From 08a0c3d536d16b5115ba6555eef72295430c93e4 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Thu, 9 Sep 2021 11:06:58 +0200 Subject: [PATCH] Built motion from commit 38dc83d4.|2.5.35 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../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/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1151 files changed, 1151 insertions(+), 1151 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f9351c3..24a53bd 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-09-09T07:45:36.288Z", + "time": "2021-09-09T09:00:06.205Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 78cf7a0..f46dcc2 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-09T07:45:36.288Z", + "time": "2021-09-09T09:00:06.205Z", "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 6923e7d..1a122af 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 _0x1b20=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','TEXT','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script'];(function(_0x1fb7cc,_0x3bd1e0){var _0xeec51=function(_0x2ee6a6){while(--_0x2ee6a6){_0x1fb7cc['push'](_0x1fb7cc['shift']());}};_0xeec51(++_0x3bd1e0);}(_0x1b20,0x66));var _0x01b2=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1b20[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0x01b2('0x0')]={'name':{'type':Sequelize[_0x01b2('0x1')],'get':function(_0x4a27f9){return this['getDataValue'](_0x01b2('0x2'));}},'action':{'type':Sequelize[_0x01b2('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x01b2('0x4'),_0x01b2('0x5'),_0x01b2('0x6'),_0x01b2('0x7'),_0x01b2('0x8'),_0x01b2('0x9'),_0x01b2('0xa'),_0x01b2('0xb')]],'msg':_0x01b2('0xc')}},'comment':_0x01b2('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x01b2('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x01b2('0xe')},'data3':{'type':Sequelize[_0x01b2('0x3')](0x1000),'comment':_0x01b2('0xf')},'data4':{'type':Sequelize[_0x01b2('0x3')](0x1000),'comments':_0x01b2('0x10')},'data5':{'type':Sequelize[_0x01b2('0x3')](0x1000),'comments':_0x01b2('0x11')},'data6':{'type':Sequelize[_0x01b2('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x01b2('0x12')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x2581=['integration','motionbar','jscripty','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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager'];(function(_0x2dbd62,_0x359933){var _0x1518d=function(_0x523267){while(--_0x523267){_0x2dbd62['push'](_0x2dbd62['shift']());}};_0x1518d(++_0x359933);}(_0x2581,0xcb));var _0x1258=function(_0x49729c,_0x4d1167){_0x49729c=_0x49729c-0x0;var _0x3b215a=_0x2581[_0x49729c];return _0x3b215a;};'use strict';var Sequelize=require(_0x1258('0x0'));module[_0x1258('0x1')]={'name':{'type':Sequelize[_0x1258('0x2')],'get':function(_0x348640){return this[_0x1258('0x3')]('action');}},'action':{'type':Sequelize[_0x1258('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1258('0x5'),_0x1258('0x6'),_0x1258('0x7'),_0x1258('0x8'),_0x1258('0x9'),_0x1258('0xa'),_0x1258('0xb'),'script']],'msg':_0x1258('0xc')}},'comment':_0x1258('0xc')},'data1':{'type':Sequelize[_0x1258('0x4')](0x1000),'comment':_0x1258('0xd')},'data2':{'type':Sequelize[_0x1258('0x4')](0x1000),'comment':_0x1258('0xe')},'data3':{'type':Sequelize[_0x1258('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x1258('0xf')},'data5':{'type':Sequelize[_0x1258('0x4')](0x1000),'comments':_0x1258('0x10')},'data6':{'type':Sequelize[_0x1258('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x1258('0x11')],'comments':_0x1258('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index aad7fba..d089f8e 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 _0xc887=['reject','save','update','then','destroy','error','name','body','find','params','Action','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','set','Content-Range','json'];(function(_0x458599,_0x2b1807){var _0x39a942=function(_0x3051a4){while(--_0x3051a4){_0x458599['push'](_0x458599['shift']());}};_0x39a942(++_0x2b1807);}(_0xc887,0x11f));var _0x7c88=function(_0x410d40,_0x564f4b){_0x410d40=_0x410d40-0x0;var _0x4895d7=_0xc887[_0x410d40];return _0x4895d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c88('0x0'));var jsonpatch=require(_0x7c88('0x1'));var rp=require(_0x7c88('0x2'));var moment=require(_0x7c88('0x3'));var BPromise=require(_0x7c88('0x4'));var Mustache=require('mustache');var util=require(_0x7c88('0x5'));var path=require(_0x7c88('0x6'));var sox=require(_0x7c88('0x7'));var csv=require('to-csv');var ejs=require(_0x7c88('0x8'));var fs=require('fs');var fs_extra=require(_0x7c88('0x9'));var _=require(_0x7c88('0xa'));var squel=require(_0x7c88('0xb'));var crypto=require('crypto');var jsforce=require(_0x7c88('0xc'));var deskjs=require(_0x7c88('0xd'));var toCsv=require(_0x7c88('0xe'));var querystring=require(_0x7c88('0xf'));var Papa=require(_0x7c88('0x10'));var Redis=require(_0x7c88('0x11'));var authService=require(_0x7c88('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7c88('0x13'));var hardwareService=require(_0x7c88('0x14'));var logger=require(_0x7c88('0x15'))(_0x7c88('0x16'));var utils=require(_0x7c88('0x17'));var config=require(_0x7c88('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c88('0x19'))['db'];function respondWithStatusCode(_0xbc9bd1,_0x188915){_0x188915=_0x188915||0xcc;return function(_0x5157fb){if(_0x5157fb){return _0xbc9bd1[_0x7c88('0x1a')](_0x188915);}return _0xbc9bd1[_0x7c88('0x1b')](_0x188915)[_0x7c88('0x1c')]();};}function respondWithResult(_0x1d0ad9,_0x4d39d0){_0x4d39d0=_0x4d39d0||0xc8;return function(_0x55cdf2){if(_0x55cdf2){return _0x1d0ad9[_0x7c88('0x1b')](_0x4d39d0)['json'](_0x55cdf2);}};}function respondWithFilteredResult(_0x3068fe,_0x1f4c60){return function(_0x3960c2){if(_0x3960c2){var _0x238585=typeof _0x1f4c60[_0x7c88('0x1d')]==='undefined'&&typeof _0x1f4c60[_0x7c88('0x1e')]===_0x7c88('0x1f');var _0x49d542=_0x3960c2['count'];var _0x19fee7=_0x238585?0x0:_0x1f4c60[_0x7c88('0x1d')];var _0x5ab382=_0x238585?_0x3960c2['count']:_0x1f4c60[_0x7c88('0x1d')]+_0x1f4c60[_0x7c88('0x1e')];var _0x4a5b3b;if(_0x5ab382>=_0x49d542){_0x5ab382=_0x49d542;_0x4a5b3b=0xc8;}else{_0x4a5b3b=0xce;}_0x3068fe[_0x7c88('0x1b')](_0x4a5b3b);return _0x3068fe[_0x7c88('0x20')](_0x7c88('0x21'),_0x19fee7+'-'+_0x5ab382+'/'+_0x49d542)[_0x7c88('0x22')](_0x3960c2);}return null;};}function patchUpdates(_0x144a99){return function(_0x401dae){try{jsonpatch['apply'](_0x401dae,_0x144a99,!![]);}catch(_0x29e017){return BPromise[_0x7c88('0x23')](_0x29e017);}return _0x401dae[_0x7c88('0x24')]();};}function saveUpdates(_0x1646a3,_0x14ba5b){return function(_0x5b14a2){if(_0x5b14a2){return _0x5b14a2[_0x7c88('0x25')](_0x1646a3)[_0x7c88('0x26')](function(_0xa60dd8){return _0xa60dd8;});}return null;};}function removeEntity(_0x1050a6,_0x87117c){return function(_0x343371){if(_0x343371){return _0x343371[_0x7c88('0x27')]()[_0x7c88('0x26')](function(){_0x1050a6[_0x7c88('0x1b')](0xcc)[_0x7c88('0x1c')]();});}};}function handleEntityNotFound(_0x5bbedc,_0x3f5439){return function(_0x4e9237){if(!_0x4e9237){_0x5bbedc['sendStatus'](0x194);}return _0x4e9237;};}function handleError(_0x20ca1a,_0x26d284){_0x26d284=_0x26d284||0x1f4;return function(_0x1c41df){logger[_0x7c88('0x28')](_0x1c41df['stack']);if(_0x1c41df[_0x7c88('0x29')]){delete _0x1c41df['name'];}_0x20ca1a[_0x7c88('0x1b')](_0x26d284)['send'](_0x1c41df);};}exports[_0x7c88('0x25')]=function(_0x334948,_0x4dcc7f){if(_0x334948[_0x7c88('0x2a')]['id']){delete _0x334948[_0x7c88('0x2a')]['id'];}return db['Action'][_0x7c88('0x2b')]({'where':{'id':_0x334948[_0x7c88('0x2c')]['id']}})[_0x7c88('0x26')](handleEntityNotFound(_0x4dcc7f,null))['then'](saveUpdates(_0x334948[_0x7c88('0x2a')],null))[_0x7c88('0x26')](respondWithResult(_0x4dcc7f,null))['catch'](handleError(_0x4dcc7f,null));};exports[_0x7c88('0x27')]=function(_0x215a56,_0x37ec42){return db[_0x7c88('0x2d')]['find']({'where':{'id':_0x215a56[_0x7c88('0x2c')]['id']}})[_0x7c88('0x26')](handleEntityNotFound(_0x37ec42,null))[_0x7c88('0x26')](removeEntity(_0x37ec42,null))['catch'](handleError(_0x37ec42,null));}; \ No newline at end of file +var _0x60f0=['Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','name','send','body','find','params','catch'];(function(_0x1fa98d,_0x3ba2b2){var _0x26f5d8=function(_0x1d2030){while(--_0x1d2030){_0x1fa98d['push'](_0x1fa98d['shift']());}};_0x26f5d8(++_0x3ba2b2);}(_0x60f0,0xec));var _0x060f=function(_0x261f69,_0x7e0602){_0x261f69=_0x261f69-0x0;var _0x5bdbb6=_0x60f0[_0x261f69];return _0x5bdbb6;};'use strict';var emlformat=require(_0x060f('0x0'));var rimraf=require(_0x060f('0x1'));var zipdir=require(_0x060f('0x2'));var jsonpatch=require(_0x060f('0x3'));var rp=require(_0x060f('0x4'));var moment=require(_0x060f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x060f('0x6'));var util=require(_0x060f('0x7'));var path=require(_0x060f('0x8'));var sox=require(_0x060f('0x9'));var csv=require(_0x060f('0xa'));var ejs=require(_0x060f('0xb'));var fs=require('fs');var fs_extra=require(_0x060f('0xc'));var _=require(_0x060f('0xd'));var squel=require(_0x060f('0xe'));var crypto=require(_0x060f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x060f('0x10'));var toCsv=require(_0x060f('0xa'));var querystring=require(_0x060f('0x11'));var Papa=require(_0x060f('0x12'));var Redis=require(_0x060f('0x13'));var authService=require(_0x060f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x060f('0x15'));var hardwareService=require(_0x060f('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x060f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x060f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f2e15,_0x49b3ac){_0x49b3ac=_0x49b3ac||0xcc;return function(_0x1199b9){if(_0x1199b9){return _0x1f2e15[_0x060f('0x19')](_0x49b3ac);}return _0x1f2e15[_0x060f('0x1a')](_0x49b3ac)[_0x060f('0x1b')]();};}function respondWithResult(_0xff6d8,_0x126e5d){_0x126e5d=_0x126e5d||0xc8;return function(_0x2e2851){if(_0x2e2851){return _0xff6d8['status'](_0x126e5d)[_0x060f('0x1c')](_0x2e2851);}};}function respondWithFilteredResult(_0x4a349d,_0x31cd2d){return function(_0x6e98ef){if(_0x6e98ef){var _0x473e76=typeof _0x31cd2d['offset']===_0x060f('0x1d')&&typeof _0x31cd2d[_0x060f('0x1e')]===_0x060f('0x1d');var _0x4d25fa=_0x6e98ef[_0x060f('0x1f')];var _0x485aaf=_0x473e76?0x0:_0x31cd2d[_0x060f('0x20')];var _0x164028=_0x473e76?_0x6e98ef[_0x060f('0x1f')]:_0x31cd2d['offset']+_0x31cd2d['limit'];var _0x26e895;if(_0x164028>=_0x4d25fa){_0x164028=_0x4d25fa;_0x26e895=0xc8;}else{_0x26e895=0xce;}_0x4a349d[_0x060f('0x1a')](_0x26e895);return _0x4a349d[_0x060f('0x21')](_0x060f('0x22'),_0x485aaf+'-'+_0x164028+'/'+_0x4d25fa)['json'](_0x6e98ef);}return null;};}function patchUpdates(_0x1f7bb6){return function(_0x52c397){try{jsonpatch['apply'](_0x52c397,_0x1f7bb6,!![]);}catch(_0x1b9ef0){return BPromise[_0x060f('0x23')](_0x1b9ef0);}return _0x52c397['save']();};}function saveUpdates(_0x4e783b,_0x5d3f78){return function(_0x23baf4){if(_0x23baf4){return _0x23baf4[_0x060f('0x24')](_0x4e783b)[_0x060f('0x25')](function(_0x3be490){return _0x3be490;});}return null;};}function removeEntity(_0x93a692,_0x183f3c){return function(_0x43bede){if(_0x43bede){return _0x43bede[_0x060f('0x26')]()[_0x060f('0x25')](function(){_0x93a692['status'](0xcc)[_0x060f('0x1b')]();});}};}function handleEntityNotFound(_0x1fded6,_0x86fd14){return function(_0x18f91f){if(!_0x18f91f){_0x1fded6[_0x060f('0x19')](0x194);}return _0x18f91f;};}function handleError(_0x58c5b8,_0x1d9e9b){_0x1d9e9b=_0x1d9e9b||0x1f4;return function(_0x53c9b3){logger[_0x060f('0x27')](_0x53c9b3['stack']);if(_0x53c9b3['name']){delete _0x53c9b3[_0x060f('0x28')];}_0x58c5b8[_0x060f('0x1a')](_0x1d9e9b)[_0x060f('0x29')](_0x53c9b3);};}exports[_0x060f('0x24')]=function(_0x377320,_0x426f74){if(_0x377320[_0x060f('0x2a')]['id']){delete _0x377320[_0x060f('0x2a')]['id'];}return db['Action'][_0x060f('0x2b')]({'where':{'id':_0x377320[_0x060f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x426f74,null))[_0x060f('0x25')](saveUpdates(_0x377320[_0x060f('0x2a')],null))[_0x060f('0x25')](respondWithResult(_0x426f74,null))[_0x060f('0x2d')](handleError(_0x426f74,null));};exports[_0x060f('0x26')]=function(_0x2b2c42,_0x1ccadd){return db[_0x060f('0x2e')][_0x060f('0x2b')]({'where':{'id':_0x2b2c42[_0x060f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1ccadd,null))[_0x060f('0x25')](removeEntity(_0x1ccadd,null))['catch'](handleError(_0x1ccadd,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 9e79cd0..20ec6dd 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 _0x1543=['./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58916b,_0x43fc5d){var _0x238322=function(_0x5cdf4a){while(--_0x5cdf4a){_0x58916b['push'](_0x58916b['shift']());}};_0x238322(++_0x43fc5d);}(_0x1543,0x1c5));var _0x3154=function(_0x976d7e,_0x1124bd){_0x976d7e=_0x976d7e-0x0;var _0x4cccaf=_0x1543[_0x976d7e];return _0x4cccaf;};'use strict';var _=require(_0x3154('0x0'));var util=require(_0x3154('0x1'));var logger=require(_0x3154('0x2'))(_0x3154('0x3'));var moment=require(_0x3154('0x4'));var BPromise=require(_0x3154('0x5'));var rp=require(_0x3154('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3154('0x7'));var config=require(_0x3154('0x8'));var attributes=require(_0x3154('0x9'));module[_0x3154('0xa')]=function(_0x37c77d,_0x331b37){return _0x37c77d[_0x3154('0xb')](_0x3154('0xc'),attributes,{'tableName':_0x3154('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b52=['./action.attributes','define','Action','tools_actions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x7b590b,_0x3db80b){var _0x326f58=function(_0x39dbe5){while(--_0x39dbe5){_0x7b590b['push'](_0x7b590b['shift']());}};_0x326f58(++_0x3db80b);}(_0x5b52,0xad));var _0x25b5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5b52[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x25b5('0x0'));var util=require(_0x25b5('0x1'));var logger=require('../../config/logger')(_0x25b5('0x2'));var moment=require(_0x25b5('0x3'));var BPromise=require(_0x25b5('0x4'));var rp=require(_0x25b5('0x5'));var fs=require('fs');var path=require(_0x25b5('0x6'));var rimraf=require(_0x25b5('0x7'));var config=require(_0x25b5('0x8'));var attributes=require(_0x25b5('0x9'));module['exports']=function(_0x22a115,_0x547856){return _0x22a115[_0x25b5('0xa')](_0x25b5('0xb'),attributes,{'tableName':_0x25b5('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 89025f6..a3c42ea 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x39ed2a,_0x2d67b2){var _0x51b63a=function(_0x3b9305){while(--_0x3b9305){_0x39ed2a['push'](_0x39ed2a['shift']());}};_0x51b63a(++_0x2d67b2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0x5fc3[_0x511b76];return _0x5424ff;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x684225,_0x516e52){var _0x2060f7=function(_0x21fb0d){while(--_0x21fb0d){_0x684225['push'](_0x684225['shift']());}};_0x2060f7(++_0x516e52);}(_0xabce,0x103));var _0xeabc=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xabce[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3ef0f94..47eaa65 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 _0xd281=['fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','util','connect-timeout','Router'];(function(_0x27d64b,_0x52a145){var _0x3aa288=function(_0x13be73){while(--_0x13be73){_0x27d64b['push'](_0x27d64b['shift']());}};_0x3aa288(++_0x52a145);}(_0xd281,0x189));var _0x1d28=function(_0x1014b4,_0x2b345f){_0x1014b4=_0x1014b4-0x0;var _0x128ec5=_0xd281[_0x1014b4];return _0x128ec5;};'use strict';var multer=require('multer');var util=require(_0x1d28('0x0'));var path=require('path');var timeout=require(_0x1d28('0x1'));var express=require('express');var router=express[_0x1d28('0x2')]();var fs_extra=require(_0x1d28('0x3'));var auth=require(_0x1d28('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1d28('0x5'));var controller=require(_0x1d28('0x6'));router[_0x1d28('0x7')](_0x1d28('0x8'),auth[_0x1d28('0x9')](),controller['update']);router[_0x1d28('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1d28('0xb')]);module['exports']=router; \ No newline at end of file +var _0x4d86=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','destroy','exports','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4d86,0x19f));var _0x64d8=function(_0x313e67,_0x39dce7){_0x313e67=_0x313e67-0x0;var _0x49a3da=_0x4d86[_0x313e67];return _0x49a3da;};'use strict';var multer=require('multer');var util=require(_0x64d8('0x0'));var path=require(_0x64d8('0x1'));var timeout=require(_0x64d8('0x2'));var express=require(_0x64d8('0x3'));var router=express[_0x64d8('0x4')]();var fs_extra=require(_0x64d8('0x5'));var auth=require(_0x64d8('0x6'));var interaction=require(_0x64d8('0x7'));var config=require(_0x64d8('0x8'));var controller=require(_0x64d8('0x9'));router[_0x64d8('0xa')]('/:id',auth[_0x64d8('0xb')](),controller[_0x64d8('0xc')]);router[_0x64d8('0xd')]('/:id',auth[_0x64d8('0xb')](),controller[_0x64d8('0xe')]);module[_0x64d8('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 4ddd879..5095202 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x58c654,_0x56f774){var _0x1b1164=function(_0x4ed7db){while(--_0x4ed7db){_0x58c654['push'](_0x58c654['shift']());}};_0x1b1164(++_0x56f774);}(_0xac9d,0x14d));var _0xdac9=function(_0x58952f,_0xeed25f){_0x58952f=_0x58952f-0x0;var _0x3217ca=_0xac9d[_0x58952f];return _0x3217ca;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file +var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x21331a,_0x57fc48){var _0x325c55=function(_0x770dfa){while(--_0x770dfa){_0x21331a['push'](_0x21331a['shift']());}};_0x325c55(++_0x57fc48);}(_0x5fab,0x177));var _0xb5fa=function(_0x3e4006,_0x6690ec){_0x3e4006=_0x3e4006-0x0;var _0x2553c2=_0x5fab[_0x3e4006];return _0x2553c2;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 56c29b9..3b65825 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 _0xfc6e=['parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','operator','select','from','table','MetricId','metric','field','clone','output','web','fullPath','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','QueryTypes','run','runReport','GROUP_CONCAT(%s)','keyBy','eml-format','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','create','body','user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','function','format','replace','groupBy','order','orderBy','DESC','alias','joins'];(function(_0x8d4c3e,_0x4e89e7){var _0x8b3834=function(_0x168830){while(--_0x168830){_0x8d4c3e['push'](_0x8d4c3e['shift']());}};_0x8b3834(++_0x4e89e7);}(_0xfc6e,0x17c));var _0xefc6=function(_0xe7d24e,_0x235022){_0xe7d24e=_0xe7d24e-0x0;var _0x42c6e3=_0xfc6e[_0xe7d24e];return _0x42c6e3;};'use strict';var emlformat=require(_0xefc6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xefc6('0x1'));var rp=require('request-promise');var moment=require(_0xefc6('0x2'));var BPromise=require(_0xefc6('0x3'));var Mustache=require('mustache');var util=require(_0xefc6('0x4'));var path=require(_0xefc6('0x5'));var sox=require(_0xefc6('0x6'));var csv=require('to-csv');var ejs=require(_0xefc6('0x7'));var fs=require('fs');var fs_extra=require(_0xefc6('0x8'));var _=require(_0xefc6('0x9'));var squel=require(_0xefc6('0xa'));var crypto=require('crypto');var jsforce=require(_0xefc6('0xb'));var deskjs=require(_0xefc6('0xc'));var toCsv=require(_0xefc6('0xd'));var querystring=require(_0xefc6('0xe'));var Papa=require(_0xefc6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xefc6('0x10'));var as=require(_0xefc6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefc6('0x12'))('api');var utils=require(_0xefc6('0x13'));var config=require(_0xefc6('0x14'));var licenseUtil=require(_0xefc6('0x15'));var db=require(_0xefc6('0x16'))['db'];var dbH=require(_0xefc6('0x16'))[_0xefc6('0x17')];function respondWithStatusCode(_0xc902e9,_0x397dc4){_0x397dc4=_0x397dc4||0xcc;return function(_0x4a6878){if(_0x4a6878){return _0xc902e9['sendStatus'](_0x397dc4);}return _0xc902e9['status'](_0x397dc4)[_0xefc6('0x18')]();};}function respondWithResult(_0x82677,_0x436c40){_0x436c40=_0x436c40||0xc8;return function(_0x37e7d7){if(_0x37e7d7){return _0x82677[_0xefc6('0x19')](_0x436c40)[_0xefc6('0x1a')](_0x37e7d7);}};}function respondWithFilteredResult(_0x112b6f,_0x2abeae){return function(_0x2c6302){if(_0x2c6302){var _0x7da3db=typeof _0x2abeae['offset']===_0xefc6('0x1b')&&typeof _0x2abeae[_0xefc6('0x1c')]===_0xefc6('0x1b');var _0x39ce53=_0x2c6302[_0xefc6('0x1d')];var _0x982c87=_0x7da3db?0x0:_0x2abeae[_0xefc6('0x1e')];var _0x5a0f8b=_0x7da3db?_0x2c6302['count']:_0x2abeae[_0xefc6('0x1e')]+_0x2abeae[_0xefc6('0x1c')];var _0x3c43e3;if(_0x5a0f8b>=_0x39ce53){_0x5a0f8b=_0x39ce53;_0x3c43e3=0xc8;}else{_0x3c43e3=0xce;}_0x112b6f[_0xefc6('0x19')](_0x3c43e3);return _0x112b6f[_0xefc6('0x1f')](_0xefc6('0x20'),_0x982c87+'-'+_0x5a0f8b+'/'+_0x39ce53)[_0xefc6('0x1a')](_0x2c6302);}return null;};}function patchUpdates(_0x1da170){return function(_0x5a2e3e){try{jsonpatch['apply'](_0x5a2e3e,_0x1da170,!![]);}catch(_0x4d3ea7){return BPromise[_0xefc6('0x21')](_0x4d3ea7);}return _0x5a2e3e['save']();};}function saveUpdates(_0x480a85,_0x730464){return function(_0x231799){if(_0x231799){return _0x231799[_0xefc6('0x22')](_0x480a85)[_0xefc6('0x23')](function(_0x372cb3){return _0x372cb3;});}return null;};}function removeEntity(_0x50e2dd,_0x3c6429){return function(_0x327e0c){if(_0x327e0c){return _0x327e0c['destroy']()[_0xefc6('0x23')](function(){var _0x51597c=_0x327e0c[_0xefc6('0x24')]({'plain':!![]});var _0x3f26be='CustomReports';return db[_0xefc6('0x25')][_0xefc6('0x26')]({'where':{'type':_0x3f26be,'resourceId':_0x51597c['id']}})[_0xefc6('0x23')](function(){return _0x327e0c;});})[_0xefc6('0x23')](function(){_0x50e2dd[_0xefc6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20bc20,_0x5642cc){return function(_0x16b617){if(!_0x16b617){_0x20bc20[_0xefc6('0x27')](0x194);}return _0x16b617;};}function handleError(_0x22438f,_0x2ccfa0){_0x2ccfa0=_0x2ccfa0||0x1f4;return function(_0x5d0859){logger['error'](_0x5d0859[_0xefc6('0x28')]);if(_0x5d0859[_0xefc6('0x29')]){delete _0x5d0859[_0xefc6('0x29')];}_0x22438f['status'](_0x2ccfa0)[_0xefc6('0x2a')](_0x5d0859);};}exports[_0xefc6('0x2b')]=function(_0x41f426,_0x3c8854){var _0x3f7f57={},_0xaaf8e8={},_0x76779f={'count':0x0,'rows':[]};var _0x58db6d=_[_0xefc6('0x2c')](db[_0xefc6('0x2d')]['rawAttributes'],function(_0x33280b){return{'name':_0x33280b[_0xefc6('0x2e')],'type':_0x33280b[_0xefc6('0x2f')][_0xefc6('0x30')]};});_0xaaf8e8[_0xefc6('0x31')]=_['map'](_0x58db6d,_0xefc6('0x29'));_0xaaf8e8['query']=_[_0xefc6('0x32')](_0x41f426['query']);_0xaaf8e8[_0xefc6('0x33')]=_[_0xefc6('0x34')](_0xaaf8e8[_0xefc6('0x31')],_0xaaf8e8[_0xefc6('0x35')]);_0x3f7f57[_0xefc6('0x36')]=_[_0xefc6('0x34')](_0xaaf8e8[_0xefc6('0x31')],qs[_0xefc6('0x37')](_0x41f426['query'][_0xefc6('0x37')]));_0x3f7f57['attributes']=_0x3f7f57[_0xefc6('0x36')][_0xefc6('0x38')]?_0x3f7f57['attributes']:_0xaaf8e8['model'];if(!_0x41f426[_0xefc6('0x35')][_0xefc6('0x39')](_0xefc6('0x3a'))){_0x3f7f57['limit']=qs[_0xefc6('0x1c')](_0x41f426['query'][_0xefc6('0x1c')]);_0x3f7f57['offset']=qs[_0xefc6('0x1e')](_0x41f426[_0xefc6('0x35')][_0xefc6('0x1e')]);}_0x3f7f57['order']=qs[_0xefc6('0x3b')](_0x41f426[_0xefc6('0x35')][_0xefc6('0x3b')]);_0x3f7f57[_0xefc6('0x3c')]=qs[_0xefc6('0x33')](_[_0xefc6('0x3d')](_0x41f426['query'],_0xaaf8e8[_0xefc6('0x33')]),_0x58db6d);if(_0x41f426[_0xefc6('0x35')][_0xefc6('0x3e')]){_0x3f7f57[_0xefc6('0x3c')]=_[_0xefc6('0x3f')](_0x3f7f57['where'],{'$or':_['map'](_0x58db6d,function(_0x1c63fa){if(_0x1c63fa[_0xefc6('0x2f')]!==_0xefc6('0x40')){var _0x3d0fd3={};_0x3d0fd3[_0x1c63fa['name']]={'$like':'%'+_0x41f426[_0xefc6('0x35')][_0xefc6('0x3e')]+'%'};return _0x3d0fd3;}})});}_0x3f7f57=_['merge']({},_0x3f7f57,_0x41f426[_0xefc6('0x41')]);var _0x557b80={'where':_0x3f7f57[_0xefc6('0x3c')]};return db[_0xefc6('0x2d')][_0xefc6('0x1d')](_0x557b80)[_0xefc6('0x23')](function(_0x33eff9){_0x76779f[_0xefc6('0x1d')]=_0x33eff9;if(_0x41f426['query'][_0xefc6('0x42')]){_0x3f7f57['include']=[{'all':!![]}];}return db[_0xefc6('0x2d')][_0xefc6('0x43')](_0x3f7f57);})[_0xefc6('0x23')](function(_0xdd331a){_0x76779f[_0xefc6('0x44')]=_0xdd331a;return _0x76779f;})[_0xefc6('0x23')](respondWithFilteredResult(_0x3c8854,_0x3f7f57))[_0xefc6('0x45')](handleError(_0x3c8854,null));};exports['show']=function(_0x4ba467,_0x5a9cd8){var _0x2f0efb={'raw':![],'where':{'id':_0x4ba467[_0xefc6('0x46')]['id']}},_0x201540={};_0x201540[_0xefc6('0x31')]=_[_0xefc6('0x32')](db[_0xefc6('0x2d')]['rawAttributes']);_0x201540[_0xefc6('0x35')]=_[_0xefc6('0x32')](_0x4ba467[_0xefc6('0x35')]);_0x201540['filters']=_['intersection'](_0x201540[_0xefc6('0x31')],_0x201540['query']);_0x2f0efb['attributes']=_['intersection'](_0x201540['model'],qs[_0xefc6('0x37')](_0x4ba467[_0xefc6('0x35')][_0xefc6('0x37')]));_0x2f0efb[_0xefc6('0x36')]=_0x2f0efb[_0xefc6('0x36')][_0xefc6('0x38')]?_0x2f0efb[_0xefc6('0x36')]:_0x201540[_0xefc6('0x31')];if(_0x4ba467[_0xefc6('0x35')][_0xefc6('0x42')]){_0x2f0efb[_0xefc6('0x47')]=[{'all':!![]}];}_0x2f0efb=_[_0xefc6('0x3f')]({},_0x2f0efb,_0x4ba467[_0xefc6('0x41')]);return db['AnalyticCustomReport']['find'](_0x2f0efb)[_0xefc6('0x23')](handleEntityNotFound(_0x5a9cd8,null))['then'](respondWithResult(_0x5a9cd8,null))[_0xefc6('0x45')](handleError(_0x5a9cd8,null));};exports[_0xefc6('0x48')]=function(_0x41cc68,_0x2de769){return db[_0xefc6('0x2d')][_0xefc6('0x48')](_0x41cc68[_0xefc6('0x49')],{})[_0xefc6('0x23')](function(_0x53c1c3){var _0x52ebb8=_0x41cc68[_0xefc6('0x4a')][_0xefc6('0x24')]({'plain':!![]});if(!_0x52ebb8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52ebb8[_0xefc6('0x4b')]===_0xefc6('0x4a')){var _0x4b2e45=_0x53c1c3['get']({'plain':!![]});var _0x3e693e=_0xefc6('0x4c');return db[_0xefc6('0x4d')][_0xefc6('0x4e')]({'where':{'name':_0x3e693e,'userProfileId':_0x52ebb8[_0xefc6('0x4f')]},'raw':!![]})[_0xefc6('0x23')](function(_0x5d166a){if(_0x5d166a&&_0x5d166a[_0xefc6('0x50')]===0x0){return db[_0xefc6('0x25')]['create']({'name':_0x4b2e45[_0xefc6('0x29')],'resourceId':_0x4b2e45['id'],'type':_0xefc6('0x51'),'sectionId':_0x5d166a['id']},{})[_0xefc6('0x23')](function(){return _0x53c1c3;});}else{return _0x53c1c3;}})[_0xefc6('0x45')](function(_0x18b9ab){logger[_0xefc6('0x52')](_0xefc6('0x53'),_0x18b9ab);throw _0x18b9ab;});}return _0x53c1c3;})['then'](respondWithResult(_0x2de769,0xc9))[_0xefc6('0x45')](handleError(_0x2de769,null));};exports['update']=function(_0x2e06b0,_0x2a9e1a){if(_0x2e06b0['body']['id']){delete _0x2e06b0['body']['id'];}return db[_0xefc6('0x2d')]['find']({'where':{'id':_0x2e06b0[_0xefc6('0x46')]['id']}})[_0xefc6('0x23')](handleEntityNotFound(_0x2a9e1a,null))['then'](saveUpdates(_0x2e06b0[_0xefc6('0x49')],null))[_0xefc6('0x23')](respondWithResult(_0x2a9e1a,null))['catch'](handleError(_0x2a9e1a,null));};exports[_0xefc6('0x26')]=function(_0x5872bf,_0x4d1ab0){return db[_0xefc6('0x2d')][_0xefc6('0x4e')]({'where':{'id':_0x5872bf[_0xefc6('0x46')]['id']}})[_0xefc6('0x23')](handleEntityNotFound(_0x4d1ab0,null))[_0xefc6('0x23')](removeEntity(_0x4d1ab0,null))[_0xefc6('0x45')](handleError(_0x4d1ab0,null));};exports[_0xefc6('0x54')]=function(_0x5873ea,_0x5a6864){var _0x137166=0xa;var _0x32e352=[_0xefc6('0x55'),_0xefc6('0x56'),_0xefc6('0x57'),'cross_join'];var _0x4d29e6={'SUM':_0xefc6('0x58'),'COUNT':_0xefc6('0x59'),'COUNT DISTINCT':_0xefc6('0x5a'),'MAX':_0xefc6('0x5b'),'MIN':_0xefc6('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xefc6('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x325d7e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xefc6('0x5e'),'HOUR':_0xefc6('0x5f'),'ROUND':_0xefc6('0x60'),'UNIX_TIMESTAMP':_0xefc6('0x61')};var _0x581e40=function(_0x371dbd){return!_[_0xefc6('0x62')]([_0xefc6('0x63'),_0xefc6('0x64'),_0xefc6('0x65'),_0xefc6('0x66')],_0x371dbd);};var _0x551a4d=function(_0x3c6e18){if(!_0x3c6e18||!_0x3c6e18[_0xefc6('0x67')][_0xefc6('0x38')]){return'';}for(var _0x2c0969='(',_0x5e8eca=0x0;_0x5e8eca<_0x3c6e18[_0xefc6('0x67')]['length'];_0x5e8eca+=0x1){_0x5e8eca>0x0&&(_0x2c0969+='\x20'+_0x3c6e18['operator']+'\x20');_0x2c0969+=_0x3c6e18[_0xefc6('0x67')][_0x5e8eca][_0xefc6('0x68')]?_0x551a4d(_0x3c6e18['rules'][_0x5e8eca][_0xefc6('0x68')]):_0x3c6e18[_0xefc6('0x67')][_0x5e8eca]['field']+'\x20'+_0x3c6e18[_0xefc6('0x67')][_0x5e8eca][_0xefc6('0x69')]+(_0x581e40(_0x3c6e18[_0xefc6('0x67')][_0x5e8eca][_0xefc6('0x69')])?'\x20'+_0x3c6e18[_0xefc6('0x67')][_0x5e8eca][_0xefc6('0x6a')]:'');}return _0x2c0969+')';};var _0x52e453={'where':{'id':_0x5873ea[_0xefc6('0x46')]['id']}},_0x4cd907,_0x2b5c97,_0x56b619,_0x5eecf7,_0x2c552d;_0x52e453=_[_0xefc6('0x3f')]({},_0x52e453,_0x5873ea[_0xefc6('0x41')]);return db[_0xefc6('0x2d')][_0xefc6('0x4e')](_0x52e453)[_0xefc6('0x23')](function(_0x33e3d9){if(_0x33e3d9){_0x4cd907=_0x33e3d9;return _0x33e3d9[_0xefc6('0x6b')]();}return null;})[_0xefc6('0x23')](function(_0x405ccc){if(_0x405ccc){if(!_0x405ccc[_0xefc6('0x38')]){throw new db[(_0xefc6('0x6c'))][(_0xefc6('0x6d'))](_0xefc6('0x6e'),0x193);}_0x2b5c97=_0x405ccc;return db[_0xefc6('0x6f')]['findAll']({'raw':!![]});}return null;})[_0xefc6('0x23')](function(_0x7eca15){if(_0x7eca15){_0x56b619=_['keyBy'](_0x7eca15,'id');var _0x54c107;var _0x2f6f37=squel['select']();_0x2f6f37['from'](_0x4cd907['table']);for(var _0x275a94=0x0;_0x275a94<_0x2b5c97[_0xefc6('0x38')];_0x275a94+=0x1){_0x54c107=_0x2b5c97[_0x275a94]['MetricId']?_0x56b619[_0x2b5c97[_0x275a94]['MetricId']]['metric']:_0x2b5c97[_0x275a94]['field'];_0x54c107=_0x2b5c97[_0x275a94][_0xefc6('0x70')]?_['replace'](_0x4d29e6[_0x2b5c97[_0x275a94][_0xefc6('0x70')]],'%s',_0x54c107):_0x54c107;_0x54c107=_0x2b5c97[_0x275a94][_0xefc6('0x71')]?_[_0xefc6('0x72')](_0x325d7e[_0x2b5c97[_0x275a94]['format']],'%s',_0x54c107):_0x54c107;if(_0x2b5c97[_0x275a94][_0xefc6('0x73')]){_0x2f6f37[_0xefc6('0x68')](_0x54c107);}_0x2b5c97[_0x275a94]['orderBy']&&_0x2f6f37[_0xefc6('0x74')](_0x54c107,_0x2b5c97[_0x275a94][_0xefc6('0x75')]===_0xefc6('0x76')?![]:!![]);_0x2f6f37['field'](_0x54c107,_0x2b5c97[_0x275a94][_0xefc6('0x77')]||_0x54c107);}if(_0x4cd907[_0xefc6('0x78')]){_0x4cd907[_0xefc6('0x78')]=JSON[_0xefc6('0x79')](_0x4cd907[_0xefc6('0x78')]);for(var _0x75012d=0x0;_0x75012d<_0x4cd907[_0xefc6('0x78')][_0xefc6('0x38')];_0x75012d+=0x1){if(_0x4cd907[_0xefc6('0x78')][_0x75012d]['type']&&_[_0xefc6('0x62')](_0x32e352,_0x4cd907[_0xefc6('0x78')][_0x75012d][_0xefc6('0x2f')])&&_0x4cd907[_0xefc6('0x78')][_0x75012d][_0xefc6('0x7a')]&&_0x4cd907[_0xefc6('0x78')][_0x75012d][_0xefc6('0x7b')]&&_0x4cd907[_0xefc6('0x78')][_0x75012d][_0xefc6('0x7c')]){_0x2f6f37[_0x4cd907[_0xefc6('0x78')][_0x75012d][_0xefc6('0x2f')]](_0x4cd907[_0xefc6('0x78')][_0x75012d]['foreignTable'],null,util[_0xefc6('0x71')](_0xefc6('0x7d'),_0x4cd907['table'],_0x4cd907[_0xefc6('0x78')][_0x75012d][_0xefc6('0x7a')],_0x4cd907['joins'][_0x75012d]['foreignTable'],_0x4cd907[_0xefc6('0x78')][_0x75012d][_0xefc6('0x7c')]));}}}if(_0x4cd907[_0xefc6('0x7e')]){_0x4cd907[_0xefc6('0x7e')]=JSON[_0xefc6('0x79')](_0x4cd907[_0xefc6('0x7e')]);_0x2f6f37[_0xefc6('0x3c')](_0x551a4d(_0x4cd907['conditions'][_0xefc6('0x68')]));}_0x2c552d=_0x2f6f37['clone']();_0x2f6f37[_0xefc6('0x1c')](_0x137166);_0x2f6f37['offset'](0x0);logger[_0xefc6('0x7f')](_0xefc6('0x80'),_0x2f6f37[_0xefc6('0x81')]());return dbH[_0xefc6('0x82')]['query'](_0x2f6f37[_0xefc6('0x81')](),{'type':dbH['sequelize']['QueryTypes'][_0xefc6('0x83')]});}})[_0xefc6('0x23')](respondWithResult(_0x5a6864,null))[_0xefc6('0x45')](handleError(_0x5a6864,null));};function runReport(_0x297615,_0x3a1bb6,_0x3ab9b0){var _0x4b5ec0=_0x3a1bb6[_0xefc6('0x29')];var _0x22316b=0xa;var _0xd5ebe8=['join',_0xefc6('0x56'),_0xefc6('0x57'),_0xefc6('0x84')];var _0x4deeef={'SUM':_0xefc6('0x58'),'COUNT':_0xefc6('0x59'),'COUNT DISTINCT':_0xefc6('0x5a'),'MAX':_0xefc6('0x5b'),'MIN':'MIN(%s)','AVG':_0xefc6('0x85'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xefc6('0x5d'),'GROUP_CONCAT DESC':_0xefc6('0x86')};var _0x395bec={'SEC_TO_TIME':_0xefc6('0x87'),'DATE':'DATE(%s)','HOUR':_0xefc6('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xefc6('0x61')};var _0x26aa99=function(_0x272d09){return!_[_0xefc6('0x62')](['IS\x20NULL',_0xefc6('0x64'),_0xefc6('0x65'),'IS\x20NOT\x20EMPTY'],_0x272d09);};var _0x2fd583=function(_0x20996e){if(!_0x20996e||!_0x20996e['rules']['length']){return'';}for(var _0x10177c='(',_0x3dcae2=0x0;_0x3dcae2<_0x20996e[_0xefc6('0x67')]['length'];_0x3dcae2+=0x1){_0x3dcae2>0x0&&(_0x10177c+='\x20'+_0x20996e[_0xefc6('0x88')]+'\x20');_0x10177c+=_0x20996e[_0xefc6('0x67')][_0x3dcae2][_0xefc6('0x68')]?_0x2fd583(_0x20996e['rules'][_0x3dcae2][_0xefc6('0x68')]):_0x20996e[_0xefc6('0x67')][_0x3dcae2]['field']+'\x20'+_0x20996e[_0xefc6('0x67')][_0x3dcae2][_0xefc6('0x69')]+(_0x26aa99(_0x20996e['rules'][_0x3dcae2][_0xefc6('0x69')])?'\x20'+_0x20996e[_0xefc6('0x67')][_0x3dcae2]['value']:'');}return _0x10177c+')';};var _0x5c379e={'where':{'id':_0x297615['id']}},_0x4c891b,_0x481433,_0x3bee22,_0x4b4f67,_0x50ed81;_0x5c379e=_['merge']({},_0x5c379e,_0x3ab9b0);return db['AnalyticCustomReport'][_0xefc6('0x4e')](_0x5c379e)['then'](function(_0x16524d){if(_0x16524d){_0x4c891b=_0x16524d;return _0x16524d[_0xefc6('0x6b')]();}return null;})[_0xefc6('0x23')](function(_0x603775){if(_0x603775){if(!_0x603775['length']){throw new db[(_0xefc6('0x6c'))][(_0xefc6('0x6d'))](_0xefc6('0x6e'),0x193);}_0x481433=_0x603775;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x380068){if(_0x380068){_0x3bee22=_['keyBy'](_0x380068,'id');var _0x3c5839;var _0x4c028e=squel[_0xefc6('0x89')]();_0x4c028e[_0xefc6('0x8a')](_0x4c891b[_0xefc6('0x8b')]);for(var _0x3aa5b9=0x0;_0x3aa5b9<_0x481433['length'];_0x3aa5b9+=0x1){_0x3c5839=_0x481433[_0x3aa5b9][_0xefc6('0x8c')]?_0x3bee22[_0x481433[_0x3aa5b9][_0xefc6('0x8c')]][_0xefc6('0x8d')]:_0x481433[_0x3aa5b9]['field'];_0x3c5839=_0x481433[_0x3aa5b9][_0xefc6('0x70')]?_[_0xefc6('0x72')](_0x4deeef[_0x481433[_0x3aa5b9][_0xefc6('0x70')]],'%s',_0x3c5839):_0x3c5839;_0x3c5839=_0x481433[_0x3aa5b9]['format']?_[_0xefc6('0x72')](_0x395bec[_0x481433[_0x3aa5b9][_0xefc6('0x71')]],'%s',_0x3c5839):_0x3c5839;if(_0x481433[_0x3aa5b9][_0xefc6('0x73')]){_0x4c028e['group'](_0x3c5839);}_0x481433[_0x3aa5b9][_0xefc6('0x75')]&&_0x4c028e[_0xefc6('0x74')](_0x3c5839,_0x481433[_0x3aa5b9][_0xefc6('0x75')]===_0xefc6('0x76')?![]:!![]);_0x4c028e[_0xefc6('0x8e')](_0x3c5839,_0x481433[_0x3aa5b9][_0xefc6('0x77')]||_0x3c5839);}if(_0x4c891b[_0xefc6('0x78')]){_0x4c891b[_0xefc6('0x78')]=JSON[_0xefc6('0x79')](_0x4c891b[_0xefc6('0x78')]);for(var _0x4a9a5b=0x0;_0x4a9a5b<_0x4c891b[_0xefc6('0x78')][_0xefc6('0x38')];_0x4a9a5b+=0x1){if(_0x4c891b[_0xefc6('0x78')][_0x4a9a5b][_0xefc6('0x2f')]&&_['includes'](_0xd5ebe8,_0x4c891b[_0xefc6('0x78')][_0x4a9a5b][_0xefc6('0x2f')])&&_0x4c891b[_0xefc6('0x78')][_0x4a9a5b][_0xefc6('0x7a')]&&_0x4c891b['joins'][_0x4a9a5b][_0xefc6('0x7b')]&&_0x4c891b['joins'][_0x4a9a5b][_0xefc6('0x7c')]){_0x4c028e[_0x4c891b[_0xefc6('0x78')][_0x4a9a5b][_0xefc6('0x2f')]](_0x4c891b[_0xefc6('0x78')][_0x4a9a5b][_0xefc6('0x7b')],null,util[_0xefc6('0x71')](_0xefc6('0x7d'),_0x4c891b[_0xefc6('0x8b')],_0x4c891b['joins'][_0x4a9a5b][_0xefc6('0x7a')],_0x4c891b[_0xefc6('0x78')][_0x4a9a5b][_0xefc6('0x7b')],_0x4c891b[_0xefc6('0x78')][_0x4a9a5b][_0xefc6('0x7c')]));}}}if(_0x4c891b[_0xefc6('0x7e')]){_0x4c891b[_0xefc6('0x7e')]=JSON[_0xefc6('0x79')](_0x4c891b[_0xefc6('0x7e')]);_0x4c028e[_0xefc6('0x3c')](_0x2fd583(_0x4c891b[_0xefc6('0x7e')][_0xefc6('0x68')]));}_0x50ed81=_0x4c028e[_0xefc6('0x8f')]();_0x4c028e[_0xefc6('0x1c')](_0x22316b);_0x4c028e[_0xefc6('0x1e')](0x0);return;}})[_0xefc6('0x23')](function(){if(_0x3a1bb6[_0xefc6('0x90')]===_0xefc6('0x91')){return null;}var _0x3d7b4c=_['merge'](_0x3a1bb6,{'name':_0x3a1bb6[_0xefc6('0x92')]||_0x3a1bb6[_0xefc6('0x29')]||_0x4c891b[_0xefc6('0x29')],'basename':_0x4b5ec0,'savename':util[_0xefc6('0x71')]('%s-%s.%s',_0x3a1bb6[_0xefc6('0x29')]||_0x4c891b['name'],require(_0xefc6('0x93'))['generate'](0x4),_0x3a1bb6['output']||_0xefc6('0x94')),'reportId':_0x4c891b['id'],'reportType':_0xefc6('0x95')});return db[_0xefc6('0x96')]['create'](_0x3d7b4c,{'raw':!![]});})[_0xefc6('0x23')](function(_0x5f4727){if(_0x4c891b[_0xefc6('0x8b')]===_0xefc6('0x97')){_0x50ed81[_0xefc6('0x3c')](_0x4c891b[_0xefc6('0x8b')]+_0xefc6('0x98'),_0x3a1bb6[_0xefc6('0x99')],_0x3a1bb6['endDate']);}else{_0x50ed81[_0xefc6('0x3c')](_0x4c891b[_0xefc6('0x8b')]+_0xefc6('0x9a'),_0x3a1bb6[_0xefc6('0x99')],_0x3a1bb6['endDate']);}if(_0x5f4727){logger[_0xefc6('0x9b')](_0xefc6('0x9c'),_0x50ed81['toString']());require(_0xefc6('0x9d'))[_0xefc6('0x9e')](path[_0xefc6('0x55')](__dirname,_0xefc6('0x9f'),_0x5f4727[_0xefc6('0x90')]),[_0x5f4727['id'],_0x50ed81['toString'](),path[_0xefc6('0x55')](__dirname,'../../files/reports',_0x5f4727[_0xefc6('0xa0')]),_0x4b5ec0]);return _0x5f4727;}else{var _0x18bbf1=squel[_0xefc6('0x89')]();_0x18bbf1[_0xefc6('0x8a')]('('+_0x50ed81['toString']()+')',_0xefc6('0xa1'));_0x18bbf1[_0xefc6('0x8e')]('COUNT(*)',_0xefc6('0x1d'));_0x50ed81['limit'](_0x3a1bb6[_0xefc6('0x1c')]||_0x22316b);_0x50ed81[_0xefc6('0x1e')](_0x3a1bb6['offset']||0x0);return dbH[_0xefc6('0x82')][_0xefc6('0x35')](_0x18bbf1[_0xefc6('0x81')](),{'type':dbH[_0xefc6('0x82')][_0xefc6('0xa2')][_0xefc6('0x83')]})[_0xefc6('0x23')](function(_0x1f9310){if(!_0x1f9310['length']){_0x4b4f67=0x0;}else{_0x4b4f67=_0x1f9310[0x0][_0xefc6('0x1d')]||0x0;}return dbH[_0xefc6('0x82')]['query'](_0x50ed81[_0xefc6('0x81')](),{'type':dbH[_0xefc6('0x82')][_0xefc6('0xa2')][_0xefc6('0x83')]});})[_0xefc6('0x23')](function(_0x59ac4e){return{'rows':_0x59ac4e||[],'count':_0x4b4f67};});}});}exports[_0xefc6('0xa3')]=function(_0x57d2a0,_0x4ea475){return runReport(_0x57d2a0[_0xefc6('0x46')],_0x57d2a0[_0xefc6('0x35')],_0x57d2a0[_0xefc6('0x41')])[_0xefc6('0x23')](respondWithResult(_0x4ea475,null))[_0xefc6('0x45')](handleError(_0x4ea475,null));};exports[_0xefc6('0xa4')]=runReport;exports[_0xefc6('0x35')]=function(_0xf55e30,_0x1f84ba){var _0x984cd4=0xa;var _0x11ead1=[_0xefc6('0x55'),_0xefc6('0x56'),_0xefc6('0x57'),_0xefc6('0x84')];var _0x3f835e={'SUM':'SUM(%s)','COUNT':_0xefc6('0x59'),'COUNT DISTINCT':_0xefc6('0x5a'),'MAX':_0xefc6('0x5b'),'MIN':_0xefc6('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xefc6('0xa5'),'GROUP_CONCAT ASC':_0xefc6('0x5d'),'GROUP_CONCAT DESC':_0xefc6('0x86')};var _0x46d01d={'SEC_TO_TIME':_0xefc6('0x87'),'DATE':'DATE(%s)','HOUR':_0xefc6('0x5f'),'ROUND':_0xefc6('0x60'),'UNIX_TIMESTAMP':_0xefc6('0x61')};var _0x3647a4=function(_0x3a59a6){return!_[_0xefc6('0x62')](['IS\x20NULL',_0xefc6('0x64'),_0xefc6('0x65'),_0xefc6('0x66')],_0x3a59a6);};var _0x14eb54=function(_0x3191c6){if(!_0x3191c6||!_0x3191c6[_0xefc6('0x67')][_0xefc6('0x38')]){return'';}for(var _0x507ef6='(',_0x203105=0x0;_0x203105<_0x3191c6['rules'][_0xefc6('0x38')];_0x203105+=0x1){_0x203105>0x0&&(_0x507ef6+='\x20'+_0x3191c6[_0xefc6('0x88')]+'\x20');_0x507ef6+=_0x3191c6[_0xefc6('0x67')][_0x203105][_0xefc6('0x68')]?_0x14eb54(_0x3191c6['rules'][_0x203105]['group']):_0x3191c6[_0xefc6('0x67')][_0x203105]['field']+'\x20'+_0x3191c6['rules'][_0x203105][_0xefc6('0x69')]+(_0x3647a4(_0x3191c6[_0xefc6('0x67')][_0x203105][_0xefc6('0x69')])?'\x20'+_0x3191c6['rules'][_0x203105]['value']:'');}return _0x507ef6+')';};var _0x4ebb35={'where':{'id':_0xf55e30[_0xefc6('0x46')]['id']}},_0x2da998,_0x5d594f,_0x5b8b0f,_0x358436,_0x208476;_0x4ebb35=_[_0xefc6('0x3f')]({},_0x4ebb35,_0xf55e30[_0xefc6('0x41')]);return db[_0xefc6('0x2d')][_0xefc6('0x4e')](_0x4ebb35)[_0xefc6('0x23')](function(_0x1af38c){if(_0x1af38c){_0x2da998=_0x1af38c;return _0x1af38c[_0xefc6('0x6b')]();}return null;})[_0xefc6('0x23')](function(_0x2610a7){if(_0x2610a7){if(!_0x2610a7[_0xefc6('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0xefc6('0x6e'),0x193);}_0x5d594f=_0x2610a7;return db[_0xefc6('0x6f')][_0xefc6('0x43')]({'raw':!![]});}return null;})[_0xefc6('0x23')](function(_0x5bcfc3){if(_0x5bcfc3){_0x5b8b0f=_[_0xefc6('0xa6')](_0x5bcfc3,'id');var _0x1e4651;var _0x432dba=squel[_0xefc6('0x89')]();_0x432dba[_0xefc6('0x8a')](_0x2da998[_0xefc6('0x8b')]);for(var _0x20f271=0x0;_0x20f271<_0x5d594f['length'];_0x20f271+=0x1){_0x1e4651=_0x5d594f[_0x20f271][_0xefc6('0x8c')]?_0x5b8b0f[_0x5d594f[_0x20f271][_0xefc6('0x8c')]][_0xefc6('0x8d')]:_0x5d594f[_0x20f271]['field'];_0x1e4651=_0x5d594f[_0x20f271]['function']?_['replace'](_0x3f835e[_0x5d594f[_0x20f271]['function']],'%s',_0x1e4651):_0x1e4651;_0x1e4651=_0x5d594f[_0x20f271]['format']?_[_0xefc6('0x72')](_0x46d01d[_0x5d594f[_0x20f271][_0xefc6('0x71')]],'%s',_0x1e4651):_0x1e4651;if(_0x5d594f[_0x20f271][_0xefc6('0x73')]){_0x432dba[_0xefc6('0x68')](_0x1e4651);}_0x5d594f[_0x20f271][_0xefc6('0x75')]&&_0x432dba[_0xefc6('0x74')](_0x1e4651,_0x5d594f[_0x20f271][_0xefc6('0x75')]===_0xefc6('0x76')?![]:!![]);_0x432dba[_0xefc6('0x8e')](_0x1e4651,_0x5d594f[_0x20f271][_0xefc6('0x77')]||_0x1e4651);}if(_0x2da998[_0xefc6('0x78')]){_0x2da998[_0xefc6('0x78')]=JSON[_0xefc6('0x79')](_0x2da998[_0xefc6('0x78')]);for(var _0x2d5a80=0x0;_0x2d5a80<_0x2da998[_0xefc6('0x78')][_0xefc6('0x38')];_0x2d5a80+=0x1){if(_0x2da998[_0xefc6('0x78')][_0x2d5a80][_0xefc6('0x2f')]&&_[_0xefc6('0x62')](_0x11ead1,_0x2da998[_0xefc6('0x78')][_0x2d5a80]['type'])&&_0x2da998['joins'][_0x2d5a80][_0xefc6('0x7a')]&&_0x2da998[_0xefc6('0x78')][_0x2d5a80][_0xefc6('0x7b')]&&_0x2da998['joins'][_0x2d5a80][_0xefc6('0x7c')]){_0x432dba[_0x2da998[_0xefc6('0x78')][_0x2d5a80]['type']](_0x2da998[_0xefc6('0x78')][_0x2d5a80][_0xefc6('0x7b')],null,util[_0xefc6('0x71')](_0xefc6('0x7d'),_0x2da998[_0xefc6('0x8b')],_0x2da998['joins'][_0x2d5a80]['parentKey'],_0x2da998[_0xefc6('0x78')][_0x2d5a80][_0xefc6('0x7b')],_0x2da998[_0xefc6('0x78')][_0x2d5a80][_0xefc6('0x7c')]));}}}if(_0x2da998[_0xefc6('0x7e')]){_0x2da998[_0xefc6('0x7e')]=JSON[_0xefc6('0x79')](_0x2da998[_0xefc6('0x7e')]);_0x432dba[_0xefc6('0x3c')](_0x14eb54(_0x2da998[_0xefc6('0x7e')][_0xefc6('0x68')]));}_0x208476=_0x432dba['clone']();_0x432dba['limit'](_0x984cd4);_0x432dba[_0xefc6('0x1e')](0x0);logger[_0xefc6('0x7f')](_0xefc6('0x80'),_0x432dba[_0xefc6('0x81')]());return dbH[_0xefc6('0x82')][_0xefc6('0x35')](_0x432dba[_0xefc6('0x81')](),{'type':dbH[_0xefc6('0x82')][_0xefc6('0xa2')][_0xefc6('0x83')]});}})['then'](function(){return{'sql':_0x208476[_0xefc6('0x81')]()};})[_0xefc6('0x23')](respondWithResult(_0x1f84ba,null))[_0xefc6('0x45')](handleError(_0x1f84ba,null));}; \ No newline at end of file +var _0xe864=['update','then','CustomReports','UserProfileResource','destroy','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','format','replace','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','HOUR(%s)','condition','value','ValidationErrorItem','metric','output','web','randomstring','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','SUM(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','clone','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe864,0x1c1));var _0x4e86=function(_0x44d699,_0x190895){_0x44d699=_0x44d699-0x0;var _0x3ae5dd=_0xe864[_0x44d699];return _0x3ae5dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e86('0x0'));var zipdir=require(_0x4e86('0x1'));var jsonpatch=require(_0x4e86('0x2'));var rp=require('request-promise');var moment=require(_0x4e86('0x3'));var BPromise=require(_0x4e86('0x4'));var Mustache=require(_0x4e86('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4e86('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e86('0x7'));var _=require(_0x4e86('0x8'));var squel=require('squel');var crypto=require(_0x4e86('0x9'));var jsforce=require(_0x4e86('0xa'));var deskjs=require(_0x4e86('0xb'));var toCsv=require(_0x4e86('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4e86('0xd'));var authService=require(_0x4e86('0xe'));var qs=require(_0x4e86('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e86('0x10'))(_0x4e86('0x11'));var utils=require(_0x4e86('0x12'));var config=require(_0x4e86('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e86('0x14'))['db'];var dbH=require(_0x4e86('0x14'))[_0x4e86('0x15')];function respondWithStatusCode(_0x3f6d7f,_0x2d3de1){_0x2d3de1=_0x2d3de1||0xcc;return function(_0x1dd24c){if(_0x1dd24c){return _0x3f6d7f[_0x4e86('0x16')](_0x2d3de1);}return _0x3f6d7f['status'](_0x2d3de1)['end']();};}function respondWithResult(_0x3ff696,_0xaa128d){_0xaa128d=_0xaa128d||0xc8;return function(_0x3d1548){if(_0x3d1548){return _0x3ff696[_0x4e86('0x17')](_0xaa128d)[_0x4e86('0x18')](_0x3d1548);}};}function respondWithFilteredResult(_0x1a5858,_0x4aada6){return function(_0x145cbb){if(_0x145cbb){var _0x4b947=typeof _0x4aada6[_0x4e86('0x19')]===_0x4e86('0x1a')&&typeof _0x4aada6[_0x4e86('0x1b')]==='undefined';var _0x51b5fb=_0x145cbb[_0x4e86('0x1c')];var _0x51a6ae=_0x4b947?0x0:_0x4aada6[_0x4e86('0x19')];var _0x10f8a8=_0x4b947?_0x145cbb['count']:_0x4aada6[_0x4e86('0x19')]+_0x4aada6[_0x4e86('0x1b')];var _0x3d6659;if(_0x10f8a8>=_0x51b5fb){_0x10f8a8=_0x51b5fb;_0x3d6659=0xc8;}else{_0x3d6659=0xce;}_0x1a5858[_0x4e86('0x17')](_0x3d6659);return _0x1a5858[_0x4e86('0x1d')](_0x4e86('0x1e'),_0x51a6ae+'-'+_0x10f8a8+'/'+_0x51b5fb)[_0x4e86('0x18')](_0x145cbb);}return null;};}function patchUpdates(_0x559174){return function(_0x1490e4){try{jsonpatch[_0x4e86('0x1f')](_0x1490e4,_0x559174,!![]);}catch(_0x20c938){return BPromise[_0x4e86('0x20')](_0x20c938);}return _0x1490e4[_0x4e86('0x21')]();};}function saveUpdates(_0x226649,_0x3f67d9){return function(_0x3ad169){if(_0x3ad169){return _0x3ad169[_0x4e86('0x22')](_0x226649)[_0x4e86('0x23')](function(_0x539a9b){return _0x539a9b;});}return null;};}function removeEntity(_0x23ca45,_0x40d567){return function(_0x1209f3){if(_0x1209f3){return _0x1209f3['destroy']()[_0x4e86('0x23')](function(){var _0x54e870=_0x1209f3['get']({'plain':!![]});var _0x440193=_0x4e86('0x24');return db[_0x4e86('0x25')][_0x4e86('0x26')]({'where':{'type':_0x440193,'resourceId':_0x54e870['id']}})[_0x4e86('0x23')](function(){return _0x1209f3;});})[_0x4e86('0x23')](function(){_0x23ca45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c34e7,_0x4878ef){return function(_0x4cc304){if(!_0x4cc304){_0x2c34e7[_0x4e86('0x16')](0x194);}return _0x4cc304;};}function handleError(_0x935de9,_0x3b9d3e){_0x3b9d3e=_0x3b9d3e||0x1f4;return function(_0x175122){logger[_0x4e86('0x27')](_0x175122[_0x4e86('0x28')]);if(_0x175122['name']){delete _0x175122[_0x4e86('0x29')];}_0x935de9['status'](_0x3b9d3e)['send'](_0x175122);};}exports[_0x4e86('0x2a')]=function(_0x2ed9e,_0x4cd3a1){var _0x6d7fa2={},_0x3b0f74={},_0x4754b9={'count':0x0,'rows':[]};var _0x2af6fd=_[_0x4e86('0x2b')](db[_0x4e86('0x2c')][_0x4e86('0x2d')],function(_0x31367d){return{'name':_0x31367d['fieldName'],'type':_0x31367d['type'][_0x4e86('0x2e')]};});_0x3b0f74[_0x4e86('0x2f')]=_['map'](_0x2af6fd,_0x4e86('0x29'));_0x3b0f74[_0x4e86('0x30')]=_['keys'](_0x2ed9e[_0x4e86('0x30')]);_0x3b0f74[_0x4e86('0x31')]=_[_0x4e86('0x32')](_0x3b0f74['model'],_0x3b0f74[_0x4e86('0x30')]);_0x6d7fa2[_0x4e86('0x33')]=_[_0x4e86('0x32')](_0x3b0f74[_0x4e86('0x2f')],qs[_0x4e86('0x34')](_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x34')]));_0x6d7fa2[_0x4e86('0x33')]=_0x6d7fa2[_0x4e86('0x33')][_0x4e86('0x35')]?_0x6d7fa2[_0x4e86('0x33')]:_0x3b0f74[_0x4e86('0x2f')];if(!_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x36')]('nolimit')){_0x6d7fa2[_0x4e86('0x1b')]=qs['limit'](_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x1b')]);_0x6d7fa2[_0x4e86('0x19')]=qs[_0x4e86('0x19')](_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x19')]);}_0x6d7fa2[_0x4e86('0x37')]=qs[_0x4e86('0x38')](_0x2ed9e['query']['sort']);_0x6d7fa2['where']=qs[_0x4e86('0x31')](_['pick'](_0x2ed9e[_0x4e86('0x30')],_0x3b0f74['filters']),_0x2af6fd);if(_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x39')]){_0x6d7fa2[_0x4e86('0x3a')]=_['merge'](_0x6d7fa2[_0x4e86('0x3a')],{'$or':_[_0x4e86('0x2b')](_0x2af6fd,function(_0x29b4b5){if(_0x29b4b5[_0x4e86('0x3b')]!==_0x4e86('0x3c')){var _0x469a2c={};_0x469a2c[_0x29b4b5[_0x4e86('0x29')]]={'$like':'%'+_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x39')]+'%'};return _0x469a2c;}})});}_0x6d7fa2=_[_0x4e86('0x3d')]({},_0x6d7fa2,_0x2ed9e[_0x4e86('0x3e')]);var _0x19a868={'where':_0x6d7fa2[_0x4e86('0x3a')]};return db[_0x4e86('0x2c')]['count'](_0x19a868)['then'](function(_0x1e73b5){_0x4754b9[_0x4e86('0x1c')]=_0x1e73b5;if(_0x2ed9e['query'][_0x4e86('0x3f')]){_0x6d7fa2[_0x4e86('0x40')]=[{'all':!![]}];}return db[_0x4e86('0x2c')][_0x4e86('0x41')](_0x6d7fa2);})[_0x4e86('0x23')](function(_0x5b6e85){_0x4754b9[_0x4e86('0x42')]=_0x5b6e85;return _0x4754b9;})['then'](respondWithFilteredResult(_0x4cd3a1,_0x6d7fa2))[_0x4e86('0x43')](handleError(_0x4cd3a1,null));};exports[_0x4e86('0x44')]=function(_0x40edfd,_0x277eb1){var _0x73c48b={'raw':![],'where':{'id':_0x40edfd['params']['id']}},_0x444721={};_0x444721[_0x4e86('0x2f')]=_[_0x4e86('0x45')](db[_0x4e86('0x2c')][_0x4e86('0x2d')]);_0x444721[_0x4e86('0x30')]=_[_0x4e86('0x45')](_0x40edfd[_0x4e86('0x30')]);_0x444721[_0x4e86('0x31')]=_[_0x4e86('0x32')](_0x444721[_0x4e86('0x2f')],_0x444721[_0x4e86('0x30')]);_0x73c48b[_0x4e86('0x33')]=_[_0x4e86('0x32')](_0x444721[_0x4e86('0x2f')],qs[_0x4e86('0x34')](_0x40edfd[_0x4e86('0x30')]['fields']));_0x73c48b[_0x4e86('0x33')]=_0x73c48b[_0x4e86('0x33')][_0x4e86('0x35')]?_0x73c48b[_0x4e86('0x33')]:_0x444721[_0x4e86('0x2f')];if(_0x40edfd[_0x4e86('0x30')]['includeAll']){_0x73c48b['include']=[{'all':!![]}];}_0x73c48b=_[_0x4e86('0x3d')]({},_0x73c48b,_0x40edfd[_0x4e86('0x3e')]);return db[_0x4e86('0x2c')][_0x4e86('0x46')](_0x73c48b)[_0x4e86('0x23')](handleEntityNotFound(_0x277eb1,null))[_0x4e86('0x23')](respondWithResult(_0x277eb1,null))[_0x4e86('0x43')](handleError(_0x277eb1,null));};exports[_0x4e86('0x47')]=function(_0x483c50,_0x52bc54){return db[_0x4e86('0x2c')][_0x4e86('0x47')](_0x483c50[_0x4e86('0x48')],{})['then'](function(_0x5dcdec){var _0x28898e=_0x483c50[_0x4e86('0x49')][_0x4e86('0x4a')]({'plain':!![]});if(!_0x28898e)throw new Error(_0x4e86('0x4b'));if(_0x28898e['role']===_0x4e86('0x49')){var _0x3a3701=_0x5dcdec['get']({'plain':!![]});var _0x1836e8=_0x4e86('0x4c');return db[_0x4e86('0x4d')][_0x4e86('0x46')]({'where':{'name':_0x1836e8,'userProfileId':_0x28898e[_0x4e86('0x4e')]},'raw':!![]})[_0x4e86('0x23')](function(_0x5da835){if(_0x5da835&&_0x5da835[_0x4e86('0x4f')]===0x0){return db['UserProfileResource'][_0x4e86('0x47')]({'name':_0x3a3701[_0x4e86('0x29')],'resourceId':_0x3a3701['id'],'type':'CustomReports','sectionId':_0x5da835['id']},{})[_0x4e86('0x23')](function(){return _0x5dcdec;});}else{return _0x5dcdec;}})['catch'](function(_0x51d62c){logger[_0x4e86('0x27')](_0x4e86('0x50'),_0x51d62c);throw _0x51d62c;});}return _0x5dcdec;})[_0x4e86('0x23')](respondWithResult(_0x52bc54,0xc9))['catch'](handleError(_0x52bc54,null));};exports[_0x4e86('0x22')]=function(_0x298739,_0x2ed488){if(_0x298739[_0x4e86('0x48')]['id']){delete _0x298739['body']['id'];}return db['AnalyticCustomReport'][_0x4e86('0x46')]({'where':{'id':_0x298739['params']['id']}})[_0x4e86('0x23')](handleEntityNotFound(_0x2ed488,null))[_0x4e86('0x23')](saveUpdates(_0x298739[_0x4e86('0x48')],null))['then'](respondWithResult(_0x2ed488,null))[_0x4e86('0x43')](handleError(_0x2ed488,null));};exports[_0x4e86('0x26')]=function(_0x495067,_0x210494){return db[_0x4e86('0x2c')][_0x4e86('0x46')]({'where':{'id':_0x495067[_0x4e86('0x51')]['id']}})['then'](handleEntityNotFound(_0x210494,null))[_0x4e86('0x23')](removeEntity(_0x210494,null))[_0x4e86('0x43')](handleError(_0x210494,null));};exports['preview']=function(_0x5afa06,_0x1177c2){var _0x384ef3=0xa;var _0x1190b8=[_0x4e86('0x52'),_0x4e86('0x53'),_0x4e86('0x54'),_0x4e86('0x55')];var _0x4cb0cf={'SUM':'SUM(%s)','COUNT':_0x4e86('0x56'),'COUNT DISTINCT':_0x4e86('0x57'),'MAX':_0x4e86('0x58'),'MIN':_0x4e86('0x59'),'AVG':_0x4e86('0x5a'),'GROUP_CONCAT':_0x4e86('0x5b'),'GROUP_CONCAT ASC':_0x4e86('0x5c'),'GROUP_CONCAT DESC':_0x4e86('0x5d')};var _0xfe6feb={'SEC_TO_TIME':_0x4e86('0x5e'),'DATE':_0x4e86('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x26baf4=function(_0x4810fd){return!_['includes']([_0x4e86('0x60'),_0x4e86('0x61'),_0x4e86('0x62'),'IS\x20NOT\x20EMPTY'],_0x4810fd);};var _0x2214db=function(_0x2b858f){if(!_0x2b858f||!_0x2b858f[_0x4e86('0x63')][_0x4e86('0x35')]){return'';}for(var _0x1444f2='(',_0x3f7966=0x0;_0x3f7966<_0x2b858f[_0x4e86('0x63')][_0x4e86('0x35')];_0x3f7966+=0x1){_0x3f7966>0x0&&(_0x1444f2+='\x20'+_0x2b858f[_0x4e86('0x64')]+'\x20');_0x1444f2+=_0x2b858f[_0x4e86('0x63')][_0x3f7966]['group']?_0x2214db(_0x2b858f[_0x4e86('0x63')][_0x3f7966]['group']):_0x2b858f[_0x4e86('0x63')][_0x3f7966][_0x4e86('0x65')]+'\x20'+_0x2b858f[_0x4e86('0x63')][_0x3f7966]['condition']+(_0x26baf4(_0x2b858f[_0x4e86('0x63')][_0x3f7966]['condition'])?'\x20'+_0x2b858f[_0x4e86('0x63')][_0x3f7966]['value']:'');}return _0x1444f2+')';};var _0x59d5d6={'where':{'id':_0x5afa06[_0x4e86('0x51')]['id']}},_0x366ffa,_0x1b5fab,_0x2bf478,_0x185d12,_0x455be8;_0x59d5d6=_['merge']({},_0x59d5d6,_0x5afa06[_0x4e86('0x3e')]);return db[_0x4e86('0x2c')][_0x4e86('0x46')](_0x59d5d6)[_0x4e86('0x23')](function(_0x551083){if(_0x551083){_0x366ffa=_0x551083;return _0x551083[_0x4e86('0x66')]();}return null;})[_0x4e86('0x23')](function(_0x39f9b5){if(_0x39f9b5){if(!_0x39f9b5[_0x4e86('0x35')]){throw new db[(_0x4e86('0x67'))]['ValidationErrorItem'](_0x4e86('0x68'),0x193);}_0x1b5fab=_0x39f9b5;return db[_0x4e86('0x69')]['findAll']({'raw':!![]});}return null;})[_0x4e86('0x23')](function(_0x37555d){if(_0x37555d){_0x2bf478=_[_0x4e86('0x6a')](_0x37555d,'id');var _0x2aa573;var _0x44e0f5=squel[_0x4e86('0x6b')]();_0x44e0f5[_0x4e86('0x6c')](_0x366ffa['table']);for(var _0x23f4d7=0x0;_0x23f4d7<_0x1b5fab[_0x4e86('0x35')];_0x23f4d7+=0x1){_0x2aa573=_0x1b5fab[_0x23f4d7]['MetricId']?_0x2bf478[_0x1b5fab[_0x23f4d7][_0x4e86('0x6d')]]['metric']:_0x1b5fab[_0x23f4d7][_0x4e86('0x65')];_0x2aa573=_0x1b5fab[_0x23f4d7][_0x4e86('0x6e')]?_['replace'](_0x4cb0cf[_0x1b5fab[_0x23f4d7][_0x4e86('0x6e')]],'%s',_0x2aa573):_0x2aa573;_0x2aa573=_0x1b5fab[_0x23f4d7][_0x4e86('0x6f')]?_[_0x4e86('0x70')](_0xfe6feb[_0x1b5fab[_0x23f4d7][_0x4e86('0x6f')]],'%s',_0x2aa573):_0x2aa573;if(_0x1b5fab[_0x23f4d7][_0x4e86('0x71')]){_0x44e0f5[_0x4e86('0x72')](_0x2aa573);}_0x1b5fab[_0x23f4d7]['orderBy']&&_0x44e0f5['order'](_0x2aa573,_0x1b5fab[_0x23f4d7][_0x4e86('0x73')]===_0x4e86('0x74')?![]:!![]);_0x44e0f5[_0x4e86('0x65')](_0x2aa573,_0x1b5fab[_0x23f4d7][_0x4e86('0x75')]||_0x2aa573);}if(_0x366ffa[_0x4e86('0x76')]){_0x366ffa[_0x4e86('0x76')]=JSON[_0x4e86('0x77')](_0x366ffa['joins']);for(var _0x1a621b=0x0;_0x1a621b<_0x366ffa[_0x4e86('0x76')]['length'];_0x1a621b+=0x1){if(_0x366ffa['joins'][_0x1a621b][_0x4e86('0x3b')]&&_[_0x4e86('0x78')](_0x1190b8,_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x3b')])&&_0x366ffa['joins'][_0x1a621b][_0x4e86('0x79')]&&_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x7a')]&&_0x366ffa[_0x4e86('0x76')][_0x1a621b]['foreignKey']){_0x44e0f5[_0x366ffa['joins'][_0x1a621b][_0x4e86('0x3b')]](_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x7a')],null,util[_0x4e86('0x6f')](_0x4e86('0x7b'),_0x366ffa[_0x4e86('0x7c')],_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x79')],_0x366ffa[_0x4e86('0x76')][_0x1a621b]['foreignTable'],_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x7d')]));}}}if(_0x366ffa['conditions']){_0x366ffa[_0x4e86('0x7e')]=JSON[_0x4e86('0x77')](_0x366ffa[_0x4e86('0x7e')]);_0x44e0f5[_0x4e86('0x3a')](_0x2214db(_0x366ffa[_0x4e86('0x7e')][_0x4e86('0x72')]));}_0x455be8=_0x44e0f5['clone']();_0x44e0f5[_0x4e86('0x1b')](_0x384ef3);_0x44e0f5['offset'](0x0);logger[_0x4e86('0x7f')]('Limited\x20Query:',_0x44e0f5[_0x4e86('0x80')]());return dbH['sequelize'][_0x4e86('0x30')](_0x44e0f5['toString'](),{'type':dbH[_0x4e86('0x81')][_0x4e86('0x82')][_0x4e86('0x83')]});}})[_0x4e86('0x23')](respondWithResult(_0x1177c2,null))[_0x4e86('0x43')](handleError(_0x1177c2,null));};function runReport(_0x2284c1,_0x50d900,_0x522e5c){var _0x328fc3=_0x50d900[_0x4e86('0x29')];var _0x535da1=0xa;var _0x100925=[_0x4e86('0x52'),_0x4e86('0x53'),_0x4e86('0x54'),_0x4e86('0x55')];var _0x4e459a={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4e86('0x57'),'MAX':'MAX(%s)','MIN':_0x4e86('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4e86('0x5d')};var _0x28a526={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4e86('0x5f'),'HOUR':_0x4e86('0x84'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ea58=function(_0x194c0e){return!_[_0x4e86('0x78')]([_0x4e86('0x60'),'IS\x20NOT\x20NULL',_0x4e86('0x62'),'IS\x20NOT\x20EMPTY'],_0x194c0e);};var _0x1ec30e=function(_0x12ba98){if(!_0x12ba98||!_0x12ba98['rules'][_0x4e86('0x35')]){return'';}for(var _0x157818='(',_0xb66cec=0x0;_0xb66cec<_0x12ba98['rules'][_0x4e86('0x35')];_0xb66cec+=0x1){_0xb66cec>0x0&&(_0x157818+='\x20'+_0x12ba98['operator']+'\x20');_0x157818+=_0x12ba98[_0x4e86('0x63')][_0xb66cec][_0x4e86('0x72')]?_0x1ec30e(_0x12ba98[_0x4e86('0x63')][_0xb66cec]['group']):_0x12ba98['rules'][_0xb66cec][_0x4e86('0x65')]+'\x20'+_0x12ba98[_0x4e86('0x63')][_0xb66cec][_0x4e86('0x85')]+(_0x27ea58(_0x12ba98[_0x4e86('0x63')][_0xb66cec][_0x4e86('0x85')])?'\x20'+_0x12ba98[_0x4e86('0x63')][_0xb66cec][_0x4e86('0x86')]:'');}return _0x157818+')';};var _0x4f75cf={'where':{'id':_0x2284c1['id']}},_0x452814,_0x360cba,_0x2e9da8,_0x38fd2b,_0x719b68;_0x4f75cf=_[_0x4e86('0x3d')]({},_0x4f75cf,_0x522e5c);return db[_0x4e86('0x2c')][_0x4e86('0x46')](_0x4f75cf)[_0x4e86('0x23')](function(_0x74019f){if(_0x74019f){_0x452814=_0x74019f;return _0x74019f['getFields']();}return null;})['then'](function(_0x2759d2){if(_0x2759d2){if(!_0x2759d2[_0x4e86('0x35')]){throw new db[(_0x4e86('0x67'))][(_0x4e86('0x87'))](_0x4e86('0x68'),0x193);}_0x360cba=_0x2759d2;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4e86('0x23')](function(_0x51bc42){if(_0x51bc42){_0x2e9da8=_[_0x4e86('0x6a')](_0x51bc42,'id');var _0x202b97;var _0x3062f3=squel['select']();_0x3062f3[_0x4e86('0x6c')](_0x452814[_0x4e86('0x7c')]);for(var _0x20aff0=0x0;_0x20aff0<_0x360cba[_0x4e86('0x35')];_0x20aff0+=0x1){_0x202b97=_0x360cba[_0x20aff0][_0x4e86('0x6d')]?_0x2e9da8[_0x360cba[_0x20aff0][_0x4e86('0x6d')]][_0x4e86('0x88')]:_0x360cba[_0x20aff0][_0x4e86('0x65')];_0x202b97=_0x360cba[_0x20aff0]['function']?_[_0x4e86('0x70')](_0x4e459a[_0x360cba[_0x20aff0][_0x4e86('0x6e')]],'%s',_0x202b97):_0x202b97;_0x202b97=_0x360cba[_0x20aff0][_0x4e86('0x6f')]?_[_0x4e86('0x70')](_0x28a526[_0x360cba[_0x20aff0][_0x4e86('0x6f')]],'%s',_0x202b97):_0x202b97;if(_0x360cba[_0x20aff0][_0x4e86('0x71')]){_0x3062f3[_0x4e86('0x72')](_0x202b97);}_0x360cba[_0x20aff0][_0x4e86('0x73')]&&_0x3062f3[_0x4e86('0x37')](_0x202b97,_0x360cba[_0x20aff0][_0x4e86('0x73')]===_0x4e86('0x74')?![]:!![]);_0x3062f3[_0x4e86('0x65')](_0x202b97,_0x360cba[_0x20aff0][_0x4e86('0x75')]||_0x202b97);}if(_0x452814['joins']){_0x452814['joins']=JSON[_0x4e86('0x77')](_0x452814[_0x4e86('0x76')]);for(var _0xb67480=0x0;_0xb67480<_0x452814['joins'][_0x4e86('0x35')];_0xb67480+=0x1){if(_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x3b')]&&_[_0x4e86('0x78')](_0x100925,_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x3b')])&&_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x79')]&&_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x7a')]&&_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x7d')]){_0x3062f3[_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x3b')]](_0x452814['joins'][_0xb67480][_0x4e86('0x7a')],null,util['format'](_0x4e86('0x7b'),_0x452814['table'],_0x452814[_0x4e86('0x76')][_0xb67480]['parentKey'],_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x7a')],_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x7d')]));}}}if(_0x452814[_0x4e86('0x7e')]){_0x452814[_0x4e86('0x7e')]=JSON[_0x4e86('0x77')](_0x452814[_0x4e86('0x7e')]);_0x3062f3[_0x4e86('0x3a')](_0x1ec30e(_0x452814['conditions']['group']));}_0x719b68=_0x3062f3['clone']();_0x3062f3[_0x4e86('0x1b')](_0x535da1);_0x3062f3[_0x4e86('0x19')](0x0);return;}})['then'](function(){if(_0x50d900[_0x4e86('0x89')]===_0x4e86('0x8a')){return null;}var _0x5d7d9d=_[_0x4e86('0x3d')](_0x50d900,{'name':_0x50d900['fullPath']||_0x50d900[_0x4e86('0x29')]||_0x452814['name'],'basename':_0x328fc3,'savename':util[_0x4e86('0x6f')]('%s-%s.%s',_0x50d900['name']||_0x452814[_0x4e86('0x29')],require(_0x4e86('0x8b'))['generate'](0x4),_0x50d900[_0x4e86('0x89')]||_0x4e86('0x8c')),'reportId':_0x452814['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x4e86('0x47')](_0x5d7d9d,{'raw':!![]});})[_0x4e86('0x23')](function(_0x5bd257){if(_0x452814[_0x4e86('0x7c')]===_0x4e86('0x8d')){_0x719b68['where'](_0x452814['table']+_0x4e86('0x8e'),_0x50d900['startDate'],_0x50d900[_0x4e86('0x8f')]);}else{_0x719b68[_0x4e86('0x3a')](_0x452814[_0x4e86('0x7c')]+_0x4e86('0x90'),_0x50d900[_0x4e86('0x91')],_0x50d900[_0x4e86('0x8f')]);}if(_0x5bd257){logger[_0x4e86('0x92')](_0x4e86('0x93'),_0x719b68['toString']());require(_0x4e86('0x94'))[_0x4e86('0x95')](path[_0x4e86('0x52')](__dirname,_0x4e86('0x96'),_0x5bd257['output']),[_0x5bd257['id'],_0x719b68['toString'](),path[_0x4e86('0x52')](__dirname,_0x4e86('0x97'),_0x5bd257[_0x4e86('0x98')]),_0x328fc3]);return _0x5bd257;}else{var _0x5b37df=squel[_0x4e86('0x6b')]();_0x5b37df[_0x4e86('0x6c')]('('+_0x719b68[_0x4e86('0x80')]()+')',_0x4e86('0x99'));_0x5b37df['field']('COUNT(*)',_0x4e86('0x1c'));_0x719b68['limit'](_0x50d900[_0x4e86('0x1b')]||_0x535da1);_0x719b68['offset'](_0x50d900[_0x4e86('0x19')]||0x0);return dbH[_0x4e86('0x81')][_0x4e86('0x30')](_0x5b37df['toString'](),{'type':dbH[_0x4e86('0x81')][_0x4e86('0x82')]['SELECT']})[_0x4e86('0x23')](function(_0x17e40e){if(!_0x17e40e[_0x4e86('0x35')]){_0x38fd2b=0x0;}else{_0x38fd2b=_0x17e40e[0x0]['count']||0x0;}return dbH[_0x4e86('0x81')][_0x4e86('0x30')](_0x719b68[_0x4e86('0x80')](),{'type':dbH[_0x4e86('0x81')]['QueryTypes'][_0x4e86('0x83')]});})[_0x4e86('0x23')](function(_0x1471fa){return{'rows':_0x1471fa||[],'count':_0x38fd2b};});}});}exports[_0x4e86('0x9a')]=function(_0x16bcfe,_0x192817){return runReport(_0x16bcfe[_0x4e86('0x51')],_0x16bcfe['query'],_0x16bcfe['options'])['then'](respondWithResult(_0x192817,null))['catch'](handleError(_0x192817,null));};exports[_0x4e86('0x9b')]=runReport;exports[_0x4e86('0x30')]=function(_0x107ed9,_0x4634c4){var _0x43125c=0xa;var _0x86e078=[_0x4e86('0x52'),_0x4e86('0x53'),'right_join','cross_join'];var _0x1ad303={'SUM':_0x4e86('0x9c'),'COUNT':_0x4e86('0x56'),'COUNT DISTINCT':_0x4e86('0x57'),'MAX':_0x4e86('0x58'),'MIN':_0x4e86('0x59'),'AVG':_0x4e86('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4e86('0x5c'),'GROUP_CONCAT DESC':_0x4e86('0x5d')};var _0x599b6e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4e86('0x5f'),'HOUR':_0x4e86('0x84'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4e86('0x9d')};var _0x1bfb02=function(_0x57e04c){return!_[_0x4e86('0x78')]([_0x4e86('0x60'),_0x4e86('0x61'),'IS\x20EMPTY',_0x4e86('0x9e')],_0x57e04c);};var _0x3ea900=function(_0x31076c){if(!_0x31076c||!_0x31076c['rules'][_0x4e86('0x35')]){return'';}for(var _0x5e9d7e='(',_0x2af1c8=0x0;_0x2af1c8<_0x31076c[_0x4e86('0x63')][_0x4e86('0x35')];_0x2af1c8+=0x1){_0x2af1c8>0x0&&(_0x5e9d7e+='\x20'+_0x31076c[_0x4e86('0x64')]+'\x20');_0x5e9d7e+=_0x31076c[_0x4e86('0x63')][_0x2af1c8][_0x4e86('0x72')]?_0x3ea900(_0x31076c['rules'][_0x2af1c8][_0x4e86('0x72')]):_0x31076c['rules'][_0x2af1c8][_0x4e86('0x65')]+'\x20'+_0x31076c[_0x4e86('0x63')][_0x2af1c8][_0x4e86('0x85')]+(_0x1bfb02(_0x31076c[_0x4e86('0x63')][_0x2af1c8][_0x4e86('0x85')])?'\x20'+_0x31076c['rules'][_0x2af1c8][_0x4e86('0x86')]:'');}return _0x5e9d7e+')';};var _0x14d29f={'where':{'id':_0x107ed9[_0x4e86('0x51')]['id']}},_0x4941a9,_0x1dfc30,_0x4d3375,_0x315bbb,_0x241d7f;_0x14d29f=_[_0x4e86('0x3d')]({},_0x14d29f,_0x107ed9[_0x4e86('0x3e')]);return db['AnalyticCustomReport'][_0x4e86('0x46')](_0x14d29f)[_0x4e86('0x23')](function(_0x270569){if(_0x270569){_0x4941a9=_0x270569;return _0x270569[_0x4e86('0x66')]();}return null;})['then'](function(_0x13da76){if(_0x13da76){if(!_0x13da76[_0x4e86('0x35')]){throw new db[(_0x4e86('0x67'))]['ValidationErrorItem'](_0x4e86('0x68'),0x193);}_0x1dfc30=_0x13da76;return db[_0x4e86('0x69')][_0x4e86('0x41')]({'raw':!![]});}return null;})[_0x4e86('0x23')](function(_0xae3206){if(_0xae3206){_0x4d3375=_[_0x4e86('0x6a')](_0xae3206,'id');var _0x322c21;var _0xdaf1f3=squel[_0x4e86('0x6b')]();_0xdaf1f3[_0x4e86('0x6c')](_0x4941a9[_0x4e86('0x7c')]);for(var _0x94265e=0x0;_0x94265e<_0x1dfc30[_0x4e86('0x35')];_0x94265e+=0x1){_0x322c21=_0x1dfc30[_0x94265e]['MetricId']?_0x4d3375[_0x1dfc30[_0x94265e][_0x4e86('0x6d')]][_0x4e86('0x88')]:_0x1dfc30[_0x94265e][_0x4e86('0x65')];_0x322c21=_0x1dfc30[_0x94265e][_0x4e86('0x6e')]?_[_0x4e86('0x70')](_0x1ad303[_0x1dfc30[_0x94265e][_0x4e86('0x6e')]],'%s',_0x322c21):_0x322c21;_0x322c21=_0x1dfc30[_0x94265e][_0x4e86('0x6f')]?_[_0x4e86('0x70')](_0x599b6e[_0x1dfc30[_0x94265e][_0x4e86('0x6f')]],'%s',_0x322c21):_0x322c21;if(_0x1dfc30[_0x94265e][_0x4e86('0x71')]){_0xdaf1f3[_0x4e86('0x72')](_0x322c21);}_0x1dfc30[_0x94265e][_0x4e86('0x73')]&&_0xdaf1f3['order'](_0x322c21,_0x1dfc30[_0x94265e]['orderBy']==='DESC'?![]:!![]);_0xdaf1f3[_0x4e86('0x65')](_0x322c21,_0x1dfc30[_0x94265e]['alias']||_0x322c21);}if(_0x4941a9['joins']){_0x4941a9['joins']=JSON['parse'](_0x4941a9[_0x4e86('0x76')]);for(var _0x3d7f3c=0x0;_0x3d7f3c<_0x4941a9[_0x4e86('0x76')]['length'];_0x3d7f3c+=0x1){if(_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x3b')]&&_[_0x4e86('0x78')](_0x86e078,_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x3b')])&&_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x79')]&&_0x4941a9['joins'][_0x3d7f3c][_0x4e86('0x7a')]&&_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x7d')]){_0xdaf1f3[_0x4941a9[_0x4e86('0x76')][_0x3d7f3c]['type']](_0x4941a9[_0x4e86('0x76')][_0x3d7f3c]['foreignTable'],null,util['format'](_0x4e86('0x7b'),_0x4941a9[_0x4e86('0x7c')],_0x4941a9[_0x4e86('0x76')][_0x3d7f3c]['parentKey'],_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x7a')],_0x4941a9[_0x4e86('0x76')][_0x3d7f3c]['foreignKey']));}}}if(_0x4941a9[_0x4e86('0x7e')]){_0x4941a9[_0x4e86('0x7e')]=JSON[_0x4e86('0x77')](_0x4941a9[_0x4e86('0x7e')]);_0xdaf1f3['where'](_0x3ea900(_0x4941a9[_0x4e86('0x7e')][_0x4e86('0x72')]));}_0x241d7f=_0xdaf1f3[_0x4e86('0x9f')]();_0xdaf1f3[_0x4e86('0x1b')](_0x43125c);_0xdaf1f3[_0x4e86('0x19')](0x0);logger[_0x4e86('0x7f')](_0x4e86('0xa0'),_0xdaf1f3['toString']());return dbH[_0x4e86('0x81')][_0x4e86('0x30')](_0xdaf1f3[_0x4e86('0x80')](),{'type':dbH[_0x4e86('0x81')][_0x4e86('0x82')][_0x4e86('0x83')]});}})[_0x4e86('0x23')](function(){return{'sql':_0x241d7f['toString']()};})[_0x4e86('0x23')](respondWithResult(_0x4634c4,null))[_0x4e86('0x43')](handleError(_0x4634c4,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index cba9396..7417235 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 _0xf129=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3cef07,_0x1229f9){var _0x160c8c=function(_0x2f3ba5){while(--_0x2f3ba5){_0x3cef07['push'](_0x3cef07['shift']());}};_0x160c8c(++_0x1229f9);}(_0xf129,0x156));var _0x9f12=function(_0x1f6bc0,_0x16eee1){_0x1f6bc0=_0x1f6bc0-0x0;var _0x54d600=_0xf129[_0x1f6bc0];return _0x54d600;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f12('0x0'))(_0x9f12('0x1'));var moment=require(_0x9f12('0x2'));var BPromise=require('bluebird');var rp=require(_0x9f12('0x3'));var fs=require('fs');var path=require(_0x9f12('0x4'));var rimraf=require(_0x9f12('0x5'));var config=require(_0x9f12('0x6'));var attributes=require(_0x9f12('0x7'));module[_0x9f12('0x8')]=function(_0x1331ee,_0x42630c){return _0x1331ee[_0x9f12('0x9')](_0x9f12('0xa'),attributes,{'tableName':_0x9f12('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd56=['./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','moment','path','rimraf','../../config/environment'];(function(_0x2304de,_0x1ba04d){var _0x3922fa=function(_0x2809a5){while(--_0x2809a5){_0x2304de['push'](_0x2304de['shift']());}};_0x3922fa(++_0x1ba04d);}(_0xfd56,0x1bb));var _0x6fd5=function(_0x4af52f,_0x5182b4){_0x4af52f=_0x4af52f-0x0;var _0x3da82e=_0xfd56[_0x4af52f];return _0x3da82e;};'use strict';var _=require(_0x6fd5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6fd5('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fd5('0x2'));var rimraf=require(_0x6fd5('0x3'));var config=require(_0x6fd5('0x4'));var attributes=require(_0x6fd5('0x5'));module['exports']=function(_0x52e50c,_0x447a50){return _0x52e50c['define'](_0x6fd5('0x6'),attributes,{'tableName':_0x6fd5('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 523a3b0..bac299a 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 _0x5e7d=['../../config/environment','jayson/promise','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc'];(function(_0x445179,_0x389247){var _0x36626f=function(_0x54ca4e){while(--_0x54ca4e){_0x445179['push'](_0x445179['shift']());}};_0x36626f(++_0x389247);}(_0x5e7d,0x163));var _0xd5e7=function(_0x1d046a,_0x30db41){_0x1d046a=_0x1d046a-0x0;var _0x2c0b0c=_0x5e7d[_0x1d046a];return _0x2c0b0c;};'use strict';var _=require(_0xd5e7('0x0'));var util=require(_0xd5e7('0x1'));var moment=require(_0xd5e7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5e7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd5e7('0x4'))(_0xd5e7('0x5'));var config=require(_0xd5e7('0x6'));var jayson=require(_0xd5e7('0x7'));var client=jayson[_0xd5e7('0x8')][_0xd5e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34e8c9,_0xdb9796,_0x4fbfb4){return new BPromise(function(_0x374a3c,_0x42eff3){return client['request'](_0x34e8c9,_0x4fbfb4)['then'](function(_0xdb5734){logger[_0xd5e7('0xa')](_0xd5e7('0xb'),_0xdb9796,_0xd5e7('0xc'));logger['debug'](_0xd5e7('0xd'),_0xdb9796,_0xd5e7('0xc'),JSON['stringify'](_0xdb5734));if(_0xdb5734['error']){if(_0xdb5734[_0xd5e7('0xe')][_0xd5e7('0xf')]===0x1f4){logger[_0xd5e7('0xe')](_0xd5e7('0xb'),_0xdb9796,_0xdb5734[_0xd5e7('0xe')]['message']);return _0x42eff3(_0xdb5734[_0xd5e7('0xe')][_0xd5e7('0x10')]);}logger[_0xd5e7('0xe')](_0xd5e7('0xb'),_0xdb9796,_0xdb5734[_0xd5e7('0xe')]['message']);return _0x374a3c(_0xdb5734[_0xd5e7('0xe')]['message']);}else{logger[_0xd5e7('0xa')](_0xd5e7('0xb'),_0xdb9796,_0xd5e7('0xc'));_0x374a3c(_0xdb5734[_0xd5e7('0x11')]['message']);}})[_0xd5e7('0x12')](function(_0x157aaa){logger[_0xd5e7('0xe')](_0xd5e7('0xb'),_0xdb9796,_0x157aaa);_0x42eff3(_0x157aaa);});});} \ No newline at end of file +var _0xbb68=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x785612,_0x44643f){var _0x3e589b=function(_0x283f31){while(--_0x283f31){_0x785612['push'](_0x785612['shift']());}};_0x3e589b(++_0x44643f);}(_0xbb68,0xec));var _0x8bb6=function(_0x25848f,_0x32a708){_0x25848f=_0x25848f-0x0;var _0x454345=_0xbb68[_0x25848f];return _0x454345;};'use strict';var _=require(_0x8bb6('0x0'));var util=require(_0x8bb6('0x1'));var moment=require(_0x8bb6('0x2'));var BPromise=require(_0x8bb6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bb6('0x5'));var logger=require(_0x8bb6('0x6'))(_0x8bb6('0x7'));var config=require(_0x8bb6('0x8'));var jayson=require(_0x8bb6('0x9'));var client=jayson['client'][_0x8bb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cf731,_0x52b338,_0x5cd37f){return new BPromise(function(_0x4fab3f,_0x1af51e){return client['request'](_0x4cf731,_0x5cd37f)['then'](function(_0x4ab0b5){logger[_0x8bb6('0xb')](_0x8bb6('0xc'),_0x52b338,_0x8bb6('0xd'));logger['debug'](_0x8bb6('0xe'),_0x52b338,_0x8bb6('0xd'),JSON['stringify'](_0x4ab0b5));if(_0x4ab0b5[_0x8bb6('0xf')]){if(_0x4ab0b5[_0x8bb6('0xf')][_0x8bb6('0x10')]===0x1f4){logger[_0x8bb6('0xf')](_0x8bb6('0xc'),_0x52b338,_0x4ab0b5['error'][_0x8bb6('0x11')]);return _0x1af51e(_0x4ab0b5['error'][_0x8bb6('0x11')]);}logger[_0x8bb6('0xf')](_0x8bb6('0xc'),_0x52b338,_0x4ab0b5[_0x8bb6('0xf')][_0x8bb6('0x11')]);return _0x4fab3f(_0x4ab0b5['error']['message']);}else{logger[_0x8bb6('0xb')](_0x8bb6('0xc'),_0x52b338,_0x8bb6('0xd'));_0x4fab3f(_0x4ab0b5[_0x8bb6('0x12')][_0x8bb6('0x11')]);}})[_0x8bb6('0x13')](function(_0xaaf916){logger['error'](_0x8bb6('0xc'),_0x52b338,_0xaaf916);_0x1af51e(_0xaaf916);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index ad73329..1a79e5c 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 _0x506b=['/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x21c222,_0x406d0a){var _0x5ec82a=function(_0x11084a){while(--_0x11084a){_0x21c222['push'](_0x21c222['shift']());}};_0x5ec82a(++_0x406d0a);}(_0x506b,0x14c));var _0xb506=function(_0x23496e,_0x5c2620){_0x23496e=_0x23496e-0x0;var _0xd5128e=_0x506b[_0x23496e];return _0xd5128e;};'use strict';var multer=require('multer');var util=require(_0xb506('0x0'));var path=require(_0xb506('0x1'));var timeout=require(_0xb506('0x2'));var express=require(_0xb506('0x3'));var router=express[_0xb506('0x4')]();var fs_extra=require(_0xb506('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb506('0x6'));var config=require(_0xb506('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xb506('0x8')]('/',auth[_0xb506('0x9')](),controller[_0xb506('0xa')]);router[_0xb506('0x8')](_0xb506('0xb'),auth[_0xb506('0x9')](),controller[_0xb506('0xc')]);router['get'](_0xb506('0xd'),auth[_0xb506('0x9')](),controller[_0xb506('0xe')]);router['get'](_0xb506('0xf'),auth[_0xb506('0x9')](),controller[_0xb506('0x10')]);router[_0xb506('0x8')](_0xb506('0x11'),auth[_0xb506('0x9')](),controller[_0xb506('0x12')]);router[_0xb506('0x13')]('/',auth[_0xb506('0x9')](),controller[_0xb506('0x14')]);router['put'](_0xb506('0xb'),auth['isAuthenticated'](),controller[_0xb506('0x15')]);router[_0xb506('0x16')](_0xb506('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcf01=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview','run','/:id/query','query','post','put','update','destroy','exports','multer','util','express'];(function(_0x1bffe8,_0xdbe373){var _0x4ab5cd=function(_0x979865){while(--_0x979865){_0x1bffe8['push'](_0x1bffe8['shift']());}};_0x4ab5cd(++_0xdbe373);}(_0xcf01,0xef));var _0x1cf0=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xcf01[_0x4bacb6];return _0x58c029;};'use strict';var multer=require(_0x1cf0('0x0'));var util=require(_0x1cf0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1cf0('0x2'));var router=express[_0x1cf0('0x3')]();var fs_extra=require(_0x1cf0('0x4'));var auth=require(_0x1cf0('0x5'));var interaction=require(_0x1cf0('0x6'));var config=require(_0x1cf0('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x1cf0('0x8')]('/',auth[_0x1cf0('0x9')](),controller['index']);router[_0x1cf0('0x8')](_0x1cf0('0xa'),auth[_0x1cf0('0x9')](),controller[_0x1cf0('0xb')]);router[_0x1cf0('0x8')](_0x1cf0('0xc'),auth[_0x1cf0('0x9')](),controller[_0x1cf0('0xd')]);router[_0x1cf0('0x8')]('/:id/run',auth[_0x1cf0('0x9')](),controller[_0x1cf0('0xe')]);router['get'](_0x1cf0('0xf'),auth[_0x1cf0('0x9')](),controller[_0x1cf0('0x10')]);router[_0x1cf0('0x11')]('/',auth[_0x1cf0('0x9')](),controller['create']);router[_0x1cf0('0x12')](_0x1cf0('0xa'),auth[_0x1cf0('0x9')](),controller[_0x1cf0('0x13')]);router['delete'](_0x1cf0('0xa'),auth['isAuthenticated'](),controller[_0x1cf0('0x14')]);module[_0x1cf0('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index e416e63..710bfb2 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 _0x6f47=['TEXT','exports','STRING'];(function(_0x222c37,_0x56f228){var _0x20e96a=function(_0xbe6c5e){while(--_0xbe6c5e){_0x222c37['push'](_0x222c37['shift']());}};_0x20e96a(++_0x56f228);}(_0x6f47,0xc7));var _0x76f4=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x6f47[_0x1ae5ab];return _0x1ce001;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5d58=['TEXT','STRING'];(function(_0x466ec4,_0x1654d3){var _0x541fa2=function(_0x3a292d){while(--_0x3a292d){_0x466ec4['push'](_0x466ec4['shift']());}};_0x541fa2(++_0x1654d3);}(_0x5d58,0x187));var _0x85d5=function(_0x5f221c,_0x45aaac){_0x5f221c=_0x5f221c-0x0;var _0x2f8046=_0x5d58[_0x5f221c];return _0x2f8046;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 1b716d7..0d8dff3 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 _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x313be0,_0x3acc80){_0x313be0=_0x313be0-0x0;var _0x2e4bb4=_0xc6ac[_0x313be0];return _0x2e4bb4;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));}; \ No newline at end of file +var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6d38,0x1ef));var _0x86d3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6d38[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 079d301..9200652 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 _0xc15f=['request-promise','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','bluebird'];(function(_0x20ebb9,_0x3535bb){var _0x1ec31d=function(_0x3afad1){while(--_0x3afad1){_0x20ebb9['push'](_0x20ebb9['shift']());}};_0x1ec31d(++_0x3535bb);}(_0xc15f,0x182));var _0xfc15=function(_0x5a9666,_0x30bc94){_0x5a9666=_0x5a9666-0x0;var _0x28601f=_0xc15f[_0x5a9666];return _0x28601f;};'use strict';var _=require(_0xfc15('0x0'));var util=require(_0xfc15('0x1'));var logger=require(_0xfc15('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfc15('0x3'));var rp=require(_0xfc15('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc15('0x5'));var config=require(_0xfc15('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0xfc15('0x7')]=function(_0x3aff96,_0x4760f8){return _0x3aff96[_0xfc15('0x8')](_0xfc15('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0edc=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xe61b71,_0x49b800){var _0x1604b7=function(_0x681020){while(--_0x681020){_0xe61b71['push'](_0xe61b71['shift']());}};_0x1604b7(++_0x49b800);}(_0x0edc,0xfd));var _0xc0ed=function(_0xa98dea,_0x189bab){_0xa98dea=_0xa98dea-0x0;var _0x361e03=_0x0edc[_0xa98dea];return _0x361e03;};'use strict';var _=require(_0xc0ed('0x0'));var util=require(_0xc0ed('0x1'));var logger=require(_0xc0ed('0x2'))(_0xc0ed('0x3'));var moment=require(_0xc0ed('0x4'));var BPromise=require(_0xc0ed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0ed('0x6'));var rimraf=require(_0xc0ed('0x7'));var config=require(_0xc0ed('0x8'));var attributes=require(_0xc0ed('0x9'));module[_0xc0ed('0xa')]=function(_0x144edc,_0x7886e5){return _0x144edc[_0xc0ed('0xb')](_0xc0ed('0xc'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index c417443..c574ed3 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 _0x83b7=['stringify','error','code','message','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x83b7,0x17b));var _0x783b=function(_0xb6e5c4,_0x14621a){_0xb6e5c4=_0xb6e5c4-0x0;var _0x1ea3cd=_0x83b7[_0xb6e5c4];return _0x1ea3cd;};'use strict';var _=require('lodash');var util=require(_0x783b('0x0'));var moment=require(_0x783b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x783b('0x2'));var db=require(_0x783b('0x3'))['db'];var utils=require(_0x783b('0x4'));var logger=require(_0x783b('0x5'))('rpc');var config=require(_0x783b('0x6'));var jayson=require(_0x783b('0x7'));var client=jayson[_0x783b('0x8')][_0x783b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x353b19,_0x1c56b6,_0x454aac){return new BPromise(function(_0x3eb266,_0xeb576b){return client[_0x783b('0xa')](_0x353b19,_0x454aac)[_0x783b('0xb')](function(_0x1ff138){logger[_0x783b('0xc')](_0x783b('0xd'),_0x1c56b6,_0x783b('0xe'));logger[_0x783b('0xf')](_0x783b('0x10'),_0x1c56b6,_0x783b('0xe'),JSON[_0x783b('0x11')](_0x1ff138));if(_0x1ff138['error']){if(_0x1ff138[_0x783b('0x12')][_0x783b('0x13')]===0x1f4){logger[_0x783b('0x12')](_0x783b('0xd'),_0x1c56b6,_0x1ff138[_0x783b('0x12')][_0x783b('0x14')]);return _0xeb576b(_0x1ff138['error'][_0x783b('0x14')]);}logger[_0x783b('0x12')](_0x783b('0xd'),_0x1c56b6,_0x1ff138[_0x783b('0x12')][_0x783b('0x14')]);return _0x3eb266(_0x1ff138[_0x783b('0x12')]['message']);}else{logger[_0x783b('0xc')](_0x783b('0xd'),_0x1c56b6,_0x783b('0xe'));_0x3eb266(_0x1ff138['result'][_0x783b('0x14')]);}})[_0x783b('0x15')](function(_0x40b14a){logger['error'](_0x783b('0xd'),_0x1c56b6,_0x40b14a);_0xeb576b(_0x40b14a);});});} \ No newline at end of file +var _0x1c06=['request\x20sent','debug','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','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x45ffaa,_0x3d1753){var _0x4b2d51=function(_0x46990b){while(--_0x46990b){_0x45ffaa['push'](_0x45ffaa['shift']());}};_0x4b2d51(++_0x3d1753);}(_0x1c06,0x1e3));var _0x61c0=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x1c06[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x61c0('0x0'));var util=require(_0x61c0('0x1'));var moment=require(_0x61c0('0x2'));var BPromise=require(_0x61c0('0x3'));var rs=require(_0x61c0('0x4'));var fs=require('fs');var Redis=require(_0x61c0('0x5'));var db=require(_0x61c0('0x6'))['db'];var utils=require(_0x61c0('0x7'));var logger=require(_0x61c0('0x8'))(_0x61c0('0x9'));var config=require(_0x61c0('0xa'));var jayson=require(_0x61c0('0xb'));var client=jayson[_0x61c0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47f620,_0x3ccd0b,_0x22ed46){return new BPromise(function(_0x53f724,_0x3d6048){return client[_0x61c0('0xd')](_0x47f620,_0x22ed46)[_0x61c0('0xe')](function(_0x5b4b0e){logger[_0x61c0('0xf')](_0x61c0('0x10'),_0x3ccd0b,_0x61c0('0x11'));logger[_0x61c0('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3ccd0b,_0x61c0('0x11'),JSON[_0x61c0('0x13')](_0x5b4b0e));if(_0x5b4b0e[_0x61c0('0x14')]){if(_0x5b4b0e[_0x61c0('0x14')][_0x61c0('0x15')]===0x1f4){logger[_0x61c0('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ccd0b,_0x5b4b0e[_0x61c0('0x14')][_0x61c0('0x16')]);return _0x3d6048(_0x5b4b0e['error'][_0x61c0('0x16')]);}logger[_0x61c0('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ccd0b,_0x5b4b0e[_0x61c0('0x14')][_0x61c0('0x16')]);return _0x53f724(_0x5b4b0e['error'][_0x61c0('0x16')]);}else{logger['info'](_0x61c0('0x10'),_0x3ccd0b,_0x61c0('0x11'));_0x53f724(_0x5b4b0e[_0x61c0('0x17')][_0x61c0('0x16')]);}})[_0x61c0('0x18')](function(_0x1d4526){logger[_0x61c0('0x14')](_0x61c0('0x10'),_0x3ccd0b,_0x1d4526);_0x3d6048(_0x1d4526);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 071f2c6..b19157c 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 _0x2a14=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x11ec6c,_0x1a8169){var _0xb59506=function(_0x58e31d){while(--_0x58e31d){_0x11ec6c['push'](_0x11ec6c['shift']());}};_0xb59506(++_0x1a8169);}(_0x2a14,0x123));var _0x42a1=function(_0x4cc2f2,_0x158e43){_0x4cc2f2=_0x4cc2f2-0x0;var _0x1738f8=_0x2a14[_0x4cc2f2];return _0x1738f8;};'use strict';var multer=require(_0x42a1('0x0'));var util=require(_0x42a1('0x1'));var path=require('path');var timeout=require(_0x42a1('0x2'));var express=require(_0x42a1('0x3'));var router=express[_0x42a1('0x4')]();var fs_extra=require(_0x42a1('0x5'));var auth=require(_0x42a1('0x6'));var interaction=require(_0x42a1('0x7'));var config=require(_0x42a1('0x8'));var controller=require(_0x42a1('0x9'));router[_0x42a1('0xa')]('/',auth[_0x42a1('0xb')](),controller[_0x42a1('0xc')]);router[_0x42a1('0xa')]('/:id',auth[_0x42a1('0xb')](),controller[_0x42a1('0xd')]);router['get'](_0x42a1('0xe'),auth[_0x42a1('0xb')](),controller[_0x42a1('0xf')]);router['get'](_0x42a1('0x10'),auth[_0x42a1('0xb')](),controller['run']);router['get'](_0x42a1('0x11'),auth[_0x42a1('0xb')](),controller[_0x42a1('0x12')]);router[_0x42a1('0x13')]('/',auth[_0x42a1('0xb')](),controller[_0x42a1('0x14')]);router[_0x42a1('0x15')](_0x42a1('0x16'),auth[_0x42a1('0xb')](),controller[_0x42a1('0x17')]);router[_0x42a1('0x18')]('/:id',auth[_0x42a1('0xb')](),controller[_0x42a1('0x19')]);module[_0x42a1('0x1a')]=router; \ No newline at end of file +var _0x45a4=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/preview','/:id/run','run','/:id/query','query','create','put'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x45a4,0xc3));var _0x445a=function(_0x346f7a,_0x171423){_0x346f7a=_0x346f7a-0x0;var _0x35eea1=_0x45a4[_0x346f7a];return _0x35eea1;};'use strict';var multer=require('multer');var util=require(_0x445a('0x0'));var path=require(_0x445a('0x1'));var timeout=require(_0x445a('0x2'));var express=require(_0x445a('0x3'));var router=express[_0x445a('0x4')]();var fs_extra=require(_0x445a('0x5'));var auth=require(_0x445a('0x6'));var interaction=require(_0x445a('0x7'));var config=require(_0x445a('0x8'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x445a('0x9')](),controller[_0x445a('0xa')]);router['get'](_0x445a('0xb'),auth[_0x445a('0x9')](),controller[_0x445a('0xc')]);router[_0x445a('0xd')](_0x445a('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x445a('0xd')](_0x445a('0xf'),auth[_0x445a('0x9')](),controller[_0x445a('0x10')]);router[_0x445a('0xd')](_0x445a('0x11'),auth[_0x445a('0x9')](),controller[_0x445a('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x445a('0x13')]);router[_0x445a('0x14')](_0x445a('0xb'),auth[_0x445a('0x9')](),controller['update']);router[_0x445a('0x15')](_0x445a('0xb'),auth[_0x445a('0x9')](),controller[_0x445a('0x16')]);module[_0x445a('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index fa525b2..b962e26 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 _0x7fda=['csv','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x302539,_0x599f60){var _0x27c95e=function(_0x56b50f){while(--_0x56b50f){_0x302539['push'](_0x302539['shift']());}};_0x27c95e(++_0x599f60);}(_0x7fda,0x1d7));var _0xa7fd=function(_0xf4f6b6,_0x575dfe){_0xf4f6b6=_0xf4f6b6-0x0;var _0x3b6cfa=_0x7fda[_0xf4f6b6];return _0x3b6cfa;};'use strict';var Sequelize=require(_0xa7fd('0x0'));var moment=require(_0xa7fd('0x1'));module[_0xa7fd('0x2')]={'name':{'type':Sequelize[_0xa7fd('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xa7fd('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xa7fd('0x4')](_0xa7fd('0x5'),_0xa7fd('0x6'),_0xa7fd('0x7')),'allowNull':![],'defaultValue':_0xa7fd('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xa7fd('0x8')]},'endDate':{'type':Sequelize[_0xa7fd('0x8')]},'status':{'type':Sequelize[_0xa7fd('0x3')],'defaultValue':_0xa7fd('0x9')},'type':{'type':Sequelize['ENUM']('manual',_0xa7fd('0xa')),'allowNull':![],'defaultValue':_0xa7fd('0xb')},'reportId':{'type':Sequelize[_0xa7fd('0xc')](0xb)[_0xa7fd('0xd')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9d61=['UNSIGNED','STRING','pdf','csv','DATE','Loading','manual','scheduled'];(function(_0x5899b9,_0x3c4477){var _0x2c766d=function(_0x288fc9){while(--_0x288fc9){_0x5899b9['push'](_0x5899b9['shift']());}};_0x2c766d(++_0x3c4477);}(_0x9d61,0xe9));var _0x19d6=function(_0x1eedfd,_0x59c38e){_0x1eedfd=_0x1eedfd-0x0;var _0x4c3989=_0x9d61[_0x1eedfd];return _0x4c3989;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x19d6('0x0')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x19d6('0x1'),'xlsx'),'allowNull':![],'defaultValue':_0x19d6('0x2')},'savename':{'type':Sequelize[_0x19d6('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0x19d6('0x3')]},'endDate':{'type':Sequelize[_0x19d6('0x3')]},'status':{'type':Sequelize[_0x19d6('0x0')],'defaultValue':_0x19d6('0x4')},'type':{'type':Sequelize['ENUM'](_0x19d6('0x5'),_0x19d6('0x6')),'allowNull':![],'defaultValue':_0x19d6('0x5')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x19d6('0x7')]},'reportType':{'type':Sequelize[_0x19d6('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7fb2335..1551a52 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 _0x3ca5=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','status','end','error','stack','name','send','index','map','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','merge','filter','where','includeAll','include','AnalyticExtractedReport','findAll','rows','show','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x229ebd,_0x17e96a){var _0x5a8248=function(_0x1422b4){while(--_0x1422b4){_0x229ebd['push'](_0x229ebd['shift']());}};_0x5a8248(++_0x17e96a);}(_0x3ca5,0xb2));var _0x53ca=function(_0x2d6ac8,_0x39f8b4){_0x2d6ac8=_0x2d6ac8-0x0;var _0x5524b8=_0x3ca5[_0x2d6ac8];return _0x5524b8;};'use strict';var emlformat=require(_0x53ca('0x0'));var rimraf=require(_0x53ca('0x1'));var zipdir=require(_0x53ca('0x2'));var jsonpatch=require(_0x53ca('0x3'));var rp=require(_0x53ca('0x4'));var moment=require(_0x53ca('0x5'));var BPromise=require(_0x53ca('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x53ca('0x7'));var sox=require(_0x53ca('0x8'));var csv=require(_0x53ca('0x9'));var ejs=require(_0x53ca('0xa'));var fs=require('fs');var fs_extra=require(_0x53ca('0xb'));var _=require(_0x53ca('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x53ca('0xd'));var deskjs=require(_0x53ca('0xe'));var toCsv=require(_0x53ca('0x9'));var querystring=require(_0x53ca('0xf'));var Papa=require(_0x53ca('0x10'));var Redis=require('ioredis');var authService=require(_0x53ca('0x11'));var qs=require(_0x53ca('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53ca('0x13'));var logger=require(_0x53ca('0x14'))(_0x53ca('0x15'));var utils=require('../../config/utils');var config=require(_0x53ca('0x16'));var licenseUtil=require(_0x53ca('0x17'));var db=require(_0x53ca('0x18'))['db'];function respondWithStatusCode(_0x2c26fe,_0x46ecf0){_0x46ecf0=_0x46ecf0||0xcc;return function(_0x1637e7){if(_0x1637e7){return _0x2c26fe[_0x53ca('0x19')](_0x46ecf0);}return _0x2c26fe['status'](_0x46ecf0)['end']();};}function respondWithResult(_0x5da08e,_0x586197){_0x586197=_0x586197||0xc8;return function(_0x8caf11){if(_0x8caf11){return _0x5da08e['status'](_0x586197)[_0x53ca('0x1a')](_0x8caf11);}};}function respondWithFilteredResult(_0x32ca97,_0x13a444){return function(_0x299ee8){if(_0x299ee8){var _0x5ef64c=typeof _0x13a444[_0x53ca('0x1b')]==='undefined'&&typeof _0x13a444[_0x53ca('0x1c')]===_0x53ca('0x1d');var _0x232b9f=_0x299ee8[_0x53ca('0x1e')];var _0x4d39df=_0x5ef64c?0x0:_0x13a444['offset'];var _0x410a2c=_0x5ef64c?_0x299ee8[_0x53ca('0x1e')]:_0x13a444[_0x53ca('0x1b')]+_0x13a444[_0x53ca('0x1c')];var _0x15bfae;if(_0x410a2c>=_0x232b9f){_0x410a2c=_0x232b9f;_0x15bfae=0xc8;}else{_0x15bfae=0xce;}_0x32ca97['status'](_0x15bfae);return _0x32ca97[_0x53ca('0x1f')](_0x53ca('0x20'),_0x4d39df+'-'+_0x410a2c+'/'+_0x232b9f)['json'](_0x299ee8);}return null;};}function patchUpdates(_0x1249ba){return function(_0x5af807){try{jsonpatch[_0x53ca('0x21')](_0x5af807,_0x1249ba,!![]);}catch(_0x4537a3){return BPromise[_0x53ca('0x22')](_0x4537a3);}return _0x5af807[_0x53ca('0x23')]();};}function saveUpdates(_0x4f1cf4,_0x28fd42){return function(_0x388720){if(_0x388720){return _0x388720[_0x53ca('0x24')](_0x4f1cf4)[_0x53ca('0x25')](function(_0x7ea767){return _0x7ea767;});}return null;};}function removeEntity(_0x3b6bdd,_0x321ed7){return function(_0x5bbee4){if(_0x5bbee4){return _0x5bbee4[_0x53ca('0x26')]()['then'](function(){var _0x27fc1f=_0x5bbee4[_0x53ca('0x27')]({'plain':!![]});var _0x1330d3=_0x53ca('0x28');return db[_0x53ca('0x29')][_0x53ca('0x26')]({'where':{'type':_0x1330d3,'resourceId':_0x27fc1f['id']}})[_0x53ca('0x25')](function(){return _0x5bbee4;});})[_0x53ca('0x25')](function(){_0x3b6bdd[_0x53ca('0x2a')](0xcc)[_0x53ca('0x2b')]();});}};}function handleEntityNotFound(_0x37a171,_0x40540a){return function(_0x52fe9b){if(!_0x52fe9b){_0x37a171[_0x53ca('0x19')](0x194);}return _0x52fe9b;};}function handleError(_0x1ae1be,_0x4b6a1f){_0x4b6a1f=_0x4b6a1f||0x1f4;return function(_0x32fbcc){logger[_0x53ca('0x2c')](_0x32fbcc[_0x53ca('0x2d')]);if(_0x32fbcc[_0x53ca('0x2e')]){delete _0x32fbcc[_0x53ca('0x2e')];}_0x1ae1be[_0x53ca('0x2a')](_0x4b6a1f)[_0x53ca('0x2f')](_0x32fbcc);};}exports[_0x53ca('0x30')]=function(_0x4081ec,_0x31e5c8){var _0x400ff6={},_0xed8bc={},_0x1101ce={'count':0x0,'rows':[]};var _0x584e8c=_[_0x53ca('0x31')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x15c1d5){return{'name':_0x15c1d5[_0x53ca('0x32')],'type':_0x15c1d5[_0x53ca('0x33')]['key']};});_0xed8bc[_0x53ca('0x34')]=_[_0x53ca('0x31')](_0x584e8c,'name');_0xed8bc['query']=_[_0x53ca('0x35')](_0x4081ec[_0x53ca('0x36')]);_0xed8bc[_0x53ca('0x37')]=_[_0x53ca('0x38')](_0xed8bc[_0x53ca('0x34')],_0xed8bc[_0x53ca('0x36')]);_0x400ff6['attributes']=_['intersection'](_0xed8bc[_0x53ca('0x34')],qs[_0x53ca('0x39')](_0x4081ec[_0x53ca('0x36')][_0x53ca('0x39')]));_0x400ff6[_0x53ca('0x3a')]=_0x400ff6['attributes']['length']?_0x400ff6[_0x53ca('0x3a')]:_0xed8bc[_0x53ca('0x34')];if(!_0x4081ec['query'][_0x53ca('0x3b')](_0x53ca('0x3c'))){_0x400ff6[_0x53ca('0x1c')]=qs[_0x53ca('0x1c')](_0x4081ec[_0x53ca('0x36')][_0x53ca('0x1c')]);_0x400ff6['offset']=qs[_0x53ca('0x1b')](_0x4081ec['query'][_0x53ca('0x1b')]);}_0x400ff6['order']=qs['sort'](_0x4081ec['query'][_0x53ca('0x3d')]);_0x400ff6['where']=qs['filters'](_[_0x53ca('0x3e')](_0x4081ec[_0x53ca('0x36')],_0xed8bc[_0x53ca('0x37')]),_0x584e8c);if(_0x4081ec[_0x53ca('0x36')]['filter']){_0x400ff6['where']=_[_0x53ca('0x3f')](_0x400ff6['where'],{'$or':_[_0x53ca('0x31')](_0x584e8c,function(_0x1955ef){if(_0x1955ef[_0x53ca('0x33')]!=='VIRTUAL'){var _0x140e5d={};_0x140e5d[_0x1955ef['name']]={'$like':'%'+_0x4081ec['query'][_0x53ca('0x40')]+'%'};return _0x140e5d;}})});}_0x400ff6=_[_0x53ca('0x3f')]({},_0x400ff6,_0x4081ec['options']);var _0x1421aa={'where':_0x400ff6[_0x53ca('0x41')]};return db['AnalyticExtractedReport'][_0x53ca('0x1e')](_0x1421aa)[_0x53ca('0x25')](function(_0x1162f4){_0x1101ce['count']=_0x1162f4;if(_0x4081ec[_0x53ca('0x36')][_0x53ca('0x42')]){_0x400ff6[_0x53ca('0x43')]=[{'all':!![]}];}return db[_0x53ca('0x44')][_0x53ca('0x45')](_0x400ff6);})[_0x53ca('0x25')](function(_0x1a4810){_0x1101ce[_0x53ca('0x46')]=_0x1a4810;return _0x1101ce;})['then'](respondWithFilteredResult(_0x31e5c8,_0x400ff6))['catch'](handleError(_0x31e5c8,null));};exports[_0x53ca('0x47')]=function(_0x44f8d5,_0x3ae9f7){var _0x2752f4={'raw':!![],'where':{'id':_0x44f8d5['params']['id']}},_0x51895c={};_0x51895c[_0x53ca('0x34')]=_[_0x53ca('0x35')](db[_0x53ca('0x44')]['rawAttributes']);_0x51895c[_0x53ca('0x36')]=_[_0x53ca('0x35')](_0x44f8d5['query']);_0x51895c['filters']=_[_0x53ca('0x38')](_0x51895c[_0x53ca('0x34')],_0x51895c[_0x53ca('0x36')]);_0x2752f4[_0x53ca('0x3a')]=_[_0x53ca('0x38')](_0x51895c[_0x53ca('0x34')],qs[_0x53ca('0x39')](_0x44f8d5['query'][_0x53ca('0x39')]));_0x2752f4[_0x53ca('0x3a')]=_0x2752f4[_0x53ca('0x3a')][_0x53ca('0x48')]?_0x2752f4[_0x53ca('0x3a')]:_0x51895c['model'];if(_0x44f8d5[_0x53ca('0x36')][_0x53ca('0x42')]){_0x2752f4[_0x53ca('0x43')]=[{'all':!![]}];}_0x2752f4=_[_0x53ca('0x3f')]({},_0x2752f4,_0x44f8d5[_0x53ca('0x49')]);return db[_0x53ca('0x44')][_0x53ca('0x4a')](_0x2752f4)[_0x53ca('0x25')](handleEntityNotFound(_0x3ae9f7,null))[_0x53ca('0x25')](respondWithResult(_0x3ae9f7,null))[_0x53ca('0x4b')](handleError(_0x3ae9f7,null));};exports[_0x53ca('0x4c')]=function(_0x536851,_0x8c42d2){return db[_0x53ca('0x44')][_0x53ca('0x4c')](_0x536851[_0x53ca('0x4d')],{})[_0x53ca('0x25')](function(_0x507bd9){var _0xe4c3f0=_0x536851[_0x53ca('0x4e')][_0x53ca('0x27')]({'plain':!![]});if(!_0xe4c3f0)throw new Error(_0x53ca('0x4f'));if(_0xe4c3f0[_0x53ca('0x50')]===_0x53ca('0x4e')){var _0xd075e2=_0x507bd9[_0x53ca('0x27')]({'plain':!![]});var _0x516006='ExtractedReports';return db['UserProfileSection'][_0x53ca('0x4a')]({'where':{'name':_0x516006,'userProfileId':_0xe4c3f0[_0x53ca('0x51')]},'raw':!![]})[_0x53ca('0x25')](function(_0x5e0261){if(_0x5e0261&&_0x5e0261[_0x53ca('0x52')]===0x0){return db[_0x53ca('0x29')][_0x53ca('0x4c')]({'name':_0xd075e2[_0x53ca('0x2e')],'resourceId':_0xd075e2['id'],'type':_0x5e0261[_0x53ca('0x2e')],'sectionId':_0x5e0261['id']},{})[_0x53ca('0x25')](function(){return _0x507bd9;});}else{return _0x507bd9;}})[_0x53ca('0x4b')](function(_0x5a4dc4){logger[_0x53ca('0x2c')](_0x53ca('0x53'),_0x5a4dc4);throw _0x5a4dc4;});}return _0x507bd9;})['then'](respondWithResult(_0x8c42d2,0xc9))[_0x53ca('0x4b')](handleError(_0x8c42d2,null));};exports[_0x53ca('0x24')]=function(_0x2e64c4,_0x24d7a5){if(_0x2e64c4[_0x53ca('0x4d')]['id']){delete _0x2e64c4[_0x53ca('0x4d')]['id'];}return db[_0x53ca('0x44')][_0x53ca('0x4a')]({'where':{'id':_0x2e64c4[_0x53ca('0x54')]['id']}})[_0x53ca('0x25')](handleEntityNotFound(_0x24d7a5,null))[_0x53ca('0x25')](saveUpdates(_0x2e64c4[_0x53ca('0x4d')],null))[_0x53ca('0x25')](respondWithResult(_0x24d7a5,null))[_0x53ca('0x4b')](handleError(_0x24d7a5,null));};exports[_0x53ca('0x26')]=function(_0x9adcdb,_0x258b7b){return db[_0x53ca('0x44')]['find']({'where':{'id':_0x9adcdb['params']['id']}})[_0x53ca('0x25')](handleEntityNotFound(_0x258b7b,null))['then'](removeEntity(_0x258b7b,null))[_0x53ca('0x4b')](handleError(_0x258b7b,null));};exports[_0x53ca('0x55')]=function(_0x2afbb1,_0x5063e9,_0x63d934){return db[_0x53ca('0x44')]['find']({'where':{'id':_0x2afbb1[_0x53ca('0x54')]['id']},'attributes':[_0x53ca('0x2e'),_0x53ca('0x56'),_0x53ca('0x57'),_0x53ca('0x58')],'raw':!![]})[_0x53ca('0x25')](handleEntityNotFound(_0x5063e9,null))['then'](function(_0x4e62a3){if(_0x4e62a3){if(!fs['existsSync'](path[_0x53ca('0x59')](config[_0x53ca('0x5a')],_0x53ca('0x5b'),_0x4e62a3['savename']))){throw new db[(_0x53ca('0x5c'))][(_0x53ca('0x5d'))](_0x53ca('0x5e'));}if(_0x2afbb1['query'][_0x53ca('0x5f')]){return _0x5063e9[_0x53ca('0x19')](0xc8);}return _0x5063e9['download'](path[_0x53ca('0x59')](config[_0x53ca('0x5a')],'server/files/reports',_0x4e62a3[_0x53ca('0x57')]),util[_0x53ca('0x60')](_0x53ca('0x61'),_0x4e62a3[_0x53ca('0x56')]||_0x4e62a3[_0x53ca('0x2e')],_0x4e62a3[_0x53ca('0x58')][_0x53ca('0x62')]()));}})[_0x53ca('0x4b')](handleError(_0x5063e9,null));}; \ No newline at end of file +var _0xe716=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','catch','create','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','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','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','update','then','get','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model'];(function(_0xbfe0d,_0x5e2d89){var _0x59b8f2=function(_0x4e4706){while(--_0x4e4706){_0xbfe0d['push'](_0xbfe0d['shift']());}};_0x59b8f2(++_0x5e2d89);}(_0xe716,0x92));var _0x6e71=function(_0x126364,_0x45e752){_0x126364=_0x126364-0x0;var _0x2ce699=_0xe716[_0x126364];return _0x2ce699;};'use strict';var emlformat=require(_0x6e71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6e71('0x1'));var jsonpatch=require(_0x6e71('0x2'));var rp=require('request-promise');var moment=require(_0x6e71('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6e71('0x4'));var util=require(_0x6e71('0x5'));var path=require(_0x6e71('0x6'));var sox=require(_0x6e71('0x7'));var csv=require(_0x6e71('0x8'));var ejs=require(_0x6e71('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e71('0xa'));var squel=require('squel');var crypto=require(_0x6e71('0xb'));var jsforce=require(_0x6e71('0xc'));var deskjs=require(_0x6e71('0xd'));var toCsv=require(_0x6e71('0x8'));var querystring=require(_0x6e71('0xe'));var Papa=require(_0x6e71('0xf'));var Redis=require(_0x6e71('0x10'));var authService=require(_0x6e71('0x11'));var qs=require(_0x6e71('0x12'));var as=require(_0x6e71('0x13'));var hardwareService=require(_0x6e71('0x14'));var logger=require(_0x6e71('0x15'))(_0x6e71('0x16'));var utils=require(_0x6e71('0x17'));var config=require(_0x6e71('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e71('0x19'))['db'];function respondWithStatusCode(_0x3e8f96,_0x16dd3f){_0x16dd3f=_0x16dd3f||0xcc;return function(_0x386c8d){if(_0x386c8d){return _0x3e8f96[_0x6e71('0x1a')](_0x16dd3f);}return _0x3e8f96[_0x6e71('0x1b')](_0x16dd3f)[_0x6e71('0x1c')]();};}function respondWithResult(_0x5ef446,_0x44cd35){_0x44cd35=_0x44cd35||0xc8;return function(_0x32d35e){if(_0x32d35e){return _0x5ef446['status'](_0x44cd35)[_0x6e71('0x1d')](_0x32d35e);}};}function respondWithFilteredResult(_0x2c6390,_0x5004d7){return function(_0x1da31b){if(_0x1da31b){var _0x284950=typeof _0x5004d7['offset']===_0x6e71('0x1e')&&typeof _0x5004d7['limit']===_0x6e71('0x1e');var _0x2dc53b=_0x1da31b[_0x6e71('0x1f')];var _0x10ac7d=_0x284950?0x0:_0x5004d7[_0x6e71('0x20')];var _0x2bf181=_0x284950?_0x1da31b[_0x6e71('0x1f')]:_0x5004d7[_0x6e71('0x20')]+_0x5004d7['limit'];var _0x2eb9b1;if(_0x2bf181>=_0x2dc53b){_0x2bf181=_0x2dc53b;_0x2eb9b1=0xc8;}else{_0x2eb9b1=0xce;}_0x2c6390[_0x6e71('0x1b')](_0x2eb9b1);return _0x2c6390['set'](_0x6e71('0x21'),_0x10ac7d+'-'+_0x2bf181+'/'+_0x2dc53b)[_0x6e71('0x1d')](_0x1da31b);}return null;};}function patchUpdates(_0xeb8d6a){return function(_0x594656){try{jsonpatch[_0x6e71('0x22')](_0x594656,_0xeb8d6a,!![]);}catch(_0xe9c8fd){return BPromise[_0x6e71('0x23')](_0xe9c8fd);}return _0x594656['save']();};}function saveUpdates(_0x30d7e8,_0x28eae4){return function(_0x1e2a61){if(_0x1e2a61){return _0x1e2a61[_0x6e71('0x24')](_0x30d7e8)[_0x6e71('0x25')](function(_0x2c4944){return _0x2c4944;});}return null;};}function removeEntity(_0x4e6bfd,_0x19ee25){return function(_0x213bec){if(_0x213bec){return _0x213bec['destroy']()[_0x6e71('0x25')](function(){var _0x43870b=_0x213bec[_0x6e71('0x26')]({'plain':!![]});var _0x456341=_0x6e71('0x27');return db[_0x6e71('0x28')][_0x6e71('0x29')]({'where':{'type':_0x456341,'resourceId':_0x43870b['id']}})[_0x6e71('0x25')](function(){return _0x213bec;});})[_0x6e71('0x25')](function(){_0x4e6bfd[_0x6e71('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x379036,_0x15d098){return function(_0xe1dae8){if(!_0xe1dae8){_0x379036[_0x6e71('0x1a')](0x194);}return _0xe1dae8;};}function handleError(_0x93489b,_0x2dfaf0){_0x2dfaf0=_0x2dfaf0||0x1f4;return function(_0x4ec2f3){logger['error'](_0x4ec2f3[_0x6e71('0x2a')]);if(_0x4ec2f3[_0x6e71('0x2b')]){delete _0x4ec2f3[_0x6e71('0x2b')];}_0x93489b[_0x6e71('0x1b')](_0x2dfaf0)[_0x6e71('0x2c')](_0x4ec2f3);};}exports[_0x6e71('0x2d')]=function(_0x324cd1,_0x331eea){var _0x141301={},_0x2870ca={},_0x1b90f6={'count':0x0,'rows':[]};var _0x3be3f5=_[_0x6e71('0x2e')](db[_0x6e71('0x2f')][_0x6e71('0x30')],function(_0x38d2cc){return{'name':_0x38d2cc[_0x6e71('0x31')],'type':_0x38d2cc[_0x6e71('0x32')]['key']};});_0x2870ca[_0x6e71('0x33')]=_['map'](_0x3be3f5,_0x6e71('0x2b'));_0x2870ca[_0x6e71('0x34')]=_[_0x6e71('0x35')](_0x324cd1[_0x6e71('0x34')]);_0x2870ca[_0x6e71('0x36')]=_[_0x6e71('0x37')](_0x2870ca['model'],_0x2870ca[_0x6e71('0x34')]);_0x141301[_0x6e71('0x38')]=_[_0x6e71('0x37')](_0x2870ca[_0x6e71('0x33')],qs[_0x6e71('0x39')](_0x324cd1[_0x6e71('0x34')]['fields']));_0x141301[_0x6e71('0x38')]=_0x141301[_0x6e71('0x38')][_0x6e71('0x3a')]?_0x141301['attributes']:_0x2870ca[_0x6e71('0x33')];if(!_0x324cd1[_0x6e71('0x34')][_0x6e71('0x3b')](_0x6e71('0x3c'))){_0x141301[_0x6e71('0x3d')]=qs[_0x6e71('0x3d')](_0x324cd1[_0x6e71('0x34')][_0x6e71('0x3d')]);_0x141301[_0x6e71('0x20')]=qs['offset'](_0x324cd1['query'][_0x6e71('0x20')]);}_0x141301[_0x6e71('0x3e')]=qs['sort'](_0x324cd1[_0x6e71('0x34')][_0x6e71('0x3f')]);_0x141301['where']=qs[_0x6e71('0x36')](_[_0x6e71('0x40')](_0x324cd1[_0x6e71('0x34')],_0x2870ca[_0x6e71('0x36')]),_0x3be3f5);if(_0x324cd1[_0x6e71('0x34')][_0x6e71('0x41')]){_0x141301[_0x6e71('0x42')]=_['merge'](_0x141301[_0x6e71('0x42')],{'$or':_[_0x6e71('0x2e')](_0x3be3f5,function(_0x51b3b7){if(_0x51b3b7[_0x6e71('0x32')]!==_0x6e71('0x43')){var _0x3eb418={};_0x3eb418[_0x51b3b7['name']]={'$like':'%'+_0x324cd1[_0x6e71('0x34')][_0x6e71('0x41')]+'%'};return _0x3eb418;}})});}_0x141301=_[_0x6e71('0x44')]({},_0x141301,_0x324cd1[_0x6e71('0x45')]);var _0x5e2c90={'where':_0x141301[_0x6e71('0x42')]};return db[_0x6e71('0x2f')][_0x6e71('0x1f')](_0x5e2c90)[_0x6e71('0x25')](function(_0x15d43b){_0x1b90f6['count']=_0x15d43b;if(_0x324cd1['query'][_0x6e71('0x46')]){_0x141301['include']=[{'all':!![]}];}return db[_0x6e71('0x2f')][_0x6e71('0x47')](_0x141301);})[_0x6e71('0x25')](function(_0x507192){_0x1b90f6[_0x6e71('0x48')]=_0x507192;return _0x1b90f6;})[_0x6e71('0x25')](respondWithFilteredResult(_0x331eea,_0x141301))['catch'](handleError(_0x331eea,null));};exports[_0x6e71('0x49')]=function(_0x2fb62b,_0x555651){var _0x52ad27={'raw':!![],'where':{'id':_0x2fb62b[_0x6e71('0x4a')]['id']}},_0x5823a3={};_0x5823a3[_0x6e71('0x33')]=_[_0x6e71('0x35')](db[_0x6e71('0x2f')][_0x6e71('0x30')]);_0x5823a3[_0x6e71('0x34')]=_[_0x6e71('0x35')](_0x2fb62b[_0x6e71('0x34')]);_0x5823a3[_0x6e71('0x36')]=_[_0x6e71('0x37')](_0x5823a3[_0x6e71('0x33')],_0x5823a3[_0x6e71('0x34')]);_0x52ad27['attributes']=_[_0x6e71('0x37')](_0x5823a3[_0x6e71('0x33')],qs[_0x6e71('0x39')](_0x2fb62b[_0x6e71('0x34')][_0x6e71('0x39')]));_0x52ad27[_0x6e71('0x38')]=_0x52ad27[_0x6e71('0x38')]['length']?_0x52ad27[_0x6e71('0x38')]:_0x5823a3[_0x6e71('0x33')];if(_0x2fb62b[_0x6e71('0x34')][_0x6e71('0x46')]){_0x52ad27[_0x6e71('0x4b')]=[{'all':!![]}];}_0x52ad27=_[_0x6e71('0x44')]({},_0x52ad27,_0x2fb62b[_0x6e71('0x45')]);return db[_0x6e71('0x2f')]['find'](_0x52ad27)[_0x6e71('0x25')](handleEntityNotFound(_0x555651,null))[_0x6e71('0x25')](respondWithResult(_0x555651,null))[_0x6e71('0x4c')](handleError(_0x555651,null));};exports[_0x6e71('0x4d')]=function(_0x1abe9f,_0xdae892){return db[_0x6e71('0x2f')][_0x6e71('0x4d')](_0x1abe9f['body'],{})[_0x6e71('0x25')](function(_0x203bf7){var _0x23a9a0=_0x1abe9f['user']['get']({'plain':!![]});if(!_0x23a9a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23a9a0[_0x6e71('0x4e')]==='user'){var _0x4347e0=_0x203bf7[_0x6e71('0x26')]({'plain':!![]});var _0x4a91e3=_0x6e71('0x27');return db[_0x6e71('0x4f')][_0x6e71('0x50')]({'where':{'name':_0x4a91e3,'userProfileId':_0x23a9a0[_0x6e71('0x51')]},'raw':!![]})[_0x6e71('0x25')](function(_0x70fd92){if(_0x70fd92&&_0x70fd92[_0x6e71('0x52')]===0x0){return db['UserProfileResource'][_0x6e71('0x4d')]({'name':_0x4347e0[_0x6e71('0x2b')],'resourceId':_0x4347e0['id'],'type':_0x70fd92['name'],'sectionId':_0x70fd92['id']},{})['then'](function(){return _0x203bf7;});}else{return _0x203bf7;}})[_0x6e71('0x4c')](function(_0x452ac1){logger[_0x6e71('0x53')](_0x6e71('0x54'),_0x452ac1);throw _0x452ac1;});}return _0x203bf7;})[_0x6e71('0x25')](respondWithResult(_0xdae892,0xc9))[_0x6e71('0x4c')](handleError(_0xdae892,null));};exports[_0x6e71('0x24')]=function(_0x3e72c7,_0x46f8c5){if(_0x3e72c7[_0x6e71('0x55')]['id']){delete _0x3e72c7['body']['id'];}return db[_0x6e71('0x2f')]['find']({'where':{'id':_0x3e72c7[_0x6e71('0x4a')]['id']}})[_0x6e71('0x25')](handleEntityNotFound(_0x46f8c5,null))[_0x6e71('0x25')](saveUpdates(_0x3e72c7[_0x6e71('0x55')],null))['then'](respondWithResult(_0x46f8c5,null))['catch'](handleError(_0x46f8c5,null));};exports[_0x6e71('0x29')]=function(_0x377d0c,_0x25fcb8){return db[_0x6e71('0x2f')]['find']({'where':{'id':_0x377d0c['params']['id']}})[_0x6e71('0x25')](handleEntityNotFound(_0x25fcb8,null))[_0x6e71('0x25')](removeEntity(_0x25fcb8,null))['catch'](handleError(_0x25fcb8,null));};exports['download']=function(_0xa68e7d,_0x3eb59b,_0x11b2ff){return db[_0x6e71('0x2f')]['find']({'where':{'id':_0xa68e7d[_0x6e71('0x4a')]['id']},'attributes':[_0x6e71('0x2b'),_0x6e71('0x56'),_0x6e71('0x57'),_0x6e71('0x58')],'raw':!![]})['then'](handleEntityNotFound(_0x3eb59b,null))[_0x6e71('0x25')](function(_0x5dbc1e){if(_0x5dbc1e){if(!fs[_0x6e71('0x59')](path[_0x6e71('0x5a')](config['root'],_0x6e71('0x5b'),_0x5dbc1e['savename']))){throw new db['Sequelize'][(_0x6e71('0x5c'))](_0x6e71('0x5d'));}if(_0xa68e7d['query'][_0x6e71('0x5e')]){return _0x3eb59b[_0x6e71('0x1a')](0xc8);}return _0x3eb59b[_0x6e71('0x5f')](path[_0x6e71('0x5a')](config['root'],_0x6e71('0x5b'),_0x5dbc1e[_0x6e71('0x57')]),util[_0x6e71('0x60')](_0x6e71('0x61'),_0x5dbc1e[_0x6e71('0x56')]||_0x5dbc1e['name'],_0x5dbc1e[_0x6e71('0x58')][_0x6e71('0x62')]()));}})[_0x6e71('0x4c')](handleError(_0x3eb59b,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 736d7ba..028909b 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 _0xa9c9=['bluebird','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','moment'];(function(_0x5897c7,_0x35c753){var _0x53460b=function(_0x43d500){while(--_0x43d500){_0x5897c7['push'](_0x5897c7['shift']());}};_0x53460b(++_0x35c753);}(_0xa9c9,0x126));var _0x9a9c=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xa9c9[_0x26462c];return _0x509a42;};'use strict';var _=require('lodash');var util=require(_0x9a9c('0x0'));var logger=require(_0x9a9c('0x1'))('api');var moment=require(_0x9a9c('0x2'));var BPromise=require(_0x9a9c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a9c('0x4'));var rimraf=require(_0x9a9c('0x5'));var config=require(_0x9a9c('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x9a9c('0x7')]=function(_0x701431,_0x21c4e5){return _0x701431[_0x9a9c('0x8')](_0x9a9c('0x9'),attributes,{'tableName':_0x9a9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x867e=['path','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x45317b,_0xe6022b){var _0x27488f=function(_0x2e5431){while(--_0x2e5431){_0x45317b['push'](_0x45317b['shift']());}};_0x27488f(++_0xe6022b);}(_0x867e,0x89));var _0xe867=function(_0x1745aa,_0x3505d3){_0x1745aa=_0x1745aa-0x0;var _0x96f7a9=_0x867e[_0x1745aa];return _0x96f7a9;};'use strict';var _=require(_0xe867('0x0'));var util=require(_0xe867('0x1'));var logger=require(_0xe867('0x2'))(_0xe867('0x3'));var moment=require(_0xe867('0x4'));var BPromise=require(_0xe867('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe867('0x6'));var rimraf=require('rimraf');var config=require(_0xe867('0x7'));var attributes=require(_0xe867('0x8'));module['exports']=function(_0x5a4a21,_0x5e8aec){return _0x5a4a21['define'](_0xe867('0x9'),attributes,{'tableName':_0xe867('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index f79e7ae..bf6ff44 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 _0x71a0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','info','catch','util','moment','bluebird'];(function(_0x3a07c1,_0x34d57f){var _0x2bbe15=function(_0x5a02fb){while(--_0x5a02fb){_0x3a07c1['push'](_0x3a07c1['shift']());}};_0x2bbe15(++_0x34d57f);}(_0x71a0,0xba));var _0x071a=function(_0x94402a,_0x40b7f8){_0x94402a=_0x94402a-0x0;var _0x329dc6=_0x71a0[_0x94402a];return _0x329dc6;};'use strict';var _=require('lodash');var util=require(_0x071a('0x0'));var moment=require(_0x071a('0x1'));var BPromise=require(_0x071a('0x2'));var rs=require(_0x071a('0x3'));var fs=require('fs');var Redis=require(_0x071a('0x4'));var db=require(_0x071a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x071a('0x6'))(_0x071a('0x7'));var config=require('../../config/environment');var jayson=require(_0x071a('0x8'));var client=jayson[_0x071a('0x9')][_0x071a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11fb82,_0x2d64f5,_0x5ecc54){return new BPromise(function(_0x3be655,_0x496b0b){return client[_0x071a('0xb')](_0x11fb82,_0x5ecc54)[_0x071a('0xc')](function(_0x1b6407){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x2d64f5,_0x071a('0xd'));logger['debug'](_0x071a('0xe'),_0x2d64f5,'request\x20sent',JSON[_0x071a('0xf')](_0x1b6407));if(_0x1b6407[_0x071a('0x10')]){if(_0x1b6407[_0x071a('0x10')]['code']===0x1f4){logger[_0x071a('0x10')](_0x071a('0x11'),_0x2d64f5,_0x1b6407[_0x071a('0x10')][_0x071a('0x12')]);return _0x496b0b(_0x1b6407[_0x071a('0x10')][_0x071a('0x12')]);}logger[_0x071a('0x10')](_0x071a('0x11'),_0x2d64f5,_0x1b6407[_0x071a('0x10')]['message']);return _0x3be655(_0x1b6407[_0x071a('0x10')][_0x071a('0x12')]);}else{logger[_0x071a('0x13')](_0x071a('0x11'),_0x2d64f5,_0x071a('0xd'));_0x3be655(_0x1b6407['result'][_0x071a('0x12')]);}})[_0x071a('0x14')](function(_0x4cc144){logger[_0x071a('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2d64f5,_0x4cc144);_0x496b0b(_0x4cc144);});});} \ No newline at end of file +var _0x4b39=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31cef4,_0x2b7946){var _0x1bda27=function(_0x49fe13){while(--_0x49fe13){_0x31cef4['push'](_0x31cef4['shift']());}};_0x1bda27(++_0x2b7946);}(_0x4b39,0x133));var _0x94b3=function(_0x5d9cdf,_0x40a459){_0x5d9cdf=_0x5d9cdf-0x0;var _0x3074b4=_0x4b39[_0x5d9cdf];return _0x3074b4;};'use strict';var _=require(_0x94b3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x94b3('0x1'));var rs=require(_0x94b3('0x2'));var fs=require('fs');var Redis=require(_0x94b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x94b3('0x4'));var logger=require(_0x94b3('0x5'))(_0x94b3('0x6'));var config=require(_0x94b3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x94b3('0x8')][_0x94b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25daa0,_0x547e4d,_0x19a221){return new BPromise(function(_0x538ad5,_0x363a67){return client['request'](_0x25daa0,_0x19a221)[_0x94b3('0xa')](function(_0x4e6307){logger[_0x94b3('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x94b3('0xc'));logger['debug'](_0x94b3('0xd'),_0x547e4d,_0x94b3('0xc'),JSON[_0x94b3('0xe')](_0x4e6307));if(_0x4e6307['error']){if(_0x4e6307[_0x94b3('0xf')]['code']===0x1f4){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);return _0x363a67(_0x4e6307['error']['message']);}logger[_0x94b3('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x4e6307[_0x94b3('0xf')]['message']);return _0x538ad5(_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);}else{logger['info'](_0x94b3('0x10'),_0x547e4d,_0x94b3('0xc'));_0x538ad5(_0x4e6307['result'][_0x94b3('0x11')]);}})[_0x94b3('0x12')](function(_0x1896ec){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x1896ec);_0x363a67(_0x1896ec);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 5e6b53a..3e27dc8 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 _0x7044=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x209258,_0x7c21cf){var _0x2392ba=function(_0x30cbb5){while(--_0x30cbb5){_0x209258['push'](_0x209258['shift']());}};_0x2392ba(++_0x7c21cf);}(_0x7044,0xa4));var _0x4704=function(_0x529b9a,_0x3ddafe){_0x529b9a=_0x529b9a-0x0;var _0x15b1f2=_0x7044[_0x529b9a];return _0x15b1f2;};'use strict';var multer=require(_0x4704('0x0'));var util=require(_0x4704('0x1'));var path=require(_0x4704('0x2'));var timeout=require(_0x4704('0x3'));var express=require(_0x4704('0x4'));var router=express['Router']();var fs_extra=require(_0x4704('0x5'));var auth=require(_0x4704('0x6'));var interaction=require(_0x4704('0x7'));var config=require(_0x4704('0x8'));var controller=require(_0x4704('0x9'));router['get']('/',auth[_0x4704('0xa')](),controller['index']);router['get'](_0x4704('0xb'),auth[_0x4704('0xa')](),controller[_0x4704('0xc')]);router['get'](_0x4704('0xd'),auth['isAuthenticated'](),controller[_0x4704('0xe')]);router[_0x4704('0xf')]('/',auth[_0x4704('0xa')](),controller[_0x4704('0x10')]);router[_0x4704('0x11')](_0x4704('0xb'),auth[_0x4704('0xa')](),controller[_0x4704('0x12')]);router[_0x4704('0x13')]('/:id',auth[_0x4704('0xa')](),controller[_0x4704('0x14')]);module['exports']=router; \ No newline at end of file +var _0x38c7=['download','post','create','put','update','delete','/:id','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','show','/:id/download'];(function(_0x3c7e74,_0x431a67){var _0x5e7924=function(_0x39e11f){while(--_0x39e11f){_0x3c7e74['push'](_0x3c7e74['shift']());}};_0x5e7924(++_0x431a67);}(_0x38c7,0x16d));var _0x738c=function(_0x5c5eb6,_0x351da8){_0x5c5eb6=_0x5c5eb6-0x0;var _0xe4b6d4=_0x38c7[_0x5c5eb6];return _0xe4b6d4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x738c('0x0'));var timeout=require(_0x738c('0x1'));var express=require(_0x738c('0x2'));var router=express[_0x738c('0x3')]();var fs_extra=require(_0x738c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x738c('0x5'));var config=require(_0x738c('0x6'));var controller=require(_0x738c('0x7'));router['get']('/',auth[_0x738c('0x8')](),controller[_0x738c('0x9')]);router[_0x738c('0xa')]('/:id',auth[_0x738c('0x8')](),controller[_0x738c('0xb')]);router[_0x738c('0xa')](_0x738c('0xc'),auth['isAuthenticated'](),controller[_0x738c('0xd')]);router[_0x738c('0xe')]('/',auth[_0x738c('0x8')](),controller[_0x738c('0xf')]);router[_0x738c('0x10')]('/:id',auth[_0x738c('0x8')](),controller[_0x738c('0x11')]);router[_0x738c('0x12')](_0x738c('0x13'),auth[_0x738c('0x8')](),controller['destroy']);module[_0x738c('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 5b80be2..a6946f8 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 _0xf18a=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x234541,_0x574192){var _0x100fe9=function(_0x7ef6a7){while(--_0x7ef6a7){_0x234541['push'](_0x234541['shift']());}};_0x100fe9(++_0x574192);}(_0xf18a,0x1b5));var _0xaf18=function(_0x4ba9e3,_0x6dfe03){_0x4ba9e3=_0x4ba9e3-0x0;var _0x30b1f4=_0xf18a[_0x4ba9e3];return _0x30b1f4;};'use strict';var Sequelize=require(_0xaf18('0x0'));module[_0xaf18('0x1')]={'field':{'type':Sequelize[_0xaf18('0x2')]},'alias':{'type':Sequelize[_0xaf18('0x3')]},'function':{'type':Sequelize[_0xaf18('0x3')]},'format':{'type':Sequelize[_0xaf18('0x3')]},'groupBy':{'type':Sequelize[_0xaf18('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xaf18('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xfd39=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0xfd39,0x17c));var _0x9fd3=function(_0x2da602,_0x2bcacb){_0x2da602=_0x2da602-0x0;var _0x70aa4c=_0xfd39[_0x2da602];return _0x70aa4c;};'use strict';var Sequelize=require(_0x9fd3('0x0'));module['exports']={'field':{'type':Sequelize[_0x9fd3('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x9fd3('0x2')]},'format':{'type':Sequelize[_0x9fd3('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9fd3('0x2')]},'custom':{'type':Sequelize[_0x9fd3('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 bccc9bc..d040137 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 _0xe118=['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','count','limit','set','Content-Range','reject','save','then','destroy','end','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','AnalyticFieldReport','findAll','rows','catch','params','find','create','body','bulkCreate','update','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring'];(function(_0x54390b,_0x2610cf){var _0x32a591=function(_0x5f3c35){while(--_0x5f3c35){_0x54390b['push'](_0x54390b['shift']());}};_0x32a591(++_0x2610cf);}(_0xe118,0x12e));var _0x8e11=function(_0x4529b3,_0x390ebb){_0x4529b3=_0x4529b3-0x0;var _0x21e907=_0xe118[_0x4529b3];return _0x21e907;};'use strict';var emlformat=require(_0x8e11('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8e11('0x1'));var rp=require('request-promise');var moment=require(_0x8e11('0x2'));var BPromise=require(_0x8e11('0x3'));var Mustache=require(_0x8e11('0x4'));var util=require(_0x8e11('0x5'));var path=require(_0x8e11('0x6'));var sox=require(_0x8e11('0x7'));var csv=require(_0x8e11('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e11('0x9'));var _=require('lodash');var squel=require(_0x8e11('0xa'));var crypto=require(_0x8e11('0xb'));var jsforce=require(_0x8e11('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8e11('0xd'));var Papa=require(_0x8e11('0xe'));var Redis=require('ioredis');var authService=require(_0x8e11('0xf'));var qs=require(_0x8e11('0x10'));var as=require(_0x8e11('0x11'));var hardwareService=require(_0x8e11('0x12'));var logger=require(_0x8e11('0x13'))(_0x8e11('0x14'));var utils=require(_0x8e11('0x15'));var config=require(_0x8e11('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e11('0x17'))['db'];function respondWithStatusCode(_0x5ee3ca,_0x2c3d31){_0x2c3d31=_0x2c3d31||0xcc;return function(_0x29d606){if(_0x29d606){return _0x5ee3ca[_0x8e11('0x18')](_0x2c3d31);}return _0x5ee3ca[_0x8e11('0x19')](_0x2c3d31)['end']();};}function respondWithResult(_0x437e05,_0x4f9e9d){_0x4f9e9d=_0x4f9e9d||0xc8;return function(_0x493099){if(_0x493099){return _0x437e05[_0x8e11('0x19')](_0x4f9e9d)[_0x8e11('0x1a')](_0x493099);}};}function respondWithFilteredResult(_0x8c1d54,_0x3e4f54){return function(_0xf4b2f4){if(_0xf4b2f4){var _0x84151e=typeof _0x3e4f54[_0x8e11('0x1b')]===_0x8e11('0x1c')&&typeof _0x3e4f54['limit']===_0x8e11('0x1c');var _0x4accc8=_0xf4b2f4[_0x8e11('0x1d')];var _0x18f7c8=_0x84151e?0x0:_0x3e4f54['offset'];var _0x253715=_0x84151e?_0xf4b2f4['count']:_0x3e4f54['offset']+_0x3e4f54[_0x8e11('0x1e')];var _0x20c741;if(_0x253715>=_0x4accc8){_0x253715=_0x4accc8;_0x20c741=0xc8;}else{_0x20c741=0xce;}_0x8c1d54[_0x8e11('0x19')](_0x20c741);return _0x8c1d54[_0x8e11('0x1f')](_0x8e11('0x20'),_0x18f7c8+'-'+_0x253715+'/'+_0x4accc8)['json'](_0xf4b2f4);}return null;};}function patchUpdates(_0x551e14){return function(_0x320abb){try{jsonpatch['apply'](_0x320abb,_0x551e14,!![]);}catch(_0x3fceac){return BPromise[_0x8e11('0x21')](_0x3fceac);}return _0x320abb[_0x8e11('0x22')]();};}function saveUpdates(_0x337ff8,_0x1de273){return function(_0xa296c8){if(_0xa296c8){return _0xa296c8['update'](_0x337ff8)[_0x8e11('0x23')](function(_0x4cc342){return _0x4cc342;});}return null;};}function removeEntity(_0x635bb5,_0x264a0e){return function(_0x3d52c2){if(_0x3d52c2){return _0x3d52c2[_0x8e11('0x24')]()['then'](function(){_0x635bb5['status'](0xcc)[_0x8e11('0x25')]();});}};}function handleEntityNotFound(_0x307de4,_0xf63ea0){return function(_0x43a41c){if(!_0x43a41c){_0x307de4[_0x8e11('0x18')](0x194);}return _0x43a41c;};}function handleError(_0x40c725,_0x2f16a5){_0x2f16a5=_0x2f16a5||0x1f4;return function(_0x4ccb12){logger['error'](_0x4ccb12[_0x8e11('0x26')]);if(_0x4ccb12[_0x8e11('0x27')]){delete _0x4ccb12[_0x8e11('0x27')];}_0x40c725['status'](_0x2f16a5)[_0x8e11('0x28')](_0x4ccb12);};}exports[_0x8e11('0x29')]=function(_0x130b1f,_0x201f54){var _0x156e69={},_0x4477bf={},_0x1cf81f={'count':0x0,'rows':[]};var _0x1f2f9f=_[_0x8e11('0x2a')](db['AnalyticFieldReport']['rawAttributes'],function(_0x9b1941){return{'name':_0x9b1941[_0x8e11('0x2b')],'type':_0x9b1941[_0x8e11('0x2c')]['key']};});_0x4477bf[_0x8e11('0x2d')]=_[_0x8e11('0x2a')](_0x1f2f9f,_0x8e11('0x27'));_0x4477bf[_0x8e11('0x2e')]=_[_0x8e11('0x2f')](_0x130b1f[_0x8e11('0x2e')]);_0x4477bf[_0x8e11('0x30')]=_[_0x8e11('0x31')](_0x4477bf[_0x8e11('0x2d')],_0x4477bf[_0x8e11('0x2e')]);_0x156e69[_0x8e11('0x32')]=_[_0x8e11('0x31')](_0x4477bf[_0x8e11('0x2d')],qs[_0x8e11('0x33')](_0x130b1f[_0x8e11('0x2e')][_0x8e11('0x33')]));_0x156e69['attributes']=_0x156e69[_0x8e11('0x32')][_0x8e11('0x34')]?_0x156e69[_0x8e11('0x32')]:_0x4477bf[_0x8e11('0x2d')];if(!_0x130b1f['query'][_0x8e11('0x35')](_0x8e11('0x36'))){_0x156e69[_0x8e11('0x1e')]=qs[_0x8e11('0x1e')](_0x130b1f[_0x8e11('0x2e')][_0x8e11('0x1e')]);_0x156e69[_0x8e11('0x1b')]=qs['offset'](_0x130b1f[_0x8e11('0x2e')][_0x8e11('0x1b')]);}_0x156e69['order']=qs[_0x8e11('0x37')](_0x130b1f['query'][_0x8e11('0x37')]);_0x156e69[_0x8e11('0x38')]=qs['filters'](_['pick'](_0x130b1f[_0x8e11('0x2e')],_0x4477bf[_0x8e11('0x30')]),_0x1f2f9f);if(_0x130b1f[_0x8e11('0x2e')][_0x8e11('0x39')]){_0x156e69[_0x8e11('0x38')]=_[_0x8e11('0x3a')](_0x156e69[_0x8e11('0x38')],{'$or':_[_0x8e11('0x2a')](_0x1f2f9f,function(_0x2777dd){if(_0x2777dd[_0x8e11('0x2c')]!==_0x8e11('0x3b')){var _0xc82930={};_0xc82930[_0x2777dd[_0x8e11('0x27')]]={'$like':'%'+_0x130b1f[_0x8e11('0x2e')][_0x8e11('0x39')]+'%'};return _0xc82930;}})});}_0x156e69=_[_0x8e11('0x3a')]({},_0x156e69,_0x130b1f[_0x8e11('0x3c')]);var _0x4ca365={'where':_0x156e69[_0x8e11('0x38')]};return db['AnalyticFieldReport']['count'](_0x4ca365)['then'](function(_0x488535){_0x1cf81f['count']=_0x488535;if(_0x130b1f[_0x8e11('0x2e')][_0x8e11('0x3d')]){_0x156e69[_0x8e11('0x3e')]=[{'all':!![]}];}return db[_0x8e11('0x3f')][_0x8e11('0x40')](_0x156e69);})[_0x8e11('0x23')](function(_0x3e3d30){_0x1cf81f[_0x8e11('0x41')]=_0x3e3d30;return _0x1cf81f;})['then'](respondWithFilteredResult(_0x201f54,_0x156e69))[_0x8e11('0x42')](handleError(_0x201f54,null));};exports['show']=function(_0x307fd8,_0x2eb2d6){var _0x258d95={'raw':![],'where':{'id':_0x307fd8[_0x8e11('0x43')]['id']}},_0x5cfde7={};_0x5cfde7[_0x8e11('0x2d')]=_[_0x8e11('0x2f')](db[_0x8e11('0x3f')]['rawAttributes']);_0x5cfde7[_0x8e11('0x2e')]=_['keys'](_0x307fd8[_0x8e11('0x2e')]);_0x5cfde7[_0x8e11('0x30')]=_[_0x8e11('0x31')](_0x5cfde7['model'],_0x5cfde7[_0x8e11('0x2e')]);_0x258d95[_0x8e11('0x32')]=_['intersection'](_0x5cfde7['model'],qs[_0x8e11('0x33')](_0x307fd8[_0x8e11('0x2e')]['fields']));_0x258d95['attributes']=_0x258d95['attributes'][_0x8e11('0x34')]?_0x258d95['attributes']:_0x5cfde7['model'];if(_0x307fd8[_0x8e11('0x2e')][_0x8e11('0x3d')]){_0x258d95[_0x8e11('0x3e')]=[{'all':!![]}];}_0x258d95=_[_0x8e11('0x3a')]({},_0x258d95,_0x307fd8[_0x8e11('0x3c')]);return db[_0x8e11('0x3f')][_0x8e11('0x44')](_0x258d95)['then'](handleEntityNotFound(_0x2eb2d6,null))[_0x8e11('0x23')](respondWithResult(_0x2eb2d6,null))[_0x8e11('0x42')](handleError(_0x2eb2d6,null));};exports[_0x8e11('0x45')]=function(_0x49cad4,_0x21226c){return db['AnalyticFieldReport'][_0x8e11('0x45')](_0x49cad4[_0x8e11('0x46')],{})[_0x8e11('0x23')](respondWithResult(_0x21226c,0xc9))['catch'](handleError(_0x21226c,null));};exports[_0x8e11('0x47')]=function(_0x491097,_0x1f6707){return db[_0x8e11('0x3f')][_0x8e11('0x47')](_0x491097[_0x8e11('0x46')],{'raw':![],'individualHooks':!![]})[_0x8e11('0x23')](respondWithResult(_0x1f6707,0xc9))[_0x8e11('0x42')](handleError(_0x1f6707,null));};exports[_0x8e11('0x48')]=function(_0x39ad8e,_0xcb9eb5){if(_0x39ad8e[_0x8e11('0x46')]['id']){delete _0x39ad8e[_0x8e11('0x46')]['id'];}return db[_0x8e11('0x3f')]['find']({'where':{'id':_0x39ad8e['params']['id']}})[_0x8e11('0x23')](handleEntityNotFound(_0xcb9eb5,null))[_0x8e11('0x23')](saveUpdates(_0x39ad8e['body'],null))[_0x8e11('0x23')](respondWithResult(_0xcb9eb5,null))[_0x8e11('0x42')](handleError(_0xcb9eb5,null));};exports[_0x8e11('0x24')]=function(_0x5980b7,_0x245c18){return db['AnalyticFieldReport']['find']({'where':{'id':_0x5980b7['params']['id']}})['then'](handleEntityNotFound(_0x245c18,null))[_0x8e11('0x23')](removeEntity(_0x245c18,null))[_0x8e11('0x42')](handleError(_0x245c18,null));};exports[_0x8e11('0x49')]=function(_0x549343,_0x1d4481){return db['AnalyticFieldReport'][_0x8e11('0x24')]({'where':{'id':_0x549343[_0x8e11('0x2e')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1d4481,0xcc))[_0x8e11('0x42')](handleError(_0x1d4481,null));};exports[_0x8e11('0x4a')]=function(_0x7782d3,_0x14ad2f,_0x2391fc){return db[_0x8e11('0x4b')][_0x8e11('0x4c')]({'where':{'id':_0x7782d3[_0x8e11('0x43')]['id']}})[_0x8e11('0x23')](handleEntityNotFound(_0x14ad2f,null))[_0x8e11('0x23')](function(_0x51dca2){if(_0x51dca2){return db[_0x8e11('0x4d')][_0x8e11('0x4e')](function(_0x46c277){return db['AnalyticFieldReport'][_0x8e11('0x24')]({'where':{'CustomReportId':_0x7782d3[_0x8e11('0x43')]['id']},'transaction':_0x46c277})[_0x8e11('0x23')](function(_0x328151){var _0x5de880=_[_0x8e11('0x2a')](_0x7782d3['body'],function(_0x4de343){delete _0x4de343['id'];_0x4de343['CustomReportId']=_0x7782d3[_0x8e11('0x43')]['id'];return _0x4de343;});return db[_0x8e11('0x3f')][_0x8e11('0x47')](_0x5de880,{'transaction':_0x46c277});});})['then'](function(){return db[_0x8e11('0x3f')][_0x8e11('0x40')]({'where':{'CustomReportId':_0x7782d3[_0x8e11('0x43')]['id']}});});}})[_0x8e11('0x23')](respondWithResult(_0x14ad2f,null))[_0x8e11('0x42')](handleError(_0x14ad2f,null));}; \ No newline at end of file +var _0xf3aa=['../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','then','includeAll','include','findAll','rows','catch','params','length','find','create','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','body','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','api','../../config/utils','../../config/environment'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xf3aa,0xe7));var _0xaf3a=function(_0x11fd4e,_0x1a32ec){_0x11fd4e=_0x11fd4e-0x0;var _0x324371=_0xf3aa[_0x11fd4e];return _0x324371;};'use strict';var emlformat=require(_0xaf3a('0x0'));var rimraf=require(_0xaf3a('0x1'));var zipdir=require(_0xaf3a('0x2'));var jsonpatch=require(_0xaf3a('0x3'));var rp=require(_0xaf3a('0x4'));var moment=require('moment');var BPromise=require(_0xaf3a('0x5'));var Mustache=require(_0xaf3a('0x6'));var util=require(_0xaf3a('0x7'));var path=require(_0xaf3a('0x8'));var sox=require(_0xaf3a('0x9'));var csv=require(_0xaf3a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf3a('0xb'));var _=require(_0xaf3a('0xc'));var squel=require(_0xaf3a('0xd'));var crypto=require(_0xaf3a('0xe'));var jsforce=require(_0xaf3a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaf3a('0x10'));var Papa=require(_0xaf3a('0x11'));var Redis=require(_0xaf3a('0x12'));var authService=require(_0xaf3a('0x13'));var qs=require(_0xaf3a('0x14'));var as=require(_0xaf3a('0x15'));var hardwareService=require(_0xaf3a('0x16'));var logger=require(_0xaf3a('0x17'))(_0xaf3a('0x18'));var utils=require(_0xaf3a('0x19'));var config=require(_0xaf3a('0x1a'));var licenseUtil=require(_0xaf3a('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2585ef,_0x49d1d2){_0x49d1d2=_0x49d1d2||0xcc;return function(_0x2b78f7){if(_0x2b78f7){return _0x2585ef[_0xaf3a('0x1c')](_0x49d1d2);}return _0x2585ef[_0xaf3a('0x1d')](_0x49d1d2)[_0xaf3a('0x1e')]();};}function respondWithResult(_0x535551,_0x36958d){_0x36958d=_0x36958d||0xc8;return function(_0x424391){if(_0x424391){return _0x535551[_0xaf3a('0x1d')](_0x36958d)[_0xaf3a('0x1f')](_0x424391);}};}function respondWithFilteredResult(_0x566ce2,_0x173fc8){return function(_0x4357bd){if(_0x4357bd){var _0x3ffea6=typeof _0x173fc8[_0xaf3a('0x20')]===_0xaf3a('0x21')&&typeof _0x173fc8[_0xaf3a('0x22')]===_0xaf3a('0x21');var _0x29997c=_0x4357bd[_0xaf3a('0x23')];var _0x1b022f=_0x3ffea6?0x0:_0x173fc8[_0xaf3a('0x20')];var _0x4ba42a=_0x3ffea6?_0x4357bd[_0xaf3a('0x23')]:_0x173fc8[_0xaf3a('0x20')]+_0x173fc8[_0xaf3a('0x22')];var _0x25e8a3;if(_0x4ba42a>=_0x29997c){_0x4ba42a=_0x29997c;_0x25e8a3=0xc8;}else{_0x25e8a3=0xce;}_0x566ce2['status'](_0x25e8a3);return _0x566ce2[_0xaf3a('0x24')]('Content-Range',_0x1b022f+'-'+_0x4ba42a+'/'+_0x29997c)[_0xaf3a('0x1f')](_0x4357bd);}return null;};}function patchUpdates(_0x453fb4){return function(_0x511f76){try{jsonpatch[_0xaf3a('0x25')](_0x511f76,_0x453fb4,!![]);}catch(_0x3f72d8){return BPromise[_0xaf3a('0x26')](_0x3f72d8);}return _0x511f76[_0xaf3a('0x27')]();};}function saveUpdates(_0x4bea2c,_0x5bb58c){return function(_0x3ddbfc){if(_0x3ddbfc){return _0x3ddbfc[_0xaf3a('0x28')](_0x4bea2c)['then'](function(_0x28cbd3){return _0x28cbd3;});}return null;};}function removeEntity(_0x511abb,_0x4d6008){return function(_0x5b80ed){if(_0x5b80ed){return _0x5b80ed[_0xaf3a('0x29')]()['then'](function(){_0x511abb[_0xaf3a('0x1d')](0xcc)[_0xaf3a('0x1e')]();});}};}function handleEntityNotFound(_0x12504a,_0x804fac){return function(_0x527394){if(!_0x527394){_0x12504a[_0xaf3a('0x1c')](0x194);}return _0x527394;};}function handleError(_0x39d637,_0xb5db33){_0xb5db33=_0xb5db33||0x1f4;return function(_0x5f3b81){logger[_0xaf3a('0x2a')](_0x5f3b81[_0xaf3a('0x2b')]);if(_0x5f3b81[_0xaf3a('0x2c')]){delete _0x5f3b81[_0xaf3a('0x2c')];}_0x39d637[_0xaf3a('0x1d')](_0xb5db33)[_0xaf3a('0x2d')](_0x5f3b81);};}exports[_0xaf3a('0x2e')]=function(_0xcc95ed,_0x7277c){var _0x37b9f2={},_0x126d05={},_0x1ffb37={'count':0x0,'rows':[]};var _0x125219=_[_0xaf3a('0x2f')](db['AnalyticFieldReport'][_0xaf3a('0x30')],function(_0x5401ea){return{'name':_0x5401ea[_0xaf3a('0x31')],'type':_0x5401ea[_0xaf3a('0x32')][_0xaf3a('0x33')]};});_0x126d05[_0xaf3a('0x34')]=_[_0xaf3a('0x2f')](_0x125219,_0xaf3a('0x2c'));_0x126d05[_0xaf3a('0x35')]=_[_0xaf3a('0x36')](_0xcc95ed[_0xaf3a('0x35')]);_0x126d05[_0xaf3a('0x37')]=_[_0xaf3a('0x38')](_0x126d05[_0xaf3a('0x34')],_0x126d05['query']);_0x37b9f2[_0xaf3a('0x39')]=_[_0xaf3a('0x38')](_0x126d05[_0xaf3a('0x34')],qs['fields'](_0xcc95ed['query'][_0xaf3a('0x3a')]));_0x37b9f2['attributes']=_0x37b9f2[_0xaf3a('0x39')]['length']?_0x37b9f2[_0xaf3a('0x39')]:_0x126d05[_0xaf3a('0x34')];if(!_0xcc95ed[_0xaf3a('0x35')][_0xaf3a('0x3b')](_0xaf3a('0x3c'))){_0x37b9f2['limit']=qs[_0xaf3a('0x22')](_0xcc95ed['query'][_0xaf3a('0x22')]);_0x37b9f2[_0xaf3a('0x20')]=qs[_0xaf3a('0x20')](_0xcc95ed[_0xaf3a('0x35')]['offset']);}_0x37b9f2[_0xaf3a('0x3d')]=qs[_0xaf3a('0x3e')](_0xcc95ed[_0xaf3a('0x35')][_0xaf3a('0x3e')]);_0x37b9f2['where']=qs[_0xaf3a('0x37')](_['pick'](_0xcc95ed[_0xaf3a('0x35')],_0x126d05[_0xaf3a('0x37')]),_0x125219);if(_0xcc95ed[_0xaf3a('0x35')][_0xaf3a('0x3f')]){_0x37b9f2[_0xaf3a('0x40')]=_[_0xaf3a('0x41')](_0x37b9f2[_0xaf3a('0x40')],{'$or':_[_0xaf3a('0x2f')](_0x125219,function(_0x5671bb){if(_0x5671bb[_0xaf3a('0x32')]!==_0xaf3a('0x42')){var _0x45b6b2={};_0x45b6b2[_0x5671bb[_0xaf3a('0x2c')]]={'$like':'%'+_0xcc95ed['query']['filter']+'%'};return _0x45b6b2;}})});}_0x37b9f2=_[_0xaf3a('0x41')]({},_0x37b9f2,_0xcc95ed[_0xaf3a('0x43')]);var _0x4ff3e7={'where':_0x37b9f2[_0xaf3a('0x40')]};return db[_0xaf3a('0x44')][_0xaf3a('0x23')](_0x4ff3e7)[_0xaf3a('0x45')](function(_0x249c1b){_0x1ffb37['count']=_0x249c1b;if(_0xcc95ed[_0xaf3a('0x35')][_0xaf3a('0x46')]){_0x37b9f2[_0xaf3a('0x47')]=[{'all':!![]}];}return db[_0xaf3a('0x44')][_0xaf3a('0x48')](_0x37b9f2);})[_0xaf3a('0x45')](function(_0x55c23e){_0x1ffb37[_0xaf3a('0x49')]=_0x55c23e;return _0x1ffb37;})[_0xaf3a('0x45')](respondWithFilteredResult(_0x7277c,_0x37b9f2))[_0xaf3a('0x4a')](handleError(_0x7277c,null));};exports['show']=function(_0x5c9e02,_0x3985c4){var _0x4a4460={'raw':![],'where':{'id':_0x5c9e02[_0xaf3a('0x4b')]['id']}},_0xae4a58={};_0xae4a58[_0xaf3a('0x34')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0xae4a58[_0xaf3a('0x35')]=_[_0xaf3a('0x36')](_0x5c9e02[_0xaf3a('0x35')]);_0xae4a58[_0xaf3a('0x37')]=_['intersection'](_0xae4a58['model'],_0xae4a58[_0xaf3a('0x35')]);_0x4a4460[_0xaf3a('0x39')]=_[_0xaf3a('0x38')](_0xae4a58['model'],qs[_0xaf3a('0x3a')](_0x5c9e02['query'][_0xaf3a('0x3a')]));_0x4a4460[_0xaf3a('0x39')]=_0x4a4460[_0xaf3a('0x39')][_0xaf3a('0x4c')]?_0x4a4460[_0xaf3a('0x39')]:_0xae4a58['model'];if(_0x5c9e02['query'][_0xaf3a('0x46')]){_0x4a4460[_0xaf3a('0x47')]=[{'all':!![]}];}_0x4a4460=_[_0xaf3a('0x41')]({},_0x4a4460,_0x5c9e02[_0xaf3a('0x43')]);return db[_0xaf3a('0x44')][_0xaf3a('0x4d')](_0x4a4460)[_0xaf3a('0x45')](handleEntityNotFound(_0x3985c4,null))[_0xaf3a('0x45')](respondWithResult(_0x3985c4,null))[_0xaf3a('0x4a')](handleError(_0x3985c4,null));};exports[_0xaf3a('0x4e')]=function(_0x2d00b1,_0x10bce2){return db[_0xaf3a('0x44')]['create'](_0x2d00b1['body'],{})[_0xaf3a('0x45')](respondWithResult(_0x10bce2,0xc9))[_0xaf3a('0x4a')](handleError(_0x10bce2,null));};exports[_0xaf3a('0x4f')]=function(_0x415289,_0xb2d845){return db[_0xaf3a('0x44')][_0xaf3a('0x4f')](_0x415289['body'],{'raw':![],'individualHooks':!![]})[_0xaf3a('0x45')](respondWithResult(_0xb2d845,0xc9))[_0xaf3a('0x4a')](handleError(_0xb2d845,null));};exports[_0xaf3a('0x28')]=function(_0x41122a,_0x11e639){if(_0x41122a['body']['id']){delete _0x41122a['body']['id'];}return db[_0xaf3a('0x44')][_0xaf3a('0x4d')]({'where':{'id':_0x41122a[_0xaf3a('0x4b')]['id']}})[_0xaf3a('0x45')](handleEntityNotFound(_0x11e639,null))['then'](saveUpdates(_0x41122a['body'],null))[_0xaf3a('0x45')](respondWithResult(_0x11e639,null))[_0xaf3a('0x4a')](handleError(_0x11e639,null));};exports[_0xaf3a('0x29')]=function(_0x59a8c3,_0x101421){return db['AnalyticFieldReport']['find']({'where':{'id':_0x59a8c3[_0xaf3a('0x4b')]['id']}})[_0xaf3a('0x45')](handleEntityNotFound(_0x101421,null))[_0xaf3a('0x45')](removeEntity(_0x101421,null))[_0xaf3a('0x4a')](handleError(_0x101421,null));};exports['bulkDestroy']=function(_0x3f2bf0,_0x45cde9){return db['AnalyticFieldReport'][_0xaf3a('0x29')]({'where':{'id':_0x3f2bf0[_0xaf3a('0x35')][_0xaf3a('0x50')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x45cde9,0xcc))[_0xaf3a('0x4a')](handleError(_0x45cde9,null));};exports[_0xaf3a('0x51')]=function(_0x4d3d3c,_0x374a25,_0x22992a){return db[_0xaf3a('0x52')][_0xaf3a('0x53')]({'where':{'id':_0x4d3d3c[_0xaf3a('0x4b')]['id']}})[_0xaf3a('0x45')](handleEntityNotFound(_0x374a25,null))[_0xaf3a('0x45')](function(_0x40dc13){if(_0x40dc13){return db['sequelize']['transaction'](function(_0x414607){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4d3d3c['params']['id']},'transaction':_0x414607})[_0xaf3a('0x45')](function(_0x3df9fd){var _0x3e0a90=_[_0xaf3a('0x2f')](_0x4d3d3c[_0xaf3a('0x54')],function(_0x12dee0){delete _0x12dee0['id'];_0x12dee0[_0xaf3a('0x55')]=_0x4d3d3c[_0xaf3a('0x4b')]['id'];return _0x12dee0;});return db[_0xaf3a('0x44')]['bulkCreate'](_0x3e0a90,{'transaction':_0x414607});});})['then'](function(){return db[_0xaf3a('0x44')][_0xaf3a('0x48')]({'where':{'CustomReportId':_0x4d3d3c[_0xaf3a('0x4b')]['id']}});});}})[_0xaf3a('0x45')](respondWithResult(_0x374a25,null))[_0xaf3a('0x4a')](handleError(_0x374a25,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 86ba7f7..20f8303 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 _0x1edc=['AnalyticFieldReport','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x25ef07,_0x4473db){var _0x367936=function(_0x2feb96){while(--_0x2feb96){_0x25ef07['push'](_0x25ef07['shift']());}};_0x367936(++_0x4473db);}(_0x1edc,0xc7));var _0xc1ed=function(_0x35d7cd,_0x1fd8de){_0x35d7cd=_0x35d7cd-0x0;var _0x1f758e=_0x1edc[_0x35d7cd];return _0x1f758e;};'use strict';var _=require(_0xc1ed('0x0'));var util=require('util');var logger=require(_0xc1ed('0x1'))(_0xc1ed('0x2'));var moment=require(_0xc1ed('0x3'));var BPromise=require(_0xc1ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1ed('0x5'));var rimraf=require(_0xc1ed('0x6'));var config=require(_0xc1ed('0x7'));var attributes=require(_0xc1ed('0x8'));module['exports']=function(_0x4ec1c1,_0x44d5b2){return _0x4ec1c1[_0xc1ed('0x9')](_0xc1ed('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x365d=['api','moment','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x2615f8,_0xd41fc5){var _0x3320ae=function(_0x140d16){while(--_0x140d16){_0x2615f8['push'](_0x2615f8['shift']());}};_0x3320ae(++_0xd41fc5);}(_0x365d,0x134));var _0xd365=function(_0x493836,_0x5af577){_0x493836=_0x493836-0x0;var _0x57b579=_0x365d[_0x493836];return _0x57b579;};'use strict';var _=require(_0xd365('0x0'));var util=require(_0xd365('0x1'));var logger=require('../../config/logger')(_0xd365('0x2'));var moment=require(_0xd365('0x3'));var BPromise=require(_0xd365('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd365('0x5'));var config=require(_0xd365('0x6'));var attributes=require(_0xd365('0x7'));module['exports']=function(_0x521f53,_0x3067e4){return _0x521f53['define'](_0xd365('0x8'),attributes,{'tableName':_0xd365('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index d43f1f7..593fd17 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 _0x1189=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring'];(function(_0x335201,_0x119f72){var _0x32790a=function(_0x31321e){while(--_0x31321e){_0x335201['push'](_0x335201['shift']());}};_0x32790a(++_0x119f72);}(_0x1189,0x127));var _0x9118=function(_0x46848e,_0xe1b792){_0x46848e=_0x46848e-0x0;var _0x3fcfcb=_0x1189[_0x46848e];return _0x3fcfcb;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var moment=require(_0x9118('0x2'));var BPromise=require(_0x9118('0x3'));var rs=require(_0x9118('0x4'));var fs=require('fs');var Redis=require(_0x9118('0x5'));var db=require(_0x9118('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9118('0x7'))(_0x9118('0x8'));var config=require(_0x9118('0x9'));var jayson=require(_0x9118('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37df99,_0x2a47a6,_0x2dbc0c){return new BPromise(function(_0x4bdec6,_0x4557cb){return client[_0x9118('0xb')](_0x37df99,_0x2dbc0c)['then'](function(_0x7116b9){logger['info'](_0x9118('0xc'),_0x2a47a6,_0x9118('0xd'));logger[_0x9118('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2a47a6,_0x9118('0xd'),JSON[_0x9118('0xf')](_0x7116b9));if(_0x7116b9[_0x9118('0x10')]){if(_0x7116b9[_0x9118('0x10')][_0x9118('0x11')]===0x1f4){logger[_0x9118('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2a47a6,_0x7116b9[_0x9118('0x10')][_0x9118('0x12')]);return _0x4557cb(_0x7116b9[_0x9118('0x10')][_0x9118('0x12')]);}logger[_0x9118('0x10')](_0x9118('0xc'),_0x2a47a6,_0x7116b9['error']['message']);return _0x4bdec6(_0x7116b9[_0x9118('0x10')][_0x9118('0x12')]);}else{logger[_0x9118('0x13')](_0x9118('0xc'),_0x2a47a6,'request\x20sent');_0x4bdec6(_0x7116b9['result'][_0x9118('0x12')]);}})['catch'](function(_0x1d5957){logger[_0x9118('0x10')](_0x9118('0xc'),_0x2a47a6,_0x1d5957);_0x4557cb(_0x1d5957);});});} \ No newline at end of file +var _0xeb9a=['error','code','message','result','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x30805d,_0x487d81){var _0x48477b=function(_0x196711){while(--_0x196711){_0x30805d['push'](_0x30805d['shift']());}};_0x48477b(++_0x487d81);}(_0xeb9a,0x1c4));var _0xaeb9=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xeb9a[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaeb9('0x0'));var BPromise=require(_0xaeb9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaeb9('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xaeb9('0x3'));var jayson=require(_0xaeb9('0x4'));var client=jayson['client'][_0xaeb9('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2c253a,_0x4dba76,_0x1d3064){return new BPromise(function(_0x53b235,_0x3ee99e){return client[_0xaeb9('0x6')](_0x2c253a,_0x1d3064)['then'](function(_0x19c7ab){logger[_0xaeb9('0x7')](_0xaeb9('0x8'),_0x4dba76,_0xaeb9('0x9'));logger[_0xaeb9('0xa')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4dba76,_0xaeb9('0x9'),JSON[_0xaeb9('0xb')](_0x19c7ab));if(_0x19c7ab[_0xaeb9('0xc')]){if(_0x19c7ab['error'][_0xaeb9('0xd')]===0x1f4){logger[_0xaeb9('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4dba76,_0x19c7ab[_0xaeb9('0xc')]['message']);return _0x3ee99e(_0x19c7ab[_0xaeb9('0xc')]['message']);}logger[_0xaeb9('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4dba76,_0x19c7ab[_0xaeb9('0xc')][_0xaeb9('0xe')]);return _0x53b235(_0x19c7ab['error'][_0xaeb9('0xe')]);}else{logger[_0xaeb9('0x7')](_0xaeb9('0x8'),_0x4dba76,'request\x20sent');_0x53b235(_0x19c7ab[_0xaeb9('0xf')][_0xaeb9('0xe')]);}})['catch'](function(_0x2d73f2){logger[_0xaeb9('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4dba76,_0x2d73f2);_0x3ee99e(_0x2d73f2);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 7c091f3..4011cc8 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(_0x542d8f,_0x4f41e9){var _0x45065a=function(_0x58f203){while(--_0x58f203){_0x542d8f['push'](_0x542d8f['shift']());}};_0x45065a(++_0x4f41e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x16def0,_0x6bf355){var _0x5f2de2=function(_0x3debdf){while(--_0x3debdf){_0x16def0['push'](_0x16def0['shift']());}};_0x5f2de2(++_0x6bf355);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 ef02808..adc320a 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 _0x26f9=['exports','name','STRING','sequelize'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x26f9,0x16f));var _0x926f=function(_0x35083a,_0x50630c){_0x35083a=_0x35083a-0x0;var _0x1c705b=_0x26f9[_0x35083a];return _0x1c705b;};'use strict';var Sequelize=require(_0x926f('0x0'));module[_0x926f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x926f('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x926f('0x3')]}}; \ No newline at end of file +var _0x16d2=['TEXT','sequelize','exports','STRING','name'];(function(_0x4f2c11,_0x15da99){var _0x29e71a=function(_0x12e193){while(--_0x12e193){_0x4f2c11['push'](_0x4f2c11['shift']());}};_0x29e71a(++_0x15da99);}(_0x16d2,0x123));var _0x216d=function(_0x47bf54,_0x327a53){_0x47bf54=_0x47bf54-0x0;var _0x2b75bc=_0x16d2[_0x47bf54];return _0x2b75bc;};'use strict';var Sequelize=require(_0x216d('0x0'));module[_0x216d('0x1')]={'name':{'type':Sequelize[_0x216d('0x2')],'allowNull':![],'unique':_0x216d('0x3')},'table':{'type':Sequelize[_0x216d('0x2')]},'metric':{'type':Sequelize[_0x216d('0x4')]},'description':{'type':Sequelize[_0x216d('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 60b60b6..5927427 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0xa52b32,_0x349b88){_0xa52b32=_0xa52b32-0x0;var _0x23b278=_0x1cb9[_0xa52b32];return _0x23b278;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));}; \ No newline at end of file +var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x5f51d0,_0x56cb80){var _0x124417=function(_0x16d87a){while(--_0x16d87a){_0x5f51d0['push'](_0x5f51d0['shift']());}};_0x124417(++_0x56cb80);}(_0xdc97,0x13b));var _0x7dc9=function(_0xcdc7c,_0x38d432){_0xcdc7c=_0xcdc7c-0x0;var _0x3d9383=_0xdc97[_0xcdc7c];return _0x3d9383;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 157c0e2..6a0edca 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 _0x1751=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1c3eaa,_0x1b6004){var _0x2c765d=function(_0x13a06d){while(--_0x13a06d){_0x1c3eaa['push'](_0x1c3eaa['shift']());}};_0x2c765d(++_0x1b6004);}(_0x1751,0x76));var _0x1175=function(_0x1214d4,_0x10f97d){_0x1214d4=_0x1214d4-0x0;var _0x1679a5=_0x1751[_0x1214d4];return _0x1679a5;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x598a=['util','../../config/logger','api','moment','request-promise','./analyticMetric.attributes','exports','define','lodash'];(function(_0xe5530b,_0x4477ea){var _0x549c66=function(_0x495293){while(--_0x495293){_0xe5530b['push'](_0xe5530b['shift']());}};_0x549c66(++_0x4477ea);}(_0x598a,0xfb));var _0xa598=function(_0x5ed364,_0x4c5423){_0x5ed364=_0x5ed364-0x0;var _0x38c6e1=_0x598a[_0x5ed364];return _0x38c6e1;};'use strict';var _=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var logger=require(_0xa598('0x2'))(_0xa598('0x3'));var moment=require(_0xa598('0x4'));var BPromise=require('bluebird');var rp=require(_0xa598('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa598('0x6'));module[_0xa598('0x7')]=function(_0x41ebaa,_0x2b0ef0){return _0x41ebaa[_0xa598('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','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 9707827..3c3d96e 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 _0x2769=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x3fda28,_0x21803a){var _0x300e3e=function(_0x5db597){while(--_0x5db597){_0x3fda28['push'](_0x3fda28['shift']());}};_0x300e3e(++_0x21803a);}(_0x2769,0xcf));var _0x9276=function(_0x44ca5b,_0xf366db){_0x44ca5b=_0x44ca5b-0x0;var _0x183b1b=_0x2769[_0x44ca5b];return _0x183b1b;};'use strict';var _=require('lodash');var util=require(_0x9276('0x0'));var moment=require('moment');var BPromise=require(_0x9276('0x1'));var rs=require(_0x9276('0x2'));var fs=require('fs');var Redis=require(_0x9276('0x3'));var db=require(_0x9276('0x4'))['db'];var utils=require(_0x9276('0x5'));var logger=require(_0x9276('0x6'))('rpc');var config=require(_0x9276('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9276('0x8')][_0x9276('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d3baf,_0xd854d5,_0x19e660){return new BPromise(function(_0x277236,_0x552f72){return client[_0x9276('0xa')](_0x5d3baf,_0x19e660)[_0x9276('0xb')](function(_0x32fa31){logger[_0x9276('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0xd854d5,_0x9276('0xd'));logger[_0x9276('0xe')](_0x9276('0xf'),_0xd854d5,_0x9276('0xd'),JSON['stringify'](_0x32fa31));if(_0x32fa31[_0x9276('0x10')]){if(_0x32fa31[_0x9276('0x10')][_0x9276('0x11')]===0x1f4){logger[_0x9276('0x10')](_0x9276('0x12'),_0xd854d5,_0x32fa31['error'][_0x9276('0x13')]);return _0x552f72(_0x32fa31[_0x9276('0x10')]['message']);}logger[_0x9276('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0xd854d5,_0x32fa31[_0x9276('0x10')][_0x9276('0x13')]);return _0x277236(_0x32fa31[_0x9276('0x10')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0xd854d5,'request\x20sent');_0x277236(_0x32fa31[_0x9276('0x14')][_0x9276('0x13')]);}})[_0x9276('0x15')](function(_0x570252){logger[_0x9276('0x10')](_0x9276('0x12'),_0xd854d5,_0x570252);_0x552f72(_0x570252);});});} \ No newline at end of file +var _0x05fb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x2ff3e5,_0x43ea59){var _0x3430a3=function(_0x202824){while(--_0x202824){_0x2ff3e5['push'](_0x2ff3e5['shift']());}};_0x3430a3(++_0x43ea59);}(_0x05fb,0x1d6));var _0xb05f=function(_0x2f0837,_0x3fa02a){_0x2f0837=_0x2f0837-0x0;var _0x1a2b2e=_0x05fb[_0x2f0837];return _0x1a2b2e;};'use strict';var _=require(_0xb05f('0x0'));var util=require(_0xb05f('0x1'));var moment=require('moment');var BPromise=require(_0xb05f('0x2'));var rs=require(_0xb05f('0x3'));var fs=require('fs');var Redis=require(_0xb05f('0x4'));var db=require(_0xb05f('0x5'))['db'];var utils=require(_0xb05f('0x6'));var logger=require(_0xb05f('0x7'))(_0xb05f('0x8'));var config=require(_0xb05f('0x9'));var jayson=require(_0xb05f('0xa'));var client=jayson['client'][_0xb05f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b1012,_0x8348a6,_0x4a2e0c){return new BPromise(function(_0x5d9498,_0x2d04ce){return client[_0xb05f('0xc')](_0x3b1012,_0x4a2e0c)[_0xb05f('0xd')](function(_0x1149bd){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x8348a6,'request\x20sent');logger[_0xb05f('0xe')](_0xb05f('0xf'),_0x8348a6,_0xb05f('0x10'),JSON[_0xb05f('0x11')](_0x1149bd));if(_0x1149bd[_0xb05f('0x12')]){if(_0x1149bd['error'][_0xb05f('0x13')]===0x1f4){logger[_0xb05f('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x8348a6,_0x1149bd[_0xb05f('0x12')]['message']);return _0x2d04ce(_0x1149bd['error'][_0xb05f('0x14')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x8348a6,_0x1149bd[_0xb05f('0x12')][_0xb05f('0x14')]);return _0x5d9498(_0x1149bd[_0xb05f('0x12')][_0xb05f('0x14')]);}else{logger[_0xb05f('0x15')](_0xb05f('0x16'),_0x8348a6,'request\x20sent');_0x5d9498(_0x1149bd[_0xb05f('0x17')][_0xb05f('0x14')]);}})[_0xb05f('0x18')](function(_0x1ae52f){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x8348a6,_0x1ae52f);_0x2d04ce(_0x1ae52f);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index e6209b3..a2d7d16 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 _0x29af=['put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create'];(function(_0x4eb0e2,_0x3f6ae0){var _0xd0d0d9=function(_0x3a4668){while(--_0x3a4668){_0x4eb0e2['push'](_0x4eb0e2['shift']());}};_0xd0d0d9(++_0x3f6ae0);}(_0x29af,0x134));var _0xf29a=function(_0xf0718,_0xf99fc5){_0xf0718=_0xf0718-0x0;var _0x5ee522=_0x29af[_0xf0718];return _0x5ee522;};'use strict';var multer=require(_0xf29a('0x0'));var util=require(_0xf29a('0x1'));var path=require(_0xf29a('0x2'));var timeout=require('connect-timeout');var express=require(_0xf29a('0x3'));var router=express[_0xf29a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf29a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf29a('0x6'));var controller=require(_0xf29a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf29a('0x8')]);router[_0xf29a('0x9')](_0xf29a('0xa'),auth[_0xf29a('0xb')](),controller[_0xf29a('0xc')]);router[_0xf29a('0xd')]('/',auth['isAuthenticated'](),controller[_0xf29a('0xe')]);router[_0xf29a('0xf')](_0xf29a('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xf29a('0x10')](_0xf29a('0xa'),auth[_0xf29a('0xb')](),controller[_0xf29a('0x11')]);module[_0xf29a('0x12')]=router; \ No newline at end of file +var _0x8ce1=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5938b5,_0x3fa937){var _0x53224c=function(_0xc66565){while(--_0xc66565){_0x5938b5['push'](_0x5938b5['shift']());}};_0x53224c(++_0x3fa937);}(_0x8ce1,0x183));var _0x18ce=function(_0x53604f,_0x1d7403){_0x53604f=_0x53604f-0x0;var _0x45740a=_0x8ce1[_0x53604f];return _0x45740a;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require(_0x18ce('0x7'));var interaction=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var controller=require(_0x18ce('0xa'));router[_0x18ce('0xb')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router[_0x18ce('0xb')](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0x10')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x11')]);router['put'](_0x18ce('0xe'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x14')]);module[_0x18ce('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index bfd841a..88b25f4 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 _0xd1cd=['sequelize','TEXT'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0xd1cd,0xe8));var _0xdd1c=function(_0x3ba159,_0x5cff83){_0x3ba159=_0x3ba159-0x0;var _0x1c60c2=_0xd1cd[_0x3ba159];return _0x1c60c2;};'use strict';var Sequelize=require(_0xdd1c('0x0'));module['exports']={'tree':{'type':Sequelize[_0xdd1c('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb977=['exports','sequelize'];(function(_0x108d63,_0x14491b){var _0x51d6df=function(_0x595598){while(--_0x595598){_0x108d63['push'](_0x108d63['shift']());}};_0x51d6df(++_0x14491b);}(_0xb977,0xd7));var _0x7b97=function(_0x47b92b,_0x410a46){_0x47b92b=_0x47b92b-0x0;var _0x2c6676=_0xb977[_0x47b92b];return _0x2c6676;};'use strict';var Sequelize=require(_0x7b97('0x0'));module[_0x7b97('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 84e0441..c46a2dd 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 _0xa8a2=['set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','AnalyticTreeReport','findAll','rows','catch','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count'];(function(_0x5af22b,_0x5bf83b){var _0x244f56=function(_0x5153b4){while(--_0x5153b4){_0x5af22b['push'](_0x5af22b['shift']());}};_0x244f56(++_0x5bf83b);}(_0xa8a2,0x143));var _0x2a8a=function(_0x1e27aa,_0x526f36){_0x1e27aa=_0x1e27aa-0x0;var _0x167d59=_0xa8a2[_0x1e27aa];return _0x167d59;};'use strict';var emlformat=require(_0x2a8a('0x0'));var rimraf=require(_0x2a8a('0x1'));var zipdir=require(_0x2a8a('0x2'));var jsonpatch=require(_0x2a8a('0x3'));var rp=require('request-promise');var moment=require(_0x2a8a('0x4'));var BPromise=require(_0x2a8a('0x5'));var Mustache=require(_0x2a8a('0x6'));var util=require('util');var path=require(_0x2a8a('0x7'));var sox=require(_0x2a8a('0x8'));var csv=require(_0x2a8a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a8a('0xa'));var _=require(_0x2a8a('0xb'));var squel=require(_0x2a8a('0xc'));var crypto=require(_0x2a8a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2a8a('0xe'));var toCsv=require(_0x2a8a('0x9'));var querystring=require('querystring');var Papa=require(_0x2a8a('0xf'));var Redis=require(_0x2a8a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2a8a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2a8a('0x12'));var config=require(_0x2a8a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a8a('0x14'))['db'];function respondWithStatusCode(_0x5a1a3a,_0x22880a){_0x22880a=_0x22880a||0xcc;return function(_0xc2f33d){if(_0xc2f33d){return _0x5a1a3a[_0x2a8a('0x15')](_0x22880a);}return _0x5a1a3a[_0x2a8a('0x16')](_0x22880a)['end']();};}function respondWithResult(_0x22fb41,_0xed9d9c){_0xed9d9c=_0xed9d9c||0xc8;return function(_0x2d30f7){if(_0x2d30f7){return _0x22fb41['status'](_0xed9d9c)['json'](_0x2d30f7);}};}function respondWithFilteredResult(_0x1a22a6,_0x27078e){return function(_0x32e91b){if(_0x32e91b){var _0x693f7d=typeof _0x27078e[_0x2a8a('0x17')]===_0x2a8a('0x18')&&typeof _0x27078e[_0x2a8a('0x19')]===_0x2a8a('0x18');var _0x4b4ddb=_0x32e91b[_0x2a8a('0x1a')];var _0x43d669=_0x693f7d?0x0:_0x27078e['offset'];var _0xffd6da=_0x693f7d?_0x32e91b[_0x2a8a('0x1a')]:_0x27078e['offset']+_0x27078e[_0x2a8a('0x19')];var _0x1bcdc7;if(_0xffd6da>=_0x4b4ddb){_0xffd6da=_0x4b4ddb;_0x1bcdc7=0xc8;}else{_0x1bcdc7=0xce;}_0x1a22a6[_0x2a8a('0x16')](_0x1bcdc7);return _0x1a22a6[_0x2a8a('0x1b')](_0x2a8a('0x1c'),_0x43d669+'-'+_0xffd6da+'/'+_0x4b4ddb)[_0x2a8a('0x1d')](_0x32e91b);}return null;};}function patchUpdates(_0x7c04ed){return function(_0x5c440d){try{jsonpatch[_0x2a8a('0x1e')](_0x5c440d,_0x7c04ed,!![]);}catch(_0x5340d6){return BPromise['reject'](_0x5340d6);}return _0x5c440d[_0x2a8a('0x1f')]();};}function saveUpdates(_0x456bb1,_0x45234e){return function(_0x5778df){if(_0x5778df){return _0x5778df[_0x2a8a('0x20')](_0x456bb1)[_0x2a8a('0x21')](function(_0x3bb1ae){return _0x3bb1ae;});}return null;};}function removeEntity(_0x477d00,_0xc0ae04){return function(_0x287f51){if(_0x287f51){return _0x287f51[_0x2a8a('0x22')]()[_0x2a8a('0x21')](function(){_0x477d00[_0x2a8a('0x16')](0xcc)[_0x2a8a('0x23')]();});}};}function handleEntityNotFound(_0x22bda1,_0x184498){return function(_0x447c55){if(!_0x447c55){_0x22bda1[_0x2a8a('0x15')](0x194);}return _0x447c55;};}function handleError(_0x1a41fa,_0x358a88){_0x358a88=_0x358a88||0x1f4;return function(_0x1f1c79){logger[_0x2a8a('0x24')](_0x1f1c79[_0x2a8a('0x25')]);if(_0x1f1c79['name']){delete _0x1f1c79[_0x2a8a('0x26')];}_0x1a41fa[_0x2a8a('0x16')](_0x358a88)[_0x2a8a('0x27')](_0x1f1c79);};}exports[_0x2a8a('0x28')]=function(_0x3beb0a,_0x13f829){var _0x5b3657={},_0x331310={},_0x32f23a={'count':0x0,'rows':[]};var _0x10869b=_[_0x2a8a('0x29')](db['AnalyticTreeReport'][_0x2a8a('0x2a')],function(_0x1573ee){return{'name':_0x1573ee['fieldName'],'type':_0x1573ee['type'][_0x2a8a('0x2b')]};});_0x331310[_0x2a8a('0x2c')]=_[_0x2a8a('0x29')](_0x10869b,'name');_0x331310[_0x2a8a('0x2d')]=_[_0x2a8a('0x2e')](_0x3beb0a['query']);_0x331310[_0x2a8a('0x2f')]=_[_0x2a8a('0x30')](_0x331310[_0x2a8a('0x2c')],_0x331310[_0x2a8a('0x2d')]);_0x5b3657['attributes']=_['intersection'](_0x331310[_0x2a8a('0x2c')],qs['fields'](_0x3beb0a[_0x2a8a('0x2d')][_0x2a8a('0x31')]));_0x5b3657[_0x2a8a('0x32')]=_0x5b3657[_0x2a8a('0x32')]['length']?_0x5b3657[_0x2a8a('0x32')]:_0x331310[_0x2a8a('0x2c')];if(!_0x3beb0a['query']['hasOwnProperty'](_0x2a8a('0x33'))){_0x5b3657[_0x2a8a('0x19')]=qs[_0x2a8a('0x19')](_0x3beb0a[_0x2a8a('0x2d')]['limit']);_0x5b3657[_0x2a8a('0x17')]=qs[_0x2a8a('0x17')](_0x3beb0a[_0x2a8a('0x2d')]['offset']);}_0x5b3657[_0x2a8a('0x34')]=qs[_0x2a8a('0x35')](_0x3beb0a['query'][_0x2a8a('0x35')]);_0x5b3657[_0x2a8a('0x36')]=qs[_0x2a8a('0x2f')](_['pick'](_0x3beb0a[_0x2a8a('0x2d')],_0x331310[_0x2a8a('0x2f')]),_0x10869b);if(_0x3beb0a[_0x2a8a('0x2d')][_0x2a8a('0x37')]){_0x5b3657[_0x2a8a('0x36')]=_[_0x2a8a('0x38')](_0x5b3657[_0x2a8a('0x36')],{'$or':_[_0x2a8a('0x29')](_0x10869b,function(_0xbae8ef){if(_0xbae8ef[_0x2a8a('0x39')]!=='VIRTUAL'){var _0x52d8f4={};_0x52d8f4[_0xbae8ef[_0x2a8a('0x26')]]={'$like':'%'+_0x3beb0a['query'][_0x2a8a('0x37')]+'%'};return _0x52d8f4;}})});}_0x5b3657=_[_0x2a8a('0x38')]({},_0x5b3657,_0x3beb0a[_0x2a8a('0x3a')]);var _0x1d8b6c={'where':_0x5b3657[_0x2a8a('0x36')]};return db['AnalyticTreeReport']['count'](_0x1d8b6c)[_0x2a8a('0x21')](function(_0xc06371){_0x32f23a[_0x2a8a('0x1a')]=_0xc06371;if(_0x3beb0a[_0x2a8a('0x2d')][_0x2a8a('0x3b')]){_0x5b3657[_0x2a8a('0x3c')]=[{'all':!![]}];}return db[_0x2a8a('0x3d')][_0x2a8a('0x3e')](_0x5b3657);})[_0x2a8a('0x21')](function(_0x2834b1){_0x32f23a[_0x2a8a('0x3f')]=_0x2834b1;return _0x32f23a;})[_0x2a8a('0x21')](respondWithFilteredResult(_0x13f829,_0x5b3657))[_0x2a8a('0x40')](handleError(_0x13f829,null));};exports['show']=function(_0x43c75a,_0x4b3d9b){var _0x444dca={'raw':!![],'where':{'id':_0x43c75a['params']['id']}},_0xff1060={};_0xff1060['model']=_[_0x2a8a('0x2e')](db[_0x2a8a('0x3d')][_0x2a8a('0x2a')]);_0xff1060[_0x2a8a('0x2d')]=_[_0x2a8a('0x2e')](_0x43c75a[_0x2a8a('0x2d')]);_0xff1060[_0x2a8a('0x2f')]=_[_0x2a8a('0x30')](_0xff1060[_0x2a8a('0x2c')],_0xff1060[_0x2a8a('0x2d')]);_0x444dca[_0x2a8a('0x32')]=_['intersection'](_0xff1060[_0x2a8a('0x2c')],qs[_0x2a8a('0x31')](_0x43c75a[_0x2a8a('0x2d')][_0x2a8a('0x31')]));_0x444dca['attributes']=_0x444dca[_0x2a8a('0x32')][_0x2a8a('0x41')]?_0x444dca[_0x2a8a('0x32')]:_0xff1060[_0x2a8a('0x2c')];if(_0x43c75a[_0x2a8a('0x2d')][_0x2a8a('0x3b')]){_0x444dca[_0x2a8a('0x3c')]=[{'all':!![]}];}_0x444dca=_[_0x2a8a('0x38')]({},_0x444dca,_0x43c75a['options']);return db[_0x2a8a('0x3d')][_0x2a8a('0x42')](_0x444dca)[_0x2a8a('0x21')](handleEntityNotFound(_0x4b3d9b,null))[_0x2a8a('0x21')](respondWithResult(_0x4b3d9b,null))[_0x2a8a('0x40')](handleError(_0x4b3d9b,null));};exports[_0x2a8a('0x43')]=function(_0x2a1ef6,_0x5ca7b6){return db[_0x2a8a('0x3d')]['create'](_0x2a1ef6[_0x2a8a('0x44')],{})['then'](respondWithResult(_0x5ca7b6,0xc9))['catch'](handleError(_0x5ca7b6,null));};exports['update']=function(_0x42cc45,_0xa5e1a1){if(_0x42cc45[_0x2a8a('0x44')]['id']){delete _0x42cc45[_0x2a8a('0x44')]['id'];}return db[_0x2a8a('0x3d')][_0x2a8a('0x42')]({'where':{'id':_0x42cc45['params']['id']}})[_0x2a8a('0x21')](handleEntityNotFound(_0xa5e1a1,null))[_0x2a8a('0x21')](saveUpdates(_0x42cc45[_0x2a8a('0x44')],null))[_0x2a8a('0x21')](respondWithResult(_0xa5e1a1,null))[_0x2a8a('0x40')](handleError(_0xa5e1a1,null));};exports[_0x2a8a('0x22')]=function(_0x5d987d,_0x1c8af1){return db[_0x2a8a('0x3d')][_0x2a8a('0x42')]({'where':{'id':_0x5d987d[_0x2a8a('0x45')]['id']}})[_0x2a8a('0x21')](handleEntityNotFound(_0x1c8af1,null))[_0x2a8a('0x21')](removeEntity(_0x1c8af1,null))[_0x2a8a('0x40')](handleError(_0x1c8af1,null));}; \ No newline at end of file +var _0x50d2=['util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1d8b10,_0x9603a6){var _0x123f31=function(_0x675fd8){while(--_0x675fd8){_0x1d8b10['push'](_0x1d8b10['shift']());}};_0x123f31(++_0x9603a6);}(_0x50d2,0x128));var _0x250d=function(_0x2fd7fb,_0x32afad){_0x2fd7fb=_0x2fd7fb-0x0;var _0x15bf0a=_0x50d2[_0x2fd7fb];return _0x15bf0a;};'use strict';var emlformat=require(_0x250d('0x0'));var rimraf=require(_0x250d('0x1'));var zipdir=require(_0x250d('0x2'));var jsonpatch=require(_0x250d('0x3'));var rp=require(_0x250d('0x4'));var moment=require(_0x250d('0x5'));var BPromise=require(_0x250d('0x6'));var Mustache=require(_0x250d('0x7'));var util=require(_0x250d('0x8'));var path=require(_0x250d('0x9'));var sox=require('sox');var csv=require(_0x250d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x250d('0xb'));var _=require('lodash');var squel=require(_0x250d('0xc'));var crypto=require('crypto');var jsforce=require(_0x250d('0xd'));var deskjs=require(_0x250d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x250d('0xf'));var Papa=require('papaparse');var Redis=require(_0x250d('0x10'));var authService=require(_0x250d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x250d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x250d('0x13'));var config=require(_0x250d('0x14'));var licenseUtil=require(_0x250d('0x15'));var db=require(_0x250d('0x16'))['db'];function respondWithStatusCode(_0x573a5b,_0x3bf830){_0x3bf830=_0x3bf830||0xcc;return function(_0x5ba5c8){if(_0x5ba5c8){return _0x573a5b[_0x250d('0x17')](_0x3bf830);}return _0x573a5b[_0x250d('0x18')](_0x3bf830)['end']();};}function respondWithResult(_0x11a763,_0x5a2074){_0x5a2074=_0x5a2074||0xc8;return function(_0x25bf05){if(_0x25bf05){return _0x11a763[_0x250d('0x18')](_0x5a2074)[_0x250d('0x19')](_0x25bf05);}};}function respondWithFilteredResult(_0x4360a5,_0x423877){return function(_0x52105e){if(_0x52105e){var _0x50e626=typeof _0x423877['offset']==='undefined'&&typeof _0x423877[_0x250d('0x1a')]===_0x250d('0x1b');var _0x797c9c=_0x52105e[_0x250d('0x1c')];var _0x1d6176=_0x50e626?0x0:_0x423877['offset'];var _0x54934e=_0x50e626?_0x52105e[_0x250d('0x1c')]:_0x423877[_0x250d('0x1d')]+_0x423877[_0x250d('0x1a')];var _0x49d256;if(_0x54934e>=_0x797c9c){_0x54934e=_0x797c9c;_0x49d256=0xc8;}else{_0x49d256=0xce;}_0x4360a5['status'](_0x49d256);return _0x4360a5[_0x250d('0x1e')](_0x250d('0x1f'),_0x1d6176+'-'+_0x54934e+'/'+_0x797c9c)[_0x250d('0x19')](_0x52105e);}return null;};}function patchUpdates(_0x245bda){return function(_0x31e804){try{jsonpatch[_0x250d('0x20')](_0x31e804,_0x245bda,!![]);}catch(_0xca36ed){return BPromise[_0x250d('0x21')](_0xca36ed);}return _0x31e804[_0x250d('0x22')]();};}function saveUpdates(_0x503eb2,_0x1f9849){return function(_0x1373a3){if(_0x1373a3){return _0x1373a3[_0x250d('0x23')](_0x503eb2)[_0x250d('0x24')](function(_0x4f192e){return _0x4f192e;});}return null;};}function removeEntity(_0x992abc,_0x45f18f){return function(_0x52705f){if(_0x52705f){return _0x52705f['destroy']()[_0x250d('0x24')](function(){_0x992abc[_0x250d('0x18')](0xcc)[_0x250d('0x25')]();});}};}function handleEntityNotFound(_0x2c58c1,_0x1b3578){return function(_0x5c4ef1){if(!_0x5c4ef1){_0x2c58c1[_0x250d('0x17')](0x194);}return _0x5c4ef1;};}function handleError(_0x283954,_0x260eb5){_0x260eb5=_0x260eb5||0x1f4;return function(_0x1738d9){logger[_0x250d('0x26')](_0x1738d9['stack']);if(_0x1738d9['name']){delete _0x1738d9[_0x250d('0x27')];}_0x283954[_0x250d('0x18')](_0x260eb5)[_0x250d('0x28')](_0x1738d9);};}exports[_0x250d('0x29')]=function(_0x577f48,_0x5e58c8){var _0x52170d={},_0x2d8a4f={},_0x5814ce={'count':0x0,'rows':[]};var _0xabf5f7=_[_0x250d('0x2a')](db['AnalyticTreeReport']['rawAttributes'],function(_0xf2d780){return{'name':_0xf2d780[_0x250d('0x2b')],'type':_0xf2d780[_0x250d('0x2c')][_0x250d('0x2d')]};});_0x2d8a4f[_0x250d('0x2e')]=_['map'](_0xabf5f7,_0x250d('0x27'));_0x2d8a4f[_0x250d('0x2f')]=_[_0x250d('0x30')](_0x577f48[_0x250d('0x2f')]);_0x2d8a4f['filters']=_[_0x250d('0x31')](_0x2d8a4f[_0x250d('0x2e')],_0x2d8a4f[_0x250d('0x2f')]);_0x52170d[_0x250d('0x32')]=_[_0x250d('0x31')](_0x2d8a4f[_0x250d('0x2e')],qs[_0x250d('0x33')](_0x577f48[_0x250d('0x2f')][_0x250d('0x33')]));_0x52170d[_0x250d('0x32')]=_0x52170d[_0x250d('0x32')][_0x250d('0x34')]?_0x52170d[_0x250d('0x32')]:_0x2d8a4f[_0x250d('0x2e')];if(!_0x577f48[_0x250d('0x2f')][_0x250d('0x35')](_0x250d('0x36'))){_0x52170d['limit']=qs[_0x250d('0x1a')](_0x577f48[_0x250d('0x2f')][_0x250d('0x1a')]);_0x52170d['offset']=qs['offset'](_0x577f48['query'][_0x250d('0x1d')]);}_0x52170d[_0x250d('0x37')]=qs[_0x250d('0x38')](_0x577f48[_0x250d('0x2f')][_0x250d('0x38')]);_0x52170d['where']=qs[_0x250d('0x39')](_[_0x250d('0x3a')](_0x577f48[_0x250d('0x2f')],_0x2d8a4f[_0x250d('0x39')]),_0xabf5f7);if(_0x577f48[_0x250d('0x2f')][_0x250d('0x3b')]){_0x52170d['where']=_[_0x250d('0x3c')](_0x52170d[_0x250d('0x3d')],{'$or':_[_0x250d('0x2a')](_0xabf5f7,function(_0x526860){if(_0x526860[_0x250d('0x2c')]!=='VIRTUAL'){var _0x43cda6={};_0x43cda6[_0x526860[_0x250d('0x27')]]={'$like':'%'+_0x577f48[_0x250d('0x2f')][_0x250d('0x3b')]+'%'};return _0x43cda6;}})});}_0x52170d=_['merge']({},_0x52170d,_0x577f48[_0x250d('0x3e')]);var _0x3951fd={'where':_0x52170d[_0x250d('0x3d')]};return db[_0x250d('0x3f')][_0x250d('0x1c')](_0x3951fd)[_0x250d('0x24')](function(_0x18b33d){_0x5814ce[_0x250d('0x1c')]=_0x18b33d;if(_0x577f48[_0x250d('0x2f')][_0x250d('0x40')]){_0x52170d['include']=[{'all':!![]}];}return db[_0x250d('0x3f')][_0x250d('0x41')](_0x52170d);})[_0x250d('0x24')](function(_0x1a7d5f){_0x5814ce[_0x250d('0x42')]=_0x1a7d5f;return _0x5814ce;})['then'](respondWithFilteredResult(_0x5e58c8,_0x52170d))[_0x250d('0x43')](handleError(_0x5e58c8,null));};exports[_0x250d('0x44')]=function(_0x3fea3a,_0xf2d299){var _0x44cc13={'raw':!![],'where':{'id':_0x3fea3a[_0x250d('0x45')]['id']}},_0x119bef={};_0x119bef[_0x250d('0x2e')]=_['keys'](db[_0x250d('0x3f')][_0x250d('0x46')]);_0x119bef['query']=_[_0x250d('0x30')](_0x3fea3a[_0x250d('0x2f')]);_0x119bef[_0x250d('0x39')]=_[_0x250d('0x31')](_0x119bef['model'],_0x119bef[_0x250d('0x2f')]);_0x44cc13[_0x250d('0x32')]=_[_0x250d('0x31')](_0x119bef[_0x250d('0x2e')],qs[_0x250d('0x33')](_0x3fea3a[_0x250d('0x2f')][_0x250d('0x33')]));_0x44cc13[_0x250d('0x32')]=_0x44cc13[_0x250d('0x32')][_0x250d('0x34')]?_0x44cc13[_0x250d('0x32')]:_0x119bef[_0x250d('0x2e')];if(_0x3fea3a['query']['includeAll']){_0x44cc13[_0x250d('0x47')]=[{'all':!![]}];}_0x44cc13=_[_0x250d('0x3c')]({},_0x44cc13,_0x3fea3a[_0x250d('0x3e')]);return db['AnalyticTreeReport'][_0x250d('0x48')](_0x44cc13)[_0x250d('0x24')](handleEntityNotFound(_0xf2d299,null))[_0x250d('0x24')](respondWithResult(_0xf2d299,null))[_0x250d('0x43')](handleError(_0xf2d299,null));};exports['create']=function(_0xf262f8,_0x2d87ce){return db[_0x250d('0x3f')][_0x250d('0x49')](_0xf262f8[_0x250d('0x4a')],{})[_0x250d('0x24')](respondWithResult(_0x2d87ce,0xc9))['catch'](handleError(_0x2d87ce,null));};exports[_0x250d('0x23')]=function(_0x5ec6e1,_0x499915){if(_0x5ec6e1[_0x250d('0x4a')]['id']){delete _0x5ec6e1[_0x250d('0x4a')]['id'];}return db[_0x250d('0x3f')]['find']({'where':{'id':_0x5ec6e1[_0x250d('0x45')]['id']}})['then'](handleEntityNotFound(_0x499915,null))[_0x250d('0x24')](saveUpdates(_0x5ec6e1[_0x250d('0x4a')],null))['then'](respondWithResult(_0x499915,null))['catch'](handleError(_0x499915,null));};exports[_0x250d('0x4b')]=function(_0x5dcc27,_0x4735f6){return db[_0x250d('0x3f')][_0x250d('0x48')]({'where':{'id':_0x5dcc27['params']['id']}})[_0x250d('0x24')](handleEntityNotFound(_0x4735f6,null))['then'](removeEntity(_0x4735f6,null))['catch'](handleError(_0x4735f6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 74b4f88..98f0395 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 _0x6763=['util','../../config/logger','api','moment','bluebird','path','rimraf','./analyticTreeReport.attributes','exports','define','analytics_report_trees'];(function(_0x749e25,_0x2a57b4){var _0x1c6a36=function(_0x44d98b){while(--_0x44d98b){_0x749e25['push'](_0x749e25['shift']());}};_0x1c6a36(++_0x2a57b4);}(_0x6763,0x113));var _0x3676=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x6763[_0x2fee96];return _0x2e6ad1;};'use strict';var _=require('lodash');var util=require(_0x3676('0x0'));var logger=require(_0x3676('0x1'))(_0x3676('0x2'));var moment=require(_0x3676('0x3'));var BPromise=require(_0x3676('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3676('0x5'));var rimraf=require(_0x3676('0x6'));var config=require('../../config/environment');var attributes=require(_0x3676('0x7'));module[_0x3676('0x8')]=function(_0x2da301,_0xef31c8){return _0x2da301[_0x3676('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x3676('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31fb=['analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x10a13d,_0x15e2aa){var _0x479dd4=function(_0x4de691){while(--_0x4de691){_0x10a13d['push'](_0x10a13d['shift']());}};_0x479dd4(++_0x15e2aa);}(_0x31fb,0x1e2));var _0xb31f=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x31fb[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xb31f('0x0'));var util=require(_0xb31f('0x1'));var logger=require('../../config/logger')(_0xb31f('0x2'));var moment=require(_0xb31f('0x3'));var BPromise=require(_0xb31f('0x4'));var rp=require(_0xb31f('0x5'));var fs=require('fs');var path=require(_0xb31f('0x6'));var rimraf=require(_0xb31f('0x7'));var config=require(_0xb31f('0x8'));var attributes=require(_0xb31f('0x9'));module['exports']=function(_0x5a92f9,_0x5277ed){return _0x5a92f9[_0xb31f('0xa')](_0xb31f('0xb'),attributes,{'tableName':_0xb31f('0xc'),'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 c90dd21..5c19011 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3ad925,_0x4a3eed){var _0x3369cc=function(_0x164e54){while(--_0x164e54){_0x3ad925['push'](_0x3ad925['shift']());}};_0x3369cc(++_0x4a3eed);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x431f7b,_0x2b624b){_0x431f7b=_0x431f7b-0x0;var _0x279c74=_0x7a54[_0x431f7b];return _0x279c74;};'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 ccb8d65..306e80b 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 _0x1499=['get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x31a6d3,_0x5096ab){var _0x29da2b=function(_0x53b298){while(--_0x53b298){_0x31a6d3['push'](_0x31a6d3['shift']());}};_0x29da2b(++_0x5096ab);}(_0x1499,0xb5));var _0x9149=function(_0x2bde62,_0x5e856){_0x2bde62=_0x2bde62-0x0;var _0x55ea09=_0x1499[_0x2bde62];return _0x55ea09;};'use strict';var multer=require(_0x9149('0x0'));var util=require('util');var path=require(_0x9149('0x1'));var timeout=require(_0x9149('0x2'));var express=require(_0x9149('0x3'));var router=express['Router']();var fs_extra=require(_0x9149('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9149('0x5'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x9149('0x6')]('/',auth['isAuthenticated'](),controller[_0x9149('0x7')]);router[_0x9149('0x6')](_0x9149('0x8'),auth[_0x9149('0x9')](),controller['show']);router[_0x9149('0xa')]('/',auth[_0x9149('0x9')](),controller[_0x9149('0xb')]);router[_0x9149('0xc')](_0x9149('0x8'),auth[_0x9149('0x9')](),controller[_0x9149('0xd')]);router[_0x9149('0xe')](_0x9149('0x8'),auth['isAuthenticated'](),controller[_0x9149('0xf')]);module[_0x9149('0x10')]=router; \ No newline at end of file +var _0x5499=['show','post','put','update','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated'];(function(_0x166fb4,_0x43cb69){var _0xa0c5ef=function(_0x21fe31){while(--_0x21fe31){_0x166fb4['push'](_0x166fb4['shift']());}};_0xa0c5ef(++_0x43cb69);}(_0x5499,0x15c));var _0x9549=function(_0x2f2d45,_0x338762){_0x2f2d45=_0x2f2d45-0x0;var _0x1fc082=_0x5499[_0x2f2d45];return _0x1fc082;};'use strict';var multer=require('multer');var util=require(_0x9549('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9549('0x1'));var router=express[_0x9549('0x2')]();var fs_extra=require(_0x9549('0x3'));var auth=require(_0x9549('0x4'));var interaction=require(_0x9549('0x5'));var config=require(_0x9549('0x6'));var controller=require(_0x9549('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9549('0x8')]);router[_0x9549('0x9')](_0x9549('0xa'),auth[_0x9549('0xb')](),controller[_0x9549('0xc')]);router[_0x9549('0xd')]('/',auth[_0x9549('0xb')](),controller['create']);router[_0x9549('0xe')](_0x9549('0xa'),auth[_0x9549('0xb')](),controller[_0x9549('0xf')]);router[_0x9549('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9549('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 8251114..389f8d6 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 _0xb31a=['exports','STRING','sequelize'];(function(_0x58435f,_0x23eac8){var _0x3a297e=function(_0x98ea5){while(--_0x98ea5){_0x58435f['push'](_0x58435f['shift']());}};_0x3a297e(++_0x23eac8);}(_0xb31a,0xd4));var _0xab31=function(_0x2f39fa,_0x5db800){_0x2f39fa=_0x2f39fa-0x0;var _0x409bfd=_0xb31a[_0x2f39fa];return _0x409bfd;};'use strict';var Sequelize=require(_0xab31('0x0'));module[_0xab31('0x1')]={'name':{'type':Sequelize[_0xab31('0x2')]},'basename':{'type':Sequelize[_0xab31('0x2')]},'type':{'type':Sequelize[_0xab31('0x2')]}}; \ No newline at end of file +var _0x98d5=['STRING','sequelize'];(function(_0x236092,_0x2f90ba){var _0x353481=function(_0x591807){while(--_0x591807){_0x236092['push'](_0x236092['shift']());}};_0x353481(++_0x2f90ba);}(_0x98d5,0xfb));var _0x598d=function(_0x6cecca,_0x406465){_0x6cecca=_0x6cecca-0x0;var _0x546160=_0x98d5[_0x6cecca];return _0x546160;};'use strict';var Sequelize=require(_0x598d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x598d('0x1')]},'type':{'type':Sequelize[_0x598d('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index d41b3f1..0927a3f 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 _0x0c73=['join','server/files/attachments/','offline-chat/','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','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','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','update','then','end','name','send','map','Attachment','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','clone','get','omit','createdAt','updatedAt','body','create','destroy','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0c73,0x1b1));var _0x30c7=function(_0x31e11a,_0x20a6bf){_0x31e11a=_0x31e11a-0x0;var _0xe98110=_0x0c73[_0x31e11a];return _0xe98110;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x30c7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x30c7('0x1'));var rp=require(_0x30c7('0x2'));var moment=require(_0x30c7('0x3'));var BPromise=require(_0x30c7('0x4'));var Mustache=require('mustache');var util=require(_0x30c7('0x5'));var path=require(_0x30c7('0x6'));var sox=require('sox');var csv=require(_0x30c7('0x7'));var ejs=require(_0x30c7('0x8'));var fs=require('fs');var fs_extra=require(_0x30c7('0x9'));var _=require(_0x30c7('0xa'));var squel=require(_0x30c7('0xb'));var crypto=require('crypto');var jsforce=require(_0x30c7('0xc'));var deskjs=require(_0x30c7('0xd'));var toCsv=require(_0x30c7('0x7'));var querystring=require('querystring');var Papa=require(_0x30c7('0xe'));var Redis=require('ioredis');var authService=require(_0x30c7('0xf'));var qs=require(_0x30c7('0x10'));var as=require(_0x30c7('0x11'));var hardwareService=require(_0x30c7('0x12'));var logger=require(_0x30c7('0x13'))(_0x30c7('0x14'));var utils=require(_0x30c7('0x15'));var config=require(_0x30c7('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b7b3c,_0x3259f8){_0x3259f8=_0x3259f8||0xcc;return function(_0x2d9318){if(_0x2d9318){return _0x3b7b3c[_0x30c7('0x17')](_0x3259f8);}return _0x3b7b3c[_0x30c7('0x18')](_0x3259f8)['end']();};}function respondWithResult(_0x2dee5e,_0x528d07){_0x528d07=_0x528d07||0xc8;return function(_0x386789){if(_0x386789){return _0x2dee5e['status'](_0x528d07)[_0x30c7('0x19')](_0x386789);}};}function respondWithFilteredResult(_0x3a9cf0,_0x2b6fe7){return function(_0x3d5910){if(_0x3d5910){var _0x1be443=typeof _0x2b6fe7[_0x30c7('0x1a')]===_0x30c7('0x1b')&&typeof _0x2b6fe7['limit']===_0x30c7('0x1b');var _0x46596f=_0x3d5910['count'];var _0x528e4c=_0x1be443?0x0:_0x2b6fe7[_0x30c7('0x1a')];var _0x1f0901=_0x1be443?_0x3d5910[_0x30c7('0x1c')]:_0x2b6fe7[_0x30c7('0x1a')]+_0x2b6fe7[_0x30c7('0x1d')];var _0x48a1b0;if(_0x1f0901>=_0x46596f){_0x1f0901=_0x46596f;_0x48a1b0=0xc8;}else{_0x48a1b0=0xce;}_0x3a9cf0[_0x30c7('0x18')](_0x48a1b0);return _0x3a9cf0[_0x30c7('0x1e')]('Content-Range',_0x528e4c+'-'+_0x1f0901+'/'+_0x46596f)[_0x30c7('0x19')](_0x3d5910);}return null;};}function patchUpdates(_0x34fd1d){return function(_0x28d21e){try{jsonpatch['apply'](_0x28d21e,_0x34fd1d,!![]);}catch(_0x37931f){return BPromise[_0x30c7('0x1f')](_0x37931f);}return _0x28d21e[_0x30c7('0x20')]();};}function saveUpdates(_0x4ead37,_0x280d51){return function(_0x18b921){if(_0x18b921){return _0x18b921[_0x30c7('0x21')](_0x4ead37)[_0x30c7('0x22')](function(_0x18b012){return _0x18b012;});}return null;};}function removeEntity(_0x421251,_0x45fc13){return function(_0x1139ba){if(_0x1139ba){return _0x1139ba['destroy']()['then'](function(){_0x421251['status'](0xcc)[_0x30c7('0x23')]();});}};}function handleEntityNotFound(_0x469ba3,_0x3f8da7){return function(_0x2c22dd){if(!_0x2c22dd){_0x469ba3[_0x30c7('0x17')](0x194);}return _0x2c22dd;};}function handleError(_0x489202,_0x8e1955){_0x8e1955=_0x8e1955||0x1f4;return function(_0x235091){logger['error'](_0x235091['stack']);if(_0x235091[_0x30c7('0x24')]){delete _0x235091[_0x30c7('0x24')];}_0x489202[_0x30c7('0x18')](_0x8e1955)[_0x30c7('0x25')](_0x235091);};}exports['index']=function(_0x483ed5,_0x2e35b3){var _0x4c7c68={},_0x378cac={},_0xb900cd={'count':0x0,'rows':[]};var _0xc1942a=_[_0x30c7('0x26')](db[_0x30c7('0x27')]['rawAttributes'],function(_0x33c787){return{'name':_0x33c787[_0x30c7('0x28')],'type':_0x33c787[_0x30c7('0x29')][_0x30c7('0x2a')]};});_0x378cac[_0x30c7('0x2b')]=_[_0x30c7('0x26')](_0xc1942a,'name');_0x378cac[_0x30c7('0x2c')]=_[_0x30c7('0x2d')](_0x483ed5[_0x30c7('0x2c')]);_0x378cac[_0x30c7('0x2e')]=_[_0x30c7('0x2f')](_0x378cac[_0x30c7('0x2b')],_0x378cac[_0x30c7('0x2c')]);_0x4c7c68[_0x30c7('0x30')]=_[_0x30c7('0x2f')](_0x378cac[_0x30c7('0x2b')],qs[_0x30c7('0x31')](_0x483ed5[_0x30c7('0x2c')][_0x30c7('0x31')]));_0x4c7c68[_0x30c7('0x30')]=_0x4c7c68[_0x30c7('0x30')][_0x30c7('0x32')]?_0x4c7c68[_0x30c7('0x30')]:_0x378cac[_0x30c7('0x2b')];if(!_0x483ed5[_0x30c7('0x2c')]['hasOwnProperty'](_0x30c7('0x33'))){_0x4c7c68['limit']=qs[_0x30c7('0x1d')](_0x483ed5[_0x30c7('0x2c')]['limit']);_0x4c7c68[_0x30c7('0x1a')]=qs[_0x30c7('0x1a')](_0x483ed5[_0x30c7('0x2c')][_0x30c7('0x1a')]);}_0x4c7c68['order']=qs[_0x30c7('0x34')](_0x483ed5['query'][_0x30c7('0x34')]);_0x4c7c68[_0x30c7('0x35')]=qs[_0x30c7('0x2e')](_['pick'](_0x483ed5['query'],_0x378cac[_0x30c7('0x2e')]),_0xc1942a);if(_0x483ed5[_0x30c7('0x2c')][_0x30c7('0x36')]){_0x4c7c68[_0x30c7('0x35')]=_[_0x30c7('0x37')](_0x4c7c68[_0x30c7('0x35')],{'$or':_[_0x30c7('0x26')](_0xc1942a,function(_0x4e0208){if(_0x4e0208[_0x30c7('0x29')]!==_0x30c7('0x38')){var _0x45169d={};_0x45169d[_0x4e0208[_0x30c7('0x24')]]={'$like':'%'+_0x483ed5[_0x30c7('0x2c')][_0x30c7('0x36')]+'%'};return _0x45169d;}})});}_0x4c7c68=_[_0x30c7('0x37')]({},_0x4c7c68,_0x483ed5[_0x30c7('0x39')]);var _0x313122={'where':_0x4c7c68[_0x30c7('0x35')]};return db[_0x30c7('0x27')][_0x30c7('0x1c')](_0x313122)['then'](function(_0xdd87d){_0xb900cd['count']=_0xdd87d;if(_0x483ed5[_0x30c7('0x2c')][_0x30c7('0x3a')]){_0x4c7c68['include']=[{'all':!![]}];}return db[_0x30c7('0x27')][_0x30c7('0x3b')](_0x4c7c68);})[_0x30c7('0x22')](function(_0xc1958b){_0xb900cd[_0x30c7('0x3c')]=_0xc1958b;return _0xb900cd;})[_0x30c7('0x22')](respondWithFilteredResult(_0x2e35b3,_0x4c7c68))['catch'](handleError(_0x2e35b3,null));};exports[_0x30c7('0x3d')]=function(_0x32794b,_0x22af4a){var _0x141c66={'raw':!![],'where':{'id':_0x32794b[_0x30c7('0x3e')]['id']}},_0x1490ba={};_0x1490ba[_0x30c7('0x2b')]=_['keys'](db[_0x30c7('0x27')][_0x30c7('0x3f')]);_0x1490ba[_0x30c7('0x2c')]=_['keys'](_0x32794b[_0x30c7('0x2c')]);_0x1490ba[_0x30c7('0x2e')]=_[_0x30c7('0x2f')](_0x1490ba[_0x30c7('0x2b')],_0x1490ba[_0x30c7('0x2c')]);_0x141c66[_0x30c7('0x30')]=_[_0x30c7('0x2f')](_0x1490ba[_0x30c7('0x2b')],qs[_0x30c7('0x31')](_0x32794b[_0x30c7('0x2c')][_0x30c7('0x31')]));_0x141c66['attributes']=_0x141c66[_0x30c7('0x30')][_0x30c7('0x32')]?_0x141c66[_0x30c7('0x30')]:_0x1490ba[_0x30c7('0x2b')];if(_0x32794b[_0x30c7('0x2c')]['includeAll']){_0x141c66[_0x30c7('0x40')]=[{'all':!![]}];}_0x141c66=_[_0x30c7('0x37')]({},_0x141c66,_0x32794b[_0x30c7('0x39')]);return db[_0x30c7('0x27')][_0x30c7('0x41')](_0x141c66)[_0x30c7('0x22')](handleEntityNotFound(_0x22af4a,null))['then'](respondWithResult(_0x22af4a,null))[_0x30c7('0x42')](handleError(_0x22af4a,null));};exports[_0x30c7('0x43')]=function(_0x231908,_0x12efd7){var _0x5e370a={'where':{'id':_0x231908[_0x30c7('0x3e')]['id']}},_0x33bb17={};_0x33bb17[_0x30c7('0x2b')]=_[_0x30c7('0x2d')](db[_0x30c7('0x27')][_0x30c7('0x3f')]);_0x5e370a['attributes']=_['intersection'](_0x33bb17['model'],qs[_0x30c7('0x31')](_0x231908['query'][_0x30c7('0x31')]));_0x5e370a[_0x30c7('0x30')]=_0x5e370a[_0x30c7('0x30')][_0x30c7('0x32')]?_0x5e370a[_0x30c7('0x30')]:_0x33bb17[_0x30c7('0x2b')];if(_0x231908['query']['includeAll']){_0x5e370a[_0x30c7('0x40')]=[{'all':!![]}];}_0x5e370a=_['merge']({},_0x5e370a,_0x231908[_0x30c7('0x39')]);return db[_0x30c7('0x27')][_0x30c7('0x41')](_0x5e370a)[_0x30c7('0x22')](handleEntityNotFound(_0x12efd7,null))[_0x30c7('0x22')](function(_0x6d07ad){if(_0x6d07ad){var _0x5c8cc0=_0x6d07ad[_0x30c7('0x44')]({'plain':!![]});_0x5c8cc0=qs[_0x30c7('0x45')](_0x5c8cc0,['id',_0x30c7('0x46'),_0x30c7('0x47')]);_0x231908[_0x30c7('0x48')]=_[_0x30c7('0x45')](_0x231908[_0x30c7('0x48')],['id',_0x30c7('0x46'),_0x30c7('0x47')]);return db[_0x30c7('0x27')][_0x30c7('0x49')](_[_0x30c7('0x37')](_0x5c8cc0,_0x231908[_0x30c7('0x48')]),{'include':_0x231908[_0x30c7('0x2c')][_0x30c7('0x3a')]?[{'all':!![]}]:undefined});}})[_0x30c7('0x22')](respondWithResult(_0x12efd7,0xc9))[_0x30c7('0x42')](handleError(_0x12efd7,null));};exports[_0x30c7('0x21')]=function(_0xe4e419,_0x357086){if(_0xe4e419[_0x30c7('0x48')]['id']){delete _0xe4e419[_0x30c7('0x48')]['id'];}return db[_0x30c7('0x27')][_0x30c7('0x41')]({'where':{'id':_0xe4e419[_0x30c7('0x3e')]['id']}})[_0x30c7('0x22')](handleEntityNotFound(_0x357086,null))[_0x30c7('0x22')](saveUpdates(_0xe4e419[_0x30c7('0x48')],null))[_0x30c7('0x22')](respondWithResult(_0x357086,null))[_0x30c7('0x42')](handleError(_0x357086,null));};exports[_0x30c7('0x4a')]=function(_0x2bcddf,_0x5fff2b){return db[_0x30c7('0x27')]['find']({'where':{'id':_0x2bcddf[_0x30c7('0x3e')]['id']}})[_0x30c7('0x22')](handleEntityNotFound(_0x5fff2b,null))[_0x30c7('0x22')](removeEntity(_0x5fff2b,null))[_0x30c7('0x42')](handleError(_0x5fff2b,null));};exports[_0x30c7('0x49')]=function(_0x2f7c2c,_0xe0e5cf,_0x39ff2c){_0x2f7c2c[_0x30c7('0x48')][_0x30c7('0x24')]=_0x2f7c2c['file'][_0x30c7('0x4b')];_0x2f7c2c[_0x30c7('0x48')][_0x30c7('0x4c')]=_0x2f7c2c[_0x30c7('0x4d')][_0x30c7('0x4e')];_0x2f7c2c[_0x30c7('0x48')][_0x30c7('0x29')]=_0x2f7c2c[_0x30c7('0x4d')][_0x30c7('0x4f')];return db[_0x30c7('0x27')][_0x30c7('0x49')](_0x2f7c2c[_0x30c7('0x48')])[_0x30c7('0x22')](respondWithResult(_0xe0e5cf,0xc9))['catch'](handleError(_0xe0e5cf,null));};exports[_0x30c7('0x50')]=function(_0x3eebab,_0x4c4519,_0x42d891){return db[_0x30c7('0x27')][_0x30c7('0x51')]({'where':{'id':_0x3eebab[_0x30c7('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4c4519,null))[_0x30c7('0x22')](function(_0x306a86){if(_0x306a86){var _0x559152=_0x306a86[_0x30c7('0x52')]!==null;var _0x30603f=path[_0x30c7('0x53')](config['root'],_0x30c7('0x54'));if(_0x559152){_0x30603f=path[_0x30c7('0x53')](_0x30603f,_0x30c7('0x55'));}var _0x2d90c3=path[_0x30c7('0x53')](_0x30603f,_0x306a86[_0x30c7('0x4c')]);return _0x4c4519[_0x30c7('0x50')](_0x2d90c3);}})[_0x30c7('0x42')](handleError(_0x4c4519,null));}; \ No newline at end of file +var _0x103a=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','intersection','length','options','find','get','omit','body','updatedAt','create','file','originalname','filename','download','findOne','join','root','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x24b773,_0x392c26){var _0x35f6c9=function(_0x37b5c3){while(--_0x37b5c3){_0x24b773['push'](_0x24b773['shift']());}};_0x35f6c9(++_0x392c26);}(_0x103a,0xfc));var _0xa103=function(_0x573658,_0x4effb7){_0x573658=_0x573658-0x0;var _0xee4e96=_0x103a[_0x573658];return _0xee4e96;};'use strict';var emlformat=require(_0xa103('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa103('0x1'));var jsonpatch=require(_0xa103('0x2'));var rp=require(_0xa103('0x3'));var moment=require(_0xa103('0x4'));var BPromise=require(_0xa103('0x5'));var Mustache=require(_0xa103('0x6'));var util=require(_0xa103('0x7'));var path=require('path');var sox=require(_0xa103('0x8'));var csv=require(_0xa103('0x9'));var ejs=require(_0xa103('0xa'));var fs=require('fs');var fs_extra=require(_0xa103('0xb'));var _=require(_0xa103('0xc'));var squel=require(_0xa103('0xd'));var crypto=require(_0xa103('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa103('0xf'));var toCsv=require(_0xa103('0x9'));var querystring=require(_0xa103('0x10'));var Papa=require(_0xa103('0x11'));var Redis=require('ioredis');var authService=require(_0xa103('0x12'));var qs=require(_0xa103('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa103('0x14'));var logger=require(_0xa103('0x15'))(_0xa103('0x16'));var utils=require(_0xa103('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa103('0x18'));var db=require(_0xa103('0x19'))['db'];function respondWithStatusCode(_0x16d922,_0x4183c1){_0x4183c1=_0x4183c1||0xcc;return function(_0x2fe57b){if(_0x2fe57b){return _0x16d922[_0xa103('0x1a')](_0x4183c1);}return _0x16d922[_0xa103('0x1b')](_0x4183c1)[_0xa103('0x1c')]();};}function respondWithResult(_0x48ec50,_0x896417){_0x896417=_0x896417||0xc8;return function(_0x4efc68){if(_0x4efc68){return _0x48ec50[_0xa103('0x1b')](_0x896417)[_0xa103('0x1d')](_0x4efc68);}};}function respondWithFilteredResult(_0x58f0a8,_0x2bb675){return function(_0x56d97f){if(_0x56d97f){var _0x3f4c81=typeof _0x2bb675[_0xa103('0x1e')]===_0xa103('0x1f')&&typeof _0x2bb675['limit']===_0xa103('0x1f');var _0x23f5d1=_0x56d97f[_0xa103('0x20')];var _0x4eb4ae=_0x3f4c81?0x0:_0x2bb675['offset'];var _0xfab670=_0x3f4c81?_0x56d97f['count']:_0x2bb675[_0xa103('0x1e')]+_0x2bb675[_0xa103('0x21')];var _0x1f4e65;if(_0xfab670>=_0x23f5d1){_0xfab670=_0x23f5d1;_0x1f4e65=0xc8;}else{_0x1f4e65=0xce;}_0x58f0a8[_0xa103('0x1b')](_0x1f4e65);return _0x58f0a8[_0xa103('0x22')](_0xa103('0x23'),_0x4eb4ae+'-'+_0xfab670+'/'+_0x23f5d1)[_0xa103('0x1d')](_0x56d97f);}return null;};}function patchUpdates(_0xd51914){return function(_0x253d91){try{jsonpatch[_0xa103('0x24')](_0x253d91,_0xd51914,!![]);}catch(_0x5e749c){return BPromise[_0xa103('0x25')](_0x5e749c);}return _0x253d91['save']();};}function saveUpdates(_0x565905,_0x45d360){return function(_0x5af8ee){if(_0x5af8ee){return _0x5af8ee[_0xa103('0x26')](_0x565905)[_0xa103('0x27')](function(_0x47e648){return _0x47e648;});}return null;};}function removeEntity(_0x337d0f,_0x2c047f){return function(_0x1a37fa){if(_0x1a37fa){return _0x1a37fa[_0xa103('0x28')]()[_0xa103('0x27')](function(){_0x337d0f[_0xa103('0x1b')](0xcc)[_0xa103('0x1c')]();});}};}function handleEntityNotFound(_0x1678fc,_0x455e0a){return function(_0x484af4){if(!_0x484af4){_0x1678fc[_0xa103('0x1a')](0x194);}return _0x484af4;};}function handleError(_0x4635d7,_0x44a04c){_0x44a04c=_0x44a04c||0x1f4;return function(_0x19348a){logger[_0xa103('0x29')](_0x19348a[_0xa103('0x2a')]);if(_0x19348a[_0xa103('0x2b')]){delete _0x19348a[_0xa103('0x2b')];}_0x4635d7[_0xa103('0x1b')](_0x44a04c)[_0xa103('0x2c')](_0x19348a);};}exports[_0xa103('0x2d')]=function(_0x217340,_0x145fac){var _0x3d593d={},_0x15ec6c={},_0x4a14e3={'count':0x0,'rows':[]};var _0xfe8e06=_[_0xa103('0x2e')](db[_0xa103('0x2f')][_0xa103('0x30')],function(_0x9b091a){return{'name':_0x9b091a[_0xa103('0x31')],'type':_0x9b091a[_0xa103('0x32')][_0xa103('0x33')]};});_0x15ec6c['model']=_[_0xa103('0x2e')](_0xfe8e06,_0xa103('0x2b'));_0x15ec6c[_0xa103('0x34')]=_[_0xa103('0x35')](_0x217340[_0xa103('0x34')]);_0x15ec6c[_0xa103('0x36')]=_['intersection'](_0x15ec6c[_0xa103('0x37')],_0x15ec6c['query']);_0x3d593d[_0xa103('0x38')]=_['intersection'](_0x15ec6c[_0xa103('0x37')],qs[_0xa103('0x39')](_0x217340[_0xa103('0x34')][_0xa103('0x39')]));_0x3d593d[_0xa103('0x38')]=_0x3d593d['attributes']['length']?_0x3d593d[_0xa103('0x38')]:_0x15ec6c[_0xa103('0x37')];if(!_0x217340['query'][_0xa103('0x3a')](_0xa103('0x3b'))){_0x3d593d['limit']=qs[_0xa103('0x21')](_0x217340['query']['limit']);_0x3d593d['offset']=qs[_0xa103('0x1e')](_0x217340[_0xa103('0x34')][_0xa103('0x1e')]);}_0x3d593d[_0xa103('0x3c')]=qs[_0xa103('0x3d')](_0x217340[_0xa103('0x34')][_0xa103('0x3d')]);_0x3d593d[_0xa103('0x3e')]=qs[_0xa103('0x36')](_['pick'](_0x217340[_0xa103('0x34')],_0x15ec6c['filters']),_0xfe8e06);if(_0x217340[_0xa103('0x34')][_0xa103('0x3f')]){_0x3d593d[_0xa103('0x3e')]=_[_0xa103('0x40')](_0x3d593d['where'],{'$or':_[_0xa103('0x2e')](_0xfe8e06,function(_0x2c632c){if(_0x2c632c[_0xa103('0x32')]!==_0xa103('0x41')){var _0x43f0f8={};_0x43f0f8[_0x2c632c[_0xa103('0x2b')]]={'$like':'%'+_0x217340[_0xa103('0x34')]['filter']+'%'};return _0x43f0f8;}})});}_0x3d593d=_[_0xa103('0x40')]({},_0x3d593d,_0x217340['options']);var _0x46a958={'where':_0x3d593d[_0xa103('0x3e')]};return db[_0xa103('0x2f')]['count'](_0x46a958)[_0xa103('0x27')](function(_0x1ed8b0){_0x4a14e3['count']=_0x1ed8b0;if(_0x217340[_0xa103('0x34')][_0xa103('0x42')]){_0x3d593d[_0xa103('0x43')]=[{'all':!![]}];}return db[_0xa103('0x2f')][_0xa103('0x44')](_0x3d593d);})['then'](function(_0x68bf2b){_0x4a14e3['rows']=_0x68bf2b;return _0x4a14e3;})['then'](respondWithFilteredResult(_0x145fac,_0x3d593d))[_0xa103('0x45')](handleError(_0x145fac,null));};exports[_0xa103('0x46')]=function(_0x28d41b,_0x42656b){var _0x2743d7={'raw':!![],'where':{'id':_0x28d41b[_0xa103('0x47')]['id']}},_0x4ead54={};_0x4ead54[_0xa103('0x37')]=_[_0xa103('0x35')](db[_0xa103('0x2f')][_0xa103('0x30')]);_0x4ead54[_0xa103('0x34')]=_['keys'](_0x28d41b[_0xa103('0x34')]);_0x4ead54[_0xa103('0x36')]=_[_0xa103('0x48')](_0x4ead54['model'],_0x4ead54[_0xa103('0x34')]);_0x2743d7[_0xa103('0x38')]=_[_0xa103('0x48')](_0x4ead54[_0xa103('0x37')],qs[_0xa103('0x39')](_0x28d41b[_0xa103('0x34')][_0xa103('0x39')]));_0x2743d7[_0xa103('0x38')]=_0x2743d7[_0xa103('0x38')][_0xa103('0x49')]?_0x2743d7[_0xa103('0x38')]:_0x4ead54[_0xa103('0x37')];if(_0x28d41b[_0xa103('0x34')][_0xa103('0x42')]){_0x2743d7[_0xa103('0x43')]=[{'all':!![]}];}_0x2743d7=_[_0xa103('0x40')]({},_0x2743d7,_0x28d41b[_0xa103('0x4a')]);return db[_0xa103('0x2f')][_0xa103('0x4b')](_0x2743d7)[_0xa103('0x27')](handleEntityNotFound(_0x42656b,null))[_0xa103('0x27')](respondWithResult(_0x42656b,null))[_0xa103('0x45')](handleError(_0x42656b,null));};exports['clone']=function(_0x3884dd,_0x2c4cd8){var _0x4de73d={'where':{'id':_0x3884dd['params']['id']}},_0x47cd98={};_0x47cd98['model']=_[_0xa103('0x35')](db['Attachment']['rawAttributes']);_0x4de73d[_0xa103('0x38')]=_[_0xa103('0x48')](_0x47cd98[_0xa103('0x37')],qs['fields'](_0x3884dd['query'][_0xa103('0x39')]));_0x4de73d[_0xa103('0x38')]=_0x4de73d[_0xa103('0x38')][_0xa103('0x49')]?_0x4de73d[_0xa103('0x38')]:_0x47cd98[_0xa103('0x37')];if(_0x3884dd[_0xa103('0x34')]['includeAll']){_0x4de73d[_0xa103('0x43')]=[{'all':!![]}];}_0x4de73d=_[_0xa103('0x40')]({},_0x4de73d,_0x3884dd[_0xa103('0x4a')]);return db[_0xa103('0x2f')][_0xa103('0x4b')](_0x4de73d)[_0xa103('0x27')](handleEntityNotFound(_0x2c4cd8,null))[_0xa103('0x27')](function(_0x5c640b){if(_0x5c640b){var _0x2d275c=_0x5c640b[_0xa103('0x4c')]({'plain':!![]});_0x2d275c=qs[_0xa103('0x4d')](_0x2d275c,['id','createdAt','updatedAt']);_0x3884dd[_0xa103('0x4e')]=_[_0xa103('0x4d')](_0x3884dd[_0xa103('0x4e')],['id','createdAt',_0xa103('0x4f')]);return db[_0xa103('0x2f')][_0xa103('0x50')](_[_0xa103('0x40')](_0x2d275c,_0x3884dd['body']),{'include':_0x3884dd[_0xa103('0x34')][_0xa103('0x42')]?[{'all':!![]}]:undefined});}})[_0xa103('0x27')](respondWithResult(_0x2c4cd8,0xc9))[_0xa103('0x45')](handleError(_0x2c4cd8,null));};exports[_0xa103('0x26')]=function(_0x277c63,_0x43f2f7){if(_0x277c63[_0xa103('0x4e')]['id']){delete _0x277c63[_0xa103('0x4e')]['id'];}return db[_0xa103('0x2f')]['find']({'where':{'id':_0x277c63[_0xa103('0x47')]['id']}})['then'](handleEntityNotFound(_0x43f2f7,null))['then'](saveUpdates(_0x277c63[_0xa103('0x4e')],null))['then'](respondWithResult(_0x43f2f7,null))['catch'](handleError(_0x43f2f7,null));};exports['destroy']=function(_0x40399d,_0x528fa5){return db['Attachment'][_0xa103('0x4b')]({'where':{'id':_0x40399d[_0xa103('0x47')]['id']}})['then'](handleEntityNotFound(_0x528fa5,null))[_0xa103('0x27')](removeEntity(_0x528fa5,null))['catch'](handleError(_0x528fa5,null));};exports[_0xa103('0x50')]=function(_0x2cc086,_0x3d8e61,_0xc6ddc0){_0x2cc086[_0xa103('0x4e')][_0xa103('0x2b')]=_0x2cc086[_0xa103('0x51')][_0xa103('0x52')];_0x2cc086['body']['basename']=_0x2cc086[_0xa103('0x51')][_0xa103('0x53')];_0x2cc086['body']['type']=_0x2cc086[_0xa103('0x51')]['mimetype'];return db[_0xa103('0x2f')][_0xa103('0x50')](_0x2cc086['body'])[_0xa103('0x27')](respondWithResult(_0x3d8e61,0xc9))[_0xa103('0x45')](handleError(_0x3d8e61,null));};exports[_0xa103('0x54')]=function(_0x5cc3e7,_0x2d7151,_0x4fdb71){return db[_0xa103('0x2f')][_0xa103('0x55')]({'where':{'id':_0x5cc3e7[_0xa103('0x47')]['id']},'raw':!![]})[_0xa103('0x27')](handleEntityNotFound(_0x2d7151,null))['then'](function(_0x395485){if(_0x395485){var _0x3e400d=_0x395485['ChatOfflineMessageId']!==null;var _0x3e968a=path[_0xa103('0x56')](config[_0xa103('0x57')],_0xa103('0x58'));if(_0x3e400d){_0x3e968a=path[_0xa103('0x56')](_0x3e968a,_0xa103('0x59'));}var _0x4b0876=path[_0xa103('0x56')](_0x3e968a,_0x395485[_0xa103('0x5a')]);return _0x2d7151[_0xa103('0x54')](_0x4b0876);}})[_0xa103('0x45')](handleError(_0x2d7151,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 6cb50b1..8e082ea 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 _0xdfc7=['attachments','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x334efb,_0x9bb72){var _0x332906=function(_0x4a75b7){while(--_0x4a75b7){_0x334efb['push'](_0x334efb['shift']());}};_0x332906(++_0x9bb72);}(_0xdfc7,0x139));var _0x7dfc=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xdfc7[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x7dfc('0x0'));var util=require(_0x7dfc('0x1'));var logger=require(_0x7dfc('0x2'))(_0x7dfc('0x3'));var moment=require('moment');var BPromise=require(_0x7dfc('0x4'));var rp=require(_0x7dfc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7dfc('0x6'));var config=require(_0x7dfc('0x7'));var attributes=require(_0x7dfc('0x8'));module[_0x7dfc('0x9')]=function(_0x322dcd,_0x1dcc51){return _0x322dcd[_0x7dfc('0xa')](_0x7dfc('0xb'),attributes,{'tableName':_0x7dfc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc155=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','define','attachments'];(function(_0x46cb32,_0x4dcba3){var _0x4281aa=function(_0x4a3ee2){while(--_0x4a3ee2){_0x46cb32['push'](_0x46cb32['shift']());}};_0x4281aa(++_0x4dcba3);}(_0xc155,0x90));var _0x5c15=function(_0x13e0a1,_0x3092d3){_0x13e0a1=_0x13e0a1-0x0;var _0x5d7318=_0xc155[_0x13e0a1];return _0x5d7318;};'use strict';var _=require(_0x5c15('0x0'));var util=require(_0x5c15('0x1'));var logger=require(_0x5c15('0x2'))(_0x5c15('0x3'));var moment=require(_0x5c15('0x4'));var BPromise=require(_0x5c15('0x5'));var rp=require(_0x5c15('0x6'));var fs=require('fs');var path=require(_0x5c15('0x7'));var rimraf=require('rimraf');var config=require(_0x5c15('0x8'));var attributes=require(_0x5c15('0x9'));module['exports']=function(_0x1065e5,_0x2fd23a){return _0x1065e5[_0x5c15('0xa')]('Attachment',attributes,{'tableName':_0x5c15('0xb'),'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 54fa43e..442dd18 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 _0x76dc=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','then','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x76dc,0x1f2));var _0xc76d=function(_0x218d56,_0x35fe59){_0x218d56=_0x218d56-0x0;var _0x3c2fb9=_0x76dc[_0x218d56];return _0x3c2fb9;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var moment=require(_0xc76d('0x2'));var BPromise=require(_0xc76d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76d('0x4'));var db=require(_0xc76d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc76d('0x7'));var client=jayson[_0xc76d('0x8')][_0xc76d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4832bd,_0x4ce0bd,_0x119f38){return new BPromise(function(_0x114572,_0x18574f){return client['request'](_0x4832bd,_0x119f38)['then'](function(_0x1dc996){logger[_0xc76d('0xa')]('Attachment,\x20%s,\x20%s',_0x4ce0bd,_0xc76d('0xb'));logger['debug'](_0xc76d('0xc'),_0x4ce0bd,_0xc76d('0xb'),JSON[_0xc76d('0xd')](_0x1dc996));if(_0x1dc996[_0xc76d('0xe')]){if(_0x1dc996[_0xc76d('0xe')][_0xc76d('0xf')]===0x1f4){logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);return _0x18574f(_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);}logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996['error'][_0xc76d('0x11')]);return _0x114572(_0x1dc996[_0xc76d('0xe')]['message']);}else{logger[_0xc76d('0xa')](_0xc76d('0x10'),_0x4ce0bd,_0xc76d('0xb'));_0x114572(_0x1dc996[_0xc76d('0x12')]['message']);}})[_0xc76d('0x13')](function(_0x5d881c){logger['error'](_0xc76d('0x10'),_0x4ce0bd,_0x5d881c);_0x18574f(_0x5d881c);});});}exports[_0xc76d('0x14')]=function(_0x339623){var _0x23f3ca=this;return new Promise(function(_0xd1d16f,_0x4b0402){return db[_0xc76d('0x15')][_0xc76d('0x16')](_0x339623[_0xc76d('0x17')],{'raw':_0x339623[_0xc76d('0x18')]?_0x339623[_0xc76d('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc76d('0x19')](function(_0x324db7){logger['info'](_0xc76d('0x14'),_0x339623);logger[_0xc76d('0x1a')](_0xc76d('0x14'),_0x339623,JSON[_0xc76d('0xd')](_0x324db7));_0xd1d16f(_0x324db7);})[_0xc76d('0x13')](function(_0x3d357b){logger[_0xc76d('0xe')](_0xc76d('0x14'),_0x3d357b[_0xc76d('0x11')],_0x339623);_0x4b0402(_0x23f3ca[_0xc76d('0xe')](0x1f4,_0x3d357b[_0xc76d('0x11')]));});});}; \ No newline at end of file +var _0xf323=['create','options','raw','debug','CreateAttachment','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Attachment'];(function(_0x203883,_0x5532f4){var _0x83022e=function(_0x5dc021){while(--_0x5dc021){_0x203883['push'](_0x203883['shift']());}};_0x83022e(++_0x5532f4);}(_0xf323,0x1c6));var _0x3f32=function(_0x144dd9,_0x8b4392){_0x144dd9=_0x144dd9-0x0;var _0x4a8e88=_0xf323[_0x144dd9];return _0x4a8e88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f32('0x0'));var BPromise=require(_0x3f32('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f32('0x2'));var db=require(_0x3f32('0x3'))['db'];var utils=require(_0x3f32('0x4'));var logger=require(_0x3f32('0x5'))(_0x3f32('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f32('0x7'));var client=jayson[_0x3f32('0x8')][_0x3f32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1134e9,_0x5c9dc2,_0x567ab1){return new BPromise(function(_0x34b93e,_0x109af2){return client[_0x3f32('0xa')](_0x1134e9,_0x567ab1)[_0x3f32('0xb')](function(_0x22a9d3){logger[_0x3f32('0xc')](_0x3f32('0xd'),_0x5c9dc2,_0x3f32('0xe'));logger['debug'](_0x3f32('0xf'),_0x5c9dc2,_0x3f32('0xe'),JSON[_0x3f32('0x10')](_0x22a9d3));if(_0x22a9d3['error']){if(_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x12')]===0x1f4){logger[_0x3f32('0x11')](_0x3f32('0xd'),_0x5c9dc2,_0x22a9d3['error']['message']);return _0x109af2(_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x13')]);}logger['error'](_0x3f32('0xd'),_0x5c9dc2,_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x13')]);return _0x34b93e(_0x22a9d3['error']['message']);}else{logger[_0x3f32('0xc')](_0x3f32('0xd'),_0x5c9dc2,_0x3f32('0xe'));_0x34b93e(_0x22a9d3[_0x3f32('0x14')]['message']);}})['catch'](function(_0x352010){logger[_0x3f32('0x11')](_0x3f32('0xd'),_0x5c9dc2,_0x352010);_0x109af2(_0x352010);});});}exports['CreateAttachment']=function(_0x5c36d9){var _0x1697c9=this;return new Promise(function(_0x19ec90,_0x8d70ee){return db[_0x3f32('0x15')][_0x3f32('0x16')](_0x5c36d9['body'],{'raw':_0x5c36d9[_0x3f32('0x17')]?_0x5c36d9[_0x3f32('0x17')][_0x3f32('0x18')]===undefined?!![]:![]:!![]})[_0x3f32('0xb')](function(_0xbc366b){logger[_0x3f32('0xc')]('CreateAttachment',_0x5c36d9);logger[_0x3f32('0x19')](_0x3f32('0x1a'),_0x5c36d9,JSON['stringify'](_0xbc366b));_0x19ec90(_0xbc366b);})[_0x3f32('0x1b')](function(_0x21cf2e){logger[_0x3f32('0x11')](_0x3f32('0x1a'),_0x21cf2e['message'],_0x5c36d9);_0x8d70ee(_0x1697c9[_0x3f32('0x11')](0x1f4,_0x21cf2e[_0x3f32('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 738df36..5cfe904 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x36304e,_0x3c8421){var _0x5ccc13=function(_0x23009f){while(--_0x23009f){_0x36304e['push'](_0x36304e['shift']());}};_0x5ccc13(++_0x3c8421);}(_0xb10b,0x12a));var _0xbb10=function(_0x45fb76,_0x35fd5d){_0x45fb76=_0x45fb76-0x0;var _0x338556=_0xb10b[_0x45fb76];return _0x338556;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x0b0e[_0x351509];return _0x4e9861;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 6352159..6a3cf8d 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 _0x4e42=['blockDuration','then','User','find','emails','value','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../components/auth/service','signToken','login','authenticate','google','profile','email','callback','/login','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts'];(function(_0x21910c,_0x5ce5bf){var _0x20f557=function(_0x4764f2){while(--_0x4764f2){_0x21910c['push'](_0x21910c['shift']());}};_0x20f557(++_0x5ce5bf);}(_0x4e42,0x19b));var _0x24e4=function(_0x205f0f,_0x35c4bd){_0x205f0f=_0x205f0f-0x0;var _0x4c9ae8=_0x4e42[_0x205f0f];return _0x4c9ae8;};'use strict';var _=require(_0x24e4('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x24e4('0x1'))[_0x24e4('0x2')];var moment=require(_0x24e4('0x3'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x24e4('0x4'))[_0x24e4('0x5')];var utils=require('../../config/utils');exports[_0x24e4('0x6')]=passport[_0x24e4('0x7')](_0x24e4('0x8'),{'failureRedirect':'/login','scope':[_0x24e4('0x9'),_0x24e4('0xa')],'session':![]});exports[_0x24e4('0xb')]=passport[_0x24e4('0x7')](_0x24e4('0x8'),{'failureRedirect':_0x24e4('0xc'),'session':![]});passport[_0x24e4('0xd')](new GoogleStrategy({'clientID':config[_0x24e4('0x8')]?config['google'][_0x24e4('0xe')]:'id','clientSecret':config[_0x24e4('0x8')]?config['google'][_0x24e4('0xf')]:_0x24e4('0x10'),'callbackURL':config[_0x24e4('0x8')]?config[_0x24e4('0x8')][_0x24e4('0x11')]:''},function(_0x2e4100,_0x20973b,_0x3df712,_0x2a2c5d){var _0x35864c,_0x1452a2;return db[_0x24e4('0x12')][_0x24e4('0x13')]({'where':{'id':0x1},'attributes':[_0x24e4('0x14'),_0x24e4('0x15')],'raw':!![]})[_0x24e4('0x16')](function(_0x24be76){_0x35864c=_0x24be76;return db[_0x24e4('0x17')][_0x24e4('0x18')]({'where':{'email':_['map'](_0x3df712[_0x24e4('0x19')],_0x24e4('0x1a')),'role':{'$or':[_0x24e4('0x1b'),_0x24e4('0x1c'),'agent']}}});})[_0x24e4('0x16')](function(_0x454491){_0x1452a2=_0x454491;if(_0x1452a2){if(_0x1452a2[_0x24e4('0x1d')]){return _0x2a2c5d(_0x24e4('0x1e'));}else if(_0x35864c['blockDuration']>0x0){if(_0x1452a2[_0x24e4('0x1f')]){if(moment(_0x1452a2['blockedAt'])['add'](_0x35864c[_0x24e4('0x15')],_0x24e4('0x20'))>moment()){return _0x2a2c5d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x24e4('0x21')](_0x1452a2,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1452a2);})['then'](function(){return _0x2a2c5d(null,_0x1452a2);});}}else{return utils[_0x24e4('0x22')](_0x1452a2)['then'](function(){return _0x2a2c5d(null,_0x1452a2);});}}else{return utils[_0x24e4('0x22')](_0x1452a2)['then'](function(){return _0x2a2c5d(null,_0x1452a2);});}}return _0x2a2c5d(_0x24e4('0x1e'));})[_0x24e4('0x23')](function(_0x5b2b31){_0x2a2c5d(_0x5b2b31);});})); \ No newline at end of file +var _0xe45f=['google','profile','email','authenticate','/login','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','User','find','map','emails','value','admin','agent','then','disabled','blockedAt','add','minutes','clearBlockUser','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login'];(function(_0x4533ec,_0x2e7187){var _0x43ead4=function(_0x1b8f87){while(--_0x1b8f87){_0x4533ec['push'](_0x4533ec['shift']());}};_0x43ead4(++_0x2e7187);}(_0xe45f,0x6d));var _0xfe45=function(_0x128d23,_0x3e6b7d){_0x128d23=_0x128d23-0x0;var _0x395633=_0xe45f[_0x128d23];return _0x395633;};'use strict';var _=require(_0xfe45('0x0'));var passport=require(_0xfe45('0x1'));var GoogleStrategy=require(_0xfe45('0x2'))[_0xfe45('0x3')];var moment=require(_0xfe45('0x4'));var db=require(_0xfe45('0x5'))['db'];var config=require(_0xfe45('0x6'));var signToken=require(_0xfe45('0x7'))[_0xfe45('0x8')];var utils=require(_0xfe45('0x9'));exports[_0xfe45('0xa')]=passport['authenticate'](_0xfe45('0xb'),{'failureRedirect':'/login','scope':[_0xfe45('0xc'),_0xfe45('0xd')],'session':![]});exports['callback']=passport[_0xfe45('0xe')](_0xfe45('0xb'),{'failureRedirect':_0xfe45('0xf'),'session':![]});passport[_0xfe45('0x10')](new GoogleStrategy({'clientID':config[_0xfe45('0xb')]?config[_0xfe45('0xb')][_0xfe45('0x11')]:'id','clientSecret':config[_0xfe45('0xb')]?config['google'][_0xfe45('0x12')]:'secret','callbackURL':config[_0xfe45('0xb')]?config[_0xfe45('0xb')][_0xfe45('0x13')]:''},function(_0x5294cb,_0x4db001,_0x18b693,_0xe62d08){var _0x29925d,_0x3e021e;return db[_0xfe45('0x14')][_0xfe45('0x15')]({'where':{'id':0x1},'attributes':[_0xfe45('0x16'),_0xfe45('0x17')],'raw':!![]})['then'](function(_0x6dd9e2){_0x29925d=_0x6dd9e2;return db[_0xfe45('0x18')][_0xfe45('0x19')]({'where':{'email':_[_0xfe45('0x1a')](_0x18b693[_0xfe45('0x1b')],_0xfe45('0x1c')),'role':{'$or':[_0xfe45('0x1d'),'user',_0xfe45('0x1e')]}}});})[_0xfe45('0x1f')](function(_0x657165){_0x3e021e=_0x657165;if(_0x3e021e){if(_0x3e021e[_0xfe45('0x20')]){return _0xe62d08('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x29925d[_0xfe45('0x17')]>0x0){if(_0x3e021e['blocked']){if(moment(_0x3e021e[_0xfe45('0x21')])[_0xfe45('0x22')](_0x29925d[_0xfe45('0x17')],_0xfe45('0x23'))>moment()){return _0xe62d08('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xfe45('0x24')](_0x3e021e,0x0,![],null)[_0xfe45('0x1f')](function(){return utils[_0xfe45('0x25')](_0x3e021e);})[_0xfe45('0x1f')](function(){return _0xe62d08(null,_0x3e021e);});}}else{return utils[_0xfe45('0x25')](_0x3e021e)[_0xfe45('0x1f')](function(){return _0xe62d08(null,_0x3e021e);});}}else{return utils[_0xfe45('0x25')](_0x3e021e)[_0xfe45('0x1f')](function(){return _0xe62d08(null,_0x3e021e);});}}return _0xe62d08(_0xfe45('0x26'));})[_0xfe45('0x27')](function(_0x16f48d){_0xe62d08(_0x16f48d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 3321fe1..1838225 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 _0x41ff=['setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','isMiddleware','login'];(function(_0x3beda6,_0x92126e){var _0x4c4c94=function(_0x35974d){while(--_0x35974d){_0x3beda6['push'](_0x3beda6['shift']());}};_0x4c4c94(++_0x92126e);}(_0x41ff,0x1e1));var _0xf41f=function(_0x3b0460,_0x2ef36e){_0x3b0460=_0x3b0460-0x0;var _0x332ef0=_0x41ff[_0x3b0460];return _0x332ef0;};'use strict';var express=require(_0xf41f('0x0'));var passport=require(_0xf41f('0x1'));var router=express[_0xf41f('0x2')]();var controller=require(_0xf41f('0x3'));var userController=require(_0xf41f('0x4'));var authService=require('../../components/auth/service');router[_0xf41f('0x5')]('/',controller['login']);router[_0xf41f('0x5')](_0xf41f('0x6'),controller['callback'],authService[_0xf41f('0x7')],userController[_0xf41f('0x8')],authService[_0xf41f('0x9')]);module['exports']=router; \ No newline at end of file +var _0x42a2=['./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie','express','Router'];(function(_0x20e81e,_0x2ad41f){var _0x3e6654=function(_0x3f2904){while(--_0x3f2904){_0x20e81e['push'](_0x20e81e['shift']());}};_0x3e6654(++_0x2ad41f);}(_0x42a2,0xf8));var _0x242a=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x42a2[_0x47fd36];return _0x21a0fc;};'use strict';var express=require(_0x242a('0x0'));var passport=require('passport');var router=express[_0x242a('0x1')]();var controller=require(_0x242a('0x2'));var userController=require(_0x242a('0x3'));var authService=require('../../components/auth/service');router[_0x242a('0x4')]('/',controller[_0x242a('0x5')]);router[_0x242a('0x4')](_0x242a('0x6'),controller[_0x242a('0x7')],authService[_0x242a('0x8')],userController[_0x242a('0x5')],authService[_0x242a('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 8b4fcd3..854f7c4 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 _0x670b=['Smtp','service','host','port','secure','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','email','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','Reset\x20Email\x20sent!','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','resetPasswordToken','save','Password\x20reset!','use','util','passport','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','client','http','findOne','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x670b,0x130));var _0xb670=function(_0x5e137b,_0x44f719){_0x5e137b=_0x5e137b-0x0;var _0x4c1752=_0x670b[_0x5e137b];return _0x4c1752;};'use strict';var util=require(_0xb670('0x0'));var passport=require(_0xb670('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xb670('0x2'));var _=require('lodash');var rs=require(_0xb670('0x3'));var moment=require('moment');var db=require(_0xb670('0x4'))['db'];var authService=require(_0xb670('0x5'));var utils=require('../../config/utils');var client=jayson[_0xb670('0x6')][_0xb670('0x7')]({'port':0x232b});function localAuthenticate(_0x4ef086,_0x3e8dd5,_0x31f0b2,_0x391690){var _0x2b68f6,_0x5aa138;return db['Setting'][_0xb670('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xb670('0x9')](function(_0x5002fb){_0x2b68f6=_0x5002fb;return _0x4ef086[_0xb670('0x8')]({'attributes':['id',_0xb670('0xa'),_0xb670('0xb'),_0xb670('0xc'),_0xb670('0xd'),_0xb670('0xe'),_0xb670('0xf'),_0xb670('0x10'),_0xb670('0x11')],'where':{'name':_0x3e8dd5,'role':{'$or':['admin',_0xb670('0x12'),_0xb670('0x13')]}}});})['then'](function(_0x5ad3f6){if(!_0x5ad3f6||_0x5ad3f6&&_0x5ad3f6['name']!==_0x3e8dd5){throw new Error(_0xb670('0x14'));}else{_0x5aa138=_0x5ad3f6;return _0x5aa138;}})[_0xb670('0x9')](function(){_0x5aa138[_0xb670('0x15')](_0x31f0b2,function(_0x24cf61,_0x185fa7){var _0x2123e1=_0x5aa138[_0xb670('0x11')]+0x1;if(_0x24cf61){return _0x391690(_0x24cf61);}else if(!_0x185fa7){if(_0x5aa138[_0xb670('0xe')]){return _0x391690(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2b68f6[_0xb670('0x16')]>0x0){if(_0x5aa138[_0xb670('0xf')]){if(_0x2b68f6[_0xb670('0x17')]>0x0){if(moment(_0x5aa138[_0xb670('0x10')])[_0xb670('0x18')](_0x2b68f6[_0xb670('0x17')],_0xb670('0x19'))>moment()){return _0x391690(null,![],{'message':_0xb670('0x14')});}else{return utils[_0xb670('0x1a')](_0x5aa138,_0x2123e1,![],null)['then'](function(){return _0x391690(null,![],{'message':_0xb670('0x14')});});}}else{return _0x391690(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2123e1>=_0x2b68f6['allowedLoginAttempts']){return utils[_0xb670('0x1a')](_0x5aa138,0x0,!![],moment())[_0xb670('0x9')](function(){return _0x391690(null,![],{'message':_0xb670('0x14')});});}else{return utils[_0xb670('0x1a')](_0x5aa138,_0x2123e1,![],null)[_0xb670('0x9')](function(){return _0x391690(null,![],{'message':_0xb670('0x14')});});}}}else{return _0x391690(null,![],{'message':_0xb670('0x14')});}}else{if(_0x5aa138[_0xb670('0xe')]){return _0x391690(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2b68f6[_0xb670('0x16')]>0x0){if(_0x5aa138['blocked']){if(_0x2b68f6[_0xb670('0x17')]>0x0){if(moment(_0x5aa138['blockedAt'])[_0xb670('0x18')](_0x2b68f6[_0xb670('0x17')],_0xb670('0x19'))>moment()){return _0x391690(null,![],{'message':_0xb670('0x14')});}else{return utils[_0xb670('0x1a')](_0x5aa138,0x0,![],null)['then'](function(){return utils[_0xb670('0x1b')](_0x5aa138);})[_0xb670('0x9')](function(){return _0x391690(null,_0x5aa138);});}}else{return _0x391690(null,![],{'message':_0xb670('0x14')});}}else{return utils['clearBlockUser'](_0x5aa138,0x0,![],null)['then'](function(){return utils[_0xb670('0x1b')](_0x5aa138);})[_0xb670('0x9')](function(){return _0x391690(null,_0x5aa138);})[_0xb670('0x1c')](function(_0x9234c0){return _0x391690(null,![],_0x9234c0);});}}else{if(_0x5aa138[_0xb670('0xf')]){return _0x391690(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xb670('0x1b')](_0x5aa138)[_0xb670('0x9')](function(){return _0x391690(null,_0x5aa138);});}}}});})[_0xb670('0x1c')](function(_0x1e3f82){return _0x391690(null,![],_0x1e3f82);});}function sendServiceMail(_0x9ff4a9){return db[_0xb670('0x1d')][_0xb670('0x1e')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xb670('0x9')](function(_0x4b6c6d){if(!_0x4b6c6d){throw new Error(_0xb670('0x1f'));}var _0x516b88={'tls':{'rejectUnauthorized':![]}};if(_0x4b6c6d[_0xb670('0x20')][_0xb670('0x21')]){_0x516b88[_0xb670('0x21')]=_0x4b6c6d[_0xb670('0x20')][_0xb670('0x21')];}else{_0x516b88[_0xb670('0x22')]=_0x4b6c6d[_0xb670('0x20')][_0xb670('0x22')];_0x516b88[_0xb670('0x23')]=_0x4b6c6d[_0xb670('0x20')][_0xb670('0x23')];_0x516b88['secure']=_0x4b6c6d[_0xb670('0x20')][_0xb670('0x24')];}if(_0x4b6c6d[_0xb670('0x20')]['authentication']){_0x516b88['auth']={'user':_0x4b6c6d[_0xb670('0x20')][_0xb670('0x12')],'pass':_0x4b6c6d[_0xb670('0x20')][_0xb670('0x25')]};}var _0x5401a1={'account':_0x516b88,'message':_[_0xb670('0x26')]({'from':util['format'](_0xb670('0x27'),_0x4b6c6d[_0xb670('0xa')],_0x4b6c6d['email']||_0x4b6c6d[_0xb670('0x20')][_0xb670('0x12')])},_0x9ff4a9)};return client[_0xb670('0x28')](_0xb670('0x29'),_0x5401a1);})[_0xb670('0x9')](function(_0x4af0da){if(_0x4af0da[_0xb670('0x2a')]){throw new Error(util[_0xb670('0x2b')](_0xb670('0x2c'),_0x4af0da[_0xb670('0x2a')][_0xb670('0x2d')]||JSON[_0xb670('0x2e')](_0x4af0da[_0xb670('0x2a')])));}return!![];});}function handleError(_0x86a12b,_0x53eb62,_0x550a57){return _0x86a12b['status'](_0x53eb62||0x1f4)[_0xb670('0x2f')]({'message':_0x550a57?_0x550a57['message']||_0x550a57:''});}exports[_0xb670('0x30')]=function(_0x5dc6dc,_0x296720,_0x530188){passport[_0xb670('0x15')](_0xb670('0x31'),function(_0x43de7e,_0x47a8b5,_0x30b93a){var _0x319aab=_0x43de7e||_0x30b93a;if(_0x319aab){return handleError(_0x296720,0x191,_0x319aab);}if(!_0x47a8b5){return handleError(_0x296720,0x194,{'message':_0xb670('0x32')});}else{var _0x365a0f={'payload':{'id':_0x47a8b5['id'],'role':_0x47a8b5['role']},'options':{'expiresIn':0x15180}};return authService[_0xb670('0x33')](_0x365a0f)[_0xb670('0x9')](function(_0x46c000){_0x296720[_0xb670('0x34')]({'id':_0x47a8b5['id'],'token':_0x46c000,'statusCall':'','isAlreadyLogged':_0x47a8b5[_0xb670('0x35')]});});}})(_0x5dc6dc,_0x296720,_0x530188);};exports['forgot']=function(_0x14c511,_0x163abd,_0xb6e81d){if(!_0x14c511['body'][_0xb670('0x36')]){return handleError(_0x163abd,0x1f4,{'message':_0xb670('0x37')});}var _0x395e65=rs[_0xb670('0x38')]();_0x14c511[_0xb670('0x39')][_0xb670('0x36')]=_0x14c511['body'][_0xb670('0x36')][_0xb670('0x3a')]()[_0xb670('0x3b')]();var _0x23b985;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xb670('0x16'),'blockDuration'],'raw':!![]})['then'](function(_0x4887b6){_0x23b985=_0x4887b6;return db['User'][_0xb670('0x1e')]({'where':{'email':_0x14c511[_0xb670('0x39')][_0xb670('0x36')]}});})[_0xb670('0x9')](function(_0x206a1d){if(!_0x206a1d){throw new Error(_0xb670('0x3c'));}if(_0x206a1d['disabled']){throw new Error(_0xb670('0x3d'));}if(_0x206a1d[_0xb670('0xf')]){if(moment(_0x206a1d[_0xb670('0x10')])[_0xb670('0x18')](_0x23b985[_0xb670('0x17')],_0xb670('0x19'))>moment()){throw new Error(_0xb670('0x3e'));}else{_0x206a1d[_0xb670('0xf')]=![];_0x206a1d[_0xb670('0x10')]=null;}}_0x206a1d['resetPasswordToken']=_0x395e65;_0x206a1d[_0xb670('0x3f')]=Date[_0xb670('0x40')]()+0x36ee80;return _0x206a1d['save']();})[_0xb670('0x9')](function(){return sendServiceMail({'to':_0x14c511['body'][_0xb670('0x36')],'subject':_0xb670('0x41'),'text':_0xb670('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x14c511[_0xb670('0x43')][_0xb670('0x22')]+_0xb670('0x44')+_0x395e65+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xb670('0x9')](function(){_0x163abd['status'](0xc8)[_0xb670('0x2f')]({'message':_0xb670('0x45')});})[_0xb670('0x1c')](function(_0x1c8c69){return handleError(_0x163abd,0x1f4,_0x1c8c69);});};exports[_0xb670('0x46')]=function(_0x5ccd59,_0x20bc5a,_0x18d3cf){return db[_0xb670('0x47')]['find']({'where':{'resetPasswordToken':_0x5ccd59['params'][_0xb670('0x48')],'resetPasswordExpires':{'$gt':Date[_0xb670('0x40')]()}}})[_0xb670('0x9')](function(_0x2d86d6){if(!_0x2d86d6){throw new Error(_0xb670('0x49'));}return db[_0xb670('0x4a')][_0xb670('0x8')]({'attributes':['id',_0xb670('0x4b'),_0xb670('0x4c'),_0xb670('0x4d')]})[_0xb670('0x9')](function(_0x3f125f){if(_0x3f125f[_0xb670('0x4b')])authService[_0xb670('0x4e')](_0x5ccd59[_0xb670('0x39')][_0xb670('0xb')]);if(!_0x3f125f[_0xb670('0x4c')]||!_0x2d86d6['previousPasswords'])return _0x2d86d6;authService['validatePasswordHistory'](_0x5ccd59['body'][_0xb670('0xb')],_0x2d86d6[_0xb670('0x4f')],_0x3f125f['passwordHistoryLimit']);return _0x2d86d6;})[_0xb670('0x9')](function(){_0x2d86d6['password']=_0x5ccd59[_0xb670('0x39')][_0xb670('0xb')];_0x2d86d6[_0xb670('0x50')]=null;_0x2d86d6[_0xb670('0x3f')]=null;return _0x2d86d6[_0xb670('0x51')]();});})['then'](function(){_0x20bc5a['status'](0xc8)[_0xb670('0x2f')]({'message':_0xb670('0x52')});})[_0xb670('0x1c')](function(_0x1f517d){return handleError(_0x20bc5a,0x1f4,_0x1f517d);});};passport[_0xb670('0x53')](new LocalStrategy({'usernameField':_0xb670('0xa'),'passwordField':_0xb670('0xb')},function(_0x410743,_0x213b8e,_0x25caf6){return localAuthenticate(db[_0xb670('0x47')],_0x410743,_0x213b8e,_0x25caf6);})); \ No newline at end of file +var _0x7c21=['token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','util','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','then','name','salt','role','disabled','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockDuration','blockedAt','minutes','clearBlockUser','add','getLicense','catch','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','auth','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','message','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','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','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params'];(function(_0x366f2a,_0x116363){var _0x6e347d=function(_0x2293e3){while(--_0x2293e3){_0x366f2a['push'](_0x366f2a['shift']());}};_0x6e347d(++_0x116363);}(_0x7c21,0x1e2));var _0x17c2=function(_0x996bff,_0x389fc9){_0x996bff=_0x996bff-0x0;var _0x442fda=_0x7c21[_0x996bff];return _0x442fda;};'use strict';var util=require(_0x17c2('0x0'));var passport=require(_0x17c2('0x1'));var LocalStrategy=require(_0x17c2('0x2'))['Strategy'];var jayson=require(_0x17c2('0x3'));var _=require(_0x17c2('0x4'));var rs=require('randomstring');var moment=require(_0x17c2('0x5'));var db=require(_0x17c2('0x6'))['db'];var authService=require(_0x17c2('0x7'));var utils=require(_0x17c2('0x8'));var client=jayson['client'][_0x17c2('0x9')]({'port':0x232b});function localAuthenticate(_0x4b7196,_0x5b1d18,_0x30a8bc,_0xc0d8c8){var _0x3c354d,_0x43e027;return db[_0x17c2('0xa')][_0x17c2('0xb')]({'where':{'id':0x1},'attributes':[_0x17c2('0xc'),'blockDuration'],'raw':!![]})[_0x17c2('0xd')](function(_0x483f6f){_0x3c354d=_0x483f6f;return _0x4b7196['findOne']({'attributes':['id',_0x17c2('0xe'),'password',_0x17c2('0xf'),_0x17c2('0x10'),_0x17c2('0x11'),'blocked','blockedAt',_0x17c2('0x12')],'where':{'name':_0x5b1d18,'role':{'$or':['admin',_0x17c2('0x13'),_0x17c2('0x14')]}}});})[_0x17c2('0xd')](function(_0xd9e07a){if(!_0xd9e07a||_0xd9e07a&&_0xd9e07a['name']!==_0x5b1d18){throw new Error(_0x17c2('0x15'));}else{_0x43e027=_0xd9e07a;return _0x43e027;}})[_0x17c2('0xd')](function(){_0x43e027[_0x17c2('0x16')](_0x30a8bc,function(_0x246ede,_0x3ebf19){var _0x5a6d4f=_0x43e027[_0x17c2('0x12')]+0x1;if(_0x246ede){return _0xc0d8c8(_0x246ede);}else if(!_0x3ebf19){if(_0x43e027[_0x17c2('0x11')]){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}else if(_0x3c354d[_0x17c2('0xc')]>0x0){if(_0x43e027[_0x17c2('0x17')]){if(_0x3c354d[_0x17c2('0x18')]>0x0){if(moment(_0x43e027[_0x17c2('0x19')])['add'](_0x3c354d[_0x17c2('0x18')],_0x17c2('0x1a'))>moment()){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}else{return utils[_0x17c2('0x1b')](_0x43e027,_0x5a6d4f,![],null)[_0x17c2('0xd')](function(){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});});}}else{return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}}else{if(_0x5a6d4f>=_0x3c354d[_0x17c2('0xc')]){return utils[_0x17c2('0x1b')](_0x43e027,0x0,!![],moment())[_0x17c2('0xd')](function(){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});});}else{return utils[_0x17c2('0x1b')](_0x43e027,_0x5a6d4f,![],null)[_0x17c2('0xd')](function(){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});});}}}else{return _0xc0d8c8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x43e027['disabled']){return _0xc0d8c8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3c354d[_0x17c2('0xc')]>0x0){if(_0x43e027[_0x17c2('0x17')]){if(_0x3c354d[_0x17c2('0x18')]>0x0){if(moment(_0x43e027[_0x17c2('0x19')])[_0x17c2('0x1c')](_0x3c354d[_0x17c2('0x18')],_0x17c2('0x1a'))>moment()){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}else{return utils[_0x17c2('0x1b')](_0x43e027,0x0,![],null)[_0x17c2('0xd')](function(){return utils[_0x17c2('0x1d')](_0x43e027);})[_0x17c2('0xd')](function(){return _0xc0d8c8(null,_0x43e027);});}}else{return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}}else{return utils[_0x17c2('0x1b')](_0x43e027,0x0,![],null)[_0x17c2('0xd')](function(){return utils['getLicense'](_0x43e027);})[_0x17c2('0xd')](function(){return _0xc0d8c8(null,_0x43e027);})[_0x17c2('0x1e')](function(_0x53b831){return _0xc0d8c8(null,![],_0x53b831);});}}else{if(_0x43e027[_0x17c2('0x17')]){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}else{return utils[_0x17c2('0x1d')](_0x43e027)[_0x17c2('0xd')](function(){return _0xc0d8c8(null,_0x43e027);});}}}});})[_0x17c2('0x1e')](function(_0x50232f){return _0xc0d8c8(null,![],_0x50232f);});}function sendServiceMail(_0x45a3b0){return db['MailAccount'][_0x17c2('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x17c2('0xe'),_0x17c2('0x20')],'include':[{'model':db[_0x17c2('0x21')],'as':_0x17c2('0x22')}]})['then'](function(_0x1b69f2){if(!_0x1b69f2){throw new Error(_0x17c2('0x23'));}var _0x191103={'tls':{'rejectUnauthorized':![]}};if(_0x1b69f2['Smtp'][_0x17c2('0x24')]){_0x191103[_0x17c2('0x24')]=_0x1b69f2[_0x17c2('0x22')][_0x17c2('0x24')];}else{_0x191103['host']=_0x1b69f2[_0x17c2('0x22')][_0x17c2('0x25')];_0x191103['port']=_0x1b69f2[_0x17c2('0x22')]['port'];_0x191103[_0x17c2('0x26')]=_0x1b69f2[_0x17c2('0x22')][_0x17c2('0x26')];}if(_0x1b69f2['Smtp']['authentication']){_0x191103[_0x17c2('0x27')]={'user':_0x1b69f2[_0x17c2('0x22')][_0x17c2('0x13')],'pass':_0x1b69f2[_0x17c2('0x22')]['pass']};}var _0x2da177={'account':_0x191103,'message':_[_0x17c2('0x28')]({'from':util['format'](_0x17c2('0x29'),_0x1b69f2['name'],_0x1b69f2['email']||_0x1b69f2[_0x17c2('0x22')]['user'])},_0x45a3b0)};return client[_0x17c2('0x2a')](_0x17c2('0x2b'),_0x2da177);})['then'](function(_0x3a8579){if(_0x3a8579[_0x17c2('0x2c')]){throw new Error(util[_0x17c2('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3a8579[_0x17c2('0x2c')][_0x17c2('0x2e')]||JSON['stringify'](_0x3a8579[_0x17c2('0x2c')])));}return!![];});}function handleError(_0x510549,_0x5eb2f4,_0x48b98a){return _0x510549['status'](_0x5eb2f4||0x1f4)[_0x17c2('0x2f')]({'message':_0x48b98a?_0x48b98a[_0x17c2('0x2e')]||_0x48b98a:''});}exports[_0x17c2('0x30')]=function(_0x5a4335,_0x1658ec,_0x48e793){passport[_0x17c2('0x16')](_0x17c2('0x31'),function(_0x2b5a70,_0xd1c3f3,_0x2579ff){var _0x45511c=_0x2b5a70||_0x2579ff;if(_0x45511c){return handleError(_0x1658ec,0x191,_0x45511c);}if(!_0xd1c3f3){return handleError(_0x1658ec,0x194,{'message':_0x17c2('0x32')});}else{var _0x4f3e3b={'payload':{'id':_0xd1c3f3['id'],'role':_0xd1c3f3['role']},'options':{'expiresIn':0x15180}};return authService[_0x17c2('0x33')](_0x4f3e3b)[_0x17c2('0xd')](function(_0x3ae4ee){_0x1658ec[_0x17c2('0x34')]({'id':_0xd1c3f3['id'],'token':_0x3ae4ee,'statusCall':'','isAlreadyLogged':_0xd1c3f3['online']});});}})(_0x5a4335,_0x1658ec,_0x48e793);};exports['forgot']=function(_0x536810,_0x177589,_0x1927ab){if(!_0x536810[_0x17c2('0x35')][_0x17c2('0x20')]){return handleError(_0x177589,0x1f4,{'message':_0x17c2('0x36')});}var _0x2ec791=rs['generate']();_0x536810['body'][_0x17c2('0x20')]=_0x536810['body']['email'][_0x17c2('0x37')]()[_0x17c2('0x38')]();var _0x52b551;return db[_0x17c2('0xa')][_0x17c2('0xb')]({'where':{'id':0x1},'attributes':[_0x17c2('0xc'),'blockDuration'],'raw':!![]})[_0x17c2('0xd')](function(_0x43de45){_0x52b551=_0x43de45;return db[_0x17c2('0x39')]['find']({'where':{'email':_0x536810['body'][_0x17c2('0x20')]}});})[_0x17c2('0xd')](function(_0x541a64){if(!_0x541a64){throw new Error(_0x17c2('0x3a'));}if(_0x541a64[_0x17c2('0x11')]){throw new Error(_0x17c2('0x3b'));}if(_0x541a64[_0x17c2('0x17')]){if(moment(_0x541a64[_0x17c2('0x19')])[_0x17c2('0x1c')](_0x52b551[_0x17c2('0x18')],_0x17c2('0x1a'))>moment()){throw new Error(_0x17c2('0x3c'));}else{_0x541a64[_0x17c2('0x17')]=![];_0x541a64[_0x17c2('0x19')]=null;}}_0x541a64[_0x17c2('0x3d')]=_0x2ec791;_0x541a64[_0x17c2('0x3e')]=Date['now']()+0x36ee80;return _0x541a64['save']();})[_0x17c2('0xd')](function(){return sendServiceMail({'to':_0x536810[_0x17c2('0x35')]['email'],'subject':_0x17c2('0x3f'),'text':_0x17c2('0x40')+_0x17c2('0x41')+_0x17c2('0x42')+_0x536810[_0x17c2('0x43')][_0x17c2('0x25')]+'/reset/'+_0x2ec791+'\x0a\x0a'+_0x17c2('0x44')});})['then'](function(){_0x177589[_0x17c2('0x45')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x17c2('0x1e')](function(_0x20a83c){return handleError(_0x177589,0x1f4,_0x20a83c);});};exports['reset']=function(_0x455524,_0x4c58f2,_0x562b93){return db[_0x17c2('0x39')][_0x17c2('0x1f')]({'where':{'resetPasswordToken':_0x455524[_0x17c2('0x46')][_0x17c2('0x47')],'resetPasswordExpires':{'$gt':Date[_0x17c2('0x48')]()}}})[_0x17c2('0xd')](function(_0x1ca76d){if(!_0x1ca76d){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x17c2('0xa')]['findOne']({'attributes':['id',_0x17c2('0x49'),_0x17c2('0x4a'),_0x17c2('0x4b')]})[_0x17c2('0xd')](function(_0x36b101){if(_0x36b101['securePassword'])authService[_0x17c2('0x4c')](_0x455524['body'][_0x17c2('0x4d')]);if(!_0x36b101['enforcePasswordHistory']||!_0x1ca76d[_0x17c2('0x4e')])return _0x1ca76d;authService['validatePasswordHistory'](_0x455524[_0x17c2('0x35')]['password'],_0x1ca76d['previousPasswords'],_0x36b101['passwordHistoryLimit']);return _0x1ca76d;})[_0x17c2('0xd')](function(){_0x1ca76d['password']=_0x455524[_0x17c2('0x35')][_0x17c2('0x4d')];_0x1ca76d['resetPasswordToken']=null;_0x1ca76d[_0x17c2('0x3e')]=null;return _0x1ca76d['save']();});})['then'](function(){_0x4c58f2[_0x17c2('0x45')](0xc8)[_0x17c2('0x2f')]({'message':'Password\x20reset!'});})[_0x17c2('0x1e')](function(_0x2bbeb3){return handleError(_0x4c58f2,0x1f4,_0x2bbeb3);});};passport['use'](new LocalStrategy({'usernameField':_0x17c2('0xe'),'passwordField':_0x17c2('0x4d')},function(_0x58946e,_0x195453,_0x5f2b50){return localAuthenticate(db[_0x17c2('0x39')],_0x58946e,_0x195453,_0x5f2b50);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 20bdedf..9b6fdc0 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 _0x65b0=['exports','express','Router','./authLocal.controller','post','/reset/:token','reset'];(function(_0x341dab,_0xbbd1c2){var _0x2c662f=function(_0x12f26a){while(--_0x12f26a){_0x341dab['push'](_0x341dab['shift']());}};_0x2c662f(++_0xbbd1c2);}(_0x65b0,0xfd));var _0x065b=function(_0x466b91,_0x53f1f2){_0x466b91=_0x466b91-0x0;var _0x544940=_0x65b0[_0x466b91];return _0x544940;};'use strict';var express=require(_0x065b('0x0'));var router=express[_0x065b('0x1')]();var controller=require(_0x065b('0x2'));router[_0x065b('0x3')]('/',controller['login']);router[_0x065b('0x3')]('/forgot',controller['forgot']);router[_0x065b('0x3')](_0x065b('0x4'),controller[_0x065b('0x5')]);module[_0x065b('0x6')]=router; \ No newline at end of file +var _0x6302=['post','/forgot','forgot','reset','exports','express','Router','./authLocal.controller','login'];(function(_0x1fe113,_0x5ed48a){var _0x36b894=function(_0x344737){while(--_0x344737){_0x1fe113['push'](_0x1fe113['shift']());}};_0x36b894(++_0x5ed48a);}(_0x6302,0x1b5));var _0x2630=function(_0x3b5f61,_0x37a454){_0x3b5f61=_0x3b5f61-0x0;var _0x5f0f20=_0x6302[_0x3b5f61];return _0x5f0f20;};'use strict';var express=require(_0x2630('0x0'));var router=express[_0x2630('0x1')]();var controller=require(_0x2630('0x2'));router['post']('/',controller[_0x2630('0x3')]);router[_0x2630('0x4')](_0x2630('0x5'),controller[_0x2630('0x6')]);router[_0x2630('0x4')]('/reset/:token',controller[_0x2630('0x7')]);module[_0x2630('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 0c82e71..0f6fb96 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 _0x8cbe=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8cbe,0x1d8));var _0xe8cb=function(_0x47f1a0,_0x3abd2c){_0x47f1a0=_0x47f1a0-0x0;var _0x279909=_0x8cbe[_0x47f1a0];return _0x279909;};'use strict';var Sequelize=require('sequelize');module[_0xe8cb('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe8cb('0x1')]},'status':{'type':Sequelize[_0xe8cb('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe8cb('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xb45c=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x5aecb9,_0x431f00){var _0x2bac52=function(_0x44076f){while(--_0x44076f){_0x5aecb9['push'](_0x5aecb9['shift']());}};_0x2bac52(++_0x431f00);}(_0xb45c,0xa7));var _0xcb45=function(_0x4ba347,_0x3eea2f){_0x4ba347=_0x4ba347-0x0;var _0x1022f2=_0xb45c[_0x4ba347];return _0x1022f2;};'use strict';var Sequelize=require(_0xcb45('0x0'));module[_0xcb45('0x1')]={'name':{'type':Sequelize[_0xcb45('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xcb45('0x2')]},'description':{'type':Sequelize[_0xcb45('0x2')]},'status':{'type':Sequelize[_0xcb45('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcb45('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 28c4f3b..e0e45f4 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 _0xfbb8=['limit','count','set','Content-Range','json','apply','reject','save','update','sendStatus','error','stack','name','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','params','find','create','body','addConditions','Condition','omit','getConditions','findOne','pick','addActions','Action','ids','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined'];(function(_0x41273e,_0x1a8d3f){var _0x340241=function(_0x4fc648){while(--_0x4fc648){_0x41273e['push'](_0x41273e['shift']());}};_0x340241(++_0x1a8d3f);}(_0xfbb8,0x1cd));var _0x8fbb=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0xfbb8[_0x3b16e1];return _0x311d1b;};'use strict';var emlformat=require(_0x8fbb('0x0'));var rimraf=require(_0x8fbb('0x1'));var zipdir=require(_0x8fbb('0x2'));var jsonpatch=require(_0x8fbb('0x3'));var rp=require(_0x8fbb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8fbb('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8fbb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fbb('0x7'));var _=require(_0x8fbb('0x8'));var squel=require(_0x8fbb('0x9'));var crypto=require('crypto');var jsforce=require(_0x8fbb('0xa'));var deskjs=require(_0x8fbb('0xb'));var toCsv=require(_0x8fbb('0x6'));var querystring=require(_0x8fbb('0xc'));var Papa=require(_0x8fbb('0xd'));var Redis=require(_0x8fbb('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8fbb('0xf'));var logger=require(_0x8fbb('0x10'))(_0x8fbb('0x11'));var utils=require(_0x8fbb('0x12'));var config=require(_0x8fbb('0x13'));var licenseUtil=require(_0x8fbb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1240bf,_0x1a16b0){_0x1a16b0=_0x1a16b0||0xcc;return function(_0x20eabb){if(_0x20eabb){return _0x1240bf['sendStatus'](_0x1a16b0);}return _0x1240bf[_0x8fbb('0x15')](_0x1a16b0)[_0x8fbb('0x16')]();};}function respondWithResult(_0x5f5c6a,_0x3fec9e){_0x3fec9e=_0x3fec9e||0xc8;return function(_0x3b7c1f){if(_0x3b7c1f){return _0x5f5c6a['status'](_0x3fec9e)['json'](_0x3b7c1f);}};}function respondWithFilteredResult(_0x527e87,_0x17487b){return function(_0x35be0e){if(_0x35be0e){var _0x4e5bc8=typeof _0x17487b[_0x8fbb('0x17')]===_0x8fbb('0x18')&&typeof _0x17487b[_0x8fbb('0x19')]===_0x8fbb('0x18');var _0x2bb971=_0x35be0e[_0x8fbb('0x1a')];var _0x15e047=_0x4e5bc8?0x0:_0x17487b[_0x8fbb('0x17')];var _0x4d94db=_0x4e5bc8?_0x35be0e[_0x8fbb('0x1a')]:_0x17487b[_0x8fbb('0x17')]+_0x17487b[_0x8fbb('0x19')];var _0x50f87f;if(_0x4d94db>=_0x2bb971){_0x4d94db=_0x2bb971;_0x50f87f=0xc8;}else{_0x50f87f=0xce;}_0x527e87[_0x8fbb('0x15')](_0x50f87f);return _0x527e87[_0x8fbb('0x1b')](_0x8fbb('0x1c'),_0x15e047+'-'+_0x4d94db+'/'+_0x2bb971)[_0x8fbb('0x1d')](_0x35be0e);}return null;};}function patchUpdates(_0x6e908e){return function(_0x23c1cf){try{jsonpatch[_0x8fbb('0x1e')](_0x23c1cf,_0x6e908e,!![]);}catch(_0xbdaa7f){return BPromise[_0x8fbb('0x1f')](_0xbdaa7f);}return _0x23c1cf[_0x8fbb('0x20')]();};}function saveUpdates(_0x9fc45d,_0x2c3910){return function(_0x440100){if(_0x440100){return _0x440100[_0x8fbb('0x21')](_0x9fc45d)['then'](function(_0x2822d1){return _0x2822d1;});}return null;};}function removeEntity(_0x492e6a,_0x33fc6e){return function(_0x279a14){if(_0x279a14){return _0x279a14['destroy']()['then'](function(){_0x492e6a[_0x8fbb('0x15')](0xcc)[_0x8fbb('0x16')]();});}};}function handleEntityNotFound(_0x3c0491,_0x23e0f3){return function(_0x166caf){if(!_0x166caf){_0x3c0491[_0x8fbb('0x22')](0x194);}return _0x166caf;};}function handleError(_0x1a3256,_0x27fb7d){_0x27fb7d=_0x27fb7d||0x1f4;return function(_0x17a290){logger[_0x8fbb('0x23')](_0x17a290[_0x8fbb('0x24')]);if(_0x17a290[_0x8fbb('0x25')]){delete _0x17a290[_0x8fbb('0x25')];}_0x1a3256[_0x8fbb('0x15')](_0x27fb7d)['send'](_0x17a290);};}exports['index']=function(_0x25f560,_0x3c3a4b){var _0x424957={},_0xd1a9c0={},_0x2da7bf={'count':0x0,'rows':[]};var _0x483d53=_['map'](db[_0x8fbb('0x26')][_0x8fbb('0x27')],function(_0x3792b0){return{'name':_0x3792b0[_0x8fbb('0x28')],'type':_0x3792b0[_0x8fbb('0x29')][_0x8fbb('0x2a')]};});_0xd1a9c0['model']=_[_0x8fbb('0x2b')](_0x483d53,_0x8fbb('0x25'));_0xd1a9c0[_0x8fbb('0x2c')]=_[_0x8fbb('0x2d')](_0x25f560[_0x8fbb('0x2c')]);_0xd1a9c0[_0x8fbb('0x2e')]=_[_0x8fbb('0x2f')](_0xd1a9c0[_0x8fbb('0x30')],_0xd1a9c0[_0x8fbb('0x2c')]);_0x424957[_0x8fbb('0x31')]=_[_0x8fbb('0x2f')](_0xd1a9c0[_0x8fbb('0x30')],qs[_0x8fbb('0x32')](_0x25f560[_0x8fbb('0x2c')][_0x8fbb('0x32')]));_0x424957[_0x8fbb('0x31')]=_0x424957[_0x8fbb('0x31')][_0x8fbb('0x33')]?_0x424957['attributes']:_0xd1a9c0[_0x8fbb('0x30')];if(!_0x25f560['query']['hasOwnProperty'](_0x8fbb('0x34'))){_0x424957[_0x8fbb('0x19')]=qs[_0x8fbb('0x19')](_0x25f560[_0x8fbb('0x2c')]['limit']);_0x424957['offset']=qs[_0x8fbb('0x17')](_0x25f560[_0x8fbb('0x2c')]['offset']);}_0x424957[_0x8fbb('0x35')]=qs[_0x8fbb('0x36')](_0x25f560[_0x8fbb('0x2c')][_0x8fbb('0x36')]);_0x424957[_0x8fbb('0x37')]=qs[_0x8fbb('0x2e')](_['pick'](_0x25f560[_0x8fbb('0x2c')],_0xd1a9c0[_0x8fbb('0x2e')]),_0x483d53);if(_0x25f560[_0x8fbb('0x2c')]['filter']){_0x424957[_0x8fbb('0x37')]=_[_0x8fbb('0x38')](_0x424957[_0x8fbb('0x37')],{'$or':_[_0x8fbb('0x2b')](_0x483d53,function(_0x1dbca3){if(_0x1dbca3[_0x8fbb('0x29')]!==_0x8fbb('0x39')){var _0x16761e={};_0x16761e[_0x1dbca3[_0x8fbb('0x25')]]={'$like':'%'+_0x25f560[_0x8fbb('0x2c')][_0x8fbb('0x3a')]+'%'};return _0x16761e;}})});}_0x424957=_[_0x8fbb('0x38')]({},_0x424957,_0x25f560[_0x8fbb('0x3b')]);var _0x9e5c8a={'where':_0x424957['where']};return db[_0x8fbb('0x26')][_0x8fbb('0x1a')](_0x9e5c8a)[_0x8fbb('0x3c')](function(_0x5db76f){_0x2da7bf[_0x8fbb('0x1a')]=_0x5db76f;if(_0x25f560[_0x8fbb('0x2c')][_0x8fbb('0x3d')]){_0x424957[_0x8fbb('0x3e')]=[{'all':!![]}];}return db[_0x8fbb('0x26')][_0x8fbb('0x3f')](_0x424957);})[_0x8fbb('0x3c')](function(_0x32f15c){_0x2da7bf[_0x8fbb('0x40')]=_0x32f15c;return _0x2da7bf;})[_0x8fbb('0x3c')](respondWithFilteredResult(_0x3c3a4b,_0x424957))[_0x8fbb('0x41')](handleError(_0x3c3a4b,null));};exports['show']=function(_0x294d92,_0x30959a){var _0x1e674e={'raw':![],'where':{'id':_0x294d92[_0x8fbb('0x42')]['id']}},_0x3f7bcd={};_0x3f7bcd['model']=_[_0x8fbb('0x2d')](db['Automation']['rawAttributes']);_0x3f7bcd['query']=_[_0x8fbb('0x2d')](_0x294d92['query']);_0x3f7bcd[_0x8fbb('0x2e')]=_[_0x8fbb('0x2f')](_0x3f7bcd['model'],_0x3f7bcd['query']);_0x1e674e[_0x8fbb('0x31')]=_[_0x8fbb('0x2f')](_0x3f7bcd[_0x8fbb('0x30')],qs[_0x8fbb('0x32')](_0x294d92[_0x8fbb('0x2c')][_0x8fbb('0x32')]));_0x1e674e[_0x8fbb('0x31')]=_0x1e674e['attributes'][_0x8fbb('0x33')]?_0x1e674e[_0x8fbb('0x31')]:_0x3f7bcd[_0x8fbb('0x30')];if(_0x294d92[_0x8fbb('0x2c')][_0x8fbb('0x3d')]){_0x1e674e[_0x8fbb('0x3e')]=[{'all':!![]}];}_0x1e674e=_[_0x8fbb('0x38')]({},_0x1e674e,_0x294d92['options']);return db[_0x8fbb('0x26')][_0x8fbb('0x43')](_0x1e674e)[_0x8fbb('0x3c')](handleEntityNotFound(_0x30959a,null))[_0x8fbb('0x3c')](respondWithResult(_0x30959a,null))['catch'](handleError(_0x30959a,null));};exports[_0x8fbb('0x44')]=function(_0x6586ce,_0x43f5f9){return db[_0x8fbb('0x26')]['create'](_0x6586ce[_0x8fbb('0x45')],{})['then'](respondWithResult(_0x43f5f9,0xc9))[_0x8fbb('0x41')](handleError(_0x43f5f9,null));};exports['update']=function(_0xbdb6f,_0x18c0c9){if(_0xbdb6f[_0x8fbb('0x45')]['id']){delete _0xbdb6f[_0x8fbb('0x45')]['id'];}return db['Automation'][_0x8fbb('0x43')]({'where':{'id':_0xbdb6f[_0x8fbb('0x42')]['id']}})['then'](handleEntityNotFound(_0x18c0c9,null))[_0x8fbb('0x3c')](saveUpdates(_0xbdb6f['body'],null))[_0x8fbb('0x3c')](respondWithResult(_0x18c0c9,null))[_0x8fbb('0x41')](handleError(_0x18c0c9,null));};exports['destroy']=function(_0x2cbc82,_0x18e6f0){return db[_0x8fbb('0x26')][_0x8fbb('0x43')]({'where':{'id':_0x2cbc82[_0x8fbb('0x42')]['id']}})[_0x8fbb('0x3c')](handleEntityNotFound(_0x18e6f0,null))[_0x8fbb('0x3c')](removeEntity(_0x18e6f0,null))[_0x8fbb('0x41')](handleError(_0x18e6f0,null));};exports[_0x8fbb('0x46')]=function(_0x51bf33,_0x5ce2c8,_0x542610){return db[_0x8fbb('0x47')][_0x8fbb('0x43')]({'where':{'id':_0x51bf33[_0x8fbb('0x42')]['id']}})[_0x8fbb('0x3c')](handleEntityNotFound(_0x5ce2c8,null))[_0x8fbb('0x3c')](function(_0x825d8c){if(_0x825d8c){return _0x825d8c[_0x8fbb('0x46')](_0x51bf33[_0x8fbb('0x45')]['ids'],_[_0x8fbb('0x48')](_0x51bf33['body'],['ids','id'])||{});}})[_0x8fbb('0x3c')](respondWithResult(_0x5ce2c8,null))[_0x8fbb('0x41')](handleError(_0x5ce2c8,null));};exports[_0x8fbb('0x49')]=function(_0xe9c109,_0x38c154,_0x3cbc8b){var _0x57bced={};var _0x48cd7d={};var _0x2d4b68;var _0x3e993;return db[_0x8fbb('0x26')][_0x8fbb('0x4a')]({'where':{'id':_0xe9c109['params']['id']}})[_0x8fbb('0x3c')](handleEntityNotFound(_0x38c154,null))['then'](function(_0x19703d){if(_0x19703d){_0x2d4b68=_0x19703d;_0x48cd7d[_0x8fbb('0x30')]=_[_0x8fbb('0x2d')](db['Condition'][_0x8fbb('0x27')]);_0x48cd7d[_0x8fbb('0x2c')]=_[_0x8fbb('0x2d')](_0xe9c109['query']);_0x48cd7d['filters']=_[_0x8fbb('0x2f')](_0x48cd7d[_0x8fbb('0x30')],_0x48cd7d[_0x8fbb('0x2c')]);_0x57bced[_0x8fbb('0x31')]=_[_0x8fbb('0x2f')](_0x48cd7d[_0x8fbb('0x30')],qs[_0x8fbb('0x32')](_0xe9c109[_0x8fbb('0x2c')][_0x8fbb('0x32')]));_0x57bced['attributes']=_0x57bced['attributes'][_0x8fbb('0x33')]?_0x57bced[_0x8fbb('0x31')]:_0x48cd7d[_0x8fbb('0x30')];_0x57bced['order']=qs[_0x8fbb('0x36')](_0xe9c109['query'][_0x8fbb('0x36')]);_0x57bced[_0x8fbb('0x37')]=qs[_0x8fbb('0x2e')](_[_0x8fbb('0x4b')](_0xe9c109[_0x8fbb('0x2c')],_0x48cd7d[_0x8fbb('0x2e')]));if(_0xe9c109[_0x8fbb('0x2c')][_0x8fbb('0x3a')]){_0x57bced[_0x8fbb('0x37')]=_['merge'](_0x57bced[_0x8fbb('0x37')],{'$or':_[_0x8fbb('0x2b')](_0x57bced[_0x8fbb('0x31')],function(_0xdc512){var _0x1a0526={};_0x1a0526[_0xdc512]={'$like':'%'+_0xe9c109[_0x8fbb('0x2c')]['filter']+'%'};return _0x1a0526;})});}_0x57bced=_[_0x8fbb('0x38')]({},_0x57bced,_0xe9c109[_0x8fbb('0x3b')]);return _0x2d4b68['getConditions'](_0x57bced);}})[_0x8fbb('0x3c')](function(_0x2a83e3){if(_0x2a83e3){_0x3e993=_0x2a83e3[_0x8fbb('0x33')];if(!_0xe9c109['query']['hasOwnProperty']('nolimit')){_0x57bced['limit']=qs['limit'](_0xe9c109['query'][_0x8fbb('0x19')]);_0x57bced[_0x8fbb('0x17')]=qs[_0x8fbb('0x17')](_0xe9c109['query'][_0x8fbb('0x17')]);}return _0x2d4b68[_0x8fbb('0x49')](_0x57bced);}})[_0x8fbb('0x3c')](function(_0x350f23){if(_0x350f23){return _0x350f23?{'count':_0x3e993,'rows':_0x350f23}:null;}})[_0x8fbb('0x3c')](respondWithResult(_0x38c154,null))[_0x8fbb('0x41')](handleError(_0x38c154,null));};exports[_0x8fbb('0x4c')]=function(_0x56476a,_0xb5c001,_0x49c10c){return db[_0x8fbb('0x4d')][_0x8fbb('0x43')]({'where':{'id':_0x56476a[_0x8fbb('0x42')]['id']}})[_0x8fbb('0x3c')](handleEntityNotFound(_0xb5c001,null))[_0x8fbb('0x3c')](function(_0x3c844e){if(_0x3c844e){return _0x3c844e[_0x8fbb('0x4c')](_0x56476a[_0x8fbb('0x45')][_0x8fbb('0x4e')],_[_0x8fbb('0x48')](_0x56476a[_0x8fbb('0x45')],[_0x8fbb('0x4e'),'id'])||{});}})['then'](respondWithResult(_0xb5c001,null))[_0x8fbb('0x41')](handleError(_0xb5c001,null));};exports[_0x8fbb('0x4f')]=function(_0xdbe388,_0x29e44a,_0x1711b4){var _0x531544={};var _0x59e0e5={};var _0x187511;var _0x147e1d;return db[_0x8fbb('0x26')]['findOne']({'where':{'id':_0xdbe388[_0x8fbb('0x42')]['id']}})[_0x8fbb('0x3c')](handleEntityNotFound(_0x29e44a,null))[_0x8fbb('0x3c')](function(_0x9be659){if(_0x9be659){_0x187511=_0x9be659;_0x59e0e5[_0x8fbb('0x30')]=_[_0x8fbb('0x2d')](db[_0x8fbb('0x4d')][_0x8fbb('0x27')]);_0x59e0e5['query']=_[_0x8fbb('0x2d')](_0xdbe388['query']);_0x59e0e5[_0x8fbb('0x2e')]=_[_0x8fbb('0x2f')](_0x59e0e5[_0x8fbb('0x30')],_0x59e0e5['query']);_0x531544[_0x8fbb('0x31')]=_[_0x8fbb('0x2f')](_0x59e0e5['model'],qs[_0x8fbb('0x32')](_0xdbe388[_0x8fbb('0x2c')][_0x8fbb('0x32')]));_0x531544[_0x8fbb('0x31')]=_0x531544[_0x8fbb('0x31')][_0x8fbb('0x33')]?_0x531544[_0x8fbb('0x31')]:_0x59e0e5[_0x8fbb('0x30')];_0x531544[_0x8fbb('0x35')]=qs[_0x8fbb('0x36')](_0xdbe388[_0x8fbb('0x2c')][_0x8fbb('0x36')]);_0x531544['where']=qs[_0x8fbb('0x2e')](_['pick'](_0xdbe388[_0x8fbb('0x2c')],_0x59e0e5[_0x8fbb('0x2e')]));if(_0xdbe388['query'][_0x8fbb('0x3a')]){_0x531544[_0x8fbb('0x37')]=_[_0x8fbb('0x38')](_0x531544[_0x8fbb('0x37')],{'$or':_[_0x8fbb('0x2b')](_0x531544['attributes'],function(_0x564a96){var _0x5827a4={};_0x5827a4[_0x564a96]={'$like':'%'+_0xdbe388[_0x8fbb('0x2c')][_0x8fbb('0x3a')]+'%'};return _0x5827a4;})});}_0x531544=_['merge']({},_0x531544,_0xdbe388['options']);return _0x187511['getActions'](_0x531544);}})[_0x8fbb('0x3c')](function(_0x478da9){if(_0x478da9){_0x147e1d=_0x478da9[_0x8fbb('0x33')];if(!_0xdbe388[_0x8fbb('0x2c')][_0x8fbb('0x50')](_0x8fbb('0x34'))){_0x531544[_0x8fbb('0x19')]=qs[_0x8fbb('0x19')](_0xdbe388[_0x8fbb('0x2c')][_0x8fbb('0x19')]);_0x531544[_0x8fbb('0x17')]=qs[_0x8fbb('0x17')](_0xdbe388[_0x8fbb('0x2c')][_0x8fbb('0x17')]);}return _0x187511['getActions'](_0x531544);}})[_0x8fbb('0x3c')](function(_0x4062ed){if(_0x4062ed){return _0x4062ed?{'count':_0x147e1d,'rows':_0x4062ed}:null;}})[_0x8fbb('0x3c')](respondWithResult(_0x29e44a,null))[_0x8fbb('0x41')](handleError(_0x29e44a,null));}; \ No newline at end of file +var _0xce85=['querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','end','error','stack','name','send','map','Automation','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','keys','includeAll','options','find','body','catch','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','order','getActions','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','jsforce','desk.js','to-csv'];(function(_0x3a1953,_0x440442){var _0x51c757=function(_0x7846eb){while(--_0x7846eb){_0x3a1953['push'](_0x3a1953['shift']());}};_0x51c757(++_0x440442);}(_0xce85,0x1c3));var _0x5ce8=function(_0x32cbf0,_0x47b073){_0x32cbf0=_0x32cbf0-0x0;var _0x332b2e=_0xce85[_0x32cbf0];return _0x332b2e;};'use strict';var emlformat=require(_0x5ce8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5ce8('0x1'));var rp=require(_0x5ce8('0x2'));var moment=require(_0x5ce8('0x3'));var BPromise=require(_0x5ce8('0x4'));var Mustache=require(_0x5ce8('0x5'));var util=require(_0x5ce8('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ce8('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5ce8('0x8'));var deskjs=require(_0x5ce8('0x9'));var toCsv=require(_0x5ce8('0xa'));var querystring=require(_0x5ce8('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ce8('0xc'));var as=require(_0x5ce8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ce8('0xe'))(_0x5ce8('0xf'));var utils=require(_0x5ce8('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5ce8('0x11'))['db'];function respondWithStatusCode(_0x97537e,_0x127125){_0x127125=_0x127125||0xcc;return function(_0x125e0b){if(_0x125e0b){return _0x97537e[_0x5ce8('0x12')](_0x127125);}return _0x97537e[_0x5ce8('0x13')](_0x127125)['end']();};}function respondWithResult(_0x428187,_0x1dc733){_0x1dc733=_0x1dc733||0xc8;return function(_0x454a27){if(_0x454a27){return _0x428187[_0x5ce8('0x13')](_0x1dc733)[_0x5ce8('0x14')](_0x454a27);}};}function respondWithFilteredResult(_0x1fe1f0,_0x16c250){return function(_0x1bcf35){if(_0x1bcf35){var _0x28c626=typeof _0x16c250[_0x5ce8('0x15')]===_0x5ce8('0x16')&&typeof _0x16c250[_0x5ce8('0x17')]===_0x5ce8('0x16');var _0x5f2c82=_0x1bcf35[_0x5ce8('0x18')];var _0xbeff59=_0x28c626?0x0:_0x16c250[_0x5ce8('0x15')];var _0x57f81f=_0x28c626?_0x1bcf35[_0x5ce8('0x18')]:_0x16c250[_0x5ce8('0x15')]+_0x16c250['limit'];var _0x13d24b;if(_0x57f81f>=_0x5f2c82){_0x57f81f=_0x5f2c82;_0x13d24b=0xc8;}else{_0x13d24b=0xce;}_0x1fe1f0[_0x5ce8('0x13')](_0x13d24b);return _0x1fe1f0[_0x5ce8('0x19')]('Content-Range',_0xbeff59+'-'+_0x57f81f+'/'+_0x5f2c82)[_0x5ce8('0x14')](_0x1bcf35);}return null;};}function patchUpdates(_0x236bce){return function(_0x35311d){try{jsonpatch[_0x5ce8('0x1a')](_0x35311d,_0x236bce,!![]);}catch(_0x3ea589){return BPromise['reject'](_0x3ea589);}return _0x35311d['save']();};}function saveUpdates(_0x7f5be2,_0x38be8f){return function(_0x1bfa4e){if(_0x1bfa4e){return _0x1bfa4e[_0x5ce8('0x1b')](_0x7f5be2)[_0x5ce8('0x1c')](function(_0x233e06){return _0x233e06;});}return null;};}function removeEntity(_0xbe6061,_0x43f009){return function(_0x16c2d9){if(_0x16c2d9){return _0x16c2d9[_0x5ce8('0x1d')]()[_0x5ce8('0x1c')](function(){_0xbe6061['status'](0xcc)[_0x5ce8('0x1e')]();});}};}function handleEntityNotFound(_0x2b12fb,_0x282dba){return function(_0x5d66ed){if(!_0x5d66ed){_0x2b12fb['sendStatus'](0x194);}return _0x5d66ed;};}function handleError(_0x5e3912,_0x128e13){_0x128e13=_0x128e13||0x1f4;return function(_0x138aec){logger[_0x5ce8('0x1f')](_0x138aec[_0x5ce8('0x20')]);if(_0x138aec[_0x5ce8('0x21')]){delete _0x138aec['name'];}_0x5e3912[_0x5ce8('0x13')](_0x128e13)[_0x5ce8('0x22')](_0x138aec);};}exports['index']=function(_0x5272e8,_0x1cfef2){var _0x3a5e01={},_0x5b2546={},_0x5a30de={'count':0x0,'rows':[]};var _0x2e8595=_[_0x5ce8('0x23')](db[_0x5ce8('0x24')]['rawAttributes'],function(_0x220adf){return{'name':_0x220adf[_0x5ce8('0x25')],'type':_0x220adf[_0x5ce8('0x26')][_0x5ce8('0x27')]};});_0x5b2546[_0x5ce8('0x28')]=_[_0x5ce8('0x23')](_0x2e8595,'name');_0x5b2546[_0x5ce8('0x29')]=_['keys'](_0x5272e8['query']);_0x5b2546['filters']=_[_0x5ce8('0x2a')](_0x5b2546[_0x5ce8('0x28')],_0x5b2546[_0x5ce8('0x29')]);_0x3a5e01[_0x5ce8('0x2b')]=_['intersection'](_0x5b2546['model'],qs['fields'](_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x2c')]));_0x3a5e01[_0x5ce8('0x2b')]=_0x3a5e01[_0x5ce8('0x2b')][_0x5ce8('0x2d')]?_0x3a5e01[_0x5ce8('0x2b')]:_0x5b2546[_0x5ce8('0x28')];if(!_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x2e')]('nolimit')){_0x3a5e01[_0x5ce8('0x17')]=qs[_0x5ce8('0x17')](_0x5272e8['query'][_0x5ce8('0x17')]);_0x3a5e01[_0x5ce8('0x15')]=qs['offset'](_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x15')]);}_0x3a5e01['order']=qs[_0x5ce8('0x2f')](_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x2f')]);_0x3a5e01['where']=qs[_0x5ce8('0x30')](_[_0x5ce8('0x31')](_0x5272e8[_0x5ce8('0x29')],_0x5b2546['filters']),_0x2e8595);if(_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x32')]){_0x3a5e01[_0x5ce8('0x33')]=_[_0x5ce8('0x34')](_0x3a5e01['where'],{'$or':_[_0x5ce8('0x23')](_0x2e8595,function(_0x1359c0){if(_0x1359c0[_0x5ce8('0x26')]!==_0x5ce8('0x35')){var _0x141f85={};_0x141f85[_0x1359c0[_0x5ce8('0x21')]]={'$like':'%'+_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x32')]+'%'};return _0x141f85;}})});}_0x3a5e01=_[_0x5ce8('0x34')]({},_0x3a5e01,_0x5272e8['options']);var _0x5a67b3={'where':_0x3a5e01[_0x5ce8('0x33')]};return db[_0x5ce8('0x24')]['count'](_0x5a67b3)[_0x5ce8('0x1c')](function(_0x1d1a09){_0x5a30de['count']=_0x1d1a09;if(_0x5272e8[_0x5ce8('0x29')]['includeAll']){_0x3a5e01[_0x5ce8('0x36')]=[{'all':!![]}];}return db[_0x5ce8('0x24')][_0x5ce8('0x37')](_0x3a5e01);})[_0x5ce8('0x1c')](function(_0x2e0661){_0x5a30de[_0x5ce8('0x38')]=_0x2e0661;return _0x5a30de;})[_0x5ce8('0x1c')](respondWithFilteredResult(_0x1cfef2,_0x3a5e01))['catch'](handleError(_0x1cfef2,null));};exports[_0x5ce8('0x39')]=function(_0x40ddda,_0x53e785){var _0x21540c={'raw':![],'where':{'id':_0x40ddda[_0x5ce8('0x3a')]['id']}},_0x39ee64={};_0x39ee64[_0x5ce8('0x28')]=_['keys'](db[_0x5ce8('0x24')][_0x5ce8('0x3b')]);_0x39ee64[_0x5ce8('0x29')]=_[_0x5ce8('0x3c')](_0x40ddda[_0x5ce8('0x29')]);_0x39ee64['filters']=_[_0x5ce8('0x2a')](_0x39ee64[_0x5ce8('0x28')],_0x39ee64[_0x5ce8('0x29')]);_0x21540c['attributes']=_[_0x5ce8('0x2a')](_0x39ee64[_0x5ce8('0x28')],qs[_0x5ce8('0x2c')](_0x40ddda['query'][_0x5ce8('0x2c')]));_0x21540c['attributes']=_0x21540c[_0x5ce8('0x2b')][_0x5ce8('0x2d')]?_0x21540c[_0x5ce8('0x2b')]:_0x39ee64['model'];if(_0x40ddda[_0x5ce8('0x29')][_0x5ce8('0x3d')]){_0x21540c['include']=[{'all':!![]}];}_0x21540c=_[_0x5ce8('0x34')]({},_0x21540c,_0x40ddda[_0x5ce8('0x3e')]);return db[_0x5ce8('0x24')][_0x5ce8('0x3f')](_0x21540c)[_0x5ce8('0x1c')](handleEntityNotFound(_0x53e785,null))[_0x5ce8('0x1c')](respondWithResult(_0x53e785,null))['catch'](handleError(_0x53e785,null));};exports['create']=function(_0x301df7,_0x5f37c3){return db[_0x5ce8('0x24')]['create'](_0x301df7[_0x5ce8('0x40')],{})[_0x5ce8('0x1c')](respondWithResult(_0x5f37c3,0xc9))[_0x5ce8('0x41')](handleError(_0x5f37c3,null));};exports['update']=function(_0x134ea4,_0x2af7f1){if(_0x134ea4[_0x5ce8('0x40')]['id']){delete _0x134ea4['body']['id'];}return db[_0x5ce8('0x24')][_0x5ce8('0x3f')]({'where':{'id':_0x134ea4[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x2af7f1,null))['then'](saveUpdates(_0x134ea4['body'],null))[_0x5ce8('0x1c')](respondWithResult(_0x2af7f1,null))[_0x5ce8('0x41')](handleError(_0x2af7f1,null));};exports[_0x5ce8('0x1d')]=function(_0x18e3c5,_0x1d4f19){return db[_0x5ce8('0x24')][_0x5ce8('0x3f')]({'where':{'id':_0x18e3c5['params']['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x1d4f19,null))[_0x5ce8('0x1c')](removeEntity(_0x1d4f19,null))[_0x5ce8('0x41')](handleError(_0x1d4f19,null));};exports[_0x5ce8('0x42')]=function(_0x4a6066,_0x396d3f,_0x430132){return db[_0x5ce8('0x43')][_0x5ce8('0x3f')]({'where':{'id':_0x4a6066[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x396d3f,null))[_0x5ce8('0x1c')](function(_0x3e74b1){if(_0x3e74b1){return _0x3e74b1['addConditions'](_0x4a6066['body'][_0x5ce8('0x44')],_[_0x5ce8('0x45')](_0x4a6066[_0x5ce8('0x40')],[_0x5ce8('0x44'),'id'])||{});}})[_0x5ce8('0x1c')](respondWithResult(_0x396d3f,null))[_0x5ce8('0x41')](handleError(_0x396d3f,null));};exports[_0x5ce8('0x46')]=function(_0x5d5394,_0x2e0bc5,_0x3cfa61){var _0x4ef8be={};var _0x4d04de={};var _0x400e41;var _0x4a65e8;return db[_0x5ce8('0x24')][_0x5ce8('0x47')]({'where':{'id':_0x5d5394[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x2e0bc5,null))[_0x5ce8('0x1c')](function(_0x476ce2){if(_0x476ce2){_0x400e41=_0x476ce2;_0x4d04de[_0x5ce8('0x28')]=_[_0x5ce8('0x3c')](db[_0x5ce8('0x43')][_0x5ce8('0x3b')]);_0x4d04de['query']=_[_0x5ce8('0x3c')](_0x5d5394['query']);_0x4d04de[_0x5ce8('0x30')]=_['intersection'](_0x4d04de[_0x5ce8('0x28')],_0x4d04de['query']);_0x4ef8be[_0x5ce8('0x2b')]=_['intersection'](_0x4d04de['model'],qs[_0x5ce8('0x2c')](_0x5d5394[_0x5ce8('0x29')]['fields']));_0x4ef8be[_0x5ce8('0x2b')]=_0x4ef8be[_0x5ce8('0x2b')][_0x5ce8('0x2d')]?_0x4ef8be[_0x5ce8('0x2b')]:_0x4d04de[_0x5ce8('0x28')];_0x4ef8be['order']=qs[_0x5ce8('0x2f')](_0x5d5394['query'][_0x5ce8('0x2f')]);_0x4ef8be['where']=qs['filters'](_[_0x5ce8('0x31')](_0x5d5394[_0x5ce8('0x29')],_0x4d04de[_0x5ce8('0x30')]));if(_0x5d5394['query'][_0x5ce8('0x32')]){_0x4ef8be['where']=_[_0x5ce8('0x34')](_0x4ef8be[_0x5ce8('0x33')],{'$or':_['map'](_0x4ef8be[_0x5ce8('0x2b')],function(_0x1b017c){var _0x544ef8={};_0x544ef8[_0x1b017c]={'$like':'%'+_0x5d5394[_0x5ce8('0x29')][_0x5ce8('0x32')]+'%'};return _0x544ef8;})});}_0x4ef8be=_['merge']({},_0x4ef8be,_0x5d5394[_0x5ce8('0x3e')]);return _0x400e41[_0x5ce8('0x46')](_0x4ef8be);}})[_0x5ce8('0x1c')](function(_0x4a23e0){if(_0x4a23e0){_0x4a65e8=_0x4a23e0[_0x5ce8('0x2d')];if(!_0x5d5394['query'][_0x5ce8('0x2e')]('nolimit')){_0x4ef8be[_0x5ce8('0x17')]=qs[_0x5ce8('0x17')](_0x5d5394[_0x5ce8('0x29')][_0x5ce8('0x17')]);_0x4ef8be[_0x5ce8('0x15')]=qs[_0x5ce8('0x15')](_0x5d5394['query']['offset']);}return _0x400e41[_0x5ce8('0x46')](_0x4ef8be);}})[_0x5ce8('0x1c')](function(_0x132963){if(_0x132963){return _0x132963?{'count':_0x4a65e8,'rows':_0x132963}:null;}})[_0x5ce8('0x1c')](respondWithResult(_0x2e0bc5,null))[_0x5ce8('0x41')](handleError(_0x2e0bc5,null));};exports[_0x5ce8('0x48')]=function(_0xf308b2,_0x205e33,_0x4af42b){return db[_0x5ce8('0x49')][_0x5ce8('0x3f')]({'where':{'id':_0xf308b2[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x205e33,null))[_0x5ce8('0x1c')](function(_0x46d1a5){if(_0x46d1a5){return _0x46d1a5['addActions'](_0xf308b2['body']['ids'],_['omit'](_0xf308b2[_0x5ce8('0x40')],['ids','id'])||{});}})['then'](respondWithResult(_0x205e33,null))[_0x5ce8('0x41')](handleError(_0x205e33,null));};exports['getActions']=function(_0x3e9567,_0x4088c4,_0x5bca39){var _0x391da2={};var _0x2390b9={};var _0x3e0970;var _0x27b430;return db[_0x5ce8('0x24')][_0x5ce8('0x47')]({'where':{'id':_0x3e9567[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x4088c4,null))['then'](function(_0x17ae09){if(_0x17ae09){_0x3e0970=_0x17ae09;_0x2390b9[_0x5ce8('0x28')]=_[_0x5ce8('0x3c')](db[_0x5ce8('0x49')][_0x5ce8('0x3b')]);_0x2390b9[_0x5ce8('0x29')]=_[_0x5ce8('0x3c')](_0x3e9567[_0x5ce8('0x29')]);_0x2390b9['filters']=_['intersection'](_0x2390b9[_0x5ce8('0x28')],_0x2390b9[_0x5ce8('0x29')]);_0x391da2[_0x5ce8('0x2b')]=_[_0x5ce8('0x2a')](_0x2390b9[_0x5ce8('0x28')],qs[_0x5ce8('0x2c')](_0x3e9567[_0x5ce8('0x29')][_0x5ce8('0x2c')]));_0x391da2['attributes']=_0x391da2['attributes'][_0x5ce8('0x2d')]?_0x391da2[_0x5ce8('0x2b')]:_0x2390b9[_0x5ce8('0x28')];_0x391da2[_0x5ce8('0x4a')]=qs['sort'](_0x3e9567[_0x5ce8('0x29')][_0x5ce8('0x2f')]);_0x391da2['where']=qs[_0x5ce8('0x30')](_[_0x5ce8('0x31')](_0x3e9567['query'],_0x2390b9[_0x5ce8('0x30')]));if(_0x3e9567['query']['filter']){_0x391da2[_0x5ce8('0x33')]=_[_0x5ce8('0x34')](_0x391da2[_0x5ce8('0x33')],{'$or':_['map'](_0x391da2[_0x5ce8('0x2b')],function(_0x61141f){var _0x45c130={};_0x45c130[_0x61141f]={'$like':'%'+_0x3e9567['query']['filter']+'%'};return _0x45c130;})});}_0x391da2=_[_0x5ce8('0x34')]({},_0x391da2,_0x3e9567[_0x5ce8('0x3e')]);return _0x3e0970[_0x5ce8('0x4b')](_0x391da2);}})[_0x5ce8('0x1c')](function(_0x169d27){if(_0x169d27){_0x27b430=_0x169d27[_0x5ce8('0x2d')];if(!_0x3e9567[_0x5ce8('0x29')][_0x5ce8('0x2e')](_0x5ce8('0x4c'))){_0x391da2[_0x5ce8('0x17')]=qs[_0x5ce8('0x17')](_0x3e9567[_0x5ce8('0x29')][_0x5ce8('0x17')]);_0x391da2[_0x5ce8('0x15')]=qs[_0x5ce8('0x15')](_0x3e9567['query']['offset']);}return _0x3e0970['getActions'](_0x391da2);}})[_0x5ce8('0x1c')](function(_0x1893dc){if(_0x1893dc){return _0x1893dc?{'count':_0x27b430,'rows':_0x1893dc}:null;}})[_0x5ce8('0x1c')](respondWithResult(_0x4088c4,null))['catch'](handleError(_0x4088c4,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 98af793..29c3bb6 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 _0xfcc0=['path','../../config/environment','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x576139,_0x4d401d){var _0x3519cc=function(_0x45c718){while(--_0x45c718){_0x576139['push'](_0x576139['shift']());}};_0x3519cc(++_0x4d401d);}(_0xfcc0,0xde));var _0x0fcc=function(_0x6005f4,_0x4f7436){_0x6005f4=_0x6005f4-0x0;var _0x4a8af6=_0xfcc0[_0x6005f4];return _0x4a8af6;};'use strict';var _=require(_0x0fcc('0x0'));var util=require(_0x0fcc('0x1'));var logger=require(_0x0fcc('0x2'))(_0x0fcc('0x3'));var moment=require('moment');var BPromise=require(_0x0fcc('0x4'));var rp=require(_0x0fcc('0x5'));var fs=require('fs');var path=require(_0x0fcc('0x6'));var rimraf=require('rimraf');var config=require(_0x0fcc('0x7'));var attributes=require('./automation.attributes');module[_0x0fcc('0x8')]=function(_0x2fe696,_0x19ba83){return _0x2fe696[_0x0fcc('0x9')](_0x0fcc('0xa'),attributes,{'tableName':_0x0fcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4815=['moment','bluebird','path','rimraf','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger','api'];(function(_0x40b613,_0x242cca){var _0x3082da=function(_0xf4c1ae){while(--_0xf4c1ae){_0x40b613['push'](_0x40b613['shift']());}};_0x3082da(++_0x242cca);}(_0x4815,0x140));var _0x5481=function(_0xc53fb4,_0x24571f){_0xc53fb4=_0xc53fb4-0x0;var _0xa624c6=_0x4815[_0xc53fb4];return _0xa624c6;};'use strict';var _=require(_0x5481('0x0'));var util=require(_0x5481('0x1'));var logger=require(_0x5481('0x2'))(_0x5481('0x3'));var moment=require(_0x5481('0x4'));var BPromise=require(_0x5481('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5481('0x6'));var rimraf=require(_0x5481('0x7'));var config=require('../../config/environment');var attributes=require(_0x5481('0x8'));module[_0x5481('0x9')]=function(_0xff398f,_0x366a34){return _0xff398f[_0x5481('0xa')]('Automation',attributes,{'tableName':_0x5481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 11d41cd..22817d6 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 _0xa848=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x2a605c,_0x18f24b){var _0x1b224e=function(_0x186b12){while(--_0x186b12){_0x2a605c['push'](_0x2a605c['shift']());}};_0x1b224e(++_0x18f24b);}(_0xa848,0x99));var _0x8a84=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa848[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x8a84('0x0'));var util=require(_0x8a84('0x1'));var moment=require(_0x8a84('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a84('0x3'));var fs=require('fs');var Redis=require(_0x8a84('0x4'));var db=require(_0x8a84('0x5'))['db'];var utils=require(_0x8a84('0x6'));var logger=require(_0x8a84('0x7'))(_0x8a84('0x8'));var config=require(_0x8a84('0x9'));var jayson=require(_0x8a84('0xa'));var client=jayson[_0x8a84('0xb')][_0x8a84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d463b,_0x1b958b,_0x764e89){return new BPromise(function(_0xd33118,_0x5a76f4){return client[_0x8a84('0xd')](_0x1d463b,_0x764e89)[_0x8a84('0xe')](function(_0x2294c8){logger['info'](_0x8a84('0xf'),_0x1b958b,_0x8a84('0x10'));logger[_0x8a84('0x11')](_0x8a84('0x12'),_0x1b958b,_0x8a84('0x10'),JSON[_0x8a84('0x13')](_0x2294c8));if(_0x2294c8[_0x8a84('0x14')]){if(_0x2294c8[_0x8a84('0x14')][_0x8a84('0x15')]===0x1f4){logger[_0x8a84('0x14')](_0x8a84('0xf'),_0x1b958b,_0x2294c8[_0x8a84('0x14')]['message']);return _0x5a76f4(_0x2294c8[_0x8a84('0x14')][_0x8a84('0x16')]);}logger[_0x8a84('0x14')]('Automation,\x20%s,\x20%s',_0x1b958b,_0x2294c8[_0x8a84('0x14')][_0x8a84('0x16')]);return _0xd33118(_0x2294c8[_0x8a84('0x14')]['message']);}else{logger[_0x8a84('0x17')](_0x8a84('0xf'),_0x1b958b,'request\x20sent');_0xd33118(_0x2294c8[_0x8a84('0x18')][_0x8a84('0x16')]);}})[_0x8a84('0x19')](function(_0x209516){logger['error'](_0x8a84('0xf'),_0x1b958b,_0x209516);_0x5a76f4(_0x209516);});});} \ No newline at end of file +var _0x50a8=['message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','error','code','Automation,\x20%s,\x20%s'];(function(_0x416759,_0x7df167){var _0x25c3f8=function(_0x575358){while(--_0x575358){_0x416759['push'](_0x416759['shift']());}};_0x25c3f8(++_0x7df167);}(_0x50a8,0x193));var _0x850a=function(_0x48788c,_0x22c6cf){_0x48788c=_0x48788c-0x0;var _0x111b0f=_0x50a8[_0x48788c];return _0x111b0f;};'use strict';var _=require('lodash');var util=require(_0x850a('0x0'));var moment=require('moment');var BPromise=require(_0x850a('0x1'));var rs=require(_0x850a('0x2'));var fs=require('fs');var Redis=require(_0x850a('0x3'));var db=require(_0x850a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x850a('0x5'));var jayson=require(_0x850a('0x6'));var client=jayson['client'][_0x850a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d74c5,_0x29c689,_0x2cfc90){return new BPromise(function(_0x245f43,_0x596f57){return client[_0x850a('0x8')](_0x4d74c5,_0x2cfc90)[_0x850a('0x9')](function(_0x21b814){logger['info']('Automation,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'));logger[_0x850a('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'),JSON['stringify'](_0x21b814));if(_0x21b814[_0x850a('0xc')]){if(_0x21b814[_0x850a('0xc')][_0x850a('0xd')]===0x1f4){logger[_0x850a('0xc')](_0x850a('0xe'),_0x29c689,_0x21b814['error'][_0x850a('0xf')]);return _0x596f57(_0x21b814[_0x850a('0xc')]['message']);}logger[_0x850a('0xc')](_0x850a('0xe'),_0x29c689,_0x21b814['error'][_0x850a('0xf')]);return _0x245f43(_0x21b814[_0x850a('0xc')][_0x850a('0xf')]);}else{logger[_0x850a('0x10')]('Automation,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'));_0x245f43(_0x21b814[_0x850a('0x11')][_0x850a('0xf')]);}})[_0x850a('0x12')](function(_0x67adce){logger[_0x850a('0xc')]('Automation,\x20%s,\x20%s',_0x29c689,_0x67adce);_0x596f57(_0x67adce);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index e70db97..fa1c843 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 _0xcf1c=['destroy','multer','util','connect-timeout','express','Router','fs-extra','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','update','delete'];(function(_0x1e928b,_0x7cb412){var _0x3e26c3=function(_0x1c41f8){while(--_0x1c41f8){_0x1e928b['push'](_0x1e928b['shift']());}};_0x3e26c3(++_0x7cb412);}(_0xcf1c,0x18d));var _0xccf1=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0xcf1c[_0x1c9c24];return _0x349c69;};'use strict';var multer=require(_0xccf1('0x0'));var util=require(_0xccf1('0x1'));var path=require('path');var timeout=require(_0xccf1('0x2'));var express=require(_0xccf1('0x3'));var router=express[_0xccf1('0x4')]();var fs_extra=require(_0xccf1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xccf1('0x6'));router['get']('/',auth[_0xccf1('0x7')](),controller[_0xccf1('0x8')]);router[_0xccf1('0x9')](_0xccf1('0xa'),auth[_0xccf1('0x7')](),controller[_0xccf1('0xb')]);router[_0xccf1('0x9')](_0xccf1('0xc'),auth[_0xccf1('0x7')](),controller[_0xccf1('0xd')]);router[_0xccf1('0x9')](_0xccf1('0xe'),auth[_0xccf1('0x7')](),controller[_0xccf1('0xf')]);router[_0xccf1('0x10')]('/',auth[_0xccf1('0x7')](),controller[_0xccf1('0x11')]);router['post']('/:id/conditions',auth[_0xccf1('0x7')](),controller[_0xccf1('0x12')]);router[_0xccf1('0x10')](_0xccf1('0xe'),auth[_0xccf1('0x7')](),controller['addActions']);router['put'](_0xccf1('0xa'),auth[_0xccf1('0x7')](),controller[_0xccf1('0x13')]);router[_0xccf1('0x14')](_0xccf1('0xa'),auth['isAuthenticated'](),controller[_0xccf1('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf72b=['show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id'];(function(_0x36402b,_0x17be28){var _0x35002c=function(_0x23f5b6){while(--_0x23f5b6){_0x36402b['push'](_0x36402b['shift']());}};_0x35002c(++_0x17be28);}(_0xf72b,0x1d9));var _0xbf72=function(_0x15cc73,_0x5e52d3){_0x15cc73=_0x15cc73-0x0;var _0x43aa76=_0xf72b[_0x15cc73];return _0x43aa76;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0xd')]);router['get'](_0xbf72('0xe'),auth[_0xbf72('0x9')](),controller['getActions']);router[_0xbf72('0xf')]('/',auth[_0xbf72('0x9')](),controller[_0xbf72('0x10')]);router[_0xbf72('0xf')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x11')]);router[_0xbf72('0xf')]('/:id/actions',auth[_0xbf72('0x9')](),controller[_0xbf72('0x12')]);router[_0xbf72('0x13')]('/:id',auth[_0xbf72('0x9')](),controller['update']);router['delete']('/:id',auth[_0xbf72('0x9')](),controller[_0xbf72('0x14')]);module[_0xbf72('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index ae7e4f1..f61a765 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 _0xb8a0=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x429b87,_0x9eefb1){var _0x1b0900=function(_0x4f9eec){while(--_0x4f9eec){_0x429b87['push'](_0x429b87['shift']());}};_0x1b0900(++_0x9eefb1);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x580471,_0x37fa49){_0x580471=_0x580471-0x0;var _0x218a1e=_0xb8a0[_0x580471];return _0x218a1e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0b8a('0x0')],'unique':_0x0b8a('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0b8a('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x0b8a('0x3')](0x4)[_0x0b8a('0x4')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0b8a('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0b8a('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0b8a('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x6')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0b8a('0x3')](0x5)[_0x0b8a('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0b8a('0x3')](0x5)[_0x0b8a('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0b8a('0x3')](0x5)[_0x0b8a('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0b8a('0xc')},'dialTimezone':{'type':Sequelize[_0x0b8a('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0b8a('0x0')],'defaultValue':_0x0b8a('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0b8a('0xe'),_0x0b8a('0xf'),_0x0b8a('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0b8a('0x11')],'defaultValue':0x0,'comment':_0x0b8a('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x0b8a('0x3')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0b8a('0x4')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0b8a('0x3')](0x9)[_0x0b8a('0x4')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0b8a('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b8a('0x3')](0x9)[_0x0b8a('0x4')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b8a('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x0b8a('0x3')](0x9)[_0x0b8a('0x4')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0b8a('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b8a('0x3')](0x9)[_0x0b8a('0x4')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0b8a('0x3')](0x9)[_0x0b8a('0x4')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0b8a('0x3')](0x5)[_0x0b8a('0x4')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0b8a('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0b8a('0x3')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b8a('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0b8a('0x18'),_0x0b8a('0x19')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0b8a('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b8a('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b8a('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0b8a('0x3')](0x5)[_0x0b8a('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x0b8a('0x3')](0x5)[_0x0b8a('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b8a('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x0b8a('0x3')](0x3)[_0x0b8a('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x20')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b8a('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b8a('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b8a('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0b8a('0x3')](0x5)[_0x0b8a('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b8a('0x23')}}; \ No newline at end of file +var _0xd191=['always','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#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','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen'];(function(_0x465f18,_0x2d600c){var _0x529a8e=function(_0x5391b9){while(--_0x5391b9){_0x465f18['push'](_0x465f18['shift']());}};_0x529a8e(++_0x2d600c);}(_0xd191,0xaf));var _0x1d19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd191[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1d19('0x0'));module[_0x1d19('0x1')]={'name':{'type':Sequelize[_0x1d19('0x2')],'unique':_0x1d19('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1d19('0x4')](_0x1d19('0x5')),'allowNull':![],'defaultValue':_0x1d19('0x5')},'description':{'type':Sequelize[_0x1d19('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1d19('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1d19('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1d19('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1d19('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1d19('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1d19('0x9')](0x3)[_0x1d19('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'comment':_0x1d19('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1d19('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1d19('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x1d19('0x13')),'defaultValue':_0x1d19('0x14')},'dialAMDActive':{'type':Sequelize[_0x1d19('0x15')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1d19('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1d19('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1d19('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1d19('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1d19('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1d19('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1d19('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1d19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1d19('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1d19('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1d19('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x1d19('0x1d')),'defaultValue':_0x1d19('0x1e')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1d19('0x1f')},'dialCutDigit':{'type':Sequelize[_0x1d19('0x9')](0x3)[_0x1d19('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 8582a50..40ebdc4 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 _0x2d4e=['fs-extra','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','name','send','index','Campaign','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','rawAttributes','omit','body','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','toString','NOW()','deletedAt\x20IS\x20NULL','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','updatedAt','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_contacts','push','sequelize','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs'];(function(_0x497e52,_0x8b1eb5){var _0x4fbee1=function(_0x180db0){while(--_0x180db0){_0x497e52['push'](_0x497e52['shift']());}};_0x4fbee1(++_0x8b1eb5);}(_0x2d4e,0x102));var _0xe2d4=function(_0x1cc150,_0x2f9ebb){_0x1cc150=_0x1cc150-0x0;var _0x32b2b2=_0x2d4e[_0x1cc150];return _0x32b2b2;};'use strict';var emlformat=require(_0xe2d4('0x0'));var rimraf=require(_0xe2d4('0x1'));var zipdir=require(_0xe2d4('0x2'));var jsonpatch=require(_0xe2d4('0x3'));var rp=require(_0xe2d4('0x4'));var moment=require(_0xe2d4('0x5'));var BPromise=require(_0xe2d4('0x6'));var Mustache=require(_0xe2d4('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe2d4('0x8'));var ejs=require(_0xe2d4('0x9'));var fs=require('fs');var fs_extra=require(_0xe2d4('0xa'));var _=require('lodash');var squel=require(_0xe2d4('0xb'));var crypto=require('crypto');var jsforce=require(_0xe2d4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe2d4('0x8'));var querystring=require('querystring');var Papa=require(_0xe2d4('0xd'));var Redis=require('ioredis');var authService=require(_0xe2d4('0xe'));var qs=require(_0xe2d4('0xf'));var as=require(_0xe2d4('0x10'));var hardwareService=require(_0xe2d4('0x11'));var logger=require(_0xe2d4('0x12'))(_0xe2d4('0x13'));var utils=require(_0xe2d4('0x14'));var config=require(_0xe2d4('0x15'));var licenseUtil=require(_0xe2d4('0x16'));var db=require(_0xe2d4('0x17'))['db'];function respondWithStatusCode(_0x3a16bb,_0x5a2b45){_0x5a2b45=_0x5a2b45||0xcc;return function(_0x47ab3b){if(_0x47ab3b){return _0x3a16bb['sendStatus'](_0x5a2b45);}return _0x3a16bb[_0xe2d4('0x18')](_0x5a2b45)[_0xe2d4('0x19')]();};}function respondWithResult(_0x167cab,_0x54620e){_0x54620e=_0x54620e||0xc8;return function(_0x2d190f){if(_0x2d190f){return _0x167cab[_0xe2d4('0x18')](_0x54620e)[_0xe2d4('0x1a')](_0x2d190f);}};}function respondWithFilteredResult(_0x15e386,_0x31d230){return function(_0x14756b){if(_0x14756b){var _0x3d9139=typeof _0x31d230[_0xe2d4('0x1b')]===_0xe2d4('0x1c')&&typeof _0x31d230[_0xe2d4('0x1d')]===_0xe2d4('0x1c');var _0x35c0d0=_0x14756b[_0xe2d4('0x1e')];var _0xc4ad78=_0x3d9139?0x0:_0x31d230['offset'];var _0x4d8ee=_0x3d9139?_0x14756b[_0xe2d4('0x1e')]:_0x31d230['offset']+_0x31d230[_0xe2d4('0x1d')];var _0x4b3631;if(_0x4d8ee>=_0x35c0d0){_0x4d8ee=_0x35c0d0;_0x4b3631=0xc8;}else{_0x4b3631=0xce;}_0x15e386[_0xe2d4('0x18')](_0x4b3631);return _0x15e386[_0xe2d4('0x1f')]('Content-Range',_0xc4ad78+'-'+_0x4d8ee+'/'+_0x35c0d0)[_0xe2d4('0x1a')](_0x14756b);}return null;};}function patchUpdates(_0x4dc032){return function(_0x1428fb){try{jsonpatch['apply'](_0x1428fb,_0x4dc032,!![]);}catch(_0x297eac){return BPromise[_0xe2d4('0x20')](_0x297eac);}return _0x1428fb[_0xe2d4('0x21')]();};}function saveUpdates(_0x530669,_0x7c7e18){return function(_0x1e18ed){if(_0x1e18ed){return _0x1e18ed[_0xe2d4('0x22')](_0x530669)[_0xe2d4('0x23')](function(_0x5c683c){return _0x5c683c;});}return null;};}function removeEntity(_0x337b08,_0x36a660){return function(_0x30a19a){if(_0x30a19a){return _0x30a19a[_0xe2d4('0x24')]()[_0xe2d4('0x23')](function(){var _0x6608d7=_0x30a19a[_0xe2d4('0x25')]({'plain':!![]});var _0x5689a7=_0xe2d4('0x26');return db[_0xe2d4('0x27')][_0xe2d4('0x24')]({'where':{'type':_0x5689a7,'resourceId':_0x6608d7['id']}})[_0xe2d4('0x23')](function(){return _0x30a19a;});})[_0xe2d4('0x23')](function(){_0x337b08[_0xe2d4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267a56,_0x404a49){return function(_0x2eb375){if(!_0x2eb375){_0x267a56[_0xe2d4('0x28')](0x194);}return _0x2eb375;};}function handleError(_0x2c006b,_0x5c6023){_0x5c6023=_0x5c6023||0x1f4;return function(_0x7473d0){logger[_0xe2d4('0x29')](_0x7473d0['stack']);if(_0x7473d0['name']){delete _0x7473d0[_0xe2d4('0x2a')];}_0x2c006b[_0xe2d4('0x18')](_0x5c6023)[_0xe2d4('0x2b')](_0x7473d0);};}exports[_0xe2d4('0x2c')]=function(_0x158206,_0x1536ae){var _0x2cc9a4={},_0x11f780={},_0x5f5ab3={'count':0x0,'rows':[]};var _0x862ce5=_['map'](db[_0xe2d4('0x2d')]['rawAttributes'],function(_0x19f0b1){return{'name':_0x19f0b1[_0xe2d4('0x2e')],'type':_0x19f0b1[_0xe2d4('0x2f')][_0xe2d4('0x30')]};});_0x11f780[_0xe2d4('0x31')]=_[_0xe2d4('0x32')](_0x862ce5,_0xe2d4('0x2a'));_0x11f780[_0xe2d4('0x33')]=_['keys'](_0x158206[_0xe2d4('0x33')]);_0x11f780[_0xe2d4('0x34')]=_[_0xe2d4('0x35')](_0x11f780[_0xe2d4('0x31')],_0x11f780[_0xe2d4('0x33')]);_0x2cc9a4[_0xe2d4('0x36')]=_[_0xe2d4('0x35')](_0x11f780[_0xe2d4('0x31')],qs[_0xe2d4('0x37')](_0x158206['query'][_0xe2d4('0x37')]));_0x2cc9a4[_0xe2d4('0x36')]=_0x2cc9a4['attributes'][_0xe2d4('0x38')]?_0x2cc9a4['attributes']:_0x11f780['model'];if(!_0x158206[_0xe2d4('0x33')][_0xe2d4('0x39')](_0xe2d4('0x3a'))){_0x2cc9a4['limit']=qs[_0xe2d4('0x1d')](_0x158206['query']['limit']);_0x2cc9a4[_0xe2d4('0x1b')]=qs[_0xe2d4('0x1b')](_0x158206[_0xe2d4('0x33')][_0xe2d4('0x1b')]);}_0x2cc9a4[_0xe2d4('0x3b')]=qs['sort'](_0x158206['query'][_0xe2d4('0x3c')]);_0x2cc9a4[_0xe2d4('0x3d')]=qs[_0xe2d4('0x34')](_[_0xe2d4('0x3e')](_0x158206['query'],_0x11f780[_0xe2d4('0x34')]),_0x862ce5);if(_0x158206[_0xe2d4('0x33')][_0xe2d4('0x3f')]){_0x2cc9a4[_0xe2d4('0x3d')]=_[_0xe2d4('0x40')](_0x2cc9a4['where'],{'$or':_[_0xe2d4('0x32')](_0x862ce5,function(_0x3310a2){if(_0x3310a2[_0xe2d4('0x2f')]!==_0xe2d4('0x41')){var _0x3731f4={};_0x3731f4[_0x3310a2[_0xe2d4('0x2a')]]={'$like':'%'+_0x158206['query'][_0xe2d4('0x3f')]+'%'};return _0x3731f4;}})});}_0x2cc9a4=_[_0xe2d4('0x40')]({},_0x2cc9a4,_0x158206[_0xe2d4('0x42')]);var _0x265bd4={'where':_0x2cc9a4[_0xe2d4('0x3d')]};return db[_0xe2d4('0x2d')][_0xe2d4('0x1e')](_0x265bd4)[_0xe2d4('0x23')](function(_0x2bb997){_0x5f5ab3['count']=_0x2bb997;if(_0x158206[_0xe2d4('0x33')][_0xe2d4('0x43')]){_0x2cc9a4['include']=[{'all':!![]}];}return db[_0xe2d4('0x2d')][_0xe2d4('0x44')](_0x2cc9a4);})['then'](function(_0x15a7ba){_0x5f5ab3[_0xe2d4('0x45')]=_0x15a7ba;return _0x5f5ab3;})[_0xe2d4('0x23')](respondWithFilteredResult(_0x1536ae,_0x2cc9a4))[_0xe2d4('0x46')](handleError(_0x1536ae,null));};exports[_0xe2d4('0x47')]=function(_0xdab865,_0x14bb3d){var _0x1e99b4={'raw':![],'where':{'id':_0xdab865[_0xe2d4('0x48')]['id']}},_0x40751c={};_0x40751c[_0xe2d4('0x31')]=_[_0xe2d4('0x49')](db['Campaign']['rawAttributes']);_0x40751c[_0xe2d4('0x33')]=_[_0xe2d4('0x49')](_0xdab865[_0xe2d4('0x33')]);_0x40751c['filters']=_[_0xe2d4('0x35')](_0x40751c['model'],_0x40751c['query']);_0x1e99b4[_0xe2d4('0x36')]=_['intersection'](_0x40751c[_0xe2d4('0x31')],qs[_0xe2d4('0x37')](_0xdab865[_0xe2d4('0x33')][_0xe2d4('0x37')]));_0x1e99b4['attributes']=_0x1e99b4[_0xe2d4('0x36')][_0xe2d4('0x38')]?_0x1e99b4[_0xe2d4('0x36')]:_0x40751c[_0xe2d4('0x31')];if(_0xdab865[_0xe2d4('0x33')][_0xe2d4('0x43')]){_0x1e99b4[_0xe2d4('0x4a')]=[{'all':!![]}];}_0x1e99b4=_[_0xe2d4('0x40')]({},_0x1e99b4,_0xdab865[_0xe2d4('0x42')]);return db['Campaign'][_0xe2d4('0x4b')](_0x1e99b4)['then'](handleEntityNotFound(_0x14bb3d,null))[_0xe2d4('0x23')](respondWithResult(_0x14bb3d,null))[_0xe2d4('0x46')](handleError(_0x14bb3d,null));};exports[_0xe2d4('0x4c')]=function(_0x434c5e,_0x444bca){return db['Campaign'][_0xe2d4('0x4c')](_0x434c5e['body'],{})[_0xe2d4('0x23')](function(_0x1c3d04){var _0x5c7238=_0x434c5e[_0xe2d4('0x4d')]['get']({'plain':!![]});if(!_0x5c7238)throw new Error(_0xe2d4('0x4e'));if(_0x5c7238[_0xe2d4('0x4f')]===_0xe2d4('0x4d')){var _0x3e6629=_0x1c3d04[_0xe2d4('0x25')]({'plain':!![]});var _0x222bbd=_0xe2d4('0x26');return db[_0xe2d4('0x50')][_0xe2d4('0x4b')]({'where':{'name':_0x222bbd,'userProfileId':_0x5c7238[_0xe2d4('0x51')]},'raw':!![]})[_0xe2d4('0x23')](function(_0x25fbdb){if(_0x25fbdb&&_0x25fbdb[_0xe2d4('0x52')]===0x0){return db[_0xe2d4('0x27')][_0xe2d4('0x4c')]({'name':_0x3e6629[_0xe2d4('0x2a')],'resourceId':_0x3e6629['id'],'type':_0x25fbdb[_0xe2d4('0x2a')],'sectionId':_0x25fbdb['id']},{})['then'](function(){return _0x1c3d04;});}else{return _0x1c3d04;}})[_0xe2d4('0x46')](function(_0xea4ed2){logger[_0xe2d4('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xea4ed2);throw _0xea4ed2;});}return _0x1c3d04;})[_0xe2d4('0x23')](respondWithResult(_0x444bca,0xc9))['catch'](handleError(_0x444bca,null));};exports[_0xe2d4('0x53')]=function(_0x53bcc0,_0x410e65){var _0x4968f5={'where':{'id':_0x53bcc0[_0xe2d4('0x48')]['id']}},_0x4b0a34={};_0x4b0a34[_0xe2d4('0x31')]=_['keys'](db[_0xe2d4('0x2d')][_0xe2d4('0x54')]);_0x4968f5[_0xe2d4('0x36')]=_[_0xe2d4('0x35')](_0x4b0a34['model'],qs[_0xe2d4('0x37')](_0x53bcc0[_0xe2d4('0x33')][_0xe2d4('0x37')]));_0x4968f5[_0xe2d4('0x36')]=_0x4968f5[_0xe2d4('0x36')]['length']?_0x4968f5['attributes']:_0x4b0a34[_0xe2d4('0x31')];if(_0x53bcc0[_0xe2d4('0x33')][_0xe2d4('0x43')]){_0x4968f5[_0xe2d4('0x4a')]=[{'all':!![]}];}_0x4968f5=_[_0xe2d4('0x40')]({},_0x4968f5,_0x53bcc0[_0xe2d4('0x42')]);return db[_0xe2d4('0x2d')]['find'](_0x4968f5)['then'](handleEntityNotFound(_0x410e65,null))[_0xe2d4('0x23')](function(_0x1e1b7a){if(_0x1e1b7a){var _0x48aad2=_0x1e1b7a['get']({'plain':!![]});_0x48aad2=qs[_0xe2d4('0x55')](_0x48aad2,['id','createdAt','updatedAt']);_0x53bcc0[_0xe2d4('0x56')]=_[_0xe2d4('0x55')](_0x53bcc0[_0xe2d4('0x56')],['id',_0xe2d4('0x57'),'updatedAt']);return db[_0xe2d4('0x2d')]['create'](_[_0xe2d4('0x40')](_0x48aad2,_0x53bcc0[_0xe2d4('0x56')]),{'include':_0x53bcc0[_0xe2d4('0x33')][_0xe2d4('0x43')]?[{'all':!![]}]:undefined})[_0xe2d4('0x23')](function(_0x204d1f){var _0xeba57f=_0x53bcc0['user'][_0xe2d4('0x25')]({'plain':!![]});if(!_0xeba57f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xeba57f[_0xe2d4('0x4f')]===_0xe2d4('0x4d')){var _0x2df67b=_0x204d1f[_0xe2d4('0x25')]({'plain':!![]});var _0x5f5910=_0xe2d4('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x5f5910,'userProfileId':_0xeba57f[_0xe2d4('0x51')]},'raw':!![]})[_0xe2d4('0x23')](function(_0x2cc11e){if(_0x2cc11e&&_0x2cc11e[_0xe2d4('0x52')]===0x0){return db[_0xe2d4('0x27')][_0xe2d4('0x4c')]({'name':_0x2df67b[_0xe2d4('0x2a')],'resourceId':_0x2df67b['id'],'type':_0x2cc11e[_0xe2d4('0x2a')],'sectionId':_0x2cc11e['id']},{})[_0xe2d4('0x23')](function(){return _0x204d1f;});}else{return _0x204d1f;}})[_0xe2d4('0x46')](function(_0x315a08){logger[_0xe2d4('0x29')](_0xe2d4('0x58'),_0x315a08);throw _0x315a08;});}return _0x204d1f;});}})[_0xe2d4('0x23')](respondWithResult(_0x410e65,0xc9))[_0xe2d4('0x46')](handleError(_0x410e65,null));};exports[_0xe2d4('0x22')]=function(_0x29e5a7,_0x42978d){if(_0x29e5a7['body']['id']){delete _0x29e5a7['body']['id'];}return db[_0xe2d4('0x2d')][_0xe2d4('0x4b')]({'where':{'id':_0x29e5a7[_0xe2d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x42978d,null))[_0xe2d4('0x23')](saveUpdates(_0x29e5a7['body'],null))['then'](respondWithResult(_0x42978d,null))[_0xe2d4('0x46')](handleError(_0x42978d,null));};exports[_0xe2d4('0x24')]=function(_0x558e42,_0x5c295f){return db[_0xe2d4('0x2d')][_0xe2d4('0x4b')]({'where':{'id':_0x558e42[_0xe2d4('0x48')]['id']}})[_0xe2d4('0x23')](handleEntityNotFound(_0x5c295f,null))[_0xe2d4('0x23')](removeEntity(_0x5c295f,null))[_0xe2d4('0x46')](handleError(_0x5c295f,null));};exports[_0xe2d4('0x59')]=function(_0xd6584e,_0xcbaf5f,_0x3f16fc){var _0x182416={'raw':!![],'where':{}};var _0xf2fa2d={};var _0x1c3eff={'count':0x0,'rows':[]};return db[_0xe2d4('0x2d')][_0xe2d4('0x5a')]({'where':{'id':_0xd6584e['params']['id']}})['then'](handleEntityNotFound(_0xcbaf5f,null))[_0xe2d4('0x23')](function(_0x584fd1){if(_0x584fd1){_0xf2fa2d['model']=_[_0xe2d4('0x49')](db[_0xe2d4('0x5b')][_0xe2d4('0x54')]);_0xf2fa2d[_0xe2d4('0x33')]=_[_0xe2d4('0x49')](_0xd6584e['query']);_0xf2fa2d[_0xe2d4('0x34')]=_[_0xe2d4('0x35')](_0xf2fa2d[_0xe2d4('0x31')],_0xf2fa2d[_0xe2d4('0x33')]);_0x182416[_0xe2d4('0x36')]=_[_0xe2d4('0x35')](_0xf2fa2d['model'],qs['fields'](_0xd6584e[_0xe2d4('0x33')][_0xe2d4('0x37')]));_0x182416[_0xe2d4('0x36')]=_0x182416[_0xe2d4('0x36')]['length']?_0x182416[_0xe2d4('0x36')]:_0xf2fa2d['model'];if(!_0xd6584e['query']['hasOwnProperty'](_0xe2d4('0x3a'))){_0x182416[_0xe2d4('0x1d')]=qs['limit'](_0xd6584e[_0xe2d4('0x33')]['limit']);_0x182416[_0xe2d4('0x1b')]=qs['offset'](_0xd6584e[_0xe2d4('0x33')][_0xe2d4('0x1b')]);}_0x182416[_0xe2d4('0x3b')]=qs['sort'](_0xd6584e[_0xe2d4('0x33')]['sort']);_0x182416[_0xe2d4('0x3d')]=qs[_0xe2d4('0x34')](_[_0xe2d4('0x3e')](_0xd6584e[_0xe2d4('0x33')],_0xf2fa2d[_0xe2d4('0x34')]));_0x182416[_0xe2d4('0x3d')]['CampaignId']=_0x584fd1['id'];if(_0xd6584e[_0xe2d4('0x33')]['filter']){_0x182416['where']=_[_0xe2d4('0x40')](_0x182416[_0xe2d4('0x3d')],{'$or':_[_0xe2d4('0x32')](_0x182416[_0xe2d4('0x36')],function(_0x219fd1){var _0x4bb0e5={};_0x4bb0e5[_0x219fd1]={'$like':'%'+_0xd6584e[_0xe2d4('0x33')][_0xe2d4('0x3f')]+'%'};return _0x4bb0e5;})});}_0x182416=_['merge']({},_0x182416,_0xd6584e[_0xe2d4('0x42')]);return db['CmHopper']['count']({'where':_0x182416[_0xe2d4('0x3d')]})[_0xe2d4('0x23')](function(_0x25997b){_0x1c3eff[_0xe2d4('0x1e')]=_0x25997b;if(_0xd6584e[_0xe2d4('0x33')]['includeAll']){_0x182416['include']=[{'all':!![]}];}return db[_0xe2d4('0x5b')]['findAll'](_0x182416);})[_0xe2d4('0x23')](function(_0xe1cfe9){_0x1c3eff[_0xe2d4('0x45')]=_0xe1cfe9;return _0x1c3eff;});}})['then'](respondWithFilteredResult(_0xcbaf5f,_0x182416))[_0xe2d4('0x46')](handleError(_0xcbaf5f,null));};exports['getHopperHistories']=function(_0x192daa,_0x391f97,_0x17dab3){var _0x2c0d99={'raw':!![],'where':{}};var _0x80915b={};var _0x4e1b35={'count':0x0,'rows':[]};return db['Campaign'][_0xe2d4('0x5a')]({'where':{'id':_0x192daa[_0xe2d4('0x48')]['id']}})[_0xe2d4('0x23')](handleEntityNotFound(_0x391f97,null))[_0xe2d4('0x23')](function(_0x14a3ba){if(_0x14a3ba){_0x80915b[_0xe2d4('0x31')]=_[_0xe2d4('0x49')](db['CmHopperHistory'][_0xe2d4('0x54')]);_0x80915b['query']=_[_0xe2d4('0x49')](_0x192daa[_0xe2d4('0x33')]);_0x80915b[_0xe2d4('0x34')]=_['intersection'](_0x80915b[_0xe2d4('0x31')],_0x80915b[_0xe2d4('0x33')]);_0x2c0d99['attributes']=_[_0xe2d4('0x35')](_0x80915b[_0xe2d4('0x31')],qs[_0xe2d4('0x37')](_0x192daa['query'][_0xe2d4('0x37')]));_0x2c0d99[_0xe2d4('0x36')]=_0x2c0d99['attributes']['length']?_0x2c0d99[_0xe2d4('0x36')]:_0x80915b[_0xe2d4('0x31')];if(!_0x192daa[_0xe2d4('0x33')][_0xe2d4('0x39')](_0xe2d4('0x3a'))){_0x2c0d99[_0xe2d4('0x1d')]=qs[_0xe2d4('0x1d')](_0x192daa['query']['limit']);_0x2c0d99[_0xe2d4('0x1b')]=qs[_0xe2d4('0x1b')](_0x192daa[_0xe2d4('0x33')][_0xe2d4('0x1b')]);}_0x2c0d99['order']=qs[_0xe2d4('0x3c')](_0x192daa[_0xe2d4('0x33')][_0xe2d4('0x3c')]);_0x2c0d99[_0xe2d4('0x3d')]=qs[_0xe2d4('0x34')](_[_0xe2d4('0x3e')](_0x192daa[_0xe2d4('0x33')],_0x80915b[_0xe2d4('0x34')]));_0x2c0d99[_0xe2d4('0x3d')][_0xe2d4('0x5c')]=_0x14a3ba['id'];if(_0x192daa['query']['filter']){_0x2c0d99[_0xe2d4('0x3d')]=_[_0xe2d4('0x40')](_0x2c0d99[_0xe2d4('0x3d')],{'$or':_[_0xe2d4('0x32')](_0x2c0d99[_0xe2d4('0x36')],function(_0x1cbd8b){var _0x2f742d={};_0x2f742d[_0x1cbd8b]={'$like':'%'+_0x192daa[_0xe2d4('0x33')][_0xe2d4('0x3f')]+'%'};return _0x2f742d;})});}_0x2c0d99=_[_0xe2d4('0x40')]({},_0x2c0d99,_0x192daa['options']);return db[_0xe2d4('0x5d')][_0xe2d4('0x1e')]({'where':_0x2c0d99[_0xe2d4('0x3d')]})[_0xe2d4('0x23')](function(_0x3035c8){_0x4e1b35[_0xe2d4('0x1e')]=_0x3035c8;if(_0x192daa['query'][_0xe2d4('0x43')]){_0x2c0d99[_0xe2d4('0x4a')]=[{'all':!![]}];}return db[_0xe2d4('0x5d')]['findAll'](_0x2c0d99);})[_0xe2d4('0x23')](function(_0x1c39c1){_0x4e1b35['rows']=_0x1c39c1;return _0x4e1b35;});}})['then'](respondWithFilteredResult(_0x391f97,_0x2c0d99))[_0xe2d4('0x46')](handleError(_0x391f97,null));};exports[_0xe2d4('0x5e')]=function(_0x19ed83,_0xc6fdbb,_0xdf1ce7){var _0x13c77d={'raw':!![],'where':{}};var _0x30f474={};var _0x17aaf7={'count':0x0,'rows':[]};return db[_0xe2d4('0x2d')][_0xe2d4('0x5a')]({'where':{'id':_0x19ed83[_0xe2d4('0x48')]['id']}})[_0xe2d4('0x23')](handleEntityNotFound(_0xc6fdbb,null))[_0xe2d4('0x23')](function(_0x3972b6){if(_0x3972b6){_0x30f474['model']=_[_0xe2d4('0x49')](db[_0xe2d4('0x5f')][_0xe2d4('0x54')]);_0x30f474[_0xe2d4('0x33')]=_[_0xe2d4('0x49')](_0x19ed83[_0xe2d4('0x33')]);_0x30f474[_0xe2d4('0x34')]=_['intersection'](_0x30f474[_0xe2d4('0x31')],_0x30f474[_0xe2d4('0x33')]);_0x13c77d['attributes']=_[_0xe2d4('0x35')](_0x30f474[_0xe2d4('0x31')],qs['fields'](_0x19ed83[_0xe2d4('0x33')]['fields']));_0x13c77d['attributes']=_0x13c77d['attributes']['length']?_0x13c77d[_0xe2d4('0x36')]:_0x30f474[_0xe2d4('0x31')];if(!_0x19ed83[_0xe2d4('0x33')][_0xe2d4('0x39')](_0xe2d4('0x3a'))){_0x13c77d[_0xe2d4('0x1d')]=qs[_0xe2d4('0x1d')](_0x19ed83[_0xe2d4('0x33')][_0xe2d4('0x1d')]);_0x13c77d['offset']=qs['offset'](_0x19ed83[_0xe2d4('0x33')][_0xe2d4('0x1b')]);}_0x13c77d[_0xe2d4('0x3b')]=qs[_0xe2d4('0x3c')](_0x19ed83[_0xe2d4('0x33')][_0xe2d4('0x3c')]);_0x13c77d[_0xe2d4('0x3d')]=qs['filters'](_['pick'](_0x19ed83[_0xe2d4('0x33')],_0x30f474[_0xe2d4('0x34')]));_0x13c77d[_0xe2d4('0x3d')][_0xe2d4('0x5c')]=_0x3972b6['id'];if(_0x19ed83[_0xe2d4('0x33')][_0xe2d4('0x3f')]){_0x13c77d['where']=_[_0xe2d4('0x40')](_0x13c77d[_0xe2d4('0x3d')],{'$or':_[_0xe2d4('0x32')](_0x13c77d[_0xe2d4('0x36')],function(_0x1ca000){var _0x17798a={};_0x17798a[_0x1ca000]={'$like':'%'+_0x19ed83[_0xe2d4('0x33')]['filter']+'%'};return _0x17798a;})});}_0x13c77d=_[_0xe2d4('0x40')]({},_0x13c77d,_0x19ed83[_0xe2d4('0x42')]);return db[_0xe2d4('0x5f')][_0xe2d4('0x1e')]({'where':_0x13c77d[_0xe2d4('0x3d')]})[_0xe2d4('0x23')](function(_0x3aee93){_0x17aaf7[_0xe2d4('0x1e')]=_0x3aee93;if(_0x19ed83[_0xe2d4('0x33')][_0xe2d4('0x43')]){_0x13c77d[_0xe2d4('0x4a')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xe2d4('0x44')](_0x13c77d);})['then'](function(_0x2e1110){_0x17aaf7[_0xe2d4('0x45')]=_0x2e1110;return _0x17aaf7;});}})[_0xe2d4('0x23')](respondWithFilteredResult(_0xc6fdbb,_0x13c77d))[_0xe2d4('0x46')](handleError(_0xc6fdbb,null));};exports['getHopperBlacks']=function(_0x52396a,_0x118284,_0x456e05){var _0x16b947={'raw':!![],'where':{}};var _0x380c72={};var _0x28d6af={'count':0x0,'rows':[]};return db[_0xe2d4('0x2d')][_0xe2d4('0x5a')]({'where':{'id':_0x52396a[_0xe2d4('0x48')]['id']}})[_0xe2d4('0x23')](handleEntityNotFound(_0x118284,null))[_0xe2d4('0x23')](function(_0x560809){if(_0x560809){_0x380c72['model']=_['keys'](db[_0xe2d4('0x60')][_0xe2d4('0x54')]);_0x380c72[_0xe2d4('0x33')]=_[_0xe2d4('0x49')](_0x52396a['query']);_0x380c72[_0xe2d4('0x34')]=_[_0xe2d4('0x35')](_0x380c72['model'],_0x380c72[_0xe2d4('0x33')]);_0x16b947[_0xe2d4('0x36')]=_[_0xe2d4('0x35')](_0x380c72['model'],qs[_0xe2d4('0x37')](_0x52396a[_0xe2d4('0x33')]['fields']));_0x16b947[_0xe2d4('0x36')]=_0x16b947[_0xe2d4('0x36')]['length']?_0x16b947[_0xe2d4('0x36')]:_0x380c72[_0xe2d4('0x31')];if(!_0x52396a[_0xe2d4('0x33')][_0xe2d4('0x39')]('nolimit')){_0x16b947['limit']=qs['limit'](_0x52396a[_0xe2d4('0x33')][_0xe2d4('0x1d')]);_0x16b947['offset']=qs[_0xe2d4('0x1b')](_0x52396a[_0xe2d4('0x33')]['offset']);}_0x16b947['order']=qs['sort'](_0x52396a[_0xe2d4('0x33')][_0xe2d4('0x3c')]);_0x16b947[_0xe2d4('0x3d')]=qs['filters'](_[_0xe2d4('0x3e')](_0x52396a['query'],_0x380c72[_0xe2d4('0x34')]));_0x16b947[_0xe2d4('0x3d')][_0xe2d4('0x5c')]=_0x560809['id'];if(_0x52396a['query'][_0xe2d4('0x3f')]){_0x16b947[_0xe2d4('0x3d')]=_[_0xe2d4('0x40')](_0x16b947[_0xe2d4('0x3d')],{'$or':_[_0xe2d4('0x32')](_0x16b947[_0xe2d4('0x36')],function(_0x3da127){var _0x31e6cd={};_0x31e6cd[_0x3da127]={'$like':'%'+_0x52396a['query'][_0xe2d4('0x3f')]+'%'};return _0x31e6cd;})});}_0x16b947=_[_0xe2d4('0x40')]({},_0x16b947,_0x52396a['options']);return db['CmHopperBlack'][_0xe2d4('0x1e')]({'where':_0x16b947['where']})['then'](function(_0x417b93){_0x28d6af[_0xe2d4('0x1e')]=_0x417b93;if(_0x52396a[_0xe2d4('0x33')]['includeAll']){_0x16b947['include']=[{'all':!![]}];}return db[_0xe2d4('0x60')][_0xe2d4('0x44')](_0x16b947);})[_0xe2d4('0x23')](function(_0x38a0fa){_0x28d6af['rows']=_0x38a0fa;return _0x28d6af;});}})[_0xe2d4('0x23')](respondWithFilteredResult(_0x118284,_0x16b947))[_0xe2d4('0x46')](handleError(_0x118284,null));};exports[_0xe2d4('0x61')]=function(_0x4c40fe,_0x5b3a85,_0x14a178){var _0x5824c3={};var _0x350391={};var _0x398327;var _0x5e59ce;return db[_0xe2d4('0x2d')][_0xe2d4('0x5a')]({'where':{'id':_0x4c40fe[_0xe2d4('0x48')]['id']}})[_0xe2d4('0x23')](handleEntityNotFound(_0x5b3a85,null))[_0xe2d4('0x23')](function(_0x3746e0){if(_0x3746e0){_0x398327=_0x3746e0;_0x350391[_0xe2d4('0x31')]=_[_0xe2d4('0x49')](db[_0xe2d4('0x62')][_0xe2d4('0x54')]);_0x350391[_0xe2d4('0x33')]=_['keys'](_0x4c40fe[_0xe2d4('0x33')]);_0x350391[_0xe2d4('0x34')]=_[_0xe2d4('0x35')](_0x350391['model'],_0x350391[_0xe2d4('0x33')]);_0x5824c3[_0xe2d4('0x36')]=_[_0xe2d4('0x35')](_0x350391[_0xe2d4('0x31')],qs[_0xe2d4('0x37')](_0x4c40fe[_0xe2d4('0x33')][_0xe2d4('0x37')]));_0x5824c3[_0xe2d4('0x36')]=_0x5824c3['attributes'][_0xe2d4('0x38')]?_0x5824c3['attributes']:_0x350391[_0xe2d4('0x31')];_0x5824c3['order']=qs[_0xe2d4('0x3c')](_0x4c40fe[_0xe2d4('0x33')][_0xe2d4('0x3c')]);_0x5824c3['where']=qs[_0xe2d4('0x34')](_[_0xe2d4('0x3e')](_0x4c40fe[_0xe2d4('0x33')],_0x350391['filters']));if(_0x4c40fe[_0xe2d4('0x33')][_0xe2d4('0x3f')]){_0x5824c3[_0xe2d4('0x3d')]=_[_0xe2d4('0x40')](_0x5824c3['where'],{'$or':_[_0xe2d4('0x32')](_0x5824c3[_0xe2d4('0x36')],function(_0x146f3f){var _0x3cefd2={};_0x3cefd2[_0x146f3f]={'$like':'%'+_0x4c40fe[_0xe2d4('0x33')][_0xe2d4('0x3f')]+'%'};return _0x3cefd2;})});}_0x5824c3=_[_0xe2d4('0x40')]({},_0x5824c3,_0x4c40fe['options']);return _0x398327[_0xe2d4('0x61')](_0x5824c3);}})[_0xe2d4('0x23')](function(_0x4d0d6b){if(_0x4d0d6b){_0x5e59ce=_0x4d0d6b[_0xe2d4('0x38')];if(!_0x4c40fe[_0xe2d4('0x33')][_0xe2d4('0x39')]('nolimit')){_0x5824c3[_0xe2d4('0x1d')]=qs['limit'](_0x4c40fe[_0xe2d4('0x33')][_0xe2d4('0x1d')]);_0x5824c3[_0xe2d4('0x1b')]=qs[_0xe2d4('0x1b')](_0x4c40fe[_0xe2d4('0x33')][_0xe2d4('0x1b')]);}return _0x398327[_0xe2d4('0x61')](_0x5824c3);}})[_0xe2d4('0x23')](function(_0x59f66b){if(_0x59f66b){return _0x59f66b?{'count':_0x5e59ce,'rows':_0x59f66b}:null;}})[_0xe2d4('0x23')](respondWithResult(_0x5b3a85,null))[_0xe2d4('0x46')](handleError(_0x5b3a85,null));};exports[_0xe2d4('0x63')]=function(_0x4bd65f,_0x2e99a6,_0xa93633){var _0x3214b5,_0x2865ee;return db[_0xe2d4('0x2d')][_0xe2d4('0x4b')]({'where':{'id':_0x4bd65f['params']['id']}})['then'](handleEntityNotFound(_0x2e99a6,null))[_0xe2d4('0x23')](function(_0x37ab06){if(_0x37ab06){_0x2865ee=_0x37ab06;return _0x37ab06[_0xe2d4('0x63')](_0x4bd65f[_0xe2d4('0x56')][_0xe2d4('0x64')],_[_0xe2d4('0x55')](_0x4bd65f['body'],[_0xe2d4('0x64'),'id'])||{});}return null;})[_0xe2d4('0x65')](function(_0x2ea933){var _0x1b2911;_0x3214b5=_0x2ea933||[];var _0xe4175c=[];if(_0x2ea933){for(var _0x31fd3b=0x0;_0x31fd3b<_0x2ea933['length'];_0x31fd3b+=0x1){var _0x51e931=_0x2ea933[_0x31fd3b][_0xe2d4('0x25')]({'plain':!![]});_0x2865ee[_0xe2d4('0x66')]=_0x4bd65f[_0xe2d4('0x56')]['dialCheckDuplicateType']?_0x4bd65f[_0xe2d4('0x56')][_0xe2d4('0x66')]:_0x2865ee[_0xe2d4('0x66')];switch(_0x2865ee[_0xe2d4('0x66')]){case _0xe2d4('0x67'):_0x1b2911=squel['insert']()[_0xe2d4('0x68')](_0xe2d4('0x69'))[_0xe2d4('0x6a')]([_0xe2d4('0x6b'),_0xe2d4('0x6c'),_0xe2d4('0x6d'),_0xe2d4('0x6e'),_0xe2d4('0x5c'),_0xe2d4('0x57'),'updatedAt'],squel[_0xe2d4('0x6f')]()[_0xe2d4('0x70')](_0xe2d4('0x6b'),_0xe2d4('0x6b'))[_0xe2d4('0x70')]('NOW()',_0xe2d4('0x6c'))[_0xe2d4('0x70')]('id',_0xe2d4('0x6d'))[_0xe2d4('0x70')](_0x51e931['CmListId'][_0xe2d4('0x71')](),'ListId')[_0xe2d4('0x70')](_0x4bd65f['params']['id']['toString'](),_0xe2d4('0x5c'))[_0xe2d4('0x70')](_0xe2d4('0x72'),_0xe2d4('0x57'))['field'](_0xe2d4('0x72'),'updatedAt')['from']('cm_contacts')[_0xe2d4('0x3d')](_0xe2d4('0x73'))['where']('ListId\x20=\x20?',_0x51e931[_0xe2d4('0x74')][_0xe2d4('0x71')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xe2d4('0x75'),squel[_0xe2d4('0x6f')]()[_0xe2d4('0x70')](_0xe2d4('0x76'))[_0xe2d4('0x77')]('cm_hopper_final')[_0xe2d4('0x3d')](_0xe2d4('0x78'),_0x4bd65f['params']['id'][_0xe2d4('0x71')]()))[_0xe2d4('0x3d')](_0xe2d4('0x75'),squel[_0xe2d4('0x6f')]()['field'](_0xe2d4('0x79'))['from'](_0xe2d4('0x69'))[_0xe2d4('0x3d')](_0xe2d4('0x78'),_0x4bd65f['params']['id'][_0xe2d4('0x71')]())))[_0xe2d4('0x71')]();break;case _0xe2d4('0x7a'):_0x1b2911=squel[_0xe2d4('0x7b')]()['into']('cm_hopper')[_0xe2d4('0x6a')]([_0xe2d4('0x6b'),_0xe2d4('0x6c'),'ContactId',_0xe2d4('0x6e'),_0xe2d4('0x5c'),'createdAt',_0xe2d4('0x7c')],squel[_0xe2d4('0x6f')]()['field']('phone','phone')[_0xe2d4('0x70')]('NOW()',_0xe2d4('0x6c'))[_0xe2d4('0x70')]('id',_0xe2d4('0x6d'))['field'](_0x51e931['CmListId'][_0xe2d4('0x71')](),_0xe2d4('0x6e'))['field'](_0x4bd65f[_0xe2d4('0x48')]['id'][_0xe2d4('0x71')](),_0xe2d4('0x5c'))[_0xe2d4('0x70')]('NOW()','createdAt')[_0xe2d4('0x70')]('NOW()',_0xe2d4('0x7c'))[_0xe2d4('0x77')]('cm_contacts')[_0xe2d4('0x3d')](_0xe2d4('0x73'))['where'](_0xe2d4('0x7d'),_0x51e931['CmListId'][_0xe2d4('0x71')]())[_0xe2d4('0x3d')](_0xe2d4('0x7e'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe2d4('0x6f')]()['field'](_0xe2d4('0x79'))['from'](_0xe2d4('0x69'))[_0xe2d4('0x3d')](_0xe2d4('0x78'),_0x4bd65f[_0xe2d4('0x48')]['id'][_0xe2d4('0x71')]())))['toString']();break;default:_0x1b2911=squel[_0xe2d4('0x7b')]()['into']('cm_hopper')[_0xe2d4('0x6a')]([_0xe2d4('0x6b'),_0xe2d4('0x6c'),_0xe2d4('0x6d'),_0xe2d4('0x6e'),_0xe2d4('0x5c'),'createdAt',_0xe2d4('0x7c')],squel[_0xe2d4('0x6f')]()[_0xe2d4('0x70')]('phone','phone')[_0xe2d4('0x70')](_0xe2d4('0x72'),_0xe2d4('0x6c'))[_0xe2d4('0x70')]('id',_0xe2d4('0x6d'))[_0xe2d4('0x70')](_0x51e931[_0xe2d4('0x74')][_0xe2d4('0x71')](),_0xe2d4('0x6e'))[_0xe2d4('0x70')](_0x4bd65f[_0xe2d4('0x48')]['id'][_0xe2d4('0x71')](),_0xe2d4('0x5c'))[_0xe2d4('0x70')](_0xe2d4('0x72'),'createdAt')['field'](_0xe2d4('0x72'),_0xe2d4('0x7c'))[_0xe2d4('0x77')](_0xe2d4('0x7f'))['where']('deletedAt\x20IS\x20NULL')[_0xe2d4('0x3d')](_0xe2d4('0x7d'),_0x51e931[_0xe2d4('0x74')][_0xe2d4('0x71')]())[_0xe2d4('0x3d')](_0xe2d4('0x7e')))[_0xe2d4('0x71')]();}_0xe4175c[_0xe2d4('0x80')](db[_0xe2d4('0x81')][_0xe2d4('0x33')](_0x1b2911));}return BPromise['all'](_0xe4175c);}})[_0xe2d4('0x23')](function(){return _0x3214b5;})[_0xe2d4('0x23')](respondWithResult(_0x2e99a6,null))[_0xe2d4('0x46')](handleError(_0x2e99a6,null));};exports['removeLists']=function(_0x517b49,_0x3d7940,_0x40b25b){return db['Campaign'][_0xe2d4('0x4b')]({'where':{'id':_0x517b49['params']['id']}})[_0xe2d4('0x23')](handleEntityNotFound(_0x3d7940,null))[_0xe2d4('0x23')](function(_0x13cd3f){if(_0x13cd3f){return _0x13cd3f['removeLists'](_0x517b49[_0xe2d4('0x33')][_0xe2d4('0x64')]);}})[_0xe2d4('0x23')](function(_0x4c3684){if(_0x4c3684){return db[_0xe2d4('0x5b')][_0xe2d4('0x24')]({'where':{'ListId':_0x517b49[_0xe2d4('0x33')][_0xe2d4('0x64')],'CampaignId':_0x517b49[_0xe2d4('0x48')]['id']}})['then'](function(){return _0x4c3684;});}})[_0xe2d4('0x23')](respondWithStatusCode(_0x3d7940,null))[_0xe2d4('0x46')](handleError(_0x3d7940,null));};exports['getBlackLists']=function(_0x2bd2cb,_0x164ec7,_0x559511){var _0x2d69b1={};var _0x1aa4aa={};var _0x494891;var _0x32f8dc;return db[_0xe2d4('0x2d')]['findOne']({'where':{'id':_0x2bd2cb[_0xe2d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x164ec7,null))[_0xe2d4('0x23')](function(_0x3ba28c){if(_0x3ba28c){_0x494891=_0x3ba28c;_0x1aa4aa[_0xe2d4('0x31')]=_['keys'](db['CmList'][_0xe2d4('0x54')]);_0x1aa4aa['query']=_[_0xe2d4('0x49')](_0x2bd2cb[_0xe2d4('0x33')]);_0x1aa4aa['filters']=_['intersection'](_0x1aa4aa[_0xe2d4('0x31')],_0x1aa4aa[_0xe2d4('0x33')]);_0x2d69b1['attributes']=_[_0xe2d4('0x35')](_0x1aa4aa[_0xe2d4('0x31')],qs['fields'](_0x2bd2cb[_0xe2d4('0x33')]['fields']));_0x2d69b1['attributes']=_0x2d69b1[_0xe2d4('0x36')][_0xe2d4('0x38')]?_0x2d69b1['attributes']:_0x1aa4aa[_0xe2d4('0x31')];_0x2d69b1[_0xe2d4('0x3b')]=qs[_0xe2d4('0x3c')](_0x2bd2cb[_0xe2d4('0x33')][_0xe2d4('0x3c')]);_0x2d69b1[_0xe2d4('0x3d')]=qs[_0xe2d4('0x34')](_[_0xe2d4('0x3e')](_0x2bd2cb[_0xe2d4('0x33')],_0x1aa4aa['filters']));if(_0x2bd2cb[_0xe2d4('0x33')][_0xe2d4('0x3f')]){_0x2d69b1['where']=_[_0xe2d4('0x40')](_0x2d69b1[_0xe2d4('0x3d')],{'$or':_[_0xe2d4('0x32')](_0x2d69b1[_0xe2d4('0x36')],function(_0x1b44ae){var _0x273cda={};_0x273cda[_0x1b44ae]={'$like':'%'+_0x2bd2cb[_0xe2d4('0x33')][_0xe2d4('0x3f')]+'%'};return _0x273cda;})});}_0x2d69b1=_[_0xe2d4('0x40')]({},_0x2d69b1,_0x2bd2cb[_0xe2d4('0x42')]);return _0x494891[_0xe2d4('0x82')](_0x2d69b1);}})[_0xe2d4('0x23')](function(_0x464484){if(_0x464484){_0x32f8dc=_0x464484[_0xe2d4('0x38')];if(!_0x2bd2cb['query']['hasOwnProperty'](_0xe2d4('0x3a'))){_0x2d69b1[_0xe2d4('0x1d')]=qs['limit'](_0x2bd2cb[_0xe2d4('0x33')][_0xe2d4('0x1d')]);_0x2d69b1[_0xe2d4('0x1b')]=qs[_0xe2d4('0x1b')](_0x2bd2cb[_0xe2d4('0x33')][_0xe2d4('0x1b')]);}return _0x494891[_0xe2d4('0x82')](_0x2d69b1);}})[_0xe2d4('0x23')](function(_0x4c80cd){if(_0x4c80cd){return _0x4c80cd?{'count':_0x32f8dc,'rows':_0x4c80cd}:null;}})[_0xe2d4('0x23')](respondWithResult(_0x164ec7,null))[_0xe2d4('0x46')](handleError(_0x164ec7,null));};exports[_0xe2d4('0x83')]=function(_0x3912b2,_0x38eba8,_0x11edf7){var _0x2845aa,_0x8ee1a8;return db[_0xe2d4('0x2d')][_0xe2d4('0x4b')]({'where':{'id':_0x3912b2[_0xe2d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x38eba8,null))[_0xe2d4('0x23')](function(_0x415fe0){if(_0x415fe0){_0x8ee1a8=_0x415fe0;return _0x415fe0[_0xe2d4('0x83')](_0x3912b2[_0xe2d4('0x56')][_0xe2d4('0x64')],_[_0xe2d4('0x55')](_0x3912b2[_0xe2d4('0x56')],['ids','id'])||{});}return null;})[_0xe2d4('0x65')](function(_0x3dfd6c){var _0x5aa9ec;_0x2845aa=_0x3dfd6c||[];var _0x2ba6cf=[];if(_0x3dfd6c){for(var _0xbf89cf=0x0;_0xbf89cf<_0x3dfd6c[_0xe2d4('0x38')];_0xbf89cf+=0x1){var _0x145847=_0x3dfd6c[_0xbf89cf]['get']({'plain':!![]});_0x5aa9ec=squel[_0xe2d4('0x7b')]()[_0xe2d4('0x68')](_0xe2d4('0x84'))[_0xe2d4('0x6a')]([_0xe2d4('0x6b'),_0xe2d4('0x6d'),_0xe2d4('0x6e'),_0xe2d4('0x5c'),_0xe2d4('0x57'),_0xe2d4('0x7c')],squel[_0xe2d4('0x6f')]()[_0xe2d4('0x70')](_0xe2d4('0x6b'),'phone')[_0xe2d4('0x70')]('id',_0xe2d4('0x6d'))[_0xe2d4('0x70')](_0x145847[_0xe2d4('0x74')][_0xe2d4('0x71')](),_0xe2d4('0x6e'))[_0xe2d4('0x70')](_0x3912b2['params']['id']['toString'](),_0xe2d4('0x5c'))['field'](_0xe2d4('0x72'),_0xe2d4('0x57'))[_0xe2d4('0x70')](_0xe2d4('0x72'),_0xe2d4('0x7c'))[_0xe2d4('0x77')](_0xe2d4('0x7f'))['where'](_0xe2d4('0x73'))[_0xe2d4('0x3d')](_0xe2d4('0x7d'),_0x145847[_0xe2d4('0x74')][_0xe2d4('0x71')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x2ba6cf[_0xe2d4('0x80')](db[_0xe2d4('0x81')]['query'](_0x5aa9ec));}return BPromise['all'](_0x2ba6cf);}})[_0xe2d4('0x23')](function(){return _0x2845aa;})[_0xe2d4('0x23')](respondWithResult(_0x38eba8,null))[_0xe2d4('0x46')](handleError(_0x38eba8,null));};exports[_0xe2d4('0x85')]=function(_0x484ef3,_0x10b70f,_0x4f190f){return db['Campaign'][_0xe2d4('0x4b')]({'where':{'id':_0x484ef3[_0xe2d4('0x48')]['id']}})[_0xe2d4('0x23')](handleEntityNotFound(_0x10b70f,null))[_0xe2d4('0x23')](function(_0x23d02f){if(_0x23d02f){return _0x23d02f[_0xe2d4('0x85')](_0x484ef3['query'][_0xe2d4('0x64')]);}})[_0xe2d4('0x23')](function(_0x543d9f){if(_0x543d9f){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x484ef3[_0xe2d4('0x33')]['ids'],'CampaignId':_0x484ef3[_0xe2d4('0x48')]['id']}})[_0xe2d4('0x23')](function(){return _0x543d9f;});}})[_0xe2d4('0x23')](respondWithStatusCode(_0x10b70f,null))['catch'](handleError(_0x10b70f,null));}; \ No newline at end of file +var _0x130d=['getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','Campaign','includeAll','findAll','rows','catch','show','params','keys','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','order','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','scheduledAt','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists'];(function(_0x57fb9d,_0x14a22d){var _0x5daabc=function(_0x3371e4){while(--_0x3371e4){_0x57fb9d['push'](_0x57fb9d['shift']());}};_0x5daabc(++_0x14a22d);}(_0x130d,0x89));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd130('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd130('0x1'));var rp=require('request-promise');var moment=require(_0xd130('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd130('0x3'));var path=require(_0xd130('0x4'));var sox=require(_0xd130('0x5'));var csv=require(_0xd130('0x6'));var ejs=require(_0xd130('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd130('0x8'));var squel=require('squel');var crypto=require(_0xd130('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd130('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd130('0xb'));var Papa=require('papaparse');var Redis=require(_0xd130('0xc'));var authService=require(_0xd130('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd130('0xe'));var hardwareService=require(_0xd130('0xf'));var logger=require(_0xd130('0x10'))('api');var utils=require(_0xd130('0x11'));var config=require(_0xd130('0x12'));var licenseUtil=require(_0xd130('0x13'));var db=require(_0xd130('0x14'))['db'];function respondWithStatusCode(_0x48bdce,_0x2ddd0b){_0x2ddd0b=_0x2ddd0b||0xcc;return function(_0x59c59a){if(_0x59c59a){return _0x48bdce['sendStatus'](_0x2ddd0b);}return _0x48bdce[_0xd130('0x15')](_0x2ddd0b)[_0xd130('0x16')]();};}function respondWithResult(_0x18d24b,_0x1c5eb7){_0x1c5eb7=_0x1c5eb7||0xc8;return function(_0x42f354){if(_0x42f354){return _0x18d24b[_0xd130('0x15')](_0x1c5eb7)[_0xd130('0x17')](_0x42f354);}};}function respondWithFilteredResult(_0x36b948,_0x32c19e){return function(_0x1cef52){if(_0x1cef52){var _0x3f8808=typeof _0x32c19e[_0xd130('0x18')]===_0xd130('0x19')&&typeof _0x32c19e[_0xd130('0x1a')]===_0xd130('0x19');var _0x162183=_0x1cef52[_0xd130('0x1b')];var _0x2707c1=_0x3f8808?0x0:_0x32c19e['offset'];var _0x419605=_0x3f8808?_0x1cef52[_0xd130('0x1b')]:_0x32c19e[_0xd130('0x18')]+_0x32c19e[_0xd130('0x1a')];var _0x3cd5e2;if(_0x419605>=_0x162183){_0x419605=_0x162183;_0x3cd5e2=0xc8;}else{_0x3cd5e2=0xce;}_0x36b948[_0xd130('0x15')](_0x3cd5e2);return _0x36b948[_0xd130('0x1c')](_0xd130('0x1d'),_0x2707c1+'-'+_0x419605+'/'+_0x162183)[_0xd130('0x17')](_0x1cef52);}return null;};}function patchUpdates(_0x23b4b4){return function(_0x380283){try{jsonpatch[_0xd130('0x1e')](_0x380283,_0x23b4b4,!![]);}catch(_0x431e97){return BPromise[_0xd130('0x1f')](_0x431e97);}return _0x380283[_0xd130('0x20')]();};}function saveUpdates(_0x1cd8d8,_0x3fabd){return function(_0x54e365){if(_0x54e365){return _0x54e365[_0xd130('0x21')](_0x1cd8d8)[_0xd130('0x22')](function(_0x52e077){return _0x52e077;});}return null;};}function removeEntity(_0x3df0fc,_0x31945f){return function(_0x511482){if(_0x511482){return _0x511482[_0xd130('0x23')]()[_0xd130('0x22')](function(){var _0x1d684e=_0x511482['get']({'plain':!![]});var _0x2b2f05='IvrCampaigns';return db[_0xd130('0x24')]['destroy']({'where':{'type':_0x2b2f05,'resourceId':_0x1d684e['id']}})['then'](function(){return _0x511482;});})[_0xd130('0x22')](function(){_0x3df0fc[_0xd130('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1131a0,_0x4e9e23){return function(_0x29572c){if(!_0x29572c){_0x1131a0['sendStatus'](0x194);}return _0x29572c;};}function handleError(_0x3aad76,_0x9eb5cf){_0x9eb5cf=_0x9eb5cf||0x1f4;return function(_0x23b091){logger[_0xd130('0x25')](_0x23b091['stack']);if(_0x23b091[_0xd130('0x26')]){delete _0x23b091[_0xd130('0x26')];}_0x3aad76['status'](_0x9eb5cf)[_0xd130('0x27')](_0x23b091);};}exports[_0xd130('0x28')]=function(_0x3ea968,_0x297994){var _0x3a856f={},_0x2fd263={},_0xe36f42={'count':0x0,'rows':[]};var _0xa6061a=_[_0xd130('0x29')](db['Campaign'][_0xd130('0x2a')],function(_0x3c53d4){return{'name':_0x3c53d4[_0xd130('0x2b')],'type':_0x3c53d4['type'][_0xd130('0x2c')]};});_0x2fd263[_0xd130('0x2d')]=_[_0xd130('0x29')](_0xa6061a,_0xd130('0x26'));_0x2fd263['query']=_['keys'](_0x3ea968[_0xd130('0x2e')]);_0x2fd263['filters']=_[_0xd130('0x2f')](_0x2fd263[_0xd130('0x2d')],_0x2fd263[_0xd130('0x2e')]);_0x3a856f[_0xd130('0x30')]=_[_0xd130('0x2f')](_0x2fd263['model'],qs[_0xd130('0x31')](_0x3ea968['query'][_0xd130('0x31')]));_0x3a856f[_0xd130('0x30')]=_0x3a856f[_0xd130('0x30')][_0xd130('0x32')]?_0x3a856f['attributes']:_0x2fd263['model'];if(!_0x3ea968[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x3a856f[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x3ea968['query']['limit']);_0x3a856f['offset']=qs[_0xd130('0x18')](_0x3ea968[_0xd130('0x2e')][_0xd130('0x18')]);}_0x3a856f['order']=qs['sort'](_0x3ea968['query'][_0xd130('0x35')]);_0x3a856f[_0xd130('0x36')]=qs['filters'](_[_0xd130('0x37')](_0x3ea968[_0xd130('0x2e')],_0x2fd263[_0xd130('0x38')]),_0xa6061a);if(_0x3ea968[_0xd130('0x2e')][_0xd130('0x39')]){_0x3a856f[_0xd130('0x36')]=_['merge'](_0x3a856f['where'],{'$or':_[_0xd130('0x29')](_0xa6061a,function(_0x9cf755){if(_0x9cf755[_0xd130('0x3a')]!==_0xd130('0x3b')){var _0x1e4326={};_0x1e4326[_0x9cf755[_0xd130('0x26')]]={'$like':'%'+_0x3ea968[_0xd130('0x2e')]['filter']+'%'};return _0x1e4326;}})});}_0x3a856f=_[_0xd130('0x3c')]({},_0x3a856f,_0x3ea968[_0xd130('0x3d')]);var _0x2f7401={'where':_0x3a856f[_0xd130('0x36')]};return db[_0xd130('0x3e')][_0xd130('0x1b')](_0x2f7401)['then'](function(_0x1d9762){_0xe36f42[_0xd130('0x1b')]=_0x1d9762;if(_0x3ea968['query'][_0xd130('0x3f')]){_0x3a856f['include']=[{'all':!![]}];}return db[_0xd130('0x3e')][_0xd130('0x40')](_0x3a856f);})[_0xd130('0x22')](function(_0x12ac68){_0xe36f42[_0xd130('0x41')]=_0x12ac68;return _0xe36f42;})[_0xd130('0x22')](respondWithFilteredResult(_0x297994,_0x3a856f))[_0xd130('0x42')](handleError(_0x297994,null));};exports[_0xd130('0x43')]=function(_0x48c4ed,_0x3b431c){var _0x31d3bf={'raw':![],'where':{'id':_0x48c4ed[_0xd130('0x44')]['id']}},_0x549eb1={};_0x549eb1[_0xd130('0x2d')]=_['keys'](db['Campaign']['rawAttributes']);_0x549eb1['query']=_[_0xd130('0x45')](_0x48c4ed[_0xd130('0x2e')]);_0x549eb1[_0xd130('0x38')]=_[_0xd130('0x2f')](_0x549eb1['model'],_0x549eb1[_0xd130('0x2e')]);_0x31d3bf['attributes']=_[_0xd130('0x2f')](_0x549eb1[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x48c4ed[_0xd130('0x2e')]['fields']));_0x31d3bf[_0xd130('0x30')]=_0x31d3bf[_0xd130('0x30')][_0xd130('0x32')]?_0x31d3bf[_0xd130('0x30')]:_0x549eb1['model'];if(_0x48c4ed['query'][_0xd130('0x3f')]){_0x31d3bf[_0xd130('0x46')]=[{'all':!![]}];}_0x31d3bf=_[_0xd130('0x3c')]({},_0x31d3bf,_0x48c4ed[_0xd130('0x3d')]);return db[_0xd130('0x3e')][_0xd130('0x47')](_0x31d3bf)[_0xd130('0x22')](handleEntityNotFound(_0x3b431c,null))[_0xd130('0x22')](respondWithResult(_0x3b431c,null))[_0xd130('0x42')](handleError(_0x3b431c,null));};exports['create']=function(_0xb71194,_0x122543){return db[_0xd130('0x3e')][_0xd130('0x48')](_0xb71194['body'],{})[_0xd130('0x22')](function(_0x5a5fe3){var _0x53dd4c=_0xb71194[_0xd130('0x49')][_0xd130('0x4a')]({'plain':!![]});if(!_0x53dd4c)throw new Error(_0xd130('0x4b'));if(_0x53dd4c['role']===_0xd130('0x49')){var _0x1219e5=_0x5a5fe3[_0xd130('0x4a')]({'plain':!![]});var _0x23e951=_0xd130('0x4c');return db[_0xd130('0x4d')]['find']({'where':{'name':_0x23e951,'userProfileId':_0x53dd4c[_0xd130('0x4e')]},'raw':!![]})[_0xd130('0x22')](function(_0x424845){if(_0x424845&&_0x424845['autoAssociation']===0x0){return db[_0xd130('0x24')][_0xd130('0x48')]({'name':_0x1219e5['name'],'resourceId':_0x1219e5['id'],'type':_0x424845[_0xd130('0x26')],'sectionId':_0x424845['id']},{})[_0xd130('0x22')](function(){return _0x5a5fe3;});}else{return _0x5a5fe3;}})[_0xd130('0x42')](function(_0x455af1){logger[_0xd130('0x25')](_0xd130('0x4f'),_0x455af1);throw _0x455af1;});}return _0x5a5fe3;})[_0xd130('0x22')](respondWithResult(_0x122543,0xc9))[_0xd130('0x42')](handleError(_0x122543,null));};exports[_0xd130('0x50')]=function(_0x18030d,_0x48ba9c){var _0x187e91={'where':{'id':_0x18030d[_0xd130('0x44')]['id']}},_0x1ae903={};_0x1ae903[_0xd130('0x2d')]=_[_0xd130('0x45')](db['Campaign'][_0xd130('0x2a')]);_0x187e91['attributes']=_[_0xd130('0x2f')](_0x1ae903[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x18030d['query'][_0xd130('0x31')]));_0x187e91[_0xd130('0x30')]=_0x187e91[_0xd130('0x30')][_0xd130('0x32')]?_0x187e91[_0xd130('0x30')]:_0x1ae903['model'];if(_0x18030d[_0xd130('0x2e')][_0xd130('0x3f')]){_0x187e91[_0xd130('0x46')]=[{'all':!![]}];}_0x187e91=_[_0xd130('0x3c')]({},_0x187e91,_0x18030d[_0xd130('0x3d')]);return db[_0xd130('0x3e')]['find'](_0x187e91)[_0xd130('0x22')](handleEntityNotFound(_0x48ba9c,null))[_0xd130('0x22')](function(_0x34d7c3){if(_0x34d7c3){var _0xd4be77=_0x34d7c3['get']({'plain':!![]});_0xd4be77=qs['omit'](_0xd4be77,['id',_0xd130('0x51'),_0xd130('0x52')]);_0x18030d[_0xd130('0x53')]=_[_0xd130('0x54')](_0x18030d[_0xd130('0x53')],['id','createdAt',_0xd130('0x52')]);return db[_0xd130('0x3e')][_0xd130('0x48')](_[_0xd130('0x3c')](_0xd4be77,_0x18030d['body']),{'include':_0x18030d[_0xd130('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0xd130('0x22')](function(_0x157de4){var _0x4a713f=_0x18030d[_0xd130('0x49')]['get']({'plain':!![]});if(!_0x4a713f)throw new Error(_0xd130('0x4b'));if(_0x4a713f['role']===_0xd130('0x49')){var _0x34319a=_0x157de4[_0xd130('0x4a')]({'plain':!![]});var _0x2d31df='IvrCampaigns';return db['UserProfileSection'][_0xd130('0x47')]({'where':{'name':_0x2d31df,'userProfileId':_0x4a713f[_0xd130('0x4e')]},'raw':!![]})[_0xd130('0x22')](function(_0x1e242a){if(_0x1e242a&&_0x1e242a[_0xd130('0x55')]===0x0){return db[_0xd130('0x24')]['create']({'name':_0x34319a[_0xd130('0x26')],'resourceId':_0x34319a['id'],'type':_0x1e242a['name'],'sectionId':_0x1e242a['id']},{})[_0xd130('0x22')](function(){return _0x157de4;});}else{return _0x157de4;}})[_0xd130('0x42')](function(_0x326b48){logger[_0xd130('0x25')](_0xd130('0x4f'),_0x326b48);throw _0x326b48;});}return _0x157de4;});}})[_0xd130('0x22')](respondWithResult(_0x48ba9c,0xc9))[_0xd130('0x42')](handleError(_0x48ba9c,null));};exports[_0xd130('0x21')]=function(_0x46456f,_0x2b13){if(_0x46456f[_0xd130('0x53')]['id']){delete _0x46456f[_0xd130('0x53')]['id'];}return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x46456f[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x2b13,null))['then'](saveUpdates(_0x46456f['body'],null))[_0xd130('0x22')](respondWithResult(_0x2b13,null))[_0xd130('0x42')](handleError(_0x2b13,null));};exports[_0xd130('0x23')]=function(_0x3af558,_0xb16830){return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x3af558[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0xb16830,null))['then'](removeEntity(_0xb16830,null))['catch'](handleError(_0xb16830,null));};exports[_0xd130('0x56')]=function(_0x117131,_0x2dd2ae,_0x2528b3){var _0x592917={'raw':!![],'where':{}};var _0x482c0a={};var _0x4d38ed={'count':0x0,'rows':[]};return db[_0xd130('0x3e')][_0xd130('0x57')]({'where':{'id':_0x117131[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x2dd2ae,null))['then'](function(_0x4e155a){if(_0x4e155a){_0x482c0a[_0xd130('0x2d')]=_[_0xd130('0x45')](db[_0xd130('0x58')][_0xd130('0x2a')]);_0x482c0a[_0xd130('0x2e')]=_['keys'](_0x117131['query']);_0x482c0a['filters']=_[_0xd130('0x2f')](_0x482c0a[_0xd130('0x2d')],_0x482c0a[_0xd130('0x2e')]);_0x592917['attributes']=_[_0xd130('0x2f')](_0x482c0a[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x117131[_0xd130('0x2e')]['fields']));_0x592917[_0xd130('0x30')]=_0x592917[_0xd130('0x30')]['length']?_0x592917[_0xd130('0x30')]:_0x482c0a[_0xd130('0x2d')];if(!_0x117131[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x592917[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x117131[_0xd130('0x2e')][_0xd130('0x1a')]);_0x592917[_0xd130('0x18')]=qs[_0xd130('0x18')](_0x117131[_0xd130('0x2e')][_0xd130('0x18')]);}_0x592917['order']=qs[_0xd130('0x35')](_0x117131[_0xd130('0x2e')][_0xd130('0x35')]);_0x592917[_0xd130('0x36')]=qs['filters'](_[_0xd130('0x37')](_0x117131['query'],_0x482c0a[_0xd130('0x38')]));_0x592917[_0xd130('0x36')][_0xd130('0x59')]=_0x4e155a['id'];if(_0x117131[_0xd130('0x2e')]['filter']){_0x592917['where']=_[_0xd130('0x3c')](_0x592917[_0xd130('0x36')],{'$or':_[_0xd130('0x29')](_0x592917[_0xd130('0x30')],function(_0x19572d){var _0x141ff6={};_0x141ff6[_0x19572d]={'$like':'%'+_0x117131['query'][_0xd130('0x39')]+'%'};return _0x141ff6;})});}_0x592917=_[_0xd130('0x3c')]({},_0x592917,_0x117131[_0xd130('0x3d')]);return db[_0xd130('0x58')][_0xd130('0x1b')]({'where':_0x592917[_0xd130('0x36')]})[_0xd130('0x22')](function(_0x4949d0){_0x4d38ed[_0xd130('0x1b')]=_0x4949d0;if(_0x117131['query'][_0xd130('0x3f')]){_0x592917['include']=[{'all':!![]}];}return db[_0xd130('0x58')]['findAll'](_0x592917);})[_0xd130('0x22')](function(_0x14f916){_0x4d38ed['rows']=_0x14f916;return _0x4d38ed;});}})[_0xd130('0x22')](respondWithFilteredResult(_0x2dd2ae,_0x592917))[_0xd130('0x42')](handleError(_0x2dd2ae,null));};exports[_0xd130('0x5a')]=function(_0x211ba8,_0xd0dcc3,_0x5e0f71){var _0x7ca944={'raw':!![],'where':{}};var _0x43490c={};var _0x448e4e={'count':0x0,'rows':[]};return db[_0xd130('0x3e')]['findOne']({'where':{'id':_0x211ba8[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0xd0dcc3,null))[_0xd130('0x22')](function(_0x11500b){if(_0x11500b){_0x43490c[_0xd130('0x2d')]=_[_0xd130('0x45')](db[_0xd130('0x5b')]['rawAttributes']);_0x43490c[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x211ba8[_0xd130('0x2e')]);_0x43490c['filters']=_[_0xd130('0x2f')](_0x43490c[_0xd130('0x2d')],_0x43490c[_0xd130('0x2e')]);_0x7ca944['attributes']=_[_0xd130('0x2f')](_0x43490c['model'],qs[_0xd130('0x31')](_0x211ba8[_0xd130('0x2e')]['fields']));_0x7ca944[_0xd130('0x30')]=_0x7ca944[_0xd130('0x30')][_0xd130('0x32')]?_0x7ca944['attributes']:_0x43490c['model'];if(!_0x211ba8[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x7ca944[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x211ba8[_0xd130('0x2e')][_0xd130('0x1a')]);_0x7ca944[_0xd130('0x18')]=qs[_0xd130('0x18')](_0x211ba8[_0xd130('0x2e')][_0xd130('0x18')]);}_0x7ca944[_0xd130('0x5c')]=qs[_0xd130('0x35')](_0x211ba8[_0xd130('0x2e')]['sort']);_0x7ca944[_0xd130('0x36')]=qs[_0xd130('0x38')](_[_0xd130('0x37')](_0x211ba8[_0xd130('0x2e')],_0x43490c[_0xd130('0x38')]));_0x7ca944[_0xd130('0x36')][_0xd130('0x59')]=_0x11500b['id'];if(_0x211ba8[_0xd130('0x2e')][_0xd130('0x39')]){_0x7ca944['where']=_[_0xd130('0x3c')](_0x7ca944[_0xd130('0x36')],{'$or':_[_0xd130('0x29')](_0x7ca944['attributes'],function(_0x2d17b8){var _0x27e00d={};_0x27e00d[_0x2d17b8]={'$like':'%'+_0x211ba8['query'][_0xd130('0x39')]+'%'};return _0x27e00d;})});}_0x7ca944=_[_0xd130('0x3c')]({},_0x7ca944,_0x211ba8[_0xd130('0x3d')]);return db[_0xd130('0x5b')][_0xd130('0x1b')]({'where':_0x7ca944['where']})[_0xd130('0x22')](function(_0x2fa51a){_0x448e4e[_0xd130('0x1b')]=_0x2fa51a;if(_0x211ba8[_0xd130('0x2e')][_0xd130('0x3f')]){_0x7ca944[_0xd130('0x46')]=[{'all':!![]}];}return db[_0xd130('0x5b')]['findAll'](_0x7ca944);})[_0xd130('0x22')](function(_0x3ec735){_0x448e4e[_0xd130('0x41')]=_0x3ec735;return _0x448e4e;});}})[_0xd130('0x22')](respondWithFilteredResult(_0xd0dcc3,_0x7ca944))['catch'](handleError(_0xd0dcc3,null));};exports['getHopperFinals']=function(_0x335685,_0x147bb9,_0x391273){var _0x4adfe5={'raw':!![],'where':{}};var _0x2adca3={};var _0x55bf8d={'count':0x0,'rows':[]};return db[_0xd130('0x3e')][_0xd130('0x57')]({'where':{'id':_0x335685[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x147bb9,null))['then'](function(_0x50bc03){if(_0x50bc03){_0x2adca3[_0xd130('0x2d')]=_['keys'](db[_0xd130('0x5d')][_0xd130('0x2a')]);_0x2adca3[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x335685['query']);_0x2adca3[_0xd130('0x38')]=_[_0xd130('0x2f')](_0x2adca3[_0xd130('0x2d')],_0x2adca3[_0xd130('0x2e')]);_0x4adfe5[_0xd130('0x30')]=_[_0xd130('0x2f')](_0x2adca3['model'],qs[_0xd130('0x31')](_0x335685[_0xd130('0x2e')][_0xd130('0x31')]));_0x4adfe5[_0xd130('0x30')]=_0x4adfe5[_0xd130('0x30')][_0xd130('0x32')]?_0x4adfe5[_0xd130('0x30')]:_0x2adca3[_0xd130('0x2d')];if(!_0x335685[_0xd130('0x2e')]['hasOwnProperty']('nolimit')){_0x4adfe5[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x335685['query'][_0xd130('0x1a')]);_0x4adfe5[_0xd130('0x18')]=qs[_0xd130('0x18')](_0x335685[_0xd130('0x2e')][_0xd130('0x18')]);}_0x4adfe5['order']=qs[_0xd130('0x35')](_0x335685[_0xd130('0x2e')][_0xd130('0x35')]);_0x4adfe5[_0xd130('0x36')]=qs[_0xd130('0x38')](_[_0xd130('0x37')](_0x335685[_0xd130('0x2e')],_0x2adca3[_0xd130('0x38')]));_0x4adfe5[_0xd130('0x36')][_0xd130('0x59')]=_0x50bc03['id'];if(_0x335685[_0xd130('0x2e')][_0xd130('0x39')]){_0x4adfe5['where']=_[_0xd130('0x3c')](_0x4adfe5[_0xd130('0x36')],{'$or':_[_0xd130('0x29')](_0x4adfe5[_0xd130('0x30')],function(_0x4ae29a){var _0x2a1956={};_0x2a1956[_0x4ae29a]={'$like':'%'+_0x335685[_0xd130('0x2e')][_0xd130('0x39')]+'%'};return _0x2a1956;})});}_0x4adfe5=_['merge']({},_0x4adfe5,_0x335685[_0xd130('0x3d')]);return db[_0xd130('0x5d')]['count']({'where':_0x4adfe5[_0xd130('0x36')]})[_0xd130('0x22')](function(_0x431563){_0x55bf8d['count']=_0x431563;if(_0x335685[_0xd130('0x2e')][_0xd130('0x3f')]){_0x4adfe5['include']=[{'all':!![]}];}return db[_0xd130('0x5d')][_0xd130('0x40')](_0x4adfe5);})[_0xd130('0x22')](function(_0x3a96a6){_0x55bf8d[_0xd130('0x41')]=_0x3a96a6;return _0x55bf8d;});}})[_0xd130('0x22')](respondWithFilteredResult(_0x147bb9,_0x4adfe5))['catch'](handleError(_0x147bb9,null));};exports[_0xd130('0x5e')]=function(_0x1e04d4,_0x49a0dc,_0x361655){var _0x37fa20={'raw':!![],'where':{}};var _0x4b480b={};var _0x27833e={'count':0x0,'rows':[]};return db['Campaign'][_0xd130('0x57')]({'where':{'id':_0x1e04d4['params']['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x49a0dc,null))[_0xd130('0x22')](function(_0x46e36e){if(_0x46e36e){_0x4b480b[_0xd130('0x2d')]=_[_0xd130('0x45')](db[_0xd130('0x5f')][_0xd130('0x2a')]);_0x4b480b[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x1e04d4[_0xd130('0x2e')]);_0x4b480b[_0xd130('0x38')]=_[_0xd130('0x2f')](_0x4b480b[_0xd130('0x2d')],_0x4b480b[_0xd130('0x2e')]);_0x37fa20['attributes']=_[_0xd130('0x2f')](_0x4b480b[_0xd130('0x2d')],qs['fields'](_0x1e04d4[_0xd130('0x2e')]['fields']));_0x37fa20[_0xd130('0x30')]=_0x37fa20[_0xd130('0x30')][_0xd130('0x32')]?_0x37fa20['attributes']:_0x4b480b[_0xd130('0x2d')];if(!_0x1e04d4[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x37fa20['limit']=qs['limit'](_0x1e04d4[_0xd130('0x2e')]['limit']);_0x37fa20['offset']=qs[_0xd130('0x18')](_0x1e04d4[_0xd130('0x2e')][_0xd130('0x18')]);}_0x37fa20[_0xd130('0x5c')]=qs[_0xd130('0x35')](_0x1e04d4[_0xd130('0x2e')][_0xd130('0x35')]);_0x37fa20['where']=qs[_0xd130('0x38')](_[_0xd130('0x37')](_0x1e04d4[_0xd130('0x2e')],_0x4b480b[_0xd130('0x38')]));_0x37fa20[_0xd130('0x36')][_0xd130('0x59')]=_0x46e36e['id'];if(_0x1e04d4[_0xd130('0x2e')][_0xd130('0x39')]){_0x37fa20[_0xd130('0x36')]=_[_0xd130('0x3c')](_0x37fa20[_0xd130('0x36')],{'$or':_['map'](_0x37fa20[_0xd130('0x30')],function(_0x1b50a0){var _0x99ad05={};_0x99ad05[_0x1b50a0]={'$like':'%'+_0x1e04d4[_0xd130('0x2e')][_0xd130('0x39')]+'%'};return _0x99ad05;})});}_0x37fa20=_[_0xd130('0x3c')]({},_0x37fa20,_0x1e04d4[_0xd130('0x3d')]);return db[_0xd130('0x5f')]['count']({'where':_0x37fa20['where']})[_0xd130('0x22')](function(_0x2f7f1b){_0x27833e['count']=_0x2f7f1b;if(_0x1e04d4[_0xd130('0x2e')]['includeAll']){_0x37fa20[_0xd130('0x46')]=[{'all':!![]}];}return db[_0xd130('0x5f')][_0xd130('0x40')](_0x37fa20);})['then'](function(_0x229051){_0x27833e['rows']=_0x229051;return _0x27833e;});}})[_0xd130('0x22')](respondWithFilteredResult(_0x49a0dc,_0x37fa20))[_0xd130('0x42')](handleError(_0x49a0dc,null));};exports[_0xd130('0x60')]=function(_0x38b705,_0x446322,_0x24b442){var _0x2a484c={};var _0x2347e0={};var _0x45e088;var _0x511b93;return db[_0xd130('0x3e')]['findOne']({'where':{'id':_0x38b705[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x446322,null))[_0xd130('0x22')](function(_0x249eef){if(_0x249eef){_0x45e088=_0x249eef;_0x2347e0[_0xd130('0x2d')]=_[_0xd130('0x45')](db['CmList']['rawAttributes']);_0x2347e0[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x38b705['query']);_0x2347e0[_0xd130('0x38')]=_[_0xd130('0x2f')](_0x2347e0[_0xd130('0x2d')],_0x2347e0[_0xd130('0x2e')]);_0x2a484c[_0xd130('0x30')]=_['intersection'](_0x2347e0[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x38b705[_0xd130('0x2e')][_0xd130('0x31')]));_0x2a484c['attributes']=_0x2a484c[_0xd130('0x30')][_0xd130('0x32')]?_0x2a484c[_0xd130('0x30')]:_0x2347e0[_0xd130('0x2d')];_0x2a484c[_0xd130('0x5c')]=qs[_0xd130('0x35')](_0x38b705[_0xd130('0x2e')]['sort']);_0x2a484c['where']=qs[_0xd130('0x38')](_[_0xd130('0x37')](_0x38b705[_0xd130('0x2e')],_0x2347e0['filters']));if(_0x38b705['query'][_0xd130('0x39')]){_0x2a484c[_0xd130('0x36')]=_[_0xd130('0x3c')](_0x2a484c[_0xd130('0x36')],{'$or':_[_0xd130('0x29')](_0x2a484c[_0xd130('0x30')],function(_0x548809){var _0x522fda={};_0x522fda[_0x548809]={'$like':'%'+_0x38b705[_0xd130('0x2e')][_0xd130('0x39')]+'%'};return _0x522fda;})});}_0x2a484c=_[_0xd130('0x3c')]({},_0x2a484c,_0x38b705[_0xd130('0x3d')]);return _0x45e088['getLists'](_0x2a484c);}})[_0xd130('0x22')](function(_0x15e63b){if(_0x15e63b){_0x511b93=_0x15e63b[_0xd130('0x32')];if(!_0x38b705[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x2a484c[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x38b705[_0xd130('0x2e')][_0xd130('0x1a')]);_0x2a484c['offset']=qs[_0xd130('0x18')](_0x38b705['query'][_0xd130('0x18')]);}return _0x45e088[_0xd130('0x60')](_0x2a484c);}})[_0xd130('0x22')](function(_0x23bf5a){if(_0x23bf5a){return _0x23bf5a?{'count':_0x511b93,'rows':_0x23bf5a}:null;}})[_0xd130('0x22')](respondWithResult(_0x446322,null))['catch'](handleError(_0x446322,null));};exports['addLists']=function(_0x4ca984,_0x3ab103,_0x30492){var _0x34122c,_0x8a7ba9;return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x4ca984['params']['id']}})['then'](handleEntityNotFound(_0x3ab103,null))[_0xd130('0x22')](function(_0x2d971c){if(_0x2d971c){_0x8a7ba9=_0x2d971c;return _0x2d971c[_0xd130('0x61')](_0x4ca984['body'][_0xd130('0x62')],_[_0xd130('0x54')](_0x4ca984['body'],[_0xd130('0x62'),'id'])||{});}return null;})[_0xd130('0x63')](function(_0x37fcca){var _0x2f2848;_0x34122c=_0x37fcca||[];var _0x59d18b=[];if(_0x37fcca){for(var _0xf65d48=0x0;_0xf65d48<_0x37fcca[_0xd130('0x32')];_0xf65d48+=0x1){var _0x3ff20a=_0x37fcca[_0xf65d48]['get']({'plain':!![]});_0x8a7ba9['dialCheckDuplicateType']=_0x4ca984[_0xd130('0x53')][_0xd130('0x64')]?_0x4ca984['body'][_0xd130('0x64')]:_0x8a7ba9[_0xd130('0x64')];switch(_0x8a7ba9[_0xd130('0x64')]){case _0xd130('0x65'):_0x2f2848=squel[_0xd130('0x66')]()[_0xd130('0x67')](_0xd130('0x68'))[_0xd130('0x69')]([_0xd130('0x6a'),'scheduledAt',_0xd130('0x6b'),_0xd130('0x6c'),_0xd130('0x59'),_0xd130('0x51'),_0xd130('0x52')],squel[_0xd130('0x6d')]()[_0xd130('0x6e')](_0xd130('0x6a'),'phone')[_0xd130('0x6e')]('NOW()',_0xd130('0x6f'))['field']('id',_0xd130('0x6b'))[_0xd130('0x6e')](_0x3ff20a['CmListId'][_0xd130('0x70')](),_0xd130('0x6c'))[_0xd130('0x6e')](_0x4ca984[_0xd130('0x44')]['id']['toString'](),_0xd130('0x59'))['field'](_0xd130('0x71'),_0xd130('0x51'))[_0xd130('0x6e')]('NOW()',_0xd130('0x52'))[_0xd130('0x72')](_0xd130('0x73'))['where'](_0xd130('0x74'))['where'](_0xd130('0x75'),_0x3ff20a[_0xd130('0x76')][_0xd130('0x70')]())['where'](_0xd130('0x77'))[_0xd130('0x36')](_0xd130('0x78'),squel[_0xd130('0x6d')]()['field'](_0xd130('0x79'))['from']('cm_hopper_final')[_0xd130('0x36')](_0xd130('0x7a'),_0x4ca984[_0xd130('0x44')]['id'][_0xd130('0x70')]()))[_0xd130('0x36')](_0xd130('0x78'),squel[_0xd130('0x6d')]()['field'](_0xd130('0x7b'))[_0xd130('0x72')](_0xd130('0x68'))['where'](_0xd130('0x7a'),_0x4ca984[_0xd130('0x44')]['id'][_0xd130('0x70')]())))[_0xd130('0x70')]();break;case _0xd130('0x7c'):_0x2f2848=squel[_0xd130('0x66')]()[_0xd130('0x67')](_0xd130('0x68'))[_0xd130('0x69')]([_0xd130('0x6a'),_0xd130('0x6f'),_0xd130('0x6b'),_0xd130('0x6c'),_0xd130('0x59'),'createdAt',_0xd130('0x52')],squel[_0xd130('0x6d')]()[_0xd130('0x6e')]('phone',_0xd130('0x6a'))[_0xd130('0x6e')]('NOW()',_0xd130('0x6f'))['field']('id',_0xd130('0x6b'))[_0xd130('0x6e')](_0x3ff20a[_0xd130('0x76')][_0xd130('0x70')](),'ListId')['field'](_0x4ca984[_0xd130('0x44')]['id']['toString'](),_0xd130('0x59'))[_0xd130('0x6e')](_0xd130('0x71'),_0xd130('0x51'))[_0xd130('0x6e')](_0xd130('0x71'),'updatedAt')[_0xd130('0x72')](_0xd130('0x73'))[_0xd130('0x36')](_0xd130('0x74'))[_0xd130('0x36')](_0xd130('0x75'),_0x3ff20a['CmListId'][_0xd130('0x70')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xd130('0x36')](_0xd130('0x78'),squel[_0xd130('0x6d')]()[_0xd130('0x6e')]('COALESCE(phone,\x27\x27)')['from'](_0xd130('0x68'))[_0xd130('0x36')](_0xd130('0x7a'),_0x4ca984[_0xd130('0x44')]['id'][_0xd130('0x70')]())))['toString']();break;default:_0x2f2848=squel[_0xd130('0x66')]()[_0xd130('0x67')]('cm_hopper')[_0xd130('0x69')]([_0xd130('0x6a'),_0xd130('0x6f'),_0xd130('0x6b'),_0xd130('0x6c'),'CampaignId',_0xd130('0x51'),_0xd130('0x52')],squel[_0xd130('0x6d')]()[_0xd130('0x6e')]('phone',_0xd130('0x6a'))[_0xd130('0x6e')](_0xd130('0x71'),'scheduledAt')[_0xd130('0x6e')]('id',_0xd130('0x6b'))[_0xd130('0x6e')](_0x3ff20a[_0xd130('0x76')][_0xd130('0x70')](),_0xd130('0x6c'))[_0xd130('0x6e')](_0x4ca984[_0xd130('0x44')]['id'][_0xd130('0x70')](),'CampaignId')[_0xd130('0x6e')](_0xd130('0x71'),_0xd130('0x51'))['field'](_0xd130('0x71'),_0xd130('0x52'))['from'](_0xd130('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0xd130('0x36')](_0xd130('0x75'),_0x3ff20a[_0xd130('0x76')][_0xd130('0x70')]())[_0xd130('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0xd130('0x70')]();}_0x59d18b[_0xd130('0x7d')](db[_0xd130('0x7e')][_0xd130('0x2e')](_0x2f2848));}return BPromise[_0xd130('0x7f')](_0x59d18b);}})[_0xd130('0x22')](function(){return _0x34122c;})[_0xd130('0x22')](respondWithResult(_0x3ab103,null))[_0xd130('0x42')](handleError(_0x3ab103,null));};exports[_0xd130('0x80')]=function(_0xe34932,_0x36e3ce,_0x2f1a71){return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0xe34932[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x36e3ce,null))[_0xd130('0x22')](function(_0x15c756){if(_0x15c756){return _0x15c756[_0xd130('0x80')](_0xe34932[_0xd130('0x2e')][_0xd130('0x62')]);}})['then'](function(_0x115cb5){if(_0x115cb5){return db['CmHopper'][_0xd130('0x23')]({'where':{'ListId':_0xe34932[_0xd130('0x2e')][_0xd130('0x62')],'CampaignId':_0xe34932[_0xd130('0x44')]['id']}})[_0xd130('0x22')](function(){return _0x115cb5;});}})[_0xd130('0x22')](respondWithStatusCode(_0x36e3ce,null))[_0xd130('0x42')](handleError(_0x36e3ce,null));};exports['getBlackLists']=function(_0x345164,_0x293e03,_0x32755c){var _0x540dbc={};var _0x206c23={};var _0xdcd2ec;var _0x413bb9;return db[_0xd130('0x3e')]['findOne']({'where':{'id':_0x345164[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x293e03,null))['then'](function(_0x56401d){if(_0x56401d){_0xdcd2ec=_0x56401d;_0x206c23[_0xd130('0x2d')]=_['keys'](db['CmList'][_0xd130('0x2a')]);_0x206c23[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x345164[_0xd130('0x2e')]);_0x206c23[_0xd130('0x38')]=_['intersection'](_0x206c23[_0xd130('0x2d')],_0x206c23['query']);_0x540dbc['attributes']=_['intersection'](_0x206c23[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x345164[_0xd130('0x2e')][_0xd130('0x31')]));_0x540dbc[_0xd130('0x30')]=_0x540dbc[_0xd130('0x30')][_0xd130('0x32')]?_0x540dbc[_0xd130('0x30')]:_0x206c23[_0xd130('0x2d')];_0x540dbc[_0xd130('0x5c')]=qs['sort'](_0x345164['query']['sort']);_0x540dbc[_0xd130('0x36')]=qs[_0xd130('0x38')](_['pick'](_0x345164[_0xd130('0x2e')],_0x206c23['filters']));if(_0x345164['query'][_0xd130('0x39')]){_0x540dbc[_0xd130('0x36')]=_[_0xd130('0x3c')](_0x540dbc['where'],{'$or':_[_0xd130('0x29')](_0x540dbc['attributes'],function(_0x2ecbfe){var _0x2757dc={};_0x2757dc[_0x2ecbfe]={'$like':'%'+_0x345164[_0xd130('0x2e')][_0xd130('0x39')]+'%'};return _0x2757dc;})});}_0x540dbc=_[_0xd130('0x3c')]({},_0x540dbc,_0x345164[_0xd130('0x3d')]);return _0xdcd2ec[_0xd130('0x81')](_0x540dbc);}})[_0xd130('0x22')](function(_0x50170c){if(_0x50170c){_0x413bb9=_0x50170c['length'];if(!_0x345164['query'][_0xd130('0x33')](_0xd130('0x34'))){_0x540dbc['limit']=qs[_0xd130('0x1a')](_0x345164['query'][_0xd130('0x1a')]);_0x540dbc[_0xd130('0x18')]=qs[_0xd130('0x18')](_0x345164[_0xd130('0x2e')]['offset']);}return _0xdcd2ec[_0xd130('0x81')](_0x540dbc);}})[_0xd130('0x22')](function(_0xd7fc21){if(_0xd7fc21){return _0xd7fc21?{'count':_0x413bb9,'rows':_0xd7fc21}:null;}})[_0xd130('0x22')](respondWithResult(_0x293e03,null))[_0xd130('0x42')](handleError(_0x293e03,null));};exports[_0xd130('0x82')]=function(_0x4f8d48,_0xd049d2,_0x148b61){var _0x17e0ae,_0x129d94;return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x4f8d48['params']['id']}})[_0xd130('0x22')](handleEntityNotFound(_0xd049d2,null))[_0xd130('0x22')](function(_0x428141){if(_0x428141){_0x129d94=_0x428141;return _0x428141[_0xd130('0x82')](_0x4f8d48['body'][_0xd130('0x62')],_['omit'](_0x4f8d48[_0xd130('0x53')],[_0xd130('0x62'),'id'])||{});}return null;})['spread'](function(_0x169966){var _0x23479d;_0x17e0ae=_0x169966||[];var _0x5d7539=[];if(_0x169966){for(var _0x42a085=0x0;_0x42a085<_0x169966[_0xd130('0x32')];_0x42a085+=0x1){var _0x4a321b=_0x169966[_0x42a085][_0xd130('0x4a')]({'plain':!![]});_0x23479d=squel[_0xd130('0x66')]()[_0xd130('0x67')](_0xd130('0x83'))[_0xd130('0x69')]([_0xd130('0x6a'),_0xd130('0x6b'),_0xd130('0x6c'),_0xd130('0x59'),_0xd130('0x51'),'updatedAt'],squel[_0xd130('0x6d')]()[_0xd130('0x6e')](_0xd130('0x6a'),_0xd130('0x6a'))['field']('id',_0xd130('0x6b'))[_0xd130('0x6e')](_0x4a321b['CmListId'][_0xd130('0x70')](),_0xd130('0x6c'))['field'](_0x4f8d48['params']['id'][_0xd130('0x70')](),_0xd130('0x59'))[_0xd130('0x6e')](_0xd130('0x71'),_0xd130('0x51'))[_0xd130('0x6e')]('NOW()',_0xd130('0x52'))[_0xd130('0x72')](_0xd130('0x73'))[_0xd130('0x36')](_0xd130('0x74'))['where']('ListId\x20=\x20?',_0x4a321b['CmListId'][_0xd130('0x70')]())[_0xd130('0x36')](_0xd130('0x77')))[_0xd130('0x70')]();_0x5d7539[_0xd130('0x7d')](db[_0xd130('0x7e')][_0xd130('0x2e')](_0x23479d));}return BPromise[_0xd130('0x7f')](_0x5d7539);}})[_0xd130('0x22')](function(){return _0x17e0ae;})[_0xd130('0x22')](respondWithResult(_0xd049d2,null))[_0xd130('0x42')](handleError(_0xd049d2,null));};exports[_0xd130('0x84')]=function(_0x40fee1,_0x1314f6,_0x4ffde5){return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x40fee1['params']['id']}})['then'](handleEntityNotFound(_0x1314f6,null))['then'](function(_0x18cfba){if(_0x18cfba){return _0x18cfba[_0xd130('0x84')](_0x40fee1[_0xd130('0x2e')][_0xd130('0x62')]);}})['then'](function(_0x2d1eb9){if(_0x2d1eb9){return db[_0xd130('0x5f')][_0xd130('0x23')]({'where':{'ListId':_0x40fee1[_0xd130('0x2e')]['ids'],'CampaignId':_0x40fee1[_0xd130('0x44')]['id']}})[_0xd130('0x22')](function(){return _0x2d1eb9;});}})[_0xd130('0x22')](respondWithStatusCode(_0x1314f6,null))[_0xd130('0x42')](handleError(_0x1314f6,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 2d8c3b8..09201ce 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(_0x4119bf,_0x2e4b8e){var _0xcd3e8f=function(_0x567d5b){while(--_0x567d5b){_0x4119bf['push'](_0x4119bf['shift']());}};_0xcd3e8f(++_0x2e4b8e);}(_0x7a54,0x106));var _0x47a5=function(_0x252b6b,_0x41fadd){_0x252b6b=_0x252b6b-0x0;var _0x5040dc=_0x7a54[_0x252b6b];return _0x5040dc;};'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(_0xd3ac55,_0x3915b6){var _0x526e60=function(_0x10ac01){while(--_0x10ac01){_0xd3ac55['push'](_0xd3ac55['shift']());}};_0x526e60(++_0x3915b6);}(_0x7a54,0x106));var _0x47a5=function(_0x2442d0,_0x347f56){_0x2442d0=_0x2442d0-0x0;var _0x344d5f=_0x7a54[_0x2442d0];return _0x344d5f;};'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 fdd3309..c204198 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 _0xda55=['Campaign','findAll','options','raw','where','attributes','limit','map','include','model','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCampaign'];(function(_0x281157,_0x1d4f3d){var _0x1f9fff=function(_0x722bdf){while(--_0x722bdf){_0x281157['push'](_0x281157['shift']());}};_0x1f9fff(++_0x1d4f3d);}(_0xda55,0x6d));var _0x5da5=function(_0xfb675c,_0x2cfb12){_0xfb675c=_0xfb675c-0x0;var _0x56179a=_0xda55[_0xfb675c];return _0x56179a;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('Campaign,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});}exports[_0x5da5('0x16')]=function(_0x16b11f){var _0x3f7e98=this;return new Promise(function(_0x428b07,_0x547c58){return db[_0x5da5('0x17')][_0x5da5('0x18')]({'raw':_0x16b11f[_0x5da5('0x19')]?_0x16b11f[_0x5da5('0x19')][_0x5da5('0x1a')]===undefined?!![]:![]:!![],'where':_0x16b11f['options']?_0x16b11f[_0x5da5('0x19')][_0x5da5('0x1b')]||null:null,'attributes':_0x16b11f[_0x5da5('0x19')]?_0x16b11f['options'][_0x5da5('0x1c')]||null:null,'limit':_0x16b11f[_0x5da5('0x19')]?_0x16b11f[_0x5da5('0x19')][_0x5da5('0x1d')]||null:null,'include':_0x16b11f[_0x5da5('0x19')]?_0x16b11f[_0x5da5('0x19')]['include']?_[_0x5da5('0x1e')](_0x16b11f['options'][_0x5da5('0x1f')],function(_0x716ab7){return{'model':db[_0x716ab7[_0x5da5('0x20')]],'as':_0x716ab7['as'],'attributes':_0x716ab7['attributes'],'include':_0x716ab7[_0x5da5('0x1f')]?_[_0x5da5('0x1e')](_0x716ab7[_0x5da5('0x1f')],function(_0x21e795){return{'model':db[_0x21e795['model']],'as':_0x21e795['as'],'attributes':_0x21e795['attributes'],'include':_0x21e795['include']?_[_0x5da5('0x1e')](_0x21e795['include'],function(_0x4e8890){return{'model':db[_0x4e8890[_0x5da5('0x20')]],'as':_0x4e8890['as'],'attributes':_0x4e8890[_0x5da5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1798ae){logger[_0x5da5('0x13')]('GetCampaign',_0x16b11f);logger[_0x5da5('0xd')](_0x5da5('0x16'),_0x16b11f,JSON[_0x5da5('0xf')](_0x1798ae));_0x428b07(_0x1798ae);})[_0x5da5('0x15')](function(_0x766ed9){logger['error'](_0x5da5('0x16'),_0x766ed9[_0x5da5('0x12')],_0x16b11f);_0x547c58(_0x3f7e98[_0x5da5('0x10')](0x1f4,_0x766ed9[_0x5da5('0x12')]));});});}; \ No newline at end of file +var _0x8f37=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','limit','include','map','attributes','model','then','lodash','util','moment'];(function(_0x15e634,_0x28558e){var _0x4d5d95=function(_0x5c3a6f){while(--_0x5c3a6f){_0x15e634['push'](_0x15e634['shift']());}};_0x4d5d95(++_0x28558e);}(_0x8f37,0x190));var _0x78f3=function(_0x1c8c47,_0x3bad79){_0x1c8c47=_0x1c8c47-0x0;var _0x3a7f35=_0x8f37[_0x1c8c47];return _0x3a7f35;};'use strict';var _=require(_0x78f3('0x0'));var util=require(_0x78f3('0x1'));var moment=require(_0x78f3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78f3('0x3'));var db=require(_0x78f3('0x4'))['db'];var utils=require(_0x78f3('0x5'));var logger=require('../../config/logger')(_0x78f3('0x6'));var config=require('../../config/environment');var jayson=require(_0x78f3('0x7'));var client=jayson['client'][_0x78f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc185,_0x492dc7,_0x58bd73){return new BPromise(function(_0x55e353,_0x35d861){return client[_0x78f3('0x9')](_0x3dc185,_0x58bd73)['then'](function(_0x20c081){logger[_0x78f3('0xa')](_0x78f3('0xb'),_0x492dc7,_0x78f3('0xc'));logger[_0x78f3('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x492dc7,_0x78f3('0xc'),JSON[_0x78f3('0xe')](_0x20c081));if(_0x20c081['error']){if(_0x20c081[_0x78f3('0xf')][_0x78f3('0x10')]===0x1f4){logger[_0x78f3('0xf')]('Campaign,\x20%s,\x20%s',_0x492dc7,_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);return _0x35d861(_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);}logger[_0x78f3('0xf')](_0x78f3('0xb'),_0x492dc7,_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);return _0x55e353(_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);}else{logger[_0x78f3('0xa')](_0x78f3('0xb'),_0x492dc7,_0x78f3('0xc'));_0x55e353(_0x20c081[_0x78f3('0x12')][_0x78f3('0x11')]);}})[_0x78f3('0x13')](function(_0x39adfc){logger[_0x78f3('0xf')](_0x78f3('0xb'),_0x492dc7,_0x39adfc);_0x35d861(_0x39adfc);});});}exports[_0x78f3('0x14')]=function(_0x3c76d2){var _0x1c25f2=this;return new Promise(function(_0x225176,_0x4a5db4){return db[_0x78f3('0x15')][_0x78f3('0x16')]({'raw':_0x3c76d2['options']?_0x3c76d2['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c76d2[_0x78f3('0x17')]?_0x3c76d2[_0x78f3('0x17')][_0x78f3('0x18')]||null:null,'attributes':_0x3c76d2[_0x78f3('0x17')]?_0x3c76d2[_0x78f3('0x17')]['attributes']||null:null,'limit':_0x3c76d2[_0x78f3('0x17')]?_0x3c76d2[_0x78f3('0x17')][_0x78f3('0x19')]||null:null,'include':_0x3c76d2[_0x78f3('0x17')]?_0x3c76d2[_0x78f3('0x17')][_0x78f3('0x1a')]?_[_0x78f3('0x1b')](_0x3c76d2[_0x78f3('0x17')][_0x78f3('0x1a')],function(_0x3c6bf8){return{'model':db[_0x3c6bf8['model']],'as':_0x3c6bf8['as'],'attributes':_0x3c6bf8[_0x78f3('0x1c')],'include':_0x3c6bf8[_0x78f3('0x1a')]?_['map'](_0x3c6bf8[_0x78f3('0x1a')],function(_0x238001){return{'model':db[_0x238001[_0x78f3('0x1d')]],'as':_0x238001['as'],'attributes':_0x238001[_0x78f3('0x1c')],'include':_0x238001[_0x78f3('0x1a')]?_['map'](_0x238001[_0x78f3('0x1a')],function(_0x197837){return{'model':db[_0x197837[_0x78f3('0x1d')]],'as':_0x197837['as'],'attributes':_0x197837[_0x78f3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x78f3('0x1e')](function(_0x54d5ae){logger[_0x78f3('0xa')](_0x78f3('0x14'),_0x3c76d2);logger[_0x78f3('0xd')](_0x78f3('0x14'),_0x3c76d2,JSON[_0x78f3('0xe')](_0x54d5ae));_0x225176(_0x54d5ae);})[_0x78f3('0x13')](function(_0x2de1bb){logger[_0x78f3('0xf')](_0x78f3('0x14'),_0x2de1bb[_0x78f3('0x11')],_0x3c76d2);_0x4a5db4(_0x1c25f2[_0x78f3('0xf')](0x1f4,_0x2de1bb[_0x78f3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 1bce8e2..d7241c6 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 _0xf908=['getLists','/:id/blacklists','getBlackLists','post','create','clone','addBlackLists','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists'];(function(_0x3554fa,_0x32f0ad){var _0x5df0b3=function(_0x15181e){while(--_0x15181e){_0x3554fa['push'](_0x3554fa['shift']());}};_0x5df0b3(++_0x32f0ad);}(_0xf908,0x1b0));var _0x8f90=function(_0xf7980e,_0x373627){_0xf7980e=_0xf7980e-0x0;var _0x4a4be4=_0xf908[_0xf7980e];return _0x4a4be4;};'use strict';var multer=require(_0x8f90('0x0'));var util=require(_0x8f90('0x1'));var path=require(_0x8f90('0x2'));var timeout=require(_0x8f90('0x3'));var express=require(_0x8f90('0x4'));var router=express[_0x8f90('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8f90('0x6'));var interaction=require(_0x8f90('0x7'));var config=require(_0x8f90('0x8'));var controller=require(_0x8f90('0x9'));router[_0x8f90('0xa')]('/',auth[_0x8f90('0xb')](),controller[_0x8f90('0xc')]);router[_0x8f90('0xa')](_0x8f90('0xd'),auth[_0x8f90('0xb')](),controller[_0x8f90('0xe')]);router[_0x8f90('0xa')](_0x8f90('0xf'),auth[_0x8f90('0xb')](),controller[_0x8f90('0x10')]);router['get'](_0x8f90('0x11'),auth[_0x8f90('0xb')](),controller[_0x8f90('0x12')]);router[_0x8f90('0xa')](_0x8f90('0x13'),auth['isAuthenticated'](),controller[_0x8f90('0x14')]);router[_0x8f90('0xa')](_0x8f90('0x15'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x8f90('0xa')](_0x8f90('0x16'),auth['isAuthenticated'](),controller[_0x8f90('0x17')]);router[_0x8f90('0xa')](_0x8f90('0x18'),auth['isAuthenticated'](),controller[_0x8f90('0x19')]);router[_0x8f90('0x1a')]('/',auth[_0x8f90('0xb')](),controller[_0x8f90('0x1b')]);router[_0x8f90('0x1a')]('/:id/clone',auth[_0x8f90('0xb')](),controller[_0x8f90('0x1c')]);router[_0x8f90('0x1a')](_0x8f90('0x16'),auth[_0x8f90('0xb')](),controller['addLists']);router[_0x8f90('0x1a')]('/:id/blacklists',auth[_0x8f90('0xb')](),controller[_0x8f90('0x1d')]);router['put'](_0x8f90('0xd'),auth[_0x8f90('0xb')](),controller[_0x8f90('0x1e')]);router[_0x8f90('0x1f')]('/:id',auth[_0x8f90('0xb')](),controller['destroy']);router['delete'](_0x8f90('0x16'),auth[_0x8f90('0xb')](),controller[_0x8f90('0x20')]);router[_0x8f90('0x1f')](_0x8f90('0x18'),auth['isAuthenticated'](),controller[_0x8f90('0x21')]);module[_0x8f90('0x22')]=router; \ No newline at end of file +var _0x710b=['removeBlackLists','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','addLists','addBlackLists','put','delete','destroy','removeLists'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x710b,0x110));var _0xb710=function(_0x1fac98,_0x3a615e){_0x1fac98=_0x1fac98-0x0;var _0x56dfff=_0x710b[_0x1fac98];return _0x56dfff;};'use strict';var multer=require(_0xb710('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb710('0x1'));var express=require(_0xb710('0x2'));var router=express[_0xb710('0x3')]();var fs_extra=require(_0xb710('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb710('0x5'));var config=require(_0xb710('0x6'));var controller=require(_0xb710('0x7'));router[_0xb710('0x8')]('/',auth[_0xb710('0x9')](),controller['index']);router[_0xb710('0x8')](_0xb710('0xa'),auth['isAuthenticated'](),controller[_0xb710('0xb')]);router[_0xb710('0x8')]('/:id/hoppers',auth[_0xb710('0x9')](),controller[_0xb710('0xc')]);router['get']('/:id/hopper_histories',auth[_0xb710('0x9')](),controller[_0xb710('0xd')]);router[_0xb710('0x8')]('/:id/hopper_finals',auth[_0xb710('0x9')](),controller[_0xb710('0xe')]);router['get'](_0xb710('0xf'),auth[_0xb710('0x9')](),controller[_0xb710('0x10')]);router[_0xb710('0x8')](_0xb710('0x11'),auth['isAuthenticated'](),controller[_0xb710('0x12')]);router[_0xb710('0x8')](_0xb710('0x13'),auth[_0xb710('0x9')](),controller['getBlackLists']);router[_0xb710('0x14')]('/',auth[_0xb710('0x9')](),controller[_0xb710('0x15')]);router['post']('/:id/clone',auth[_0xb710('0x9')](),controller['clone']);router[_0xb710('0x14')](_0xb710('0x11'),auth[_0xb710('0x9')](),controller[_0xb710('0x16')]);router[_0xb710('0x14')](_0xb710('0x13'),auth[_0xb710('0x9')](),controller[_0xb710('0x17')]);router[_0xb710('0x18')](_0xb710('0xa'),auth[_0xb710('0x9')](),controller['update']);router[_0xb710('0x19')](_0xb710('0xa'),auth[_0xb710('0x9')](),controller[_0xb710('0x1a')]);router[_0xb710('0x19')](_0xb710('0x11'),auth[_0xb710('0x9')](),controller[_0xb710('0x1b')]);router['delete'](_0xb710('0x13'),auth[_0xb710('0x9')](),controller[_0xb710('0x1c')]);module[_0xb710('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ad8cca0..3e6e8eb 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 _0xd311=['exports','TEXT','VIRTUAL','getDataValue','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd311,0xa4));var _0x1d31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd311[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1d31('0x0'));module[_0x1d31('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x1d31('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x1d31('0x3')],'get':function(){return this[_0x1d31('0x4')]('key');}}}; \ No newline at end of file +var _0xbd6c=['STRING','key','sequelize','exports'];(function(_0x3ec2ff,_0x5f0ef2){var _0x5b4a2e=function(_0x2ddd34){while(--_0x2ddd34){_0x3ec2ff['push'](_0x3ec2ff['shift']());}};_0x5b4a2e(++_0x5f0ef2);}(_0xbd6c,0xaa));var _0xcbd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbd6c[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xcbd6('0x0'));module[_0xcbd6('0x1')]={'key':{'type':Sequelize[_0xcbd6('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xcbd6('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xcbd6('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 4923473..b811a33 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 _0xcc7c=['hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','find','body','params','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','query','keys','filters','model','attributes','fields'];(function(_0x1b5c07,_0x18f64e){var _0x472d4f=function(_0x5420e3){while(--_0x5420e3){_0x1b5c07['push'](_0x1b5c07['shift']());}};_0x472d4f(++_0x18f64e);}(_0xcc7c,0x16f));var _0xccc7=function(_0x11b7db,_0x4567f1){_0x11b7db=_0x11b7db-0x0;var _0x50723e=_0xcc7c[_0x11b7db];return _0x50723e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xccc7('0x0'));var zipdir=require(_0xccc7('0x1'));var jsonpatch=require(_0xccc7('0x2'));var rp=require(_0xccc7('0x3'));var moment=require('moment');var BPromise=require(_0xccc7('0x4'));var Mustache=require(_0xccc7('0x5'));var util=require(_0xccc7('0x6'));var path=require(_0xccc7('0x7'));var sox=require(_0xccc7('0x8'));var csv=require(_0xccc7('0x9'));var ejs=require(_0xccc7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xccc7('0xb'));var squel=require(_0xccc7('0xc'));var crypto=require(_0xccc7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xccc7('0xe'));var toCsv=require(_0xccc7('0x9'));var querystring=require('querystring');var Papa=require(_0xccc7('0xf'));var Redis=require(_0xccc7('0x10'));var authService=require(_0xccc7('0x11'));var qs=require(_0xccc7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccc7('0x13'));var logger=require(_0xccc7('0x14'))('api');var utils=require(_0xccc7('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x323671,_0x3a0cbf){_0x3a0cbf=_0x3a0cbf||0xcc;return function(_0x405ad1){if(_0x405ad1){return _0x323671[_0xccc7('0x16')](_0x3a0cbf);}return _0x323671[_0xccc7('0x17')](_0x3a0cbf)[_0xccc7('0x18')]();};}function respondWithResult(_0x15e788,_0x99346d){_0x99346d=_0x99346d||0xc8;return function(_0x1e7916){if(_0x1e7916){return _0x15e788[_0xccc7('0x17')](_0x99346d)[_0xccc7('0x19')](_0x1e7916);}};}function respondWithFilteredResult(_0x995ed8,_0x3c44c7){return function(_0x332379){if(_0x332379){var _0x11e6d5=typeof _0x3c44c7[_0xccc7('0x1a')]===_0xccc7('0x1b')&&typeof _0x3c44c7['limit']==='undefined';var _0x350e0b=_0x332379[_0xccc7('0x1c')];var _0x380728=_0x11e6d5?0x0:_0x3c44c7[_0xccc7('0x1a')];var _0x5c8bd5=_0x11e6d5?_0x332379[_0xccc7('0x1c')]:_0x3c44c7[_0xccc7('0x1a')]+_0x3c44c7[_0xccc7('0x1d')];var _0x33940a;if(_0x5c8bd5>=_0x350e0b){_0x5c8bd5=_0x350e0b;_0x33940a=0xc8;}else{_0x33940a=0xce;}_0x995ed8[_0xccc7('0x17')](_0x33940a);return _0x995ed8[_0xccc7('0x1e')](_0xccc7('0x1f'),_0x380728+'-'+_0x5c8bd5+'/'+_0x350e0b)[_0xccc7('0x19')](_0x332379);}return null;};}function patchUpdates(_0x2c5dfc){return function(_0xe20ec8){try{jsonpatch[_0xccc7('0x20')](_0xe20ec8,_0x2c5dfc,!![]);}catch(_0x52d160){return BPromise[_0xccc7('0x21')](_0x52d160);}return _0xe20ec8[_0xccc7('0x22')]();};}function saveUpdates(_0x5235e1,_0x33cb93){return function(_0x2c7693){if(_0x2c7693){return _0x2c7693[_0xccc7('0x23')](_0x5235e1)[_0xccc7('0x24')](function(_0x2121ae){return _0x2121ae;});}return null;};}function removeEntity(_0xe4b095,_0x20ad13){return function(_0x49f4b5){if(_0x49f4b5){return _0x49f4b5[_0xccc7('0x25')]()['then'](function(){var _0x2da8f5=_0x49f4b5['get']({'plain':!![]});var _0x375d1e='CannedAnswers';return db[_0xccc7('0x26')][_0xccc7('0x25')]({'where':{'type':_0x375d1e,'resourceId':_0x2da8f5['id']}})[_0xccc7('0x24')](function(){return _0x49f4b5;});})[_0xccc7('0x24')](function(){_0xe4b095['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc426e6,_0x37c605){return function(_0x4ee0e7){if(!_0x4ee0e7){_0xc426e6[_0xccc7('0x16')](0x194);}return _0x4ee0e7;};}function handleError(_0x431214,_0x285f55){_0x285f55=_0x285f55||0x1f4;return function(_0x239081){logger[_0xccc7('0x27')](_0x239081[_0xccc7('0x28')]);if(_0x239081[_0xccc7('0x29')]){delete _0x239081[_0xccc7('0x29')];}_0x431214[_0xccc7('0x17')](_0x285f55)[_0xccc7('0x2a')](_0x239081);};}exports[_0xccc7('0x2b')]=function(_0x40b904,_0x4fe601){var _0x3b43f8={},_0xadde01={},_0x7b7166={'count':0x0,'rows':[]};var _0x397274=_[_0xccc7('0x2c')](db[_0xccc7('0x2d')][_0xccc7('0x2e')],function(_0x3a6298){return{'name':_0x3a6298['fieldName'],'type':_0x3a6298['type']['key']};});_0xadde01['model']=_[_0xccc7('0x2c')](_0x397274,_0xccc7('0x29'));_0xadde01[_0xccc7('0x2f')]=_[_0xccc7('0x30')](_0x40b904[_0xccc7('0x2f')]);_0xadde01[_0xccc7('0x31')]=_['intersection'](_0xadde01[_0xccc7('0x32')],_0xadde01[_0xccc7('0x2f')]);_0x3b43f8[_0xccc7('0x33')]=_['intersection'](_0xadde01[_0xccc7('0x32')],qs[_0xccc7('0x34')](_0x40b904[_0xccc7('0x2f')][_0xccc7('0x34')]));_0x3b43f8['attributes']=_0x3b43f8[_0xccc7('0x33')]['length']?_0x3b43f8[_0xccc7('0x33')]:_0xadde01[_0xccc7('0x32')];if(!_0x40b904[_0xccc7('0x2f')][_0xccc7('0x35')](_0xccc7('0x36'))){_0x3b43f8[_0xccc7('0x1d')]=qs['limit'](_0x40b904[_0xccc7('0x2f')][_0xccc7('0x1d')]);_0x3b43f8['offset']=qs[_0xccc7('0x1a')](_0x40b904[_0xccc7('0x2f')][_0xccc7('0x1a')]);}_0x3b43f8[_0xccc7('0x37')]=qs[_0xccc7('0x38')](_0x40b904[_0xccc7('0x2f')][_0xccc7('0x38')]);_0x3b43f8[_0xccc7('0x39')]=qs['filters'](_[_0xccc7('0x3a')](_0x40b904['query'],_0xadde01['filters']),_0x397274);if(_0x40b904[_0xccc7('0x2f')]['filter']){_0x3b43f8['where']=_[_0xccc7('0x3b')](_0x3b43f8[_0xccc7('0x39')],{'$or':[{'key':{'$like':'%'+_0x40b904[_0xccc7('0x2f')][_0xccc7('0x3c')]+'%'}},{'value':{'$like':'%'+_0x40b904[_0xccc7('0x2f')][_0xccc7('0x3c')]+'%'}}]});}_0x3b43f8=_[_0xccc7('0x3b')]({},_0x3b43f8,_0x40b904[_0xccc7('0x3d')]);var _0x5e000e={'where':_0x3b43f8['where']};return db[_0xccc7('0x2d')][_0xccc7('0x1c')](_0x5e000e)[_0xccc7('0x24')](function(_0x2d49c5){_0x7b7166[_0xccc7('0x1c')]=_0x2d49c5;if(_0x40b904[_0xccc7('0x2f')][_0xccc7('0x3e')]){_0x3b43f8[_0xccc7('0x3f')]=[{'all':!![]}];}return db[_0xccc7('0x2d')][_0xccc7('0x40')](_0x3b43f8);})[_0xccc7('0x24')](function(_0x5e5523){_0x7b7166['rows']=_0x5e5523;return _0x7b7166;})[_0xccc7('0x24')](respondWithFilteredResult(_0x4fe601,_0x3b43f8))[_0xccc7('0x41')](handleError(_0x4fe601,null));};exports[_0xccc7('0x42')]=function(_0x38faf1,_0xfa1daf){var _0x45a13f={'raw':!![],'where':{'id':_0x38faf1['params']['id']}},_0x1c9c25={};_0x1c9c25[_0xccc7('0x32')]=_['keys'](db[_0xccc7('0x2d')][_0xccc7('0x2e')]);_0x1c9c25['query']=_[_0xccc7('0x30')](_0x38faf1[_0xccc7('0x2f')]);_0x1c9c25[_0xccc7('0x31')]=_['intersection'](_0x1c9c25[_0xccc7('0x32')],_0x1c9c25[_0xccc7('0x2f')]);_0x45a13f[_0xccc7('0x33')]=_['intersection'](_0x1c9c25[_0xccc7('0x32')],qs[_0xccc7('0x34')](_0x38faf1[_0xccc7('0x2f')][_0xccc7('0x34')]));_0x45a13f[_0xccc7('0x33')]=_0x45a13f[_0xccc7('0x33')]['length']?_0x45a13f[_0xccc7('0x33')]:_0x1c9c25[_0xccc7('0x32')];if(_0x38faf1['query'][_0xccc7('0x3e')]){_0x45a13f[_0xccc7('0x3f')]=[{'all':!![]}];}_0x45a13f=_[_0xccc7('0x3b')]({},_0x45a13f,_0x38faf1[_0xccc7('0x3d')]);return db[_0xccc7('0x2d')][_0xccc7('0x43')](_0x45a13f)['then'](handleEntityNotFound(_0xfa1daf,null))['then'](respondWithResult(_0xfa1daf,null))[_0xccc7('0x41')](handleError(_0xfa1daf,null));};exports[_0xccc7('0x23')]=function(_0x14abee,_0x3af2e0){if(_0x14abee[_0xccc7('0x44')]['id']){delete _0x14abee[_0xccc7('0x44')]['id'];}return db[_0xccc7('0x2d')][_0xccc7('0x43')]({'where':{'id':_0x14abee['params']['id']}})[_0xccc7('0x24')](handleEntityNotFound(_0x3af2e0,null))[_0xccc7('0x24')](saveUpdates(_0x14abee[_0xccc7('0x44')],null))[_0xccc7('0x24')](respondWithResult(_0x3af2e0,null))[_0xccc7('0x41')](handleError(_0x3af2e0,null));};exports[_0xccc7('0x25')]=function(_0x4c010e,_0x3389e3){return db[_0xccc7('0x2d')][_0xccc7('0x43')]({'where':{'id':_0x4c010e[_0xccc7('0x45')]['id']}})[_0xccc7('0x24')](handleEntityNotFound(_0x3389e3,null))[_0xccc7('0x24')](removeEntity(_0x3389e3,null))[_0xccc7('0x41')](handleError(_0x3389e3,null));};exports['create']=function(_0x27746b,_0x2dd003){var _0x37c775={'key':_0x27746b['body'][_0xccc7('0x46')]};if(_0x27746b[_0xccc7('0x44')][_0xccc7('0x47')]){_0x37c775[_0xccc7('0x47')]=_0x27746b[_0xccc7('0x44')][_0xccc7('0x47')];}else if(_0x27746b[_0xccc7('0x44')][_0xccc7('0x48')]){_0x37c775[_0xccc7('0x48')]=_0x27746b[_0xccc7('0x44')][_0xccc7('0x48')];}else if(_0x27746b[_0xccc7('0x44')][_0xccc7('0x49')]){_0x37c775[_0xccc7('0x49')]=_0x27746b['body'][_0xccc7('0x49')];}else if(_0x27746b[_0xccc7('0x44')][_0xccc7('0x4a')]){_0x37c775[_0xccc7('0x4a')]=_0x27746b[_0xccc7('0x44')]['ChatWebsiteId'];}return db[_0xccc7('0x2d')][_0xccc7('0x43')]({'where':_0x37c775})[_0xccc7('0x24')](function(_0x49815e){if(_0x49815e){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xccc7('0x2d')][_0xccc7('0x4b')](_0x27746b[_0xccc7('0x44')]);})['then'](function(_0x41a81a){var _0x529cea=_0x27746b[_0xccc7('0x4c')][_0xccc7('0x4d')]({'plain':!![]});if(!_0x529cea)throw new Error(_0xccc7('0x4e'));if(_0x529cea[_0xccc7('0x4f')]===_0xccc7('0x4c')){var _0xedf21d=_0x41a81a[_0xccc7('0x4d')]({'plain':!![]});return db[_0xccc7('0x50')]['find']({'where':{'name':_0xccc7('0x51'),'userProfileId':_0x529cea[_0xccc7('0x52')]},'raw':!![]})[_0xccc7('0x24')](function(_0x44e91b){if(_0x44e91b&&_0x44e91b[_0xccc7('0x53')]===0x0){return db[_0xccc7('0x26')][_0xccc7('0x4b')]({'name':_0xedf21d[_0xccc7('0x29')],'resourceId':_0xedf21d['id'],'type':_0x44e91b[_0xccc7('0x29')],'sectionId':_0x44e91b['id']},{})[_0xccc7('0x24')](function(){return _0x41a81a;});}else{return _0x41a81a;}})[_0xccc7('0x41')](function(_0x42cb1c){logger[_0xccc7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42cb1c);throw _0x42cb1c;});}return _0x41a81a;})['then'](respondWithResult(_0x2dd003,0xc9))[_0xccc7('0x41')](handleError(_0x2dd003,null));}; \ No newline at end of file +var _0x0c42=['to-csv','ejs','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','name','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','length','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox'];(function(_0x33c6a5,_0x3e0b2b){var _0x24f17f=function(_0x1781a7){while(--_0x1781a7){_0x33c6a5['push'](_0x33c6a5['shift']());}};_0x24f17f(++_0x3e0b2b);}(_0x0c42,0xab));var _0x20c4=function(_0x1993cc,_0x46a9d5){_0x1993cc=_0x1993cc-0x0;var _0x7cd105=_0x0c42[_0x1993cc];return _0x7cd105;};'use strict';var emlformat=require(_0x20c4('0x0'));var rimraf=require(_0x20c4('0x1'));var zipdir=require(_0x20c4('0x2'));var jsonpatch=require(_0x20c4('0x3'));var rp=require(_0x20c4('0x4'));var moment=require(_0x20c4('0x5'));var BPromise=require(_0x20c4('0x6'));var Mustache=require('mustache');var util=require(_0x20c4('0x7'));var path=require('path');var sox=require(_0x20c4('0x8'));var csv=require(_0x20c4('0x9'));var ejs=require(_0x20c4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20c4('0xb'));var squel=require('squel');var crypto=require(_0x20c4('0xc'));var jsforce=require(_0x20c4('0xd'));var deskjs=require(_0x20c4('0xe'));var toCsv=require(_0x20c4('0x9'));var querystring=require(_0x20c4('0xf'));var Papa=require(_0x20c4('0x10'));var Redis=require(_0x20c4('0x11'));var authService=require(_0x20c4('0x12'));var qs=require(_0x20c4('0x13'));var as=require(_0x20c4('0x14'));var hardwareService=require(_0x20c4('0x15'));var logger=require('../../config/logger')(_0x20c4('0x16'));var utils=require(_0x20c4('0x17'));var config=require(_0x20c4('0x18'));var licenseUtil=require(_0x20c4('0x19'));var db=require(_0x20c4('0x1a'))['db'];function respondWithStatusCode(_0x4c26af,_0x2f0086){_0x2f0086=_0x2f0086||0xcc;return function(_0xd17466){if(_0xd17466){return _0x4c26af[_0x20c4('0x1b')](_0x2f0086);}return _0x4c26af[_0x20c4('0x1c')](_0x2f0086)[_0x20c4('0x1d')]();};}function respondWithResult(_0x1b6675,_0x90d864){_0x90d864=_0x90d864||0xc8;return function(_0x5956a5){if(_0x5956a5){return _0x1b6675[_0x20c4('0x1c')](_0x90d864)[_0x20c4('0x1e')](_0x5956a5);}};}function respondWithFilteredResult(_0x1bddc6,_0x48921c){return function(_0x4c053e){if(_0x4c053e){var _0x257e80=typeof _0x48921c[_0x20c4('0x1f')]===_0x20c4('0x20')&&typeof _0x48921c[_0x20c4('0x21')]==='undefined';var _0x6acaa5=_0x4c053e[_0x20c4('0x22')];var _0x3a813e=_0x257e80?0x0:_0x48921c[_0x20c4('0x1f')];var _0x23baa2=_0x257e80?_0x4c053e[_0x20c4('0x22')]:_0x48921c[_0x20c4('0x1f')]+_0x48921c[_0x20c4('0x21')];var _0x5f19d7;if(_0x23baa2>=_0x6acaa5){_0x23baa2=_0x6acaa5;_0x5f19d7=0xc8;}else{_0x5f19d7=0xce;}_0x1bddc6[_0x20c4('0x1c')](_0x5f19d7);return _0x1bddc6['set'](_0x20c4('0x23'),_0x3a813e+'-'+_0x23baa2+'/'+_0x6acaa5)[_0x20c4('0x1e')](_0x4c053e);}return null;};}function patchUpdates(_0x1f1a93){return function(_0x1ecf26){try{jsonpatch[_0x20c4('0x24')](_0x1ecf26,_0x1f1a93,!![]);}catch(_0x18cb75){return BPromise[_0x20c4('0x25')](_0x18cb75);}return _0x1ecf26['save']();};}function saveUpdates(_0x54ac33,_0x85fa93){return function(_0x3b83ef){if(_0x3b83ef){return _0x3b83ef[_0x20c4('0x26')](_0x54ac33)['then'](function(_0x3e6ef2){return _0x3e6ef2;});}return null;};}function removeEntity(_0x336a37,_0x525cb2){return function(_0x2eca74){if(_0x2eca74){return _0x2eca74[_0x20c4('0x27')]()[_0x20c4('0x28')](function(){var _0x5d7e41=_0x2eca74[_0x20c4('0x29')]({'plain':!![]});var _0x433a80=_0x20c4('0x2a');return db[_0x20c4('0x2b')][_0x20c4('0x27')]({'where':{'type':_0x433a80,'resourceId':_0x5d7e41['id']}})['then'](function(){return _0x2eca74;});})[_0x20c4('0x28')](function(){_0x336a37[_0x20c4('0x1c')](0xcc)[_0x20c4('0x1d')]();});}};}function handleEntityNotFound(_0x36c1b3,_0x47490f){return function(_0x2510ad){if(!_0x2510ad){_0x36c1b3[_0x20c4('0x1b')](0x194);}return _0x2510ad;};}function handleError(_0x54d536,_0x1a9495){_0x1a9495=_0x1a9495||0x1f4;return function(_0x4b2bc5){logger[_0x20c4('0x2c')](_0x4b2bc5['stack']);if(_0x4b2bc5[_0x20c4('0x2d')]){delete _0x4b2bc5['name'];}_0x54d536[_0x20c4('0x1c')](_0x1a9495)['send'](_0x4b2bc5);};}exports[_0x20c4('0x2e')]=function(_0x4c8307,_0x392978){var _0x375aaa={},_0x2ec092={},_0x4310ff={'count':0x0,'rows':[]};var _0x3152c3=_[_0x20c4('0x2f')](db[_0x20c4('0x30')][_0x20c4('0x31')],function(_0x889d56){return{'name':_0x889d56[_0x20c4('0x32')],'type':_0x889d56['type'][_0x20c4('0x33')]};});_0x2ec092[_0x20c4('0x34')]=_['map'](_0x3152c3,_0x20c4('0x2d'));_0x2ec092[_0x20c4('0x35')]=_[_0x20c4('0x36')](_0x4c8307[_0x20c4('0x35')]);_0x2ec092[_0x20c4('0x37')]=_[_0x20c4('0x38')](_0x2ec092['model'],_0x2ec092[_0x20c4('0x35')]);_0x375aaa['attributes']=_['intersection'](_0x2ec092['model'],qs[_0x20c4('0x39')](_0x4c8307['query'][_0x20c4('0x39')]));_0x375aaa[_0x20c4('0x3a')]=_0x375aaa[_0x20c4('0x3a')]['length']?_0x375aaa['attributes']:_0x2ec092[_0x20c4('0x34')];if(!_0x4c8307[_0x20c4('0x35')][_0x20c4('0x3b')](_0x20c4('0x3c'))){_0x375aaa[_0x20c4('0x21')]=qs[_0x20c4('0x21')](_0x4c8307['query']['limit']);_0x375aaa['offset']=qs[_0x20c4('0x1f')](_0x4c8307[_0x20c4('0x35')][_0x20c4('0x1f')]);}_0x375aaa[_0x20c4('0x3d')]=qs[_0x20c4('0x3e')](_0x4c8307[_0x20c4('0x35')][_0x20c4('0x3e')]);_0x375aaa[_0x20c4('0x3f')]=qs['filters'](_[_0x20c4('0x40')](_0x4c8307[_0x20c4('0x35')],_0x2ec092[_0x20c4('0x37')]),_0x3152c3);if(_0x4c8307[_0x20c4('0x35')]['filter']){_0x375aaa[_0x20c4('0x3f')]=_[_0x20c4('0x41')](_0x375aaa[_0x20c4('0x3f')],{'$or':[{'key':{'$like':'%'+_0x4c8307['query']['filter']+'%'}},{'value':{'$like':'%'+_0x4c8307[_0x20c4('0x35')][_0x20c4('0x42')]+'%'}}]});}_0x375aaa=_[_0x20c4('0x41')]({},_0x375aaa,_0x4c8307[_0x20c4('0x43')]);var _0x4aab6a={'where':_0x375aaa[_0x20c4('0x3f')]};return db[_0x20c4('0x30')][_0x20c4('0x22')](_0x4aab6a)['then'](function(_0x19aa6d){_0x4310ff[_0x20c4('0x22')]=_0x19aa6d;if(_0x4c8307['query'][_0x20c4('0x44')]){_0x375aaa[_0x20c4('0x45')]=[{'all':!![]}];}return db['CannedAnswer'][_0x20c4('0x46')](_0x375aaa);})[_0x20c4('0x28')](function(_0x4ed074){_0x4310ff['rows']=_0x4ed074;return _0x4310ff;})['then'](respondWithFilteredResult(_0x392978,_0x375aaa))[_0x20c4('0x47')](handleError(_0x392978,null));};exports[_0x20c4('0x48')]=function(_0x57dcf7,_0x30c838){var _0x5adfc7={'raw':!![],'where':{'id':_0x57dcf7[_0x20c4('0x49')]['id']}},_0x2b9841={};_0x2b9841[_0x20c4('0x34')]=_[_0x20c4('0x36')](db[_0x20c4('0x30')][_0x20c4('0x31')]);_0x2b9841[_0x20c4('0x35')]=_[_0x20c4('0x36')](_0x57dcf7['query']);_0x2b9841['filters']=_[_0x20c4('0x38')](_0x2b9841[_0x20c4('0x34')],_0x2b9841[_0x20c4('0x35')]);_0x5adfc7['attributes']=_[_0x20c4('0x38')](_0x2b9841[_0x20c4('0x34')],qs['fields'](_0x57dcf7[_0x20c4('0x35')][_0x20c4('0x39')]));_0x5adfc7['attributes']=_0x5adfc7[_0x20c4('0x3a')][_0x20c4('0x4a')]?_0x5adfc7[_0x20c4('0x3a')]:_0x2b9841['model'];if(_0x57dcf7[_0x20c4('0x35')][_0x20c4('0x44')]){_0x5adfc7[_0x20c4('0x45')]=[{'all':!![]}];}_0x5adfc7=_[_0x20c4('0x41')]({},_0x5adfc7,_0x57dcf7[_0x20c4('0x43')]);return db['CannedAnswer']['find'](_0x5adfc7)[_0x20c4('0x28')](handleEntityNotFound(_0x30c838,null))[_0x20c4('0x28')](respondWithResult(_0x30c838,null))['catch'](handleError(_0x30c838,null));};exports[_0x20c4('0x26')]=function(_0x20f3e2,_0x524118){if(_0x20f3e2[_0x20c4('0x4b')]['id']){delete _0x20f3e2['body']['id'];}return db[_0x20c4('0x30')]['find']({'where':{'id':_0x20f3e2[_0x20c4('0x49')]['id']}})[_0x20c4('0x28')](handleEntityNotFound(_0x524118,null))[_0x20c4('0x28')](saveUpdates(_0x20f3e2[_0x20c4('0x4b')],null))[_0x20c4('0x28')](respondWithResult(_0x524118,null))['catch'](handleError(_0x524118,null));};exports[_0x20c4('0x27')]=function(_0x49efb0,_0x356603){return db[_0x20c4('0x30')]['find']({'where':{'id':_0x49efb0['params']['id']}})[_0x20c4('0x28')](handleEntityNotFound(_0x356603,null))[_0x20c4('0x28')](removeEntity(_0x356603,null))[_0x20c4('0x47')](handleError(_0x356603,null));};exports[_0x20c4('0x4c')]=function(_0x2df34c,_0x56643c){var _0x445cd6={'key':_0x2df34c[_0x20c4('0x4b')]['key']};if(_0x2df34c[_0x20c4('0x4b')]['MailAccountId']){_0x445cd6[_0x20c4('0x4d')]=_0x2df34c[_0x20c4('0x4b')]['MailAccountId'];}else if(_0x2df34c['body'][_0x20c4('0x4e')]){_0x445cd6['SmsAccountId']=_0x2df34c[_0x20c4('0x4b')][_0x20c4('0x4e')];}else if(_0x2df34c[_0x20c4('0x4b')]['OpenchannelAccountId']){_0x445cd6[_0x20c4('0x4f')]=_0x2df34c[_0x20c4('0x4b')][_0x20c4('0x4f')];}else if(_0x2df34c[_0x20c4('0x4b')]['ChatWebsiteId']){_0x445cd6[_0x20c4('0x50')]=_0x2df34c['body'][_0x20c4('0x50')];}return db[_0x20c4('0x30')][_0x20c4('0x51')]({'where':_0x445cd6})['then'](function(_0x1472c8){if(_0x1472c8){throw new db[(_0x20c4('0x52'))][(_0x20c4('0x53'))](_0x20c4('0x54'));}return db[_0x20c4('0x30')][_0x20c4('0x4c')](_0x2df34c[_0x20c4('0x4b')]);})[_0x20c4('0x28')](function(_0x38c1d3){var _0x300844=_0x2df34c[_0x20c4('0x55')][_0x20c4('0x29')]({'plain':!![]});if(!_0x300844)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x300844['role']==='user'){var _0xcccc27=_0x38c1d3[_0x20c4('0x29')]({'plain':!![]});return db[_0x20c4('0x56')]['find']({'where':{'name':_0x20c4('0x2a'),'userProfileId':_0x300844[_0x20c4('0x57')]},'raw':!![]})['then'](function(_0x3b34fe){if(_0x3b34fe&&_0x3b34fe[_0x20c4('0x58')]===0x0){return db[_0x20c4('0x2b')][_0x20c4('0x4c')]({'name':_0xcccc27[_0x20c4('0x2d')],'resourceId':_0xcccc27['id'],'type':_0x3b34fe[_0x20c4('0x2d')],'sectionId':_0x3b34fe['id']},{})['then'](function(){return _0x38c1d3;});}else{return _0x38c1d3;}})['catch'](function(_0x822375){logger[_0x20c4('0x2c')](_0x20c4('0x59'),_0x822375);throw _0x822375;});}return _0x38c1d3;})[_0x20c4('0x28')](respondWithResult(_0x56643c,0xc9))[_0x20c4('0x47')](handleError(_0x56643c,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index afaae0a..6146084 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 _0xafc6=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','./cannedAnswer.attributes'];(function(_0x3f6a5d,_0x2483d8){var _0x543aaf=function(_0x15912e){while(--_0x15912e){_0x3f6a5d['push'](_0x3f6a5d['shift']());}};_0x543aaf(++_0x2483d8);}(_0xafc6,0x180));var _0x6afc=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xafc6[_0x476bf4];return _0x788ffe;};'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(_0x6afc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6afc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6afc('0x7'));module[_0x6afc('0x8')]=function(_0x461900,_0x31f2c0){return _0x461900[_0x6afc('0x9')](_0x6afc('0xa'),attributes,{'tableName':_0x6afc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6afc('0xc'),'collate':_0x6afc('0xd')});}; \ No newline at end of file +var _0xabc0=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x530b29,_0x30dff4){var _0x3a4c1a=function(_0x6498e8){while(--_0x6498e8){_0x530b29['push'](_0x530b29['shift']());}};_0x3a4c1a(++_0x30dff4);}(_0xabc0,0x16d));var _0x0abc=function(_0x33cd12,_0x8e8b30){_0x33cd12=_0x33cd12-0x0;var _0x483b8d=_0xabc0[_0x33cd12];return _0x483b8d;};'use strict';var _=require(_0x0abc('0x0'));var util=require(_0x0abc('0x1'));var logger=require(_0x0abc('0x2'))(_0x0abc('0x3'));var moment=require(_0x0abc('0x4'));var BPromise=require('bluebird');var rp=require(_0x0abc('0x5'));var fs=require('fs');var path=require(_0x0abc('0x6'));var rimraf=require(_0x0abc('0x7'));var config=require(_0x0abc('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x0abc('0x9')]=function(_0x214f2f,_0x3336ee){return _0x214f2f['define'](_0x0abc('0xa'),attributes,{'tableName':_0x0abc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0abc('0xc'),'collate':_0x0abc('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index fa1fb8f..065026d 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(_0x2c3fe6,_0x2c34c4){var _0x55d80b=function(_0x42efee){while(--_0x42efee){_0x2c3fe6['push'](_0x2c3fe6['shift']());}};_0x55d80b(++_0x2c34c4);}(_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(_0x1013eb,_0x4e850e){var _0x315721=function(_0x1c5242){while(--_0x1c5242){_0x1013eb['push'](_0x1013eb['shift']());}};_0x315721(++_0x4e850e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 3b70431..7cf1e20 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 _0xa97e=['multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','exports'];(function(_0x13d075,_0x2f74fd){var _0x4bc7c1=function(_0x30ab79){while(--_0x30ab79){_0x13d075['push'](_0x13d075['shift']());}};_0x4bc7c1(++_0x2f74fd);}(_0xa97e,0xe4));var _0xea97=function(_0x524abf,_0x140424){_0x524abf=_0x524abf-0x0;var _0x3a1e48=_0xa97e[_0x524abf];return _0x3a1e48;};'use strict';var multer=require(_0xea97('0x0'));var util=require('util');var path=require(_0xea97('0x1'));var timeout=require('connect-timeout');var express=require(_0xea97('0x2'));var router=express[_0xea97('0x3')]();var fs_extra=require(_0xea97('0x4'));var auth=require(_0xea97('0x5'));var interaction=require(_0xea97('0x6'));var config=require(_0xea97('0x7'));var controller=require(_0xea97('0x8'));router['get']('/',auth[_0xea97('0x9')](),controller[_0xea97('0xa')]);router[_0xea97('0xb')](_0xea97('0xc'),auth[_0xea97('0x9')](),controller[_0xea97('0xd')]);router[_0xea97('0xe')]('/',auth[_0xea97('0x9')](),controller[_0xea97('0xf')]);router['put']('/:id',auth[_0xea97('0x9')](),controller[_0xea97('0x10')]);router[_0xea97('0x11')](_0xea97('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xea97('0x12')]=router; \ No newline at end of file +var _0x2c33=['fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0xa8c896,_0x163116){var _0x3fac5b=function(_0x555e59){while(--_0x555e59){_0xa8c896['push'](_0xa8c896['shift']());}};_0x3fac5b(++_0x163116);}(_0x2c33,0x13e));var _0x32c3=function(_0x2a11f6,_0x59eb3a){_0x2a11f6=_0x2a11f6-0x0;var _0x1a9ef9=_0x2c33[_0x2a11f6];return _0x1a9ef9;};'use strict';var multer=require(_0x32c3('0x0'));var util=require(_0x32c3('0x1'));var path=require(_0x32c3('0x2'));var timeout=require('connect-timeout');var express=require(_0x32c3('0x3'));var router=express[_0x32c3('0x4')]();var fs_extra=require(_0x32c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x32c3('0x6'));var config=require(_0x32c3('0x7'));var controller=require(_0x32c3('0x8'));router[_0x32c3('0x9')]('/',auth[_0x32c3('0xa')](),controller[_0x32c3('0xb')]);router[_0x32c3('0x9')](_0x32c3('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x32c3('0xd')]('/',auth[_0x32c3('0xa')](),controller['create']);router[_0x32c3('0xe')](_0x32c3('0xc'),auth['isAuthenticated'](),controller[_0x32c3('0xf')]);router[_0x32c3('0x10')](_0x32c3('0xc'),auth[_0x32c3('0xa')](),controller[_0x32c3('0x11')]);module[_0x32c3('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 57647fe..c22fd35 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 _0x55da=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x55da,0x16f));var _0xa55d=function(_0xc682af,_0x509267){_0xc682af=_0xc682af-0x0;var _0x5f5c85=_0x55da[_0xc682af];return _0x5f5c85;};'use strict';var Sequelize=require('sequelize');module[_0xa55d('0x0')]={'calldate':{'type':Sequelize[_0xa55d('0x1')],'allowNull':![],'defaultValue':_0xa55d('0x2')},'clid':{'type':Sequelize[_0xa55d('0x3')]},'src':{'type':Sequelize[_0xa55d('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xa55d('0x3')]},'channel':{'type':Sequelize[_0xa55d('0x3')]},'dstchannel':{'type':Sequelize[_0xa55d('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xa55d('0x3')]},'duration':{'type':Sequelize[_0xa55d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa55d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa55d('0x3')]},'amaflags':{'type':Sequelize[_0xa55d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa55d('0x3')]},'userfield':{'type':Sequelize[_0xa55d('0x3')]},'uniqueid':{'type':Sequelize[_0xa55d('0x3')]},'linkedid':{'type':Sequelize[_0xa55d('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xa55d('0x3')]},'type':{'type':Sequelize[_0xa55d('0x3')]},'tag':{'type':Sequelize[_0xa55d('0x3')]}}; \ No newline at end of file +var _0x98b8=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x4373a8,_0x201514){var _0x3bfabe=function(_0x47eb6c){while(--_0x47eb6c){_0x4373a8['push'](_0x4373a8['shift']());}};_0x3bfabe(++_0x201514);}(_0x98b8,0x93));var _0x898b=function(_0x563a7e,_0x4d543a){_0x563a7e=_0x563a7e-0x0;var _0x4f7bd4=_0x98b8[_0x563a7e];return _0x4f7bd4;};'use strict';var Sequelize=require(_0x898b('0x0'));module[_0x898b('0x1')]={'calldate':{'type':Sequelize[_0x898b('0x2')],'allowNull':![],'defaultValue':_0x898b('0x3')},'clid':{'type':Sequelize[_0x898b('0x4')]},'src':{'type':Sequelize[_0x898b('0x4')]},'dst':{'type':Sequelize[_0x898b('0x4')]},'dcontext':{'type':Sequelize[_0x898b('0x4')]},'channel':{'type':Sequelize[_0x898b('0x4')]},'dstchannel':{'type':Sequelize[_0x898b('0x4')]},'lastapp':{'type':Sequelize[_0x898b('0x4')]},'lastdata':{'type':Sequelize[_0x898b('0x4')]},'duration':{'type':Sequelize[_0x898b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x898b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x898b('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x898b('0x4')]},'userfield':{'type':Sequelize[_0x898b('0x4')]},'uniqueid':{'type':Sequelize[_0x898b('0x4')]},'linkedid':{'type':Sequelize[_0x898b('0x4')]},'sequence':{'type':Sequelize[_0x898b('0x4')]},'peeraccount':{'type':Sequelize[_0x898b('0x4')]},'type':{'type':Sequelize[_0x898b('0x4')]},'tag':{'type':Sequelize[_0x898b('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e70ca83..ec2f3f3 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 _0x2eb2=['ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3df547,_0x16faf4){var _0x3af2b4=function(_0x283b74){while(--_0x283b74){_0x3df547['push'](_0x3df547['shift']());}};_0x3af2b4(++_0x16faf4);}(_0x2eb2,0x19f));var _0x22eb=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x2eb2[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22eb('0x0'));var zipdir=require(_0x22eb('0x1'));var jsonpatch=require(_0x22eb('0x2'));var rp=require(_0x22eb('0x3'));var moment=require(_0x22eb('0x4'));var BPromise=require(_0x22eb('0x5'));var Mustache=require('mustache');var util=require(_0x22eb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x22eb('0x7'));var ejs=require(_0x22eb('0x8'));var fs=require('fs');var fs_extra=require(_0x22eb('0x9'));var _=require(_0x22eb('0xa'));var squel=require(_0x22eb('0xb'));var crypto=require(_0x22eb('0xc'));var jsforce=require(_0x22eb('0xd'));var deskjs=require(_0x22eb('0xe'));var toCsv=require(_0x22eb('0x7'));var querystring=require(_0x22eb('0xf'));var Papa=require(_0x22eb('0x10'));var Redis=require(_0x22eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22eb('0x13'))('api');var utils=require(_0x22eb('0x14'));var config=require(_0x22eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xcc;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0x16')](_0x189f05);}return _0x1f286c[_0x22eb('0x17')](_0x189f05)['end']();};}function respondWithResult(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0xc8;return function(_0x1f5089){if(_0x1f5089){return _0x350ade['status'](_0x53f14e)[_0x22eb('0x18')](_0x1f5089);}};}function respondWithFilteredResult(_0x84c668,_0x53abbf){return function(_0x48b63c){if(_0x48b63c){var _0x4bc29a=typeof _0x53abbf[_0x22eb('0x19')]==='undefined'&&typeof _0x53abbf['limit']===_0x22eb('0x1a');var _0x4d9a71=_0x48b63c['count'];var _0xb7a73a=_0x4bc29a?0x0:_0x53abbf[_0x22eb('0x19')];var _0x385bcb=_0x4bc29a?_0x48b63c[_0x22eb('0x1b')]:_0x53abbf[_0x22eb('0x19')]+_0x53abbf['limit'];var _0x4182a8;if(_0x385bcb>=_0x4d9a71){_0x385bcb=_0x4d9a71;_0x4182a8=0xc8;}else{_0x4182a8=0xce;}_0x84c668[_0x22eb('0x17')](_0x4182a8);return _0x84c668[_0x22eb('0x1c')](_0x22eb('0x1d'),_0xb7a73a+'-'+_0x385bcb+'/'+_0x4d9a71)[_0x22eb('0x18')](_0x48b63c);}return null;};}function patchUpdates(_0x517313){return function(_0x2eb115){try{jsonpatch[_0x22eb('0x1e')](_0x2eb115,_0x517313,!![]);}catch(_0x2fc36e){return BPromise['reject'](_0x2fc36e);}return _0x2eb115['save']();};}function saveUpdates(_0x4335b7,_0x267d97){return function(_0x434ecb){if(_0x434ecb){return _0x434ecb[_0x22eb('0x1f')](_0x4335b7)[_0x22eb('0x20')](function(_0x3e8c1c){return _0x3e8c1c;});}return null;};}function removeEntity(_0x43dacb,_0x4e7e69){return function(_0x2e8f7c){if(_0x2e8f7c){return _0x2e8f7c[_0x22eb('0x21')]()[_0x22eb('0x20')](function(){_0x43dacb[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();});}};}function handleEntityNotFound(_0x4da252,_0x12c133){return function(_0x6f8ff3){if(!_0x6f8ff3){_0x4da252[_0x22eb('0x16')](0x194);}return _0x6f8ff3;};}function handleError(_0x5a001e,_0xe0783c){_0xe0783c=_0xe0783c||0x1f4;return function(_0x259847){logger['error'](_0x259847[_0x22eb('0x23')]);if(_0x259847[_0x22eb('0x24')]){delete _0x259847[_0x22eb('0x24')];}_0x5a001e[_0x22eb('0x17')](_0xe0783c)[_0x22eb('0x25')](_0x259847);};}exports['index']=function(_0x49dd59,_0x2a950e){var _0x25e5bc={},_0x44cf91={},_0x7c0119={'count':0x0,'rows':[]};var _0x1599c7=_[_0x22eb('0x26')](db[_0x22eb('0x27')][_0x22eb('0x28')],function(_0x382784){return{'name':_0x382784[_0x22eb('0x29')],'type':_0x382784[_0x22eb('0x2a')][_0x22eb('0x2b')]};});_0x44cf91['model']=_[_0x22eb('0x26')](_0x1599c7,'name');_0x44cf91[_0x22eb('0x2c')]=_[_0x22eb('0x2d')](_0x49dd59[_0x22eb('0x2c')]);_0x44cf91[_0x22eb('0x2e')]=_[_0x22eb('0x2f')](_0x44cf91[_0x22eb('0x30')],_0x44cf91[_0x22eb('0x2c')]);_0x25e5bc[_0x22eb('0x31')]=_[_0x22eb('0x2f')](_0x44cf91[_0x22eb('0x30')],qs['fields'](_0x49dd59['query'][_0x22eb('0x32')]));_0x25e5bc['attributes']=_0x25e5bc['attributes'][_0x22eb('0x33')]?_0x25e5bc[_0x22eb('0x31')]:_0x44cf91[_0x22eb('0x30')];if(!_0x49dd59[_0x22eb('0x2c')][_0x22eb('0x34')](_0x22eb('0x35'))){_0x25e5bc[_0x22eb('0x36')]=qs[_0x22eb('0x36')](_0x49dd59[_0x22eb('0x2c')][_0x22eb('0x36')]);_0x25e5bc['offset']=qs[_0x22eb('0x19')](_0x49dd59['query']['offset']);}_0x25e5bc[_0x22eb('0x37')]=qs[_0x22eb('0x38')](_0x49dd59['query'][_0x22eb('0x38')]);_0x25e5bc[_0x22eb('0x39')]=qs[_0x22eb('0x2e')](_[_0x22eb('0x3a')](_0x49dd59[_0x22eb('0x2c')],_0x44cf91['filters']),_0x1599c7);if(_0x49dd59[_0x22eb('0x2c')][_0x22eb('0x3b')]){_0x25e5bc['where']=_[_0x22eb('0x3c')](_0x25e5bc[_0x22eb('0x39')],{'$or':_[_0x22eb('0x26')](_0x1599c7,function(_0x2cc77c){if(_0x2cc77c[_0x22eb('0x2a')]!=='VIRTUAL'){var _0x51c8b5={};_0x51c8b5[_0x2cc77c[_0x22eb('0x24')]]={'$like':'%'+_0x49dd59[_0x22eb('0x2c')]['filter']+'%'};return _0x51c8b5;}})});}_0x25e5bc=_[_0x22eb('0x3c')]({},_0x25e5bc,_0x49dd59[_0x22eb('0x3d')]);var _0x46c6a1={'where':_0x25e5bc['where']};return db[_0x22eb('0x27')][_0x22eb('0x1b')](_0x46c6a1)[_0x22eb('0x20')](function(_0x2a8517){_0x7c0119[_0x22eb('0x1b')]=_0x2a8517;if(_0x49dd59[_0x22eb('0x2c')]['includeAll']){_0x25e5bc[_0x22eb('0x3e')]=[{'all':!![]}];}return db[_0x22eb('0x27')]['findAll'](_0x25e5bc);})[_0x22eb('0x20')](function(_0x44d39f){_0x7c0119[_0x22eb('0x3f')]=_0x44d39f;return _0x7c0119;})[_0x22eb('0x20')](respondWithFilteredResult(_0x2a950e,_0x25e5bc))[_0x22eb('0x40')](handleError(_0x2a950e,null));};exports[_0x22eb('0x41')]=function(_0x1ff04a,_0x78b250){var _0x1bafa3={'raw':!![],'where':{'id':_0x1ff04a[_0x22eb('0x42')]['id']}},_0x82ace8={};_0x82ace8[_0x22eb('0x30')]=_[_0x22eb('0x2d')](db[_0x22eb('0x27')][_0x22eb('0x28')]);_0x82ace8[_0x22eb('0x2c')]=_[_0x22eb('0x2d')](_0x1ff04a[_0x22eb('0x2c')]);_0x82ace8['filters']=_[_0x22eb('0x2f')](_0x82ace8[_0x22eb('0x30')],_0x82ace8['query']);_0x1bafa3[_0x22eb('0x31')]=_[_0x22eb('0x2f')](_0x82ace8['model'],qs['fields'](_0x1ff04a['query'][_0x22eb('0x32')]));_0x1bafa3[_0x22eb('0x31')]=_0x1bafa3['attributes']['length']?_0x1bafa3[_0x22eb('0x31')]:_0x82ace8[_0x22eb('0x30')];if(_0x1ff04a[_0x22eb('0x2c')][_0x22eb('0x43')]){_0x1bafa3[_0x22eb('0x3e')]=[{'all':!![]}];}_0x1bafa3=_[_0x22eb('0x3c')]({},_0x1bafa3,_0x1ff04a[_0x22eb('0x3d')]);return db[_0x22eb('0x27')]['find'](_0x1bafa3)['then'](handleEntityNotFound(_0x78b250,null))[_0x22eb('0x20')](respondWithResult(_0x78b250,null))['catch'](handleError(_0x78b250,null));};exports[_0x22eb('0x44')]=function(_0x4bd819,_0x8a2b2c){return db['Cdr']['create'](_0x4bd819['body'],{})['then'](respondWithResult(_0x8a2b2c,0xc9))[_0x22eb('0x40')](handleError(_0x8a2b2c,null));};exports['update']=function(_0x320211,_0x3b35c6){if(_0x320211['body']['id']){delete _0x320211[_0x22eb('0x45')]['id'];}return db['Cdr'][_0x22eb('0x46')]({'where':{'id':_0x320211[_0x22eb('0x42')]['id']}})[_0x22eb('0x20')](handleEntityNotFound(_0x3b35c6,null))[_0x22eb('0x20')](saveUpdates(_0x320211[_0x22eb('0x45')],null))[_0x22eb('0x20')](respondWithResult(_0x3b35c6,null))[_0x22eb('0x40')](handleError(_0x3b35c6,null));};exports[_0x22eb('0x21')]=function(_0x11942d,_0x527ef1){return db[_0x22eb('0x27')][_0x22eb('0x46')]({'where':{'id':_0x11942d['params']['id']}})[_0x22eb('0x20')](handleEntityNotFound(_0x527ef1,null))[_0x22eb('0x20')](removeEntity(_0x527ef1,null))[_0x22eb('0x40')](handleError(_0x527ef1,null));};exports[_0x22eb('0x47')]=function(_0x4fee5c,_0x6c0600){return db[_0x22eb('0x27')][_0x22eb('0x47')]()[_0x22eb('0x20')](respondWithResult(_0x6c0600,null))[_0x22eb('0x40')](handleError(_0x6c0600,null));}; \ No newline at end of file +var _0x6c7b=['apply','reject','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','findAll','rows','params','includeAll','include','find','catch','create','body','destroy','describe','eml-format','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x2067da,_0x231256){_0x2067da=_0x2067da-0x0;var _0x348f8b=_0x6c7b[_0x2067da];return _0x348f8b;};'use strict';var emlformat=require(_0xb6c7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb6c7('0x1'));var moment=require('moment');var BPromise=require(_0xb6c7('0x2'));var Mustache=require(_0xb6c7('0x3'));var util=require(_0xb6c7('0x4'));var path=require('path');var sox=require(_0xb6c7('0x5'));var csv=require(_0xb6c7('0x6'));var ejs=require(_0xb6c7('0x7'));var fs=require('fs');var fs_extra=require(_0xb6c7('0x8'));var _=require(_0xb6c7('0x9'));var squel=require('squel');var crypto=require(_0xb6c7('0xa'));var jsforce=require(_0xb6c7('0xb'));var deskjs=require(_0xb6c7('0xc'));var toCsv=require(_0xb6c7('0x6'));var querystring=require(_0xb6c7('0xd'));var Papa=require(_0xb6c7('0xe'));var Redis=require(_0xb6c7('0xf'));var authService=require(_0xb6c7('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6c7('0x11'));var logger=require(_0xb6c7('0x12'))(_0xb6c7('0x13'));var utils=require(_0xb6c7('0x14'));var config=require(_0xb6c7('0x15'));var licenseUtil=require(_0xb6c7('0x16'));var db=require(_0xb6c7('0x17'))['db'];function respondWithStatusCode(_0x50c2de,_0x9b32b7){_0x9b32b7=_0x9b32b7||0xcc;return function(_0xa858c5){if(_0xa858c5){return _0x50c2de[_0xb6c7('0x18')](_0x9b32b7);}return _0x50c2de[_0xb6c7('0x19')](_0x9b32b7)[_0xb6c7('0x1a')]();};}function respondWithResult(_0x383ac5,_0x147e4a){_0x147e4a=_0x147e4a||0xc8;return function(_0x561eb4){if(_0x561eb4){return _0x383ac5[_0xb6c7('0x19')](_0x147e4a)['json'](_0x561eb4);}};}function respondWithFilteredResult(_0x480d9a,_0x5d5428){return function(_0x19c145){if(_0x19c145){var _0x48b7ec=typeof _0x5d5428[_0xb6c7('0x1b')]===_0xb6c7('0x1c')&&typeof _0x5d5428[_0xb6c7('0x1d')]===_0xb6c7('0x1c');var _0x209659=_0x19c145[_0xb6c7('0x1e')];var _0x2c819d=_0x48b7ec?0x0:_0x5d5428[_0xb6c7('0x1b')];var _0x1a591f=_0x48b7ec?_0x19c145[_0xb6c7('0x1e')]:_0x5d5428[_0xb6c7('0x1b')]+_0x5d5428[_0xb6c7('0x1d')];var _0x3beafa;if(_0x1a591f>=_0x209659){_0x1a591f=_0x209659;_0x3beafa=0xc8;}else{_0x3beafa=0xce;}_0x480d9a['status'](_0x3beafa);return _0x480d9a[_0xb6c7('0x1f')](_0xb6c7('0x20'),_0x2c819d+'-'+_0x1a591f+'/'+_0x209659)['json'](_0x19c145);}return null;};}function patchUpdates(_0x25ca5d){return function(_0x5a1c0a){try{jsonpatch[_0xb6c7('0x21')](_0x5a1c0a,_0x25ca5d,!![]);}catch(_0x5b7ebf){return BPromise[_0xb6c7('0x22')](_0x5b7ebf);}return _0x5a1c0a['save']();};}function saveUpdates(_0x24c0b3,_0x146dd4){return function(_0x4a4788){if(_0x4a4788){return _0x4a4788[_0xb6c7('0x23')](_0x24c0b3)[_0xb6c7('0x24')](function(_0x2081a6){return _0x2081a6;});}return null;};}function removeEntity(_0x4232b6,_0xd33675){return function(_0x1ee45d){if(_0x1ee45d){return _0x1ee45d['destroy']()[_0xb6c7('0x24')](function(){_0x4232b6[_0xb6c7('0x19')](0xcc)[_0xb6c7('0x1a')]();});}};}function handleEntityNotFound(_0x418920,_0x5ed41e){return function(_0x1eb265){if(!_0x1eb265){_0x418920[_0xb6c7('0x18')](0x194);}return _0x1eb265;};}function handleError(_0x49909e,_0x1eee74){_0x1eee74=_0x1eee74||0x1f4;return function(_0x164801){logger[_0xb6c7('0x25')](_0x164801[_0xb6c7('0x26')]);if(_0x164801['name']){delete _0x164801[_0xb6c7('0x27')];}_0x49909e['status'](_0x1eee74)[_0xb6c7('0x28')](_0x164801);};}exports[_0xb6c7('0x29')]=function(_0x232f7f,_0x5f3be2){var _0x47acab={},_0x4f19da={},_0x438dc3={'count':0x0,'rows':[]};var _0xcd9464=_[_0xb6c7('0x2a')](db[_0xb6c7('0x2b')][_0xb6c7('0x2c')],function(_0x1b4180){return{'name':_0x1b4180[_0xb6c7('0x2d')],'type':_0x1b4180[_0xb6c7('0x2e')][_0xb6c7('0x2f')]};});_0x4f19da[_0xb6c7('0x30')]=_['map'](_0xcd9464,_0xb6c7('0x27'));_0x4f19da['query']=_[_0xb6c7('0x31')](_0x232f7f[_0xb6c7('0x32')]);_0x4f19da[_0xb6c7('0x33')]=_[_0xb6c7('0x34')](_0x4f19da[_0xb6c7('0x30')],_0x4f19da['query']);_0x47acab['attributes']=_['intersection'](_0x4f19da[_0xb6c7('0x30')],qs[_0xb6c7('0x35')](_0x232f7f['query'][_0xb6c7('0x35')]));_0x47acab[_0xb6c7('0x36')]=_0x47acab['attributes'][_0xb6c7('0x37')]?_0x47acab[_0xb6c7('0x36')]:_0x4f19da[_0xb6c7('0x30')];if(!_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x38')](_0xb6c7('0x39'))){_0x47acab['limit']=qs[_0xb6c7('0x1d')](_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x1d')]);_0x47acab[_0xb6c7('0x1b')]=qs[_0xb6c7('0x1b')](_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x1b')]);}_0x47acab['order']=qs['sort'](_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x3a')]);_0x47acab[_0xb6c7('0x3b')]=qs[_0xb6c7('0x33')](_[_0xb6c7('0x3c')](_0x232f7f[_0xb6c7('0x32')],_0x4f19da[_0xb6c7('0x33')]),_0xcd9464);if(_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x3d')]){_0x47acab[_0xb6c7('0x3b')]=_['merge'](_0x47acab[_0xb6c7('0x3b')],{'$or':_['map'](_0xcd9464,function(_0x5836e9){if(_0x5836e9[_0xb6c7('0x2e')]!=='VIRTUAL'){var _0x3af5be={};_0x3af5be[_0x5836e9[_0xb6c7('0x27')]]={'$like':'%'+_0x232f7f['query'][_0xb6c7('0x3d')]+'%'};return _0x3af5be;}})});}_0x47acab=_[_0xb6c7('0x3e')]({},_0x47acab,_0x232f7f[_0xb6c7('0x3f')]);var _0x84861f={'where':_0x47acab[_0xb6c7('0x3b')]};return db['Cdr']['count'](_0x84861f)[_0xb6c7('0x24')](function(_0xb575){_0x438dc3[_0xb6c7('0x1e')]=_0xb575;if(_0x232f7f[_0xb6c7('0x32')]['includeAll']){_0x47acab['include']=[{'all':!![]}];}return db[_0xb6c7('0x2b')][_0xb6c7('0x40')](_0x47acab);})[_0xb6c7('0x24')](function(_0x214d04){_0x438dc3[_0xb6c7('0x41')]=_0x214d04;return _0x438dc3;})['then'](respondWithFilteredResult(_0x5f3be2,_0x47acab))['catch'](handleError(_0x5f3be2,null));};exports['show']=function(_0x45369e,_0x80ee40){var _0x4462dc={'raw':!![],'where':{'id':_0x45369e[_0xb6c7('0x42')]['id']}},_0x5050c9={};_0x5050c9[_0xb6c7('0x30')]=_['keys'](db[_0xb6c7('0x2b')][_0xb6c7('0x2c')]);_0x5050c9[_0xb6c7('0x32')]=_[_0xb6c7('0x31')](_0x45369e[_0xb6c7('0x32')]);_0x5050c9['filters']=_[_0xb6c7('0x34')](_0x5050c9[_0xb6c7('0x30')],_0x5050c9[_0xb6c7('0x32')]);_0x4462dc['attributes']=_['intersection'](_0x5050c9[_0xb6c7('0x30')],qs[_0xb6c7('0x35')](_0x45369e[_0xb6c7('0x32')]['fields']));_0x4462dc['attributes']=_0x4462dc['attributes'][_0xb6c7('0x37')]?_0x4462dc[_0xb6c7('0x36')]:_0x5050c9[_0xb6c7('0x30')];if(_0x45369e[_0xb6c7('0x32')][_0xb6c7('0x43')]){_0x4462dc[_0xb6c7('0x44')]=[{'all':!![]}];}_0x4462dc=_[_0xb6c7('0x3e')]({},_0x4462dc,_0x45369e['options']);return db[_0xb6c7('0x2b')][_0xb6c7('0x45')](_0x4462dc)[_0xb6c7('0x24')](handleEntityNotFound(_0x80ee40,null))[_0xb6c7('0x24')](respondWithResult(_0x80ee40,null))[_0xb6c7('0x46')](handleError(_0x80ee40,null));};exports['create']=function(_0x33b9a2,_0x40bbff){return db[_0xb6c7('0x2b')][_0xb6c7('0x47')](_0x33b9a2[_0xb6c7('0x48')],{})[_0xb6c7('0x24')](respondWithResult(_0x40bbff,0xc9))['catch'](handleError(_0x40bbff,null));};exports[_0xb6c7('0x23')]=function(_0x141cd5,_0x2116cb){if(_0x141cd5[_0xb6c7('0x48')]['id']){delete _0x141cd5[_0xb6c7('0x48')]['id'];}return db[_0xb6c7('0x2b')][_0xb6c7('0x45')]({'where':{'id':_0x141cd5['params']['id']}})['then'](handleEntityNotFound(_0x2116cb,null))['then'](saveUpdates(_0x141cd5[_0xb6c7('0x48')],null))[_0xb6c7('0x24')](respondWithResult(_0x2116cb,null))[_0xb6c7('0x46')](handleError(_0x2116cb,null));};exports[_0xb6c7('0x49')]=function(_0x2278c0,_0x2002f8){return db['Cdr']['find']({'where':{'id':_0x2278c0[_0xb6c7('0x42')]['id']}})['then'](handleEntityNotFound(_0x2002f8,null))[_0xb6c7('0x24')](removeEntity(_0x2002f8,null))[_0xb6c7('0x46')](handleError(_0x2002f8,null));};exports[_0xb6c7('0x4a')]=function(_0x210d50,_0x317a4b){return db['Cdr'][_0xb6c7('0x4a')]()['then'](respondWithResult(_0x317a4b,null))[_0xb6c7('0x46')](handleError(_0x317a4b,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index a11f4a2..a8642dc 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2cf0eb,_0x3169b6){var _0x593250=function(_0x2d0382){while(--_0x2d0382){_0x2cf0eb['push'](_0x2cf0eb['shift']());}};_0x593250(++_0x3169b6);}(_0x7a54,0x106));var _0x47a5=function(_0x4be663,_0x4f54c1){_0x4be663=_0x4be663-0x0;var _0x455f08=_0x7a54[_0x4be663];return _0x455f08;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4eafcf,_0x458eb5){var _0x431945=function(_0x2f2777){while(--_0x2f2777){_0x4eafcf['push'](_0x4eafcf['shift']());}};_0x431945(++_0x458eb5);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 67f0cc1..3cd47e3 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 _0x9256=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x38e122,_0x2201e1){var _0x58ebe5=function(_0x34c3b4){while(--_0x34c3b4){_0x38e122['push'](_0x38e122['shift']());}};_0x58ebe5(++_0x2201e1);}(_0x9256,0x137));var _0x6925=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9256[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6925('0x0'));var moment=require(_0x6925('0x1'));var BPromise=require(_0x6925('0x2'));var rs=require(_0x6925('0x3'));var fs=require('fs');var Redis=require(_0x6925('0x4'));var db=require(_0x6925('0x5'))['db'];var utils=require(_0x6925('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6925('0x7'));var jayson=require(_0x6925('0x8'));var client=jayson['client'][_0x6925('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3778d2,_0x4530ff,_0x544e4b){return new BPromise(function(_0x33dff2,_0x3c52b1){return client['request'](_0x3778d2,_0x544e4b)[_0x6925('0xa')](function(_0x20f9e0){logger[_0x6925('0xb')](_0x6925('0xc'),_0x4530ff,_0x6925('0xd'));logger[_0x6925('0xe')](_0x6925('0xf'),_0x4530ff,_0x6925('0xd'),JSON[_0x6925('0x10')](_0x20f9e0));if(_0x20f9e0[_0x6925('0x11')]){if(_0x20f9e0[_0x6925('0x11')][_0x6925('0x12')]===0x1f4){logger['error'](_0x6925('0xc'),_0x4530ff,_0x20f9e0[_0x6925('0x11')][_0x6925('0x13')]);return _0x3c52b1(_0x20f9e0[_0x6925('0x11')][_0x6925('0x13')]);}logger[_0x6925('0x11')](_0x6925('0xc'),_0x4530ff,_0x20f9e0[_0x6925('0x11')][_0x6925('0x13')]);return _0x33dff2(_0x20f9e0['error'][_0x6925('0x13')]);}else{logger[_0x6925('0xb')]('Cdr,\x20%s,\x20%s',_0x4530ff,_0x6925('0xd'));_0x33dff2(_0x20f9e0['result'][_0x6925('0x13')]);}})[_0x6925('0x14')](function(_0x23291d){logger[_0x6925('0x11')](_0x6925('0xc'),_0x4530ff,_0x23291d);_0x3c52b1(_0x23291d);});});} \ No newline at end of file +var _0x8709=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x8476ab,_0x23ee0d){var _0x1d892d=function(_0x3f6596){while(--_0x3f6596){_0x8476ab['push'](_0x8476ab['shift']());}};_0x1d892d(++_0x23ee0d);}(_0x8709,0x90));var _0x9870=function(_0x4ef7e2,_0x257e37){_0x4ef7e2=_0x4ef7e2-0x0;var _0x84fa8=_0x8709[_0x4ef7e2];return _0x84fa8;};'use strict';var _=require('lodash');var util=require(_0x9870('0x0'));var moment=require(_0x9870('0x1'));var BPromise=require(_0x9870('0x2'));var rs=require(_0x9870('0x3'));var fs=require('fs');var Redis=require(_0x9870('0x4'));var db=require(_0x9870('0x5'))['db'];var utils=require(_0x9870('0x6'));var logger=require(_0x9870('0x7'))(_0x9870('0x8'));var config=require(_0x9870('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9870('0xa')][_0x9870('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54b9a6,_0x4ab315,_0x34cf72){return new BPromise(function(_0x1907f6,_0x591d5a){return client[_0x9870('0xc')](_0x54b9a6,_0x34cf72)[_0x9870('0xd')](function(_0x1f5e82){logger['info']('Cdr,\x20%s,\x20%s',_0x4ab315,_0x9870('0xe'));logger[_0x9870('0xf')](_0x9870('0x10'),_0x4ab315,_0x9870('0xe'),JSON[_0x9870('0x11')](_0x1f5e82));if(_0x1f5e82[_0x9870('0x12')]){if(_0x1f5e82['error'][_0x9870('0x13')]===0x1f4){logger[_0x9870('0x12')]('Cdr,\x20%s,\x20%s',_0x4ab315,_0x1f5e82[_0x9870('0x12')][_0x9870('0x14')]);return _0x591d5a(_0x1f5e82[_0x9870('0x12')]['message']);}logger['error'](_0x9870('0x15'),_0x4ab315,_0x1f5e82[_0x9870('0x12')][_0x9870('0x14')]);return _0x1907f6(_0x1f5e82[_0x9870('0x12')][_0x9870('0x14')]);}else{logger[_0x9870('0x16')]('Cdr,\x20%s,\x20%s',_0x4ab315,'request\x20sent');_0x1907f6(_0x1f5e82[_0x9870('0x17')][_0x9870('0x14')]);}})[_0x9870('0x18')](function(_0x1dd876){logger[_0x9870('0x12')](_0x9870('0x15'),_0x4ab315,_0x1dd876);_0x591d5a(_0x1dd876);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index ddba9f4..83626ac 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(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x56c6a9,_0x1239ee){var _0xa3ad43=function(_0x386c0a){while(--_0x386c0a){_0x56c6a9['push'](_0x56c6a9['shift']());}};_0xa3ad43(++_0x1239ee);}(_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 4643792..1821acb 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 _0x3e5c=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x12f762,_0x357113){var _0x3729d6=function(_0x148440){while(--_0x148440){_0x12f762['push'](_0x12f762['shift']());}};_0x3729d6(++_0x357113);}(_0x3e5c,0x6c));var _0xc3e5=function(_0x1bd272,_0x4530e6){_0x1bd272=_0x1bd272-0x0;var _0x3537b6=_0x3e5c[_0x1bd272];return _0x3537b6;};'use strict';var Sequelize=require(_0xc3e5('0x0'));module[_0xc3e5('0x1')]={'priority':{'type':Sequelize[_0xc3e5('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc3e5('0x3')},'appdata':{'type':Sequelize[_0xc3e5('0x4')]()},'description':{'type':Sequelize[_0xc3e5('0x5')]},'interval':{'type':Sequelize[_0xc3e5('0x5')],'defaultValue':_0xc3e5('0x6')}}; \ No newline at end of file +var _0xfc84=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4570ab,_0x5a97c1){var _0x531d8b=function(_0x58e635){while(--_0x58e635){_0x4570ab['push'](_0x4570ab['shift']());}};_0x531d8b(++_0x5a97c1);}(_0xfc84,0x97));var _0x4fc8=function(_0x323aab,_0x5df4b9){_0x323aab=_0x323aab-0x0;var _0xc0d363=_0xfc84[_0x323aab];return _0xc0d363;};'use strict';var Sequelize=require(_0x4fc8('0x0'));module[_0x4fc8('0x1')]={'priority':{'type':Sequelize[_0x4fc8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4fc8('0x3')],'allowNull':![],'defaultValue':_0x4fc8('0x4')},'appdata':{'type':Sequelize[_0x4fc8('0x5')]()},'description':{'type':Sequelize[_0x4fc8('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4fc8('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 81c9981..ad4f408 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 _0xde2c=['fields','length','includeAll','include','merge','find','then','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','save','update','destroy','error','name','send','show','params','keys','ChatApplication','rawAttributes','query','intersection','model','attributes'];(function(_0x1f2b7a,_0x3909d3){var _0x24fe01=function(_0x3a8c94){while(--_0x3a8c94){_0x1f2b7a['push'](_0x1f2b7a['shift']());}};_0x24fe01(++_0x3909d3);}(_0xde2c,0x7f));var _0xcde2=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xde2c[_0x5678b5];return _0x4c09a5;};'use strict';var emlformat=require(_0xcde2('0x0'));var rimraf=require(_0xcde2('0x1'));var zipdir=require(_0xcde2('0x2'));var jsonpatch=require(_0xcde2('0x3'));var rp=require(_0xcde2('0x4'));var moment=require(_0xcde2('0x5'));var BPromise=require(_0xcde2('0x6'));var Mustache=require(_0xcde2('0x7'));var util=require('util');var path=require(_0xcde2('0x8'));var sox=require(_0xcde2('0x9'));var csv=require(_0xcde2('0xa'));var ejs=require(_0xcde2('0xb'));var fs=require('fs');var fs_extra=require(_0xcde2('0xc'));var _=require('lodash');var squel=require(_0xcde2('0xd'));var crypto=require(_0xcde2('0xe'));var jsforce=require(_0xcde2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcde2('0x10'));var Papa=require(_0xcde2('0x11'));var Redis=require('ioredis');var authService=require(_0xcde2('0x12'));var qs=require(_0xcde2('0x13'));var as=require(_0xcde2('0x14'));var hardwareService=require(_0xcde2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcde2('0x16'));var config=require(_0xcde2('0x17'));var licenseUtil=require(_0xcde2('0x18'));var db=require(_0xcde2('0x19'))['db'];function respondWithStatusCode(_0x932b90,_0x1ea4bb){_0x1ea4bb=_0x1ea4bb||0xcc;return function(_0x599294){if(_0x599294){return _0x932b90[_0xcde2('0x1a')](_0x1ea4bb);}return _0x932b90['status'](_0x1ea4bb)[_0xcde2('0x1b')]();};}function respondWithResult(_0x4f0ac9,_0x4b0e0e){_0x4b0e0e=_0x4b0e0e||0xc8;return function(_0x34e079){if(_0x34e079){return _0x4f0ac9[_0xcde2('0x1c')](_0x4b0e0e)[_0xcde2('0x1d')](_0x34e079);}};}function respondWithFilteredResult(_0x19b54b,_0x11665c){return function(_0x5312c7){if(_0x5312c7){var _0x39b023=typeof _0x11665c['offset']===_0xcde2('0x1e')&&typeof _0x11665c[_0xcde2('0x1f')]===_0xcde2('0x1e');var _0x1f1858=_0x5312c7['count'];var _0x4fd5aa=_0x39b023?0x0:_0x11665c['offset'];var _0x2b4468=_0x39b023?_0x5312c7['count']:_0x11665c[_0xcde2('0x20')]+_0x11665c[_0xcde2('0x1f')];var _0x252372;if(_0x2b4468>=_0x1f1858){_0x2b4468=_0x1f1858;_0x252372=0xc8;}else{_0x252372=0xce;}_0x19b54b['status'](_0x252372);return _0x19b54b[_0xcde2('0x21')](_0xcde2('0x22'),_0x4fd5aa+'-'+_0x2b4468+'/'+_0x1f1858)[_0xcde2('0x1d')](_0x5312c7);}return null;};}function patchUpdates(_0x3c1d7e){return function(_0x43df7a){try{jsonpatch['apply'](_0x43df7a,_0x3c1d7e,!![]);}catch(_0x4bce90){return BPromise['reject'](_0x4bce90);}return _0x43df7a[_0xcde2('0x23')]();};}function saveUpdates(_0x3e5170,_0x2c9562){return function(_0x4063d4){if(_0x4063d4){return _0x4063d4[_0xcde2('0x24')](_0x3e5170)['then'](function(_0x1104b8){return _0x1104b8;});}return null;};}function removeEntity(_0x52368b,_0x280d8c){return function(_0xb2123c){if(_0xb2123c){return _0xb2123c[_0xcde2('0x25')]()['then'](function(){_0x52368b['status'](0xcc)[_0xcde2('0x1b')]();});}};}function handleEntityNotFound(_0x207a12,_0x3e8aaf){return function(_0x217ec9){if(!_0x217ec9){_0x207a12[_0xcde2('0x1a')](0x194);}return _0x217ec9;};}function handleError(_0x5a5b92,_0x2d1d17){_0x2d1d17=_0x2d1d17||0x1f4;return function(_0x45275a){logger[_0xcde2('0x26')](_0x45275a['stack']);if(_0x45275a[_0xcde2('0x27')]){delete _0x45275a[_0xcde2('0x27')];}_0x5a5b92[_0xcde2('0x1c')](_0x2d1d17)[_0xcde2('0x28')](_0x45275a);};}exports[_0xcde2('0x29')]=function(_0x5b2b7,_0x40b12c){var _0x3e492f={'raw':!![],'where':{'id':_0x5b2b7[_0xcde2('0x2a')]['id']}},_0x5bf1e6={};_0x5bf1e6['model']=_[_0xcde2('0x2b')](db[_0xcde2('0x2c')][_0xcde2('0x2d')]);_0x5bf1e6['query']=_[_0xcde2('0x2b')](_0x5b2b7[_0xcde2('0x2e')]);_0x5bf1e6['filters']=_[_0xcde2('0x2f')](_0x5bf1e6[_0xcde2('0x30')],_0x5bf1e6[_0xcde2('0x2e')]);_0x3e492f[_0xcde2('0x31')]=_[_0xcde2('0x2f')](_0x5bf1e6[_0xcde2('0x30')],qs[_0xcde2('0x32')](_0x5b2b7[_0xcde2('0x2e')]['fields']));_0x3e492f[_0xcde2('0x31')]=_0x3e492f[_0xcde2('0x31')][_0xcde2('0x33')]?_0x3e492f[_0xcde2('0x31')]:_0x5bf1e6['model'];if(_0x5b2b7[_0xcde2('0x2e')][_0xcde2('0x34')]){_0x3e492f[_0xcde2('0x35')]=[{'all':!![]}];}_0x3e492f=_[_0xcde2('0x36')]({},_0x3e492f,_0x5b2b7['options']);return db[_0xcde2('0x2c')][_0xcde2('0x37')](_0x3e492f)[_0xcde2('0x38')](handleEntityNotFound(_0x40b12c,null))[_0xcde2('0x38')](respondWithResult(_0x40b12c,null))['catch'](handleError(_0x40b12c,null));};exports[_0xcde2('0x24')]=function(_0x5ab40f,_0xbde4f4){if(_0x5ab40f[_0xcde2('0x39')]['id']){delete _0x5ab40f[_0xcde2('0x39')]['id'];}return db['ChatApplication'][_0xcde2('0x37')]({'where':{'id':_0x5ab40f[_0xcde2('0x2a')]['id']}})[_0xcde2('0x38')](handleEntityNotFound(_0xbde4f4,null))[_0xcde2('0x38')](saveUpdates(_0x5ab40f['body'],null))['then'](respondWithResult(_0xbde4f4,null))[_0xcde2('0x3a')](handleError(_0xbde4f4,null));};exports[_0xcde2('0x25')]=function(_0x40e1e2,_0x4463d1){return db[_0xcde2('0x2c')][_0xcde2('0x37')]({'where':{'id':_0x40e1e2[_0xcde2('0x2a')]['id']}})[_0xcde2('0x38')](handleEntityNotFound(_0x4463d1,null))[_0xcde2('0x38')](removeEntity(_0x4463d1,null))['catch'](handleError(_0x4463d1,null));}; \ No newline at end of file +var _0xe493=['then','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','params','keys','ChatApplication','rawAttributes','query','model','attributes','intersection','fields','length','includeAll','include','merge','options'];(function(_0x2dca49,_0x66a57e){var _0x3df140=function(_0x583752){while(--_0x583752){_0x2dca49['push'](_0x2dca49['shift']());}};_0x3df140(++_0x66a57e);}(_0xe493,0x7e));var _0x3e49=function(_0x6b055c,_0x5d9aee){_0x6b055c=_0x6b055c-0x0;var _0x14f684=_0xe493[_0x6b055c];return _0x14f684;};'use strict';var emlformat=require(_0x3e49('0x0'));var rimraf=require(_0x3e49('0x1'));var zipdir=require(_0x3e49('0x2'));var jsonpatch=require(_0x3e49('0x3'));var rp=require(_0x3e49('0x4'));var moment=require('moment');var BPromise=require(_0x3e49('0x5'));var Mustache=require(_0x3e49('0x6'));var util=require('util');var path=require(_0x3e49('0x7'));var sox=require('sox');var csv=require(_0x3e49('0x8'));var ejs=require(_0x3e49('0x9'));var fs=require('fs');var fs_extra=require(_0x3e49('0xa'));var _=require(_0x3e49('0xb'));var squel=require(_0x3e49('0xc'));var crypto=require(_0x3e49('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e49('0xe'));var Papa=require(_0x3e49('0xf'));var Redis=require(_0x3e49('0x10'));var authService=require(_0x3e49('0x11'));var qs=require(_0x3e49('0x12'));var as=require(_0x3e49('0x13'));var hardwareService=require(_0x3e49('0x14'));var logger=require(_0x3e49('0x15'))(_0x3e49('0x16'));var utils=require(_0x3e49('0x17'));var config=require(_0x3e49('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e49('0x19'))['db'];function respondWithStatusCode(_0x3c9410,_0x56114b){_0x56114b=_0x56114b||0xcc;return function(_0x2539a7){if(_0x2539a7){return _0x3c9410[_0x3e49('0x1a')](_0x56114b);}return _0x3c9410['status'](_0x56114b)[_0x3e49('0x1b')]();};}function respondWithResult(_0x40504b,_0x54463c){_0x54463c=_0x54463c||0xc8;return function(_0x258db5){if(_0x258db5){return _0x40504b[_0x3e49('0x1c')](_0x54463c)[_0x3e49('0x1d')](_0x258db5);}};}function respondWithFilteredResult(_0x238d1b,_0x401e84){return function(_0x3a9685){if(_0x3a9685){var _0x46d813=typeof _0x401e84[_0x3e49('0x1e')]===_0x3e49('0x1f')&&typeof _0x401e84[_0x3e49('0x20')]===_0x3e49('0x1f');var _0x1826ac=_0x3a9685[_0x3e49('0x21')];var _0x3ae5f4=_0x46d813?0x0:_0x401e84[_0x3e49('0x1e')];var _0x4e1cdf=_0x46d813?_0x3a9685[_0x3e49('0x21')]:_0x401e84['offset']+_0x401e84[_0x3e49('0x20')];var _0x524707;if(_0x4e1cdf>=_0x1826ac){_0x4e1cdf=_0x1826ac;_0x524707=0xc8;}else{_0x524707=0xce;}_0x238d1b[_0x3e49('0x1c')](_0x524707);return _0x238d1b['set'](_0x3e49('0x22'),_0x3ae5f4+'-'+_0x4e1cdf+'/'+_0x1826ac)[_0x3e49('0x1d')](_0x3a9685);}return null;};}function patchUpdates(_0x420d7b){return function(_0x5a4e67){try{jsonpatch[_0x3e49('0x23')](_0x5a4e67,_0x420d7b,!![]);}catch(_0x5ce419){return BPromise[_0x3e49('0x24')](_0x5ce419);}return _0x5a4e67[_0x3e49('0x25')]();};}function saveUpdates(_0x323be5,_0x5e0f1d){return function(_0x547c3b){if(_0x547c3b){return _0x547c3b[_0x3e49('0x26')](_0x323be5)['then'](function(_0x12d71a){return _0x12d71a;});}return null;};}function removeEntity(_0x1b338b,_0x567d13){return function(_0x5b85df){if(_0x5b85df){return _0x5b85df[_0x3e49('0x27')]()['then'](function(){_0x1b338b[_0x3e49('0x1c')](0xcc)[_0x3e49('0x1b')]();});}};}function handleEntityNotFound(_0x1bdb3e,_0x38cbe0){return function(_0x538547){if(!_0x538547){_0x1bdb3e[_0x3e49('0x1a')](0x194);}return _0x538547;};}function handleError(_0x469d8d,_0xd573d7){_0xd573d7=_0xd573d7||0x1f4;return function(_0x1710e8){logger[_0x3e49('0x28')](_0x1710e8[_0x3e49('0x29')]);if(_0x1710e8[_0x3e49('0x2a')]){delete _0x1710e8[_0x3e49('0x2a')];}_0x469d8d[_0x3e49('0x1c')](_0xd573d7)['send'](_0x1710e8);};}exports['show']=function(_0x5aea97,_0x1d6680){var _0x366c78={'raw':!![],'where':{'id':_0x5aea97[_0x3e49('0x2b')]['id']}},_0x486057={};_0x486057['model']=_[_0x3e49('0x2c')](db[_0x3e49('0x2d')][_0x3e49('0x2e')]);_0x486057[_0x3e49('0x2f')]=_['keys'](_0x5aea97[_0x3e49('0x2f')]);_0x486057['filters']=_['intersection'](_0x486057[_0x3e49('0x30')],_0x486057[_0x3e49('0x2f')]);_0x366c78[_0x3e49('0x31')]=_[_0x3e49('0x32')](_0x486057[_0x3e49('0x30')],qs[_0x3e49('0x33')](_0x5aea97[_0x3e49('0x2f')][_0x3e49('0x33')]));_0x366c78['attributes']=_0x366c78[_0x3e49('0x31')][_0x3e49('0x34')]?_0x366c78[_0x3e49('0x31')]:_0x486057[_0x3e49('0x30')];if(_0x5aea97[_0x3e49('0x2f')][_0x3e49('0x35')]){_0x366c78[_0x3e49('0x36')]=[{'all':!![]}];}_0x366c78=_[_0x3e49('0x37')]({},_0x366c78,_0x5aea97[_0x3e49('0x38')]);return db[_0x3e49('0x2d')]['find'](_0x366c78)[_0x3e49('0x39')](handleEntityNotFound(_0x1d6680,null))[_0x3e49('0x39')](respondWithResult(_0x1d6680,null))[_0x3e49('0x3a')](handleError(_0x1d6680,null));};exports[_0x3e49('0x26')]=function(_0xa474a1,_0x27380c){if(_0xa474a1[_0x3e49('0x3b')]['id']){delete _0xa474a1[_0x3e49('0x3b')]['id'];}return db[_0x3e49('0x2d')][_0x3e49('0x3c')]({'where':{'id':_0xa474a1['params']['id']}})['then'](handleEntityNotFound(_0x27380c,null))[_0x3e49('0x39')](saveUpdates(_0xa474a1[_0x3e49('0x3b')],null))[_0x3e49('0x39')](respondWithResult(_0x27380c,null))[_0x3e49('0x3a')](handleError(_0x27380c,null));};exports[_0x3e49('0x27')]=function(_0x4d8475,_0x129e62){return db[_0x3e49('0x2d')][_0x3e49('0x3c')]({'where':{'id':_0x4d8475['params']['id']}})['then'](handleEntityNotFound(_0x129e62,null))['then'](removeEntity(_0x129e62,null))[_0x3e49('0x3a')](handleError(_0x129e62,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 54ea553..e24792d 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 _0x67f0=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x67f0,0x1b0));var _0x067f=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0x67f0[_0x837dad];return _0x1d62d3;};'use strict';var _=require(_0x067f('0x0'));var util=require(_0x067f('0x1'));var logger=require(_0x067f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x067f('0x3'));var rp=require(_0x067f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x067f('0x5'));var config=require(_0x067f('0x6'));var attributes=require(_0x067f('0x7'));module[_0x067f('0x8')]=function(_0x2d64d9,_0x5f1c12){return _0x2d64d9[_0x067f('0x9')](_0x067f('0xa'),attributes,{'tableName':_0x067f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x067f('0xc'),'collate':_0x067f('0xd')});}; \ No newline at end of file +var _0xca99=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x2a7680,_0x9992d8){var _0x44d8a1=function(_0x581d8b){while(--_0x581d8b){_0x2a7680['push'](_0x2a7680['shift']());}};_0x44d8a1(++_0x9992d8);}(_0xca99,0x186));var _0x9ca9=function(_0x1ca4cc,_0x402c23){_0x1ca4cc=_0x1ca4cc-0x0;var _0x108010=_0xca99[_0x1ca4cc];return _0x108010;};'use strict';var _=require(_0x9ca9('0x0'));var util=require(_0x9ca9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9ca9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ca9('0x3'));var rimraf=require(_0x9ca9('0x4'));var config=require(_0x9ca9('0x5'));var attributes=require(_0x9ca9('0x6'));module[_0x9ca9('0x7')]=function(_0x5294e4,_0x8f5ff3){return _0x5294e4[_0x9ca9('0x8')](_0x9ca9('0x9'),attributes,{'tableName':_0x9ca9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ca9('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index bd4c678..978f2e0 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 _0x8c48=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3103af,_0xfc6e7a){var _0x53f990=function(_0x1e8a02){while(--_0x1e8a02){_0x3103af['push'](_0x3103af['shift']());}};_0x53f990(++_0xfc6e7a);}(_0x8c48,0x19d));var _0x88c4=function(_0x570f62,_0x4a5c5c){_0x570f62=_0x570f62-0x0;var _0x20fc72=_0x8c48[_0x570f62];return _0x20fc72;};'use strict';var _=require(_0x88c4('0x0'));var util=require(_0x88c4('0x1'));var moment=require(_0x88c4('0x2'));var BPromise=require(_0x88c4('0x3'));var rs=require(_0x88c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88c4('0x5'))['db'];var utils=require(_0x88c4('0x6'));var logger=require(_0x88c4('0x7'))(_0x88c4('0x8'));var config=require(_0x88c4('0x9'));var jayson=require(_0x88c4('0xa'));var client=jayson[_0x88c4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x501eb3,_0x27f6bd,_0x1540c4){return new BPromise(function(_0x57d15f,_0x5f0d94){return client['request'](_0x501eb3,_0x1540c4)[_0x88c4('0xc')](function(_0x30ffc2){logger['info'](_0x88c4('0xd'),_0x27f6bd,_0x88c4('0xe'));logger[_0x88c4('0xf')](_0x88c4('0x10'),_0x27f6bd,_0x88c4('0xe'),JSON[_0x88c4('0x11')](_0x30ffc2));if(_0x30ffc2['error']){if(_0x30ffc2[_0x88c4('0x12')][_0x88c4('0x13')]===0x1f4){logger['error'](_0x88c4('0xd'),_0x27f6bd,_0x30ffc2['error'][_0x88c4('0x14')]);return _0x5f0d94(_0x30ffc2['error'][_0x88c4('0x14')]);}logger[_0x88c4('0x12')](_0x88c4('0xd'),_0x27f6bd,_0x30ffc2[_0x88c4('0x12')]['message']);return _0x57d15f(_0x30ffc2[_0x88c4('0x12')][_0x88c4('0x14')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x27f6bd,_0x88c4('0xe'));_0x57d15f(_0x30ffc2[_0x88c4('0x15')]['message']);}})[_0x88c4('0x16')](function(_0x1c2752){logger[_0x88c4('0x12')](_0x88c4('0xd'),_0x27f6bd,_0x1c2752);_0x5f0d94(_0x1c2752);});});} \ No newline at end of file +var _0x52c0=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x2d1fdb,_0x50d2de){var _0x19e74b=function(_0x30fee6){while(--_0x30fee6){_0x2d1fdb['push'](_0x2d1fdb['shift']());}};_0x19e74b(++_0x50d2de);}(_0x52c0,0x1e2));var _0x052c=function(_0x18c790,_0x2e5ce6){_0x18c790=_0x18c790-0x0;var _0x2ae38e=_0x52c0[_0x18c790];return _0x2ae38e;};'use strict';var _=require('lodash');var util=require(_0x052c('0x0'));var moment=require(_0x052c('0x1'));var BPromise=require(_0x052c('0x2'));var rs=require(_0x052c('0x3'));var fs=require('fs');var Redis=require(_0x052c('0x4'));var db=require(_0x052c('0x5'))['db'];var utils=require(_0x052c('0x6'));var logger=require(_0x052c('0x7'))(_0x052c('0x8'));var config=require(_0x052c('0x9'));var jayson=require(_0x052c('0xa'));var client=jayson[_0x052c('0xb')][_0x052c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1870aa,_0x4cba16,_0x493f5f){return new BPromise(function(_0x187ff5,_0x1042b9){return client[_0x052c('0xd')](_0x1870aa,_0x493f5f)[_0x052c('0xe')](function(_0x419bf4){logger[_0x052c('0xf')](_0x052c('0x10'),_0x4cba16,_0x052c('0x11'));logger[_0x052c('0x12')](_0x052c('0x13'),_0x4cba16,_0x052c('0x11'),JSON[_0x052c('0x14')](_0x419bf4));if(_0x419bf4[_0x052c('0x15')]){if(_0x419bf4[_0x052c('0x15')]['code']===0x1f4){logger[_0x052c('0x15')]('ChatApplication,\x20%s,\x20%s',_0x4cba16,_0x419bf4[_0x052c('0x15')][_0x052c('0x16')]);return _0x1042b9(_0x419bf4[_0x052c('0x15')][_0x052c('0x16')]);}logger[_0x052c('0x15')](_0x052c('0x10'),_0x4cba16,_0x419bf4[_0x052c('0x15')][_0x052c('0x16')]);return _0x187ff5(_0x419bf4[_0x052c('0x15')][_0x052c('0x16')]);}else{logger[_0x052c('0xf')](_0x052c('0x10'),_0x4cba16,_0x052c('0x11'));_0x187ff5(_0x419bf4[_0x052c('0x17')][_0x052c('0x16')]);}})[_0x052c('0x18')](function(_0x575898){logger[_0x052c('0x15')](_0x052c('0x10'),_0x4cba16,_0x575898);_0x1042b9(_0x575898);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 63f5224..0106c1c 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 _0x738f=['show','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x4668cd,_0x451c67){var _0x37da3c=function(_0x1ab264){while(--_0x1ab264){_0x4668cd['push'](_0x4668cd['shift']());}};_0x37da3c(++_0x451c67);}(_0x738f,0x76));var _0xf738=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0x738f[_0x9edfd5];return _0x330738;};'use strict';var multer=require(_0xf738('0x0'));var util=require(_0xf738('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf738('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf738('0x3'));var interaction=require(_0xf738('0x4'));var config=require(_0xf738('0x5'));var controller=require(_0xf738('0x6'));router[_0xf738('0x7')](_0xf738('0x8'),auth[_0xf738('0x9')](),controller[_0xf738('0xa')]);router[_0xf738('0xb')](_0xf738('0x8'),auth['isAuthenticated'](),controller[_0xf738('0xc')]);router[_0xf738('0xd')]('/:id',auth[_0xf738('0x9')](),controller[_0xf738('0xe')]);module[_0xf738('0xf')]=router; \ No newline at end of file +var _0x3607=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x3607,0xe3));var _0x7360=function(_0x4cb91c,_0x131bd4){_0x4cb91c=_0x4cb91c-0x0;var _0x3bd919=_0x3607[_0x4cb91c];return _0x3bd919;};'use strict';var multer=require('multer');var util=require(_0x7360('0x0'));var path=require('path');var timeout=require(_0x7360('0x1'));var express=require(_0x7360('0x2'));var router=express[_0x7360('0x3')]();var fs_extra=require(_0x7360('0x4'));var auth=require(_0x7360('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7360('0x6'));var controller=require(_0x7360('0x7'));router[_0x7360('0x8')](_0x7360('0x9'),auth[_0x7360('0xa')](),controller['show']);router[_0x7360('0xb')](_0x7360('0x9'),auth['isAuthenticated'](),controller[_0x7360('0xc')]);router[_0x7360('0xd')](_0x7360('0x9'),auth[_0x7360('0xa')](),controller[_0x7360('0xe')]);module[_0x7360('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index cffea51..e64ce73 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 _0x5b8a=['STRING'];(function(_0xc66d99,_0x1e5330){var _0x55ced8=function(_0x2f3c6a){while(--_0x2f3c6a){_0xc66d99['push'](_0xc66d99['shift']());}};_0x55ced8(++_0x1e5330);}(_0x5b8a,0x119));var _0xa5b8=function(_0x253792,_0x10aa93){_0x253792=_0x253792-0x0;var _0x446ab5=_0x5b8a[_0x253792];return _0x446ab5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa5b8('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x3e24=['exports','STRING','BOOLEAN','sequelize'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x3e24,0x167));var _0x43e2=function(_0x4045ff,_0x46cbcd){_0x4045ff=_0x4045ff-0x0;var _0x5797ac=_0x3e24[_0x4045ff];return _0x5797ac;};'use strict';var Sequelize=require(_0x43e2('0x0'));module[_0x43e2('0x1')]={'name':{'type':Sequelize[_0x43e2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x43e2('0x2')]},'write':{'type':Sequelize[_0x43e2('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 354efa6..d71fed4 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 _0xcc36=['name','send','index','map','ChatGroup','fieldName','key','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','catch','show','params','keys','rawAttributes','include','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','pick','removeMembers','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack'];(function(_0x293ff3,_0xaf4417){var _0x3c6fef=function(_0x8b2de9){while(--_0x8b2de9){_0x293ff3['push'](_0x293ff3['shift']());}};_0x3c6fef(++_0xaf4417);}(_0xcc36,0x8d));var _0x6cc3=function(_0x80b1f1,_0x4011e){_0x80b1f1=_0x80b1f1-0x0;var _0x39dec8=_0xcc36[_0x80b1f1];return _0x39dec8;};'use strict';var emlformat=require(_0x6cc3('0x0'));var rimraf=require(_0x6cc3('0x1'));var zipdir=require(_0x6cc3('0x2'));var jsonpatch=require(_0x6cc3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6cc3('0x4'));var Mustache=require(_0x6cc3('0x5'));var util=require(_0x6cc3('0x6'));var path=require('path');var sox=require(_0x6cc3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6cc3('0x8'));var _=require(_0x6cc3('0x9'));var squel=require('squel');var crypto=require(_0x6cc3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6cc3('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6cc3('0xc'));var Redis=require(_0x6cc3('0xd'));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(_0x6cc3('0xe'))(_0x6cc3('0xf'));var utils=require('../../config/utils');var config=require(_0x6cc3('0x10'));var licenseUtil=require(_0x6cc3('0x11'));var db=require(_0x6cc3('0x12'))['db'];config[_0x6cc3('0x13')]=_[_0x6cc3('0x14')](config['redis'],{'host':_0x6cc3('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6cc3('0x13')]));require(_0x6cc3('0x16'))[_0x6cc3('0x17')](socket);function respondWithStatusCode(_0x472bda,_0x7de057){_0x7de057=_0x7de057||0xcc;return function(_0x80ee6d){if(_0x80ee6d){return _0x472bda[_0x6cc3('0x18')](_0x7de057);}return _0x472bda[_0x6cc3('0x19')](_0x7de057)[_0x6cc3('0x1a')]();};}function respondWithResult(_0x263f8f,_0x3f4256){_0x3f4256=_0x3f4256||0xc8;return function(_0x3c447b){if(_0x3c447b){return _0x263f8f[_0x6cc3('0x19')](_0x3f4256)[_0x6cc3('0x1b')](_0x3c447b);}};}function respondWithFilteredResult(_0x1544bd,_0x28d524){return function(_0x1ba1f6){if(_0x1ba1f6){var _0x2f4d9e=typeof _0x28d524[_0x6cc3('0x1c')]===_0x6cc3('0x1d')&&typeof _0x28d524[_0x6cc3('0x1e')]===_0x6cc3('0x1d');var _0x18b6d0=_0x1ba1f6[_0x6cc3('0x1f')];var _0x2436a9=_0x2f4d9e?0x0:_0x28d524[_0x6cc3('0x1c')];var _0x4327f4=_0x2f4d9e?_0x1ba1f6['count']:_0x28d524[_0x6cc3('0x1c')]+_0x28d524[_0x6cc3('0x1e')];var _0x308a15;if(_0x4327f4>=_0x18b6d0){_0x4327f4=_0x18b6d0;_0x308a15=0xc8;}else{_0x308a15=0xce;}_0x1544bd[_0x6cc3('0x19')](_0x308a15);return _0x1544bd[_0x6cc3('0x20')](_0x6cc3('0x21'),_0x2436a9+'-'+_0x4327f4+'/'+_0x18b6d0)[_0x6cc3('0x1b')](_0x1ba1f6);}return null;};}function patchUpdates(_0x4f7fa9){return function(_0x213ca4){try{jsonpatch[_0x6cc3('0x22')](_0x213ca4,_0x4f7fa9,!![]);}catch(_0x36aec5){return BPromise[_0x6cc3('0x23')](_0x36aec5);}return _0x213ca4[_0x6cc3('0x24')]();};}function saveUpdates(_0x22a10b,_0x2861b7){return function(_0x5be8a4){if(_0x5be8a4){return _0x5be8a4[_0x6cc3('0x25')](_0x22a10b)[_0x6cc3('0x26')](function(_0x479c4c){return _0x479c4c;});}return null;};}function removeEntity(_0x58f82b,_0x5adba8){return function(_0x3b6ae9){if(_0x3b6ae9){return _0x3b6ae9['destroy']()['then'](function(){_0x58f82b[_0x6cc3('0x19')](0xcc)[_0x6cc3('0x1a')]();});}};}function handleEntityNotFound(_0x35d9be,_0x31c8e0){return function(_0x2420c8){if(!_0x2420c8){_0x35d9be[_0x6cc3('0x18')](0x194);}return _0x2420c8;};}function handleError(_0x3a097b,_0x4b4758){_0x4b4758=_0x4b4758||0x1f4;return function(_0x2d5b31){logger[_0x6cc3('0x27')](_0x2d5b31[_0x6cc3('0x28')]);if(_0x2d5b31[_0x6cc3('0x29')]){delete _0x2d5b31[_0x6cc3('0x29')];}_0x3a097b['status'](_0x4b4758)[_0x6cc3('0x2a')](_0x2d5b31);};}exports[_0x6cc3('0x2b')]=function(_0x33e6e9,_0x4783f9){var _0x760a84={},_0x464975={},_0x1d6b57={'count':0x0,'rows':[]};var _0x1f3277=_[_0x6cc3('0x2c')](db[_0x6cc3('0x2d')]['rawAttributes'],function(_0x3c88f1){return{'name':_0x3c88f1[_0x6cc3('0x2e')],'type':_0x3c88f1['type'][_0x6cc3('0x2f')]};});_0x464975['model']=_['map'](_0x1f3277,_0x6cc3('0x29'));_0x464975['query']=_['keys'](_0x33e6e9['query']);_0x464975[_0x6cc3('0x30')]=_[_0x6cc3('0x31')](_0x464975[_0x6cc3('0x32')],_0x464975[_0x6cc3('0x33')]);_0x760a84['attributes']=_['intersection'](_0x464975[_0x6cc3('0x32')],qs[_0x6cc3('0x34')](_0x33e6e9[_0x6cc3('0x33')]['fields']));_0x760a84['attributes']=_0x760a84[_0x6cc3('0x35')][_0x6cc3('0x36')]?_0x760a84[_0x6cc3('0x35')]:_0x464975['model'];if(!_0x33e6e9[_0x6cc3('0x33')][_0x6cc3('0x37')](_0x6cc3('0x38'))){_0x760a84[_0x6cc3('0x1e')]=qs['limit'](_0x33e6e9['query'][_0x6cc3('0x1e')]);_0x760a84[_0x6cc3('0x1c')]=qs[_0x6cc3('0x1c')](_0x33e6e9[_0x6cc3('0x33')][_0x6cc3('0x1c')]);}_0x760a84['order']=qs['sort'](_0x33e6e9[_0x6cc3('0x33')][_0x6cc3('0x39')]);_0x760a84[_0x6cc3('0x3a')]=qs['filters'](_['pick'](_0x33e6e9[_0x6cc3('0x33')],_0x464975[_0x6cc3('0x30')]),_0x1f3277);if(_0x33e6e9['query']['filter']){_0x760a84['where']=_[_0x6cc3('0x3b')](_0x760a84[_0x6cc3('0x3a')],{'$or':_[_0x6cc3('0x2c')](_0x1f3277,function(_0x1ef286){if(_0x1ef286['type']!==_0x6cc3('0x3c')){var _0x572167={};_0x572167[_0x1ef286[_0x6cc3('0x29')]]={'$like':'%'+_0x33e6e9[_0x6cc3('0x33')][_0x6cc3('0x3d')]+'%'};return _0x572167;}})});}_0x760a84=_[_0x6cc3('0x3b')]({},_0x760a84,_0x33e6e9[_0x6cc3('0x3e')]);var _0x4a5da7={'where':_0x760a84[_0x6cc3('0x3a')]};return db[_0x6cc3('0x2d')]['count'](_0x4a5da7)['then'](function(_0x2e3d80){_0x1d6b57[_0x6cc3('0x1f')]=_0x2e3d80;if(_0x33e6e9[_0x6cc3('0x33')]['includeAll']){_0x760a84['include']=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x760a84);})['then'](function(_0x3c2e40){_0x1d6b57['rows']=_0x3c2e40;return _0x1d6b57;})[_0x6cc3('0x26')](respondWithFilteredResult(_0x4783f9,_0x760a84))[_0x6cc3('0x3f')](handleError(_0x4783f9,null));};exports[_0x6cc3('0x40')]=function(_0x55159b,_0x2327ed){var _0x2173a2={'raw':!![],'where':{'id':_0x55159b[_0x6cc3('0x41')]['id']}},_0xd5abca={};_0xd5abca['model']=_[_0x6cc3('0x42')](db[_0x6cc3('0x2d')][_0x6cc3('0x43')]);_0xd5abca[_0x6cc3('0x33')]=_['keys'](_0x55159b[_0x6cc3('0x33')]);_0xd5abca['filters']=_[_0x6cc3('0x31')](_0xd5abca[_0x6cc3('0x32')],_0xd5abca[_0x6cc3('0x33')]);_0x2173a2['attributes']=_['intersection'](_0xd5abca[_0x6cc3('0x32')],qs[_0x6cc3('0x34')](_0x55159b[_0x6cc3('0x33')]['fields']));_0x2173a2['attributes']=_0x2173a2[_0x6cc3('0x35')]['length']?_0x2173a2[_0x6cc3('0x35')]:_0xd5abca['model'];if(_0x55159b[_0x6cc3('0x33')]['includeAll']){_0x2173a2[_0x6cc3('0x44')]=[{'all':!![]}];}_0x2173a2=_['merge']({},_0x2173a2,_0x55159b[_0x6cc3('0x3e')]);return db[_0x6cc3('0x2d')][_0x6cc3('0x45')](_0x2173a2)[_0x6cc3('0x26')](handleEntityNotFound(_0x2327ed,null))[_0x6cc3('0x26')](respondWithResult(_0x2327ed,null))['catch'](handleError(_0x2327ed,null));};exports[_0x6cc3('0x46')]=function(_0x5f01f9,_0x233389){return db[_0x6cc3('0x2d')][_0x6cc3('0x46')](_0x5f01f9[_0x6cc3('0x47')],{})[_0x6cc3('0x26')](respondWithResult(_0x233389,0xc9))[_0x6cc3('0x3f')](handleError(_0x233389,null));};exports[_0x6cc3('0x25')]=function(_0x48e210,_0x4bc97a){if(_0x48e210[_0x6cc3('0x47')]['id']){delete _0x48e210['body']['id'];}return db[_0x6cc3('0x2d')]['find']({'where':{'id':_0x48e210[_0x6cc3('0x41')]['id']}})[_0x6cc3('0x26')](handleEntityNotFound(_0x4bc97a,null))[_0x6cc3('0x26')](saveUpdates(_0x48e210['body'],null))['then'](respondWithResult(_0x4bc97a,null))[_0x6cc3('0x3f')](handleError(_0x4bc97a,null));};exports[_0x6cc3('0x48')]=function(_0x29e027,_0x429191){return db[_0x6cc3('0x2d')]['find']({'where':{'id':_0x29e027[_0x6cc3('0x41')]['id']}})['then'](handleEntityNotFound(_0x429191,null))[_0x6cc3('0x26')](removeEntity(_0x429191,null))['catch'](handleError(_0x429191,null));};exports[_0x6cc3('0x49')]=function(_0x3626ec,_0x993733){return db[_0x6cc3('0x2d')][_0x6cc3('0x49')]()['then'](respondWithResult(_0x993733,null))[_0x6cc3('0x3f')](handleError(_0x993733,null));};exports[_0x6cc3('0x4a')]=function(_0x1f75bb,_0x596c41,_0x1be5ee){return db[_0x6cc3('0x4b')][_0x6cc3('0x1f')]({'where':{'ChatGroupId':_0x1f75bb['params']['id'],'ToId':_0x1f75bb[_0x6cc3('0x4c')]['id'],'read':![]}})[_0x6cc3('0x26')](function(_0x550e53){return{'id':_[_0x6cc3('0x4d')](_0x1f75bb[_0x6cc3('0x41')]['id']),'count':_0x550e53};})[_0x6cc3('0x26')](respondWithResult(_0x596c41,null))[_0x6cc3('0x3f')](handleError(_0x596c41,null));};exports[_0x6cc3('0x4e')]=function(_0x32ba0b,_0x2f6314,_0x3adeaa){return db['ChatGroup'][_0x6cc3('0x45')]({'where':{'id':_0x32ba0b[_0x6cc3('0x41')]['id']}})[_0x6cc3('0x26')](handleEntityNotFound(_0x2f6314,null))[_0x6cc3('0x26')](function(_0x2b566b){if(_0x2b566b){return _0x2b566b[_0x6cc3('0x4e')](_0x32ba0b[_0x6cc3('0x47')][_0x6cc3('0x4f')],_[_0x6cc3('0x50')](_0x32ba0b['body'],[_0x6cc3('0x4f'),'id'])||{});}})[_0x6cc3('0x26')](respondWithResult(_0x2f6314,null))[_0x6cc3('0x3f')](handleError(_0x2f6314,null));};exports[_0x6cc3('0x51')]=function(_0x1d5251,_0x5d2dbf,_0x1fd9e7){var _0x2ebc01={};var _0x5a0720={};var _0x39e490;var _0x122c5a;return db['ChatGroup'][_0x6cc3('0x52')]({'where':{'id':_0x1d5251[_0x6cc3('0x41')]['id']}})[_0x6cc3('0x26')](handleEntityNotFound(_0x5d2dbf,null))[_0x6cc3('0x26')](function(_0x522d4b){if(_0x522d4b){_0x39e490=_0x522d4b;_0x5a0720[_0x6cc3('0x32')]=_[_0x6cc3('0x42')](db[_0x6cc3('0x53')][_0x6cc3('0x43')]);_0x5a0720[_0x6cc3('0x33')]=_[_0x6cc3('0x42')](_0x1d5251[_0x6cc3('0x33')]);_0x5a0720['filters']=_[_0x6cc3('0x31')](_0x5a0720[_0x6cc3('0x32')],_0x5a0720[_0x6cc3('0x33')]);_0x2ebc01[_0x6cc3('0x35')]=_[_0x6cc3('0x31')](_0x5a0720['model'],qs[_0x6cc3('0x34')](_0x1d5251[_0x6cc3('0x33')][_0x6cc3('0x34')]));_0x2ebc01[_0x6cc3('0x35')]=_0x2ebc01[_0x6cc3('0x35')][_0x6cc3('0x36')]?_0x2ebc01[_0x6cc3('0x35')]:_0x5a0720['model'];_0x2ebc01[_0x6cc3('0x54')]=qs['sort'](_0x1d5251[_0x6cc3('0x33')][_0x6cc3('0x39')]);_0x2ebc01[_0x6cc3('0x3a')]=qs[_0x6cc3('0x30')](_[_0x6cc3('0x55')](_0x1d5251[_0x6cc3('0x33')],_0x5a0720[_0x6cc3('0x30')]));if(_0x1d5251[_0x6cc3('0x33')]['filter']){_0x2ebc01['where']=_[_0x6cc3('0x3b')](_0x2ebc01[_0x6cc3('0x3a')],{'$or':_[_0x6cc3('0x2c')](_0x2ebc01['attributes'],function(_0x81cb36){var _0x124bf1={};_0x124bf1[_0x81cb36]={'$like':'%'+_0x1d5251[_0x6cc3('0x33')][_0x6cc3('0x3d')]+'%'};return _0x124bf1;})});}_0x2ebc01=_[_0x6cc3('0x3b')]({},_0x2ebc01,_0x1d5251['options']);return _0x39e490[_0x6cc3('0x51')](_0x2ebc01);}})['then'](function(_0x1e1b49){if(_0x1e1b49){_0x122c5a=_0x1e1b49[_0x6cc3('0x36')];if(!_0x1d5251[_0x6cc3('0x33')][_0x6cc3('0x37')](_0x6cc3('0x38'))){_0x2ebc01[_0x6cc3('0x1e')]=qs[_0x6cc3('0x1e')](_0x1d5251[_0x6cc3('0x33')][_0x6cc3('0x1e')]);_0x2ebc01['offset']=qs[_0x6cc3('0x1c')](_0x1d5251[_0x6cc3('0x33')][_0x6cc3('0x1c')]);}return _0x39e490['getMembers'](_0x2ebc01);}})[_0x6cc3('0x26')](function(_0x4b1ea8){if(_0x4b1ea8){return _0x4b1ea8?{'count':_0x122c5a,'rows':_0x4b1ea8}:null;}})['then'](respondWithResult(_0x5d2dbf,null))['catch'](handleError(_0x5d2dbf,null));};exports[_0x6cc3('0x56')]=function(_0x22b8b5,_0x4a0c25,_0x519061){return db['ChatGroup'][_0x6cc3('0x45')]({'where':{'id':_0x22b8b5[_0x6cc3('0x41')]['id']}})[_0x6cc3('0x26')](handleEntityNotFound(_0x4a0c25,null))['then'](function(_0x1dcf3e){if(_0x1dcf3e){return _0x1dcf3e[_0x6cc3('0x56')](_0x22b8b5['query'][_0x6cc3('0x4f')]);}})['then'](respondWithStatusCode(_0x4a0c25,null))[_0x6cc3('0x3f')](handleError(_0x4a0c25,null));};exports['addMessage']=function(_0x244740,_0xd23bf3,_0x515520){if(_0x244740['body']['id']){delete _0x244740[_0x6cc3('0x47')]['id'];}return db[_0x6cc3('0x2d')][_0x6cc3('0x45')]({'where':{'id':_0x244740[_0x6cc3('0x41')]['id']}})[_0x6cc3('0x26')](handleEntityNotFound(_0xd23bf3,null))[_0x6cc3('0x26')](function(_0x116da8){if(_0x116da8){_0x244740[_0x6cc3('0x47')]['ChatGroupId']=_0x116da8['id'];return db[_0x6cc3('0x4b')][_0x6cc3('0x46')](_0x244740['body']);}})[_0x6cc3('0x26')](respondWithResult(_0xd23bf3,null))['catch'](handleError(_0xd23bf3,null));};exports['getMessages']=function(_0x22873a,_0x5eb692,_0x13ca56){var _0x5baf16={};var _0x104c93={};var _0x254e05;var _0x2b98c4;return db[_0x6cc3('0x2d')]['findOne']({'where':{'id':_0x22873a[_0x6cc3('0x41')]['id']}})['then'](handleEntityNotFound(_0x5eb692,null))[_0x6cc3('0x26')](function(_0x26c55b){if(_0x26c55b){_0x254e05=_0x26c55b;_0x104c93[_0x6cc3('0x32')]=_['keys'](db['ChatInternalMessage'][_0x6cc3('0x43')]);_0x104c93[_0x6cc3('0x33')]=_[_0x6cc3('0x42')](_0x22873a[_0x6cc3('0x33')]);_0x104c93[_0x6cc3('0x30')]=_['intersection'](_0x104c93[_0x6cc3('0x32')],_0x104c93[_0x6cc3('0x33')]);_0x5baf16[_0x6cc3('0x35')]=_[_0x6cc3('0x31')](_0x104c93[_0x6cc3('0x32')],qs[_0x6cc3('0x34')](_0x22873a[_0x6cc3('0x33')][_0x6cc3('0x34')]));_0x5baf16[_0x6cc3('0x35')]=_0x5baf16[_0x6cc3('0x35')]['length']?_0x5baf16[_0x6cc3('0x35')]:_0x104c93[_0x6cc3('0x32')];_0x5baf16[_0x6cc3('0x54')]=qs[_0x6cc3('0x39')](_0x22873a['query'][_0x6cc3('0x39')]);_0x5baf16[_0x6cc3('0x3a')]=qs[_0x6cc3('0x30')](_['pick'](_0x22873a[_0x6cc3('0x33')],_0x104c93[_0x6cc3('0x30')]));if(_0x22873a[_0x6cc3('0x33')][_0x6cc3('0x3d')]){_0x5baf16[_0x6cc3('0x3a')]=_[_0x6cc3('0x3b')](_0x5baf16[_0x6cc3('0x3a')],{'$or':_[_0x6cc3('0x2c')](_0x5baf16['attributes'],function(_0x1da629){var _0x4e1338={};_0x4e1338[_0x1da629]={'$like':'%'+_0x22873a[_0x6cc3('0x33')][_0x6cc3('0x3d')]+'%'};return _0x4e1338;})});}if(_0x22873a[_0x6cc3('0x33')][_0x6cc3('0x57')]){var _0x4bd5c4=_0x22873a[_0x6cc3('0x33')]['$gte']['split'](',');var _0x1c96da={};_0x1c96da[_0x4bd5c4[0x0]]={'$gte':moment(_0x4bd5c4[0x1])[_0x6cc3('0x58')](_0x6cc3('0x59'))};_0x5baf16[_0x6cc3('0x3a')]=_[_0x6cc3('0x3b')](_0x5baf16[_0x6cc3('0x3a')],_0x1c96da);}_0x5baf16=_['merge']({},_0x5baf16,_0x22873a[_0x6cc3('0x3e')]);return _0x254e05['getMessages'](_0x5baf16);}})[_0x6cc3('0x26')](function(_0x36d7d6){if(_0x36d7d6){_0x2b98c4=_0x36d7d6[_0x6cc3('0x36')];if(!_0x22873a['query']['hasOwnProperty'](_0x6cc3('0x38'))){_0x5baf16[_0x6cc3('0x1e')]=qs['limit'](_0x22873a[_0x6cc3('0x33')][_0x6cc3('0x1e')]);_0x5baf16[_0x6cc3('0x1c')]=qs[_0x6cc3('0x1c')](_0x22873a['query'][_0x6cc3('0x1c')]);}return _0x254e05[_0x6cc3('0x5a')](_0x5baf16);}})['then'](function(_0x293529){if(_0x293529){return _0x293529?{'count':_0x2b98c4,'rows':_0x293529}:null;}})[_0x6cc3('0x26')](respondWithResult(_0x5eb692,null))[_0x6cc3('0x3f')](handleError(_0x5eb692,null));}; \ No newline at end of file +var _0x97da=['includeAll','findAll','rows','rawAttributes','include','catch','create','body','update','find','params','describe','ChatInternalMessage','user','addMembers','getMembers','findOne','User','pick','removeMembers','ids','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','count','offset','limit','set','reject','save','then','destroy','end','error','stack','name','send','map','ChatGroup','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options'];(function(_0x592389,_0x18ab51){var _0xf71a9c=function(_0xa98b4b){while(--_0xa98b4b){_0x592389['push'](_0x592389['shift']());}};_0xf71a9c(++_0x18ab51);}(_0x97da,0x136));var _0xa97d=function(_0x39dfcc,_0x277658){_0x39dfcc=_0x39dfcc-0x0;var _0x323723=_0x97da[_0x39dfcc];return _0x323723;};'use strict';var emlformat=require(_0xa97d('0x0'));var rimraf=require(_0xa97d('0x1'));var zipdir=require(_0xa97d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa97d('0x3'));var moment=require(_0xa97d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa97d('0x5'));var util=require(_0xa97d('0x6'));var path=require('path');var sox=require(_0xa97d('0x7'));var csv=require('to-csv');var ejs=require(_0xa97d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa97d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa97d('0xa'));var deskjs=require(_0xa97d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa97d('0xc'));var Papa=require(_0xa97d('0xd'));var Redis=require(_0xa97d('0xe'));var authService=require(_0xa97d('0xf'));var qs=require(_0xa97d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa97d('0x11'));var logger=require(_0xa97d('0x12'))(_0xa97d('0x13'));var utils=require(_0xa97d('0x14'));var config=require(_0xa97d('0x15'));var licenseUtil=require(_0xa97d('0x16'));var db=require(_0xa97d('0x17'))['db'];config[_0xa97d('0x18')]=_[_0xa97d('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa97d('0x1a'))(new Redis(config[_0xa97d('0x18')]));require(_0xa97d('0x1b'))[_0xa97d('0x1c')](socket);function respondWithStatusCode(_0x34d9d8,_0x44176d){_0x44176d=_0x44176d||0xcc;return function(_0x26884b){if(_0x26884b){return _0x34d9d8[_0xa97d('0x1d')](_0x44176d);}return _0x34d9d8[_0xa97d('0x1e')](_0x44176d)['end']();};}function respondWithResult(_0x5e55b3,_0x3a2166){_0x3a2166=_0x3a2166||0xc8;return function(_0xc5e3ac){if(_0xc5e3ac){return _0x5e55b3[_0xa97d('0x1e')](_0x3a2166)[_0xa97d('0x1f')](_0xc5e3ac);}};}function respondWithFilteredResult(_0x520790,_0x240d47){return function(_0x1328e4){if(_0x1328e4){var _0x190979=typeof _0x240d47['offset']==='undefined'&&typeof _0x240d47['limit']==='undefined';var _0x457f3c=_0x1328e4[_0xa97d('0x20')];var _0x21e971=_0x190979?0x0:_0x240d47['offset'];var _0x5ad339=_0x190979?_0x1328e4[_0xa97d('0x20')]:_0x240d47[_0xa97d('0x21')]+_0x240d47[_0xa97d('0x22')];var _0x19dafd;if(_0x5ad339>=_0x457f3c){_0x5ad339=_0x457f3c;_0x19dafd=0xc8;}else{_0x19dafd=0xce;}_0x520790[_0xa97d('0x1e')](_0x19dafd);return _0x520790[_0xa97d('0x23')]('Content-Range',_0x21e971+'-'+_0x5ad339+'/'+_0x457f3c)[_0xa97d('0x1f')](_0x1328e4);}return null;};}function patchUpdates(_0x324331){return function(_0x748281){try{jsonpatch['apply'](_0x748281,_0x324331,!![]);}catch(_0x25e55d){return BPromise[_0xa97d('0x24')](_0x25e55d);}return _0x748281[_0xa97d('0x25')]();};}function saveUpdates(_0xdd0aee,_0x53dac2){return function(_0x262584){if(_0x262584){return _0x262584['update'](_0xdd0aee)[_0xa97d('0x26')](function(_0x46be86){return _0x46be86;});}return null;};}function removeEntity(_0x50eeaa,_0x37297e){return function(_0x1efc2c){if(_0x1efc2c){return _0x1efc2c[_0xa97d('0x27')]()['then'](function(){_0x50eeaa[_0xa97d('0x1e')](0xcc)[_0xa97d('0x28')]();});}};}function handleEntityNotFound(_0x4ef7e0,_0x3a98e3){return function(_0x3576b8){if(!_0x3576b8){_0x4ef7e0['sendStatus'](0x194);}return _0x3576b8;};}function handleError(_0x55bde6,_0x42077f){_0x42077f=_0x42077f||0x1f4;return function(_0x22b7aa){logger[_0xa97d('0x29')](_0x22b7aa[_0xa97d('0x2a')]);if(_0x22b7aa[_0xa97d('0x2b')]){delete _0x22b7aa[_0xa97d('0x2b')];}_0x55bde6[_0xa97d('0x1e')](_0x42077f)[_0xa97d('0x2c')](_0x22b7aa);};}exports['index']=function(_0xf1edf2,_0x5a1c9e){var _0x175ba0={},_0x3a1ff4={},_0x31760f={'count':0x0,'rows':[]};var _0x17adde=_[_0xa97d('0x2d')](db[_0xa97d('0x2e')]['rawAttributes'],function(_0x2491fa){return{'name':_0x2491fa[_0xa97d('0x2f')],'type':_0x2491fa[_0xa97d('0x30')][_0xa97d('0x31')]};});_0x3a1ff4[_0xa97d('0x32')]=_[_0xa97d('0x2d')](_0x17adde,'name');_0x3a1ff4[_0xa97d('0x33')]=_[_0xa97d('0x34')](_0xf1edf2[_0xa97d('0x33')]);_0x3a1ff4['filters']=_[_0xa97d('0x35')](_0x3a1ff4[_0xa97d('0x32')],_0x3a1ff4['query']);_0x175ba0['attributes']=_[_0xa97d('0x35')](_0x3a1ff4[_0xa97d('0x32')],qs[_0xa97d('0x36')](_0xf1edf2[_0xa97d('0x33')]['fields']));_0x175ba0[_0xa97d('0x37')]=_0x175ba0[_0xa97d('0x37')][_0xa97d('0x38')]?_0x175ba0[_0xa97d('0x37')]:_0x3a1ff4[_0xa97d('0x32')];if(!_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x39')]('nolimit')){_0x175ba0[_0xa97d('0x22')]=qs[_0xa97d('0x22')](_0xf1edf2['query'][_0xa97d('0x22')]);_0x175ba0[_0xa97d('0x21')]=qs[_0xa97d('0x21')](_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x21')]);}_0x175ba0[_0xa97d('0x3a')]=qs[_0xa97d('0x3b')](_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x3b')]);_0x175ba0[_0xa97d('0x3c')]=qs[_0xa97d('0x3d')](_['pick'](_0xf1edf2[_0xa97d('0x33')],_0x3a1ff4['filters']),_0x17adde);if(_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x3e')]){_0x175ba0['where']=_[_0xa97d('0x3f')](_0x175ba0[_0xa97d('0x3c')],{'$or':_[_0xa97d('0x2d')](_0x17adde,function(_0x1d3a79){if(_0x1d3a79[_0xa97d('0x30')]!==_0xa97d('0x40')){var _0x44bb1b={};_0x44bb1b[_0x1d3a79[_0xa97d('0x2b')]]={'$like':'%'+_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x3e')]+'%'};return _0x44bb1b;}})});}_0x175ba0=_['merge']({},_0x175ba0,_0xf1edf2[_0xa97d('0x41')]);var _0x4ae986={'where':_0x175ba0['where']};return db[_0xa97d('0x2e')][_0xa97d('0x20')](_0x4ae986)[_0xa97d('0x26')](function(_0x1447e6){_0x31760f[_0xa97d('0x20')]=_0x1447e6;if(_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x42')]){_0x175ba0['include']=[{'all':!![]}];}return db['ChatGroup'][_0xa97d('0x43')](_0x175ba0);})[_0xa97d('0x26')](function(_0x14b70b){_0x31760f[_0xa97d('0x44')]=_0x14b70b;return _0x31760f;})[_0xa97d('0x26')](respondWithFilteredResult(_0x5a1c9e,_0x175ba0))['catch'](handleError(_0x5a1c9e,null));};exports['show']=function(_0x5b888a,_0x523ad3){var _0x3f659e={'raw':!![],'where':{'id':_0x5b888a['params']['id']}},_0x132cf={};_0x132cf[_0xa97d('0x32')]=_['keys'](db[_0xa97d('0x2e')][_0xa97d('0x45')]);_0x132cf[_0xa97d('0x33')]=_[_0xa97d('0x34')](_0x5b888a[_0xa97d('0x33')]);_0x132cf['filters']=_[_0xa97d('0x35')](_0x132cf['model'],_0x132cf[_0xa97d('0x33')]);_0x3f659e['attributes']=_[_0xa97d('0x35')](_0x132cf['model'],qs[_0xa97d('0x36')](_0x5b888a['query']['fields']));_0x3f659e[_0xa97d('0x37')]=_0x3f659e[_0xa97d('0x37')]['length']?_0x3f659e[_0xa97d('0x37')]:_0x132cf['model'];if(_0x5b888a['query'][_0xa97d('0x42')]){_0x3f659e[_0xa97d('0x46')]=[{'all':!![]}];}_0x3f659e=_['merge']({},_0x3f659e,_0x5b888a['options']);return db[_0xa97d('0x2e')]['find'](_0x3f659e)[_0xa97d('0x26')](handleEntityNotFound(_0x523ad3,null))[_0xa97d('0x26')](respondWithResult(_0x523ad3,null))[_0xa97d('0x47')](handleError(_0x523ad3,null));};exports['create']=function(_0x514507,_0xb206af){return db[_0xa97d('0x2e')][_0xa97d('0x48')](_0x514507[_0xa97d('0x49')],{})[_0xa97d('0x26')](respondWithResult(_0xb206af,0xc9))['catch'](handleError(_0xb206af,null));};exports[_0xa97d('0x4a')]=function(_0x1d6670,_0x26a9f5){if(_0x1d6670[_0xa97d('0x49')]['id']){delete _0x1d6670[_0xa97d('0x49')]['id'];}return db[_0xa97d('0x2e')][_0xa97d('0x4b')]({'where':{'id':_0x1d6670['params']['id']}})['then'](handleEntityNotFound(_0x26a9f5,null))['then'](saveUpdates(_0x1d6670[_0xa97d('0x49')],null))[_0xa97d('0x26')](respondWithResult(_0x26a9f5,null))[_0xa97d('0x47')](handleError(_0x26a9f5,null));};exports[_0xa97d('0x27')]=function(_0x28213f,_0x3668a7){return db[_0xa97d('0x2e')][_0xa97d('0x4b')]({'where':{'id':_0x28213f[_0xa97d('0x4c')]['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x3668a7,null))[_0xa97d('0x26')](removeEntity(_0x3668a7,null))[_0xa97d('0x47')](handleError(_0x3668a7,null));};exports[_0xa97d('0x4d')]=function(_0x1f91a2,_0x35e108){return db[_0xa97d('0x2e')][_0xa97d('0x4d')]()[_0xa97d('0x26')](respondWithResult(_0x35e108,null))[_0xa97d('0x47')](handleError(_0x35e108,null));};exports['getUnread']=function(_0x182c64,_0xcdb7a7,_0x46a727){return db[_0xa97d('0x4e')][_0xa97d('0x20')]({'where':{'ChatGroupId':_0x182c64['params']['id'],'ToId':_0x182c64[_0xa97d('0x4f')]['id'],'read':![]}})[_0xa97d('0x26')](function(_0x279f3e){return{'id':_['toInteger'](_0x182c64[_0xa97d('0x4c')]['id']),'count':_0x279f3e};})[_0xa97d('0x26')](respondWithResult(_0xcdb7a7,null))[_0xa97d('0x47')](handleError(_0xcdb7a7,null));};exports[_0xa97d('0x50')]=function(_0xf442ef,_0x16315f,_0x39ab64){return db[_0xa97d('0x2e')][_0xa97d('0x4b')]({'where':{'id':_0xf442ef[_0xa97d('0x4c')]['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x16315f,null))['then'](function(_0x1bfd50){if(_0x1bfd50){return _0x1bfd50['addMembers'](_0xf442ef[_0xa97d('0x49')]['ids'],_['omit'](_0xf442ef[_0xa97d('0x49')],['ids','id'])||{});}})[_0xa97d('0x26')](respondWithResult(_0x16315f,null))['catch'](handleError(_0x16315f,null));};exports[_0xa97d('0x51')]=function(_0xce5a5f,_0x56ba98,_0x40f4bb){var _0x3bb093={};var _0x11532d={};var _0x25a645;var _0x1758fb;return db['ChatGroup'][_0xa97d('0x52')]({'where':{'id':_0xce5a5f[_0xa97d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x56ba98,null))[_0xa97d('0x26')](function(_0x679e75){if(_0x679e75){_0x25a645=_0x679e75;_0x11532d['model']=_[_0xa97d('0x34')](db[_0xa97d('0x53')][_0xa97d('0x45')]);_0x11532d[_0xa97d('0x33')]=_[_0xa97d('0x34')](_0xce5a5f['query']);_0x11532d[_0xa97d('0x3d')]=_[_0xa97d('0x35')](_0x11532d[_0xa97d('0x32')],_0x11532d[_0xa97d('0x33')]);_0x3bb093[_0xa97d('0x37')]=_['intersection'](_0x11532d[_0xa97d('0x32')],qs['fields'](_0xce5a5f['query'][_0xa97d('0x36')]));_0x3bb093[_0xa97d('0x37')]=_0x3bb093[_0xa97d('0x37')][_0xa97d('0x38')]?_0x3bb093[_0xa97d('0x37')]:_0x11532d[_0xa97d('0x32')];_0x3bb093[_0xa97d('0x3a')]=qs[_0xa97d('0x3b')](_0xce5a5f['query'][_0xa97d('0x3b')]);_0x3bb093['where']=qs[_0xa97d('0x3d')](_[_0xa97d('0x54')](_0xce5a5f['query'],_0x11532d['filters']));if(_0xce5a5f[_0xa97d('0x33')][_0xa97d('0x3e')]){_0x3bb093[_0xa97d('0x3c')]=_[_0xa97d('0x3f')](_0x3bb093['where'],{'$or':_[_0xa97d('0x2d')](_0x3bb093[_0xa97d('0x37')],function(_0x4a9929){var _0x4afab6={};_0x4afab6[_0x4a9929]={'$like':'%'+_0xce5a5f['query'][_0xa97d('0x3e')]+'%'};return _0x4afab6;})});}_0x3bb093=_[_0xa97d('0x3f')]({},_0x3bb093,_0xce5a5f[_0xa97d('0x41')]);return _0x25a645[_0xa97d('0x51')](_0x3bb093);}})['then'](function(_0x412acb){if(_0x412acb){_0x1758fb=_0x412acb[_0xa97d('0x38')];if(!_0xce5a5f[_0xa97d('0x33')][_0xa97d('0x39')]('nolimit')){_0x3bb093[_0xa97d('0x22')]=qs[_0xa97d('0x22')](_0xce5a5f[_0xa97d('0x33')][_0xa97d('0x22')]);_0x3bb093[_0xa97d('0x21')]=qs['offset'](_0xce5a5f[_0xa97d('0x33')][_0xa97d('0x21')]);}return _0x25a645[_0xa97d('0x51')](_0x3bb093);}})[_0xa97d('0x26')](function(_0x36d88e){if(_0x36d88e){return _0x36d88e?{'count':_0x1758fb,'rows':_0x36d88e}:null;}})['then'](respondWithResult(_0x56ba98,null))['catch'](handleError(_0x56ba98,null));};exports[_0xa97d('0x55')]=function(_0x451580,_0x13f988,_0x3eaf40){return db[_0xa97d('0x2e')][_0xa97d('0x4b')]({'where':{'id':_0x451580['params']['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x13f988,null))[_0xa97d('0x26')](function(_0x44db25){if(_0x44db25){return _0x44db25[_0xa97d('0x55')](_0x451580[_0xa97d('0x33')][_0xa97d('0x56')]);}})[_0xa97d('0x26')](respondWithStatusCode(_0x13f988,null))['catch'](handleError(_0x13f988,null));};exports['addMessage']=function(_0x4014c0,_0x25ff60,_0x639928){if(_0x4014c0[_0xa97d('0x49')]['id']){delete _0x4014c0['body']['id'];}return db[_0xa97d('0x2e')]['find']({'where':{'id':_0x4014c0[_0xa97d('0x4c')]['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x25ff60,null))[_0xa97d('0x26')](function(_0xb932eb){if(_0xb932eb){_0x4014c0[_0xa97d('0x49')][_0xa97d('0x57')]=_0xb932eb['id'];return db[_0xa97d('0x4e')]['create'](_0x4014c0[_0xa97d('0x49')]);}})[_0xa97d('0x26')](respondWithResult(_0x25ff60,null))[_0xa97d('0x47')](handleError(_0x25ff60,null));};exports[_0xa97d('0x58')]=function(_0x3004ef,_0x1767c8,_0x38e6f0){var _0x3d6f51={};var _0x528803={};var _0x5e855c;var _0xdd265;return db[_0xa97d('0x2e')][_0xa97d('0x52')]({'where':{'id':_0x3004ef[_0xa97d('0x4c')]['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x1767c8,null))[_0xa97d('0x26')](function(_0x2ba30b){if(_0x2ba30b){_0x5e855c=_0x2ba30b;_0x528803[_0xa97d('0x32')]=_[_0xa97d('0x34')](db['ChatInternalMessage'][_0xa97d('0x45')]);_0x528803[_0xa97d('0x33')]=_[_0xa97d('0x34')](_0x3004ef[_0xa97d('0x33')]);_0x528803[_0xa97d('0x3d')]=_[_0xa97d('0x35')](_0x528803[_0xa97d('0x32')],_0x528803['query']);_0x3d6f51[_0xa97d('0x37')]=_[_0xa97d('0x35')](_0x528803[_0xa97d('0x32')],qs[_0xa97d('0x36')](_0x3004ef[_0xa97d('0x33')][_0xa97d('0x36')]));_0x3d6f51['attributes']=_0x3d6f51[_0xa97d('0x37')][_0xa97d('0x38')]?_0x3d6f51[_0xa97d('0x37')]:_0x528803[_0xa97d('0x32')];_0x3d6f51[_0xa97d('0x3a')]=qs['sort'](_0x3004ef[_0xa97d('0x33')][_0xa97d('0x3b')]);_0x3d6f51['where']=qs[_0xa97d('0x3d')](_[_0xa97d('0x54')](_0x3004ef[_0xa97d('0x33')],_0x528803[_0xa97d('0x3d')]));if(_0x3004ef[_0xa97d('0x33')][_0xa97d('0x3e')]){_0x3d6f51[_0xa97d('0x3c')]=_[_0xa97d('0x3f')](_0x3d6f51[_0xa97d('0x3c')],{'$or':_[_0xa97d('0x2d')](_0x3d6f51['attributes'],function(_0xde0e5e){var _0x19fea7={};_0x19fea7[_0xde0e5e]={'$like':'%'+_0x3004ef[_0xa97d('0x33')][_0xa97d('0x3e')]+'%'};return _0x19fea7;})});}if(_0x3004ef['query'][_0xa97d('0x59')]){var _0x1cc2d9=_0x3004ef[_0xa97d('0x33')][_0xa97d('0x59')][_0xa97d('0x5a')](',');var _0x5dd0e4={};_0x5dd0e4[_0x1cc2d9[0x0]]={'$gte':moment(_0x1cc2d9[0x1])[_0xa97d('0x5b')](_0xa97d('0x5c'))};_0x3d6f51[_0xa97d('0x3c')]=_[_0xa97d('0x3f')](_0x3d6f51[_0xa97d('0x3c')],_0x5dd0e4);}_0x3d6f51=_[_0xa97d('0x3f')]({},_0x3d6f51,_0x3004ef['options']);return _0x5e855c[_0xa97d('0x58')](_0x3d6f51);}})[_0xa97d('0x26')](function(_0x1ee472){if(_0x1ee472){_0xdd265=_0x1ee472[_0xa97d('0x38')];if(!_0x3004ef[_0xa97d('0x33')][_0xa97d('0x39')](_0xa97d('0x5d'))){_0x3d6f51[_0xa97d('0x22')]=qs['limit'](_0x3004ef['query'][_0xa97d('0x22')]);_0x3d6f51['offset']=qs[_0xa97d('0x21')](_0x3004ef[_0xa97d('0x33')]['offset']);}return _0x5e855c[_0xa97d('0x58')](_0x3d6f51);}})[_0xa97d('0x26')](function(_0x396b83){if(_0x396b83){return _0x396b83?{'count':_0xdd265,'rows':_0x396b83}:null;}})[_0xa97d('0x26')](respondWithResult(_0x1767c8,null))['catch'](handleError(_0x1767c8,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index f2f34e1..a4ccde8 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 _0x8acc=['hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0x3f089e,_0x50af87){var _0x3d9437=function(_0x39b38a){while(--_0x39b38a){_0x3f089e['push'](_0x3f089e['shift']());}};_0x3d9437(++_0x50af87);}(_0x8acc,0xdb));var _0xc8ac=function(_0x478087,_0x109fb2){_0x478087=_0x478087-0x0;var _0x54bff1=_0x8acc[_0x478087];return _0x54bff1;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xc8ac('0x0'))['db'][_0xc8ac('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc8ac('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc8ac('0x3'),'afterDestroy':_0xc8ac('0x4')};function emitEvent(_0x4edf27){return function(_0x280b6c,_0x1bb12c,_0x4df245){ChatGroupEvents[_0xc8ac('0x5')](_0x4edf27+':'+_0x280b6c['id'],_0x280b6c);ChatGroupEvents[_0xc8ac('0x5')](_0x4edf27,_0x280b6c);_0x4df245(null);};}for(var e in events){if(events[_0xc8ac('0x6')](e)){var event=events[e];ChatGroup[_0xc8ac('0x7')](e,emitEvent(event));}}module[_0xc8ac('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x33aa=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x428f01,_0x1aa22c){var _0x3aa144=function(_0x29699c){while(--_0x29699c){_0x428f01['push'](_0x428f01['shift']());}};_0x3aa144(++_0x1aa22c);}(_0x33aa,0xc9));var _0xa33a=function(_0x17ba85,_0x2db9e9){_0x17ba85=_0x17ba85-0x0;var _0x4c17ac=_0x33aa[_0x17ba85];return _0x4c17ac;};'use strict';var EventEmitter=require(_0xa33a('0x0'));var ChatGroup=require(_0xa33a('0x1'))['db'][_0xa33a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa33a('0x3')](0x0);var events={'afterCreate':_0xa33a('0x4'),'afterUpdate':_0xa33a('0x5'),'afterDestroy':_0xa33a('0x6')};function emitEvent(_0x31060d){return function(_0x530bf8,_0x5b8073,_0x1655fa){ChatGroupEvents[_0xa33a('0x7')](_0x31060d+':'+_0x530bf8['id'],_0x530bf8);ChatGroupEvents[_0xa33a('0x7')](_0x31060d,_0x530bf8);_0x1655fa(null);};}for(var e in events){if(events[_0xa33a('0x8')](e)){var event=events[e];ChatGroup[_0xa33a('0x9')](e,emitEvent(event));}}module[_0xa33a('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index ffff191..0b1c09c 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 _0x44ef=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatGroup','lodash'];(function(_0xe6d890,_0x5be152){var _0x28d8be=function(_0x2953f8){while(--_0x2953f8){_0xe6d890['push'](_0xe6d890['shift']());}};_0x28d8be(++_0x5be152);}(_0x44ef,0x167));var _0xf44e=function(_0xb48ecc,_0x2e2e1a){_0xb48ecc=_0xb48ecc-0x0;var _0x180bd5=_0x44ef[_0xb48ecc];return _0x180bd5;};'use strict';var _=require(_0xf44e('0x0'));var util=require(_0xf44e('0x1'));var logger=require(_0xf44e('0x2'))(_0xf44e('0x3'));var moment=require(_0xf44e('0x4'));var BPromise=require(_0xf44e('0x5'));var rp=require(_0xf44e('0x6'));var fs=require('fs');var path=require(_0xf44e('0x7'));var rimraf=require(_0xf44e('0x8'));var config=require(_0xf44e('0x9'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x3fac64,_0x589f22){return _0x3fac64[_0xf44e('0xa')](_0xf44e('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdabc=['exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x49bfb7,_0x17225b){var _0x3354e3=function(_0x1fa7f3){while(--_0x1fa7f3){_0x49bfb7['push'](_0x49bfb7['shift']());}};_0x3354e3(++_0x17225b);}(_0xdabc,0x1e4));var _0xcdab=function(_0x5da27f,_0x504b76){_0x5da27f=_0x5da27f-0x0;var _0x54a3fb=_0xdabc[_0x5da27f];return _0x54a3fb;};'use strict';var _=require(_0xcdab('0x0'));var util=require(_0xcdab('0x1'));var logger=require(_0xcdab('0x2'))(_0xcdab('0x3'));var moment=require(_0xcdab('0x4'));var BPromise=require(_0xcdab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdab('0x6'));var rimraf=require(_0xcdab('0x7'));var config=require(_0xcdab('0x8'));var attributes=require(_0xcdab('0x9'));module[_0xcdab('0xa')]=function(_0x5c8feb,_0xed0dca){return _0x5c8feb['define'](_0xcdab('0xb'),attributes,{'tableName':_0xcdab('0xc'),'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 ee232b9..3d71bb5 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 _0xf961=['error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x301b7a,_0x55fdd0){var _0x1e2fab=function(_0x1d87d1){while(--_0x1d87d1){_0x301b7a['push'](_0x301b7a['shift']());}};_0x1e2fab(++_0x55fdd0);}(_0xf961,0x1cf));var _0x1f96=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xf961[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0x1f96('0x0'));var util=require(_0x1f96('0x1'));var moment=require(_0x1f96('0x2'));var BPromise=require(_0x1f96('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f96('0x4'));var db=require(_0x1f96('0x5'))['db'];var utils=require(_0x1f96('0x6'));var logger=require('../../config/logger')(_0x1f96('0x7'));var config=require(_0x1f96('0x8'));var jayson=require(_0x1f96('0x9'));var client=jayson['client'][_0x1f96('0xa')]({'port':0x232a});config['redis']=_[_0x1f96('0xb')](config[_0x1f96('0xc')],{'host':_0x1f96('0xd'),'port':0x18eb});var socket=require(_0x1f96('0xe'))(new Redis(config[_0x1f96('0xc')]));require(_0x1f96('0xf'))['register'](socket);function respondWithRpcPromise(_0x523b60,_0x40f9f1,_0x54ae99){return new BPromise(function(_0x32b621,_0x2e1fdb){return client[_0x1f96('0x10')](_0x523b60,_0x54ae99)[_0x1f96('0x11')](function(_0x577c76){logger[_0x1f96('0x12')](_0x1f96('0x13'),_0x40f9f1,_0x1f96('0x14'));logger['debug'](_0x1f96('0x15'),_0x40f9f1,_0x1f96('0x14'),JSON[_0x1f96('0x16')](_0x577c76));if(_0x577c76[_0x1f96('0x17')]){if(_0x577c76[_0x1f96('0x17')][_0x1f96('0x18')]===0x1f4){logger['error'](_0x1f96('0x13'),_0x40f9f1,_0x577c76[_0x1f96('0x17')][_0x1f96('0x19')]);return _0x2e1fdb(_0x577c76[_0x1f96('0x17')]['message']);}logger[_0x1f96('0x17')](_0x1f96('0x13'),_0x40f9f1,_0x577c76[_0x1f96('0x17')][_0x1f96('0x19')]);return _0x32b621(_0x577c76[_0x1f96('0x17')][_0x1f96('0x19')]);}else{logger[_0x1f96('0x12')](_0x1f96('0x13'),_0x40f9f1,'request\x20sent');_0x32b621(_0x577c76[_0x1f96('0x1a')][_0x1f96('0x19')]);}})['catch'](function(_0x1569ca){logger[_0x1f96('0x17')](_0x1f96('0x13'),_0x40f9f1,_0x1569ca);_0x2e1fdb(_0x1569ca);});});} \ No newline at end of file +var _0xf873=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','request'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0xf873,0xb2));var _0x3f87=function(_0x86069d,_0x47a44f){_0x86069d=_0x86069d-0x0;var _0x4d1813=_0xf873[_0x86069d];return _0x4d1813;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var moment=require(_0x3f87('0x1'));var BPromise=require(_0x3f87('0x2'));var rs=require(_0x3f87('0x3'));var fs=require('fs');var Redis=require(_0x3f87('0x4'));var db=require(_0x3f87('0x5'))['db'];var utils=require(_0x3f87('0x6'));var logger=require(_0x3f87('0x7'))(_0x3f87('0x8'));var config=require('../../config/environment');var jayson=require(_0x3f87('0x9'));var client=jayson[_0x3f87('0xa')][_0x3f87('0xb')]({'port':0x232a});config['redis']=_[_0x3f87('0xc')](config[_0x3f87('0xd')],{'host':_0x3f87('0xe'),'port':0x18eb});var socket=require(_0x3f87('0xf'))(new Redis(config[_0x3f87('0xd')]));require(_0x3f87('0x10'))['register'](socket);function respondWithRpcPromise(_0x1405ca,_0x435ca8,_0x32e236){return new BPromise(function(_0x3e6ca6,_0x1ad2a9){return client[_0x3f87('0x11')](_0x1405ca,_0x32e236)[_0x3f87('0x12')](function(_0x2b7ca0){logger[_0x3f87('0x13')](_0x3f87('0x14'),_0x435ca8,_0x3f87('0x15'));logger[_0x3f87('0x16')](_0x3f87('0x17'),_0x435ca8,_0x3f87('0x15'),JSON['stringify'](_0x2b7ca0));if(_0x2b7ca0[_0x3f87('0x18')]){if(_0x2b7ca0[_0x3f87('0x18')]['code']===0x1f4){logger[_0x3f87('0x18')](_0x3f87('0x14'),_0x435ca8,_0x2b7ca0[_0x3f87('0x18')][_0x3f87('0x19')]);return _0x1ad2a9(_0x2b7ca0[_0x3f87('0x18')][_0x3f87('0x19')]);}logger[_0x3f87('0x18')](_0x3f87('0x14'),_0x435ca8,_0x2b7ca0['error'][_0x3f87('0x19')]);return _0x3e6ca6(_0x2b7ca0[_0x3f87('0x18')][_0x3f87('0x19')]);}else{logger['info'](_0x3f87('0x14'),_0x435ca8,'request\x20sent');_0x3e6ca6(_0x2b7ca0[_0x3f87('0x1a')][_0x3f87('0x19')]);}})[_0x3f87('0x1b')](function(_0x279eba){logger[_0x3f87('0x18')]('ChatGroup,\x20%s,\x20%s',_0x435ca8,_0x279eba);_0x1ad2a9(_0x279eba);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 10f2a42..336c000 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 _0x5db1=['register','./chatGroup.events','save','update','emit','removeListener'];(function(_0x41d4f9,_0x4ce4db){var _0x19c75c=function(_0x3209d0){while(--_0x3209d0){_0x41d4f9['push'](_0x41d4f9['shift']());}};_0x19c75c(++_0x4ce4db);}(_0x5db1,0x16f));var _0x15db=function(_0x3ffd75,_0xe4f285){_0x3ffd75=_0x3ffd75-0x0;var _0x191134=_0x5db1[_0x3ffd75];return _0x191134;};'use strict';var ChatGroupEvents=require(_0x15db('0x0'));var events=[_0x15db('0x1'),'remove',_0x15db('0x2')];function createListener(_0x46abdd,_0x1d4997){return function(_0x130034){_0x1d4997[_0x15db('0x3')](_0x46abdd,_0x130034);};}function removeListener(_0x4da9b1,_0x4bbf80){return function(){ChatGroupEvents[_0x15db('0x4')](_0x4da9b1,_0x4bbf80);};}exports[_0x15db('0x5')]=function(_0x270a73){for(var _0x557776=0x0,_0x66dd91=events['length'];_0x557776<_0x66dd91;_0x557776++){var _0x5f5b3e=events[_0x557776];var _0x2c884f=createListener('chatGroup:'+_0x5f5b3e,_0x270a73);ChatGroupEvents['on'](_0x5f5b3e,_0x2c884f);}}; \ No newline at end of file +var _0x0fc7=['./chatGroup.events','save','emit','length','chatGroup:'];(function(_0x2296dd,_0x534a97){var _0x4df384=function(_0x147aa2){while(--_0x147aa2){_0x2296dd['push'](_0x2296dd['shift']());}};_0x4df384(++_0x534a97);}(_0x0fc7,0xf5));var _0x70fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0fc7[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0x70fc('0x0'));var events=[_0x70fc('0x1'),'remove','update'];function createListener(_0x18479c,_0x425cfc){return function(_0x542429){_0x425cfc[_0x70fc('0x2')](_0x18479c,_0x542429);};}function removeListener(_0x309846,_0xdba98a){return function(){ChatGroupEvents['removeListener'](_0x309846,_0xdba98a);};}exports['register']=function(_0x8a662){for(var _0x29c2cd=0x0,_0x347f14=events[_0x70fc('0x3')];_0x29c2cd<_0x347f14;_0x29c2cd++){var _0x3c80e4=events[_0x29c2cd];var _0x55744f=createListener(_0x70fc('0x4')+_0x3c80e4,_0x8a662);ChatGroupEvents['on'](_0x3c80e4,_0x55744f);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 5e149df..1ff7e36 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 _0xb9bf=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','delete','destroy','removeMembers','exports','util'];(function(_0x170b79,_0x230a13){var _0x4061e1=function(_0x1ea3d0){while(--_0x1ea3d0){_0x170b79['push'](_0x170b79['shift']());}};_0x4061e1(++_0x230a13);}(_0xb9bf,0x6b));var _0xfb9b=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xb9bf[_0x3826ad];return _0x17b900;};'use strict';var multer=require('multer');var util=require(_0xfb9b('0x0'));var path=require(_0xfb9b('0x1'));var timeout=require(_0xfb9b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfb9b('0x3'));var auth=require(_0xfb9b('0x4'));var interaction=require(_0xfb9b('0x5'));var config=require(_0xfb9b('0x6'));var controller=require('./chatGroup.controller');router[_0xfb9b('0x7')]('/',auth['isAuthenticated'](),controller[_0xfb9b('0x8')]);router[_0xfb9b('0x7')](_0xfb9b('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xfb9b('0x7')](_0xfb9b('0xa'),auth[_0xfb9b('0xb')](),controller[_0xfb9b('0xc')]);router[_0xfb9b('0x7')](_0xfb9b('0xd'),auth['isAuthenticated'](),controller[_0xfb9b('0xe')]);router[_0xfb9b('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0xfb9b('0xf')]);router[_0xfb9b('0x7')](_0xfb9b('0x10'),auth['isAuthenticated'](),controller[_0xfb9b('0x11')]);router[_0xfb9b('0x12')]('/',auth[_0xfb9b('0xb')](),controller[_0xfb9b('0x13')]);router[_0xfb9b('0x12')](_0xfb9b('0x14'),auth[_0xfb9b('0xb')](),controller[_0xfb9b('0x15')]);router[_0xfb9b('0x12')](_0xfb9b('0x10'),auth[_0xfb9b('0xb')](),controller[_0xfb9b('0x16')]);router['put'](_0xfb9b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xfb9b('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xfb9b('0x18')]);router[_0xfb9b('0x17')]('/:id/members',auth['isAuthenticated'](),controller[_0xfb9b('0x19')]);module[_0xfb9b('0x1a')]=router; \ No newline at end of file +var _0x8e57=['/describe','isAuthenticated','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','post','create','/:id/members','update','delete','destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x8e57,0x11f));var _0x78e5=function(_0x1a44e3,_0x5dd6ad){_0x1a44e3=_0x1a44e3-0x0;var _0x5f5cca=_0x8e57[_0x1a44e3];return _0x5f5cca;};'use strict';var multer=require('multer');var util=require(_0x78e5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x78e5('0x1'));var router=express[_0x78e5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x78e5('0x3'));var interaction=require(_0x78e5('0x4'));var config=require('../../config/environment');var controller=require(_0x78e5('0x5'));router[_0x78e5('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x78e5('0x6')](_0x78e5('0x7'),auth[_0x78e5('0x8')](),controller['describe']);router['get'](_0x78e5('0x9'),auth[_0x78e5('0x8')](),controller[_0x78e5('0xa')]);router[_0x78e5('0x6')](_0x78e5('0xb'),auth[_0x78e5('0x8')](),controller[_0x78e5('0xc')]);router[_0x78e5('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0x78e5('0xd')]);router[_0x78e5('0x6')](_0x78e5('0xe'),auth[_0x78e5('0x8')](),controller['getMessages']);router[_0x78e5('0xf')]('/',auth[_0x78e5('0x8')](),controller[_0x78e5('0x10')]);router['post'](_0x78e5('0x11'),auth[_0x78e5('0x8')](),controller['addMembers']);router['post']('/:id/messages',auth[_0x78e5('0x8')](),controller['addMessage']);router['put'](_0x78e5('0x9'),auth[_0x78e5('0x8')](),controller[_0x78e5('0x12')]);router[_0x78e5('0x13')](_0x78e5('0x9'),auth[_0x78e5('0x8')](),controller[_0x78e5('0x14')]);router[_0x78e5('0x13')](_0x78e5('0x11'),auth[_0x78e5('0x8')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index b695c61..1881ab9 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 _0xe3d4=['INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','exports','BOOLEAN'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xe3d4,0xc6));var _0x4e3d=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0xe3d4[_0xc7348b];return _0x307cec;};'use strict';var Sequelize=require('sequelize');module[_0x4e3d('0x0')]={'closed':{'type':Sequelize[_0x4e3d('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4e3d('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x4e3d('0x3'),_0x4e3d('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x4e3d('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x4e3d('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4e3d('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4e3d('0x6')]},'thirdDisposition':{'type':Sequelize[_0x4e3d('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x4e3d('0x6')]},'browserVersion':{'type':Sequelize[_0x4e3d('0x6')]},'osName':{'type':Sequelize[_0x4e3d('0x6')]},'osVersion':{'type':Sequelize[_0x4e3d('0x6')]},'deviceModel':{'type':Sequelize[_0x4e3d('0x6')]},'deviceVendor':{'type':Sequelize[_0x4e3d('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x4e3d('0x6')]},'formData':{'type':Sequelize[_0x4e3d('0x5')](_0x4e3d('0x8'))},'read1stAt':{'type':Sequelize[_0x4e3d('0x7')]},'lastMsgAt':{'type':Sequelize[_0x4e3d('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x4e3d('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4e3d('0x6')]},'customerPort':{'type':Sequelize[_0x4e3d('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x4e3d('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x4e3d('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x7be1=['ENUM','star','thumb','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN'];(function(_0x292c39,_0x46338b){var _0x56859d=function(_0x2a27f2){while(--_0x2a27f2){_0x292c39['push'](_0x292c39['shift']());}};_0x56859d(++_0x46338b);}(_0x7be1,0x165));var _0x17be=function(_0x2c9e61,_0x2d13f5){_0x2c9e61=_0x2c9e61-0x0;var _0x4d55d6=_0x7be1[_0x2c9e61];return _0x4d55d6;};'use strict';var Sequelize=require(_0x17be('0x0'));module[_0x17be('0x1')]={'closed':{'type':Sequelize[_0x17be('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x17be('0x3')](_0x17be('0x4'),_0x17be('0x5')),'defaultValue':_0x17be('0x4')},'ratingMessage':{'type':Sequelize[_0x17be('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x17be('0x7')]},'secondDisposition':{'type':Sequelize[_0x17be('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x17be('0x7')]},'browserName':{'type':Sequelize[_0x17be('0x7')]},'browserVersion':{'type':Sequelize[_0x17be('0x7')]},'osName':{'type':Sequelize[_0x17be('0x7')]},'osVersion':{'type':Sequelize[_0x17be('0x7')]},'deviceModel':{'type':Sequelize[_0x17be('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x17be('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x17be('0x7')]},'formData':{'type':Sequelize[_0x17be('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x17be('0x8')]},'lastMsgAt':{'type':Sequelize[_0x17be('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x17be('0x3')]('in',_0x17be('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x17be('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x17be('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 121ba20..243f930 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 _0x3423=['Unauthorized','attachId','ChatOfflineMessageId','server/files/attachments/','offline-chat/','join','download','root','server/files/chat/upload/','format','now','pathTranscript','Messages','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','alias','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','server','attachments','transcript-%d-%s.zip','firstName','secret','read','Account','Owner','get','mkdirSync','Chat','closedAt','osName','customerIp','customerPort','existsSync','pipe','out','lastName','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','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','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','render','merge','body','interaction','account','Users','fullname','TagIds','forEach','push','catch','index','map','ChatInteraction','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','field','color','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','users','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\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)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','clone','DESC','t.id\x20IN\x20?','resolve','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload'];(function(_0x5d61e8,_0x3ac08f){var _0x144c95=function(_0x424f1c){while(--_0x424f1c){_0x5d61e8['push'](_0x5d61e8['shift']());}};_0x144c95(++_0x3ac08f);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3342('0x0'));var jsonpatch=require(_0x3342('0x1'));var rp=require(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var Mustache=require(_0x3342('0x5'));var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require(_0x3342('0x8'));var csv=require(_0x3342('0x9'));var ejs=require(_0x3342('0xa'));var fs=require('fs');var fs_extra=require(_0x3342('0xb'));var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0x9'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3342('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3342('0x13'))(_0x3342('0x14'));var utils=require('../../config/utils');var config=require(_0x3342('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3342('0x16'))['db'];config[_0x3342('0x17')]=_['defaults'](config[_0x3342('0x17')],{'host':_0x3342('0x18'),'port':0x18eb});var socket=require(_0x3342('0x19'))(new Redis(config[_0x3342('0x17')]));require(_0x3342('0x1a'))[_0x3342('0x1b')](socket);var jayson=require(_0x3342('0x1c'));var client=jayson['client'][_0x3342('0x1d')]({'port':0x232b});var client9004=jayson[_0x3342('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x40d609,_0x2c9df0,_0x51ef91,_0x554f9c){return new BPromise(function(_0xdbbb6c,_0x143cf1){var _0x6949fc=_0x554f9c||client;return _0x6949fc[_0x3342('0x1f')](_0x40d609,_0x51ef91)[_0x3342('0x20')](function(_0x156c24){logger[_0x3342('0x21')](_0x3342('0x22'),_0x2c9df0,_0x3342('0x23'));logger['debug'](_0x3342('0x24'),_0x2c9df0,_0x3342('0x23'),JSON[_0x3342('0x25')](_0x156c24));if(_0x156c24['error']){if(_0x156c24[_0x3342('0x26')][_0x3342('0x27')]===0x1f4){logger['error'](_0x3342('0x22'),_0x2c9df0,_0x156c24[_0x3342('0x26')]['message']);return _0x143cf1(_0x156c24[_0x3342('0x26')]['message']);}logger[_0x3342('0x26')](_0x3342('0x22'),_0x2c9df0,_0x156c24[_0x3342('0x26')][_0x3342('0x28')]);return _0xdbbb6c(_0x156c24[_0x3342('0x26')][_0x3342('0x28')]);}else{logger[_0x3342('0x21')](_0x3342('0x22'),_0x2c9df0,'request\x20sent');_0xdbbb6c(_0x156c24[_0x3342('0x29')]['message']);}})['catch'](function(_0x986ab0){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2c9df0,_0x986ab0);_0x143cf1(_0x986ab0);});});}function respondWithStatusCode(_0x247ee4,_0x58f0f5){_0x58f0f5=_0x58f0f5||0xcc;return function(_0x37df78){if(_0x37df78){return _0x247ee4['sendStatus'](_0x58f0f5);}return _0x247ee4['status'](_0x58f0f5)['end']();};}function respondWithResult(_0x1497d9,_0x286c42){_0x286c42=_0x286c42||0xc8;return function(_0x1dd607){if(_0x1dd607){return _0x1497d9['status'](_0x286c42)[_0x3342('0x2a')](_0x1dd607);}};}function respondWithFilteredResult(_0x1275e2,_0x1cc542){return function(_0x272a52){if(_0x272a52){var _0x4fbfb7=typeof _0x1cc542[_0x3342('0x2b')]===_0x3342('0x2c')&&typeof _0x1cc542[_0x3342('0x2d')]===_0x3342('0x2c');var _0xf82530=_0x272a52[_0x3342('0x2e')];var _0x135760=_0x4fbfb7?0x0:_0x1cc542['offset'];var _0x2e0bde=_0x4fbfb7?_0x272a52['count']:_0x1cc542[_0x3342('0x2b')]+_0x1cc542[_0x3342('0x2d')];var _0x508f87;if(_0x2e0bde>=_0xf82530){_0x2e0bde=_0xf82530;_0x508f87=0xc8;}else{_0x508f87=0xce;}_0x1275e2[_0x3342('0x2f')](_0x508f87);return _0x1275e2[_0x3342('0x30')](_0x3342('0x31'),_0x135760+'-'+_0x2e0bde+'/'+_0xf82530)[_0x3342('0x2a')](_0x272a52);}return null;};}function patchUpdates(_0x498ded){return function(_0x3301c1){try{jsonpatch[_0x3342('0x32')](_0x3301c1,_0x498ded,!![]);}catch(_0x311cfe){return BPromise[_0x3342('0x33')](_0x311cfe);}return _0x3301c1[_0x3342('0x34')]();};}function saveUpdates(_0x26528f,_0x16fbb0){return function(_0x78c868){if(_0x78c868){return _0x78c868[_0x3342('0x35')](_0x26528f)[_0x3342('0x20')](function(_0x46cdbd){return _0x46cdbd;});}return null;};}function removeEntity(_0x30dcea,_0x5aea96){return function(_0x478c8d){if(_0x478c8d){return _0x478c8d[_0x3342('0x36')]()['then'](function(){_0x30dcea[_0x3342('0x2f')](0xcc)[_0x3342('0x37')]();});}};}function handleEntityNotFound(_0x1a74d3,_0x361d23){return function(_0x2dbc02){if(!_0x2dbc02){_0x1a74d3[_0x3342('0x38')](0x194);}return _0x2dbc02;};}function handleError(_0x956cde,_0x5d460c){_0x5d460c=_0x5d460c||0x1f4;return function(_0x4754d9){logger[_0x3342('0x26')](_0x4754d9[_0x3342('0x39')]);if(_0x4754d9[_0x3342('0x3a')]){delete _0x4754d9[_0x3342('0x3a')];}_0x956cde['status'](_0x5d460c)[_0x3342('0x3b')](_0x4754d9);};}function getMustacheRender(_0x4d1a59,_0x22ca76){return Mustache[_0x3342('0x3c')](_0x4d1a59,_[_0x3342('0x3d')](_0x22ca76[_0x3342('0x3e')],{'contact':_0x22ca76['contact'],'message':_0x22ca76[_0x3342('0x28')],'agent':_0x22ca76['agent'],'interaction':_0x22ca76[_0x3342('0x3f')],'account':_0x22ca76[_0x3342('0x40')]}))||'';}function getInteractionUsers(_0x2e815e,_0x1b58c5){return new BPromise(function(_0x40a5bd,_0xf83613){try{if(_0x1b58c5[_0x2e815e['id']]){_0x2e815e[_0x3342('0x41')]=_['map'](_0x1b58c5[_0x2e815e['id']],function(_0x3e626b){return{'id':_0x3e626b['id'],'fullname':_0x3e626b[_0x3342('0x42')]};});}}catch(_0x57cc44){_0xf83613(_0x57cc44);}_0x40a5bd(_0x2e815e);});}function getInteractionTags(_0x324205,_0x1f336c){return new BPromise(function(_0x494d28,_0x45b956){try{if(_0x324205[_0x3342('0x43')]){_0x324205['Tags']=[];_0x324205['TagIds']['split'](',')[_0x3342('0x44')](function(_0x41e727){_0x324205['Tags'][_0x3342('0x45')](_0x1f336c[_0x41e727]);});}delete _0x324205[_0x3342('0x43')];}catch(_0x2944ab){_0x45b956(_0x2944ab);}_0x494d28(_0x324205);});}function updateChatInteraction(_0x17fd01,_0x126ee4,_0x308363){return new BPromise(function(_0x34de7b,_0x4282ea){return getInteractionUsers(_0x17fd01,_0x308363)['then'](function(_0x5a787b){return getInteractionTags(_0x5a787b,_0x126ee4);})[_0x3342('0x20')](function(_0x7341fa){_0x34de7b(_0x7341fa);})[_0x3342('0x46')](function(_0xee717e){_0x4282ea(_0xee717e);});});}exports[_0x3342('0x47')]=function(_0x414fcb,_0x5e24a1){var _0x15eb49={},_0x196436={},_0x283ce9={'count':0x0,'rows':[]};var _0x309423=_[_0x3342('0x48')](db[_0x3342('0x49')]['rawAttributes'],function(_0x36baa4){return{'name':_0x36baa4['fieldName'],'type':_0x36baa4[_0x3342('0x4a')][_0x3342('0x4b')]};});_0x196436[_0x3342('0x4c')]=_[_0x3342('0x48')](_0x309423,'name');_0x196436[_0x3342('0x4d')]=_[_0x3342('0x4e')](_0x414fcb['query']);_0x196436[_0x3342('0x4f')]=_[_0x3342('0x50')](_0x196436[_0x3342('0x4c')],_0x196436[_0x3342('0x4d')]);_0x15eb49['attributes']=_[_0x3342('0x50')](_0x196436[_0x3342('0x4c')],qs['fields'](_0x414fcb[_0x3342('0x4d')]['fields']));_0x15eb49['attributes']=_0x15eb49[_0x3342('0x51')][_0x3342('0x52')]?_0x15eb49[_0x3342('0x51')]:_0x196436[_0x3342('0x4c')];if(!_0x414fcb[_0x3342('0x4d')][_0x3342('0x53')](_0x3342('0x54'))){_0x15eb49['limit']=qs['limit'](_0x414fcb[_0x3342('0x4d')]['limit']);_0x15eb49[_0x3342('0x2b')]=qs['offset'](_0x414fcb['query']['offset']);}_0x15eb49[_0x3342('0x55')]=qs[_0x3342('0x56')](_0x414fcb[_0x3342('0x4d')][_0x3342('0x56')]);_0x15eb49['where']=qs[_0x3342('0x4f')](_[_0x3342('0x57')](_0x414fcb['query'],_0x196436[_0x3342('0x4f')]),_0x309423);var _0x24d543=[];var _0x43c27a=squel['select']()[_0x3342('0x58')]('id')[_0x3342('0x58')](_0x3342('0x3a'))[_0x3342('0x58')](_0x3342('0x59'))['from'](_0x3342('0x5a'));var _0x1d5001=squel[_0x3342('0x5b')]()[_0x3342('0x58')](_0x3342('0x5c'))[_0x3342('0x58')](_0x3342('0x5d'))[_0x3342('0x58')](_0x3342('0x5e'))['from'](_0x3342('0x5f'),'ui')['left_join'](_0x3342('0x60'),'u','u.id\x20=\x20ui.UserId');var _0x49e3c6=squel['select']()['from'](_0x3342('0x61'),'i')[_0x3342('0x62')](_0x3342('0x63'),'c',_0x3342('0x64'))[_0x3342('0x62')](_0x3342('0x60'),'o',_0x3342('0x65'))[_0x3342('0x62')](_0x3342('0x66'),'a',_0x3342('0x67'))[_0x3342('0x62')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x3342('0x62')]('chat_interaction_has_tags','it',_0x3342('0x68'))['left_join']('tools_tags','t',_0x3342('0x69'));var _0x43d39f=squel[_0x3342('0x6a')]();var _0x5d5e0f=[];var _0x58d37a=squel[_0x3342('0x6a')]();var _0x3cc92a;if(_0x414fcb['query'][_0x3342('0x6b')]){_0x3cc92a=as[_0x3342('0x6c')](_0x414fcb[_0x3342('0x4d')]['search']);var _0x23c186=_0x3cc92a[_0x3342('0x6d')];for(var _0x3dd926=0x0;_0x3dd926<_0x3cc92a[_0x3342('0x6e')][_0x3342('0x52')];_0x3dd926++){var _0x19e27b=_0x3cc92a[_0x3342('0x6e')][_0x3dd926];var _0x57942a='i';var _0x4bc9a9=_[_0x3342('0x6f')](_0x309423,['name',_0x19e27b[_0x3342('0x58')]]);if(!_0x4bc9a9){switch(_0x19e27b[_0x3342('0x58')]){case _0x3342('0x70'):if(_0x19e27b[_0x3342('0x71')]==0x1){_0x49e3c6[_0x3342('0x72')]('`'+_0x19e27b['field']+_0x3342('0x73'));}else{_0x49e3c6[_0x3342('0x72')]('`'+_0x19e27b['field']+_0x3342('0x74'));}break;case _0x3342('0x75'):if(_0x19e27b[_0x3342('0x76')]===_0x3342('0x77')){if(_0x19e27b[_0x3342('0x71')][_0x3342('0x78')]('\x20')[_0x3342('0x52')]>0x1){_0x43d39f[_0x23c186](_0x3342('0x79'),qs[_0x3342('0x7a')](_0x19e27b[_0x3342('0x71')]),null);}else{var _0x42fcd7='%'+_0x19e27b[_0x3342('0x71')]+'%';_0x43d39f[_0x23c186](_0x3342('0x7b'),_0x42fcd7,_0x42fcd7,_0x42fcd7);}}else{_0x4bc9a9=_['find'](_0x309423,['name',_0x3342('0x7c')]);_0x19e27b[_0x3342('0x58')]=_0x3342('0x7c');_0x570781=as[_0x3342('0x7d')](_0x57942a,_0x4bc9a9['type'],_0x19e27b);_0x43d39f[_0x23c186](_0x570781['text'],_0x570781[_0x3342('0x71')][_0x3342('0x7e')],_0x570781[_0x3342('0x71')][_0x3342('0x37')]);}break;case _0x3342('0x7f'):var _0x3902b6=_0x19e27b[_0x3342('0x71')][_0x3342('0x78')](',')[_0x3342('0x48')](function(_0x385d9c){return Number(_0x385d9c);});_0x3902b6['forEach'](function(_0x3392a2){_0x58d37a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3392a2+',%');});_0x5d5e0f=_[_0x3342('0x80')](_0x5d5e0f,_0x3902b6);break;case _0x3342('0x81'):if(_0x19e27b['operator']===_0x3342('0x77')){_0x43d39f[_0x23c186](_0x3342('0x82'),'%'+_0x19e27b['value']+'%',null);}else{_0x4bc9a9=_[_0x3342('0x6f')](_0x309423,[_0x3342('0x3a'),_0x3342('0x83')]);_0x19e27b[_0x3342('0x58')]=_0x3342('0x83');_0x570781=as[_0x3342('0x7d')](_0x57942a,_0x4bc9a9[_0x3342('0x4a')],_0x19e27b);_0x43d39f[_0x23c186](_0x570781['text'],_0x570781[_0x3342('0x71')]['start'],_0x570781['value'][_0x3342('0x37')]);}break;case _0x3342('0x3e'):_0x570781=as[_0x3342('0x7d')]('me',null,_0x19e27b);_0x43d39f[_0x23c186](_0x570781[_0x3342('0x84')],_0x570781[_0x3342('0x71')][_0x3342('0x7e')],_0x570781[_0x3342('0x71')][_0x3342('0x37')]);break;}}else{var _0x570781=as[_0x3342('0x7d')](_0x57942a,_0x4bc9a9[_0x3342('0x4a')],_0x19e27b);_0x43d39f[_0x23c186](_0x570781[_0x3342('0x84')],_0x570781[_0x3342('0x71')][_0x3342('0x7e')],_0x570781[_0x3342('0x71')][_0x3342('0x37')]);}}}else{var _0x58926c=_(_0x414fcb[_0x3342('0x4d')])[_0x3342('0x4e')]()[_0x3342('0x48')](function(_0x20203b){return _[_0x3342('0x85')](_0x309423,[_0x3342('0x3a'),_0x20203b])?_0x20203b:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x58926c)){_0x58926c[_0x3342('0x44')](function(_0x21670a){if(_0x21670a===_0x3342('0x86')){_0x49e3c6[_0x3342('0x87')](_0x3342('0x88'),[][_0x3342('0x89')](_0x414fcb[_0x3342('0x4d')][_0x21670a]));}else if(_0x21670a===_0x3342('0x8a')){var _0x4b47ab=JSON[_0x3342('0x8b')](_0x414fcb[_0x3342('0x4d')][_0x21670a])[_0x3342('0x8c')];var _0x42782f=JSON['parse'](_0x414fcb[_0x3342('0x4d')][_0x21670a])[_0x3342('0x8d')];_0x49e3c6[_0x3342('0x87')](_0x3342('0x8e'),_0x4b47ab,_0x42782f);}else{if(_0x414fcb[_0x3342('0x4d')][_0x21670a]===_0x3342('0x8f')){_0x49e3c6[_0x3342('0x87')]('i.'+_0x21670a+_0x3342('0x90'));}else{_0x49e3c6[_0x3342('0x87')]('i.'+_0x21670a+'\x20=\x20?',_0x414fcb[_0x3342('0x4d')][_0x21670a]);}}});}if(_0x414fcb[_0x3342('0x4d')]['read']){if(_0x414fcb[_0x3342('0x4d')]['read']==0x1){_0x49e3c6[_0x3342('0x72')]('`unreadMessages`\x20=\x200');}else{_0x49e3c6[_0x3342('0x72')]('`unreadMessages`\x20>\x200');}}if(_0x414fcb[_0x3342('0x4d')][_0x3342('0x91')]){_0x5d5e0f=_['isArray'](_0x414fcb[_0x3342('0x4d')][_0x3342('0x91')])?_0x414fcb['query'][_0x3342('0x91')]:new Array(_0x414fcb[_0x3342('0x4d')][_0x3342('0x91')]);_0x5d5e0f[_0x3342('0x44')](function(_0x22a9ec){_0x58d37a['or'](_0x3342('0x92'),'%,'+_0x22a9ec+',%');});}if(_0x414fcb['query'][_0x3342('0x93')]){var _0x5f168b=_0x414fcb[_0x3342('0x4d')][_0x3342('0x93')][_0x3342('0x94')]('\x5c','\x5c\x5c')[_0x3342('0x94')](/'/g,'\x27\x27');if(qs[_0x3342('0x95')](_0x5f168b)){_0x43d39f['or'](_0x3342('0x96'),_0x5f168b+'%');}else{_0x43d39f['or'](_0x3342('0x97'),qs[_0x3342('0x7a')](_0x5f168b))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5f168b+'%');}}}_0x49e3c6[_0x3342('0x87')](_0x43d39f);_0x49e3c6[_0x3342('0x98')](_0x3342('0x99'));var _0x592122={'type':db['Sequelize'][_0x3342('0x9a')]['SELECT'],'raw':!![]};var _0x59088e=_0x49e3c6[_0x3342('0x9b')]();_0x59088e[_0x3342('0x58')]('i.id');_0x59088e[_0x3342('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3342('0x70'));if(_0x15eb49['order']){_0x15eb49['order'][_0x3342('0x44')](function(_0x2d3f3e){var _0x3131d9=_0x2d3f3e[0x0]==='contactName'?_0x2d3f3e[0x0]:'i.'+_0x2d3f3e[0x0];_0x49e3c6['order'](_0x3131d9,_0x2d3f3e[0x1]===_0x3342('0x9c')?![]:!![]);});}if(!_['isEmpty'](_0x5d5e0f)){_0x49e3c6[_0x3342('0x72')](_0x58d37a);_0x59088e[_0x3342('0x87')](_0x3342('0x9d'),_0x5d5e0f);}BPromise[_0x3342('0x9e')]()['then'](function(){if(!_0x3cc92a){if(_0x414fcb['query'][_0x3342('0x86')])return;_0x59088e[_0x3342('0x87')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x49e3c6[_0x3342('0x87')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x414fcb[_0x3342('0x9f')][_0x3342('0xa0')]!==_0x3342('0xa1'))return;return _0x414fcb[_0x3342('0x9f')][_0x3342('0xa2')]({'attributes':['id'],'raw':!![]})['then'](function(_0x502050){if(_['isEmpty'](_0x502050)){_0x59088e[_0x3342('0x87')](_0x3342('0xa3'));_0x49e3c6[_0x3342('0x87')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x59088e[_0x3342('0x87')](_0x3342('0x88'),_[_0x3342('0x48')](_0x502050,'id'));_0x49e3c6[_0x3342('0x87')](_0x3342('0x88'),_[_0x3342('0x48')](_0x502050,'id'));}});})['then'](function(){if(_0x414fcb[_0x3342('0x9f')]['role']==='agent'&&!_0x3cc92a&&!_0x414fcb['query'][_0x3342('0x86')])return[];return db[_0x3342('0xa4')]['query'](_0x59088e[_0x3342('0xa5')](),_0x592122);})[_0x3342('0x20')](function(_0x55049d){_0x283ce9[_0x3342('0x2e')]=_0x55049d[_0x3342('0x52')];if(_0x283ce9[_0x3342('0x2e')]===0x0)return[];return db[_0x3342('0xa4')][_0x3342('0x4d')](_0x43c27a[_0x3342('0xa5')](),_0x592122)[_0x3342('0x20')](function(_0x132ef4){_0x24d543=_['keyBy'](_0x132ef4,'id');_0x592122=_[_0x3342('0x3d')](_0x592122,{'model':db[_0x3342('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x414fcb[_0x3342('0x4d')][_0x3342('0xa6')]){_0x15eb49[_0x3342('0x51')][_0x3342('0x44')](function(_0x2d2902){_0x49e3c6['field']('i.'+_0x2d2902);});}else{_0x49e3c6['field'](_0x3342('0xa7'),_0x3342('0x70'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xa8'),_0x3342('0xa9'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xaa'),'Account.mandatoryDisposition');_0x49e3c6[_0x3342('0x58')](_0x3342('0xab'),_0x3342('0xac'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xad'));_0x49e3c6['field'](_0x3342('0xae'),_0x3342('0xaf'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xb0'),'Contact.lastName');_0x49e3c6[_0x3342('0x58')](_0x3342('0xb1'),_0x3342('0xb2'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xb3'),_0x3342('0xb4'));_0x49e3c6[_0x3342('0x58')]('c.mobile','Contact.mobile');_0x49e3c6[_0x3342('0x58')]('c.fax',_0x3342('0xb5'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xb6'),_0x3342('0xb7'));_0x49e3c6[_0x3342('0x58')]('o.internal',_0x3342('0xb8'));_0x49e3c6[_0x3342('0x58')](_0x3342('0xb9'),'TagIds');}if(_0x15eb49['limit'])_0x49e3c6[_0x3342('0x2d')](_0x15eb49[_0x3342('0x2d')]);if(_0x15eb49[_0x3342('0x2b')])_0x49e3c6[_0x3342('0x2b')](_0x15eb49[_0x3342('0x2b')]);return db[_0x3342('0xa4')][_0x3342('0x4d')](_0x49e3c6[_0x3342('0xa5')](),_0x592122);})[_0x3342('0x20')](function(_0x304dd0){if(_0x304dd0[_0x3342('0x52')]>0x0)_0x1d5001[_0x3342('0x87')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x304dd0,'id'));return db['sequelize'][_0x3342('0x4d')](_0x1d5001[_0x3342('0xa5')](),_0x592122)[_0x3342('0x20')](function(_0x405995){var _0x31bf5c=_['groupBy'](_0x405995,_0x3342('0xba'));var _0x1f98b5=[];_0x304dd0[_0x3342('0x44')](function(_0x537b31){_0x1f98b5[_0x3342('0x45')](updateChatInteraction(_0x537b31,_0x24d543,_0x31bf5c));});return BPromise[_0x3342('0xbb')](_0x1f98b5);});});})['then'](function(_0x501e72){_0x283ce9[_0x3342('0xbc')]=_0x501e72;return _0x283ce9;})[_0x3342('0x20')](respondWithFilteredResult(_0x5e24a1,_0x15eb49))[_0x3342('0x46')](handleError(_0x5e24a1,null));};exports[_0x3342('0xbd')]=function(_0x475ee4,_0x51b0f9){var _0x48cb53={'raw':![],'where':{'id':_0x475ee4[_0x3342('0xbe')]['id']}},_0x37fdc5={};_0x37fdc5[_0x3342('0x4c')]=_[_0x3342('0x4e')](db[_0x3342('0x49')][_0x3342('0xbf')]);_0x37fdc5[_0x3342('0x4d')]=_['keys'](_0x475ee4['query']);_0x37fdc5['filters']=_[_0x3342('0x50')](_0x37fdc5['model'],_0x37fdc5['query']);_0x48cb53['attributes']=_[_0x3342('0x50')](_0x37fdc5[_0x3342('0x4c')],qs['fields'](_0x475ee4[_0x3342('0x4d')]['fields']));_0x48cb53['attributes']=_0x48cb53[_0x3342('0x51')]['length']?_0x48cb53[_0x3342('0x51')]:_0x37fdc5[_0x3342('0x4c')];if(_0x475ee4[_0x3342('0x4d')][_0x3342('0xc0')]){_0x48cb53[_0x3342('0xc1')]=[{'all':!![]}];}_0x48cb53=_[_0x3342('0x3d')]({},_0x48cb53,_0x475ee4['options']);return db[_0x3342('0x49')][_0x3342('0x6f')](_0x48cb53)[_0x3342('0x20')](handleEntityNotFound(_0x51b0f9,null))['then'](respondWithResult(_0x51b0f9,null))[_0x3342('0x46')](handleError(_0x51b0f9,null));};exports[_0x3342('0xc2')]=function(_0x3b206a,_0x1f7b91){return db[_0x3342('0x49')][_0x3342('0xc2')](_0x3b206a['body'],{})[_0x3342('0x20')](respondWithResult(_0x1f7b91,0xc9))[_0x3342('0x46')](handleError(_0x1f7b91,null));};exports[_0x3342('0x35')]=function(_0x3b875e,_0x441c2a){if(_0x3b875e['body']['id']){delete _0x3b875e[_0x3342('0x3e')]['id'];}return db[_0x3342('0x49')][_0x3342('0x6f')]({'where':{'id':_0x3b875e[_0x3342('0xbe')]['id']}})['then'](handleEntityNotFound(_0x441c2a,null))[_0x3342('0x20')](saveUpdates(_0x3b875e['body'],null))[_0x3342('0x20')](respondWithResult(_0x441c2a,null))[_0x3342('0x46')](handleError(_0x441c2a,null));};exports[_0x3342('0x36')]=function(_0x4f4819,_0x1e67a4){return db['ChatInteraction'][_0x3342('0x6f')]({'where':{'id':_0x4f4819['params']['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x1e67a4,null))[_0x3342('0x20')](removeEntity(_0x1e67a4,null))[_0x3342('0x46')](handleError(_0x1e67a4,null));};exports['describe']=function(_0x25b867,_0x3a6d87){return db[_0x3342('0x49')][_0x3342('0xc3')]()[_0x3342('0x20')](respondWithResult(_0x3a6d87,null))[_0x3342('0x46')](handleError(_0x3a6d87,null));};exports[_0x3342('0xc4')]=function(_0x4d86c3,_0x296ae6){var _0x2d7ba8=_0x4d86c3[_0x3342('0xbe')]['id'];var _0x526a1a;var _0x27aa50;var _0x3c0eb8;return db[_0x3342('0x49')][_0x3342('0xc5')]({'where':{'id':_0x2d7ba8}})[_0x3342('0x20')](function(_0x157c6d){_0x526a1a=_0x157c6d;return db[_0x3342('0xc6')][_0x3342('0xc5')]({'where':{'id':_0x157c6d['ChatWebsiteId']},'attributes':['id',_0x3342('0xc7'),_0x3342('0xc8'),'vidaooTopic',_0x3342('0xc9'),_0x3342('0xca')],'raw':!![]});})[_0x3342('0x20')](function(_0x1e26f8){if(_0x1e26f8&&_0x1e26f8[_0x3342('0xc7')]&&_0x1e26f8[_0x3342('0xc8')]){_0x27aa50=_0x1e26f8;var _0x3c371b={'interaction':{'id':_0x2d7ba8},'agent':{'id':_0x4d86c3[_0x3342('0x9f')]['id'],'name':_0x4d86c3[_0x3342('0x9f')][_0x3342('0x3a')],'fullname':_0x4d86c3[_0x3342('0x9f')]['fullname'],'email':_0x4d86c3['user'][_0x3342('0xcb')]},'contact':_0x4d86c3[_0x3342('0x3e')][_0x3342('0xcc')],'account':_0x4d86c3[_0x3342('0x3e')][_0x3342('0x40')]};var _0x1bed4c={'rejectUnauthorized':![],'method':_0x3342('0xcd'),'url':_0x3342('0xce'),'headers':{'X-APIKEY':_0x1e26f8[_0x3342('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4d86c3[_0x3342('0x9f')][_0x3342('0xcb')]],'buttons':null,'topic':_0x27aa50[_0x3342('0xcf')],'note':_[_0x3342('0xd0')](_0x27aa50[_0x3342('0xc9')])?null:getMustacheRender(_0x27aa50[_0x3342('0xc9')],_0x3c371b),'metadata':null},'redirect':_0x3342('0xd1'),'json':!![]};try{if(!_['isNull'](_0x27aa50['vidaooMetadata'])){var _0x399d30=getMustacheRender(_0x27aa50[_0x3342('0xca')],_0x3c371b);var _0x4fcb8d=JSON[_0x3342('0x8b')](_0x399d30);_0x1bed4c[_0x3342('0x3e')]['metadata']=_0x4fcb8d;}}catch(_0x455b2d){throw new db['Sequelize'][(_0x3342('0xd2'))](_0x3342('0xd3'));}return rp(_0x1bed4c);}else{throw new db[(_0x3342('0xd4'))][(_0x3342('0xd2'))](_0x3342('0xd5'));}})[_0x3342('0x20')](function(_0x8f9e69){_0x3c0eb8=_0x8f9e69;if(_0x3c0eb8['id']){var _0x31014e={'body':_0x3c0eb8[_0x3342('0xd6')],'ChatWebsiteId':_0x27aa50['id'],'ChatInteractionId':_0x526a1a['id'],'direction':'out','UserId':_0x4d86c3['user']['id']};return db['ChatMessage'][_0x3342('0xc2')](_0x31014e,{});}else{throw new db[(_0x3342('0xd4'))]['ValidationError'](_0x3342('0xd7'));}})[_0x3342('0x20')](function(){return _0x526a1a[_0x3342('0xd8')]({'vidaooSessionId':_0x3c0eb8['id']});})[_0x3342('0x20')](respondWithResult(_0x296ae6,null))['catch'](handleError(_0x296ae6,null));};exports[_0x3342('0xd9')]=function(_0x2d38a7,_0x5dbba5){if(_0x2d38a7['body']['id']){delete _0x2d38a7[_0x3342('0x3e')]['id'];}return db[_0x3342('0x49')][_0x3342('0x6f')]({'where':{'id':_0x2d38a7[_0x3342('0xbe')]['id']},'include':[{'model':db[_0x3342('0xda')],'as':_0x3342('0x75')}]})['then'](handleEntityNotFound(_0x5dbba5,null))['then'](saveUpdates(_0x2d38a7[_0x3342('0x3e')],null))[_0x3342('0x20')](respondWithResult(_0x5dbba5,null))[_0x3342('0x46')](handleError(_0x5dbba5,null));};exports[_0x3342('0xdb')]=function(_0x1b87a7,_0x50b51b,_0x50470b){if(_0x1b87a7['body']['id']){delete _0x1b87a7[_0x3342('0x3e')]['id'];}return db['ChatInteraction'][_0x3342('0x6f')]({'where':{'id':_0x1b87a7[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](function(_0x24b50f){if(!_0x24b50f){logger[_0x3342('0x26')](_0x3342('0xdc'),_0x3342('0xdb'),0x194,_0x3342('0xdd'));_0x50b51b[_0x3342('0x38')](0x194);}else{if(_0x24b50f[_0x3342('0x83')]){throw new db[(_0x3342('0xd4'))][(_0x3342('0xd2'))]('Interaction\x20already\x20assigned');}}return _0x24b50f;})[_0x3342('0x20')](function(_0x32a488){if(_0x32a488){return _0x32a488[_0x3342('0x35')]({'closed':_0x1b87a7[_0x3342('0x3e')][_0x3342('0xde')],'disposition':_0x1b87a7[_0x3342('0x3e')][_0x3342('0xdf')]})[_0x3342('0x20')](function(_0x28bb21){return _0x28bb21;});}})[_0x3342('0x20')](function(_0x40aa4a){return respondWithRpcPromise(_0x3342('0xe0'),'abandon',_0x1b87a7[_0x3342('0x3e')],client9004);})[_0x3342('0x20')](respondWithResult(_0x50b51b,null))['catch'](handleError(_0x50b51b,null));};exports[_0x3342('0xe1')]=function(_0x78daec,_0x7b7120,_0x512838){_0x78daec[_0x3342('0x3e')][_0x3342('0x3a')]=_0x78daec[_0x3342('0xe2')][_0x3342('0xe3')];_0x78daec[_0x3342('0x3e')][_0x3342('0xe4')]=_0x78daec['file'][_0x3342('0xe5')];_0x78daec[_0x3342('0x3e')][_0x3342('0x4a')]=_0x78daec[_0x3342('0xe2')]['mimetype'];return db[_0x3342('0xe6')]['create'](_0x78daec['body'])[_0x3342('0x20')](respondWithResult(_0x7b7120,0xc9))[_0x3342('0x46')](handleError(_0x7b7120,null));};exports[_0x3342('0xe7')]=function(_0x22ac7c,_0x4726ab,_0x14a236){return db[_0x3342('0x49')][_0x3342('0xc5')]({'where':{'id':_0x22ac7c[_0x3342('0xbe')]['id']},'raw':!![]})[_0x3342('0x20')](handleEntityNotFound(_0x4726ab,null))['then'](function(_0x58bcc3){if(_0x58bcc3){if(_0x58bcc3[_0x3342('0xde')]){return _0x4726ab[_0x3342('0x2f')](0x193)['json']({'status':0x193,'message':_0x3342('0xe8')});}return db['Attachment'][_0x3342('0xc5')]({'where':{'id':_0x22ac7c[_0x3342('0x4d')][_0x3342('0xe9')]},'raw':!![]})['then'](handleEntityNotFound(_0x4726ab,null));}})['then'](function(_0x328f06){if(_0x328f06){var _0x2a2c38=_0x328f06[_0x3342('0xea')]!==null;var _0x41146b=path['join'](config['root'],_0x3342('0xeb'));if(_0x2a2c38){_0x41146b=path['join'](_0x41146b,_0x3342('0xec'));}var _0xcd0550=path[_0x3342('0xed')](_0x41146b,_0x328f06[_0x3342('0xe4')]);return _0x4726ab[_0x3342('0xee')](_0xcd0550);}})['catch'](handleError(_0x4726ab,null));};exports['close']=function(_0x214ff3,_0x584c31){var _0x6ea059=null;var _0x521e5a=null;var _0x5cc2ef=null;var _0x59c56a=null;if(_0x214ff3['body']['id']){delete _0x214ff3[_0x3342('0x3e')]['id'];}if(_0x214ff3[_0x3342('0x3e')]['mailTranscript']){_0x59c56a=path['join'](config[_0x3342('0xef')],_0x3342('0xf0'),util[_0x3342('0xf1')]('transcript-%s.txt',Date[_0x3342('0xf2')]()));_0x214ff3[_0x3342('0x3e')][_0x3342('0xf3')]=_0x59c56a;}return db[_0x3342('0x49')]['find']({'where':{'id':_0x214ff3[_0x3342('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x3342('0xf4'),'include':[{'model':db[_0x3342('0x81')],'as':_0x3342('0x81')}]}]})['then'](handleEntityNotFound(_0x584c31,null))[_0x3342('0x20')](saveUpdates(_0x214ff3['body'],null))[_0x3342('0x20')](function(_0xf61be3){if(_0xf61be3){_0x6ea059=_0xf61be3;return db[_0x3342('0xc6')][_0x3342('0x6f')]({'where':{'id':_0x6ea059[_0x3342('0x86')]}});}})[_0x3342('0x20')](function(_0x322dd2){if(_0x322dd2){_0x5cc2ef=_0x322dd2;return db[_0x3342('0xda')][_0x3342('0x6f')]({'where':{'id':_0x6ea059['ContactId']}});}})[_0x3342('0x20')](function(_0x45bd80){if(_0x45bd80){_0x521e5a=_0x45bd80;if(_0x59c56a){var _0x35c575=null;for(var _0x1df1cb=0x1;_0x1df1cb<_0x6ea059[_0x3342('0xf4')]['length'];++_0x1df1cb){_0x35c575=_0x6ea059['Messages'][_0x1df1cb];var _0x4cb2f5=_0x35c575[_0x3342('0x83')]?util[_0x3342('0xf1')](_0x3342('0xf5'),_0x5cc2ef['agentAlias'],_0x35c575[_0x3342('0x83')]):_0x3342('0xf6');var _0x6d520a=_0x214ff3['body'][_0x3342('0xf7')]||util['format'](_0x3342('0xf5'),_0x3342('0xf8'),_0x35c575[_0x3342('0x7c')]);switch(_0x5cc2ef[_0x3342('0xf9')]){case _0x3342('0xfa'):_0x4cb2f5=_0x35c575['UserId']?util[_0x3342('0xf1')](_0x3342('0xf5'),_0x5cc2ef[_0x3342('0xfb')],_0x35c575['UserId']):_0x3342('0xf6');break;case _0x3342('0xfc'):_0x4cb2f5=_0x35c575[_0x3342('0x83')]?_0x35c575[_0x3342('0x81')]['alias']||_0x35c575[_0x3342('0x81')][_0x3342('0x42')]:_0x3342('0xf6');break;case _0x3342('0xfd'):_0x4cb2f5=_0x35c575[_0x3342('0x83')]?_0x35c575['User'][_0x3342('0x42')]:'System';break;default:_0x4cb2f5=_0x35c575[_0x3342('0x83')]?util[_0x3342('0xf1')](_0x3342('0xf5'),_0x5cc2ef[_0x3342('0xfb')],_0x35c575['UserId']):_0x3342('0xf6');}var _0x3b0ae0=util[_0x3342('0xf1')](_0x3342('0xfe'),moment(_0x35c575['createdAt'])[_0x3342('0xf1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x35c575[_0x3342('0xff')]==='in'?_0x6d520a:_0x4cb2f5,_0x35c575[_0x3342('0x3e')]);if(!_0x35c575['secret']){fs[_0x3342('0x100')](_0x59c56a,_0x3b0ae0);}}return db['MailAccount'][_0x3342('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x3342('0x101')],'as':_0x3342('0x102'),'raw':!![]}]});}}})[_0x3342('0x20')](function(_0x1f6d84){if(_0x1f6d84&&_0x1f6d84[_0x3342('0x102')]&&_0x214ff3[_0x3342('0x3e')]){var _0x34e824={'tls':{'rejectUnauthorized':![]}};if(_0x1f6d84[_0x3342('0x102')][_0x3342('0x103')]){_0x34e824[_0x3342('0x103')]=_0x1f6d84['Smtp'][_0x3342('0x103')];}else{_0x34e824[_0x3342('0x104')]=_0x1f6d84[_0x3342('0x102')]['host'];_0x34e824['port']=_0x1f6d84[_0x3342('0x102')]['port'];_0x34e824[_0x3342('0x105')]=_0x1f6d84[_0x3342('0x102')][_0x3342('0x105')];}if(_0x1f6d84[_0x3342('0x102')][_0x3342('0x106')]){_0x34e824[_0x3342('0x107')]={'user':_0x1f6d84[_0x3342('0x102')][_0x3342('0x9f')],'pass':_0x1f6d84['Smtp'][_0x3342('0x108')]};}return respondWithRpcPromise(_0x3342('0x109'),'sendMail',{'account':_0x34e824,'message':{'from':util[_0x3342('0xf1')](_0x3342('0x10a'),_0x1f6d84[_0x3342('0x3a')],_0x1f6d84['email']||_0x1f6d84['Smtp'][_0x3342('0x9f')]),'to':_0x214ff3[_0x3342('0x3e')][_0x3342('0x10b')],'subject':'Mail\x20Transcript','text':util[_0x3342('0xf1')](_0x3342('0x10c'),_0x214ff3[_0x3342('0x3e')]['mailTranscript']),'attachments':[{'path':_0x59c56a}]}})[_0x3342('0x20')](function(){return _0x6ea059;})['catch'](function(_0x4ccbbe){console[_0x3342('0x26')](_0x4ccbbe);});}else{return _0x6ea059;}})[_0x3342('0x20')](respondWithStatusCode(_0x584c31,0xc8))[_0x3342('0x46')](handleError(_0x584c31,null));};exports[_0x3342('0x10d')]=function(_0x41e521,_0x1ab46b,_0x592f9b){return db[_0x3342('0x10e')][_0x3342('0x6f')]({'where':{'id':_0x41e521[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x1ab46b,null))[_0x3342('0x20')](function(_0x3bb70b){if(_0x3bb70b){return _0x3bb70b[_0x3342('0x10d')](_0x41e521[_0x3342('0x3e')][_0x3342('0x10f')],_[_0x3342('0x110')](_0x41e521[_0x3342('0x3e')],['ids','id'])||{});}})['then'](respondWithResult(_0x1ab46b,null))['catch'](handleError(_0x1ab46b,null));};exports[_0x3342('0x111')]=function(_0x2b46c5,_0x203409,_0x242c31){var _0x87fe8={'raw':![],'where':{}};var _0x3d594c={};var _0x4ea5cf={'count':0x0,'rows':[]};return db[_0x3342('0x49')]['findOne']({'where':{'id':_0x2b46c5[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x203409,null))[_0x3342('0x20')](function(_0x7b2e55){if(_0x7b2e55){_0x3d594c[_0x3342('0x4c')]=_[_0x3342('0x4e')](db[_0x3342('0x10e')][_0x3342('0xbf')]);_0x3d594c['query']=_[_0x3342('0x4e')](_0x2b46c5[_0x3342('0x4d')]);_0x3d594c[_0x3342('0x4f')]=_[_0x3342('0x50')](_0x3d594c['model'],_0x3d594c['query']);_0x87fe8[_0x3342('0x51')]=_['intersection'](_0x3d594c[_0x3342('0x4c')],qs[_0x3342('0xa6')](_0x2b46c5[_0x3342('0x4d')][_0x3342('0xa6')]));_0x87fe8[_0x3342('0x51')]=_0x87fe8[_0x3342('0x51')][_0x3342('0x52')]?_0x87fe8[_0x3342('0x51')]:_0x3d594c['model'];if(!_0x2b46c5[_0x3342('0x4d')][_0x3342('0x53')](_0x3342('0x54'))){_0x87fe8['limit']=qs[_0x3342('0x2d')](_0x2b46c5[_0x3342('0x4d')][_0x3342('0x2d')]);_0x87fe8[_0x3342('0x2b')]=qs[_0x3342('0x2b')](_0x2b46c5[_0x3342('0x4d')]['offset']);}_0x87fe8[_0x3342('0x55')]=qs[_0x3342('0x56')](_0x2b46c5[_0x3342('0x4d')][_0x3342('0x56')]);_0x87fe8['where']=qs['filters'](_[_0x3342('0x57')](_0x2b46c5[_0x3342('0x4d')],_0x3d594c[_0x3342('0x4f')]));_0x87fe8['where'][_0x3342('0xba')]=_0x7b2e55['id'];if(_0x2b46c5[_0x3342('0x4d')]['filter']){_0x87fe8[_0x3342('0x87')]=_[_0x3342('0x3d')](_0x87fe8[_0x3342('0x87')],{'$or':_[_0x3342('0x48')](_0x87fe8[_0x3342('0x51')],function(_0x1f9706){var _0x422e17={};_0x422e17[_0x1f9706]={'$like':'%'+_0x2b46c5[_0x3342('0x4d')][_0x3342('0x93')]+'%'};return _0x422e17;})});}if(_0x2b46c5['query'][_0x3342('0x8c')]){var _0x109c2c=_0x2b46c5[_0x3342('0x4d')][_0x3342('0x8c')][_0x3342('0x78')](',');var _0x891df3={};_0x891df3[_0x109c2c[0x0]]={'$gte':moment(_0x109c2c[0x1])[_0x3342('0xf1')](_0x3342('0x112'))};_0x87fe8[_0x3342('0x87')]=_[_0x3342('0x3d')](_0x87fe8[_0x3342('0x87')],_0x891df3);}_0x87fe8=_[_0x3342('0x3d')]({},_0x87fe8,_0x2b46c5[_0x3342('0x113')]);return db[_0x3342('0x10e')][_0x3342('0x2e')]({'where':_0x87fe8[_0x3342('0x87')]})[_0x3342('0x20')](function(_0x2dcc44){_0x4ea5cf[_0x3342('0x2e')]=_0x2dcc44;if(_0x2b46c5[_0x3342('0x4d')][_0x3342('0xc0')]){_0x87fe8['include']=[{'all':!![]}];}return db[_0x3342('0x10e')][_0x3342('0x114')](_0x87fe8);})[_0x3342('0x20')](function(_0x34b9bd){_0x4ea5cf['rows']=_0x34b9bd;return _0x4ea5cf;});}})[_0x3342('0x20')](respondWithFilteredResult(_0x203409,_0x87fe8))['catch'](handleError(_0x203409,null));};exports[_0x3342('0x115')]=function(_0x53e73b,_0x51f592,_0x8fc042){var _0x43bf9a={'where':{}},_0x12693e={},_0x564ecb={'count':0x0,'rows':[]};return db[_0x3342('0x49')][_0x3342('0xc5')]({'where':{'id':_0x53e73b[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x51f592,null))[_0x3342('0x20')](function(_0x7b2d65){if(_0x7b2d65){_0x12693e[_0x3342('0x4c')]=_['keys'](db[_0x3342('0x10e')]['rawAttributes']);_0x12693e[_0x3342('0x4d')]=_[_0x3342('0x4e')](_0x53e73b[_0x3342('0x4d')]);_0x12693e['filters']=_[_0x3342('0x50')](_0x12693e[_0x3342('0x4c')],_0x12693e[_0x3342('0x4d')]);_0x43bf9a[_0x3342('0x51')]=_[_0x3342('0x50')](_0x12693e[_0x3342('0x4c')],qs[_0x3342('0xa6')](_0x53e73b['query'][_0x3342('0xa6')]));_0x43bf9a[_0x3342('0x51')]=_0x43bf9a[_0x3342('0x51')][_0x3342('0x52')]?_0x43bf9a[_0x3342('0x51')]:_0x12693e[_0x3342('0x4c')];if(!_0x53e73b['query'][_0x3342('0x53')](_0x3342('0x54'))){_0x43bf9a['limit']=qs['limit'](_0x53e73b[_0x3342('0x4d')][_0x3342('0x2d')]);_0x43bf9a[_0x3342('0x2b')]=qs['offset'](_0x53e73b[_0x3342('0x4d')][_0x3342('0x2b')]);}_0x43bf9a[_0x3342('0x55')]=qs[_0x3342('0x56')](_0x53e73b['query'][_0x3342('0x56')]);_0x43bf9a['where']=qs['filters'](_[_0x3342('0x57')](_0x53e73b[_0x3342('0x4d')],_0x12693e['filters']));_0x43bf9a[_0x3342('0x87')][_0x3342('0xba')]=_0x7b2d65['id'];if(_0x53e73b[_0x3342('0x4d')][_0x3342('0x93')]){_0x43bf9a['where']=_[_0x3342('0x3d')](_0x43bf9a[_0x3342('0x87')],{'$or':_[_0x3342('0x48')](_0x43bf9a[_0x3342('0x51')],function(_0x1af0ab){var _0x2c36b6={};_0x2c36b6[_0x1af0ab]={'$like':'%'+_0x53e73b[_0x3342('0x4d')][_0x3342('0x93')]+'%'};return _0x2c36b6;})});}_0x43bf9a['where']['secret']=![];if(_0x53e73b[_0x3342('0x4d')]['id']){_0x43bf9a[_0x3342('0x87')]['id']={'$gt':_0x53e73b[_0x3342('0x4d')]['id']};}_0x43bf9a=_[_0x3342('0x3d')]({},_0x43bf9a,_0x53e73b['options']);return db['ChatMessage'][_0x3342('0x2e')]({'where':_0x43bf9a['where']})[_0x3342('0x20')](function(_0x408c0b){_0x564ecb[_0x3342('0x2e')]=_0x408c0b;_0x43bf9a[_0x3342('0xc1')]=[];if(_0x53e73b[_0x3342('0x4d')]['includeAgent']){_0x43bf9a[_0x3342('0xc1')][_0x3342('0x45')]({'model':db[_0x3342('0x81')],'as':_0x3342('0x81'),'attributes':['id',_0x3342('0x42'),_0x3342('0x116')]});}if(_0x53e73b[_0x3342('0x4d')][_0x3342('0xc0')]){_0x43bf9a[_0x3342('0xc1')]=[{'all':!![]}];}return db[_0x3342('0x10e')]['findAll'](_0x43bf9a);})[_0x3342('0x20')](function(_0x4ee731){_0x564ecb[_0x3342('0xbc')]=_0x4ee731;return _0x564ecb;});}})[_0x3342('0x20')](respondWithFilteredResult(_0x51f592,_0x43bf9a))[_0x3342('0x46')](handleError(_0x51f592,null));};exports[_0x3342('0x117')]=function(_0x13846a,_0x35ef7e,_0x65063d){return db[_0x3342('0x49')][_0x3342('0x6f')]({'where':{'id':_0x13846a[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x35ef7e,null))[_0x3342('0x20')](function(_0xb7cc7){if(_0xb7cc7){return _0xb7cc7[_0x3342('0x118')](_0x13846a[_0x3342('0x3e')]['ids'],_[_0x3342('0x110')](_0x13846a[_0x3342('0x3e')],['ids','id'])||{})[_0x3342('0x119')](function(){return db[_0x3342('0x7f')][_0x3342('0x114')]({'attributes':['id',_0x3342('0x3a'),_0x3342('0x59')],'where':{'id':_0x13846a[_0x3342('0x3e')][_0x3342('0x10f')]}});})[_0x3342('0x20')](function(_0x178c5d){socket[_0x3342('0x11a')](_0x3342('0x11b'),{'id':Number(_0x13846a[_0x3342('0xbe')]['id']),'tags':_0x178c5d||[]});return{'id':Number(_0x13846a[_0x3342('0xbe')]['id']),'tags':_0x178c5d||[]};});}})['then'](respondWithResult(_0x35ef7e,null))[_0x3342('0x46')](handleError(_0x35ef7e,null));};exports[_0x3342('0x11c')]=function(_0x667da3,_0x4a26c4,_0x3d4b1d){return db['ChatInteraction']['find']({'where':{'id':_0x667da3[_0x3342('0xbe')]['id']}})[_0x3342('0x20')](handleEntityNotFound(_0x4a26c4,null))[_0x3342('0x20')](function(_0x91b50b){if(_0x91b50b){return _0x91b50b[_0x3342('0x11c')](_0x667da3['query']['ids']);}})[_0x3342('0x20')](respondWithStatusCode(_0x4a26c4,null))[_0x3342('0x46')](handleError(_0x4a26c4,null));};exports[_0x3342('0xee')]=function(_0x4d7c61,_0x13d5ae){var _0x18e629=moment()['unix']()[_0x3342('0xa5')]();var _0x11f4c7=path[_0x3342('0xed')](config[_0x3342('0xef')],_0x3342('0x11d'),'files','tmp');var _0x20f322=path[_0x3342('0xed')](config[_0x3342('0xef')],_0x3342('0x11d'),'files',_0x3342('0x11e'));var _0xd16f=path[_0x3342('0xed')](_0x11f4c7,_0x18e629);var _0x5b2c37=util[_0x3342('0xf1')](_0x3342('0x11f'),_0x4d7c61[_0x3342('0xbe')]['id'],_0x18e629);var _0x212ec9=path[_0x3342('0xed')](_0x11f4c7,_0x5b2c37);var _0x143b82=[];_0x143b82[_0x3342('0x45')]({'model':db[_0x3342('0x81')],'as':_0x3342('0x81'),'attributes':['id',_0x3342('0x42')],'raw':!![]});_0x143b82[_0x3342('0x45')]({'model':db[_0x3342('0xda')],'as':_0x3342('0x75'),'attributes':['id',_0x3342('0x120'),'lastName'],'raw':!![]});if(_0x4d7c61[_0x3342('0x4d')][_0x3342('0x11e')]){_0x143b82[_0x3342('0x45')]({'model':db[_0x3342('0xe6')],'as':_0x3342('0xe6'),'raw':!![]});}var _0x49b963=[{'model':db[_0x3342('0x10e')],'as':_0x3342('0xf4'),'attributes':['id',_0x3342('0x3e'),'createdAt',_0x3342('0xff'),_0x3342('0x121'),_0x3342('0x122')],'include':_0x143b82}];_0x49b963[_0x3342('0x45')]({'model':db[_0x3342('0xc6')],'as':_0x3342('0x123'),'attributes':['id',_0x3342('0x3a')]});_0x49b963['push']({'model':db['User'],'as':_0x3342('0x124'),'attributes':['id','fullname']});return db[_0x3342('0x49')][_0x3342('0x6f')]({'where':{'id':_0x4d7c61['params']['id']},'include':_0x49b963})['then'](handleEntityNotFound(_0x13d5ae,null))[_0x3342('0x20')](function(_0x44bc75){if(_0x44bc75){var _0x3c85d2=_0x44bc75[_0x3342('0x125')]({'plain':!![]});fs[_0x3342('0x126')](_0xd16f);var _0x1597da={'channel':_0x3342('0x127'),'account':_0x3c85d2[_0x3342('0x123')][_0x3342('0x3a')],'agent':_0x3c85d2[_0x3342('0x124')]?_0x3c85d2[_0x3342('0x124')]['fullname']:'N.A.','createdAt':moment(_0x3c85d2[_0x3342('0x8a')])[_0x3342('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3342('0xa5')](),'closedAt':_0x3c85d2['closed']?moment(_0x3c85d2[_0x3342('0x128')])[_0x3342('0xf1')](_0x3342('0x112'))[_0x3342('0xa5')]():'','disposition':_0x3c85d2[_0x3342('0xdf')],'chatInfo':{'browser':_0x3c85d2['browserName'],'os':_0x3c85d2[_0x3342('0x129')],'referer':_0x3c85d2['referer'],'customerIp':_0x3c85d2[_0x3342('0x12a')],'customerPort':_0x3c85d2['customerPort']?_0x3c85d2[_0x3342('0x12b')]:'N.A.'},'messages':_(_0x3c85d2[_0x3342('0xf4')])['tail']()[_0x3342('0x93')]({'secret':![]})[_0x3342('0x48')](function(_0xf3c1bb){if(_0xf3c1bb[_0x3342('0xe6')]){var _0x437bb7=path[_0x3342('0xed')](_0x20f322,_0xf3c1bb[_0x3342('0xe6')]['basename']);if(fs[_0x3342('0x12c')](_0x437bb7)){fs['createReadStream'](_0x437bb7)[_0x3342('0x12d')](fs['createWriteStream'](path[_0x3342('0xed')](_0xd16f,_0xf3c1bb['Attachment'][_0x3342('0xe4')])));}}return{'date':moment(_0xf3c1bb[_0x3342('0x8a')])['format'](_0x3342('0x112'))[_0x3342('0xa5')](),'sender':_0xf3c1bb['direction']===_0x3342('0x12e')?_0xf3c1bb[_0x3342('0x81')]?_0xf3c1bb[_0x3342('0x81')][_0x3342('0x42')]:'System':_0xf3c1bb[_0x3342('0x75')][_0x3342('0x120')]+(_0xf3c1bb['Contact'][_0x3342('0x12f')]?'\x20'+_0xf3c1bb[_0x3342('0x75')][_0x3342('0x12f')]:''),'body':_0xf3c1bb['Attachment']?_0xf3c1bb['Attachment'][_0x3342('0xe4')]:_0xf3c1bb[_0x3342('0x3e')],'direction':_0xf3c1bb['direction']===_0x3342('0x12e')?'A':'C','secret':_0xf3c1bb['secret'],'read':_0xf3c1bb[_0x3342('0x122')],'attachment':_0xf3c1bb[_0x3342('0xe6')]};})['value']()};return ejs[_0x3342('0x130')](path[_0x3342('0xed')](config[_0x3342('0xef')],_0x3342('0x11d'),'views',_0x3342('0x131')),{'interaction':_0x1597da})[_0x3342('0x20')](function(_0x267752){var _0x47bdd3=path[_0x3342('0xed')](_0xd16f,_0x3342('0x132')+_0x3c85d2['id']+'-'+_0x18e629+_0x3342('0x133'));var _0x5b9ac8={'path':_0x47bdd3,'channel':'Chat','interactionId':_0x3c85d2['id']};return pdf[_0x3342('0x134')](_0x267752,_0x5b9ac8);})[_0x3342('0x20')](function(){return new BPromise(function(_0x567761,_0x17cb20){zipdir(_0xd16f,{'saveTo':_0x212ec9},function(_0x5fbd3c,_0x33a274){if(_0x5fbd3c)return _0x17cb20(_0x5fbd3c);return _0x567761(_0x33a274);});})[_0x3342('0x20')](function(){return new BPromise(function(_0x90ef48,_0x76b760){rimraf(_0xd16f,function(_0x1ec7ff){if(_0x1ec7ff)_0x76b760(_0x1ec7ff);return _0x90ef48();});});})[_0x3342('0x20')](function(){return _0x13d5ae[_0x3342('0xee')](_0x212ec9,_0x5b2c37,function(_0x4f3f28){if(_0x4f3f28){console[_0x3342('0x135')](_0x3342('0x136'),_0x4f3f28);}else{fs[_0x3342('0x137')](_0x212ec9);}});});});}else{return _0x13d5ae[_0x3342('0x38')](0xc8);}})[_0x3342('0x46')](handleError(_0x13d5ae,null));}; \ No newline at end of file +var _0x757a=['u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','conditions','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','type','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','show','params','rawAttributes','includeAll','include','options','create','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','basename','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','getMessages','$gte','findAll','getMyMessages','secret','includeAgent','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','root','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','send','render','merge','body','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','push','catch','index','ChatInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags'];(function(_0x3efdc4,_0x1f962a){var _0x314b59=function(_0x404253){while(--_0x404253){_0x3efdc4['push'](_0x3efdc4['shift']());}};_0x314b59(++_0x1f962a);}(_0x757a,0xde));var _0xa757=function(_0x3a69cb,_0x27ef04){_0x3a69cb=_0x3a69cb-0x0;var _0x48cccb=_0x757a[_0x3a69cb];return _0x48cccb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var pdf=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa757('0x15')]=_['defaults'](config['redis'],{'host':_0xa757('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa757('0x17'))[_0xa757('0x18')](socket);var jayson=require(_0xa757('0x19'));var client=jayson[_0xa757('0x1a')][_0xa757('0x1b')]({'port':0x232b});var client9004=jayson[_0xa757('0x1a')][_0xa757('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x2f7947,_0x185011,_0x3df1f9,_0x50aac1){return new BPromise(function(_0x2e195b,_0x44eab8){var _0xde8248=_0x50aac1||client;return _0xde8248['request'](_0x2f7947,_0x3df1f9)['then'](function(_0x151c04){logger[_0xa757('0x1c')](_0xa757('0x1d'),_0x185011,_0xa757('0x1e'));logger[_0xa757('0x1f')](_0xa757('0x20'),_0x185011,'request\x20sent',JSON[_0xa757('0x21')](_0x151c04));if(_0x151c04['error']){if(_0x151c04[_0xa757('0x22')][_0xa757('0x23')]===0x1f4){logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x151c04['error']['message']);return _0x44eab8(_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);}logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);return _0x2e195b(_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);}else{logger[_0xa757('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x185011,_0xa757('0x1e'));_0x2e195b(_0x151c04['result'][_0xa757('0x24')]);}})['catch'](function(_0x40551d){logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x40551d);_0x44eab8(_0x40551d);});});}function respondWithStatusCode(_0x4d58a4,_0x2b19d5){_0x2b19d5=_0x2b19d5||0xcc;return function(_0xcd98bd){if(_0xcd98bd){return _0x4d58a4[_0xa757('0x25')](_0x2b19d5);}return _0x4d58a4[_0xa757('0x26')](_0x2b19d5)['end']();};}function respondWithResult(_0x449a7d,_0x54263b){_0x54263b=_0x54263b||0xc8;return function(_0x5a5664){if(_0x5a5664){return _0x449a7d['status'](_0x54263b)['json'](_0x5a5664);}};}function respondWithFilteredResult(_0xfdf69d,_0x596ae2){return function(_0x2208f9){if(_0x2208f9){var _0x3bc24c=typeof _0x596ae2['offset']===_0xa757('0x27')&&typeof _0x596ae2['limit']===_0xa757('0x27');var _0xa6d0f6=_0x2208f9['count'];var _0x235e54=_0x3bc24c?0x0:_0x596ae2['offset'];var _0x3a4a66=_0x3bc24c?_0x2208f9[_0xa757('0x28')]:_0x596ae2[_0xa757('0x29')]+_0x596ae2[_0xa757('0x2a')];var _0xcc87c0;if(_0x3a4a66>=_0xa6d0f6){_0x3a4a66=_0xa6d0f6;_0xcc87c0=0xc8;}else{_0xcc87c0=0xce;}_0xfdf69d[_0xa757('0x26')](_0xcc87c0);return _0xfdf69d[_0xa757('0x2b')](_0xa757('0x2c'),_0x235e54+'-'+_0x3a4a66+'/'+_0xa6d0f6)[_0xa757('0x2d')](_0x2208f9);}return null;};}function patchUpdates(_0x384424){return function(_0x1f5d5a){try{jsonpatch[_0xa757('0x2e')](_0x1f5d5a,_0x384424,!![]);}catch(_0x25dfbb){return BPromise[_0xa757('0x2f')](_0x25dfbb);}return _0x1f5d5a[_0xa757('0x30')]();};}function saveUpdates(_0xc1cc20,_0x3e64b7){return function(_0x1ad384){if(_0x1ad384){return _0x1ad384[_0xa757('0x31')](_0xc1cc20)[_0xa757('0x32')](function(_0x3de18f){return _0x3de18f;});}return null;};}function removeEntity(_0x170aa9,_0x379de7){return function(_0x3aae1e){if(_0x3aae1e){return _0x3aae1e['destroy']()[_0xa757('0x32')](function(){_0x170aa9[_0xa757('0x26')](0xcc)[_0xa757('0x33')]();});}};}function handleEntityNotFound(_0x1794a9,_0x1c4c40){return function(_0x51e2aa){if(!_0x51e2aa){_0x1794a9[_0xa757('0x25')](0x194);}return _0x51e2aa;};}function handleError(_0x2af470,_0x37b1a3){_0x37b1a3=_0x37b1a3||0x1f4;return function(_0x2c34b1){logger[_0xa757('0x22')](_0x2c34b1[_0xa757('0x34')]);if(_0x2c34b1['name']){delete _0x2c34b1[_0xa757('0x35')];}_0x2af470[_0xa757('0x26')](_0x37b1a3)[_0xa757('0x36')](_0x2c34b1);};}function getMustacheRender(_0xc34409,_0x3b5104){return Mustache[_0xa757('0x37')](_0xc34409,_[_0xa757('0x38')](_0x3b5104[_0xa757('0x39')],{'contact':_0x3b5104[_0xa757('0x3a')],'message':_0x3b5104['message'],'agent':_0x3b5104[_0xa757('0x3b')],'interaction':_0x3b5104[_0xa757('0x3c')],'account':_0x3b5104[_0xa757('0x3d')]}))||'';}function getInteractionUsers(_0x35c15a,_0x2531be){return new BPromise(function(_0x2fd99e,_0x501e26){try{if(_0x2531be[_0x35c15a['id']]){_0x35c15a[_0xa757('0x3e')]=_[_0xa757('0x3f')](_0x2531be[_0x35c15a['id']],function(_0x48cde9){return{'id':_0x48cde9['id'],'fullname':_0x48cde9['fullname']};});}}catch(_0x9607af){_0x501e26(_0x9607af);}_0x2fd99e(_0x35c15a);});}function getInteractionTags(_0x6193bf,_0x5b11fe){return new BPromise(function(_0x51c3d1,_0xcff7c4){try{if(_0x6193bf[_0xa757('0x40')]){_0x6193bf[_0xa757('0x41')]=[];_0x6193bf['TagIds'][_0xa757('0x42')](',')[_0xa757('0x43')](function(_0x26802c){_0x6193bf[_0xa757('0x41')][_0xa757('0x44')](_0x5b11fe[_0x26802c]);});}delete _0x6193bf['TagIds'];}catch(_0x1f9af){_0xcff7c4(_0x1f9af);}_0x51c3d1(_0x6193bf);});}function updateChatInteraction(_0x52c728,_0x564d40,_0x43329c){return new BPromise(function(_0x57298b,_0x373747){return getInteractionUsers(_0x52c728,_0x43329c)[_0xa757('0x32')](function(_0x9a0934){return getInteractionTags(_0x9a0934,_0x564d40);})['then'](function(_0x5d25bb){_0x57298b(_0x5d25bb);})[_0xa757('0x45')](function(_0x129d77){_0x373747(_0x129d77);});});}exports[_0xa757('0x46')]=function(_0xe03a3c,_0xc063db){var _0x3db5d5={},_0x4f12b1={},_0xd61628={'count':0x0,'rows':[]};var _0x364998=_['map'](db[_0xa757('0x47')]['rawAttributes'],function(_0x2d111e){return{'name':_0x2d111e[_0xa757('0x48')],'type':_0x2d111e['type'][_0xa757('0x49')]};});_0x4f12b1[_0xa757('0x4a')]=_['map'](_0x364998,_0xa757('0x35'));_0x4f12b1[_0xa757('0x4b')]=_[_0xa757('0x4c')](_0xe03a3c[_0xa757('0x4b')]);_0x4f12b1['filters']=_[_0xa757('0x4d')](_0x4f12b1[_0xa757('0x4a')],_0x4f12b1[_0xa757('0x4b')]);_0x3db5d5[_0xa757('0x4e')]=_['intersection'](_0x4f12b1[_0xa757('0x4a')],qs['fields'](_0xe03a3c['query'][_0xa757('0x4f')]));_0x3db5d5[_0xa757('0x4e')]=_0x3db5d5[_0xa757('0x4e')]['length']?_0x3db5d5[_0xa757('0x4e')]:_0x4f12b1['model'];if(!_0xe03a3c[_0xa757('0x4b')][_0xa757('0x50')](_0xa757('0x51'))){_0x3db5d5[_0xa757('0x2a')]=qs[_0xa757('0x2a')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x2a')]);_0x3db5d5[_0xa757('0x29')]=qs['offset'](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x29')]);}_0x3db5d5[_0xa757('0x52')]=qs[_0xa757('0x53')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x53')]);_0x3db5d5[_0xa757('0x54')]=qs[_0xa757('0x55')](_[_0xa757('0x56')](_0xe03a3c[_0xa757('0x4b')],_0x4f12b1[_0xa757('0x55')]),_0x364998);var _0x19ceef=[];var _0x2367c7=squel[_0xa757('0x57')]()[_0xa757('0x58')]('id')[_0xa757('0x58')]('name')[_0xa757('0x58')]('color')[_0xa757('0x59')](_0xa757('0x5a'));var _0xa89d24=squel[_0xa757('0x57')]()['field'](_0xa757('0x5b'))[_0xa757('0x58')](_0xa757('0x5c'))[_0xa757('0x58')]('ui.ChatInteractionId')[_0xa757('0x59')](_0xa757('0x5d'),'ui')[_0xa757('0x5e')](_0xa757('0x5f'),'u',_0xa757('0x60'));var _0x291b26=squel['select']()['from']('chat_interactions','i')['left_join'](_0xa757('0x61'),'c',_0xa757('0x62'))[_0xa757('0x5e')](_0xa757('0x5f'),'o',_0xa757('0x63'))[_0xa757('0x5e')]('chat_websites','a',_0xa757('0x64'))[_0xa757('0x5e')](_0xa757('0x65'),'me',_0xa757('0x66'))['left_join'](_0xa757('0x67'),'it',_0xa757('0x68'))['left_join'](_0xa757('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x211980=squel['expr']();var _0x51be6e=[];var _0x58633a=squel['expr']();var _0x367b48;if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x69')]){_0x367b48=as[_0xa757('0x6a')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x69')]);var _0x4c19a6=_0x367b48['sqlOperator'];for(var _0x201557=0x0;_0x201557<_0x367b48[_0xa757('0x6b')][_0xa757('0x6c')];_0x201557++){var _0x4a5ad5=_0x367b48['conditions'][_0x201557];var _0x18dff7='i';var _0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),_0x4a5ad5[_0xa757('0x58')]]);if(!_0x31c4cd){switch(_0x4a5ad5[_0xa757('0x58')]){case'unreadMessages':if(_0x4a5ad5[_0xa757('0x6e')]==0x1){_0x291b26[_0xa757('0x6f')]('`'+_0x4a5ad5[_0xa757('0x58')]+_0xa757('0x70'));}else{_0x291b26[_0xa757('0x6f')]('`'+_0x4a5ad5[_0xa757('0x58')]+_0xa757('0x71'));}break;case _0xa757('0x72'):if(_0x4a5ad5[_0xa757('0x73')]===_0xa757('0x74')){if(_0x4a5ad5['value'][_0xa757('0x42')]('\x20')['length']>0x1){_0x211980[_0x4c19a6]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa757('0x75')](_0x4a5ad5[_0xa757('0x6e')]),null);}else{var _0x432856='%'+_0x4a5ad5[_0xa757('0x6e')]+'%';_0x211980[_0x4c19a6](_0xa757('0x76'),_0x432856,_0x432856,_0x432856);}}else{_0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),_0xa757('0x77')]);_0x4a5ad5[_0xa757('0x58')]=_0xa757('0x77');_0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd['type'],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')]['start'],_0x423f3a[_0xa757('0x6e')][_0xa757('0x33')]);}break;case _0xa757('0x7a'):var _0x180cec=_0x4a5ad5[_0xa757('0x6e')][_0xa757('0x42')](',')['map'](function(_0x413217){return Number(_0x413217);});_0x180cec['forEach'](function(_0xee5b78){_0x58633a['or'](_0xa757('0x7b'),'%,'+_0xee5b78+',%');});_0x51be6e=_[_0xa757('0x7c')](_0x51be6e,_0x180cec);break;case _0xa757('0x7d'):if(_0x4a5ad5[_0xa757('0x73')]==='$substring'){_0x211980[_0x4c19a6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4a5ad5[_0xa757('0x6e')]+'%',null);}else{_0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),'UserId']);_0x4a5ad5[_0xa757('0x58')]='UserId';_0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd[_0xa757('0x7e')],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x7f')],_0x423f3a[_0xa757('0x6e')]['end']);}break;case _0xa757('0x39'):_0x423f3a=as[_0xa757('0x78')]('me',null,_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x7f')],_0x423f3a['value'][_0xa757('0x33')]);break;}}else{var _0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd[_0xa757('0x7e')],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a['value'][_0xa757('0x7f')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x33')]);}}}else{var _0x529298=_(_0xe03a3c[_0xa757('0x4b')])[_0xa757('0x4c')]()[_0xa757('0x3f')](function(_0x60f518){return _[_0xa757('0x80')](_0x364998,[_0xa757('0x35'),_0x60f518])?_0x60f518:undefined;})[_0xa757('0x81')]()[_0xa757('0x6e')]();if(!_[_0xa757('0x82')](_0x529298)){_0x529298[_0xa757('0x43')](function(_0x1a868d){if(_0x1a868d===_0xa757('0x83')){_0x291b26[_0xa757('0x54')](_0xa757('0x84'),[]['concat'](_0xe03a3c[_0xa757('0x4b')][_0x1a868d]));}else if(_0x1a868d===_0xa757('0x85')){var _0x532ab5=JSON[_0xa757('0x86')](_0xe03a3c[_0xa757('0x4b')][_0x1a868d])['$gte'];var _0x29aea2=JSON[_0xa757('0x86')](_0xe03a3c[_0xa757('0x4b')][_0x1a868d])[_0xa757('0x87')];_0x291b26[_0xa757('0x54')](_0xa757('0x88'),_0x532ab5,_0x29aea2);}else{if(_0xe03a3c[_0xa757('0x4b')][_0x1a868d]===_0xa757('0x89')){_0x291b26[_0xa757('0x54')]('i.'+_0x1a868d+_0xa757('0x8a'));}else{_0x291b26[_0xa757('0x54')]('i.'+_0x1a868d+_0xa757('0x8b'),_0xe03a3c[_0xa757('0x4b')][_0x1a868d]);}}});}if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8c')]){if(_0xe03a3c[_0xa757('0x4b')]['read']==0x1){_0x291b26[_0xa757('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x291b26[_0xa757('0x6f')](_0xa757('0x8d'));}}if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8e')]){_0x51be6e=_[_0xa757('0x8f')](_0xe03a3c['query'][_0xa757('0x8e')])?_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8e')]:new Array(_0xe03a3c['query'][_0xa757('0x8e')]);_0x51be6e[_0xa757('0x43')](function(_0x2c05d5){_0x58633a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c05d5+',%');});}if(_0xe03a3c['query'][_0xa757('0x90')]){var _0x351e0e=_0xe03a3c[_0xa757('0x4b')]['filter'][_0xa757('0x91')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x351e0e)){_0x211980['or'](_0xa757('0x92'),_0x351e0e+'%');}else{_0x211980['or'](_0xa757('0x93'),qs[_0xa757('0x75')](_0x351e0e))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x351e0e+'%');}}}_0x291b26[_0xa757('0x54')](_0x211980);_0x291b26[_0xa757('0x94')](_0xa757('0x95'));var _0x199f75={'type':db[_0xa757('0x96')][_0xa757('0x97')][_0xa757('0x98')],'raw':!![]};var _0x44c681=_0x291b26[_0xa757('0x99')]();_0x44c681[_0xa757('0x58')](_0xa757('0x95'));_0x44c681[_0xa757('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa757('0x9a'));if(_0x3db5d5[_0xa757('0x52')]){_0x3db5d5[_0xa757('0x52')][_0xa757('0x43')](function(_0x1a46d6){var _0x7440f6=_0x1a46d6[0x0]===_0xa757('0x9b')?_0x1a46d6[0x0]:'i.'+_0x1a46d6[0x0];_0x291b26[_0xa757('0x52')](_0x7440f6,_0x1a46d6[0x1]===_0xa757('0x9c')?![]:!![]);});}if(!_[_0xa757('0x82')](_0x51be6e)){_0x291b26[_0xa757('0x6f')](_0x58633a);_0x44c681[_0xa757('0x54')](_0xa757('0x9d'),_0x51be6e);}BPromise[_0xa757('0x9e')]()[_0xa757('0x32')](function(){if(!_0x367b48){if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x83')])return;_0x44c681[_0xa757('0x54')](_0xa757('0x9f'));_0x291b26[_0xa757('0x54')](_0xa757('0x9f'));return;}if(_0xe03a3c[_0xa757('0xa0')]['role']!==_0xa757('0x3b'))return;return _0xe03a3c[_0xa757('0xa0')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xa757('0x32')](function(_0x4c4b1a){if(_[_0xa757('0x82')](_0x4c4b1a)){_0x44c681[_0xa757('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');_0x291b26[_0xa757('0x54')](_0xa757('0xa1'));}else{_0x44c681[_0xa757('0x54')](_0xa757('0x84'),_['map'](_0x4c4b1a,'id'));_0x291b26[_0xa757('0x54')](_0xa757('0x84'),_['map'](_0x4c4b1a,'id'));}});})[_0xa757('0x32')](function(){if(_0xe03a3c[_0xa757('0xa0')]['role']===_0xa757('0x3b')&&!_0x367b48&&!_0xe03a3c[_0xa757('0x4b')][_0xa757('0x83')])return[];return db[_0xa757('0xa2')][_0xa757('0x4b')](_0x44c681[_0xa757('0xa3')](),_0x199f75);})[_0xa757('0x32')](function(_0x2d6405){_0xd61628[_0xa757('0x28')]=_0x2d6405['length'];if(_0xd61628['count']===0x0)return[];return db[_0xa757('0xa2')][_0xa757('0x4b')](_0x2367c7[_0xa757('0xa3')](),_0x199f75)[_0xa757('0x32')](function(_0x38d0f8){_0x19ceef=_[_0xa757('0xa4')](_0x38d0f8,'id');_0x199f75=_[_0xa757('0x38')](_0x199f75,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe03a3c[_0xa757('0x4b')]['fields']){_0x3db5d5[_0xa757('0x4e')][_0xa757('0x43')](function(_0x365a0d){_0x291b26[_0xa757('0x58')]('i.'+_0x365a0d);});}else{_0x291b26[_0xa757('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa757('0x9a'));_0x291b26['field'](_0xa757('0xa5'),_0xa757('0xa6'));_0x291b26[_0xa757('0x58')](_0xa757('0xa7'),'Account.mandatoryDisposition');_0x291b26[_0xa757('0x58')](_0xa757('0xa8'),_0xa757('0x9b'));_0x291b26[_0xa757('0x58')](_0xa757('0xa9'));_0x291b26[_0xa757('0x58')](_0xa757('0xaa'),_0xa757('0xab'));_0x291b26['field'](_0xa757('0xac'),_0xa757('0xad'));_0x291b26[_0xa757('0x58')](_0xa757('0xae'),'Contact.email');_0x291b26[_0xa757('0x58')](_0xa757('0xaf'),_0xa757('0xb0'));_0x291b26[_0xa757('0x58')](_0xa757('0xb1'),_0xa757('0xb2'));_0x291b26[_0xa757('0x58')]('c.fax','Contact.fax');_0x291b26[_0xa757('0x58')]('o.fullname',_0xa757('0xb3'));_0x291b26['field']('o.internal',_0xa757('0xb4'));_0x291b26[_0xa757('0x58')](_0xa757('0xb5'),_0xa757('0x40'));}if(_0x3db5d5[_0xa757('0x2a')])_0x291b26[_0xa757('0x2a')](_0x3db5d5[_0xa757('0x2a')]);if(_0x3db5d5[_0xa757('0x29')])_0x291b26[_0xa757('0x29')](_0x3db5d5[_0xa757('0x29')]);return db['sequelize'][_0xa757('0x4b')](_0x291b26['toString'](),_0x199f75);})[_0xa757('0x32')](function(_0x4e7280){if(_0x4e7280[_0xa757('0x6c')]>0x0)_0xa89d24[_0xa757('0x54')]('ui.ChatInteractionId\x20IN\x20?',_[_0xa757('0x3f')](_0x4e7280,'id'));return db[_0xa757('0xa2')][_0xa757('0x4b')](_0xa89d24[_0xa757('0xa3')](),_0x199f75)[_0xa757('0x32')](function(_0x162ff6){var _0x1c789c=_[_0xa757('0xb6')](_0x162ff6,_0xa757('0xb7'));var _0x358268=[];_0x4e7280[_0xa757('0x43')](function(_0x204489){_0x358268[_0xa757('0x44')](updateChatInteraction(_0x204489,_0x19ceef,_0x1c789c));});return BPromise[_0xa757('0xb8')](_0x358268);});});})[_0xa757('0x32')](function(_0x56a060){_0xd61628['rows']=_0x56a060;return _0xd61628;})[_0xa757('0x32')](respondWithFilteredResult(_0xc063db,_0x3db5d5))['catch'](handleError(_0xc063db,null));};exports[_0xa757('0xb9')]=function(_0x3404f1,_0x2edad2){var _0x1d03a7={'raw':![],'where':{'id':_0x3404f1[_0xa757('0xba')]['id']}},_0x48c52f={};_0x48c52f[_0xa757('0x4a')]=_[_0xa757('0x4c')](db[_0xa757('0x47')][_0xa757('0xbb')]);_0x48c52f[_0xa757('0x4b')]=_['keys'](_0x3404f1[_0xa757('0x4b')]);_0x48c52f[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x48c52f[_0xa757('0x4a')],_0x48c52f[_0xa757('0x4b')]);_0x1d03a7['attributes']=_['intersection'](_0x48c52f[_0xa757('0x4a')],qs['fields'](_0x3404f1[_0xa757('0x4b')]['fields']));_0x1d03a7[_0xa757('0x4e')]=_0x1d03a7[_0xa757('0x4e')][_0xa757('0x6c')]?_0x1d03a7[_0xa757('0x4e')]:_0x48c52f[_0xa757('0x4a')];if(_0x3404f1[_0xa757('0x4b')][_0xa757('0xbc')]){_0x1d03a7[_0xa757('0xbd')]=[{'all':!![]}];}_0x1d03a7=_[_0xa757('0x38')]({},_0x1d03a7,_0x3404f1[_0xa757('0xbe')]);return db[_0xa757('0x47')]['find'](_0x1d03a7)[_0xa757('0x32')](handleEntityNotFound(_0x2edad2,null))[_0xa757('0x32')](respondWithResult(_0x2edad2,null))[_0xa757('0x45')](handleError(_0x2edad2,null));};exports[_0xa757('0xbf')]=function(_0x1f308f,_0x1ea6d7){return db['ChatInteraction'][_0xa757('0xbf')](_0x1f308f[_0xa757('0x39')],{})['then'](respondWithResult(_0x1ea6d7,0xc9))[_0xa757('0x45')](handleError(_0x1ea6d7,null));};exports[_0xa757('0x31')]=function(_0x1f4782,_0x5e6171){if(_0x1f4782[_0xa757('0x39')]['id']){delete _0x1f4782[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x1f4782[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x5e6171,null))[_0xa757('0x32')](saveUpdates(_0x1f4782['body'],null))['then'](respondWithResult(_0x5e6171,null))[_0xa757('0x45')](handleError(_0x5e6171,null));};exports['destroy']=function(_0x5d9102,_0x44023e){return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x5d9102[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x44023e,null))[_0xa757('0x32')](removeEntity(_0x44023e,null))['catch'](handleError(_0x44023e,null));};exports['describe']=function(_0x556b78,_0x4b4a87){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x4b4a87,null))[_0xa757('0x45')](handleError(_0x4b4a87,null));};exports['createVidaooSession']=function(_0x1ba0df,_0xccb91e){var _0x146305=_0x1ba0df[_0xa757('0xba')]['id'];var _0x46fd6b;var _0xc0a523;var _0x399952;return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0x146305}})['then'](function(_0x4dd40a){_0x46fd6b=_0x4dd40a;return db[_0xa757('0xc1')][_0xa757('0xc0')]({'where':{'id':_0x4dd40a[_0xa757('0x83')]},'attributes':['id',_0xa757('0xc2'),'vidaooEscalation',_0xa757('0xc3'),_0xa757('0xc4'),_0xa757('0xc5')],'raw':!![]});})[_0xa757('0x32')](function(_0x30c170){if(_0x30c170&&_0x30c170[_0xa757('0xc2')]&&_0x30c170[_0xa757('0xc6')]){_0xc0a523=_0x30c170;var _0x4e552d={'interaction':{'id':_0x146305},'agent':{'id':_0x1ba0df[_0xa757('0xa0')]['id'],'name':_0x1ba0df[_0xa757('0xa0')]['name'],'fullname':_0x1ba0df[_0xa757('0xa0')][_0xa757('0xc7')],'email':_0x1ba0df[_0xa757('0xa0')][_0xa757('0xc8')]},'contact':_0x1ba0df[_0xa757('0x39')]['contact'],'account':_0x1ba0df[_0xa757('0x39')][_0xa757('0x3d')]};var _0x3d031d={'rejectUnauthorized':![],'method':'POST','url':_0xa757('0xc9'),'headers':{'X-APIKEY':_0x30c170[_0xa757('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ba0df[_0xa757('0xa0')]['email']],'buttons':null,'topic':_0xc0a523[_0xa757('0xc3')],'note':_[_0xa757('0xca')](_0xc0a523[_0xa757('0xc4')])?null:getMustacheRender(_0xc0a523[_0xa757('0xc4')],_0x4e552d),'metadata':null},'redirect':_0xa757('0xcb'),'json':!![]};try{if(!_['isNull'](_0xc0a523[_0xa757('0xc5')])){var _0x4b440e=getMustacheRender(_0xc0a523['vidaooMetadata'],_0x4e552d);var _0x6e9075=JSON[_0xa757('0x86')](_0x4b440e);_0x3d031d[_0xa757('0x39')][_0xa757('0xcc')]=_0x6e9075;}}catch(_0x4d3423){throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xce'));}return rp(_0x3d031d);}else{throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xcf'));}})[_0xa757('0x32')](function(_0xad41e1){_0x399952=_0xad41e1;if(_0x399952['id']){var _0x564db3={'body':_0x399952[_0xa757('0xd0')],'ChatWebsiteId':_0xc0a523['id'],'ChatInteractionId':_0x46fd6b['id'],'direction':_0xa757('0xd1'),'UserId':_0x1ba0df[_0xa757('0xa0')]['id']};return db[_0xa757('0xd2')][_0xa757('0xbf')](_0x564db3,{});}else{throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xd3'));}})[_0xa757('0x32')](function(){return _0x46fd6b['updateAttributes']({'vidaooSessionId':_0x399952['id']});})['then'](respondWithResult(_0xccb91e,null))[_0xa757('0x45')](handleError(_0xccb91e,null));};exports[_0xa757('0xd4')]=function(_0x542faf,_0x3e7174){if(_0x542faf['body']['id']){delete _0x542faf[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x542faf[_0xa757('0xba')]['id']},'include':[{'model':db[_0xa757('0xd5')],'as':_0xa757('0x72')}]})[_0xa757('0x32')](handleEntityNotFound(_0x3e7174,null))[_0xa757('0x32')](saveUpdates(_0x542faf[_0xa757('0x39')],null))['then'](respondWithResult(_0x3e7174,null))[_0xa757('0x45')](handleError(_0x3e7174,null));};exports[_0xa757('0xd6')]=function(_0x4a7a69,_0xea878b,_0x434c4b){if(_0x4a7a69[_0xa757('0x39')]['id']){delete _0x4a7a69[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x4a7a69[_0xa757('0xba')]['id']}})[_0xa757('0x32')](function(_0x2ea80d){if(!_0x2ea80d){logger[_0xa757('0x22')](_0xa757('0xd7'),_0xa757('0xd6'),0x194,'entity\x20not\x20found');_0xea878b[_0xa757('0x25')](0x194);}else{if(_0x2ea80d[_0xa757('0xd8')]){throw new db['Sequelize'][(_0xa757('0xcd'))](_0xa757('0xd9'));}}return _0x2ea80d;})['then'](function(_0x124eff){if(_0x124eff){return _0x124eff[_0xa757('0x31')]({'closed':_0x4a7a69[_0xa757('0x39')][_0xa757('0xda')],'disposition':_0x4a7a69['body']['disposition']})[_0xa757('0x32')](function(_0x48a9d0){return _0x48a9d0;});}})[_0xa757('0x32')](function(_0x551930){return respondWithRpcPromise(_0xa757('0xdb'),_0xa757('0xd6'),_0x4a7a69[_0xa757('0x39')],client9004);})[_0xa757('0x32')](respondWithResult(_0xea878b,null))[_0xa757('0x45')](handleError(_0xea878b,null));};exports['attachmentUpload']=function(_0x54385d,_0xa77319,_0x7c238d){_0x54385d[_0xa757('0x39')][_0xa757('0x35')]=_0x54385d['file']['originalname'];_0x54385d[_0xa757('0x39')]['basename']=_0x54385d[_0xa757('0xdc')][_0xa757('0xdd')];_0x54385d[_0xa757('0x39')][_0xa757('0x7e')]=_0x54385d[_0xa757('0xdc')][_0xa757('0xde')];return db[_0xa757('0xdf')]['create'](_0x54385d[_0xa757('0x39')])[_0xa757('0x32')](respondWithResult(_0xa77319,0xc9))[_0xa757('0x45')](handleError(_0xa77319,null));};exports[_0xa757('0xe0')]=function(_0x177db5,_0x1f678e,_0x377663){return db['ChatInteraction']['findOne']({'where':{'id':_0x177db5[_0xa757('0xba')]['id']},'raw':!![]})[_0xa757('0x32')](handleEntityNotFound(_0x1f678e,null))[_0xa757('0x32')](function(_0x54da87){if(_0x54da87){if(_0x54da87[_0xa757('0xda')]){return _0x1f678e[_0xa757('0x26')](0x193)['json']({'status':0x193,'message':_0xa757('0xe1')});}return db['Attachment'][_0xa757('0xc0')]({'where':{'id':_0x177db5[_0xa757('0x4b')][_0xa757('0xe2')]},'raw':!![]})[_0xa757('0x32')](handleEntityNotFound(_0x1f678e,null));}})[_0xa757('0x32')](function(_0x1b4e62){if(_0x1b4e62){var _0x42e409=_0x1b4e62[_0xa757('0xe3')]!==null;var _0x19f834=path[_0xa757('0xe4')](config['root'],'server/files/attachments/');if(_0x42e409){_0x19f834=path[_0xa757('0xe4')](_0x19f834,'offline-chat/');}var _0x4bd0a6=path[_0xa757('0xe4')](_0x19f834,_0x1b4e62[_0xa757('0xe5')]);return _0x1f678e['download'](_0x4bd0a6);}})[_0xa757('0x45')](handleError(_0x1f678e,null));};exports['close']=function(_0x334f77,_0x45dc56){var _0x2fe93c=null;var _0x101410=null;var _0x2cc39e=null;var _0x1aa70d=null;if(_0x334f77[_0xa757('0x39')]['id']){delete _0x334f77[_0xa757('0x39')]['id'];}if(_0x334f77['body']['mailTranscript']){_0x1aa70d=path[_0xa757('0xe4')](config['root'],_0xa757('0xe6'),util[_0xa757('0xe7')](_0xa757('0xe8'),Date[_0xa757('0xe9')]()));_0x334f77[_0xa757('0x39')][_0xa757('0xea')]=_0x1aa70d;}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x334f77['params']['id']},'include':[{'model':db[_0xa757('0xd2')],'as':'Messages','include':[{'model':db['User'],'as':_0xa757('0x7d')}]}]})[_0xa757('0x32')](handleEntityNotFound(_0x45dc56,null))[_0xa757('0x32')](saveUpdates(_0x334f77[_0xa757('0x39')],null))['then'](function(_0xce5af4){if(_0xce5af4){_0x2fe93c=_0xce5af4;return db['ChatWebsite'][_0xa757('0x6d')]({'where':{'id':_0x2fe93c['ChatWebsiteId']}});}})[_0xa757('0x32')](function(_0x3e9009){if(_0x3e9009){_0x2cc39e=_0x3e9009;return db['CmContact'][_0xa757('0x6d')]({'where':{'id':_0x2fe93c[_0xa757('0x77')]}});}})['then'](function(_0x2a5b41){if(_0x2a5b41){_0x101410=_0x2a5b41;if(_0x1aa70d){var _0x1ec56a=null;for(var _0xa09d83=0x1;_0xa09d83<_0x2fe93c[_0xa757('0xeb')][_0xa757('0x6c')];++_0xa09d83){_0x1ec56a=_0x2fe93c[_0xa757('0xeb')][_0xa09d83];var _0x2439f9=_0x1ec56a['UserId']?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e['agentAlias'],_0x1ec56a['UserId']):_0xa757('0xed');var _0x30f2da=_0x334f77[_0xa757('0x39')][_0xa757('0xee')]||util[_0xa757('0xe7')](_0xa757('0xec'),_0xa757('0xef'),_0x1ec56a[_0xa757('0x77')]);switch(_0x2cc39e[_0xa757('0xf0')]){case _0xa757('0xf1'):_0x2439f9=_0x1ec56a[_0xa757('0xd8')]?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e['agentAlias'],_0x1ec56a[_0xa757('0xd8')]):_0xa757('0xed');break;case _0xa757('0xf2'):_0x2439f9=_0x1ec56a['UserId']?_0x1ec56a['User'][_0xa757('0xf3')]||_0x1ec56a[_0xa757('0x7d')]['fullname']:_0xa757('0xed');break;case _0xa757('0xf4'):_0x2439f9=_0x1ec56a['UserId']?_0x1ec56a[_0xa757('0x7d')]['fullname']:_0xa757('0xed');break;default:_0x2439f9=_0x1ec56a[_0xa757('0xd8')]?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e[_0xa757('0xf5')],_0x1ec56a[_0xa757('0xd8')]):_0xa757('0xed');}var _0x69af1f=util['format'](_0xa757('0xf6'),moment(_0x1ec56a['createdAt'])['format'](_0xa757('0xf7')),_0x1ec56a[_0xa757('0xf8')]==='in'?_0x30f2da:_0x2439f9,_0x1ec56a['body']);if(!_0x1ec56a['secret']){fs['appendFileSync'](_0x1aa70d,_0x69af1f);}}return db[_0xa757('0xf9')][_0xa757('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xa757('0xfa')],'as':'Smtp','raw':!![]}]});}}})[_0xa757('0x32')](function(_0x2e76e5){if(_0x2e76e5&&_0x2e76e5[_0xa757('0xfb')]&&_0x334f77[_0xa757('0x39')]){var _0x1caccc={'tls':{'rejectUnauthorized':![]}};if(_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfc')]){_0x1caccc[_0xa757('0xfc')]=_0x2e76e5['Smtp'][_0xa757('0xfc')];}else{_0x1caccc['host']=_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfd')];_0x1caccc[_0xa757('0xfe')]=_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfe')];_0x1caccc['secure']=_0x2e76e5[_0xa757('0xfb')]['secure'];}if(_0x2e76e5[_0xa757('0xfb')][_0xa757('0xff')]){_0x1caccc[_0xa757('0x100')]={'user':_0x2e76e5[_0xa757('0xfb')][_0xa757('0xa0')],'pass':_0x2e76e5[_0xa757('0xfb')][_0xa757('0x101')]};}return respondWithRpcPromise(_0xa757('0x102'),_0xa757('0x103'),{'account':_0x1caccc,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2e76e5[_0xa757('0x35')],_0x2e76e5[_0xa757('0xc8')]||_0x2e76e5['Smtp'][_0xa757('0xa0')]),'to':_0x334f77[_0xa757('0x39')]['mailTranscript'],'subject':_0xa757('0x104'),'text':util['format'](_0xa757('0x105'),_0x334f77[_0xa757('0x39')][_0xa757('0x106')]),'attachments':[{'path':_0x1aa70d}]}})[_0xa757('0x32')](function(){return _0x2fe93c;})[_0xa757('0x45')](function(_0xa285fa){console[_0xa757('0x22')](_0xa285fa);});}else{return _0x2fe93c;}})[_0xa757('0x32')](respondWithStatusCode(_0x45dc56,0xc8))[_0xa757('0x45')](handleError(_0x45dc56,null));};exports[_0xa757('0x107')]=function(_0x379660,_0x36643f,_0xe704f0){return db['ChatMessage']['find']({'where':{'id':_0x379660[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x36643f,null))[_0xa757('0x32')](function(_0x4f1a01){if(_0x4f1a01){return _0x4f1a01[_0xa757('0x107')](_0x379660[_0xa757('0x39')][_0xa757('0x108')],_[_0xa757('0x109')](_0x379660[_0xa757('0x39')],['ids','id'])||{});}})['then'](respondWithResult(_0x36643f,null))[_0xa757('0x45')](handleError(_0x36643f,null));};exports[_0xa757('0x10a')]=function(_0xada3bd,_0x566095,_0x25c4da){var _0x35b41e={'raw':![],'where':{}};var _0x4b60b9={};var _0x2d7d24={'count':0x0,'rows':[]};return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0xada3bd['params']['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x566095,null))[_0xa757('0x32')](function(_0x1b702f){if(_0x1b702f){_0x4b60b9[_0xa757('0x4a')]=_[_0xa757('0x4c')](db[_0xa757('0xd2')][_0xa757('0xbb')]);_0x4b60b9['query']=_[_0xa757('0x4c')](_0xada3bd['query']);_0x4b60b9[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x4b60b9[_0xa757('0x4a')],_0x4b60b9[_0xa757('0x4b')]);_0x35b41e['attributes']=_['intersection'](_0x4b60b9[_0xa757('0x4a')],qs[_0xa757('0x4f')](_0xada3bd[_0xa757('0x4b')][_0xa757('0x4f')]));_0x35b41e[_0xa757('0x4e')]=_0x35b41e['attributes']['length']?_0x35b41e[_0xa757('0x4e')]:_0x4b60b9[_0xa757('0x4a')];if(!_0xada3bd[_0xa757('0x4b')][_0xa757('0x50')](_0xa757('0x51'))){_0x35b41e[_0xa757('0x2a')]=qs['limit'](_0xada3bd[_0xa757('0x4b')][_0xa757('0x2a')]);_0x35b41e[_0xa757('0x29')]=qs['offset'](_0xada3bd[_0xa757('0x4b')][_0xa757('0x29')]);}_0x35b41e[_0xa757('0x52')]=qs[_0xa757('0x53')](_0xada3bd[_0xa757('0x4b')][_0xa757('0x53')]);_0x35b41e[_0xa757('0x54')]=qs['filters'](_[_0xa757('0x56')](_0xada3bd[_0xa757('0x4b')],_0x4b60b9[_0xa757('0x55')]));_0x35b41e[_0xa757('0x54')][_0xa757('0xb7')]=_0x1b702f['id'];if(_0xada3bd[_0xa757('0x4b')][_0xa757('0x90')]){_0x35b41e['where']=_[_0xa757('0x38')](_0x35b41e['where'],{'$or':_[_0xa757('0x3f')](_0x35b41e['attributes'],function(_0x4438ec){var _0x1491c7={};_0x1491c7[_0x4438ec]={'$like':'%'+_0xada3bd[_0xa757('0x4b')]['filter']+'%'};return _0x1491c7;})});}if(_0xada3bd['query']['$gte']){var _0xa89e07=_0xada3bd[_0xa757('0x4b')][_0xa757('0x10b')][_0xa757('0x42')](',');var _0x560b05={};_0x560b05[_0xa89e07[0x0]]={'$gte':moment(_0xa89e07[0x1])[_0xa757('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x35b41e[_0xa757('0x54')]=_[_0xa757('0x38')](_0x35b41e[_0xa757('0x54')],_0x560b05);}_0x35b41e=_['merge']({},_0x35b41e,_0xada3bd[_0xa757('0xbe')]);return db['ChatMessage'][_0xa757('0x28')]({'where':_0x35b41e[_0xa757('0x54')]})['then'](function(_0x31c25e){_0x2d7d24[_0xa757('0x28')]=_0x31c25e;if(_0xada3bd[_0xa757('0x4b')]['includeAll']){_0x35b41e['include']=[{'all':!![]}];}return db['ChatMessage'][_0xa757('0x10c')](_0x35b41e);})[_0xa757('0x32')](function(_0x4867c8){_0x2d7d24['rows']=_0x4867c8;return _0x2d7d24;});}})[_0xa757('0x32')](respondWithFilteredResult(_0x566095,_0x35b41e))[_0xa757('0x45')](handleError(_0x566095,null));};exports[_0xa757('0x10d')]=function(_0x4da912,_0x4b0e40,_0x4fe6f5){var _0x3cf8d3={'where':{}},_0x1a1605={},_0x4074a3={'count':0x0,'rows':[]};return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0x4da912[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x4b0e40,null))[_0xa757('0x32')](function(_0x4b3270){if(_0x4b3270){_0x1a1605[_0xa757('0x4a')]=_[_0xa757('0x4c')](db['ChatMessage'][_0xa757('0xbb')]);_0x1a1605[_0xa757('0x4b')]=_[_0xa757('0x4c')](_0x4da912[_0xa757('0x4b')]);_0x1a1605[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x1a1605[_0xa757('0x4a')],_0x1a1605[_0xa757('0x4b')]);_0x3cf8d3[_0xa757('0x4e')]=_[_0xa757('0x4d')](_0x1a1605[_0xa757('0x4a')],qs[_0xa757('0x4f')](_0x4da912['query']['fields']));_0x3cf8d3[_0xa757('0x4e')]=_0x3cf8d3[_0xa757('0x4e')][_0xa757('0x6c')]?_0x3cf8d3[_0xa757('0x4e')]:_0x1a1605[_0xa757('0x4a')];if(!_0x4da912[_0xa757('0x4b')][_0xa757('0x50')]('nolimit')){_0x3cf8d3[_0xa757('0x2a')]=qs[_0xa757('0x2a')](_0x4da912[_0xa757('0x4b')][_0xa757('0x2a')]);_0x3cf8d3[_0xa757('0x29')]=qs[_0xa757('0x29')](_0x4da912[_0xa757('0x4b')]['offset']);}_0x3cf8d3[_0xa757('0x52')]=qs[_0xa757('0x53')](_0x4da912['query']['sort']);_0x3cf8d3['where']=qs[_0xa757('0x55')](_['pick'](_0x4da912['query'],_0x1a1605[_0xa757('0x55')]));_0x3cf8d3[_0xa757('0x54')][_0xa757('0xb7')]=_0x4b3270['id'];if(_0x4da912[_0xa757('0x4b')]['filter']){_0x3cf8d3[_0xa757('0x54')]=_[_0xa757('0x38')](_0x3cf8d3['where'],{'$or':_[_0xa757('0x3f')](_0x3cf8d3[_0xa757('0x4e')],function(_0x2782e3){var _0x2f8045={};_0x2f8045[_0x2782e3]={'$like':'%'+_0x4da912['query'][_0xa757('0x90')]+'%'};return _0x2f8045;})});}_0x3cf8d3[_0xa757('0x54')][_0xa757('0x10e')]=![];if(_0x4da912[_0xa757('0x4b')]['id']){_0x3cf8d3[_0xa757('0x54')]['id']={'$gt':_0x4da912[_0xa757('0x4b')]['id']};}_0x3cf8d3=_[_0xa757('0x38')]({},_0x3cf8d3,_0x4da912[_0xa757('0xbe')]);return db[_0xa757('0xd2')]['count']({'where':_0x3cf8d3[_0xa757('0x54')]})[_0xa757('0x32')](function(_0x409ae1){_0x4074a3[_0xa757('0x28')]=_0x409ae1;_0x3cf8d3[_0xa757('0xbd')]=[];if(_0x4da912[_0xa757('0x4b')][_0xa757('0x10f')]){_0x3cf8d3['include'][_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x7d'),'attributes':['id',_0xa757('0xc7'),_0xa757('0xf3')]});}if(_0x4da912[_0xa757('0x4b')][_0xa757('0xbc')]){_0x3cf8d3[_0xa757('0xbd')]=[{'all':!![]}];}return db[_0xa757('0xd2')]['findAll'](_0x3cf8d3);})[_0xa757('0x32')](function(_0x4c86fd){_0x4074a3['rows']=_0x4c86fd;return _0x4074a3;});}})[_0xa757('0x32')](respondWithFilteredResult(_0x4b0e40,_0x3cf8d3))['catch'](handleError(_0x4b0e40,null));};exports[_0xa757('0x110')]=function(_0x40e0df,_0x54f4ca,_0x4152da){return db['ChatInteraction']['find']({'where':{'id':_0x40e0df[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x54f4ca,null))['then'](function(_0x59ff48){if(_0x59ff48){return _0x59ff48[_0xa757('0x111')](_0x40e0df['body'][_0xa757('0x108')],_[_0xa757('0x109')](_0x40e0df[_0xa757('0x39')],[_0xa757('0x108'),'id'])||{})['spread'](function(){return db[_0xa757('0x7a')][_0xa757('0x10c')]({'attributes':['id',_0xa757('0x35'),_0xa757('0x112')],'where':{'id':_0x40e0df[_0xa757('0x39')][_0xa757('0x108')]}});})[_0xa757('0x32')](function(_0x5d2063){socket[_0xa757('0x113')](_0xa757('0x114'),{'id':Number(_0x40e0df['params']['id']),'tags':_0x5d2063||[]});return{'id':Number(_0x40e0df[_0xa757('0xba')]['id']),'tags':_0x5d2063||[]};});}})[_0xa757('0x32')](respondWithResult(_0x54f4ca,null))['catch'](handleError(_0x54f4ca,null));};exports[_0xa757('0x115')]=function(_0x1474f7,_0x1449d4,_0x2aaf2a){return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x1474f7[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x1449d4,null))[_0xa757('0x32')](function(_0x1ba7d0){if(_0x1ba7d0){return _0x1ba7d0[_0xa757('0x115')](_0x1474f7[_0xa757('0x4b')]['ids']);}})[_0xa757('0x32')](respondWithStatusCode(_0x1449d4,null))[_0xa757('0x45')](handleError(_0x1449d4,null));};exports[_0xa757('0x116')]=function(_0x563988,_0x43e9cb){var _0xaf7112=moment()['unix']()[_0xa757('0xa3')]();var _0x5ea526=path[_0xa757('0xe4')](config['root'],_0xa757('0x117'),_0xa757('0x118'),_0xa757('0x119'));var _0x58f20d=path[_0xa757('0xe4')](config[_0xa757('0x11a')],_0xa757('0x117'),_0xa757('0x118'),_0xa757('0x11b'));var _0x4b274f=path[_0xa757('0xe4')](_0x5ea526,_0xaf7112);var _0x225b14=util[_0xa757('0xe7')](_0xa757('0x11c'),_0x563988[_0xa757('0xba')]['id'],_0xaf7112);var _0x14d04e=path['join'](_0x5ea526,_0x225b14);var _0x3798ea=[];_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x7d'),'attributes':['id',_0xa757('0xc7')],'raw':!![]});_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0xd5')],'as':'Contact','attributes':['id',_0xa757('0x11d'),'lastName'],'raw':!![]});if(_0x563988['query'][_0xa757('0x11b')]){_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0xdf')],'as':'Attachment','raw':!![]});}var _0x3bd69c=[{'model':db['ChatMessage'],'as':_0xa757('0xeb'),'attributes':['id',_0xa757('0x39'),'createdAt',_0xa757('0xf8'),'secret',_0xa757('0x8c')],'include':_0x3798ea}];_0x3bd69c[_0xa757('0x44')]({'model':db[_0xa757('0xc1')],'as':_0xa757('0x11e'),'attributes':['id',_0xa757('0x35')]});_0x3bd69c[_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x11f'),'attributes':['id',_0xa757('0xc7')]});return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x563988['params']['id']},'include':_0x3bd69c})[_0xa757('0x32')](handleEntityNotFound(_0x43e9cb,null))[_0xa757('0x32')](function(_0x374216){if(_0x374216){var _0x1a8c73=_0x374216[_0xa757('0x120')]({'plain':!![]});fs[_0xa757('0x121')](_0x4b274f);var _0xd20b89={'channel':_0xa757('0x122'),'account':_0x1a8c73['Account'][_0xa757('0x35')],'agent':_0x1a8c73['Owner']?_0x1a8c73[_0xa757('0x11f')][_0xa757('0xc7')]:_0xa757('0x123'),'createdAt':moment(_0x1a8c73[_0xa757('0x85')])[_0xa757('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa757('0xa3')](),'closedAt':_0x1a8c73[_0xa757('0xda')]?moment(_0x1a8c73[_0xa757('0x124')])['format'](_0xa757('0x125'))['toString']():'','disposition':_0x1a8c73['disposition'],'chatInfo':{'browser':_0x1a8c73[_0xa757('0x126')],'os':_0x1a8c73[_0xa757('0x127')],'referer':_0x1a8c73[_0xa757('0x128')],'customerIp':_0x1a8c73[_0xa757('0x129')],'customerPort':_0x1a8c73['customerPort']?_0x1a8c73[_0xa757('0x12a')]:_0xa757('0x123')},'messages':_(_0x1a8c73[_0xa757('0xeb')])[_0xa757('0x12b')]()[_0xa757('0x90')]({'secret':![]})['map'](function(_0x535599){if(_0x535599['Attachment']){var _0x56c9b9=path[_0xa757('0xe4')](_0x58f20d,_0x535599['Attachment'][_0xa757('0xe5')]);if(fs[_0xa757('0x12c')](_0x56c9b9)){fs[_0xa757('0x12d')](_0x56c9b9)[_0xa757('0x12e')](fs[_0xa757('0x12f')](path[_0xa757('0xe4')](_0x4b274f,_0x535599[_0xa757('0xdf')][_0xa757('0xe5')])));}}return{'date':moment(_0x535599[_0xa757('0x85')])[_0xa757('0xe7')](_0xa757('0x125'))[_0xa757('0xa3')](),'sender':_0x535599[_0xa757('0xf8')]===_0xa757('0xd1')?_0x535599[_0xa757('0x7d')]?_0x535599[_0xa757('0x7d')][_0xa757('0xc7')]:_0xa757('0xed'):_0x535599[_0xa757('0x72')][_0xa757('0x11d')]+(_0x535599[_0xa757('0x72')][_0xa757('0x130')]?'\x20'+_0x535599[_0xa757('0x72')][_0xa757('0x130')]:''),'body':_0x535599[_0xa757('0xdf')]?_0x535599[_0xa757('0xdf')][_0xa757('0xe5')]:_0x535599[_0xa757('0x39')],'direction':_0x535599['direction']===_0xa757('0xd1')?'A':'C','secret':_0x535599[_0xa757('0x10e')],'read':_0x535599[_0xa757('0x8c')],'attachment':_0x535599[_0xa757('0xdf')]};})['value']()};return ejs[_0xa757('0x131')](path[_0xa757('0xe4')](config[_0xa757('0x11a')],_0xa757('0x117'),_0xa757('0x132'),_0xa757('0x133')),{'interaction':_0xd20b89})[_0xa757('0x32')](function(_0xd7df6f){var _0x7e03ff=path[_0xa757('0xe4')](_0x4b274f,_0xa757('0x134')+_0x1a8c73['id']+'-'+_0xaf7112+_0xa757('0x135'));var _0x1d21e7={'path':_0x7e03ff,'channel':_0xa757('0x122'),'interactionId':_0x1a8c73['id']};return pdf['createPdfFromHTML'](_0xd7df6f,_0x1d21e7);})[_0xa757('0x32')](function(){return new BPromise(function(_0xacfa4b,_0x567517){zipdir(_0x4b274f,{'saveTo':_0x14d04e},function(_0x22e7f5,_0x435552){if(_0x22e7f5)return _0x567517(_0x22e7f5);return _0xacfa4b(_0x435552);});})[_0xa757('0x32')](function(){return new BPromise(function(_0x466f7b,_0x4f5ae1){rimraf(_0x4b274f,function(_0x404003){if(_0x404003)_0x4f5ae1(_0x404003);return _0x466f7b();});});})[_0xa757('0x32')](function(){return _0x43e9cb[_0xa757('0x116')](_0x14d04e,_0x225b14,function(_0x34f745){if(_0x34f745){console[_0xa757('0x136')](_0xa757('0x137'),_0x34f745);}else{fs[_0xa757('0x138')](_0x14d04e);}});});});}else{return _0x43e9cb[_0xa757('0x25')](0xc8);}})[_0xa757('0x45')](handleError(_0x43e9cb,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9275e76..446c824 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 _0xc2da=['save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage'];(function(_0x5df38c,_0x168af4){var _0x286798=function(_0x2f7377){while(--_0x2f7377){_0x5df38c['push'](_0x5df38c['shift']());}};_0x286798(++_0x168af4);}(_0xc2da,0xe8));var _0xac2d=function(_0x13635d,_0x14d83e){_0x13635d=_0x13635d-0x0;var _0x3505b9=_0xc2da[_0x13635d];return _0x3505b9;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xac2d('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xac2d('0x0'))['db'][_0xac2d('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac2d('0x2'),'afterUpdate':_0xac2d('0x3'),'afterDestroy':_0xac2d('0x4')};function emitEvent(_0x527081){return function(_0x4905d1,_0x6b37da,_0x2991b){_0x4905d1[_0xac2d('0x5')]({'attributes':['id'],'raw':!![]})[_0xac2d('0x6')](function(_0x533d5e){_0x4905d1['setDataValue'](_0xac2d('0x7'),_0x533d5e[_0xac2d('0x8')](function(_0x3ffd91){return{'id':_0x3ffd91['id']};}));return ChatMessage[_0xac2d('0x9')]({'where':{'ChatInteractionId':_0x4905d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac2d('0x6')](function(_0x24ac6f){_0x4905d1[_0xac2d('0xa')](_0xac2d('0xb'),_0x24ac6f[_0xac2d('0xc')]);ChatInteractionEvents['emit'](_0x527081+':'+_0x4905d1['id'],_0x4905d1);ChatInteractionEvents[_0xac2d('0xd')](_0x527081,_0x4905d1);_0x2991b(null);})[_0xac2d('0xe')](_0x2991b(null));};}for(var e in events){if(events[_0xac2d('0xf')](e)){var event=events[e];ChatInteraction[_0xac2d('0x10')](e,emitEvent(event));}}module[_0xac2d('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x47de=['getUsers','setDataValue','map','findAll','then','unreadMessages','length','emit','catch','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x1f4995,_0x43c894){var _0x1b6ed6=function(_0x24ac0f){while(--_0x24ac0f){_0x1f4995['push'](_0x1f4995['shift']());}};_0x1b6ed6(++_0x43c894);}(_0x47de,0x1a1));var _0xe47d=function(_0x225d9a,_0x289707){_0x225d9a=_0x225d9a-0x0;var _0x5b8859=_0x47de[_0x225d9a];return _0x5b8859;};'use strict';var EventEmitter=require(_0xe47d('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xe47d('0x1')];var ChatMessage=require(_0xe47d('0x2'))['db'][_0xe47d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe47d('0x4')](0x0);var events={'afterCreate':_0xe47d('0x5'),'afterUpdate':_0xe47d('0x6'),'afterDestroy':_0xe47d('0x7')};function emitEvent(_0xa9f909){return function(_0x3da759,_0x46633a,_0x191c45){_0x3da759[_0xe47d('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x351a44){_0x3da759[_0xe47d('0x9')]('Users',_0x351a44[_0xe47d('0xa')](function(_0x172a5b){return{'id':_0x172a5b['id']};}));return ChatMessage[_0xe47d('0xb')]({'where':{'ChatInteractionId':_0x3da759['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe47d('0xc')](function(_0x5bb091){_0x3da759[_0xe47d('0x9')](_0xe47d('0xd'),_0x5bb091[_0xe47d('0xe')]);ChatInteractionEvents[_0xe47d('0xf')](_0xa9f909+':'+_0x3da759['id'],_0x3da759);ChatInteractionEvents[_0xe47d('0xf')](_0xa9f909,_0x3da759);_0x191c45(null);})[_0xe47d('0x10')](_0x191c45(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 4bb0dfc..a33eea5 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 _0xa836=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash'];(function(_0x2e20fe,_0x354136){var _0x50004f=function(_0x2972d8){while(--_0x2972d8){_0x2e20fe['push'](_0x2e20fe['shift']());}};_0x50004f(++_0x354136);}(_0xa836,0xef));var _0x6a83=function(_0x1c016f,_0x104a35){_0x1c016f=_0x1c016f-0x0;var _0x32eb28=_0xa836[_0x1c016f];return _0x32eb28;};'use strict';var _=require(_0x6a83('0x0'));var util=require(_0x6a83('0x1'));var logger=require('../../config/logger')(_0x6a83('0x2'));var moment=require(_0x6a83('0x3'));var BPromise=require(_0x6a83('0x4'));var rp=require(_0x6a83('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a83('0x6'));var config=require(_0x6a83('0x7'));var attributes=require(_0x6a83('0x8'));module[_0x6a83('0x9')]=function(_0x133c50,_0x3aaa65){return _0x133c50['define']('ChatInteraction',attributes,{'tableName':_0x6a83('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe071c7,_0x16bcf7,_0x26022d){if(_0xe071c7[_0x6a83('0xb')](_0x6a83('0xc'))){_0xe071c7[_0x6a83('0xd')]=moment()['format'](_0x6a83('0xe'));}_0x26022d(null,_0xe071c7);}},'charset':'utf8mb4','collate':_0x6a83('0xf')});}; \ No newline at end of file +var _0xe064=['./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe064,0x1a7));var _0x4e06=function(_0x9c173a,_0x461c9c){_0x9c173a=_0x9c173a-0x0;var _0x88d611=_0xe064[_0x9c173a];return _0x88d611;};'use strict';var _=require(_0x4e06('0x0'));var util=require(_0x4e06('0x1'));var logger=require(_0x4e06('0x2'))(_0x4e06('0x3'));var moment=require(_0x4e06('0x4'));var BPromise=require(_0x4e06('0x5'));var rp=require(_0x4e06('0x6'));var fs=require('fs');var path=require(_0x4e06('0x7'));var rimraf=require(_0x4e06('0x8'));var config=require('../../config/environment');var attributes=require(_0x4e06('0x9'));module[_0x4e06('0xa')]=function(_0x36217c,_0x13a907){return _0x36217c[_0x4e06('0xb')]('ChatInteraction',attributes,{'tableName':_0x4e06('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2568df,_0x353e2a,_0x25f4be){if(_0x2568df[_0x4e06('0xd')](_0x4e06('0xe'))){_0x2568df[_0x4e06('0xf')]=moment()[_0x4e06('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x25f4be(null,_0x2568df);}},'charset':_0x4e06('0x11'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index ed0d0a8..01aa655 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 _0x21a5=['spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','limit','AddTagsToChatInteraction','ids','omit'];(function(_0x1187d2,_0x45b562){var _0x5778d1=function(_0xa061a4){while(--_0xa061a4){_0x1187d2['push'](_0x1187d2['shift']());}};_0x5778d1(++_0x45b562);}(_0x21a5,0x77));var _0x521a=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0x21a5[_0x291aaf];return _0x5571e6;};'use strict';var _=require(_0x521a('0x0'));var util=require(_0x521a('0x1'));var moment=require(_0x521a('0x2'));var BPromise=require(_0x521a('0x3'));var rs=require(_0x521a('0x4'));var fs=require('fs');var Redis=require(_0x521a('0x5'));var db=require(_0x521a('0x6'))['db'];var utils=require(_0x521a('0x7'));var logger=require(_0x521a('0x8'))(_0x521a('0x9'));var config=require(_0x521a('0xa'));var jayson=require(_0x521a('0xb'));var client=jayson[_0x521a('0xc')][_0x521a('0xd')]({'port':0x232a});config[_0x521a('0xe')]=_['defaults'](config[_0x521a('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x521a('0xf'))(new Redis(config[_0x521a('0xe')]));require('./chatInteraction.socket')[_0x521a('0x10')](socket);function respondWithRpcPromise(_0x107b9f,_0x48f2e4,_0x7b3ee5){return new BPromise(function(_0x7dc9e9,_0x1e1d5d){return client[_0x521a('0x11')](_0x107b9f,_0x7b3ee5)[_0x521a('0x12')](function(_0x27577d){logger[_0x521a('0x13')](_0x521a('0x14'),_0x48f2e4,_0x521a('0x15'));logger[_0x521a('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x48f2e4,_0x521a('0x15'),JSON[_0x521a('0x17')](_0x27577d));if(_0x27577d[_0x521a('0x18')]){if(_0x27577d[_0x521a('0x18')]['code']===0x1f4){logger['error'](_0x521a('0x14'),_0x48f2e4,_0x27577d[_0x521a('0x18')][_0x521a('0x19')]);return _0x1e1d5d(_0x27577d[_0x521a('0x18')][_0x521a('0x19')]);}logger[_0x521a('0x18')](_0x521a('0x14'),_0x48f2e4,_0x27577d[_0x521a('0x18')]['message']);return _0x7dc9e9(_0x27577d[_0x521a('0x18')][_0x521a('0x19')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x48f2e4,_0x521a('0x15'));_0x7dc9e9(_0x27577d[_0x521a('0x1a')][_0x521a('0x19')]);}})[_0x521a('0x1b')](function(_0x57f140){logger[_0x521a('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x48f2e4,_0x57f140);_0x1e1d5d(_0x57f140);});});}exports[_0x521a('0x1c')]=function(_0x355761){var _0x4293f4=this;return new Promise(function(_0x4f33dd,_0x41cd08){return db[_0x521a('0x1d')][_0x521a('0x1e')](_0x355761[_0x521a('0x1f')],{'raw':_0x355761[_0x521a('0x20')]?_0x355761[_0x521a('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x355761['options']?_0x355761['options']['where']||null:null,'attributes':_0x355761[_0x521a('0x20')]?_0x355761[_0x521a('0x20')]['attributes']||null:null,'limit':_0x355761[_0x521a('0x20')]?_0x355761['options'][_0x521a('0x21')]||null:null})[_0x521a('0x12')](function(_0x2a2d20){logger[_0x521a('0x13')](_0x521a('0x1c'),_0x355761);logger['debug']('UpdateChatInteraction',_0x355761,JSON[_0x521a('0x17')](_0x2a2d20));_0x4f33dd(_0x2a2d20);})['catch'](function(_0x3e6586){logger[_0x521a('0x18')](_0x521a('0x1c'),_0x3e6586['message'],_0x355761);_0x41cd08(_0x4293f4[_0x521a('0x18')](0x1f4,_0x3e6586['message']));});});};exports[_0x521a('0x22')]=function(_0x5a6671){return new Promise(function(_0x118b6f,_0xaa1c0e){return db[_0x521a('0x1d')]['find']({'where':_0x5a6671[_0x521a('0x20')]?_0x5a6671[_0x521a('0x20')]['where']||null:null})[_0x521a('0x12')](function(_0x3d714f){if(_0x3d714f){return _0x3d714f['addTags'](_0x5a6671[_0x521a('0x1f')][_0x521a('0x23')],_[_0x521a('0x24')](_0x5a6671['body'],[_0x521a('0x23'),'id'])||{});}})[_0x521a('0x25')](function(_0x157b6c){logger[_0x521a('0x13')](_0x521a('0x26'),_0x5a6671);logger[_0x521a('0x16')](_0x521a('0x26'),_0x5a6671,JSON[_0x521a('0x17')](_0x157b6c));_0x118b6f(_0x157b6c);})[_0x521a('0x1b')](function(_0x4e0c67){logger[_0x521a('0x18')](_0x521a('0x26'),_0x4e0c67[_0x521a('0x19')],_0x5a6671);_0xaa1c0e(_this[_0x521a('0x18')](0x1f4,_0x4e0c67[_0x521a('0x19')]));});});}; \ No newline at end of file +var _0x53d4=['../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','then','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','catch','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0xb47dc0,_0x407032){var _0x57f0b0=function(_0x11c030){while(--_0x11c030){_0xb47dc0['push'](_0xb47dc0['shift']());}};_0x57f0b0(++_0x407032);}(_0x53d4,0xc8));var _0x453d=function(_0x133c28,_0x37a7a9){_0x133c28=_0x133c28-0x0;var _0x34e64b=_0x53d4[_0x133c28];return _0x34e64b;};'use strict';var _=require(_0x453d('0x0'));var util=require(_0x453d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x453d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x453d('0x3'))['db'];var utils=require(_0x453d('0x4'));var logger=require(_0x453d('0x5'))(_0x453d('0x6'));var config=require(_0x453d('0x7'));var jayson=require(_0x453d('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x453d('0x9')]=_[_0x453d('0xa')](config['redis'],{'host':_0x453d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x453d('0x9')]));require(_0x453d('0xc'))[_0x453d('0xd')](socket);function respondWithRpcPromise(_0x70883a,_0x2c0404,_0x1a177c){return new BPromise(function(_0xb91b8e,_0x13011a){return client[_0x453d('0xe')](_0x70883a,_0x1a177c)['then'](function(_0xf54366){logger[_0x453d('0xf')](_0x453d('0x10'),_0x2c0404,_0x453d('0x11'));logger['debug'](_0x453d('0x12'),_0x2c0404,'request\x20sent',JSON[_0x453d('0x13')](_0xf54366));if(_0xf54366[_0x453d('0x14')]){if(_0xf54366[_0x453d('0x14')][_0x453d('0x15')]===0x1f4){logger[_0x453d('0x14')](_0x453d('0x10'),_0x2c0404,_0xf54366[_0x453d('0x14')][_0x453d('0x16')]);return _0x13011a(_0xf54366[_0x453d('0x14')][_0x453d('0x16')]);}logger[_0x453d('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2c0404,_0xf54366[_0x453d('0x14')]['message']);return _0xb91b8e(_0xf54366[_0x453d('0x14')][_0x453d('0x16')]);}else{logger[_0x453d('0xf')](_0x453d('0x10'),_0x2c0404,'request\x20sent');_0xb91b8e(_0xf54366['result'][_0x453d('0x16')]);}})['catch'](function(_0x71d99c){logger[_0x453d('0x14')](_0x453d('0x10'),_0x2c0404,_0x71d99c);_0x13011a(_0x71d99c);});});}exports[_0x453d('0x17')]=function(_0x50de7f){var _0x25f034=this;return new Promise(function(_0x1bcf8d,_0x1d7116){return db[_0x453d('0x18')][_0x453d('0x19')](_0x50de7f[_0x453d('0x1a')],{'raw':_0x50de7f[_0x453d('0x1b')]?_0x50de7f[_0x453d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50de7f[_0x453d('0x1b')]?_0x50de7f[_0x453d('0x1b')][_0x453d('0x1c')]||null:null,'attributes':_0x50de7f[_0x453d('0x1b')]?_0x50de7f[_0x453d('0x1b')][_0x453d('0x1d')]||null:null,'limit':_0x50de7f['options']?_0x50de7f[_0x453d('0x1b')][_0x453d('0x1e')]||null:null})[_0x453d('0x1f')](function(_0x41eb81){logger[_0x453d('0xf')]('UpdateChatInteraction',_0x50de7f);logger[_0x453d('0x20')](_0x453d('0x17'),_0x50de7f,JSON['stringify'](_0x41eb81));_0x1bcf8d(_0x41eb81);})['catch'](function(_0x258d14){logger[_0x453d('0x14')](_0x453d('0x17'),_0x258d14[_0x453d('0x16')],_0x50de7f);_0x1d7116(_0x25f034[_0x453d('0x14')](0x1f4,_0x258d14[_0x453d('0x16')]));});});};exports[_0x453d('0x21')]=function(_0x193ade){return new Promise(function(_0x52e49c,_0x39efc1){return db[_0x453d('0x18')][_0x453d('0x22')]({'where':_0x193ade['options']?_0x193ade[_0x453d('0x1b')]['where']||null:null})[_0x453d('0x1f')](function(_0xeb6ae3){if(_0xeb6ae3){return _0xeb6ae3[_0x453d('0x23')](_0x193ade[_0x453d('0x1a')][_0x453d('0x24')],_[_0x453d('0x25')](_0x193ade[_0x453d('0x1a')],[_0x453d('0x24'),'id'])||{});}})[_0x453d('0x26')](function(_0x532c64){logger[_0x453d('0xf')]('AddTags',_0x193ade);logger[_0x453d('0x20')](_0x453d('0x27'),_0x193ade,JSON[_0x453d('0x13')](_0x532c64));_0x52e49c(_0x532c64);})[_0x453d('0x28')](function(_0x494589){logger[_0x453d('0x14')](_0x453d('0x27'),_0x494589[_0x453d('0x16')],_0x193ade);_0x39efc1(_this[_0x453d('0x14')](0x1f4,_0x494589[_0x453d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 3f99808..20f494c 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 _0x2313=['update','emit','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x25060f,_0x5d22e9){var _0x4a23a5=function(_0x19a8d4){while(--_0x19a8d4){_0x25060f['push'](_0x25060f['shift']());}};_0x4a23a5(++_0x5d22e9);}(_0x2313,0x191));var _0x3231=function(_0x333e6c,_0x32d568){_0x333e6c=_0x333e6c-0x0;var _0x95d9dd=_0x2313[_0x333e6c];return _0x95d9dd;};'use strict';var ChatInteractionEvents=require(_0x3231('0x0'));var events=['save','remove',_0x3231('0x1')];function createListener(_0x5e7521,_0x211e1a){return function(_0x1e0b37){_0x211e1a[_0x3231('0x2')](_0x5e7521,_0x1e0b37);};}function removeListener(_0x49710b,_0x24e76a){return function(){ChatInteractionEvents['removeListener'](_0x49710b,_0x24e76a);};}exports[_0x3231('0x3')]=function(_0xfde7fe){for(var _0x5cc583=0x0,_0xdea179=events[_0x3231('0x4')];_0x5cc583<_0xdea179;_0x5cc583++){var _0x27414d=events[_0x5cc583];var _0x1b45ff=createListener(_0x3231('0x5')+_0x27414d,_0xfde7fe);ChatInteractionEvents['on'](_0x27414d,_0x1b45ff);}}; \ No newline at end of file +var _0xeb6c=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x34d677,_0x434206){var _0x452303=function(_0xd3836){while(--_0xd3836){_0x34d677['push'](_0x34d677['shift']());}};_0x452303(++_0x434206);}(_0xeb6c,0x85));var _0xceb6=function(_0x5efaac,_0x15dd05){_0x5efaac=_0x5efaac-0x0;var _0x142221=_0xeb6c[_0x5efaac];return _0x142221;};'use strict';var ChatInteractionEvents=require(_0xceb6('0x0'));var events=[_0xceb6('0x1'),_0xceb6('0x2'),_0xceb6('0x3')];function createListener(_0x25a035,_0x16a36e){return function(_0x9f4e9e){_0x16a36e[_0xceb6('0x4')](_0x25a035,_0x9f4e9e);};}function removeListener(_0x34689d,_0x30b90e){return function(){ChatInteractionEvents[_0xceb6('0x5')](_0x34689d,_0x30b90e);};}exports['register']=function(_0x349b66){for(var _0x4984e2=0x0,_0x34a2e2=events[_0xceb6('0x6')];_0x4984e2<_0x34a2e2;_0x4984e2++){var _0x439b39=events[_0x4984e2];var _0x35e98f=createListener(_0xceb6('0x7')+_0x439b39,_0x349b66);ChatInteractionEvents['on'](_0x439b39,_0x35e98f);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 8f1eb57..8e7efff 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 _0xb05e=['update','/:id/custom_update','customUpdate','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update'];(function(_0x42552a,_0x4336ca){var _0x156b7d=function(_0x5c1367){while(--_0x5c1367){_0x42552a['push'](_0x42552a['shift']());}};_0x156b7d(++_0x4336ca);}(_0xb05e,0x159));var _0xeb05=function(_0x281fe4,_0x592fd7){_0x281fe4=_0x281fe4-0x0;var _0x10539a=_0xb05e[_0x281fe4];return _0x10539a;};'use strict';var multer=require(_0xeb05('0x0'));var util=require(_0xeb05('0x1'));var path=require(_0xeb05('0x2'));var timeout=require(_0xeb05('0x3'));var express=require(_0xeb05('0x4'));var router=express[_0xeb05('0x5')]();var fs_extra=require(_0xeb05('0x6'));var auth=require(_0xeb05('0x7'));var interaction=require(_0xeb05('0x8'));var config=require('../../config/environment');var controller=require(_0xeb05('0x9'));router[_0xeb05('0xa')]('/',auth[_0xeb05('0xb')](),controller[_0xeb05('0xc')]);router[_0xeb05('0xa')](_0xeb05('0xd'),auth[_0xeb05('0xb')](),controller[_0xeb05('0xe')]);router[_0xeb05('0xa')](_0xeb05('0xf'),auth[_0xeb05('0x10')](),controller[_0xeb05('0x11')]);router['get'](_0xeb05('0x12'),auth[_0xeb05('0x10')](),controller[_0xeb05('0x13')]);router[_0xeb05('0xa')](_0xeb05('0x14'),auth[_0xeb05('0xb')](),controller[_0xeb05('0x15')]);router['get'](_0xeb05('0x16'),auth[_0xeb05('0x10')](),controller[_0xeb05('0x17')]);router[_0xeb05('0xa')](_0xeb05('0x18'),auth[_0xeb05('0xb')](),controller[_0xeb05('0x19')]);router[_0xeb05('0x1a')]('/',auth[_0xeb05('0xb')](),controller['create']);router[_0xeb05('0x1a')](_0xeb05('0x1b'),auth[_0xeb05('0xb')](),controller[_0xeb05('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x10e921,_0x2ce4bf,_0x3ac2aa){_0x3ac2aa(null,path[_0xeb05('0x1d')](config[_0xeb05('0x1e')],_0xeb05('0x1f')));},'filename':function(_0x1c1302,_0x55dcda,_0x1ea787){_0x1ea787(null,util[_0xeb05('0x20')](_0xeb05('0x21'),Date[_0xeb05('0x22')](),_0x55dcda[_0xeb05('0x23')][_0xeb05('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xeb05('0x1a')](_0xeb05('0x25'),upload['single']('file'),controller[_0xeb05('0x26')]);router[_0xeb05('0x1a')]('/:id/messages',auth[_0xeb05('0x10')](),controller[_0xeb05('0x27')]);router[_0xeb05('0x1a')](_0xeb05('0x28'),auth[_0xeb05('0xb')](),interaction[_0xeb05('0x29')]('chat',_0xeb05('0x2a')),controller[_0xeb05('0x2b')]);router[_0xeb05('0x2c')](_0xeb05('0xf'),auth[_0xeb05('0xb')](),interaction[_0xeb05('0x29')](_0xeb05('0x2d'),_0xeb05('0x2e')),controller[_0xeb05('0x2f')]);router[_0xeb05('0x2c')](_0xeb05('0x30'),controller[_0xeb05('0x31')]);router[_0xeb05('0x2c')]('/:id/abandon',auth[_0xeb05('0x10')](),controller[_0xeb05('0x32')]);router[_0xeb05('0x2c')]('/:id/close',controller[_0xeb05('0x33')]);router[_0xeb05('0x34')]('/:id',auth[_0xeb05('0xb')](),interaction[_0xeb05('0x29')](_0xeb05('0x2d'),_0xeb05('0x35')),controller[_0xeb05('0x36')]);router[_0xeb05('0x34')](_0xeb05('0x28'),auth[_0xeb05('0xb')](),controller[_0xeb05('0x37')]);module['exports']=router; \ No newline at end of file +var _0xe883=['server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','removeTags','exports','connect-timeout','../../components/auth/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','download','post','createVidaooSession','diskStorage','join','root'];(function(_0x4a095b,_0x561d99){var _0x2f5394=function(_0xeeb84c){while(--_0xeeb84c){_0x4a095b['push'](_0x4a095b['shift']());}};_0x2f5394(++_0x561d99);}(_0xe883,0xfb));var _0x3e88=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xe883[_0x26f702];return _0x11417d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3e88('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3e88('0x1'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3e88('0x2'));router['get']('/',auth[_0x3e88('0x3')](),controller[_0x3e88('0x4')]);router[_0x3e88('0x5')](_0x3e88('0x6'),auth[_0x3e88('0x3')](),controller['describe']);router[_0x3e88('0x5')]('/:id',auth[_0x3e88('0x7')](),controller[_0x3e88('0x8')]);router[_0x3e88('0x5')](_0x3e88('0x9'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x3e88('0x5')](_0x3e88('0xa'),auth[_0x3e88('0x3')](),controller[_0x3e88('0xb')]);router['get'](_0x3e88('0xc'),auth[_0x3e88('0x7')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x3e88('0x3')](),controller[_0x3e88('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3e88('0xe')]('/:id/vidaoo',auth[_0x3e88('0x3')](),controller[_0x3e88('0xf')]);var upload=multer({'storage':multer[_0x3e88('0x10')]({'destination':function(_0x2514e2,_0x45826f,_0x331033){_0x331033(null,path[_0x3e88('0x11')](config[_0x3e88('0x12')],_0x3e88('0x13')));},'filename':function(_0x2e77f0,_0x3b5f1b,_0x4a5de5){_0x4a5de5(null,util[_0x3e88('0x14')](_0x3e88('0x15'),Date[_0x3e88('0x16')](),_0x3b5f1b[_0x3e88('0x17')][_0x3e88('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3e88('0xe')]('/:id/attachment_upload',upload[_0x3e88('0x19')](_0x3e88('0x1a')),controller[_0x3e88('0x1b')]);router[_0x3e88('0xe')](_0x3e88('0xa'),auth[_0x3e88('0x7')](),controller[_0x3e88('0x1c')]);router[_0x3e88('0xe')](_0x3e88('0x1d'),auth[_0x3e88('0x3')](),interaction[_0x3e88('0x1e')](_0x3e88('0x1f'),_0x3e88('0x20')),controller[_0x3e88('0x21')]);router[_0x3e88('0x22')](_0x3e88('0x23'),auth[_0x3e88('0x3')](),interaction[_0x3e88('0x1e')]('chat',_0x3e88('0x24')),controller['update']);router['put']('/:id/custom_update',controller[_0x3e88('0x25')]);router[_0x3e88('0x22')](_0x3e88('0x26'),auth[_0x3e88('0x7')](),controller[_0x3e88('0x27')]);router['put'](_0x3e88('0x28'),controller[_0x3e88('0x29')]);router['delete'](_0x3e88('0x23'),auth['isAuthenticated'](),interaction[_0x3e88('0x1e')](_0x3e88('0x1f'),_0x3e88('0x2a')),controller['destroy']);router['delete']('/:id/tags',auth[_0x3e88('0x3')](),controller[_0x3e88('0x2b')]);module[_0x3e88('0x2c')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 5c8a3c6..757f449 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 _0xfb51=['exports','TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x1bc4b,_0x4e5682){var _0xf9e9ac=function(_0x4570a4){while(--_0x4570a4){_0x1bc4b['push'](_0x1bc4b['shift']());}};_0xf9e9ac(++_0x4e5682);}(_0xfb51,0x194));var _0x1fb5=function(_0x401ec9,_0x77c73f){_0x401ec9=_0x401ec9-0x0;var _0x8ef3a1=_0xfb51[_0x401ec9];return _0x8ef3a1;};'use strict';var Sequelize=require(_0x1fb5('0x0'));module[_0x1fb5('0x1')]={'body':{'type':Sequelize[_0x1fb5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1fb5('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1fb5('0x4')]}}; \ No newline at end of file +var _0x1f37=['sequelize','medium','BOOLEAN'];(function(_0x42e7ce,_0x812fb3){var _0x2e35a8=function(_0x463be8){while(--_0x463be8){_0x42e7ce['push'](_0x42e7ce['shift']());}};_0x2e35a8(++_0x812fb3);}(_0x1f37,0x16e));var _0x71f3=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x1f37[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x71f3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x71f3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x71f3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index b93ccab..7af69d7 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 _0xe842=['lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','then','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','length','create','body','update','find','params','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','sort','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x40ff0d,_0x50be1a){var _0x3885c2=function(_0xe86c83){while(--_0xe86c83){_0x40ff0d['push'](_0x40ff0d['shift']());}};_0x3885c2(++_0x50be1a);}(_0xe842,0x146));var _0x2e84=function(_0xafd451,_0x3b7d01){_0xafd451=_0xafd451-0x0;var _0x576b22=_0xe842[_0xafd451];return _0x576b22;};'use strict';var emlformat=require(_0x2e84('0x0'));var rimraf=require(_0x2e84('0x1'));var zipdir=require(_0x2e84('0x2'));var jsonpatch=require(_0x2e84('0x3'));var rp=require(_0x2e84('0x4'));var moment=require(_0x2e84('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2e84('0x6'));var util=require(_0x2e84('0x7'));var path=require(_0x2e84('0x8'));var sox=require(_0x2e84('0x9'));var csv=require(_0x2e84('0xa'));var ejs=require(_0x2e84('0xb'));var fs=require('fs');var fs_extra=require(_0x2e84('0xc'));var _=require(_0x2e84('0xd'));var squel=require(_0x2e84('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2e84('0xf'));var toCsv=require(_0x2e84('0xa'));var querystring=require('querystring');var Papa=require(_0x2e84('0x10'));var Redis=require(_0x2e84('0x11'));var authService=require(_0x2e84('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e84('0x13'))('api');var utils=require(_0x2e84('0x14'));var config=require(_0x2e84('0x15'));var licenseUtil=require(_0x2e84('0x16'));var db=require(_0x2e84('0x17'))['db'];config[_0x2e84('0x18')]=_[_0x2e84('0x19')](config[_0x2e84('0x18')],{'host':_0x2e84('0x1a'),'port':0x18eb});var socket=require(_0x2e84('0x1b'))(new Redis(config[_0x2e84('0x18')]));require(_0x2e84('0x1c'))[_0x2e84('0x1d')](socket);function respondWithStatusCode(_0x426045,_0x3caa0e){_0x3caa0e=_0x3caa0e||0xcc;return function(_0x228d23){if(_0x228d23){return _0x426045[_0x2e84('0x1e')](_0x3caa0e);}return _0x426045[_0x2e84('0x1f')](_0x3caa0e)[_0x2e84('0x20')]();};}function respondWithResult(_0x16b08a,_0x40ac0a){_0x40ac0a=_0x40ac0a||0xc8;return function(_0x14e134){if(_0x14e134){return _0x16b08a['status'](_0x40ac0a)[_0x2e84('0x21')](_0x14e134);}};}function respondWithFilteredResult(_0x56978c,_0x188649){return function(_0x29a578){if(_0x29a578){var _0x45db6e=typeof _0x188649[_0x2e84('0x22')]==='undefined'&&typeof _0x188649[_0x2e84('0x23')]===_0x2e84('0x24');var _0x9906b1=_0x29a578[_0x2e84('0x25')];var _0x52afbb=_0x45db6e?0x0:_0x188649[_0x2e84('0x22')];var _0x215888=_0x45db6e?_0x29a578[_0x2e84('0x25')]:_0x188649[_0x2e84('0x22')]+_0x188649[_0x2e84('0x23')];var _0x51ff06;if(_0x215888>=_0x9906b1){_0x215888=_0x9906b1;_0x51ff06=0xc8;}else{_0x51ff06=0xce;}_0x56978c['status'](_0x51ff06);return _0x56978c[_0x2e84('0x26')](_0x2e84('0x27'),_0x52afbb+'-'+_0x215888+'/'+_0x9906b1)['json'](_0x29a578);}return null;};}function patchUpdates(_0x16c71e){return function(_0x98ba77){try{jsonpatch['apply'](_0x98ba77,_0x16c71e,!![]);}catch(_0x10359a){return BPromise[_0x2e84('0x28')](_0x10359a);}return _0x98ba77[_0x2e84('0x29')]();};}function saveUpdates(_0x2d5fc5,_0x1bab55){return function(_0x3488af){if(_0x3488af){return _0x3488af['update'](_0x2d5fc5)['then'](function(_0x266fd0){return _0x266fd0;});}return null;};}function removeEntity(_0x40309c,_0x3d38ea){return function(_0x14b915){if(_0x14b915){return _0x14b915[_0x2e84('0x2a')]()[_0x2e84('0x2b')](function(){_0x40309c[_0x2e84('0x1f')](0xcc)[_0x2e84('0x20')]();});}};}function handleEntityNotFound(_0x1d86c1,_0x906b80){return function(_0x449dc7){if(!_0x449dc7){_0x1d86c1[_0x2e84('0x1e')](0x194);}return _0x449dc7;};}function handleError(_0x263ef8,_0x28c792){_0x28c792=_0x28c792||0x1f4;return function(_0x5a57ee){logger['error'](_0x5a57ee[_0x2e84('0x2c')]);if(_0x5a57ee[_0x2e84('0x2d')]){delete _0x5a57ee[_0x2e84('0x2d')];}_0x263ef8['status'](_0x28c792)[_0x2e84('0x2e')](_0x5a57ee);};}exports[_0x2e84('0x2f')]=function(_0x343559,_0x14b4ff){var _0x3f42d3={},_0x2694dc={},_0xadc0a4={'count':0x0,'rows':[]};var _0x20849c=_[_0x2e84('0x30')](db[_0x2e84('0x31')][_0x2e84('0x32')],function(_0x3faa89){return{'name':_0x3faa89[_0x2e84('0x33')],'type':_0x3faa89[_0x2e84('0x34')][_0x2e84('0x35')]};});_0x2694dc[_0x2e84('0x36')]=_[_0x2e84('0x30')](_0x20849c,_0x2e84('0x2d'));_0x2694dc[_0x2e84('0x37')]=_[_0x2e84('0x38')](_0x343559[_0x2e84('0x37')]);_0x2694dc[_0x2e84('0x39')]=_[_0x2e84('0x3a')](_0x2694dc[_0x2e84('0x36')],_0x2694dc[_0x2e84('0x37')]);_0x3f42d3[_0x2e84('0x3b')]=_['intersection'](_0x2694dc[_0x2e84('0x36')],qs['fields'](_0x343559[_0x2e84('0x37')][_0x2e84('0x3c')]));_0x3f42d3['attributes']=_0x3f42d3[_0x2e84('0x3b')]['length']?_0x3f42d3['attributes']:_0x2694dc[_0x2e84('0x36')];if(!_0x343559['query'][_0x2e84('0x3d')](_0x2e84('0x3e'))){_0x3f42d3[_0x2e84('0x23')]=qs[_0x2e84('0x23')](_0x343559[_0x2e84('0x37')][_0x2e84('0x23')]);_0x3f42d3['offset']=qs[_0x2e84('0x22')](_0x343559[_0x2e84('0x37')][_0x2e84('0x22')]);}_0x3f42d3[_0x2e84('0x3f')]=qs['sort'](_0x343559[_0x2e84('0x37')]['sort']);_0x3f42d3[_0x2e84('0x40')]=qs[_0x2e84('0x39')](_[_0x2e84('0x41')](_0x343559[_0x2e84('0x37')],_0x2694dc[_0x2e84('0x39')]),_0x20849c);if(_0x343559['query'][_0x2e84('0x42')]){_0x3f42d3[_0x2e84('0x40')]=_[_0x2e84('0x43')](_0x3f42d3[_0x2e84('0x40')],{'$or':_['map'](_0x20849c,function(_0x900dc7){if(_0x900dc7[_0x2e84('0x34')]!==_0x2e84('0x44')){var _0xc46e85={};_0xc46e85[_0x900dc7['name']]={'$like':'%'+_0x343559[_0x2e84('0x37')][_0x2e84('0x42')]+'%'};return _0xc46e85;}})});}_0x3f42d3=_[_0x2e84('0x43')]({},_0x3f42d3,_0x343559[_0x2e84('0x45')]);var _0x573dcf={'where':_0x3f42d3['where']};return db['ChatInternalMessage']['count'](_0x573dcf)[_0x2e84('0x2b')](function(_0x12de98){_0xadc0a4[_0x2e84('0x25')]=_0x12de98;if(_0x343559[_0x2e84('0x37')][_0x2e84('0x46')]){_0x3f42d3[_0x2e84('0x47')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x2e84('0x48')](_0x3f42d3);})[_0x2e84('0x2b')](function(_0x73736b){_0xadc0a4['rows']=_0x73736b;return _0xadc0a4;})[_0x2e84('0x2b')](respondWithFilteredResult(_0x14b4ff,_0x3f42d3))[_0x2e84('0x49')](handleError(_0x14b4ff,null));};exports[_0x2e84('0x4a')]=function(_0x191103,_0x134e37){var _0x22f99b={'raw':!![],'where':{'id':_0x191103['params']['id']}},_0x75f4c1={};_0x75f4c1['model']=_[_0x2e84('0x38')](db[_0x2e84('0x31')][_0x2e84('0x32')]);_0x75f4c1[_0x2e84('0x37')]=_['keys'](_0x191103[_0x2e84('0x37')]);_0x75f4c1[_0x2e84('0x39')]=_[_0x2e84('0x3a')](_0x75f4c1[_0x2e84('0x36')],_0x75f4c1[_0x2e84('0x37')]);_0x22f99b[_0x2e84('0x3b')]=_['intersection'](_0x75f4c1['model'],qs['fields'](_0x191103[_0x2e84('0x37')][_0x2e84('0x3c')]));_0x22f99b['attributes']=_0x22f99b[_0x2e84('0x3b')][_0x2e84('0x4b')]?_0x22f99b[_0x2e84('0x3b')]:_0x75f4c1[_0x2e84('0x36')];if(_0x191103[_0x2e84('0x37')]['includeAll']){_0x22f99b[_0x2e84('0x47')]=[{'all':!![]}];}_0x22f99b=_[_0x2e84('0x43')]({},_0x22f99b,_0x191103[_0x2e84('0x45')]);return db[_0x2e84('0x31')]['find'](_0x22f99b)[_0x2e84('0x2b')](handleEntityNotFound(_0x134e37,null))['then'](respondWithResult(_0x134e37,null))['catch'](handleError(_0x134e37,null));};exports[_0x2e84('0x4c')]=function(_0x30ffdb,_0x7b4de3){return db[_0x2e84('0x31')][_0x2e84('0x4c')](_0x30ffdb[_0x2e84('0x4d')],{})[_0x2e84('0x2b')](respondWithResult(_0x7b4de3,0xc9))['catch'](handleError(_0x7b4de3,null));};exports[_0x2e84('0x4e')]=function(_0x5c761c,_0x17c7d4){if(_0x5c761c['body']['id']){delete _0x5c761c['body']['id'];}return db[_0x2e84('0x31')][_0x2e84('0x4f')]({'where':{'id':_0x5c761c[_0x2e84('0x50')]['id']}})[_0x2e84('0x2b')](handleEntityNotFound(_0x17c7d4,null))['then'](saveUpdates(_0x5c761c[_0x2e84('0x4d')],null))[_0x2e84('0x2b')](respondWithResult(_0x17c7d4,null))[_0x2e84('0x49')](handleError(_0x17c7d4,null));};exports['destroy']=function(_0x1ec306,_0x2ac848){return db[_0x2e84('0x31')]['find']({'where':{'id':_0x1ec306[_0x2e84('0x50')]['id']}})[_0x2e84('0x2b')](handleEntityNotFound(_0x2ac848,null))[_0x2e84('0x2b')](removeEntity(_0x2ac848,null))[_0x2e84('0x49')](handleError(_0x2ac848,null));};exports[_0x2e84('0x51')]=function(_0x2cafc9,_0x42aa7f){return db['ChatInternalMessage']['describe']()[_0x2e84('0x2b')](respondWithResult(_0x42aa7f,null))[_0x2e84('0x49')](handleError(_0x42aa7f,null));};function wrapUser(_0x24e7d8){return function(_0x3193a6){var _0xec6397=_0x24e7d8[_0x2e84('0x52')]({'plain':!![]});_0xec6397['messages']=[];if(_0x3193a6){_0xec6397[_0x2e84('0x53')]=_0x3193a6[_0x2e84('0x54')];_0xec6397[_0x2e84('0x55')]=_0x3193a6;}else{_0xec6397[_0x2e84('0x53')]=moment(0x0)['format'](_0x2e84('0x56'));_0xec6397[_0x2e84('0x55')]={};}return _0xec6397;};}exports[_0x2e84('0x57')]=function(_0x58b91b,_0x529f40,_0x23605f){var _0x4659af=[];return db[_0x2e84('0x58')]['findAll']({'where':{'role':[_0x2e84('0x59'),_0x2e84('0x5a'),_0x2e84('0x5b')]},'attributes':['id','fullname','name',_0x2e84('0x5c'),_0x2e84('0x5d'),'internal',_0x2e84('0x5e'),_0x2e84('0x5f'),_0x2e84('0x60'),'showWebBar'],'order':qs[_0x2e84('0x61')](_0x2e84('0x62')),'include':[{'model':db[_0x2e84('0x63')],'as':_0x2e84('0x64'),'attributes':['id','name',_0x2e84('0x34')],'through':{'attributes':[]}}]})[_0x2e84('0x2b')](function(_0x75ec20){if(_0x75ec20){var _0x3f42e8=_0x58b91b[_0x2e84('0x5b')]['get']({'plain':!![]});if(!_0x3f42e8)throw new Error(_0x2e84('0x65'));if(_0x3f42e8[_0x2e84('0x5c')]===_0x2e84('0x5b')){return db[_0x2e84('0x66')][_0x2e84('0x4f')]({'where':{'name':_0x2e84('0x67'),'userProfileId':_0x3f42e8[_0x2e84('0x68')]},'raw':!![]})[_0x2e84('0x2b')](function(_0x13bf90){if(_0x13bf90){if(_0x13bf90['autoAssociation']===0x0){return db[_0x2e84('0x69')][_0x2e84('0x48')]({'where':{'sectionId':_0x13bf90['id']},'raw':!![]})[_0x2e84('0x2b')](function(_0x29b01a){var _0x3db835=[];if(_['isEmpty'](_0x29b01a)){_0x3db835=_['filter'](_0x75ec20,function(_0x254de1){if(_0x254de1['role']!==_0x2e84('0x59')){return _0x254de1;}});return _0x3db835;}else{for(var _0x320349=0x0;_0x320349<_0x75ec20[_0x2e84('0x4b')];_0x320349++){var _0x2335f6=_0x75ec20[_0x320349];if(_0x2335f6[_0x2e84('0x5c')]===_0x2e84('0x59')){var _0x51c7d8=_[_0x2e84('0x4f')](_0x29b01a,function(_0x4c2799){return _0x4c2799[_0x2e84('0x6a')]===_0x2335f6['id'];});if(_0x51c7d8)_0x3db835[_0x2e84('0x6b')](_0x2335f6);}else{_0x3db835[_0x2e84('0x6b')](_0x2335f6);}}return _0x3db835;}});}else{return _0x75ec20;}}else{var _0x19c82d=_[_0x2e84('0x42')](_0x75ec20,function(_0x50aadf){if(_0x50aadf[_0x2e84('0x5c')]!==_0x2e84('0x59')){return _0x50aadf;}});return _0x19c82d;}});}else{return _0x75ec20;}}})[_0x2e84('0x2b')](function(_0x577b57){var _0x5147a4=[];if(_0x577b57){_0x4659af=_0x577b57;for(var _0x468929=0x0;_0x468929<_0x577b57['length'];_0x468929+=0x1){_0x4659af[_0x468929][_0x2e84('0x6c')]=[];_0x5147a4[_0x2e84('0x6b')](db[_0x2e84('0x31')][_0x2e84('0x4f')]({'where':{'FromId':[_0x58b91b[_0x2e84('0x5b')]['id'],_0x577b57[_0x468929]['id']],'ToId':[_0x58b91b[_0x2e84('0x5b')]['id'],_0x577b57[_0x468929]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x2e84('0x6d'),_0x2e84('0x6e'),_0x2e84('0x4d')],'order':qs[_0x2e84('0x61')](_0x2e84('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2e84('0x2b')](wrapUser(_0x577b57[_0x468929])));}return BPromise[_0x2e84('0x70')](_0x5147a4);}return[];})[_0x2e84('0x2b')](function(_0x594e43){return{'rows':_0x594e43,'count':_0x594e43[_0x2e84('0x4b')]};})[_0x2e84('0x2b')](respondWithResult(_0x529f40,null))[_0x2e84('0x49')](handleError(_0x529f40,null));}; \ No newline at end of file +var _0x732c=['moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x386e7c,_0x3cf6b9){var _0x16b2b0=function(_0x191952){while(--_0x191952){_0x386e7c['push'](_0x386e7c['shift']());}};_0x16b2b0(++_0x3cf6b9);}(_0x732c,0x1b4));var _0xc732=function(_0x3e96f6,_0x427022){_0x3e96f6=_0x3e96f6-0x0;var _0x454296=_0x732c[_0x3e96f6];return _0x454296;};'use strict';var emlformat=require(_0xc732('0x0'));var rimraf=require(_0xc732('0x1'));var zipdir=require(_0xc732('0x2'));var jsonpatch=require(_0xc732('0x3'));var rp=require('request-promise');var moment=require(_0xc732('0x4'));var BPromise=require(_0xc732('0x5'));var Mustache=require(_0xc732('0x6'));var util=require(_0xc732('0x7'));var path=require(_0xc732('0x8'));var sox=require(_0xc732('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc732('0xa'));var squel=require('squel');var crypto=require(_0xc732('0xb'));var jsforce=require(_0xc732('0xc'));var deskjs=require(_0xc732('0xd'));var toCsv=require(_0xc732('0xe'));var querystring=require(_0xc732('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc732('0x10'));var hardwareService=require(_0xc732('0x11'));var logger=require(_0xc732('0x12'))('api');var utils=require(_0xc732('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc732('0x14'))['db'];config[_0xc732('0x15')]=_[_0xc732('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc732('0x17'))(new Redis(config[_0xc732('0x15')]));require(_0xc732('0x18'))[_0xc732('0x19')](socket);function respondWithStatusCode(_0x37be2a,_0xb2c875){_0xb2c875=_0xb2c875||0xcc;return function(_0x41b586){if(_0x41b586){return _0x37be2a[_0xc732('0x1a')](_0xb2c875);}return _0x37be2a[_0xc732('0x1b')](_0xb2c875)[_0xc732('0x1c')]();};}function respondWithResult(_0x10c29c,_0x23f8d8){_0x23f8d8=_0x23f8d8||0xc8;return function(_0x2b349d){if(_0x2b349d){return _0x10c29c[_0xc732('0x1b')](_0x23f8d8)[_0xc732('0x1d')](_0x2b349d);}};}function respondWithFilteredResult(_0x521b20,_0x45d683){return function(_0x2719bf){if(_0x2719bf){var _0x29d7c4=typeof _0x45d683['offset']===_0xc732('0x1e')&&typeof _0x45d683['limit']===_0xc732('0x1e');var _0x12d74b=_0x2719bf[_0xc732('0x1f')];var _0x5c8ff7=_0x29d7c4?0x0:_0x45d683[_0xc732('0x20')];var _0x4d7639=_0x29d7c4?_0x2719bf[_0xc732('0x1f')]:_0x45d683[_0xc732('0x20')]+_0x45d683[_0xc732('0x21')];var _0x48b692;if(_0x4d7639>=_0x12d74b){_0x4d7639=_0x12d74b;_0x48b692=0xc8;}else{_0x48b692=0xce;}_0x521b20['status'](_0x48b692);return _0x521b20[_0xc732('0x22')](_0xc732('0x23'),_0x5c8ff7+'-'+_0x4d7639+'/'+_0x12d74b)['json'](_0x2719bf);}return null;};}function patchUpdates(_0x28b253){return function(_0x2caae6){try{jsonpatch[_0xc732('0x24')](_0x2caae6,_0x28b253,!![]);}catch(_0x5d31c4){return BPromise[_0xc732('0x25')](_0x5d31c4);}return _0x2caae6[_0xc732('0x26')]();};}function saveUpdates(_0xffa310,_0x5be607){return function(_0x2b57e8){if(_0x2b57e8){return _0x2b57e8[_0xc732('0x27')](_0xffa310)[_0xc732('0x28')](function(_0x8ed855){return _0x8ed855;});}return null;};}function removeEntity(_0x4d8c19,_0x1f21a9){return function(_0xdcf377){if(_0xdcf377){return _0xdcf377[_0xc732('0x29')]()[_0xc732('0x28')](function(){_0x4d8c19['status'](0xcc)[_0xc732('0x1c')]();});}};}function handleEntityNotFound(_0x5d1602,_0x2a00ed){return function(_0x4313f3){if(!_0x4313f3){_0x5d1602[_0xc732('0x1a')](0x194);}return _0x4313f3;};}function handleError(_0x19d3ca,_0x1cdb76){_0x1cdb76=_0x1cdb76||0x1f4;return function(_0x13e283){logger['error'](_0x13e283[_0xc732('0x2a')]);if(_0x13e283[_0xc732('0x2b')]){delete _0x13e283[_0xc732('0x2b')];}_0x19d3ca[_0xc732('0x1b')](_0x1cdb76)[_0xc732('0x2c')](_0x13e283);};}exports['index']=function(_0x4091b0,_0x27ec43){var _0x273168={},_0x35904c={},_0x4169af={'count':0x0,'rows':[]};var _0x3b2ae1=_['map'](db[_0xc732('0x2d')][_0xc732('0x2e')],function(_0xf2f6ce){return{'name':_0xf2f6ce[_0xc732('0x2f')],'type':_0xf2f6ce[_0xc732('0x30')][_0xc732('0x31')]};});_0x35904c[_0xc732('0x32')]=_[_0xc732('0x33')](_0x3b2ae1,_0xc732('0x2b'));_0x35904c['query']=_[_0xc732('0x34')](_0x4091b0[_0xc732('0x35')]);_0x35904c['filters']=_[_0xc732('0x36')](_0x35904c['model'],_0x35904c['query']);_0x273168[_0xc732('0x37')]=_[_0xc732('0x36')](_0x35904c[_0xc732('0x32')],qs[_0xc732('0x38')](_0x4091b0[_0xc732('0x35')][_0xc732('0x38')]));_0x273168[_0xc732('0x37')]=_0x273168[_0xc732('0x37')][_0xc732('0x39')]?_0x273168[_0xc732('0x37')]:_0x35904c[_0xc732('0x32')];if(!_0x4091b0['query'][_0xc732('0x3a')](_0xc732('0x3b'))){_0x273168[_0xc732('0x21')]=qs[_0xc732('0x21')](_0x4091b0[_0xc732('0x35')][_0xc732('0x21')]);_0x273168[_0xc732('0x20')]=qs[_0xc732('0x20')](_0x4091b0[_0xc732('0x35')]['offset']);}_0x273168['order']=qs[_0xc732('0x3c')](_0x4091b0[_0xc732('0x35')][_0xc732('0x3c')]);_0x273168[_0xc732('0x3d')]=qs[_0xc732('0x3e')](_[_0xc732('0x3f')](_0x4091b0[_0xc732('0x35')],_0x35904c[_0xc732('0x3e')]),_0x3b2ae1);if(_0x4091b0['query'][_0xc732('0x40')]){_0x273168['where']=_['merge'](_0x273168[_0xc732('0x3d')],{'$or':_[_0xc732('0x33')](_0x3b2ae1,function(_0x17816c){if(_0x17816c[_0xc732('0x30')]!=='VIRTUAL'){var _0xdf1fed={};_0xdf1fed[_0x17816c['name']]={'$like':'%'+_0x4091b0['query'][_0xc732('0x40')]+'%'};return _0xdf1fed;}})});}_0x273168=_['merge']({},_0x273168,_0x4091b0[_0xc732('0x41')]);var _0x4ba138={'where':_0x273168[_0xc732('0x3d')]};return db['ChatInternalMessage'][_0xc732('0x1f')](_0x4ba138)[_0xc732('0x28')](function(_0x242cd9){_0x4169af[_0xc732('0x1f')]=_0x242cd9;if(_0x4091b0[_0xc732('0x35')][_0xc732('0x42')]){_0x273168[_0xc732('0x43')]=[{'all':!![]}];}return db[_0xc732('0x2d')][_0xc732('0x44')](_0x273168);})['then'](function(_0x92ca5f){_0x4169af[_0xc732('0x45')]=_0x92ca5f;return _0x4169af;})['then'](respondWithFilteredResult(_0x27ec43,_0x273168))[_0xc732('0x46')](handleError(_0x27ec43,null));};exports[_0xc732('0x47')]=function(_0x1a5b97,_0x40892d){var _0x42757e={'raw':!![],'where':{'id':_0x1a5b97[_0xc732('0x48')]['id']}},_0x218960={};_0x218960[_0xc732('0x32')]=_[_0xc732('0x34')](db[_0xc732('0x2d')][_0xc732('0x2e')]);_0x218960[_0xc732('0x35')]=_[_0xc732('0x34')](_0x1a5b97[_0xc732('0x35')]);_0x218960[_0xc732('0x3e')]=_['intersection'](_0x218960[_0xc732('0x32')],_0x218960['query']);_0x42757e['attributes']=_['intersection'](_0x218960[_0xc732('0x32')],qs[_0xc732('0x38')](_0x1a5b97['query']['fields']));_0x42757e[_0xc732('0x37')]=_0x42757e[_0xc732('0x37')][_0xc732('0x39')]?_0x42757e['attributes']:_0x218960[_0xc732('0x32')];if(_0x1a5b97[_0xc732('0x35')][_0xc732('0x42')]){_0x42757e[_0xc732('0x43')]=[{'all':!![]}];}_0x42757e=_['merge']({},_0x42757e,_0x1a5b97['options']);return db[_0xc732('0x2d')][_0xc732('0x49')](_0x42757e)[_0xc732('0x28')](handleEntityNotFound(_0x40892d,null))[_0xc732('0x28')](respondWithResult(_0x40892d,null))[_0xc732('0x46')](handleError(_0x40892d,null));};exports[_0xc732('0x4a')]=function(_0x50335e,_0x3d4677){return db[_0xc732('0x2d')]['create'](_0x50335e[_0xc732('0x4b')],{})[_0xc732('0x28')](respondWithResult(_0x3d4677,0xc9))['catch'](handleError(_0x3d4677,null));};exports[_0xc732('0x27')]=function(_0x2a4ee8,_0x4e4173){if(_0x2a4ee8['body']['id']){delete _0x2a4ee8['body']['id'];}return db[_0xc732('0x2d')][_0xc732('0x49')]({'where':{'id':_0x2a4ee8['params']['id']}})[_0xc732('0x28')](handleEntityNotFound(_0x4e4173,null))[_0xc732('0x28')](saveUpdates(_0x2a4ee8[_0xc732('0x4b')],null))[_0xc732('0x28')](respondWithResult(_0x4e4173,null))['catch'](handleError(_0x4e4173,null));};exports['destroy']=function(_0x5be00e,_0x273ecb){return db['ChatInternalMessage'][_0xc732('0x49')]({'where':{'id':_0x5be00e[_0xc732('0x48')]['id']}})['then'](handleEntityNotFound(_0x273ecb,null))[_0xc732('0x28')](removeEntity(_0x273ecb,null))[_0xc732('0x46')](handleError(_0x273ecb,null));};exports['describe']=function(_0x19e28b,_0x46c7bf){return db['ChatInternalMessage'][_0xc732('0x4c')]()[_0xc732('0x28')](respondWithResult(_0x46c7bf,null))[_0xc732('0x46')](handleError(_0x46c7bf,null));};function wrapUser(_0xc7f5ef){return function(_0x547934){var _0xb06ee9=_0xc7f5ef[_0xc732('0x4d')]({'plain':!![]});_0xb06ee9[_0xc732('0x4e')]=[];if(_0x547934){_0xb06ee9[_0xc732('0x4f')]=_0x547934[_0xc732('0x50')];_0xb06ee9[_0xc732('0x51')]=_0x547934;}else{_0xb06ee9[_0xc732('0x4f')]=moment(0x0)[_0xc732('0x52')](_0xc732('0x53'));_0xb06ee9[_0xc732('0x51')]={};}return _0xb06ee9;};}exports[_0xc732('0x54')]=function(_0x869538,_0x3c37c2,_0x25661e){var _0x4d77cd=[];return db[_0xc732('0x55')]['findAll']({'where':{'role':[_0xc732('0x56'),_0xc732('0x57'),_0xc732('0x58')]},'attributes':['id',_0xc732('0x59'),_0xc732('0x2b'),_0xc732('0x5a'),_0xc732('0x5b'),_0xc732('0x5c'),_0xc732('0x5d'),_0xc732('0x5e'),_0xc732('0x5f'),'showWebBar'],'order':qs['sort'](_0xc732('0x60')),'include':[{'model':db[_0xc732('0x61')],'as':_0xc732('0x62'),'attributes':['id',_0xc732('0x2b'),_0xc732('0x30')],'through':{'attributes':[]}}]})[_0xc732('0x28')](function(_0x3c73f0){if(_0x3c73f0){var _0x30a860=_0x869538[_0xc732('0x58')][_0xc732('0x4d')]({'plain':!![]});if(!_0x30a860)throw new Error(_0xc732('0x63'));if(_0x30a860['role']===_0xc732('0x58')){return db['UserProfileSection'][_0xc732('0x49')]({'where':{'name':_0xc732('0x64'),'userProfileId':_0x30a860['userProfileId']},'raw':!![]})['then'](function(_0x360052){if(_0x360052){if(_0x360052[_0xc732('0x65')]===0x0){return db[_0xc732('0x66')]['findAll']({'where':{'sectionId':_0x360052['id']},'raw':!![]})[_0xc732('0x28')](function(_0x587d0d){var _0x31775e=[];if(_['isEmpty'](_0x587d0d)){_0x31775e=_[_0xc732('0x40')](_0x3c73f0,function(_0x3fab79){if(_0x3fab79[_0xc732('0x5a')]!=='agent'){return _0x3fab79;}});return _0x31775e;}else{for(var _0x1bf2cb=0x0;_0x1bf2cb<_0x3c73f0['length'];_0x1bf2cb++){var _0x3b3cae=_0x3c73f0[_0x1bf2cb];if(_0x3b3cae[_0xc732('0x5a')]===_0xc732('0x56')){var _0x2e4adb=_[_0xc732('0x49')](_0x587d0d,function(_0x34ee62){return _0x34ee62[_0xc732('0x67')]===_0x3b3cae['id'];});if(_0x2e4adb)_0x31775e[_0xc732('0x68')](_0x3b3cae);}else{_0x31775e['push'](_0x3b3cae);}}return _0x31775e;}});}else{return _0x3c73f0;}}else{var _0x5a5a45=_[_0xc732('0x40')](_0x3c73f0,function(_0x54a1e0){if(_0x54a1e0[_0xc732('0x5a')]!==_0xc732('0x56')){return _0x54a1e0;}});return _0x5a5a45;}});}else{return _0x3c73f0;}}})[_0xc732('0x28')](function(_0xf07b58){var _0x29bbd9=[];if(_0xf07b58){_0x4d77cd=_0xf07b58;for(var _0x28bfc9=0x0;_0x28bfc9<_0xf07b58[_0xc732('0x39')];_0x28bfc9+=0x1){_0x4d77cd[_0x28bfc9]['messages']=[];_0x29bbd9[_0xc732('0x68')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x869538['user']['id'],_0xf07b58[_0x28bfc9]['id']],'ToId':[_0x869538[_0xc732('0x58')]['id'],_0xf07b58[_0x28bfc9]['id']],'ChatGroupId':null},'attributes':['id',_0xc732('0x50'),_0xc732('0x69'),_0xc732('0x6a'),_0xc732('0x6b'),_0xc732('0x4b')],'order':qs[_0xc732('0x3c')](_0xc732('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc732('0x28')](wrapUser(_0xf07b58[_0x28bfc9])));}return BPromise[_0xc732('0x6d')](_0x29bbd9);}return[];})['then'](function(_0x28d978){return{'rows':_0x28d978,'count':_0x28d978['length']};})[_0xc732('0x28')](respondWithResult(_0x3c37c2,null))['catch'](handleError(_0x3c37c2,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 66bff6e..af1d364 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 _0x5c82=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2305a0,_0x1b94d4){var _0x10eb73=function(_0x3f7e44){while(--_0x3f7e44){_0x2305a0['push'](_0x2305a0['shift']());}};_0x10eb73(++_0x1b94d4);}(_0x5c82,0x198));var _0x25c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c82[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x25c8('0x0'));var ChatInternalMessage=require(_0x25c8('0x1'))['db'][_0x25c8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x25c8('0x3')](0x0);var events={'afterCreate':_0x25c8('0x4'),'afterUpdate':_0x25c8('0x5'),'afterDestroy':_0x25c8('0x6')};function emitEvent(_0x2dced6){return function(_0x3167d2,_0x1dc4fd,_0x38d038){ChatInternalMessageEvents[_0x25c8('0x7')](_0x2dced6+':'+_0x3167d2['id'],_0x3167d2);ChatInternalMessageEvents[_0x25c8('0x7')](_0x2dced6,_0x3167d2);_0x38d038(null);};}for(var e in events){if(events[_0x25c8('0x8')](e)){var event=events[e];ChatInternalMessage[_0x25c8('0x9')](e,emitEvent(event));}}module[_0x25c8('0xa')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xff7c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4f295e,_0xa0e6b9){var _0x276fd5=function(_0x52fec9){while(--_0x52fec9){_0x4f295e['push'](_0x4f295e['shift']());}};_0x276fd5(++_0xa0e6b9);}(_0xff7c,0x1d4));var _0xcff7=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xff7c[_0x2adbeb];return _0x5e18a6;};'use strict';var EventEmitter=require(_0xcff7('0x0'));var ChatInternalMessage=require(_0xcff7('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcff7('0x2')](0x0);var events={'afterCreate':_0xcff7('0x3'),'afterUpdate':_0xcff7('0x4'),'afterDestroy':_0xcff7('0x5')};function emitEvent(_0x4c06dc){return function(_0x5a8ff2,_0x19739b,_0x513d1b){ChatInternalMessageEvents['emit'](_0x4c06dc+':'+_0x5a8ff2['id'],_0x5a8ff2);ChatInternalMessageEvents[_0xcff7('0x6')](_0x4c06dc,_0x5a8ff2);_0x513d1b(null);};}for(var e in events){if(events[_0xcff7('0x7')](e)){var event=events[e];ChatInternalMessage[_0xcff7('0x8')](e,emitEvent(event));}}module[_0xcff7('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 1e89329..c8af305 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 _0x9215=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x9215,0x168));var _0x5921=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9215[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5921('0x0'))(_0x5921('0x1'));var moment=require('moment');var BPromise=require(_0x5921('0x2'));var rp=require(_0x5921('0x3'));var fs=require('fs');var path=require(_0x5921('0x4'));var rimraf=require(_0x5921('0x5'));var config=require(_0x5921('0x6'));var attributes=require(_0x5921('0x7'));module[_0x5921('0x8')]=function(_0x2fb45e,_0x39aeb4){return _0x2fb45e[_0x5921('0x9')](_0x5921('0xa'),attributes,{'tableName':_0x5921('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5921('0xc'),'collate':_0x5921('0xd')});}; \ No newline at end of file +var _0xe61e=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x22e0f2,_0x1e029a){var _0x54fafc=function(_0x3e9071){while(--_0x3e9071){_0x22e0f2['push'](_0x22e0f2['shift']());}};_0x54fafc(++_0x1e029a);}(_0xe61e,0xef));var _0xee61=function(_0x21d1c7,_0x335222){_0x21d1c7=_0x21d1c7-0x0;var _0xdb87b0=_0xe61e[_0x21d1c7];return _0xdb87b0;};'use strict';var _=require(_0xee61('0x0'));var util=require(_0xee61('0x1'));var logger=require(_0xee61('0x2'))('api');var moment=require(_0xee61('0x3'));var BPromise=require(_0xee61('0x4'));var rp=require(_0xee61('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee61('0x6'));var config=require(_0xee61('0x7'));var attributes=require(_0xee61('0x8'));module[_0xee61('0x9')]=function(_0x57b6d1,_0x230eaf){return _0x57b6d1[_0xee61('0xa')](_0xee61('0xb'),attributes,{'tableName':_0xee61('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee61('0xd'),'collate':_0xee61('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 4e44e44..0d30bcd 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 _0xeb3a=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug'];(function(_0x4a0b68,_0x27200b){var _0x44ddd4=function(_0x184770){while(--_0x184770){_0x4a0b68['push'](_0x4a0b68['shift']());}};_0x44ddd4(++_0x27200b);}(_0xeb3a,0x12f));var _0xaeb3=function(_0x346b3f,_0x13a1fb){_0x346b3f=_0x346b3f-0x0;var _0x5a86f9=_0xeb3a[_0x346b3f];return _0x5a86f9;};'use strict';var _=require(_0xaeb3('0x0'));var util=require(_0xaeb3('0x1'));var moment=require(_0xaeb3('0x2'));var BPromise=require(_0xaeb3('0x3'));var rs=require(_0xaeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaeb3('0x5'));var logger=require(_0xaeb3('0x6'))(_0xaeb3('0x7'));var config=require(_0xaeb3('0x8'));var jayson=require(_0xaeb3('0x9'));var client=jayson[_0xaeb3('0xa')][_0xaeb3('0xb')]({'port':0x232a});config[_0xaeb3('0xc')]=_['defaults'](config[_0xaeb3('0xc')],{'host':_0xaeb3('0xd'),'port':0x18eb});var socket=require(_0xaeb3('0xe'))(new Redis(config[_0xaeb3('0xc')]));require(_0xaeb3('0xf'))[_0xaeb3('0x10')](socket);function respondWithRpcPromise(_0x15ca57,_0x1fb6fb,_0x39f53f){return new BPromise(function(_0x4e9a10,_0x48bc64){return client['request'](_0x15ca57,_0x39f53f)[_0xaeb3('0x11')](function(_0x2256a9){logger[_0xaeb3('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fb6fb,_0xaeb3('0x13'));logger[_0xaeb3('0x14')](_0xaeb3('0x15'),_0x1fb6fb,_0xaeb3('0x13'),JSON[_0xaeb3('0x16')](_0x2256a9));if(_0x2256a9[_0xaeb3('0x17')]){if(_0x2256a9['error']['code']===0x1f4){logger['error'](_0xaeb3('0x18'),_0x1fb6fb,_0x2256a9[_0xaeb3('0x17')][_0xaeb3('0x19')]);return _0x48bc64(_0x2256a9[_0xaeb3('0x17')][_0xaeb3('0x19')]);}logger[_0xaeb3('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fb6fb,_0x2256a9[_0xaeb3('0x17')][_0xaeb3('0x19')]);return _0x4e9a10(_0x2256a9['error']['message']);}else{logger[_0xaeb3('0x12')](_0xaeb3('0x18'),_0x1fb6fb,'request\x20sent');_0x4e9a10(_0x2256a9['result']['message']);}})[_0xaeb3('0x1a')](function(_0x23c2ae){logger[_0xaeb3('0x17')](_0xaeb3('0x18'),_0x1fb6fb,_0x23c2ae);_0x48bc64(_0x23c2ae);});});} \ No newline at end of file +var _0xe644=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x82e939,_0x3b4198){var _0x575d90=function(_0x23f1e9){while(--_0x23f1e9){_0x82e939['push'](_0x82e939['shift']());}};_0x575d90(++_0x3b4198);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});config[_0x4e64('0xc')]=_[_0x4e64('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4e64('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x4e64('0xf')](socket);function respondWithRpcPromise(_0x43ba47,_0x4323bb,_0x30ed02){return new BPromise(function(_0x21d454,_0xcbcafb){return client['request'](_0x43ba47,_0x30ed02)[_0x4e64('0x10')](function(_0x1b2b5f){logger['info'](_0x4e64('0x11'),_0x4323bb,'request\x20sent');logger['debug'](_0x4e64('0x12'),_0x4323bb,'request\x20sent',JSON[_0x4e64('0x13')](_0x1b2b5f));if(_0x1b2b5f[_0x4e64('0x14')]){if(_0x1b2b5f[_0x4e64('0x14')][_0x4e64('0x15')]===0x1f4){logger[_0x4e64('0x14')](_0x4e64('0x11'),_0x4323bb,_0x1b2b5f[_0x4e64('0x14')]['message']);return _0xcbcafb(_0x1b2b5f[_0x4e64('0x14')][_0x4e64('0x16')]);}logger[_0x4e64('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x4323bb,_0x1b2b5f[_0x4e64('0x14')][_0x4e64('0x16')]);return _0x21d454(_0x1b2b5f[_0x4e64('0x14')][_0x4e64('0x16')]);}else{logger[_0x4e64('0x17')](_0x4e64('0x11'),_0x4323bb,_0x4e64('0x18'));_0x21d454(_0x1b2b5f[_0x4e64('0x19')][_0x4e64('0x16')]);}})[_0x4e64('0x1a')](function(_0x54d0ca){logger[_0x4e64('0x14')](_0x4e64('0x11'),_0x4323bb,_0x54d0ca);_0xcbcafb(_0x54d0ca);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index fae57c8..b498cf0 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 _0x9917=['save','remove','update','emit','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x9917,0xc3));var _0x7991=function(_0x4ded65,_0x5efebb){_0x4ded65=_0x4ded65-0x0;var _0x34dc14=_0x9917[_0x4ded65];return _0x34dc14;};'use strict';var ChatInternalMessageEvents=require(_0x7991('0x0'));var events=[_0x7991('0x1'),_0x7991('0x2'),_0x7991('0x3')];function createListener(_0x4b7045,_0x2a136b){return function(_0x20b1ca){_0x2a136b[_0x7991('0x4')](_0x4b7045,_0x20b1ca);};}function removeListener(_0x39db74,_0x4657b4){return function(){ChatInternalMessageEvents['removeListener'](_0x39db74,_0x4657b4);};}exports['register']=function(_0x3051c4){for(var _0x2a1950=0x0,_0x183fc5=events[_0x7991('0x5')];_0x2a1950<_0x183fc5;_0x2a1950++){var _0x3c98fd=events[_0x2a1950];var _0x43f5ee=createListener(_0x7991('0x6')+_0x3c98fd,_0x3051c4);ChatInternalMessageEvents['on'](_0x3c98fd,_0x43f5ee);}}; \ No newline at end of file +var _0xb2f5=['remove','update','emit','removeListener','register','length','chatInternalMessage:','save'];(function(_0x243158,_0x554df0){var _0x142fa9=function(_0x23b2e5){while(--_0x23b2e5){_0x243158['push'](_0x243158['shift']());}};_0x142fa9(++_0x554df0);}(_0xb2f5,0x1e7));var _0x5b2f=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xb2f5[_0xd09668];return _0x68726;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5b2f('0x0'),_0x5b2f('0x1'),_0x5b2f('0x2')];function createListener(_0x86bf65,_0x1bee99){return function(_0x147dd1){_0x1bee99[_0x5b2f('0x3')](_0x86bf65,_0x147dd1);};}function removeListener(_0x1add8d,_0x73957d){return function(){ChatInternalMessageEvents[_0x5b2f('0x4')](_0x1add8d,_0x73957d);};}exports[_0x5b2f('0x5')]=function(_0x2db5fc){for(var _0x1e97bb=0x0,_0x524aa3=events[_0x5b2f('0x6')];_0x1e97bb<_0x524aa3;_0x1e97bb++){var _0x471e71=events[_0x1e97bb];var _0x5d2287=createListener(_0x5b2f('0x7')+_0x471e71,_0x2db5fc);ChatInternalMessageEvents['on'](_0x471e71,_0x5d2287);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 0f7e162..4a68a76 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 _0xc650=['getUsers','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1599cb,_0x5bb2e2){var _0x1b4c09=function(_0x42d6df){while(--_0x42d6df){_0x1599cb['push'](_0x1599cb['shift']());}};_0x1b4c09(++_0x5bb2e2);}(_0xc650,0xb1));var _0x0c65=function(_0x5b7cdf,_0x158fac){_0x5b7cdf=_0x5b7cdf-0x0;var _0x586e70=_0xc650[_0x5b7cdf];return _0x586e70;};'use strict';var multer=require(_0x0c65('0x0'));var util=require(_0x0c65('0x1'));var path=require(_0x0c65('0x2'));var timeout=require(_0x0c65('0x3'));var express=require(_0x0c65('0x4'));var router=express[_0x0c65('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0c65('0x6'));var interaction=require(_0x0c65('0x7'));var config=require(_0x0c65('0x8'));var controller=require(_0x0c65('0x9'));router[_0x0c65('0xa')]('/',auth[_0x0c65('0xb')](),controller[_0x0c65('0xc')]);router['get'](_0x0c65('0xd'),auth[_0x0c65('0xb')](),controller[_0x0c65('0xe')]);router[_0x0c65('0xa')]('/users',auth['isAuthenticated'](),controller[_0x0c65('0xf')]);router[_0x0c65('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0c65('0x10')]);router['post']('/',auth[_0x0c65('0xb')](),controller[_0x0c65('0x11')]);router[_0x0c65('0x12')](_0x0c65('0x13'),controller[_0x0c65('0x14')]);router[_0x0c65('0x15')](_0x0c65('0x13'),auth[_0x0c65('0xb')](),controller[_0x0c65('0x16')]);module[_0x0c65('0x17')]=router; \ No newline at end of file +var _0xb19e=['show','create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','describe','/users','getUsers','/:id'];(function(_0x17f50e,_0xdc24a){var _0x365e53=function(_0x373c66){while(--_0x373c66){_0x17f50e['push'](_0x17f50e['shift']());}};_0x365e53(++_0xdc24a);}(_0xb19e,0x92));var _0xeb19=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0xb19e[_0x555069];return _0x100af7;};'use strict';var multer=require(_0xeb19('0x0'));var util=require(_0xeb19('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeb19('0x2'));var router=express[_0xeb19('0x3')]();var fs_extra=require(_0xeb19('0x4'));var auth=require(_0xeb19('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeb19('0x6'));var controller=require(_0xeb19('0x7'));router[_0xeb19('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeb19('0x8')]('/describe',auth[_0xeb19('0x9')](),controller[_0xeb19('0xa')]);router[_0xeb19('0x8')](_0xeb19('0xb'),auth['isAuthenticated'](),controller[_0xeb19('0xc')]);router['get'](_0xeb19('0xd'),auth[_0xeb19('0x9')](),controller[_0xeb19('0xe')]);router['post']('/',auth[_0xeb19('0x9')](),controller[_0xeb19('0xf')]);router[_0xeb19('0x10')](_0xeb19('0xd'),controller[_0xeb19('0x11')]);router[_0xeb19('0x12')](_0xeb19('0xd'),auth[_0xeb19('0x9')](),controller['destroy']);module[_0xeb19('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 947075a..0eeb9f6 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 _0x7a40=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x7a40,0x197));var _0x07a4=function(_0x26dc8e,_0x140d10){_0x26dc8e=_0x26dc8e-0x0;var _0x232e40=_0x7a40[_0x26dc8e];return _0x232e40;};'use strict';var Sequelize=require(_0x07a4('0x0'));module[_0x07a4('0x1')]={'body':{'type':Sequelize[_0x07a4('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x07a4('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x07a4('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x07a4('0x4')]('in',_0x07a4('0x5')),'defaultValue':_0x07a4('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x07a4('0x6')]},'providerResponse':{'type':Sequelize[_0x07a4('0x2')]}}; \ No newline at end of file +var _0x5eef=['TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5eef,0x9c));var _0xf5ee=function(_0x1f1e4b,_0x9892de){_0x1f1e4b=_0x1f1e4b-0x0;var _0x56a635=_0x5eef[_0x1f1e4b];return _0x56a635;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xf5ee('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf5ee('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf5ee('0x2')]('in',_0xf5ee('0x3')),'defaultValue':_0xf5ee('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf5ee('0x4')]},'providerName':{'type':Sequelize[_0xf5ee('0x5')]},'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 686fb0f..3ebcdf5 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 _0x47f7=['[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','Sequelize','interface','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','end','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','update','destroy','describe','../../config/logger','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId'];(function(_0x4db392,_0x2c1aec){var _0x399526=function(_0x5c078f){while(--_0x5c078f){_0x4db392['push'](_0x4db392['shift']());}};_0x399526(++_0x2c1aec);}(_0x47f7,0x199));var _0x747f=function(_0x10045d,_0x3685c4){_0x10045d=_0x10045d-0x0;var _0x474a74=_0x47f7[_0x10045d];return _0x474a74;};'use strict';var emlformat=require(_0x747f('0x0'));var rimraf=require(_0x747f('0x1'));var zipdir=require(_0x747f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x747f('0x3'));var moment=require('moment');var BPromise=require(_0x747f('0x4'));var Mustache=require(_0x747f('0x5'));var util=require(_0x747f('0x6'));var path=require(_0x747f('0x7'));var sox=require(_0x747f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x747f('0x9'));var squel=require(_0x747f('0xa'));var crypto=require(_0x747f('0xb'));var jsforce=require(_0x747f('0xc'));var deskjs=require(_0x747f('0xd'));var toCsv=require(_0x747f('0xe'));var querystring=require(_0x747f('0xf'));var Papa=require('papaparse');var Redis=require(_0x747f('0x10'));var authService=require(_0x747f('0x11'));var qs=require(_0x747f('0x12'));var as=require(_0x747f('0x13'));var hardwareService=require(_0x747f('0x14'));var logger=require('../../config/logger')(_0x747f('0x15'));var utils=require(_0x747f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x747f('0x17'))['db'];config['redis']=_['defaults'](config[_0x747f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x747f('0x19'))(new Redis(config[_0x747f('0x18')]));require(_0x747f('0x1a'))[_0x747f('0x1b')](socket);var jayson=require(_0x747f('0x1c'));var client=jayson[_0x747f('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x747f('0x1d')][_0x747f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x32797f,_0x2b0cbf,_0x154512,_0x359984){return new BPromise(function(_0x10cab8,_0x79a8a2){var _0x49a8cd=_0x359984||client;return _0x49a8cd[_0x747f('0x1f')](_0x32797f,_0x154512)[_0x747f('0x20')](function(_0x5d8bef){logger[_0x747f('0x21')](_0x747f('0x22'),_0x2b0cbf,_0x747f('0x23'));logger[_0x747f('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2b0cbf,_0x747f('0x23'),JSON[_0x747f('0x25')](_0x5d8bef));if(_0x5d8bef[_0x747f('0x26')]){if(_0x5d8bef[_0x747f('0x26')]['code']===0x1f4){logger[_0x747f('0x26')](_0x747f('0x22'),_0x2b0cbf,_0x5d8bef['error']['message']);return _0x79a8a2(_0x5d8bef[_0x747f('0x26')][_0x747f('0x27')]);}logger[_0x747f('0x26')]('ChatMessage,\x20%s,\x20%s',_0x2b0cbf,_0x5d8bef['error'][_0x747f('0x27')]);return _0x10cab8(_0x5d8bef['error'][_0x747f('0x27')]);}else{logger[_0x747f('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2b0cbf,'request\x20sent');_0x10cab8(_0x5d8bef[_0x747f('0x28')][_0x747f('0x27')]);}})[_0x747f('0x29')](function(_0x103ce5){logger[_0x747f('0x26')](_0x747f('0x22'),_0x2b0cbf,_0x103ce5);_0x79a8a2(_0x103ce5);});});}function respondWithStatusCode(_0x90ed51,_0x4d254c){_0x4d254c=_0x4d254c||0xcc;return function(_0x23f95a){if(_0x23f95a){return _0x90ed51[_0x747f('0x2a')](_0x4d254c);}return _0x90ed51[_0x747f('0x2b')](_0x4d254c)['end']();};}function respondWithResult(_0x30921c,_0xe4b3f4){_0xe4b3f4=_0xe4b3f4||0xc8;return function(_0x15cb66){if(_0x15cb66){return _0x30921c[_0x747f('0x2b')](_0xe4b3f4)[_0x747f('0x2c')](_0x15cb66);}};}function respondWithFilteredResult(_0x15721b,_0x9a0b73){return function(_0x2c589a){if(_0x2c589a){var _0x19334d=typeof _0x9a0b73[_0x747f('0x2d')]===_0x747f('0x2e')&&typeof _0x9a0b73[_0x747f('0x2f')]===_0x747f('0x2e');var _0x367e3c=_0x2c589a[_0x747f('0x30')];var _0x3b01ff=_0x19334d?0x0:_0x9a0b73[_0x747f('0x2d')];var _0x128766=_0x19334d?_0x2c589a[_0x747f('0x30')]:_0x9a0b73[_0x747f('0x2d')]+_0x9a0b73['limit'];var _0x4511d5;if(_0x128766>=_0x367e3c){_0x128766=_0x367e3c;_0x4511d5=0xc8;}else{_0x4511d5=0xce;}_0x15721b[_0x747f('0x2b')](_0x4511d5);return _0x15721b[_0x747f('0x31')](_0x747f('0x32'),_0x3b01ff+'-'+_0x128766+'/'+_0x367e3c)[_0x747f('0x2c')](_0x2c589a);}return null;};}function patchUpdates(_0xa7f79f){return function(_0x225bbf){try{jsonpatch[_0x747f('0x33')](_0x225bbf,_0xa7f79f,!![]);}catch(_0xad07e){return BPromise[_0x747f('0x34')](_0xad07e);}return _0x225bbf['save']();};}function saveUpdates(_0x159e8f,_0x2b046c){return function(_0x1a9c38){if(_0x1a9c38){return _0x1a9c38['update'](_0x159e8f)['then'](function(_0x5c6db7){return _0x5c6db7;});}return null;};}function removeEntity(_0x59f9f5,_0x1a10ba){return function(_0x4e182b){if(_0x4e182b){return _0x4e182b['destroy']()[_0x747f('0x20')](function(){_0x59f9f5[_0x747f('0x2b')](0xcc)[_0x747f('0x35')]();});}};}function handleEntityNotFound(_0x386fdc,_0x820067){return function(_0x16f1ad){if(!_0x16f1ad){_0x386fdc[_0x747f('0x2a')](0x194);}return _0x16f1ad;};}function handleError(_0x23871e,_0x253959){_0x253959=_0x253959||0x1f4;return function(_0x106a36){logger['error'](_0x106a36[_0x747f('0x36')]);if(_0x106a36[_0x747f('0x37')]){delete _0x106a36['name'];}_0x23871e[_0x747f('0x2b')](_0x253959)['send'](_0x106a36);};}exports[_0x747f('0x38')]=function(_0x144e63,_0x22a802){var _0x525af6={},_0x58d718={},_0x2d3373={'count':0x0,'rows':[]};var _0x235d44=_[_0x747f('0x39')](db[_0x747f('0x3a')][_0x747f('0x3b')],function(_0x1d0610){return{'name':_0x1d0610[_0x747f('0x3c')],'type':_0x1d0610[_0x747f('0x3d')]['key']};});_0x58d718[_0x747f('0x3e')]=_['map'](_0x235d44,_0x747f('0x37'));_0x58d718[_0x747f('0x3f')]=_[_0x747f('0x40')](_0x144e63['query']);_0x58d718[_0x747f('0x41')]=_[_0x747f('0x42')](_0x58d718[_0x747f('0x3e')],_0x58d718['query']);_0x525af6[_0x747f('0x43')]=_[_0x747f('0x42')](_0x58d718['model'],qs[_0x747f('0x44')](_0x144e63[_0x747f('0x3f')][_0x747f('0x44')]));_0x525af6[_0x747f('0x43')]=_0x525af6['attributes'][_0x747f('0x45')]?_0x525af6[_0x747f('0x43')]:_0x58d718['model'];if(!_0x144e63['query']['hasOwnProperty'](_0x747f('0x46'))){_0x525af6[_0x747f('0x2f')]=qs['limit'](_0x144e63['query']['limit']);_0x525af6[_0x747f('0x2d')]=qs[_0x747f('0x2d')](_0x144e63['query'][_0x747f('0x2d')]);}_0x525af6[_0x747f('0x47')]=qs[_0x747f('0x48')](_0x144e63[_0x747f('0x3f')][_0x747f('0x48')]);_0x525af6[_0x747f('0x49')]=qs[_0x747f('0x41')](_[_0x747f('0x4a')](_0x144e63[_0x747f('0x3f')],_0x58d718[_0x747f('0x41')]),_0x235d44);if(_0x144e63[_0x747f('0x3f')][_0x747f('0x4b')]){_0x525af6['where']=_[_0x747f('0x4c')](_0x525af6[_0x747f('0x49')],{'$or':_['map'](_0x235d44,function(_0x175852){if(_0x175852[_0x747f('0x3d')]!==_0x747f('0x4d')){var _0x11682d={};_0x11682d[_0x175852[_0x747f('0x37')]]={'$like':'%'+_0x144e63[_0x747f('0x3f')]['filter']+'%'};return _0x11682d;}})});}_0x525af6=_['merge']({},_0x525af6,_0x144e63['options']);var _0x4ba5c1={'where':_0x525af6['where']};return db[_0x747f('0x3a')]['count'](_0x4ba5c1)['then'](function(_0x2edefe){_0x2d3373['count']=_0x2edefe;if(_0x144e63[_0x747f('0x3f')][_0x747f('0x4e')]){_0x525af6[_0x747f('0x4f')]=[{'all':!![]}];}return db[_0x747f('0x3a')][_0x747f('0x50')](_0x525af6);})[_0x747f('0x20')](function(_0x246e1a){_0x2d3373[_0x747f('0x51')]=_0x246e1a;return _0x2d3373;})[_0x747f('0x20')](respondWithFilteredResult(_0x22a802,_0x525af6))[_0x747f('0x29')](handleError(_0x22a802,null));};exports[_0x747f('0x52')]=function(_0x5a3926,_0x3f859c){var _0x3d12ef={'raw':!![],'where':{'id':_0x5a3926[_0x747f('0x53')]['id']}},_0x19de15={};_0x19de15[_0x747f('0x3e')]=_[_0x747f('0x40')](db['ChatMessage'][_0x747f('0x3b')]);_0x19de15[_0x747f('0x3f')]=_[_0x747f('0x40')](_0x5a3926[_0x747f('0x3f')]);_0x19de15[_0x747f('0x41')]=_['intersection'](_0x19de15[_0x747f('0x3e')],_0x19de15[_0x747f('0x3f')]);_0x3d12ef[_0x747f('0x43')]=_[_0x747f('0x42')](_0x19de15[_0x747f('0x3e')],qs[_0x747f('0x44')](_0x5a3926[_0x747f('0x3f')][_0x747f('0x44')]));_0x3d12ef['attributes']=_0x3d12ef[_0x747f('0x43')][_0x747f('0x45')]?_0x3d12ef['attributes']:_0x19de15[_0x747f('0x3e')];if(_0x5a3926[_0x747f('0x3f')][_0x747f('0x4e')]){_0x3d12ef[_0x747f('0x4f')]=[{'all':!![]}];}_0x3d12ef=_['merge']({},_0x3d12ef,_0x5a3926[_0x747f('0x54')]);return db[_0x747f('0x3a')][_0x747f('0x55')](_0x3d12ef)[_0x747f('0x20')](handleEntityNotFound(_0x3f859c,null))[_0x747f('0x20')](respondWithResult(_0x3f859c,null))[_0x747f('0x29')](handleError(_0x3f859c,null));};exports['create']=function(_0x254a4d,_0x58a2e5){return db[_0x747f('0x3a')][_0x747f('0x56')](_0x254a4d[_0x747f('0x57')],{})[_0x747f('0x20')](respondWithResult(_0x58a2e5,0xc9))[_0x747f('0x29')](handleError(_0x58a2e5,null));};exports[_0x747f('0x58')]=function(_0x4db980,_0x5a2e9c){if(_0x4db980['body']['id']){delete _0x4db980[_0x747f('0x57')]['id'];}return db['ChatMessage'][_0x747f('0x55')]({'where':{'id':_0x4db980[_0x747f('0x53')]['id']}})[_0x747f('0x20')](handleEntityNotFound(_0x5a2e9c,null))[_0x747f('0x20')](saveUpdates(_0x4db980[_0x747f('0x57')],null))[_0x747f('0x20')](respondWithResult(_0x5a2e9c,null))['catch'](handleError(_0x5a2e9c,null));};exports[_0x747f('0x59')]=function(_0x27205d,_0x45ec73){return db[_0x747f('0x3a')][_0x747f('0x55')]({'where':{'id':_0x27205d[_0x747f('0x53')]['id']}})['then'](handleEntityNotFound(_0x45ec73,null))[_0x747f('0x20')](removeEntity(_0x45ec73,null))[_0x747f('0x29')](handleError(_0x45ec73,null));};exports[_0x747f('0x5a')]=function(_0x9b2ff5,_0x16fd3d){return db[_0x747f('0x3a')][_0x747f('0x5a')]()[_0x747f('0x20')](respondWithResult(_0x16fd3d,null))[_0x747f('0x29')](handleError(_0x16fd3d,null));};var interaction_log=require(_0x747f('0x5b'))(_0x747f('0x5c'));exports[_0x747f('0x5d')]=function(_0x4ae907,_0x2594bf,_0x187b53){var _0x30faae={'agent':{},'channel':_0x747f('0x5e')};if(_0x4ae907[_0x747f('0x57')]['id']){delete _0x4ae907[_0x747f('0x57')]['id'];}_0x4ae907['body']['read']=!![];_0x4ae907[_0x747f('0x57')]['readAt']=moment()[_0x747f('0x5f')](_0x747f('0x60'));_0x4ae907[_0x747f('0x57')]['UserId']=_0x4ae907['body'][_0x747f('0x61')]||_0x4ae907[_0x747f('0x62')]['id'];_0x30faae[_0x747f('0x63')]['id']=_0x4ae907[_0x747f('0x57')]['UserId'];return db[_0x747f('0x3a')]['find']({'where':{'id':_0x4ae907[_0x747f('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2594bf,null))[_0x747f('0x20')](saveUpdates(_0x4ae907[_0x747f('0x57')],null))[_0x747f('0x20')](function(_0x3c417b){if(_0x3c417b){_0x30faae[_0x747f('0x27')]=_0x3c417b[_0x747f('0x64')]({'plain':!![]});return db[_0x747f('0x65')][_0x747f('0x55')]({'where':{'id':_0x3c417b['ChatInteractionId']}});}return null;})[_0x747f('0x20')](handleEntityNotFound(_0x2594bf,null))[_0x747f('0x20')](function(_0x5826bc){if(_0x5826bc){return _0x5826bc['update']({'UserId':_0x4ae907[_0x747f('0x57')]['UserId'],'read1stAt':_[_0x747f('0x66')](_0x5826bc['read1stAt'])?moment()[_0x747f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1c26a7){if(_0x1c26a7){_0x30faae['interaction']=_0x1c26a7[_0x747f('0x64')]({'plain':!![]});interaction_log['info'](_0x747f('0x67'),_0x4ae907[_0x747f('0x62')]['id'],_0x4ae907[_0x747f('0x62')][_0x747f('0x37')],_0x4ae907[_0x747f('0x62')][_0x747f('0x68')],_0x30faae[_0x747f('0x69')]['id'],_0x4ae907[_0x747f('0x57')]?JSON[_0x747f('0x25')](_0x4ae907[_0x747f('0x57')]):'null');return respondWithRpcPromise(_0x747f('0x6a'),_0x747f('0x6b'),_0x30faae);}return null;})['then'](function(_0x5968b3){var _0xdc5b92=_0x747f('0x6c')+_0x5968b3['message'][_0x747f('0x6d')];return db[_0x747f('0x6e')][_0x747f('0x3f')](_0xdc5b92,{'type':db['Sequelize'][_0x747f('0x6f')][_0x747f('0x70')],'raw':!![]})[_0x747f('0x20')](function(_0x258152){return _0x258152;});})['then'](function(_0x3fc842){if(_0x3fc842){_0x30faae['message'][_0x747f('0x71')]=_0x3fc842[0x0];if(!_0x4ae907[_0x747f('0x57')][_0x747f('0x61')])return;return db[_0x747f('0x72')][_0x747f('0x55')]({'where':{'id':_0x4ae907[_0x747f('0x57')][_0x747f('0x61')],'role':_0x747f('0x63')},'attributes':['id',_0x747f('0x37'),_0x747f('0x73'),_0x747f('0x74'),_0x747f('0x75')],'raw':!![]});}return null;})[_0x747f('0x20')](function(_0x40867c){if(!_0x40867c)return null;_0x30faae[_0x747f('0x27')][_0x747f('0x63')]=_0x40867c;return _0x30faae;})[_0x747f('0x20')](function(_0x3fecc5){if(_0x3fecc5){if(_0x4ae907[_0x747f('0x57')][_0x747f('0x76')]){_0x30faae[_0x747f('0x27')]['interface']=util[_0x747f('0x5f')](_0x747f('0x77'),_0x4ae907['user'][_0x747f('0x37')]);_0x30faae[_0x747f('0x27')][_0x747f('0x78')]=_0x30faae['channel'];_0x30faae[_0x747f('0x27')]['motionChannel']=_0x30faae[_0x747f('0x78')];_0x30faae[_0x747f('0x27')][_0x747f('0x79')]=_0x747f('0x5d');return respondWithRpcPromise(_0x747f('0x7a'),_0x747f('0x7a'),{'event':_0x747f('0x7b'),'message':_['merge'](_0x30faae[_0x747f('0x27')],JSON[_0x747f('0x7c')](_0x30faae[_0x747f('0x69')][_0x747f('0x7d')]))},client9002)[_0x747f('0x20')](function(){return _0x30faae;});}return _0x30faae;}return null;})[_0x747f('0x20')](respondWithResult(_0x2594bf,null))['catch'](handleError(_0x2594bf,null));};var interaction_log=require(_0x747f('0x5b'))(_0x747f('0x5c'));exports[_0x747f('0x34')]=function(_0x382535,_0x211d06,_0x52c127){var _0x43d880={'agent':{},'channel':'chat'};if(_0x382535[_0x747f('0x57')]['id']){delete _0x382535['body']['id'];}_0x382535[_0x747f('0x57')][_0x747f('0x61')]=_0x382535[_0x747f('0x57')][_0x747f('0x61')]||_0x382535[_0x747f('0x62')]['id'];_0x43d880['agent']['id']=_0x382535['body'][_0x747f('0x61')];return db[_0x747f('0x3a')][_0x747f('0x55')]({'where':{'id':_0x382535[_0x747f('0x53')]['id'],'UserId':null}})[_0x747f('0x20')](handleEntityNotFound(_0x211d06,null))[_0x747f('0x20')](function(_0xcb339b){if(_0xcb339b){_0x43d880[_0x747f('0x27')]=_0xcb339b[_0x747f('0x64')]({'plain':!![]});return db[_0x747f('0x65')][_0x747f('0x55')]({'where':{'id':_0xcb339b[_0x747f('0x7e')]}});}return null;})[_0x747f('0x20')](handleEntityNotFound(_0x211d06,null))['then'](function(_0x207aef){if(_0x207aef){_0x43d880['interaction']=_0x207aef['get']({'plain':!![]});interaction_log['info'](_0x747f('0x7f'),_0x382535[_0x747f('0x62')]['id'],_0x382535[_0x747f('0x62')]['name'],_0x382535['user']['role'],_0x43d880[_0x747f('0x69')]['id'],_0x382535[_0x747f('0x57')]?JSON[_0x747f('0x25')](_0x382535['body']):_0x747f('0x80'));return respondWithRpcPromise('RejectMessage',_0x747f('0x81'),_0x43d880);}return null;})[_0x747f('0x20')](function(_0x14c80b){var _0xfd4aab=_0x747f('0x6c')+_0x14c80b['message']['ContactId'];return db[_0x747f('0x6e')]['query'](_0xfd4aab,{'type':db[_0x747f('0x82')][_0x747f('0x6f')][_0x747f('0x70')],'raw':!![]})[_0x747f('0x20')](function(_0x501a88){return _0x501a88;});})[_0x747f('0x20')](function(_0x540058){if(_0x540058){_0x43d880[_0x747f('0x27')][_0x747f('0x71')]=_0x540058[0x0];if(!_0x382535['body']['UserId'])return;return db['User'][_0x747f('0x55')]({'where':{'id':_0x382535['body']['UserId'],'role':_0x747f('0x63')},'attributes':['id',_0x747f('0x37'),_0x747f('0x73'),'email','internal'],'raw':!![]});}return null;})[_0x747f('0x20')](function(_0x416ed0){if(!_0x416ed0)return null;_0x43d880[_0x747f('0x27')][_0x747f('0x63')]=_0x416ed0;return _0x43d880;})[_0x747f('0x20')](function(_0x4cfce6){if(_0x4cfce6){_0x4cfce6[_0x747f('0x27')][_0x747f('0x83')]=util[_0x747f('0x5f')](_0x747f('0x77'),_0x382535['user'][_0x747f('0x37')]);_0x4cfce6['message'][_0x747f('0x78')]=_0x43d880[_0x747f('0x78')];_0x4cfce6[_0x747f('0x27')][_0x747f('0x84')]=_0x43d880[_0x747f('0x78')];_0x4cfce6['message']['event']=_0x747f('0x34');respondWithRpcPromise('EventManager',_0x747f('0x7a'),{'event':_0x747f('0x85'),'message':_[_0x747f('0x4c')](_0x43d880[_0x747f('0x27')],JSON['parse'](_0x43d880[_0x747f('0x69')]['formData']))},client9002);return _0x43d880;}return null;})[_0x747f('0x20')](respondWithResult(_0x211d06,null))[_0x747f('0x29')](handleError(_0x211d06,null));}; \ No newline at end of file +var _0xc8c4=['[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','ChatInteraction','ChatInteractionId','rejectMessage','QueryTypes','SELECT','fullname','eml-format','fast-json-patch','request-promise','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/environment','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','client','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','intersection','create','body','find','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','interaction'];(function(_0x1af7b8,_0xe3c8c7){var _0x480ef8=function(_0xa92b89){while(--_0xa92b89){_0x1af7b8['push'](_0x1af7b8['shift']());}};_0x480ef8(++_0xe3c8c7);}(_0xc8c4,0x193));var _0x4c8c=function(_0x20a573,_0x3328b4){_0x20a573=_0x20a573-0x0;var _0x399adf=_0xc8c4[_0x20a573];return _0x399adf;};'use strict';var emlformat=require(_0x4c8c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4c8c('0x1'));var rp=require(_0x4c8c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4c8c('0x3'));var path=require(_0x4c8c('0x4'));var sox=require(_0x4c8c('0x5'));var csv=require(_0x4c8c('0x6'));var ejs=require(_0x4c8c('0x7'));var fs=require('fs');var fs_extra=require(_0x4c8c('0x8'));var _=require('lodash');var squel=require(_0x4c8c('0x9'));var crypto=require(_0x4c8c('0xa'));var jsforce=require(_0x4c8c('0xb'));var deskjs=require(_0x4c8c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4c8c('0xd'));var Papa=require(_0x4c8c('0xe'));var Redis=require(_0x4c8c('0xf'));var authService=require(_0x4c8c('0x10'));var qs=require(_0x4c8c('0x11'));var as=require(_0x4c8c('0x12'));var hardwareService=require(_0x4c8c('0x13'));var logger=require(_0x4c8c('0x14'))(_0x4c8c('0x15'));var utils=require('../../config/utils');var config=require(_0x4c8c('0x16'));var licenseUtil=require(_0x4c8c('0x17'));var db=require('../../mysqldb')['db'];config[_0x4c8c('0x18')]=_[_0x4c8c('0x19')](config[_0x4c8c('0x18')],{'host':_0x4c8c('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c8c('0x18')]));require(_0x4c8c('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4c8c('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0xce524,_0x83c1f0,_0x407229,_0x150030){return new BPromise(function(_0x208ce1,_0x1071ff){var _0x5784b2=_0x150030||client;return _0x5784b2[_0x4c8c('0x1d')](_0xce524,_0x407229)[_0x4c8c('0x1e')](function(_0x2d4347){logger[_0x4c8c('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x83c1f0,_0x4c8c('0x20'));logger[_0x4c8c('0x21')](_0x4c8c('0x22'),_0x83c1f0,_0x4c8c('0x20'),JSON[_0x4c8c('0x23')](_0x2d4347));if(_0x2d4347[_0x4c8c('0x24')]){if(_0x2d4347[_0x4c8c('0x24')]['code']===0x1f4){logger[_0x4c8c('0x24')](_0x4c8c('0x25'),_0x83c1f0,_0x2d4347[_0x4c8c('0x24')][_0x4c8c('0x26')]);return _0x1071ff(_0x2d4347['error']['message']);}logger[_0x4c8c('0x24')](_0x4c8c('0x25'),_0x83c1f0,_0x2d4347[_0x4c8c('0x24')][_0x4c8c('0x26')]);return _0x208ce1(_0x2d4347[_0x4c8c('0x24')][_0x4c8c('0x26')]);}else{logger[_0x4c8c('0x1f')](_0x4c8c('0x25'),_0x83c1f0,'request\x20sent');_0x208ce1(_0x2d4347[_0x4c8c('0x27')]['message']);}})[_0x4c8c('0x28')](function(_0x4f805d){logger[_0x4c8c('0x24')](_0x4c8c('0x25'),_0x83c1f0,_0x4f805d);_0x1071ff(_0x4f805d);});});}function respondWithStatusCode(_0x5be6b0,_0x38035c){_0x38035c=_0x38035c||0xcc;return function(_0x99359b){if(_0x99359b){return _0x5be6b0['sendStatus'](_0x38035c);}return _0x5be6b0['status'](_0x38035c)[_0x4c8c('0x29')]();};}function respondWithResult(_0xbaec20,_0x385e59){_0x385e59=_0x385e59||0xc8;return function(_0x585b4e){if(_0x585b4e){return _0xbaec20['status'](_0x385e59)[_0x4c8c('0x2a')](_0x585b4e);}};}function respondWithFilteredResult(_0xe8f3d,_0x1bfb16){return function(_0x268a04){if(_0x268a04){var _0x31e20e=typeof _0x1bfb16['offset']==='undefined'&&typeof _0x1bfb16[_0x4c8c('0x2b')]===_0x4c8c('0x2c');var _0x412891=_0x268a04[_0x4c8c('0x2d')];var _0x100774=_0x31e20e?0x0:_0x1bfb16['offset'];var _0x44326d=_0x31e20e?_0x268a04[_0x4c8c('0x2d')]:_0x1bfb16[_0x4c8c('0x2e')]+_0x1bfb16['limit'];var _0x488a7d;if(_0x44326d>=_0x412891){_0x44326d=_0x412891;_0x488a7d=0xc8;}else{_0x488a7d=0xce;}_0xe8f3d['status'](_0x488a7d);return _0xe8f3d[_0x4c8c('0x2f')](_0x4c8c('0x30'),_0x100774+'-'+_0x44326d+'/'+_0x412891)['json'](_0x268a04);}return null;};}function patchUpdates(_0x12b5e9){return function(_0x3f9b12){try{jsonpatch[_0x4c8c('0x31')](_0x3f9b12,_0x12b5e9,!![]);}catch(_0x70bec0){return BPromise[_0x4c8c('0x32')](_0x70bec0);}return _0x3f9b12[_0x4c8c('0x33')]();};}function saveUpdates(_0x55a809,_0x53c074){return function(_0x15574a){if(_0x15574a){return _0x15574a[_0x4c8c('0x34')](_0x55a809)[_0x4c8c('0x1e')](function(_0x2b78a4){return _0x2b78a4;});}return null;};}function removeEntity(_0x2bfd1b,_0x5bced3){return function(_0x24074f){if(_0x24074f){return _0x24074f[_0x4c8c('0x35')]()['then'](function(){_0x2bfd1b[_0x4c8c('0x36')](0xcc)[_0x4c8c('0x29')]();});}};}function handleEntityNotFound(_0xf672fa,_0x134be7){return function(_0x5c1b96){if(!_0x5c1b96){_0xf672fa['sendStatus'](0x194);}return _0x5c1b96;};}function handleError(_0x524a78,_0x49f072){_0x49f072=_0x49f072||0x1f4;return function(_0x4bd144){logger['error'](_0x4bd144[_0x4c8c('0x37')]);if(_0x4bd144[_0x4c8c('0x38')]){delete _0x4bd144[_0x4c8c('0x38')];}_0x524a78['status'](_0x49f072)[_0x4c8c('0x39')](_0x4bd144);};}exports[_0x4c8c('0x3a')]=function(_0x26828e,_0x4460f6){var _0x524825={},_0x2403d2={},_0xbe6ca0={'count':0x0,'rows':[]};var _0x4a483c=_[_0x4c8c('0x3b')](db['ChatMessage'][_0x4c8c('0x3c')],function(_0x371831){return{'name':_0x371831[_0x4c8c('0x3d')],'type':_0x371831[_0x4c8c('0x3e')][_0x4c8c('0x3f')]};});_0x2403d2['model']=_[_0x4c8c('0x3b')](_0x4a483c,_0x4c8c('0x38'));_0x2403d2[_0x4c8c('0x40')]=_[_0x4c8c('0x41')](_0x26828e[_0x4c8c('0x40')]);_0x2403d2[_0x4c8c('0x42')]=_['intersection'](_0x2403d2[_0x4c8c('0x43')],_0x2403d2[_0x4c8c('0x40')]);_0x524825[_0x4c8c('0x44')]=_['intersection'](_0x2403d2[_0x4c8c('0x43')],qs[_0x4c8c('0x45')](_0x26828e[_0x4c8c('0x40')][_0x4c8c('0x45')]));_0x524825[_0x4c8c('0x44')]=_0x524825[_0x4c8c('0x44')][_0x4c8c('0x46')]?_0x524825[_0x4c8c('0x44')]:_0x2403d2[_0x4c8c('0x43')];if(!_0x26828e['query'][_0x4c8c('0x47')]('nolimit')){_0x524825['limit']=qs['limit'](_0x26828e['query']['limit']);_0x524825[_0x4c8c('0x2e')]=qs[_0x4c8c('0x2e')](_0x26828e['query'][_0x4c8c('0x2e')]);}_0x524825[_0x4c8c('0x48')]=qs[_0x4c8c('0x49')](_0x26828e[_0x4c8c('0x40')][_0x4c8c('0x49')]);_0x524825['where']=qs[_0x4c8c('0x42')](_['pick'](_0x26828e[_0x4c8c('0x40')],_0x2403d2[_0x4c8c('0x42')]),_0x4a483c);if(_0x26828e[_0x4c8c('0x40')][_0x4c8c('0x4a')]){_0x524825[_0x4c8c('0x4b')]=_[_0x4c8c('0x4c')](_0x524825['where'],{'$or':_[_0x4c8c('0x3b')](_0x4a483c,function(_0xe3e7e){if(_0xe3e7e[_0x4c8c('0x3e')]!==_0x4c8c('0x4d')){var _0x1e9c85={};_0x1e9c85[_0xe3e7e[_0x4c8c('0x38')]]={'$like':'%'+_0x26828e[_0x4c8c('0x40')]['filter']+'%'};return _0x1e9c85;}})});}_0x524825=_[_0x4c8c('0x4c')]({},_0x524825,_0x26828e[_0x4c8c('0x4e')]);var _0x286ca0={'where':_0x524825['where']};return db[_0x4c8c('0x4f')][_0x4c8c('0x2d')](_0x286ca0)[_0x4c8c('0x1e')](function(_0x345e1d){_0xbe6ca0[_0x4c8c('0x2d')]=_0x345e1d;if(_0x26828e[_0x4c8c('0x40')][_0x4c8c('0x50')]){_0x524825[_0x4c8c('0x51')]=[{'all':!![]}];}return db['ChatMessage'][_0x4c8c('0x52')](_0x524825);})[_0x4c8c('0x1e')](function(_0x3c0df7){_0xbe6ca0[_0x4c8c('0x53')]=_0x3c0df7;return _0xbe6ca0;})[_0x4c8c('0x1e')](respondWithFilteredResult(_0x4460f6,_0x524825))['catch'](handleError(_0x4460f6,null));};exports[_0x4c8c('0x54')]=function(_0x456a3c,_0x4f1a47){var _0x18cc5d={'raw':!![],'where':{'id':_0x456a3c[_0x4c8c('0x55')]['id']}},_0x198e8c={};_0x198e8c[_0x4c8c('0x43')]=_[_0x4c8c('0x41')](db['ChatMessage'][_0x4c8c('0x3c')]);_0x198e8c['query']=_[_0x4c8c('0x41')](_0x456a3c[_0x4c8c('0x40')]);_0x198e8c['filters']=_[_0x4c8c('0x56')](_0x198e8c[_0x4c8c('0x43')],_0x198e8c[_0x4c8c('0x40')]);_0x18cc5d[_0x4c8c('0x44')]=_['intersection'](_0x198e8c[_0x4c8c('0x43')],qs[_0x4c8c('0x45')](_0x456a3c[_0x4c8c('0x40')][_0x4c8c('0x45')]));_0x18cc5d['attributes']=_0x18cc5d[_0x4c8c('0x44')][_0x4c8c('0x46')]?_0x18cc5d[_0x4c8c('0x44')]:_0x198e8c[_0x4c8c('0x43')];if(_0x456a3c[_0x4c8c('0x40')]['includeAll']){_0x18cc5d[_0x4c8c('0x51')]=[{'all':!![]}];}_0x18cc5d=_[_0x4c8c('0x4c')]({},_0x18cc5d,_0x456a3c[_0x4c8c('0x4e')]);return db[_0x4c8c('0x4f')]['find'](_0x18cc5d)[_0x4c8c('0x1e')](handleEntityNotFound(_0x4f1a47,null))['then'](respondWithResult(_0x4f1a47,null))[_0x4c8c('0x28')](handleError(_0x4f1a47,null));};exports[_0x4c8c('0x57')]=function(_0x58bfff,_0x494e2e){return db[_0x4c8c('0x4f')][_0x4c8c('0x57')](_0x58bfff[_0x4c8c('0x58')],{})[_0x4c8c('0x1e')](respondWithResult(_0x494e2e,0xc9))[_0x4c8c('0x28')](handleError(_0x494e2e,null));};exports[_0x4c8c('0x34')]=function(_0x3c9833,_0x5bf0e2){if(_0x3c9833[_0x4c8c('0x58')]['id']){delete _0x3c9833['body']['id'];}return db[_0x4c8c('0x4f')]['find']({'where':{'id':_0x3c9833[_0x4c8c('0x55')]['id']}})[_0x4c8c('0x1e')](handleEntityNotFound(_0x5bf0e2,null))[_0x4c8c('0x1e')](saveUpdates(_0x3c9833[_0x4c8c('0x58')],null))[_0x4c8c('0x1e')](respondWithResult(_0x5bf0e2,null))[_0x4c8c('0x28')](handleError(_0x5bf0e2,null));};exports[_0x4c8c('0x35')]=function(_0x420dbd,_0xbfb461){return db[_0x4c8c('0x4f')][_0x4c8c('0x59')]({'where':{'id':_0x420dbd['params']['id']}})[_0x4c8c('0x1e')](handleEntityNotFound(_0xbfb461,null))[_0x4c8c('0x1e')](removeEntity(_0xbfb461,null))[_0x4c8c('0x28')](handleError(_0xbfb461,null));};exports['describe']=function(_0xa6148f,_0x4db957){return db[_0x4c8c('0x4f')]['describe']()['then'](respondWithResult(_0x4db957,null))[_0x4c8c('0x28')](handleError(_0x4db957,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x4c8c('0x5a')]=function(_0x2ee236,_0x5ed2c7,_0x487d1a){var _0x436ad3={'agent':{},'channel':_0x4c8c('0x5b')};if(_0x2ee236['body']['id']){delete _0x2ee236[_0x4c8c('0x58')]['id'];}_0x2ee236[_0x4c8c('0x58')][_0x4c8c('0x5c')]=!![];_0x2ee236[_0x4c8c('0x58')]['readAt']=moment()[_0x4c8c('0x5d')](_0x4c8c('0x5e'));_0x2ee236[_0x4c8c('0x58')]['UserId']=_0x2ee236['body'][_0x4c8c('0x5f')]||_0x2ee236[_0x4c8c('0x60')]['id'];_0x436ad3[_0x4c8c('0x61')]['id']=_0x2ee236[_0x4c8c('0x58')][_0x4c8c('0x5f')];return db[_0x4c8c('0x4f')]['find']({'where':{'id':_0x2ee236[_0x4c8c('0x55')]['id'],'UserId':null}})[_0x4c8c('0x1e')](handleEntityNotFound(_0x5ed2c7,null))[_0x4c8c('0x1e')](saveUpdates(_0x2ee236[_0x4c8c('0x58')],null))[_0x4c8c('0x1e')](function(_0x2c45ba){if(_0x2c45ba){_0x436ad3[_0x4c8c('0x26')]=_0x2c45ba[_0x4c8c('0x62')]({'plain':!![]});return db['ChatInteraction'][_0x4c8c('0x59')]({'where':{'id':_0x2c45ba['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5ed2c7,null))['then'](function(_0x589073){if(_0x589073){return _0x589073['update']({'UserId':_0x2ee236[_0x4c8c('0x58')]['UserId'],'read1stAt':_['isNil'](_0x589073[_0x4c8c('0x63')])?moment()[_0x4c8c('0x5d')](_0x4c8c('0x5e')):undefined});}return null;})[_0x4c8c('0x1e')](function(_0x27cebb){if(_0x27cebb){_0x436ad3[_0x4c8c('0x64')]=_0x27cebb[_0x4c8c('0x62')]({'plain':!![]});interaction_log[_0x4c8c('0x1f')](_0x4c8c('0x65'),_0x2ee236[_0x4c8c('0x60')]['id'],_0x2ee236['user']['name'],_0x2ee236['user'][_0x4c8c('0x66')],_0x436ad3['interaction']['id'],_0x2ee236[_0x4c8c('0x58')]?JSON[_0x4c8c('0x23')](_0x2ee236[_0x4c8c('0x58')]):'null');return respondWithRpcPromise('AcceptMessage',_0x4c8c('0x67'),_0x436ad3);}return null;})['then'](function(_0x309c79){var _0x17ae6a=_0x4c8c('0x68')+_0x309c79[_0x4c8c('0x26')][_0x4c8c('0x69')];return db[_0x4c8c('0x6a')][_0x4c8c('0x40')](_0x17ae6a,{'type':db[_0x4c8c('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x89df30){return _0x89df30;});})[_0x4c8c('0x1e')](function(_0x4c8e00){if(_0x4c8e00){_0x436ad3[_0x4c8c('0x26')][_0x4c8c('0x6c')]=_0x4c8e00[0x0];if(!_0x2ee236[_0x4c8c('0x58')]['UserId'])return;return db[_0x4c8c('0x6d')][_0x4c8c('0x59')]({'where':{'id':_0x2ee236['body'][_0x4c8c('0x5f')],'role':'agent'},'attributes':['id',_0x4c8c('0x38'),'fullname',_0x4c8c('0x6e'),_0x4c8c('0x6f')],'raw':!![]});}return null;})[_0x4c8c('0x1e')](function(_0x2503e7){if(!_0x2503e7)return null;_0x436ad3['message'][_0x4c8c('0x61')]=_0x2503e7;return _0x436ad3;})[_0x4c8c('0x1e')](function(_0xa05ffc){if(_0xa05ffc){if(_0x2ee236[_0x4c8c('0x58')][_0x4c8c('0x70')]){_0x436ad3[_0x4c8c('0x26')][_0x4c8c('0x71')]=util[_0x4c8c('0x5d')](_0x4c8c('0x72'),_0x2ee236[_0x4c8c('0x60')][_0x4c8c('0x38')]);_0x436ad3[_0x4c8c('0x26')][_0x4c8c('0x73')]=_0x436ad3[_0x4c8c('0x73')];_0x436ad3['message'][_0x4c8c('0x74')]=_0x436ad3[_0x4c8c('0x73')];_0x436ad3[_0x4c8c('0x26')][_0x4c8c('0x75')]=_0x4c8c('0x5a');return respondWithRpcPromise(_0x4c8c('0x76'),_0x4c8c('0x76'),{'event':'acceptmessage','message':_[_0x4c8c('0x4c')](_0x436ad3['message'],JSON[_0x4c8c('0x77')](_0x436ad3['interaction']['formData']))},client9002)[_0x4c8c('0x1e')](function(){return _0x436ad3;});}return _0x436ad3;}return null;})[_0x4c8c('0x1e')](respondWithResult(_0x5ed2c7,null))[_0x4c8c('0x28')](handleError(_0x5ed2c7,null));};var interaction_log=require(_0x4c8c('0x14'))('chat-interactions');exports['reject']=function(_0x1c1896,_0x4bf5fd,_0x676f83){var _0x33ce93={'agent':{},'channel':'chat'};if(_0x1c1896[_0x4c8c('0x58')]['id']){delete _0x1c1896[_0x4c8c('0x58')]['id'];}_0x1c1896[_0x4c8c('0x58')][_0x4c8c('0x5f')]=_0x1c1896[_0x4c8c('0x58')][_0x4c8c('0x5f')]||_0x1c1896[_0x4c8c('0x60')]['id'];_0x33ce93[_0x4c8c('0x61')]['id']=_0x1c1896[_0x4c8c('0x58')][_0x4c8c('0x5f')];return db['ChatMessage'][_0x4c8c('0x59')]({'where':{'id':_0x1c1896['params']['id'],'UserId':null}})[_0x4c8c('0x1e')](handleEntityNotFound(_0x4bf5fd,null))['then'](function(_0x4f6114){if(_0x4f6114){_0x33ce93[_0x4c8c('0x26')]=_0x4f6114[_0x4c8c('0x62')]({'plain':!![]});return db[_0x4c8c('0x78')][_0x4c8c('0x59')]({'where':{'id':_0x4f6114[_0x4c8c('0x79')]}});}return null;})[_0x4c8c('0x1e')](handleEntityNotFound(_0x4bf5fd,null))['then'](function(_0x5f1553){if(_0x5f1553){_0x33ce93[_0x4c8c('0x64')]=_0x5f1553[_0x4c8c('0x62')]({'plain':!![]});interaction_log[_0x4c8c('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c1896[_0x4c8c('0x60')]['id'],_0x1c1896[_0x4c8c('0x60')][_0x4c8c('0x38')],_0x1c1896['user'][_0x4c8c('0x66')],_0x33ce93[_0x4c8c('0x64')]['id'],_0x1c1896[_0x4c8c('0x58')]?JSON[_0x4c8c('0x23')](_0x1c1896['body']):'null');return respondWithRpcPromise('RejectMessage',_0x4c8c('0x7a'),_0x33ce93);}return null;})[_0x4c8c('0x1e')](function(_0x260699){var _0x2475e1=_0x4c8c('0x68')+_0x260699[_0x4c8c('0x26')][_0x4c8c('0x69')];return db[_0x4c8c('0x6a')][_0x4c8c('0x40')](_0x2475e1,{'type':db['Sequelize'][_0x4c8c('0x7b')][_0x4c8c('0x7c')],'raw':!![]})[_0x4c8c('0x1e')](function(_0x4635bb){return _0x4635bb;});})[_0x4c8c('0x1e')](function(_0x409f6c){if(_0x409f6c){_0x33ce93[_0x4c8c('0x26')][_0x4c8c('0x6c')]=_0x409f6c[0x0];if(!_0x1c1896[_0x4c8c('0x58')]['UserId'])return;return db[_0x4c8c('0x6d')]['find']({'where':{'id':_0x1c1896[_0x4c8c('0x58')]['UserId'],'role':_0x4c8c('0x61')},'attributes':['id',_0x4c8c('0x38'),_0x4c8c('0x7d'),_0x4c8c('0x6e'),_0x4c8c('0x6f')],'raw':!![]});}return null;})[_0x4c8c('0x1e')](function(_0x71e685){if(!_0x71e685)return null;_0x33ce93[_0x4c8c('0x26')][_0x4c8c('0x61')]=_0x71e685;return _0x33ce93;})[_0x4c8c('0x1e')](function(_0x421c63){if(_0x421c63){_0x421c63[_0x4c8c('0x26')][_0x4c8c('0x71')]=util[_0x4c8c('0x5d')](_0x4c8c('0x72'),_0x1c1896[_0x4c8c('0x60')][_0x4c8c('0x38')]);_0x421c63[_0x4c8c('0x26')]['channel']=_0x33ce93[_0x4c8c('0x73')];_0x421c63[_0x4c8c('0x26')]['motionChannel']=_0x33ce93[_0x4c8c('0x73')];_0x421c63[_0x4c8c('0x26')]['event']='reject';respondWithRpcPromise('EventManager',_0x4c8c('0x76'),{'event':'rejectmessage','message':_[_0x4c8c('0x4c')](_0x33ce93[_0x4c8c('0x26')],JSON['parse'](_0x33ce93[_0x4c8c('0x64')]['formData']))},client9002);return _0x33ce93;}return null;})[_0x4c8c('0x1e')](respondWithResult(_0x4bf5fd,null))[_0x4c8c('0x28')](handleError(_0x4bf5fd,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 8ac5fd9..5ef3087 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 _0x7eb1=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x7eb1,0x1d3));var _0x17eb=function(_0x423312,_0x25f527){_0x423312=_0x423312-0x0;var _0x33f959=_0x7eb1[_0x423312];return _0x33f959;};'use strict';var EventEmitter=require(_0x17eb('0x0'));var ChatMessage=require(_0x17eb('0x1'))['db'][_0x17eb('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x17eb('0x3')](0x0);var events={'afterCreate':_0x17eb('0x4'),'afterUpdate':_0x17eb('0x5'),'afterDestroy':'remove'};function emitEvent(_0x179da4){return function(_0x5090db,_0x51b0b5,_0x12c338){ChatMessageEvents[_0x17eb('0x6')](_0x179da4+':'+_0x5090db['id'],_0x5090db);ChatMessageEvents[_0x17eb('0x6')](_0x179da4,_0x5090db);_0x12c338(null);};}for(var e in events){if(events[_0x17eb('0x7')](e)){var event=events[e];ChatMessage[_0x17eb('0x8')](e,emitEvent(event));}}module[_0x17eb('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x4f06=['events','ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x4d53ad,_0x5a8c2b){var _0x1bf121=function(_0x4f88c1){while(--_0x4f88c1){_0x4d53ad['push'](_0x4d53ad['shift']());}};_0x1bf121(++_0x5a8c2b);}(_0x4f06,0x130));var _0x64f0=function(_0x2e6326,_0x108461){_0x2e6326=_0x2e6326-0x0;var _0x4e3465=_0x4f06[_0x2e6326];return _0x4e3465;};'use strict';var EventEmitter=require(_0x64f0('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x64f0('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x64f0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x64f0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5126af){return function(_0x23aa57,_0x1b7360,_0x3893da){ChatMessageEvents[_0x64f0('0x4')](_0x5126af+':'+_0x23aa57['id'],_0x23aa57);ChatMessageEvents[_0x64f0('0x4')](_0x5126af,_0x23aa57);_0x3893da(null);};}for(var e in events){if(events[_0x64f0('0x5')](e)){var event=events[e];ChatMessage[_0x64f0('0x6')](e,emitEvent(event));}}module[_0x64f0('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 8a21691..8b11dd0 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 _0xd751=['./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0xd751,0x74));var _0x1d75=function(_0xfa75b5,_0x5cbe19){_0xfa75b5=_0xfa75b5-0x0;var _0x1c1911=_0xd751[_0xfa75b5];return _0x1c1911;};'use strict';var _=require(_0x1d75('0x0'));var util=require(_0x1d75('0x1'));var logger=require(_0x1d75('0x2'))(_0x1d75('0x3'));var moment=require(_0x1d75('0x4'));var BPromise=require(_0x1d75('0x5'));var rp=require(_0x1d75('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1d75('0x7'));var attributes=require(_0x1d75('0x8'));module[_0x1d75('0x9')]=function(_0x2653b2,_0x4d4af4){return _0x2653b2[_0x1d75('0xa')](_0x1d75('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x1d75('0xc'),'fields':[_0x1d75('0xd')],'type':_0x1d75('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58e948,_0x128649,_0x4ebb44){var _0xa1d5eb=_0x2653b2[_0x1d75('0xf')];var _0x46c4a3=_0x58e948[_0x1d75('0x10')]({'plain':!![]});if(_0x46c4a3['direction'][_0x1d75('0x11')]()==='in'||_0x46c4a3[_0x1d75('0x12')]['toLowerCase']()===_0x1d75('0x13')&&!_0x46c4a3['secret']&&!_[_0x1d75('0x14')](_0x46c4a3[_0x1d75('0x15')])){_0xa1d5eb[_0x1d75('0x16')][_0x1d75('0x17')]({'where':{'id':_0x46c4a3[_0x1d75('0x18')]}})[_0x1d75('0x19')](function(_0xb5e76b){if(_0xb5e76b){_0xb5e76b[_0x1d75('0x1a')]({'lastMsgAt':_0x46c4a3['createdAt'],'lastMsgDirection':_0x46c4a3['direction']['toLowerCase']()});}})[_0x1d75('0x1b')](function(_0x4d4c41){console[_0x1d75('0x1c')](_0x4d4c41);});}_0x4ebb44();}},'charset':_0x1d75('0x1d'),'collate':_0x1d75('0x1e')});}; \ No newline at end of file +var _0x2402=['./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','ChatInteraction','ChatInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xbf15fb,_0xbf8e46){var _0x2a1941=function(_0x44451d){while(--_0x44451d){_0xbf15fb['push'](_0xbf15fb['shift']());}};_0x2a1941(++_0xbf8e46);}(_0x2402,0xc9));var _0x2240=function(_0x13be0f,_0x31f0d7){_0x13be0f=_0x13be0f-0x0;var _0x834c3c=_0x2402[_0x13be0f];return _0x834c3c;};'use strict';var _=require(_0x2240('0x0'));var util=require(_0x2240('0x1'));var logger=require(_0x2240('0x2'))(_0x2240('0x3'));var moment=require('moment');var BPromise=require(_0x2240('0x4'));var rp=require(_0x2240('0x5'));var fs=require('fs');var path=require(_0x2240('0x6'));var rimraf=require(_0x2240('0x7'));var config=require(_0x2240('0x8'));var attributes=require(_0x2240('0x9'));module[_0x2240('0xa')]=function(_0x311e37,_0x1e588c){return _0x311e37[_0x2240('0xb')](_0x2240('0xc'),attributes,{'tableName':_0x2240('0xd'),'paranoid':![],'indexes':[{'name':_0x2240('0xe'),'fields':[_0x2240('0xf')],'type':_0x2240('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa6bffc,_0x2616ec,_0x4a7b78){var _0x20fdec=_0x311e37[_0x2240('0x11')];var _0x5c3dc3=_0xa6bffc[_0x2240('0x12')]({'plain':!![]});if(_0x5c3dc3[_0x2240('0x13')][_0x2240('0x14')]()==='in'||_0x5c3dc3[_0x2240('0x13')]['toLowerCase']()===_0x2240('0x15')&&!_0x5c3dc3['secret']&&!_[_0x2240('0x16')](_0x5c3dc3['UserId'])){_0x20fdec[_0x2240('0x17')]['findOne']({'where':{'id':_0x5c3dc3[_0x2240('0x18')]}})[_0x2240('0x19')](function(_0x10a971){if(_0x10a971){_0x10a971[_0x2240('0x1a')]({'lastMsgAt':_0x5c3dc3[_0x2240('0x1b')],'lastMsgDirection':_0x5c3dc3[_0x2240('0x13')][_0x2240('0x14')]()});}})['catch'](function(_0x34b640){console[_0x2240('0x1c')](_0x34b640);});}_0x4a7b78();}},'charset':'utf8mb4','collate':_0x2240('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 622ed3b..5db24f7 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 _0xa2da=['register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','body','options','raw','then','debug','CreateChatMessage','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x3b7248,_0x19f44f){var _0x51bb36=function(_0x1e4688){while(--_0x1e4688){_0x3b7248['push'](_0x3b7248['shift']());}};_0x51bb36(++_0x19f44f);}(_0xa2da,0x1e1));var _0xaa2d=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0xa2da[_0x4ee9cd];return _0x328a5b;};'use strict';var _=require(_0xaa2d('0x0'));var util=require(_0xaa2d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaa2d('0x2'));var fs=require('fs');var Redis=require(_0xaa2d('0x3'));var db=require(_0xaa2d('0x4'))['db'];var utils=require(_0xaa2d('0x5'));var logger=require(_0xaa2d('0x6'))('rpc');var config=require(_0xaa2d('0x7'));var jayson=require(_0xaa2d('0x8'));var client=jayson[_0xaa2d('0x9')]['http']({'port':0x232a});config[_0xaa2d('0xa')]=_[_0xaa2d('0xb')](config[_0xaa2d('0xa')],{'host':_0xaa2d('0xc'),'port':0x18eb});var socket=require(_0xaa2d('0xd'))(new Redis(config[_0xaa2d('0xa')]));require(_0xaa2d('0xe'))[_0xaa2d('0xf')](socket);function respondWithRpcPromise(_0x3b6931,_0x10a5a7,_0x6b2613){return new BPromise(function(_0x538341,_0x4d1fe1){return client[_0xaa2d('0x10')](_0x3b6931,_0x6b2613)['then'](function(_0x454ef7){logger[_0xaa2d('0x11')](_0xaa2d('0x12'),_0x10a5a7,_0xaa2d('0x13'));logger['debug'](_0xaa2d('0x14'),_0x10a5a7,_0xaa2d('0x13'),JSON['stringify'](_0x454ef7));if(_0x454ef7[_0xaa2d('0x15')]){if(_0x454ef7['error'][_0xaa2d('0x16')]===0x1f4){logger[_0xaa2d('0x15')](_0xaa2d('0x12'),_0x10a5a7,_0x454ef7[_0xaa2d('0x15')]['message']);return _0x4d1fe1(_0x454ef7[_0xaa2d('0x15')][_0xaa2d('0x17')]);}logger[_0xaa2d('0x15')]('ChatMessage,\x20%s,\x20%s',_0x10a5a7,_0x454ef7[_0xaa2d('0x15')]['message']);return _0x538341(_0x454ef7[_0xaa2d('0x15')][_0xaa2d('0x17')]);}else{logger[_0xaa2d('0x11')](_0xaa2d('0x12'),_0x10a5a7,_0xaa2d('0x13'));_0x538341(_0x454ef7['result'][_0xaa2d('0x17')]);}})[_0xaa2d('0x18')](function(_0x4f58e7){logger['error'](_0xaa2d('0x12'),_0x10a5a7,_0x4f58e7);_0x4d1fe1(_0x4f58e7);});});}exports['CreateChatMessage']=function(_0x1763c9){var _0x5e22de=this;return new Promise(function(_0x51f68b,_0x2bed14){return db['ChatMessage']['create'](_0x1763c9[_0xaa2d('0x19')],{'raw':_0x1763c9[_0xaa2d('0x1a')]?_0x1763c9['options'][_0xaa2d('0x1b')]===undefined?!![]:![]:!![]})[_0xaa2d('0x1c')](function(_0x5677f2){logger[_0xaa2d('0x11')]('CreateChatMessage',_0x1763c9);logger[_0xaa2d('0x1d')](_0xaa2d('0x1e'),_0x1763c9,JSON['stringify'](_0x5677f2));_0x51f68b(_0x5677f2);})[_0xaa2d('0x18')](function(_0x153b3e){logger[_0xaa2d('0x15')](_0xaa2d('0x1e'),_0x153b3e[_0xaa2d('0x17')],_0x1763c9);_0x2bed14(_0x5e22de[_0xaa2d('0x15')](0x1f4,_0x153b3e[_0xaa2d('0x17')]));});});}; \ No newline at end of file +var _0x964c=['body','options','raw','lodash','util','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatMessage.socket','register','then','info','request\x20sent','debug','stringify','error','message','ChatMessage,\x20%s,\x20%s','catch','CreateChatMessage','create'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0x964c,0x162));var _0xc964=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x964c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc964('0x0'));var util=require(_0xc964('0x1'));var moment=require(_0xc964('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc964('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc964('0x4'))('rpc');var config=require(_0xc964('0x5'));var jayson=require(_0xc964('0x6'));var client=jayson[_0xc964('0x7')]['http']({'port':0x232a});config[_0xc964('0x8')]=_[_0xc964('0x9')](config[_0xc964('0x8')],{'host':_0xc964('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc964('0x8')]));require(_0xc964('0xb'))[_0xc964('0xc')](socket);function respondWithRpcPromise(_0x1ac77c,_0x432b78,_0x4cde08){return new BPromise(function(_0x1be00b,_0x112bcd){return client['request'](_0x1ac77c,_0x4cde08)[_0xc964('0xd')](function(_0x243c7c){logger[_0xc964('0xe')]('ChatMessage,\x20%s,\x20%s',_0x432b78,_0xc964('0xf'));logger[_0xc964('0x10')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x432b78,_0xc964('0xf'),JSON[_0xc964('0x11')](_0x243c7c));if(_0x243c7c['error']){if(_0x243c7c[_0xc964('0x12')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x432b78,_0x243c7c[_0xc964('0x12')][_0xc964('0x13')]);return _0x112bcd(_0x243c7c[_0xc964('0x12')]['message']);}logger[_0xc964('0x12')](_0xc964('0x14'),_0x432b78,_0x243c7c[_0xc964('0x12')][_0xc964('0x13')]);return _0x1be00b(_0x243c7c[_0xc964('0x12')][_0xc964('0x13')]);}else{logger[_0xc964('0xe')](_0xc964('0x14'),_0x432b78,'request\x20sent');_0x1be00b(_0x243c7c['result'][_0xc964('0x13')]);}})[_0xc964('0x15')](function(_0x34c93c){logger[_0xc964('0x12')](_0xc964('0x14'),_0x432b78,_0x34c93c);_0x112bcd(_0x34c93c);});});}exports[_0xc964('0x16')]=function(_0x38573f){var _0x5b7cfa=this;return new Promise(function(_0x12e5cb,_0x53a647){return db['ChatMessage'][_0xc964('0x17')](_0x38573f[_0xc964('0x18')],{'raw':_0x38573f[_0xc964('0x19')]?_0x38573f[_0xc964('0x19')][_0xc964('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x45ed8b){logger[_0xc964('0xe')](_0xc964('0x16'),_0x38573f);logger['debug'](_0xc964('0x16'),_0x38573f,JSON[_0xc964('0x11')](_0x45ed8b));_0x12e5cb(_0x45ed8b);})['catch'](function(_0x4ca324){logger[_0xc964('0x12')](_0xc964('0x16'),_0x4ca324[_0xc964('0x13')],_0x38573f);_0x53a647(_0x5b7cfa[_0xc964('0x12')](0x1f4,_0x4ca324['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 5543681..3abe425 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 _0xc818=['update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xc818,0x1e3));var _0x8c81=function(_0x1c58e6,_0x396259){_0x1c58e6=_0x1c58e6-0x0;var _0x3941d1=_0xc818[_0x1c58e6];return _0x3941d1;};'use strict';var ChatMessageEvents=require(_0x8c81('0x0'));var events=[_0x8c81('0x1'),_0x8c81('0x2'),_0x8c81('0x3')];function createListener(_0x5e6597,_0x461c5f){return function(_0x7a8137){_0x461c5f[_0x8c81('0x4')](_0x5e6597,_0x7a8137);};}function removeListener(_0x7e329f,_0x1a61ab){return function(){ChatMessageEvents[_0x8c81('0x5')](_0x7e329f,_0x1a61ab);};}exports[_0x8c81('0x6')]=function(_0x4a6e65){for(var _0x2c5966=0x0,_0x3d663e=events[_0x8c81('0x7')];_0x2c5966<_0x3d663e;_0x2c5966++){var _0x43d142=events[_0x2c5966];var _0x501240=createListener(_0x8c81('0x8')+_0x43d142,_0x4a6e65);ChatMessageEvents['on'](_0x43d142,_0x501240);}}; \ No newline at end of file +var _0xc474=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','emit'];(function(_0xfc4b96,_0x16acc3){var _0x52cc38=function(_0xe04b32){while(--_0xe04b32){_0xfc4b96['push'](_0xfc4b96['shift']());}};_0x52cc38(++_0x16acc3);}(_0xc474,0xfc));var _0x4c47=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xc474[_0x500419];return _0x241c1a;};'use strict';var ChatMessageEvents=require(_0x4c47('0x0'));var events=[_0x4c47('0x1'),_0x4c47('0x2'),'update'];function createListener(_0x29e5bf,_0x15bc09){return function(_0x1703cd){_0x15bc09[_0x4c47('0x3')](_0x29e5bf,_0x1703cd);};}function removeListener(_0x2b2443,_0x40b979){return function(){ChatMessageEvents[_0x4c47('0x4')](_0x2b2443,_0x40b979);};}exports[_0x4c47('0x5')]=function(_0x58db78){for(var _0x5aaf0e=0x0,_0x6aeef8=events[_0x4c47('0x6')];_0x5aaf0e<_0x6aeef8;_0x5aaf0e++){var _0x275a64=events[_0x5aaf0e];var _0x35a093=createListener(_0x4c47('0x7')+_0x275a64,_0x58db78);ChatMessageEvents['on'](_0x275a64,_0x35a093);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 845fa89..85b03e8 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 _0xd106=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','tracked','chat','create','put','/:id','update'];(function(_0x2e3c24,_0x30d198){var _0x5b6ef2=function(_0x23a0e7){while(--_0x23a0e7){_0x2e3c24['push'](_0x2e3c24['shift']());}};_0x5b6ef2(++_0x30d198);}(_0xd106,0x159));var _0x6d10=function(_0x3e2b13,_0x240522){_0x3e2b13=_0x3e2b13-0x0;var _0x38bcb4=_0xd106[_0x3e2b13];return _0x38bcb4;};'use strict';var multer=require(_0x6d10('0x0'));var util=require('util');var path=require(_0x6d10('0x1'));var timeout=require(_0x6d10('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6d10('0x3'));var auth=require(_0x6d10('0x4'));var interaction=require(_0x6d10('0x5'));var config=require('../../config/environment');var controller=require(_0x6d10('0x6'));router[_0x6d10('0x7')]('/',auth[_0x6d10('0x8')](),controller[_0x6d10('0x9')]);router['get'](_0x6d10('0xa'),auth[_0x6d10('0x8')](),controller[_0x6d10('0xb')]);router[_0x6d10('0x7')]('/:id',auth[_0x6d10('0x8')](),controller[_0x6d10('0xc')]);router['post']('/',auth[_0x6d10('0x8')](),interaction[_0x6d10('0xd')](_0x6d10('0xe'),'chatmessage:create'),controller[_0x6d10('0xf')]);router[_0x6d10('0x10')](_0x6d10('0x11'),controller[_0x6d10('0x12')]);router[_0x6d10('0x10')](_0x6d10('0x13'),auth[_0x6d10('0x8')](),controller[_0x6d10('0x14')]);router[_0x6d10('0x10')](_0x6d10('0x15'),auth['isAuthenticated'](),controller[_0x6d10('0x16')]);router[_0x6d10('0x17')](_0x6d10('0x11'),auth['isAuthenticated'](),controller[_0x6d10('0x18')]);module[_0x6d10('0x19')]=router; \ No newline at end of file +var _0xe6e8=['show','post','chat','create','put','update','/:id/accept','accept','/:id/reject','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','/:id'];(function(_0x495c9e,_0x398e3d){var _0x1a11b2=function(_0x10a4f6){while(--_0x10a4f6){_0x495c9e['push'](_0x495c9e['shift']());}};_0x1a11b2(++_0x398e3d);}(_0xe6e8,0x7e));var _0x8e6e=function(_0x46e8a6,_0x593b44){_0x46e8a6=_0x46e8a6-0x0;var _0x47e3ce=_0xe6e8[_0x46e8a6];return _0x47e3ce;};'use strict';var multer=require(_0x8e6e('0x0'));var util=require(_0x8e6e('0x1'));var path=require('path');var timeout=require(_0x8e6e('0x2'));var express=require(_0x8e6e('0x3'));var router=express['Router']();var fs_extra=require(_0x8e6e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8e6e('0x5'));var config=require(_0x8e6e('0x6'));var controller=require(_0x8e6e('0x7'));router[_0x8e6e('0x8')]('/',auth[_0x8e6e('0x9')](),controller['index']);router[_0x8e6e('0x8')](_0x8e6e('0xa'),auth[_0x8e6e('0x9')](),controller['describe']);router[_0x8e6e('0x8')](_0x8e6e('0xb'),auth[_0x8e6e('0x9')](),controller[_0x8e6e('0xc')]);router[_0x8e6e('0xd')]('/',auth[_0x8e6e('0x9')](),interaction['tracked'](_0x8e6e('0xe'),'chatmessage:create'),controller[_0x8e6e('0xf')]);router[_0x8e6e('0x10')]('/:id',controller[_0x8e6e('0x11')]);router[_0x8e6e('0x10')](_0x8e6e('0x12'),auth[_0x8e6e('0x9')](),controller[_0x8e6e('0x13')]);router[_0x8e6e('0x10')](_0x8e6e('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0x8e6e('0x15')]('/:id',auth[_0x8e6e('0x9')](),controller['destroy']);module[_0x8e6e('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 6edf093..195be09 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 _0x7359=['exports','TEXT','sequelize'];(function(_0x412519,_0x118d3d){var _0x55bb99=function(_0x1a8759){while(--_0x1a8759){_0x412519['push'](_0x412519['shift']());}};_0x55bb99(++_0x118d3d);}(_0x7359,0x13d));var _0x9735=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x7359[_0x45e98e];return _0x374dba;};'use strict';var Sequelize=require(_0x9735('0x0'));module[_0x9735('0x1')]={'body':{'type':Sequelize[_0x9735('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0xf016=['TEXT','exports'];(function(_0x50a448,_0x3d1a4d){var _0x5da8c6=function(_0x3310a6){while(--_0x3310a6){_0x50a448['push'](_0x50a448['shift']());}};_0x5da8c6(++_0x3d1a4d);}(_0xf016,0x13f));var _0x6f01=function(_0x485142,_0x13f9bc){_0x485142=_0x485142-0x0;var _0x5df234=_0xf016[_0x485142];return _0x5df234;};'use strict';var Sequelize=require('sequelize');module[_0x6f01('0x0')]={'body':{'type':Sequelize[_0x6f01('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 36ef596..db9e6ec 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(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x7a54,0x106));var _0x47a5=function(_0x31bbad,_0x4e33a3){_0x31bbad=_0x31bbad-0x0;var _0x4740e1=_0x7a54[_0x31bbad];return _0x4740e1;};'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(_0x295ee0,_0x4a1afe){var _0x443a03=function(_0x1b015f){while(--_0x1b015f){_0x295ee0['push'](_0x295ee0['shift']());}};_0x443a03(++_0x4a1afe);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['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 e9fc366..803a89e 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 _0x67b9=['bluebird','request-promise','path','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0x2e11aa,_0x1aa517){var _0x24b0ce=function(_0x22e372){while(--_0x22e372){_0x2e11aa['push'](_0x2e11aa['shift']());}};_0x24b0ce(++_0x1aa517);}(_0x67b9,0xc0));var _0x967b=function(_0x233833,_0x52763f){_0x233833=_0x233833-0x0;var _0x37473e=_0x67b9[_0x233833];return _0x37473e;};'use strict';var _=require(_0x967b('0x0'));var util=require('util');var logger=require(_0x967b('0x1'))('api');var moment=require(_0x967b('0x2'));var BPromise=require(_0x967b('0x3'));var rp=require(_0x967b('0x4'));var fs=require('fs');var path=require(_0x967b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x967b('0x6'));module[_0x967b('0x7')]=function(_0x330973,_0x546c97){return _0x330973[_0x967b('0x8')](_0x967b('0x9'),attributes,{'tableName':_0x967b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x967b('0xb'),'collate':_0x967b('0xc')});}; \ No newline at end of file +var _0x41b1=['moment','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41b1,0x112));var _0x141b=function(_0x10e8ed,_0x384a0d){_0x10e8ed=_0x10e8ed-0x0;var _0x4aea4a=_0x41b1[_0x10e8ed];return _0x4aea4a;};'use strict';var _=require(_0x141b('0x0'));var util=require(_0x141b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x141b('0x2'));var BPromise=require('bluebird');var rp=require(_0x141b('0x3'));var fs=require('fs');var path=require(_0x141b('0x4'));var rimraf=require('rimraf');var config=require(_0x141b('0x5'));var attributes=require(_0x141b('0x6'));module[_0x141b('0x7')]=function(_0x302d3d,_0x3614a8){return _0x302d3d[_0x141b('0x8')]('ChatOfflineMessage',attributes,{'tableName':_0x141b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x141b('0xa'),'collate':_0x141b('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index cf7d1d6..851d908 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 _0x462f=['jayson/promise','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x462f,0x1c5));var _0xf462=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x462f[_0x13b392];return _0x39db24;};'use strict';var _=require('lodash');var util=require(_0xf462('0x0'));var moment=require('moment');var BPromise=require(_0xf462('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf462('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf462('0x3'));var logger=require(_0xf462('0x4'))('rpc');var config=require(_0xf462('0x5'));var jayson=require(_0xf462('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4521a8,_0x17511d,_0xa1dcb){return new BPromise(function(_0x15af59,_0x1c6d9d){return client['request'](_0x4521a8,_0xa1dcb)[_0xf462('0x7')](function(_0x69a64b){logger[_0xf462('0x8')](_0xf462('0x9'),_0x17511d,_0xf462('0xa'));logger['debug'](_0xf462('0xb'),_0x17511d,'request\x20sent',JSON[_0xf462('0xc')](_0x69a64b));if(_0x69a64b[_0xf462('0xd')]){if(_0x69a64b[_0xf462('0xd')]['code']===0x1f4){logger['error'](_0xf462('0x9'),_0x17511d,_0x69a64b['error'][_0xf462('0xe')]);return _0x1c6d9d(_0x69a64b[_0xf462('0xd')][_0xf462('0xe')]);}logger[_0xf462('0xd')](_0xf462('0x9'),_0x17511d,_0x69a64b['error'][_0xf462('0xe')]);return _0x15af59(_0x69a64b[_0xf462('0xd')][_0xf462('0xe')]);}else{logger[_0xf462('0x8')](_0xf462('0x9'),_0x17511d,'request\x20sent');_0x15af59(_0x69a64b[_0xf462('0xf')][_0xf462('0xe')]);}})[_0xf462('0x10')](function(_0x485bc6){logger[_0xf462('0xd')](_0xf462('0x9'),_0x17511d,_0x485bc6);_0x1c6d9d(_0x485bc6);});});} \ No newline at end of file +var _0xd33e=['client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd33e,0x1b7));var _0xed33=function(_0x590cd0,_0x11bfd4){_0x590cd0=_0x590cd0-0x0;var _0x208eb0=_0xd33e[_0x590cd0];return _0x208eb0;};'use strict';var _=require(_0xed33('0x0'));var util=require('util');var moment=require(_0xed33('0x1'));var BPromise=require(_0xed33('0x2'));var rs=require(_0xed33('0x3'));var fs=require('fs');var Redis=require(_0xed33('0x4'));var db=require(_0xed33('0x5'))['db'];var utils=require(_0xed33('0x6'));var logger=require(_0xed33('0x7'))(_0xed33('0x8'));var config=require(_0xed33('0x9'));var jayson=require(_0xed33('0xa'));var client=jayson[_0xed33('0xb')][_0xed33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57d0e7,_0x136d9d,_0x30ee8b){return new BPromise(function(_0x2587c9,_0x484227){return client[_0xed33('0xd')](_0x57d0e7,_0x30ee8b)[_0xed33('0xe')](function(_0xbea503){logger['info'](_0xed33('0xf'),_0x136d9d,_0xed33('0x10'));logger[_0xed33('0x11')](_0xed33('0x12'),_0x136d9d,_0xed33('0x10'),JSON[_0xed33('0x13')](_0xbea503));if(_0xbea503[_0xed33('0x14')]){if(_0xbea503['error']['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x136d9d,_0xbea503['error']['message']);return _0x484227(_0xbea503[_0xed33('0x14')][_0xed33('0x15')]);}logger[_0xed33('0x14')](_0xed33('0xf'),_0x136d9d,_0xbea503[_0xed33('0x14')]['message']);return _0x2587c9(_0xbea503[_0xed33('0x14')][_0xed33('0x15')]);}else{logger[_0xed33('0x16')](_0xed33('0xf'),_0x136d9d,_0xed33('0x10'));_0x2587c9(_0xbea503[_0xed33('0x17')][_0xed33('0x15')]);}})[_0xed33('0x18')](function(_0xc5c97b){logger['error'](_0xed33('0xf'),_0x136d9d,_0xc5c97b);_0x484227(_0xc5c97b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 4434387..0b20c84 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 _0x190f=['index','/describe','describe','/:id','show','create','put','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x44fc3f,_0x4774d1){var _0x926ba3=function(_0x2af2a9){while(--_0x2af2a9){_0x44fc3f['push'](_0x44fc3f['shift']());}};_0x926ba3(++_0x4774d1);}(_0x190f,0x14d));var _0xf190=function(_0x120092,_0x222dff){_0x120092=_0x120092-0x0;var _0x4c29f7=_0x190f[_0x120092];return _0x4c29f7;};'use strict';var multer=require('multer');var util=require(_0xf190('0x0'));var path=require(_0xf190('0x1'));var timeout=require(_0xf190('0x2'));var express=require(_0xf190('0x3'));var router=express[_0xf190('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf190('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf190('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xf190('0x7')]('/',auth[_0xf190('0x8')](),controller[_0xf190('0x9')]);router['get'](_0xf190('0xa'),auth[_0xf190('0x8')](),controller[_0xf190('0xb')]);router['get'](_0xf190('0xc'),auth['isAuthenticated'](),controller[_0xf190('0xd')]);router['post']('/',auth[_0xf190('0x8')](),controller[_0xf190('0xe')]);router[_0xf190('0xf')]('/:id',auth[_0xf190('0x8')](),controller['update']);router['delete'](_0xf190('0xc'),auth['isAuthenticated'](),controller[_0xf190('0x10')]);module[_0xf190('0x11')]=router; \ No newline at end of file +var _0x8463=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','util','path','connect-timeout'];(function(_0x3ef5e9,_0x309745){var _0x3d12b5=function(_0x2bcde4){while(--_0x2bcde4){_0x3ef5e9['push'](_0x3ef5e9['shift']());}};_0x3d12b5(++_0x309745);}(_0x8463,0x18c));var _0x3846=function(_0x27bfd2,_0x54c745){_0x27bfd2=_0x27bfd2-0x0;var _0x578a86=_0x8463[_0x27bfd2];return _0x578a86;};'use strict';var multer=require('multer');var util=require(_0x3846('0x0'));var path=require(_0x3846('0x1'));var timeout=require(_0x3846('0x2'));var express=require(_0x3846('0x3'));var router=express[_0x3846('0x4')]();var fs_extra=require(_0x3846('0x5'));var auth=require(_0x3846('0x6'));var interaction=require(_0x3846('0x7'));var config=require('../../config/environment');var controller=require(_0x3846('0x8'));router[_0x3846('0x9')]('/',auth[_0x3846('0xa')](),controller[_0x3846('0xb')]);router[_0x3846('0x9')](_0x3846('0xc'),auth['isAuthenticated'](),controller[_0x3846('0xd')]);router['get']('/:id',auth[_0x3846('0xa')](),controller[_0x3846('0xe')]);router[_0x3846('0xf')]('/',auth[_0x3846('0xa')](),controller[_0x3846('0x10')]);router[_0x3846('0x11')](_0x3846('0x12'),auth[_0x3846('0xa')](),controller['update']);router[_0x3846('0x13')](_0x3846('0x12'),auth[_0x3846('0xa')](),controller[_0x3846('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index f08da73..afd2eee 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 _0x6e36=['ENUM','timeout','mouseOver','sequelize','exports','STRING'];(function(_0x427787,_0xf1abc9){var _0x4f5f61=function(_0x6ff455){while(--_0x6ff455){_0x427787['push'](_0x427787['shift']());}};_0x4f5f61(++_0xf1abc9);}(_0x6e36,0x18f));var _0x66e3=function(_0x4368b4,_0x38be14){_0x4368b4=_0x4368b4-0x0;var _0x2602d9=_0x6e36[_0x4368b4];return _0x2602d9;};'use strict';var Sequelize=require(_0x66e3('0x0'));module[_0x66e3('0x1')]={'name':{'type':Sequelize[_0x66e3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x66e3('0x3')]('mouseOver',_0x66e3('0x4')),'defaultValue':_0x66e3('0x5')},'selector':{'type':Sequelize[_0x66e3('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7f8a=['timeout','mouseOver','sequelize','STRING','ENUM'];(function(_0x1127ea,_0x1bb829){var _0x3c8008=function(_0x446150){while(--_0x446150){_0x1127ea['push'](_0x1127ea['shift']());}};_0x3c8008(++_0x1bb829);}(_0x7f8a,0xbb));var _0xa7f8=function(_0x4ffaa0,_0x2c494b){_0x4ffaa0=_0x4ffaa0-0x0;var _0x37e66c=_0x7f8a[_0x4ffaa0];return _0x37e66c;};'use strict';var Sequelize=require(_0xa7f8('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7f8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa7f8('0x2')]('mouseOver',_0xa7f8('0x3')),'defaultValue':_0xa7f8('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 880bfe3..3275738 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 _0x51f2=['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','undefined','limit','count','Content-Range','apply','reject','destroy','then','error','stack','name','show','params','rawAttributes','query','keys','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','ChatProactiveAction','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51f2,0xeb));var _0x251f=function(_0x4fb073,_0xc9ec3c){_0x4fb073=_0x4fb073-0x0;var _0x198931=_0x51f2[_0x4fb073];return _0x198931;};'use strict';var emlformat=require(_0x251f('0x0'));var rimraf=require(_0x251f('0x1'));var zipdir=require(_0x251f('0x2'));var jsonpatch=require(_0x251f('0x3'));var rp=require(_0x251f('0x4'));var moment=require(_0x251f('0x5'));var BPromise=require(_0x251f('0x6'));var Mustache=require(_0x251f('0x7'));var util=require(_0x251f('0x8'));var path=require('path');var sox=require(_0x251f('0x9'));var csv=require(_0x251f('0xa'));var ejs=require(_0x251f('0xb'));var fs=require('fs');var fs_extra=require(_0x251f('0xc'));var _=require(_0x251f('0xd'));var squel=require('squel');var crypto=require(_0x251f('0xe'));var jsforce=require(_0x251f('0xf'));var deskjs=require(_0x251f('0x10'));var toCsv=require(_0x251f('0xa'));var querystring=require('querystring');var Papa=require(_0x251f('0x11'));var Redis=require(_0x251f('0x12'));var authService=require(_0x251f('0x13'));var qs=require(_0x251f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x251f('0x15'));var logger=require(_0x251f('0x16'))(_0x251f('0x17'));var utils=require(_0x251f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x251f('0x19'));var db=require(_0x251f('0x1a'))['db'];function respondWithStatusCode(_0x262da7,_0x1d923a){_0x1d923a=_0x1d923a||0xcc;return function(_0x13802a){if(_0x13802a){return _0x262da7[_0x251f('0x1b')](_0x1d923a);}return _0x262da7[_0x251f('0x1c')](_0x1d923a)[_0x251f('0x1d')]();};}function respondWithResult(_0x3806b1,_0x1de162){_0x1de162=_0x1de162||0xc8;return function(_0x1837d1){if(_0x1837d1){return _0x3806b1['status'](_0x1de162)[_0x251f('0x1e')](_0x1837d1);}};}function respondWithFilteredResult(_0x9d39e3,_0x4e1492){return function(_0x1f6c55){if(_0x1f6c55){var _0x4303e2=typeof _0x4e1492[_0x251f('0x1f')]===_0x251f('0x20')&&typeof _0x4e1492[_0x251f('0x21')]==='undefined';var _0x5d34b2=_0x1f6c55[_0x251f('0x22')];var _0x39e173=_0x4303e2?0x0:_0x4e1492[_0x251f('0x1f')];var _0x44414b=_0x4303e2?_0x1f6c55[_0x251f('0x22')]:_0x4e1492['offset']+_0x4e1492[_0x251f('0x21')];var _0x2198a7;if(_0x44414b>=_0x5d34b2){_0x44414b=_0x5d34b2;_0x2198a7=0xc8;}else{_0x2198a7=0xce;}_0x9d39e3['status'](_0x2198a7);return _0x9d39e3['set'](_0x251f('0x23'),_0x39e173+'-'+_0x44414b+'/'+_0x5d34b2)[_0x251f('0x1e')](_0x1f6c55);}return null;};}function patchUpdates(_0x63fa24){return function(_0x11df74){try{jsonpatch[_0x251f('0x24')](_0x11df74,_0x63fa24,!![]);}catch(_0x52f31d){return BPromise[_0x251f('0x25')](_0x52f31d);}return _0x11df74['save']();};}function saveUpdates(_0x5ac4ba,_0x25d2e8){return function(_0xdd907d){if(_0xdd907d){return _0xdd907d['update'](_0x5ac4ba)['then'](function(_0x124dd2){return _0x124dd2;});}return null;};}function removeEntity(_0x4e64ec,_0x5549b0){return function(_0x2da7ad){if(_0x2da7ad){return _0x2da7ad[_0x251f('0x26')]()[_0x251f('0x27')](function(){_0x4e64ec['status'](0xcc)[_0x251f('0x1d')]();});}};}function handleEntityNotFound(_0x1f770c,_0x5d5790){return function(_0x56979d){if(!_0x56979d){_0x1f770c[_0x251f('0x1b')](0x194);}return _0x56979d;};}function handleError(_0x3e2655,_0x31c6e3){_0x31c6e3=_0x31c6e3||0x1f4;return function(_0x2f117f){logger[_0x251f('0x28')](_0x2f117f[_0x251f('0x29')]);if(_0x2f117f[_0x251f('0x2a')]){delete _0x2f117f[_0x251f('0x2a')];}_0x3e2655[_0x251f('0x1c')](_0x31c6e3)['send'](_0x2f117f);};}exports[_0x251f('0x2b')]=function(_0x13c6be,_0x884459){var _0x66f303={'raw':!![],'where':{'id':_0x13c6be[_0x251f('0x2c')]['id']}},_0x24032={};_0x24032['model']=_['keys'](db['ChatProactiveAction'][_0x251f('0x2d')]);_0x24032[_0x251f('0x2e')]=_[_0x251f('0x2f')](_0x13c6be[_0x251f('0x2e')]);_0x24032['filters']=_[_0x251f('0x30')](_0x24032[_0x251f('0x31')],_0x24032['query']);_0x66f303[_0x251f('0x32')]=_[_0x251f('0x30')](_0x24032['model'],qs[_0x251f('0x33')](_0x13c6be['query'][_0x251f('0x33')]));_0x66f303['attributes']=_0x66f303[_0x251f('0x32')][_0x251f('0x34')]?_0x66f303[_0x251f('0x32')]:_0x24032[_0x251f('0x31')];if(_0x13c6be[_0x251f('0x2e')][_0x251f('0x35')]){_0x66f303[_0x251f('0x36')]=[{'all':!![]}];}_0x66f303=_[_0x251f('0x37')]({},_0x66f303,_0x13c6be[_0x251f('0x38')]);return db['ChatProactiveAction'][_0x251f('0x39')](_0x66f303)[_0x251f('0x27')](handleEntityNotFound(_0x884459,null))[_0x251f('0x27')](respondWithResult(_0x884459,null))[_0x251f('0x3a')](handleError(_0x884459,null));};exports['create']=function(_0x103531,_0x3b3930){return db[_0x251f('0x3b')][_0x251f('0x3c')](_0x103531[_0x251f('0x3d')],{})[_0x251f('0x27')](respondWithResult(_0x3b3930,0xc9))['catch'](handleError(_0x3b3930,null));};exports[_0x251f('0x3e')]=function(_0x21f929,_0x41ea75){if(_0x21f929['body']['id']){delete _0x21f929[_0x251f('0x3d')]['id'];}return db['ChatProactiveAction'][_0x251f('0x39')]({'where':{'id':_0x21f929[_0x251f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x41ea75,null))[_0x251f('0x27')](saveUpdates(_0x21f929[_0x251f('0x3d')],null))[_0x251f('0x27')](respondWithResult(_0x41ea75,null))[_0x251f('0x3a')](handleError(_0x41ea75,null));};exports['destroy']=function(_0x32c01e,_0x19500a){return db['ChatProactiveAction']['find']({'where':{'id':_0x32c01e['params']['id']}})['then'](handleEntityNotFound(_0x19500a,null))[_0x251f('0x27')](removeEntity(_0x19500a,null))[_0x251f('0x3a')](handleError(_0x19500a,null));}; \ No newline at end of file +var _0x2bd8=['count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','show','ChatProactiveAction','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x2bd8,0x130));var _0x82bd=function(_0x4519eb,_0x320dea){_0x4519eb=_0x4519eb-0x0;var _0x3198a5=_0x2bd8[_0x4519eb];return _0x3198a5;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={'raw':!![],'where':{'id':_0x52bcd8['params']['id']}},_0x363ef9={};_0x363ef9['model']=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x363ef9[_0x82bd('0x29')]=_['keys'](_0x52bcd8[_0x82bd('0x29')]);_0x363ef9['filters']=_[_0x82bd('0x2a')](_0x363ef9[_0x82bd('0x2b')],_0x363ef9[_0x82bd('0x29')]);_0x190bca[_0x82bd('0x2c')]=_[_0x82bd('0x2a')](_0x363ef9[_0x82bd('0x2b')],qs['fields'](_0x52bcd8[_0x82bd('0x29')][_0x82bd('0x2d')]));_0x190bca[_0x82bd('0x2c')]=_0x190bca['attributes'][_0x82bd('0x2e')]?_0x190bca['attributes']:_0x363ef9['model'];if(_0x52bcd8[_0x82bd('0x29')][_0x82bd('0x2f')]){_0x190bca[_0x82bd('0x30')]=[{'all':!![]}];}_0x190bca=_[_0x82bd('0x31')]({},_0x190bca,_0x52bcd8[_0x82bd('0x32')]);return db[_0x82bd('0x27')][_0x82bd('0x33')](_0x190bca)[_0x82bd('0x22')](handleEntityNotFound(_0x351d3d,null))[_0x82bd('0x22')](respondWithResult(_0x351d3d,null))[_0x82bd('0x34')](handleError(_0x351d3d,null));};exports[_0x82bd('0x35')]=function(_0xe666bd,_0x29813b){return db[_0x82bd('0x27')][_0x82bd('0x35')](_0xe666bd[_0x82bd('0x36')],{})[_0x82bd('0x22')](respondWithResult(_0x29813b,0xc9))['catch'](handleError(_0x29813b,null));};exports['update']=function(_0x59319d,_0x3fea10){if(_0x59319d[_0x82bd('0x36')]['id']){delete _0x59319d['body']['id'];}return db[_0x82bd('0x27')]['find']({'where':{'id':_0x59319d['params']['id']}})['then'](handleEntityNotFound(_0x3fea10,null))[_0x82bd('0x22')](saveUpdates(_0x59319d[_0x82bd('0x36')],null))[_0x82bd('0x22')](respondWithResult(_0x3fea10,null))[_0x82bd('0x34')](handleError(_0x3fea10,null));};exports[_0x82bd('0x23')]=function(_0x4c3c38,_0x54e33f){return db['ChatProactiveAction'][_0x82bd('0x33')]({'where':{'id':_0x4c3c38['params']['id']}})['then'](handleEntityNotFound(_0x54e33f,null))[_0x82bd('0x22')](removeEntity(_0x54e33f,null))[_0x82bd('0x34')](handleError(_0x54e33f,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 44fd4b1..703e457 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 _0x66d5=['exports','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x66d5,0x1e3));var _0x566d=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x66d5[_0xb0de07];return _0x4633d8;};'use strict';var _=require('lodash');var util=require(_0x566d('0x0'));var logger=require(_0x566d('0x1'))(_0x566d('0x2'));var moment=require('moment');var BPromise=require(_0x566d('0x3'));var rp=require(_0x566d('0x4'));var fs=require('fs');var path=require(_0x566d('0x5'));var rimraf=require(_0x566d('0x6'));var config=require(_0x566d('0x7'));var attributes=require(_0x566d('0x8'));module[_0x566d('0x9')]=function(_0x4bb55f,_0x796a76){return _0x4bb55f['define'](_0x566d('0xa'),attributes,{'tableName':_0x566d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfb6=['../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b0b78,_0x7783e5){var _0x5b41c4=function(_0x5024e1){while(--_0x5024e1){_0x1b0b78['push'](_0x1b0b78['shift']());}};_0x5b41c4(++_0x7783e5);}(_0xbfb6,0x19c));var _0x6bfb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbfb6[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x6bfb('0x0'));var logger=require(_0x6bfb('0x1'))(_0x6bfb('0x2'));var moment=require(_0x6bfb('0x3'));var BPromise=require(_0x6bfb('0x4'));var rp=require(_0x6bfb('0x5'));var fs=require('fs');var path=require(_0x6bfb('0x6'));var rimraf=require(_0x6bfb('0x7'));var config=require(_0x6bfb('0x8'));var attributes=require(_0x6bfb('0x9'));module[_0x6bfb('0xa')]=function(_0x2a25ca,_0x50d053){return _0x2a25ca[_0x6bfb('0xb')](_0x6bfb('0xc'),attributes,{'tableName':_0x6bfb('0xd'),'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 a145143..86e1b70 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 _0xabe7=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x2a3a82,_0x231059){var _0x1d13b8=function(_0x41fe91){while(--_0x41fe91){_0x2a3a82['push'](_0x2a3a82['shift']());}};_0x1d13b8(++_0x231059);}(_0xabe7,0xa4));var _0x7abe=function(_0x3973e4,_0x44eacf){_0x3973e4=_0x3973e4-0x0;var _0xb0b809=_0xabe7[_0x3973e4];return _0xb0b809;};'use strict';var _=require('lodash');var util=require(_0x7abe('0x0'));var moment=require(_0x7abe('0x1'));var BPromise=require(_0x7abe('0x2'));var rs=require(_0x7abe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7abe('0x4'))['db'];var utils=require(_0x7abe('0x5'));var logger=require(_0x7abe('0x6'))('rpc');var config=require(_0x7abe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7abe('0x8')][_0x7abe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x123716,_0x1f2f7d,_0x547b6f){return new BPromise(function(_0x469daf,_0x34efcf){return client[_0x7abe('0xa')](_0x123716,_0x547b6f)[_0x7abe('0xb')](function(_0x3ca36d){logger[_0x7abe('0xc')](_0x7abe('0xd'),_0x1f2f7d,_0x7abe('0xe'));logger['debug'](_0x7abe('0xf'),_0x1f2f7d,_0x7abe('0xe'),JSON[_0x7abe('0x10')](_0x3ca36d));if(_0x3ca36d[_0x7abe('0x11')]){if(_0x3ca36d['error'][_0x7abe('0x12')]===0x1f4){logger[_0x7abe('0x11')](_0x7abe('0xd'),_0x1f2f7d,_0x3ca36d[_0x7abe('0x11')][_0x7abe('0x13')]);return _0x34efcf(_0x3ca36d[_0x7abe('0x11')][_0x7abe('0x13')]);}logger['error'](_0x7abe('0xd'),_0x1f2f7d,_0x3ca36d['error'][_0x7abe('0x13')]);return _0x469daf(_0x3ca36d[_0x7abe('0x11')][_0x7abe('0x13')]);}else{logger[_0x7abe('0xc')](_0x7abe('0xd'),_0x1f2f7d,_0x7abe('0xe'));_0x469daf(_0x3ca36d[_0x7abe('0x14')][_0x7abe('0x13')]);}})[_0x7abe('0x15')](function(_0x127cff){logger[_0x7abe('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1f2f7d,_0x127cff);_0x34efcf(_0x127cff);});});} \ No newline at end of file +var _0x7b3d=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x7b3d,0x19a));var _0xd7b3=function(_0x5d2a66,_0x5387a3){_0x5d2a66=_0x5d2a66-0x0;var _0x52a709=_0x7b3d[_0x5d2a66];return _0x52a709;};'use strict';var _=require(_0xd7b3('0x0'));var util=require(_0xd7b3('0x1'));var moment=require(_0xd7b3('0x2'));var BPromise=require(_0xd7b3('0x3'));var rs=require(_0xd7b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7b3('0x5'))['db'];var utils=require(_0xd7b3('0x6'));var logger=require(_0xd7b3('0x7'))(_0xd7b3('0x8'));var config=require('../../config/environment');var jayson=require(_0xd7b3('0x9'));var client=jayson[_0xd7b3('0xa')][_0xd7b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb41ad1,_0x52bf2f,_0x9e09a3){return new BPromise(function(_0x220526,_0x24903f){return client['request'](_0xb41ad1,_0x9e09a3)[_0xd7b3('0xc')](function(_0x2190c1){logger[_0xd7b3('0xd')](_0xd7b3('0xe'),_0x52bf2f,_0xd7b3('0xf'));logger[_0xd7b3('0x10')](_0xd7b3('0x11'),_0x52bf2f,_0xd7b3('0xf'),JSON[_0xd7b3('0x12')](_0x2190c1));if(_0x2190c1[_0xd7b3('0x13')]){if(_0x2190c1[_0xd7b3('0x13')][_0xd7b3('0x14')]===0x1f4){logger[_0xd7b3('0x13')](_0xd7b3('0xe'),_0x52bf2f,_0x2190c1[_0xd7b3('0x13')][_0xd7b3('0x15')]);return _0x24903f(_0x2190c1[_0xd7b3('0x13')][_0xd7b3('0x15')]);}logger[_0xd7b3('0x13')](_0xd7b3('0xe'),_0x52bf2f,_0x2190c1[_0xd7b3('0x13')][_0xd7b3('0x15')]);return _0x220526(_0x2190c1['error'][_0xd7b3('0x15')]);}else{logger[_0xd7b3('0xd')](_0xd7b3('0xe'),_0x52bf2f,_0xd7b3('0xf'));_0x220526(_0x2190c1['result']['message']);}})[_0xd7b3('0x16')](function(_0x4d605e){logger[_0xd7b3('0x13')](_0xd7b3('0xe'),_0x52bf2f,_0x4d605e);_0x24903f(_0x4d605e);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 583d444..5e7beba 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x42c330,_0x5f4dbc){var _0x18433a=function(_0x55b4ac){while(--_0x55b4ac){_0x42c330['push'](_0x42c330['shift']());}};_0x18433a(++_0x5f4dbc);}(_0x33c5,0xe6));var _0x533c=function(_0x154cb5,_0x1a8d5a){_0x154cb5=_0x154cb5-0x0;var _0x3f574f=_0x33c5[_0x154cb5];return _0x3f574f;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file +var _0xac9d=['get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2c6e27,_0x437207){var _0xe7808e=function(_0x59b9ae){while(--_0x59b9ae){_0x2c6e27['push'](_0x2c6e27['shift']());}};_0xe7808e(++_0x437207);}(_0xac9d,0x14d));var _0xdac9=function(_0x3dc1c6,_0x8529a1){_0x3dc1c6=_0x3dc1c6-0x0;var _0x3c82ce=_0xac9d[_0x3dc1c6];return _0x3c82ce;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xdac9('0x9')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0xc')]);router[_0xdac9('0xd')]('/',auth[_0xdac9('0xb')](),controller['create']);router[_0xdac9('0xe')]('/:id',auth[_0xdac9('0xb')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 88d9260..a4c342f 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 _0x7e3f=['beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x7e3f,0x1e5));var _0xf7e3=function(_0x2fadca,_0x3deda8){_0x2fadca=_0x2fadca-0x0;var _0x260094=_0x7e3f[_0x2fadca];return _0x260094;};'use strict';var Sequelize=require(_0xf7e3('0x0'));module['exports']={'name':{'type':Sequelize[_0xf7e3('0x1')],'unique':_0xf7e3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf7e3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf7e3('0x4')]('rrmemory',_0xf7e3('0x5'),_0xf7e3('0x6'))}}; \ No newline at end of file +var _0xff0d=['roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xff0d,0x109));var _0xdff0=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xff0d[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');module[_0xdff0('0x0')]={'name':{'type':Sequelize[_0xdff0('0x1')],'unique':_0xdff0('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdff0('0x1')]},'timeout':{'type':Sequelize[_0xdff0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdff0('0x4')](_0xdff0('0x5'),_0xdff0('0x6'),_0xdff0('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 86bd3f6..4d61895 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 _0xbab6=['removeAgents','forEach','emit','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatQueue.socket','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','options','includeAll','findAll','rows','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','params','order','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','filter','addTeams','ids','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','userChatQueue:save','removeTeams','select','field','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbab6,0x1dd));var _0x6bab=function(_0x148b4d,_0x41d815){_0x148b4d=_0x148b4d-0x0;var _0x42441c=_0xbab6[_0x148b4d];return _0x42441c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6bab('0x0'));var zipdir=require(_0x6bab('0x1'));var jsonpatch=require(_0x6bab('0x2'));var rp=require('request-promise');var moment=require(_0x6bab('0x3'));var BPromise=require(_0x6bab('0x4'));var Mustache=require('mustache');var util=require(_0x6bab('0x5'));var path=require(_0x6bab('0x6'));var sox=require(_0x6bab('0x7'));var csv=require(_0x6bab('0x8'));var ejs=require(_0x6bab('0x9'));var fs=require('fs');var fs_extra=require(_0x6bab('0xa'));var _=require('lodash');var squel=require(_0x6bab('0xb'));var crypto=require(_0x6bab('0xc'));var jsforce=require(_0x6bab('0xd'));var deskjs=require(_0x6bab('0xe'));var toCsv=require(_0x6bab('0x8'));var querystring=require('querystring');var Papa=require(_0x6bab('0xf'));var Redis=require(_0x6bab('0x10'));var authService=require(_0x6bab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6bab('0x12'));var hardwareService=require(_0x6bab('0x13'));var logger=require(_0x6bab('0x14'))(_0x6bab('0x15'));var utils=require('../../config/utils');var config=require(_0x6bab('0x16'));var licenseUtil=require(_0x6bab('0x17'));var db=require('../../mysqldb')['db'];config[_0x6bab('0x18')]=_[_0x6bab('0x19')](config[_0x6bab('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6bab('0x1a'))(new Redis(config['redis']));require(_0x6bab('0x1b'))['register'](socket);var jayson=require(_0x6bab('0x1c'));var client=jayson[_0x6bab('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1df185,_0x28afa3,_0x3f52da,_0x4c7c65){return new BPromise(function(_0x70e158,_0x382843){var _0x41de49=_0x4c7c65||client;return _0x41de49[_0x6bab('0x1e')](_0x1df185,_0x3f52da)[_0x6bab('0x1f')](function(_0x3e4957){logger[_0x6bab('0x20')](_0x6bab('0x21'),_0x28afa3,_0x6bab('0x22'));logger[_0x6bab('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x28afa3,_0x6bab('0x22'),JSON[_0x6bab('0x24')](_0x3e4957));if(_0x3e4957[_0x6bab('0x25')]){if(_0x3e4957[_0x6bab('0x25')][_0x6bab('0x26')]===0x1f4){logger['error'](_0x6bab('0x21'),_0x28afa3,_0x3e4957[_0x6bab('0x25')]['message']);return _0x382843(_0x3e4957[_0x6bab('0x25')][_0x6bab('0x27')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x28afa3,_0x3e4957[_0x6bab('0x25')][_0x6bab('0x27')]);return _0x70e158(_0x3e4957['error'][_0x6bab('0x27')]);}else{logger[_0x6bab('0x20')](_0x6bab('0x21'),_0x28afa3,_0x6bab('0x22'));_0x70e158(_0x3e4957[_0x6bab('0x28')][_0x6bab('0x27')]);}})[_0x6bab('0x29')](function(_0x327824){logger[_0x6bab('0x25')](_0x6bab('0x21'),_0x28afa3,_0x327824);_0x382843(_0x327824);});});}function respondWithStatusCode(_0x31fa7d,_0x357864){_0x357864=_0x357864||0xcc;return function(_0x189952){if(_0x189952){return _0x31fa7d[_0x6bab('0x2a')](_0x357864);}return _0x31fa7d[_0x6bab('0x2b')](_0x357864)['end']();};}function respondWithResult(_0x1097cf,_0x367937){_0x367937=_0x367937||0xc8;return function(_0x4b27eb){if(_0x4b27eb){return _0x1097cf[_0x6bab('0x2b')](_0x367937)['json'](_0x4b27eb);}};}function respondWithFilteredResult(_0x2898ec,_0x19f767){return function(_0x2b3f0f){if(_0x2b3f0f){var _0x57fda4=typeof _0x19f767[_0x6bab('0x2c')]===_0x6bab('0x2d')&&typeof _0x19f767[_0x6bab('0x2e')]===_0x6bab('0x2d');var _0xbf9db8=_0x2b3f0f[_0x6bab('0x2f')];var _0x5bc230=_0x57fda4?0x0:_0x19f767[_0x6bab('0x2c')];var _0x4c87a7=_0x57fda4?_0x2b3f0f[_0x6bab('0x2f')]:_0x19f767[_0x6bab('0x2c')]+_0x19f767[_0x6bab('0x2e')];var _0x56acf3;if(_0x4c87a7>=_0xbf9db8){_0x4c87a7=_0xbf9db8;_0x56acf3=0xc8;}else{_0x56acf3=0xce;}_0x2898ec[_0x6bab('0x2b')](_0x56acf3);return _0x2898ec[_0x6bab('0x30')](_0x6bab('0x31'),_0x5bc230+'-'+_0x4c87a7+'/'+_0xbf9db8)[_0x6bab('0x32')](_0x2b3f0f);}return null;};}function patchUpdates(_0x29465d){return function(_0xd1971){try{jsonpatch['apply'](_0xd1971,_0x29465d,!![]);}catch(_0x388fb5){return BPromise['reject'](_0x388fb5);}return _0xd1971[_0x6bab('0x33')]();};}function saveUpdates(_0xffdd7b,_0x421e33){return function(_0x485dd2){if(_0x485dd2){return _0x485dd2[_0x6bab('0x34')](_0xffdd7b)[_0x6bab('0x1f')](function(_0x6ee77b){return _0x6ee77b;});}return null;};}function removeEntity(_0x303691,_0x1e14d3){return function(_0x1cac8a){if(_0x1cac8a){return _0x1cac8a[_0x6bab('0x35')]()[_0x6bab('0x1f')](function(){var _0x32d404=_0x1cac8a[_0x6bab('0x36')]({'plain':!![]});var _0x11aa65=_0x6bab('0x37');return db[_0x6bab('0x38')][_0x6bab('0x35')]({'where':{'type':_0x11aa65,'resourceId':_0x32d404['id']}})[_0x6bab('0x1f')](function(){return _0x1cac8a;});})[_0x6bab('0x1f')](function(){_0x303691[_0x6bab('0x2b')](0xcc)[_0x6bab('0x39')]();});}};}function handleEntityNotFound(_0x3faa03,_0x326296){return function(_0x17f9dc){if(!_0x17f9dc){_0x3faa03[_0x6bab('0x2a')](0x194);}return _0x17f9dc;};}function handleError(_0x29b719,_0x3acc0f){_0x3acc0f=_0x3acc0f||0x1f4;return function(_0x13ff14){logger[_0x6bab('0x25')](_0x13ff14[_0x6bab('0x3a')]);if(_0x13ff14[_0x6bab('0x3b')]){delete _0x13ff14[_0x6bab('0x3b')];}_0x29b719[_0x6bab('0x2b')](_0x3acc0f)[_0x6bab('0x3c')](_0x13ff14);};}exports[_0x6bab('0x3d')]=function(_0x473a35,_0x53b4d6){var _0x2e88eb={},_0x5beb8d={},_0x4cc39e={'count':0x0,'rows':[]};var _0x28f98b=_[_0x6bab('0x3e')](db[_0x6bab('0x3f')][_0x6bab('0x40')],function(_0x589051){return{'name':_0x589051[_0x6bab('0x41')],'type':_0x589051['type'][_0x6bab('0x42')]};});_0x5beb8d[_0x6bab('0x43')]=_['map'](_0x28f98b,_0x6bab('0x3b'));_0x5beb8d[_0x6bab('0x44')]=_[_0x6bab('0x45')](_0x473a35['query']);_0x5beb8d[_0x6bab('0x46')]=_[_0x6bab('0x47')](_0x5beb8d[_0x6bab('0x43')],_0x5beb8d[_0x6bab('0x44')]);_0x2e88eb[_0x6bab('0x48')]=_[_0x6bab('0x47')](_0x5beb8d[_0x6bab('0x43')],qs[_0x6bab('0x49')](_0x473a35[_0x6bab('0x44')][_0x6bab('0x49')]));_0x2e88eb['attributes']=_0x2e88eb[_0x6bab('0x48')][_0x6bab('0x4a')]?_0x2e88eb[_0x6bab('0x48')]:_0x5beb8d[_0x6bab('0x43')];if(!_0x473a35['query'][_0x6bab('0x4b')](_0x6bab('0x4c'))){_0x2e88eb[_0x6bab('0x2e')]=qs['limit'](_0x473a35['query']['limit']);_0x2e88eb[_0x6bab('0x2c')]=qs['offset'](_0x473a35[_0x6bab('0x44')][_0x6bab('0x2c')]);}_0x2e88eb['order']=qs[_0x6bab('0x4d')](_0x473a35[_0x6bab('0x44')][_0x6bab('0x4d')]);_0x2e88eb[_0x6bab('0x4e')]=qs['filters'](_[_0x6bab('0x4f')](_0x473a35[_0x6bab('0x44')],_0x5beb8d['filters']),_0x28f98b);if(_0x473a35['query']['filter']){_0x2e88eb['where']=_['merge'](_0x2e88eb[_0x6bab('0x4e')],{'$or':_[_0x6bab('0x3e')](_0x28f98b,function(_0x1f2631){if(_0x1f2631[_0x6bab('0x50')]!==_0x6bab('0x51')){var _0x1768be={};_0x1768be[_0x1f2631[_0x6bab('0x3b')]]={'$like':'%'+_0x473a35['query']['filter']+'%'};return _0x1768be;}})});}_0x2e88eb=_[_0x6bab('0x52')]({},_0x2e88eb,_0x473a35[_0x6bab('0x53')]);var _0x2e7390={'where':_0x2e88eb[_0x6bab('0x4e')]};return db[_0x6bab('0x3f')][_0x6bab('0x2f')](_0x2e7390)[_0x6bab('0x1f')](function(_0xe7bc09){_0x4cc39e[_0x6bab('0x2f')]=_0xe7bc09;if(_0x473a35['query'][_0x6bab('0x54')]){_0x2e88eb['include']=[{'all':!![]}];}return db['ChatQueue'][_0x6bab('0x55')](_0x2e88eb);})[_0x6bab('0x1f')](function(_0x3c0892){_0x4cc39e[_0x6bab('0x56')]=_0x3c0892;return _0x4cc39e;})['then'](respondWithFilteredResult(_0x53b4d6,_0x2e88eb))[_0x6bab('0x29')](handleError(_0x53b4d6,null));};exports['show']=function(_0x3720d4,_0x8f6a9e){var _0x4fabe2={'raw':!![],'where':{'id':_0x3720d4['params']['id']}},_0x25027a={};_0x25027a[_0x6bab('0x43')]=_['keys'](db[_0x6bab('0x3f')][_0x6bab('0x40')]);_0x25027a[_0x6bab('0x44')]=_[_0x6bab('0x45')](_0x3720d4[_0x6bab('0x44')]);_0x25027a[_0x6bab('0x46')]=_['intersection'](_0x25027a[_0x6bab('0x43')],_0x25027a[_0x6bab('0x44')]);_0x4fabe2['attributes']=_[_0x6bab('0x47')](_0x25027a[_0x6bab('0x43')],qs[_0x6bab('0x49')](_0x3720d4['query'][_0x6bab('0x49')]));_0x4fabe2[_0x6bab('0x48')]=_0x4fabe2[_0x6bab('0x48')]['length']?_0x4fabe2[_0x6bab('0x48')]:_0x25027a['model'];if(_0x3720d4[_0x6bab('0x44')][_0x6bab('0x54')]){_0x4fabe2[_0x6bab('0x57')]=[{'all':!![]}];}_0x4fabe2=_[_0x6bab('0x52')]({},_0x4fabe2,_0x3720d4[_0x6bab('0x53')]);return db[_0x6bab('0x3f')][_0x6bab('0x58')](_0x4fabe2)[_0x6bab('0x1f')](handleEntityNotFound(_0x8f6a9e,null))['then'](respondWithResult(_0x8f6a9e,null))[_0x6bab('0x29')](handleError(_0x8f6a9e,null));};exports[_0x6bab('0x59')]=function(_0x25090c,_0x4740a1){return db[_0x6bab('0x3f')][_0x6bab('0x59')](_0x25090c['body'],{})[_0x6bab('0x1f')](function(_0x4ef257){var _0x23ad54=_0x25090c[_0x6bab('0x5a')][_0x6bab('0x36')]({'plain':!![]});if(!_0x23ad54)throw new Error(_0x6bab('0x5b'));if(_0x23ad54[_0x6bab('0x5c')]===_0x6bab('0x5a')){var _0x5b2e97=_0x4ef257['get']({'plain':!![]});var _0x31020f=_0x6bab('0x37');return db[_0x6bab('0x5d')][_0x6bab('0x58')]({'where':{'name':_0x31020f,'userProfileId':_0x23ad54[_0x6bab('0x5e')]},'raw':!![]})[_0x6bab('0x1f')](function(_0x233565){if(_0x233565&&_0x233565[_0x6bab('0x5f')]===0x0){return db[_0x6bab('0x38')][_0x6bab('0x59')]({'name':_0x5b2e97[_0x6bab('0x3b')],'resourceId':_0x5b2e97['id'],'type':_0x233565[_0x6bab('0x3b')],'sectionId':_0x233565['id']},{})[_0x6bab('0x1f')](function(){return _0x4ef257;});}else{return _0x4ef257;}})['catch'](function(_0x33f551){logger['error'](_0x6bab('0x60'),_0x33f551);throw _0x33f551;});}return _0x4ef257;})['then'](respondWithResult(_0x4740a1,0xc9))[_0x6bab('0x29')](handleError(_0x4740a1,null));};exports[_0x6bab('0x34')]=function(_0x17e2fd,_0xb450a1){if(_0x17e2fd[_0x6bab('0x61')]['id']){delete _0x17e2fd[_0x6bab('0x61')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x17e2fd['params']['id']}})[_0x6bab('0x1f')](handleEntityNotFound(_0xb450a1,null))[_0x6bab('0x1f')](saveUpdates(_0x17e2fd[_0x6bab('0x61')],null))[_0x6bab('0x1f')](respondWithResult(_0xb450a1,null))[_0x6bab('0x29')](handleError(_0xb450a1,null));};exports['destroy']=function(_0x570253,_0x310aa1){return db[_0x6bab('0x3f')][_0x6bab('0x58')]({'where':{'id':_0x570253['params']['id']}})['then'](handleEntityNotFound(_0x310aa1,null))[_0x6bab('0x1f')](removeEntity(_0x310aa1,null))[_0x6bab('0x29')](handleError(_0x310aa1,null));};exports[_0x6bab('0x62')]=function(_0x19145d,_0x12097d){return db[_0x6bab('0x3f')][_0x6bab('0x62')]()[_0x6bab('0x1f')](respondWithResult(_0x12097d,null))[_0x6bab('0x29')](handleError(_0x12097d,null));};exports['getMembers']=function(_0x24d5fb,_0x5ef96a,_0x158607){var _0x3eccb5={'raw':!![],'where':{}},_0x4c5089={},_0x3c595c;return db['ChatQueue']['findOne']({'where':{'id':_0x24d5fb[_0x6bab('0x63')]['id']}})[_0x6bab('0x1f')](handleEntityNotFound(_0x5ef96a,null))[_0x6bab('0x1f')](function(_0x1098ce){if(_0x1098ce){_0x3c595c=_0x1098ce[_0x6bab('0x36')]({'plain':!![]});_0x4c5089[_0x6bab('0x43')]=_[_0x6bab('0x45')](db['UserChatQueue'][_0x6bab('0x40')]);_0x4c5089[_0x6bab('0x44')]=_[_0x6bab('0x45')](_0x24d5fb['query']);_0x4c5089[_0x6bab('0x46')]=_['intersection'](_0x4c5089[_0x6bab('0x43')],_0x4c5089[_0x6bab('0x44')]);_0x3eccb5[_0x6bab('0x48')]=_['intersection'](_0x4c5089[_0x6bab('0x43')],qs['fields'](_0x24d5fb[_0x6bab('0x44')][_0x6bab('0x49')]));_0x3eccb5[_0x6bab('0x48')]=_0x3eccb5[_0x6bab('0x48')][_0x6bab('0x4a')]?_0x3eccb5['attributes']:_0x4c5089[_0x6bab('0x43')];if(!_0x24d5fb[_0x6bab('0x44')]['hasOwnProperty'](_0x6bab('0x4c'))){_0x3eccb5['limit']=qs[_0x6bab('0x2e')](_0x24d5fb[_0x6bab('0x44')][_0x6bab('0x2e')]);_0x3eccb5[_0x6bab('0x2c')]=qs[_0x6bab('0x2c')](_0x24d5fb[_0x6bab('0x44')][_0x6bab('0x2c')]);}_0x3eccb5[_0x6bab('0x64')]=qs[_0x6bab('0x4d')](_0x24d5fb[_0x6bab('0x44')]['sort']);_0x3eccb5[_0x6bab('0x4e')]=qs[_0x6bab('0x46')](_[_0x6bab('0x4f')](_0x24d5fb[_0x6bab('0x44')],_0x4c5089[_0x6bab('0x46')]));_0x3eccb5['where'][_0x6bab('0x65')]=_0x1098ce['id'];if(_0x24d5fb[_0x6bab('0x44')]['filter']){_0x3eccb5[_0x6bab('0x4e')]=_[_0x6bab('0x52')](_0x3eccb5['where'],{'$or':_[_0x6bab('0x3e')](_0x3eccb5[_0x6bab('0x48')],function(_0x4f11e9){var _0x955899={};_0x955899[_0x4f11e9]={'$like':'%'+_0x24d5fb['query']['filter']+'%'};return _0x955899;})});}_0x3eccb5=_['merge']({},_0x3eccb5,_0x24d5fb[_0x6bab('0x53')]);return db[_0x6bab('0x66')][_0x6bab('0x55')](_0x3eccb5);}})[_0x6bab('0x1f')](function(_0x5df944){if(_0x5df944){return db[_0x6bab('0x67')][_0x6bab('0x68')]({'where':{'id':_[_0x6bab('0x3e')](_0x5df944,_0x6bab('0x69')),'role':_0x6bab('0x6a')},'attributes':['id',_0x6bab('0x3b'),_0x6bab('0x6b'),_0x6bab('0x6c'),_0x6bab('0x6d')]});}})[_0x6bab('0x1f')](function(_0x5dafdf){if(_0x5dafdf){return{'count':_0x5dafdf[_0x6bab('0x2f')],'rows':_[_0x6bab('0x3e')](_0x5dafdf[_0x6bab('0x56')],function(_0x4f273c){return{'membername':_0x4f273c['name'],'UserId':_0x4f273c['id'],'queue_name':_0x3c595c['name'],'ChatQueueId':_0x3c595c['id'],'interface':util['format'](_0x6bab('0x6e'),_0x6bab('0x6f'),_0x4f273c[_0x6bab('0x3b')]),'penalty':0x0,'paused':_0x4f273c[_0x6bab('0x6b')],'createdAt':_0x4f273c[_0x6bab('0x6d')],'updatedAt':_0x4f273c[_0x6bab('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6bab('0x1f')](respondWithFilteredResult(_0x5ef96a,_0x3eccb5))['catch'](handleError(_0x5ef96a,null));};exports[_0x6bab('0x70')]=function(_0x152abe,_0x1dca61,_0x761259){var _0x570577={};var _0x54fd68={};var _0xc9b41a;var _0x1f5129;return db[_0x6bab('0x3f')][_0x6bab('0x71')]({'where':{'id':_0x152abe[_0x6bab('0x63')]['id']}})[_0x6bab('0x1f')](handleEntityNotFound(_0x1dca61,null))[_0x6bab('0x1f')](function(_0x1d5b74){if(_0x1d5b74){_0xc9b41a=_0x1d5b74;_0x54fd68[_0x6bab('0x43')]=_['keys'](db[_0x6bab('0x72')][_0x6bab('0x40')]);_0x54fd68[_0x6bab('0x44')]=_['keys'](_0x152abe[_0x6bab('0x44')]);_0x54fd68[_0x6bab('0x46')]=_['intersection'](_0x54fd68[_0x6bab('0x43')],_0x54fd68[_0x6bab('0x44')]);_0x570577[_0x6bab('0x48')]=_[_0x6bab('0x47')](_0x54fd68[_0x6bab('0x43')],qs[_0x6bab('0x49')](_0x152abe[_0x6bab('0x44')]['fields']));_0x570577[_0x6bab('0x48')]=_0x570577[_0x6bab('0x48')][_0x6bab('0x4a')]?_0x570577[_0x6bab('0x48')]:_0x54fd68[_0x6bab('0x43')];_0x570577[_0x6bab('0x64')]=qs['sort'](_0x152abe[_0x6bab('0x44')][_0x6bab('0x4d')]);_0x570577[_0x6bab('0x4e')]=qs['filters'](_[_0x6bab('0x4f')](_0x152abe[_0x6bab('0x44')],_0x54fd68[_0x6bab('0x46')]));if(_0x152abe[_0x6bab('0x44')]['filter']){_0x570577[_0x6bab('0x4e')]=_[_0x6bab('0x52')](_0x570577[_0x6bab('0x4e')],{'$or':_['map'](_0x570577['attributes'],function(_0x3c3e86){var _0x5467d7={};_0x5467d7[_0x3c3e86]={'$like':'%'+_0x152abe['query'][_0x6bab('0x73')]+'%'};return _0x5467d7;})});}_0x570577=_[_0x6bab('0x52')]({},_0x570577,_0x152abe[_0x6bab('0x53')]);return _0xc9b41a[_0x6bab('0x70')](_0x570577);}})['then'](function(_0x160bfe){if(_0x160bfe){_0x1f5129=_0x160bfe[_0x6bab('0x4a')];if(!_0x152abe[_0x6bab('0x44')]['hasOwnProperty']('nolimit')){_0x570577['limit']=qs[_0x6bab('0x2e')](_0x152abe[_0x6bab('0x44')][_0x6bab('0x2e')]);_0x570577['offset']=qs[_0x6bab('0x2c')](_0x152abe[_0x6bab('0x44')][_0x6bab('0x2c')]);}return _0xc9b41a[_0x6bab('0x70')](_0x570577);}})[_0x6bab('0x1f')](function(_0x5e4546){if(_0x5e4546){return _0x5e4546?{'count':_0x1f5129,'rows':_0x5e4546}:null;}})[_0x6bab('0x1f')](respondWithResult(_0x1dca61,null))[_0x6bab('0x29')](handleError(_0x1dca61,null));};exports[_0x6bab('0x74')]=function(_0x2d362b,_0x24e33a,_0x1d1735){var _0x47b17a=_0x2d362b[_0x6bab('0x61')][_0x6bab('0x75')];return db['Team'][_0x6bab('0x55')]({'where':{'id':_0x47b17a},'attributes':['id'],'include':[{'model':db[_0x6bab('0x67')],'as':_0x6bab('0x76'),'attributes':['id',_0x6bab('0x3b'),_0x6bab('0x77'),'voicePause','interface'],'raw':!![]}]})[_0x6bab('0x1f')](function(_0x265e4b){if(_0x265e4b){var _0xbc494e=_[_0x6bab('0x78')](_0x265e4b,function(_0x87b791){var _0x33d5e2=_0x87b791[_0x6bab('0x36')]({'plain':!![]});return _0x33d5e2['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x2d362b[_0x6bab('0x63')]['id']}})[_0x6bab('0x1f')](function(_0x394999){return db[_0x6bab('0x79')][_0x6bab('0x7a')](function(_0x586d94){return _0x394999['addTeams'](_0x47b17a,{'transaction':_0x586d94})[_0x6bab('0x1f')](function(){return BPromise[_0x6bab('0x7b')](_0xbc494e,function(_0x301821){return db[_0x6bab('0x66')][_0x6bab('0x7c')]({'where':{'UserId':_0x301821['id'],'ChatQueueId':_0x2d362b[_0x6bab('0x63')]['id']},'transaction':_0x586d94});});})[_0x6bab('0x1f')](function(){_0xbc494e['forEach'](function(_0x2b6617){socket['emit'](_0x6bab('0x7d'),{'UserId':_0x2b6617['id'],'ChatQueueId':_0x394999['id']});});});});});}})[_0x6bab('0x1f')](respondWithStatusCode(_0x24e33a,null))[_0x6bab('0x29')](handleError(_0x24e33a,null));};exports[_0x6bab('0x7e')]=function(_0x151848,_0x2d1484,_0x59f355){return db[_0x6bab('0x72')][_0x6bab('0x55')]({'where':{'id':_0x151848[_0x6bab('0x44')][_0x6bab('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6bab('0x76'),'attributes':['id'],'raw':!![]}]})[_0x6bab('0x1f')](handleEntityNotFound(_0x2d1484,null))[_0x6bab('0x1f')](function(_0x134d2e){var _0x4ef284=_['map'](_0x134d2e,'id');var _0x15da94=[];var _0x48d28e=[];var _0x1a5db9=squel[_0x6bab('0x7f')]();_0x1a5db9[_0x6bab('0x80')]('tq.TeamId')['from'](_0x6bab('0x81'),'tq')[_0x6bab('0x82')](_0x6bab('0x83'),'ut',_0x6bab('0x84'))[_0x6bab('0x4e')](_0x6bab('0x85'),_0x151848[_0x6bab('0x63')]['id']);for(var _0x39116f=0x0;_0x39116f<_0x134d2e['length'];_0x39116f+=0x1){let _0x2ef21b=_0x134d2e[_0x39116f];for(var _0x5a2ee4=0x0;_0x5a2ee4<_0x2ef21b[_0x6bab('0x76')][_0x6bab('0x4a')];_0x5a2ee4+=0x1){let _0x31ad4a=_0x2ef21b[_0x6bab('0x76')][_0x5a2ee4];var _0xe7db58=_0x1a5db9[_0x6bab('0x86')]();_0xe7db58[_0x6bab('0x4e')](_0x6bab('0x87'),_0x31ad4a['id']);_0x48d28e[_0x6bab('0x88')](db[_0x6bab('0x79')][_0x6bab('0x44')](_0xe7db58['toString'](),{'type':db[_0x6bab('0x79')][_0x6bab('0x89')][_0x6bab('0x8a')]})[_0x6bab('0x1f')](function(_0x2d4338){if(_0x2d4338[_0x6bab('0x4a')]===0x1){return _0x31ad4a['id'];}else{var _0x33246d=_[_0x6bab('0x8b')](_[_0x6bab('0x3e')](_0x2d4338,_0x6bab('0x8c')),function(_0x484aed){return _[_0x6bab('0x8d')](_0x4ef284,_0x484aed);});if(_0x33246d){return _0x31ad4a['id'];}}}));}}return BPromise[_0x6bab('0x8e')](_0x48d28e)[_0x6bab('0x1f')](function(_0x3774a9){_0x15da94=_(_0x15da94)[_0x6bab('0x8f')](_0x3774a9)[_0x6bab('0x90')]()[_0x6bab('0x91')]();return db[_0x6bab('0x3f')][_0x6bab('0x58')]({'where':{'id':_0x151848[_0x6bab('0x63')]['id']}})[_0x6bab('0x1f')](function(_0x24d56f){return db[_0x6bab('0x79')][_0x6bab('0x7a')](function(_0x20db28){return _0x24d56f[_0x6bab('0x7e')](_0x151848[_0x6bab('0x44')][_0x6bab('0x75')],{'transaction':_0x20db28})[_0x6bab('0x1f')](function(){if(!_[_0x6bab('0x92')](_0x15da94)){return _0x24d56f[_0x6bab('0x93')](_0x15da94,{'transaction':_0x20db28});}})['then'](function(){_0x15da94[_0x6bab('0x94')](function(_0x436faa){socket[_0x6bab('0x95')]('userChatQueue:remove',{'UserId':_0x436faa,'ChatQueueId':_0x24d56f['id']});});});});});});})['then'](respondWithStatusCode(_0x2d1484,null))[_0x6bab('0x29')](handleError(_0x2d1484,null));};exports[_0x6bab('0x96')]=function(_0x59dcee,_0x4a035e,_0x330868){return db['ChatQueue'][_0x6bab('0x58')]({'where':{'id':_0x59dcee[_0x6bab('0x63')]['id']}})['then'](handleEntityNotFound(_0x4a035e,null))[_0x6bab('0x1f')](function(_0x3486aa){if(_0x3486aa){return _0x3486aa[_0x6bab('0x96')](_0x59dcee[_0x6bab('0x61')][_0x6bab('0x75')],_[_0x6bab('0x97')](_0x59dcee[_0x6bab('0x61')],[_0x6bab('0x75'),'id'])||{})[_0x6bab('0x98')](function(_0x5946e9){for(var _0x5a6e2b=0x0;_0x5a6e2b<_0x59dcee['body']['ids']['length'];_0x5a6e2b+=0x1){socket['emit'](_0x6bab('0x7d'),{'UserId':Number(_0x59dcee[_0x6bab('0x61')][_0x6bab('0x75')][_0x5a6e2b]),'ChatQueueId':Number(_0x59dcee[_0x6bab('0x63')]['id'])});}return _0x5946e9;});}})[_0x6bab('0x1f')](respondWithResult(_0x4a035e,null))[_0x6bab('0x29')](handleError(_0x4a035e,null));};exports[_0x6bab('0x93')]=function(_0x19f671,_0x1ad293,_0x47d458){return db['ChatQueue'][_0x6bab('0x58')]({'where':{'id':_0x19f671[_0x6bab('0x63')]['id']}})['then'](handleEntityNotFound(_0x1ad293,null))[_0x6bab('0x1f')](function(_0x3048d9){if(_0x3048d9){return _0x3048d9[_0x6bab('0x93')](_0x19f671[_0x6bab('0x44')][_0x6bab('0x75')])[_0x6bab('0x1f')](function(){if(_[_0x6bab('0x99')](_0x19f671[_0x6bab('0x44')][_0x6bab('0x75')])){for(var _0x3d2f4e=0x0;_0x3d2f4e<_0x19f671[_0x6bab('0x44')][_0x6bab('0x75')]['length'];_0x3d2f4e+=0x1){socket[_0x6bab('0x95')]('userChatQueue:remove',{'UserId':Number(_0x19f671[_0x6bab('0x44')][_0x6bab('0x75')][_0x3d2f4e]),'ChatQueueId':Number(_0x19f671[_0x6bab('0x63')]['id'])});}}else{socket[_0x6bab('0x95')](_0x6bab('0x9a'),{'UserId':Number(_0x19f671['query'][_0x6bab('0x75')]),'ChatQueueId':Number(_0x19f671[_0x6bab('0x63')]['id'])});}});}})[_0x6bab('0x1f')](respondWithStatusCode(_0x1ad293,null))['catch'](handleError(_0x1ad293,null));};exports['getAgents']=function(_0x1e8c94,_0x1f5210,_0x34eada){var _0x42c999={};var _0x5dd6c1={};var _0x498395;var _0xfaa763;return db[_0x6bab('0x3f')][_0x6bab('0x71')]({'where':{'id':_0x1e8c94['params']['id']}})[_0x6bab('0x1f')](handleEntityNotFound(_0x1f5210,null))['then'](function(_0x3ba5a3){if(_0x3ba5a3){_0x498395=_0x3ba5a3;_0x5dd6c1['model']=_[_0x6bab('0x45')](db['User']['rawAttributes']);_0x5dd6c1[_0x6bab('0x44')]=_['keys'](_0x1e8c94[_0x6bab('0x44')]);_0x5dd6c1['filters']=_[_0x6bab('0x47')](_0x5dd6c1[_0x6bab('0x43')],_0x5dd6c1['query']);_0x42c999[_0x6bab('0x48')]=_[_0x6bab('0x47')](_0x5dd6c1['model'],qs[_0x6bab('0x49')](_0x1e8c94[_0x6bab('0x44')]['fields']));_0x42c999[_0x6bab('0x48')]=_0x42c999['attributes']['length']?_0x42c999[_0x6bab('0x48')]:_0x5dd6c1[_0x6bab('0x43')];_0x42c999[_0x6bab('0x64')]=qs[_0x6bab('0x4d')](_0x1e8c94[_0x6bab('0x44')][_0x6bab('0x4d')]);_0x42c999[_0x6bab('0x4e')]=qs[_0x6bab('0x46')](_[_0x6bab('0x4f')](_0x1e8c94[_0x6bab('0x44')],_0x5dd6c1[_0x6bab('0x46')]));if(_0x1e8c94[_0x6bab('0x44')][_0x6bab('0x73')]){_0x42c999[_0x6bab('0x4e')]=_[_0x6bab('0x52')](_0x42c999[_0x6bab('0x4e')],{'$or':_[_0x6bab('0x3e')](_0x42c999[_0x6bab('0x48')],function(_0x27267b){var _0x25bb8f={};_0x25bb8f[_0x27267b]={'$like':'%'+_0x1e8c94[_0x6bab('0x44')][_0x6bab('0x73')]+'%'};return _0x25bb8f;})});}_0x42c999=_[_0x6bab('0x52')]({},_0x42c999,_0x1e8c94[_0x6bab('0x53')]);return _0x498395[_0x6bab('0x9b')](_0x42c999);}})[_0x6bab('0x1f')](function(_0x25e8aa){if(_0x25e8aa){_0xfaa763=_0x25e8aa[_0x6bab('0x4a')];if(!_0x1e8c94[_0x6bab('0x44')][_0x6bab('0x4b')]('nolimit')){_0x42c999[_0x6bab('0x2e')]=qs[_0x6bab('0x2e')](_0x1e8c94[_0x6bab('0x44')][_0x6bab('0x2e')]);_0x42c999[_0x6bab('0x2c')]=qs[_0x6bab('0x2c')](_0x1e8c94['query'][_0x6bab('0x2c')]);}return _0x498395['getAgents'](_0x42c999);}})['then'](function(_0x56e92c){if(_0x56e92c){return _0x56e92c?{'count':_0xfaa763,'rows':_0x56e92c}:null;}})['then'](respondWithResult(_0x1f5210,null))[_0x6bab('0x29')](handleError(_0x1f5210,null));}; \ No newline at end of file +var _0x0ee9=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','params','sequelize','transaction','forEach','emit','userChatQueue:save','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','body','user'];(function(_0x39d25b,_0x1aa143){var _0x48ceaf=function(_0x417281){while(--_0x417281){_0x39d25b['push'](_0x39d25b['shift']());}};_0x48ceaf(++_0x1aa143);}(_0x0ee9,0xd1));var _0x90ee=function(_0xbdae1c,_0x64a4c6){_0xbdae1c=_0xbdae1c-0x0;var _0x1bfa84=_0x0ee9[_0xbdae1c];return _0x1bfa84;};'use strict';var emlformat=require(_0x90ee('0x0'));var rimraf=require(_0x90ee('0x1'));var zipdir=require(_0x90ee('0x2'));var jsonpatch=require(_0x90ee('0x3'));var rp=require('request-promise');var moment=require(_0x90ee('0x4'));var BPromise=require(_0x90ee('0x5'));var Mustache=require('mustache');var util=require(_0x90ee('0x6'));var path=require('path');var sox=require(_0x90ee('0x7'));var csv=require(_0x90ee('0x8'));var ejs=require(_0x90ee('0x9'));var fs=require('fs');var fs_extra=require(_0x90ee('0xa'));var _=require(_0x90ee('0xb'));var squel=require('squel');var crypto=require(_0x90ee('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x90ee('0xd'));var toCsv=require('to-csv');var querystring=require(_0x90ee('0xe'));var Papa=require(_0x90ee('0xf'));var Redis=require(_0x90ee('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x90ee('0x11'));var as=require(_0x90ee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90ee('0x13'))(_0x90ee('0x14'));var utils=require('../../config/utils');var config=require(_0x90ee('0x15'));var licenseUtil=require(_0x90ee('0x16'));var db=require(_0x90ee('0x17'))['db'];config[_0x90ee('0x18')]=_[_0x90ee('0x19')](config['redis'],{'host':_0x90ee('0x1a'),'port':0x18eb});var socket=require(_0x90ee('0x1b'))(new Redis(config[_0x90ee('0x18')]));require(_0x90ee('0x1c'))[_0x90ee('0x1d')](socket);var jayson=require(_0x90ee('0x1e'));var client=jayson['client'][_0x90ee('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x58cdfe,_0x109523,_0x964822,_0x2700bb){return new BPromise(function(_0x1125f9,_0x5ef26d){var _0x306af7=_0x2700bb||client;return _0x306af7['request'](_0x58cdfe,_0x964822)[_0x90ee('0x20')](function(_0x5b7bd7){logger['info'](_0x90ee('0x21'),_0x109523,_0x90ee('0x22'));logger['debug'](_0x90ee('0x23'),_0x109523,_0x90ee('0x22'),JSON['stringify'](_0x5b7bd7));if(_0x5b7bd7[_0x90ee('0x24')]){if(_0x5b7bd7[_0x90ee('0x24')][_0x90ee('0x25')]===0x1f4){logger[_0x90ee('0x24')](_0x90ee('0x21'),_0x109523,_0x5b7bd7[_0x90ee('0x24')][_0x90ee('0x26')]);return _0x5ef26d(_0x5b7bd7[_0x90ee('0x24')]['message']);}logger[_0x90ee('0x24')]('ChatQueue,\x20%s,\x20%s',_0x109523,_0x5b7bd7[_0x90ee('0x24')][_0x90ee('0x26')]);return _0x1125f9(_0x5b7bd7[_0x90ee('0x24')][_0x90ee('0x26')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x109523,_0x90ee('0x22'));_0x1125f9(_0x5b7bd7[_0x90ee('0x27')]['message']);}})[_0x90ee('0x28')](function(_0x58e205){logger[_0x90ee('0x24')](_0x90ee('0x21'),_0x109523,_0x58e205);_0x5ef26d(_0x58e205);});});}function respondWithStatusCode(_0x132db1,_0x4bfa51){_0x4bfa51=_0x4bfa51||0xcc;return function(_0x62a19f){if(_0x62a19f){return _0x132db1[_0x90ee('0x29')](_0x4bfa51);}return _0x132db1['status'](_0x4bfa51)[_0x90ee('0x2a')]();};}function respondWithResult(_0x1d061b,_0x4c2add){_0x4c2add=_0x4c2add||0xc8;return function(_0xa9647f){if(_0xa9647f){return _0x1d061b[_0x90ee('0x2b')](_0x4c2add)[_0x90ee('0x2c')](_0xa9647f);}};}function respondWithFilteredResult(_0x4feb0b,_0x19c81b){return function(_0x559962){if(_0x559962){var _0x8c1bc2=typeof _0x19c81b['offset']==='undefined'&&typeof _0x19c81b[_0x90ee('0x2d')]===_0x90ee('0x2e');var _0x256feb=_0x559962[_0x90ee('0x2f')];var _0x22bf31=_0x8c1bc2?0x0:_0x19c81b['offset'];var _0x3dec8e=_0x8c1bc2?_0x559962[_0x90ee('0x2f')]:_0x19c81b[_0x90ee('0x30')]+_0x19c81b[_0x90ee('0x2d')];var _0x24beec;if(_0x3dec8e>=_0x256feb){_0x3dec8e=_0x256feb;_0x24beec=0xc8;}else{_0x24beec=0xce;}_0x4feb0b[_0x90ee('0x2b')](_0x24beec);return _0x4feb0b[_0x90ee('0x31')](_0x90ee('0x32'),_0x22bf31+'-'+_0x3dec8e+'/'+_0x256feb)['json'](_0x559962);}return null;};}function patchUpdates(_0xca9db6){return function(_0xb3b747){try{jsonpatch[_0x90ee('0x33')](_0xb3b747,_0xca9db6,!![]);}catch(_0x115eef){return BPromise[_0x90ee('0x34')](_0x115eef);}return _0xb3b747['save']();};}function saveUpdates(_0x11d5a8,_0x3a8cf7){return function(_0x16784d){if(_0x16784d){return _0x16784d[_0x90ee('0x35')](_0x11d5a8)[_0x90ee('0x20')](function(_0x4b110c){return _0x4b110c;});}return null;};}function removeEntity(_0x3a06d4,_0x48cc02){return function(_0x4aa2dc){if(_0x4aa2dc){return _0x4aa2dc[_0x90ee('0x36')]()[_0x90ee('0x20')](function(){var _0x1bee7e=_0x4aa2dc[_0x90ee('0x37')]({'plain':!![]});var _0x53a588=_0x90ee('0x38');return db[_0x90ee('0x39')][_0x90ee('0x36')]({'where':{'type':_0x53a588,'resourceId':_0x1bee7e['id']}})[_0x90ee('0x20')](function(){return _0x4aa2dc;});})[_0x90ee('0x20')](function(){_0x3a06d4[_0x90ee('0x2b')](0xcc)[_0x90ee('0x2a')]();});}};}function handleEntityNotFound(_0x26d77d,_0x23e079){return function(_0x2313e7){if(!_0x2313e7){_0x26d77d[_0x90ee('0x29')](0x194);}return _0x2313e7;};}function handleError(_0x454800,_0x56159c){_0x56159c=_0x56159c||0x1f4;return function(_0x55ba3d){logger['error'](_0x55ba3d[_0x90ee('0x3a')]);if(_0x55ba3d['name']){delete _0x55ba3d[_0x90ee('0x3b')];}_0x454800[_0x90ee('0x2b')](_0x56159c)[_0x90ee('0x3c')](_0x55ba3d);};}exports[_0x90ee('0x3d')]=function(_0x2aacbc,_0x526741){var _0x9da004={},_0xdbbdd8={},_0x4d2c11={'count':0x0,'rows':[]};var _0xce8854=_['map'](db[_0x90ee('0x3e')]['rawAttributes'],function(_0x2eb06f){return{'name':_0x2eb06f[_0x90ee('0x3f')],'type':_0x2eb06f[_0x90ee('0x40')]['key']};});_0xdbbdd8['model']=_[_0x90ee('0x41')](_0xce8854,_0x90ee('0x3b'));_0xdbbdd8[_0x90ee('0x42')]=_[_0x90ee('0x43')](_0x2aacbc[_0x90ee('0x42')]);_0xdbbdd8[_0x90ee('0x44')]=_[_0x90ee('0x45')](_0xdbbdd8[_0x90ee('0x46')],_0xdbbdd8[_0x90ee('0x42')]);_0x9da004['attributes']=_[_0x90ee('0x45')](_0xdbbdd8['model'],qs[_0x90ee('0x47')](_0x2aacbc['query'][_0x90ee('0x47')]));_0x9da004[_0x90ee('0x48')]=_0x9da004['attributes'][_0x90ee('0x49')]?_0x9da004[_0x90ee('0x48')]:_0xdbbdd8[_0x90ee('0x46')];if(!_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x4a')](_0x90ee('0x4b'))){_0x9da004[_0x90ee('0x2d')]=qs[_0x90ee('0x2d')](_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x2d')]);_0x9da004[_0x90ee('0x30')]=qs[_0x90ee('0x30')](_0x2aacbc['query'][_0x90ee('0x30')]);}_0x9da004[_0x90ee('0x4c')]=qs[_0x90ee('0x4d')](_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x4d')]);_0x9da004[_0x90ee('0x4e')]=qs[_0x90ee('0x44')](_[_0x90ee('0x4f')](_0x2aacbc[_0x90ee('0x42')],_0xdbbdd8['filters']),_0xce8854);if(_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x50')]){_0x9da004[_0x90ee('0x4e')]=_[_0x90ee('0x51')](_0x9da004[_0x90ee('0x4e')],{'$or':_['map'](_0xce8854,function(_0x28c24e){if(_0x28c24e[_0x90ee('0x40')]!==_0x90ee('0x52')){var _0x46c61a={};_0x46c61a[_0x28c24e['name']]={'$like':'%'+_0x2aacbc[_0x90ee('0x42')]['filter']+'%'};return _0x46c61a;}})});}_0x9da004=_[_0x90ee('0x51')]({},_0x9da004,_0x2aacbc[_0x90ee('0x53')]);var _0xd183e3={'where':_0x9da004[_0x90ee('0x4e')]};return db[_0x90ee('0x3e')][_0x90ee('0x2f')](_0xd183e3)[_0x90ee('0x20')](function(_0x5cc567){_0x4d2c11[_0x90ee('0x2f')]=_0x5cc567;if(_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x54')]){_0x9da004[_0x90ee('0x55')]=[{'all':!![]}];}return db[_0x90ee('0x3e')][_0x90ee('0x56')](_0x9da004);})[_0x90ee('0x20')](function(_0x43c39b){_0x4d2c11[_0x90ee('0x57')]=_0x43c39b;return _0x4d2c11;})['then'](respondWithFilteredResult(_0x526741,_0x9da004))['catch'](handleError(_0x526741,null));};exports[_0x90ee('0x58')]=function(_0x31d689,_0x45cde7){var _0xa1277c={'raw':!![],'where':{'id':_0x31d689['params']['id']}},_0x41904a={};_0x41904a['model']=_[_0x90ee('0x43')](db[_0x90ee('0x3e')][_0x90ee('0x59')]);_0x41904a['query']=_[_0x90ee('0x43')](_0x31d689[_0x90ee('0x42')]);_0x41904a[_0x90ee('0x44')]=_['intersection'](_0x41904a[_0x90ee('0x46')],_0x41904a['query']);_0xa1277c[_0x90ee('0x48')]=_['intersection'](_0x41904a['model'],qs[_0x90ee('0x47')](_0x31d689[_0x90ee('0x42')][_0x90ee('0x47')]));_0xa1277c[_0x90ee('0x48')]=_0xa1277c['attributes']['length']?_0xa1277c[_0x90ee('0x48')]:_0x41904a[_0x90ee('0x46')];if(_0x31d689[_0x90ee('0x42')][_0x90ee('0x54')]){_0xa1277c[_0x90ee('0x55')]=[{'all':!![]}];}_0xa1277c=_[_0x90ee('0x51')]({},_0xa1277c,_0x31d689['options']);return db[_0x90ee('0x3e')]['find'](_0xa1277c)['then'](handleEntityNotFound(_0x45cde7,null))[_0x90ee('0x20')](respondWithResult(_0x45cde7,null))[_0x90ee('0x28')](handleError(_0x45cde7,null));};exports[_0x90ee('0x5a')]=function(_0x2d098a,_0x5e765d){return db[_0x90ee('0x3e')][_0x90ee('0x5a')](_0x2d098a[_0x90ee('0x5b')],{})[_0x90ee('0x20')](function(_0x4d63cb){var _0x2123b9=_0x2d098a[_0x90ee('0x5c')][_0x90ee('0x37')]({'plain':!![]});if(!_0x2123b9)throw new Error(_0x90ee('0x5d'));if(_0x2123b9[_0x90ee('0x5e')]===_0x90ee('0x5c')){var _0x3185b1=_0x4d63cb[_0x90ee('0x37')]({'plain':!![]});var _0x303d19=_0x90ee('0x38');return db[_0x90ee('0x5f')]['find']({'where':{'name':_0x303d19,'userProfileId':_0x2123b9[_0x90ee('0x60')]},'raw':!![]})[_0x90ee('0x20')](function(_0x1d9c9b){if(_0x1d9c9b&&_0x1d9c9b['autoAssociation']===0x0){return db[_0x90ee('0x39')]['create']({'name':_0x3185b1['name'],'resourceId':_0x3185b1['id'],'type':_0x1d9c9b[_0x90ee('0x3b')],'sectionId':_0x1d9c9b['id']},{})[_0x90ee('0x20')](function(){return _0x4d63cb;});}else{return _0x4d63cb;}})['catch'](function(_0x260228){logger['error'](_0x90ee('0x61'),_0x260228);throw _0x260228;});}return _0x4d63cb;})[_0x90ee('0x20')](respondWithResult(_0x5e765d,0xc9))['catch'](handleError(_0x5e765d,null));};exports[_0x90ee('0x35')]=function(_0x22ab2a,_0xbbfed2){if(_0x22ab2a['body']['id']){delete _0x22ab2a[_0x90ee('0x5b')]['id'];}return db[_0x90ee('0x3e')][_0x90ee('0x62')]({'where':{'id':_0x22ab2a['params']['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0xbbfed2,null))[_0x90ee('0x20')](saveUpdates(_0x22ab2a['body'],null))['then'](respondWithResult(_0xbbfed2,null))[_0x90ee('0x28')](handleError(_0xbbfed2,null));};exports[_0x90ee('0x36')]=function(_0x402803,_0x479689){return db[_0x90ee('0x3e')]['find']({'where':{'id':_0x402803['params']['id']}})['then'](handleEntityNotFound(_0x479689,null))[_0x90ee('0x20')](removeEntity(_0x479689,null))[_0x90ee('0x28')](handleError(_0x479689,null));};exports[_0x90ee('0x63')]=function(_0x9550fb,_0x2a2e3f){return db[_0x90ee('0x3e')][_0x90ee('0x63')]()[_0x90ee('0x20')](respondWithResult(_0x2a2e3f,null))[_0x90ee('0x28')](handleError(_0x2a2e3f,null));};exports[_0x90ee('0x64')]=function(_0x914cb0,_0x2f65d9,_0x1f440b){var _0x5b3280={'raw':!![],'where':{}},_0x14af19={},_0x47b9eb;return db[_0x90ee('0x3e')][_0x90ee('0x65')]({'where':{'id':_0x914cb0['params']['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x2f65d9,null))['then'](function(_0x3e0452){if(_0x3e0452){_0x47b9eb=_0x3e0452['get']({'plain':!![]});_0x14af19[_0x90ee('0x46')]=_['keys'](db['UserChatQueue'][_0x90ee('0x59')]);_0x14af19['query']=_[_0x90ee('0x43')](_0x914cb0[_0x90ee('0x42')]);_0x14af19['filters']=_[_0x90ee('0x45')](_0x14af19['model'],_0x14af19[_0x90ee('0x42')]);_0x5b3280[_0x90ee('0x48')]=_['intersection'](_0x14af19[_0x90ee('0x46')],qs[_0x90ee('0x47')](_0x914cb0[_0x90ee('0x42')][_0x90ee('0x47')]));_0x5b3280['attributes']=_0x5b3280['attributes'][_0x90ee('0x49')]?_0x5b3280['attributes']:_0x14af19['model'];if(!_0x914cb0[_0x90ee('0x42')][_0x90ee('0x4a')](_0x90ee('0x4b'))){_0x5b3280[_0x90ee('0x2d')]=qs[_0x90ee('0x2d')](_0x914cb0[_0x90ee('0x42')][_0x90ee('0x2d')]);_0x5b3280[_0x90ee('0x30')]=qs[_0x90ee('0x30')](_0x914cb0[_0x90ee('0x42')][_0x90ee('0x30')]);}_0x5b3280[_0x90ee('0x4c')]=qs['sort'](_0x914cb0[_0x90ee('0x42')][_0x90ee('0x4d')]);_0x5b3280[_0x90ee('0x4e')]=qs[_0x90ee('0x44')](_['pick'](_0x914cb0['query'],_0x14af19['filters']));_0x5b3280['where'][_0x90ee('0x66')]=_0x3e0452['id'];if(_0x914cb0[_0x90ee('0x42')][_0x90ee('0x50')]){_0x5b3280[_0x90ee('0x4e')]=_[_0x90ee('0x51')](_0x5b3280['where'],{'$or':_[_0x90ee('0x41')](_0x5b3280['attributes'],function(_0x280680){var _0x5098b3={};_0x5098b3[_0x280680]={'$like':'%'+_0x914cb0[_0x90ee('0x42')]['filter']+'%'};return _0x5098b3;})});}_0x5b3280=_[_0x90ee('0x51')]({},_0x5b3280,_0x914cb0['options']);return db[_0x90ee('0x67')][_0x90ee('0x56')](_0x5b3280);}})[_0x90ee('0x20')](function(_0x7b8dcf){if(_0x7b8dcf){return db[_0x90ee('0x68')]['findAndCountAll']({'where':{'id':_[_0x90ee('0x41')](_0x7b8dcf,_0x90ee('0x69')),'role':_0x90ee('0x6a')},'attributes':['id',_0x90ee('0x3b'),_0x90ee('0x6b'),_0x90ee('0x6c'),_0x90ee('0x6d')]});}})[_0x90ee('0x20')](function(_0x4684ff){if(_0x4684ff){return{'count':_0x4684ff[_0x90ee('0x2f')],'rows':_['map'](_0x4684ff['rows'],function(_0x466d21){return{'membername':_0x466d21['name'],'UserId':_0x466d21['id'],'queue_name':_0x47b9eb['name'],'ChatQueueId':_0x47b9eb['id'],'interface':util[_0x90ee('0x6e')](_0x90ee('0x6f'),_0x90ee('0x70'),_0x466d21[_0x90ee('0x3b')]),'penalty':0x0,'paused':_0x466d21['chatPause'],'createdAt':_0x466d21[_0x90ee('0x6d')],'updatedAt':_0x466d21[_0x90ee('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x90ee('0x20')](respondWithFilteredResult(_0x2f65d9,_0x5b3280))['catch'](handleError(_0x2f65d9,null));};exports[_0x90ee('0x71')]=function(_0x194c8a,_0x211c4b,_0xf245cf){var _0x5f515e={};var _0x44b4a9={};var _0x1c0777;var _0x5ee8de;return db['ChatQueue'][_0x90ee('0x65')]({'where':{'id':_0x194c8a['params']['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x211c4b,null))[_0x90ee('0x20')](function(_0x2fdea2){if(_0x2fdea2){_0x1c0777=_0x2fdea2;_0x44b4a9[_0x90ee('0x46')]=_['keys'](db[_0x90ee('0x72')][_0x90ee('0x59')]);_0x44b4a9[_0x90ee('0x42')]=_['keys'](_0x194c8a[_0x90ee('0x42')]);_0x44b4a9[_0x90ee('0x44')]=_[_0x90ee('0x45')](_0x44b4a9[_0x90ee('0x46')],_0x44b4a9['query']);_0x5f515e['attributes']=_[_0x90ee('0x45')](_0x44b4a9[_0x90ee('0x46')],qs['fields'](_0x194c8a[_0x90ee('0x42')][_0x90ee('0x47')]));_0x5f515e[_0x90ee('0x48')]=_0x5f515e[_0x90ee('0x48')]['length']?_0x5f515e[_0x90ee('0x48')]:_0x44b4a9[_0x90ee('0x46')];_0x5f515e[_0x90ee('0x4c')]=qs[_0x90ee('0x4d')](_0x194c8a[_0x90ee('0x42')][_0x90ee('0x4d')]);_0x5f515e['where']=qs[_0x90ee('0x44')](_[_0x90ee('0x4f')](_0x194c8a[_0x90ee('0x42')],_0x44b4a9[_0x90ee('0x44')]));if(_0x194c8a[_0x90ee('0x42')][_0x90ee('0x50')]){_0x5f515e[_0x90ee('0x4e')]=_[_0x90ee('0x51')](_0x5f515e['where'],{'$or':_[_0x90ee('0x41')](_0x5f515e[_0x90ee('0x48')],function(_0x333966){var _0x2f8402={};_0x2f8402[_0x333966]={'$like':'%'+_0x194c8a[_0x90ee('0x42')][_0x90ee('0x50')]+'%'};return _0x2f8402;})});}_0x5f515e=_[_0x90ee('0x51')]({},_0x5f515e,_0x194c8a[_0x90ee('0x53')]);return _0x1c0777[_0x90ee('0x71')](_0x5f515e);}})['then'](function(_0x34987c){if(_0x34987c){_0x5ee8de=_0x34987c[_0x90ee('0x49')];if(!_0x194c8a[_0x90ee('0x42')][_0x90ee('0x4a')]('nolimit')){_0x5f515e[_0x90ee('0x2d')]=qs[_0x90ee('0x2d')](_0x194c8a['query'][_0x90ee('0x2d')]);_0x5f515e[_0x90ee('0x30')]=qs[_0x90ee('0x30')](_0x194c8a[_0x90ee('0x42')][_0x90ee('0x30')]);}return _0x1c0777[_0x90ee('0x71')](_0x5f515e);}})[_0x90ee('0x20')](function(_0x18b473){if(_0x18b473){return _0x18b473?{'count':_0x5ee8de,'rows':_0x18b473}:null;}})[_0x90ee('0x20')](respondWithResult(_0x211c4b,null))[_0x90ee('0x28')](handleError(_0x211c4b,null));};exports[_0x90ee('0x73')]=function(_0x4fef92,_0x7b5208,_0x313bf6){var _0x2a5583=_0x4fef92['body'][_0x90ee('0x74')];return db[_0x90ee('0x72')][_0x90ee('0x56')]({'where':{'id':_0x2a5583},'attributes':['id'],'include':[{'model':db[_0x90ee('0x68')],'as':_0x90ee('0x75'),'attributes':['id',_0x90ee('0x3b'),_0x90ee('0x76'),'voicePause',_0x90ee('0x77')],'raw':!![]}]})['then'](function(_0x48abb1){if(_0x48abb1){var _0x5177d4=_[_0x90ee('0x78')](_0x48abb1,function(_0x4e98f0){var _0x356311=_0x4e98f0[_0x90ee('0x37')]({'plain':!![]});return _0x356311['Agents'];});return db['ChatQueue'][_0x90ee('0x62')]({'where':{'id':_0x4fef92[_0x90ee('0x79')]['id']}})[_0x90ee('0x20')](function(_0x43f1c5){return db[_0x90ee('0x7a')][_0x90ee('0x7b')](function(_0x125391){return _0x43f1c5['addTeams'](_0x2a5583,{'transaction':_0x125391})[_0x90ee('0x20')](function(){return BPromise['each'](_0x5177d4,function(_0x119101){return db[_0x90ee('0x67')]['findOrCreate']({'where':{'UserId':_0x119101['id'],'ChatQueueId':_0x4fef92[_0x90ee('0x79')]['id']},'transaction':_0x125391});});})['then'](function(){_0x5177d4[_0x90ee('0x7c')](function(_0xdab8ba){socket[_0x90ee('0x7d')](_0x90ee('0x7e'),{'UserId':_0xdab8ba['id'],'ChatQueueId':_0x43f1c5['id']});});});});});}})['then'](respondWithStatusCode(_0x7b5208,null))['catch'](handleError(_0x7b5208,null));};exports['removeTeams']=function(_0x30ce54,_0x4703db,_0x16211c){return db[_0x90ee('0x72')][_0x90ee('0x56')]({'where':{'id':_0x30ce54[_0x90ee('0x42')][_0x90ee('0x74')]},'attributes':['id'],'include':[{'model':db[_0x90ee('0x68')],'as':_0x90ee('0x75'),'attributes':['id'],'raw':!![]}]})[_0x90ee('0x20')](handleEntityNotFound(_0x4703db,null))[_0x90ee('0x20')](function(_0x4532d5){var _0x447f84=_[_0x90ee('0x41')](_0x4532d5,'id');var _0x321b1f=[];var _0x562dcf=[];var _0x1ade86=squel[_0x90ee('0x7f')]();_0x1ade86['field'](_0x90ee('0x80'))[_0x90ee('0x81')]('team_has_chat_queues','tq')['join'](_0x90ee('0x82'),'ut',_0x90ee('0x83'))[_0x90ee('0x4e')](_0x90ee('0x84'),_0x30ce54[_0x90ee('0x79')]['id']);for(var _0x3ed068=0x0;_0x3ed068<_0x4532d5[_0x90ee('0x49')];_0x3ed068+=0x1){let _0x1f4939=_0x4532d5[_0x3ed068];for(var _0x3b6192=0x0;_0x3b6192<_0x1f4939[_0x90ee('0x75')][_0x90ee('0x49')];_0x3b6192+=0x1){let _0xfaa285=_0x1f4939[_0x90ee('0x75')][_0x3b6192];var _0x5a9353=_0x1ade86[_0x90ee('0x85')]();_0x5a9353[_0x90ee('0x4e')]('ut.UserId\x20=\x20?',_0xfaa285['id']);_0x562dcf[_0x90ee('0x86')](db[_0x90ee('0x7a')]['query'](_0x5a9353[_0x90ee('0x87')](),{'type':db[_0x90ee('0x7a')][_0x90ee('0x88')][_0x90ee('0x89')]})[_0x90ee('0x20')](function(_0x1030cf){if(_0x1030cf['length']===0x1){return _0xfaa285['id'];}else{var _0x5bfa1c=_['every'](_[_0x90ee('0x41')](_0x1030cf,_0x90ee('0x8a')),function(_0x527f19){return _[_0x90ee('0x8b')](_0x447f84,_0x527f19);});if(_0x5bfa1c){return _0xfaa285['id'];}}}));}}return BPromise[_0x90ee('0x8c')](_0x562dcf)[_0x90ee('0x20')](function(_0x515303){_0x321b1f=_(_0x321b1f)[_0x90ee('0x8d')](_0x515303)['compact']()[_0x90ee('0x8e')]();return db[_0x90ee('0x3e')][_0x90ee('0x62')]({'where':{'id':_0x30ce54[_0x90ee('0x79')]['id']}})['then'](function(_0x30ed24){return db[_0x90ee('0x7a')][_0x90ee('0x7b')](function(_0x1769ac){return _0x30ed24[_0x90ee('0x8f')](_0x30ce54[_0x90ee('0x42')]['ids'],{'transaction':_0x1769ac})[_0x90ee('0x20')](function(){if(!_[_0x90ee('0x90')](_0x321b1f)){return _0x30ed24[_0x90ee('0x91')](_0x321b1f,{'transaction':_0x1769ac});}})['then'](function(){_0x321b1f[_0x90ee('0x7c')](function(_0x77804d){socket['emit'](_0x90ee('0x92'),{'UserId':_0x77804d,'ChatQueueId':_0x30ed24['id']});});});});});});})[_0x90ee('0x20')](respondWithStatusCode(_0x4703db,null))[_0x90ee('0x28')](handleError(_0x4703db,null));};exports[_0x90ee('0x93')]=function(_0x268930,_0x4ed087,_0x45c384){return db[_0x90ee('0x3e')][_0x90ee('0x62')]({'where':{'id':_0x268930['params']['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x4ed087,null))[_0x90ee('0x20')](function(_0x4fb1ec){if(_0x4fb1ec){return _0x4fb1ec[_0x90ee('0x93')](_0x268930[_0x90ee('0x5b')]['ids'],_[_0x90ee('0x94')](_0x268930[_0x90ee('0x5b')],[_0x90ee('0x74'),'id'])||{})[_0x90ee('0x95')](function(_0x4d3838){for(var _0x558e43=0x0;_0x558e43<_0x268930[_0x90ee('0x5b')][_0x90ee('0x74')]['length'];_0x558e43+=0x1){socket[_0x90ee('0x7d')](_0x90ee('0x7e'),{'UserId':Number(_0x268930[_0x90ee('0x5b')][_0x90ee('0x74')][_0x558e43]),'ChatQueueId':Number(_0x268930[_0x90ee('0x79')]['id'])});}return _0x4d3838;});}})['then'](respondWithResult(_0x4ed087,null))['catch'](handleError(_0x4ed087,null));};exports[_0x90ee('0x91')]=function(_0x41ce83,_0x4aef1f,_0x3d6a16){return db[_0x90ee('0x3e')]['find']({'where':{'id':_0x41ce83[_0x90ee('0x79')]['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x4aef1f,null))['then'](function(_0x2d5f4c){if(_0x2d5f4c){return _0x2d5f4c[_0x90ee('0x91')](_0x41ce83[_0x90ee('0x42')][_0x90ee('0x74')])[_0x90ee('0x20')](function(){if(_['isArray'](_0x41ce83[_0x90ee('0x42')][_0x90ee('0x74')])){for(var _0x58b553=0x0;_0x58b553<_0x41ce83['query']['ids'][_0x90ee('0x49')];_0x58b553+=0x1){socket[_0x90ee('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x41ce83[_0x90ee('0x42')][_0x90ee('0x74')][_0x58b553]),'ChatQueueId':Number(_0x41ce83[_0x90ee('0x79')]['id'])});}}else{socket[_0x90ee('0x7d')](_0x90ee('0x92'),{'UserId':Number(_0x41ce83[_0x90ee('0x42')]['ids']),'ChatQueueId':Number(_0x41ce83[_0x90ee('0x79')]['id'])});}});}})[_0x90ee('0x20')](respondWithStatusCode(_0x4aef1f,null))['catch'](handleError(_0x4aef1f,null));};exports[_0x90ee('0x96')]=function(_0x3a8213,_0x2c816d,_0x29dea6){var _0x1d93fb={};var _0x383030={};var _0xd2591b;var _0x355adf;return db[_0x90ee('0x3e')][_0x90ee('0x65')]({'where':{'id':_0x3a8213[_0x90ee('0x79')]['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x2c816d,null))[_0x90ee('0x20')](function(_0x4ade30){if(_0x4ade30){_0xd2591b=_0x4ade30;_0x383030[_0x90ee('0x46')]=_['keys'](db['User']['rawAttributes']);_0x383030['query']=_['keys'](_0x3a8213[_0x90ee('0x42')]);_0x383030[_0x90ee('0x44')]=_['intersection'](_0x383030[_0x90ee('0x46')],_0x383030[_0x90ee('0x42')]);_0x1d93fb[_0x90ee('0x48')]=_[_0x90ee('0x45')](_0x383030['model'],qs[_0x90ee('0x47')](_0x3a8213['query']['fields']));_0x1d93fb['attributes']=_0x1d93fb[_0x90ee('0x48')][_0x90ee('0x49')]?_0x1d93fb[_0x90ee('0x48')]:_0x383030[_0x90ee('0x46')];_0x1d93fb[_0x90ee('0x4c')]=qs[_0x90ee('0x4d')](_0x3a8213[_0x90ee('0x42')]['sort']);_0x1d93fb[_0x90ee('0x4e')]=qs[_0x90ee('0x44')](_[_0x90ee('0x4f')](_0x3a8213[_0x90ee('0x42')],_0x383030[_0x90ee('0x44')]));if(_0x3a8213[_0x90ee('0x42')][_0x90ee('0x50')]){_0x1d93fb[_0x90ee('0x4e')]=_[_0x90ee('0x51')](_0x1d93fb[_0x90ee('0x4e')],{'$or':_[_0x90ee('0x41')](_0x1d93fb[_0x90ee('0x48')],function(_0x5c027d){var _0xd7a54f={};_0xd7a54f[_0x5c027d]={'$like':'%'+_0x3a8213[_0x90ee('0x42')]['filter']+'%'};return _0xd7a54f;})});}_0x1d93fb=_[_0x90ee('0x51')]({},_0x1d93fb,_0x3a8213['options']);return _0xd2591b[_0x90ee('0x96')](_0x1d93fb);}})[_0x90ee('0x20')](function(_0x3bbc4e){if(_0x3bbc4e){_0x355adf=_0x3bbc4e['length'];if(!_0x3a8213[_0x90ee('0x42')][_0x90ee('0x4a')](_0x90ee('0x4b'))){_0x1d93fb[_0x90ee('0x2d')]=qs[_0x90ee('0x2d')](_0x3a8213['query'][_0x90ee('0x2d')]);_0x1d93fb[_0x90ee('0x30')]=qs[_0x90ee('0x30')](_0x3a8213[_0x90ee('0x42')][_0x90ee('0x30')]);}return _0xd2591b[_0x90ee('0x96')](_0x1d93fb);}})[_0x90ee('0x20')](function(_0x2efa4f){if(_0x2efa4f){return _0x2efa4f?{'count':_0x355adf,'rows':_0x2efa4f}:null;}})[_0x90ee('0x20')](respondWithResult(_0x2c816d,null))[_0x90ee('0x28')](handleError(_0x2c816d,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 4a8f529..47a1652 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 _0x7e6b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x35fb7c,_0x4ee512){var _0x3b319e=function(_0x381eaa){while(--_0x381eaa){_0x35fb7c['push'](_0x35fb7c['shift']());}};_0x3b319e(++_0x4ee512);}(_0x7e6b,0x128));var _0xb7e6=function(_0x5d4d02,_0x384ae5){_0x5d4d02=_0x5d4d02-0x0;var _0x293090=_0x7e6b[_0x5d4d02];return _0x293090;};'use strict';var EventEmitter=require(_0xb7e6('0x0'));var ChatQueue=require(_0xb7e6('0x1'))['db'][_0xb7e6('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb7e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb7e6('0x4'),'afterDestroy':_0xb7e6('0x5')};function emitEvent(_0x54006d){return function(_0x1a5aac,_0x3692c9,_0x35bcc3){ChatQueueEvents[_0xb7e6('0x6')](_0x54006d+':'+_0x1a5aac['id'],_0x1a5aac);ChatQueueEvents[_0xb7e6('0x6')](_0x54006d,_0x1a5aac);_0x35bcc3(null);};}for(var e in events){if(events[_0xb7e6('0x7')](e)){var event=events[e];ChatQueue[_0xb7e6('0x8')](e,emitEvent(event));}}module[_0xb7e6('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xeb64=['emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0xeb64,0x130));var _0x4eb6=function(_0x1b90f4,_0x43959d){_0x1b90f4=_0x1b90f4-0x0;var _0x332b46=_0xeb64[_0x1b90f4];return _0x332b46;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4eb6('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4eb6('0x1')](0x0);var events={'afterCreate':_0x4eb6('0x2'),'afterUpdate':_0x4eb6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b4905){return function(_0x44b72a,_0x193057,_0x3061d6){ChatQueueEvents[_0x4eb6('0x4')](_0x3b4905+':'+_0x44b72a['id'],_0x44b72a);ChatQueueEvents['emit'](_0x3b4905,_0x44b72a);_0x3061d6(null);};}for(var e in events){if(events[_0x4eb6('0x5')](e)){var event=events[e];ChatQueue[_0x4eb6('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index d828d76..b1798a6 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 _0x4205=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','util','../../config/logger','api'];(function(_0x40bcf9,_0x409033){var _0x10ab13=function(_0x363277){while(--_0x363277){_0x40bcf9['push'](_0x40bcf9['shift']());}};_0x10ab13(++_0x409033);}(_0x4205,0x10e));var _0x5420=function(_0x4998b6,_0x5a31f6){_0x4998b6=_0x4998b6-0x0;var _0x976e7f=_0x4205[_0x4998b6];return _0x976e7f;};'use strict';var _=require('lodash');var util=require(_0x5420('0x0'));var logger=require(_0x5420('0x1'))(_0x5420('0x2'));var moment=require(_0x5420('0x3'));var BPromise=require(_0x5420('0x4'));var rp=require(_0x5420('0x5'));var fs=require('fs');var path=require(_0x5420('0x6'));var rimraf=require(_0x5420('0x7'));var config=require(_0x5420('0x8'));var attributes=require(_0x5420('0x9'));module[_0x5420('0xa')]=function(_0xdb2503,_0x138c2a){return _0xdb2503[_0x5420('0xb')](_0x5420('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdaf2=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0xdaf2,0x12e));var _0x2daf=function(_0x4c5c97,_0x4f85bf){_0x4c5c97=_0x4c5c97-0x0;var _0xd5d2cb=_0xdaf2[_0x4c5c97];return _0xd5d2cb;};'use strict';var _=require(_0x2daf('0x0'));var util=require(_0x2daf('0x1'));var logger=require(_0x2daf('0x2'))(_0x2daf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2daf('0x4'));var fs=require('fs');var path=require(_0x2daf('0x5'));var rimraf=require(_0x2daf('0x6'));var config=require(_0x2daf('0x7'));var attributes=require(_0x2daf('0x8'));module['exports']=function(_0xb57b82,_0x80ce42){return _0xb57b82[_0x2daf('0x9')](_0x2daf('0xa'),attributes,{'tableName':_0x2daf('0xb'),'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 16ce62a..eea3d29 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 _0xdfb1=['socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','raw','options','attributes','limit','include','map','model','find','where','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost'];(function(_0x1bcb2c,_0xf85d2a){var _0x843eab=function(_0x4ec292){while(--_0x4ec292){_0x1bcb2c['push'](_0x1bcb2c['shift']());}};_0x843eab(++_0xf85d2a);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x56d88a,_0x3d5b10){_0x56d88a=_0x56d88a-0x0;var _0x27b7f5=_0xdfb1[_0x56d88a];return _0x27b7f5;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var moment=require(_0x1dfb('0x2'));var BPromise=require(_0x1dfb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dfb('0x4'));var db=require(_0x1dfb('0x5'))['db'];var utils=require(_0x1dfb('0x6'));var logger=require(_0x1dfb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1dfb('0x8')][_0x1dfb('0x9')]({'port':0x232a});config[_0x1dfb('0xa')]=_['defaults'](config[_0x1dfb('0xa')],{'host':_0x1dfb('0xb'),'port':0x18eb});var socket=require(_0x1dfb('0xc'))(new Redis(config[_0x1dfb('0xa')]));require('./chatQueue.socket')[_0x1dfb('0xd')](socket);function respondWithRpcPromise(_0x3e728f,_0x191d87,_0x4ea385){return new BPromise(function(_0xd747ac,_0x6a43eb){return client[_0x1dfb('0xe')](_0x3e728f,_0x4ea385)[_0x1dfb('0xf')](function(_0x3a0366){logger[_0x1dfb('0x10')](_0x1dfb('0x11'),_0x191d87,_0x1dfb('0x12'));logger[_0x1dfb('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x191d87,_0x1dfb('0x12'),JSON[_0x1dfb('0x14')](_0x3a0366));if(_0x3a0366['error']){if(_0x3a0366[_0x1dfb('0x15')][_0x1dfb('0x16')]===0x1f4){logger[_0x1dfb('0x15')]('ChatQueue,\x20%s,\x20%s',_0x191d87,_0x3a0366[_0x1dfb('0x15')][_0x1dfb('0x17')]);return _0x6a43eb(_0x3a0366[_0x1dfb('0x15')]['message']);}logger[_0x1dfb('0x15')](_0x1dfb('0x11'),_0x191d87,_0x3a0366[_0x1dfb('0x15')]['message']);return _0xd747ac(_0x3a0366[_0x1dfb('0x15')][_0x1dfb('0x17')]);}else{logger[_0x1dfb('0x10')]('ChatQueue,\x20%s,\x20%s',_0x191d87,'request\x20sent');_0xd747ac(_0x3a0366[_0x1dfb('0x18')][_0x1dfb('0x17')]);}})[_0x1dfb('0x19')](function(_0xce05c5){logger['error'](_0x1dfb('0x11'),_0x191d87,_0xce05c5);_0x6a43eb(_0xce05c5);});});}exports[_0x1dfb('0x1a')]=function(_0x2842e7){var _0x358465=this;return new Promise(function(_0x3fde47,_0x4dff46){return db[_0x1dfb('0x1b')]['findAll']({'raw':_0x2842e7['options']?_0x2842e7['options'][_0x1dfb('0x1c')]===undefined?!![]:![]:!![],'where':_0x2842e7[_0x1dfb('0x1d')]?_0x2842e7[_0x1dfb('0x1d')]['where']||null:null,'attributes':_0x2842e7['options']?_0x2842e7['options'][_0x1dfb('0x1e')]||null:null,'limit':_0x2842e7[_0x1dfb('0x1d')]?_0x2842e7[_0x1dfb('0x1d')][_0x1dfb('0x1f')]||null:null,'include':_0x2842e7[_0x1dfb('0x1d')]?_0x2842e7[_0x1dfb('0x1d')][_0x1dfb('0x20')]?_[_0x1dfb('0x21')](_0x2842e7[_0x1dfb('0x1d')]['include'],function(_0x5111eb){return{'model':db[_0x5111eb[_0x1dfb('0x22')]],'as':_0x5111eb['as'],'attributes':_0x5111eb[_0x1dfb('0x1e')],'include':_0x5111eb['include']?_['map'](_0x5111eb['include'],function(_0x36bda8){return{'model':db[_0x36bda8[_0x1dfb('0x22')]],'as':_0x36bda8['as'],'attributes':_0x36bda8['attributes'],'include':_0x36bda8[_0x1dfb('0x20')]?_['map'](_0x36bda8[_0x1dfb('0x20')],function(_0x18d254){return{'model':db[_0x18d254['model']],'as':_0x18d254['as'],'attributes':_0x18d254[_0x1dfb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1dfb('0xf')](function(_0x292c2d){logger['info'](_0x1dfb('0x1a'),_0x2842e7);logger[_0x1dfb('0x13')](_0x1dfb('0x1a'),_0x2842e7,JSON[_0x1dfb('0x14')](_0x292c2d));_0x3fde47(_0x292c2d);})[_0x1dfb('0x19')](function(_0x49e973){logger[_0x1dfb('0x15')](_0x1dfb('0x1a'),_0x49e973['message'],_0x2842e7);_0x4dff46(_0x358465[_0x1dfb('0x15')](0x1f4,_0x49e973[_0x1dfb('0x17')]));});});};exports['ShowChatQueue']=function(_0x2acba7){var _0xb1b736=this;return new Promise(function(_0x4b8bdf,_0x37f86a){return db[_0x1dfb('0x1b')][_0x1dfb('0x23')]({'raw':_0x2acba7[_0x1dfb('0x1d')]?_0x2acba7[_0x1dfb('0x1d')][_0x1dfb('0x1c')]===undefined?!![]:![]:!![],'where':_0x2acba7[_0x1dfb('0x1d')]?_0x2acba7['options'][_0x1dfb('0x24')]||null:null,'attributes':_0x2acba7[_0x1dfb('0x1d')]?_0x2acba7[_0x1dfb('0x1d')]['attributes']||null:null,'include':_0x2acba7[_0x1dfb('0x1d')]?_0x2acba7[_0x1dfb('0x1d')][_0x1dfb('0x20')]?_['map'](_0x2acba7['options'][_0x1dfb('0x20')],function(_0x34503c){return{'model':db[_0x34503c['model']],'as':_0x34503c['as'],'attributes':_0x34503c[_0x1dfb('0x1e')],'include':_0x34503c[_0x1dfb('0x20')]?_[_0x1dfb('0x21')](_0x34503c['include'],function(_0x1696ef){return{'model':db[_0x1696ef[_0x1dfb('0x22')]],'as':_0x1696ef['as'],'attributes':_0x1696ef[_0x1dfb('0x1e')],'include':_0x1696ef[_0x1dfb('0x20')]?_['map'](_0x1696ef[_0x1dfb('0x20')],function(_0x454aaa){return{'model':db[_0x454aaa['model']],'as':_0x454aaa['as'],'attributes':_0x454aaa['attributes']};}):[]};}):[]};}):[]:[]})[_0x1dfb('0xf')](function(_0x5a8c31){logger[_0x1dfb('0x10')]('ShowChatQueue',_0x2acba7);logger['debug'](_0x1dfb('0x25'),_0x2acba7,JSON[_0x1dfb('0x14')](_0x5a8c31));_0x4b8bdf(_0x5a8c31);})[_0x1dfb('0x19')](function(_0x1e240b){logger[_0x1dfb('0x15')]('ShowChatQueue',_0x1e240b[_0x1dfb('0x17')],_0x2acba7);_0x37f86a(_0xb1b736[_0x1dfb('0x15')](0x1f4,_0x1e240b[_0x1dfb('0x17')]));});});}; \ No newline at end of file +var _0x7e56=['redis','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','map','include','model','debug','ShowChatQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x3d7e29,_0x4b19b9){var _0x480345=function(_0x512148){while(--_0x512148){_0x3d7e29['push'](_0x3d7e29['shift']());}};_0x480345(++_0x4b19b9);}(_0x7e56,0x107));var _0x67e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e56[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x67e5('0x0'));var util=require(_0x67e5('0x1'));var moment=require(_0x67e5('0x2'));var BPromise=require('bluebird');var rs=require(_0x67e5('0x3'));var fs=require('fs');var Redis=require(_0x67e5('0x4'));var db=require(_0x67e5('0x5'))['db'];var utils=require(_0x67e5('0x6'));var logger=require(_0x67e5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x67e5('0x8'));var client=jayson[_0x67e5('0x9')]['http']({'port':0x232a});config[_0x67e5('0xa')]=_['defaults'](config[_0x67e5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67e5('0xa')]));require(_0x67e5('0xb'))[_0x67e5('0xc')](socket);function respondWithRpcPromise(_0x4682e1,_0x43da28,_0x111988){return new BPromise(function(_0x4edc9c,_0x4fc3fd){return client[_0x67e5('0xd')](_0x4682e1,_0x111988)[_0x67e5('0xe')](function(_0x55f070){logger['info'](_0x67e5('0xf'),_0x43da28,_0x67e5('0x10'));logger['debug'](_0x67e5('0x11'),_0x43da28,'request\x20sent',JSON[_0x67e5('0x12')](_0x55f070));if(_0x55f070[_0x67e5('0x13')]){if(_0x55f070[_0x67e5('0x13')][_0x67e5('0x14')]===0x1f4){logger[_0x67e5('0x13')](_0x67e5('0xf'),_0x43da28,_0x55f070['error']['message']);return _0x4fc3fd(_0x55f070[_0x67e5('0x13')][_0x67e5('0x15')]);}logger[_0x67e5('0x13')]('ChatQueue,\x20%s,\x20%s',_0x43da28,_0x55f070[_0x67e5('0x13')][_0x67e5('0x15')]);return _0x4edc9c(_0x55f070[_0x67e5('0x13')][_0x67e5('0x15')]);}else{logger[_0x67e5('0x16')](_0x67e5('0xf'),_0x43da28,_0x67e5('0x10'));_0x4edc9c(_0x55f070[_0x67e5('0x17')]['message']);}})[_0x67e5('0x18')](function(_0x2182d5){logger[_0x67e5('0x13')](_0x67e5('0xf'),_0x43da28,_0x2182d5);_0x4fc3fd(_0x2182d5);});});}exports[_0x67e5('0x19')]=function(_0x5de872){var _0x1c8891=this;return new Promise(function(_0x557d6a,_0x2143ff){return db[_0x67e5('0x1a')][_0x67e5('0x1b')]({'raw':_0x5de872['options']?_0x5de872[_0x67e5('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5de872[_0x67e5('0x1c')]?_0x5de872[_0x67e5('0x1c')][_0x67e5('0x1d')]||null:null,'attributes':_0x5de872[_0x67e5('0x1c')]?_0x5de872['options'][_0x67e5('0x1e')]||null:null,'limit':_0x5de872[_0x67e5('0x1c')]?_0x5de872[_0x67e5('0x1c')][_0x67e5('0x1f')]||null:null,'include':_0x5de872[_0x67e5('0x1c')]?_0x5de872['options']['include']?_[_0x67e5('0x20')](_0x5de872[_0x67e5('0x1c')][_0x67e5('0x21')],function(_0x4b3120){return{'model':db[_0x4b3120[_0x67e5('0x22')]],'as':_0x4b3120['as'],'attributes':_0x4b3120['attributes'],'include':_0x4b3120[_0x67e5('0x21')]?_[_0x67e5('0x20')](_0x4b3120[_0x67e5('0x21')],function(_0x133e49){return{'model':db[_0x133e49[_0x67e5('0x22')]],'as':_0x133e49['as'],'attributes':_0x133e49[_0x67e5('0x1e')],'include':_0x133e49[_0x67e5('0x21')]?_[_0x67e5('0x20')](_0x133e49[_0x67e5('0x21')],function(_0x55c7f2){return{'model':db[_0x55c7f2[_0x67e5('0x22')]],'as':_0x55c7f2['as'],'attributes':_0x55c7f2[_0x67e5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x67e5('0xe')](function(_0x33c506){logger[_0x67e5('0x16')]('GetChatQueue',_0x5de872);logger[_0x67e5('0x23')]('GetChatQueue',_0x5de872,JSON[_0x67e5('0x12')](_0x33c506));_0x557d6a(_0x33c506);})[_0x67e5('0x18')](function(_0xe1a2e4){logger[_0x67e5('0x13')]('GetChatQueue',_0xe1a2e4['message'],_0x5de872);_0x2143ff(_0x1c8891[_0x67e5('0x13')](0x1f4,_0xe1a2e4['message']));});});};exports[_0x67e5('0x24')]=function(_0x53a49d){var _0x2815aa=this;return new Promise(function(_0x1682c5,_0x573136){return db[_0x67e5('0x1a')][_0x67e5('0x25')]({'raw':_0x53a49d[_0x67e5('0x1c')]?_0x53a49d[_0x67e5('0x1c')][_0x67e5('0x26')]===undefined?!![]:![]:!![],'where':_0x53a49d['options']?_0x53a49d[_0x67e5('0x1c')]['where']||null:null,'attributes':_0x53a49d[_0x67e5('0x1c')]?_0x53a49d[_0x67e5('0x1c')][_0x67e5('0x1e')]||null:null,'include':_0x53a49d['options']?_0x53a49d['options'][_0x67e5('0x21')]?_[_0x67e5('0x20')](_0x53a49d[_0x67e5('0x1c')][_0x67e5('0x21')],function(_0x1ebe59){return{'model':db[_0x1ebe59[_0x67e5('0x22')]],'as':_0x1ebe59['as'],'attributes':_0x1ebe59['attributes'],'include':_0x1ebe59[_0x67e5('0x21')]?_['map'](_0x1ebe59[_0x67e5('0x21')],function(_0x18231b){return{'model':db[_0x18231b['model']],'as':_0x18231b['as'],'attributes':_0x18231b['attributes'],'include':_0x18231b[_0x67e5('0x21')]?_[_0x67e5('0x20')](_0x18231b[_0x67e5('0x21')],function(_0x3ec08e){return{'model':db[_0x3ec08e[_0x67e5('0x22')]],'as':_0x3ec08e['as'],'attributes':_0x3ec08e[_0x67e5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x67e5('0xe')](function(_0x35c5e5){logger[_0x67e5('0x16')](_0x67e5('0x24'),_0x53a49d);logger[_0x67e5('0x23')](_0x67e5('0x24'),_0x53a49d,JSON[_0x67e5('0x12')](_0x35c5e5));_0x1682c5(_0x35c5e5);})[_0x67e5('0x18')](function(_0x5c5df2){logger[_0x67e5('0x13')]('ShowChatQueue',_0x5c5df2[_0x67e5('0x15')],_0x53a49d);_0x573136(_0x2815aa[_0x67e5('0x13')](0x1f4,_0x5c5df2[_0x67e5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 3d1db53..56915fa 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 _0xda55=['chatQueue:','./chatQueue.events','save','emit','removeListener','length'];(function(_0x329caa,_0x1bde8e){var _0x2672f1=function(_0x25bdf4){while(--_0x25bdf4){_0x329caa['push'](_0x329caa['shift']());}};_0x2672f1(++_0x1bde8e);}(_0xda55,0x6d));var _0x5da5=function(_0x12fb2c,_0xad4eb9){_0x12fb2c=_0x12fb2c-0x0;var _0x1431cf=_0xda55[_0x12fb2c];return _0x1431cf;};'use strict';var ChatQueueEvents=require(_0x5da5('0x0'));var events=[_0x5da5('0x1'),'remove','update'];function createListener(_0x13ecbc,_0x240a49){return function(_0x26a443){_0x240a49[_0x5da5('0x2')](_0x13ecbc,_0x26a443);};}function removeListener(_0x1c3afd,_0x5da254){return function(){ChatQueueEvents[_0x5da5('0x3')](_0x1c3afd,_0x5da254);};}exports['register']=function(_0x356a37){for(var _0x58e7b3=0x0,_0x2fd877=events[_0x5da5('0x4')];_0x58e7b3<_0x2fd877;_0x58e7b3++){var _0x71b187=events[_0x58e7b3];var _0x46290d=createListener(_0x5da5('0x5')+_0x71b187,_0x356a37);ChatQueueEvents['on'](_0x71b187,_0x46290d);}}; \ No newline at end of file +var _0x826a=['update','emit','removeListener','register','length','chatQueue:','save'];(function(_0x5f18dc,_0x1958a6){var _0x35bada=function(_0x391de7){while(--_0x391de7){_0x5f18dc['push'](_0x5f18dc['shift']());}};_0x35bada(++_0x1958a6);}(_0x826a,0x1aa));var _0xa826=function(_0x327202,_0x43df14){_0x327202=_0x327202-0x0;var _0x141f77=_0x826a[_0x327202];return _0x141f77;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xa826('0x0'),'remove',_0xa826('0x1')];function createListener(_0x50c70e,_0x376d53){return function(_0x19ba11){_0x376d53[_0xa826('0x2')](_0x50c70e,_0x19ba11);};}function removeListener(_0x34e1ad,_0x5372ab){return function(){ChatQueueEvents[_0xa826('0x3')](_0x34e1ad,_0x5372ab);};}exports[_0xa826('0x4')]=function(_0x3929d4){for(var _0x34327b=0x0,_0x45154f=events[_0xa826('0x5')];_0x34327b<_0x45154f;_0x34327b++){var _0x4339f9=events[_0x34327b];var _0x14c2ba=createListener(_0xa826('0x6')+_0x4339f9,_0x3929d4);ChatQueueEvents['on'](_0x4339f9,_0x14c2ba);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 923e827..8785c73 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x2057fe,_0x3e5850){var _0x190713=function(_0x379900){while(--_0x379900){_0x2057fe['push'](_0x2057fe['shift']());}};_0x190713(++_0x3e5850);}(_0x55ca,0x126));var _0xa55c=function(_0x17d82f,_0x5d9172){_0x17d82f=_0x17d82f-0x0;var _0x58137b=_0x55ca[_0x17d82f];return _0x58137b;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x21a7c6,_0x296a2f){var _0x397342=function(_0x3b127e){while(--_0x3b127e){_0x21a7c6['push'](_0x21a7c6['shift']());}};_0x397342(++_0x296a2f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 27a8a42..cbcd7d6 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 _0x36fe=['sequelize','exports','STRING','DATE','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x36fe,0x17b));var _0xe36f=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0x36fe[_0x3cfb0d];return _0x3486b4;};'use strict';var moment=require(_0xe36f('0x0'));var Sequelize=require(_0xe36f('0x1'));module[_0xe36f('0x2')]={'uniqueid':{'type':Sequelize[_0xe36f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe36f('0x3')]},'joinAt':{'type':Sequelize[_0xe36f('0x4')]},'leaveAt':{'type':Sequelize[_0xe36f('0x4')]},'acceptAt':{'type':Sequelize[_0xe36f('0x4')]},'exitAt':{'type':Sequelize[_0xe36f('0x4')]},'reason':{'type':Sequelize[_0xe36f('0x3')]}}; \ No newline at end of file +var _0x6cc9=['STRING','DATE','moment'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x6cc9,0x188));var _0x96cc=function(_0x4cdbcc,_0x88dd08){_0x4cdbcc=_0x4cdbcc-0x0;var _0x459841=_0x6cc9[_0x4cdbcc];return _0x459841;};'use strict';var moment=require(_0x96cc('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x96cc('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x96cc('0x1')]},'joinAt':{'type':Sequelize[_0x96cc('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x96cc('0x2')]},'exitAt':{'type':Sequelize[_0x96cc('0x2')]},'reason':{'type':Sequelize[_0x96cc('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 3cbb981..b6d186a 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 _0xbd3c=['moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','merge','filter','include','findAll','catch','show','params','includeAll','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise'];(function(_0xafbcd,_0x17ff0f){var _0x11a229=function(_0x2915b2){while(--_0x2915b2){_0xafbcd['push'](_0xafbcd['shift']());}};_0x11a229(++_0x17ff0f);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x7d1137,_0x354b8a){_0x7d1137=_0x7d1137-0x0;var _0x3e3ec=_0xbd3c[_0x7d1137];return _0x3e3ec;};'use strict';var emlformat=require(_0xcbd3('0x0'));var rimraf=require(_0xcbd3('0x1'));var zipdir=require(_0xcbd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbd3('0x3'));var moment=require(_0xcbd3('0x4'));var BPromise=require(_0xcbd3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcbd3('0x6'));var sox=require('sox');var csv=require(_0xcbd3('0x7'));var ejs=require(_0xcbd3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbd3('0x9'));var squel=require(_0xcbd3('0xa'));var crypto=require(_0xcbd3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcbd3('0xc'));var toCsv=require(_0xcbd3('0x7'));var querystring=require(_0xcbd3('0xd'));var Papa=require(_0xcbd3('0xe'));var Redis=require(_0xcbd3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbd3('0x10'));var hardwareService=require(_0xcbd3('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcbd3('0x12'));var licenseUtil=require(_0xcbd3('0x13'));var db=require(_0xcbd3('0x14'))['db'];function respondWithStatusCode(_0x488258,_0x6e7d38){_0x6e7d38=_0x6e7d38||0xcc;return function(_0x267d31){if(_0x267d31){return _0x488258[_0xcbd3('0x15')](_0x6e7d38);}return _0x488258[_0xcbd3('0x16')](_0x6e7d38)[_0xcbd3('0x17')]();};}function respondWithResult(_0x1e085d,_0x4fe615){_0x4fe615=_0x4fe615||0xc8;return function(_0x3cb72d){if(_0x3cb72d){return _0x1e085d['status'](_0x4fe615)[_0xcbd3('0x18')](_0x3cb72d);}};}function respondWithFilteredResult(_0x434ed6,_0x3afcb6){return function(_0x5cc3e2){if(_0x5cc3e2){var _0xaec2d4=typeof _0x3afcb6['offset']===_0xcbd3('0x19')&&typeof _0x3afcb6['limit']===_0xcbd3('0x19');var _0x4dd582=_0x5cc3e2[_0xcbd3('0x1a')];var _0x115336=_0xaec2d4?0x0:_0x3afcb6[_0xcbd3('0x1b')];var _0x4ee6a2=_0xaec2d4?_0x5cc3e2['count']:_0x3afcb6[_0xcbd3('0x1b')]+_0x3afcb6[_0xcbd3('0x1c')];var _0xa13da3;if(_0x4ee6a2>=_0x4dd582){_0x4ee6a2=_0x4dd582;_0xa13da3=0xc8;}else{_0xa13da3=0xce;}_0x434ed6['status'](_0xa13da3);return _0x434ed6[_0xcbd3('0x1d')]('Content-Range',_0x115336+'-'+_0x4ee6a2+'/'+_0x4dd582)[_0xcbd3('0x18')](_0x5cc3e2);}return null;};}function patchUpdates(_0x4c344b){return function(_0x281133){try{jsonpatch['apply'](_0x281133,_0x4c344b,!![]);}catch(_0x27b0a5){return BPromise['reject'](_0x27b0a5);}return _0x281133['save']();};}function saveUpdates(_0x3e86c1,_0x443531){return function(_0x1369c5){if(_0x1369c5){return _0x1369c5['update'](_0x3e86c1)[_0xcbd3('0x1e')](function(_0x2b3339){return _0x2b3339;});}return null;};}function removeEntity(_0x232e49,_0x334b34){return function(_0x2a68db){if(_0x2a68db){return _0x2a68db[_0xcbd3('0x1f')]()[_0xcbd3('0x1e')](function(){_0x232e49[_0xcbd3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35fd76,_0x5d9047){return function(_0x2f1cea){if(!_0x2f1cea){_0x35fd76['sendStatus'](0x194);}return _0x2f1cea;};}function handleError(_0x3fa3ca,_0x1d7d18){_0x1d7d18=_0x1d7d18||0x1f4;return function(_0x4fb411){logger[_0xcbd3('0x20')](_0x4fb411['stack']);if(_0x4fb411[_0xcbd3('0x21')]){delete _0x4fb411[_0xcbd3('0x21')];}_0x3fa3ca[_0xcbd3('0x16')](_0x1d7d18)[_0xcbd3('0x22')](_0x4fb411);};}exports[_0xcbd3('0x23')]=function(_0x197b00,_0x15349e){var _0x4e2a58={},_0x3b2186={},_0x148606={'count':0x0,'rows':[]};var _0x2c0fb3=_[_0xcbd3('0x24')](db[_0xcbd3('0x25')][_0xcbd3('0x26')],function(_0x3a74e2){return{'name':_0x3a74e2[_0xcbd3('0x27')],'type':_0x3a74e2[_0xcbd3('0x28')]['key']};});_0x3b2186[_0xcbd3('0x29')]=_['map'](_0x2c0fb3,'name');_0x3b2186[_0xcbd3('0x2a')]=_[_0xcbd3('0x2b')](_0x197b00[_0xcbd3('0x2a')]);_0x3b2186[_0xcbd3('0x2c')]=_[_0xcbd3('0x2d')](_0x3b2186[_0xcbd3('0x29')],_0x3b2186[_0xcbd3('0x2a')]);_0x4e2a58['attributes']=_[_0xcbd3('0x2d')](_0x3b2186['model'],qs[_0xcbd3('0x2e')](_0x197b00[_0xcbd3('0x2a')][_0xcbd3('0x2e')]));_0x4e2a58[_0xcbd3('0x2f')]=_0x4e2a58[_0xcbd3('0x2f')][_0xcbd3('0x30')]?_0x4e2a58[_0xcbd3('0x2f')]:_0x3b2186[_0xcbd3('0x29')];if(!_0x197b00[_0xcbd3('0x2a')]['hasOwnProperty']('nolimit')){_0x4e2a58[_0xcbd3('0x1c')]=qs['limit'](_0x197b00[_0xcbd3('0x2a')][_0xcbd3('0x1c')]);_0x4e2a58[_0xcbd3('0x1b')]=qs[_0xcbd3('0x1b')](_0x197b00[_0xcbd3('0x2a')][_0xcbd3('0x1b')]);}_0x4e2a58['order']=qs[_0xcbd3('0x31')](_0x197b00[_0xcbd3('0x2a')]['sort']);_0x4e2a58[_0xcbd3('0x32')]=qs['filters'](_[_0xcbd3('0x33')](_0x197b00[_0xcbd3('0x2a')],_0x3b2186[_0xcbd3('0x2c')]),_0x2c0fb3);if(_0x197b00[_0xcbd3('0x2a')]['filter']){_0x4e2a58['where']=_[_0xcbd3('0x34')](_0x4e2a58['where'],{'$or':_[_0xcbd3('0x24')](_0x2c0fb3,function(_0xfc29e4){if(_0xfc29e4[_0xcbd3('0x28')]!=='VIRTUAL'){var _0xf5652e={};_0xf5652e[_0xfc29e4[_0xcbd3('0x21')]]={'$like':'%'+_0x197b00['query'][_0xcbd3('0x35')]+'%'};return _0xf5652e;}})});}_0x4e2a58=_[_0xcbd3('0x34')]({},_0x4e2a58,_0x197b00['options']);var _0x296784={'where':_0x4e2a58[_0xcbd3('0x32')]};return db[_0xcbd3('0x25')][_0xcbd3('0x1a')](_0x296784)[_0xcbd3('0x1e')](function(_0x3c6433){_0x148606[_0xcbd3('0x1a')]=_0x3c6433;if(_0x197b00[_0xcbd3('0x2a')]['includeAll']){_0x4e2a58[_0xcbd3('0x36')]=[{'all':!![]}];}return db[_0xcbd3('0x25')][_0xcbd3('0x37')](_0x4e2a58);})[_0xcbd3('0x1e')](function(_0x1c001c){_0x148606['rows']=_0x1c001c;return _0x148606;})[_0xcbd3('0x1e')](respondWithFilteredResult(_0x15349e,_0x4e2a58))[_0xcbd3('0x38')](handleError(_0x15349e,null));};exports[_0xcbd3('0x39')]=function(_0x325beb,_0x45f75b){var _0x1c2168={'raw':!![],'where':{'id':_0x325beb[_0xcbd3('0x3a')]['id']}},_0x1cc338={};_0x1cc338['model']=_[_0xcbd3('0x2b')](db[_0xcbd3('0x25')][_0xcbd3('0x26')]);_0x1cc338[_0xcbd3('0x2a')]=_[_0xcbd3('0x2b')](_0x325beb['query']);_0x1cc338[_0xcbd3('0x2c')]=_[_0xcbd3('0x2d')](_0x1cc338[_0xcbd3('0x29')],_0x1cc338[_0xcbd3('0x2a')]);_0x1c2168[_0xcbd3('0x2f')]=_[_0xcbd3('0x2d')](_0x1cc338['model'],qs[_0xcbd3('0x2e')](_0x325beb[_0xcbd3('0x2a')]['fields']));_0x1c2168[_0xcbd3('0x2f')]=_0x1c2168[_0xcbd3('0x2f')][_0xcbd3('0x30')]?_0x1c2168[_0xcbd3('0x2f')]:_0x1cc338['model'];if(_0x325beb['query'][_0xcbd3('0x3b')]){_0x1c2168[_0xcbd3('0x36')]=[{'all':!![]}];}_0x1c2168=_[_0xcbd3('0x34')]({},_0x1c2168,_0x325beb[_0xcbd3('0x3c')]);return db[_0xcbd3('0x25')][_0xcbd3('0x3d')](_0x1c2168)[_0xcbd3('0x1e')](handleEntityNotFound(_0x45f75b,null))[_0xcbd3('0x1e')](respondWithResult(_0x45f75b,null))['catch'](handleError(_0x45f75b,null));};exports[_0xcbd3('0x3e')]=function(_0x557ea0,_0xcf69af){return db['ChatQueueReport'][_0xcbd3('0x3e')](_0x557ea0[_0xcbd3('0x3f')],{})[_0xcbd3('0x1e')](respondWithResult(_0xcf69af,0xc9))['catch'](handleError(_0xcf69af,null));};exports[_0xcbd3('0x40')]=function(_0x2da30c,_0x1016dc){if(_0x2da30c[_0xcbd3('0x3f')]['id']){delete _0x2da30c[_0xcbd3('0x3f')]['id'];}return db[_0xcbd3('0x25')][_0xcbd3('0x3d')]({'where':{'id':_0x2da30c[_0xcbd3('0x3a')]['id']}})[_0xcbd3('0x1e')](handleEntityNotFound(_0x1016dc,null))['then'](saveUpdates(_0x2da30c[_0xcbd3('0x3f')],null))[_0xcbd3('0x1e')](respondWithResult(_0x1016dc,null))[_0xcbd3('0x38')](handleError(_0x1016dc,null));};exports[_0xcbd3('0x1f')]=function(_0x59153b,_0x234414){return db['ChatQueueReport'][_0xcbd3('0x3d')]({'where':{'id':_0x59153b['params']['id']}})[_0xcbd3('0x1e')](handleEntityNotFound(_0x234414,null))[_0xcbd3('0x1e')](removeEntity(_0x234414,null))[_0xcbd3('0x38')](handleError(_0x234414,null));};exports['describe']=function(_0x32610d,_0x1b3edb){return db[_0xcbd3('0x25')][_0xcbd3('0x41')]()['then'](respondWithResult(_0x1b3edb,null))['catch'](handleError(_0x1b3edb,null));}; \ No newline at end of file +var _0xbd18=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','name','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0xbd18,0x195));var _0x8bd1=function(_0xd9c344,_0x3e424b){_0xd9c344=_0xd9c344-0x0;var _0x470d66=_0xbd18[_0xd9c344];return _0x470d66;};'use strict';var emlformat=require(_0x8bd1('0x0'));var rimraf=require(_0x8bd1('0x1'));var zipdir=require(_0x8bd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bd1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8bd1('0x4'));var path=require(_0x8bd1('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8bd1('0x6'));var fs=require('fs');var fs_extra=require(_0x8bd1('0x7'));var _=require(_0x8bd1('0x8'));var squel=require(_0x8bd1('0x9'));var crypto=require('crypto');var jsforce=require(_0x8bd1('0xa'));var deskjs=require(_0x8bd1('0xb'));var toCsv=require(_0x8bd1('0xc'));var querystring=require('querystring');var Papa=require(_0x8bd1('0xd'));var Redis=require(_0x8bd1('0xe'));var authService=require(_0x8bd1('0xf'));var qs=require(_0x8bd1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bd1('0x11'));var logger=require('../../config/logger')(_0x8bd1('0x12'));var utils=require(_0x8bd1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8bd1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x186943,_0x37639b){_0x37639b=_0x37639b||0xcc;return function(_0x11d80a){if(_0x11d80a){return _0x186943[_0x8bd1('0x15')](_0x37639b);}return _0x186943[_0x8bd1('0x16')](_0x37639b)[_0x8bd1('0x17')]();};}function respondWithResult(_0x194812,_0x322d06){_0x322d06=_0x322d06||0xc8;return function(_0x44a6cd){if(_0x44a6cd){return _0x194812['status'](_0x322d06)[_0x8bd1('0x18')](_0x44a6cd);}};}function respondWithFilteredResult(_0x1d446d,_0x65d556){return function(_0x41b595){if(_0x41b595){var _0x63b01a=typeof _0x65d556[_0x8bd1('0x19')]==='undefined'&&typeof _0x65d556[_0x8bd1('0x1a')]===_0x8bd1('0x1b');var _0xcef42a=_0x41b595['count'];var _0x48a9d0=_0x63b01a?0x0:_0x65d556[_0x8bd1('0x19')];var _0x3ef8aa=_0x63b01a?_0x41b595[_0x8bd1('0x1c')]:_0x65d556[_0x8bd1('0x19')]+_0x65d556[_0x8bd1('0x1a')];var _0x2d7217;if(_0x3ef8aa>=_0xcef42a){_0x3ef8aa=_0xcef42a;_0x2d7217=0xc8;}else{_0x2d7217=0xce;}_0x1d446d[_0x8bd1('0x16')](_0x2d7217);return _0x1d446d[_0x8bd1('0x1d')](_0x8bd1('0x1e'),_0x48a9d0+'-'+_0x3ef8aa+'/'+_0xcef42a)[_0x8bd1('0x18')](_0x41b595);}return null;};}function patchUpdates(_0x58d428){return function(_0x24a4c9){try{jsonpatch[_0x8bd1('0x1f')](_0x24a4c9,_0x58d428,!![]);}catch(_0x3e1a43){return BPromise[_0x8bd1('0x20')](_0x3e1a43);}return _0x24a4c9[_0x8bd1('0x21')]();};}function saveUpdates(_0x3d51fb,_0x460f09){return function(_0x407a49){if(_0x407a49){return _0x407a49[_0x8bd1('0x22')](_0x3d51fb)[_0x8bd1('0x23')](function(_0x22dd62){return _0x22dd62;});}return null;};}function removeEntity(_0x19fb04,_0x59f54e){return function(_0xbe9080){if(_0xbe9080){return _0xbe9080[_0x8bd1('0x24')]()['then'](function(){_0x19fb04[_0x8bd1('0x16')](0xcc)[_0x8bd1('0x17')]();});}};}function handleEntityNotFound(_0x5aa02d,_0x1ea0dc){return function(_0x2394c5){if(!_0x2394c5){_0x5aa02d[_0x8bd1('0x15')](0x194);}return _0x2394c5;};}function handleError(_0x553a9c,_0x205f67){_0x205f67=_0x205f67||0x1f4;return function(_0x1963dc){logger['error'](_0x1963dc['stack']);if(_0x1963dc[_0x8bd1('0x25')]){delete _0x1963dc['name'];}_0x553a9c[_0x8bd1('0x16')](_0x205f67)['send'](_0x1963dc);};}exports['index']=function(_0x46e8bd,_0x1e9389){var _0x34401e={},_0x38d8a0={},_0x15b332={'count':0x0,'rows':[]};var _0xdf3834=_['map'](db[_0x8bd1('0x26')][_0x8bd1('0x27')],function(_0x13e0e0){return{'name':_0x13e0e0[_0x8bd1('0x28')],'type':_0x13e0e0[_0x8bd1('0x29')][_0x8bd1('0x2a')]};});_0x38d8a0[_0x8bd1('0x2b')]=_[_0x8bd1('0x2c')](_0xdf3834,'name');_0x38d8a0[_0x8bd1('0x2d')]=_[_0x8bd1('0x2e')](_0x46e8bd['query']);_0x38d8a0[_0x8bd1('0x2f')]=_[_0x8bd1('0x30')](_0x38d8a0[_0x8bd1('0x2b')],_0x38d8a0[_0x8bd1('0x2d')]);_0x34401e[_0x8bd1('0x31')]=_['intersection'](_0x38d8a0[_0x8bd1('0x2b')],qs['fields'](_0x46e8bd['query'][_0x8bd1('0x32')]));_0x34401e[_0x8bd1('0x31')]=_0x34401e['attributes'][_0x8bd1('0x33')]?_0x34401e['attributes']:_0x38d8a0[_0x8bd1('0x2b')];if(!_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x34')]('nolimit')){_0x34401e['limit']=qs[_0x8bd1('0x1a')](_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x1a')]);_0x34401e[_0x8bd1('0x19')]=qs[_0x8bd1('0x19')](_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x19')]);}_0x34401e[_0x8bd1('0x35')]=qs[_0x8bd1('0x36')](_0x46e8bd['query']['sort']);_0x34401e[_0x8bd1('0x37')]=qs[_0x8bd1('0x2f')](_[_0x8bd1('0x38')](_0x46e8bd[_0x8bd1('0x2d')],_0x38d8a0[_0x8bd1('0x2f')]),_0xdf3834);if(_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x39')]){_0x34401e[_0x8bd1('0x37')]=_[_0x8bd1('0x3a')](_0x34401e['where'],{'$or':_[_0x8bd1('0x2c')](_0xdf3834,function(_0x225c14){if(_0x225c14[_0x8bd1('0x29')]!==_0x8bd1('0x3b')){var _0x56f8e3={};_0x56f8e3[_0x225c14['name']]={'$like':'%'+_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x39')]+'%'};return _0x56f8e3;}})});}_0x34401e=_['merge']({},_0x34401e,_0x46e8bd['options']);var _0x2bf417={'where':_0x34401e[_0x8bd1('0x37')]};return db[_0x8bd1('0x26')]['count'](_0x2bf417)[_0x8bd1('0x23')](function(_0x339e2a){_0x15b332['count']=_0x339e2a;if(_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x3c')]){_0x34401e[_0x8bd1('0x3d')]=[{'all':!![]}];}return db[_0x8bd1('0x26')][_0x8bd1('0x3e')](_0x34401e);})['then'](function(_0xa03ed9){_0x15b332[_0x8bd1('0x3f')]=_0xa03ed9;return _0x15b332;})[_0x8bd1('0x23')](respondWithFilteredResult(_0x1e9389,_0x34401e))['catch'](handleError(_0x1e9389,null));};exports[_0x8bd1('0x40')]=function(_0x380599,_0x30375e){var _0x48a808={'raw':!![],'where':{'id':_0x380599[_0x8bd1('0x41')]['id']}},_0x3d6628={};_0x3d6628[_0x8bd1('0x2b')]=_['keys'](db[_0x8bd1('0x26')][_0x8bd1('0x27')]);_0x3d6628[_0x8bd1('0x2d')]=_['keys'](_0x380599[_0x8bd1('0x2d')]);_0x3d6628[_0x8bd1('0x2f')]=_[_0x8bd1('0x30')](_0x3d6628['model'],_0x3d6628[_0x8bd1('0x2d')]);_0x48a808[_0x8bd1('0x31')]=_[_0x8bd1('0x30')](_0x3d6628[_0x8bd1('0x2b')],qs[_0x8bd1('0x32')](_0x380599['query']['fields']));_0x48a808['attributes']=_0x48a808[_0x8bd1('0x31')][_0x8bd1('0x33')]?_0x48a808[_0x8bd1('0x31')]:_0x3d6628[_0x8bd1('0x2b')];if(_0x380599[_0x8bd1('0x2d')]['includeAll']){_0x48a808['include']=[{'all':!![]}];}_0x48a808=_[_0x8bd1('0x3a')]({},_0x48a808,_0x380599[_0x8bd1('0x42')]);return db[_0x8bd1('0x26')][_0x8bd1('0x43')](_0x48a808)[_0x8bd1('0x23')](handleEntityNotFound(_0x30375e,null))[_0x8bd1('0x23')](respondWithResult(_0x30375e,null))[_0x8bd1('0x44')](handleError(_0x30375e,null));};exports[_0x8bd1('0x45')]=function(_0x346514,_0x3abf0d){return db[_0x8bd1('0x26')][_0x8bd1('0x45')](_0x346514[_0x8bd1('0x46')],{})[_0x8bd1('0x23')](respondWithResult(_0x3abf0d,0xc9))['catch'](handleError(_0x3abf0d,null));};exports[_0x8bd1('0x22')]=function(_0x4983e4,_0x354a63){if(_0x4983e4[_0x8bd1('0x46')]['id']){delete _0x4983e4[_0x8bd1('0x46')]['id'];}return db[_0x8bd1('0x26')]['find']({'where':{'id':_0x4983e4[_0x8bd1('0x41')]['id']}})['then'](handleEntityNotFound(_0x354a63,null))[_0x8bd1('0x23')](saveUpdates(_0x4983e4[_0x8bd1('0x46')],null))[_0x8bd1('0x23')](respondWithResult(_0x354a63,null))[_0x8bd1('0x44')](handleError(_0x354a63,null));};exports[_0x8bd1('0x24')]=function(_0x553f1e,_0x5a4c58){return db[_0x8bd1('0x26')][_0x8bd1('0x43')]({'where':{'id':_0x553f1e[_0x8bd1('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a4c58,null))[_0x8bd1('0x23')](removeEntity(_0x5a4c58,null))[_0x8bd1('0x44')](handleError(_0x5a4c58,null));};exports[_0x8bd1('0x47')]=function(_0x6e8691,_0x239ef2){return db['ChatQueueReport'][_0x8bd1('0x47')]()[_0x8bd1('0x23')](respondWithResult(_0x239ef2,null))['catch'](handleError(_0x239ef2,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index a0d7714..dccba8b 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(_0x2b8347,_0x14e3f2){var _0x15e93e=function(_0x2b046b){while(--_0x2b046b){_0x2b8347['push'](_0x2b8347['shift']());}};_0x15e93e(++_0x14e3f2);}(_0xe706,0xa3));var _0x6e70=function(_0x199c9b,_0xd6e4c3){_0x199c9b=_0x199c9b-0x0;var _0x2f4c42=_0xe706[_0x199c9b];return _0x2f4c42;};'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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x55b0bf,_0x483cc8){var _0x29da3a=function(_0x2e7332){while(--_0x2e7332){_0x55b0bf['push'](_0x55b0bf['shift']());}};_0x29da3a(++_0x483cc8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index fe297ed..fdc38fc 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 _0xac02=['where','limit','UpdateChatQueueReport','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','update'];(function(_0x90651d,_0x39e4c2){var _0x44a0ae=function(_0x1b3ead){while(--_0x1b3ead){_0x90651d['push'](_0x90651d['shift']());}};_0x44a0ae(++_0x39e4c2);}(_0xac02,0xc3));var _0x2ac0=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xac02[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x2ac0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ac0('0x1'));var db=require(_0x2ac0('0x2'))['db'];var utils=require(_0x2ac0('0x3'));var logger=require(_0x2ac0('0x4'))(_0x2ac0('0x5'));var config=require(_0x2ac0('0x6'));var jayson=require(_0x2ac0('0x7'));var client=jayson[_0x2ac0('0x8')][_0x2ac0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ceb94,_0x3d4e33,_0x399cb8){return new BPromise(function(_0x5c7bc3,_0x4e9741){return client[_0x2ac0('0xa')](_0x5ceb94,_0x399cb8)[_0x2ac0('0xb')](function(_0x17fe32){logger[_0x2ac0('0xc')](_0x2ac0('0xd'),_0x3d4e33,'request\x20sent');logger['debug'](_0x2ac0('0xe'),_0x3d4e33,_0x2ac0('0xf'),JSON[_0x2ac0('0x10')](_0x17fe32));if(_0x17fe32[_0x2ac0('0x11')]){if(_0x17fe32['error'][_0x2ac0('0x12')]===0x1f4){logger[_0x2ac0('0x11')](_0x2ac0('0xd'),_0x3d4e33,_0x17fe32['error']['message']);return _0x4e9741(_0x17fe32['error'][_0x2ac0('0x13')]);}logger['error'](_0x2ac0('0xd'),_0x3d4e33,_0x17fe32[_0x2ac0('0x11')]['message']);return _0x5c7bc3(_0x17fe32['error'][_0x2ac0('0x13')]);}else{logger[_0x2ac0('0xc')](_0x2ac0('0xd'),_0x3d4e33,_0x2ac0('0xf'));_0x5c7bc3(_0x17fe32['result'][_0x2ac0('0x13')]);}})[_0x2ac0('0x14')](function(_0x5f32a9){logger[_0x2ac0('0x11')](_0x2ac0('0xd'),_0x3d4e33,_0x5f32a9);_0x4e9741(_0x5f32a9);});});}exports[_0x2ac0('0x15')]=function(_0x2d67ba){var _0x61dd7d=this;return new Promise(function(_0x4a8781,_0x62b35e){return db[_0x2ac0('0x16')][_0x2ac0('0x17')](_0x2d67ba[_0x2ac0('0x18')],{'raw':_0x2d67ba[_0x2ac0('0x19')]?_0x2d67ba[_0x2ac0('0x19')][_0x2ac0('0x1a')]===undefined?!![]:![]:!![]})[_0x2ac0('0xb')](function(_0xad4489){logger[_0x2ac0('0xc')](_0x2ac0('0x15'),_0x2d67ba);logger[_0x2ac0('0x1b')](_0x2ac0('0x15'),_0x2d67ba,JSON[_0x2ac0('0x10')](_0xad4489));_0x4a8781(_0xad4489);})['catch'](function(_0x344aed){logger[_0x2ac0('0x11')](_0x2ac0('0x15'),_0x344aed[_0x2ac0('0x13')],_0x2d67ba);_0x62b35e(_0x61dd7d[_0x2ac0('0x11')](0x1f4,_0x344aed[_0x2ac0('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x2779cd){var _0x470de5=this;return new Promise(function(_0x52a3ec,_0x3262ba){return db[_0x2ac0('0x16')][_0x2ac0('0x1c')](_0x2779cd[_0x2ac0('0x18')],{'raw':_0x2779cd[_0x2ac0('0x19')]?_0x2779cd[_0x2ac0('0x19')][_0x2ac0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2779cd[_0x2ac0('0x19')]?_0x2779cd[_0x2ac0('0x19')][_0x2ac0('0x1d')]||null:null,'attributes':_0x2779cd['options']?_0x2779cd[_0x2ac0('0x19')]['attributes']||null:null,'limit':_0x2779cd[_0x2ac0('0x19')]?_0x2779cd[_0x2ac0('0x19')][_0x2ac0('0x1e')]||null:null})[_0x2ac0('0xb')](function(_0x44fbd2){logger[_0x2ac0('0xc')]('UpdateChatQueueReport',_0x2779cd);logger[_0x2ac0('0x1b')]('UpdateChatQueueReport',_0x2779cd,JSON[_0x2ac0('0x10')](_0x44fbd2));_0x52a3ec(_0x44fbd2);})['catch'](function(_0x22f7be){logger[_0x2ac0('0x11')](_0x2ac0('0x1f'),_0x22f7be[_0x2ac0('0x13')],_0x2779cd);_0x3262ba(_0x470de5['error'](0x1f4,_0x22f7be[_0x2ac0('0x13')]));});});}; \ No newline at end of file +var _0x0d87=['UpdateChatQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then'];(function(_0x3c0fc7,_0x462074){var _0x509859=function(_0x7af9eb){while(--_0x7af9eb){_0x3c0fc7['push'](_0x3c0fc7['shift']());}};_0x509859(++_0x462074);}(_0x0d87,0xca));var _0x70d8=function(_0x1c25de,_0xf7ef95){_0x1c25de=_0x1c25de-0x0;var _0x36553c=_0x0d87[_0x1c25de];return _0x36553c;};'use strict';var _=require('lodash');var util=require(_0x70d8('0x0'));var moment=require(_0x70d8('0x1'));var BPromise=require(_0x70d8('0x2'));var rs=require(_0x70d8('0x3'));var fs=require('fs');var Redis=require(_0x70d8('0x4'));var db=require(_0x70d8('0x5'))['db'];var utils=require(_0x70d8('0x6'));var logger=require(_0x70d8('0x7'))('rpc');var config=require(_0x70d8('0x8'));var jayson=require(_0x70d8('0x9'));var client=jayson[_0x70d8('0xa')][_0x70d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ffb61,_0x58ffea,_0x169ba8){return new BPromise(function(_0x4a93ea,_0x2e7d35){return client['request'](_0x2ffb61,_0x169ba8)['then'](function(_0x5b382d){logger[_0x70d8('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,'request\x20sent');logger[_0x70d8('0xd')](_0x70d8('0xe'),_0x58ffea,_0x70d8('0xf'),JSON[_0x70d8('0x10')](_0x5b382d));if(_0x5b382d[_0x70d8('0x11')]){if(_0x5b382d['error'][_0x70d8('0x12')]===0x1f4){logger[_0x70d8('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,_0x5b382d[_0x70d8('0x11')]['message']);return _0x2e7d35(_0x5b382d[_0x70d8('0x11')][_0x70d8('0x13')]);}logger[_0x70d8('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,_0x5b382d[_0x70d8('0x11')][_0x70d8('0x13')]);return _0x4a93ea(_0x5b382d[_0x70d8('0x11')][_0x70d8('0x13')]);}else{logger[_0x70d8('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,'request\x20sent');_0x4a93ea(_0x5b382d[_0x70d8('0x14')]['message']);}})[_0x70d8('0x15')](function(_0x45c726){logger[_0x70d8('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,_0x45c726);_0x2e7d35(_0x45c726);});});}exports[_0x70d8('0x16')]=function(_0x1d6908){var _0x5541e5=this;return new Promise(function(_0x538e87,_0x1f86c5){return db[_0x70d8('0x17')][_0x70d8('0x18')](_0x1d6908[_0x70d8('0x19')],{'raw':_0x1d6908[_0x70d8('0x1a')]?_0x1d6908[_0x70d8('0x1a')][_0x70d8('0x1b')]===undefined?!![]:![]:!![]})[_0x70d8('0x1c')](function(_0x12d069){logger[_0x70d8('0xc')](_0x70d8('0x16'),_0x1d6908);logger[_0x70d8('0xd')](_0x70d8('0x16'),_0x1d6908,JSON[_0x70d8('0x10')](_0x12d069));_0x538e87(_0x12d069);})[_0x70d8('0x15')](function(_0x34967a){logger[_0x70d8('0x11')]('CreateChatQueueReport',_0x34967a[_0x70d8('0x13')],_0x1d6908);_0x1f86c5(_0x5541e5[_0x70d8('0x11')](0x1f4,_0x34967a[_0x70d8('0x13')]));});});};exports[_0x70d8('0x1d')]=function(_0x15eb27){var _0x4c5501=this;return new Promise(function(_0x565ce3,_0x549a84){return db['ChatQueueReport'][_0x70d8('0x1e')](_0x15eb27[_0x70d8('0x19')],{'raw':_0x15eb27[_0x70d8('0x1a')]?_0x15eb27['options'][_0x70d8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15eb27[_0x70d8('0x1a')]?_0x15eb27[_0x70d8('0x1a')]['where']||null:null,'attributes':_0x15eb27['options']?_0x15eb27[_0x70d8('0x1a')][_0x70d8('0x1f')]||null:null,'limit':_0x15eb27[_0x70d8('0x1a')]?_0x15eb27[_0x70d8('0x1a')][_0x70d8('0x20')]||null:null})[_0x70d8('0x1c')](function(_0xa826a8){logger[_0x70d8('0xc')](_0x70d8('0x1d'),_0x15eb27);logger[_0x70d8('0xd')](_0x70d8('0x1d'),_0x15eb27,JSON['stringify'](_0xa826a8));_0x565ce3(_0xa826a8);})[_0x70d8('0x15')](function(_0x4836a9){logger[_0x70d8('0x11')]('UpdateChatQueueReport',_0x4836a9[_0x70d8('0x13')],_0x15eb27);_0x549a84(_0x4c5501[_0x70d8('0x11')](0x1f4,_0x4836a9[_0x70d8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index b94e7cf..e14540d 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 _0x5299=['/:id','update','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create'];(function(_0x5ace78,_0x7edcd3){var _0x5a1279=function(_0x3bf095){while(--_0x3bf095){_0x5ace78['push'](_0x5ace78['shift']());}};_0x5a1279(++_0x7edcd3);}(_0x5299,0x1e3));var _0x9529=function(_0x1ba646,_0x49a27d){_0x1ba646=_0x1ba646-0x0;var _0x4625ac=_0x5299[_0x1ba646];return _0x4625ac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9529('0x0'));var timeout=require(_0x9529('0x1'));var express=require('express');var router=express[_0x9529('0x2')]();var fs_extra=require(_0x9529('0x3'));var auth=require(_0x9529('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9529('0x5'));router[_0x9529('0x6')]('/',auth[_0x9529('0x7')](),controller[_0x9529('0x8')]);router['get'](_0x9529('0x9'),auth[_0x9529('0x7')](),controller['describe']);router[_0x9529('0x6')]('/:id',auth[_0x9529('0x7')](),controller[_0x9529('0xa')]);router[_0x9529('0xb')]('/',auth['isAuthenticated'](),controller[_0x9529('0xc')]);router['put'](_0x9529('0xd'),auth[_0x9529('0x7')](),controller[_0x9529('0xe')]);router['delete'](_0x9529('0xd'),auth[_0x9529('0x7')](),controller[_0x9529('0xf')]);module['exports']=router; \ No newline at end of file +var _0x94e6=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x21adfa,_0x42692b){var _0x15c9b7=function(_0x722296){while(--_0x722296){_0x21adfa['push'](_0x21adfa['shift']());}};_0x15c9b7(++_0x42692b);}(_0x94e6,0x127));var _0x694e=function(_0x33f994,_0x23fda2){_0x33f994=_0x33f994-0x0;var _0xfaf084=_0x94e6[_0x33f994];return _0xfaf084;};'use strict';var multer=require(_0x694e('0x0'));var util=require(_0x694e('0x1'));var path=require(_0x694e('0x2'));var timeout=require(_0x694e('0x3'));var express=require(_0x694e('0x4'));var router=express[_0x694e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x694e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x694e('0x7'));var controller=require('./chatQueueReport.controller');router[_0x694e('0x8')]('/',auth[_0x694e('0x9')](),controller[_0x694e('0xa')]);router['get']('/describe',auth[_0x694e('0x9')](),controller[_0x694e('0xb')]);router[_0x694e('0x8')]('/:id',auth[_0x694e('0x9')](),controller[_0x694e('0xc')]);router[_0x694e('0xd')]('/',auth[_0x694e('0x9')](),controller[_0x694e('0xe')]);router[_0x694e('0xf')]('/:id',auth[_0x694e('0x9')](),controller[_0x694e('0x10')]);router[_0x694e('0x11')]('/:id',auth[_0x694e('0x9')](),controller[_0x694e('0x12')]);module[_0x694e('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d75c53f..98ce7c0 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1f97fa,_0x2e24cc){_0x1f97fa=_0x1f97fa-0x0;var _0x3f86cc=_0xb43b[_0x1f97fa];return _0x3f86cc;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x641b62,_0x49432c){var _0x346d0c=function(_0x45413f){while(--_0x45413f){_0x641b62['push'](_0x641b62['shift']());}};_0x346d0c(++_0x49432c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1a49ca,_0x406f70){_0x1a49ca=_0x1a49ca-0x0;var _0x232d53=_0xf4eb[_0x1a49ca];return _0x232d53;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index a90e21c..46ae1bc 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 _0x570b=['find','create','body','params','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','keys'];(function(_0x14d8ba,_0x1209f5){var _0x332211=function(_0x5f2897){while(--_0x5f2897){_0x14d8ba['push'](_0x14d8ba['shift']());}};_0x332211(++_0x1209f5);}(_0x570b,0xa0));var _0xb570=function(_0x414ed2,_0x417ea1){_0x414ed2=_0x414ed2-0x0;var _0x8c730e=_0x570b[_0x414ed2];return _0x8c730e;};'use strict';var emlformat=require(_0xb570('0x0'));var rimraf=require(_0xb570('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb570('0x2'));var rp=require(_0xb570('0x3'));var moment=require(_0xb570('0x4'));var BPromise=require(_0xb570('0x5'));var Mustache=require(_0xb570('0x6'));var util=require(_0xb570('0x7'));var path=require(_0xb570('0x8'));var sox=require(_0xb570('0x9'));var csv=require('to-csv');var ejs=require(_0xb570('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb570('0xb'));var crypto=require(_0xb570('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb570('0xd'));var toCsv=require(_0xb570('0xe'));var querystring=require(_0xb570('0xf'));var Papa=require(_0xb570('0x10'));var Redis=require(_0xb570('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb570('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb570('0x13'));var logger=require(_0xb570('0x14'))(_0xb570('0x15'));var utils=require(_0xb570('0x16'));var config=require(_0xb570('0x17'));var licenseUtil=require(_0xb570('0x18'));var db=require(_0xb570('0x19'))['db'];function respondWithStatusCode(_0x2a1127,_0x5365b0){_0x5365b0=_0x5365b0||0xcc;return function(_0x58986){if(_0x58986){return _0x2a1127['sendStatus'](_0x5365b0);}return _0x2a1127['status'](_0x5365b0)[_0xb570('0x1a')]();};}function respondWithResult(_0xf0b431,_0x5e32ab){_0x5e32ab=_0x5e32ab||0xc8;return function(_0x23e277){if(_0x23e277){return _0xf0b431[_0xb570('0x1b')](_0x5e32ab)[_0xb570('0x1c')](_0x23e277);}};}function respondWithFilteredResult(_0x35d267,_0x528b24){return function(_0x560fa4){if(_0x560fa4){var _0x1b83df=typeof _0x528b24['offset']===_0xb570('0x1d')&&typeof _0x528b24[_0xb570('0x1e')]===_0xb570('0x1d');var _0x47fd03=_0x560fa4[_0xb570('0x1f')];var _0x194c89=_0x1b83df?0x0:_0x528b24[_0xb570('0x20')];var _0x4a22ff=_0x1b83df?_0x560fa4[_0xb570('0x1f')]:_0x528b24[_0xb570('0x20')]+_0x528b24['limit'];var _0x47f92a;if(_0x4a22ff>=_0x47fd03){_0x4a22ff=_0x47fd03;_0x47f92a=0xc8;}else{_0x47f92a=0xce;}_0x35d267[_0xb570('0x1b')](_0x47f92a);return _0x35d267['set'](_0xb570('0x21'),_0x194c89+'-'+_0x4a22ff+'/'+_0x47fd03)[_0xb570('0x1c')](_0x560fa4);}return null;};}function patchUpdates(_0x3d84bf){return function(_0x233d44){try{jsonpatch[_0xb570('0x22')](_0x233d44,_0x3d84bf,!![]);}catch(_0x1b7df3){return BPromise[_0xb570('0x23')](_0x1b7df3);}return _0x233d44[_0xb570('0x24')]();};}function saveUpdates(_0x394979,_0xb3b972){return function(_0x51f18c){if(_0x51f18c){return _0x51f18c[_0xb570('0x25')](_0x394979)[_0xb570('0x26')](function(_0x48e948){return _0x48e948;});}return null;};}function removeEntity(_0xcd4346,_0x4fca64){return function(_0x5dc2a2){if(_0x5dc2a2){return _0x5dc2a2[_0xb570('0x27')]()[_0xb570('0x26')](function(){_0xcd4346[_0xb570('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fced,_0x1d7a1a){return function(_0x526ea2){if(!_0x526ea2){_0x30fced[_0xb570('0x28')](0x194);}return _0x526ea2;};}function handleError(_0x865f13,_0x3322e0){_0x3322e0=_0x3322e0||0x1f4;return function(_0x4f7194){logger['error'](_0x4f7194[_0xb570('0x29')]);if(_0x4f7194['name']){delete _0x4f7194['name'];}_0x865f13[_0xb570('0x1b')](_0x3322e0)[_0xb570('0x2a')](_0x4f7194);};}exports[_0xb570('0x2b')]=function(_0x1afa88,_0x356bf9){var _0x3b8d2e={},_0x152778={},_0x91dcca={'count':0x0,'rows':[]};var _0x3e97a1=_[_0xb570('0x2c')](db[_0xb570('0x2d')][_0xb570('0x2e')],function(_0xed8ab6){return{'name':_0xed8ab6[_0xb570('0x2f')],'type':_0xed8ab6[_0xb570('0x30')][_0xb570('0x31')]};});_0x152778[_0xb570('0x32')]=_['map'](_0x3e97a1,_0xb570('0x33'));_0x152778[_0xb570('0x34')]=_['keys'](_0x1afa88[_0xb570('0x34')]);_0x152778[_0xb570('0x35')]=_[_0xb570('0x36')](_0x152778[_0xb570('0x32')],_0x152778[_0xb570('0x34')]);_0x3b8d2e[_0xb570('0x37')]=_[_0xb570('0x36')](_0x152778['model'],qs[_0xb570('0x38')](_0x1afa88['query'][_0xb570('0x38')]));_0x3b8d2e[_0xb570('0x37')]=_0x3b8d2e[_0xb570('0x37')][_0xb570('0x39')]?_0x3b8d2e[_0xb570('0x37')]:_0x152778[_0xb570('0x32')];if(!_0x1afa88['query']['hasOwnProperty'](_0xb570('0x3a'))){_0x3b8d2e[_0xb570('0x1e')]=qs[_0xb570('0x1e')](_0x1afa88['query'][_0xb570('0x1e')]);_0x3b8d2e[_0xb570('0x20')]=qs[_0xb570('0x20')](_0x1afa88[_0xb570('0x34')]['offset']);}_0x3b8d2e['order']=qs[_0xb570('0x3b')](_0x1afa88[_0xb570('0x34')][_0xb570('0x3b')]);_0x3b8d2e[_0xb570('0x3c')]=qs['filters'](_[_0xb570('0x3d')](_0x1afa88[_0xb570('0x34')],_0x152778[_0xb570('0x35')]),_0x3e97a1);if(_0x1afa88[_0xb570('0x34')]['filter']){_0x3b8d2e['where']=_['merge'](_0x3b8d2e[_0xb570('0x3c')],{'$or':_[_0xb570('0x2c')](_0x3e97a1,function(_0xbd7f5e){if(_0xbd7f5e['type']!==_0xb570('0x3e')){var _0x333534={};_0x333534[_0xbd7f5e[_0xb570('0x33')]]={'$like':'%'+_0x1afa88[_0xb570('0x34')][_0xb570('0x3f')]+'%'};return _0x333534;}})});}_0x3b8d2e=_[_0xb570('0x40')]({},_0x3b8d2e,_0x1afa88[_0xb570('0x41')]);var _0x55e733={'where':_0x3b8d2e[_0xb570('0x3c')]};return db[_0xb570('0x2d')]['count'](_0x55e733)[_0xb570('0x26')](function(_0xef2ecd){_0x91dcca[_0xb570('0x1f')]=_0xef2ecd;if(_0x1afa88[_0xb570('0x34')][_0xb570('0x42')]){_0x3b8d2e[_0xb570('0x43')]=[{'all':!![]}];}return db[_0xb570('0x2d')]['findAll'](_0x3b8d2e);})[_0xb570('0x26')](function(_0x5898ce){_0x91dcca[_0xb570('0x44')]=_0x5898ce;return _0x91dcca;})['then'](respondWithFilteredResult(_0x356bf9,_0x3b8d2e))['catch'](handleError(_0x356bf9,null));};exports[_0xb570('0x45')]=function(_0x5ee6d4,_0x4025ef){var _0x2f7463={'raw':!![],'where':{'id':_0x5ee6d4['params']['id']}},_0x3306b5={};_0x3306b5[_0xb570('0x32')]=_[_0xb570('0x46')](db[_0xb570('0x2d')][_0xb570('0x2e')]);_0x3306b5[_0xb570('0x34')]=_[_0xb570('0x46')](_0x5ee6d4['query']);_0x3306b5[_0xb570('0x35')]=_[_0xb570('0x36')](_0x3306b5[_0xb570('0x32')],_0x3306b5[_0xb570('0x34')]);_0x2f7463[_0xb570('0x37')]=_[_0xb570('0x36')](_0x3306b5[_0xb570('0x32')],qs[_0xb570('0x38')](_0x5ee6d4[_0xb570('0x34')]['fields']));_0x2f7463[_0xb570('0x37')]=_0x2f7463[_0xb570('0x37')][_0xb570('0x39')]?_0x2f7463['attributes']:_0x3306b5[_0xb570('0x32')];if(_0x5ee6d4['query'][_0xb570('0x42')]){_0x2f7463[_0xb570('0x43')]=[{'all':!![]}];}_0x2f7463=_['merge']({},_0x2f7463,_0x5ee6d4[_0xb570('0x41')]);return db[_0xb570('0x2d')][_0xb570('0x47')](_0x2f7463)[_0xb570('0x26')](handleEntityNotFound(_0x4025ef,null))[_0xb570('0x26')](respondWithResult(_0x4025ef,null))['catch'](handleError(_0x4025ef,null));};exports[_0xb570('0x48')]=function(_0xaa1ba0,_0x5753cf){return db[_0xb570('0x2d')][_0xb570('0x48')](_0xaa1ba0[_0xb570('0x49')],{})[_0xb570('0x26')](respondWithResult(_0x5753cf,0xc9))['catch'](handleError(_0x5753cf,null));};exports[_0xb570('0x25')]=function(_0x9fc9c7,_0x5f0a90){if(_0x9fc9c7[_0xb570('0x49')]['id']){delete _0x9fc9c7['body']['id'];}return db['ChatTransferReport'][_0xb570('0x47')]({'where':{'id':_0x9fc9c7[_0xb570('0x4a')]['id']}})[_0xb570('0x26')](handleEntityNotFound(_0x5f0a90,null))[_0xb570('0x26')](saveUpdates(_0x9fc9c7[_0xb570('0x49')],null))['then'](respondWithResult(_0x5f0a90,null))['catch'](handleError(_0x5f0a90,null));};exports[_0xb570('0x27')]=function(_0x2f8902,_0x1ea130){return db[_0xb570('0x2d')]['find']({'where':{'id':_0x2f8902[_0xb570('0x4a')]['id']}})[_0xb570('0x26')](handleEntityNotFound(_0x1ea130,null))[_0xb570('0x26')](removeEntity(_0x1ea130,null))[_0xb570('0x4b')](handleError(_0x1ea130,null));};exports[_0xb570('0x4c')]=function(_0x3e7edf,_0x491b33){return db[_0xb570('0x2d')][_0xb570('0x4c')]()[_0xb570('0x26')](respondWithResult(_0x491b33,null))[_0xb570('0x4b')](handleError(_0x491b33,null));}; \ No newline at end of file +var _0x157e=['query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key'];(function(_0x1c9e28,_0x436dcf){var _0x201d1f=function(_0x5cf9f7){while(--_0x5cf9f7){_0x1c9e28['push'](_0x1c9e28['shift']());}};_0x201d1f(++_0x436dcf);}(_0x157e,0x66));var _0xe157=function(_0x56e80c,_0xd0f2eb){_0x56e80c=_0x56e80c-0x0;var _0x2ece80=_0x157e[_0x56e80c];return _0x2ece80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe157('0x0'));var zipdir=require(_0xe157('0x1'));var jsonpatch=require(_0xe157('0x2'));var rp=require(_0xe157('0x3'));var moment=require(_0xe157('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe157('0x5'));var path=require(_0xe157('0x6'));var sox=require('sox');var csv=require(_0xe157('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe157('0x8'));var _=require(_0xe157('0x9'));var squel=require(_0xe157('0xa'));var crypto=require(_0xe157('0xb'));var jsforce=require(_0xe157('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe157('0x7'));var querystring=require(_0xe157('0xd'));var Papa=require(_0xe157('0xe'));var Redis=require(_0xe157('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe157('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe157('0x11'));var logger=require(_0xe157('0x12'))(_0xe157('0x13'));var utils=require(_0xe157('0x14'));var config=require(_0xe157('0x15'));var licenseUtil=require(_0xe157('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x508fad,_0x108984){_0x108984=_0x108984||0xcc;return function(_0x4a1cad){if(_0x4a1cad){return _0x508fad[_0xe157('0x17')](_0x108984);}return _0x508fad[_0xe157('0x18')](_0x108984)[_0xe157('0x19')]();};}function respondWithResult(_0x1fcef1,_0xe8a55c){_0xe8a55c=_0xe8a55c||0xc8;return function(_0x1e1562){if(_0x1e1562){return _0x1fcef1['status'](_0xe8a55c)[_0xe157('0x1a')](_0x1e1562);}};}function respondWithFilteredResult(_0x56a043,_0x237346){return function(_0x536161){if(_0x536161){var _0x457ac2=typeof _0x237346['offset']===_0xe157('0x1b')&&typeof _0x237346[_0xe157('0x1c')]===_0xe157('0x1b');var _0x5ee816=_0x536161[_0xe157('0x1d')];var _0x596325=_0x457ac2?0x0:_0x237346['offset'];var _0x3d3b6d=_0x457ac2?_0x536161[_0xe157('0x1d')]:_0x237346['offset']+_0x237346['limit'];var _0x11e973;if(_0x3d3b6d>=_0x5ee816){_0x3d3b6d=_0x5ee816;_0x11e973=0xc8;}else{_0x11e973=0xce;}_0x56a043['status'](_0x11e973);return _0x56a043['set'](_0xe157('0x1e'),_0x596325+'-'+_0x3d3b6d+'/'+_0x5ee816)['json'](_0x536161);}return null;};}function patchUpdates(_0x495716){return function(_0x4392cb){try{jsonpatch[_0xe157('0x1f')](_0x4392cb,_0x495716,!![]);}catch(_0x329a91){return BPromise[_0xe157('0x20')](_0x329a91);}return _0x4392cb['save']();};}function saveUpdates(_0x53be75,_0x318774){return function(_0x293bfc){if(_0x293bfc){return _0x293bfc[_0xe157('0x21')](_0x53be75)[_0xe157('0x22')](function(_0x42429b){return _0x42429b;});}return null;};}function removeEntity(_0xae21c7,_0x4e5b50){return function(_0x5a1060){if(_0x5a1060){return _0x5a1060[_0xe157('0x23')]()[_0xe157('0x22')](function(){_0xae21c7[_0xe157('0x18')](0xcc)[_0xe157('0x19')]();});}};}function handleEntityNotFound(_0xf9b7e4,_0x33e4db){return function(_0x5c1a0e){if(!_0x5c1a0e){_0xf9b7e4[_0xe157('0x17')](0x194);}return _0x5c1a0e;};}function handleError(_0x5be602,_0x40f0bc){_0x40f0bc=_0x40f0bc||0x1f4;return function(_0x3431a9){logger[_0xe157('0x24')](_0x3431a9[_0xe157('0x25')]);if(_0x3431a9['name']){delete _0x3431a9[_0xe157('0x26')];}_0x5be602[_0xe157('0x18')](_0x40f0bc)[_0xe157('0x27')](_0x3431a9);};}exports[_0xe157('0x28')]=function(_0x584f28,_0x1f92ed){var _0x22266a={},_0x1a7935={},_0x16a070={'count':0x0,'rows':[]};var _0x5df6e2=_[_0xe157('0x29')](db[_0xe157('0x2a')][_0xe157('0x2b')],function(_0x3f830a){return{'name':_0x3f830a['fieldName'],'type':_0x3f830a[_0xe157('0x2c')][_0xe157('0x2d')]};});_0x1a7935['model']=_['map'](_0x5df6e2,_0xe157('0x26'));_0x1a7935[_0xe157('0x2e')]=_[_0xe157('0x2f')](_0x584f28[_0xe157('0x2e')]);_0x1a7935[_0xe157('0x30')]=_[_0xe157('0x31')](_0x1a7935['model'],_0x1a7935['query']);_0x22266a[_0xe157('0x32')]=_[_0xe157('0x31')](_0x1a7935[_0xe157('0x33')],qs[_0xe157('0x34')](_0x584f28[_0xe157('0x2e')][_0xe157('0x34')]));_0x22266a['attributes']=_0x22266a['attributes']['length']?_0x22266a[_0xe157('0x32')]:_0x1a7935[_0xe157('0x33')];if(!_0x584f28[_0xe157('0x2e')][_0xe157('0x35')](_0xe157('0x36'))){_0x22266a[_0xe157('0x1c')]=qs[_0xe157('0x1c')](_0x584f28['query'][_0xe157('0x1c')]);_0x22266a[_0xe157('0x37')]=qs[_0xe157('0x37')](_0x584f28['query'][_0xe157('0x37')]);}_0x22266a[_0xe157('0x38')]=qs[_0xe157('0x39')](_0x584f28[_0xe157('0x2e')][_0xe157('0x39')]);_0x22266a[_0xe157('0x3a')]=qs[_0xe157('0x30')](_['pick'](_0x584f28[_0xe157('0x2e')],_0x1a7935[_0xe157('0x30')]),_0x5df6e2);if(_0x584f28['query'][_0xe157('0x3b')]){_0x22266a[_0xe157('0x3a')]=_[_0xe157('0x3c')](_0x22266a[_0xe157('0x3a')],{'$or':_[_0xe157('0x29')](_0x5df6e2,function(_0x4f9035){if(_0x4f9035[_0xe157('0x2c')]!==_0xe157('0x3d')){var _0x229e3d={};_0x229e3d[_0x4f9035[_0xe157('0x26')]]={'$like':'%'+_0x584f28[_0xe157('0x2e')][_0xe157('0x3b')]+'%'};return _0x229e3d;}})});}_0x22266a=_[_0xe157('0x3c')]({},_0x22266a,_0x584f28[_0xe157('0x3e')]);var _0x12e9c1={'where':_0x22266a[_0xe157('0x3a')]};return db[_0xe157('0x2a')][_0xe157('0x1d')](_0x12e9c1)[_0xe157('0x22')](function(_0x59c6d5){_0x16a070[_0xe157('0x1d')]=_0x59c6d5;if(_0x584f28[_0xe157('0x2e')][_0xe157('0x3f')]){_0x22266a[_0xe157('0x40')]=[{'all':!![]}];}return db[_0xe157('0x2a')][_0xe157('0x41')](_0x22266a);})[_0xe157('0x22')](function(_0x25eabe){_0x16a070[_0xe157('0x42')]=_0x25eabe;return _0x16a070;})[_0xe157('0x22')](respondWithFilteredResult(_0x1f92ed,_0x22266a))[_0xe157('0x43')](handleError(_0x1f92ed,null));};exports[_0xe157('0x44')]=function(_0x3a2fe4,_0x5d1eac){var _0x313e51={'raw':!![],'where':{'id':_0x3a2fe4['params']['id']}},_0x4bedf6={};_0x4bedf6[_0xe157('0x33')]=_[_0xe157('0x2f')](db[_0xe157('0x2a')][_0xe157('0x2b')]);_0x4bedf6[_0xe157('0x2e')]=_[_0xe157('0x2f')](_0x3a2fe4['query']);_0x4bedf6[_0xe157('0x30')]=_['intersection'](_0x4bedf6[_0xe157('0x33')],_0x4bedf6[_0xe157('0x2e')]);_0x313e51['attributes']=_[_0xe157('0x31')](_0x4bedf6[_0xe157('0x33')],qs[_0xe157('0x34')](_0x3a2fe4[_0xe157('0x2e')][_0xe157('0x34')]));_0x313e51[_0xe157('0x32')]=_0x313e51[_0xe157('0x32')]['length']?_0x313e51[_0xe157('0x32')]:_0x4bedf6[_0xe157('0x33')];if(_0x3a2fe4['query'][_0xe157('0x3f')]){_0x313e51[_0xe157('0x40')]=[{'all':!![]}];}_0x313e51=_[_0xe157('0x3c')]({},_0x313e51,_0x3a2fe4['options']);return db[_0xe157('0x2a')][_0xe157('0x45')](_0x313e51)['then'](handleEntityNotFound(_0x5d1eac,null))[_0xe157('0x22')](respondWithResult(_0x5d1eac,null))[_0xe157('0x43')](handleError(_0x5d1eac,null));};exports[_0xe157('0x46')]=function(_0x566a24,_0x1f962c){return db[_0xe157('0x2a')]['create'](_0x566a24[_0xe157('0x47')],{})['then'](respondWithResult(_0x1f962c,0xc9))[_0xe157('0x43')](handleError(_0x1f962c,null));};exports[_0xe157('0x21')]=function(_0x44d195,_0x10ae28){if(_0x44d195[_0xe157('0x47')]['id']){delete _0x44d195[_0xe157('0x47')]['id'];}return db[_0xe157('0x2a')][_0xe157('0x45')]({'where':{'id':_0x44d195[_0xe157('0x48')]['id']}})[_0xe157('0x22')](handleEntityNotFound(_0x10ae28,null))[_0xe157('0x22')](saveUpdates(_0x44d195[_0xe157('0x47')],null))[_0xe157('0x22')](respondWithResult(_0x10ae28,null))[_0xe157('0x43')](handleError(_0x10ae28,null));};exports[_0xe157('0x23')]=function(_0x44840e,_0x29d44c){return db[_0xe157('0x2a')][_0xe157('0x45')]({'where':{'id':_0x44840e[_0xe157('0x48')]['id']}})[_0xe157('0x22')](handleEntityNotFound(_0x29d44c,null))['then'](removeEntity(_0x29d44c,null))[_0xe157('0x43')](handleError(_0x29d44c,null));};exports[_0xe157('0x49')]=function(_0x4a762e,_0x27fed7){return db[_0xe157('0x2a')][_0xe157('0x49')]()['then'](respondWithResult(_0x27fed7,null))[_0xe157('0x43')](handleError(_0x27fed7,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index e8679ce..6cb720f 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 _0xcbb7=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xcbb7,0x13e));var _0x7cbb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcbb7[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7cbb('0x0'));var util=require(_0x7cbb('0x1'));var logger=require('../../config/logger')(_0x7cbb('0x2'));var moment=require(_0x7cbb('0x3'));var BPromise=require(_0x7cbb('0x4'));var rp=require(_0x7cbb('0x5'));var fs=require('fs');var path=require(_0x7cbb('0x6'));var rimraf=require(_0x7cbb('0x7'));var config=require(_0x7cbb('0x8'));var attributes=require(_0x7cbb('0x9'));module[_0x7cbb('0xa')]=function(_0x261bd7,_0x11a6e3){return _0x261bd7[_0x7cbb('0xb')](_0x7cbb('0xc'),attributes,{'tableName':_0x7cbb('0xd'),'paranoid':![],'indexes':[{'name':_0x7cbb('0xe'),'fields':[_0x7cbb('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ede=['uniqueid','lodash','util','moment','request-promise','path','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x147b6b,_0x23c714){var _0x8da7ac=function(_0x282beb){while(--_0x282beb){_0x147b6b['push'](_0x147b6b['shift']());}};_0x8da7ac(++_0x23c714);}(_0x3ede,0x85));var _0xe3ed=function(_0x1ef547,_0x31bfdb){_0x1ef547=_0x1ef547-0x0;var _0x1d697b=_0x3ede[_0x1ef547];return _0x1d697b;};'use strict';var _=require(_0xe3ed('0x0'));var util=require(_0xe3ed('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe3ed('0x2'));var BPromise=require('bluebird');var rp=require(_0xe3ed('0x3'));var fs=require('fs');var path=require(_0xe3ed('0x4'));var rimraf=require('rimraf');var config=require(_0xe3ed('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0xe3ed('0x6')]=function(_0x1a48da,_0x505ede){return _0x1a48da[_0xe3ed('0x7')](_0xe3ed('0x8'),attributes,{'tableName':_0xe3ed('0x9'),'paranoid':![],'indexes':[{'name':_0xe3ed('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 992fb81..2bdccd8 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 _0x62a6=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x17a481,_0x18800d){var _0x4e1119=function(_0xfc0888){while(--_0xfc0888){_0x17a481['push'](_0x17a481['shift']());}};_0x4e1119(++_0x18800d);}(_0x62a6,0x110));var _0x662a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x62a6[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x662a('0x0'));var util=require(_0x662a('0x1'));var moment=require(_0x662a('0x2'));var BPromise=require(_0x662a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x662a('0x4'));var db=require(_0x662a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x662a('0x6'))(_0x662a('0x7'));var config=require(_0x662a('0x8'));var jayson=require(_0x662a('0x9'));var client=jayson[_0x662a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x210bc4,_0x5607fc,_0x27a8b4){return new BPromise(function(_0x48d803,_0x5a6905){return client[_0x662a('0xb')](_0x210bc4,_0x27a8b4)[_0x662a('0xc')](function(_0x418921){logger[_0x662a('0xd')](_0x662a('0xe'),_0x5607fc,_0x662a('0xf'));logger['debug'](_0x662a('0x10'),_0x5607fc,_0x662a('0xf'),JSON[_0x662a('0x11')](_0x418921));if(_0x418921[_0x662a('0x12')]){if(_0x418921[_0x662a('0x12')][_0x662a('0x13')]===0x1f4){logger['error'](_0x662a('0xe'),_0x5607fc,_0x418921[_0x662a('0x12')][_0x662a('0x14')]);return _0x5a6905(_0x418921[_0x662a('0x12')][_0x662a('0x14')]);}logger[_0x662a('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5607fc,_0x418921[_0x662a('0x12')][_0x662a('0x14')]);return _0x48d803(_0x418921[_0x662a('0x12')]['message']);}else{logger[_0x662a('0xd')](_0x662a('0xe'),_0x5607fc,'request\x20sent');_0x48d803(_0x418921[_0x662a('0x15')][_0x662a('0x14')]);}})[_0x662a('0x16')](function(_0x37ec1a){logger['error'](_0x662a('0xe'),_0x5607fc,_0x37ec1a);_0x5a6905(_0x37ec1a);});});} \ No newline at end of file +var _0xf387=['message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x96f0dd,_0x5b7305){var _0x2b3fd5=function(_0x4b6dc6){while(--_0x4b6dc6){_0x96f0dd['push'](_0x96f0dd['shift']());}};_0x2b3fd5(++_0x5b7305);}(_0xf387,0x154));var _0x7f38=function(_0x13ac6c,_0x41abd0){_0x13ac6c=_0x13ac6c-0x0;var _0x5331ea=_0xf387[_0x13ac6c];return _0x5331ea;};'use strict';var _=require(_0x7f38('0x0'));var util=require(_0x7f38('0x1'));var moment=require(_0x7f38('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f38('0x3'));var fs=require('fs');var Redis=require(_0x7f38('0x4'));var db=require(_0x7f38('0x5'))['db'];var utils=require(_0x7f38('0x6'));var logger=require(_0x7f38('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7f38('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x207b3f,_0x25ecdd,_0x33ea1d){return new BPromise(function(_0x2caab6,_0x2cec7f){return client['request'](_0x207b3f,_0x33ea1d)[_0x7f38('0x9')](function(_0x18e089){logger[_0x7f38('0xa')](_0x7f38('0xb'),_0x25ecdd,'request\x20sent');logger[_0x7f38('0xc')](_0x7f38('0xd'),_0x25ecdd,'request\x20sent',JSON[_0x7f38('0xe')](_0x18e089));if(_0x18e089[_0x7f38('0xf')]){if(_0x18e089[_0x7f38('0xf')][_0x7f38('0x10')]===0x1f4){logger[_0x7f38('0xf')](_0x7f38('0xb'),_0x25ecdd,_0x18e089['error'][_0x7f38('0x11')]);return _0x2cec7f(_0x18e089['error'][_0x7f38('0x11')]);}logger['error'](_0x7f38('0xb'),_0x25ecdd,_0x18e089[_0x7f38('0xf')]['message']);return _0x2caab6(_0x18e089['error']['message']);}else{logger[_0x7f38('0xa')](_0x7f38('0xb'),_0x25ecdd,_0x7f38('0x12'));_0x2caab6(_0x18e089[_0x7f38('0x13')][_0x7f38('0x11')]);}})[_0x7f38('0x14')](function(_0x33adb4){logger[_0x7f38('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x25ecdd,_0x33adb4);_0x2cec7f(_0x33adb4);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index fc2697c..a1a89b2 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 _0x83f6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','delete','destroy','exports','util','path'];(function(_0x3fefea,_0x4dca2e){var _0x395543=function(_0x4396bc){while(--_0x4396bc){_0x3fefea['push'](_0x3fefea['shift']());}};_0x395543(++_0x4dca2e);}(_0x83f6,0x7c));var _0x683f=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x83f6[_0x424a9a];return _0xa7831c;};'use strict';var multer=require('multer');var util=require(_0x683f('0x0'));var path=require(_0x683f('0x1'));var timeout=require(_0x683f('0x2'));var express=require(_0x683f('0x3'));var router=express[_0x683f('0x4')]();var fs_extra=require(_0x683f('0x5'));var auth=require(_0x683f('0x6'));var interaction=require(_0x683f('0x7'));var config=require(_0x683f('0x8'));var controller=require(_0x683f('0x9'));router[_0x683f('0xa')]('/',auth[_0x683f('0xb')](),controller[_0x683f('0xc')]);router[_0x683f('0xa')](_0x683f('0xd'),auth[_0x683f('0xb')](),controller[_0x683f('0xe')]);router[_0x683f('0xa')](_0x683f('0xf'),auth[_0x683f('0xb')](),controller['show']);router['post']('/',auth[_0x683f('0xb')](),controller[_0x683f('0x10')]);router[_0x683f('0x11')](_0x683f('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x683f('0x12')]('/:id',auth[_0x683f('0xb')](),controller[_0x683f('0x13')]);module[_0x683f('0x14')]=router; \ No newline at end of file +var _0x11e7=['delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11e7,0x86));var _0x711e=function(_0x40ce27,_0x27c747){_0x40ce27=_0x40ce27-0x0;var _0xf54b4b=_0x11e7[_0x40ce27];return _0xf54b4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x711e('0x0'));var timeout=require(_0x711e('0x1'));var express=require(_0x711e('0x2'));var router=express[_0x711e('0x3')]();var fs_extra=require(_0x711e('0x4'));var auth=require(_0x711e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x711e('0x6'));var controller=require(_0x711e('0x7'));router[_0x711e('0x8')]('/',auth[_0x711e('0x9')](),controller[_0x711e('0xa')]);router[_0x711e('0x8')](_0x711e('0xb'),auth[_0x711e('0x9')](),controller[_0x711e('0xc')]);router[_0x711e('0x8')](_0x711e('0xd'),auth[_0x711e('0x9')](),controller['show']);router[_0x711e('0xe')]('/',auth[_0x711e('0x9')](),controller[_0x711e('0xf')]);router[_0x711e('0x10')](_0x711e('0xd'),auth[_0x711e('0x9')](),controller[_0x711e('0x11')]);router[_0x711e('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);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 4cabaa8..c0a0cf8 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 _0x2d77=['parse','setDataValue','Comments','Leave\x20your\x20comments','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','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','TEXT','stringify','name','input','getDataValue','onlineForm'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2d77,0x1b3));var _0x72d7=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x2d77[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0x72d7('0x0'));var rs=require(_0x72d7('0x1'));module[_0x72d7('0x2')]={'name':{'type':Sequelize[_0x72d7('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x72d7('0x4')},'description':{'type':Sequelize[_0x72d7('0x3')]},'mapKey':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x72d7('0x5')},'key':{'type':Sequelize[_0x72d7('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x6')},'customerAlias':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x72d7('0x3')],'allowNull':![],'defaultValue':_0x72d7('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x72d7('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x72d7('0x3')],'allowNull':![],'defaultValue':_0x72d7('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x72d7('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x72d7('0x3')]},'animation':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x72d7('0xb'),_0x72d7('0xc')),'defaultValue':_0x72d7('0xb')},'header_online':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0xd')},'start_chat_button':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0xe')},'header_offline':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0xf')},'download_transcript':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x72d7('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x72d7('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x13')},'noteTitle':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x14')},'placeholderMessage':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x15')},'closingMessage':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x16')},'closingMessageButton':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0xe')},'skipMessageButton':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x17')},'conditionAgreement':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x72d7('0x18')](_0x72d7('0x19'),_0x72d7('0x1a')),'defaultValue':_0x72d7('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x72d7('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x72d7('0x1b')],'defaultValue':function(){return JSON[_0x72d7('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x72d7('0x1d'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x72d7('0x1e'),'props':{'title':_0x72d7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x72d7('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x72d7('0x1f')](_0x72d7('0x20'))?JSON[_0x72d7('0x21')](this['getDataValue']('onlineForm')):{};},'set':function(_0x1a68b6){return this[_0x72d7('0x22')](_0x72d7('0x20'),JSON[_0x72d7('0x1c')](_0x1a68b6));}},'offlineForm':{'type':Sequelize[_0x72d7('0x1b')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x72d7('0x1e'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x72d7('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x72d7('0x23'),'helpText':_0x72d7('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x72d7('0x1f')](_0x72d7('0x25'))?JSON[_0x72d7('0x21')](this[_0x72d7('0x1f')](_0x72d7('0x25'))):{};},'set':function(_0x4fdd02){return this[_0x72d7('0x22')]('offlineForm',JSON[_0x72d7('0x1c')](_0x4fdd02));}},'token':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':function(){return rs[_0x72d7('0x26')]();}},'autoclose':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x72d7('0x3')]},'forwardOffline':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x72d7('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x72d7('0x27')},'waitingMessage':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x29')},'offlineMessageBody':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x17')},'sendUnmanaged':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x72d7('0x1b')]},'showAgentAvatar':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x72d7('0x1b')],'defaultValue':function(){return _0x72d7('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x72d7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':_0x72d7('0x2e')},'defaultTitle':{'type':Sequelize[_0x72d7('0x3')]},'customerAvatar':{'type':Sequelize[_0x72d7('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x72d7('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x72d7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x72d7('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x72d7('0x9')],'comment':_0x72d7('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x72d7('0x31'),'set':function(_0x319ad2){if(!_0x319ad2)this[_0x72d7('0x22')]('mandatoryDispositionPauseId',null);this[_0x72d7('0x22')](_0x72d7('0x32'),_0x319ad2);}},'vidaooEscalation':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x72d7('0x3')]},'vidaooTopic':{'type':Sequelize[_0x72d7('0x3')],'allowNull':![],'defaultValue':_0x72d7('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x72d7('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x72d7('0x1b')]}}; \ No newline at end of file +var _0xbd39=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Note','Send','Feedback','thumb','name','text','input','onlineForm','parse','getDataValue','stringify','textarea','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System'];(function(_0x31a783,_0x211d45){var _0x24ff25=function(_0x649d79){while(--_0x649d79){_0x31a783['push'](_0x31a783['shift']());}};_0x24ff25(++_0x211d45);}(_0xbd39,0xea));var _0x9bd3=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xbd39[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0x9bd3('0x0'));var rs=require(_0x9bd3('0x1'));module['exports']={'name':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'unique':_0x9bd3('0x3')},'description':{'type':Sequelize[_0x9bd3('0x2')]},'mapKey':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x4')},'key':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x5')},'customerAlias':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'defaultValue':_0x9bd3('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'defaultValue':_0x9bd3('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'defaultValue':_0x9bd3('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9bd3('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9bd3('0x2')]},'animation':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9bd3('0xa')](_0x9bd3('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0xc')},'start_chat_button':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0xe')},'download_transcript':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9bd3('0xf')]},'closingQuestion':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x11')},'skipMessageButton':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x12')},'ratingType':{'type':Sequelize[_0x9bd3('0xa')]('star',_0x9bd3('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x9bd3('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9bd3('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x9bd3('0x14'),'type':_0x9bd3('0x15'),'required':!![]},'props':{'title':_0x9bd3('0x14'),'helpText':''}},{'type':_0x9bd3('0x16'),'props':{'title':_0x9bd3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9bd3('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x9bd3('0x17'))?JSON[_0x9bd3('0x18')](this[_0x9bd3('0x19')]('onlineForm')):{};},'set':function(_0x1ada2a){return this['setDataValue'](_0x9bd3('0x17'),JSON['stringify'](_0x1ada2a));}},'offlineForm':{'type':Sequelize[_0x9bd3('0xf')],'defaultValue':function(){return JSON[_0x9bd3('0x1a')]({'items':[{'type':'input','props':{'title':_0x9bd3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9bd3('0x4'),'type':_0x9bd3('0x4')},'variable':null},{'type':_0x9bd3('0x1b'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x9bd3('0x1c')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x9bd3('0x1d'))?JSON['parse'](this[_0x9bd3('0x19')]('offlineForm')):{};},'set':function(_0x39a914){return this[_0x9bd3('0x1e')]('offlineForm',JSON[_0x9bd3('0x1a')](_0x39a914));}},'token':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':function(){return rs[_0x9bd3('0x1f')]();}},'autoclose':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9bd3('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9bd3('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x20')},'waitingMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x21')},'offlineMessageSubject':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x22')},'offlineMessageBody':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x11')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9bd3('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9bd3('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9bd3('0xf')],'defaultValue':function(){return _0x9bd3('0x24');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9bd3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x26')},'verticalAlignment':{'type':Sequelize[_0x9bd3('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x27')},'defaultTitle':{'type':Sequelize[_0x9bd3('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'defaultValue':_0x9bd3('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9bd3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9bd3('0x2a'),'set':function(_0x4a8733){if(!_0x4a8733)this[_0x9bd3('0x1e')](_0x9bd3('0x2b'),null);this[_0x9bd3('0x1e')](_0x9bd3('0x2c'),_0x4a8733);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9bd3('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':function(){return _0x9bd3('0x2d');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9bd3('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 9dccb0e..9413a94 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 _0x1909=['file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','custom','sitepic','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','ChatApplication','Applications','account','applications','list','List','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','push','close','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','originalname','subjectOffline','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','server/files/chat/iframe.ejs','connection','remoteAddress','verticalAlignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers'];(function(_0x3fd828,_0x49944e){var _0x37fd39=function(_0x5984fc){while(--_0x5984fc){_0x3fd828['push'](_0x3fd828['shift']());}};_0x37fd39(++_0x49944e);}(_0x1909,0x1e3));var _0x9190=function(_0x4322db,_0x540acf){_0x4322db=_0x4322db-0x0;var _0x449a5a=_0x1909[_0x4322db];return _0x449a5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9190('0x0'));var zipdir=require(_0x9190('0x1'));var jsonpatch=require(_0x9190('0x2'));var rp=require(_0x9190('0x3'));var moment=require(_0x9190('0x4'));var BPromise=require(_0x9190('0x5'));var Mustache=require(_0x9190('0x6'));var util=require(_0x9190('0x7'));var path=require(_0x9190('0x8'));var sox=require(_0x9190('0x9'));var csv=require(_0x9190('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9190('0xb'));var _=require(_0x9190('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9190('0xd'));var deskjs=require(_0x9190('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9190('0xf'));var Papa=require('papaparse');var Redis=require(_0x9190('0x10'));var authService=require(_0x9190('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9190('0x12'));var hardwareService=require(_0x9190('0x13'));var logger=require(_0x9190('0x14'))('api');var utils=require(_0x9190('0x15'));var config=require(_0x9190('0x16'));var licenseUtil=require(_0x9190('0x17'));var db=require(_0x9190('0x18'))['db'];config[_0x9190('0x19')]=_[_0x9190('0x1a')](config[_0x9190('0x19')],{'host':_0x9190('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9190('0x19')]));require('./chatWebsite.socket')[_0x9190('0x1c')](socket);var jayson=require(_0x9190('0x1d'));var client=jayson[_0x9190('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x9190('0x1e')][_0x9190('0x1f')]({'port':0x232a});var client9003=jayson[_0x9190('0x1e')][_0x9190('0x1f')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x193b13,_0x257dab,_0x337dc5,_0x2c48d9){return new BPromise(function(_0x4d3ebb,_0x4dbca5){var _0xe8ee7b=_0x2c48d9||client;return _0xe8ee7b[_0x9190('0x20')](_0x193b13,_0x337dc5)[_0x9190('0x21')](function(_0x2ec7ba){logger[_0x9190('0x22')](_0x9190('0x23'),_0x257dab,_0x9190('0x24'));logger[_0x9190('0x25')](_0x9190('0x26'),_0x257dab,_0x9190('0x24'),JSON[_0x9190('0x27')](_0x2ec7ba));if(_0x2ec7ba[_0x9190('0x28')]){if(_0x2ec7ba['error'][_0x9190('0x29')]===0x1f4){logger['error'](_0x9190('0x23'),_0x257dab,_0x2ec7ba[_0x9190('0x28')]['message']);return _0x4dbca5(_0x2ec7ba[_0x9190('0x28')][_0x9190('0x2a')]);}logger['error'](_0x9190('0x23'),_0x257dab,_0x2ec7ba[_0x9190('0x28')][_0x9190('0x2a')]);return _0x4d3ebb(_0x2ec7ba[_0x9190('0x28')]['message']);}else{logger[_0x9190('0x22')](_0x9190('0x23'),_0x257dab,'request\x20sent');_0x4d3ebb(_0x2ec7ba['result'][_0x9190('0x2a')]);}})[_0x9190('0x2b')](function(_0x27a47e){logger[_0x9190('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x257dab,_0x27a47e);_0x4dbca5(_0x27a47e);});});}function respondWithStatusCode(_0x445241,_0x27129e){_0x27129e=_0x27129e||0xcc;return function(_0x266de7){if(_0x266de7){return _0x445241[_0x9190('0x2c')](_0x27129e);}return _0x445241[_0x9190('0x2d')](_0x27129e)[_0x9190('0x2e')]();};}function respondWithResult(_0x252b5e,_0x53ff26){_0x53ff26=_0x53ff26||0xc8;return function(_0x314035){if(_0x314035){return _0x252b5e['status'](_0x53ff26)[_0x9190('0x2f')](_0x314035);}};}function respondWithFilteredResult(_0x31a35c,_0x3f88bd){return function(_0x2495da){if(_0x2495da){var _0x34edc4=typeof _0x3f88bd[_0x9190('0x30')]===_0x9190('0x31')&&typeof _0x3f88bd[_0x9190('0x32')]===_0x9190('0x31');var _0x1a1be7=_0x2495da[_0x9190('0x33')];var _0x3222b0=_0x34edc4?0x0:_0x3f88bd[_0x9190('0x30')];var _0x164d05=_0x34edc4?_0x2495da[_0x9190('0x33')]:_0x3f88bd[_0x9190('0x30')]+_0x3f88bd[_0x9190('0x32')];var _0x3d265b;if(_0x164d05>=_0x1a1be7){_0x164d05=_0x1a1be7;_0x3d265b=0xc8;}else{_0x3d265b=0xce;}_0x31a35c[_0x9190('0x2d')](_0x3d265b);return _0x31a35c['set']('Content-Range',_0x3222b0+'-'+_0x164d05+'/'+_0x1a1be7)['json'](_0x2495da);}return null;};}function patchUpdates(_0x5812a6){return function(_0x4ad30e){try{jsonpatch[_0x9190('0x34')](_0x4ad30e,_0x5812a6,!![]);}catch(_0x344ea5){return BPromise[_0x9190('0x35')](_0x344ea5);}return _0x4ad30e[_0x9190('0x36')]();};}function saveUpdates(_0x894d2f,_0x1dfc5f){return function(_0x3eea72){if(_0x3eea72){return _0x3eea72[_0x9190('0x37')](_0x894d2f)[_0x9190('0x21')](function(_0x4f3f4a){return _0x4f3f4a;});}return null;};}function removeEntity(_0x30e493,_0x2984ac){return function(_0x45deb0){if(_0x45deb0){return _0x45deb0[_0x9190('0x38')]()[_0x9190('0x21')](function(){var _0x285a1b=_0x45deb0[_0x9190('0x39')]({'plain':!![]});var _0x3f4aba='ChatWebsites';return db[_0x9190('0x3a')]['destroy']({'where':{'type':_0x3f4aba,'resourceId':_0x285a1b['id']}})[_0x9190('0x21')](function(){return _0x45deb0;});})[_0x9190('0x21')](function(){_0x30e493['status'](0xcc)[_0x9190('0x2e')]();});}};}function handleEntityNotFound(_0xb78350,_0x16dbb5){return function(_0x5722e5){if(!_0x5722e5){_0xb78350['sendStatus'](0x194);}return _0x5722e5;};}function handleError(_0x3527e6,_0x50ed06){_0x50ed06=_0x50ed06||0x1f4;return function(_0x27a3e0){logger[_0x9190('0x28')](_0x27a3e0[_0x9190('0x3b')]);if(_0x27a3e0[_0x9190('0x3c')]){delete _0x27a3e0[_0x9190('0x3c')];}_0x3527e6[_0x9190('0x2d')](_0x50ed06)[_0x9190('0x3d')](_0x27a3e0);};}exports['index']=function(_0x1c398f,_0x1cb19c){var _0x1d300a={'include':[{'model':db[_0x9190('0x3e')],'as':_0x9190('0x3f')}]},_0x550c73={},_0x286a59={'count':0x0,'rows':[]};var _0x327a32=_['map'](db[_0x9190('0x40')][_0x9190('0x41')],function(_0x10f42b){return{'name':_0x10f42b[_0x9190('0x42')],'type':_0x10f42b[_0x9190('0x43')]['key']};});_0x550c73[_0x9190('0x44')]=_[_0x9190('0x45')](_0x327a32,_0x9190('0x3c'));_0x550c73[_0x9190('0x46')]=_[_0x9190('0x47')](_0x1c398f[_0x9190('0x46')]);_0x550c73[_0x9190('0x48')]=_['intersection'](_0x550c73[_0x9190('0x44')],_0x550c73[_0x9190('0x46')]);_0x1d300a[_0x9190('0x49')]=_[_0x9190('0x4a')](_0x550c73[_0x9190('0x44')],qs['fields'](_0x1c398f[_0x9190('0x46')][_0x9190('0x4b')]));_0x1d300a['attributes']=_0x1d300a['attributes'][_0x9190('0x4c')]?_0x1d300a[_0x9190('0x49')]:_0x550c73[_0x9190('0x44')];if(!_0x1c398f[_0x9190('0x46')][_0x9190('0x4d')](_0x9190('0x4e'))){_0x1d300a['limit']=qs['limit'](_0x1c398f['query'][_0x9190('0x32')]);_0x1d300a[_0x9190('0x30')]=qs[_0x9190('0x30')](_0x1c398f[_0x9190('0x46')][_0x9190('0x30')]);}_0x1d300a[_0x9190('0x4f')]=qs['sort'](_0x1c398f[_0x9190('0x46')][_0x9190('0x50')]);_0x1d300a[_0x9190('0x51')]=qs['filters'](_['pick'](_0x1c398f['query'],_0x550c73['filters']),_0x327a32);if(_0x1c398f[_0x9190('0x46')][_0x9190('0x52')]){_0x1d300a[_0x9190('0x51')]=_['merge'](_0x1d300a['where'],{'$or':_[_0x9190('0x45')](_0x327a32,function(_0xc69b19){if(_0xc69b19['type']!=='VIRTUAL'){var _0x5f5c06={};_0x5f5c06[_0xc69b19[_0x9190('0x3c')]]={'$like':'%'+_0x1c398f[_0x9190('0x46')][_0x9190('0x52')]+'%'};return _0x5f5c06;}})});}_0x1d300a=_[_0x9190('0x53')]({},_0x1d300a,_0x1c398f[_0x9190('0x54')]);var _0x2db5c7={'where':_0x1d300a[_0x9190('0x51')]};return db[_0x9190('0x40')][_0x9190('0x33')](_0x2db5c7)['then'](function(_0x131a8b){_0x286a59['count']=_0x131a8b;if(_0x1c398f[_0x9190('0x46')][_0x9190('0x55')]){_0x1d300a[_0x9190('0x56')]=[{'all':!![]}];}return db[_0x9190('0x40')]['findAll'](_0x1d300a);})[_0x9190('0x21')](function(_0x785e50){_0x286a59[_0x9190('0x57')]=_0x785e50;return _0x286a59;})[_0x9190('0x21')](respondWithFilteredResult(_0x1cb19c,_0x1d300a))['catch'](handleError(_0x1cb19c,null));};exports[_0x9190('0x58')]=function(_0x2fe4dd,_0x426ea7){var _0x42d0fc={'raw':![],'where':{'id':_0x2fe4dd[_0x9190('0x59')]['id']},'include':[{'model':db[_0x9190('0x3e')],'as':_0x9190('0x3f')}]},_0xecddd8={};_0xecddd8[_0x9190('0x44')]=_[_0x9190('0x47')](db[_0x9190('0x40')][_0x9190('0x41')]);_0xecddd8[_0x9190('0x46')]=_['keys'](_0x2fe4dd[_0x9190('0x46')]);_0xecddd8[_0x9190('0x48')]=_[_0x9190('0x4a')](_0xecddd8['model'],_0xecddd8[_0x9190('0x46')]);_0x42d0fc[_0x9190('0x49')]=_[_0x9190('0x4a')](_0xecddd8[_0x9190('0x44')],qs[_0x9190('0x4b')](_0x2fe4dd['query'][_0x9190('0x4b')]));_0x42d0fc[_0x9190('0x49')]=_0x42d0fc[_0x9190('0x49')][_0x9190('0x4c')]?_0x42d0fc[_0x9190('0x49')]:_0xecddd8['model'];if(_0x2fe4dd[_0x9190('0x46')][_0x9190('0x55')]){_0x42d0fc[_0x9190('0x56')]=[{'all':!![]}];}_0x42d0fc=_[_0x9190('0x53')]({},_0x42d0fc,_0x2fe4dd['options']);return db[_0x9190('0x40')][_0x9190('0x5a')](_0x42d0fc)[_0x9190('0x21')](handleEntityNotFound(_0x426ea7,null))[_0x9190('0x21')](respondWithResult(_0x426ea7,null))['catch'](handleError(_0x426ea7,null));};exports[_0x9190('0x5b')]=function(_0x43c990,_0x1fa238){return db[_0x9190('0x40')][_0x9190('0x5b')](_0x43c990[_0x9190('0x5c')],{})[_0x9190('0x21')](function(_0x37058a){var _0x5f068a=_0x43c990[_0x9190('0x5d')][_0x9190('0x39')]({'plain':!![]});if(!_0x5f068a)throw new Error(_0x9190('0x5e'));if(_0x5f068a['role']==='user'){var _0x32945c=_0x37058a[_0x9190('0x39')]({'plain':!![]});var _0xa6fbac='ChatWebsites';return db['UserProfileSection'][_0x9190('0x5a')]({'where':{'name':_0xa6fbac,'userProfileId':_0x5f068a[_0x9190('0x5f')]},'raw':!![]})[_0x9190('0x21')](function(_0x247b08){if(_0x247b08&&_0x247b08[_0x9190('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x32945c[_0x9190('0x3c')],'resourceId':_0x32945c['id'],'type':_0x247b08[_0x9190('0x3c')],'sectionId':_0x247b08['id']},{})[_0x9190('0x21')](function(){return _0x37058a;});}else{return _0x37058a;}})[_0x9190('0x2b')](function(_0x197f09){logger[_0x9190('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x197f09);throw _0x197f09;});}return _0x37058a;})[_0x9190('0x21')](respondWithResult(_0x1fa238,0xc9))[_0x9190('0x2b')](handleError(_0x1fa238,null));};exports[_0x9190('0x37')]=function(_0x23ef14,_0x4f0ad5){if(_0x23ef14[_0x9190('0x5c')]['id']){delete _0x23ef14['body']['id'];}return db['ChatWebsite'][_0x9190('0x5a')]({'where':{'id':_0x23ef14[_0x9190('0x59')]['id']},'include':[{'model':db[_0x9190('0x3e')],'as':_0x9190('0x3f')}]})[_0x9190('0x21')](handleEntityNotFound(_0x4f0ad5,null))[_0x9190('0x21')](saveUpdates(_0x23ef14[_0x9190('0x5c')],null))[_0x9190('0x21')](respondWithResult(_0x4f0ad5,null))['catch'](handleError(_0x4f0ad5,null));};exports[_0x9190('0x38')]=function(_0x13e8a0,_0x5aa0f4){return db['ChatWebsite'][_0x9190('0x5a')]({'where':{'id':_0x13e8a0[_0x9190('0x59')]['id']}})['then'](handleEntityNotFound(_0x5aa0f4,null))[_0x9190('0x21')](removeEntity(_0x5aa0f4,null))['catch'](handleError(_0x5aa0f4,null));};exports[_0x9190('0x61')]=function(_0x44fd14,_0x4c59ef){return db[_0x9190('0x40')][_0x9190('0x61')]()[_0x9190('0x21')](respondWithResult(_0x4c59ef,null))[_0x9190('0x2b')](handleError(_0x4c59ef,null));};exports[_0x9190('0x62')]=function(_0x250876,_0xd97549,_0xd570c8){if(_0x250876[_0x9190('0x5c')]['id']){delete _0x250876['body']['id'];}return db[_0x9190('0x40')][_0x9190('0x5a')]({'where':{'id':_0x250876['params']['id']}})[_0x9190('0x21')](handleEntityNotFound(_0xd97549,null))[_0x9190('0x21')](function(_0x3d395b){if(_0x3d395b){_0x250876[_0x9190('0x5c')][_0x9190('0x63')]=_0x3d395b['id'];return db['Disposition'][_0x9190('0x5b')](_0x250876[_0x9190('0x5c')]);}})[_0x9190('0x21')](respondWithResult(_0xd97549,null))[_0x9190('0x2b')](handleError(_0xd97549,null));};exports[_0x9190('0x64')]=function(_0x64ec85,_0x395bb0,_0x525faa){var _0x2eaf93={'raw':![],'where':{}};var _0x3fcccd={};var _0x12b303={'count':0x0,'rows':[]};return db[_0x9190('0x40')][_0x9190('0x65')]({'where':{'id':_0x64ec85[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x395bb0,null))[_0x9190('0x21')](function(_0x5b3b04){if(_0x5b3b04){_0x3fcccd[_0x9190('0x44')]=_[_0x9190('0x47')](db[_0x9190('0x66')][_0x9190('0x41')]);_0x3fcccd[_0x9190('0x46')]=_[_0x9190('0x47')](_0x64ec85[_0x9190('0x46')]);_0x3fcccd[_0x9190('0x48')]=_[_0x9190('0x4a')](_0x3fcccd[_0x9190('0x44')],_0x3fcccd[_0x9190('0x46')]);_0x2eaf93[_0x9190('0x49')]=_[_0x9190('0x4a')](_0x3fcccd[_0x9190('0x44')],qs['fields'](_0x64ec85[_0x9190('0x46')]['fields']));_0x2eaf93[_0x9190('0x49')]=_0x2eaf93[_0x9190('0x49')][_0x9190('0x4c')]?_0x2eaf93[_0x9190('0x49')]:_0x3fcccd[_0x9190('0x44')];if(!_0x64ec85[_0x9190('0x46')][_0x9190('0x4d')](_0x9190('0x4e'))){_0x2eaf93[_0x9190('0x32')]=qs['limit'](_0x64ec85['query']['limit']);_0x2eaf93['offset']=qs[_0x9190('0x30')](_0x64ec85[_0x9190('0x46')][_0x9190('0x30')]);}_0x2eaf93[_0x9190('0x4f')]=qs['sort'](_0x64ec85[_0x9190('0x46')]['sort']);_0x2eaf93['where']=qs[_0x9190('0x48')](_[_0x9190('0x67')](_0x64ec85[_0x9190('0x46')],_0x3fcccd[_0x9190('0x48')]));_0x2eaf93[_0x9190('0x51')][_0x9190('0x63')]=_0x5b3b04['id'];if(_0x64ec85[_0x9190('0x46')][_0x9190('0x52')]){_0x2eaf93['where']=_[_0x9190('0x53')](_0x2eaf93['where'],{'$or':_['map'](_0x2eaf93[_0x9190('0x49')],function(_0x3e92f3){var _0x6fae47={};_0x6fae47[_0x3e92f3]={'$like':'%'+_0x64ec85[_0x9190('0x46')][_0x9190('0x52')]+'%'};return _0x6fae47;})});}_0x2eaf93=_['merge']({},_0x2eaf93,_0x64ec85[_0x9190('0x54')]);return db[_0x9190('0x66')][_0x9190('0x33')]({'where':_0x2eaf93[_0x9190('0x51')]})[_0x9190('0x21')](function(_0x18f4bb){_0x12b303[_0x9190('0x33')]=_0x18f4bb;if(_0x64ec85[_0x9190('0x46')][_0x9190('0x55')]){_0x2eaf93[_0x9190('0x56')]=[{'all':!![]}];}return db[_0x9190('0x66')][_0x9190('0x68')](_0x2eaf93);})[_0x9190('0x21')](function(_0x467096){_0x12b303['rows']=_0x467096;return _0x12b303;});}})['then'](respondWithFilteredResult(_0x395bb0,_0x2eaf93))[_0x9190('0x2b')](handleError(_0x395bb0,null));};exports[_0x9190('0x69')]=function(_0x13d9d2,_0x1ea197,_0x203a64){return db[_0x9190('0x40')]['find']({'where':{'id':_0x13d9d2[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x1ea197,null))[_0x9190('0x21')](function(_0x1049e6){if(_0x1049e6){return _0x1049e6[_0x9190('0x69')](_0x13d9d2[_0x9190('0x46')][_0x9190('0x6a')]);}})[_0x9190('0x21')](respondWithStatusCode(_0x1ea197,null))['catch'](handleError(_0x1ea197,null));};exports[_0x9190('0x6b')]=function(_0x306ce2,_0x1e4c23,_0x248596){if(_0x306ce2[_0x9190('0x5c')]['id']){delete _0x306ce2[_0x9190('0x5c')]['id'];}return db[_0x9190('0x40')][_0x9190('0x5a')]({'where':{'id':_0x306ce2['params']['id']}})['then'](handleEntityNotFound(_0x1e4c23,null))[_0x9190('0x21')](function(_0x256e0e){if(_0x256e0e){_0x306ce2[_0x9190('0x5c')]['ChatWebsiteId']=_0x256e0e['id'];return db[_0x9190('0x6c')][_0x9190('0x5b')](_0x306ce2['body']);}})[_0x9190('0x21')](respondWithResult(_0x1e4c23,null))[_0x9190('0x2b')](handleError(_0x1e4c23,null));};exports[_0x9190('0x6d')]=function(_0x1ddb19,_0x454ef3,_0x48458f){var _0x3161c2={'raw':![],'where':{}};var _0xded231={};var _0x818b8a={'count':0x0,'rows':[]};return db[_0x9190('0x40')][_0x9190('0x65')]({'where':{'id':_0x1ddb19[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x454ef3,null))[_0x9190('0x21')](function(_0x3d0901){if(_0x3d0901){_0xded231[_0x9190('0x44')]=_[_0x9190('0x47')](db[_0x9190('0x6c')]['rawAttributes']);_0xded231[_0x9190('0x46')]=_[_0x9190('0x47')](_0x1ddb19[_0x9190('0x46')]);_0xded231[_0x9190('0x48')]=_[_0x9190('0x4a')](_0xded231[_0x9190('0x44')],_0xded231[_0x9190('0x46')]);_0x3161c2[_0x9190('0x49')]=_[_0x9190('0x4a')](_0xded231[_0x9190('0x44')],qs[_0x9190('0x4b')](_0x1ddb19['query']['fields']));_0x3161c2[_0x9190('0x49')]=_0x3161c2[_0x9190('0x49')]['length']?_0x3161c2[_0x9190('0x49')]:_0xded231['model'];if(!_0x1ddb19[_0x9190('0x46')][_0x9190('0x4d')](_0x9190('0x4e'))){_0x3161c2['limit']=qs['limit'](_0x1ddb19[_0x9190('0x46')][_0x9190('0x32')]);_0x3161c2[_0x9190('0x30')]=qs[_0x9190('0x30')](_0x1ddb19[_0x9190('0x46')]['offset']);}_0x3161c2[_0x9190('0x4f')]=qs[_0x9190('0x50')](_0x1ddb19['query'][_0x9190('0x50')]);_0x3161c2[_0x9190('0x51')]=qs[_0x9190('0x48')](_['pick'](_0x1ddb19[_0x9190('0x46')],_0xded231[_0x9190('0x48')]));_0x3161c2[_0x9190('0x51')][_0x9190('0x63')]=_0x3d0901['id'];if(_0x1ddb19[_0x9190('0x46')][_0x9190('0x52')]){_0x3161c2[_0x9190('0x51')]=_['merge'](_0x3161c2[_0x9190('0x51')],{'$or':_['map'](_0x3161c2[_0x9190('0x49')],function(_0x562772){var _0x509421={};_0x509421[_0x562772]={'$like':'%'+_0x1ddb19[_0x9190('0x46')][_0x9190('0x52')]+'%'};return _0x509421;})});}_0x3161c2=_[_0x9190('0x53')]({},_0x3161c2,_0x1ddb19['options']);return db[_0x9190('0x6c')]['count']({'where':_0x3161c2[_0x9190('0x51')]})[_0x9190('0x21')](function(_0x2f07a3){_0x818b8a[_0x9190('0x33')]=_0x2f07a3;if(_0x1ddb19['query'][_0x9190('0x55')]){_0x3161c2[_0x9190('0x56')]=[{'all':!![]}];}return db[_0x9190('0x6c')][_0x9190('0x68')](_0x3161c2);})[_0x9190('0x21')](function(_0x417cab){_0x818b8a[_0x9190('0x57')]=_0x417cab;return _0x818b8a;});}})[_0x9190('0x21')](respondWithFilteredResult(_0x454ef3,_0x3161c2))[_0x9190('0x2b')](handleError(_0x454ef3,null));};exports[_0x9190('0x6e')]=function(_0x3b28c8,_0x580659,_0x56aa2f){return db['ChatWebsite']['find']({'where':{'id':_0x3b28c8['params']['id']}})['then'](handleEntityNotFound(_0x580659,null))['then'](function(_0x118273){if(_0x118273){return _0x118273[_0x9190('0x6e')](_0x3b28c8[_0x9190('0x46')][_0x9190('0x6a')]);}})['then'](respondWithStatusCode(_0x580659,null))[_0x9190('0x2b')](handleError(_0x580659,null));};exports['addLogo']=function(_0x34ac16,_0xc38473,_0x17805e){_0x34ac16[_0x9190('0x5c')]['sitepic']=_0x34ac16[_0x9190('0x6f')][_0x9190('0x70')];return db[_0x9190('0x40')][_0x9190('0x5a')]({'where':{'id':_0x34ac16[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0xc38473,null))[_0x9190('0x21')](saveUpdates(_0x34ac16[_0x9190('0x5c')],null))[_0x9190('0x21')](respondWithResult(_0xc38473,null))[_0x9190('0x2b')](handleError(_0xc38473,null));};exports[_0x9190('0x71')]=function(_0x4e76fb,_0x258862,_0x123a56){_0x4e76fb[_0x9190('0x5c')]['agentAvatar']=_0x4e76fb[_0x9190('0x6f')][_0x9190('0x70')];return db[_0x9190('0x40')][_0x9190('0x5a')]({'where':{'id':_0x4e76fb['params']['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x258862,null))[_0x9190('0x21')](saveUpdates(_0x4e76fb[_0x9190('0x5c')],null))[_0x9190('0x21')](respondWithResult(_0x258862,null))[_0x9190('0x2b')](handleError(_0x258862,null));};exports[_0x9190('0x72')]=function(_0x10634e,_0x51700b,_0x270bdb){_0x10634e[_0x9190('0x5c')][_0x9190('0x73')]=_0x10634e[_0x9190('0x6f')]['filename'];return db[_0x9190('0x40')][_0x9190('0x5a')]({'where':{'id':_0x10634e[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x51700b,null))[_0x9190('0x21')](saveUpdates(_0x10634e[_0x9190('0x5c')],null))[_0x9190('0x21')](respondWithResult(_0x51700b,null))[_0x9190('0x2b')](handleError(_0x51700b,null));};exports[_0x9190('0x74')]=function(_0x48ca47,_0xfb16c4,_0x281a9b){_0x48ca47[_0x9190('0x5c')][_0x9190('0x75')]=_0x48ca47[_0x9190('0x6f')][_0x9190('0x70')];return db['ChatWebsite'][_0x9190('0x5a')]({'where':{'id':_0x48ca47['params']['id']}})['then'](handleEntityNotFound(_0xfb16c4,null))[_0x9190('0x21')](saveUpdates(_0x48ca47['body'],null))['then'](respondWithResult(_0xfb16c4,null))[_0x9190('0x2b')](handleError(_0xfb16c4,null));};exports[_0x9190('0x76')]=function(_0x25867c,_0x14c675,_0x338f5c){var _0x2c765c=path['join'](config[_0x9190('0x77')],'server/files/images/logos/default_logo.svg');var _0x57d5b6={'where':{'id':_0x25867c[_0x9190('0x59')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x3fc15c=![];return require(_0x9190('0x17'))[_0x9190('0x78')]()[_0x9190('0x21')](function(_0x34a78d){if(_0x34a78d){_0x3fc15c=_0x34a78d[_0x9190('0x79')];}})['then'](function(){return db[_0x9190('0x40')]['find'](_0x57d5b6);})['then'](handleEntityNotFound(_0x14c675,null))[_0x9190('0x21')](function(_0x5a3419){if(_0x5a3419){if(!_['isNil'](_0x5a3419[_0x9190('0x7a')])){if(fs['existsSync'](path['join'](config['root'],_0x9190('0x7b'),_0x5a3419[_0x9190('0x7a')]))&&_0x3fc15c){_0x2c765c=path[_0x9190('0x7c')](config[_0x9190('0x77')],_0x9190('0x7b'),_0x5a3419['sitepic']);}}return _0x14c675[_0x9190('0x7d')](_0x2c765c);}})[_0x9190('0x2b')](handleError(_0x14c675,null));};exports[_0x9190('0x7e')]=function(_0x1d96c2,_0x10cf74,_0x7126a6){var _0x527470=path['join'](config[_0x9190('0x77')],_0x9190('0x7f'));var _0xbd2ae2={'where':{'id':_0x1d96c2['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x9190('0x40')][_0x9190('0x5a')](_0xbd2ae2)[_0x9190('0x21')](handleEntityNotFound(_0x10cf74,null))[_0x9190('0x21')](function(_0x56bb36){if(_0x56bb36){if(!_[_0x9190('0x80')](_0x56bb36['agentAvatar'])){if(fs[_0x9190('0x81')](path[_0x9190('0x7c')](config['root'],_0x9190('0x82'),_0x56bb36['agentAvatar']))){_0x527470=path[_0x9190('0x7c')](config[_0x9190('0x77')],_0x9190('0x82'),_0x56bb36['agentAvatar']);}}return _0x10cf74[_0x9190('0x7d')](_0x527470);}})['catch'](handleError(_0x10cf74,null));};exports[_0x9190('0x83')]=function(_0x4af464,_0x521b45,_0xb38874){var _0x2bcd5e=path[_0x9190('0x7c')](config[_0x9190('0x77')],_0x9190('0x84'));var _0x41a01a={'where':{'id':_0x4af464['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x9190('0x40')][_0x9190('0x5a')](_0x41a01a)[_0x9190('0x21')](handleEntityNotFound(_0x521b45,null))[_0x9190('0x21')](function(_0x1b3b73){if(_0x1b3b73){if(!_[_0x9190('0x80')](_0x1b3b73[_0x9190('0x73')])){if(fs[_0x9190('0x81')](path[_0x9190('0x7c')](config['root'],_0x9190('0x82'),_0x1b3b73['customerAvatar']))&&_0x1b3b73[_0x9190('0x85')]){_0x2bcd5e=path[_0x9190('0x7c')](config['root'],'server/files/images/avatars/',_0x1b3b73[_0x9190('0x73')]);}}return _0x521b45[_0x9190('0x7d')](_0x2bcd5e);}})[_0x9190('0x2b')](handleError(_0x521b45,null));};exports[_0x9190('0x86')]=function(_0x58da31,_0x143cf2,_0x2be80d){var _0x22c49c=path[_0x9190('0x7c')](config[_0x9190('0x77')],_0x9190('0x87'));var _0x4340e5={'where':{'id':_0x58da31['params']['id']},'attributes':['id',_0x9190('0x75')],'raw':!![]};return db[_0x9190('0x40')][_0x9190('0x5a')](_0x4340e5)['then'](handleEntityNotFound(_0x143cf2,null))['then'](function(_0x30a134){if(_0x30a134){if(!_[_0x9190('0x80')](_0x30a134[_0x9190('0x75')])){if(fs[_0x9190('0x81')](path[_0x9190('0x7c')](config['root'],_0x9190('0x82'),_0x30a134[_0x9190('0x75')]))){_0x22c49c=path[_0x9190('0x7c')](config[_0x9190('0x77')],_0x9190('0x82'),_0x30a134[_0x9190('0x75')]);}}return _0x143cf2['download'](_0x22c49c);}})[_0x9190('0x2b')](handleError(_0x143cf2,null));};exports[_0x9190('0x88')]=function(_0x2a2b07,_0x3de409,_0x491baa){var _0xe8aca8=require(_0x9190('0x89'));var _0x209dea=new _0xe8aca8();var _0x13173a=_0x209dea[_0x9190('0x8a')](_0x2a2b07[_0x9190('0x8b')][_0x9190('0x8c')])[_0x9190('0x8d')]();var _0x488b5a={'body':_0x2a2b07['body'],'channel':'chat'};var _0xa35c3a=[];var _0x1c5909=[];var _0x2690dc={};var _0x57d0d9=![];return db[_0x9190('0x8e')][_0x9190('0x61')]()[_0x9190('0x21')](function(_0x39ca45){if(!_0x39ca45){throw new db[(_0x9190('0x8f'))][(_0x9190('0x90'))]('no\x20available\x20attributes');}_0xa35c3a=_[_0x9190('0x91')](_[_0x9190('0x47')](_0x39ca45),[_0x9190('0x92'),_0x9190('0x93')]);_0x1c5909=_[_0x9190('0x91')](_['keys'](_0x39ca45),[_0x9190('0x92'),_0x9190('0x93'),_0x9190('0x94'),_0x9190('0x95')]);if(_0x2a2b07['body']['id']){delete _0x2a2b07[_0x9190('0x5c')]['id'];}if(_['isNil'](_0x2a2b07[_0x9190('0x5c')][_0x9190('0x96')])){throw new db[(_0x9190('0x8f'))][(_0x9190('0x90'))](_0x9190('0x97'));}if(_[_0x9190('0x80')](_0x2a2b07[_0x9190('0x5c')][_0x9190('0x5c')])||_0x2a2b07[_0x9190('0x5c')]['body']===''){throw new db[(_0x9190('0x8f'))][(_0x9190('0x90'))](_0x9190('0x98'));}if(_[_0x9190('0x80')](_0x2a2b07[_0x9190('0x5c')][_0x9190('0x99')])){throw new db[(_0x9190('0x8f'))][(_0x9190('0x90'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c5909);}if(!_[_0x9190('0x9a')](_0x1c5909,_0x2a2b07[_0x9190('0x5c')][_0x9190('0x99')])){throw new db[(_0x9190('0x8f'))][(_0x9190('0x90'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c5909);}_0x2690dc[_0x2a2b07['body'][_0x9190('0x99')]]=_0x2a2b07[_0x9190('0x5c')][_0x9190('0x96')];})['then'](function(){return db[_0x9190('0x40')]['find']({'where':{'id':_0x2a2b07[_0x9190('0x59')]['id']},'include':[{'model':db[_0x9190('0x9b')],'as':'List','include':[{'model':db['CmContact'],'as':_0x9190('0x9c'),'where':_0x2690dc,'limit':0x1,'order':[[_0x9190('0x93'),'DESC']]}]},{'model':db[_0x9190('0x9d')],'as':_0x9190('0x9e')}]});})[_0x9190('0x21')](handleEntityNotFound(_0x3de409,null))[_0x9190('0x21')](function(_0x1a490c){if(_0x1a490c&&_0x1a490c['List']){_0x488b5a[_0x9190('0x9f')]=_0x1a490c;_0x488b5a[_0x9190('0xa0')]=_0x1a490c[_0x9190('0x9e')];_0x488b5a[_0x9190('0xa1')]=_0x1a490c[_0x9190('0xa2')];_0x488b5a[_0x9190('0xa0')]=_[_0x9190('0xa3')](_0x488b5a[_0x9190('0xa0')],[_0x9190('0xa4')],[_0x9190('0xa5')]);if(_0x488b5a[_0x9190('0x9f')]['Applications']){delete _0x488b5a[_0x9190('0x9f')][_0x9190('0x9e')];}if(_0x488b5a[_0x9190('0x9f')][_0x9190('0xa2')]&&_0x488b5a['account'][_0x9190('0xa2')][_0x9190('0x9c')][_0x9190('0x4c')]){return _0x488b5a[_0x9190('0x9f')][_0x9190('0xa2')][_0x9190('0x9c')][0x0];}var _0x4b0298=_['defaults'](_0x2a2b07[_0x9190('0x5c')],{'firstName':_0x2a2b07['body'][_0x9190('0x96')],'ListId':_0x1a490c[_0x9190('0x95')]});_0x4b0298[_0x2a2b07[_0x9190('0x5c')][_0x9190('0x99')]]=_0x2a2b07[_0x9190('0x5c')][_0x9190('0x96')];return db['CmContact'][_0x9190('0x5b')](_0x4b0298,{'fields':_0xa35c3a,'raw':!![]});}})['then'](handleEntityNotFound(_0x3de409,null))[_0x9190('0x21')](function(_0x335b15){_0x488b5a[_0x9190('0xa6')]=_0x335b15;var _0x30f779=_0x2a2b07[_0x9190('0x5c')][_0x9190('0xa7')];if(_0x2a2b07[_0x9190('0x8b')][_0x9190('0xa8')]){_0x30f779=_0x2a2b07['headers'][_0x9190('0xa8')];}else if(_0x2a2b07[_0x9190('0x8b')][_0x9190('0xa9')]){_0x30f779=_[_0x9190('0xaa')](_0x2a2b07['headers'][_0x9190('0xa9')]['split'](','));}if(_0x335b15){var _0x157831={'ContactId':_0x335b15['id'],'ChatWebsiteId':_0x2a2b07[_0x9190('0x59')]['id'],'from':(_0x335b15[_0x9190('0xab')]||'')+'\x20'+(_0x335b15[_0x9190('0xac')]||''),'customerIp':_0x30f779,'customerPort':_0x2a2b07['headers'][_0x9190('0xad')]?_0x2a2b07[_0x9190('0x8b')][_0x9190('0xad')]:null,'referer':_0x2a2b07[_0x9190('0x5c')][_0x9190('0xae')],'browserName':_0x13173a[_0x9190('0xaf')][_0x9190('0x3c')]&&_0x13173a[_0x9190('0xaf')]['version']?util[_0x9190('0xb0')]('%s\x20%s',_0x13173a['browser'][_0x9190('0x3c')],_0x13173a[_0x9190('0xaf')][_0x9190('0xb1')]):_0x9190('0xb2'),'browserVersion':_0x13173a[_0x9190('0xaf')]['version']||_0x9190('0xb2'),'osName':util['format'](_0x9190('0xb3'),_0x13173a['os'][_0x9190('0x3c')],_0x13173a['os'][_0x9190('0xb1')]),'osVersion':_0x13173a['os'][_0x9190('0xb1')],'deviceModel':_0x13173a[_0x9190('0xb4')]['model']&&_0x13173a[_0x9190('0xb4')]['vendor']?util['format']('%s\x20%s\x20%s',_0x13173a['device'][_0x9190('0x44')],_0x13173a['device']['vendor'],_0x13173a['device'][_0x9190('0x43')]):null,'deviceVendor':_0x13173a[_0x9190('0xb4')][_0x9190('0xb5')],'deviceType':_0x13173a[_0x9190('0xb4')][_0x9190('0x43')],'formData':JSON[_0x9190('0x27')](_0x2a2b07[_0x9190('0x5c')])};var _0x23457f={'ChatWebsiteId':_0x2a2b07['params']['id'],'closed':![]};if(_0x2a2b07[_0x9190('0x5c')][_0x9190('0xb6')]){_0x23457f[_0x9190('0xb6')]=_0x2a2b07[_0x9190('0x5c')][_0x9190('0xb6')];return db[_0x9190('0xb7')][_0x9190('0x5a')]({'where':_0x23457f})[_0x9190('0x21')](function(_0x278646){if(_0x278646){return[_0x278646,![]];}_0x157831[_0x9190('0xb6')]=_0x2a2b07['body']['threadId'];_0x157831['externalUrl']=_0x2a2b07[_0x9190('0x5c')][_0x9190('0xb8')];return db['ChatInteraction']['create'](_0x157831)['then'](function(_0x3f5235){return[_0x3f5235,!![]];});});}_0x23457f[_0x9190('0xb9')]=_0x335b15['id'];if(_0x2a2b07[_0x9190('0x5c')][_0x9190('0xba')]&&_0x2a2b07[_0x9190('0x5c')]['interaction']['id']){_0x23457f['id']=_0x2a2b07['body'][_0x9190('0xba')]['id'];return db[_0x9190('0xb7')][_0x9190('0x5a')]({'where':_0x23457f})[_0x9190('0x21')](function(_0xad48ec){if(_0xad48ec){return[_0xad48ec,![]];}return db[_0x9190('0xb7')]['create'](_0x157831)['then'](function(_0x48942c){return[_0x48942c,!![]];});});}return db[_0x9190('0xb7')][_0x9190('0x5b')](_0x157831)[_0x9190('0x21')](function(_0x467cb6){return[_0x467cb6,!![]];});}})[_0x9190('0xbb')](function(_0x25db77,_0x1af4af){if(_0x25db77){_0x57d0d9=_0x1af4af;if(!_0x1af4af){var _0x1773d6={'from':(_0x488b5a[_0x9190('0xa6')]['firstName']||'')+'\x20'+(_0x488b5a[_0x9190('0xa6')][_0x9190('0xac')]||'')};if(_0x2a2b07['body'][_0x9190('0xb6')]&&_0x2a2b07[_0x9190('0x5c')][_0x9190('0xbc')]&&_0x2a2b07['body'][_0x9190('0xb6')]!=_0x2a2b07['body'][_0x9190('0xbc')]){_0x1773d6[_0x9190('0xb6')]=_0x2a2b07['body'][_0x9190('0xbc')];}return _0x25db77[_0x9190('0x37')](_0x1773d6);}else{return _0x25db77;}}})[_0x9190('0x21')](function(_0x44d572){_0x488b5a['interaction']=_0x44d572[_0x9190('0x39')]({'plain':!![]});_0x488b5a[_0x9190('0xba')]['created']=_0x57d0d9;if(_0x488b5a[_0x9190('0xba')]['created']){if(_0x488b5a[_0x9190('0x9f')]['autoclose']){_0x488b5a[_0x9190('0xa0')][_0x9190('0xbd')]({'id':0x0,'priority':_0x488b5a[_0x9190('0xa0')]['length']+0x1,'app':_0x9190('0xbe'),'appdata':_0x9190('0xbf'),'interval':_0x9190('0xc0')});}}return db['ChatMessage'][_0x9190('0x5b')]({'body':_0x2a2b07[_0x9190('0x5c')][_0x9190('0x5c')],'ChatWebsiteId':_0x2a2b07[_0x9190('0x59')]['id'],'ChatInteractionId':_0x44d572['id'],'direction':'in','ContactId':_0x488b5a['contact']['id'],'AttachmentId':_0x2a2b07['body']['AttachmentId']});})[_0x9190('0x21')](function(_0x52adb1){_0x488b5a[_0x9190('0x2a')]=_0x52adb1;if(_0x488b5a['interaction'][_0x9190('0xc1')]){return db[_0x9190('0xc2')][_0x9190('0x5a')]({'attributes':['id',_0x9190('0x3c')],'where':{'id':_0x488b5a[_0x9190('0xba')]['UserId']}})[_0x9190('0x21')](function(_0x2790c8){if(_0x2790c8){_0x488b5a[_0x9190('0xa0')][_0x9190('0xc3')]({'id':0x0,'priority':0x0,'app':_0x9190('0xc4'),'appdata':_0x2790c8['name']+','+(_0x488b5a[_0x9190('0x9f')][_0x9190('0xc5')]||0xa),'interval':_0x9190('0xc0')});_0x488b5a[_0x9190('0xc6')]=!![];}return respondWithRpcPromise(_0x9190('0xc7'),_0x9190('0xc8'),_0x488b5a);});}return respondWithRpcPromise('Start',_0x9190('0xc8'),_0x488b5a);})[_0x9190('0x21')](function(_0x471091){respondWithRpcPromise('EventManager',_0x9190('0xc9'),{'event':'notify','message':_0x471091},client9002);return _0x471091;})['then'](respondWithResult(_0x3de409,null))[_0x9190('0x2b')](handleError(_0x3de409,null));};exports[_0x9190('0xca')]=function(_0x14013a,_0x3c355a,_0x311c6c){var _0x3a7246,_0x433cb8,_0x28920d;var _0x3266d2=[];var _0x195189=[];var _0x3bc8ca={};var _0x5390a2=_0x14013a[_0x9190('0xcb')]||[];var _0x29b4f8=[];var _0x46f146;return db[_0x9190('0x8e')]['describe']()[_0x9190('0x21')](function(_0x3d2321){if(!_0x3d2321){throw new db[(_0x9190('0x8f'))][(_0x9190('0x90'))](_0x9190('0xcc'));}_0x195189=_[_0x9190('0x91')](_[_0x9190('0x47')](_0x3d2321),[_0x9190('0x92'),_0x9190('0x93')]);_0x3266d2=_[_0x9190('0x91')](_[_0x9190('0x47')](_0x3d2321),['createdAt','updatedAt',_0x9190('0x94'),_0x9190('0x95')]);if(_0x14013a[_0x9190('0x5c')]['id']){delete _0x14013a[_0x9190('0x5c')]['id'];}if(_['isNil'](_0x14013a[_0x9190('0x5c')]['from'])){throw _0x3c355a['status'](0x1f4)['send'](new db[(_0x9190('0x8f'))][(_0x9190('0x90'))](_0x9190('0x97')));}if(_[_0x9190('0x80')](_0x14013a['body'][_0x9190('0x5c')])||_0x14013a['body'][_0x9190('0x5c')]===''){throw _0x3c355a[_0x9190('0x2d')](0x1f4)[_0x9190('0x3d')](new db[(_0x9190('0x8f'))]['ValidationError'](_0x9190('0x98')));}if(_[_0x9190('0x80')](_0x14013a['body'][_0x9190('0xcd')])){throw _0x3c355a[_0x9190('0x2d')](0x1f4)['send'](new db[(_0x9190('0x8f'))][(_0x9190('0x90'))](_0x9190('0xce')+_0x3266d2));}if(!_[_0x9190('0x9a')](_0x3266d2,_0x14013a[_0x9190('0x5c')][_0x9190('0xcd')])){throw _0x3c355a[_0x9190('0x2d')](0x1f4)[_0x9190('0x3d')](new db['Sequelize'][(_0x9190('0x90'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3266d2));}_0x3bc8ca[_0x14013a[_0x9190('0x5c')][_0x9190('0xcd')]]=_0x14013a[_0x9190('0x5c')][_0x9190('0x96')];})[_0x9190('0x21')](function(){return db[_0x9190('0x40')][_0x9190('0x5a')]({'where':{'id':_0x14013a['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x9190('0xcf')],'as':_0x9190('0xcf')}]});})[_0x9190('0x21')](handleEntityNotFound(_0x3c355a,null))['then'](function(_0x3f9450){if(_0x3f9450&&_0x3f9450[_0x9190('0xa2')]){_0x433cb8=_0x3f9450;var _0x7ecc5d=_[_0x9190('0x1a')](_0x14013a[_0x9190('0x5c')],{'firstName':_0x14013a[_0x9190('0x5c')]['from'],'phone':_0x14013a['body'][_0x9190('0x96')],'ListId':_0x3f9450[_0x9190('0x95')]});_0x7ecc5d[_0x14013a[_0x9190('0x5c')][_0x9190('0xcd')]]=_0x14013a['body']['from'];return db[_0x9190('0x8e')][_0x9190('0xd0')]({'where':_0x3bc8ca,'defaults':_0x7ecc5d});}})[_0x9190('0xbb')](function(_0x59e959){if(_0x59e959){_0x28920d=_0x59e959;var _0x103192=fs[_0x9190('0xd1')](path[_0x9190('0x7c')](config[_0x9190('0x77')],_0x9190('0xd2')),_0x9190('0xd3'));var _0x30e74c=ejs[_0x9190('0xd4')](_0x103192,{'body':_[_0x9190('0xd5')](_0x14013a[_0x9190('0x5c')]['body']),'bodyTitle':_0x433cb8[_0x9190('0xd6')]});return db[_0x9190('0xd7')][_0x9190('0x5b')]({'body':_0x30e74c,'ContactId':_0x59e959['id'],'ChatWebsiteId':_0x433cb8['id']});}})[_0x9190('0x21')](function(_0x4167db){_0x46f146=_0x4167db;if(_0x5390a2[_0x9190('0x4c')]){var _0x7cee7a=_0x5390a2['map'](function(_0x5407be){return{'name':_0x5407be['originalname'],'basename':_0x5407be[_0x9190('0x70')],'type':_0x5407be[_0x9190('0xd8')],'ChatOfflineMessageId':_0x4167db['id']};});_0x29b4f8=_0x7cee7a[_0x9190('0x45')](_0x36be53=>{var _0x204fd0={'filename':_0x36be53[_0x9190('0x3c')],'path':path['join'](config[_0x9190('0x77')],_0x9190('0xd9'),_0x9190('0xcb'),_0x9190('0xda'),_0x9190('0xdb'),_0x36be53['basename'])};return _0x204fd0;});if(!_0x433cb8['openNewInteraction']){return db[_0x9190('0xdc')][_0x9190('0xdd')](function(_0x227b1e){return db[_0x9190('0xde')]['bulkCreate'](_0x7cee7a,{'transaction':_0x227b1e});});}}})[_0x9190('0x21')](function(){if(_0x46f146){_0x3a7246=_0x46f146;return db[_0x9190('0xcf')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x9190('0xdf')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x250af6){if(_0x250af6&&_0x250af6[_0x9190('0xe0')]&&_0x433cb8[_0x9190('0xe1')]&&_0x433cb8[_0x9190('0xe2')]){var _0x3f9943={'tls':{'rejectUnauthorized':![]}};if(_0x250af6[_0x9190('0xe0')]['service']){_0x3f9943[_0x9190('0xe3')]=_0x250af6[_0x9190('0xe0')][_0x9190('0xe3')];}else{_0x3f9943[_0x9190('0xe4')]=_0x250af6[_0x9190('0xe0')][_0x9190('0xe4')];_0x3f9943['port']=_0x250af6[_0x9190('0xe0')]['port'];_0x3f9943[_0x9190('0xe5')]=_0x250af6[_0x9190('0xe0')][_0x9190('0xe5')];}if(_0x250af6['Smtp'][_0x9190('0xe6')]){_0x3f9943[_0x9190('0xe7')]={'user':_0x250af6[_0x9190('0xe0')][_0x9190('0x5d')],'pass':_0x250af6[_0x9190('0xe0')][_0x9190('0xe8')]};}return respondWithRpcPromise(_0x9190('0xe9'),_0x9190('0xea'),{'account':_0x3f9943,'message':{'from':util[_0x9190('0xb0')](_0x9190('0xeb'),_0x250af6[_0x9190('0x3c')],_0x250af6[_0x9190('0xec')]||_0x250af6[_0x9190('0xe0')][_0x9190('0x5d')]),'to':_0x433cb8[_0x9190('0xe2')],'subject':_0x433cb8['offlineMessageSubject'],'html':_0x3a7246[_0x9190('0x5c')],'attachments':_0x29b4f8}},client9003)[_0x9190('0x21')](function(){return _0x3a7246;})['catch'](function(_0x112834){console[_0x9190('0x28')](_0x112834);});}})[_0x9190('0x21')](function(){if(_0x433cb8&&_0x433cb8[_0x9190('0xed')]&&_0x433cb8[_0x9190('0xee')]){var _0x45b575=[];if(_0x5390a2[_0x9190('0x4c')]){_0x45b575=_0x5390a2[_0x9190('0x45')](function(_0x451c6a){return{'name':_0x451c6a[_0x9190('0xef')],'basename':_0x451c6a[_0x9190('0x70')],'type':_0x451c6a['mimetype'],'ChatOfflineMessageId':_0x46f146['id']};});}var _0x506530;if(!_[_0x9190('0x80')](_0x433cb8[_0x9190('0xf0')])){var _0x89d2f4=_[_0x9190('0x45')](_0x14013a[_0x9190('0x5c')],function(_0x33dc2f){return _0x33dc2f;});var _0x273843=_['toPairsIn'](_0x89d2f4)[0x0];var _0x14e2e5=_[_0x9190('0xf1')](_0x273843,function(_0x283317){return _0x283317;});_0x506530=_0x14e2e5[0x1][_0x433cb8[_0x9190('0xf0')]];}var _0x50c154={'from':_0x28920d[_0x9190('0xec')],'firstName':_0x28920d[_0x9190('0xab')],'lastName':_0x28920d['lastName'],'mapKey':_0x9190('0xec'),'message':{'from':_0x28920d[_0x9190('0xec')],'to':_0x433cb8[_0x9190('0xcf')][_0x9190('0xec')],'cc':'','subject':_['isNil'](_0x506530)?_0x433cb8[_0x9190('0xf2')]:_0x506530,'messageId':'','sentAt':new Date(),'attach':_0x45b575['length'],'attachments':_0x45b575,'originChannel':_0x9190('0xf3'),'ChatWebsiteId':_0x433cb8['id'],'ChatOfflineMessageId':_0x3a7246['id'],'originTo':_0x433cb8['MailAccount']['email']},'body':_0x3a7246[_0x9190('0x5c')]};var _0x3250bc={'account':{'id':_0x433cb8[_0x9190('0xee')]},'body':_0x50c154,'log':_0x9190('0xf4')};return respondWithRpcPromise(_0x9190('0xf4'),_0x9190('0xf5'),_0x3250bc,client9001)['then'](function(){return _0x3a7246;})[_0x9190('0x2b')](function(_0xee42df){console['error'](_0xee42df);});}return;})[_0x9190('0x21')](function(){if(_0x3a7246){return _0x3a7246;}})[_0x9190('0x21')](respondWithResult(_0x3c355a,null))[_0x9190('0x2b')](function(_0x4b80ea){console[_0x9190('0x28')](_0x9190('0x2b'),_0x4b80ea);for(var _0xe8f390 of _0x5390a2){var _0x359332=path['join'](config['root'],_0x9190('0xd9'),_0x9190('0xcb'),_0x9190('0xda'),'offline-chat',_0xe8f390[_0x9190('0x70')]);fs_extra[_0x9190('0xf6')](_0x359332)[_0x9190('0x2b')](function(_0x2993fb){console[_0x9190('0x28')](_0x9190('0xf7'),_0x359332,_0x2993fb);});}});};exports[_0x9190('0xf8')]=function(_0x48e2eb,_0x5310cc,_0x266562){return db['ChatInteraction'][_0x9190('0x5a')]({'where':{'id':_0x48e2eb[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x5310cc,null))[_0x9190('0x21')](function(_0x325ab0){if(_0x325ab0){return _0x325ab0[_0x9190('0xf8')](_0x48e2eb['body']['ids'],_['omit'](_0x48e2eb[_0x9190('0x5c')],[_0x9190('0x6a'),'id'])||{});}})[_0x9190('0x21')](respondWithResult(_0x5310cc,null))[_0x9190('0x2b')](handleError(_0x5310cc,null));};exports['getInteractions']=function(_0x406ce6,_0x1cda04,_0x17f729){var _0x1e244c={'raw':![],'where':{}};var _0x372640={};var _0x4076a3={'count':0x0,'rows':[]};return db[_0x9190('0x40')]['findOne']({'where':{'id':_0x406ce6['params']['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x1cda04,null))[_0x9190('0x21')](function(_0x231f58){if(_0x231f58){_0x372640[_0x9190('0x44')]=_[_0x9190('0x47')](db['ChatInteraction'][_0x9190('0x41')]);_0x372640[_0x9190('0x46')]=_[_0x9190('0x47')](_0x406ce6[_0x9190('0x46')]);_0x372640['filters']=_[_0x9190('0x4a')](_0x372640['model'],_0x372640[_0x9190('0x46')]);_0x1e244c[_0x9190('0x49')]=_[_0x9190('0x4a')](_0x372640[_0x9190('0x44')],qs[_0x9190('0x4b')](_0x406ce6[_0x9190('0x46')]['fields']));_0x1e244c[_0x9190('0x49')]=_0x1e244c[_0x9190('0x49')][_0x9190('0x4c')]?_0x1e244c[_0x9190('0x49')]:_0x372640[_0x9190('0x44')];if(!_0x406ce6[_0x9190('0x46')][_0x9190('0x4d')](_0x9190('0x4e'))){_0x1e244c[_0x9190('0x32')]=qs[_0x9190('0x32')](_0x406ce6[_0x9190('0x46')][_0x9190('0x32')]);_0x1e244c[_0x9190('0x30')]=qs['offset'](_0x406ce6[_0x9190('0x46')][_0x9190('0x30')]);}_0x1e244c[_0x9190('0x4f')]=qs[_0x9190('0x50')](_0x406ce6[_0x9190('0x46')][_0x9190('0x50')]);_0x1e244c[_0x9190('0x51')]=qs[_0x9190('0x48')](_['pick'](_0x406ce6['query'],_0x372640[_0x9190('0x48')]));_0x1e244c[_0x9190('0x51')]['ChatWebsiteId']=_0x231f58['id'];if(_0x406ce6['query'][_0x9190('0x52')]){_0x1e244c[_0x9190('0x51')]=_[_0x9190('0x53')](_0x1e244c[_0x9190('0x51')],{'$or':_[_0x9190('0x45')](_0x1e244c['attributes'],function(_0x54b237){var _0xdd728e={};_0xdd728e[_0x54b237]={'$like':'%'+_0x406ce6[_0x9190('0x46')]['filter']+'%'};return _0xdd728e;})});}_0x1e244c=_[_0x9190('0x53')]({},_0x1e244c,_0x406ce6[_0x9190('0x54')]);return db[_0x9190('0xb7')][_0x9190('0x33')]({'where':_0x1e244c[_0x9190('0x51')]})[_0x9190('0x21')](function(_0x3c5383){_0x4076a3['count']=_0x3c5383;if(_0x406ce6[_0x9190('0x46')][_0x9190('0x55')]){_0x1e244c[_0x9190('0x56')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0x9190('0xf9'),'attributes':[_0x9190('0x3c'),_0x9190('0xfa'),'internal'],'required':![]},{'model':db[_0x9190('0xfb')],'as':_0x9190('0xfc'),'attributes':['id','name',_0x9190('0xfd')],'where':_0x406ce6[_0x9190('0x46')][_0x9190('0xfe')]?{'id':_0x406ce6[_0x9190('0x46')]['tag']}:undefined,'required':_0x406ce6[_0x9190('0x46')][_0x9190('0xfe')]?!![]:![]}];}return db[_0x9190('0xb7')][_0x9190('0x68')](_0x1e244c);})[_0x9190('0x21')](function(_0x2973fb){_0x4076a3[_0x9190('0x57')]=_0x2973fb;return _0x4076a3;});}})[_0x9190('0x21')](respondWithFilteredResult(_0x1cda04,_0x1e244c))['catch'](handleError(_0x1cda04,null));};function iftimePromise(_0x53476e,_0x50c8e9){return respondWithRpcPromise(_0x9190('0xff'),_0x9190('0x100'),{'command':_0x50c8e9[_0x9190('0x101')]?util[_0x9190('0xb0')]('iftime\x20%s,%s',_0x53476e[_0x9190('0x102')],_0x50c8e9[_0x9190('0x101')]):util[_0x9190('0xb0')](_0x9190('0x103'),_0x53476e[_0x9190('0x102')])},client9002)[_0x9190('0x21')](function(_0x1ae3ad){var _0x1d555e=_0x1ae3ad&&_0x1ae3ad[_0x9190('0x104')]('true')>=0x0?!![]:![];logger['info'](_0x9190('0x105'),_0x50c8e9['id'],_0x53476e['id'],_0x53476e[_0x9190('0x102')],_0x1d555e?_0x9190('0x106'):_0x9190('0x107'),_0x50c8e9[_0x9190('0x101')]?_0x50c8e9['timezone']:_0x9190('0x108'));return _0x1d555e;})[_0x9190('0x2b')](function(_0x213149){logger[_0x9190('0x28')](_0x9190('0x105'),_0x50c8e9['id'],_0x53476e['id'],_0x53476e[_0x9190('0x102')],util[_0x9190('0x109')](_0x213149,{'showHidden':![],'depth':null}),_0x50c8e9[_0x9190('0x101')]?_0x50c8e9[_0x9190('0x101')]:_0x9190('0x108'));return![];});}exports[_0x9190('0x100')]=function(_0x2c9c44,_0x5510bc,_0x1f4bb7){var _0x567533=0x0;var _0x11ca44=0x0;var _0x2a185a=![];var _0xf3de94;var _0x17af2e;return db[_0x9190('0x40')][_0x9190('0x5a')]({'where':{'id':_0x2c9c44[_0x9190('0x59')]['id']},'include':[{'model':db['Interval'],'as':_0x9190('0x10a'),'include':[{'model':db['Interval'],'as':_0x9190('0x10b'),'attributes':['id',_0x9190('0x102')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5510bc,null))[_0x9190('0x21')](function(_0x6109fc){if(_0x6109fc){_0xf3de94=_0x6109fc;return _0x6109fc['getProactiveActions']({'raw':!![]});}})[_0x9190('0x21')](function(_0x50dfae){if(_0xf3de94){if(_0x50dfae){_0x17af2e=_0x50dfae;}}return require(_0x9190('0x17'))[_0x9190('0x78')]();})[_0x9190('0x21')](function(_0x1bd2a3){if(_0x1bd2a3){_0x11ca44=_0x1bd2a3[_0x9190('0x10c')];_0x2a185a=_0x1bd2a3['custom'];}})[_0x9190('0x21')](function(){return db[_0x9190('0xb7')][_0x9190('0x33')]({'where':{'closed':![]}});})[_0x9190('0x21')](function(_0x246765){_0x567533=_0x246765;if(_0x11ca44&&_0x246765>_0x11ca44){return db[_0x9190('0x10d')]['findOne']({'where':{'id':0x1}})[_0x9190('0x21')](function(_0x57d581){if(_0x57d581){_0x57d581['increment']('chatLicenseExceeded');}});}})[_0x9190('0x21')](function(){if(_0xf3de94[_0x9190('0x10a')]&&_0xf3de94['Interval'][_0x9190('0x10b')]){var _0x444f5f=[];for(var _0x4d5a7d=0x0;_0x4d5a7d<_0xf3de94[_0x9190('0x10a')]['Intervals'][_0x9190('0x4c')];_0x4d5a7d++){var _0x203e6d=_0xf3de94['Interval']['Intervals'][_0x4d5a7d]['get']({'plain':!![]});_0x444f5f[_0x9190('0xbd')](iftimePromise(_0x203e6d,_0xf3de94));}return BPromise['all'](_0x444f5f)['then'](function(_0x5ebde1){return _['some'](_0x5ebde1);});}else{return!![];}})[_0x9190('0x21')](function(_0x5d8ca7){var _0xc95cc0=fs[_0x9190('0xd1')](path[_0x9190('0x7c')](config[_0x9190('0x77')],_0x9190('0x10e')),_0x9190('0xd3'));var _0x86991f={'remote':_0xf3de94['remote'],'query':querystring[_0x9190('0x27')](_[_0x9190('0x53')](_0xf3de94['get']({'plain':!![]}),{'customerIp':_0x2c9c44[_0x9190('0x8b')][_0x9190('0xa9')]||_0x2c9c44[_0x9190('0x8b')]['x-real-ip']||_0x2c9c44[_0x9190('0x10f')][_0x9190('0x110')]||_0x2c9c44['ip'],'referer':_0x2c9c44['headers'][_0x9190('0xae')],'openedInteractions':_0x567533,'maxInteractions':_0x11ca44,'virtual':_0x2a185a['virtual'],'online':_0x5d8ca7,'custom':_0x2a185a}))['replace'](/'/g,'\x5c\x27')};_0x5510bc['send'](ejs[_0x9190('0xd4')](Mustache['render'](_0xc95cc0,_0x86991f),{'proactiveActions':_0x17af2e,'alignment':_0xf3de94['alignment'],'verticalAlignment':_0xf3de94[_0x9190('0x111')],'div_color':_0xf3de94[_0x9190('0xfd')],'text_color':_0xf3de94[_0x9190('0x112')],'button_color':_0xf3de94[_0x9190('0x113')],'background_color':_0xf3de94[_0x9190('0x114')]}));})[_0x9190('0x2b')](handleError(_0x5510bc,null));};exports[_0x9190('0x115')]=function(_0x434452,_0x1d227c,_0x2b2ab4){return db[_0x9190('0x40')][_0x9190('0x65')]({'where':{'id':_0x434452[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x1d227c,null))['then'](function(_0x1744ab){if(_0x1744ab){return db[_0x9190('0xdc')]['transaction'](function(_0x149b10){return db['ChatApplication'][_0x9190('0x38')]({'where':{'ChatWebsiteId':_0x434452[_0x9190('0x59')]['id']},'transaction':_0x149b10})[_0x9190('0x21')](function(_0x58ff9f){var _0x582497=_[_0x9190('0x45')](_0x434452[_0x9190('0x5c')],function(_0x1c7472){_0x1c7472[_0x9190('0x63')]=_0x434452[_0x9190('0x59')]['id'];return _0x1c7472;});return db[_0x9190('0x9d')]['bulkCreate'](_0x582497,{'transaction':_0x149b10});});})[_0x9190('0x21')](function(){return db[_0x9190('0x9d')][_0x9190('0x116')]({'where':{'ChatWebsiteId':_0x434452[_0x9190('0x59')]['id']},'order':'priority'});});}})[_0x9190('0x21')](respondWithResult(_0x1d227c,null))[_0x9190('0x2b')](handleError(_0x1d227c,null));};exports[_0x9190('0x117')]=function(_0x151831,_0x2a99dc,_0x35dd74){var _0x56c923={};var _0x5be411={};var _0xa62eb3;var _0x2a1abf;return db['ChatWebsite']['findOne']({'where':{'id':_0x151831[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x2a99dc,null))[_0x9190('0x21')](function(_0x22ba26){if(_0x22ba26){_0xa62eb3=_0x22ba26;_0x5be411[_0x9190('0x44')]=_[_0x9190('0x47')](db[_0x9190('0x9d')]['rawAttributes']);_0x5be411[_0x9190('0x46')]=_['keys'](_0x151831['query']);_0x5be411[_0x9190('0x48')]=_[_0x9190('0x4a')](_0x5be411[_0x9190('0x44')],_0x5be411['query']);_0x56c923['attributes']=_['intersection'](_0x5be411[_0x9190('0x44')],qs['fields'](_0x151831[_0x9190('0x46')][_0x9190('0x4b')]));_0x56c923[_0x9190('0x49')]=_0x56c923[_0x9190('0x49')][_0x9190('0x4c')]?_0x56c923[_0x9190('0x49')]:_0x5be411['model'];_0x56c923['order']=qs[_0x9190('0x50')](_0x151831['query'][_0x9190('0x50')]);_0x56c923[_0x9190('0x51')]=qs['filters'](_[_0x9190('0x67')](_0x151831['query'],_0x5be411[_0x9190('0x48')]));if(_0x151831[_0x9190('0x46')][_0x9190('0x52')]){_0x56c923[_0x9190('0x51')]=_[_0x9190('0x53')](_0x56c923['where'],{'$or':_[_0x9190('0x45')](_0x56c923['attributes'],function(_0x35c80d){var _0x4cf2cf={};_0x4cf2cf[_0x35c80d]={'$like':'%'+_0x151831[_0x9190('0x46')]['filter']+'%'};return _0x4cf2cf;})});}_0x56c923=_['merge']({},_0x56c923,_0x151831[_0x9190('0x54')]);return _0xa62eb3[_0x9190('0x117')](_0x56c923);}})[_0x9190('0x21')](function(_0x2c18ab){if(_0x2c18ab){_0x2a1abf=_0x2c18ab[_0x9190('0x4c')];if(!_0x151831['query'][_0x9190('0x4d')](_0x9190('0x4e'))){_0x56c923[_0x9190('0x32')]=qs[_0x9190('0x32')](_0x151831['query'][_0x9190('0x32')]);_0x56c923[_0x9190('0x30')]=qs[_0x9190('0x30')](_0x151831[_0x9190('0x46')][_0x9190('0x30')]);}return _0xa62eb3[_0x9190('0x117')](_0x56c923);}})[_0x9190('0x21')](function(_0x167280){if(_0x167280){return _0x167280?{'count':_0x2a1abf,'rows':_0x167280}:null;}})[_0x9190('0x21')](respondWithResult(_0x2a99dc,null))['catch'](handleError(_0x2a99dc,null));};exports[_0x9190('0x118')]=function(_0x4ffcf7,_0x2c215c,_0x2733ef){return db[_0x9190('0x119')]['find']({'where':{'id':_0x4ffcf7[_0x9190('0x59')]['id']}})['then'](handleEntityNotFound(_0x2c215c,null))['then'](function(_0x1139fc){if(_0x1139fc){return _0x1139fc[_0x9190('0x118')](_0x4ffcf7[_0x9190('0x5c')]['ids'],_[_0x9190('0x11a')](_0x4ffcf7[_0x9190('0x5c')],[_0x9190('0x6a'),'id'])||{});}})[_0x9190('0x21')](respondWithResult(_0x2c215c,null))[_0x9190('0x2b')](handleError(_0x2c215c,null));};exports['getProactiveActions']=function(_0x1d176b,_0x32a52,_0x45f6bf){var _0x39365f={};var _0x5bc167={};var _0x1e8613;var _0x32d129;return db[_0x9190('0x40')][_0x9190('0x65')]({'where':{'id':_0x1d176b[_0x9190('0x59')]['id']}})['then'](handleEntityNotFound(_0x32a52,null))[_0x9190('0x21')](function(_0x4199f1){if(_0x4199f1){_0x1e8613=_0x4199f1;_0x5bc167['model']=_[_0x9190('0x47')](db[_0x9190('0x11b')][_0x9190('0x41')]);_0x5bc167[_0x9190('0x46')]=_[_0x9190('0x47')](_0x1d176b[_0x9190('0x46')]);_0x5bc167[_0x9190('0x48')]=_['intersection'](_0x5bc167[_0x9190('0x44')],_0x5bc167[_0x9190('0x46')]);_0x39365f[_0x9190('0x49')]=_[_0x9190('0x4a')](_0x5bc167['model'],qs['fields'](_0x1d176b[_0x9190('0x46')][_0x9190('0x4b')]));_0x39365f[_0x9190('0x49')]=_0x39365f[_0x9190('0x49')]['length']?_0x39365f[_0x9190('0x49')]:_0x5bc167[_0x9190('0x44')];_0x39365f[_0x9190('0x4f')]=qs[_0x9190('0x50')](_0x1d176b[_0x9190('0x46')][_0x9190('0x50')]);_0x39365f[_0x9190('0x51')]=qs[_0x9190('0x48')](_[_0x9190('0x67')](_0x1d176b[_0x9190('0x46')],_0x5bc167[_0x9190('0x48')]));if(_0x1d176b[_0x9190('0x46')][_0x9190('0x52')]){_0x39365f['where']=_[_0x9190('0x53')](_0x39365f[_0x9190('0x51')],{'$or':_[_0x9190('0x45')](_0x39365f[_0x9190('0x49')],function(_0x868a95){var _0x1ee693={};_0x1ee693[_0x868a95]={'$like':'%'+_0x1d176b['query']['filter']+'%'};return _0x1ee693;})});}_0x39365f=_[_0x9190('0x53')]({},_0x39365f,_0x1d176b[_0x9190('0x54')]);return _0x1e8613['getProactiveActions'](_0x39365f);}})[_0x9190('0x21')](function(_0x5a58eb){if(_0x5a58eb){_0x32d129=_0x5a58eb[_0x9190('0x4c')];if(!_0x1d176b[_0x9190('0x46')][_0x9190('0x4d')](_0x9190('0x4e'))){_0x39365f[_0x9190('0x32')]=qs[_0x9190('0x32')](_0x1d176b[_0x9190('0x46')][_0x9190('0x32')]);_0x39365f['offset']=qs[_0x9190('0x30')](_0x1d176b[_0x9190('0x46')]['offset']);}return _0x1e8613['getProactiveActions'](_0x39365f);}})[_0x9190('0x21')](function(_0x320ae8){if(_0x320ae8){return _0x320ae8?{'count':_0x32d129,'rows':_0x320ae8}:null;}})[_0x9190('0x21')](respondWithResult(_0x32a52,null))[_0x9190('0x2b')](handleError(_0x32a52,null));};exports['getFields']=function(_0x4b9c19,_0x1904e7,_0x4a0979){var _0x38c390=_0x4b9c19['query'][_0x9190('0x11c')]===_0x9190('0x11d')?_0x9190('0x11e'):_0x9190('0x11f');return db[_0x9190('0x40')][_0x9190('0x5a')]({'attributes':['id',_0x38c390],'where':{'id':_0x4b9c19['params']['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x1904e7,null))[_0x9190('0x21')](function(_0x55d834){if(_0x55d834){var _0x4dd2a6=_0x55d834[_0x38c390];var _0x582b25=_0x4dd2a6&&_0x4dd2a6[_0x9190('0x120')]?_0x4dd2a6[_0x9190('0x120')]:[];_0x1904e7['send']({'fromKey':_[_0x9190('0x80')](_0x4dd2a6[_0x9190('0x121')])?undefined:_0x4dd2a6[_0x9190('0x121')],'count':_0x582b25[_0x9190('0x4c')],'rows':_0x582b25});}})[_0x9190('0x2b')](handleError(_0x1904e7,null));};exports[_0x9190('0x122')]=function(_0x3c5bf4,_0xafc7ac,_0x18028c){var _0x520590={'raw':![],'where':{}};var _0x2d995a={};var _0x56f4c3={'count':0x0,'rows':[]};return db[_0x9190('0x40')][_0x9190('0x65')]({'where':{'id':_0x3c5bf4[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0xafc7ac,null))[_0x9190('0x21')](function(_0x33ad81){if(_0x33ad81){_0x2d995a['model']=_[_0x9190('0x47')](db[_0x9190('0xd7')][_0x9190('0x41')]);_0x2d995a[_0x9190('0x46')]=_[_0x9190('0x47')](_0x3c5bf4[_0x9190('0x46')]);_0x2d995a['filters']=_[_0x9190('0x4a')](_0x2d995a[_0x9190('0x44')],_0x2d995a[_0x9190('0x46')]);_0x520590[_0x9190('0x49')]=_['intersection'](_0x2d995a['model'],qs[_0x9190('0x4b')](_0x3c5bf4[_0x9190('0x46')][_0x9190('0x4b')]));_0x520590['attributes']=_0x520590[_0x9190('0x49')][_0x9190('0x4c')]?_0x520590[_0x9190('0x49')]:_0x2d995a['model'];if(!_0x3c5bf4[_0x9190('0x46')][_0x9190('0x4d')](_0x9190('0x4e'))){_0x520590[_0x9190('0x32')]=qs['limit'](_0x3c5bf4[_0x9190('0x46')]['limit']);_0x520590['offset']=qs[_0x9190('0x30')](_0x3c5bf4[_0x9190('0x46')][_0x9190('0x30')]);}_0x520590[_0x9190('0x4f')]=qs['sort'](_0x3c5bf4[_0x9190('0x46')][_0x9190('0x50')]);_0x520590[_0x9190('0x51')]=qs[_0x9190('0x48')](_[_0x9190('0x67')](_0x3c5bf4[_0x9190('0x46')],_0x2d995a[_0x9190('0x48')]));_0x520590[_0x9190('0x51')][_0x9190('0x63')]=_0x33ad81['id'];if(_0x3c5bf4[_0x9190('0x46')]['filter']){_0x520590[_0x9190('0x51')]=_['merge'](_0x520590[_0x9190('0x51')],{'$or':_[_0x9190('0x45')](_0x520590[_0x9190('0x49')],function(_0x4f779b){var _0x20d468={};_0x20d468[_0x4f779b]={'$like':'%'+_0x3c5bf4['query'][_0x9190('0x52')]+'%'};return _0x20d468;})});}_0x520590=_[_0x9190('0x53')]({},_0x520590,_0x3c5bf4['options']);return db[_0x9190('0xd7')][_0x9190('0x33')]({'where':_0x520590['where']})[_0x9190('0x21')](function(_0x3e5722){_0x56f4c3[_0x9190('0x33')]=_0x3e5722;if(_0x3c5bf4['query']['includeAll']){_0x520590[_0x9190('0x56')]=[{'all':!![]}];}else{_0x520590[_0x9190('0x56')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x9190('0xde')],'as':_0x9190('0x123'),'required':![]}];}return db[_0x9190('0xd7')][_0x9190('0x68')](_0x520590);})[_0x9190('0x21')](function(_0x519d09){_0x56f4c3[_0x9190('0x57')]=_0x519d09;return _0x56f4c3;});}})[_0x9190('0x21')](respondWithFilteredResult(_0xafc7ac,_0x520590))[_0x9190('0x2b')](handleError(_0xafc7ac,null));};exports['addAgents']=function(_0x105562,_0x949d06,_0x5e5d9a){return db['ChatWebsite']['find']({'where':{'id':_0x105562[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x949d06,null))[_0x9190('0x21')](function(_0x388d99){if(_0x388d99){return _0x388d99[_0x9190('0x124')](_0x105562[_0x9190('0x5c')][_0x9190('0x6a')],_[_0x9190('0x11a')](_0x105562[_0x9190('0x5c')],[_0x9190('0x6a'),'id'])||{})[_0x9190('0xbb')](function(_0x18a757){for(var _0x551cf7=0x0;_0x551cf7<_0x105562[_0x9190('0x5c')][_0x9190('0x6a')][_0x9190('0x4c')];_0x551cf7+=0x1){socket[_0x9190('0x125')](_0x9190('0x126'),{'UserId':Number(_0x105562[_0x9190('0x5c')][_0x9190('0x6a')][_0x551cf7]),'ChatWebsiteId':Number(_0x105562[_0x9190('0x59')]['id'])});}return _0x18a757;});}})['then'](respondWithResult(_0x949d06,null))[_0x9190('0x2b')](handleError(_0x949d06,null));};exports['removeAgents']=function(_0x492679,_0x12ee8f,_0x16a60a){return db[_0x9190('0x40')][_0x9190('0x5a')]({'where':{'id':_0x492679[_0x9190('0x59')]['id']}})[_0x9190('0x21')](handleEntityNotFound(_0x12ee8f,null))[_0x9190('0x21')](function(_0x2d1332){if(_0x2d1332){return _0x2d1332['removeAgents'](_0x492679[_0x9190('0x46')][_0x9190('0x6a')])['then'](function(){if(_[_0x9190('0x127')](_0x492679[_0x9190('0x46')]['ids'])){for(var _0x158685=0x0;_0x158685<_0x492679['query'][_0x9190('0x6a')]['length'];_0x158685+=0x1){socket[_0x9190('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x492679['query'][_0x9190('0x6a')][_0x158685]),'ChatWebsiteId':Number(_0x492679[_0x9190('0x59')]['id'])});}}else{socket[_0x9190('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x492679[_0x9190('0x46')][_0x9190('0x6a')]),'ChatWebsiteId':Number(_0x492679[_0x9190('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x12ee8f,null))[_0x9190('0x2b')](handleError(_0x12ee8f,null));};exports[_0x9190('0x128')]=function(_0x382d15,_0x39f318,_0x5407ca){var _0x6cbaec={};var _0x4fab19={};var _0x35baea;var _0x377108;return db['ChatWebsite'][_0x9190('0x65')]({'where':{'id':_0x382d15[_0x9190('0x59')]['id']}})['then'](handleEntityNotFound(_0x39f318,null))[_0x9190('0x21')](function(_0x3439c8){if(_0x3439c8){_0x35baea=_0x3439c8;_0x4fab19[_0x9190('0x44')]=_['keys'](db['User'][_0x9190('0x41')]);_0x4fab19['query']=_[_0x9190('0x47')](_0x382d15[_0x9190('0x46')]);_0x4fab19[_0x9190('0x48')]=_[_0x9190('0x4a')](_0x4fab19[_0x9190('0x44')],_0x4fab19[_0x9190('0x46')]);_0x6cbaec[_0x9190('0x49')]=_['intersection'](_0x4fab19[_0x9190('0x44')],qs[_0x9190('0x4b')](_0x382d15[_0x9190('0x46')][_0x9190('0x4b')]));_0x6cbaec[_0x9190('0x49')]=_0x6cbaec[_0x9190('0x49')][_0x9190('0x4c')]?_0x6cbaec[_0x9190('0x49')]:_0x4fab19[_0x9190('0x44')];_0x6cbaec[_0x9190('0x4f')]=qs['sort'](_0x382d15[_0x9190('0x46')][_0x9190('0x50')]);_0x6cbaec[_0x9190('0x51')]=qs[_0x9190('0x48')](_[_0x9190('0x67')](_0x382d15[_0x9190('0x46')],_0x4fab19['filters']));if(_0x382d15[_0x9190('0x46')][_0x9190('0x52')]){_0x6cbaec[_0x9190('0x51')]=_[_0x9190('0x53')](_0x6cbaec[_0x9190('0x51')],{'$or':_[_0x9190('0x45')](_0x6cbaec[_0x9190('0x49')],function(_0x2fac22){var _0xf4c032={};_0xf4c032[_0x2fac22]={'$like':'%'+_0x382d15[_0x9190('0x46')]['filter']+'%'};return _0xf4c032;})});}_0x6cbaec=_[_0x9190('0x53')]({},_0x6cbaec,_0x382d15['options']);return _0x35baea[_0x9190('0x128')](_0x6cbaec);}})['then'](function(_0x5f0f20){if(_0x5f0f20){_0x377108=_0x5f0f20['length'];if(!_0x382d15[_0x9190('0x46')][_0x9190('0x4d')](_0x9190('0x4e'))){_0x6cbaec[_0x9190('0x32')]=qs[_0x9190('0x32')](_0x382d15[_0x9190('0x46')][_0x9190('0x32')]);_0x6cbaec[_0x9190('0x30')]=qs[_0x9190('0x30')](_0x382d15[_0x9190('0x46')][_0x9190('0x30')]);}return _0x35baea[_0x9190('0x128')](_0x6cbaec);}})[_0x9190('0x21')](function(_0x388a25){if(_0x388a25){return _0x388a25?{'count':_0x377108,'rows':_0x388a25}:null;}})[_0x9190('0x21')](respondWithResult(_0x39f318,null))[_0x9190('0x2b')](handleError(_0x39f318,null));}; \ No newline at end of file +var _0xbe99=['x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','CmContact','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','forwardOffline','forwardOfflineAddress','Smtp','service','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','toPairsIn','offlineMessageSubject','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','timezone','No\x20timezone','inspect','Interval','getProactiveActions','getLicense','virtual','custom','License','increment','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','render','alignment','color','textColor','color_button','backgroundColor','addApplications','transaction','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','getFields','online','false','onlineForm','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','merge','where','filter','count','includeAll','include','Pause','mandatoryDispositionPause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','order','options','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','isNil','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName'];(function(_0x29510f,_0x3bf281){var _0x53cd1a=function(_0x16cd04){while(--_0x16cd04){_0x29510f['push'](_0x29510f['shift']());}};_0x53cd1a(++_0x3bf281);}(_0xbe99,0x1ca));var _0x9be9=function(_0x56eabf,_0x122249){_0x56eabf=_0x56eabf-0x0;var _0x5daa57=_0xbe99[_0x56eabf];return _0x5daa57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9be9('0x0'));var zipdir=require(_0x9be9('0x1'));var jsonpatch=require(_0x9be9('0x2'));var rp=require('request-promise');var moment=require(_0x9be9('0x3'));var BPromise=require(_0x9be9('0x4'));var Mustache=require(_0x9be9('0x5'));var util=require(_0x9be9('0x6'));var path=require(_0x9be9('0x7'));var sox=require(_0x9be9('0x8'));var csv=require('to-csv');var ejs=require(_0x9be9('0x9'));var fs=require('fs');var fs_extra=require(_0x9be9('0xa'));var _=require(_0x9be9('0xb'));var squel=require('squel');var crypto=require(_0x9be9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9be9('0xd'));var querystring=require(_0x9be9('0xe'));var Papa=require(_0x9be9('0xf'));var Redis=require(_0x9be9('0x10'));var authService=require(_0x9be9('0x11'));var qs=require(_0x9be9('0x12'));var as=require(_0x9be9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9be9('0x14'))(_0x9be9('0x15'));var utils=require(_0x9be9('0x16'));var config=require(_0x9be9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9be9('0x18'))['db'];config[_0x9be9('0x19')]=_['defaults'](config['redis'],{'host':_0x9be9('0x1a'),'port':0x18eb});var socket=require(_0x9be9('0x1b'))(new Redis(config[_0x9be9('0x19')]));require(_0x9be9('0x1c'))['register'](socket);var jayson=require(_0x9be9('0x1d'));var client=jayson[_0x9be9('0x1e')][_0x9be9('0x1f')]({'port':0x232c});var client9002=jayson[_0x9be9('0x1e')][_0x9be9('0x1f')]({'port':0x232a});var client9003=jayson[_0x9be9('0x1e')][_0x9be9('0x1f')]({'port':0x232b});var client9001=jayson[_0x9be9('0x1e')][_0x9be9('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x1d8e4b,_0x16717b,_0x43578e,_0x3b97de){return new BPromise(function(_0x21747e,_0x4fd6e3){var _0x48abe0=_0x3b97de||client;return _0x48abe0['request'](_0x1d8e4b,_0x43578e)['then'](function(_0x533dd0){logger[_0x9be9('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x16717b,_0x9be9('0x21'));logger['debug'](_0x9be9('0x22'),_0x16717b,_0x9be9('0x21'),JSON[_0x9be9('0x23')](_0x533dd0));if(_0x533dd0['error']){if(_0x533dd0[_0x9be9('0x24')][_0x9be9('0x25')]===0x1f4){logger[_0x9be9('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x16717b,_0x533dd0['error']['message']);return _0x4fd6e3(_0x533dd0[_0x9be9('0x24')]['message']);}logger[_0x9be9('0x24')](_0x9be9('0x26'),_0x16717b,_0x533dd0['error']['message']);return _0x21747e(_0x533dd0['error'][_0x9be9('0x27')]);}else{logger[_0x9be9('0x20')](_0x9be9('0x26'),_0x16717b,'request\x20sent');_0x21747e(_0x533dd0[_0x9be9('0x28')]['message']);}})[_0x9be9('0x29')](function(_0x3411b2){logger[_0x9be9('0x24')](_0x9be9('0x26'),_0x16717b,_0x3411b2);_0x4fd6e3(_0x3411b2);});});}function respondWithStatusCode(_0x445658,_0x42e925){_0x42e925=_0x42e925||0xcc;return function(_0x333072){if(_0x333072){return _0x445658[_0x9be9('0x2a')](_0x42e925);}return _0x445658[_0x9be9('0x2b')](_0x42e925)[_0x9be9('0x2c')]();};}function respondWithResult(_0x53bbdd,_0x3341e1){_0x3341e1=_0x3341e1||0xc8;return function(_0x3a1931){if(_0x3a1931){return _0x53bbdd[_0x9be9('0x2b')](_0x3341e1)[_0x9be9('0x2d')](_0x3a1931);}};}function respondWithFilteredResult(_0x2e50ac,_0x14e58e){return function(_0x22545d){if(_0x22545d){var _0x426d01=typeof _0x14e58e[_0x9be9('0x2e')]===_0x9be9('0x2f')&&typeof _0x14e58e[_0x9be9('0x30')]==='undefined';var _0xa0529b=_0x22545d['count'];var _0x327912=_0x426d01?0x0:_0x14e58e['offset'];var _0x19a5e7=_0x426d01?_0x22545d['count']:_0x14e58e['offset']+_0x14e58e[_0x9be9('0x30')];var _0x19dcf9;if(_0x19a5e7>=_0xa0529b){_0x19a5e7=_0xa0529b;_0x19dcf9=0xc8;}else{_0x19dcf9=0xce;}_0x2e50ac[_0x9be9('0x2b')](_0x19dcf9);return _0x2e50ac[_0x9be9('0x31')]('Content-Range',_0x327912+'-'+_0x19a5e7+'/'+_0xa0529b)[_0x9be9('0x2d')](_0x22545d);}return null;};}function patchUpdates(_0x2f73ea){return function(_0x323f31){try{jsonpatch[_0x9be9('0x32')](_0x323f31,_0x2f73ea,!![]);}catch(_0xe1123){return BPromise[_0x9be9('0x33')](_0xe1123);}return _0x323f31[_0x9be9('0x34')]();};}function saveUpdates(_0x4de1c3,_0x12544c){return function(_0x30f335){if(_0x30f335){return _0x30f335[_0x9be9('0x35')](_0x4de1c3)[_0x9be9('0x36')](function(_0x219912){return _0x219912;});}return null;};}function removeEntity(_0x3e7b14,_0x29a922){return function(_0x5427b2){if(_0x5427b2){return _0x5427b2[_0x9be9('0x37')]()[_0x9be9('0x36')](function(){var _0x53d07b=_0x5427b2[_0x9be9('0x38')]({'plain':!![]});var _0x5cbcb2=_0x9be9('0x39');return db[_0x9be9('0x3a')][_0x9be9('0x37')]({'where':{'type':_0x5cbcb2,'resourceId':_0x53d07b['id']}})[_0x9be9('0x36')](function(){return _0x5427b2;});})[_0x9be9('0x36')](function(){_0x3e7b14[_0x9be9('0x2b')](0xcc)[_0x9be9('0x2c')]();});}};}function handleEntityNotFound(_0x1409fd,_0xaa031c){return function(_0xe768f0){if(!_0xe768f0){_0x1409fd[_0x9be9('0x2a')](0x194);}return _0xe768f0;};}function handleError(_0x57ec15,_0x361090){_0x361090=_0x361090||0x1f4;return function(_0x306a37){logger[_0x9be9('0x24')](_0x306a37[_0x9be9('0x3b')]);if(_0x306a37['name']){delete _0x306a37[_0x9be9('0x3c')];}_0x57ec15[_0x9be9('0x2b')](_0x361090)[_0x9be9('0x3d')](_0x306a37);};}exports[_0x9be9('0x3e')]=function(_0x7335b1,_0x10236c){var _0x466211={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1761d5={},_0x3e6a7d={'count':0x0,'rows':[]};var _0x337556=_[_0x9be9('0x3f')](db[_0x9be9('0x40')][_0x9be9('0x41')],function(_0x58d1ee){return{'name':_0x58d1ee[_0x9be9('0x42')],'type':_0x58d1ee[_0x9be9('0x43')][_0x9be9('0x44')]};});_0x1761d5[_0x9be9('0x45')]=_[_0x9be9('0x3f')](_0x337556,_0x9be9('0x3c'));_0x1761d5[_0x9be9('0x46')]=_[_0x9be9('0x47')](_0x7335b1[_0x9be9('0x46')]);_0x1761d5['filters']=_[_0x9be9('0x48')](_0x1761d5[_0x9be9('0x45')],_0x1761d5['query']);_0x466211[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x1761d5['model'],qs[_0x9be9('0x4a')](_0x7335b1[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x466211['attributes']=_0x466211[_0x9be9('0x49')][_0x9be9('0x4b')]?_0x466211['attributes']:_0x1761d5[_0x9be9('0x45')];if(!_0x7335b1['query'][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x466211[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0x7335b1[_0x9be9('0x46')][_0x9be9('0x30')]);_0x466211[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x7335b1[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x466211['order']=qs[_0x9be9('0x4e')](_0x7335b1[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x466211['where']=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x7335b1['query'],_0x1761d5[_0x9be9('0x4f')]),_0x337556);if(_0x7335b1['query']['filter']){_0x466211['where']=_[_0x9be9('0x51')](_0x466211[_0x9be9('0x52')],{'$or':_['map'](_0x337556,function(_0x5bd22e){if(_0x5bd22e[_0x9be9('0x43')]!=='VIRTUAL'){var _0x135ac0={};_0x135ac0[_0x5bd22e[_0x9be9('0x3c')]]={'$like':'%'+_0x7335b1['query'][_0x9be9('0x53')]+'%'};return _0x135ac0;}})});}_0x466211=_['merge']({},_0x466211,_0x7335b1['options']);var _0x1ff482={'where':_0x466211[_0x9be9('0x52')]};return db[_0x9be9('0x40')][_0x9be9('0x54')](_0x1ff482)['then'](function(_0x3e23b2){_0x3e6a7d['count']=_0x3e23b2;if(_0x7335b1[_0x9be9('0x46')][_0x9be9('0x55')]){_0x466211[_0x9be9('0x56')]=[{'all':!![]}];}return db[_0x9be9('0x40')]['findAll'](_0x466211);})[_0x9be9('0x36')](function(_0x8436db){_0x3e6a7d['rows']=_0x8436db;return _0x3e6a7d;})['then'](respondWithFilteredResult(_0x10236c,_0x466211))['catch'](handleError(_0x10236c,null));};exports['show']=function(_0x3b2cea,_0x2d4abf){var _0x5b3cea={'raw':![],'where':{'id':_0x3b2cea['params']['id']},'include':[{'model':db[_0x9be9('0x57')],'as':_0x9be9('0x58')}]},_0x429153={};_0x429153[_0x9be9('0x45')]=_['keys'](db[_0x9be9('0x40')][_0x9be9('0x41')]);_0x429153['query']=_[_0x9be9('0x47')](_0x3b2cea[_0x9be9('0x46')]);_0x429153[_0x9be9('0x4f')]=_[_0x9be9('0x48')](_0x429153[_0x9be9('0x45')],_0x429153['query']);_0x5b3cea[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x429153[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x3b2cea[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x5b3cea['attributes']=_0x5b3cea[_0x9be9('0x49')]['length']?_0x5b3cea[_0x9be9('0x49')]:_0x429153[_0x9be9('0x45')];if(_0x3b2cea[_0x9be9('0x46')]['includeAll']){_0x5b3cea[_0x9be9('0x56')]=[{'all':!![]}];}_0x5b3cea=_['merge']({},_0x5b3cea,_0x3b2cea['options']);return db[_0x9be9('0x40')][_0x9be9('0x59')](_0x5b3cea)[_0x9be9('0x36')](handleEntityNotFound(_0x2d4abf,null))['then'](respondWithResult(_0x2d4abf,null))[_0x9be9('0x29')](handleError(_0x2d4abf,null));};exports[_0x9be9('0x5a')]=function(_0x216215,_0x57a84d){return db[_0x9be9('0x40')][_0x9be9('0x5a')](_0x216215[_0x9be9('0x5b')],{})[_0x9be9('0x36')](function(_0x194cf5){var _0x4006d1=_0x216215['user'][_0x9be9('0x38')]({'plain':!![]});if(!_0x4006d1)throw new Error(_0x9be9('0x5c'));if(_0x4006d1[_0x9be9('0x5d')]===_0x9be9('0x5e')){var _0x37c62f=_0x194cf5['get']({'plain':!![]});var _0x41be91=_0x9be9('0x39');return db[_0x9be9('0x5f')]['find']({'where':{'name':_0x41be91,'userProfileId':_0x4006d1[_0x9be9('0x60')]},'raw':!![]})[_0x9be9('0x36')](function(_0x467d24){if(_0x467d24&&_0x467d24[_0x9be9('0x61')]===0x0){return db[_0x9be9('0x3a')]['create']({'name':_0x37c62f['name'],'resourceId':_0x37c62f['id'],'type':_0x467d24[_0x9be9('0x3c')],'sectionId':_0x467d24['id']},{})[_0x9be9('0x36')](function(){return _0x194cf5;});}else{return _0x194cf5;}})[_0x9be9('0x29')](function(_0x2c7154){logger[_0x9be9('0x24')](_0x9be9('0x62'),_0x2c7154);throw _0x2c7154;});}return _0x194cf5;})[_0x9be9('0x36')](respondWithResult(_0x57a84d,0xc9))[_0x9be9('0x29')](handleError(_0x57a84d,null));};exports['update']=function(_0x51fdfd,_0x56f1ee){if(_0x51fdfd[_0x9be9('0x5b')]['id']){delete _0x51fdfd[_0x9be9('0x5b')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x51fdfd[_0x9be9('0x63')]['id']},'include':[{'model':db[_0x9be9('0x57')],'as':_0x9be9('0x58')}]})[_0x9be9('0x36')](handleEntityNotFound(_0x56f1ee,null))[_0x9be9('0x36')](saveUpdates(_0x51fdfd[_0x9be9('0x5b')],null))['then'](respondWithResult(_0x56f1ee,null))[_0x9be9('0x29')](handleError(_0x56f1ee,null));};exports[_0x9be9('0x37')]=function(_0x51875c,_0x35e2a2){return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x51875c[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x35e2a2,null))[_0x9be9('0x36')](removeEntity(_0x35e2a2,null))[_0x9be9('0x29')](handleError(_0x35e2a2,null));};exports[_0x9be9('0x64')]=function(_0x5aa45b,_0x529360){return db['ChatWebsite']['describe']()[_0x9be9('0x36')](respondWithResult(_0x529360,null))['catch'](handleError(_0x529360,null));};exports[_0x9be9('0x65')]=function(_0x3be552,_0x55e7da,_0x3a5e13){if(_0x3be552[_0x9be9('0x5b')]['id']){delete _0x3be552[_0x9be9('0x5b')]['id'];}return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x3be552[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x55e7da,null))[_0x9be9('0x36')](function(_0x21fd96){if(_0x21fd96){_0x3be552[_0x9be9('0x5b')][_0x9be9('0x66')]=_0x21fd96['id'];return db['Disposition'][_0x9be9('0x5a')](_0x3be552['body']);}})[_0x9be9('0x36')](respondWithResult(_0x55e7da,null))[_0x9be9('0x29')](handleError(_0x55e7da,null));};exports[_0x9be9('0x67')]=function(_0x2ad8fa,_0x289b10,_0x3a4404){var _0x718f49={'raw':![],'where':{}};var _0x32eb27={};var _0x5aeade={'count':0x0,'rows':[]};return db[_0x9be9('0x40')][_0x9be9('0x68')]({'where':{'id':_0x2ad8fa[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x289b10,null))[_0x9be9('0x36')](function(_0x16ebc2){if(_0x16ebc2){_0x32eb27[_0x9be9('0x45')]=_['keys'](db[_0x9be9('0x69')][_0x9be9('0x41')]);_0x32eb27['query']=_['keys'](_0x2ad8fa[_0x9be9('0x46')]);_0x32eb27[_0x9be9('0x4f')]=_['intersection'](_0x32eb27[_0x9be9('0x45')],_0x32eb27[_0x9be9('0x46')]);_0x718f49[_0x9be9('0x49')]=_['intersection'](_0x32eb27[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x2ad8fa[_0x9be9('0x46')]['fields']));_0x718f49[_0x9be9('0x49')]=_0x718f49['attributes'][_0x9be9('0x4b')]?_0x718f49['attributes']:_0x32eb27['model'];if(!_0x2ad8fa['query'][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x718f49[_0x9be9('0x30')]=qs['limit'](_0x2ad8fa['query'][_0x9be9('0x30')]);_0x718f49[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x2ad8fa[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x718f49[_0x9be9('0x6a')]=qs[_0x9be9('0x4e')](_0x2ad8fa[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x718f49[_0x9be9('0x52')]=qs['filters'](_[_0x9be9('0x50')](_0x2ad8fa[_0x9be9('0x46')],_0x32eb27[_0x9be9('0x4f')]));_0x718f49['where'][_0x9be9('0x66')]=_0x16ebc2['id'];if(_0x2ad8fa[_0x9be9('0x46')][_0x9be9('0x53')]){_0x718f49[_0x9be9('0x52')]=_['merge'](_0x718f49[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x718f49[_0x9be9('0x49')],function(_0x472912){var _0x446c44={};_0x446c44[_0x472912]={'$like':'%'+_0x2ad8fa['query'][_0x9be9('0x53')]+'%'};return _0x446c44;})});}_0x718f49=_[_0x9be9('0x51')]({},_0x718f49,_0x2ad8fa[_0x9be9('0x6b')]);return db[_0x9be9('0x69')][_0x9be9('0x54')]({'where':_0x718f49[_0x9be9('0x52')]})[_0x9be9('0x36')](function(_0x508efe){_0x5aeade[_0x9be9('0x54')]=_0x508efe;if(_0x2ad8fa['query'][_0x9be9('0x55')]){_0x718f49[_0x9be9('0x56')]=[{'all':!![]}];}return db[_0x9be9('0x69')][_0x9be9('0x6c')](_0x718f49);})[_0x9be9('0x36')](function(_0x24e8cc){_0x5aeade[_0x9be9('0x6d')]=_0x24e8cc;return _0x5aeade;});}})[_0x9be9('0x36')](respondWithFilteredResult(_0x289b10,_0x718f49))['catch'](handleError(_0x289b10,null));};exports[_0x9be9('0x6e')]=function(_0x574c32,_0x247ced,_0x389eec){return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x574c32[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x247ced,null))[_0x9be9('0x36')](function(_0x6e3625){if(_0x6e3625){return _0x6e3625[_0x9be9('0x6e')](_0x574c32['query'][_0x9be9('0x6f')]);}})[_0x9be9('0x36')](respondWithStatusCode(_0x247ced,null))['catch'](handleError(_0x247ced,null));};exports[_0x9be9('0x70')]=function(_0x568d58,_0x52ee11,_0x4888b9){if(_0x568d58[_0x9be9('0x5b')]['id']){delete _0x568d58['body']['id'];}return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x568d58['params']['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x52ee11,null))['then'](function(_0x493c44){if(_0x493c44){_0x568d58[_0x9be9('0x5b')]['ChatWebsiteId']=_0x493c44['id'];return db[_0x9be9('0x71')]['create'](_0x568d58[_0x9be9('0x5b')]);}})['then'](respondWithResult(_0x52ee11,null))[_0x9be9('0x29')](handleError(_0x52ee11,null));};exports[_0x9be9('0x72')]=function(_0x2a8fbf,_0x4c7191,_0x24410d){var _0x470078={'raw':![],'where':{}};var _0x16da8d={};var _0x3741a6={'count':0x0,'rows':[]};return db[_0x9be9('0x40')][_0x9be9('0x68')]({'where':{'id':_0x2a8fbf[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x4c7191,null))[_0x9be9('0x36')](function(_0x4aa35d){if(_0x4aa35d){_0x16da8d['model']=_[_0x9be9('0x47')](db[_0x9be9('0x71')]['rawAttributes']);_0x16da8d['query']=_[_0x9be9('0x47')](_0x2a8fbf[_0x9be9('0x46')]);_0x16da8d[_0x9be9('0x4f')]=_[_0x9be9('0x48')](_0x16da8d[_0x9be9('0x45')],_0x16da8d[_0x9be9('0x46')]);_0x470078[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x16da8d['model'],qs[_0x9be9('0x4a')](_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x470078[_0x9be9('0x49')]=_0x470078[_0x9be9('0x49')][_0x9be9('0x4b')]?_0x470078[_0x9be9('0x49')]:_0x16da8d[_0x9be9('0x45')];if(!_0x2a8fbf['query']['hasOwnProperty'](_0x9be9('0x4d'))){_0x470078[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x30')]);_0x470078['offset']=qs[_0x9be9('0x2e')](_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x470078[_0x9be9('0x6a')]=qs[_0x9be9('0x4e')](_0x2a8fbf['query']['sort']);_0x470078[_0x9be9('0x52')]=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x2a8fbf[_0x9be9('0x46')],_0x16da8d[_0x9be9('0x4f')]));_0x470078[_0x9be9('0x52')][_0x9be9('0x66')]=_0x4aa35d['id'];if(_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x53')]){_0x470078[_0x9be9('0x52')]=_[_0x9be9('0x51')](_0x470078[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x470078[_0x9be9('0x49')],function(_0x210269){var _0x1984b3={};_0x1984b3[_0x210269]={'$like':'%'+_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x53')]+'%'};return _0x1984b3;})});}_0x470078=_[_0x9be9('0x51')]({},_0x470078,_0x2a8fbf[_0x9be9('0x6b')]);return db[_0x9be9('0x71')][_0x9be9('0x54')]({'where':_0x470078[_0x9be9('0x52')]})[_0x9be9('0x36')](function(_0x4b2b7f){_0x3741a6['count']=_0x4b2b7f;if(_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x55')]){_0x470078['include']=[{'all':!![]}];}return db[_0x9be9('0x71')][_0x9be9('0x6c')](_0x470078);})[_0x9be9('0x36')](function(_0x1b741a){_0x3741a6[_0x9be9('0x6d')]=_0x1b741a;return _0x3741a6;});}})[_0x9be9('0x36')](respondWithFilteredResult(_0x4c7191,_0x470078))[_0x9be9('0x29')](handleError(_0x4c7191,null));};exports[_0x9be9('0x73')]=function(_0x3f7e0a,_0x1438e7,_0x1f1577){return db[_0x9be9('0x40')]['find']({'where':{'id':_0x3f7e0a[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x1438e7,null))[_0x9be9('0x36')](function(_0x1be6ec){if(_0x1be6ec){return _0x1be6ec[_0x9be9('0x73')](_0x3f7e0a[_0x9be9('0x46')][_0x9be9('0x6f')]);}})[_0x9be9('0x36')](respondWithStatusCode(_0x1438e7,null))[_0x9be9('0x29')](handleError(_0x1438e7,null));};exports['addLogo']=function(_0x45ce95,_0x3c1c12,_0x294282){_0x45ce95[_0x9be9('0x5b')]['sitepic']=_0x45ce95['file'][_0x9be9('0x74')];return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x45ce95['params']['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x3c1c12,null))[_0x9be9('0x36')](saveUpdates(_0x45ce95[_0x9be9('0x5b')],null))[_0x9be9('0x36')](respondWithResult(_0x3c1c12,null))[_0x9be9('0x29')](handleError(_0x3c1c12,null));};exports[_0x9be9('0x75')]=function(_0x928976,_0x10d329,_0x41d0d4){_0x928976[_0x9be9('0x5b')][_0x9be9('0x76')]=_0x928976[_0x9be9('0x77')][_0x9be9('0x74')];return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x928976[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x10d329,null))[_0x9be9('0x36')](saveUpdates(_0x928976[_0x9be9('0x5b')],null))[_0x9be9('0x36')](respondWithResult(_0x10d329,null))[_0x9be9('0x29')](handleError(_0x10d329,null));};exports[_0x9be9('0x78')]=function(_0x551ac5,_0x43313e,_0x57f1ee){_0x551ac5[_0x9be9('0x5b')][_0x9be9('0x79')]=_0x551ac5[_0x9be9('0x77')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x551ac5['params']['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x43313e,null))[_0x9be9('0x36')](saveUpdates(_0x551ac5[_0x9be9('0x5b')],null))[_0x9be9('0x36')](respondWithResult(_0x43313e,null))[_0x9be9('0x29')](handleError(_0x43313e,null));};exports[_0x9be9('0x7a')]=function(_0x49bf1c,_0x434130,_0x3e51e8){_0x49bf1c[_0x9be9('0x5b')][_0x9be9('0x7b')]=_0x49bf1c['file'][_0x9be9('0x74')];return db[_0x9be9('0x40')]['find']({'where':{'id':_0x49bf1c[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x434130,null))[_0x9be9('0x36')](saveUpdates(_0x49bf1c['body'],null))[_0x9be9('0x36')](respondWithResult(_0x434130,null))[_0x9be9('0x29')](handleError(_0x434130,null));};exports[_0x9be9('0x7c')]=function(_0x34e12b,_0x1102b6,_0x578184){var _0x1eee74=path[_0x9be9('0x7d')](config['root'],_0x9be9('0x7e'));var _0x330abf={'where':{'id':_0x34e12b['params']['id']},'attributes':['id',_0x9be9('0x7f')],'raw':!![]};var _0x8390a=![];return require(_0x9be9('0x80'))['getLicense']()[_0x9be9('0x36')](function(_0x970f16){if(_0x970f16){_0x8390a=_0x970f16['custom'];}})['then'](function(){return db[_0x9be9('0x40')]['find'](_0x330abf);})[_0x9be9('0x36')](handleEntityNotFound(_0x1102b6,null))[_0x9be9('0x36')](function(_0x10c4e2){if(_0x10c4e2){if(!_[_0x9be9('0x81')](_0x10c4e2['sitepic'])){if(fs['existsSync'](path[_0x9be9('0x7d')](config[_0x9be9('0x82')],'server/files/images/logos/',_0x10c4e2['sitepic']))&&_0x8390a){_0x1eee74=path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x83'),_0x10c4e2[_0x9be9('0x7f')]);}}return _0x1102b6['download'](_0x1eee74);}})[_0x9be9('0x29')](handleError(_0x1102b6,null));};exports[_0x9be9('0x84')]=function(_0x1c476c,_0x13bb07,_0x36ad45){var _0x1c16e5=path['join'](config[_0x9be9('0x82')],_0x9be9('0x85'));var _0x5d663e={'where':{'id':_0x1c476c[_0x9be9('0x63')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x9be9('0x40')][_0x9be9('0x59')](_0x5d663e)['then'](handleEntityNotFound(_0x13bb07,null))[_0x9be9('0x36')](function(_0x1d1c89){if(_0x1d1c89){if(!_[_0x9be9('0x81')](_0x1d1c89[_0x9be9('0x76')])){if(fs[_0x9be9('0x86')](path[_0x9be9('0x7d')](config[_0x9be9('0x82')],'server/files/images/avatars/',_0x1d1c89[_0x9be9('0x76')]))){_0x1c16e5=path[_0x9be9('0x7d')](config['root'],_0x9be9('0x87'),_0x1d1c89['agentAvatar']);}}return _0x13bb07[_0x9be9('0x88')](_0x1c16e5);}})[_0x9be9('0x29')](handleError(_0x13bb07,null));};exports[_0x9be9('0x89')]=function(_0x56cbac,_0x333bb7,_0x83de1b){var _0x7bf1dd=path['join'](config[_0x9be9('0x82')],_0x9be9('0x8a'));var _0x4565ef={'where':{'id':_0x56cbac[_0x9be9('0x63')]['id']},'attributes':['id',_0x9be9('0x79'),'showCustomerAvatar'],'raw':!![]};return db[_0x9be9('0x40')][_0x9be9('0x59')](_0x4565ef)['then'](handleEntityNotFound(_0x333bb7,null))[_0x9be9('0x36')](function(_0x26b777){if(_0x26b777){if(!_[_0x9be9('0x81')](_0x26b777[_0x9be9('0x79')])){if(fs[_0x9be9('0x86')](path['join'](config[_0x9be9('0x82')],_0x9be9('0x87'),_0x26b777[_0x9be9('0x79')]))&&_0x26b777[_0x9be9('0x8b')]){_0x7bf1dd=path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x87'),_0x26b777['customerAvatar']);}}return _0x333bb7[_0x9be9('0x88')](_0x7bf1dd);}})[_0x9be9('0x29')](handleError(_0x333bb7,null));};exports[_0x9be9('0x8c')]=function(_0x3515b1,_0x536c64,_0xcd9fbe){var _0xd1b779=path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x8d'));var _0x53486b={'where':{'id':_0x3515b1[_0x9be9('0x63')]['id']},'attributes':['id',_0x9be9('0x7b')],'raw':!![]};return db[_0x9be9('0x40')][_0x9be9('0x59')](_0x53486b)[_0x9be9('0x36')](handleEntityNotFound(_0x536c64,null))[_0x9be9('0x36')](function(_0x254642){if(_0x254642){if(!_[_0x9be9('0x81')](_0x254642[_0x9be9('0x7b')])){if(fs['existsSync'](path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x87'),_0x254642[_0x9be9('0x7b')]))){_0xd1b779=path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x87'),_0x254642[_0x9be9('0x7b')]);}}return _0x536c64[_0x9be9('0x88')](_0xd1b779);}})[_0x9be9('0x29')](handleError(_0x536c64,null));};exports['notify']=function(_0x97bb54,_0x2044b6,_0x2d8395){var _0x412c68=require(_0x9be9('0x8e'));var _0x48aa15=new _0x412c68();var _0x1960f8=_0x48aa15[_0x9be9('0x8f')](_0x97bb54[_0x9be9('0x90')][_0x9be9('0x91')])[_0x9be9('0x92')]();var _0x4c8b9b={'body':_0x97bb54[_0x9be9('0x5b')],'channel':_0x9be9('0x93')};var _0x27d101=[];var _0x43f4bb=[];var _0x286a4a={};var _0x39dca3=![];return db['CmContact'][_0x9be9('0x64')]()['then'](function(_0x264361){if(!_0x264361){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0x96'));}_0x27d101=_[_0x9be9('0x97')](_[_0x9be9('0x47')](_0x264361),[_0x9be9('0x98'),_0x9be9('0x99')]);_0x43f4bb=_[_0x9be9('0x97')](_[_0x9be9('0x47')](_0x264361),[_0x9be9('0x98'),_0x9be9('0x99'),_0x9be9('0x9a'),_0x9be9('0x9b')]);if(_0x97bb54[_0x9be9('0x5b')]['id']){delete _0x97bb54['body']['id'];}if(_[_0x9be9('0x81')](_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9c')])){throw new db['Sequelize']['ValidationError'](_0x9be9('0x9d'));}if(_[_0x9be9('0x81')](_0x97bb54[_0x9be9('0x5b')]['body'])||_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x5b')]===''){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0x9e'));}if(_['isNil'](_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9f')])){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0xa0')+_0x43f4bb);}if(!_[_0x9be9('0xa1')](_0x43f4bb,_0x97bb54['body'][_0x9be9('0x9f')])){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43f4bb);}_0x286a4a[_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9f')]]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9c')];})[_0x9be9('0x36')](function(){return db[_0x9be9('0x40')]['find']({'where':{'id':_0x97bb54[_0x9be9('0x63')]['id']},'include':[{'model':db[_0x9be9('0xa2')],'as':_0x9be9('0xa3'),'include':[{'model':db['CmContact'],'as':_0x9be9('0xa4'),'where':_0x286a4a,'limit':0x1,'order':[['updatedAt',_0x9be9('0xa5')]]}]},{'model':db[_0x9be9('0xa6')],'as':_0x9be9('0xa7')}]});})[_0x9be9('0x36')](handleEntityNotFound(_0x2044b6,null))['then'](function(_0x3564e6){if(_0x3564e6&&_0x3564e6[_0x9be9('0xa3')]){_0x4c8b9b[_0x9be9('0xa8')]=_0x3564e6;_0x4c8b9b[_0x9be9('0xa9')]=_0x3564e6[_0x9be9('0xa7')];_0x4c8b9b[_0x9be9('0xaa')]=_0x3564e6[_0x9be9('0xa3')];_0x4c8b9b[_0x9be9('0xa9')]=_['orderBy'](_0x4c8b9b['applications'],['priority'],[_0x9be9('0xab')]);if(_0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xa7')]){delete _0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xa7')];}if(_0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xa3')]&&_0x4c8b9b['account'][_0x9be9('0xa3')][_0x9be9('0xa4')][_0x9be9('0x4b')]){return _0x4c8b9b[_0x9be9('0xa8')]['List']['Contacts'][0x0];}var _0x327ddf=_['defaults'](_0x97bb54[_0x9be9('0x5b')],{'firstName':_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9c')],'ListId':_0x3564e6[_0x9be9('0x9b')]});_0x327ddf[_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9f')]]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9c')];return db['CmContact'][_0x9be9('0x5a')](_0x327ddf,{'fields':_0x27d101,'raw':!![]});}})[_0x9be9('0x36')](handleEntityNotFound(_0x2044b6,null))[_0x9be9('0x36')](function(_0x3b324d){_0x4c8b9b[_0x9be9('0xac')]=_0x3b324d;var _0xf2658a=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xad')];if(_0x97bb54[_0x9be9('0x90')][_0x9be9('0xae')]){_0xf2658a=_0x97bb54[_0x9be9('0x90')][_0x9be9('0xae')];}else if(_0x97bb54[_0x9be9('0x90')]['x-forwarded-for']){_0xf2658a=_[_0x9be9('0xaf')](_0x97bb54[_0x9be9('0x90')][_0x9be9('0xb0')][_0x9be9('0xb1')](','));}if(_0x3b324d){var _0x33da00={'ContactId':_0x3b324d['id'],'ChatWebsiteId':_0x97bb54[_0x9be9('0x63')]['id'],'from':(_0x3b324d[_0x9be9('0xb2')]||'')+'\x20'+(_0x3b324d[_0x9be9('0xb3')]||''),'customerIp':_0xf2658a,'customerPort':_0x97bb54[_0x9be9('0x90')][_0x9be9('0xb4')]?_0x97bb54[_0x9be9('0x90')][_0x9be9('0xb4')]:null,'referer':_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xb5')],'browserName':_0x1960f8[_0x9be9('0xb6')][_0x9be9('0x3c')]&&_0x1960f8[_0x9be9('0xb6')][_0x9be9('0xb7')]?util[_0x9be9('0xb8')](_0x9be9('0xb9'),_0x1960f8[_0x9be9('0xb6')][_0x9be9('0x3c')],_0x1960f8['browser'][_0x9be9('0xb7')]):'unknown','browserVersion':_0x1960f8['browser'][_0x9be9('0xb7')]||_0x9be9('0xba'),'osName':util[_0x9be9('0xb8')](_0x9be9('0xb9'),_0x1960f8['os'][_0x9be9('0x3c')],_0x1960f8['os'][_0x9be9('0xb7')]),'osVersion':_0x1960f8['os'][_0x9be9('0xb7')],'deviceModel':_0x1960f8['device']['model']&&_0x1960f8[_0x9be9('0xbb')][_0x9be9('0xbc')]?util[_0x9be9('0xb8')](_0x9be9('0xbd'),_0x1960f8[_0x9be9('0xbb')][_0x9be9('0x45')],_0x1960f8[_0x9be9('0xbb')][_0x9be9('0xbc')],_0x1960f8['device']['type']):null,'deviceVendor':_0x1960f8[_0x9be9('0xbb')][_0x9be9('0xbc')],'deviceType':_0x1960f8[_0x9be9('0xbb')][_0x9be9('0x43')],'formData':JSON['stringify'](_0x97bb54[_0x9be9('0x5b')])};var _0x54a08d={'ChatWebsiteId':_0x97bb54[_0x9be9('0x63')]['id'],'closed':![]};if(_0x97bb54[_0x9be9('0x5b')]['threadId']){_0x54a08d[_0x9be9('0xbe')]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xbe')];return db[_0x9be9('0xbf')][_0x9be9('0x59')]({'where':_0x54a08d})['then'](function(_0x33e021){if(_0x33e021){return[_0x33e021,![]];}_0x33da00[_0x9be9('0xbe')]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xbe')];_0x33da00[_0x9be9('0xc0')]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xc0')];return db[_0x9be9('0xbf')][_0x9be9('0x5a')](_0x33da00)[_0x9be9('0x36')](function(_0x5c0259){return[_0x5c0259,!![]];});});}_0x54a08d[_0x9be9('0xc1')]=_0x3b324d['id'];if(_0x97bb54['body']['interaction']&&_0x97bb54[_0x9be9('0x5b')]['interaction']['id']){_0x54a08d['id']=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xc2')]['id'];return db[_0x9be9('0xbf')][_0x9be9('0x59')]({'where':_0x54a08d})['then'](function(_0xb93d8a){if(_0xb93d8a){return[_0xb93d8a,![]];}return db[_0x9be9('0xbf')][_0x9be9('0x5a')](_0x33da00)[_0x9be9('0x36')](function(_0x557b24){return[_0x557b24,!![]];});});}return db['ChatInteraction']['create'](_0x33da00)[_0x9be9('0x36')](function(_0x4b3838){return[_0x4b3838,!![]];});}})[_0x9be9('0xc3')](function(_0x1ea19b,_0x3ec850){if(_0x1ea19b){_0x39dca3=_0x3ec850;if(!_0x3ec850){var _0x371ca1={'from':(_0x4c8b9b[_0x9be9('0xac')][_0x9be9('0xb2')]||'')+'\x20'+(_0x4c8b9b['contact'][_0x9be9('0xb3')]||'')};if(_0x97bb54[_0x9be9('0x5b')]['threadId']&&_0x97bb54[_0x9be9('0x5b')]['messageId']&&_0x97bb54['body']['threadId']!=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xc4')]){_0x371ca1[_0x9be9('0xbe')]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xc4')];}return _0x1ea19b[_0x9be9('0x35')](_0x371ca1);}else{return _0x1ea19b;}}})['then'](function(_0x24b7b2){_0x4c8b9b[_0x9be9('0xc2')]=_0x24b7b2[_0x9be9('0x38')]({'plain':!![]});_0x4c8b9b[_0x9be9('0xc2')][_0x9be9('0xc5')]=_0x39dca3;if(_0x4c8b9b[_0x9be9('0xc2')][_0x9be9('0xc5')]){if(_0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xc6')]){_0x4c8b9b[_0x9be9('0xa9')][_0x9be9('0xc7')]({'id':0x0,'priority':_0x4c8b9b['applications'][_0x9be9('0x4b')]+0x1,'app':_0x9be9('0xc8'),'appdata':'unmanaged','interval':_0x9be9('0xc9')});}}return db['ChatMessage'][_0x9be9('0x5a')]({'body':_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x5b')],'ChatWebsiteId':_0x97bb54[_0x9be9('0x63')]['id'],'ChatInteractionId':_0x24b7b2['id'],'direction':'in','ContactId':_0x4c8b9b[_0x9be9('0xac')]['id'],'AttachmentId':_0x97bb54[_0x9be9('0x5b')]['AttachmentId']});})[_0x9be9('0x36')](function(_0x3afa4d){_0x4c8b9b[_0x9be9('0x27')]=_0x3afa4d;if(_0x4c8b9b[_0x9be9('0xc2')][_0x9be9('0xca')]){return db[_0x9be9('0xcb')]['find']({'attributes':['id',_0x9be9('0x3c')],'where':{'id':_0x4c8b9b[_0x9be9('0xc2')][_0x9be9('0xca')]}})[_0x9be9('0x36')](function(_0x428f25){if(_0x428f25){_0x4c8b9b[_0x9be9('0xa9')][_0x9be9('0xcc')]({'id':0x0,'priority':0x0,'app':_0x9be9('0xcd'),'appdata':_0x428f25['name']+','+(_0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xce')]||0xa),'interval':_0x9be9('0xc9')});_0x4c8b9b[_0x9be9('0xcf')]=!![];}return respondWithRpcPromise(_0x9be9('0xd0'),'startRouting',_0x4c8b9b);});}return respondWithRpcPromise(_0x9be9('0xd0'),_0x9be9('0xd1'),_0x4c8b9b);})[_0x9be9('0x36')](function(_0x21cb8f){respondWithRpcPromise(_0x9be9('0xd2'),_0x9be9('0xd2'),{'event':_0x9be9('0xd3'),'message':_0x21cb8f},client9002);return _0x21cb8f;})[_0x9be9('0x36')](respondWithResult(_0x2044b6,null))[_0x9be9('0x29')](handleError(_0x2044b6,null));};exports[_0x9be9('0xd4')]=function(_0x4b205c,_0x2bd7d9,_0x42482e){var _0x12a6a4,_0x440cde,_0x3abb8f;var _0x23ddc9=[];var _0x5df8ed=[];var _0x411bb2={};var _0x2d9d85=_0x4b205c['files']||[];var _0x17cbfc=[];var _0x2a95db;return db[_0x9be9('0xd5')][_0x9be9('0x64')]()[_0x9be9('0x36')](function(_0x4537e5){if(!_0x4537e5){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0x96'));}_0x5df8ed=_[_0x9be9('0x97')](_[_0x9be9('0x47')](_0x4537e5),['createdAt',_0x9be9('0x99')]);_0x23ddc9=_[_0x9be9('0x97')](_[_0x9be9('0x47')](_0x4537e5),[_0x9be9('0x98'),_0x9be9('0x99'),_0x9be9('0x9a'),_0x9be9('0x9b')]);if(_0x4b205c[_0x9be9('0x5b')]['id']){delete _0x4b205c[_0x9be9('0x5b')]['id'];}if(_['isNil'](_0x4b205c['body'][_0x9be9('0x9c')])){throw _0x2bd7d9[_0x9be9('0x2b')](0x1f4)[_0x9be9('0x3d')](new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0x9d')));}if(_[_0x9be9('0x81')](_0x4b205c[_0x9be9('0x5b')]['body'])||_0x4b205c[_0x9be9('0x5b')][_0x9be9('0x5b')]===''){throw _0x2bd7d9[_0x9be9('0x2b')](0x1f4)[_0x9be9('0x3d')](new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x9be9('0x81')](_0x4b205c[_0x9be9('0x5b')][_0x9be9('0xd6')])){throw _0x2bd7d9[_0x9be9('0x2b')](0x1f4)['send'](new db[(_0x9be9('0x94'))]['ValidationError'](_0x9be9('0xd7')+_0x23ddc9));}if(!_[_0x9be9('0xa1')](_0x23ddc9,_0x4b205c[_0x9be9('0x5b')][_0x9be9('0xd6')])){throw _0x2bd7d9[_0x9be9('0x2b')](0x1f4)[_0x9be9('0x3d')](new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0xd8')+_0x23ddc9));}_0x411bb2[_0x4b205c['body'][_0x9be9('0xd6')]]=_0x4b205c[_0x9be9('0x5b')][_0x9be9('0x9c')];})[_0x9be9('0x36')](function(){return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x4b205c[_0x9be9('0x63')]['id']},'include':[{'model':db[_0x9be9('0xa2')],'as':_0x9be9('0xa3')},{'model':db[_0x9be9('0xd9')],'as':_0x9be9('0xd9')}]});})['then'](handleEntityNotFound(_0x2bd7d9,null))[_0x9be9('0x36')](function(_0x27e1dc){if(_0x27e1dc&&_0x27e1dc[_0x9be9('0xa3')]){_0x440cde=_0x27e1dc;var _0x165a41=_[_0x9be9('0xda')](_0x4b205c[_0x9be9('0x5b')],{'firstName':_0x4b205c[_0x9be9('0x5b')]['from'],'phone':_0x4b205c[_0x9be9('0x5b')]['from'],'ListId':_0x27e1dc[_0x9be9('0x9b')]});_0x165a41[_0x4b205c['body'][_0x9be9('0xd6')]]=_0x4b205c[_0x9be9('0x5b')]['from'];return db[_0x9be9('0xd5')][_0x9be9('0xdb')]({'where':_0x411bb2,'defaults':_0x165a41});}})[_0x9be9('0xc3')](function(_0x1a9bf4){if(_0x1a9bf4){_0x3abb8f=_0x1a9bf4;var _0x4e306c=fs[_0x9be9('0xdc')](path[_0x9be9('0x7d')](config['root'],_0x9be9('0xdd')),_0x9be9('0xde'));var _0x269f14=ejs['render'](_0x4e306c,{'body':_[_0x9be9('0xdf')](_0x4b205c[_0x9be9('0x5b')]['body']),'bodyTitle':_0x440cde['offlineMessageBody']});return db[_0x9be9('0xe0')]['create']({'body':_0x269f14,'ContactId':_0x1a9bf4['id'],'ChatWebsiteId':_0x440cde['id']});}})['then'](function(_0x3ccc1e){_0x2a95db=_0x3ccc1e;if(_0x2d9d85[_0x9be9('0x4b')]){var _0xa597fe=_0x2d9d85[_0x9be9('0x3f')](function(_0x1aa1d7){return{'name':_0x1aa1d7[_0x9be9('0xe1')],'basename':_0x1aa1d7['filename'],'type':_0x1aa1d7[_0x9be9('0xe2')],'ChatOfflineMessageId':_0x3ccc1e['id']};});_0x17cbfc=_0xa597fe[_0x9be9('0x3f')](_0x235a78=>{var _0x356e80={'filename':_0x235a78[_0x9be9('0x3c')],'path':path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0xe3'),_0x9be9('0xe4'),_0x9be9('0xe5'),_0x9be9('0xe6'),_0x235a78[_0x9be9('0xe7')])};return _0x356e80;});if(!_0x440cde[_0x9be9('0xe8')]){return db[_0x9be9('0xe9')]['transaction'](function(_0xfb86fd){return db[_0x9be9('0xea')][_0x9be9('0xeb')](_0xa597fe,{'transaction':_0xfb86fd});});}}})[_0x9be9('0x36')](function(){if(_0x2a95db){_0x12a6a4=_0x2a95db;return db[_0x9be9('0xd9')][_0x9be9('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0x9be9('0xec')],'as':'Smtp','raw':!![]}]});}})[_0x9be9('0x36')](function(_0x23e95f){if(_0x23e95f&&_0x23e95f['Smtp']&&_0x440cde[_0x9be9('0xed')]&&_0x440cde[_0x9be9('0xee')]){var _0x4a2fbb={'tls':{'rejectUnauthorized':![]}};if(_0x23e95f[_0x9be9('0xef')][_0x9be9('0xf0')]){_0x4a2fbb['service']=_0x23e95f['Smtp'][_0x9be9('0xf0')];}else{_0x4a2fbb[_0x9be9('0xf1')]=_0x23e95f[_0x9be9('0xef')][_0x9be9('0xf1')];_0x4a2fbb['port']=_0x23e95f['Smtp'][_0x9be9('0xf2')];_0x4a2fbb[_0x9be9('0xf3')]=_0x23e95f[_0x9be9('0xef')][_0x9be9('0xf3')];}if(_0x23e95f[_0x9be9('0xef')]['authentication']){_0x4a2fbb[_0x9be9('0xf4')]={'user':_0x23e95f[_0x9be9('0xef')]['user'],'pass':_0x23e95f['Smtp'][_0x9be9('0xf5')]};}return respondWithRpcPromise('SendMail',_0x9be9('0xf6'),{'account':_0x4a2fbb,'message':{'from':util['format'](_0x9be9('0xf7'),_0x23e95f[_0x9be9('0x3c')],_0x23e95f[_0x9be9('0xf8')]||_0x23e95f['Smtp'][_0x9be9('0x5e')]),'to':_0x440cde[_0x9be9('0xee')],'subject':_0x440cde['offlineMessageSubject'],'html':_0x12a6a4[_0x9be9('0x5b')],'attachments':_0x17cbfc}},client9003)[_0x9be9('0x36')](function(){return _0x12a6a4;})[_0x9be9('0x29')](function(_0x530b58){console[_0x9be9('0x24')](_0x530b58);});}})[_0x9be9('0x36')](function(){if(_0x440cde&&_0x440cde[_0x9be9('0xe8')]&&_0x440cde['MailAccountId']){var _0x1d9c1c=[];if(_0x2d9d85[_0x9be9('0x4b')]){_0x1d9c1c=_0x2d9d85[_0x9be9('0x3f')](function(_0x394a4e){return{'name':_0x394a4e[_0x9be9('0xe1')],'basename':_0x394a4e[_0x9be9('0x74')],'type':_0x394a4e[_0x9be9('0xe2')],'ChatOfflineMessageId':_0x2a95db['id']};});}var _0x4c6964;if(!_[_0x9be9('0x81')](_0x440cde[_0x9be9('0xf9')])){var _0x25f6c7=_[_0x9be9('0x3f')](_0x4b205c['body'],function(_0x56e090){return _0x56e090;});var _0x2db9e3=_[_0x9be9('0xfa')](_0x25f6c7)[0x0];var _0x1f8b2f=_['mapValues'](_0x2db9e3,function(_0x2f95b8){return _0x2f95b8;});_0x4c6964=_0x1f8b2f[0x1][_0x440cde['subjectOffline']];}var _0x30ddbf={'from':_0x3abb8f['email'],'firstName':_0x3abb8f[_0x9be9('0xb2')],'lastName':_0x3abb8f[_0x9be9('0xb3')],'mapKey':'email','message':{'from':_0x3abb8f[_0x9be9('0xf8')],'to':_0x440cde['MailAccount'][_0x9be9('0xf8')],'cc':'','subject':_['isNil'](_0x4c6964)?_0x440cde[_0x9be9('0xfb')]:_0x4c6964,'messageId':'','sentAt':new Date(),'attach':_0x1d9c1c['length'],'attachments':_0x1d9c1c,'originChannel':'Chat','ChatWebsiteId':_0x440cde['id'],'ChatOfflineMessageId':_0x12a6a4['id'],'originTo':_0x440cde[_0x9be9('0xd9')]['email']},'body':_0x12a6a4['body']};var _0x3d485={'account':{'id':_0x440cde[_0x9be9('0xfc')]},'body':_0x30ddbf,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x9be9('0xfd'),_0x9be9('0xfe'),_0x3d485,client9001)['then'](function(){return _0x12a6a4;})['catch'](function(_0x318006){console[_0x9be9('0x24')](_0x318006);});}return;})['then'](function(){if(_0x12a6a4){return _0x12a6a4;}})[_0x9be9('0x36')](respondWithResult(_0x2bd7d9,null))[_0x9be9('0x29')](function(_0x5a852b){console['error']('catch',_0x5a852b);for(var _0x5e6295 of _0x2d9d85){var _0x2decf2=path['join'](config[_0x9be9('0x82')],_0x9be9('0xe3'),_0x9be9('0xe4'),_0x9be9('0xe5'),'offline-chat',_0x5e6295['filename']);fs_extra[_0x9be9('0xff')](_0x2decf2)[_0x9be9('0x29')](function(_0x4db58e){console[_0x9be9('0x24')](_0x9be9('0x100'),_0x2decf2,_0x4db58e);});}});};exports['addInteraction']=function(_0x18ca89,_0x51c59b,_0x25dcc0){return db['ChatInteraction'][_0x9be9('0x59')]({'where':{'id':_0x18ca89[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x51c59b,null))[_0x9be9('0x36')](function(_0x4102fb){if(_0x4102fb){return _0x4102fb[_0x9be9('0x101')](_0x18ca89[_0x9be9('0x5b')]['ids'],_[_0x9be9('0x102')](_0x18ca89[_0x9be9('0x5b')],[_0x9be9('0x6f'),'id'])||{});}})[_0x9be9('0x36')](respondWithResult(_0x51c59b,null))[_0x9be9('0x29')](handleError(_0x51c59b,null));};exports[_0x9be9('0x103')]=function(_0x2f2009,_0x8dd88,_0x2abd16){var _0x4b66ba={'raw':![],'where':{}};var _0x272393={};var _0x35d55b={'count':0x0,'rows':[]};return db[_0x9be9('0x40')]['findOne']({'where':{'id':_0x2f2009[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x8dd88,null))[_0x9be9('0x36')](function(_0x489d08){if(_0x489d08){_0x272393[_0x9be9('0x45')]=_[_0x9be9('0x47')](db[_0x9be9('0xbf')]['rawAttributes']);_0x272393[_0x9be9('0x46')]=_['keys'](_0x2f2009[_0x9be9('0x46')]);_0x272393[_0x9be9('0x4f')]=_['intersection'](_0x272393[_0x9be9('0x45')],_0x272393[_0x9be9('0x46')]);_0x4b66ba[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x272393[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x2f2009[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x4b66ba[_0x9be9('0x49')]=_0x4b66ba[_0x9be9('0x49')]['length']?_0x4b66ba[_0x9be9('0x49')]:_0x272393[_0x9be9('0x45')];if(!_0x2f2009[_0x9be9('0x46')]['hasOwnProperty']('nolimit')){_0x4b66ba[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0x2f2009[_0x9be9('0x46')][_0x9be9('0x30')]);_0x4b66ba[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x2f2009[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x4b66ba['order']=qs['sort'](_0x2f2009[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x4b66ba['where']=qs['filters'](_[_0x9be9('0x50')](_0x2f2009[_0x9be9('0x46')],_0x272393[_0x9be9('0x4f')]));_0x4b66ba[_0x9be9('0x52')][_0x9be9('0x66')]=_0x489d08['id'];if(_0x2f2009[_0x9be9('0x46')]['filter']){_0x4b66ba[_0x9be9('0x52')]=_['merge'](_0x4b66ba[_0x9be9('0x52')],{'$or':_['map'](_0x4b66ba[_0x9be9('0x49')],function(_0x4a492e){var _0x23c966={};_0x23c966[_0x4a492e]={'$like':'%'+_0x2f2009['query'][_0x9be9('0x53')]+'%'};return _0x23c966;})});}_0x4b66ba=_[_0x9be9('0x51')]({},_0x4b66ba,_0x2f2009[_0x9be9('0x6b')]);return db['ChatInteraction']['count']({'where':_0x4b66ba[_0x9be9('0x52')]})['then'](function(_0x524f59){_0x35d55b[_0x9be9('0x54')]=_0x524f59;if(_0x2f2009['query'][_0x9be9('0x55')]){_0x4b66ba['include']=[{'model':db['CmContact'],'as':_0x9be9('0x104'),'required':![]},{'model':db['User'],'as':_0x9be9('0x105'),'attributes':[_0x9be9('0x3c'),_0x9be9('0x106'),_0x9be9('0x107')],'required':![]},{'model':db[_0x9be9('0x108')],'as':_0x9be9('0x109'),'attributes':['id',_0x9be9('0x3c'),'color'],'where':_0x2f2009[_0x9be9('0x46')][_0x9be9('0x10a')]?{'id':_0x2f2009[_0x9be9('0x46')][_0x9be9('0x10a')]}:undefined,'required':_0x2f2009['query'][_0x9be9('0x10a')]?!![]:![]}];}return db['ChatInteraction'][_0x9be9('0x6c')](_0x4b66ba);})['then'](function(_0x3eccfc){_0x35d55b[_0x9be9('0x6d')]=_0x3eccfc;return _0x35d55b;});}})['then'](respondWithFilteredResult(_0x8dd88,_0x4b66ba))[_0x9be9('0x29')](handleError(_0x8dd88,null));};function iftimePromise(_0x224218,_0x11cb0b){return respondWithRpcPromise(_0x9be9('0x10b'),_0x9be9('0x10c'),{'command':_0x11cb0b['timezone']?util[_0x9be9('0xb8')]('iftime\x20%s,%s',_0x224218[_0x9be9('0x10d')],_0x11cb0b['timezone']):util['format'](_0x9be9('0x10e'),_0x224218['interval'])},client9002)[_0x9be9('0x36')](function(_0x5e4964){var _0x3e56a1=_0x5e4964&&_0x5e4964[_0x9be9('0x10f')](_0x9be9('0x110'))>=0x0?!![]:![];logger[_0x9be9('0x20')](_0x9be9('0x111'),_0x11cb0b['id'],_0x224218['id'],_0x224218[_0x9be9('0x10d')],_0x3e56a1?'ONLINE':_0x9be9('0x112'),_0x11cb0b[_0x9be9('0x113')]?_0x11cb0b[_0x9be9('0x113')]:_0x9be9('0x114'));return _0x3e56a1;})[_0x9be9('0x29')](function(_0x11b754){logger['error'](_0x9be9('0x111'),_0x11cb0b['id'],_0x224218['id'],_0x224218[_0x9be9('0x10d')],util[_0x9be9('0x115')](_0x11b754,{'showHidden':![],'depth':null}),_0x11cb0b['timezone']?_0x11cb0b[_0x9be9('0x113')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x50bd8c,_0x303523,_0x23f8db){var _0x9b2508=0x0;var _0x3e2c04=0x0;var _0x32b68e=![];var _0x141c12;var _0x419129;return db[_0x9be9('0x40')]['find']({'where':{'id':_0x50bd8c['params']['id']},'include':[{'model':db[_0x9be9('0x116')],'as':_0x9be9('0x116'),'include':[{'model':db[_0x9be9('0x116')],'as':'Intervals','attributes':['id',_0x9be9('0x10d')],'raw':!![]}]}]})[_0x9be9('0x36')](handleEntityNotFound(_0x303523,null))[_0x9be9('0x36')](function(_0x475f40){if(_0x475f40){_0x141c12=_0x475f40;return _0x475f40[_0x9be9('0x117')]({'raw':!![]});}})[_0x9be9('0x36')](function(_0x3b29e4){if(_0x141c12){if(_0x3b29e4){_0x419129=_0x3b29e4;}}return require(_0x9be9('0x80'))[_0x9be9('0x118')]();})[_0x9be9('0x36')](function(_0x817346){if(_0x817346){_0x3e2c04=_0x817346[_0x9be9('0x119')];_0x32b68e=_0x817346[_0x9be9('0x11a')];}})[_0x9be9('0x36')](function(){return db[_0x9be9('0xbf')][_0x9be9('0x54')]({'where':{'closed':![]}});})[_0x9be9('0x36')](function(_0x495eb9){_0x9b2508=_0x495eb9;if(_0x3e2c04&&_0x495eb9>_0x3e2c04){return db[_0x9be9('0x11b')][_0x9be9('0x68')]({'where':{'id':0x1}})[_0x9be9('0x36')](function(_0x5192f4){if(_0x5192f4){_0x5192f4[_0x9be9('0x11c')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x141c12[_0x9be9('0x116')]&&_0x141c12[_0x9be9('0x116')][_0x9be9('0x11d')]){var _0xe7e464=[];for(var _0x333079=0x0;_0x333079<_0x141c12[_0x9be9('0x116')]['Intervals'][_0x9be9('0x4b')];_0x333079++){var _0x16a461=_0x141c12[_0x9be9('0x116')][_0x9be9('0x11d')][_0x333079][_0x9be9('0x38')]({'plain':!![]});_0xe7e464[_0x9be9('0xc7')](iftimePromise(_0x16a461,_0x141c12));}return BPromise[_0x9be9('0x11e')](_0xe7e464)[_0x9be9('0x36')](function(_0x459b46){return _[_0x9be9('0x11f')](_0x459b46);});}else{return!![];}})[_0x9be9('0x36')](function(_0x1c0bc9){var _0x2d9db5=fs[_0x9be9('0xdc')](path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x120')),_0x9be9('0xde'));var _0x4bfc93={'remote':_0x141c12[_0x9be9('0x121')],'query':querystring['stringify'](_[_0x9be9('0x51')](_0x141c12['get']({'plain':!![]}),{'customerIp':_0x50bd8c[_0x9be9('0x90')][_0x9be9('0xb0')]||_0x50bd8c[_0x9be9('0x90')][_0x9be9('0x122')]||_0x50bd8c[_0x9be9('0x123')][_0x9be9('0x124')]||_0x50bd8c['ip'],'referer':_0x50bd8c[_0x9be9('0x90')]['referer'],'openedInteractions':_0x9b2508,'maxInteractions':_0x3e2c04,'virtual':_0x32b68e[_0x9be9('0x119')],'online':_0x1c0bc9,'custom':_0x32b68e}))['replace'](/'/g,'\x5c\x27')};_0x303523['send'](ejs[_0x9be9('0x125')](Mustache[_0x9be9('0x125')](_0x2d9db5,_0x4bfc93),{'proactiveActions':_0x419129,'alignment':_0x141c12[_0x9be9('0x126')],'verticalAlignment':_0x141c12['verticalAlignment'],'div_color':_0x141c12[_0x9be9('0x127')],'text_color':_0x141c12[_0x9be9('0x128')],'button_color':_0x141c12[_0x9be9('0x129')],'background_color':_0x141c12[_0x9be9('0x12a')]}));})[_0x9be9('0x29')](handleError(_0x303523,null));};exports[_0x9be9('0x12b')]=function(_0x23c267,_0x4a4044,_0x47662f){return db[_0x9be9('0x40')][_0x9be9('0x68')]({'where':{'id':_0x23c267[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x4a4044,null))[_0x9be9('0x36')](function(_0x1a9ed9){if(_0x1a9ed9){return db[_0x9be9('0xe9')][_0x9be9('0x12c')](function(_0x5f1155){return db[_0x9be9('0xa6')]['destroy']({'where':{'ChatWebsiteId':_0x23c267[_0x9be9('0x63')]['id']},'transaction':_0x5f1155})[_0x9be9('0x36')](function(_0x48c087){var _0x333180=_['map'](_0x23c267['body'],function(_0x180458){_0x180458[_0x9be9('0x66')]=_0x23c267[_0x9be9('0x63')]['id'];return _0x180458;});return db[_0x9be9('0xa6')][_0x9be9('0xeb')](_0x333180,{'transaction':_0x5f1155});});})['then'](function(){return db[_0x9be9('0xa6')][_0x9be9('0x12d')]({'where':{'ChatWebsiteId':_0x23c267[_0x9be9('0x63')]['id']},'order':_0x9be9('0x12e')});});}})[_0x9be9('0x36')](respondWithResult(_0x4a4044,null))['catch'](handleError(_0x4a4044,null));};exports[_0x9be9('0x12f')]=function(_0x110176,_0x5ad96f,_0x5f2e52){var _0x3d900c={};var _0x2de644={};var _0x2b493c;var _0x511b77;return db[_0x9be9('0x40')]['findOne']({'where':{'id':_0x110176[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x5ad96f,null))[_0x9be9('0x36')](function(_0x1bb6d8){if(_0x1bb6d8){_0x2b493c=_0x1bb6d8;_0x2de644[_0x9be9('0x45')]=_[_0x9be9('0x47')](db[_0x9be9('0xa6')][_0x9be9('0x41')]);_0x2de644[_0x9be9('0x46')]=_['keys'](_0x110176[_0x9be9('0x46')]);_0x2de644['filters']=_[_0x9be9('0x48')](_0x2de644[_0x9be9('0x45')],_0x2de644[_0x9be9('0x46')]);_0x3d900c[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x2de644[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x110176['query']['fields']));_0x3d900c['attributes']=_0x3d900c[_0x9be9('0x49')]['length']?_0x3d900c[_0x9be9('0x49')]:_0x2de644['model'];_0x3d900c['order']=qs[_0x9be9('0x4e')](_0x110176[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x3d900c[_0x9be9('0x52')]=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x110176[_0x9be9('0x46')],_0x2de644[_0x9be9('0x4f')]));if(_0x110176[_0x9be9('0x46')][_0x9be9('0x53')]){_0x3d900c[_0x9be9('0x52')]=_[_0x9be9('0x51')](_0x3d900c['where'],{'$or':_[_0x9be9('0x3f')](_0x3d900c[_0x9be9('0x49')],function(_0x4e2708){var _0x23ec28={};_0x23ec28[_0x4e2708]={'$like':'%'+_0x110176[_0x9be9('0x46')][_0x9be9('0x53')]+'%'};return _0x23ec28;})});}_0x3d900c=_['merge']({},_0x3d900c,_0x110176['options']);return _0x2b493c['getApplications'](_0x3d900c);}})['then'](function(_0x4fc2f1){if(_0x4fc2f1){_0x511b77=_0x4fc2f1[_0x9be9('0x4b')];if(!_0x110176[_0x9be9('0x46')][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x3d900c['limit']=qs[_0x9be9('0x30')](_0x110176[_0x9be9('0x46')][_0x9be9('0x30')]);_0x3d900c['offset']=qs[_0x9be9('0x2e')](_0x110176[_0x9be9('0x46')]['offset']);}return _0x2b493c[_0x9be9('0x12f')](_0x3d900c);}})['then'](function(_0x3e666b){if(_0x3e666b){return _0x3e666b?{'count':_0x511b77,'rows':_0x3e666b}:null;}})[_0x9be9('0x36')](respondWithResult(_0x5ad96f,null))['catch'](handleError(_0x5ad96f,null));};exports['addProactiveActions']=function(_0x4af8f5,_0xa65e23,_0xd7ecdc){return db[_0x9be9('0x130')]['find']({'where':{'id':_0x4af8f5['params']['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0xa65e23,null))[_0x9be9('0x36')](function(_0x516ae4){if(_0x516ae4){return _0x516ae4[_0x9be9('0x131')](_0x4af8f5[_0x9be9('0x5b')][_0x9be9('0x6f')],_[_0x9be9('0x102')](_0x4af8f5[_0x9be9('0x5b')],[_0x9be9('0x6f'),'id'])||{});}})[_0x9be9('0x36')](respondWithResult(_0xa65e23,null))[_0x9be9('0x29')](handleError(_0xa65e23,null));};exports[_0x9be9('0x117')]=function(_0x2784b8,_0xc7ac46,_0x17cfbe){var _0x358ceb={};var _0x168a0e={};var _0x397200;var _0x144436;return db['ChatWebsite']['findOne']({'where':{'id':_0x2784b8[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0xc7ac46,null))[_0x9be9('0x36')](function(_0x4b4236){if(_0x4b4236){_0x397200=_0x4b4236;_0x168a0e[_0x9be9('0x45')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x168a0e['query']=_['keys'](_0x2784b8[_0x9be9('0x46')]);_0x168a0e['filters']=_[_0x9be9('0x48')](_0x168a0e['model'],_0x168a0e[_0x9be9('0x46')]);_0x358ceb['attributes']=_[_0x9be9('0x48')](_0x168a0e[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x2784b8[_0x9be9('0x46')]['fields']));_0x358ceb[_0x9be9('0x49')]=_0x358ceb[_0x9be9('0x49')][_0x9be9('0x4b')]?_0x358ceb[_0x9be9('0x49')]:_0x168a0e[_0x9be9('0x45')];_0x358ceb[_0x9be9('0x6a')]=qs[_0x9be9('0x4e')](_0x2784b8[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x358ceb[_0x9be9('0x52')]=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x2784b8[_0x9be9('0x46')],_0x168a0e[_0x9be9('0x4f')]));if(_0x2784b8[_0x9be9('0x46')][_0x9be9('0x53')]){_0x358ceb[_0x9be9('0x52')]=_[_0x9be9('0x51')](_0x358ceb[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x358ceb['attributes'],function(_0xd7d520){var _0x678d71={};_0x678d71[_0xd7d520]={'$like':'%'+_0x2784b8[_0x9be9('0x46')]['filter']+'%'};return _0x678d71;})});}_0x358ceb=_[_0x9be9('0x51')]({},_0x358ceb,_0x2784b8[_0x9be9('0x6b')]);return _0x397200[_0x9be9('0x117')](_0x358ceb);}})[_0x9be9('0x36')](function(_0x46571a){if(_0x46571a){_0x144436=_0x46571a[_0x9be9('0x4b')];if(!_0x2784b8[_0x9be9('0x46')][_0x9be9('0x4c')]('nolimit')){_0x358ceb[_0x9be9('0x30')]=qs['limit'](_0x2784b8[_0x9be9('0x46')]['limit']);_0x358ceb[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x2784b8['query'][_0x9be9('0x2e')]);}return _0x397200[_0x9be9('0x117')](_0x358ceb);}})[_0x9be9('0x36')](function(_0xb44127){if(_0xb44127){return _0xb44127?{'count':_0x144436,'rows':_0xb44127}:null;}})[_0x9be9('0x36')](respondWithResult(_0xc7ac46,null))[_0x9be9('0x29')](handleError(_0xc7ac46,null));};exports[_0x9be9('0x132')]=function(_0x124044,_0x18ac58,_0x1cba61){var _0x512c59=_0x124044['query'][_0x9be9('0x133')]===_0x9be9('0x134')?'offlineForm':_0x9be9('0x135');return db['ChatWebsite']['find']({'attributes':['id',_0x512c59],'where':{'id':_0x124044[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x18ac58,null))['then'](function(_0x1eb3bc){if(_0x1eb3bc){var _0x4fd12b=_0x1eb3bc[_0x512c59];var _0x3fd53e=_0x4fd12b&&_0x4fd12b['items']?_0x4fd12b['items']:[];_0x18ac58[_0x9be9('0x3d')]({'fromKey':_[_0x9be9('0x81')](_0x4fd12b[_0x9be9('0x136')])?undefined:_0x4fd12b[_0x9be9('0x136')],'count':_0x3fd53e[_0x9be9('0x4b')],'rows':_0x3fd53e});}})[_0x9be9('0x29')](handleError(_0x18ac58,null));};exports[_0x9be9('0x137')]=function(_0x320ef0,_0x26184e,_0x5a4af6){var _0x345cda={'raw':![],'where':{}};var _0x280522={};var _0x293e45={'count':0x0,'rows':[]};return db[_0x9be9('0x40')]['findOne']({'where':{'id':_0x320ef0[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x26184e,null))[_0x9be9('0x36')](function(_0x286623){if(_0x286623){_0x280522['model']=_[_0x9be9('0x47')](db[_0x9be9('0xe0')][_0x9be9('0x41')]);_0x280522[_0x9be9('0x46')]=_[_0x9be9('0x47')](_0x320ef0[_0x9be9('0x46')]);_0x280522[_0x9be9('0x4f')]=_['intersection'](_0x280522[_0x9be9('0x45')],_0x280522[_0x9be9('0x46')]);_0x345cda[_0x9be9('0x49')]=_['intersection'](_0x280522[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x320ef0[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x345cda[_0x9be9('0x49')]=_0x345cda['attributes'][_0x9be9('0x4b')]?_0x345cda[_0x9be9('0x49')]:_0x280522[_0x9be9('0x45')];if(!_0x320ef0['query'][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x345cda[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0x320ef0['query'][_0x9be9('0x30')]);_0x345cda[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x320ef0[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x345cda[_0x9be9('0x6a')]=qs[_0x9be9('0x4e')](_0x320ef0[_0x9be9('0x46')]['sort']);_0x345cda['where']=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x320ef0['query'],_0x280522[_0x9be9('0x4f')]));_0x345cda[_0x9be9('0x52')][_0x9be9('0x66')]=_0x286623['id'];if(_0x320ef0[_0x9be9('0x46')][_0x9be9('0x53')]){_0x345cda[_0x9be9('0x52')]=_[_0x9be9('0x51')](_0x345cda[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x345cda[_0x9be9('0x49')],function(_0x144cf7){var _0x287475={};_0x287475[_0x144cf7]={'$like':'%'+_0x320ef0[_0x9be9('0x46')]['filter']+'%'};return _0x287475;})});}_0x345cda=_[_0x9be9('0x51')]({},_0x345cda,_0x320ef0[_0x9be9('0x6b')]);return db['ChatOfflineMessage'][_0x9be9('0x54')]({'where':_0x345cda['where']})[_0x9be9('0x36')](function(_0x153c06){_0x293e45[_0x9be9('0x54')]=_0x153c06;if(_0x320ef0['query'][_0x9be9('0x55')]){_0x345cda[_0x9be9('0x56')]=[{'all':!![]}];}else{_0x345cda[_0x9be9('0x56')]=[{'model':db[_0x9be9('0xd5')],'as':_0x9be9('0x104'),'required':![]},{'model':db[_0x9be9('0xea')],'as':_0x9be9('0x138'),'required':![]}];}return db[_0x9be9('0xe0')][_0x9be9('0x6c')](_0x345cda);})[_0x9be9('0x36')](function(_0x450986){_0x293e45[_0x9be9('0x6d')]=_0x450986;return _0x293e45;});}})['then'](respondWithFilteredResult(_0x26184e,_0x345cda))[_0x9be9('0x29')](handleError(_0x26184e,null));};exports[_0x9be9('0x139')]=function(_0x57afb4,_0x46d3dd,_0x1d5078){return db['ChatWebsite']['find']({'where':{'id':_0x57afb4[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x46d3dd,null))[_0x9be9('0x36')](function(_0x425923){if(_0x425923){return _0x425923[_0x9be9('0x139')](_0x57afb4[_0x9be9('0x5b')]['ids'],_[_0x9be9('0x102')](_0x57afb4[_0x9be9('0x5b')],['ids','id'])||{})[_0x9be9('0xc3')](function(_0x3995c6){for(var _0x3bfa88=0x0;_0x3bfa88<_0x57afb4[_0x9be9('0x5b')][_0x9be9('0x6f')][_0x9be9('0x4b')];_0x3bfa88+=0x1){socket['emit'](_0x9be9('0x13a'),{'UserId':Number(_0x57afb4[_0x9be9('0x5b')][_0x9be9('0x6f')][_0x3bfa88]),'ChatWebsiteId':Number(_0x57afb4[_0x9be9('0x63')]['id'])});}return _0x3995c6;});}})[_0x9be9('0x36')](respondWithResult(_0x46d3dd,null))[_0x9be9('0x29')](handleError(_0x46d3dd,null));};exports[_0x9be9('0x13b')]=function(_0x3a0364,_0x3d5ba0,_0x3634a2){return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x3a0364[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x3d5ba0,null))[_0x9be9('0x36')](function(_0x151d85){if(_0x151d85){return _0x151d85[_0x9be9('0x13b')](_0x3a0364[_0x9be9('0x46')][_0x9be9('0x6f')])[_0x9be9('0x36')](function(){if(_[_0x9be9('0x13c')](_0x3a0364[_0x9be9('0x46')]['ids'])){for(var _0x2f9222=0x0;_0x2f9222<_0x3a0364[_0x9be9('0x46')][_0x9be9('0x6f')][_0x9be9('0x4b')];_0x2f9222+=0x1){socket['emit'](_0x9be9('0x13d'),{'UserId':Number(_0x3a0364[_0x9be9('0x46')][_0x9be9('0x6f')][_0x2f9222]),'ChatWebsiteId':Number(_0x3a0364[_0x9be9('0x63')]['id'])});}}else{socket['emit'](_0x9be9('0x13d'),{'UserId':Number(_0x3a0364['query'][_0x9be9('0x6f')]),'ChatWebsiteId':Number(_0x3a0364[_0x9be9('0x63')]['id'])});}});}})[_0x9be9('0x36')](respondWithStatusCode(_0x3d5ba0,null))[_0x9be9('0x29')](handleError(_0x3d5ba0,null));};exports[_0x9be9('0x13e')]=function(_0xe3bb8c,_0xedff3a,_0x26b473){var _0x553006={};var _0x37a8f0={};var _0x585434;var _0x522148;return db['ChatWebsite'][_0x9be9('0x68')]({'where':{'id':_0xe3bb8c[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0xedff3a,null))[_0x9be9('0x36')](function(_0x2c6dee){if(_0x2c6dee){_0x585434=_0x2c6dee;_0x37a8f0[_0x9be9('0x45')]=_[_0x9be9('0x47')](db[_0x9be9('0xcb')][_0x9be9('0x41')]);_0x37a8f0['query']=_['keys'](_0xe3bb8c[_0x9be9('0x46')]);_0x37a8f0[_0x9be9('0x4f')]=_[_0x9be9('0x48')](_0x37a8f0[_0x9be9('0x45')],_0x37a8f0[_0x9be9('0x46')]);_0x553006['attributes']=_[_0x9be9('0x48')](_0x37a8f0[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0xe3bb8c[_0x9be9('0x46')]['fields']));_0x553006[_0x9be9('0x49')]=_0x553006[_0x9be9('0x49')][_0x9be9('0x4b')]?_0x553006[_0x9be9('0x49')]:_0x37a8f0['model'];_0x553006['order']=qs[_0x9be9('0x4e')](_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x553006[_0x9be9('0x52')]=qs['filters'](_['pick'](_0xe3bb8c[_0x9be9('0x46')],_0x37a8f0['filters']));if(_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x53')]){_0x553006[_0x9be9('0x52')]=_['merge'](_0x553006[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x553006['attributes'],function(_0x194c23){var _0x2fc85f={};_0x2fc85f[_0x194c23]={'$like':'%'+_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x53')]+'%'};return _0x2fc85f;})});}_0x553006=_[_0x9be9('0x51')]({},_0x553006,_0xe3bb8c['options']);return _0x585434[_0x9be9('0x13e')](_0x553006);}})[_0x9be9('0x36')](function(_0x5f13a3){if(_0x5f13a3){_0x522148=_0x5f13a3[_0x9be9('0x4b')];if(!_0xe3bb8c['query'][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x553006[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x30')]);_0x553006[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x2e')]);}return _0x585434[_0x9be9('0x13e')](_0x553006);}})[_0x9be9('0x36')](function(_0x40a4cc){if(_0x40a4cc){return _0x40a4cc?{'count':_0x522148,'rows':_0x40a4cc}:null;}})[_0x9be9('0x36')](respondWithResult(_0xedff3a,null))[_0x9be9('0x29')](handleError(_0xedff3a,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 3c90370..2d5e64b 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 _0x9ffd=['emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove'];(function(_0x280bb5,_0x4a1aff){var _0x2b760c=function(_0x53b65a){while(--_0x53b65a){_0x280bb5['push'](_0x280bb5['shift']());}};_0x2b760c(++_0x4a1aff);}(_0x9ffd,0x1d7));var _0xd9ff=function(_0x38682c,_0x15afd2){_0x38682c=_0x38682c-0x0;var _0x6f32ca=_0x9ffd[_0x38682c];return _0x6f32ca;};'use strict';var EventEmitter=require(_0xd9ff('0x0'));var ChatWebsite=require(_0xd9ff('0x1'))['db'][_0xd9ff('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd9ff('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd9ff('0x4'),'afterDestroy':_0xd9ff('0x5')};function emitEvent(_0x3de85b){return function(_0x96ee9a,_0x44c750,_0x4795c3){ChatWebsiteEvents['emit'](_0x3de85b+':'+_0x96ee9a['id'],_0x96ee9a);ChatWebsiteEvents[_0xd9ff('0x6')](_0x3de85b,_0x96ee9a);_0x4795c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xd9ff('0x7')](e,emitEvent(event));}}module[_0xd9ff('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x72b1=['save','update','remove','emit','hasOwnProperty','exports','events','ChatWebsite','setMaxListeners'];(function(_0x5d3ba8,_0x4b340a){var _0x479625=function(_0x3176e5){while(--_0x3176e5){_0x5d3ba8['push'](_0x5d3ba8['shift']());}};_0x479625(++_0x4b340a);}(_0x72b1,0x16e));var _0x172b=function(_0x475276,_0xa01d05){_0x475276=_0x475276-0x0;var _0x58ab90=_0x72b1[_0x475276];return _0x58ab90;};'use strict';var EventEmitter=require(_0x172b('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x172b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x172b('0x2')](0x0);var events={'afterCreate':_0x172b('0x3'),'afterUpdate':_0x172b('0x4'),'afterDestroy':_0x172b('0x5')};function emitEvent(_0x3fa10d){return function(_0x2c1d6e,_0x558038,_0x3781f3){ChatWebsiteEvents[_0x172b('0x6')](_0x3fa10d+':'+_0x2c1d6e['id'],_0x2c1d6e);ChatWebsiteEvents[_0x172b('0x6')](_0x3fa10d,_0x2c1d6e);_0x3781f3(null);};}for(var e in events){if(events[_0x172b('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x172b('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index fd9d854..f1a92da 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 _0xee84=['ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','request-promise','path','./chatWebsite.attributes','exports','define'];(function(_0x5b84ff,_0x47e637){var _0xf145d9=function(_0x554033){while(--_0x554033){_0x5b84ff['push'](_0x5b84ff['shift']());}};_0xf145d9(++_0x47e637);}(_0xee84,0x1f1));var _0x4ee8=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xee84[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x4ee8('0x0'));var util=require(_0x4ee8('0x1'));var logger=require(_0x4ee8('0x2'))('api');var moment=require(_0x4ee8('0x3'));var BPromise=require('bluebird');var rp=require(_0x4ee8('0x4'));var fs=require('fs');var path=require(_0x4ee8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4ee8('0x6'));module[_0x4ee8('0x7')]=function(_0x19accd,_0x185a71){return _0x19accd[_0x4ee8('0x8')](_0x4ee8('0x9'),attributes,{'tableName':_0x4ee8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x303c=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x57cadb,_0x12813d){var _0x4eb70d=function(_0x4946dc){while(--_0x4946dc){_0x57cadb['push'](_0x57cadb['shift']());}};_0x4eb70d(++_0x12813d);}(_0x303c,0x6d));var _0xc303=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x303c[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0xc303('0x0'));var util=require(_0xc303('0x1'));var logger=require(_0xc303('0x2'))('api');var moment=require(_0xc303('0x3'));var BPromise=require(_0xc303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc303('0x5'));var rimraf=require(_0xc303('0x6'));var config=require(_0xc303('0x7'));var attributes=require(_0xc303('0x8'));module[_0xc303('0x9')]=function(_0x23187c,_0xdde2a6){return _0x23187c[_0xc303('0xa')](_0xc303('0xb'),attributes,{'tableName':_0xc303('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 7d0330a..6e73ec2 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 _0xe089=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x41880b,_0x1fb1e5){var _0x16e6ed=function(_0x47fff6){while(--_0x47fff6){_0x41880b['push'](_0x41880b['shift']());}};_0x16e6ed(++_0x1fb1e5);}(_0xe089,0x153));var _0x9e08=function(_0x1c0117,_0xa44df1){_0x1c0117=_0x1c0117-0x0;var _0x29b95b=_0xe089[_0x1c0117];return _0x29b95b;};'use strict';var _=require(_0x9e08('0x0'));var util=require(_0x9e08('0x1'));var moment=require(_0x9e08('0x2'));var BPromise=require(_0x9e08('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e08('0x4'));var db=require(_0x9e08('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e08('0x6'));var config=require(_0x9e08('0x7'));var jayson=require(_0x9e08('0x8'));var client=jayson[_0x9e08('0x9')][_0x9e08('0xa')]({'port':0x232a});config['redis']=_[_0x9e08('0xb')](config['redis'],{'host':_0x9e08('0xc'),'port':0x18eb});var socket=require(_0x9e08('0xd'))(new Redis(config[_0x9e08('0xe')]));require(_0x9e08('0xf'))[_0x9e08('0x10')](socket);function respondWithRpcPromise(_0x4b983b,_0x5b69e2,_0x2c9072){return new BPromise(function(_0x38f7fa,_0x1da444){return client[_0x9e08('0x11')](_0x4b983b,_0x2c9072)[_0x9e08('0x12')](function(_0x5c2220){logger[_0x9e08('0x13')](_0x9e08('0x14'),_0x5b69e2,_0x9e08('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5b69e2,'request\x20sent',JSON['stringify'](_0x5c2220));if(_0x5c2220[_0x9e08('0x16')]){if(_0x5c2220['error']['code']===0x1f4){logger[_0x9e08('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x5b69e2,_0x5c2220[_0x9e08('0x16')][_0x9e08('0x17')]);return _0x1da444(_0x5c2220['error'][_0x9e08('0x17')]);}logger[_0x9e08('0x16')](_0x9e08('0x14'),_0x5b69e2,_0x5c2220[_0x9e08('0x16')][_0x9e08('0x17')]);return _0x38f7fa(_0x5c2220[_0x9e08('0x16')]['message']);}else{logger[_0x9e08('0x13')](_0x9e08('0x14'),_0x5b69e2,'request\x20sent');_0x38f7fa(_0x5c2220[_0x9e08('0x18')][_0x9e08('0x17')]);}})[_0x9e08('0x19')](function(_0x332711){logger['error'](_0x9e08('0x14'),_0x5b69e2,_0x332711);_0x1da444(_0x332711);});});} \ No newline at end of file +var _0xb7e3=['request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x1bfccb,_0x2a5d55){var _0x4e7f15=function(_0x22e8b5){while(--_0x22e8b5){_0x1bfccb['push'](_0x1bfccb['shift']());}};_0x4e7f15(++_0x2a5d55);}(_0xb7e3,0xf4));var _0x3b7e=function(_0x4be774,_0x5b2d48){_0x4be774=_0x4be774-0x0;var _0x31d1c9=_0xb7e3[_0x4be774];return _0x31d1c9;};'use strict';var _=require('lodash');var util=require(_0x3b7e('0x0'));var moment=require(_0x3b7e('0x1'));var BPromise=require(_0x3b7e('0x2'));var rs=require(_0x3b7e('0x3'));var fs=require('fs');var Redis=require(_0x3b7e('0x4'));var db=require(_0x3b7e('0x5'))['db'];var utils=require(_0x3b7e('0x6'));var logger=require(_0x3b7e('0x7'))(_0x3b7e('0x8'));var config=require(_0x3b7e('0x9'));var jayson=require(_0x3b7e('0xa'));var client=jayson[_0x3b7e('0xb')][_0x3b7e('0xc')]({'port':0x232a});config[_0x3b7e('0xd')]=_[_0x3b7e('0xe')](config[_0x3b7e('0xd')],{'host':_0x3b7e('0xf'),'port':0x18eb});var socket=require(_0x3b7e('0x10'))(new Redis(config[_0x3b7e('0xd')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x43b1f6,_0x48dc5c,_0x2a02ed){return new BPromise(function(_0x4cedec,_0x3ff5c0){return client[_0x3b7e('0x11')](_0x43b1f6,_0x2a02ed)[_0x3b7e('0x12')](function(_0xc0541f){logger[_0x3b7e('0x13')](_0x3b7e('0x14'),_0x48dc5c,'request\x20sent');logger[_0x3b7e('0x15')](_0x3b7e('0x16'),_0x48dc5c,_0x3b7e('0x17'),JSON['stringify'](_0xc0541f));if(_0xc0541f[_0x3b7e('0x18')]){if(_0xc0541f['error'][_0x3b7e('0x19')]===0x1f4){logger[_0x3b7e('0x18')](_0x3b7e('0x14'),_0x48dc5c,_0xc0541f[_0x3b7e('0x18')][_0x3b7e('0x1a')]);return _0x3ff5c0(_0xc0541f[_0x3b7e('0x18')][_0x3b7e('0x1a')]);}logger[_0x3b7e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x48dc5c,_0xc0541f[_0x3b7e('0x18')][_0x3b7e('0x1a')]);return _0x4cedec(_0xc0541f['error'][_0x3b7e('0x1a')]);}else{logger[_0x3b7e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x48dc5c,_0x3b7e('0x17'));_0x4cedec(_0xc0541f[_0x3b7e('0x1b')][_0x3b7e('0x1a')]);}})[_0x3b7e('0x1c')](function(_0x1cdb06){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x48dc5c,_0x1cdb06);_0x3ff5c0(_0x1cdb06);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 1e5f55e..3a2f0d1 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 _0x86d9=['remove','update','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x5c84d6,_0x113833){var _0xd55787=function(_0x4708cc){while(--_0x4708cc){_0x5c84d6['push'](_0x5c84d6['shift']());}};_0xd55787(++_0x113833);}(_0x86d9,0x14e));var _0x986d=function(_0x25563a,_0x304ee9){_0x25563a=_0x25563a-0x0;var _0x29a9b0=_0x86d9[_0x25563a];return _0x29a9b0;};'use strict';var ChatWebsiteEvents=require(_0x986d('0x0'));var events=[_0x986d('0x1'),_0x986d('0x2'),_0x986d('0x3')];function createListener(_0x578f42,_0x35429c){return function(_0x493066){_0x35429c['emit'](_0x578f42,_0x493066);};}function removeListener(_0x50af9c,_0x1882bc){return function(){ChatWebsiteEvents[_0x986d('0x4')](_0x50af9c,_0x1882bc);};}exports[_0x986d('0x5')]=function(_0x25177f){for(var _0x160804=0x0,_0x5273da=events[_0x986d('0x6')];_0x160804<_0x5273da;_0x160804++){var _0x41d200=events[_0x160804];var _0x2c4e27=createListener(_0x986d('0x7')+_0x41d200,_0x25177f);ChatWebsiteEvents['on'](_0x41d200,_0x2c4e27);}}; \ No newline at end of file +var _0x1de3=['./chatWebsite.events','save','update','removeListener','register','chatWebsite:'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1de3,0x14a));var _0x31de=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x1de3[_0x92c450];return _0x2a9599;};'use strict';var ChatWebsiteEvents=require(_0x31de('0x0'));var events=[_0x31de('0x1'),'remove',_0x31de('0x2')];function createListener(_0x188675,_0x18b580){return function(_0x36f4e4){_0x18b580['emit'](_0x188675,_0x36f4e4);};}function removeListener(_0x532b6d,_0x560e05){return function(){ChatWebsiteEvents[_0x31de('0x3')](_0x532b6d,_0x560e05);};}exports[_0x31de('0x4')]=function(_0xfc3240){for(var _0x32c55d=0x0,_0x4f6511=events['length'];_0x32c55d<_0x4f6511;_0x32c55d++){var _0x4d7bd5=events[_0x32c55d];var _0x159465=createListener(_0x31de('0x5')+_0x4d7bd5,_0xfc3240);ChatWebsiteEvents['on'](_0x4d7bd5,_0x159465);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 03b6b9f..42c4c73 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 _0xbd7b=['extname','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','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','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','/:id/logo','single','file','addLogo','format','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace'];(function(_0x207b8c,_0x34497d){var _0x3979a6=function(_0x29e7fc){while(--_0x29e7fc){_0x207b8c['push'](_0x207b8c['shift']());}};_0x3979a6(++_0x34497d);}(_0xbd7b,0x17b));var _0xbbd7=function(_0xe3c18c,_0x4628bb){_0xe3c18c=_0xe3c18c-0x0;var _0x50ccd0=_0xbd7b[_0xe3c18c];return _0x50ccd0;};'use strict';var multer=require(_0xbbd7('0x0'));var util=require(_0xbbd7('0x1'));var path=require(_0xbbd7('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbd7('0x3'));var router=express[_0xbbd7('0x4')]();var fs_extra=require(_0xbbd7('0x5'));var auth=require(_0xbbd7('0x6'));var interaction=require(_0xbbd7('0x7'));var config=require(_0xbbd7('0x8'));var controller=require('./chatWebsite.controller');router[_0xbbd7('0x9')]('/',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0xb')]);router[_0xbbd7('0x9')](_0xbbd7('0xc'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0xd')]);router[_0xbbd7('0x9')](_0xbbd7('0xe'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0xf')]);router[_0xbbd7('0x9')](_0xbbd7('0x10'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x11')]);router[_0xbbd7('0x9')](_0xbbd7('0x12'),auth[_0xbbd7('0xa')](),controller['getAnswers']);router[_0xbbd7('0x9')]('/:id/logo',controller['getLogo']);router[_0xbbd7('0x9')](_0xbbd7('0x13'),controller[_0xbbd7('0x14')]);router[_0xbbd7('0x9')]('/:id/customer_avatar',controller[_0xbbd7('0x15')]);router[_0xbbd7('0x9')](_0xbbd7('0x16'),controller[_0xbbd7('0x17')]);router[_0xbbd7('0x9')](_0xbbd7('0x18'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x19')]);router[_0xbbd7('0x9')](_0xbbd7('0x1a'),controller[_0xbbd7('0x1b')]);router[_0xbbd7('0x9')]('/:id/applications',auth[_0xbbd7('0xa')](),controller['getApplications']);router[_0xbbd7('0x9')](_0xbbd7('0x1c'),auth['isAuthenticated'](),controller[_0xbbd7('0x1d')]);router[_0xbbd7('0x9')](_0xbbd7('0x1e'),controller[_0xbbd7('0x1f')]);router[_0xbbd7('0x9')]('/:id/offline_messages',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x20')]);router[_0xbbd7('0x9')](_0xbbd7('0x21'),auth['isAuthenticated'](),controller[_0xbbd7('0x22')]);router[_0xbbd7('0x23')]('/',auth['isAuthenticated'](),controller[_0xbbd7('0x24')]);router[_0xbbd7('0x23')](_0xbbd7('0x10'),auth[_0xbbd7('0xa')](),controller['addDisposition']);router[_0xbbd7('0x23')](_0xbbd7('0x12'),auth[_0xbbd7('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xbbd7('0x25')]({'destination':function(_0x1ce499,_0x5ef3e5,_0x1e5d72){_0x1e5d72(null,path[_0xbbd7('0x26')](config[_0xbbd7('0x27')],_0xbbd7('0x28')));},'filename':function(_0x1d9651,_0x3ccee2,_0x3ece3b){_0x3ece3b(null,util['format'](_0xbbd7('0x29'),Date[_0xbbd7('0x2a')](),_0x3ccee2[_0xbbd7('0x2b')]));}})});router[_0xbbd7('0x23')](_0xbbd7('0x2c'),upload[_0xbbd7('0x2d')](_0xbbd7('0x2e')),controller[_0xbbd7('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4ba3b7,_0x496157,_0x5a2d5f){_0x5a2d5f(null,path[_0xbbd7('0x26')](config[_0xbbd7('0x27')],'server/files/images/avatars/'));},'filename':function(_0x4497e9,_0x385230,_0x1bd56c){_0x1bd56c(null,util[_0xbbd7('0x30')](_0xbbd7('0x29'),Date[_0xbbd7('0x2a')](),_0x385230[_0xbbd7('0x2b')]));}})});router[_0xbbd7('0x23')](_0xbbd7('0x13'),upload[_0xbbd7('0x2d')]('file'),controller[_0xbbd7('0x31')]);var upload=multer({'storage':multer[_0xbbd7('0x25')]({'destination':function(_0x43d7d1,_0x599f7a,_0x27ec4f){_0x27ec4f(null,path[_0xbbd7('0x26')](config[_0xbbd7('0x27')],_0xbbd7('0x32')));},'filename':function(_0x23daef,_0x43682f,_0x157bb1){_0x157bb1(null,util[_0xbbd7('0x30')]('%s-%s',Date[_0xbbd7('0x2a')](),_0x43682f[_0xbbd7('0x2b')]));}})});router[_0xbbd7('0x23')]('/:id/customer_avatar',upload[_0xbbd7('0x2d')](_0xbbd7('0x2e')),controller[_0xbbd7('0x33')]);var upload=multer({'storage':multer[_0xbbd7('0x25')]({'destination':function(_0x15a900,_0x192500,_0x2a61d8){_0x2a61d8(null,path['join'](config[_0xbbd7('0x27')],_0xbbd7('0x32')));},'filename':function(_0x232ffd,_0x12b855,_0x1812c0){_0x1812c0(null,util[_0xbbd7('0x30')]('%s-%s',Date[_0xbbd7('0x2a')](),_0x12b855[_0xbbd7('0x2b')]));}})});router[_0xbbd7('0x23')]('/:id/system_avatar',upload[_0xbbd7('0x2d')](_0xbbd7('0x2e')),controller[_0xbbd7('0x34')]);router['post'](_0xbbd7('0x35'),controller[_0xbbd7('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xbbd7('0x25')]({'destination':function(_0x24fcdd,_0x16f8a8,_0x1acda2){const _0x1764e4=path[_0xbbd7('0x26')](config[_0xbbd7('0x27')],_0xbbd7('0x37'),_0xbbd7('0x38'),_0xbbd7('0x39'));fs_extra['ensureDir'](_0x1764e4,function(){_0x1acda2(null,_0x1764e4);});},'filename':function(_0x28b1b7,_0x35b0cb,_0x37875d){const _0x1cdb63=_0x35b0cb['originalname'][_0xbbd7('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5a53a6=path[_0xbbd7('0x3b')](_0x1cdb63);const _0x425da1=Date['now']()+'-'+_0x1cdb63['replace'](_0x5a53a6,'')+_0x5a53a6;_0x37875d(null,_0x425da1);}})});router['post'](_0xbbd7('0x3c'),offlineUploadMulter[_0xbbd7('0x3d')](),controller['offline']);router[_0xbbd7('0x23')](_0xbbd7('0x18'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x3e')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xbbd7('0x3f')]);router[_0xbbd7('0x23')]('/:id/proactive_actions',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x40')]);router[_0xbbd7('0x23')]('/:id/users',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x41')]);router['put'](_0xbbd7('0xe'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x42')]);router[_0xbbd7('0x43')](_0xbbd7('0xe'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x44')]);router['delete']('/:id/dispositions',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x45')]);router[_0xbbd7('0x43')]('/:id/canned_answers',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x46')]);router['delete'](_0xbbd7('0x21'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x47')]);module[_0xbbd7('0x48')]=router; \ No newline at end of file +var _0xda89=['/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','%s-%s','addCustomerAvatar','addSystemAvatar'];(function(_0x53db50,_0x36dce2){var _0x28cbe2=function(_0x17c950){while(--_0x17c950){_0x53db50['push'](_0x53db50['shift']());}};_0x28cbe2(++_0x36dce2);}(_0xda89,0x179));var _0x9da8=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xda89[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x9da8('0x0'));var util=require('util');var path=require(_0x9da8('0x1'));var timeout=require(_0x9da8('0x2'));var express=require('express');var router=express[_0x9da8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9da8('0x4'));var interaction=require(_0x9da8('0x5'));var config=require(_0x9da8('0x6'));var controller=require(_0x9da8('0x7'));router['get']('/',auth[_0x9da8('0x8')](),controller[_0x9da8('0x9')]);router[_0x9da8('0xa')](_0x9da8('0xb'),auth[_0x9da8('0x8')](),controller[_0x9da8('0xc')]);router[_0x9da8('0xa')](_0x9da8('0xd'),auth[_0x9da8('0x8')](),controller['show']);router['get']('/:id/dispositions',auth[_0x9da8('0x8')](),controller[_0x9da8('0xe')]);router['get'](_0x9da8('0xf'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x10')]);router['get'](_0x9da8('0x11'),controller['getLogo']);router['get'](_0x9da8('0x12'),controller[_0x9da8('0x13')]);router[_0x9da8('0xa')](_0x9da8('0x14'),controller[_0x9da8('0x15')]);router[_0x9da8('0xa')](_0x9da8('0x16'),controller[_0x9da8('0x17')]);router[_0x9da8('0xa')](_0x9da8('0x18'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x19')]);router[_0x9da8('0xa')]('/:id/snippet',controller[_0x9da8('0x1a')]);router[_0x9da8('0xa')](_0x9da8('0x1b'),auth['isAuthenticated'](),controller[_0x9da8('0x1c')]);router[_0x9da8('0xa')](_0x9da8('0x1d'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x1e')]);router[_0x9da8('0xa')]('/:id/fields',controller[_0x9da8('0x1f')]);router[_0x9da8('0xa')](_0x9da8('0x20'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x21')]);router['get'](_0x9da8('0x22'),auth[_0x9da8('0x8')](),controller['getAgents']);router[_0x9da8('0x23')]('/',auth['isAuthenticated'](),controller[_0x9da8('0x24')]);router[_0x9da8('0x23')](_0x9da8('0x25'),auth['isAuthenticated'](),controller[_0x9da8('0x26')]);router[_0x9da8('0x23')](_0x9da8('0xf'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x27')]);var upload=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0x48763b,_0x25973f,_0x1c4463){_0x1c4463(null,path[_0x9da8('0x29')](config[_0x9da8('0x2a')],_0x9da8('0x2b')));},'filename':function(_0x45277a,_0x4dd763,_0x1100ec){_0x1100ec(null,util[_0x9da8('0x2c')]('%s-%s',Date[_0x9da8('0x2d')](),_0x4dd763[_0x9da8('0x2e')]));}})});router[_0x9da8('0x23')](_0x9da8('0x11'),upload[_0x9da8('0x2f')](_0x9da8('0x30')),controller[_0x9da8('0x31')]);var upload=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0x585c1d,_0x13583a,_0x834898){_0x834898(null,path[_0x9da8('0x29')](config['root'],_0x9da8('0x32')));},'filename':function(_0x443357,_0x1acd2d,_0x30f3a9){_0x30f3a9(null,util[_0x9da8('0x2c')]('%s-%s',Date['now'](),_0x1acd2d[_0x9da8('0x2e')]));}})});router[_0x9da8('0x23')](_0x9da8('0x12'),upload[_0x9da8('0x2f')](_0x9da8('0x30')),controller[_0x9da8('0x33')]);var upload=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0x1a7742,_0x136a43,_0x46bdc3){_0x46bdc3(null,path[_0x9da8('0x29')](config[_0x9da8('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x420a5d,_0x22a553,_0x30c507){_0x30c507(null,util[_0x9da8('0x2c')](_0x9da8('0x34'),Date['now'](),_0x22a553[_0x9da8('0x2e')]));}})});router[_0x9da8('0x23')](_0x9da8('0x14'),upload['single'](_0x9da8('0x30')),controller[_0x9da8('0x35')]);var upload=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0xc9a327,_0x5a9609,_0x69688f){_0x69688f(null,path[_0x9da8('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xcbef5e,_0x1f8f3e,_0x1e62b6){_0x1e62b6(null,util[_0x9da8('0x2c')](_0x9da8('0x34'),Date[_0x9da8('0x2d')](),_0x1f8f3e[_0x9da8('0x2e')]));}})});router[_0x9da8('0x23')](_0x9da8('0x16'),upload[_0x9da8('0x2f')]('file'),controller[_0x9da8('0x36')]);router[_0x9da8('0x23')](_0x9da8('0x37'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0x4e2854,_0x37c95d,_0x1c3119){const _0x236aa3=path['join'](config['root'],_0x9da8('0x38'),_0x9da8('0x39'),_0x9da8('0x3a'));fs_extra[_0x9da8('0x3b')](_0x236aa3,function(){_0x1c3119(null,_0x236aa3);});},'filename':function(_0x2ee433,_0x5574e1,_0x2f955e){const _0x27de2b=_0x5574e1[_0x9da8('0x2e')][_0x9da8('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x655430=path['extname'](_0x27de2b);const _0x42a6f2=Date[_0x9da8('0x2d')]()+'-'+_0x27de2b[_0x9da8('0x3c')](_0x655430,'')+_0x655430;_0x2f955e(null,_0x42a6f2);}})});router[_0x9da8('0x23')](_0x9da8('0x3d'),offlineUploadMulter[_0x9da8('0x3e')](),controller['offline']);router[_0x9da8('0x23')](_0x9da8('0x18'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x3f')]);router['post']('/:id/applications',auth[_0x9da8('0x8')](),controller[_0x9da8('0x40')]);router[_0x9da8('0x23')](_0x9da8('0x1d'),auth['isAuthenticated'](),controller[_0x9da8('0x41')]);router[_0x9da8('0x23')](_0x9da8('0x22'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x42')]);router[_0x9da8('0x43')](_0x9da8('0xd'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x44')]);router[_0x9da8('0x45')](_0x9da8('0xd'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x46')]);router[_0x9da8('0x45')](_0x9da8('0x25'),auth[_0x9da8('0x8')](),controller['removeDispositions']);router[_0x9da8('0x45')](_0x9da8('0xf'),auth['isAuthenticated'](),controller[_0x9da8('0x47')]);router[_0x9da8('0x45')](_0x9da8('0x22'),auth[_0x9da8('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index bc36a10..1fa213c 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 _0xd9a8=['sequelize','exports','STRING','AmazonAWS','Google'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xd9a8,0xc3));var _0x8d9a=function(_0x35335f,_0x4861ff){_0x35335f=_0x35335f-0x0;var _0x4a9103=_0xd9a8[_0x35335f];return _0x4a9103;};'use strict';var Sequelize=require(_0x8d9a('0x0'));module[_0x8d9a('0x1')]={'name':{'type':Sequelize[_0x8d9a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x8d9a('0x3'),_0x8d9a('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x553a=['AmazonAWS','Google','exports','ENUM'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x553a,0x192));var _0xa553=function(_0x3890f8,_0x1b39df){_0x3890f8=_0x3890f8-0x0;var _0x40713e=_0x553a[_0x3890f8];return _0x40713e;};'use strict';var Sequelize=require('sequelize');module[_0xa553('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa553('0x1')](_0xa553('0x2'),_0xa553('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'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 917d09e..9fe555b 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 _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','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'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x5f2f,0x73));var _0xf5f2=function(_0x445d1e,_0x3f5c8f){_0x445d1e=_0x445d1e-0x0;var _0x59ae5a=_0x5f2f[_0x445d1e];return _0x59ae5a;};'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')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x2b2a12,_0x3f9ede){var _0x31fe03=function(_0x19945e){while(--_0x19945e){_0x2b2a12['push'](_0x2b2a12['shift']());}};_0x31fe03(++_0x3f9ede);}(_0x7a54,0x106));var _0x47a5=function(_0xd9e698,_0x1ed5fa){_0xd9e698=_0xd9e698-0x0;var _0x4226f0=_0x7a54[_0xd9e698];return _0x4226f0;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 3ed8c70..32df621 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 _0x6937=['exports','define','cloud_providers','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x29752a,_0x2ba2d9){var _0x2db88f=function(_0x5ef7f9){while(--_0x5ef7f9){_0x29752a['push'](_0x29752a['shift']());}};_0x2db88f(++_0x2ba2d9);}(_0x6937,0x18f));var _0x7693=function(_0x186861,_0x2311c7){_0x186861=_0x186861-0x0;var _0x5be31f=_0x6937[_0x186861];return _0x5be31f;};'use strict';var _=require('lodash');var util=require(_0x7693('0x0'));var logger=require('../../config/logger')(_0x7693('0x1'));var moment=require(_0x7693('0x2'));var BPromise=require(_0x7693('0x3'));var rp=require(_0x7693('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7693('0x5'));var config=require(_0x7693('0x6'));var attributes=require(_0x7693('0x7'));module[_0x7693('0x8')]=function(_0x3a58be,_0x233b72){return _0x3a58be[_0x7693('0x9')]('CloudProvider',attributes,{'tableName':_0x7693('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ebc=['moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','../../config/logger'];(function(_0xa6238d,_0x78ab8a){var _0x1cc8b6=function(_0x35e9cd){while(--_0x35e9cd){_0xa6238d['push'](_0xa6238d['shift']());}};_0x1cc8b6(++_0x78ab8a);}(_0x8ebc,0x196));var _0xc8eb=function(_0x38cf13,_0x44f6af){_0x38cf13=_0x38cf13-0x0;var _0x29b1a1=_0x8ebc[_0x38cf13];return _0x29b1a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc8eb('0x0'))('api');var moment=require(_0xc8eb('0x1'));var BPromise=require(_0xc8eb('0x2'));var rp=require(_0xc8eb('0x3'));var fs=require('fs');var path=require(_0xc8eb('0x4'));var rimraf=require('rimraf');var config=require(_0xc8eb('0x5'));var attributes=require(_0xc8eb('0x6'));module[_0xc8eb('0x7')]=function(_0x47db71,_0x41f249){return _0x47db71[_0xc8eb('0x8')](_0xc8eb('0x9'),attributes,{'tableName':_0xc8eb('0xa'),'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 1dda3a0..2e8fcab 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 _0x6132=['../../config/logger','../../config/environment','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x57f91f,_0x21cf17){var _0x4deca6=function(_0x5c97bb){while(--_0x5c97bb){_0x57f91f['push'](_0x57f91f['shift']());}};_0x4deca6(++_0x21cf17);}(_0x6132,0xf3));var _0x2613=function(_0xec5728,_0x267b89){_0xec5728=_0xec5728-0x0;var _0x3c3130=_0x6132[_0xec5728];return _0x3c3130;};'use strict';var _=require('lodash');var util=require(_0x2613('0x0'));var moment=require('moment');var BPromise=require(_0x2613('0x1'));var rs=require(_0x2613('0x2'));var fs=require('fs');var Redis=require(_0x2613('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2613('0x4'))('rpc');var config=require(_0x2613('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2613('0x6')][_0x2613('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1083a6,_0x546fd4,_0x43c9d4){return new BPromise(function(_0x43c876,_0x51f79d){return client['request'](_0x1083a6,_0x43c9d4)[_0x2613('0x8')](function(_0x47dfc5){logger[_0x2613('0x9')](_0x2613('0xa'),_0x546fd4,_0x2613('0xb'));logger[_0x2613('0xc')](_0x2613('0xd'),_0x546fd4,_0x2613('0xb'),JSON['stringify'](_0x47dfc5));if(_0x47dfc5[_0x2613('0xe')]){if(_0x47dfc5[_0x2613('0xe')][_0x2613('0xf')]===0x1f4){logger[_0x2613('0xe')]('CloudProvider,\x20%s,\x20%s',_0x546fd4,_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);return _0x51f79d(_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);}logger[_0x2613('0xe')](_0x2613('0xa'),_0x546fd4,_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);return _0x43c876(_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);}else{logger[_0x2613('0x9')](_0x2613('0xa'),_0x546fd4,_0x2613('0xb'));_0x43c876(_0x47dfc5[_0x2613('0x11')][_0x2613('0x10')]);}})[_0x2613('0x12')](function(_0xb99fd7){logger[_0x2613('0xe')](_0x2613('0xa'),_0x546fd4,_0xb99fd7);_0x51f79d(_0xb99fd7);});});} \ No newline at end of file +var _0x1a37=['rpc','jayson/promise','http','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x32c00e,_0x3578af){var _0x23e55e=function(_0x468f64){while(--_0x468f64){_0x32c00e['push'](_0x32c00e['shift']());}};_0x23e55e(++_0x3578af);}(_0x1a37,0xb4));var _0x71a3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x1a37[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7b274c6..5de7a17 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 _0x6239=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create','put','destroy'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x6239,0x144));var _0x9623=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0x6239[_0x188a93];return _0x23b40d;};'use strict';var multer=require(_0x9623('0x0'));var util=require(_0x9623('0x1'));var path=require(_0x9623('0x2'));var timeout=require('connect-timeout');var express=require(_0x9623('0x3'));var router=express[_0x9623('0x4')]();var fs_extra=require(_0x9623('0x5'));var auth=require(_0x9623('0x6'));var interaction=require(_0x9623('0x7'));var config=require(_0x9623('0x8'));var controller=require(_0x9623('0x9'));router[_0x9623('0xa')]('/',auth[_0x9623('0xb')](),controller[_0x9623('0xc')]);router['get'](_0x9623('0xd'),auth[_0x9623('0xb')](),controller[_0x9623('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9623('0xf')]);router[_0x9623('0x10')](_0x9623('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9623('0xd'),auth[_0x9623('0xb')](),controller[_0x9623('0x11')]);module[_0x9623('0x12')]=router; \ No newline at end of file +var _0xba38=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x9f34bc,_0x3fb4ce){var _0x4c353e=function(_0x5b3007){while(--_0x5b3007){_0x9f34bc['push'](_0x9f34bc['shift']());}};_0x4c353e(++_0x3fb4ce);}(_0xba38,0x190));var _0x8ba3=function(_0x1d6510,_0x3ada4c){_0x1d6510=_0x1d6510-0x0;var _0x45bceb=_0xba38[_0x1d6510];return _0x45bceb;};'use strict';var multer=require('multer');var util=require(_0x8ba3('0x0'));var path=require(_0x8ba3('0x1'));var timeout=require(_0x8ba3('0x2'));var express=require('express');var router=express[_0x8ba3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8ba3('0x4'));var interaction=require(_0x8ba3('0x5'));var config=require(_0x8ba3('0x6'));var controller=require(_0x8ba3('0x7'));router[_0x8ba3('0x8')]('/',auth[_0x8ba3('0x9')](),controller[_0x8ba3('0xa')]);router[_0x8ba3('0x8')](_0x8ba3('0xb'),auth[_0x8ba3('0x9')](),controller[_0x8ba3('0xc')]);router[_0x8ba3('0xd')]('/',auth['isAuthenticated'](),controller[_0x8ba3('0xe')]);router[_0x8ba3('0xf')]('/:id',auth[_0x8ba3('0x9')](),controller['update']);router[_0x8ba3('0x10')](_0x8ba3('0xb'),auth[_0x8ba3('0x9')](),controller[_0x8ba3('0x11')]);module[_0x8ba3('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index a2a77dd..6a37554 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 _0xdb75=['STRING','name','sequelize','exports'];(function(_0x1dd5ad,_0x556a8e){var _0x386e02=function(_0xf4a0e1){while(--_0xf4a0e1){_0x1dd5ad['push'](_0x1dd5ad['shift']());}};_0x386e02(++_0x556a8e);}(_0xdb75,0xae));var _0x5db7=function(_0x1b1570,_0x3cca89){_0x1b1570=_0x1b1570-0x0;var _0x584eff=_0xdb75[_0x1b1570];return _0x584eff;};'use strict';var Sequelize=require(_0x5db7('0x0'));module[_0x5db7('0x1')]={'name':{'type':Sequelize[_0x5db7('0x2')],'unique':_0x5db7('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5db7('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x5db7('0x2')]},'phone':{'type':Sequelize[_0x5db7('0x2')]},'fax':{'type':Sequelize[_0x5db7('0x2')]},'type':{'type':Sequelize[_0x5db7('0x2')]},'street':{'type':Sequelize[_0x5db7('0x2')]},'postalCode':{'type':Sequelize[_0x5db7('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x5db7('0x2')]},'email':{'type':Sequelize[_0x5db7('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5db7('0x2')]},'sStreet':{'type':Sequelize[_0x5db7('0x2')]},'sPostalCode':{'type':Sequelize[_0x5db7('0x2')]},'sCity':{'type':Sequelize[_0x5db7('0x2')]},'sCountry':{'type':Sequelize[_0x5db7('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xee74=['STRING','name','exports'];(function(_0x2f0bf6,_0x386ca6){var _0x24025c=function(_0x3a9263){while(--_0x3a9263){_0x2f0bf6['push'](_0x2f0bf6['shift']());}};_0x24025c(++_0x386ca6);}(_0xee74,0x1eb));var _0x4ee7=function(_0x29fa89,_0x47b1db){_0x29fa89=_0x29fa89-0x0;var _0x3dd71e=_0xee74[_0x29fa89];return _0x3dd71e;};'use strict';var Sequelize=require('sequelize');module[_0x4ee7('0x0')]={'name':{'type':Sequelize[_0x4ee7('0x1')],'unique':_0x4ee7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4ee7('0x1')]},'companyId':{'type':Sequelize[_0x4ee7('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4ee7('0x1')]},'fax':{'type':Sequelize[_0x4ee7('0x1')]},'type':{'type':Sequelize[_0x4ee7('0x1')]},'street':{'type':Sequelize[_0x4ee7('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4ee7('0x1')]},'country':{'type':Sequelize[_0x4ee7('0x1')]},'email':{'type':Sequelize[_0x4ee7('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4ee7('0x1')]},'sStreet':{'type':Sequelize[_0x4ee7('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4ee7('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index acdce58..be845ca 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 _0xd12d=['fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','get','Companies','sendStatus','name','index','describe','model','keys','intersection','attributes','fields','query','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','options','CmCompany','includeAll','rows','catch','show','rawAttributes','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf'];(function(_0x46c64c,_0x1c876f){var _0x1aadc6=function(_0x483dde){while(--_0x483dde){_0x46c64c['push'](_0x46c64c['shift']());}};_0x1aadc6(++_0x1c876f);}(_0xd12d,0xa4));var _0xdd12=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xd12d[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require(_0xdd12('0x0'));var rimraf=require(_0xdd12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd12('0x2'));var rp=require('request-promise');var moment=require(_0xdd12('0x3'));var BPromise=require(_0xdd12('0x4'));var Mustache=require(_0xdd12('0x5'));var util=require('util');var path=require(_0xdd12('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdd12('0x7'));var fs=require('fs');var fs_extra=require(_0xdd12('0x8'));var _=require(_0xdd12('0x9'));var squel=require(_0xdd12('0xa'));var crypto=require('crypto');var jsforce=require(_0xdd12('0xb'));var deskjs=require(_0xdd12('0xc'));var toCsv=require(_0xdd12('0xd'));var querystring=require(_0xdd12('0xe'));var Papa=require(_0xdd12('0xf'));var Redis=require(_0xdd12('0x10'));var authService=require(_0xdd12('0x11'));var qs=require(_0xdd12('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd12('0x13'));var logger=require(_0xdd12('0x14'))(_0xdd12('0x15'));var utils=require('../../config/utils');var config=require(_0xdd12('0x16'));var licenseUtil=require(_0xdd12('0x17'));var db=require(_0xdd12('0x18'))['db'];function respondWithStatusCode(_0x5685e8,_0x57075f){_0x57075f=_0x57075f||0xcc;return function(_0x26de80){if(_0x26de80){return _0x5685e8['sendStatus'](_0x57075f);}return _0x5685e8[_0xdd12('0x19')](_0x57075f)[_0xdd12('0x1a')]();};}function respondWithResult(_0x3537e5,_0x5ddbef){_0x5ddbef=_0x5ddbef||0xc8;return function(_0x22e5dd){if(_0x22e5dd){return _0x3537e5[_0xdd12('0x19')](_0x5ddbef)[_0xdd12('0x1b')](_0x22e5dd);}};}function respondWithFilteredResult(_0x1ee626,_0x43eea9){return function(_0x3e609a){if(_0x3e609a){var _0x15a7e2=typeof _0x43eea9[_0xdd12('0x1c')]==='undefined'&&typeof _0x43eea9['limit']===_0xdd12('0x1d');var _0x539265=_0x3e609a['count'];var _0x269950=_0x15a7e2?0x0:_0x43eea9[_0xdd12('0x1c')];var _0x3f2af7=_0x15a7e2?_0x3e609a[_0xdd12('0x1e')]:_0x43eea9['offset']+_0x43eea9[_0xdd12('0x1f')];var _0x4ffb3e;if(_0x3f2af7>=_0x539265){_0x3f2af7=_0x539265;_0x4ffb3e=0xc8;}else{_0x4ffb3e=0xce;}_0x1ee626[_0xdd12('0x19')](_0x4ffb3e);return _0x1ee626[_0xdd12('0x20')]('Content-Range',_0x269950+'-'+_0x3f2af7+'/'+_0x539265)[_0xdd12('0x1b')](_0x3e609a);}return null;};}function patchUpdates(_0x25b370){return function(_0x5561bf){try{jsonpatch['apply'](_0x5561bf,_0x25b370,!![]);}catch(_0x5f3fe8){return BPromise[_0xdd12('0x21')](_0x5f3fe8);}return _0x5561bf['save']();};}function saveUpdates(_0x57c6ab,_0x57ae3c){return function(_0x13046e){if(_0x13046e){return _0x13046e[_0xdd12('0x22')](_0x57c6ab)[_0xdd12('0x23')](function(_0x298baa){return _0x298baa;});}return null;};}function removeEntity(_0x22906c,_0x38fb39){return function(_0x133706){if(_0x133706){return _0x133706[_0xdd12('0x24')]()['then'](function(){var _0x256296=_0x133706[_0xdd12('0x25')]({'plain':!![]});var _0x42b64e=_0xdd12('0x26');return db['UserProfileResource'][_0xdd12('0x24')]({'where':{'type':_0x42b64e,'resourceId':_0x256296['id']}})['then'](function(){return _0x133706;});})[_0xdd12('0x23')](function(){_0x22906c[_0xdd12('0x19')](0xcc)[_0xdd12('0x1a')]();});}};}function handleEntityNotFound(_0x2018a5,_0x521e4a){return function(_0x245e66){if(!_0x245e66){_0x2018a5[_0xdd12('0x27')](0x194);}return _0x245e66;};}function handleError(_0x5291df,_0x4b6616){_0x4b6616=_0x4b6616||0x1f4;return function(_0x583c83){logger['error'](_0x583c83['stack']);if(_0x583c83['name']){delete _0x583c83[_0xdd12('0x28')];}_0x5291df[_0xdd12('0x19')](_0x4b6616)['send'](_0x583c83);};}exports[_0xdd12('0x29')]=function(_0x2deed1,_0x2d77f2){var _0x2e83e9={},_0x239ef0={},_0x42f0ef={'count':0x0,'rows':[]};return db['CmCompany'][_0xdd12('0x2a')]()['then'](function(_0x6a02d6){_0x239ef0[_0xdd12('0x2b')]=_['keys'](_0x6a02d6);_0x239ef0['query']=_[_0xdd12('0x2c')](_0x2deed1['query']);_0x239ef0['filters']=_[_0xdd12('0x2d')](_0x239ef0[_0xdd12('0x2b')],_0x239ef0['query']);_0x2e83e9[_0xdd12('0x2e')]=_[_0xdd12('0x2d')](_0x239ef0[_0xdd12('0x2b')],qs[_0xdd12('0x2f')](_0x2deed1[_0xdd12('0x30')][_0xdd12('0x2f')]));_0x2e83e9[_0xdd12('0x2e')]=_0x2e83e9['attributes']['length']?_0x2e83e9[_0xdd12('0x2e')]:_0x239ef0[_0xdd12('0x2b')];if(!_0x2deed1[_0xdd12('0x30')][_0xdd12('0x31')](_0xdd12('0x32'))){_0x2e83e9[_0xdd12('0x1f')]=qs[_0xdd12('0x1f')](_0x2deed1[_0xdd12('0x30')][_0xdd12('0x1f')]);_0x2e83e9[_0xdd12('0x1c')]=qs[_0xdd12('0x1c')](_0x2deed1[_0xdd12('0x30')]['offset']);}_0x2e83e9['order']=qs['sort'](_0x2deed1[_0xdd12('0x30')][_0xdd12('0x33')]);_0x2e83e9[_0xdd12('0x34')]=qs[_0xdd12('0x35')](_[_0xdd12('0x36')](_0x2deed1[_0xdd12('0x30')],_0x239ef0['filters']),_0x6a02d6);if(_0x2deed1[_0xdd12('0x30')][_0xdd12('0x37')]){_0x2e83e9[_0xdd12('0x34')]=_[_0xdd12('0x38')](_0x2e83e9[_0xdd12('0x34')],{'$or':_[_0xdd12('0x39')](_0x2e83e9[_0xdd12('0x2e')],function(_0x6a1b2){var _0x5446ec={};_0x5446ec[_0x6a1b2]={'$like':'%'+_0x2deed1[_0xdd12('0x30')][_0xdd12('0x37')]+'%'};return _0x5446ec;})});}_0x2e83e9=_[_0xdd12('0x38')]({},_0x2e83e9,_0x2deed1[_0xdd12('0x3a')]);var _0x266899={'where':_0x2e83e9[_0xdd12('0x34')]};return db[_0xdd12('0x3b')][_0xdd12('0x1e')](_0x266899)[_0xdd12('0x23')](function(_0x5b7cfa){_0x42f0ef[_0xdd12('0x1e')]=_0x5b7cfa;if(_0x2deed1[_0xdd12('0x30')][_0xdd12('0x3c')]){_0x2e83e9['include']=[{'all':!![]}];}return db[_0xdd12('0x3b')]['findAll'](_0x2e83e9);})[_0xdd12('0x23')](function(_0x3b75b3){_0x42f0ef[_0xdd12('0x3d')]=_0x3b75b3;return _0x42f0ef;})[_0xdd12('0x23')](respondWithFilteredResult(_0x2d77f2,_0x2e83e9))[_0xdd12('0x3e')](handleError(_0x2d77f2,null));})[_0xdd12('0x3e')](handleError(_0x2d77f2,null));};exports[_0xdd12('0x3f')]=function(_0x5863b0,_0x52daba){var _0x62a5f3={'raw':![],'where':{'id':_0x5863b0['params']['id']}},_0x3b9663={};_0x3b9663[_0xdd12('0x2b')]=_['keys'](db[_0xdd12('0x3b')][_0xdd12('0x40')]);_0x3b9663['query']=_[_0xdd12('0x2c')](_0x5863b0[_0xdd12('0x30')]);_0x3b9663[_0xdd12('0x35')]=_['intersection'](_0x3b9663[_0xdd12('0x2b')],_0x3b9663['query']);_0x62a5f3[_0xdd12('0x2e')]=_[_0xdd12('0x2d')](_0x3b9663['model'],qs[_0xdd12('0x2f')](_0x5863b0[_0xdd12('0x30')][_0xdd12('0x2f')]));_0x62a5f3[_0xdd12('0x2e')]=_0x62a5f3[_0xdd12('0x2e')][_0xdd12('0x41')]?_0x62a5f3[_0xdd12('0x2e')]:_0x3b9663[_0xdd12('0x2b')];if(_0x5863b0[_0xdd12('0x30')][_0xdd12('0x3c')]){_0x62a5f3['include']=[{'all':!![]}];}_0x62a5f3=_['merge']({},_0x62a5f3,_0x5863b0[_0xdd12('0x3a')]);return db['CmCompany'][_0xdd12('0x42')](_0x62a5f3)[_0xdd12('0x23')](handleEntityNotFound(_0x52daba,null))[_0xdd12('0x23')](respondWithResult(_0x52daba,null))[_0xdd12('0x3e')](handleError(_0x52daba,null));};exports['create']=function(_0x34d5d2,_0x90d04e){return db['CmCompany']['create'](_0x34d5d2[_0xdd12('0x43')],{})['then'](function(_0x41d31a){var _0x27b517=_0x34d5d2[_0xdd12('0x44')][_0xdd12('0x25')]({'plain':!![]});if(!_0x27b517)throw new Error(_0xdd12('0x45'));if(_0x27b517['role']==='user'){var _0x3e3b87=_0x41d31a[_0xdd12('0x25')]({'plain':!![]});var _0xcd13c2=_0xdd12('0x26');return db[_0xdd12('0x46')]['find']({'where':{'name':_0xcd13c2,'userProfileId':_0x27b517[_0xdd12('0x47')]},'raw':!![]})['then'](function(_0x499e15){if(_0x499e15&&_0x499e15[_0xdd12('0x48')]===0x0){return db[_0xdd12('0x49')][_0xdd12('0x4a')]({'name':_0x3e3b87['name'],'resourceId':_0x3e3b87['id'],'type':_0x499e15[_0xdd12('0x28')],'sectionId':_0x499e15['id']},{})['then'](function(){return _0x41d31a;});}else{return _0x41d31a;}})[_0xdd12('0x3e')](function(_0x3ee014){logger[_0xdd12('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ee014);throw _0x3ee014;});}return _0x41d31a;})[_0xdd12('0x23')](respondWithResult(_0x90d04e,0xc9))[_0xdd12('0x3e')](handleError(_0x90d04e,null));};exports[_0xdd12('0x22')]=function(_0x2bc349,_0x9e3ce2){if(_0x2bc349[_0xdd12('0x43')]['id']){delete _0x2bc349[_0xdd12('0x43')]['id'];}return db['CmCompany'][_0xdd12('0x42')]({'where':{'id':_0x2bc349[_0xdd12('0x4c')]['id']}})[_0xdd12('0x23')](handleEntityNotFound(_0x9e3ce2,null))[_0xdd12('0x23')](saveUpdates(_0x2bc349[_0xdd12('0x43')],null))[_0xdd12('0x23')](respondWithResult(_0x9e3ce2,null))[_0xdd12('0x3e')](handleError(_0x9e3ce2,null));};exports['destroy']=function(_0x51e840,_0x316fc8){return db[_0xdd12('0x3b')][_0xdd12('0x42')]({'where':{'id':_0x51e840['params']['id']}})['then'](handleEntityNotFound(_0x316fc8,null))[_0xdd12('0x23')](removeEntity(_0x316fc8,null))[_0xdd12('0x3e')](handleError(_0x316fc8,null));};exports[_0xdd12('0x2a')]=function(_0x255ab6,_0x7ba7b0){return db[_0xdd12('0x3b')][_0xdd12('0x2a')]()[_0xdd12('0x23')](respondWithResult(_0x7ba7b0,null))[_0xdd12('0x3e')](handleError(_0x7ba7b0,null));};exports[_0xdd12('0x4d')]=function(_0x436555,_0x2a4942,_0x19b91d){return db[_0xdd12('0x4e')][_0xdd12('0x42')]({'where':{'id':_0x436555[_0xdd12('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2a4942,null))[_0xdd12('0x23')](function(_0x120a59){if(_0x120a59){return _0x120a59[_0xdd12('0x4d')](_0x436555['body'][_0xdd12('0x4f')],_[_0xdd12('0x50')](_0x436555[_0xdd12('0x43')],['ids','id'])||{});}})['then'](respondWithResult(_0x2a4942,null))[_0xdd12('0x3e')](handleError(_0x2a4942,null));};exports[_0xdd12('0x51')]=function(_0x397ad5,_0x4bf657,_0x4a3f4c){var _0x59a7f0={};var _0x3f4665={};var _0x10e02a;var _0x38abe9;return db[_0xdd12('0x3b')][_0xdd12('0x52')]({'where':{'id':_0x397ad5[_0xdd12('0x4c')]['id']}})[_0xdd12('0x23')](handleEntityNotFound(_0x4bf657,null))[_0xdd12('0x23')](function(_0x42f680){if(_0x42f680){_0x10e02a=_0x42f680;_0x3f4665[_0xdd12('0x2b')]=_[_0xdd12('0x2c')](db[_0xdd12('0x4e')]['rawAttributes']);_0x3f4665[_0xdd12('0x30')]=_[_0xdd12('0x2c')](_0x397ad5[_0xdd12('0x30')]);_0x3f4665[_0xdd12('0x35')]=_[_0xdd12('0x2d')](_0x3f4665[_0xdd12('0x2b')],_0x3f4665[_0xdd12('0x30')]);_0x59a7f0[_0xdd12('0x2e')]=_[_0xdd12('0x2d')](_0x3f4665['model'],qs[_0xdd12('0x2f')](_0x397ad5[_0xdd12('0x30')][_0xdd12('0x2f')]));_0x59a7f0[_0xdd12('0x2e')]=_0x59a7f0[_0xdd12('0x2e')][_0xdd12('0x41')]?_0x59a7f0[_0xdd12('0x2e')]:_0x3f4665['model'];_0x59a7f0['order']=qs[_0xdd12('0x33')](_0x397ad5[_0xdd12('0x30')][_0xdd12('0x33')]);_0x59a7f0[_0xdd12('0x34')]=qs['filters'](_['pick'](_0x397ad5[_0xdd12('0x30')],_0x3f4665[_0xdd12('0x35')]));if(_0x397ad5[_0xdd12('0x30')][_0xdd12('0x37')]){_0x59a7f0[_0xdd12('0x34')]=_[_0xdd12('0x38')](_0x59a7f0['where'],{'$or':_[_0xdd12('0x39')](_0x59a7f0[_0xdd12('0x2e')],function(_0xcf4777){var _0x409132={};_0x409132[_0xcf4777]={'$like':'%'+_0x397ad5[_0xdd12('0x30')][_0xdd12('0x37')]+'%'};return _0x409132;})});}_0x59a7f0=_[_0xdd12('0x38')]({},_0x59a7f0,_0x397ad5[_0xdd12('0x3a')]);return _0x10e02a[_0xdd12('0x51')](_0x59a7f0);}})[_0xdd12('0x23')](function(_0x5310a1){if(_0x5310a1){_0x38abe9=_0x5310a1[_0xdd12('0x41')];if(!_0x397ad5[_0xdd12('0x30')]['hasOwnProperty'](_0xdd12('0x32'))){_0x59a7f0[_0xdd12('0x1f')]=qs[_0xdd12('0x1f')](_0x397ad5['query']['limit']);_0x59a7f0[_0xdd12('0x1c')]=qs[_0xdd12('0x1c')](_0x397ad5[_0xdd12('0x30')][_0xdd12('0x1c')]);}return _0x10e02a[_0xdd12('0x51')](_0x59a7f0);}})[_0xdd12('0x23')](function(_0x39eb8d){if(_0x39eb8d){return _0x39eb8d?{'count':_0x38abe9,'rows':_0x39eb8d}:null;}})['then'](respondWithResult(_0x4bf657,null))[_0xdd12('0x3e')](handleError(_0x4bf657,null));}; \ No newline at end of file +var _0x62cd=['Companies','UserProfileResource','error','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addContacts','CmContact','ids','omit','findOne','pick','nolimit','getContacts','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','Content-Range','save','then','destroy','get'];(function(_0x1436c5,_0x599841){var _0x112ded=function(_0x196590){while(--_0x196590){_0x1436c5['push'](_0x1436c5['shift']());}};_0x112ded(++_0x599841);}(_0x62cd,0xda));var _0xd62c=function(_0x4a7f8a,_0x46ea56){_0x4a7f8a=_0x4a7f8a-0x0;var _0x373b5f=_0x62cd[_0x4a7f8a];return _0x373b5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd62c('0x0'));var zipdir=require(_0xd62c('0x1'));var jsonpatch=require(_0xd62c('0x2'));var rp=require('request-promise');var moment=require(_0xd62c('0x3'));var BPromise=require(_0xd62c('0x4'));var Mustache=require(_0xd62c('0x5'));var util=require(_0xd62c('0x6'));var path=require(_0xd62c('0x7'));var sox=require(_0xd62c('0x8'));var csv=require(_0xd62c('0x9'));var ejs=require(_0xd62c('0xa'));var fs=require('fs');var fs_extra=require(_0xd62c('0xb'));var _=require(_0xd62c('0xc'));var squel=require(_0xd62c('0xd'));var crypto=require(_0xd62c('0xe'));var jsforce=require(_0xd62c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd62c('0x9'));var querystring=require(_0xd62c('0x10'));var Papa=require(_0xd62c('0x11'));var Redis=require('ioredis');var authService=require(_0xd62c('0x12'));var qs=require(_0xd62c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd62c('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd62c('0x15'));var db=require(_0xd62c('0x16'))['db'];function respondWithStatusCode(_0x5733a3,_0x39dde3){_0x39dde3=_0x39dde3||0xcc;return function(_0x8281de){if(_0x8281de){return _0x5733a3['sendStatus'](_0x39dde3);}return _0x5733a3['status'](_0x39dde3)[_0xd62c('0x17')]();};}function respondWithResult(_0x4e290f,_0x1253f0){_0x1253f0=_0x1253f0||0xc8;return function(_0x320032){if(_0x320032){return _0x4e290f[_0xd62c('0x18')](_0x1253f0)[_0xd62c('0x19')](_0x320032);}};}function respondWithFilteredResult(_0x1f7d1b,_0x4738f9){return function(_0x1f0095){if(_0x1f0095){var _0xe93df8=typeof _0x4738f9[_0xd62c('0x1a')]==='undefined'&&typeof _0x4738f9[_0xd62c('0x1b')]===_0xd62c('0x1c');var _0x54fda1=_0x1f0095['count'];var _0x4d9aa5=_0xe93df8?0x0:_0x4738f9[_0xd62c('0x1a')];var _0x1dbe21=_0xe93df8?_0x1f0095['count']:_0x4738f9['offset']+_0x4738f9[_0xd62c('0x1b')];var _0x10b13b;if(_0x1dbe21>=_0x54fda1){_0x1dbe21=_0x54fda1;_0x10b13b=0xc8;}else{_0x10b13b=0xce;}_0x1f7d1b[_0xd62c('0x18')](_0x10b13b);return _0x1f7d1b['set'](_0xd62c('0x1d'),_0x4d9aa5+'-'+_0x1dbe21+'/'+_0x54fda1)['json'](_0x1f0095);}return null;};}function patchUpdates(_0x585a7f){return function(_0x359337){try{jsonpatch['apply'](_0x359337,_0x585a7f,!![]);}catch(_0x5c4949){return BPromise['reject'](_0x5c4949);}return _0x359337[_0xd62c('0x1e')]();};}function saveUpdates(_0x5cd53d,_0x3e8c9d){return function(_0x55c41e){if(_0x55c41e){return _0x55c41e['update'](_0x5cd53d)[_0xd62c('0x1f')](function(_0x35dfc1){return _0x35dfc1;});}return null;};}function removeEntity(_0x5069a9,_0x32dbc3){return function(_0x34dd6b){if(_0x34dd6b){return _0x34dd6b[_0xd62c('0x20')]()['then'](function(){var _0x5d2438=_0x34dd6b[_0xd62c('0x21')]({'plain':!![]});var _0x27a925=_0xd62c('0x22');return db[_0xd62c('0x23')][_0xd62c('0x20')]({'where':{'type':_0x27a925,'resourceId':_0x5d2438['id']}})['then'](function(){return _0x34dd6b;});})['then'](function(){_0x5069a9[_0xd62c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x548b16,_0x35387b){return function(_0x378a1a){if(!_0x378a1a){_0x548b16['sendStatus'](0x194);}return _0x378a1a;};}function handleError(_0xbd8dd8,_0x4882d8){_0x4882d8=_0x4882d8||0x1f4;return function(_0x480919){logger[_0xd62c('0x24')](_0x480919['stack']);if(_0x480919[_0xd62c('0x25')]){delete _0x480919['name'];}_0xbd8dd8[_0xd62c('0x18')](_0x4882d8)[_0xd62c('0x26')](_0x480919);};}exports[_0xd62c('0x27')]=function(_0x1113d5,_0x15b0a9){var _0x1394f1={},_0x593f32={},_0x28d98e={'count':0x0,'rows':[]};return db[_0xd62c('0x28')]['describe']()[_0xd62c('0x1f')](function(_0xddb107){_0x593f32[_0xd62c('0x29')]=_[_0xd62c('0x2a')](_0xddb107);_0x593f32[_0xd62c('0x2b')]=_[_0xd62c('0x2a')](_0x1113d5[_0xd62c('0x2b')]);_0x593f32[_0xd62c('0x2c')]=_[_0xd62c('0x2d')](_0x593f32[_0xd62c('0x29')],_0x593f32[_0xd62c('0x2b')]);_0x1394f1[_0xd62c('0x2e')]=_[_0xd62c('0x2d')](_0x593f32[_0xd62c('0x29')],qs['fields'](_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x2f')]));_0x1394f1[_0xd62c('0x2e')]=_0x1394f1['attributes'][_0xd62c('0x30')]?_0x1394f1[_0xd62c('0x2e')]:_0x593f32[_0xd62c('0x29')];if(!_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x31')]('nolimit')){_0x1394f1[_0xd62c('0x1b')]=qs[_0xd62c('0x1b')](_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x1b')]);_0x1394f1['offset']=qs['offset'](_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x1a')]);}_0x1394f1[_0xd62c('0x32')]=qs['sort'](_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x33')]);_0x1394f1[_0xd62c('0x34')]=qs[_0xd62c('0x2c')](_['pick'](_0x1113d5['query'],_0x593f32[_0xd62c('0x2c')]),_0xddb107);if(_0x1113d5['query'][_0xd62c('0x35')]){_0x1394f1['where']=_[_0xd62c('0x36')](_0x1394f1[_0xd62c('0x34')],{'$or':_[_0xd62c('0x37')](_0x1394f1[_0xd62c('0x2e')],function(_0x131d21){var _0x4edd62={};_0x4edd62[_0x131d21]={'$like':'%'+_0x1113d5[_0xd62c('0x2b')]['filter']+'%'};return _0x4edd62;})});}_0x1394f1=_[_0xd62c('0x36')]({},_0x1394f1,_0x1113d5[_0xd62c('0x38')]);var _0x7c3dab={'where':_0x1394f1[_0xd62c('0x34')]};return db[_0xd62c('0x28')][_0xd62c('0x39')](_0x7c3dab)[_0xd62c('0x1f')](function(_0x734ac6){_0x28d98e[_0xd62c('0x39')]=_0x734ac6;if(_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x3a')]){_0x1394f1['include']=[{'all':!![]}];}return db[_0xd62c('0x28')][_0xd62c('0x3b')](_0x1394f1);})[_0xd62c('0x1f')](function(_0x98fac2){_0x28d98e[_0xd62c('0x3c')]=_0x98fac2;return _0x28d98e;})['then'](respondWithFilteredResult(_0x15b0a9,_0x1394f1))[_0xd62c('0x3d')](handleError(_0x15b0a9,null));})[_0xd62c('0x3d')](handleError(_0x15b0a9,null));};exports[_0xd62c('0x3e')]=function(_0x55ca6c,_0x5c3b4d){var _0x5955cc={'raw':![],'where':{'id':_0x55ca6c[_0xd62c('0x3f')]['id']}},_0x5c16de={};_0x5c16de[_0xd62c('0x29')]=_['keys'](db[_0xd62c('0x28')][_0xd62c('0x40')]);_0x5c16de[_0xd62c('0x2b')]=_['keys'](_0x55ca6c[_0xd62c('0x2b')]);_0x5c16de[_0xd62c('0x2c')]=_[_0xd62c('0x2d')](_0x5c16de[_0xd62c('0x29')],_0x5c16de[_0xd62c('0x2b')]);_0x5955cc[_0xd62c('0x2e')]=_['intersection'](_0x5c16de[_0xd62c('0x29')],qs['fields'](_0x55ca6c[_0xd62c('0x2b')][_0xd62c('0x2f')]));_0x5955cc['attributes']=_0x5955cc[_0xd62c('0x2e')]['length']?_0x5955cc[_0xd62c('0x2e')]:_0x5c16de[_0xd62c('0x29')];if(_0x55ca6c[_0xd62c('0x2b')][_0xd62c('0x3a')]){_0x5955cc['include']=[{'all':!![]}];}_0x5955cc=_['merge']({},_0x5955cc,_0x55ca6c['options']);return db[_0xd62c('0x28')][_0xd62c('0x41')](_0x5955cc)[_0xd62c('0x1f')](handleEntityNotFound(_0x5c3b4d,null))[_0xd62c('0x1f')](respondWithResult(_0x5c3b4d,null))[_0xd62c('0x3d')](handleError(_0x5c3b4d,null));};exports[_0xd62c('0x42')]=function(_0x54c40e,_0x14fe62){return db[_0xd62c('0x28')]['create'](_0x54c40e['body'],{})[_0xd62c('0x1f')](function(_0x299dc3){var _0x4b2262=_0x54c40e[_0xd62c('0x43')][_0xd62c('0x21')]({'plain':!![]});if(!_0x4b2262)throw new Error(_0xd62c('0x44'));if(_0x4b2262['role']===_0xd62c('0x43')){var _0x50deb4=_0x299dc3[_0xd62c('0x21')]({'plain':!![]});var _0x587ee7='Companies';return db[_0xd62c('0x45')]['find']({'where':{'name':_0x587ee7,'userProfileId':_0x4b2262[_0xd62c('0x46')]},'raw':!![]})[_0xd62c('0x1f')](function(_0xe49d2c){if(_0xe49d2c&&_0xe49d2c[_0xd62c('0x47')]===0x0){return db[_0xd62c('0x23')][_0xd62c('0x42')]({'name':_0x50deb4[_0xd62c('0x25')],'resourceId':_0x50deb4['id'],'type':_0xe49d2c[_0xd62c('0x25')],'sectionId':_0xe49d2c['id']},{})[_0xd62c('0x1f')](function(){return _0x299dc3;});}else{return _0x299dc3;}})[_0xd62c('0x3d')](function(_0x397de2){logger[_0xd62c('0x24')](_0xd62c('0x48'),_0x397de2);throw _0x397de2;});}return _0x299dc3;})[_0xd62c('0x1f')](respondWithResult(_0x14fe62,0xc9))[_0xd62c('0x3d')](handleError(_0x14fe62,null));};exports[_0xd62c('0x49')]=function(_0x337d0c,_0x7da848){if(_0x337d0c[_0xd62c('0x4a')]['id']){delete _0x337d0c[_0xd62c('0x4a')]['id'];}return db[_0xd62c('0x28')][_0xd62c('0x41')]({'where':{'id':_0x337d0c['params']['id']}})[_0xd62c('0x1f')](handleEntityNotFound(_0x7da848,null))[_0xd62c('0x1f')](saveUpdates(_0x337d0c[_0xd62c('0x4a')],null))[_0xd62c('0x1f')](respondWithResult(_0x7da848,null))[_0xd62c('0x3d')](handleError(_0x7da848,null));};exports[_0xd62c('0x20')]=function(_0x34616d,_0x1d6732){return db[_0xd62c('0x28')][_0xd62c('0x41')]({'where':{'id':_0x34616d['params']['id']}})[_0xd62c('0x1f')](handleEntityNotFound(_0x1d6732,null))[_0xd62c('0x1f')](removeEntity(_0x1d6732,null))[_0xd62c('0x3d')](handleError(_0x1d6732,null));};exports[_0xd62c('0x4b')]=function(_0x487d71,_0x10f3de){return db[_0xd62c('0x28')]['describe']()['then'](respondWithResult(_0x10f3de,null))[_0xd62c('0x3d')](handleError(_0x10f3de,null));};exports[_0xd62c('0x4c')]=function(_0x2ab930,_0x2cc94d,_0x3b71d6){return db[_0xd62c('0x4d')][_0xd62c('0x41')]({'where':{'id':_0x2ab930[_0xd62c('0x3f')]['id']}})[_0xd62c('0x1f')](handleEntityNotFound(_0x2cc94d,null))['then'](function(_0x38b709){if(_0x38b709){return _0x38b709['addContacts'](_0x2ab930[_0xd62c('0x4a')][_0xd62c('0x4e')],_[_0xd62c('0x4f')](_0x2ab930[_0xd62c('0x4a')],[_0xd62c('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x2cc94d,null))[_0xd62c('0x3d')](handleError(_0x2cc94d,null));};exports['getContacts']=function(_0x32b784,_0x4f30ea,_0x464b5d){var _0x38ee35={};var _0x2b8c59={};var _0x113354;var _0x28db09;return db['CmCompany'][_0xd62c('0x50')]({'where':{'id':_0x32b784['params']['id']}})[_0xd62c('0x1f')](handleEntityNotFound(_0x4f30ea,null))[_0xd62c('0x1f')](function(_0x48f805){if(_0x48f805){_0x113354=_0x48f805;_0x2b8c59[_0xd62c('0x29')]=_['keys'](db[_0xd62c('0x4d')]['rawAttributes']);_0x2b8c59[_0xd62c('0x2b')]=_[_0xd62c('0x2a')](_0x32b784['query']);_0x2b8c59['filters']=_[_0xd62c('0x2d')](_0x2b8c59[_0xd62c('0x29')],_0x2b8c59[_0xd62c('0x2b')]);_0x38ee35[_0xd62c('0x2e')]=_[_0xd62c('0x2d')](_0x2b8c59[_0xd62c('0x29')],qs[_0xd62c('0x2f')](_0x32b784[_0xd62c('0x2b')][_0xd62c('0x2f')]));_0x38ee35[_0xd62c('0x2e')]=_0x38ee35[_0xd62c('0x2e')][_0xd62c('0x30')]?_0x38ee35['attributes']:_0x2b8c59[_0xd62c('0x29')];_0x38ee35[_0xd62c('0x32')]=qs['sort'](_0x32b784[_0xd62c('0x2b')][_0xd62c('0x33')]);_0x38ee35[_0xd62c('0x34')]=qs[_0xd62c('0x2c')](_[_0xd62c('0x51')](_0x32b784['query'],_0x2b8c59[_0xd62c('0x2c')]));if(_0x32b784[_0xd62c('0x2b')][_0xd62c('0x35')]){_0x38ee35['where']=_[_0xd62c('0x36')](_0x38ee35[_0xd62c('0x34')],{'$or':_[_0xd62c('0x37')](_0x38ee35['attributes'],function(_0x2efd68){var _0x8be342={};_0x8be342[_0x2efd68]={'$like':'%'+_0x32b784[_0xd62c('0x2b')][_0xd62c('0x35')]+'%'};return _0x8be342;})});}_0x38ee35=_[_0xd62c('0x36')]({},_0x38ee35,_0x32b784[_0xd62c('0x38')]);return _0x113354['getContacts'](_0x38ee35);}})[_0xd62c('0x1f')](function(_0x38044c){if(_0x38044c){_0x28db09=_0x38044c[_0xd62c('0x30')];if(!_0x32b784[_0xd62c('0x2b')][_0xd62c('0x31')](_0xd62c('0x52'))){_0x38ee35[_0xd62c('0x1b')]=qs[_0xd62c('0x1b')](_0x32b784[_0xd62c('0x2b')][_0xd62c('0x1b')]);_0x38ee35[_0xd62c('0x1a')]=qs[_0xd62c('0x1a')](_0x32b784['query'][_0xd62c('0x1a')]);}return _0x113354[_0xd62c('0x53')](_0x38ee35);}})[_0xd62c('0x1f')](function(_0x54bea1){if(_0x54bea1){return _0x54bea1?{'count':_0x28db09,'rows':_0x54bea1}:null;}})['then'](respondWithResult(_0x4f30ea,null))['catch'](handleError(_0x4f30ea,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index b6ca71a..10f9ffa 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 _0x791d=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x791d,0x187));var _0xd791=function(_0x467527,_0x4190dd){_0x467527=_0x467527-0x0;var _0x1d3e21=_0x791d[_0x467527];return _0x1d3e21;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd791('0x0'))('api');var moment=require(_0xd791('0x1'));var BPromise=require(_0xd791('0x2'));var rp=require(_0xd791('0x3'));var fs=require('fs');var path=require(_0xd791('0x4'));var rimraf=require('rimraf');var config=require(_0xd791('0x5'));var attributes=require(_0xd791('0x6'));module[_0xd791('0x7')]=function(_0x59ef36,_0x15390a){return _0x59ef36[_0xd791('0x8')](_0xd791('0x9'),attributes,{'tableName':_0xd791('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6769=['CmCompany','cm_companies','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x53a85b,_0x269718){var _0x10296f=function(_0x55ef17){while(--_0x55ef17){_0x53a85b['push'](_0x53a85b['shift']());}};_0x10296f(++_0x269718);}(_0x6769,0xde));var _0x9676=function(_0x437bf9,_0x1a5817){_0x437bf9=_0x437bf9-0x0;var _0x5c8602=_0x6769[_0x437bf9];return _0x5c8602;};'use strict';var _=require(_0x9676('0x0'));var util=require(_0x9676('0x1'));var logger=require('../../config/logger')(_0x9676('0x2'));var moment=require(_0x9676('0x3'));var BPromise=require('bluebird');var rp=require(_0x9676('0x4'));var fs=require('fs');var path=require(_0x9676('0x5'));var rimraf=require(_0x9676('0x6'));var config=require(_0x9676('0x7'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x3739a9,_0x27baf2){return _0x3739a9['define'](_0x9676('0x8'),attributes,{'tableName':_0x9676('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 7d0e466..5335b32 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 _0xf433=['CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x415b13,_0x61c73e){var _0x5f4534=function(_0x842fcf){while(--_0x842fcf){_0x415b13['push'](_0x415b13['shift']());}};_0x5f4534(++_0x61c73e);}(_0xf433,0xd7));var _0x3f43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf433[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3f43('0x0'));var util=require('util');var moment=require(_0x3f43('0x1'));var BPromise=require(_0x3f43('0x2'));var rs=require(_0x3f43('0x3'));var fs=require('fs');var Redis=require(_0x3f43('0x4'));var db=require(_0x3f43('0x5'))['db'];var utils=require(_0x3f43('0x6'));var logger=require(_0x3f43('0x7'))(_0x3f43('0x8'));var config=require(_0x3f43('0x9'));var jayson=require(_0x3f43('0xa'));var client=jayson[_0x3f43('0xb')][_0x3f43('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x175a88,_0x48c029,_0x126c9a){return new BPromise(function(_0x16b79d,_0x14d200){return client['request'](_0x175a88,_0x126c9a)[_0x3f43('0xd')](function(_0x123cc3){logger[_0x3f43('0xe')](_0x3f43('0xf'),_0x48c029,_0x3f43('0x10'));logger['debug'](_0x3f43('0x11'),_0x48c029,_0x3f43('0x10'),JSON['stringify'](_0x123cc3));if(_0x123cc3[_0x3f43('0x12')]){if(_0x123cc3[_0x3f43('0x12')][_0x3f43('0x13')]===0x1f4){logger[_0x3f43('0x12')](_0x3f43('0xf'),_0x48c029,_0x123cc3[_0x3f43('0x12')]['message']);return _0x14d200(_0x123cc3[_0x3f43('0x12')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x48c029,_0x123cc3[_0x3f43('0x12')][_0x3f43('0x14')]);return _0x16b79d(_0x123cc3['error'][_0x3f43('0x14')]);}else{logger[_0x3f43('0xe')](_0x3f43('0xf'),_0x48c029,_0x3f43('0x10'));_0x16b79d(_0x123cc3[_0x3f43('0x15')]['message']);}})[_0x3f43('0x16')](function(_0x15a439){logger[_0x3f43('0x12')](_0x3f43('0xf'),_0x48c029,_0x15a439);_0x14d200(_0x15a439);});});} \ No newline at end of file +var _0x74ea=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x503c66,_0x253c79){var _0x4b38d3=function(_0x75807c){while(--_0x75807c){_0x503c66['push'](_0x503c66['shift']());}};_0x4b38d3(++_0x253c79);}(_0x74ea,0xb3));var _0xa74e=function(_0x14e5a1,_0x239131){_0x14e5a1=_0x14e5a1-0x0;var _0x4e6c40=_0x74ea[_0x14e5a1];return _0x4e6c40;};'use strict';var _=require(_0xa74e('0x0'));var util=require(_0xa74e('0x1'));var moment=require('moment');var BPromise=require(_0xa74e('0x2'));var rs=require(_0xa74e('0x3'));var fs=require('fs');var Redis=require(_0xa74e('0x4'));var db=require(_0xa74e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa74e('0x6'))(_0xa74e('0x7'));var config=require(_0xa74e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a7cf4,_0x3afcc0,_0xccbb6f){return new BPromise(function(_0x556a4e,_0x2584dc){return client[_0xa74e('0x9')](_0x5a7cf4,_0xccbb6f)['then'](function(_0x27d2f0){logger[_0xa74e('0xa')](_0xa74e('0xb'),_0x3afcc0,_0xa74e('0xc'));logger[_0xa74e('0xd')](_0xa74e('0xe'),_0x3afcc0,'request\x20sent',JSON['stringify'](_0x27d2f0));if(_0x27d2f0[_0xa74e('0xf')]){if(_0x27d2f0[_0xa74e('0xf')][_0xa74e('0x10')]===0x1f4){logger[_0xa74e('0xf')]('CmCompany,\x20%s,\x20%s',_0x3afcc0,_0x27d2f0[_0xa74e('0xf')][_0xa74e('0x11')]);return _0x2584dc(_0x27d2f0[_0xa74e('0xf')]['message']);}logger[_0xa74e('0xf')](_0xa74e('0xb'),_0x3afcc0,_0x27d2f0[_0xa74e('0xf')]['message']);return _0x556a4e(_0x27d2f0[_0xa74e('0xf')][_0xa74e('0x11')]);}else{logger[_0xa74e('0xa')]('CmCompany,\x20%s,\x20%s',_0x3afcc0,_0xa74e('0xc'));_0x556a4e(_0x27d2f0[_0xa74e('0x12')][_0xa74e('0x11')]);}})[_0xa74e('0x13')](function(_0x460e99){logger[_0xa74e('0xf')](_0xa74e('0xb'),_0x3afcc0,_0x460e99);_0x2584dc(_0x460e99);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 70e6cfa..1671c4a 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 _0xe6b1=['post','create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','/:id/contacts','getContacts'];(function(_0x1c5ef4,_0x2f8a43){var _0x1480ce=function(_0x5619c3){while(--_0x5619c3){_0x1c5ef4['push'](_0x1c5ef4['shift']());}};_0x1480ce(++_0x2f8a43);}(_0xe6b1,0x6a));var _0x1e6b=function(_0x170609,_0x386329){_0x170609=_0x170609-0x0;var _0x55be7c=_0xe6b1[_0x170609];return _0x55be7c;};'use strict';var multer=require('multer');var util=require(_0x1e6b('0x0'));var path=require('path');var timeout=require(_0x1e6b('0x1'));var express=require(_0x1e6b('0x2'));var router=express[_0x1e6b('0x3')]();var fs_extra=require(_0x1e6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e6b('0x5'));var config=require('../../config/environment');var controller=require(_0x1e6b('0x6'));router[_0x1e6b('0x7')]('/',auth[_0x1e6b('0x8')](),controller[_0x1e6b('0x9')]);router[_0x1e6b('0x7')]('/describe',auth[_0x1e6b('0x8')](),controller[_0x1e6b('0xa')]);router[_0x1e6b('0x7')](_0x1e6b('0xb'),auth[_0x1e6b('0x8')](),controller['show']);router[_0x1e6b('0x7')](_0x1e6b('0xc'),auth[_0x1e6b('0x8')](),controller[_0x1e6b('0xd')]);router[_0x1e6b('0xe')]('/',auth[_0x1e6b('0x8')](),controller[_0x1e6b('0xf')]);router[_0x1e6b('0xe')]('/:id/contacts',auth[_0x1e6b('0x8')](),controller['addContacts']);router[_0x1e6b('0x10')]('/:id',auth[_0x1e6b('0x8')](),controller['update']);router[_0x1e6b('0x11')]('/:id',auth[_0x1e6b('0x8')](),controller[_0x1e6b('0x12')]);module[_0x1e6b('0x13')]=router; \ No newline at end of file +var _0x923e=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','post','create','addContacts'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x923e,0x93));var _0xe923=function(_0x4f4679,_0x713087){_0x4f4679=_0x4f4679-0x0;var _0x2f7cd0=_0x923e[_0x4f4679];return _0x2f7cd0;};'use strict';var multer=require(_0xe923('0x0'));var util=require(_0xe923('0x1'));var path=require(_0xe923('0x2'));var timeout=require(_0xe923('0x3'));var express=require(_0xe923('0x4'));var router=express[_0xe923('0x5')]();var fs_extra=require(_0xe923('0x6'));var auth=require(_0xe923('0x7'));var interaction=require(_0xe923('0x8'));var config=require(_0xe923('0x9'));var controller=require(_0xe923('0xa'));router[_0xe923('0xb')]('/',auth[_0xe923('0xc')](),controller['index']);router[_0xe923('0xb')](_0xe923('0xd'),auth[_0xe923('0xc')](),controller[_0xe923('0xe')]);router['get'](_0xe923('0xf'),auth[_0xe923('0xc')](),controller[_0xe923('0x10')]);router['get'](_0xe923('0x11'),auth[_0xe923('0xc')](),controller['getContacts']);router[_0xe923('0x12')]('/',auth[_0xe923('0xc')](),controller[_0xe923('0x13')]);router[_0xe923('0x12')](_0xe923('0x11'),auth[_0xe923('0xc')](),controller[_0xe923('0x14')]);router['put']('/:id',auth[_0xe923('0xc')](),controller[_0xe923('0x15')]);router[_0xe923('0x16')](_0xe923('0xf'),auth[_0xe923('0xc')](),controller[_0xe923('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index fba0f71..745c87f 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 _0xb8d5=['lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x355347,_0x28489c){var _0x4c2085=function(_0x273f2e){while(--_0x273f2e){_0x355347['push'](_0x355347['shift']());}};_0x4c2085(++_0x28489c);}(_0xb8d5,0xcc));var _0x5b8d=function(_0x38c64b,_0x218a41){_0x38c64b=_0x38c64b-0x0;var _0x28cb02=_0xb8d5[_0x38c64b];return _0x28cb02;};'use strict';var _=require(_0x5b8d('0x0'));var Sequelize=require(_0x5b8d('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x5b8d('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5b8d('0x2')]},'postalCode':{'type':Sequelize[_0x5b8d('0x2')]},'city':{'type':Sequelize[_0x5b8d('0x2')]},'country':{'type':Sequelize[_0x5b8d('0x2')]},'dateOfBirth':{'type':Sequelize[_0x5b8d('0x2')]},'description':{'type':Sequelize[_0x5b8d('0x3')]},'phone':{'type':Sequelize[_0x5b8d('0x2')]},'mobile':{'type':Sequelize[_0x5b8d('0x2')]},'fax':{'type':Sequelize[_0x5b8d('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x5b8d('0x2')]},'facebook':{'type':Sequelize[_0x5b8d('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x5b8d('0x2')]},'teams':{'type':Sequelize[_0x5b8d('0x2')]},'viber':{'type':Sequelize[_0x5b8d('0x2')]},'line':{'type':Sequelize[_0x5b8d('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x5b8d('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x5b8d('0x4')](0x2)[_0x5b8d('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x4577=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0xed3799,_0x4b0606){var _0x20aca9=function(_0x24976c){while(--_0x24976c){_0xed3799['push'](_0xed3799['shift']());}};_0x20aca9(++_0x4b0606);}(_0x4577,0xd9));var _0x7457=function(_0x9686e3,_0x205f24){_0x9686e3=_0x9686e3-0x0;var _0x4d6220=_0x4577[_0x9686e3];return _0x4d6220;};'use strict';var _=require(_0x7457('0x0'));var Sequelize=require(_0x7457('0x1'));module[_0x7457('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x7457('0x3')]},'street':{'type':Sequelize[_0x7457('0x3')]},'postalCode':{'type':Sequelize[_0x7457('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7457('0x3')]},'dateOfBirth':{'type':Sequelize[_0x7457('0x3')]},'description':{'type':Sequelize[_0x7457('0x4')]},'phone':{'type':Sequelize[_0x7457('0x3')]},'mobile':{'type':Sequelize[_0x7457('0x3')]},'fax':{'type':Sequelize[_0x7457('0x3')]},'email':{'type':Sequelize[_0x7457('0x3')]},'url':{'type':Sequelize[_0x7457('0x3')]},'facebook':{'type':Sequelize[_0x7457('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7457('0x3')]},'skype':{'type':Sequelize[_0x7457('0x3')]},'teams':{'type':Sequelize[_0x7457('0x3')]},'viber':{'type':Sequelize[_0x7457('0x3')]},'line':{'type':Sequelize[_0x7457('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x7457('0x3')]},'UserId':{'type':Sequelize[_0x7457('0x5')]},'priority':{'type':Sequelize[_0x7457('0x5')](0x2)[_0x7457('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x7457('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 2ebc05f..18a4e16 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 _0x090d=['columnName','alias','custom','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','ReportAgentPreview','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','spread','error','find','color','$and','omit','cf_%d','table','cm_contacts','id\x20=\x20?','phone','getTags','rawAttributes','fields','options','nolimit','setTags','ids','getHoppers','pick','ContactId','include','getHopperHistories','CmHopperHistory','CmHopperFinal','includeAll','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','agent','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','fax','voice','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','VoiceCallReport','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','subject','substatus','openchannel','externalUrl','threadId','sortBy','reverse','slice','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','model','filters','query','attributes','intersection','hasOwnProperty','order','sort','where','field','from','tools_tags','select','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','expr','search','sqlOperator','conditions','value','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','type','text','start','map','filter','isNil','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','displayName','findAll'];(function(_0x9faff7,_0x59a564){var _0x4f8043=function(_0x5f060d){while(--_0x5f060d){_0x9faff7['push'](_0x9faff7['shift']());}};_0x4f8043(++_0x59a564);}(_0x090d,0x1b2));var _0xd090=function(_0x1bcc4c,_0x3b3b12){_0x1bcc4c=_0x1bcc4c-0x0;var _0x2dd241=_0x090d[_0x1bcc4c];return _0x2dd241;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd090('0x0'));var zipdir=require(_0xd090('0x1'));var jsonpatch=require(_0xd090('0x2'));var rp=require(_0xd090('0x3'));var moment=require(_0xd090('0x4'));var BPromise=require(_0xd090('0x5'));var Mustache=require(_0xd090('0x6'));var util=require(_0xd090('0x7'));var path=require('path');var sox=require(_0xd090('0x8'));var csv=require(_0xd090('0x9'));var ejs=require(_0xd090('0xa'));var fs=require('fs');var fs_extra=require(_0xd090('0xb'));var _=require(_0xd090('0xc'));var squel=require(_0xd090('0xd'));var crypto=require(_0xd090('0xe'));var jsforce=require(_0xd090('0xf'));var deskjs=require(_0xd090('0x10'));var toCsv=require(_0xd090('0x9'));var querystring=require(_0xd090('0x11'));var Papa=require(_0xd090('0x12'));var Redis=require('ioredis');var authService=require(_0xd090('0x13'));var qs=require(_0xd090('0x14'));var as=require(_0xd090('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd090('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd090('0x17'))['db'];config[_0xd090('0x18')]=_[_0xd090('0x19')](config[_0xd090('0x18')],{'host':_0xd090('0x1a'),'port':0x18eb});var socket=require(_0xd090('0x1b'))(new Redis(config[_0xd090('0x18')]));require(_0xd090('0x1c'))[_0xd090('0x1d')](socket);function respondWithStatusCode(_0x3a4801,_0x26cc70){_0x26cc70=_0x26cc70||0xcc;return function(_0x571fd0){if(_0x571fd0){return _0x3a4801[_0xd090('0x1e')](_0x26cc70);}return _0x3a4801[_0xd090('0x1f')](_0x26cc70)[_0xd090('0x20')]();};}function respondWithResult(_0x191b07,_0x598a25){_0x598a25=_0x598a25||0xc8;return function(_0x20cb44){if(_0x20cb44){return _0x191b07['status'](_0x598a25)['json'](_0x20cb44);}};}function respondWithFilteredResult(_0x4a7af7,_0xb7bc9b){return function(_0x349b3f){if(_0x349b3f){var _0x51cf95=typeof _0xb7bc9b[_0xd090('0x21')]===_0xd090('0x22')&&typeof _0xb7bc9b[_0xd090('0x23')]===_0xd090('0x22');var _0x5335e2=_0x349b3f['count'];var _0x1a6add=_0x51cf95?0x0:_0xb7bc9b[_0xd090('0x21')];var _0x531592=_0x51cf95?_0x349b3f[_0xd090('0x24')]:_0xb7bc9b[_0xd090('0x21')]+_0xb7bc9b[_0xd090('0x23')];var _0x4792dd;if(_0x531592>=_0x5335e2){_0x531592=_0x5335e2;_0x4792dd=0xc8;}else{_0x4792dd=0xce;}_0x4a7af7[_0xd090('0x1f')](_0x4792dd);return _0x4a7af7['set'](_0xd090('0x25'),_0x1a6add+'-'+_0x531592+'/'+_0x5335e2)[_0xd090('0x26')](_0x349b3f);}return null;};}function patchUpdates(_0x2b8fa7){return function(_0xdd4bd7){try{jsonpatch[_0xd090('0x27')](_0xdd4bd7,_0x2b8fa7,!![]);}catch(_0x5cc6ed){return BPromise[_0xd090('0x28')](_0x5cc6ed);}return _0xdd4bd7['save']();};}function saveUpdates(_0x260697,_0x2a99ed){return function(_0x46db87){if(_0x46db87){return _0x46db87[_0xd090('0x29')](_0x260697)[_0xd090('0x2a')](function(_0x5f07c1){return _0x5f07c1;});}return null;};}function removeEntity(_0x745451,_0x574252){return function(_0x474bfb){if(_0x474bfb){return _0x474bfb[_0xd090('0x2b')]()['then'](function(){_0x745451[_0xd090('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x382898,_0x3c611c){return function(_0x12d301){if(!_0x12d301){_0x382898['sendStatus'](0x194);}return _0x12d301;};}function handleError(_0x4cfc48,_0x622262){_0x622262=_0x622262||0x1f4;return function(_0x5946d2){logger['error'](_0x5946d2[_0xd090('0x2c')]);if(_0x5946d2[_0xd090('0x2d')]){delete _0x5946d2[_0xd090('0x2d')];}_0x4cfc48[_0xd090('0x1f')](_0x622262)[_0xd090('0x2e')](_0x5946d2);};}exports[_0xd090('0x2f')]=function(_0x3ac6a7,_0xb5b22){var _0x18039b={},_0x394214={},_0x400f20={'count':0x0,'rows':[]};return db[_0xd090('0x30')][_0xd090('0x31')]()[_0xd090('0x2a')](function(_0xc1eee2){var _0x2dbdf0=[];for(var _0x1f83e6=0x0;_0x1f83e60x1){_0x48883b['or'](_0xd090('0x6b'),qs['getFullTextValue'](_0x4118bd),null);}else{if(qs['isNumeric'](_0x4118bd)){_0x48883b['or'](_0xd090('0x6c'),_0x4118bd+'%');_0x48883b['or'](_0xd090('0x6d'),_0x4118bd+'%');_0x48883b['or'](_0xd090('0x6e'),_0x4118bd+'%');_0x48883b['or']('c.fax\x20LIKE\x20?',_0x4118bd+'%');}else if(qs[_0xd090('0x6f')](_0x4118bd)){_0x48883b['or'](_0xd090('0x70'),_0x4118bd+'%');}else{_0x48883b['or'](_0xd090('0x71'),'%'+_0x4118bd+'%');_0x48883b['or'](_0xd090('0x72'),'%'+_0x4118bd+'%');_0x48883b['or'](_0xd090('0x70'),'%'+_0x4118bd+'%');}}}}_0x1403e8['where'](_0x48883b);_0x1403e8[_0xd090('0x73')](_0xd090('0x74'));var _0x3718c6={'type':db[_0xd090('0x75')][_0xd090('0x76')][_0xd090('0x77')],'raw':!![]};var _0x5cada6=_0x1403e8[_0xd090('0x78')]()['field'](_0xd090('0x74'));if(_0x18039b[_0xd090('0x42')]){_0x18039b[_0xd090('0x42')]['forEach'](function(_0x3d8ada){_0x1403e8[_0xd090('0x42')]('c.'+_0x3d8ada[0x0],_0x3d8ada[0x1]===_0xd090('0x79')?![]:!![]);});}if(!_[_0xd090('0x63')](_0x11753d)){_0x1403e8[_0xd090('0x7a')](_0x7c2014);_0x5cada6['where'](_0xd090('0x7b'),_0x11753d);}BPromise[_0xd090('0x7c')]()[_0xd090('0x2a')](function(){if(!_0x384199)return;if(_0x3ac6a7[_0xd090('0x7d')][_0xd090('0x7e')]!=='agent')return;if(!_[_0xd090('0x7f')](_0x384199['conditions'],['field',_0xd090('0x56')])){return _0x3ac6a7[_0xd090('0x7d')][_0xd090('0x80')]({'attributes':['id'],'raw':!![]})['then'](function(_0x318f57){if(_[_0xd090('0x63')](_0x318f57)){_0x5cada6[_0xd090('0x44')](_0xd090('0x81'));_0x1403e8[_0xd090('0x44')](_0xd090('0x81'));}else{_0x5cada6[_0xd090('0x44')]('c.ListId\x20IN\x20?',_['map'](_0x318f57,'id'));_0x1403e8[_0xd090('0x44')](_0xd090('0x82'),_[_0xd090('0x5f')](_0x318f57,'id'));}});}})[_0xd090('0x2a')](function(){if(_0x3ac6a7[_0xd090('0x7d')][_0xd090('0x7e')]==='agent'&&!_0x384199&&!_0x3ac6a7[_0xd090('0x3e')][_0xd090('0x64')])return[];return db[_0xd090('0x83')][_0xd090('0x3e')](_0x5cada6[_0xd090('0x84')](),_0x3718c6);})[_0xd090('0x2a')](function(_0x433b6a){_0x400f20[_0xd090('0x24')]=_0x433b6a[_0xd090('0x33')];if(_0x400f20[_0xd090('0x24')]===0x0)return[];return db['sequelize'][_0xd090('0x3e')](_0x17e7c2[_0xd090('0x84')](),_0x3718c6)[_0xd090('0x2a')](function(_0x3ccb8b){_0x19d2e=_[_0xd090('0x85')](_0x3ccb8b,'id');_0x3718c6=_[_0xd090('0x86')](_0x3718c6,{'model':db[_0xd090('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ac6a7['query']['fields']){_0x18039b['attributes'][_0xd090('0x53')](function(_0x1b8909){_0x1403e8[_0xd090('0x45')]('c.'+_0x1b8909);});}else{_0x1403e8[_0xd090('0x45')]('c.id');_0x1403e8[_0xd090('0x45')](_0xd090('0x87'));_0x1403e8[_0xd090('0x45')](_0xd090('0x88'));_0x1403e8['field'](_0xd090('0x89'));_0x1403e8[_0xd090('0x45')](_0xd090('0x8a'));_0x1403e8['field']('c.fax');_0x1403e8['field'](_0xd090('0x8b'));_0x1403e8['field'](_0xd090('0x8c'));_0x1403e8[_0xd090('0x45')](_0xd090('0x8d'));_0x1403e8[_0xd090('0x45')](_0xd090('0x8e'));_0x1403e8[_0xd090('0x45')](_0xd090('0x8f'));_0x1403e8['field'](_0xd090('0x90'),_0xd090('0x91'));}if(_0x18039b['limit'])_0x1403e8['limit'](_0x18039b['limit']);if(_0x18039b[_0xd090('0x21')])_0x1403e8['offset'](_0x18039b[_0xd090('0x21')]);return db[_0xd090('0x83')][_0xd090('0x3e')](_0x1403e8['toString'](),_0x3718c6);});})[_0xd090('0x2a')](function(_0x51d0f9){_0x51d0f9['forEach'](function(_0x59116f){if(_0x59116f[_0xd090('0x91')]){_0x59116f[_0xd090('0x92')]=[];_0x59116f['TagIds'][_0xd090('0x52')](',')['forEach'](function(_0x4eb100){_0x59116f[_0xd090('0x92')][_0xd090('0x36')](_0x19d2e[_0x4eb100]);});}delete _0x59116f['TagIds'];});_0x400f20[_0xd090('0x93')]=_0x51d0f9;return _0x400f20;})[_0xd090('0x2a')](respondWithFilteredResult(_0xb5b22,_0x18039b));})[_0xd090('0x94')](handleError(_0xb5b22,null));};exports[_0xd090('0x2b')]=function(_0x3766a0,_0x5717a1){return db['CmContact']['find']({'where':{'id':_0x3766a0[_0xd090('0x95')]['id']}})['then'](handleEntityNotFound(_0x5717a1,null))[_0xd090('0x2a')](removeEntity(_0x5717a1,null))[_0xd090('0x94')](handleError(_0x5717a1,null));};exports[_0xd090('0x31')]=function(_0x4bac2a,_0x138b22){return db[_0xd090('0x30')]['describe']()['then'](function(_0x2d0f4f){delete _0x2d0f4f['tags'];for(var _0x4058d1=0x0;_0x4058d1=_0x2effa6){_0x5b8dac=_0x2effa6;_0xfd3e6=0xc8;}else{_0xfd3e6=0xce;}_0x2b583f[_0x5e28('0x1e')](_0xfd3e6);return _0x2b583f['set'](_0x5e28('0x23'),_0x262081+'-'+_0x5b8dac+'/'+_0x2effa6)[_0x5e28('0x24')](_0x27b9df);}return null;};}function patchUpdates(_0x40fe4b){return function(_0x1064e7){try{jsonpatch['apply'](_0x1064e7,_0x40fe4b,!![]);}catch(_0x731856){return BPromise[_0x5e28('0x25')](_0x731856);}return _0x1064e7[_0x5e28('0x26')]();};}function saveUpdates(_0x16510d,_0x3f6840){return function(_0x102642){if(_0x102642){return _0x102642[_0x5e28('0x27')](_0x16510d)[_0x5e28('0x28')](function(_0xcb22cf){return _0xcb22cf;});}return null;};}function removeEntity(_0x14f1b8,_0x4f56db){return function(_0x1b4238){if(_0x1b4238){return _0x1b4238[_0x5e28('0x29')]()[_0x5e28('0x28')](function(){_0x14f1b8[_0x5e28('0x1e')](0xcc)[_0x5e28('0x2a')]();});}};}function handleEntityNotFound(_0x3c3956,_0x3d5c87){return function(_0x55598a){if(!_0x55598a){_0x3c3956['sendStatus'](0x194);}return _0x55598a;};}function handleError(_0x33eb78,_0x58c926){_0x58c926=_0x58c926||0x1f4;return function(_0x710d9b){logger[_0x5e28('0x2b')](_0x710d9b['stack']);if(_0x710d9b[_0x5e28('0x2c')]){delete _0x710d9b[_0x5e28('0x2c')];}_0x33eb78[_0x5e28('0x1e')](_0x58c926)[_0x5e28('0x2d')](_0x710d9b);};}exports['index']=function(_0x361717,_0x288a2e){var _0x3a241b={},_0x389492={},_0xaa0d8c={'count':0x0,'rows':[]};return db[_0x5e28('0x2e')][_0x5e28('0x2f')]()[_0x5e28('0x28')](function(_0x3967ec){var _0xa13ecd=[];for(var _0x485958=0x0;_0x4859580x1){_0x5ae3fe['or'](_0x5e28('0x6e'),qs['getFullTextValue'](_0x6fd7b0),null);}else{if(qs[_0x5e28('0x6f')](_0x6fd7b0)){_0x5ae3fe['or']('c.id\x20LIKE\x20?',_0x6fd7b0+'%');_0x5ae3fe['or']('c.phone\x20LIKE\x20?',_0x6fd7b0+'%');_0x5ae3fe['or'](_0x5e28('0x70'),_0x6fd7b0+'%');_0x5ae3fe['or'](_0x5e28('0x71'),_0x6fd7b0+'%');}else if(qs[_0x5e28('0x72')](_0x6fd7b0)){_0x5ae3fe['or'](_0x5e28('0x73'),_0x6fd7b0+'%');}else{_0x5ae3fe['or']('c.firstName\x20LIKE\x20?','%'+_0x6fd7b0+'%');_0x5ae3fe['or'](_0x5e28('0x74'),'%'+_0x6fd7b0+'%');_0x5ae3fe['or'](_0x5e28('0x73'),'%'+_0x6fd7b0+'%');}}}}_0x56c43e['where'](_0x5ae3fe);_0x56c43e[_0x5e28('0x75')]('c.id');var _0x5a3a82={'type':db['Sequelize'][_0x5e28('0x76')][_0x5e28('0x77')],'raw':!![]};var _0x5c3436=_0x56c43e['clone']()[_0x5e28('0x47')]('c.id');if(_0x3a241b[_0x5e28('0x42')]){_0x3a241b[_0x5e28('0x42')][_0x5e28('0x59')](function(_0x2d240c){_0x56c43e[_0x5e28('0x42')]('c.'+_0x2d240c[0x0],_0x2d240c[0x1]===_0x5e28('0x78')?![]:!![]);});}if(!_[_0x5e28('0x67')](_0x1602a5)){_0x56c43e['having'](_0x199ad8);_0x5c3436['where']('t.id\x20IN\x20?',_0x1602a5);}BPromise[_0x5e28('0x79')]()[_0x5e28('0x28')](function(){if(!_0x371851)return;if(_0x361717['user']['role']!==_0x5e28('0x7a'))return;if(!_[_0x5e28('0x7b')](_0x371851[_0x5e28('0x53')],[_0x5e28('0x47'),_0x5e28('0x5c')])){return _0x361717['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x5e28('0x28')](function(_0x430be4){if(_[_0x5e28('0x67')](_0x430be4)){_0x5c3436[_0x5e28('0x44')](_0x5e28('0x7c'));_0x56c43e[_0x5e28('0x44')](_0x5e28('0x7c'));}else{_0x5c3436[_0x5e28('0x44')](_0x5e28('0x68'),_['map'](_0x430be4,'id'));_0x56c43e['where']('c.ListId\x20IN\x20?',_['map'](_0x430be4,'id'));}});}})[_0x5e28('0x28')](function(){if(_0x361717[_0x5e28('0x7d')][_0x5e28('0x7e')]===_0x5e28('0x7a')&&!_0x371851&&!_0x361717[_0x5e28('0x3b')][_0x5e28('0x7f')])return[];return db[_0x5e28('0x80')][_0x5e28('0x3b')](_0x5c3436[_0x5e28('0x81')](),_0x5a3a82);})['then'](function(_0x1b0c0a){_0xaa0d8c['count']=_0x1b0c0a[_0x5e28('0x30')];if(_0xaa0d8c[_0x5e28('0x22')]===0x0)return[];return db['sequelize'][_0x5e28('0x3b')](_0x4910bc[_0x5e28('0x81')](),_0x5a3a82)[_0x5e28('0x28')](function(_0x2446b2){_0xdcda3b=_[_0x5e28('0x82')](_0x2446b2,'id');_0x5a3a82=_[_0x5e28('0x83')](_0x5a3a82,{'model':db[_0x5e28('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x361717[_0x5e28('0x3b')][_0x5e28('0x3f')]){_0x3a241b[_0x5e28('0x3e')][_0x5e28('0x59')](function(_0x44ad96){_0x56c43e['field']('c.'+_0x44ad96);});}else{_0x56c43e[_0x5e28('0x47')](_0x5e28('0x84'));_0x56c43e[_0x5e28('0x47')]('c.firstName');_0x56c43e[_0x5e28('0x47')]('c.lastName');_0x56c43e[_0x5e28('0x47')](_0x5e28('0x85'));_0x56c43e['field'](_0x5e28('0x86'));_0x56c43e[_0x5e28('0x47')]('c.fax');_0x56c43e['field']('c.email');_0x56c43e[_0x5e28('0x47')](_0x5e28('0x87'));_0x56c43e[_0x5e28('0x47')](_0x5e28('0x88'));_0x56c43e['field'](_0x5e28('0x89'));_0x56c43e[_0x5e28('0x47')](_0x5e28('0x8a'));_0x56c43e[_0x5e28('0x47')](_0x5e28('0x8b'),_0x5e28('0x8c'));}if(_0x3a241b['limit'])_0x56c43e[_0x5e28('0x21')](_0x3a241b[_0x5e28('0x21')]);if(_0x3a241b[_0x5e28('0x1f')])_0x56c43e['offset'](_0x3a241b[_0x5e28('0x1f')]);return db[_0x5e28('0x80')]['query'](_0x56c43e[_0x5e28('0x81')](),_0x5a3a82);});})[_0x5e28('0x28')](function(_0x2af0db){_0x2af0db['forEach'](function(_0x1445c0){if(_0x1445c0[_0x5e28('0x8c')]){_0x1445c0[_0x5e28('0x8d')]=[];_0x1445c0[_0x5e28('0x8c')][_0x5e28('0x57')](',')[_0x5e28('0x59')](function(_0x49c687){_0x1445c0[_0x5e28('0x8d')][_0x5e28('0x33')](_0xdcda3b[_0x49c687]);});}delete _0x1445c0[_0x5e28('0x8c')];});_0xaa0d8c[_0x5e28('0x8e')]=_0x2af0db;return _0xaa0d8c;})[_0x5e28('0x28')](respondWithFilteredResult(_0x288a2e,_0x3a241b));})[_0x5e28('0x8f')](handleError(_0x288a2e,null));};exports[_0x5e28('0x29')]=function(_0x5492ac,_0x590592){return db[_0x5e28('0x2e')]['find']({'where':{'id':_0x5492ac[_0x5e28('0x90')]['id']}})[_0x5e28('0x28')](handleEntityNotFound(_0x590592,null))['then'](removeEntity(_0x590592,null))[_0x5e28('0x8f')](handleError(_0x590592,null));};exports['describe']=function(_0x147783,_0x5c3b8a){return db[_0x5e28('0x2e')][_0x5e28('0x2f')]()[_0x5e28('0x28')](function(_0x3a2e4f){delete _0x3a2e4f[_0x5e28('0x91')];for(var _0x11a961=0x0;_0x11a961{}\s\\|]/g,'-');_0x1fc50d(null,util['format'](_0x5abe('0x23'),path[_0x5abe('0x24')](_0x297a80[_0x5abe('0x21')],path[_0x5abe('0x25')](_0x297a80[_0x5abe('0x21')])),Date[_0x5abe('0x26')](),path[_0x5abe('0x25')](_0x297a80[_0x5abe('0x21')])));}})});router[_0x5abe('0x19')](_0x5abe('0x27'),upload[_0x5abe('0x28')]('file'),controller[_0x5abe('0x29')]);var upload=multer({'storage':multer[_0x5abe('0x1f')]({'destination':function(_0x1594a5,_0x2008b4,_0xf77465){_0xf77465(null,path[_0x5abe('0x2a')](config[_0x5abe('0x2b')],_0x5abe('0x20')));},'filename':function(_0x2975b1,_0x18da6d,_0x27349c){_0x18da6d['originalname']=_0x18da6d[_0x5abe('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x27349c(null,util[_0x5abe('0x2c')](_0x5abe('0x23'),path[_0x5abe('0x24')](_0x18da6d['originalname'],path['extname'](_0x18da6d[_0x5abe('0x21')])),Date[_0x5abe('0x26')](),path[_0x5abe('0x25')](_0x18da6d['originalname'])));}})});router[_0x5abe('0x19')](_0x5abe('0x2d'),upload[_0x5abe('0x28')](_0x5abe('0x2e')),controller[_0x5abe('0x2f')]);router[_0x5abe('0x19')](_0x5abe('0x30'),auth[_0x5abe('0xb')](),controller['import']);router[_0x5abe('0x31')](_0x5abe('0xd'),auth[_0x5abe('0xb')](),controller['update']);router['delete'](_0x5abe('0xd'),auth[_0x5abe('0xb')](),controller[_0x5abe('0x32')]);module[_0x5abe('0x33')]=router; \ No newline at end of file +var _0x51ab=['format','%s-%s%s','basename','extname','now','/csv','file','uploadCsv','upload','/upload/:id','import','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51ab,0x1b0));var _0xb51a=function(_0x49b4a8,_0x5f16d4){_0x49b4a8=_0x49b4a8-0x0;var _0x557b52=_0x51ab[_0x49b4a8];return _0x557b52;};'use strict';var multer=require(_0xb51a('0x0'));var util=require(_0xb51a('0x1'));var path=require('path');var timeout=require(_0xb51a('0x2'));var express=require('express');var router=express[_0xb51a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb51a('0x4'));var interaction=require(_0xb51a('0x5'));var config=require(_0xb51a('0x6'));var controller=require(_0xb51a('0x7'));router[_0xb51a('0x8')]('/',auth[_0xb51a('0x9')](),controller['index']);router['get']('/describe',auth[_0xb51a('0x9')](),controller[_0xb51a('0xa')]);router[_0xb51a('0x8')](_0xb51a('0xb'),auth[_0xb51a('0x9')](),controller[_0xb51a('0xc')]);router[_0xb51a('0x8')](_0xb51a('0xd'),auth['isAuthenticated'](),controller[_0xb51a('0xe')]);router[_0xb51a('0x8')](_0xb51a('0xf'),auth[_0xb51a('0x9')](),controller[_0xb51a('0x10')]);router[_0xb51a('0x8')]('/:id/hopper_histories',auth[_0xb51a('0x9')](),controller[_0xb51a('0x11')]);router[_0xb51a('0x8')](_0xb51a('0x12'),auth[_0xb51a('0x9')](),controller[_0xb51a('0x13')]);router[_0xb51a('0x8')](_0xb51a('0x14'),auth[_0xb51a('0x9')](),controller[_0xb51a('0x15')]);router[_0xb51a('0x8')](_0xb51a('0x16'),auth['isAuthenticated'](),controller[_0xb51a('0x17')]);router[_0xb51a('0x18')](_0xb51a('0x19'),auth['isAuthenticated'](),controller[_0xb51a('0x1a')]);router[_0xb51a('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb51a('0x18')](_0xb51a('0x1b'),auth[_0xb51a('0x9')](),controller[_0xb51a('0x1c')]);router['post'](_0xb51a('0xd'),auth[_0xb51a('0x9')](),controller[_0xb51a('0x1d')]);var upload=multer({'storage':multer[_0xb51a('0x1e')]({'destination':function(_0x40e170,_0x462252,_0x41168c){_0x41168c(null,path[_0xb51a('0x1f')](config[_0xb51a('0x20')],_0xb51a('0x21')));},'filename':function(_0x503058,_0x844fcf,_0x590580){_0x844fcf[_0xb51a('0x22')]=_0x844fcf[_0xb51a('0x22')][_0xb51a('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x590580(null,util[_0xb51a('0x24')](_0xb51a('0x25'),path[_0xb51a('0x26')](_0x844fcf[_0xb51a('0x22')],path[_0xb51a('0x27')](_0x844fcf['originalname'])),Date[_0xb51a('0x28')](),path[_0xb51a('0x27')](_0x844fcf[_0xb51a('0x22')])));}})});router[_0xb51a('0x18')](_0xb51a('0x29'),upload['single'](_0xb51a('0x2a')),controller[_0xb51a('0x2b')]);var upload=multer({'storage':multer[_0xb51a('0x1e')]({'destination':function(_0x4386d5,_0xf14c8b,_0x13ba5a){_0x13ba5a(null,path['join'](config[_0xb51a('0x20')],_0xb51a('0x21')));},'filename':function(_0x11b8d6,_0x17f1bf,_0x6b5da1){_0x17f1bf[_0xb51a('0x22')]=_0x17f1bf[_0xb51a('0x22')][_0xb51a('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6b5da1(null,util[_0xb51a('0x24')](_0xb51a('0x25'),path[_0xb51a('0x26')](_0x17f1bf[_0xb51a('0x22')],path[_0xb51a('0x27')](_0x17f1bf['originalname'])),Date['now'](),path[_0xb51a('0x27')](_0x17f1bf[_0xb51a('0x22')])));}})});router[_0xb51a('0x18')]('/upload',upload['single'](_0xb51a('0x2a')),controller[_0xb51a('0x2c')]);router[_0xb51a('0x18')](_0xb51a('0x2d'),auth[_0xb51a('0x9')](),controller[_0xb51a('0x2e')]);router[_0xb51a('0x2f')](_0xb51a('0xb'),auth[_0xb51a('0x9')](),controller[_0xb51a('0x30')]);router[_0xb51a('0x31')](_0xb51a('0xb'),auth['isAuthenticated'](),controller[_0xb51a('0x32')]);module[_0xb51a('0x33')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c54dccf..bad965c 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 _0xb47b=['values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','long','select','parse'];(function(_0x57aa1a,_0x450bea){var _0x73ce1f=function(_0x379cb0){while(--_0x379cb0){_0x57aa1a['push'](_0x57aa1a['shift']());}};_0x73ce1f(++_0x450bea);}(_0xb47b,0x114));var _0xbb47=function(_0x217612,_0x4ffd92){_0x217612=_0x217612-0x0;var _0x100bfa=_0xb47b[_0x217612];return _0x100bfa;};'use strict';var Sequelize=require('sequelize');var _=require(_0xbb47('0x0'));module[_0xbb47('0x1')]={'name':{'type':Sequelize[_0xbb47('0x2')],'get':function(_0x482e5f){return this[_0xbb47('0x3')]('alias');}},'alias':{'type':Sequelize[_0xbb47('0x4')],'allowNull':![],'set':function(_0x2506d0){this[_0xbb47('0x5')](_0xbb47('0x6'),_0x2506d0?_0x2506d0:this[_0xbb47('0x3')](_0xbb47('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xbb47('0x8')](_0xbb47('0x9')),'get':function(){if(this[_0xbb47('0x3')]('type')===_0xbb47('0xa')){return JSON[_0xbb47('0xb')](this[_0xbb47('0x3')](_0xbb47('0xc')));}else{return this[_0xbb47('0x3')](_0xbb47('0xc'));}},'set':function(_0x30e290){if(Array[_0xbb47('0xd')](_0x30e290)){this[_0xbb47('0x5')](_0xbb47('0xc'),JSON[_0xbb47('0xe')](_0x30e290));}else{this[_0xbb47('0x5')](_0xbb47('0xc'),_0x30e290);}}},'required':{'type':Sequelize[_0xbb47('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xbb47('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xbb47('0x10')](_0xbb47('0x11'))}}; \ No newline at end of file +var _0xdde9=['parse','values','isArray','setDataValue','BOOLEAN','ENUM','voice','sequelize','VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','type','select'];(function(_0x1cd962,_0x669f7){var _0x46d68d=function(_0x1fbd83){while(--_0x1fbd83){_0x1cd962['push'](_0x1cd962['shift']());}};_0x46d68d(++_0x669f7);}(_0xdde9,0x17d));var _0x9dde=function(_0x75a5,_0x38165a){_0x75a5=_0x75a5-0x0;var _0x111343=_0xdde9[_0x75a5];return _0x111343;};'use strict';var Sequelize=require(_0x9dde('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x9dde('0x1')],'get':function(_0x927325){return this[_0x9dde('0x2')](_0x9dde('0x3'));}},'alias':{'type':Sequelize[_0x9dde('0x4')],'allowNull':![],'set':function(_0x3a5d4c){this['setDataValue'](_0x9dde('0x3'),_0x3a5d4c?_0x3a5d4c:this[_0x9dde('0x2')](_0x9dde('0x5')));}},'type':{'type':Sequelize[_0x9dde('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x9dde('0x6')](_0x9dde('0x7')),'get':function(){if(this[_0x9dde('0x2')](_0x9dde('0x8'))===_0x9dde('0x9')){return JSON[_0x9dde('0xa')](this[_0x9dde('0x2')](_0x9dde('0xb')));}else{return this[_0x9dde('0x2')](_0x9dde('0xb'));}},'set':function(_0x1874eb){if(Array[_0x9dde('0xc')](_0x1874eb)){this[_0x9dde('0xd')](_0x9dde('0xb'),JSON['stringify'](_0x1874eb));}else{this['setDataValue'](_0x9dde('0xb'),_0x1874eb);}}},'required':{'type':Sequelize[_0x9dde('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x9dde('0xf')](_0x9dde('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 63e5c2a..a6b5a9b 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 _0xa255=['set','Content-Range','reject','update','destroy','then','sendStatus','error','stack','send','index','map','CmCustomField','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','find','body','create','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','format','eml-format','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count'];(function(_0x3b4963,_0xf916f4){var _0x597baa=function(_0x5b0cb0){while(--_0x5b0cb0){_0x3b4963['push'](_0x3b4963['shift']());}};_0x597baa(++_0xf916f4);}(_0xa255,0x88));var _0x5a25=function(_0x12e6dc,_0x56c555){_0x12e6dc=_0x12e6dc-0x0;var _0x1743c0=_0xa255[_0x12e6dc];return _0x1743c0;};'use strict';var emlformat=require(_0x5a25('0x0'));var rimraf=require(_0x5a25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a25('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5a25('0x3'));var util=require(_0x5a25('0x4'));var path=require(_0x5a25('0x5'));var sox=require('sox');var csv=require(_0x5a25('0x6'));var ejs=require(_0x5a25('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a25('0x8'));var squel=require(_0x5a25('0x9'));var crypto=require('crypto');var jsforce=require(_0x5a25('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5a25('0x6'));var querystring=require('querystring');var Papa=require(_0x5a25('0xb'));var Redis=require('ioredis');var authService=require(_0x5a25('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x5a25('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a25('0xe'));var utils=require('../../config/utils');var config=require(_0x5a25('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a25('0x10'))['db'];function respondWithStatusCode(_0x2afdea,_0x31e71f){_0x31e71f=_0x31e71f||0xcc;return function(_0x49b43b){if(_0x49b43b){return _0x2afdea['sendStatus'](_0x31e71f);}return _0x2afdea['status'](_0x31e71f)[_0x5a25('0x11')]();};}function respondWithResult(_0x361666,_0x13404c){_0x13404c=_0x13404c||0xc8;return function(_0xb5daa7){if(_0xb5daa7){return _0x361666[_0x5a25('0x12')](_0x13404c)[_0x5a25('0x13')](_0xb5daa7);}};}function respondWithFilteredResult(_0x4aafbc,_0xac997){return function(_0x2fb754){if(_0x2fb754){var _0x211963=typeof _0xac997[_0x5a25('0x14')]==='undefined'&&typeof _0xac997[_0x5a25('0x15')]===_0x5a25('0x16');var _0x2c3fb6=_0x2fb754[_0x5a25('0x17')];var _0x366397=_0x211963?0x0:_0xac997['offset'];var _0x5c41f3=_0x211963?_0x2fb754[_0x5a25('0x17')]:_0xac997[_0x5a25('0x14')]+_0xac997[_0x5a25('0x15')];var _0x435c63;if(_0x5c41f3>=_0x2c3fb6){_0x5c41f3=_0x2c3fb6;_0x435c63=0xc8;}else{_0x435c63=0xce;}_0x4aafbc[_0x5a25('0x12')](_0x435c63);return _0x4aafbc[_0x5a25('0x18')](_0x5a25('0x19'),_0x366397+'-'+_0x5c41f3+'/'+_0x2c3fb6)[_0x5a25('0x13')](_0x2fb754);}return null;};}function patchUpdates(_0x64848f){return function(_0x2b6a84){try{jsonpatch['apply'](_0x2b6a84,_0x64848f,!![]);}catch(_0x4fe713){return BPromise[_0x5a25('0x1a')](_0x4fe713);}return _0x2b6a84['save']();};}function saveUpdates(_0x3ae620,_0x1358a8){return function(_0x585b77){if(_0x585b77){return _0x585b77[_0x5a25('0x1b')](_0x3ae620)['then'](function(_0xadbb6){return _0xadbb6;});}return null;};}function removeEntity(_0x1ea37b,_0x1cc381){return function(_0xdadfca){if(_0xdadfca){return _0xdadfca[_0x5a25('0x1c')]()[_0x5a25('0x1d')](function(){_0x1ea37b[_0x5a25('0x12')](0xcc)[_0x5a25('0x11')]();});}};}function handleEntityNotFound(_0x4f859c,_0x1d8bf1){return function(_0xf867ba){if(!_0xf867ba){_0x4f859c[_0x5a25('0x1e')](0x194);}return _0xf867ba;};}function handleError(_0x45e146,_0x19c26d){_0x19c26d=_0x19c26d||0x1f4;return function(_0x5dc375){logger[_0x5a25('0x1f')](_0x5dc375[_0x5a25('0x20')]);if(_0x5dc375['name']){delete _0x5dc375['name'];}_0x45e146[_0x5a25('0x12')](_0x19c26d)[_0x5a25('0x21')](_0x5dc375);};}exports[_0x5a25('0x22')]=function(_0xbb3de6,_0x4b2c41){var _0x2ff898={},_0x4cf6fb={},_0xac8e98={'count':0x0,'rows':[]};var _0x5cc6d7=_[_0x5a25('0x23')](db[_0x5a25('0x24')][_0x5a25('0x25')],function(_0x3162d2){return{'name':_0x3162d2[_0x5a25('0x26')],'type':_0x3162d2[_0x5a25('0x27')]['key']};});_0x4cf6fb['model']=_['differenceBy'](_[_0x5a25('0x23')](_0x5cc6d7,_0x5a25('0x28')),[_0x5a25('0x28')]);_0x4cf6fb[_0x5a25('0x29')]=_[_0x5a25('0x2a')](_0xbb3de6['query']);_0x4cf6fb[_0x5a25('0x2b')]=_[_0x5a25('0x2c')](_0x4cf6fb[_0x5a25('0x2d')],_0x4cf6fb[_0x5a25('0x29')]);_0x2ff898[_0x5a25('0x2e')]=_[_0x5a25('0x2c')](_0x4cf6fb[_0x5a25('0x2d')],qs[_0x5a25('0x2f')](_0xbb3de6['query'][_0x5a25('0x2f')]));_0x2ff898[_0x5a25('0x2e')]=_0x2ff898['attributes'][_0x5a25('0x30')]?_0x2ff898[_0x5a25('0x2e')]:_0x4cf6fb[_0x5a25('0x2d')];if(!_0xbb3de6['query'][_0x5a25('0x31')](_0x5a25('0x32'))){_0x2ff898[_0x5a25('0x15')]=qs[_0x5a25('0x15')](_0xbb3de6['query'][_0x5a25('0x15')]);_0x2ff898[_0x5a25('0x14')]=qs[_0x5a25('0x14')](_0xbb3de6[_0x5a25('0x29')][_0x5a25('0x14')]);}_0x2ff898[_0x5a25('0x33')]=qs[_0x5a25('0x34')](_0xbb3de6['query'][_0x5a25('0x34')]);_0x2ff898[_0x5a25('0x35')]=qs[_0x5a25('0x2b')](_[_0x5a25('0x36')](_0xbb3de6[_0x5a25('0x29')],_0x4cf6fb[_0x5a25('0x2b')]),_0x5cc6d7);if(_0xbb3de6['query']['filter']){_0x2ff898['where']=_['merge'](_0x2ff898[_0x5a25('0x35')],{'$or':_[_0x5a25('0x23')](_0x5cc6d7,function(_0x2d73ab){if(_0x2d73ab[_0x5a25('0x27')]!==_0x5a25('0x37')){var _0x2e7f0d={};_0x2e7f0d[_0x2d73ab['name']]={'$like':'%'+_0xbb3de6[_0x5a25('0x29')]['filter']+'%'};return _0x2e7f0d;}})});}_0x2ff898=_['merge']({},_0x2ff898,_0xbb3de6[_0x5a25('0x38')]);var _0x33cca4={'where':_0x2ff898['where']};return db[_0x5a25('0x24')][_0x5a25('0x17')](_0x33cca4)[_0x5a25('0x1d')](function(_0x67efb9){_0xac8e98['count']=_0x67efb9;if(_0xbb3de6[_0x5a25('0x29')][_0x5a25('0x39')]){_0x2ff898['include']=[{'all':!![]}];}return db['CmCustomField'][_0x5a25('0x3a')](_0x2ff898);})[_0x5a25('0x1d')](function(_0x100425){_0xac8e98[_0x5a25('0x3b')]=_0x100425;return _0xac8e98;})['then'](respondWithFilteredResult(_0x4b2c41,_0x2ff898))[_0x5a25('0x3c')](handleError(_0x4b2c41,null));};exports[_0x5a25('0x3d')]=function(_0x33dc32,_0x37a545){var _0xb865cc={'raw':!![],'where':{'id':_0x33dc32[_0x5a25('0x3e')]['id']}},_0x3b44a3={};_0x3b44a3['model']=_[_0x5a25('0x2a')](db[_0x5a25('0x24')][_0x5a25('0x25')]);_0x3b44a3[_0x5a25('0x29')]=_[_0x5a25('0x2a')](_0x33dc32[_0x5a25('0x29')]);_0x3b44a3[_0x5a25('0x2b')]=_[_0x5a25('0x2c')](_0x3b44a3[_0x5a25('0x2d')],_0x3b44a3['query']);_0xb865cc[_0x5a25('0x2e')]=_['intersection'](_0x3b44a3['model'],qs[_0x5a25('0x2f')](_0x33dc32[_0x5a25('0x29')][_0x5a25('0x2f')]));_0xb865cc[_0x5a25('0x2e')]=_0xb865cc[_0x5a25('0x2e')]['length']?_0xb865cc[_0x5a25('0x2e')]:_0x3b44a3[_0x5a25('0x2d')];if(_0x33dc32[_0x5a25('0x29')][_0x5a25('0x39')]){_0xb865cc[_0x5a25('0x3f')]=[{'all':!![]}];}_0xb865cc=_[_0x5a25('0x40')]({},_0xb865cc,_0x33dc32[_0x5a25('0x38')]);return db[_0x5a25('0x24')][_0x5a25('0x41')](_0xb865cc)[_0x5a25('0x1d')](handleEntityNotFound(_0x37a545,null))[_0x5a25('0x1d')](respondWithResult(_0x37a545,null))[_0x5a25('0x3c')](handleError(_0x37a545,null));};exports[_0x5a25('0x1b')]=function(_0x198148,_0xa25ad6){if(_0x198148[_0x5a25('0x42')]['id']){delete _0x198148[_0x5a25('0x42')]['id'];}return db[_0x5a25('0x24')]['find']({'where':{'id':_0x198148[_0x5a25('0x3e')]['id']}})[_0x5a25('0x1d')](handleEntityNotFound(_0xa25ad6,null))[_0x5a25('0x1d')](saveUpdates(_0x198148[_0x5a25('0x42')],null))[_0x5a25('0x1d')](respondWithResult(_0xa25ad6,null))[_0x5a25('0x3c')](handleError(_0xa25ad6,null));};exports[_0x5a25('0x1c')]=function(_0x163b95,_0xd39491){return db['CmCustomField'][_0x5a25('0x41')]({'where':{'id':_0x163b95[_0x5a25('0x3e')]['id']}})[_0x5a25('0x1d')](handleEntityNotFound(_0xd39491,null))[_0x5a25('0x1d')](removeEntity(_0xd39491,null))[_0x5a25('0x3c')](handleError(_0xd39491,null));};exports[_0x5a25('0x43')]=function(_0x4f6ca8,_0x3a2636){var _0x57b12b;return db['sequelize'][_0x5a25('0x44')](function(_0x4fbf76){return db[_0x5a25('0x24')][_0x5a25('0x43')](_0x4f6ca8[_0x5a25('0x42')],{'transaction':_0x4fbf76})[_0x5a25('0x1d')](function(_0x9e518){_0x57b12b=_0x9e518;var _0x51a078={'type':db[_0x5a25('0x45')][_0x5a25('0x46')],'transaction':_0x4fbf76};switch(_0x4f6ca8[_0x5a25('0x42')][_0x5a25('0x27')]){case _0x5a25('0x47'):_0x51a078[_0x5a25('0x27')]=db[_0x5a25('0x45')][_0x5a25('0x46')];break;case'number':_0x51a078[_0x5a25('0x27')]=db['Sequelize'][_0x5a25('0x48')];break;case _0x5a25('0x49'):_0x51a078[_0x5a25('0x27')]=db['Sequelize'][_0x5a25('0x4a')];_0x51a078[_0x5a25('0x4b')]=![];break;default:}return db[_0x5a25('0x4c')]['queryInterface'][_0x5a25('0x4d')](_0x5a25('0x4e'),util[_0x5a25('0x4f')]('cf_%d',_0x57b12b['id']),_0x51a078);})[_0x5a25('0x1d')](function(){return _0x57b12b;});})[_0x5a25('0x1d')](respondWithResult(_0x3a2636,0xc9))['catch'](handleError(_0x3a2636,null));}; \ No newline at end of file +var _0xbc2b=['body','destroy','create','sequelize','transaction','TEXT','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','error','stack','name','send','index','map','CmCustomField','fieldName','type','key','differenceBy','keys','query','filters','intersection','model','attributes','fields','nolimit','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','find','update'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xbc2b,0x1b2));var _0xbbc2=function(_0x56f591,_0xd3e156){_0x56f591=_0x56f591-0x0;var _0x486bb7=_0xbc2b[_0x56f591];return _0x486bb7;};'use strict';var emlformat=require(_0xbbc2('0x0'));var rimraf=require(_0xbbc2('0x1'));var zipdir=require(_0xbbc2('0x2'));var jsonpatch=require(_0xbbc2('0x3'));var rp=require(_0xbbc2('0x4'));var moment=require(_0xbbc2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbbc2('0x6'));var util=require('util');var path=require(_0xbbc2('0x7'));var sox=require(_0xbbc2('0x8'));var csv=require(_0xbbc2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbbc2('0xa'));var _=require(_0xbbc2('0xb'));var squel=require(_0xbbc2('0xc'));var crypto=require(_0xbbc2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbbc2('0xe'));var toCsv=require(_0xbbc2('0x9'));var querystring=require(_0xbbc2('0xf'));var Papa=require(_0xbbc2('0x10'));var Redis=require(_0xbbc2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbbc2('0x12'));var as=require(_0xbbc2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbc2('0x14'))('api');var utils=require(_0xbbc2('0x15'));var config=require(_0xbbc2('0x16'));var licenseUtil=require(_0xbbc2('0x17'));var db=require(_0xbbc2('0x18'))['db'];function respondWithStatusCode(_0xb0ff64,_0x312530){_0x312530=_0x312530||0xcc;return function(_0xb49711){if(_0xb49711){return _0xb0ff64[_0xbbc2('0x19')](_0x312530);}return _0xb0ff64[_0xbbc2('0x1a')](_0x312530)[_0xbbc2('0x1b')]();};}function respondWithResult(_0x2140d6,_0x2a95cf){_0x2a95cf=_0x2a95cf||0xc8;return function(_0xf4b413){if(_0xf4b413){return _0x2140d6[_0xbbc2('0x1a')](_0x2a95cf)[_0xbbc2('0x1c')](_0xf4b413);}};}function respondWithFilteredResult(_0x5eb080,_0x29c32f){return function(_0x3f0373){if(_0x3f0373){var _0x206bcd=typeof _0x29c32f[_0xbbc2('0x1d')]===_0xbbc2('0x1e')&&typeof _0x29c32f[_0xbbc2('0x1f')]===_0xbbc2('0x1e');var _0x4f98ae=_0x3f0373[_0xbbc2('0x20')];var _0x4565b9=_0x206bcd?0x0:_0x29c32f[_0xbbc2('0x1d')];var _0x62dd07=_0x206bcd?_0x3f0373[_0xbbc2('0x20')]:_0x29c32f[_0xbbc2('0x1d')]+_0x29c32f[_0xbbc2('0x1f')];var _0x6b0799;if(_0x62dd07>=_0x4f98ae){_0x62dd07=_0x4f98ae;_0x6b0799=0xc8;}else{_0x6b0799=0xce;}_0x5eb080['status'](_0x6b0799);return _0x5eb080[_0xbbc2('0x21')]('Content-Range',_0x4565b9+'-'+_0x62dd07+'/'+_0x4f98ae)[_0xbbc2('0x1c')](_0x3f0373);}return null;};}function patchUpdates(_0x1383f3){return function(_0x17d6b8){try{jsonpatch[_0xbbc2('0x22')](_0x17d6b8,_0x1383f3,!![]);}catch(_0x5b7436){return BPromise[_0xbbc2('0x23')](_0x5b7436);}return _0x17d6b8['save']();};}function saveUpdates(_0xeead5d,_0x682b){return function(_0x28063a){if(_0x28063a){return _0x28063a['update'](_0xeead5d)[_0xbbc2('0x24')](function(_0x2a1972){return _0x2a1972;});}return null;};}function removeEntity(_0x1ac477,_0x46b14c){return function(_0x4eec87){if(_0x4eec87){return _0x4eec87['destroy']()['then'](function(){_0x1ac477[_0xbbc2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf93786,_0x12c679){return function(_0x5bd990){if(!_0x5bd990){_0xf93786[_0xbbc2('0x19')](0x194);}return _0x5bd990;};}function handleError(_0x387e4e,_0x3c5c1f){_0x3c5c1f=_0x3c5c1f||0x1f4;return function(_0x1b7a89){logger[_0xbbc2('0x25')](_0x1b7a89[_0xbbc2('0x26')]);if(_0x1b7a89[_0xbbc2('0x27')]){delete _0x1b7a89['name'];}_0x387e4e[_0xbbc2('0x1a')](_0x3c5c1f)[_0xbbc2('0x28')](_0x1b7a89);};}exports[_0xbbc2('0x29')]=function(_0x6996ed,_0x36a6a2){var _0x1a3356={},_0x2a7569={},_0x1f48e6={'count':0x0,'rows':[]};var _0x177a13=_[_0xbbc2('0x2a')](db[_0xbbc2('0x2b')]['rawAttributes'],function(_0x52d4cf){return{'name':_0x52d4cf[_0xbbc2('0x2c')],'type':_0x52d4cf[_0xbbc2('0x2d')][_0xbbc2('0x2e')]};});_0x2a7569['model']=_[_0xbbc2('0x2f')](_['map'](_0x177a13,_0xbbc2('0x27')),['name']);_0x2a7569['query']=_[_0xbbc2('0x30')](_0x6996ed[_0xbbc2('0x31')]);_0x2a7569[_0xbbc2('0x32')]=_[_0xbbc2('0x33')](_0x2a7569[_0xbbc2('0x34')],_0x2a7569[_0xbbc2('0x31')]);_0x1a3356[_0xbbc2('0x35')]=_[_0xbbc2('0x33')](_0x2a7569['model'],qs[_0xbbc2('0x36')](_0x6996ed[_0xbbc2('0x31')][_0xbbc2('0x36')]));_0x1a3356[_0xbbc2('0x35')]=_0x1a3356[_0xbbc2('0x35')]['length']?_0x1a3356[_0xbbc2('0x35')]:_0x2a7569[_0xbbc2('0x34')];if(!_0x6996ed['query']['hasOwnProperty'](_0xbbc2('0x37'))){_0x1a3356[_0xbbc2('0x1f')]=qs[_0xbbc2('0x1f')](_0x6996ed[_0xbbc2('0x31')][_0xbbc2('0x1f')]);_0x1a3356[_0xbbc2('0x1d')]=qs[_0xbbc2('0x1d')](_0x6996ed[_0xbbc2('0x31')][_0xbbc2('0x1d')]);}_0x1a3356['order']=qs[_0xbbc2('0x38')](_0x6996ed['query'][_0xbbc2('0x38')]);_0x1a3356[_0xbbc2('0x39')]=qs[_0xbbc2('0x32')](_['pick'](_0x6996ed['query'],_0x2a7569[_0xbbc2('0x32')]),_0x177a13);if(_0x6996ed['query']['filter']){_0x1a3356[_0xbbc2('0x39')]=_['merge'](_0x1a3356[_0xbbc2('0x39')],{'$or':_[_0xbbc2('0x2a')](_0x177a13,function(_0x22eebd){if(_0x22eebd['type']!==_0xbbc2('0x3a')){var _0x35dcb0={};_0x35dcb0[_0x22eebd[_0xbbc2('0x27')]]={'$like':'%'+_0x6996ed[_0xbbc2('0x31')]['filter']+'%'};return _0x35dcb0;}})});}_0x1a3356=_[_0xbbc2('0x3b')]({},_0x1a3356,_0x6996ed['options']);var _0x49f433={'where':_0x1a3356[_0xbbc2('0x39')]};return db['CmCustomField'][_0xbbc2('0x20')](_0x49f433)['then'](function(_0x32c5ea){_0x1f48e6[_0xbbc2('0x20')]=_0x32c5ea;if(_0x6996ed[_0xbbc2('0x31')][_0xbbc2('0x3c')]){_0x1a3356[_0xbbc2('0x3d')]=[{'all':!![]}];}return db['CmCustomField'][_0xbbc2('0x3e')](_0x1a3356);})[_0xbbc2('0x24')](function(_0xa752de){_0x1f48e6[_0xbbc2('0x3f')]=_0xa752de;return _0x1f48e6;})[_0xbbc2('0x24')](respondWithFilteredResult(_0x36a6a2,_0x1a3356))[_0xbbc2('0x40')](handleError(_0x36a6a2,null));};exports[_0xbbc2('0x41')]=function(_0x5c6761,_0x47c369){var _0x5f48be={'raw':!![],'where':{'id':_0x5c6761[_0xbbc2('0x42')]['id']}},_0x54ded1={};_0x54ded1[_0xbbc2('0x34')]=_[_0xbbc2('0x30')](db[_0xbbc2('0x2b')]['rawAttributes']);_0x54ded1['query']=_['keys'](_0x5c6761[_0xbbc2('0x31')]);_0x54ded1['filters']=_[_0xbbc2('0x33')](_0x54ded1[_0xbbc2('0x34')],_0x54ded1['query']);_0x5f48be[_0xbbc2('0x35')]=_[_0xbbc2('0x33')](_0x54ded1[_0xbbc2('0x34')],qs[_0xbbc2('0x36')](_0x5c6761[_0xbbc2('0x31')]['fields']));_0x5f48be[_0xbbc2('0x35')]=_0x5f48be[_0xbbc2('0x35')][_0xbbc2('0x43')]?_0x5f48be['attributes']:_0x54ded1[_0xbbc2('0x34')];if(_0x5c6761[_0xbbc2('0x31')][_0xbbc2('0x3c')]){_0x5f48be[_0xbbc2('0x3d')]=[{'all':!![]}];}_0x5f48be=_['merge']({},_0x5f48be,_0x5c6761['options']);return db[_0xbbc2('0x2b')][_0xbbc2('0x44')](_0x5f48be)[_0xbbc2('0x24')](handleEntityNotFound(_0x47c369,null))[_0xbbc2('0x24')](respondWithResult(_0x47c369,null))[_0xbbc2('0x40')](handleError(_0x47c369,null));};exports[_0xbbc2('0x45')]=function(_0x3ac9e4,_0x1bc3bb){if(_0x3ac9e4[_0xbbc2('0x46')]['id']){delete _0x3ac9e4['body']['id'];}return db[_0xbbc2('0x2b')][_0xbbc2('0x44')]({'where':{'id':_0x3ac9e4[_0xbbc2('0x42')]['id']}})['then'](handleEntityNotFound(_0x1bc3bb,null))['then'](saveUpdates(_0x3ac9e4['body'],null))['then'](respondWithResult(_0x1bc3bb,null))['catch'](handleError(_0x1bc3bb,null));};exports[_0xbbc2('0x47')]=function(_0x476c9b,_0x5b98c3){return db[_0xbbc2('0x2b')][_0xbbc2('0x44')]({'where':{'id':_0x476c9b[_0xbbc2('0x42')]['id']}})[_0xbbc2('0x24')](handleEntityNotFound(_0x5b98c3,null))['then'](removeEntity(_0x5b98c3,null))[_0xbbc2('0x40')](handleError(_0x5b98c3,null));};exports[_0xbbc2('0x48')]=function(_0x3cfd6a,_0x2078ca){var _0x4fe366;return db[_0xbbc2('0x49')][_0xbbc2('0x4a')](function(_0x2f64d3){return db[_0xbbc2('0x2b')]['create'](_0x3cfd6a[_0xbbc2('0x46')],{'transaction':_0x2f64d3})['then'](function(_0x296c49){_0x4fe366=_0x296c49;var _0x1d959d={'type':db['Sequelize'][_0xbbc2('0x4b')],'transaction':_0x2f64d3};switch(_0x3cfd6a[_0xbbc2('0x46')][_0xbbc2('0x2d')]){case'text':_0x1d959d[_0xbbc2('0x2d')]=db[_0xbbc2('0x4c')][_0xbbc2('0x4b')];break;case _0xbbc2('0x4d'):_0x1d959d[_0xbbc2('0x2d')]=db['Sequelize'][_0xbbc2('0x4e')];break;case _0xbbc2('0x4f'):_0x1d959d['type']=db[_0xbbc2('0x4c')][_0xbbc2('0x50')];_0x1d959d[_0xbbc2('0x51')]=![];break;default:}return db[_0xbbc2('0x49')]['queryInterface'][_0xbbc2('0x52')]('cm_contacts',util['format'](_0xbbc2('0x53'),_0x4fe366['id']),_0x1d959d);})[_0xbbc2('0x24')](function(){return _0x4fe366;});})[_0xbbc2('0x24')](respondWithResult(_0x2078ca,0xc9))['catch'](handleError(_0x2078ca,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index d976a18..b3c0aef 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 _0x3ca7=['moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','api'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3ca7,0x1eb));var _0x73ca=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x3ca7[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x73ca('0x0'));var util=require(_0x73ca('0x1'));var logger=require('../../config/logger')(_0x73ca('0x2'));var moment=require(_0x73ca('0x3'));var BPromise=require(_0x73ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x73ca('0x5'));var rimraf=require(_0x73ca('0x6'));var config=require(_0x73ca('0x7'));var attributes=require(_0x73ca('0x8'));module[_0x73ca('0x9')]=function(_0xc853c4,_0x586049){return _0xc853c4[_0x73ca('0xa')](_0x73ca('0xb'),attributes,{'tableName':_0x73ca('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22dd=['define','cm_custom_fields','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x22dd,0x188));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd22d('0x0'));var util=require('util');var logger=require(_0xd22d('0x1'))(_0xd22d('0x2'));var moment=require('moment');var BPromise=require(_0xd22d('0x3'));var rp=require(_0xd22d('0x4'));var fs=require('fs');var path=require(_0xd22d('0x5'));var rimraf=require(_0xd22d('0x6'));var config=require(_0xd22d('0x7'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x133df8,_0xd3e9aa){return _0x133df8[_0xd22d('0x8')]('CmCustomField',attributes,{'tableName':_0xd22d('0x9'),'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 ee51db1..9470f05 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 _0x29a8=['request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x48e6f1,_0x1bd3e8){var _0x154ae1=function(_0x253b58){while(--_0x253b58){_0x48e6f1['push'](_0x48e6f1['shift']());}};_0x154ae1(++_0x1bd3e8);}(_0x29a8,0x185));var _0x829a=function(_0x455161,_0x520f10){_0x455161=_0x455161-0x0;var _0x3e7c03=_0x29a8[_0x455161];return _0x3e7c03;};'use strict';var _=require(_0x829a('0x0'));var util=require(_0x829a('0x1'));var moment=require(_0x829a('0x2'));var BPromise=require('bluebird');var rs=require(_0x829a('0x3'));var fs=require('fs');var Redis=require(_0x829a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x829a('0x5'));var logger=require(_0x829a('0x6'))(_0x829a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x829a('0x8')][_0x829a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cc97d,_0x24f372,_0x239fa9){return new BPromise(function(_0x28bdb3,_0x20e26b){return client[_0x829a('0xa')](_0x1cc97d,_0x239fa9)['then'](function(_0x25a969){logger[_0x829a('0xb')](_0x829a('0xc'),_0x24f372,_0x829a('0xd'));logger[_0x829a('0xe')](_0x829a('0xf'),_0x24f372,'request\x20sent',JSON[_0x829a('0x10')](_0x25a969));if(_0x25a969[_0x829a('0x11')]){if(_0x25a969['error'][_0x829a('0x12')]===0x1f4){logger[_0x829a('0x11')](_0x829a('0xc'),_0x24f372,_0x25a969[_0x829a('0x11')][_0x829a('0x13')]);return _0x20e26b(_0x25a969[_0x829a('0x11')][_0x829a('0x13')]);}logger[_0x829a('0x11')](_0x829a('0xc'),_0x24f372,_0x25a969[_0x829a('0x11')]['message']);return _0x28bdb3(_0x25a969[_0x829a('0x11')][_0x829a('0x13')]);}else{logger[_0x829a('0xb')]('CmCustomField,\x20%s,\x20%s',_0x24f372,_0x829a('0xd'));_0x28bdb3(_0x25a969['result'][_0x829a('0x13')]);}})[_0x829a('0x14')](function(_0x1246c7){logger[_0x829a('0x11')](_0x829a('0xc'),_0x24f372,_0x1246c7);_0x20e26b(_0x1246c7);});});} \ No newline at end of file +var _0x843d=['error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x843d,0x1a7));var _0xd843=function(_0x1944f2,_0x59fb78){_0x1944f2=_0x1944f2-0x0;var _0x282a6b=_0x843d[_0x1944f2];return _0x282a6b;};'use strict';var _=require(_0xd843('0x0'));var util=require('util');var moment=require(_0xd843('0x1'));var BPromise=require(_0xd843('0x2'));var rs=require(_0xd843('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd843('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd843('0x5'))(_0xd843('0x6'));var config=require(_0xd843('0x7'));var jayson=require(_0xd843('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x423949,_0x40fd23,_0x400398){return new BPromise(function(_0xd3d586,_0x45f3df){return client[_0xd843('0x9')](_0x423949,_0x400398)[_0xd843('0xa')](function(_0x30878c){logger['info']('CmCustomField,\x20%s,\x20%s',_0x40fd23,'request\x20sent');logger[_0xd843('0xb')](_0xd843('0xc'),_0x40fd23,_0xd843('0xd'),JSON['stringify'](_0x30878c));if(_0x30878c[_0xd843('0xe')]){if(_0x30878c[_0xd843('0xe')]['code']===0x1f4){logger['error'](_0xd843('0xf'),_0x40fd23,_0x30878c[_0xd843('0xe')][_0xd843('0x10')]);return _0x45f3df(_0x30878c['error'][_0xd843('0x10')]);}logger['error'](_0xd843('0xf'),_0x40fd23,_0x30878c[_0xd843('0xe')]['message']);return _0xd3d586(_0x30878c[_0xd843('0xe')][_0xd843('0x10')]);}else{logger['info'](_0xd843('0xf'),_0x40fd23,_0xd843('0xd'));_0xd3d586(_0x30878c[_0xd843('0x11')][_0xd843('0x10')]);}})[_0xd843('0x12')](function(_0x2a901b){logger[_0xd843('0xe')](_0xd843('0xf'),_0x40fd23,_0x2a901b);_0x45f3df(_0x2a901b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index c8df34c..1e47f94 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 _0x3c06=['show','post','create','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index'];(function(_0x439516,_0x4d4d60){var _0x22ce05=function(_0x32ae5b){while(--_0x32ae5b){_0x439516['push'](_0x439516['shift']());}};_0x22ce05(++_0x4d4d60);}(_0x3c06,0xf7));var _0x63c0=function(_0x2f7a54,_0x115651){_0x2f7a54=_0x2f7a54-0x0;var _0x39e20c=_0x3c06[_0x2f7a54];return _0x39e20c;};'use strict';var multer=require(_0x63c0('0x0'));var util=require(_0x63c0('0x1'));var path=require(_0x63c0('0x2'));var timeout=require(_0x63c0('0x3'));var express=require(_0x63c0('0x4'));var router=express[_0x63c0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x63c0('0x6'));var interaction=require(_0x63c0('0x7'));var config=require(_0x63c0('0x8'));var controller=require(_0x63c0('0x9'));router[_0x63c0('0xa')]('/',auth[_0x63c0('0xb')](),controller[_0x63c0('0xc')]);router['get']('/:id',auth[_0x63c0('0xb')](),controller[_0x63c0('0xd')]);router[_0x63c0('0xe')]('/',auth[_0x63c0('0xb')](),controller[_0x63c0('0xf')]);router['put']('/:id',auth[_0x63c0('0xb')](),controller[_0x63c0('0x10')]);router[_0x63c0('0x11')](_0x63c0('0x12'),auth[_0x63c0('0xb')](),controller['destroy']);module[_0x63c0('0x13')]=router; \ No newline at end of file +var _0x0967=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0967,0x100));var _0x7096=function(_0x3b4e50,_0x49143f){_0x3b4e50=_0x3b4e50-0x0;var _0x3975fa=_0x0967[_0x3b4e50];return _0x3975fa;};'use strict';var multer=require(_0x7096('0x0'));var util=require('util');var path=require(_0x7096('0x1'));var timeout=require(_0x7096('0x2'));var express=require(_0x7096('0x3'));var router=express[_0x7096('0x4')]();var fs_extra=require(_0x7096('0x5'));var auth=require(_0x7096('0x6'));var interaction=require(_0x7096('0x7'));var config=require(_0x7096('0x8'));var controller=require('./cmCustomField.controller');router[_0x7096('0x9')]('/',auth[_0x7096('0xa')](),controller[_0x7096('0xb')]);router[_0x7096('0x9')](_0x7096('0xc'),auth[_0x7096('0xa')](),controller[_0x7096('0xd')]);router[_0x7096('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7096('0xf')](_0x7096('0xc'),auth[_0x7096('0xa')](),controller['update']);router['delete'](_0x7096('0xc'),auth[_0x7096('0xa')](),controller[_0x7096('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 16e4329..fb508d5 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 _0x4297=['UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x30193b,_0x4d153b){var _0x468ae2=function(_0x4a075d){while(--_0x4a075d){_0x30193b['push'](_0x30193b['shift']());}};_0x468ae2(++_0x4d153b);}(_0x4297,0x161));var _0x7429=function(_0x3a53b4,_0x36d8e4){_0x3a53b4=_0x3a53b4-0x0;var _0x531720=_0x4297[_0x3a53b4];return _0x531720;};'use strict';var moment=require('moment');var Sequelize=require(_0x7429('0x0'));module[_0x7429('0x1')]={'phone':{'type':Sequelize[_0x7429('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x7429('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7429('0x4')],'defaultValue':moment()['format'](_0x7429('0x5'))},'countbusyretry':{'type':Sequelize[_0x7429('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7429('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7429('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7429('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7429('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x7429('0x6')](0x2)[_0x7429('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x7429('0x6')],'unique':_0x7429('0x8')},'ListId':{'type':Sequelize[_0x7429('0x6')],'unique':_0x7429('0x8')},'UserId':{'type':Sequelize[_0x7429('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x7429('0x8')},'CampaignId':{'type':Sequelize[_0x7429('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x7429('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7429('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7429('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd47d=['moment','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue'];(function(_0x2086dd,_0x40c63f){var _0x52fb48=function(_0x28cc39){while(--_0x28cc39){_0x2086dd['push'](_0x2086dd['shift']());}};_0x52fb48(++_0x40c63f);}(_0xd47d,0x15e));var _0xdd47=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0xd47d[_0x413727];return _0x5f46d7;};'use strict';var moment=require(_0xdd47('0x0'));var Sequelize=require(_0xdd47('0x1'));module['exports']={'phone':{'type':Sequelize[_0xdd47('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xdd47('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xdd47('0x4')],'defaultValue':moment()[_0xdd47('0x5')](_0xdd47('0x6'))},'countbusyretry':{'type':Sequelize[_0xdd47('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdd47('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xdd47('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdd47('0x4')]},'priority':{'type':Sequelize[_0xdd47('0x7')](0x2)[_0xdd47('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xdd47('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xdd47('0x7')],'unique':_0xdd47('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xdd47('0x9')},'CampaignId':{'type':Sequelize[_0xdd47('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdd47('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdd47('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdd47('0x7')],'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 c71f029..3c4c177 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 _0xfa91=['VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','length','merge','find','catch','create','body','params','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','CmHopper','fieldName','type','key','model','query','keys','filters','intersection','$or','$gte','$ne','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contained','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x170d36,_0xac7bfc){var _0x3e5ffc=function(_0x32644d){while(--_0x32644d){_0x170d36['push'](_0x170d36['shift']());}};_0x3e5ffc(++_0xac7bfc);}(_0xfa91,0x180));var _0x1fa9=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xfa91[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0x1fa9('0x0'));var rimraf=require(_0x1fa9('0x1'));var zipdir=require(_0x1fa9('0x2'));var jsonpatch=require(_0x1fa9('0x3'));var rp=require(_0x1fa9('0x4'));var moment=require(_0x1fa9('0x5'));var BPromise=require(_0x1fa9('0x6'));var Mustache=require(_0x1fa9('0x7'));var util=require(_0x1fa9('0x8'));var path=require(_0x1fa9('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1fa9('0xa'));var fs=require('fs');var fs_extra=require(_0x1fa9('0xb'));var _=require(_0x1fa9('0xc'));var squel=require(_0x1fa9('0xd'));var crypto=require(_0x1fa9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1fa9('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1fa9('0x10'));var Redis=require(_0x1fa9('0x11'));var authService=require(_0x1fa9('0x12'));var qs=require(_0x1fa9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fa9('0x14'))(_0x1fa9('0x15'));var utils=require(_0x1fa9('0x16'));var config=require(_0x1fa9('0x17'));var licenseUtil=require(_0x1fa9('0x18'));var db=require(_0x1fa9('0x19'))['db'];function respondWithStatusCode(_0x201a4a,_0x29e213){_0x29e213=_0x29e213||0xcc;return function(_0x57ac74){if(_0x57ac74){return _0x201a4a[_0x1fa9('0x1a')](_0x29e213);}return _0x201a4a[_0x1fa9('0x1b')](_0x29e213)[_0x1fa9('0x1c')]();};}function respondWithResult(_0x3c4018,_0x35eca1){_0x35eca1=_0x35eca1||0xc8;return function(_0x49dc4c){if(_0x49dc4c){return _0x3c4018[_0x1fa9('0x1b')](_0x35eca1)[_0x1fa9('0x1d')](_0x49dc4c);}};}function respondWithFilteredResult(_0x146f06,_0x19fa17){return function(_0x5dd528){if(_0x5dd528){var _0xb86176=typeof _0x19fa17[_0x1fa9('0x1e')]===_0x1fa9('0x1f')&&typeof _0x19fa17[_0x1fa9('0x20')]==='undefined';var _0x71c25f=_0x5dd528['count'];var _0x1ef7a4=_0xb86176?0x0:_0x19fa17['offset'];var _0x45f220=_0xb86176?_0x5dd528[_0x1fa9('0x21')]:_0x19fa17[_0x1fa9('0x1e')]+_0x19fa17[_0x1fa9('0x20')];var _0x23d5ea;if(_0x45f220>=_0x71c25f){_0x45f220=_0x71c25f;_0x23d5ea=0xc8;}else{_0x23d5ea=0xce;}_0x146f06[_0x1fa9('0x1b')](_0x23d5ea);return _0x146f06[_0x1fa9('0x22')](_0x1fa9('0x23'),_0x1ef7a4+'-'+_0x45f220+'/'+_0x71c25f)[_0x1fa9('0x1d')](_0x5dd528);}return null;};}function patchUpdates(_0x3c6d10){return function(_0x58a780){try{jsonpatch[_0x1fa9('0x24')](_0x58a780,_0x3c6d10,!![]);}catch(_0x4b9633){return BPromise[_0x1fa9('0x25')](_0x4b9633);}return _0x58a780[_0x1fa9('0x26')]();};}function saveUpdates(_0x33ffd0,_0x24278a){return function(_0xe0c045){if(_0xe0c045){return _0xe0c045[_0x1fa9('0x27')](_0x33ffd0)[_0x1fa9('0x28')](function(_0x4957d2){return _0x4957d2;});}return null;};}function removeEntity(_0x445540,_0x3f7164){return function(_0x2c6159){if(_0x2c6159){return _0x2c6159[_0x1fa9('0x29')]()[_0x1fa9('0x28')](function(){_0x445540[_0x1fa9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x149270,_0x4cbff4){return function(_0x29ae4e){if(!_0x29ae4e){_0x149270[_0x1fa9('0x1a')](0x194);}return _0x29ae4e;};}function handleError(_0x30b1a1,_0x42ef8b){_0x42ef8b=_0x42ef8b||0x1f4;return function(_0x1209a4){logger[_0x1fa9('0x2a')](_0x1209a4['stack']);if(_0x1209a4[_0x1fa9('0x2b')]){delete _0x1209a4[_0x1fa9('0x2b')];}_0x30b1a1['status'](_0x42ef8b)[_0x1fa9('0x2c')](_0x1209a4);};}exports['index']=function(_0x530e5d,_0x43fac1){var _0x5976d0={},_0x5954f4={},_0x246d2e={'count':0x0,'rows':[]};var _0x2419c7=_[_0x1fa9('0x2d')](db[_0x1fa9('0x2e')]['rawAttributes'],function(_0x622431){return{'name':_0x622431[_0x1fa9('0x2f')],'type':_0x622431[_0x1fa9('0x30')][_0x1fa9('0x31')]};});_0x5954f4[_0x1fa9('0x32')]=_[_0x1fa9('0x2d')](_0x2419c7,_0x1fa9('0x2b'));_0x5954f4[_0x1fa9('0x33')]=_[_0x1fa9('0x34')](_0x530e5d['query']);_0x5954f4[_0x1fa9('0x35')]=_[_0x1fa9('0x36')](_0x5954f4[_0x1fa9('0x32')],_0x5954f4[_0x1fa9('0x33')]);_0x5954f4[_0x1fa9('0x35')]=_['concat'](_0x5954f4[_0x1fa9('0x35')],['$and',_0x1fa9('0x37'),'$gt',_0x1fa9('0x38'),'$lt','$lte',_0x1fa9('0x39'),'$eq',_0x1fa9('0x3a'),_0x1fa9('0x3b'),_0x1fa9('0x3c'),_0x1fa9('0x3d'),_0x1fa9('0x3e'),'$like',_0x1fa9('0x3f'),_0x1fa9('0x40'),_0x1fa9('0x41'),_0x1fa9('0x42'),_0x1fa9('0x43'),'$contains',_0x1fa9('0x44'),'$any']);_0x5976d0[_0x1fa9('0x45')]=_['intersection'](_0x5954f4[_0x1fa9('0x32')],qs[_0x1fa9('0x46')](_0x530e5d['query'][_0x1fa9('0x46')]));_0x5976d0[_0x1fa9('0x45')]=_0x5976d0[_0x1fa9('0x45')]['length']?_0x5976d0[_0x1fa9('0x45')]:_0x5954f4[_0x1fa9('0x32')];if(!_0x530e5d[_0x1fa9('0x33')][_0x1fa9('0x47')](_0x1fa9('0x48'))){_0x5976d0[_0x1fa9('0x20')]=qs[_0x1fa9('0x20')](_0x530e5d[_0x1fa9('0x33')]['limit']);_0x5976d0['offset']=qs['offset'](_0x530e5d['query'][_0x1fa9('0x1e')]);}_0x5976d0[_0x1fa9('0x49')]=qs[_0x1fa9('0x4a')](_0x530e5d['query']['sort']);_0x5976d0['where']=qs[_0x1fa9('0x35')](_[_0x1fa9('0x4b')](_0x530e5d['query'],_0x5954f4[_0x1fa9('0x35')]),_0x2419c7);if(_0x530e5d[_0x1fa9('0x33')][_0x1fa9('0x4c')]){_0x5976d0[_0x1fa9('0x4d')]=_['merge'](_0x5976d0[_0x1fa9('0x4d')],{'$or':_[_0x1fa9('0x2d')](_0x2419c7,function(_0x3d6b86){if(_0x3d6b86[_0x1fa9('0x30')]!==_0x1fa9('0x4e')){var _0x19db2d={};_0x19db2d[_0x3d6b86[_0x1fa9('0x2b')]]={'$like':'%'+_0x530e5d[_0x1fa9('0x33')]['filter']+'%'};return _0x19db2d;}})});}_0x5976d0=_['merge']({},_0x5976d0,_0x530e5d[_0x1fa9('0x4f')]);var _0x4e2f8d={'where':_0x5976d0[_0x1fa9('0x4d')]};return db['CmHopper'][_0x1fa9('0x21')](_0x4e2f8d)[_0x1fa9('0x28')](function(_0xd6b203){_0x246d2e[_0x1fa9('0x21')]=_0xd6b203;if(_0x530e5d['query'][_0x1fa9('0x50')]){_0x5976d0[_0x1fa9('0x51')]=[{'all':!![]}];}return db[_0x1fa9('0x2e')][_0x1fa9('0x52')](_0x5976d0);})['then'](function(_0x2bd873){_0x246d2e[_0x1fa9('0x53')]=_0x2bd873;return _0x246d2e;})[_0x1fa9('0x28')](respondWithFilteredResult(_0x43fac1,_0x5976d0))['catch'](handleError(_0x43fac1,null));};exports[_0x1fa9('0x54')]=function(_0x1025fb,_0x3224d5){var _0x552b71={'raw':!![],'where':{'id':_0x1025fb['params']['id']}},_0x4930ca={};_0x4930ca[_0x1fa9('0x32')]=_[_0x1fa9('0x34')](db[_0x1fa9('0x2e')][_0x1fa9('0x55')]);_0x4930ca[_0x1fa9('0x33')]=_[_0x1fa9('0x34')](_0x1025fb['query']);_0x4930ca[_0x1fa9('0x35')]=_[_0x1fa9('0x36')](_0x4930ca[_0x1fa9('0x32')],_0x4930ca[_0x1fa9('0x33')]);_0x552b71[_0x1fa9('0x45')]=_[_0x1fa9('0x36')](_0x4930ca['model'],qs[_0x1fa9('0x46')](_0x1025fb['query'][_0x1fa9('0x46')]));_0x552b71[_0x1fa9('0x45')]=_0x552b71[_0x1fa9('0x45')][_0x1fa9('0x56')]?_0x552b71[_0x1fa9('0x45')]:_0x4930ca[_0x1fa9('0x32')];if(_0x1025fb[_0x1fa9('0x33')][_0x1fa9('0x50')]){_0x552b71[_0x1fa9('0x51')]=[{'all':!![]}];}_0x552b71=_[_0x1fa9('0x57')]({},_0x552b71,_0x1025fb['options']);return db[_0x1fa9('0x2e')][_0x1fa9('0x58')](_0x552b71)[_0x1fa9('0x28')](handleEntityNotFound(_0x3224d5,null))[_0x1fa9('0x28')](respondWithResult(_0x3224d5,null))[_0x1fa9('0x59')](handleError(_0x3224d5,null));};exports[_0x1fa9('0x5a')]=function(_0x590f27,_0x40003d){return db[_0x1fa9('0x2e')][_0x1fa9('0x5a')](_0x590f27[_0x1fa9('0x5b')],{})['then'](respondWithResult(_0x40003d,0xc9))['catch'](handleError(_0x40003d,null));};exports['update']=function(_0x267961,_0x44192c){if(_0x267961[_0x1fa9('0x5b')]['id']){delete _0x267961[_0x1fa9('0x5b')]['id'];}return db[_0x1fa9('0x2e')][_0x1fa9('0x58')]({'where':{'id':_0x267961[_0x1fa9('0x5c')]['id']}})[_0x1fa9('0x28')](handleEntityNotFound(_0x44192c,null))[_0x1fa9('0x28')](saveUpdates(_0x267961['body'],null))['then'](respondWithResult(_0x44192c,null))[_0x1fa9('0x59')](handleError(_0x44192c,null));};exports[_0x1fa9('0x5d')]=function(_0x380713,_0xa76ea){return db['CmHopper'][_0x1fa9('0x5d')]()[_0x1fa9('0x28')](respondWithResult(_0xa76ea,null))[_0x1fa9('0x59')](handleError(_0xa76ea,null));};exports[_0x1fa9('0x29')]=function(_0x161a47,_0x5999f5){var _0x51df8f;return db[_0x1fa9('0x2e')][_0x1fa9('0x58')]({'where':{'id':_0x161a47[_0x1fa9('0x5c')]['id']}})[_0x1fa9('0x28')](handleEntityNotFound(_0x5999f5,null))[_0x1fa9('0x28')](function(_0x1e018f){if(_0x1e018f){return _0x1e018f[_0x1fa9('0x29')]()['then'](function(_0x103d44){return _0x103d44;});}})[_0x1fa9('0x28')](function(_0x438993){_0x51df8f=_0x438993;if(_0x438993){if(_0x438993[_0x1fa9('0x5e')]||_0x438993[_0x1fa9('0x5f')]){return db[_0x438993['VoiceQueueId']?_0x1fa9('0x60'):_0x1fa9('0x61')][_0x1fa9('0x58')]({'where':{'id':_0x438993['VoiceQueueId']?_0x438993[_0x1fa9('0x5e')]:_0x438993[_0x1fa9('0x5f')]},'attributes':['id',_0x1fa9('0x2b')],'raw':!![]});}}})[_0x1fa9('0x28')](function(_0x50ef78){var _0x335248={};if(_0x50ef78){_['merge'](_0x335248,_[_0x1fa9('0x62')](_0x51df8f[_0x1fa9('0x63')],[_0x1fa9('0x64'),_0x1fa9('0x65'),'id']));_0x335248[_0x1fa9('0x66')]=0x15;_0x335248[_0x1fa9('0x67')]=_0x1fa9('0x68');_0x335248['campaign']=_0x50ef78['name'];_0x335248[_0x1fa9('0x69')]=_0x161a47[_0x1fa9('0x6a')]['name'];_0x335248[_0x1fa9('0x6b')]=_0x161a47[_0x1fa9('0x6a')]['id'];_0x335248[_0x1fa9('0x68')]=!![];_0x335248[_0x1fa9('0x6c')]=moment()[_0x1fa9('0x6d')](_0x1fa9('0x6e'));_0x335248[_0x1fa9('0x6f')]=_0x51df8f[_0x1fa9('0x70')];_0x335248['campaigntype']=_0x51df8f['VoiceQueueId']?_0x1fa9('0x71'):_0x1fa9('0x72');return db[_0x1fa9('0x73')][_0x1fa9('0x58')]({'where':{'id':_0x335248[_0x1fa9('0x74')]},'attributes':['firstName',_0x1fa9('0x75')]})[_0x1fa9('0x28')](function(_0x9475d1){if(!_[_0x1fa9('0x76')](_0x5999f5)&&!_['isNil'](_0x9475d1[_0x1fa9('0x77')])){_0x335248['calleridname']=_0x9475d1[_0x1fa9('0x77')];if(!_[_0x1fa9('0x76')](_0x9475d1[_0x1fa9('0x75')])){_0x335248[_0x1fa9('0x78')]+='\x20'+_0x9475d1[_0x1fa9('0x75')];}}})[_0x1fa9('0x79')](function(){return db[_0x1fa9('0x7a')]['create'](_0x335248);});}})[_0x1fa9('0x28')](function(){return _0x5999f5[_0x1fa9('0x1b')](0xcc)[_0x1fa9('0x1c')]();})[_0x1fa9('0x59')](handleError(_0x5999f5,null));};exports[_0x1fa9('0x7b')]=function(_0xe22bf0,_0x32d002,_0x334c3d){var _0x3aad96=[];return db[_0x1fa9('0x73')][_0x1fa9('0x5d')]()[_0x1fa9('0x28')](function(_0x4d03a5){_0x3aad96=_['keys'](_0x4d03a5);return _0xe22bf0[_0x1fa9('0x6a')]['getVoiceQueues']({'where':{'type':_0x1fa9('0x7c'),'dialActive':!![],'dialMethod':_0x1fa9('0x7d')},'attributes':['id',_0x1fa9('0x7e')],'raw':!![]});})[_0x1fa9('0x28')](function(_0x642537){if(_0x642537&&_0x642537[_0x1fa9('0x56')]){return db[_0x1fa9('0x7f')][_0x1fa9('0x80')](function(_0x36b4a5){var _0x54f7e9={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1fa9('0x6d')](_0x1fa9('0x6e'))},'VoiceQueueId':{'$in':_[_0x1fa9('0x2d')](_0x642537,'id')},'$or':[{'UserId':null},{'UserId':_0xe22bf0[_0x1fa9('0x6a')]['id']}]};var _0x4f0640=[];if(_0xe22bf0[_0x1fa9('0x5b')][_0x1fa9('0x81')]&&_0xe22bf0[_0x1fa9('0x5b')][_0x1fa9('0x81')]===_0x1fa9('0x82')){if(!_[_0x1fa9('0x83')](_0xe22bf0[_0x1fa9('0x5b')]['hopperIds'])){_0x54f7e9['id']={'$in':_0xe22bf0[_0x1fa9('0x5b')][_0x1fa9('0x84')]};}_0x4f0640=[[_0x1fa9('0x85'),_0x1fa9('0x86')],['scheduledAt',_0x642537[0x0][_0x1fa9('0x7e')]===_0x1fa9('0x86')?'DESC':_0x1fa9('0x86')],db['sequelize'][_0x1fa9('0x87')](_0x1fa9('0x88')),['id',_0x1fa9('0x89')]];}else{if(!_[_0x1fa9('0x83')](_0xe22bf0[_0x1fa9('0x5b')][_0x1fa9('0x84')])){_0x54f7e9['id']={'$notIn':_0xe22bf0[_0x1fa9('0x5b')][_0x1fa9('0x84')]};}_0x4f0640=[[_0x1fa9('0x85'),_0x1fa9('0x89')],[_0x1fa9('0x8a'),_0x642537[0x0][_0x1fa9('0x7e')]],db[_0x1fa9('0x7f')][_0x1fa9('0x87')](_0x1fa9('0x8b')),['id','ASC']];}return db[_0x1fa9('0x2e')][_0x1fa9('0x8c')]({'attributes':['id',_0x1fa9('0x8d')],'where':_0x54f7e9,'order':_0x4f0640,'transaction':_0x36b4a5,'lock':_0x36b4a5[_0x1fa9('0x8e')][_0x1fa9('0x8f')],'include':[{'model':db[_0x1fa9('0x73')],'as':_0x1fa9('0x90'),'attributes':_0x3aad96,'include':[{'model':db[_0x1fa9('0x91')],'as':'Company','attributes':['id',_0x1fa9('0x2b')]}]},{'model':db[_0x1fa9('0x92')],'as':_0x1fa9('0x93'),'attributes':['id',_0x1fa9('0x2b')]},{'model':db[_0x1fa9('0x60')],'as':_0x1fa9('0x94'),'attributes':['id','name',_0x1fa9('0x95')]}]})[_0x1fa9('0x28')](function(_0x1735a6){if(_0x1735a6){return _0x1735a6[_0x1fa9('0x27')]({'UserId':_0xe22bf0[_0x1fa9('0x6a')]['id']},{'transaction':_0x36b4a5});}});});}})[_0x1fa9('0x28')](handleEntityNotFound(_0x32d002,null))[_0x1fa9('0x28')](respondWithResult(_0x32d002,null))[_0x1fa9('0x59')](handleError(_0x32d002,null));};exports['getOpenContacts']=function(_0xd429cd,_0x485189,_0x55a66a){return _0xd429cd[_0x1fa9('0x6a')]['getVoiceQueues']({'where':{'type':_0x1fa9('0x7c'),'dialActive':!![],'dialMethod':_0x1fa9('0x7d')},'attributes':['id'],'raw':!![]})[_0x1fa9('0x28')](function(_0x4eae65){if(_0x4eae65&&_0x4eae65['length']){return db[_0x1fa9('0x2e')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1fa9('0x6d')](_0x1fa9('0x6e'))},'VoiceQueueId':{'$in':_[_0x1fa9('0x2d')](_0x4eae65,'id')},'$or':[{'UserId':null},{'UserId':_0xd429cd[_0x1fa9('0x6a')]['id']}]}});}return 0x0;})[_0x1fa9('0x28')](function(_0x4b9b87){if(!_['isNil'](_0x4b9b87)&&_[_0x1fa9('0x96')](_0x4b9b87)){return _0x485189[_0x1fa9('0x1b')](0xc8)[_0x1fa9('0x1d')]({'contacts':_0x4b9b87});}else{logger[_0x1fa9('0x2a')](_0x1fa9('0x97'),_0x1fa9('0x98'),0x194,_0x1fa9('0x99'));_0x485189[_0x1fa9('0x1a')](0x194);}})[_0x1fa9('0x59')](handleError(_0x485189,null));}; \ No newline at end of file +var _0x2666=['then','destroy','name','send','index','map','CmHopper','rawAttributes','fieldName','type','model','query','keys','filters','intersection','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','VoiceQueueId','CampaignId','omit','createdAt','updatedAt','state','deleted','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','calleridname','isNil','finally','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','transaction','direction','isEmpty','hopperIds','priority','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','findOne','scheduledat','UPDATE','Contact','Company','CmList','VoiceQueue','Queue','update','getOpenContacts','outbound','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x2666,0x184));var _0x6266=function(_0x3502c9,_0xce749e){_0x3502c9=_0x3502c9-0x0;var _0x472dc4=_0x2666[_0x3502c9];return _0x472dc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6266('0x0'));var zipdir=require(_0x6266('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6266('0x2'));var moment=require('moment');var BPromise=require(_0x6266('0x3'));var Mustache=require('mustache');var util=require(_0x6266('0x4'));var path=require(_0x6266('0x5'));var sox=require(_0x6266('0x6'));var csv=require(_0x6266('0x7'));var ejs=require(_0x6266('0x8'));var fs=require('fs');var fs_extra=require(_0x6266('0x9'));var _=require(_0x6266('0xa'));var squel=require(_0x6266('0xb'));var crypto=require(_0x6266('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6266('0xd'));var toCsv=require(_0x6266('0x7'));var querystring=require(_0x6266('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6266('0xf'));var qs=require(_0x6266('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6266('0x11'));var logger=require(_0x6266('0x12'))(_0x6266('0x13'));var utils=require('../../config/utils');var config=require(_0x6266('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x247a16,_0x6f76ef){_0x6f76ef=_0x6f76ef||0xcc;return function(_0x582192){if(_0x582192){return _0x247a16[_0x6266('0x15')](_0x6f76ef);}return _0x247a16[_0x6266('0x16')](_0x6f76ef)[_0x6266('0x17')]();};}function respondWithResult(_0x3f5fac,_0x4deba0){_0x4deba0=_0x4deba0||0xc8;return function(_0x35c597){if(_0x35c597){return _0x3f5fac['status'](_0x4deba0)[_0x6266('0x18')](_0x35c597);}};}function respondWithFilteredResult(_0x2249c8,_0x3ee541){return function(_0x47c9a2){if(_0x47c9a2){var _0xa6f5f=typeof _0x3ee541['offset']===_0x6266('0x19')&&typeof _0x3ee541['limit']==='undefined';var _0x3d6d4f=_0x47c9a2['count'];var _0x570339=_0xa6f5f?0x0:_0x3ee541['offset'];var _0x571dad=_0xa6f5f?_0x47c9a2[_0x6266('0x1a')]:_0x3ee541[_0x6266('0x1b')]+_0x3ee541['limit'];var _0xf6e0a7;if(_0x571dad>=_0x3d6d4f){_0x571dad=_0x3d6d4f;_0xf6e0a7=0xc8;}else{_0xf6e0a7=0xce;}_0x2249c8[_0x6266('0x16')](_0xf6e0a7);return _0x2249c8[_0x6266('0x1c')](_0x6266('0x1d'),_0x570339+'-'+_0x571dad+'/'+_0x3d6d4f)[_0x6266('0x18')](_0x47c9a2);}return null;};}function patchUpdates(_0x3f3ef0){return function(_0x45c227){try{jsonpatch['apply'](_0x45c227,_0x3f3ef0,!![]);}catch(_0x28b750){return BPromise[_0x6266('0x1e')](_0x28b750);}return _0x45c227[_0x6266('0x1f')]();};}function saveUpdates(_0x274f72,_0x6f514){return function(_0x2542ab){if(_0x2542ab){return _0x2542ab['update'](_0x274f72)[_0x6266('0x20')](function(_0x4bca44){return _0x4bca44;});}return null;};}function removeEntity(_0x37c253,_0x5b89be){return function(_0x26963d){if(_0x26963d){return _0x26963d[_0x6266('0x21')]()['then'](function(){_0x37c253[_0x6266('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dce20,_0xb1c72c){return function(_0x340b54){if(!_0x340b54){_0x4dce20[_0x6266('0x15')](0x194);}return _0x340b54;};}function handleError(_0x39e3b4,_0x43e860){_0x43e860=_0x43e860||0x1f4;return function(_0x3e0f4a){logger['error'](_0x3e0f4a['stack']);if(_0x3e0f4a[_0x6266('0x22')]){delete _0x3e0f4a[_0x6266('0x22')];}_0x39e3b4['status'](_0x43e860)[_0x6266('0x23')](_0x3e0f4a);};}exports[_0x6266('0x24')]=function(_0x1ff248,_0x45a15c){var _0x3d2377={},_0xc24edc={},_0x36b97b={'count':0x0,'rows':[]};var _0x24dc14=_[_0x6266('0x25')](db[_0x6266('0x26')][_0x6266('0x27')],function(_0xea05a4){return{'name':_0xea05a4[_0x6266('0x28')],'type':_0xea05a4[_0x6266('0x29')]['key']};});_0xc24edc[_0x6266('0x2a')]=_[_0x6266('0x25')](_0x24dc14,'name');_0xc24edc[_0x6266('0x2b')]=_[_0x6266('0x2c')](_0x1ff248['query']);_0xc24edc[_0x6266('0x2d')]=_[_0x6266('0x2e')](_0xc24edc['model'],_0xc24edc['query']);_0xc24edc[_0x6266('0x2d')]=_[_0x6266('0x2f')](_0xc24edc[_0x6266('0x2d')],[_0x6266('0x30'),'$or',_0x6266('0x31'),_0x6266('0x32'),_0x6266('0x33'),_0x6266('0x34'),_0x6266('0x35'),_0x6266('0x36'),'$not',_0x6266('0x37'),_0x6266('0x38'),_0x6266('0x39'),'$notIn',_0x6266('0x3a'),'$notLike',_0x6266('0x3b'),_0x6266('0x3c'),_0x6266('0x3a'),_0x6266('0x3d'),'$contains',_0x6266('0x3e'),_0x6266('0x3f')]);_0x3d2377[_0x6266('0x40')]=_[_0x6266('0x2e')](_0xc24edc[_0x6266('0x2a')],qs[_0x6266('0x41')](_0x1ff248[_0x6266('0x2b')][_0x6266('0x41')]));_0x3d2377[_0x6266('0x40')]=_0x3d2377[_0x6266('0x40')][_0x6266('0x42')]?_0x3d2377[_0x6266('0x40')]:_0xc24edc[_0x6266('0x2a')];if(!_0x1ff248[_0x6266('0x2b')][_0x6266('0x43')](_0x6266('0x44'))){_0x3d2377[_0x6266('0x45')]=qs[_0x6266('0x45')](_0x1ff248[_0x6266('0x2b')][_0x6266('0x45')]);_0x3d2377['offset']=qs[_0x6266('0x1b')](_0x1ff248[_0x6266('0x2b')][_0x6266('0x1b')]);}_0x3d2377[_0x6266('0x46')]=qs[_0x6266('0x47')](_0x1ff248[_0x6266('0x2b')][_0x6266('0x47')]);_0x3d2377['where']=qs[_0x6266('0x2d')](_[_0x6266('0x48')](_0x1ff248[_0x6266('0x2b')],_0xc24edc[_0x6266('0x2d')]),_0x24dc14);if(_0x1ff248[_0x6266('0x2b')][_0x6266('0x49')]){_0x3d2377[_0x6266('0x4a')]=_[_0x6266('0x4b')](_0x3d2377[_0x6266('0x4a')],{'$or':_[_0x6266('0x25')](_0x24dc14,function(_0x92ec50){if(_0x92ec50[_0x6266('0x29')]!=='VIRTUAL'){var _0x24286f={};_0x24286f[_0x92ec50[_0x6266('0x22')]]={'$like':'%'+_0x1ff248[_0x6266('0x2b')][_0x6266('0x49')]+'%'};return _0x24286f;}})});}_0x3d2377=_[_0x6266('0x4b')]({},_0x3d2377,_0x1ff248['options']);var _0x528d99={'where':_0x3d2377[_0x6266('0x4a')]};return db[_0x6266('0x26')][_0x6266('0x1a')](_0x528d99)[_0x6266('0x20')](function(_0x26e490){_0x36b97b['count']=_0x26e490;if(_0x1ff248[_0x6266('0x2b')][_0x6266('0x4c')]){_0x3d2377[_0x6266('0x4d')]=[{'all':!![]}];}return db[_0x6266('0x26')][_0x6266('0x4e')](_0x3d2377);})[_0x6266('0x20')](function(_0xf8abc){_0x36b97b[_0x6266('0x4f')]=_0xf8abc;return _0x36b97b;})[_0x6266('0x20')](respondWithFilteredResult(_0x45a15c,_0x3d2377))[_0x6266('0x50')](handleError(_0x45a15c,null));};exports[_0x6266('0x51')]=function(_0x1f5789,_0x539a31){var _0x5e672b={'raw':!![],'where':{'id':_0x1f5789['params']['id']}},_0x574837={};_0x574837[_0x6266('0x2a')]=_[_0x6266('0x2c')](db[_0x6266('0x26')][_0x6266('0x27')]);_0x574837[_0x6266('0x2b')]=_[_0x6266('0x2c')](_0x1f5789[_0x6266('0x2b')]);_0x574837[_0x6266('0x2d')]=_[_0x6266('0x2e')](_0x574837['model'],_0x574837['query']);_0x5e672b['attributes']=_[_0x6266('0x2e')](_0x574837[_0x6266('0x2a')],qs[_0x6266('0x41')](_0x1f5789['query'][_0x6266('0x41')]));_0x5e672b[_0x6266('0x40')]=_0x5e672b[_0x6266('0x40')]['length']?_0x5e672b[_0x6266('0x40')]:_0x574837['model'];if(_0x1f5789[_0x6266('0x2b')][_0x6266('0x4c')]){_0x5e672b[_0x6266('0x4d')]=[{'all':!![]}];}_0x5e672b=_[_0x6266('0x4b')]({},_0x5e672b,_0x1f5789['options']);return db[_0x6266('0x26')][_0x6266('0x52')](_0x5e672b)[_0x6266('0x20')](handleEntityNotFound(_0x539a31,null))['then'](respondWithResult(_0x539a31,null))[_0x6266('0x50')](handleError(_0x539a31,null));};exports[_0x6266('0x53')]=function(_0x1dec8f,_0x1ca4c9){return db[_0x6266('0x26')][_0x6266('0x53')](_0x1dec8f[_0x6266('0x54')],{})['then'](respondWithResult(_0x1ca4c9,0xc9))['catch'](handleError(_0x1ca4c9,null));};exports['update']=function(_0x6dffe5,_0xc07eec){if(_0x6dffe5[_0x6266('0x54')]['id']){delete _0x6dffe5[_0x6266('0x54')]['id'];}return db[_0x6266('0x26')]['find']({'where':{'id':_0x6dffe5[_0x6266('0x55')]['id']}})[_0x6266('0x20')](handleEntityNotFound(_0xc07eec,null))[_0x6266('0x20')](saveUpdates(_0x6dffe5['body'],null))[_0x6266('0x20')](respondWithResult(_0xc07eec,null))['catch'](handleError(_0xc07eec,null));};exports[_0x6266('0x56')]=function(_0x610ef5,_0x541169){return db[_0x6266('0x26')]['describe']()[_0x6266('0x20')](respondWithResult(_0x541169,null))['catch'](handleError(_0x541169,null));};exports['destroy']=function(_0x1a3938,_0x4164e2){var _0x2ac2c2;return db[_0x6266('0x26')][_0x6266('0x52')]({'where':{'id':_0x1a3938[_0x6266('0x55')]['id']}})[_0x6266('0x20')](handleEntityNotFound(_0x4164e2,null))[_0x6266('0x20')](function(_0x43591d){if(_0x43591d){return _0x43591d[_0x6266('0x21')]()[_0x6266('0x20')](function(_0x1d4304){return _0x1d4304;});}})[_0x6266('0x20')](function(_0x24baa3){_0x2ac2c2=_0x24baa3;if(_0x24baa3){if(_0x24baa3[_0x6266('0x57')]||_0x24baa3['CampaignId']){return db[_0x24baa3['VoiceQueueId']?'VoiceQueue':'Campaign'][_0x6266('0x52')]({'where':{'id':_0x24baa3[_0x6266('0x57')]?_0x24baa3['VoiceQueueId']:_0x24baa3[_0x6266('0x58')]},'attributes':['id',_0x6266('0x22')],'raw':!![]});}}})[_0x6266('0x20')](function(_0xb6522a){var _0x5940a1={};if(_0xb6522a){_['merge'](_0x5940a1,_[_0x6266('0x59')](_0x2ac2c2['dataValues'],[_0x6266('0x5a'),_0x6266('0x5b'),'id']));_0x5940a1[_0x6266('0x5c')]=0x15;_0x5940a1['statedesc']=_0x6266('0x5d');_0x5940a1['campaign']=_0xb6522a[_0x6266('0x22')];_0x5940a1['membername']=_0x1a3938[_0x6266('0x5e')][_0x6266('0x22')];_0x5940a1[_0x6266('0x5f')]=_0x1a3938[_0x6266('0x5e')]['id'];_0x5940a1[_0x6266('0x5d')]=!![];_0x5940a1[_0x6266('0x60')]=moment()[_0x6266('0x61')](_0x6266('0x62'));_0x5940a1[_0x6266('0x63')]=_0x2ac2c2[_0x6266('0x64')];_0x5940a1[_0x6266('0x65')]=_0x2ac2c2[_0x6266('0x57')]?_0x6266('0x66'):_0x6266('0x67');return db[_0x6266('0x68')][_0x6266('0x52')]({'where':{'id':_0x5940a1['ContactId']},'attributes':[_0x6266('0x69'),_0x6266('0x6a')]})[_0x6266('0x20')](function(_0x490a56){if(!_['isNil'](_0x4164e2)&&!_['isNil'](_0x490a56[_0x6266('0x69')])){_0x5940a1[_0x6266('0x6b')]=_0x490a56[_0x6266('0x69')];if(!_[_0x6266('0x6c')](_0x490a56['lastName'])){_0x5940a1[_0x6266('0x6b')]+='\x20'+_0x490a56[_0x6266('0x6a')];}}})[_0x6266('0x6d')](function(){return db[_0x6266('0x6e')]['create'](_0x5940a1);});}})[_0x6266('0x20')](function(){return _0x4164e2['status'](0xcc)[_0x6266('0x17')]();})[_0x6266('0x50')](handleError(_0x4164e2,null));};exports[_0x6266('0x6f')]=function(_0x1a86bf,_0x56ba94,_0x5d9473){var _0x28eb0e=[];return db[_0x6266('0x68')][_0x6266('0x56')]()[_0x6266('0x20')](function(_0x3d7c7b){_0x28eb0e=_['keys'](_0x3d7c7b);return _0x1a86bf['user'][_0x6266('0x70')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x6266('0x71')},'attributes':['id',_0x6266('0x72')],'raw':!![]});})['then'](function(_0x365afd){if(_0x365afd&&_0x365afd[_0x6266('0x42')]){return db['sequelize'][_0x6266('0x73')](function(_0x3f831c){var _0x307e0b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x6266('0x62'))},'VoiceQueueId':{'$in':_[_0x6266('0x25')](_0x365afd,'id')},'$or':[{'UserId':null},{'UserId':_0x1a86bf['user']['id']}]};var _0x1639a3=[];if(_0x1a86bf[_0x6266('0x54')][_0x6266('0x74')]&&_0x1a86bf[_0x6266('0x54')][_0x6266('0x74')]==='prev'){if(!_[_0x6266('0x75')](_0x1a86bf[_0x6266('0x54')][_0x6266('0x76')])){_0x307e0b['id']={'$in':_0x1a86bf[_0x6266('0x54')][_0x6266('0x76')]};}_0x1639a3=[[_0x6266('0x77'),_0x6266('0x78')],['scheduledAt',_0x365afd[0x0][_0x6266('0x72')]==='ASC'?_0x6266('0x79'):_0x6266('0x78')],db[_0x6266('0x7a')][_0x6266('0x7b')](_0x6266('0x7c')),['id',_0x6266('0x79')]];}else{if(!_[_0x6266('0x75')](_0x1a86bf[_0x6266('0x54')]['hopperIds'])){_0x307e0b['id']={'$notIn':_0x1a86bf['body'][_0x6266('0x76')]};}_0x1639a3=[[_0x6266('0x77'),_0x6266('0x79')],[_0x6266('0x7d'),_0x365afd[0x0][_0x6266('0x72')]],db[_0x6266('0x7a')][_0x6266('0x7b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x6266('0x26')][_0x6266('0x7e')]({'attributes':['id',_0x6266('0x7f')],'where':_0x307e0b,'order':_0x1639a3,'transaction':_0x3f831c,'lock':_0x3f831c['LOCK'][_0x6266('0x80')],'include':[{'model':db[_0x6266('0x68')],'as':_0x6266('0x81'),'attributes':_0x28eb0e,'include':[{'model':db['CmCompany'],'as':_0x6266('0x82'),'attributes':['id',_0x6266('0x22')]}]},{'model':db[_0x6266('0x83')],'as':'List','attributes':['id',_0x6266('0x22')]},{'model':db[_0x6266('0x84')],'as':_0x6266('0x85'),'attributes':['id',_0x6266('0x22'),'dialActive']}]})['then'](function(_0x452b27){if(_0x452b27){return _0x452b27[_0x6266('0x86')]({'UserId':_0x1a86bf[_0x6266('0x5e')]['id']},{'transaction':_0x3f831c});}});});}})['then'](handleEntityNotFound(_0x56ba94,null))[_0x6266('0x20')](respondWithResult(_0x56ba94,null))['catch'](handleError(_0x56ba94,null));};exports[_0x6266('0x87')]=function(_0x46dbde,_0x6e3951,_0x4cc0b4){return _0x46dbde[_0x6266('0x5e')]['getVoiceQueues']({'where':{'type':_0x6266('0x88'),'dialActive':!![],'dialMethod':_0x6266('0x71')},'attributes':['id'],'raw':!![]})[_0x6266('0x20')](function(_0x1d6c20){if(_0x1d6c20&&_0x1d6c20[_0x6266('0x42')]){return db[_0x6266('0x26')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6266('0x61')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x6266('0x25')](_0x1d6c20,'id')},'$or':[{'UserId':null},{'UserId':_0x46dbde[_0x6266('0x5e')]['id']}]}});}return 0x0;})['then'](function(_0x511e32){if(!_['isNil'](_0x511e32)&&_['isNumber'](_0x511e32)){return _0x6e3951[_0x6266('0x16')](0xc8)[_0x6266('0x18')]({'contacts':_0x511e32});}else{logger[_0x6266('0x89')](_0x6266('0x8a'),'getOpenContacts',0x194,_0x6266('0x8b'));_0x6e3951[_0x6266('0x15')](0x194);}})['catch'](handleError(_0x6e3951,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d32763d..883c240 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 _0x3f8a=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xb68fe6,_0x226cb1){var _0x5060fd=function(_0x33cc40){while(--_0x33cc40){_0xb68fe6['push'](_0xb68fe6['shift']());}};_0x5060fd(++_0x226cb1);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1b3012,_0x4d340a){_0x1b3012=_0x1b3012-0x0;var _0x32336b=_0x3f8a[_0x1b3012];return _0x32336b;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'paranoid':![],'indexes':[{'name':_0xa3f8('0xe'),'fields':[_0xa3f8('0xe')]},{'name':_0xa3f8('0xf'),'fields':[_0xa3f8('0xf')]},{'name':_0xa3f8('0x10'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','priority','lodash','util','../../config/logger','moment'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7a54,0x106));var _0x47a5=function(_0x98947a,_0x5ba4fe){_0x98947a=_0x98947a-0x0;var _0x6f3519=_0x7a54[_0x98947a];return _0x6f3519;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x47a5('0xc')]},{'name':'phone','fields':['phone']},{'name':'priority','fields':[_0x47a5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index a9aba25..14910d9 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 _0x886a=['CreateCmHopper','create','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','keys','User','Agent','voicePause','UserId','includes','push','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','length','GetCmHopperPreview','Contact','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowCmHopper'];(function(_0x4f9378,_0x349485){var _0x30ed97=function(_0x53abf5){while(--_0x53abf5){_0x4f9378['push'](_0x4f9378['shift']());}};_0x30ed97(++_0x349485);}(_0x886a,0x1db));var _0xa886=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0x886a[_0x541260];return _0x1dd2b5;};'use strict';var _=require('lodash');var util=require(_0xa886('0x0'));var moment=require(_0xa886('0x1'));var BPromise=require(_0xa886('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa886('0x3'));var db=require(_0xa886('0x4'))['db'];var utils=require(_0xa886('0x5'));var logger=require('../../config/logger')(_0xa886('0x6'));var config=require(_0xa886('0x7'));var jayson=require(_0xa886('0x8'));var client=jayson[_0xa886('0x9')][_0xa886('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a10bb,_0x20dc2c,_0x305c92){return new BPromise(function(_0x578838,_0x3cd538){return client[_0xa886('0xb')](_0x2a10bb,_0x305c92)[_0xa886('0xc')](function(_0x236c4e){logger[_0xa886('0xd')]('CmHopper,\x20%s,\x20%s',_0x20dc2c,'request\x20sent');logger[_0xa886('0xe')](_0xa886('0xf'),_0x20dc2c,_0xa886('0x10'),JSON['stringify'](_0x236c4e));if(_0x236c4e['error']){if(_0x236c4e[_0xa886('0x11')][_0xa886('0x12')]===0x1f4){logger[_0xa886('0x11')](_0xa886('0x13'),_0x20dc2c,_0x236c4e[_0xa886('0x11')]['message']);return _0x3cd538(_0x236c4e[_0xa886('0x11')]['message']);}logger[_0xa886('0x11')]('CmHopper,\x20%s,\x20%s',_0x20dc2c,_0x236c4e[_0xa886('0x11')][_0xa886('0x14')]);return _0x578838(_0x236c4e[_0xa886('0x11')]['message']);}else{logger[_0xa886('0xd')](_0xa886('0x13'),_0x20dc2c,_0xa886('0x10'));_0x578838(_0x236c4e[_0xa886('0x15')]['message']);}})[_0xa886('0x16')](function(_0x56415e){logger[_0xa886('0x11')](_0xa886('0x13'),_0x20dc2c,_0x56415e);_0x3cd538(_0x56415e);});});}exports[_0xa886('0x17')]=function(_0x2c3a1f){var _0x487523=this;return new Promise(function(_0x3cda27,_0x5c4344){return db[_0xa886('0x18')][_0xa886('0x19')]({'raw':_0x2c3a1f['options']?_0x2c3a1f[_0xa886('0x1a')][_0xa886('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c3a1f[_0xa886('0x1a')]?_0x2c3a1f['options'][_0xa886('0x1c')]||null:null,'attributes':_0x2c3a1f[_0xa886('0x1a')]?_0x2c3a1f[_0xa886('0x1a')][_0xa886('0x1d')]||null:null,'limit':_0x2c3a1f['options']?_0x2c3a1f[_0xa886('0x1a')][_0xa886('0x1e')]||null:null,'include':_0x2c3a1f[_0xa886('0x1a')]?_0x2c3a1f[_0xa886('0x1a')][_0xa886('0x1f')]?_[_0xa886('0x20')](_0x2c3a1f[_0xa886('0x1a')]['include'],function(_0xf4af4d){return{'model':db[_0xf4af4d[_0xa886('0x21')]],'as':_0xf4af4d['as'],'attributes':_0xf4af4d[_0xa886('0x1d')],'include':_0xf4af4d[_0xa886('0x1f')]?_[_0xa886('0x20')](_0xf4af4d[_0xa886('0x1f')],function(_0xe6e302){return{'model':db[_0xe6e302['model']],'as':_0xe6e302['as'],'attributes':_0xe6e302['attributes'],'include':_0xe6e302[_0xa886('0x1f')]?_[_0xa886('0x20')](_0xe6e302[_0xa886('0x1f')],function(_0x17ca5e){return{'model':db[_0x17ca5e[_0xa886('0x21')]],'as':_0x17ca5e['as'],'attributes':_0x17ca5e[_0xa886('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa886('0xc')](function(_0x3fbc24){logger['info'](_0xa886('0x17'),_0x2c3a1f);logger[_0xa886('0xe')](_0xa886('0x17'),_0x2c3a1f,JSON[_0xa886('0x22')](_0x3fbc24));_0x3cda27(_0x3fbc24);})[_0xa886('0x16')](function(_0x384da8){logger[_0xa886('0x11')](_0xa886('0x17'),_0x384da8[_0xa886('0x14')],_0x2c3a1f);_0x5c4344(_0x487523[_0xa886('0x11')](0x1f4,_0x384da8[_0xa886('0x14')]));});});};exports[_0xa886('0x23')]=function(_0x1b4b1e){var _0x4db29c=this;return new Promise(function(_0x54e21c,_0x423d5c){return db[_0xa886('0x18')]['find']({'raw':_0x1b4b1e[_0xa886('0x1a')]?_0x1b4b1e['options'][_0xa886('0x1b')]===undefined?!![]:![]:!![],'where':_0x1b4b1e[_0xa886('0x1a')]?_0x1b4b1e['options'][_0xa886('0x1c')]||null:null,'attributes':_0x1b4b1e[_0xa886('0x1a')]?_0x1b4b1e[_0xa886('0x1a')][_0xa886('0x1d')]||null:null,'include':_0x1b4b1e['options']?_0x1b4b1e[_0xa886('0x1a')]['include']?_[_0xa886('0x20')](_0x1b4b1e['options'][_0xa886('0x1f')],function(_0x3a579b){return{'model':db[_0x3a579b[_0xa886('0x21')]],'as':_0x3a579b['as'],'attributes':_0x3a579b[_0xa886('0x1d')],'include':_0x3a579b[_0xa886('0x1f')]?_[_0xa886('0x20')](_0x3a579b[_0xa886('0x1f')],function(_0x2e9eb1){return{'model':db[_0x2e9eb1[_0xa886('0x21')]],'as':_0x2e9eb1['as'],'attributes':_0x2e9eb1[_0xa886('0x1d')],'include':_0x2e9eb1[_0xa886('0x1f')]?_[_0xa886('0x20')](_0x2e9eb1[_0xa886('0x1f')],function(_0x4c0c5d){return{'model':db[_0x4c0c5d[_0xa886('0x21')]],'as':_0x4c0c5d['as'],'attributes':_0x4c0c5d[_0xa886('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa886('0xc')](function(_0x25ab61){logger[_0xa886('0xd')](_0xa886('0x23'),_0x1b4b1e);logger[_0xa886('0xe')]('ShowCmHopper',_0x1b4b1e,JSON[_0xa886('0x22')](_0x25ab61));_0x54e21c(_0x25ab61);})['catch'](function(_0x12f653){logger[_0xa886('0x11')](_0xa886('0x23'),_0x12f653[_0xa886('0x14')],_0x1b4b1e);_0x423d5c(_0x4db29c['error'](0x1f4,_0x12f653['message']));});});};exports[_0xa886('0x24')]=function(_0x390e92){var _0x50afb7=this;return new Promise(function(_0x322fe3,_0x1ab4bc){return db[_0xa886('0x18')][_0xa886('0x25')](_0x390e92[_0xa886('0x26')],{'raw':_0x390e92['options']?_0x390e92['options'][_0xa886('0x1b')]===undefined?!![]:![]:!![]})[_0xa886('0xc')](function(_0x59302e){logger[_0xa886('0xd')](_0xa886('0x24'),_0x390e92);logger[_0xa886('0xe')](_0xa886('0x24'),_0x390e92,JSON[_0xa886('0x22')](_0x59302e));_0x322fe3(_0x59302e);})[_0xa886('0x16')](function(_0x5502f9){logger['error'](_0xa886('0x24'),_0x5502f9[_0xa886('0x14')],_0x390e92);_0x1ab4bc(_0x50afb7['error'](0x1f4,_0x5502f9[_0xa886('0x14')]));});});};exports['UpdateCmHopper']=function(_0x5540c1){var _0x3a1838=this;return new Promise(function(_0x1774c1,_0x391ceb){return db[_0xa886('0x18')][_0xa886('0x27')](_0x5540c1[_0xa886('0x26')],{'raw':_0x5540c1[_0xa886('0x1a')]?_0x5540c1[_0xa886('0x1a')][_0xa886('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5540c1['options']?_0x5540c1['options'][_0xa886('0x1c')]||null:null,'attributes':_0x5540c1[_0xa886('0x1a')]?_0x5540c1[_0xa886('0x1a')]['attributes']||null:null,'limit':_0x5540c1[_0xa886('0x1a')]?_0x5540c1[_0xa886('0x1a')][_0xa886('0x1e')]||null:null})[_0xa886('0xc')](function(_0x3cdb09){logger[_0xa886('0xd')](_0xa886('0x28'),_0x5540c1);logger[_0xa886('0xe')]('UpdateCmHopper',_0x5540c1,JSON['stringify'](_0x3cdb09));_0x1774c1(_0x3cdb09);})[_0xa886('0x16')](function(_0x1784a2){logger[_0xa886('0x11')](_0xa886('0x28'),_0x1784a2['message'],_0x5540c1);_0x391ceb(_0x3a1838[_0xa886('0x11')](0x1f4,_0x1784a2[_0xa886('0x14')]));});});};exports[_0xa886('0x29')]=function(_0x488c9d){var _0x309003=this;return new Promise(function(_0x273a26,_0xca8725){return db[_0xa886('0x18')][_0xa886('0x2a')]({'where':_0x488c9d['options']?_0x488c9d['options'][_0xa886('0x1c')]||null:null})['then'](function(_0x52925f){logger[_0xa886('0xd')](_0xa886('0x29'),_0x488c9d);logger[_0xa886('0xe')]('DestroyCmHopper',_0x488c9d,JSON[_0xa886('0x22')](_0x52925f));_0x273a26(_0x52925f);})['catch'](function(_0x994f8d){logger[_0xa886('0x11')]('DestroyCmHopper',_0x994f8d[_0xa886('0x14')],_0x488c9d);_0xca8725(_0x309003[_0xa886('0x11')](0x1f4,_0x994f8d[_0xa886('0x14')]));});});};exports[_0xa886('0x2b')]=function(_0x24c5a4){var _0x585020=this;return new Promise(function(_0x5c0b4b,_0x466105){return db[_0xa886('0x2c')][_0xa886('0x2d')]()['then'](function(_0x157d3d){return db[_0xa886('0x2e')][_0xa886('0x2f')](function(_0xd7431){return db[_0xa886('0x18')][_0xa886('0x19')]({'where':_0x24c5a4[_0xa886('0x1a')]?_0x24c5a4[_0xa886('0x1a')][_0xa886('0x1c')]||null:null,'attributes':_0x24c5a4[_0xa886('0x1a')]?_0x24c5a4['options'][_0xa886('0x1d')]||null:null,'limit':_0x24c5a4[_0xa886('0x1a')]?_0x24c5a4['options']['limit']||null:null,'order':_0x24c5a4[_0xa886('0x1a')]?_0x24c5a4[_0xa886('0x1a')][_0xa886('0x30')]||null:null,'transaction':_0xd7431,'lock':_0xd7431[_0xa886('0x31')][_0xa886('0x32')],'include':[{'model':db[_0xa886('0x2c')],'as':'Contact','attributes':_[_0xa886('0x33')](_0x157d3d)},{'model':db[_0xa886('0x34')],'as':_0xa886('0x35'),'attributes':['id','name',_0xa886('0x36')]}]})['then'](function(_0x31f909){var _0xd5f3b=[];var _0x6f4dd=[];for(var _0x13ebb9=0x0;_0x13ebb9<_0x31f909['length'];_0x13ebb9+=0x1){var _0x5d8295=_0x31f909[_0x13ebb9][_0xa886('0x37')];if(_0x5d8295===null){_0xd5f3b['push'](_0x31f909[_0x13ebb9]['update'](_0x24c5a4[_0xa886('0x26')],{'transaction':_0xd7431}));}else if(!_0x6f4dd[_0xa886('0x38')](_0x5d8295)){_0x6f4dd[_0xa886('0x39')](_0x5d8295);_0xd5f3b[_0xa886('0x39')](_0x31f909[_0x13ebb9][_0xa886('0x27')](_0x24c5a4[_0xa886('0x26')],{'transaction':_0xd7431}));}}return BPromise[_0xa886('0x3a')](_0xd5f3b);});})[_0xa886('0xc')](function(_0x538f59){logger['info']('GetContactDialer',_0x24c5a4);logger[_0xa886('0xe')](_0xa886('0x2b'),_0x24c5a4,JSON['stringify'](_0x538f59));_0x5c0b4b(_0x538f59);})[_0xa886('0x16')](function(_0xf483f7){logger[_0xa886('0x11')](_0xa886('0x2b'),_0xf483f7[_0xa886('0x14')],_0x24c5a4);_0x466105(_0x585020['error'](0x1f4,_0xf483f7[_0xa886('0x14')]));});});});};exports[_0xa886('0x3b')]=function(_0x42d455){var _0x4f020a=this;return new Promise(function(_0xb4141,_0x14d4f0){return db[_0xa886('0x2e')]['transaction'](function(_0x195dd3){return db[_0xa886('0x3c')][_0xa886('0x25')](_0x42d455[_0xa886('0x26')],{'raw':_0x42d455[_0xa886('0x1a')]?_0x42d455[_0xa886('0x1a')][_0xa886('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x195dd3})[_0xa886('0xc')](function(){return db['CmHopper'][_0xa886('0x2a')]({'where':_0x42d455[_0xa886('0x1a')]?_0x42d455['options']['where']||null:null,'transaction':_0x195dd3});});})[_0xa886('0xc')](function(_0x5162fb){logger['info'](_0xa886('0x3b'),_0x42d455);logger[_0xa886('0xe')]('MoveContactManagedDialer',_0x42d455,JSON[_0xa886('0x22')](_0x5162fb));_0xb4141(_0x5162fb);})['catch'](function(_0x37f1ff){logger[_0xa886('0x11')](_0xa886('0x3b'),_0x37f1ff[_0xa886('0x14')],_0x42d455);_0x14d4f0(_0x4f020a['error'](0x1f4,_0x37f1ff[_0xa886('0x14')]));});});};exports[_0xa886('0x3d')]=function(_0x28f5f7){var _0x2566dc=this;return new Promise(function(_0xb092df,_0x7d4eda){return db[_0xa886('0x18')][_0xa886('0x19')]({'raw':_0x28f5f7['options']?_0x28f5f7[_0xa886('0x1a')][_0xa886('0x1b')]===undefined?!![]:![]:!![],'where':_0x28f5f7[_0xa886('0x1a')]?_0x28f5f7[_0xa886('0x1a')][_0xa886('0x1c')]||null:null,'attributes':[[db[_0xa886('0x2e')]['fn'](_0xa886('0x3e'),db[_0xa886('0x2e')]['fn']('IF',db[_0xa886('0x2e')]['literal'](_0xa886('0x3f')+util[_0xa886('0x40')](_0xa886('0x41'),moment()[_0xa886('0x40')](_0xa886('0x42')))+_0xa886('0x43')))),_0xa886('0x44')]]})['then'](function(_0x50ca8a){logger[_0xa886('0xd')](_0xa886('0x3d'),_0x28f5f7);logger[_0xa886('0xe')](_0xa886('0x3d'),_0x28f5f7,JSON[_0xa886('0x22')](_0x50ca8a));_0xb092df(_0x50ca8a);})[_0xa886('0x16')](function(_0x390a81){logger['error']('CountReScheduled',_0x390a81[_0xa886('0x14')],_0x28f5f7);_0x7d4eda(_0x2566dc[_0xa886('0x11')](0x1f4,_0x390a81[_0xa886('0x14')]));});});};exports[_0xa886('0x45')]=function(_0x553e83){var _0x355994=this;return new Promise(function(_0x2267be,_0x451188){return db[_0xa886('0x2c')][_0xa886('0x2d')]()[_0xa886('0xc')](function(_0x17e579){return db[_0xa886('0x2e')][_0xa886('0x2f')](function(_0x25c37c){return db[_0xa886('0x18')][_0xa886('0x19')]({'where':_0x553e83['options']?_0x553e83[_0xa886('0x1a')][_0xa886('0x1c')]||null:null,'attributes':_0x553e83[_0xa886('0x1a')]?_0x553e83['options'][_0xa886('0x1d')]||null:null,'limit':0x1,'order':_0x553e83[_0xa886('0x1a')]?_0x553e83['options']['order']||null:null,'group':db['CmHopper'][_0xa886('0x37')],'transaction':_0x25c37c,'lock':_0x25c37c['LOCK'][_0xa886('0x32')],'include':_0x553e83[_0xa886('0x1a')]?_0x553e83[_0xa886('0x1a')][_0xa886('0x1f')]?_[_0xa886('0x20')](_0x553e83[_0xa886('0x1a')][_0xa886('0x1f')],function(_0x536fb0){return{'model':db[_0x536fb0[_0xa886('0x21')]],'as':_0x536fb0['as'],'attributes':_0x536fb0['attributes'],'include':_0x536fb0['include']?_[_0xa886('0x20')](_0x536fb0[_0xa886('0x1f')],function(_0x19cfff){return{'model':db[_0x19cfff[_0xa886('0x21')]],'as':_0x19cfff['as'],'attributes':_0x19cfff['attributes'],'include':_0x19cfff[_0xa886('0x1f')]?_[_0xa886('0x20')](_0x19cfff[_0xa886('0x1f')],function(_0x14025e){return{'model':db[_0x14025e[_0xa886('0x21')]],'as':_0x14025e['as'],'attributes':_0x14025e[_0xa886('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa886('0xc')](function(_0x29e8c9){var _0x5df215=[];for(var _0x469710=0x0;_0x469710<_0x29e8c9[_0xa886('0x46')];_0x469710+=0x1){_0x5df215[_0xa886('0x39')](_0x29e8c9[_0x469710][_0xa886('0x27')](_0x553e83[_0xa886('0x26')],{'transaction':_0x25c37c}));}return BPromise[_0xa886('0x3a')](_0x5df215);});})[_0xa886('0xc')](function(_0x39ece6){logger[_0xa886('0xd')](_0xa886('0x45'),_0x553e83);logger['debug'](_0xa886('0x45'),_0x553e83,JSON['stringify'](_0x39ece6));_0x2267be(_0x39ece6);})['catch'](function(_0x5d415f){logger[_0xa886('0x11')](_0xa886('0x45'),_0x5d415f[_0xa886('0x14')],_0x553e83);_0x451188(_0x355994[_0xa886('0x11')](0x1f4,_0x5d415f['message']));});});});};exports[_0xa886('0x47')]=function(_0x2f9778){var _0x4202c7=this;return new Promise(function(_0x675f93,_0x3e66b9){db['CmContact'][_0xa886('0x2d')]()[_0xa886('0xc')](function(_0x1b9c39){return db[_0xa886('0x18')][_0xa886('0x19')]({'raw':_0x2f9778[_0xa886('0x1a')]?_0x2f9778['options'][_0xa886('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f9778[_0xa886('0x1a')]?_0x2f9778['options']['where']||null:null,'attributes':_0x2f9778[_0xa886('0x1a')]?_0x2f9778[_0xa886('0x1a')][_0xa886('0x1d')]||null:null,'limit':_0x2f9778[_0xa886('0x1a')]?_0x2f9778[_0xa886('0x1a')][_0xa886('0x1e')]||null:null,'include':_0x2f9778['options']?_0x2f9778[_0xa886('0x1a')][_0xa886('0x1f')]?_[_0xa886('0x20')](_0x2f9778['options'][_0xa886('0x1f')],function(_0x1eaca6){return{'model':db[_0x1eaca6[_0xa886('0x21')]],'as':_0x1eaca6['as'],'attributes':_0x1eaca6['as']===_0xa886('0x48')?_['keys'](_0x1b9c39):_0x1eaca6[_0xa886('0x1d')],'include':_0x1eaca6[_0xa886('0x1f')]?_['map'](_0x1eaca6[_0xa886('0x1f')],function(_0x4b5455){return{'model':db[_0x4b5455[_0xa886('0x21')]],'as':_0x4b5455['as'],'attributes':_0x4b5455[_0xa886('0x1d')],'include':_0x4b5455[_0xa886('0x1f')]?_['map'](_0x4b5455[_0xa886('0x1f')],function(_0x151511){return{'model':db[_0x151511[_0xa886('0x21')]],'as':_0x151511['as'],'attributes':_0x151511[_0xa886('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa886('0xc')](function(_0x557914){logger['info'](_0xa886('0x17'),_0x2f9778);logger[_0xa886('0xe')](_0xa886('0x17'),_0x2f9778,JSON[_0xa886('0x22')](_0x557914));_0x675f93(_0x557914);})[_0xa886('0x16')](function(_0x38b7e0){logger[_0xa886('0x11')]('GetCmHopper',_0x38b7e0[_0xa886('0x14')],_0x2f9778);_0x3e66b9(_0x4202c7[_0xa886('0x11')](0x1f4,_0x38b7e0['message']));});});});}; \ No newline at end of file +var _0x0ef4=['find','map','body','CreateCmHopper','UpdateCmHopper','update','where','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','Contact','User','Agent','name','voicePause','UserId','push','includes','all','CmHopperFinal','create','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','LOCK','UPDATE','length','GetContactRecallMe','keys','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','findAll','raw','options','attributes','limit','include','model','debug','ShowCmHopper','CmHopper'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x0ef4,0x1e4));var _0x40ef=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0x0ef4[_0x412342];return _0x3e62cb;};'use strict';var _=require(_0x40ef('0x0'));var util=require(_0x40ef('0x1'));var moment=require(_0x40ef('0x2'));var BPromise=require(_0x40ef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40ef('0x4'));var db=require(_0x40ef('0x5'))['db'];var utils=require(_0x40ef('0x6'));var logger=require(_0x40ef('0x7'))(_0x40ef('0x8'));var config=require('../../config/environment');var jayson=require(_0x40ef('0x9'));var client=jayson[_0x40ef('0xa')][_0x40ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20b7e4,_0x57e6d6,_0x750da1){return new BPromise(function(_0x272d2d,_0xd3651f){return client[_0x40ef('0xc')](_0x20b7e4,_0x750da1)[_0x40ef('0xd')](function(_0x404cae){logger[_0x40ef('0xe')]('CmHopper,\x20%s,\x20%s',_0x57e6d6,_0x40ef('0xf'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x57e6d6,_0x40ef('0xf'),JSON[_0x40ef('0x10')](_0x404cae));if(_0x404cae[_0x40ef('0x11')]){if(_0x404cae['error'][_0x40ef('0x12')]===0x1f4){logger[_0x40ef('0x11')](_0x40ef('0x13'),_0x57e6d6,_0x404cae[_0x40ef('0x11')][_0x40ef('0x14')]);return _0xd3651f(_0x404cae[_0x40ef('0x11')][_0x40ef('0x14')]);}logger[_0x40ef('0x11')]('CmHopper,\x20%s,\x20%s',_0x57e6d6,_0x404cae['error']['message']);return _0x272d2d(_0x404cae['error'][_0x40ef('0x14')]);}else{logger[_0x40ef('0xe')](_0x40ef('0x13'),_0x57e6d6,_0x40ef('0xf'));_0x272d2d(_0x404cae[_0x40ef('0x15')][_0x40ef('0x14')]);}})[_0x40ef('0x16')](function(_0x396a6b){logger[_0x40ef('0x11')](_0x40ef('0x13'),_0x57e6d6,_0x396a6b);_0xd3651f(_0x396a6b);});});}exports[_0x40ef('0x17')]=function(_0x3d1134){var _0x39f3b6=this;return new Promise(function(_0x2395e4,_0x551d4f){return db['CmHopper'][_0x40ef('0x18')]({'raw':_0x3d1134['options']?_0x3d1134['options'][_0x40ef('0x19')]===undefined?!![]:![]:!![],'where':_0x3d1134[_0x40ef('0x1a')]?_0x3d1134[_0x40ef('0x1a')]['where']||null:null,'attributes':_0x3d1134[_0x40ef('0x1a')]?_0x3d1134[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':_0x3d1134['options']?_0x3d1134[_0x40ef('0x1a')][_0x40ef('0x1c')]||null:null,'include':_0x3d1134[_0x40ef('0x1a')]?_0x3d1134[_0x40ef('0x1a')][_0x40ef('0x1d')]?_['map'](_0x3d1134[_0x40ef('0x1a')][_0x40ef('0x1d')],function(_0x188518){return{'model':db[_0x188518[_0x40ef('0x1e')]],'as':_0x188518['as'],'attributes':_0x188518['attributes'],'include':_0x188518[_0x40ef('0x1d')]?_['map'](_0x188518['include'],function(_0x86efc9){return{'model':db[_0x86efc9[_0x40ef('0x1e')]],'as':_0x86efc9['as'],'attributes':_0x86efc9['attributes'],'include':_0x86efc9[_0x40ef('0x1d')]?_['map'](_0x86efc9['include'],function(_0x2474cf){return{'model':db[_0x2474cf[_0x40ef('0x1e')]],'as':_0x2474cf['as'],'attributes':_0x2474cf[_0x40ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x40ef('0xd')](function(_0x471f12){logger[_0x40ef('0xe')]('GetCmHopper',_0x3d1134);logger[_0x40ef('0x1f')](_0x40ef('0x17'),_0x3d1134,JSON[_0x40ef('0x10')](_0x471f12));_0x2395e4(_0x471f12);})[_0x40ef('0x16')](function(_0x17413d){logger[_0x40ef('0x11')](_0x40ef('0x17'),_0x17413d[_0x40ef('0x14')],_0x3d1134);_0x551d4f(_0x39f3b6[_0x40ef('0x11')](0x1f4,_0x17413d[_0x40ef('0x14')]));});});};exports[_0x40ef('0x20')]=function(_0x2eae01){var _0x306bc0=this;return new Promise(function(_0x56e9d7,_0x549801){return db[_0x40ef('0x21')][_0x40ef('0x22')]({'raw':_0x2eae01[_0x40ef('0x1a')]?_0x2eae01[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'where':_0x2eae01[_0x40ef('0x1a')]?_0x2eae01[_0x40ef('0x1a')]['where']||null:null,'attributes':_0x2eae01['options']?_0x2eae01[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'include':_0x2eae01[_0x40ef('0x1a')]?_0x2eae01[_0x40ef('0x1a')]['include']?_['map'](_0x2eae01['options']['include'],function(_0x5cc539){return{'model':db[_0x5cc539[_0x40ef('0x1e')]],'as':_0x5cc539['as'],'attributes':_0x5cc539[_0x40ef('0x1b')],'include':_0x5cc539[_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x5cc539[_0x40ef('0x1d')],function(_0x304601){return{'model':db[_0x304601[_0x40ef('0x1e')]],'as':_0x304601['as'],'attributes':_0x304601[_0x40ef('0x1b')],'include':_0x304601['include']?_[_0x40ef('0x23')](_0x304601[_0x40ef('0x1d')],function(_0x1355b2){return{'model':db[_0x1355b2[_0x40ef('0x1e')]],'as':_0x1355b2['as'],'attributes':_0x1355b2[_0x40ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x40ef('0xd')](function(_0x212b22){logger[_0x40ef('0xe')](_0x40ef('0x20'),_0x2eae01);logger[_0x40ef('0x1f')](_0x40ef('0x20'),_0x2eae01,JSON[_0x40ef('0x10')](_0x212b22));_0x56e9d7(_0x212b22);})[_0x40ef('0x16')](function(_0x4461cd){logger[_0x40ef('0x11')](_0x40ef('0x20'),_0x4461cd[_0x40ef('0x14')],_0x2eae01);_0x549801(_0x306bc0[_0x40ef('0x11')](0x1f4,_0x4461cd['message']));});});};exports['CreateCmHopper']=function(_0x25246e){var _0x39eda2=this;return new Promise(function(_0x23f167,_0x1b8be0){return db['CmHopper']['create'](_0x25246e[_0x40ef('0x24')],{'raw':_0x25246e[_0x40ef('0x1a')]?_0x25246e[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![]})[_0x40ef('0xd')](function(_0xdbc68){logger['info'](_0x40ef('0x25'),_0x25246e);logger[_0x40ef('0x1f')](_0x40ef('0x25'),_0x25246e,JSON[_0x40ef('0x10')](_0xdbc68));_0x23f167(_0xdbc68);})['catch'](function(_0x4eabe7){logger[_0x40ef('0x11')]('CreateCmHopper',_0x4eabe7[_0x40ef('0x14')],_0x25246e);_0x1b8be0(_0x39eda2[_0x40ef('0x11')](0x1f4,_0x4eabe7['message']));});});};exports[_0x40ef('0x26')]=function(_0x1e8602){var _0x663c12=this;return new Promise(function(_0x544b2c,_0x3487b2){return db[_0x40ef('0x21')][_0x40ef('0x27')](_0x1e8602[_0x40ef('0x24')],{'raw':_0x1e8602[_0x40ef('0x1a')]?_0x1e8602[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8602[_0x40ef('0x1a')]?_0x1e8602['options'][_0x40ef('0x28')]||null:null,'attributes':_0x1e8602['options']?_0x1e8602[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':_0x1e8602[_0x40ef('0x1a')]?_0x1e8602['options'][_0x40ef('0x1c')]||null:null})[_0x40ef('0xd')](function(_0xbca7c2){logger[_0x40ef('0xe')](_0x40ef('0x26'),_0x1e8602);logger[_0x40ef('0x1f')](_0x40ef('0x26'),_0x1e8602,JSON[_0x40ef('0x10')](_0xbca7c2));_0x544b2c(_0xbca7c2);})[_0x40ef('0x16')](function(_0x50e89c){logger[_0x40ef('0x11')](_0x40ef('0x26'),_0x50e89c[_0x40ef('0x14')],_0x1e8602);_0x3487b2(_0x663c12[_0x40ef('0x11')](0x1f4,_0x50e89c[_0x40ef('0x14')]));});});};exports[_0x40ef('0x29')]=function(_0x53dd0a){var _0x498ba7=this;return new Promise(function(_0x44a488,_0x475cc8){return db[_0x40ef('0x21')]['destroy']({'where':_0x53dd0a['options']?_0x53dd0a['options'][_0x40ef('0x28')]||null:null})['then'](function(_0x4653e4){logger[_0x40ef('0xe')](_0x40ef('0x29'),_0x53dd0a);logger[_0x40ef('0x1f')](_0x40ef('0x29'),_0x53dd0a,JSON[_0x40ef('0x10')](_0x4653e4));_0x44a488(_0x4653e4);})[_0x40ef('0x16')](function(_0x5cb16c){logger['error'](_0x40ef('0x29'),_0x5cb16c[_0x40ef('0x14')],_0x53dd0a);_0x475cc8(_0x498ba7[_0x40ef('0x11')](0x1f4,_0x5cb16c[_0x40ef('0x14')]));});});};exports[_0x40ef('0x2a')]=function(_0x28a643){var _0x3b28b6=this;return new Promise(function(_0x38c096,_0xd6e7de){return db[_0x40ef('0x2b')][_0x40ef('0x2c')]()[_0x40ef('0xd')](function(_0x13dc4c){return db[_0x40ef('0x2d')][_0x40ef('0x2e')](function(_0x422784){return db[_0x40ef('0x21')][_0x40ef('0x18')]({'where':_0x28a643[_0x40ef('0x1a')]?_0x28a643[_0x40ef('0x1a')]['where']||null:null,'attributes':_0x28a643[_0x40ef('0x1a')]?_0x28a643[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':_0x28a643[_0x40ef('0x1a')]?_0x28a643[_0x40ef('0x1a')]['limit']||null:null,'order':_0x28a643['options']?_0x28a643[_0x40ef('0x1a')][_0x40ef('0x2f')]||null:null,'transaction':_0x422784,'lock':_0x422784['LOCK']['UPDATE'],'include':[{'model':db[_0x40ef('0x2b')],'as':_0x40ef('0x30'),'attributes':_['keys'](_0x13dc4c)},{'model':db[_0x40ef('0x31')],'as':_0x40ef('0x32'),'attributes':['id',_0x40ef('0x33'),_0x40ef('0x34')]}]})[_0x40ef('0xd')](function(_0x5b54fa){var _0xe371db=[];var _0x387e57=[];for(var _0x1b9096=0x0;_0x1b9096<_0x5b54fa['length'];_0x1b9096+=0x1){var _0x2c8645=_0x5b54fa[_0x1b9096][_0x40ef('0x35')];if(_0x2c8645===null){_0xe371db[_0x40ef('0x36')](_0x5b54fa[_0x1b9096]['update'](_0x28a643[_0x40ef('0x24')],{'transaction':_0x422784}));}else if(!_0x387e57[_0x40ef('0x37')](_0x2c8645)){_0x387e57['push'](_0x2c8645);_0xe371db[_0x40ef('0x36')](_0x5b54fa[_0x1b9096][_0x40ef('0x27')](_0x28a643[_0x40ef('0x24')],{'transaction':_0x422784}));}}return BPromise[_0x40ef('0x38')](_0xe371db);});})[_0x40ef('0xd')](function(_0x138af7){logger['info'](_0x40ef('0x2a'),_0x28a643);logger[_0x40ef('0x1f')]('GetContactDialer',_0x28a643,JSON['stringify'](_0x138af7));_0x38c096(_0x138af7);})[_0x40ef('0x16')](function(_0x20b417){logger[_0x40ef('0x11')](_0x40ef('0x2a'),_0x20b417[_0x40ef('0x14')],_0x28a643);_0xd6e7de(_0x3b28b6[_0x40ef('0x11')](0x1f4,_0x20b417['message']));});});});};exports['MoveContactManagedDialer']=function(_0x12e36f){var _0x3a91c0=this;return new Promise(function(_0x4c0142,_0x1fec99){return db['sequelize'][_0x40ef('0x2e')](function(_0x3a22a1){return db[_0x40ef('0x39')][_0x40ef('0x3a')](_0x12e36f[_0x40ef('0x24')],{'raw':_0x12e36f[_0x40ef('0x1a')]?_0x12e36f[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'transaction':_0x3a22a1})[_0x40ef('0xd')](function(){return db[_0x40ef('0x21')][_0x40ef('0x3b')]({'where':_0x12e36f['options']?_0x12e36f['options'][_0x40ef('0x28')]||null:null,'transaction':_0x3a22a1});});})[_0x40ef('0xd')](function(_0x2e06f5){logger[_0x40ef('0xe')](_0x40ef('0x3c'),_0x12e36f);logger[_0x40ef('0x1f')]('MoveContactManagedDialer',_0x12e36f,JSON['stringify'](_0x2e06f5));_0x4c0142(_0x2e06f5);})[_0x40ef('0x16')](function(_0x3726dc){logger['error'](_0x40ef('0x3c'),_0x3726dc[_0x40ef('0x14')],_0x12e36f);_0x1fec99(_0x3a91c0[_0x40ef('0x11')](0x1f4,_0x3726dc[_0x40ef('0x14')]));});});};exports[_0x40ef('0x3d')]=function(_0x13a201){var _0x43d78c=this;return new Promise(function(_0x2221a2,_0x4a3567){return db['CmHopper'][_0x40ef('0x18')]({'raw':_0x13a201['options']?_0x13a201[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'where':_0x13a201[_0x40ef('0x1a')]?_0x13a201[_0x40ef('0x1a')][_0x40ef('0x28')]||null:null,'attributes':[[db[_0x40ef('0x2d')]['fn'](_0x40ef('0x3e'),db[_0x40ef('0x2d')]['fn']('IF',db[_0x40ef('0x2d')][_0x40ef('0x3f')](_0x40ef('0x40')+util[_0x40ef('0x41')](_0x40ef('0x42'),moment()[_0x40ef('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x40ef('0x43')))),_0x40ef('0x44')]]})[_0x40ef('0xd')](function(_0x371016){logger[_0x40ef('0xe')]('CountReScheduled',_0x13a201);logger[_0x40ef('0x1f')]('CountReScheduled',_0x13a201,JSON[_0x40ef('0x10')](_0x371016));_0x2221a2(_0x371016);})[_0x40ef('0x16')](function(_0x323976){logger[_0x40ef('0x11')](_0x40ef('0x3d'),_0x323976['message'],_0x13a201);_0x4a3567(_0x43d78c[_0x40ef('0x11')](0x1f4,_0x323976[_0x40ef('0x14')]));});});};exports['GetContactRecallMe']=function(_0x795397){var _0x5e9119=this;return new Promise(function(_0x362585,_0x4536c6){return db[_0x40ef('0x2b')][_0x40ef('0x2c')]()[_0x40ef('0xd')](function(_0x24e362){return db[_0x40ef('0x2d')]['transaction'](function(_0x267b47){return db[_0x40ef('0x21')][_0x40ef('0x18')]({'where':_0x795397[_0x40ef('0x1a')]?_0x795397[_0x40ef('0x1a')]['where']||null:null,'attributes':_0x795397[_0x40ef('0x1a')]?_0x795397[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':0x1,'order':_0x795397[_0x40ef('0x1a')]?_0x795397[_0x40ef('0x1a')][_0x40ef('0x2f')]||null:null,'group':db[_0x40ef('0x21')][_0x40ef('0x35')],'transaction':_0x267b47,'lock':_0x267b47[_0x40ef('0x45')][_0x40ef('0x46')],'include':_0x795397[_0x40ef('0x1a')]?_0x795397[_0x40ef('0x1a')][_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x795397[_0x40ef('0x1a')][_0x40ef('0x1d')],function(_0x14489e){return{'model':db[_0x14489e[_0x40ef('0x1e')]],'as':_0x14489e['as'],'attributes':_0x14489e[_0x40ef('0x1b')],'include':_0x14489e[_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x14489e[_0x40ef('0x1d')],function(_0x4f79c2){return{'model':db[_0x4f79c2[_0x40ef('0x1e')]],'as':_0x4f79c2['as'],'attributes':_0x4f79c2[_0x40ef('0x1b')],'include':_0x4f79c2[_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x4f79c2[_0x40ef('0x1d')],function(_0x2becb0){return{'model':db[_0x2becb0[_0x40ef('0x1e')]],'as':_0x2becb0['as'],'attributes':_0x2becb0['attributes']};}):[]};}):[]};}):[]:[]})[_0x40ef('0xd')](function(_0x1b0ac2){var _0xc533aa=[];for(var _0x477f9f=0x0;_0x477f9f<_0x1b0ac2[_0x40ef('0x47')];_0x477f9f+=0x1){_0xc533aa[_0x40ef('0x36')](_0x1b0ac2[_0x477f9f][_0x40ef('0x27')](_0x795397['body'],{'transaction':_0x267b47}));}return BPromise[_0x40ef('0x38')](_0xc533aa);});})[_0x40ef('0xd')](function(_0x1caa34){logger[_0x40ef('0xe')]('GetContactRecallMe',_0x795397);logger[_0x40ef('0x1f')](_0x40ef('0x48'),_0x795397,JSON[_0x40ef('0x10')](_0x1caa34));_0x362585(_0x1caa34);})[_0x40ef('0x16')](function(_0x3029bf){logger[_0x40ef('0x11')](_0x40ef('0x48'),_0x3029bf[_0x40ef('0x14')],_0x795397);_0x4536c6(_0x5e9119[_0x40ef('0x11')](0x1f4,_0x3029bf[_0x40ef('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x29ef48){var _0x114627=this;return new Promise(function(_0x1fea47,_0x3b82e3){db[_0x40ef('0x2b')][_0x40ef('0x2c')]()[_0x40ef('0xd')](function(_0x54ee5c){return db['CmHopper']['findAll']({'raw':_0x29ef48['options']?_0x29ef48[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'where':_0x29ef48[_0x40ef('0x1a')]?_0x29ef48[_0x40ef('0x1a')][_0x40ef('0x28')]||null:null,'attributes':_0x29ef48['options']?_0x29ef48[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':_0x29ef48[_0x40ef('0x1a')]?_0x29ef48[_0x40ef('0x1a')]['limit']||null:null,'include':_0x29ef48[_0x40ef('0x1a')]?_0x29ef48[_0x40ef('0x1a')][_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x29ef48['options'][_0x40ef('0x1d')],function(_0x459f69){return{'model':db[_0x459f69[_0x40ef('0x1e')]],'as':_0x459f69['as'],'attributes':_0x459f69['as']===_0x40ef('0x30')?_[_0x40ef('0x49')](_0x54ee5c):_0x459f69[_0x40ef('0x1b')],'include':_0x459f69[_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x459f69[_0x40ef('0x1d')],function(_0x4747a3){return{'model':db[_0x4747a3[_0x40ef('0x1e')]],'as':_0x4747a3['as'],'attributes':_0x4747a3[_0x40ef('0x1b')],'include':_0x4747a3['include']?_[_0x40ef('0x23')](_0x4747a3['include'],function(_0x56e17a){return{'model':db[_0x56e17a[_0x40ef('0x1e')]],'as':_0x56e17a['as'],'attributes':_0x56e17a['attributes']};}):[]};}):[]};}):[]:[]})[_0x40ef('0xd')](function(_0x1afcdf){logger[_0x40ef('0xe')](_0x40ef('0x17'),_0x29ef48);logger[_0x40ef('0x1f')](_0x40ef('0x17'),_0x29ef48,JSON[_0x40ef('0x10')](_0x1afcdf));_0x1fea47(_0x1afcdf);})[_0x40ef('0x16')](function(_0xbad852){logger[_0x40ef('0x11')](_0x40ef('0x17'),_0xbad852[_0x40ef('0x14')],_0x29ef48);_0x3b82e3(_0x114627[_0x40ef('0x11')](0x1f4,_0xbad852[_0x40ef('0x14')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 939822b..6eb7e8e 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 _0x45a1=['get','isAuthenticated','index','/describe','describe','getOpenContacts','create','post','getPreview','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x25a407,_0x3f33fd){var _0x54a912=function(_0x2eecb9){while(--_0x2eecb9){_0x25a407['push'](_0x25a407['shift']());}};_0x54a912(++_0x3f33fd);}(_0x45a1,0xbe));var _0x145a=function(_0xad13f1,_0x5a3371){_0xad13f1=_0xad13f1-0x0;var _0x1b7a2d=_0x45a1[_0xad13f1];return _0x1b7a2d;};'use strict';var multer=require(_0x145a('0x0'));var util=require(_0x145a('0x1'));var path=require(_0x145a('0x2'));var timeout=require(_0x145a('0x3'));var express=require(_0x145a('0x4'));var router=express[_0x145a('0x5')]();var fs_extra=require(_0x145a('0x6'));var auth=require(_0x145a('0x7'));var interaction=require(_0x145a('0x8'));var config=require(_0x145a('0x9'));var controller=require('./cmHopper.controller');router[_0x145a('0xa')]('/',auth[_0x145a('0xb')](),controller[_0x145a('0xc')]);router['get'](_0x145a('0xd'),auth[_0x145a('0xb')](),controller[_0x145a('0xe')]);router[_0x145a('0xa')]('/opencontacts',auth[_0x145a('0xb')](),controller[_0x145a('0xf')]);router[_0x145a('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x145a('0xb')](),controller[_0x145a('0x10')]);router[_0x145a('0x11')]('/preview',auth['isAuthenticated'](),controller[_0x145a('0x12')]);router[_0x145a('0x13')](_0x145a('0x14'),auth[_0x145a('0xb')](),controller[_0x145a('0x15')]);router[_0x145a('0x16')]('/:id',auth[_0x145a('0xb')](),controller[_0x145a('0x17')]);module[_0x145a('0x18')]=router; \ No newline at end of file +var _0x44a1=['./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','show','getPreview','put','update','exports','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0x44a1,0x164));var _0x144a=function(_0x8f60d1,_0x15d9cd){_0x8f60d1=_0x8f60d1-0x0;var _0x25d617=_0x44a1[_0x8f60d1];return _0x25d617;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x144a('0x0'));var timeout=require('connect-timeout');var express=require(_0x144a('0x1'));var router=express[_0x144a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x144a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x144a('0x4'));var controller=require(_0x144a('0x5'));router[_0x144a('0x6')]('/',auth['isAuthenticated'](),controller[_0x144a('0x7')]);router['get'](_0x144a('0x8'),auth[_0x144a('0x9')](),controller[_0x144a('0xa')]);router['get'](_0x144a('0xb'),auth[_0x144a('0x9')](),controller[_0x144a('0xc')]);router[_0x144a('0x6')](_0x144a('0xd'),auth[_0x144a('0x9')](),controller[_0x144a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/preview',auth[_0x144a('0x9')](),controller[_0x144a('0xf')]);router[_0x144a('0x10')]('/:id',auth[_0x144a('0x9')](),controller[_0x144a('0x11')]);router['delete'](_0x144a('0xd'),auth[_0x144a('0x9')](),controller['destroy']);module[_0x144a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 761750e..32fa7a8 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 _0xdc97=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0x1d4bde,_0x15f9fb){var _0x5733e8=function(_0x1d7070){while(--_0x1d7070){_0x1d4bde['push'](_0x1d4bde['shift']());}};_0x5733e8(++_0x15f9fb);}(_0xdc97,0x13b));var _0x7dc9=function(_0xed475c,_0x1deb24){_0xed475c=_0xed475c-0x0;var _0x39f4c1=_0xdc97[_0xed475c];return _0x39f4c1;};'use strict';var moment=require(_0x7dc9('0x0'));var Sequelize=require(_0x7dc9('0x1'));module[_0x7dc9('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7dc9('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x7dc9('0x3')],'unique':_0x7dc9('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x7dc9('0x4')}}; \ No newline at end of file +var _0x8147=['INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x348184,_0x1526ba){var _0x2dfd4f=function(_0x3999da){while(--_0x3999da){_0x348184['push'](_0x348184['shift']());}};_0x2dfd4f(++_0x1526ba);}(_0x8147,0x179));var _0x7814=function(_0x3069cb,_0x1929df){_0x3069cb=_0x3069cb-0x0;var _0x163c3c=_0x8147[_0x3069cb];return _0x163c3c;};'use strict';var moment=require(_0x7814('0x0'));var Sequelize=require(_0x7814('0x1'));module['exports']={'phone':{'type':Sequelize[_0x7814('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7814('0x3')],'unique':_0x7814('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x7814('0x4')},'VoiceQueueId':{'type':Sequelize[_0x7814('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index c928ae3..30b2917 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 _0xc7ca=['bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','CmHopperBlack','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x502598,_0x1e95c8){var _0xbdee21=function(_0x140feb){while(--_0x140feb){_0x502598['push'](_0x502598['shift']());}};_0xbdee21(++_0x1e95c8);}(_0xc7ca,0xdd));var _0xac7c=function(_0x450047,_0x36cabf){_0x450047=_0x450047-0x0;var _0x39ef5c=_0xc7ca[_0x450047];return _0x39ef5c;};'use strict';var emlformat=require(_0xac7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac7c('0x1'));var jsonpatch=require(_0xac7c('0x2'));var rp=require(_0xac7c('0x3'));var moment=require('moment');var BPromise=require(_0xac7c('0x4'));var Mustache=require(_0xac7c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xac7c('0x6'));var csv=require(_0xac7c('0x7'));var ejs=require(_0xac7c('0x8'));var fs=require('fs');var fs_extra=require(_0xac7c('0x9'));var _=require(_0xac7c('0xa'));var squel=require(_0xac7c('0xb'));var crypto=require(_0xac7c('0xc'));var jsforce=require(_0xac7c('0xd'));var deskjs=require(_0xac7c('0xe'));var toCsv=require(_0xac7c('0x7'));var querystring=require('querystring');var Papa=require(_0xac7c('0xf'));var Redis=require(_0xac7c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xac7c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac7c('0x12'));var logger=require(_0xac7c('0x13'))('api');var utils=require(_0xac7c('0x14'));var config=require(_0xac7c('0x15'));var licenseUtil=require(_0xac7c('0x16'));var db=require(_0xac7c('0x17'))['db'];function respondWithStatusCode(_0x2ccd77,_0x2f1c80){_0x2f1c80=_0x2f1c80||0xcc;return function(_0x13f9a4){if(_0x13f9a4){return _0x2ccd77[_0xac7c('0x18')](_0x2f1c80);}return _0x2ccd77[_0xac7c('0x19')](_0x2f1c80)[_0xac7c('0x1a')]();};}function respondWithResult(_0x44b713,_0x296593){_0x296593=_0x296593||0xc8;return function(_0x1bcc6c){if(_0x1bcc6c){return _0x44b713[_0xac7c('0x19')](_0x296593)[_0xac7c('0x1b')](_0x1bcc6c);}};}function respondWithFilteredResult(_0x4897ab,_0x24f2b9){return function(_0x41d3e8){if(_0x41d3e8){var _0x4bc37b=typeof _0x24f2b9[_0xac7c('0x1c')]===_0xac7c('0x1d')&&typeof _0x24f2b9[_0xac7c('0x1e')]==='undefined';var _0x1265ad=_0x41d3e8['count'];var _0x1acd78=_0x4bc37b?0x0:_0x24f2b9['offset'];var _0x22861a=_0x4bc37b?_0x41d3e8[_0xac7c('0x1f')]:_0x24f2b9[_0xac7c('0x1c')]+_0x24f2b9[_0xac7c('0x1e')];var _0x57d755;if(_0x22861a>=_0x1265ad){_0x22861a=_0x1265ad;_0x57d755=0xc8;}else{_0x57d755=0xce;}_0x4897ab[_0xac7c('0x19')](_0x57d755);return _0x4897ab['set'](_0xac7c('0x20'),_0x1acd78+'-'+_0x22861a+'/'+_0x1265ad)[_0xac7c('0x1b')](_0x41d3e8);}return null;};}function patchUpdates(_0x342d20){return function(_0x1f8ea8){try{jsonpatch[_0xac7c('0x21')](_0x1f8ea8,_0x342d20,!![]);}catch(_0x58608d){return BPromise[_0xac7c('0x22')](_0x58608d);}return _0x1f8ea8[_0xac7c('0x23')]();};}function saveUpdates(_0x172abe,_0x28c96b){return function(_0x6b8eea){if(_0x6b8eea){return _0x6b8eea[_0xac7c('0x24')](_0x172abe)[_0xac7c('0x25')](function(_0x548185){return _0x548185;});}return null;};}function removeEntity(_0x22d8f7,_0x59c086){return function(_0x35e40d){if(_0x35e40d){return _0x35e40d[_0xac7c('0x26')]()['then'](function(){_0x22d8f7[_0xac7c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x405ac9,_0xef535a){return function(_0x57d1ee){if(!_0x57d1ee){_0x405ac9[_0xac7c('0x18')](0x194);}return _0x57d1ee;};}function handleError(_0x505a80,_0x381ca9){_0x381ca9=_0x381ca9||0x1f4;return function(_0x3c587d){logger['error'](_0x3c587d[_0xac7c('0x27')]);if(_0x3c587d[_0xac7c('0x28')]){delete _0x3c587d[_0xac7c('0x28')];}_0x505a80[_0xac7c('0x19')](_0x381ca9)['send'](_0x3c587d);};}exports[_0xac7c('0x29')]=function(_0x2a1fd7,_0x26b9c9){var _0x220d78={},_0x127b39={},_0x3976f5={'count':0x0,'rows':[]};var _0x365cf0=_[_0xac7c('0x2a')](db[_0xac7c('0x2b')][_0xac7c('0x2c')],function(_0x56d826){return{'name':_0x56d826['fieldName'],'type':_0x56d826[_0xac7c('0x2d')][_0xac7c('0x2e')]};});_0x127b39[_0xac7c('0x2f')]=_[_0xac7c('0x2a')](_0x365cf0,_0xac7c('0x28'));_0x127b39[_0xac7c('0x30')]=_[_0xac7c('0x31')](_0x2a1fd7[_0xac7c('0x30')]);_0x127b39[_0xac7c('0x32')]=_[_0xac7c('0x33')](_0x127b39[_0xac7c('0x2f')],_0x127b39[_0xac7c('0x30')]);_0x220d78['attributes']=_[_0xac7c('0x33')](_0x127b39[_0xac7c('0x2f')],qs[_0xac7c('0x34')](_0x2a1fd7[_0xac7c('0x30')][_0xac7c('0x34')]));_0x220d78['attributes']=_0x220d78[_0xac7c('0x35')][_0xac7c('0x36')]?_0x220d78[_0xac7c('0x35')]:_0x127b39['model'];if(!_0x2a1fd7[_0xac7c('0x30')][_0xac7c('0x37')](_0xac7c('0x38'))){_0x220d78[_0xac7c('0x1e')]=qs['limit'](_0x2a1fd7[_0xac7c('0x30')][_0xac7c('0x1e')]);_0x220d78[_0xac7c('0x1c')]=qs[_0xac7c('0x1c')](_0x2a1fd7[_0xac7c('0x30')][_0xac7c('0x1c')]);}_0x220d78[_0xac7c('0x39')]=qs[_0xac7c('0x3a')](_0x2a1fd7[_0xac7c('0x30')][_0xac7c('0x3a')]);_0x220d78[_0xac7c('0x3b')]=qs[_0xac7c('0x32')](_[_0xac7c('0x3c')](_0x2a1fd7[_0xac7c('0x30')],_0x127b39[_0xac7c('0x32')]),_0x365cf0);if(_0x2a1fd7[_0xac7c('0x30')]['filter']){_0x220d78[_0xac7c('0x3b')]=_['merge'](_0x220d78[_0xac7c('0x3b')],{'$or':_['map'](_0x365cf0,function(_0x42e1bc){if(_0x42e1bc[_0xac7c('0x2d')]!==_0xac7c('0x3d')){var _0x1c964b={};_0x1c964b[_0x42e1bc['name']]={'$like':'%'+_0x2a1fd7[_0xac7c('0x30')][_0xac7c('0x3e')]+'%'};return _0x1c964b;}})});}_0x220d78=_[_0xac7c('0x3f')]({},_0x220d78,_0x2a1fd7[_0xac7c('0x40')]);var _0x4562f4={'where':_0x220d78[_0xac7c('0x3b')]};return db[_0xac7c('0x2b')][_0xac7c('0x1f')](_0x4562f4)[_0xac7c('0x25')](function(_0x2425bd){_0x3976f5['count']=_0x2425bd;if(_0x2a1fd7['query']['includeAll']){_0x220d78[_0xac7c('0x41')]=[{'all':!![]}];}return db[_0xac7c('0x2b')][_0xac7c('0x42')](_0x220d78);})['then'](function(_0x1aa53c){_0x3976f5[_0xac7c('0x43')]=_0x1aa53c;return _0x3976f5;})[_0xac7c('0x25')](respondWithFilteredResult(_0x26b9c9,_0x220d78))[_0xac7c('0x44')](handleError(_0x26b9c9,null));};exports[_0xac7c('0x45')]=function(_0x2a29b1,_0x4cd5b8){var _0x216517={'raw':!![],'where':{'id':_0x2a29b1[_0xac7c('0x46')]['id']}},_0xcf9e75={};_0xcf9e75['model']=_[_0xac7c('0x31')](db['CmHopperBlack'][_0xac7c('0x2c')]);_0xcf9e75['query']=_[_0xac7c('0x31')](_0x2a29b1[_0xac7c('0x30')]);_0xcf9e75['filters']=_[_0xac7c('0x33')](_0xcf9e75[_0xac7c('0x2f')],_0xcf9e75[_0xac7c('0x30')]);_0x216517['attributes']=_['intersection'](_0xcf9e75[_0xac7c('0x2f')],qs[_0xac7c('0x34')](_0x2a29b1[_0xac7c('0x30')]['fields']));_0x216517[_0xac7c('0x35')]=_0x216517['attributes'][_0xac7c('0x36')]?_0x216517[_0xac7c('0x35')]:_0xcf9e75[_0xac7c('0x2f')];if(_0x2a29b1['query'][_0xac7c('0x47')]){_0x216517['include']=[{'all':!![]}];}_0x216517=_[_0xac7c('0x3f')]({},_0x216517,_0x2a29b1[_0xac7c('0x40')]);return db[_0xac7c('0x2b')][_0xac7c('0x48')](_0x216517)['then'](handleEntityNotFound(_0x4cd5b8,null))[_0xac7c('0x25')](respondWithResult(_0x4cd5b8,null))[_0xac7c('0x44')](handleError(_0x4cd5b8,null));};exports[_0xac7c('0x24')]=function(_0x41aaff,_0x52dfde){if(_0x41aaff[_0xac7c('0x49')]['id']){delete _0x41aaff[_0xac7c('0x49')]['id'];}return db[_0xac7c('0x2b')][_0xac7c('0x48')]({'where':{'id':_0x41aaff['params']['id']}})['then'](handleEntityNotFound(_0x52dfde,null))[_0xac7c('0x25')](saveUpdates(_0x41aaff[_0xac7c('0x49')],null))[_0xac7c('0x25')](respondWithResult(_0x52dfde,null))[_0xac7c('0x44')](handleError(_0x52dfde,null));};exports[_0xac7c('0x26')]=function(_0x3671dd,_0x4cf81d){return db[_0xac7c('0x2b')][_0xac7c('0x48')]({'where':{'id':_0x3671dd['params']['id']}})[_0xac7c('0x25')](handleEntityNotFound(_0x4cf81d,null))[_0xac7c('0x25')](removeEntity(_0x4cf81d,null))[_0xac7c('0x44')](handleError(_0x4cf81d,null));};exports[_0xac7c('0x4a')]=function(_0x25f47e,_0x281011){return db[_0xac7c('0x2b')][_0xac7c('0x4a')]()[_0xac7c('0x25')](respondWithResult(_0x281011,null))['catch'](handleError(_0x281011,null));}; \ No newline at end of file +var _0x65fe=['destroy','sendStatus','error','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','catch','show','length','includeAll','find','body','params','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','end','status','json','offset','count','limit','Content-Range','apply','save','update','then'];(function(_0x3d1dbd,_0x5300f3){var _0xc9b900=function(_0x1ef8f4){while(--_0x1ef8f4){_0x3d1dbd['push'](_0x3d1dbd['shift']());}};_0xc9b900(++_0x5300f3);}(_0x65fe,0x16c));var _0xe65f=function(_0x538d45,_0x2d953){_0x538d45=_0x538d45-0x0;var _0x5d91e5=_0x65fe[_0x538d45];return _0x5d91e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe65f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe65f('0x1'));var rp=require(_0xe65f('0x2'));var moment=require(_0xe65f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe65f('0x4'));var util=require('util');var path=require(_0xe65f('0x5'));var sox=require(_0xe65f('0x6'));var csv=require(_0xe65f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe65f('0x8'));var _=require('lodash');var squel=require(_0xe65f('0x9'));var crypto=require(_0xe65f('0xa'));var jsforce=require(_0xe65f('0xb'));var deskjs=require(_0xe65f('0xc'));var toCsv=require(_0xe65f('0x7'));var querystring=require(_0xe65f('0xd'));var Papa=require(_0xe65f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe65f('0xf'));var as=require(_0xe65f('0x10'));var hardwareService=require(_0xe65f('0x11'));var logger=require('../../config/logger')(_0xe65f('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe65f('0x13'));var db=require(_0xe65f('0x14'))['db'];function respondWithStatusCode(_0x1bc227,_0x33c92d){_0x33c92d=_0x33c92d||0xcc;return function(_0x59e718){if(_0x59e718){return _0x1bc227['sendStatus'](_0x33c92d);}return _0x1bc227['status'](_0x33c92d)[_0xe65f('0x15')]();};}function respondWithResult(_0x404b48,_0x2e882e){_0x2e882e=_0x2e882e||0xc8;return function(_0x28213e){if(_0x28213e){return _0x404b48[_0xe65f('0x16')](_0x2e882e)[_0xe65f('0x17')](_0x28213e);}};}function respondWithFilteredResult(_0x2cad72,_0x520489){return function(_0x3b976b){if(_0x3b976b){var _0x3f2a12=typeof _0x520489[_0xe65f('0x18')]==='undefined'&&typeof _0x520489['limit']==='undefined';var _0xb6095a=_0x3b976b[_0xe65f('0x19')];var _0x46fd24=_0x3f2a12?0x0:_0x520489['offset'];var _0x14aa81=_0x3f2a12?_0x3b976b[_0xe65f('0x19')]:_0x520489['offset']+_0x520489[_0xe65f('0x1a')];var _0x54feb2;if(_0x14aa81>=_0xb6095a){_0x14aa81=_0xb6095a;_0x54feb2=0xc8;}else{_0x54feb2=0xce;}_0x2cad72[_0xe65f('0x16')](_0x54feb2);return _0x2cad72['set'](_0xe65f('0x1b'),_0x46fd24+'-'+_0x14aa81+'/'+_0xb6095a)[_0xe65f('0x17')](_0x3b976b);}return null;};}function patchUpdates(_0x1ea409){return function(_0xa1e2bb){try{jsonpatch[_0xe65f('0x1c')](_0xa1e2bb,_0x1ea409,!![]);}catch(_0xe3f438){return BPromise['reject'](_0xe3f438);}return _0xa1e2bb[_0xe65f('0x1d')]();};}function saveUpdates(_0x5ca71d,_0x34f830){return function(_0x5c8df1){if(_0x5c8df1){return _0x5c8df1[_0xe65f('0x1e')](_0x5ca71d)[_0xe65f('0x1f')](function(_0x490696){return _0x490696;});}return null;};}function removeEntity(_0xe26edf,_0x16b885){return function(_0x35be5c){if(_0x35be5c){return _0x35be5c[_0xe65f('0x20')]()[_0xe65f('0x1f')](function(){_0xe26edf[_0xe65f('0x16')](0xcc)[_0xe65f('0x15')]();});}};}function handleEntityNotFound(_0x3309b6,_0x51188c){return function(_0x5c1115){if(!_0x5c1115){_0x3309b6[_0xe65f('0x21')](0x194);}return _0x5c1115;};}function handleError(_0x58b8ae,_0x52b494){_0x52b494=_0x52b494||0x1f4;return function(_0x5e2b08){logger[_0xe65f('0x22')](_0x5e2b08[_0xe65f('0x23')]);if(_0x5e2b08[_0xe65f('0x24')]){delete _0x5e2b08['name'];}_0x58b8ae[_0xe65f('0x16')](_0x52b494)['send'](_0x5e2b08);};}exports[_0xe65f('0x25')]=function(_0x3674e7,_0xbef71){var _0x31b133={},_0x596a12={},_0x36ba07={'count':0x0,'rows':[]};var _0x183e5c=_[_0xe65f('0x26')](db[_0xe65f('0x27')][_0xe65f('0x28')],function(_0x2999b0){return{'name':_0x2999b0[_0xe65f('0x29')],'type':_0x2999b0['type']['key']};});_0x596a12[_0xe65f('0x2a')]=_[_0xe65f('0x26')](_0x183e5c,'name');_0x596a12[_0xe65f('0x2b')]=_[_0xe65f('0x2c')](_0x3674e7[_0xe65f('0x2b')]);_0x596a12[_0xe65f('0x2d')]=_[_0xe65f('0x2e')](_0x596a12[_0xe65f('0x2a')],_0x596a12[_0xe65f('0x2b')]);_0x31b133[_0xe65f('0x2f')]=_[_0xe65f('0x2e')](_0x596a12['model'],qs[_0xe65f('0x30')](_0x3674e7['query']['fields']));_0x31b133[_0xe65f('0x2f')]=_0x31b133[_0xe65f('0x2f')]['length']?_0x31b133[_0xe65f('0x2f')]:_0x596a12[_0xe65f('0x2a')];if(!_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x31')](_0xe65f('0x32'))){_0x31b133[_0xe65f('0x1a')]=qs[_0xe65f('0x1a')](_0x3674e7['query']['limit']);_0x31b133[_0xe65f('0x18')]=qs[_0xe65f('0x18')](_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x18')]);}_0x31b133[_0xe65f('0x33')]=qs[_0xe65f('0x34')](_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x34')]);_0x31b133['where']=qs[_0xe65f('0x2d')](_[_0xe65f('0x35')](_0x3674e7[_0xe65f('0x2b')],_0x596a12[_0xe65f('0x2d')]),_0x183e5c);if(_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x36')]){_0x31b133[_0xe65f('0x37')]=_[_0xe65f('0x38')](_0x31b133['where'],{'$or':_[_0xe65f('0x26')](_0x183e5c,function(_0x19e9b5){if(_0x19e9b5['type']!=='VIRTUAL'){var _0xecc0b7={};_0xecc0b7[_0x19e9b5['name']]={'$like':'%'+_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x36')]+'%'};return _0xecc0b7;}})});}_0x31b133=_[_0xe65f('0x38')]({},_0x31b133,_0x3674e7[_0xe65f('0x39')]);var _0x39ef7f={'where':_0x31b133[_0xe65f('0x37')]};return db[_0xe65f('0x27')][_0xe65f('0x19')](_0x39ef7f)[_0xe65f('0x1f')](function(_0x5b3021){_0x36ba07[_0xe65f('0x19')]=_0x5b3021;if(_0x3674e7['query']['includeAll']){_0x31b133[_0xe65f('0x3a')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x31b133);})['then'](function(_0x2cf09c){_0x36ba07['rows']=_0x2cf09c;return _0x36ba07;})['then'](respondWithFilteredResult(_0xbef71,_0x31b133))[_0xe65f('0x3b')](handleError(_0xbef71,null));};exports[_0xe65f('0x3c')]=function(_0x13eaf9,_0x38291f){var _0x473553={'raw':!![],'where':{'id':_0x13eaf9['params']['id']}},_0x1e9d96={};_0x1e9d96[_0xe65f('0x2a')]=_[_0xe65f('0x2c')](db['CmHopperBlack'][_0xe65f('0x28')]);_0x1e9d96[_0xe65f('0x2b')]=_['keys'](_0x13eaf9[_0xe65f('0x2b')]);_0x1e9d96['filters']=_[_0xe65f('0x2e')](_0x1e9d96[_0xe65f('0x2a')],_0x1e9d96[_0xe65f('0x2b')]);_0x473553[_0xe65f('0x2f')]=_[_0xe65f('0x2e')](_0x1e9d96['model'],qs[_0xe65f('0x30')](_0x13eaf9['query'][_0xe65f('0x30')]));_0x473553[_0xe65f('0x2f')]=_0x473553[_0xe65f('0x2f')][_0xe65f('0x3d')]?_0x473553['attributes']:_0x1e9d96['model'];if(_0x13eaf9[_0xe65f('0x2b')][_0xe65f('0x3e')]){_0x473553[_0xe65f('0x3a')]=[{'all':!![]}];}_0x473553=_[_0xe65f('0x38')]({},_0x473553,_0x13eaf9['options']);return db[_0xe65f('0x27')][_0xe65f('0x3f')](_0x473553)[_0xe65f('0x1f')](handleEntityNotFound(_0x38291f,null))[_0xe65f('0x1f')](respondWithResult(_0x38291f,null))['catch'](handleError(_0x38291f,null));};exports[_0xe65f('0x1e')]=function(_0x315a26,_0x154332){if(_0x315a26[_0xe65f('0x40')]['id']){delete _0x315a26[_0xe65f('0x40')]['id'];}return db[_0xe65f('0x27')][_0xe65f('0x3f')]({'where':{'id':_0x315a26['params']['id']}})[_0xe65f('0x1f')](handleEntityNotFound(_0x154332,null))[_0xe65f('0x1f')](saveUpdates(_0x315a26[_0xe65f('0x40')],null))['then'](respondWithResult(_0x154332,null))[_0xe65f('0x3b')](handleError(_0x154332,null));};exports[_0xe65f('0x20')]=function(_0x5c6111,_0x389596){return db[_0xe65f('0x27')][_0xe65f('0x3f')]({'where':{'id':_0x5c6111[_0xe65f('0x41')]['id']}})[_0xe65f('0x1f')](handleEntityNotFound(_0x389596,null))[_0xe65f('0x1f')](removeEntity(_0x389596,null))[_0xe65f('0x3b')](handleError(_0x389596,null));};exports['describe']=function(_0x3ad5e5,_0x5903e8){return db[_0xe65f('0x27')]['describe']()[_0xe65f('0x1f')](respondWithResult(_0x5903e8,null))['catch'](handleError(_0x5903e8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 624c4d3..ab2c199 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 _0xc950=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x429693,_0x25b3eb){var _0xc779c6=function(_0x1e4344){while(--_0x1e4344){_0x429693['push'](_0x429693['shift']());}};_0xc779c6(++_0x25b3eb);}(_0xc950,0x1c6));var _0x0c95=function(_0x23b5bd,_0x363716){_0x23b5bd=_0x23b5bd-0x0;var _0x3689c4=_0xc950[_0x23b5bd];return _0x3689c4;};'use strict';var _=require(_0x0c95('0x0'));var util=require(_0x0c95('0x1'));var logger=require(_0x0c95('0x2'))(_0x0c95('0x3'));var moment=require(_0x0c95('0x4'));var BPromise=require(_0x0c95('0x5'));var rp=require(_0x0c95('0x6'));var fs=require('fs');var path=require(_0x0c95('0x7'));var rimraf=require(_0x0c95('0x8'));var config=require(_0x0c95('0x9'));var attributes=require('./cmHopperBlack.attributes');module[_0x0c95('0xa')]=function(_0x11f0db,_0x565b5f){return _0x11f0db['define'](_0x0c95('0xb'),attributes,{'tableName':_0x0c95('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72d0=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black'];(function(_0x17ce0a,_0x206be5){var _0x3b5cd8=function(_0x54204c){while(--_0x54204c){_0x17ce0a['push'](_0x17ce0a['shift']());}};_0x3b5cd8(++_0x206be5);}(_0x72d0,0x1ad));var _0x072d=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0x72d0[_0x3a9635];return _0x10d08c;};'use strict';var _=require(_0x072d('0x0'));var util=require(_0x072d('0x1'));var logger=require(_0x072d('0x2'))(_0x072d('0x3'));var moment=require(_0x072d('0x4'));var BPromise=require(_0x072d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x072d('0x6'));var rimraf=require(_0x072d('0x7'));var config=require(_0x072d('0x8'));var attributes=require(_0x072d('0x9'));module[_0x072d('0xa')]=function(_0x208318,_0x309ec9){return _0x208318[_0x072d('0xb')]('CmHopperBlack',attributes,{'tableName':_0x072d('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 7a63dfe..070b2d8 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 _0x9034=['../../config/environment','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','options','where','attributes','limit','include','map','model','GetCmHopperBlack','stringify','UpdateCmHopperBlack','CmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x457a69,_0x55a28a){var _0x554fd0=function(_0x1c8b18){while(--_0x1c8b18){_0x457a69['push'](_0x457a69['shift']());}};_0x554fd0(++_0x55a28a);}(_0x9034,0x1d8));var _0x4903=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9034[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x4903('0x0'));var util=require(_0x4903('0x1'));var moment=require(_0x4903('0x2'));var BPromise=require(_0x4903('0x3'));var rs=require(_0x4903('0x4'));var fs=require('fs');var Redis=require(_0x4903('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4903('0x6'));var logger=require(_0x4903('0x7'))(_0x4903('0x8'));var config=require(_0x4903('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4903('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x192266,_0x502905,_0x5d6039){return new BPromise(function(_0xa44a33,_0x5a4b74){return client[_0x4903('0xb')](_0x192266,_0x5d6039)[_0x4903('0xc')](function(_0x46f0bc){logger[_0x4903('0xd')](_0x4903('0xe'),_0x502905,'request\x20sent');logger[_0x4903('0xf')](_0x4903('0x10'),_0x502905,_0x4903('0x11'),JSON['stringify'](_0x46f0bc));if(_0x46f0bc[_0x4903('0x12')]){if(_0x46f0bc['error']['code']===0x1f4){logger[_0x4903('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x502905,_0x46f0bc[_0x4903('0x12')][_0x4903('0x13')]);return _0x5a4b74(_0x46f0bc[_0x4903('0x12')][_0x4903('0x13')]);}logger[_0x4903('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x502905,_0x46f0bc['error'][_0x4903('0x13')]);return _0xa44a33(_0x46f0bc[_0x4903('0x12')][_0x4903('0x13')]);}else{logger[_0x4903('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x502905,_0x4903('0x11'));_0xa44a33(_0x46f0bc[_0x4903('0x14')]['message']);}})[_0x4903('0x15')](function(_0x554923){logger[_0x4903('0x12')](_0x4903('0xe'),_0x502905,_0x554923);_0x5a4b74(_0x554923);});});}exports['GetCmHopperBlack']=function(_0x2bd391){var _0x299f0f=this;return new Promise(function(_0x2b992a,_0x3f7e48){return db['CmHopperBlack']['findAll']({'raw':_0x2bd391['options']?_0x2bd391[_0x4903('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2bd391['options']?_0x2bd391[_0x4903('0x16')][_0x4903('0x17')]||null:null,'attributes':_0x2bd391['options']?_0x2bd391[_0x4903('0x16')][_0x4903('0x18')]||null:null,'limit':_0x2bd391[_0x4903('0x16')]?_0x2bd391['options'][_0x4903('0x19')]||null:null,'include':_0x2bd391[_0x4903('0x16')]?_0x2bd391[_0x4903('0x16')][_0x4903('0x1a')]?_[_0x4903('0x1b')](_0x2bd391[_0x4903('0x16')][_0x4903('0x1a')],function(_0x5cc65d){return{'model':db[_0x5cc65d[_0x4903('0x1c')]],'as':_0x5cc65d['as'],'attributes':_0x5cc65d[_0x4903('0x18')],'include':_0x5cc65d[_0x4903('0x1a')]?_[_0x4903('0x1b')](_0x5cc65d[_0x4903('0x1a')],function(_0x4db85c){return{'model':db[_0x4db85c[_0x4903('0x1c')]],'as':_0x4db85c['as'],'attributes':_0x4db85c['attributes'],'include':_0x4db85c[_0x4903('0x1a')]?_[_0x4903('0x1b')](_0x4db85c['include'],function(_0xa0eff7){return{'model':db[_0xa0eff7[_0x4903('0x1c')]],'as':_0xa0eff7['as'],'attributes':_0xa0eff7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4903('0xc')](function(_0x4a6f8f){logger[_0x4903('0xd')](_0x4903('0x1d'),_0x2bd391);logger['debug'](_0x4903('0x1d'),_0x2bd391,JSON[_0x4903('0x1e')](_0x4a6f8f));_0x2b992a(_0x4a6f8f);})[_0x4903('0x15')](function(_0x1ca2e2){logger[_0x4903('0x12')](_0x4903('0x1d'),_0x1ca2e2[_0x4903('0x13')],_0x2bd391);_0x3f7e48(_0x299f0f[_0x4903('0x12')](0x1f4,_0x1ca2e2['message']));});});};exports[_0x4903('0x1f')]=function(_0xc98f7c){var _0x2d9e3e=this;return new Promise(function(_0x19f275,_0x206336){return db[_0x4903('0x20')][_0x4903('0x21')](_0xc98f7c[_0x4903('0x22')],{'raw':_0xc98f7c[_0x4903('0x16')]?_0xc98f7c[_0x4903('0x16')][_0x4903('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc98f7c[_0x4903('0x16')]?_0xc98f7c['options']['where']||null:null,'attributes':_0xc98f7c['options']?_0xc98f7c[_0x4903('0x16')][_0x4903('0x18')]||null:null,'limit':_0xc98f7c[_0x4903('0x16')]?_0xc98f7c[_0x4903('0x16')][_0x4903('0x19')]||null:null})['then'](function(_0xc23e4e){logger[_0x4903('0xd')](_0x4903('0x1f'),_0xc98f7c);logger['debug'](_0x4903('0x1f'),_0xc98f7c,JSON[_0x4903('0x1e')](_0xc23e4e));_0x19f275(_0xc23e4e);})[_0x4903('0x15')](function(_0x5c9c09){logger[_0x4903('0x12')](_0x4903('0x1f'),_0x5c9c09[_0x4903('0x13')],_0xc98f7c);_0x206336(_0x2d9e3e[_0x4903('0x12')](0x1f4,_0x5c9c09[_0x4903('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x5f7e1a){var _0xc4fa7f=this;return new Promise(function(_0x4fb3b2,_0x2011ed){return db[_0x4903('0x20')]['destroy']({'where':_0x5f7e1a[_0x4903('0x16')]?_0x5f7e1a[_0x4903('0x16')]['where']||null:null})['then'](function(_0x5331e3){logger[_0x4903('0xd')]('DestroyCmHopperBlack',_0x5f7e1a);logger[_0x4903('0xf')](_0x4903('0x24'),_0x5f7e1a,JSON['stringify'](_0x5331e3));_0x4fb3b2(_0x5331e3);})[_0x4903('0x15')](function(_0x165878){logger['error'](_0x4903('0x24'),_0x165878['message'],_0x5f7e1a);_0x2011ed(_0xc4fa7f[_0x4903('0x12')](0x1f4,_0x165878['message']));});});}; \ No newline at end of file +var _0x91f0=['map','include','model','info','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x91f0,0x1b6));var _0x091f=function(_0x41538b,_0x2b79a3){_0x41538b=_0x41538b-0x0;var _0x5b43b1=_0x91f0[_0x41538b];return _0x5b43b1;};'use strict';var _=require(_0x091f('0x0'));var util=require(_0x091f('0x1'));var moment=require(_0x091f('0x2'));var BPromise=require(_0x091f('0x3'));var rs=require(_0x091f('0x4'));var fs=require('fs');var Redis=require(_0x091f('0x5'));var db=require(_0x091f('0x6'))['db'];var utils=require(_0x091f('0x7'));var logger=require(_0x091f('0x8'))(_0x091f('0x9'));var config=require(_0x091f('0xa'));var jayson=require(_0x091f('0xb'));var client=jayson[_0x091f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bc0e5,_0x405b0e,_0x29d4d1){return new BPromise(function(_0x1fe632,_0x1e988c){return client[_0x091f('0xd')](_0x2bc0e5,_0x29d4d1)[_0x091f('0xe')](function(_0x58a41d){logger['info'](_0x091f('0xf'),_0x405b0e,_0x091f('0x10'));logger[_0x091f('0x11')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x405b0e,'request\x20sent',JSON[_0x091f('0x12')](_0x58a41d));if(_0x58a41d[_0x091f('0x13')]){if(_0x58a41d['error']['code']===0x1f4){logger[_0x091f('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x405b0e,_0x58a41d[_0x091f('0x13')][_0x091f('0x14')]);return _0x1e988c(_0x58a41d['error'][_0x091f('0x14')]);}logger[_0x091f('0x13')](_0x091f('0xf'),_0x405b0e,_0x58a41d[_0x091f('0x13')][_0x091f('0x14')]);return _0x1fe632(_0x58a41d['error'][_0x091f('0x14')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x405b0e,'request\x20sent');_0x1fe632(_0x58a41d[_0x091f('0x15')][_0x091f('0x14')]);}})[_0x091f('0x16')](function(_0x3e1325){logger[_0x091f('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x405b0e,_0x3e1325);_0x1e988c(_0x3e1325);});});}exports[_0x091f('0x17')]=function(_0x35b712){var _0x5c6e84=this;return new Promise(function(_0x59a1ed,_0x1f7137){return db[_0x091f('0x18')][_0x091f('0x19')]({'raw':_0x35b712[_0x091f('0x1a')]?_0x35b712['options']['raw']===undefined?!![]:![]:!![],'where':_0x35b712[_0x091f('0x1a')]?_0x35b712[_0x091f('0x1a')][_0x091f('0x1b')]||null:null,'attributes':_0x35b712[_0x091f('0x1a')]?_0x35b712['options'][_0x091f('0x1c')]||null:null,'limit':_0x35b712[_0x091f('0x1a')]?_0x35b712[_0x091f('0x1a')][_0x091f('0x1d')]||null:null,'include':_0x35b712[_0x091f('0x1a')]?_0x35b712['options']['include']?_[_0x091f('0x1e')](_0x35b712[_0x091f('0x1a')]['include'],function(_0x52e0f2){return{'model':db[_0x52e0f2['model']],'as':_0x52e0f2['as'],'attributes':_0x52e0f2[_0x091f('0x1c')],'include':_0x52e0f2[_0x091f('0x1f')]?_[_0x091f('0x1e')](_0x52e0f2['include'],function(_0x3b3d82){return{'model':db[_0x3b3d82[_0x091f('0x20')]],'as':_0x3b3d82['as'],'attributes':_0x3b3d82[_0x091f('0x1c')],'include':_0x3b3d82[_0x091f('0x1f')]?_[_0x091f('0x1e')](_0x3b3d82[_0x091f('0x1f')],function(_0x329f9c){return{'model':db[_0x329f9c[_0x091f('0x20')]],'as':_0x329f9c['as'],'attributes':_0x329f9c['attributes']};}):[]};}):[]};}):[]:[]})[_0x091f('0xe')](function(_0x134891){logger[_0x091f('0x21')](_0x091f('0x17'),_0x35b712);logger['debug']('GetCmHopperBlack',_0x35b712,JSON['stringify'](_0x134891));_0x59a1ed(_0x134891);})[_0x091f('0x16')](function(_0x33b281){logger[_0x091f('0x13')](_0x091f('0x17'),_0x33b281[_0x091f('0x14')],_0x35b712);_0x1f7137(_0x5c6e84[_0x091f('0x13')](0x1f4,_0x33b281[_0x091f('0x14')]));});});};exports[_0x091f('0x22')]=function(_0x57ed02){var _0x13686d=this;return new Promise(function(_0xd47c97,_0x53436b){return db[_0x091f('0x18')][_0x091f('0x23')](_0x57ed02[_0x091f('0x24')],{'raw':_0x57ed02[_0x091f('0x1a')]?_0x57ed02[_0x091f('0x1a')][_0x091f('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57ed02['options']?_0x57ed02[_0x091f('0x1a')][_0x091f('0x1b')]||null:null,'attributes':_0x57ed02[_0x091f('0x1a')]?_0x57ed02[_0x091f('0x1a')][_0x091f('0x1c')]||null:null,'limit':_0x57ed02[_0x091f('0x1a')]?_0x57ed02[_0x091f('0x1a')][_0x091f('0x1d')]||null:null})[_0x091f('0xe')](function(_0x33c468){logger[_0x091f('0x21')]('UpdateCmHopperBlack',_0x57ed02);logger['debug'](_0x091f('0x22'),_0x57ed02,JSON[_0x091f('0x12')](_0x33c468));_0xd47c97(_0x33c468);})[_0x091f('0x16')](function(_0x6dbdc2){logger[_0x091f('0x13')](_0x091f('0x22'),_0x6dbdc2[_0x091f('0x14')],_0x57ed02);_0x53436b(_0x13686d[_0x091f('0x13')](0x1f4,_0x6dbdc2['message']));});});};exports['DestroyCmHopperBlack']=function(_0x1b0dcd){var _0x3f2002=this;return new Promise(function(_0x29cd36,_0x31a27f){return db[_0x091f('0x18')]['destroy']({'where':_0x1b0dcd[_0x091f('0x1a')]?_0x1b0dcd['options'][_0x091f('0x1b')]||null:null})[_0x091f('0xe')](function(_0x1746c2){logger[_0x091f('0x21')]('DestroyCmHopperBlack',_0x1b0dcd);logger[_0x091f('0x11')](_0x091f('0x26'),_0x1b0dcd,JSON[_0x091f('0x12')](_0x1746c2));_0x29cd36(_0x1746c2);})[_0x091f('0x16')](function(_0x392dc6){logger[_0x091f('0x13')]('DestroyCmHopperBlack',_0x392dc6[_0x091f('0x14')],_0x1b0dcd);_0x31a27f(_0x3f2002[_0x091f('0x13')](0x1f4,_0x392dc6[_0x091f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8e8db8a..b96b49b 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 _0x1967=['../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3db8fe,_0x4778f8){var _0x448957=function(_0x49c7e7){while(--_0x49c7e7){_0x3db8fe['push'](_0x3db8fe['shift']());}};_0x448957(++_0x4778f8);}(_0x1967,0x173));var _0x7196=function(_0x589090,_0xa36dfa){_0x589090=_0x589090-0x0;var _0x1ec520=_0x1967[_0x589090];return _0x1ec520;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')](_0x7196('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x7196('0x12')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x13')]);module[_0x7196('0x14')]=router; \ No newline at end of file +var _0x3831=['get','isAuthenticated','describe','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller'];(function(_0x294667,_0x34b308){var _0x2db709=function(_0x3ece1a){while(--_0x3ece1a){_0x294667['push'](_0x294667['shift']());}};_0x2db709(++_0x34b308);}(_0x3831,0x14c));var _0x1383=function(_0x289fd4,_0xd34ba6){_0x289fd4=_0x289fd4-0x0;var _0x3d4a88=_0x3831[_0x289fd4];return _0x3d4a88;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var fs_extra=require(_0x1383('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1383('0x6'));var config=require('../../config/environment');var controller=require(_0x1383('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1383('0x8')]('/describe',auth[_0x1383('0x9')](),controller[_0x1383('0xa')]);router[_0x1383('0x8')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xc')]);router[_0x1383('0xd')](_0x1383('0xb'),auth['isAuthenticated'](),controller[_0x1383('0xe')]);router[_0x1383('0xf')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7d45a5d..f3538ab 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 _0x0c54=['STRING','DATE','INTEGER','getDataValue','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','moment','exports'];(function(_0x19aca5,_0x4007c1){var _0x381199=function(_0x913bc7){while(--_0x913bc7){_0x19aca5['push'](_0x19aca5['shift']());}};_0x381199(++_0x4007c1);}(_0x0c54,0x1de));var _0x40c5=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x0c54[_0x556bb1];return _0x45455f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x40c5('0x0'));module[_0x40c5('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x40c5('0x2')]},'scheduledat':{'type':Sequelize[_0x40c5('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x40c5('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x40c5('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x40c5('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x40c5('0x3')]},'droptime':{'type':Sequelize[_0x40c5('0x3')]},'endtime':{'type':Sequelize[_0x40c5('0x3')]},'ringtime':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x40c5('0x2')]},'campaign':{'type':Sequelize[_0x40c5('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x40c5('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x40c5('0x2')]},'secondDisposition':{'type':Sequelize[_0x40c5('0x2')]},'thirdDisposition':{'type':Sequelize[_0x40c5('0x2')]},'dispositionat':{'type':Sequelize[_0x40c5('0x3')],'set':function(_0x2dfc39){var _0x30cb1c=this[_0x40c5('0x5')]('endtime');if(_0x30cb1c&&_0x2dfc39){this[_0x40c5('0x6')](_0x40c5('0x7'),moment(_0x2dfc39)[_0x40c5('0x8')](moment(_0x30cb1c),_0x40c5('0x9')));}return this[_0x40c5('0x6')](_0x40c5('0xa'),_0x2dfc39);}},'amd':{'type':Sequelize[_0x40c5('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x40c5('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x40c5('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x40c5('0x3')]},'callback':{'type':Sequelize[_0x40c5('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x40c5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x40c5('0x3')]},'deleted':{'type':Sequelize[_0x40c5('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x40c5('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x40c5('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x40c5('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x77be=['seconds','dispositionat','BOOLEAN','exports','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff'];(function(_0x46b848,_0x1443e9){var _0x407e7e=function(_0x35cc9f){while(--_0x35cc9f){_0x46b848['push'](_0x46b848['shift']());}};_0x407e7e(++_0x1443e9);}(_0x77be,0x18f));var _0xe77b=function(_0x4f9bc2,_0x47a2b5){_0x4f9bc2=_0x4f9bc2-0x0;var _0xc33c6d=_0x77be[_0x4f9bc2];return _0xc33c6d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xe77b('0x0')]={'state':{'type':Sequelize[_0xe77b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe77b('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xe77b('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe77b('0x2')]},'calleridname':{'type':Sequelize[_0xe77b('0x2')]},'starttime':{'type':Sequelize[_0xe77b('0x3')]},'responsetime':{'type':Sequelize[_0xe77b('0x3')]},'answertime':{'type':Sequelize[_0xe77b('0x3')]},'droptime':{'type':Sequelize[_0xe77b('0x3')]},'endtime':{'type':Sequelize[_0xe77b('0x3')]},'ringtime':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe77b('0x2')]},'campaign':{'type':Sequelize[_0xe77b('0x2')]},'campaigntype':{'type':Sequelize[_0xe77b('0x2')]},'membername':{'type':Sequelize[_0xe77b('0x2')]},'reason':{'type':Sequelize[_0xe77b('0x2')]},'disposition':{'type':Sequelize[_0xe77b('0x2')]},'secondDisposition':{'type':Sequelize[_0xe77b('0x2')]},'thirdDisposition':{'type':Sequelize[_0xe77b('0x2')]},'dispositionat':{'type':Sequelize[_0xe77b('0x3')],'set':function(_0xbc5270){var _0x2e146f=this['getDataValue'](_0xe77b('0x4'));if(_0x2e146f&&_0xbc5270){this[_0xe77b('0x5')](_0xe77b('0x6'),moment(_0xbc5270)[_0xe77b('0x7')](moment(_0x2e146f),_0xe77b('0x8')));}return this[_0xe77b('0x5')](_0xe77b('0x9'),_0xbc5270);}},'amd':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe77b('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xe77b('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe77b('0x3')]},'recallme':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe77b('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index bfab09f..1d9d5d2 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 _0x524e=['destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperFinal','then','includeAll','include','findAll','rows','catch','show','length','find','describe','body','uniqueid','params','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','group','Campaign','ContactId','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','CmHopper','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x524e,0x15e));var _0xe524=function(_0x2af73f,_0x2be5e4){_0x2af73f=_0x2af73f-0x0;var _0x3c4be8=_0x524e[_0x2af73f];return _0x3c4be8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['CmHopperFinal'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':!![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['describe']()[_0xe524('0x3f')](respondWithResult(_0x33b1c8,null))['catch'](handleError(_0x33b1c8,null));};exports['update']=function(_0x24f313,_0x59fe6b){if(_0x24f313[_0xe524('0x49')][_0xe524('0x4a')]){delete _0x24f313['body'][_0xe524('0x4a')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x24f313[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x59fe6b,null))[_0xe524('0x3f')](saveUpdates(_0x24f313['body'],null))['then'](respondWithResult(_0x59fe6b,null))['catch'](handleError(_0x59fe6b,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4f7a64,_0x5477ca,_0x45f504){return db[_0xe524('0x3e')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x4f7a64[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x4e')))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x51')))),_0xe524('0x52')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),_0xe524('0x54')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x59')))),'reCallContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xe524('0x3f')](handleEntityNotFound(_0x5477ca,null))['then'](respondWithResult(_0x5477ca,null))[_0xe524('0x44')](handleError(_0x5477ca,null));};exports[_0xe524('0x5a')]=function(_0x3f4201,_0x287ab8,_0x2b2a0e){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x3f4201[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x51')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),'busyContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x5b')))),_0xe524('0x5c')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x59')))),_0xe524('0x5d')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x5e')))),_0xe524('0x5f')]]})[_0xe524('0x3f')](handleEntityNotFound(_0x287ab8,null))['then'](respondWithResult(_0x287ab8,null))[_0xe524('0x44')](handleError(_0x287ab8,null));};exports[_0xe524('0x60')]=function(_0x43d125,_0x13905f,_0x4514d4){return db['VoiceQueue'][_0xe524('0x47')]({'where':{'id':_0x43d125[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x13905f,null))[_0xe524('0x3f')](function(_0x109da1){var _0x57b6bb;if(_0x109da1){_0x57b6bb=squel[_0xe524('0x61')]()[_0xe524('0x62')](_0xe524('0x63'))[_0xe524('0x64')]([_0xe524('0x65'),_0xe524('0x66'),'ContactId',_0xe524('0x67'),_0xe524('0x68'),_0xe524('0x69'),'updatedAt'],squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('ANY_VALUE(calleridnum)',_0xe524('0x65'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))[_0xe524('0x6b')](_0xe524('0x6d'),'ContactId')[_0xe524('0x6b')](_0xe524('0x6e'),_0xe524('0x67'))[_0xe524('0x6b')](_0xe524('0x6f'),_0xe524('0x68'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x69'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x70'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x20?',_0x43d125[_0xe524('0x49')][_0xe524('0x74')]['toString']())['where'](_0xe524('0x75'))['where'](_0xe524('0x76'),squel['select']()[_0xe524('0x6b')](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))['where']('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where'](_0xe524('0x76'),squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('calleridnum')[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')](_0xe524('0x77'),_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())['where']('state\x20=\x204'))[_0xe524('0x78')]('ContactId'))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0x57b6bb);}return[];})['then'](respondWithResult(_0x13905f,null))[_0xe524('0x44')](handleError(_0x13905f,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1681c5,_0x41e693,_0xfc62e5){return db[_0xe524('0x79')][_0xe524('0x47')]({'where':{'id':_0x1681c5[_0xe524('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41e693,null))[_0xe524('0x3f')](function(_0x35d0f4){var _0xa8334;if(_0x35d0f4){_0xa8334=squel['insert']()[_0xe524('0x62')](_0xe524('0x63'))['fromQuery']([_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x7a'),_0xe524('0x67'),'CampaignId',_0xe524('0x69'),_0xe524('0x70')],squel[_0xe524('0x6a')]()['field'](_0xe524('0x7b'),'phone')[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))['field'](_0xe524('0x6d'),_0xe524('0x7a'))[_0xe524('0x6b')]('ANY_VALUE(ListId)','ListId')[_0xe524('0x6b')]('ANY_VALUE(CampaignId)',_0xe524('0x7c'))['field'](_0xe524('0x6c'),_0xe524('0x69'))['field'](_0xe524('0x6c'),_0xe524('0x70'))['from']('cm_hopper_final')[_0xe524('0x38')](_0xe524('0x7d'),_0x1681c5[_0xe524('0x4b')]['id']['toString']())[_0xe524('0x38')](_0xe524('0x7e'),_0x1681c5[_0xe524('0x49')][_0xe524('0x74')][_0xe524('0x73')]())[_0xe524('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xe524('0x38')](_0xe524('0x76'),squel['select']()['field'](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe524('0x6a')]()[_0xe524('0x6b')](_0xe524('0x7f'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5['params']['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x204'))['group'](_0xe524('0x7a')))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0xa8334);}return[];})[_0xe524('0x3f')](respondWithResult(_0x41e693,null))[_0xe524('0x44')](handleError(_0x41e693,null));};exports['checkContactHopper']=function(_0x555801,_0x3e8668,_0x390093){return db[_0xe524('0x80')][_0xe524('0x81')]({'where':{'VoiceQueueId':_0x555801[_0xe524('0x49')][_0xe524('0x68')],'CampaignId':_0x555801[_0xe524('0x49')][_0xe524('0x7c')],'ContactId':_0x555801['body'][_0xe524('0x7a')]}})[_0xe524('0x3f')](handleEntityNotFound(_0x3e8668,null))[_0xe524('0x3f')](function(_0x5242b7){if(_0x5242b7){return _0x5242b7;}return null;})['then'](respondWithResult(_0x3e8668,null))[_0xe524('0x44')](handleError(_0x3e8668,null));}; \ No newline at end of file +var _0x0295=['ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3c40f7,_0x1644bb){var _0x27238a=function(_0x4205c6){while(--_0x4205c6){_0x3c40f7['push'](_0x3c40f7['shift']());}};_0x27238a(++_0x1644bb);}(_0x0295,0x1f0));var _0x5029=function(_0x432044,_0x35d99b){_0x432044=_0x432044-0x0;var _0x108d8d=_0x0295[_0x432044];return _0x108d8d;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['CmHopperFinal'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['CmHopperFinal'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index d1bda3b..a08fe8c 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 _0xeb1a=['cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','moment','bluebird','path','../../config/environment','./cmHopperFinal.attributes'];(function(_0x57a8cd,_0x3800ad){var _0xcdbc5e=function(_0x351ec4){while(--_0x351ec4){_0x57a8cd['push'](_0x57a8cd['shift']());}};_0xcdbc5e(++_0x3800ad);}(_0xeb1a,0x107));var _0xaeb1=function(_0x24b852,_0x2bad67){_0x24b852=_0x24b852-0x0;var _0x180ad2=_0xeb1a[_0x24b852];return _0x180ad2;};'use strict';var _=require('lodash');var util=require(_0xaeb1('0x0'));var logger=require(_0xaeb1('0x1'))('api');var moment=require(_0xaeb1('0x2'));var BPromise=require(_0xaeb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaeb1('0x4'));var rimraf=require('rimraf');var config=require(_0xaeb1('0x5'));var attributes=require(_0xaeb1('0x6'));module['exports']=function(_0x25e879,_0x5e1d13){return _0x25e879['define']('CmHopperFinal',attributes,{'tableName':_0xaeb1('0x7'),'paranoid':![],'indexes':[{'name':_0xaeb1('0x8'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xaeb1('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f24=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','api','moment','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x3f64d5,_0x200567){var _0x476cbf=function(_0x5b49fe){while(--_0x5b49fe){_0x3f64d5['push'](_0x3f64d5['shift']());}};_0x476cbf(++_0x200567);}(_0x4f24,0x165));var _0x44f2=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x4f24[_0x4bb145];return _0x4db596;};'use strict';var _=require(_0x44f2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x44f2('0x1'));var moment=require(_0x44f2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44f2('0x3'));var rimraf=require(_0x44f2('0x4'));var config=require(_0x44f2('0x5'));var attributes=require(_0x44f2('0x6'));module[_0x44f2('0x7')]=function(_0x53e010,_0x4e49b9){return _0x53e010[_0x44f2('0x8')](_0x44f2('0x9'),attributes,{'tableName':_0x44f2('0xa'),'paranoid':![],'indexes':[{'name':_0x44f2('0xb'),'fields':[_0x44f2('0xb')]},{'name':_0x44f2('0xc'),'fields':[_0x44f2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 428d69c..b8d1879 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4f1815,_0x2dcedf){var _0x40751f=function(_0x53385a){while(--_0x53385a){_0x4f1815['push'](_0x4f1815['shift']());}};_0x40751f(++_0x2dcedf);}(_0xb10b,0x12a));var _0xbb10=function(_0x32ad52,_0x3867b7){_0x32ad52=_0x32ad52-0x0;var _0xd4d3d3=_0xb10b[_0x32ad52];return _0xd4d3d3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x501477,_0x3250dd){var _0x100d62=function(_0x1c3269){while(--_0x1c3269){_0x501477['push'](_0x501477['shift']());}};_0x100d62(++_0x3250dd);}(_0x7a54,0x106));var _0x47a5=function(_0x20fc31,_0x3f25e4){_0x20fc31=_0x20fc31-0x0;var _0x3b0d81=_0x7a54[_0x20fc31];return _0x3b0d81;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index a62fe50..14b82f6 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 _0x1d66=['post','/voice/campaign/moveContacts/:id','/checkContactHopper','put','update','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','index','isAuthenticated','describe','show','/campaign/countAttributes/:id'];(function(_0x53fdcb,_0x4e5dea){var _0x50d9c5=function(_0x11a152){while(--_0x11a152){_0x53fdcb['push'](_0x53fdcb['shift']());}};_0x50d9c5(++_0x4e5dea);}(_0x1d66,0xfc));var _0x61d6=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1d66[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x61d6('0x0'));var util=require(_0x61d6('0x1'));var path=require('path');var timeout=require(_0x61d6('0x2'));var express=require(_0x61d6('0x3'));var router=express['Router']();var fs_extra=require(_0x61d6('0x4'));var auth=require(_0x61d6('0x5'));var interaction=require(_0x61d6('0x6'));var config=require('../../config/environment');var controller=require(_0x61d6('0x7'));router[_0x61d6('0x8')]('/',auth['isAuthenticated'](),controller[_0x61d6('0x9')]);router[_0x61d6('0x8')]('/describe',auth[_0x61d6('0xa')](),controller[_0x61d6('0xb')]);router['get']('/:id',auth[_0x61d6('0xa')](),controller[_0x61d6('0xc')]);router[_0x61d6('0x8')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x61d6('0xd'),auth[_0x61d6('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x61d6('0xe')]('/voice/queue/moveContacts/:id',auth[_0x61d6('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x61d6('0xe')](_0x61d6('0xf'),auth[_0x61d6('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x61d6('0x10'),auth[_0x61d6('0xa')](),controller['checkContactHopper']);router[_0x61d6('0x11')]('/:id',auth[_0x61d6('0xa')](),controller[_0x61d6('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9149=['moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id'];(function(_0x5099c0,_0x1fd583){var _0x3ccdfe=function(_0x325294){while(--_0x325294){_0x5099c0['push'](_0x5099c0['shift']());}};_0x3ccdfe(++_0x1fd583);}(_0x9149,0x1d7));var _0x9914=function(_0x382bef,_0x1fd4f5){_0x382bef=_0x382bef-0x0;var _0x55ade0=_0x9149[_0x382bef];return _0x55ade0;};'use strict';var multer=require(_0x9914('0x0'));var util=require(_0x9914('0x1'));var path=require(_0x9914('0x2'));var timeout=require(_0x9914('0x3'));var express=require(_0x9914('0x4'));var router=express[_0x9914('0x5')]();var fs_extra=require(_0x9914('0x6'));var auth=require(_0x9914('0x7'));var interaction=require(_0x9914('0x8'));var config=require(_0x9914('0x9'));var controller=require(_0x9914('0xa'));router[_0x9914('0xb')]('/',auth[_0x9914('0xc')](),controller[_0x9914('0xd')]);router[_0x9914('0xb')](_0x9914('0xe'),auth[_0x9914('0xc')](),controller['describe']);router[_0x9914('0xb')]('/:id',auth[_0x9914('0xc')](),controller[_0x9914('0xf')]);router['get'](_0x9914('0x10'),auth[_0x9914('0xc')](),controller[_0x9914('0x11')]);router[_0x9914('0xb')](_0x9914('0x12'),auth[_0x9914('0xc')](),controller[_0x9914('0x13')]);router[_0x9914('0x14')](_0x9914('0x15'),auth[_0x9914('0xc')](),controller[_0x9914('0x16')]);router[_0x9914('0x14')](_0x9914('0x17'),auth['isAuthenticated'](),controller[_0x9914('0x18')]);router[_0x9914('0x14')](_0x9914('0x19'),auth[_0x9914('0xc')](),controller[_0x9914('0x1a')]);router[_0x9914('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x9914('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index c2f70fb..aeec1c5 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 _0xfe25=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x51b459,_0x263444){var _0x2419f4=function(_0x1ed2a4){while(--_0x1ed2a4){_0x51b459['push'](_0x51b459['shift']());}};_0x2419f4(++_0x263444);}(_0xfe25,0x1c8));var _0x5fe2=function(_0x431a29,_0x377c0b){_0x431a29=_0x431a29-0x0;var _0x16b1a8=_0xfe25[_0x431a29];return _0x16b1a8;};'use strict';var Sequelize=require(_0x5fe2('0x0'));module[_0x5fe2('0x1')]={'state':{'type':Sequelize[_0x5fe2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5fe2('0x3')]},'scheduledat':{'type':Sequelize[_0x5fe2('0x4')]},'countbusyretry':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5fe2('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x5fe2('0x3')]},'calleridnum':{'type':Sequelize[_0x5fe2('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x5fe2('0x4')]},'answertime':{'type':Sequelize[_0x5fe2('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5fe2('0x4')]},'ringtime':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5fe2('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x5fe2('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x5fe2('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x5fe2('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x5fe2('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5fe2('0x4')]},'recallme':{'type':Sequelize[_0x5fe2('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5fe2('0x4')]},'edited':{'type':Sequelize[_0x5fe2('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5fe2('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6ed8=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3d5437,_0x339d5d){var _0x260503=function(_0x75b633){while(--_0x75b633){_0x3d5437['push'](_0x3d5437['shift']());}};_0x260503(++_0x339d5d);}(_0x6ed8,0x6d));var _0x86ed=function(_0x2799b2,_0x3d0279){_0x2799b2=_0x2799b2-0x0;var _0x4af7f9=_0x6ed8[_0x2799b2];return _0x4af7f9;};'use strict';var Sequelize=require(_0x86ed('0x0'));module[_0x86ed('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x86ed('0x2')]},'scheduledat':{'type':Sequelize[_0x86ed('0x3')]},'countbusyretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x86ed('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x86ed('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x86ed('0x3')]},'responsetime':{'type':Sequelize[_0x86ed('0x3')]},'answertime':{'type':Sequelize[_0x86ed('0x3')]},'droptime':{'type':Sequelize[_0x86ed('0x3')]},'endtime':{'type':Sequelize[_0x86ed('0x3')]},'ringtime':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x86ed('0x2')]},'campaign':{'type':Sequelize[_0x86ed('0x2')]},'campaigntype':{'type':Sequelize[_0x86ed('0x2')]},'membername':{'type':Sequelize[_0x86ed('0x2')]},'reason':{'type':Sequelize[_0x86ed('0x2')]},'amd':{'type':Sequelize[_0x86ed('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x86ed('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x86ed('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x86ed('0x3')]},'recallme':{'type':Sequelize[_0x86ed('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x86ed('0x3')]},'edited':{'type':Sequelize[_0x86ed('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 e17ae57..2df54cc 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 _0xff4a=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','sendStatus','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','then','includeAll','findAll','rows','catch','show','keys','include','options','find','create','describe','body','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1956ca,_0x51f2e4){var _0x544859=function(_0x4722ce){while(--_0x4722ce){_0x1956ca['push'](_0x1956ca['shift']());}};_0x544859(++_0x51f2e4);}(_0xff4a,0x121));var _0xaff4=function(_0x5367bb,_0x2310ec){_0x5367bb=_0x5367bb-0x0;var _0x1b33e1=_0xff4a[_0x5367bb];return _0x1b33e1;};'use strict';var emlformat=require(_0xaff4('0x0'));var rimraf=require(_0xaff4('0x1'));var zipdir=require(_0xaff4('0x2'));var jsonpatch=require(_0xaff4('0x3'));var rp=require(_0xaff4('0x4'));var moment=require(_0xaff4('0x5'));var BPromise=require(_0xaff4('0x6'));var Mustache=require(_0xaff4('0x7'));var util=require('util');var path=require(_0xaff4('0x8'));var sox=require(_0xaff4('0x9'));var csv=require(_0xaff4('0xa'));var ejs=require(_0xaff4('0xb'));var fs=require('fs');var fs_extra=require(_0xaff4('0xc'));var _=require(_0xaff4('0xd'));var squel=require(_0xaff4('0xe'));var crypto=require('crypto');var jsforce=require(_0xaff4('0xf'));var deskjs=require(_0xaff4('0x10'));var toCsv=require(_0xaff4('0xa'));var querystring=require(_0xaff4('0x11'));var Papa=require('papaparse');var Redis=require(_0xaff4('0x12'));var authService=require(_0xaff4('0x13'));var qs=require(_0xaff4('0x14'));var as=require(_0xaff4('0x15'));var hardwareService=require(_0xaff4('0x16'));var logger=require(_0xaff4('0x17'))(_0xaff4('0x18'));var utils=require(_0xaff4('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xaff4('0x1a'));var db=require(_0xaff4('0x1b'))['db'];function respondWithStatusCode(_0x5c7869,_0x4fb8a5){_0x4fb8a5=_0x4fb8a5||0xcc;return function(_0x4460e2){if(_0x4460e2){return _0x5c7869['sendStatus'](_0x4fb8a5);}return _0x5c7869[_0xaff4('0x1c')](_0x4fb8a5)[_0xaff4('0x1d')]();};}function respondWithResult(_0x2ac304,_0x33f238){_0x33f238=_0x33f238||0xc8;return function(_0x280748){if(_0x280748){return _0x2ac304[_0xaff4('0x1c')](_0x33f238)[_0xaff4('0x1e')](_0x280748);}};}function respondWithFilteredResult(_0x593c13,_0x63c6ad){return function(_0x292514){if(_0x292514){var _0x2f7110=typeof _0x63c6ad[_0xaff4('0x1f')]===_0xaff4('0x20')&&typeof _0x63c6ad[_0xaff4('0x21')]===_0xaff4('0x20');var _0x1f253d=_0x292514[_0xaff4('0x22')];var _0x1cf977=_0x2f7110?0x0:_0x63c6ad[_0xaff4('0x1f')];var _0x5031a6=_0x2f7110?_0x292514[_0xaff4('0x22')]:_0x63c6ad[_0xaff4('0x1f')]+_0x63c6ad[_0xaff4('0x21')];var _0x37d2d4;if(_0x5031a6>=_0x1f253d){_0x5031a6=_0x1f253d;_0x37d2d4=0xc8;}else{_0x37d2d4=0xce;}_0x593c13[_0xaff4('0x1c')](_0x37d2d4);return _0x593c13[_0xaff4('0x23')](_0xaff4('0x24'),_0x1cf977+'-'+_0x5031a6+'/'+_0x1f253d)[_0xaff4('0x1e')](_0x292514);}return null;};}function patchUpdates(_0x1fab5d){return function(_0x527885){try{jsonpatch[_0xaff4('0x25')](_0x527885,_0x1fab5d,!![]);}catch(_0x52831c){return BPromise['reject'](_0x52831c);}return _0x527885['save']();};}function saveUpdates(_0x26c860,_0x444f5e){return function(_0x177674){if(_0x177674){return _0x177674[_0xaff4('0x26')](_0x26c860)['then'](function(_0x1f598e){return _0x1f598e;});}return null;};}function removeEntity(_0x2691f5,_0x4694a7){return function(_0x556b66){if(_0x556b66){return _0x556b66[_0xaff4('0x27')]()['then'](function(){_0x2691f5[_0xaff4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b387c,_0x2dd025){return function(_0x482c0f){if(!_0x482c0f){_0x4b387c[_0xaff4('0x28')](0x194);}return _0x482c0f;};}function handleError(_0x17319a,_0x27fd0b){_0x27fd0b=_0x27fd0b||0x1f4;return function(_0x4e4be1){logger['error'](_0x4e4be1['stack']);if(_0x4e4be1['name']){delete _0x4e4be1[_0xaff4('0x29')];}_0x17319a[_0xaff4('0x1c')](_0x27fd0b)[_0xaff4('0x2a')](_0x4e4be1);};}exports['index']=function(_0x513a06,_0x2d1587){var _0x4827cc={},_0x159af5={},_0x243c5b={'count':0x0,'rows':[]};var _0x349f2b=_[_0xaff4('0x2b')](db[_0xaff4('0x2c')][_0xaff4('0x2d')],function(_0x5901f3){return{'name':_0x5901f3[_0xaff4('0x2e')],'type':_0x5901f3[_0xaff4('0x2f')][_0xaff4('0x30')]};});_0x159af5[_0xaff4('0x31')]=_[_0xaff4('0x2b')](_0x349f2b,_0xaff4('0x29'));_0x159af5[_0xaff4('0x32')]=_['keys'](_0x513a06[_0xaff4('0x32')]);_0x159af5[_0xaff4('0x33')]=_[_0xaff4('0x34')](_0x159af5[_0xaff4('0x31')],_0x159af5['query']);_0x4827cc[_0xaff4('0x35')]=_[_0xaff4('0x34')](_0x159af5['model'],qs[_0xaff4('0x36')](_0x513a06['query'][_0xaff4('0x36')]));_0x4827cc[_0xaff4('0x35')]=_0x4827cc['attributes'][_0xaff4('0x37')]?_0x4827cc[_0xaff4('0x35')]:_0x159af5[_0xaff4('0x31')];if(!_0x513a06[_0xaff4('0x32')][_0xaff4('0x38')](_0xaff4('0x39'))){_0x4827cc['limit']=qs[_0xaff4('0x21')](_0x513a06[_0xaff4('0x32')][_0xaff4('0x21')]);_0x4827cc['offset']=qs['offset'](_0x513a06[_0xaff4('0x32')][_0xaff4('0x1f')]);}_0x4827cc[_0xaff4('0x3a')]=qs[_0xaff4('0x3b')](_0x513a06[_0xaff4('0x32')][_0xaff4('0x3b')]);_0x4827cc['where']=qs['filters'](_['pick'](_0x513a06[_0xaff4('0x32')],_0x159af5['filters']),_0x349f2b);if(_0x513a06[_0xaff4('0x32')][_0xaff4('0x3c')]){_0x4827cc[_0xaff4('0x3d')]=_[_0xaff4('0x3e')](_0x4827cc[_0xaff4('0x3d')],{'$or':_[_0xaff4('0x2b')](_0x349f2b,function(_0xd8dd58){if(_0xd8dd58['type']!==_0xaff4('0x3f')){var _0x558bb4={};_0x558bb4[_0xd8dd58['name']]={'$like':'%'+_0x513a06[_0xaff4('0x32')][_0xaff4('0x3c')]+'%'};return _0x558bb4;}})});}_0x4827cc=_[_0xaff4('0x3e')]({},_0x4827cc,_0x513a06['options']);var _0x109f11={'where':_0x4827cc[_0xaff4('0x3d')]};return db['CmHopperHistory']['count'](_0x109f11)[_0xaff4('0x40')](function(_0x44cf22){_0x243c5b[_0xaff4('0x22')]=_0x44cf22;if(_0x513a06[_0xaff4('0x32')][_0xaff4('0x41')]){_0x4827cc['include']=[{'all':!![]}];}return db[_0xaff4('0x2c')][_0xaff4('0x42')](_0x4827cc);})[_0xaff4('0x40')](function(_0x2cebbb){_0x243c5b[_0xaff4('0x43')]=_0x2cebbb;return _0x243c5b;})[_0xaff4('0x40')](respondWithFilteredResult(_0x2d1587,_0x4827cc))[_0xaff4('0x44')](handleError(_0x2d1587,null));};exports[_0xaff4('0x45')]=function(_0x363c88,_0x1219d2){var _0x1a621a={'raw':!![],'where':{'id':_0x363c88['params']['id']}},_0x537d68={};_0x537d68[_0xaff4('0x31')]=_[_0xaff4('0x46')](db['CmHopperHistory'][_0xaff4('0x2d')]);_0x537d68[_0xaff4('0x32')]=_['keys'](_0x363c88[_0xaff4('0x32')]);_0x537d68[_0xaff4('0x33')]=_['intersection'](_0x537d68[_0xaff4('0x31')],_0x537d68[_0xaff4('0x32')]);_0x1a621a[_0xaff4('0x35')]=_[_0xaff4('0x34')](_0x537d68[_0xaff4('0x31')],qs[_0xaff4('0x36')](_0x363c88['query'][_0xaff4('0x36')]));_0x1a621a[_0xaff4('0x35')]=_0x1a621a[_0xaff4('0x35')][_0xaff4('0x37')]?_0x1a621a[_0xaff4('0x35')]:_0x537d68['model'];if(_0x363c88['query'][_0xaff4('0x41')]){_0x1a621a[_0xaff4('0x47')]=[{'all':!![]}];}_0x1a621a=_['merge']({},_0x1a621a,_0x363c88[_0xaff4('0x48')]);return db[_0xaff4('0x2c')][_0xaff4('0x49')](_0x1a621a)[_0xaff4('0x40')](handleEntityNotFound(_0x1219d2,null))[_0xaff4('0x40')](respondWithResult(_0x1219d2,null))[_0xaff4('0x44')](handleError(_0x1219d2,null));};exports[_0xaff4('0x4a')]=function(_0x139e26,_0x56263b){return db[_0xaff4('0x2c')]['create'](_0x139e26['body'],{})[_0xaff4('0x40')](respondWithResult(_0x56263b,0xc9))[_0xaff4('0x44')](handleError(_0x56263b,null));};exports[_0xaff4('0x4b')]=function(_0x590b6e,_0x2f70b3){return db[_0xaff4('0x2c')][_0xaff4('0x4b')]()[_0xaff4('0x40')](respondWithResult(_0x2f70b3,null))[_0xaff4('0x44')](handleError(_0x2f70b3,null));};exports[_0xaff4('0x26')]=function(_0x934147,_0x161a8e){if(_0x934147[_0xaff4('0x4c')][_0xaff4('0x4d')]){delete _0x934147['body'][_0xaff4('0x4d')];}return db[_0xaff4('0x2c')][_0xaff4('0x49')]({'where':{'uniqueid':_0x934147['params']['id']}})['then'](handleEntityNotFound(_0x161a8e,null))[_0xaff4('0x40')](saveUpdates(_0x934147[_0xaff4('0x4c')],null))['then'](respondWithResult(_0x161a8e,null))['catch'](handleError(_0x161a8e,null));}; \ No newline at end of file +var _0x1328=['moment','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','end','status','offset','undefined','count','set','json','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','options','includeAll','include','CmHopperHistory','params','keys','merge','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise'];(function(_0x20a590,_0x1e8a6d){var _0x2e1b41=function(_0x48359f){while(--_0x48359f){_0x20a590['push'](_0x20a590['shift']());}};_0x2e1b41(++_0x1e8a6d);}(_0x1328,0x169));var _0x8132=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x1328[_0x412e27];return _0x53da42;};'use strict';var emlformat=require(_0x8132('0x0'));var rimraf=require(_0x8132('0x1'));var zipdir=require(_0x8132('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8132('0x3'));var moment=require(_0x8132('0x4'));var BPromise=require(_0x8132('0x5'));var Mustache=require('mustache');var util=require(_0x8132('0x6'));var path=require(_0x8132('0x7'));var sox=require(_0x8132('0x8'));var csv=require(_0x8132('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8132('0xa'));var crypto=require('crypto');var jsforce=require(_0x8132('0xb'));var deskjs=require(_0x8132('0xc'));var toCsv=require(_0x8132('0x9'));var querystring=require(_0x8132('0xd'));var Papa=require(_0x8132('0xe'));var Redis=require(_0x8132('0xf'));var authService=require(_0x8132('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8132('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8132('0x12'));var utils=require(_0x8132('0x13'));var config=require(_0x8132('0x14'));var licenseUtil=require(_0x8132('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e46f0,_0x4d9f35){_0x4d9f35=_0x4d9f35||0xcc;return function(_0x5b7eb7){if(_0x5b7eb7){return _0x2e46f0['sendStatus'](_0x4d9f35);}return _0x2e46f0['status'](_0x4d9f35)[_0x8132('0x16')]();};}function respondWithResult(_0x3aa6ce,_0x535e3c){_0x535e3c=_0x535e3c||0xc8;return function(_0x13729b){if(_0x13729b){return _0x3aa6ce[_0x8132('0x17')](_0x535e3c)['json'](_0x13729b);}};}function respondWithFilteredResult(_0xeeae2a,_0xccdf37){return function(_0xb5db){if(_0xb5db){var _0x4c5439=typeof _0xccdf37[_0x8132('0x18')]===_0x8132('0x19')&&typeof _0xccdf37['limit']===_0x8132('0x19');var _0x4adc0b=_0xb5db[_0x8132('0x1a')];var _0x37e4bb=_0x4c5439?0x0:_0xccdf37[_0x8132('0x18')];var _0x4651c1=_0x4c5439?_0xb5db[_0x8132('0x1a')]:_0xccdf37['offset']+_0xccdf37['limit'];var _0x5391be;if(_0x4651c1>=_0x4adc0b){_0x4651c1=_0x4adc0b;_0x5391be=0xc8;}else{_0x5391be=0xce;}_0xeeae2a[_0x8132('0x17')](_0x5391be);return _0xeeae2a[_0x8132('0x1b')]('Content-Range',_0x37e4bb+'-'+_0x4651c1+'/'+_0x4adc0b)[_0x8132('0x1c')](_0xb5db);}return null;};}function patchUpdates(_0x492d88){return function(_0x458fbc){try{jsonpatch[_0x8132('0x1d')](_0x458fbc,_0x492d88,!![]);}catch(_0x1d7150){return BPromise[_0x8132('0x1e')](_0x1d7150);}return _0x458fbc['save']();};}function saveUpdates(_0x5c7c2c,_0x408208){return function(_0x2e46cb){if(_0x2e46cb){return _0x2e46cb[_0x8132('0x1f')](_0x5c7c2c)['then'](function(_0x3b4137){return _0x3b4137;});}return null;};}function removeEntity(_0x1021f7,_0x46b22f){return function(_0x461edc){if(_0x461edc){return _0x461edc[_0x8132('0x20')]()[_0x8132('0x21')](function(){_0x1021f7[_0x8132('0x17')](0xcc)[_0x8132('0x16')]();});}};}function handleEntityNotFound(_0x3bfd9f,_0x2929db){return function(_0x434eff){if(!_0x434eff){_0x3bfd9f[_0x8132('0x22')](0x194);}return _0x434eff;};}function handleError(_0x532ebe,_0x301451){_0x301451=_0x301451||0x1f4;return function(_0x3a6d54){logger[_0x8132('0x23')](_0x3a6d54[_0x8132('0x24')]);if(_0x3a6d54['name']){delete _0x3a6d54[_0x8132('0x25')];}_0x532ebe[_0x8132('0x17')](_0x301451)[_0x8132('0x26')](_0x3a6d54);};}exports[_0x8132('0x27')]=function(_0x405e30,_0x1c087e){var _0x3dc1d4={},_0x19b9ad={},_0x1d4e7d={'count':0x0,'rows':[]};var _0x2c270a=_[_0x8132('0x28')](db['CmHopperHistory'][_0x8132('0x29')],function(_0x215993){return{'name':_0x215993[_0x8132('0x2a')],'type':_0x215993[_0x8132('0x2b')][_0x8132('0x2c')]};});_0x19b9ad[_0x8132('0x2d')]=_[_0x8132('0x28')](_0x2c270a,_0x8132('0x25'));_0x19b9ad[_0x8132('0x2e')]=_['keys'](_0x405e30[_0x8132('0x2e')]);_0x19b9ad[_0x8132('0x2f')]=_['intersection'](_0x19b9ad['model'],_0x19b9ad[_0x8132('0x2e')]);_0x3dc1d4[_0x8132('0x30')]=_[_0x8132('0x31')](_0x19b9ad[_0x8132('0x2d')],qs[_0x8132('0x32')](_0x405e30[_0x8132('0x2e')][_0x8132('0x32')]));_0x3dc1d4[_0x8132('0x30')]=_0x3dc1d4[_0x8132('0x30')][_0x8132('0x33')]?_0x3dc1d4['attributes']:_0x19b9ad[_0x8132('0x2d')];if(!_0x405e30[_0x8132('0x2e')][_0x8132('0x34')](_0x8132('0x35'))){_0x3dc1d4[_0x8132('0x36')]=qs[_0x8132('0x36')](_0x405e30[_0x8132('0x2e')][_0x8132('0x36')]);_0x3dc1d4[_0x8132('0x18')]=qs[_0x8132('0x18')](_0x405e30[_0x8132('0x2e')][_0x8132('0x18')]);}_0x3dc1d4[_0x8132('0x37')]=qs[_0x8132('0x38')](_0x405e30[_0x8132('0x2e')][_0x8132('0x38')]);_0x3dc1d4[_0x8132('0x39')]=qs[_0x8132('0x2f')](_[_0x8132('0x3a')](_0x405e30[_0x8132('0x2e')],_0x19b9ad[_0x8132('0x2f')]),_0x2c270a);if(_0x405e30[_0x8132('0x2e')][_0x8132('0x3b')]){_0x3dc1d4[_0x8132('0x39')]=_['merge'](_0x3dc1d4[_0x8132('0x39')],{'$or':_['map'](_0x2c270a,function(_0x589985){if(_0x589985[_0x8132('0x2b')]!=='VIRTUAL'){var _0x528c68={};_0x528c68[_0x589985[_0x8132('0x25')]]={'$like':'%'+_0x405e30[_0x8132('0x2e')][_0x8132('0x3b')]+'%'};return _0x528c68;}})});}_0x3dc1d4=_['merge']({},_0x3dc1d4,_0x405e30[_0x8132('0x3c')]);var _0x1c892f={'where':_0x3dc1d4['where']};return db['CmHopperHistory'][_0x8132('0x1a')](_0x1c892f)['then'](function(_0x3f2a18){_0x1d4e7d[_0x8132('0x1a')]=_0x3f2a18;if(_0x405e30[_0x8132('0x2e')][_0x8132('0x3d')]){_0x3dc1d4[_0x8132('0x3e')]=[{'all':!![]}];}return db[_0x8132('0x3f')]['findAll'](_0x3dc1d4);})['then'](function(_0x8b3487){_0x1d4e7d['rows']=_0x8b3487;return _0x1d4e7d;})[_0x8132('0x21')](respondWithFilteredResult(_0x1c087e,_0x3dc1d4))['catch'](handleError(_0x1c087e,null));};exports['show']=function(_0xd48a30,_0x2383b4){var _0x264581={'raw':!![],'where':{'id':_0xd48a30[_0x8132('0x40')]['id']}},_0x3884c5={};_0x3884c5['model']=_[_0x8132('0x41')](db[_0x8132('0x3f')][_0x8132('0x29')]);_0x3884c5[_0x8132('0x2e')]=_[_0x8132('0x41')](_0xd48a30['query']);_0x3884c5[_0x8132('0x2f')]=_[_0x8132('0x31')](_0x3884c5['model'],_0x3884c5[_0x8132('0x2e')]);_0x264581[_0x8132('0x30')]=_['intersection'](_0x3884c5[_0x8132('0x2d')],qs[_0x8132('0x32')](_0xd48a30[_0x8132('0x2e')]['fields']));_0x264581[_0x8132('0x30')]=_0x264581[_0x8132('0x30')][_0x8132('0x33')]?_0x264581[_0x8132('0x30')]:_0x3884c5[_0x8132('0x2d')];if(_0xd48a30[_0x8132('0x2e')][_0x8132('0x3d')]){_0x264581[_0x8132('0x3e')]=[{'all':!![]}];}_0x264581=_[_0x8132('0x42')]({},_0x264581,_0xd48a30['options']);return db['CmHopperHistory'][_0x8132('0x43')](_0x264581)[_0x8132('0x21')](handleEntityNotFound(_0x2383b4,null))[_0x8132('0x21')](respondWithResult(_0x2383b4,null))[_0x8132('0x44')](handleError(_0x2383b4,null));};exports[_0x8132('0x45')]=function(_0x12bd36,_0x5be250){return db['CmHopperHistory'][_0x8132('0x45')](_0x12bd36[_0x8132('0x46')],{})[_0x8132('0x21')](respondWithResult(_0x5be250,0xc9))[_0x8132('0x44')](handleError(_0x5be250,null));};exports[_0x8132('0x47')]=function(_0x3bb07c,_0xff56a8){return db[_0x8132('0x3f')][_0x8132('0x47')]()[_0x8132('0x21')](respondWithResult(_0xff56a8,null))[_0x8132('0x44')](handleError(_0xff56a8,null));};exports[_0x8132('0x1f')]=function(_0x1e4cd7,_0x421f90){if(_0x1e4cd7['body'][_0x8132('0x48')]){delete _0x1e4cd7[_0x8132('0x46')][_0x8132('0x48')];}return db[_0x8132('0x3f')][_0x8132('0x43')]({'where':{'uniqueid':_0x1e4cd7[_0x8132('0x40')]['id']}})[_0x8132('0x21')](handleEntityNotFound(_0x421f90,null))['then'](saveUpdates(_0x1e4cd7[_0x8132('0x46')],null))[_0x8132('0x21')](respondWithResult(_0x421f90,null))[_0x8132('0x44')](handleError(_0x421f90,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index a0d28e8..d567db3 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 _0xf5b6=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','endtime','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4aeeb9,_0x1d8388){var _0x49e56d=function(_0x507778){while(--_0x507778){_0x4aeeb9['push'](_0x4aeeb9['shift']());}};_0x49e56d(++_0x1d8388);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x43b664,_0x43426a){_0x43b664=_0x43b664-0x0;var _0x3564ea=_0xf5b6[_0x43b664];return _0x3564ea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f5b('0x0'))(_0x6f5b('0x1'));var moment=require(_0x6f5b('0x2'));var BPromise=require(_0x6f5b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f5b('0x4'));var rimraf=require(_0x6f5b('0x5'));var config=require(_0x6f5b('0x6'));var attributes=require(_0x6f5b('0x7'));module['exports']=function(_0x518ebf,_0x4baf5c){return _0x518ebf[_0x6f5b('0x8')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x6f5b('0x9'),'fields':['endtime']},{'name':_0x6f5b('0xa'),'fields':[_0x6f5b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed20=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed20,0xce));var _0x0ed2=function(_0x1f5bf7,_0x580aa7){_0x1f5bf7=_0x1f5bf7-0x0;var _0xe0f1c9=_0xed20[_0x1f5bf7];return _0xe0f1c9;};'use strict';var _=require(_0x0ed2('0x0'));var util=require(_0x0ed2('0x1'));var logger=require(_0x0ed2('0x2'))('api');var moment=require(_0x0ed2('0x3'));var BPromise=require(_0x0ed2('0x4'));var rp=require(_0x0ed2('0x5'));var fs=require('fs');var path=require(_0x0ed2('0x6'));var rimraf=require(_0x0ed2('0x7'));var config=require(_0x0ed2('0x8'));var attributes=require('./cmHopperHistory.attributes');module[_0x0ed2('0x9')]=function(_0x88640a,_0x5c686a){return _0x88640a[_0x0ed2('0xa')](_0x0ed2('0xb'),attributes,{'tableName':_0x0ed2('0xc'),'paranoid':![],'indexes':[{'name':_0x0ed2('0xd'),'fields':['endtime']},{'name':_0x0ed2('0xe'),'fields':[_0x0ed2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index df4af99..5f176c3 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 _0x1841=['outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','create','options','catch','AvgHandleTime','CmHopperHistory','findAll','raw','where','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','COUNT','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null'];(function(_0x32596a,_0x11eba9){var _0x3e0498=function(_0x4ee656){while(--_0x4ee656){_0x32596a['push'](_0x32596a['shift']());}};_0x3e0498(++_0x11eba9);}(_0x1841,0xdf));var _0x1184=function(_0x4fd604,_0x140a21){_0x4fd604=_0x4fd604-0x0;var _0x3a6290=_0x1841[_0x4fd604];return _0x3a6290;};'use strict';var _=require('lodash');var util=require(_0x1184('0x0'));var moment=require(_0x1184('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1184('0x2'));var db=require(_0x1184('0x3'))['db'];var utils=require(_0x1184('0x4'));var logger=require(_0x1184('0x5'))(_0x1184('0x6'));var config=require('../../config/environment');var jayson=require(_0x1184('0x7'));var client=jayson[_0x1184('0x8')][_0x1184('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a7046,_0x122829,_0x4292f6){return new BPromise(function(_0x2e8a79,_0x18bc1b){return client[_0x1184('0xa')](_0x1a7046,_0x4292f6)[_0x1184('0xb')](function(_0x349460){logger[_0x1184('0xc')](_0x1184('0xd'),_0x122829,_0x1184('0xe'));logger[_0x1184('0xf')](_0x1184('0x10'),_0x122829,_0x1184('0xe'),JSON[_0x1184('0x11')](_0x349460));if(_0x349460[_0x1184('0x12')]){if(_0x349460['error'][_0x1184('0x13')]===0x1f4){logger[_0x1184('0x12')](_0x1184('0xd'),_0x122829,_0x349460[_0x1184('0x12')][_0x1184('0x14')]);return _0x18bc1b(_0x349460['error'][_0x1184('0x14')]);}logger[_0x1184('0x12')](_0x1184('0xd'),_0x122829,_0x349460['error']['message']);return _0x2e8a79(_0x349460[_0x1184('0x12')]['message']);}else{logger['info'](_0x1184('0xd'),_0x122829,_0x1184('0xe'));_0x2e8a79(_0x349460[_0x1184('0x15')][_0x1184('0x14')]);}})['catch'](function(_0x18d82a){logger[_0x1184('0x12')](_0x1184('0xd'),_0x122829,_0x18d82a);_0x18bc1b(_0x18d82a);});});}exports[_0x1184('0x16')]=function(_0x2ce3c0){var _0x5bf7e7=this;return new Promise(function(_0x1841d2,_0x1c42f8){return db['CmHopperHistory'][_0x1184('0x17')](_0x2ce3c0['body'],{'raw':_0x2ce3c0[_0x1184('0x18')]?_0x2ce3c0[_0x1184('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x1184('0xb')](function(_0x576306){logger[_0x1184('0xc')](_0x1184('0x16'),_0x2ce3c0);logger[_0x1184('0xf')](_0x1184('0x16'),_0x2ce3c0,JSON[_0x1184('0x11')](_0x576306));_0x1841d2(_0x576306);})[_0x1184('0x19')](function(_0x562f40){logger[_0x1184('0x12')](_0x1184('0x16'),_0x562f40['message'],_0x2ce3c0);_0x1c42f8(_0x5bf7e7['error'](0x1f4,_0x562f40['message']));});});};exports[_0x1184('0x1a')]=function(_0x250d9b){var _0x31b0d0=this;return new Promise(function(_0x202616,_0x4a60b4){return db[_0x1184('0x1b')][_0x1184('0x1c')]({'raw':_0x250d9b[_0x1184('0x18')]?_0x250d9b[_0x1184('0x18')][_0x1184('0x1d')]===undefined?!![]:![]:!![],'where':_0x250d9b[_0x1184('0x18')]?_0x250d9b['options'][_0x1184('0x1e')]||null:null,'attributes':[[db[_0x1184('0x1f')]['fn']('COUNT',db[_0x1184('0x1f')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x1184('0x1f')]['fn']('COUNT',db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x21')))),_0x1184('0x22')],[db[_0x1184('0x1f')]['fn']('COUNT',db[_0x1184('0x1f')]['fn']('IF',db['sequelize'][_0x1184('0x20')](_0x1184('0x23')))),_0x1184('0x24')],[db['sequelize']['fn'](_0x1184('0x25'),db[_0x1184('0x1f')]['fn']('IF',db['sequelize'][_0x1184('0x20')](_0x1184('0x26')))),_0x1184('0x27')],[db[_0x1184('0x1f')]['fn'](_0x1184('0x28'),db[_0x1184('0x1f')]['fn']('IF',db['sequelize'][_0x1184('0x20')](_0x1184('0x29')))),_0x1184('0x2a')],[db[_0x1184('0x1f')]['fn'](_0x1184('0x28'),db[_0x1184('0x1f')]['fn']('IF',db['sequelize'][_0x1184('0x20')](_0x1184('0x2b')))),'predictiveIntervalAvgTalktime']]})[_0x1184('0xb')](function(_0x17e40e){logger[_0x1184('0xc')](_0x1184('0x1a'),_0x250d9b);logger[_0x1184('0xf')](_0x1184('0x1a'),_0x250d9b,JSON['stringify'](_0x17e40e));_0x202616(_0x17e40e);})[_0x1184('0x19')](function(_0x47578f){logger[_0x1184('0x12')](_0x1184('0x1a'),_0x47578f[_0x1184('0x14')],_0x250d9b);_0x4a60b4(_0x31b0d0[_0x1184('0x12')](0x1f4,_0x47578f[_0x1184('0x14')]));});});};exports[_0x1184('0x2c')]=function(_0x36e068){var _0x1fec1f=this;return new Promise(function(_0x35018e,_0x5297da){return db['CmHopperHistory'][_0x1184('0x1c')]({'raw':_0x36e068['options']?_0x36e068[_0x1184('0x18')][_0x1184('0x1d')]===undefined?!![]:![]:!![],'where':_0x36e068['options']?_0x36e068[_0x1184('0x18')]['where']||null:null,'attributes':[[_0x1184('0x2d'),_0x1184('0x2e')],[db[_0x1184('0x1f')]['fn']('COUNT',db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')]['literal'](_0x1184('0x2f')))),_0x1184('0x30')],[db[_0x1184('0x1f')]['fn'](_0x1184('0x25'),db['sequelize']['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x31')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x1184('0x25'),db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x21')))),'outboundAnswerCallsDay'],[db[_0x1184('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x32')))),_0x1184('0x33')],[db[_0x1184('0x1f')]['fn']('COUNT',db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x34')))),'outboundCongestionCallsDay'],[db[_0x1184('0x1f')]['fn'](_0x1184('0x25'),db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x35')))),_0x1184('0x36')],[db[_0x1184('0x1f')]['fn'](_0x1184('0x25'),db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x37')))),_0x1184('0x38')],[db[_0x1184('0x1f')]['fn'](_0x1184('0x25'),db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x39')))),_0x1184('0x3a')],[db[_0x1184('0x1f')]['fn'](_0x1184('0x25'),db[_0x1184('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x1184('0x3b')))),_0x1184('0x3c')],[db[_0x1184('0x1f')]['fn'](_0x1184('0x25'),db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')]['literal'](_0x1184('0x3d')))),_0x1184('0x3e')],[db[_0x1184('0x1f')]['fn']('COUNT',db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')]['literal'](_0x1184('0x3f')))),'outboundRejectCallsDay'],[db[_0x1184('0x1f')]['fn'](_0x1184('0x25'),db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x40')))),_0x1184('0x41')],[db[_0x1184('0x1f')]['fn']('COUNT',db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')]['literal'](_0x1184('0x42')))),_0x1184('0x43')],[db[_0x1184('0x1f')]['fn']('COUNT',db[_0x1184('0x1f')]['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x1184('0x2d')]})['then'](function(_0x53caf2){logger[_0x1184('0xc')](_0x1184('0x2c'),_0x36e068);logger[_0x1184('0xf')](_0x1184('0x2c'),_0x36e068,JSON[_0x1184('0x11')](_0x53caf2));_0x35018e(_0x53caf2);})['catch'](function(_0x23591b){logger[_0x1184('0x12')]('GetVoiceQueueHopperHistory',_0x23591b[_0x1184('0x14')],_0x36e068);_0x5297da(_0x1fec1f[_0x1184('0x12')](0x1f4,_0x23591b[_0x1184('0x14')]));});});};exports[_0x1184('0x44')]=function(_0x4a1e0c){var _0x3abff0=this;return new Promise(function(_0x3e01cf,_0x15845d){return db[_0x1184('0x1b')][_0x1184('0x1c')]({'raw':_0x4a1e0c[_0x1184('0x18')]?_0x4a1e0c[_0x1184('0x18')][_0x1184('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a1e0c['options']?_0x4a1e0c['options']['where']||null:null,'attributes':[[_0x1184('0x2d'),_0x1184('0x2e')],[db[_0x1184('0x1f')]['fn'](_0x1184('0x25'),db[_0x1184('0x1f')][_0x1184('0x45')]('id')),_0x1184('0x46')],[db[_0x1184('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1184('0x1f')][_0x1184('0x20')](_0x1184('0x21')))),_0x1184('0x47')]],'group':[_0x1184('0x2d')]})[_0x1184('0xb')](function(_0x10ce6e){logger[_0x1184('0xc')]('GetCampaignHopperHistory',_0x4a1e0c);logger[_0x1184('0xf')](_0x1184('0x44'),_0x4a1e0c,JSON['stringify'](_0x10ce6e));_0x3e01cf(_0x10ce6e);})['catch'](function(_0x415fe7){logger[_0x1184('0x12')](_0x1184('0x44'),_0x415fe7['message'],_0x4a1e0c);_0x15845d(_0x3abff0['error'](0x1f4,_0x415fe7[_0x1184('0x14')]));});});}; \ No newline at end of file +var _0xe9e2=['where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','name','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`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','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','body','options','raw','catch','AvgHandleTime','CmHopperHistory'];(function(_0x1a62fa,_0x245b12){var _0x5404ea=function(_0x53d354){while(--_0x53d354){_0x1a62fa['push'](_0x1a62fa['shift']());}};_0x5404ea(++_0x245b12);}(_0xe9e2,0x13a));var _0x2e9e=function(_0x130719,_0x2a7018){_0x130719=_0x130719-0x0;var _0x159865=_0xe9e2[_0x130719];return _0x159865;};'use strict';var _=require(_0x2e9e('0x0'));var util=require(_0x2e9e('0x1'));var moment=require(_0x2e9e('0x2'));var BPromise=require(_0x2e9e('0x3'));var rs=require(_0x2e9e('0x4'));var fs=require('fs');var Redis=require(_0x2e9e('0x5'));var db=require(_0x2e9e('0x6'))['db'];var utils=require(_0x2e9e('0x7'));var logger=require(_0x2e9e('0x8'))(_0x2e9e('0x9'));var config=require('../../config/environment');var jayson=require(_0x2e9e('0xa'));var client=jayson[_0x2e9e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x217435,_0x22a519,_0x1e70c0){return new BPromise(function(_0x51dcdc,_0xbfc54){return client[_0x2e9e('0xc')](_0x217435,_0x1e70c0)[_0x2e9e('0xd')](function(_0x55691f){logger[_0x2e9e('0xe')](_0x2e9e('0xf'),_0x22a519,_0x2e9e('0x10'));logger[_0x2e9e('0x11')](_0x2e9e('0x12'),_0x22a519,'request\x20sent',JSON[_0x2e9e('0x13')](_0x55691f));if(_0x55691f[_0x2e9e('0x14')]){if(_0x55691f[_0x2e9e('0x14')][_0x2e9e('0x15')]===0x1f4){logger['error'](_0x2e9e('0xf'),_0x22a519,_0x55691f[_0x2e9e('0x14')]['message']);return _0xbfc54(_0x55691f[_0x2e9e('0x14')][_0x2e9e('0x16')]);}logger[_0x2e9e('0x14')](_0x2e9e('0xf'),_0x22a519,_0x55691f['error'][_0x2e9e('0x16')]);return _0x51dcdc(_0x55691f[_0x2e9e('0x14')][_0x2e9e('0x16')]);}else{logger[_0x2e9e('0xe')](_0x2e9e('0xf'),_0x22a519,'request\x20sent');_0x51dcdc(_0x55691f[_0x2e9e('0x17')][_0x2e9e('0x16')]);}})['catch'](function(_0x319c2c){logger['error'](_0x2e9e('0xf'),_0x22a519,_0x319c2c);_0xbfc54(_0x319c2c);});});}exports[_0x2e9e('0x18')]=function(_0x49379c){var _0x88ca93=this;return new Promise(function(_0x15d12f,_0x4e954f){return db['CmHopperHistory']['create'](_0x49379c[_0x2e9e('0x19')],{'raw':_0x49379c[_0x2e9e('0x1a')]?_0x49379c[_0x2e9e('0x1a')][_0x2e9e('0x1b')]===undefined?!![]:![]:!![]})[_0x2e9e('0xd')](function(_0x3013f7){logger['info'](_0x2e9e('0x18'),_0x49379c);logger[_0x2e9e('0x11')]('CreateCmHopperHistory',_0x49379c,JSON[_0x2e9e('0x13')](_0x3013f7));_0x15d12f(_0x3013f7);})[_0x2e9e('0x1c')](function(_0x649b59){logger[_0x2e9e('0x14')](_0x2e9e('0x18'),_0x649b59[_0x2e9e('0x16')],_0x49379c);_0x4e954f(_0x88ca93[_0x2e9e('0x14')](0x1f4,_0x649b59['message']));});});};exports[_0x2e9e('0x1d')]=function(_0x5951ae){var _0x408e18=this;return new Promise(function(_0x17d24b,_0x3f3a72){return db[_0x2e9e('0x1e')]['findAll']({'raw':_0x5951ae['options']?_0x5951ae['options'][_0x2e9e('0x1b')]===undefined?!![]:![]:!![],'where':_0x5951ae[_0x2e9e('0x1a')]?_0x5951ae[_0x2e9e('0x1a')][_0x2e9e('0x1f')]||null:null,'attributes':[[db[_0x2e9e('0x20')]['fn']('COUNT',db[_0x2e9e('0x20')][_0x2e9e('0x21')]('id')),_0x2e9e('0x22')],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize']['literal'](_0x2e9e('0x24')))),_0x2e9e('0x25')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')](_0x2e9e('0x27')))),_0x2e9e('0x28')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x2011,\x201,\x20null'))),_0x2e9e('0x29')],[db['sequelize']['fn'](_0x2e9e('0x2a'),db['sequelize']['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x2e9e('0x2b')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x2a'),db['sequelize']['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x2e9e('0x2c')]]})['then'](function(_0x57095a){logger[_0x2e9e('0xe')]('AvgHandleTime',_0x5951ae);logger[_0x2e9e('0x11')](_0x2e9e('0x1d'),_0x5951ae,JSON[_0x2e9e('0x13')](_0x57095a));_0x17d24b(_0x57095a);})[_0x2e9e('0x1c')](function(_0x3bfeb3){logger[_0x2e9e('0x14')]('AvgHandleTime',_0x3bfeb3[_0x2e9e('0x16')],_0x5951ae);_0x3f3a72(_0x408e18[_0x2e9e('0x14')](0x1f4,_0x3bfeb3[_0x2e9e('0x16')]));});});};exports[_0x2e9e('0x2d')]=function(_0x49bfae){var _0xea41a9=this;return new Promise(function(_0x569509,_0x5c283f){return db[_0x2e9e('0x1e')][_0x2e9e('0x2e')]({'raw':_0x49bfae['options']?_0x49bfae[_0x2e9e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x49bfae[_0x2e9e('0x1a')]?_0x49bfae[_0x2e9e('0x1a')][_0x2e9e('0x1f')]||null:null,'attributes':[['campaign',_0x2e9e('0x2f')],[db[_0x2e9e('0x20')]['fn']('COUNT',db[_0x2e9e('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x2e9e('0x30')],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x24')))),_0x2e9e('0x31')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x32')))),_0x2e9e('0x33')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize']['literal'](_0x2e9e('0x34')))),_0x2e9e('0x35')],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')](_0x2e9e('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')]['literal'](_0x2e9e('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x2012,\x201,\x20null'))),_0x2e9e('0x38')],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x2013,\x201,\x20null'))),_0x2e9e('0x39')],[db[_0x2e9e('0x20')]['fn']('COUNT',db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')]['literal'](_0x2e9e('0x3a')))),_0x2e9e('0x3b')],[db['sequelize']['fn']('COUNT',db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x3c')))),_0x2e9e('0x3d')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')](_0x2e9e('0x3e')))),_0x2e9e('0x3f')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db['sequelize']['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')](_0x2e9e('0x40')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x41')))),'outboundReCallsDay']],'group':[_0x2e9e('0x42')]})['then'](function(_0x489215){logger[_0x2e9e('0xe')](_0x2e9e('0x2d'),_0x49bfae);logger[_0x2e9e('0x11')]('GetVoiceQueueHopperHistory',_0x49bfae,JSON['stringify'](_0x489215));_0x569509(_0x489215);})[_0x2e9e('0x1c')](function(_0x322915){logger[_0x2e9e('0x14')]('GetVoiceQueueHopperHistory',_0x322915['message'],_0x49bfae);_0x5c283f(_0xea41a9[_0x2e9e('0x14')](0x1f4,_0x322915['message']));});});};exports[_0x2e9e('0x43')]=function(_0x399e9a){var _0x2dd24e=this;return new Promise(function(_0x23c207,_0x1b791b){return db[_0x2e9e('0x1e')][_0x2e9e('0x2e')]({'raw':_0x399e9a['options']?_0x399e9a[_0x2e9e('0x1a')][_0x2e9e('0x1b')]===undefined?!![]:![]:!![],'where':_0x399e9a[_0x2e9e('0x1a')]?_0x399e9a[_0x2e9e('0x1a')]['where']||null:null,'attributes':[['campaign',_0x2e9e('0x2f')],[db['sequelize']['fn'](_0x2e9e('0x23'),db['sequelize'][_0x2e9e('0x21')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x24')))),_0x2e9e('0x44')]],'group':['campaign']})[_0x2e9e('0xd')](function(_0x5d0247){logger[_0x2e9e('0xe')](_0x2e9e('0x43'),_0x399e9a);logger[_0x2e9e('0x11')]('GetCampaignHopperHistory',_0x399e9a,JSON[_0x2e9e('0x13')](_0x5d0247));_0x23c207(_0x5d0247);})['catch'](function(_0x1b8cfa){logger['error']('GetCampaignHopperHistory',_0x1b8cfa[_0x2e9e('0x16')],_0x399e9a);_0x1b791b(_0x2dd24e[_0x2e9e('0x14')](0x1f4,_0x1b8cfa['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 2536cbb..dc0634e 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 _0x72bd=['describe','/:id','show','create','put','update','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe'];(function(_0x25f9dc,_0x36c8e1){var _0x4213ec=function(_0x5f4707){while(--_0x5f4707){_0x25f9dc['push'](_0x25f9dc['shift']());}};_0x4213ec(++_0x36c8e1);}(_0x72bd,0x115));var _0xd72b=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x72bd[_0x187ee1];return _0x388160;};'use strict';var multer=require('multer');var util=require(_0xd72b('0x0'));var path=require('path');var timeout=require(_0xd72b('0x1'));var express=require(_0xd72b('0x2'));var router=express[_0xd72b('0x3')]();var fs_extra=require(_0xd72b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd72b('0x5'));var controller=require(_0xd72b('0x6'));router[_0xd72b('0x7')]('/',auth[_0xd72b('0x8')](),controller[_0xd72b('0x9')]);router[_0xd72b('0x7')](_0xd72b('0xa'),auth[_0xd72b('0x8')](),controller[_0xd72b('0xb')]);router[_0xd72b('0x7')](_0xd72b('0xc'),auth[_0xd72b('0x8')](),controller[_0xd72b('0xd')]);router['post']('/',auth[_0xd72b('0x8')](),controller[_0xd72b('0xe')]);router[_0xd72b('0xf')]('/:id',auth[_0xd72b('0x8')](),controller[_0xd72b('0x10')]);module[_0xd72b('0x11')]=router; \ No newline at end of file +var _0x5b38=['post','create','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5b38,0x194));var _0x85b3=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5b38[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x85b3('0x0'));var util=require(_0x85b3('0x1'));var path=require(_0x85b3('0x2'));var timeout=require(_0x85b3('0x3'));var express=require(_0x85b3('0x4'));var router=express[_0x85b3('0x5')]();var fs_extra=require(_0x85b3('0x6'));var auth=require(_0x85b3('0x7'));var interaction=require(_0x85b3('0x8'));var config=require(_0x85b3('0x9'));var controller=require(_0x85b3('0xa'));router[_0x85b3('0xb')]('/',auth[_0x85b3('0xc')](),controller['index']);router[_0x85b3('0xb')](_0x85b3('0xd'),auth['isAuthenticated'](),controller[_0x85b3('0xe')]);router[_0x85b3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x85b3('0xf')]);router[_0x85b3('0x10')]('/',auth['isAuthenticated'](),controller[_0x85b3('0x11')]);router['put'](_0x85b3('0x12'),auth[_0x85b3('0xc')](),controller[_0x85b3('0x13')]);module[_0x85b3('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 71d1e3c..dccc8e4 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 _0x64f5=['sequelize','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x64f5,0x17e));var _0x564f=function(_0x1c811f,_0x2ce2cb){_0x1c811f=_0x1c811f-0x0;var _0x47626e=_0x64f5[_0x1c811f];return _0x47626e;};'use strict';var Sequelize=require(_0x564f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x564f('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x946e=['sequelize','STRING'];(function(_0x32c48c,_0x5d669e){var _0x133729=function(_0x369daa){while(--_0x369daa){_0x32c48c['push'](_0x32c48c['shift']());}};_0x133729(++_0x5d669e);}(_0x946e,0x1d0));var _0xe946=function(_0x4b4ab8,_0x193fa1){_0x4b4ab8=_0x4b4ab8-0x0;var _0x437c00=_0x946e[_0x4b4ab8];return _0x437c00;};'use strict';var Sequelize=require(_0xe946('0x0'));module['exports']={'name':{'type':Sequelize[_0xe946('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe946('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 87144cc..a65a528 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 _0x2e99=['rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','find','catch','create','body','user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','order','ListId','removeDispositions','ids','addContacts','tags','isArray','join','each','CmContact','omit','success','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','concat','getContacts','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Lists','error','stack','name','index','map','CmList'];(function(_0x3d3b05,_0x334c57){var _0x2c6ca3=function(_0x3fd1cc){while(--_0x3fd1cc){_0x3d3b05['push'](_0x3d3b05['shift']());}};_0x2c6ca3(++_0x334c57);}(_0x2e99,0xf4));var _0x92e9=function(_0x2bf4d6,_0x57d692){_0x2bf4d6=_0x2bf4d6-0x0;var _0x2a21a7=_0x2e99[_0x2bf4d6];return _0x2a21a7;};'use strict';var emlformat=require(_0x92e9('0x0'));var rimraf=require(_0x92e9('0x1'));var zipdir=require(_0x92e9('0x2'));var jsonpatch=require(_0x92e9('0x3'));var rp=require(_0x92e9('0x4'));var moment=require(_0x92e9('0x5'));var BPromise=require(_0x92e9('0x6'));var Mustache=require(_0x92e9('0x7'));var util=require(_0x92e9('0x8'));var path=require('path');var sox=require(_0x92e9('0x9'));var csv=require(_0x92e9('0xa'));var ejs=require(_0x92e9('0xb'));var fs=require('fs');var fs_extra=require(_0x92e9('0xc'));var _=require(_0x92e9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x92e9('0xe'));var deskjs=require(_0x92e9('0xf'));var toCsv=require(_0x92e9('0xa'));var querystring=require(_0x92e9('0x10'));var Papa=require('papaparse');var Redis=require(_0x92e9('0x11'));var authService=require(_0x92e9('0x12'));var qs=require(_0x92e9('0x13'));var as=require(_0x92e9('0x14'));var hardwareService=require(_0x92e9('0x15'));var logger=require('../../config/logger')(_0x92e9('0x16'));var utils=require('../../config/utils');var config=require(_0x92e9('0x17'));var licenseUtil=require(_0x92e9('0x18'));var db=require(_0x92e9('0x19'))['db'];config[_0x92e9('0x1a')]=_[_0x92e9('0x1b')](config[_0x92e9('0x1a')],{'host':_0x92e9('0x1c'),'port':0x18eb});var socket=require(_0x92e9('0x1d'))(new Redis(config['redis']));require('./cmList.socket')[_0x92e9('0x1e')](socket);function respondWithStatusCode(_0x14453a,_0xea9870){_0xea9870=_0xea9870||0xcc;return function(_0x20f997){if(_0x20f997){return _0x14453a[_0x92e9('0x1f')](_0xea9870);}return _0x14453a[_0x92e9('0x20')](_0xea9870)[_0x92e9('0x21')]();};}function respondWithResult(_0x2739ae,_0x375079){_0x375079=_0x375079||0xc8;return function(_0x57e028){if(_0x57e028){return _0x2739ae['status'](_0x375079)[_0x92e9('0x22')](_0x57e028);}};}function respondWithFilteredResult(_0x2c4e0d,_0x3d4ba5){return function(_0x5a6a7f){if(_0x5a6a7f){var _0x57a028=typeof _0x3d4ba5[_0x92e9('0x23')]===_0x92e9('0x24')&&typeof _0x3d4ba5[_0x92e9('0x25')]==='undefined';var _0x919a2=_0x5a6a7f['count'];var _0x3126d0=_0x57a028?0x0:_0x3d4ba5[_0x92e9('0x23')];var _0xf40916=_0x57a028?_0x5a6a7f[_0x92e9('0x26')]:_0x3d4ba5[_0x92e9('0x23')]+_0x3d4ba5['limit'];var _0x4af6cc;if(_0xf40916>=_0x919a2){_0xf40916=_0x919a2;_0x4af6cc=0xc8;}else{_0x4af6cc=0xce;}_0x2c4e0d['status'](_0x4af6cc);return _0x2c4e0d[_0x92e9('0x27')](_0x92e9('0x28'),_0x3126d0+'-'+_0xf40916+'/'+_0x919a2)[_0x92e9('0x22')](_0x5a6a7f);}return null;};}function patchUpdates(_0x2a233b){return function(_0x2ab95c){try{jsonpatch['apply'](_0x2ab95c,_0x2a233b,!![]);}catch(_0x45caab){return BPromise[_0x92e9('0x29')](_0x45caab);}return _0x2ab95c[_0x92e9('0x2a')]();};}function saveUpdates(_0x3e34b4,_0xc43e6f){return function(_0x21b4ec){if(_0x21b4ec){return _0x21b4ec[_0x92e9('0x2b')](_0x3e34b4)['then'](function(_0x428a36){return _0x428a36;});}return null;};}function removeEntity(_0x31d049,_0xce909c){return function(_0x5e69aa){if(_0x5e69aa){return _0x5e69aa[_0x92e9('0x2c')]()[_0x92e9('0x2d')](function(){var _0x58ccf3=_0x5e69aa[_0x92e9('0x2e')]({'plain':!![]});var _0x5e9cc4=_0x92e9('0x2f');return db['UserProfileResource'][_0x92e9('0x2c')]({'where':{'type':_0x5e9cc4,'resourceId':_0x58ccf3['id']}})[_0x92e9('0x2d')](function(){return _0x5e69aa;});})['then'](function(){_0x31d049['status'](0xcc)[_0x92e9('0x21')]();});}};}function handleEntityNotFound(_0x439d8a,_0xc1db89){return function(_0x5492d6){if(!_0x5492d6){_0x439d8a[_0x92e9('0x1f')](0x194);}return _0x5492d6;};}function handleError(_0x164c52,_0x2a82e4){_0x2a82e4=_0x2a82e4||0x1f4;return function(_0x447537){logger[_0x92e9('0x30')](_0x447537[_0x92e9('0x31')]);if(_0x447537['name']){delete _0x447537[_0x92e9('0x32')];}_0x164c52[_0x92e9('0x20')](_0x2a82e4)['send'](_0x447537);};}exports[_0x92e9('0x33')]=function(_0x1285ed,_0x41f146){var _0x4d5ed5={},_0x15b86e={},_0x5bea9a={'count':0x0,'rows':[]};var _0x306a6d=_[_0x92e9('0x34')](db[_0x92e9('0x35')][_0x92e9('0x36')],function(_0x4597cc){return{'name':_0x4597cc[_0x92e9('0x37')],'type':_0x4597cc['type'][_0x92e9('0x38')]};});_0x15b86e['model']=_[_0x92e9('0x34')](_0x306a6d,_0x92e9('0x32'));_0x15b86e[_0x92e9('0x39')]=_['keys'](_0x1285ed['query']);_0x15b86e[_0x92e9('0x3a')]=_[_0x92e9('0x3b')](_0x15b86e['model'],_0x15b86e[_0x92e9('0x39')]);_0x4d5ed5[_0x92e9('0x3c')]=_[_0x92e9('0x3b')](_0x15b86e[_0x92e9('0x3d')],qs[_0x92e9('0x3e')](_0x1285ed[_0x92e9('0x39')][_0x92e9('0x3e')]));_0x4d5ed5[_0x92e9('0x3c')]=_0x4d5ed5[_0x92e9('0x3c')][_0x92e9('0x3f')]?_0x4d5ed5[_0x92e9('0x3c')]:_0x15b86e[_0x92e9('0x3d')];if(!_0x1285ed[_0x92e9('0x39')][_0x92e9('0x40')](_0x92e9('0x41'))){_0x4d5ed5['limit']=qs['limit'](_0x1285ed[_0x92e9('0x39')][_0x92e9('0x25')]);_0x4d5ed5['offset']=qs[_0x92e9('0x23')](_0x1285ed['query'][_0x92e9('0x23')]);}_0x4d5ed5['order']=qs[_0x92e9('0x42')](_0x1285ed[_0x92e9('0x39')]['sort']);_0x4d5ed5[_0x92e9('0x43')]=qs['filters'](_[_0x92e9('0x44')](_0x1285ed[_0x92e9('0x39')],_0x15b86e[_0x92e9('0x3a')]),_0x306a6d);if(_0x1285ed[_0x92e9('0x39')]['filter']){_0x4d5ed5[_0x92e9('0x43')]=_[_0x92e9('0x45')](_0x4d5ed5[_0x92e9('0x43')],{'$or':_[_0x92e9('0x34')](_0x306a6d,function(_0x12c8d2){if(_0x12c8d2[_0x92e9('0x46')]!==_0x92e9('0x47')){var _0x54e299={};_0x54e299[_0x12c8d2[_0x92e9('0x32')]]={'$like':'%'+_0x1285ed[_0x92e9('0x39')][_0x92e9('0x48')]+'%'};return _0x54e299;}})});}_0x4d5ed5=_[_0x92e9('0x45')]({},_0x4d5ed5,_0x1285ed[_0x92e9('0x49')]);var _0x117681={'where':_0x4d5ed5[_0x92e9('0x43')]};return db[_0x92e9('0x35')][_0x92e9('0x26')](_0x117681)[_0x92e9('0x2d')](function(_0x225eb2){_0x5bea9a['count']=_0x225eb2;if(_0x1285ed[_0x92e9('0x39')][_0x92e9('0x4a')]){_0x4d5ed5[_0x92e9('0x4b')]=[{'all':!![]}];}return db[_0x92e9('0x35')][_0x92e9('0x4c')](_0x4d5ed5);})['then'](function(_0x140603){_0x5bea9a[_0x92e9('0x4d')]=_0x140603;return _0x5bea9a;})['then'](respondWithFilteredResult(_0x41f146,_0x4d5ed5))['catch'](handleError(_0x41f146,null));};exports[_0x92e9('0x4e')]=function(_0x370474,_0x4c5ed7){var _0x2f49ad={'raw':![],'where':{'id':_0x370474['params']['id']}},_0x532d06={};_0x532d06[_0x92e9('0x3d')]=_[_0x92e9('0x4f')](db['CmList']['rawAttributes']);_0x532d06[_0x92e9('0x39')]=_[_0x92e9('0x4f')](_0x370474[_0x92e9('0x39')]);_0x532d06['filters']=_[_0x92e9('0x3b')](_0x532d06[_0x92e9('0x3d')],_0x532d06[_0x92e9('0x39')]);_0x2f49ad[_0x92e9('0x3c')]=_[_0x92e9('0x3b')](_0x532d06['model'],qs[_0x92e9('0x3e')](_0x370474['query']['fields']));_0x2f49ad[_0x92e9('0x3c')]=_0x2f49ad[_0x92e9('0x3c')][_0x92e9('0x3f')]?_0x2f49ad[_0x92e9('0x3c')]:_0x532d06[_0x92e9('0x3d')];if(_0x370474[_0x92e9('0x39')][_0x92e9('0x4a')]){_0x2f49ad[_0x92e9('0x4b')]=[{'all':!![]}];}_0x2f49ad=_[_0x92e9('0x45')]({},_0x2f49ad,_0x370474[_0x92e9('0x49')]);return db[_0x92e9('0x35')][_0x92e9('0x50')](_0x2f49ad)[_0x92e9('0x2d')](handleEntityNotFound(_0x4c5ed7,null))[_0x92e9('0x2d')](respondWithResult(_0x4c5ed7,null))[_0x92e9('0x51')](handleError(_0x4c5ed7,null));};exports[_0x92e9('0x52')]=function(_0x4ca359,_0xd0eca5){return db[_0x92e9('0x35')]['create'](_0x4ca359[_0x92e9('0x53')],{})[_0x92e9('0x2d')](function(_0x4fdeba){var _0x255ac3=_0x4ca359[_0x92e9('0x54')][_0x92e9('0x2e')]({'plain':!![]});if(!_0x255ac3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x255ac3[_0x92e9('0x55')]==='user'){var _0x2ad6b2=_0x4fdeba['get']({'plain':!![]});var _0x535438=_0x92e9('0x2f');return db[_0x92e9('0x56')][_0x92e9('0x50')]({'where':{'name':_0x535438,'userProfileId':_0x255ac3['userProfileId']},'raw':!![]})[_0x92e9('0x2d')](function(_0x37a672){if(_0x37a672&&_0x37a672['autoAssociation']===0x0){return db[_0x92e9('0x57')][_0x92e9('0x52')]({'name':_0x2ad6b2[_0x92e9('0x32')],'resourceId':_0x2ad6b2['id'],'type':_0x37a672[_0x92e9('0x32')],'sectionId':_0x37a672['id']},{})[_0x92e9('0x2d')](function(){return _0x4fdeba;});}else{return _0x4fdeba;}})['catch'](function(_0xe98ab6){logger[_0x92e9('0x30')](_0x92e9('0x58'),_0xe98ab6);throw _0xe98ab6;});}return _0x4fdeba;})[_0x92e9('0x2d')](respondWithResult(_0xd0eca5,0xc9))['catch'](handleError(_0xd0eca5,null));};exports[_0x92e9('0x2b')]=function(_0x454cff,_0x221c99){if(_0x454cff[_0x92e9('0x53')]['id']){delete _0x454cff['body']['id'];}return db[_0x92e9('0x35')][_0x92e9('0x50')]({'where':{'id':_0x454cff[_0x92e9('0x59')]['id']}})['then'](handleEntityNotFound(_0x221c99,null))[_0x92e9('0x2d')](saveUpdates(_0x454cff['body'],null))[_0x92e9('0x2d')](respondWithResult(_0x221c99,null))[_0x92e9('0x51')](handleError(_0x221c99,null));};exports[_0x92e9('0x2c')]=function(_0x31a553,_0xbd3e2b){return db[_0x92e9('0x35')][_0x92e9('0x50')]({'where':{'id':_0x31a553[_0x92e9('0x59')]['id']}})[_0x92e9('0x2d')](handleEntityNotFound(_0xbd3e2b,null))[_0x92e9('0x2d')](removeEntity(_0xbd3e2b,null))['catch'](handleError(_0xbd3e2b,null));};exports[_0x92e9('0x5a')]=function(_0x4a2649,_0x58c5a3){return db[_0x92e9('0x35')][_0x92e9('0x5a')]()[_0x92e9('0x2d')](respondWithResult(_0x58c5a3,null))[_0x92e9('0x51')](handleError(_0x58c5a3,null));};exports[_0x92e9('0x5b')]=function(_0x30237a,_0x85bbf0,_0xb7f6e7){if(_0x30237a['body']['id']){delete _0x30237a[_0x92e9('0x53')]['id'];}return db['CmList']['find']({'where':{'id':_0x30237a['params']['id']}})['then'](handleEntityNotFound(_0x85bbf0,null))[_0x92e9('0x2d')](function(_0x140392){if(_0x140392){_0x30237a['body']['ListId']=_0x140392['id'];return db[_0x92e9('0x5c')][_0x92e9('0x52')](_0x30237a[_0x92e9('0x53')]);}})[_0x92e9('0x2d')](respondWithResult(_0x85bbf0,null))[_0x92e9('0x51')](handleError(_0x85bbf0,null));};exports[_0x92e9('0x5d')]=function(_0x44b8e9,_0x1f5352,_0x1ce64e){var _0x17c25e={'raw':![],'where':{}};var _0x44d2c7={};var _0x3a9ce1={'count':0x0,'rows':[]};return db[_0x92e9('0x35')][_0x92e9('0x5e')]({'where':{'id':_0x44b8e9['params']['id']}})[_0x92e9('0x2d')](handleEntityNotFound(_0x1f5352,null))[_0x92e9('0x2d')](function(_0x2472af){if(_0x2472af){_0x44d2c7[_0x92e9('0x3d')]=_[_0x92e9('0x4f')](db[_0x92e9('0x5c')]['rawAttributes']);_0x44d2c7[_0x92e9('0x39')]=_['keys'](_0x44b8e9[_0x92e9('0x39')]);_0x44d2c7[_0x92e9('0x3a')]=_['intersection'](_0x44d2c7[_0x92e9('0x3d')],_0x44d2c7['query']);_0x17c25e[_0x92e9('0x3c')]=_[_0x92e9('0x3b')](_0x44d2c7[_0x92e9('0x3d')],qs[_0x92e9('0x3e')](_0x44b8e9[_0x92e9('0x39')][_0x92e9('0x3e')]));_0x17c25e['attributes']=_0x17c25e[_0x92e9('0x3c')]['length']?_0x17c25e[_0x92e9('0x3c')]:_0x44d2c7[_0x92e9('0x3d')];if(!_0x44b8e9[_0x92e9('0x39')]['hasOwnProperty'](_0x92e9('0x41'))){_0x17c25e[_0x92e9('0x25')]=qs[_0x92e9('0x25')](_0x44b8e9[_0x92e9('0x39')][_0x92e9('0x25')]);_0x17c25e[_0x92e9('0x23')]=qs[_0x92e9('0x23')](_0x44b8e9[_0x92e9('0x39')][_0x92e9('0x23')]);}_0x17c25e[_0x92e9('0x5f')]=qs[_0x92e9('0x42')](_0x44b8e9[_0x92e9('0x39')][_0x92e9('0x42')]);_0x17c25e[_0x92e9('0x43')]=qs[_0x92e9('0x3a')](_['pick'](_0x44b8e9[_0x92e9('0x39')],_0x44d2c7[_0x92e9('0x3a')]));_0x17c25e[_0x92e9('0x43')][_0x92e9('0x60')]=_0x2472af['id'];if(_0x44b8e9[_0x92e9('0x39')]['filter']){_0x17c25e[_0x92e9('0x43')]=_[_0x92e9('0x45')](_0x17c25e['where'],{'$or':_[_0x92e9('0x34')](_0x17c25e[_0x92e9('0x3c')],function(_0x4a4baf){var _0x5ed2df={};_0x5ed2df[_0x4a4baf]={'$like':'%'+_0x44b8e9['query'][_0x92e9('0x48')]+'%'};return _0x5ed2df;})});}_0x17c25e=_['merge']({},_0x17c25e,_0x44b8e9[_0x92e9('0x49')]);return db['Disposition'][_0x92e9('0x26')]({'where':_0x17c25e[_0x92e9('0x43')]})[_0x92e9('0x2d')](function(_0x4337d3){_0x3a9ce1[_0x92e9('0x26')]=_0x4337d3;if(_0x44b8e9[_0x92e9('0x39')][_0x92e9('0x4a')]){_0x17c25e[_0x92e9('0x4b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x17c25e);})[_0x92e9('0x2d')](function(_0x188280){_0x3a9ce1[_0x92e9('0x4d')]=_0x188280;return _0x3a9ce1;});}})[_0x92e9('0x2d')](respondWithFilteredResult(_0x1f5352,_0x17c25e))['catch'](handleError(_0x1f5352,null));};exports[_0x92e9('0x61')]=function(_0x5a41a8,_0x3dd5f6,_0x2f5214){return db['CmList'][_0x92e9('0x50')]({'where':{'id':_0x5a41a8[_0x92e9('0x59')]['id']}})[_0x92e9('0x2d')](handleEntityNotFound(_0x3dd5f6,null))[_0x92e9('0x2d')](function(_0x38fc04){if(_0x38fc04){return _0x38fc04['removeDispositions'](_0x5a41a8['query'][_0x92e9('0x62')]);}})[_0x92e9('0x2d')](respondWithStatusCode(_0x3dd5f6,null))[_0x92e9('0x51')](handleError(_0x3dd5f6,null));};exports[_0x92e9('0x63')]=function(_0x13a1e7,_0x29e53d,_0x42f8c3){return db[_0x92e9('0x35')]['find']({'where':{'id':_0x13a1e7[_0x92e9('0x59')]['id']}})['then'](handleEntityNotFound(_0x29e53d,null))[_0x92e9('0x2d')](function(_0x2c3291){if(_0x2c3291){var _0x52cbe1=[];var _0x581bfc={'success':[],'errors':[]};return db['CmContact'][_0x92e9('0x5a')]()[_0x92e9('0x2d')](function(_0xb99003){if(_0x13a1e7['body'][_0x92e9('0x64')]&&_[_0x92e9('0x65')](_0x13a1e7[_0x92e9('0x53')][_0x92e9('0x64')])){if(_0x13a1e7['body']['tags']['length']){_0x13a1e7['body'][_0x92e9('0x64')]=_0x13a1e7['body'][_0x92e9('0x64')][_0x92e9('0x66')](';')+';';}else{_0x13a1e7['body'][_0x92e9('0x64')]=null;}}else{_0x13a1e7[_0x92e9('0x53')][_0x92e9('0x64')]=null;}if(_0x13a1e7[_0x92e9('0x53')]&&_[_0x92e9('0x65')](_0x13a1e7['body'])){for(var _0x444b97=0x0;_0x444b97<_0x13a1e7[_0x92e9('0x53')][_0x92e9('0x3f')];_0x444b97+=0x1){_0x13a1e7[_0x92e9('0x53')][_0x444b97][_0x92e9('0x60')]=_0x13a1e7[_0x92e9('0x59')]['id'];_0x52cbe1['push'](_0x13a1e7[_0x92e9('0x53')][_0x444b97]);}return BPromise[_0x92e9('0x67')](_0x52cbe1,function(_0x322692){return db[_0x92e9('0x68')][_0x92e9('0x52')](_[_0x92e9('0x69')](_0x322692,['ids','id'])||{},{'fields':_[_0x92e9('0x4f')](_0xb99003),'raw':!![]})['then'](function(_0x5dc809){_0x581bfc[_0x92e9('0x6a')]['push'](_0x5dc809['dataValues']);})[_0x92e9('0x51')](function(_0x58f344){_0x581bfc['errors']['push']({'data':_0x322692,'error':_0x58f344[_0x92e9('0x6b')]});});})[_0x92e9('0x2d')](function(_0x515129){return _0x581bfc;})[_0x92e9('0x51')](function(_0x329db4){return _0x329db4;});}else{_0x29e53d[_0x92e9('0x20')](0x190)['json']({'message':_0x92e9('0x6c')});}});}})['then'](respondWithResult(_0x29e53d,null))[_0x92e9('0x51')](handleError(_0x29e53d,null));};exports['getContacts']=function(_0x5e8ff5,_0x54a9de,_0x6b5f1){var _0x5b5e3a;return db[_0x92e9('0x35')][_0x92e9('0x50')]({'where':{'id':_0x5e8ff5['params']['id']},'include':[{'model':db[_0x92e9('0x6d')],'as':_0x92e9('0x6e')}]})[_0x92e9('0x2d')](handleEntityNotFound(_0x54a9de,null))['then'](function(_0x43e2c7){if(_0x43e2c7){_0x5b5e3a=_0x43e2c7;return db[_0x92e9('0x68')][_0x92e9('0x36')];}})['then'](function(_0x56591b){if(_0x56591b){var _0x3ae487={};var _0x2ba4cd={};_0x2ba4cd[_0x92e9('0x3d')]=_['concat'](_[_0x92e9('0x4f')](_0x56591b),_[_0x92e9('0x34')](_0x5b5e3a[_0x92e9('0x6e')],function(_0x78de42){return util[_0x92e9('0x6f')](_0x92e9('0x70'),_0x78de42['id']);}));_0x2ba4cd[_0x92e9('0x39')]=_[_0x92e9('0x4f')](_0x5e8ff5[_0x92e9('0x39')]);_0x2ba4cd['filters']=_[_0x92e9('0x3b')](_0x2ba4cd['model'],_0x2ba4cd[_0x92e9('0x39')]);_0x3ae487[_0x92e9('0x3c')]=_[_0x92e9('0x3b')](_0x2ba4cd['model'],qs['fields'](_0x5e8ff5[_0x92e9('0x39')][_0x92e9('0x3e')]));_0x3ae487['attributes']=_0x3ae487[_0x92e9('0x3c')][_0x92e9('0x3f')]?_0x3ae487[_0x92e9('0x3c')]:_0x2ba4cd['model'];if(!_0x5e8ff5[_0x92e9('0x39')][_0x92e9('0x40')](_0x92e9('0x41'))){_0x3ae487[_0x92e9('0x25')]=qs[_0x92e9('0x25')](_0x5e8ff5[_0x92e9('0x39')]['limit']);_0x3ae487[_0x92e9('0x23')]=qs[_0x92e9('0x23')](_0x5e8ff5['query'][_0x92e9('0x23')]);}_0x3ae487[_0x92e9('0x5f')]=qs[_0x92e9('0x42')](_0x5e8ff5[_0x92e9('0x39')][_0x92e9('0x42')]);_0x3ae487['where']=qs[_0x92e9('0x3a')](_['pick'](_0x5e8ff5['query'],_0x2ba4cd[_0x92e9('0x3a')]));_0x3ae487[_0x92e9('0x71')]=!![];if(_0x5e8ff5[_0x92e9('0x39')][_0x92e9('0x48')]){_0x3ae487[_0x92e9('0x43')]=_[_0x92e9('0x45')](_0x3ae487[_0x92e9('0x43')],{'$or':_[_0x92e9('0x34')](_0x3ae487['attributes'],function(_0x483319){var _0x2d97dd={};_0x2d97dd[_0x483319]={'$like':'%'+_0x5e8ff5['query'][_0x92e9('0x48')]+'%'};return _0x2d97dd;})});}_0x3ae487=_[_0x92e9('0x45')]({},_0x3ae487,_0x5e8ff5[_0x92e9('0x49')]);return _0x5b5e3a['getContacts'](_0x3ae487);}})[_0x92e9('0x2d')](respondWithResult(_0x54a9de,null))[_0x92e9('0x51')](handleError(_0x54a9de,null));};exports[_0x92e9('0x72')]=function(_0x4101aa,_0x117568,_0xeae475){var _0x3d3ce5;return db['CmList'][_0x92e9('0x50')]({'where':{'id':_0x4101aa['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x92e9('0x6e')}]})[_0x92e9('0x2d')](handleEntityNotFound(_0x117568,null))[_0x92e9('0x2d')](function(_0x57818c){if(_0x57818c){_0x3d3ce5=_0x57818c;return db[_0x92e9('0x68')][_0x92e9('0x36')];}})[_0x92e9('0x2d')](function(_0x5cfbea){if(_0x5cfbea){var _0x5dc00c={};var _0xc99bf6={};_0xc99bf6['model']=_[_0x92e9('0x73')](_[_0x92e9('0x4f')](_0x5cfbea),_[_0x92e9('0x34')](_0x3d3ce5[_0x92e9('0x6e')],function(_0x116893){return util[_0x92e9('0x6f')](_0x92e9('0x70'),_0x116893['id']);}));_0xc99bf6[_0x92e9('0x39')]=_['keys'](_0x4101aa[_0x92e9('0x39')]);_0xc99bf6[_0x92e9('0x3a')]=_['intersection'](_0xc99bf6[_0x92e9('0x3d')],_0xc99bf6['query']);_0x5dc00c[_0x92e9('0x3c')]=_['intersection'](_0xc99bf6[_0x92e9('0x3d')],qs[_0x92e9('0x3e')](_0x4101aa[_0x92e9('0x39')][_0x92e9('0x3e')]));_0x5dc00c[_0x92e9('0x3c')]=_0x5dc00c[_0x92e9('0x3c')][_0x92e9('0x3f')]?_0x5dc00c[_0x92e9('0x3c')]:_0xc99bf6[_0x92e9('0x3d')];if(!_0x4101aa[_0x92e9('0x39')][_0x92e9('0x40')](_0x92e9('0x41'))){_0x5dc00c[_0x92e9('0x25')]=qs[_0x92e9('0x25')](_0x4101aa[_0x92e9('0x39')]['limit']);_0x5dc00c['offset']=qs[_0x92e9('0x23')](_0x4101aa[_0x92e9('0x39')]['offset']);}_0x5dc00c[_0x92e9('0x5f')]=qs['sort'](_0x4101aa[_0x92e9('0x39')][_0x92e9('0x42')]);_0x5dc00c['where']=qs[_0x92e9('0x3a')](_[_0x92e9('0x44')](_0x4101aa[_0x92e9('0x39')],_0xc99bf6[_0x92e9('0x3a')]));_0x5dc00c[_0x92e9('0x71')]=!![];if(_0x4101aa[_0x92e9('0x39')]['filter']){_0x5dc00c['where']=_[_0x92e9('0x45')](_0x5dc00c[_0x92e9('0x43')],{'$or':_[_0x92e9('0x34')](_0x5dc00c[_0x92e9('0x3c')],function(_0x40e7c6){var _0x893e79={};_0x893e79[_0x40e7c6]={'$like':'%'+_0x4101aa[_0x92e9('0x39')][_0x92e9('0x48')]+'%'};return _0x893e79;})});}_0x5dc00c=_['merge']({},_0x5dc00c,_0x4101aa['options']);return _0x3d3ce5[_0x92e9('0x74')](_0x5dc00c);}})['then'](function(_0x9d6bbc){if(!_[_0x92e9('0x75')](_0x9d6bbc)){var _0x3e6b67=toCsv(_0x9d6bbc);var _0x7d17c9=Date[_0x92e9('0x76')]();fs[_0x92e9('0x77')](util['format']('/tmp/list_%d_%s.csv',_0x3d3ce5['id'],_0x7d17c9),_0x3e6b67);_0x117568[_0x92e9('0x78')](_0x92e9('0x79'),_0x92e9('0x7a')+util['format'](_0x92e9('0x7b'),_0x3d3ce5['id'],_0x7d17c9));_0x117568[_0x92e9('0x78')](_0x92e9('0x7c'),_0x92e9('0x7d'));return _0x117568[_0x92e9('0x7e')](util[_0x92e9('0x6f')]('/tmp/list_%d_%s.csv',_0x3d3ce5['id'],_0x7d17c9));}else{return _0x117568[_0x92e9('0x1f')](0xcc);}})['catch'](handleError(_0x117568,null));};exports[_0x92e9('0x7f')]=function(_0x7148e8,_0x149f8b,_0x393e68){var _0x3254b0;delete _0x7148e8[_0x92e9('0x53')]['id'];return db[_0x92e9('0x35')][_0x92e9('0x5e')]({'where':{'id':_0x7148e8['params']['id']}})[_0x92e9('0x2d')](handleEntityNotFound(_0x149f8b,null))[_0x92e9('0x2d')](function(_0x5f12be){if(_0x5f12be){return db['sequelize'][_0x92e9('0x80')](function(_0x596acc){return db[_0x92e9('0x6d')][_0x92e9('0x52')](_0x7148e8[_0x92e9('0x53')],{'transaction':_0x596acc})[_0x92e9('0x2d')](function(_0x5ee57d){_0x3254b0=_0x5ee57d;return _0x5f12be[_0x92e9('0x81')](_0x5ee57d,{'transaction':_0x596acc});})[_0x92e9('0x2d')](function(){var _0x178309={'type':db[_0x92e9('0x82')][_0x92e9('0x83')],'transaction':_0x596acc};switch(_0x7148e8[_0x92e9('0x53')][_0x92e9('0x46')]){case'text':_0x178309[_0x92e9('0x46')]=db[_0x92e9('0x82')][_0x92e9('0x83')];break;case _0x92e9('0x84'):_0x178309[_0x92e9('0x46')]=db[_0x92e9('0x82')][_0x92e9('0x85')];break;case _0x92e9('0x86'):_0x178309[_0x92e9('0x46')]=db[_0x92e9('0x82')][_0x92e9('0x87')];_0x178309[_0x92e9('0x88')]=![];break;default:}return db[_0x92e9('0x89')][_0x92e9('0x8a')][_0x92e9('0x8b')](_0x92e9('0x8c'),util['format'](_0x92e9('0x8d'),_0x3254b0['id']),_0x178309);})[_0x92e9('0x2d')](function(){return _0x3254b0;});});}})[_0x92e9('0x2d')](respondWithResult(_0x149f8b,null))[_0x92e9('0x51')](handleError(_0x149f8b,null));};exports['getCustomFields']=function(_0x494a04,_0x374e38,_0x52b15f){var _0x3cc474={};var _0x4fbf19={};var _0x10d464;var _0x2c131a;return db[_0x92e9('0x35')][_0x92e9('0x5e')]({'where':{'id':_0x494a04[_0x92e9('0x59')]['id']}})[_0x92e9('0x2d')](handleEntityNotFound(_0x374e38,null))[_0x92e9('0x2d')](function(_0x199416){if(_0x199416){_0x10d464=_0x199416;_0x4fbf19[_0x92e9('0x3d')]=_[_0x92e9('0x4f')](db[_0x92e9('0x6d')]['rawAttributes']);_0x4fbf19['query']=_[_0x92e9('0x4f')](_0x494a04[_0x92e9('0x39')]);_0x4fbf19[_0x92e9('0x3a')]=_[_0x92e9('0x3b')](_0x4fbf19['model'],_0x4fbf19[_0x92e9('0x39')]);_0x3cc474[_0x92e9('0x3c')]=_['intersection'](_0x4fbf19[_0x92e9('0x3d')],qs[_0x92e9('0x3e')](_0x494a04[_0x92e9('0x39')][_0x92e9('0x3e')]));_0x3cc474[_0x92e9('0x3c')]=_0x3cc474['attributes'][_0x92e9('0x3f')]?_0x3cc474['attributes']:_0x4fbf19[_0x92e9('0x3d')];_0x3cc474['order']=qs[_0x92e9('0x42')](_0x494a04[_0x92e9('0x39')][_0x92e9('0x42')]);_0x3cc474[_0x92e9('0x43')]=qs['filters'](_[_0x92e9('0x44')](_0x494a04[_0x92e9('0x39')],_0x4fbf19[_0x92e9('0x3a')]));_0x3cc474['where']=_[_0x92e9('0x45')](_0x3cc474[_0x92e9('0x43')],{'$or':[{'ListId':_0x199416['id']},{'ListId':null}]});if(_0x494a04['query'][_0x92e9('0x48')]){_0x3cc474[_0x92e9('0x43')]=_[_0x92e9('0x45')](_0x3cc474['where'],{'$or':_[_0x92e9('0x34')](_0x3cc474[_0x92e9('0x3c')],function(_0x400935){var _0x47b62d={};_0x47b62d[_0x400935]={'$like':'%'+_0x494a04['query'][_0x92e9('0x48')]+'%'};return _0x47b62d;})});}_0x3cc474=_['merge']({},_0x3cc474,_0x494a04[_0x92e9('0x49')]);return db['CmCustomField']['findAndCountAll'](_0x3cc474);}})[_0x92e9('0x2d')](respondWithResult(_0x374e38,null))['catch'](handleError(_0x374e38,null));};exports[_0x92e9('0x8e')]=function(_0x2b3d98,_0x32b3da,_0x4d11a8){return db[_0x92e9('0x35')][_0x92e9('0x50')]({'where':{'id':_0x2b3d98['params']['id']}})[_0x92e9('0x2d')](handleEntityNotFound(_0x32b3da,null))[_0x92e9('0x2d')](function(_0x5f42ab){if(_0x5f42ab){return _0x5f42ab[_0x92e9('0x8e')](_0x2b3d98[_0x92e9('0x53')][_0x92e9('0x62')],_['omit'](_0x2b3d98[_0x92e9('0x53')],[_0x92e9('0x62'),'id'])||{})[_0x92e9('0x8f')](function(_0x5a2cc7){for(var _0x56930b=0x0;_0x56930b<_0x2b3d98[_0x92e9('0x53')]['ids'][_0x92e9('0x3f')];_0x56930b+=0x1){socket[_0x92e9('0x90')](_0x92e9('0x91'),{'UserId':Number(_0x2b3d98[_0x92e9('0x53')][_0x92e9('0x62')][_0x56930b]),'CmListId':Number(_0x2b3d98[_0x92e9('0x59')]['id'])});}return _0x5a2cc7;});}})[_0x92e9('0x2d')](respondWithResult(_0x32b3da,null))[_0x92e9('0x51')](handleError(_0x32b3da,null));};exports[_0x92e9('0x92')]=function(_0x5d4dcb,_0x252400,_0x1feae5){return db[_0x92e9('0x35')][_0x92e9('0x50')]({'where':{'id':_0x5d4dcb[_0x92e9('0x59')]['id']}})[_0x92e9('0x2d')](handleEntityNotFound(_0x252400,null))[_0x92e9('0x2d')](function(_0x4181c7){if(_0x4181c7){return _0x4181c7[_0x92e9('0x92')](_0x5d4dcb['query'][_0x92e9('0x62')])[_0x92e9('0x2d')](function(){if(_[_0x92e9('0x65')](_0x5d4dcb[_0x92e9('0x39')][_0x92e9('0x62')])){for(var _0x2d2e8d=0x0;_0x2d2e8d<_0x5d4dcb[_0x92e9('0x39')][_0x92e9('0x62')][_0x92e9('0x3f')];_0x2d2e8d+=0x1){socket[_0x92e9('0x90')](_0x92e9('0x93'),{'UserId':Number(_0x5d4dcb[_0x92e9('0x39')]['ids'][_0x2d2e8d]),'CmListId':Number(_0x5d4dcb[_0x92e9('0x59')]['id'])});}}else{socket[_0x92e9('0x90')](_0x92e9('0x93'),{'UserId':Number(_0x5d4dcb[_0x92e9('0x39')][_0x92e9('0x62')]),'CmListId':Number(_0x5d4dcb['params']['id'])});}});}})['then'](respondWithStatusCode(_0x252400,null))[_0x92e9('0x51')](handleError(_0x252400,null));};exports['getAgents']=function(_0x43010d,_0x359c5d,_0x2621cf){var _0xf08b55={};var _0x4bb544={};var _0x4ea3a9;var _0x4f5228;return db[_0x92e9('0x35')][_0x92e9('0x5e')]({'where':{'id':_0x43010d[_0x92e9('0x59')]['id']}})[_0x92e9('0x2d')](handleEntityNotFound(_0x359c5d,null))[_0x92e9('0x2d')](function(_0x5168d5){if(_0x5168d5){_0x4ea3a9=_0x5168d5;_0x4bb544[_0x92e9('0x3d')]=_[_0x92e9('0x4f')](db['User'][_0x92e9('0x36')]);_0x4bb544[_0x92e9('0x39')]=_[_0x92e9('0x4f')](_0x43010d[_0x92e9('0x39')]);_0x4bb544[_0x92e9('0x3a')]=_[_0x92e9('0x3b')](_0x4bb544['model'],_0x4bb544[_0x92e9('0x39')]);_0xf08b55[_0x92e9('0x3c')]=_['intersection'](_0x4bb544[_0x92e9('0x3d')],qs['fields'](_0x43010d[_0x92e9('0x39')][_0x92e9('0x3e')]));_0xf08b55['attributes']=_0xf08b55[_0x92e9('0x3c')]['length']?_0xf08b55[_0x92e9('0x3c')]:_0x4bb544[_0x92e9('0x3d')];_0xf08b55[_0x92e9('0x5f')]=qs[_0x92e9('0x42')](_0x43010d[_0x92e9('0x39')][_0x92e9('0x42')]);_0xf08b55[_0x92e9('0x43')]=qs[_0x92e9('0x3a')](_[_0x92e9('0x44')](_0x43010d[_0x92e9('0x39')],_0x4bb544[_0x92e9('0x3a')]));if(_0x43010d[_0x92e9('0x39')]['filter']){_0xf08b55[_0x92e9('0x43')]=_[_0x92e9('0x45')](_0xf08b55[_0x92e9('0x43')],{'$or':_['map'](_0xf08b55['attributes'],function(_0x5ae691){var _0x18dd61={};_0x18dd61[_0x5ae691]={'$like':'%'+_0x43010d[_0x92e9('0x39')][_0x92e9('0x48')]+'%'};return _0x18dd61;})});}_0xf08b55=_['merge']({},_0xf08b55,_0x43010d[_0x92e9('0x49')]);return _0x4ea3a9[_0x92e9('0x94')](_0xf08b55);}})[_0x92e9('0x2d')](function(_0x18286f){if(_0x18286f){_0x4f5228=_0x18286f['length'];if(!_0x43010d[_0x92e9('0x39')][_0x92e9('0x40')](_0x92e9('0x41'))){_0xf08b55[_0x92e9('0x25')]=qs[_0x92e9('0x25')](_0x43010d[_0x92e9('0x39')][_0x92e9('0x25')]);_0xf08b55[_0x92e9('0x23')]=qs['offset'](_0x43010d[_0x92e9('0x39')][_0x92e9('0x23')]);}return _0x4ea3a9[_0x92e9('0x94')](_0xf08b55);}})['then'](function(_0x1a4eb1){if(_0x1a4eb1){return _0x1a4eb1?{'count':_0x4f5228,'rows':_0x1a4eb1}:null;}})[_0x92e9('0x2d')](respondWithResult(_0x359c5d,null))[_0x92e9('0x51')](handleError(_0x359c5d,null));}; \ No newline at end of file +var _0x05af=['offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','ListId','Disposition','getDispositions','findOne','nolimit','filter','removeDispositions','ids','CmContact','describe','tags','isArray','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','concat','pick','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','text','TEXT','INTEGER','switch','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x05af,0x70));var _0xf05a=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x05af[_0x3712e2];return _0x1faff4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf05a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf05a('0x1'));var moment=require(_0xf05a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf05a('0x3'));var util=require(_0xf05a('0x4'));var path=require('path');var sox=require(_0xf05a('0x5'));var csv=require(_0xf05a('0x6'));var ejs=require(_0xf05a('0x7'));var fs=require('fs');var fs_extra=require(_0xf05a('0x8'));var _=require(_0xf05a('0x9'));var squel=require(_0xf05a('0xa'));var crypto=require(_0xf05a('0xb'));var jsforce=require(_0xf05a('0xc'));var deskjs=require(_0xf05a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf05a('0xe'));var Papa=require(_0xf05a('0xf'));var Redis=require(_0xf05a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf05a('0x11'));var as=require(_0xf05a('0x12'));var hardwareService=require(_0xf05a('0x13'));var logger=require('../../config/logger')(_0xf05a('0x14'));var utils=require(_0xf05a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf05a('0x16'));var db=require(_0xf05a('0x17'))['db'];config[_0xf05a('0x18')]=_[_0xf05a('0x19')](config[_0xf05a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf05a('0x1a'))(new Redis(config[_0xf05a('0x18')]));require(_0xf05a('0x1b'))[_0xf05a('0x1c')](socket);function respondWithStatusCode(_0x4d05fd,_0x5eaeac){_0x5eaeac=_0x5eaeac||0xcc;return function(_0x4848ea){if(_0x4848ea){return _0x4d05fd[_0xf05a('0x1d')](_0x5eaeac);}return _0x4d05fd['status'](_0x5eaeac)[_0xf05a('0x1e')]();};}function respondWithResult(_0x229d29,_0x886e03){_0x886e03=_0x886e03||0xc8;return function(_0x4934ae){if(_0x4934ae){return _0x229d29[_0xf05a('0x1f')](_0x886e03)[_0xf05a('0x20')](_0x4934ae);}};}function respondWithFilteredResult(_0x5e797c,_0xb41223){return function(_0x52a372){if(_0x52a372){var _0x3de067=typeof _0xb41223[_0xf05a('0x21')]===_0xf05a('0x22')&&typeof _0xb41223[_0xf05a('0x23')]===_0xf05a('0x22');var _0x5b61bf=_0x52a372[_0xf05a('0x24')];var _0x42eb47=_0x3de067?0x0:_0xb41223[_0xf05a('0x21')];var _0x1ea773=_0x3de067?_0x52a372[_0xf05a('0x24')]:_0xb41223['offset']+_0xb41223['limit'];var _0x478b00;if(_0x1ea773>=_0x5b61bf){_0x1ea773=_0x5b61bf;_0x478b00=0xc8;}else{_0x478b00=0xce;}_0x5e797c['status'](_0x478b00);return _0x5e797c[_0xf05a('0x25')](_0xf05a('0x26'),_0x42eb47+'-'+_0x1ea773+'/'+_0x5b61bf)['json'](_0x52a372);}return null;};}function patchUpdates(_0x3d92ab){return function(_0x11a039){try{jsonpatch['apply'](_0x11a039,_0x3d92ab,!![]);}catch(_0x229da3){return BPromise['reject'](_0x229da3);}return _0x11a039[_0xf05a('0x27')]();};}function saveUpdates(_0x1e10d6,_0x4b9a65){return function(_0x451b85){if(_0x451b85){return _0x451b85[_0xf05a('0x28')](_0x1e10d6)[_0xf05a('0x29')](function(_0x3133db){return _0x3133db;});}return null;};}function removeEntity(_0x11993a,_0x1a4970){return function(_0x3d4afc){if(_0x3d4afc){return _0x3d4afc[_0xf05a('0x2a')]()[_0xf05a('0x29')](function(){var _0x1fbfb5=_0x3d4afc[_0xf05a('0x2b')]({'plain':!![]});var _0x1917f3=_0xf05a('0x2c');return db[_0xf05a('0x2d')][_0xf05a('0x2a')]({'where':{'type':_0x1917f3,'resourceId':_0x1fbfb5['id']}})[_0xf05a('0x29')](function(){return _0x3d4afc;});})['then'](function(){_0x11993a[_0xf05a('0x1f')](0xcc)[_0xf05a('0x1e')]();});}};}function handleEntityNotFound(_0x27eb35,_0x18a551){return function(_0x4557ca){if(!_0x4557ca){_0x27eb35[_0xf05a('0x1d')](0x194);}return _0x4557ca;};}function handleError(_0x4a0b13,_0x4c49d8){_0x4c49d8=_0x4c49d8||0x1f4;return function(_0x34f85a){logger[_0xf05a('0x2e')](_0x34f85a[_0xf05a('0x2f')]);if(_0x34f85a[_0xf05a('0x30')]){delete _0x34f85a[_0xf05a('0x30')];}_0x4a0b13[_0xf05a('0x1f')](_0x4c49d8)[_0xf05a('0x31')](_0x34f85a);};}exports[_0xf05a('0x32')]=function(_0xe754ec,_0xa8e41c){var _0x3f6256={},_0x3d6d6d={},_0x31f658={'count':0x0,'rows':[]};var _0x1392e2=_['map'](db[_0xf05a('0x33')][_0xf05a('0x34')],function(_0x31d47d){return{'name':_0x31d47d[_0xf05a('0x35')],'type':_0x31d47d[_0xf05a('0x36')][_0xf05a('0x37')]};});_0x3d6d6d[_0xf05a('0x38')]=_[_0xf05a('0x39')](_0x1392e2,_0xf05a('0x30'));_0x3d6d6d['query']=_[_0xf05a('0x3a')](_0xe754ec[_0xf05a('0x3b')]);_0x3d6d6d[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x3d6d6d[_0xf05a('0x38')],_0x3d6d6d[_0xf05a('0x3b')]);_0x3f6256[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x3d6d6d[_0xf05a('0x38')],qs[_0xf05a('0x3f')](_0xe754ec[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0x3f6256[_0xf05a('0x3e')]=_0x3f6256[_0xf05a('0x3e')][_0xf05a('0x40')]?_0x3f6256[_0xf05a('0x3e')]:_0x3d6d6d[_0xf05a('0x38')];if(!_0xe754ec[_0xf05a('0x3b')][_0xf05a('0x41')]('nolimit')){_0x3f6256['limit']=qs[_0xf05a('0x23')](_0xe754ec[_0xf05a('0x3b')]['limit']);_0x3f6256['offset']=qs[_0xf05a('0x21')](_0xe754ec[_0xf05a('0x3b')][_0xf05a('0x21')]);}_0x3f6256[_0xf05a('0x42')]=qs['sort'](_0xe754ec[_0xf05a('0x3b')][_0xf05a('0x43')]);_0x3f6256[_0xf05a('0x44')]=qs[_0xf05a('0x3c')](_['pick'](_0xe754ec['query'],_0x3d6d6d[_0xf05a('0x3c')]),_0x1392e2);if(_0xe754ec['query']['filter']){_0x3f6256[_0xf05a('0x44')]=_[_0xf05a('0x45')](_0x3f6256[_0xf05a('0x44')],{'$or':_[_0xf05a('0x39')](_0x1392e2,function(_0x9e31c5){if(_0x9e31c5[_0xf05a('0x36')]!=='VIRTUAL'){var _0x5e0d40={};_0x5e0d40[_0x9e31c5['name']]={'$like':'%'+_0xe754ec['query']['filter']+'%'};return _0x5e0d40;}})});}_0x3f6256=_[_0xf05a('0x45')]({},_0x3f6256,_0xe754ec[_0xf05a('0x46')]);var _0x4c9f17={'where':_0x3f6256['where']};return db['CmList'][_0xf05a('0x24')](_0x4c9f17)[_0xf05a('0x29')](function(_0x37fbb3){_0x31f658[_0xf05a('0x24')]=_0x37fbb3;if(_0xe754ec['query'][_0xf05a('0x47')]){_0x3f6256[_0xf05a('0x48')]=[{'all':!![]}];}return db[_0xf05a('0x33')][_0xf05a('0x49')](_0x3f6256);})[_0xf05a('0x29')](function(_0x58b763){_0x31f658[_0xf05a('0x4a')]=_0x58b763;return _0x31f658;})[_0xf05a('0x29')](respondWithFilteredResult(_0xa8e41c,_0x3f6256))[_0xf05a('0x4b')](handleError(_0xa8e41c,null));};exports[_0xf05a('0x4c')]=function(_0x1715e2,_0x32e41f){var _0x458ff6={'raw':![],'where':{'id':_0x1715e2['params']['id']}},_0xdb4463={};_0xdb4463[_0xf05a('0x38')]=_['keys'](db[_0xf05a('0x33')]['rawAttributes']);_0xdb4463['query']=_[_0xf05a('0x3a')](_0x1715e2[_0xf05a('0x3b')]);_0xdb4463[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0xdb4463['model'],_0xdb4463[_0xf05a('0x3b')]);_0x458ff6[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0xdb4463[_0xf05a('0x38')],qs[_0xf05a('0x3f')](_0x1715e2[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0x458ff6[_0xf05a('0x3e')]=_0x458ff6[_0xf05a('0x3e')][_0xf05a('0x40')]?_0x458ff6[_0xf05a('0x3e')]:_0xdb4463[_0xf05a('0x38')];if(_0x1715e2['query'][_0xf05a('0x47')]){_0x458ff6['include']=[{'all':!![]}];}_0x458ff6=_[_0xf05a('0x45')]({},_0x458ff6,_0x1715e2[_0xf05a('0x46')]);return db['CmList']['find'](_0x458ff6)[_0xf05a('0x29')](handleEntityNotFound(_0x32e41f,null))[_0xf05a('0x29')](respondWithResult(_0x32e41f,null))[_0xf05a('0x4b')](handleError(_0x32e41f,null));};exports[_0xf05a('0x4d')]=function(_0x4587b6,_0x21cd1f){return db[_0xf05a('0x33')]['create'](_0x4587b6['body'],{})['then'](function(_0x35325d){var _0x3fc5ab=_0x4587b6[_0xf05a('0x4e')]['get']({'plain':!![]});if(!_0x3fc5ab)throw new Error(_0xf05a('0x4f'));if(_0x3fc5ab[_0xf05a('0x50')]==='user'){var _0x487418=_0x35325d[_0xf05a('0x2b')]({'plain':!![]});var _0x145d30='Lists';return db['UserProfileSection'][_0xf05a('0x51')]({'where':{'name':_0x145d30,'userProfileId':_0x3fc5ab[_0xf05a('0x52')]},'raw':!![]})[_0xf05a('0x29')](function(_0x577b84){if(_0x577b84&&_0x577b84['autoAssociation']===0x0){return db['UserProfileResource'][_0xf05a('0x4d')]({'name':_0x487418[_0xf05a('0x30')],'resourceId':_0x487418['id'],'type':_0x577b84[_0xf05a('0x30')],'sectionId':_0x577b84['id']},{})[_0xf05a('0x29')](function(){return _0x35325d;});}else{return _0x35325d;}})[_0xf05a('0x4b')](function(_0x568eae){logger['error'](_0xf05a('0x53'),_0x568eae);throw _0x568eae;});}return _0x35325d;})[_0xf05a('0x29')](respondWithResult(_0x21cd1f,0xc9))[_0xf05a('0x4b')](handleError(_0x21cd1f,null));};exports[_0xf05a('0x28')]=function(_0x5b01bf,_0x4a52bc){if(_0x5b01bf['body']['id']){delete _0x5b01bf[_0xf05a('0x54')]['id'];}return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x5b01bf[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x4a52bc,null))[_0xf05a('0x29')](saveUpdates(_0x5b01bf['body'],null))['then'](respondWithResult(_0x4a52bc,null))[_0xf05a('0x4b')](handleError(_0x4a52bc,null));};exports[_0xf05a('0x2a')]=function(_0x331088,_0x40e3eb){return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x331088['params']['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x40e3eb,null))[_0xf05a('0x29')](removeEntity(_0x40e3eb,null))[_0xf05a('0x4b')](handleError(_0x40e3eb,null));};exports['describe']=function(_0x14122b,_0x2a2581){return db[_0xf05a('0x33')]['describe']()['then'](respondWithResult(_0x2a2581,null))[_0xf05a('0x4b')](handleError(_0x2a2581,null));};exports['addDisposition']=function(_0x35a30e,_0x1c73b5,_0x4d353f){if(_0x35a30e['body']['id']){delete _0x35a30e[_0xf05a('0x54')]['id'];}return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x35a30e[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x1c73b5,null))[_0xf05a('0x29')](function(_0x562041){if(_0x562041){_0x35a30e[_0xf05a('0x54')][_0xf05a('0x56')]=_0x562041['id'];return db[_0xf05a('0x57')][_0xf05a('0x4d')](_0x35a30e[_0xf05a('0x54')]);}})['then'](respondWithResult(_0x1c73b5,null))['catch'](handleError(_0x1c73b5,null));};exports[_0xf05a('0x58')]=function(_0x4d511a,_0x114d9f,_0x472502){var _0x5d2947={'raw':![],'where':{}};var _0x14b01a={};var _0x5a4a68={'count':0x0,'rows':[]};return db[_0xf05a('0x33')][_0xf05a('0x59')]({'where':{'id':_0x4d511a[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x114d9f,null))[_0xf05a('0x29')](function(_0x3b6a16){if(_0x3b6a16){_0x14b01a[_0xf05a('0x38')]=_[_0xf05a('0x3a')](db[_0xf05a('0x57')][_0xf05a('0x34')]);_0x14b01a[_0xf05a('0x3b')]=_['keys'](_0x4d511a[_0xf05a('0x3b')]);_0x14b01a[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x14b01a[_0xf05a('0x38')],_0x14b01a[_0xf05a('0x3b')]);_0x5d2947[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x14b01a[_0xf05a('0x38')],qs['fields'](_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0x5d2947[_0xf05a('0x3e')]=_0x5d2947['attributes'][_0xf05a('0x40')]?_0x5d2947[_0xf05a('0x3e')]:_0x14b01a[_0xf05a('0x38')];if(!_0x4d511a['query'][_0xf05a('0x41')](_0xf05a('0x5a'))){_0x5d2947['limit']=qs[_0xf05a('0x23')](_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x23')]);_0x5d2947['offset']=qs[_0xf05a('0x21')](_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x21')]);}_0x5d2947[_0xf05a('0x42')]=qs[_0xf05a('0x43')](_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x43')]);_0x5d2947[_0xf05a('0x44')]=qs[_0xf05a('0x3c')](_['pick'](_0x4d511a['query'],_0x14b01a[_0xf05a('0x3c')]));_0x5d2947[_0xf05a('0x44')][_0xf05a('0x56')]=_0x3b6a16['id'];if(_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x5b')]){_0x5d2947[_0xf05a('0x44')]=_[_0xf05a('0x45')](_0x5d2947[_0xf05a('0x44')],{'$or':_[_0xf05a('0x39')](_0x5d2947[_0xf05a('0x3e')],function(_0x4e315e){var _0x1a88ff={};_0x1a88ff[_0x4e315e]={'$like':'%'+_0x4d511a[_0xf05a('0x3b')]['filter']+'%'};return _0x1a88ff;})});}_0x5d2947=_[_0xf05a('0x45')]({},_0x5d2947,_0x4d511a[_0xf05a('0x46')]);return db[_0xf05a('0x57')][_0xf05a('0x24')]({'where':_0x5d2947[_0xf05a('0x44')]})[_0xf05a('0x29')](function(_0xd93881){_0x5a4a68[_0xf05a('0x24')]=_0xd93881;if(_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x47')]){_0x5d2947[_0xf05a('0x48')]=[{'all':!![]}];}return db[_0xf05a('0x57')][_0xf05a('0x49')](_0x5d2947);})[_0xf05a('0x29')](function(_0x2ecdf7){_0x5a4a68[_0xf05a('0x4a')]=_0x2ecdf7;return _0x5a4a68;});}})[_0xf05a('0x29')](respondWithFilteredResult(_0x114d9f,_0x5d2947))['catch'](handleError(_0x114d9f,null));};exports['removeDispositions']=function(_0x19e1bf,_0x429469,_0x19714d){return db[_0xf05a('0x33')]['find']({'where':{'id':_0x19e1bf[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x429469,null))[_0xf05a('0x29')](function(_0x4fa148){if(_0x4fa148){return _0x4fa148[_0xf05a('0x5c')](_0x19e1bf[_0xf05a('0x3b')][_0xf05a('0x5d')]);}})[_0xf05a('0x29')](respondWithStatusCode(_0x429469,null))[_0xf05a('0x4b')](handleError(_0x429469,null));};exports['addContacts']=function(_0x13dd3a,_0x159b3a,_0x4ea87b){return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x13dd3a[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x159b3a,null))[_0xf05a('0x29')](function(_0xdf5a3){if(_0xdf5a3){var _0x17239a=[];var _0x8ec934={'success':[],'errors':[]};return db[_0xf05a('0x5e')][_0xf05a('0x5f')]()['then'](function(_0x3a8197){if(_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x60')]&&_[_0xf05a('0x61')](_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x60')])){if(_0x13dd3a['body'][_0xf05a('0x60')][_0xf05a('0x40')]){_0x13dd3a['body'][_0xf05a('0x60')]=_0x13dd3a[_0xf05a('0x54')]['tags'][_0xf05a('0x62')](';')+';';}else{_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x60')]=null;}}else{_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x60')]=null;}if(_0x13dd3a[_0xf05a('0x54')]&&_[_0xf05a('0x61')](_0x13dd3a[_0xf05a('0x54')])){for(var _0x2974b6=0x0;_0x2974b6<_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x40')];_0x2974b6+=0x1){_0x13dd3a[_0xf05a('0x54')][_0x2974b6][_0xf05a('0x56')]=_0x13dd3a[_0xf05a('0x55')]['id'];_0x17239a[_0xf05a('0x63')](_0x13dd3a[_0xf05a('0x54')][_0x2974b6]);}return BPromise['each'](_0x17239a,function(_0x53e333){return db[_0xf05a('0x5e')][_0xf05a('0x4d')](_[_0xf05a('0x64')](_0x53e333,[_0xf05a('0x5d'),'id'])||{},{'fields':_[_0xf05a('0x3a')](_0x3a8197),'raw':!![]})[_0xf05a('0x29')](function(_0x52e3ce){_0x8ec934[_0xf05a('0x65')]['push'](_0x52e3ce[_0xf05a('0x66')]);})['catch'](function(_0x67746){_0x8ec934[_0xf05a('0x67')]['push']({'data':_0x53e333,'error':_0x67746[_0xf05a('0x68')]});});})[_0xf05a('0x29')](function(_0x3f6455){return _0x8ec934;})[_0xf05a('0x4b')](function(_0x8a5c27){return _0x8a5c27;});}else{_0x159b3a[_0xf05a('0x1f')](0x190)[_0xf05a('0x20')]({'message':_0xf05a('0x69')});}});}})['then'](respondWithResult(_0x159b3a,null))['catch'](handleError(_0x159b3a,null));};exports[_0xf05a('0x6a')]=function(_0x1fd88a,_0x1e9cc3,_0x3f6b6f){var _0x49e935;return db[_0xf05a('0x33')]['find']({'where':{'id':_0x1fd88a['params']['id']},'include':[{'model':db[_0xf05a('0x6b')],'as':_0xf05a('0x6c')}]})[_0xf05a('0x29')](handleEntityNotFound(_0x1e9cc3,null))['then'](function(_0x576f3e){if(_0x576f3e){_0x49e935=_0x576f3e;return db['CmContact'][_0xf05a('0x34')];}})[_0xf05a('0x29')](function(_0x3bd719){if(_0x3bd719){var _0x1c9cce={};var _0x3477d4={};_0x3477d4[_0xf05a('0x38')]=_['concat'](_[_0xf05a('0x3a')](_0x3bd719),_[_0xf05a('0x39')](_0x49e935[_0xf05a('0x6c')],function(_0xa0400f){return util[_0xf05a('0x6d')](_0xf05a('0x6e'),_0xa0400f['id']);}));_0x3477d4[_0xf05a('0x3b')]=_[_0xf05a('0x3a')](_0x1fd88a['query']);_0x3477d4[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x3477d4[_0xf05a('0x38')],_0x3477d4[_0xf05a('0x3b')]);_0x1c9cce[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x3477d4['model'],qs[_0xf05a('0x3f')](_0x1fd88a[_0xf05a('0x3b')]['fields']));_0x1c9cce['attributes']=_0x1c9cce[_0xf05a('0x3e')][_0xf05a('0x40')]?_0x1c9cce[_0xf05a('0x3e')]:_0x3477d4['model'];if(!_0x1fd88a['query'][_0xf05a('0x41')](_0xf05a('0x5a'))){_0x1c9cce[_0xf05a('0x23')]=qs[_0xf05a('0x23')](_0x1fd88a[_0xf05a('0x3b')][_0xf05a('0x23')]);_0x1c9cce['offset']=qs['offset'](_0x1fd88a[_0xf05a('0x3b')]['offset']);}_0x1c9cce['order']=qs[_0xf05a('0x43')](_0x1fd88a[_0xf05a('0x3b')][_0xf05a('0x43')]);_0x1c9cce[_0xf05a('0x44')]=qs[_0xf05a('0x3c')](_['pick'](_0x1fd88a['query'],_0x3477d4[_0xf05a('0x3c')]));_0x1c9cce[_0xf05a('0x6f')]=!![];if(_0x1fd88a[_0xf05a('0x3b')][_0xf05a('0x5b')]){_0x1c9cce[_0xf05a('0x44')]=_[_0xf05a('0x45')](_0x1c9cce[_0xf05a('0x44')],{'$or':_[_0xf05a('0x39')](_0x1c9cce[_0xf05a('0x3e')],function(_0x2a8034){var _0x556f76={};_0x556f76[_0x2a8034]={'$like':'%'+_0x1fd88a[_0xf05a('0x3b')][_0xf05a('0x5b')]+'%'};return _0x556f76;})});}_0x1c9cce=_[_0xf05a('0x45')]({},_0x1c9cce,_0x1fd88a['options']);return _0x49e935[_0xf05a('0x6a')](_0x1c9cce);}})['then'](respondWithResult(_0x1e9cc3,null))[_0xf05a('0x4b')](handleError(_0x1e9cc3,null));};exports[_0xf05a('0x70')]=function(_0x2ce1fe,_0x52bf2a,_0x5451cb){var _0x2b70d5;return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x2ce1fe[_0xf05a('0x55')]['id']},'include':[{'model':db[_0xf05a('0x6b')],'as':'CustomFields'}]})[_0xf05a('0x29')](handleEntityNotFound(_0x52bf2a,null))[_0xf05a('0x29')](function(_0x5987ef){if(_0x5987ef){_0x2b70d5=_0x5987ef;return db['CmContact'][_0xf05a('0x34')];}})[_0xf05a('0x29')](function(_0x30dc9e){if(_0x30dc9e){var _0x9ef79b={};var _0x115d91={};_0x115d91['model']=_[_0xf05a('0x71')](_[_0xf05a('0x3a')](_0x30dc9e),_[_0xf05a('0x39')](_0x2b70d5['CustomFields'],function(_0x4fc538){return util[_0xf05a('0x6d')]('cf_%d',_0x4fc538['id']);}));_0x115d91[_0xf05a('0x3b')]=_[_0xf05a('0x3a')](_0x2ce1fe[_0xf05a('0x3b')]);_0x115d91[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x115d91['model'],_0x115d91[_0xf05a('0x3b')]);_0x9ef79b[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x115d91[_0xf05a('0x38')],qs[_0xf05a('0x3f')](_0x2ce1fe['query'][_0xf05a('0x3f')]));_0x9ef79b['attributes']=_0x9ef79b[_0xf05a('0x3e')][_0xf05a('0x40')]?_0x9ef79b[_0xf05a('0x3e')]:_0x115d91[_0xf05a('0x38')];if(!_0x2ce1fe['query'][_0xf05a('0x41')](_0xf05a('0x5a'))){_0x9ef79b['limit']=qs[_0xf05a('0x23')](_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x23')]);_0x9ef79b[_0xf05a('0x21')]=qs[_0xf05a('0x21')](_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x21')]);}_0x9ef79b['order']=qs[_0xf05a('0x43')](_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x43')]);_0x9ef79b['where']=qs[_0xf05a('0x3c')](_[_0xf05a('0x72')](_0x2ce1fe[_0xf05a('0x3b')],_0x115d91[_0xf05a('0x3c')]));_0x9ef79b['raw']=!![];if(_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x5b')]){_0x9ef79b[_0xf05a('0x44')]=_[_0xf05a('0x45')](_0x9ef79b[_0xf05a('0x44')],{'$or':_['map'](_0x9ef79b[_0xf05a('0x3e')],function(_0xf68fec){var _0x409485={};_0x409485[_0xf68fec]={'$like':'%'+_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x5b')]+'%'};return _0x409485;})});}_0x9ef79b=_[_0xf05a('0x45')]({},_0x9ef79b,_0x2ce1fe[_0xf05a('0x46')]);return _0x2b70d5['getContacts'](_0x9ef79b);}})[_0xf05a('0x29')](function(_0x143070){if(!_[_0xf05a('0x73')](_0x143070)){var _0x39d8a7=toCsv(_0x143070);var _0xc4c1fc=Date[_0xf05a('0x74')]();fs[_0xf05a('0x75')](util[_0xf05a('0x6d')]('/tmp/list_%d_%s.csv',_0x2b70d5['id'],_0xc4c1fc),_0x39d8a7);_0x52bf2a[_0xf05a('0x76')]('Content-disposition',_0xf05a('0x77')+util['format']('list_%d_%s.csv',_0x2b70d5['id'],_0xc4c1fc));_0x52bf2a[_0xf05a('0x76')](_0xf05a('0x78'),_0xf05a('0x79'));return _0x52bf2a[_0xf05a('0x7a')](util[_0xf05a('0x6d')](_0xf05a('0x7b'),_0x2b70d5['id'],_0xc4c1fc));}else{return _0x52bf2a[_0xf05a('0x1d')](0xcc);}})[_0xf05a('0x4b')](handleError(_0x52bf2a,null));};exports[_0xf05a('0x7c')]=function(_0x34d37f,_0x2c20f4,_0x426a39){var _0x23122a;delete _0x34d37f[_0xf05a('0x54')]['id'];return db[_0xf05a('0x33')][_0xf05a('0x59')]({'where':{'id':_0x34d37f[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x2c20f4,null))['then'](function(_0x331401){if(_0x331401){return db[_0xf05a('0x7d')][_0xf05a('0x7e')](function(_0x4d0b59){return db[_0xf05a('0x6b')][_0xf05a('0x4d')](_0x34d37f[_0xf05a('0x54')],{'transaction':_0x4d0b59})[_0xf05a('0x29')](function(_0xea8ead){_0x23122a=_0xea8ead;return _0x331401[_0xf05a('0x7f')](_0xea8ead,{'transaction':_0x4d0b59});})['then'](function(){var _0x2d4757={'type':db['Sequelize']['TEXT'],'transaction':_0x4d0b59};switch(_0x34d37f['body'][_0xf05a('0x36')]){case _0xf05a('0x80'):_0x2d4757[_0xf05a('0x36')]=db['Sequelize'][_0xf05a('0x81')];break;case'number':_0x2d4757['type']=db['Sequelize'][_0xf05a('0x82')];break;case _0xf05a('0x83'):_0x2d4757[_0xf05a('0x36')]=db['Sequelize']['BOOLEAN'];_0x2d4757['defaultValue']=![];break;default:}return db[_0xf05a('0x7d')][_0xf05a('0x84')][_0xf05a('0x85')](_0xf05a('0x86'),util[_0xf05a('0x6d')](_0xf05a('0x87'),_0x23122a['id']),_0x2d4757);})[_0xf05a('0x29')](function(){return _0x23122a;});});}})[_0xf05a('0x29')](respondWithResult(_0x2c20f4,null))[_0xf05a('0x4b')](handleError(_0x2c20f4,null));};exports[_0xf05a('0x88')]=function(_0x465c43,_0x1fbc87,_0x545057){var _0xa6bf2c={};var _0x291684={};var _0xdf3e8c;var _0x156bfd;return db[_0xf05a('0x33')]['findOne']({'where':{'id':_0x465c43[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x1fbc87,null))[_0xf05a('0x29')](function(_0xe63171){if(_0xe63171){_0xdf3e8c=_0xe63171;_0x291684[_0xf05a('0x38')]=_[_0xf05a('0x3a')](db[_0xf05a('0x6b')][_0xf05a('0x34')]);_0x291684[_0xf05a('0x3b')]=_['keys'](_0x465c43[_0xf05a('0x3b')]);_0x291684[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x291684['model'],_0x291684[_0xf05a('0x3b')]);_0xa6bf2c[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x291684['model'],qs['fields'](_0x465c43[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0xa6bf2c[_0xf05a('0x3e')]=_0xa6bf2c[_0xf05a('0x3e')][_0xf05a('0x40')]?_0xa6bf2c[_0xf05a('0x3e')]:_0x291684[_0xf05a('0x38')];_0xa6bf2c['order']=qs['sort'](_0x465c43[_0xf05a('0x3b')][_0xf05a('0x43')]);_0xa6bf2c[_0xf05a('0x44')]=qs['filters'](_[_0xf05a('0x72')](_0x465c43[_0xf05a('0x3b')],_0x291684[_0xf05a('0x3c')]));_0xa6bf2c[_0xf05a('0x44')]=_['merge'](_0xa6bf2c['where'],{'$or':[{'ListId':_0xe63171['id']},{'ListId':null}]});if(_0x465c43[_0xf05a('0x3b')]['filter']){_0xa6bf2c[_0xf05a('0x44')]=_['merge'](_0xa6bf2c[_0xf05a('0x44')],{'$or':_['map'](_0xa6bf2c['attributes'],function(_0x3701e4){var _0x25813c={};_0x25813c[_0x3701e4]={'$like':'%'+_0x465c43[_0xf05a('0x3b')]['filter']+'%'};return _0x25813c;})});}_0xa6bf2c=_['merge']({},_0xa6bf2c,_0x465c43[_0xf05a('0x46')]);return db['CmCustomField'][_0xf05a('0x89')](_0xa6bf2c);}})[_0xf05a('0x29')](respondWithResult(_0x1fbc87,null))['catch'](handleError(_0x1fbc87,null));};exports[_0xf05a('0x8a')]=function(_0x37badd,_0x4c83a4,_0xc1bb94){return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x37badd[_0xf05a('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c83a4,null))[_0xf05a('0x29')](function(_0x4d00ad){if(_0x4d00ad){return _0x4d00ad['addAgents'](_0x37badd['body'][_0xf05a('0x5d')],_[_0xf05a('0x64')](_0x37badd['body'],[_0xf05a('0x5d'),'id'])||{})[_0xf05a('0x8b')](function(_0x218b1d){for(var _0x335873=0x0;_0x335873<_0x37badd[_0xf05a('0x54')][_0xf05a('0x5d')][_0xf05a('0x40')];_0x335873+=0x1){socket['emit'](_0xf05a('0x8c'),{'UserId':Number(_0x37badd[_0xf05a('0x54')][_0xf05a('0x5d')][_0x335873]),'CmListId':Number(_0x37badd[_0xf05a('0x55')]['id'])});}return _0x218b1d;});}})[_0xf05a('0x29')](respondWithResult(_0x4c83a4,null))[_0xf05a('0x4b')](handleError(_0x4c83a4,null));};exports['removeAgents']=function(_0x1f0c3a,_0x28b2dc,_0x3bc0e4){return db[_0xf05a('0x33')]['find']({'where':{'id':_0x1f0c3a[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x28b2dc,null))[_0xf05a('0x29')](function(_0x10efbb){if(_0x10efbb){return _0x10efbb[_0xf05a('0x8d')](_0x1f0c3a['query'][_0xf05a('0x5d')])[_0xf05a('0x29')](function(){if(_['isArray'](_0x1f0c3a[_0xf05a('0x3b')][_0xf05a('0x5d')])){for(var _0xee3953=0x0;_0xee3953<_0x1f0c3a['query']['ids']['length'];_0xee3953+=0x1){socket[_0xf05a('0x8e')](_0xf05a('0x8f'),{'UserId':Number(_0x1f0c3a['query'][_0xf05a('0x5d')][_0xee3953]),'CmListId':Number(_0x1f0c3a[_0xf05a('0x55')]['id'])});}}else{socket['emit'](_0xf05a('0x8f'),{'UserId':Number(_0x1f0c3a[_0xf05a('0x3b')][_0xf05a('0x5d')]),'CmListId':Number(_0x1f0c3a[_0xf05a('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x28b2dc,null))['catch'](handleError(_0x28b2dc,null));};exports[_0xf05a('0x90')]=function(_0x3b6650,_0x594734,_0x4af546){var _0xf6b0fe={};var _0x3ddda5={};var _0x5b5d93;var _0x5b3f2b;return db[_0xf05a('0x33')][_0xf05a('0x59')]({'where':{'id':_0x3b6650['params']['id']}})['then'](handleEntityNotFound(_0x594734,null))[_0xf05a('0x29')](function(_0x445bbf){if(_0x445bbf){_0x5b5d93=_0x445bbf;_0x3ddda5[_0xf05a('0x38')]=_[_0xf05a('0x3a')](db['User']['rawAttributes']);_0x3ddda5[_0xf05a('0x3b')]=_[_0xf05a('0x3a')](_0x3b6650[_0xf05a('0x3b')]);_0x3ddda5['filters']=_['intersection'](_0x3ddda5[_0xf05a('0x38')],_0x3ddda5[_0xf05a('0x3b')]);_0xf6b0fe[_0xf05a('0x3e')]=_['intersection'](_0x3ddda5[_0xf05a('0x38')],qs[_0xf05a('0x3f')](_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0xf6b0fe[_0xf05a('0x3e')]=_0xf6b0fe[_0xf05a('0x3e')][_0xf05a('0x40')]?_0xf6b0fe[_0xf05a('0x3e')]:_0x3ddda5[_0xf05a('0x38')];_0xf6b0fe['order']=qs[_0xf05a('0x43')](_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x43')]);_0xf6b0fe[_0xf05a('0x44')]=qs[_0xf05a('0x3c')](_[_0xf05a('0x72')](_0x3b6650[_0xf05a('0x3b')],_0x3ddda5[_0xf05a('0x3c')]));if(_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x5b')]){_0xf6b0fe['where']=_[_0xf05a('0x45')](_0xf6b0fe['where'],{'$or':_[_0xf05a('0x39')](_0xf6b0fe[_0xf05a('0x3e')],function(_0x55b17e){var _0x2f552c={};_0x2f552c[_0x55b17e]={'$like':'%'+_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x5b')]+'%'};return _0x2f552c;})});}_0xf6b0fe=_[_0xf05a('0x45')]({},_0xf6b0fe,_0x3b6650[_0xf05a('0x46')]);return _0x5b5d93['getAgents'](_0xf6b0fe);}})['then'](function(_0x14dba7){if(_0x14dba7){_0x5b3f2b=_0x14dba7[_0xf05a('0x40')];if(!_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x41')](_0xf05a('0x5a'))){_0xf6b0fe[_0xf05a('0x23')]=qs[_0xf05a('0x23')](_0x3b6650[_0xf05a('0x3b')]['limit']);_0xf6b0fe['offset']=qs[_0xf05a('0x21')](_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x21')]);}return _0x5b5d93[_0xf05a('0x90')](_0xf6b0fe);}})[_0xf05a('0x29')](function(_0x4b9df7){if(_0x4b9df7){return _0x4b9df7?{'count':_0x5b3f2b,'rows':_0x4b9df7}:null;}})['then'](respondWithResult(_0x594734,null))[_0xf05a('0x4b')](handleError(_0x594734,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index d74d28d..307f4da 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 _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x267ef6,_0x2c817d){_0x267ef6=_0x267ef6-0x0;var _0x2dd26f=_0x326f[_0x267ef6];return _0x2dd26f;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0x814b,0x1a2));var _0xb814=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x814b[_0x1b8e60];return _0x363363;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 2af5837..308aa86 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 _0xb821=['rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','../../config/logger','bluebird'];(function(_0x336c8b,_0x292ccb){var _0x46856d=function(_0x16de95){while(--_0x16de95){_0x336c8b['push'](_0x336c8b['shift']());}};_0x46856d(++_0x292ccb);}(_0xb821,0xa7));var _0x1b82=function(_0x310776,_0x5e977c){_0x310776=_0x310776-0x0;var _0x596acf=_0xb821[_0x310776];return _0x596acf;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash'];(function(_0x361ea5,_0x34c89a){var _0x1a6d9b=function(_0x56f417){while(--_0x56f417){_0x361ea5['push'](_0x361ea5['shift']());}};_0x1a6d9b(++_0x34c89a);}(_0xaa88,0x137));var _0x8aa8=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0xaa88[_0x307086];return _0x699043;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('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 f2f8a05..cb0677d 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 _0xa6c6=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','defaults','redis','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','debug','stringify','error'];(function(_0x284807,_0x4be925){var _0x50c774=function(_0xf56cf7){while(--_0xf56cf7){_0x284807['push'](_0x284807['shift']());}};_0x50c774(++_0x4be925);}(_0xa6c6,0xd2));var _0x6a6c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa6c6[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x6a6c('0x0'));var moment=require(_0x6a6c('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a6c('0x2'));var fs=require('fs');var Redis=require(_0x6a6c('0x3'));var db=require(_0x6a6c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6a6c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6a6c('0x6')][_0x6a6c('0x7')]({'port':0x232a});config['redis']=_[_0x6a6c('0x8')](config[_0x6a6c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6a6c('0xa'))(new Redis(config[_0x6a6c('0x9')]));require(_0x6a6c('0xb'))[_0x6a6c('0xc')](socket);function respondWithRpcPromise(_0x2a5b0c,_0x665565,_0x1df099){return new BPromise(function(_0x4f6986,_0x9efbff){return client[_0x6a6c('0xd')](_0x2a5b0c,_0x1df099)[_0x6a6c('0xe')](function(_0x25d997){logger[_0x6a6c('0xf')](_0x6a6c('0x10'),_0x665565,'request\x20sent');logger[_0x6a6c('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x665565,'request\x20sent',JSON[_0x6a6c('0x12')](_0x25d997));if(_0x25d997[_0x6a6c('0x13')]){if(_0x25d997[_0x6a6c('0x13')]['code']===0x1f4){logger[_0x6a6c('0x13')](_0x6a6c('0x10'),_0x665565,_0x25d997[_0x6a6c('0x13')][_0x6a6c('0x14')]);return _0x9efbff(_0x25d997['error'][_0x6a6c('0x14')]);}logger[_0x6a6c('0x13')](_0x6a6c('0x10'),_0x665565,_0x25d997['error'][_0x6a6c('0x14')]);return _0x4f6986(_0x25d997['error'][_0x6a6c('0x14')]);}else{logger[_0x6a6c('0xf')](_0x6a6c('0x10'),_0x665565,'request\x20sent');_0x4f6986(_0x25d997[_0x6a6c('0x15')]['message']);}})[_0x6a6c('0x16')](function(_0x5be93b){logger[_0x6a6c('0x13')]('CmList,\x20%s,\x20%s',_0x665565,_0x5be93b);_0x9efbff(_0x5be93b);});});} \ No newline at end of file +var _0xdedf=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error'];(function(_0x396fcd,_0x2d0edf){var _0x4905b1=function(_0x452604){while(--_0x452604){_0x396fcd['push'](_0x396fcd['shift']());}};_0x4905b1(++_0x2d0edf);}(_0xdedf,0x1b7));var _0xfded=function(_0x40a12a,_0x3340ef){_0x40a12a=_0x40a12a-0x0;var _0x41ed92=_0xdedf[_0x40a12a];return _0x41ed92;};'use strict';var _=require(_0xfded('0x0'));var util=require(_0xfded('0x1'));var moment=require(_0xfded('0x2'));var BPromise=require(_0xfded('0x3'));var rs=require(_0xfded('0x4'));var fs=require('fs');var Redis=require(_0xfded('0x5'));var db=require(_0xfded('0x6'))['db'];var utils=require(_0xfded('0x7'));var logger=require(_0xfded('0x8'))(_0xfded('0x9'));var config=require('../../config/environment');var jayson=require(_0xfded('0xa'));var client=jayson['client'][_0xfded('0xb')]({'port':0x232a});config['redis']=_[_0xfded('0xc')](config['redis'],{'host':_0xfded('0xd'),'port':0x18eb});var socket=require(_0xfded('0xe'))(new Redis(config[_0xfded('0xf')]));require(_0xfded('0x10'))[_0xfded('0x11')](socket);function respondWithRpcPromise(_0x5400d7,_0xe0217,_0x2b076b){return new BPromise(function(_0x2c6dd4,_0x20835a){return client[_0xfded('0x12')](_0x5400d7,_0x2b076b)[_0xfded('0x13')](function(_0x5200c2){logger['info'](_0xfded('0x14'),_0xe0217,_0xfded('0x15'));logger[_0xfded('0x16')](_0xfded('0x17'),_0xe0217,_0xfded('0x15'),JSON['stringify'](_0x5200c2));if(_0x5200c2[_0xfded('0x18')]){if(_0x5200c2[_0xfded('0x18')][_0xfded('0x19')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0xe0217,_0x5200c2[_0xfded('0x18')][_0xfded('0x1a')]);return _0x20835a(_0x5200c2[_0xfded('0x18')]['message']);}logger[_0xfded('0x18')]('CmList,\x20%s,\x20%s',_0xe0217,_0x5200c2[_0xfded('0x18')][_0xfded('0x1a')]);return _0x2c6dd4(_0x5200c2['error']['message']);}else{logger['info'](_0xfded('0x14'),_0xe0217,_0xfded('0x15'));_0x2c6dd4(_0x5200c2[_0xfded('0x1b')][_0xfded('0x1a')]);}})[_0xfded('0x1c')](function(_0x1ca6d3){logger['error'](_0xfded('0x14'),_0xe0217,_0x1ca6d3);_0x20835a(_0x1ca6d3);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index a4750bd..d80402f 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 _0xb71a=['length','cmList:','./cmList.events','remove','register'];(function(_0x11d502,_0x266a72){var _0x5ac03e=function(_0x1f025c){while(--_0x1f025c){_0x11d502['push'](_0x11d502['shift']());}};_0x5ac03e(++_0x266a72);}(_0xb71a,0x1e2));var _0xab71=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xb71a[_0x126fb9];return _0xc8a3b1;};'use strict';var CmListEvents=require(_0xab71('0x0'));var events=['save',_0xab71('0x1'),'update'];function createListener(_0x26cd67,_0x15d4bc){return function(_0x3a44f9){_0x15d4bc['emit'](_0x26cd67,_0x3a44f9);};}function removeListener(_0x4321f7,_0x2d5eea){return function(){CmListEvents['removeListener'](_0x4321f7,_0x2d5eea);};}exports[_0xab71('0x2')]=function(_0x2f210a){for(var _0x5c4a70=0x0,_0x35054e=events[_0xab71('0x3')];_0x5c4a70<_0x35054e;_0x5c4a70++){var _0x392409=events[_0x5c4a70];var _0x17f75d=createListener(_0xab71('0x4')+_0x392409,_0x2f210a);CmListEvents['on'](_0x392409,_0x17f75d);}}; \ No newline at end of file +var _0x94c1=['remove','update','emit','register','length','cmList:','./cmList.events','save'];(function(_0x17b751,_0x28856e){var _0x91c642=function(_0x1ed460){while(--_0x1ed460){_0x17b751['push'](_0x17b751['shift']());}};_0x91c642(++_0x28856e);}(_0x94c1,0x6e));var _0x194c=function(_0x8a61cd,_0x233652){_0x8a61cd=_0x8a61cd-0x0;var _0x1816b6=_0x94c1[_0x8a61cd];return _0x1816b6;};'use strict';var CmListEvents=require(_0x194c('0x0'));var events=[_0x194c('0x1'),_0x194c('0x2'),_0x194c('0x3')];function createListener(_0x458dc4,_0x32963d){return function(_0x9a608d){_0x32963d[_0x194c('0x4')](_0x458dc4,_0x9a608d);};}function removeListener(_0x2f0262,_0x29b71c){return function(){CmListEvents['removeListener'](_0x2f0262,_0x29b71c);};}exports[_0x194c('0x5')]=function(_0x4dc971){for(var _0x48bcaf=0x0,_0x4b7efa=events[_0x194c('0x6')];_0x48bcaf<_0x4b7efa;_0x48bcaf++){var _0x3d3e35=events[_0x48bcaf];var _0x1d26e7=createListener(_0x194c('0x7')+_0x3d3e35,_0x4dc971);CmListEvents['on'](_0x3d3e35,_0x1d26e7);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 21f7cfb..dc7b37e 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 _0x17bd=['put','update','delete','destroy','removeDispositions','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','index','isAuthenticated','describe','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents'];(function(_0x108ea8,_0x462ae7){var _0x388df7=function(_0x20032c){while(--_0x20032c){_0x108ea8['push'](_0x108ea8['shift']());}};_0x388df7(++_0x462ae7);}(_0x17bd,0x19e));var _0xd17b=function(_0x43006e,_0x474149){_0x43006e=_0x43006e-0x0;var _0x16a85d=_0x17bd[_0x43006e];return _0x16a85d;};'use strict';var multer=require(_0xd17b('0x0'));var util=require(_0xd17b('0x1'));var path=require(_0xd17b('0x2'));var timeout=require('connect-timeout');var express=require(_0xd17b('0x3'));var router=express['Router']();var fs_extra=require(_0xd17b('0x4'));var auth=require(_0xd17b('0x5'));var interaction=require(_0xd17b('0x6'));var config=require('../../config/environment');var controller=require(_0xd17b('0x7'));router[_0xd17b('0x8')]('/',auth['isAuthenticated'](),controller[_0xd17b('0x9')]);router[_0xd17b('0x8')]('/describe',auth[_0xd17b('0xa')](),controller[_0xd17b('0xb')]);router[_0xd17b('0x8')](_0xd17b('0xc'),auth['isAuthenticated'](),controller[_0xd17b('0xd')]);router[_0xd17b('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd17b('0xe')]);router[_0xd17b('0x8')](_0xd17b('0xf'),auth['isAuthenticated'](),controller[_0xd17b('0x10')]);router[_0xd17b('0x8')](_0xd17b('0x11'),auth[_0xd17b('0xa')](),controller[_0xd17b('0x12')]);router[_0xd17b('0x8')](_0xd17b('0x13'),auth[_0xd17b('0xa')](),controller['getCustomFields']);router[_0xd17b('0x8')](_0xd17b('0x14'),auth[_0xd17b('0xa')](),controller[_0xd17b('0x15')]);router[_0xd17b('0x16')]('/',auth[_0xd17b('0xa')](),controller['create']);router['post'](_0xd17b('0x17'),auth[_0xd17b('0xa')](),controller[_0xd17b('0x18')]);router['post'](_0xd17b('0xf'),auth[_0xd17b('0xa')](),controller[_0xd17b('0x19')]);router[_0xd17b('0x16')](_0xd17b('0x13'),auth[_0xd17b('0xa')](),controller[_0xd17b('0x1a')]);router['post'](_0xd17b('0x14'),auth[_0xd17b('0xa')](),controller[_0xd17b('0x1b')]);router[_0xd17b('0x1c')](_0xd17b('0xc'),auth[_0xd17b('0xa')](),controller[_0xd17b('0x1d')]);router[_0xd17b('0x1e')]('/:id',auth[_0xd17b('0xa')](),controller[_0xd17b('0x1f')]);router['delete'](_0xd17b('0x17'),auth['isAuthenticated'](),controller[_0xd17b('0x20')]);router[_0xd17b('0x1e')](_0xd17b('0x14'),auth[_0xd17b('0xa')](),controller['removeAgents']);module[_0xd17b('0x21')]=router; \ No newline at end of file +var _0xcb67=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/contacts','getContacts','getContactsCsv','getCustomFields','/:id/users','post','create','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','multer'];(function(_0x1ef7a2,_0x44e828){var _0x80cf67=function(_0xec03df){while(--_0xec03df){_0x1ef7a2['push'](_0x1ef7a2['shift']());}};_0x80cf67(++_0x44e828);}(_0xcb67,0x93));var _0x7cb6=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xcb67[_0x2459fd];return _0x364cd2;};'use strict';var multer=require(_0x7cb6('0x0'));var util=require(_0x7cb6('0x1'));var path=require(_0x7cb6('0x2'));var timeout=require(_0x7cb6('0x3'));var express=require('express');var router=express[_0x7cb6('0x4')]();var fs_extra=require(_0x7cb6('0x5'));var auth=require(_0x7cb6('0x6'));var interaction=require(_0x7cb6('0x7'));var config=require(_0x7cb6('0x8'));var controller=require(_0x7cb6('0x9'));router['get']('/',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0xb')]);router[_0x7cb6('0xc')](_0x7cb6('0xd'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0xe')]);router[_0x7cb6('0xc')](_0x7cb6('0xf'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x10')]);router[_0x7cb6('0xc')]('/:id/dispositions',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x11')]);router[_0x7cb6('0xc')](_0x7cb6('0x12'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x13')]);router[_0x7cb6('0xc')]('/:id/contacts/csv',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x14')]);router[_0x7cb6('0xc')]('/:id/fields',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x15')]);router[_0x7cb6('0xc')](_0x7cb6('0x16'),auth[_0x7cb6('0xa')](),controller['getAgents']);router[_0x7cb6('0x17')]('/',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x18')]);router[_0x7cb6('0x17')](_0x7cb6('0x19'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x1a')]);router[_0x7cb6('0x17')]('/:id/contacts',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x1b')]);router[_0x7cb6('0x17')](_0x7cb6('0x1c'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x1d')]);router['post'](_0x7cb6('0x16'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x1e')]);router['put'](_0x7cb6('0xf'),auth['isAuthenticated'](),controller[_0x7cb6('0x1f')]);router[_0x7cb6('0x20')]('/:id',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x21')]);router[_0x7cb6('0x20')](_0x7cb6('0x19'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x22')]);router['delete'](_0x7cb6('0x16'),auth['isAuthenticated'](),controller[_0x7cb6('0x23')]);module[_0x7cb6('0x24')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index fff065d..4b0f859 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 _0x1578=['getDataValue','STRING','sequelize'];(function(_0xe87e7f,_0x168854){var _0x28065a=function(_0x30dfc4){while(--_0x30dfc4){_0xe87e7f['push'](_0xe87e7f['shift']());}};_0x28065a(++_0x168854);}(_0x1578,0xfb));var _0x8157=function(_0x2c3cef,_0x367039){_0x2c3cef=_0x2c3cef-0x0;var _0x14a804=_0x1578[_0x2c3cef];return _0x14a804;};'use strict';var Sequelize=require(_0x8157('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x202fb1){return this[_0x8157('0x1')]('field');}},'field':{'type':Sequelize[_0x8157('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x8157('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8157('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc757=['STRING','exports','VIRTUAL','getDataValue','field'];(function(_0x58df6c,_0x2c8f1c){var _0x1e3790=function(_0x47f471){while(--_0x47f471){_0x58df6c['push'](_0x58df6c['shift']());}};_0x1e3790(++_0x2c8f1c);}(_0xc757,0x10f));var _0x7c75=function(_0x264664,_0x335c30){_0x264664=_0x264664-0x0;var _0x3fb5ca=_0xc757[_0x264664];return _0x3fb5ca;};'use strict';var Sequelize=require('sequelize');module[_0x7c75('0x0')]={'name':{'type':Sequelize[_0x7c75('0x1')],'get':function(_0x2dd3cb){return this[_0x7c75('0x2')](_0x7c75('0x3'));}},'field':{'type':Sequelize[_0x7c75('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7c75('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7c75('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index baa6c23..b785b1f 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x942514,_0xb76a05){var _0x1459bf=function(_0x607a3f){while(--_0x607a3f){_0x942514['push'](_0x942514['shift']());}};_0x1459bf(++_0xb76a05);}(_0x7a54,0x106));var _0x47a5=function(_0x2f905c,_0x45fdd7){_0x2f905c=_0x2f905c-0x0;var _0x29e43e=_0x7a54[_0x2f905c];return _0x29e43e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x14d6ea,_0x770f63){var _0x538820=function(_0x1cef55){while(--_0x1cef55){_0x14d6ea['push'](_0x14d6ea['shift']());}};_0x538820(++_0x770f63);}(_0x7a54,0x106));var _0x47a5=function(_0x304fe6,_0xaf6c00){_0x304fe6=_0x304fe6-0x0;var _0x483766=_0x7a54[_0x304fe6];return _0x483766;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index df71857..91dfc56 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 _0xd2aa=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes'];(function(_0x193b42,_0x311afb){var _0x1061fb=function(_0x2d32fd){while(--_0x2d32fd){_0x193b42['push'](_0x193b42['shift']());}};_0x1061fb(++_0x311afb);}(_0xd2aa,0x139));var _0xad2a=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0xd2aa[_0x4cee4b];return _0x4d891d;};'use strict';var _=require(_0xad2a('0x0'));var util=require(_0xad2a('0x1'));var logger=require(_0xad2a('0x2'))(_0xad2a('0x3'));var moment=require(_0xad2a('0x4'));var BPromise=require(_0xad2a('0x5'));var rp=require(_0xad2a('0x6'));var fs=require('fs');var path=require(_0xad2a('0x7'));var rimraf=require(_0xad2a('0x8'));var config=require(_0xad2a('0x9'));var attributes=require(_0xad2a('0xa'));module['exports']=function(_0x5e32b0,_0x32277c){return _0x5e32b0[_0xad2a('0xb')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa36e=['define','tools_conditions','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x305832,_0x11b3e0){var _0x127bbd=function(_0x2139f0){while(--_0x2139f0){_0x305832['push'](_0x305832['shift']());}};_0x127bbd(++_0x11b3e0);}(_0xa36e,0x1f1));var _0xea36=function(_0x356a00,_0x5e00c9){_0x356a00=_0x356a00-0x0;var _0x18946f=_0xa36e[_0x356a00];return _0x18946f;};'use strict';var _=require(_0xea36('0x0'));var util=require('util');var logger=require(_0xea36('0x1'))(_0xea36('0x2'));var moment=require(_0xea36('0x3'));var BPromise=require('bluebird');var rp=require(_0xea36('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea36('0x5'));var config=require(_0xea36('0x6'));var attributes=require(_0xea36('0x7'));module[_0xea36('0x8')]=function(_0x11be7e,_0x203392){return _0x11be7e[_0xea36('0x9')]('Condition',attributes,{'tableName':_0xea36('0xa'),'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 bf24cff..f26b3cc 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 _0xfd90=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x1af6a4,_0x5ccef3){var _0x14b3bd=function(_0x1c361a){while(--_0x1c361a){_0x1af6a4['push'](_0x1af6a4['shift']());}};_0x14b3bd(++_0x5ccef3);}(_0xfd90,0xf1));var _0x0fd9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfd90[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0fd9('0x0'));var util=require(_0x0fd9('0x1'));var moment=require(_0x0fd9('0x2'));var BPromise=require(_0x0fd9('0x3'));var rs=require(_0x0fd9('0x4'));var fs=require('fs');var Redis=require(_0x0fd9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fd9('0x6'));var logger=require(_0x0fd9('0x7'))('rpc');var config=require(_0x0fd9('0x8'));var jayson=require(_0x0fd9('0x9'));var client=jayson['client'][_0x0fd9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b64c5,_0x32b791,_0x2aa8be){return new BPromise(function(_0x431245,_0x2c8c02){return client[_0x0fd9('0xb')](_0x1b64c5,_0x2aa8be)[_0x0fd9('0xc')](function(_0x287754){logger[_0x0fd9('0xd')]('Condition,\x20%s,\x20%s',_0x32b791,_0x0fd9('0xe'));logger['debug'](_0x0fd9('0xf'),_0x32b791,_0x0fd9('0xe'),JSON['stringify'](_0x287754));if(_0x287754[_0x0fd9('0x10')]){if(_0x287754[_0x0fd9('0x10')][_0x0fd9('0x11')]===0x1f4){logger[_0x0fd9('0x10')](_0x0fd9('0x12'),_0x32b791,_0x287754['error']['message']);return _0x2c8c02(_0x287754[_0x0fd9('0x10')][_0x0fd9('0x13')]);}logger['error'](_0x0fd9('0x12'),_0x32b791,_0x287754[_0x0fd9('0x10')][_0x0fd9('0x13')]);return _0x431245(_0x287754['error'][_0x0fd9('0x13')]);}else{logger[_0x0fd9('0xd')](_0x0fd9('0x12'),_0x32b791,'request\x20sent');_0x431245(_0x287754[_0x0fd9('0x14')][_0x0fd9('0x13')]);}})[_0x0fd9('0x15')](function(_0x1a59b1){logger['error'](_0x0fd9('0x12'),_0x32b791,_0x1a59b1);_0x2c8c02(_0x1a59b1);});});} \ No newline at end of file +var _0x4e02=['Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0x4e02,0x1ee));var _0x24e0=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x4e02[_0x32d457];return _0x338386;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x24e0('0x0'));var BPromise=require('bluebird');var rs=require(_0x24e0('0x1'));var fs=require('fs');var Redis=require(_0x24e0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x24e0('0x3'));var logger=require(_0x24e0('0x4'))(_0x24e0('0x5'));var config=require(_0x24e0('0x6'));var jayson=require(_0x24e0('0x7'));var client=jayson[_0x24e0('0x8')][_0x24e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x450f12,_0x2de4cc,_0x1d0467){return new BPromise(function(_0x46a0af,_0x168943){return client['request'](_0x450f12,_0x1d0467)[_0x24e0('0xa')](function(_0x4db258){logger[_0x24e0('0xb')](_0x24e0('0xc'),_0x2de4cc,_0x24e0('0xd'));logger[_0x24e0('0xe')](_0x24e0('0xf'),_0x2de4cc,'request\x20sent',JSON[_0x24e0('0x10')](_0x4db258));if(_0x4db258[_0x24e0('0x11')]){if(_0x4db258[_0x24e0('0x11')][_0x24e0('0x12')]===0x1f4){logger[_0x24e0('0x11')]('Condition,\x20%s,\x20%s',_0x2de4cc,_0x4db258[_0x24e0('0x11')]['message']);return _0x168943(_0x4db258[_0x24e0('0x11')][_0x24e0('0x13')]);}logger['error']('Condition,\x20%s,\x20%s',_0x2de4cc,_0x4db258[_0x24e0('0x11')][_0x24e0('0x13')]);return _0x46a0af(_0x4db258[_0x24e0('0x11')][_0x24e0('0x13')]);}else{logger[_0x24e0('0xb')]('Condition,\x20%s,\x20%s',_0x2de4cc,_0x24e0('0xd'));_0x46a0af(_0x4db258[_0x24e0('0x14')][_0x24e0('0x13')]);}})[_0x24e0('0x15')](function(_0x285fc4){logger[_0x24e0('0x11')]('Condition,\x20%s,\x20%s',_0x2de4cc,_0x285fc4);_0x168943(_0x285fc4);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index f15b3cf..90a6e4d 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 _0x5abf=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete'];(function(_0x220eaa,_0x41e066){var _0x211524=function(_0x4518bb){while(--_0x4518bb){_0x220eaa['push'](_0x220eaa['shift']());}};_0x211524(++_0x41e066);}(_0x5abf,0x72));var _0xf5ab=function(_0x102caf,_0x363913){_0x102caf=_0x102caf-0x0;var _0x35a33f=_0x5abf[_0x102caf];return _0x35a33f;};'use strict';var multer=require(_0xf5ab('0x0'));var util=require(_0xf5ab('0x1'));var path=require(_0xf5ab('0x2'));var timeout=require(_0xf5ab('0x3'));var express=require(_0xf5ab('0x4'));var router=express[_0xf5ab('0x5')]();var fs_extra=require(_0xf5ab('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf5ab('0x7'));var config=require(_0xf5ab('0x8'));var controller=require(_0xf5ab('0x9'));router[_0xf5ab('0xa')](_0xf5ab('0xb'),auth['isAuthenticated'](),controller[_0xf5ab('0xc')]);router[_0xf5ab('0xd')](_0xf5ab('0xb'),auth['isAuthenticated'](),controller[_0xf5ab('0xe')]);module[_0xf5ab('0xf')]=router; \ No newline at end of file +var _0xf296=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated'];(function(_0xc08ffe,_0x26f43f){var _0x52c452=function(_0x571984){while(--_0x571984){_0xc08ffe['push'](_0xc08ffe['shift']());}};_0x52c452(++_0x26f43f);}(_0xf296,0x1a8));var _0x6f29=function(_0x504e8c,_0x563d11){_0x504e8c=_0x504e8c-0x0;var _0xcae156=_0xf296[_0x504e8c];return _0xcae156;};'use strict';var multer=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var path=require(_0x6f29('0x2'));var timeout=require(_0x6f29('0x3'));var express=require('express');var router=express[_0x6f29('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6f29('0x5'));var config=require(_0x6f29('0x6'));var controller=require(_0x6f29('0x7'));router[_0x6f29('0x8')](_0x6f29('0x9'),auth[_0x6f29('0xa')](),controller[_0x6f29('0xb')]);router[_0x6f29('0xc')](_0x6f29('0x9'),auth[_0x6f29('0xa')](),controller[_0x6f29('0xd')]);module[_0x6f29('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 6d0fe81..d2c1637 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 _0xbaf0=['name','exports','STRING'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x397484,_0x1a833e){var _0xe1f53d=function(_0x469f36){while(--_0x469f36){_0x397484['push'](_0x397484['shift']());}};_0xe1f53d(++_0x1a833e);}(_0x2032,0xd9));var _0x2203=function(_0x308ea3,_0xbe9c4){_0x308ea3=_0x308ea3-0x0;var _0x5aaaea=_0x2032[_0x308ea3];return _0x5aaaea;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 6fbd99a..ec95037 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 _0x2e30=['./dashboard.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','sendStatus','error','name','send','index','map','Dashboard','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','CustomDashboards','userProfileId','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter'];(function(_0x4f3cd1,_0x4b666e){var _0x4f304d=function(_0x5691ad){while(--_0x5691ad){_0x4f3cd1['push'](_0x4f3cd1['shift']());}};_0x4f304d(++_0x4b666e);}(_0x2e30,0xd9));var _0x02e3=function(_0x26f540,_0x2d43ea){_0x26f540=_0x26f540-0x0;var _0x5dea22=_0x2e30[_0x26f540];return _0x5dea22;};'use strict';var emlformat=require(_0x02e3('0x0'));var rimraf=require(_0x02e3('0x1'));var zipdir=require(_0x02e3('0x2'));var jsonpatch=require(_0x02e3('0x3'));var rp=require(_0x02e3('0x4'));var moment=require(_0x02e3('0x5'));var BPromise=require(_0x02e3('0x6'));var Mustache=require(_0x02e3('0x7'));var util=require('util');var path=require('path');var sox=require(_0x02e3('0x8'));var csv=require(_0x02e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x02e3('0xa'));var _=require(_0x02e3('0xb'));var squel=require(_0x02e3('0xc'));var crypto=require(_0x02e3('0xd'));var jsforce=require(_0x02e3('0xe'));var deskjs=require(_0x02e3('0xf'));var toCsv=require(_0x02e3('0x9'));var querystring=require('querystring');var Papa=require(_0x02e3('0x10'));var Redis=require(_0x02e3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02e3('0x12'));var logger=require(_0x02e3('0x13'))(_0x02e3('0x14'));var utils=require(_0x02e3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x02e3('0x16'));var db=require('../../mysqldb')['db'];config[_0x02e3('0x17')]=_[_0x02e3('0x18')](config[_0x02e3('0x17')],{'host':_0x02e3('0x19'),'port':0x18eb});var socket=require(_0x02e3('0x1a'))(new Redis(config['redis']));require(_0x02e3('0x1b'))['register'](socket);function respondWithStatusCode(_0x1c16ce,_0xf67125){_0xf67125=_0xf67125||0xcc;return function(_0x282162){if(_0x282162){return _0x1c16ce['sendStatus'](_0xf67125);}return _0x1c16ce[_0x02e3('0x1c')](_0xf67125)[_0x02e3('0x1d')]();};}function respondWithResult(_0x49b434,_0x631ab8){_0x631ab8=_0x631ab8||0xc8;return function(_0xb5b9da){if(_0xb5b9da){return _0x49b434[_0x02e3('0x1c')](_0x631ab8)[_0x02e3('0x1e')](_0xb5b9da);}};}function respondWithFilteredResult(_0x243b90,_0x3bbfb0){return function(_0x2e3927){if(_0x2e3927){var _0x406e9f=typeof _0x3bbfb0[_0x02e3('0x1f')]===_0x02e3('0x20')&&typeof _0x3bbfb0['limit']===_0x02e3('0x20');var _0x11c210=_0x2e3927['count'];var _0x472eda=_0x406e9f?0x0:_0x3bbfb0['offset'];var _0x49aefb=_0x406e9f?_0x2e3927[_0x02e3('0x21')]:_0x3bbfb0['offset']+_0x3bbfb0[_0x02e3('0x22')];var _0x249843;if(_0x49aefb>=_0x11c210){_0x49aefb=_0x11c210;_0x249843=0xc8;}else{_0x249843=0xce;}_0x243b90['status'](_0x249843);return _0x243b90[_0x02e3('0x23')](_0x02e3('0x24'),_0x472eda+'-'+_0x49aefb+'/'+_0x11c210)[_0x02e3('0x1e')](_0x2e3927);}return null;};}function patchUpdates(_0x517ee0){return function(_0x16b82d){try{jsonpatch[_0x02e3('0x25')](_0x16b82d,_0x517ee0,!![]);}catch(_0x156e27){return BPromise[_0x02e3('0x26')](_0x156e27);}return _0x16b82d[_0x02e3('0x27')]();};}function saveUpdates(_0x44d96c,_0x373cd7){return function(_0x46e1ad){if(_0x46e1ad){return _0x46e1ad[_0x02e3('0x28')](_0x44d96c)[_0x02e3('0x29')](function(_0x299598){return _0x299598;});}return null;};}function removeEntity(_0x20cd41,_0x137726){return function(_0x2c9687){if(_0x2c9687){return _0x2c9687['destroy']()[_0x02e3('0x29')](function(){var _0x476c82=_0x2c9687['get']({'plain':!![]});var _0x4855b5='CustomDashboards';return db[_0x02e3('0x2a')][_0x02e3('0x2b')]({'where':{'type':_0x4855b5,'resourceId':_0x476c82['id']}})['then'](function(){return _0x2c9687;});})[_0x02e3('0x29')](function(){_0x20cd41[_0x02e3('0x1c')](0xcc)[_0x02e3('0x1d')]();});}};}function handleEntityNotFound(_0x4baa48,_0x49592a){return function(_0x476c4e){if(!_0x476c4e){_0x4baa48[_0x02e3('0x2c')](0x194);}return _0x476c4e;};}function handleError(_0x279c39,_0x517cbf){_0x517cbf=_0x517cbf||0x1f4;return function(_0x3b634e){logger[_0x02e3('0x2d')](_0x3b634e['stack']);if(_0x3b634e['name']){delete _0x3b634e[_0x02e3('0x2e')];}_0x279c39[_0x02e3('0x1c')](_0x517cbf)[_0x02e3('0x2f')](_0x3b634e);};}exports[_0x02e3('0x30')]=function(_0x4a3a06,_0x5e2694){var _0x33c3fd={},_0x433b31={},_0x5b0ad6={'count':0x0,'rows':[]};var _0x525130=_[_0x02e3('0x31')](db[_0x02e3('0x32')][_0x02e3('0x33')],function(_0xd42d42){return{'name':_0xd42d42[_0x02e3('0x34')],'type':_0xd42d42[_0x02e3('0x35')]['key']};});_0x433b31['model']=_['map'](_0x525130,_0x02e3('0x2e'));_0x433b31['query']=_[_0x02e3('0x36')](_0x4a3a06[_0x02e3('0x37')]);_0x433b31[_0x02e3('0x38')]=_[_0x02e3('0x39')](_0x433b31[_0x02e3('0x3a')],_0x433b31[_0x02e3('0x37')]);_0x33c3fd[_0x02e3('0x3b')]=_[_0x02e3('0x39')](_0x433b31[_0x02e3('0x3a')],qs[_0x02e3('0x3c')](_0x4a3a06[_0x02e3('0x37')][_0x02e3('0x3c')]));_0x33c3fd[_0x02e3('0x3b')]=_0x33c3fd[_0x02e3('0x3b')][_0x02e3('0x3d')]?_0x33c3fd['attributes']:_0x433b31[_0x02e3('0x3a')];if(!_0x4a3a06['query'][_0x02e3('0x3e')](_0x02e3('0x3f'))){_0x33c3fd[_0x02e3('0x22')]=qs[_0x02e3('0x22')](_0x4a3a06[_0x02e3('0x37')]['limit']);_0x33c3fd[_0x02e3('0x1f')]=qs[_0x02e3('0x1f')](_0x4a3a06[_0x02e3('0x37')][_0x02e3('0x1f')]);}_0x33c3fd['order']=qs[_0x02e3('0x40')](_0x4a3a06[_0x02e3('0x37')][_0x02e3('0x40')]);_0x33c3fd[_0x02e3('0x41')]=qs[_0x02e3('0x38')](_[_0x02e3('0x42')](_0x4a3a06[_0x02e3('0x37')],_0x433b31[_0x02e3('0x38')]),_0x525130);if(_0x4a3a06[_0x02e3('0x37')][_0x02e3('0x43')]){_0x33c3fd[_0x02e3('0x41')]=_[_0x02e3('0x44')](_0x33c3fd['where'],{'$or':_[_0x02e3('0x31')](_0x525130,function(_0xf795bc){if(_0xf795bc[_0x02e3('0x35')]!==_0x02e3('0x45')){var _0x337a86={};_0x337a86[_0xf795bc[_0x02e3('0x2e')]]={'$like':'%'+_0x4a3a06[_0x02e3('0x37')]['filter']+'%'};return _0x337a86;}})});}_0x33c3fd=_['merge']({},_0x33c3fd,_0x4a3a06[_0x02e3('0x46')]);var _0x51b406={'where':_0x33c3fd[_0x02e3('0x41')]};return db[_0x02e3('0x32')][_0x02e3('0x21')](_0x51b406)['then'](function(_0x4f8512){_0x5b0ad6[_0x02e3('0x21')]=_0x4f8512;if(_0x4a3a06['query'][_0x02e3('0x47')]){_0x33c3fd[_0x02e3('0x48')]=[{'all':!![]}];}return db[_0x02e3('0x32')][_0x02e3('0x49')](_0x33c3fd);})[_0x02e3('0x29')](function(_0x22c239){_0x5b0ad6[_0x02e3('0x4a')]=_0x22c239;return _0x5b0ad6;})[_0x02e3('0x29')](respondWithFilteredResult(_0x5e2694,_0x33c3fd))['catch'](handleError(_0x5e2694,null));};exports[_0x02e3('0x4b')]=function(_0x2eb574,_0x12be7b){var _0xd752fb={'raw':![],'where':{'id':_0x2eb574[_0x02e3('0x4c')]['id']}},_0x37bdd4={};_0x37bdd4[_0x02e3('0x3a')]=_[_0x02e3('0x36')](db['Dashboard'][_0x02e3('0x33')]);_0x37bdd4['query']=_[_0x02e3('0x36')](_0x2eb574['query']);_0x37bdd4[_0x02e3('0x38')]=_['intersection'](_0x37bdd4[_0x02e3('0x3a')],_0x37bdd4[_0x02e3('0x37')]);_0xd752fb[_0x02e3('0x3b')]=_[_0x02e3('0x39')](_0x37bdd4[_0x02e3('0x3a')],qs['fields'](_0x2eb574[_0x02e3('0x37')]['fields']));_0xd752fb[_0x02e3('0x3b')]=_0xd752fb[_0x02e3('0x3b')][_0x02e3('0x3d')]?_0xd752fb[_0x02e3('0x3b')]:_0x37bdd4[_0x02e3('0x3a')];if(_0x2eb574[_0x02e3('0x37')][_0x02e3('0x47')]){_0xd752fb[_0x02e3('0x48')]=[{'all':!![]}];}_0xd752fb=_[_0x02e3('0x44')]({},_0xd752fb,_0x2eb574[_0x02e3('0x46')]);return db['Dashboard'][_0x02e3('0x4d')](_0xd752fb)[_0x02e3('0x29')](handleEntityNotFound(_0x12be7b,null))['then'](respondWithResult(_0x12be7b,null))['catch'](handleError(_0x12be7b,null));};exports[_0x02e3('0x4e')]=function(_0x4682e4,_0x5098eb){return db[_0x02e3('0x32')]['create'](_0x4682e4[_0x02e3('0x4f')],{})[_0x02e3('0x29')](function(_0xabe42c){var _0x42cd65=_0x4682e4[_0x02e3('0x50')]['get']({'plain':!![]});if(!_0x42cd65)throw new Error(_0x02e3('0x51'));if(_0x42cd65[_0x02e3('0x52')]===_0x02e3('0x50')){var _0x46f669=_0xabe42c[_0x02e3('0x53')]({'plain':!![]});var _0x514011='CustomDashboards';return db[_0x02e3('0x54')][_0x02e3('0x4d')]({'where':{'name':_0x514011,'userProfileId':_0x42cd65['userProfileId']},'raw':!![]})['then'](function(_0x269792){if(_0x269792&&_0x269792['autoAssociation']===0x0){return db['UserProfileResource'][_0x02e3('0x4e')]({'name':_0x46f669['name'],'resourceId':_0x46f669['id'],'type':_0x269792[_0x02e3('0x2e')],'sectionId':_0x269792['id']},{})[_0x02e3('0x29')](function(){return _0xabe42c;});}else{return _0xabe42c;}})[_0x02e3('0x55')](function(_0x2f253e){logger[_0x02e3('0x2d')](_0x02e3('0x56'),_0x2f253e);throw _0x2f253e;});}return _0xabe42c;})[_0x02e3('0x29')](respondWithResult(_0x5098eb,0xc9))[_0x02e3('0x55')](handleError(_0x5098eb,null));};exports[_0x02e3('0x57')]=function(_0x1925ea,_0x2daf25){var _0x17a278={'where':{'id':_0x1925ea[_0x02e3('0x4c')]['id']}},_0x4e3f0f={};_0x4e3f0f[_0x02e3('0x3a')]=_[_0x02e3('0x36')](db['Dashboard'][_0x02e3('0x33')]);_0x17a278['attributes']=_['intersection'](_0x4e3f0f[_0x02e3('0x3a')],qs[_0x02e3('0x3c')](_0x1925ea['query'][_0x02e3('0x3c')]));_0x17a278[_0x02e3('0x3b')]=_0x17a278[_0x02e3('0x3b')][_0x02e3('0x3d')]?_0x17a278[_0x02e3('0x3b')]:_0x4e3f0f[_0x02e3('0x3a')];if(_0x1925ea[_0x02e3('0x37')][_0x02e3('0x47')]){_0x17a278[_0x02e3('0x48')]=[{'all':!![]}];}_0x17a278=_[_0x02e3('0x44')]({},_0x17a278,_0x1925ea['options']);return db[_0x02e3('0x32')][_0x02e3('0x4d')](_0x17a278)[_0x02e3('0x29')](handleEntityNotFound(_0x2daf25,null))[_0x02e3('0x29')](function(_0x10dec3){if(_0x10dec3){var _0x387fae=_0x10dec3[_0x02e3('0x53')]({'plain':!![]});_0x387fae=qs['omit'](_0x387fae,['id','createdAt',_0x02e3('0x58')]);_0x1925ea['body']=_[_0x02e3('0x59')](_0x1925ea['body'],['id',_0x02e3('0x5a'),_0x02e3('0x58')]);return db[_0x02e3('0x32')][_0x02e3('0x4e')](_[_0x02e3('0x44')](_0x387fae,_0x1925ea[_0x02e3('0x4f')]),{'include':_0x1925ea['query'][_0x02e3('0x47')]?[{'all':!![]}]:undefined})[_0x02e3('0x29')](function(_0x229082){var _0x4372a7=_0x1925ea[_0x02e3('0x50')][_0x02e3('0x53')]({'plain':!![]});if(!_0x4372a7)throw new Error(_0x02e3('0x51'));if(_0x4372a7[_0x02e3('0x52')]===_0x02e3('0x50')){var _0x5906a3=_0x229082[_0x02e3('0x53')]({'plain':!![]});var _0x476953=_0x02e3('0x5b');return db[_0x02e3('0x54')][_0x02e3('0x4d')]({'where':{'name':_0x476953,'userProfileId':_0x4372a7[_0x02e3('0x5c')]},'raw':!![]})['then'](function(_0xc4bbd0){if(_0xc4bbd0&&_0xc4bbd0['autoAssociation']===0x0){return db['UserProfileResource'][_0x02e3('0x4e')]({'name':_0x5906a3['name'],'resourceId':_0x5906a3['id'],'type':_0xc4bbd0[_0x02e3('0x2e')],'sectionId':_0xc4bbd0['id']},{})['then'](function(){return _0x229082;});}else{return _0x229082;}})[_0x02e3('0x55')](function(_0x2f9a72){logger[_0x02e3('0x2d')](_0x02e3('0x56'),_0x2f9a72);throw _0x2f9a72;});}return _0x229082;});}})['then'](respondWithResult(_0x2daf25,0xc9))[_0x02e3('0x55')](handleError(_0x2daf25,null));};exports[_0x02e3('0x28')]=function(_0x13640f,_0x4c9904){if(_0x13640f['body']['id']){delete _0x13640f[_0x02e3('0x4f')]['id'];}return db[_0x02e3('0x32')][_0x02e3('0x4d')]({'where':{'id':_0x13640f[_0x02e3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c9904,null))[_0x02e3('0x29')](saveUpdates(_0x13640f[_0x02e3('0x4f')],null))[_0x02e3('0x29')](respondWithResult(_0x4c9904,null))[_0x02e3('0x55')](handleError(_0x4c9904,null));};exports[_0x02e3('0x2b')]=function(_0x400ce5,_0x5d04b4){return db['Dashboard'][_0x02e3('0x4d')]({'where':{'id':_0x400ce5['params']['id']}})[_0x02e3('0x29')](handleEntityNotFound(_0x5d04b4,null))[_0x02e3('0x29')](removeEntity(_0x5d04b4,null))[_0x02e3('0x55')](handleError(_0x5d04b4,null));};function widgetAttributes(_0x2e8571){try{switch(_0x2e8571[_0x02e3('0x35')]){case _0x02e3('0x5d'):return[{'name':'attrUrl','value':_0x2e8571[_0x02e3('0x5e')]||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571['attrs'][0x0]?_0x2e8571[_0x02e3('0x5f')][0x0][_0x02e3('0x60')]:undefined)||'https://'}];case'custom':return[{'name':_0x02e3('0x61'),'value':_0x2e8571[_0x02e3('0x61')]||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571[_0x02e3('0x5f')][0x0]?_0x2e8571['attrs'][0x0][_0x02e3('0x60')]:undefined)||''}];case _0x02e3('0x62'):return[{'name':_0x02e3('0x63'),'value':_0x2e8571[_0x02e3('0x63')]||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571['attrs'][0x0]?_0x2e8571['attrs'][0x0][_0x02e3('0x60')]:undefined)||_0x02e3('0x64')},{'name':_0x02e3('0x65'),'value':_0x2e8571[_0x02e3('0x65')]||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571[_0x02e3('0x5f')][0x1]?_0x2e8571[_0x02e3('0x5f')][0x1]['value']:undefined)||_0x02e3('0x66')},{'name':_0x02e3('0x67'),'value':_0x2e8571['attrFontSize']||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571[_0x02e3('0x5f')][0x2]?_0x2e8571[_0x02e3('0x5f')][0x2][_0x02e3('0x60')]:undefined)||0xc}];case _0x02e3('0x68'):return[{'name':'attrMetric','value':_0x2e8571[_0x02e3('0x69')]||(_0x2e8571['attrs']&&_0x2e8571[_0x02e3('0x5f')][0x0]?_0x2e8571[_0x02e3('0x5f')][0x0][_0x02e3('0x60')]:undefined)||_0x02e3('0x6a')},{'name':_0x02e3('0x6b'),'value':_0x2e8571['attrVoiceQueues']||(_0x2e8571['attrs']&&_0x2e8571[_0x02e3('0x5f')][0x1]?_0x2e8571[_0x02e3('0x5f')][0x1][_0x02e3('0x60')]:undefined)||[]},{'name':_0x02e3('0x67'),'value':_0x2e8571[_0x02e3('0x67')]||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571[_0x02e3('0x5f')][0x2]?_0x2e8571[_0x02e3('0x5f')][0x2]['value']:undefined)||0x14}];case _0x02e3('0x6c'):case _0x02e3('0x6d'):return[{'name':_0x02e3('0x6e'),'value':_0x2e8571[_0x02e3('0x6e')]||(_0x2e8571['attrs']&&_0x2e8571[_0x02e3('0x5f')][0x0]?_0x2e8571['attrs'][0x0][_0x02e3('0x60')]:undefined)||'total'},{'name':_0x02e3('0x6f'),'value':_0x2e8571['attrSerie2']||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571[_0x02e3('0x5f')][0x1]?_0x2e8571[_0x02e3('0x5f')][0x1][_0x02e3('0x60')]:undefined)||null},{'name':'attrSerie3','value':_0x2e8571[_0x02e3('0x70')]||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571['attrs'][0x2]?_0x2e8571[_0x02e3('0x5f')][0x2][_0x02e3('0x60')]:undefined)||null},{'name':_0x02e3('0x6b'),'value':_0x2e8571[_0x02e3('0x6b')]||(_0x2e8571['attrs']&&_0x2e8571[_0x02e3('0x5f')][0x3]?_0x2e8571[_0x02e3('0x5f')][0x3][_0x02e3('0x60')]:undefined)||[]}];case _0x02e3('0x71'):return[{'name':'attrReport','type':_0x2e8571[_0x02e3('0x72')]||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571[_0x02e3('0x5f')][0x0]?_0x2e8571[_0x02e3('0x5f')][0x0][_0x02e3('0x35')]:undefined)||null,'value':_0x2e8571[_0x02e3('0x73')]||(_0x2e8571['attrs']&&_0x2e8571[_0x02e3('0x5f')][0x0]?_0x2e8571[_0x02e3('0x5f')][0x0]['value']:undefined)||null},{'name':_0x02e3('0x74'),'value':_0x2e8571[_0x02e3('0x74')]||(_0x2e8571[_0x02e3('0x5f')]&&_0x2e8571[_0x02e3('0x5f')][0x1]?_0x2e8571['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4afa7a){logger[_0x02e3('0x2d')](_0x02e3('0x75'),JSON[_0x02e3('0x76')](_0x4afa7a));return[];}}exports['addItem']=function(_0x5920bb,_0x1c7078,_0x1e658d){if(_0x5920bb[_0x02e3('0x4f')]['id']){delete _0x5920bb['body']['id'];}return db[_0x02e3('0x32')][_0x02e3('0x4d')]({'where':{'id':_0x5920bb[_0x02e3('0x4c')]['id']}})[_0x02e3('0x29')](handleEntityNotFound(_0x1c7078,null))[_0x02e3('0x29')](function(_0x421282){if(_0x421282){_0x5920bb[_0x02e3('0x4f')]['DashboardId']=_0x421282['id'];_0x5920bb[_0x02e3('0x4f')][_0x02e3('0x5f')]=widgetAttributes(_0x5920bb[_0x02e3('0x4f')]);return db[_0x02e3('0x77')][_0x02e3('0x4e')](_0x5920bb[_0x02e3('0x4f')]);}})['then'](respondWithResult(_0x1c7078,null))['catch'](handleError(_0x1c7078,null));};exports[_0x02e3('0x78')]=function(_0x1aedb6,_0x1ee06c,_0x52ddcb){var _0x2c783f={};var _0x12ccfd={};var _0x388737;var _0x232151;return db['Dashboard'][_0x02e3('0x79')]({'where':{'id':_0x1aedb6[_0x02e3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ee06c,null))[_0x02e3('0x29')](function(_0xc672de){if(_0xc672de){_0x388737=_0xc672de;_0x12ccfd['model']=_[_0x02e3('0x36')](db[_0x02e3('0x77')][_0x02e3('0x33')]);_0x12ccfd[_0x02e3('0x37')]=_[_0x02e3('0x36')](_0x1aedb6[_0x02e3('0x37')]);_0x12ccfd['filters']=_['intersection'](_0x12ccfd[_0x02e3('0x3a')],_0x12ccfd[_0x02e3('0x37')]);_0x2c783f[_0x02e3('0x3b')]=_[_0x02e3('0x39')](_0x12ccfd[_0x02e3('0x3a')],qs[_0x02e3('0x3c')](_0x1aedb6['query'][_0x02e3('0x3c')]));_0x2c783f['attributes']=_0x2c783f[_0x02e3('0x3b')][_0x02e3('0x3d')]?_0x2c783f['attributes']:_0x12ccfd[_0x02e3('0x3a')];_0x2c783f['order']=qs[_0x02e3('0x40')](_0x1aedb6['query']['sort']);_0x2c783f[_0x02e3('0x41')]=qs['filters'](_['pick'](_0x1aedb6[_0x02e3('0x37')],_0x12ccfd[_0x02e3('0x38')]));if(_0x1aedb6['query'][_0x02e3('0x43')]){_0x2c783f[_0x02e3('0x41')]=_[_0x02e3('0x44')](_0x2c783f[_0x02e3('0x41')],{'$or':_[_0x02e3('0x31')](_0x2c783f['attributes'],function(_0x4007fc){var _0x488b64={};_0x488b64[_0x4007fc]={'$like':'%'+_0x1aedb6[_0x02e3('0x37')][_0x02e3('0x43')]+'%'};return _0x488b64;})});}_0x2c783f=_['merge']({},_0x2c783f,_0x1aedb6[_0x02e3('0x46')]);return _0x388737[_0x02e3('0x78')](_0x2c783f);}})['then'](function(_0x5854b4){if(_0x5854b4){_0x232151=_0x5854b4[_0x02e3('0x3d')];if(!_0x1aedb6[_0x02e3('0x37')][_0x02e3('0x3e')](_0x02e3('0x3f'))){_0x2c783f[_0x02e3('0x22')]=qs[_0x02e3('0x22')](_0x1aedb6[_0x02e3('0x37')]['limit']);_0x2c783f[_0x02e3('0x1f')]=qs[_0x02e3('0x1f')](_0x1aedb6[_0x02e3('0x37')][_0x02e3('0x1f')]);}return _0x388737[_0x02e3('0x78')](_0x2c783f);}})[_0x02e3('0x29')](function(_0x2894ad){if(_0x2894ad){return _0x2894ad?{'count':_0x232151,'rows':_0x2894ad}:null;}})[_0x02e3('0x29')](respondWithResult(_0x1ee06c,null))[_0x02e3('0x55')](handleError(_0x1ee06c,null));}; \ No newline at end of file +var _0x0cd2=['redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','get','CustomDashboards','error','stack','name','index','map','Dashboard','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util'];(function(_0x91d9f1,_0x2ace8d){var _0x539d87=function(_0x5180a8){while(--_0x5180a8){_0x91d9f1['push'](_0x91d9f1['shift']());}};_0x539d87(++_0x2ace8d);}(_0x0cd2,0x1cb));var _0x20cd=function(_0x4acdf,_0x480f4c){_0x4acdf=_0x4acdf-0x0;var _0x3a5423=_0x0cd2[_0x4acdf];return _0x3a5423;};'use strict';var emlformat=require(_0x20cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x20cd('0x1'));var rp=require(_0x20cd('0x2'));var moment=require(_0x20cd('0x3'));var BPromise=require(_0x20cd('0x4'));var Mustache=require('mustache');var util=require(_0x20cd('0x5'));var path=require(_0x20cd('0x6'));var sox=require('sox');var csv=require(_0x20cd('0x7'));var ejs=require(_0x20cd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20cd('0x9'));var squel=require(_0x20cd('0xa'));var crypto=require(_0x20cd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x20cd('0xc'));var toCsv=require(_0x20cd('0x7'));var querystring=require('querystring');var Papa=require(_0x20cd('0xd'));var Redis=require(_0x20cd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x20cd('0xf'));var as=require(_0x20cd('0x10'));var hardwareService=require(_0x20cd('0x11'));var logger=require('../../config/logger')(_0x20cd('0x12'));var utils=require(_0x20cd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x20cd('0x14'));var db=require('../../mysqldb')['db'];config[_0x20cd('0x15')]=_[_0x20cd('0x16')](config[_0x20cd('0x15')],{'host':_0x20cd('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x20cd('0x18')](socket);function respondWithStatusCode(_0x5ad831,_0x301cc8){_0x301cc8=_0x301cc8||0xcc;return function(_0x5f6151){if(_0x5f6151){return _0x5ad831[_0x20cd('0x19')](_0x301cc8);}return _0x5ad831[_0x20cd('0x1a')](_0x301cc8)['end']();};}function respondWithResult(_0x41e4b3,_0x1d105c){_0x1d105c=_0x1d105c||0xc8;return function(_0x183f85){if(_0x183f85){return _0x41e4b3[_0x20cd('0x1a')](_0x1d105c)[_0x20cd('0x1b')](_0x183f85);}};}function respondWithFilteredResult(_0x1a6d46,_0x582df2){return function(_0x26135b){if(_0x26135b){var _0x5e0237=typeof _0x582df2[_0x20cd('0x1c')]===_0x20cd('0x1d')&&typeof _0x582df2['limit']===_0x20cd('0x1d');var _0x7916af=_0x26135b[_0x20cd('0x1e')];var _0x291072=_0x5e0237?0x0:_0x582df2['offset'];var _0x19fadb=_0x5e0237?_0x26135b[_0x20cd('0x1e')]:_0x582df2[_0x20cd('0x1c')]+_0x582df2['limit'];var _0x50e536;if(_0x19fadb>=_0x7916af){_0x19fadb=_0x7916af;_0x50e536=0xc8;}else{_0x50e536=0xce;}_0x1a6d46[_0x20cd('0x1a')](_0x50e536);return _0x1a6d46[_0x20cd('0x1f')](_0x20cd('0x20'),_0x291072+'-'+_0x19fadb+'/'+_0x7916af)[_0x20cd('0x1b')](_0x26135b);}return null;};}function patchUpdates(_0x4c1c49){return function(_0x4ee728){try{jsonpatch['apply'](_0x4ee728,_0x4c1c49,!![]);}catch(_0x5a0617){return BPromise[_0x20cd('0x21')](_0x5a0617);}return _0x4ee728['save']();};}function saveUpdates(_0x2231f1,_0xaa3c7e){return function(_0x54b2cd){if(_0x54b2cd){return _0x54b2cd[_0x20cd('0x22')](_0x2231f1)[_0x20cd('0x23')](function(_0x103931){return _0x103931;});}return null;};}function removeEntity(_0x21a563,_0x2264c0){return function(_0x319095){if(_0x319095){return _0x319095[_0x20cd('0x24')]()['then'](function(){var _0x31c773=_0x319095[_0x20cd('0x25')]({'plain':!![]});var _0x2651e9=_0x20cd('0x26');return db['UserProfileResource'][_0x20cd('0x24')]({'where':{'type':_0x2651e9,'resourceId':_0x31c773['id']}})['then'](function(){return _0x319095;});})[_0x20cd('0x23')](function(){_0x21a563['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x506d7,_0x2364b4){return function(_0x2ac336){if(!_0x2ac336){_0x506d7[_0x20cd('0x19')](0x194);}return _0x2ac336;};}function handleError(_0x332372,_0x5309ed){_0x5309ed=_0x5309ed||0x1f4;return function(_0x87e4b2){logger[_0x20cd('0x27')](_0x87e4b2[_0x20cd('0x28')]);if(_0x87e4b2[_0x20cd('0x29')]){delete _0x87e4b2[_0x20cd('0x29')];}_0x332372['status'](_0x5309ed)['send'](_0x87e4b2);};}exports[_0x20cd('0x2a')]=function(_0x40469b,_0x527e57){var _0x1b3302={},_0x4fc02a={},_0x4a6f7b={'count':0x0,'rows':[]};var _0x23027c=_[_0x20cd('0x2b')](db[_0x20cd('0x2c')]['rawAttributes'],function(_0x1f38f9){return{'name':_0x1f38f9[_0x20cd('0x2d')],'type':_0x1f38f9[_0x20cd('0x2e')]['key']};});_0x4fc02a['model']=_[_0x20cd('0x2b')](_0x23027c,_0x20cd('0x29'));_0x4fc02a['query']=_[_0x20cd('0x2f')](_0x40469b[_0x20cd('0x30')]);_0x4fc02a[_0x20cd('0x31')]=_['intersection'](_0x4fc02a[_0x20cd('0x32')],_0x4fc02a[_0x20cd('0x30')]);_0x1b3302[_0x20cd('0x33')]=_[_0x20cd('0x34')](_0x4fc02a[_0x20cd('0x32')],qs[_0x20cd('0x35')](_0x40469b[_0x20cd('0x30')][_0x20cd('0x35')]));_0x1b3302[_0x20cd('0x33')]=_0x1b3302['attributes'][_0x20cd('0x36')]?_0x1b3302[_0x20cd('0x33')]:_0x4fc02a[_0x20cd('0x32')];if(!_0x40469b['query'][_0x20cd('0x37')](_0x20cd('0x38'))){_0x1b3302['limit']=qs[_0x20cd('0x39')](_0x40469b[_0x20cd('0x30')][_0x20cd('0x39')]);_0x1b3302[_0x20cd('0x1c')]=qs['offset'](_0x40469b['query']['offset']);}_0x1b3302['order']=qs[_0x20cd('0x3a')](_0x40469b[_0x20cd('0x30')]['sort']);_0x1b3302[_0x20cd('0x3b')]=qs[_0x20cd('0x31')](_[_0x20cd('0x3c')](_0x40469b[_0x20cd('0x30')],_0x4fc02a['filters']),_0x23027c);if(_0x40469b[_0x20cd('0x30')][_0x20cd('0x3d')]){_0x1b3302[_0x20cd('0x3b')]=_['merge'](_0x1b3302[_0x20cd('0x3b')],{'$or':_['map'](_0x23027c,function(_0x46446d){if(_0x46446d[_0x20cd('0x2e')]!==_0x20cd('0x3e')){var _0x228c7b={};_0x228c7b[_0x46446d[_0x20cd('0x29')]]={'$like':'%'+_0x40469b[_0x20cd('0x30')][_0x20cd('0x3d')]+'%'};return _0x228c7b;}})});}_0x1b3302=_[_0x20cd('0x3f')]({},_0x1b3302,_0x40469b[_0x20cd('0x40')]);var _0x2f3963={'where':_0x1b3302['where']};return db[_0x20cd('0x2c')]['count'](_0x2f3963)[_0x20cd('0x23')](function(_0x29ea29){_0x4a6f7b[_0x20cd('0x1e')]=_0x29ea29;if(_0x40469b[_0x20cd('0x30')]['includeAll']){_0x1b3302['include']=[{'all':!![]}];}return db[_0x20cd('0x2c')][_0x20cd('0x41')](_0x1b3302);})[_0x20cd('0x23')](function(_0x1ca473){_0x4a6f7b[_0x20cd('0x42')]=_0x1ca473;return _0x4a6f7b;})[_0x20cd('0x23')](respondWithFilteredResult(_0x527e57,_0x1b3302))[_0x20cd('0x43')](handleError(_0x527e57,null));};exports['show']=function(_0x4fe634,_0x9aeb45){var _0x46a751={'raw':![],'where':{'id':_0x4fe634[_0x20cd('0x44')]['id']}},_0x1cdec8={};_0x1cdec8[_0x20cd('0x32')]=_['keys'](db[_0x20cd('0x2c')][_0x20cd('0x45')]);_0x1cdec8['query']=_[_0x20cd('0x2f')](_0x4fe634['query']);_0x1cdec8[_0x20cd('0x31')]=_[_0x20cd('0x34')](_0x1cdec8[_0x20cd('0x32')],_0x1cdec8[_0x20cd('0x30')]);_0x46a751[_0x20cd('0x33')]=_[_0x20cd('0x34')](_0x1cdec8[_0x20cd('0x32')],qs[_0x20cd('0x35')](_0x4fe634[_0x20cd('0x30')][_0x20cd('0x35')]));_0x46a751[_0x20cd('0x33')]=_0x46a751['attributes'][_0x20cd('0x36')]?_0x46a751[_0x20cd('0x33')]:_0x1cdec8[_0x20cd('0x32')];if(_0x4fe634[_0x20cd('0x30')][_0x20cd('0x46')]){_0x46a751['include']=[{'all':!![]}];}_0x46a751=_[_0x20cd('0x3f')]({},_0x46a751,_0x4fe634['options']);return db[_0x20cd('0x2c')][_0x20cd('0x47')](_0x46a751)[_0x20cd('0x23')](handleEntityNotFound(_0x9aeb45,null))[_0x20cd('0x23')](respondWithResult(_0x9aeb45,null))[_0x20cd('0x43')](handleError(_0x9aeb45,null));};exports[_0x20cd('0x48')]=function(_0x5b7ed0,_0x491535){return db[_0x20cd('0x2c')][_0x20cd('0x48')](_0x5b7ed0[_0x20cd('0x49')],{})[_0x20cd('0x23')](function(_0x502281){var _0x5502d9=_0x5b7ed0[_0x20cd('0x4a')]['get']({'plain':!![]});if(!_0x5502d9)throw new Error(_0x20cd('0x4b'));if(_0x5502d9[_0x20cd('0x4c')]===_0x20cd('0x4a')){var _0x1b221e=_0x502281[_0x20cd('0x25')]({'plain':!![]});var _0x16d962=_0x20cd('0x26');return db[_0x20cd('0x4d')][_0x20cd('0x47')]({'where':{'name':_0x16d962,'userProfileId':_0x5502d9[_0x20cd('0x4e')]},'raw':!![]})[_0x20cd('0x23')](function(_0x2c969b){if(_0x2c969b&&_0x2c969b[_0x20cd('0x4f')]===0x0){return db[_0x20cd('0x50')][_0x20cd('0x48')]({'name':_0x1b221e[_0x20cd('0x29')],'resourceId':_0x1b221e['id'],'type':_0x2c969b[_0x20cd('0x29')],'sectionId':_0x2c969b['id']},{})[_0x20cd('0x23')](function(){return _0x502281;});}else{return _0x502281;}})[_0x20cd('0x43')](function(_0x40ade6){logger['error'](_0x20cd('0x51'),_0x40ade6);throw _0x40ade6;});}return _0x502281;})['then'](respondWithResult(_0x491535,0xc9))[_0x20cd('0x43')](handleError(_0x491535,null));};exports[_0x20cd('0x52')]=function(_0xfb547c,_0xaa2a72){var _0x1f4998={'where':{'id':_0xfb547c[_0x20cd('0x44')]['id']}},_0xd5ffd={};_0xd5ffd[_0x20cd('0x32')]=_['keys'](db[_0x20cd('0x2c')][_0x20cd('0x45')]);_0x1f4998['attributes']=_['intersection'](_0xd5ffd[_0x20cd('0x32')],qs['fields'](_0xfb547c[_0x20cd('0x30')][_0x20cd('0x35')]));_0x1f4998[_0x20cd('0x33')]=_0x1f4998[_0x20cd('0x33')]['length']?_0x1f4998['attributes']:_0xd5ffd['model'];if(_0xfb547c['query'][_0x20cd('0x46')]){_0x1f4998[_0x20cd('0x53')]=[{'all':!![]}];}_0x1f4998=_['merge']({},_0x1f4998,_0xfb547c['options']);return db[_0x20cd('0x2c')][_0x20cd('0x47')](_0x1f4998)[_0x20cd('0x23')](handleEntityNotFound(_0xaa2a72,null))[_0x20cd('0x23')](function(_0xcf7119){if(_0xcf7119){var _0x19d68f=_0xcf7119[_0x20cd('0x25')]({'plain':!![]});_0x19d68f=qs[_0x20cd('0x54')](_0x19d68f,['id',_0x20cd('0x55'),'updatedAt']);_0xfb547c[_0x20cd('0x49')]=_[_0x20cd('0x54')](_0xfb547c['body'],['id',_0x20cd('0x55'),_0x20cd('0x56')]);return db[_0x20cd('0x2c')][_0x20cd('0x48')](_[_0x20cd('0x3f')](_0x19d68f,_0xfb547c[_0x20cd('0x49')]),{'include':_0xfb547c[_0x20cd('0x30')][_0x20cd('0x46')]?[{'all':!![]}]:undefined})[_0x20cd('0x23')](function(_0x10e97c){var _0x229fd7=_0xfb547c[_0x20cd('0x4a')][_0x20cd('0x25')]({'plain':!![]});if(!_0x229fd7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x229fd7[_0x20cd('0x4c')]==='user'){var _0x41ef6c=_0x10e97c[_0x20cd('0x25')]({'plain':!![]});var _0x35b25d=_0x20cd('0x26');return db[_0x20cd('0x4d')]['find']({'where':{'name':_0x35b25d,'userProfileId':_0x229fd7['userProfileId']},'raw':!![]})[_0x20cd('0x23')](function(_0x7e284a){if(_0x7e284a&&_0x7e284a[_0x20cd('0x4f')]===0x0){return db['UserProfileResource'][_0x20cd('0x48')]({'name':_0x41ef6c[_0x20cd('0x29')],'resourceId':_0x41ef6c['id'],'type':_0x7e284a[_0x20cd('0x29')],'sectionId':_0x7e284a['id']},{})['then'](function(){return _0x10e97c;});}else{return _0x10e97c;}})['catch'](function(_0x62612){logger[_0x20cd('0x27')](_0x20cd('0x51'),_0x62612);throw _0x62612;});}return _0x10e97c;});}})[_0x20cd('0x23')](respondWithResult(_0xaa2a72,0xc9))[_0x20cd('0x43')](handleError(_0xaa2a72,null));};exports['update']=function(_0xc5b661,_0x2dd8eb){if(_0xc5b661[_0x20cd('0x49')]['id']){delete _0xc5b661['body']['id'];}return db[_0x20cd('0x2c')]['find']({'where':{'id':_0xc5b661[_0x20cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dd8eb,null))[_0x20cd('0x23')](saveUpdates(_0xc5b661[_0x20cd('0x49')],null))[_0x20cd('0x23')](respondWithResult(_0x2dd8eb,null))[_0x20cd('0x43')](handleError(_0x2dd8eb,null));};exports[_0x20cd('0x24')]=function(_0x4cddce,_0x443093){return db[_0x20cd('0x2c')][_0x20cd('0x47')]({'where':{'id':_0x4cddce['params']['id']}})['then'](handleEntityNotFound(_0x443093,null))[_0x20cd('0x23')](removeEntity(_0x443093,null))[_0x20cd('0x43')](handleError(_0x443093,null));};function widgetAttributes(_0x6843ea){try{switch(_0x6843ea['type']){case _0x20cd('0x57'):return[{'name':_0x20cd('0x58'),'value':_0x6843ea['attrUrl']||(_0x6843ea['attrs']&&_0x6843ea['attrs'][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||_0x20cd('0x5b')}];case'custom':return[{'name':_0x20cd('0x5c'),'value':_0x6843ea['attrPath']||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||''}];case _0x20cd('0x5d'):return[{'name':'attrHourFormat','value':_0x6843ea[_0x20cd('0x5e')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||_0x20cd('0x5f')},{'name':_0x20cd('0x60'),'value':_0x6843ea[_0x20cd('0x60')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea['attrs'][0x1]?_0x6843ea[_0x20cd('0x59')][0x1][_0x20cd('0x5a')]:undefined)||_0x20cd('0x61')},{'name':_0x20cd('0x62'),'value':_0x6843ea[_0x20cd('0x62')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x2]?_0x6843ea['attrs'][0x2][_0x20cd('0x5a')]:undefined)||0xc}];case _0x20cd('0x63'):return[{'name':'attrMetric','value':_0x6843ea[_0x20cd('0x64')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea['attrs'][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||'total'},{'name':_0x20cd('0x65'),'value':_0x6843ea[_0x20cd('0x65')]||(_0x6843ea['attrs']&&_0x6843ea[_0x20cd('0x59')][0x1]?_0x6843ea[_0x20cd('0x59')][0x1][_0x20cd('0x5a')]:undefined)||[]},{'name':_0x20cd('0x62'),'value':_0x6843ea[_0x20cd('0x62')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x2]?_0x6843ea[_0x20cd('0x59')][0x2]['value']:undefined)||0x14}];case _0x20cd('0x66'):case _0x20cd('0x67'):return[{'name':_0x20cd('0x68'),'value':_0x6843ea[_0x20cd('0x68')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea['attrs'][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||_0x20cd('0x69')},{'name':_0x20cd('0x6a'),'value':_0x6843ea[_0x20cd('0x6a')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x1]?_0x6843ea[_0x20cd('0x59')][0x1]['value']:undefined)||null},{'name':_0x20cd('0x6b'),'value':_0x6843ea[_0x20cd('0x6b')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x2]?_0x6843ea[_0x20cd('0x59')][0x2]['value']:undefined)||null},{'name':_0x20cd('0x65'),'value':_0x6843ea[_0x20cd('0x65')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea['attrs'][0x3]?_0x6843ea[_0x20cd('0x59')][0x3][_0x20cd('0x5a')]:undefined)||[]}];case _0x20cd('0x6c'):return[{'name':_0x20cd('0x6d'),'type':_0x6843ea[_0x20cd('0x6e')]||(_0x6843ea['attrs']&&_0x6843ea['attrs'][0x0]?_0x6843ea['attrs'][0x0][_0x20cd('0x2e')]:undefined)||null,'value':_0x6843ea[_0x20cd('0x6d')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||null},{'name':'attrRefresh','value':_0x6843ea[_0x20cd('0x6f')]||(_0x6843ea['attrs']&&_0x6843ea[_0x20cd('0x59')][0x1]?_0x6843ea['attrs'][0x1][_0x20cd('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x17560c){logger[_0x20cd('0x27')](_0x20cd('0x70'),JSON[_0x20cd('0x71')](_0x17560c));return[];}}exports[_0x20cd('0x72')]=function(_0x58f218,_0x279f4e,_0x275144){if(_0x58f218['body']['id']){delete _0x58f218['body']['id'];}return db[_0x20cd('0x2c')][_0x20cd('0x47')]({'where':{'id':_0x58f218[_0x20cd('0x44')]['id']}})[_0x20cd('0x23')](handleEntityNotFound(_0x279f4e,null))[_0x20cd('0x23')](function(_0xe00a42){if(_0xe00a42){_0x58f218[_0x20cd('0x49')][_0x20cd('0x73')]=_0xe00a42['id'];_0x58f218['body'][_0x20cd('0x59')]=widgetAttributes(_0x58f218[_0x20cd('0x49')]);return db[_0x20cd('0x74')][_0x20cd('0x48')](_0x58f218[_0x20cd('0x49')]);}})['then'](respondWithResult(_0x279f4e,null))['catch'](handleError(_0x279f4e,null));};exports[_0x20cd('0x75')]=function(_0x26baa2,_0x5046c8,_0x24cb93){var _0x168650={};var _0x4aa600={};var _0x49752e;var _0x5a17b5;return db[_0x20cd('0x2c')][_0x20cd('0x76')]({'where':{'id':_0x26baa2[_0x20cd('0x44')]['id']}})[_0x20cd('0x23')](handleEntityNotFound(_0x5046c8,null))[_0x20cd('0x23')](function(_0x392810){if(_0x392810){_0x49752e=_0x392810;_0x4aa600['model']=_['keys'](db[_0x20cd('0x74')]['rawAttributes']);_0x4aa600[_0x20cd('0x30')]=_[_0x20cd('0x2f')](_0x26baa2['query']);_0x4aa600[_0x20cd('0x31')]=_[_0x20cd('0x34')](_0x4aa600[_0x20cd('0x32')],_0x4aa600[_0x20cd('0x30')]);_0x168650[_0x20cd('0x33')]=_[_0x20cd('0x34')](_0x4aa600[_0x20cd('0x32')],qs[_0x20cd('0x35')](_0x26baa2[_0x20cd('0x30')][_0x20cd('0x35')]));_0x168650['attributes']=_0x168650[_0x20cd('0x33')][_0x20cd('0x36')]?_0x168650['attributes']:_0x4aa600['model'];_0x168650[_0x20cd('0x77')]=qs[_0x20cd('0x3a')](_0x26baa2[_0x20cd('0x30')][_0x20cd('0x3a')]);_0x168650[_0x20cd('0x3b')]=qs[_0x20cd('0x31')](_['pick'](_0x26baa2[_0x20cd('0x30')],_0x4aa600[_0x20cd('0x31')]));if(_0x26baa2[_0x20cd('0x30')][_0x20cd('0x3d')]){_0x168650[_0x20cd('0x3b')]=_[_0x20cd('0x3f')](_0x168650[_0x20cd('0x3b')],{'$or':_[_0x20cd('0x2b')](_0x168650[_0x20cd('0x33')],function(_0xcce0e1){var _0x391c74={};_0x391c74[_0xcce0e1]={'$like':'%'+_0x26baa2['query']['filter']+'%'};return _0x391c74;})});}_0x168650=_[_0x20cd('0x3f')]({},_0x168650,_0x26baa2['options']);return _0x49752e[_0x20cd('0x75')](_0x168650);}})[_0x20cd('0x23')](function(_0x5bdc3d){if(_0x5bdc3d){_0x5a17b5=_0x5bdc3d['length'];if(!_0x26baa2['query']['hasOwnProperty'](_0x20cd('0x38'))){_0x168650[_0x20cd('0x39')]=qs[_0x20cd('0x39')](_0x26baa2['query'][_0x20cd('0x39')]);_0x168650[_0x20cd('0x1c')]=qs[_0x20cd('0x1c')](_0x26baa2[_0x20cd('0x30')][_0x20cd('0x1c')]);}return _0x49752e[_0x20cd('0x75')](_0x168650);}})['then'](function(_0x1d36b4){if(_0x1d36b4){return _0x1d36b4?{'count':_0x5a17b5,'rows':_0x1d36b4}:null;}})[_0x20cd('0x23')](respondWithResult(_0x5046c8,null))[_0x20cd('0x43')](handleError(_0x5046c8,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index b34788d..b545da8 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 _0x65f9=['../../mysqldb','Dashboard','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x116d2d,_0x1e5518){var _0x10e9da=function(_0x28e47f){while(--_0x28e47f){_0x116d2d['push'](_0x116d2d['shift']());}};_0x10e9da(++_0x1e5518);}(_0x65f9,0x19d));var _0x965f=function(_0x440d1d,_0x3f3a5c){_0x440d1d=_0x440d1d-0x0;var _0x472a25=_0x65f9[_0x440d1d];return _0x472a25;};'use strict';var EventEmitter=require(_0x965f('0x0'));var Dashboard=require(_0x965f('0x1'))['db'][_0x965f('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x965f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x965f('0x4')};function emitEvent(_0x25df3c){return function(_0x741ad6,_0x13f88b,_0xbafc03){DashboardEvents[_0x965f('0x5')](_0x25df3c+':'+_0x741ad6['id'],_0x741ad6);DashboardEvents[_0x965f('0x5')](_0x25df3c,_0x741ad6);_0xbafc03(null);};}for(var e in events){if(events[_0x965f('0x6')](e)){var event=events[e];Dashboard[_0x965f('0x7')](e,emitEvent(event));}}module[_0x965f('0x8')]=DashboardEvents; \ No newline at end of file +var _0xa909=['../../mysqldb','Dashboard','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x85a751,_0x406baf){var _0x5ec101=function(_0x53f6b4){while(--_0x53f6b4){_0x85a751['push'](_0x85a751['shift']());}};_0x5ec101(++_0x406baf);}(_0xa909,0x95));var _0x9a90=function(_0x5d21c0,_0x288257){_0x5d21c0=_0x5d21c0-0x0;var _0x33ef40=_0xa909[_0x5d21c0];return _0x33ef40;};'use strict';var EventEmitter=require(_0x9a90('0x0'));var Dashboard=require(_0x9a90('0x1'))['db'][_0x9a90('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a90('0x3'),'afterUpdate':_0x9a90('0x4'),'afterDestroy':_0x9a90('0x5')};function emitEvent(_0x43d9e8){return function(_0x5ad5b3,_0xa6810,_0x4ba0f8){DashboardEvents[_0x9a90('0x6')](_0x43d9e8+':'+_0x5ad5b3['id'],_0x5ad5b3);DashboardEvents[_0x9a90('0x6')](_0x43d9e8,_0x5ad5b3);_0x4ba0f8(null);};}for(var e in events){if(events[_0x9a90('0x7')](e)){var event=events[e];Dashboard[_0x9a90('0x8')](e,emitEvent(event));}}module[_0x9a90('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 83b0408..da8c353 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 _0x76d8=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards'];(function(_0x28cac3,_0x59e908){var _0x43cf63=function(_0x2e4364){while(--_0x2e4364){_0x28cac3['push'](_0x28cac3['shift']());}};_0x43cf63(++_0x59e908);}(_0x76d8,0x168));var _0x876d=function(_0x4ac4ae,_0x34a08c){_0x4ac4ae=_0x4ac4ae-0x0;var _0x22a499=_0x76d8[_0x4ac4ae];return _0x22a499;};'use strict';var _=require('lodash');var util=require(_0x876d('0x0'));var logger=require(_0x876d('0x1'))('api');var moment=require(_0x876d('0x2'));var BPromise=require(_0x876d('0x3'));var rp=require(_0x876d('0x4'));var fs=require('fs');var path=require(_0x876d('0x5'));var rimraf=require(_0x876d('0x6'));var config=require(_0x876d('0x7'));var attributes=require(_0x876d('0x8'));module[_0x876d('0x9')]=function(_0x3989cf,_0x3429d1){return _0x3989cf[_0x876d('0xa')]('Dashboard',attributes,{'tableName':_0x876d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f7a=['path','rimraf','../../config/environment','exports','define','Dashboard','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f7a,0x88));var _0xa5f7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5f7a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xa5f7('0x0'));var util=require(_0xa5f7('0x1'));var logger=require(_0xa5f7('0x2'))(_0xa5f7('0x3'));var moment=require(_0xa5f7('0x4'));var BPromise=require(_0xa5f7('0x5'));var rp=require(_0xa5f7('0x6'));var fs=require('fs');var path=require(_0xa5f7('0x7'));var rimraf=require(_0xa5f7('0x8'));var config=require(_0xa5f7('0x9'));var attributes=require('./dashboard.attributes');module[_0xa5f7('0xa')]=function(_0x35fb56,_0x314571){return _0x35fb56[_0xa5f7('0xb')](_0xa5f7('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index f76a1c1..ef5ce7c 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 _0xb174=['then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request'];(function(_0x207233,_0x4e7e8b){var _0x40508d=function(_0x4de830){while(--_0x4de830){_0x207233['push'](_0x207233['shift']());}};_0x40508d(++_0x4e7e8b);}(_0xb174,0x112));var _0x4b17=function(_0x450a02,_0x4a7c15){_0x450a02=_0x450a02-0x0;var _0x11e888=_0xb174[_0x450a02];return _0x11e888;};'use strict';var _=require('lodash');var util=require(_0x4b17('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4b17('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b17('0x2'))['db'];var utils=require(_0x4b17('0x3'));var logger=require(_0x4b17('0x4'))(_0x4b17('0x5'));var config=require(_0x4b17('0x6'));var jayson=require(_0x4b17('0x7'));var client=jayson[_0x4b17('0x8')][_0x4b17('0x9')]({'port':0x232a});config[_0x4b17('0xa')]=_['defaults'](config[_0x4b17('0xa')],{'host':_0x4b17('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x4b17('0xc')](socket);function respondWithRpcPromise(_0x39dd5a,_0x56e483,_0x4c8f03){return new BPromise(function(_0x2e1419,_0xdf6d0b){return client[_0x4b17('0xd')](_0x39dd5a,_0x4c8f03)[_0x4b17('0xe')](function(_0x224979){logger[_0x4b17('0xf')](_0x4b17('0x10'),_0x56e483,_0x4b17('0x11'));logger['debug'](_0x4b17('0x12'),_0x56e483,_0x4b17('0x11'),JSON['stringify'](_0x224979));if(_0x224979['error']){if(_0x224979[_0x4b17('0x13')][_0x4b17('0x14')]===0x1f4){logger['error'](_0x4b17('0x10'),_0x56e483,_0x224979['error'][_0x4b17('0x15')]);return _0xdf6d0b(_0x224979[_0x4b17('0x13')]['message']);}logger['error'](_0x4b17('0x10'),_0x56e483,_0x224979[_0x4b17('0x13')]['message']);return _0x2e1419(_0x224979['error'][_0x4b17('0x15')]);}else{logger[_0x4b17('0xf')](_0x4b17('0x10'),_0x56e483,_0x4b17('0x11'));_0x2e1419(_0x224979[_0x4b17('0x16')][_0x4b17('0x15')]);}})[_0x4b17('0x17')](function(_0x776cbc){logger[_0x4b17('0x13')]('Dashboard,\x20%s,\x20%s',_0x56e483,_0x776cbc);_0xdf6d0b(_0x776cbc);});});} \ No newline at end of file +var _0xcec2=['Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','./dashboard.socket','register','request','then','info'];(function(_0x74a76c,_0x87c60d){var _0x3d8e25=function(_0x17fa8b){while(--_0x17fa8b){_0x74a76c['push'](_0x74a76c['shift']());}};_0x3d8e25(++_0x87c60d);}(_0xcec2,0xd8));var _0x2cec=function(_0x3cfb25,_0x5d88e9){_0x3cfb25=_0x3cfb25-0x0;var _0x388a2b=_0xcec2[_0x3cfb25];return _0x388a2b;};'use strict';var _=require(_0x2cec('0x0'));var util=require('util');var moment=require(_0x2cec('0x1'));var BPromise=require(_0x2cec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2cec('0x3'));var db=require(_0x2cec('0x4'))['db'];var utils=require(_0x2cec('0x5'));var logger=require(_0x2cec('0x6'))('rpc');var config=require(_0x2cec('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cec('0x8')][_0x2cec('0x9')]({'port':0x232a});config['redis']=_[_0x2cec('0xa')](config[_0x2cec('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2cec('0xc'))(new Redis(config[_0x2cec('0xb')]));require(_0x2cec('0xd'))[_0x2cec('0xe')](socket);function respondWithRpcPromise(_0x2d4e4e,_0x4afcf6,_0x3acff4){return new BPromise(function(_0x49f2cd,_0x32fea1){return client[_0x2cec('0xf')](_0x2d4e4e,_0x3acff4)[_0x2cec('0x10')](function(_0x37b40c){logger[_0x2cec('0x11')](_0x2cec('0x12'),_0x4afcf6,_0x2cec('0x13'));logger[_0x2cec('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x4afcf6,_0x2cec('0x13'),JSON[_0x2cec('0x15')](_0x37b40c));if(_0x37b40c[_0x2cec('0x16')]){if(_0x37b40c[_0x2cec('0x16')][_0x2cec('0x17')]===0x1f4){logger[_0x2cec('0x16')](_0x2cec('0x12'),_0x4afcf6,_0x37b40c[_0x2cec('0x16')][_0x2cec('0x18')]);return _0x32fea1(_0x37b40c[_0x2cec('0x16')][_0x2cec('0x18')]);}logger[_0x2cec('0x16')](_0x2cec('0x12'),_0x4afcf6,_0x37b40c[_0x2cec('0x16')]['message']);return _0x49f2cd(_0x37b40c[_0x2cec('0x16')][_0x2cec('0x18')]);}else{logger[_0x2cec('0x11')](_0x2cec('0x12'),_0x4afcf6,_0x2cec('0x13'));_0x49f2cd(_0x37b40c[_0x2cec('0x19')]['message']);}})['catch'](function(_0x36fc14){logger['error'](_0x2cec('0x12'),_0x4afcf6,_0x36fc14);_0x32fea1(_0x36fc14);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index b2b8d69..9b8e40f 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 _0xddb4=['register','length','dashboard:','save','removeListener'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xddb4,0x1cf));var _0x4ddb=function(_0x4fe77d,_0xaad1f1){_0x4fe77d=_0x4fe77d-0x0;var _0x296a48=_0xddb4[_0x4fe77d];return _0x296a48;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x4ddb('0x0'),'remove','update'];function createListener(_0x840d76,_0x9f1df4){return function(_0x3257a2){_0x9f1df4['emit'](_0x840d76,_0x3257a2);};}function removeListener(_0x584329,_0x342d52){return function(){DashboardEvents[_0x4ddb('0x1')](_0x584329,_0x342d52);};}exports[_0x4ddb('0x2')]=function(_0x39fc22){for(var _0x181fe7=0x0,_0x1afd71=events[_0x4ddb('0x3')];_0x181fe7<_0x1afd71;_0x181fe7++){var _0x4244b2=events[_0x181fe7];var _0x2e4fa2=createListener(_0x4ddb('0x4')+_0x4244b2,_0x39fc22);DashboardEvents['on'](_0x4244b2,_0x2e4fa2);}}; \ No newline at end of file +var _0xbd72=['update','register','length','dashboard:','save'];(function(_0x21c614,_0x1644ac){var _0x2cac53=function(_0x250086){while(--_0x250086){_0x21c614['push'](_0x21c614['shift']());}};_0x2cac53(++_0x1644ac);}(_0xbd72,0xf9));var _0x2bd7=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0xbd72[_0x2714ec];return _0x2608e5;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x2bd7('0x0'),'remove',_0x2bd7('0x1')];function createListener(_0x1e0ad8,_0x46df76){return function(_0x5a7a13){_0x46df76['emit'](_0x1e0ad8,_0x5a7a13);};}function removeListener(_0x5cfcd5,_0xc279d2){return function(){DashboardEvents['removeListener'](_0x5cfcd5,_0xc279d2);};}exports[_0x2bd7('0x2')]=function(_0x25871a){for(var _0x26bfce=0x0,_0x158d48=events[_0x2bd7('0x3')];_0x26bfce<_0x158d48;_0x26bfce++){var _0x804ebd=events[_0x26bfce];var _0x492d59=createListener(_0x2bd7('0x4')+_0x804ebd,_0x25871a);DashboardEvents['on'](_0x804ebd,_0x492d59);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 8a45ddc..406ecf9 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 _0x2420=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/items','getItems','create','/:id/clone','post','addItem','put','/:id','update','delete'];(function(_0x4d6682,_0x4352fb){var _0x584256=function(_0x99bfc3){while(--_0x99bfc3){_0x4d6682['push'](_0x4d6682['shift']());}};_0x584256(++_0x4352fb);}(_0x2420,0xdd));var _0x0242=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2420[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0242('0x0'));var timeout=require(_0x0242('0x1'));var express=require(_0x0242('0x2'));var router=express[_0x0242('0x3')]();var fs_extra=require(_0x0242('0x4'));var auth=require(_0x0242('0x5'));var interaction=require(_0x0242('0x6'));var config=require(_0x0242('0x7'));var controller=require('./dashboard.controller');router[_0x0242('0x8')]('/',auth['isAuthenticated'](),controller[_0x0242('0x9')]);router['get']('/:id',auth[_0x0242('0xa')](),controller['show']);router[_0x0242('0x8')](_0x0242('0xb'),auth['isAuthenticated'](),controller[_0x0242('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0242('0xd')]);router['post'](_0x0242('0xe'),auth[_0x0242('0xa')](),controller['clone']);router[_0x0242('0xf')](_0x0242('0xb'),auth[_0x0242('0xa')](),controller[_0x0242('0x10')]);router[_0x0242('0x11')](_0x0242('0x12'),auth['isAuthenticated'](),controller[_0x0242('0x13')]);router[_0x0242('0x14')](_0x0242('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x0242('0x15')]=router; \ No newline at end of file +var _0x0f77=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','delete'];(function(_0x4360c9,_0x69b183){var _0x4846dd=function(_0x12d760){while(--_0x12d760){_0x4360c9['push'](_0x4360c9['shift']());}};_0x4846dd(++_0x69b183);}(_0x0f77,0x65));var _0x70f7=function(_0x2ed60b,_0x216d5e){_0x2ed60b=_0x2ed60b-0x0;var _0x68a427=_0x0f77[_0x2ed60b];return _0x68a427;};'use strict';var multer=require(_0x70f7('0x0'));var util=require(_0x70f7('0x1'));var path=require(_0x70f7('0x2'));var timeout=require(_0x70f7('0x3'));var express=require(_0x70f7('0x4'));var router=express[_0x70f7('0x5')]();var fs_extra=require(_0x70f7('0x6'));var auth=require(_0x70f7('0x7'));var interaction=require(_0x70f7('0x8'));var config=require(_0x70f7('0x9'));var controller=require(_0x70f7('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x70f7('0xb')](_0x70f7('0xc'),auth[_0x70f7('0xd')](),controller[_0x70f7('0xe')]);router[_0x70f7('0xb')](_0x70f7('0xf'),auth[_0x70f7('0xd')](),controller[_0x70f7('0x10')]);router[_0x70f7('0x11')]('/',auth[_0x70f7('0xd')](),controller[_0x70f7('0x12')]);router['post'](_0x70f7('0x13'),auth['isAuthenticated'](),controller[_0x70f7('0x14')]);router[_0x70f7('0x11')](_0x70f7('0xf'),auth[_0x70f7('0xd')](),controller[_0x70f7('0x15')]);router[_0x70f7('0x16')](_0x70f7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x70f7('0x17')](_0x70f7('0xc'),auth[_0x70f7('0xd')](),controller[_0x70f7('0x18')]);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 53a428f..fa1a281 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 _0x187d=['stringify','INTEGER','#ffffff','sequelize','lodash','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue'];(function(_0x472639,_0x3127aa){var _0x48ef0d=function(_0x257e83){while(--_0x257e83){_0x472639['push'](_0x472639['shift']());}};_0x48ef0d(++_0x3127aa);}(_0x187d,0x93));var _0xd187=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x187d[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require(_0xd187('0x0'));var squel=require('squel');var _=require(_0xd187('0x1'));module[_0xd187('0x2')]={'title':{'type':Sequelize[_0xd187('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd187('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xd187('0x4')](_0xd187('0x5')),'get':function(){try{return JSON['parse'](this[_0xd187('0x6')](_0xd187('0x7')));}catch(_0x4ebc8d){return[];}},'set':function(_0x1d2533){try{this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')](_0x1d2533));}catch(_0x28ce2f){this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xd187('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd187('0xa')]},'col':{'type':Sequelize[_0xd187('0xa')]},'background':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':_0xd187('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd187('0x3')]},'titleFontSize':{'type':Sequelize[_0xd187('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x53ec=['getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','long'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0x53ec,0x192));var _0xc53e=function(_0x4f027d,_0x3f9587){_0x4f027d=_0x4f027d-0x0;var _0xc46890=_0x53ec[_0x4f027d];return _0xc46890;};'use strict';var Sequelize=require(_0xc53e('0x0'));var squel=require(_0xc53e('0x1'));var _=require(_0xc53e('0x2'));module[_0xc53e('0x3')]={'title':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xc53e('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc53e('0x5')),'get':function(){try{return JSON['parse'](this[_0xc53e('0x6')](_0xc53e('0x7')));}catch(_0x4a9c59){return[];}},'set':function(_0x2f1414){try{this['setDataValue'](_0xc53e('0x7'),JSON[_0xc53e('0x8')](_0x2f1414));}catch(_0x5d3b28){this[_0xc53e('0x9')](_0xc53e('0x7'),JSON[_0xc53e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc53e('0xa')]},'col':{'type':Sequelize[_0xc53e('0xa')]},'background':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![],'defaultValue':_0xc53e('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc53e('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 80e65d7..00db952 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 _0x59cb=['util','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','show','model','keys','DashboardItem','query','filters','intersection','fields','attributes','include','options','find','catch','params','type','iframe','attrUrl','attrs','value','https://','custom','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x561ade,_0x183122){var _0x1757eb=function(_0xe5795b){while(--_0xe5795b){_0x561ade['push'](_0x561ade['shift']());}};_0x1757eb(++_0x183122);}(_0x59cb,0x9b));var _0xb59c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x59cb[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xb59c('0x0'));var rimraf=require(_0xb59c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb59c('0x2'));var moment=require(_0xb59c('0x3'));var BPromise=require(_0xb59c('0x4'));var Mustache=require('mustache');var util=require(_0xb59c('0x5'));var path=require('path');var sox=require(_0xb59c('0x6'));var csv=require('to-csv');var ejs=require(_0xb59c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb59c('0x8'));var squel=require('squel');var crypto=require(_0xb59c('0x9'));var jsforce=require(_0xb59c('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb59c('0xb'));var Papa=require(_0xb59c('0xc'));var Redis=require(_0xb59c('0xd'));var authService=require(_0xb59c('0xe'));var qs=require(_0xb59c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb59c('0x10'));var config=require(_0xb59c('0x11'));var licenseUtil=require(_0xb59c('0x12'));var db=require(_0xb59c('0x13'))['db'];config[_0xb59c('0x14')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb59c('0x15'))(new Redis(config[_0xb59c('0x14')]));require('./dashboardItem.socket')[_0xb59c('0x16')](socket);function respondWithStatusCode(_0x4263d7,_0x10ab19){_0x10ab19=_0x10ab19||0xcc;return function(_0x349a62){if(_0x349a62){return _0x4263d7[_0xb59c('0x17')](_0x10ab19);}return _0x4263d7[_0xb59c('0x18')](_0x10ab19)[_0xb59c('0x19')]();};}function respondWithResult(_0x2fe856,_0x4e3588){_0x4e3588=_0x4e3588||0xc8;return function(_0x2e931c){if(_0x2e931c){return _0x2fe856['status'](_0x4e3588)[_0xb59c('0x1a')](_0x2e931c);}};}function respondWithFilteredResult(_0x3001b4,_0x205fc5){return function(_0x1cebb5){if(_0x1cebb5){var _0x4fbf5d=typeof _0x205fc5['offset']===_0xb59c('0x1b')&&typeof _0x205fc5[_0xb59c('0x1c')]===_0xb59c('0x1b');var _0x5f3495=_0x1cebb5[_0xb59c('0x1d')];var _0x20506c=_0x4fbf5d?0x0:_0x205fc5[_0xb59c('0x1e')];var _0x3879db=_0x4fbf5d?_0x1cebb5[_0xb59c('0x1d')]:_0x205fc5[_0xb59c('0x1e')]+_0x205fc5[_0xb59c('0x1c')];var _0x4939e1;if(_0x3879db>=_0x5f3495){_0x3879db=_0x5f3495;_0x4939e1=0xc8;}else{_0x4939e1=0xce;}_0x3001b4['status'](_0x4939e1);return _0x3001b4[_0xb59c('0x1f')](_0xb59c('0x20'),_0x20506c+'-'+_0x3879db+'/'+_0x5f3495)[_0xb59c('0x1a')](_0x1cebb5);}return null;};}function patchUpdates(_0x643f16){return function(_0x1414b2){try{jsonpatch['apply'](_0x1414b2,_0x643f16,!![]);}catch(_0xdd281c){return BPromise[_0xb59c('0x21')](_0xdd281c);}return _0x1414b2[_0xb59c('0x22')]();};}function saveUpdates(_0x52cb1b,_0x4090da){return function(_0x111087){if(_0x111087){return _0x111087['update'](_0x52cb1b)[_0xb59c('0x23')](function(_0x4464d0){return _0x4464d0;});}return null;};}function removeEntity(_0x1a641a,_0x29403c){return function(_0x276c48){if(_0x276c48){return _0x276c48[_0xb59c('0x24')]()[_0xb59c('0x23')](function(){_0x1a641a[_0xb59c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217a3e,_0x6721ab){return function(_0x396786){if(!_0x396786){_0x217a3e[_0xb59c('0x17')](0x194);}return _0x396786;};}function handleError(_0x4abc76,_0x3183bb){_0x3183bb=_0x3183bb||0x1f4;return function(_0x3fda2c){logger[_0xb59c('0x25')](_0x3fda2c[_0xb59c('0x26')]);if(_0x3fda2c[_0xb59c('0x27')]){delete _0x3fda2c[_0xb59c('0x27')];}_0x4abc76[_0xb59c('0x18')](_0x3183bb)['send'](_0x3fda2c);};}exports[_0xb59c('0x28')]=function(_0x40b4d9,_0x4b31e8){var _0x4e283e={'raw':![],'where':{'id':_0x40b4d9['params']['id']}},_0x9c4f4e={};_0x9c4f4e[_0xb59c('0x29')]=_[_0xb59c('0x2a')](db[_0xb59c('0x2b')]['rawAttributes']);_0x9c4f4e[_0xb59c('0x2c')]=_[_0xb59c('0x2a')](_0x40b4d9[_0xb59c('0x2c')]);_0x9c4f4e[_0xb59c('0x2d')]=_[_0xb59c('0x2e')](_0x9c4f4e[_0xb59c('0x29')],_0x9c4f4e[_0xb59c('0x2c')]);_0x4e283e['attributes']=_[_0xb59c('0x2e')](_0x9c4f4e['model'],qs[_0xb59c('0x2f')](_0x40b4d9['query'][_0xb59c('0x2f')]));_0x4e283e[_0xb59c('0x30')]=_0x4e283e['attributes']['length']?_0x4e283e[_0xb59c('0x30')]:_0x9c4f4e['model'];if(_0x40b4d9['query']['includeAll']){_0x4e283e[_0xb59c('0x31')]=[{'all':!![]}];}_0x4e283e=_['merge']({},_0x4e283e,_0x40b4d9[_0xb59c('0x32')]);return db[_0xb59c('0x2b')][_0xb59c('0x33')](_0x4e283e)['then'](handleEntityNotFound(_0x4b31e8,null))[_0xb59c('0x23')](respondWithResult(_0x4b31e8,null))[_0xb59c('0x34')](handleError(_0x4b31e8,null));};exports[_0xb59c('0x24')]=function(_0x19b8d7,_0x5a3c44){return db[_0xb59c('0x2b')][_0xb59c('0x33')]({'where':{'id':_0x19b8d7[_0xb59c('0x35')]['id']}})[_0xb59c('0x23')](handleEntityNotFound(_0x5a3c44,null))[_0xb59c('0x23')](removeEntity(_0x5a3c44,null))[_0xb59c('0x34')](handleError(_0x5a3c44,null));};function widgetAttributes(_0x4a0bef){try{switch(_0x4a0bef[_0xb59c('0x36')]){case _0xb59c('0x37'):return[{'name':_0xb59c('0x38'),'value':_0x4a0bef[_0xb59c('0x38')]||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef[_0xb59c('0x39')][0x0]?_0x4a0bef[_0xb59c('0x39')][0x0][_0xb59c('0x3a')]:undefined)||_0xb59c('0x3b')}];case _0xb59c('0x3c'):return[{'name':'attrPath','value':_0x4a0bef['attrPath']||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef['attrs'][0x0]?_0x4a0bef[_0xb59c('0x39')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xb59c('0x3d'),'value':_0x4a0bef[_0xb59c('0x3d')]||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef[_0xb59c('0x39')][0x0]?_0x4a0bef[_0xb59c('0x39')][0x0][_0xb59c('0x3a')]:undefined)||'HH:mm:ss'},{'name':_0xb59c('0x3e'),'value':_0x4a0bef[_0xb59c('0x3e')]||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef[_0xb59c('0x39')][0x1]?_0x4a0bef[_0xb59c('0x39')][0x1]['value']:undefined)||_0xb59c('0x3f')},{'name':_0xb59c('0x40'),'value':_0x4a0bef[_0xb59c('0x40')]||(_0x4a0bef['attrs']&&_0x4a0bef[_0xb59c('0x39')][0x2]?_0x4a0bef[_0xb59c('0x39')][0x2][_0xb59c('0x3a')]:undefined)||0xc}];case _0xb59c('0x41'):return[{'name':_0xb59c('0x42'),'value':_0x4a0bef[_0xb59c('0x42')]||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef['attrs'][0x0]?_0x4a0bef[_0xb59c('0x39')][0x0][_0xb59c('0x3a')]:undefined)||_0xb59c('0x43')},{'name':'attrVoiceQueues','value':_0x4a0bef[_0xb59c('0x44')]||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef[_0xb59c('0x39')][0x1]?_0x4a0bef[_0xb59c('0x39')][0x1][_0xb59c('0x3a')]:undefined)||[]},{'name':_0xb59c('0x40'),'value':_0x4a0bef['attrFontSize']||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef[_0xb59c('0x39')][0x2]?_0x4a0bef[_0xb59c('0x39')][0x2][_0xb59c('0x3a')]:undefined)||0x14}];case _0xb59c('0x45'):case _0xb59c('0x46'):return[{'name':'attrSerie1','value':_0x4a0bef[_0xb59c('0x47')]||(_0x4a0bef['attrs']&&_0x4a0bef[_0xb59c('0x39')][0x0]?_0x4a0bef[_0xb59c('0x39')][0x0][_0xb59c('0x3a')]:undefined)||_0xb59c('0x43')},{'name':_0xb59c('0x48'),'value':_0x4a0bef[_0xb59c('0x48')]||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef[_0xb59c('0x39')][0x1]?_0x4a0bef[_0xb59c('0x39')][0x1][_0xb59c('0x3a')]:undefined)||null},{'name':'attrSerie3','value':_0x4a0bef[_0xb59c('0x49')]||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef[_0xb59c('0x39')][0x2]?_0x4a0bef['attrs'][0x2][_0xb59c('0x3a')]:undefined)||null},{'name':_0xb59c('0x44'),'value':_0x4a0bef[_0xb59c('0x44')]||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef[_0xb59c('0x39')][0x3]?_0x4a0bef['attrs'][0x3][_0xb59c('0x3a')]:undefined)||[]}];case'web-report':return[{'name':_0xb59c('0x4a'),'type':_0x4a0bef['reportType']||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef['attrs'][0x0]?_0x4a0bef['attrs'][0x0][_0xb59c('0x36')]:undefined)||null,'value':_0x4a0bef[_0xb59c('0x4a')]||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef[_0xb59c('0x39')][0x0]?_0x4a0bef['attrs'][0x0][_0xb59c('0x3a')]:undefined)||null},{'name':'attrRefresh','value':_0x4a0bef['attrRefresh']||(_0x4a0bef[_0xb59c('0x39')]&&_0x4a0bef['attrs'][0x1]?_0x4a0bef[_0xb59c('0x39')][0x1][_0xb59c('0x3a')]:undefined)||0x0}];default:return[];}}catch(_0x3582a4){logger[_0xb59c('0x25')](_0xb59c('0x4b'),JSON[_0xb59c('0x4c')](_0x3582a4));return[];}}exports[_0xb59c('0x4d')]=function(_0x473ae0,_0x5e38b2){if(_0x473ae0[_0xb59c('0x4e')]){_0x473ae0[_0xb59c('0x4e')][_0xb59c('0x39')]=widgetAttributes(_0x473ae0[_0xb59c('0x4e')]);}return db[_0xb59c('0x2b')][_0xb59c('0x4d')](_0x473ae0[_0xb59c('0x4e')],{})['then'](respondWithResult(_0x5e38b2,0xc9))[_0xb59c('0x34')](handleError(_0x5e38b2,null));};exports[_0xb59c('0x4f')]=function(_0x199d3a,_0xd9724a){if(_0x199d3a[_0xb59c('0x4e')]['id']){delete _0x199d3a[_0xb59c('0x4e')]['id'];}_0x199d3a[_0xb59c('0x4e')][_0xb59c('0x39')]=widgetAttributes(_0x199d3a[_0xb59c('0x4e')]);return db[_0xb59c('0x2b')][_0xb59c('0x33')]({'where':{'id':_0x199d3a[_0xb59c('0x35')]['id']}})[_0xb59c('0x23')](handleEntityNotFound(_0xd9724a,null))['then'](saveUpdates(_0x199d3a[_0xb59c('0x4e')],null))[_0xb59c('0x23')](respondWithResult(_0xd9724a,null))['catch'](handleError(_0xd9724a,null));}; \ No newline at end of file +var _0xa845=['moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','query','keys','intersection','fields','attributes','length','includeAll','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','total','attrSerie2','attrSerie3','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x411b54,_0x47ce64){var _0x1f1dbe=function(_0x19218a){while(--_0x19218a){_0x411b54['push'](_0x411b54['shift']());}};_0x1f1dbe(++_0x47ce64);}(_0xa845,0x163));var _0x5a84=function(_0x5017af,_0x300c05){_0x5017af=_0x5017af-0x0;var _0x521a1a=_0xa845[_0x5017af];return _0x521a1a;};'use strict';var emlformat=require(_0x5a84('0x0'));var rimraf=require(_0x5a84('0x1'));var zipdir=require(_0x5a84('0x2'));var jsonpatch=require(_0x5a84('0x3'));var rp=require(_0x5a84('0x4'));var moment=require(_0x5a84('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5a84('0x6'));var util=require(_0x5a84('0x7'));var path=require(_0x5a84('0x8'));var sox=require(_0x5a84('0x9'));var csv=require('to-csv');var ejs=require(_0x5a84('0xa'));var fs=require('fs');var fs_extra=require(_0x5a84('0xb'));var _=require(_0x5a84('0xc'));var squel=require(_0x5a84('0xd'));var crypto=require(_0x5a84('0xe'));var jsforce=require(_0x5a84('0xf'));var deskjs=require(_0x5a84('0x10'));var toCsv=require(_0x5a84('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a84('0x12'));var authService=require(_0x5a84('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5a84('0x14'));var hardwareService=require(_0x5a84('0x15'));var logger=require(_0x5a84('0x16'))(_0x5a84('0x17'));var utils=require(_0x5a84('0x18'));var config=require(_0x5a84('0x19'));var licenseUtil=require(_0x5a84('0x1a'));var db=require(_0x5a84('0x1b'))['db'];config[_0x5a84('0x1c')]=_['defaults'](config[_0x5a84('0x1c')],{'host':_0x5a84('0x1d'),'port':0x18eb});var socket=require(_0x5a84('0x1e'))(new Redis(config[_0x5a84('0x1c')]));require(_0x5a84('0x1f'))['register'](socket);function respondWithStatusCode(_0x211c6d,_0x3e5203){_0x3e5203=_0x3e5203||0xcc;return function(_0x4885a2){if(_0x4885a2){return _0x211c6d[_0x5a84('0x20')](_0x3e5203);}return _0x211c6d[_0x5a84('0x21')](_0x3e5203)[_0x5a84('0x22')]();};}function respondWithResult(_0x3fc079,_0x29a8a1){_0x29a8a1=_0x29a8a1||0xc8;return function(_0x2e9f8c){if(_0x2e9f8c){return _0x3fc079[_0x5a84('0x21')](_0x29a8a1)[_0x5a84('0x23')](_0x2e9f8c);}};}function respondWithFilteredResult(_0x350c7f,_0x1decc9){return function(_0x4277eb){if(_0x4277eb){var _0x1c80a0=typeof _0x1decc9[_0x5a84('0x24')]===_0x5a84('0x25')&&typeof _0x1decc9[_0x5a84('0x26')]===_0x5a84('0x25');var _0x280f74=_0x4277eb[_0x5a84('0x27')];var _0x39bfe0=_0x1c80a0?0x0:_0x1decc9[_0x5a84('0x24')];var _0x16a3d6=_0x1c80a0?_0x4277eb['count']:_0x1decc9[_0x5a84('0x24')]+_0x1decc9[_0x5a84('0x26')];var _0x49bcf6;if(_0x16a3d6>=_0x280f74){_0x16a3d6=_0x280f74;_0x49bcf6=0xc8;}else{_0x49bcf6=0xce;}_0x350c7f['status'](_0x49bcf6);return _0x350c7f[_0x5a84('0x28')]('Content-Range',_0x39bfe0+'-'+_0x16a3d6+'/'+_0x280f74)['json'](_0x4277eb);}return null;};}function patchUpdates(_0x14eb61){return function(_0x5d8816){try{jsonpatch[_0x5a84('0x29')](_0x5d8816,_0x14eb61,!![]);}catch(_0x478c86){return BPromise[_0x5a84('0x2a')](_0x478c86);}return _0x5d8816[_0x5a84('0x2b')]();};}function saveUpdates(_0x38ebac,_0x2e7866){return function(_0x343736){if(_0x343736){return _0x343736[_0x5a84('0x2c')](_0x38ebac)[_0x5a84('0x2d')](function(_0x4690fa){return _0x4690fa;});}return null;};}function removeEntity(_0x295461,_0x17ac6a){return function(_0x4e5b23){if(_0x4e5b23){return _0x4e5b23[_0x5a84('0x2e')]()[_0x5a84('0x2d')](function(){_0x295461[_0x5a84('0x21')](0xcc)[_0x5a84('0x22')]();});}};}function handleEntityNotFound(_0x3b03c0,_0x50b39e){return function(_0xde04e4){if(!_0xde04e4){_0x3b03c0[_0x5a84('0x20')](0x194);}return _0xde04e4;};}function handleError(_0x20a5dc,_0xe899a5){_0xe899a5=_0xe899a5||0x1f4;return function(_0x1e1c1b){logger[_0x5a84('0x2f')](_0x1e1c1b[_0x5a84('0x30')]);if(_0x1e1c1b[_0x5a84('0x31')]){delete _0x1e1c1b[_0x5a84('0x31')];}_0x20a5dc['status'](_0xe899a5)[_0x5a84('0x32')](_0x1e1c1b);};}exports[_0x5a84('0x33')]=function(_0x3d30b6,_0x4a506b){var _0x3e2c8e={'raw':![],'where':{'id':_0x3d30b6[_0x5a84('0x34')]['id']}},_0x3633c1={};_0x3633c1[_0x5a84('0x35')]=_['keys'](db['DashboardItem']['rawAttributes']);_0x3633c1[_0x5a84('0x36')]=_[_0x5a84('0x37')](_0x3d30b6[_0x5a84('0x36')]);_0x3633c1['filters']=_[_0x5a84('0x38')](_0x3633c1['model'],_0x3633c1['query']);_0x3e2c8e['attributes']=_[_0x5a84('0x38')](_0x3633c1['model'],qs[_0x5a84('0x39')](_0x3d30b6[_0x5a84('0x36')][_0x5a84('0x39')]));_0x3e2c8e['attributes']=_0x3e2c8e[_0x5a84('0x3a')][_0x5a84('0x3b')]?_0x3e2c8e[_0x5a84('0x3a')]:_0x3633c1[_0x5a84('0x35')];if(_0x3d30b6[_0x5a84('0x36')][_0x5a84('0x3c')]){_0x3e2c8e['include']=[{'all':!![]}];}_0x3e2c8e=_[_0x5a84('0x3d')]({},_0x3e2c8e,_0x3d30b6[_0x5a84('0x3e')]);return db[_0x5a84('0x3f')][_0x5a84('0x40')](_0x3e2c8e)[_0x5a84('0x2d')](handleEntityNotFound(_0x4a506b,null))[_0x5a84('0x2d')](respondWithResult(_0x4a506b,null))['catch'](handleError(_0x4a506b,null));};exports[_0x5a84('0x2e')]=function(_0x3fb659,_0x4f33e9){return db[_0x5a84('0x3f')][_0x5a84('0x40')]({'where':{'id':_0x3fb659[_0x5a84('0x34')]['id']}})['then'](handleEntityNotFound(_0x4f33e9,null))[_0x5a84('0x2d')](removeEntity(_0x4f33e9,null))[_0x5a84('0x41')](handleError(_0x4f33e9,null));};function widgetAttributes(_0x3e852d){try{switch(_0x3e852d[_0x5a84('0x42')]){case _0x5a84('0x43'):return[{'name':_0x5a84('0x44'),'value':_0x3e852d[_0x5a84('0x44')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d[_0x5a84('0x45')][0x0][_0x5a84('0x46')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x3e852d[_0x5a84('0x47')]||(_0x3e852d['attrs']&&_0x3e852d['attrs'][0x0]?_0x3e852d[_0x5a84('0x45')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x5a84('0x48'),'value':_0x3e852d[_0x5a84('0x48')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d[_0x5a84('0x45')][0x0]['value']:undefined)||_0x5a84('0x49')},{'name':'attrTimezone','value':_0x3e852d[_0x5a84('0x4a')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x1]?_0x3e852d['attrs'][0x1][_0x5a84('0x46')]:undefined)||_0x5a84('0x4b')},{'name':_0x5a84('0x4c'),'value':_0x3e852d[_0x5a84('0x4c')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x2]?_0x3e852d[_0x5a84('0x45')][0x2][_0x5a84('0x46')]:undefined)||0xc}];case _0x5a84('0x4d'):return[{'name':'attrMetric','value':_0x3e852d[_0x5a84('0x4e')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d[_0x5a84('0x45')][0x0][_0x5a84('0x46')]:undefined)||'total'},{'name':_0x5a84('0x4f'),'value':_0x3e852d[_0x5a84('0x4f')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x1]?_0x3e852d[_0x5a84('0x45')][0x1][_0x5a84('0x46')]:undefined)||[]},{'name':_0x5a84('0x4c'),'value':_0x3e852d[_0x5a84('0x4c')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x2]?_0x3e852d[_0x5a84('0x45')][0x2][_0x5a84('0x46')]:undefined)||0x14}];case _0x5a84('0x50'):case _0x5a84('0x51'):return[{'name':'attrSerie1','value':_0x3e852d['attrSerie1']||(_0x3e852d['attrs']&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d['attrs'][0x0][_0x5a84('0x46')]:undefined)||_0x5a84('0x52')},{'name':_0x5a84('0x53'),'value':_0x3e852d[_0x5a84('0x53')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x1]?_0x3e852d[_0x5a84('0x45')][0x1]['value']:undefined)||null},{'name':_0x5a84('0x54'),'value':_0x3e852d[_0x5a84('0x54')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d['attrs'][0x2]?_0x3e852d[_0x5a84('0x45')][0x2][_0x5a84('0x46')]:undefined)||null},{'name':_0x5a84('0x4f'),'value':_0x3e852d[_0x5a84('0x4f')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x3]?_0x3e852d[_0x5a84('0x45')][0x3][_0x5a84('0x46')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x3e852d[_0x5a84('0x55')]||(_0x3e852d['attrs']&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d[_0x5a84('0x45')][0x0][_0x5a84('0x42')]:undefined)||null,'value':_0x3e852d['attrReport']||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d['attrs'][0x0]?_0x3e852d[_0x5a84('0x45')][0x0][_0x5a84('0x46')]:undefined)||null},{'name':_0x5a84('0x56'),'value':_0x3e852d[_0x5a84('0x56')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x1]?_0x3e852d[_0x5a84('0x45')][0x1][_0x5a84('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x47ca04){logger['error'](_0x5a84('0x57'),JSON['stringify'](_0x47ca04));return[];}}exports[_0x5a84('0x58')]=function(_0x24b617,_0x2365f5){if(_0x24b617[_0x5a84('0x59')]){_0x24b617[_0x5a84('0x59')][_0x5a84('0x45')]=widgetAttributes(_0x24b617[_0x5a84('0x59')]);}return db['DashboardItem'][_0x5a84('0x58')](_0x24b617['body'],{})[_0x5a84('0x2d')](respondWithResult(_0x2365f5,0xc9))[_0x5a84('0x41')](handleError(_0x2365f5,null));};exports['update']=function(_0x3d7c7d,_0x43f5b2){if(_0x3d7c7d['body']['id']){delete _0x3d7c7d[_0x5a84('0x59')]['id'];}_0x3d7c7d['body'][_0x5a84('0x45')]=widgetAttributes(_0x3d7c7d[_0x5a84('0x59')]);return db[_0x5a84('0x3f')][_0x5a84('0x40')]({'where':{'id':_0x3d7c7d[_0x5a84('0x34')]['id']}})[_0x5a84('0x2d')](handleEntityNotFound(_0x43f5b2,null))[_0x5a84('0x2d')](saveUpdates(_0x3d7c7d['body'],null))['then'](respondWithResult(_0x43f5b2,null))['catch'](handleError(_0x43f5b2,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4f0b031..06894db 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 _0x13f7=['emit','hasOwnProperty','hook','../../mysqldb','save','update'];(function(_0x8cea57,_0x290172){var _0x25ce1d=function(_0x152c9a){while(--_0x152c9a){_0x8cea57['push'](_0x8cea57['shift']());}};_0x25ce1d(++_0x290172);}(_0x13f7,0x1d1));var _0x713f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f7[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x713f('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x713f('0x1'),'afterUpdate':_0x713f('0x2'),'afterDestroy':'remove'};function emitEvent(_0x28704c){return function(_0x42bfbc,_0x5508a5,_0x1f0a5f){DashboardItemEvents[_0x713f('0x3')](_0x28704c+':'+_0x42bfbc['id'],_0x42bfbc);DashboardItemEvents[_0x713f('0x3')](_0x28704c,_0x42bfbc);_0x1f0a5f(null);};}for(var e in events){if(events[_0x713f('0x4')](e)){var event=events[e];DashboardItem[_0x713f('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x5253=['events','../../mysqldb','DashboardItem','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4f09ce,_0xb38621){var _0x329014=function(_0x518fcb){while(--_0x518fcb){_0x4f09ce['push'](_0x4f09ce['shift']());}};_0x329014(++_0xb38621);}(_0x5253,0xb4));var _0x3525=function(_0x57c15d,_0x2157a2){_0x57c15d=_0x57c15d-0x0;var _0x54ec26=_0x5253[_0x57c15d];return _0x54ec26;};'use strict';var EventEmitter=require(_0x3525('0x0'));var DashboardItem=require(_0x3525('0x1'))['db'][_0x3525('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3525('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3525('0x4')};function emitEvent(_0x3e10ab){return function(_0x83aa22,_0x59a29d,_0x16e66b){DashboardItemEvents[_0x3525('0x5')](_0x3e10ab+':'+_0x83aa22['id'],_0x83aa22);DashboardItemEvents['emit'](_0x3e10ab,_0x83aa22);_0x16e66b(null);};}for(var e in events){if(events[_0x3525('0x6')](e)){var event=events[e];DashboardItem[_0x3525('0x7')](e,emitEvent(event));}}module[_0x3525('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 2bab853..20bc98c 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 _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util'];(function(_0x2582df,_0x54f87b){var _0x5c071f=function(_0x7ed86e){while(--_0x7ed86e){_0x2582df['push'](_0x2582df['shift']());}};_0x5c071f(++_0x54f87b);}(_0x9f62,0x154));var _0x29f6=function(_0x1e1a4b,_0x30df3c){_0x1e1a4b=_0x1e1a4b-0x0;var _0x3f4945=_0x9f62[_0x1e1a4b];return _0x3f4945;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30d2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash','../../config/logger','api'];(function(_0x1129a5,_0x55b919){var _0x2845ac=function(_0x3e213a){while(--_0x3e213a){_0x1129a5['push'](_0x1129a5['shift']());}};_0x2845ac(++_0x55b919);}(_0x30d2,0x190));var _0x230d=function(_0x426cad,_0x45810d){_0x426cad=_0x426cad-0x0;var _0x50c00f=_0x30d2[_0x426cad];return _0x50c00f;};'use strict';var _=require(_0x230d('0x0'));var util=require('util');var logger=require(_0x230d('0x1'))(_0x230d('0x2'));var moment=require(_0x230d('0x3'));var BPromise=require(_0x230d('0x4'));var rp=require(_0x230d('0x5'));var fs=require('fs');var path=require(_0x230d('0x6'));var rimraf=require(_0x230d('0x7'));var config=require(_0x230d('0x8'));var attributes=require(_0x230d('0x9'));module[_0x230d('0xa')]=function(_0x469a0c,_0x3b550c){return _0x469a0c[_0x230d('0xb')](_0x230d('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 18f7cdc..f7e5419 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 _0x40da=['jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x34a8b0,_0x17a597){var _0x1e318a=function(_0x179d8a){while(--_0x179d8a){_0x34a8b0['push'](_0x34a8b0['shift']());}};_0x1e318a(++_0x17a597);}(_0x40da,0x1e3));var _0xa40d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x40da[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xa40d('0x0'));var util=require(_0xa40d('0x1'));var moment=require(_0xa40d('0x2'));var BPromise=require(_0xa40d('0x3'));var rs=require(_0xa40d('0x4'));var fs=require('fs');var Redis=require(_0xa40d('0x5'));var db=require(_0xa40d('0x6'))['db'];var utils=require(_0xa40d('0x7'));var logger=require(_0xa40d('0x8'))(_0xa40d('0x9'));var config=require('../../config/environment');var jayson=require(_0xa40d('0xa'));var client=jayson[_0xa40d('0xb')][_0xa40d('0xc')]({'port':0x232a});config[_0xa40d('0xd')]=_[_0xa40d('0xe')](config[_0xa40d('0xd')],{'host':_0xa40d('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa40d('0xd')]));require(_0xa40d('0x10'))['register'](socket);function respondWithRpcPromise(_0x6b0d8f,_0x56f738,_0x4ed759){return new BPromise(function(_0x2ad5c1,_0xfacd4a){return client[_0xa40d('0x11')](_0x6b0d8f,_0x4ed759)[_0xa40d('0x12')](function(_0xb9813a){logger[_0xa40d('0x13')](_0xa40d('0x14'),_0x56f738,_0xa40d('0x15'));logger[_0xa40d('0x16')](_0xa40d('0x17'),_0x56f738,_0xa40d('0x15'),JSON[_0xa40d('0x18')](_0xb9813a));if(_0xb9813a['error']){if(_0xb9813a['error'][_0xa40d('0x19')]===0x1f4){logger['error'](_0xa40d('0x14'),_0x56f738,_0xb9813a[_0xa40d('0x1a')][_0xa40d('0x1b')]);return _0xfacd4a(_0xb9813a[_0xa40d('0x1a')][_0xa40d('0x1b')]);}logger[_0xa40d('0x1a')]('DashboardItem,\x20%s,\x20%s',_0x56f738,_0xb9813a[_0xa40d('0x1a')][_0xa40d('0x1b')]);return _0x2ad5c1(_0xb9813a[_0xa40d('0x1a')]['message']);}else{logger[_0xa40d('0x13')](_0xa40d('0x14'),_0x56f738,'request\x20sent');_0x2ad5c1(_0xb9813a[_0xa40d('0x1c')][_0xa40d('0x1b')]);}})['catch'](function(_0x684fe2){logger[_0xa40d('0x1a')](_0xa40d('0x14'),_0x56f738,_0x684fe2);_0xfacd4a(_0x684fe2);});});} \ No newline at end of file +var _0xcc96=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x17f3df,_0xdc212b){var _0x1163d8=function(_0x3ef3b9){while(--_0x3ef3b9){_0x17f3df['push'](_0x17f3df['shift']());}};_0x1163d8(++_0xdc212b);}(_0xcc96,0x18c));var _0x6cc9=function(_0x37fe88,_0x39c460){_0x37fe88=_0x37fe88-0x0;var _0x4cedd6=_0xcc96[_0x37fe88];return _0x4cedd6;};'use strict';var _=require(_0x6cc9('0x0'));var util=require(_0x6cc9('0x1'));var moment=require(_0x6cc9('0x2'));var BPromise=require(_0x6cc9('0x3'));var rs=require(_0x6cc9('0x4'));var fs=require('fs');var Redis=require(_0x6cc9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6cc9('0x6'));var logger=require(_0x6cc9('0x7'))(_0x6cc9('0x8'));var config=require(_0x6cc9('0x9'));var jayson=require(_0x6cc9('0xa'));var client=jayson['client'][_0x6cc9('0xb')]({'port':0x232a});config[_0x6cc9('0xc')]=_[_0x6cc9('0xd')](config[_0x6cc9('0xc')],{'host':_0x6cc9('0xe'),'port':0x18eb});var socket=require(_0x6cc9('0xf'))(new Redis(config[_0x6cc9('0xc')]));require(_0x6cc9('0x10'))['register'](socket);function respondWithRpcPromise(_0x4ab554,_0x11d6a2,_0x401108){return new BPromise(function(_0x56114f,_0x5ea7fa){return client[_0x6cc9('0x11')](_0x4ab554,_0x401108)['then'](function(_0x535cde){logger[_0x6cc9('0x12')](_0x6cc9('0x13'),_0x11d6a2,_0x6cc9('0x14'));logger[_0x6cc9('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x11d6a2,_0x6cc9('0x14'),JSON[_0x6cc9('0x16')](_0x535cde));if(_0x535cde[_0x6cc9('0x17')]){if(_0x535cde[_0x6cc9('0x17')][_0x6cc9('0x18')]===0x1f4){logger[_0x6cc9('0x17')](_0x6cc9('0x13'),_0x11d6a2,_0x535cde[_0x6cc9('0x17')]['message']);return _0x5ea7fa(_0x535cde['error'][_0x6cc9('0x19')]);}logger[_0x6cc9('0x17')](_0x6cc9('0x13'),_0x11d6a2,_0x535cde[_0x6cc9('0x17')][_0x6cc9('0x19')]);return _0x56114f(_0x535cde[_0x6cc9('0x17')]['message']);}else{logger[_0x6cc9('0x12')](_0x6cc9('0x13'),_0x11d6a2,_0x6cc9('0x14'));_0x56114f(_0x535cde[_0x6cc9('0x1a')][_0x6cc9('0x19')]);}})[_0x6cc9('0x1b')](function(_0x418dbd){logger[_0x6cc9('0x17')](_0x6cc9('0x13'),_0x11d6a2,_0x418dbd);_0x5ea7fa(_0x418dbd);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 0c69f32..52ec0e8 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 _0x1554=['length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','register'];(function(_0x12a79a,_0x1bba1f){var _0x2c144d=function(_0xe51841){while(--_0xe51841){_0x12a79a['push'](_0x12a79a['shift']());}};_0x2c144d(++_0x1bba1f);}(_0x1554,0x1ea));var _0x4155=function(_0x57d63a,_0x3bcf2e){_0x57d63a=_0x57d63a-0x0;var _0x676348=_0x1554[_0x57d63a];return _0x676348;};'use strict';var DashboardItemEvents=require(_0x4155('0x0'));var events=[_0x4155('0x1'),_0x4155('0x2'),_0x4155('0x3')];function createListener(_0x1d95ea,_0x5801b7){return function(_0x1bec29){_0x5801b7[_0x4155('0x4')](_0x1d95ea,_0x1bec29);};}function removeListener(_0x224fe5,_0x48fb29){return function(){DashboardItemEvents['removeListener'](_0x224fe5,_0x48fb29);};}exports[_0x4155('0x5')]=function(_0x4efef9){for(var _0x5e33b3=0x0,_0x37b1d6=events[_0x4155('0x6')];_0x5e33b3<_0x37b1d6;_0x5e33b3++){var _0x11b5e9=events[_0x5e33b3];var _0x5032c0=createListener(_0x4155('0x7')+_0x11b5e9,_0x4efef9);DashboardItemEvents['on'](_0x11b5e9,_0x5032c0);}}; \ No newline at end of file +var _0xe887=['emit','register','length','dashboardItem:','save','remove','update'];(function(_0x167fcf,_0x321323){var _0x178875=function(_0x1e9810){while(--_0x1e9810){_0x167fcf['push'](_0x167fcf['shift']());}};_0x178875(++_0x321323);}(_0xe887,0xeb));var _0x7e88=function(_0x5ae8eb,_0x1be007){_0x5ae8eb=_0x5ae8eb-0x0;var _0x34ea12=_0xe887[_0x5ae8eb];return _0x34ea12;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x7e88('0x0'),_0x7e88('0x1'),_0x7e88('0x2')];function createListener(_0x1f00dc,_0x50614d){return function(_0x2d318a){_0x50614d[_0x7e88('0x3')](_0x1f00dc,_0x2d318a);};}function removeListener(_0x1884e3,_0x12d76d){return function(){DashboardItemEvents['removeListener'](_0x1884e3,_0x12d76d);};}exports[_0x7e88('0x4')]=function(_0x282c0b){for(var _0x4ef309=0x0,_0x1a3e79=events[_0x7e88('0x5')];_0x4ef309<_0x1a3e79;_0x4ef309++){var _0x5db251=events[_0x4ef309];var _0x1eb996=createListener(_0x7e88('0x6')+_0x5db251,_0x282c0b);DashboardItemEvents['on'](_0x5db251,_0x1eb996);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 54dd29e..c493d74 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 _0x8a59=['update','delete','destroy','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','put'];(function(_0x2a7d59,_0x5bc382){var _0x4dfc36=function(_0x696e8e){while(--_0x696e8e){_0x2a7d59['push'](_0x2a7d59['shift']());}};_0x4dfc36(++_0x5bc382);}(_0x8a59,0x120));var _0x98a5=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8a59[_0x20c9b2];return _0x2c6030;};'use strict';var multer=require('multer');var util=require(_0x98a5('0x0'));var path=require('path');var timeout=require(_0x98a5('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x98a5('0x2'));var auth=require(_0x98a5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x98a5('0x4'));var controller=require(_0x98a5('0x5'));router[_0x98a5('0x6')](_0x98a5('0x7'),auth[_0x98a5('0x8')](),controller[_0x98a5('0x9')]);router[_0x98a5('0xa')]('/',auth[_0x98a5('0x8')](),controller['create']);router[_0x98a5('0xb')](_0x98a5('0x7'),auth[_0x98a5('0x8')](),controller[_0x98a5('0xc')]);router[_0x98a5('0xd')](_0x98a5('0x7'),auth['isAuthenticated'](),controller[_0x98a5('0xe')]);module['exports']=router; \ No newline at end of file +var _0xc04b=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x21ecc8,_0x2bdead){var _0x510c1d=function(_0x3b6862){while(--_0x3b6862){_0x21ecc8['push'](_0x21ecc8['shift']());}};_0x510c1d(++_0x2bdead);}(_0xc04b,0xdc));var _0xbc04=function(_0x184f06,_0x573ead){_0x184f06=_0x184f06-0x0;var _0x49b7e0=_0xc04b[_0x184f06];return _0x49b7e0;};'use strict';var multer=require('multer');var util=require(_0xbc04('0x0'));var path=require(_0xbc04('0x1'));var timeout=require(_0xbc04('0x2'));var express=require('express');var router=express[_0xbc04('0x3')]();var fs_extra=require(_0xbc04('0x4'));var auth=require(_0xbc04('0x5'));var interaction=require(_0xbc04('0x6'));var config=require(_0xbc04('0x7'));var controller=require(_0xbc04('0x8'));router[_0xbc04('0x9')](_0xbc04('0xa'),auth[_0xbc04('0xb')](),controller[_0xbc04('0xc')]);router[_0xbc04('0xd')]('/',auth[_0xbc04('0xb')](),controller[_0xbc04('0xe')]);router[_0xbc04('0xf')](_0xbc04('0xa'),auth[_0xbc04('0xb')](),controller[_0xbc04('0x10')]);router[_0xbc04('0x11')](_0xbc04('0xa'),auth['isAuthenticated'](),controller[_0xbc04('0x12')]);module[_0xbc04('0x13')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 73e7559..87b1b38 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 _0x8084=['exports','STRING','first'];(function(_0x5b834d,_0x41719b){var _0x5af488=function(_0x5866fa){while(--_0x5866fa){_0x5b834d['push'](_0x5b834d['shift']());}};_0x5af488(++_0x41719b);}(_0x8084,0xe7));var _0x4808=function(_0x3822f8,_0x12e40b){_0x3822f8=_0x3822f8-0x0;var _0x4b50ff=_0x8084[_0x3822f8];return _0x4b50ff;};'use strict';var Sequelize=require('sequelize');module[_0x4808('0x0')]={'name':{'type':Sequelize[_0x4808('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x4808('0x2'),'second','third'),'allowNull':![],'defaultValue':_0x4808('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaaca=['exports','second','third','STRING','sequelize'];(function(_0x3c42ff,_0x45ee1f){var _0x4c0f6d=function(_0x3ec265){while(--_0x3ec265){_0x3c42ff['push'](_0x3c42ff['shift']());}};_0x4c0f6d(++_0x45ee1f);}(_0xaaca,0x72));var _0xaaac=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xaaca[_0x5e4563];return _0x8d1bf5;};'use strict';var Sequelize=require(_0xaaac('0x0'));module[_0xaaac('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0xaaac('0x2'),_0xaaac('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xaaac('0x4')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index f0ffcd3..0aeee0a 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 _0xdf76=['offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','map','Disposition','fieldName','type','key','model','keys','query','attributes','intersection','fields','nolimit','order','pick','filters','where','merge','VIRTUAL','filter','includeAll','findAll','rows','show','rawAttributes','length','include','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x445450,_0x2fadfa){var _0x11d305=function(_0xd47c89){while(--_0xd47c89){_0x445450['push'](_0x445450['shift']());}};_0x11d305(++_0x2fadfa);}(_0xdf76,0x1d5));var _0x6df7=function(_0x4bf3a7,_0x5d756b){_0x4bf3a7=_0x4bf3a7-0x0;var _0x58c9cc=_0xdf76[_0x4bf3a7];return _0x58c9cc;};'use strict';var emlformat=require(_0x6df7('0x0'));var rimraf=require(_0x6df7('0x1'));var zipdir=require(_0x6df7('0x2'));var jsonpatch=require(_0x6df7('0x3'));var rp=require(_0x6df7('0x4'));var moment=require('moment');var BPromise=require(_0x6df7('0x5'));var Mustache=require(_0x6df7('0x6'));var util=require(_0x6df7('0x7'));var path=require(_0x6df7('0x8'));var sox=require(_0x6df7('0x9'));var csv=require(_0x6df7('0xa'));var ejs=require(_0x6df7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6df7('0xc'));var squel=require(_0x6df7('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6df7('0xe'));var toCsv=require(_0x6df7('0xa'));var querystring=require(_0x6df7('0xf'));var Papa=require(_0x6df7('0x10'));var Redis=require(_0x6df7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6df7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6df7('0x13'))(_0x6df7('0x14'));var utils=require(_0x6df7('0x15'));var config=require(_0x6df7('0x16'));var licenseUtil=require(_0x6df7('0x17'));var db=require(_0x6df7('0x18'))['db'];function respondWithStatusCode(_0x2859cd,_0x75457c){_0x75457c=_0x75457c||0xcc;return function(_0xf5591b){if(_0xf5591b){return _0x2859cd[_0x6df7('0x19')](_0x75457c);}return _0x2859cd[_0x6df7('0x1a')](_0x75457c)[_0x6df7('0x1b')]();};}function respondWithResult(_0x4b638d,_0x431b93){_0x431b93=_0x431b93||0xc8;return function(_0x3fed69){if(_0x3fed69){return _0x4b638d[_0x6df7('0x1a')](_0x431b93)[_0x6df7('0x1c')](_0x3fed69);}};}function respondWithFilteredResult(_0x371020,_0x15d1dd){return function(_0x3cd321){if(_0x3cd321){var _0x3128ea=typeof _0x15d1dd[_0x6df7('0x1d')]==='undefined'&&typeof _0x15d1dd[_0x6df7('0x1e')]===_0x6df7('0x1f');var _0x4402b6=_0x3cd321[_0x6df7('0x20')];var _0x4f9211=_0x3128ea?0x0:_0x15d1dd[_0x6df7('0x1d')];var _0x1cfce0=_0x3128ea?_0x3cd321[_0x6df7('0x20')]:_0x15d1dd['offset']+_0x15d1dd[_0x6df7('0x1e')];var _0x195eb6;if(_0x1cfce0>=_0x4402b6){_0x1cfce0=_0x4402b6;_0x195eb6=0xc8;}else{_0x195eb6=0xce;}_0x371020[_0x6df7('0x1a')](_0x195eb6);return _0x371020[_0x6df7('0x21')](_0x6df7('0x22'),_0x4f9211+'-'+_0x1cfce0+'/'+_0x4402b6)[_0x6df7('0x1c')](_0x3cd321);}return null;};}function patchUpdates(_0x23373d){return function(_0x138f4d){try{jsonpatch['apply'](_0x138f4d,_0x23373d,!![]);}catch(_0x48e841){return BPromise['reject'](_0x48e841);}return _0x138f4d[_0x6df7('0x23')]();};}function saveUpdates(_0x3f52ab,_0x16fab9){return function(_0x2e5c71){if(_0x2e5c71){return _0x2e5c71[_0x6df7('0x24')](_0x3f52ab)[_0x6df7('0x25')](function(_0x49f826){return _0x49f826;});}return null;};}function removeEntity(_0x37ddec,_0x20e6eb){return function(_0x3102e2){if(_0x3102e2){return _0x3102e2[_0x6df7('0x26')]()[_0x6df7('0x25')](function(){var _0x5df1cb=_0x3102e2[_0x6df7('0x27')]({'plain':!![]});var _0xa747b9=_0x6df7('0x28');return db[_0x6df7('0x29')]['destroy']({'where':{'type':_0xa747b9,'resourceId':_0x5df1cb['id']}})[_0x6df7('0x25')](function(){return _0x3102e2;});})[_0x6df7('0x25')](function(){_0x37ddec[_0x6df7('0x1a')](0xcc)[_0x6df7('0x1b')]();});}};}function handleEntityNotFound(_0x53d854,_0x2cd8e6){return function(_0xbd949a){if(!_0xbd949a){_0x53d854[_0x6df7('0x19')](0x194);}return _0xbd949a;};}function handleError(_0x313e74,_0x1f6ff7){_0x1f6ff7=_0x1f6ff7||0x1f4;return function(_0x5eb080){logger[_0x6df7('0x2a')](_0x5eb080[_0x6df7('0x2b')]);if(_0x5eb080[_0x6df7('0x2c')]){delete _0x5eb080[_0x6df7('0x2c')];}_0x313e74[_0x6df7('0x1a')](_0x1f6ff7)['send'](_0x5eb080);};}exports['index']=function(_0x2e6234,_0x23294a){var _0x1fef1b={},_0x159d48={},_0x2f4ba5={'count':0x0,'rows':[]};var _0x5cb3e1=_[_0x6df7('0x2d')](db[_0x6df7('0x2e')]['rawAttributes'],function(_0x3ee6b6){return{'name':_0x3ee6b6[_0x6df7('0x2f')],'type':_0x3ee6b6[_0x6df7('0x30')][_0x6df7('0x31')]};});_0x159d48[_0x6df7('0x32')]=_[_0x6df7('0x2d')](_0x5cb3e1,_0x6df7('0x2c'));_0x159d48['query']=_[_0x6df7('0x33')](_0x2e6234['query']);_0x159d48['filters']=_['intersection'](_0x159d48[_0x6df7('0x32')],_0x159d48[_0x6df7('0x34')]);_0x1fef1b[_0x6df7('0x35')]=_[_0x6df7('0x36')](_0x159d48[_0x6df7('0x32')],qs[_0x6df7('0x37')](_0x2e6234['query'][_0x6df7('0x37')]));_0x1fef1b[_0x6df7('0x35')]=_0x1fef1b[_0x6df7('0x35')]['length']?_0x1fef1b[_0x6df7('0x35')]:_0x159d48[_0x6df7('0x32')];if(!_0x2e6234[_0x6df7('0x34')]['hasOwnProperty'](_0x6df7('0x38'))){_0x1fef1b[_0x6df7('0x1e')]=qs['limit'](_0x2e6234[_0x6df7('0x34')]['limit']);_0x1fef1b['offset']=qs['offset'](_0x2e6234['query'][_0x6df7('0x1d')]);}_0x1fef1b[_0x6df7('0x39')]=qs['sort'](_0x2e6234[_0x6df7('0x34')]['sort']);_0x1fef1b['where']=qs['filters'](_[_0x6df7('0x3a')](_0x2e6234[_0x6df7('0x34')],_0x159d48[_0x6df7('0x3b')]),_0x5cb3e1);if(_0x2e6234[_0x6df7('0x34')]['filter']){_0x1fef1b[_0x6df7('0x3c')]=_[_0x6df7('0x3d')](_0x1fef1b[_0x6df7('0x3c')],{'$or':_[_0x6df7('0x2d')](_0x5cb3e1,function(_0x2f1c1d){if(_0x2f1c1d[_0x6df7('0x30')]!==_0x6df7('0x3e')){var _0x1870b7={};_0x1870b7[_0x2f1c1d[_0x6df7('0x2c')]]={'$like':'%'+_0x2e6234[_0x6df7('0x34')][_0x6df7('0x3f')]+'%'};return _0x1870b7;}})});}_0x1fef1b=_['merge']({},_0x1fef1b,_0x2e6234['options']);var _0x3a5289={'where':_0x1fef1b['where']};return db[_0x6df7('0x2e')]['count'](_0x3a5289)[_0x6df7('0x25')](function(_0xccb2bf){_0x2f4ba5[_0x6df7('0x20')]=_0xccb2bf;if(_0x2e6234[_0x6df7('0x34')][_0x6df7('0x40')]){_0x1fef1b['include']=[{'all':!![]}];}return db['Disposition'][_0x6df7('0x41')](_0x1fef1b);})[_0x6df7('0x25')](function(_0x305ad0){_0x2f4ba5[_0x6df7('0x42')]=_0x305ad0;return _0x2f4ba5;})[_0x6df7('0x25')](respondWithFilteredResult(_0x23294a,_0x1fef1b))['catch'](handleError(_0x23294a,null));};exports[_0x6df7('0x43')]=function(_0x1f6070,_0x124d6b){var _0x65a77a={'raw':!![],'where':{'id':_0x1f6070['params']['id']}},_0xd7958f={};_0xd7958f[_0x6df7('0x32')]=_['keys'](db['Disposition'][_0x6df7('0x44')]);_0xd7958f[_0x6df7('0x34')]=_[_0x6df7('0x33')](_0x1f6070[_0x6df7('0x34')]);_0xd7958f[_0x6df7('0x3b')]=_[_0x6df7('0x36')](_0xd7958f['model'],_0xd7958f[_0x6df7('0x34')]);_0x65a77a[_0x6df7('0x35')]=_['intersection'](_0xd7958f['model'],qs['fields'](_0x1f6070[_0x6df7('0x34')][_0x6df7('0x37')]));_0x65a77a['attributes']=_0x65a77a['attributes'][_0x6df7('0x45')]?_0x65a77a['attributes']:_0xd7958f[_0x6df7('0x32')];if(_0x1f6070['query'][_0x6df7('0x40')]){_0x65a77a[_0x6df7('0x46')]=[{'all':!![]}];}_0x65a77a=_[_0x6df7('0x3d')]({},_0x65a77a,_0x1f6070[_0x6df7('0x47')]);return db['Disposition'][_0x6df7('0x48')](_0x65a77a)[_0x6df7('0x25')](handleEntityNotFound(_0x124d6b,null))[_0x6df7('0x25')](respondWithResult(_0x124d6b,null))[_0x6df7('0x49')](handleError(_0x124d6b,null));};exports[_0x6df7('0x4a')]=function(_0x1a6bcd,_0x11e8d1){return db[_0x6df7('0x2e')][_0x6df7('0x4a')](_0x1a6bcd[_0x6df7('0x4b')],{})[_0x6df7('0x25')](function(_0x337acf){var _0x11a550=_0x1a6bcd[_0x6df7('0x4c')][_0x6df7('0x27')]({'plain':!![]});if(!_0x11a550)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11a550[_0x6df7('0x4d')]===_0x6df7('0x4c')){var _0x168c40=_0x337acf[_0x6df7('0x27')]({'plain':!![]});var _0x3fd415=_0x6df7('0x28');return db[_0x6df7('0x4e')][_0x6df7('0x48')]({'where':{'name':_0x3fd415,'userProfileId':_0x11a550[_0x6df7('0x4f')]},'raw':!![]})[_0x6df7('0x25')](function(_0x1da783){if(_0x1da783&&_0x1da783[_0x6df7('0x50')]===0x0){return db[_0x6df7('0x29')][_0x6df7('0x4a')]({'name':_0x168c40[_0x6df7('0x2c')],'resourceId':_0x168c40['id'],'type':_0x1da783[_0x6df7('0x2c')],'sectionId':_0x1da783['id']},{})['then'](function(){return _0x337acf;});}else{return _0x337acf;}})['catch'](function(_0xada0d5){logger[_0x6df7('0x2a')](_0x6df7('0x51'),_0xada0d5);throw _0xada0d5;});}return _0x337acf;})['then'](respondWithResult(_0x11e8d1,0xc9))['catch'](handleError(_0x11e8d1,null));};exports['update']=function(_0x24bb61,_0x5792a2){if(_0x24bb61['body']['id']){delete _0x24bb61[_0x6df7('0x4b')]['id'];}return db[_0x6df7('0x2e')][_0x6df7('0x48')]({'where':{'id':_0x24bb61[_0x6df7('0x52')]['id']}})[_0x6df7('0x25')](handleEntityNotFound(_0x5792a2,null))[_0x6df7('0x25')](saveUpdates(_0x24bb61[_0x6df7('0x4b')],null))['then'](respondWithResult(_0x5792a2,null))[_0x6df7('0x49')](handleError(_0x5792a2,null));};exports['destroy']=function(_0x3d9a62,_0x4935e0){return db[_0x6df7('0x2e')][_0x6df7('0x48')]({'where':{'id':_0x3d9a62['params']['id']}})[_0x6df7('0x25')](handleEntityNotFound(_0x4935e0,null))['then'](removeEntity(_0x4935e0,null))[_0x6df7('0x49')](handleError(_0x4935e0,null));}; \ No newline at end of file +var _0x6868=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse'];(function(_0x1bc36b,_0x9422d3){var _0x7e5a2f=function(_0x2a0689){while(--_0x2a0689){_0x1bc36b['push'](_0x1bc36b['shift']());}};_0x7e5a2f(++_0x9422d3);}(_0x6868,0x90));var _0x8686=function(_0x22ac68,_0x4b95f3){_0x22ac68=_0x22ac68-0x0;var _0x2a0e44=_0x6868[_0x22ac68];return _0x2a0e44;};'use strict';var emlformat=require(_0x8686('0x0'));var rimraf=require(_0x8686('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8686('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8686('0x3'));var util=require(_0x8686('0x4'));var path=require('path');var sox=require(_0x8686('0x5'));var csv=require(_0x8686('0x6'));var ejs=require(_0x8686('0x7'));var fs=require('fs');var fs_extra=require(_0x8686('0x8'));var _=require('lodash');var squel=require(_0x8686('0x9'));var crypto=require(_0x8686('0xa'));var jsforce=require(_0x8686('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8686('0x6'));var querystring=require(_0x8686('0xc'));var Papa=require(_0x8686('0xd'));var Redis=require('ioredis');var authService=require(_0x8686('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8686('0xf'));var hardwareService=require(_0x8686('0x10'));var logger=require(_0x8686('0x11'))(_0x8686('0x12'));var utils=require('../../config/utils');var config=require(_0x8686('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b6076,_0x1ea71f){_0x1ea71f=_0x1ea71f||0xcc;return function(_0x5a7100){if(_0x5a7100){return _0x3b6076[_0x8686('0x14')](_0x1ea71f);}return _0x3b6076[_0x8686('0x15')](_0x1ea71f)[_0x8686('0x16')]();};}function respondWithResult(_0x4f4c12,_0x181312){_0x181312=_0x181312||0xc8;return function(_0x1cfbb3){if(_0x1cfbb3){return _0x4f4c12[_0x8686('0x15')](_0x181312)[_0x8686('0x17')](_0x1cfbb3);}};}function respondWithFilteredResult(_0x1d1927,_0x2b16ab){return function(_0x7c94d4){if(_0x7c94d4){var _0x301aaa=typeof _0x2b16ab['offset']==='undefined'&&typeof _0x2b16ab[_0x8686('0x18')]==='undefined';var _0x45533b=_0x7c94d4[_0x8686('0x19')];var _0x3397eb=_0x301aaa?0x0:_0x2b16ab['offset'];var _0x263e64=_0x301aaa?_0x7c94d4[_0x8686('0x19')]:_0x2b16ab[_0x8686('0x1a')]+_0x2b16ab[_0x8686('0x18')];var _0x491a37;if(_0x263e64>=_0x45533b){_0x263e64=_0x45533b;_0x491a37=0xc8;}else{_0x491a37=0xce;}_0x1d1927[_0x8686('0x15')](_0x491a37);return _0x1d1927['set'](_0x8686('0x1b'),_0x3397eb+'-'+_0x263e64+'/'+_0x45533b)[_0x8686('0x17')](_0x7c94d4);}return null;};}function patchUpdates(_0x5beeb7){return function(_0x19ad0d){try{jsonpatch[_0x8686('0x1c')](_0x19ad0d,_0x5beeb7,!![]);}catch(_0x3afd00){return BPromise['reject'](_0x3afd00);}return _0x19ad0d[_0x8686('0x1d')]();};}function saveUpdates(_0x4b2fd3,_0x428922){return function(_0x4a2faf){if(_0x4a2faf){return _0x4a2faf[_0x8686('0x1e')](_0x4b2fd3)[_0x8686('0x1f')](function(_0x5ca7ca){return _0x5ca7ca;});}return null;};}function removeEntity(_0x92a1f0,_0x3605bd){return function(_0x2f0ed9){if(_0x2f0ed9){return _0x2f0ed9[_0x8686('0x20')]()[_0x8686('0x1f')](function(){var _0x190dbc=_0x2f0ed9['get']({'plain':!![]});var _0x58e11e='Dispositions';return db[_0x8686('0x21')][_0x8686('0x20')]({'where':{'type':_0x58e11e,'resourceId':_0x190dbc['id']}})[_0x8686('0x1f')](function(){return _0x2f0ed9;});})[_0x8686('0x1f')](function(){_0x92a1f0[_0x8686('0x15')](0xcc)[_0x8686('0x16')]();});}};}function handleEntityNotFound(_0x1c5d90,_0x47aad6){return function(_0x156305){if(!_0x156305){_0x1c5d90[_0x8686('0x14')](0x194);}return _0x156305;};}function handleError(_0x6e8fbb,_0x5367ca){_0x5367ca=_0x5367ca||0x1f4;return function(_0x383722){logger[_0x8686('0x22')](_0x383722[_0x8686('0x23')]);if(_0x383722['name']){delete _0x383722[_0x8686('0x24')];}_0x6e8fbb['status'](_0x5367ca)[_0x8686('0x25')](_0x383722);};}exports[_0x8686('0x26')]=function(_0x48efae,_0x50a2d5){var _0x4387af={},_0x5862f5={},_0x53e7ce={'count':0x0,'rows':[]};var _0x3e6d02=_[_0x8686('0x27')](db[_0x8686('0x28')][_0x8686('0x29')],function(_0x37c89b){return{'name':_0x37c89b[_0x8686('0x2a')],'type':_0x37c89b['type'][_0x8686('0x2b')]};});_0x5862f5[_0x8686('0x2c')]=_[_0x8686('0x27')](_0x3e6d02,_0x8686('0x24'));_0x5862f5[_0x8686('0x2d')]=_[_0x8686('0x2e')](_0x48efae[_0x8686('0x2d')]);_0x5862f5['filters']=_[_0x8686('0x2f')](_0x5862f5[_0x8686('0x2c')],_0x5862f5[_0x8686('0x2d')]);_0x4387af[_0x8686('0x30')]=_[_0x8686('0x2f')](_0x5862f5['model'],qs[_0x8686('0x31')](_0x48efae[_0x8686('0x2d')][_0x8686('0x31')]));_0x4387af[_0x8686('0x30')]=_0x4387af[_0x8686('0x30')][_0x8686('0x32')]?_0x4387af[_0x8686('0x30')]:_0x5862f5[_0x8686('0x2c')];if(!_0x48efae['query']['hasOwnProperty'](_0x8686('0x33'))){_0x4387af[_0x8686('0x18')]=qs[_0x8686('0x18')](_0x48efae[_0x8686('0x2d')][_0x8686('0x18')]);_0x4387af[_0x8686('0x1a')]=qs[_0x8686('0x1a')](_0x48efae[_0x8686('0x2d')]['offset']);}_0x4387af['order']=qs[_0x8686('0x34')](_0x48efae[_0x8686('0x2d')][_0x8686('0x34')]);_0x4387af[_0x8686('0x35')]=qs[_0x8686('0x36')](_[_0x8686('0x37')](_0x48efae[_0x8686('0x2d')],_0x5862f5[_0x8686('0x36')]),_0x3e6d02);if(_0x48efae[_0x8686('0x2d')][_0x8686('0x38')]){_0x4387af[_0x8686('0x35')]=_['merge'](_0x4387af[_0x8686('0x35')],{'$or':_[_0x8686('0x27')](_0x3e6d02,function(_0x544b6f){if(_0x544b6f[_0x8686('0x39')]!==_0x8686('0x3a')){var _0x44032d={};_0x44032d[_0x544b6f[_0x8686('0x24')]]={'$like':'%'+_0x48efae[_0x8686('0x2d')][_0x8686('0x38')]+'%'};return _0x44032d;}})});}_0x4387af=_[_0x8686('0x3b')]({},_0x4387af,_0x48efae[_0x8686('0x3c')]);var _0x1312b9={'where':_0x4387af[_0x8686('0x35')]};return db[_0x8686('0x28')]['count'](_0x1312b9)[_0x8686('0x1f')](function(_0x37ee99){_0x53e7ce[_0x8686('0x19')]=_0x37ee99;if(_0x48efae[_0x8686('0x2d')][_0x8686('0x3d')]){_0x4387af[_0x8686('0x3e')]=[{'all':!![]}];}return db['Disposition'][_0x8686('0x3f')](_0x4387af);})['then'](function(_0x264675){_0x53e7ce[_0x8686('0x40')]=_0x264675;return _0x53e7ce;})[_0x8686('0x1f')](respondWithFilteredResult(_0x50a2d5,_0x4387af))[_0x8686('0x41')](handleError(_0x50a2d5,null));};exports['show']=function(_0x44542c,_0x761d88){var _0x337acd={'raw':!![],'where':{'id':_0x44542c['params']['id']}},_0x110141={};_0x110141[_0x8686('0x2c')]=_[_0x8686('0x2e')](db['Disposition']['rawAttributes']);_0x110141[_0x8686('0x2d')]=_['keys'](_0x44542c[_0x8686('0x2d')]);_0x110141[_0x8686('0x36')]=_['intersection'](_0x110141[_0x8686('0x2c')],_0x110141[_0x8686('0x2d')]);_0x337acd['attributes']=_['intersection'](_0x110141['model'],qs[_0x8686('0x31')](_0x44542c['query']['fields']));_0x337acd[_0x8686('0x30')]=_0x337acd[_0x8686('0x30')]['length']?_0x337acd[_0x8686('0x30')]:_0x110141['model'];if(_0x44542c[_0x8686('0x2d')][_0x8686('0x3d')]){_0x337acd[_0x8686('0x3e')]=[{'all':!![]}];}_0x337acd=_['merge']({},_0x337acd,_0x44542c[_0x8686('0x3c')]);return db[_0x8686('0x28')][_0x8686('0x42')](_0x337acd)[_0x8686('0x1f')](handleEntityNotFound(_0x761d88,null))[_0x8686('0x1f')](respondWithResult(_0x761d88,null))['catch'](handleError(_0x761d88,null));};exports[_0x8686('0x43')]=function(_0x3a73ef,_0x611b22){return db['Disposition'][_0x8686('0x43')](_0x3a73ef[_0x8686('0x44')],{})[_0x8686('0x1f')](function(_0x3b37ed){var _0x397afb=_0x3a73ef[_0x8686('0x45')][_0x8686('0x46')]({'plain':!![]});if(!_0x397afb)throw new Error(_0x8686('0x47'));if(_0x397afb[_0x8686('0x48')]==='user'){var _0x45a2e1=_0x3b37ed['get']({'plain':!![]});var _0x50a81a=_0x8686('0x49');return db[_0x8686('0x4a')][_0x8686('0x42')]({'where':{'name':_0x50a81a,'userProfileId':_0x397afb[_0x8686('0x4b')]},'raw':!![]})['then'](function(_0x1b7941){if(_0x1b7941&&_0x1b7941[_0x8686('0x4c')]===0x0){return db[_0x8686('0x21')][_0x8686('0x43')]({'name':_0x45a2e1[_0x8686('0x24')],'resourceId':_0x45a2e1['id'],'type':_0x1b7941['name'],'sectionId':_0x1b7941['id']},{})[_0x8686('0x1f')](function(){return _0x3b37ed;});}else{return _0x3b37ed;}})[_0x8686('0x41')](function(_0x456525){logger[_0x8686('0x22')](_0x8686('0x4d'),_0x456525);throw _0x456525;});}return _0x3b37ed;})['then'](respondWithResult(_0x611b22,0xc9))['catch'](handleError(_0x611b22,null));};exports[_0x8686('0x1e')]=function(_0x523a7b,_0x58b0fc){if(_0x523a7b[_0x8686('0x44')]['id']){delete _0x523a7b[_0x8686('0x44')]['id'];}return db[_0x8686('0x28')][_0x8686('0x42')]({'where':{'id':_0x523a7b[_0x8686('0x4e')]['id']}})[_0x8686('0x1f')](handleEntityNotFound(_0x58b0fc,null))[_0x8686('0x1f')](saveUpdates(_0x523a7b[_0x8686('0x44')],null))[_0x8686('0x1f')](respondWithResult(_0x58b0fc,null))[_0x8686('0x41')](handleError(_0x58b0fc,null));};exports[_0x8686('0x20')]=function(_0x16aee1,_0x536749){return db[_0x8686('0x28')][_0x8686('0x42')]({'where':{'id':_0x16aee1[_0x8686('0x4e')]['id']}})[_0x8686('0x1f')](handleEntityNotFound(_0x536749,null))[_0x8686('0x1f')](removeEntity(_0x536749,null))['catch'](handleError(_0x536749,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 6c6b66f..cbecf8e 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 _0x6ca3=['bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','../../config/logger','api'];(function(_0x297785,_0x114f27){var _0x2ca064=function(_0x2f814d){while(--_0x2f814d){_0x297785['push'](_0x297785['shift']());}};_0x2ca064(++_0x114f27);}(_0x6ca3,0x75));var _0x36ca=function(_0x56a69f,_0x1bf698){_0x56a69f=_0x56a69f-0x0;var _0x1cb629=_0x6ca3[_0x56a69f];return _0x1cb629;};'use strict';var _=require(_0x36ca('0x0'));var util=require('util');var logger=require(_0x36ca('0x1'))(_0x36ca('0x2'));var moment=require('moment');var BPromise=require(_0x36ca('0x3'));var rp=require(_0x36ca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36ca('0x5'));var config=require(_0x36ca('0x6'));var attributes=require(_0x36ca('0x7'));module['exports']=function(_0x3e2435,_0x3d998f){return _0x3e2435['define'](_0x36ca('0x8'),attributes,{'tableName':_0x36ca('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x36ca('0xa'),'fields':[_0x36ca('0xb'),_0x36ca('0xc')]},{'unique':!![],'name':_0x36ca('0xd'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x36ca('0xb'),'MailAccountId']},{'unique':!![],'name':_0x36ca('0xe'),'fields':['name','SmsAccountId']},{'unique':!![],'name':_0x36ca('0xf'),'fields':['name',_0x36ca('0x10')]},{'unique':!![],'name':_0x36ca('0x11'),'fields':['name',_0x36ca('0x12')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x36ca('0xb'),_0x36ca('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4df=['ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name'];(function(_0x11df6d,_0x41e593){var _0x4ceeac=function(_0x10df85){while(--_0x10df85){_0x11df6d['push'](_0x11df6d['shift']());}};_0x4ceeac(++_0x41e593);}(_0xe4df,0x6e));var _0xfe4d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe4df[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfe4d('0x0'));var util=require('util');var logger=require(_0xfe4d('0x1'))(_0xfe4d('0x2'));var moment=require('moment');var BPromise=require(_0xfe4d('0x3'));var rp=require(_0xfe4d('0x4'));var fs=require('fs');var path=require(_0xfe4d('0x5'));var rimraf=require(_0xfe4d('0x6'));var config=require(_0xfe4d('0x7'));var attributes=require(_0xfe4d('0x8'));module[_0xfe4d('0x9')]=function(_0x1a7d82,_0x38e01c){return _0x1a7d82[_0xfe4d('0xa')](_0xfe4d('0xb'),attributes,{'tableName':_0xfe4d('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xfe4d('0xd'),'fields':[_0xfe4d('0xe'),_0xfe4d('0xf')]},{'unique':!![],'name':_0xfe4d('0x10'),'fields':[_0xfe4d('0xe'),_0xfe4d('0x11')]},{'unique':!![],'name':_0xfe4d('0x12'),'fields':[_0xfe4d('0xe'),_0xfe4d('0x13')]},{'unique':!![],'name':_0xfe4d('0x14'),'fields':[_0xfe4d('0xe'),'SmsAccountId']},{'unique':!![],'name':_0xfe4d('0x15'),'fields':[_0xfe4d('0xe'),_0xfe4d('0x16')]},{'unique':!![],'name':'name_openchannel','fields':[_0xfe4d('0xe'),'OpenchannelAccountId']},{'unique':!![],'name':_0xfe4d('0x17'),'fields':[_0xfe4d('0xe'),_0xfe4d('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index c29d295..c543f6d 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(_0x318237,_0x14c126){var _0x57dd1a=function(_0x2c4306){while(--_0x2c4306){_0x318237['push'](_0x318237['shift']());}};_0x57dd1a(++_0x14c126);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x2196d2,_0x2ed45d){var _0x19061f=function(_0x2d6162){while(--_0x2d6162){_0x2196d2['push'](_0x2196d2['shift']());}};_0x19061f(++_0x2ed45d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 93f3173..be37c57 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 _0x351a=['./disposition.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2961c2,_0x595adc){var _0x26724b=function(_0x478b88){while(--_0x478b88){_0x2961c2['push'](_0x2961c2['shift']());}};_0x26724b(++_0x595adc);}(_0x351a,0x1f0));var _0xa351=function(_0x47fbcf,_0x444500){_0x47fbcf=_0x47fbcf-0x0;var _0x234a16=_0x351a[_0x47fbcf];return _0x234a16;};'use strict';var multer=require('multer');var util=require(_0xa351('0x0'));var path=require(_0xa351('0x1'));var timeout=require(_0xa351('0x2'));var express=require(_0xa351('0x3'));var router=express[_0xa351('0x4')]();var fs_extra=require(_0xa351('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa351('0x6'));var config=require(_0xa351('0x7'));var controller=require(_0xa351('0x8'));router[_0xa351('0x9')]('/',auth[_0xa351('0xa')](),controller['index']);router['get'](_0xa351('0xb'),auth[_0xa351('0xa')](),controller[_0xa351('0xc')]);router[_0xa351('0xd')]('/',auth[_0xa351('0xa')](),controller['create']);router[_0xa351('0xe')](_0xa351('0xb'),auth[_0xa351('0xa')](),controller[_0xa351('0xf')]);router[_0xa351('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa351('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf14d=['delete','/:id','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','show','post','create','update'];(function(_0x231b24,_0x15d434){var _0x157b60=function(_0xbc2301){while(--_0xbc2301){_0x231b24['push'](_0x231b24['shift']());}};_0x157b60(++_0x15d434);}(_0xf14d,0x1a1));var _0xdf14=function(_0x2591f0,_0x2272bc){_0x2591f0=_0x2591f0-0x0;var _0x4a51ba=_0xf14d[_0x2591f0];return _0x4a51ba;};'use strict';var multer=require(_0xdf14('0x0'));var util=require(_0xdf14('0x1'));var path=require(_0xdf14('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf14('0x3'));var router=express['Router']();var fs_extra=require(_0xdf14('0x4'));var auth=require(_0xdf14('0x5'));var interaction=require(_0xdf14('0x6'));var config=require('../../config/environment');var controller=require(_0xdf14('0x7'));router[_0xdf14('0x8')]('/',auth[_0xdf14('0x9')](),controller[_0xdf14('0xa')]);router[_0xdf14('0x8')]('/:id',auth[_0xdf14('0x9')](),controller[_0xdf14('0xb')]);router[_0xdf14('0xc')]('/',auth[_0xdf14('0x9')](),controller[_0xdf14('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xdf14('0xe')]);router[_0xdf14('0xf')](_0xdf14('0x10'),auth[_0xdf14('0x9')](),controller[_0xdf14('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 57f4efb..d3a319f 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 _0x6df5=['BOOLEAN','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','9600','12000','14400','7200','INTEGER','SIP','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x40570d,_0x173745){var _0x53bc05=function(_0x2e0259){while(--_0x2e0259){_0x40570d['push'](_0x40570d['shift']());}};_0x53bc05(++_0x173745);}(_0x6df5,0xc1));var _0x56df=function(_0x55ae99,_0x5ab789){_0x55ae99=_0x55ae99-0x0;var _0x4297e1=_0x6df5[_0x55ae99];return _0x4297e1;};'use strict';var Sequelize=require(_0x56df('0x0'));module[_0x56df('0x1')]={'name':{'type':Sequelize[_0x56df('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x56df('0x2')]},'ecm':{'type':Sequelize[_0x56df('0x3')]('yes','no'),'defaultValue':_0x56df('0x4')},'headerinfo':{'type':Sequelize[_0x56df('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x56df('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x56df('0x6'),_0x56df('0x7'),'7200',_0x56df('0x8'),_0x56df('0x9'),_0x56df('0xa')),'defaultValue':_0x56df('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0x56df('0x6'),_0x56df('0x7'),_0x56df('0xb'),_0x56df('0x8'),'12000','14400'),'defaultValue':_0x56df('0xa')},'modem':{'type':Sequelize[_0x56df('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x56df('0x2')],'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[_0x56df('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x56df('0x3')](_0x56df('0xd'),'IAX',_0x56df('0xe'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x56df('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x56df('0xf')],'defaultValue':function(){return _0x56df('0x10');}},'notificationSound':{'type':Sequelize[_0x56df('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x56df('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x56df('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x56df('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x56df('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x56df('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x56df('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x56df('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x20dd60){if(!_0x20dd60)this['setDataValue'](_0x56df('0x12'),null);this[_0x56df('0x13')](_0x56df('0x14'),_0x20dd60);}}}; \ No newline at end of file +var _0x70e2=['9600','12000','14400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200'];(function(_0x446853,_0x287af6){var _0x5912d7=function(_0x504567){while(--_0x504567){_0x446853['push'](_0x446853['shift']());}};_0x5912d7(++_0x287af6);}(_0x70e2,0x150));var _0x270e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x70e2[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x270e('0x0'));module[_0x270e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x270e('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x270e('0x3')},'localstationid':{'type':Sequelize[_0x270e('0x2')],'unique':_0x270e('0x4')},'minrate':{'type':Sequelize[_0x270e('0x5')](_0x270e('0x6'),_0x270e('0x7'),_0x270e('0x8'),_0x270e('0x9'),_0x270e('0xa'),_0x270e('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x270e('0x6'),_0x270e('0x7'),'7200','9600',_0x270e('0xa'),_0x270e('0xb')),'defaultValue':_0x270e('0xb')},'modem':{'type':Sequelize[_0x270e('0x2')],'defaultValue':_0x270e('0xc')},'gateway':{'type':Sequelize[_0x270e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x270e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x270e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x270e('0x5')]('SIP',_0x270e('0xe'),_0x270e('0xf'),_0x270e('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x270e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x270e('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x270e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x270e('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x270e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x270e('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x270e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x270e('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x270e('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x270e('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x11feb7){if(!_0x11feb7)this[_0x270e('0x14')](_0x270e('0x15'),null);this[_0x270e('0x14')](_0x270e('0x16'),_0x11feb7);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index d0c1500..212a3ee 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 _0x8c75=['hasOwnProperty','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','FaxInteraction','addInteraction','getInteractions','pick','CmContact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','priority','getApplications','from-voip-provider','exten','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','localstationid','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','bulkCreate','omit','ListId','findById','FaxMessage','$gte','split','format','List','Contacts','updatedAt','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','addAgents','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','FaxAccountId','getDispositions','findOne','Disposition'];(function(_0xc7702b,_0x52385b){var _0x463c46=function(_0x3ede07){while(--_0x3ede07){_0xc7702b['push'](_0xc7702b['shift']());}};_0x463c46(++_0x52385b);}(_0x8c75,0x1d7));var _0x58c7=function(_0x4bc71b,_0x11c71b){_0x4bc71b=_0x4bc71b-0x0;var _0x12b505=_0x8c75[_0x4bc71b];return _0x12b505;};'use strict';var emlformat=require(_0x58c7('0x0'));var rimraf=require(_0x58c7('0x1'));var zipdir=require(_0x58c7('0x2'));var jsonpatch=require(_0x58c7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x58c7('0x4'));var Mustache=require(_0x58c7('0x5'));var util=require(_0x58c7('0x6'));var path=require(_0x58c7('0x7'));var sox=require(_0x58c7('0x8'));var csv=require(_0x58c7('0x9'));var ejs=require(_0x58c7('0xa'));var fs=require('fs');var fs_extra=require(_0x58c7('0xb'));var _=require(_0x58c7('0xc'));var squel=require(_0x58c7('0xd'));var crypto=require(_0x58c7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x58c7('0xf'));var toCsv=require(_0x58c7('0x9'));var querystring=require(_0x58c7('0x10'));var Papa=require(_0x58c7('0x11'));var Redis=require('ioredis');var authService=require(_0x58c7('0x12'));var qs=require(_0x58c7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x58c7('0x14'))(_0x58c7('0x15'));var utils=require(_0x58c7('0x16'));var config=require(_0x58c7('0x17'));var licenseUtil=require(_0x58c7('0x18'));var db=require('../../mysqldb')['db'];config[_0x58c7('0x19')]=_[_0x58c7('0x1a')](config[_0x58c7('0x19')],{'host':_0x58c7('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x58c7('0x19')]));require(_0x58c7('0x1c'))[_0x58c7('0x1d')](socket);var jayson=require(_0x58c7('0x1e'));var client=jayson[_0x58c7('0x1f')][_0x58c7('0x20')]({'port':0x232c});var client9002=jayson[_0x58c7('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52faae,_0x10c35d,_0x3e1548,_0x263f44){return new BPromise(function(_0x5efece,_0x43c680){var _0xf5910d=_0x263f44||client;return _0xf5910d[_0x58c7('0x21')](_0x52faae,_0x3e1548)[_0x58c7('0x22')](function(_0x4efb7a){logger[_0x58c7('0x23')](_0x58c7('0x24'),_0x10c35d,_0x58c7('0x25'));logger[_0x58c7('0x26')](_0x58c7('0x27'),_0x10c35d,_0x58c7('0x25'),JSON[_0x58c7('0x28')](_0x4efb7a));if(_0x4efb7a[_0x58c7('0x29')]){if(_0x4efb7a['error']['code']===0x1f4){logger[_0x58c7('0x29')](_0x58c7('0x24'),_0x10c35d,_0x4efb7a[_0x58c7('0x29')][_0x58c7('0x2a')]);return _0x43c680(_0x4efb7a[_0x58c7('0x29')][_0x58c7('0x2a')]);}logger[_0x58c7('0x29')](_0x58c7('0x24'),_0x10c35d,_0x4efb7a[_0x58c7('0x29')][_0x58c7('0x2a')]);return _0x5efece(_0x4efb7a['error'][_0x58c7('0x2a')]);}else{logger[_0x58c7('0x23')](_0x58c7('0x24'),_0x10c35d,'request\x20sent');_0x5efece(_0x4efb7a[_0x58c7('0x2b')]['message']);}})[_0x58c7('0x2c')](function(_0x1f2a15){logger['error'](_0x58c7('0x24'),_0x10c35d,_0x1f2a15);_0x43c680(_0x1f2a15);});});}function respondWithStatusCode(_0x4ae7ff,_0x3cc7c5){_0x3cc7c5=_0x3cc7c5||0xcc;return function(_0x384e82){if(_0x384e82){return _0x4ae7ff[_0x58c7('0x2d')](_0x3cc7c5);}return _0x4ae7ff[_0x58c7('0x2e')](_0x3cc7c5)[_0x58c7('0x2f')]();};}function respondWithResult(_0x1e64bf,_0x2dcfd1){_0x2dcfd1=_0x2dcfd1||0xc8;return function(_0x25f5b2){if(_0x25f5b2){return _0x1e64bf[_0x58c7('0x2e')](_0x2dcfd1)[_0x58c7('0x30')](_0x25f5b2);}};}function respondWithFilteredResult(_0x3139ae,_0x4bb5cf){return function(_0x314e3b){if(_0x314e3b){var _0x2dbfb2=typeof _0x4bb5cf[_0x58c7('0x31')]===_0x58c7('0x32')&&typeof _0x4bb5cf[_0x58c7('0x33')]===_0x58c7('0x32');var _0x29a91e=_0x314e3b[_0x58c7('0x34')];var _0x5de909=_0x2dbfb2?0x0:_0x4bb5cf[_0x58c7('0x31')];var _0x5784c0=_0x2dbfb2?_0x314e3b[_0x58c7('0x34')]:_0x4bb5cf['offset']+_0x4bb5cf[_0x58c7('0x33')];var _0x1d958c;if(_0x5784c0>=_0x29a91e){_0x5784c0=_0x29a91e;_0x1d958c=0xc8;}else{_0x1d958c=0xce;}_0x3139ae['status'](_0x1d958c);return _0x3139ae[_0x58c7('0x35')](_0x58c7('0x36'),_0x5de909+'-'+_0x5784c0+'/'+_0x29a91e)['json'](_0x314e3b);}return null;};}function patchUpdates(_0x3b2da4){return function(_0x16c561){try{jsonpatch['apply'](_0x16c561,_0x3b2da4,!![]);}catch(_0x11a512){return BPromise[_0x58c7('0x37')](_0x11a512);}return _0x16c561[_0x58c7('0x38')]();};}function saveUpdates(_0x166fef,_0x89e031){return function(_0x5239e8){if(_0x5239e8){return _0x5239e8[_0x58c7('0x39')](_0x166fef)[_0x58c7('0x22')](function(_0x39e19c){return _0x39e19c;});}return null;};}function removeEntity(_0x3184ff,_0x272a44){return function(_0x1ffc0f){if(_0x1ffc0f){return _0x1ffc0f[_0x58c7('0x3a')]()[_0x58c7('0x22')](function(){var _0x733eb4=_0x1ffc0f['get']({'plain':!![]});var _0x5c79fd=_0x58c7('0x3b');return db[_0x58c7('0x3c')][_0x58c7('0x3a')]({'where':{'type':_0x5c79fd,'resourceId':_0x733eb4['id']}})[_0x58c7('0x22')](function(){return _0x1ffc0f;});})[_0x58c7('0x22')](function(){_0x3184ff['status'](0xcc)[_0x58c7('0x2f')]();});}};}function handleEntityNotFound(_0xfd8a4,_0x12d2a1){return function(_0x20fe8d){if(!_0x20fe8d){_0xfd8a4[_0x58c7('0x2d')](0x194);}return _0x20fe8d;};}function handleError(_0x5d1634,_0x32e589){_0x32e589=_0x32e589||0x1f4;return function(_0x584452){logger[_0x58c7('0x29')](_0x584452[_0x58c7('0x3d')]);if(_0x584452[_0x58c7('0x3e')]){delete _0x584452['name'];}_0x5d1634[_0x58c7('0x2e')](_0x32e589)[_0x58c7('0x3f')](_0x584452);};}exports[_0x58c7('0x40')]=function(_0x4cb14d,_0x19e1b2){var _0x55cea1={'include':[{'model':db[_0x58c7('0x41')],'as':_0x58c7('0x42')}]},_0x242f28={},_0x53094f={'count':0x0,'rows':[]};var _0x857794=_['map'](db[_0x58c7('0x43')][_0x58c7('0x44')],function(_0x33be50){return{'name':_0x33be50[_0x58c7('0x45')],'type':_0x33be50[_0x58c7('0x46')][_0x58c7('0x47')]};});_0x242f28[_0x58c7('0x48')]=_[_0x58c7('0x49')](_0x857794,_0x58c7('0x3e'));_0x242f28[_0x58c7('0x4a')]=_[_0x58c7('0x4b')](_0x4cb14d[_0x58c7('0x4a')]);_0x242f28[_0x58c7('0x4c')]=_[_0x58c7('0x4d')](_0x242f28[_0x58c7('0x48')],_0x242f28[_0x58c7('0x4a')]);_0x55cea1[_0x58c7('0x4e')]=_[_0x58c7('0x4d')](_0x242f28['model'],qs[_0x58c7('0x4f')](_0x4cb14d[_0x58c7('0x4a')][_0x58c7('0x4f')]));_0x55cea1['attributes']=_0x55cea1[_0x58c7('0x4e')][_0x58c7('0x50')]?_0x55cea1[_0x58c7('0x4e')]:_0x242f28['model'];if(!_0x4cb14d[_0x58c7('0x4a')]['hasOwnProperty'](_0x58c7('0x51'))){_0x55cea1[_0x58c7('0x33')]=qs[_0x58c7('0x33')](_0x4cb14d[_0x58c7('0x4a')]['limit']);_0x55cea1[_0x58c7('0x31')]=qs[_0x58c7('0x31')](_0x4cb14d[_0x58c7('0x4a')][_0x58c7('0x31')]);}_0x55cea1['order']=qs['sort'](_0x4cb14d[_0x58c7('0x4a')][_0x58c7('0x52')]);_0x55cea1[_0x58c7('0x53')]=qs[_0x58c7('0x4c')](_['pick'](_0x4cb14d[_0x58c7('0x4a')],_0x242f28[_0x58c7('0x4c')]),_0x857794);if(_0x4cb14d['query'][_0x58c7('0x54')]){_0x55cea1['where']=_[_0x58c7('0x55')](_0x55cea1[_0x58c7('0x53')],{'$or':_[_0x58c7('0x49')](_0x857794,function(_0x5d5089){if(_0x5d5089[_0x58c7('0x46')]!==_0x58c7('0x56')){var _0x6fa442={};_0x6fa442[_0x5d5089[_0x58c7('0x3e')]]={'$like':'%'+_0x4cb14d[_0x58c7('0x4a')][_0x58c7('0x54')]+'%'};return _0x6fa442;}})});}_0x55cea1=_['merge']({},_0x55cea1,_0x4cb14d[_0x58c7('0x57')]);var _0x27a68a={'where':_0x55cea1[_0x58c7('0x53')]};return db[_0x58c7('0x43')][_0x58c7('0x34')](_0x27a68a)['then'](function(_0x3199fc){_0x53094f[_0x58c7('0x34')]=_0x3199fc;if(_0x4cb14d[_0x58c7('0x4a')]['includeAll']){_0x55cea1[_0x58c7('0x58')]=[{'all':!![]}];}return db[_0x58c7('0x43')][_0x58c7('0x59')](_0x55cea1);})[_0x58c7('0x22')](function(_0x499e88){_0x53094f[_0x58c7('0x5a')]=_0x499e88;return _0x53094f;})[_0x58c7('0x22')](respondWithFilteredResult(_0x19e1b2,_0x55cea1))['catch'](handleError(_0x19e1b2,null));};exports[_0x58c7('0x5b')]=function(_0xb05497,_0x4de5dc){var _0x3dd5ea={'raw':![],'where':{'id':_0xb05497[_0x58c7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x58c7('0x42')}]},_0x1368a0={};_0x1368a0[_0x58c7('0x48')]=_[_0x58c7('0x4b')](db[_0x58c7('0x43')][_0x58c7('0x44')]);_0x1368a0[_0x58c7('0x4a')]=_[_0x58c7('0x4b')](_0xb05497['query']);_0x1368a0['filters']=_[_0x58c7('0x4d')](_0x1368a0['model'],_0x1368a0['query']);_0x3dd5ea[_0x58c7('0x4e')]=_[_0x58c7('0x4d')](_0x1368a0[_0x58c7('0x48')],qs[_0x58c7('0x4f')](_0xb05497['query'][_0x58c7('0x4f')]));_0x3dd5ea[_0x58c7('0x4e')]=_0x3dd5ea['attributes'][_0x58c7('0x50')]?_0x3dd5ea['attributes']:_0x1368a0[_0x58c7('0x48')];if(_0xb05497[_0x58c7('0x4a')][_0x58c7('0x5d')]){_0x3dd5ea[_0x58c7('0x58')]=[{'all':!![]}];}_0x3dd5ea=_[_0x58c7('0x55')]({},_0x3dd5ea,_0xb05497[_0x58c7('0x57')]);return db[_0x58c7('0x43')]['find'](_0x3dd5ea)[_0x58c7('0x22')](handleEntityNotFound(_0x4de5dc,null))[_0x58c7('0x22')](respondWithResult(_0x4de5dc,null))[_0x58c7('0x2c')](handleError(_0x4de5dc,null));};exports[_0x58c7('0x5e')]=function(_0x522baf,_0x38a26b){return db[_0x58c7('0x43')][_0x58c7('0x5e')](_0x522baf[_0x58c7('0x5f')],{})[_0x58c7('0x22')](function(_0x1ae140){var _0x3eeddd=_0x522baf[_0x58c7('0x60')][_0x58c7('0x61')]({'plain':!![]});if(!_0x3eeddd)throw new Error(_0x58c7('0x62'));if(_0x3eeddd[_0x58c7('0x63')]===_0x58c7('0x60')){var _0x55fe75=_0x1ae140[_0x58c7('0x61')]({'plain':!![]});var _0x325524=_0x58c7('0x3b');return db[_0x58c7('0x64')]['find']({'where':{'name':_0x325524,'userProfileId':_0x3eeddd['userProfileId']},'raw':!![]})['then'](function(_0x2c3dcc){if(_0x2c3dcc&&_0x2c3dcc['autoAssociation']===0x0){return db[_0x58c7('0x3c')][_0x58c7('0x5e')]({'name':_0x55fe75[_0x58c7('0x3e')],'resourceId':_0x55fe75['id'],'type':_0x2c3dcc['name'],'sectionId':_0x2c3dcc['id']},{})[_0x58c7('0x22')](function(){return _0x1ae140;});}else{return _0x1ae140;}})['catch'](function(_0x23ae3a){logger[_0x58c7('0x29')](_0x58c7('0x65'),_0x23ae3a);throw _0x23ae3a;});}return _0x1ae140;})[_0x58c7('0x22')](respondWithResult(_0x38a26b,0xc9))[_0x58c7('0x2c')](handleError(_0x38a26b,null));};exports[_0x58c7('0x39')]=function(_0xec9d60,_0x27b0d2){if(_0xec9d60[_0x58c7('0x5f')]['id']){delete _0xec9d60['body']['id'];}return db[_0x58c7('0x43')][_0x58c7('0x66')]({'where':{'id':_0xec9d60[_0x58c7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x58c7('0x42')}]})['then'](handleEntityNotFound(_0x27b0d2,null))[_0x58c7('0x22')](saveUpdates(_0xec9d60[_0x58c7('0x5f')],null))['then'](respondWithResult(_0x27b0d2,null))[_0x58c7('0x2c')](handleError(_0x27b0d2,null));};exports['destroy']=function(_0x1bce02,_0x130d02){return db[_0x58c7('0x43')][_0x58c7('0x66')]({'where':{'id':_0x1bce02[_0x58c7('0x5c')]['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0x130d02,null))['then'](removeEntity(_0x130d02,null))['catch'](handleError(_0x130d02,null));};exports[_0x58c7('0x67')]=function(_0x508dae,_0x9f1911){return db['FaxAccount']['describe']()[_0x58c7('0x22')](respondWithResult(_0x9f1911,null))[_0x58c7('0x2c')](handleError(_0x9f1911,null));};exports['addDisposition']=function(_0x4222b1,_0x4622d6,_0x1eef94){if(_0x4222b1[_0x58c7('0x5f')]['id']){delete _0x4222b1['body']['id'];}return db[_0x58c7('0x43')][_0x58c7('0x66')]({'where':{'id':_0x4222b1['params']['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0x4622d6,null))['then'](function(_0x319968){if(_0x319968){_0x4222b1[_0x58c7('0x5f')][_0x58c7('0x68')]=_0x319968['id'];return db['Disposition'][_0x58c7('0x5e')](_0x4222b1[_0x58c7('0x5f')]);}})[_0x58c7('0x22')](respondWithResult(_0x4622d6,null))[_0x58c7('0x2c')](handleError(_0x4622d6,null));};exports[_0x58c7('0x69')]=function(_0x504ac6,_0x3bfac3,_0x3fd1f0){var _0x1c2a66={'raw':![],'where':{}};var _0x3cbf26={};var _0x5ecc2f={'count':0x0,'rows':[]};return db['FaxAccount'][_0x58c7('0x6a')]({'where':{'id':_0x504ac6[_0x58c7('0x5c')]['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0x3bfac3,null))[_0x58c7('0x22')](function(_0x29dbc0){if(_0x29dbc0){_0x3cbf26[_0x58c7('0x48')]=_['keys'](db[_0x58c7('0x6b')][_0x58c7('0x44')]);_0x3cbf26[_0x58c7('0x4a')]=_[_0x58c7('0x4b')](_0x504ac6[_0x58c7('0x4a')]);_0x3cbf26[_0x58c7('0x4c')]=_[_0x58c7('0x4d')](_0x3cbf26[_0x58c7('0x48')],_0x3cbf26[_0x58c7('0x4a')]);_0x1c2a66[_0x58c7('0x4e')]=_['intersection'](_0x3cbf26[_0x58c7('0x48')],qs[_0x58c7('0x4f')](_0x504ac6[_0x58c7('0x4a')][_0x58c7('0x4f')]));_0x1c2a66[_0x58c7('0x4e')]=_0x1c2a66[_0x58c7('0x4e')][_0x58c7('0x50')]?_0x1c2a66[_0x58c7('0x4e')]:_0x3cbf26[_0x58c7('0x48')];if(!_0x504ac6[_0x58c7('0x4a')][_0x58c7('0x6c')](_0x58c7('0x51'))){_0x1c2a66['limit']=qs[_0x58c7('0x33')](_0x504ac6['query']['limit']);_0x1c2a66[_0x58c7('0x31')]=qs[_0x58c7('0x31')](_0x504ac6[_0x58c7('0x4a')]['offset']);}_0x1c2a66[_0x58c7('0x6d')]=qs[_0x58c7('0x52')](_0x504ac6[_0x58c7('0x4a')]['sort']);_0x1c2a66[_0x58c7('0x53')]=qs[_0x58c7('0x4c')](_['pick'](_0x504ac6[_0x58c7('0x4a')],_0x3cbf26['filters']));_0x1c2a66[_0x58c7('0x53')][_0x58c7('0x68')]=_0x29dbc0['id'];if(_0x504ac6[_0x58c7('0x4a')]['filter']){_0x1c2a66['where']=_[_0x58c7('0x55')](_0x1c2a66[_0x58c7('0x53')],{'$or':_[_0x58c7('0x49')](_0x1c2a66['attributes'],function(_0xe1ee40){var _0x3685a={};_0x3685a[_0xe1ee40]={'$like':'%'+_0x504ac6[_0x58c7('0x4a')][_0x58c7('0x54')]+'%'};return _0x3685a;})});}_0x1c2a66=_[_0x58c7('0x55')]({},_0x1c2a66,_0x504ac6[_0x58c7('0x57')]);return db[_0x58c7('0x6b')][_0x58c7('0x34')]({'where':_0x1c2a66[_0x58c7('0x53')]})['then'](function(_0x35aa8e){_0x5ecc2f['count']=_0x35aa8e;if(_0x504ac6[_0x58c7('0x4a')][_0x58c7('0x5d')]){_0x1c2a66[_0x58c7('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x58c7('0x59')](_0x1c2a66);})[_0x58c7('0x22')](function(_0x2dcb00){_0x5ecc2f['rows']=_0x2dcb00;return _0x5ecc2f;});}})[_0x58c7('0x22')](respondWithFilteredResult(_0x3bfac3,_0x1c2a66))[_0x58c7('0x2c')](handleError(_0x3bfac3,null));};exports[_0x58c7('0x6e')]=function(_0x47b396,_0x4442c4,_0x3327e7){return db[_0x58c7('0x43')][_0x58c7('0x66')]({'where':{'id':_0x47b396[_0x58c7('0x5c')]['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0x4442c4,null))['then'](function(_0x2feeb1){if(_0x2feeb1){return _0x2feeb1[_0x58c7('0x6e')](_0x47b396[_0x58c7('0x4a')]['ids']);}})['then'](respondWithStatusCode(_0x4442c4,null))['catch'](handleError(_0x4442c4,null));};exports[_0x58c7('0x6f')]=function(_0x4f825f,_0xe63b4,_0x30494b){if(_0x4f825f[_0x58c7('0x5f')]['id']){delete _0x4f825f[_0x58c7('0x5f')]['id'];}return db[_0x58c7('0x43')][_0x58c7('0x66')]({'where':{'id':_0x4f825f[_0x58c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0xe63b4,null))[_0x58c7('0x22')](function(_0x522ea6){if(_0x522ea6){_0x4f825f['body'][_0x58c7('0x68')]=_0x522ea6['id'];return db[_0x58c7('0x70')][_0x58c7('0x5e')](_0x4f825f[_0x58c7('0x5f')]);}})['then'](respondWithResult(_0xe63b4,null))[_0x58c7('0x2c')](handleError(_0xe63b4,null));};exports[_0x58c7('0x71')]=function(_0x4934f8,_0x2c23fd,_0x332bfa){var _0x3a713f={'raw':![],'where':{}};var _0x12bf1e={};var _0x10bf31={'count':0x0,'rows':[]};return db['FaxAccount'][_0x58c7('0x6a')]({'where':{'id':_0x4934f8[_0x58c7('0x5c')]['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0x2c23fd,null))[_0x58c7('0x22')](function(_0x51a50b){if(_0x51a50b){_0x12bf1e['model']=_[_0x58c7('0x4b')](db[_0x58c7('0x70')][_0x58c7('0x44')]);_0x12bf1e[_0x58c7('0x4a')]=_[_0x58c7('0x4b')](_0x4934f8[_0x58c7('0x4a')]);_0x12bf1e[_0x58c7('0x4c')]=_['intersection'](_0x12bf1e[_0x58c7('0x48')],_0x12bf1e['query']);_0x3a713f[_0x58c7('0x4e')]=_[_0x58c7('0x4d')](_0x12bf1e['model'],qs[_0x58c7('0x4f')](_0x4934f8[_0x58c7('0x4a')][_0x58c7('0x4f')]));_0x3a713f[_0x58c7('0x4e')]=_0x3a713f[_0x58c7('0x4e')][_0x58c7('0x50')]?_0x3a713f[_0x58c7('0x4e')]:_0x12bf1e['model'];if(!_0x4934f8[_0x58c7('0x4a')]['hasOwnProperty'](_0x58c7('0x51'))){_0x3a713f[_0x58c7('0x33')]=qs[_0x58c7('0x33')](_0x4934f8[_0x58c7('0x4a')][_0x58c7('0x33')]);_0x3a713f['offset']=qs['offset'](_0x4934f8[_0x58c7('0x4a')][_0x58c7('0x31')]);}_0x3a713f[_0x58c7('0x6d')]=qs[_0x58c7('0x52')](_0x4934f8[_0x58c7('0x4a')][_0x58c7('0x52')]);_0x3a713f[_0x58c7('0x53')]=qs[_0x58c7('0x4c')](_['pick'](_0x4934f8[_0x58c7('0x4a')],_0x12bf1e[_0x58c7('0x4c')]));_0x3a713f['where'][_0x58c7('0x68')]=_0x51a50b['id'];if(_0x4934f8[_0x58c7('0x4a')]['filter']){_0x3a713f['where']=_[_0x58c7('0x55')](_0x3a713f['where'],{'$or':_[_0x58c7('0x49')](_0x3a713f[_0x58c7('0x4e')],function(_0x25d766){var _0xcfd33e={};_0xcfd33e[_0x25d766]={'$like':'%'+_0x4934f8[_0x58c7('0x4a')]['filter']+'%'};return _0xcfd33e;})});}_0x3a713f=_[_0x58c7('0x55')]({},_0x3a713f,_0x4934f8[_0x58c7('0x57')]);return db[_0x58c7('0x70')]['count']({'where':_0x3a713f[_0x58c7('0x53')]})[_0x58c7('0x22')](function(_0x5418ae){_0x10bf31['count']=_0x5418ae;if(_0x4934f8[_0x58c7('0x4a')]['includeAll']){_0x3a713f['include']=[{'all':!![]}];}return db[_0x58c7('0x70')]['findAll'](_0x3a713f);})[_0x58c7('0x22')](function(_0x30be16){_0x10bf31[_0x58c7('0x5a')]=_0x30be16;return _0x10bf31;});}})[_0x58c7('0x22')](respondWithFilteredResult(_0x2c23fd,_0x3a713f))[_0x58c7('0x2c')](handleError(_0x2c23fd,null));};exports['removeAnswers']=function(_0x58e416,_0x4fff7d,_0x3b6f43){return db[_0x58c7('0x43')][_0x58c7('0x66')]({'where':{'id':_0x58e416[_0x58c7('0x5c')]['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0x4fff7d,null))[_0x58c7('0x22')](function(_0x5ac452){if(_0x5ac452){return _0x5ac452[_0x58c7('0x72')](_0x58e416['query'][_0x58c7('0x73')]);}})['then'](respondWithStatusCode(_0x4fff7d,null))[_0x58c7('0x2c')](handleError(_0x4fff7d,null));};exports['addInteraction']=function(_0x578211,_0x17fe65,_0x2b9c69){return db[_0x58c7('0x74')]['find']({'where':{'id':_0x578211[_0x58c7('0x5c')]['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0x17fe65,null))[_0x58c7('0x22')](function(_0xa47141){if(_0xa47141){return _0xa47141[_0x58c7('0x75')](_0x578211[_0x58c7('0x5f')]['ids'],_['omit'](_0x578211[_0x58c7('0x5f')],['ids','id'])||{});}})[_0x58c7('0x22')](respondWithResult(_0x17fe65,null))[_0x58c7('0x2c')](handleError(_0x17fe65,null));};exports[_0x58c7('0x76')]=function(_0x11a935,_0x1296ea,_0x4ef42e){var _0xcb7567={'raw':![],'where':{}};var _0x35f652={};var _0x45686e={'count':0x0,'rows':[]};return db[_0x58c7('0x43')]['findOne']({'where':{'id':_0x11a935['params']['id']}})['then'](handleEntityNotFound(_0x1296ea,null))['then'](function(_0x20bd27){if(_0x20bd27){_0x35f652['model']=_[_0x58c7('0x4b')](db['FaxInteraction'][_0x58c7('0x44')]);_0x35f652['query']=_[_0x58c7('0x4b')](_0x11a935[_0x58c7('0x4a')]);_0x35f652['filters']=_[_0x58c7('0x4d')](_0x35f652[_0x58c7('0x48')],_0x35f652['query']);_0xcb7567[_0x58c7('0x4e')]=_[_0x58c7('0x4d')](_0x35f652[_0x58c7('0x48')],qs[_0x58c7('0x4f')](_0x11a935['query'][_0x58c7('0x4f')]));_0xcb7567[_0x58c7('0x4e')]=_0xcb7567[_0x58c7('0x4e')][_0x58c7('0x50')]?_0xcb7567[_0x58c7('0x4e')]:_0x35f652[_0x58c7('0x48')];if(!_0x11a935[_0x58c7('0x4a')][_0x58c7('0x6c')](_0x58c7('0x51'))){_0xcb7567[_0x58c7('0x33')]=qs[_0x58c7('0x33')](_0x11a935[_0x58c7('0x4a')][_0x58c7('0x33')]);_0xcb7567['offset']=qs[_0x58c7('0x31')](_0x11a935[_0x58c7('0x4a')]['offset']);}_0xcb7567['order']=qs[_0x58c7('0x52')](_0x11a935['query'][_0x58c7('0x52')]);_0xcb7567['where']=qs[_0x58c7('0x4c')](_[_0x58c7('0x77')](_0x11a935['query'],_0x35f652['filters']));_0xcb7567[_0x58c7('0x53')]['FaxAccountId']=_0x20bd27['id'];if(_0x11a935[_0x58c7('0x4a')][_0x58c7('0x54')]){_0xcb7567[_0x58c7('0x53')]=_['merge'](_0xcb7567[_0x58c7('0x53')],{'$or':_[_0x58c7('0x49')](_0xcb7567[_0x58c7('0x4e')],function(_0x5e0505){var _0xae42f1={};_0xae42f1[_0x5e0505]={'$like':'%'+_0x11a935['query'][_0x58c7('0x54')]+'%'};return _0xae42f1;})});}_0xcb7567=_[_0x58c7('0x55')]({},_0xcb7567,_0x11a935['options']);return db['FaxInteraction']['count']({'where':_0xcb7567[_0x58c7('0x53')]})['then'](function(_0x5f409a){_0x45686e[_0x58c7('0x34')]=_0x5f409a;if(_0x11a935[_0x58c7('0x4a')][_0x58c7('0x5d')]){_0xcb7567[_0x58c7('0x58')]=[{'model':db[_0x58c7('0x78')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x58c7('0x79'),'attributes':[_0x58c7('0x3e'),_0x58c7('0x7a'),_0x58c7('0x7b')],'required':![]},{'model':db[_0x58c7('0x7c')],'as':_0x58c7('0x7d'),'attributes':['id','name',_0x58c7('0x7e')],'where':_0x11a935[_0x58c7('0x4a')][_0x58c7('0x7f')]?{'id':_0x11a935['query'][_0x58c7('0x7f')]}:undefined,'required':_0x11a935[_0x58c7('0x4a')][_0x58c7('0x7f')]?!![]:![]}];}return db[_0x58c7('0x74')][_0x58c7('0x59')](_0xcb7567);})['then'](function(_0x86c03){_0x45686e[_0x58c7('0x5a')]=_0x86c03;return _0x45686e;});}})[_0x58c7('0x22')](respondWithFilteredResult(_0x1296ea,_0xcb7567))[_0x58c7('0x2c')](handleError(_0x1296ea,null));};exports[_0x58c7('0x80')]=function(_0x2f1f6c,_0x219846,_0x1298e4){return db[_0x58c7('0x43')][_0x58c7('0x6a')]({'where':{'id':_0x2f1f6c[_0x58c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x219846,null))[_0x58c7('0x22')](function(_0x48348e){if(_0x48348e){return db[_0x58c7('0x81')][_0x58c7('0x82')](function(_0x47395b){return db[_0x58c7('0x83')][_0x58c7('0x3a')]({'where':{'FaxAccountId':_0x2f1f6c[_0x58c7('0x5c')]['id']},'transaction':_0x47395b})[_0x58c7('0x22')](function(_0x1e6647){var _0x38f7af=_[_0x58c7('0x49')](_0x2f1f6c['body'],function(_0x5574e0){_0x5574e0['FaxAccountId']=_0x2f1f6c['params']['id'];return _0x5574e0;});return db[_0x58c7('0x83')]['bulkCreate'](_0x38f7af,{'transaction':_0x47395b});});})[_0x58c7('0x22')](function(){return db[_0x58c7('0x83')]['findAndCountAll']({'where':{'FaxAccountId':_0x2f1f6c['params']['id']},'order':_0x58c7('0x84')});});}})[_0x58c7('0x22')](respondWithResult(_0x219846,null))[_0x58c7('0x2c')](handleError(_0x219846,null));};exports[_0x58c7('0x85')]=function(_0x3ec49a,_0x314345,_0x5d6b8d){var _0xf66d7b={};var _0x503562={};var _0x20c0f0;var _0x858865;return db['FaxAccount'][_0x58c7('0x6a')]({'where':{'id':_0x3ec49a[_0x58c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x314345,null))[_0x58c7('0x22')](function(_0x5eaebf){if(_0x5eaebf){_0x20c0f0=_0x5eaebf;_0x503562[_0x58c7('0x48')]=_[_0x58c7('0x4b')](db['FaxApplication'][_0x58c7('0x44')]);_0x503562[_0x58c7('0x4a')]=_[_0x58c7('0x4b')](_0x3ec49a[_0x58c7('0x4a')]);_0x503562[_0x58c7('0x4c')]=_['intersection'](_0x503562[_0x58c7('0x48')],_0x503562[_0x58c7('0x4a')]);_0xf66d7b['attributes']=_[_0x58c7('0x4d')](_0x503562['model'],qs[_0x58c7('0x4f')](_0x3ec49a[_0x58c7('0x4a')][_0x58c7('0x4f')]));_0xf66d7b[_0x58c7('0x4e')]=_0xf66d7b[_0x58c7('0x4e')][_0x58c7('0x50')]?_0xf66d7b[_0x58c7('0x4e')]:_0x503562['model'];_0xf66d7b[_0x58c7('0x6d')]=qs[_0x58c7('0x52')](_0x3ec49a[_0x58c7('0x4a')]['sort']);_0xf66d7b[_0x58c7('0x53')]=qs[_0x58c7('0x4c')](_[_0x58c7('0x77')](_0x3ec49a[_0x58c7('0x4a')],_0x503562[_0x58c7('0x4c')]));if(_0x3ec49a[_0x58c7('0x4a')][_0x58c7('0x54')]){_0xf66d7b['where']=_[_0x58c7('0x55')](_0xf66d7b['where'],{'$or':_[_0x58c7('0x49')](_0xf66d7b[_0x58c7('0x4e')],function(_0x1d2ae4){var _0x48f77e={};_0x48f77e[_0x1d2ae4]={'$like':'%'+_0x3ec49a[_0x58c7('0x4a')]['filter']+'%'};return _0x48f77e;})});}_0xf66d7b=_['merge']({},_0xf66d7b,_0x3ec49a[_0x58c7('0x57')]);return _0x20c0f0[_0x58c7('0x85')](_0xf66d7b);}})['then'](function(_0x166d5f){if(_0x166d5f){_0x858865=_0x166d5f['length'];if(!_0x3ec49a[_0x58c7('0x4a')][_0x58c7('0x6c')](_0x58c7('0x51'))){_0xf66d7b[_0x58c7('0x33')]=qs[_0x58c7('0x33')](_0x3ec49a['query']['limit']);_0xf66d7b['offset']=qs[_0x58c7('0x31')](_0x3ec49a[_0x58c7('0x4a')][_0x58c7('0x31')]);}return _0x20c0f0[_0x58c7('0x85')](_0xf66d7b);}})[_0x58c7('0x22')](function(_0x18e73b){if(_0x18e73b){return _0x18e73b?{'count':_0x858865,'rows':_0x18e73b}:null;}})[_0x58c7('0x22')](respondWithResult(_0x314345,null))[_0x58c7('0x2c')](handleError(_0x314345,null));};function Extension(_0x1f95ed,_0x144767,_0x2a28f8,_0x8dcff6){this['context']=_0x58c7('0x86');this[_0x58c7('0x87')]=_0x1f95ed['localstationid'];this[_0x58c7('0x88')]=_0x8dcff6;this['type']=_0x58c7('0x89');this[_0x58c7('0x8a')]=_0x58c7('0x8b');this[_0x58c7('0x68')]=_0x1f95ed['id'];this[_0x58c7('0x84')]=_0x144767;this[_0x58c7('0x8c')]=_0x2a28f8;}function createExtensionsReciveFax(_0x24ee10){var _0xbb02ad=0x1;var _0x1ad344=[];_0x1ad344[_0x58c7('0x8d')](new Extension(_0x24ee10,_0xbb02ad,'',_0x58c7('0x8e')));_0xbb02ad+=0x1;_0x1ad344[_0x58c7('0x8d')](new Extension(_0x24ee10,_0xbb02ad,_0x58c7('0x8f'),_0x58c7('0x90')));_0xbb02ad+=0x1;for(var _0x53c0df in _0x24ee10){if(_0x24ee10[_0x58c7('0x6c')](_0x53c0df)&&(_0x53c0df==='ecm'||_0x53c0df===_0x58c7('0x91')||_0x53c0df==='gateway'||_0x53c0df==='faxdetect'||_0x53c0df===_0x58c7('0x92')||_0x53c0df===_0x58c7('0x93')||_0x53c0df===_0x58c7('0x94')||_0x53c0df===_0x58c7('0x95')||_0x53c0df===_0x58c7('0x96'))){_0x1ad344[_0x58c7('0x8d')](new Extension(_0x24ee10,_0xbb02ad,_0x58c7('0x97')+_0x53c0df+')='+_0x24ee10[_0x53c0df],_0x58c7('0x90')));_0xbb02ad+=0x1;}}_0x1ad344[_0x58c7('0x8d')](new Extension(_0x24ee10,_0xbb02ad,'6',_0x58c7('0x98')));_0xbb02ad+=0x1;_0x1ad344['push'](new Extension(_0x24ee10,_0xbb02ad,_0x58c7('0x99'),_0x58c7('0x9a')));_0xbb02ad=0x0;return _0x1ad344;}exports['addAccountApplications']=function(_0x5a3a20,_0x174adb,_0x3237b8){var _0x5ada08;return db['sequelize'][_0x58c7('0x82')](function(_0x38ff7b){return db['FaxAccount']['create'](_0x5a3a20['body'],{'transaction':_0x38ff7b})['then'](function(_0x14e84){_0x5ada08=_0x14e84[_0x58c7('0x61')]({'plain':!![]});return db[_0x58c7('0x9b')]['bulkCreate'](createExtensionsReciveFax(_0x5ada08),{'transaction':_0x38ff7b});});})[_0x58c7('0x22')](function(){return _0x5ada08;})['then'](respondWithResult(_0x174adb,null))[_0x58c7('0x2c')](handleError(_0x174adb,null));};exports[_0x58c7('0x9c')]=function(_0x227ea3,_0x394ba8,_0x486054){var _0x3478b8;return db['sequelize'][_0x58c7('0x82')](function(_0x26008e){return db[_0x58c7('0x43')][_0x58c7('0x39')](_0x227ea3[_0x58c7('0x5f')],{'where':{'id':_0x227ea3['body']['id']},'transaction':_0x26008e})[_0x58c7('0x22')](function(_0x44ceb6){return db['VoiceExtension'][_0x58c7('0x3a')]({'where':{'FaxAccountId':_0x227ea3['body']['id']},'transaction':_0x26008e})[_0x58c7('0x22')](function(_0xc2e465){return db[_0x58c7('0x9b')][_0x58c7('0x9d')](createExtensionsReciveFax(_[_0x58c7('0x9e')](_0x227ea3[_0x58c7('0x5f')],['tech','key','createdAt','updatedAt','TrunkId',_0x58c7('0x9f')])),{'transaction':_0x26008e});});});})[_0x58c7('0x22')](function(){return db[_0x58c7('0x43')][_0x58c7('0xa0')](_0x227ea3[_0x58c7('0x5f')]['id']);})[_0x58c7('0x22')](respondWithResult(_0x394ba8,null))['catch'](handleError(_0x394ba8,null));};exports['getMessages']=function(_0x5b269a,_0x164ebc,_0x24c9c0){var _0x252242={'raw':!![],'where':{}};var _0x1e3e74={};var _0x4600e={'count':0x0,'rows':[]};return db[_0x58c7('0x43')][_0x58c7('0x6a')]({'where':{'id':_0x5b269a[_0x58c7('0x5c')]['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0x164ebc,null))[_0x58c7('0x22')](function(_0x53600c){if(_0x53600c){_0x1e3e74['model']=_[_0x58c7('0x4b')](db[_0x58c7('0xa1')][_0x58c7('0x44')]);_0x1e3e74[_0x58c7('0x4a')]=_[_0x58c7('0x4b')](_0x5b269a[_0x58c7('0x4a')]);_0x1e3e74[_0x58c7('0x4c')]=_[_0x58c7('0x4d')](_0x1e3e74[_0x58c7('0x48')],_0x1e3e74['query']);_0x252242['attributes']=_[_0x58c7('0x4d')](_0x1e3e74['model'],qs['fields'](_0x5b269a[_0x58c7('0x4a')][_0x58c7('0x4f')]));_0x252242[_0x58c7('0x4e')]=_0x252242[_0x58c7('0x4e')][_0x58c7('0x50')]?_0x252242[_0x58c7('0x4e')]:_0x1e3e74[_0x58c7('0x48')];if(!_0x5b269a[_0x58c7('0x4a')][_0x58c7('0x6c')](_0x58c7('0x51'))){_0x252242[_0x58c7('0x33')]=qs[_0x58c7('0x33')](_0x5b269a[_0x58c7('0x4a')][_0x58c7('0x33')]);_0x252242[_0x58c7('0x31')]=qs['offset'](_0x5b269a[_0x58c7('0x4a')][_0x58c7('0x31')]);}_0x252242[_0x58c7('0x6d')]=qs['sort'](_0x5b269a[_0x58c7('0x4a')][_0x58c7('0x52')]);_0x252242['where']=qs[_0x58c7('0x4c')](_[_0x58c7('0x77')](_0x5b269a[_0x58c7('0x4a')],_0x1e3e74['filters']));_0x252242[_0x58c7('0x53')][_0x58c7('0x68')]=_0x53600c['id'];if(_0x5b269a[_0x58c7('0x4a')][_0x58c7('0x54')]){_0x252242[_0x58c7('0x53')]=_[_0x58c7('0x55')](_0x252242['where'],{'$or':_[_0x58c7('0x49')](_0x252242['attributes'],function(_0x4c7db0){var _0xf7f926={};_0xf7f926[_0x4c7db0]={'$like':'%'+_0x5b269a[_0x58c7('0x4a')]['filter']+'%'};return _0xf7f926;})});}if(_0x5b269a[_0x58c7('0x4a')][_0x58c7('0xa2')]){var _0x2e2b4d=_0x5b269a['query'][_0x58c7('0xa2')][_0x58c7('0xa3')](',');var _0x2962c4={};_0x2962c4[_0x2e2b4d[0x0]]={'$gte':moment(_0x2e2b4d[0x1])[_0x58c7('0xa4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x252242[_0x58c7('0x53')]=_[_0x58c7('0x55')](_0x252242[_0x58c7('0x53')],_0x2962c4);}_0x252242=_[_0x58c7('0x55')]({},_0x252242,_0x5b269a[_0x58c7('0x57')]);return db[_0x58c7('0xa1')][_0x58c7('0x34')]({'where':_0x252242['where']})[_0x58c7('0x22')](function(_0xdc241e){_0x4600e[_0x58c7('0x34')]=_0xdc241e;if(_0x5b269a[_0x58c7('0x4a')][_0x58c7('0x5d')]){_0x252242[_0x58c7('0x58')]=[{'all':!![]}];}return db['FaxMessage'][_0x58c7('0x59')](_0x252242);})[_0x58c7('0x22')](function(_0x35caf9){_0x4600e['rows']=_0x35caf9;return _0x4600e;});}})[_0x58c7('0x22')](respondWithFilteredResult(_0x164ebc,_0x252242))[_0x58c7('0x2c')](handleError(_0x164ebc,null));};exports[_0x58c7('0x3f')]=function(_0x16b671,_0x41d74e,_0x96dd57){var _0x12422f,_0x533fab={},_0x14b02b;if(_0x16b671[_0x58c7('0x5f')]['to']){_0x14b02b=_0x16b671[_0x58c7('0x5f')]['to'][0x0];}return db[_0x58c7('0x43')][_0x58c7('0x66')]({'where':{'id':_0x16b671[_0x58c7('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x58c7('0xa5'),'include':[{'model':db[_0x58c7('0x78')],'as':_0x58c7('0xa6'),'where':{'fax':_0x14b02b},'limit':0x1,'order':[[_0x58c7('0xa7'),'DESC']]}]}]})[_0x58c7('0x22')](handleEntityNotFound(_0x41d74e,null))[_0x58c7('0x22')](function(_0x2d0422){_0x12422f=_0x2d0422;if(_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')]&&_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')]['length']){for(var _0x300d0f=0x0;_0x300d0f<_0x16b671['body'][_0x58c7('0xa8')][_0x58c7('0x50')];_0x300d0f+=0x1){_0x16b671[_0x58c7('0x5f')]['attachments'][_0x300d0f]={'filename':_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')][_0x300d0f][_0x58c7('0x3e')],'id':_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')][_0x300d0f]['id'],'path':path['join'](config[_0x58c7('0xa9')],_0x58c7('0xaa'),_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')][_0x300d0f][_0x58c7('0xab')])};}}return respondWithRpcPromise(_0x58c7('0xac'),_0x58c7('0xac'),{'FaxAccountId':_[_0x58c7('0xad')](_0x16b671[_0x58c7('0x5c')]['id'])?undefined:_0x16b671['params']['id'],'path':_['isNil'](_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')][0x0][_0x58c7('0x7')])?undefined:_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')][0x0][_0x58c7('0x7')],'fax':_[_0x58c7('0xad')](_0x16b671['body']['to'][0x0])?undefined:_0x16b671['body']['to'][0x0]},client9002);})[_0x58c7('0x22')](function(){if(_0x12422f){if(_[_0x58c7('0xad')](_0x16b671[_0x58c7('0x5f')][_0x58c7('0xae')])){_0x16b671[_0x58c7('0x5f')][_0x58c7('0xae')]=util[_0x58c7('0xa4')]('\x22%s\x22\x20<%s>',_0x12422f[_0x58c7('0x3e')],_0x12422f[_0x58c7('0xaf')]);}if(_0x12422f[_0x58c7('0xa5')]){if(_0x12422f['List'][_0x58c7('0xa6')][_0x58c7('0x50')]){return _0x12422f['List'][_0x58c7('0xa6')][0x0];}else{return db['CmContact'][_0x58c7('0x5e')](_['defaults'](_0x16b671[_0x58c7('0x5f')],{'firstName':_0x16b671[_0x58c7('0x5f')]['to'][0x0],'phone':_0x16b671[_0x58c7('0x5f')]['to'][0x0],'fax':_0x16b671[_0x58c7('0x5f')]['to'][0x0],'ListId':_0x12422f['ListId']}));}}else{throw new Error(_0x58c7('0xb0'));}}else{throw new Error(_0x58c7('0xb1'));}})[_0x58c7('0x22')](function(_0x25a0ec){if(_0x25a0ec){return db[_0x58c7('0x74')][_0x58c7('0x66')]({'where':{'ContactId':_0x25a0ec['id'],'closed':![],'FaxAccountId':_0x12422f['id']}})[_0x58c7('0x22')](function(_0x151b6f){if(_0x151b6f){return[_0x151b6f,![]];}return db[_0x58c7('0x74')][_0x58c7('0x5e')]({'UserId':_0x16b671[_0x58c7('0x60')]['id'],'ContactId':_0x25a0ec['id'],'FaxAccountId':_0x12422f['id'],'fax':_0x16b671[_0x58c7('0x5f')]['to'][0x0],'firstMsgDirection':_0x58c7('0xb2'),'Messages':[_[_0x58c7('0x55')](_0x16b671[_0x58c7('0x5f')],{'read':![],'body':_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')][0x0][_0x58c7('0xb3')],'FaxAccountId':_0x12422f['id'],'UserId':_0x16b671[_0x58c7('0x60')]['id'],'ContactId':_0x25a0ec['id'],'AttachmentId':_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x58c7('0xa1')],'as':_0x58c7('0xb4')}]})[_0x58c7('0x22')](function(_0xac3ac0){return[_0xac3ac0,!![]];});});}else{throw new Error(_0x58c7('0xb5'));}})[_0x58c7('0xb6')](function(_0x52ca85,_0x6e3140){if(_0x6e3140){return _0x52ca85;}return db[_0x58c7('0xa1')][_0x58c7('0x5e')]({'direction':'out','read':![],'body':_0x16b671[_0x58c7('0x5f')]['attachments'][0x0][_0x58c7('0xb3')],'FaxAccountId':_0x12422f['id'],'FaxInteractionId':_0x52ca85['id'],'UserId':_0x16b671['user']['id'],'ContactId':_0x52ca85['ContactId'],'AttachmentId':_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')][0x0]['id']})[_0x58c7('0x22')](function(_0x433c0c){_0x52ca85['dataValues']['Messages']=[];_0x52ca85['dataValues'][_0x58c7('0xb4')][_0x58c7('0x8d')](_0x433c0c[_0x58c7('0xb7')]);return _0x52ca85;});})[_0x58c7('0x22')](function(_0x5684df){respondWithRpcPromise('SendFax',_0x58c7('0xb8'),{'FaxAccountId':_[_0x58c7('0xad')](_0x16b671[_0x58c7('0x5c')]['id'])?undefined:_0x16b671['params']['id'],'path':_[_0x58c7('0xad')](_0x16b671[_0x58c7('0x5f')][_0x58c7('0xa8')][0x0][_0x58c7('0x7')])?undefined:_0x16b671[_0x58c7('0x5f')]['attachments'][0x0][_0x58c7('0x7')],'fax':_['isNil'](_0x16b671[_0x58c7('0x5f')]['to'][0x0])?undefined:_0x16b671[_0x58c7('0x5f')]['to'][0x0],'AttachmentId':_0x16b671['body'][_0x58c7('0xa8')][0x0]['id']},client9002)[_0x58c7('0x22')](function(_0x1fd663){logger['info']('SendFaxRpc,\x20%s',_0x1fd663);})[_0x58c7('0x2c')](function(_0x2ac736){logger[_0x58c7('0x23')]('SendFaxRpc,\x20%s',_0x2ac736);});return _0x5684df;})['then'](respondWithResult(_0x41d74e,null))[_0x58c7('0x2c')](handleError(_0x41d74e,null));};exports[_0x58c7('0xb9')]=function(_0x7c27ca,_0x27ba58,_0x5257fe){return db[_0x58c7('0x43')]['find']({'where':{'id':_0x7c27ca[_0x58c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x27ba58,null))['then'](function(_0x56d8b2){if(_0x56d8b2){return _0x56d8b2['addAgents'](_0x7c27ca[_0x58c7('0x5f')][_0x58c7('0x73')],_[_0x58c7('0x9e')](_0x7c27ca[_0x58c7('0x5f')],['ids','id'])||{})[_0x58c7('0xb6')](function(_0x109805){for(var _0x2ef546=0x0;_0x2ef546<_0x7c27ca[_0x58c7('0x5f')]['ids'][_0x58c7('0x50')];_0x2ef546+=0x1){socket['emit'](_0x58c7('0xba'),{'UserId':Number(_0x7c27ca[_0x58c7('0x5f')][_0x58c7('0x73')][_0x2ef546]),'FaxAccountId':Number(_0x7c27ca[_0x58c7('0x5c')]['id'])});}return _0x109805;});}})[_0x58c7('0x22')](respondWithResult(_0x27ba58,null))[_0x58c7('0x2c')](handleError(_0x27ba58,null));};exports[_0x58c7('0xbb')]=function(_0x23828f,_0x35e95e,_0x253855){return db[_0x58c7('0x43')][_0x58c7('0x66')]({'where':{'id':_0x23828f[_0x58c7('0x5c')]['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0x35e95e,null))[_0x58c7('0x22')](function(_0x505b9e){if(_0x505b9e){return _0x505b9e[_0x58c7('0xbb')](_0x23828f[_0x58c7('0x4a')][_0x58c7('0x73')])['then'](function(){if(_[_0x58c7('0xbc')](_0x23828f[_0x58c7('0x4a')]['ids'])){for(var _0x5a4dac=0x0;_0x5a4dac<_0x23828f[_0x58c7('0x4a')][_0x58c7('0x73')][_0x58c7('0x50')];_0x5a4dac+=0x1){socket['emit'](_0x58c7('0xbd'),{'UserId':Number(_0x23828f['query'][_0x58c7('0x73')][_0x5a4dac]),'FaxAccountId':Number(_0x23828f[_0x58c7('0x5c')]['id'])});}}else{socket[_0x58c7('0xbe')](_0x58c7('0xbd'),{'UserId':Number(_0x23828f[_0x58c7('0x4a')][_0x58c7('0x73')]),'FaxAccountId':Number(_0x23828f[_0x58c7('0x5c')]['id'])});}});}})[_0x58c7('0x22')](respondWithStatusCode(_0x35e95e,null))[_0x58c7('0x2c')](handleError(_0x35e95e,null));};exports[_0x58c7('0xbf')]=function(_0x6ab497,_0xba40fa,_0xf260a1){var _0x495be9={};var _0x20fbdc={};var _0x1db91b;var _0x43d4c9;return db['FaxAccount'][_0x58c7('0x6a')]({'where':{'id':_0x6ab497[_0x58c7('0x5c')]['id']}})[_0x58c7('0x22')](handleEntityNotFound(_0xba40fa,null))[_0x58c7('0x22')](function(_0x154679){if(_0x154679){_0x1db91b=_0x154679;_0x20fbdc['model']=_[_0x58c7('0x4b')](db[_0x58c7('0xc0')][_0x58c7('0x44')]);_0x20fbdc[_0x58c7('0x4a')]=_['keys'](_0x6ab497[_0x58c7('0x4a')]);_0x20fbdc[_0x58c7('0x4c')]=_[_0x58c7('0x4d')](_0x20fbdc[_0x58c7('0x48')],_0x20fbdc[_0x58c7('0x4a')]);_0x495be9[_0x58c7('0x4e')]=_[_0x58c7('0x4d')](_0x20fbdc[_0x58c7('0x48')],qs['fields'](_0x6ab497[_0x58c7('0x4a')]['fields']));_0x495be9[_0x58c7('0x4e')]=_0x495be9['attributes'][_0x58c7('0x50')]?_0x495be9[_0x58c7('0x4e')]:_0x20fbdc[_0x58c7('0x48')];_0x495be9[_0x58c7('0x6d')]=qs[_0x58c7('0x52')](_0x6ab497['query'][_0x58c7('0x52')]);_0x495be9[_0x58c7('0x53')]=qs[_0x58c7('0x4c')](_['pick'](_0x6ab497[_0x58c7('0x4a')],_0x20fbdc[_0x58c7('0x4c')]));if(_0x6ab497[_0x58c7('0x4a')][_0x58c7('0x54')]){_0x495be9[_0x58c7('0x53')]=_[_0x58c7('0x55')](_0x495be9[_0x58c7('0x53')],{'$or':_[_0x58c7('0x49')](_0x495be9['attributes'],function(_0x453319){var _0x112525={};_0x112525[_0x453319]={'$like':'%'+_0x6ab497['query'][_0x58c7('0x54')]+'%'};return _0x112525;})});}_0x495be9=_[_0x58c7('0x55')]({},_0x495be9,_0x6ab497[_0x58c7('0x57')]);return _0x1db91b['getAgents'](_0x495be9);}})[_0x58c7('0x22')](function(_0x4f5571){if(_0x4f5571){_0x43d4c9=_0x4f5571[_0x58c7('0x50')];if(!_0x6ab497[_0x58c7('0x4a')]['hasOwnProperty']('nolimit')){_0x495be9[_0x58c7('0x33')]=qs[_0x58c7('0x33')](_0x6ab497['query'][_0x58c7('0x33')]);_0x495be9['offset']=qs['offset'](_0x6ab497[_0x58c7('0x4a')]['offset']);}return _0x1db91b[_0x58c7('0xbf')](_0x495be9);}})['then'](function(_0x1a8d82){if(_0x1a8d82){return _0x1a8d82?{'count':_0x43d4c9,'rows':_0x1a8d82}:null;}})[_0x58c7('0x22')](respondWithResult(_0xba40fa,null))['catch'](handleError(_0xba40fa,null));}; \ No newline at end of file +var _0x9983=['format','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit','removeAgents','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','http','client','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','include','show','params','includeAll','options','find','create','user','role','FaxAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','findOne','rawAttributes','findAll','removeDispositions','addAnswer','CannedAnswer','rows','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','order','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','app','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','headerinfo','maxrate','modem','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','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','from'];(function(_0x3760d5,_0x118479){var _0x91783c=function(_0x396a8e){while(--_0x396a8e){_0x3760d5['push'](_0x3760d5['shift']());}};_0x91783c(++_0x118479);}(_0x9983,0xcb));var _0x3998=function(_0x309293,_0x1c1e8c){_0x309293=_0x309293-0x0;var _0x359ab3=_0x9983[_0x309293];return _0x359ab3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3998('0x0'));var jsonpatch=require(_0x3998('0x1'));var rp=require(_0x3998('0x2'));var moment=require(_0x3998('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3998('0x4'));var util=require(_0x3998('0x5'));var path=require(_0x3998('0x6'));var sox=require(_0x3998('0x7'));var csv=require(_0x3998('0x8'));var ejs=require(_0x3998('0x9'));var fs=require('fs');var fs_extra=require(_0x3998('0xa'));var _=require(_0x3998('0xb'));var squel=require(_0x3998('0xc'));var crypto=require(_0x3998('0xd'));var jsforce=require(_0x3998('0xe'));var deskjs=require(_0x3998('0xf'));var toCsv=require(_0x3998('0x8'));var querystring=require('querystring');var Papa=require(_0x3998('0x10'));var Redis=require(_0x3998('0x11'));var authService=require(_0x3998('0x12'));var qs=require(_0x3998('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3998('0x14'));var logger=require(_0x3998('0x15'))(_0x3998('0x16'));var utils=require('../../config/utils');var config=require(_0x3998('0x17'));var licenseUtil=require(_0x3998('0x18'));var db=require(_0x3998('0x19'))['db'];config[_0x3998('0x1a')]=_[_0x3998('0x1b')](config[_0x3998('0x1a')],{'host':_0x3998('0x1c'),'port':0x18eb});var socket=require(_0x3998('0x1d'))(new Redis(config[_0x3998('0x1a')]));require(_0x3998('0x1e'))[_0x3998('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3998('0x20')]({'port':0x232c});var client9002=jayson[_0x3998('0x21')][_0x3998('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x57ccd0,_0x124015,_0x4f9f7e,_0xd9797b){return new BPromise(function(_0x532e5f,_0x514b1a){var _0x16339d=_0xd9797b||client;return _0x16339d['request'](_0x57ccd0,_0x4f9f7e)['then'](function(_0x588d2b){logger[_0x3998('0x22')](_0x3998('0x23'),_0x124015,'request\x20sent');logger[_0x3998('0x24')](_0x3998('0x25'),_0x124015,'request\x20sent',JSON[_0x3998('0x26')](_0x588d2b));if(_0x588d2b[_0x3998('0x27')]){if(_0x588d2b[_0x3998('0x27')][_0x3998('0x28')]===0x1f4){logger[_0x3998('0x27')](_0x3998('0x23'),_0x124015,_0x588d2b['error'][_0x3998('0x29')]);return _0x514b1a(_0x588d2b[_0x3998('0x27')][_0x3998('0x29')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x124015,_0x588d2b['error'][_0x3998('0x29')]);return _0x532e5f(_0x588d2b[_0x3998('0x27')]['message']);}else{logger[_0x3998('0x22')]('FaxAccount,\x20%s,\x20%s',_0x124015,'request\x20sent');_0x532e5f(_0x588d2b[_0x3998('0x2a')][_0x3998('0x29')]);}})[_0x3998('0x2b')](function(_0x5279ca){logger[_0x3998('0x27')](_0x3998('0x23'),_0x124015,_0x5279ca);_0x514b1a(_0x5279ca);});});}function respondWithStatusCode(_0x22470e,_0x3ca02b){_0x3ca02b=_0x3ca02b||0xcc;return function(_0x167fcf){if(_0x167fcf){return _0x22470e[_0x3998('0x2c')](_0x3ca02b);}return _0x22470e[_0x3998('0x2d')](_0x3ca02b)['end']();};}function respondWithResult(_0x1a807e,_0x3a2e58){_0x3a2e58=_0x3a2e58||0xc8;return function(_0x5a6148){if(_0x5a6148){return _0x1a807e[_0x3998('0x2d')](_0x3a2e58)[_0x3998('0x2e')](_0x5a6148);}};}function respondWithFilteredResult(_0x4cbf18,_0x553911){return function(_0xd4c7f0){if(_0xd4c7f0){var _0x46630c=typeof _0x553911['offset']===_0x3998('0x2f')&&typeof _0x553911[_0x3998('0x30')]==='undefined';var _0x4b2960=_0xd4c7f0[_0x3998('0x31')];var _0x3a5d42=_0x46630c?0x0:_0x553911[_0x3998('0x32')];var _0x139ed7=_0x46630c?_0xd4c7f0['count']:_0x553911[_0x3998('0x32')]+_0x553911[_0x3998('0x30')];var _0x30d4f2;if(_0x139ed7>=_0x4b2960){_0x139ed7=_0x4b2960;_0x30d4f2=0xc8;}else{_0x30d4f2=0xce;}_0x4cbf18[_0x3998('0x2d')](_0x30d4f2);return _0x4cbf18['set'](_0x3998('0x33'),_0x3a5d42+'-'+_0x139ed7+'/'+_0x4b2960)[_0x3998('0x2e')](_0xd4c7f0);}return null;};}function patchUpdates(_0x1683e7){return function(_0x1415d8){try{jsonpatch[_0x3998('0x34')](_0x1415d8,_0x1683e7,!![]);}catch(_0x3b82d6){return BPromise['reject'](_0x3b82d6);}return _0x1415d8[_0x3998('0x35')]();};}function saveUpdates(_0x10fc22,_0x721ddd){return function(_0x53755c){if(_0x53755c){return _0x53755c[_0x3998('0x36')](_0x10fc22)[_0x3998('0x37')](function(_0x267d3a){return _0x267d3a;});}return null;};}function removeEntity(_0x1f87bb,_0x2ae989){return function(_0x2f8f89){if(_0x2f8f89){return _0x2f8f89[_0x3998('0x38')]()['then'](function(){var _0x3a7c86=_0x2f8f89[_0x3998('0x39')]({'plain':!![]});var _0x5bf4bb='FaxAccounts';return db[_0x3998('0x3a')]['destroy']({'where':{'type':_0x5bf4bb,'resourceId':_0x3a7c86['id']}})[_0x3998('0x37')](function(){return _0x2f8f89;});})[_0x3998('0x37')](function(){_0x1f87bb[_0x3998('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x223283,_0x2d595e){return function(_0x45bca1){if(!_0x45bca1){_0x223283[_0x3998('0x2c')](0x194);}return _0x45bca1;};}function handleError(_0x29ea5a,_0x5bf336){_0x5bf336=_0x5bf336||0x1f4;return function(_0x578571){logger[_0x3998('0x27')](_0x578571['stack']);if(_0x578571[_0x3998('0x3b')]){delete _0x578571['name'];}_0x29ea5a[_0x3998('0x2d')](_0x5bf336)[_0x3998('0x3c')](_0x578571);};}exports[_0x3998('0x3d')]=function(_0x2db8c9,_0x547ad0){var _0x3bd4cf={'include':[{'model':db[_0x3998('0x3e')],'as':_0x3998('0x3f')}]},_0x353f51={},_0x154d51={'count':0x0,'rows':[]};var _0xa8fad1=_[_0x3998('0x40')](db[_0x3998('0x41')]['rawAttributes'],function(_0x1cff77){return{'name':_0x1cff77['fieldName'],'type':_0x1cff77[_0x3998('0x42')][_0x3998('0x43')]};});_0x353f51['model']=_[_0x3998('0x40')](_0xa8fad1,_0x3998('0x3b'));_0x353f51[_0x3998('0x44')]=_[_0x3998('0x45')](_0x2db8c9[_0x3998('0x44')]);_0x353f51['filters']=_[_0x3998('0x46')](_0x353f51[_0x3998('0x47')],_0x353f51[_0x3998('0x44')]);_0x3bd4cf[_0x3998('0x48')]=_[_0x3998('0x46')](_0x353f51[_0x3998('0x47')],qs['fields'](_0x2db8c9[_0x3998('0x44')][_0x3998('0x49')]));_0x3bd4cf['attributes']=_0x3bd4cf[_0x3998('0x48')][_0x3998('0x4a')]?_0x3bd4cf['attributes']:_0x353f51[_0x3998('0x47')];if(!_0x2db8c9['query'][_0x3998('0x4b')](_0x3998('0x4c'))){_0x3bd4cf['limit']=qs[_0x3998('0x30')](_0x2db8c9[_0x3998('0x44')][_0x3998('0x30')]);_0x3bd4cf[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x2db8c9[_0x3998('0x44')]['offset']);}_0x3bd4cf['order']=qs[_0x3998('0x4d')](_0x2db8c9[_0x3998('0x44')][_0x3998('0x4d')]);_0x3bd4cf[_0x3998('0x4e')]=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x2db8c9[_0x3998('0x44')],_0x353f51[_0x3998('0x4f')]),_0xa8fad1);if(_0x2db8c9['query'][_0x3998('0x51')]){_0x3bd4cf[_0x3998('0x4e')]=_['merge'](_0x3bd4cf[_0x3998('0x4e')],{'$or':_[_0x3998('0x40')](_0xa8fad1,function(_0x48cdba){if(_0x48cdba[_0x3998('0x42')]!==_0x3998('0x52')){var _0x28e64c={};_0x28e64c[_0x48cdba[_0x3998('0x3b')]]={'$like':'%'+_0x2db8c9[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0x28e64c;}})});}_0x3bd4cf=_[_0x3998('0x53')]({},_0x3bd4cf,_0x2db8c9['options']);var _0x1c115d={'where':_0x3bd4cf['where']};return db['FaxAccount'][_0x3998('0x31')](_0x1c115d)[_0x3998('0x37')](function(_0x38c398){_0x154d51[_0x3998('0x31')]=_0x38c398;if(_0x2db8c9[_0x3998('0x44')]['includeAll']){_0x3bd4cf[_0x3998('0x54')]=[{'all':!![]}];}return db[_0x3998('0x41')]['findAll'](_0x3bd4cf);})['then'](function(_0x36f6e4){_0x154d51['rows']=_0x36f6e4;return _0x154d51;})['then'](respondWithFilteredResult(_0x547ad0,_0x3bd4cf))[_0x3998('0x2b')](handleError(_0x547ad0,null));};exports[_0x3998('0x55')]=function(_0x5851f2,_0x153e09){var _0x4a5a4d={'raw':![],'where':{'id':_0x5851f2[_0x3998('0x56')]['id']},'include':[{'model':db[_0x3998('0x3e')],'as':_0x3998('0x3f')}]},_0x22ee07={};_0x22ee07[_0x3998('0x47')]=_['keys'](db['FaxAccount']['rawAttributes']);_0x22ee07[_0x3998('0x44')]=_[_0x3998('0x45')](_0x5851f2['query']);_0x22ee07[_0x3998('0x4f')]=_[_0x3998('0x46')](_0x22ee07['model'],_0x22ee07[_0x3998('0x44')]);_0x4a5a4d[_0x3998('0x48')]=_[_0x3998('0x46')](_0x22ee07['model'],qs[_0x3998('0x49')](_0x5851f2[_0x3998('0x44')][_0x3998('0x49')]));_0x4a5a4d[_0x3998('0x48')]=_0x4a5a4d[_0x3998('0x48')]['length']?_0x4a5a4d[_0x3998('0x48')]:_0x22ee07['model'];if(_0x5851f2[_0x3998('0x44')][_0x3998('0x57')]){_0x4a5a4d[_0x3998('0x54')]=[{'all':!![]}];}_0x4a5a4d=_[_0x3998('0x53')]({},_0x4a5a4d,_0x5851f2[_0x3998('0x58')]);return db[_0x3998('0x41')][_0x3998('0x59')](_0x4a5a4d)['then'](handleEntityNotFound(_0x153e09,null))['then'](respondWithResult(_0x153e09,null))[_0x3998('0x2b')](handleError(_0x153e09,null));};exports[_0x3998('0x5a')]=function(_0x5a2e3e,_0x3d2769){return db[_0x3998('0x41')][_0x3998('0x5a')](_0x5a2e3e['body'],{})['then'](function(_0x12ed52){var _0xbe3c6=_0x5a2e3e[_0x3998('0x5b')][_0x3998('0x39')]({'plain':!![]});if(!_0xbe3c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbe3c6[_0x3998('0x5c')]===_0x3998('0x5b')){var _0x16316a=_0x12ed52[_0x3998('0x39')]({'plain':!![]});var _0x3191f4=_0x3998('0x5d');return db['UserProfileSection'][_0x3998('0x59')]({'where':{'name':_0x3191f4,'userProfileId':_0xbe3c6[_0x3998('0x5e')]},'raw':!![]})[_0x3998('0x37')](function(_0x5c7f0d){if(_0x5c7f0d&&_0x5c7f0d[_0x3998('0x5f')]===0x0){return db['UserProfileResource'][_0x3998('0x5a')]({'name':_0x16316a['name'],'resourceId':_0x16316a['id'],'type':_0x5c7f0d[_0x3998('0x3b')],'sectionId':_0x5c7f0d['id']},{})['then'](function(){return _0x12ed52;});}else{return _0x12ed52;}})['catch'](function(_0x52b022){logger[_0x3998('0x27')](_0x3998('0x60'),_0x52b022);throw _0x52b022;});}return _0x12ed52;})[_0x3998('0x37')](respondWithResult(_0x3d2769,0xc9))[_0x3998('0x2b')](handleError(_0x3d2769,null));};exports[_0x3998('0x36')]=function(_0x2b54bf,_0x5bb33a){if(_0x2b54bf[_0x3998('0x61')]['id']){delete _0x2b54bf['body']['id'];}return db['FaxAccount'][_0x3998('0x59')]({'where':{'id':_0x2b54bf[_0x3998('0x56')]['id']},'include':[{'model':db[_0x3998('0x3e')],'as':_0x3998('0x3f')}]})['then'](handleEntityNotFound(_0x5bb33a,null))[_0x3998('0x37')](saveUpdates(_0x2b54bf['body'],null))[_0x3998('0x37')](respondWithResult(_0x5bb33a,null))[_0x3998('0x2b')](handleError(_0x5bb33a,null));};exports['destroy']=function(_0x5a60c1,_0x4cd001){return db['FaxAccount'][_0x3998('0x59')]({'where':{'id':_0x5a60c1[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0x4cd001,null))[_0x3998('0x37')](removeEntity(_0x4cd001,null))[_0x3998('0x2b')](handleError(_0x4cd001,null));};exports['describe']=function(_0x34ec35,_0x1a33af){return db[_0x3998('0x41')][_0x3998('0x62')]()['then'](respondWithResult(_0x1a33af,null))['catch'](handleError(_0x1a33af,null));};exports[_0x3998('0x63')]=function(_0x2e014c,_0x430a41,_0x318b23){if(_0x2e014c['body']['id']){delete _0x2e014c[_0x3998('0x61')]['id'];}return db[_0x3998('0x41')][_0x3998('0x59')]({'where':{'id':_0x2e014c['params']['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x430a41,null))[_0x3998('0x37')](function(_0x31fca6){if(_0x31fca6){_0x2e014c['body'][_0x3998('0x64')]=_0x31fca6['id'];return db[_0x3998('0x65')][_0x3998('0x5a')](_0x2e014c[_0x3998('0x61')]);}})[_0x3998('0x37')](respondWithResult(_0x430a41,null))[_0x3998('0x2b')](handleError(_0x430a41,null));};exports['getDispositions']=function(_0x3eba57,_0x3bfb44,_0xbc4db4){var _0x2c15f8={'raw':![],'where':{}};var _0x41c460={};var _0x502987={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3998('0x66')]({'where':{'id':_0x3eba57[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x3bfb44,null))[_0x3998('0x37')](function(_0x2deb54){if(_0x2deb54){_0x41c460[_0x3998('0x47')]=_['keys'](db['Disposition'][_0x3998('0x67')]);_0x41c460[_0x3998('0x44')]=_['keys'](_0x3eba57[_0x3998('0x44')]);_0x41c460[_0x3998('0x4f')]=_[_0x3998('0x46')](_0x41c460[_0x3998('0x47')],_0x41c460[_0x3998('0x44')]);_0x2c15f8[_0x3998('0x48')]=_[_0x3998('0x46')](_0x41c460[_0x3998('0x47')],qs['fields'](_0x3eba57[_0x3998('0x44')][_0x3998('0x49')]));_0x2c15f8[_0x3998('0x48')]=_0x2c15f8[_0x3998('0x48')][_0x3998('0x4a')]?_0x2c15f8[_0x3998('0x48')]:_0x41c460[_0x3998('0x47')];if(!_0x3eba57[_0x3998('0x44')]['hasOwnProperty'](_0x3998('0x4c'))){_0x2c15f8['limit']=qs[_0x3998('0x30')](_0x3eba57[_0x3998('0x44')][_0x3998('0x30')]);_0x2c15f8[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x3eba57[_0x3998('0x44')]['offset']);}_0x2c15f8['order']=qs[_0x3998('0x4d')](_0x3eba57[_0x3998('0x44')]['sort']);_0x2c15f8[_0x3998('0x4e')]=qs['filters'](_[_0x3998('0x50')](_0x3eba57[_0x3998('0x44')],_0x41c460['filters']));_0x2c15f8['where'][_0x3998('0x64')]=_0x2deb54['id'];if(_0x3eba57[_0x3998('0x44')][_0x3998('0x51')]){_0x2c15f8['where']=_[_0x3998('0x53')](_0x2c15f8[_0x3998('0x4e')],{'$or':_[_0x3998('0x40')](_0x2c15f8[_0x3998('0x48')],function(_0x1bd197){var _0x2f6554={};_0x2f6554[_0x1bd197]={'$like':'%'+_0x3eba57['query'][_0x3998('0x51')]+'%'};return _0x2f6554;})});}_0x2c15f8=_[_0x3998('0x53')]({},_0x2c15f8,_0x3eba57[_0x3998('0x58')]);return db[_0x3998('0x65')][_0x3998('0x31')]({'where':_0x2c15f8[_0x3998('0x4e')]})['then'](function(_0x3b5d57){_0x502987[_0x3998('0x31')]=_0x3b5d57;if(_0x3eba57['query'][_0x3998('0x57')]){_0x2c15f8['include']=[{'all':!![]}];}return db[_0x3998('0x65')][_0x3998('0x68')](_0x2c15f8);})[_0x3998('0x37')](function(_0x278927){_0x502987['rows']=_0x278927;return _0x502987;});}})[_0x3998('0x37')](respondWithFilteredResult(_0x3bfb44,_0x2c15f8))[_0x3998('0x2b')](handleError(_0x3bfb44,null));};exports[_0x3998('0x69')]=function(_0x58ebf6,_0x5a3f38,_0x1306f5){return db['FaxAccount']['find']({'where':{'id':_0x58ebf6['params']['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x5a3f38,null))['then'](function(_0x5b341f){if(_0x5b341f){return _0x5b341f[_0x3998('0x69')](_0x58ebf6['query']['ids']);}})[_0x3998('0x37')](respondWithStatusCode(_0x5a3f38,null))[_0x3998('0x2b')](handleError(_0x5a3f38,null));};exports[_0x3998('0x6a')]=function(_0x4b7380,_0x507d3d,_0xe4465f){if(_0x4b7380[_0x3998('0x61')]['id']){delete _0x4b7380[_0x3998('0x61')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x4b7380[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x507d3d,null))[_0x3998('0x37')](function(_0x3a897e){if(_0x3a897e){_0x4b7380['body'][_0x3998('0x64')]=_0x3a897e['id'];return db[_0x3998('0x6b')]['create'](_0x4b7380[_0x3998('0x61')]);}})['then'](respondWithResult(_0x507d3d,null))[_0x3998('0x2b')](handleError(_0x507d3d,null));};exports['getAnswers']=function(_0x9f9a7f,_0x2880ba,_0x255d47){var _0x2c8beb={'raw':![],'where':{}};var _0x23d995={};var _0x59efe2={'count':0x0,'rows':[]};return db[_0x3998('0x41')][_0x3998('0x66')]({'where':{'id':_0x9f9a7f[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x2880ba,null))[_0x3998('0x37')](function(_0x129455){if(_0x129455){_0x23d995[_0x3998('0x47')]=_[_0x3998('0x45')](db[_0x3998('0x6b')][_0x3998('0x67')]);_0x23d995[_0x3998('0x44')]=_[_0x3998('0x45')](_0x9f9a7f[_0x3998('0x44')]);_0x23d995[_0x3998('0x4f')]=_[_0x3998('0x46')](_0x23d995[_0x3998('0x47')],_0x23d995[_0x3998('0x44')]);_0x2c8beb[_0x3998('0x48')]=_[_0x3998('0x46')](_0x23d995[_0x3998('0x47')],qs['fields'](_0x9f9a7f[_0x3998('0x44')][_0x3998('0x49')]));_0x2c8beb['attributes']=_0x2c8beb['attributes'][_0x3998('0x4a')]?_0x2c8beb[_0x3998('0x48')]:_0x23d995[_0x3998('0x47')];if(!_0x9f9a7f['query']['hasOwnProperty']('nolimit')){_0x2c8beb[_0x3998('0x30')]=qs['limit'](_0x9f9a7f[_0x3998('0x44')][_0x3998('0x30')]);_0x2c8beb['offset']=qs[_0x3998('0x32')](_0x9f9a7f[_0x3998('0x44')][_0x3998('0x32')]);}_0x2c8beb['order']=qs[_0x3998('0x4d')](_0x9f9a7f[_0x3998('0x44')][_0x3998('0x4d')]);_0x2c8beb[_0x3998('0x4e')]=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x9f9a7f[_0x3998('0x44')],_0x23d995[_0x3998('0x4f')]));_0x2c8beb[_0x3998('0x4e')]['FaxAccountId']=_0x129455['id'];if(_0x9f9a7f[_0x3998('0x44')][_0x3998('0x51')]){_0x2c8beb[_0x3998('0x4e')]=_[_0x3998('0x53')](_0x2c8beb['where'],{'$or':_[_0x3998('0x40')](_0x2c8beb[_0x3998('0x48')],function(_0x1cc1ad){var _0x4bb5e7={};_0x4bb5e7[_0x1cc1ad]={'$like':'%'+_0x9f9a7f[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0x4bb5e7;})});}_0x2c8beb=_[_0x3998('0x53')]({},_0x2c8beb,_0x9f9a7f[_0x3998('0x58')]);return db[_0x3998('0x6b')][_0x3998('0x31')]({'where':_0x2c8beb[_0x3998('0x4e')]})['then'](function(_0x4c91a1){_0x59efe2[_0x3998('0x31')]=_0x4c91a1;if(_0x9f9a7f['query'][_0x3998('0x57')]){_0x2c8beb[_0x3998('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3998('0x68')](_0x2c8beb);})[_0x3998('0x37')](function(_0x57e4b3){_0x59efe2[_0x3998('0x6c')]=_0x57e4b3;return _0x59efe2;});}})[_0x3998('0x37')](respondWithFilteredResult(_0x2880ba,_0x2c8beb))[_0x3998('0x2b')](handleError(_0x2880ba,null));};exports[_0x3998('0x6d')]=function(_0x10ffd5,_0x3195a1,_0x261245){return db[_0x3998('0x41')][_0x3998('0x59')]({'where':{'id':_0x10ffd5[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0x3195a1,null))[_0x3998('0x37')](function(_0x2ef403){if(_0x2ef403){return _0x2ef403[_0x3998('0x6d')](_0x10ffd5[_0x3998('0x44')][_0x3998('0x6e')]);}})[_0x3998('0x37')](respondWithStatusCode(_0x3195a1,null))[_0x3998('0x2b')](handleError(_0x3195a1,null));};exports[_0x3998('0x6f')]=function(_0x6720fa,_0x5948ec,_0x334246){return db[_0x3998('0x70')][_0x3998('0x59')]({'where':{'id':_0x6720fa[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x5948ec,null))['then'](function(_0x1b16cd){if(_0x1b16cd){return _0x1b16cd[_0x3998('0x6f')](_0x6720fa[_0x3998('0x61')][_0x3998('0x6e')],_[_0x3998('0x71')](_0x6720fa[_0x3998('0x61')],['ids','id'])||{});}})['then'](respondWithResult(_0x5948ec,null))['catch'](handleError(_0x5948ec,null));};exports[_0x3998('0x72')]=function(_0x579d7d,_0x55bdad,_0x2b0d3f){var _0x402804={'raw':![],'where':{}};var _0x409739={};var _0x1dc904={'count':0x0,'rows':[]};return db[_0x3998('0x41')]['findOne']({'where':{'id':_0x579d7d[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0x55bdad,null))['then'](function(_0xaffaec){if(_0xaffaec){_0x409739[_0x3998('0x47')]=_['keys'](db['FaxInteraction'][_0x3998('0x67')]);_0x409739['query']=_[_0x3998('0x45')](_0x579d7d['query']);_0x409739[_0x3998('0x4f')]=_['intersection'](_0x409739[_0x3998('0x47')],_0x409739[_0x3998('0x44')]);_0x402804[_0x3998('0x48')]=_['intersection'](_0x409739['model'],qs[_0x3998('0x49')](_0x579d7d[_0x3998('0x44')][_0x3998('0x49')]));_0x402804['attributes']=_0x402804['attributes'][_0x3998('0x4a')]?_0x402804['attributes']:_0x409739[_0x3998('0x47')];if(!_0x579d7d[_0x3998('0x44')][_0x3998('0x4b')](_0x3998('0x4c'))){_0x402804[_0x3998('0x30')]=qs['limit'](_0x579d7d[_0x3998('0x44')]['limit']);_0x402804['offset']=qs[_0x3998('0x32')](_0x579d7d[_0x3998('0x44')][_0x3998('0x32')]);}_0x402804[_0x3998('0x73')]=qs[_0x3998('0x4d')](_0x579d7d[_0x3998('0x44')][_0x3998('0x4d')]);_0x402804['where']=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x579d7d[_0x3998('0x44')],_0x409739['filters']));_0x402804[_0x3998('0x4e')][_0x3998('0x64')]=_0xaffaec['id'];if(_0x579d7d[_0x3998('0x44')][_0x3998('0x51')]){_0x402804['where']=_[_0x3998('0x53')](_0x402804[_0x3998('0x4e')],{'$or':_[_0x3998('0x40')](_0x402804[_0x3998('0x48')],function(_0x4199a){var _0x1521fb={};_0x1521fb[_0x4199a]={'$like':'%'+_0x579d7d[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0x1521fb;})});}_0x402804=_[_0x3998('0x53')]({},_0x402804,_0x579d7d[_0x3998('0x58')]);return db['FaxInteraction'][_0x3998('0x31')]({'where':_0x402804[_0x3998('0x4e')]})[_0x3998('0x37')](function(_0x5830aa){_0x1dc904['count']=_0x5830aa;if(_0x579d7d['query'][_0x3998('0x57')]){_0x402804['include']=[{'model':db[_0x3998('0x74')],'as':_0x3998('0x75'),'required':![]},{'model':db[_0x3998('0x76')],'as':'Owner','attributes':[_0x3998('0x3b'),_0x3998('0x77'),_0x3998('0x78')],'required':![]},{'model':db[_0x3998('0x79')],'as':_0x3998('0x7a'),'attributes':['id',_0x3998('0x3b'),_0x3998('0x7b')],'where':_0x579d7d[_0x3998('0x44')][_0x3998('0x7c')]?{'id':_0x579d7d['query'][_0x3998('0x7c')]}:undefined,'required':_0x579d7d[_0x3998('0x44')][_0x3998('0x7c')]?!![]:![]}];}return db['FaxInteraction'][_0x3998('0x68')](_0x402804);})['then'](function(_0x353763){_0x1dc904[_0x3998('0x6c')]=_0x353763;return _0x1dc904;});}})[_0x3998('0x37')](respondWithFilteredResult(_0x55bdad,_0x402804))[_0x3998('0x2b')](handleError(_0x55bdad,null));};exports[_0x3998('0x7d')]=function(_0x291d17,_0x4cee78,_0x1b32ad){return db[_0x3998('0x41')][_0x3998('0x66')]({'where':{'id':_0x291d17['params']['id']}})['then'](handleEntityNotFound(_0x4cee78,null))[_0x3998('0x37')](function(_0x51565a){if(_0x51565a){return db[_0x3998('0x7e')][_0x3998('0x7f')](function(_0x2c876d){return db[_0x3998('0x80')][_0x3998('0x38')]({'where':{'FaxAccountId':_0x291d17[_0x3998('0x56')]['id']},'transaction':_0x2c876d})['then'](function(_0x54b560){var _0x2b1c6a=_[_0x3998('0x40')](_0x291d17['body'],function(_0x46b013){_0x46b013[_0x3998('0x64')]=_0x291d17[_0x3998('0x56')]['id'];return _0x46b013;});return db[_0x3998('0x80')][_0x3998('0x81')](_0x2b1c6a,{'transaction':_0x2c876d});});})['then'](function(){return db['FaxApplication'][_0x3998('0x82')]({'where':{'FaxAccountId':_0x291d17[_0x3998('0x56')]['id']},'order':'priority'});});}})[_0x3998('0x37')](respondWithResult(_0x4cee78,null))[_0x3998('0x2b')](handleError(_0x4cee78,null));};exports[_0x3998('0x83')]=function(_0x3b3b8b,_0x20321f,_0x2cdd35){var _0x53e344={};var _0x5e0546={};var _0x195d54;var _0x37758c;return db[_0x3998('0x41')][_0x3998('0x66')]({'where':{'id':_0x3b3b8b['params']['id']}})['then'](handleEntityNotFound(_0x20321f,null))[_0x3998('0x37')](function(_0xf4a84e){if(_0xf4a84e){_0x195d54=_0xf4a84e;_0x5e0546[_0x3998('0x47')]=_[_0x3998('0x45')](db[_0x3998('0x80')][_0x3998('0x67')]);_0x5e0546['query']=_[_0x3998('0x45')](_0x3b3b8b[_0x3998('0x44')]);_0x5e0546[_0x3998('0x4f')]=_['intersection'](_0x5e0546[_0x3998('0x47')],_0x5e0546[_0x3998('0x44')]);_0x53e344[_0x3998('0x48')]=_['intersection'](_0x5e0546[_0x3998('0x47')],qs[_0x3998('0x49')](_0x3b3b8b[_0x3998('0x44')]['fields']));_0x53e344[_0x3998('0x48')]=_0x53e344['attributes'][_0x3998('0x4a')]?_0x53e344[_0x3998('0x48')]:_0x5e0546[_0x3998('0x47')];_0x53e344[_0x3998('0x73')]=qs[_0x3998('0x4d')](_0x3b3b8b[_0x3998('0x44')][_0x3998('0x4d')]);_0x53e344['where']=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x3b3b8b['query'],_0x5e0546['filters']));if(_0x3b3b8b[_0x3998('0x44')][_0x3998('0x51')]){_0x53e344['where']=_[_0x3998('0x53')](_0x53e344['where'],{'$or':_['map'](_0x53e344['attributes'],function(_0x17412d){var _0x2fffa3={};_0x2fffa3[_0x17412d]={'$like':'%'+_0x3b3b8b[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0x2fffa3;})});}_0x53e344=_[_0x3998('0x53')]({},_0x53e344,_0x3b3b8b['options']);return _0x195d54[_0x3998('0x83')](_0x53e344);}})['then'](function(_0x2f1363){if(_0x2f1363){_0x37758c=_0x2f1363[_0x3998('0x4a')];if(!_0x3b3b8b[_0x3998('0x44')][_0x3998('0x4b')](_0x3998('0x4c'))){_0x53e344[_0x3998('0x30')]=qs[_0x3998('0x30')](_0x3b3b8b['query'][_0x3998('0x30')]);_0x53e344[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x3b3b8b['query'][_0x3998('0x32')]);}return _0x195d54[_0x3998('0x83')](_0x53e344);}})[_0x3998('0x37')](function(_0x5920bd){if(_0x5920bd){return _0x5920bd?{'count':_0x37758c,'rows':_0x5920bd}:null;}})['then'](respondWithResult(_0x20321f,null))[_0x3998('0x2b')](handleError(_0x20321f,null));};function Extension(_0x3c0e88,_0x9bda70,_0x5d94d6,_0x80b287){this[_0x3998('0x84')]=_0x3998('0x85');this[_0x3998('0x86')]=_0x3c0e88['localstationid'];this[_0x3998('0x87')]=_0x80b287;this['type']='system';this['description']='Fax\x20Extension';this[_0x3998('0x64')]=_0x3c0e88['id'];this['priority']=_0x9bda70;this[_0x3998('0x88')]=_0x5d94d6;}function createExtensionsReciveFax(_0x223aca){var _0x1d611a=0x1;var _0x5476e8=[];_0x5476e8[_0x3998('0x89')](new Extension(_0x223aca,_0x1d611a,'',_0x3998('0x8a')));_0x1d611a+=0x1;_0x5476e8['push'](new Extension(_0x223aca,_0x1d611a,_0x3998('0x8b'),_0x3998('0x8c')));_0x1d611a+=0x1;for(var _0x2494e4 in _0x223aca){if(_0x223aca[_0x3998('0x4b')](_0x2494e4)&&(_0x2494e4===_0x3998('0x8d')||_0x2494e4===_0x3998('0x8e')||_0x2494e4===_0x3998('0x8f')||_0x2494e4==='faxdetect'||_0x2494e4===_0x3998('0x90')||_0x2494e4===_0x3998('0x91')||_0x2494e4==='minrate'||_0x2494e4===_0x3998('0x92')||_0x2494e4==='t38timeout')){_0x5476e8[_0x3998('0x89')](new Extension(_0x223aca,_0x1d611a,_0x3998('0x93')+_0x2494e4+')='+_0x223aca[_0x2494e4],_0x3998('0x8c')));_0x1d611a+=0x1;}}_0x5476e8[_0x3998('0x89')](new Extension(_0x223aca,_0x1d611a,'6','Wait'));_0x1d611a+=0x1;_0x5476e8[_0x3998('0x89')](new Extension(_0x223aca,_0x1d611a,_0x3998('0x94'),_0x3998('0x95')));_0x1d611a=0x0;return _0x5476e8;}exports['addAccountApplications']=function(_0x2a8239,_0x5d0ede,_0xab9fdb){var _0x14952;return db[_0x3998('0x7e')]['transaction'](function(_0x117cdb){return db['FaxAccount'][_0x3998('0x5a')](_0x2a8239[_0x3998('0x61')],{'transaction':_0x117cdb})[_0x3998('0x37')](function(_0x554ae3){_0x14952=_0x554ae3[_0x3998('0x39')]({'plain':!![]});return db[_0x3998('0x96')][_0x3998('0x81')](createExtensionsReciveFax(_0x14952),{'transaction':_0x117cdb});});})['then'](function(){return _0x14952;})[_0x3998('0x37')](respondWithResult(_0x5d0ede,null))[_0x3998('0x2b')](handleError(_0x5d0ede,null));};exports[_0x3998('0x97')]=function(_0x36b8f,_0x37da04,_0x252785){var _0x28eee4;return db[_0x3998('0x7e')][_0x3998('0x7f')](function(_0x342905){return db[_0x3998('0x41')]['update'](_0x36b8f[_0x3998('0x61')],{'where':{'id':_0x36b8f[_0x3998('0x61')]['id']},'transaction':_0x342905})[_0x3998('0x37')](function(_0x442d62){return db['VoiceExtension'][_0x3998('0x38')]({'where':{'FaxAccountId':_0x36b8f['body']['id']},'transaction':_0x342905})['then'](function(_0xcdd83f){return db[_0x3998('0x96')][_0x3998('0x81')](createExtensionsReciveFax(_[_0x3998('0x71')](_0x36b8f[_0x3998('0x61')],['tech',_0x3998('0x43'),_0x3998('0x98'),_0x3998('0x99'),_0x3998('0x9a'),_0x3998('0x9b')])),{'transaction':_0x342905});});});})[_0x3998('0x37')](function(){return db[_0x3998('0x41')][_0x3998('0x9c')](_0x36b8f[_0x3998('0x61')]['id']);})[_0x3998('0x37')](respondWithResult(_0x37da04,null))[_0x3998('0x2b')](handleError(_0x37da04,null));};exports[_0x3998('0x9d')]=function(_0x553549,_0x3a22cb,_0x122ad6){var _0x39a640={'raw':!![],'where':{}};var _0x36cd42={};var _0x1a8fd5={'count':0x0,'rows':[]};return db[_0x3998('0x41')]['findOne']({'where':{'id':_0x553549[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x3a22cb,null))[_0x3998('0x37')](function(_0x4af520){if(_0x4af520){_0x36cd42[_0x3998('0x47')]=_[_0x3998('0x45')](db[_0x3998('0x9e')][_0x3998('0x67')]);_0x36cd42[_0x3998('0x44')]=_['keys'](_0x553549['query']);_0x36cd42[_0x3998('0x4f')]=_[_0x3998('0x46')](_0x36cd42[_0x3998('0x47')],_0x36cd42[_0x3998('0x44')]);_0x39a640[_0x3998('0x48')]=_[_0x3998('0x46')](_0x36cd42[_0x3998('0x47')],qs[_0x3998('0x49')](_0x553549['query'][_0x3998('0x49')]));_0x39a640[_0x3998('0x48')]=_0x39a640['attributes']['length']?_0x39a640[_0x3998('0x48')]:_0x36cd42[_0x3998('0x47')];if(!_0x553549[_0x3998('0x44')][_0x3998('0x4b')](_0x3998('0x4c'))){_0x39a640[_0x3998('0x30')]=qs[_0x3998('0x30')](_0x553549[_0x3998('0x44')][_0x3998('0x30')]);_0x39a640[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x553549[_0x3998('0x44')][_0x3998('0x32')]);}_0x39a640['order']=qs[_0x3998('0x4d')](_0x553549[_0x3998('0x44')][_0x3998('0x4d')]);_0x39a640['where']=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x553549[_0x3998('0x44')],_0x36cd42[_0x3998('0x4f')]));_0x39a640[_0x3998('0x4e')][_0x3998('0x64')]=_0x4af520['id'];if(_0x553549[_0x3998('0x44')]['filter']){_0x39a640['where']=_[_0x3998('0x53')](_0x39a640['where'],{'$or':_[_0x3998('0x40')](_0x39a640[_0x3998('0x48')],function(_0x2319fd){var _0xdc794c={};_0xdc794c[_0x2319fd]={'$like':'%'+_0x553549[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0xdc794c;})});}if(_0x553549['query'][_0x3998('0x9f')]){var _0x4cc62e=_0x553549[_0x3998('0x44')]['$gte'][_0x3998('0xa0')](',');var _0x412d51={};_0x412d51[_0x4cc62e[0x0]]={'$gte':moment(_0x4cc62e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x39a640[_0x3998('0x4e')]=_[_0x3998('0x53')](_0x39a640[_0x3998('0x4e')],_0x412d51);}_0x39a640=_[_0x3998('0x53')]({},_0x39a640,_0x553549[_0x3998('0x58')]);return db[_0x3998('0x9e')][_0x3998('0x31')]({'where':_0x39a640[_0x3998('0x4e')]})[_0x3998('0x37')](function(_0x724d5){_0x1a8fd5[_0x3998('0x31')]=_0x724d5;if(_0x553549[_0x3998('0x44')][_0x3998('0x57')]){_0x39a640[_0x3998('0x54')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x39a640);})[_0x3998('0x37')](function(_0x3139ef){_0x1a8fd5[_0x3998('0x6c')]=_0x3139ef;return _0x1a8fd5;});}})['then'](respondWithFilteredResult(_0x3a22cb,_0x39a640))['catch'](handleError(_0x3a22cb,null));};exports[_0x3998('0x3c')]=function(_0x41ee09,_0x23c26c,_0x3d7281){var _0x156f40,_0x41d200={},_0x214ba5;if(_0x41ee09[_0x3998('0x61')]['to']){_0x214ba5=_0x41ee09[_0x3998('0x61')]['to'][0x0];}return db[_0x3998('0x41')][_0x3998('0x59')]({'where':{'id':_0x41ee09[_0x3998('0x56')]['id']},'include':[{'model':db[_0x3998('0xa1')],'as':_0x3998('0xa2'),'include':[{'model':db['CmContact'],'as':_0x3998('0xa3'),'where':{'fax':_0x214ba5},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x23c26c,null))[_0x3998('0x37')](function(_0x54dfd8){_0x156f40=_0x54dfd8;if(_0x41ee09['body'][_0x3998('0xa4')]&&_0x41ee09[_0x3998('0x61')]['attachments'][_0x3998('0x4a')]){for(var _0x20e069=0x0;_0x20e069<_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][_0x3998('0x4a')];_0x20e069+=0x1){_0x41ee09['body'][_0x3998('0xa4')][_0x20e069]={'filename':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][_0x20e069][_0x3998('0x3b')],'id':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][_0x20e069]['id'],'path':path[_0x3998('0xa5')](config[_0x3998('0xa6')],'server/files/attachments',_0x41ee09[_0x3998('0x61')]['attachments'][_0x20e069][_0x3998('0xa7')])};}}return respondWithRpcPromise(_0x3998('0xa8'),_0x3998('0xa8'),{'FaxAccountId':_['isNil'](_0x41ee09[_0x3998('0x56')]['id'])?undefined:_0x41ee09['params']['id'],'path':_['isNil'](_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0][_0x3998('0x6')])?undefined:_0x41ee09['body'][_0x3998('0xa4')][0x0][_0x3998('0x6')],'fax':_[_0x3998('0xa9')](_0x41ee09[_0x3998('0x61')]['to'][0x0])?undefined:_0x41ee09[_0x3998('0x61')]['to'][0x0]},client9002);})[_0x3998('0x37')](function(){if(_0x156f40){if(_[_0x3998('0xa9')](_0x41ee09['body'][_0x3998('0xaa')])){_0x41ee09[_0x3998('0x61')]['from']=util[_0x3998('0xab')]('\x22%s\x22\x20<%s>',_0x156f40[_0x3998('0x3b')],_0x156f40['fax']);}if(_0x156f40['List']){if(_0x156f40[_0x3998('0xa2')][_0x3998('0xa3')][_0x3998('0x4a')]){return _0x156f40[_0x3998('0xa2')][_0x3998('0xa3')][0x0];}else{return db[_0x3998('0x74')][_0x3998('0x5a')](_[_0x3998('0x1b')](_0x41ee09['body'],{'firstName':_0x41ee09[_0x3998('0x61')]['to'][0x0],'phone':_0x41ee09[_0x3998('0x61')]['to'][0x0],'fax':_0x41ee09[_0x3998('0x61')]['to'][0x0],'ListId':_0x156f40[_0x3998('0x9b')]}));}}else{throw new Error(_0x3998('0xac'));}}else{throw new Error(_0x3998('0xad'));}})[_0x3998('0x37')](function(_0x3470a2){if(_0x3470a2){return db[_0x3998('0x70')][_0x3998('0x59')]({'where':{'ContactId':_0x3470a2['id'],'closed':![],'FaxAccountId':_0x156f40['id']}})[_0x3998('0x37')](function(_0x105424){if(_0x105424){return[_0x105424,![]];}return db[_0x3998('0x70')][_0x3998('0x5a')]({'UserId':_0x41ee09[_0x3998('0x5b')]['id'],'ContactId':_0x3470a2['id'],'FaxAccountId':_0x156f40['id'],'fax':_0x41ee09['body']['to'][0x0],'firstMsgDirection':_0x3998('0xae'),'Messages':[_[_0x3998('0x53')](_0x41ee09[_0x3998('0x61')],{'read':![],'body':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0][_0x3998('0xaf')],'FaxAccountId':_0x156f40['id'],'UserId':_0x41ee09[_0x3998('0x5b')]['id'],'ContactId':_0x3470a2['id'],'AttachmentId':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0x3998('0x9e')],'as':_0x3998('0xb0')}]})[_0x3998('0x37')](function(_0x5ded6c){return[_0x5ded6c,!![]];});});}else{throw new Error(_0x3998('0xb1'));}})[_0x3998('0xb2')](function(_0xc10977,_0x893918){if(_0x893918){return _0xc10977;}return db['FaxMessage']['create']({'direction':_0x3998('0xae'),'read':![],'body':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0]['filename'],'FaxAccountId':_0x156f40['id'],'FaxInteractionId':_0xc10977['id'],'UserId':_0x41ee09['user']['id'],'ContactId':_0xc10977[_0x3998('0xb3')],'AttachmentId':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0]['id']})[_0x3998('0x37')](function(_0x5ab869){_0xc10977[_0x3998('0xb4')]['Messages']=[];_0xc10977[_0x3998('0xb4')][_0x3998('0xb0')]['push'](_0x5ab869[_0x3998('0xb4')]);return _0xc10977;});})[_0x3998('0x37')](function(_0x1a4201){respondWithRpcPromise(_0x3998('0xb5'),_0x3998('0xb5'),{'FaxAccountId':_[_0x3998('0xa9')](_0x41ee09['params']['id'])?undefined:_0x41ee09[_0x3998('0x56')]['id'],'path':_['isNil'](_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0][_0x3998('0x6')])?undefined:_0x41ee09['body']['attachments'][0x0][_0x3998('0x6')],'fax':_[_0x3998('0xa9')](_0x41ee09['body']['to'][0x0])?undefined:_0x41ee09['body']['to'][0x0],'AttachmentId':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0]['id']},client9002)['then'](function(_0x4bee07){logger[_0x3998('0x22')]('SendFaxRpc,\x20%s',_0x4bee07);})[_0x3998('0x2b')](function(_0x3e42f3){logger['info'](_0x3998('0xb6'),_0x3e42f3);});return _0x1a4201;})[_0x3998('0x37')](respondWithResult(_0x23c26c,null))[_0x3998('0x2b')](handleError(_0x23c26c,null));};exports['addAgents']=function(_0x4db54d,_0xb9590b,_0x3b082c){return db[_0x3998('0x41')][_0x3998('0x59')]({'where':{'id':_0x4db54d[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0xb9590b,null))[_0x3998('0x37')](function(_0x60ee2e){if(_0x60ee2e){return _0x60ee2e['addAgents'](_0x4db54d['body'][_0x3998('0x6e')],_[_0x3998('0x71')](_0x4db54d[_0x3998('0x61')],[_0x3998('0x6e'),'id'])||{})[_0x3998('0xb2')](function(_0x29983c){for(var _0x303190=0x0;_0x303190<_0x4db54d[_0x3998('0x61')]['ids'][_0x3998('0x4a')];_0x303190+=0x1){socket[_0x3998('0xb7')]('userFaxAccount:save',{'UserId':Number(_0x4db54d[_0x3998('0x61')]['ids'][_0x303190]),'FaxAccountId':Number(_0x4db54d['params']['id'])});}return _0x29983c;});}})[_0x3998('0x37')](respondWithResult(_0xb9590b,null))['catch'](handleError(_0xb9590b,null));};exports[_0x3998('0xb8')]=function(_0x37bdf7,_0x59f3b0,_0x3b0d9a){return db[_0x3998('0x41')]['find']({'where':{'id':_0x37bdf7[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0x59f3b0,null))[_0x3998('0x37')](function(_0x382113){if(_0x382113){return _0x382113[_0x3998('0xb8')](_0x37bdf7[_0x3998('0x44')][_0x3998('0x6e')])[_0x3998('0x37')](function(){if(_['isArray'](_0x37bdf7[_0x3998('0x44')][_0x3998('0x6e')])){for(var _0x450525=0x0;_0x450525<_0x37bdf7[_0x3998('0x44')][_0x3998('0x6e')]['length'];_0x450525+=0x1){socket[_0x3998('0xb7')](_0x3998('0xb9'),{'UserId':Number(_0x37bdf7['query'][_0x3998('0x6e')][_0x450525]),'FaxAccountId':Number(_0x37bdf7[_0x3998('0x56')]['id'])});}}else{socket[_0x3998('0xb7')]('userFaxAccount:remove',{'UserId':Number(_0x37bdf7[_0x3998('0x44')]['ids']),'FaxAccountId':Number(_0x37bdf7[_0x3998('0x56')]['id'])});}});}})[_0x3998('0x37')](respondWithStatusCode(_0x59f3b0,null))[_0x3998('0x2b')](handleError(_0x59f3b0,null));};exports[_0x3998('0xba')]=function(_0x1f15cb,_0x33964a,_0x332c3d){var _0x665ec6={};var _0x4e6b3a={};var _0x480636;var _0x5c664e;return db[_0x3998('0x41')][_0x3998('0x66')]({'where':{'id':_0x1f15cb[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x33964a,null))['then'](function(_0x4bf597){if(_0x4bf597){_0x480636=_0x4bf597;_0x4e6b3a['model']=_[_0x3998('0x45')](db[_0x3998('0x76')][_0x3998('0x67')]);_0x4e6b3a[_0x3998('0x44')]=_['keys'](_0x1f15cb[_0x3998('0x44')]);_0x4e6b3a['filters']=_['intersection'](_0x4e6b3a[_0x3998('0x47')],_0x4e6b3a[_0x3998('0x44')]);_0x665ec6[_0x3998('0x48')]=_[_0x3998('0x46')](_0x4e6b3a[_0x3998('0x47')],qs[_0x3998('0x49')](_0x1f15cb[_0x3998('0x44')][_0x3998('0x49')]));_0x665ec6[_0x3998('0x48')]=_0x665ec6[_0x3998('0x48')][_0x3998('0x4a')]?_0x665ec6[_0x3998('0x48')]:_0x4e6b3a['model'];_0x665ec6[_0x3998('0x73')]=qs[_0x3998('0x4d')](_0x1f15cb['query'][_0x3998('0x4d')]);_0x665ec6[_0x3998('0x4e')]=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x1f15cb[_0x3998('0x44')],_0x4e6b3a['filters']));if(_0x1f15cb[_0x3998('0x44')][_0x3998('0x51')]){_0x665ec6[_0x3998('0x4e')]=_[_0x3998('0x53')](_0x665ec6['where'],{'$or':_[_0x3998('0x40')](_0x665ec6[_0x3998('0x48')],function(_0x46270a){var _0x12d955={};_0x12d955[_0x46270a]={'$like':'%'+_0x1f15cb['query'][_0x3998('0x51')]+'%'};return _0x12d955;})});}_0x665ec6=_[_0x3998('0x53')]({},_0x665ec6,_0x1f15cb[_0x3998('0x58')]);return _0x480636[_0x3998('0xba')](_0x665ec6);}})[_0x3998('0x37')](function(_0x30b642){if(_0x30b642){_0x5c664e=_0x30b642[_0x3998('0x4a')];if(!_0x1f15cb[_0x3998('0x44')][_0x3998('0x4b')](_0x3998('0x4c'))){_0x665ec6[_0x3998('0x30')]=qs[_0x3998('0x30')](_0x1f15cb[_0x3998('0x44')][_0x3998('0x30')]);_0x665ec6[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x1f15cb[_0x3998('0x44')][_0x3998('0x32')]);}return _0x480636[_0x3998('0xba')](_0x665ec6);}})['then'](function(_0x28bcde){if(_0x28bcde){return _0x28bcde?{'count':_0x5c664e,'rows':_0x28bcde}:null;}})[_0x3998('0x37')](respondWithResult(_0x33964a,null))[_0x3998('0x2b')](handleError(_0x33964a,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index b226cc4..76ede3d 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 _0x68cc=['update','remove','emit','hasOwnProperty','hook','events','FaxAccount','setMaxListeners','save'];(function(_0x5bd97e,_0x398726){var _0x4d903c=function(_0x1ec896){while(--_0x1ec896){_0x5bd97e['push'](_0x5bd97e['shift']());}};_0x4d903c(++_0x398726);}(_0x68cc,0xd4));var _0xc68c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x68cc[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0xc68c('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xc68c('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc68c('0x2')](0x0);var events={'afterCreate':_0xc68c('0x3'),'afterUpdate':_0xc68c('0x4'),'afterDestroy':_0xc68c('0x5')};function emitEvent(_0x3c4119){return function(_0x337a40,_0x5f301b,_0x503e31){FaxAccountEvents[_0xc68c('0x6')](_0x3c4119+':'+_0x337a40['id'],_0x337a40);FaxAccountEvents[_0xc68c('0x6')](_0x3c4119,_0x337a40);_0x503e31(null);};}for(var e in events){if(events[_0xc68c('0x7')](e)){var event=events[e];FaxAccount[_0xc68c('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xe16a=['emit','hook','events','../../mysqldb','FaxAccount','save','update','remove'];(function(_0x452985,_0x1ca4af){var _0x115294=function(_0x38a74d){while(--_0x38a74d){_0x452985['push'](_0x452985['shift']());}};_0x115294(++_0x1ca4af);}(_0xe16a,0x122));var _0xae16=function(_0x45e039,_0x13c2da){_0x45e039=_0x45e039-0x0;var _0x490903=_0xe16a[_0x45e039];return _0x490903;};'use strict';var EventEmitter=require(_0xae16('0x0'));var FaxAccount=require(_0xae16('0x1'))['db'][_0xae16('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae16('0x3'),'afterUpdate':_0xae16('0x4'),'afterDestroy':_0xae16('0x5')};function emitEvent(_0x21a9c1){return function(_0x2cc3fa,_0x4c4707,_0x3cf20e){FaxAccountEvents[_0xae16('0x6')](_0x21a9c1+':'+_0x2cc3fa['id'],_0x2cc3fa);FaxAccountEvents[_0xae16('0x6')](_0x21a9c1,_0x2cc3fa);_0x3cf20e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xae16('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 8bc68e6..bea83f2 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 _0x7e27=['FaxAccount','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','define'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7e27,0xdd));var _0x77e2=function(_0x5ba856,_0xb3e315){_0x5ba856=_0x5ba856-0x0;var _0x41fc2c=_0x7e27[_0x5ba856];return _0x41fc2c;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var logger=require('../../config/logger')(_0x77e2('0x2'));var moment=require(_0x77e2('0x3'));var BPromise=require(_0x77e2('0x4'));var rp=require(_0x77e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77e2('0x6'));var config=require(_0x77e2('0x7'));var attributes=require(_0x77e2('0x8'));module['exports']=function(_0x3a312a,_0x57562e){return _0x3a312a[_0x77e2('0x9')](_0x77e2('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3792=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','FaxAccount','fax_accounts'];(function(_0x2da803,_0x10fbe1){var _0x4d20f4=function(_0xaad48d){while(--_0xaad48d){_0x2da803['push'](_0x2da803['shift']());}};_0x4d20f4(++_0x10fbe1);}(_0x3792,0x1d4));var _0x2379=function(_0x383b70,_0x4b0e90){_0x383b70=_0x383b70-0x0;var _0x354f5b=_0x3792[_0x383b70];return _0x354f5b;};'use strict';var _=require(_0x2379('0x0'));var util=require(_0x2379('0x1'));var logger=require(_0x2379('0x2'))('api');var moment=require(_0x2379('0x3'));var BPromise=require(_0x2379('0x4'));var rp=require(_0x2379('0x5'));var fs=require('fs');var path=require(_0x2379('0x6'));var rimraf=require(_0x2379('0x7'));var config=require(_0x2379('0x8'));var attributes=require(_0x2379('0x9'));module['exports']=function(_0x20e573,_0x3204ea){return _0x20e573['define'](_0x2379('0xa'),attributes,{'tableName':_0x2379('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index ca1b72e..54aa004 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 _0x8c82=['describe','Sequelize','no\x20available\x20attributes','keys','createdAt','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','updatedAt','DESC','FaxApplication','Applications','get','applications','orderBy','asc','length','Contacts','ListId','create','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','debug','stringify','body','fax','CmContact'];(function(_0x3cdfd2,_0x42c73a){var _0x5cba81=function(_0x59fbe7){while(--_0x59fbe7){_0x3cdfd2['push'](_0x3cdfd2['shift']());}};_0x5cba81(++_0x42c73a);}(_0x8c82,0x1ec));var _0x28c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c82[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x28c8('0x0'));var util=require(_0x28c8('0x1'));var moment=require('moment');var BPromise=require(_0x28c8('0x2'));var rs=require(_0x28c8('0x3'));var fs=require('fs');var Redis=require(_0x28c8('0x4'));var db=require(_0x28c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x28c8('0x6'));var config=require(_0x28c8('0x7'));var jayson=require(_0x28c8('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0x28c8('0x9')]=_[_0x28c8('0xa')](config[_0x28c8('0x9')],{'host':_0x28c8('0xb'),'port':0x18eb});var socket=require(_0x28c8('0xc'))(new Redis(config['redis']));require(_0x28c8('0xd'))[_0x28c8('0xe')](socket);function respondWithRpcPromise(_0x2b5fa9,_0x39d771,_0x2905f8){return new BPromise(function(_0x55428e,_0x29c4f3){return client[_0x28c8('0xf')](_0x2b5fa9,_0x2905f8)[_0x28c8('0x10')](function(_0x3f1149){logger[_0x28c8('0x11')](_0x28c8('0x12'),_0x39d771,'request\x20sent');logger['debug'](_0x28c8('0x13'),_0x39d771,'request\x20sent',JSON['stringify'](_0x3f1149));if(_0x3f1149[_0x28c8('0x14')]){if(_0x3f1149[_0x28c8('0x14')][_0x28c8('0x15')]===0x1f4){logger[_0x28c8('0x14')](_0x28c8('0x12'),_0x39d771,_0x3f1149[_0x28c8('0x14')][_0x28c8('0x16')]);return _0x29c4f3(_0x3f1149['error']['message']);}logger[_0x28c8('0x14')](_0x28c8('0x12'),_0x39d771,_0x3f1149[_0x28c8('0x14')]['message']);return _0x55428e(_0x3f1149[_0x28c8('0x14')][_0x28c8('0x16')]);}else{logger[_0x28c8('0x11')](_0x28c8('0x12'),_0x39d771,_0x28c8('0x17'));_0x55428e(_0x3f1149[_0x28c8('0x18')][_0x28c8('0x16')]);}})[_0x28c8('0x19')](function(_0x129ef9){logger[_0x28c8('0x14')](_0x28c8('0x12'),_0x39d771,_0x129ef9);_0x29c4f3(_0x129ef9);});});}exports['GetFaxAccount']=function(_0x269a25){var _0x51a0bf=this;return new Promise(function(_0x4f6cb0,_0x11d0a2){return db[_0x28c8('0x1a')][_0x28c8('0x1b')]({'raw':_0x269a25['options']?_0x269a25[_0x28c8('0x1c')][_0x28c8('0x1d')]===undefined?!![]:![]:!![],'where':_0x269a25[_0x28c8('0x1c')]?_0x269a25[_0x28c8('0x1c')][_0x28c8('0x1e')]||null:null,'attributes':_0x269a25[_0x28c8('0x1c')]?_0x269a25[_0x28c8('0x1c')][_0x28c8('0x1f')]||null:null,'limit':_0x269a25['options']?_0x269a25[_0x28c8('0x1c')][_0x28c8('0x20')]||null:null,'include':_0x269a25['options']?_0x269a25[_0x28c8('0x1c')][_0x28c8('0x21')]?_[_0x28c8('0x22')](_0x269a25[_0x28c8('0x1c')]['include'],function(_0x27b80f){return{'model':db[_0x27b80f['model']],'as':_0x27b80f['as'],'attributes':_0x27b80f[_0x28c8('0x1f')],'include':_0x27b80f[_0x28c8('0x21')]?_[_0x28c8('0x22')](_0x27b80f['include'],function(_0x50b04b){return{'model':db[_0x50b04b[_0x28c8('0x23')]],'as':_0x50b04b['as'],'attributes':_0x50b04b[_0x28c8('0x1f')],'include':_0x50b04b[_0x28c8('0x21')]?_['map'](_0x50b04b[_0x28c8('0x21')],function(_0x74ce83){return{'model':db[_0x74ce83[_0x28c8('0x23')]],'as':_0x74ce83['as'],'attributes':_0x74ce83[_0x28c8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5173eb){logger['info'](_0x28c8('0x24'),_0x269a25);logger[_0x28c8('0x25')](_0x28c8('0x24'),_0x269a25,JSON[_0x28c8('0x26')](_0x5173eb));_0x4f6cb0(_0x5173eb);})[_0x28c8('0x19')](function(_0x36e83e){logger[_0x28c8('0x14')](_0x28c8('0x24'),_0x36e83e['message'],_0x269a25);_0x11d0a2(_0x51a0bf['error'](0x1f4,_0x36e83e[_0x28c8('0x16')]));});});};exports['NotifyFaxAccount']=function(_0x591214,_0xc8d45e,_0x4e0c7b){var _0x2350cf=this;return new Promise(function(_0x1f196b,_0x1e525b){var _0x157a1e={'body':_0x591214[_0x28c8('0x27')],'channel':_0x28c8('0x28')};var _0x41ecec=[];var _0x4a20f4=[];var _0x1f207a={};return db[_0x28c8('0x29')][_0x28c8('0x2a')]()[_0x28c8('0x10')](function(_0x477432){if(!_0x477432){throw new db[(_0x28c8('0x2b'))]['ValidationError'](_0x28c8('0x2c'));}_0x41ecec=_['difference'](_[_0x28c8('0x2d')](_0x477432),['createdAt','updatedAt']);_0x4a20f4=_['difference'](_[_0x28c8('0x2d')](_0x477432),[_0x28c8('0x2e'),'updatedAt','CompanyId','ListId']);if(_0x591214['body']['id']){delete _0x591214[_0x28c8('0x27')]['id'];}if(_[_0x28c8('0x2f')](_0x591214['body']['from'])){throw new db[(_0x28c8('0x2b'))][(_0x28c8('0x30'))](_0x28c8('0x31'));}if(_[_0x28c8('0x2f')](_0x591214[_0x28c8('0x27')][_0x28c8('0x27')])||_0x591214[_0x28c8('0x27')][_0x28c8('0x27')]===''){throw new db[(_0x28c8('0x2b'))][(_0x28c8('0x30'))](_0x28c8('0x32'));}if(_[_0x28c8('0x2f')](_0x591214[_0x28c8('0x27')][_0x28c8('0x33')])){throw new db['Sequelize'][(_0x28c8('0x30'))](_0x28c8('0x34')+_0x4a20f4);}if(!_[_0x28c8('0x35')](_0x4a20f4,_0x591214[_0x28c8('0x27')][_0x28c8('0x33')])){throw new db[(_0x28c8('0x2b'))][(_0x28c8('0x30'))](_0x28c8('0x36')+_0x4a20f4);}_0x1f207a[_0x591214[_0x28c8('0x27')][_0x28c8('0x33')]]=_0x591214[_0x28c8('0x27')][_0x28c8('0x37')];})[_0x28c8('0x10')](function(){return db[_0x28c8('0x1a')][_0x28c8('0x38')]({'where':{'id':_0x591214[_0x28c8('0x39')]['id']},'include':[{'model':db[_0x28c8('0x3a')],'as':_0x28c8('0x3b'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1f207a,'limit':0x1,'order':[[_0x28c8('0x3c'),_0x28c8('0x3d')]]}]},{'model':db[_0x28c8('0x3e')],'as':_0x28c8('0x3f')}]});})[_0x28c8('0x10')](function(_0x2bfb75){if(_0x2bfb75&&_0x2bfb75['List']){var _0x519499=_0x2bfb75[_0x28c8('0x40')]({'plain':!![]});_0x157a1e[_0x28c8('0x39')]=_0x519499;_0x157a1e[_0x28c8('0x41')]=_0x519499[_0x28c8('0x3f')];_0x157a1e['list']=_0x519499[_0x28c8('0x3b')];_0x157a1e['applications']=_[_0x28c8('0x42')](_0x157a1e[_0x28c8('0x41')],['priority'],[_0x28c8('0x43')]);if(_0x157a1e[_0x28c8('0x39')][_0x28c8('0x3f')]){delete _0x157a1e['account'][_0x28c8('0x3f')];}if(_0x157a1e[_0x28c8('0x39')][_0x28c8('0x3b')]&&_0x157a1e[_0x28c8('0x39')][_0x28c8('0x3b')]['Contacts'][_0x28c8('0x44')]){return _0x157a1e[_0x28c8('0x39')]['List'][_0x28c8('0x45')][0x0];}var _0x306d06=_[_0x28c8('0xa')](_0x591214[_0x28c8('0x27')],{'firstName':_0x591214[_0x28c8('0x27')][_0x28c8('0x37')],'ListId':_0x519499[_0x28c8('0x46')]});_0x306d06[_0x591214[_0x28c8('0x27')][_0x28c8('0x33')]]=_0x591214[_0x28c8('0x27')][_0x28c8('0x37')];return db[_0x28c8('0x29')][_0x28c8('0x47')](_0x306d06,{'fields':_0x41ecec,'raw':!![]});}})[_0x28c8('0x10')](function(_0x5cd63c){_0x157a1e['contact']=_0x5cd63c;if(_0x5cd63c){var _0x1b3ef1={'ContactId':_0x5cd63c['id'],'FaxAccountId':_0x591214[_0x28c8('0x39')]['id'],'fax':_0x5cd63c[_0x28c8('0x28')]};return db['FaxInteraction'][_0x28c8('0x38')]({'where':{'ContactId':_0x5cd63c['id'],'closed':![],'FaxAccountId':_0x591214['account']['id']}})[_0x28c8('0x10')](function(_0x28b713){if(_0x28b713){return[_0x28b713,![]];}return db[_0x28c8('0x48')]['create'](_0x1b3ef1)['then'](function(_0x31289b){return[_0x31289b,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x28c8('0x49')](function(_0x2a01a7,_0x2515e1){var _0x8ec6d2=_0x2a01a7[_0x28c8('0x40')]({'plain':!![]});if(_0x2515e1){if(_0x157a1e[_0x28c8('0x39')][_0x28c8('0x4a')]){_0x157a1e[_0x28c8('0x41')][_0x28c8('0x4b')]({'id':0x0,'priority':_0x157a1e[_0x28c8('0x41')]['length']+0x1,'app':_0x28c8('0x4c'),'appdata':_0x28c8('0x4d'),'interval':_0x28c8('0x4e')});}_0x8ec6d2[_0x28c8('0x4f')]=!![];}else{_0x8ec6d2[_0x28c8('0x4f')]=![];}_0x157a1e[_0x28c8('0x50')]=_0x8ec6d2;return db['FaxMessage'][_0x28c8('0x47')]({'body':_0x591214['body']['body'],'FaxAccountId':_0x591214['account']['id'],'FaxInteractionId':_0x2a01a7['id'],'direction':'in','ContactId':_0x2a01a7[_0x28c8('0x51')],'AttachmentId':_0x591214[_0x28c8('0x27')]['AttachmentId']});})[_0x28c8('0x10')](function(_0x4a4161){_0x157a1e[_0x28c8('0x16')]=_0x4a4161;if(_0x157a1e[_0x28c8('0x50')][_0x28c8('0x52')]){return db[_0x28c8('0x53')][_0x28c8('0x38')]({'attributes':['id',_0x28c8('0x54')],'where':{'id':_0x157a1e[_0x28c8('0x50')][_0x28c8('0x52')]}})['then'](function(_0xfe4801){if(_0xfe4801){_0x157a1e[_0x28c8('0x41')][_0x28c8('0x55')]({'id':0x0,'priority':0x0,'app':_0x28c8('0x56'),'appdata':_0xfe4801[_0x28c8('0x54')]+','+(_0x157a1e['account'][_0x28c8('0x57')]||0xa),'interval':_0x28c8('0x4e')});}return respondWithRpcPromise(_0x28c8('0x58'),'startRouting',_0x157a1e);});}return respondWithRpcPromise('Start','startRouting',_0x157a1e);})[_0x28c8('0x10')](function(_0x5ef9d1){_0x1f196b(_0x5ef9d1);})[_0x28c8('0x19')](function(_0x16a847){_0x1e525b(_0x2350cf['error'](0x1f4,_0x16a847[_0x28c8('0x16')]));});});}; \ No newline at end of file +var _0x6b1d=['spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','updatedAt','difference','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','FaxApplication','get','applications','Applications','list','orderBy','priority','asc','length','Contacts','defaults','create','contact','find','FaxInteraction','Contact\x20not\x20found'];(function(_0x15377a,_0x339f29){var _0x5d72e4=function(_0x308272){while(--_0x308272){_0x15377a['push'](_0x15377a['shift']());}};_0x5d72e4(++_0x339f29);}(_0x6b1d,0x192));var _0xd6b1=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0x6b1d[_0x11314c];return _0x12cb4a;};'use strict';var _=require(_0xd6b1('0x0'));var util=require(_0xd6b1('0x1'));var moment=require(_0xd6b1('0x2'));var BPromise=require('bluebird');var rs=require(_0xd6b1('0x3'));var fs=require('fs');var Redis=require(_0xd6b1('0x4'));var db=require(_0xd6b1('0x5'))['db'];var utils=require(_0xd6b1('0x6'));var logger=require(_0xd6b1('0x7'))(_0xd6b1('0x8'));var config=require(_0xd6b1('0x9'));var jayson=require(_0xd6b1('0xa'));var client=jayson[_0xd6b1('0xb')][_0xd6b1('0xc')]({'port':0x232c});config[_0xd6b1('0xd')]=_['defaults'](config[_0xd6b1('0xd')],{'host':_0xd6b1('0xe'),'port':0x18eb});var socket=require(_0xd6b1('0xf'))(new Redis(config[_0xd6b1('0xd')]));require(_0xd6b1('0x10'))[_0xd6b1('0x11')](socket);function respondWithRpcPromise(_0x5c2f71,_0x5e5a60,_0x4981f8){return new BPromise(function(_0x29188a,_0x2a2689){return client[_0xd6b1('0x12')](_0x5c2f71,_0x4981f8)[_0xd6b1('0x13')](function(_0x2beea4){logger[_0xd6b1('0x14')](_0xd6b1('0x15'),_0x5e5a60,_0xd6b1('0x16'));logger[_0xd6b1('0x17')](_0xd6b1('0x18'),_0x5e5a60,'request\x20sent',JSON['stringify'](_0x2beea4));if(_0x2beea4[_0xd6b1('0x19')]){if(_0x2beea4[_0xd6b1('0x19')][_0xd6b1('0x1a')]===0x1f4){logger[_0xd6b1('0x19')](_0xd6b1('0x15'),_0x5e5a60,_0x2beea4['error'][_0xd6b1('0x1b')]);return _0x2a2689(_0x2beea4[_0xd6b1('0x19')][_0xd6b1('0x1b')]);}logger[_0xd6b1('0x19')](_0xd6b1('0x15'),_0x5e5a60,_0x2beea4['error'][_0xd6b1('0x1b')]);return _0x29188a(_0x2beea4[_0xd6b1('0x19')][_0xd6b1('0x1b')]);}else{logger[_0xd6b1('0x14')](_0xd6b1('0x15'),_0x5e5a60,_0xd6b1('0x16'));_0x29188a(_0x2beea4[_0xd6b1('0x1c')][_0xd6b1('0x1b')]);}})[_0xd6b1('0x1d')](function(_0x252434){logger[_0xd6b1('0x19')]('FaxAccount,\x20%s,\x20%s',_0x5e5a60,_0x252434);_0x2a2689(_0x252434);});});}exports[_0xd6b1('0x1e')]=function(_0x5ed649){var _0x913af4=this;return new Promise(function(_0x5455e8,_0x1efbd6){return db[_0xd6b1('0x1f')][_0xd6b1('0x20')]({'raw':_0x5ed649[_0xd6b1('0x21')]?_0x5ed649[_0xd6b1('0x21')][_0xd6b1('0x22')]===undefined?!![]:![]:!![],'where':_0x5ed649[_0xd6b1('0x21')]?_0x5ed649[_0xd6b1('0x21')]['where']||null:null,'attributes':_0x5ed649['options']?_0x5ed649[_0xd6b1('0x21')][_0xd6b1('0x23')]||null:null,'limit':_0x5ed649[_0xd6b1('0x21')]?_0x5ed649[_0xd6b1('0x21')][_0xd6b1('0x24')]||null:null,'include':_0x5ed649[_0xd6b1('0x21')]?_0x5ed649[_0xd6b1('0x21')][_0xd6b1('0x25')]?_[_0xd6b1('0x26')](_0x5ed649[_0xd6b1('0x21')]['include'],function(_0x7d0534){return{'model':db[_0x7d0534['model']],'as':_0x7d0534['as'],'attributes':_0x7d0534[_0xd6b1('0x23')],'include':_0x7d0534[_0xd6b1('0x25')]?_[_0xd6b1('0x26')](_0x7d0534[_0xd6b1('0x25')],function(_0x3fff6c){return{'model':db[_0x3fff6c['model']],'as':_0x3fff6c['as'],'attributes':_0x3fff6c[_0xd6b1('0x23')],'include':_0x3fff6c[_0xd6b1('0x25')]?_[_0xd6b1('0x26')](_0x3fff6c[_0xd6b1('0x25')],function(_0x4fbf30){return{'model':db[_0x4fbf30[_0xd6b1('0x27')]],'as':_0x4fbf30['as'],'attributes':_0x4fbf30[_0xd6b1('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x182688){logger[_0xd6b1('0x14')](_0xd6b1('0x1e'),_0x5ed649);logger['debug'](_0xd6b1('0x1e'),_0x5ed649,JSON[_0xd6b1('0x28')](_0x182688));_0x5455e8(_0x182688);})[_0xd6b1('0x1d')](function(_0x4055e4){logger[_0xd6b1('0x19')](_0xd6b1('0x1e'),_0x4055e4['message'],_0x5ed649);_0x1efbd6(_0x913af4['error'](0x1f4,_0x4055e4['message']));});});};exports[_0xd6b1('0x29')]=function(_0x130bd3,_0x579fe5,_0x400eec){var _0x4e44e9=this;return new Promise(function(_0x349251,_0x1a21f3){var _0x1a2d22={'body':_0x130bd3[_0xd6b1('0x2a')],'channel':_0xd6b1('0x2b')};var _0x234264=[];var _0xe40ae1=[];var _0x4831a8={};return db['CmContact'][_0xd6b1('0x2c')]()[_0xd6b1('0x13')](function(_0x258025){if(!_0x258025){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))]('no\x20available\x20attributes');}_0x234264=_['difference'](_['keys'](_0x258025),['createdAt',_0xd6b1('0x2f')]);_0xe40ae1=_[_0xd6b1('0x30')](_['keys'](_0x258025),[_0xd6b1('0x31'),_0xd6b1('0x2f'),'CompanyId',_0xd6b1('0x32')]);if(_0x130bd3[_0xd6b1('0x2a')]['id']){delete _0x130bd3[_0xd6b1('0x2a')]['id'];}if(_['isNil'](_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x33')])){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))](_0xd6b1('0x34'));}if(_['isNil'](_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x2a')])||_0x130bd3['body'][_0xd6b1('0x2a')]===''){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))](_0xd6b1('0x35'));}if(_[_0xd6b1('0x36')](_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x37')])){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))](_0xd6b1('0x38')+_0xe40ae1);}if(!_['includes'](_0xe40ae1,_0x130bd3[_0xd6b1('0x2a')]['mapKey'])){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))](_0xd6b1('0x39')+_0xe40ae1);}_0x4831a8[_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x37')]]=_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x33')];})['then'](function(){return db[_0xd6b1('0x1f')]['find']({'where':{'id':_0x130bd3[_0xd6b1('0x3a')]['id']},'include':[{'model':db[_0xd6b1('0x3b')],'as':_0xd6b1('0x3c'),'include':[{'model':db[_0xd6b1('0x3d')],'as':'Contacts','where':_0x4831a8,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xd6b1('0x3e')],'as':'Applications'}]});})[_0xd6b1('0x13')](function(_0x4f6d90){if(_0x4f6d90&&_0x4f6d90[_0xd6b1('0x3c')]){var _0x3b2cac=_0x4f6d90[_0xd6b1('0x3f')]({'plain':!![]});_0x1a2d22['account']=_0x3b2cac;_0x1a2d22[_0xd6b1('0x40')]=_0x3b2cac[_0xd6b1('0x41')];_0x1a2d22[_0xd6b1('0x42')]=_0x3b2cac['List'];_0x1a2d22['applications']=_[_0xd6b1('0x43')](_0x1a2d22[_0xd6b1('0x40')],[_0xd6b1('0x44')],[_0xd6b1('0x45')]);if(_0x1a2d22[_0xd6b1('0x3a')][_0xd6b1('0x41')]){delete _0x1a2d22[_0xd6b1('0x3a')]['Applications'];}if(_0x1a2d22[_0xd6b1('0x3a')][_0xd6b1('0x3c')]&&_0x1a2d22[_0xd6b1('0x3a')]['List']['Contacts'][_0xd6b1('0x46')]){return _0x1a2d22[_0xd6b1('0x3a')][_0xd6b1('0x3c')][_0xd6b1('0x47')][0x0];}var _0xcf8f40=_[_0xd6b1('0x48')](_0x130bd3[_0xd6b1('0x2a')],{'firstName':_0x130bd3['body'][_0xd6b1('0x33')],'ListId':_0x3b2cac['ListId']});_0xcf8f40[_0x130bd3['body']['mapKey']]=_0x130bd3['body'][_0xd6b1('0x33')];return db[_0xd6b1('0x3d')][_0xd6b1('0x49')](_0xcf8f40,{'fields':_0x234264,'raw':!![]});}})[_0xd6b1('0x13')](function(_0x23bf32){_0x1a2d22[_0xd6b1('0x4a')]=_0x23bf32;if(_0x23bf32){var _0x23a440={'ContactId':_0x23bf32['id'],'FaxAccountId':_0x130bd3[_0xd6b1('0x3a')]['id'],'fax':_0x23bf32['fax']};return db['FaxInteraction'][_0xd6b1('0x4b')]({'where':{'ContactId':_0x23bf32['id'],'closed':![],'FaxAccountId':_0x130bd3[_0xd6b1('0x3a')]['id']}})[_0xd6b1('0x13')](function(_0x2cb68b){if(_0x2cb68b){return[_0x2cb68b,![]];}return db[_0xd6b1('0x4c')]['create'](_0x23a440)[_0xd6b1('0x13')](function(_0x4f1366){return[_0x4f1366,!![]];});});}else{throw new Error(_0xd6b1('0x4d'));}})[_0xd6b1('0x4e')](function(_0x1a3e98,_0x10382c){var _0x3c6c3f=_0x1a3e98[_0xd6b1('0x3f')]({'plain':!![]});if(_0x10382c){if(_0x1a2d22['account'][_0xd6b1('0x4f')]){_0x1a2d22['applications']['push']({'id':0x0,'priority':_0x1a2d22['applications'][_0xd6b1('0x46')]+0x1,'app':_0xd6b1('0x50'),'appdata':_0xd6b1('0x51'),'interval':_0xd6b1('0x52')});}_0x3c6c3f['created']=!![];}else{_0x3c6c3f[_0xd6b1('0x53')]=![];}_0x1a2d22[_0xd6b1('0x54')]=_0x3c6c3f;return db[_0xd6b1('0x55')][_0xd6b1('0x49')]({'body':_0x130bd3['body']['body'],'FaxAccountId':_0x130bd3[_0xd6b1('0x3a')]['id'],'FaxInteractionId':_0x1a3e98['id'],'direction':'in','ContactId':_0x1a3e98[_0xd6b1('0x56')],'AttachmentId':_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x57')]});})['then'](function(_0x1ca26a){_0x1a2d22[_0xd6b1('0x1b')]=_0x1ca26a;if(_0x1a2d22['interaction'][_0xd6b1('0x58')]){return db[_0xd6b1('0x59')]['find']({'attributes':['id','name'],'where':{'id':_0x1a2d22['interaction']['UserId']}})[_0xd6b1('0x13')](function(_0x3892e3){if(_0x3892e3){_0x1a2d22[_0xd6b1('0x40')][_0xd6b1('0x5a')]({'id':0x0,'priority':0x0,'app':_0xd6b1('0x5b'),'appdata':_0x3892e3[_0xd6b1('0x5c')]+','+(_0x1a2d22['account'][_0xd6b1('0x5d')]||0xa),'interval':_0xd6b1('0x52')});}return respondWithRpcPromise(_0xd6b1('0x5e'),'startRouting',_0x1a2d22);});}return respondWithRpcPromise(_0xd6b1('0x5e'),_0xd6b1('0x5f'),_0x1a2d22);})[_0xd6b1('0x13')](function(_0x444a2b){_0x349251(_0x444a2b);})[_0xd6b1('0x1d')](function(_0x261d7b){_0x1a21f3(_0x4e44e9[_0xd6b1('0x19')](0x1f4,_0x261d7b[_0xd6b1('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 09f70da..0f283da 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 _0xae26=['update','removeListener','faxAccount:','./faxAccount.events'];(function(_0x14c3d0,_0x489f24){var _0x4d0531=function(_0x5d68d4){while(--_0x5d68d4){_0x14c3d0['push'](_0x14c3d0['shift']());}};_0x4d0531(++_0x489f24);}(_0xae26,0x1cb));var _0x6ae2=function(_0x467b5d,_0x22ca71){_0x467b5d=_0x467b5d-0x0;var _0x3a64da=_0xae26[_0x467b5d];return _0x3a64da;};'use strict';var FaxAccountEvents=require(_0x6ae2('0x0'));var events=['save','remove',_0x6ae2('0x1')];function createListener(_0xfba9f0,_0x5b4bae){return function(_0x431ad4){_0x5b4bae['emit'](_0xfba9f0,_0x431ad4);};}function removeListener(_0x5ab3df,_0x49f3e7){return function(){FaxAccountEvents[_0x6ae2('0x2')](_0x5ab3df,_0x49f3e7);};}exports['register']=function(_0xae1b7b){for(var _0x42d125=0x0,_0x39b1f3=events['length'];_0x42d125<_0x39b1f3;_0x42d125++){var _0x5abfc8=events[_0x42d125];var _0x588df8=createListener(_0x6ae2('0x3')+_0x5abfc8,_0xae1b7b);FaxAccountEvents['on'](_0x5abfc8,_0x588df8);}}; \ No newline at end of file +var _0x2cc6=['remove','update','emit','register','length','faxAccount:','save'];(function(_0x2a4da6,_0x5e7f66){var _0x21f384=function(_0x1d2b45){while(--_0x1d2b45){_0x2a4da6['push'](_0x2a4da6['shift']());}};_0x21f384(++_0x5e7f66);}(_0x2cc6,0xca));var _0x62cc=function(_0x426267,_0x422e6e){_0x426267=_0x426267-0x0;var _0x59e163=_0x2cc6[_0x426267];return _0x59e163;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x62cc('0x0'),_0x62cc('0x1'),_0x62cc('0x2')];function createListener(_0x2fae0d,_0x29fb76){return function(_0x45e1ac){_0x29fb76[_0x62cc('0x3')](_0x2fae0d,_0x45e1ac);};}function removeListener(_0x40de80,_0x744ed6){return function(){FaxAccountEvents['removeListener'](_0x40de80,_0x744ed6);};}exports[_0x62cc('0x4')]=function(_0x9076fb){for(var _0x1ec607=0x0,_0x199ea2=events[_0x62cc('0x5')];_0x1ec607<_0x199ea2;_0x1ec607++){var _0x336d81=events[_0x1ec607];var _0x3fde6c=createListener(_0x62cc('0x6')+_0x336d81,_0x9076fb);FaxAccountEvents['on'](_0x336d81,_0x3fde6c);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d0b7550..e2fbc2b 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(_0x2a381f,_0x5ac78b){var _0xbb80ac=function(_0x5aa22f){while(--_0x5aa22f){_0x2a381f['push'](_0x2a381f['shift']());}};_0xbb80ac(++_0x5ac78b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x196bbf,_0x3a0d24){var _0x155966=function(_0x37323f){while(--_0x37323f){_0x196bbf['push'](_0x196bbf['shift']());}};_0x155966(++_0x3a0d24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 6fe7b74..36021e2 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 _0xe250=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x444f07,_0x45fd3e){var _0x43b9fb=function(_0x502fe7){while(--_0x502fe7){_0x444f07['push'](_0x444f07['shift']());}};_0x43b9fb(++_0x45fd3e);}(_0xe250,0xb2));var _0x0e25=function(_0x57574c,_0x477d51){_0x57574c=_0x57574c-0x0;var _0x47aa97=_0xe250[_0x57574c];return _0x47aa97;};'use strict';var Sequelize=require(_0x0e25('0x0'));module[_0x0e25('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0e25('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0e25('0x3')]()},'description':{'type':Sequelize[_0x0e25('0x2')]},'interval':{'type':Sequelize[_0x0e25('0x2')],'defaultValue':_0x0e25('0x4')}}; \ No newline at end of file +var _0xfffa=['TEXT','STRING','INTEGER','noop'];(function(_0x3e2952,_0x546a1b){var _0x1641c6=function(_0x412c55){while(--_0x412c55){_0x3e2952['push'](_0x3e2952['shift']());}};_0x1641c6(++_0x546a1b);}(_0xfffa,0x15e));var _0xafff=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfffa[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xafff('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xafff('0x1')},'appdata':{'type':Sequelize[_0xafff('0x2')]()},'description':{'type':Sequelize[_0xafff('0x3')]},'interval':{'type':Sequelize[_0xafff('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 646dbe9..04c9c29 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 _0xbf26=['hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','then','catch','show','params','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','error','name','send','index','map','FaxApplication','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length'];(function(_0x50a427,_0xae4f94){var _0x2eccee=function(_0x56165e){while(--_0x56165e){_0x50a427['push'](_0x50a427['shift']());}};_0x2eccee(++_0xae4f94);}(_0xbf26,0x13d));var _0x6bf2=function(_0x983fd3,_0x3d30a8){_0x983fd3=_0x983fd3-0x0;var _0x39012f=_0xbf26[_0x983fd3];return _0x39012f;};'use strict';var emlformat=require(_0x6bf2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bf2('0x1'));var jsonpatch=require(_0x6bf2('0x2'));var rp=require(_0x6bf2('0x3'));var moment=require(_0x6bf2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6bf2('0x5'));var util=require(_0x6bf2('0x6'));var path=require(_0x6bf2('0x7'));var sox=require(_0x6bf2('0x8'));var csv=require(_0x6bf2('0x9'));var ejs=require(_0x6bf2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6bf2('0xb'));var squel=require(_0x6bf2('0xc'));var crypto=require(_0x6bf2('0xd'));var jsforce=require(_0x6bf2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6bf2('0xf'));var Papa=require('papaparse');var Redis=require(_0x6bf2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6bf2('0x11'));var as=require(_0x6bf2('0x12'));var hardwareService=require(_0x6bf2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6bf2('0x14'));var config=require(_0x6bf2('0x15'));var licenseUtil=require(_0x6bf2('0x16'));var db=require(_0x6bf2('0x17'))['db'];function respondWithStatusCode(_0xb40c20,_0x3bfd7c){_0x3bfd7c=_0x3bfd7c||0xcc;return function(_0x232008){if(_0x232008){return _0xb40c20['sendStatus'](_0x3bfd7c);}return _0xb40c20[_0x6bf2('0x18')](_0x3bfd7c)[_0x6bf2('0x19')]();};}function respondWithResult(_0x40cc23,_0x2d2dec){_0x2d2dec=_0x2d2dec||0xc8;return function(_0x17006e){if(_0x17006e){return _0x40cc23[_0x6bf2('0x18')](_0x2d2dec)[_0x6bf2('0x1a')](_0x17006e);}};}function respondWithFilteredResult(_0x20781c,_0x1bb4b9){return function(_0x999f51){if(_0x999f51){var _0x489d19=typeof _0x1bb4b9[_0x6bf2('0x1b')]==='undefined'&&typeof _0x1bb4b9[_0x6bf2('0x1c')]===_0x6bf2('0x1d');var _0x449c1=_0x999f51[_0x6bf2('0x1e')];var _0x15e723=_0x489d19?0x0:_0x1bb4b9[_0x6bf2('0x1b')];var _0x55209a=_0x489d19?_0x999f51[_0x6bf2('0x1e')]:_0x1bb4b9[_0x6bf2('0x1b')]+_0x1bb4b9['limit'];var _0x23ddbd;if(_0x55209a>=_0x449c1){_0x55209a=_0x449c1;_0x23ddbd=0xc8;}else{_0x23ddbd=0xce;}_0x20781c[_0x6bf2('0x18')](_0x23ddbd);return _0x20781c[_0x6bf2('0x1f')](_0x6bf2('0x20'),_0x15e723+'-'+_0x55209a+'/'+_0x449c1)['json'](_0x999f51);}return null;};}function patchUpdates(_0x310077){return function(_0xfc1384){try{jsonpatch[_0x6bf2('0x21')](_0xfc1384,_0x310077,!![]);}catch(_0x560311){return BPromise['reject'](_0x560311);}return _0xfc1384['save']();};}function saveUpdates(_0x11e069,_0x3f0115){return function(_0x1b7e3d){if(_0x1b7e3d){return _0x1b7e3d[_0x6bf2('0x22')](_0x11e069)['then'](function(_0x34f17a){return _0x34f17a;});}return null;};}function removeEntity(_0x12a858,_0x14b116){return function(_0x2ca4c1){if(_0x2ca4c1){return _0x2ca4c1[_0x6bf2('0x23')]()['then'](function(){_0x12a858[_0x6bf2('0x18')](0xcc)[_0x6bf2('0x19')]();});}};}function handleEntityNotFound(_0x380441,_0x52ad9e){return function(_0x55b584){if(!_0x55b584){_0x380441['sendStatus'](0x194);}return _0x55b584;};}function handleError(_0x4df72a,_0x265868){_0x265868=_0x265868||0x1f4;return function(_0x408270){logger[_0x6bf2('0x24')](_0x408270['stack']);if(_0x408270['name']){delete _0x408270[_0x6bf2('0x25')];}_0x4df72a['status'](_0x265868)[_0x6bf2('0x26')](_0x408270);};}exports[_0x6bf2('0x27')]=function(_0x4010fc,_0x53c293){var _0x2fe0bc={},_0xe1e8bb={},_0x38bbae={'count':0x0,'rows':[]};var _0x5a6581=_[_0x6bf2('0x28')](db[_0x6bf2('0x29')][_0x6bf2('0x2a')],function(_0x265553){return{'name':_0x265553['fieldName'],'type':_0x265553[_0x6bf2('0x2b')][_0x6bf2('0x2c')]};});_0xe1e8bb[_0x6bf2('0x2d')]=_[_0x6bf2('0x28')](_0x5a6581,_0x6bf2('0x25'));_0xe1e8bb['query']=_[_0x6bf2('0x2e')](_0x4010fc[_0x6bf2('0x2f')]);_0xe1e8bb[_0x6bf2('0x30')]=_[_0x6bf2('0x31')](_0xe1e8bb[_0x6bf2('0x2d')],_0xe1e8bb[_0x6bf2('0x2f')]);_0x2fe0bc['attributes']=_['intersection'](_0xe1e8bb['model'],qs[_0x6bf2('0x32')](_0x4010fc['query'][_0x6bf2('0x32')]));_0x2fe0bc[_0x6bf2('0x33')]=_0x2fe0bc['attributes'][_0x6bf2('0x34')]?_0x2fe0bc['attributes']:_0xe1e8bb['model'];if(!_0x4010fc[_0x6bf2('0x2f')][_0x6bf2('0x35')](_0x6bf2('0x36'))){_0x2fe0bc[_0x6bf2('0x1c')]=qs[_0x6bf2('0x1c')](_0x4010fc[_0x6bf2('0x2f')][_0x6bf2('0x1c')]);_0x2fe0bc[_0x6bf2('0x1b')]=qs[_0x6bf2('0x1b')](_0x4010fc[_0x6bf2('0x2f')][_0x6bf2('0x1b')]);}_0x2fe0bc[_0x6bf2('0x37')]=qs[_0x6bf2('0x38')](_0x4010fc[_0x6bf2('0x2f')][_0x6bf2('0x38')]);_0x2fe0bc[_0x6bf2('0x39')]=qs['filters'](_[_0x6bf2('0x3a')](_0x4010fc['query'],_0xe1e8bb[_0x6bf2('0x30')]),_0x5a6581);if(_0x4010fc['query'][_0x6bf2('0x3b')]){_0x2fe0bc[_0x6bf2('0x39')]=_['merge'](_0x2fe0bc['where'],{'$or':_[_0x6bf2('0x28')](_0x5a6581,function(_0x3edd09){if(_0x3edd09['type']!==_0x6bf2('0x3c')){var _0x46f4fb={};_0x46f4fb[_0x3edd09['name']]={'$like':'%'+_0x4010fc['query']['filter']+'%'};return _0x46f4fb;}})});}_0x2fe0bc=_[_0x6bf2('0x3d')]({},_0x2fe0bc,_0x4010fc['options']);var _0x6f7d3a={'where':_0x2fe0bc[_0x6bf2('0x39')]};return db[_0x6bf2('0x29')]['count'](_0x6f7d3a)['then'](function(_0x45b229){_0x38bbae[_0x6bf2('0x1e')]=_0x45b229;if(_0x4010fc[_0x6bf2('0x2f')][_0x6bf2('0x3e')]){_0x2fe0bc[_0x6bf2('0x3f')]=[{'all':!![]}];}return db[_0x6bf2('0x29')][_0x6bf2('0x40')](_0x2fe0bc);})['then'](function(_0x2df708){_0x38bbae[_0x6bf2('0x41')]=_0x2df708;return _0x38bbae;})[_0x6bf2('0x42')](respondWithFilteredResult(_0x53c293,_0x2fe0bc))[_0x6bf2('0x43')](handleError(_0x53c293,null));};exports[_0x6bf2('0x44')]=function(_0x5f2a84,_0x44ed81){var _0x14adcd={'raw':!![],'where':{'id':_0x5f2a84[_0x6bf2('0x45')]['id']}},_0x3956ec={};_0x3956ec[_0x6bf2('0x2d')]=_[_0x6bf2('0x2e')](db[_0x6bf2('0x29')]['rawAttributes']);_0x3956ec[_0x6bf2('0x2f')]=_[_0x6bf2('0x2e')](_0x5f2a84[_0x6bf2('0x2f')]);_0x3956ec[_0x6bf2('0x30')]=_['intersection'](_0x3956ec[_0x6bf2('0x2d')],_0x3956ec[_0x6bf2('0x2f')]);_0x14adcd[_0x6bf2('0x33')]=_[_0x6bf2('0x31')](_0x3956ec[_0x6bf2('0x2d')],qs[_0x6bf2('0x32')](_0x5f2a84[_0x6bf2('0x2f')][_0x6bf2('0x32')]));_0x14adcd[_0x6bf2('0x33')]=_0x14adcd[_0x6bf2('0x33')][_0x6bf2('0x34')]?_0x14adcd[_0x6bf2('0x33')]:_0x3956ec['model'];if(_0x5f2a84['query'][_0x6bf2('0x3e')]){_0x14adcd['include']=[{'all':!![]}];}_0x14adcd=_[_0x6bf2('0x3d')]({},_0x14adcd,_0x5f2a84[_0x6bf2('0x46')]);return db[_0x6bf2('0x29')][_0x6bf2('0x47')](_0x14adcd)[_0x6bf2('0x42')](handleEntityNotFound(_0x44ed81,null))['then'](respondWithResult(_0x44ed81,null))[_0x6bf2('0x43')](handleError(_0x44ed81,null));};exports[_0x6bf2('0x48')]=function(_0x1678a5,_0xa4bc2e){return db[_0x6bf2('0x29')][_0x6bf2('0x48')](_0x1678a5[_0x6bf2('0x49')],{})[_0x6bf2('0x42')](respondWithResult(_0xa4bc2e,0xc9))[_0x6bf2('0x43')](handleError(_0xa4bc2e,null));};exports[_0x6bf2('0x22')]=function(_0x2d64ff,_0x2e5b91){if(_0x2d64ff[_0x6bf2('0x49')]['id']){delete _0x2d64ff[_0x6bf2('0x49')]['id'];}return db[_0x6bf2('0x29')][_0x6bf2('0x47')]({'where':{'id':_0x2d64ff['params']['id']}})[_0x6bf2('0x42')](handleEntityNotFound(_0x2e5b91,null))[_0x6bf2('0x42')](saveUpdates(_0x2d64ff['body'],null))[_0x6bf2('0x42')](respondWithResult(_0x2e5b91,null))['catch'](handleError(_0x2e5b91,null));};exports['destroy']=function(_0x18563f,_0x52ca92){return db[_0x6bf2('0x29')][_0x6bf2('0x47')]({'where':{'id':_0x18563f[_0x6bf2('0x45')]['id']}})[_0x6bf2('0x42')](handleEntityNotFound(_0x52ca92,null))[_0x6bf2('0x42')](removeEntity(_0x52ca92,null))[_0x6bf2('0x43')](handleError(_0x52ca92,null));}; \ No newline at end of file +var _0x0a7c=['filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','includeAll','include','rows','catch','show','params','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0a7c,0xa8));var _0xc0a7=function(_0x11dde4,_0x1d4852){_0x11dde4=_0x11dde4-0x0;var _0x6eea94=_0x0a7c[_0x11dde4];return _0x6eea94;};'use strict';var emlformat=require(_0xc0a7('0x0'));var rimraf=require(_0xc0a7('0x1'));var zipdir=require(_0xc0a7('0x2'));var jsonpatch=require(_0xc0a7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc0a7('0x4'));var util=require(_0xc0a7('0x5'));var path=require(_0xc0a7('0x6'));var sox=require(_0xc0a7('0x7'));var csv=require(_0xc0a7('0x8'));var ejs=require(_0xc0a7('0x9'));var fs=require('fs');var fs_extra=require(_0xc0a7('0xa'));var _=require('lodash');var squel=require(_0xc0a7('0xb'));var crypto=require(_0xc0a7('0xc'));var jsforce=require(_0xc0a7('0xd'));var deskjs=require(_0xc0a7('0xe'));var toCsv=require(_0xc0a7('0x8'));var querystring=require(_0xc0a7('0xf'));var Papa=require(_0xc0a7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc0a7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0a7('0x12'));var logger=require(_0xc0a7('0x13'))(_0xc0a7('0x14'));var utils=require(_0xc0a7('0x15'));var config=require(_0xc0a7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0a7('0x17'))['db'];function respondWithStatusCode(_0x33831a,_0x1a6be5){_0x1a6be5=_0x1a6be5||0xcc;return function(_0x3a3935){if(_0x3a3935){return _0x33831a[_0xc0a7('0x18')](_0x1a6be5);}return _0x33831a[_0xc0a7('0x19')](_0x1a6be5)[_0xc0a7('0x1a')]();};}function respondWithResult(_0xb139bc,_0x2d5ea3){_0x2d5ea3=_0x2d5ea3||0xc8;return function(_0x3e0453){if(_0x3e0453){return _0xb139bc['status'](_0x2d5ea3)['json'](_0x3e0453);}};}function respondWithFilteredResult(_0x3d5c47,_0x2f9c61){return function(_0x46686c){if(_0x46686c){var _0x5d4015=typeof _0x2f9c61[_0xc0a7('0x1b')]===_0xc0a7('0x1c')&&typeof _0x2f9c61[_0xc0a7('0x1d')]===_0xc0a7('0x1c');var _0x560818=_0x46686c['count'];var _0x492df7=_0x5d4015?0x0:_0x2f9c61[_0xc0a7('0x1b')];var _0x4b6999=_0x5d4015?_0x46686c[_0xc0a7('0x1e')]:_0x2f9c61[_0xc0a7('0x1b')]+_0x2f9c61[_0xc0a7('0x1d')];var _0x113e82;if(_0x4b6999>=_0x560818){_0x4b6999=_0x560818;_0x113e82=0xc8;}else{_0x113e82=0xce;}_0x3d5c47[_0xc0a7('0x19')](_0x113e82);return _0x3d5c47[_0xc0a7('0x1f')](_0xc0a7('0x20'),_0x492df7+'-'+_0x4b6999+'/'+_0x560818)['json'](_0x46686c);}return null;};}function patchUpdates(_0x1e5367){return function(_0x1a2416){try{jsonpatch['apply'](_0x1a2416,_0x1e5367,!![]);}catch(_0x24f954){return BPromise[_0xc0a7('0x21')](_0x24f954);}return _0x1a2416[_0xc0a7('0x22')]();};}function saveUpdates(_0x4ecefe,_0x2ad5fb){return function(_0x56acad){if(_0x56acad){return _0x56acad['update'](_0x4ecefe)[_0xc0a7('0x23')](function(_0x326f0c){return _0x326f0c;});}return null;};}function removeEntity(_0x20843c,_0x5ec028){return function(_0x4c2aff){if(_0x4c2aff){return _0x4c2aff[_0xc0a7('0x24')]()[_0xc0a7('0x23')](function(){_0x20843c[_0xc0a7('0x19')](0xcc)[_0xc0a7('0x1a')]();});}};}function handleEntityNotFound(_0x578c81,_0x5a5dae){return function(_0x47f752){if(!_0x47f752){_0x578c81[_0xc0a7('0x18')](0x194);}return _0x47f752;};}function handleError(_0x1658f7,_0x114bff){_0x114bff=_0x114bff||0x1f4;return function(_0x4e4912){logger[_0xc0a7('0x25')](_0x4e4912[_0xc0a7('0x26')]);if(_0x4e4912[_0xc0a7('0x27')]){delete _0x4e4912[_0xc0a7('0x27')];}_0x1658f7['status'](_0x114bff)[_0xc0a7('0x28')](_0x4e4912);};}exports[_0xc0a7('0x29')]=function(_0x1e39c8,_0x2de615){var _0x14b432={},_0x5e82ed={},_0x1b9942={'count':0x0,'rows':[]};var _0x26bab5=_[_0xc0a7('0x2a')](db[_0xc0a7('0x2b')][_0xc0a7('0x2c')],function(_0xcd7db3){return{'name':_0xcd7db3[_0xc0a7('0x2d')],'type':_0xcd7db3[_0xc0a7('0x2e')][_0xc0a7('0x2f')]};});_0x5e82ed[_0xc0a7('0x30')]=_[_0xc0a7('0x2a')](_0x26bab5,_0xc0a7('0x27'));_0x5e82ed['query']=_[_0xc0a7('0x31')](_0x1e39c8[_0xc0a7('0x32')]);_0x5e82ed[_0xc0a7('0x33')]=_['intersection'](_0x5e82ed[_0xc0a7('0x30')],_0x5e82ed['query']);_0x14b432['attributes']=_[_0xc0a7('0x34')](_0x5e82ed[_0xc0a7('0x30')],qs['fields'](_0x1e39c8['query'][_0xc0a7('0x35')]));_0x14b432[_0xc0a7('0x36')]=_0x14b432['attributes'][_0xc0a7('0x37')]?_0x14b432['attributes']:_0x5e82ed['model'];if(!_0x1e39c8[_0xc0a7('0x32')]['hasOwnProperty'](_0xc0a7('0x38'))){_0x14b432[_0xc0a7('0x1d')]=qs[_0xc0a7('0x1d')](_0x1e39c8['query'][_0xc0a7('0x1d')]);_0x14b432[_0xc0a7('0x1b')]=qs[_0xc0a7('0x1b')](_0x1e39c8[_0xc0a7('0x32')][_0xc0a7('0x1b')]);}_0x14b432[_0xc0a7('0x39')]=qs[_0xc0a7('0x3a')](_0x1e39c8[_0xc0a7('0x32')][_0xc0a7('0x3a')]);_0x14b432['where']=qs[_0xc0a7('0x33')](_['pick'](_0x1e39c8[_0xc0a7('0x32')],_0x5e82ed[_0xc0a7('0x33')]),_0x26bab5);if(_0x1e39c8['query'][_0xc0a7('0x3b')]){_0x14b432[_0xc0a7('0x3c')]=_[_0xc0a7('0x3d')](_0x14b432[_0xc0a7('0x3c')],{'$or':_['map'](_0x26bab5,function(_0x5bb1c4){if(_0x5bb1c4[_0xc0a7('0x2e')]!=='VIRTUAL'){var _0x33123b={};_0x33123b[_0x5bb1c4[_0xc0a7('0x27')]]={'$like':'%'+_0x1e39c8[_0xc0a7('0x32')][_0xc0a7('0x3b')]+'%'};return _0x33123b;}})});}_0x14b432=_[_0xc0a7('0x3d')]({},_0x14b432,_0x1e39c8[_0xc0a7('0x3e')]);var _0x2e1315={'where':_0x14b432['where']};return db[_0xc0a7('0x2b')][_0xc0a7('0x1e')](_0x2e1315)[_0xc0a7('0x23')](function(_0x502440){_0x1b9942[_0xc0a7('0x1e')]=_0x502440;if(_0x1e39c8[_0xc0a7('0x32')][_0xc0a7('0x3f')]){_0x14b432[_0xc0a7('0x40')]=[{'all':!![]}];}return db[_0xc0a7('0x2b')]['findAll'](_0x14b432);})[_0xc0a7('0x23')](function(_0x41c066){_0x1b9942[_0xc0a7('0x41')]=_0x41c066;return _0x1b9942;})[_0xc0a7('0x23')](respondWithFilteredResult(_0x2de615,_0x14b432))[_0xc0a7('0x42')](handleError(_0x2de615,null));};exports[_0xc0a7('0x43')]=function(_0x337a32,_0x207c08){var _0x37904a={'raw':!![],'where':{'id':_0x337a32[_0xc0a7('0x44')]['id']}},_0x46eb3e={};_0x46eb3e['model']=_[_0xc0a7('0x31')](db[_0xc0a7('0x2b')][_0xc0a7('0x2c')]);_0x46eb3e[_0xc0a7('0x32')]=_[_0xc0a7('0x31')](_0x337a32[_0xc0a7('0x32')]);_0x46eb3e[_0xc0a7('0x33')]=_[_0xc0a7('0x34')](_0x46eb3e[_0xc0a7('0x30')],_0x46eb3e[_0xc0a7('0x32')]);_0x37904a[_0xc0a7('0x36')]=_[_0xc0a7('0x34')](_0x46eb3e[_0xc0a7('0x30')],qs[_0xc0a7('0x35')](_0x337a32[_0xc0a7('0x32')]['fields']));_0x37904a[_0xc0a7('0x36')]=_0x37904a[_0xc0a7('0x36')][_0xc0a7('0x37')]?_0x37904a['attributes']:_0x46eb3e[_0xc0a7('0x30')];if(_0x337a32[_0xc0a7('0x32')][_0xc0a7('0x3f')]){_0x37904a['include']=[{'all':!![]}];}_0x37904a=_[_0xc0a7('0x3d')]({},_0x37904a,_0x337a32[_0xc0a7('0x3e')]);return db['FaxApplication']['find'](_0x37904a)['then'](handleEntityNotFound(_0x207c08,null))['then'](respondWithResult(_0x207c08,null))[_0xc0a7('0x42')](handleError(_0x207c08,null));};exports['create']=function(_0x26dbd6,_0x514e05){return db[_0xc0a7('0x2b')][_0xc0a7('0x45')](_0x26dbd6[_0xc0a7('0x46')],{})['then'](respondWithResult(_0x514e05,0xc9))[_0xc0a7('0x42')](handleError(_0x514e05,null));};exports[_0xc0a7('0x47')]=function(_0x1cd852,_0xe28fdf){if(_0x1cd852[_0xc0a7('0x46')]['id']){delete _0x1cd852[_0xc0a7('0x46')]['id'];}return db[_0xc0a7('0x2b')][_0xc0a7('0x48')]({'where':{'id':_0x1cd852[_0xc0a7('0x44')]['id']}})[_0xc0a7('0x23')](handleEntityNotFound(_0xe28fdf,null))[_0xc0a7('0x23')](saveUpdates(_0x1cd852[_0xc0a7('0x46')],null))[_0xc0a7('0x23')](respondWithResult(_0xe28fdf,null))[_0xc0a7('0x42')](handleError(_0xe28fdf,null));};exports[_0xc0a7('0x24')]=function(_0x45129c,_0x433c3c){return db[_0xc0a7('0x2b')][_0xc0a7('0x48')]({'where':{'id':_0x45129c[_0xc0a7('0x44')]['id']}})['then'](handleEntityNotFound(_0x433c3c,null))['then'](removeEntity(_0x433c3c,null))[_0xc0a7('0x42')](handleError(_0x433c3c,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index dac633c..570928c 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 _0x9a3d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','exports','FaxApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5aaa47,_0x448fb5){var _0x393f86=function(_0x5e41b6){while(--_0x5e41b6){_0x5aaa47['push'](_0x5aaa47['shift']());}};_0x393f86(++_0x448fb5);}(_0x9a3d,0x15e));var _0xd9a3=function(_0x360d7f,_0x19c030){_0x360d7f=_0x360d7f-0x0;var _0x4bb10b=_0x9a3d[_0x360d7f];return _0x4bb10b;};'use strict';var _=require(_0xd9a3('0x0'));var util=require(_0xd9a3('0x1'));var logger=require(_0xd9a3('0x2'))(_0xd9a3('0x3'));var moment=require(_0xd9a3('0x4'));var BPromise=require(_0xd9a3('0x5'));var rp=require(_0xd9a3('0x6'));var fs=require('fs');var path=require(_0xd9a3('0x7'));var rimraf=require('rimraf');var config=require(_0xd9a3('0x8'));var attributes=require(_0xd9a3('0x9'));module[_0xd9a3('0xa')]=function(_0x4a936a,_0x45b404){return _0x4a936a['define'](_0xd9a3('0xb'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd9a3('0xc'),'collate':_0xd9a3('0xd')});}; \ No newline at end of file +var _0xd106=['request-promise','path','rimraf','./faxApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd106,0xcb));var _0x6d10=function(_0x597220,_0x1405f4){_0x597220=_0x597220-0x0;var _0x25bfca=_0xd106[_0x597220];return _0x25bfca;};'use strict';var _=require(_0x6d10('0x0'));var util=require(_0x6d10('0x1'));var logger=require(_0x6d10('0x2'))('api');var moment=require(_0x6d10('0x3'));var BPromise=require(_0x6d10('0x4'));var rp=require(_0x6d10('0x5'));var fs=require('fs');var path=require(_0x6d10('0x6'));var rimraf=require(_0x6d10('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d10('0x8'));module[_0x6d10('0x9')]=function(_0x4e34d7,_0x3202ba){return _0x4e34d7[_0x6d10('0xa')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d10('0xb'),'collate':_0x6d10('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 80b7390..9f6dc36 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 _0xf981=['../../config/utils','../../config/logger','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','result','UpdateFaxApplication','FaxApplication','update','options','raw','where','limit','catch','lodash','util','moment','randomstring'];(function(_0x2ec00a,_0x23412a){var _0x27b616=function(_0x1bb2c5){while(--_0x1bb2c5){_0x2ec00a['push'](_0x2ec00a['shift']());}};_0x27b616(++_0x23412a);}(_0xf981,0x1af));var _0x1f98=function(_0x3a46de,_0x295bf7){_0x3a46de=_0x3a46de-0x0;var _0x59df1f=_0xf981[_0x3a46de];return _0x59df1f;};'use strict';var _=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));var moment=require(_0x1f98('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f98('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1f98('0x4'));var logger=require(_0x1f98('0x5'))(_0x1f98('0x6'));var config=require(_0x1f98('0x7'));var jayson=require(_0x1f98('0x8'));var client=jayson[_0x1f98('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x100075,_0x55a92d,_0x4944e9){return new BPromise(function(_0x25d264,_0x539c8e){return client[_0x1f98('0xa')](_0x100075,_0x4944e9)[_0x1f98('0xb')](function(_0x30b362){logger[_0x1f98('0xc')](_0x1f98('0xd'),_0x55a92d,_0x1f98('0xe'));logger[_0x1f98('0xf')](_0x1f98('0x10'),_0x55a92d,_0x1f98('0xe'),JSON[_0x1f98('0x11')](_0x30b362));if(_0x30b362['error']){if(_0x30b362[_0x1f98('0x12')]['code']===0x1f4){logger[_0x1f98('0x12')](_0x1f98('0xd'),_0x55a92d,_0x30b362['error'][_0x1f98('0x13')]);return _0x539c8e(_0x30b362[_0x1f98('0x12')][_0x1f98('0x13')]);}logger['error'](_0x1f98('0xd'),_0x55a92d,_0x30b362[_0x1f98('0x12')]['message']);return _0x25d264(_0x30b362[_0x1f98('0x12')][_0x1f98('0x13')]);}else{logger[_0x1f98('0xc')](_0x1f98('0xd'),_0x55a92d,_0x1f98('0xe'));_0x25d264(_0x30b362[_0x1f98('0x14')][_0x1f98('0x13')]);}})['catch'](function(_0x257232){logger[_0x1f98('0x12')](_0x1f98('0xd'),_0x55a92d,_0x257232);_0x539c8e(_0x257232);});});}exports[_0x1f98('0x15')]=function(_0x34cd83){var _0xe95fe7=this;return new Promise(function(_0x94111f,_0x55036a){return db[_0x1f98('0x16')][_0x1f98('0x17')](_0x34cd83['body'],{'raw':_0x34cd83['options']?_0x34cd83[_0x1f98('0x18')][_0x1f98('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34cd83[_0x1f98('0x18')]?_0x34cd83[_0x1f98('0x18')][_0x1f98('0x1a')]||null:null,'attributes':_0x34cd83[_0x1f98('0x18')]?_0x34cd83[_0x1f98('0x18')]['attributes']||null:null,'limit':_0x34cd83[_0x1f98('0x18')]?_0x34cd83['options'][_0x1f98('0x1b')]||null:null})[_0x1f98('0xb')](function(_0x37589e){logger[_0x1f98('0xc')](_0x1f98('0x15'),_0x34cd83);logger[_0x1f98('0xf')]('UpdateFaxApplication',_0x34cd83,JSON[_0x1f98('0x11')](_0x37589e));_0x94111f(_0x37589e);})[_0x1f98('0x1c')](function(_0x2c79fc){logger[_0x1f98('0x12')](_0x1f98('0x15'),_0x2c79fc[_0x1f98('0x13')],_0x34cd83);_0x55036a(_0xe95fe7[_0x1f98('0x12')](0x1f4,_0x2c79fc[_0x1f98('0x13')]));});});}; \ No newline at end of file +var _0x84cc=['body','options','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','UpdateFaxApplication','FaxApplication','update'];(function(_0x238bda,_0x4503b9){var _0x264bc5=function(_0x4efe8d){while(--_0x4efe8d){_0x238bda['push'](_0x238bda['shift']());}};_0x264bc5(++_0x4503b9);}(_0x84cc,0x1c6));var _0xc84c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x84cc[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xc84c('0x0'));var util=require('util');var moment=require(_0xc84c('0x1'));var BPromise=require(_0xc84c('0x2'));var rs=require(_0xc84c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc84c('0x4'))['db'];var utils=require(_0xc84c('0x5'));var logger=require(_0xc84c('0x6'))('rpc');var config=require(_0xc84c('0x7'));var jayson=require(_0xc84c('0x8'));var client=jayson[_0xc84c('0x9')][_0xc84c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2895f6,_0x1f0951,_0x2276b6){return new BPromise(function(_0x3f4ffd,_0x435163){return client[_0xc84c('0xb')](_0x2895f6,_0x2276b6)[_0xc84c('0xc')](function(_0x4c24eb){logger['info'](_0xc84c('0xd'),_0x1f0951,'request\x20sent');logger[_0xc84c('0xe')](_0xc84c('0xf'),_0x1f0951,_0xc84c('0x10'),JSON[_0xc84c('0x11')](_0x4c24eb));if(_0x4c24eb['error']){if(_0x4c24eb[_0xc84c('0x12')][_0xc84c('0x13')]===0x1f4){logger[_0xc84c('0x12')](_0xc84c('0xd'),_0x1f0951,_0x4c24eb[_0xc84c('0x12')][_0xc84c('0x14')]);return _0x435163(_0x4c24eb[_0xc84c('0x12')][_0xc84c('0x14')]);}logger[_0xc84c('0x12')]('FaxApplication,\x20%s,\x20%s',_0x1f0951,_0x4c24eb['error'][_0xc84c('0x14')]);return _0x3f4ffd(_0x4c24eb[_0xc84c('0x12')][_0xc84c('0x14')]);}else{logger[_0xc84c('0x15')](_0xc84c('0xd'),_0x1f0951,_0xc84c('0x10'));_0x3f4ffd(_0x4c24eb['result'][_0xc84c('0x14')]);}})[_0xc84c('0x16')](function(_0x11deb4){logger[_0xc84c('0x12')](_0xc84c('0xd'),_0x1f0951,_0x11deb4);_0x435163(_0x11deb4);});});}exports[_0xc84c('0x17')]=function(_0x51c938){var _0x1709e5=this;return new Promise(function(_0x34c30c,_0x57bcfe){return db[_0xc84c('0x18')][_0xc84c('0x19')](_0x51c938[_0xc84c('0x1a')],{'raw':_0x51c938[_0xc84c('0x1b')]?_0x51c938['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51c938['options']?_0x51c938[_0xc84c('0x1b')][_0xc84c('0x1c')]||null:null,'attributes':_0x51c938['options']?_0x51c938[_0xc84c('0x1b')][_0xc84c('0x1d')]||null:null,'limit':_0x51c938[_0xc84c('0x1b')]?_0x51c938[_0xc84c('0x1b')]['limit']||null:null})[_0xc84c('0xc')](function(_0x5eb63d){logger['info']('UpdateFaxApplication',_0x51c938);logger[_0xc84c('0xe')]('UpdateFaxApplication',_0x51c938,JSON[_0xc84c('0x11')](_0x5eb63d));_0x34c30c(_0x5eb63d);})[_0xc84c('0x16')](function(_0x1f3ce4){logger[_0xc84c('0x12')](_0xc84c('0x17'),_0x1f3ce4[_0xc84c('0x14')],_0x51c938);_0x57bcfe(_0x1709e5[_0xc84c('0x12')](0x1f4,_0x1f3ce4[_0xc84c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index e5d58d8..d76c117 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 _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x47014f,_0x407713){var _0x3f9bd3=function(_0x465814){while(--_0x465814){_0x47014f['push'](_0x47014f['shift']());}};_0x3f9bd3(++_0x407713);}(_0xac4a,0x13f));var _0xaac4=function(_0xcda733,_0xb6a901){_0xcda733=_0xcda733-0x0;var _0x543f15=_0xac4a[_0xcda733];return _0x543f15;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file +var _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1dc3e0,_0x5f15e0){var _0x2918cd=function(_0x44474d){while(--_0x44474d){_0x1dc3e0['push'](_0x1dc3e0['shift']());}};_0x2918cd(++_0x5f15e0);}(_0x4213,0x77));var _0x3421=function(_0x84b14c,_0x13f0c5){_0x84b14c=_0x84b14c-0x0;var _0x4c92a7=_0x4213[_0x84b14c];return _0x4c92a7;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 0804a1b..29dac06 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 _0x1244=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x512b15,_0xbc5285){var _0x4abcd2=function(_0x4ebdb1){while(--_0x4ebdb1){_0x512b15['push'](_0x512b15['shift']());}};_0x4abcd2(++_0xbc5285);}(_0x1244,0x19c));var _0x4124=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x1244[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require('sequelize');module[_0x4124('0x0')]={'closed':{'type':Sequelize[_0x4124('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4124('0x2')]},'disposition':{'type':Sequelize[_0x4124('0x3')]},'secondDisposition':{'type':Sequelize[_0x4124('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4124('0x3')]},'note':{'type':Sequelize[_0x4124('0x3')]},'read1stAt':{'type':Sequelize[_0x4124('0x2')]},'fax':{'type':Sequelize[_0x4124('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4124('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4124('0x4')]('in',_0x4124('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6801=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0x6801,0xa5));var _0x1680=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6801[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1680('0x0'));module[_0x1680('0x1')]={'closed':{'type':Sequelize[_0x1680('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1680('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1680('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1680('0x4')]},'note':{'type':Sequelize[_0x1680('0x4')]},'read1stAt':{'type':Sequelize[_0x1680('0x3')]},'fax':{'type':Sequelize[_0x1680('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1680('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1680('0x5')]('in',_0x1680('0x6')),'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 1daba00..62befba 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 _0x78c6=['ui.FaxInteractionId','from','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','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','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','includeAll','include','options','create','body','params','describe','FaxMessage','addMessage','ids','omit','findOne','sort','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','removeTags','download','unix','tmp','server','files','attachments','join','transcript-%d-%s.zip','Attachment','createdAt','Messages','get','mkdirSync','existsSync','createReadStream','pipe','basename','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','end','status','offset','undefined','limit','count','set','apply','reject','update','then','destroy','sendStatus','stack','name','Users','map','fullname','TagIds','Tags','split','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','select','field','color','tools_tags','u.fullname'];(function(_0x1aeb31,_0x3e901f){var _0x31c1a9=function(_0x2239f3){while(--_0x2239f3){_0x1aeb31['push'](_0x1aeb31['shift']());}};_0x31c1a9(++_0x3e901f);}(_0x78c6,0x91));var _0x678c=function(_0x23f722,_0x196b24){_0x23f722=_0x23f722-0x0;var _0x5bf2cc=_0x78c6[_0x23f722];return _0x5bf2cc;};'use strict';var emlformat=require(_0x678c('0x0'));var rimraf=require(_0x678c('0x1'));var zipdir=require(_0x678c('0x2'));var jsonpatch=require(_0x678c('0x3'));var rp=require(_0x678c('0x4'));var moment=require(_0x678c('0x5'));var BPromise=require(_0x678c('0x6'));var Mustache=require(_0x678c('0x7'));var util=require(_0x678c('0x8'));var path=require('path');var sox=require(_0x678c('0x9'));var csv=require(_0x678c('0xa'));var ejs=require(_0x678c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x678c('0xc'));var squel=require(_0x678c('0xd'));var crypto=require(_0x678c('0xe'));var jsforce=require(_0x678c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x678c('0xa'));var querystring=require(_0x678c('0x10'));var Papa=require(_0x678c('0x11'));var Redis=require('ioredis');var authService=require(_0x678c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x678c('0x13'));var logger=require('../../config/logger')(_0x678c('0x14'));var utils=require(_0x678c('0x15'));var config=require(_0x678c('0x16'));var licenseUtil=require(_0x678c('0x17'));var db=require(_0x678c('0x18'))['db'];config[_0x678c('0x19')]=_[_0x678c('0x1a')](config[_0x678c('0x19')],{'host':_0x678c('0x1b'),'port':0x18eb});var socket=require(_0x678c('0x1c'))(new Redis(config[_0x678c('0x19')]));require(_0x678c('0x1d'))[_0x678c('0x1e')](socket);function respondWithStatusCode(_0x3b8864,_0x4e8904){_0x4e8904=_0x4e8904||0xcc;return function(_0x27a759){if(_0x27a759){return _0x3b8864['sendStatus'](_0x4e8904);}return _0x3b8864['status'](_0x4e8904)[_0x678c('0x1f')]();};}function respondWithResult(_0x2edabd,_0x57e7d1){_0x57e7d1=_0x57e7d1||0xc8;return function(_0x5a4e59){if(_0x5a4e59){return _0x2edabd[_0x678c('0x20')](_0x57e7d1)['json'](_0x5a4e59);}};}function respondWithFilteredResult(_0x2f7e21,_0xe0099){return function(_0x188534){if(_0x188534){var _0x32af9d=typeof _0xe0099[_0x678c('0x21')]===_0x678c('0x22')&&typeof _0xe0099[_0x678c('0x23')]===_0x678c('0x22');var _0x55c0fa=_0x188534[_0x678c('0x24')];var _0xb54581=_0x32af9d?0x0:_0xe0099[_0x678c('0x21')];var _0x1a0312=_0x32af9d?_0x188534[_0x678c('0x24')]:_0xe0099['offset']+_0xe0099['limit'];var _0x2c8ed7;if(_0x1a0312>=_0x55c0fa){_0x1a0312=_0x55c0fa;_0x2c8ed7=0xc8;}else{_0x2c8ed7=0xce;}_0x2f7e21['status'](_0x2c8ed7);return _0x2f7e21[_0x678c('0x25')]('Content-Range',_0xb54581+'-'+_0x1a0312+'/'+_0x55c0fa)['json'](_0x188534);}return null;};}function patchUpdates(_0x1b3b0f){return function(_0x5e935c){try{jsonpatch[_0x678c('0x26')](_0x5e935c,_0x1b3b0f,!![]);}catch(_0x5b687d){return BPromise[_0x678c('0x27')](_0x5b687d);}return _0x5e935c['save']();};}function saveUpdates(_0x487e92,_0x1752f4){return function(_0x322103){if(_0x322103){return _0x322103[_0x678c('0x28')](_0x487e92)[_0x678c('0x29')](function(_0x52735d){return _0x52735d;});}return null;};}function removeEntity(_0x16644e,_0x335aa7){return function(_0x817b76){if(_0x817b76){return _0x817b76[_0x678c('0x2a')]()[_0x678c('0x29')](function(){_0x16644e['status'](0xcc)[_0x678c('0x1f')]();});}};}function handleEntityNotFound(_0x2659b8,_0x54faaf){return function(_0x165a4d){if(!_0x165a4d){_0x2659b8[_0x678c('0x2b')](0x194);}return _0x165a4d;};}function handleError(_0x4c08ef,_0x4dca48){_0x4dca48=_0x4dca48||0x1f4;return function(_0x53955c){logger['error'](_0x53955c[_0x678c('0x2c')]);if(_0x53955c['name']){delete _0x53955c[_0x678c('0x2d')];}_0x4c08ef[_0x678c('0x20')](_0x4dca48)['send'](_0x53955c);};}function getInteractionUsers(_0x592063,_0x3cf4d8){return new BPromise(function(_0x29309e,_0x24be3b){try{if(_0x3cf4d8[_0x592063['id']]){_0x592063[_0x678c('0x2e')]=_[_0x678c('0x2f')](_0x3cf4d8[_0x592063['id']],function(_0x2f2a75){return{'id':_0x2f2a75['id'],'fullname':_0x2f2a75[_0x678c('0x30')]};});}}catch(_0x25b545){_0x24be3b(_0x25b545);}_0x29309e(_0x592063);});}function getInteractionTags(_0x1ec97c,_0x5efbf1){return new BPromise(function(_0x590deb,_0x251b7a){try{if(_0x1ec97c[_0x678c('0x31')]){_0x1ec97c[_0x678c('0x32')]=[];_0x1ec97c['TagIds'][_0x678c('0x33')](',')['forEach'](function(_0x55b71f){_0x1ec97c['Tags'][_0x678c('0x34')](_0x5efbf1[_0x55b71f]);});}delete _0x1ec97c[_0x678c('0x31')];}catch(_0x953e68){_0x251b7a(_0x953e68);}_0x590deb(_0x1ec97c);});}function updateFaxInteraction(_0x14ac44,_0x98b76a,_0x1f0c4a){return new BPromise(function(_0x300bab,_0x42015a){return getInteractionUsers(_0x14ac44,_0x1f0c4a)[_0x678c('0x29')](function(_0x4540ad){return getInteractionTags(_0x4540ad,_0x98b76a);})[_0x678c('0x29')](function(_0x19ea1f){_0x300bab(_0x19ea1f);})[_0x678c('0x35')](function(_0x2e9947){_0x42015a(_0x2e9947);});});}exports[_0x678c('0x36')]=function(_0x39f7b8,_0x5f13b4){var _0x77ad43={},_0x470faa={},_0x760693={'count':0x0,'rows':[]};var _0x3744ea=_[_0x678c('0x2f')](db[_0x678c('0x37')][_0x678c('0x38')],function(_0x3b9ab1){return{'name':_0x3b9ab1[_0x678c('0x39')],'type':_0x3b9ab1[_0x678c('0x3a')][_0x678c('0x3b')]};});_0x470faa['model']=_[_0x678c('0x2f')](_0x3744ea,_0x678c('0x2d'));_0x470faa['query']=_[_0x678c('0x3c')](_0x39f7b8[_0x678c('0x3d')]);_0x470faa[_0x678c('0x3e')]=_[_0x678c('0x3f')](_0x470faa[_0x678c('0x40')],_0x470faa[_0x678c('0x3d')]);_0x77ad43[_0x678c('0x41')]=_[_0x678c('0x3f')](_0x470faa['model'],qs[_0x678c('0x42')](_0x39f7b8['query'][_0x678c('0x42')]));_0x77ad43['attributes']=_0x77ad43[_0x678c('0x41')]['length']?_0x77ad43[_0x678c('0x41')]:_0x470faa['model'];if(!_0x39f7b8[_0x678c('0x3d')][_0x678c('0x43')](_0x678c('0x44'))){_0x77ad43[_0x678c('0x23')]=qs['limit'](_0x39f7b8['query'][_0x678c('0x23')]);_0x77ad43[_0x678c('0x21')]=qs[_0x678c('0x21')](_0x39f7b8[_0x678c('0x3d')][_0x678c('0x21')]);}_0x77ad43[_0x678c('0x45')]=qs['sort'](_0x39f7b8[_0x678c('0x3d')]['sort']);_0x77ad43[_0x678c('0x46')]=qs['filters'](_[_0x678c('0x47')](_0x39f7b8[_0x678c('0x3d')],_0x470faa[_0x678c('0x3e')]),_0x3744ea);var _0x53873f=[];var _0x44cbe0=squel[_0x678c('0x48')]()[_0x678c('0x49')]('id')[_0x678c('0x49')]('name')[_0x678c('0x49')](_0x678c('0x4a'))['from'](_0x678c('0x4b'));var _0xdc5b1a=squel[_0x678c('0x48')]()[_0x678c('0x49')]('u.id')[_0x678c('0x49')](_0x678c('0x4c'))[_0x678c('0x49')](_0x678c('0x4d'))[_0x678c('0x4e')](_0x678c('0x4f'),'ui')['left_join'](_0x678c('0x50'),'u',_0x678c('0x51'));var _0x2791b3=squel[_0x678c('0x48')]()[_0x678c('0x4e')](_0x678c('0x52'),'i')[_0x678c('0x53')](_0x678c('0x54'),'c',_0x678c('0x55'))[_0x678c('0x53')]('users','o','o.id\x20=\x20i.UserId')[_0x678c('0x53')](_0x678c('0x56'),'a',_0x678c('0x57'))[_0x678c('0x53')](_0x678c('0x58'),'me',_0x678c('0x59'))[_0x678c('0x53')]('fax_interaction_has_tags','it',_0x678c('0x5a'))[_0x678c('0x53')](_0x678c('0x4b'),'t',_0x678c('0x5b'));var _0x188441=squel[_0x678c('0x5c')]();var _0x1383f2=[];var _0x41ed64=squel['expr']();var _0x2b9c75;if(_0x39f7b8['query']['search']){_0x2b9c75=as['parseSearch'](_0x39f7b8[_0x678c('0x3d')][_0x678c('0x5d')]);var _0x8dd02a=_0x2b9c75[_0x678c('0x5e')];for(var _0x8cd2c=0x0;_0x8cd2c<_0x2b9c75[_0x678c('0x5f')]['length'];_0x8cd2c++){var _0x5ebe57=_0x2b9c75['conditions'][_0x8cd2c];var _0x4b646d='i';var _0x2e2b70=_[_0x678c('0x60')](_0x3744ea,[_0x678c('0x2d'),_0x5ebe57[_0x678c('0x49')]]);if(!_0x2e2b70){switch(_0x5ebe57['field']){case _0x678c('0x61'):if(_0x5ebe57[_0x678c('0x62')]==0x1){_0x2791b3['having']('`'+_0x5ebe57['field']+_0x678c('0x63'));}else{_0x2791b3['having']('`'+_0x5ebe57[_0x678c('0x49')]+_0x678c('0x64'));}break;case _0x678c('0x65'):if(_0x5ebe57[_0x678c('0x66')]===_0x678c('0x67')){if(_0x5ebe57[_0x678c('0x62')]['split']('\x20')[_0x678c('0x68')]>0x1){_0x188441[_0x8dd02a](_0x678c('0x69'),qs[_0x678c('0x6a')](_0x5ebe57[_0x678c('0x62')]),null);}else{var _0x4434bb='%'+_0x5ebe57[_0x678c('0x62')]+'%';_0x188441[_0x8dd02a](_0x678c('0x6b'),_0x4434bb,_0x4434bb,_0x4434bb);}}else{_0x2e2b70=_[_0x678c('0x60')](_0x3744ea,[_0x678c('0x2d'),_0x678c('0x6c')]);_0x5ebe57[_0x678c('0x49')]=_0x678c('0x6c');_0x41049f=as['buildExpression'](_0x4b646d,_0x2e2b70[_0x678c('0x3a')],_0x5ebe57);_0x188441[_0x8dd02a](_0x41049f[_0x678c('0x6d')],_0x41049f[_0x678c('0x62')][_0x678c('0x6e')],_0x41049f[_0x678c('0x62')]['end']);}break;case _0x678c('0x6f'):var _0x3bdb6d=_0x5ebe57[_0x678c('0x62')]['split'](',')['map'](function(_0x42943a){return Number(_0x42943a);});_0x3bdb6d[_0x678c('0x70')](function(_0x3cea8b){_0x41ed64['or'](_0x678c('0x71'),'%,'+_0x3cea8b+',%');});_0x1383f2=_[_0x678c('0x72')](_0x1383f2,_0x3bdb6d);break;case _0x678c('0x73'):if(_0x5ebe57[_0x678c('0x66')]===_0x678c('0x67')){_0x188441[_0x8dd02a](_0x678c('0x74'),'%'+_0x5ebe57[_0x678c('0x62')]+'%',null);}else{_0x2e2b70=_[_0x678c('0x60')](_0x3744ea,[_0x678c('0x2d'),_0x678c('0x75')]);_0x5ebe57[_0x678c('0x49')]=_0x678c('0x75');_0x41049f=as['buildExpression'](_0x4b646d,_0x2e2b70[_0x678c('0x3a')],_0x5ebe57);_0x188441[_0x8dd02a](_0x41049f[_0x678c('0x6d')],_0x41049f[_0x678c('0x62')][_0x678c('0x6e')],_0x41049f['value']['end']);}break;case'body':_0x41049f=as[_0x678c('0x76')]('me',null,_0x5ebe57);_0x188441[_0x8dd02a](_0x41049f[_0x678c('0x6d')],_0x41049f[_0x678c('0x62')][_0x678c('0x6e')],_0x41049f[_0x678c('0x62')][_0x678c('0x1f')]);break;}}else{var _0x41049f=as[_0x678c('0x76')](_0x4b646d,_0x2e2b70[_0x678c('0x3a')],_0x5ebe57);_0x188441[_0x8dd02a](_0x41049f[_0x678c('0x6d')],_0x41049f['value'][_0x678c('0x6e')],_0x41049f[_0x678c('0x62')][_0x678c('0x1f')]);}}}else{var _0x5e9078=_(_0x39f7b8[_0x678c('0x3d')])[_0x678c('0x3c')]()['map'](function(_0x56a8cf){return _[_0x678c('0x77')](_0x3744ea,[_0x678c('0x2d'),_0x56a8cf])?_0x56a8cf:undefined;})[_0x678c('0x78')]()[_0x678c('0x62')]();if(!_[_0x678c('0x79')](_0x5e9078)){_0x5e9078[_0x678c('0x70')](function(_0x2c889b){if(_0x2c889b==='FaxAccountId'){_0x2791b3['where'](_0x678c('0x7a'),[][_0x678c('0x7b')](_0x39f7b8['query'][_0x2c889b]));}else if(_0x2c889b==='createdAt'){var _0x468b21=JSON[_0x678c('0x7c')](_0x39f7b8[_0x678c('0x3d')][_0x2c889b])[_0x678c('0x7d')];var _0x2ba29a=JSON[_0x678c('0x7c')](_0x39f7b8[_0x678c('0x3d')][_0x2c889b])[_0x678c('0x7e')];_0x2791b3[_0x678c('0x46')](_0x678c('0x7f'),_0x468b21,_0x2ba29a);}else{if(_0x39f7b8['query'][_0x2c889b]===_0x678c('0x80')){_0x2791b3['where']('i.'+_0x2c889b+'\x20IS\x20NULL');}else{_0x2791b3['where']('i.'+_0x2c889b+_0x678c('0x81'),_0x39f7b8[_0x678c('0x3d')][_0x2c889b]);}}});}if(_0x39f7b8['query'][_0x678c('0x82')]){if(_0x39f7b8[_0x678c('0x3d')][_0x678c('0x82')]==0x1){_0x2791b3[_0x678c('0x83')](_0x678c('0x84'));}else{_0x2791b3[_0x678c('0x83')](_0x678c('0x85'));}}if(_0x39f7b8[_0x678c('0x3d')][_0x678c('0x86')]){_0x1383f2=_[_0x678c('0x87')](_0x39f7b8[_0x678c('0x3d')]['tag'])?_0x39f7b8[_0x678c('0x3d')]['tag']:new Array(_0x39f7b8[_0x678c('0x3d')][_0x678c('0x86')]);_0x1383f2[_0x678c('0x70')](function(_0x52ca01){_0x41ed64['or'](_0x678c('0x71'),'%,'+_0x52ca01+',%');});}if(_0x39f7b8[_0x678c('0x3d')]['filter']){var _0x287759=_0x39f7b8[_0x678c('0x3d')][_0x678c('0x88')][_0x678c('0x89')]('\x5c','\x5c\x5c')[_0x678c('0x89')](/'/g,'\x27\x27');if(qs[_0x678c('0x8a')](_0x287759)){_0x188441['or'](_0x678c('0x8b'),_0x287759+'%')['or'](_0x678c('0x8c'),_0x287759+'%');}_0x188441['or'](_0x678c('0x8d'),_0x287759+'%');}}_0x2791b3[_0x678c('0x46')](_0x188441);_0x2791b3[_0x678c('0x8e')](_0x678c('0x8f'));var _0x5791d1={'type':db[_0x678c('0x90')]['QueryTypes'][_0x678c('0x91')],'raw':!![]};var _0x3304cd=_0x2791b3[_0x678c('0x92')]();_0x3304cd[_0x678c('0x49')](_0x678c('0x8f'));_0x3304cd[_0x678c('0x49')](_0x678c('0x93'),_0x678c('0x61'));if(_0x77ad43['order']){_0x77ad43[_0x678c('0x45')][_0x678c('0x70')](function(_0x21a8a2){var _0x28745e=_0x21a8a2[0x0]===_0x678c('0x94')?_0x21a8a2[0x0]:'i.'+_0x21a8a2[0x0];_0x2791b3[_0x678c('0x45')](_0x28745e,_0x21a8a2[0x1]==='DESC'?![]:!![]);});}if(!_[_0x678c('0x79')](_0x1383f2)){_0x2791b3[_0x678c('0x83')](_0x41ed64);_0x3304cd[_0x678c('0x46')](_0x678c('0x95'),_0x1383f2);}BPromise[_0x678c('0x96')]()['then'](function(){if(!_0x2b9c75){if(_0x39f7b8[_0x678c('0x3d')][_0x678c('0x97')])return;_0x3304cd[_0x678c('0x46')](_0x678c('0x98'));_0x2791b3['where'](_0x678c('0x98'));return;}if(_0x39f7b8[_0x678c('0x99')]['role']!==_0x678c('0x9a'))return;return _0x39f7b8[_0x678c('0x99')][_0x678c('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4ebe24){if(_[_0x678c('0x79')](_0x4ebe24)){_0x3304cd[_0x678c('0x46')](_0x678c('0x9c'));_0x2791b3['where'](_0x678c('0x9c'));}else{_0x3304cd[_0x678c('0x46')]('i.FaxAccountId\x20IN\x20?',_[_0x678c('0x2f')](_0x4ebe24,'id'));_0x2791b3[_0x678c('0x46')]('i.FaxAccountId\x20IN\x20?',_[_0x678c('0x2f')](_0x4ebe24,'id'));}});})['then'](function(){if(_0x39f7b8[_0x678c('0x99')][_0x678c('0x9d')]==='agent'&&!_0x2b9c75&&!_0x39f7b8[_0x678c('0x3d')]['FaxAccountId'])return[];return db['sequelize']['query'](_0x3304cd['toString'](),_0x5791d1);})['then'](function(_0x3f4882){_0x760693['count']=_0x3f4882[_0x678c('0x68')];if(_0x760693[_0x678c('0x24')]===0x0)return[];return db[_0x678c('0x9e')][_0x678c('0x3d')](_0x44cbe0[_0x678c('0x9f')](),_0x5791d1)[_0x678c('0x29')](function(_0x36e89b){_0x53873f=_[_0x678c('0xa0')](_0x36e89b,'id');_0x5791d1=_[_0x678c('0xa1')](_0x5791d1,{'model':db[_0x678c('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39f7b8[_0x678c('0x3d')]['fields']){_0x77ad43[_0x678c('0x41')][_0x678c('0x70')](function(_0x368c75){_0x2791b3[_0x678c('0x49')]('i.'+_0x368c75);});}else{_0x2791b3[_0x678c('0x49')](_0x678c('0x93'),'unreadMessages');_0x2791b3['field'](_0x678c('0xa2'),'Account.key');_0x2791b3[_0x678c('0x49')](_0x678c('0xa3'),_0x678c('0xa4'));_0x2791b3[_0x678c('0x49')](_0x678c('0xa5'),_0x678c('0x94'));_0x2791b3[_0x678c('0x49')](_0x678c('0xa6'));_0x2791b3['field']('c.firstName',_0x678c('0xa7'));_0x2791b3[_0x678c('0x49')]('c.lastName','Contact.lastName');_0x2791b3[_0x678c('0x49')](_0x678c('0xa8'),_0x678c('0xa9'));_0x2791b3[_0x678c('0x49')](_0x678c('0xaa'),_0x678c('0xab'));_0x2791b3[_0x678c('0x49')](_0x678c('0xac'),_0x678c('0xad'));_0x2791b3[_0x678c('0x49')]('c.fax',_0x678c('0xae'));_0x2791b3['field']('o.fullname',_0x678c('0xaf'));_0x2791b3[_0x678c('0x49')]('o.internal',_0x678c('0xb0'));_0x2791b3[_0x678c('0x49')](_0x678c('0xb1'),_0x678c('0x31'));}if(_0x77ad43[_0x678c('0x23')])_0x2791b3[_0x678c('0x23')](_0x77ad43[_0x678c('0x23')]);if(_0x77ad43[_0x678c('0x21')])_0x2791b3[_0x678c('0x21')](_0x77ad43[_0x678c('0x21')]);return db['sequelize'][_0x678c('0x3d')](_0x2791b3[_0x678c('0x9f')](),_0x5791d1);})[_0x678c('0x29')](function(_0x441857){if(_0x441857[_0x678c('0x68')]>0x0)_0xdc5b1a[_0x678c('0x46')](_0x678c('0xb2'),_['map'](_0x441857,'id'));return db[_0x678c('0x9e')]['query'](_0xdc5b1a[_0x678c('0x9f')](),_0x5791d1)['then'](function(_0xdd2413){var _0x42ff5c=_['groupBy'](_0xdd2413,_0x678c('0xb3'));var _0x203a4f=[];_0x441857[_0x678c('0x70')](function(_0x2a6364){_0x203a4f[_0x678c('0x34')](updateFaxInteraction(_0x2a6364,_0x53873f,_0x42ff5c));});return BPromise[_0x678c('0xb4')](_0x203a4f);});});})[_0x678c('0x29')](function(_0x2f7e86){_0x760693[_0x678c('0xb5')]=_0x2f7e86;return _0x760693;})['then'](respondWithFilteredResult(_0x5f13b4,_0x77ad43))[_0x678c('0x35')](handleError(_0x5f13b4,null));};exports[_0x678c('0xb6')]=function(_0x3ccd3d,_0x59dbb0){var _0x25333d={'raw':![],'where':{'id':_0x3ccd3d['params']['id']}},_0x222960={};_0x222960[_0x678c('0x40')]=_['keys'](db[_0x678c('0x37')][_0x678c('0x38')]);_0x222960[_0x678c('0x3d')]=_[_0x678c('0x3c')](_0x3ccd3d['query']);_0x222960[_0x678c('0x3e')]=_[_0x678c('0x3f')](_0x222960['model'],_0x222960[_0x678c('0x3d')]);_0x25333d['attributes']=_[_0x678c('0x3f')](_0x222960['model'],qs[_0x678c('0x42')](_0x3ccd3d['query'][_0x678c('0x42')]));_0x25333d[_0x678c('0x41')]=_0x25333d[_0x678c('0x41')]['length']?_0x25333d[_0x678c('0x41')]:_0x222960[_0x678c('0x40')];if(_0x3ccd3d[_0x678c('0x3d')][_0x678c('0xb7')]){_0x25333d[_0x678c('0xb8')]=[{'all':!![]}];}_0x25333d=_[_0x678c('0xa1')]({},_0x25333d,_0x3ccd3d[_0x678c('0xb9')]);return db['FaxInteraction'][_0x678c('0x60')](_0x25333d)[_0x678c('0x29')](handleEntityNotFound(_0x59dbb0,null))[_0x678c('0x29')](respondWithResult(_0x59dbb0,null))['catch'](handleError(_0x59dbb0,null));};exports[_0x678c('0xba')]=function(_0x44b7ae,_0x34e59a){return db[_0x678c('0x37')][_0x678c('0xba')](_0x44b7ae[_0x678c('0xbb')],{})[_0x678c('0x29')](respondWithResult(_0x34e59a,0xc9))['catch'](handleError(_0x34e59a,null));};exports[_0x678c('0x28')]=function(_0x3b7e6f,_0x48e4e8){if(_0x3b7e6f[_0x678c('0xbb')]['id']){delete _0x3b7e6f[_0x678c('0xbb')]['id'];}return db['FaxInteraction'][_0x678c('0x60')]({'where':{'id':_0x3b7e6f[_0x678c('0xbc')]['id']}})[_0x678c('0x29')](handleEntityNotFound(_0x48e4e8,null))[_0x678c('0x29')](saveUpdates(_0x3b7e6f[_0x678c('0xbb')],null))[_0x678c('0x29')](respondWithResult(_0x48e4e8,null))['catch'](handleError(_0x48e4e8,null));};exports[_0x678c('0x2a')]=function(_0x3f38ea,_0x59cff0){return db[_0x678c('0x37')]['find']({'where':{'id':_0x3f38ea[_0x678c('0xbc')]['id']}})['then'](handleEntityNotFound(_0x59cff0,null))['then'](removeEntity(_0x59cff0,null))[_0x678c('0x35')](handleError(_0x59cff0,null));};exports['describe']=function(_0x586cf4,_0xa04b1b){return db['FaxInteraction'][_0x678c('0xbd')]()[_0x678c('0x29')](respondWithResult(_0xa04b1b,null))[_0x678c('0x35')](handleError(_0xa04b1b,null));};exports['addMessage']=function(_0x656b73,_0x780da1,_0x37d4f2){return db[_0x678c('0xbe')][_0x678c('0x60')]({'where':{'id':_0x656b73[_0x678c('0xbc')]['id']}})[_0x678c('0x29')](handleEntityNotFound(_0x780da1,null))[_0x678c('0x29')](function(_0x4957a4){if(_0x4957a4){return _0x4957a4[_0x678c('0xbf')](_0x656b73['body'][_0x678c('0xc0')],_[_0x678c('0xc1')](_0x656b73[_0x678c('0xbb')],['ids','id'])||{});}})['then'](respondWithResult(_0x780da1,null))['catch'](handleError(_0x780da1,null));};exports['getMessages']=function(_0x2b5f1e,_0x179a23,_0x47a356){var _0x254e07={'raw':![],'where':{}};var _0x5eaa81={};var _0x5c2ccf={'count':0x0,'rows':[]};return db[_0x678c('0x37')][_0x678c('0xc2')]({'where':{'id':_0x2b5f1e['params']['id']}})['then'](handleEntityNotFound(_0x179a23,null))[_0x678c('0x29')](function(_0x361e24){if(_0x361e24){_0x5eaa81[_0x678c('0x40')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x5eaa81[_0x678c('0x3d')]=_[_0x678c('0x3c')](_0x2b5f1e[_0x678c('0x3d')]);_0x5eaa81[_0x678c('0x3e')]=_[_0x678c('0x3f')](_0x5eaa81[_0x678c('0x40')],_0x5eaa81[_0x678c('0x3d')]);_0x254e07[_0x678c('0x41')]=_['intersection'](_0x5eaa81['model'],qs[_0x678c('0x42')](_0x2b5f1e[_0x678c('0x3d')]['fields']));_0x254e07['attributes']=_0x254e07[_0x678c('0x41')][_0x678c('0x68')]?_0x254e07[_0x678c('0x41')]:_0x5eaa81[_0x678c('0x40')];if(!_0x2b5f1e[_0x678c('0x3d')][_0x678c('0x43')](_0x678c('0x44'))){_0x254e07[_0x678c('0x23')]=qs[_0x678c('0x23')](_0x2b5f1e[_0x678c('0x3d')]['limit']);_0x254e07['offset']=qs[_0x678c('0x21')](_0x2b5f1e[_0x678c('0x3d')][_0x678c('0x21')]);}_0x254e07[_0x678c('0x45')]=qs['sort'](_0x2b5f1e[_0x678c('0x3d')][_0x678c('0xc3')]);_0x254e07[_0x678c('0x46')]=qs[_0x678c('0x3e')](_[_0x678c('0x47')](_0x2b5f1e[_0x678c('0x3d')],_0x5eaa81[_0x678c('0x3e')]));_0x254e07[_0x678c('0x46')][_0x678c('0xb3')]=_0x361e24['id'];if(_0x2b5f1e['query']['filter']){_0x254e07['where']=_[_0x678c('0xa1')](_0x254e07['where'],{'$or':_['map'](_0x254e07['attributes'],function(_0x6a741a){var _0x251e16={};_0x251e16[_0x6a741a]={'$like':'%'+_0x2b5f1e[_0x678c('0x3d')][_0x678c('0x88')]+'%'};return _0x251e16;})});}if(_0x2b5f1e['query']['$gte']){var _0x8c3ea=_0x2b5f1e[_0x678c('0x3d')]['$gte'][_0x678c('0x33')](',');var _0x54c113={};_0x54c113[_0x8c3ea[0x0]]={'$gte':moment(_0x8c3ea[0x1])[_0x678c('0xc4')](_0x678c('0xc5'))};_0x254e07['where']=_[_0x678c('0xa1')](_0x254e07[_0x678c('0x46')],_0x54c113);}_0x254e07=_['merge']({},_0x254e07,_0x2b5f1e[_0x678c('0xb9')]);return db['FaxMessage'][_0x678c('0x24')]({'where':_0x254e07[_0x678c('0x46')]})[_0x678c('0x29')](function(_0x1ec1b8){_0x5c2ccf['count']=_0x1ec1b8;if(_0x2b5f1e[_0x678c('0x3d')][_0x678c('0xb7')]){_0x254e07[_0x678c('0xb8')]=[{'all':!![]}];}return db['FaxMessage'][_0x678c('0xc6')](_0x254e07);})['then'](function(_0x10b54d){_0x5c2ccf['rows']=_0x10b54d;return _0x5c2ccf;});}})[_0x678c('0x29')](respondWithFilteredResult(_0x179a23,_0x254e07))['catch'](handleError(_0x179a23,null));};exports[_0x678c('0xc7')]=function(_0x5cea13,_0x224751,_0x5e769e){return db[_0x678c('0x37')]['find']({'where':{'id':_0x5cea13[_0x678c('0xbc')]['id']}})['then'](handleEntityNotFound(_0x224751,null))[_0x678c('0x29')](function(_0x5c31f3){if(_0x5c31f3){return _0x5c31f3[_0x678c('0xc8')](_0x5cea13['body'][_0x678c('0xc0')],_[_0x678c('0xc1')](_0x5cea13[_0x678c('0xbb')],[_0x678c('0xc0'),'id'])||{})[_0x678c('0xc9')](function(){return db[_0x678c('0x6f')][_0x678c('0xc6')]({'attributes':['id',_0x678c('0x2d'),_0x678c('0x4a')],'where':{'id':_0x5cea13['body'][_0x678c('0xc0')]}});})[_0x678c('0x29')](function(_0x3aff3d){socket['emit']('faxInteractionTags:save',{'id':Number(_0x5cea13[_0x678c('0xbc')]['id']),'tags':_0x3aff3d||[]});return{'id':Number(_0x5cea13[_0x678c('0xbc')]['id']),'tags':_0x3aff3d||[]};});}})[_0x678c('0x29')](respondWithResult(_0x224751,null))[_0x678c('0x35')](handleError(_0x224751,null));};exports['removeTags']=function(_0x61992c,_0x3cbccb,_0x2c343a){return db[_0x678c('0x37')]['find']({'where':{'id':_0x61992c[_0x678c('0xbc')]['id']}})[_0x678c('0x29')](handleEntityNotFound(_0x3cbccb,null))[_0x678c('0x29')](function(_0x3c78c9){if(_0x3c78c9){return _0x3c78c9[_0x678c('0xca')](_0x61992c[_0x678c('0x3d')][_0x678c('0xc0')]);}})[_0x678c('0x29')](respondWithStatusCode(_0x3cbccb,null))[_0x678c('0x35')](handleError(_0x3cbccb,null));};exports[_0x678c('0xcb')]=function(_0x18685f,_0x4c445e){var _0x33500c=moment()[_0x678c('0xcc')]()['toString']();var _0x4c0cd9=path['join'](config['root'],'server','files',_0x678c('0xcd'));var _0xd4a098=path['join'](config['root'],_0x678c('0xce'),_0x678c('0xcf'),_0x678c('0xd0'));var _0x14b9b3=path[_0x678c('0xd1')](_0x4c0cd9,_0x33500c);var _0x432922=util['format'](_0x678c('0xd2'),_0x18685f[_0x678c('0xbc')]['id'],_0x33500c);var _0xe6daca=path[_0x678c('0xd1')](_0x4c0cd9,_0x432922);var _0x1d101f=[];_0x1d101f[_0x678c('0x34')]({'model':db[_0x678c('0xd3')],'as':_0x678c('0xd3'),'raw':!![]});var _0x3c0a73=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x678c('0xbb'),_0x678c('0xd4')],'include':_0x1d101f}];return db[_0x678c('0x37')][_0x678c('0x60')]({'where':{'id':_0x18685f[_0x678c('0xbc')]['id']},'include':_0x3c0a73})['then'](handleEntityNotFound(_0x4c445e,null))[_0x678c('0x29')](function(_0x294e3d){if(_0x294e3d&&_0x294e3d[_0x678c('0xd5')]){var _0x1e29a0=_0x294e3d[_0x678c('0xd6')]({'plain':!![]});fs[_0x678c('0xd7')](_0x14b9b3);for(var _0x15777f=0x0;_0x15777f<_0x1e29a0[_0x678c('0xd5')]['length'];_0x15777f++){var _0x5899f8=_0x1e29a0[_0x678c('0xd5')][_0x15777f][_0x678c('0xd3')];if(_0x5899f8){var _0x3ed868=path['join'](_0xd4a098,_0x5899f8['basename']);if(fs[_0x678c('0xd8')](_0x3ed868)){fs[_0x678c('0xd9')](_0x3ed868)[_0x678c('0xda')](fs['createWriteStream'](path[_0x678c('0xd1')](_0x14b9b3,_0x5899f8[_0x678c('0xdb')])));}}}return BPromise[_0x678c('0x96')]()[_0x678c('0x29')](function(){return new BPromise(function(_0x11b80d,_0x4e1c28){zipdir(_0x14b9b3,{'saveTo':_0xe6daca},function(_0x4e2120,_0x5de611){if(_0x4e2120)return _0x4e1c28(_0x4e2120);return _0x11b80d(_0x5de611);});})['then'](function(){return new BPromise(function(_0x1ba281,_0x6a7238){rimraf(_0x14b9b3,function(_0x59cc87){if(_0x59cc87)_0x6a7238(_0x59cc87);return _0x1ba281();});});})[_0x678c('0x29')](function(){return _0x4c445e[_0x678c('0xcb')](_0xe6daca,_0x432922,function(_0x16e65c){if(_0x16e65c){console[_0x678c('0xdc')](_0x678c('0xdd'),_0x16e65c);}else{fs['unlinkSync'](_0xe6daca);}});});});}else{return _0x4c445e['sendStatus'](0xc8);}})[_0x678c('0x35')](handleError(_0x4c445e,null));}; \ No newline at end of file +var _0x4ae6=['t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','unreadMessages','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','buildExpression','compact','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','isNumeric','i.fax\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','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.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.FaxInteractionId\x20IN\x20?','groupBy','push','all','rows','show','params','include','options','describe','addMessage','FaxMessage','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','ids','Tag','color','faxInteractionTags:save','removeTags','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Messages','get','mkdirSync','Attachment','basename','existsSync','createWriteStream','download','log','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','register','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','Users','map','fullname','Tags','split','forEach','then','catch','FaxInteraction','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','select','field','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x4ae6,0x14e));var _0x64ae=function(_0x331da2,_0x348571){_0x331da2=_0x331da2-0x0;var _0x294ffd=_0x4ae6[_0x331da2];return _0x294ffd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64ae('0x0'));var zipdir=require(_0x64ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64ae('0x2'));var moment=require(_0x64ae('0x3'));var BPromise=require(_0x64ae('0x4'));var Mustache=require(_0x64ae('0x5'));var util=require(_0x64ae('0x6'));var path=require(_0x64ae('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x64ae('0x8'));var fs=require('fs');var fs_extra=require(_0x64ae('0x9'));var _=require('lodash');var squel=require(_0x64ae('0xa'));var crypto=require(_0x64ae('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x64ae('0xc'));var querystring=require(_0x64ae('0xd'));var Papa=require('papaparse');var Redis=require(_0x64ae('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x64ae('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64ae('0x10'));var logger=require(_0x64ae('0x11'))('api');var utils=require(_0x64ae('0x12'));var config=require(_0x64ae('0x13'));var licenseUtil=require(_0x64ae('0x14'));var db=require(_0x64ae('0x15'))['db'];config['redis']=_[_0x64ae('0x16')](config['redis'],{'host':_0x64ae('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64ae('0x18')]));require('./faxInteraction.socket')[_0x64ae('0x19')](socket);function respondWithStatusCode(_0x2a3cc8,_0x1c6e46){_0x1c6e46=_0x1c6e46||0xcc;return function(_0x12d62d){if(_0x12d62d){return _0x2a3cc8['sendStatus'](_0x1c6e46);}return _0x2a3cc8[_0x64ae('0x1a')](_0x1c6e46)[_0x64ae('0x1b')]();};}function respondWithResult(_0xdab106,_0x3a0cb9){_0x3a0cb9=_0x3a0cb9||0xc8;return function(_0x3265d7){if(_0x3265d7){return _0xdab106['status'](_0x3a0cb9)[_0x64ae('0x1c')](_0x3265d7);}};}function respondWithFilteredResult(_0x43727e,_0x2a3a7b){return function(_0x373722){if(_0x373722){var _0xf98982=typeof _0x2a3a7b['offset']===_0x64ae('0x1d')&&typeof _0x2a3a7b[_0x64ae('0x1e')]===_0x64ae('0x1d');var _0x465646=_0x373722[_0x64ae('0x1f')];var _0x4be4b5=_0xf98982?0x0:_0x2a3a7b[_0x64ae('0x20')];var _0x3f2f06=_0xf98982?_0x373722[_0x64ae('0x1f')]:_0x2a3a7b[_0x64ae('0x20')]+_0x2a3a7b['limit'];var _0x43e8a4;if(_0x3f2f06>=_0x465646){_0x3f2f06=_0x465646;_0x43e8a4=0xc8;}else{_0x43e8a4=0xce;}_0x43727e[_0x64ae('0x1a')](_0x43e8a4);return _0x43727e['set'](_0x64ae('0x21'),_0x4be4b5+'-'+_0x3f2f06+'/'+_0x465646)[_0x64ae('0x1c')](_0x373722);}return null;};}function patchUpdates(_0x45ca94){return function(_0x54f99c){try{jsonpatch['apply'](_0x54f99c,_0x45ca94,!![]);}catch(_0x49901a){return BPromise[_0x64ae('0x22')](_0x49901a);}return _0x54f99c[_0x64ae('0x23')]();};}function saveUpdates(_0x4f035c,_0x199f43){return function(_0x356b00){if(_0x356b00){return _0x356b00[_0x64ae('0x24')](_0x4f035c)['then'](function(_0x323801){return _0x323801;});}return null;};}function removeEntity(_0xee2d75,_0x295a88){return function(_0x5a8eaf){if(_0x5a8eaf){return _0x5a8eaf[_0x64ae('0x25')]()['then'](function(){_0xee2d75[_0x64ae('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x300d5b,_0x3911d6){return function(_0x403915){if(!_0x403915){_0x300d5b[_0x64ae('0x26')](0x194);}return _0x403915;};}function handleError(_0xce6548,_0x3d696b){_0x3d696b=_0x3d696b||0x1f4;return function(_0x27c6a0){logger[_0x64ae('0x27')](_0x27c6a0[_0x64ae('0x28')]);if(_0x27c6a0[_0x64ae('0x29')]){delete _0x27c6a0[_0x64ae('0x29')];}_0xce6548[_0x64ae('0x1a')](_0x3d696b)['send'](_0x27c6a0);};}function getInteractionUsers(_0x57085b,_0xc87eca){return new BPromise(function(_0x51c807,_0x3c9b28){try{if(_0xc87eca[_0x57085b['id']]){_0x57085b[_0x64ae('0x2a')]=_[_0x64ae('0x2b')](_0xc87eca[_0x57085b['id']],function(_0x5441a8){return{'id':_0x5441a8['id'],'fullname':_0x5441a8[_0x64ae('0x2c')]};});}}catch(_0xc31e1d){_0x3c9b28(_0xc31e1d);}_0x51c807(_0x57085b);});}function getInteractionTags(_0x50af8d,_0x5f0ac4){return new BPromise(function(_0x5409ae,_0x224e84){try{if(_0x50af8d['TagIds']){_0x50af8d[_0x64ae('0x2d')]=[];_0x50af8d['TagIds'][_0x64ae('0x2e')](',')[_0x64ae('0x2f')](function(_0x469c64){_0x50af8d[_0x64ae('0x2d')]['push'](_0x5f0ac4[_0x469c64]);});}delete _0x50af8d['TagIds'];}catch(_0x49e109){_0x224e84(_0x49e109);}_0x5409ae(_0x50af8d);});}function updateFaxInteraction(_0x2ca15d,_0x28dfd1,_0x5d1902){return new BPromise(function(_0x4e79cf,_0x28c7d5){return getInteractionUsers(_0x2ca15d,_0x5d1902)[_0x64ae('0x30')](function(_0xdc477b){return getInteractionTags(_0xdc477b,_0x28dfd1);})[_0x64ae('0x30')](function(_0x1d1bb2){_0x4e79cf(_0x1d1bb2);})[_0x64ae('0x31')](function(_0x535728){_0x28c7d5(_0x535728);});});}exports['index']=function(_0x241cc2,_0x2844f1){var _0x39aaed={},_0x35880e={},_0x56b526={'count':0x0,'rows':[]};var _0x12e95d=_[_0x64ae('0x2b')](db[_0x64ae('0x32')][_0x64ae('0x33')],function(_0x4e9edb){return{'name':_0x4e9edb[_0x64ae('0x34')],'type':_0x4e9edb[_0x64ae('0x35')][_0x64ae('0x36')]};});_0x35880e['model']=_[_0x64ae('0x2b')](_0x12e95d,_0x64ae('0x29'));_0x35880e[_0x64ae('0x37')]=_[_0x64ae('0x38')](_0x241cc2[_0x64ae('0x37')]);_0x35880e['filters']=_[_0x64ae('0x39')](_0x35880e[_0x64ae('0x3a')],_0x35880e[_0x64ae('0x37')]);_0x39aaed[_0x64ae('0x3b')]=_[_0x64ae('0x39')](_0x35880e[_0x64ae('0x3a')],qs[_0x64ae('0x3c')](_0x241cc2['query'][_0x64ae('0x3c')]));_0x39aaed[_0x64ae('0x3b')]=_0x39aaed[_0x64ae('0x3b')]['length']?_0x39aaed[_0x64ae('0x3b')]:_0x35880e[_0x64ae('0x3a')];if(!_0x241cc2[_0x64ae('0x37')][_0x64ae('0x3d')](_0x64ae('0x3e'))){_0x39aaed[_0x64ae('0x1e')]=qs[_0x64ae('0x1e')](_0x241cc2[_0x64ae('0x37')][_0x64ae('0x1e')]);_0x39aaed['offset']=qs['offset'](_0x241cc2[_0x64ae('0x37')][_0x64ae('0x20')]);}_0x39aaed['order']=qs[_0x64ae('0x3f')](_0x241cc2['query']['sort']);_0x39aaed['where']=qs[_0x64ae('0x40')](_[_0x64ae('0x41')](_0x241cc2['query'],_0x35880e['filters']),_0x12e95d);var _0x4587c1=[];var _0x4885fd=squel[_0x64ae('0x42')]()[_0x64ae('0x43')]('id')[_0x64ae('0x43')]('name')[_0x64ae('0x43')]('color')[_0x64ae('0x44')](_0x64ae('0x45'));var _0x5aae97=squel[_0x64ae('0x42')]()[_0x64ae('0x43')](_0x64ae('0x46'))[_0x64ae('0x43')](_0x64ae('0x47'))[_0x64ae('0x43')]('ui.FaxInteractionId')[_0x64ae('0x44')](_0x64ae('0x48'),'ui')['left_join'](_0x64ae('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x5b3b0c=squel[_0x64ae('0x42')]()['from'](_0x64ae('0x4a'),'i')['left_join'](_0x64ae('0x4b'),'c',_0x64ae('0x4c'))['left_join'](_0x64ae('0x49'),'o',_0x64ae('0x4d'))[_0x64ae('0x4e')](_0x64ae('0x4f'),'a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0x64ae('0x50'),'me',_0x64ae('0x51'))[_0x64ae('0x4e')](_0x64ae('0x52'),'it',_0x64ae('0x53'))['left_join']('tools_tags','t',_0x64ae('0x54'));var _0x32fed9=squel[_0x64ae('0x55')]();var _0xad2718=[];var _0x29036c=squel[_0x64ae('0x55')]();var _0x3bc143;if(_0x241cc2['query'][_0x64ae('0x56')]){_0x3bc143=as[_0x64ae('0x57')](_0x241cc2[_0x64ae('0x37')][_0x64ae('0x56')]);var _0x519e73=_0x3bc143['sqlOperator'];for(var _0x19a5c7=0x0;_0x19a5c7<_0x3bc143[_0x64ae('0x58')][_0x64ae('0x59')];_0x19a5c7++){var _0x18f404=_0x3bc143[_0x64ae('0x58')][_0x19a5c7];var _0x2da46b='i';var _0x504ea8=_['find'](_0x12e95d,[_0x64ae('0x29'),_0x18f404[_0x64ae('0x43')]]);if(!_0x504ea8){switch(_0x18f404[_0x64ae('0x43')]){case _0x64ae('0x5a'):if(_0x18f404['value']==0x1){_0x5b3b0c[_0x64ae('0x5b')]('`'+_0x18f404[_0x64ae('0x43')]+_0x64ae('0x5c'));}else{_0x5b3b0c[_0x64ae('0x5b')]('`'+_0x18f404['field']+_0x64ae('0x5d'));}break;case'Contact':if(_0x18f404[_0x64ae('0x5e')]===_0x64ae('0x5f')){if(_0x18f404['value'][_0x64ae('0x2e')]('\x20')[_0x64ae('0x59')]>0x1){_0x32fed9[_0x519e73](_0x64ae('0x60'),qs[_0x64ae('0x61')](_0x18f404[_0x64ae('0x62')]),null);}else{var _0xc2c2d7='%'+_0x18f404[_0x64ae('0x62')]+'%';_0x32fed9[_0x519e73](_0x64ae('0x63'),_0xc2c2d7,_0xc2c2d7,_0xc2c2d7);}}else{_0x504ea8=_[_0x64ae('0x64')](_0x12e95d,[_0x64ae('0x29'),'ContactId']);_0x18f404['field']='ContactId';_0x5a3183=as['buildExpression'](_0x2da46b,_0x504ea8['type'],_0x18f404);_0x32fed9[_0x519e73](_0x5a3183[_0x64ae('0x65')],_0x5a3183['value'][_0x64ae('0x66')],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x1b')]);}break;case'Tag':var _0x473e0d=_0x18f404[_0x64ae('0x62')][_0x64ae('0x2e')](',')[_0x64ae('0x2b')](function(_0x26ff44){return Number(_0x26ff44);});_0x473e0d[_0x64ae('0x2f')](function(_0x430a96){_0x29036c['or'](_0x64ae('0x67'),'%,'+_0x430a96+',%');});_0xad2718=_[_0x64ae('0x68')](_0xad2718,_0x473e0d);break;case _0x64ae('0x69'):if(_0x18f404[_0x64ae('0x5e')]==='$substring'){_0x32fed9[_0x519e73]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x18f404[_0x64ae('0x62')]+'%',null);}else{_0x504ea8=_[_0x64ae('0x64')](_0x12e95d,[_0x64ae('0x29'),_0x64ae('0x6a')]);_0x18f404['field']=_0x64ae('0x6a');_0x5a3183=as['buildExpression'](_0x2da46b,_0x504ea8[_0x64ae('0x35')],_0x18f404);_0x32fed9[_0x519e73](_0x5a3183['text'],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x66')],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x1b')]);}break;case _0x64ae('0x6b'):_0x5a3183=as[_0x64ae('0x6c')]('me',null,_0x18f404);_0x32fed9[_0x519e73](_0x5a3183[_0x64ae('0x65')],_0x5a3183[_0x64ae('0x62')]['start'],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x1b')]);break;}}else{var _0x5a3183=as['buildExpression'](_0x2da46b,_0x504ea8[_0x64ae('0x35')],_0x18f404);_0x32fed9[_0x519e73](_0x5a3183[_0x64ae('0x65')],_0x5a3183['value'][_0x64ae('0x66')],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x1b')]);}}}else{var _0x8159bd=_(_0x241cc2[_0x64ae('0x37')])[_0x64ae('0x38')]()[_0x64ae('0x2b')](function(_0x5eec47){return _['some'](_0x12e95d,[_0x64ae('0x29'),_0x5eec47])?_0x5eec47:undefined;})[_0x64ae('0x6d')]()[_0x64ae('0x62')]();if(!_[_0x64ae('0x6e')](_0x8159bd)){_0x8159bd[_0x64ae('0x2f')](function(_0x41f1f4){if(_0x41f1f4===_0x64ae('0x6f')){_0x5b3b0c[_0x64ae('0x70')](_0x64ae('0x71'),[][_0x64ae('0x72')](_0x241cc2[_0x64ae('0x37')][_0x41f1f4]));}else if(_0x41f1f4==='createdAt'){var _0xc428ef=JSON[_0x64ae('0x73')](_0x241cc2[_0x64ae('0x37')][_0x41f1f4])[_0x64ae('0x74')];var _0x3a3436=JSON[_0x64ae('0x73')](_0x241cc2[_0x64ae('0x37')][_0x41f1f4])[_0x64ae('0x75')];_0x5b3b0c[_0x64ae('0x70')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc428ef,_0x3a3436);}else{if(_0x241cc2['query'][_0x41f1f4]===_0x64ae('0x76')){_0x5b3b0c[_0x64ae('0x70')]('i.'+_0x41f1f4+'\x20IS\x20NULL');}else{_0x5b3b0c[_0x64ae('0x70')]('i.'+_0x41f1f4+_0x64ae('0x77'),_0x241cc2[_0x64ae('0x37')][_0x41f1f4]);}}});}if(_0x241cc2[_0x64ae('0x37')]['read']){if(_0x241cc2['query'][_0x64ae('0x78')]==0x1){_0x5b3b0c['having'](_0x64ae('0x79'));}else{_0x5b3b0c[_0x64ae('0x5b')](_0x64ae('0x7a'));}}if(_0x241cc2[_0x64ae('0x37')][_0x64ae('0x7b')]){_0xad2718=_['isArray'](_0x241cc2[_0x64ae('0x37')][_0x64ae('0x7b')])?_0x241cc2['query'][_0x64ae('0x7b')]:new Array(_0x241cc2[_0x64ae('0x37')]['tag']);_0xad2718[_0x64ae('0x2f')](function(_0x298833){_0x29036c['or'](_0x64ae('0x67'),'%,'+_0x298833+',%');});}if(_0x241cc2[_0x64ae('0x37')][_0x64ae('0x7c')]){var _0x189989=_0x241cc2[_0x64ae('0x37')][_0x64ae('0x7c')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x64ae('0x7d')](_0x189989)){_0x32fed9['or']('i.id\x20LIKE\x20?',_0x189989+'%')['or'](_0x64ae('0x7e'),_0x189989+'%');}_0x32fed9['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x189989+'%');}}_0x5b3b0c[_0x64ae('0x70')](_0x32fed9);_0x5b3b0c[_0x64ae('0x7f')](_0x64ae('0x80'));var _0x2ef91f={'type':db[_0x64ae('0x81')]['QueryTypes'][_0x64ae('0x82')],'raw':!![]};var _0x511cd2=_0x5b3b0c['clone']();_0x511cd2[_0x64ae('0x43')](_0x64ae('0x80'));_0x511cd2[_0x64ae('0x43')](_0x64ae('0x83'),_0x64ae('0x5a'));if(_0x39aaed[_0x64ae('0x84')]){_0x39aaed[_0x64ae('0x84')][_0x64ae('0x2f')](function(_0x1ffdb1){var _0x22676a=_0x1ffdb1[0x0]===_0x64ae('0x85')?_0x1ffdb1[0x0]:'i.'+_0x1ffdb1[0x0];_0x5b3b0c[_0x64ae('0x84')](_0x22676a,_0x1ffdb1[0x1]===_0x64ae('0x86')?![]:!![]);});}if(!_[_0x64ae('0x6e')](_0xad2718)){_0x5b3b0c['having'](_0x29036c);_0x511cd2[_0x64ae('0x70')](_0x64ae('0x87'),_0xad2718);}BPromise[_0x64ae('0x88')]()[_0x64ae('0x30')](function(){if(!_0x3bc143){if(_0x241cc2['query']['FaxAccountId'])return;_0x511cd2[_0x64ae('0x70')](_0x64ae('0x89'));_0x5b3b0c[_0x64ae('0x70')](_0x64ae('0x89'));return;}if(_0x241cc2[_0x64ae('0x8a')][_0x64ae('0x8b')]!==_0x64ae('0x8c'))return;return _0x241cc2[_0x64ae('0x8a')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x64ae('0x30')](function(_0x3b9458){if(_[_0x64ae('0x6e')](_0x3b9458)){_0x511cd2[_0x64ae('0x70')](_0x64ae('0x8d'));_0x5b3b0c[_0x64ae('0x70')](_0x64ae('0x8d'));}else{_0x511cd2[_0x64ae('0x70')]('i.FaxAccountId\x20IN\x20?',_[_0x64ae('0x2b')](_0x3b9458,'id'));_0x5b3b0c[_0x64ae('0x70')](_0x64ae('0x71'),_['map'](_0x3b9458,'id'));}});})[_0x64ae('0x30')](function(){if(_0x241cc2['user']['role']===_0x64ae('0x8c')&&!_0x3bc143&&!_0x241cc2[_0x64ae('0x37')][_0x64ae('0x6f')])return[];return db[_0x64ae('0x8e')]['query'](_0x511cd2[_0x64ae('0x8f')](),_0x2ef91f);})[_0x64ae('0x30')](function(_0x50d10b){_0x56b526['count']=_0x50d10b[_0x64ae('0x59')];if(_0x56b526['count']===0x0)return[];return db['sequelize'][_0x64ae('0x37')](_0x4885fd[_0x64ae('0x8f')](),_0x2ef91f)[_0x64ae('0x30')](function(_0x13e4c5){_0x4587c1=_[_0x64ae('0x90')](_0x13e4c5,'id');_0x2ef91f=_[_0x64ae('0x91')](_0x2ef91f,{'model':db[_0x64ae('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x241cc2[_0x64ae('0x37')][_0x64ae('0x3c')]){_0x39aaed[_0x64ae('0x3b')]['forEach'](function(_0x40f3e1){_0x5b3b0c[_0x64ae('0x43')]('i.'+_0x40f3e1);});}else{_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x83'),'unreadMessages');_0x5b3b0c['field'](_0x64ae('0x92'),_0x64ae('0x93'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x94'),'Account.mandatoryDisposition');_0x5b3b0c['field'](_0x64ae('0x95'),_0x64ae('0x85'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x96'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x97'),_0x64ae('0x98'));_0x5b3b0c['field'](_0x64ae('0x99'),_0x64ae('0x9a'));_0x5b3b0c[_0x64ae('0x43')]('c.email','Contact.email');_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x9b'),_0x64ae('0x9c'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x9d'),_0x64ae('0x9e'));_0x5b3b0c[_0x64ae('0x43')]('c.fax',_0x64ae('0x9f'));_0x5b3b0c['field'](_0x64ae('0xa0'),_0x64ae('0xa1'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0xa2'),_0x64ae('0xa3'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0xa4'),_0x64ae('0xa5'));}if(_0x39aaed[_0x64ae('0x1e')])_0x5b3b0c[_0x64ae('0x1e')](_0x39aaed[_0x64ae('0x1e')]);if(_0x39aaed[_0x64ae('0x20')])_0x5b3b0c['offset'](_0x39aaed[_0x64ae('0x20')]);return db['sequelize'][_0x64ae('0x37')](_0x5b3b0c['toString'](),_0x2ef91f);})['then'](function(_0x3c67d2){if(_0x3c67d2[_0x64ae('0x59')]>0x0)_0x5aae97[_0x64ae('0x70')](_0x64ae('0xa6'),_[_0x64ae('0x2b')](_0x3c67d2,'id'));return db['sequelize'][_0x64ae('0x37')](_0x5aae97['toString'](),_0x2ef91f)[_0x64ae('0x30')](function(_0x99cd9d){var _0x2ff550=_[_0x64ae('0xa7')](_0x99cd9d,'FaxInteractionId');var _0x1bb7bc=[];_0x3c67d2[_0x64ae('0x2f')](function(_0x59cece){_0x1bb7bc[_0x64ae('0xa8')](updateFaxInteraction(_0x59cece,_0x4587c1,_0x2ff550));});return BPromise[_0x64ae('0xa9')](_0x1bb7bc);});});})[_0x64ae('0x30')](function(_0x5abd25){_0x56b526[_0x64ae('0xaa')]=_0x5abd25;return _0x56b526;})[_0x64ae('0x30')](respondWithFilteredResult(_0x2844f1,_0x39aaed))[_0x64ae('0x31')](handleError(_0x2844f1,null));};exports[_0x64ae('0xab')]=function(_0x453841,_0x43e72c){var _0x2f2792={'raw':![],'where':{'id':_0x453841[_0x64ae('0xac')]['id']}},_0x3dee04={};_0x3dee04[_0x64ae('0x3a')]=_[_0x64ae('0x38')](db[_0x64ae('0x32')][_0x64ae('0x33')]);_0x3dee04[_0x64ae('0x37')]=_[_0x64ae('0x38')](_0x453841[_0x64ae('0x37')]);_0x3dee04[_0x64ae('0x40')]=_['intersection'](_0x3dee04[_0x64ae('0x3a')],_0x3dee04['query']);_0x2f2792[_0x64ae('0x3b')]=_[_0x64ae('0x39')](_0x3dee04[_0x64ae('0x3a')],qs[_0x64ae('0x3c')](_0x453841[_0x64ae('0x37')][_0x64ae('0x3c')]));_0x2f2792[_0x64ae('0x3b')]=_0x2f2792[_0x64ae('0x3b')][_0x64ae('0x59')]?_0x2f2792[_0x64ae('0x3b')]:_0x3dee04[_0x64ae('0x3a')];if(_0x453841[_0x64ae('0x37')]['includeAll']){_0x2f2792[_0x64ae('0xad')]=[{'all':!![]}];}_0x2f2792=_[_0x64ae('0x91')]({},_0x2f2792,_0x453841[_0x64ae('0xae')]);return db['FaxInteraction'][_0x64ae('0x64')](_0x2f2792)[_0x64ae('0x30')](handleEntityNotFound(_0x43e72c,null))[_0x64ae('0x30')](respondWithResult(_0x43e72c,null))[_0x64ae('0x31')](handleError(_0x43e72c,null));};exports['create']=function(_0x3a3262,_0x29feb0){return db[_0x64ae('0x32')]['create'](_0x3a3262[_0x64ae('0x6b')],{})[_0x64ae('0x30')](respondWithResult(_0x29feb0,0xc9))[_0x64ae('0x31')](handleError(_0x29feb0,null));};exports[_0x64ae('0x24')]=function(_0x3f8fa2,_0xf42701){if(_0x3f8fa2['body']['id']){delete _0x3f8fa2[_0x64ae('0x6b')]['id'];}return db[_0x64ae('0x32')][_0x64ae('0x64')]({'where':{'id':_0x3f8fa2[_0x64ae('0xac')]['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0xf42701,null))[_0x64ae('0x30')](saveUpdates(_0x3f8fa2['body'],null))[_0x64ae('0x30')](respondWithResult(_0xf42701,null))[_0x64ae('0x31')](handleError(_0xf42701,null));};exports[_0x64ae('0x25')]=function(_0x240aee,_0x262119){return db[_0x64ae('0x32')][_0x64ae('0x64')]({'where':{'id':_0x240aee['params']['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0x262119,null))['then'](removeEntity(_0x262119,null))['catch'](handleError(_0x262119,null));};exports[_0x64ae('0xaf')]=function(_0x4feff6,_0x17d293){return db['FaxInteraction']['describe']()[_0x64ae('0x30')](respondWithResult(_0x17d293,null))[_0x64ae('0x31')](handleError(_0x17d293,null));};exports[_0x64ae('0xb0')]=function(_0x24d040,_0x358f05,_0xc84213){return db[_0x64ae('0xb1')][_0x64ae('0x64')]({'where':{'id':_0x24d040[_0x64ae('0xac')]['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0x358f05,null))[_0x64ae('0x30')](function(_0x262b3d){if(_0x262b3d){return _0x262b3d['addMessage'](_0x24d040['body']['ids'],_[_0x64ae('0xb2')](_0x24d040[_0x64ae('0x6b')],['ids','id'])||{});}})[_0x64ae('0x30')](respondWithResult(_0x358f05,null))[_0x64ae('0x31')](handleError(_0x358f05,null));};exports[_0x64ae('0xb3')]=function(_0x82c9e6,_0xf9acd6,_0x78723d){var _0x15c517={'raw':![],'where':{}};var _0x181b65={};var _0x1c17e0={'count':0x0,'rows':[]};return db[_0x64ae('0x32')][_0x64ae('0xb4')]({'where':{'id':_0x82c9e6[_0x64ae('0xac')]['id']}})['then'](handleEntityNotFound(_0xf9acd6,null))['then'](function(_0x52f2a6){if(_0x52f2a6){_0x181b65[_0x64ae('0x3a')]=_[_0x64ae('0x38')](db['FaxMessage'][_0x64ae('0x33')]);_0x181b65[_0x64ae('0x37')]=_['keys'](_0x82c9e6[_0x64ae('0x37')]);_0x181b65[_0x64ae('0x40')]=_[_0x64ae('0x39')](_0x181b65['model'],_0x181b65['query']);_0x15c517[_0x64ae('0x3b')]=_[_0x64ae('0x39')](_0x181b65['model'],qs[_0x64ae('0x3c')](_0x82c9e6['query']['fields']));_0x15c517[_0x64ae('0x3b')]=_0x15c517[_0x64ae('0x3b')][_0x64ae('0x59')]?_0x15c517[_0x64ae('0x3b')]:_0x181b65[_0x64ae('0x3a')];if(!_0x82c9e6[_0x64ae('0x37')][_0x64ae('0x3d')]('nolimit')){_0x15c517[_0x64ae('0x1e')]=qs['limit'](_0x82c9e6[_0x64ae('0x37')]['limit']);_0x15c517[_0x64ae('0x20')]=qs[_0x64ae('0x20')](_0x82c9e6[_0x64ae('0x37')][_0x64ae('0x20')]);}_0x15c517[_0x64ae('0x84')]=qs['sort'](_0x82c9e6[_0x64ae('0x37')]['sort']);_0x15c517[_0x64ae('0x70')]=qs[_0x64ae('0x40')](_[_0x64ae('0x41')](_0x82c9e6['query'],_0x181b65['filters']));_0x15c517[_0x64ae('0x70')]['FaxInteractionId']=_0x52f2a6['id'];if(_0x82c9e6['query']['filter']){_0x15c517['where']=_[_0x64ae('0x91')](_0x15c517[_0x64ae('0x70')],{'$or':_['map'](_0x15c517[_0x64ae('0x3b')],function(_0x3afd6c){var _0x1ca017={};_0x1ca017[_0x3afd6c]={'$like':'%'+_0x82c9e6[_0x64ae('0x37')][_0x64ae('0x7c')]+'%'};return _0x1ca017;})});}if(_0x82c9e6[_0x64ae('0x37')]['$gte']){var _0x5135cb=_0x82c9e6['query']['$gte'][_0x64ae('0x2e')](',');var _0x3a5561={};_0x3a5561[_0x5135cb[0x0]]={'$gte':moment(_0x5135cb[0x1])['format'](_0x64ae('0xb5'))};_0x15c517['where']=_['merge'](_0x15c517['where'],_0x3a5561);}_0x15c517=_[_0x64ae('0x91')]({},_0x15c517,_0x82c9e6[_0x64ae('0xae')]);return db[_0x64ae('0xb1')]['count']({'where':_0x15c517[_0x64ae('0x70')]})[_0x64ae('0x30')](function(_0x1568dc){_0x1c17e0[_0x64ae('0x1f')]=_0x1568dc;if(_0x82c9e6[_0x64ae('0x37')][_0x64ae('0xb6')]){_0x15c517[_0x64ae('0xad')]=[{'all':!![]}];}return db[_0x64ae('0xb1')][_0x64ae('0xb7')](_0x15c517);})[_0x64ae('0x30')](function(_0x4e43a1){_0x1c17e0['rows']=_0x4e43a1;return _0x1c17e0;});}})[_0x64ae('0x30')](respondWithFilteredResult(_0xf9acd6,_0x15c517))[_0x64ae('0x31')](handleError(_0xf9acd6,null));};exports[_0x64ae('0xb8')]=function(_0x34d31d,_0x2fc955,_0x1f8613){return db['FaxInteraction']['find']({'where':{'id':_0x34d31d[_0x64ae('0xac')]['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0x2fc955,null))[_0x64ae('0x30')](function(_0xb4162d){if(_0xb4162d){return _0xb4162d[_0x64ae('0xb9')](_0x34d31d[_0x64ae('0x6b')][_0x64ae('0xba')],_[_0x64ae('0xb2')](_0x34d31d[_0x64ae('0x6b')],[_0x64ae('0xba'),'id'])||{})['spread'](function(){return db[_0x64ae('0xbb')][_0x64ae('0xb7')]({'attributes':['id','name',_0x64ae('0xbc')],'where':{'id':_0x34d31d[_0x64ae('0x6b')][_0x64ae('0xba')]}});})['then'](function(_0x1e0672){socket['emit'](_0x64ae('0xbd'),{'id':Number(_0x34d31d[_0x64ae('0xac')]['id']),'tags':_0x1e0672||[]});return{'id':Number(_0x34d31d['params']['id']),'tags':_0x1e0672||[]};});}})[_0x64ae('0x30')](respondWithResult(_0x2fc955,null))[_0x64ae('0x31')](handleError(_0x2fc955,null));};exports[_0x64ae('0xbe')]=function(_0x3a577e,_0x153acd,_0x5f3c30){return db[_0x64ae('0x32')]['find']({'where':{'id':_0x3a577e['params']['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0x153acd,null))[_0x64ae('0x30')](function(_0x23d9e2){if(_0x23d9e2){return _0x23d9e2[_0x64ae('0xbe')](_0x3a577e[_0x64ae('0x37')][_0x64ae('0xba')]);}})[_0x64ae('0x30')](respondWithStatusCode(_0x153acd,null))[_0x64ae('0x31')](handleError(_0x153acd,null));};exports['download']=function(_0x433175,_0x5a71e6){var _0x48d654=moment()['unix']()[_0x64ae('0x8f')]();var _0x5556f8=path[_0x64ae('0xbf')](config['root'],_0x64ae('0xc0'),_0x64ae('0xc1'),_0x64ae('0xc2'));var _0x5ce687=path[_0x64ae('0xbf')](config[_0x64ae('0xc3')],'server',_0x64ae('0xc1'),_0x64ae('0xc4'));var _0x381c0e=path[_0x64ae('0xbf')](_0x5556f8,_0x48d654);var _0xe8e438=util['format'](_0x64ae('0xc5'),_0x433175[_0x64ae('0xac')]['id'],_0x48d654);var _0x38eb2b=path['join'](_0x5556f8,_0xe8e438);var _0x9ae352=[];_0x9ae352['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x3ae475=[{'model':db[_0x64ae('0xb1')],'as':_0x64ae('0xc6'),'attributes':['id',_0x64ae('0x6b'),'createdAt'],'include':_0x9ae352}];return db[_0x64ae('0x32')]['find']({'where':{'id':_0x433175[_0x64ae('0xac')]['id']},'include':_0x3ae475})[_0x64ae('0x30')](handleEntityNotFound(_0x5a71e6,null))[_0x64ae('0x30')](function(_0x2e3d16){if(_0x2e3d16&&_0x2e3d16[_0x64ae('0xc6')]){var _0x2a933=_0x2e3d16[_0x64ae('0xc7')]({'plain':!![]});fs[_0x64ae('0xc8')](_0x381c0e);for(var _0x5d87b2=0x0;_0x5d87b2<_0x2a933['Messages'][_0x64ae('0x59')];_0x5d87b2++){var _0x12bce5=_0x2a933['Messages'][_0x5d87b2][_0x64ae('0xc9')];if(_0x12bce5){var _0x1257e0=path['join'](_0x5ce687,_0x12bce5[_0x64ae('0xca')]);if(fs[_0x64ae('0xcb')](_0x1257e0)){fs['createReadStream'](_0x1257e0)['pipe'](fs[_0x64ae('0xcc')](path[_0x64ae('0xbf')](_0x381c0e,_0x12bce5[_0x64ae('0xca')])));}}}return BPromise[_0x64ae('0x88')]()['then'](function(){return new BPromise(function(_0xf4c60b,_0x26b304){zipdir(_0x381c0e,{'saveTo':_0x38eb2b},function(_0x5f1241,_0x32f6be){if(_0x5f1241)return _0x26b304(_0x5f1241);return _0xf4c60b(_0x32f6be);});})[_0x64ae('0x30')](function(){return new BPromise(function(_0x20ccbd,_0x2ba311){rimraf(_0x381c0e,function(_0x8ac296){if(_0x8ac296)_0x2ba311(_0x8ac296);return _0x20ccbd();});});})[_0x64ae('0x30')](function(){return _0x5a71e6[_0x64ae('0xcd')](_0x38eb2b,_0xe8e438,function(_0x37a2c5){if(_0x37a2c5){console[_0x64ae('0xce')](_0x64ae('0xcf'),_0x37a2c5);}else{fs[_0x64ae('0xd0')](_0x38eb2b);}});});});}else{return _0x5a71e6[_0x64ae('0x26')](0xc8);}})[_0x64ae('0x31')](handleError(_0x5a71e6,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index c81d60d..e99f27c 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 _0x6949=['Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','getUsers','then','setDataValue'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x6949,0x15c));var _0x9694=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x6949[_0x47e549];return _0x251374;};'use strict';var EventEmitter=require(_0x9694('0x0'));var FaxInteraction=require(_0x9694('0x1'))['db'][_0x9694('0x2')];var FaxMessage=require(_0x9694('0x1'))['db'][_0x9694('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9694('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9694('0x5'),'afterDestroy':'remove'};function emitEvent(_0x20ac88){return function(_0x5077c6,_0x32618d,_0x47a843){_0x5077c6[_0x9694('0x6')]({'attributes':['id'],'raw':!![]})[_0x9694('0x7')](function(_0x43b19b){_0x5077c6[_0x9694('0x8')](_0x9694('0x9'),_0x43b19b[_0x9694('0xa')](function(_0x408081){return{'id':_0x408081['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x5077c6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9694('0x7')](function(_0x56c953){_0x5077c6[_0x9694('0x8')](_0x9694('0xb'),_0x56c953[_0x9694('0xc')]);FaxInteractionEvents[_0x9694('0xd')](_0x20ac88+':'+_0x5077c6['id'],_0x5077c6);FaxInteractionEvents['emit'](_0x20ac88,_0x5077c6);_0x47a843(null);})[_0x9694('0xe')](_0x47a843(null));};}for(var e in events){if(events[_0x9694('0xf')](e)){var event=events[e];FaxInteraction[_0x9694('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x153d=['remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update'];(function(_0xf489a7,_0x48445b){var _0x4ee42c=function(_0x543e0e){while(--_0x543e0e){_0xf489a7['push'](_0xf489a7['shift']());}};_0x4ee42c(++_0x48445b);}(_0x153d,0x19c));var _0xd153=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x153d[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0xd153('0x0'));var FaxInteraction=require(_0xd153('0x1'))['db'][_0xd153('0x2')];var FaxMessage=require(_0xd153('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xd153('0x3')](0x0);var events={'afterCreate':_0xd153('0x4'),'afterUpdate':_0xd153('0x5'),'afterDestroy':_0xd153('0x6')};function emitEvent(_0xe565eb){return function(_0x467bfd,_0x2ef1e0,_0x56b65b){_0x467bfd[_0xd153('0x7')]({'attributes':['id'],'raw':!![]})[_0xd153('0x8')](function(_0x25440a){_0x467bfd['setDataValue'](_0xd153('0x9'),_0x25440a[_0xd153('0xa')](function(_0x53f892){return{'id':_0x53f892['id']};}));return FaxMessage[_0xd153('0xb')]({'where':{'FaxInteractionId':_0x467bfd['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd153('0x8')](function(_0x1fbd90){_0x467bfd[_0xd153('0xc')](_0xd153('0xd'),_0x1fbd90[_0xd153('0xe')]);FaxInteractionEvents[_0xd153('0xf')](_0xe565eb+':'+_0x467bfd['id'],_0x467bfd);FaxInteractionEvents['emit'](_0xe565eb,_0x467bfd);_0x56b65b(null);})['catch'](_0x56b65b(null));};}for(var e in events){if(events[_0xd153('0x10')](e)){var event=events[e];FaxInteraction[_0xd153('0x11')](e,emitEvent(event));}}module[_0xd153('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 049699d..c671fa5 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 _0x1a8d=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format'];(function(_0x421850,_0x3b219f){var _0x3da623=function(_0x3dac98){while(--_0x3dac98){_0x421850['push'](_0x421850['shift']());}};_0x3da623(++_0x3b219f);}(_0x1a8d,0x89));var _0xd1a8=function(_0x336d19,_0x3767d0){_0x336d19=_0x336d19-0x0;var _0x419656=_0x1a8d[_0x336d19];return _0x419656;};'use strict';var _=require('lodash');var util=require(_0xd1a8('0x0'));var logger=require(_0xd1a8('0x1'))(_0xd1a8('0x2'));var moment=require('moment');var BPromise=require(_0xd1a8('0x3'));var rp=require(_0xd1a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1a8('0x5'));var config=require(_0xd1a8('0x6'));var attributes=require(_0xd1a8('0x7'));module[_0xd1a8('0x8')]=function(_0x1944c5,_0x4ac337){return _0x1944c5[_0xd1a8('0x9')](_0xd1a8('0xa'),attributes,{'tableName':_0xd1a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x364504,_0x5d3db4,_0x432688){if(_0x364504[_0xd1a8('0xc')](_0xd1a8('0xd'))){_0x364504[_0xd1a8('0xe')]=moment()[_0xd1a8('0xf')](_0xd1a8('0x10'));}_0x432688(null,_0x364504);}}});}; \ No newline at end of file +var _0x9905=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x206839,_0x4494e5){var _0x3dfebd=function(_0x566b91){while(--_0x566b91){_0x206839['push'](_0x206839['shift']());}};_0x3dfebd(++_0x4494e5);}(_0x9905,0x130));var _0x5990=function(_0x57c076,_0x51bda7){_0x57c076=_0x57c076-0x0;var _0x42ce8c=_0x9905[_0x57c076];return _0x42ce8c;};'use strict';var _=require(_0x5990('0x0'));var util=require(_0x5990('0x1'));var logger=require(_0x5990('0x2'))(_0x5990('0x3'));var moment=require(_0x5990('0x4'));var BPromise=require(_0x5990('0x5'));var rp=require(_0x5990('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5990('0x7'));var config=require(_0x5990('0x8'));var attributes=require(_0x5990('0x9'));module[_0x5990('0xa')]=function(_0x92e917,_0x497a45){return _0x92e917[_0x5990('0xb')](_0x5990('0xc'),attributes,{'tableName':_0x5990('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x371b29,_0x4c0d43,_0x54cfba){if(_0x371b29[_0x5990('0xe')](_0x5990('0xf'))){_0x371b29['closedAt']=moment()[_0x5990('0x10')](_0x5990('0x11'));}_0x54cfba(null,_0x371b29);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 76b7c5f..59f3050 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 _0x8767=['../../config/logger','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','info','debug','AddTagsToFaxInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8767,0xe4));var _0x7876=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8767[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7876('0x0'));var util=require(_0x7876('0x1'));var moment=require(_0x7876('0x2'));var BPromise=require(_0x7876('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7876('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7876('0x5'));var logger=require(_0x7876('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7876('0x7')]({'port':0x232a});config[_0x7876('0x8')]=_[_0x7876('0x9')](config['redis'],{'host':_0x7876('0xa'),'port':0x18eb});var socket=require(_0x7876('0xb'))(new Redis(config[_0x7876('0x8')]));require(_0x7876('0xc'))[_0x7876('0xd')](socket);function respondWithRpcPromise(_0x3abd48,_0x3a1120,_0x272067){return new BPromise(function(_0x32bd18,_0x3d90c2){return client[_0x7876('0xe')](_0x3abd48,_0x272067)[_0x7876('0xf')](function(_0x1e639d){logger['info'](_0x7876('0x10'),_0x3a1120,_0x7876('0x11'));logger['debug'](_0x7876('0x12'),_0x3a1120,_0x7876('0x11'),JSON[_0x7876('0x13')](_0x1e639d));if(_0x1e639d[_0x7876('0x14')]){if(_0x1e639d[_0x7876('0x14')][_0x7876('0x15')]===0x1f4){logger['error'](_0x7876('0x10'),_0x3a1120,_0x1e639d[_0x7876('0x14')][_0x7876('0x16')]);return _0x3d90c2(_0x1e639d[_0x7876('0x14')]['message']);}logger[_0x7876('0x14')](_0x7876('0x10'),_0x3a1120,_0x1e639d[_0x7876('0x14')]['message']);return _0x32bd18(_0x1e639d['error'][_0x7876('0x16')]);}else{logger['info'](_0x7876('0x10'),_0x3a1120,_0x7876('0x11'));_0x32bd18(_0x1e639d[_0x7876('0x17')][_0x7876('0x16')]);}})[_0x7876('0x18')](function(_0x436f03){logger[_0x7876('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x3a1120,_0x436f03);_0x3d90c2(_0x436f03);});});}exports[_0x7876('0x19')]=function(_0x17ae3a){var _0xad3fb8=this;return new Promise(function(_0x2a7b4f,_0x4df926){return db[_0x7876('0x1a')][_0x7876('0x1b')](_0x17ae3a[_0x7876('0x1c')],{'raw':_0x17ae3a[_0x7876('0x1d')]?_0x17ae3a[_0x7876('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17ae3a[_0x7876('0x1d')]?_0x17ae3a['options'][_0x7876('0x1e')]||null:null,'attributes':_0x17ae3a[_0x7876('0x1d')]?_0x17ae3a[_0x7876('0x1d')][_0x7876('0x1f')]||null:null,'limit':_0x17ae3a[_0x7876('0x1d')]?_0x17ae3a[_0x7876('0x1d')]['limit']||null:null})[_0x7876('0xf')](function(_0x36a44d){logger[_0x7876('0x20')](_0x7876('0x19'),_0x17ae3a);logger[_0x7876('0x21')](_0x7876('0x19'),_0x17ae3a,JSON['stringify'](_0x36a44d));_0x2a7b4f(_0x36a44d);})[_0x7876('0x18')](function(_0x5a3851){logger['error'](_0x7876('0x19'),_0x5a3851['message'],_0x17ae3a);_0x4df926(_0xad3fb8[_0x7876('0x14')](0x1f4,_0x5a3851[_0x7876('0x16')]));});});};exports[_0x7876('0x22')]=function(_0x36171a){return new Promise(function(_0x15e618,_0x29e2ea){return db[_0x7876('0x1a')]['find']({'where':_0x36171a[_0x7876('0x1d')]?_0x36171a[_0x7876('0x1d')][_0x7876('0x1e')]||null:null})[_0x7876('0xf')](function(_0x2d80da){if(_0x2d80da){return _0x2d80da[_0x7876('0x23')](_0x36171a[_0x7876('0x1c')]['ids'],_['omit'](_0x36171a[_0x7876('0x1c')],[_0x7876('0x24'),'id'])||{});}})[_0x7876('0x25')](function(_0x31444c){logger[_0x7876('0x20')](_0x7876('0x26'),_0x36171a);logger[_0x7876('0x21')]('AddTags',_0x36171a,JSON[_0x7876('0x13')](_0x31444c));_0x15e618(_0x31444c);})[_0x7876('0x18')](function(_0x40a49a){logger[_0x7876('0x14')](_0x7876('0x26'),_0x40a49a['message'],_0x36171a);_0x29e2ea(_this['error'](0x1f4,_0x40a49a[_0x7876('0x16')]));});});}; \ No newline at end of file +var _0xb225=['register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','body','options','raw','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket'];(function(_0x497e22,_0x339077){var _0x170ec9=function(_0x19d105){while(--_0x19d105){_0x497e22['push'](_0x497e22['shift']());}};_0x170ec9(++_0x339077);}(_0xb225,0x1e9));var _0x5b22=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0xb225[_0x4db46b];return _0x565be8;};'use strict';var _=require(_0x5b22('0x0'));var util=require(_0x5b22('0x1'));var moment=require('moment');var BPromise=require(_0x5b22('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b22('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b22('0x4'))(_0x5b22('0x5'));var config=require(_0x5b22('0x6'));var jayson=require(_0x5b22('0x7'));var client=jayson[_0x5b22('0x8')][_0x5b22('0x9')]({'port':0x232a});config[_0x5b22('0xa')]=_[_0x5b22('0xb')](config[_0x5b22('0xa')],{'host':_0x5b22('0xc'),'port':0x18eb});var socket=require(_0x5b22('0xd'))(new Redis(config[_0x5b22('0xa')]));require(_0x5b22('0xe'))[_0x5b22('0xf')](socket);function respondWithRpcPromise(_0x556783,_0x343dfc,_0x53fb68){return new BPromise(function(_0x56bc8d,_0x222f71){return client[_0x5b22('0x10')](_0x556783,_0x53fb68)[_0x5b22('0x11')](function(_0x1b8fc2){logger[_0x5b22('0x12')](_0x5b22('0x13'),_0x343dfc,_0x5b22('0x14'));logger[_0x5b22('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x343dfc,_0x5b22('0x14'),JSON[_0x5b22('0x16')](_0x1b8fc2));if(_0x1b8fc2['error']){if(_0x1b8fc2['error'][_0x5b22('0x17')]===0x1f4){logger[_0x5b22('0x18')](_0x5b22('0x13'),_0x343dfc,_0x1b8fc2[_0x5b22('0x18')]['message']);return _0x222f71(_0x1b8fc2[_0x5b22('0x18')][_0x5b22('0x19')]);}logger[_0x5b22('0x18')](_0x5b22('0x13'),_0x343dfc,_0x1b8fc2[_0x5b22('0x18')][_0x5b22('0x19')]);return _0x56bc8d(_0x1b8fc2[_0x5b22('0x18')][_0x5b22('0x19')]);}else{logger[_0x5b22('0x12')](_0x5b22('0x13'),_0x343dfc,'request\x20sent');_0x56bc8d(_0x1b8fc2[_0x5b22('0x1a')][_0x5b22('0x19')]);}})[_0x5b22('0x1b')](function(_0x2a3b8d){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x343dfc,_0x2a3b8d);_0x222f71(_0x2a3b8d);});});}exports['UpdateFaxInteraction']=function(_0x231e17){var _0x3886f3=this;return new Promise(function(_0x75c20e,_0x1c3420){return db['FaxInteraction']['update'](_0x231e17[_0x5b22('0x1c')],{'raw':_0x231e17[_0x5b22('0x1d')]?_0x231e17[_0x5b22('0x1d')][_0x5b22('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x231e17['options']?_0x231e17[_0x5b22('0x1d')][_0x5b22('0x1f')]||null:null,'attributes':_0x231e17[_0x5b22('0x1d')]?_0x231e17[_0x5b22('0x1d')][_0x5b22('0x20')]||null:null,'limit':_0x231e17['options']?_0x231e17['options'][_0x5b22('0x21')]||null:null})['then'](function(_0x1a197a){logger[_0x5b22('0x12')]('UpdateFaxInteraction',_0x231e17);logger['debug'](_0x5b22('0x22'),_0x231e17,JSON[_0x5b22('0x16')](_0x1a197a));_0x75c20e(_0x1a197a);})['catch'](function(_0x420865){logger[_0x5b22('0x18')](_0x5b22('0x22'),_0x420865[_0x5b22('0x19')],_0x231e17);_0x1c3420(_0x3886f3[_0x5b22('0x18')](0x1f4,_0x420865[_0x5b22('0x19')]));});});};exports[_0x5b22('0x23')]=function(_0x590e7d){return new Promise(function(_0x5206d5,_0x188935){return db['FaxInteraction'][_0x5b22('0x24')]({'where':_0x590e7d[_0x5b22('0x1d')]?_0x590e7d[_0x5b22('0x1d')][_0x5b22('0x1f')]||null:null})[_0x5b22('0x11')](function(_0x31d768){if(_0x31d768){return _0x31d768[_0x5b22('0x25')](_0x590e7d[_0x5b22('0x1c')][_0x5b22('0x26')],_[_0x5b22('0x27')](_0x590e7d[_0x5b22('0x1c')],['ids','id'])||{});}})[_0x5b22('0x28')](function(_0x168f57){logger[_0x5b22('0x12')](_0x5b22('0x29'),_0x590e7d);logger['debug'](_0x5b22('0x29'),_0x590e7d,JSON['stringify'](_0x168f57));_0x5206d5(_0x168f57);})[_0x5b22('0x1b')](function(_0x48dbb8){logger[_0x5b22('0x18')](_0x5b22('0x29'),_0x48dbb8[_0x5b22('0x19')],_0x590e7d);_0x188935(_this['error'](0x1f4,_0x48dbb8[_0x5b22('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 7e94c27..e39a1cb 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 _0xea61=['remove','update','emit','removeListener','register','length'];(function(_0xcb5a37,_0x212917){var _0xe114fd=function(_0x444124){while(--_0x444124){_0xcb5a37['push'](_0xcb5a37['shift']());}};_0xe114fd(++_0x212917);}(_0xea61,0x7e));var _0x1ea6=function(_0x53c2f8,_0x49d607){_0x53c2f8=_0x53c2f8-0x0;var _0x2e3e73=_0xea61[_0x53c2f8];return _0x2e3e73;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x1ea6('0x0'),_0x1ea6('0x1')];function createListener(_0x1a280b,_0x402bb2){return function(_0x1241cd){_0x402bb2[_0x1ea6('0x2')](_0x1a280b,_0x1241cd);};}function removeListener(_0x446101,_0x27f841){return function(){FaxInteractionEvents[_0x1ea6('0x3')](_0x446101,_0x27f841);};}exports[_0x1ea6('0x4')]=function(_0xb8a346){for(var _0x338425=0x0,_0x19bcae=events[_0x1ea6('0x5')];_0x338425<_0x19bcae;_0x338425++){var _0x26cb8d=events[_0x338425];var _0x3a92ba=createListener('faxInteraction:'+_0x26cb8d,_0xb8a346);FaxInteractionEvents['on'](_0x26cb8d,_0x3a92ba);}}; \ No newline at end of file +var _0xdc19=['save','remove','update','emit','removeListener','register','length','./faxInteraction.events'];(function(_0x35a974,_0x56c92f){var _0x5b234e=function(_0x294098){while(--_0x294098){_0x35a974['push'](_0x35a974['shift']());}};_0x5b234e(++_0x56c92f);}(_0xdc19,0xcf));var _0x9dc1=function(_0x29bff8,_0x9c3132){_0x29bff8=_0x29bff8-0x0;var _0x1d9289=_0xdc19[_0x29bff8];return _0x1d9289;};'use strict';var FaxInteractionEvents=require(_0x9dc1('0x0'));var events=[_0x9dc1('0x1'),_0x9dc1('0x2'),_0x9dc1('0x3')];function createListener(_0x3ea339,_0x50a363){return function(_0x2d2480){_0x50a363[_0x9dc1('0x4')](_0x3ea339,_0x2d2480);};}function removeListener(_0x3c8831,_0x5fa129){return function(){FaxInteractionEvents[_0x9dc1('0x5')](_0x3c8831,_0x5fa129);};}exports[_0x9dc1('0x6')]=function(_0x5aa905){for(var _0x147b75=0x0,_0x5122bb=events[_0x9dc1('0x7')];_0x147b75<_0x5122bb;_0x147b75++){var _0x108d33=events[_0x147b75];var _0x2b4d73=createListener('faxInteraction:'+_0x108d33,_0x5aa905);FaxInteractionEvents['on'](_0x108d33,_0x2b4d73);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index bea054f..c79b8cd 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 _0x03f0=['download','post','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked','update','delete','faxinteraction:destroy','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','/:id/download'];(function(_0x324305,_0x56bb6c){var _0x119823=function(_0x56f9c1){while(--_0x56f9c1){_0x324305['push'](_0x324305['shift']());}};_0x119823(++_0x56bb6c);}(_0x03f0,0x1b2));var _0x003f=function(_0x34e2de,_0x5eef2a){_0x34e2de=_0x34e2de-0x0;var _0x2917d7=_0x03f0[_0x34e2de];return _0x2917d7;};'use strict';var multer=require('multer');var util=require(_0x003f('0x0'));var path=require('path');var timeout=require(_0x003f('0x1'));var express=require(_0x003f('0x2'));var router=express[_0x003f('0x3')]();var fs_extra=require(_0x003f('0x4'));var auth=require(_0x003f('0x5'));var interaction=require(_0x003f('0x6'));var config=require(_0x003f('0x7'));var controller=require('./faxInteraction.controller');router[_0x003f('0x8')]('/',auth[_0x003f('0x9')](),controller['index']);router['get']('/describe',auth[_0x003f('0x9')](),controller['describe']);router[_0x003f('0x8')](_0x003f('0xa'),auth[_0x003f('0x9')](),controller[_0x003f('0xb')]);router[_0x003f('0x8')](_0x003f('0xc'),auth[_0x003f('0x9')](),controller['getMessages']);router[_0x003f('0x8')](_0x003f('0xd'),auth[_0x003f('0x9')](),controller[_0x003f('0xe')]);router[_0x003f('0xf')]('/',auth[_0x003f('0x9')](),controller['create']);router[_0x003f('0xf')]('/:id/messages',auth[_0x003f('0x9')](),controller[_0x003f('0x10')]);router[_0x003f('0xf')](_0x003f('0x11'),auth['isAuthenticated'](),interaction['tracked'](_0x003f('0x12'),_0x003f('0x13')),controller[_0x003f('0x14')]);router[_0x003f('0x15')]('/:id',auth[_0x003f('0x9')](),interaction[_0x003f('0x16')](_0x003f('0x12'),'faxinteraction:update'),controller[_0x003f('0x17')]);router[_0x003f('0x18')](_0x003f('0xa'),auth[_0x003f('0x9')](),interaction[_0x003f('0x16')]('fax',_0x003f('0x19')),controller['destroy']);router[_0x003f('0x18')](_0x003f('0x11'),auth[_0x003f('0x9')](),controller[_0x003f('0x1a')]);module[_0x003f('0x1b')]=router; \ No newline at end of file +var _0xe033=['faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','exports','util','path','express','../../config/environment','isAuthenticated','describe','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xe033,0x8b));var _0x3e03=function(_0xc8b0c7,_0x1da5ee){_0xc8b0c7=_0xc8b0c7-0x0;var _0x285276=_0xe033[_0xc8b0c7];return _0x285276;};'use strict';var multer=require('multer');var util=require(_0x3e03('0x0'));var path=require(_0x3e03('0x1'));var timeout=require('connect-timeout');var express=require(_0x3e03('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3e03('0x3'));var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x3e03('0x4')](),controller[_0x3e03('0x5')]);router[_0x3e03('0x6')](_0x3e03('0x7'),auth['isAuthenticated'](),controller[_0x3e03('0x8')]);router[_0x3e03('0x6')](_0x3e03('0x9'),auth[_0x3e03('0x4')](),controller[_0x3e03('0xa')]);router[_0x3e03('0x6')](_0x3e03('0xb'),auth[_0x3e03('0x4')](),controller[_0x3e03('0xc')]);router[_0x3e03('0xd')]('/',auth[_0x3e03('0x4')](),controller[_0x3e03('0xe')]);router[_0x3e03('0xd')](_0x3e03('0x9'),auth[_0x3e03('0x4')](),controller['addMessage']);router[_0x3e03('0xd')](_0x3e03('0xf'),auth[_0x3e03('0x4')](),interaction[_0x3e03('0x10')]('fax',_0x3e03('0x11')),controller[_0x3e03('0x12')]);router[_0x3e03('0x13')](_0x3e03('0x7'),auth['isAuthenticated'](),interaction['tracked'](_0x3e03('0x14'),_0x3e03('0x15')),controller[_0x3e03('0x16')]);router[_0x3e03('0x17')](_0x3e03('0x7'),auth[_0x3e03('0x4')](),interaction[_0x3e03('0x10')](_0x3e03('0x14'),_0x3e03('0x18')),controller['destroy']);router[_0x3e03('0x17')]('/:id/tags',auth[_0x3e03('0x4')](),controller['removeTags']);module[_0x3e03('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 3fe6c1d..92aad9b 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 _0xd737=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x57ee8c,_0xe42849){var _0x3a2322=function(_0x5ea8b2){while(--_0x5ea8b2){_0x57ee8c['push'](_0x57ee8c['shift']());}};_0x3a2322(++_0xe42849);}(_0xd737,0x85));var _0x7d73=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd737[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x7d73('0x0'));module['exports']={'body':{'type':Sequelize[_0x7d73('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7d73('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7d73('0x3')]('in',_0x7d73('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x7d73('0x5')]}}; \ No newline at end of file +var _0x5ff3=['TEXT','exports','medium','ENUM','out'];(function(_0xdf072d,_0x1f67ef){var _0x4f3802=function(_0x1a5e4f){while(--_0x1a5e4f){_0xdf072d['push'](_0xdf072d['shift']());}};_0x4f3802(++_0x1f67ef);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2cacdc,_0x19b5ac){_0x2cacdc=_0x2cacdc-0x0;var _0xf435c4=_0x5ff3[_0x2cacdc];return _0xf435c4;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'body':{'type':Sequelize['TEXT'](_0x35ff('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x35ff('0x2')]('in',_0x35ff('0x3')),'defaultValue':_0x35ff('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x35ff('0x4')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 9aec542..8669af4 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 _0xde26=['register','jayson/promise','client','http','request','then','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxMessage','includeAll','include','findAll','rows','show','params','keys','length','find','body','fax-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','QueryTypes','SELECT','contact','User','agent','fullname','internal','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','Sequelize','email','rejectmessage','create','CmContact','findOne','isNil','fax','Attachment','AttachmentId','SendFax','FaxAccountId','root','attachments','download','join','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xde26,0x101));var _0x6de2=function(_0x110c54,_0xa3cfcb){_0x110c54=_0x110c54-0x0;var _0x58a348=_0xde26[_0x110c54];return _0x58a348;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6de2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6de2('0x1'));var rp=require(_0x6de2('0x2'));var moment=require(_0x6de2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6de2('0x4'));var util=require(_0x6de2('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6de2('0x6'));var ejs=require(_0x6de2('0x7'));var fs=require('fs');var fs_extra=require(_0x6de2('0x8'));var _=require(_0x6de2('0x9'));var squel=require(_0x6de2('0xa'));var crypto=require(_0x6de2('0xb'));var jsforce=require(_0x6de2('0xc'));var deskjs=require(_0x6de2('0xd'));var toCsv=require(_0x6de2('0x6'));var querystring=require('querystring');var Papa=require(_0x6de2('0xe'));var Redis=require(_0x6de2('0xf'));var authService=require(_0x6de2('0x10'));var qs=require(_0x6de2('0x11'));var as=require(_0x6de2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6de2('0x13'))(_0x6de2('0x14'));var utils=require(_0x6de2('0x15'));var config=require(_0x6de2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6de2('0x17'))['db'];config[_0x6de2('0x18')]=_[_0x6de2('0x19')](config[_0x6de2('0x18')],{'host':_0x6de2('0x1a'),'port':0x18eb});var socket=require(_0x6de2('0x1b'))(new Redis(config[_0x6de2('0x18')]));require(_0x6de2('0x1c'))[_0x6de2('0x1d')](socket);var jayson=require(_0x6de2('0x1e'));var client=jayson[_0x6de2('0x1f')][_0x6de2('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x6de2('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x166fd8,_0x47db45,_0x16a5ab,_0x3041d1){return new BPromise(function(_0x670aca,_0x4d7b92){var _0x12c9ab=_0x3041d1||client;return _0x12c9ab[_0x6de2('0x21')](_0x166fd8,_0x16a5ab)[_0x6de2('0x22')](function(_0x497f4e){logger[_0x6de2('0x23')]('FaxMessage,\x20%s,\x20%s',_0x47db45,'request\x20sent');logger[_0x6de2('0x24')](_0x6de2('0x25'),_0x47db45,_0x6de2('0x26'),JSON['stringify'](_0x497f4e));if(_0x497f4e[_0x6de2('0x27')]){if(_0x497f4e[_0x6de2('0x27')][_0x6de2('0x28')]===0x1f4){logger['error'](_0x6de2('0x29'),_0x47db45,_0x497f4e['error'][_0x6de2('0x2a')]);return _0x4d7b92(_0x497f4e[_0x6de2('0x27')]['message']);}logger[_0x6de2('0x27')](_0x6de2('0x29'),_0x47db45,_0x497f4e[_0x6de2('0x27')][_0x6de2('0x2a')]);return _0x670aca(_0x497f4e[_0x6de2('0x27')][_0x6de2('0x2a')]);}else{logger[_0x6de2('0x23')](_0x6de2('0x29'),_0x47db45,_0x6de2('0x26'));_0x670aca(_0x497f4e[_0x6de2('0x2b')][_0x6de2('0x2a')]);}})[_0x6de2('0x2c')](function(_0xc95a86){logger[_0x6de2('0x27')]('FaxMessage,\x20%s,\x20%s',_0x47db45,_0xc95a86);_0x4d7b92(_0xc95a86);});});}function respondWithStatusCode(_0x26ec77,_0xf05356){_0xf05356=_0xf05356||0xcc;return function(_0x21df15){if(_0x21df15){return _0x26ec77[_0x6de2('0x2d')](_0xf05356);}return _0x26ec77['status'](_0xf05356)[_0x6de2('0x2e')]();};}function respondWithResult(_0x1b0b2e,_0x2290fc){_0x2290fc=_0x2290fc||0xc8;return function(_0x2d8534){if(_0x2d8534){return _0x1b0b2e['status'](_0x2290fc)[_0x6de2('0x2f')](_0x2d8534);}};}function respondWithFilteredResult(_0x5a141e,_0x2b6e3a){return function(_0x3d7ef1){if(_0x3d7ef1){var _0x3509d3=typeof _0x2b6e3a[_0x6de2('0x30')]===_0x6de2('0x31')&&typeof _0x2b6e3a[_0x6de2('0x32')]===_0x6de2('0x31');var _0x2ad670=_0x3d7ef1['count'];var _0x181b06=_0x3509d3?0x0:_0x2b6e3a[_0x6de2('0x30')];var _0xbdb52=_0x3509d3?_0x3d7ef1[_0x6de2('0x33')]:_0x2b6e3a[_0x6de2('0x30')]+_0x2b6e3a['limit'];var _0x925b21;if(_0xbdb52>=_0x2ad670){_0xbdb52=_0x2ad670;_0x925b21=0xc8;}else{_0x925b21=0xce;}_0x5a141e[_0x6de2('0x34')](_0x925b21);return _0x5a141e['set'](_0x6de2('0x35'),_0x181b06+'-'+_0xbdb52+'/'+_0x2ad670)[_0x6de2('0x2f')](_0x3d7ef1);}return null;};}function patchUpdates(_0x54fae6){return function(_0x57dd3e){try{jsonpatch[_0x6de2('0x36')](_0x57dd3e,_0x54fae6,!![]);}catch(_0x176557){return BPromise[_0x6de2('0x37')](_0x176557);}return _0x57dd3e[_0x6de2('0x38')]();};}function saveUpdates(_0x5ed11c,_0x3983da){return function(_0x30d312){if(_0x30d312){return _0x30d312[_0x6de2('0x39')](_0x5ed11c)[_0x6de2('0x22')](function(_0x1ff580){return _0x1ff580;});}return null;};}function removeEntity(_0x50e0d8,_0x5609c4){return function(_0x449c2f){if(_0x449c2f){return _0x449c2f[_0x6de2('0x3a')]()['then'](function(){_0x50e0d8[_0x6de2('0x34')](0xcc)[_0x6de2('0x2e')]();});}};}function handleEntityNotFound(_0x1885ff,_0x409503){return function(_0x200e30){if(!_0x200e30){_0x1885ff[_0x6de2('0x2d')](0x194);}return _0x200e30;};}function handleError(_0x4fa3d8,_0x2d550e){_0x2d550e=_0x2d550e||0x1f4;return function(_0x32ab06){logger[_0x6de2('0x27')](_0x32ab06[_0x6de2('0x3b')]);if(_0x32ab06['name']){delete _0x32ab06[_0x6de2('0x3c')];}_0x4fa3d8[_0x6de2('0x34')](_0x2d550e)[_0x6de2('0x3d')](_0x32ab06);};}exports[_0x6de2('0x3e')]=function(_0x21f52a,_0x12fc7e){var _0xa4b0b8={},_0x5d857c={},_0x5c6f4b={'count':0x0,'rows':[]};var _0x4c4dc7=_[_0x6de2('0x3f')](db['FaxMessage'][_0x6de2('0x40')],function(_0x38de4f){return{'name':_0x38de4f[_0x6de2('0x41')],'type':_0x38de4f[_0x6de2('0x42')][_0x6de2('0x43')]};});_0x5d857c[_0x6de2('0x44')]=_[_0x6de2('0x3f')](_0x4c4dc7,_0x6de2('0x3c'));_0x5d857c['query']=_['keys'](_0x21f52a[_0x6de2('0x45')]);_0x5d857c[_0x6de2('0x46')]=_[_0x6de2('0x47')](_0x5d857c[_0x6de2('0x44')],_0x5d857c['query']);_0xa4b0b8[_0x6de2('0x48')]=_[_0x6de2('0x47')](_0x5d857c[_0x6de2('0x44')],qs[_0x6de2('0x49')](_0x21f52a[_0x6de2('0x45')][_0x6de2('0x49')]));_0xa4b0b8[_0x6de2('0x48')]=_0xa4b0b8['attributes']['length']?_0xa4b0b8[_0x6de2('0x48')]:_0x5d857c[_0x6de2('0x44')];if(!_0x21f52a[_0x6de2('0x45')]['hasOwnProperty'](_0x6de2('0x4a'))){_0xa4b0b8[_0x6de2('0x32')]=qs[_0x6de2('0x32')](_0x21f52a[_0x6de2('0x45')][_0x6de2('0x32')]);_0xa4b0b8['offset']=qs['offset'](_0x21f52a[_0x6de2('0x45')][_0x6de2('0x30')]);}_0xa4b0b8[_0x6de2('0x4b')]=qs['sort'](_0x21f52a[_0x6de2('0x45')][_0x6de2('0x4c')]);_0xa4b0b8[_0x6de2('0x4d')]=qs['filters'](_[_0x6de2('0x4e')](_0x21f52a['query'],_0x5d857c[_0x6de2('0x46')]),_0x4c4dc7);if(_0x21f52a[_0x6de2('0x45')][_0x6de2('0x4f')]){_0xa4b0b8['where']=_[_0x6de2('0x50')](_0xa4b0b8['where'],{'$or':_[_0x6de2('0x3f')](_0x4c4dc7,function(_0x3e39a9){if(_0x3e39a9[_0x6de2('0x42')]!==_0x6de2('0x51')){var _0x4276d3={};_0x4276d3[_0x3e39a9['name']]={'$like':'%'+_0x21f52a[_0x6de2('0x45')][_0x6de2('0x4f')]+'%'};return _0x4276d3;}})});}_0xa4b0b8=_[_0x6de2('0x50')]({},_0xa4b0b8,_0x21f52a[_0x6de2('0x52')]);var _0x4a9595={'where':_0xa4b0b8[_0x6de2('0x4d')]};return db[_0x6de2('0x53')][_0x6de2('0x33')](_0x4a9595)['then'](function(_0x6af0f){_0x5c6f4b[_0x6de2('0x33')]=_0x6af0f;if(_0x21f52a[_0x6de2('0x45')][_0x6de2('0x54')]){_0xa4b0b8[_0x6de2('0x55')]=[{'all':!![]}];}return db[_0x6de2('0x53')][_0x6de2('0x56')](_0xa4b0b8);})[_0x6de2('0x22')](function(_0x18f1b6){_0x5c6f4b[_0x6de2('0x57')]=_0x18f1b6;return _0x5c6f4b;})['then'](respondWithFilteredResult(_0x12fc7e,_0xa4b0b8))[_0x6de2('0x2c')](handleError(_0x12fc7e,null));};exports[_0x6de2('0x58')]=function(_0x1b1a21,_0x5d5f94){var _0x3fc767={'raw':!![],'where':{'id':_0x1b1a21[_0x6de2('0x59')]['id']}},_0x1ae404={};_0x1ae404[_0x6de2('0x44')]=_[_0x6de2('0x5a')](db[_0x6de2('0x53')][_0x6de2('0x40')]);_0x1ae404[_0x6de2('0x45')]=_[_0x6de2('0x5a')](_0x1b1a21[_0x6de2('0x45')]);_0x1ae404[_0x6de2('0x46')]=_[_0x6de2('0x47')](_0x1ae404[_0x6de2('0x44')],_0x1ae404['query']);_0x3fc767[_0x6de2('0x48')]=_[_0x6de2('0x47')](_0x1ae404[_0x6de2('0x44')],qs[_0x6de2('0x49')](_0x1b1a21['query'][_0x6de2('0x49')]));_0x3fc767[_0x6de2('0x48')]=_0x3fc767[_0x6de2('0x48')][_0x6de2('0x5b')]?_0x3fc767[_0x6de2('0x48')]:_0x1ae404[_0x6de2('0x44')];if(_0x1b1a21[_0x6de2('0x45')][_0x6de2('0x54')]){_0x3fc767[_0x6de2('0x55')]=[{'all':!![]}];}_0x3fc767=_['merge']({},_0x3fc767,_0x1b1a21[_0x6de2('0x52')]);return db['FaxMessage'][_0x6de2('0x5c')](_0x3fc767)[_0x6de2('0x22')](handleEntityNotFound(_0x5d5f94,null))[_0x6de2('0x22')](respondWithResult(_0x5d5f94,null))[_0x6de2('0x2c')](handleError(_0x5d5f94,null));};exports[_0x6de2('0x39')]=function(_0x5adaf0,_0x43ff3c){if(_0x5adaf0['body']['id']){delete _0x5adaf0['body']['id'];}return db[_0x6de2('0x53')][_0x6de2('0x5c')]({'where':{'id':_0x5adaf0[_0x6de2('0x59')]['id']}})['then'](handleEntityNotFound(_0x43ff3c,null))[_0x6de2('0x22')](saveUpdates(_0x5adaf0[_0x6de2('0x5d')],null))[_0x6de2('0x22')](respondWithResult(_0x43ff3c,null))[_0x6de2('0x2c')](handleError(_0x43ff3c,null));};exports['destroy']=function(_0x43f6b2,_0x5975b9){return db[_0x6de2('0x53')][_0x6de2('0x5c')]({'where':{'id':_0x43f6b2[_0x6de2('0x59')]['id']}})[_0x6de2('0x22')](handleEntityNotFound(_0x5975b9,null))[_0x6de2('0x22')](removeEntity(_0x5975b9,null))['catch'](handleError(_0x5975b9,null));};exports['describe']=function(_0xe0dbfc,_0x3bb2e8){return db[_0x6de2('0x53')]['describe']()[_0x6de2('0x22')](respondWithResult(_0x3bb2e8,null))[_0x6de2('0x2c')](handleError(_0x3bb2e8,null));};var interaction_log=require('../../config/logger')(_0x6de2('0x5e'));exports[_0x6de2('0x5f')]=function(_0x6f4070,_0x4da19e,_0x4d6ebb){var _0x13d88d={'agent':{},'channel':'fax'};if(_0x6f4070[_0x6de2('0x5d')]['id']){delete _0x6f4070[_0x6de2('0x5d')]['id'];}_0x6f4070[_0x6de2('0x5d')]['read']=!![];_0x6f4070[_0x6de2('0x5d')][_0x6de2('0x60')]=moment()['format'](_0x6de2('0x61'));_0x6f4070[_0x6de2('0x5d')][_0x6de2('0x62')]=_0x6f4070['body'][_0x6de2('0x62')]||_0x6f4070[_0x6de2('0x63')]['id'];_0x13d88d['agent']['id']=_0x6f4070[_0x6de2('0x5d')][_0x6de2('0x62')];return db['FaxMessage']['find']({'where':{'id':_0x6f4070[_0x6de2('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4da19e,null))[_0x6de2('0x22')](saveUpdates(_0x6f4070[_0x6de2('0x5d')],null))[_0x6de2('0x22')](function(_0xa83aaa){if(_0xa83aaa){_0x13d88d[_0x6de2('0x2a')]=_0xa83aaa[_0x6de2('0x64')]({'plain':!![]});return db[_0x6de2('0x65')][_0x6de2('0x5c')]({'where':{'id':_0xa83aaa[_0x6de2('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x4da19e,null))[_0x6de2('0x22')](function(_0x2c841a){if(_0x2c841a){return _0x2c841a[_0x6de2('0x39')]({'UserId':_0x6f4070[_0x6de2('0x5d')][_0x6de2('0x62')],'read1stAt':_['isNil'](_0x2c841a[_0x6de2('0x67')])?moment()['format'](_0x6de2('0x61')):undefined});}return null;})[_0x6de2('0x22')](function(_0x291b71){if(_0x291b71){_0x13d88d[_0x6de2('0x68')]=_0x291b71[_0x6de2('0x64')]({'plain':!![]});interaction_log[_0x6de2('0x23')](_0x6de2('0x69'),_0x6f4070[_0x6de2('0x63')]['id'],_0x6f4070[_0x6de2('0x63')]['name'],_0x6f4070[_0x6de2('0x63')]['role'],_0x13d88d[_0x6de2('0x68')]['id'],_0x6f4070['body']?JSON[_0x6de2('0x6a')](_0x6f4070[_0x6de2('0x5d')]):_0x6de2('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x13d88d);}return null;})[_0x6de2('0x22')](function(_0x34657e){var _0x556074='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x34657e['message']['ContactId'];return db['sequelize'][_0x6de2('0x45')](_0x556074,{'type':db['Sequelize'][_0x6de2('0x6c')][_0x6de2('0x6d')],'raw':!![]})[_0x6de2('0x22')](function(_0x3bce50){return _0x3bce50;});})[_0x6de2('0x22')](function(_0x507705){if(_0x507705){_0x13d88d[_0x6de2('0x2a')][_0x6de2('0x6e')]=_0x507705[0x0];if(!_0x6f4070[_0x6de2('0x5d')][_0x6de2('0x62')])return;return db[_0x6de2('0x6f')][_0x6de2('0x5c')]({'where':{'id':_0x6f4070['body'][_0x6de2('0x62')],'role':_0x6de2('0x70')},'attributes':['id',_0x6de2('0x3c'),_0x6de2('0x71'),'email',_0x6de2('0x72')],'raw':!![]});}return null;})[_0x6de2('0x22')](function(_0x512ff3){if(!_0x512ff3)return null;_0x13d88d[_0x6de2('0x2a')][_0x6de2('0x70')]=_0x512ff3;return _0x13d88d;})[_0x6de2('0x22')](function(_0x349e0c){if(_0x349e0c){if(_0x6f4070['body']['manual']){_0x13d88d[_0x6de2('0x2a')][_0x6de2('0x73')]=util[_0x6de2('0x74')](_0x6de2('0x75'),_0x6f4070['user']['name']);_0x13d88d[_0x6de2('0x2a')][_0x6de2('0x76')]=_0x13d88d[_0x6de2('0x76')];_0x13d88d[_0x6de2('0x2a')]['motionChannel']=_0x13d88d[_0x6de2('0x76')];_0x13d88d['message'][_0x6de2('0x77')]=_0x6de2('0x5f');return respondWithRpcPromise(_0x6de2('0x78'),_0x6de2('0x78'),{'event':_0x6de2('0x79'),'message':_0x13d88d[_0x6de2('0x2a')]},client9002)['then'](function(){return _0x13d88d;});}return _0x13d88d;}return null;})[_0x6de2('0x22')](respondWithResult(_0x4da19e,null))[_0x6de2('0x2c')](handleError(_0x4da19e,null));};var interaction_log=require(_0x6de2('0x13'))('fax-interactions');exports[_0x6de2('0x37')]=function(_0x15cd3c,_0x1411e6,_0x301d3f){var _0x432e9c={'agent':{},'channel':'fax'};if(_0x15cd3c[_0x6de2('0x5d')]['id']){delete _0x15cd3c['body']['id'];}_0x15cd3c[_0x6de2('0x5d')]['UserId']=_0x15cd3c['body'][_0x6de2('0x62')]||_0x15cd3c[_0x6de2('0x63')]['id'];_0x432e9c[_0x6de2('0x70')]['id']=_0x15cd3c[_0x6de2('0x5d')][_0x6de2('0x62')];return db['FaxMessage']['find']({'where':{'id':_0x15cd3c[_0x6de2('0x59')]['id'],'UserId':null}})[_0x6de2('0x22')](handleEntityNotFound(_0x1411e6,null))[_0x6de2('0x22')](function(_0x24addc){if(_0x24addc){_0x432e9c[_0x6de2('0x2a')]=_0x24addc['get']({'plain':!![]});return db[_0x6de2('0x65')][_0x6de2('0x5c')]({'where':{'id':_0x24addc[_0x6de2('0x66')]}});}return null;})[_0x6de2('0x22')](handleEntityNotFound(_0x1411e6,null))[_0x6de2('0x22')](function(_0x43dcc1){if(_0x43dcc1){_0x432e9c[_0x6de2('0x68')]=_0x43dcc1[_0x6de2('0x64')]({'plain':!![]});interaction_log['info'](_0x6de2('0x7a'),_0x15cd3c[_0x6de2('0x63')]['id'],_0x15cd3c['user'][_0x6de2('0x3c')],_0x15cd3c[_0x6de2('0x63')]['role'],_0x432e9c[_0x6de2('0x68')]['id'],_0x15cd3c[_0x6de2('0x5d')]?JSON[_0x6de2('0x6a')](_0x15cd3c['body']):_0x6de2('0x6b'));return respondWithRpcPromise(_0x6de2('0x7b'),_0x6de2('0x7c'),_0x432e9c);}return null;})[_0x6de2('0x22')](function(_0x5bff96){var _0x2a3502='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5bff96[_0x6de2('0x2a')][_0x6de2('0x7d')];return db[_0x6de2('0x7e')][_0x6de2('0x45')](_0x2a3502,{'type':db[_0x6de2('0x7f')][_0x6de2('0x6c')][_0x6de2('0x6d')],'raw':!![]})[_0x6de2('0x22')](function(_0x1688ce){return _0x1688ce;});})['then'](function(_0x3b8d71){if(_0x3b8d71){_0x432e9c[_0x6de2('0x2a')][_0x6de2('0x6e')]=_0x3b8d71[0x0];if(!_0x15cd3c[_0x6de2('0x5d')][_0x6de2('0x62')])return;return db[_0x6de2('0x6f')][_0x6de2('0x5c')]({'where':{'id':_0x15cd3c[_0x6de2('0x5d')][_0x6de2('0x62')],'role':_0x6de2('0x70')},'attributes':['id',_0x6de2('0x3c'),_0x6de2('0x71'),_0x6de2('0x80'),_0x6de2('0x72')],'raw':!![]});}return null;})[_0x6de2('0x22')](function(_0x1e5de1){if(!_0x1e5de1)return null;_0x432e9c['message'][_0x6de2('0x70')]=_0x1e5de1;return _0x432e9c;})['then'](function(_0x8d409c){if(_0x8d409c){_0x8d409c[_0x6de2('0x2a')][_0x6de2('0x73')]=util[_0x6de2('0x74')](_0x6de2('0x75'),_0x15cd3c[_0x6de2('0x63')][_0x6de2('0x3c')]);_0x8d409c['message']['channel']=_0x432e9c[_0x6de2('0x76')];_0x8d409c[_0x6de2('0x2a')]['motionChannel']=_0x432e9c['channel'];_0x8d409c[_0x6de2('0x2a')][_0x6de2('0x77')]=_0x6de2('0x37');respondWithRpcPromise(_0x6de2('0x78'),_0x6de2('0x78'),{'event':_0x6de2('0x81'),'message':_0x8d409c[_0x6de2('0x2a')]},client9002);return _0x432e9c;}return null;})[_0x6de2('0x22')](respondWithResult(_0x1411e6,null))[_0x6de2('0x2c')](handleError(_0x1411e6,null));};exports[_0x6de2('0x82')]=function(_0x61b075,_0x334394){var _0x52bc22;return db[_0x6de2('0x53')][_0x6de2('0x82')](_0x61b075['body'],{})[_0x6de2('0x22')](function(_0xcb02df){_0x52bc22=_0xcb02df;return db[_0x6de2('0x83')][_0x6de2('0x84')]({'where':{'id':_0x52bc22['ContactId']}});})[_0x6de2('0x22')](function(_0x197ddd){if(_[_0x6de2('0x85')](_0x197ddd)){return;}else{_0x52bc22[_0x6de2('0x86')]=_0x197ddd[_0x6de2('0x86')];return db[_0x6de2('0x87')][_0x6de2('0x84')]({'where':{'id':_0x52bc22[_0x6de2('0x88')]}});}})['then'](function(_0x47cc77){return respondWithRpcPromise(_0x6de2('0x89'),_0x6de2('0x89'),{'FaxAccountId':_[_0x6de2('0x85')](_0x61b075[_0x6de2('0x5d')])?undefined:_0x61b075[_0x6de2('0x5d')][_0x6de2('0x8a')],'path':_['isNil'](_0x47cc77)?undefined:util[_0x6de2('0x74')]('/var/opt/motion2/server/files/attachments/%s',_0x47cc77['basename']),'fax':_[_0x6de2('0x85')](_0x52bc22[_0x6de2('0x86')])?undefined:_0x52bc22['fax'],'AttachmentId':_0x52bc22['AttachmentId']},client9002);})[_0x6de2('0x22')](respondWithResult(_0x334394,0xc9))[_0x6de2('0x2c')](handleError(_0x334394,null));};exports['download']=function(_0x4b55f9,_0x52916e){var _0x488e8f=path['join'](config[_0x6de2('0x8b')],'server','files',_0x6de2('0x8c'));return db['FaxMessage'][_0x6de2('0x5c')]({'where':{'id':_0x4b55f9[_0x6de2('0x59')]['id']},'include':[{'model':db[_0x6de2('0x87')],'as':_0x6de2('0x87')}]})[_0x6de2('0x22')](handleEntityNotFound(_0x52916e,null))[_0x6de2('0x22')](function(_0x22956b){if(_0x22956b){return _0x52916e[_0x6de2('0x8d')](path[_0x6de2('0x8e')](_0x488e8f,_0x22956b[_0x6de2('0x87')]['basename']));}})['catch'](handleError(_0x52916e,null));}; \ No newline at end of file +var _0xdd06=['defaults','redis','./faxMessage.socket','jayson/promise','client','http','request','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','info','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxMessage','includeAll','include','findAll','then','rows','params','keys','find','body','catch','describe','../../config/logger','fax-interactions','accept','fax','read','format','UserId','user','agent','get','FaxInteraction','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','email','rejectmessage','create','findOne','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','zip-dir','request-promise','bluebird','mustache','path','to-csv','lodash','desk.js','papaparse','ioredis','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2aced2,_0x251671){var _0x144be2=function(_0x597f99){while(--_0x597f99){_0x2aced2['push'](_0x2aced2['shift']());}};_0x144be2(++_0x251671);}(_0xdd06,0x7a));var _0x6dd0=function(_0x28cef5,_0x5ed280){_0x28cef5=_0x28cef5-0x0;var _0x5b4cf3=_0xdd06[_0x28cef5];return _0x5b4cf3;};'use strict';var emlformat=require(_0x6dd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6dd0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dd0('0x2'));var moment=require('moment');var BPromise=require(_0x6dd0('0x3'));var Mustache=require(_0x6dd0('0x4'));var util=require('util');var path=require(_0x6dd0('0x5'));var sox=require('sox');var csv=require(_0x6dd0('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6dd0('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6dd0('0x8'));var toCsv=require(_0x6dd0('0x6'));var querystring=require('querystring');var Papa=require(_0x6dd0('0x9'));var Redis=require(_0x6dd0('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6dd0('0xb'));var config=require(_0x6dd0('0xc'));var licenseUtil=require(_0x6dd0('0xd'));var db=require(_0x6dd0('0xe'))['db'];config['redis']=_[_0x6dd0('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dd0('0x10')]));require(_0x6dd0('0x11'))['register'](socket);var jayson=require(_0x6dd0('0x12'));var client=jayson[_0x6dd0('0x13')]['http']({'port':0x232c});var client9002=jayson[_0x6dd0('0x13')][_0x6dd0('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x30731e,_0x525f54,_0x29e35f,_0x5dd37a){return new BPromise(function(_0x5d1f3c,_0x1dcb3f){var _0x35c6ed=_0x5dd37a||client;return _0x35c6ed[_0x6dd0('0x15')](_0x30731e,_0x29e35f)['then'](function(_0x12155c){logger['info']('FaxMessage,\x20%s,\x20%s',_0x525f54,_0x6dd0('0x16'));logger[_0x6dd0('0x17')](_0x6dd0('0x18'),_0x525f54,_0x6dd0('0x16'),JSON[_0x6dd0('0x19')](_0x12155c));if(_0x12155c[_0x6dd0('0x1a')]){if(_0x12155c[_0x6dd0('0x1a')][_0x6dd0('0x1b')]===0x1f4){logger[_0x6dd0('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x525f54,_0x12155c[_0x6dd0('0x1a')]['message']);return _0x1dcb3f(_0x12155c['error'][_0x6dd0('0x1c')]);}logger[_0x6dd0('0x1a')](_0x6dd0('0x1d'),_0x525f54,_0x12155c[_0x6dd0('0x1a')][_0x6dd0('0x1c')]);return _0x5d1f3c(_0x12155c[_0x6dd0('0x1a')][_0x6dd0('0x1c')]);}else{logger[_0x6dd0('0x1e')](_0x6dd0('0x1d'),_0x525f54,_0x6dd0('0x16'));_0x5d1f3c(_0x12155c[_0x6dd0('0x1f')][_0x6dd0('0x1c')]);}})['catch'](function(_0x1f94b0){logger['error'](_0x6dd0('0x1d'),_0x525f54,_0x1f94b0);_0x1dcb3f(_0x1f94b0);});});}function respondWithStatusCode(_0x382a3a,_0x482c04){_0x482c04=_0x482c04||0xcc;return function(_0x2eb39a){if(_0x2eb39a){return _0x382a3a[_0x6dd0('0x20')](_0x482c04);}return _0x382a3a[_0x6dd0('0x21')](_0x482c04)['end']();};}function respondWithResult(_0x1f51ed,_0xa89b3){_0xa89b3=_0xa89b3||0xc8;return function(_0x54b2c5){if(_0x54b2c5){return _0x1f51ed[_0x6dd0('0x21')](_0xa89b3)[_0x6dd0('0x22')](_0x54b2c5);}};}function respondWithFilteredResult(_0xbbe27e,_0xaba88){return function(_0x50d659){if(_0x50d659){var _0x3b22e1=typeof _0xaba88[_0x6dd0('0x23')]===_0x6dd0('0x24')&&typeof _0xaba88[_0x6dd0('0x25')]===_0x6dd0('0x24');var _0x186cea=_0x50d659[_0x6dd0('0x26')];var _0x37b786=_0x3b22e1?0x0:_0xaba88['offset'];var _0x4bf645=_0x3b22e1?_0x50d659[_0x6dd0('0x26')]:_0xaba88['offset']+_0xaba88[_0x6dd0('0x25')];var _0x4c59f1;if(_0x4bf645>=_0x186cea){_0x4bf645=_0x186cea;_0x4c59f1=0xc8;}else{_0x4c59f1=0xce;}_0xbbe27e[_0x6dd0('0x21')](_0x4c59f1);return _0xbbe27e[_0x6dd0('0x27')](_0x6dd0('0x28'),_0x37b786+'-'+_0x4bf645+'/'+_0x186cea)[_0x6dd0('0x22')](_0x50d659);}return null;};}function patchUpdates(_0x1bc2fa){return function(_0x31b398){try{jsonpatch['apply'](_0x31b398,_0x1bc2fa,!![]);}catch(_0x12697e){return BPromise[_0x6dd0('0x29')](_0x12697e);}return _0x31b398[_0x6dd0('0x2a')]();};}function saveUpdates(_0x3e287f,_0x271a89){return function(_0x1236c0){if(_0x1236c0){return _0x1236c0[_0x6dd0('0x2b')](_0x3e287f)['then'](function(_0x21d52b){return _0x21d52b;});}return null;};}function removeEntity(_0x426b41,_0x2357ae){return function(_0x238b78){if(_0x238b78){return _0x238b78[_0x6dd0('0x2c')]()['then'](function(){_0x426b41[_0x6dd0('0x21')](0xcc)[_0x6dd0('0x2d')]();});}};}function handleEntityNotFound(_0x353a2b,_0x28f86e){return function(_0x2b91d2){if(!_0x2b91d2){_0x353a2b['sendStatus'](0x194);}return _0x2b91d2;};}function handleError(_0x226dd2,_0x32caac){_0x32caac=_0x32caac||0x1f4;return function(_0x5d3f17){logger['error'](_0x5d3f17[_0x6dd0('0x2e')]);if(_0x5d3f17[_0x6dd0('0x2f')]){delete _0x5d3f17['name'];}_0x226dd2['status'](_0x32caac)['send'](_0x5d3f17);};}exports[_0x6dd0('0x30')]=function(_0x50d75f,_0x285d30){var _0x5ba7c1={},_0x557097={},_0x949d63={'count':0x0,'rows':[]};var _0x19c48c=_[_0x6dd0('0x31')](db['FaxMessage'][_0x6dd0('0x32')],function(_0x54021e){return{'name':_0x54021e[_0x6dd0('0x33')],'type':_0x54021e[_0x6dd0('0x34')][_0x6dd0('0x35')]};});_0x557097[_0x6dd0('0x36')]=_['map'](_0x19c48c,_0x6dd0('0x2f'));_0x557097['query']=_['keys'](_0x50d75f[_0x6dd0('0x37')]);_0x557097[_0x6dd0('0x38')]=_[_0x6dd0('0x39')](_0x557097['model'],_0x557097[_0x6dd0('0x37')]);_0x5ba7c1['attributes']=_[_0x6dd0('0x39')](_0x557097['model'],qs[_0x6dd0('0x3a')](_0x50d75f['query']['fields']));_0x5ba7c1[_0x6dd0('0x3b')]=_0x5ba7c1[_0x6dd0('0x3b')][_0x6dd0('0x3c')]?_0x5ba7c1[_0x6dd0('0x3b')]:_0x557097['model'];if(!_0x50d75f[_0x6dd0('0x37')]['hasOwnProperty'](_0x6dd0('0x3d'))){_0x5ba7c1[_0x6dd0('0x25')]=qs[_0x6dd0('0x25')](_0x50d75f[_0x6dd0('0x37')]['limit']);_0x5ba7c1[_0x6dd0('0x23')]=qs[_0x6dd0('0x23')](_0x50d75f[_0x6dd0('0x37')][_0x6dd0('0x23')]);}_0x5ba7c1[_0x6dd0('0x3e')]=qs[_0x6dd0('0x3f')](_0x50d75f['query'][_0x6dd0('0x3f')]);_0x5ba7c1[_0x6dd0('0x40')]=qs[_0x6dd0('0x38')](_['pick'](_0x50d75f['query'],_0x557097[_0x6dd0('0x38')]),_0x19c48c);if(_0x50d75f[_0x6dd0('0x37')][_0x6dd0('0x41')]){_0x5ba7c1[_0x6dd0('0x40')]=_[_0x6dd0('0x42')](_0x5ba7c1['where'],{'$or':_[_0x6dd0('0x31')](_0x19c48c,function(_0x36ab7e){if(_0x36ab7e[_0x6dd0('0x34')]!==_0x6dd0('0x43')){var _0x2124d5={};_0x2124d5[_0x36ab7e['name']]={'$like':'%'+_0x50d75f[_0x6dd0('0x37')][_0x6dd0('0x41')]+'%'};return _0x2124d5;}})});}_0x5ba7c1=_[_0x6dd0('0x42')]({},_0x5ba7c1,_0x50d75f[_0x6dd0('0x44')]);var _0x419679={'where':_0x5ba7c1[_0x6dd0('0x40')]};return db[_0x6dd0('0x45')][_0x6dd0('0x26')](_0x419679)['then'](function(_0x28cd0c){_0x949d63[_0x6dd0('0x26')]=_0x28cd0c;if(_0x50d75f[_0x6dd0('0x37')][_0x6dd0('0x46')]){_0x5ba7c1[_0x6dd0('0x47')]=[{'all':!![]}];}return db[_0x6dd0('0x45')][_0x6dd0('0x48')](_0x5ba7c1);})[_0x6dd0('0x49')](function(_0x5b3833){_0x949d63[_0x6dd0('0x4a')]=_0x5b3833;return _0x949d63;})[_0x6dd0('0x49')](respondWithFilteredResult(_0x285d30,_0x5ba7c1))['catch'](handleError(_0x285d30,null));};exports['show']=function(_0x243474,_0x5c691e){var _0x51d081={'raw':!![],'where':{'id':_0x243474[_0x6dd0('0x4b')]['id']}},_0x1a88fb={};_0x1a88fb['model']=_[_0x6dd0('0x4c')](db[_0x6dd0('0x45')][_0x6dd0('0x32')]);_0x1a88fb[_0x6dd0('0x37')]=_[_0x6dd0('0x4c')](_0x243474['query']);_0x1a88fb[_0x6dd0('0x38')]=_[_0x6dd0('0x39')](_0x1a88fb[_0x6dd0('0x36')],_0x1a88fb[_0x6dd0('0x37')]);_0x51d081[_0x6dd0('0x3b')]=_[_0x6dd0('0x39')](_0x1a88fb['model'],qs[_0x6dd0('0x3a')](_0x243474['query'][_0x6dd0('0x3a')]));_0x51d081[_0x6dd0('0x3b')]=_0x51d081[_0x6dd0('0x3b')][_0x6dd0('0x3c')]?_0x51d081[_0x6dd0('0x3b')]:_0x1a88fb['model'];if(_0x243474[_0x6dd0('0x37')][_0x6dd0('0x46')]){_0x51d081['include']=[{'all':!![]}];}_0x51d081=_[_0x6dd0('0x42')]({},_0x51d081,_0x243474[_0x6dd0('0x44')]);return db['FaxMessage'][_0x6dd0('0x4d')](_0x51d081)['then'](handleEntityNotFound(_0x5c691e,null))[_0x6dd0('0x49')](respondWithResult(_0x5c691e,null))['catch'](handleError(_0x5c691e,null));};exports['update']=function(_0x3370e0,_0x36587a){if(_0x3370e0[_0x6dd0('0x4e')]['id']){delete _0x3370e0[_0x6dd0('0x4e')]['id'];}return db['FaxMessage'][_0x6dd0('0x4d')]({'where':{'id':_0x3370e0[_0x6dd0('0x4b')]['id']}})[_0x6dd0('0x49')](handleEntityNotFound(_0x36587a,null))[_0x6dd0('0x49')](saveUpdates(_0x3370e0[_0x6dd0('0x4e')],null))[_0x6dd0('0x49')](respondWithResult(_0x36587a,null))[_0x6dd0('0x4f')](handleError(_0x36587a,null));};exports[_0x6dd0('0x2c')]=function(_0x551e13,_0x15ed5d){return db['FaxMessage'][_0x6dd0('0x4d')]({'where':{'id':_0x551e13['params']['id']}})['then'](handleEntityNotFound(_0x15ed5d,null))[_0x6dd0('0x49')](removeEntity(_0x15ed5d,null))[_0x6dd0('0x4f')](handleError(_0x15ed5d,null));};exports['describe']=function(_0x43c551,_0x8b9691){return db[_0x6dd0('0x45')][_0x6dd0('0x50')]()[_0x6dd0('0x49')](respondWithResult(_0x8b9691,null))['catch'](handleError(_0x8b9691,null));};var interaction_log=require(_0x6dd0('0x51'))(_0x6dd0('0x52'));exports[_0x6dd0('0x53')]=function(_0x54c8e5,_0x1180fe,_0x3ab6d0){var _0x254416={'agent':{},'channel':_0x6dd0('0x54')};if(_0x54c8e5[_0x6dd0('0x4e')]['id']){delete _0x54c8e5[_0x6dd0('0x4e')]['id'];}_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x55')]=!![];_0x54c8e5['body']['readAt']=moment()[_0x6dd0('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x54c8e5['body'][_0x6dd0('0x57')]=_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x57')]||_0x54c8e5[_0x6dd0('0x58')]['id'];_0x254416[_0x6dd0('0x59')]['id']=_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x57')];return db[_0x6dd0('0x45')][_0x6dd0('0x4d')]({'where':{'id':_0x54c8e5[_0x6dd0('0x4b')]['id'],'UserId':null}})[_0x6dd0('0x49')](handleEntityNotFound(_0x1180fe,null))[_0x6dd0('0x49')](saveUpdates(_0x54c8e5[_0x6dd0('0x4e')],null))[_0x6dd0('0x49')](function(_0xa8abd1){if(_0xa8abd1){_0x254416[_0x6dd0('0x1c')]=_0xa8abd1[_0x6dd0('0x5a')]({'plain':!![]});return db[_0x6dd0('0x5b')][_0x6dd0('0x4d')]({'where':{'id':_0xa8abd1['FaxInteractionId']}});}return null;})[_0x6dd0('0x49')](handleEntityNotFound(_0x1180fe,null))[_0x6dd0('0x49')](function(_0x5e6c39){if(_0x5e6c39){return _0x5e6c39[_0x6dd0('0x2b')]({'UserId':_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x57')],'read1stAt':_['isNil'](_0x5e6c39[_0x6dd0('0x5c')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6dd0('0x49')](function(_0x9c4c2e){if(_0x9c4c2e){_0x254416['interaction']=_0x9c4c2e[_0x6dd0('0x5a')]({'plain':!![]});interaction_log[_0x6dd0('0x1e')](_0x6dd0('0x5d'),_0x54c8e5[_0x6dd0('0x58')]['id'],_0x54c8e5[_0x6dd0('0x58')][_0x6dd0('0x2f')],_0x54c8e5['user'][_0x6dd0('0x5e')],_0x254416[_0x6dd0('0x5f')]['id'],_0x54c8e5['body']?JSON[_0x6dd0('0x19')](_0x54c8e5[_0x6dd0('0x4e')]):_0x6dd0('0x60'));return respondWithRpcPromise(_0x6dd0('0x61'),_0x6dd0('0x62'),_0x254416);}return null;})['then'](function(_0x1dac33){var _0x5ca01e=_0x6dd0('0x63')+_0x1dac33[_0x6dd0('0x1c')][_0x6dd0('0x64')];return db['sequelize']['query'](_0x5ca01e,{'type':db[_0x6dd0('0x65')][_0x6dd0('0x66')][_0x6dd0('0x67')],'raw':!![]})['then'](function(_0x47c0f3){return _0x47c0f3;});})[_0x6dd0('0x49')](function(_0x702c5){if(_0x702c5){_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x68')]=_0x702c5[0x0];if(!_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x57')])return;return db[_0x6dd0('0x69')][_0x6dd0('0x4d')]({'where':{'id':_0x54c8e5['body']['UserId'],'role':'agent'},'attributes':['id',_0x6dd0('0x2f'),_0x6dd0('0x6a'),'email',_0x6dd0('0x6b')],'raw':!![]});}return null;})['then'](function(_0x1eaa78){if(!_0x1eaa78)return null;_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x59')]=_0x1eaa78;return _0x254416;})[_0x6dd0('0x49')](function(_0x35eae5){if(_0x35eae5){if(_0x54c8e5['body'][_0x6dd0('0x6c')]){_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x6d')]=util[_0x6dd0('0x56')](_0x6dd0('0x6e'),_0x54c8e5[_0x6dd0('0x58')]['name']);_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x6f')]=_0x254416['channel'];_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x70')]=_0x254416['channel'];_0x254416['message'][_0x6dd0('0x71')]=_0x6dd0('0x53');return respondWithRpcPromise(_0x6dd0('0x72'),_0x6dd0('0x72'),{'event':_0x6dd0('0x73'),'message':_0x254416[_0x6dd0('0x1c')]},client9002)[_0x6dd0('0x49')](function(){return _0x254416;});}return _0x254416;}return null;})[_0x6dd0('0x49')](respondWithResult(_0x1180fe,null))[_0x6dd0('0x4f')](handleError(_0x1180fe,null));};var interaction_log=require('../../config/logger')(_0x6dd0('0x52'));exports[_0x6dd0('0x29')]=function(_0x55a2ee,_0x4030eb,_0xeb8571){var _0x2510e0={'agent':{},'channel':'fax'};if(_0x55a2ee['body']['id']){delete _0x55a2ee[_0x6dd0('0x4e')]['id'];}_0x55a2ee['body'][_0x6dd0('0x57')]=_0x55a2ee[_0x6dd0('0x4e')]['UserId']||_0x55a2ee[_0x6dd0('0x58')]['id'];_0x2510e0[_0x6dd0('0x59')]['id']=_0x55a2ee['body'][_0x6dd0('0x57')];return db['FaxMessage']['find']({'where':{'id':_0x55a2ee[_0x6dd0('0x4b')]['id'],'UserId':null}})[_0x6dd0('0x49')](handleEntityNotFound(_0x4030eb,null))[_0x6dd0('0x49')](function(_0x1160f7){if(_0x1160f7){_0x2510e0[_0x6dd0('0x1c')]=_0x1160f7[_0x6dd0('0x5a')]({'plain':!![]});return db[_0x6dd0('0x5b')][_0x6dd0('0x4d')]({'where':{'id':_0x1160f7[_0x6dd0('0x74')]}});}return null;})[_0x6dd0('0x49')](handleEntityNotFound(_0x4030eb,null))[_0x6dd0('0x49')](function(_0x14d40c){if(_0x14d40c){_0x2510e0[_0x6dd0('0x5f')]=_0x14d40c[_0x6dd0('0x5a')]({'plain':!![]});interaction_log[_0x6dd0('0x1e')](_0x6dd0('0x75'),_0x55a2ee[_0x6dd0('0x58')]['id'],_0x55a2ee['user']['name'],_0x55a2ee[_0x6dd0('0x58')][_0x6dd0('0x5e')],_0x2510e0[_0x6dd0('0x5f')]['id'],_0x55a2ee['body']?JSON['stringify'](_0x55a2ee[_0x6dd0('0x4e')]):_0x6dd0('0x60'));return respondWithRpcPromise(_0x6dd0('0x76'),_0x6dd0('0x77'),_0x2510e0);}return null;})[_0x6dd0('0x49')](function(_0x2b05e0){var _0x15fc61='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2b05e0[_0x6dd0('0x1c')][_0x6dd0('0x64')];return db[_0x6dd0('0x78')][_0x6dd0('0x37')](_0x15fc61,{'type':db[_0x6dd0('0x65')][_0x6dd0('0x66')][_0x6dd0('0x67')],'raw':!![]})[_0x6dd0('0x49')](function(_0x1a4c44){return _0x1a4c44;});})['then'](function(_0x57a3e1){if(_0x57a3e1){_0x2510e0[_0x6dd0('0x1c')][_0x6dd0('0x68')]=_0x57a3e1[0x0];if(!_0x55a2ee[_0x6dd0('0x4e')]['UserId'])return;return db[_0x6dd0('0x69')][_0x6dd0('0x4d')]({'where':{'id':_0x55a2ee[_0x6dd0('0x4e')][_0x6dd0('0x57')],'role':'agent'},'attributes':['id',_0x6dd0('0x2f'),_0x6dd0('0x6a'),_0x6dd0('0x79'),'internal'],'raw':!![]});}return null;})[_0x6dd0('0x49')](function(_0x4051d9){if(!_0x4051d9)return null;_0x2510e0[_0x6dd0('0x1c')]['agent']=_0x4051d9;return _0x2510e0;})[_0x6dd0('0x49')](function(_0x21b44c){if(_0x21b44c){_0x21b44c[_0x6dd0('0x1c')][_0x6dd0('0x6d')]=util[_0x6dd0('0x56')](_0x6dd0('0x6e'),_0x55a2ee[_0x6dd0('0x58')][_0x6dd0('0x2f')]);_0x21b44c[_0x6dd0('0x1c')][_0x6dd0('0x6f')]=_0x2510e0[_0x6dd0('0x6f')];_0x21b44c[_0x6dd0('0x1c')]['motionChannel']=_0x2510e0[_0x6dd0('0x6f')];_0x21b44c['message'][_0x6dd0('0x71')]=_0x6dd0('0x29');respondWithRpcPromise(_0x6dd0('0x72'),_0x6dd0('0x72'),{'event':_0x6dd0('0x7a'),'message':_0x21b44c[_0x6dd0('0x1c')]},client9002);return _0x2510e0;}return null;})[_0x6dd0('0x49')](respondWithResult(_0x4030eb,null))[_0x6dd0('0x4f')](handleError(_0x4030eb,null));};exports[_0x6dd0('0x7b')]=function(_0x48c61c,_0xd6866c){var _0x2e226d;return db[_0x6dd0('0x45')][_0x6dd0('0x7b')](_0x48c61c['body'],{})['then'](function(_0xeb39bc){_0x2e226d=_0xeb39bc;return db['CmContact'][_0x6dd0('0x7c')]({'where':{'id':_0x2e226d[_0x6dd0('0x64')]}});})[_0x6dd0('0x49')](function(_0x64e430){if(_[_0x6dd0('0x7d')](_0x64e430)){return;}else{_0x2e226d[_0x6dd0('0x54')]=_0x64e430[_0x6dd0('0x54')];return db[_0x6dd0('0x7e')][_0x6dd0('0x7c')]({'where':{'id':_0x2e226d['AttachmentId']}});}})[_0x6dd0('0x49')](function(_0x69202e){return respondWithRpcPromise(_0x6dd0('0x7f'),'SendFax',{'FaxAccountId':_['isNil'](_0x48c61c[_0x6dd0('0x4e')])?undefined:_0x48c61c[_0x6dd0('0x4e')][_0x6dd0('0x80')],'path':_[_0x6dd0('0x7d')](_0x69202e)?undefined:util[_0x6dd0('0x56')](_0x6dd0('0x81'),_0x69202e[_0x6dd0('0x82')]),'fax':_[_0x6dd0('0x7d')](_0x2e226d[_0x6dd0('0x54')])?undefined:_0x2e226d[_0x6dd0('0x54')],'AttachmentId':_0x2e226d['AttachmentId']},client9002);})[_0x6dd0('0x49')](respondWithResult(_0xd6866c,0xc9))[_0x6dd0('0x4f')](handleError(_0xd6866c,null));};exports[_0x6dd0('0x83')]=function(_0x32301d,_0xf62b12){var _0x13d029=path[_0x6dd0('0x84')](config[_0x6dd0('0x85')],_0x6dd0('0x86'),_0x6dd0('0x87'),_0x6dd0('0x88'));return db[_0x6dd0('0x45')]['find']({'where':{'id':_0x32301d[_0x6dd0('0x4b')]['id']},'include':[{'model':db['Attachment'],'as':_0x6dd0('0x7e')}]})[_0x6dd0('0x49')](handleEntityNotFound(_0xf62b12,null))[_0x6dd0('0x49')](function(_0x2c6bba){if(_0x2c6bba){return _0xf62b12[_0x6dd0('0x83')](path[_0x6dd0('0x84')](_0x13d029,_0x2c6bba[_0x6dd0('0x7e')][_0x6dd0('0x82')]));}})['catch'](handleError(_0xf62b12,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 38177e0..16a00a0 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 _0x11e5=['emit','hasOwnProperty','hook','events','FaxMessage','setMaxListeners','update','remove'];(function(_0x22f011,_0xf7f8d6){var _0x4935f4=function(_0x260e22){while(--_0x260e22){_0x22f011['push'](_0x22f011['shift']());}};_0x4935f4(++_0xf7f8d6);}(_0x11e5,0x8b));var _0x511e=function(_0x3e3bed,_0x28cdc0){_0x3e3bed=_0x3e3bed-0x0;var _0x30595b=_0x11e5[_0x3e3bed];return _0x30595b;};'use strict';var EventEmitter=require(_0x511e('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x511e('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x511e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x511e('0x3'),'afterDestroy':_0x511e('0x4')};function emitEvent(_0x101e06){return function(_0x5cab33,_0x249e4d,_0x4fbd4f){FaxMessageEvents['emit'](_0x101e06+':'+_0x5cab33['id'],_0x5cab33);FaxMessageEvents[_0x511e('0x5')](_0x101e06,_0x5cab33);_0x4fbd4f(null);};}for(var e in events){if(events[_0x511e('0x6')](e)){var event=events[e];FaxMessage[_0x511e('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xd69e=['events','../../mysqldb','FaxMessage','save','update','hasOwnProperty','hook','exports'];(function(_0xe3bf5c,_0x4a07ee){var _0x335a53=function(_0x43a2bb){while(--_0x43a2bb){_0xe3bf5c['push'](_0xe3bf5c['shift']());}};_0x335a53(++_0x4a07ee);}(_0xd69e,0xa0));var _0xed69=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xd69e[_0x2c7618];return _0x5ce3f0;};'use strict';var EventEmitter=require(_0xed69('0x0'));var FaxMessage=require(_0xed69('0x1'))['db'][_0xed69('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xed69('0x3'),'afterUpdate':_0xed69('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c00fe){return function(_0x5b941a,_0x5afae1,_0x3b30c5){FaxMessageEvents['emit'](_0x5c00fe+':'+_0x5b941a['id'],_0x5b941a);FaxMessageEvents['emit'](_0x5c00fe,_0x5b941a);_0x3b30c5(null);};}for(var e in events){if(events[_0xed69('0x5')](e)){var event=events[e];FaxMessage[_0xed69('0x6')](e,emitEvent(event));}}module[_0xed69('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 1dbcde9..d7bf698 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 _0x8b9b=['rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','FaxInteraction','findOne','FaxInteractionId','update','error','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path'];(function(_0x3cb133,_0x42eb10){var _0x8896cf=function(_0x5dc12b){while(--_0x5dc12b){_0x3cb133['push'](_0x3cb133['shift']());}};_0x8896cf(++_0x42eb10);}(_0x8b9b,0x18f));var _0xb8b9=function(_0x16e4c4,_0x1e67a1){_0x16e4c4=_0x16e4c4-0x0;var _0x2896fe=_0x8b9b[_0x16e4c4];return _0x2896fe;};'use strict';var _=require(_0xb8b9('0x0'));var util=require(_0xb8b9('0x1'));var logger=require('../../config/logger')(_0xb8b9('0x2'));var moment=require(_0xb8b9('0x3'));var BPromise=require(_0xb8b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8b9('0x5'));var rimraf=require(_0xb8b9('0x6'));var config=require(_0xb8b9('0x7'));var attributes=require(_0xb8b9('0x8'));module[_0xb8b9('0x9')]=function(_0x357f49,_0x58ed35){return _0x357f49[_0xb8b9('0xa')](_0xb8b9('0xb'),attributes,{'tableName':_0xb8b9('0xc'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xb8b9('0xd')],'type':_0xb8b9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42d499,_0x4b73fd,_0x58daf0){var _0x4ac351=_0x357f49[_0xb8b9('0xf')];var _0x32de18=_0x42d499[_0xb8b9('0x10')]({'plain':!![]});if(_0x32de18[_0xb8b9('0x11')][_0xb8b9('0x12')]()==='in'||_0x32de18['direction'][_0xb8b9('0x12')]()==='out'&&!_0x32de18[_0xb8b9('0x13')]&&!_['isNil'](_0x32de18[_0xb8b9('0x14')])){_0x4ac351[_0xb8b9('0x15')][_0xb8b9('0x16')]({'where':{'id':_0x32de18[_0xb8b9('0x17')]}})['then'](function(_0x2ffe10){if(_0x2ffe10){_0x2ffe10[_0xb8b9('0x18')]({'lastMsgAt':_0x32de18['createdAt'],'lastMsgDirection':_0x32de18[_0xb8b9('0x11')][_0xb8b9('0x12')]()});}})['catch'](function(_0x47e6df){console[_0xb8b9('0x19')](_0x47e6df);});}_0x58daf0();}},'charset':'utf8mb4','collate':_0xb8b9('0x1a')});}; \ No newline at end of file +var _0xe78d=['path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe78d,0x1d9));var _0xde78=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xe78d[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0xde78('0x0'));var util=require(_0xde78('0x1'));var logger=require(_0xde78('0x2'))(_0xde78('0x3'));var moment=require(_0xde78('0x4'));var BPromise=require(_0xde78('0x5'));var rp=require(_0xde78('0x6'));var fs=require('fs');var path=require(_0xde78('0x7'));var rimraf=require(_0xde78('0x8'));var config=require('../../config/environment');var attributes=require(_0xde78('0x9'));module[_0xde78('0xa')]=function(_0x56f19c,_0x57b003){return _0x56f19c[_0xde78('0xb')](_0xde78('0xc'),attributes,{'tableName':_0xde78('0xd'),'paranoid':![],'indexes':[{'name':_0xde78('0xe'),'fields':[_0xde78('0xf')],'type':_0xde78('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6b79aa,_0x47401c,_0xbde05b){var _0x53a53b=_0x56f19c[_0xde78('0x11')];var _0x3ce2a0=_0x6b79aa[_0xde78('0x12')]({'plain':!![]});if(_0x3ce2a0[_0xde78('0x13')][_0xde78('0x14')]()==='in'||_0x3ce2a0[_0xde78('0x13')]['toLowerCase']()===_0xde78('0x15')&&!_0x3ce2a0['secret']&&!_[_0xde78('0x16')](_0x3ce2a0['UserId'])){_0x53a53b[_0xde78('0x17')][_0xde78('0x18')]({'where':{'id':_0x3ce2a0[_0xde78('0x19')]}})[_0xde78('0x1a')](function(_0x4c9791){if(_0x4c9791){_0x4c9791[_0xde78('0x1b')]({'lastMsgAt':_0x3ce2a0['createdAt'],'lastMsgDirection':_0x3ce2a0[_0xde78('0x13')]['toLowerCase']()});}})[_0xde78('0x1c')](function(_0x7bb03d){console[_0xde78('0x1d')](_0x7bb03d);});}_0xbde05b();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index a02b0e8..11693d9 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 _0xb903=['options','raw','then','stringify','UpdateFaxMessage','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0x25b7cf,_0x4eace4){var _0xbd7943=function(_0x3903ac){while(--_0x3903ac){_0x25b7cf['push'](_0x25b7cf['shift']());}};_0xbd7943(++_0x4eace4);}(_0xb903,0x185));var _0x3b90=function(_0x30f093,_0x4ae418){_0x30f093=_0x30f093-0x0;var _0x1e0d31=_0xb903[_0x30f093];return _0x1e0d31;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3b90('0xc')],{'host':_0x3b90('0xd'),'port':0x18eb});var socket=require(_0x3b90('0xe'))(new Redis(config[_0x3b90('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x52401e,_0x51f916,_0x56261b){return new BPromise(function(_0x55db3f,_0x336913){return client[_0x3b90('0xf')](_0x52401e,_0x56261b)['then'](function(_0x30c49c){logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));logger[_0x3b90('0x12')](_0x3b90('0x13'),_0x51f916,'request\x20sent',JSON['stringify'](_0x30c49c));if(_0x30c49c[_0x3b90('0x14')]){if(_0x30c49c['error']['code']===0x1f4){logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c['error']['message']);return _0x336913(_0x30c49c[_0x3b90('0x14')][_0x3b90('0x16')]);}logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c[_0x3b90('0x14')]['message']);return _0x55db3f(_0x30c49c['error'][_0x3b90('0x16')]);}else{logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));_0x55db3f(_0x30c49c[_0x3b90('0x17')][_0x3b90('0x16')]);}})[_0x3b90('0x18')](function(_0x4f388b){logger[_0x3b90('0x14')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x4f388b);_0x336913(_0x4f388b);});});}exports[_0x3b90('0x19')]=function(_0x231690){var _0x535894=this;return new Promise(function(_0x39ae7c,_0x12e1cf){return db[_0x3b90('0x1a')][_0x3b90('0x1b')](_0x231690[_0x3b90('0x1c')],{'raw':_0x231690[_0x3b90('0x1d')]?_0x231690[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![]})[_0x3b90('0x1f')](function(_0x3e5bb8){logger['info'](_0x3b90('0x19'),_0x231690);logger[_0x3b90('0x12')](_0x3b90('0x19'),_0x231690,JSON[_0x3b90('0x20')](_0x3e5bb8));_0x39ae7c(_0x3e5bb8);})[_0x3b90('0x18')](function(_0x93b8e7){logger['error']('CreateFaxMessage',_0x93b8e7[_0x3b90('0x16')],_0x231690);_0x12e1cf(_0x535894[_0x3b90('0x14')](0x1f4,_0x93b8e7[_0x3b90('0x16')]));});});};exports[_0x3b90('0x21')]=function(_0x583523){var _0x414462=this;return new Promise(function(_0x2936d7,_0x1787d1){return db['FaxMessage'][_0x3b90('0x22')](_0x583523[_0x3b90('0x1c')],{'raw':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x583523[_0x3b90('0x1d')]?_0x583523['options'][_0x3b90('0x23')]||null:null,'attributes':_0x583523['options']?_0x583523[_0x3b90('0x1d')][_0x3b90('0x24')]||null:null,'limit':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x25')]||null:null})[_0x3b90('0x1f')](function(_0x290283){logger[_0x3b90('0x10')]('UpdateFaxMessage',_0x583523);logger['debug'](_0x3b90('0x21'),_0x583523,JSON[_0x3b90('0x20')](_0x290283));_0x2936d7(_0x290283);})[_0x3b90('0x18')](function(_0x1c2e84){logger['error']('UpdateFaxMessage',_0x1c2e84[_0x3b90('0x16')],_0x583523);_0x1787d1(_0x414462[_0x3b90('0x14')](0x1f4,_0x1c2e84[_0x3b90('0x16')]));});});}; \ No newline at end of file +var _0x6f0d=['../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3d6db1,_0x4358f8){var _0x5e1cc3=function(_0x3ad5af){while(--_0x3ad5af){_0x3d6db1['push'](_0x3d6db1['shift']());}};_0x5e1cc3(++_0x4358f8);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2723ca,_0x2a1013){_0x2723ca=_0x2723ca-0x0;var _0x7d9040=_0x6f0d[_0x2723ca];return _0x7d9040;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});config[_0xd6f0('0xa')]=_[_0xd6f0('0xb')](config[_0xd6f0('0xa')],{'host':_0xd6f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6f0('0xd'))[_0xd6f0('0xe')](socket);function respondWithRpcPromise(_0x2854cd,_0x382a2e,_0x225dcf){return new BPromise(function(_0x4db64a,_0x136eee){return client[_0xd6f0('0xf')](_0x2854cd,_0x225dcf)[_0xd6f0('0x10')](function(_0x44bba6){logger['info'](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x382a2e,_0xd6f0('0x12'),JSON[_0xd6f0('0x15')](_0x44bba6));if(_0x44bba6[_0xd6f0('0x16')]){if(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x17')]===0x1f4){logger['error'](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')]['message']);return _0x136eee(_0x44bba6[_0xd6f0('0x16')]['message']);}logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);return _0x4db64a(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);}else{logger[_0xd6f0('0x19')](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));_0x4db64a(_0x44bba6[_0xd6f0('0x1a')][_0xd6f0('0x18')]);}})[_0xd6f0('0x1b')](function(_0x327231){logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x327231);_0x136eee(_0x327231);});});}exports[_0xd6f0('0x1c')]=function(_0x5cd367){var _0x48ac38=this;return new Promise(function(_0x3939aa,_0x264104){return db[_0xd6f0('0x1d')]['create'](_0x5cd367[_0xd6f0('0x1e')],{'raw':_0x5cd367[_0xd6f0('0x1f')]?_0x5cd367['options'][_0xd6f0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ee584){logger[_0xd6f0('0x19')]('CreateFaxMessage',_0x5cd367);logger[_0xd6f0('0x13')](_0xd6f0('0x1c'),_0x5cd367,JSON['stringify'](_0x1ee584));_0x3939aa(_0x1ee584);})[_0xd6f0('0x1b')](function(_0x402070){logger[_0xd6f0('0x16')]('CreateFaxMessage',_0x402070[_0xd6f0('0x18')],_0x5cd367);_0x264104(_0x48ac38[_0xd6f0('0x16')](0x1f4,_0x402070['message']));});});};exports[_0xd6f0('0x21')]=function(_0x551be8){var _0x2042d5=this;return new Promise(function(_0x3fb5c3,_0x1630dc){return db[_0xd6f0('0x1d')][_0xd6f0('0x22')](_0x551be8[_0xd6f0('0x1e')],{'raw':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['where']||null:null,'attributes':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x23')]||null:null,'limit':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x24')]||null:null})[_0xd6f0('0x10')](function(_0x3151f8){logger[_0xd6f0('0x19')](_0xd6f0('0x21'),_0x551be8);logger[_0xd6f0('0x13')](_0xd6f0('0x21'),_0x551be8,JSON[_0xd6f0('0x15')](_0x3151f8));_0x3fb5c3(_0x3151f8);})[_0xd6f0('0x1b')](function(_0xbdd223){logger[_0xd6f0('0x16')](_0xd6f0('0x21'),_0xbdd223[_0xd6f0('0x18')],_0x551be8);_0x1630dc(_0x2042d5[_0xd6f0('0x16')](0x1f4,_0xbdd223[_0xd6f0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 3a6f433..d7a40ba 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 _0xf00e=['faxMessage:','./faxMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x52f163,_0x2ae764){var _0x134f21=function(_0x4b28d5){while(--_0x4b28d5){_0x52f163['push'](_0x52f163['shift']());}};_0x134f21(++_0x2ae764);}(_0xf00e,0x1d1));var _0xef00=function(_0x30d7ac,_0x8c30bd){_0x30d7ac=_0x30d7ac-0x0;var _0x381ccb=_0xf00e[_0x30d7ac];return _0x381ccb;};'use strict';var FaxMessageEvents=require(_0xef00('0x0'));var events=['save',_0xef00('0x1'),_0xef00('0x2')];function createListener(_0x3f1a63,_0xead19){return function(_0x3e2b25){_0xead19[_0xef00('0x3')](_0x3f1a63,_0x3e2b25);};}function removeListener(_0x1fd10b,_0x20a2e3){return function(){FaxMessageEvents[_0xef00('0x4')](_0x1fd10b,_0x20a2e3);};}exports[_0xef00('0x5')]=function(_0x1386d9){for(var _0x18967c=0x0,_0x31e58e=events[_0xef00('0x6')];_0x18967c<_0x31e58e;_0x18967c++){var _0x37c938=events[_0x18967c];var _0xddd478=createListener(_0xef00('0x7')+_0x37c938,_0x1386d9);FaxMessageEvents['on'](_0x37c938,_0xddd478);}}; \ No newline at end of file +var _0xc08b=['removeListener','length','save'];(function(_0x329696,_0x1bc80e){var _0x529b15=function(_0x23c36d){while(--_0x23c36d){_0x329696['push'](_0x329696['shift']());}};_0x529b15(++_0x1bc80e);}(_0xc08b,0x1c4));var _0xbc08=function(_0x2a450f,_0x45193e){_0x2a450f=_0x2a450f-0x0;var _0x1f978e=_0xc08b[_0x2a450f];return _0x1f978e;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xbc08('0x0'),'remove','update'];function createListener(_0x2a3f39,_0x4ca563){return function(_0x325815){_0x4ca563['emit'](_0x2a3f39,_0x325815);};}function removeListener(_0x4cda1b,_0xcd0825){return function(){FaxMessageEvents[_0xbc08('0x1')](_0x4cda1b,_0xcd0825);};}exports['register']=function(_0x416317){for(var _0x2403bc=0x0,_0x528d37=events[_0xbc08('0x2')];_0x2403bc<_0x528d37;_0x2403bc++){var _0x2e8a77=events[_0x2403bc];var _0x335254=createListener('faxMessage:'+_0x2e8a77,_0x416317);FaxMessageEvents['on'](_0x2e8a77,_0x335254);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 509234d..9a03fa8 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 _0xbb53=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','tracked','faxmessage:create','put','update','/:id/accept','accept','reject','destroy'];(function(_0xcf9b5,_0x1735e1){var _0x3107c8=function(_0x5431de){while(--_0x5431de){_0xcf9b5['push'](_0xcf9b5['shift']());}};_0x3107c8(++_0x1735e1);}(_0xbb53,0x121));var _0x3bb5=function(_0x53968c,_0x3c7195){_0x53968c=_0x53968c-0x0;var _0x580fa0=_0xbb53[_0x53968c];return _0x580fa0;};'use strict';var multer=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var path=require(_0x3bb5('0x2'));var timeout=require(_0x3bb5('0x3'));var express=require(_0x3bb5('0x4'));var router=express[_0x3bb5('0x5')]();var fs_extra=require(_0x3bb5('0x6'));var auth=require(_0x3bb5('0x7'));var interaction=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var controller=require('./faxMessage.controller');router['get']('/',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xb')]);router[_0x3bb5('0xc')](_0x3bb5('0xd'),auth[_0x3bb5('0xa')](),controller['describe']);router['get']('/:id',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xe')]);router[_0x3bb5('0xc')]('/:id/download',auth[_0x3bb5('0xa')](),controller['download']);router['post']('/',auth[_0x3bb5('0xa')](),interaction[_0x3bb5('0xf')]('fax',_0x3bb5('0x10')),controller['create']);router[_0x3bb5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3bb5('0x12')]);router[_0x3bb5('0x11')](_0x3bb5('0x13'),auth['isAuthenticated'](),controller[_0x3bb5('0x14')]);router[_0x3bb5('0x11')]('/:id/reject',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3bb5('0x16')]);module[_0x3bb5('0x17')]=router; \ No newline at end of file +var _0x3667=['/describe','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index'];(function(_0x8c3228,_0xcdcfc4){var _0x1cf5e5=function(_0xf3b35f){while(--_0xf3b35f){_0x8c3228['push'](_0x8c3228['shift']());}};_0x1cf5e5(++_0xcdcfc4);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var path=require(_0x7366('0x2'));var timeout=require(_0x7366('0x3'));var express=require(_0x7366('0x4'));var router=express['Router']();var fs_extra=require(_0x7366('0x5'));var auth=require(_0x7366('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7366('0x7'));var controller=require(_0x7366('0x8'));router[_0x7366('0x9')]('/',auth[_0x7366('0xa')](),controller[_0x7366('0xb')]);router['get'](_0x7366('0xc'),auth[_0x7366('0xa')](),controller[_0x7366('0xd')]);router[_0x7366('0x9')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller[_0x7366('0xf')]);router[_0x7366('0x9')](_0x7366('0x10'),auth[_0x7366('0xa')](),controller[_0x7366('0x11')]);router[_0x7366('0x12')]('/',auth[_0x7366('0xa')](),interaction[_0x7366('0x13')](_0x7366('0x14'),_0x7366('0x15')),controller[_0x7366('0x16')]);router[_0x7366('0x17')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller[_0x7366('0x18')]);router[_0x7366('0x17')](_0x7366('0x19'),auth[_0x7366('0xa')](),controller[_0x7366('0x1a')]);router[_0x7366('0x17')](_0x7366('0x1b'),auth[_0x7366('0xa')](),controller['reject']);router[_0x7366('0x1c')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller[_0x7366('0x1d')]);module[_0x7366('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 80225ed..68128c7 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 _0x8ab2=['exports','STRING','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x49013e,_0x212e61){var _0x271117=function(_0x3841bb){while(--_0x3841bb){_0x49013e['push'](_0x49013e['shift']());}};_0x271117(++_0x212e61);}(_0x8ab2,0x89));var _0x28ab=function(_0xfe3826,_0x57b2d2){_0xfe3826=_0xfe3826-0x0;var _0x2e7b48=_0x8ab2[_0xfe3826];return _0x2e7b48;};'use strict';var Sequelize=require(_0x28ab('0x0'));module[_0x28ab('0x1')]={'name':{'type':Sequelize[_0x28ab('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x28ab('0x2')]},'timeout':{'type':Sequelize[_0x28ab('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x28ab('0x4')]('rrmemory','beepall',_0x28ab('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x28ab('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x834c=['ENUM','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x1bb672,_0x40baa8){var _0x3b4b88=function(_0x46c8e1){while(--_0x46c8e1){_0x1bb672['push'](_0x1bb672['shift']());}};_0x3b4b88(++_0x40baa8);}(_0x834c,0x73));var _0xc834=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0x834c[_0x48cb1f];return _0x172c4d;};'use strict';var Sequelize=require(_0xc834('0x0'));module[_0xc834('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc834('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc834('0x3')]},'timeout':{'type':Sequelize[_0xc834('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc834('0x5')]('rrmemory',_0xc834('0x6'),_0xc834('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc834('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 053e5f3..cc558e4 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 _0x7adf=['undefined','limit','count','Content-Range','apply','save','update','then','FaxQueues','UserProfileResource','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','FaxQueue','includeAll','findAll','rows','catch','show','filters','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','nolimit','UserFaxQueue','findAndCountAll','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','User','Agents','online','flatMap','transaction','addTeams','each','findOrCreate','forEach','removeTeams','ids','select','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','includes','all','union','compact','isEmpty','removeAgents','addAgents','omit','emit','userFaxQueue:save','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./faxQueue.socket','status','end','json','offset'];(function(_0x9340d6,_0x3393e8){var _0x47f865=function(_0x451bf7){while(--_0x451bf7){_0x9340d6['push'](_0x9340d6['shift']());}};_0x47f865(++_0x3393e8);}(_0x7adf,0x182));var _0xf7ad=function(_0x1e851f,_0x1c7630){_0x1e851f=_0x1e851f-0x0;var _0x4c3e02=_0x7adf[_0x1e851f];return _0x4c3e02;};'use strict';var emlformat=require(_0xf7ad('0x0'));var rimraf=require(_0xf7ad('0x1'));var zipdir=require(_0xf7ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7ad('0x3'));var moment=require(_0xf7ad('0x4'));var BPromise=require(_0xf7ad('0x5'));var Mustache=require('mustache');var util=require(_0xf7ad('0x6'));var path=require(_0xf7ad('0x7'));var sox=require(_0xf7ad('0x8'));var csv=require(_0xf7ad('0x9'));var ejs=require(_0xf7ad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7ad('0xb'));var squel=require(_0xf7ad('0xc'));var crypto=require('crypto');var jsforce=require(_0xf7ad('0xd'));var deskjs=require(_0xf7ad('0xe'));var toCsv=require(_0xf7ad('0x9'));var querystring=require(_0xf7ad('0xf'));var Papa=require(_0xf7ad('0x10'));var Redis=require(_0xf7ad('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf7ad('0x12'));var as=require(_0xf7ad('0x13'));var hardwareService=require(_0xf7ad('0x14'));var logger=require(_0xf7ad('0x15'))(_0xf7ad('0x16'));var utils=require(_0xf7ad('0x17'));var config=require(_0xf7ad('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf7ad('0x19'))['db'];config['redis']=_[_0xf7ad('0x1a')](config[_0xf7ad('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xf7ad('0x1c'))(new Redis(config[_0xf7ad('0x1b')]));require(_0xf7ad('0x1d'))['register'](socket);function respondWithStatusCode(_0x6477b2,_0x2d9f4a){_0x2d9f4a=_0x2d9f4a||0xcc;return function(_0x436033){if(_0x436033){return _0x6477b2['sendStatus'](_0x2d9f4a);}return _0x6477b2[_0xf7ad('0x1e')](_0x2d9f4a)[_0xf7ad('0x1f')]();};}function respondWithResult(_0x48e30a,_0x3f27f6){_0x3f27f6=_0x3f27f6||0xc8;return function(_0x1b5d58){if(_0x1b5d58){return _0x48e30a[_0xf7ad('0x1e')](_0x3f27f6)[_0xf7ad('0x20')](_0x1b5d58);}};}function respondWithFilteredResult(_0x23bbd3,_0xc9d155){return function(_0x852c76){if(_0x852c76){var _0x1c5403=typeof _0xc9d155[_0xf7ad('0x21')]===_0xf7ad('0x22')&&typeof _0xc9d155[_0xf7ad('0x23')]===_0xf7ad('0x22');var _0x3d79ef=_0x852c76[_0xf7ad('0x24')];var _0x46e7d4=_0x1c5403?0x0:_0xc9d155['offset'];var _0x2d6236=_0x1c5403?_0x852c76[_0xf7ad('0x24')]:_0xc9d155[_0xf7ad('0x21')]+_0xc9d155['limit'];var _0x446685;if(_0x2d6236>=_0x3d79ef){_0x2d6236=_0x3d79ef;_0x446685=0xc8;}else{_0x446685=0xce;}_0x23bbd3[_0xf7ad('0x1e')](_0x446685);return _0x23bbd3['set'](_0xf7ad('0x25'),_0x46e7d4+'-'+_0x2d6236+'/'+_0x3d79ef)[_0xf7ad('0x20')](_0x852c76);}return null;};}function patchUpdates(_0x338dc4){return function(_0x2fd7f9){try{jsonpatch[_0xf7ad('0x26')](_0x2fd7f9,_0x338dc4,!![]);}catch(_0x54d6ac){return BPromise['reject'](_0x54d6ac);}return _0x2fd7f9[_0xf7ad('0x27')]();};}function saveUpdates(_0x1637ad,_0x227483){return function(_0xb9e848){if(_0xb9e848){return _0xb9e848[_0xf7ad('0x28')](_0x1637ad)[_0xf7ad('0x29')](function(_0x10d3a7){return _0x10d3a7;});}return null;};}function removeEntity(_0x3f359f,_0x2c64a9){return function(_0x3b3b86){if(_0x3b3b86){return _0x3b3b86['destroy']()[_0xf7ad('0x29')](function(){var _0x42595c=_0x3b3b86['get']({'plain':!![]});var _0x509140=_0xf7ad('0x2a');return db[_0xf7ad('0x2b')][_0xf7ad('0x2c')]({'where':{'type':_0x509140,'resourceId':_0x42595c['id']}})[_0xf7ad('0x29')](function(){return _0x3b3b86;});})[_0xf7ad('0x29')](function(){_0x3f359f[_0xf7ad('0x1e')](0xcc)[_0xf7ad('0x1f')]();});}};}function handleEntityNotFound(_0x553764,_0x19749f){return function(_0x57d768){if(!_0x57d768){_0x553764[_0xf7ad('0x2d')](0x194);}return _0x57d768;};}function handleError(_0x194606,_0x3adf0a){_0x3adf0a=_0x3adf0a||0x1f4;return function(_0x47896d){logger['error'](_0x47896d['stack']);if(_0x47896d[_0xf7ad('0x2e')]){delete _0x47896d['name'];}_0x194606[_0xf7ad('0x1e')](_0x3adf0a)[_0xf7ad('0x2f')](_0x47896d);};}exports[_0xf7ad('0x30')]=function(_0x3ce995,_0x11f2c4){var _0x5aa95d={},_0x5dd9e0={},_0x202791={'count':0x0,'rows':[]};var _0x3606ff=_[_0xf7ad('0x31')](db['FaxQueue'][_0xf7ad('0x32')],function(_0x2c9eef){return{'name':_0x2c9eef[_0xf7ad('0x33')],'type':_0x2c9eef['type'][_0xf7ad('0x34')]};});_0x5dd9e0[_0xf7ad('0x35')]=_['map'](_0x3606ff,_0xf7ad('0x2e'));_0x5dd9e0['query']=_[_0xf7ad('0x36')](_0x3ce995[_0xf7ad('0x37')]);_0x5dd9e0['filters']=_[_0xf7ad('0x38')](_0x5dd9e0[_0xf7ad('0x35')],_0x5dd9e0[_0xf7ad('0x37')]);_0x5aa95d[_0xf7ad('0x39')]=_['intersection'](_0x5dd9e0[_0xf7ad('0x35')],qs[_0xf7ad('0x3a')](_0x3ce995['query'][_0xf7ad('0x3a')]));_0x5aa95d['attributes']=_0x5aa95d[_0xf7ad('0x39')][_0xf7ad('0x3b')]?_0x5aa95d['attributes']:_0x5dd9e0[_0xf7ad('0x35')];if(!_0x3ce995[_0xf7ad('0x37')][_0xf7ad('0x3c')]('nolimit')){_0x5aa95d[_0xf7ad('0x23')]=qs['limit'](_0x3ce995[_0xf7ad('0x37')]['limit']);_0x5aa95d[_0xf7ad('0x21')]=qs[_0xf7ad('0x21')](_0x3ce995[_0xf7ad('0x37')][_0xf7ad('0x21')]);}_0x5aa95d[_0xf7ad('0x3d')]=qs[_0xf7ad('0x3e')](_0x3ce995[_0xf7ad('0x37')][_0xf7ad('0x3e')]);_0x5aa95d[_0xf7ad('0x3f')]=qs['filters'](_[_0xf7ad('0x40')](_0x3ce995[_0xf7ad('0x37')],_0x5dd9e0['filters']),_0x3606ff);if(_0x3ce995['query'][_0xf7ad('0x41')]){_0x5aa95d['where']=_['merge'](_0x5aa95d[_0xf7ad('0x3f')],{'$or':_[_0xf7ad('0x31')](_0x3606ff,function(_0x5c4d9c){if(_0x5c4d9c[_0xf7ad('0x42')]!=='VIRTUAL'){var _0x4cb47b={};_0x4cb47b[_0x5c4d9c[_0xf7ad('0x2e')]]={'$like':'%'+_0x3ce995[_0xf7ad('0x37')][_0xf7ad('0x41')]+'%'};return _0x4cb47b;}})});}_0x5aa95d=_[_0xf7ad('0x43')]({},_0x5aa95d,_0x3ce995[_0xf7ad('0x44')]);var _0x40c5d5={'where':_0x5aa95d[_0xf7ad('0x3f')]};return db[_0xf7ad('0x45')][_0xf7ad('0x24')](_0x40c5d5)[_0xf7ad('0x29')](function(_0x57a2a7){_0x202791[_0xf7ad('0x24')]=_0x57a2a7;if(_0x3ce995[_0xf7ad('0x37')][_0xf7ad('0x46')]){_0x5aa95d['include']=[{'all':!![]}];}return db['FaxQueue'][_0xf7ad('0x47')](_0x5aa95d);})[_0xf7ad('0x29')](function(_0x34dce3){_0x202791[_0xf7ad('0x48')]=_0x34dce3;return _0x202791;})[_0xf7ad('0x29')](respondWithFilteredResult(_0x11f2c4,_0x5aa95d))[_0xf7ad('0x49')](handleError(_0x11f2c4,null));};exports[_0xf7ad('0x4a')]=function(_0x184d70,_0x18a1ba){var _0x436bb6={'raw':!![],'where':{'id':_0x184d70['params']['id']}},_0x50c1ee={};_0x50c1ee[_0xf7ad('0x35')]=_['keys'](db['FaxQueue'][_0xf7ad('0x32')]);_0x50c1ee[_0xf7ad('0x37')]=_[_0xf7ad('0x36')](_0x184d70['query']);_0x50c1ee[_0xf7ad('0x4b')]=_['intersection'](_0x50c1ee['model'],_0x50c1ee[_0xf7ad('0x37')]);_0x436bb6['attributes']=_[_0xf7ad('0x38')](_0x50c1ee[_0xf7ad('0x35')],qs[_0xf7ad('0x3a')](_0x184d70[_0xf7ad('0x37')][_0xf7ad('0x3a')]));_0x436bb6[_0xf7ad('0x39')]=_0x436bb6[_0xf7ad('0x39')][_0xf7ad('0x3b')]?_0x436bb6['attributes']:_0x50c1ee[_0xf7ad('0x35')];if(_0x184d70[_0xf7ad('0x37')][_0xf7ad('0x46')]){_0x436bb6[_0xf7ad('0x4c')]=[{'all':!![]}];}_0x436bb6=_[_0xf7ad('0x43')]({},_0x436bb6,_0x184d70[_0xf7ad('0x44')]);return db[_0xf7ad('0x45')][_0xf7ad('0x4d')](_0x436bb6)[_0xf7ad('0x29')](handleEntityNotFound(_0x18a1ba,null))[_0xf7ad('0x29')](respondWithResult(_0x18a1ba,null))[_0xf7ad('0x49')](handleError(_0x18a1ba,null));};exports['create']=function(_0x14dc5c,_0x248b01){return db[_0xf7ad('0x45')][_0xf7ad('0x4e')](_0x14dc5c[_0xf7ad('0x4f')],{})[_0xf7ad('0x29')](function(_0x64c04e){var _0x17906e=_0x14dc5c[_0xf7ad('0x50')][_0xf7ad('0x51')]({'plain':!![]});if(!_0x17906e)throw new Error(_0xf7ad('0x52'));if(_0x17906e['role']===_0xf7ad('0x50')){var _0x2ef80c=_0x64c04e[_0xf7ad('0x51')]({'plain':!![]});var _0x578ff4=_0xf7ad('0x2a');return db[_0xf7ad('0x53')][_0xf7ad('0x4d')]({'where':{'name':_0x578ff4,'userProfileId':_0x17906e['userProfileId']},'raw':!![]})[_0xf7ad('0x29')](function(_0x53efb7){if(_0x53efb7&&_0x53efb7[_0xf7ad('0x54')]===0x0){return db[_0xf7ad('0x2b')][_0xf7ad('0x4e')]({'name':_0x2ef80c[_0xf7ad('0x2e')],'resourceId':_0x2ef80c['id'],'type':_0x53efb7[_0xf7ad('0x2e')],'sectionId':_0x53efb7['id']},{})[_0xf7ad('0x29')](function(){return _0x64c04e;});}else{return _0x64c04e;}})[_0xf7ad('0x49')](function(_0x59433f){logger[_0xf7ad('0x55')](_0xf7ad('0x56'),_0x59433f);throw _0x59433f;});}return _0x64c04e;})[_0xf7ad('0x29')](respondWithResult(_0x248b01,0xc9))[_0xf7ad('0x49')](handleError(_0x248b01,null));};exports[_0xf7ad('0x28')]=function(_0x2f69ea,_0x14b36a){if(_0x2f69ea['body']['id']){delete _0x2f69ea[_0xf7ad('0x4f')]['id'];}return db[_0xf7ad('0x45')]['find']({'where':{'id':_0x2f69ea[_0xf7ad('0x57')]['id']}})[_0xf7ad('0x29')](handleEntityNotFound(_0x14b36a,null))[_0xf7ad('0x29')](saveUpdates(_0x2f69ea[_0xf7ad('0x4f')],null))[_0xf7ad('0x29')](respondWithResult(_0x14b36a,null))[_0xf7ad('0x49')](handleError(_0x14b36a,null));};exports[_0xf7ad('0x2c')]=function(_0x16c02d,_0x4db7f4){return db[_0xf7ad('0x45')]['find']({'where':{'id':_0x16c02d[_0xf7ad('0x57')]['id']}})[_0xf7ad('0x29')](handleEntityNotFound(_0x4db7f4,null))[_0xf7ad('0x29')](removeEntity(_0x4db7f4,null))[_0xf7ad('0x49')](handleError(_0x4db7f4,null));};exports[_0xf7ad('0x58')]=function(_0x5d6d4c,_0x20883b){return db[_0xf7ad('0x45')][_0xf7ad('0x58')]()[_0xf7ad('0x29')](respondWithResult(_0x20883b,null))[_0xf7ad('0x49')](handleError(_0x20883b,null));};exports['getMembers']=function(_0x39ad31,_0x4ff5ae,_0x5984a0){var _0xf372b2={'raw':!![],'where':{}},_0xdb03c7={},_0x9e83b6;return db[_0xf7ad('0x45')][_0xf7ad('0x59')]({'where':{'id':_0x39ad31['params']['id']}})[_0xf7ad('0x29')](handleEntityNotFound(_0x4ff5ae,null))[_0xf7ad('0x29')](function(_0x1b893f){if(_0x1b893f){_0x9e83b6=_0x1b893f[_0xf7ad('0x51')]({'plain':!![]});_0xdb03c7[_0xf7ad('0x35')]=_['keys'](db['UserFaxQueue'][_0xf7ad('0x32')]);_0xdb03c7[_0xf7ad('0x37')]=_[_0xf7ad('0x36')](_0x39ad31[_0xf7ad('0x37')]);_0xdb03c7[_0xf7ad('0x4b')]=_[_0xf7ad('0x38')](_0xdb03c7[_0xf7ad('0x35')],_0xdb03c7[_0xf7ad('0x37')]);_0xf372b2[_0xf7ad('0x39')]=_[_0xf7ad('0x38')](_0xdb03c7[_0xf7ad('0x35')],qs[_0xf7ad('0x3a')](_0x39ad31[_0xf7ad('0x37')]['fields']));_0xf372b2[_0xf7ad('0x39')]=_0xf372b2[_0xf7ad('0x39')][_0xf7ad('0x3b')]?_0xf372b2[_0xf7ad('0x39')]:_0xdb03c7[_0xf7ad('0x35')];if(!_0x39ad31['query'][_0xf7ad('0x3c')](_0xf7ad('0x5a'))){_0xf372b2[_0xf7ad('0x23')]=qs[_0xf7ad('0x23')](_0x39ad31[_0xf7ad('0x37')][_0xf7ad('0x23')]);_0xf372b2[_0xf7ad('0x21')]=qs['offset'](_0x39ad31[_0xf7ad('0x37')]['offset']);}_0xf372b2['order']=qs[_0xf7ad('0x3e')](_0x39ad31['query'][_0xf7ad('0x3e')]);_0xf372b2[_0xf7ad('0x3f')]=qs[_0xf7ad('0x4b')](_[_0xf7ad('0x40')](_0x39ad31[_0xf7ad('0x37')],_0xdb03c7[_0xf7ad('0x4b')]));_0xf372b2['where']['FaxQueueId']=_0x1b893f['id'];if(_0x39ad31[_0xf7ad('0x37')][_0xf7ad('0x41')]){_0xf372b2[_0xf7ad('0x3f')]=_[_0xf7ad('0x43')](_0xf372b2[_0xf7ad('0x3f')],{'$or':_['map'](_0xf372b2[_0xf7ad('0x39')],function(_0x566934){var _0x360d1b={};_0x360d1b[_0x566934]={'$like':'%'+_0x39ad31[_0xf7ad('0x37')][_0xf7ad('0x41')]+'%'};return _0x360d1b;})});}_0xf372b2=_[_0xf7ad('0x43')]({},_0xf372b2,_0x39ad31['options']);return db[_0xf7ad('0x5b')][_0xf7ad('0x47')](_0xf372b2);}})['then'](function(_0x231593){if(_0x231593){return db['User'][_0xf7ad('0x5c')]({'where':{'id':_[_0xf7ad('0x31')](_0x231593,_0xf7ad('0x5d')),'role':_0xf7ad('0x5e')},'attributes':['id',_0xf7ad('0x2e'),_0xf7ad('0x5f'),'updatedAt',_0xf7ad('0x60')]});}})[_0xf7ad('0x29')](function(_0x577345){if(_0x577345){return{'count':_0x577345[_0xf7ad('0x24')],'rows':_['map'](_0x577345[_0xf7ad('0x48')],function(_0xa4fa5b){return{'membername':_0xa4fa5b[_0xf7ad('0x2e')],'UserId':_0xa4fa5b['id'],'queue_name':_0x9e83b6[_0xf7ad('0x2e')],'FaxQueueId':_0x9e83b6['id'],'interface':util[_0xf7ad('0x61')](_0xf7ad('0x62'),_0xf7ad('0x63'),_0xa4fa5b[_0xf7ad('0x2e')]),'penalty':0x0,'paused':_0xa4fa5b['faxPause'],'createdAt':_0xa4fa5b[_0xf7ad('0x60')],'updatedAt':_0xa4fa5b[_0xf7ad('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf7ad('0x29')](respondWithFilteredResult(_0x4ff5ae,_0xf372b2))['catch'](handleError(_0x4ff5ae,null));};exports['getTeams']=function(_0x3866c4,_0xfa4922,_0x3469ae){var _0x5022e9={};var _0x245bb1={};var _0x12af49;var _0x316243;return db[_0xf7ad('0x45')][_0xf7ad('0x59')]({'where':{'id':_0x3866c4[_0xf7ad('0x57')]['id']}})[_0xf7ad('0x29')](handleEntityNotFound(_0xfa4922,null))[_0xf7ad('0x29')](function(_0x26cb34){if(_0x26cb34){_0x12af49=_0x26cb34;_0x245bb1[_0xf7ad('0x35')]=_['keys'](db[_0xf7ad('0x65')][_0xf7ad('0x32')]);_0x245bb1[_0xf7ad('0x37')]=_[_0xf7ad('0x36')](_0x3866c4[_0xf7ad('0x37')]);_0x245bb1[_0xf7ad('0x4b')]=_[_0xf7ad('0x38')](_0x245bb1[_0xf7ad('0x35')],_0x245bb1['query']);_0x5022e9[_0xf7ad('0x39')]=_['intersection'](_0x245bb1[_0xf7ad('0x35')],qs[_0xf7ad('0x3a')](_0x3866c4[_0xf7ad('0x37')]['fields']));_0x5022e9[_0xf7ad('0x39')]=_0x5022e9[_0xf7ad('0x39')]['length']?_0x5022e9['attributes']:_0x245bb1['model'];_0x5022e9['order']=qs[_0xf7ad('0x3e')](_0x3866c4[_0xf7ad('0x37')][_0xf7ad('0x3e')]);_0x5022e9[_0xf7ad('0x3f')]=qs['filters'](_[_0xf7ad('0x40')](_0x3866c4[_0xf7ad('0x37')],_0x245bb1['filters']));if(_0x3866c4['query'][_0xf7ad('0x41')]){_0x5022e9[_0xf7ad('0x3f')]=_[_0xf7ad('0x43')](_0x5022e9[_0xf7ad('0x3f')],{'$or':_[_0xf7ad('0x31')](_0x5022e9['attributes'],function(_0xee8f1){var _0x5c4948={};_0x5c4948[_0xee8f1]={'$like':'%'+_0x3866c4[_0xf7ad('0x37')][_0xf7ad('0x41')]+'%'};return _0x5c4948;})});}_0x5022e9=_[_0xf7ad('0x43')]({},_0x5022e9,_0x3866c4[_0xf7ad('0x44')]);return _0x12af49[_0xf7ad('0x66')](_0x5022e9);}})[_0xf7ad('0x29')](function(_0x1d14e6){if(_0x1d14e6){_0x316243=_0x1d14e6[_0xf7ad('0x3b')];if(!_0x3866c4[_0xf7ad('0x37')][_0xf7ad('0x3c')](_0xf7ad('0x5a'))){_0x5022e9[_0xf7ad('0x23')]=qs[_0xf7ad('0x23')](_0x3866c4['query']['limit']);_0x5022e9['offset']=qs[_0xf7ad('0x21')](_0x3866c4[_0xf7ad('0x37')][_0xf7ad('0x21')]);}return _0x12af49[_0xf7ad('0x66')](_0x5022e9);}})[_0xf7ad('0x29')](function(_0x48bb34){if(_0x48bb34){return _0x48bb34?{'count':_0x316243,'rows':_0x48bb34}:null;}})['then'](respondWithResult(_0xfa4922,null))['catch'](handleError(_0xfa4922,null));};exports['addTeams']=function(_0x4a816a,_0x4f837e,_0x171905){var _0x15fd88=_0x4a816a[_0xf7ad('0x4f')]['ids'];return db[_0xf7ad('0x65')][_0xf7ad('0x47')]({'where':{'id':_0x15fd88},'attributes':['id'],'include':[{'model':db[_0xf7ad('0x67')],'as':_0xf7ad('0x68'),'attributes':['id',_0xf7ad('0x2e'),_0xf7ad('0x69'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x17d1fe){if(_0x17d1fe){var _0x3df06c=_[_0xf7ad('0x6a')](_0x17d1fe,function(_0x4259a2){var _0x20dee9=_0x4259a2[_0xf7ad('0x51')]({'plain':!![]});return _0x20dee9[_0xf7ad('0x68')];});return db[_0xf7ad('0x45')][_0xf7ad('0x4d')]({'where':{'id':_0x4a816a[_0xf7ad('0x57')]['id']}})['then'](function(_0x22933f){return db['sequelize'][_0xf7ad('0x6b')](function(_0x4a33c1){return _0x22933f[_0xf7ad('0x6c')](_0x15fd88,{'transaction':_0x4a33c1})[_0xf7ad('0x29')](function(){return BPromise[_0xf7ad('0x6d')](_0x3df06c,function(_0x1badb2){return db['UserFaxQueue'][_0xf7ad('0x6e')]({'where':{'UserId':_0x1badb2['id'],'FaxQueueId':_0x4a816a['params']['id']},'transaction':_0x4a33c1});});})[_0xf7ad('0x29')](function(){_0x3df06c[_0xf7ad('0x6f')](function(_0x360e41){socket['emit']('userFaxQueue:save',{'UserId':_0x360e41['id'],'FaxQueueId':_0x22933f['id']});});});});});}})['then'](respondWithStatusCode(_0x4f837e,null))[_0xf7ad('0x49')](handleError(_0x4f837e,null));};exports[_0xf7ad('0x70')]=function(_0x285c5f,_0x160102,_0x5bea68){return db[_0xf7ad('0x65')][_0xf7ad('0x47')]({'where':{'id':_0x285c5f[_0xf7ad('0x37')][_0xf7ad('0x71')]},'attributes':['id'],'include':[{'model':db[_0xf7ad('0x67')],'as':_0xf7ad('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x160102,null))[_0xf7ad('0x29')](function(_0x443add){var _0x5d5bd7=_[_0xf7ad('0x31')](_0x443add,'id');var _0x410ae0=[];var _0x484b30=[];var _0xc2a5fd=squel[_0xf7ad('0x72')]();_0xc2a5fd['field'](_0xf7ad('0x73'))['from'](_0xf7ad('0x74'),'tq')['join'](_0xf7ad('0x75'),'ut',_0xf7ad('0x76'))[_0xf7ad('0x3f')](_0xf7ad('0x77'),_0x285c5f['params']['id']);for(var _0x320b58=0x0;_0x320b58<_0x443add[_0xf7ad('0x3b')];_0x320b58+=0x1){let _0x17caa1=_0x443add[_0x320b58];for(var _0x3561c4=0x0;_0x3561c4<_0x17caa1[_0xf7ad('0x68')][_0xf7ad('0x3b')];_0x3561c4+=0x1){let _0x5ab500=_0x17caa1[_0xf7ad('0x68')][_0x3561c4];var _0x549010=_0xc2a5fd[_0xf7ad('0x78')]();_0x549010['where'](_0xf7ad('0x79'),_0x5ab500['id']);_0x484b30[_0xf7ad('0x7a')](db[_0xf7ad('0x7b')][_0xf7ad('0x37')](_0x549010[_0xf7ad('0x7c')](),{'type':db[_0xf7ad('0x7b')][_0xf7ad('0x7d')][_0xf7ad('0x7e')]})['then'](function(_0x6ed0bd){if(_0x6ed0bd[_0xf7ad('0x3b')]===0x1){return _0x5ab500['id'];}else{var _0xeea54f=_['every'](_['map'](_0x6ed0bd,'TeamId'),function(_0x118f65){return _[_0xf7ad('0x7f')](_0x5d5bd7,_0x118f65);});if(_0xeea54f){return _0x5ab500['id'];}}}));}}return BPromise[_0xf7ad('0x80')](_0x484b30)[_0xf7ad('0x29')](function(_0x5ed1e4){_0x410ae0=_(_0x410ae0)[_0xf7ad('0x81')](_0x5ed1e4)[_0xf7ad('0x82')]()['value']();return db[_0xf7ad('0x45')]['find']({'where':{'id':_0x285c5f[_0xf7ad('0x57')]['id']}})[_0xf7ad('0x29')](function(_0x1e94c9){return db[_0xf7ad('0x7b')][_0xf7ad('0x6b')](function(_0x123541){return _0x1e94c9['removeTeams'](_0x285c5f[_0xf7ad('0x37')]['ids'],{'transaction':_0x123541})[_0xf7ad('0x29')](function(){if(!_[_0xf7ad('0x83')](_0x410ae0)){return _0x1e94c9[_0xf7ad('0x84')](_0x410ae0,{'transaction':_0x123541});}})[_0xf7ad('0x29')](function(){_0x410ae0[_0xf7ad('0x6f')](function(_0x23a2ed){socket['emit']('userFaxQueue:remove',{'UserId':_0x23a2ed,'FaxQueueId':_0x1e94c9['id']});});});});});});})[_0xf7ad('0x29')](respondWithStatusCode(_0x160102,null))[_0xf7ad('0x49')](handleError(_0x160102,null));};exports[_0xf7ad('0x85')]=function(_0x24af90,_0x54c789,_0x10c3b8){return db[_0xf7ad('0x45')][_0xf7ad('0x4d')]({'where':{'id':_0x24af90[_0xf7ad('0x57')]['id']}})[_0xf7ad('0x29')](handleEntityNotFound(_0x54c789,null))[_0xf7ad('0x29')](function(_0x3adc5e){if(_0x3adc5e){return _0x3adc5e[_0xf7ad('0x85')](_0x24af90[_0xf7ad('0x4f')][_0xf7ad('0x71')],_[_0xf7ad('0x86')](_0x24af90['body'],[_0xf7ad('0x71'),'id'])||{})['spread'](function(_0xe53df2){for(var _0x54c14b=0x0;_0x54c14b<_0x24af90[_0xf7ad('0x4f')][_0xf7ad('0x71')]['length'];_0x54c14b+=0x1){socket[_0xf7ad('0x87')](_0xf7ad('0x88'),{'UserId':Number(_0x24af90[_0xf7ad('0x4f')][_0xf7ad('0x71')][_0x54c14b]),'FaxQueueId':Number(_0x24af90[_0xf7ad('0x57')]['id'])});}return _0xe53df2;});}})['then'](respondWithResult(_0x54c789,null))[_0xf7ad('0x49')](handleError(_0x54c789,null));};exports['removeAgents']=function(_0x23c1c2,_0x257bfa,_0x247be1){return db[_0xf7ad('0x45')][_0xf7ad('0x4d')]({'where':{'id':_0x23c1c2[_0xf7ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x257bfa,null))[_0xf7ad('0x29')](function(_0x173eb3){if(_0x173eb3){return _0x173eb3[_0xf7ad('0x84')](_0x23c1c2['query']['ids'])['then'](function(){if(_[_0xf7ad('0x89')](_0x23c1c2[_0xf7ad('0x37')][_0xf7ad('0x71')])){for(var _0x146057=0x0;_0x146057<_0x23c1c2[_0xf7ad('0x37')][_0xf7ad('0x71')]['length'];_0x146057+=0x1){socket[_0xf7ad('0x87')](_0xf7ad('0x8a'),{'UserId':Number(_0x23c1c2[_0xf7ad('0x37')][_0xf7ad('0x71')][_0x146057]),'FaxQueueId':Number(_0x23c1c2[_0xf7ad('0x57')]['id'])});}}else{socket[_0xf7ad('0x87')]('userFaxQueue:remove',{'UserId':Number(_0x23c1c2[_0xf7ad('0x37')][_0xf7ad('0x71')]),'FaxQueueId':Number(_0x23c1c2[_0xf7ad('0x57')]['id'])});}});}})[_0xf7ad('0x29')](respondWithStatusCode(_0x257bfa,null))[_0xf7ad('0x49')](handleError(_0x257bfa,null));};exports[_0xf7ad('0x8b')]=function(_0xe0ce85,_0x5e47da,_0x4e37ff){var _0x4de497={};var _0x411009={};var _0x348efa;var _0x4dd3bf;return db['FaxQueue'][_0xf7ad('0x59')]({'where':{'id':_0xe0ce85[_0xf7ad('0x57')]['id']}})[_0xf7ad('0x29')](handleEntityNotFound(_0x5e47da,null))[_0xf7ad('0x29')](function(_0x306d23){if(_0x306d23){_0x348efa=_0x306d23;_0x411009['model']=_[_0xf7ad('0x36')](db[_0xf7ad('0x67')][_0xf7ad('0x32')]);_0x411009['query']=_[_0xf7ad('0x36')](_0xe0ce85[_0xf7ad('0x37')]);_0x411009['filters']=_[_0xf7ad('0x38')](_0x411009[_0xf7ad('0x35')],_0x411009['query']);_0x4de497[_0xf7ad('0x39')]=_[_0xf7ad('0x38')](_0x411009[_0xf7ad('0x35')],qs[_0xf7ad('0x3a')](_0xe0ce85[_0xf7ad('0x37')][_0xf7ad('0x3a')]));_0x4de497[_0xf7ad('0x39')]=_0x4de497['attributes'][_0xf7ad('0x3b')]?_0x4de497[_0xf7ad('0x39')]:_0x411009[_0xf7ad('0x35')];_0x4de497[_0xf7ad('0x3d')]=qs[_0xf7ad('0x3e')](_0xe0ce85[_0xf7ad('0x37')][_0xf7ad('0x3e')]);_0x4de497[_0xf7ad('0x3f')]=qs[_0xf7ad('0x4b')](_[_0xf7ad('0x40')](_0xe0ce85[_0xf7ad('0x37')],_0x411009[_0xf7ad('0x4b')]));if(_0xe0ce85[_0xf7ad('0x37')][_0xf7ad('0x41')]){_0x4de497[_0xf7ad('0x3f')]=_['merge'](_0x4de497[_0xf7ad('0x3f')],{'$or':_[_0xf7ad('0x31')](_0x4de497[_0xf7ad('0x39')],function(_0x10e9ee){var _0x549049={};_0x549049[_0x10e9ee]={'$like':'%'+_0xe0ce85['query']['filter']+'%'};return _0x549049;})});}_0x4de497=_['merge']({},_0x4de497,_0xe0ce85[_0xf7ad('0x44')]);return _0x348efa[_0xf7ad('0x8b')](_0x4de497);}})['then'](function(_0x43117a){if(_0x43117a){_0x4dd3bf=_0x43117a[_0xf7ad('0x3b')];if(!_0xe0ce85[_0xf7ad('0x37')][_0xf7ad('0x3c')](_0xf7ad('0x5a'))){_0x4de497[_0xf7ad('0x23')]=qs[_0xf7ad('0x23')](_0xe0ce85[_0xf7ad('0x37')][_0xf7ad('0x23')]);_0x4de497['offset']=qs[_0xf7ad('0x21')](_0xe0ce85[_0xf7ad('0x37')]['offset']);}return _0x348efa['getAgents'](_0x4de497);}})[_0xf7ad('0x29')](function(_0xc15e43){if(_0xc15e43){return _0xc15e43?{'count':_0x4dd3bf,'rows':_0xc15e43}:null;}})['then'](respondWithResult(_0x5e47da,null))['catch'](handleError(_0x5e47da,null));}; \ No newline at end of file +var _0x72c1=['forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','FaxQueues','destroy','then','error','stack','index','map','FaxQueue','rawAttributes','type','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','length','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','nolimit','pick','FaxQueueId','merge','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','online','voicePause','interface','Agents','sequelize','transaction','addTeams','each'];(function(_0x5a91d9,_0x47cedb){var _0x5275e2=function(_0x15de79){while(--_0x15de79){_0x5a91d9['push'](_0x5a91d9['shift']());}};_0x5275e2(++_0x47cedb);}(_0x72c1,0x1cb));var _0x172c=function(_0x3f271b,_0x647c39){_0x3f271b=_0x3f271b-0x0;var _0x45519e=_0x72c1[_0x3f271b];return _0x45519e;};'use strict';var emlformat=require(_0x172c('0x0'));var rimraf=require(_0x172c('0x1'));var zipdir=require(_0x172c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x172c('0x3'));var BPromise=require(_0x172c('0x4'));var Mustache=require(_0x172c('0x5'));var util=require(_0x172c('0x6'));var path=require(_0x172c('0x7'));var sox=require(_0x172c('0x8'));var csv=require(_0x172c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x172c('0xa'));var _=require('lodash');var squel=require(_0x172c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x172c('0xc'));var toCsv=require(_0x172c('0x9'));var querystring=require(_0x172c('0xd'));var Papa=require(_0x172c('0xe'));var Redis=require(_0x172c('0xf'));var authService=require(_0x172c('0x10'));var qs=require(_0x172c('0x11'));var as=require(_0x172c('0x12'));var hardwareService=require(_0x172c('0x13'));var logger=require(_0x172c('0x14'))(_0x172c('0x15'));var utils=require(_0x172c('0x16'));var config=require(_0x172c('0x17'));var licenseUtil=require(_0x172c('0x18'));var db=require(_0x172c('0x19'))['db'];config[_0x172c('0x1a')]=_[_0x172c('0x1b')](config[_0x172c('0x1a')],{'host':_0x172c('0x1c'),'port':0x18eb});var socket=require(_0x172c('0x1d'))(new Redis(config[_0x172c('0x1a')]));require(_0x172c('0x1e'))[_0x172c('0x1f')](socket);function respondWithStatusCode(_0x44ae1f,_0x3c029d){_0x3c029d=_0x3c029d||0xcc;return function(_0x1c0248){if(_0x1c0248){return _0x44ae1f[_0x172c('0x20')](_0x3c029d);}return _0x44ae1f[_0x172c('0x21')](_0x3c029d)[_0x172c('0x22')]();};}function respondWithResult(_0x228642,_0x321417){_0x321417=_0x321417||0xc8;return function(_0x25ebc6){if(_0x25ebc6){return _0x228642[_0x172c('0x21')](_0x321417)[_0x172c('0x23')](_0x25ebc6);}};}function respondWithFilteredResult(_0x145ea9,_0x4aea0c){return function(_0x4eecfa){if(_0x4eecfa){var _0x53c7b9=typeof _0x4aea0c[_0x172c('0x24')]===_0x172c('0x25')&&typeof _0x4aea0c[_0x172c('0x26')]===_0x172c('0x25');var _0x323fee=_0x4eecfa['count'];var _0x572969=_0x53c7b9?0x0:_0x4aea0c[_0x172c('0x24')];var _0x45e9ca=_0x53c7b9?_0x4eecfa[_0x172c('0x27')]:_0x4aea0c[_0x172c('0x24')]+_0x4aea0c['limit'];var _0x38adc8;if(_0x45e9ca>=_0x323fee){_0x45e9ca=_0x323fee;_0x38adc8=0xc8;}else{_0x38adc8=0xce;}_0x145ea9[_0x172c('0x21')](_0x38adc8);return _0x145ea9['set'](_0x172c('0x28'),_0x572969+'-'+_0x45e9ca+'/'+_0x323fee)[_0x172c('0x23')](_0x4eecfa);}return null;};}function patchUpdates(_0x9e7f27){return function(_0x3a2804){try{jsonpatch['apply'](_0x3a2804,_0x9e7f27,!![]);}catch(_0x107439){return BPromise['reject'](_0x107439);}return _0x3a2804[_0x172c('0x29')]();};}function saveUpdates(_0x528a2b,_0x136e58){return function(_0x227a72){if(_0x227a72){return _0x227a72[_0x172c('0x2a')](_0x528a2b)['then'](function(_0x69ce4d){return _0x69ce4d;});}return null;};}function removeEntity(_0x15baf5,_0x41281e){return function(_0x3a0436){if(_0x3a0436){return _0x3a0436['destroy']()['then'](function(){var _0x4b90fa=_0x3a0436['get']({'plain':!![]});var _0x223173=_0x172c('0x2b');return db['UserProfileResource'][_0x172c('0x2c')]({'where':{'type':_0x223173,'resourceId':_0x4b90fa['id']}})[_0x172c('0x2d')](function(){return _0x3a0436;});})[_0x172c('0x2d')](function(){_0x15baf5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ad535,_0x3f2a58){return function(_0x1f1319){if(!_0x1f1319){_0x1ad535[_0x172c('0x20')](0x194);}return _0x1f1319;};}function handleError(_0x3fdce8,_0x5dab09){_0x5dab09=_0x5dab09||0x1f4;return function(_0x35a814){logger[_0x172c('0x2e')](_0x35a814[_0x172c('0x2f')]);if(_0x35a814['name']){delete _0x35a814['name'];}_0x3fdce8[_0x172c('0x21')](_0x5dab09)['send'](_0x35a814);};}exports[_0x172c('0x30')]=function(_0x58d63c,_0x2f4b3f){var _0x24a2d2={},_0x300900={},_0x350479={'count':0x0,'rows':[]};var _0x5f00e7=_[_0x172c('0x31')](db[_0x172c('0x32')][_0x172c('0x33')],function(_0x4509a0){return{'name':_0x4509a0['fieldName'],'type':_0x4509a0[_0x172c('0x34')]['key']};});_0x300900['model']=_[_0x172c('0x31')](_0x5f00e7,_0x172c('0x35'));_0x300900[_0x172c('0x36')]=_['keys'](_0x58d63c[_0x172c('0x36')]);_0x300900[_0x172c('0x37')]=_[_0x172c('0x38')](_0x300900[_0x172c('0x39')],_0x300900['query']);_0x24a2d2[_0x172c('0x3a')]=_['intersection'](_0x300900[_0x172c('0x39')],qs[_0x172c('0x3b')](_0x58d63c[_0x172c('0x36')][_0x172c('0x3b')]));_0x24a2d2[_0x172c('0x3a')]=_0x24a2d2[_0x172c('0x3a')]['length']?_0x24a2d2[_0x172c('0x3a')]:_0x300900[_0x172c('0x39')];if(!_0x58d63c[_0x172c('0x36')][_0x172c('0x3c')]('nolimit')){_0x24a2d2[_0x172c('0x26')]=qs[_0x172c('0x26')](_0x58d63c[_0x172c('0x36')][_0x172c('0x26')]);_0x24a2d2['offset']=qs[_0x172c('0x24')](_0x58d63c[_0x172c('0x36')][_0x172c('0x24')]);}_0x24a2d2[_0x172c('0x3d')]=qs['sort'](_0x58d63c[_0x172c('0x36')][_0x172c('0x3e')]);_0x24a2d2['where']=qs[_0x172c('0x37')](_['pick'](_0x58d63c[_0x172c('0x36')],_0x300900[_0x172c('0x37')]),_0x5f00e7);if(_0x58d63c[_0x172c('0x36')]['filter']){_0x24a2d2['where']=_['merge'](_0x24a2d2[_0x172c('0x3f')],{'$or':_[_0x172c('0x31')](_0x5f00e7,function(_0x473c5){if(_0x473c5[_0x172c('0x34')]!==_0x172c('0x40')){var _0x577c56={};_0x577c56[_0x473c5['name']]={'$like':'%'+_0x58d63c[_0x172c('0x36')][_0x172c('0x41')]+'%'};return _0x577c56;}})});}_0x24a2d2=_['merge']({},_0x24a2d2,_0x58d63c[_0x172c('0x42')]);var _0x8a3cfd={'where':_0x24a2d2[_0x172c('0x3f')]};return db['FaxQueue']['count'](_0x8a3cfd)[_0x172c('0x2d')](function(_0x21b0a0){_0x350479[_0x172c('0x27')]=_0x21b0a0;if(_0x58d63c[_0x172c('0x36')]['includeAll']){_0x24a2d2[_0x172c('0x43')]=[{'all':!![]}];}return db[_0x172c('0x32')][_0x172c('0x44')](_0x24a2d2);})['then'](function(_0x3863ec){_0x350479[_0x172c('0x45')]=_0x3863ec;return _0x350479;})[_0x172c('0x2d')](respondWithFilteredResult(_0x2f4b3f,_0x24a2d2))[_0x172c('0x46')](handleError(_0x2f4b3f,null));};exports['show']=function(_0x399a36,_0x5ab9c9){var _0x3f4769={'raw':!![],'where':{'id':_0x399a36[_0x172c('0x47')]['id']}},_0x14ccec={};_0x14ccec[_0x172c('0x39')]=_[_0x172c('0x48')](db['FaxQueue']['rawAttributes']);_0x14ccec[_0x172c('0x36')]=_[_0x172c('0x48')](_0x399a36[_0x172c('0x36')]);_0x14ccec['filters']=_[_0x172c('0x38')](_0x14ccec[_0x172c('0x39')],_0x14ccec[_0x172c('0x36')]);_0x3f4769[_0x172c('0x3a')]=_[_0x172c('0x38')](_0x14ccec[_0x172c('0x39')],qs[_0x172c('0x3b')](_0x399a36['query'][_0x172c('0x3b')]));_0x3f4769[_0x172c('0x3a')]=_0x3f4769['attributes'][_0x172c('0x49')]?_0x3f4769[_0x172c('0x3a')]:_0x14ccec['model'];if(_0x399a36[_0x172c('0x36')][_0x172c('0x4a')]){_0x3f4769[_0x172c('0x43')]=[{'all':!![]}];}_0x3f4769=_['merge']({},_0x3f4769,_0x399a36[_0x172c('0x42')]);return db[_0x172c('0x32')][_0x172c('0x4b')](_0x3f4769)[_0x172c('0x2d')](handleEntityNotFound(_0x5ab9c9,null))[_0x172c('0x2d')](respondWithResult(_0x5ab9c9,null))['catch'](handleError(_0x5ab9c9,null));};exports[_0x172c('0x4c')]=function(_0x1c4ee8,_0x2e6e88){return db['FaxQueue'][_0x172c('0x4c')](_0x1c4ee8[_0x172c('0x4d')],{})[_0x172c('0x2d')](function(_0x156dcf){var _0x2de425=_0x1c4ee8[_0x172c('0x4e')][_0x172c('0x4f')]({'plain':!![]});if(!_0x2de425)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2de425[_0x172c('0x50')]===_0x172c('0x4e')){var _0x150f9a=_0x156dcf['get']({'plain':!![]});var _0x212a85='FaxQueues';return db[_0x172c('0x51')]['find']({'where':{'name':_0x212a85,'userProfileId':_0x2de425[_0x172c('0x52')]},'raw':!![]})[_0x172c('0x2d')](function(_0xf1830f){if(_0xf1830f&&_0xf1830f['autoAssociation']===0x0){return db[_0x172c('0x53')]['create']({'name':_0x150f9a[_0x172c('0x35')],'resourceId':_0x150f9a['id'],'type':_0xf1830f['name'],'sectionId':_0xf1830f['id']},{})[_0x172c('0x2d')](function(){return _0x156dcf;});}else{return _0x156dcf;}})[_0x172c('0x46')](function(_0x540b1b){logger[_0x172c('0x2e')](_0x172c('0x54'),_0x540b1b);throw _0x540b1b;});}return _0x156dcf;})[_0x172c('0x2d')](respondWithResult(_0x2e6e88,0xc9))[_0x172c('0x46')](handleError(_0x2e6e88,null));};exports[_0x172c('0x2a')]=function(_0x43917a,_0x3af84e){if(_0x43917a['body']['id']){delete _0x43917a['body']['id'];}return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x43917a[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x3af84e,null))[_0x172c('0x2d')](saveUpdates(_0x43917a[_0x172c('0x4d')],null))[_0x172c('0x2d')](respondWithResult(_0x3af84e,null))[_0x172c('0x46')](handleError(_0x3af84e,null));};exports[_0x172c('0x2c')]=function(_0x4f6848,_0x23ac18){return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x4f6848[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x23ac18,null))[_0x172c('0x2d')](removeEntity(_0x23ac18,null))[_0x172c('0x46')](handleError(_0x23ac18,null));};exports['describe']=function(_0x96c148,_0x593786){return db['FaxQueue'][_0x172c('0x55')]()['then'](respondWithResult(_0x593786,null))['catch'](handleError(_0x593786,null));};exports[_0x172c('0x56')]=function(_0x1efc66,_0x583294,_0xddbfc){var _0xd6b350={'raw':!![],'where':{}},_0x3c27d2={},_0x59f618;return db[_0x172c('0x32')][_0x172c('0x57')]({'where':{'id':_0x1efc66['params']['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x583294,null))['then'](function(_0x4a7030){if(_0x4a7030){_0x59f618=_0x4a7030[_0x172c('0x4f')]({'plain':!![]});_0x3c27d2[_0x172c('0x39')]=_[_0x172c('0x48')](db[_0x172c('0x58')]['rawAttributes']);_0x3c27d2[_0x172c('0x36')]=_[_0x172c('0x48')](_0x1efc66[_0x172c('0x36')]);_0x3c27d2['filters']=_[_0x172c('0x38')](_0x3c27d2[_0x172c('0x39')],_0x3c27d2[_0x172c('0x36')]);_0xd6b350[_0x172c('0x3a')]=_[_0x172c('0x38')](_0x3c27d2['model'],qs[_0x172c('0x3b')](_0x1efc66[_0x172c('0x36')][_0x172c('0x3b')]));_0xd6b350[_0x172c('0x3a')]=_0xd6b350['attributes']['length']?_0xd6b350[_0x172c('0x3a')]:_0x3c27d2[_0x172c('0x39')];if(!_0x1efc66['query'][_0x172c('0x3c')](_0x172c('0x59'))){_0xd6b350['limit']=qs[_0x172c('0x26')](_0x1efc66[_0x172c('0x36')][_0x172c('0x26')]);_0xd6b350['offset']=qs[_0x172c('0x24')](_0x1efc66['query'][_0x172c('0x24')]);}_0xd6b350[_0x172c('0x3d')]=qs[_0x172c('0x3e')](_0x1efc66['query'][_0x172c('0x3e')]);_0xd6b350[_0x172c('0x3f')]=qs[_0x172c('0x37')](_[_0x172c('0x5a')](_0x1efc66['query'],_0x3c27d2['filters']));_0xd6b350[_0x172c('0x3f')][_0x172c('0x5b')]=_0x4a7030['id'];if(_0x1efc66[_0x172c('0x36')][_0x172c('0x41')]){_0xd6b350['where']=_[_0x172c('0x5c')](_0xd6b350[_0x172c('0x3f')],{'$or':_[_0x172c('0x31')](_0xd6b350[_0x172c('0x3a')],function(_0x1e3130){var _0x4de5d4={};_0x4de5d4[_0x1e3130]={'$like':'%'+_0x1efc66[_0x172c('0x36')][_0x172c('0x41')]+'%'};return _0x4de5d4;})});}_0xd6b350=_[_0x172c('0x5c')]({},_0xd6b350,_0x1efc66[_0x172c('0x42')]);return db[_0x172c('0x58')][_0x172c('0x44')](_0xd6b350);}})['then'](function(_0x200737){if(_0x200737){return db[_0x172c('0x5d')][_0x172c('0x5e')]({'where':{'id':_['map'](_0x200737,_0x172c('0x5f')),'role':'agent'},'attributes':['id',_0x172c('0x35'),_0x172c('0x60'),_0x172c('0x61'),_0x172c('0x62')]});}})[_0x172c('0x2d')](function(_0x4fe94c){if(_0x4fe94c){return{'count':_0x4fe94c[_0x172c('0x27')],'rows':_[_0x172c('0x31')](_0x4fe94c['rows'],function(_0x6385cb){return{'membername':_0x6385cb['name'],'UserId':_0x6385cb['id'],'queue_name':_0x59f618[_0x172c('0x35')],'FaxQueueId':_0x59f618['id'],'interface':util[_0x172c('0x63')](_0x172c('0x64'),_0x172c('0x65'),_0x6385cb[_0x172c('0x35')]),'penalty':0x0,'paused':_0x6385cb[_0x172c('0x60')],'createdAt':_0x6385cb[_0x172c('0x62')],'updatedAt':_0x6385cb[_0x172c('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x172c('0x2d')](respondWithFilteredResult(_0x583294,_0xd6b350))['catch'](handleError(_0x583294,null));};exports[_0x172c('0x66')]=function(_0x4cdfbd,_0x3012c7,_0x3a4d2d){var _0xf225ac={};var _0x270543={};var _0x47d0f9;var _0x2f3ec1;return db[_0x172c('0x32')][_0x172c('0x57')]({'where':{'id':_0x4cdfbd['params']['id']}})['then'](handleEntityNotFound(_0x3012c7,null))[_0x172c('0x2d')](function(_0xa24888){if(_0xa24888){_0x47d0f9=_0xa24888;_0x270543[_0x172c('0x39')]=_[_0x172c('0x48')](db[_0x172c('0x67')][_0x172c('0x33')]);_0x270543[_0x172c('0x36')]=_[_0x172c('0x48')](_0x4cdfbd['query']);_0x270543[_0x172c('0x37')]=_[_0x172c('0x38')](_0x270543[_0x172c('0x39')],_0x270543[_0x172c('0x36')]);_0xf225ac[_0x172c('0x3a')]=_['intersection'](_0x270543[_0x172c('0x39')],qs[_0x172c('0x3b')](_0x4cdfbd[_0x172c('0x36')][_0x172c('0x3b')]));_0xf225ac['attributes']=_0xf225ac[_0x172c('0x3a')][_0x172c('0x49')]?_0xf225ac[_0x172c('0x3a')]:_0x270543[_0x172c('0x39')];_0xf225ac[_0x172c('0x3d')]=qs[_0x172c('0x3e')](_0x4cdfbd[_0x172c('0x36')]['sort']);_0xf225ac[_0x172c('0x3f')]=qs['filters'](_[_0x172c('0x5a')](_0x4cdfbd['query'],_0x270543[_0x172c('0x37')]));if(_0x4cdfbd['query'][_0x172c('0x41')]){_0xf225ac[_0x172c('0x3f')]=_[_0x172c('0x5c')](_0xf225ac['where'],{'$or':_[_0x172c('0x31')](_0xf225ac[_0x172c('0x3a')],function(_0x7c6e59){var _0x2983b2={};_0x2983b2[_0x7c6e59]={'$like':'%'+_0x4cdfbd['query'][_0x172c('0x41')]+'%'};return _0x2983b2;})});}_0xf225ac=_[_0x172c('0x5c')]({},_0xf225ac,_0x4cdfbd[_0x172c('0x42')]);return _0x47d0f9[_0x172c('0x66')](_0xf225ac);}})[_0x172c('0x2d')](function(_0x3c150c){if(_0x3c150c){_0x2f3ec1=_0x3c150c[_0x172c('0x49')];if(!_0x4cdfbd['query']['hasOwnProperty'](_0x172c('0x59'))){_0xf225ac['limit']=qs['limit'](_0x4cdfbd[_0x172c('0x36')][_0x172c('0x26')]);_0xf225ac[_0x172c('0x24')]=qs[_0x172c('0x24')](_0x4cdfbd['query'][_0x172c('0x24')]);}return _0x47d0f9[_0x172c('0x66')](_0xf225ac);}})['then'](function(_0x2234ae){if(_0x2234ae){return _0x2234ae?{'count':_0x2f3ec1,'rows':_0x2234ae}:null;}})[_0x172c('0x2d')](respondWithResult(_0x3012c7,null))[_0x172c('0x46')](handleError(_0x3012c7,null));};exports['addTeams']=function(_0xe6a037,_0x5c161e,_0x9da24e){var _0xf21ea7=_0xe6a037[_0x172c('0x4d')][_0x172c('0x68')];return db[_0x172c('0x67')][_0x172c('0x44')]({'where':{'id':_0xf21ea7},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x172c('0x35'),_0x172c('0x69'),_0x172c('0x6a'),_0x172c('0x6b')],'raw':!![]}]})[_0x172c('0x2d')](function(_0x5d382e){if(_0x5d382e){var _0x33daff=_['flatMap'](_0x5d382e,function(_0x4d73ef){var _0x1589ae=_0x4d73ef[_0x172c('0x4f')]({'plain':!![]});return _0x1589ae[_0x172c('0x6c')];});return db['FaxQueue'][_0x172c('0x4b')]({'where':{'id':_0xe6a037[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](function(_0x1fb5e9){return db[_0x172c('0x6d')][_0x172c('0x6e')](function(_0x263ed3){return _0x1fb5e9[_0x172c('0x6f')](_0xf21ea7,{'transaction':_0x263ed3})[_0x172c('0x2d')](function(){return BPromise[_0x172c('0x70')](_0x33daff,function(_0x2a9328){return db[_0x172c('0x58')]['findOrCreate']({'where':{'UserId':_0x2a9328['id'],'FaxQueueId':_0xe6a037[_0x172c('0x47')]['id']},'transaction':_0x263ed3});});})[_0x172c('0x2d')](function(){_0x33daff[_0x172c('0x71')](function(_0xc1cfa7){socket[_0x172c('0x72')]('userFaxQueue:save',{'UserId':_0xc1cfa7['id'],'FaxQueueId':_0x1fb5e9['id']});});});});});}})[_0x172c('0x2d')](respondWithStatusCode(_0x5c161e,null))['catch'](handleError(_0x5c161e,null));};exports[_0x172c('0x73')]=function(_0x1c0be0,_0x2ed8f4,_0x2aabdd){return db['Team'][_0x172c('0x44')]({'where':{'id':_0x1c0be0[_0x172c('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x172c('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2ed8f4,null))[_0x172c('0x2d')](function(_0x5a710e){var _0x3e24f3=_[_0x172c('0x31')](_0x5a710e,'id');var _0x26f1d0=[];var _0x171c6c=[];var _0xa2c20=squel[_0x172c('0x74')]();_0xa2c20[_0x172c('0x75')](_0x172c('0x76'))[_0x172c('0x77')]('team_has_fax_queues','tq')[_0x172c('0x78')](_0x172c('0x79'),'ut',_0x172c('0x7a'))[_0x172c('0x3f')](_0x172c('0x7b'),_0x1c0be0[_0x172c('0x47')]['id']);for(var _0x1e153d=0x0;_0x1e153d<_0x5a710e[_0x172c('0x49')];_0x1e153d+=0x1){let _0x334b05=_0x5a710e[_0x1e153d];for(var _0x117e2b=0x0;_0x117e2b<_0x334b05[_0x172c('0x6c')][_0x172c('0x49')];_0x117e2b+=0x1){let _0xa1f30f=_0x334b05[_0x172c('0x6c')][_0x117e2b];var _0x3fa01e=_0xa2c20[_0x172c('0x7c')]();_0x3fa01e[_0x172c('0x3f')](_0x172c('0x7d'),_0xa1f30f['id']);_0x171c6c[_0x172c('0x7e')](db[_0x172c('0x6d')][_0x172c('0x36')](_0x3fa01e[_0x172c('0x7f')](),{'type':db['sequelize'][_0x172c('0x80')]['SELECT']})['then'](function(_0x3ab983){if(_0x3ab983['length']===0x1){return _0xa1f30f['id'];}else{var _0x20ac69=_['every'](_[_0x172c('0x31')](_0x3ab983,_0x172c('0x81')),function(_0x3145e6){return _['includes'](_0x3e24f3,_0x3145e6);});if(_0x20ac69){return _0xa1f30f['id'];}}}));}}return BPromise[_0x172c('0x82')](_0x171c6c)['then'](function(_0x105878){_0x26f1d0=_(_0x26f1d0)[_0x172c('0x83')](_0x105878)[_0x172c('0x84')]()[_0x172c('0x85')]();return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x1c0be0['params']['id']}})[_0x172c('0x2d')](function(_0x35d7d1){return db[_0x172c('0x6d')][_0x172c('0x6e')](function(_0x19392c){return _0x35d7d1[_0x172c('0x73')](_0x1c0be0['query'][_0x172c('0x68')],{'transaction':_0x19392c})[_0x172c('0x2d')](function(){if(!_[_0x172c('0x86')](_0x26f1d0)){return _0x35d7d1[_0x172c('0x87')](_0x26f1d0,{'transaction':_0x19392c});}})[_0x172c('0x2d')](function(){_0x26f1d0[_0x172c('0x71')](function(_0x781379){socket['emit'](_0x172c('0x88'),{'UserId':_0x781379,'FaxQueueId':_0x35d7d1['id']});});});});});});})[_0x172c('0x2d')](respondWithStatusCode(_0x2ed8f4,null))[_0x172c('0x46')](handleError(_0x2ed8f4,null));};exports[_0x172c('0x89')]=function(_0x2f5bf2,_0x1625eb,_0x28498d){return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x2f5bf2[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x1625eb,null))[_0x172c('0x2d')](function(_0x27ceb6){if(_0x27ceb6){return _0x27ceb6[_0x172c('0x89')](_0x2f5bf2[_0x172c('0x4d')][_0x172c('0x68')],_[_0x172c('0x8a')](_0x2f5bf2['body'],['ids','id'])||{})[_0x172c('0x8b')](function(_0x2eb7c3){for(var _0xa9167d=0x0;_0xa9167d<_0x2f5bf2[_0x172c('0x4d')][_0x172c('0x68')][_0x172c('0x49')];_0xa9167d+=0x1){socket[_0x172c('0x72')](_0x172c('0x8c'),{'UserId':Number(_0x2f5bf2[_0x172c('0x4d')][_0x172c('0x68')][_0xa9167d]),'FaxQueueId':Number(_0x2f5bf2[_0x172c('0x47')]['id'])});}return _0x2eb7c3;});}})[_0x172c('0x2d')](respondWithResult(_0x1625eb,null))[_0x172c('0x46')](handleError(_0x1625eb,null));};exports[_0x172c('0x87')]=function(_0x4702c6,_0x4c4f63,_0x113cc8){return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x4702c6[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x4c4f63,null))[_0x172c('0x2d')](function(_0x5576f8){if(_0x5576f8){return _0x5576f8[_0x172c('0x87')](_0x4702c6['query']['ids'])[_0x172c('0x2d')](function(){if(_[_0x172c('0x8d')](_0x4702c6[_0x172c('0x36')]['ids'])){for(var _0x1af72e=0x0;_0x1af72e<_0x4702c6[_0x172c('0x36')][_0x172c('0x68')][_0x172c('0x49')];_0x1af72e+=0x1){socket[_0x172c('0x72')](_0x172c('0x88'),{'UserId':Number(_0x4702c6[_0x172c('0x36')][_0x172c('0x68')][_0x1af72e]),'FaxQueueId':Number(_0x4702c6[_0x172c('0x47')]['id'])});}}else{socket['emit'](_0x172c('0x88'),{'UserId':Number(_0x4702c6[_0x172c('0x36')][_0x172c('0x68')]),'FaxQueueId':Number(_0x4702c6['params']['id'])});}});}})[_0x172c('0x2d')](respondWithStatusCode(_0x4c4f63,null))[_0x172c('0x46')](handleError(_0x4c4f63,null));};exports['getAgents']=function(_0x176551,_0x41d9e1,_0x5163bd){var _0x515fba={};var _0x26aea7={};var _0xb1ac92;var _0x37f8e3;return db[_0x172c('0x32')][_0x172c('0x57')]({'where':{'id':_0x176551['params']['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x41d9e1,null))[_0x172c('0x2d')](function(_0x3c6f75){if(_0x3c6f75){_0xb1ac92=_0x3c6f75;_0x26aea7[_0x172c('0x39')]=_[_0x172c('0x48')](db['User'][_0x172c('0x33')]);_0x26aea7[_0x172c('0x36')]=_['keys'](_0x176551[_0x172c('0x36')]);_0x26aea7['filters']=_['intersection'](_0x26aea7[_0x172c('0x39')],_0x26aea7[_0x172c('0x36')]);_0x515fba[_0x172c('0x3a')]=_[_0x172c('0x38')](_0x26aea7['model'],qs['fields'](_0x176551['query'][_0x172c('0x3b')]));_0x515fba['attributes']=_0x515fba['attributes'][_0x172c('0x49')]?_0x515fba[_0x172c('0x3a')]:_0x26aea7[_0x172c('0x39')];_0x515fba[_0x172c('0x3d')]=qs['sort'](_0x176551[_0x172c('0x36')][_0x172c('0x3e')]);_0x515fba[_0x172c('0x3f')]=qs[_0x172c('0x37')](_['pick'](_0x176551[_0x172c('0x36')],_0x26aea7[_0x172c('0x37')]));if(_0x176551[_0x172c('0x36')][_0x172c('0x41')]){_0x515fba[_0x172c('0x3f')]=_[_0x172c('0x5c')](_0x515fba[_0x172c('0x3f')],{'$or':_['map'](_0x515fba[_0x172c('0x3a')],function(_0x1367c4){var _0x40b54f={};_0x40b54f[_0x1367c4]={'$like':'%'+_0x176551[_0x172c('0x36')][_0x172c('0x41')]+'%'};return _0x40b54f;})});}_0x515fba=_[_0x172c('0x5c')]({},_0x515fba,_0x176551[_0x172c('0x42')]);return _0xb1ac92[_0x172c('0x8e')](_0x515fba);}})[_0x172c('0x2d')](function(_0x5a3c7a){if(_0x5a3c7a){_0x37f8e3=_0x5a3c7a[_0x172c('0x49')];if(!_0x176551[_0x172c('0x36')][_0x172c('0x3c')](_0x172c('0x59'))){_0x515fba[_0x172c('0x26')]=qs[_0x172c('0x26')](_0x176551[_0x172c('0x36')][_0x172c('0x26')]);_0x515fba['offset']=qs[_0x172c('0x24')](_0x176551['query'][_0x172c('0x24')]);}return _0xb1ac92['getAgents'](_0x515fba);}})[_0x172c('0x2d')](function(_0x368127){if(_0x368127){return _0x368127?{'count':_0x37f8e3,'rows':_0x368127}:null;}})[_0x172c('0x2d')](respondWithResult(_0x41d9e1,null))[_0x172c('0x46')](handleError(_0x41d9e1,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 76076fc..6e75c08 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 _0x7eb8=['update','remove','emit','exports','events','../../mysqldb','FaxQueue','save'];(function(_0x5076f8,_0x59742e){var _0x38bf3d=function(_0x586247){while(--_0x586247){_0x5076f8['push'](_0x5076f8['shift']());}};_0x38bf3d(++_0x59742e);}(_0x7eb8,0x94));var _0x87eb=function(_0x34d86b,_0x1a33db){_0x34d86b=_0x34d86b-0x0;var _0x22efe9=_0x7eb8[_0x34d86b];return _0x22efe9;};'use strict';var EventEmitter=require(_0x87eb('0x0'));var FaxQueue=require(_0x87eb('0x1'))['db'][_0x87eb('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x87eb('0x3'),'afterUpdate':_0x87eb('0x4'),'afterDestroy':_0x87eb('0x5')};function emitEvent(_0x1a7224){return function(_0x3c7c99,_0x1b410a,_0x54e59a){FaxQueueEvents['emit'](_0x1a7224+':'+_0x3c7c99['id'],_0x3c7c99);FaxQueueEvents[_0x87eb('0x6')](_0x1a7224,_0x3c7c99);_0x54e59a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x87eb('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xe702=['hasOwnProperty','hook','exports','../../mysqldb','update','remove','emit'];(function(_0x38b3cb,_0x4ad7b3){var _0x5a9a84=function(_0x237634){while(--_0x237634){_0x38b3cb['push'](_0x38b3cb['shift']());}};_0x5a9a84(++_0x4ad7b3);}(_0xe702,0x96));var _0x2e70=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xe702[_0x42245d];return _0x4b211a;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x2e70('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2e70('0x1'),'afterDestroy':_0x2e70('0x2')};function emitEvent(_0x24de44){return function(_0x109c29,_0x4266fd,_0x4a0a36){FaxQueueEvents[_0x2e70('0x3')](_0x24de44+':'+_0x109c29['id'],_0x109c29);FaxQueueEvents[_0x2e70('0x3')](_0x24de44,_0x109c29);_0x4a0a36(null);};}for(var e in events){if(events[_0x2e70('0x4')](e)){var event=events[e];FaxQueue[_0x2e70('0x5')](e,emitEvent(event));}}module[_0x2e70('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index b04c6c9..188df0e 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 _0xf8c2=['define','FaxQueue','fax_queues','util','../../config/logger','moment','request-promise','path','../../config/environment','./faxQueue.attributes'];(function(_0x444077,_0x542bbe){var _0x29909c=function(_0x48559f){while(--_0x48559f){_0x444077['push'](_0x444077['shift']());}};_0x29909c(++_0x542bbe);}(_0xf8c2,0x99));var _0x2f8c=function(_0x4cb4c1,_0x16d737){_0x4cb4c1=_0x4cb4c1-0x0;var _0x4d4431=_0xf8c2[_0x4cb4c1];return _0x4d4431;};'use strict';var _=require('lodash');var util=require(_0x2f8c('0x0'));var logger=require(_0x2f8c('0x1'))('api');var moment=require(_0x2f8c('0x2'));var BPromise=require('bluebird');var rp=require(_0x2f8c('0x3'));var fs=require('fs');var path=require(_0x2f8c('0x4'));var rimraf=require('rimraf');var config=require(_0x2f8c('0x5'));var attributes=require(_0x2f8c('0x6'));module['exports']=function(_0x2e9f9d,_0x531085){return _0x2e9f9d[_0x2f8c('0x7')](_0x2f8c('0x8'),attributes,{'tableName':_0x2f8c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1bf=['exports','define','fax_queues','../../config/logger','api','moment','request-promise','path','rimraf','./faxQueue.attributes'];(function(_0x250a27,_0x392265){var _0x11d3d9=function(_0x4847c2){while(--_0x4847c2){_0x250a27['push'](_0x250a27['shift']());}};_0x11d3d9(++_0x392265);}(_0xb1bf,0x175));var _0xfb1b=function(_0x93714c,_0x5906d2){_0x93714c=_0x93714c-0x0;var _0x5bc167=_0xb1bf[_0x93714c];return _0x5bc167;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfb1b('0x0'))(_0xfb1b('0x1'));var moment=require(_0xfb1b('0x2'));var BPromise=require('bluebird');var rp=require(_0xfb1b('0x3'));var fs=require('fs');var path=require(_0xfb1b('0x4'));var rimraf=require(_0xfb1b('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb1b('0x6'));module[_0xfb1b('0x7')]=function(_0x252697,_0x1021d2){return _0x252697[_0xfb1b('0x8')]('FaxQueue',attributes,{'tableName':_0xfb1b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 8f4b58a..daaeee7 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 _0x16d7=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','include','model','map','stringify','ShowFaxQueue','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s'];(function(_0x3ea1f4,_0x237a8a){var _0x1d4c11=function(_0x89fa82){while(--_0x89fa82){_0x3ea1f4['push'](_0x3ea1f4['shift']());}};_0x1d4c11(++_0x237a8a);}(_0x16d7,0xb5));var _0x716d=function(_0x53bc18,_0x191c68){_0x53bc18=_0x53bc18-0x0;var _0x133f65=_0x16d7[_0x53bc18];return _0x133f65;};'use strict';var _=require(_0x716d('0x0'));var util=require('util');var moment=require(_0x716d('0x1'));var BPromise=require(_0x716d('0x2'));var rs=require(_0x716d('0x3'));var fs=require('fs');var Redis=require(_0x716d('0x4'));var db=require(_0x716d('0x5'))['db'];var utils=require(_0x716d('0x6'));var logger=require('../../config/logger')(_0x716d('0x7'));var config=require('../../config/environment');var jayson=require(_0x716d('0x8'));var client=jayson[_0x716d('0x9')]['http']({'port':0x232a});config[_0x716d('0xa')]=_[_0x716d('0xb')](config[_0x716d('0xa')],{'host':_0x716d('0xc'),'port':0x18eb});var socket=require(_0x716d('0xd'))(new Redis(config[_0x716d('0xa')]));require('./faxQueue.socket')[_0x716d('0xe')](socket);function respondWithRpcPromise(_0xd73474,_0x68c0ee,_0x4304d1){return new BPromise(function(_0x40b7c0,_0x53f431){return client[_0x716d('0xf')](_0xd73474,_0x4304d1)[_0x716d('0x10')](function(_0x55fbfe){logger[_0x716d('0x11')](_0x716d('0x12'),_0x68c0ee,'request\x20sent');logger[_0x716d('0x13')](_0x716d('0x14'),_0x68c0ee,_0x716d('0x15'),JSON['stringify'](_0x55fbfe));if(_0x55fbfe[_0x716d('0x16')]){if(_0x55fbfe[_0x716d('0x16')][_0x716d('0x17')]===0x1f4){logger[_0x716d('0x16')](_0x716d('0x12'),_0x68c0ee,_0x55fbfe[_0x716d('0x16')]['message']);return _0x53f431(_0x55fbfe['error'][_0x716d('0x18')]);}logger[_0x716d('0x16')](_0x716d('0x12'),_0x68c0ee,_0x55fbfe[_0x716d('0x16')][_0x716d('0x18')]);return _0x40b7c0(_0x55fbfe[_0x716d('0x16')][_0x716d('0x18')]);}else{logger[_0x716d('0x11')](_0x716d('0x12'),_0x68c0ee,_0x716d('0x15'));_0x40b7c0(_0x55fbfe[_0x716d('0x19')][_0x716d('0x18')]);}})[_0x716d('0x1a')](function(_0x260e16){logger[_0x716d('0x16')](_0x716d('0x12'),_0x68c0ee,_0x260e16);_0x53f431(_0x260e16);});});}exports[_0x716d('0x1b')]=function(_0x476127){var _0x112733=this;return new Promise(function(_0x2dd279,_0x22f7c6){return db[_0x716d('0x1c')][_0x716d('0x1d')]({'raw':_0x476127[_0x716d('0x1e')]?_0x476127[_0x716d('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x476127[_0x716d('0x1e')]?_0x476127[_0x716d('0x1e')][_0x716d('0x1f')]||null:null,'attributes':_0x476127[_0x716d('0x1e')]?_0x476127[_0x716d('0x1e')][_0x716d('0x20')]||null:null,'limit':_0x476127[_0x716d('0x1e')]?_0x476127['options']['limit']||null:null,'include':_0x476127[_0x716d('0x1e')]?_0x476127[_0x716d('0x1e')]['include']?_['map'](_0x476127[_0x716d('0x1e')][_0x716d('0x21')],function(_0x163ba4){return{'model':db[_0x163ba4[_0x716d('0x22')]],'as':_0x163ba4['as'],'attributes':_0x163ba4[_0x716d('0x20')],'include':_0x163ba4[_0x716d('0x21')]?_[_0x716d('0x23')](_0x163ba4[_0x716d('0x21')],function(_0x1c5dbb){return{'model':db[_0x1c5dbb[_0x716d('0x22')]],'as':_0x1c5dbb['as'],'attributes':_0x1c5dbb['attributes'],'include':_0x1c5dbb[_0x716d('0x21')]?_[_0x716d('0x23')](_0x1c5dbb['include'],function(_0x4d9ba9){return{'model':db[_0x4d9ba9['model']],'as':_0x4d9ba9['as'],'attributes':_0x4d9ba9[_0x716d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x435059){logger[_0x716d('0x11')](_0x716d('0x1b'),_0x476127);logger[_0x716d('0x13')](_0x716d('0x1b'),_0x476127,JSON[_0x716d('0x24')](_0x435059));_0x2dd279(_0x435059);})['catch'](function(_0x25e234){logger[_0x716d('0x16')](_0x716d('0x1b'),_0x25e234[_0x716d('0x18')],_0x476127);_0x22f7c6(_0x112733[_0x716d('0x16')](0x1f4,_0x25e234[_0x716d('0x18')]));});});};exports[_0x716d('0x25')]=function(_0x31d245){var _0xd3ebfe=this;return new Promise(function(_0xe8c9b0,_0x464d3b){return db[_0x716d('0x1c')][_0x716d('0x26')]({'raw':_0x31d245[_0x716d('0x1e')]?_0x31d245['options'][_0x716d('0x27')]===undefined?!![]:![]:!![],'where':_0x31d245[_0x716d('0x1e')]?_0x31d245[_0x716d('0x1e')][_0x716d('0x1f')]||null:null,'attributes':_0x31d245['options']?_0x31d245[_0x716d('0x1e')][_0x716d('0x20')]||null:null,'include':_0x31d245['options']?_0x31d245[_0x716d('0x1e')][_0x716d('0x21')]?_[_0x716d('0x23')](_0x31d245['options']['include'],function(_0x444f62){return{'model':db[_0x444f62[_0x716d('0x22')]],'as':_0x444f62['as'],'attributes':_0x444f62[_0x716d('0x20')],'include':_0x444f62[_0x716d('0x21')]?_[_0x716d('0x23')](_0x444f62[_0x716d('0x21')],function(_0x5e54da){return{'model':db[_0x5e54da['model']],'as':_0x5e54da['as'],'attributes':_0x5e54da[_0x716d('0x20')],'include':_0x5e54da[_0x716d('0x21')]?_[_0x716d('0x23')](_0x5e54da[_0x716d('0x21')],function(_0x45a432){return{'model':db[_0x45a432[_0x716d('0x22')]],'as':_0x45a432['as'],'attributes':_0x45a432[_0x716d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x716d('0x10')](function(_0x1629a3){logger[_0x716d('0x11')]('ShowFaxQueue',_0x31d245);logger['debug']('ShowFaxQueue',_0x31d245,JSON[_0x716d('0x24')](_0x1629a3));_0xe8c9b0(_0x1629a3);})[_0x716d('0x1a')](function(_0x4281c7){logger[_0x716d('0x16')]('ShowFaxQueue',_0x4281c7[_0x716d('0x18')],_0x31d245);_0x464d3b(_0xd3ebfe['error'](0x1f4,_0x4281c7['message']));});});}; \ No newline at end of file +var _0x406b=['client','http','socket.io-emitter','redis','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','debug','ShowFaxQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3c0000,_0x2f9529){var _0x61b963=function(_0x369757){while(--_0x369757){_0x3c0000['push'](_0x3c0000['shift']());}};_0x61b963(++_0x2f9529);}(_0x406b,0x13a));var _0xb406=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x406b[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xb406('0x0'));var util=require(_0xb406('0x1'));var moment=require(_0xb406('0x2'));var BPromise=require('bluebird');var rs=require(_0xb406('0x3'));var fs=require('fs');var Redis=require(_0xb406('0x4'));var db=require(_0xb406('0x5'))['db'];var utils=require(_0xb406('0x6'));var logger=require('../../config/logger')(_0xb406('0x7'));var config=require(_0xb406('0x8'));var jayson=require(_0xb406('0x9'));var client=jayson[_0xb406('0xa')][_0xb406('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb406('0xc'))(new Redis(config[_0xb406('0xd')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x28dbc7,_0xaae289,_0x4d7427){return new BPromise(function(_0x54293b,_0x1ce583){return client['request'](_0x28dbc7,_0x4d7427)[_0xb406('0xe')](function(_0x4f764c){logger[_0xb406('0xf')](_0xb406('0x10'),_0xaae289,_0xb406('0x11'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0xaae289,_0xb406('0x11'),JSON[_0xb406('0x12')](_0x4f764c));if(_0x4f764c[_0xb406('0x13')]){if(_0x4f764c[_0xb406('0x13')][_0xb406('0x14')]===0x1f4){logger[_0xb406('0x13')](_0xb406('0x10'),_0xaae289,_0x4f764c[_0xb406('0x13')][_0xb406('0x15')]);return _0x1ce583(_0x4f764c['error'][_0xb406('0x15')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0xaae289,_0x4f764c[_0xb406('0x13')][_0xb406('0x15')]);return _0x54293b(_0x4f764c['error'][_0xb406('0x15')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0xaae289,_0xb406('0x11'));_0x54293b(_0x4f764c['result'][_0xb406('0x15')]);}})[_0xb406('0x16')](function(_0x235e3d){logger['error']('FaxQueue,\x20%s,\x20%s',_0xaae289,_0x235e3d);_0x1ce583(_0x235e3d);});});}exports[_0xb406('0x17')]=function(_0x2da0a8){var _0x3371aa=this;return new Promise(function(_0x2263c1,_0x4e9130){return db[_0xb406('0x18')][_0xb406('0x19')]({'raw':_0x2da0a8['options']?_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1b')]===undefined?!![]:![]:!![],'where':_0x2da0a8[_0xb406('0x1a')]?_0x2da0a8[_0xb406('0x1a')]['where']||null:null,'attributes':_0x2da0a8[_0xb406('0x1a')]?_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1c')]||null:null,'limit':_0x2da0a8[_0xb406('0x1a')]?_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1d')]||null:null,'include':_0x2da0a8[_0xb406('0x1a')]?_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1e')],function(_0x268c11){return{'model':db[_0x268c11['model']],'as':_0x268c11['as'],'attributes':_0x268c11[_0xb406('0x1c')],'include':_0x268c11[_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x268c11[_0xb406('0x1e')],function(_0x5416d5){return{'model':db[_0x5416d5['model']],'as':_0x5416d5['as'],'attributes':_0x5416d5[_0xb406('0x1c')],'include':_0x5416d5[_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x5416d5[_0xb406('0x1e')],function(_0x4169f5){return{'model':db[_0x4169f5[_0xb406('0x20')]],'as':_0x4169f5['as'],'attributes':_0x4169f5[_0xb406('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb406('0xe')](function(_0x3a0eaf){logger[_0xb406('0xf')]('GetFaxQueue',_0x2da0a8);logger[_0xb406('0x21')]('GetFaxQueue',_0x2da0a8,JSON['stringify'](_0x3a0eaf));_0x2263c1(_0x3a0eaf);})[_0xb406('0x16')](function(_0x252f9e){logger[_0xb406('0x13')]('GetFaxQueue',_0x252f9e[_0xb406('0x15')],_0x2da0a8);_0x4e9130(_0x3371aa['error'](0x1f4,_0x252f9e['message']));});});};exports[_0xb406('0x22')]=function(_0x2c4239){var _0x3ead0a=this;return new Promise(function(_0x2c66dd,_0x10266d){return db['FaxQueue'][_0xb406('0x23')]({'raw':_0x2c4239[_0xb406('0x1a')]?_0x2c4239[_0xb406('0x1a')][_0xb406('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c4239['options']?_0x2c4239['options']['where']||null:null,'attributes':_0x2c4239[_0xb406('0x1a')]?_0x2c4239[_0xb406('0x1a')][_0xb406('0x1c')]||null:null,'include':_0x2c4239[_0xb406('0x1a')]?_0x2c4239[_0xb406('0x1a')][_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x2c4239[_0xb406('0x1a')][_0xb406('0x1e')],function(_0x2e2210){return{'model':db[_0x2e2210[_0xb406('0x20')]],'as':_0x2e2210['as'],'attributes':_0x2e2210['attributes'],'include':_0x2e2210[_0xb406('0x1e')]?_['map'](_0x2e2210['include'],function(_0x1ebefb){return{'model':db[_0x1ebefb['model']],'as':_0x1ebefb['as'],'attributes':_0x1ebefb[_0xb406('0x1c')],'include':_0x1ebefb[_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x1ebefb[_0xb406('0x1e')],function(_0x324703){return{'model':db[_0x324703[_0xb406('0x20')]],'as':_0x324703['as'],'attributes':_0x324703['attributes']};}):[]};}):[]};}):[]:[]})[_0xb406('0xe')](function(_0xf40762){logger[_0xb406('0xf')](_0xb406('0x22'),_0x2c4239);logger['debug'](_0xb406('0x22'),_0x2c4239,JSON[_0xb406('0x12')](_0xf40762));_0x2c66dd(_0xf40762);})[_0xb406('0x16')](function(_0x384819){logger[_0xb406('0x13')](_0xb406('0x22'),_0x384819[_0xb406('0x15')],_0x2c4239);_0x10266d(_0x3ead0a[_0xb406('0x13')](0x1f4,_0x384819[_0xb406('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 4dd840e..9db07d8 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 _0x77ea=['emit','removeListener','length','faxQueue:','save','remove','update'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x77ea,0x18c));var _0xa77e=function(_0x28594b,_0x22c888){_0x28594b=_0x28594b-0x0;var _0x2a9abf=_0x77ea[_0x28594b];return _0x2a9abf;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xa77e('0x0'),_0xa77e('0x1'),_0xa77e('0x2')];function createListener(_0x1c027b,_0x35444d){return function(_0x6f876b){_0x35444d[_0xa77e('0x3')](_0x1c027b,_0x6f876b);};}function removeListener(_0x14fd44,_0x390ccb){return function(){FaxQueueEvents[_0xa77e('0x4')](_0x14fd44,_0x390ccb);};}exports['register']=function(_0x4dcf0a){for(var _0x491fd5=0x0,_0x2f9b42=events[_0xa77e('0x5')];_0x491fd5<_0x2f9b42;_0x491fd5++){var _0x4416c8=events[_0x491fd5];var _0x277eb5=createListener(_0xa77e('0x6')+_0x4416c8,_0x4dcf0a);FaxQueueEvents['on'](_0x4416c8,_0x277eb5);}}; \ No newline at end of file +var _0x781c=['register','length','save','remove','update','emit','removeListener'];(function(_0x3e186f,_0x2eb7be){var _0x3595bf=function(_0x5cb578){while(--_0x5cb578){_0x3e186f['push'](_0x3e186f['shift']());}};_0x3595bf(++_0x2eb7be);}(_0x781c,0x105));var _0xc781=function(_0x5b7911,_0xca8bbd){_0x5b7911=_0x5b7911-0x0;var _0x3353a9=_0x781c[_0x5b7911];return _0x3353a9;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xc781('0x0'),_0xc781('0x1'),_0xc781('0x2')];function createListener(_0x2ff709,_0x3c73fa){return function(_0x39ec17){_0x3c73fa[_0xc781('0x3')](_0x2ff709,_0x39ec17);};}function removeListener(_0x3b01fb,_0x10272c){return function(){FaxQueueEvents[_0xc781('0x4')](_0x3b01fb,_0x10272c);};}exports[_0xc781('0x5')]=function(_0x279353){for(var _0x11adbe=0x0,_0x263c5c=events[_0xc781('0x6')];_0x11adbe<_0x263c5c;_0x11adbe++){var _0x1b4dd5=events[_0x11adbe];var _0x159ede=createListener('faxQueue:'+_0x1b4dd5,_0x279353);FaxQueueEvents['on'](_0x1b4dd5,_0x159ede);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index c5fa6e0..f582441 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 _0x5430=['addAgents','put','update','destroy','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams'];(function(_0x4927a3,_0x19d72c){var _0x51cf4f=function(_0x32eb5f){while(--_0x32eb5f){_0x4927a3['push'](_0x4927a3['shift']());}};_0x51cf4f(++_0x19d72c);}(_0x5430,0x10c));var _0x0543=function(_0x2dcd1d,_0x95219a){_0x2dcd1d=_0x2dcd1d-0x0;var _0x20582d=_0x5430[_0x2dcd1d];return _0x20582d;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0543('0x6'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x0543('0x7')]('/',auth[_0x0543('0x8')](),controller[_0x0543('0x9')]);router[_0x0543('0x7')](_0x0543('0xa'),auth['isAuthenticated'](),controller[_0x0543('0xb')]);router[_0x0543('0x7')](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0xd')]);router[_0x0543('0x7')]('/:id/members',auth[_0x0543('0x8')](),controller[_0x0543('0xe')]);router['get'](_0x0543('0xf'),auth[_0x0543('0x8')](),controller[_0x0543('0x10')]);router[_0x0543('0x7')](_0x0543('0x11'),auth[_0x0543('0x8')](),controller[_0x0543('0x12')]);router[_0x0543('0x13')]('/',auth[_0x0543('0x8')](),controller[_0x0543('0x14')]);router[_0x0543('0x13')](_0x0543('0xf'),auth['isAuthenticated'](),controller[_0x0543('0x15')]);router[_0x0543('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x0543('0x16')]);router[_0x0543('0x17')](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0x18')]);router['delete'](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0x19')]);router[_0x0543('0x1a')](_0x0543('0xf'),auth[_0x0543('0x8')](),controller[_0x0543('0x1b')]);router['delete'](_0x0543('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0543('0x1c')]=router; \ No newline at end of file +var _0x9536=['put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents'];(function(_0x2e498d,_0x39acdf){var _0x1d3656=function(_0x1d14ea){while(--_0x1d14ea){_0x2e498d['push'](_0x2e498d['shift']());}};_0x1d3656(++_0x39acdf);}(_0x9536,0x179));var _0x6953=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x9536[_0x4ca333];return _0x13b2e1;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6953('0x5'));var interaction=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var controller=require(_0x6953('0x8'));router[_0x6953('0x9')]('/',auth['isAuthenticated'](),controller[_0x6953('0xa')]);router[_0x6953('0x9')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0xd')]);router['get'](_0x6953('0xe'),auth[_0x6953('0xc')](),controller[_0x6953('0xf')]);router['get'](_0x6953('0x10'),auth[_0x6953('0xc')](),controller[_0x6953('0x11')]);router[_0x6953('0x9')](_0x6953('0x12'),auth[_0x6953('0xc')](),controller[_0x6953('0x13')]);router[_0x6953('0x9')](_0x6953('0x14'),auth['isAuthenticated'](),controller[_0x6953('0x15')]);router['post']('/',auth[_0x6953('0xc')](),controller[_0x6953('0x16')]);router[_0x6953('0x17')](_0x6953('0x12'),auth[_0x6953('0xc')](),controller[_0x6953('0x18')]);router[_0x6953('0x17')](_0x6953('0x14'),auth[_0x6953('0xc')](),controller[_0x6953('0x19')]);router[_0x6953('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x6953('0x1b')]);router[_0x6953('0x1c')](_0x6953('0xe'),auth[_0x6953('0xc')](),controller['destroy']);router[_0x6953('0x1c')](_0x6953('0x12'),auth['isAuthenticated'](),controller[_0x6953('0x1d')]);router[_0x6953('0x1c')](_0x6953('0x14'),auth[_0x6953('0xc')](),controller[_0x6953('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 7828a06..26e38bc 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 _0x9b6d=['DATE','sequelize','exports','STRING'];(function(_0x373279,_0x498af0){var _0x13e6a0=function(_0x25ae7d){while(--_0x25ae7d){_0x373279['push'](_0x373279['shift']());}};_0x13e6a0(++_0x498af0);}(_0x9b6d,0x105));var _0xd9b6=function(_0x1aa762,_0x3b1fb3){_0x1aa762=_0x1aa762-0x0;var _0x5ae6f5=_0x9b6d[_0x1aa762];return _0x5ae6f5;};'use strict';var moment=require('moment');var Sequelize=require(_0xd9b6('0x0'));module[_0xd9b6('0x1')]={'uniqueid':{'type':Sequelize[_0xd9b6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd9b6('0x2')]},'joinAt':{'type':Sequelize[_0xd9b6('0x3')]},'leaveAt':{'type':Sequelize[_0xd9b6('0x3')]},'acceptAt':{'type':Sequelize[_0xd9b6('0x3')]},'exitAt':{'type':Sequelize[_0xd9b6('0x3')]},'reason':{'type':Sequelize[_0xd9b6('0x2')]}}; \ No newline at end of file +var _0x65c4=['DATE','moment','STRING'];(function(_0x68016,_0x90d27a){var _0x3ab6ad=function(_0x3976d8){while(--_0x3976d8){_0x68016['push'](_0x68016['shift']());}};_0x3ab6ad(++_0x90d27a);}(_0x65c4,0x19f));var _0x465c=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x65c4[_0x298ed3];return _0x5aad28;};'use strict';var moment=require(_0x465c('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x465c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x465c('0x1')]},'joinAt':{'type':Sequelize[_0x465c('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x465c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 6bd2e42..a3c7d30 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 _0x843b=['end','error','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject','save','then','destroy'];(function(_0x20d290,_0x40fc11){var _0x2bfa8f=function(_0x2498e0){while(--_0x2498e0){_0x20d290['push'](_0x20d290['shift']());}};_0x2bfa8f(++_0x40fc11);}(_0x843b,0xc5));var _0xb843=function(_0x59c8ea,_0x5d1535){_0x59c8ea=_0x59c8ea-0x0;var _0x4a5cd8=_0x843b[_0x59c8ea];return _0x4a5cd8;};'use strict';var emlformat=require(_0xb843('0x0'));var rimraf=require(_0xb843('0x1'));var zipdir=require(_0xb843('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb843('0x3'));var moment=require(_0xb843('0x4'));var BPromise=require(_0xb843('0x5'));var Mustache=require(_0xb843('0x6'));var util=require(_0xb843('0x7'));var path=require(_0xb843('0x8'));var sox=require(_0xb843('0x9'));var csv=require(_0xb843('0xa'));var ejs=require(_0xb843('0xb'));var fs=require('fs');var fs_extra=require(_0xb843('0xc'));var _=require(_0xb843('0xd'));var squel=require(_0xb843('0xe'));var crypto=require(_0xb843('0xf'));var jsforce=require(_0xb843('0x10'));var deskjs=require(_0xb843('0x11'));var toCsv=require(_0xb843('0xa'));var querystring=require('querystring');var Papa=require(_0xb843('0x12'));var Redis=require(_0xb843('0x13'));var authService=require(_0xb843('0x14'));var qs=require(_0xb843('0x15'));var as=require(_0xb843('0x16'));var hardwareService=require(_0xb843('0x17'));var logger=require(_0xb843('0x18'))('api');var utils=require(_0xb843('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb843('0x1a'));var db=require(_0xb843('0x1b'))['db'];function respondWithStatusCode(_0x2fc2a9,_0x3ab55e){_0x3ab55e=_0x3ab55e||0xcc;return function(_0x2f8e71){if(_0x2f8e71){return _0x2fc2a9[_0xb843('0x1c')](_0x3ab55e);}return _0x2fc2a9[_0xb843('0x1d')](_0x3ab55e)['end']();};}function respondWithResult(_0x5a7cc6,_0x17e748){_0x17e748=_0x17e748||0xc8;return function(_0x2986b7){if(_0x2986b7){return _0x5a7cc6['status'](_0x17e748)['json'](_0x2986b7);}};}function respondWithFilteredResult(_0xa6984,_0x3d9ce2){return function(_0x1c4a1c){if(_0x1c4a1c){var _0x58b770=typeof _0x3d9ce2[_0xb843('0x1e')]===_0xb843('0x1f')&&typeof _0x3d9ce2[_0xb843('0x20')]===_0xb843('0x1f');var _0x15a892=_0x1c4a1c[_0xb843('0x21')];var _0x1925b3=_0x58b770?0x0:_0x3d9ce2[_0xb843('0x1e')];var _0x5035f3=_0x58b770?_0x1c4a1c[_0xb843('0x21')]:_0x3d9ce2[_0xb843('0x1e')]+_0x3d9ce2[_0xb843('0x20')];var _0x40e8e0;if(_0x5035f3>=_0x15a892){_0x5035f3=_0x15a892;_0x40e8e0=0xc8;}else{_0x40e8e0=0xce;}_0xa6984[_0xb843('0x1d')](_0x40e8e0);return _0xa6984['set']('Content-Range',_0x1925b3+'-'+_0x5035f3+'/'+_0x15a892)[_0xb843('0x22')](_0x1c4a1c);}return null;};}function patchUpdates(_0x33abbb){return function(_0x4c8d8b){try{jsonpatch[_0xb843('0x23')](_0x4c8d8b,_0x33abbb,!![]);}catch(_0x208036){return BPromise[_0xb843('0x24')](_0x208036);}return _0x4c8d8b[_0xb843('0x25')]();};}function saveUpdates(_0x44dadc,_0x3215be){return function(_0x2e56a8){if(_0x2e56a8){return _0x2e56a8['update'](_0x44dadc)[_0xb843('0x26')](function(_0x1afd57){return _0x1afd57;});}return null;};}function removeEntity(_0x53a689,_0x395045){return function(_0x33c3a4){if(_0x33c3a4){return _0x33c3a4[_0xb843('0x27')]()['then'](function(){_0x53a689[_0xb843('0x1d')](0xcc)[_0xb843('0x28')]();});}};}function handleEntityNotFound(_0x3d771d,_0x499859){return function(_0x5623ad){if(!_0x5623ad){_0x3d771d['sendStatus'](0x194);}return _0x5623ad;};}function handleError(_0x3cd3b0,_0x39ade6){_0x39ade6=_0x39ade6||0x1f4;return function(_0x5bdba8){logger[_0xb843('0x29')](_0x5bdba8[_0xb843('0x2a')]);if(_0x5bdba8[_0xb843('0x2b')]){delete _0x5bdba8[_0xb843('0x2b')];}_0x3cd3b0[_0xb843('0x1d')](_0x39ade6)[_0xb843('0x2c')](_0x5bdba8);};}exports['index']=function(_0xd9565c,_0xf34316){var _0x1753e5={},_0x4bc8e5={},_0x3fe943={'count':0x0,'rows':[]};var _0x3ace8d=_[_0xb843('0x2d')](db[_0xb843('0x2e')][_0xb843('0x2f')],function(_0x5d8a72){return{'name':_0x5d8a72[_0xb843('0x30')],'type':_0x5d8a72[_0xb843('0x31')]['key']};});_0x4bc8e5[_0xb843('0x32')]=_['map'](_0x3ace8d,_0xb843('0x2b'));_0x4bc8e5[_0xb843('0x33')]=_['keys'](_0xd9565c['query']);_0x4bc8e5['filters']=_[_0xb843('0x34')](_0x4bc8e5[_0xb843('0x32')],_0x4bc8e5['query']);_0x1753e5[_0xb843('0x35')]=_[_0xb843('0x34')](_0x4bc8e5[_0xb843('0x32')],qs[_0xb843('0x36')](_0xd9565c[_0xb843('0x33')]['fields']));_0x1753e5[_0xb843('0x35')]=_0x1753e5[_0xb843('0x35')][_0xb843('0x37')]?_0x1753e5[_0xb843('0x35')]:_0x4bc8e5['model'];if(!_0xd9565c[_0xb843('0x33')][_0xb843('0x38')](_0xb843('0x39'))){_0x1753e5['limit']=qs[_0xb843('0x20')](_0xd9565c[_0xb843('0x33')][_0xb843('0x20')]);_0x1753e5[_0xb843('0x1e')]=qs[_0xb843('0x1e')](_0xd9565c['query']['offset']);}_0x1753e5[_0xb843('0x3a')]=qs['sort'](_0xd9565c[_0xb843('0x33')][_0xb843('0x3b')]);_0x1753e5[_0xb843('0x3c')]=qs[_0xb843('0x3d')](_[_0xb843('0x3e')](_0xd9565c[_0xb843('0x33')],_0x4bc8e5[_0xb843('0x3d')]),_0x3ace8d);if(_0xd9565c[_0xb843('0x33')][_0xb843('0x3f')]){_0x1753e5['where']=_[_0xb843('0x40')](_0x1753e5[_0xb843('0x3c')],{'$or':_[_0xb843('0x2d')](_0x3ace8d,function(_0x537911){if(_0x537911[_0xb843('0x31')]!=='VIRTUAL'){var _0x539ad3={};_0x539ad3[_0x537911[_0xb843('0x2b')]]={'$like':'%'+_0xd9565c[_0xb843('0x33')]['filter']+'%'};return _0x539ad3;}})});}_0x1753e5=_[_0xb843('0x40')]({},_0x1753e5,_0xd9565c[_0xb843('0x41')]);var _0x19f0d2={'where':_0x1753e5['where']};return db[_0xb843('0x2e')][_0xb843('0x21')](_0x19f0d2)['then'](function(_0x19032f){_0x3fe943[_0xb843('0x21')]=_0x19032f;if(_0xd9565c[_0xb843('0x33')][_0xb843('0x42')]){_0x1753e5[_0xb843('0x43')]=[{'all':!![]}];}return db[_0xb843('0x2e')][_0xb843('0x44')](_0x1753e5);})[_0xb843('0x26')](function(_0x5399af){_0x3fe943[_0xb843('0x45')]=_0x5399af;return _0x3fe943;})['then'](respondWithFilteredResult(_0xf34316,_0x1753e5))[_0xb843('0x46')](handleError(_0xf34316,null));};exports[_0xb843('0x47')]=function(_0x275fa8,_0x3cc51e){var _0x8e5b6f={'raw':!![],'where':{'id':_0x275fa8['params']['id']}},_0x518ce0={};_0x518ce0[_0xb843('0x32')]=_[_0xb843('0x48')](db['FaxQueueReport'][_0xb843('0x2f')]);_0x518ce0['query']=_['keys'](_0x275fa8['query']);_0x518ce0[_0xb843('0x3d')]=_[_0xb843('0x34')](_0x518ce0[_0xb843('0x32')],_0x518ce0[_0xb843('0x33')]);_0x8e5b6f[_0xb843('0x35')]=_['intersection'](_0x518ce0[_0xb843('0x32')],qs[_0xb843('0x36')](_0x275fa8['query'][_0xb843('0x36')]));_0x8e5b6f[_0xb843('0x35')]=_0x8e5b6f[_0xb843('0x35')][_0xb843('0x37')]?_0x8e5b6f[_0xb843('0x35')]:_0x518ce0[_0xb843('0x32')];if(_0x275fa8[_0xb843('0x33')][_0xb843('0x42')]){_0x8e5b6f[_0xb843('0x43')]=[{'all':!![]}];}_0x8e5b6f=_[_0xb843('0x40')]({},_0x8e5b6f,_0x275fa8['options']);return db['FaxQueueReport'][_0xb843('0x49')](_0x8e5b6f)[_0xb843('0x26')](handleEntityNotFound(_0x3cc51e,null))[_0xb843('0x26')](respondWithResult(_0x3cc51e,null))['catch'](handleError(_0x3cc51e,null));};exports['create']=function(_0x461f5c,_0x4a6604){return db[_0xb843('0x2e')][_0xb843('0x4a')](_0x461f5c[_0xb843('0x4b')],{})[_0xb843('0x26')](respondWithResult(_0x4a6604,0xc9))[_0xb843('0x46')](handleError(_0x4a6604,null));};exports[_0xb843('0x4c')]=function(_0x2fedeb,_0x4f2d1f){if(_0x2fedeb[_0xb843('0x4b')]['id']){delete _0x2fedeb['body']['id'];}return db[_0xb843('0x2e')][_0xb843('0x49')]({'where':{'id':_0x2fedeb[_0xb843('0x4d')]['id']}})[_0xb843('0x26')](handleEntityNotFound(_0x4f2d1f,null))[_0xb843('0x26')](saveUpdates(_0x2fedeb[_0xb843('0x4b')],null))[_0xb843('0x26')](respondWithResult(_0x4f2d1f,null))[_0xb843('0x46')](handleError(_0x4f2d1f,null));};exports[_0xb843('0x27')]=function(_0x4aff81,_0x330c89){return db[_0xb843('0x2e')][_0xb843('0x49')]({'where':{'id':_0x4aff81[_0xb843('0x4d')]['id']}})[_0xb843('0x26')](handleEntityNotFound(_0x330c89,null))[_0xb843('0x26')](removeEntity(_0x330c89,null))['catch'](handleError(_0x330c89,null));};exports['describe']=function(_0x2708d8,_0x14376a){return db['FaxQueueReport'][_0xb843('0x4e')]()[_0xb843('0x26')](respondWithResult(_0x14376a,null))[_0xb843('0x46')](handleError(_0x14376a,null));}; \ No newline at end of file +var _0x8f7d=['type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x133f81,_0x550e62){var _0x2eef30=function(_0x48e9bf){while(--_0x48e9bf){_0x133f81['push'](_0x133f81['shift']());}};_0x2eef30(++_0x550e62);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x4fb4ec,_0x1278c2){_0x4fb4ec=_0x4fb4ec-0x0;var _0x3fa7e3=_0x8f7d[_0x4fb4ec];return _0x3fa7e3;};'use strict';var emlformat=require(_0xd8f7('0x0'));var rimraf=require(_0xd8f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd8f7('0x3'));var Mustache=require('mustache');var util=require(_0xd8f7('0x4'));var path=require(_0xd8f7('0x5'));var sox=require(_0xd8f7('0x6'));var csv=require(_0xd8f7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8f7('0x8'));var _=require(_0xd8f7('0x9'));var squel=require(_0xd8f7('0xa'));var crypto=require(_0xd8f7('0xb'));var jsforce=require(_0xd8f7('0xc'));var deskjs=require(_0xd8f7('0xd'));var toCsv=require(_0xd8f7('0x7'));var querystring=require(_0xd8f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xd8f7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd8f7('0x10'));var as=require(_0xd8f7('0x11'));var hardwareService=require(_0xd8f7('0x12'));var logger=require(_0xd8f7('0x13'))(_0xd8f7('0x14'));var utils=require(_0xd8f7('0x15'));var config=require(_0xd8f7('0x16'));var licenseUtil=require(_0xd8f7('0x17'));var db=require(_0xd8f7('0x18'))['db'];function respondWithStatusCode(_0x41ebd3,_0x29467b){_0x29467b=_0x29467b||0xcc;return function(_0x21ee60){if(_0x21ee60){return _0x41ebd3[_0xd8f7('0x19')](_0x29467b);}return _0x41ebd3[_0xd8f7('0x1a')](_0x29467b)[_0xd8f7('0x1b')]();};}function respondWithResult(_0x4406c7,_0x4b4114){_0x4b4114=_0x4b4114||0xc8;return function(_0x5c1177){if(_0x5c1177){return _0x4406c7['status'](_0x4b4114)[_0xd8f7('0x1c')](_0x5c1177);}};}function respondWithFilteredResult(_0x2b58c1,_0x341152){return function(_0x109488){if(_0x109488){var _0x299208=typeof _0x341152[_0xd8f7('0x1d')]===_0xd8f7('0x1e')&&typeof _0x341152[_0xd8f7('0x1f')]==='undefined';var _0x478e46=_0x109488['count'];var _0x202298=_0x299208?0x0:_0x341152[_0xd8f7('0x1d')];var _0x5d31c5=_0x299208?_0x109488[_0xd8f7('0x20')]:_0x341152[_0xd8f7('0x1d')]+_0x341152[_0xd8f7('0x1f')];var _0x48a97b;if(_0x5d31c5>=_0x478e46){_0x5d31c5=_0x478e46;_0x48a97b=0xc8;}else{_0x48a97b=0xce;}_0x2b58c1[_0xd8f7('0x1a')](_0x48a97b);return _0x2b58c1['set'](_0xd8f7('0x21'),_0x202298+'-'+_0x5d31c5+'/'+_0x478e46)[_0xd8f7('0x1c')](_0x109488);}return null;};}function patchUpdates(_0x4e0ec4){return function(_0xcbc2a5){try{jsonpatch[_0xd8f7('0x22')](_0xcbc2a5,_0x4e0ec4,!![]);}catch(_0x57bf17){return BPromise[_0xd8f7('0x23')](_0x57bf17);}return _0xcbc2a5[_0xd8f7('0x24')]();};}function saveUpdates(_0x54bc78,_0x2fc6cb){return function(_0x58469a){if(_0x58469a){return _0x58469a['update'](_0x54bc78)[_0xd8f7('0x25')](function(_0x4e1e10){return _0x4e1e10;});}return null;};}function removeEntity(_0x148d6f,_0x1bbe84){return function(_0x4d84bb){if(_0x4d84bb){return _0x4d84bb[_0xd8f7('0x26')]()[_0xd8f7('0x25')](function(){_0x148d6f[_0xd8f7('0x1a')](0xcc)[_0xd8f7('0x1b')]();});}};}function handleEntityNotFound(_0x8874d4,_0x380247){return function(_0x3ca18a){if(!_0x3ca18a){_0x8874d4[_0xd8f7('0x19')](0x194);}return _0x3ca18a;};}function handleError(_0x424b91,_0x8a8403){_0x8a8403=_0x8a8403||0x1f4;return function(_0x4ba0f){logger[_0xd8f7('0x27')](_0x4ba0f[_0xd8f7('0x28')]);if(_0x4ba0f['name']){delete _0x4ba0f['name'];}_0x424b91[_0xd8f7('0x1a')](_0x8a8403)[_0xd8f7('0x29')](_0x4ba0f);};}exports[_0xd8f7('0x2a')]=function(_0x20ef3a,_0x35ef58){var _0x101935={},_0x5d54b9={},_0x480635={'count':0x0,'rows':[]};var _0x12bf13=_[_0xd8f7('0x2b')](db[_0xd8f7('0x2c')][_0xd8f7('0x2d')],function(_0x3e2f76){return{'name':_0x3e2f76[_0xd8f7('0x2e')],'type':_0x3e2f76['type']['key']};});_0x5d54b9[_0xd8f7('0x2f')]=_['map'](_0x12bf13,_0xd8f7('0x30'));_0x5d54b9['query']=_[_0xd8f7('0x31')](_0x20ef3a[_0xd8f7('0x32')]);_0x5d54b9[_0xd8f7('0x33')]=_[_0xd8f7('0x34')](_0x5d54b9[_0xd8f7('0x2f')],_0x5d54b9[_0xd8f7('0x32')]);_0x101935['attributes']=_['intersection'](_0x5d54b9[_0xd8f7('0x2f')],qs[_0xd8f7('0x35')](_0x20ef3a['query'][_0xd8f7('0x35')]));_0x101935[_0xd8f7('0x36')]=_0x101935[_0xd8f7('0x36')][_0xd8f7('0x37')]?_0x101935[_0xd8f7('0x36')]:_0x5d54b9[_0xd8f7('0x2f')];if(!_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x38')](_0xd8f7('0x39'))){_0x101935[_0xd8f7('0x1f')]=qs[_0xd8f7('0x1f')](_0x20ef3a['query']['limit']);_0x101935[_0xd8f7('0x1d')]=qs['offset'](_0x20ef3a['query'][_0xd8f7('0x1d')]);}_0x101935[_0xd8f7('0x3a')]=qs[_0xd8f7('0x3b')](_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3b')]);_0x101935[_0xd8f7('0x3c')]=qs['filters'](_['pick'](_0x20ef3a[_0xd8f7('0x32')],_0x5d54b9['filters']),_0x12bf13);if(_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3d')]){_0x101935[_0xd8f7('0x3c')]=_[_0xd8f7('0x3e')](_0x101935[_0xd8f7('0x3c')],{'$or':_[_0xd8f7('0x2b')](_0x12bf13,function(_0x40a26c){if(_0x40a26c[_0xd8f7('0x3f')]!==_0xd8f7('0x40')){var _0x41c08c={};_0x41c08c[_0x40a26c[_0xd8f7('0x30')]]={'$like':'%'+_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3d')]+'%'};return _0x41c08c;}})});}_0x101935=_['merge']({},_0x101935,_0x20ef3a[_0xd8f7('0x41')]);var _0x143e1a={'where':_0x101935[_0xd8f7('0x3c')]};return db[_0xd8f7('0x2c')][_0xd8f7('0x20')](_0x143e1a)[_0xd8f7('0x25')](function(_0x153ff0){_0x480635[_0xd8f7('0x20')]=_0x153ff0;if(_0x20ef3a['query'][_0xd8f7('0x42')]){_0x101935[_0xd8f7('0x43')]=[{'all':!![]}];}return db[_0xd8f7('0x2c')][_0xd8f7('0x44')](_0x101935);})[_0xd8f7('0x25')](function(_0x254c15){_0x480635['rows']=_0x254c15;return _0x480635;})[_0xd8f7('0x25')](respondWithFilteredResult(_0x35ef58,_0x101935))[_0xd8f7('0x45')](handleError(_0x35ef58,null));};exports[_0xd8f7('0x46')]=function(_0x51d5a2,_0x265429){var _0x244d12={'raw':!![],'where':{'id':_0x51d5a2[_0xd8f7('0x47')]['id']}},_0x5cadee={};_0x5cadee[_0xd8f7('0x2f')]=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x5cadee[_0xd8f7('0x32')]=_[_0xd8f7('0x31')](_0x51d5a2[_0xd8f7('0x32')]);_0x5cadee[_0xd8f7('0x33')]=_['intersection'](_0x5cadee[_0xd8f7('0x2f')],_0x5cadee[_0xd8f7('0x32')]);_0x244d12[_0xd8f7('0x36')]=_[_0xd8f7('0x34')](_0x5cadee[_0xd8f7('0x2f')],qs[_0xd8f7('0x35')](_0x51d5a2[_0xd8f7('0x32')][_0xd8f7('0x35')]));_0x244d12[_0xd8f7('0x36')]=_0x244d12[_0xd8f7('0x36')][_0xd8f7('0x37')]?_0x244d12[_0xd8f7('0x36')]:_0x5cadee[_0xd8f7('0x2f')];if(_0x51d5a2[_0xd8f7('0x32')][_0xd8f7('0x42')]){_0x244d12[_0xd8f7('0x43')]=[{'all':!![]}];}_0x244d12=_['merge']({},_0x244d12,_0x51d5a2['options']);return db[_0xd8f7('0x2c')][_0xd8f7('0x48')](_0x244d12)[_0xd8f7('0x25')](handleEntityNotFound(_0x265429,null))['then'](respondWithResult(_0x265429,null))[_0xd8f7('0x45')](handleError(_0x265429,null));};exports[_0xd8f7('0x49')]=function(_0x20832d,_0x1e8343){return db['FaxQueueReport'][_0xd8f7('0x49')](_0x20832d[_0xd8f7('0x4a')],{})[_0xd8f7('0x25')](respondWithResult(_0x1e8343,0xc9))[_0xd8f7('0x45')](handleError(_0x1e8343,null));};exports[_0xd8f7('0x4b')]=function(_0x3a317c,_0x522fb2){if(_0x3a317c[_0xd8f7('0x4a')]['id']){delete _0x3a317c[_0xd8f7('0x4a')]['id'];}return db[_0xd8f7('0x2c')][_0xd8f7('0x48')]({'where':{'id':_0x3a317c[_0xd8f7('0x47')]['id']}})[_0xd8f7('0x25')](handleEntityNotFound(_0x522fb2,null))[_0xd8f7('0x25')](saveUpdates(_0x3a317c['body'],null))[_0xd8f7('0x25')](respondWithResult(_0x522fb2,null))['catch'](handleError(_0x522fb2,null));};exports[_0xd8f7('0x26')]=function(_0x2a797d,_0x19ccef){return db['FaxQueueReport']['find']({'where':{'id':_0x2a797d['params']['id']}})['then'](handleEntityNotFound(_0x19ccef,null))['then'](removeEntity(_0x19ccef,null))['catch'](handleError(_0x19ccef,null));};exports[_0xd8f7('0x4c')]=function(_0x14a307,_0x2bca2b){return db[_0xd8f7('0x2c')][_0xd8f7('0x4c')]()[_0xd8f7('0x25')](respondWithResult(_0x2bca2b,null))[_0xd8f7('0x45')](handleError(_0x2bca2b,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e0e8aa9..0f5364e 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 _0x0295=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash','api','request-promise','path'];(function(_0x222217,_0x25e65e){var _0x5a2b8c=function(_0x5ba157){while(--_0x5ba157){_0x222217['push'](_0x222217['shift']());}};_0x5a2b8c(++_0x25e65e);}(_0x0295,0x1f0));var _0x5029=function(_0x26c643,_0x2c784a){_0x26c643=_0x26c643-0x0;var _0xb49398=_0x0295[_0x26c643];return _0xb49398;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5029('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x5c3720,_0x662f3b){var _0x21bf2d=function(_0x293f25){while(--_0x293f25){_0x5c3720['push'](_0x5c3720['shift']());}};_0x21bf2d(++_0x662f3b);}(_0x7a54,0x106));var _0x47a5=function(_0x21de59,_0x23b3a7){_0x21de59=_0x21de59-0x0;var _0x31f6de=_0x7a54[_0x21de59];return _0x31f6de;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index d5a3f2f..31ccd03 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 _0xeb03=['create','body','options','debug','catch','UpdateFaxQueueReport','FaxQueueReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','CreateFaxQueueReport'];(function(_0x10908d,_0xc632d0){var _0x4471bf=function(_0x380d80){while(--_0x380d80){_0x10908d['push'](_0x10908d['shift']());}};_0x4471bf(++_0xc632d0);}(_0xeb03,0xb6));var _0x3eb0=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xeb03[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x3eb0('0x0'));var util=require(_0x3eb0('0x1'));var moment=require(_0x3eb0('0x2'));var BPromise=require(_0x3eb0('0x3'));var rs=require(_0x3eb0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3eb0('0x5'))['db'];var utils=require(_0x3eb0('0x6'));var logger=require(_0x3eb0('0x7'))(_0x3eb0('0x8'));var config=require('../../config/environment');var jayson=require(_0x3eb0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c5234,_0x408041,_0x3c675c){return new BPromise(function(_0x1d9885,_0x224bbf){return client[_0x3eb0('0xa')](_0x2c5234,_0x3c675c)[_0x3eb0('0xb')](function(_0x54a678){logger[_0x3eb0('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x408041,_0x3eb0('0xd'));logger['debug'](_0x3eb0('0xe'),_0x408041,_0x3eb0('0xd'),JSON[_0x3eb0('0xf')](_0x54a678));if(_0x54a678[_0x3eb0('0x10')]){if(_0x54a678[_0x3eb0('0x10')][_0x3eb0('0x11')]===0x1f4){logger['error'](_0x3eb0('0x12'),_0x408041,_0x54a678[_0x3eb0('0x10')]['message']);return _0x224bbf(_0x54a678[_0x3eb0('0x10')][_0x3eb0('0x13')]);}logger[_0x3eb0('0x10')](_0x3eb0('0x12'),_0x408041,_0x54a678[_0x3eb0('0x10')]['message']);return _0x1d9885(_0x54a678[_0x3eb0('0x10')][_0x3eb0('0x13')]);}else{logger[_0x3eb0('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x408041,_0x3eb0('0xd'));_0x1d9885(_0x54a678['result'][_0x3eb0('0x13')]);}})['catch'](function(_0xebf97a){logger[_0x3eb0('0x10')](_0x3eb0('0x12'),_0x408041,_0xebf97a);_0x224bbf(_0xebf97a);});});}exports[_0x3eb0('0x14')]=function(_0x11de1c){var _0x12a60e=this;return new Promise(function(_0x5156fc,_0x2ae820){return db['FaxQueueReport'][_0x3eb0('0x15')](_0x11de1c[_0x3eb0('0x16')],{'raw':_0x11de1c[_0x3eb0('0x17')]?_0x11de1c['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x560790){logger['info'](_0x3eb0('0x14'),_0x11de1c);logger[_0x3eb0('0x18')]('CreateFaxQueueReport',_0x11de1c,JSON[_0x3eb0('0xf')](_0x560790));_0x5156fc(_0x560790);})[_0x3eb0('0x19')](function(_0x3c7d0c){logger[_0x3eb0('0x10')](_0x3eb0('0x14'),_0x3c7d0c[_0x3eb0('0x13')],_0x11de1c);_0x2ae820(_0x12a60e['error'](0x1f4,_0x3c7d0c[_0x3eb0('0x13')]));});});};exports[_0x3eb0('0x1a')]=function(_0x57a6ca){var _0x221d42=this;return new Promise(function(_0x13429a,_0x547411){return db[_0x3eb0('0x1b')][_0x3eb0('0x1c')](_0x57a6ca[_0x3eb0('0x16')],{'raw':_0x57a6ca[_0x3eb0('0x17')]?_0x57a6ca[_0x3eb0('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a6ca['options']?_0x57a6ca[_0x3eb0('0x17')]['where']||null:null,'attributes':_0x57a6ca[_0x3eb0('0x17')]?_0x57a6ca[_0x3eb0('0x17')]['attributes']||null:null,'limit':_0x57a6ca['options']?_0x57a6ca[_0x3eb0('0x17')]['limit']||null:null})['then'](function(_0x4e9e87){logger[_0x3eb0('0xc')](_0x3eb0('0x1a'),_0x57a6ca);logger[_0x3eb0('0x18')](_0x3eb0('0x1a'),_0x57a6ca,JSON[_0x3eb0('0xf')](_0x4e9e87));_0x13429a(_0x4e9e87);})[_0x3eb0('0x19')](function(_0x4cc2bb){logger[_0x3eb0('0x10')](_0x3eb0('0x1a'),_0x4cc2bb[_0x3eb0('0x13')],_0x57a6ca);_0x547411(_0x221d42[_0x3eb0('0x10')](0x1f4,_0x4cc2bb['message']));});});}; \ No newline at end of file +var _0x6bfd=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','catch','update','body','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x6bfd,0x13d));var _0xd6bf=function(_0x42bfd5,_0x26c47c){_0x42bfd5=_0x42bfd5-0x0;var _0x351cae=_0x6bfd[_0x42bfd5];return _0x351cae;};'use strict';var _=require(_0xd6bf('0x0'));var util=require('util');var moment=require(_0xd6bf('0x1'));var BPromise=require(_0xd6bf('0x2'));var rs=require(_0xd6bf('0x3'));var fs=require('fs');var Redis=require(_0xd6bf('0x4'));var db=require(_0xd6bf('0x5'))['db'];var utils=require(_0xd6bf('0x6'));var logger=require(_0xd6bf('0x7'))(_0xd6bf('0x8'));var config=require(_0xd6bf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd6bf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41efd3,_0x3f9a92,_0x209177){return new BPromise(function(_0x4fe11e,_0x3fdd62){return client[_0xd6bf('0xb')](_0x41efd3,_0x209177)[_0xd6bf('0xc')](function(_0x2fc47d){logger[_0xd6bf('0xd')](_0xd6bf('0xe'),_0x3f9a92,_0xd6bf('0xf'));logger[_0xd6bf('0x10')](_0xd6bf('0x11'),_0x3f9a92,_0xd6bf('0xf'),JSON[_0xd6bf('0x12')](_0x2fc47d));if(_0x2fc47d[_0xd6bf('0x13')]){if(_0x2fc47d['error']['code']===0x1f4){logger['error'](_0xd6bf('0xe'),_0x3f9a92,_0x2fc47d[_0xd6bf('0x13')][_0xd6bf('0x14')]);return _0x3fdd62(_0x2fc47d[_0xd6bf('0x13')][_0xd6bf('0x14')]);}logger[_0xd6bf('0x13')](_0xd6bf('0xe'),_0x3f9a92,_0x2fc47d['error'][_0xd6bf('0x14')]);return _0x4fe11e(_0x2fc47d[_0xd6bf('0x13')][_0xd6bf('0x14')]);}else{logger['info'](_0xd6bf('0xe'),_0x3f9a92,_0xd6bf('0xf'));_0x4fe11e(_0x2fc47d[_0xd6bf('0x15')][_0xd6bf('0x14')]);}})['catch'](function(_0x384275){logger[_0xd6bf('0x13')](_0xd6bf('0xe'),_0x3f9a92,_0x384275);_0x3fdd62(_0x384275);});});}exports[_0xd6bf('0x16')]=function(_0x2f131a){var _0x2dbfd1=this;return new Promise(function(_0x80f338,_0x3f7d7a){return db[_0xd6bf('0x17')][_0xd6bf('0x18')](_0x2f131a['body'],{'raw':_0x2f131a[_0xd6bf('0x19')]?_0x2f131a[_0xd6bf('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xd6bf('0xc')](function(_0x2d9318){logger[_0xd6bf('0xd')](_0xd6bf('0x16'),_0x2f131a);logger[_0xd6bf('0x10')](_0xd6bf('0x16'),_0x2f131a,JSON['stringify'](_0x2d9318));_0x80f338(_0x2d9318);})[_0xd6bf('0x1a')](function(_0x37ff69){logger[_0xd6bf('0x13')]('CreateFaxQueueReport',_0x37ff69['message'],_0x2f131a);_0x3f7d7a(_0x2dbfd1[_0xd6bf('0x13')](0x1f4,_0x37ff69['message']));});});};exports['UpdateFaxQueueReport']=function(_0x74b5cf){var _0x463e3b=this;return new Promise(function(_0x59adee,_0x755933){return db['FaxQueueReport'][_0xd6bf('0x1b')](_0x74b5cf[_0xd6bf('0x1c')],{'raw':_0x74b5cf[_0xd6bf('0x19')]?_0x74b5cf[_0xd6bf('0x19')][_0xd6bf('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x74b5cf[_0xd6bf('0x19')]?_0x74b5cf[_0xd6bf('0x19')][_0xd6bf('0x1e')]||null:null,'attributes':_0x74b5cf['options']?_0x74b5cf[_0xd6bf('0x19')][_0xd6bf('0x1f')]||null:null,'limit':_0x74b5cf[_0xd6bf('0x19')]?_0x74b5cf['options'][_0xd6bf('0x20')]||null:null})[_0xd6bf('0xc')](function(_0x3dc9df){logger['info']('UpdateFaxQueueReport',_0x74b5cf);logger[_0xd6bf('0x10')]('UpdateFaxQueueReport',_0x74b5cf,JSON[_0xd6bf('0x12')](_0x3dc9df));_0x59adee(_0x3dc9df);})['catch'](function(_0x118d3d){logger[_0xd6bf('0x13')]('UpdateFaxQueueReport',_0x118d3d[_0xd6bf('0x14')],_0x74b5cf);_0x755933(_0x463e3b[_0xd6bf('0x13')](0x1f4,_0x118d3d[_0xd6bf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 4d8c6d3..8717f31 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 _0x4b31=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','update','destroy','multer','path','connect-timeout','Router','fs-extra'];(function(_0x4418d6,_0x2a3b34){var _0x765d86=function(_0x386738){while(--_0x386738){_0x4418d6['push'](_0x4418d6['shift']());}};_0x765d86(++_0x2a3b34);}(_0x4b31,0x7b));var _0x14b3=function(_0x4dfb1b,_0x26850a){_0x4dfb1b=_0x4dfb1b-0x0;var _0x4dc88=_0x4b31[_0x4dfb1b];return _0x4dc88;};'use strict';var multer=require(_0x14b3('0x0'));var util=require('util');var path=require(_0x14b3('0x1'));var timeout=require(_0x14b3('0x2'));var express=require('express');var router=express[_0x14b3('0x3')]();var fs_extra=require(_0x14b3('0x4'));var auth=require(_0x14b3('0x5'));var interaction=require(_0x14b3('0x6'));var config=require(_0x14b3('0x7'));var controller=require('./faxQueueReport.controller');router[_0x14b3('0x8')]('/',auth[_0x14b3('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x14b3('0xa')]);router['get'](_0x14b3('0xb'),auth['isAuthenticated'](),controller[_0x14b3('0xc')]);router[_0x14b3('0xd')]('/',auth[_0x14b3('0x9')](),controller['create']);router['put']('/:id',auth[_0x14b3('0x9')](),controller[_0x14b3('0xe')]);router['delete'](_0x14b3('0xb'),auth[_0x14b3('0x9')](),controller[_0x14b3('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2d73=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x2638ab,_0x5bd48d){var _0x7b4e36=function(_0x5cd418){while(--_0x5cd418){_0x2638ab['push'](_0x2638ab['shift']());}};_0x7b4e36(++_0x5bd48d);}(_0x2d73,0x1ed));var _0x32d7=function(_0x1da448,_0x565a9f){_0x1da448=_0x1da448-0x0;var _0xdb7a13=_0x2d73[_0x1da448];return _0xdb7a13;};'use strict';var multer=require(_0x32d7('0x0'));var util=require(_0x32d7('0x1'));var path=require('path');var timeout=require(_0x32d7('0x2'));var express=require(_0x32d7('0x3'));var router=express[_0x32d7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x32d7('0x5'));var interaction=require(_0x32d7('0x6'));var config=require('../../config/environment');var controller=require(_0x32d7('0x7'));router[_0x32d7('0x8')]('/',auth[_0x32d7('0x9')](),controller['index']);router[_0x32d7('0x8')](_0x32d7('0xa'),auth['isAuthenticated'](),controller[_0x32d7('0xb')]);router[_0x32d7('0x8')](_0x32d7('0xc'),auth['isAuthenticated'](),controller[_0x32d7('0xd')]);router[_0x32d7('0xe')]('/',auth['isAuthenticated'](),controller[_0x32d7('0xf')]);router[_0x32d7('0x10')]('/:id',auth[_0x32d7('0x9')](),controller[_0x32d7('0x11')]);router[_0x32d7('0x12')](_0x32d7('0xc'),auth['isAuthenticated'](),controller[_0x32d7('0x13')]);module[_0x32d7('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 1b3d19a..4eced0a 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x16ee55,_0x5f416c){var _0xb918a2=function(_0x4f750e){while(--_0x4f750e){_0x16ee55['push'](_0x16ee55['shift']());}};_0xb918a2(++_0x5f416c);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x417774,_0x1b95e6){_0x417774=_0x417774-0x0;var _0x10015d=_0xf3cd[_0x417774];return _0x10015d;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4c4953,_0xe0f6c2){var _0x5cfc83=function(_0x17ed87){while(--_0x17ed87){_0x4c4953['push'](_0x4c4953['shift']());}};_0x5cfc83(++_0xe0f6c2);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x45c61e,_0x59694d){_0x45c61e=_0x45c61e-0x0;var _0x19033c=_0xf3cd[_0x45c61e];return _0x19033c;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a72a43a..6980ddd 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 _0xa2ee=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','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','status','offset','limit','count','Content-Range','json','reject','save','update','then','end','sendStatus','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1b4cab,_0x504100){var _0x1348f3=function(_0x7c6b5e){while(--_0x7c6b5e){_0x1b4cab['push'](_0x1b4cab['shift']());}};_0x1348f3(++_0x504100);}(_0xa2ee,0xae));var _0xea2e=function(_0x26f4a4,_0xeb0dc6){_0x26f4a4=_0x26f4a4-0x0;var _0x437404=_0xa2ee[_0x26f4a4];return _0x437404;};'use strict';var emlformat=require(_0xea2e('0x0'));var rimraf=require(_0xea2e('0x1'));var zipdir=require(_0xea2e('0x2'));var jsonpatch=require(_0xea2e('0x3'));var rp=require(_0xea2e('0x4'));var moment=require(_0xea2e('0x5'));var BPromise=require(_0xea2e('0x6'));var Mustache=require(_0xea2e('0x7'));var util=require(_0xea2e('0x8'));var path=require('path');var sox=require(_0xea2e('0x9'));var csv=require('to-csv');var ejs=require(_0xea2e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea2e('0xb'));var squel=require('squel');var crypto=require(_0xea2e('0xc'));var jsforce=require(_0xea2e('0xd'));var deskjs=require(_0xea2e('0xe'));var toCsv=require(_0xea2e('0xf'));var querystring=require(_0xea2e('0x10'));var Papa=require(_0xea2e('0x11'));var Redis=require(_0xea2e('0x12'));var authService=require(_0xea2e('0x13'));var qs=require(_0xea2e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea2e('0x15'));var logger=require(_0xea2e('0x16'))('api');var utils=require(_0xea2e('0x17'));var config=require(_0xea2e('0x18'));var licenseUtil=require(_0xea2e('0x19'));var db=require(_0xea2e('0x1a'))['db'];function respondWithStatusCode(_0x51f416,_0x4dd094){_0x4dd094=_0x4dd094||0xcc;return function(_0x28baa0){if(_0x28baa0){return _0x51f416['sendStatus'](_0x4dd094);}return _0x51f416[_0xea2e('0x1b')](_0x4dd094)['end']();};}function respondWithResult(_0x314739,_0x4695fa){_0x4695fa=_0x4695fa||0xc8;return function(_0x476a32){if(_0x476a32){return _0x314739['status'](_0x4695fa)['json'](_0x476a32);}};}function respondWithFilteredResult(_0xfd6993,_0x3bd016){return function(_0x3ac916){if(_0x3ac916){var _0x12ad29=typeof _0x3bd016[_0xea2e('0x1c')]==='undefined'&&typeof _0x3bd016[_0xea2e('0x1d')]==='undefined';var _0xfc4ae7=_0x3ac916['count'];var _0x2781cf=_0x12ad29?0x0:_0x3bd016[_0xea2e('0x1c')];var _0x210f7a=_0x12ad29?_0x3ac916[_0xea2e('0x1e')]:_0x3bd016['offset']+_0x3bd016[_0xea2e('0x1d')];var _0x3776a2;if(_0x210f7a>=_0xfc4ae7){_0x210f7a=_0xfc4ae7;_0x3776a2=0xc8;}else{_0x3776a2=0xce;}_0xfd6993[_0xea2e('0x1b')](_0x3776a2);return _0xfd6993['set'](_0xea2e('0x1f'),_0x2781cf+'-'+_0x210f7a+'/'+_0xfc4ae7)[_0xea2e('0x20')](_0x3ac916);}return null;};}function patchUpdates(_0x3ead3f){return function(_0x3ea696){try{jsonpatch['apply'](_0x3ea696,_0x3ead3f,!![]);}catch(_0x446c5a){return BPromise[_0xea2e('0x21')](_0x446c5a);}return _0x3ea696[_0xea2e('0x22')]();};}function saveUpdates(_0xcf8593,_0x207fd7){return function(_0x317650){if(_0x317650){return _0x317650[_0xea2e('0x23')](_0xcf8593)[_0xea2e('0x24')](function(_0x32d184){return _0x32d184;});}return null;};}function removeEntity(_0x32ead8,_0x1511c5){return function(_0x534b1c){if(_0x534b1c){return _0x534b1c['destroy']()[_0xea2e('0x24')](function(){_0x32ead8['status'](0xcc)[_0xea2e('0x25')]();});}};}function handleEntityNotFound(_0x4f00ce,_0x14f247){return function(_0x2b9e58){if(!_0x2b9e58){_0x4f00ce[_0xea2e('0x26')](0x194);}return _0x2b9e58;};}function handleError(_0x1dc478,_0x4b2098){_0x4b2098=_0x4b2098||0x1f4;return function(_0x46b6a9){logger[_0xea2e('0x27')](_0x46b6a9['stack']);if(_0x46b6a9[_0xea2e('0x28')]){delete _0x46b6a9[_0xea2e('0x28')];}_0x1dc478[_0xea2e('0x1b')](_0x4b2098)[_0xea2e('0x29')](_0x46b6a9);};}exports[_0xea2e('0x2a')]=function(_0x30c01b,_0x4eccd0){var _0x1a7108={},_0x303bab={},_0x57a1ed={'count':0x0,'rows':[]};var _0x52e4cc=_[_0xea2e('0x2b')](db[_0xea2e('0x2c')][_0xea2e('0x2d')],function(_0x5cebd5){return{'name':_0x5cebd5[_0xea2e('0x2e')],'type':_0x5cebd5[_0xea2e('0x2f')][_0xea2e('0x30')]};});_0x303bab[_0xea2e('0x31')]=_[_0xea2e('0x2b')](_0x52e4cc,_0xea2e('0x28'));_0x303bab[_0xea2e('0x32')]=_[_0xea2e('0x33')](_0x30c01b[_0xea2e('0x32')]);_0x303bab[_0xea2e('0x34')]=_['intersection'](_0x303bab[_0xea2e('0x31')],_0x303bab[_0xea2e('0x32')]);_0x1a7108[_0xea2e('0x35')]=_[_0xea2e('0x36')](_0x303bab['model'],qs[_0xea2e('0x37')](_0x30c01b['query'][_0xea2e('0x37')]));_0x1a7108[_0xea2e('0x35')]=_0x1a7108[_0xea2e('0x35')][_0xea2e('0x38')]?_0x1a7108['attributes']:_0x303bab['model'];if(!_0x30c01b[_0xea2e('0x32')][_0xea2e('0x39')](_0xea2e('0x3a'))){_0x1a7108[_0xea2e('0x1d')]=qs[_0xea2e('0x1d')](_0x30c01b[_0xea2e('0x32')][_0xea2e('0x1d')]);_0x1a7108[_0xea2e('0x1c')]=qs[_0xea2e('0x1c')](_0x30c01b[_0xea2e('0x32')][_0xea2e('0x1c')]);}_0x1a7108[_0xea2e('0x3b')]=qs[_0xea2e('0x3c')](_0x30c01b[_0xea2e('0x32')][_0xea2e('0x3c')]);_0x1a7108[_0xea2e('0x3d')]=qs['filters'](_[_0xea2e('0x3e')](_0x30c01b['query'],_0x303bab['filters']),_0x52e4cc);if(_0x30c01b[_0xea2e('0x32')][_0xea2e('0x3f')]){_0x1a7108['where']=_[_0xea2e('0x40')](_0x1a7108[_0xea2e('0x3d')],{'$or':_[_0xea2e('0x2b')](_0x52e4cc,function(_0x1c7e43){if(_0x1c7e43[_0xea2e('0x2f')]!==_0xea2e('0x41')){var _0x2d8a5b={};_0x2d8a5b[_0x1c7e43[_0xea2e('0x28')]]={'$like':'%'+_0x30c01b[_0xea2e('0x32')][_0xea2e('0x3f')]+'%'};return _0x2d8a5b;}})});}_0x1a7108=_[_0xea2e('0x40')]({},_0x1a7108,_0x30c01b[_0xea2e('0x42')]);var _0x1feca2={'where':_0x1a7108[_0xea2e('0x3d')]};return db['FaxTransferReport']['count'](_0x1feca2)[_0xea2e('0x24')](function(_0x99802){_0x57a1ed[_0xea2e('0x1e')]=_0x99802;if(_0x30c01b['query'][_0xea2e('0x43')]){_0x1a7108[_0xea2e('0x44')]=[{'all':!![]}];}return db[_0xea2e('0x2c')][_0xea2e('0x45')](_0x1a7108);})[_0xea2e('0x24')](function(_0x397494){_0x57a1ed[_0xea2e('0x46')]=_0x397494;return _0x57a1ed;})[_0xea2e('0x24')](respondWithFilteredResult(_0x4eccd0,_0x1a7108))[_0xea2e('0x47')](handleError(_0x4eccd0,null));};exports[_0xea2e('0x48')]=function(_0x594e37,_0x1671e9){var _0x3b82c6={'raw':!![],'where':{'id':_0x594e37[_0xea2e('0x49')]['id']}},_0x295fee={};_0x295fee['model']=_[_0xea2e('0x33')](db[_0xea2e('0x2c')][_0xea2e('0x2d')]);_0x295fee[_0xea2e('0x32')]=_[_0xea2e('0x33')](_0x594e37[_0xea2e('0x32')]);_0x295fee[_0xea2e('0x34')]=_[_0xea2e('0x36')](_0x295fee[_0xea2e('0x31')],_0x295fee[_0xea2e('0x32')]);_0x3b82c6['attributes']=_[_0xea2e('0x36')](_0x295fee['model'],qs[_0xea2e('0x37')](_0x594e37[_0xea2e('0x32')]['fields']));_0x3b82c6['attributes']=_0x3b82c6[_0xea2e('0x35')][_0xea2e('0x38')]?_0x3b82c6[_0xea2e('0x35')]:_0x295fee[_0xea2e('0x31')];if(_0x594e37[_0xea2e('0x32')][_0xea2e('0x43')]){_0x3b82c6['include']=[{'all':!![]}];}_0x3b82c6=_[_0xea2e('0x40')]({},_0x3b82c6,_0x594e37[_0xea2e('0x42')]);return db['FaxTransferReport'][_0xea2e('0x4a')](_0x3b82c6)[_0xea2e('0x24')](handleEntityNotFound(_0x1671e9,null))[_0xea2e('0x24')](respondWithResult(_0x1671e9,null))['catch'](handleError(_0x1671e9,null));};exports[_0xea2e('0x4b')]=function(_0x56791,_0x188ffd){return db[_0xea2e('0x2c')][_0xea2e('0x4b')](_0x56791['body'],{})[_0xea2e('0x24')](respondWithResult(_0x188ffd,0xc9))['catch'](handleError(_0x188ffd,null));};exports[_0xea2e('0x23')]=function(_0x2db606,_0x52c2f9){if(_0x2db606[_0xea2e('0x4c')]['id']){delete _0x2db606[_0xea2e('0x4c')]['id'];}return db[_0xea2e('0x2c')]['find']({'where':{'id':_0x2db606['params']['id']}})['then'](handleEntityNotFound(_0x52c2f9,null))[_0xea2e('0x24')](saveUpdates(_0x2db606[_0xea2e('0x4c')],null))[_0xea2e('0x24')](respondWithResult(_0x52c2f9,null))[_0xea2e('0x47')](handleError(_0x52c2f9,null));};exports[_0xea2e('0x4d')]=function(_0x126647,_0x33bb21){return db[_0xea2e('0x2c')][_0xea2e('0x4a')]({'where':{'id':_0x126647[_0xea2e('0x49')]['id']}})['then'](handleEntityNotFound(_0x33bb21,null))['then'](removeEntity(_0x33bb21,null))['catch'](handleError(_0x33bb21,null));};exports['describe']=function(_0x4e5450,_0x300d79){return db[_0xea2e('0x2c')][_0xea2e('0x4e')]()[_0xea2e('0x24')](respondWithResult(_0x300d79,null))[_0xea2e('0x47')](handleError(_0x300d79,null));}; \ No newline at end of file +var _0x6365=['bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','status','stack','name','index','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','includeAll','include','FaxTransferReport','rows','catch','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1d2b67,_0x48a393){var _0x5ea408=function(_0x9f7786){while(--_0x9f7786){_0x1d2b67['push'](_0x1d2b67['shift']());}};_0x5ea408(++_0x48a393);}(_0x6365,0x12a));var _0x5636=function(_0x5238d0,_0x4fcd82){_0x5238d0=_0x5238d0-0x0;var _0x216758=_0x6365[_0x5238d0];return _0x216758;};'use strict';var emlformat=require(_0x5636('0x0'));var rimraf=require(_0x5636('0x1'));var zipdir=require(_0x5636('0x2'));var jsonpatch=require(_0x5636('0x3'));var rp=require(_0x5636('0x4'));var moment=require(_0x5636('0x5'));var BPromise=require(_0x5636('0x6'));var Mustache=require(_0x5636('0x7'));var util=require(_0x5636('0x8'));var path=require(_0x5636('0x9'));var sox=require(_0x5636('0xa'));var csv=require(_0x5636('0xb'));var ejs=require(_0x5636('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5636('0xd'));var crypto=require(_0x5636('0xe'));var jsforce=require(_0x5636('0xf'));var deskjs=require(_0x5636('0x10'));var toCsv=require(_0x5636('0xb'));var querystring=require(_0x5636('0x11'));var Papa=require(_0x5636('0x12'));var Redis=require(_0x5636('0x13'));var authService=require(_0x5636('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5636('0x15'));var hardwareService=require(_0x5636('0x16'));var logger=require(_0x5636('0x17'))(_0x5636('0x18'));var utils=require('../../config/utils');var config=require(_0x5636('0x19'));var licenseUtil=require(_0x5636('0x1a'));var db=require(_0x5636('0x1b'))['db'];function respondWithStatusCode(_0xe973b7,_0x179971){_0x179971=_0x179971||0xcc;return function(_0x4147bd){if(_0x4147bd){return _0xe973b7['sendStatus'](_0x179971);}return _0xe973b7['status'](_0x179971)[_0x5636('0x1c')]();};}function respondWithResult(_0x10063f,_0x24e449){_0x24e449=_0x24e449||0xc8;return function(_0x19245c){if(_0x19245c){return _0x10063f['status'](_0x24e449)[_0x5636('0x1d')](_0x19245c);}};}function respondWithFilteredResult(_0x47e404,_0x36e2bf){return function(_0x4714d4){if(_0x4714d4){var _0x4b0da5=typeof _0x36e2bf[_0x5636('0x1e')]===_0x5636('0x1f')&&typeof _0x36e2bf[_0x5636('0x20')]===_0x5636('0x1f');var _0x356b7c=_0x4714d4[_0x5636('0x21')];var _0x5dd9b8=_0x4b0da5?0x0:_0x36e2bf[_0x5636('0x1e')];var _0xcee1c3=_0x4b0da5?_0x4714d4['count']:_0x36e2bf['offset']+_0x36e2bf['limit'];var _0x373a69;if(_0xcee1c3>=_0x356b7c){_0xcee1c3=_0x356b7c;_0x373a69=0xc8;}else{_0x373a69=0xce;}_0x47e404['status'](_0x373a69);return _0x47e404['set'](_0x5636('0x22'),_0x5dd9b8+'-'+_0xcee1c3+'/'+_0x356b7c)[_0x5636('0x1d')](_0x4714d4);}return null;};}function patchUpdates(_0x29b224){return function(_0x37cdc6){try{jsonpatch['apply'](_0x37cdc6,_0x29b224,!![]);}catch(_0x258340){return BPromise[_0x5636('0x23')](_0x258340);}return _0x37cdc6[_0x5636('0x24')]();};}function saveUpdates(_0x32e793,_0x3b9d76){return function(_0x5082d7){if(_0x5082d7){return _0x5082d7[_0x5636('0x25')](_0x32e793)[_0x5636('0x26')](function(_0x446ee1){return _0x446ee1;});}return null;};}function removeEntity(_0x382403,_0x4a60bb){return function(_0x1ed95a){if(_0x1ed95a){return _0x1ed95a[_0x5636('0x27')]()[_0x5636('0x26')](function(){_0x382403[_0x5636('0x28')](0xcc)[_0x5636('0x1c')]();});}};}function handleEntityNotFound(_0x18a650,_0x5e8f93){return function(_0x515f32){if(!_0x515f32){_0x18a650['sendStatus'](0x194);}return _0x515f32;};}function handleError(_0x25c14e,_0x365402){_0x365402=_0x365402||0x1f4;return function(_0x42a241){logger['error'](_0x42a241[_0x5636('0x29')]);if(_0x42a241[_0x5636('0x2a')]){delete _0x42a241[_0x5636('0x2a')];}_0x25c14e[_0x5636('0x28')](_0x365402)['send'](_0x42a241);};}exports[_0x5636('0x2b')]=function(_0x539378,_0x2b2b60){var _0x488c47={},_0xaaa8cc={},_0x43f580={'count':0x0,'rows':[]};var _0x571638=_['map'](db['FaxTransferReport'][_0x5636('0x2c')],function(_0x2ff1dd){return{'name':_0x2ff1dd[_0x5636('0x2d')],'type':_0x2ff1dd[_0x5636('0x2e')][_0x5636('0x2f')]};});_0xaaa8cc[_0x5636('0x30')]=_['map'](_0x571638,_0x5636('0x2a'));_0xaaa8cc[_0x5636('0x31')]=_['keys'](_0x539378['query']);_0xaaa8cc['filters']=_[_0x5636('0x32')](_0xaaa8cc[_0x5636('0x30')],_0xaaa8cc[_0x5636('0x31')]);_0x488c47[_0x5636('0x33')]=_[_0x5636('0x32')](_0xaaa8cc['model'],qs[_0x5636('0x34')](_0x539378[_0x5636('0x31')][_0x5636('0x34')]));_0x488c47[_0x5636('0x33')]=_0x488c47[_0x5636('0x33')][_0x5636('0x35')]?_0x488c47['attributes']:_0xaaa8cc['model'];if(!_0x539378[_0x5636('0x31')][_0x5636('0x36')](_0x5636('0x37'))){_0x488c47[_0x5636('0x20')]=qs[_0x5636('0x20')](_0x539378[_0x5636('0x31')][_0x5636('0x20')]);_0x488c47['offset']=qs[_0x5636('0x1e')](_0x539378[_0x5636('0x31')][_0x5636('0x1e')]);}_0x488c47[_0x5636('0x38')]=qs[_0x5636('0x39')](_0x539378['query']['sort']);_0x488c47[_0x5636('0x3a')]=qs[_0x5636('0x3b')](_[_0x5636('0x3c')](_0x539378[_0x5636('0x31')],_0xaaa8cc[_0x5636('0x3b')]),_0x571638);if(_0x539378[_0x5636('0x31')][_0x5636('0x3d')]){_0x488c47[_0x5636('0x3a')]=_['merge'](_0x488c47[_0x5636('0x3a')],{'$or':_[_0x5636('0x3e')](_0x571638,function(_0x395cb8){if(_0x395cb8['type']!==_0x5636('0x3f')){var _0x4c5dff={};_0x4c5dff[_0x395cb8[_0x5636('0x2a')]]={'$like':'%'+_0x539378[_0x5636('0x31')][_0x5636('0x3d')]+'%'};return _0x4c5dff;}})});}_0x488c47=_[_0x5636('0x40')]({},_0x488c47,_0x539378['options']);var _0x245867={'where':_0x488c47[_0x5636('0x3a')]};return db['FaxTransferReport'][_0x5636('0x21')](_0x245867)[_0x5636('0x26')](function(_0x42635b){_0x43f580[_0x5636('0x21')]=_0x42635b;if(_0x539378['query'][_0x5636('0x41')]){_0x488c47[_0x5636('0x42')]=[{'all':!![]}];}return db[_0x5636('0x43')]['findAll'](_0x488c47);})[_0x5636('0x26')](function(_0x390667){_0x43f580[_0x5636('0x44')]=_0x390667;return _0x43f580;})[_0x5636('0x26')](respondWithFilteredResult(_0x2b2b60,_0x488c47))[_0x5636('0x45')](handleError(_0x2b2b60,null));};exports['show']=function(_0x4315a9,_0x6cfe01){var _0x30a104={'raw':!![],'where':{'id':_0x4315a9[_0x5636('0x46')]['id']}},_0x5da6fa={};_0x5da6fa[_0x5636('0x30')]=_[_0x5636('0x47')](db['FaxTransferReport']['rawAttributes']);_0x5da6fa[_0x5636('0x31')]=_[_0x5636('0x47')](_0x4315a9[_0x5636('0x31')]);_0x5da6fa[_0x5636('0x3b')]=_[_0x5636('0x32')](_0x5da6fa['model'],_0x5da6fa[_0x5636('0x31')]);_0x30a104[_0x5636('0x33')]=_['intersection'](_0x5da6fa['model'],qs['fields'](_0x4315a9[_0x5636('0x31')]['fields']));_0x30a104['attributes']=_0x30a104[_0x5636('0x33')][_0x5636('0x35')]?_0x30a104[_0x5636('0x33')]:_0x5da6fa[_0x5636('0x30')];if(_0x4315a9[_0x5636('0x31')][_0x5636('0x41')]){_0x30a104[_0x5636('0x42')]=[{'all':!![]}];}_0x30a104=_[_0x5636('0x40')]({},_0x30a104,_0x4315a9['options']);return db[_0x5636('0x43')][_0x5636('0x48')](_0x30a104)[_0x5636('0x26')](handleEntityNotFound(_0x6cfe01,null))['then'](respondWithResult(_0x6cfe01,null))['catch'](handleError(_0x6cfe01,null));};exports[_0x5636('0x49')]=function(_0x255383,_0x2d6da7){return db[_0x5636('0x43')][_0x5636('0x49')](_0x255383[_0x5636('0x4a')],{})[_0x5636('0x26')](respondWithResult(_0x2d6da7,0xc9))[_0x5636('0x45')](handleError(_0x2d6da7,null));};exports[_0x5636('0x25')]=function(_0x3013dd,_0x3f100f){if(_0x3013dd[_0x5636('0x4a')]['id']){delete _0x3013dd[_0x5636('0x4a')]['id'];}return db[_0x5636('0x43')][_0x5636('0x48')]({'where':{'id':_0x3013dd['params']['id']}})[_0x5636('0x26')](handleEntityNotFound(_0x3f100f,null))[_0x5636('0x26')](saveUpdates(_0x3013dd[_0x5636('0x4a')],null))[_0x5636('0x26')](respondWithResult(_0x3f100f,null))[_0x5636('0x45')](handleError(_0x3f100f,null));};exports[_0x5636('0x27')]=function(_0x8f8814,_0x5beb61){return db[_0x5636('0x43')][_0x5636('0x48')]({'where':{'id':_0x8f8814['params']['id']}})['then'](handleEntityNotFound(_0x5beb61,null))[_0x5636('0x26')](removeEntity(_0x5beb61,null))[_0x5636('0x45')](handleError(_0x5beb61,null));};exports['describe']=function(_0x2d9fe7,_0x41cf95){return db['FaxTransferReport'][_0x5636('0x4b')]()[_0x5636('0x26')](respondWithResult(_0x41cf95,null))['catch'](handleError(_0x41cf95,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 3fa206e..7516173 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 _0x7ad0=['../../config/environment','./faxTransferReport.attributes','report_fax_transfer','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0x43cad4,_0x16d098){var _0x2c4700=function(_0x34a7cb){while(--_0x34a7cb){_0x43cad4['push'](_0x43cad4['shift']());}};_0x2c4700(++_0x16d098);}(_0x7ad0,0x11a));var _0x07ad=function(_0x4d1f5f,_0x484149){_0x4d1f5f=_0x4d1f5f-0x0;var _0x57b35e=_0x7ad0[_0x4d1f5f];return _0x57b35e;};'use strict';var _=require(_0x07ad('0x0'));var util=require('util');var logger=require(_0x07ad('0x1'))(_0x07ad('0x2'));var moment=require(_0x07ad('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x07ad('0x4'));var rimraf=require(_0x07ad('0x5'));var config=require(_0x07ad('0x6'));var attributes=require(_0x07ad('0x7'));module['exports']=function(_0x4f640f,_0x8ca7a0){return _0x4f640f['define']('FaxTransferReport',attributes,{'tableName':_0x07ad('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x63c7=['./faxTransferReport.attributes','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x177d4e,_0x2958cf){var _0x457974=function(_0xecd480){while(--_0xecd480){_0x177d4e['push'](_0x177d4e['shift']());}};_0x457974(++_0x2958cf);}(_0x63c7,0x1b0));var _0x763c=function(_0x397fb5,_0x4ce2c2){_0x397fb5=_0x397fb5-0x0;var _0x347bf8=_0x63c7[_0x397fb5];return _0x347bf8;};'use strict';var _=require(_0x763c('0x0'));var util=require(_0x763c('0x1'));var logger=require(_0x763c('0x2'))('api');var moment=require(_0x763c('0x3'));var BPromise=require(_0x763c('0x4'));var rp=require(_0x763c('0x5'));var fs=require('fs');var path=require(_0x763c('0x6'));var rimraf=require('rimraf');var config=require(_0x763c('0x7'));var attributes=require(_0x763c('0x8'));module['exports']=function(_0x32acb8,_0x1695d1){return _0x32acb8['define']('FaxTransferReport',attributes,{'tableName':_0x763c('0x9'),'paranoid':![],'indexes':[{'name':_0x763c('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 2579124..4d81a5f 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 _0xf57e=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5558d9,_0x1845fa){var _0xcfd70d=function(_0x456795){while(--_0x456795){_0x5558d9['push'](_0x5558d9['shift']());}};_0xcfd70d(++_0x1845fa);}(_0xf57e,0xab));var _0xef57=function(_0x327a59,_0x52ce59){_0x327a59=_0x327a59-0x0;var _0x1df745=_0xf57e[_0x327a59];return _0x1df745;};'use strict';var _=require(_0xef57('0x0'));var util=require(_0xef57('0x1'));var moment=require(_0xef57('0x2'));var BPromise=require(_0xef57('0x3'));var rs=require(_0xef57('0x4'));var fs=require('fs');var Redis=require(_0xef57('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xef57('0x6'));var logger=require(_0xef57('0x7'))(_0xef57('0x8'));var config=require(_0xef57('0x9'));var jayson=require(_0xef57('0xa'));var client=jayson[_0xef57('0xb')][_0xef57('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e3705,_0x563e18,_0x234b45){return new BPromise(function(_0x463f54,_0x5df786){return client['request'](_0x3e3705,_0x234b45)['then'](function(_0x1959fa){logger['info'](_0xef57('0xd'),_0x563e18,_0xef57('0xe'));logger['debug'](_0xef57('0xf'),_0x563e18,_0xef57('0xe'),JSON[_0xef57('0x10')](_0x1959fa));if(_0x1959fa[_0xef57('0x11')]){if(_0x1959fa[_0xef57('0x11')][_0xef57('0x12')]===0x1f4){logger['error'](_0xef57('0xd'),_0x563e18,_0x1959fa[_0xef57('0x11')]['message']);return _0x5df786(_0x1959fa[_0xef57('0x11')][_0xef57('0x13')]);}logger[_0xef57('0x11')](_0xef57('0xd'),_0x563e18,_0x1959fa['error'][_0xef57('0x13')]);return _0x463f54(_0x1959fa[_0xef57('0x11')][_0xef57('0x13')]);}else{logger[_0xef57('0x14')](_0xef57('0xd'),_0x563e18,_0xef57('0xe'));_0x463f54(_0x1959fa[_0xef57('0x15')][_0xef57('0x13')]);}})[_0xef57('0x16')](function(_0xafbe6e){logger[_0xef57('0x11')](_0xef57('0xd'),_0x563e18,_0xafbe6e);_0x5df786(_0xafbe6e);});});} \ No newline at end of file +var _0xbc8f=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x17f403,_0x240058){var _0x5e1c42=function(_0x50f40b){while(--_0x50f40b){_0x17f403['push'](_0x17f403['shift']());}};_0x5e1c42(++_0x240058);}(_0xbc8f,0x17d));var _0xfbc8=function(_0x398e1c,_0x4e7020){_0x398e1c=_0x398e1c-0x0;var _0x33bb40=_0xbc8f[_0x398e1c];return _0x33bb40;};'use strict';var _=require(_0xfbc8('0x0'));var util=require(_0xfbc8('0x1'));var moment=require(_0xfbc8('0x2'));var BPromise=require(_0xfbc8('0x3'));var rs=require(_0xfbc8('0x4'));var fs=require('fs');var Redis=require(_0xfbc8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbc8('0x6'));var logger=require('../../config/logger')(_0xfbc8('0x7'));var config=require(_0xfbc8('0x8'));var jayson=require(_0xfbc8('0x9'));var client=jayson[_0xfbc8('0xa')][_0xfbc8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x241527,_0x46e92c,_0x5e1f25){return new BPromise(function(_0x5d1f6d,_0x237f9f){return client['request'](_0x241527,_0x5e1f25)['then'](function(_0x390ff4){logger[_0xfbc8('0xc')](_0xfbc8('0xd'),_0x46e92c,_0xfbc8('0xe'));logger[_0xfbc8('0xf')](_0xfbc8('0x10'),_0x46e92c,_0xfbc8('0xe'),JSON[_0xfbc8('0x11')](_0x390ff4));if(_0x390ff4[_0xfbc8('0x12')]){if(_0x390ff4['error'][_0xfbc8('0x13')]===0x1f4){logger[_0xfbc8('0x12')](_0xfbc8('0xd'),_0x46e92c,_0x390ff4[_0xfbc8('0x12')][_0xfbc8('0x14')]);return _0x237f9f(_0x390ff4['error'][_0xfbc8('0x14')]);}logger[_0xfbc8('0x12')](_0xfbc8('0xd'),_0x46e92c,_0x390ff4[_0xfbc8('0x12')][_0xfbc8('0x14')]);return _0x5d1f6d(_0x390ff4[_0xfbc8('0x12')][_0xfbc8('0x14')]);}else{logger[_0xfbc8('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x46e92c,_0xfbc8('0xe'));_0x5d1f6d(_0x390ff4[_0xfbc8('0x15')][_0xfbc8('0x14')]);}})['catch'](function(_0xb9d1d){logger[_0xfbc8('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x46e92c,_0xb9d1d);_0x237f9f(_0xb9d1d);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index e8c6a76..0e678b1 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 _0xb2f1=['show','create','put','update','delete','destroy','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xbce40f,_0xd74797){var _0x57326d=function(_0x3605e2){while(--_0x3605e2){_0xbce40f['push'](_0xbce40f['shift']());}};_0x57326d(++_0xd74797);}(_0xb2f1,0x1b6));var _0x1b2f=function(_0x370ed4,_0x2b358c){_0x370ed4=_0x370ed4-0x0;var _0x172079=_0xb2f1[_0x370ed4];return _0x172079;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1b2f('0x0'));var router=express[_0x1b2f('0x1')]();var fs_extra=require(_0x1b2f('0x2'));var auth=require(_0x1b2f('0x3'));var interaction=require(_0x1b2f('0x4'));var config=require('../../config/environment');var controller=require(_0x1b2f('0x5'));router[_0x1b2f('0x6')]('/',auth[_0x1b2f('0x7')](),controller[_0x1b2f('0x8')]);router['get'](_0x1b2f('0x9'),auth[_0x1b2f('0x7')](),controller[_0x1b2f('0xa')]);router[_0x1b2f('0x6')](_0x1b2f('0xb'),auth[_0x1b2f('0x7')](),controller[_0x1b2f('0xc')]);router['post']('/',auth[_0x1b2f('0x7')](),controller[_0x1b2f('0xd')]);router[_0x1b2f('0xe')](_0x1b2f('0xb'),auth[_0x1b2f('0x7')](),controller[_0x1b2f('0xf')]);router[_0x1b2f('0x10')](_0x1b2f('0xb'),auth[_0x1b2f('0x7')](),controller[_0x1b2f('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc12a=['../../components/auth/service','../../config/environment','./faxTransferReport.controller','index','/describe','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x22431e,_0x5af0a3){var _0xd978e9=function(_0x2bbdd7){while(--_0x2bbdd7){_0x22431e['push'](_0x22431e['shift']());}};_0xd978e9(++_0x5af0a3);}(_0xc12a,0xeb));var _0xac12=function(_0x6ee7c2,_0x4e5c43){_0x6ee7c2=_0x6ee7c2-0x0;var _0x2f52fe=_0xc12a[_0x6ee7c2];return _0x2f52fe;};'use strict';var multer=require(_0xac12('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xac12('0x1'));var express=require(_0xac12('0x2'));var router=express[_0xac12('0x3')]();var fs_extra=require(_0xac12('0x4'));var auth=require(_0xac12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xac12('0x6'));var controller=require(_0xac12('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xac12('0x8')]);router['get'](_0xac12('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xac12('0xa')](_0xac12('0xb'),auth[_0xac12('0xc')](),controller[_0xac12('0xd')]);router[_0xac12('0xe')]('/',auth['isAuthenticated'](),controller[_0xac12('0xf')]);router[_0xac12('0x10')](_0xac12('0xb'),auth[_0xac12('0xc')](),controller['update']);router[_0xac12('0x11')](_0xac12('0xb'),auth[_0xac12('0xc')](),controller[_0xac12('0x12')]);module[_0xac12('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 54c8f96..87001b6 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 _0x8dc9=['../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x531440,_0x4d240c){var _0x4253b6=function(_0x516d59){while(--_0x516d59){_0x531440['push'](_0x531440['shift']());}};_0x4253b6(++_0x4d240c);}(_0x8dc9,0x1de));var _0x98dc=function(_0x26aff2,_0x540443){_0x26aff2=_0x26aff2-0x0;var _0x333699=_0x8dc9[_0x26aff2];return _0x333699;};'use strict';var multer=require('multer');var util=require(_0x98dc('0x0'));var path=require('path');var timeout=require(_0x98dc('0x1'));var express=require('express');var router=express[_0x98dc('0x2')]();var fs_extra=require(_0x98dc('0x3'));var auth=require(_0x98dc('0x4'));var interaction=require(_0x98dc('0x5'));var config=require(_0x98dc('0x6'));var controller=require(_0x98dc('0x7'));router[_0x98dc('0x8')]('/',auth[_0x98dc('0x9')](),controller[_0x98dc('0xa')]);router['get'](_0x98dc('0xb'),auth['isAuthenticated'](),controller[_0x98dc('0xc')]);router[_0x98dc('0x8')](_0x98dc('0xd'),auth[_0x98dc('0x9')](),controller[_0x98dc('0xe')]);router['get'](_0x98dc('0xf'),auth[_0x98dc('0x9')](),controller[_0x98dc('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x98dc('0x11')]);router[_0x98dc('0x12')]('/:id/configurations',auth[_0x98dc('0x9')](),controller[_0x98dc('0x13')]);router['put'](_0x98dc('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x98dc('0x14')](_0x98dc('0xb'),auth[_0x98dc('0x9')](),controller[_0x98dc('0x15')]);module[_0x98dc('0x16')]=router; \ No newline at end of file +var _0x4f37=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x4f37,0x149));var _0x74f3=function(_0x6ab156,_0x54824f){_0x6ab156=_0x6ab156-0x0;var _0x55b335=_0x4f37[_0x6ab156];return _0x55b335;};'use strict';var multer=require(_0x74f3('0x0'));var util=require(_0x74f3('0x1'));var path=require(_0x74f3('0x2'));var timeout=require(_0x74f3('0x3'));var express=require(_0x74f3('0x4'));var router=express[_0x74f3('0x5')]();var fs_extra=require(_0x74f3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x74f3('0x7'));var config=require(_0x74f3('0x8'));var controller=require(_0x74f3('0x9'));router[_0x74f3('0xa')]('/',auth['isAuthenticated'](),controller[_0x74f3('0xb')]);router[_0x74f3('0xa')](_0x74f3('0xc'),auth[_0x74f3('0xd')](),controller[_0x74f3('0xe')]);router[_0x74f3('0xa')](_0x74f3('0xf'),auth[_0x74f3('0xd')](),controller[_0x74f3('0x10')]);router[_0x74f3('0xa')](_0x74f3('0x11'),auth[_0x74f3('0xd')](),controller[_0x74f3('0x12')]);router[_0x74f3('0x13')]('/',auth[_0x74f3('0xd')](),controller[_0x74f3('0x14')]);router[_0x74f3('0x13')]('/:id/configurations',auth[_0x74f3('0xd')](),controller[_0x74f3('0x15')]);router[_0x74f3('0x16')](_0x74f3('0xc'),auth['isAuthenticated'](),controller[_0x74f3('0x17')]);router[_0x74f3('0x18')](_0x74f3('0xc'),auth[_0x74f3('0xd')](),controller[_0x74f3('0x19')]);module[_0x74f3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d6d1deb..e73065f 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 _0xf571=['sequelize','exports','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x1e18ee,_0x1f3518){var _0x9522ab=function(_0x50c62f){while(--_0x50c62f){_0x1e18ee['push'](_0x1e18ee['shift']());}};_0x9522ab(++_0x1f3518);}(_0xf571,0x18f));var _0x1f57=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf571[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1f57('0x0'));module[_0x1f57('0x1')]={'name':{'type':Sequelize[_0x1f57('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1f57('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x1f57('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x1f57('0x2')]},'consumerKey':{'type':Sequelize[_0x1f57('0x2')]},'consumerSecret':{'type':Sequelize[_0x1f57('0x2')]},'token':{'type':Sequelize[_0x1f57('0x2')]},'tokenSecret':{'type':Sequelize[_0x1f57('0x2')]},'serverUrl':{'type':Sequelize[_0x1f57('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1f57('0x4')](_0x1f57('0x5'),_0x1f57('0x6')),'defaultValue':_0x1f57('0x5')}}; \ No newline at end of file +var _0x6ce6=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x575a31,_0x56336f){var _0x5d7dad=function(_0x2c8c09){while(--_0x2c8c09){_0x575a31['push'](_0x575a31['shift']());}};_0x5d7dad(++_0x56336f);}(_0x6ce6,0x146));var _0x66ce=function(_0x5e7b9b,_0x559763){_0x5e7b9b=_0x5e7b9b-0x0;var _0x37678b=_0x6ce6[_0x5e7b9b];return _0x37678b;};'use strict';var Sequelize=require(_0x66ce('0x0'));module[_0x66ce('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x66ce('0x2')]},'username':{'type':Sequelize[_0x66ce('0x2')]},'remoteUri':{'type':Sequelize[_0x66ce('0x2')]},'authType':{'type':Sequelize[_0x66ce('0x3')]('basic'),'defaultValue':_0x66ce('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x66ce('0x2')]},'consumerSecret':{'type':Sequelize[_0x66ce('0x2')]},'token':{'type':Sequelize[_0x66ce('0x2')]},'tokenSecret':{'type':Sequelize[_0x66ce('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x66ce('0x3')](_0x66ce('0x5'),_0x66ce('0x6')),'defaultValue':_0x66ce('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index e42a081..bafa796 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 _0xade0=['options','DeskAccount','includeAll','findAll','rows','show','keys','include','find','catch','create','body','params','findOne','DeskConfiguration','getConfigurations','AccountId','Subjects','channel','getDescriptions','DeskField','Descriptions','priority','remoteUri','username','password','token','tokenSecret','substring','GET','format','application/json','authType','basic','headers','Authorization','%s:%s','toString','base64','concat','_embedded','entries','active','label','statusCode','Wrong\x20credentials','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x45d59a,_0x43d3a9){var _0x13f3ef=function(_0x41971c){while(--_0x41971c){_0x45d59a['push'](_0x45d59a['shift']());}};_0x13f3ef(++_0x43d3a9);}(_0xade0,0x1da));var _0x0ade=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0xade0[_0x329437];return _0x3789d9;};'use strict';var emlformat=require(_0x0ade('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0ade('0x1'));var moment=require(_0x0ade('0x2'));var BPromise=require(_0x0ade('0x3'));var Mustache=require(_0x0ade('0x4'));var util=require('util');var path=require(_0x0ade('0x5'));var sox=require(_0x0ade('0x6'));var csv=require(_0x0ade('0x7'));var ejs=require(_0x0ade('0x8'));var fs=require('fs');var fs_extra=require(_0x0ade('0x9'));var _=require(_0x0ade('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0ade('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0ade('0x7'));var querystring=require(_0x0ade('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0ade('0xd'));var qs=require(_0x0ade('0xe'));var as=require(_0x0ade('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0ade('0x10'));var utils=require(_0x0ade('0x11'));var config=require(_0x0ade('0x12'));var licenseUtil=require(_0x0ade('0x13'));var db=require(_0x0ade('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3c5b20,_0xd768e8){_0xd768e8=_0xd768e8||0xcc;return function(_0x3db83a){if(_0x3db83a){return _0x3c5b20[_0x0ade('0x15')](_0xd768e8);}return _0x3c5b20[_0x0ade('0x16')](_0xd768e8)[_0x0ade('0x17')]();};}function respondWithResult(_0x1f2df1,_0x1eef45){_0x1eef45=_0x1eef45||0xc8;return function(_0x10f067){if(_0x10f067){return _0x1f2df1['status'](_0x1eef45)['json'](_0x10f067);}};}function respondWithFilteredResult(_0x22c83f,_0x5b68e9){return function(_0x4b675f){if(_0x4b675f){var _0x1ea77b=typeof _0x5b68e9[_0x0ade('0x18')]===_0x0ade('0x19')&&typeof _0x5b68e9[_0x0ade('0x1a')]===_0x0ade('0x19');var _0x58399b=_0x4b675f[_0x0ade('0x1b')];var _0x2ac8ad=_0x1ea77b?0x0:_0x5b68e9[_0x0ade('0x18')];var _0x47f6fb=_0x1ea77b?_0x4b675f[_0x0ade('0x1b')]:_0x5b68e9['offset']+_0x5b68e9[_0x0ade('0x1a')];var _0x20c81c;if(_0x47f6fb>=_0x58399b){_0x47f6fb=_0x58399b;_0x20c81c=0xc8;}else{_0x20c81c=0xce;}_0x22c83f[_0x0ade('0x16')](_0x20c81c);return _0x22c83f[_0x0ade('0x1c')](_0x0ade('0x1d'),_0x2ac8ad+'-'+_0x47f6fb+'/'+_0x58399b)[_0x0ade('0x1e')](_0x4b675f);}return null;};}function patchUpdates(_0x4324bd){return function(_0x2e9baa){try{jsonpatch[_0x0ade('0x1f')](_0x2e9baa,_0x4324bd,!![]);}catch(_0x2e26b4){return BPromise[_0x0ade('0x20')](_0x2e26b4);}return _0x2e9baa[_0x0ade('0x21')]();};}function saveUpdates(_0x2660c2,_0x8100fb){return function(_0x51e6dd){if(_0x51e6dd){return _0x51e6dd['update'](_0x2660c2)[_0x0ade('0x22')](function(_0x17bb0a){return _0x17bb0a;});}return null;};}function removeEntity(_0x5e711d,_0x12fde1){return function(_0x1d0850){if(_0x1d0850){return _0x1d0850[_0x0ade('0x23')]()[_0x0ade('0x22')](function(){_0x5e711d[_0x0ade('0x16')](0xcc)[_0x0ade('0x17')]();});}};}function handleEntityNotFound(_0x5eb878,_0x4b0b1a){return function(_0x39bff6){if(!_0x39bff6){_0x5eb878[_0x0ade('0x15')](0x194);}return _0x39bff6;};}function handleError(_0x284949,_0x359ac9){_0x359ac9=_0x359ac9||0x1f4;return function(_0x332e39){logger[_0x0ade('0x24')](_0x332e39[_0x0ade('0x25')]);if(_0x332e39[_0x0ade('0x26')]){delete _0x332e39[_0x0ade('0x26')];}_0x284949[_0x0ade('0x16')](_0x359ac9)[_0x0ade('0x27')](_0x332e39);};}exports[_0x0ade('0x28')]=function(_0x19f245,_0x24163a){var _0x5a06d6={},_0x363ff0={},_0xa90140={'count':0x0,'rows':[]};var _0x2705aa=_[_0x0ade('0x29')](db['DeskAccount'][_0x0ade('0x2a')],function(_0x6851cd){return{'name':_0x6851cd[_0x0ade('0x2b')],'type':_0x6851cd[_0x0ade('0x2c')][_0x0ade('0x2d')]};});_0x363ff0[_0x0ade('0x2e')]=_[_0x0ade('0x29')](_0x2705aa,_0x0ade('0x26'));_0x363ff0[_0x0ade('0x2f')]=_['keys'](_0x19f245[_0x0ade('0x2f')]);_0x363ff0[_0x0ade('0x30')]=_[_0x0ade('0x31')](_0x363ff0[_0x0ade('0x2e')],_0x363ff0['query']);_0x5a06d6[_0x0ade('0x32')]=_[_0x0ade('0x31')](_0x363ff0['model'],qs[_0x0ade('0x33')](_0x19f245[_0x0ade('0x2f')][_0x0ade('0x33')]));_0x5a06d6[_0x0ade('0x32')]=_0x5a06d6[_0x0ade('0x32')][_0x0ade('0x34')]?_0x5a06d6[_0x0ade('0x32')]:_0x363ff0[_0x0ade('0x2e')];if(!_0x19f245['query']['hasOwnProperty'](_0x0ade('0x35'))){_0x5a06d6[_0x0ade('0x1a')]=qs[_0x0ade('0x1a')](_0x19f245['query'][_0x0ade('0x1a')]);_0x5a06d6['offset']=qs[_0x0ade('0x18')](_0x19f245[_0x0ade('0x2f')][_0x0ade('0x18')]);}_0x5a06d6[_0x0ade('0x36')]=qs[_0x0ade('0x37')](_0x19f245[_0x0ade('0x2f')][_0x0ade('0x37')]);_0x5a06d6[_0x0ade('0x38')]=qs[_0x0ade('0x30')](_[_0x0ade('0x39')](_0x19f245[_0x0ade('0x2f')],_0x363ff0['filters']),_0x2705aa);if(_0x19f245[_0x0ade('0x2f')][_0x0ade('0x3a')]){_0x5a06d6['where']=_['merge'](_0x5a06d6[_0x0ade('0x38')],{'$or':_[_0x0ade('0x29')](_0x2705aa,function(_0x2f8c63){if(_0x2f8c63[_0x0ade('0x2c')]!==_0x0ade('0x3b')){var _0x8d2b1a={};_0x8d2b1a[_0x2f8c63[_0x0ade('0x26')]]={'$like':'%'+_0x19f245[_0x0ade('0x2f')][_0x0ade('0x3a')]+'%'};return _0x8d2b1a;}})});}_0x5a06d6=_[_0x0ade('0x3c')]({},_0x5a06d6,_0x19f245[_0x0ade('0x3d')]);var _0x3b171a={'where':_0x5a06d6['where']};return db[_0x0ade('0x3e')][_0x0ade('0x1b')](_0x3b171a)[_0x0ade('0x22')](function(_0x53a0f8){_0xa90140['count']=_0x53a0f8;if(_0x19f245[_0x0ade('0x2f')][_0x0ade('0x3f')]){_0x5a06d6['include']=[{'all':!![]}];}return db[_0x0ade('0x3e')][_0x0ade('0x40')](_0x5a06d6);})[_0x0ade('0x22')](function(_0x50202e){_0xa90140[_0x0ade('0x41')]=_0x50202e;return _0xa90140;})[_0x0ade('0x22')](respondWithFilteredResult(_0x24163a,_0x5a06d6))['catch'](handleError(_0x24163a,null));};exports[_0x0ade('0x42')]=function(_0x1e114c,_0xdefcab){var _0x49ae3e={'raw':![],'where':{'id':_0x1e114c['params']['id']}},_0xf262a4={};_0xf262a4[_0x0ade('0x2e')]=_[_0x0ade('0x43')](db[_0x0ade('0x3e')][_0x0ade('0x2a')]);_0xf262a4['query']=_['keys'](_0x1e114c[_0x0ade('0x2f')]);_0xf262a4[_0x0ade('0x30')]=_[_0x0ade('0x31')](_0xf262a4['model'],_0xf262a4[_0x0ade('0x2f')]);_0x49ae3e['attributes']=_[_0x0ade('0x31')](_0xf262a4[_0x0ade('0x2e')],qs[_0x0ade('0x33')](_0x1e114c[_0x0ade('0x2f')][_0x0ade('0x33')]));_0x49ae3e[_0x0ade('0x32')]=_0x49ae3e[_0x0ade('0x32')]['length']?_0x49ae3e[_0x0ade('0x32')]:_0xf262a4[_0x0ade('0x2e')];if(_0x1e114c[_0x0ade('0x2f')][_0x0ade('0x3f')]){_0x49ae3e[_0x0ade('0x44')]=[{'all':!![]}];}_0x49ae3e=_[_0x0ade('0x3c')]({},_0x49ae3e,_0x1e114c['options']);return db[_0x0ade('0x3e')][_0x0ade('0x45')](_0x49ae3e)[_0x0ade('0x22')](handleEntityNotFound(_0xdefcab,null))[_0x0ade('0x22')](respondWithResult(_0xdefcab,null))[_0x0ade('0x46')](handleError(_0xdefcab,null));};exports[_0x0ade('0x47')]=function(_0x3f6500,_0x28d831){return db[_0x0ade('0x3e')][_0x0ade('0x47')](_0x3f6500[_0x0ade('0x48')],{})[_0x0ade('0x22')](respondWithResult(_0x28d831,0xc9))[_0x0ade('0x46')](handleError(_0x28d831,null));};exports['update']=function(_0x569350,_0x8f1508){if(_0x569350[_0x0ade('0x48')]['id']){delete _0x569350[_0x0ade('0x48')]['id'];}return db[_0x0ade('0x3e')][_0x0ade('0x45')]({'where':{'id':_0x569350[_0x0ade('0x49')]['id']}})[_0x0ade('0x22')](handleEntityNotFound(_0x8f1508,null))[_0x0ade('0x22')](saveUpdates(_0x569350['body'],null))[_0x0ade('0x22')](respondWithResult(_0x8f1508,null))['catch'](handleError(_0x8f1508,null));};exports['destroy']=function(_0x4bb59d,_0x1e8643){return db['DeskAccount']['find']({'where':{'id':_0x4bb59d[_0x0ade('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e8643,null))[_0x0ade('0x22')](removeEntity(_0x1e8643,null))[_0x0ade('0x46')](handleError(_0x1e8643,null));};exports['getConfigurations']=function(_0xeb68c1,_0x20c6f7,_0x25a05d){var _0x4ce07a={};var _0x206fd5={};var _0x30f800;var _0x32c058;return db[_0x0ade('0x3e')][_0x0ade('0x4a')]({'where':{'id':_0xeb68c1[_0x0ade('0x49')]['id']}})[_0x0ade('0x22')](handleEntityNotFound(_0x20c6f7,null))[_0x0ade('0x22')](function(_0x54556e){if(_0x54556e){_0x30f800=_0x54556e;_0x206fd5['model']=_[_0x0ade('0x43')](db[_0x0ade('0x4b')][_0x0ade('0x2a')]);_0x206fd5[_0x0ade('0x2f')]=_['keys'](_0xeb68c1[_0x0ade('0x2f')]);_0x206fd5[_0x0ade('0x30')]=_[_0x0ade('0x31')](_0x206fd5['model'],_0x206fd5[_0x0ade('0x2f')]);_0x4ce07a['attributes']=_[_0x0ade('0x31')](_0x206fd5['model'],qs[_0x0ade('0x33')](_0xeb68c1[_0x0ade('0x2f')][_0x0ade('0x33')]));_0x4ce07a['attributes']=_0x4ce07a[_0x0ade('0x32')][_0x0ade('0x34')]?_0x4ce07a[_0x0ade('0x32')]:_0x206fd5[_0x0ade('0x2e')];_0x4ce07a[_0x0ade('0x36')]=qs[_0x0ade('0x37')](_0xeb68c1[_0x0ade('0x2f')][_0x0ade('0x37')]);_0x4ce07a[_0x0ade('0x38')]=qs[_0x0ade('0x30')](_['pick'](_0xeb68c1[_0x0ade('0x2f')],_0x206fd5[_0x0ade('0x30')]));if(_0xeb68c1[_0x0ade('0x2f')][_0x0ade('0x3a')]){_0x4ce07a[_0x0ade('0x38')]=_['merge'](_0x4ce07a['where'],{'$or':_[_0x0ade('0x29')](_0x4ce07a[_0x0ade('0x32')],function(_0x444d87){var _0x1c0a9c={};_0x1c0a9c[_0x444d87]={'$like':'%'+_0xeb68c1[_0x0ade('0x2f')][_0x0ade('0x3a')]+'%'};return _0x1c0a9c;})});}_0x4ce07a=_[_0x0ade('0x3c')]({},_0x4ce07a,_0xeb68c1[_0x0ade('0x3d')]);return _0x30f800['getConfigurations'](_0x4ce07a);}})[_0x0ade('0x22')](function(_0x1c69ae){if(_0x1c69ae){_0x32c058=_0x1c69ae[_0x0ade('0x34')];if(!_0xeb68c1['query']['hasOwnProperty'](_0x0ade('0x35'))){_0x4ce07a[_0x0ade('0x1a')]=qs[_0x0ade('0x1a')](_0xeb68c1['query'][_0x0ade('0x1a')]);_0x4ce07a['offset']=qs[_0x0ade('0x18')](_0xeb68c1['query']['offset']);}return _0x30f800[_0x0ade('0x4c')](_0x4ce07a);}})['then'](function(_0x1ff862){if(_0x1ff862){return _0x1ff862?{'count':_0x32c058,'rows':_0x1ff862}:null;}})[_0x0ade('0x22')](respondWithResult(_0x20c6f7,null))['catch'](handleError(_0x20c6f7,null));};exports['addConfiguration']=function(_0x5f586d,_0xe9d06d,_0x3987da){if(_0x5f586d[_0x0ade('0x48')]['id']){delete _0x5f586d['body']['id'];}return db['DeskAccount'][_0x0ade('0x4a')]({'where':{'id':_0x5f586d[_0x0ade('0x49')]['id']}})[_0x0ade('0x22')](handleEntityNotFound(_0xe9d06d,null))[_0x0ade('0x22')](function(_0x563bde){if(_0x563bde){_0x5f586d['body'][_0x0ade('0x4d')]=_0x563bde['id'];_0x5f586d[_0x0ade('0x48')][_0x0ade('0x4e')]=integrations['getSubjects'](_0x5f586d[_0x0ade('0x48')][_0x0ade('0x4f')],_0x5f586d[_0x0ade('0x48')][_0x0ade('0x2c')]);_0x5f586d[_0x0ade('0x48')]['Descriptions']=integrations[_0x0ade('0x50')](_0x5f586d[_0x0ade('0x48')][_0x0ade('0x4f')],_0x5f586d[_0x0ade('0x48')][_0x0ade('0x2c')]);return db[_0x0ade('0x4b')][_0x0ade('0x47')](_0x5f586d[_0x0ade('0x48')],{'include':[{'model':db[_0x0ade('0x51')],'as':_0x0ade('0x4e')},{'model':db[_0x0ade('0x51')],'as':_0x0ade('0x52')}]});}return null;})[_0x0ade('0x22')](respondWithResult(_0xe9d06d,null))['catch'](handleError(_0xe9d06d,null));};exports['getFields']=function(_0x4cfe4e,_0x509590,_0x3f1cac){var _0x13b86a=[{'name':_0x0ade('0x53'),'label':_0x0ade('0x53'),'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 _0x19f279='';return db['DeskAccount'][_0x0ade('0x4a')]({'where':{'id':_0x4cfe4e[_0x0ade('0x49')]['id']},'attributes':['id',_0x0ade('0x54'),'authType',_0x0ade('0x55'),_0x0ade('0x56'),'consumerKey','consumerSecret',_0x0ade('0x57'),_0x0ade('0x58')]})[_0x0ade('0x22')](handleEntityNotFound(_0x509590,null))[_0x0ade('0x22')](function(_0x5a55eb){if(_0x5a55eb){_0x19f279=_0x5a55eb[_0x0ade('0x54')];var _0x1b3e18=_0x19f279['slice'](-0x1);if(_0x1b3e18==='/'){_0x19f279=_0x19f279[_0x0ade('0x59')](0x0,_0x19f279['lastIndexOf'](_0x1b3e18));}var _0xabab2c={'method':_0x0ade('0x5a'),'uri':util[_0x0ade('0x5b')]('%s/custom_fields',_0x19f279),'headers':{'Content-Type':_0x0ade('0x5c'),'Accept':_0x0ade('0x5c')},'json':!![]};if(_0x5a55eb[_0x0ade('0x5d')]===_0x0ade('0x5e')){_0xabab2c[_0x0ade('0x5f')][_0x0ade('0x60')]=util[_0x0ade('0x5b')]('Basic\x20%s',new Buffer(util[_0x0ade('0x5b')](_0x0ade('0x61'),_0x5a55eb['username'],_0x5a55eb[_0x0ade('0x56')]))[_0x0ade('0x62')](_0x0ade('0x63')));}return rp(_0xabab2c)[_0x0ade('0x22')](function(_0x13ba1){return _0x13b86a[_0x0ade('0x64')](_[_0x0ade('0x29')](_0x13ba1[_0x0ade('0x65')][_0x0ade('0x66')],function(_0x22ecf0){return{'id':_0x22ecf0['name'],'name':_0x22ecf0['name'],'type':_0x22ecf0[_0x0ade('0x2c')],'active':_0x22ecf0[_0x0ade('0x67')],'label':_0x22ecf0[_0x0ade('0x68')],'custom':!![]};}));});}})[_0x0ade('0x22')](function(_0x59fad9){return{'count':_0x59fad9[_0x0ade('0x34')],'rows':_0x59fad9};})[_0x0ade('0x22')](respondWithResult(_0x509590,null))[_0x0ade('0x46')](function(_0x4bae53){var _0x3449ad=_0x4cfe4e[_0x0ade('0x2f')]['test']?0x1f4:_0x4bae53[_0x0ade('0x69')]||0x1f4;logger[_0x0ade('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3449ad,JSON['stringify'](_0x4bae53));delete _0x4bae53[_0x0ade('0x26')];if(_0x3449ad===0x191){_0x3449ad=0x190;}_0x509590[_0x0ade('0x16')](_0x3449ad)['send'](_0x4cfe4e[_0x0ade('0x2f')]['test']?{'message':_0x0ade('0x6a'),'statusCode':_0x4bae53[_0x0ade('0x69')]}:_0x4bae53);});}; \ No newline at end of file +var _0x4435=['type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','fields','find','body','getConfigurations','findOne','params','DeskConfiguration','pick','map','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','DeskField','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','concat','_embedded','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../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','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','DeskAccount','rawAttributes'];(function(_0xdc4d1d,_0x313c69){var _0x58e9ad=function(_0x372848){while(--_0x372848){_0xdc4d1d['push'](_0xdc4d1d['shift']());}};_0x58e9ad(++_0x313c69);}(_0x4435,0x19a));var _0x5443=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4435[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0x5443('0x0'));var rimraf=require(_0x5443('0x1'));var zipdir=require(_0x5443('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5443('0x3'));var BPromise=require(_0x5443('0x4'));var Mustache=require(_0x5443('0x5'));var util=require(_0x5443('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5443('0x7'));var ejs=require(_0x5443('0x8'));var fs=require('fs');var fs_extra=require(_0x5443('0x9'));var _=require('lodash');var squel=require(_0x5443('0xa'));var crypto=require(_0x5443('0xb'));var jsforce=require(_0x5443('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5443('0x7'));var querystring=require(_0x5443('0xd'));var Papa=require(_0x5443('0xe'));var Redis=require(_0x5443('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5443('0x10'));var as=require(_0x5443('0x11'));var hardwareService=require(_0x5443('0x12'));var logger=require(_0x5443('0x13'))(_0x5443('0x14'));var utils=require(_0x5443('0x15'));var config=require(_0x5443('0x16'));var licenseUtil=require(_0x5443('0x17'));var db=require(_0x5443('0x18'))['db'];var integrations=require(_0x5443('0x19'));function respondWithStatusCode(_0x5af348,_0x1071dd){_0x1071dd=_0x1071dd||0xcc;return function(_0x5f3b70){if(_0x5f3b70){return _0x5af348[_0x5443('0x1a')](_0x1071dd);}return _0x5af348[_0x5443('0x1b')](_0x1071dd)[_0x5443('0x1c')]();};}function respondWithResult(_0x589511,_0x27f60c){_0x27f60c=_0x27f60c||0xc8;return function(_0x4d75e4){if(_0x4d75e4){return _0x589511[_0x5443('0x1b')](_0x27f60c)[_0x5443('0x1d')](_0x4d75e4);}};}function respondWithFilteredResult(_0x18cdd1,_0x5c9bf8){return function(_0x46e608){if(_0x46e608){var _0x48c486=typeof _0x5c9bf8[_0x5443('0x1e')]===_0x5443('0x1f')&&typeof _0x5c9bf8[_0x5443('0x20')]==='undefined';var _0x5d3ba6=_0x46e608[_0x5443('0x21')];var _0x4e71c3=_0x48c486?0x0:_0x5c9bf8[_0x5443('0x1e')];var _0x554d4b=_0x48c486?_0x46e608[_0x5443('0x21')]:_0x5c9bf8['offset']+_0x5c9bf8[_0x5443('0x20')];var _0x93af03;if(_0x554d4b>=_0x5d3ba6){_0x554d4b=_0x5d3ba6;_0x93af03=0xc8;}else{_0x93af03=0xce;}_0x18cdd1[_0x5443('0x1b')](_0x93af03);return _0x18cdd1[_0x5443('0x22')](_0x5443('0x23'),_0x4e71c3+'-'+_0x554d4b+'/'+_0x5d3ba6)[_0x5443('0x1d')](_0x46e608);}return null;};}function patchUpdates(_0x31168c){return function(_0x2e3331){try{jsonpatch['apply'](_0x2e3331,_0x31168c,!![]);}catch(_0x3dd557){return BPromise[_0x5443('0x24')](_0x3dd557);}return _0x2e3331['save']();};}function saveUpdates(_0x2cd22e,_0x524d4f){return function(_0x244a6f){if(_0x244a6f){return _0x244a6f[_0x5443('0x25')](_0x2cd22e)[_0x5443('0x26')](function(_0x55c9ec){return _0x55c9ec;});}return null;};}function removeEntity(_0x9747e9,_0x44040c){return function(_0x3c7f0c){if(_0x3c7f0c){return _0x3c7f0c[_0x5443('0x27')]()[_0x5443('0x26')](function(){_0x9747e9[_0x5443('0x1b')](0xcc)[_0x5443('0x1c')]();});}};}function handleEntityNotFound(_0x1ab27a,_0x840dc3){return function(_0x23e1b3){if(!_0x23e1b3){_0x1ab27a['sendStatus'](0x194);}return _0x23e1b3;};}function handleError(_0x505d40,_0x233dc6){_0x233dc6=_0x233dc6||0x1f4;return function(_0x371725){logger['error'](_0x371725[_0x5443('0x28')]);if(_0x371725[_0x5443('0x29')]){delete _0x371725[_0x5443('0x29')];}_0x505d40[_0x5443('0x1b')](_0x233dc6)[_0x5443('0x2a')](_0x371725);};}exports[_0x5443('0x2b')]=function(_0x29029a,_0x535167){var _0x4d41f0={},_0x5d202e={},_0x5aa169={'count':0x0,'rows':[]};var _0x3a8dd0=_['map'](db[_0x5443('0x2c')][_0x5443('0x2d')],function(_0x55cacc){return{'name':_0x55cacc['fieldName'],'type':_0x55cacc[_0x5443('0x2e')][_0x5443('0x2f')]};});_0x5d202e[_0x5443('0x30')]=_['map'](_0x3a8dd0,_0x5443('0x29'));_0x5d202e[_0x5443('0x31')]=_[_0x5443('0x32')](_0x29029a[_0x5443('0x31')]);_0x5d202e[_0x5443('0x33')]=_['intersection'](_0x5d202e[_0x5443('0x30')],_0x5d202e[_0x5443('0x31')]);_0x4d41f0[_0x5443('0x34')]=_[_0x5443('0x35')](_0x5d202e[_0x5443('0x30')],qs['fields'](_0x29029a[_0x5443('0x31')]['fields']));_0x4d41f0['attributes']=_0x4d41f0['attributes'][_0x5443('0x36')]?_0x4d41f0[_0x5443('0x34')]:_0x5d202e[_0x5443('0x30')];if(!_0x29029a[_0x5443('0x31')][_0x5443('0x37')]('nolimit')){_0x4d41f0[_0x5443('0x20')]=qs[_0x5443('0x20')](_0x29029a[_0x5443('0x31')][_0x5443('0x20')]);_0x4d41f0[_0x5443('0x1e')]=qs[_0x5443('0x1e')](_0x29029a[_0x5443('0x31')]['offset']);}_0x4d41f0[_0x5443('0x38')]=qs[_0x5443('0x39')](_0x29029a[_0x5443('0x31')][_0x5443('0x39')]);_0x4d41f0[_0x5443('0x3a')]=qs[_0x5443('0x33')](_['pick'](_0x29029a[_0x5443('0x31')],_0x5d202e[_0x5443('0x33')]),_0x3a8dd0);if(_0x29029a[_0x5443('0x31')][_0x5443('0x3b')]){_0x4d41f0[_0x5443('0x3a')]=_[_0x5443('0x3c')](_0x4d41f0[_0x5443('0x3a')],{'$or':_['map'](_0x3a8dd0,function(_0x20741b){if(_0x20741b[_0x5443('0x2e')]!=='VIRTUAL'){var _0x51366f={};_0x51366f[_0x20741b[_0x5443('0x29')]]={'$like':'%'+_0x29029a['query']['filter']+'%'};return _0x51366f;}})});}_0x4d41f0=_[_0x5443('0x3c')]({},_0x4d41f0,_0x29029a[_0x5443('0x3d')]);var _0x3b7929={'where':_0x4d41f0[_0x5443('0x3a')]};return db[_0x5443('0x2c')]['count'](_0x3b7929)[_0x5443('0x26')](function(_0x5c427d){_0x5aa169[_0x5443('0x21')]=_0x5c427d;if(_0x29029a[_0x5443('0x31')][_0x5443('0x3e')]){_0x4d41f0[_0x5443('0x3f')]=[{'all':!![]}];}return db[_0x5443('0x2c')][_0x5443('0x40')](_0x4d41f0);})[_0x5443('0x26')](function(_0x53f1ba){_0x5aa169['rows']=_0x53f1ba;return _0x5aa169;})[_0x5443('0x26')](respondWithFilteredResult(_0x535167,_0x4d41f0))[_0x5443('0x41')](handleError(_0x535167,null));};exports[_0x5443('0x42')]=function(_0x3bee74,_0x150c6a){var _0x21fbcf={'raw':![],'where':{'id':_0x3bee74['params']['id']}},_0x22a1ab={};_0x22a1ab[_0x5443('0x30')]=_[_0x5443('0x32')](db[_0x5443('0x2c')]['rawAttributes']);_0x22a1ab[_0x5443('0x31')]=_['keys'](_0x3bee74['query']);_0x22a1ab[_0x5443('0x33')]=_[_0x5443('0x35')](_0x22a1ab['model'],_0x22a1ab['query']);_0x21fbcf['attributes']=_[_0x5443('0x35')](_0x22a1ab[_0x5443('0x30')],qs['fields'](_0x3bee74['query'][_0x5443('0x43')]));_0x21fbcf[_0x5443('0x34')]=_0x21fbcf[_0x5443('0x34')][_0x5443('0x36')]?_0x21fbcf[_0x5443('0x34')]:_0x22a1ab[_0x5443('0x30')];if(_0x3bee74['query']['includeAll']){_0x21fbcf[_0x5443('0x3f')]=[{'all':!![]}];}_0x21fbcf=_[_0x5443('0x3c')]({},_0x21fbcf,_0x3bee74['options']);return db[_0x5443('0x2c')][_0x5443('0x44')](_0x21fbcf)['then'](handleEntityNotFound(_0x150c6a,null))['then'](respondWithResult(_0x150c6a,null))[_0x5443('0x41')](handleError(_0x150c6a,null));};exports['create']=function(_0x3d4c51,_0xb30d11){return db[_0x5443('0x2c')]['create'](_0x3d4c51[_0x5443('0x45')],{})[_0x5443('0x26')](respondWithResult(_0xb30d11,0xc9))[_0x5443('0x41')](handleError(_0xb30d11,null));};exports[_0x5443('0x25')]=function(_0x348201,_0x22b7af){if(_0x348201[_0x5443('0x45')]['id']){delete _0x348201[_0x5443('0x45')]['id'];}return db[_0x5443('0x2c')][_0x5443('0x44')]({'where':{'id':_0x348201['params']['id']}})['then'](handleEntityNotFound(_0x22b7af,null))[_0x5443('0x26')](saveUpdates(_0x348201[_0x5443('0x45')],null))[_0x5443('0x26')](respondWithResult(_0x22b7af,null))[_0x5443('0x41')](handleError(_0x22b7af,null));};exports[_0x5443('0x27')]=function(_0x1336cf,_0x1e00d3){return db[_0x5443('0x2c')][_0x5443('0x44')]({'where':{'id':_0x1336cf['params']['id']}})['then'](handleEntityNotFound(_0x1e00d3,null))['then'](removeEntity(_0x1e00d3,null))['catch'](handleError(_0x1e00d3,null));};exports[_0x5443('0x46')]=function(_0x5f45c5,_0xe98522,_0x1af3f8){var _0x373aff={};var _0x2a422a={};var _0x48f8b9;var _0x8a792;return db[_0x5443('0x2c')][_0x5443('0x47')]({'where':{'id':_0x5f45c5[_0x5443('0x48')]['id']}})[_0x5443('0x26')](handleEntityNotFound(_0xe98522,null))[_0x5443('0x26')](function(_0x39d67a){if(_0x39d67a){_0x48f8b9=_0x39d67a;_0x2a422a[_0x5443('0x30')]=_[_0x5443('0x32')](db[_0x5443('0x49')][_0x5443('0x2d')]);_0x2a422a[_0x5443('0x31')]=_[_0x5443('0x32')](_0x5f45c5[_0x5443('0x31')]);_0x2a422a[_0x5443('0x33')]=_[_0x5443('0x35')](_0x2a422a[_0x5443('0x30')],_0x2a422a[_0x5443('0x31')]);_0x373aff[_0x5443('0x34')]=_['intersection'](_0x2a422a[_0x5443('0x30')],qs[_0x5443('0x43')](_0x5f45c5[_0x5443('0x31')][_0x5443('0x43')]));_0x373aff[_0x5443('0x34')]=_0x373aff[_0x5443('0x34')][_0x5443('0x36')]?_0x373aff[_0x5443('0x34')]:_0x2a422a['model'];_0x373aff[_0x5443('0x38')]=qs['sort'](_0x5f45c5[_0x5443('0x31')][_0x5443('0x39')]);_0x373aff['where']=qs[_0x5443('0x33')](_[_0x5443('0x4a')](_0x5f45c5[_0x5443('0x31')],_0x2a422a[_0x5443('0x33')]));if(_0x5f45c5[_0x5443('0x31')][_0x5443('0x3b')]){_0x373aff[_0x5443('0x3a')]=_[_0x5443('0x3c')](_0x373aff['where'],{'$or':_[_0x5443('0x4b')](_0x373aff[_0x5443('0x34')],function(_0xd63701){var _0xfd66a4={};_0xfd66a4[_0xd63701]={'$like':'%'+_0x5f45c5[_0x5443('0x31')][_0x5443('0x3b')]+'%'};return _0xfd66a4;})});}_0x373aff=_['merge']({},_0x373aff,_0x5f45c5[_0x5443('0x3d')]);return _0x48f8b9[_0x5443('0x46')](_0x373aff);}})['then'](function(_0x100023){if(_0x100023){_0x8a792=_0x100023[_0x5443('0x36')];if(!_0x5f45c5[_0x5443('0x31')][_0x5443('0x37')]('nolimit')){_0x373aff[_0x5443('0x20')]=qs[_0x5443('0x20')](_0x5f45c5[_0x5443('0x31')]['limit']);_0x373aff[_0x5443('0x1e')]=qs[_0x5443('0x1e')](_0x5f45c5[_0x5443('0x31')]['offset']);}return _0x48f8b9[_0x5443('0x46')](_0x373aff);}})[_0x5443('0x26')](function(_0x49724a){if(_0x49724a){return _0x49724a?{'count':_0x8a792,'rows':_0x49724a}:null;}})[_0x5443('0x26')](respondWithResult(_0xe98522,null))[_0x5443('0x41')](handleError(_0xe98522,null));};exports[_0x5443('0x4c')]=function(_0x188649,_0x2c6dd7,_0x283eeb){if(_0x188649['body']['id']){delete _0x188649[_0x5443('0x45')]['id'];}return db[_0x5443('0x2c')]['findOne']({'where':{'id':_0x188649[_0x5443('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c6dd7,null))[_0x5443('0x26')](function(_0x440711){if(_0x440711){_0x188649[_0x5443('0x45')][_0x5443('0x4d')]=_0x440711['id'];_0x188649[_0x5443('0x45')][_0x5443('0x4e')]=integrations[_0x5443('0x4f')](_0x188649[_0x5443('0x45')][_0x5443('0x50')],_0x188649[_0x5443('0x45')][_0x5443('0x2e')]);_0x188649[_0x5443('0x45')][_0x5443('0x51')]=integrations[_0x5443('0x52')](_0x188649[_0x5443('0x45')][_0x5443('0x50')],_0x188649['body'][_0x5443('0x2e')]);return db['DeskConfiguration'][_0x5443('0x53')](_0x188649[_0x5443('0x45')],{'include':[{'model':db[_0x5443('0x54')],'as':'Subjects'},{'model':db[_0x5443('0x54')],'as':_0x5443('0x51')}]});}return null;})[_0x5443('0x26')](respondWithResult(_0x2c6dd7,null))[_0x5443('0x41')](handleError(_0x2c6dd7,null));};exports[_0x5443('0x55')]=function(_0x15ba8c,_0x207041,_0x35e862){var _0x48ef22=[{'name':_0x5443('0x56'),'label':_0x5443('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 _0x43e8e8='';return db[_0x5443('0x2c')][_0x5443('0x47')]({'where':{'id':_0x15ba8c[_0x5443('0x48')]['id']},'attributes':['id',_0x5443('0x57'),_0x5443('0x58'),'username',_0x5443('0x59'),_0x5443('0x5a'),_0x5443('0x5b'),_0x5443('0x5c'),_0x5443('0x5d')]})[_0x5443('0x26')](handleEntityNotFound(_0x207041,null))['then'](function(_0x395445){if(_0x395445){_0x43e8e8=_0x395445[_0x5443('0x57')];var _0x2e672f=_0x43e8e8[_0x5443('0x5e')](-0x1);if(_0x2e672f==='/'){_0x43e8e8=_0x43e8e8[_0x5443('0x5f')](0x0,_0x43e8e8[_0x5443('0x60')](_0x2e672f));}var _0x38f4d7={'method':_0x5443('0x61'),'uri':util[_0x5443('0x62')](_0x5443('0x63'),_0x43e8e8),'headers':{'Content-Type':_0x5443('0x64'),'Accept':_0x5443('0x64')},'json':!![]};if(_0x395445[_0x5443('0x58')]===_0x5443('0x65')){_0x38f4d7[_0x5443('0x66')]['Authorization']=util[_0x5443('0x62')](_0x5443('0x67'),new Buffer(util[_0x5443('0x62')](_0x5443('0x68'),_0x395445['username'],_0x395445[_0x5443('0x59')]))['toString']('base64'));}return rp(_0x38f4d7)[_0x5443('0x26')](function(_0x466715){return _0x48ef22[_0x5443('0x69')](_[_0x5443('0x4b')](_0x466715[_0x5443('0x6a')]['entries'],function(_0x31923e){return{'id':_0x31923e[_0x5443('0x29')],'name':_0x31923e[_0x5443('0x29')],'type':_0x31923e[_0x5443('0x2e')],'active':_0x31923e[_0x5443('0x6b')],'label':_0x31923e[_0x5443('0x6c')],'custom':!![]};}));});}})['then'](function(_0x1570b6){return{'count':_0x1570b6['length'],'rows':_0x1570b6};})[_0x5443('0x26')](respondWithResult(_0x207041,null))[_0x5443('0x41')](function(_0x441a1d){var _0x4cff84=_0x15ba8c[_0x5443('0x31')][_0x5443('0x6d')]?0x1f4:_0x441a1d[_0x5443('0x6e')]||0x1f4;logger[_0x5443('0x6f')](_0x5443('0x70'),_0x5443('0x55'),_0x4cff84,JSON['stringify'](_0x441a1d));delete _0x441a1d[_0x5443('0x29')];if(_0x4cff84===0x191){_0x4cff84=0x190;}_0x207041[_0x5443('0x1b')](_0x4cff84)[_0x5443('0x2a')](_0x15ba8c[_0x5443('0x31')]['test']?{'message':_0x5443('0x71'),'statusCode':_0x441a1d[_0x5443('0x6e')]}:_0x441a1d);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index e0fcae4..e2b42d6 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 _0x04e7=['bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x31bb0c,_0x496959){var _0x4e8ee9=function(_0x2d661d){while(--_0x2d661d){_0x31bb0c['push'](_0x31bb0c['shift']());}};_0x4e8ee9(++_0x496959);}(_0x04e7,0x87));var _0x704e=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x04e7[_0x49a57c];return _0x4e0316;};'use strict';var _=require(_0x704e('0x0'));var util=require(_0x704e('0x1'));var logger=require(_0x704e('0x2'))(_0x704e('0x3'));var moment=require(_0x704e('0x4'));var BPromise=require(_0x704e('0x5'));var rp=require(_0x704e('0x6'));var fs=require('fs');var path=require(_0x704e('0x7'));var rimraf=require(_0x704e('0x8'));var config=require('../../config/environment');var attributes=require(_0x704e('0x9'));var integrations=require(_0x704e('0xa'));module[_0x704e('0xb')]=function(_0x3cc225,_0x537305){return _0x3cc225[_0x704e('0xc')]('DeskAccount',attributes,{'tableName':_0x704e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9876=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0x9876,0xee));var _0x6987=function(_0x263d39,_0x4c13e5){_0x263d39=_0x263d39-0x0;var _0x4bbd1c=_0x9876[_0x263d39];return _0x4bbd1c;};'use strict';var _=require(_0x6987('0x0'));var util=require(_0x6987('0x1'));var logger=require(_0x6987('0x2'))(_0x6987('0x3'));var moment=require(_0x6987('0x4'));var BPromise=require(_0x6987('0x5'));var rp=require(_0x6987('0x6'));var fs=require('fs');var path=require(_0x6987('0x7'));var rimraf=require(_0x6987('0x8'));var config=require(_0x6987('0x9'));var attributes=require(_0x6987('0xa'));var integrations=require(_0x6987('0xb'));module[_0x6987('0xc')]=function(_0x127e1b,_0xa6e6b2){return _0x127e1b[_0x6987('0xd')]('DeskAccount',attributes,{'tableName':_0x6987('0xe'),'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 d8acaed..496536c 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 _0xca4a=['then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDeskAccount','findAll','options','raw','attributes','limit','include','model','map','ShowDeskAccount','DeskAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x3d79bf,_0x39fea3){var _0x4e2126=function(_0xa5ba47){while(--_0xa5ba47){_0x3d79bf['push'](_0x3d79bf['shift']());}};_0x4e2126(++_0x39fea3);}(_0xca4a,0x81));var _0xaca4=function(_0x1d390d,_0xc2678d){_0x1d390d=_0x1d390d-0x0;var _0x260f65=_0xca4a[_0x1d390d];return _0x260f65;};'use strict';var _=require('lodash');var util=require(_0xaca4('0x0'));var moment=require(_0xaca4('0x1'));var BPromise=require(_0xaca4('0x2'));var rs=require(_0xaca4('0x3'));var fs=require('fs');var Redis=require(_0xaca4('0x4'));var db=require(_0xaca4('0x5'))['db'];var utils=require(_0xaca4('0x6'));var logger=require('../../config/logger')(_0xaca4('0x7'));var config=require(_0xaca4('0x8'));var jayson=require(_0xaca4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5455b2,_0x462490,_0xaed90d){return new BPromise(function(_0x1b3053,_0x246eae){return client[_0xaca4('0xa')](_0x5455b2,_0xaed90d)[_0xaca4('0xb')](function(_0x4509c2){logger[_0xaca4('0xc')](_0xaca4('0xd'),_0x462490,_0xaca4('0xe'));logger[_0xaca4('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x462490,_0xaca4('0xe'),JSON[_0xaca4('0x10')](_0x4509c2));if(_0x4509c2[_0xaca4('0x11')]){if(_0x4509c2['error'][_0xaca4('0x12')]===0x1f4){logger[_0xaca4('0x11')](_0xaca4('0xd'),_0x462490,_0x4509c2[_0xaca4('0x11')]['message']);return _0x246eae(_0x4509c2[_0xaca4('0x11')][_0xaca4('0x13')]);}logger[_0xaca4('0x11')](_0xaca4('0xd'),_0x462490,_0x4509c2[_0xaca4('0x11')]['message']);return _0x1b3053(_0x4509c2['error'][_0xaca4('0x13')]);}else{logger['info'](_0xaca4('0xd'),_0x462490,_0xaca4('0xe'));_0x1b3053(_0x4509c2[_0xaca4('0x14')]['message']);}})[_0xaca4('0x15')](function(_0x31e3af){logger[_0xaca4('0x11')]('DeskAccount,\x20%s,\x20%s',_0x462490,_0x31e3af);_0x246eae(_0x31e3af);});});}exports[_0xaca4('0x16')]=function(_0x21d81a){var _0x22902d=this;return new Promise(function(_0x1a3549,_0x4e622c){return db['DeskAccount'][_0xaca4('0x17')]({'raw':_0x21d81a[_0xaca4('0x18')]?_0x21d81a['options'][_0xaca4('0x19')]===undefined?!![]:![]:!![],'where':_0x21d81a[_0xaca4('0x18')]?_0x21d81a[_0xaca4('0x18')]['where']||null:null,'attributes':_0x21d81a[_0xaca4('0x18')]?_0x21d81a[_0xaca4('0x18')][_0xaca4('0x1a')]||null:null,'limit':_0x21d81a[_0xaca4('0x18')]?_0x21d81a['options'][_0xaca4('0x1b')]||null:null,'include':_0x21d81a[_0xaca4('0x18')]?_0x21d81a[_0xaca4('0x18')]['include']?_['map'](_0x21d81a[_0xaca4('0x18')][_0xaca4('0x1c')],function(_0x24dbca){return{'model':db[_0x24dbca[_0xaca4('0x1d')]],'as':_0x24dbca['as'],'attributes':_0x24dbca[_0xaca4('0x1a')],'include':_0x24dbca[_0xaca4('0x1c')]?_[_0xaca4('0x1e')](_0x24dbca[_0xaca4('0x1c')],function(_0x27b9b5){return{'model':db[_0x27b9b5['model']],'as':_0x27b9b5['as'],'attributes':_0x27b9b5[_0xaca4('0x1a')],'include':_0x27b9b5[_0xaca4('0x1c')]?_['map'](_0x27b9b5[_0xaca4('0x1c')],function(_0x2239e2){return{'model':db[_0x2239e2['model']],'as':_0x2239e2['as'],'attributes':_0x2239e2[_0xaca4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xaca4('0xb')](function(_0xbe5bee){logger[_0xaca4('0xc')](_0xaca4('0x16'),_0x21d81a);logger['debug'](_0xaca4('0x16'),_0x21d81a,JSON['stringify'](_0xbe5bee));_0x1a3549(_0xbe5bee);})['catch'](function(_0x2864b8){logger['error'](_0xaca4('0x16'),_0x2864b8['message'],_0x21d81a);_0x4e622c(_0x22902d[_0xaca4('0x11')](0x1f4,_0x2864b8['message']));});});};exports[_0xaca4('0x1f')]=function(_0x17a30e){var _0x357207=this;return new Promise(function(_0xd9830c,_0x1fa85a){return db[_0xaca4('0x20')][_0xaca4('0x21')]({'raw':_0x17a30e[_0xaca4('0x18')]?_0x17a30e[_0xaca4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x17a30e[_0xaca4('0x18')]?_0x17a30e[_0xaca4('0x18')][_0xaca4('0x22')]||null:null,'attributes':_0x17a30e[_0xaca4('0x18')]?_0x17a30e[_0xaca4('0x18')][_0xaca4('0x1a')]||null:null,'include':_0x17a30e[_0xaca4('0x18')]?_0x17a30e[_0xaca4('0x18')][_0xaca4('0x1c')]?_[_0xaca4('0x1e')](_0x17a30e[_0xaca4('0x18')][_0xaca4('0x1c')],function(_0x36f6e5){return{'model':db[_0x36f6e5[_0xaca4('0x1d')]],'as':_0x36f6e5['as'],'attributes':_0x36f6e5['attributes'],'include':_0x36f6e5[_0xaca4('0x1c')]?_[_0xaca4('0x1e')](_0x36f6e5[_0xaca4('0x1c')],function(_0x588674){return{'model':db[_0x588674[_0xaca4('0x1d')]],'as':_0x588674['as'],'attributes':_0x588674[_0xaca4('0x1a')],'include':_0x588674['include']?_[_0xaca4('0x1e')](_0x588674[_0xaca4('0x1c')],function(_0xf14fc0){return{'model':db[_0xf14fc0[_0xaca4('0x1d')]],'as':_0xf14fc0['as'],'attributes':_0xf14fc0[_0xaca4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xaca4('0xb')](function(_0x8b1092){logger[_0xaca4('0xc')]('ShowDeskAccount',_0x17a30e);logger[_0xaca4('0xf')](_0xaca4('0x1f'),_0x17a30e,JSON[_0xaca4('0x10')](_0x8b1092));_0xd9830c(_0x8b1092);})[_0xaca4('0x15')](function(_0x2b9122){logger[_0xaca4('0x11')](_0xaca4('0x1f'),_0x2b9122[_0xaca4('0x13')],_0x17a30e);_0x1fa85a(_0x357207[_0xaca4('0x11')](0x1f4,_0x2b9122['message']));});});}; \ No newline at end of file +var _0x71ac=['options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowDeskAccount','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll'];(function(_0x538b27,_0x5af68f){var _0x4b4cc3=function(_0x4db032){while(--_0x4db032){_0x538b27['push'](_0x538b27['shift']());}};_0x4b4cc3(++_0x5af68f);}(_0x71ac,0x8f));var _0xc71a=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x71ac[_0x2053ea];return _0x2232c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc71a('0x0'));var rs=require(_0xc71a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc71a('0x2'))['db'];var utils=require(_0xc71a('0x3'));var logger=require(_0xc71a('0x4'))(_0xc71a('0x5'));var config=require(_0xc71a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc71a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1de592,_0x32ed61,_0x45f3fb){return new BPromise(function(_0x5d9d64,_0x1a1c6f){return client[_0xc71a('0x8')](_0x1de592,_0x45f3fb)[_0xc71a('0x9')](function(_0x5e23af){logger[_0xc71a('0xa')](_0xc71a('0xb'),_0x32ed61,_0xc71a('0xc'));logger['debug'](_0xc71a('0xd'),_0x32ed61,_0xc71a('0xc'),JSON['stringify'](_0x5e23af));if(_0x5e23af[_0xc71a('0xe')]){if(_0x5e23af['error'][_0xc71a('0xf')]===0x1f4){logger['error'](_0xc71a('0xb'),_0x32ed61,_0x5e23af['error'][_0xc71a('0x10')]);return _0x1a1c6f(_0x5e23af[_0xc71a('0xe')]['message']);}logger[_0xc71a('0xe')](_0xc71a('0xb'),_0x32ed61,_0x5e23af[_0xc71a('0xe')][_0xc71a('0x10')]);return _0x5d9d64(_0x5e23af['error'][_0xc71a('0x10')]);}else{logger[_0xc71a('0xa')](_0xc71a('0xb'),_0x32ed61,'request\x20sent');_0x5d9d64(_0x5e23af[_0xc71a('0x11')][_0xc71a('0x10')]);}})[_0xc71a('0x12')](function(_0x140dfc){logger[_0xc71a('0xe')](_0xc71a('0xb'),_0x32ed61,_0x140dfc);_0x1a1c6f(_0x140dfc);});});}exports[_0xc71a('0x13')]=function(_0x284440){var _0x29e7b8=this;return new Promise(function(_0x5efa7d,_0xbaecf3){return db[_0xc71a('0x14')][_0xc71a('0x15')]({'raw':_0x284440['options']?_0x284440[_0xc71a('0x16')][_0xc71a('0x17')]===undefined?!![]:![]:!![],'where':_0x284440[_0xc71a('0x16')]?_0x284440[_0xc71a('0x16')][_0xc71a('0x18')]||null:null,'attributes':_0x284440[_0xc71a('0x16')]?_0x284440[_0xc71a('0x16')][_0xc71a('0x19')]||null:null,'limit':_0x284440[_0xc71a('0x16')]?_0x284440['options'][_0xc71a('0x1a')]||null:null,'include':_0x284440[_0xc71a('0x16')]?_0x284440[_0xc71a('0x16')][_0xc71a('0x1b')]?_['map'](_0x284440[_0xc71a('0x16')][_0xc71a('0x1b')],function(_0x5d67c7){return{'model':db[_0x5d67c7['model']],'as':_0x5d67c7['as'],'attributes':_0x5d67c7[_0xc71a('0x19')],'include':_0x5d67c7[_0xc71a('0x1b')]?_[_0xc71a('0x1c')](_0x5d67c7[_0xc71a('0x1b')],function(_0x4ead4f){return{'model':db[_0x4ead4f[_0xc71a('0x1d')]],'as':_0x4ead4f['as'],'attributes':_0x4ead4f[_0xc71a('0x19')],'include':_0x4ead4f[_0xc71a('0x1b')]?_[_0xc71a('0x1c')](_0x4ead4f[_0xc71a('0x1b')],function(_0x530c06){return{'model':db[_0x530c06['model']],'as':_0x530c06['as'],'attributes':_0x530c06['attributes']};}):[]};}):[]};}):[]:[]})[_0xc71a('0x9')](function(_0x2e86c4){logger['info'](_0xc71a('0x13'),_0x284440);logger[_0xc71a('0x1e')](_0xc71a('0x13'),_0x284440,JSON[_0xc71a('0x1f')](_0x2e86c4));_0x5efa7d(_0x2e86c4);})[_0xc71a('0x12')](function(_0x1f4b79){logger[_0xc71a('0xe')](_0xc71a('0x13'),_0x1f4b79['message'],_0x284440);_0xbaecf3(_0x29e7b8[_0xc71a('0xe')](0x1f4,_0x1f4b79[_0xc71a('0x10')]));});});};exports[_0xc71a('0x20')]=function(_0x8f3299){var _0x397c2c=this;return new Promise(function(_0x36fe13,_0x783fe4){return db[_0xc71a('0x14')]['find']({'raw':_0x8f3299[_0xc71a('0x16')]?_0x8f3299[_0xc71a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x8f3299[_0xc71a('0x16')]?_0x8f3299[_0xc71a('0x16')][_0xc71a('0x18')]||null:null,'attributes':_0x8f3299[_0xc71a('0x16')]?_0x8f3299['options'][_0xc71a('0x19')]||null:null,'include':_0x8f3299[_0xc71a('0x16')]?_0x8f3299[_0xc71a('0x16')][_0xc71a('0x1b')]?_['map'](_0x8f3299[_0xc71a('0x16')][_0xc71a('0x1b')],function(_0x2883ea){return{'model':db[_0x2883ea['model']],'as':_0x2883ea['as'],'attributes':_0x2883ea[_0xc71a('0x19')],'include':_0x2883ea[_0xc71a('0x1b')]?_[_0xc71a('0x1c')](_0x2883ea[_0xc71a('0x1b')],function(_0x1bffa5){return{'model':db[_0x1bffa5['model']],'as':_0x1bffa5['as'],'attributes':_0x1bffa5['attributes'],'include':_0x1bffa5[_0xc71a('0x1b')]?_[_0xc71a('0x1c')](_0x1bffa5[_0xc71a('0x1b')],function(_0x1c8858){return{'model':db[_0x1c8858[_0xc71a('0x1d')]],'as':_0x1c8858['as'],'attributes':_0x1c8858[_0xc71a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3241ee){logger[_0xc71a('0xa')](_0xc71a('0x20'),_0x8f3299);logger[_0xc71a('0x1e')](_0xc71a('0x20'),_0x8f3299,JSON['stringify'](_0x3241ee));_0x36fe13(_0x3241ee);})[_0xc71a('0x12')](function(_0x557710){logger['error'](_0xc71a('0x20'),_0x557710['message'],_0x8f3299);_0x783fe4(_0x397c2c[_0xc71a('0xe')](0x1f4,_0x557710['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 1dac50f..d63f906 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0xf34b0a,_0x11e116){var _0x5021e1=function(_0x4eff67){while(--_0x4eff67){_0xf34b0a['push'](_0xf34b0a['shift']());}};_0x5021e1(++_0x11e116);}(_0x55ca,0x126));var _0xa55c=function(_0x5cb4f0,_0xb16665){_0x5cb4f0=_0x5cb4f0-0x0;var _0x22208=_0x55ca[_0x5cb4f0];return _0x22208;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x58b2a,_0x128376){var _0x4e4495=function(_0x527109){while(--_0x527109){_0x58b2a['push'](_0x58b2a['shift']());}};_0x4e4495(++_0x128376);}(_0xedd9,0xfc));var _0x9edd=function(_0x789604,_0x1a336e){_0x789604=_0x789604-0x0;var _0x5c32c3=_0xedd9[_0x789604];return _0x5c32c3;};'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['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 7d38d8b..4b8a61b 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 _0xea8b=['STRING','sequelize'];(function(_0x6dd861,_0x114776){var _0x4595f6=function(_0x2550b5){while(--_0x2550b5){_0x6dd861['push'](_0x6dd861['shift']());}};_0x4595f6(++_0x114776);}(_0xea8b,0x193));var _0xbea8=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xea8b[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0xbea8('0x0'));module['exports']={'name':{'type':Sequelize[_0xbea8('0x1')]},'description':{'type':Sequelize[_0xbea8('0x1')]}}; \ No newline at end of file +var _0x1026=['STRING','sequelize','exports'];(function(_0x35defc,_0x29d28a){var _0x38da7c=function(_0x21522a){while(--_0x21522a){_0x35defc['push'](_0x35defc['shift']());}};_0x38da7c(++_0x29d28a);}(_0x1026,0x19f));var _0x6102=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x1026[_0x454e6d];return _0x4bc294;};'use strict';var Sequelize=require(_0x6102('0x0'));module[_0x6102('0x1')]={'name':{'type':Sequelize[_0x6102('0x2')]},'description':{'type':Sequelize[_0x6102('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index b58de4e..e3f22e2 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 _0xd714=['api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','DeskConfiguration','fieldName','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','length','find','create','body','findOne','DeskField','getFields','nolimit','getSubjects','order','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xd714,0x93));var _0x4d71=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0xd714[_0x296754];return _0x1d9f1d;};'use strict';var emlformat=require(_0x4d71('0x0'));var rimraf=require(_0x4d71('0x1'));var zipdir=require(_0x4d71('0x2'));var jsonpatch=require(_0x4d71('0x3'));var rp=require(_0x4d71('0x4'));var moment=require(_0x4d71('0x5'));var BPromise=require(_0x4d71('0x6'));var Mustache=require(_0x4d71('0x7'));var util=require(_0x4d71('0x8'));var path=require(_0x4d71('0x9'));var sox=require(_0x4d71('0xa'));var csv=require(_0x4d71('0xb'));var ejs=require(_0x4d71('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d71('0xd'));var squel=require(_0x4d71('0xe'));var crypto=require(_0x4d71('0xf'));var jsforce=require(_0x4d71('0x10'));var deskjs=require(_0x4d71('0x11'));var toCsv=require('to-csv');var querystring=require(_0x4d71('0x12'));var Papa=require(_0x4d71('0x13'));var Redis=require(_0x4d71('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x4d71('0x15'));var as=require(_0x4d71('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4d71('0x17'));var utils=require(_0x4d71('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4d71('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3746e9,_0x4119ed){_0x4119ed=_0x4119ed||0xcc;return function(_0x5626ed){if(_0x5626ed){return _0x3746e9[_0x4d71('0x1a')](_0x4119ed);}return _0x3746e9[_0x4d71('0x1b')](_0x4119ed)['end']();};}function respondWithResult(_0x3f010f,_0x1bcace){_0x1bcace=_0x1bcace||0xc8;return function(_0x2f12eb){if(_0x2f12eb){return _0x3f010f['status'](_0x1bcace)[_0x4d71('0x1c')](_0x2f12eb);}};}function respondWithFilteredResult(_0x475948,_0x1d891f){return function(_0x1f2736){if(_0x1f2736){var _0x3ec095=typeof _0x1d891f[_0x4d71('0x1d')]===_0x4d71('0x1e')&&typeof _0x1d891f['limit']===_0x4d71('0x1e');var _0x422d31=_0x1f2736[_0x4d71('0x1f')];var _0x24cc7c=_0x3ec095?0x0:_0x1d891f['offset'];var _0x2ae8ba=_0x3ec095?_0x1f2736[_0x4d71('0x1f')]:_0x1d891f[_0x4d71('0x1d')]+_0x1d891f[_0x4d71('0x20')];var _0x2b1f7c;if(_0x2ae8ba>=_0x422d31){_0x2ae8ba=_0x422d31;_0x2b1f7c=0xc8;}else{_0x2b1f7c=0xce;}_0x475948[_0x4d71('0x1b')](_0x2b1f7c);return _0x475948[_0x4d71('0x21')](_0x4d71('0x22'),_0x24cc7c+'-'+_0x2ae8ba+'/'+_0x422d31)['json'](_0x1f2736);}return null;};}function patchUpdates(_0x171e66){return function(_0x3e02e4){try{jsonpatch[_0x4d71('0x23')](_0x3e02e4,_0x171e66,!![]);}catch(_0x4e9ceb){return BPromise[_0x4d71('0x24')](_0x4e9ceb);}return _0x3e02e4[_0x4d71('0x25')]();};}function saveUpdates(_0xbd78ec,_0x188946){return function(_0x1d5ddd){if(_0x1d5ddd){return _0x1d5ddd[_0x4d71('0x26')](_0xbd78ec)['then'](function(_0x3c3136){return _0x3c3136;});}return null;};}function removeEntity(_0x334c48,_0x267afe){return function(_0x280f25){if(_0x280f25){return _0x280f25['destroy']()[_0x4d71('0x27')](function(){_0x334c48[_0x4d71('0x1b')](0xcc)[_0x4d71('0x28')]();});}};}function handleEntityNotFound(_0x20ba4d,_0x5af09b){return function(_0x825a1){if(!_0x825a1){_0x20ba4d[_0x4d71('0x1a')](0x194);}return _0x825a1;};}function handleError(_0x1405e1,_0x5c68da){_0x5c68da=_0x5c68da||0x1f4;return function(_0x177b06){logger[_0x4d71('0x29')](_0x177b06[_0x4d71('0x2a')]);if(_0x177b06[_0x4d71('0x2b')]){delete _0x177b06['name'];}_0x1405e1['status'](_0x5c68da)[_0x4d71('0x2c')](_0x177b06);};}exports[_0x4d71('0x2d')]=function(_0x2f325b,_0xd05635){var _0x45455c={},_0x2fe37f={},_0x1d9788={'count':0x0,'rows':[]};var _0x2fbd2f=_[_0x4d71('0x2e')](db[_0x4d71('0x2f')]['rawAttributes'],function(_0x3693ea){return{'name':_0x3693ea[_0x4d71('0x30')],'type':_0x3693ea[_0x4d71('0x31')]['key']};});_0x2fe37f['model']=_['map'](_0x2fbd2f,_0x4d71('0x2b'));_0x2fe37f[_0x4d71('0x32')]=_['keys'](_0x2f325b[_0x4d71('0x32')]);_0x2fe37f[_0x4d71('0x33')]=_[_0x4d71('0x34')](_0x2fe37f['model'],_0x2fe37f[_0x4d71('0x32')]);_0x45455c['attributes']=_[_0x4d71('0x34')](_0x2fe37f[_0x4d71('0x35')],qs['fields'](_0x2f325b[_0x4d71('0x32')][_0x4d71('0x36')]));_0x45455c['attributes']=_0x45455c['attributes']['length']?_0x45455c[_0x4d71('0x37')]:_0x2fe37f[_0x4d71('0x35')];if(!_0x2f325b[_0x4d71('0x32')][_0x4d71('0x38')]('nolimit')){_0x45455c['limit']=qs['limit'](_0x2f325b['query'][_0x4d71('0x20')]);_0x45455c[_0x4d71('0x1d')]=qs['offset'](_0x2f325b[_0x4d71('0x32')][_0x4d71('0x1d')]);}_0x45455c['order']=qs[_0x4d71('0x39')](_0x2f325b['query'][_0x4d71('0x39')]);_0x45455c[_0x4d71('0x3a')]=qs[_0x4d71('0x33')](_[_0x4d71('0x3b')](_0x2f325b[_0x4d71('0x32')],_0x2fe37f[_0x4d71('0x33')]),_0x2fbd2f);if(_0x2f325b[_0x4d71('0x32')][_0x4d71('0x3c')]){_0x45455c[_0x4d71('0x3a')]=_['merge'](_0x45455c['where'],{'$or':_[_0x4d71('0x2e')](_0x2fbd2f,function(_0x47bebc){if(_0x47bebc[_0x4d71('0x31')]!=='VIRTUAL'){var _0x380a15={};_0x380a15[_0x47bebc[_0x4d71('0x2b')]]={'$like':'%'+_0x2f325b[_0x4d71('0x32')][_0x4d71('0x3c')]+'%'};return _0x380a15;}})});}_0x45455c=_[_0x4d71('0x3d')]({},_0x45455c,_0x2f325b[_0x4d71('0x3e')]);var _0x685379={'where':_0x45455c[_0x4d71('0x3a')]};return db[_0x4d71('0x2f')][_0x4d71('0x1f')](_0x685379)[_0x4d71('0x27')](function(_0x36d0e1){_0x1d9788[_0x4d71('0x1f')]=_0x36d0e1;if(_0x2f325b['query'][_0x4d71('0x3f')]){_0x45455c[_0x4d71('0x40')]=[{'all':!![]}];}return db[_0x4d71('0x2f')][_0x4d71('0x41')](_0x45455c);})[_0x4d71('0x27')](function(_0x27ea20){_0x1d9788['rows']=_0x27ea20;return _0x1d9788;})['then'](respondWithFilteredResult(_0xd05635,_0x45455c))[_0x4d71('0x42')](handleError(_0xd05635,null));};exports[_0x4d71('0x43')]=function(_0x3b2b55,_0xbc3e6b){var _0xb4deb4={'raw':![],'where':{'id':_0x3b2b55[_0x4d71('0x44')]['id']}},_0x46c3d7={};_0x46c3d7[_0x4d71('0x35')]=_['keys'](db[_0x4d71('0x2f')][_0x4d71('0x45')]);_0x46c3d7[_0x4d71('0x32')]=_[_0x4d71('0x46')](_0x3b2b55[_0x4d71('0x32')]);_0x46c3d7[_0x4d71('0x33')]=_['intersection'](_0x46c3d7[_0x4d71('0x35')],_0x46c3d7[_0x4d71('0x32')]);_0xb4deb4[_0x4d71('0x37')]=_[_0x4d71('0x34')](_0x46c3d7['model'],qs[_0x4d71('0x36')](_0x3b2b55[_0x4d71('0x32')]['fields']));_0xb4deb4['attributes']=_0xb4deb4[_0x4d71('0x37')][_0x4d71('0x47')]?_0xb4deb4['attributes']:_0x46c3d7[_0x4d71('0x35')];if(_0x3b2b55['query']['includeAll']){_0xb4deb4[_0x4d71('0x40')]=[{'all':!![]}];}_0xb4deb4=_[_0x4d71('0x3d')]({},_0xb4deb4,_0x3b2b55['options']);return db[_0x4d71('0x2f')][_0x4d71('0x48')](_0xb4deb4)[_0x4d71('0x27')](handleEntityNotFound(_0xbc3e6b,null))[_0x4d71('0x27')](respondWithResult(_0xbc3e6b,null))[_0x4d71('0x42')](handleError(_0xbc3e6b,null));};exports['create']=function(_0x5061d2,_0x2a8180){return db[_0x4d71('0x2f')][_0x4d71('0x49')](_0x5061d2[_0x4d71('0x4a')],{})['then'](respondWithResult(_0x2a8180,0xc9))[_0x4d71('0x42')](handleError(_0x2a8180,null));};exports['update']=function(_0x54741e,_0x419763){if(_0x54741e[_0x4d71('0x4a')]['id']){delete _0x54741e[_0x4d71('0x4a')]['id'];}return db['DeskConfiguration'][_0x4d71('0x48')]({'where':{'id':_0x54741e[_0x4d71('0x44')]['id']}})['then'](handleEntityNotFound(_0x419763,null))['then'](saveUpdates(_0x54741e['body'],null))[_0x4d71('0x27')](respondWithResult(_0x419763,null))[_0x4d71('0x42')](handleError(_0x419763,null));};exports['destroy']=function(_0xeb1f54,_0x1b3935){return db[_0x4d71('0x2f')][_0x4d71('0x48')]({'where':{'id':_0xeb1f54[_0x4d71('0x44')]['id']}})[_0x4d71('0x27')](handleEntityNotFound(_0x1b3935,null))[_0x4d71('0x27')](removeEntity(_0x1b3935,null))[_0x4d71('0x42')](handleError(_0x1b3935,null));};exports['getFields']=function(_0x102ca3,_0x6fdf7e,_0x4276f2){var _0x1ea7b2={};var _0x1f3c69={};var _0x3d7ecd;var _0x5d1b11;return db[_0x4d71('0x2f')][_0x4d71('0x4b')]({'where':{'id':_0x102ca3['params']['id']}})[_0x4d71('0x27')](handleEntityNotFound(_0x6fdf7e,null))['then'](function(_0x5087a8){if(_0x5087a8){_0x3d7ecd=_0x5087a8;_0x1f3c69[_0x4d71('0x35')]=_['keys'](db[_0x4d71('0x4c')][_0x4d71('0x45')]);_0x1f3c69[_0x4d71('0x32')]=_[_0x4d71('0x46')](_0x102ca3[_0x4d71('0x32')]);_0x1f3c69[_0x4d71('0x33')]=_[_0x4d71('0x34')](_0x1f3c69[_0x4d71('0x35')],_0x1f3c69[_0x4d71('0x32')]);_0x1ea7b2[_0x4d71('0x37')]=_['intersection'](_0x1f3c69[_0x4d71('0x35')],qs[_0x4d71('0x36')](_0x102ca3[_0x4d71('0x32')][_0x4d71('0x36')]));_0x1ea7b2[_0x4d71('0x37')]=_0x1ea7b2[_0x4d71('0x37')][_0x4d71('0x47')]?_0x1ea7b2[_0x4d71('0x37')]:_0x1f3c69[_0x4d71('0x35')];_0x1ea7b2['order']=qs[_0x4d71('0x39')](_0x102ca3[_0x4d71('0x32')][_0x4d71('0x39')]);_0x1ea7b2['where']=qs[_0x4d71('0x33')](_[_0x4d71('0x3b')](_0x102ca3[_0x4d71('0x32')],_0x1f3c69[_0x4d71('0x33')]));if(_0x102ca3['query'][_0x4d71('0x3c')]){_0x1ea7b2['where']=_[_0x4d71('0x3d')](_0x1ea7b2[_0x4d71('0x3a')],{'$or':_[_0x4d71('0x2e')](_0x1ea7b2['attributes'],function(_0x24da4b){var _0x4074bd={};_0x4074bd[_0x24da4b]={'$like':'%'+_0x102ca3[_0x4d71('0x32')][_0x4d71('0x3c')]+'%'};return _0x4074bd;})});}_0x1ea7b2=_[_0x4d71('0x3d')]({},_0x1ea7b2,_0x102ca3[_0x4d71('0x3e')]);return _0x3d7ecd[_0x4d71('0x4d')](_0x1ea7b2);}})[_0x4d71('0x27')](function(_0x3b4129){if(_0x3b4129){_0x5d1b11=_0x3b4129['length'];if(!_0x102ca3['query'][_0x4d71('0x38')](_0x4d71('0x4e'))){_0x1ea7b2['limit']=qs[_0x4d71('0x20')](_0x102ca3[_0x4d71('0x32')][_0x4d71('0x20')]);_0x1ea7b2[_0x4d71('0x1d')]=qs[_0x4d71('0x1d')](_0x102ca3[_0x4d71('0x32')][_0x4d71('0x1d')]);}return _0x3d7ecd[_0x4d71('0x4d')](_0x1ea7b2);}})[_0x4d71('0x27')](function(_0x492258){if(_0x492258){return _0x492258?{'count':_0x5d1b11,'rows':_0x492258}:null;}})[_0x4d71('0x27')](respondWithResult(_0x6fdf7e,null))[_0x4d71('0x42')](handleError(_0x6fdf7e,null));};exports[_0x4d71('0x4f')]=function(_0xeda05f,_0x2c456b,_0x54aa90){var _0x2dc87a={};var _0x33771c={};var _0x1e8001;var _0x4930dc;return db[_0x4d71('0x2f')][_0x4d71('0x4b')]({'where':{'id':_0xeda05f['params']['id']}})[_0x4d71('0x27')](handleEntityNotFound(_0x2c456b,null))[_0x4d71('0x27')](function(_0x9f2f5d){if(_0x9f2f5d){_0x1e8001=_0x9f2f5d;_0x33771c['model']=_['keys'](db[_0x4d71('0x4c')][_0x4d71('0x45')]);_0x33771c['query']=_['keys'](_0xeda05f['query']);_0x33771c['filters']=_[_0x4d71('0x34')](_0x33771c['model'],_0x33771c[_0x4d71('0x32')]);_0x2dc87a[_0x4d71('0x37')]=_[_0x4d71('0x34')](_0x33771c[_0x4d71('0x35')],qs[_0x4d71('0x36')](_0xeda05f[_0x4d71('0x32')][_0x4d71('0x36')]));_0x2dc87a[_0x4d71('0x37')]=_0x2dc87a[_0x4d71('0x37')]['length']?_0x2dc87a[_0x4d71('0x37')]:_0x33771c[_0x4d71('0x35')];_0x2dc87a[_0x4d71('0x50')]=qs['sort'](_0xeda05f['query']['sort']);_0x2dc87a[_0x4d71('0x3a')]=qs[_0x4d71('0x33')](_[_0x4d71('0x3b')](_0xeda05f[_0x4d71('0x32')],_0x33771c[_0x4d71('0x33')]));if(_0xeda05f[_0x4d71('0x32')][_0x4d71('0x3c')]){_0x2dc87a['where']=_['merge'](_0x2dc87a[_0x4d71('0x3a')],{'$or':_[_0x4d71('0x2e')](_0x2dc87a[_0x4d71('0x37')],function(_0x4c4705){var _0x22aca5={};_0x22aca5[_0x4c4705]={'$like':'%'+_0xeda05f['query']['filter']+'%'};return _0x22aca5;})});}_0x2dc87a=_[_0x4d71('0x3d')]({},_0x2dc87a,_0xeda05f[_0x4d71('0x3e')]);return _0x1e8001['getSubjects'](_0x2dc87a);}})['then'](function(_0x4bc550){if(_0x4bc550){_0x4930dc=_0x4bc550[_0x4d71('0x47')];if(!_0xeda05f[_0x4d71('0x32')]['hasOwnProperty'](_0x4d71('0x4e'))){_0x2dc87a[_0x4d71('0x20')]=qs['limit'](_0xeda05f[_0x4d71('0x32')][_0x4d71('0x20')]);_0x2dc87a[_0x4d71('0x1d')]=qs[_0x4d71('0x1d')](_0xeda05f[_0x4d71('0x32')][_0x4d71('0x1d')]);}return _0x1e8001[_0x4d71('0x4f')](_0x2dc87a);}})[_0x4d71('0x27')](function(_0x1ec929){if(_0x1ec929){return _0x1ec929?{'count':_0x4930dc,'rows':_0x1ec929}:null;}})[_0x4d71('0x27')](respondWithResult(_0x2c456b,null))['catch'](handleError(_0x2c456b,null));};exports[_0x4d71('0x51')]=function(_0x3cd5b9,_0x16b363,_0x246c67){var _0x202a12={};var _0x561738={};var _0x1bb230;var _0x323bf9;return db['DeskConfiguration'][_0x4d71('0x4b')]({'where':{'id':_0x3cd5b9[_0x4d71('0x44')]['id']}})[_0x4d71('0x27')](handleEntityNotFound(_0x16b363,null))[_0x4d71('0x27')](function(_0x30a881){if(_0x30a881){_0x1bb230=_0x30a881;_0x561738[_0x4d71('0x35')]=_[_0x4d71('0x46')](db[_0x4d71('0x4c')][_0x4d71('0x45')]);_0x561738[_0x4d71('0x32')]=_[_0x4d71('0x46')](_0x3cd5b9['query']);_0x561738['filters']=_['intersection'](_0x561738[_0x4d71('0x35')],_0x561738[_0x4d71('0x32')]);_0x202a12['attributes']=_['intersection'](_0x561738[_0x4d71('0x35')],qs[_0x4d71('0x36')](_0x3cd5b9[_0x4d71('0x32')][_0x4d71('0x36')]));_0x202a12[_0x4d71('0x37')]=_0x202a12[_0x4d71('0x37')][_0x4d71('0x47')]?_0x202a12[_0x4d71('0x37')]:_0x561738[_0x4d71('0x35')];_0x202a12['order']=qs[_0x4d71('0x39')](_0x3cd5b9[_0x4d71('0x32')][_0x4d71('0x39')]);_0x202a12['where']=qs[_0x4d71('0x33')](_[_0x4d71('0x3b')](_0x3cd5b9['query'],_0x561738[_0x4d71('0x33')]));if(_0x3cd5b9[_0x4d71('0x32')]['filter']){_0x202a12['where']=_['merge'](_0x202a12[_0x4d71('0x3a')],{'$or':_[_0x4d71('0x2e')](_0x202a12['attributes'],function(_0x2185b7){var _0x52e3f6={};_0x52e3f6[_0x2185b7]={'$like':'%'+_0x3cd5b9[_0x4d71('0x32')]['filter']+'%'};return _0x52e3f6;})});}_0x202a12=_[_0x4d71('0x3d')]({},_0x202a12,_0x3cd5b9[_0x4d71('0x3e')]);return _0x1bb230[_0x4d71('0x51')](_0x202a12);}})[_0x4d71('0x27')](function(_0x55e51d){if(_0x55e51d){_0x323bf9=_0x55e51d['length'];if(!_0x3cd5b9[_0x4d71('0x32')][_0x4d71('0x38')](_0x4d71('0x4e'))){_0x202a12[_0x4d71('0x20')]=qs[_0x4d71('0x20')](_0x3cd5b9[_0x4d71('0x32')][_0x4d71('0x20')]);_0x202a12[_0x4d71('0x1d')]=qs[_0x4d71('0x1d')](_0x3cd5b9[_0x4d71('0x32')]['offset']);}return _0x1bb230['getDescriptions'](_0x202a12);}})[_0x4d71('0x27')](function(_0x52d29c){if(_0x52d29c){return _0x52d29c?{'count':_0x323bf9,'rows':_0x52d29c}:null;}})[_0x4d71('0x27')](respondWithResult(_0x16b363,null))[_0x4d71('0x42')](handleError(_0x16b363,null));};exports[_0x4d71('0x52')]=function(_0x1631c4,_0xa6be2c,_0xa34af8){var _0x3ab95f={};var _0x2a1a33={};var _0x3117b4;var _0x1e8669;return db[_0x4d71('0x2f')][_0x4d71('0x4b')]({'where':{'id':_0x1631c4['params']['id']}})[_0x4d71('0x27')](handleEntityNotFound(_0xa6be2c,null))[_0x4d71('0x27')](function(_0x2b7437){if(_0x2b7437){_0x3117b4=_0x2b7437;_0x2a1a33[_0x4d71('0x35')]=_[_0x4d71('0x46')](db[_0x4d71('0x53')][_0x4d71('0x45')]);_0x2a1a33['query']=_[_0x4d71('0x46')](_0x1631c4['query']);_0x2a1a33[_0x4d71('0x33')]=_[_0x4d71('0x34')](_0x2a1a33[_0x4d71('0x35')],_0x2a1a33[_0x4d71('0x32')]);_0x3ab95f['attributes']=_[_0x4d71('0x34')](_0x2a1a33['model'],qs['fields'](_0x1631c4[_0x4d71('0x32')][_0x4d71('0x36')]));_0x3ab95f['attributes']=_0x3ab95f[_0x4d71('0x37')][_0x4d71('0x47')]?_0x3ab95f[_0x4d71('0x37')]:_0x2a1a33['model'];_0x3ab95f[_0x4d71('0x50')]=qs[_0x4d71('0x39')](_0x1631c4[_0x4d71('0x32')][_0x4d71('0x39')]);_0x3ab95f[_0x4d71('0x3a')]=qs[_0x4d71('0x33')](_[_0x4d71('0x3b')](_0x1631c4[_0x4d71('0x32')],_0x2a1a33[_0x4d71('0x33')]));if(_0x1631c4[_0x4d71('0x32')][_0x4d71('0x3c')]){_0x3ab95f[_0x4d71('0x3a')]=_[_0x4d71('0x3d')](_0x3ab95f['where'],{'$or':_['map'](_0x3ab95f[_0x4d71('0x37')],function(_0x9d7ec6){var _0x69eea8={};_0x69eea8[_0x9d7ec6]={'$like':'%'+_0x1631c4[_0x4d71('0x32')][_0x4d71('0x3c')]+'%'};return _0x69eea8;})});}_0x3ab95f=_['merge']({},_0x3ab95f,_0x1631c4[_0x4d71('0x3e')]);return _0x3117b4[_0x4d71('0x52')](_0x3ab95f);}})[_0x4d71('0x27')](function(_0xfd220d){if(_0xfd220d){_0x1e8669=_0xfd220d[_0x4d71('0x47')];if(!_0x1631c4['query']['hasOwnProperty']('nolimit')){_0x3ab95f[_0x4d71('0x20')]=qs[_0x4d71('0x20')](_0x1631c4['query']['limit']);_0x3ab95f[_0x4d71('0x1d')]=qs[_0x4d71('0x1d')](_0x1631c4['query']['offset']);}return _0x3117b4[_0x4d71('0x52')](_0x3ab95f);}})['then'](function(_0x16b0c5){if(_0x16b0c5){return _0x16b0c5?{'count':_0x1e8669,'rows':_0x16b0c5}:null;}})[_0x4d71('0x27')](respondWithResult(_0xa6be2c,null))[_0x4d71('0x42')](handleError(_0xa6be2c,null));};exports[_0x4d71('0x54')]=function(_0x3f7e26,_0x1aa914,_0x2eb7ff){if(_0x3f7e26[_0x4d71('0x4a')]['id']){delete _0x3f7e26[_0x4d71('0x4a')]['id'];}return db[_0x4d71('0x2f')][_0x4d71('0x4b')]({'where':{'id':_0x3f7e26[_0x4d71('0x44')]['id']}})[_0x4d71('0x27')](handleEntityNotFound(_0x1aa914,null))[_0x4d71('0x27')](function(_0x163308){if(_0x163308){return _0x163308['setTags'](_0x3f7e26['body']['ids']||[]);}return null;})[_0x4d71('0x27')](respondWithResult(_0x1aa914,null))[_0x4d71('0x42')](handleError(_0x1aa914,null));}; \ No newline at end of file +var _0x908c=['where','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','create','body','find','params','getFields','findOne','DeskField','order','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','pick','filter'];(function(_0x4057ea,_0x83c248){var _0x2f75ee=function(_0x4ee3a3){while(--_0x4ee3a3){_0x4057ea['push'](_0x4057ea['shift']());}};_0x2f75ee(++_0x83c248);}(_0x908c,0xc4));var _0xc908=function(_0x1a5689,_0x4920ea){_0x1a5689=_0x1a5689-0x0;var _0x1dbd8a=_0x908c[_0x1a5689];return _0x1dbd8a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc908('0x0'));var zipdir=require(_0xc908('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc908('0x2'));var moment=require(_0xc908('0x3'));var BPromise=require(_0xc908('0x4'));var Mustache=require('mustache');var util=require(_0xc908('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc908('0x6'));var ejs=require(_0xc908('0x7'));var fs=require('fs');var fs_extra=require(_0xc908('0x8'));var _=require(_0xc908('0x9'));var squel=require(_0xc908('0xa'));var crypto=require(_0xc908('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc908('0x6'));var querystring=require(_0xc908('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc908('0xd'));var as=require(_0xc908('0xe'));var hardwareService=require(_0xc908('0xf'));var logger=require(_0xc908('0x10'))('api');var utils=require(_0xc908('0x11'));var config=require(_0xc908('0x12'));var licenseUtil=require(_0xc908('0x13'));var db=require(_0xc908('0x14'))['db'];function respondWithStatusCode(_0x5151a3,_0x1b783d){_0x1b783d=_0x1b783d||0xcc;return function(_0x427859){if(_0x427859){return _0x5151a3['sendStatus'](_0x1b783d);}return _0x5151a3['status'](_0x1b783d)[_0xc908('0x15')]();};}function respondWithResult(_0xada5b7,_0x1aa2ce){_0x1aa2ce=_0x1aa2ce||0xc8;return function(_0x5dd323){if(_0x5dd323){return _0xada5b7[_0xc908('0x16')](_0x1aa2ce)['json'](_0x5dd323);}};}function respondWithFilteredResult(_0x4ebf2e,_0x170aa8){return function(_0x3cb9d1){if(_0x3cb9d1){var _0x52954e=typeof _0x170aa8[_0xc908('0x17')]===_0xc908('0x18')&&typeof _0x170aa8['limit']===_0xc908('0x18');var _0x24e788=_0x3cb9d1['count'];var _0x461b69=_0x52954e?0x0:_0x170aa8['offset'];var _0x529c5f=_0x52954e?_0x3cb9d1['count']:_0x170aa8[_0xc908('0x17')]+_0x170aa8['limit'];var _0x448ff;if(_0x529c5f>=_0x24e788){_0x529c5f=_0x24e788;_0x448ff=0xc8;}else{_0x448ff=0xce;}_0x4ebf2e[_0xc908('0x16')](_0x448ff);return _0x4ebf2e[_0xc908('0x19')](_0xc908('0x1a'),_0x461b69+'-'+_0x529c5f+'/'+_0x24e788)[_0xc908('0x1b')](_0x3cb9d1);}return null;};}function patchUpdates(_0xad1bef){return function(_0x3d5d92){try{jsonpatch[_0xc908('0x1c')](_0x3d5d92,_0xad1bef,!![]);}catch(_0x30a531){return BPromise[_0xc908('0x1d')](_0x30a531);}return _0x3d5d92[_0xc908('0x1e')]();};}function saveUpdates(_0x47c33a,_0x505a8c){return function(_0x2af27a){if(_0x2af27a){return _0x2af27a[_0xc908('0x1f')](_0x47c33a)['then'](function(_0x24027d){return _0x24027d;});}return null;};}function removeEntity(_0x263b4a,_0x13910c){return function(_0x5441dd){if(_0x5441dd){return _0x5441dd[_0xc908('0x20')]()[_0xc908('0x21')](function(){_0x263b4a[_0xc908('0x16')](0xcc)[_0xc908('0x15')]();});}};}function handleEntityNotFound(_0x2129e4,_0x18fbe7){return function(_0x28516c){if(!_0x28516c){_0x2129e4[_0xc908('0x22')](0x194);}return _0x28516c;};}function handleError(_0x4358fa,_0x3fafc4){_0x3fafc4=_0x3fafc4||0x1f4;return function(_0x5b1234){logger[_0xc908('0x23')](_0x5b1234[_0xc908('0x24')]);if(_0x5b1234[_0xc908('0x25')]){delete _0x5b1234['name'];}_0x4358fa[_0xc908('0x16')](_0x3fafc4)[_0xc908('0x26')](_0x5b1234);};}exports[_0xc908('0x27')]=function(_0x30eb71,_0x294f8b){var _0x19fad7={},_0x357870={},_0x5d6056={'count':0x0,'rows':[]};var _0x23c14e=_[_0xc908('0x28')](db[_0xc908('0x29')][_0xc908('0x2a')],function(_0x40b491){return{'name':_0x40b491[_0xc908('0x2b')],'type':_0x40b491[_0xc908('0x2c')][_0xc908('0x2d')]};});_0x357870[_0xc908('0x2e')]=_['map'](_0x23c14e,_0xc908('0x25'));_0x357870[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x30eb71[_0xc908('0x2f')]);_0x357870[_0xc908('0x31')]=_['intersection'](_0x357870[_0xc908('0x2e')],_0x357870[_0xc908('0x2f')]);_0x19fad7[_0xc908('0x32')]=_[_0xc908('0x33')](_0x357870[_0xc908('0x2e')],qs[_0xc908('0x34')](_0x30eb71[_0xc908('0x2f')]['fields']));_0x19fad7[_0xc908('0x32')]=_0x19fad7[_0xc908('0x32')][_0xc908('0x35')]?_0x19fad7['attributes']:_0x357870[_0xc908('0x2e')];if(!_0x30eb71['query'][_0xc908('0x36')]('nolimit')){_0x19fad7[_0xc908('0x37')]=qs['limit'](_0x30eb71['query']['limit']);_0x19fad7[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x30eb71[_0xc908('0x2f')][_0xc908('0x17')]);}_0x19fad7['order']=qs['sort'](_0x30eb71['query'][_0xc908('0x38')]);_0x19fad7['where']=qs[_0xc908('0x31')](_[_0xc908('0x39')](_0x30eb71[_0xc908('0x2f')],_0x357870[_0xc908('0x31')]),_0x23c14e);if(_0x30eb71[_0xc908('0x2f')][_0xc908('0x3a')]){_0x19fad7[_0xc908('0x3b')]=_[_0xc908('0x3c')](_0x19fad7[_0xc908('0x3b')],{'$or':_[_0xc908('0x28')](_0x23c14e,function(_0x194208){if(_0x194208[_0xc908('0x2c')]!==_0xc908('0x3d')){var _0x16582b={};_0x16582b[_0x194208[_0xc908('0x25')]]={'$like':'%'+_0x30eb71[_0xc908('0x2f')]['filter']+'%'};return _0x16582b;}})});}_0x19fad7=_[_0xc908('0x3c')]({},_0x19fad7,_0x30eb71[_0xc908('0x3e')]);var _0x4355d7={'where':_0x19fad7[_0xc908('0x3b')]};return db[_0xc908('0x29')]['count'](_0x4355d7)[_0xc908('0x21')](function(_0x5a8bf3){_0x5d6056[_0xc908('0x3f')]=_0x5a8bf3;if(_0x30eb71[_0xc908('0x2f')][_0xc908('0x40')]){_0x19fad7['include']=[{'all':!![]}];}return db[_0xc908('0x29')][_0xc908('0x41')](_0x19fad7);})[_0xc908('0x21')](function(_0x4436cb){_0x5d6056[_0xc908('0x42')]=_0x4436cb;return _0x5d6056;})[_0xc908('0x21')](respondWithFilteredResult(_0x294f8b,_0x19fad7))[_0xc908('0x43')](handleError(_0x294f8b,null));};exports[_0xc908('0x44')]=function(_0x49f5d0,_0x1620b1){var _0x3f4c9a={'raw':![],'where':{'id':_0x49f5d0['params']['id']}},_0x12af31={};_0x12af31[_0xc908('0x2e')]=_[_0xc908('0x30')](db[_0xc908('0x29')]['rawAttributes']);_0x12af31[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x49f5d0['query']);_0x12af31['filters']=_[_0xc908('0x33')](_0x12af31[_0xc908('0x2e')],_0x12af31['query']);_0x3f4c9a['attributes']=_[_0xc908('0x33')](_0x12af31[_0xc908('0x2e')],qs[_0xc908('0x34')](_0x49f5d0[_0xc908('0x2f')][_0xc908('0x34')]));_0x3f4c9a[_0xc908('0x32')]=_0x3f4c9a['attributes'][_0xc908('0x35')]?_0x3f4c9a[_0xc908('0x32')]:_0x12af31[_0xc908('0x2e')];if(_0x49f5d0[_0xc908('0x2f')][_0xc908('0x40')]){_0x3f4c9a[_0xc908('0x45')]=[{'all':!![]}];}_0x3f4c9a=_[_0xc908('0x3c')]({},_0x3f4c9a,_0x49f5d0['options']);return db['DeskConfiguration']['find'](_0x3f4c9a)[_0xc908('0x21')](handleEntityNotFound(_0x1620b1,null))[_0xc908('0x21')](respondWithResult(_0x1620b1,null))[_0xc908('0x43')](handleError(_0x1620b1,null));};exports[_0xc908('0x46')]=function(_0x4cbfa7,_0x579ca2){return db[_0xc908('0x29')][_0xc908('0x46')](_0x4cbfa7[_0xc908('0x47')],{})[_0xc908('0x21')](respondWithResult(_0x579ca2,0xc9))[_0xc908('0x43')](handleError(_0x579ca2,null));};exports['update']=function(_0x3c7065,_0x1ac56b){if(_0x3c7065[_0xc908('0x47')]['id']){delete _0x3c7065['body']['id'];}return db[_0xc908('0x29')][_0xc908('0x48')]({'where':{'id':_0x3c7065[_0xc908('0x49')]['id']}})[_0xc908('0x21')](handleEntityNotFound(_0x1ac56b,null))[_0xc908('0x21')](saveUpdates(_0x3c7065['body'],null))[_0xc908('0x21')](respondWithResult(_0x1ac56b,null))[_0xc908('0x43')](handleError(_0x1ac56b,null));};exports[_0xc908('0x20')]=function(_0x5ba486,_0x43c8ba){return db[_0xc908('0x29')][_0xc908('0x48')]({'where':{'id':_0x5ba486[_0xc908('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c8ba,null))[_0xc908('0x21')](removeEntity(_0x43c8ba,null))[_0xc908('0x43')](handleError(_0x43c8ba,null));};exports[_0xc908('0x4a')]=function(_0x394637,_0x4aa331,_0x2211b6){var _0x2c90a6={};var _0x36da55={};var _0xb5fb6f;var _0x42c62b;return db[_0xc908('0x29')][_0xc908('0x4b')]({'where':{'id':_0x394637[_0xc908('0x49')]['id']}})['then'](handleEntityNotFound(_0x4aa331,null))[_0xc908('0x21')](function(_0x56db1d){if(_0x56db1d){_0xb5fb6f=_0x56db1d;_0x36da55[_0xc908('0x2e')]=_['keys'](db[_0xc908('0x4c')][_0xc908('0x2a')]);_0x36da55[_0xc908('0x2f')]=_['keys'](_0x394637[_0xc908('0x2f')]);_0x36da55['filters']=_[_0xc908('0x33')](_0x36da55[_0xc908('0x2e')],_0x36da55['query']);_0x2c90a6[_0xc908('0x32')]=_[_0xc908('0x33')](_0x36da55['model'],qs['fields'](_0x394637[_0xc908('0x2f')][_0xc908('0x34')]));_0x2c90a6[_0xc908('0x32')]=_0x2c90a6[_0xc908('0x32')][_0xc908('0x35')]?_0x2c90a6[_0xc908('0x32')]:_0x36da55[_0xc908('0x2e')];_0x2c90a6[_0xc908('0x4d')]=qs[_0xc908('0x38')](_0x394637['query']['sort']);_0x2c90a6[_0xc908('0x3b')]=qs['filters'](_[_0xc908('0x39')](_0x394637[_0xc908('0x2f')],_0x36da55[_0xc908('0x31')]));if(_0x394637[_0xc908('0x2f')][_0xc908('0x3a')]){_0x2c90a6['where']=_['merge'](_0x2c90a6[_0xc908('0x3b')],{'$or':_[_0xc908('0x28')](_0x2c90a6[_0xc908('0x32')],function(_0x34751c){var _0x583563={};_0x583563[_0x34751c]={'$like':'%'+_0x394637[_0xc908('0x2f')]['filter']+'%'};return _0x583563;})});}_0x2c90a6=_['merge']({},_0x2c90a6,_0x394637[_0xc908('0x3e')]);return _0xb5fb6f['getFields'](_0x2c90a6);}})['then'](function(_0x559ce9){if(_0x559ce9){_0x42c62b=_0x559ce9[_0xc908('0x35')];if(!_0x394637[_0xc908('0x2f')][_0xc908('0x36')]('nolimit')){_0x2c90a6['limit']=qs['limit'](_0x394637[_0xc908('0x2f')][_0xc908('0x37')]);_0x2c90a6[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x394637['query'][_0xc908('0x17')]);}return _0xb5fb6f['getFields'](_0x2c90a6);}})[_0xc908('0x21')](function(_0xd35ffe){if(_0xd35ffe){return _0xd35ffe?{'count':_0x42c62b,'rows':_0xd35ffe}:null;}})[_0xc908('0x21')](respondWithResult(_0x4aa331,null))[_0xc908('0x43')](handleError(_0x4aa331,null));};exports[_0xc908('0x4e')]=function(_0x3e1f50,_0x3808a7,_0x286184){var _0x150ec3={};var _0x51d0a4={};var _0x25b4aa;var _0x3cad59;return db['DeskConfiguration'][_0xc908('0x4b')]({'where':{'id':_0x3e1f50['params']['id']}})['then'](handleEntityNotFound(_0x3808a7,null))[_0xc908('0x21')](function(_0x265d26){if(_0x265d26){_0x25b4aa=_0x265d26;_0x51d0a4[_0xc908('0x2e')]=_[_0xc908('0x30')](db[_0xc908('0x4c')][_0xc908('0x2a')]);_0x51d0a4[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x3e1f50['query']);_0x51d0a4[_0xc908('0x31')]=_[_0xc908('0x33')](_0x51d0a4['model'],_0x51d0a4[_0xc908('0x2f')]);_0x150ec3['attributes']=_[_0xc908('0x33')](_0x51d0a4[_0xc908('0x2e')],qs[_0xc908('0x34')](_0x3e1f50[_0xc908('0x2f')][_0xc908('0x34')]));_0x150ec3['attributes']=_0x150ec3[_0xc908('0x32')][_0xc908('0x35')]?_0x150ec3['attributes']:_0x51d0a4['model'];_0x150ec3[_0xc908('0x4d')]=qs[_0xc908('0x38')](_0x3e1f50['query']['sort']);_0x150ec3[_0xc908('0x3b')]=qs[_0xc908('0x31')](_['pick'](_0x3e1f50[_0xc908('0x2f')],_0x51d0a4[_0xc908('0x31')]));if(_0x3e1f50['query'][_0xc908('0x3a')]){_0x150ec3[_0xc908('0x3b')]=_[_0xc908('0x3c')](_0x150ec3[_0xc908('0x3b')],{'$or':_[_0xc908('0x28')](_0x150ec3[_0xc908('0x32')],function(_0x8006f8){var _0x45b776={};_0x45b776[_0x8006f8]={'$like':'%'+_0x3e1f50[_0xc908('0x2f')]['filter']+'%'};return _0x45b776;})});}_0x150ec3=_[_0xc908('0x3c')]({},_0x150ec3,_0x3e1f50[_0xc908('0x3e')]);return _0x25b4aa[_0xc908('0x4e')](_0x150ec3);}})[_0xc908('0x21')](function(_0x3090fa){if(_0x3090fa){_0x3cad59=_0x3090fa['length'];if(!_0x3e1f50[_0xc908('0x2f')]['hasOwnProperty'](_0xc908('0x4f'))){_0x150ec3['limit']=qs[_0xc908('0x37')](_0x3e1f50[_0xc908('0x2f')]['limit']);_0x150ec3[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x3e1f50[_0xc908('0x2f')][_0xc908('0x17')]);}return _0x25b4aa[_0xc908('0x4e')](_0x150ec3);}})[_0xc908('0x21')](function(_0x52b07b){if(_0x52b07b){return _0x52b07b?{'count':_0x3cad59,'rows':_0x52b07b}:null;}})[_0xc908('0x21')](respondWithResult(_0x3808a7,null))[_0xc908('0x43')](handleError(_0x3808a7,null));};exports[_0xc908('0x50')]=function(_0x321110,_0x377f49,_0xaa2083){var _0x1714ba={};var _0xd2468e={};var _0xe5a020;var _0x5db3d7;return db[_0xc908('0x29')][_0xc908('0x4b')]({'where':{'id':_0x321110[_0xc908('0x49')]['id']}})[_0xc908('0x21')](handleEntityNotFound(_0x377f49,null))[_0xc908('0x21')](function(_0x6fb1fd){if(_0x6fb1fd){_0xe5a020=_0x6fb1fd;_0xd2468e[_0xc908('0x2e')]=_[_0xc908('0x30')](db['DeskField'][_0xc908('0x2a')]);_0xd2468e[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x321110['query']);_0xd2468e['filters']=_['intersection'](_0xd2468e[_0xc908('0x2e')],_0xd2468e[_0xc908('0x2f')]);_0x1714ba[_0xc908('0x32')]=_[_0xc908('0x33')](_0xd2468e[_0xc908('0x2e')],qs[_0xc908('0x34')](_0x321110[_0xc908('0x2f')]['fields']));_0x1714ba['attributes']=_0x1714ba['attributes'][_0xc908('0x35')]?_0x1714ba[_0xc908('0x32')]:_0xd2468e[_0xc908('0x2e')];_0x1714ba[_0xc908('0x4d')]=qs[_0xc908('0x38')](_0x321110[_0xc908('0x2f')][_0xc908('0x38')]);_0x1714ba['where']=qs[_0xc908('0x31')](_['pick'](_0x321110[_0xc908('0x2f')],_0xd2468e['filters']));if(_0x321110[_0xc908('0x2f')][_0xc908('0x3a')]){_0x1714ba[_0xc908('0x3b')]=_[_0xc908('0x3c')](_0x1714ba['where'],{'$or':_['map'](_0x1714ba['attributes'],function(_0x29ae9a){var _0x492031={};_0x492031[_0x29ae9a]={'$like':'%'+_0x321110[_0xc908('0x2f')][_0xc908('0x3a')]+'%'};return _0x492031;})});}_0x1714ba=_[_0xc908('0x3c')]({},_0x1714ba,_0x321110['options']);return _0xe5a020[_0xc908('0x50')](_0x1714ba);}})[_0xc908('0x21')](function(_0x1df86e){if(_0x1df86e){_0x5db3d7=_0x1df86e['length'];if(!_0x321110[_0xc908('0x2f')][_0xc908('0x36')](_0xc908('0x4f'))){_0x1714ba[_0xc908('0x37')]=qs['limit'](_0x321110[_0xc908('0x2f')][_0xc908('0x37')]);_0x1714ba[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x321110[_0xc908('0x2f')][_0xc908('0x17')]);}return _0xe5a020[_0xc908('0x50')](_0x1714ba);}})['then'](function(_0x2d95f3){if(_0x2d95f3){return _0x2d95f3?{'count':_0x5db3d7,'rows':_0x2d95f3}:null;}})[_0xc908('0x21')](respondWithResult(_0x377f49,null))[_0xc908('0x43')](handleError(_0x377f49,null));};exports[_0xc908('0x51')]=function(_0x3af729,_0x22d7f0,_0x2eea5d){var _0x10397e={};var _0x4dc4fd={};var _0x26209b;var _0x33925e;return db[_0xc908('0x29')][_0xc908('0x4b')]({'where':{'id':_0x3af729['params']['id']}})[_0xc908('0x21')](handleEntityNotFound(_0x22d7f0,null))['then'](function(_0x4ff522){if(_0x4ff522){_0x26209b=_0x4ff522;_0x4dc4fd[_0xc908('0x2e')]=_[_0xc908('0x30')](db[_0xc908('0x52')][_0xc908('0x2a')]);_0x4dc4fd[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x3af729[_0xc908('0x2f')]);_0x4dc4fd[_0xc908('0x31')]=_[_0xc908('0x33')](_0x4dc4fd[_0xc908('0x2e')],_0x4dc4fd[_0xc908('0x2f')]);_0x10397e[_0xc908('0x32')]=_[_0xc908('0x33')](_0x4dc4fd['model'],qs[_0xc908('0x34')](_0x3af729[_0xc908('0x2f')][_0xc908('0x34')]));_0x10397e['attributes']=_0x10397e['attributes'][_0xc908('0x35')]?_0x10397e['attributes']:_0x4dc4fd[_0xc908('0x2e')];_0x10397e[_0xc908('0x4d')]=qs[_0xc908('0x38')](_0x3af729[_0xc908('0x2f')][_0xc908('0x38')]);_0x10397e['where']=qs['filters'](_[_0xc908('0x39')](_0x3af729['query'],_0x4dc4fd['filters']));if(_0x3af729['query'][_0xc908('0x3a')]){_0x10397e['where']=_[_0xc908('0x3c')](_0x10397e[_0xc908('0x3b')],{'$or':_[_0xc908('0x28')](_0x10397e[_0xc908('0x32')],function(_0x138bdf){var _0x3ae181={};_0x3ae181[_0x138bdf]={'$like':'%'+_0x3af729[_0xc908('0x2f')][_0xc908('0x3a')]+'%'};return _0x3ae181;})});}_0x10397e=_[_0xc908('0x3c')]({},_0x10397e,_0x3af729['options']);return _0x26209b[_0xc908('0x51')](_0x10397e);}})[_0xc908('0x21')](function(_0x34002e){if(_0x34002e){_0x33925e=_0x34002e['length'];if(!_0x3af729['query'][_0xc908('0x36')](_0xc908('0x4f'))){_0x10397e[_0xc908('0x37')]=qs[_0xc908('0x37')](_0x3af729['query']['limit']);_0x10397e[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x3af729[_0xc908('0x2f')][_0xc908('0x17')]);}return _0x26209b[_0xc908('0x51')](_0x10397e);}})[_0xc908('0x21')](function(_0x180981){if(_0x180981){return _0x180981?{'count':_0x33925e,'rows':_0x180981}:null;}})[_0xc908('0x21')](respondWithResult(_0x22d7f0,null))[_0xc908('0x43')](handleError(_0x22d7f0,null));};exports[_0xc908('0x53')]=function(_0x28bc21,_0x363d4a,_0x2a9be3){if(_0x28bc21['body']['id']){delete _0x28bc21['body']['id'];}return db['DeskConfiguration'][_0xc908('0x4b')]({'where':{'id':_0x28bc21['params']['id']}})[_0xc908('0x21')](handleEntityNotFound(_0x363d4a,null))[_0xc908('0x21')](function(_0x327e15){if(_0x327e15){return _0x327e15[_0xc908('0x53')](_0x28bc21[_0xc908('0x47')][_0xc908('0x54')]||[]);}return null;})[_0xc908('0x21')](respondWithResult(_0x363d4a,null))['catch'](handleError(_0x363d4a,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 4b6f159..903845b 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 _0x3773=['bluebird','path','rimraf','../../config/environment','define','DeskConfiguration','lodash','util','../../config/logger','moment'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x3773,0x92));var _0x3377=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x3773[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x3377('0x0'));var util=require(_0x3377('0x1'));var logger=require(_0x3377('0x2'))('api');var moment=require(_0x3377('0x3'));var BPromise=require(_0x3377('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3377('0x5'));var rimraf=require(_0x3377('0x6'));var config=require(_0x3377('0x7'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x5bd7dd,_0x443b6e){return _0x5bd7dd[_0x3377('0x8')](_0x3377('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x871b=['define','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x408706,_0x3a9d00){var _0x35cce9=function(_0xe3b21f){while(--_0xe3b21f){_0x408706['push'](_0x408706['shift']());}};_0x35cce9(++_0x3a9d00);}(_0x871b,0x77));var _0xb871=function(_0x51c3fe,_0x56b258){_0x51c3fe=_0x51c3fe-0x0;var _0x1cf67b=_0x871b[_0x51c3fe];return _0x1cf67b;};'use strict';var _=require(_0xb871('0x0'));var util=require(_0xb871('0x1'));var logger=require(_0xb871('0x2'))(_0xb871('0x3'));var moment=require(_0xb871('0x4'));var BPromise=require(_0xb871('0x5'));var rp=require(_0xb871('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb871('0x7'));var config=require(_0xb871('0x8'));var attributes=require(_0xb871('0x9'));module[_0xb871('0xa')]=function(_0x428c0c,_0x77a713){return _0x428c0c[_0xb871('0xb')]('DeskConfiguration',attributes,{'tableName':_0xb871('0xc'),'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 ce22905..e76b9e1 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 _0x80e4=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x4c0a7f,_0x3821e6){var _0x359351=function(_0x5511ca){while(--_0x5511ca){_0x4c0a7f['push'](_0x4c0a7f['shift']());}};_0x359351(++_0x3821e6);}(_0x80e4,0x103));var _0x480e=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0x80e4[_0x233cb1];return _0x29ee7e;};'use strict';var _=require(_0x480e('0x0'));var util=require(_0x480e('0x1'));var moment=require(_0x480e('0x2'));var BPromise=require('bluebird');var rs=require(_0x480e('0x3'));var fs=require('fs');var Redis=require(_0x480e('0x4'));var db=require(_0x480e('0x5'))['db'];var utils=require(_0x480e('0x6'));var logger=require(_0x480e('0x7'))('rpc');var config=require(_0x480e('0x8'));var jayson=require(_0x480e('0x9'));var client=jayson[_0x480e('0xa')][_0x480e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x318a8d,_0x251870,_0x27a40e){return new BPromise(function(_0x429246,_0x192ebe){return client[_0x480e('0xc')](_0x318a8d,_0x27a40e)[_0x480e('0xd')](function(_0x3a647a){logger['info'](_0x480e('0xe'),_0x251870,_0x480e('0xf'));logger[_0x480e('0x10')](_0x480e('0x11'),_0x251870,_0x480e('0xf'),JSON[_0x480e('0x12')](_0x3a647a));if(_0x3a647a['error']){if(_0x3a647a[_0x480e('0x13')][_0x480e('0x14')]===0x1f4){logger[_0x480e('0x13')](_0x480e('0xe'),_0x251870,_0x3a647a['error'][_0x480e('0x15')]);return _0x192ebe(_0x3a647a[_0x480e('0x13')][_0x480e('0x15')]);}logger[_0x480e('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x251870,_0x3a647a[_0x480e('0x13')]['message']);return _0x429246(_0x3a647a[_0x480e('0x13')][_0x480e('0x15')]);}else{logger[_0x480e('0x16')](_0x480e('0xe'),_0x251870,'request\x20sent');_0x429246(_0x3a647a[_0x480e('0x17')][_0x480e('0x15')]);}})[_0x480e('0x18')](function(_0xd1aa51){logger[_0x480e('0x13')](_0x480e('0xe'),_0x251870,_0xd1aa51);_0x192ebe(_0xd1aa51);});});} \ No newline at end of file +var _0x1678=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x1678,0x17b));var _0x8167=function(_0xd28266,_0x26a211){_0xd28266=_0xd28266-0x0;var _0x52559f=_0x1678[_0xd28266];return _0x52559f;};'use strict';var _=require(_0x8167('0x0'));var util=require(_0x8167('0x1'));var moment=require(_0x8167('0x2'));var BPromise=require(_0x8167('0x3'));var rs=require(_0x8167('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8167('0x5'));var logger=require(_0x8167('0x6'))(_0x8167('0x7'));var config=require(_0x8167('0x8'));var jayson=require(_0x8167('0x9'));var client=jayson[_0x8167('0xa')][_0x8167('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ce075,_0x34768e,_0x267746){return new BPromise(function(_0x1aab13,_0x58b220){return client['request'](_0x4ce075,_0x267746)[_0x8167('0xc')](function(_0x381a87){logger['info'](_0x8167('0xd'),_0x34768e,_0x8167('0xe'));logger[_0x8167('0xf')](_0x8167('0x10'),_0x34768e,_0x8167('0xe'),JSON[_0x8167('0x11')](_0x381a87));if(_0x381a87[_0x8167('0x12')]){if(_0x381a87['error']['code']===0x1f4){logger[_0x8167('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x34768e,_0x381a87[_0x8167('0x12')][_0x8167('0x13')]);return _0x58b220(_0x381a87[_0x8167('0x12')][_0x8167('0x13')]);}logger[_0x8167('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x34768e,_0x381a87[_0x8167('0x12')]['message']);return _0x1aab13(_0x381a87['error']['message']);}else{logger['info'](_0x8167('0xd'),_0x34768e,_0x8167('0xe'));_0x1aab13(_0x381a87[_0x8167('0x14')][_0x8167('0x13')]);}})[_0x8167('0x15')](function(_0x3927ad){logger[_0x8167('0x12')](_0x8167('0xd'),_0x34768e,_0x3927ad);_0x58b220(_0x3927ad);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index bb2ae1c..3734b7d 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 _0xbedc=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbedc,0x10a));var _0xcbed=function(_0x224092,_0x189e38){_0x224092=_0x224092-0x0;var _0x2f2b01=_0xbedc[_0x224092];return _0x2f2b01;};'use strict';var multer=require(_0xcbed('0x0'));var util=require(_0xcbed('0x1'));var path=require(_0xcbed('0x2'));var timeout=require(_0xcbed('0x3'));var express=require('express');var router=express[_0xcbed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcbed('0x5'));var interaction=require(_0xcbed('0x6'));var config=require(_0xcbed('0x7'));var controller=require(_0xcbed('0x8'));router[_0xcbed('0x9')]('/',auth[_0xcbed('0xa')](),controller[_0xcbed('0xb')]);router[_0xcbed('0x9')](_0xcbed('0xc'),auth[_0xcbed('0xa')](),controller[_0xcbed('0xd')]);router[_0xcbed('0xe')]('/',auth[_0xcbed('0xa')](),controller[_0xcbed('0xf')]);router[_0xcbed('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcbed('0x11')](_0xcbed('0xc'),auth[_0xcbed('0xa')](),controller['destroy']);module[_0xcbed('0x12')]=router; \ No newline at end of file +var _0x25a9=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','put'];(function(_0x4bff6b,_0xf1721e){var _0x423c5b=function(_0xe2401){while(--_0xe2401){_0x4bff6b['push'](_0x4bff6b['shift']());}};_0x423c5b(++_0xf1721e);}(_0x25a9,0xf1));var _0x925a=function(_0x3f4315,_0xd6ec89){_0x3f4315=_0x3f4315-0x0;var _0x5842e3=_0x25a9[_0x3f4315];return _0x5842e3;};'use strict';var multer=require('multer');var util=require(_0x925a('0x0'));var path=require(_0x925a('0x1'));var timeout=require(_0x925a('0x2'));var express=require(_0x925a('0x3'));var router=express[_0x925a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x925a('0x5'));var interaction=require(_0x925a('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x925a('0x7')]('/',auth['isAuthenticated'](),controller[_0x925a('0x8')]);router[_0x925a('0x7')](_0x925a('0x9'),auth[_0x925a('0xa')](),controller[_0x925a('0xb')]);router[_0x925a('0xc')]('/',auth[_0x925a('0xa')](),controller['create']);router[_0x925a('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x925a('0xe')]('/:id',auth[_0x925a('0xa')](),controller[_0x925a('0xf')]);module[_0x925a('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 ea6aa91..ca4387b 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 _0x3344=['ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize'];(function(_0x4e676a,_0x2a183e){var _0x5aa0a6=function(_0x7ad0c){while(--_0x7ad0c){_0x4e676a['push'](_0x4e676a['shift']());}};_0x5aa0a6(++_0x2a183e);}(_0x3344,0xd7));var _0x4334=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3344[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x4334('0x0'));module['exports']={'type':{'type':Sequelize[_0x4334('0x1')]('string',_0x4334('0x2'),_0x4334('0x3'),_0x4334('0x4'),'picklist'),'defaultValue':_0x4334('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4334('0x1')](_0x4334('0x5'),_0x4334('0x2'),_0x4334('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4334('0x6')]},'nameField':{'type':Sequelize[_0x4334('0x6')]},'customField':{'type':Sequelize[_0x4334('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4334('0x6')]}}; \ No newline at end of file +var _0x2614=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','sequelize'];(function(_0xbe7b54,_0x43273a){var _0x59d96e=function(_0x20cbad){while(--_0x20cbad){_0xbe7b54['push'](_0xbe7b54['shift']());}};_0x59d96e(++_0x43273a);}(_0x2614,0x143));var _0x4261=function(_0x6a7d1f,_0x543a2f){_0x6a7d1f=_0x6a7d1f-0x0;var _0x55a840=_0x2614[_0x6a7d1f];return _0x55a840;};'use strict';var Sequelize=require(_0x4261('0x0'));module[_0x4261('0x1')]={'type':{'type':Sequelize[_0x4261('0x2')]('string',_0x4261('0x3'),_0x4261('0x4'),_0x4261('0x5'),_0x4261('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4261('0x7')]},'key':{'type':Sequelize[_0x4261('0x7')]},'keyType':{'type':Sequelize[_0x4261('0x2')](_0x4261('0x8'),_0x4261('0x3'),_0x4261('0x4'))},'keyContent':{'type':Sequelize[_0x4261('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4261('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4261('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2c4c575..9401add 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 _0x39bd=['sendStatus','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','DeskField','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','params','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x39bd,0x7c));var _0xd39b=function(_0x3b0c12,_0x10c09b){_0x3b0c12=_0x3b0c12-0x0;var _0x10184d=_0x39bd[_0x3b0c12];return _0x10184d;};'use strict';var emlformat=require(_0xd39b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd39b('0x1'));var rp=require('request-promise');var moment=require(_0xd39b('0x2'));var BPromise=require(_0xd39b('0x3'));var Mustache=require(_0xd39b('0x4'));var util=require(_0xd39b('0x5'));var path=require(_0xd39b('0x6'));var sox=require(_0xd39b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd39b('0x8'));var _=require(_0xd39b('0x9'));var squel=require(_0xd39b('0xa'));var crypto=require(_0xd39b('0xb'));var jsforce=require(_0xd39b('0xc'));var deskjs=require(_0xd39b('0xd'));var toCsv=require(_0xd39b('0xe'));var querystring=require('querystring');var Papa=require(_0xd39b('0xf'));var Redis=require(_0xd39b('0x10'));var authService=require(_0xd39b('0x11'));var qs=require(_0xd39b('0x12'));var as=require(_0xd39b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd39b('0x14'))(_0xd39b('0x15'));var utils=require(_0xd39b('0x16'));var config=require(_0xd39b('0x17'));var licenseUtil=require(_0xd39b('0x18'));var db=require(_0xd39b('0x19'))['db'];function respondWithStatusCode(_0x1c41d6,_0x33ba97){_0x33ba97=_0x33ba97||0xcc;return function(_0x35c576){if(_0x35c576){return _0x1c41d6[_0xd39b('0x1a')](_0x33ba97);}return _0x1c41d6[_0xd39b('0x1b')](_0x33ba97)['end']();};}function respondWithResult(_0x51ade2,_0x4d12b9){_0x4d12b9=_0x4d12b9||0xc8;return function(_0x2af409){if(_0x2af409){return _0x51ade2['status'](_0x4d12b9)['json'](_0x2af409);}};}function respondWithFilteredResult(_0x55b3ba,_0x341d60){return function(_0x2def47){if(_0x2def47){var _0x13db19=typeof _0x341d60['offset']===_0xd39b('0x1c')&&typeof _0x341d60[_0xd39b('0x1d')]===_0xd39b('0x1c');var _0x3407d3=_0x2def47['count'];var _0x3921ad=_0x13db19?0x0:_0x341d60[_0xd39b('0x1e')];var _0x13d83c=_0x13db19?_0x2def47['count']:_0x341d60[_0xd39b('0x1e')]+_0x341d60['limit'];var _0x96732c;if(_0x13d83c>=_0x3407d3){_0x13d83c=_0x3407d3;_0x96732c=0xc8;}else{_0x96732c=0xce;}_0x55b3ba['status'](_0x96732c);return _0x55b3ba[_0xd39b('0x1f')](_0xd39b('0x20'),_0x3921ad+'-'+_0x13d83c+'/'+_0x3407d3)[_0xd39b('0x21')](_0x2def47);}return null;};}function patchUpdates(_0x995406){return function(_0x5a2cd6){try{jsonpatch[_0xd39b('0x22')](_0x5a2cd6,_0x995406,!![]);}catch(_0x5a0d5b){return BPromise[_0xd39b('0x23')](_0x5a0d5b);}return _0x5a2cd6[_0xd39b('0x24')]();};}function saveUpdates(_0x243657,_0x4d947c){return function(_0x21d108){if(_0x21d108){return _0x21d108[_0xd39b('0x25')](_0x243657)[_0xd39b('0x26')](function(_0x10950a){return _0x10950a;});}return null;};}function removeEntity(_0x5092ad,_0x1f3c93){return function(_0x5949bb){if(_0x5949bb){return _0x5949bb[_0xd39b('0x27')]()[_0xd39b('0x26')](function(){_0x5092ad[_0xd39b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a54a,_0x5d2ac5){return function(_0x240567){if(!_0x240567){_0x46a54a['sendStatus'](0x194);}return _0x240567;};}function handleError(_0x14c18c,_0x405558){_0x405558=_0x405558||0x1f4;return function(_0x2a2fc0){logger[_0xd39b('0x28')](_0x2a2fc0['stack']);if(_0x2a2fc0[_0xd39b('0x29')]){delete _0x2a2fc0[_0xd39b('0x29')];}_0x14c18c[_0xd39b('0x1b')](_0x405558)['send'](_0x2a2fc0);};}exports[_0xd39b('0x2a')]=function(_0x109eca,_0x3d1a41){var _0x3dff89={},_0x71270f={},_0x36cafd={'count':0x0,'rows':[]};var _0x272bfc=_[_0xd39b('0x2b')](db[_0xd39b('0x2c')][_0xd39b('0x2d')],function(_0x1d0f1b){return{'name':_0x1d0f1b[_0xd39b('0x2e')],'type':_0x1d0f1b['type'][_0xd39b('0x2f')]};});_0x71270f[_0xd39b('0x30')]=_['map'](_0x272bfc,_0xd39b('0x29'));_0x71270f['query']=_[_0xd39b('0x31')](_0x109eca[_0xd39b('0x32')]);_0x71270f[_0xd39b('0x33')]=_['intersection'](_0x71270f['model'],_0x71270f[_0xd39b('0x32')]);_0x3dff89[_0xd39b('0x34')]=_['intersection'](_0x71270f[_0xd39b('0x30')],qs[_0xd39b('0x35')](_0x109eca[_0xd39b('0x32')][_0xd39b('0x35')]));_0x3dff89['attributes']=_0x3dff89[_0xd39b('0x34')][_0xd39b('0x36')]?_0x3dff89['attributes']:_0x71270f['model'];if(!_0x109eca['query']['hasOwnProperty'](_0xd39b('0x37'))){_0x3dff89[_0xd39b('0x1d')]=qs[_0xd39b('0x1d')](_0x109eca[_0xd39b('0x32')][_0xd39b('0x1d')]);_0x3dff89[_0xd39b('0x1e')]=qs[_0xd39b('0x1e')](_0x109eca[_0xd39b('0x32')]['offset']);}_0x3dff89[_0xd39b('0x38')]=qs[_0xd39b('0x39')](_0x109eca[_0xd39b('0x32')]['sort']);_0x3dff89[_0xd39b('0x3a')]=qs[_0xd39b('0x33')](_['pick'](_0x109eca['query'],_0x71270f['filters']),_0x272bfc);if(_0x109eca['query'][_0xd39b('0x3b')]){_0x3dff89[_0xd39b('0x3a')]=_[_0xd39b('0x3c')](_0x3dff89[_0xd39b('0x3a')],{'$or':_[_0xd39b('0x2b')](_0x272bfc,function(_0x322f49){if(_0x322f49[_0xd39b('0x3d')]!==_0xd39b('0x3e')){var _0x533905={};_0x533905[_0x322f49[_0xd39b('0x29')]]={'$like':'%'+_0x109eca[_0xd39b('0x32')]['filter']+'%'};return _0x533905;}})});}_0x3dff89=_[_0xd39b('0x3c')]({},_0x3dff89,_0x109eca['options']);var _0x9cb3a6={'where':_0x3dff89[_0xd39b('0x3a')]};return db[_0xd39b('0x2c')][_0xd39b('0x3f')](_0x9cb3a6)['then'](function(_0x3a4567){_0x36cafd[_0xd39b('0x3f')]=_0x3a4567;if(_0x109eca[_0xd39b('0x32')][_0xd39b('0x40')]){_0x3dff89[_0xd39b('0x41')]=[{'all':!![]}];}return db[_0xd39b('0x2c')][_0xd39b('0x42')](_0x3dff89);})[_0xd39b('0x26')](function(_0xd083ad){_0x36cafd[_0xd39b('0x43')]=_0xd083ad;return _0x36cafd;})[_0xd39b('0x26')](respondWithFilteredResult(_0x3d1a41,_0x3dff89))['catch'](handleError(_0x3d1a41,null));};exports[_0xd39b('0x44')]=function(_0x2657f5,_0x487c75){var _0x35ab7f={'raw':!![],'where':{'id':_0x2657f5['params']['id']}},_0x49f112={};_0x49f112['model']=_['keys'](db[_0xd39b('0x2c')][_0xd39b('0x2d')]);_0x49f112[_0xd39b('0x32')]=_[_0xd39b('0x31')](_0x2657f5[_0xd39b('0x32')]);_0x49f112[_0xd39b('0x33')]=_[_0xd39b('0x45')](_0x49f112[_0xd39b('0x30')],_0x49f112[_0xd39b('0x32')]);_0x35ab7f[_0xd39b('0x34')]=_[_0xd39b('0x45')](_0x49f112[_0xd39b('0x30')],qs[_0xd39b('0x35')](_0x2657f5['query'][_0xd39b('0x35')]));_0x35ab7f[_0xd39b('0x34')]=_0x35ab7f[_0xd39b('0x34')][_0xd39b('0x36')]?_0x35ab7f[_0xd39b('0x34')]:_0x49f112[_0xd39b('0x30')];if(_0x2657f5[_0xd39b('0x32')][_0xd39b('0x40')]){_0x35ab7f[_0xd39b('0x41')]=[{'all':!![]}];}_0x35ab7f=_[_0xd39b('0x3c')]({},_0x35ab7f,_0x2657f5['options']);return db[_0xd39b('0x2c')][_0xd39b('0x46')](_0x35ab7f)[_0xd39b('0x26')](handleEntityNotFound(_0x487c75,null))[_0xd39b('0x26')](respondWithResult(_0x487c75,null))[_0xd39b('0x47')](handleError(_0x487c75,null));};exports[_0xd39b('0x48')]=function(_0x2f2db1,_0x189ba8){return db['DeskField'][_0xd39b('0x48')](_0x2f2db1[_0xd39b('0x49')],{})['then'](respondWithResult(_0x189ba8,0xc9))[_0xd39b('0x47')](handleError(_0x189ba8,null));};exports[_0xd39b('0x25')]=function(_0x14847a,_0x3288ed){if(_0x14847a[_0xd39b('0x49')]['id']){delete _0x14847a[_0xd39b('0x49')]['id'];}return db[_0xd39b('0x2c')][_0xd39b('0x46')]({'where':{'id':_0x14847a[_0xd39b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3288ed,null))[_0xd39b('0x26')](saveUpdates(_0x14847a[_0xd39b('0x49')],null))[_0xd39b('0x26')](respondWithResult(_0x3288ed,null))[_0xd39b('0x47')](handleError(_0x3288ed,null));};exports[_0xd39b('0x27')]=function(_0x12b532,_0x3a8d4c){return db[_0xd39b('0x2c')]['find']({'where':{'id':_0x12b532[_0xd39b('0x4a')]['id']}})[_0xd39b('0x26')](handleEntityNotFound(_0x3a8d4c,null))[_0xd39b('0x26')](removeEntity(_0x3a8d4c,null))[_0xd39b('0x47')](handleError(_0x3a8d4c,null));}; \ No newline at end of file +var _0x6003=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','keys','intersection','includeAll','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','type','model','query','filters','attributes','fields'];(function(_0x5b7a3f,_0x4ab8ad){var _0x164e85=function(_0x230aa4){while(--_0x230aa4){_0x5b7a3f['push'](_0x5b7a3f['shift']());}};_0x164e85(++_0x4ab8ad);}(_0x6003,0xae));var _0x3600=function(_0x28075c,_0x253aa2){_0x28075c=_0x28075c-0x0;var _0x44d99b=_0x6003[_0x28075c];return _0x44d99b;};'use strict';var emlformat=require(_0x3600('0x0'));var rimraf=require(_0x3600('0x1'));var zipdir=require(_0x3600('0x2'));var jsonpatch=require(_0x3600('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3600('0x4'));var Mustache=require(_0x3600('0x5'));var util=require(_0x3600('0x6'));var path=require('path');var sox=require(_0x3600('0x7'));var csv=require(_0x3600('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3600('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3600('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3600('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3600('0xc'));var Papa=require(_0x3600('0xd'));var Redis=require(_0x3600('0xe'));var authService=require(_0x3600('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3600('0x10'));var hardwareService=require(_0x3600('0x11'));var logger=require(_0x3600('0x12'))(_0x3600('0x13'));var utils=require(_0x3600('0x14'));var config=require(_0x3600('0x15'));var licenseUtil=require(_0x3600('0x16'));var db=require(_0x3600('0x17'))['db'];function respondWithStatusCode(_0x430281,_0x156265){_0x156265=_0x156265||0xcc;return function(_0x29cefd){if(_0x29cefd){return _0x430281[_0x3600('0x18')](_0x156265);}return _0x430281['status'](_0x156265)[_0x3600('0x19')]();};}function respondWithResult(_0x5704a0,_0x4faefa){_0x4faefa=_0x4faefa||0xc8;return function(_0x298f6d){if(_0x298f6d){return _0x5704a0[_0x3600('0x1a')](_0x4faefa)[_0x3600('0x1b')](_0x298f6d);}};}function respondWithFilteredResult(_0x4d40a1,_0xe9eb7c){return function(_0x486fbb){if(_0x486fbb){var _0x10bdd3=typeof _0xe9eb7c['offset']===_0x3600('0x1c')&&typeof _0xe9eb7c[_0x3600('0x1d')]===_0x3600('0x1c');var _0x533e79=_0x486fbb['count'];var _0x680b80=_0x10bdd3?0x0:_0xe9eb7c[_0x3600('0x1e')];var _0xcb98b5=_0x10bdd3?_0x486fbb[_0x3600('0x1f')]:_0xe9eb7c['offset']+_0xe9eb7c[_0x3600('0x1d')];var _0x4be7e2;if(_0xcb98b5>=_0x533e79){_0xcb98b5=_0x533e79;_0x4be7e2=0xc8;}else{_0x4be7e2=0xce;}_0x4d40a1[_0x3600('0x1a')](_0x4be7e2);return _0x4d40a1[_0x3600('0x20')](_0x3600('0x21'),_0x680b80+'-'+_0xcb98b5+'/'+_0x533e79)['json'](_0x486fbb);}return null;};}function patchUpdates(_0x8390c1){return function(_0x47a48e){try{jsonpatch[_0x3600('0x22')](_0x47a48e,_0x8390c1,!![]);}catch(_0x1414c6){return BPromise[_0x3600('0x23')](_0x1414c6);}return _0x47a48e[_0x3600('0x24')]();};}function saveUpdates(_0x29edc6,_0x47d58c){return function(_0x7e30a0){if(_0x7e30a0){return _0x7e30a0[_0x3600('0x25')](_0x29edc6)[_0x3600('0x26')](function(_0x708430){return _0x708430;});}return null;};}function removeEntity(_0x782224,_0x148155){return function(_0x1e5492){if(_0x1e5492){return _0x1e5492[_0x3600('0x27')]()[_0x3600('0x26')](function(){_0x782224[_0x3600('0x1a')](0xcc)[_0x3600('0x19')]();});}};}function handleEntityNotFound(_0x51bdb8,_0x2ad736){return function(_0x50a222){if(!_0x50a222){_0x51bdb8[_0x3600('0x18')](0x194);}return _0x50a222;};}function handleError(_0x532fe7,_0x35d6f3){_0x35d6f3=_0x35d6f3||0x1f4;return function(_0x1c6b74){logger[_0x3600('0x28')](_0x1c6b74[_0x3600('0x29')]);if(_0x1c6b74[_0x3600('0x2a')]){delete _0x1c6b74[_0x3600('0x2a')];}_0x532fe7['status'](_0x35d6f3)[_0x3600('0x2b')](_0x1c6b74);};}exports[_0x3600('0x2c')]=function(_0x5580b9,_0x3bfd60){var _0x8fc4c6={},_0x2854cd={},_0x861d1={'count':0x0,'rows':[]};var _0x3e3ce0=_[_0x3600('0x2d')](db[_0x3600('0x2e')][_0x3600('0x2f')],function(_0x516005){return{'name':_0x516005['fieldName'],'type':_0x516005[_0x3600('0x30')]['key']};});_0x2854cd[_0x3600('0x31')]=_[_0x3600('0x2d')](_0x3e3ce0,_0x3600('0x2a'));_0x2854cd['query']=_['keys'](_0x5580b9[_0x3600('0x32')]);_0x2854cd[_0x3600('0x33')]=_['intersection'](_0x2854cd[_0x3600('0x31')],_0x2854cd[_0x3600('0x32')]);_0x8fc4c6[_0x3600('0x34')]=_['intersection'](_0x2854cd[_0x3600('0x31')],qs[_0x3600('0x35')](_0x5580b9[_0x3600('0x32')][_0x3600('0x35')]));_0x8fc4c6[_0x3600('0x34')]=_0x8fc4c6[_0x3600('0x34')][_0x3600('0x36')]?_0x8fc4c6[_0x3600('0x34')]:_0x2854cd[_0x3600('0x31')];if(!_0x5580b9[_0x3600('0x32')][_0x3600('0x37')](_0x3600('0x38'))){_0x8fc4c6[_0x3600('0x1d')]=qs['limit'](_0x5580b9[_0x3600('0x32')]['limit']);_0x8fc4c6[_0x3600('0x1e')]=qs['offset'](_0x5580b9[_0x3600('0x32')]['offset']);}_0x8fc4c6[_0x3600('0x39')]=qs[_0x3600('0x3a')](_0x5580b9[_0x3600('0x32')][_0x3600('0x3a')]);_0x8fc4c6[_0x3600('0x3b')]=qs[_0x3600('0x33')](_[_0x3600('0x3c')](_0x5580b9[_0x3600('0x32')],_0x2854cd['filters']),_0x3e3ce0);if(_0x5580b9['query'][_0x3600('0x3d')]){_0x8fc4c6[_0x3600('0x3b')]=_[_0x3600('0x3e')](_0x8fc4c6['where'],{'$or':_[_0x3600('0x2d')](_0x3e3ce0,function(_0x511595){if(_0x511595[_0x3600('0x30')]!==_0x3600('0x3f')){var _0x4bd2be={};_0x4bd2be[_0x511595[_0x3600('0x2a')]]={'$like':'%'+_0x5580b9[_0x3600('0x32')][_0x3600('0x3d')]+'%'};return _0x4bd2be;}})});}_0x8fc4c6=_[_0x3600('0x3e')]({},_0x8fc4c6,_0x5580b9[_0x3600('0x40')]);var _0x3bd1e4={'where':_0x8fc4c6['where']};return db['DeskField'][_0x3600('0x1f')](_0x3bd1e4)[_0x3600('0x26')](function(_0x538d3c){_0x861d1['count']=_0x538d3c;if(_0x5580b9[_0x3600('0x32')]['includeAll']){_0x8fc4c6[_0x3600('0x41')]=[{'all':!![]}];}return db[_0x3600('0x2e')][_0x3600('0x42')](_0x8fc4c6);})[_0x3600('0x26')](function(_0x279fe5){_0x861d1['rows']=_0x279fe5;return _0x861d1;})['then'](respondWithFilteredResult(_0x3bfd60,_0x8fc4c6))['catch'](handleError(_0x3bfd60,null));};exports[_0x3600('0x43')]=function(_0x5a6365,_0x48c02b){var _0x289b76={'raw':!![],'where':{'id':_0x5a6365[_0x3600('0x44')]['id']}},_0x1040a4={};_0x1040a4[_0x3600('0x31')]=_[_0x3600('0x45')](db['DeskField'][_0x3600('0x2f')]);_0x1040a4[_0x3600('0x32')]=_[_0x3600('0x45')](_0x5a6365[_0x3600('0x32')]);_0x1040a4[_0x3600('0x33')]=_[_0x3600('0x46')](_0x1040a4[_0x3600('0x31')],_0x1040a4[_0x3600('0x32')]);_0x289b76[_0x3600('0x34')]=_[_0x3600('0x46')](_0x1040a4[_0x3600('0x31')],qs[_0x3600('0x35')](_0x5a6365[_0x3600('0x32')][_0x3600('0x35')]));_0x289b76['attributes']=_0x289b76[_0x3600('0x34')][_0x3600('0x36')]?_0x289b76['attributes']:_0x1040a4[_0x3600('0x31')];if(_0x5a6365['query'][_0x3600('0x47')]){_0x289b76[_0x3600('0x41')]=[{'all':!![]}];}_0x289b76=_[_0x3600('0x3e')]({},_0x289b76,_0x5a6365['options']);return db[_0x3600('0x2e')][_0x3600('0x48')](_0x289b76)[_0x3600('0x26')](handleEntityNotFound(_0x48c02b,null))[_0x3600('0x26')](respondWithResult(_0x48c02b,null))['catch'](handleError(_0x48c02b,null));};exports[_0x3600('0x49')]=function(_0x5a877c,_0x52ebf4){return db['DeskField'][_0x3600('0x49')](_0x5a877c['body'],{})[_0x3600('0x26')](respondWithResult(_0x52ebf4,0xc9))[_0x3600('0x4a')](handleError(_0x52ebf4,null));};exports['update']=function(_0x40c5a4,_0x2b1946){if(_0x40c5a4[_0x3600('0x4b')]['id']){delete _0x40c5a4[_0x3600('0x4b')]['id'];}return db['DeskField'][_0x3600('0x48')]({'where':{'id':_0x40c5a4[_0x3600('0x44')]['id']}})[_0x3600('0x26')](handleEntityNotFound(_0x2b1946,null))[_0x3600('0x26')](saveUpdates(_0x40c5a4[_0x3600('0x4b')],null))[_0x3600('0x26')](respondWithResult(_0x2b1946,null))[_0x3600('0x4a')](handleError(_0x2b1946,null));};exports['destroy']=function(_0xbf015a,_0x2f09d9){return db['DeskField'][_0x3600('0x48')]({'where':{'id':_0xbf015a[_0x3600('0x44')]['id']}})[_0x3600('0x26')](handleEntityNotFound(_0x2f09d9,null))[_0x3600('0x26')](removeEntity(_0x2f09d9,null))[_0x3600('0x4a')](handleError(_0x2f09d9,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 7d47f09..fec9235 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 _0x803f=['DeskField','desk_unique_index','idField','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x4c32f5,_0x3dbbf1){var _0x19cae9=function(_0x3c77cd){while(--_0x3c77cd){_0x4c32f5['push'](_0x4c32f5['shift']());}};_0x19cae9(++_0x3dbbf1);}(_0x803f,0x1ed));var _0xf803=function(_0x148142,_0x5393e0){_0x148142=_0x148142-0x0;var _0x1ca965=_0x803f[_0x148142];return _0x1ca965;};'use strict';var _=require(_0xf803('0x0'));var util=require(_0xf803('0x1'));var logger=require(_0xf803('0x2'))(_0xf803('0x3'));var moment=require(_0xf803('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf803('0x5'));var rimraf=require(_0xf803('0x6'));var config=require(_0xf803('0x7'));var attributes=require(_0xf803('0x8'));module[_0xf803('0x9')]=function(_0x4fbc01,_0x468484){return _0x4fbc01[_0xf803('0xa')](_0xf803('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xf803('0xc'),'fields':[_0xf803('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2145=['int_desk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','./intDeskField.attributes','exports','define'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0x2145,0x85));var _0x5214=function(_0x18f1e6,_0x429411){_0x18f1e6=_0x18f1e6-0x0;var _0x5bd88e=_0x2145[_0x18f1e6];return _0x5bd88e;};'use strict';var _=require(_0x5214('0x0'));var util=require(_0x5214('0x1'));var logger=require(_0x5214('0x2'))(_0x5214('0x3'));var moment=require(_0x5214('0x4'));var BPromise=require(_0x5214('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5214('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5214('0x7'));module[_0x5214('0x8')]=function(_0x4ab128,_0x16352e){return _0x4ab128[_0x5214('0x9')]('DeskField',attributes,{'tableName':_0x5214('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x5214('0xb'),_0x5214('0xc')],'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 d3c5fd0..24f8ddd 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 _0x057e=['http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5c2b1f,_0x266443){var _0x55d367=function(_0xeb5790){while(--_0xeb5790){_0x5c2b1f['push'](_0x5c2b1f['shift']());}};_0x55d367(++_0x266443);}(_0x057e,0x1ab));var _0xe057=function(_0x361856,_0x1dc6f7){_0x361856=_0x361856-0x0;var _0x336b0b=_0x057e[_0x361856];return _0x336b0b;};'use strict';var _=require(_0xe057('0x0'));var util=require(_0xe057('0x1'));var moment=require(_0xe057('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe057('0x3'));var db=require(_0xe057('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe057('0x5'))(_0xe057('0x6'));var config=require(_0xe057('0x7'));var jayson=require(_0xe057('0x8'));var client=jayson[_0xe057('0x9')][_0xe057('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x401493,_0x48c9b0,_0x113ee7){return new BPromise(function(_0x887d3b,_0x484f3f){return client[_0xe057('0xb')](_0x401493,_0x113ee7)[_0xe057('0xc')](function(_0x1f8b5d){logger[_0xe057('0xd')](_0xe057('0xe'),_0x48c9b0,_0xe057('0xf'));logger[_0xe057('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x48c9b0,_0xe057('0xf'),JSON[_0xe057('0x11')](_0x1f8b5d));if(_0x1f8b5d[_0xe057('0x12')]){if(_0x1f8b5d[_0xe057('0x12')][_0xe057('0x13')]===0x1f4){logger[_0xe057('0x12')](_0xe057('0xe'),_0x48c9b0,_0x1f8b5d['error'][_0xe057('0x14')]);return _0x484f3f(_0x1f8b5d[_0xe057('0x12')][_0xe057('0x14')]);}logger[_0xe057('0x12')](_0xe057('0xe'),_0x48c9b0,_0x1f8b5d[_0xe057('0x12')][_0xe057('0x14')]);return _0x887d3b(_0x1f8b5d[_0xe057('0x12')]['message']);}else{logger[_0xe057('0xd')](_0xe057('0xe'),_0x48c9b0,_0xe057('0xf'));_0x887d3b(_0x1f8b5d[_0xe057('0x15')][_0xe057('0x14')]);}})[_0xe057('0x16')](function(_0x548cd5){logger[_0xe057('0x12')](_0xe057('0xe'),_0x48c9b0,_0x548cd5);_0x484f3f(_0x548cd5);});});} \ No newline at end of file +var _0xfd9b=['request\x20sent','stringify','error','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','DeskField,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd9b,0x8d));var _0xbfd9=function(_0x78693d,_0x5a6c05){_0x78693d=_0x78693d-0x0;var _0x17b6fd=_0xfd9b[_0x78693d];return _0x17b6fd;};'use strict';var _=require('lodash');var util=require(_0xbfd9('0x0'));var moment=require(_0xbfd9('0x1'));var BPromise=require('bluebird');var rs=require(_0xbfd9('0x2'));var fs=require('fs');var Redis=require(_0xbfd9('0x3'));var db=require(_0xbfd9('0x4'))['db'];var utils=require(_0xbfd9('0x5'));var logger=require('../../config/logger')(_0xbfd9('0x6'));var config=require(_0xbfd9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbfd9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x371c02,_0x41207e,_0x46d048){return new BPromise(function(_0x18a9b7,_0x318e05){return client[_0xbfd9('0x9')](_0x371c02,_0x46d048)['then'](function(_0x2923bd){logger[_0xbfd9('0xa')](_0xbfd9('0xb'),_0x41207e,_0xbfd9('0xc'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x41207e,_0xbfd9('0xc'),JSON[_0xbfd9('0xd')](_0x2923bd));if(_0x2923bd['error']){if(_0x2923bd[_0xbfd9('0xe')]['code']===0x1f4){logger[_0xbfd9('0xe')](_0xbfd9('0xb'),_0x41207e,_0x2923bd['error'][_0xbfd9('0xf')]);return _0x318e05(_0x2923bd[_0xbfd9('0xe')][_0xbfd9('0xf')]);}logger[_0xbfd9('0xe')]('DeskField,\x20%s,\x20%s',_0x41207e,_0x2923bd[_0xbfd9('0xe')][_0xbfd9('0xf')]);return _0x18a9b7(_0x2923bd['error']['message']);}else{logger[_0xbfd9('0xa')](_0xbfd9('0xb'),_0x41207e,_0xbfd9('0xc'));_0x18a9b7(_0x2923bd[_0xbfd9('0x10')]['message']);}})['catch'](function(_0x195456){logger[_0xbfd9('0xe')](_0xbfd9('0xb'),_0x41207e,_0x195456);_0x318e05(_0x195456);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 8810f71..dc46a2a 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 _0x9283=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put'];(function(_0xec3877,_0x53d204){var _0x2818dc=function(_0x46cc0e){while(--_0x46cc0e){_0xec3877['push'](_0xec3877['shift']());}};_0x2818dc(++_0x53d204);}(_0x9283,0x1d1));var _0x3928=function(_0x2ffcac,_0x40da61){_0x2ffcac=_0x2ffcac-0x0;var _0x145970=_0x9283[_0x2ffcac];return _0x145970;};'use strict';var multer=require(_0x3928('0x0'));var util=require(_0x3928('0x1'));var path=require(_0x3928('0x2'));var timeout=require(_0x3928('0x3'));var express=require('express');var router=express[_0x3928('0x4')]();var fs_extra=require(_0x3928('0x5'));var auth=require(_0x3928('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3928('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x3928('0x8')]('/',auth['isAuthenticated'](),controller[_0x3928('0x9')]);router[_0x3928('0x8')](_0x3928('0xa'),auth[_0x3928('0xb')](),controller['show']);router['get'](_0x3928('0xc'),auth[_0x3928('0xb')](),controller[_0x3928('0xd')]);router[_0x3928('0x8')]('/:id/fields',auth[_0x3928('0xb')](),controller[_0x3928('0xe')]);router[_0x3928('0xf')]('/',auth['isAuthenticated'](),controller[_0x3928('0x10')]);router[_0x3928('0xf')]('/:id/configurations',auth[_0x3928('0xb')](),controller[_0x3928('0x11')]);router[_0x3928('0x12')](_0x3928('0xa'),auth['isAuthenticated'](),controller[_0x3928('0x13')]);router['delete'](_0x3928('0xa'),auth[_0x3928('0xb')](),controller[_0x3928('0x14')]);module[_0x3928('0x15')]=router; \ No newline at end of file +var _0xaa54=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated'];(function(_0x12c6f2,_0x5cefbf){var _0x9d6b8d=function(_0x43a910){while(--_0x43a910){_0x12c6f2['push'](_0x12c6f2['shift']());}};_0x9d6b8d(++_0x5cefbf);}(_0xaa54,0x7d));var _0x4aa5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xaa54[_0x178e48];return _0x440d7e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4aa5('0x0'));var timeout=require(_0x4aa5('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4aa5('0x2'));var auth=require(_0x4aa5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4aa5('0x4'));var controller=require(_0x4aa5('0x5'));router[_0x4aa5('0x6')]('/',auth[_0x4aa5('0x7')](),controller[_0x4aa5('0x8')]);router['get'](_0x4aa5('0x9'),auth[_0x4aa5('0x7')](),controller[_0x4aa5('0xa')]);router[_0x4aa5('0x6')](_0x4aa5('0xb'),auth[_0x4aa5('0x7')](),controller[_0x4aa5('0xc')]);router[_0x4aa5('0x6')](_0x4aa5('0xd'),auth[_0x4aa5('0x7')](),controller[_0x4aa5('0xe')]);router['post']('/',auth[_0x4aa5('0x7')](),controller['create']);router[_0x4aa5('0xf')](_0x4aa5('0xb'),auth[_0x4aa5('0x7')](),controller['addConfiguration']);router['put'](_0x4aa5('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4aa5('0x10')](_0x4aa5('0x9'),auth[_0x4aa5('0x7')](),controller[_0x4aa5('0x11')]);module[_0x4aa5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 69e0ee8..08527b7 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 _0x5525=['sequelize','exports','STRING'];(function(_0x4863f2,_0x2f29e4){var _0x19a824=function(_0x15baeb){while(--_0x15baeb){_0x4863f2['push'](_0x4863f2['shift']());}};_0x19a824(++_0x2f29e4);}(_0x5525,0x87));var _0x5552=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5525[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x5552('0x0'));module[_0x5552('0x1')]={'name':{'type':Sequelize[_0x5552('0x2')]},'username':{'type':Sequelize[_0x5552('0x2')]},'password':{'type':Sequelize[_0x5552('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x5552('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5552('0x2')]}}; \ No newline at end of file +var _0x9b6b=['STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b6b,0xe5));var _0xb9b6=function(_0x5eddd5,_0x29091f){_0x5eddd5=_0x5eddd5-0x0;var _0x1fc10e=_0x9b6b[_0x5eddd5];return _0x1fc10e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb9b6('0x0')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb9b6('0x0')]},'tenantId':{'type':Sequelize[_0xb9b6('0x0')]},'clientId':{'type':Sequelize[_0xb9b6('0x0')]},'clientSecret':{'type':Sequelize[_0xb9b6('0x0')]},'serverUrl':{'type':Sequelize[_0xb9b6('0x0')],'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 b6c3293..77d6660 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 _0x0911=['UserLocalizedLabel','Value','LogicalName','DisplayName','EntityDefinitions(',')/Attributes(','OptionSet','TrueOption','true','FalseOption','false','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','filter','merge','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_url','exchangerate','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','tenantId','clientSecret','remoteUri','slice','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','substring','@odata.type','PicklistAttributeMetadata','MetadataId','isNil','BooleanAttributeMetadata','push','forEach','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','all','test','statusCode','stack','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','Label'];(function(_0x58358c,_0x27d653){var _0x461602=function(_0x1184f4){while(--_0x1184f4){_0x58358c['push'](_0x58358c['shift']());}};_0x461602(++_0x27d653);}(_0x0911,0x1a9));var _0x1091=function(_0x448422,_0x362248){_0x448422=_0x448422-0x0;var _0xcc0afd=_0x0911[_0x448422];return _0xcc0afd;};'use strict';var emlformat=require(_0x1091('0x0'));var rimraf=require(_0x1091('0x1'));var zipdir=require(_0x1091('0x2'));var jsonpatch=require(_0x1091('0x3'));var rp=require(_0x1091('0x4'));var moment=require('moment');var BPromise=require(_0x1091('0x5'));var Mustache=require('mustache');var util=require(_0x1091('0x6'));var path=require(_0x1091('0x7'));var sox=require(_0x1091('0x8'));var csv=require(_0x1091('0x9'));var ejs=require(_0x1091('0xa'));var fs=require('fs');var fs_extra=require(_0x1091('0xb'));var _=require(_0x1091('0xc'));var squel=require(_0x1091('0xd'));var crypto=require(_0x1091('0xe'));var jsforce=require(_0x1091('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1091('0x9'));var querystring=require(_0x1091('0x10'));var Papa=require(_0x1091('0x11'));var Redis=require(_0x1091('0x12'));var authService=require(_0x1091('0x13'));var qs=require(_0x1091('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1091('0x15'));var logger=require(_0x1091('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x1091('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1091('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e9a52,_0x37a27c){_0x37a27c=_0x37a27c||0xcc;return function(_0x390560){if(_0x390560){return _0x3e9a52[_0x1091('0x19')](_0x37a27c);}return _0x3e9a52['status'](_0x37a27c)[_0x1091('0x1a')]();};}function respondWithResult(_0x11c894,_0x5d34e7){_0x5d34e7=_0x5d34e7||0xc8;return function(_0x5815db){if(_0x5815db){return _0x11c894['status'](_0x5d34e7)['json'](_0x5815db);}};}function respondWithFilteredResult(_0x4483c4,_0x9c92e5){return function(_0x3607e5){if(_0x3607e5){var _0x58c366=typeof _0x9c92e5[_0x1091('0x1b')]===_0x1091('0x1c')&&typeof _0x9c92e5[_0x1091('0x1d')]===_0x1091('0x1c');var _0x14f787=_0x3607e5['count'];var _0x841623=_0x58c366?0x0:_0x9c92e5[_0x1091('0x1b')];var _0x2b0fda=_0x58c366?_0x3607e5[_0x1091('0x1e')]:_0x9c92e5[_0x1091('0x1b')]+_0x9c92e5['limit'];var _0x2d9a4a;if(_0x2b0fda>=_0x14f787){_0x2b0fda=_0x14f787;_0x2d9a4a=0xc8;}else{_0x2d9a4a=0xce;}_0x4483c4[_0x1091('0x1f')](_0x2d9a4a);return _0x4483c4['set']('Content-Range',_0x841623+'-'+_0x2b0fda+'/'+_0x14f787)['json'](_0x3607e5);}return null;};}function patchUpdates(_0x250718){return function(_0x3a5014){try{jsonpatch[_0x1091('0x20')](_0x3a5014,_0x250718,!![]);}catch(_0x2f84d2){return BPromise[_0x1091('0x21')](_0x2f84d2);}return _0x3a5014[_0x1091('0x22')]();};}function saveUpdates(_0x30792f,_0xfb48c6){return function(_0x3daff2){if(_0x3daff2){return _0x3daff2[_0x1091('0x23')](_0x30792f)[_0x1091('0x24')](function(_0x197355){return _0x197355;});}return null;};}function removeEntity(_0x1925fc,_0x142597){return function(_0xffe7a6){if(_0xffe7a6){return _0xffe7a6[_0x1091('0x25')]()['then'](function(){_0x1925fc[_0x1091('0x1f')](0xcc)[_0x1091('0x1a')]();});}};}function handleEntityNotFound(_0x266d34,_0x5a4886){return function(_0x2a74cc){if(!_0x2a74cc){_0x266d34['sendStatus'](0x194);}return _0x2a74cc;};}function handleError(_0x26c91b,_0x306165){_0x306165=_0x306165||0x1f4;return function(_0x15eb8d){logger[_0x1091('0x26')](_0x15eb8d['stack']);if(_0x15eb8d[_0x1091('0x27')]){delete _0x15eb8d[_0x1091('0x27')];}_0x26c91b[_0x1091('0x1f')](_0x306165)[_0x1091('0x28')](_0x15eb8d);};}exports[_0x1091('0x29')]=function(_0x40a8b4,_0x56dc27){var _0x2be598={},_0x2068b6={},_0x170684={'count':0x0,'rows':[]};var _0x39326e=_['map'](db['Dynamics365Account'][_0x1091('0x2a')],function(_0x2ef4a9){return{'name':_0x2ef4a9[_0x1091('0x2b')],'type':_0x2ef4a9[_0x1091('0x2c')]['key']};});_0x2068b6['model']=_[_0x1091('0x2d')](_0x39326e,'name');_0x2068b6['query']=_[_0x1091('0x2e')](_0x40a8b4[_0x1091('0x2f')]);_0x2068b6[_0x1091('0x30')]=_[_0x1091('0x31')](_0x2068b6[_0x1091('0x32')],_0x2068b6[_0x1091('0x2f')]);_0x2be598['attributes']=_[_0x1091('0x31')](_0x2068b6[_0x1091('0x32')],qs[_0x1091('0x33')](_0x40a8b4[_0x1091('0x2f')]['fields']));_0x2be598[_0x1091('0x34')]=_0x2be598[_0x1091('0x34')]['length']?_0x2be598[_0x1091('0x34')]:_0x2068b6[_0x1091('0x32')];if(!_0x40a8b4[_0x1091('0x2f')]['hasOwnProperty'](_0x1091('0x35'))){_0x2be598[_0x1091('0x1d')]=qs['limit'](_0x40a8b4[_0x1091('0x2f')][_0x1091('0x1d')]);_0x2be598[_0x1091('0x1b')]=qs[_0x1091('0x1b')](_0x40a8b4['query'][_0x1091('0x1b')]);}_0x2be598[_0x1091('0x36')]=qs[_0x1091('0x37')](_0x40a8b4['query'][_0x1091('0x37')]);_0x2be598[_0x1091('0x38')]=qs[_0x1091('0x30')](_['pick'](_0x40a8b4[_0x1091('0x2f')],_0x2068b6[_0x1091('0x30')]),_0x39326e);if(_0x40a8b4[_0x1091('0x2f')][_0x1091('0x39')]){_0x2be598[_0x1091('0x38')]=_[_0x1091('0x3a')](_0x2be598['where'],{'$or':_[_0x1091('0x2d')](_0x39326e,function(_0x3f93b2){if(_0x3f93b2[_0x1091('0x2c')]!=='VIRTUAL'){var _0x3af339={};_0x3af339[_0x3f93b2[_0x1091('0x27')]]={'$like':'%'+_0x40a8b4[_0x1091('0x2f')][_0x1091('0x39')]+'%'};return _0x3af339;}})});}_0x2be598=_[_0x1091('0x3a')]({},_0x2be598,_0x40a8b4[_0x1091('0x3b')]);var _0x123363={'where':_0x2be598['where']};return db[_0x1091('0x3c')][_0x1091('0x1e')](_0x123363)[_0x1091('0x24')](function(_0x5e1390){_0x170684[_0x1091('0x1e')]=_0x5e1390;if(_0x40a8b4['query'][_0x1091('0x3d')]){_0x2be598[_0x1091('0x3e')]=[{'all':!![]}];}return db[_0x1091('0x3c')][_0x1091('0x3f')](_0x2be598);})[_0x1091('0x24')](function(_0x448d5d){_0x170684[_0x1091('0x40')]=_0x448d5d;return _0x170684;})['then'](respondWithFilteredResult(_0x56dc27,_0x2be598))[_0x1091('0x41')](handleError(_0x56dc27,null));};exports[_0x1091('0x42')]=function(_0x4b2048,_0x8985f7){var _0x1f29ea={'raw':![],'where':{'id':_0x4b2048['params']['id']}},_0x24bbd0={};_0x24bbd0[_0x1091('0x32')]=_[_0x1091('0x2e')](db[_0x1091('0x3c')][_0x1091('0x2a')]);_0x24bbd0[_0x1091('0x2f')]=_['keys'](_0x4b2048['query']);_0x24bbd0['filters']=_['intersection'](_0x24bbd0[_0x1091('0x32')],_0x24bbd0[_0x1091('0x2f')]);_0x1f29ea[_0x1091('0x34')]=_[_0x1091('0x31')](_0x24bbd0[_0x1091('0x32')],qs[_0x1091('0x33')](_0x4b2048[_0x1091('0x2f')][_0x1091('0x33')]));_0x1f29ea['attributes']=_0x1f29ea['attributes'][_0x1091('0x43')]?_0x1f29ea[_0x1091('0x34')]:_0x24bbd0[_0x1091('0x32')];if(_0x4b2048[_0x1091('0x2f')][_0x1091('0x3d')]){_0x1f29ea['include']=[{'all':!![]}];}_0x1f29ea=_[_0x1091('0x3a')]({},_0x1f29ea,_0x4b2048['options']);return db[_0x1091('0x3c')][_0x1091('0x44')](_0x1f29ea)[_0x1091('0x24')](handleEntityNotFound(_0x8985f7,null))[_0x1091('0x24')](respondWithResult(_0x8985f7,null))[_0x1091('0x41')](handleError(_0x8985f7,null));};exports[_0x1091('0x45')]=function(_0x4fc761,_0x1a3883){return db[_0x1091('0x3c')][_0x1091('0x45')](_0x4fc761[_0x1091('0x46')],{})[_0x1091('0x24')](respondWithResult(_0x1a3883,0xc9))[_0x1091('0x41')](handleError(_0x1a3883,null));};exports['update']=function(_0x36f93a,_0xf57822){if(_0x36f93a[_0x1091('0x46')]['id']){delete _0x36f93a[_0x1091('0x46')]['id'];}return db[_0x1091('0x3c')][_0x1091('0x44')]({'where':{'id':_0x36f93a[_0x1091('0x47')]['id']}})[_0x1091('0x24')](handleEntityNotFound(_0xf57822,null))[_0x1091('0x24')](saveUpdates(_0x36f93a[_0x1091('0x46')],null))[_0x1091('0x24')](respondWithResult(_0xf57822,null))[_0x1091('0x41')](handleError(_0xf57822,null));};exports[_0x1091('0x25')]=function(_0x33816a,_0x8980d9){return db[_0x1091('0x3c')][_0x1091('0x44')]({'where':{'id':_0x33816a[_0x1091('0x47')]['id']}})[_0x1091('0x24')](handleEntityNotFound(_0x8980d9,null))['then'](removeEntity(_0x8980d9,null))['catch'](handleError(_0x8980d9,null));};exports[_0x1091('0x48')]=function(_0x9a9747,_0x22cca1,_0x127979){var _0x1f21c0={};var _0x540813={};var _0x3a1d25;var _0x217d4f;return db[_0x1091('0x3c')][_0x1091('0x49')]({'where':{'id':_0x9a9747[_0x1091('0x47')]['id']}})['then'](handleEntityNotFound(_0x22cca1,null))[_0x1091('0x24')](function(_0x4084cb){if(_0x4084cb){_0x3a1d25=_0x4084cb;_0x540813['model']=_[_0x1091('0x2e')](db['Dynamics365Configuration']['rawAttributes']);_0x540813[_0x1091('0x2f')]=_['keys'](_0x9a9747[_0x1091('0x2f')]);_0x540813['filters']=_[_0x1091('0x31')](_0x540813[_0x1091('0x32')],_0x540813[_0x1091('0x2f')]);_0x1f21c0[_0x1091('0x34')]=_[_0x1091('0x31')](_0x540813[_0x1091('0x32')],qs[_0x1091('0x33')](_0x9a9747[_0x1091('0x2f')][_0x1091('0x33')]));_0x1f21c0[_0x1091('0x34')]=_0x1f21c0[_0x1091('0x34')][_0x1091('0x43')]?_0x1f21c0['attributes']:_0x540813[_0x1091('0x32')];_0x1f21c0[_0x1091('0x36')]=qs['sort'](_0x9a9747[_0x1091('0x2f')]['sort']);_0x1f21c0[_0x1091('0x38')]=qs[_0x1091('0x30')](_[_0x1091('0x4a')](_0x9a9747[_0x1091('0x2f')],_0x540813[_0x1091('0x30')]));if(_0x9a9747['query'][_0x1091('0x39')]){_0x1f21c0[_0x1091('0x38')]=_['merge'](_0x1f21c0['where'],{'$or':_[_0x1091('0x2d')](_0x1f21c0['attributes'],function(_0x6467fd){var _0x33e8cf={};_0x33e8cf[_0x6467fd]={'$like':'%'+_0x9a9747[_0x1091('0x2f')][_0x1091('0x39')]+'%'};return _0x33e8cf;})});}_0x1f21c0=_[_0x1091('0x3a')]({},_0x1f21c0,_0x9a9747['options']);return _0x3a1d25['getConfigurations'](_0x1f21c0);}})[_0x1091('0x24')](function(_0x110218){if(_0x110218){_0x217d4f=_0x110218[_0x1091('0x43')];if(!_0x9a9747['query']['hasOwnProperty'](_0x1091('0x35'))){_0x1f21c0[_0x1091('0x1d')]=qs[_0x1091('0x1d')](_0x9a9747[_0x1091('0x2f')][_0x1091('0x1d')]);_0x1f21c0[_0x1091('0x1b')]=qs['offset'](_0x9a9747[_0x1091('0x2f')][_0x1091('0x1b')]);}return _0x3a1d25['getConfigurations'](_0x1f21c0);}})[_0x1091('0x24')](function(_0x353b77){if(_0x353b77){return _0x353b77?{'count':_0x217d4f,'rows':_0x353b77}:null;}})[_0x1091('0x24')](respondWithResult(_0x22cca1,null))['catch'](handleError(_0x22cca1,null));};exports[_0x1091('0x4b')]=function(_0x425326,_0x327399,_0x2400f2){if(_0x425326[_0x1091('0x46')]['id']){delete _0x425326[_0x1091('0x46')]['id'];}return db[_0x1091('0x3c')][_0x1091('0x49')]({'where':{'id':_0x425326['params']['id']}})['then'](handleEntityNotFound(_0x327399,null))['then'](function(_0x2ea4cd){if(_0x2ea4cd){_0x425326[_0x1091('0x46')][_0x1091('0x4c')]=_0x2ea4cd['id'];_0x425326[_0x1091('0x46')][_0x1091('0x4d')]=integrations[_0x1091('0x4e')](_0x425326[_0x1091('0x46')][_0x1091('0x4f')],_0x425326[_0x1091('0x46')][_0x1091('0x2c')]);_0x425326['body'][_0x1091('0x50')]=integrations[_0x1091('0x51')](_0x425326[_0x1091('0x46')][_0x1091('0x4f')],_0x425326[_0x1091('0x46')]['type']);return db[_0x1091('0x52')][_0x1091('0x45')](_0x425326[_0x1091('0x46')],{'include':[{'model':db[_0x1091('0x53')],'as':_0x1091('0x4d')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x1091('0x24')](respondWithResult(_0x327399,null))[_0x1091('0x41')](handleError(_0x327399,null));};exports['getFields']=function(_0x10ef74,_0x5a6e40,_0x1a7dd5){var _0x19036f=_0x10ef74['query'][_0x1091('0x54')];var _0x112a8f=_0x19036f===_0x1091('0x55')?_0x1091('0x56'):_0x1091('0x57');var _0x2f905f='';var _0x13de6c='';var _0x3c5714='';var _0x195f27='';var _0x23de01='';var _0x2df47a='';var _0x5e1df4='';var _0x227e1='';var _0x108a7c=[_0x1091('0x58'),_0x1091('0x59'),_0x1091('0x5a'),_0x1091('0x5b'),_0x1091('0x5c'),_0x1091('0x5d'),_0x1091('0x5e'),_0x1091('0x5f'),_0x1091('0x60'),_0x1091('0x61')];var _0x405674=[_0x1091('0x62'),_0x1091('0x63'),_0x1091('0x64'),'billedserviceunits',_0x1091('0x65'),_0x1091('0x66'),'contractdetailidname',_0x1091('0x67'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x1091('0x68'),_0x1091('0x69'),_0x1091('0x6a'),_0x1091('0x6b'),_0x1091('0x6c'),_0x1091('0x6d'),_0x1091('0x6e'),_0x1091('0x6f'),_0x1091('0x70'),'entitlementidname','entityimage_timestamp',_0x1091('0x71'),'escalatedon',_0x1091('0x72'),'firstresponsebykpiidname','followupby',_0x1091('0x73'),'influencescore',_0x1091('0x74'),_0x1091('0x75'),_0x1091('0x76'),_0x1091('0x77'),_0x1091('0x78'),_0x1091('0x79'),_0x1091('0x7a'),_0x1091('0x7b'),_0x1091('0x7c'),_0x1091('0x7d'),'msdyn_incidenttypename',_0x1091('0x7e'),_0x1091('0x7f'),_0x1091('0x80'),_0x1091('0x81'),_0x1091('0x82'),_0x1091('0x83'),'owneridyominame','parentcaseidname',_0x1091('0x84'),_0x1091('0x85'),_0x1091('0x86'),_0x1091('0x87'),_0x1091('0x88'),_0x1091('0x89'),_0x1091('0x8a'),_0x1091('0x8b'),_0x1091('0x8c'),_0x1091('0x8d'),_0x1091('0x8e'),_0x1091('0x8f'),_0x1091('0x90'),_0x1091('0x91'),_0x1091('0x92'),_0x1091('0x93'),_0x1091('0x94'),'ticketnumber','timezoneruleversionnumber',_0x1091('0x95'),_0x1091('0x96'),_0x1091('0x97'),'versionnumber'];var _0x511132=_0x108a7c[_0x1091('0x98')](_0x405674);return db[_0x1091('0x3c')][_0x1091('0x49')]({'where':{'id':_0x10ef74[_0x1091('0x47')]['id']},'attributes':['id',_0x1091('0x99'),_0x1091('0x9a'),'remoteUri',_0x1091('0x9b'),'clientId',_0x1091('0x9c')]})[_0x1091('0x24')](handleEntityNotFound(_0x5a6e40,null))[_0x1091('0x24')](function(_0x1a2731){if(_0x1a2731){_0x227e1=_0x1a2731[_0x1091('0x9d')];var _0x313b37=_0x227e1[_0x1091('0x9e')](-0x1);if(_0x313b37==='/'){_0x227e1=_0x227e1['substring'](0x0,_0x227e1[_0x1091('0x9f')](_0x313b37));}_0x5e1df4=util['format'](_0x1091('0xa0'),_0x227e1);var _0x1e6d9d={'method':_0x1091('0xa1'),'uri':_0x1091('0xa2')+_0x1a2731[_0x1091('0x9b')]+_0x1091('0xa3'),'form':{'client_id':_0x1a2731[_0x1091('0xa4')],'resource':_0x227e1,'username':_0x1a2731[_0x1091('0x99')],'password':_0x1a2731[_0x1091('0x9a')],'grant_type':'password','client_secret':_0x1a2731[_0x1091('0x9c')]},'json':!![]};return rp(_0x1e6d9d);}})[_0x1091('0x24')](function(_0x51a993){_0x2df47a=_0x51a993['access_token'];var _0x14d358={'method':_0x1091('0xa5'),'uri':encodeURI(_0x5e1df4+_0x1091('0xa6')+_0x112a8f+'\x27'),'headers':{'Authorization':_0x1091('0xa7')+_0x2df47a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x14d358);})['then'](function(_0x501b39){var _0x2abba6=_0x501b39['value'][0x0];var _0x3e468c=_0x2abba6['MetadataId'];var _0xd1e2af={'method':_0x1091('0xa5'),'uri':_0x5e1df4+'EntityDefinitions('+_0x3e468c+_0x1091('0xa8'),'headers':{'Authorization':'Bearer\x20'+_0x2df47a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xd1e2af);})['then'](function(_0x18899d){_0x2f905f=_0x18899d;_0x13de6c=_0x2f905f[_0x1091('0xa9')];_0x13de6c=_[_0x1091('0xaa')](_0x13de6c,function(_0x1f0c64){return!_0x511132[_0x1091('0xab')](_0x1f0c64['LogicalName']);});var _0x4b545f=[];var _0xad7ea3=[];_0x13de6c['forEach'](function(_0x2dfd57){if(_0x2dfd57['@odata.type']){var _0x196fa1=_0x2dfd57['@odata.type'][_0x1091('0xac')](_0x2dfd57[_0x1091('0xad')]['lastIndexOf']('.')+0x1);if(_0x196fa1===_0x1091('0xae')){_0x4b545f['push'](getSelectList(_0x5e1df4,_0x19036f,_0xad7ea3,_0x2f905f['MetadataId'],_0x2dfd57[_0x1091('0xaf')],_0x2df47a));}}});return Promise['all'](_0x4b545f);})[_0x1091('0x24')](function(_0x27a482){_0x3c5714=_0x27a482[0x0];var _0xd30b68=[];var _0x25d7a4=[];_0x13de6c['forEach'](function(_0x1756c0){if(!_[_0x1091('0xb0')](_0x1756c0['@odata.type'])){var _0x184679=_0x1756c0[_0x1091('0xad')][_0x1091('0xac')](_0x1756c0['@odata.type'][_0x1091('0x9f')]('.')+0x1);if(_0x184679===_0x1091('0xb1')){_0xd30b68[_0x1091('0xb2')](getBooleanList(_0x5e1df4,_0x19036f,_0x25d7a4,_0x2f905f[_0x1091('0xaf')],_0x1756c0['MetadataId'],_0x2df47a));}}});return Promise['all'](_0xd30b68);})[_0x1091('0x24')](function(_0x33a6eb){_0x195f27=_0x33a6eb[0x0];var _0x4f963c=[];var _0x25822b=[];_0x13de6c[_0x1091('0xb3')](function(_0x40998a){if(_0x40998a[_0x1091('0xad')]){var _0x26caae=_0x40998a[_0x1091('0xad')]['substring'](_0x40998a[_0x1091('0xad')]['lastIndexOf']('.')+0x1);if(_0x26caae==='StringAttributeMetadata'||_0x26caae===_0x1091('0xb4')||_0x26caae===_0x1091('0xb5')||_0x26caae===_0x1091('0xb6')||_0x26caae==='MemoAttributeMetadata'||_0x26caae===_0x1091('0xb7')||_0x26caae===_0x1091('0xb8')||_0x26caae===_0x1091('0xb9')||_0x26caae==='StateAttributeMetadata'||_0x26caae===_0x1091('0xba')){_0x4f963c[_0x1091('0xb2')](getInputList(_0x5e1df4,_0x19036f,_0x26caae,_0x25822b,_0x2f905f[_0x1091('0xaf')],_0x40998a[_0x1091('0xaf')],_0x2df47a));}}});return Promise[_0x1091('0xbb')](_0x4f963c);})[_0x1091('0x24')](function(_0x500bdb){_0x23de01=_0x500bdb[0x0];var _0x2c50cf=_0x3c5714[_0x1091('0x98')](_0x195f27)[_0x1091('0x98')](_0x23de01);var _0x390b1b={'count':_0x2c50cf[_0x1091('0x43')],'rows':_0x2c50cf};return _0x390b1b;})[_0x1091('0x24')](respondWithResult(_0x5a6e40,null))[_0x1091('0x41')](function(_0x2a1411){var _0x23828a=_0x10ef74['query'][_0x1091('0xbc')]?0x1f4:_0x2a1411[_0x1091('0xbd')]||0x1f4;logger[_0x1091('0x26')](_0x2a1411[_0x1091('0xbe')]);delete _0x2a1411['name'];if(_0x23828a===0x191){_0x23828a=0x190;}_0x5a6e40[_0x1091('0x1f')](_0x23828a)['send'](_0x10ef74['query'][_0x1091('0xbc')]?{'message':_0x1091('0xbf'),'statusCode':_0x2a1411[_0x1091('0xbd')]}:_0x2a1411);});};function getSelectList(_0x1adf4b,_0xfb790e,_0x31b0fe,_0x160682,_0x3b371c,_0xd322dd){var _0x114b9e={'method':_0x1091('0xa5'),'uri':_0x1adf4b+'EntityDefinitions('+_0x160682+')/Attributes('+_0x3b371c+_0x1091('0xc0')+_0x1091('0xc1'),'headers':{'Authorization':_0x1091('0xa7')+_0xd322dd,'If-None-Match':null,'OData-Version':_0x1091('0xc2')},'json':!![]};return rp(_0x114b9e)[_0x1091('0x24')](function(_0x4d6e60){var _0x3b2c93=[];var _0x1f1b69=_0x4d6e60['OptionSet']['Options'];_0x1f1b69[_0x1091('0xb3')](function(_0x5d8e34){_0x3b2c93[_0x1091('0xb2')]({'name':_0x5d8e34[_0x1091('0xc3')][_0x1091('0xc4')][_0x1091('0xc3')],'value':String(_0x5d8e34[_0x1091('0xc5')])});});var _0x350be4={'id':_0xfb790e+'_'+_0x4d6e60[_0x1091('0xc6')],'name':_0x4d6e60[_0x1091('0xc7')]['UserLocalizedLabel'][_0x1091('0xc3')],'custom':![],'options':_0x3b2c93};_0x31b0fe[_0x1091('0xb2')](_0x350be4);return _0x31b0fe;});}function getBooleanList(_0x5b712b,_0x57209e,_0xdfe781,_0x4ecceb,_0x3c8d49,_0x11905a){var _0xed0bd6={'method':'GET','uri':_0x5b712b+_0x1091('0xc8')+_0x4ecceb+_0x1091('0xc9')+_0x3c8d49+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x1091('0xa7')+_0x11905a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xed0bd6)[_0x1091('0x24')](function(_0xffdbde){var _0x41c73d=[];_0x41c73d[_0x1091('0xb2')]({'name':_0xffdbde[_0x1091('0xca')][_0x1091('0xcb')][_0x1091('0xc3')][_0x1091('0xc4')][_0x1091('0xc3')],'value':_0x1091('0xcc')},{'name':_0xffdbde[_0x1091('0xca')][_0x1091('0xcd')][_0x1091('0xc3')]['UserLocalizedLabel'][_0x1091('0xc3')],'value':_0x1091('0xce')});var _0x2be033={'id':_0x57209e+'_'+_0xffdbde[_0x1091('0xc6')],'name':_0xffdbde['DisplayName'][_0x1091('0xc4')]['Label'],'custom':![],'options':_0x41c73d};_0xdfe781['push'](_0x2be033);return _0xdfe781;});}function getInputList(_0x31e911,_0x3a8c2d,_0x30bd6a,_0x592d3e,_0x33bc86,_0x21a2ec,_0x2f9576){var _0x53f418={'method':_0x1091('0xa5'),'uri':_0x31e911+_0x1091('0xc8')+_0x33bc86+_0x1091('0xc9')+_0x21a2ec+')/Microsoft.Dynamics.CRM.'+_0x30bd6a+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x1091('0xa7')+_0x2f9576,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x53f418)['then'](function(_0x53d2b3){var _0x289faf={'id':_0x3a8c2d+'_'+_0x53d2b3['LogicalName'],'name':_0x53d2b3[_0x1091('0xc7')]['UserLocalizedLabel']?_0x53d2b3[_0x1091('0xc7')][_0x1091('0xc4')][_0x1091('0xc3')]:_0x53d2b3[_0x1091('0xc6')],'custom':![],'options':[]};_0x592d3e[_0x1091('0xb2')](_0x289faf);return _0x592d3e;});} \ No newline at end of file +var _0x6dfa=['pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','Subjects','ticketType','Incident','PhoneCall','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','access_token','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','statusCode','stack','Wrong\x20credentials','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','Dynamics365Account','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','order'];(function(_0x51dda5,_0x69168e){var _0x4b42d4=function(_0x18c55d){while(--_0x18c55d){_0x51dda5['push'](_0x51dda5['shift']());}};_0x4b42d4(++_0x69168e);}(_0x6dfa,0x7b));var _0xa6df=function(_0x44dc35,_0x2e5d1b){_0x44dc35=_0x44dc35-0x0;var _0x3c6729=_0x6dfa[_0x44dc35];return _0x3c6729;};'use strict';var emlformat=require(_0xa6df('0x0'));var rimraf=require(_0xa6df('0x1'));var zipdir=require(_0xa6df('0x2'));var jsonpatch=require(_0xa6df('0x3'));var rp=require(_0xa6df('0x4'));var moment=require('moment');var BPromise=require(_0xa6df('0x5'));var Mustache=require('mustache');var util=require(_0xa6df('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa6df('0x7'));var ejs=require(_0xa6df('0x8'));var fs=require('fs');var fs_extra=require(_0xa6df('0x9'));var _=require(_0xa6df('0xa'));var squel=require(_0xa6df('0xb'));var crypto=require(_0xa6df('0xc'));var jsforce=require(_0xa6df('0xd'));var deskjs=require(_0xa6df('0xe'));var toCsv=require(_0xa6df('0x7'));var querystring=require(_0xa6df('0xf'));var Papa=require('papaparse');var Redis=require(_0xa6df('0x10'));var authService=require(_0xa6df('0x11'));var qs=require(_0xa6df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6df('0x13'));var logger=require('../../config/logger')(_0xa6df('0x14'));var utils=require(_0xa6df('0x15'));var config=require(_0xa6df('0x16'));var licenseUtil=require(_0xa6df('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa6df('0x18'));function respondWithStatusCode(_0x500e77,_0x1540f1){_0x1540f1=_0x1540f1||0xcc;return function(_0x18e6d3){if(_0x18e6d3){return _0x500e77[_0xa6df('0x19')](_0x1540f1);}return _0x500e77[_0xa6df('0x1a')](_0x1540f1)['end']();};}function respondWithResult(_0x1e536d,_0x5bbd9e){_0x5bbd9e=_0x5bbd9e||0xc8;return function(_0x4f0494){if(_0x4f0494){return _0x1e536d[_0xa6df('0x1a')](_0x5bbd9e)['json'](_0x4f0494);}};}function respondWithFilteredResult(_0x300a72,_0x414cae){return function(_0x23f4c1){if(_0x23f4c1){var _0x3e268f=typeof _0x414cae[_0xa6df('0x1b')]==='undefined'&&typeof _0x414cae[_0xa6df('0x1c')]===_0xa6df('0x1d');var _0x1b7870=_0x23f4c1[_0xa6df('0x1e')];var _0x4d6d2f=_0x3e268f?0x0:_0x414cae[_0xa6df('0x1b')];var _0x2d01dc=_0x3e268f?_0x23f4c1[_0xa6df('0x1e')]:_0x414cae[_0xa6df('0x1b')]+_0x414cae['limit'];var _0x59f65a;if(_0x2d01dc>=_0x1b7870){_0x2d01dc=_0x1b7870;_0x59f65a=0xc8;}else{_0x59f65a=0xce;}_0x300a72[_0xa6df('0x1a')](_0x59f65a);return _0x300a72['set'](_0xa6df('0x1f'),_0x4d6d2f+'-'+_0x2d01dc+'/'+_0x1b7870)[_0xa6df('0x20')](_0x23f4c1);}return null;};}function patchUpdates(_0x297e0f){return function(_0x378f1f){try{jsonpatch[_0xa6df('0x21')](_0x378f1f,_0x297e0f,!![]);}catch(_0x5e9799){return BPromise[_0xa6df('0x22')](_0x5e9799);}return _0x378f1f[_0xa6df('0x23')]();};}function saveUpdates(_0x3c09de,_0x10fb11){return function(_0x46d0c4){if(_0x46d0c4){return _0x46d0c4[_0xa6df('0x24')](_0x3c09de)['then'](function(_0x4be3e0){return _0x4be3e0;});}return null;};}function removeEntity(_0xcaa3a1,_0x111659){return function(_0x38fa51){if(_0x38fa51){return _0x38fa51[_0xa6df('0x25')]()[_0xa6df('0x26')](function(){_0xcaa3a1[_0xa6df('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e836,_0x1f138b){return function(_0x2838f5){if(!_0x2838f5){_0x51e836[_0xa6df('0x19')](0x194);}return _0x2838f5;};}function handleError(_0x50e7b8,_0x54ff44){_0x54ff44=_0x54ff44||0x1f4;return function(_0x564e30){logger[_0xa6df('0x27')](_0x564e30['stack']);if(_0x564e30[_0xa6df('0x28')]){delete _0x564e30[_0xa6df('0x28')];}_0x50e7b8[_0xa6df('0x1a')](_0x54ff44)[_0xa6df('0x29')](_0x564e30);};}exports[_0xa6df('0x2a')]=function(_0x25a36a,_0x55161d){var _0x42fa1b={},_0x417c8a={},_0x42fa29={'count':0x0,'rows':[]};var _0x1257b2=_[_0xa6df('0x2b')](db['Dynamics365Account'][_0xa6df('0x2c')],function(_0xd56e14){return{'name':_0xd56e14['fieldName'],'type':_0xd56e14[_0xa6df('0x2d')][_0xa6df('0x2e')]};});_0x417c8a['model']=_[_0xa6df('0x2b')](_0x1257b2,_0xa6df('0x28'));_0x417c8a[_0xa6df('0x2f')]=_[_0xa6df('0x30')](_0x25a36a[_0xa6df('0x2f')]);_0x417c8a['filters']=_[_0xa6df('0x31')](_0x417c8a[_0xa6df('0x32')],_0x417c8a[_0xa6df('0x2f')]);_0x42fa1b[_0xa6df('0x33')]=_['intersection'](_0x417c8a[_0xa6df('0x32')],qs['fields'](_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x34')]));_0x42fa1b[_0xa6df('0x33')]=_0x42fa1b[_0xa6df('0x33')][_0xa6df('0x35')]?_0x42fa1b[_0xa6df('0x33')]:_0x417c8a[_0xa6df('0x32')];if(!_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x36')](_0xa6df('0x37'))){_0x42fa1b[_0xa6df('0x1c')]=qs['limit'](_0x25a36a['query'][_0xa6df('0x1c')]);_0x42fa1b[_0xa6df('0x1b')]=qs[_0xa6df('0x1b')](_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x1b')]);}_0x42fa1b['order']=qs[_0xa6df('0x38')](_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x38')]);_0x42fa1b[_0xa6df('0x39')]=qs[_0xa6df('0x3a')](_['pick'](_0x25a36a[_0xa6df('0x2f')],_0x417c8a[_0xa6df('0x3a')]),_0x1257b2);if(_0x25a36a[_0xa6df('0x2f')]['filter']){_0x42fa1b[_0xa6df('0x39')]=_['merge'](_0x42fa1b['where'],{'$or':_['map'](_0x1257b2,function(_0x2cf537){if(_0x2cf537[_0xa6df('0x2d')]!=='VIRTUAL'){var _0x493e91={};_0x493e91[_0x2cf537[_0xa6df('0x28')]]={'$like':'%'+_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x3b')]+'%'};return _0x493e91;}})});}_0x42fa1b=_[_0xa6df('0x3c')]({},_0x42fa1b,_0x25a36a[_0xa6df('0x3d')]);var _0x47a460={'where':_0x42fa1b[_0xa6df('0x39')]};return db[_0xa6df('0x3e')][_0xa6df('0x1e')](_0x47a460)['then'](function(_0xe63116){_0x42fa29[_0xa6df('0x1e')]=_0xe63116;if(_0x25a36a[_0xa6df('0x2f')]['includeAll']){_0x42fa1b[_0xa6df('0x3f')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xa6df('0x40')](_0x42fa1b);})['then'](function(_0x2bd695){_0x42fa29[_0xa6df('0x41')]=_0x2bd695;return _0x42fa29;})[_0xa6df('0x26')](respondWithFilteredResult(_0x55161d,_0x42fa1b))[_0xa6df('0x42')](handleError(_0x55161d,null));};exports[_0xa6df('0x43')]=function(_0x4f99a0,_0x3ea622){var _0x5e277f={'raw':![],'where':{'id':_0x4f99a0[_0xa6df('0x44')]['id']}},_0x38ac07={};_0x38ac07[_0xa6df('0x32')]=_['keys'](db[_0xa6df('0x3e')][_0xa6df('0x2c')]);_0x38ac07[_0xa6df('0x2f')]=_[_0xa6df('0x30')](_0x4f99a0[_0xa6df('0x2f')]);_0x38ac07['filters']=_[_0xa6df('0x31')](_0x38ac07[_0xa6df('0x32')],_0x38ac07[_0xa6df('0x2f')]);_0x5e277f['attributes']=_['intersection'](_0x38ac07['model'],qs[_0xa6df('0x34')](_0x4f99a0[_0xa6df('0x2f')][_0xa6df('0x34')]));_0x5e277f[_0xa6df('0x33')]=_0x5e277f[_0xa6df('0x33')]['length']?_0x5e277f[_0xa6df('0x33')]:_0x38ac07[_0xa6df('0x32')];if(_0x4f99a0[_0xa6df('0x2f')]['includeAll']){_0x5e277f['include']=[{'all':!![]}];}_0x5e277f=_['merge']({},_0x5e277f,_0x4f99a0[_0xa6df('0x3d')]);return db[_0xa6df('0x3e')][_0xa6df('0x45')](_0x5e277f)['then'](handleEntityNotFound(_0x3ea622,null))[_0xa6df('0x26')](respondWithResult(_0x3ea622,null))['catch'](handleError(_0x3ea622,null));};exports[_0xa6df('0x46')]=function(_0x1278b3,_0x53b4f2){return db[_0xa6df('0x3e')][_0xa6df('0x46')](_0x1278b3[_0xa6df('0x47')],{})[_0xa6df('0x26')](respondWithResult(_0x53b4f2,0xc9))['catch'](handleError(_0x53b4f2,null));};exports[_0xa6df('0x24')]=function(_0xdb3379,_0x4bc4d5){if(_0xdb3379['body']['id']){delete _0xdb3379['body']['id'];}return db[_0xa6df('0x3e')][_0xa6df('0x45')]({'where':{'id':_0xdb3379[_0xa6df('0x44')]['id']}})[_0xa6df('0x26')](handleEntityNotFound(_0x4bc4d5,null))[_0xa6df('0x26')](saveUpdates(_0xdb3379[_0xa6df('0x47')],null))['then'](respondWithResult(_0x4bc4d5,null))[_0xa6df('0x42')](handleError(_0x4bc4d5,null));};exports[_0xa6df('0x25')]=function(_0x415417,_0x130c0e){return db[_0xa6df('0x3e')][_0xa6df('0x45')]({'where':{'id':_0x415417[_0xa6df('0x44')]['id']}})[_0xa6df('0x26')](handleEntityNotFound(_0x130c0e,null))[_0xa6df('0x26')](removeEntity(_0x130c0e,null))[_0xa6df('0x42')](handleError(_0x130c0e,null));};exports[_0xa6df('0x48')]=function(_0x3c7f40,_0x8f7801,_0x3b45ae){var _0x2e7575={};var _0xa011d={};var _0x4e92a;var _0x5efea2;return db[_0xa6df('0x3e')][_0xa6df('0x49')]({'where':{'id':_0x3c7f40[_0xa6df('0x44')]['id']}})[_0xa6df('0x26')](handleEntityNotFound(_0x8f7801,null))[_0xa6df('0x26')](function(_0x2c11f7){if(_0x2c11f7){_0x4e92a=_0x2c11f7;_0xa011d[_0xa6df('0x32')]=_[_0xa6df('0x30')](db[_0xa6df('0x4a')][_0xa6df('0x2c')]);_0xa011d[_0xa6df('0x2f')]=_['keys'](_0x3c7f40[_0xa6df('0x2f')]);_0xa011d[_0xa6df('0x3a')]=_[_0xa6df('0x31')](_0xa011d[_0xa6df('0x32')],_0xa011d[_0xa6df('0x2f')]);_0x2e7575['attributes']=_[_0xa6df('0x31')](_0xa011d['model'],qs[_0xa6df('0x34')](_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x34')]));_0x2e7575[_0xa6df('0x33')]=_0x2e7575[_0xa6df('0x33')][_0xa6df('0x35')]?_0x2e7575[_0xa6df('0x33')]:_0xa011d[_0xa6df('0x32')];_0x2e7575[_0xa6df('0x4b')]=qs[_0xa6df('0x38')](_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x38')]);_0x2e7575[_0xa6df('0x39')]=qs[_0xa6df('0x3a')](_[_0xa6df('0x4c')](_0x3c7f40[_0xa6df('0x2f')],_0xa011d[_0xa6df('0x3a')]));if(_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x3b')]){_0x2e7575[_0xa6df('0x39')]=_[_0xa6df('0x3c')](_0x2e7575[_0xa6df('0x39')],{'$or':_[_0xa6df('0x2b')](_0x2e7575[_0xa6df('0x33')],function(_0x3ad81a){var _0x18d0ae={};_0x18d0ae[_0x3ad81a]={'$like':'%'+_0x3c7f40['query'][_0xa6df('0x3b')]+'%'};return _0x18d0ae;})});}_0x2e7575=_[_0xa6df('0x3c')]({},_0x2e7575,_0x3c7f40[_0xa6df('0x3d')]);return _0x4e92a[_0xa6df('0x48')](_0x2e7575);}})[_0xa6df('0x26')](function(_0x309718){if(_0x309718){_0x5efea2=_0x309718['length'];if(!_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x36')](_0xa6df('0x37'))){_0x2e7575[_0xa6df('0x1c')]=qs[_0xa6df('0x1c')](_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x1c')]);_0x2e7575[_0xa6df('0x1b')]=qs[_0xa6df('0x1b')](_0x3c7f40['query'][_0xa6df('0x1b')]);}return _0x4e92a[_0xa6df('0x48')](_0x2e7575);}})[_0xa6df('0x26')](function(_0x1c15cd){if(_0x1c15cd){return _0x1c15cd?{'count':_0x5efea2,'rows':_0x1c15cd}:null;}})[_0xa6df('0x26')](respondWithResult(_0x8f7801,null))[_0xa6df('0x42')](handleError(_0x8f7801,null));};exports[_0xa6df('0x4d')]=function(_0x442ca0,_0x3635ef,_0x2fa7d8){if(_0x442ca0[_0xa6df('0x47')]['id']){delete _0x442ca0[_0xa6df('0x47')]['id'];}return db['Dynamics365Account'][_0xa6df('0x49')]({'where':{'id':_0x442ca0[_0xa6df('0x44')]['id']}})[_0xa6df('0x26')](handleEntityNotFound(_0x3635ef,null))[_0xa6df('0x26')](function(_0x579176){if(_0x579176){_0x442ca0[_0xa6df('0x47')][_0xa6df('0x4e')]=_0x579176['id'];_0x442ca0['body']['Subjects']=integrations[_0xa6df('0x4f')](_0x442ca0['body'][_0xa6df('0x50')],_0x442ca0[_0xa6df('0x47')][_0xa6df('0x2d')]);_0x442ca0[_0xa6df('0x47')][_0xa6df('0x51')]=integrations['getDescriptions'](_0x442ca0[_0xa6df('0x47')][_0xa6df('0x50')],_0x442ca0[_0xa6df('0x47')][_0xa6df('0x2d')]);return db['Dynamics365Configuration'][_0xa6df('0x46')](_0x442ca0[_0xa6df('0x47')],{'include':[{'model':db['Dynamics365Field'],'as':_0xa6df('0x52')},{'model':db['Dynamics365Field'],'as':_0xa6df('0x51')}]});}return null;})[_0xa6df('0x26')](respondWithResult(_0x3635ef,null))[_0xa6df('0x42')](handleError(_0x3635ef,null));};exports['getFields']=function(_0x34da54,_0xfd6bde,_0x20bea9){var _0x340e3b=_0x34da54[_0xa6df('0x2f')][_0xa6df('0x53')];var _0x3ac955=_0x340e3b==='incident'?_0xa6df('0x54'):_0xa6df('0x55');var _0x239dc0='';var _0x5cdce7='';var _0x578c14='';var _0x56d19f='';var _0x3d934c='';var _0x4c3245='';var _0x50e17a='';var _0x3977c8='';var _0x31633a=['title','description','customerid','ownerid',_0xa6df('0x56'),'subject',_0xa6df('0x57'),_0xa6df('0x58'),_0xa6df('0x59'),_0xa6df('0x5a')];var _0x3ed015=[_0xa6df('0x5b'),'accountidyominame',_0xa6df('0x5c'),_0xa6df('0x5d'),_0xa6df('0x5e'),'contactidyominame',_0xa6df('0x5f'),'contractidname',_0xa6df('0x60'),_0xa6df('0x61'),'createdbyname','createdbyyominame',_0xa6df('0x62'),_0xa6df('0x63'),_0xa6df('0x64'),'customeridname',_0xa6df('0x65'),_0xa6df('0x66'),'emailaddress',_0xa6df('0x67'),_0xa6df('0x68'),_0xa6df('0x69'),_0xa6df('0x6a'),_0xa6df('0x6b'),_0xa6df('0x6c'),_0xa6df('0x6d'),_0xa6df('0x6e'),_0xa6df('0x6f'),_0xa6df('0x70'),_0xa6df('0x71'),_0xa6df('0x72'),_0xa6df('0x73'),_0xa6df('0x74'),'modifiedbyname',_0xa6df('0x75'),_0xa6df('0x76'),_0xa6df('0x77'),_0xa6df('0x78'),'msdyn_incidenttypename',_0xa6df('0x79'),_0xa6df('0x7a'),_0xa6df('0x7b'),'overriddencreatedon',_0xa6df('0x7c'),_0xa6df('0x7d'),_0xa6df('0x7e'),_0xa6df('0x7f'),_0xa6df('0x80'),_0xa6df('0x81'),_0xa6df('0x82'),_0xa6df('0x83'),_0xa6df('0x84'),'resolveby',_0xa6df('0x85'),_0xa6df('0x86'),_0xa6df('0x87'),'responsiblecontactidyominame',_0xa6df('0x88'),_0xa6df('0x89'),_0xa6df('0x8a'),_0xa6df('0x8b'),_0xa6df('0x8c'),_0xa6df('0x8d'),_0xa6df('0x8e'),_0xa6df('0x8f'),'timezoneruleversionnumber',_0xa6df('0x90'),'traversedpath',_0xa6df('0x91'),_0xa6df('0x92')];var _0x87baa9=_0x31633a[_0xa6df('0x93')](_0x3ed015);return db[_0xa6df('0x3e')][_0xa6df('0x49')]({'where':{'id':_0x34da54[_0xa6df('0x44')]['id']},'attributes':['id',_0xa6df('0x94'),_0xa6df('0x95'),'remoteUri',_0xa6df('0x96'),_0xa6df('0x97'),_0xa6df('0x98')]})['then'](handleEntityNotFound(_0xfd6bde,null))[_0xa6df('0x26')](function(_0x14b0eb){if(_0x14b0eb){_0x3977c8=_0x14b0eb['remoteUri'];var _0x36d98e=_0x3977c8[_0xa6df('0x99')](-0x1);if(_0x36d98e==='/'){_0x3977c8=_0x3977c8[_0xa6df('0x9a')](0x0,_0x3977c8[_0xa6df('0x9b')](_0x36d98e));}_0x50e17a=util[_0xa6df('0x9c')](_0xa6df('0x9d'),_0x3977c8);var _0x249b22={'method':'POST','uri':_0xa6df('0x9e')+_0x14b0eb[_0xa6df('0x96')]+_0xa6df('0x9f'),'form':{'client_id':_0x14b0eb['clientId'],'resource':_0x3977c8,'username':_0x14b0eb[_0xa6df('0x94')],'password':_0x14b0eb[_0xa6df('0x95')],'grant_type':'password','client_secret':_0x14b0eb['clientSecret']},'json':!![]};return rp(_0x249b22);}})[_0xa6df('0x26')](function(_0x1e0d0d){_0x4c3245=_0x1e0d0d[_0xa6df('0xa0')];var _0x54e8dc={'method':'GET','uri':encodeURI(_0x50e17a+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x3ac955+'\x27'),'headers':{'Authorization':_0xa6df('0xa1')+_0x4c3245,'If-None-Match':null,'OData-Version':_0xa6df('0xa2')},'json':!![]};return rp(_0x54e8dc);})[_0xa6df('0x26')](function(_0x22d52c){var _0x28edb1=_0x22d52c[_0xa6df('0xa3')][0x0];var _0x48924f=_0x28edb1[_0xa6df('0xa4')];var _0x332452={'method':_0xa6df('0xa5'),'uri':_0x50e17a+_0xa6df('0xa6')+_0x48924f+_0xa6df('0xa7'),'headers':{'Authorization':'Bearer\x20'+_0x4c3245,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x332452);})['then'](function(_0x1b2fd4){_0x239dc0=_0x1b2fd4;_0x5cdce7=_0x239dc0['Attributes'];_0x5cdce7=_[_0xa6df('0xa8')](_0x5cdce7,function(_0x473331){return!_0x87baa9['includes'](_0x473331[_0xa6df('0xa9')]);});var _0x31bc83=[];var _0x1172cf=[];_0x5cdce7[_0xa6df('0xaa')](function(_0x2007a3){if(_0x2007a3['@odata.type']){var _0x2fbc12=_0x2007a3[_0xa6df('0xab')][_0xa6df('0x9a')](_0x2007a3[_0xa6df('0xab')]['lastIndexOf']('.')+0x1);if(_0x2fbc12===_0xa6df('0xac')){_0x31bc83['push'](getSelectList(_0x50e17a,_0x340e3b,_0x1172cf,_0x239dc0[_0xa6df('0xa4')],_0x2007a3[_0xa6df('0xa4')],_0x4c3245));}}});return Promise['all'](_0x31bc83);})[_0xa6df('0x26')](function(_0x54bae4){_0x578c14=_0x54bae4[0x0];var _0x2d5d88=[];var _0x4acff5=[];_0x5cdce7[_0xa6df('0xaa')](function(_0x117903){if(!_['isNil'](_0x117903[_0xa6df('0xab')])){var _0x41018c=_0x117903['@odata.type'][_0xa6df('0x9a')](_0x117903[_0xa6df('0xab')][_0xa6df('0x9b')]('.')+0x1);if(_0x41018c===_0xa6df('0xad')){_0x2d5d88[_0xa6df('0xae')](getBooleanList(_0x50e17a,_0x340e3b,_0x4acff5,_0x239dc0[_0xa6df('0xa4')],_0x117903[_0xa6df('0xa4')],_0x4c3245));}}});return Promise['all'](_0x2d5d88);})[_0xa6df('0x26')](function(_0x36636b){_0x56d19f=_0x36636b[0x0];var _0x3ed813=[];var _0x566287=[];_0x5cdce7[_0xa6df('0xaa')](function(_0x26ab8d){if(_0x26ab8d[_0xa6df('0xab')]){var _0x2d2724=_0x26ab8d[_0xa6df('0xab')]['substring'](_0x26ab8d[_0xa6df('0xab')][_0xa6df('0x9b')]('.')+0x1);if(_0x2d2724===_0xa6df('0xaf')||_0x2d2724==='DoubleAttributeMetadata'||_0x2d2724===_0xa6df('0xb0')||_0x2d2724===_0xa6df('0xb1')||_0x2d2724===_0xa6df('0xb2')||_0x2d2724===_0xa6df('0xb3')||_0x2d2724==='StatusAttributeMetadata'||_0x2d2724===_0xa6df('0xb4')||_0x2d2724===_0xa6df('0xb5')||_0x2d2724===_0xa6df('0xb6')){_0x3ed813[_0xa6df('0xae')](getInputList(_0x50e17a,_0x340e3b,_0x2d2724,_0x566287,_0x239dc0['MetadataId'],_0x26ab8d[_0xa6df('0xa4')],_0x4c3245));}}});return Promise[_0xa6df('0xb7')](_0x3ed813);})['then'](function(_0x3dfae1){_0x3d934c=_0x3dfae1[0x0];var _0xf22efa=_0x578c14[_0xa6df('0x93')](_0x56d19f)['concat'](_0x3d934c);var _0x17272b={'count':_0xf22efa['length'],'rows':_0xf22efa};return _0x17272b;})['then'](respondWithResult(_0xfd6bde,null))['catch'](function(_0x38b4a6){var _0x5a7f15=_0x34da54[_0xa6df('0x2f')][_0xa6df('0xb8')]?0x1f4:_0x38b4a6[_0xa6df('0xb9')]||0x1f4;logger[_0xa6df('0x27')](_0x38b4a6[_0xa6df('0xba')]);delete _0x38b4a6['name'];if(_0x5a7f15===0x191){_0x5a7f15=0x190;}_0xfd6bde[_0xa6df('0x1a')](_0x5a7f15)[_0xa6df('0x29')](_0x34da54[_0xa6df('0x2f')][_0xa6df('0xb8')]?{'message':_0xa6df('0xbb'),'statusCode':_0x38b4a6['statusCode']}:_0x38b4a6);});};function getSelectList(_0x58b0e4,_0x162cc2,_0x48a79a,_0x453f81,_0x58f83d,_0x25e5a5){var _0x8da4fe={'method':'GET','uri':_0x58b0e4+'EntityDefinitions('+_0x453f81+')/Attributes('+_0x58f83d+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xa6df('0xbc'),'headers':{'Authorization':_0xa6df('0xa1')+_0x25e5a5,'If-None-Match':null,'OData-Version':_0xa6df('0xa2')},'json':!![]};return rp(_0x8da4fe)[_0xa6df('0x26')](function(_0x9d338c){var _0x129137=[];var _0xd34c0b=_0x9d338c[_0xa6df('0xbd')]['Options'];_0xd34c0b[_0xa6df('0xaa')](function(_0x23da8d){_0x129137[_0xa6df('0xae')]({'name':_0x23da8d[_0xa6df('0xbe')][_0xa6df('0xbf')][_0xa6df('0xbe')],'value':String(_0x23da8d[_0xa6df('0xc0')])});});var _0xe6ca07={'id':_0x162cc2+'_'+_0x9d338c[_0xa6df('0xa9')],'name':_0x9d338c[_0xa6df('0xc1')]['UserLocalizedLabel'][_0xa6df('0xbe')],'custom':![],'options':_0x129137};_0x48a79a[_0xa6df('0xae')](_0xe6ca07);return _0x48a79a;});}function getBooleanList(_0x35cc97,_0x5490f6,_0x536a44,_0x227552,_0x5d7dc3,_0x3886f7){var _0x516974={'method':_0xa6df('0xa5'),'uri':_0x35cc97+_0xa6df('0xa6')+_0x227552+_0xa6df('0xc2')+_0x5d7dc3+_0xa6df('0xc3'),'headers':{'Authorization':_0xa6df('0xa1')+_0x3886f7,'If-None-Match':null,'OData-Version':_0xa6df('0xa2')},'json':!![]};return rp(_0x516974)[_0xa6df('0x26')](function(_0x4d24d8){var _0x1754c4=[];_0x1754c4['push']({'name':_0x4d24d8[_0xa6df('0xbd')][_0xa6df('0xc4')][_0xa6df('0xbe')][_0xa6df('0xbf')]['Label'],'value':_0xa6df('0xc5')},{'name':_0x4d24d8[_0xa6df('0xbd')]['FalseOption'][_0xa6df('0xbe')][_0xa6df('0xbf')][_0xa6df('0xbe')],'value':'false'});var _0x4eeaf7={'id':_0x5490f6+'_'+_0x4d24d8[_0xa6df('0xa9')],'name':_0x4d24d8['DisplayName']['UserLocalizedLabel'][_0xa6df('0xbe')],'custom':![],'options':_0x1754c4};_0x536a44[_0xa6df('0xae')](_0x4eeaf7);return _0x536a44;});}function getInputList(_0x58d0b1,_0x486bfa,_0x3daaca,_0x41a554,_0x29487d,_0x423d72,_0x3b6947){var _0x166d54={'method':_0xa6df('0xa5'),'uri':_0x58d0b1+_0xa6df('0xa6')+_0x29487d+')/Attributes('+_0x423d72+_0xa6df('0xc6')+_0x3daaca+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xa6df('0xa1')+_0x3b6947,'If-None-Match':null,'OData-Version':_0xa6df('0xa2')},'json':!![]};return rp(_0x166d54)['then'](function(_0x315a25){var _0x589300={'id':_0x486bfa+'_'+_0x315a25[_0xa6df('0xa9')],'name':_0x315a25[_0xa6df('0xc1')][_0xa6df('0xbf')]?_0x315a25[_0xa6df('0xc1')][_0xa6df('0xbf')][_0xa6df('0xbe')]:_0x315a25['LogicalName'],'custom':![],'options':[]};_0x41a554[_0xa6df('0xae')](_0x589300);return _0x41a554;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 3707795..2ed7662 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(_0x12b341,_0x3e0957){var _0x1a04c8=function(_0x18b005){while(--_0x18b005){_0x12b341['push'](_0x12b341['shift']());}};_0x1a04c8(++_0x3e0957);}(_0x757a,0xde));var _0xa757=function(_0x112dca,_0x7b61f7){_0x112dca=_0x112dca-0x0;var _0x205ec2=_0x757a[_0x112dca];return _0x205ec2;};'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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x1d74b4,_0x5522ae){var _0x245c95=function(_0x511b1a){while(--_0x511b1a){_0x1d74b4['push'](_0x1d74b4['shift']());}};_0x245c95(++_0x5522ae);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','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 5740dbe..2cf3db5 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 _0xf41c=['Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','limit','map','model','include','find','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf41c,0x199));var _0xcf41=function(_0x3b7a82,_0x334bf4){_0x3b7a82=_0x3b7a82-0x0;var _0x25292b=_0xf41c[_0x3b7a82];return _0x25292b;};'use strict';var _=require(_0xcf41('0x0'));var util=require(_0xcf41('0x1'));var moment=require(_0xcf41('0x2'));var BPromise=require(_0xcf41('0x3'));var rs=require(_0xcf41('0x4'));var fs=require('fs');var Redis=require(_0xcf41('0x5'));var db=require(_0xcf41('0x6'))['db'];var utils=require(_0xcf41('0x7'));var logger=require(_0xcf41('0x8'))(_0xcf41('0x9'));var config=require(_0xcf41('0xa'));var jayson=require(_0xcf41('0xb'));var client=jayson[_0xcf41('0xc')][_0xcf41('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5388af,_0x61ad60,_0x3216fb){return new BPromise(function(_0x4c8703,_0x19f355){return client[_0xcf41('0xe')](_0x5388af,_0x3216fb)[_0xcf41('0xf')](function(_0x282272){logger[_0xcf41('0x10')](_0xcf41('0x11'),_0x61ad60,_0xcf41('0x12'));logger[_0xcf41('0x13')](_0xcf41('0x14'),_0x61ad60,_0xcf41('0x12'),JSON[_0xcf41('0x15')](_0x282272));if(_0x282272[_0xcf41('0x16')]){if(_0x282272['error'][_0xcf41('0x17')]===0x1f4){logger[_0xcf41('0x16')]('Dynamics365Account,\x20%s,\x20%s',_0x61ad60,_0x282272[_0xcf41('0x16')]['message']);return _0x19f355(_0x282272[_0xcf41('0x16')][_0xcf41('0x18')]);}logger[_0xcf41('0x16')](_0xcf41('0x11'),_0x61ad60,_0x282272['error'][_0xcf41('0x18')]);return _0x4c8703(_0x282272[_0xcf41('0x16')]['message']);}else{logger[_0xcf41('0x10')](_0xcf41('0x11'),_0x61ad60,_0xcf41('0x12'));_0x4c8703(_0x282272[_0xcf41('0x19')][_0xcf41('0x18')]);}})[_0xcf41('0x1a')](function(_0x1e3011){logger[_0xcf41('0x16')](_0xcf41('0x11'),_0x61ad60,_0x1e3011);_0x19f355(_0x1e3011);});});}exports[_0xcf41('0x1b')]=function(_0x133a27){var _0x1deb12=this;return new Promise(function(_0x1aa57b,_0x475811){return db[_0xcf41('0x1c')]['findAll']({'raw':_0x133a27[_0xcf41('0x1d')]?_0x133a27['options'][_0xcf41('0x1e')]===undefined?!![]:![]:!![],'where':_0x133a27[_0xcf41('0x1d')]?_0x133a27[_0xcf41('0x1d')][_0xcf41('0x1f')]||null:null,'attributes':_0x133a27['options']?_0x133a27[_0xcf41('0x1d')][_0xcf41('0x20')]||null:null,'limit':_0x133a27[_0xcf41('0x1d')]?_0x133a27[_0xcf41('0x1d')][_0xcf41('0x21')]||null:null,'include':_0x133a27[_0xcf41('0x1d')]?_0x133a27[_0xcf41('0x1d')]['include']?_[_0xcf41('0x22')](_0x133a27['options']['include'],function(_0xc9a96f){return{'model':db[_0xc9a96f[_0xcf41('0x23')]],'as':_0xc9a96f['as'],'attributes':_0xc9a96f[_0xcf41('0x20')],'include':_0xc9a96f[_0xcf41('0x24')]?_[_0xcf41('0x22')](_0xc9a96f[_0xcf41('0x24')],function(_0x1fb8b5){return{'model':db[_0x1fb8b5[_0xcf41('0x23')]],'as':_0x1fb8b5['as'],'attributes':_0x1fb8b5[_0xcf41('0x20')],'include':_0x1fb8b5['include']?_[_0xcf41('0x22')](_0x1fb8b5[_0xcf41('0x24')],function(_0x238c78){return{'model':db[_0x238c78[_0xcf41('0x23')]],'as':_0x238c78['as'],'attributes':_0x238c78[_0xcf41('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcf41('0xf')](function(_0x41cb10){logger[_0xcf41('0x10')](_0xcf41('0x1b'),_0x133a27);logger[_0xcf41('0x13')](_0xcf41('0x1b'),_0x133a27,JSON[_0xcf41('0x15')](_0x41cb10));_0x1aa57b(_0x41cb10);})[_0xcf41('0x1a')](function(_0x2a6da5){logger[_0xcf41('0x16')]('GetDynamics365Account',_0x2a6da5[_0xcf41('0x18')],_0x133a27);_0x475811(_0x1deb12[_0xcf41('0x16')](0x1f4,_0x2a6da5[_0xcf41('0x18')]));});});};exports['ShowDynamics365Account']=function(_0x98f02){var _0x5d2e54=this;return new Promise(function(_0x2b5b7a,_0x19f91a){return db[_0xcf41('0x1c')][_0xcf41('0x25')]({'raw':_0x98f02[_0xcf41('0x1d')]?_0x98f02[_0xcf41('0x1d')][_0xcf41('0x1e')]===undefined?!![]:![]:!![],'where':_0x98f02['options']?_0x98f02['options'][_0xcf41('0x1f')]||null:null,'attributes':_0x98f02[_0xcf41('0x1d')]?_0x98f02[_0xcf41('0x1d')]['attributes']||null:null,'include':_0x98f02[_0xcf41('0x1d')]?_0x98f02[_0xcf41('0x1d')]['include']?_['map'](_0x98f02['options'][_0xcf41('0x24')],function(_0x6266ef){return{'model':db[_0x6266ef[_0xcf41('0x23')]],'as':_0x6266ef['as'],'attributes':_0x6266ef[_0xcf41('0x20')],'include':_0x6266ef[_0xcf41('0x24')]?_[_0xcf41('0x22')](_0x6266ef[_0xcf41('0x24')],function(_0x3b7f2d){return{'model':db[_0x3b7f2d['model']],'as':_0x3b7f2d['as'],'attributes':_0x3b7f2d[_0xcf41('0x20')],'include':_0x3b7f2d[_0xcf41('0x24')]?_[_0xcf41('0x22')](_0x3b7f2d['include'],function(_0x2a5c47){return{'model':db[_0x2a5c47[_0xcf41('0x23')]],'as':_0x2a5c47['as'],'attributes':_0x2a5c47[_0xcf41('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcf41('0xf')](function(_0x344116){logger['info'](_0xcf41('0x26'),_0x98f02);logger[_0xcf41('0x13')](_0xcf41('0x26'),_0x98f02,JSON[_0xcf41('0x15')](_0x344116));_0x2b5b7a(_0x344116);})[_0xcf41('0x1a')](function(_0x170914){logger['error'](_0xcf41('0x26'),_0x170914[_0xcf41('0x18')],_0x98f02);_0x19f91a(_0x5d2e54['error'](0x1f4,_0x170914[_0xcf41('0x18')]));});});}; \ No newline at end of file +var _0x4d46=['client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','stringify','find','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x406519,_0x4b5703){var _0x35d221=function(_0x38f6f1){while(--_0x38f6f1){_0x406519['push'](_0x406519['shift']());}};_0x35d221(++_0x4b5703);}(_0x4d46,0x18d));var _0x64d4=function(_0x455d3b,_0x274d8b){_0x455d3b=_0x455d3b-0x0;var _0x49cb51=_0x4d46[_0x455d3b];return _0x49cb51;};'use strict';var _=require('lodash');var util=require(_0x64d4('0x0'));var moment=require(_0x64d4('0x1'));var BPromise=require(_0x64d4('0x2'));var rs=require(_0x64d4('0x3'));var fs=require('fs');var Redis=require(_0x64d4('0x4'));var db=require(_0x64d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x64d4('0x6'))(_0x64d4('0x7'));var config=require(_0x64d4('0x8'));var jayson=require(_0x64d4('0x9'));var client=jayson[_0x64d4('0xa')][_0x64d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcbdff2,_0x1d64d7,_0x3fd904){return new BPromise(function(_0x2f2dfc,_0xd8f441){return client[_0x64d4('0xc')](_0xcbdff2,_0x3fd904)[_0x64d4('0xd')](function(_0x34ea5c){logger[_0x64d4('0xe')](_0x64d4('0xf'),_0x1d64d7,_0x64d4('0x10'));logger[_0x64d4('0x11')](_0x64d4('0x12'),_0x1d64d7,_0x64d4('0x10'),JSON['stringify'](_0x34ea5c));if(_0x34ea5c[_0x64d4('0x13')]){if(_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x14')]===0x1f4){logger[_0x64d4('0x13')](_0x64d4('0xf'),_0x1d64d7,_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x15')]);return _0xd8f441(_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x15')]);}logger[_0x64d4('0x13')](_0x64d4('0xf'),_0x1d64d7,_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x15')]);return _0x2f2dfc(_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x15')]);}else{logger['info'](_0x64d4('0xf'),_0x1d64d7,_0x64d4('0x10'));_0x2f2dfc(_0x34ea5c[_0x64d4('0x16')][_0x64d4('0x15')]);}})[_0x64d4('0x17')](function(_0x2e159c){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1d64d7,_0x2e159c);_0xd8f441(_0x2e159c);});});}exports[_0x64d4('0x18')]=function(_0x54c829){var _0x23f4cc=this;return new Promise(function(_0x5e4fe1,_0x327392){return db[_0x64d4('0x19')][_0x64d4('0x1a')]({'raw':_0x54c829[_0x64d4('0x1b')]?_0x54c829['options'][_0x64d4('0x1c')]===undefined?!![]:![]:!![],'where':_0x54c829['options']?_0x54c829[_0x64d4('0x1b')]['where']||null:null,'attributes':_0x54c829[_0x64d4('0x1b')]?_0x54c829['options'][_0x64d4('0x1d')]||null:null,'limit':_0x54c829[_0x64d4('0x1b')]?_0x54c829[_0x64d4('0x1b')][_0x64d4('0x1e')]||null:null,'include':_0x54c829[_0x64d4('0x1b')]?_0x54c829['options'][_0x64d4('0x1f')]?_[_0x64d4('0x20')](_0x54c829[_0x64d4('0x1b')][_0x64d4('0x1f')],function(_0x41baf9){return{'model':db[_0x41baf9[_0x64d4('0x21')]],'as':_0x41baf9['as'],'attributes':_0x41baf9['attributes'],'include':_0x41baf9[_0x64d4('0x1f')]?_[_0x64d4('0x20')](_0x41baf9[_0x64d4('0x1f')],function(_0x499697){return{'model':db[_0x499697[_0x64d4('0x21')]],'as':_0x499697['as'],'attributes':_0x499697[_0x64d4('0x1d')],'include':_0x499697[_0x64d4('0x1f')]?_['map'](_0x499697[_0x64d4('0x1f')],function(_0x5a52e8){return{'model':db[_0x5a52e8[_0x64d4('0x21')]],'as':_0x5a52e8['as'],'attributes':_0x5a52e8[_0x64d4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x64d4('0xd')](function(_0x3097b6){logger[_0x64d4('0xe')]('GetDynamics365Account',_0x54c829);logger['debug'](_0x64d4('0x18'),_0x54c829,JSON[_0x64d4('0x22')](_0x3097b6));_0x5e4fe1(_0x3097b6);})[_0x64d4('0x17')](function(_0x5817e5){logger[_0x64d4('0x13')]('GetDynamics365Account',_0x5817e5[_0x64d4('0x15')],_0x54c829);_0x327392(_0x23f4cc[_0x64d4('0x13')](0x1f4,_0x5817e5[_0x64d4('0x15')]));});});};exports['ShowDynamics365Account']=function(_0x32cb0f){var _0x156d18=this;return new Promise(function(_0x51ebc9,_0x71d4e5){return db['Dynamics365Account'][_0x64d4('0x23')]({'raw':_0x32cb0f['options']?_0x32cb0f[_0x64d4('0x1b')][_0x64d4('0x1c')]===undefined?!![]:![]:!![],'where':_0x32cb0f[_0x64d4('0x1b')]?_0x32cb0f[_0x64d4('0x1b')]['where']||null:null,'attributes':_0x32cb0f[_0x64d4('0x1b')]?_0x32cb0f[_0x64d4('0x1b')]['attributes']||null:null,'include':_0x32cb0f[_0x64d4('0x1b')]?_0x32cb0f[_0x64d4('0x1b')][_0x64d4('0x1f')]?_['map'](_0x32cb0f[_0x64d4('0x1b')][_0x64d4('0x1f')],function(_0x13bd7c){return{'model':db[_0x13bd7c[_0x64d4('0x21')]],'as':_0x13bd7c['as'],'attributes':_0x13bd7c[_0x64d4('0x1d')],'include':_0x13bd7c[_0x64d4('0x1f')]?_[_0x64d4('0x20')](_0x13bd7c['include'],function(_0x422282){return{'model':db[_0x422282[_0x64d4('0x21')]],'as':_0x422282['as'],'attributes':_0x422282[_0x64d4('0x1d')],'include':_0x422282[_0x64d4('0x1f')]?_[_0x64d4('0x20')](_0x422282[_0x64d4('0x1f')],function(_0x4fc502){return{'model':db[_0x4fc502[_0x64d4('0x21')]],'as':_0x4fc502['as'],'attributes':_0x4fc502[_0x64d4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x64d4('0xd')](function(_0x5af5db){logger[_0x64d4('0xe')]('ShowDynamics365Account',_0x32cb0f);logger[_0x64d4('0x11')](_0x64d4('0x24'),_0x32cb0f,JSON['stringify'](_0x5af5db));_0x51ebc9(_0x5af5db);})[_0x64d4('0x17')](function(_0x533924){logger['error'](_0x64d4('0x24'),_0x533924[_0x64d4('0x15')],_0x32cb0f);_0x71d4e5(_0x156d18[_0x64d4('0x13')](0x1f4,_0x533924[_0x64d4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index fe05c19..55d4853 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 _0x96d8=['update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create'];(function(_0x1ec7bb,_0x4d1249){var _0x56c1ee=function(_0x5eba7c){while(--_0x5eba7c){_0x1ec7bb['push'](_0x1ec7bb['shift']());}};_0x56c1ee(++_0x4d1249);}(_0x96d8,0x1e2));var _0x896d=function(_0x9c7854,_0x1788a5){_0x9c7854=_0x9c7854-0x0;var _0x989955=_0x96d8[_0x9c7854];return _0x989955;};'use strict';var multer=require(_0x896d('0x0'));var util=require(_0x896d('0x1'));var path=require(_0x896d('0x2'));var timeout=require(_0x896d('0x3'));var express=require(_0x896d('0x4'));var router=express[_0x896d('0x5')]();var fs_extra=require(_0x896d('0x6'));var auth=require(_0x896d('0x7'));var interaction=require(_0x896d('0x8'));var config=require(_0x896d('0x9'));var controller=require(_0x896d('0xa'));router[_0x896d('0xb')]('/',auth[_0x896d('0xc')](),controller[_0x896d('0xd')]);router['get'](_0x896d('0xe'),auth[_0x896d('0xc')](),controller[_0x896d('0xf')]);router[_0x896d('0xb')](_0x896d('0x10'),auth[_0x896d('0xc')](),controller[_0x896d('0x11')]);router[_0x896d('0xb')]('/:id/subjects',auth[_0x896d('0xc')](),controller[_0x896d('0x12')]);router[_0x896d('0xb')](_0x896d('0x13'),auth[_0x896d('0xc')](),controller['getDescriptions']);router[_0x896d('0x14')]('/',auth[_0x896d('0xc')](),controller[_0x896d('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x896d('0x16')]);router['delete'](_0x896d('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x896d('0x17')]=router; \ No newline at end of file +var _0xcf3d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x21090b,_0x39dd3b){var _0x3c68d7=function(_0x28ecd4){while(--_0x28ecd4){_0x21090b['push'](_0x21090b['shift']());}};_0x3c68d7(++_0x39dd3b);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x4ee75d,_0x4f8071){_0x4ee75d=_0x4ee75d-0x0;var _0x50de26=_0xcf3d[_0x4ee75d];return _0x50de26;};'use strict';var multer=require(_0xdcf3('0x0'));var util=require(_0xdcf3('0x1'));var path=require(_0xdcf3('0x2'));var timeout=require(_0xdcf3('0x3'));var express=require('express');var router=express[_0xdcf3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdcf3('0x5'));var interaction=require(_0xdcf3('0x6'));var config=require(_0xdcf3('0x7'));var controller=require(_0xdcf3('0x8'));router[_0xdcf3('0x9')]('/',auth[_0xdcf3('0xa')](),controller['index']);router[_0xdcf3('0x9')]('/:id',auth[_0xdcf3('0xa')](),controller[_0xdcf3('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xdcf3('0xc')]);router[_0xdcf3('0x9')](_0xdcf3('0xd'),auth[_0xdcf3('0xa')](),controller[_0xdcf3('0xe')]);router[_0xdcf3('0x9')](_0xdcf3('0xf'),auth[_0xdcf3('0xa')](),controller[_0xdcf3('0x10')]);router['post']('/',auth[_0xdcf3('0xa')](),controller[_0xdcf3('0x11')]);router['put'](_0xdcf3('0x12'),auth[_0xdcf3('0xa')](),controller[_0xdcf3('0x13')]);router[_0xdcf3('0x14')]('/:id',auth[_0xdcf3('0xa')](),controller[_0xdcf3('0x15')]);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 2d85b77..19037c1 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 _0x6203=['ENUM','phonecall','incident','sequelize','exports','STRING'];(function(_0x4db4da,_0x2750d7){var _0x4c1fdc=function(_0x22d764){while(--_0x22d764){_0x4db4da['push'](_0x4db4da['shift']());}};_0x4c1fdc(++_0x2750d7);}(_0x6203,0x81));var _0x3620=function(_0x14b236,_0x417fe3){_0x14b236=_0x14b236-0x0;var _0x302375=_0x6203[_0x14b236];return _0x302375;};'use strict';var Sequelize=require(_0x3620('0x0'));module[_0x3620('0x1')]={'name':{'type':Sequelize[_0x3620('0x2')]},'description':{'type':Sequelize[_0x3620('0x2')]},'ticketType':{'type':Sequelize[_0x3620('0x3')]('incident',_0x3620('0x4')),'defaultValue':_0x3620('0x5')}}; \ No newline at end of file +var _0x32d8=['incident','phonecall','sequelize','exports','STRING','ENUM'];(function(_0x31ecd2,_0x39b17d){var _0x5ef9f2=function(_0x4478b6){while(--_0x4478b6){_0x31ecd2['push'](_0x31ecd2['shift']());}};_0x5ef9f2(++_0x39b17d);}(_0x32d8,0x19a));var _0x832d=function(_0x44d34f,_0x4f98f9){_0x44d34f=_0x44d34f-0x0;var _0x2eb329=_0x32d8[_0x44d34f];return _0x2eb329;};'use strict';var Sequelize=require(_0x832d('0x0'));module[_0x832d('0x1')]={'name':{'type':Sequelize[_0x832d('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x832d('0x3')](_0x832d('0x4'),_0x832d('0x5')),'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 1829edc..c7f943d 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 _0xb04b=['pick','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','Content-Range','apply','reject','update','then','end','sendStatus','error','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','create','body','catch','destroy','find','findOne','Dynamics365Field'];(function(_0x37a0cf,_0x5661a8){var _0x2b39d1=function(_0x4832e8){while(--_0x4832e8){_0x37a0cf['push'](_0x37a0cf['shift']());}};_0x2b39d1(++_0x5661a8);}(_0xb04b,0x132));var _0xbb04=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb04b[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xbb04('0x0'));var rimraf=require(_0xbb04('0x1'));var zipdir=require(_0xbb04('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbb04('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbb04('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbb04('0x5'));var csv=require(_0xbb04('0x6'));var ejs=require(_0xbb04('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb04('0x8'));var jsforce=require(_0xbb04('0x9'));var deskjs=require(_0xbb04('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbb04('0xb'));var Redis=require(_0xbb04('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xbb04('0xd'));var as=require(_0xbb04('0xe'));var hardwareService=require(_0xbb04('0xf'));var logger=require(_0xbb04('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbb04('0x11'));var db=require(_0xbb04('0x12'))['db'];function respondWithStatusCode(_0x211f5a,_0x2a4725){_0x2a4725=_0x2a4725||0xcc;return function(_0xf2e8f0){if(_0xf2e8f0){return _0x211f5a['sendStatus'](_0x2a4725);}return _0x211f5a[_0xbb04('0x13')](_0x2a4725)['end']();};}function respondWithResult(_0x4a75ed,_0x524633){_0x524633=_0x524633||0xc8;return function(_0x4d2e02){if(_0x4d2e02){return _0x4a75ed['status'](_0x524633)[_0xbb04('0x14')](_0x4d2e02);}};}function respondWithFilteredResult(_0x539bc8,_0x30c3dd){return function(_0x15ccee){if(_0x15ccee){var _0x4d147f=typeof _0x30c3dd[_0xbb04('0x15')]===_0xbb04('0x16')&&typeof _0x30c3dd[_0xbb04('0x17')]===_0xbb04('0x16');var _0x44e952=_0x15ccee['count'];var _0x569eca=_0x4d147f?0x0:_0x30c3dd[_0xbb04('0x15')];var _0x200f74=_0x4d147f?_0x15ccee['count']:_0x30c3dd['offset']+_0x30c3dd[_0xbb04('0x17')];var _0x8c5864;if(_0x200f74>=_0x44e952){_0x200f74=_0x44e952;_0x8c5864=0xc8;}else{_0x8c5864=0xce;}_0x539bc8['status'](_0x8c5864);return _0x539bc8['set'](_0xbb04('0x18'),_0x569eca+'-'+_0x200f74+'/'+_0x44e952)[_0xbb04('0x14')](_0x15ccee);}return null;};}function patchUpdates(_0x211ac2){return function(_0xf6f678){try{jsonpatch[_0xbb04('0x19')](_0xf6f678,_0x211ac2,!![]);}catch(_0x4b9b7b){return BPromise[_0xbb04('0x1a')](_0x4b9b7b);}return _0xf6f678['save']();};}function saveUpdates(_0x278816,_0x28f575){return function(_0x348c6a){if(_0x348c6a){return _0x348c6a[_0xbb04('0x1b')](_0x278816)[_0xbb04('0x1c')](function(_0x4aeb74){return _0x4aeb74;});}return null;};}function removeEntity(_0x3e723d,_0xaa963c){return function(_0x4b9674){if(_0x4b9674){return _0x4b9674['destroy']()[_0xbb04('0x1c')](function(){_0x3e723d[_0xbb04('0x13')](0xcc)[_0xbb04('0x1d')]();});}};}function handleEntityNotFound(_0x599b52,_0x331b47){return function(_0x3662c6){if(!_0x3662c6){_0x599b52[_0xbb04('0x1e')](0x194);}return _0x3662c6;};}function handleError(_0x2d5911,_0x276e26){_0x276e26=_0x276e26||0x1f4;return function(_0x564fa1){logger[_0xbb04('0x1f')](_0x564fa1['stack']);if(_0x564fa1[_0xbb04('0x20')]){delete _0x564fa1[_0xbb04('0x20')];}_0x2d5911['status'](_0x276e26)[_0xbb04('0x21')](_0x564fa1);};}exports[_0xbb04('0x22')]=function(_0x4d9131,_0x15eb2b){var _0x52ca73={},_0x33fec6={},_0x3f3b3a={'count':0x0,'rows':[]};var _0x1d39bd=_['map'](db[_0xbb04('0x23')][_0xbb04('0x24')],function(_0x490850){return{'name':_0x490850[_0xbb04('0x25')],'type':_0x490850[_0xbb04('0x26')]['key']};});_0x33fec6[_0xbb04('0x27')]=_[_0xbb04('0x28')](_0x1d39bd,_0xbb04('0x20'));_0x33fec6[_0xbb04('0x29')]=_[_0xbb04('0x2a')](_0x4d9131[_0xbb04('0x29')]);_0x33fec6[_0xbb04('0x2b')]=_[_0xbb04('0x2c')](_0x33fec6[_0xbb04('0x27')],_0x33fec6[_0xbb04('0x29')]);_0x52ca73[_0xbb04('0x2d')]=_[_0xbb04('0x2c')](_0x33fec6[_0xbb04('0x27')],qs['fields'](_0x4d9131[_0xbb04('0x29')][_0xbb04('0x2e')]));_0x52ca73['attributes']=_0x52ca73[_0xbb04('0x2d')][_0xbb04('0x2f')]?_0x52ca73[_0xbb04('0x2d')]:_0x33fec6[_0xbb04('0x27')];if(!_0x4d9131[_0xbb04('0x29')]['hasOwnProperty']('nolimit')){_0x52ca73[_0xbb04('0x17')]=qs['limit'](_0x4d9131[_0xbb04('0x29')][_0xbb04('0x17')]);_0x52ca73[_0xbb04('0x15')]=qs['offset'](_0x4d9131[_0xbb04('0x29')][_0xbb04('0x15')]);}_0x52ca73[_0xbb04('0x30')]=qs[_0xbb04('0x31')](_0x4d9131[_0xbb04('0x29')][_0xbb04('0x31')]);_0x52ca73[_0xbb04('0x32')]=qs['filters'](_['pick'](_0x4d9131['query'],_0x33fec6[_0xbb04('0x2b')]),_0x1d39bd);if(_0x4d9131['query'][_0xbb04('0x33')]){_0x52ca73[_0xbb04('0x32')]=_[_0xbb04('0x34')](_0x52ca73[_0xbb04('0x32')],{'$or':_[_0xbb04('0x28')](_0x1d39bd,function(_0x15175c){if(_0x15175c[_0xbb04('0x26')]!==_0xbb04('0x35')){var _0x191ea9={};_0x191ea9[_0x15175c[_0xbb04('0x20')]]={'$like':'%'+_0x4d9131[_0xbb04('0x29')][_0xbb04('0x33')]+'%'};return _0x191ea9;}})});}_0x52ca73=_[_0xbb04('0x34')]({},_0x52ca73,_0x4d9131[_0xbb04('0x36')]);var _0x1db146={'where':_0x52ca73[_0xbb04('0x32')]};return db[_0xbb04('0x23')][_0xbb04('0x37')](_0x1db146)['then'](function(_0x34b725){_0x3f3b3a[_0xbb04('0x37')]=_0x34b725;if(_0x4d9131[_0xbb04('0x29')][_0xbb04('0x38')]){_0x52ca73[_0xbb04('0x39')]=[{'all':!![]}];}return db[_0xbb04('0x23')][_0xbb04('0x3a')](_0x52ca73);})[_0xbb04('0x1c')](function(_0x5c17a2){_0x3f3b3a[_0xbb04('0x3b')]=_0x5c17a2;return _0x3f3b3a;})['then'](respondWithFilteredResult(_0x15eb2b,_0x52ca73))['catch'](handleError(_0x15eb2b,null));};exports[_0xbb04('0x3c')]=function(_0x28d65e,_0x5dacb1){var _0x12c31a={'raw':![],'where':{'id':_0x28d65e[_0xbb04('0x3d')]['id']}},_0x11321a={};_0x11321a['model']=_[_0xbb04('0x2a')](db[_0xbb04('0x23')][_0xbb04('0x24')]);_0x11321a['query']=_[_0xbb04('0x2a')](_0x28d65e[_0xbb04('0x29')]);_0x11321a[_0xbb04('0x2b')]=_['intersection'](_0x11321a[_0xbb04('0x27')],_0x11321a[_0xbb04('0x29')]);_0x12c31a[_0xbb04('0x2d')]=_[_0xbb04('0x2c')](_0x11321a[_0xbb04('0x27')],qs[_0xbb04('0x2e')](_0x28d65e['query'][_0xbb04('0x2e')]));_0x12c31a[_0xbb04('0x2d')]=_0x12c31a['attributes'][_0xbb04('0x2f')]?_0x12c31a[_0xbb04('0x2d')]:_0x11321a['model'];if(_0x28d65e['query'][_0xbb04('0x38')]){_0x12c31a[_0xbb04('0x39')]=[{'all':!![]}];}_0x12c31a=_[_0xbb04('0x34')]({},_0x12c31a,_0x28d65e[_0xbb04('0x36')]);return db[_0xbb04('0x23')]['find'](_0x12c31a)['then'](handleEntityNotFound(_0x5dacb1,null))['then'](respondWithResult(_0x5dacb1,null))['catch'](handleError(_0x5dacb1,null));};exports['create']=function(_0x509fa9,_0xf9615b){return db[_0xbb04('0x23')][_0xbb04('0x3e')](_0x509fa9[_0xbb04('0x3f')],{})[_0xbb04('0x1c')](respondWithResult(_0xf9615b,0xc9))[_0xbb04('0x40')](handleError(_0xf9615b,null));};exports['update']=function(_0x256c81,_0x2b3196){if(_0x256c81[_0xbb04('0x3f')]['id']){delete _0x256c81['body']['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x256c81[_0xbb04('0x3d')]['id']}})[_0xbb04('0x1c')](handleEntityNotFound(_0x2b3196,null))[_0xbb04('0x1c')](saveUpdates(_0x256c81[_0xbb04('0x3f')],null))[_0xbb04('0x1c')](respondWithResult(_0x2b3196,null))[_0xbb04('0x40')](handleError(_0x2b3196,null));};exports[_0xbb04('0x41')]=function(_0x58470e,_0xdc980b){return db[_0xbb04('0x23')][_0xbb04('0x42')]({'where':{'id':_0x58470e[_0xbb04('0x3d')]['id']}})[_0xbb04('0x1c')](handleEntityNotFound(_0xdc980b,null))['then'](removeEntity(_0xdc980b,null))['catch'](handleError(_0xdc980b,null));};exports['getFields']=function(_0x1a858d,_0x121e8a,_0x4d47f6){var _0x301bc5={};var _0x2bea1d={};var _0x2797f4;var _0xb8e36d;return db['Dynamics365Configuration'][_0xbb04('0x43')]({'where':{'id':_0x1a858d[_0xbb04('0x3d')]['id']}})['then'](handleEntityNotFound(_0x121e8a,null))[_0xbb04('0x1c')](function(_0x215702){if(_0x215702){_0x2797f4=_0x215702;_0x2bea1d[_0xbb04('0x27')]=_['keys'](db[_0xbb04('0x44')][_0xbb04('0x24')]);_0x2bea1d[_0xbb04('0x29')]=_['keys'](_0x1a858d[_0xbb04('0x29')]);_0x2bea1d['filters']=_[_0xbb04('0x2c')](_0x2bea1d['model'],_0x2bea1d[_0xbb04('0x29')]);_0x301bc5[_0xbb04('0x2d')]=_['intersection'](_0x2bea1d['model'],qs[_0xbb04('0x2e')](_0x1a858d[_0xbb04('0x29')][_0xbb04('0x2e')]));_0x301bc5['attributes']=_0x301bc5[_0xbb04('0x2d')]['length']?_0x301bc5['attributes']:_0x2bea1d[_0xbb04('0x27')];_0x301bc5[_0xbb04('0x30')]=qs[_0xbb04('0x31')](_0x1a858d[_0xbb04('0x29')]['sort']);_0x301bc5[_0xbb04('0x32')]=qs[_0xbb04('0x2b')](_[_0xbb04('0x45')](_0x1a858d['query'],_0x2bea1d[_0xbb04('0x2b')]));if(_0x1a858d['query']['filter']){_0x301bc5[_0xbb04('0x32')]=_[_0xbb04('0x34')](_0x301bc5[_0xbb04('0x32')],{'$or':_['map'](_0x301bc5[_0xbb04('0x2d')],function(_0x6ff61){var _0x352c2a={};_0x352c2a[_0x6ff61]={'$like':'%'+_0x1a858d[_0xbb04('0x29')][_0xbb04('0x33')]+'%'};return _0x352c2a;})});}_0x301bc5=_['merge']({},_0x301bc5,_0x1a858d['options']);return _0x2797f4[_0xbb04('0x46')](_0x301bc5);}})['then'](function(_0x57aff7){if(_0x57aff7){_0xb8e36d=_0x57aff7['length'];if(!_0x1a858d[_0xbb04('0x29')][_0xbb04('0x47')](_0xbb04('0x48'))){_0x301bc5['limit']=qs['limit'](_0x1a858d['query']['limit']);_0x301bc5[_0xbb04('0x15')]=qs[_0xbb04('0x15')](_0x1a858d[_0xbb04('0x29')]['offset']);}return _0x2797f4[_0xbb04('0x46')](_0x301bc5);}})[_0xbb04('0x1c')](function(_0x347c70){if(_0x347c70){return _0x347c70?{'count':_0xb8e36d,'rows':_0x347c70}:null;}})[_0xbb04('0x1c')](respondWithResult(_0x121e8a,null))[_0xbb04('0x40')](handleError(_0x121e8a,null));};exports['getSubjects']=function(_0x1060eb,_0xfc8498,_0x18de43){var _0x2dcb81={};var _0xe7686e={};var _0x33fb4e;var _0x551981;return db[_0xbb04('0x23')][_0xbb04('0x43')]({'where':{'id':_0x1060eb[_0xbb04('0x3d')]['id']}})[_0xbb04('0x1c')](handleEntityNotFound(_0xfc8498,null))[_0xbb04('0x1c')](function(_0x3405dd){if(_0x3405dd){_0x33fb4e=_0x3405dd;_0xe7686e[_0xbb04('0x27')]=_['keys'](db[_0xbb04('0x44')][_0xbb04('0x24')]);_0xe7686e[_0xbb04('0x29')]=_[_0xbb04('0x2a')](_0x1060eb[_0xbb04('0x29')]);_0xe7686e[_0xbb04('0x2b')]=_[_0xbb04('0x2c')](_0xe7686e['model'],_0xe7686e[_0xbb04('0x29')]);_0x2dcb81['attributes']=_[_0xbb04('0x2c')](_0xe7686e[_0xbb04('0x27')],qs[_0xbb04('0x2e')](_0x1060eb[_0xbb04('0x29')]['fields']));_0x2dcb81[_0xbb04('0x2d')]=_0x2dcb81[_0xbb04('0x2d')]['length']?_0x2dcb81[_0xbb04('0x2d')]:_0xe7686e[_0xbb04('0x27')];_0x2dcb81[_0xbb04('0x30')]=qs[_0xbb04('0x31')](_0x1060eb[_0xbb04('0x29')][_0xbb04('0x31')]);_0x2dcb81['where']=qs[_0xbb04('0x2b')](_['pick'](_0x1060eb['query'],_0xe7686e[_0xbb04('0x2b')]));if(_0x1060eb[_0xbb04('0x29')]['filter']){_0x2dcb81['where']=_[_0xbb04('0x34')](_0x2dcb81[_0xbb04('0x32')],{'$or':_['map'](_0x2dcb81[_0xbb04('0x2d')],function(_0x3a7381){var _0x48286c={};_0x48286c[_0x3a7381]={'$like':'%'+_0x1060eb[_0xbb04('0x29')]['filter']+'%'};return _0x48286c;})});}_0x2dcb81=_[_0xbb04('0x34')]({},_0x2dcb81,_0x1060eb[_0xbb04('0x36')]);return _0x33fb4e[_0xbb04('0x49')](_0x2dcb81);}})[_0xbb04('0x1c')](function(_0x51434c){if(_0x51434c){_0x551981=_0x51434c[_0xbb04('0x2f')];if(!_0x1060eb[_0xbb04('0x29')][_0xbb04('0x47')](_0xbb04('0x48'))){_0x2dcb81[_0xbb04('0x17')]=qs[_0xbb04('0x17')](_0x1060eb[_0xbb04('0x29')]['limit']);_0x2dcb81[_0xbb04('0x15')]=qs['offset'](_0x1060eb[_0xbb04('0x29')]['offset']);}return _0x33fb4e[_0xbb04('0x49')](_0x2dcb81);}})['then'](function(_0x2d3281){if(_0x2d3281){return _0x2d3281?{'count':_0x551981,'rows':_0x2d3281}:null;}})[_0xbb04('0x1c')](respondWithResult(_0xfc8498,null))['catch'](handleError(_0xfc8498,null));};exports[_0xbb04('0x4a')]=function(_0x466879,_0x108c37,_0x20a6b1){var _0x404411={};var _0x26f8ce={};var _0x5d4cfc;var _0x3793ef;return db[_0xbb04('0x23')][_0xbb04('0x43')]({'where':{'id':_0x466879[_0xbb04('0x3d')]['id']}})['then'](handleEntityNotFound(_0x108c37,null))['then'](function(_0xf6386d){if(_0xf6386d){_0x5d4cfc=_0xf6386d;_0x26f8ce[_0xbb04('0x27')]=_[_0xbb04('0x2a')](db[_0xbb04('0x44')][_0xbb04('0x24')]);_0x26f8ce[_0xbb04('0x29')]=_[_0xbb04('0x2a')](_0x466879[_0xbb04('0x29')]);_0x26f8ce['filters']=_[_0xbb04('0x2c')](_0x26f8ce[_0xbb04('0x27')],_0x26f8ce[_0xbb04('0x29')]);_0x404411[_0xbb04('0x2d')]=_['intersection'](_0x26f8ce[_0xbb04('0x27')],qs[_0xbb04('0x2e')](_0x466879[_0xbb04('0x29')][_0xbb04('0x2e')]));_0x404411[_0xbb04('0x2d')]=_0x404411[_0xbb04('0x2d')][_0xbb04('0x2f')]?_0x404411[_0xbb04('0x2d')]:_0x26f8ce[_0xbb04('0x27')];_0x404411['order']=qs['sort'](_0x466879[_0xbb04('0x29')][_0xbb04('0x31')]);_0x404411[_0xbb04('0x32')]=qs['filters'](_[_0xbb04('0x45')](_0x466879[_0xbb04('0x29')],_0x26f8ce['filters']));if(_0x466879[_0xbb04('0x29')]['filter']){_0x404411[_0xbb04('0x32')]=_[_0xbb04('0x34')](_0x404411[_0xbb04('0x32')],{'$or':_[_0xbb04('0x28')](_0x404411[_0xbb04('0x2d')],function(_0x2e3c7e){var _0x36a7a2={};_0x36a7a2[_0x2e3c7e]={'$like':'%'+_0x466879[_0xbb04('0x29')][_0xbb04('0x33')]+'%'};return _0x36a7a2;})});}_0x404411=_['merge']({},_0x404411,_0x466879[_0xbb04('0x36')]);return _0x5d4cfc[_0xbb04('0x4a')](_0x404411);}})['then'](function(_0x19406c){if(_0x19406c){_0x3793ef=_0x19406c['length'];if(!_0x466879[_0xbb04('0x29')][_0xbb04('0x47')](_0xbb04('0x48'))){_0x404411[_0xbb04('0x17')]=qs[_0xbb04('0x17')](_0x466879[_0xbb04('0x29')][_0xbb04('0x17')]);_0x404411['offset']=qs[_0xbb04('0x15')](_0x466879[_0xbb04('0x29')][_0xbb04('0x15')]);}return _0x5d4cfc[_0xbb04('0x4a')](_0x404411);}})[_0xbb04('0x1c')](function(_0x5ccb8c){if(_0x5ccb8c){return _0x5ccb8c?{'count':_0x3793ef,'rows':_0x5ccb8c}:null;}})[_0xbb04('0x1c')](respondWithResult(_0x108c37,null))['catch'](handleError(_0x108c37,null));}; \ No newline at end of file +var _0x23ab=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','getFields','findOne','Dynamics365Field','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','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','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','fieldName','type','key','model','map','query','keys'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x23ab,0x167));var _0xb23a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x23ab[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb23a('0x0'));var rimraf=require(_0xb23a('0x1'));var zipdir=require(_0xb23a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb23a('0x3'));var BPromise=require(_0xb23a('0x4'));var Mustache=require(_0xb23a('0x5'));var util=require(_0xb23a('0x6'));var path=require(_0xb23a('0x7'));var sox=require(_0xb23a('0x8'));var csv=require(_0xb23a('0x9'));var ejs=require(_0xb23a('0xa'));var fs=require('fs');var fs_extra=require(_0xb23a('0xb'));var _=require(_0xb23a('0xc'));var squel=require(_0xb23a('0xd'));var crypto=require(_0xb23a('0xe'));var jsforce=require(_0xb23a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb23a('0x9'));var querystring=require(_0xb23a('0x10'));var Papa=require('papaparse');var Redis=require(_0xb23a('0x11'));var authService=require(_0xb23a('0x12'));var qs=require(_0xb23a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb23a('0x14'));var logger=require('../../config/logger')(_0xb23a('0x15'));var utils=require(_0xb23a('0x16'));var config=require(_0xb23a('0x17'));var licenseUtil=require(_0xb23a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e57,_0x17fe58){_0x17fe58=_0x17fe58||0xcc;return function(_0x503827){if(_0x503827){return _0x3d8e57[_0xb23a('0x19')](_0x17fe58);}return _0x3d8e57['status'](_0x17fe58)['end']();};}function respondWithResult(_0x5d9e22,_0x23d9f8){_0x23d9f8=_0x23d9f8||0xc8;return function(_0x45e555){if(_0x45e555){return _0x5d9e22[_0xb23a('0x1a')](_0x23d9f8)['json'](_0x45e555);}};}function respondWithFilteredResult(_0x358f25,_0x2ed6ab){return function(_0x1f43da){if(_0x1f43da){var _0x55f0d4=typeof _0x2ed6ab[_0xb23a('0x1b')]==='undefined'&&typeof _0x2ed6ab[_0xb23a('0x1c')]==='undefined';var _0x3112b2=_0x1f43da[_0xb23a('0x1d')];var _0x411a2d=_0x55f0d4?0x0:_0x2ed6ab[_0xb23a('0x1b')];var _0x341dd6=_0x55f0d4?_0x1f43da[_0xb23a('0x1d')]:_0x2ed6ab[_0xb23a('0x1b')]+_0x2ed6ab[_0xb23a('0x1c')];var _0x285769;if(_0x341dd6>=_0x3112b2){_0x341dd6=_0x3112b2;_0x285769=0xc8;}else{_0x285769=0xce;}_0x358f25[_0xb23a('0x1a')](_0x285769);return _0x358f25[_0xb23a('0x1e')](_0xb23a('0x1f'),_0x411a2d+'-'+_0x341dd6+'/'+_0x3112b2)['json'](_0x1f43da);}return null;};}function patchUpdates(_0x36422a){return function(_0x33e7bb){try{jsonpatch[_0xb23a('0x20')](_0x33e7bb,_0x36422a,!![]);}catch(_0x77d111){return BPromise[_0xb23a('0x21')](_0x77d111);}return _0x33e7bb[_0xb23a('0x22')]();};}function saveUpdates(_0x1ee94f,_0x2b3094){return function(_0x26d42a){if(_0x26d42a){return _0x26d42a[_0xb23a('0x23')](_0x1ee94f)[_0xb23a('0x24')](function(_0xbec222){return _0xbec222;});}return null;};}function removeEntity(_0x26d6de,_0x3b011f){return function(_0x1687a3){if(_0x1687a3){return _0x1687a3[_0xb23a('0x25')]()[_0xb23a('0x24')](function(){_0x26d6de[_0xb23a('0x1a')](0xcc)[_0xb23a('0x26')]();});}};}function handleEntityNotFound(_0x5becd0,_0xafb539){return function(_0x2ec365){if(!_0x2ec365){_0x5becd0[_0xb23a('0x19')](0x194);}return _0x2ec365;};}function handleError(_0x121b3f,_0x17ff81){_0x17ff81=_0x17ff81||0x1f4;return function(_0x594716){logger[_0xb23a('0x27')](_0x594716[_0xb23a('0x28')]);if(_0x594716[_0xb23a('0x29')]){delete _0x594716[_0xb23a('0x29')];}_0x121b3f['status'](_0x17ff81)[_0xb23a('0x2a')](_0x594716);};}exports[_0xb23a('0x2b')]=function(_0x4aa981,_0x394b0a){var _0x3f45b7={},_0x2fb44e={},_0x38f9dc={'count':0x0,'rows':[]};var _0x118c4f=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x86627e){return{'name':_0x86627e[_0xb23a('0x2c')],'type':_0x86627e[_0xb23a('0x2d')][_0xb23a('0x2e')]};});_0x2fb44e[_0xb23a('0x2f')]=_[_0xb23a('0x30')](_0x118c4f,_0xb23a('0x29'));_0x2fb44e[_0xb23a('0x31')]=_[_0xb23a('0x32')](_0x4aa981[_0xb23a('0x31')]);_0x2fb44e[_0xb23a('0x33')]=_[_0xb23a('0x34')](_0x2fb44e[_0xb23a('0x2f')],_0x2fb44e['query']);_0x3f45b7[_0xb23a('0x35')]=_[_0xb23a('0x34')](_0x2fb44e['model'],qs[_0xb23a('0x36')](_0x4aa981[_0xb23a('0x31')]['fields']));_0x3f45b7[_0xb23a('0x35')]=_0x3f45b7[_0xb23a('0x35')][_0xb23a('0x37')]?_0x3f45b7[_0xb23a('0x35')]:_0x2fb44e[_0xb23a('0x2f')];if(!_0x4aa981[_0xb23a('0x31')][_0xb23a('0x38')](_0xb23a('0x39'))){_0x3f45b7[_0xb23a('0x1c')]=qs['limit'](_0x4aa981['query'][_0xb23a('0x1c')]);_0x3f45b7[_0xb23a('0x1b')]=qs[_0xb23a('0x1b')](_0x4aa981['query'][_0xb23a('0x1b')]);}_0x3f45b7['order']=qs['sort'](_0x4aa981[_0xb23a('0x31')][_0xb23a('0x3a')]);_0x3f45b7['where']=qs[_0xb23a('0x33')](_[_0xb23a('0x3b')](_0x4aa981[_0xb23a('0x31')],_0x2fb44e[_0xb23a('0x33')]),_0x118c4f);if(_0x4aa981['query'][_0xb23a('0x3c')]){_0x3f45b7[_0xb23a('0x3d')]=_[_0xb23a('0x3e')](_0x3f45b7[_0xb23a('0x3d')],{'$or':_[_0xb23a('0x30')](_0x118c4f,function(_0x21ecfb){if(_0x21ecfb[_0xb23a('0x2d')]!==_0xb23a('0x3f')){var _0x2a2c10={};_0x2a2c10[_0x21ecfb[_0xb23a('0x29')]]={'$like':'%'+_0x4aa981[_0xb23a('0x31')][_0xb23a('0x3c')]+'%'};return _0x2a2c10;}})});}_0x3f45b7=_[_0xb23a('0x3e')]({},_0x3f45b7,_0x4aa981[_0xb23a('0x40')]);var _0xe3dd62={'where':_0x3f45b7[_0xb23a('0x3d')]};return db[_0xb23a('0x41')][_0xb23a('0x1d')](_0xe3dd62)[_0xb23a('0x24')](function(_0x1cc941){_0x38f9dc[_0xb23a('0x1d')]=_0x1cc941;if(_0x4aa981[_0xb23a('0x31')][_0xb23a('0x42')]){_0x3f45b7[_0xb23a('0x43')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xb23a('0x44')](_0x3f45b7);})[_0xb23a('0x24')](function(_0x27e9eb){_0x38f9dc[_0xb23a('0x45')]=_0x27e9eb;return _0x38f9dc;})[_0xb23a('0x24')](respondWithFilteredResult(_0x394b0a,_0x3f45b7))['catch'](handleError(_0x394b0a,null));};exports['show']=function(_0x55d0f2,_0x538c05){var _0x57fc7a={'raw':![],'where':{'id':_0x55d0f2[_0xb23a('0x46')]['id']}},_0x35e6d4={};_0x35e6d4[_0xb23a('0x2f')]=_[_0xb23a('0x32')](db[_0xb23a('0x41')][_0xb23a('0x47')]);_0x35e6d4[_0xb23a('0x31')]=_[_0xb23a('0x32')](_0x55d0f2[_0xb23a('0x31')]);_0x35e6d4[_0xb23a('0x33')]=_[_0xb23a('0x34')](_0x35e6d4[_0xb23a('0x2f')],_0x35e6d4['query']);_0x57fc7a[_0xb23a('0x35')]=_['intersection'](_0x35e6d4[_0xb23a('0x2f')],qs[_0xb23a('0x36')](_0x55d0f2[_0xb23a('0x31')][_0xb23a('0x36')]));_0x57fc7a['attributes']=_0x57fc7a[_0xb23a('0x35')][_0xb23a('0x37')]?_0x57fc7a['attributes']:_0x35e6d4['model'];if(_0x55d0f2[_0xb23a('0x31')][_0xb23a('0x42')]){_0x57fc7a[_0xb23a('0x43')]=[{'all':!![]}];}_0x57fc7a=_[_0xb23a('0x3e')]({},_0x57fc7a,_0x55d0f2[_0xb23a('0x40')]);return db[_0xb23a('0x41')][_0xb23a('0x48')](_0x57fc7a)[_0xb23a('0x24')](handleEntityNotFound(_0x538c05,null))['then'](respondWithResult(_0x538c05,null))[_0xb23a('0x49')](handleError(_0x538c05,null));};exports[_0xb23a('0x4a')]=function(_0x9d897,_0x3b8d19){return db[_0xb23a('0x41')][_0xb23a('0x4a')](_0x9d897['body'],{})['then'](respondWithResult(_0x3b8d19,0xc9))[_0xb23a('0x49')](handleError(_0x3b8d19,null));};exports[_0xb23a('0x23')]=function(_0x118df3,_0xaf4438){if(_0x118df3[_0xb23a('0x4b')]['id']){delete _0x118df3[_0xb23a('0x4b')]['id'];}return db[_0xb23a('0x41')][_0xb23a('0x48')]({'where':{'id':_0x118df3[_0xb23a('0x46')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0xaf4438,null))['then'](saveUpdates(_0x118df3[_0xb23a('0x4b')],null))[_0xb23a('0x24')](respondWithResult(_0xaf4438,null))[_0xb23a('0x49')](handleError(_0xaf4438,null));};exports[_0xb23a('0x25')]=function(_0x4e8131,_0xdf5a93){return db['Dynamics365Configuration']['find']({'where':{'id':_0x4e8131[_0xb23a('0x46')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0xdf5a93,null))[_0xb23a('0x24')](removeEntity(_0xdf5a93,null))['catch'](handleError(_0xdf5a93,null));};exports[_0xb23a('0x4c')]=function(_0x2ad74e,_0xd3c8a6,_0x37da80){var _0x296938={};var _0x5749b3={};var _0xd417af;var _0x238eb6;return db[_0xb23a('0x41')][_0xb23a('0x4d')]({'where':{'id':_0x2ad74e[_0xb23a('0x46')]['id']}})['then'](handleEntityNotFound(_0xd3c8a6,null))[_0xb23a('0x24')](function(_0x5581d4){if(_0x5581d4){_0xd417af=_0x5581d4;_0x5749b3[_0xb23a('0x2f')]=_[_0xb23a('0x32')](db[_0xb23a('0x4e')][_0xb23a('0x47')]);_0x5749b3['query']=_[_0xb23a('0x32')](_0x2ad74e[_0xb23a('0x31')]);_0x5749b3[_0xb23a('0x33')]=_[_0xb23a('0x34')](_0x5749b3[_0xb23a('0x2f')],_0x5749b3[_0xb23a('0x31')]);_0x296938[_0xb23a('0x35')]=_[_0xb23a('0x34')](_0x5749b3['model'],qs['fields'](_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x36')]));_0x296938[_0xb23a('0x35')]=_0x296938['attributes']['length']?_0x296938[_0xb23a('0x35')]:_0x5749b3[_0xb23a('0x2f')];_0x296938[_0xb23a('0x4f')]=qs['sort'](_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x3a')]);_0x296938['where']=qs[_0xb23a('0x33')](_['pick'](_0x2ad74e[_0xb23a('0x31')],_0x5749b3[_0xb23a('0x33')]));if(_0x2ad74e['query'][_0xb23a('0x3c')]){_0x296938['where']=_[_0xb23a('0x3e')](_0x296938[_0xb23a('0x3d')],{'$or':_['map'](_0x296938[_0xb23a('0x35')],function(_0x226fd9){var _0x1aff86={};_0x1aff86[_0x226fd9]={'$like':'%'+_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x3c')]+'%'};return _0x1aff86;})});}_0x296938=_[_0xb23a('0x3e')]({},_0x296938,_0x2ad74e[_0xb23a('0x40')]);return _0xd417af[_0xb23a('0x4c')](_0x296938);}})[_0xb23a('0x24')](function(_0x5bd5df){if(_0x5bd5df){_0x238eb6=_0x5bd5df[_0xb23a('0x37')];if(!_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x38')](_0xb23a('0x39'))){_0x296938[_0xb23a('0x1c')]=qs[_0xb23a('0x1c')](_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x1c')]);_0x296938['offset']=qs[_0xb23a('0x1b')](_0x2ad74e['query']['offset']);}return _0xd417af[_0xb23a('0x4c')](_0x296938);}})[_0xb23a('0x24')](function(_0x324047){if(_0x324047){return _0x324047?{'count':_0x238eb6,'rows':_0x324047}:null;}})[_0xb23a('0x24')](respondWithResult(_0xd3c8a6,null))['catch'](handleError(_0xd3c8a6,null));};exports[_0xb23a('0x50')]=function(_0x52bb72,_0x5444b8,_0x2d20e2){var _0x1e2c89={};var _0x12cac2={};var _0x56b9a0;var _0x1aca99;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x52bb72[_0xb23a('0x46')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0x5444b8,null))[_0xb23a('0x24')](function(_0x4e2a7f){if(_0x4e2a7f){_0x56b9a0=_0x4e2a7f;_0x12cac2['model']=_[_0xb23a('0x32')](db[_0xb23a('0x4e')][_0xb23a('0x47')]);_0x12cac2[_0xb23a('0x31')]=_['keys'](_0x52bb72[_0xb23a('0x31')]);_0x12cac2[_0xb23a('0x33')]=_['intersection'](_0x12cac2['model'],_0x12cac2['query']);_0x1e2c89[_0xb23a('0x35')]=_[_0xb23a('0x34')](_0x12cac2[_0xb23a('0x2f')],qs[_0xb23a('0x36')](_0x52bb72[_0xb23a('0x31')]['fields']));_0x1e2c89[_0xb23a('0x35')]=_0x1e2c89[_0xb23a('0x35')][_0xb23a('0x37')]?_0x1e2c89[_0xb23a('0x35')]:_0x12cac2[_0xb23a('0x2f')];_0x1e2c89['order']=qs[_0xb23a('0x3a')](_0x52bb72['query']['sort']);_0x1e2c89[_0xb23a('0x3d')]=qs[_0xb23a('0x33')](_[_0xb23a('0x3b')](_0x52bb72[_0xb23a('0x31')],_0x12cac2['filters']));if(_0x52bb72[_0xb23a('0x31')][_0xb23a('0x3c')]){_0x1e2c89[_0xb23a('0x3d')]=_[_0xb23a('0x3e')](_0x1e2c89[_0xb23a('0x3d')],{'$or':_[_0xb23a('0x30')](_0x1e2c89[_0xb23a('0x35')],function(_0x5e9c0a){var _0x3878cb={};_0x3878cb[_0x5e9c0a]={'$like':'%'+_0x52bb72[_0xb23a('0x31')][_0xb23a('0x3c')]+'%'};return _0x3878cb;})});}_0x1e2c89=_[_0xb23a('0x3e')]({},_0x1e2c89,_0x52bb72['options']);return _0x56b9a0[_0xb23a('0x50')](_0x1e2c89);}})[_0xb23a('0x24')](function(_0x32e9f8){if(_0x32e9f8){_0x1aca99=_0x32e9f8[_0xb23a('0x37')];if(!_0x52bb72[_0xb23a('0x31')][_0xb23a('0x38')]('nolimit')){_0x1e2c89[_0xb23a('0x1c')]=qs[_0xb23a('0x1c')](_0x52bb72[_0xb23a('0x31')][_0xb23a('0x1c')]);_0x1e2c89['offset']=qs[_0xb23a('0x1b')](_0x52bb72['query'][_0xb23a('0x1b')]);}return _0x56b9a0[_0xb23a('0x50')](_0x1e2c89);}})[_0xb23a('0x24')](function(_0x32619b){if(_0x32619b){return _0x32619b?{'count':_0x1aca99,'rows':_0x32619b}:null;}})['then'](respondWithResult(_0x5444b8,null))['catch'](handleError(_0x5444b8,null));};exports[_0xb23a('0x51')]=function(_0x3badf5,_0x59a30e,_0x20c3b7){var _0x2622db={};var _0x1ee597={};var _0x19b2c8;var _0x5562ae;return db[_0xb23a('0x41')][_0xb23a('0x4d')]({'where':{'id':_0x3badf5[_0xb23a('0x46')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0x59a30e,null))[_0xb23a('0x24')](function(_0x23801c){if(_0x23801c){_0x19b2c8=_0x23801c;_0x1ee597[_0xb23a('0x2f')]=_[_0xb23a('0x32')](db[_0xb23a('0x4e')][_0xb23a('0x47')]);_0x1ee597['query']=_[_0xb23a('0x32')](_0x3badf5['query']);_0x1ee597[_0xb23a('0x33')]=_['intersection'](_0x1ee597[_0xb23a('0x2f')],_0x1ee597[_0xb23a('0x31')]);_0x2622db['attributes']=_[_0xb23a('0x34')](_0x1ee597['model'],qs[_0xb23a('0x36')](_0x3badf5['query'][_0xb23a('0x36')]));_0x2622db[_0xb23a('0x35')]=_0x2622db[_0xb23a('0x35')][_0xb23a('0x37')]?_0x2622db[_0xb23a('0x35')]:_0x1ee597[_0xb23a('0x2f')];_0x2622db[_0xb23a('0x4f')]=qs[_0xb23a('0x3a')](_0x3badf5['query'][_0xb23a('0x3a')]);_0x2622db[_0xb23a('0x3d')]=qs[_0xb23a('0x33')](_[_0xb23a('0x3b')](_0x3badf5[_0xb23a('0x31')],_0x1ee597[_0xb23a('0x33')]));if(_0x3badf5[_0xb23a('0x31')]['filter']){_0x2622db['where']=_[_0xb23a('0x3e')](_0x2622db[_0xb23a('0x3d')],{'$or':_[_0xb23a('0x30')](_0x2622db[_0xb23a('0x35')],function(_0x57b797){var _0x41e94b={};_0x41e94b[_0x57b797]={'$like':'%'+_0x3badf5['query']['filter']+'%'};return _0x41e94b;})});}_0x2622db=_[_0xb23a('0x3e')]({},_0x2622db,_0x3badf5[_0xb23a('0x40')]);return _0x19b2c8['getDescriptions'](_0x2622db);}})[_0xb23a('0x24')](function(_0xee0426){if(_0xee0426){_0x5562ae=_0xee0426[_0xb23a('0x37')];if(!_0x3badf5['query'][_0xb23a('0x38')](_0xb23a('0x39'))){_0x2622db['limit']=qs[_0xb23a('0x1c')](_0x3badf5[_0xb23a('0x31')][_0xb23a('0x1c')]);_0x2622db[_0xb23a('0x1b')]=qs['offset'](_0x3badf5[_0xb23a('0x31')][_0xb23a('0x1b')]);}return _0x19b2c8[_0xb23a('0x51')](_0x2622db);}})[_0xb23a('0x24')](function(_0x2fe2fb){if(_0x2fe2fb){return _0x2fe2fb?{'count':_0x5562ae,'rows':_0x2fe2fb}:null;}})[_0xb23a('0x24')](respondWithResult(_0x59a30e,null))['catch'](handleError(_0x59a30e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index fc958b4..567e167 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 _0xf109=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x25f69c,_0x5a2789){var _0x4d56df=function(_0x113b22){while(--_0x113b22){_0x25f69c['push'](_0x25f69c['shift']());}};_0x4d56df(++_0x5a2789);}(_0xf109,0xce));var _0x9f10=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf109[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x9a19,0x114));var _0x99a1=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x9a19[_0x2d4421];return _0x2d3b01;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index bac0381..aa0a1e7 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 _0xb47f=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','Dynamics365Configuration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info'];(function(_0x1efdd2,_0x3cde86){var _0x110b92=function(_0x26915a){while(--_0x26915a){_0x1efdd2['push'](_0x1efdd2['shift']());}};_0x110b92(++_0x3cde86);}(_0xb47f,0x1e2));var _0xfb47=function(_0x24b477,_0x30393b){_0x24b477=_0x24b477-0x0;var _0x4041a6=_0xb47f[_0x24b477];return _0x4041a6;};'use strict';var _=require(_0xfb47('0x0'));var util=require(_0xfb47('0x1'));var moment=require(_0xfb47('0x2'));var BPromise=require(_0xfb47('0x3'));var rs=require(_0xfb47('0x4'));var fs=require('fs');var Redis=require(_0xfb47('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb47('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfb47('0x7'));var jayson=require(_0xfb47('0x8'));var client=jayson[_0xfb47('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x361607,_0x316444,_0x2ab3bc){return new BPromise(function(_0x54ca43,_0x556fb5){return client['request'](_0x361607,_0x2ab3bc)['then'](function(_0x3c56be){logger['info'](_0xfb47('0xa'),_0x316444,'request\x20sent');logger[_0xfb47('0xb')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x316444,_0xfb47('0xc'),JSON[_0xfb47('0xd')](_0x3c56be));if(_0x3c56be[_0xfb47('0xe')]){if(_0x3c56be[_0xfb47('0xe')][_0xfb47('0xf')]===0x1f4){logger[_0xfb47('0xe')](_0xfb47('0xa'),_0x316444,_0x3c56be[_0xfb47('0xe')]['message']);return _0x556fb5(_0x3c56be[_0xfb47('0xe')]['message']);}logger['error'](_0xfb47('0xa'),_0x316444,_0x3c56be[_0xfb47('0xe')]['message']);return _0x54ca43(_0x3c56be[_0xfb47('0xe')][_0xfb47('0x10')]);}else{logger[_0xfb47('0x11')](_0xfb47('0xa'),_0x316444,'request\x20sent');_0x54ca43(_0x3c56be[_0xfb47('0x12')][_0xfb47('0x10')]);}})[_0xfb47('0x13')](function(_0x2a34b7){logger[_0xfb47('0xe')](_0xfb47('0xa'),_0x316444,_0x2a34b7);_0x556fb5(_0x2a34b7);});});} \ No newline at end of file +var _0x5bab=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request'];(function(_0x57fda8,_0x5e80a0){var _0x11c895=function(_0xd08d0e){while(--_0xd08d0e){_0x57fda8['push'](_0x57fda8['shift']());}};_0x11c895(++_0x5e80a0);}(_0x5bab,0x6e));var _0xb5ba=function(_0x4cff15,_0x57e987){_0x4cff15=_0x4cff15-0x0;var _0x105bcb=_0x5bab[_0x4cff15];return _0x105bcb;};'use strict';var _=require(_0xb5ba('0x0'));var util=require(_0xb5ba('0x1'));var moment=require(_0xb5ba('0x2'));var BPromise=require(_0xb5ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5ba('0x4'));var db=require(_0xb5ba('0x5'))['db'];var utils=require(_0xb5ba('0x6'));var logger=require(_0xb5ba('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb5ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10be07,_0x57020b,_0x283263){return new BPromise(function(_0x2005ef,_0x10ca5e){return client[_0xb5ba('0x9')](_0x10be07,_0x283263)[_0xb5ba('0xa')](function(_0x54720d){logger[_0xb5ba('0xb')](_0xb5ba('0xc'),_0x57020b,_0xb5ba('0xd'));logger[_0xb5ba('0xe')](_0xb5ba('0xf'),_0x57020b,_0xb5ba('0xd'),JSON[_0xb5ba('0x10')](_0x54720d));if(_0x54720d['error']){if(_0x54720d[_0xb5ba('0x11')][_0xb5ba('0x12')]===0x1f4){logger[_0xb5ba('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x57020b,_0x54720d[_0xb5ba('0x11')][_0xb5ba('0x13')]);return _0x10ca5e(_0x54720d['error'][_0xb5ba('0x13')]);}logger[_0xb5ba('0x11')](_0xb5ba('0xc'),_0x57020b,_0x54720d[_0xb5ba('0x11')][_0xb5ba('0x13')]);return _0x2005ef(_0x54720d[_0xb5ba('0x11')][_0xb5ba('0x13')]);}else{logger['info'](_0xb5ba('0xc'),_0x57020b,'request\x20sent');_0x2005ef(_0x54720d['result'][_0xb5ba('0x13')]);}})['catch'](function(_0x20d571){logger[_0xb5ba('0x11')](_0xb5ba('0xc'),_0x57020b,_0x20d571);_0x10ca5e(_0x20d571);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 40ef1b9..8c8dd4f 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 _0xb920=['show','post','create','/:id','update','delete','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xb920,0xe7));var _0x0b92=function(_0x33dccb,_0x416f33){_0x33dccb=_0x33dccb-0x0;var _0x20df89=_0xb920[_0x33dccb];return _0x20df89;};'use strict';var multer=require(_0x0b92('0x0'));var util=require(_0x0b92('0x1'));var path=require('path');var timeout=require(_0x0b92('0x2'));var express=require('express');var router=express[_0x0b92('0x3')]();var fs_extra=require(_0x0b92('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0b92('0x5'));var config=require('../../config/environment');var controller=require(_0x0b92('0x6'));router[_0x0b92('0x7')]('/',auth[_0x0b92('0x8')](),controller['index']);router[_0x0b92('0x7')]('/:id',auth[_0x0b92('0x8')](),controller[_0x0b92('0x9')]);router[_0x0b92('0xa')]('/',auth[_0x0b92('0x8')](),controller[_0x0b92('0xb')]);router['put'](_0x0b92('0xc'),auth[_0x0b92('0x8')](),controller[_0x0b92('0xd')]);router[_0x0b92('0xe')]('/:id',auth[_0x0b92('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa2be=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','Router'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0xa2be,0xe1));var _0xea2b=function(_0x10f0a3,_0x4a75a9){_0x10f0a3=_0x10f0a3-0x0;var _0x2af3cf=_0xa2be[_0x10f0a3];return _0x2af3cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea2b('0x0'));var timeout=require(_0xea2b('0x1'));var express=require('express');var router=express[_0xea2b('0x2')]();var fs_extra=require(_0xea2b('0x3'));var auth=require(_0xea2b('0x4'));var interaction=require(_0xea2b('0x5'));var config=require(_0xea2b('0x6'));var controller=require(_0xea2b('0x7'));router['get']('/',auth[_0xea2b('0x8')](),controller[_0xea2b('0x9')]);router[_0xea2b('0xa')](_0xea2b('0xb'),auth['isAuthenticated'](),controller[_0xea2b('0xc')]);router[_0xea2b('0xd')]('/',auth[_0xea2b('0x8')](),controller[_0xea2b('0xe')]);router[_0xea2b('0xf')](_0xea2b('0xb'),auth[_0xea2b('0x8')](),controller[_0xea2b('0x10')]);router[_0xea2b('0x11')]('/:id',auth[_0xea2b('0x8')](),controller[_0xea2b('0x12')]);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 b7c0e40..8d94c95 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 _0xaf73=['STRING','customVariable','BOOLEAN','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x48ef68,_0x540403){var _0x3f317c=function(_0xbb02c5){while(--_0xbb02c5){_0x48ef68['push'](_0x48ef68['shift']());}};_0x3f317c(++_0x540403);}(_0xaf73,0xd2));var _0x3af7=function(_0x230466,_0x33900c){_0x230466=_0x230466-0x0;var _0x574dfa=_0xaf73[_0x230466];return _0x574dfa;};'use strict';var Sequelize=require('sequelize');module[_0x3af7('0x0')]={'type':{'type':Sequelize[_0x3af7('0x1')](_0x3af7('0x2'),_0x3af7('0x3'),'customVariable',_0x3af7('0x4'),_0x3af7('0x5')),'defaultValue':_0x3af7('0x2')},'content':{'type':Sequelize[_0x3af7('0x6')]},'key':{'type':Sequelize[_0x3af7('0x6')]},'keyType':{'type':Sequelize[_0x3af7('0x1')](_0x3af7('0x2'),'variable',_0x3af7('0x7'))},'keyContent':{'type':Sequelize[_0x3af7('0x6')]},'idField':{'type':Sequelize[_0x3af7('0x6')]},'nameField':{'type':Sequelize[_0x3af7('0x6')]},'customField':{'type':Sequelize[_0x3af7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4f7b=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist','string','STRING'];(function(_0x8f73b0,_0x4d03b2){var _0x402d3a=function(_0x25db74){while(--_0x25db74){_0x8f73b0['push'](_0x8f73b0['shift']());}};_0x402d3a(++_0x4d03b2);}(_0x4f7b,0x157));var _0xb4f7=function(_0x504537,_0x51f615){_0x504537=_0x504537-0x0;var _0x2d7872=_0x4f7b[_0x504537];return _0x2d7872;};'use strict';var Sequelize=require(_0xb4f7('0x0'));module[_0xb4f7('0x1')]={'type':{'type':Sequelize[_0xb4f7('0x2')]('string',_0xb4f7('0x3'),_0xb4f7('0x4'),'keyValue',_0xb4f7('0x5')),'defaultValue':_0xb4f7('0x6')},'content':{'type':Sequelize[_0xb4f7('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xb4f7('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xb4f7('0x7')]},'idField':{'type':Sequelize[_0xb4f7('0x7')]},'nameField':{'type':Sequelize[_0xb4f7('0x7')]},'customField':{'type':Sequelize[_0xb4f7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb4f7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 6307c28..1380f1a 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 _0x1623=['sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Field','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x160b71,_0x2ed489){var _0x32a6e1=function(_0x57c9b3){while(--_0x57c9b3){_0x160b71['push'](_0x160b71['shift']());}};_0x32a6e1(++_0x2ed489);}(_0x1623,0x1e5));var _0x3162=function(_0x2d227d,_0x3e4710){_0x2d227d=_0x2d227d-0x0;var _0x54a1f5=_0x1623[_0x2d227d];return _0x54a1f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3162('0x0'));var zipdir=require(_0x3162('0x1'));var jsonpatch=require(_0x3162('0x2'));var rp=require(_0x3162('0x3'));var moment=require(_0x3162('0x4'));var BPromise=require(_0x3162('0x5'));var Mustache=require(_0x3162('0x6'));var util=require('util');var path=require(_0x3162('0x7'));var sox=require(_0x3162('0x8'));var csv=require(_0x3162('0x9'));var ejs=require(_0x3162('0xa'));var fs=require('fs');var fs_extra=require(_0x3162('0xb'));var _=require('lodash');var squel=require(_0x3162('0xc'));var crypto=require(_0x3162('0xd'));var jsforce=require(_0x3162('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3162('0xf'));var Papa=require(_0x3162('0x10'));var Redis=require(_0x3162('0x11'));var authService=require(_0x3162('0x12'));var qs=require(_0x3162('0x13'));var as=require(_0x3162('0x14'));var hardwareService=require(_0x3162('0x15'));var logger=require(_0x3162('0x16'))('api');var utils=require(_0x3162('0x17'));var config=require(_0x3162('0x18'));var licenseUtil=require(_0x3162('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4735e3,_0x4e212b){_0x4e212b=_0x4e212b||0xcc;return function(_0x4a3285){if(_0x4a3285){return _0x4735e3[_0x3162('0x1a')](_0x4e212b);}return _0x4735e3[_0x3162('0x1b')](_0x4e212b)[_0x3162('0x1c')]();};}function respondWithResult(_0x2a9377,_0x10b153){_0x10b153=_0x10b153||0xc8;return function(_0x35ba2b){if(_0x35ba2b){return _0x2a9377[_0x3162('0x1b')](_0x10b153)['json'](_0x35ba2b);}};}function respondWithFilteredResult(_0x578e6f,_0x37bcb5){return function(_0x50062a){if(_0x50062a){var _0x124661=typeof _0x37bcb5[_0x3162('0x1d')]==='undefined'&&typeof _0x37bcb5[_0x3162('0x1e')]==='undefined';var _0x28f5ae=_0x50062a[_0x3162('0x1f')];var _0x1fdf13=_0x124661?0x0:_0x37bcb5[_0x3162('0x1d')];var _0x4fcce3=_0x124661?_0x50062a[_0x3162('0x1f')]:_0x37bcb5[_0x3162('0x1d')]+_0x37bcb5[_0x3162('0x1e')];var _0x32c1fe;if(_0x4fcce3>=_0x28f5ae){_0x4fcce3=_0x28f5ae;_0x32c1fe=0xc8;}else{_0x32c1fe=0xce;}_0x578e6f[_0x3162('0x1b')](_0x32c1fe);return _0x578e6f[_0x3162('0x20')](_0x3162('0x21'),_0x1fdf13+'-'+_0x4fcce3+'/'+_0x28f5ae)['json'](_0x50062a);}return null;};}function patchUpdates(_0x10c887){return function(_0x532204){try{jsonpatch[_0x3162('0x22')](_0x532204,_0x10c887,!![]);}catch(_0x2f517a){return BPromise[_0x3162('0x23')](_0x2f517a);}return _0x532204[_0x3162('0x24')]();};}function saveUpdates(_0x24852c,_0xedf85c){return function(_0x3eb9af){if(_0x3eb9af){return _0x3eb9af[_0x3162('0x25')](_0x24852c)[_0x3162('0x26')](function(_0x5b2779){return _0x5b2779;});}return null;};}function removeEntity(_0xf24c52,_0x3717d7){return function(_0x373a7c){if(_0x373a7c){return _0x373a7c[_0x3162('0x27')]()['then'](function(){_0xf24c52[_0x3162('0x1b')](0xcc)[_0x3162('0x1c')]();});}};}function handleEntityNotFound(_0x24f404,_0x4fc876){return function(_0x5ea767){if(!_0x5ea767){_0x24f404['sendStatus'](0x194);}return _0x5ea767;};}function handleError(_0x346819,_0x53df4c){_0x53df4c=_0x53df4c||0x1f4;return function(_0x3dcf4f){logger[_0x3162('0x28')](_0x3dcf4f['stack']);if(_0x3dcf4f[_0x3162('0x29')]){delete _0x3dcf4f[_0x3162('0x29')];}_0x346819[_0x3162('0x1b')](_0x53df4c)[_0x3162('0x2a')](_0x3dcf4f);};}exports[_0x3162('0x2b')]=function(_0x527c5b,_0x9c90f0){var _0x410c9d={},_0x8ac124={},_0x41da73={'count':0x0,'rows':[]};var _0x51313f=_[_0x3162('0x2c')](db[_0x3162('0x2d')]['rawAttributes'],function(_0x4546f1){return{'name':_0x4546f1['fieldName'],'type':_0x4546f1[_0x3162('0x2e')][_0x3162('0x2f')]};});_0x8ac124[_0x3162('0x30')]=_[_0x3162('0x2c')](_0x51313f,'name');_0x8ac124[_0x3162('0x31')]=_[_0x3162('0x32')](_0x527c5b[_0x3162('0x31')]);_0x8ac124[_0x3162('0x33')]=_[_0x3162('0x34')](_0x8ac124[_0x3162('0x30')],_0x8ac124['query']);_0x410c9d[_0x3162('0x35')]=_['intersection'](_0x8ac124[_0x3162('0x30')],qs[_0x3162('0x36')](_0x527c5b['query'][_0x3162('0x36')]));_0x410c9d[_0x3162('0x35')]=_0x410c9d[_0x3162('0x35')][_0x3162('0x37')]?_0x410c9d[_0x3162('0x35')]:_0x8ac124['model'];if(!_0x527c5b['query'][_0x3162('0x38')]('nolimit')){_0x410c9d['limit']=qs['limit'](_0x527c5b[_0x3162('0x31')][_0x3162('0x1e')]);_0x410c9d[_0x3162('0x1d')]=qs['offset'](_0x527c5b['query'][_0x3162('0x1d')]);}_0x410c9d['order']=qs[_0x3162('0x39')](_0x527c5b[_0x3162('0x31')][_0x3162('0x39')]);_0x410c9d[_0x3162('0x3a')]=qs[_0x3162('0x33')](_[_0x3162('0x3b')](_0x527c5b[_0x3162('0x31')],_0x8ac124[_0x3162('0x33')]),_0x51313f);if(_0x527c5b[_0x3162('0x31')][_0x3162('0x3c')]){_0x410c9d['where']=_['merge'](_0x410c9d[_0x3162('0x3a')],{'$or':_['map'](_0x51313f,function(_0x56e3a8){if(_0x56e3a8[_0x3162('0x2e')]!==_0x3162('0x3d')){var _0x366bc6={};_0x366bc6[_0x56e3a8[_0x3162('0x29')]]={'$like':'%'+_0x527c5b[_0x3162('0x31')][_0x3162('0x3c')]+'%'};return _0x366bc6;}})});}_0x410c9d=_[_0x3162('0x3e')]({},_0x410c9d,_0x527c5b['options']);var _0x3a87fb={'where':_0x410c9d[_0x3162('0x3a')]};return db['Dynamics365Field'][_0x3162('0x1f')](_0x3a87fb)[_0x3162('0x26')](function(_0x3a2084){_0x41da73[_0x3162('0x1f')]=_0x3a2084;if(_0x527c5b[_0x3162('0x31')]['includeAll']){_0x410c9d[_0x3162('0x3f')]=[{'all':!![]}];}return db[_0x3162('0x2d')][_0x3162('0x40')](_0x410c9d);})[_0x3162('0x26')](function(_0x276a17){_0x41da73[_0x3162('0x41')]=_0x276a17;return _0x41da73;})[_0x3162('0x26')](respondWithFilteredResult(_0x9c90f0,_0x410c9d))[_0x3162('0x42')](handleError(_0x9c90f0,null));};exports['show']=function(_0x494b89,_0xc10b64){var _0x5d68ac={'raw':!![],'where':{'id':_0x494b89['params']['id']}},_0x3cbb87={};_0x3cbb87[_0x3162('0x30')]=_[_0x3162('0x32')](db['Dynamics365Field'][_0x3162('0x43')]);_0x3cbb87['query']=_[_0x3162('0x32')](_0x494b89[_0x3162('0x31')]);_0x3cbb87[_0x3162('0x33')]=_['intersection'](_0x3cbb87[_0x3162('0x30')],_0x3cbb87[_0x3162('0x31')]);_0x5d68ac[_0x3162('0x35')]=_[_0x3162('0x34')](_0x3cbb87['model'],qs[_0x3162('0x36')](_0x494b89[_0x3162('0x31')]['fields']));_0x5d68ac[_0x3162('0x35')]=_0x5d68ac['attributes'][_0x3162('0x37')]?_0x5d68ac[_0x3162('0x35')]:_0x3cbb87['model'];if(_0x494b89[_0x3162('0x31')][_0x3162('0x44')]){_0x5d68ac[_0x3162('0x3f')]=[{'all':!![]}];}_0x5d68ac=_[_0x3162('0x3e')]({},_0x5d68ac,_0x494b89['options']);return db[_0x3162('0x2d')][_0x3162('0x45')](_0x5d68ac)[_0x3162('0x26')](handleEntityNotFound(_0xc10b64,null))[_0x3162('0x26')](respondWithResult(_0xc10b64,null))[_0x3162('0x42')](handleError(_0xc10b64,null));};exports[_0x3162('0x46')]=function(_0x334725,_0x4457fa){return db[_0x3162('0x2d')]['create'](_0x334725[_0x3162('0x47')],{})['then'](respondWithResult(_0x4457fa,0xc9))[_0x3162('0x42')](handleError(_0x4457fa,null));};exports['update']=function(_0x87aa9e,_0x367f43){if(_0x87aa9e['body']['id']){delete _0x87aa9e[_0x3162('0x47')]['id'];}return db[_0x3162('0x2d')][_0x3162('0x45')]({'where':{'id':_0x87aa9e[_0x3162('0x48')]['id']}})[_0x3162('0x26')](handleEntityNotFound(_0x367f43,null))[_0x3162('0x26')](saveUpdates(_0x87aa9e['body'],null))[_0x3162('0x26')](respondWithResult(_0x367f43,null))['catch'](handleError(_0x367f43,null));};exports['destroy']=function(_0x5682f6,_0x2b12b7){return db[_0x3162('0x2d')][_0x3162('0x45')]({'where':{'id':_0x5682f6[_0x3162('0x48')]['id']}})[_0x3162('0x26')](handleEntityNotFound(_0x2b12b7,null))[_0x3162('0x26')](removeEntity(_0x2b12b7,null))['catch'](handleError(_0x2b12b7,null));}; \ No newline at end of file +var _0x240c=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','rows','catch','params','length','includeAll','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','stack','name','send','index','map','Dynamics365Field'];(function(_0x3edbf4,_0x1aa808){var _0x59f894=function(_0x333c07){while(--_0x333c07){_0x3edbf4['push'](_0x3edbf4['shift']());}};_0x59f894(++_0x1aa808);}(_0x240c,0xf5));var _0xc240=function(_0x274d29,_0x96add8){_0x274d29=_0x274d29-0x0;var _0x53b4d4=_0x240c[_0x274d29];return _0x53b4d4;};'use strict';var emlformat=require(_0xc240('0x0'));var rimraf=require(_0xc240('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc240('0x2'));var rp=require(_0xc240('0x3'));var moment=require(_0xc240('0x4'));var BPromise=require(_0xc240('0x5'));var Mustache=require(_0xc240('0x6'));var util=require(_0xc240('0x7'));var path=require(_0xc240('0x8'));var sox=require(_0xc240('0x9'));var csv=require('to-csv');var ejs=require(_0xc240('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc240('0xb'));var crypto=require(_0xc240('0xc'));var jsforce=require(_0xc240('0xd'));var deskjs=require(_0xc240('0xe'));var toCsv=require(_0xc240('0xf'));var querystring=require(_0xc240('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc240('0x11'));var qs=require(_0xc240('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc240('0x13'));var logger=require('../../config/logger')(_0xc240('0x14'));var utils=require(_0xc240('0x15'));var config=require(_0xc240('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc240('0x17'))['db'];function respondWithStatusCode(_0x492de0,_0x28206a){_0x28206a=_0x28206a||0xcc;return function(_0x537d3d){if(_0x537d3d){return _0x492de0[_0xc240('0x18')](_0x28206a);}return _0x492de0['status'](_0x28206a)[_0xc240('0x19')]();};}function respondWithResult(_0x1d2251,_0x429e0a){_0x429e0a=_0x429e0a||0xc8;return function(_0x57b9fa){if(_0x57b9fa){return _0x1d2251[_0xc240('0x1a')](_0x429e0a)[_0xc240('0x1b')](_0x57b9fa);}};}function respondWithFilteredResult(_0x5c1dfe,_0x5a72a2){return function(_0x517ced){if(_0x517ced){var _0x4ef036=typeof _0x5a72a2['offset']===_0xc240('0x1c')&&typeof _0x5a72a2[_0xc240('0x1d')]===_0xc240('0x1c');var _0x38cebc=_0x517ced['count'];var _0x1a2ae=_0x4ef036?0x0:_0x5a72a2[_0xc240('0x1e')];var _0x4cf5f2=_0x4ef036?_0x517ced[_0xc240('0x1f')]:_0x5a72a2[_0xc240('0x1e')]+_0x5a72a2['limit'];var _0x29408b;if(_0x4cf5f2>=_0x38cebc){_0x4cf5f2=_0x38cebc;_0x29408b=0xc8;}else{_0x29408b=0xce;}_0x5c1dfe['status'](_0x29408b);return _0x5c1dfe['set'](_0xc240('0x20'),_0x1a2ae+'-'+_0x4cf5f2+'/'+_0x38cebc)[_0xc240('0x1b')](_0x517ced);}return null;};}function patchUpdates(_0x57a6ba){return function(_0x17c430){try{jsonpatch[_0xc240('0x21')](_0x17c430,_0x57a6ba,!![]);}catch(_0x22e6be){return BPromise['reject'](_0x22e6be);}return _0x17c430['save']();};}function saveUpdates(_0x545b92,_0x14e248){return function(_0x97903f){if(_0x97903f){return _0x97903f[_0xc240('0x22')](_0x545b92)[_0xc240('0x23')](function(_0xa31aaf){return _0xa31aaf;});}return null;};}function removeEntity(_0x5d012d,_0x53ee49){return function(_0x31e190){if(_0x31e190){return _0x31e190[_0xc240('0x24')]()[_0xc240('0x23')](function(){_0x5d012d[_0xc240('0x1a')](0xcc)[_0xc240('0x19')]();});}};}function handleEntityNotFound(_0x3806d5,_0x39230f){return function(_0x43cb63){if(!_0x43cb63){_0x3806d5[_0xc240('0x18')](0x194);}return _0x43cb63;};}function handleError(_0x3ca294,_0x335b0e){_0x335b0e=_0x335b0e||0x1f4;return function(_0x33916e){logger['error'](_0x33916e[_0xc240('0x25')]);if(_0x33916e['name']){delete _0x33916e[_0xc240('0x26')];}_0x3ca294[_0xc240('0x1a')](_0x335b0e)[_0xc240('0x27')](_0x33916e);};}exports[_0xc240('0x28')]=function(_0x1a535d,_0x46e532){var _0x5bb462={},_0x415b28={},_0x502c16={'count':0x0,'rows':[]};var _0x28c4fc=_[_0xc240('0x29')](db[_0xc240('0x2a')][_0xc240('0x2b')],function(_0xf81f6d){return{'name':_0xf81f6d[_0xc240('0x2c')],'type':_0xf81f6d[_0xc240('0x2d')][_0xc240('0x2e')]};});_0x415b28[_0xc240('0x2f')]=_['map'](_0x28c4fc,_0xc240('0x26'));_0x415b28[_0xc240('0x30')]=_[_0xc240('0x31')](_0x1a535d[_0xc240('0x30')]);_0x415b28[_0xc240('0x32')]=_[_0xc240('0x33')](_0x415b28[_0xc240('0x2f')],_0x415b28['query']);_0x5bb462[_0xc240('0x34')]=_[_0xc240('0x33')](_0x415b28[_0xc240('0x2f')],qs['fields'](_0x1a535d[_0xc240('0x30')][_0xc240('0x35')]));_0x5bb462[_0xc240('0x34')]=_0x5bb462[_0xc240('0x34')]['length']?_0x5bb462[_0xc240('0x34')]:_0x415b28[_0xc240('0x2f')];if(!_0x1a535d[_0xc240('0x30')][_0xc240('0x36')](_0xc240('0x37'))){_0x5bb462['limit']=qs[_0xc240('0x1d')](_0x1a535d[_0xc240('0x30')][_0xc240('0x1d')]);_0x5bb462['offset']=qs[_0xc240('0x1e')](_0x1a535d[_0xc240('0x30')]['offset']);}_0x5bb462['order']=qs[_0xc240('0x38')](_0x1a535d[_0xc240('0x30')][_0xc240('0x38')]);_0x5bb462[_0xc240('0x39')]=qs[_0xc240('0x32')](_[_0xc240('0x3a')](_0x1a535d['query'],_0x415b28['filters']),_0x28c4fc);if(_0x1a535d[_0xc240('0x30')]['filter']){_0x5bb462[_0xc240('0x39')]=_['merge'](_0x5bb462[_0xc240('0x39')],{'$or':_[_0xc240('0x29')](_0x28c4fc,function(_0x3dcf0c){if(_0x3dcf0c[_0xc240('0x2d')]!=='VIRTUAL'){var _0x2be382={};_0x2be382[_0x3dcf0c[_0xc240('0x26')]]={'$like':'%'+_0x1a535d[_0xc240('0x30')][_0xc240('0x3b')]+'%'};return _0x2be382;}})});}_0x5bb462=_[_0xc240('0x3c')]({},_0x5bb462,_0x1a535d['options']);var _0x4d7384={'where':_0x5bb462['where']};return db[_0xc240('0x2a')][_0xc240('0x1f')](_0x4d7384)[_0xc240('0x23')](function(_0x4224b2){_0x502c16[_0xc240('0x1f')]=_0x4224b2;if(_0x1a535d[_0xc240('0x30')]['includeAll']){_0x5bb462[_0xc240('0x3d')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xc240('0x3e')](_0x5bb462);})[_0xc240('0x23')](function(_0x2506e3){_0x502c16[_0xc240('0x3f')]=_0x2506e3;return _0x502c16;})[_0xc240('0x23')](respondWithFilteredResult(_0x46e532,_0x5bb462))[_0xc240('0x40')](handleError(_0x46e532,null));};exports['show']=function(_0xc5e1f9,_0x231951){var _0x2ffbe5={'raw':!![],'where':{'id':_0xc5e1f9[_0xc240('0x41')]['id']}},_0x5bd39e={};_0x5bd39e['model']=_[_0xc240('0x31')](db[_0xc240('0x2a')][_0xc240('0x2b')]);_0x5bd39e[_0xc240('0x30')]=_[_0xc240('0x31')](_0xc5e1f9[_0xc240('0x30')]);_0x5bd39e[_0xc240('0x32')]=_[_0xc240('0x33')](_0x5bd39e[_0xc240('0x2f')],_0x5bd39e[_0xc240('0x30')]);_0x2ffbe5[_0xc240('0x34')]=_[_0xc240('0x33')](_0x5bd39e['model'],qs['fields'](_0xc5e1f9['query'][_0xc240('0x35')]));_0x2ffbe5['attributes']=_0x2ffbe5['attributes'][_0xc240('0x42')]?_0x2ffbe5[_0xc240('0x34')]:_0x5bd39e[_0xc240('0x2f')];if(_0xc5e1f9[_0xc240('0x30')][_0xc240('0x43')]){_0x2ffbe5[_0xc240('0x3d')]=[{'all':!![]}];}_0x2ffbe5=_[_0xc240('0x3c')]({},_0x2ffbe5,_0xc5e1f9[_0xc240('0x44')]);return db[_0xc240('0x2a')]['find'](_0x2ffbe5)[_0xc240('0x23')](handleEntityNotFound(_0x231951,null))['then'](respondWithResult(_0x231951,null))[_0xc240('0x40')](handleError(_0x231951,null));};exports[_0xc240('0x45')]=function(_0x2ac142,_0x44960f){return db[_0xc240('0x2a')]['create'](_0x2ac142[_0xc240('0x46')],{})[_0xc240('0x23')](respondWithResult(_0x44960f,0xc9))[_0xc240('0x40')](handleError(_0x44960f,null));};exports[_0xc240('0x22')]=function(_0x3aa232,_0xf46f98){if(_0x3aa232[_0xc240('0x46')]['id']){delete _0x3aa232[_0xc240('0x46')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x3aa232[_0xc240('0x41')]['id']}})['then'](handleEntityNotFound(_0xf46f98,null))[_0xc240('0x23')](saveUpdates(_0x3aa232[_0xc240('0x46')],null))['then'](respondWithResult(_0xf46f98,null))[_0xc240('0x40')](handleError(_0xf46f98,null));};exports[_0xc240('0x24')]=function(_0x52a3d4,_0x2ed092){return db[_0xc240('0x2a')][_0xc240('0x47')]({'where':{'id':_0x52a3d4['params']['id']}})['then'](handleEntityNotFound(_0x2ed092,null))[_0xc240('0x23')](removeEntity(_0x2ed092,null))['catch'](handleError(_0x2ed092,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 8c7fb51..7d06cb2 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 _0x6c7c=['idField','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x222f37,_0x44be00){var _0x50f391=function(_0x20a4eb){while(--_0x20a4eb){_0x222f37['push'](_0x222f37['shift']());}};_0x50f391(++_0x44be00);}(_0x6c7c,0xd3));var _0xc6c7=function(_0x4d5935,_0x55dc8a){_0x4d5935=_0x4d5935-0x0;var _0x51c83a=_0x6c7c[_0x4d5935];return _0x51c83a;};'use strict';var _=require(_0xc6c7('0x0'));var util=require(_0xc6c7('0x1'));var logger=require(_0xc6c7('0x2'))('api');var moment=require(_0xc6c7('0x3'));var BPromise=require(_0xc6c7('0x4'));var rp=require(_0xc6c7('0x5'));var fs=require('fs');var path=require(_0xc6c7('0x6'));var rimraf=require(_0xc6c7('0x7'));var config=require(_0xc6c7('0x8'));var attributes=require(_0xc6c7('0x9'));module[_0xc6c7('0xa')]=function(_0x46cdd0,_0x2b6097){return _0x46cdd0[_0xc6c7('0xb')](_0xc6c7('0xc'),attributes,{'tableName':_0xc6c7('0xd'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xc6c7('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd32a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','idField','FieldId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd32a,0x1e0));var _0xad32=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xd32a[_0x556927];return _0x5f1235;};'use strict';var _=require('lodash');var util=require(_0xad32('0x0'));var logger=require(_0xad32('0x1'))(_0xad32('0x2'));var moment=require(_0xad32('0x3'));var BPromise=require(_0xad32('0x4'));var rp=require(_0xad32('0x5'));var fs=require('fs');var path=require(_0xad32('0x6'));var rimraf=require(_0xad32('0x7'));var config=require(_0xad32('0x8'));var attributes=require(_0xad32('0x9'));module[_0xad32('0xa')]=function(_0x93d76f,_0x2e5319){return _0x93d76f[_0xad32('0xb')]('Dynamics365Field',attributes,{'tableName':_0xad32('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xad32('0xd'),_0xad32('0xe')],'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 2d444ce..ef14d59 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 _0x9b96=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x5452c9,_0xc7ea83){var _0x2ca4e1=function(_0x292233){while(--_0x292233){_0x5452c9['push'](_0x5452c9['shift']());}};_0x2ca4e1(++_0xc7ea83);}(_0x9b96,0x18b));var _0x69b9=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9b96[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x69b9('0x0'));var util=require(_0x69b9('0x1'));var moment=require(_0x69b9('0x2'));var BPromise=require(_0x69b9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69b9('0x4'));var db=require(_0x69b9('0x5'))['db'];var utils=require(_0x69b9('0x6'));var logger=require(_0x69b9('0x7'))(_0x69b9('0x8'));var config=require(_0x69b9('0x9'));var jayson=require(_0x69b9('0xa'));var client=jayson[_0x69b9('0xb')][_0x69b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d14c0,_0x2eb1e7,_0x3ecbb9){return new BPromise(function(_0x4c2018,_0x43b446){return client['request'](_0x5d14c0,_0x3ecbb9)['then'](function(_0x2ed059){logger[_0x69b9('0xd')](_0x69b9('0xe'),_0x2eb1e7,_0x69b9('0xf'));logger['debug'](_0x69b9('0x10'),_0x2eb1e7,'request\x20sent',JSON['stringify'](_0x2ed059));if(_0x2ed059['error']){if(_0x2ed059[_0x69b9('0x11')][_0x69b9('0x12')]===0x1f4){logger[_0x69b9('0x11')](_0x69b9('0xe'),_0x2eb1e7,_0x2ed059[_0x69b9('0x11')][_0x69b9('0x13')]);return _0x43b446(_0x2ed059[_0x69b9('0x11')][_0x69b9('0x13')]);}logger[_0x69b9('0x11')](_0x69b9('0xe'),_0x2eb1e7,_0x2ed059[_0x69b9('0x11')][_0x69b9('0x13')]);return _0x4c2018(_0x2ed059[_0x69b9('0x11')]['message']);}else{logger[_0x69b9('0xd')](_0x69b9('0xe'),_0x2eb1e7,_0x69b9('0xf'));_0x4c2018(_0x2ed059[_0x69b9('0x14')][_0x69b9('0x13')]);}})[_0x69b9('0x15')](function(_0x4afe17){logger[_0x69b9('0x11')](_0x69b9('0xe'),_0x2eb1e7,_0x4afe17);_0x43b446(_0x4afe17);});});} \ No newline at end of file +var _0xf851=['stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xf851,0x11d));var _0x1f85=function(_0x2ee01d,_0x48f7a7){_0x2ee01d=_0x2ee01d-0x0;var _0x24bc9f=_0xf851[_0x2ee01d];return _0x24bc9f;};'use strict';var _=require('lodash');var util=require(_0x1f85('0x0'));var moment=require(_0x1f85('0x1'));var BPromise=require(_0x1f85('0x2'));var rs=require(_0x1f85('0x3'));var fs=require('fs');var Redis=require(_0x1f85('0x4'));var db=require(_0x1f85('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f85('0x6'));var config=require(_0x1f85('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1f85('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf902c8,_0x336a26,_0x22b1c4){return new BPromise(function(_0x44bb4b,_0x1de042){return client[_0x1f85('0x9')](_0xf902c8,_0x22b1c4)[_0x1f85('0xa')](function(_0x1681ac){logger['info'](_0x1f85('0xb'),_0x336a26,_0x1f85('0xc'));logger[_0x1f85('0xd')](_0x1f85('0xe'),_0x336a26,_0x1f85('0xc'),JSON[_0x1f85('0xf')](_0x1681ac));if(_0x1681ac[_0x1f85('0x10')]){if(_0x1681ac[_0x1f85('0x10')][_0x1f85('0x11')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x336a26,_0x1681ac[_0x1f85('0x10')][_0x1f85('0x12')]);return _0x1de042(_0x1681ac['error']['message']);}logger[_0x1f85('0x10')](_0x1f85('0xb'),_0x336a26,_0x1681ac[_0x1f85('0x10')][_0x1f85('0x12')]);return _0x44bb4b(_0x1681ac[_0x1f85('0x10')][_0x1f85('0x12')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x336a26,_0x1f85('0xc'));_0x44bb4b(_0x1681ac[_0x1f85('0x13')]['message']);}})['catch'](function(_0x6f4ec4){logger['error'](_0x1f85('0xb'),_0x336a26,_0x6f4ec4);_0x1de042(_0x6f4ec4);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 3b7981f..d73b4ea 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 _0xb3d5=['put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x44ec38,_0x203113){var _0x4627b5=function(_0x58e4cd){while(--_0x58e4cd){_0x44ec38['push'](_0x44ec38['shift']());}};_0x4627b5(++_0x203113);}(_0xb3d5,0x1d1));var _0x5b3d=function(_0x3ff0cb,_0x4808b6){_0x3ff0cb=_0x3ff0cb-0x0;var _0x3e357f=_0xb3d5[_0x3ff0cb];return _0x3e357f;};'use strict';var multer=require(_0x5b3d('0x0'));var util=require(_0x5b3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5b3d('0x2'));var router=express[_0x5b3d('0x3')]();var fs_extra=require(_0x5b3d('0x4'));var auth=require(_0x5b3d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x5b3d('0x6')]('/',auth[_0x5b3d('0x7')](),controller[_0x5b3d('0x8')]);router[_0x5b3d('0x6')](_0x5b3d('0x9'),auth[_0x5b3d('0x7')](),controller[_0x5b3d('0xa')]);router[_0x5b3d('0x6')](_0x5b3d('0xb'),auth[_0x5b3d('0x7')](),controller[_0x5b3d('0xc')]);router['get'](_0x5b3d('0xd'),auth[_0x5b3d('0x7')](),controller[_0x5b3d('0xe')]);router[_0x5b3d('0xf')]('/',auth[_0x5b3d('0x7')](),controller[_0x5b3d('0x10')]);router[_0x5b3d('0xf')](_0x5b3d('0xb'),auth['isAuthenticated'](),controller[_0x5b3d('0x11')]);router[_0x5b3d('0x12')](_0x5b3d('0x9'),auth[_0x5b3d('0x7')](),controller[_0x5b3d('0x13')]);router[_0x5b3d('0x14')](_0x5b3d('0x9'),auth['isAuthenticated'](),controller[_0x5b3d('0x15')]);module[_0x5b3d('0x16')]=router; \ No newline at end of file +var _0x5381=['create','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5381,0x8a));var _0x1538=function(_0x24ca09,_0x10bfac){_0x24ca09=_0x24ca09-0x0;var _0x19f1cc=_0x5381[_0x24ca09];return _0x19f1cc;};'use strict';var multer=require(_0x1538('0x0'));var util=require(_0x1538('0x1'));var path=require(_0x1538('0x2'));var timeout=require(_0x1538('0x3'));var express=require(_0x1538('0x4'));var router=express[_0x1538('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1538('0x6'));var controller=require(_0x1538('0x7'));router[_0x1538('0x8')]('/',auth[_0x1538('0x9')](),controller['index']);router[_0x1538('0x8')](_0x1538('0xa'),auth[_0x1538('0x9')](),controller[_0x1538('0xb')]);router[_0x1538('0x8')](_0x1538('0xc'),auth[_0x1538('0x9')](),controller[_0x1538('0xd')]);router[_0x1538('0x8')](_0x1538('0xe'),auth[_0x1538('0x9')](),controller[_0x1538('0xf')]);router['post']('/',auth[_0x1538('0x9')](),controller[_0x1538('0x10')]);router[_0x1538('0x11')](_0x1538('0xc'),auth[_0x1538('0x9')](),controller['addConfiguration']);router[_0x1538('0x12')]('/:id',auth[_0x1538('0x9')](),controller[_0x1538('0x13')]);router['delete'](_0x1538('0xa'),auth['isAuthenticated'](),controller[_0x1538('0x14')]);module[_0x1538('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 65c8f36..c605cd6 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 _0xffd6=['exports','STRING','username','sequelize'];(function(_0xa975f,_0x41de82){var _0x501418=function(_0x2d98f6){while(--_0x2d98f6){_0xa975f['push'](_0xa975f['shift']());}};_0x501418(++_0x41de82);}(_0xffd6,0x97));var _0x6ffd=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xffd6[_0x576170];return _0x397c70;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe820=['sequelize','STRING','username'];(function(_0x3e8287,_0x4c08b8){var _0x346da5=function(_0x198d46){while(--_0x198d46){_0x3e8287['push'](_0x3e8287['shift']());}};_0x346da5(++_0x4c08b8);}(_0xe820,0xd2));var _0x0e82=function(_0x45bec6,_0x3cf863){_0x45bec6=_0x45bec6-0x0;var _0x8c2b59=_0xe820[_0x45bec6];return _0x8c2b59;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0e82('0x2')},'apiKey':{'type':Sequelize[_0x0e82('0x1')]},'remoteUri':{'type':Sequelize[_0x0e82('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 4b31904..411a474 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 _0x44d4=['slice','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','description','priority','group','source','ticket_type','company','includes','default','custom_text','label','choices','capitalize','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','include','FreshdeskAccount','findAll','rows','catch','params','includeAll','options','find','create','body','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','findOne','remoteUri','apiKey'];(function(_0xf59a18,_0x592cd4){var _0x291466=function(_0x118e62){while(--_0x118e62){_0xf59a18['push'](_0xf59a18['shift']());}};_0x291466(++_0x592cd4);}(_0x44d4,0x161));var _0x444d=function(_0x29f014,_0x508522){_0x29f014=_0x29f014-0x0;var _0x316be5=_0x44d4[_0x29f014];return _0x316be5;};'use strict';var emlformat=require(_0x444d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x444d('0x1'));var moment=require(_0x444d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x444d('0x3'));var sox=require(_0x444d('0x4'));var csv=require(_0x444d('0x5'));var ejs=require(_0x444d('0x6'));var fs=require('fs');var fs_extra=require(_0x444d('0x7'));var _=require(_0x444d('0x8'));var squel=require(_0x444d('0x9'));var crypto=require('crypto');var jsforce=require(_0x444d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x444d('0x5'));var querystring=require(_0x444d('0xb'));var Papa=require(_0x444d('0xc'));var Redis=require(_0x444d('0xd'));var authService=require(_0x444d('0xe'));var qs=require(_0x444d('0xf'));var as=require(_0x444d('0x10'));var hardwareService=require(_0x444d('0x11'));var logger=require(_0x444d('0x12'))(_0x444d('0x13'));var utils=require(_0x444d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x444d('0x15'));var db=require(_0x444d('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x11db08,_0x3a2d03){_0x3a2d03=_0x3a2d03||0xcc;return function(_0x2807fb){if(_0x2807fb){return _0x11db08['sendStatus'](_0x3a2d03);}return _0x11db08[_0x444d('0x17')](_0x3a2d03)[_0x444d('0x18')]();};}function respondWithResult(_0x390231,_0x545a4b){_0x545a4b=_0x545a4b||0xc8;return function(_0x4107df){if(_0x4107df){return _0x390231['status'](_0x545a4b)[_0x444d('0x19')](_0x4107df);}};}function respondWithFilteredResult(_0x43210d,_0x21cbb0){return function(_0x1bd5db){if(_0x1bd5db){var _0x57c992=typeof _0x21cbb0['offset']==='undefined'&&typeof _0x21cbb0['limit']===_0x444d('0x1a');var _0x3f5372=_0x1bd5db[_0x444d('0x1b')];var _0x5eb11e=_0x57c992?0x0:_0x21cbb0['offset'];var _0x2f7809=_0x57c992?_0x1bd5db[_0x444d('0x1b')]:_0x21cbb0[_0x444d('0x1c')]+_0x21cbb0[_0x444d('0x1d')];var _0x3e2bd2;if(_0x2f7809>=_0x3f5372){_0x2f7809=_0x3f5372;_0x3e2bd2=0xc8;}else{_0x3e2bd2=0xce;}_0x43210d['status'](_0x3e2bd2);return _0x43210d[_0x444d('0x1e')](_0x444d('0x1f'),_0x5eb11e+'-'+_0x2f7809+'/'+_0x3f5372)[_0x444d('0x19')](_0x1bd5db);}return null;};}function patchUpdates(_0x3bac2f){return function(_0x17ee20){try{jsonpatch[_0x444d('0x20')](_0x17ee20,_0x3bac2f,!![]);}catch(_0x3365ae){return BPromise['reject'](_0x3365ae);}return _0x17ee20['save']();};}function saveUpdates(_0xe2cd4d,_0x4ef57b){return function(_0x4dd652){if(_0x4dd652){return _0x4dd652[_0x444d('0x21')](_0xe2cd4d)[_0x444d('0x22')](function(_0x546a9f){return _0x546a9f;});}return null;};}function removeEntity(_0x5bbc84,_0x17cc83){return function(_0x2a149c){if(_0x2a149c){return _0x2a149c[_0x444d('0x23')]()[_0x444d('0x22')](function(){_0x5bbc84[_0x444d('0x17')](0xcc)[_0x444d('0x18')]();});}};}function handleEntityNotFound(_0x4016b8,_0x394d06){return function(_0x218873){if(!_0x218873){_0x4016b8['sendStatus'](0x194);}return _0x218873;};}function handleError(_0x5b8f14,_0x240c32){_0x240c32=_0x240c32||0x1f4;return function(_0x4b4f33){logger['error'](_0x4b4f33[_0x444d('0x24')]);if(_0x4b4f33['name']){delete _0x4b4f33[_0x444d('0x25')];}_0x5b8f14[_0x444d('0x17')](_0x240c32)['send'](_0x4b4f33);};}exports[_0x444d('0x26')]=function(_0x262fd2,_0x3a4806){var _0xea2b0b={},_0x5aac3a={},_0x24ec2e={'count':0x0,'rows':[]};var _0x5e81dc=_[_0x444d('0x27')](db['FreshdeskAccount'][_0x444d('0x28')],function(_0xa8aadc){return{'name':_0xa8aadc[_0x444d('0x29')],'type':_0xa8aadc[_0x444d('0x2a')][_0x444d('0x2b')]};});_0x5aac3a['model']=_[_0x444d('0x27')](_0x5e81dc,_0x444d('0x25'));_0x5aac3a[_0x444d('0x2c')]=_[_0x444d('0x2d')](_0x262fd2[_0x444d('0x2c')]);_0x5aac3a[_0x444d('0x2e')]=_[_0x444d('0x2f')](_0x5aac3a[_0x444d('0x30')],_0x5aac3a[_0x444d('0x2c')]);_0xea2b0b['attributes']=_['intersection'](_0x5aac3a[_0x444d('0x30')],qs[_0x444d('0x31')](_0x262fd2['query'][_0x444d('0x31')]));_0xea2b0b[_0x444d('0x32')]=_0xea2b0b[_0x444d('0x32')][_0x444d('0x33')]?_0xea2b0b[_0x444d('0x32')]:_0x5aac3a['model'];if(!_0x262fd2['query']['hasOwnProperty'](_0x444d('0x34'))){_0xea2b0b[_0x444d('0x1d')]=qs['limit'](_0x262fd2[_0x444d('0x2c')]['limit']);_0xea2b0b[_0x444d('0x1c')]=qs[_0x444d('0x1c')](_0x262fd2[_0x444d('0x2c')][_0x444d('0x1c')]);}_0xea2b0b[_0x444d('0x35')]=qs['sort'](_0x262fd2['query'][_0x444d('0x36')]);_0xea2b0b[_0x444d('0x37')]=qs[_0x444d('0x2e')](_[_0x444d('0x38')](_0x262fd2[_0x444d('0x2c')],_0x5aac3a[_0x444d('0x2e')]),_0x5e81dc);if(_0x262fd2[_0x444d('0x2c')]['filter']){_0xea2b0b[_0x444d('0x37')]=_[_0x444d('0x39')](_0xea2b0b['where'],{'$or':_['map'](_0x5e81dc,function(_0x1a44f9){if(_0x1a44f9[_0x444d('0x2a')]!=='VIRTUAL'){var _0x4352f1={};_0x4352f1[_0x1a44f9[_0x444d('0x25')]]={'$like':'%'+_0x262fd2[_0x444d('0x2c')][_0x444d('0x3a')]+'%'};return _0x4352f1;}})});}_0xea2b0b=_['merge']({},_0xea2b0b,_0x262fd2['options']);var _0x57d0b8={'where':_0xea2b0b[_0x444d('0x37')]};return db['FreshdeskAccount'][_0x444d('0x1b')](_0x57d0b8)[_0x444d('0x22')](function(_0x4cae30){_0x24ec2e[_0x444d('0x1b')]=_0x4cae30;if(_0x262fd2[_0x444d('0x2c')]['includeAll']){_0xea2b0b[_0x444d('0x3b')]=[{'all':!![]}];}return db[_0x444d('0x3c')][_0x444d('0x3d')](_0xea2b0b);})[_0x444d('0x22')](function(_0x2b8ba6){_0x24ec2e[_0x444d('0x3e')]=_0x2b8ba6;return _0x24ec2e;})[_0x444d('0x22')](respondWithFilteredResult(_0x3a4806,_0xea2b0b))[_0x444d('0x3f')](handleError(_0x3a4806,null));};exports['show']=function(_0x526a49,_0x5d8a5b){var _0x2a4988={'raw':![],'where':{'id':_0x526a49[_0x444d('0x40')]['id']}},_0x1e1585={};_0x1e1585[_0x444d('0x30')]=_['keys'](db[_0x444d('0x3c')][_0x444d('0x28')]);_0x1e1585[_0x444d('0x2c')]=_['keys'](_0x526a49[_0x444d('0x2c')]);_0x1e1585['filters']=_[_0x444d('0x2f')](_0x1e1585[_0x444d('0x30')],_0x1e1585[_0x444d('0x2c')]);_0x2a4988[_0x444d('0x32')]=_['intersection'](_0x1e1585[_0x444d('0x30')],qs[_0x444d('0x31')](_0x526a49[_0x444d('0x2c')][_0x444d('0x31')]));_0x2a4988[_0x444d('0x32')]=_0x2a4988[_0x444d('0x32')][_0x444d('0x33')]?_0x2a4988[_0x444d('0x32')]:_0x1e1585[_0x444d('0x30')];if(_0x526a49[_0x444d('0x2c')][_0x444d('0x41')]){_0x2a4988[_0x444d('0x3b')]=[{'all':!![]}];}_0x2a4988=_[_0x444d('0x39')]({},_0x2a4988,_0x526a49[_0x444d('0x42')]);return db[_0x444d('0x3c')][_0x444d('0x43')](_0x2a4988)[_0x444d('0x22')](handleEntityNotFound(_0x5d8a5b,null))['then'](respondWithResult(_0x5d8a5b,null))['catch'](handleError(_0x5d8a5b,null));};exports[_0x444d('0x44')]=function(_0x2014d8,_0xa76be){return db['FreshdeskAccount']['create'](_0x2014d8['body'],{})[_0x444d('0x22')](respondWithResult(_0xa76be,0xc9))[_0x444d('0x3f')](handleError(_0xa76be,null));};exports[_0x444d('0x21')]=function(_0x1bf30f,_0x3af9b9){if(_0x1bf30f[_0x444d('0x45')]['id']){delete _0x1bf30f[_0x444d('0x45')]['id'];}return db[_0x444d('0x3c')][_0x444d('0x43')]({'where':{'id':_0x1bf30f[_0x444d('0x40')]['id']}})[_0x444d('0x22')](handleEntityNotFound(_0x3af9b9,null))[_0x444d('0x22')](saveUpdates(_0x1bf30f['body'],null))[_0x444d('0x22')](respondWithResult(_0x3af9b9,null))['catch'](handleError(_0x3af9b9,null));};exports[_0x444d('0x23')]=function(_0x3b7d0f,_0x579de1){return db[_0x444d('0x3c')][_0x444d('0x43')]({'where':{'id':_0x3b7d0f[_0x444d('0x40')]['id']}})['then'](handleEntityNotFound(_0x579de1,null))['then'](removeEntity(_0x579de1,null))[_0x444d('0x3f')](handleError(_0x579de1,null));};exports[_0x444d('0x46')]=function(_0x2b3525,_0x4c3962,_0x3c5bc9){var _0x19ca3c={};var _0x344372={};var _0x3e356e;var _0x15b3ee;return db[_0x444d('0x3c')]['findOne']({'where':{'id':_0x2b3525[_0x444d('0x40')]['id']}})['then'](handleEntityNotFound(_0x4c3962,null))['then'](function(_0x2958b3){if(_0x2958b3){_0x3e356e=_0x2958b3;_0x344372['model']=_[_0x444d('0x2d')](db[_0x444d('0x47')][_0x444d('0x28')]);_0x344372[_0x444d('0x2c')]=_['keys'](_0x2b3525[_0x444d('0x2c')]);_0x344372[_0x444d('0x2e')]=_[_0x444d('0x2f')](_0x344372[_0x444d('0x30')],_0x344372[_0x444d('0x2c')]);_0x19ca3c[_0x444d('0x32')]=_[_0x444d('0x2f')](_0x344372['model'],qs[_0x444d('0x31')](_0x2b3525[_0x444d('0x2c')]['fields']));_0x19ca3c[_0x444d('0x32')]=_0x19ca3c['attributes']['length']?_0x19ca3c[_0x444d('0x32')]:_0x344372['model'];_0x19ca3c[_0x444d('0x35')]=qs[_0x444d('0x36')](_0x2b3525[_0x444d('0x2c')][_0x444d('0x36')]);_0x19ca3c['where']=qs[_0x444d('0x2e')](_['pick'](_0x2b3525['query'],_0x344372[_0x444d('0x2e')]));if(_0x2b3525[_0x444d('0x2c')][_0x444d('0x3a')]){_0x19ca3c[_0x444d('0x37')]=_[_0x444d('0x39')](_0x19ca3c[_0x444d('0x37')],{'$or':_[_0x444d('0x27')](_0x19ca3c['attributes'],function(_0x315916){var _0x459ffa={};_0x459ffa[_0x315916]={'$like':'%'+_0x2b3525[_0x444d('0x2c')]['filter']+'%'};return _0x459ffa;})});}_0x19ca3c=_[_0x444d('0x39')]({},_0x19ca3c,_0x2b3525[_0x444d('0x42')]);return _0x3e356e[_0x444d('0x46')](_0x19ca3c);}})['then'](function(_0x6c3269){if(_0x6c3269){_0x15b3ee=_0x6c3269[_0x444d('0x33')];if(!_0x2b3525[_0x444d('0x2c')][_0x444d('0x48')](_0x444d('0x34'))){_0x19ca3c[_0x444d('0x1d')]=qs[_0x444d('0x1d')](_0x2b3525['query']['limit']);_0x19ca3c[_0x444d('0x1c')]=qs[_0x444d('0x1c')](_0x2b3525[_0x444d('0x2c')][_0x444d('0x1c')]);}return _0x3e356e['getConfigurations'](_0x19ca3c);}})[_0x444d('0x22')](function(_0x1ac218){if(_0x1ac218){return _0x1ac218?{'count':_0x15b3ee,'rows':_0x1ac218}:null;}})[_0x444d('0x22')](respondWithResult(_0x4c3962,null))[_0x444d('0x3f')](handleError(_0x4c3962,null));};exports[_0x444d('0x49')]=function(_0x4f204e,_0x9c402c,_0x32a31e){if(_0x4f204e[_0x444d('0x45')]['id']){delete _0x4f204e[_0x444d('0x45')]['id'];}return db[_0x444d('0x3c')]['findOne']({'where':{'id':_0x4f204e[_0x444d('0x40')]['id']}})['then'](handleEntityNotFound(_0x9c402c,null))[_0x444d('0x22')](function(_0x575cfb){if(_0x575cfb){_0x4f204e['body']['AccountId']=_0x575cfb['id'];_0x4f204e[_0x444d('0x45')]['Subjects']=integrations[_0x444d('0x4a')](_0x4f204e['body'][_0x444d('0x4b')],_0x4f204e[_0x444d('0x45')][_0x444d('0x2a')]);_0x4f204e['body'][_0x444d('0x4c')]=integrations[_0x444d('0x4d')](_0x4f204e[_0x444d('0x45')][_0x444d('0x4b')],_0x4f204e[_0x444d('0x45')]['type']);return db[_0x444d('0x47')][_0x444d('0x44')](_0x4f204e[_0x444d('0x45')],{'include':[{'model':db[_0x444d('0x4e')],'as':'Subjects'},{'model':db[_0x444d('0x4e')],'as':_0x444d('0x4c')}]});}return null;})['then'](respondWithResult(_0x9c402c,null))[_0x444d('0x3f')](handleError(_0x9c402c,null));};exports[_0x444d('0x4f')]=function(_0x12c44e,_0x2d7ab0,_0xc02cc7){var _0x595758='';return db[_0x444d('0x3c')][_0x444d('0x50')]({'where':{'id':_0x12c44e['params']['id']},'attributes':['id',_0x444d('0x51'),_0x444d('0x52')]})[_0x444d('0x22')](handleEntityNotFound(_0x2d7ab0,null))[_0x444d('0x22')](function(_0x4f7ea1){if(_0x4f7ea1){_0x595758=_0x4f7ea1['remoteUri'];var _0x39700f=_0x595758[_0x444d('0x53')](-0x1);if(_0x39700f==='/'){_0x595758=_0x595758['substring'](0x0,_0x595758['lastIndexOf'](_0x39700f));}return rp({'method':_0x444d('0x54'),'uri':util[_0x444d('0x55')](_0x444d('0x56'),_0x595758,_0x444d('0x57')),'headers':{'Authorization':util[_0x444d('0x55')]('Basic\x20%s',new Buffer(util[_0x444d('0x55')](_0x444d('0x58'),_0x4f7ea1[_0x444d('0x52')]))[_0x444d('0x59')](_0x444d('0x5a')))},'json':!![]});}})[_0x444d('0x22')](function(_0x2b53a8){if(_0x2b53a8){var _0x4e1c1f=[_0x444d('0x5b'),'subject','agent',_0x444d('0x5c'),_0x444d('0x17'),_0x444d('0x5d'),_0x444d('0x5e'),_0x444d('0x5f'),_0x444d('0x60'),_0x444d('0x5e'),_0x444d('0x61')];_['remove'](_0x2b53a8,function(_0x366ab6){return _0x4e1c1f[_0x444d('0x62')](_0x366ab6[_0x444d('0x25')])||!_0x366ab6[_0x444d('0x63')]&&_0x366ab6[_0x444d('0x2a')]!==_0x444d('0x64')&&_0x366ab6[_0x444d('0x2a')]!=='custom_dropdown';});return{'count':_0x2b53a8[_0x444d('0x33')],'rows':_['map'](_0x2b53a8,function(_0x2a4bed){return{'id':_0x2a4bed['name'],'name':_0x2a4bed[_0x444d('0x65')],'custom':!_0x2a4bed['default'],'options':_0x2a4bed[_0x444d('0x66')]?_['map'](_0x2a4bed[_0x444d('0x66')],function(_0x1686aa){return{'name':_[_0x444d('0x67')](_0x1686aa),'value':_0x1686aa};}):[]};})};}})[_0x444d('0x22')](respondWithResult(_0x2d7ab0,null))[_0x444d('0x3f')](function(_0x4e4e88){var _0x4ca26f=_0x12c44e[_0x444d('0x2c')][_0x444d('0x68')]?0x1f4:_0x4e4e88[_0x444d('0x69')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x444d('0x4f'),_0x4ca26f,JSON[_0x444d('0x6a')](_0x4e4e88));delete _0x4e4e88[_0x444d('0x25')];if(_0x4ca26f===0x191){_0x4ca26f=0x190;}_0x2d7ab0[_0x444d('0x17')](_0x4ca26f)[_0x444d('0x6b')](_0x12c44e[_0x444d('0x2c')]['test']?{'message':_0x444d('0x6c'),'statusCode':_0x4e4e88['statusCode']}:_0x4e4e88);});}; \ No newline at end of file +var _0x2116=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','priority','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2116,0x67));var _0x6211=function(_0x4a0953,_0x98b6f2){_0x4a0953=_0x4a0953-0x0;var _0x5c1af0=_0x2116[_0x4a0953];return _0x5c1af0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6211('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6211('0x1'));var rp=require(_0x6211('0x2'));var moment=require(_0x6211('0x3'));var BPromise=require(_0x6211('0x4'));var Mustache=require('mustache');var util=require(_0x6211('0x5'));var path=require(_0x6211('0x6'));var sox=require(_0x6211('0x7'));var csv=require(_0x6211('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6211('0x9'));var _=require('lodash');var squel=require(_0x6211('0xa'));var crypto=require(_0x6211('0xb'));var jsforce=require(_0x6211('0xc'));var deskjs=require(_0x6211('0xd'));var toCsv=require(_0x6211('0x8'));var querystring=require(_0x6211('0xe'));var Papa=require(_0x6211('0xf'));var Redis=require('ioredis');var authService=require(_0x6211('0x10'));var qs=require(_0x6211('0x11'));var as=require(_0x6211('0x12'));var hardwareService=require(_0x6211('0x13'));var logger=require(_0x6211('0x14'))(_0x6211('0x15'));var utils=require(_0x6211('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6211('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6211('0x18'));function respondWithStatusCode(_0x6661a7,_0x22963d){_0x22963d=_0x22963d||0xcc;return function(_0x4bf101){if(_0x4bf101){return _0x6661a7[_0x6211('0x19')](_0x22963d);}return _0x6661a7[_0x6211('0x1a')](_0x22963d)[_0x6211('0x1b')]();};}function respondWithResult(_0x509faa,_0x54a303){_0x54a303=_0x54a303||0xc8;return function(_0x1685eb){if(_0x1685eb){return _0x509faa[_0x6211('0x1a')](_0x54a303)[_0x6211('0x1c')](_0x1685eb);}};}function respondWithFilteredResult(_0xf69c79,_0xa23863){return function(_0x15adb6){if(_0x15adb6){var _0x16d6a3=typeof _0xa23863[_0x6211('0x1d')]==='undefined'&&typeof _0xa23863[_0x6211('0x1e')]===_0x6211('0x1f');var _0x431081=_0x15adb6[_0x6211('0x20')];var _0xecea40=_0x16d6a3?0x0:_0xa23863[_0x6211('0x1d')];var _0x460efc=_0x16d6a3?_0x15adb6['count']:_0xa23863[_0x6211('0x1d')]+_0xa23863[_0x6211('0x1e')];var _0x5af096;if(_0x460efc>=_0x431081){_0x460efc=_0x431081;_0x5af096=0xc8;}else{_0x5af096=0xce;}_0xf69c79[_0x6211('0x1a')](_0x5af096);return _0xf69c79[_0x6211('0x21')](_0x6211('0x22'),_0xecea40+'-'+_0x460efc+'/'+_0x431081)[_0x6211('0x1c')](_0x15adb6);}return null;};}function patchUpdates(_0x4d99bc){return function(_0x51a389){try{jsonpatch[_0x6211('0x23')](_0x51a389,_0x4d99bc,!![]);}catch(_0x3cc2cf){return BPromise['reject'](_0x3cc2cf);}return _0x51a389['save']();};}function saveUpdates(_0x15ca00,_0x1e6a53){return function(_0x3a39fb){if(_0x3a39fb){return _0x3a39fb[_0x6211('0x24')](_0x15ca00)['then'](function(_0x2c1c0a){return _0x2c1c0a;});}return null;};}function removeEntity(_0x311054,_0x16fb0c){return function(_0x49153f){if(_0x49153f){return _0x49153f[_0x6211('0x25')]()[_0x6211('0x26')](function(){_0x311054[_0x6211('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x532778,_0x4ebae9){return function(_0x4c0017){if(!_0x4c0017){_0x532778['sendStatus'](0x194);}return _0x4c0017;};}function handleError(_0x15a096,_0x2badd2){_0x2badd2=_0x2badd2||0x1f4;return function(_0x140496){logger[_0x6211('0x27')](_0x140496[_0x6211('0x28')]);if(_0x140496[_0x6211('0x29')]){delete _0x140496[_0x6211('0x29')];}_0x15a096[_0x6211('0x1a')](_0x2badd2)[_0x6211('0x2a')](_0x140496);};}exports[_0x6211('0x2b')]=function(_0x105721,_0x38f5f8){var _0x3564f2={},_0x26a8cc={},_0x20e576={'count':0x0,'rows':[]};var _0x424ce3=_[_0x6211('0x2c')](db['FreshdeskAccount'][_0x6211('0x2d')],function(_0x44404a){return{'name':_0x44404a[_0x6211('0x2e')],'type':_0x44404a['type']['key']};});_0x26a8cc[_0x6211('0x2f')]=_['map'](_0x424ce3,_0x6211('0x29'));_0x26a8cc[_0x6211('0x30')]=_[_0x6211('0x31')](_0x105721['query']);_0x26a8cc[_0x6211('0x32')]=_[_0x6211('0x33')](_0x26a8cc[_0x6211('0x2f')],_0x26a8cc[_0x6211('0x30')]);_0x3564f2[_0x6211('0x34')]=_['intersection'](_0x26a8cc['model'],qs[_0x6211('0x35')](_0x105721['query']['fields']));_0x3564f2['attributes']=_0x3564f2[_0x6211('0x34')][_0x6211('0x36')]?_0x3564f2[_0x6211('0x34')]:_0x26a8cc['model'];if(!_0x105721[_0x6211('0x30')]['hasOwnProperty'](_0x6211('0x37'))){_0x3564f2[_0x6211('0x1e')]=qs[_0x6211('0x1e')](_0x105721['query'][_0x6211('0x1e')]);_0x3564f2[_0x6211('0x1d')]=qs[_0x6211('0x1d')](_0x105721[_0x6211('0x30')][_0x6211('0x1d')]);}_0x3564f2[_0x6211('0x38')]=qs[_0x6211('0x39')](_0x105721[_0x6211('0x30')]['sort']);_0x3564f2[_0x6211('0x3a')]=qs[_0x6211('0x32')](_[_0x6211('0x3b')](_0x105721[_0x6211('0x30')],_0x26a8cc[_0x6211('0x32')]),_0x424ce3);if(_0x105721['query'][_0x6211('0x3c')]){_0x3564f2[_0x6211('0x3a')]=_[_0x6211('0x3d')](_0x3564f2[_0x6211('0x3a')],{'$or':_['map'](_0x424ce3,function(_0x457ff9){if(_0x457ff9[_0x6211('0x3e')]!==_0x6211('0x3f')){var _0x1f3a4a={};_0x1f3a4a[_0x457ff9[_0x6211('0x29')]]={'$like':'%'+_0x105721[_0x6211('0x30')][_0x6211('0x3c')]+'%'};return _0x1f3a4a;}})});}_0x3564f2=_['merge']({},_0x3564f2,_0x105721[_0x6211('0x40')]);var _0x4ed0c5={'where':_0x3564f2[_0x6211('0x3a')]};return db[_0x6211('0x41')]['count'](_0x4ed0c5)[_0x6211('0x26')](function(_0x1b5e1c){_0x20e576['count']=_0x1b5e1c;if(_0x105721['query']['includeAll']){_0x3564f2[_0x6211('0x42')]=[{'all':!![]}];}return db[_0x6211('0x41')][_0x6211('0x43')](_0x3564f2);})['then'](function(_0x132fb7){_0x20e576[_0x6211('0x44')]=_0x132fb7;return _0x20e576;})[_0x6211('0x26')](respondWithFilteredResult(_0x38f5f8,_0x3564f2))[_0x6211('0x45')](handleError(_0x38f5f8,null));};exports[_0x6211('0x46')]=function(_0x476456,_0x28721a){var _0x371956={'raw':![],'where':{'id':_0x476456['params']['id']}},_0x4e2c14={};_0x4e2c14[_0x6211('0x2f')]=_[_0x6211('0x31')](db[_0x6211('0x41')][_0x6211('0x2d')]);_0x4e2c14[_0x6211('0x30')]=_[_0x6211('0x31')](_0x476456['query']);_0x4e2c14[_0x6211('0x32')]=_[_0x6211('0x33')](_0x4e2c14[_0x6211('0x2f')],_0x4e2c14[_0x6211('0x30')]);_0x371956[_0x6211('0x34')]=_['intersection'](_0x4e2c14[_0x6211('0x2f')],qs['fields'](_0x476456[_0x6211('0x30')]['fields']));_0x371956[_0x6211('0x34')]=_0x371956[_0x6211('0x34')]['length']?_0x371956[_0x6211('0x34')]:_0x4e2c14[_0x6211('0x2f')];if(_0x476456[_0x6211('0x30')]['includeAll']){_0x371956[_0x6211('0x42')]=[{'all':!![]}];}_0x371956=_['merge']({},_0x371956,_0x476456[_0x6211('0x40')]);return db['FreshdeskAccount'][_0x6211('0x47')](_0x371956)['then'](handleEntityNotFound(_0x28721a,null))[_0x6211('0x26')](respondWithResult(_0x28721a,null))[_0x6211('0x45')](handleError(_0x28721a,null));};exports[_0x6211('0x48')]=function(_0x2111fd,_0x27eae4){return db[_0x6211('0x41')][_0x6211('0x48')](_0x2111fd[_0x6211('0x49')],{})[_0x6211('0x26')](respondWithResult(_0x27eae4,0xc9))[_0x6211('0x45')](handleError(_0x27eae4,null));};exports['update']=function(_0x2bc4ae,_0x40c8df){if(_0x2bc4ae[_0x6211('0x49')]['id']){delete _0x2bc4ae[_0x6211('0x49')]['id'];}return db['FreshdeskAccount'][_0x6211('0x47')]({'where':{'id':_0x2bc4ae[_0x6211('0x4a')]['id']}})['then'](handleEntityNotFound(_0x40c8df,null))[_0x6211('0x26')](saveUpdates(_0x2bc4ae['body'],null))['then'](respondWithResult(_0x40c8df,null))[_0x6211('0x45')](handleError(_0x40c8df,null));};exports[_0x6211('0x25')]=function(_0x5aae45,_0xa0485a){return db[_0x6211('0x41')][_0x6211('0x47')]({'where':{'id':_0x5aae45[_0x6211('0x4a')]['id']}})[_0x6211('0x26')](handleEntityNotFound(_0xa0485a,null))['then'](removeEntity(_0xa0485a,null))[_0x6211('0x45')](handleError(_0xa0485a,null));};exports[_0x6211('0x4b')]=function(_0x1901d7,_0x4d0acd,_0x1b264a){var _0x588ab7={};var _0x21e5e2={};var _0x4a15b0;var _0x4b1d8e;return db[_0x6211('0x41')][_0x6211('0x4c')]({'where':{'id':_0x1901d7['params']['id']}})[_0x6211('0x26')](handleEntityNotFound(_0x4d0acd,null))[_0x6211('0x26')](function(_0x41c86a){if(_0x41c86a){_0x4a15b0=_0x41c86a;_0x21e5e2[_0x6211('0x2f')]=_['keys'](db[_0x6211('0x4d')][_0x6211('0x2d')]);_0x21e5e2[_0x6211('0x30')]=_[_0x6211('0x31')](_0x1901d7[_0x6211('0x30')]);_0x21e5e2[_0x6211('0x32')]=_[_0x6211('0x33')](_0x21e5e2[_0x6211('0x2f')],_0x21e5e2['query']);_0x588ab7[_0x6211('0x34')]=_[_0x6211('0x33')](_0x21e5e2['model'],qs['fields'](_0x1901d7[_0x6211('0x30')][_0x6211('0x35')]));_0x588ab7[_0x6211('0x34')]=_0x588ab7['attributes'][_0x6211('0x36')]?_0x588ab7['attributes']:_0x21e5e2[_0x6211('0x2f')];_0x588ab7[_0x6211('0x38')]=qs['sort'](_0x1901d7['query'][_0x6211('0x39')]);_0x588ab7[_0x6211('0x3a')]=qs[_0x6211('0x32')](_[_0x6211('0x3b')](_0x1901d7[_0x6211('0x30')],_0x21e5e2['filters']));if(_0x1901d7[_0x6211('0x30')][_0x6211('0x3c')]){_0x588ab7['where']=_[_0x6211('0x3d')](_0x588ab7[_0x6211('0x3a')],{'$or':_[_0x6211('0x2c')](_0x588ab7[_0x6211('0x34')],function(_0x18f08a){var _0x509302={};_0x509302[_0x18f08a]={'$like':'%'+_0x1901d7[_0x6211('0x30')][_0x6211('0x3c')]+'%'};return _0x509302;})});}_0x588ab7=_[_0x6211('0x3d')]({},_0x588ab7,_0x1901d7[_0x6211('0x40')]);return _0x4a15b0['getConfigurations'](_0x588ab7);}})[_0x6211('0x26')](function(_0x5628ac){if(_0x5628ac){_0x4b1d8e=_0x5628ac[_0x6211('0x36')];if(!_0x1901d7[_0x6211('0x30')][_0x6211('0x4e')]('nolimit')){_0x588ab7[_0x6211('0x1e')]=qs['limit'](_0x1901d7[_0x6211('0x30')][_0x6211('0x1e')]);_0x588ab7['offset']=qs[_0x6211('0x1d')](_0x1901d7['query'][_0x6211('0x1d')]);}return _0x4a15b0[_0x6211('0x4b')](_0x588ab7);}})[_0x6211('0x26')](function(_0x10d8d1){if(_0x10d8d1){return _0x10d8d1?{'count':_0x4b1d8e,'rows':_0x10d8d1}:null;}})['then'](respondWithResult(_0x4d0acd,null))[_0x6211('0x45')](handleError(_0x4d0acd,null));};exports[_0x6211('0x4f')]=function(_0x2aec5d,_0x15cb0a,_0x5453fd){if(_0x2aec5d[_0x6211('0x49')]['id']){delete _0x2aec5d[_0x6211('0x49')]['id'];}return db['FreshdeskAccount'][_0x6211('0x4c')]({'where':{'id':_0x2aec5d[_0x6211('0x4a')]['id']}})[_0x6211('0x26')](handleEntityNotFound(_0x15cb0a,null))[_0x6211('0x26')](function(_0x191f84){if(_0x191f84){_0x2aec5d[_0x6211('0x49')][_0x6211('0x50')]=_0x191f84['id'];_0x2aec5d[_0x6211('0x49')]['Subjects']=integrations[_0x6211('0x51')](_0x2aec5d[_0x6211('0x49')][_0x6211('0x52')],_0x2aec5d[_0x6211('0x49')][_0x6211('0x3e')]);_0x2aec5d[_0x6211('0x49')][_0x6211('0x53')]=integrations[_0x6211('0x54')](_0x2aec5d[_0x6211('0x49')][_0x6211('0x52')],_0x2aec5d['body']['type']);return db['FreshdeskConfiguration'][_0x6211('0x48')](_0x2aec5d['body'],{'include':[{'model':db[_0x6211('0x55')],'as':'Subjects'},{'model':db[_0x6211('0x55')],'as':_0x6211('0x53')}]});}return null;})[_0x6211('0x26')](respondWithResult(_0x15cb0a,null))['catch'](handleError(_0x15cb0a,null));};exports[_0x6211('0x56')]=function(_0x361dd3,_0x1b6f09,_0xa90873){var _0x144620='';return db[_0x6211('0x41')]['findOne']({'where':{'id':_0x361dd3[_0x6211('0x4a')]['id']},'attributes':['id','remoteUri',_0x6211('0x57')]})['then'](handleEntityNotFound(_0x1b6f09,null))[_0x6211('0x26')](function(_0x370016){if(_0x370016){_0x144620=_0x370016[_0x6211('0x58')];var _0x58e51d=_0x144620[_0x6211('0x59')](-0x1);if(_0x58e51d==='/'){_0x144620=_0x144620[_0x6211('0x5a')](0x0,_0x144620[_0x6211('0x5b')](_0x58e51d));}return rp({'method':_0x6211('0x5c'),'uri':util[_0x6211('0x5d')](_0x6211('0x5e'),_0x144620,_0x6211('0x5f')),'headers':{'Authorization':util[_0x6211('0x5d')]('Basic\x20%s',new Buffer(util[_0x6211('0x5d')](_0x6211('0x60'),_0x370016['apiKey']))[_0x6211('0x61')](_0x6211('0x62')))},'json':!![]});}})[_0x6211('0x26')](function(_0x35e822){if(_0x35e822){var _0x40fad2=[_0x6211('0x63'),_0x6211('0x64'),_0x6211('0x65'),'description',_0x6211('0x1a'),_0x6211('0x66'),_0x6211('0x67'),'source','ticket_type',_0x6211('0x67'),_0x6211('0x68')];_[_0x6211('0x69')](_0x35e822,function(_0x4d7a5b){return _0x40fad2[_0x6211('0x6a')](_0x4d7a5b[_0x6211('0x29')])||!_0x4d7a5b[_0x6211('0x6b')]&&_0x4d7a5b[_0x6211('0x3e')]!==_0x6211('0x6c')&&_0x4d7a5b['type']!==_0x6211('0x6d');});return{'count':_0x35e822[_0x6211('0x36')],'rows':_['map'](_0x35e822,function(_0x2ad122){return{'id':_0x2ad122['name'],'name':_0x2ad122[_0x6211('0x6e')],'custom':!_0x2ad122['default'],'options':_0x2ad122[_0x6211('0x6f')]?_[_0x6211('0x2c')](_0x2ad122[_0x6211('0x6f')],function(_0xa5e9a){return{'name':_[_0x6211('0x70')](_0xa5e9a),'value':_0xa5e9a};}):[]};})};}})['then'](respondWithResult(_0x1b6f09,null))[_0x6211('0x45')](function(_0x12b48b){var _0x5526b5=_0x361dd3[_0x6211('0x30')][_0x6211('0x71')]?0x1f4:_0x12b48b[_0x6211('0x72')]||0x1f4;logger[_0x6211('0x27')](_0x6211('0x73'),_0x6211('0x56'),_0x5526b5,JSON[_0x6211('0x74')](_0x12b48b));delete _0x12b48b['name'];if(_0x5526b5===0x191){_0x5526b5=0x190;}_0x1b6f09[_0x6211('0x1a')](_0x5526b5)[_0x6211('0x2a')](_0x361dd3[_0x6211('0x30')][_0x6211('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x12b48b[_0x6211('0x72')]}:_0x12b48b);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index ef11a93..73d55d7 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 _0xd772=['FreshdeskAccount','lodash','moment','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x1e8f4c,_0x3ad664){var _0x2629fb=function(_0x4eaf6f){while(--_0x4eaf6f){_0x1e8f4c['push'](_0x1e8f4c['shift']());}};_0x2629fb(++_0x3ad664);}(_0xd772,0x177));var _0x2d77=function(_0x7bb2f7,_0x429f4d){_0x7bb2f7=_0x7bb2f7-0x0;var _0x5852a3=_0xd772[_0x7bb2f7];return _0x5852a3;};'use strict';var _=require(_0x2d77('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2d77('0x1'));var BPromise=require(_0x2d77('0x2'));var rp=require(_0x2d77('0x3'));var fs=require('fs');var path=require(_0x2d77('0x4'));var rimraf=require(_0x2d77('0x5'));var config=require('../../config/environment');var attributes=require(_0x2d77('0x6'));var integrations=require(_0x2d77('0x7'));module[_0x2d77('0x8')]=function(_0x3bbb3f,_0x9adb7){return _0x3bbb3f[_0x2d77('0x9')](_0x2d77('0xa'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd008=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x4074d5,_0xa57194){var _0x502cfe=function(_0x345efa){while(--_0x345efa){_0x4074d5['push'](_0x4074d5['shift']());}};_0x502cfe(++_0xa57194);}(_0xd008,0xfa));var _0x8d00=function(_0x126e0b,_0x45c0b3){_0x126e0b=_0x126e0b-0x0;var _0x9061c5=_0xd008[_0x126e0b];return _0x9061c5;};'use strict';var _=require(_0x8d00('0x0'));var util=require(_0x8d00('0x1'));var logger=require(_0x8d00('0x2'))(_0x8d00('0x3'));var moment=require('moment');var BPromise=require(_0x8d00('0x4'));var rp=require(_0x8d00('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d00('0x6'));var config=require(_0x8d00('0x7'));var attributes=require(_0x8d00('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8d00('0x9')]=function(_0x21ee15,_0x13405c){return _0x21ee15['define'](_0x8d00('0xa'),attributes,{'tableName':_0x8d00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index bd53c49..9dac6de 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 _0x28d1=['http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','include','map','model','attributes','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client'];(function(_0x452b3e,_0x173a18){var _0x3fe701=function(_0xf2995d){while(--_0xf2995d){_0x452b3e['push'](_0x452b3e['shift']());}};_0x3fe701(++_0x173a18);}(_0x28d1,0xbd));var _0x128d=function(_0x4dd499,_0x34dffd){_0x4dd499=_0x4dd499-0x0;var _0x1e21c4=_0x28d1[_0x4dd499];return _0x1e21c4;};'use strict';var _=require(_0x128d('0x0'));var util=require(_0x128d('0x1'));var moment=require(_0x128d('0x2'));var BPromise=require(_0x128d('0x3'));var rs=require(_0x128d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x128d('0x5'));var logger=require(_0x128d('0x6'))(_0x128d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x128d('0x8')][_0x128d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3913e7,_0x155c80,_0xf2e2b5){return new BPromise(function(_0x1645a3,_0x464c32){return client[_0x128d('0xa')](_0x3913e7,_0xf2e2b5)[_0x128d('0xb')](function(_0x552695){logger['info'](_0x128d('0xc'),_0x155c80,_0x128d('0xd'));logger[_0x128d('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x155c80,_0x128d('0xd'),JSON[_0x128d('0xf')](_0x552695));if(_0x552695['error']){if(_0x552695[_0x128d('0x10')]['code']===0x1f4){logger[_0x128d('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x155c80,_0x552695[_0x128d('0x10')][_0x128d('0x11')]);return _0x464c32(_0x552695[_0x128d('0x10')][_0x128d('0x11')]);}logger[_0x128d('0x10')](_0x128d('0xc'),_0x155c80,_0x552695[_0x128d('0x10')][_0x128d('0x11')]);return _0x1645a3(_0x552695[_0x128d('0x10')][_0x128d('0x11')]);}else{logger[_0x128d('0x12')](_0x128d('0xc'),_0x155c80,'request\x20sent');_0x1645a3(_0x552695[_0x128d('0x13')][_0x128d('0x11')]);}})[_0x128d('0x14')](function(_0x4339df){logger[_0x128d('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x155c80,_0x4339df);_0x464c32(_0x4339df);});});}exports[_0x128d('0x15')]=function(_0x5ef6c7){var _0x2c1408=this;return new Promise(function(_0x324a92,_0x367b51){return db[_0x128d('0x16')][_0x128d('0x17')]({'raw':_0x5ef6c7[_0x128d('0x18')]?_0x5ef6c7[_0x128d('0x18')][_0x128d('0x19')]===undefined?!![]:![]:!![],'where':_0x5ef6c7[_0x128d('0x18')]?_0x5ef6c7['options'][_0x128d('0x1a')]||null:null,'attributes':_0x5ef6c7[_0x128d('0x18')]?_0x5ef6c7[_0x128d('0x18')]['attributes']||null:null,'limit':_0x5ef6c7[_0x128d('0x18')]?_0x5ef6c7['options']['limit']||null:null,'include':_0x5ef6c7[_0x128d('0x18')]?_0x5ef6c7[_0x128d('0x18')][_0x128d('0x1b')]?_[_0x128d('0x1c')](_0x5ef6c7['options']['include'],function(_0x271602){return{'model':db[_0x271602[_0x128d('0x1d')]],'as':_0x271602['as'],'attributes':_0x271602[_0x128d('0x1e')],'include':_0x271602['include']?_['map'](_0x271602[_0x128d('0x1b')],function(_0x11bd8f){return{'model':db[_0x11bd8f['model']],'as':_0x11bd8f['as'],'attributes':_0x11bd8f[_0x128d('0x1e')],'include':_0x11bd8f[_0x128d('0x1b')]?_[_0x128d('0x1c')](_0x11bd8f[_0x128d('0x1b')],function(_0x415895){return{'model':db[_0x415895[_0x128d('0x1d')]],'as':_0x415895['as'],'attributes':_0x415895[_0x128d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x128d('0xb')](function(_0x44932f){logger[_0x128d('0x12')]('GetFreshdeskAccount',_0x5ef6c7);logger[_0x128d('0xe')](_0x128d('0x15'),_0x5ef6c7,JSON[_0x128d('0xf')](_0x44932f));_0x324a92(_0x44932f);})[_0x128d('0x14')](function(_0x3a37dc){logger[_0x128d('0x10')](_0x128d('0x15'),_0x3a37dc[_0x128d('0x11')],_0x5ef6c7);_0x367b51(_0x2c1408[_0x128d('0x10')](0x1f4,_0x3a37dc[_0x128d('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x45e32a){var _0x358bfb=this;return new Promise(function(_0x2ac12a,_0x1a61a7){return db[_0x128d('0x16')][_0x128d('0x1f')]({'raw':_0x45e32a[_0x128d('0x18')]?_0x45e32a['options'][_0x128d('0x19')]===undefined?!![]:![]:!![],'where':_0x45e32a['options']?_0x45e32a[_0x128d('0x18')][_0x128d('0x1a')]||null:null,'attributes':_0x45e32a['options']?_0x45e32a[_0x128d('0x18')][_0x128d('0x1e')]||null:null,'include':_0x45e32a['options']?_0x45e32a[_0x128d('0x18')][_0x128d('0x1b')]?_[_0x128d('0x1c')](_0x45e32a[_0x128d('0x18')][_0x128d('0x1b')],function(_0x3e8266){return{'model':db[_0x3e8266[_0x128d('0x1d')]],'as':_0x3e8266['as'],'attributes':_0x3e8266[_0x128d('0x1e')],'include':_0x3e8266[_0x128d('0x1b')]?_[_0x128d('0x1c')](_0x3e8266['include'],function(_0x2f5bf2){return{'model':db[_0x2f5bf2[_0x128d('0x1d')]],'as':_0x2f5bf2['as'],'attributes':_0x2f5bf2[_0x128d('0x1e')],'include':_0x2f5bf2[_0x128d('0x1b')]?_[_0x128d('0x1c')](_0x2f5bf2['include'],function(_0x1c4026){return{'model':db[_0x1c4026[_0x128d('0x1d')]],'as':_0x1c4026['as'],'attributes':_0x1c4026[_0x128d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b07f){logger['info']('ShowFreshdeskAccount',_0x45e32a);logger[_0x128d('0xe')](_0x128d('0x20'),_0x45e32a,JSON[_0x128d('0xf')](_0x59b07f));_0x2ac12a(_0x59b07f);})[_0x128d('0x14')](function(_0x305af7){logger[_0x128d('0x10')]('ShowFreshdeskAccount',_0x305af7['message'],_0x45e32a);_0x1a61a7(_0x358bfb[_0x128d('0x10')](0x1f4,_0x305af7[_0x128d('0x11')]));});});}; \ No newline at end of file +var _0xc900=['debug','request\x20sent','stringify','error','code','message','result','GetFreshdeskAccount','findAll','options','raw','attributes','include','map','model','catch','ShowFreshdeskAccount','FreshdeskAccount','where','lodash','util','bluebird','ioredis','../../config/utils','rpc','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x1a6b49,_0x50ea79){var _0xf3badf=function(_0x5409f9){while(--_0x5409f9){_0x1a6b49['push'](_0x1a6b49['shift']());}};_0xf3badf(++_0x50ea79);}(_0xc900,0xc7));var _0x0c90=function(_0x228dff,_0x4d988d){_0x228dff=_0x228dff-0x0;var _0x55fde2=_0xc900[_0x228dff];return _0x55fde2;};'use strict';var _=require(_0x0c90('0x0'));var util=require(_0x0c90('0x1'));var moment=require('moment');var BPromise=require(_0x0c90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c90('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c90('0x4'));var logger=require('../../config/logger')(_0x0c90('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0c90('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x34b482,_0x3bf50c,_0x9d243e){return new BPromise(function(_0x5a43df,_0x12e6e0){return client[_0x0c90('0x7')](_0x34b482,_0x9d243e)[_0x0c90('0x8')](function(_0x406d55){logger[_0x0c90('0x9')](_0x0c90('0xa'),_0x3bf50c,'request\x20sent');logger[_0x0c90('0xb')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3bf50c,_0x0c90('0xc'),JSON[_0x0c90('0xd')](_0x406d55));if(_0x406d55[_0x0c90('0xe')]){if(_0x406d55[_0x0c90('0xe')][_0x0c90('0xf')]===0x1f4){logger[_0x0c90('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x3bf50c,_0x406d55[_0x0c90('0xe')][_0x0c90('0x10')]);return _0x12e6e0(_0x406d55[_0x0c90('0xe')]['message']);}logger[_0x0c90('0xe')](_0x0c90('0xa'),_0x3bf50c,_0x406d55[_0x0c90('0xe')]['message']);return _0x5a43df(_0x406d55[_0x0c90('0xe')][_0x0c90('0x10')]);}else{logger[_0x0c90('0x9')](_0x0c90('0xa'),_0x3bf50c,_0x0c90('0xc'));_0x5a43df(_0x406d55[_0x0c90('0x11')][_0x0c90('0x10')]);}})['catch'](function(_0x3bf2a1){logger[_0x0c90('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x3bf50c,_0x3bf2a1);_0x12e6e0(_0x3bf2a1);});});}exports[_0x0c90('0x12')]=function(_0x4e3a61){var _0x4b9383=this;return new Promise(function(_0x4a077c,_0x4596db){return db['FreshdeskAccount'][_0x0c90('0x13')]({'raw':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61[_0x0c90('0x14')][_0x0c90('0x15')]===undefined?!![]:![]:!![],'where':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61[_0x0c90('0x14')]['where']||null:null,'attributes':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61['options'][_0x0c90('0x16')]||null:null,'limit':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61[_0x0c90('0x14')]['limit']||null:null,'include':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61[_0x0c90('0x14')][_0x0c90('0x17')]?_[_0x0c90('0x18')](_0x4e3a61[_0x0c90('0x14')]['include'],function(_0x21fba6){return{'model':db[_0x21fba6['model']],'as':_0x21fba6['as'],'attributes':_0x21fba6[_0x0c90('0x16')],'include':_0x21fba6['include']?_[_0x0c90('0x18')](_0x21fba6[_0x0c90('0x17')],function(_0xae29b9){return{'model':db[_0xae29b9[_0x0c90('0x19')]],'as':_0xae29b9['as'],'attributes':_0xae29b9[_0x0c90('0x16')],'include':_0xae29b9['include']?_[_0x0c90('0x18')](_0xae29b9[_0x0c90('0x17')],function(_0x121d3a){return{'model':db[_0x121d3a[_0x0c90('0x19')]],'as':_0x121d3a['as'],'attributes':_0x121d3a[_0x0c90('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0c90('0x8')](function(_0xfbed99){logger[_0x0c90('0x9')](_0x0c90('0x12'),_0x4e3a61);logger[_0x0c90('0xb')](_0x0c90('0x12'),_0x4e3a61,JSON[_0x0c90('0xd')](_0xfbed99));_0x4a077c(_0xfbed99);})[_0x0c90('0x1a')](function(_0x49ae1a){logger[_0x0c90('0xe')](_0x0c90('0x12'),_0x49ae1a[_0x0c90('0x10')],_0x4e3a61);_0x4596db(_0x4b9383[_0x0c90('0xe')](0x1f4,_0x49ae1a[_0x0c90('0x10')]));});});};exports[_0x0c90('0x1b')]=function(_0x3f88b1){var _0x16980a=this;return new Promise(function(_0x40304e,_0x27f3b3){return db[_0x0c90('0x1c')]['find']({'raw':_0x3f88b1['options']?_0x3f88b1[_0x0c90('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3f88b1[_0x0c90('0x14')]?_0x3f88b1[_0x0c90('0x14')][_0x0c90('0x1d')]||null:null,'attributes':_0x3f88b1['options']?_0x3f88b1[_0x0c90('0x14')][_0x0c90('0x16')]||null:null,'include':_0x3f88b1[_0x0c90('0x14')]?_0x3f88b1[_0x0c90('0x14')][_0x0c90('0x17')]?_[_0x0c90('0x18')](_0x3f88b1[_0x0c90('0x14')][_0x0c90('0x17')],function(_0x53873b){return{'model':db[_0x53873b[_0x0c90('0x19')]],'as':_0x53873b['as'],'attributes':_0x53873b[_0x0c90('0x16')],'include':_0x53873b[_0x0c90('0x17')]?_[_0x0c90('0x18')](_0x53873b[_0x0c90('0x17')],function(_0x30c48f){return{'model':db[_0x30c48f[_0x0c90('0x19')]],'as':_0x30c48f['as'],'attributes':_0x30c48f[_0x0c90('0x16')],'include':_0x30c48f[_0x0c90('0x17')]?_[_0x0c90('0x18')](_0x30c48f['include'],function(_0x390e55){return{'model':db[_0x390e55[_0x0c90('0x19')]],'as':_0x390e55['as'],'attributes':_0x390e55[_0x0c90('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe2a8f8){logger[_0x0c90('0x9')](_0x0c90('0x1b'),_0x3f88b1);logger[_0x0c90('0xb')]('ShowFreshdeskAccount',_0x3f88b1,JSON[_0x0c90('0xd')](_0xe2a8f8));_0x40304e(_0xe2a8f8);})[_0x0c90('0x1a')](function(_0x5213af){logger[_0x0c90('0xe')](_0x0c90('0x1b'),_0x5213af[_0x0c90('0x10')],_0x3f88b1);_0x27f3b3(_0x16980a[_0x0c90('0xe')](0x1f4,_0x5213af[_0x0c90('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index db825a2..a7bd013 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 _0xacff=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','/:id','update','delete','destroy'];(function(_0x5b0d75,_0x3cb27c){var _0x6671b0=function(_0x532ab0){while(--_0x532ab0){_0x5b0d75['push'](_0x5b0d75['shift']());}};_0x6671b0(++_0x3cb27c);}(_0xacff,0x123));var _0xfacf=function(_0x42e300,_0x1db311){_0x42e300=_0x42e300-0x0;var _0x58daa2=_0xacff[_0x42e300];return _0x58daa2;};'use strict';var multer=require('multer');var util=require(_0xfacf('0x0'));var path=require(_0xfacf('0x1'));var timeout=require(_0xfacf('0x2'));var express=require(_0xfacf('0x3'));var router=express[_0xfacf('0x4')]();var fs_extra=require(_0xfacf('0x5'));var auth=require(_0xfacf('0x6'));var interaction=require(_0xfacf('0x7'));var config=require('../../config/environment');var controller=require(_0xfacf('0x8'));router[_0xfacf('0x9')]('/',auth[_0xfacf('0xa')](),controller[_0xfacf('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xfacf('0xc')]);router[_0xfacf('0x9')](_0xfacf('0xd'),auth[_0xfacf('0xa')](),controller['getFields']);router[_0xfacf('0x9')](_0xfacf('0xe'),auth[_0xfacf('0xa')](),controller[_0xfacf('0xf')]);router[_0xfacf('0x9')](_0xfacf('0x10'),auth['isAuthenticated'](),controller[_0xfacf('0x11')]);router[_0xfacf('0x9')](_0xfacf('0x12'),auth[_0xfacf('0xa')](),controller[_0xfacf('0x13')]);router['post']('/',auth[_0xfacf('0xa')](),controller[_0xfacf('0x14')]);router[_0xfacf('0x15')](_0xfacf('0x12'),auth[_0xfacf('0xa')](),controller[_0xfacf('0x16')]);router[_0xfacf('0x17')](_0xfacf('0x18'),auth[_0xfacf('0xa')](),controller[_0xfacf('0x19')]);router[_0xfacf('0x1a')](_0xfacf('0x18'),auth[_0xfacf('0xa')](),controller[_0xfacf('0x1b')]);module[_0xfacf('0x1c')]=router; \ No newline at end of file +var _0x673d=['../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0x673d,0x130));var _0xd673=function(_0x5bc6c7,_0x1cfb29){_0x5bc6c7=_0x5bc6c7-0x0;var _0x17aec5=_0x673d[_0x5bc6c7];return _0x17aec5;};'use strict';var multer=require(_0xd673('0x0'));var util=require(_0xd673('0x1'));var path=require(_0xd673('0x2'));var timeout=require('connect-timeout');var express=require(_0xd673('0x3'));var router=express[_0xd673('0x4')]();var fs_extra=require(_0xd673('0x5'));var auth=require(_0xd673('0x6'));var interaction=require(_0xd673('0x7'));var config=require(_0xd673('0x8'));var controller=require(_0xd673('0x9'));router[_0xd673('0xa')]('/',auth[_0xd673('0xb')](),controller[_0xd673('0xc')]);router[_0xd673('0xa')]('/:id',auth[_0xd673('0xb')](),controller['show']);router['get'](_0xd673('0xd'),auth[_0xd673('0xb')](),controller['getFields']);router['get'](_0xd673('0xe'),auth[_0xd673('0xb')](),controller['getSubjects']);router[_0xd673('0xa')](_0xd673('0xf'),auth[_0xd673('0xb')](),controller[_0xd673('0x10')]);router['get']('/:id/tags',auth[_0xd673('0xb')](),controller[_0xd673('0x11')]);router[_0xd673('0x12')]('/',auth[_0xd673('0xb')](),controller[_0xd673('0x13')]);router['post'](_0xd673('0x14'),auth[_0xd673('0xb')](),controller['setTags']);router[_0xd673('0x15')](_0xd673('0x16'),auth['isAuthenticated'](),controller[_0xd673('0x17')]);router[_0xd673('0x18')](_0xd673('0x16'),auth[_0xd673('0xb')](),controller['destroy']);module[_0xd673('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 fc7c945..2c5d333 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 _0x0224=['exports','STRING','sequelize'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x0224,0x17c));var _0x4022=function(_0x2cbfe5,_0x1fb99b){_0x2cbfe5=_0x2cbfe5-0x0;var _0x3f69ad=_0x0224[_0x2cbfe5];return _0x3f69ad;};'use strict';var Sequelize=require(_0x4022('0x0'));module[_0x4022('0x1')]={'name':{'type':Sequelize[_0x4022('0x2')]},'description':{'type':Sequelize[_0x4022('0x2')]}}; \ No newline at end of file +var _0x5984=['exports','STRING','sequelize'];(function(_0x4b558b,_0x2d22c6){var _0x1b96f1=function(_0x3e3922){while(--_0x3e3922){_0x4b558b['push'](_0x4b558b['shift']());}};_0x1b96f1(++_0x2d22c6);}(_0x5984,0x1a0));var _0x4598=function(_0x4583c7,_0x480906){_0x4583c7=_0x4583c7-0x0;var _0x2d4016=_0x5984[_0x4583c7];return _0x2d4016;};'use strict';var Sequelize=require(_0x4598('0x0'));module[_0x4598('0x1')]={'name':{'type':Sequelize[_0x4598('0x2')]},'description':{'type':Sequelize[_0x4598('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 802264c..bc2061c 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 _0xa1bf=['name','send','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','getTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x1f78a4,_0x1ede5e){var _0x5a1666=function(_0x5061ad){while(--_0x5061ad){_0x1f78a4['push'](_0x1f78a4['shift']());}};_0x5a1666(++_0x1ede5e);}(_0xa1bf,0xda));var _0xfa1b=function(_0x29147f,_0x22e5c9){_0x29147f=_0x29147f-0x0;var _0x4f4a61=_0xa1bf[_0x29147f];return _0x4f4a61;};'use strict';var emlformat=require(_0xfa1b('0x0'));var rimraf=require(_0xfa1b('0x1'));var zipdir=require(_0xfa1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa1b('0x3'));var moment=require(_0xfa1b('0x4'));var BPromise=require(_0xfa1b('0x5'));var Mustache=require(_0xfa1b('0x6'));var util=require(_0xfa1b('0x7'));var path=require(_0xfa1b('0x8'));var sox=require(_0xfa1b('0x9'));var csv=require(_0xfa1b('0xa'));var ejs=require(_0xfa1b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfa1b('0xc'));var crypto=require(_0xfa1b('0xd'));var jsforce=require(_0xfa1b('0xe'));var deskjs=require(_0xfa1b('0xf'));var toCsv=require(_0xfa1b('0xa'));var querystring=require(_0xfa1b('0x10'));var Papa=require(_0xfa1b('0x11'));var Redis=require(_0xfa1b('0x12'));var authService=require(_0xfa1b('0x13'));var qs=require(_0xfa1b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa1b('0x15'));var logger=require(_0xfa1b('0x16'))(_0xfa1b('0x17'));var utils=require(_0xfa1b('0x18'));var config=require(_0xfa1b('0x19'));var licenseUtil=require(_0xfa1b('0x1a'));var db=require(_0xfa1b('0x1b'))['db'];function respondWithStatusCode(_0x5f1353,_0x20b7b9){_0x20b7b9=_0x20b7b9||0xcc;return function(_0x420aff){if(_0x420aff){return _0x5f1353[_0xfa1b('0x1c')](_0x20b7b9);}return _0x5f1353['status'](_0x20b7b9)[_0xfa1b('0x1d')]();};}function respondWithResult(_0x4f7cf3,_0x173bdb){_0x173bdb=_0x173bdb||0xc8;return function(_0x1d1e70){if(_0x1d1e70){return _0x4f7cf3[_0xfa1b('0x1e')](_0x173bdb)[_0xfa1b('0x1f')](_0x1d1e70);}};}function respondWithFilteredResult(_0x3a1db0,_0x477e2c){return function(_0xae5e8e){if(_0xae5e8e){var _0x15d45e=typeof _0x477e2c[_0xfa1b('0x20')]==='undefined'&&typeof _0x477e2c['limit']===_0xfa1b('0x21');var _0x20e2f3=_0xae5e8e[_0xfa1b('0x22')];var _0x345013=_0x15d45e?0x0:_0x477e2c[_0xfa1b('0x20')];var _0x331968=_0x15d45e?_0xae5e8e[_0xfa1b('0x22')]:_0x477e2c[_0xfa1b('0x20')]+_0x477e2c[_0xfa1b('0x23')];var _0x11416b;if(_0x331968>=_0x20e2f3){_0x331968=_0x20e2f3;_0x11416b=0xc8;}else{_0x11416b=0xce;}_0x3a1db0['status'](_0x11416b);return _0x3a1db0[_0xfa1b('0x24')](_0xfa1b('0x25'),_0x345013+'-'+_0x331968+'/'+_0x20e2f3)[_0xfa1b('0x1f')](_0xae5e8e);}return null;};}function patchUpdates(_0x41cf6d){return function(_0x3e2018){try{jsonpatch[_0xfa1b('0x26')](_0x3e2018,_0x41cf6d,!![]);}catch(_0x1b24af){return BPromise[_0xfa1b('0x27')](_0x1b24af);}return _0x3e2018[_0xfa1b('0x28')]();};}function saveUpdates(_0x35fc18,_0x26a1e8){return function(_0x265747){if(_0x265747){return _0x265747[_0xfa1b('0x29')](_0x35fc18)[_0xfa1b('0x2a')](function(_0x9468b4){return _0x9468b4;});}return null;};}function removeEntity(_0x3049b6,_0x404bce){return function(_0x10805e){if(_0x10805e){return _0x10805e[_0xfa1b('0x2b')]()['then'](function(){_0x3049b6[_0xfa1b('0x1e')](0xcc)[_0xfa1b('0x1d')]();});}};}function handleEntityNotFound(_0x551474,_0x15ce71){return function(_0x362e78){if(!_0x362e78){_0x551474[_0xfa1b('0x1c')](0x194);}return _0x362e78;};}function handleError(_0x40c5b7,_0xdfa07a){_0xdfa07a=_0xdfa07a||0x1f4;return function(_0x1ababe){logger[_0xfa1b('0x2c')](_0x1ababe[_0xfa1b('0x2d')]);if(_0x1ababe['name']){delete _0x1ababe[_0xfa1b('0x2e')];}_0x40c5b7[_0xfa1b('0x1e')](_0xdfa07a)[_0xfa1b('0x2f')](_0x1ababe);};}exports['index']=function(_0x54b4b7,_0x568dd6){var _0x11200e={},_0x1dc744={},_0x1d250f={'count':0x0,'rows':[]};var _0x43c17f=_['map'](db[_0xfa1b('0x30')][_0xfa1b('0x31')],function(_0x3d62bb){return{'name':_0x3d62bb[_0xfa1b('0x32')],'type':_0x3d62bb[_0xfa1b('0x33')][_0xfa1b('0x34')]};});_0x1dc744[_0xfa1b('0x35')]=_['map'](_0x43c17f,_0xfa1b('0x2e'));_0x1dc744[_0xfa1b('0x36')]=_[_0xfa1b('0x37')](_0x54b4b7['query']);_0x1dc744[_0xfa1b('0x38')]=_[_0xfa1b('0x39')](_0x1dc744['model'],_0x1dc744[_0xfa1b('0x36')]);_0x11200e['attributes']=_[_0xfa1b('0x39')](_0x1dc744[_0xfa1b('0x35')],qs[_0xfa1b('0x3a')](_0x54b4b7[_0xfa1b('0x36')]['fields']));_0x11200e[_0xfa1b('0x3b')]=_0x11200e[_0xfa1b('0x3b')][_0xfa1b('0x3c')]?_0x11200e[_0xfa1b('0x3b')]:_0x1dc744['model'];if(!_0x54b4b7[_0xfa1b('0x36')][_0xfa1b('0x3d')](_0xfa1b('0x3e'))){_0x11200e[_0xfa1b('0x23')]=qs[_0xfa1b('0x23')](_0x54b4b7[_0xfa1b('0x36')][_0xfa1b('0x23')]);_0x11200e['offset']=qs[_0xfa1b('0x20')](_0x54b4b7[_0xfa1b('0x36')]['offset']);}_0x11200e[_0xfa1b('0x3f')]=qs[_0xfa1b('0x40')](_0x54b4b7[_0xfa1b('0x36')][_0xfa1b('0x40')]);_0x11200e[_0xfa1b('0x41')]=qs['filters'](_['pick'](_0x54b4b7['query'],_0x1dc744['filters']),_0x43c17f);if(_0x54b4b7[_0xfa1b('0x36')][_0xfa1b('0x42')]){_0x11200e[_0xfa1b('0x41')]=_[_0xfa1b('0x43')](_0x11200e[_0xfa1b('0x41')],{'$or':_[_0xfa1b('0x44')](_0x43c17f,function(_0x88389a){if(_0x88389a[_0xfa1b('0x33')]!==_0xfa1b('0x45')){var _0x2c3f5d={};_0x2c3f5d[_0x88389a['name']]={'$like':'%'+_0x54b4b7['query'][_0xfa1b('0x42')]+'%'};return _0x2c3f5d;}})});}_0x11200e=_[_0xfa1b('0x43')]({},_0x11200e,_0x54b4b7[_0xfa1b('0x46')]);var _0x3a8a9a={'where':_0x11200e[_0xfa1b('0x41')]};return db[_0xfa1b('0x30')][_0xfa1b('0x22')](_0x3a8a9a)[_0xfa1b('0x2a')](function(_0x495b16){_0x1d250f[_0xfa1b('0x22')]=_0x495b16;if(_0x54b4b7[_0xfa1b('0x36')][_0xfa1b('0x47')]){_0x11200e['include']=[{'all':!![]}];}return db[_0xfa1b('0x30')]['findAll'](_0x11200e);})[_0xfa1b('0x2a')](function(_0x599c6d){_0x1d250f[_0xfa1b('0x48')]=_0x599c6d;return _0x1d250f;})[_0xfa1b('0x2a')](respondWithFilteredResult(_0x568dd6,_0x11200e))[_0xfa1b('0x49')](handleError(_0x568dd6,null));};exports[_0xfa1b('0x4a')]=function(_0x3f4c95,_0x59d00f){var _0x42d06d={'raw':![],'where':{'id':_0x3f4c95[_0xfa1b('0x4b')]['id']}},_0x47ced1={};_0x47ced1['model']=_[_0xfa1b('0x37')](db[_0xfa1b('0x30')][_0xfa1b('0x31')]);_0x47ced1[_0xfa1b('0x36')]=_['keys'](_0x3f4c95['query']);_0x47ced1[_0xfa1b('0x38')]=_[_0xfa1b('0x39')](_0x47ced1['model'],_0x47ced1[_0xfa1b('0x36')]);_0x42d06d[_0xfa1b('0x3b')]=_[_0xfa1b('0x39')](_0x47ced1[_0xfa1b('0x35')],qs[_0xfa1b('0x3a')](_0x3f4c95[_0xfa1b('0x36')][_0xfa1b('0x3a')]));_0x42d06d[_0xfa1b('0x3b')]=_0x42d06d[_0xfa1b('0x3b')][_0xfa1b('0x3c')]?_0x42d06d[_0xfa1b('0x3b')]:_0x47ced1[_0xfa1b('0x35')];if(_0x3f4c95['query'][_0xfa1b('0x47')]){_0x42d06d[_0xfa1b('0x4c')]=[{'all':!![]}];}_0x42d06d=_[_0xfa1b('0x43')]({},_0x42d06d,_0x3f4c95[_0xfa1b('0x46')]);return db['FreshdeskConfiguration'][_0xfa1b('0x4d')](_0x42d06d)['then'](handleEntityNotFound(_0x59d00f,null))[_0xfa1b('0x2a')](respondWithResult(_0x59d00f,null))[_0xfa1b('0x49')](handleError(_0x59d00f,null));};exports['create']=function(_0x3073a5,_0x496060){return db[_0xfa1b('0x30')][_0xfa1b('0x4e')](_0x3073a5['body'],{})[_0xfa1b('0x2a')](respondWithResult(_0x496060,0xc9))[_0xfa1b('0x49')](handleError(_0x496060,null));};exports[_0xfa1b('0x29')]=function(_0x56b987,_0xc88eac){if(_0x56b987[_0xfa1b('0x4f')]['id']){delete _0x56b987[_0xfa1b('0x4f')]['id'];}return db[_0xfa1b('0x30')][_0xfa1b('0x4d')]({'where':{'id':_0x56b987[_0xfa1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0xc88eac,null))[_0xfa1b('0x2a')](saveUpdates(_0x56b987[_0xfa1b('0x4f')],null))[_0xfa1b('0x2a')](respondWithResult(_0xc88eac,null))[_0xfa1b('0x49')](handleError(_0xc88eac,null));};exports[_0xfa1b('0x2b')]=function(_0x24241e,_0xca8cce){return db[_0xfa1b('0x30')][_0xfa1b('0x4d')]({'where':{'id':_0x24241e[_0xfa1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0xca8cce,null))['then'](removeEntity(_0xca8cce,null))[_0xfa1b('0x49')](handleError(_0xca8cce,null));};exports[_0xfa1b('0x50')]=function(_0x57f13f,_0xc636cb,_0x314100){var _0x5228b2={};var _0x3afbd1={};var _0x112f91;var _0x23703b;return db[_0xfa1b('0x30')][_0xfa1b('0x51')]({'where':{'id':_0x57f13f[_0xfa1b('0x4b')]['id']}})[_0xfa1b('0x2a')](handleEntityNotFound(_0xc636cb,null))[_0xfa1b('0x2a')](function(_0x49cc4f){if(_0x49cc4f){_0x112f91=_0x49cc4f;_0x3afbd1[_0xfa1b('0x35')]=_[_0xfa1b('0x37')](db[_0xfa1b('0x52')][_0xfa1b('0x31')]);_0x3afbd1[_0xfa1b('0x36')]=_[_0xfa1b('0x37')](_0x57f13f[_0xfa1b('0x36')]);_0x3afbd1['filters']=_[_0xfa1b('0x39')](_0x3afbd1[_0xfa1b('0x35')],_0x3afbd1[_0xfa1b('0x36')]);_0x5228b2[_0xfa1b('0x3b')]=_[_0xfa1b('0x39')](_0x3afbd1[_0xfa1b('0x35')],qs[_0xfa1b('0x3a')](_0x57f13f[_0xfa1b('0x36')][_0xfa1b('0x3a')]));_0x5228b2['attributes']=_0x5228b2['attributes'][_0xfa1b('0x3c')]?_0x5228b2[_0xfa1b('0x3b')]:_0x3afbd1[_0xfa1b('0x35')];_0x5228b2[_0xfa1b('0x3f')]=qs[_0xfa1b('0x40')](_0x57f13f[_0xfa1b('0x36')]['sort']);_0x5228b2[_0xfa1b('0x41')]=qs[_0xfa1b('0x38')](_[_0xfa1b('0x53')](_0x57f13f[_0xfa1b('0x36')],_0x3afbd1['filters']));if(_0x57f13f[_0xfa1b('0x36')][_0xfa1b('0x42')]){_0x5228b2[_0xfa1b('0x41')]=_[_0xfa1b('0x43')](_0x5228b2[_0xfa1b('0x41')],{'$or':_[_0xfa1b('0x44')](_0x5228b2[_0xfa1b('0x3b')],function(_0x37294a){var _0x98bc2b={};_0x98bc2b[_0x37294a]={'$like':'%'+_0x57f13f[_0xfa1b('0x36')][_0xfa1b('0x42')]+'%'};return _0x98bc2b;})});}_0x5228b2=_[_0xfa1b('0x43')]({},_0x5228b2,_0x57f13f[_0xfa1b('0x46')]);return _0x112f91['getFields'](_0x5228b2);}})[_0xfa1b('0x2a')](function(_0x32fd73){if(_0x32fd73){_0x23703b=_0x32fd73[_0xfa1b('0x3c')];if(!_0x57f13f[_0xfa1b('0x36')][_0xfa1b('0x3d')]('nolimit')){_0x5228b2[_0xfa1b('0x23')]=qs[_0xfa1b('0x23')](_0x57f13f['query'][_0xfa1b('0x23')]);_0x5228b2['offset']=qs[_0xfa1b('0x20')](_0x57f13f[_0xfa1b('0x36')]['offset']);}return _0x112f91[_0xfa1b('0x50')](_0x5228b2);}})[_0xfa1b('0x2a')](function(_0x164578){if(_0x164578){return _0x164578?{'count':_0x23703b,'rows':_0x164578}:null;}})[_0xfa1b('0x2a')](respondWithResult(_0xc636cb,null))[_0xfa1b('0x49')](handleError(_0xc636cb,null));};exports[_0xfa1b('0x54')]=function(_0x427885,_0x2dab35,_0x5ac80d){var _0x240744={};var _0x17c087={};var _0x3c0b16;var _0x543643;return db['FreshdeskConfiguration'][_0xfa1b('0x51')]({'where':{'id':_0x427885[_0xfa1b('0x4b')]['id']}})[_0xfa1b('0x2a')](handleEntityNotFound(_0x2dab35,null))[_0xfa1b('0x2a')](function(_0x5460b1){if(_0x5460b1){_0x3c0b16=_0x5460b1;_0x17c087['model']=_[_0xfa1b('0x37')](db['FreshdeskField'][_0xfa1b('0x31')]);_0x17c087[_0xfa1b('0x36')]=_['keys'](_0x427885[_0xfa1b('0x36')]);_0x17c087[_0xfa1b('0x38')]=_[_0xfa1b('0x39')](_0x17c087[_0xfa1b('0x35')],_0x17c087[_0xfa1b('0x36')]);_0x240744[_0xfa1b('0x3b')]=_[_0xfa1b('0x39')](_0x17c087[_0xfa1b('0x35')],qs[_0xfa1b('0x3a')](_0x427885[_0xfa1b('0x36')]['fields']));_0x240744['attributes']=_0x240744['attributes']['length']?_0x240744[_0xfa1b('0x3b')]:_0x17c087[_0xfa1b('0x35')];_0x240744[_0xfa1b('0x3f')]=qs['sort'](_0x427885['query'][_0xfa1b('0x40')]);_0x240744['where']=qs['filters'](_['pick'](_0x427885[_0xfa1b('0x36')],_0x17c087[_0xfa1b('0x38')]));if(_0x427885[_0xfa1b('0x36')][_0xfa1b('0x42')]){_0x240744[_0xfa1b('0x41')]=_[_0xfa1b('0x43')](_0x240744[_0xfa1b('0x41')],{'$or':_[_0xfa1b('0x44')](_0x240744['attributes'],function(_0x482cae){var _0x4d33a1={};_0x4d33a1[_0x482cae]={'$like':'%'+_0x427885[_0xfa1b('0x36')]['filter']+'%'};return _0x4d33a1;})});}_0x240744=_['merge']({},_0x240744,_0x427885['options']);return _0x3c0b16[_0xfa1b('0x54')](_0x240744);}})[_0xfa1b('0x2a')](function(_0x9db83c){if(_0x9db83c){_0x543643=_0x9db83c[_0xfa1b('0x3c')];if(!_0x427885[_0xfa1b('0x36')]['hasOwnProperty'](_0xfa1b('0x3e'))){_0x240744[_0xfa1b('0x23')]=qs[_0xfa1b('0x23')](_0x427885[_0xfa1b('0x36')][_0xfa1b('0x23')]);_0x240744[_0xfa1b('0x20')]=qs[_0xfa1b('0x20')](_0x427885[_0xfa1b('0x36')]['offset']);}return _0x3c0b16[_0xfa1b('0x54')](_0x240744);}})[_0xfa1b('0x2a')](function(_0x2438ad){if(_0x2438ad){return _0x2438ad?{'count':_0x543643,'rows':_0x2438ad}:null;}})[_0xfa1b('0x2a')](respondWithResult(_0x2dab35,null))[_0xfa1b('0x49')](handleError(_0x2dab35,null));};exports['getDescriptions']=function(_0x22254a,_0x1c405c,_0x4d69f8){var _0x38228c={};var _0xbcc037={};var _0x566adb;var _0x4c303a;return db[_0xfa1b('0x30')][_0xfa1b('0x51')]({'where':{'id':_0x22254a['params']['id']}})['then'](handleEntityNotFound(_0x1c405c,null))[_0xfa1b('0x2a')](function(_0x4da075){if(_0x4da075){_0x566adb=_0x4da075;_0xbcc037[_0xfa1b('0x35')]=_['keys'](db[_0xfa1b('0x52')]['rawAttributes']);_0xbcc037[_0xfa1b('0x36')]=_[_0xfa1b('0x37')](_0x22254a[_0xfa1b('0x36')]);_0xbcc037[_0xfa1b('0x38')]=_[_0xfa1b('0x39')](_0xbcc037['model'],_0xbcc037[_0xfa1b('0x36')]);_0x38228c[_0xfa1b('0x3b')]=_[_0xfa1b('0x39')](_0xbcc037['model'],qs[_0xfa1b('0x3a')](_0x22254a[_0xfa1b('0x36')][_0xfa1b('0x3a')]));_0x38228c[_0xfa1b('0x3b')]=_0x38228c[_0xfa1b('0x3b')][_0xfa1b('0x3c')]?_0x38228c[_0xfa1b('0x3b')]:_0xbcc037['model'];_0x38228c[_0xfa1b('0x3f')]=qs[_0xfa1b('0x40')](_0x22254a[_0xfa1b('0x36')]['sort']);_0x38228c[_0xfa1b('0x41')]=qs[_0xfa1b('0x38')](_[_0xfa1b('0x53')](_0x22254a['query'],_0xbcc037['filters']));if(_0x22254a['query'][_0xfa1b('0x42')]){_0x38228c[_0xfa1b('0x41')]=_[_0xfa1b('0x43')](_0x38228c['where'],{'$or':_['map'](_0x38228c[_0xfa1b('0x3b')],function(_0x102d16){var _0x227f6e={};_0x227f6e[_0x102d16]={'$like':'%'+_0x22254a[_0xfa1b('0x36')][_0xfa1b('0x42')]+'%'};return _0x227f6e;})});}_0x38228c=_[_0xfa1b('0x43')]({},_0x38228c,_0x22254a[_0xfa1b('0x46')]);return _0x566adb[_0xfa1b('0x55')](_0x38228c);}})[_0xfa1b('0x2a')](function(_0x2dfd39){if(_0x2dfd39){_0x4c303a=_0x2dfd39[_0xfa1b('0x3c')];if(!_0x22254a[_0xfa1b('0x36')]['hasOwnProperty']('nolimit')){_0x38228c[_0xfa1b('0x23')]=qs[_0xfa1b('0x23')](_0x22254a[_0xfa1b('0x36')]['limit']);_0x38228c['offset']=qs[_0xfa1b('0x20')](_0x22254a[_0xfa1b('0x36')]['offset']);}return _0x566adb[_0xfa1b('0x55')](_0x38228c);}})[_0xfa1b('0x2a')](function(_0x421378){if(_0x421378){return _0x421378?{'count':_0x4c303a,'rows':_0x421378}:null;}})[_0xfa1b('0x2a')](respondWithResult(_0x1c405c,null))['catch'](handleError(_0x1c405c,null));};exports[_0xfa1b('0x56')]=function(_0x282904,_0x21343e,_0x271748){var _0x1c2f43={};var _0x5ec406={};var _0x3a6189;var _0x543941;return db[_0xfa1b('0x30')][_0xfa1b('0x51')]({'where':{'id':_0x282904['params']['id']}})[_0xfa1b('0x2a')](handleEntityNotFound(_0x21343e,null))['then'](function(_0x33c73b){if(_0x33c73b){_0x3a6189=_0x33c73b;_0x5ec406[_0xfa1b('0x35')]=_['keys'](db['Tag'][_0xfa1b('0x31')]);_0x5ec406[_0xfa1b('0x36')]=_['keys'](_0x282904[_0xfa1b('0x36')]);_0x5ec406['filters']=_['intersection'](_0x5ec406[_0xfa1b('0x35')],_0x5ec406['query']);_0x1c2f43[_0xfa1b('0x3b')]=_[_0xfa1b('0x39')](_0x5ec406['model'],qs[_0xfa1b('0x3a')](_0x282904[_0xfa1b('0x36')][_0xfa1b('0x3a')]));_0x1c2f43[_0xfa1b('0x3b')]=_0x1c2f43[_0xfa1b('0x3b')]['length']?_0x1c2f43[_0xfa1b('0x3b')]:_0x5ec406[_0xfa1b('0x35')];_0x1c2f43[_0xfa1b('0x3f')]=qs[_0xfa1b('0x40')](_0x282904[_0xfa1b('0x36')][_0xfa1b('0x40')]);_0x1c2f43['where']=qs[_0xfa1b('0x38')](_['pick'](_0x282904['query'],_0x5ec406[_0xfa1b('0x38')]));if(_0x282904[_0xfa1b('0x36')][_0xfa1b('0x42')]){_0x1c2f43[_0xfa1b('0x41')]=_[_0xfa1b('0x43')](_0x1c2f43[_0xfa1b('0x41')],{'$or':_['map'](_0x1c2f43[_0xfa1b('0x3b')],function(_0x13a4cc){var _0xd9d12b={};_0xd9d12b[_0x13a4cc]={'$like':'%'+_0x282904[_0xfa1b('0x36')][_0xfa1b('0x42')]+'%'};return _0xd9d12b;})});}_0x1c2f43=_[_0xfa1b('0x43')]({},_0x1c2f43,_0x282904[_0xfa1b('0x46')]);return _0x3a6189[_0xfa1b('0x56')](_0x1c2f43);}})[_0xfa1b('0x2a')](function(_0x4f73ba){if(_0x4f73ba){_0x543941=_0x4f73ba[_0xfa1b('0x3c')];if(!_0x282904[_0xfa1b('0x36')][_0xfa1b('0x3d')]('nolimit')){_0x1c2f43['limit']=qs['limit'](_0x282904['query'][_0xfa1b('0x23')]);_0x1c2f43[_0xfa1b('0x20')]=qs['offset'](_0x282904['query'][_0xfa1b('0x20')]);}return _0x3a6189['getTags'](_0x1c2f43);}})['then'](function(_0x1923a3){if(_0x1923a3){return _0x1923a3?{'count':_0x543941,'rows':_0x1923a3}:null;}})['then'](respondWithResult(_0x21343e,null))['catch'](handleError(_0x21343e,null));};exports['setTags']=function(_0x4a2db7,_0x3e9d15,_0x457d8c){if(_0x4a2db7[_0xfa1b('0x4f')]['id']){delete _0x4a2db7[_0xfa1b('0x4f')]['id'];}return db[_0xfa1b('0x30')][_0xfa1b('0x51')]({'where':{'id':_0x4a2db7['params']['id']}})[_0xfa1b('0x2a')](handleEntityNotFound(_0x3e9d15,null))[_0xfa1b('0x2a')](function(_0x8c3c64){if(_0x8c3c64){return _0x8c3c64['setTags'](_0x4a2db7[_0xfa1b('0x4f')][_0xfa1b('0x57')]||[]);}return null;})['then'](respondWithResult(_0x3e9d15,null))[_0xfa1b('0x49')](handleError(_0x3e9d15,null));}; \ No newline at end of file +var _0x2b5a=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskConfiguration','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','destroy','getFields','findOne','length','getSubjects','getDescriptions','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x35f8af,_0x3e3622){var _0x12280f=function(_0x1369e6){while(--_0x1369e6){_0x35f8af['push'](_0x35f8af['shift']());}};_0x12280f(++_0x3e3622);}(_0x2b5a,0x186));var _0xa2b5=function(_0x500e4a,_0x288db2){_0x500e4a=_0x500e4a-0x0;var _0x32952f=_0x2b5a[_0x500e4a];return _0x32952f;};'use strict';var emlformat=require(_0xa2b5('0x0'));var rimraf=require(_0xa2b5('0x1'));var zipdir=require(_0xa2b5('0x2'));var jsonpatch=require(_0xa2b5('0x3'));var rp=require(_0xa2b5('0x4'));var moment=require('moment');var BPromise=require(_0xa2b5('0x5'));var Mustache=require(_0xa2b5('0x6'));var util=require(_0xa2b5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa2b5('0x8'));var fs=require('fs');var fs_extra=require(_0xa2b5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2b5('0xa'));var jsforce=require(_0xa2b5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa2b5('0xc'));var querystring=require(_0xa2b5('0xd'));var Papa=require(_0xa2b5('0xe'));var Redis=require(_0xa2b5('0xf'));var authService=require(_0xa2b5('0x10'));var qs=require(_0xa2b5('0x11'));var as=require(_0xa2b5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa2b5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa2b5('0x14'));var db=require(_0xa2b5('0x15'))['db'];function respondWithStatusCode(_0x3175c0,_0x1a068a){_0x1a068a=_0x1a068a||0xcc;return function(_0x12ffc9){if(_0x12ffc9){return _0x3175c0[_0xa2b5('0x16')](_0x1a068a);}return _0x3175c0[_0xa2b5('0x17')](_0x1a068a)[_0xa2b5('0x18')]();};}function respondWithResult(_0x25b9a5,_0x2b87d3){_0x2b87d3=_0x2b87d3||0xc8;return function(_0x57aa96){if(_0x57aa96){return _0x25b9a5[_0xa2b5('0x17')](_0x2b87d3)[_0xa2b5('0x19')](_0x57aa96);}};}function respondWithFilteredResult(_0x1778f9,_0x2a4db4){return function(_0x5ba6a2){if(_0x5ba6a2){var _0x16a3d2=typeof _0x2a4db4[_0xa2b5('0x1a')]==='undefined'&&typeof _0x2a4db4[_0xa2b5('0x1b')]==='undefined';var _0x36c119=_0x5ba6a2[_0xa2b5('0x1c')];var _0x4be742=_0x16a3d2?0x0:_0x2a4db4[_0xa2b5('0x1a')];var _0x234d6d=_0x16a3d2?_0x5ba6a2[_0xa2b5('0x1c')]:_0x2a4db4['offset']+_0x2a4db4[_0xa2b5('0x1b')];var _0x581484;if(_0x234d6d>=_0x36c119){_0x234d6d=_0x36c119;_0x581484=0xc8;}else{_0x581484=0xce;}_0x1778f9['status'](_0x581484);return _0x1778f9[_0xa2b5('0x1d')](_0xa2b5('0x1e'),_0x4be742+'-'+_0x234d6d+'/'+_0x36c119)[_0xa2b5('0x19')](_0x5ba6a2);}return null;};}function patchUpdates(_0x5a2d34){return function(_0x586905){try{jsonpatch[_0xa2b5('0x1f')](_0x586905,_0x5a2d34,!![]);}catch(_0x2dbac5){return BPromise[_0xa2b5('0x20')](_0x2dbac5);}return _0x586905[_0xa2b5('0x21')]();};}function saveUpdates(_0x55f586,_0x518366){return function(_0x24f3dd){if(_0x24f3dd){return _0x24f3dd[_0xa2b5('0x22')](_0x55f586)[_0xa2b5('0x23')](function(_0x35c4f0){return _0x35c4f0;});}return null;};}function removeEntity(_0x1a8943,_0x148adf){return function(_0x9f12ac){if(_0x9f12ac){return _0x9f12ac['destroy']()[_0xa2b5('0x23')](function(){_0x1a8943[_0xa2b5('0x17')](0xcc)[_0xa2b5('0x18')]();});}};}function handleEntityNotFound(_0x2fe1f5,_0x3818f7){return function(_0x284d67){if(!_0x284d67){_0x2fe1f5[_0xa2b5('0x16')](0x194);}return _0x284d67;};}function handleError(_0x2d7e68,_0x202e58){_0x202e58=_0x202e58||0x1f4;return function(_0xa3e2a0){logger[_0xa2b5('0x24')](_0xa3e2a0[_0xa2b5('0x25')]);if(_0xa3e2a0['name']){delete _0xa3e2a0[_0xa2b5('0x26')];}_0x2d7e68['status'](_0x202e58)['send'](_0xa3e2a0);};}exports[_0xa2b5('0x27')]=function(_0x5d78c9,_0x4d1bcb){var _0x25b3a9={},_0xee5143={},_0xe8f463={'count':0x0,'rows':[]};var _0x357c3f=_[_0xa2b5('0x28')](db['FreshdeskConfiguration']['rawAttributes'],function(_0xc192be){return{'name':_0xc192be[_0xa2b5('0x29')],'type':_0xc192be[_0xa2b5('0x2a')][_0xa2b5('0x2b')]};});_0xee5143[_0xa2b5('0x2c')]=_[_0xa2b5('0x28')](_0x357c3f,_0xa2b5('0x26'));_0xee5143[_0xa2b5('0x2d')]=_[_0xa2b5('0x2e')](_0x5d78c9[_0xa2b5('0x2d')]);_0xee5143[_0xa2b5('0x2f')]=_[_0xa2b5('0x30')](_0xee5143[_0xa2b5('0x2c')],_0xee5143[_0xa2b5('0x2d')]);_0x25b3a9[_0xa2b5('0x31')]=_[_0xa2b5('0x30')](_0xee5143[_0xa2b5('0x2c')],qs[_0xa2b5('0x32')](_0x5d78c9['query']['fields']));_0x25b3a9['attributes']=_0x25b3a9[_0xa2b5('0x31')]['length']?_0x25b3a9[_0xa2b5('0x31')]:_0xee5143[_0xa2b5('0x2c')];if(!_0x5d78c9['query'][_0xa2b5('0x33')](_0xa2b5('0x34'))){_0x25b3a9[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x5d78c9[_0xa2b5('0x2d')][_0xa2b5('0x1b')]);_0x25b3a9[_0xa2b5('0x1a')]=qs[_0xa2b5('0x1a')](_0x5d78c9['query'][_0xa2b5('0x1a')]);}_0x25b3a9[_0xa2b5('0x35')]=qs[_0xa2b5('0x36')](_0x5d78c9['query'][_0xa2b5('0x36')]);_0x25b3a9[_0xa2b5('0x37')]=qs['filters'](_[_0xa2b5('0x38')](_0x5d78c9['query'],_0xee5143[_0xa2b5('0x2f')]),_0x357c3f);if(_0x5d78c9[_0xa2b5('0x2d')][_0xa2b5('0x39')]){_0x25b3a9['where']=_[_0xa2b5('0x3a')](_0x25b3a9[_0xa2b5('0x37')],{'$or':_[_0xa2b5('0x28')](_0x357c3f,function(_0x3f392d){if(_0x3f392d[_0xa2b5('0x2a')]!==_0xa2b5('0x3b')){var _0x55b41d={};_0x55b41d[_0x3f392d[_0xa2b5('0x26')]]={'$like':'%'+_0x5d78c9[_0xa2b5('0x2d')]['filter']+'%'};return _0x55b41d;}})});}_0x25b3a9=_[_0xa2b5('0x3a')]({},_0x25b3a9,_0x5d78c9[_0xa2b5('0x3c')]);var _0x227f10={'where':_0x25b3a9[_0xa2b5('0x37')]};return db['FreshdeskConfiguration']['count'](_0x227f10)[_0xa2b5('0x23')](function(_0x13aec1){_0xe8f463[_0xa2b5('0x1c')]=_0x13aec1;if(_0x5d78c9[_0xa2b5('0x2d')]['includeAll']){_0x25b3a9['include']=[{'all':!![]}];}return db[_0xa2b5('0x3d')][_0xa2b5('0x3e')](_0x25b3a9);})['then'](function(_0x16b7b5){_0xe8f463[_0xa2b5('0x3f')]=_0x16b7b5;return _0xe8f463;})[_0xa2b5('0x23')](respondWithFilteredResult(_0x4d1bcb,_0x25b3a9))[_0xa2b5('0x40')](handleError(_0x4d1bcb,null));};exports[_0xa2b5('0x41')]=function(_0x43177c,_0x50def0){var _0x1464fc={'raw':![],'where':{'id':_0x43177c[_0xa2b5('0x42')]['id']}},_0x15294d={};_0x15294d[_0xa2b5('0x2c')]=_[_0xa2b5('0x2e')](db[_0xa2b5('0x3d')][_0xa2b5('0x43')]);_0x15294d[_0xa2b5('0x2d')]=_[_0xa2b5('0x2e')](_0x43177c[_0xa2b5('0x2d')]);_0x15294d[_0xa2b5('0x2f')]=_[_0xa2b5('0x30')](_0x15294d['model'],_0x15294d[_0xa2b5('0x2d')]);_0x1464fc[_0xa2b5('0x31')]=_['intersection'](_0x15294d['model'],qs[_0xa2b5('0x32')](_0x43177c[_0xa2b5('0x2d')][_0xa2b5('0x32')]));_0x1464fc[_0xa2b5('0x31')]=_0x1464fc[_0xa2b5('0x31')]['length']?_0x1464fc[_0xa2b5('0x31')]:_0x15294d['model'];if(_0x43177c[_0xa2b5('0x2d')][_0xa2b5('0x44')]){_0x1464fc[_0xa2b5('0x45')]=[{'all':!![]}];}_0x1464fc=_[_0xa2b5('0x3a')]({},_0x1464fc,_0x43177c[_0xa2b5('0x3c')]);return db[_0xa2b5('0x3d')][_0xa2b5('0x46')](_0x1464fc)[_0xa2b5('0x23')](handleEntityNotFound(_0x50def0,null))[_0xa2b5('0x23')](respondWithResult(_0x50def0,null))['catch'](handleError(_0x50def0,null));};exports[_0xa2b5('0x47')]=function(_0x39ac30,_0x2e9ffc){return db[_0xa2b5('0x3d')]['create'](_0x39ac30[_0xa2b5('0x48')],{})[_0xa2b5('0x23')](respondWithResult(_0x2e9ffc,0xc9))[_0xa2b5('0x40')](handleError(_0x2e9ffc,null));};exports['update']=function(_0x102ee7,_0x4d7ae1){if(_0x102ee7[_0xa2b5('0x48')]['id']){delete _0x102ee7[_0xa2b5('0x48')]['id'];}return db[_0xa2b5('0x3d')]['find']({'where':{'id':_0x102ee7[_0xa2b5('0x42')]['id']}})[_0xa2b5('0x23')](handleEntityNotFound(_0x4d7ae1,null))[_0xa2b5('0x23')](saveUpdates(_0x102ee7[_0xa2b5('0x48')],null))[_0xa2b5('0x23')](respondWithResult(_0x4d7ae1,null))[_0xa2b5('0x40')](handleError(_0x4d7ae1,null));};exports[_0xa2b5('0x49')]=function(_0x5b1831,_0x1ee926){return db[_0xa2b5('0x3d')][_0xa2b5('0x46')]({'where':{'id':_0x5b1831['params']['id']}})['then'](handleEntityNotFound(_0x1ee926,null))[_0xa2b5('0x23')](removeEntity(_0x1ee926,null))[_0xa2b5('0x40')](handleError(_0x1ee926,null));};exports[_0xa2b5('0x4a')]=function(_0x23d872,_0x29537e,_0x46c2c0){var _0x5246f8={};var _0x9dfde9={};var _0x46f7fb;var _0x363fb9;return db[_0xa2b5('0x3d')][_0xa2b5('0x4b')]({'where':{'id':_0x23d872[_0xa2b5('0x42')]['id']}})[_0xa2b5('0x23')](handleEntityNotFound(_0x29537e,null))['then'](function(_0x9c5469){if(_0x9c5469){_0x46f7fb=_0x9c5469;_0x9dfde9[_0xa2b5('0x2c')]=_['keys'](db['FreshdeskField'][_0xa2b5('0x43')]);_0x9dfde9['query']=_[_0xa2b5('0x2e')](_0x23d872[_0xa2b5('0x2d')]);_0x9dfde9['filters']=_[_0xa2b5('0x30')](_0x9dfde9[_0xa2b5('0x2c')],_0x9dfde9['query']);_0x5246f8[_0xa2b5('0x31')]=_[_0xa2b5('0x30')](_0x9dfde9[_0xa2b5('0x2c')],qs[_0xa2b5('0x32')](_0x23d872[_0xa2b5('0x2d')]['fields']));_0x5246f8[_0xa2b5('0x31')]=_0x5246f8['attributes'][_0xa2b5('0x4c')]?_0x5246f8['attributes']:_0x9dfde9[_0xa2b5('0x2c')];_0x5246f8[_0xa2b5('0x35')]=qs[_0xa2b5('0x36')](_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x36')]);_0x5246f8[_0xa2b5('0x37')]=qs[_0xa2b5('0x2f')](_['pick'](_0x23d872[_0xa2b5('0x2d')],_0x9dfde9['filters']));if(_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x39')]){_0x5246f8[_0xa2b5('0x37')]=_[_0xa2b5('0x3a')](_0x5246f8[_0xa2b5('0x37')],{'$or':_[_0xa2b5('0x28')](_0x5246f8[_0xa2b5('0x31')],function(_0x3375d1){var _0x3c28a5={};_0x3c28a5[_0x3375d1]={'$like':'%'+_0x23d872[_0xa2b5('0x2d')]['filter']+'%'};return _0x3c28a5;})});}_0x5246f8=_[_0xa2b5('0x3a')]({},_0x5246f8,_0x23d872[_0xa2b5('0x3c')]);return _0x46f7fb[_0xa2b5('0x4a')](_0x5246f8);}})[_0xa2b5('0x23')](function(_0x1316d5){if(_0x1316d5){_0x363fb9=_0x1316d5[_0xa2b5('0x4c')];if(!_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x33')]('nolimit')){_0x5246f8[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x1b')]);_0x5246f8['offset']=qs['offset'](_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x1a')]);}return _0x46f7fb[_0xa2b5('0x4a')](_0x5246f8);}})['then'](function(_0x4bd266){if(_0x4bd266){return _0x4bd266?{'count':_0x363fb9,'rows':_0x4bd266}:null;}})['then'](respondWithResult(_0x29537e,null))[_0xa2b5('0x40')](handleError(_0x29537e,null));};exports['getSubjects']=function(_0x16b0f9,_0x157462,_0x15212b){var _0x3ed37a={};var _0x4aaa7f={};var _0x278dcc;var _0x54a89d;return db[_0xa2b5('0x3d')][_0xa2b5('0x4b')]({'where':{'id':_0x16b0f9[_0xa2b5('0x42')]['id']}})['then'](handleEntityNotFound(_0x157462,null))[_0xa2b5('0x23')](function(_0x2f03a4){if(_0x2f03a4){_0x278dcc=_0x2f03a4;_0x4aaa7f[_0xa2b5('0x2c')]=_[_0xa2b5('0x2e')](db['FreshdeskField'][_0xa2b5('0x43')]);_0x4aaa7f['query']=_[_0xa2b5('0x2e')](_0x16b0f9[_0xa2b5('0x2d')]);_0x4aaa7f[_0xa2b5('0x2f')]=_['intersection'](_0x4aaa7f[_0xa2b5('0x2c')],_0x4aaa7f[_0xa2b5('0x2d')]);_0x3ed37a[_0xa2b5('0x31')]=_[_0xa2b5('0x30')](_0x4aaa7f[_0xa2b5('0x2c')],qs[_0xa2b5('0x32')](_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x32')]));_0x3ed37a['attributes']=_0x3ed37a[_0xa2b5('0x31')]['length']?_0x3ed37a['attributes']:_0x4aaa7f[_0xa2b5('0x2c')];_0x3ed37a['order']=qs['sort'](_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x36')]);_0x3ed37a[_0xa2b5('0x37')]=qs[_0xa2b5('0x2f')](_[_0xa2b5('0x38')](_0x16b0f9[_0xa2b5('0x2d')],_0x4aaa7f[_0xa2b5('0x2f')]));if(_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x39')]){_0x3ed37a[_0xa2b5('0x37')]=_['merge'](_0x3ed37a[_0xa2b5('0x37')],{'$or':_[_0xa2b5('0x28')](_0x3ed37a[_0xa2b5('0x31')],function(_0x297eec){var _0x3e6586={};_0x3e6586[_0x297eec]={'$like':'%'+_0x16b0f9['query']['filter']+'%'};return _0x3e6586;})});}_0x3ed37a=_[_0xa2b5('0x3a')]({},_0x3ed37a,_0x16b0f9['options']);return _0x278dcc[_0xa2b5('0x4d')](_0x3ed37a);}})[_0xa2b5('0x23')](function(_0x5e8ec8){if(_0x5e8ec8){_0x54a89d=_0x5e8ec8[_0xa2b5('0x4c')];if(!_0x16b0f9[_0xa2b5('0x2d')]['hasOwnProperty']('nolimit')){_0x3ed37a[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x1b')]);_0x3ed37a[_0xa2b5('0x1a')]=qs[_0xa2b5('0x1a')](_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x1a')]);}return _0x278dcc[_0xa2b5('0x4d')](_0x3ed37a);}})['then'](function(_0x46465a){if(_0x46465a){return _0x46465a?{'count':_0x54a89d,'rows':_0x46465a}:null;}})[_0xa2b5('0x23')](respondWithResult(_0x157462,null))[_0xa2b5('0x40')](handleError(_0x157462,null));};exports['getDescriptions']=function(_0x5829c8,_0x374807,_0x2ca91d){var _0x40b4db={};var _0xc0620d={};var _0x4536f8;var _0x4d61c6;return db[_0xa2b5('0x3d')][_0xa2b5('0x4b')]({'where':{'id':_0x5829c8[_0xa2b5('0x42')]['id']}})[_0xa2b5('0x23')](handleEntityNotFound(_0x374807,null))[_0xa2b5('0x23')](function(_0x1e8e06){if(_0x1e8e06){_0x4536f8=_0x1e8e06;_0xc0620d[_0xa2b5('0x2c')]=_['keys'](db['FreshdeskField'][_0xa2b5('0x43')]);_0xc0620d[_0xa2b5('0x2d')]=_[_0xa2b5('0x2e')](_0x5829c8[_0xa2b5('0x2d')]);_0xc0620d['filters']=_[_0xa2b5('0x30')](_0xc0620d['model'],_0xc0620d[_0xa2b5('0x2d')]);_0x40b4db[_0xa2b5('0x31')]=_[_0xa2b5('0x30')](_0xc0620d[_0xa2b5('0x2c')],qs['fields'](_0x5829c8['query'][_0xa2b5('0x32')]));_0x40b4db[_0xa2b5('0x31')]=_0x40b4db[_0xa2b5('0x31')][_0xa2b5('0x4c')]?_0x40b4db[_0xa2b5('0x31')]:_0xc0620d[_0xa2b5('0x2c')];_0x40b4db[_0xa2b5('0x35')]=qs[_0xa2b5('0x36')](_0x5829c8[_0xa2b5('0x2d')][_0xa2b5('0x36')]);_0x40b4db[_0xa2b5('0x37')]=qs['filters'](_[_0xa2b5('0x38')](_0x5829c8[_0xa2b5('0x2d')],_0xc0620d[_0xa2b5('0x2f')]));if(_0x5829c8[_0xa2b5('0x2d')]['filter']){_0x40b4db[_0xa2b5('0x37')]=_[_0xa2b5('0x3a')](_0x40b4db[_0xa2b5('0x37')],{'$or':_[_0xa2b5('0x28')](_0x40b4db['attributes'],function(_0x17c949){var _0x179fb3={};_0x179fb3[_0x17c949]={'$like':'%'+_0x5829c8[_0xa2b5('0x2d')]['filter']+'%'};return _0x179fb3;})});}_0x40b4db=_[_0xa2b5('0x3a')]({},_0x40b4db,_0x5829c8[_0xa2b5('0x3c')]);return _0x4536f8[_0xa2b5('0x4e')](_0x40b4db);}})['then'](function(_0x2d2445){if(_0x2d2445){_0x4d61c6=_0x2d2445[_0xa2b5('0x4c')];if(!_0x5829c8[_0xa2b5('0x2d')][_0xa2b5('0x33')](_0xa2b5('0x34'))){_0x40b4db[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x5829c8[_0xa2b5('0x2d')][_0xa2b5('0x1b')]);_0x40b4db[_0xa2b5('0x1a')]=qs[_0xa2b5('0x1a')](_0x5829c8[_0xa2b5('0x2d')][_0xa2b5('0x1a')]);}return _0x4536f8[_0xa2b5('0x4e')](_0x40b4db);}})['then'](function(_0x4d173f){if(_0x4d173f){return _0x4d173f?{'count':_0x4d61c6,'rows':_0x4d173f}:null;}})[_0xa2b5('0x23')](respondWithResult(_0x374807,null))[_0xa2b5('0x40')](handleError(_0x374807,null));};exports['getTags']=function(_0x119fe9,_0x5d71e7,_0x3823ca){var _0x319e9c={};var _0x24c31a={};var _0x238223;var _0xaf444b;return db[_0xa2b5('0x3d')]['findOne']({'where':{'id':_0x119fe9[_0xa2b5('0x42')]['id']}})['then'](handleEntityNotFound(_0x5d71e7,null))['then'](function(_0x68c890){if(_0x68c890){_0x238223=_0x68c890;_0x24c31a[_0xa2b5('0x2c')]=_['keys'](db[_0xa2b5('0x4f')][_0xa2b5('0x43')]);_0x24c31a['query']=_[_0xa2b5('0x2e')](_0x119fe9['query']);_0x24c31a[_0xa2b5('0x2f')]=_['intersection'](_0x24c31a['model'],_0x24c31a[_0xa2b5('0x2d')]);_0x319e9c['attributes']=_[_0xa2b5('0x30')](_0x24c31a[_0xa2b5('0x2c')],qs[_0xa2b5('0x32')](_0x119fe9[_0xa2b5('0x2d')]['fields']));_0x319e9c[_0xa2b5('0x31')]=_0x319e9c[_0xa2b5('0x31')][_0xa2b5('0x4c')]?_0x319e9c[_0xa2b5('0x31')]:_0x24c31a[_0xa2b5('0x2c')];_0x319e9c['order']=qs['sort'](_0x119fe9['query'][_0xa2b5('0x36')]);_0x319e9c[_0xa2b5('0x37')]=qs[_0xa2b5('0x2f')](_['pick'](_0x119fe9['query'],_0x24c31a['filters']));if(_0x119fe9[_0xa2b5('0x2d')][_0xa2b5('0x39')]){_0x319e9c['where']=_[_0xa2b5('0x3a')](_0x319e9c['where'],{'$or':_[_0xa2b5('0x28')](_0x319e9c[_0xa2b5('0x31')],function(_0x77298a){var _0xcf2425={};_0xcf2425[_0x77298a]={'$like':'%'+_0x119fe9[_0xa2b5('0x2d')][_0xa2b5('0x39')]+'%'};return _0xcf2425;})});}_0x319e9c=_['merge']({},_0x319e9c,_0x119fe9[_0xa2b5('0x3c')]);return _0x238223['getTags'](_0x319e9c);}})[_0xa2b5('0x23')](function(_0x1d2947){if(_0x1d2947){_0xaf444b=_0x1d2947[_0xa2b5('0x4c')];if(!_0x119fe9[_0xa2b5('0x2d')][_0xa2b5('0x33')](_0xa2b5('0x34'))){_0x319e9c[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x119fe9[_0xa2b5('0x2d')]['limit']);_0x319e9c[_0xa2b5('0x1a')]=qs['offset'](_0x119fe9[_0xa2b5('0x2d')][_0xa2b5('0x1a')]);}return _0x238223['getTags'](_0x319e9c);}})['then'](function(_0x318461){if(_0x318461){return _0x318461?{'count':_0xaf444b,'rows':_0x318461}:null;}})[_0xa2b5('0x23')](respondWithResult(_0x5d71e7,null))[_0xa2b5('0x40')](handleError(_0x5d71e7,null));};exports[_0xa2b5('0x50')]=function(_0x5b3fda,_0x306956,_0x3ea22f){if(_0x5b3fda[_0xa2b5('0x48')]['id']){delete _0x5b3fda[_0xa2b5('0x48')]['id'];}return db[_0xa2b5('0x3d')][_0xa2b5('0x4b')]({'where':{'id':_0x5b3fda[_0xa2b5('0x42')]['id']}})[_0xa2b5('0x23')](handleEntityNotFound(_0x306956,null))['then'](function(_0x1935e4){if(_0x1935e4){return _0x1935e4[_0xa2b5('0x50')](_0x5b3fda[_0xa2b5('0x48')][_0xa2b5('0x51')]||[]);}return null;})[_0xa2b5('0x23')](respondWithResult(_0x306956,null))[_0xa2b5('0x40')](handleError(_0x306956,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 7b3537e..cd96230 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 _0x0b46=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x59d9b9,_0x4769ae){var _0x5927d2=function(_0x39b91b){while(--_0x39b91b){_0x59d9b9['push'](_0x59d9b9['shift']());}};_0x5927d2(++_0x4769ae);}(_0x0b46,0xd1));var _0x60b4=function(_0x443f79,_0x33e446){_0x443f79=_0x443f79-0x0;var _0x3847e4=_0x0b46[_0x443f79];return _0x3847e4;};'use strict';var _=require(_0x60b4('0x0'));var util=require('util');var logger=require(_0x60b4('0x1'))('api');var moment=require(_0x60b4('0x2'));var BPromise=require(_0x60b4('0x3'));var rp=require(_0x60b4('0x4'));var fs=require('fs');var path=require(_0x60b4('0x5'));var rimraf=require(_0x60b4('0x6'));var config=require(_0x60b4('0x7'));var attributes=require(_0x60b4('0x8'));module[_0x60b4('0x9')]=function(_0x200268,_0x9ce8cc){return _0x200268[_0x60b4('0xa')](_0x60b4('0xb'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5e6=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes'];(function(_0x2b79c2,_0x5a5afb){var _0x49bfd1=function(_0x283118){while(--_0x283118){_0x2b79c2['push'](_0x2b79c2['shift']());}};_0x49bfd1(++_0x5a5afb);}(_0xd5e6,0xfb));var _0x6d5e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd5e6[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x6d5e('0x0'));var util=require('util');var logger=require(_0x6d5e('0x1'))(_0x6d5e('0x2'));var moment=require(_0x6d5e('0x3'));var BPromise=require(_0x6d5e('0x4'));var rp=require(_0x6d5e('0x5'));var fs=require('fs');var path=require(_0x6d5e('0x6'));var rimraf=require(_0x6d5e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d5e('0x8'));module[_0x6d5e('0x9')]=function(_0x1a0182,_0x36e031){return _0x1a0182[_0x6d5e('0xa')](_0x6d5e('0xb'),attributes,{'tableName':_0x6d5e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 5df9255..a966b38 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 _0xdae7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','ioredis'];(function(_0x570dce,_0xf5836d){var _0x33c876=function(_0x1ca69b){while(--_0x1ca69b){_0x570dce['push'](_0x570dce['shift']());}};_0x33c876(++_0xf5836d);}(_0xdae7,0x13f));var _0x7dae=function(_0x2d0953,_0x30bcf9){_0x2d0953=_0x2d0953-0x0;var _0x1e824a=_0xdae7[_0x2d0953];return _0x1e824a;};'use strict';var _=require('lodash');var util=require(_0x7dae('0x0'));var moment=require(_0x7dae('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dae('0x2'));var db=require(_0x7dae('0x3'))['db'];var utils=require(_0x7dae('0x4'));var logger=require(_0x7dae('0x5'))(_0x7dae('0x6'));var config=require(_0x7dae('0x7'));var jayson=require(_0x7dae('0x8'));var client=jayson[_0x7dae('0x9')][_0x7dae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x370613,_0x2eb9aa,_0x5540e4){return new BPromise(function(_0x35d21c,_0x4b7c42){return client[_0x7dae('0xb')](_0x370613,_0x5540e4)[_0x7dae('0xc')](function(_0x1c4550){logger[_0x7dae('0xd')](_0x7dae('0xe'),_0x2eb9aa,_0x7dae('0xf'));logger[_0x7dae('0x10')](_0x7dae('0x11'),_0x2eb9aa,_0x7dae('0xf'),JSON[_0x7dae('0x12')](_0x1c4550));if(_0x1c4550[_0x7dae('0x13')]){if(_0x1c4550[_0x7dae('0x13')][_0x7dae('0x14')]===0x1f4){logger[_0x7dae('0x13')](_0x7dae('0xe'),_0x2eb9aa,_0x1c4550['error']['message']);return _0x4b7c42(_0x1c4550['error'][_0x7dae('0x15')]);}logger[_0x7dae('0x13')](_0x7dae('0xe'),_0x2eb9aa,_0x1c4550[_0x7dae('0x13')][_0x7dae('0x15')]);return _0x35d21c(_0x1c4550[_0x7dae('0x13')][_0x7dae('0x15')]);}else{logger[_0x7dae('0xd')](_0x7dae('0xe'),_0x2eb9aa,_0x7dae('0xf'));_0x35d21c(_0x1c4550[_0x7dae('0x16')]['message']);}})['catch'](function(_0x3f7a54){logger[_0x7dae('0x13')](_0x7dae('0xe'),_0x2eb9aa,_0x3f7a54);_0x4b7c42(_0x3f7a54);});});} \ No newline at end of file +var _0xd083=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd083,0x1ba));var _0x3d08=function(_0x37fcda,_0x2f5aa1){_0x37fcda=_0x37fcda-0x0;var _0xf5ed91=_0xd083[_0x37fcda];return _0xf5ed91;};'use strict';var _=require(_0x3d08('0x0'));var util=require(_0x3d08('0x1'));var moment=require('moment');var BPromise=require(_0x3d08('0x2'));var rs=require(_0x3d08('0x3'));var fs=require('fs');var Redis=require(_0x3d08('0x4'));var db=require(_0x3d08('0x5'))['db'];var utils=require(_0x3d08('0x6'));var logger=require(_0x3d08('0x7'))(_0x3d08('0x8'));var config=require(_0x3d08('0x9'));var jayson=require(_0x3d08('0xa'));var client=jayson[_0x3d08('0xb')][_0x3d08('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b8ad4,_0x3bb402,_0x33b86c){return new BPromise(function(_0x11d9de,_0x5837ef){return client[_0x3d08('0xd')](_0x1b8ad4,_0x33b86c)[_0x3d08('0xe')](function(_0x2506ba){logger[_0x3d08('0xf')](_0x3d08('0x10'),_0x3bb402,_0x3d08('0x11'));logger[_0x3d08('0x12')](_0x3d08('0x13'),_0x3bb402,_0x3d08('0x11'),JSON[_0x3d08('0x14')](_0x2506ba));if(_0x2506ba[_0x3d08('0x15')]){if(_0x2506ba['error']['code']===0x1f4){logger[_0x3d08('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bb402,_0x2506ba['error'][_0x3d08('0x16')]);return _0x5837ef(_0x2506ba[_0x3d08('0x15')][_0x3d08('0x16')]);}logger[_0x3d08('0x15')](_0x3d08('0x10'),_0x3bb402,_0x2506ba[_0x3d08('0x15')][_0x3d08('0x16')]);return _0x11d9de(_0x2506ba[_0x3d08('0x15')][_0x3d08('0x16')]);}else{logger[_0x3d08('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bb402,_0x3d08('0x11'));_0x11d9de(_0x2506ba[_0x3d08('0x17')]['message']);}})[_0x3d08('0x18')](function(_0x51a361){logger[_0x3d08('0x15')](_0x3d08('0x10'),_0x3bb402,_0x51a361);_0x5837ef(_0x51a361);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 49de833..82e058b 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 _0x0705=['destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','create','put','update','delete','/:id'];(function(_0x163366,_0x35d6d5){var _0x422d8a=function(_0x14e6c6){while(--_0x14e6c6){_0x163366['push'](_0x163366['shift']());}};_0x422d8a(++_0x35d6d5);}(_0x0705,0x157));var _0x5070=function(_0xa90718,_0x2fd952){_0xa90718=_0xa90718-0x0;var _0x56ed79=_0x0705[_0xa90718];return _0x56ed79;};'use strict';var multer=require(_0x5070('0x0'));var util=require(_0x5070('0x1'));var path=require(_0x5070('0x2'));var timeout=require(_0x5070('0x3'));var express=require(_0x5070('0x4'));var router=express['Router']();var fs_extra=require(_0x5070('0x5'));var auth=require(_0x5070('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5070('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x5070('0x8')]('/',auth['isAuthenticated'](),controller[_0x5070('0x9')]);router[_0x5070('0x8')]('/:id',auth[_0x5070('0xa')](),controller[_0x5070('0xb')]);router['post']('/',auth[_0x5070('0xa')](),controller[_0x5070('0xc')]);router[_0x5070('0xd')]('/:id',auth[_0x5070('0xa')](),controller[_0x5070('0xe')]);router[_0x5070('0xf')](_0x5070('0x10'),auth['isAuthenticated'](),controller[_0x5070('0x11')]);module['exports']=router; \ No newline at end of file +var _0x41e8=['put','/:id','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post'];(function(_0x49adfd,_0x136735){var _0x518e53=function(_0x5b472c){while(--_0x5b472c){_0x49adfd['push'](_0x49adfd['shift']());}};_0x518e53(++_0x136735);}(_0x41e8,0x148));var _0x841e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x41e8[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x841e('0x0'));var util=require(_0x841e('0x1'));var path=require('path');var timeout=require(_0x841e('0x2'));var express=require(_0x841e('0x3'));var router=express[_0x841e('0x4')]();var fs_extra=require(_0x841e('0x5'));var auth=require(_0x841e('0x6'));var interaction=require(_0x841e('0x7'));var config=require('../../config/environment');var controller=require(_0x841e('0x8'));router[_0x841e('0x9')]('/',auth[_0x841e('0xa')](),controller[_0x841e('0xb')]);router[_0x841e('0x9')]('/:id',auth[_0x841e('0xa')](),controller[_0x841e('0xc')]);router[_0x841e('0xd')]('/',auth[_0x841e('0xa')](),controller['create']);router[_0x841e('0xe')](_0x841e('0xf'),auth[_0x841e('0xa')](),controller[_0x841e('0x10')]);router['delete'](_0x841e('0xf'),auth[_0x841e('0xa')](),controller[_0x841e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index c7170f2..3866a6d 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 _0x2678=['customVariable','keyValue','picklist','string','STRING','exports','ENUM','variable'];(function(_0x339e02,_0x224082){var _0x40b459=function(_0x2c062d){while(--_0x2c062d){_0x339e02['push'](_0x339e02['shift']());}};_0x40b459(++_0x224082);}(_0x2678,0x15d));var _0x8267=function(_0x4cd4fe,_0x18ef9c){_0x4cd4fe=_0x4cd4fe-0x0;var _0x12d092=_0x2678[_0x4cd4fe];return _0x12d092;};'use strict';var Sequelize=require('sequelize');module[_0x8267('0x0')]={'type':{'type':Sequelize[_0x8267('0x1')]('string',_0x8267('0x2'),_0x8267('0x3'),_0x8267('0x4'),_0x8267('0x5')),'defaultValue':_0x8267('0x6')},'content':{'type':Sequelize[_0x8267('0x7')]},'key':{'type':Sequelize[_0x8267('0x7')]},'keyType':{'type':Sequelize[_0x8267('0x1')](_0x8267('0x6'),_0x8267('0x2'),_0x8267('0x3'))},'keyContent':{'type':Sequelize[_0x8267('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8267('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xab8d=['string','STRING','variable','sequelize','ENUM','customVariable','keyValue','picklist'];(function(_0x59d186,_0x415a9c){var _0x3a372a=function(_0x279acb){while(--_0x279acb){_0x59d186['push'](_0x59d186['shift']());}};_0x3a372a(++_0x415a9c);}(_0xab8d,0x1e3));var _0xdab8=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xab8d[_0xa8883];return _0x479426;};'use strict';var Sequelize=require(_0xdab8('0x0'));module['exports']={'type':{'type':Sequelize[_0xdab8('0x1')]('string','variable',_0xdab8('0x2'),_0xdab8('0x3'),_0xdab8('0x4')),'defaultValue':_0xdab8('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdab8('0x6')]},'keyType':{'type':Sequelize[_0xdab8('0x1')]('string',_0xdab8('0x7'),_0xdab8('0x2'))},'keyContent':{'type':Sequelize[_0xdab8('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdab8('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdab8('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 79aef35..9313cd1 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 _0xe28e=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','then','send','index','map','FreshdeskField','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0xe28e,0x1ba));var _0xee28=function(_0x12d65c,_0x802ae1){_0x12d65c=_0x12d65c-0x0;var _0x33bd3c=_0xe28e[_0x12d65c];return _0x33bd3c;};'use strict';var emlformat=require(_0xee28('0x0'));var rimraf=require(_0xee28('0x1'));var zipdir=require(_0xee28('0x2'));var jsonpatch=require(_0xee28('0x3'));var rp=require(_0xee28('0x4'));var moment=require(_0xee28('0x5'));var BPromise=require(_0xee28('0x6'));var Mustache=require(_0xee28('0x7'));var util=require(_0xee28('0x8'));var path=require(_0xee28('0x9'));var sox=require(_0xee28('0xa'));var csv=require(_0xee28('0xb'));var ejs=require(_0xee28('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee28('0xd'));var squel=require(_0xee28('0xe'));var crypto=require(_0xee28('0xf'));var jsforce=require(_0xee28('0x10'));var deskjs=require(_0xee28('0x11'));var toCsv=require(_0xee28('0xb'));var querystring=require(_0xee28('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee28('0x13'));var as=require(_0xee28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee28('0x15'))(_0xee28('0x16'));var utils=require('../../config/utils');var config=require(_0xee28('0x17'));var licenseUtil=require(_0xee28('0x18'));var db=require(_0xee28('0x19'))['db'];function respondWithStatusCode(_0x2488cf,_0x267031){_0x267031=_0x267031||0xcc;return function(_0x46e784){if(_0x46e784){return _0x2488cf[_0xee28('0x1a')](_0x267031);}return _0x2488cf['status'](_0x267031)[_0xee28('0x1b')]();};}function respondWithResult(_0x1df69a,_0x555b9c){_0x555b9c=_0x555b9c||0xc8;return function(_0x331b7c){if(_0x331b7c){return _0x1df69a[_0xee28('0x1c')](_0x555b9c)['json'](_0x331b7c);}};}function respondWithFilteredResult(_0x11ac93,_0x17c99a){return function(_0x3d3a5c){if(_0x3d3a5c){var _0x343358=typeof _0x17c99a[_0xee28('0x1d')]===_0xee28('0x1e')&&typeof _0x17c99a['limit']===_0xee28('0x1e');var _0x5de212=_0x3d3a5c[_0xee28('0x1f')];var _0x19472a=_0x343358?0x0:_0x17c99a['offset'];var _0x355b07=_0x343358?_0x3d3a5c['count']:_0x17c99a[_0xee28('0x1d')]+_0x17c99a['limit'];var _0x28da88;if(_0x355b07>=_0x5de212){_0x355b07=_0x5de212;_0x28da88=0xc8;}else{_0x28da88=0xce;}_0x11ac93['status'](_0x28da88);return _0x11ac93[_0xee28('0x20')]('Content-Range',_0x19472a+'-'+_0x355b07+'/'+_0x5de212)[_0xee28('0x21')](_0x3d3a5c);}return null;};}function patchUpdates(_0x2a01ff){return function(_0x96f5db){try{jsonpatch[_0xee28('0x22')](_0x96f5db,_0x2a01ff,!![]);}catch(_0x21ee24){return BPromise[_0xee28('0x23')](_0x21ee24);}return _0x96f5db[_0xee28('0x24')]();};}function saveUpdates(_0x4bda53,_0x342798){return function(_0x44d7ff){if(_0x44d7ff){return _0x44d7ff[_0xee28('0x25')](_0x4bda53)['then'](function(_0x5b500b){return _0x5b500b;});}return null;};}function removeEntity(_0x17d8e4,_0x4a524d){return function(_0x1519ae){if(_0x1519ae){return _0x1519ae[_0xee28('0x26')]()[_0xee28('0x27')](function(){_0x17d8e4[_0xee28('0x1c')](0xcc)[_0xee28('0x1b')]();});}};}function handleEntityNotFound(_0x95d917,_0x2a7c95){return function(_0x733ca8){if(!_0x733ca8){_0x95d917[_0xee28('0x1a')](0x194);}return _0x733ca8;};}function handleError(_0x4ce19b,_0x2c847b){_0x2c847b=_0x2c847b||0x1f4;return function(_0x5b1b1e){logger['error'](_0x5b1b1e['stack']);if(_0x5b1b1e['name']){delete _0x5b1b1e['name'];}_0x4ce19b[_0xee28('0x1c')](_0x2c847b)[_0xee28('0x28')](_0x5b1b1e);};}exports[_0xee28('0x29')]=function(_0x469889,_0x346201){var _0x417840={},_0xbafd67={},_0x4fcc8f={'count':0x0,'rows':[]};var _0x84e0ba=_[_0xee28('0x2a')](db[_0xee28('0x2b')]['rawAttributes'],function(_0x14f7c4){return{'name':_0x14f7c4[_0xee28('0x2c')],'type':_0x14f7c4[_0xee28('0x2d')][_0xee28('0x2e')]};});_0xbafd67[_0xee28('0x2f')]=_[_0xee28('0x2a')](_0x84e0ba,_0xee28('0x30'));_0xbafd67['query']=_[_0xee28('0x31')](_0x469889[_0xee28('0x32')]);_0xbafd67['filters']=_[_0xee28('0x33')](_0xbafd67[_0xee28('0x2f')],_0xbafd67[_0xee28('0x32')]);_0x417840[_0xee28('0x34')]=_[_0xee28('0x33')](_0xbafd67[_0xee28('0x2f')],qs[_0xee28('0x35')](_0x469889['query']['fields']));_0x417840['attributes']=_0x417840[_0xee28('0x34')][_0xee28('0x36')]?_0x417840[_0xee28('0x34')]:_0xbafd67[_0xee28('0x2f')];if(!_0x469889[_0xee28('0x32')][_0xee28('0x37')]('nolimit')){_0x417840[_0xee28('0x38')]=qs[_0xee28('0x38')](_0x469889['query']['limit']);_0x417840[_0xee28('0x1d')]=qs[_0xee28('0x1d')](_0x469889['query']['offset']);}_0x417840[_0xee28('0x39')]=qs[_0xee28('0x3a')](_0x469889['query'][_0xee28('0x3a')]);_0x417840[_0xee28('0x3b')]=qs[_0xee28('0x3c')](_[_0xee28('0x3d')](_0x469889[_0xee28('0x32')],_0xbafd67[_0xee28('0x3c')]),_0x84e0ba);if(_0x469889[_0xee28('0x32')][_0xee28('0x3e')]){_0x417840[_0xee28('0x3b')]=_[_0xee28('0x3f')](_0x417840[_0xee28('0x3b')],{'$or':_[_0xee28('0x2a')](_0x84e0ba,function(_0x486d55){if(_0x486d55[_0xee28('0x2d')]!=='VIRTUAL'){var _0x4b0b75={};_0x4b0b75[_0x486d55[_0xee28('0x30')]]={'$like':'%'+_0x469889['query'][_0xee28('0x3e')]+'%'};return _0x4b0b75;}})});}_0x417840=_['merge']({},_0x417840,_0x469889[_0xee28('0x40')]);var _0x4d096c={'where':_0x417840[_0xee28('0x3b')]};return db[_0xee28('0x2b')][_0xee28('0x1f')](_0x4d096c)[_0xee28('0x27')](function(_0x58ebb5){_0x4fcc8f[_0xee28('0x1f')]=_0x58ebb5;if(_0x469889['query'][_0xee28('0x41')]){_0x417840[_0xee28('0x42')]=[{'all':!![]}];}return db[_0xee28('0x2b')][_0xee28('0x43')](_0x417840);})[_0xee28('0x27')](function(_0x2e046e){_0x4fcc8f[_0xee28('0x44')]=_0x2e046e;return _0x4fcc8f;})['then'](respondWithFilteredResult(_0x346201,_0x417840))['catch'](handleError(_0x346201,null));};exports[_0xee28('0x45')]=function(_0x5c710d,_0x52b666){var _0x4064cf={'raw':!![],'where':{'id':_0x5c710d['params']['id']}},_0x14bd8d={};_0x14bd8d[_0xee28('0x2f')]=_[_0xee28('0x31')](db[_0xee28('0x2b')][_0xee28('0x46')]);_0x14bd8d[_0xee28('0x32')]=_[_0xee28('0x31')](_0x5c710d[_0xee28('0x32')]);_0x14bd8d['filters']=_[_0xee28('0x33')](_0x14bd8d[_0xee28('0x2f')],_0x14bd8d[_0xee28('0x32')]);_0x4064cf[_0xee28('0x34')]=_[_0xee28('0x33')](_0x14bd8d['model'],qs[_0xee28('0x35')](_0x5c710d[_0xee28('0x32')]['fields']));_0x4064cf[_0xee28('0x34')]=_0x4064cf[_0xee28('0x34')][_0xee28('0x36')]?_0x4064cf[_0xee28('0x34')]:_0x14bd8d[_0xee28('0x2f')];if(_0x5c710d[_0xee28('0x32')]['includeAll']){_0x4064cf[_0xee28('0x42')]=[{'all':!![]}];}_0x4064cf=_['merge']({},_0x4064cf,_0x5c710d['options']);return db[_0xee28('0x2b')][_0xee28('0x47')](_0x4064cf)['then'](handleEntityNotFound(_0x52b666,null))[_0xee28('0x27')](respondWithResult(_0x52b666,null))[_0xee28('0x48')](handleError(_0x52b666,null));};exports[_0xee28('0x49')]=function(_0x5d07ed,_0x57e57e){return db[_0xee28('0x2b')][_0xee28('0x49')](_0x5d07ed[_0xee28('0x4a')],{})[_0xee28('0x27')](respondWithResult(_0x57e57e,0xc9))[_0xee28('0x48')](handleError(_0x57e57e,null));};exports[_0xee28('0x25')]=function(_0x2574c5,_0x2b5f36){if(_0x2574c5[_0xee28('0x4a')]['id']){delete _0x2574c5[_0xee28('0x4a')]['id'];}return db['FreshdeskField'][_0xee28('0x47')]({'where':{'id':_0x2574c5['params']['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x2b5f36,null))[_0xee28('0x27')](saveUpdates(_0x2574c5[_0xee28('0x4a')],null))[_0xee28('0x27')](respondWithResult(_0x2b5f36,null))[_0xee28('0x48')](handleError(_0x2b5f36,null));};exports['destroy']=function(_0x5247fe,_0x5ca018){return db[_0xee28('0x2b')]['find']({'where':{'id':_0x5247fe['params']['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x5ca018,null))['then'](removeEntity(_0x5ca018,null))[_0xee28('0x48')](handleError(_0x5ca018,null));}; \ No newline at end of file +var _0x5ec6=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service'];(function(_0x317da2,_0x52bd9b){var _0x2d33fc=function(_0x5834b9){while(--_0x5834b9){_0x317da2['push'](_0x317da2['shift']());}};_0x2d33fc(++_0x52bd9b);}(_0x5ec6,0x7f));var _0x65ec=function(_0x22c353,_0x457bfb){_0x22c353=_0x22c353-0x0;var _0x3065d4=_0x5ec6[_0x22c353];return _0x3065d4;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];function respondWithStatusCode(_0x53d62b,_0x3e52c8){_0x3e52c8=_0x3e52c8||0xcc;return function(_0x2af7d6){if(_0x2af7d6){return _0x53d62b[_0x65ec('0x15')](_0x3e52c8);}return _0x53d62b[_0x65ec('0x16')](_0x3e52c8)[_0x65ec('0x17')]();};}function respondWithResult(_0x434e20,_0x344724){_0x344724=_0x344724||0xc8;return function(_0x3edbfd){if(_0x3edbfd){return _0x434e20['status'](_0x344724)[_0x65ec('0x18')](_0x3edbfd);}};}function respondWithFilteredResult(_0x3ed6f7,_0x35d06b){return function(_0x4bbe88){if(_0x4bbe88){var _0x5a0442=typeof _0x35d06b[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x35d06b[_0x65ec('0x1b')]==='undefined';var _0x25dae7=_0x4bbe88[_0x65ec('0x1c')];var _0x1254f8=_0x5a0442?0x0:_0x35d06b[_0x65ec('0x19')];var _0x29ebc4=_0x5a0442?_0x4bbe88[_0x65ec('0x1c')]:_0x35d06b[_0x65ec('0x19')]+_0x35d06b[_0x65ec('0x1b')];var _0x2127e2;if(_0x29ebc4>=_0x25dae7){_0x29ebc4=_0x25dae7;_0x2127e2=0xc8;}else{_0x2127e2=0xce;}_0x3ed6f7[_0x65ec('0x16')](_0x2127e2);return _0x3ed6f7[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x1254f8+'-'+_0x29ebc4+'/'+_0x25dae7)[_0x65ec('0x18')](_0x4bbe88);}return null;};}function patchUpdates(_0x1467ac){return function(_0x3804a4){try{jsonpatch[_0x65ec('0x1f')](_0x3804a4,_0x1467ac,!![]);}catch(_0x15d4eb){return BPromise[_0x65ec('0x20')](_0x15d4eb);}return _0x3804a4[_0x65ec('0x21')]();};}function saveUpdates(_0x4ff93c,_0x170703){return function(_0x297fba){if(_0x297fba){return _0x297fba[_0x65ec('0x22')](_0x4ff93c)[_0x65ec('0x23')](function(_0x1d60fb){return _0x1d60fb;});}return null;};}function removeEntity(_0x163e55,_0x47288d){return function(_0x58239f){if(_0x58239f){return _0x58239f[_0x65ec('0x24')]()[_0x65ec('0x23')](function(){_0x163e55[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x288e66,_0x156793){return function(_0x21426b){if(!_0x21426b){_0x288e66[_0x65ec('0x15')](0x194);}return _0x21426b;};}function handleError(_0x297e09,_0x4c846b){_0x4c846b=_0x4c846b||0x1f4;return function(_0x10baef){logger[_0x65ec('0x25')](_0x10baef[_0x65ec('0x26')]);if(_0x10baef[_0x65ec('0x27')]){delete _0x10baef['name'];}_0x297e09[_0x65ec('0x16')](_0x4c846b)['send'](_0x10baef);};}exports[_0x65ec('0x28')]=function(_0x1ada47,_0x1d0b5c){var _0x30366c={},_0x14431d={},_0x46d4c1={'count':0x0,'rows':[]};var _0x46bf66=_[_0x65ec('0x29')](db[_0x65ec('0x2a')][_0x65ec('0x2b')],function(_0x3c97e2){return{'name':_0x3c97e2['fieldName'],'type':_0x3c97e2['type'][_0x65ec('0x2c')]};});_0x14431d['model']=_[_0x65ec('0x29')](_0x46bf66,_0x65ec('0x27'));_0x14431d['query']=_[_0x65ec('0x2d')](_0x1ada47[_0x65ec('0x2e')]);_0x14431d[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x14431d['model'],_0x14431d[_0x65ec('0x2e')]);_0x30366c[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x14431d[_0x65ec('0x32')],qs[_0x65ec('0x33')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x30366c[_0x65ec('0x31')]=_0x30366c[_0x65ec('0x31')][_0x65ec('0x34')]?_0x30366c['attributes']:_0x14431d[_0x65ec('0x32')];if(!_0x1ada47[_0x65ec('0x2e')]['hasOwnProperty'](_0x65ec('0x35'))){_0x30366c[_0x65ec('0x1b')]=qs[_0x65ec('0x1b')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x1b')]);_0x30366c[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0x1ada47['query'][_0x65ec('0x19')]);}_0x30366c[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x1ada47[_0x65ec('0x2e')]['sort']);_0x30366c[_0x65ec('0x38')]=qs[_0x65ec('0x2f')](_[_0x65ec('0x39')](_0x1ada47[_0x65ec('0x2e')],_0x14431d['filters']),_0x46bf66);if(_0x1ada47['query'][_0x65ec('0x3a')]){_0x30366c['where']=_[_0x65ec('0x3b')](_0x30366c[_0x65ec('0x38')],{'$or':_['map'](_0x46bf66,function(_0x16ef59){if(_0x16ef59[_0x65ec('0x3c')]!==_0x65ec('0x3d')){var _0x5357bf={};_0x5357bf[_0x16ef59[_0x65ec('0x27')]]={'$like':'%'+_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3a')]+'%'};return _0x5357bf;}})});}_0x30366c=_[_0x65ec('0x3b')]({},_0x30366c,_0x1ada47[_0x65ec('0x3e')]);var _0x2ce56f={'where':_0x30366c[_0x65ec('0x38')]};return db['FreshdeskField'][_0x65ec('0x1c')](_0x2ce56f)['then'](function(_0x2654b2){_0x46d4c1[_0x65ec('0x1c')]=_0x2654b2;if(_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x30366c[_0x65ec('0x40')]=[{'all':!![]}];}return db[_0x65ec('0x2a')]['findAll'](_0x30366c);})[_0x65ec('0x23')](function(_0x4ba7df){_0x46d4c1['rows']=_0x4ba7df;return _0x46d4c1;})[_0x65ec('0x23')](respondWithFilteredResult(_0x1d0b5c,_0x30366c))[_0x65ec('0x41')](handleError(_0x1d0b5c,null));};exports[_0x65ec('0x42')]=function(_0x143a11,_0x1d475e){var _0x524235={'raw':!![],'where':{'id':_0x143a11[_0x65ec('0x43')]['id']}},_0x4843ca={};_0x4843ca[_0x65ec('0x32')]=_[_0x65ec('0x2d')](db[_0x65ec('0x2a')][_0x65ec('0x2b')]);_0x4843ca['query']=_['keys'](_0x143a11[_0x65ec('0x2e')]);_0x4843ca[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x4843ca[_0x65ec('0x32')],_0x4843ca[_0x65ec('0x2e')]);_0x524235[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x4843ca['model'],qs[_0x65ec('0x33')](_0x143a11[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x524235['attributes']=_0x524235[_0x65ec('0x31')][_0x65ec('0x34')]?_0x524235['attributes']:_0x4843ca[_0x65ec('0x32')];if(_0x143a11[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x524235[_0x65ec('0x40')]=[{'all':!![]}];}_0x524235=_[_0x65ec('0x3b')]({},_0x524235,_0x143a11['options']);return db[_0x65ec('0x2a')][_0x65ec('0x44')](_0x524235)[_0x65ec('0x23')](handleEntityNotFound(_0x1d475e,null))[_0x65ec('0x23')](respondWithResult(_0x1d475e,null))['catch'](handleError(_0x1d475e,null));};exports[_0x65ec('0x45')]=function(_0x509c28,_0x1ed0f9){return db[_0x65ec('0x2a')][_0x65ec('0x45')](_0x509c28['body'],{})['then'](respondWithResult(_0x1ed0f9,0xc9))[_0x65ec('0x41')](handleError(_0x1ed0f9,null));};exports[_0x65ec('0x22')]=function(_0xf5419,_0x2111af){if(_0xf5419[_0x65ec('0x46')]['id']){delete _0xf5419[_0x65ec('0x46')]['id'];}return db[_0x65ec('0x2a')][_0x65ec('0x44')]({'where':{'id':_0xf5419[_0x65ec('0x43')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x23')](saveUpdates(_0xf5419[_0x65ec('0x46')],null))[_0x65ec('0x23')](respondWithResult(_0x2111af,null))[_0x65ec('0x41')](handleError(_0x2111af,null));};exports[_0x65ec('0x24')]=function(_0x14eaef,_0x22c28c){return db['FreshdeskField'][_0x65ec('0x44')]({'where':{'id':_0x14eaef[_0x65ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x22c28c,null))[_0x65ec('0x23')](removeEntity(_0x22c28c,null))[_0x65ec('0x41')](handleError(_0x22c28c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index e018703..15b9612 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 _0x9d6a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash'];(function(_0x8ee2e7,_0x3908e3){var _0x2d8334=function(_0x4cac61){while(--_0x4cac61){_0x8ee2e7['push'](_0x8ee2e7['shift']());}};_0x2d8334(++_0x3908e3);}(_0x9d6a,0x1d0));var _0xa9d6=function(_0x4c1c11,_0x286cf6){_0x4c1c11=_0x4c1c11-0x0;var _0x341556=_0x9d6a[_0x4c1c11];return _0x341556;};'use strict';var _=require(_0xa9d6('0x0'));var util=require(_0xa9d6('0x1'));var logger=require(_0xa9d6('0x2'))(_0xa9d6('0x3'));var moment=require(_0xa9d6('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9d6('0x5'));var fs=require('fs');var path=require(_0xa9d6('0x6'));var rimraf=require(_0xa9d6('0x7'));var config=require(_0xa9d6('0x8'));var attributes=require(_0xa9d6('0x9'));module['exports']=function(_0x2d0071,_0x6877dd){return _0x2d0071[_0xa9d6('0xa')](_0xa9d6('0xb'),attributes,{'tableName':_0xa9d6('0xc'),'paranoid':![],'indexes':[{'name':_0xa9d6('0xd'),'fields':[_0xa9d6('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6135=['define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0xed8e01,_0x561850){var _0x2a13b5=function(_0x21a1b9){while(--_0x21a1b9){_0xed8e01['push'](_0xed8e01['shift']());}};_0x2a13b5(++_0x561850);}(_0x6135,0x18b));var _0x5613=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x6135[_0x4e11d5];return _0x5e4e4c;};'use strict';var _=require(_0x5613('0x0'));var util=require(_0x5613('0x1'));var logger=require(_0x5613('0x2'))(_0x5613('0x3'));var moment=require(_0x5613('0x4'));var BPromise=require('bluebird');var rp=require(_0x5613('0x5'));var fs=require('fs');var path=require(_0x5613('0x6'));var rimraf=require(_0x5613('0x7'));var config=require(_0x5613('0x8'));var attributes=require(_0x5613('0x9'));module['exports']=function(_0x37a2af,_0x17604e){return _0x37a2af[_0x5613('0xa')](_0x5613('0xb'),attributes,{'tableName':_0x5613('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x5613('0xd'),_0x5613('0xe')],'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 5769c45..05c4cbd 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 _0xfb5e=['client','http','request','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','FreshdeskField,\x20%s,\x20%s','message','info','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5182e8,_0xef48fd){var _0x46f1bb=function(_0xa05973){while(--_0xa05973){_0x5182e8['push'](_0x5182e8['shift']());}};_0x46f1bb(++_0xef48fd);}(_0xfb5e,0x1ab));var _0xefb5=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xfb5e[_0x5ecadc];return _0x565037;};'use strict';var _=require('lodash');var util=require(_0xefb5('0x0'));var moment=require(_0xefb5('0x1'));var BPromise=require(_0xefb5('0x2'));var rs=require(_0xefb5('0x3'));var fs=require('fs');var Redis=require(_0xefb5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xefb5('0x5'));var logger=require(_0xefb5('0x6'))(_0xefb5('0x7'));var config=require(_0xefb5('0x8'));var jayson=require(_0xefb5('0x9'));var client=jayson[_0xefb5('0xa')][_0xefb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb8af77,_0xdad064,_0x77b5e5){return new BPromise(function(_0x2d8bd4,_0x4f22ca){return client[_0xefb5('0xc')](_0xb8af77,_0x77b5e5)[_0xefb5('0xd')](function(_0x3ca87b){logger['info']('FreshdeskField,\x20%s,\x20%s',_0xdad064,_0xefb5('0xe'));logger[_0xefb5('0xf')](_0xefb5('0x10'),_0xdad064,_0xefb5('0xe'),JSON['stringify'](_0x3ca87b));if(_0x3ca87b['error']){if(_0x3ca87b[_0xefb5('0x11')][_0xefb5('0x12')]===0x1f4){logger[_0xefb5('0x11')](_0xefb5('0x13'),_0xdad064,_0x3ca87b[_0xefb5('0x11')][_0xefb5('0x14')]);return _0x4f22ca(_0x3ca87b[_0xefb5('0x11')]['message']);}logger['error'](_0xefb5('0x13'),_0xdad064,_0x3ca87b[_0xefb5('0x11')][_0xefb5('0x14')]);return _0x2d8bd4(_0x3ca87b[_0xefb5('0x11')]['message']);}else{logger[_0xefb5('0x15')](_0xefb5('0x13'),_0xdad064,'request\x20sent');_0x2d8bd4(_0x3ca87b[_0xefb5('0x16')][_0xefb5('0x14')]);}})['catch'](function(_0x3bab73){logger[_0xefb5('0x11')](_0xefb5('0x13'),_0xdad064,_0x3bab73);_0x4f22ca(_0x3bab73);});});} \ No newline at end of file +var _0x2725=['FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2662d2,_0x5040bc){var _0x4f5aea=function(_0x2e52dc){while(--_0x2e52dc){_0x2662d2['push'](_0x2662d2['shift']());}};_0x4f5aea(++_0x5040bc);}(_0x2725,0xbc));var _0x5272=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x2725[_0x4914e2];return _0x2dcd07;};'use strict';var _=require('lodash');var util=require(_0x5272('0x0'));var moment=require(_0x5272('0x1'));var BPromise=require(_0x5272('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('../../config/logger')(_0x5272('0x3'));var config=require(_0x5272('0x4'));var jayson=require(_0x5272('0x5'));var client=jayson[_0x5272('0x6')][_0x5272('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ff56f,_0x12624a,_0x40fc69){return new BPromise(function(_0x918e74,_0x50b4ac){return client['request'](_0x4ff56f,_0x40fc69)[_0x5272('0x8')](function(_0x54514a){logger[_0x5272('0x9')](_0x5272('0xa'),_0x12624a,'request\x20sent');logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x12624a,_0x5272('0xb'),JSON[_0x5272('0xc')](_0x54514a));if(_0x54514a[_0x5272('0xd')]){if(_0x54514a[_0x5272('0xd')][_0x5272('0xe')]===0x1f4){logger[_0x5272('0xd')](_0x5272('0xa'),_0x12624a,_0x54514a[_0x5272('0xd')][_0x5272('0xf')]);return _0x50b4ac(_0x54514a[_0x5272('0xd')][_0x5272('0xf')]);}logger[_0x5272('0xd')](_0x5272('0xa'),_0x12624a,_0x54514a[_0x5272('0xd')]['message']);return _0x918e74(_0x54514a[_0x5272('0xd')][_0x5272('0xf')]);}else{logger[_0x5272('0x9')](_0x5272('0xa'),_0x12624a,_0x5272('0xb'));_0x918e74(_0x54514a[_0x5272('0x10')][_0x5272('0xf')]);}})[_0x5272('0x11')](function(_0x1af2f8){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x12624a,_0x1af2f8);_0x50b4ac(_0x1af2f8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index ebef7cb..e94cdf2 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 _0x0713=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','delete'];(function(_0x1699e5,_0x5245fb){var _0x503e6a=function(_0x4d99ed){while(--_0x4d99ed){_0x1699e5['push'](_0x1699e5['shift']());}};_0x503e6a(++_0x5245fb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getConfigurations']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x10')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x12')]);router['put']('/:id',auth[_0x3071('0x9')](),controller['update']);router[_0x3071('0x13')](_0x3071('0xb'),auth['isAuthenticated'](),controller[_0x3071('0x14')]);module['exports']=router; \ No newline at end of file +var _0x84a0=['isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x84a0,0x66));var _0x084a=function(_0x43b764,_0x22af88){_0x43b764=_0x43b764-0x0;var _0x394e8a=_0x84a0[_0x43b764];return _0x394e8a;};'use strict';var multer=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var path=require(_0x084a('0x2'));var timeout=require(_0x084a('0x3'));var express=require('express');var router=express[_0x084a('0x4')]();var fs_extra=require(_0x084a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x084a('0x6'));var controller=require(_0x084a('0x7'));router['get']('/',auth[_0x084a('0x8')](),controller[_0x084a('0x9')]);router[_0x084a('0xa')](_0x084a('0xb'),auth[_0x084a('0x8')](),controller['show']);router[_0x084a('0xa')](_0x084a('0xc'),auth[_0x084a('0x8')](),controller[_0x084a('0xd')]);router[_0x084a('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x084a('0xe')]);router[_0x084a('0xf')]('/',auth[_0x084a('0x8')](),controller[_0x084a('0x10')]);router[_0x084a('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x084a('0x11')]);router[_0x084a('0x12')](_0x084a('0xb'),auth[_0x084a('0x8')](),controller[_0x084a('0x13')]);router[_0x084a('0x14')](_0x084a('0xb'),auth[_0x084a('0x8')](),controller['destroy']);module[_0x084a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index ad9c7f5..49296be 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 _0x7b84=['sequelize','exports','STRING','username','remoteUri'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x7b84,0x17c));var _0x47b8=function(_0x439ef9,_0x51ec55){_0x439ef9=_0x439ef9-0x0;var _0x63045c=_0x7b84[_0x439ef9];return _0x63045c;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'name':{'type':Sequelize[_0x47b8('0x2')]},'description':{'type':Sequelize[_0x47b8('0x2')]},'username':{'type':Sequelize[_0x47b8('0x2')],'unique':_0x47b8('0x3')},'apiKey':{'type':Sequelize[_0x47b8('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x47b8('0x4')},'serverUrl':{'type':Sequelize[_0x47b8('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xfef3=['sequelize','STRING','username','remoteUri'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfef3,0x118));var _0x3fef=function(_0x4b354f,_0x350965){_0x4b354f=_0x4b354f-0x0;var _0xe3f93c=_0xfef3[_0x4b354f];return _0xe3f93c;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 8914a0c..c912b1d 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 _0x31f7=['path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','count','offset','limit','set','json','apply','reject','update','then','destroy','name','send','index','FreshsalesAccount','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','map','hasOwnProperty','AccountId','Subjects','getSubjects','getDescriptions','channel','FreshsalesField','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x31f7,0x182));var _0x731f=function(_0x419135,_0x4c2695){_0x419135=_0x419135-0x0;var _0x5669d3=_0x31f7[_0x419135];return _0x5669d3;};'use strict';var emlformat=require(_0x731f('0x0'));var rimraf=require(_0x731f('0x1'));var zipdir=require(_0x731f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x731f('0x3'));var moment=require(_0x731f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x731f('0x5'));var util=require('util');var path=require(_0x731f('0x6'));var sox=require(_0x731f('0x7'));var csv=require(_0x731f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x731f('0x9'));var _=require(_0x731f('0xa'));var squel=require(_0x731f('0xb'));var crypto=require('crypto');var jsforce=require(_0x731f('0xc'));var deskjs=require(_0x731f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x731f('0xe'));var Redis=require(_0x731f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x731f('0x10'));var as=require(_0x731f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x731f('0x12'))('api');var utils=require(_0x731f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x731f('0x14'));var db=require(_0x731f('0x15'))['db'];var integrations=require(_0x731f('0x16'));function respondWithStatusCode(_0x4a85b1,_0x191f22){_0x191f22=_0x191f22||0xcc;return function(_0x3ac2a1){if(_0x3ac2a1){return _0x4a85b1[_0x731f('0x17')](_0x191f22);}return _0x4a85b1['status'](_0x191f22)['end']();};}function respondWithResult(_0x8fc94f,_0x38419d){_0x38419d=_0x38419d||0xc8;return function(_0x335441){if(_0x335441){return _0x8fc94f[_0x731f('0x18')](_0x38419d)['json'](_0x335441);}};}function respondWithFilteredResult(_0x38a445,_0x26905c){return function(_0x144db0){if(_0x144db0){var _0x3d1d85=typeof _0x26905c['offset']==='undefined'&&typeof _0x26905c['limit']==='undefined';var _0x4abf6c=_0x144db0[_0x731f('0x19')];var _0x425b73=_0x3d1d85?0x0:_0x26905c[_0x731f('0x1a')];var _0x90cff=_0x3d1d85?_0x144db0[_0x731f('0x19')]:_0x26905c['offset']+_0x26905c[_0x731f('0x1b')];var _0x69f6ac;if(_0x90cff>=_0x4abf6c){_0x90cff=_0x4abf6c;_0x69f6ac=0xc8;}else{_0x69f6ac=0xce;}_0x38a445[_0x731f('0x18')](_0x69f6ac);return _0x38a445[_0x731f('0x1c')]('Content-Range',_0x425b73+'-'+_0x90cff+'/'+_0x4abf6c)[_0x731f('0x1d')](_0x144db0);}return null;};}function patchUpdates(_0x161e55){return function(_0x4f81a1){try{jsonpatch[_0x731f('0x1e')](_0x4f81a1,_0x161e55,!![]);}catch(_0x2768c4){return BPromise[_0x731f('0x1f')](_0x2768c4);}return _0x4f81a1['save']();};}function saveUpdates(_0x41a8ea,_0x37220f){return function(_0x1a3473){if(_0x1a3473){return _0x1a3473[_0x731f('0x20')](_0x41a8ea)[_0x731f('0x21')](function(_0x578cf4){return _0x578cf4;});}return null;};}function removeEntity(_0x2e00d7,_0x47a74c){return function(_0x26dd47){if(_0x26dd47){return _0x26dd47[_0x731f('0x22')]()[_0x731f('0x21')](function(){_0x2e00d7[_0x731f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e534e,_0x160006){return function(_0xd308f4){if(!_0xd308f4){_0x5e534e[_0x731f('0x17')](0x194);}return _0xd308f4;};}function handleError(_0x59f3d4,_0x289f9d){_0x289f9d=_0x289f9d||0x1f4;return function(_0x3a8e59){logger['error'](_0x3a8e59['stack']);if(_0x3a8e59[_0x731f('0x23')]){delete _0x3a8e59[_0x731f('0x23')];}_0x59f3d4[_0x731f('0x18')](_0x289f9d)[_0x731f('0x24')](_0x3a8e59);};}exports[_0x731f('0x25')]=function(_0x2ec71f,_0x162b7b){var _0x431b1b={},_0x2a3cc5={},_0x5a5cd7={'count':0x0,'rows':[]};var _0x3e348f=_['map'](db[_0x731f('0x26')][_0x731f('0x27')],function(_0x547f0c){return{'name':_0x547f0c[_0x731f('0x28')],'type':_0x547f0c['type']['key']};});_0x2a3cc5['model']=_['map'](_0x3e348f,_0x731f('0x23'));_0x2a3cc5[_0x731f('0x29')]=_[_0x731f('0x2a')](_0x2ec71f[_0x731f('0x29')]);_0x2a3cc5['filters']=_[_0x731f('0x2b')](_0x2a3cc5[_0x731f('0x2c')],_0x2a3cc5['query']);_0x431b1b[_0x731f('0x2d')]=_[_0x731f('0x2b')](_0x2a3cc5[_0x731f('0x2c')],qs[_0x731f('0x2e')](_0x2ec71f[_0x731f('0x29')][_0x731f('0x2e')]));_0x431b1b[_0x731f('0x2d')]=_0x431b1b[_0x731f('0x2d')]['length']?_0x431b1b['attributes']:_0x2a3cc5[_0x731f('0x2c')];if(!_0x2ec71f['query']['hasOwnProperty'](_0x731f('0x2f'))){_0x431b1b[_0x731f('0x1b')]=qs[_0x731f('0x1b')](_0x2ec71f['query']['limit']);_0x431b1b[_0x731f('0x1a')]=qs[_0x731f('0x1a')](_0x2ec71f[_0x731f('0x29')][_0x731f('0x1a')]);}_0x431b1b[_0x731f('0x30')]=qs['sort'](_0x2ec71f[_0x731f('0x29')][_0x731f('0x31')]);_0x431b1b[_0x731f('0x32')]=qs[_0x731f('0x33')](_[_0x731f('0x34')](_0x2ec71f[_0x731f('0x29')],_0x2a3cc5[_0x731f('0x33')]),_0x3e348f);if(_0x2ec71f['query'][_0x731f('0x35')]){_0x431b1b[_0x731f('0x32')]=_[_0x731f('0x36')](_0x431b1b[_0x731f('0x32')],{'$or':_['map'](_0x3e348f,function(_0x283a93){if(_0x283a93[_0x731f('0x37')]!==_0x731f('0x38')){var _0x56ee9f={};_0x56ee9f[_0x283a93[_0x731f('0x23')]]={'$like':'%'+_0x2ec71f[_0x731f('0x29')]['filter']+'%'};return _0x56ee9f;}})});}_0x431b1b=_[_0x731f('0x36')]({},_0x431b1b,_0x2ec71f[_0x731f('0x39')]);var _0x2e317f={'where':_0x431b1b[_0x731f('0x32')]};return db['FreshsalesAccount'][_0x731f('0x19')](_0x2e317f)['then'](function(_0x6123e5){_0x5a5cd7[_0x731f('0x19')]=_0x6123e5;if(_0x2ec71f[_0x731f('0x29')]['includeAll']){_0x431b1b[_0x731f('0x3a')]=[{'all':!![]}];}return db[_0x731f('0x26')][_0x731f('0x3b')](_0x431b1b);})['then'](function(_0x5d7296){_0x5a5cd7[_0x731f('0x3c')]=_0x5d7296;return _0x5a5cd7;})[_0x731f('0x21')](respondWithFilteredResult(_0x162b7b,_0x431b1b))[_0x731f('0x3d')](handleError(_0x162b7b,null));};exports[_0x731f('0x3e')]=function(_0xb68d6f,_0x2306a2){var _0x4b5ab4={'raw':![],'where':{'id':_0xb68d6f[_0x731f('0x3f')]['id']}},_0x45174b={};_0x45174b[_0x731f('0x2c')]=_[_0x731f('0x2a')](db[_0x731f('0x26')][_0x731f('0x27')]);_0x45174b[_0x731f('0x29')]=_['keys'](_0xb68d6f['query']);_0x45174b[_0x731f('0x33')]=_['intersection'](_0x45174b['model'],_0x45174b['query']);_0x4b5ab4[_0x731f('0x2d')]=_['intersection'](_0x45174b['model'],qs[_0x731f('0x2e')](_0xb68d6f[_0x731f('0x29')][_0x731f('0x2e')]));_0x4b5ab4[_0x731f('0x2d')]=_0x4b5ab4[_0x731f('0x2d')][_0x731f('0x40')]?_0x4b5ab4[_0x731f('0x2d')]:_0x45174b['model'];if(_0xb68d6f[_0x731f('0x29')][_0x731f('0x41')]){_0x4b5ab4['include']=[{'all':!![]}];}_0x4b5ab4=_[_0x731f('0x36')]({},_0x4b5ab4,_0xb68d6f['options']);return db[_0x731f('0x26')][_0x731f('0x42')](_0x4b5ab4)[_0x731f('0x21')](handleEntityNotFound(_0x2306a2,null))[_0x731f('0x21')](respondWithResult(_0x2306a2,null))['catch'](handleError(_0x2306a2,null));};exports[_0x731f('0x43')]=function(_0x237a83,_0x5e8ac1){return db['FreshsalesAccount'][_0x731f('0x43')](_0x237a83[_0x731f('0x44')],{})[_0x731f('0x21')](respondWithResult(_0x5e8ac1,0xc9))[_0x731f('0x3d')](handleError(_0x5e8ac1,null));};exports[_0x731f('0x20')]=function(_0x5cd062,_0x43d289){if(_0x5cd062[_0x731f('0x44')]['id']){delete _0x5cd062[_0x731f('0x44')]['id'];}return db[_0x731f('0x26')][_0x731f('0x42')]({'where':{'id':_0x5cd062[_0x731f('0x3f')]['id']}})[_0x731f('0x21')](handleEntityNotFound(_0x43d289,null))['then'](saveUpdates(_0x5cd062[_0x731f('0x44')],null))[_0x731f('0x21')](respondWithResult(_0x43d289,null))[_0x731f('0x3d')](handleError(_0x43d289,null));};exports[_0x731f('0x22')]=function(_0x1315c7,_0x44bdb1){return db['FreshsalesAccount']['find']({'where':{'id':_0x1315c7['params']['id']}})['then'](handleEntityNotFound(_0x44bdb1,null))[_0x731f('0x21')](removeEntity(_0x44bdb1,null))[_0x731f('0x3d')](handleError(_0x44bdb1,null));};exports[_0x731f('0x45')]=function(_0x5809ca,_0x34dde5,_0x4d1f5d){var _0x1a6700={};var _0x5cd562={};var _0x2c0ba7;var _0xfbaffd;return db[_0x731f('0x26')][_0x731f('0x46')]({'where':{'id':_0x5809ca['params']['id']}})[_0x731f('0x21')](handleEntityNotFound(_0x34dde5,null))['then'](function(_0x4b55c9){if(_0x4b55c9){_0x2c0ba7=_0x4b55c9;_0x5cd562[_0x731f('0x2c')]=_[_0x731f('0x2a')](db[_0x731f('0x47')][_0x731f('0x27')]);_0x5cd562['query']=_[_0x731f('0x2a')](_0x5809ca[_0x731f('0x29')]);_0x5cd562['filters']=_['intersection'](_0x5cd562['model'],_0x5cd562[_0x731f('0x29')]);_0x1a6700[_0x731f('0x2d')]=_['intersection'](_0x5cd562[_0x731f('0x2c')],qs[_0x731f('0x2e')](_0x5809ca['query'][_0x731f('0x2e')]));_0x1a6700[_0x731f('0x2d')]=_0x1a6700[_0x731f('0x2d')][_0x731f('0x40')]?_0x1a6700[_0x731f('0x2d')]:_0x5cd562[_0x731f('0x2c')];_0x1a6700[_0x731f('0x30')]=qs['sort'](_0x5809ca[_0x731f('0x29')]['sort']);_0x1a6700[_0x731f('0x32')]=qs[_0x731f('0x33')](_[_0x731f('0x34')](_0x5809ca[_0x731f('0x29')],_0x5cd562[_0x731f('0x33')]));if(_0x5809ca['query'][_0x731f('0x35')]){_0x1a6700['where']=_[_0x731f('0x36')](_0x1a6700[_0x731f('0x32')],{'$or':_[_0x731f('0x48')](_0x1a6700[_0x731f('0x2d')],function(_0x1b97ba){var _0x3446b3={};_0x3446b3[_0x1b97ba]={'$like':'%'+_0x5809ca[_0x731f('0x29')][_0x731f('0x35')]+'%'};return _0x3446b3;})});}_0x1a6700=_[_0x731f('0x36')]({},_0x1a6700,_0x5809ca[_0x731f('0x39')]);return _0x2c0ba7[_0x731f('0x45')](_0x1a6700);}})[_0x731f('0x21')](function(_0x22bc90){if(_0x22bc90){_0xfbaffd=_0x22bc90[_0x731f('0x40')];if(!_0x5809ca[_0x731f('0x29')][_0x731f('0x49')](_0x731f('0x2f'))){_0x1a6700[_0x731f('0x1b')]=qs[_0x731f('0x1b')](_0x5809ca['query'][_0x731f('0x1b')]);_0x1a6700['offset']=qs[_0x731f('0x1a')](_0x5809ca[_0x731f('0x29')][_0x731f('0x1a')]);}return _0x2c0ba7['getConfigurations'](_0x1a6700);}})[_0x731f('0x21')](function(_0x37f36c){if(_0x37f36c){return _0x37f36c?{'count':_0xfbaffd,'rows':_0x37f36c}:null;}})[_0x731f('0x21')](respondWithResult(_0x34dde5,null))[_0x731f('0x3d')](handleError(_0x34dde5,null));};exports['addConfiguration']=function(_0x4cbedc,_0x2ee6d6,_0x644e76){if(_0x4cbedc['body']['id']){delete _0x4cbedc['body']['id'];}return db['FreshsalesAccount'][_0x731f('0x46')]({'where':{'id':_0x4cbedc[_0x731f('0x3f')]['id']}})[_0x731f('0x21')](handleEntityNotFound(_0x2ee6d6,null))[_0x731f('0x21')](function(_0x526417){if(_0x526417){_0x4cbedc['body'][_0x731f('0x4a')]=_0x526417['id'];_0x4cbedc[_0x731f('0x44')][_0x731f('0x4b')]=integrations[_0x731f('0x4c')](_0x4cbedc[_0x731f('0x44')]['channel'],_0x4cbedc[_0x731f('0x44')][_0x731f('0x37')]);_0x4cbedc[_0x731f('0x44')]['Descriptions']=integrations[_0x731f('0x4d')](_0x4cbedc[_0x731f('0x44')][_0x731f('0x4e')],_0x4cbedc[_0x731f('0x44')][_0x731f('0x37')]);return db[_0x731f('0x47')]['create'](_0x4cbedc['body'],{'include':[{'model':db[_0x731f('0x4f')],'as':_0x731f('0x4b')},{'model':db[_0x731f('0x4f')],'as':'Descriptions'}]});}return null;})[_0x731f('0x21')](respondWithResult(_0x2ee6d6,null))[_0x731f('0x3d')](handleError(_0x2ee6d6,null));};exports[_0x731f('0x50')]=function(_0x453af9,_0x1824ad,_0x15b6cb){var _0x410eef='';var _0x2a1f67='';return db[_0x731f('0x26')][_0x731f('0x46')]({'where':{'id':_0x453af9[_0x731f('0x3f')]['id']},'attributes':['id','username',_0x731f('0x51'),_0x731f('0x52')]})[_0x731f('0x21')](handleEntityNotFound(_0x1824ad,null))[_0x731f('0x21')](function(_0x3b6f52){if(_0x3b6f52){_0x2a1f67=_0x3b6f52[_0x731f('0x53')];_0x410eef=_0x3b6f52[_0x731f('0x51')];var _0x20f632=_0x3b6f52[_0x731f('0x51')][_0x731f('0x54')](-0x1);if(_0x20f632==='/'){_0x410eef=_0x410eef[_0x731f('0x55')](0x0,_0x410eef[_0x731f('0x56')](_0x20f632));}return rp({'method':'GET','uri':util[_0x731f('0x57')](_0x731f('0x58'),_0x410eef,_0x731f('0x59')),'headers':{'Authorization':_0x731f('0x5a')+_0x3b6f52[_0x731f('0x52')]},'json':!![]});}})['then'](function(_0x53993a){if(_0x53993a){var _0x9216c9=_0x53993a[_0x731f('0x5b')];var _0x595533=![];var _0x45b0dc=null;for(_0x45b0dc=0x0;_0x45b0dc<_0x9216c9['length'];_0x45b0dc++){if(_0x9216c9[_0x45b0dc][_0x731f('0x5c')]===_0x2a1f67){_0x595533=!![];}}if(_0x595533){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x1824ad,null))[_0x731f('0x3d')](function(_0x389647){var _0x421bf8=_0x453af9[_0x731f('0x29')]['test']?0x1f4:_0x389647[_0x731f('0x5d')]||0x1f4;logger[_0x731f('0x5e')](_0x731f('0x5f'),_0x731f('0x50'),_0x421bf8,JSON['stringify'](_0x389647));delete _0x389647[_0x731f('0x23')];if(_0x421bf8===0x191){_0x421bf8=0x190;}_0x1824ad[_0x731f('0x18')](_0x421bf8)['send'](_0x453af9[_0x731f('0x29')][_0x731f('0x60')]?{'message':_0x731f('0x61'),'statusCode':_0x389647[_0x731f('0x5d')]}:_0x389647);});}; \ No newline at end of file +var _0x189f=['filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','FreshsalesConfiguration','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','FreshsalesField','getFields','username','apiKey','remoteUri','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4af53a,_0x4f350f){var _0x232ccb=function(_0x35445d){while(--_0x35445d){_0x4af53a['push'](_0x4af53a['shift']());}};_0x232ccb(++_0x4f350f);}(_0x189f,0x1f4));var _0xf189=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0x189f[_0x2ee790];return _0x5a54a5;};'use strict';var emlformat=require(_0xf189('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf189('0x1'));var jsonpatch=require(_0xf189('0x2'));var rp=require(_0xf189('0x3'));var moment=require(_0xf189('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf189('0x5'));var util=require(_0xf189('0x6'));var path=require('path');var sox=require(_0xf189('0x7'));var csv=require(_0xf189('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf189('0x9'));var crypto=require('crypto');var jsforce=require(_0xf189('0xa'));var deskjs=require(_0xf189('0xb'));var toCsv=require(_0xf189('0x8'));var querystring=require(_0xf189('0xc'));var Papa=require(_0xf189('0xd'));var Redis=require(_0xf189('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf189('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf189('0x10'));var logger=require('../../config/logger')(_0xf189('0x11'));var utils=require(_0xf189('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf189('0x13'));var db=require(_0xf189('0x14'))['db'];var integrations=require(_0xf189('0x15'));function respondWithStatusCode(_0x1de3de,_0x35aa2a){_0x35aa2a=_0x35aa2a||0xcc;return function(_0x11aeae){if(_0x11aeae){return _0x1de3de[_0xf189('0x16')](_0x35aa2a);}return _0x1de3de[_0xf189('0x17')](_0x35aa2a)[_0xf189('0x18')]();};}function respondWithResult(_0x1a1b5b,_0x181628){_0x181628=_0x181628||0xc8;return function(_0x61d755){if(_0x61d755){return _0x1a1b5b[_0xf189('0x17')](_0x181628)[_0xf189('0x19')](_0x61d755);}};}function respondWithFilteredResult(_0x10ceca,_0x213289){return function(_0x31c515){if(_0x31c515){var _0x574cdc=typeof _0x213289[_0xf189('0x1a')]===_0xf189('0x1b')&&typeof _0x213289['limit']==='undefined';var _0x5c3322=_0x31c515[_0xf189('0x1c')];var _0x1c32bd=_0x574cdc?0x0:_0x213289[_0xf189('0x1a')];var _0x444e16=_0x574cdc?_0x31c515['count']:_0x213289[_0xf189('0x1a')]+_0x213289[_0xf189('0x1d')];var _0x43367;if(_0x444e16>=_0x5c3322){_0x444e16=_0x5c3322;_0x43367=0xc8;}else{_0x43367=0xce;}_0x10ceca[_0xf189('0x17')](_0x43367);return _0x10ceca[_0xf189('0x1e')](_0xf189('0x1f'),_0x1c32bd+'-'+_0x444e16+'/'+_0x5c3322)['json'](_0x31c515);}return null;};}function patchUpdates(_0x2718d3){return function(_0x23dd23){try{jsonpatch['apply'](_0x23dd23,_0x2718d3,!![]);}catch(_0x43668b){return BPromise[_0xf189('0x20')](_0x43668b);}return _0x23dd23['save']();};}function saveUpdates(_0x585908,_0x3fae94){return function(_0x1c24bc){if(_0x1c24bc){return _0x1c24bc[_0xf189('0x21')](_0x585908)[_0xf189('0x22')](function(_0x4df0b3){return _0x4df0b3;});}return null;};}function removeEntity(_0x566e8d,_0x42c0a5){return function(_0x27613f){if(_0x27613f){return _0x27613f[_0xf189('0x23')]()['then'](function(){_0x566e8d['status'](0xcc)[_0xf189('0x18')]();});}};}function handleEntityNotFound(_0x412eaf,_0x4e6424){return function(_0x5de176){if(!_0x5de176){_0x412eaf[_0xf189('0x16')](0x194);}return _0x5de176;};}function handleError(_0x3c010a,_0x254316){_0x254316=_0x254316||0x1f4;return function(_0x297813){logger['error'](_0x297813['stack']);if(_0x297813[_0xf189('0x24')]){delete _0x297813[_0xf189('0x24')];}_0x3c010a[_0xf189('0x17')](_0x254316)[_0xf189('0x25')](_0x297813);};}exports[_0xf189('0x26')]=function(_0x884abb,_0x26d8cc){var _0x52daf8={},_0x1bd4a0={},_0x3d5cad={'count':0x0,'rows':[]};var _0x3bba43=_['map'](db[_0xf189('0x27')][_0xf189('0x28')],function(_0x3377f0){return{'name':_0x3377f0[_0xf189('0x29')],'type':_0x3377f0[_0xf189('0x2a')]['key']};});_0x1bd4a0[_0xf189('0x2b')]=_[_0xf189('0x2c')](_0x3bba43,'name');_0x1bd4a0[_0xf189('0x2d')]=_[_0xf189('0x2e')](_0x884abb[_0xf189('0x2d')]);_0x1bd4a0[_0xf189('0x2f')]=_['intersection'](_0x1bd4a0['model'],_0x1bd4a0[_0xf189('0x2d')]);_0x52daf8[_0xf189('0x30')]=_[_0xf189('0x31')](_0x1bd4a0[_0xf189('0x2b')],qs[_0xf189('0x32')](_0x884abb['query'][_0xf189('0x32')]));_0x52daf8[_0xf189('0x30')]=_0x52daf8[_0xf189('0x30')][_0xf189('0x33')]?_0x52daf8[_0xf189('0x30')]:_0x1bd4a0[_0xf189('0x2b')];if(!_0x884abb[_0xf189('0x2d')][_0xf189('0x34')](_0xf189('0x35'))){_0x52daf8['limit']=qs['limit'](_0x884abb['query'][_0xf189('0x1d')]);_0x52daf8['offset']=qs[_0xf189('0x1a')](_0x884abb['query'][_0xf189('0x1a')]);}_0x52daf8[_0xf189('0x36')]=qs['sort'](_0x884abb['query'][_0xf189('0x37')]);_0x52daf8[_0xf189('0x38')]=qs[_0xf189('0x2f')](_[_0xf189('0x39')](_0x884abb[_0xf189('0x2d')],_0x1bd4a0[_0xf189('0x2f')]),_0x3bba43);if(_0x884abb[_0xf189('0x2d')][_0xf189('0x3a')]){_0x52daf8[_0xf189('0x38')]=_[_0xf189('0x3b')](_0x52daf8[_0xf189('0x38')],{'$or':_[_0xf189('0x2c')](_0x3bba43,function(_0x3e719e){if(_0x3e719e[_0xf189('0x2a')]!==_0xf189('0x3c')){var _0x8fa8d7={};_0x8fa8d7[_0x3e719e[_0xf189('0x24')]]={'$like':'%'+_0x884abb[_0xf189('0x2d')][_0xf189('0x3a')]+'%'};return _0x8fa8d7;}})});}_0x52daf8=_[_0xf189('0x3b')]({},_0x52daf8,_0x884abb[_0xf189('0x3d')]);var _0x5412a7={'where':_0x52daf8['where']};return db[_0xf189('0x27')]['count'](_0x5412a7)['then'](function(_0x51ce49){_0x3d5cad[_0xf189('0x1c')]=_0x51ce49;if(_0x884abb[_0xf189('0x2d')][_0xf189('0x3e')]){_0x52daf8[_0xf189('0x3f')]=[{'all':!![]}];}return db[_0xf189('0x27')]['findAll'](_0x52daf8);})[_0xf189('0x22')](function(_0x2c7d1e){_0x3d5cad[_0xf189('0x40')]=_0x2c7d1e;return _0x3d5cad;})[_0xf189('0x22')](respondWithFilteredResult(_0x26d8cc,_0x52daf8))[_0xf189('0x41')](handleError(_0x26d8cc,null));};exports['show']=function(_0x503470,_0x26d898){var _0x466bd8={'raw':![],'where':{'id':_0x503470[_0xf189('0x42')]['id']}},_0x585a1a={};_0x585a1a[_0xf189('0x2b')]=_[_0xf189('0x2e')](db[_0xf189('0x27')][_0xf189('0x28')]);_0x585a1a[_0xf189('0x2d')]=_['keys'](_0x503470[_0xf189('0x2d')]);_0x585a1a[_0xf189('0x2f')]=_[_0xf189('0x31')](_0x585a1a[_0xf189('0x2b')],_0x585a1a['query']);_0x466bd8['attributes']=_['intersection'](_0x585a1a[_0xf189('0x2b')],qs[_0xf189('0x32')](_0x503470['query'][_0xf189('0x32')]));_0x466bd8['attributes']=_0x466bd8[_0xf189('0x30')][_0xf189('0x33')]?_0x466bd8[_0xf189('0x30')]:_0x585a1a[_0xf189('0x2b')];if(_0x503470[_0xf189('0x2d')][_0xf189('0x3e')]){_0x466bd8['include']=[{'all':!![]}];}_0x466bd8=_[_0xf189('0x3b')]({},_0x466bd8,_0x503470[_0xf189('0x3d')]);return db[_0xf189('0x27')]['find'](_0x466bd8)[_0xf189('0x22')](handleEntityNotFound(_0x26d898,null))[_0xf189('0x22')](respondWithResult(_0x26d898,null))[_0xf189('0x41')](handleError(_0x26d898,null));};exports[_0xf189('0x43')]=function(_0x2e132d,_0x27f860){return db[_0xf189('0x27')][_0xf189('0x43')](_0x2e132d['body'],{})[_0xf189('0x22')](respondWithResult(_0x27f860,0xc9))['catch'](handleError(_0x27f860,null));};exports['update']=function(_0x5b74a9,_0x46e5a0){if(_0x5b74a9[_0xf189('0x44')]['id']){delete _0x5b74a9[_0xf189('0x44')]['id'];}return db[_0xf189('0x27')][_0xf189('0x45')]({'where':{'id':_0x5b74a9['params']['id']}})[_0xf189('0x22')](handleEntityNotFound(_0x46e5a0,null))['then'](saveUpdates(_0x5b74a9[_0xf189('0x44')],null))['then'](respondWithResult(_0x46e5a0,null))[_0xf189('0x41')](handleError(_0x46e5a0,null));};exports['destroy']=function(_0x10fda3,_0x1277f4){return db[_0xf189('0x27')][_0xf189('0x45')]({'where':{'id':_0x10fda3[_0xf189('0x42')]['id']}})[_0xf189('0x22')](handleEntityNotFound(_0x1277f4,null))[_0xf189('0x22')](removeEntity(_0x1277f4,null))[_0xf189('0x41')](handleError(_0x1277f4,null));};exports['getConfigurations']=function(_0x5b4325,_0x81830b,_0x426a44){var _0x4270bb={};var _0x1d0763={};var _0x34c4bd;var _0x36638d;return db[_0xf189('0x27')]['findOne']({'where':{'id':_0x5b4325['params']['id']}})[_0xf189('0x22')](handleEntityNotFound(_0x81830b,null))[_0xf189('0x22')](function(_0x326251){if(_0x326251){_0x34c4bd=_0x326251;_0x1d0763[_0xf189('0x2b')]=_[_0xf189('0x2e')](db[_0xf189('0x46')][_0xf189('0x28')]);_0x1d0763[_0xf189('0x2d')]=_[_0xf189('0x2e')](_0x5b4325[_0xf189('0x2d')]);_0x1d0763[_0xf189('0x2f')]=_[_0xf189('0x31')](_0x1d0763[_0xf189('0x2b')],_0x1d0763[_0xf189('0x2d')]);_0x4270bb['attributes']=_['intersection'](_0x1d0763[_0xf189('0x2b')],qs[_0xf189('0x32')](_0x5b4325[_0xf189('0x2d')][_0xf189('0x32')]));_0x4270bb[_0xf189('0x30')]=_0x4270bb[_0xf189('0x30')][_0xf189('0x33')]?_0x4270bb['attributes']:_0x1d0763[_0xf189('0x2b')];_0x4270bb[_0xf189('0x36')]=qs[_0xf189('0x37')](_0x5b4325[_0xf189('0x2d')][_0xf189('0x37')]);_0x4270bb[_0xf189('0x38')]=qs[_0xf189('0x2f')](_['pick'](_0x5b4325[_0xf189('0x2d')],_0x1d0763[_0xf189('0x2f')]));if(_0x5b4325[_0xf189('0x2d')][_0xf189('0x3a')]){_0x4270bb[_0xf189('0x38')]=_[_0xf189('0x3b')](_0x4270bb[_0xf189('0x38')],{'$or':_[_0xf189('0x2c')](_0x4270bb[_0xf189('0x30')],function(_0x3ff3cb){var _0x27eee6={};_0x27eee6[_0x3ff3cb]={'$like':'%'+_0x5b4325[_0xf189('0x2d')][_0xf189('0x3a')]+'%'};return _0x27eee6;})});}_0x4270bb=_[_0xf189('0x3b')]({},_0x4270bb,_0x5b4325[_0xf189('0x3d')]);return _0x34c4bd['getConfigurations'](_0x4270bb);}})['then'](function(_0x236312){if(_0x236312){_0x36638d=_0x236312[_0xf189('0x33')];if(!_0x5b4325[_0xf189('0x2d')][_0xf189('0x34')](_0xf189('0x35'))){_0x4270bb['limit']=qs['limit'](_0x5b4325['query'][_0xf189('0x1d')]);_0x4270bb[_0xf189('0x1a')]=qs[_0xf189('0x1a')](_0x5b4325['query'][_0xf189('0x1a')]);}return _0x34c4bd['getConfigurations'](_0x4270bb);}})['then'](function(_0x553eb2){if(_0x553eb2){return _0x553eb2?{'count':_0x36638d,'rows':_0x553eb2}:null;}})[_0xf189('0x22')](respondWithResult(_0x81830b,null))['catch'](handleError(_0x81830b,null));};exports[_0xf189('0x47')]=function(_0x2aea59,_0x51b64d,_0x1a8bb6){if(_0x2aea59[_0xf189('0x44')]['id']){delete _0x2aea59[_0xf189('0x44')]['id'];}return db[_0xf189('0x27')][_0xf189('0x48')]({'where':{'id':_0x2aea59[_0xf189('0x42')]['id']}})[_0xf189('0x22')](handleEntityNotFound(_0x51b64d,null))[_0xf189('0x22')](function(_0xa9a83d){if(_0xa9a83d){_0x2aea59[_0xf189('0x44')][_0xf189('0x49')]=_0xa9a83d['id'];_0x2aea59[_0xf189('0x44')][_0xf189('0x4a')]=integrations['getSubjects'](_0x2aea59['body'][_0xf189('0x4b')],_0x2aea59['body'][_0xf189('0x2a')]);_0x2aea59[_0xf189('0x44')][_0xf189('0x4c')]=integrations['getDescriptions'](_0x2aea59[_0xf189('0x44')]['channel'],_0x2aea59['body'][_0xf189('0x2a')]);return db[_0xf189('0x46')]['create'](_0x2aea59['body'],{'include':[{'model':db[_0xf189('0x4d')],'as':_0xf189('0x4a')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0xf189('0x22')](respondWithResult(_0x51b64d,null))[_0xf189('0x41')](handleError(_0x51b64d,null));};exports[_0xf189('0x4e')]=function(_0x4d8fc9,_0x2a5b72,_0x34be3b){var _0xb7d31c='';var _0x20f5dc='';return db[_0xf189('0x27')]['findOne']({'where':{'id':_0x4d8fc9['params']['id']},'attributes':['id',_0xf189('0x4f'),'remoteUri',_0xf189('0x50')]})[_0xf189('0x22')](handleEntityNotFound(_0x2a5b72,null))['then'](function(_0x4d2cd7){if(_0x4d2cd7){_0x20f5dc=_0x4d2cd7[_0xf189('0x4f')];_0xb7d31c=_0x4d2cd7[_0xf189('0x51')];var _0x335b01=_0x4d2cd7[_0xf189('0x51')]['slice'](-0x1);if(_0x335b01==='/'){_0xb7d31c=_0xb7d31c[_0xf189('0x52')](0x0,_0xb7d31c[_0xf189('0x53')](_0x335b01));}return rp({'method':_0xf189('0x54'),'uri':util[_0xf189('0x55')](_0xf189('0x56'),_0xb7d31c,'/api/selector/owners'),'headers':{'Authorization':_0xf189('0x57')+_0x4d2cd7['apiKey']},'json':!![]});}})[_0xf189('0x22')](function(_0x2d2283){if(_0x2d2283){var _0x3394c2=_0x2d2283[_0xf189('0x58')];var _0x31f720=![];var _0x565f62=null;for(_0x565f62=0x0;_0x565f62<_0x3394c2['length'];_0x565f62++){if(_0x3394c2[_0x565f62]['email']===_0x20f5dc){_0x31f720=!![];}}if(_0x31f720){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf189('0x59')});}}})['then'](respondWithResult(_0x2a5b72,null))[_0xf189('0x41')](function(_0x23f521){var _0x1b4fc9=_0x4d8fc9[_0xf189('0x2d')]['test']?0x1f4:_0x23f521['statusCode']||0x1f4;logger[_0xf189('0x5a')](_0xf189('0x5b'),'getFields',_0x1b4fc9,JSON['stringify'](_0x23f521));delete _0x23f521[_0xf189('0x24')];if(_0x1b4fc9===0x191){_0x1b4fc9=0x190;}_0x2a5b72[_0xf189('0x17')](_0x1b4fc9)[_0xf189('0x25')](_0x4d8fc9[_0xf189('0x2d')]['test']?{'message':_0xf189('0x5c'),'statusCode':_0x23f521['statusCode']}:_0x23f521);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index d93ac35..75f98bf 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 _0x77d4=['../../components/integrations/configuration','exports','int_freshsales_accounts','util','api','bluebird','request-promise','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x5cd3cd,_0x595978){var _0x1423e8=function(_0x15f1c1){while(--_0x15f1c1){_0x5cd3cd['push'](_0x5cd3cd['shift']());}};_0x1423e8(++_0x595978);}(_0x77d4,0x108));var _0x477d=function(_0x2f888d,_0x597d3c){_0x2f888d=_0x2f888d-0x0;var _0x40f285=_0x77d4[_0x2f888d];return _0x40f285;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var logger=require('../../config/logger')(_0x477d('0x1'));var moment=require('moment');var BPromise=require(_0x477d('0x2'));var rp=require(_0x477d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x477d('0x4'));var attributes=require(_0x477d('0x5'));var integrations=require(_0x477d('0x6'));module[_0x477d('0x7')]=function(_0x2545e5,_0x45ca2d){return _0x2545e5['define']('FreshsalesAccount',attributes,{'tableName':_0x477d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util'];(function(_0x2b6593,_0x2c5e04){var _0x59ccf4=function(_0x371d5e){while(--_0x371d5e){_0x2b6593['push'](_0x2b6593['shift']());}};_0x59ccf4(++_0x2c5e04);}(_0x9a5a,0x194));var _0xa9a5=function(_0x5c4fb3,_0xc08426){_0x5c4fb3=_0x5c4fb3-0x0;var _0x5b57e6=_0x9a5a[_0x5c4fb3];return _0x5b57e6;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));var integrations=require(_0xa9a5('0xa'));module['exports']=function(_0xb0ccd9,_0x37e93b){return _0xb0ccd9[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'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 5f45640..068b638 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 _0xe3da=['then','GetFreshsalesAccount','catch','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x5bc38d,_0x1bc1d2){var _0x5e1e92=function(_0x480f43){while(--_0x480f43){_0x5bc38d['push'](_0x5bc38d['shift']());}};_0x5e1e92(++_0x1bc1d2);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'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['GetFreshsalesAccount']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')]({'raw':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f8cf9['options']?_0x3f8cf9[_0xae3d('0x1a')]['where']||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1d')]||null:null,'include':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')],function(_0x37f5ff){return{'model':db[_0x37f5ff[_0xae3d('0x20')]],'as':_0x37f5ff['as'],'attributes':_0x37f5ff[_0xae3d('0x1c')],'include':_0x37f5ff[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x37f5ff[_0xae3d('0x1e')],function(_0x2131e9){return{'model':db[_0x2131e9[_0xae3d('0x20')]],'as':_0x2131e9['as'],'attributes':_0x2131e9['attributes'],'include':_0x2131e9[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x2131e9[_0xae3d('0x1e')],function(_0x52df0f){return{'model':db[_0x52df0f[_0xae3d('0x20')]],'as':_0x52df0f['as'],'attributes':_0x52df0f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x54c1e1){logger['info'](_0xae3d('0x22'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x22'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x54c1e1));_0x558e42(_0x54c1e1);})[_0xae3d('0x23')](function(_0x561371){logger[_0xae3d('0x14')](_0xae3d('0x22'),_0x561371['message'],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x561371[_0xae3d('0x16')]));});});};exports[_0xae3d('0x24')]=function(_0x46f484){var _0x432c04=this;return new Promise(function(_0x6ef13c,_0x5356d4){return db['FreshsalesAccount']['find']({'raw':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x46f484[_0xae3d('0x1a')]?_0x46f484['options'][_0xae3d('0x25')]||null:null,'attributes':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'include':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1e')]?_['map'](_0x46f484[_0xae3d('0x1a')]['include'],function(_0x55aae4){return{'model':db[_0x55aae4[_0xae3d('0x20')]],'as':_0x55aae4['as'],'attributes':_0x55aae4['attributes'],'include':_0x55aae4[_0xae3d('0x1e')]?_['map'](_0x55aae4['include'],function(_0x1a28b5){return{'model':db[_0x1a28b5[_0xae3d('0x20')]],'as':_0x1a28b5['as'],'attributes':_0x1a28b5[_0xae3d('0x1c')],'include':_0x1a28b5['include']?_[_0xae3d('0x1f')](_0x1a28b5['include'],function(_0xce647f){return{'model':db[_0xce647f[_0xae3d('0x20')]],'as':_0xce647f['as'],'attributes':_0xce647f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x18c469){logger[_0xae3d('0xe')](_0xae3d('0x24'),_0x46f484);logger[_0xae3d('0x11')](_0xae3d('0x24'),_0x46f484,JSON[_0xae3d('0x13')](_0x18c469));_0x6ef13c(_0x18c469);})[_0xae3d('0x23')](function(_0x5543ee){logger['error'](_0xae3d('0x24'),_0x5543ee['message'],_0x46f484);_0x5356d4(_0x432c04[_0xae3d('0x14')](0x1f4,_0x5543ee[_0xae3d('0x16')]));});});}; \ No newline at end of file +var _0x57ca=['then','debug','ShowFreshsalesAccount','find','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x1d5906,_0xdd3a39){var _0xe94622=function(_0x2a4681){while(--_0x2a4681){_0x1d5906['push'](_0x1d5906['shift']());}};_0xe94622(++_0xdd3a39);}(_0x57ca,0x108));var _0xa57c=function(_0x4d7167,_0x210618){_0x4d7167=_0x4d7167-0x0;var _0x15a303=_0x57ca[_0x4d7167];return _0x15a303;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});}exports[_0xa57c('0x15')]=function(_0x3d781d){var _0x93462c=this;return new Promise(function(_0xe3d505,_0x1fd0d8){return db[_0xa57c('0x16')][_0xa57c('0x17')]({'raw':_0x3d781d[_0xa57c('0x18')]?_0x3d781d['options'][_0xa57c('0x19')]===undefined?!![]:![]:!![],'where':_0x3d781d['options']?_0x3d781d['options'][_0xa57c('0x1a')]||null:null,'attributes':_0x3d781d[_0xa57c('0x18')]?_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1b')]||null:null,'limit':_0x3d781d['options']?_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1c')]||null:null,'include':_0x3d781d[_0xa57c('0x18')]?_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1d')],function(_0x2e99ed){return{'model':db[_0x2e99ed[_0xa57c('0x1f')]],'as':_0x2e99ed['as'],'attributes':_0x2e99ed[_0xa57c('0x1b')],'include':_0x2e99ed[_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x2e99ed[_0xa57c('0x1d')],function(_0x431bec){return{'model':db[_0x431bec['model']],'as':_0x431bec['as'],'attributes':_0x431bec[_0xa57c('0x1b')],'include':_0x431bec[_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x431bec[_0xa57c('0x1d')],function(_0x315ad7){return{'model':db[_0x315ad7[_0xa57c('0x1f')]],'as':_0x315ad7['as'],'attributes':_0x315ad7[_0xa57c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa57c('0x20')](function(_0x337f97){logger[_0xa57c('0xc')]('GetFreshsalesAccount',_0x3d781d);logger[_0xa57c('0x21')]('GetFreshsalesAccount',_0x3d781d,JSON['stringify'](_0x337f97));_0xe3d505(_0x337f97);})[_0xa57c('0x14')](function(_0x7d10ec){logger['error'](_0xa57c('0x15'),_0x7d10ec[_0xa57c('0x12')],_0x3d781d);_0x1fd0d8(_0x93462c[_0xa57c('0xf')](0x1f4,_0x7d10ec['message']));});});};exports[_0xa57c('0x22')]=function(_0x58d46f){var _0xf5f70c=this;return new Promise(function(_0x5464f2,_0x2a3bbe){return db['FreshsalesAccount'][_0xa57c('0x23')]({'raw':_0x58d46f['options']?_0x58d46f[_0xa57c('0x18')][_0xa57c('0x19')]===undefined?!![]:![]:!![],'where':_0x58d46f[_0xa57c('0x18')]?_0x58d46f[_0xa57c('0x18')][_0xa57c('0x1a')]||null:null,'attributes':_0x58d46f[_0xa57c('0x18')]?_0x58d46f[_0xa57c('0x18')]['attributes']||null:null,'include':_0x58d46f[_0xa57c('0x18')]?_0x58d46f['options'][_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x58d46f[_0xa57c('0x18')]['include'],function(_0x289174){return{'model':db[_0x289174['model']],'as':_0x289174['as'],'attributes':_0x289174[_0xa57c('0x1b')],'include':_0x289174['include']?_[_0xa57c('0x1e')](_0x289174['include'],function(_0x433116){return{'model':db[_0x433116[_0xa57c('0x1f')]],'as':_0x433116['as'],'attributes':_0x433116['attributes'],'include':_0x433116[_0xa57c('0x1d')]?_['map'](_0x433116[_0xa57c('0x1d')],function(_0x5c56d3){return{'model':db[_0x5c56d3[_0xa57c('0x1f')]],'as':_0x5c56d3['as'],'attributes':_0x5c56d3[_0xa57c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa57c('0x20')](function(_0x62f697){logger[_0xa57c('0xc')](_0xa57c('0x22'),_0x58d46f);logger['debug']('ShowFreshsalesAccount',_0x58d46f,JSON[_0xa57c('0x24')](_0x62f697));_0x5464f2(_0x62f697);})[_0xa57c('0x14')](function(_0x2c70d6){logger['error'](_0xa57c('0x22'),_0x2c70d6['message'],_0x58d46f);_0x2a3bbe(_0xf5f70c[_0xa57c('0xf')](0x1f4,_0x2c70d6[_0xa57c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 51b1e88..ae1b61a 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 _0xff32=['../../config/environment','isAuthenticated','index','show','get','/:id/descriptions','getDescriptions','/:id/fields','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x12916b,_0x3ba82d){var _0x58d533=function(_0xd83c7c){while(--_0xd83c7c){_0x12916b['push'](_0x12916b['shift']());}};_0x58d533(++_0x3ba82d);}(_0xff32,0x93));var _0x2ff3=function(_0xe7dfa7,_0x3d17ee){_0xe7dfa7=_0xe7dfa7-0x0;var _0x1a9fbf=_0xff32[_0xe7dfa7];return _0x1a9fbf;};'use strict';var multer=require(_0x2ff3('0x0'));var util=require(_0x2ff3('0x1'));var path=require(_0x2ff3('0x2'));var timeout=require(_0x2ff3('0x3'));var express=require('express');var router=express[_0x2ff3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ff3('0x5'));var interaction=require(_0x2ff3('0x6'));var config=require(_0x2ff3('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0x2ff3('0x8')](),controller[_0x2ff3('0x9')]);router['get']('/:id',auth[_0x2ff3('0x8')](),controller[_0x2ff3('0xa')]);router[_0x2ff3('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x2ff3('0xb')](_0x2ff3('0xc'),auth['isAuthenticated'](),controller[_0x2ff3('0xd')]);router[_0x2ff3('0xb')](_0x2ff3('0xe'),auth[_0x2ff3('0x8')](),controller['getFields']);router['post']('/',auth[_0x2ff3('0x8')](),controller[_0x2ff3('0xf')]);router[_0x2ff3('0x10')](_0x2ff3('0x11'),auth[_0x2ff3('0x8')](),controller[_0x2ff3('0x12')]);router[_0x2ff3('0x13')](_0x2ff3('0x11'),auth[_0x2ff3('0x8')](),controller[_0x2ff3('0x14')]);module[_0x2ff3('0x15')]=router; \ No newline at end of file +var _0x1bd1=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','put','delete','destroy'];(function(_0x492445,_0x1454f9){var _0x34ca20=function(_0x33e606){while(--_0x33e606){_0x492445['push'](_0x492445['shift']());}};_0x34ca20(++_0x1454f9);}(_0x1bd1,0xd3));var _0x11bd=function(_0x18bd98,_0x56d69d){_0x18bd98=_0x18bd98-0x0;var _0x404e0c=_0x1bd1[_0x18bd98];return _0x404e0c;};'use strict';var multer=require(_0x11bd('0x0'));var util=require(_0x11bd('0x1'));var path=require(_0x11bd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x11bd('0x3')]();var fs_extra=require(_0x11bd('0x4'));var auth=require(_0x11bd('0x5'));var interaction=require(_0x11bd('0x6'));var config=require(_0x11bd('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x11bd('0x8')]('/',auth[_0x11bd('0x9')](),controller['index']);router['get'](_0x11bd('0xa'),auth[_0x11bd('0x9')](),controller[_0x11bd('0xb')]);router[_0x11bd('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x11bd('0xc')]);router[_0x11bd('0x8')](_0x11bd('0xd'),auth[_0x11bd('0x9')](),controller[_0x11bd('0xe')]);router[_0x11bd('0x8')](_0x11bd('0xf'),auth[_0x11bd('0x9')](),controller[_0x11bd('0x10')]);router['post']('/',auth[_0x11bd('0x9')](),controller['create']);router[_0x11bd('0x11')](_0x11bd('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x11bd('0x12')]('/:id',auth[_0x11bd('0x9')](),controller[_0x11bd('0x13')]);module[_0x11bd('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 531678c..e63f947 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 _0x35ec=['exports','sequelize'];(function(_0x2d73a6,_0x224975){var _0x1effc7=function(_0x2e9ff2){while(--_0x2e9ff2){_0x2d73a6['push'](_0x2d73a6['shift']());}};_0x1effc7(++_0x224975);}(_0x35ec,0x113));var _0xc35e=function(_0x255e05,_0x2b5fa4){_0x255e05=_0x255e05-0x0;var _0x5f3fa7=_0x35ec[_0x255e05];return _0x5f3fa7;};'use strict';var Sequelize=require(_0xc35e('0x0'));module[_0xc35e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1c0a=['STRING','exports'];(function(_0x26a427,_0x127e68){var _0x4bd45b=function(_0x41a6f8){while(--_0x41a6f8){_0x26a427['push'](_0x26a427['shift']());}};_0x4bd45b(++_0x127e68);}(_0x1c0a,0x99));var _0xa1c0=function(_0x55cbe6,_0x1dfa5a){_0x55cbe6=_0x55cbe6-0x0;var _0x26cb04=_0x1c0a[_0x55cbe6];return _0x26cb04;};'use strict';var Sequelize=require('sequelize');module[_0xa1c0('0x0')]={'name':{'type':Sequelize[_0xa1c0('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index d8677c1..45cff67 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 _0x9366=['rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','find','catch','create','body','params','getSubjects','intersection','pick','getDescriptions','FreshsalesField','getFields','findOne','nolimit','eml-format'];(function(_0x2e7d57,_0x349ef4){var _0x2cae2c=function(_0x5a3c23){while(--_0x5a3c23){_0x2e7d57['push'](_0x2e7d57['shift']());}};_0x2cae2c(++_0x349ef4);}(_0x9366,0xf8));var _0x6936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9366[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6936('0x0'));var rimraf=require(_0x6936('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6936('0x2'));var moment=require(_0x6936('0x3'));var BPromise=require(_0x6936('0x4'));var Mustache=require(_0x6936('0x5'));var util=require(_0x6936('0x6'));var path=require(_0x6936('0x7'));var sox=require(_0x6936('0x8'));var csv=require('to-csv');var ejs=require(_0x6936('0x9'));var fs=require('fs');var fs_extra=require(_0x6936('0xa'));var _=require('lodash');var squel=require(_0x6936('0xb'));var crypto=require(_0x6936('0xc'));var jsforce=require(_0x6936('0xd'));var deskjs=require(_0x6936('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6936('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6936('0x10'));var as=require(_0x6936('0x11'));var hardwareService=require(_0x6936('0x12'));var logger=require(_0x6936('0x13'))('api');var utils=require(_0x6936('0x14'));var config=require(_0x6936('0x15'));var licenseUtil=require(_0x6936('0x16'));var db=require(_0x6936('0x17'))['db'];function respondWithStatusCode(_0x24b515,_0x5adbca){_0x5adbca=_0x5adbca||0xcc;return function(_0x2c7c13){if(_0x2c7c13){return _0x24b515[_0x6936('0x18')](_0x5adbca);}return _0x24b515['status'](_0x5adbca)[_0x6936('0x19')]();};}function respondWithResult(_0x193778,_0x1e9bf6){_0x1e9bf6=_0x1e9bf6||0xc8;return function(_0x31d080){if(_0x31d080){return _0x193778[_0x6936('0x1a')](_0x1e9bf6)['json'](_0x31d080);}};}function respondWithFilteredResult(_0xe8c32d,_0x250ba6){return function(_0x4974bd){if(_0x4974bd){var _0x5673f3=typeof _0x250ba6[_0x6936('0x1b')]==='undefined'&&typeof _0x250ba6[_0x6936('0x1c')]===_0x6936('0x1d');var _0x289d21=_0x4974bd[_0x6936('0x1e')];var _0x567cf0=_0x5673f3?0x0:_0x250ba6['offset'];var _0x140127=_0x5673f3?_0x4974bd['count']:_0x250ba6[_0x6936('0x1b')]+_0x250ba6[_0x6936('0x1c')];var _0x489096;if(_0x140127>=_0x289d21){_0x140127=_0x289d21;_0x489096=0xc8;}else{_0x489096=0xce;}_0xe8c32d[_0x6936('0x1a')](_0x489096);return _0xe8c32d[_0x6936('0x1f')](_0x6936('0x20'),_0x567cf0+'-'+_0x140127+'/'+_0x289d21)[_0x6936('0x21')](_0x4974bd);}return null;};}function patchUpdates(_0x53ca7c){return function(_0xdfee5a){try{jsonpatch[_0x6936('0x22')](_0xdfee5a,_0x53ca7c,!![]);}catch(_0x220eaf){return BPromise[_0x6936('0x23')](_0x220eaf);}return _0xdfee5a[_0x6936('0x24')]();};}function saveUpdates(_0x548bc9,_0x140f40){return function(_0x2f003d){if(_0x2f003d){return _0x2f003d[_0x6936('0x25')](_0x548bc9)['then'](function(_0x347c3f){return _0x347c3f;});}return null;};}function removeEntity(_0x23ffb1,_0x57cd25){return function(_0x1294ac){if(_0x1294ac){return _0x1294ac[_0x6936('0x26')]()[_0x6936('0x27')](function(){_0x23ffb1[_0x6936('0x1a')](0xcc)[_0x6936('0x19')]();});}};}function handleEntityNotFound(_0x2ec16d,_0x11c2ad){return function(_0x4f1981){if(!_0x4f1981){_0x2ec16d[_0x6936('0x18')](0x194);}return _0x4f1981;};}function handleError(_0x51d47e,_0xc98e65){_0xc98e65=_0xc98e65||0x1f4;return function(_0x331007){logger[_0x6936('0x28')](_0x331007[_0x6936('0x29')]);if(_0x331007[_0x6936('0x2a')]){delete _0x331007[_0x6936('0x2a')];}_0x51d47e[_0x6936('0x1a')](_0xc98e65)[_0x6936('0x2b')](_0x331007);};}exports[_0x6936('0x2c')]=function(_0x1ea21c,_0x1394ae){var _0x49d317={},_0xf9495={},_0x25153e={'count':0x0,'rows':[]};var _0x50f059=_[_0x6936('0x2d')](db[_0x6936('0x2e')][_0x6936('0x2f')],function(_0x2a7164){return{'name':_0x2a7164[_0x6936('0x30')],'type':_0x2a7164[_0x6936('0x31')][_0x6936('0x32')]};});_0xf9495[_0x6936('0x33')]=_[_0x6936('0x2d')](_0x50f059,_0x6936('0x2a'));_0xf9495[_0x6936('0x34')]=_[_0x6936('0x35')](_0x1ea21c[_0x6936('0x34')]);_0xf9495[_0x6936('0x36')]=_['intersection'](_0xf9495[_0x6936('0x33')],_0xf9495['query']);_0x49d317[_0x6936('0x37')]=_['intersection'](_0xf9495['model'],qs[_0x6936('0x38')](_0x1ea21c['query'][_0x6936('0x38')]));_0x49d317['attributes']=_0x49d317[_0x6936('0x37')][_0x6936('0x39')]?_0x49d317[_0x6936('0x37')]:_0xf9495[_0x6936('0x33')];if(!_0x1ea21c[_0x6936('0x34')][_0x6936('0x3a')]('nolimit')){_0x49d317[_0x6936('0x1c')]=qs['limit'](_0x1ea21c[_0x6936('0x34')][_0x6936('0x1c')]);_0x49d317[_0x6936('0x1b')]=qs[_0x6936('0x1b')](_0x1ea21c['query'][_0x6936('0x1b')]);}_0x49d317[_0x6936('0x3b')]=qs['sort'](_0x1ea21c[_0x6936('0x34')][_0x6936('0x3c')]);_0x49d317[_0x6936('0x3d')]=qs[_0x6936('0x36')](_['pick'](_0x1ea21c[_0x6936('0x34')],_0xf9495['filters']),_0x50f059);if(_0x1ea21c[_0x6936('0x34')][_0x6936('0x3e')]){_0x49d317[_0x6936('0x3d')]=_[_0x6936('0x3f')](_0x49d317[_0x6936('0x3d')],{'$or':_[_0x6936('0x2d')](_0x50f059,function(_0x29b77d){if(_0x29b77d[_0x6936('0x31')]!==_0x6936('0x40')){var _0x27ad1e={};_0x27ad1e[_0x29b77d[_0x6936('0x2a')]]={'$like':'%'+_0x1ea21c[_0x6936('0x34')][_0x6936('0x3e')]+'%'};return _0x27ad1e;}})});}_0x49d317=_[_0x6936('0x3f')]({},_0x49d317,_0x1ea21c[_0x6936('0x41')]);var _0x2bcb2a={'where':_0x49d317[_0x6936('0x3d')]};return db[_0x6936('0x2e')][_0x6936('0x1e')](_0x2bcb2a)['then'](function(_0x17dd01){_0x25153e['count']=_0x17dd01;if(_0x1ea21c[_0x6936('0x34')][_0x6936('0x42')]){_0x49d317['include']=[{'all':!![]}];}return db[_0x6936('0x2e')][_0x6936('0x43')](_0x49d317);})[_0x6936('0x27')](function(_0x2a40e1){_0x25153e[_0x6936('0x44')]=_0x2a40e1;return _0x25153e;})['then'](respondWithFilteredResult(_0x1394ae,_0x49d317))['catch'](handleError(_0x1394ae,null));};exports[_0x6936('0x45')]=function(_0x528f83,_0x4e72af){var _0x1c8392={'raw':![],'where':{'id':_0x528f83['params']['id']}},_0x1468a7={};_0x1468a7[_0x6936('0x33')]=_[_0x6936('0x35')](db[_0x6936('0x2e')][_0x6936('0x2f')]);_0x1468a7[_0x6936('0x34')]=_[_0x6936('0x35')](_0x528f83[_0x6936('0x34')]);_0x1468a7['filters']=_['intersection'](_0x1468a7[_0x6936('0x33')],_0x1468a7[_0x6936('0x34')]);_0x1c8392[_0x6936('0x37')]=_['intersection'](_0x1468a7[_0x6936('0x33')],qs[_0x6936('0x38')](_0x528f83['query'][_0x6936('0x38')]));_0x1c8392['attributes']=_0x1c8392[_0x6936('0x37')][_0x6936('0x39')]?_0x1c8392[_0x6936('0x37')]:_0x1468a7[_0x6936('0x33')];if(_0x528f83[_0x6936('0x34')][_0x6936('0x42')]){_0x1c8392['include']=[{'all':!![]}];}_0x1c8392=_[_0x6936('0x3f')]({},_0x1c8392,_0x528f83[_0x6936('0x41')]);return db['FreshsalesConfiguration'][_0x6936('0x46')](_0x1c8392)['then'](handleEntityNotFound(_0x4e72af,null))[_0x6936('0x27')](respondWithResult(_0x4e72af,null))[_0x6936('0x47')](handleError(_0x4e72af,null));};exports[_0x6936('0x48')]=function(_0x5d0705,_0x4bf74c){return db[_0x6936('0x2e')][_0x6936('0x48')](_0x5d0705[_0x6936('0x49')],{})[_0x6936('0x27')](respondWithResult(_0x4bf74c,0xc9))[_0x6936('0x47')](handleError(_0x4bf74c,null));};exports['update']=function(_0x27467d,_0x13ff39){if(_0x27467d[_0x6936('0x49')]['id']){delete _0x27467d[_0x6936('0x49')]['id'];}return db[_0x6936('0x2e')][_0x6936('0x46')]({'where':{'id':_0x27467d[_0x6936('0x4a')]['id']}})[_0x6936('0x27')](handleEntityNotFound(_0x13ff39,null))['then'](saveUpdates(_0x27467d[_0x6936('0x49')],null))[_0x6936('0x27')](respondWithResult(_0x13ff39,null))['catch'](handleError(_0x13ff39,null));};exports[_0x6936('0x26')]=function(_0x2d994b,_0x35bd06){return db['FreshsalesConfiguration'][_0x6936('0x46')]({'where':{'id':_0x2d994b[_0x6936('0x4a')]['id']}})[_0x6936('0x27')](handleEntityNotFound(_0x35bd06,null))[_0x6936('0x27')](removeEntity(_0x35bd06,null))[_0x6936('0x47')](handleError(_0x35bd06,null));};exports[_0x6936('0x4b')]=function(_0x584ff9,_0x13dcd6,_0xeb1447){var _0x459437={};var _0x367a44={};var _0x5240fd;var _0x473b85;return db[_0x6936('0x2e')]['findOne']({'where':{'id':_0x584ff9[_0x6936('0x4a')]['id']}})['then'](handleEntityNotFound(_0x13dcd6,null))[_0x6936('0x27')](function(_0x329263){if(_0x329263){_0x5240fd=_0x329263;_0x367a44['model']=_['keys'](db['FreshsalesField'][_0x6936('0x2f')]);_0x367a44['query']=_[_0x6936('0x35')](_0x584ff9['query']);_0x367a44['filters']=_[_0x6936('0x4c')](_0x367a44['model'],_0x367a44[_0x6936('0x34')]);_0x459437[_0x6936('0x37')]=_[_0x6936('0x4c')](_0x367a44[_0x6936('0x33')],qs[_0x6936('0x38')](_0x584ff9[_0x6936('0x34')][_0x6936('0x38')]));_0x459437[_0x6936('0x37')]=_0x459437[_0x6936('0x37')][_0x6936('0x39')]?_0x459437[_0x6936('0x37')]:_0x367a44['model'];_0x459437['order']=qs[_0x6936('0x3c')](_0x584ff9[_0x6936('0x34')][_0x6936('0x3c')]);_0x459437['where']=qs[_0x6936('0x36')](_[_0x6936('0x4d')](_0x584ff9[_0x6936('0x34')],_0x367a44[_0x6936('0x36')]));if(_0x584ff9[_0x6936('0x34')][_0x6936('0x3e')]){_0x459437[_0x6936('0x3d')]=_['merge'](_0x459437['where'],{'$or':_[_0x6936('0x2d')](_0x459437[_0x6936('0x37')],function(_0x3586cd){var _0x5cb8bd={};_0x5cb8bd[_0x3586cd]={'$like':'%'+_0x584ff9['query'][_0x6936('0x3e')]+'%'};return _0x5cb8bd;})});}_0x459437=_['merge']({},_0x459437,_0x584ff9[_0x6936('0x41')]);return _0x5240fd[_0x6936('0x4b')](_0x459437);}})[_0x6936('0x27')](function(_0x24d68c){if(_0x24d68c){_0x473b85=_0x24d68c[_0x6936('0x39')];if(!_0x584ff9[_0x6936('0x34')][_0x6936('0x3a')]('nolimit')){_0x459437[_0x6936('0x1c')]=qs[_0x6936('0x1c')](_0x584ff9[_0x6936('0x34')]['limit']);_0x459437[_0x6936('0x1b')]=qs[_0x6936('0x1b')](_0x584ff9['query'][_0x6936('0x1b')]);}return _0x5240fd[_0x6936('0x4b')](_0x459437);}})[_0x6936('0x27')](function(_0x30096e){if(_0x30096e){return _0x30096e?{'count':_0x473b85,'rows':_0x30096e}:null;}})[_0x6936('0x27')](respondWithResult(_0x13dcd6,null))['catch'](handleError(_0x13dcd6,null));};exports[_0x6936('0x4e')]=function(_0x5f37b9,_0x247c31,_0x2b9e31){var _0x385d9e={};var _0x326a6e={};var _0x3e63ba;var _0x397cbd;return db[_0x6936('0x2e')]['findOne']({'where':{'id':_0x5f37b9[_0x6936('0x4a')]['id']}})[_0x6936('0x27')](handleEntityNotFound(_0x247c31,null))[_0x6936('0x27')](function(_0x520a45){if(_0x520a45){_0x3e63ba=_0x520a45;_0x326a6e[_0x6936('0x33')]=_[_0x6936('0x35')](db[_0x6936('0x4f')]['rawAttributes']);_0x326a6e[_0x6936('0x34')]=_[_0x6936('0x35')](_0x5f37b9['query']);_0x326a6e[_0x6936('0x36')]=_[_0x6936('0x4c')](_0x326a6e[_0x6936('0x33')],_0x326a6e[_0x6936('0x34')]);_0x385d9e[_0x6936('0x37')]=_[_0x6936('0x4c')](_0x326a6e[_0x6936('0x33')],qs['fields'](_0x5f37b9[_0x6936('0x34')][_0x6936('0x38')]));_0x385d9e[_0x6936('0x37')]=_0x385d9e[_0x6936('0x37')]['length']?_0x385d9e[_0x6936('0x37')]:_0x326a6e['model'];_0x385d9e[_0x6936('0x3b')]=qs[_0x6936('0x3c')](_0x5f37b9[_0x6936('0x34')]['sort']);_0x385d9e[_0x6936('0x3d')]=qs[_0x6936('0x36')](_[_0x6936('0x4d')](_0x5f37b9[_0x6936('0x34')],_0x326a6e[_0x6936('0x36')]));if(_0x5f37b9['query'][_0x6936('0x3e')]){_0x385d9e['where']=_[_0x6936('0x3f')](_0x385d9e[_0x6936('0x3d')],{'$or':_[_0x6936('0x2d')](_0x385d9e[_0x6936('0x37')],function(_0x5561ac){var _0x18ee29={};_0x18ee29[_0x5561ac]={'$like':'%'+_0x5f37b9[_0x6936('0x34')]['filter']+'%'};return _0x18ee29;})});}_0x385d9e=_[_0x6936('0x3f')]({},_0x385d9e,_0x5f37b9['options']);return _0x3e63ba['getDescriptions'](_0x385d9e);}})[_0x6936('0x27')](function(_0x12e82f){if(_0x12e82f){_0x397cbd=_0x12e82f[_0x6936('0x39')];if(!_0x5f37b9[_0x6936('0x34')][_0x6936('0x3a')]('nolimit')){_0x385d9e[_0x6936('0x1c')]=qs['limit'](_0x5f37b9['query'][_0x6936('0x1c')]);_0x385d9e['offset']=qs['offset'](_0x5f37b9[_0x6936('0x34')][_0x6936('0x1b')]);}return _0x3e63ba[_0x6936('0x4e')](_0x385d9e);}})[_0x6936('0x27')](function(_0x2d1e61){if(_0x2d1e61){return _0x2d1e61?{'count':_0x397cbd,'rows':_0x2d1e61}:null;}})[_0x6936('0x27')](respondWithResult(_0x247c31,null))['catch'](handleError(_0x247c31,null));};exports[_0x6936('0x50')]=function(_0x150fdc,_0x4633dd,_0x1d0edf){var _0x2f1813={};var _0x31599f={};var _0x4b33da;var _0x2d3bef;return db[_0x6936('0x2e')][_0x6936('0x51')]({'where':{'id':_0x150fdc[_0x6936('0x4a')]['id']}})[_0x6936('0x27')](handleEntityNotFound(_0x4633dd,null))[_0x6936('0x27')](function(_0x3164ab){if(_0x3164ab){_0x4b33da=_0x3164ab;_0x31599f[_0x6936('0x33')]=_[_0x6936('0x35')](db[_0x6936('0x4f')]['rawAttributes']);_0x31599f[_0x6936('0x34')]=_['keys'](_0x150fdc[_0x6936('0x34')]);_0x31599f[_0x6936('0x36')]=_[_0x6936('0x4c')](_0x31599f['model'],_0x31599f[_0x6936('0x34')]);_0x2f1813[_0x6936('0x37')]=_[_0x6936('0x4c')](_0x31599f['model'],qs[_0x6936('0x38')](_0x150fdc[_0x6936('0x34')][_0x6936('0x38')]));_0x2f1813[_0x6936('0x37')]=_0x2f1813[_0x6936('0x37')][_0x6936('0x39')]?_0x2f1813[_0x6936('0x37')]:_0x31599f[_0x6936('0x33')];_0x2f1813['order']=qs[_0x6936('0x3c')](_0x150fdc[_0x6936('0x34')][_0x6936('0x3c')]);_0x2f1813[_0x6936('0x3d')]=qs[_0x6936('0x36')](_[_0x6936('0x4d')](_0x150fdc['query'],_0x31599f[_0x6936('0x36')]));if(_0x150fdc[_0x6936('0x34')][_0x6936('0x3e')]){_0x2f1813[_0x6936('0x3d')]=_[_0x6936('0x3f')](_0x2f1813[_0x6936('0x3d')],{'$or':_[_0x6936('0x2d')](_0x2f1813[_0x6936('0x37')],function(_0x2039fe){var _0x9872d7={};_0x9872d7[_0x2039fe]={'$like':'%'+_0x150fdc[_0x6936('0x34')]['filter']+'%'};return _0x9872d7;})});}_0x2f1813=_['merge']({},_0x2f1813,_0x150fdc[_0x6936('0x41')]);return _0x4b33da[_0x6936('0x50')](_0x2f1813);}})[_0x6936('0x27')](function(_0x3de8a4){if(_0x3de8a4){_0x2d3bef=_0x3de8a4[_0x6936('0x39')];if(!_0x150fdc[_0x6936('0x34')][_0x6936('0x3a')](_0x6936('0x52'))){_0x2f1813[_0x6936('0x1c')]=qs['limit'](_0x150fdc[_0x6936('0x34')][_0x6936('0x1c')]);_0x2f1813[_0x6936('0x1b')]=qs['offset'](_0x150fdc[_0x6936('0x34')]['offset']);}return _0x4b33da['getFields'](_0x2f1813);}})[_0x6936('0x27')](function(_0x406810){if(_0x406810){return _0x406810?{'count':_0x2d3bef,'rows':_0x406810}:null;}})['then'](respondWithResult(_0x4633dd,null))[_0x6936('0x47')](handleError(_0x4633dd,null));}; \ No newline at end of file +var _0x1567=['pick','filter','merge','VIRTUAL','options','where','includeAll','rows','then','catch','show','params','include','find','create','body','getSubjects','findOne','order','getDescriptions','FreshsalesField','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x1dfa70,_0x404788){var _0x18e9ce=function(_0x313cc0){while(--_0x313cc0){_0x1dfa70['push'](_0x1dfa70['shift']());}};_0x18e9ce(++_0x404788);}(_0x1567,0x1bf));var _0x7156=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1567[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x7156('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7156('0x1'));var jsonpatch=require(_0x7156('0x2'));var rp=require(_0x7156('0x3'));var moment=require(_0x7156('0x4'));var BPromise=require(_0x7156('0x5'));var Mustache=require(_0x7156('0x6'));var util=require('util');var path=require(_0x7156('0x7'));var sox=require(_0x7156('0x8'));var csv=require(_0x7156('0x9'));var ejs=require(_0x7156('0xa'));var fs=require('fs');var fs_extra=require(_0x7156('0xb'));var _=require('lodash');var squel=require(_0x7156('0xc'));var crypto=require('crypto');var jsforce=require(_0x7156('0xd'));var deskjs=require(_0x7156('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7156('0xf'));var Papa=require(_0x7156('0x10'));var Redis=require(_0x7156('0x11'));var authService=require(_0x7156('0x12'));var qs=require(_0x7156('0x13'));var as=require(_0x7156('0x14'));var hardwareService=require(_0x7156('0x15'));var logger=require('../../config/logger')(_0x7156('0x16'));var utils=require(_0x7156('0x17'));var config=require(_0x7156('0x18'));var licenseUtil=require(_0x7156('0x19'));var db=require(_0x7156('0x1a'))['db'];function respondWithStatusCode(_0x430c76,_0x417f2c){_0x417f2c=_0x417f2c||0xcc;return function(_0x336735){if(_0x336735){return _0x430c76['sendStatus'](_0x417f2c);}return _0x430c76[_0x7156('0x1b')](_0x417f2c)[_0x7156('0x1c')]();};}function respondWithResult(_0x632cd6,_0x87e34c){_0x87e34c=_0x87e34c||0xc8;return function(_0x827100){if(_0x827100){return _0x632cd6['status'](_0x87e34c)['json'](_0x827100);}};}function respondWithFilteredResult(_0x45b047,_0x7f5fa1){return function(_0xf9871c){if(_0xf9871c){var _0x576461=typeof _0x7f5fa1[_0x7156('0x1d')]===_0x7156('0x1e')&&typeof _0x7f5fa1[_0x7156('0x1f')]===_0x7156('0x1e');var _0x5956ed=_0xf9871c[_0x7156('0x20')];var _0x195b46=_0x576461?0x0:_0x7f5fa1['offset'];var _0x3ea567=_0x576461?_0xf9871c[_0x7156('0x20')]:_0x7f5fa1[_0x7156('0x1d')]+_0x7f5fa1[_0x7156('0x1f')];var _0x18718e;if(_0x3ea567>=_0x5956ed){_0x3ea567=_0x5956ed;_0x18718e=0xc8;}else{_0x18718e=0xce;}_0x45b047['status'](_0x18718e);return _0x45b047[_0x7156('0x21')](_0x7156('0x22'),_0x195b46+'-'+_0x3ea567+'/'+_0x5956ed)[_0x7156('0x23')](_0xf9871c);}return null;};}function patchUpdates(_0x4a60ff){return function(_0x53cf9a){try{jsonpatch[_0x7156('0x24')](_0x53cf9a,_0x4a60ff,!![]);}catch(_0x2a8180){return BPromise[_0x7156('0x25')](_0x2a8180);}return _0x53cf9a[_0x7156('0x26')]();};}function saveUpdates(_0x1850ff,_0x21258c){return function(_0xd393f8){if(_0xd393f8){return _0xd393f8['update'](_0x1850ff)['then'](function(_0xdd97e8){return _0xdd97e8;});}return null;};}function removeEntity(_0x7769b9,_0x353afd){return function(_0x5be637){if(_0x5be637){return _0x5be637[_0x7156('0x27')]()['then'](function(){_0x7769b9[_0x7156('0x1b')](0xcc)[_0x7156('0x1c')]();});}};}function handleEntityNotFound(_0x231491,_0x52b58c){return function(_0x2e1dbd){if(!_0x2e1dbd){_0x231491[_0x7156('0x28')](0x194);}return _0x2e1dbd;};}function handleError(_0x4a8404,_0x1c8beb){_0x1c8beb=_0x1c8beb||0x1f4;return function(_0x3193da){logger[_0x7156('0x29')](_0x3193da[_0x7156('0x2a')]);if(_0x3193da[_0x7156('0x2b')]){delete _0x3193da['name'];}_0x4a8404[_0x7156('0x1b')](_0x1c8beb)[_0x7156('0x2c')](_0x3193da);};}exports[_0x7156('0x2d')]=function(_0xcf131d,_0xa18c36){var _0x47259d={},_0x2a0160={},_0x7685f0={'count':0x0,'rows':[]};var _0x37e96e=_[_0x7156('0x2e')](db[_0x7156('0x2f')][_0x7156('0x30')],function(_0x51e69a){return{'name':_0x51e69a[_0x7156('0x31')],'type':_0x51e69a[_0x7156('0x32')][_0x7156('0x33')]};});_0x2a0160['model']=_['map'](_0x37e96e,_0x7156('0x2b'));_0x2a0160[_0x7156('0x34')]=_[_0x7156('0x35')](_0xcf131d[_0x7156('0x34')]);_0x2a0160[_0x7156('0x36')]=_[_0x7156('0x37')](_0x2a0160[_0x7156('0x38')],_0x2a0160[_0x7156('0x34')]);_0x47259d[_0x7156('0x39')]=_[_0x7156('0x37')](_0x2a0160[_0x7156('0x38')],qs[_0x7156('0x3a')](_0xcf131d['query']['fields']));_0x47259d[_0x7156('0x39')]=_0x47259d['attributes'][_0x7156('0x3b')]?_0x47259d[_0x7156('0x39')]:_0x2a0160[_0x7156('0x38')];if(!_0xcf131d[_0x7156('0x34')][_0x7156('0x3c')](_0x7156('0x3d'))){_0x47259d[_0x7156('0x1f')]=qs[_0x7156('0x1f')](_0xcf131d[_0x7156('0x34')][_0x7156('0x1f')]);_0x47259d[_0x7156('0x1d')]=qs['offset'](_0xcf131d['query']['offset']);}_0x47259d['order']=qs['sort'](_0xcf131d[_0x7156('0x34')][_0x7156('0x3e')]);_0x47259d['where']=qs[_0x7156('0x36')](_[_0x7156('0x3f')](_0xcf131d[_0x7156('0x34')],_0x2a0160['filters']),_0x37e96e);if(_0xcf131d[_0x7156('0x34')][_0x7156('0x40')]){_0x47259d['where']=_[_0x7156('0x41')](_0x47259d['where'],{'$or':_[_0x7156('0x2e')](_0x37e96e,function(_0x3149b5){if(_0x3149b5['type']!==_0x7156('0x42')){var _0x56cfca={};_0x56cfca[_0x3149b5[_0x7156('0x2b')]]={'$like':'%'+_0xcf131d['query'][_0x7156('0x40')]+'%'};return _0x56cfca;}})});}_0x47259d=_[_0x7156('0x41')]({},_0x47259d,_0xcf131d[_0x7156('0x43')]);var _0x21d7ab={'where':_0x47259d[_0x7156('0x44')]};return db['FreshsalesConfiguration'][_0x7156('0x20')](_0x21d7ab)['then'](function(_0x251d11){_0x7685f0[_0x7156('0x20')]=_0x251d11;if(_0xcf131d[_0x7156('0x34')][_0x7156('0x45')]){_0x47259d['include']=[{'all':!![]}];}return db[_0x7156('0x2f')]['findAll'](_0x47259d);})['then'](function(_0x3e57d5){_0x7685f0[_0x7156('0x46')]=_0x3e57d5;return _0x7685f0;})[_0x7156('0x47')](respondWithFilteredResult(_0xa18c36,_0x47259d))[_0x7156('0x48')](handleError(_0xa18c36,null));};exports[_0x7156('0x49')]=function(_0x5bf7f4,_0x48fdf1){var _0x4848d2={'raw':![],'where':{'id':_0x5bf7f4[_0x7156('0x4a')]['id']}},_0x5377d6={};_0x5377d6[_0x7156('0x38')]=_[_0x7156('0x35')](db[_0x7156('0x2f')][_0x7156('0x30')]);_0x5377d6['query']=_['keys'](_0x5bf7f4[_0x7156('0x34')]);_0x5377d6[_0x7156('0x36')]=_['intersection'](_0x5377d6[_0x7156('0x38')],_0x5377d6[_0x7156('0x34')]);_0x4848d2[_0x7156('0x39')]=_[_0x7156('0x37')](_0x5377d6[_0x7156('0x38')],qs[_0x7156('0x3a')](_0x5bf7f4[_0x7156('0x34')][_0x7156('0x3a')]));_0x4848d2[_0x7156('0x39')]=_0x4848d2[_0x7156('0x39')][_0x7156('0x3b')]?_0x4848d2[_0x7156('0x39')]:_0x5377d6[_0x7156('0x38')];if(_0x5bf7f4[_0x7156('0x34')]['includeAll']){_0x4848d2[_0x7156('0x4b')]=[{'all':!![]}];}_0x4848d2=_[_0x7156('0x41')]({},_0x4848d2,_0x5bf7f4[_0x7156('0x43')]);return db[_0x7156('0x2f')][_0x7156('0x4c')](_0x4848d2)['then'](handleEntityNotFound(_0x48fdf1,null))[_0x7156('0x47')](respondWithResult(_0x48fdf1,null))[_0x7156('0x48')](handleError(_0x48fdf1,null));};exports[_0x7156('0x4d')]=function(_0x4184bf,_0x539199){return db[_0x7156('0x2f')][_0x7156('0x4d')](_0x4184bf[_0x7156('0x4e')],{})[_0x7156('0x47')](respondWithResult(_0x539199,0xc9))[_0x7156('0x48')](handleError(_0x539199,null));};exports['update']=function(_0x4fe0f3,_0xf9bd97){if(_0x4fe0f3[_0x7156('0x4e')]['id']){delete _0x4fe0f3[_0x7156('0x4e')]['id'];}return db[_0x7156('0x2f')][_0x7156('0x4c')]({'where':{'id':_0x4fe0f3['params']['id']}})['then'](handleEntityNotFound(_0xf9bd97,null))['then'](saveUpdates(_0x4fe0f3[_0x7156('0x4e')],null))[_0x7156('0x47')](respondWithResult(_0xf9bd97,null))['catch'](handleError(_0xf9bd97,null));};exports[_0x7156('0x27')]=function(_0xef7042,_0x3cfaaa){return db[_0x7156('0x2f')][_0x7156('0x4c')]({'where':{'id':_0xef7042[_0x7156('0x4a')]['id']}})[_0x7156('0x47')](handleEntityNotFound(_0x3cfaaa,null))['then'](removeEntity(_0x3cfaaa,null))['catch'](handleError(_0x3cfaaa,null));};exports[_0x7156('0x4f')]=function(_0x2e5020,_0x26577b,_0xe67ce7){var _0x8d3cdf={};var _0x36ef43={};var _0x41d878;var _0xf9d43c;return db[_0x7156('0x2f')][_0x7156('0x50')]({'where':{'id':_0x2e5020['params']['id']}})[_0x7156('0x47')](handleEntityNotFound(_0x26577b,null))[_0x7156('0x47')](function(_0xc29afe){if(_0xc29afe){_0x41d878=_0xc29afe;_0x36ef43[_0x7156('0x38')]=_[_0x7156('0x35')](db['FreshsalesField'][_0x7156('0x30')]);_0x36ef43['query']=_[_0x7156('0x35')](_0x2e5020[_0x7156('0x34')]);_0x36ef43['filters']=_[_0x7156('0x37')](_0x36ef43[_0x7156('0x38')],_0x36ef43[_0x7156('0x34')]);_0x8d3cdf[_0x7156('0x39')]=_[_0x7156('0x37')](_0x36ef43[_0x7156('0x38')],qs[_0x7156('0x3a')](_0x2e5020[_0x7156('0x34')][_0x7156('0x3a')]));_0x8d3cdf[_0x7156('0x39')]=_0x8d3cdf['attributes'][_0x7156('0x3b')]?_0x8d3cdf['attributes']:_0x36ef43[_0x7156('0x38')];_0x8d3cdf[_0x7156('0x51')]=qs[_0x7156('0x3e')](_0x2e5020[_0x7156('0x34')][_0x7156('0x3e')]);_0x8d3cdf['where']=qs[_0x7156('0x36')](_[_0x7156('0x3f')](_0x2e5020[_0x7156('0x34')],_0x36ef43['filters']));if(_0x2e5020[_0x7156('0x34')][_0x7156('0x40')]){_0x8d3cdf[_0x7156('0x44')]=_[_0x7156('0x41')](_0x8d3cdf[_0x7156('0x44')],{'$or':_[_0x7156('0x2e')](_0x8d3cdf[_0x7156('0x39')],function(_0x1a7030){var _0x23376f={};_0x23376f[_0x1a7030]={'$like':'%'+_0x2e5020['query']['filter']+'%'};return _0x23376f;})});}_0x8d3cdf=_['merge']({},_0x8d3cdf,_0x2e5020['options']);return _0x41d878[_0x7156('0x4f')](_0x8d3cdf);}})[_0x7156('0x47')](function(_0x52ebec){if(_0x52ebec){_0xf9d43c=_0x52ebec[_0x7156('0x3b')];if(!_0x2e5020[_0x7156('0x34')][_0x7156('0x3c')](_0x7156('0x3d'))){_0x8d3cdf['limit']=qs[_0x7156('0x1f')](_0x2e5020[_0x7156('0x34')]['limit']);_0x8d3cdf[_0x7156('0x1d')]=qs[_0x7156('0x1d')](_0x2e5020[_0x7156('0x34')][_0x7156('0x1d')]);}return _0x41d878[_0x7156('0x4f')](_0x8d3cdf);}})['then'](function(_0x5779d2){if(_0x5779d2){return _0x5779d2?{'count':_0xf9d43c,'rows':_0x5779d2}:null;}})[_0x7156('0x47')](respondWithResult(_0x26577b,null))[_0x7156('0x48')](handleError(_0x26577b,null));};exports[_0x7156('0x52')]=function(_0x4af9a8,_0x2a32ac,_0x4edee2){var _0x40eec0={};var _0x13e675={};var _0x5753d7;var _0x5997c3;return db[_0x7156('0x2f')][_0x7156('0x50')]({'where':{'id':_0x4af9a8['params']['id']}})['then'](handleEntityNotFound(_0x2a32ac,null))[_0x7156('0x47')](function(_0x2994f5){if(_0x2994f5){_0x5753d7=_0x2994f5;_0x13e675[_0x7156('0x38')]=_[_0x7156('0x35')](db[_0x7156('0x53')][_0x7156('0x30')]);_0x13e675[_0x7156('0x34')]=_['keys'](_0x4af9a8[_0x7156('0x34')]);_0x13e675[_0x7156('0x36')]=_[_0x7156('0x37')](_0x13e675[_0x7156('0x38')],_0x13e675[_0x7156('0x34')]);_0x40eec0[_0x7156('0x39')]=_['intersection'](_0x13e675[_0x7156('0x38')],qs[_0x7156('0x3a')](_0x4af9a8[_0x7156('0x34')]['fields']));_0x40eec0[_0x7156('0x39')]=_0x40eec0[_0x7156('0x39')]['length']?_0x40eec0[_0x7156('0x39')]:_0x13e675[_0x7156('0x38')];_0x40eec0[_0x7156('0x51')]=qs[_0x7156('0x3e')](_0x4af9a8['query'][_0x7156('0x3e')]);_0x40eec0[_0x7156('0x44')]=qs[_0x7156('0x36')](_[_0x7156('0x3f')](_0x4af9a8[_0x7156('0x34')],_0x13e675[_0x7156('0x36')]));if(_0x4af9a8['query'][_0x7156('0x40')]){_0x40eec0[_0x7156('0x44')]=_['merge'](_0x40eec0[_0x7156('0x44')],{'$or':_[_0x7156('0x2e')](_0x40eec0[_0x7156('0x39')],function(_0x931e31){var _0x537715={};_0x537715[_0x931e31]={'$like':'%'+_0x4af9a8['query'][_0x7156('0x40')]+'%'};return _0x537715;})});}_0x40eec0=_['merge']({},_0x40eec0,_0x4af9a8[_0x7156('0x43')]);return _0x5753d7[_0x7156('0x52')](_0x40eec0);}})[_0x7156('0x47')](function(_0x20d3cd){if(_0x20d3cd){_0x5997c3=_0x20d3cd['length'];if(!_0x4af9a8[_0x7156('0x34')][_0x7156('0x3c')](_0x7156('0x3d'))){_0x40eec0['limit']=qs[_0x7156('0x1f')](_0x4af9a8['query'][_0x7156('0x1f')]);_0x40eec0[_0x7156('0x1d')]=qs[_0x7156('0x1d')](_0x4af9a8[_0x7156('0x34')]['offset']);}return _0x5753d7[_0x7156('0x52')](_0x40eec0);}})[_0x7156('0x47')](function(_0x148f23){if(_0x148f23){return _0x148f23?{'count':_0x5997c3,'rows':_0x148f23}:null;}})[_0x7156('0x47')](respondWithResult(_0x2a32ac,null))[_0x7156('0x48')](handleError(_0x2a32ac,null));};exports['getFields']=function(_0x395bd9,_0x296aae,_0x7a12b5){var _0x539707={};var _0x55e1d1={};var _0x454d6d;var _0x5192d7;return db[_0x7156('0x2f')]['findOne']({'where':{'id':_0x395bd9[_0x7156('0x4a')]['id']}})[_0x7156('0x47')](handleEntityNotFound(_0x296aae,null))[_0x7156('0x47')](function(_0x196c39){if(_0x196c39){_0x454d6d=_0x196c39;_0x55e1d1[_0x7156('0x38')]=_[_0x7156('0x35')](db[_0x7156('0x53')][_0x7156('0x30')]);_0x55e1d1[_0x7156('0x34')]=_[_0x7156('0x35')](_0x395bd9[_0x7156('0x34')]);_0x55e1d1['filters']=_[_0x7156('0x37')](_0x55e1d1['model'],_0x55e1d1[_0x7156('0x34')]);_0x539707[_0x7156('0x39')]=_[_0x7156('0x37')](_0x55e1d1['model'],qs[_0x7156('0x3a')](_0x395bd9[_0x7156('0x34')]['fields']));_0x539707[_0x7156('0x39')]=_0x539707['attributes'][_0x7156('0x3b')]?_0x539707[_0x7156('0x39')]:_0x55e1d1[_0x7156('0x38')];_0x539707[_0x7156('0x51')]=qs[_0x7156('0x3e')](_0x395bd9[_0x7156('0x34')][_0x7156('0x3e')]);_0x539707['where']=qs[_0x7156('0x36')](_['pick'](_0x395bd9[_0x7156('0x34')],_0x55e1d1[_0x7156('0x36')]));if(_0x395bd9['query']['filter']){_0x539707['where']=_['merge'](_0x539707[_0x7156('0x44')],{'$or':_[_0x7156('0x2e')](_0x539707['attributes'],function(_0x5830cf){var _0x546da3={};_0x546da3[_0x5830cf]={'$like':'%'+_0x395bd9[_0x7156('0x34')]['filter']+'%'};return _0x546da3;})});}_0x539707=_['merge']({},_0x539707,_0x395bd9[_0x7156('0x43')]);return _0x454d6d['getFields'](_0x539707);}})[_0x7156('0x47')](function(_0x2cfddc){if(_0x2cfddc){_0x5192d7=_0x2cfddc[_0x7156('0x3b')];if(!_0x395bd9[_0x7156('0x34')][_0x7156('0x3c')]('nolimit')){_0x539707[_0x7156('0x1f')]=qs[_0x7156('0x1f')](_0x395bd9[_0x7156('0x34')][_0x7156('0x1f')]);_0x539707[_0x7156('0x1d')]=qs[_0x7156('0x1d')](_0x395bd9[_0x7156('0x34')]['offset']);}return _0x454d6d[_0x7156('0x54')](_0x539707);}})[_0x7156('0x47')](function(_0x565686){if(_0x565686){return _0x565686?{'count':_0x5192d7,'rows':_0x565686}:null;}})[_0x7156('0x47')](respondWithResult(_0x296aae,null))['catch'](handleError(_0x296aae,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index a4a49e5..fdaa7ea 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 _0x79c0=['./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x138cff,_0x9744ed){var _0x24b199=function(_0x4c780f){while(--_0x4c780f){_0x138cff['push'](_0x138cff['shift']());}};_0x24b199(++_0x9744ed);}(_0x79c0,0x1e0));var _0x079c=function(_0x2ff692,_0x1de287){_0x2ff692=_0x2ff692-0x0;var _0x49738c=_0x79c0[_0x2ff692];return _0x49738c;};'use strict';var _=require('lodash');var util=require(_0x079c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x079c('0x1'));var BPromise=require('bluebird');var rp=require(_0x079c('0x2'));var fs=require('fs');var path=require(_0x079c('0x3'));var rimraf=require(_0x079c('0x4'));var config=require(_0x079c('0x5'));var attributes=require(_0x079c('0x6'));module[_0x079c('0x7')]=function(_0xf2e9e9,_0x4916fa){return _0xf2e9e9['define']('FreshsalesConfiguration',attributes,{'tableName':_0x079c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa37f=['api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','util','../../config/logger'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xa37f,0x135));var _0xfa37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa37f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfa37('0x0'));var util=require(_0xfa37('0x1'));var logger=require(_0xfa37('0x2'))(_0xfa37('0x3'));var moment=require(_0xfa37('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa37('0x5'));var fs=require('fs');var path=require(_0xfa37('0x6'));var rimraf=require(_0xfa37('0x7'));var config=require(_0xfa37('0x8'));var attributes=require(_0xfa37('0x9'));module[_0xfa37('0xa')]=function(_0x30ea6d,_0x333cb4){return _0x30ea6d[_0xfa37('0xb')](_0xfa37('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 2f905e9..48c58b7 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 _0xf691=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger'];(function(_0x4521e3,_0x10a8a4){var _0x46a272=function(_0x2f4c64){while(--_0x2f4c64){_0x4521e3['push'](_0x4521e3['shift']());}};_0x46a272(++_0x10a8a4);}(_0xf691,0x1c7));var _0x1f69=function(_0x42df9f,_0x52aedd){_0x42df9f=_0x42df9f-0x0;var _0x89712b=_0xf691[_0x42df9f];return _0x89712b;};'use strict';var _=require(_0x1f69('0x0'));var util=require(_0x1f69('0x1'));var moment=require('moment');var BPromise=require(_0x1f69('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f69('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1f69('0x4'))(_0x1f69('0x5'));var config=require(_0x1f69('0x6'));var jayson=require(_0x1f69('0x7'));var client=jayson[_0x1f69('0x8')][_0x1f69('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29ba6a,_0x1a9ea8,_0x1bb4e7){return new BPromise(function(_0x2adee9,_0x161dce){return client[_0x1f69('0xa')](_0x29ba6a,_0x1bb4e7)[_0x1f69('0xb')](function(_0x5541d9){logger[_0x1f69('0xc')](_0x1f69('0xd'),_0x1a9ea8,'request\x20sent');logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1a9ea8,_0x1f69('0xe'),JSON['stringify'](_0x5541d9));if(_0x5541d9['error']){if(_0x5541d9[_0x1f69('0xf')][_0x1f69('0x10')]===0x1f4){logger[_0x1f69('0xf')](_0x1f69('0xd'),_0x1a9ea8,_0x5541d9['error'][_0x1f69('0x11')]);return _0x161dce(_0x5541d9[_0x1f69('0xf')][_0x1f69('0x11')]);}logger[_0x1f69('0xf')](_0x1f69('0xd'),_0x1a9ea8,_0x5541d9['error'][_0x1f69('0x11')]);return _0x2adee9(_0x5541d9['error']['message']);}else{logger[_0x1f69('0xc')](_0x1f69('0xd'),_0x1a9ea8,_0x1f69('0xe'));_0x2adee9(_0x5541d9[_0x1f69('0x12')]['message']);}})[_0x1f69('0x13')](function(_0x178943){logger['error'](_0x1f69('0xd'),_0x1a9ea8,_0x178943);_0x161dce(_0x178943);});});} \ No newline at end of file +var _0x2119=['request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x382f15,_0x13d46b){var _0x354b45=function(_0xf523b5){while(--_0xf523b5){_0x382f15['push'](_0x382f15['shift']());}};_0x354b45(++_0x13d46b);}(_0x2119,0x8f));var _0x9211=function(_0x3d2541,_0x3ac09e){_0x3d2541=_0x3d2541-0x0;var _0x70fb21=_0x2119[_0x3d2541];return _0x70fb21;};'use strict';var _=require(_0x9211('0x0'));var util=require('util');var moment=require(_0x9211('0x1'));var BPromise=require(_0x9211('0x2'));var rs=require(_0x9211('0x3'));var fs=require('fs');var Redis=require(_0x9211('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9211('0x5'));var logger=require(_0x9211('0x6'))('rpc');var config=require(_0x9211('0x7'));var jayson=require(_0x9211('0x8'));var client=jayson[_0x9211('0x9')][_0x9211('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f8f72,_0x14e674,_0x341dcf){return new BPromise(function(_0x2eb09c,_0x3702b2){return client[_0x9211('0xb')](_0x3f8f72,_0x341dcf)['then'](function(_0x46d9eb){logger[_0x9211('0xc')](_0x9211('0xd'),_0x14e674,_0x9211('0xe'));logger[_0x9211('0xf')](_0x9211('0x10'),_0x14e674,_0x9211('0xe'),JSON[_0x9211('0x11')](_0x46d9eb));if(_0x46d9eb[_0x9211('0x12')]){if(_0x46d9eb['error']['code']===0x1f4){logger[_0x9211('0x12')](_0x9211('0xd'),_0x14e674,_0x46d9eb[_0x9211('0x12')][_0x9211('0x13')]);return _0x3702b2(_0x46d9eb['error']['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x14e674,_0x46d9eb[_0x9211('0x12')][_0x9211('0x13')]);return _0x2eb09c(_0x46d9eb[_0x9211('0x12')][_0x9211('0x13')]);}else{logger[_0x9211('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x14e674,'request\x20sent');_0x2eb09c(_0x46d9eb[_0x9211('0x14')]['message']);}})[_0x9211('0x15')](function(_0x35b2d9){logger[_0x9211('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x14e674,_0x35b2d9);_0x3702b2(_0x35b2d9);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 331f8ed..a56c217 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 _0xa2ab=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa2ab,0xa7));var _0xba2a=function(_0x3412bb,_0x1bfeff){_0x3412bb=_0x3412bb-0x0;var _0x3f973f=_0xa2ab[_0x3412bb];return _0x3f973f;};'use strict';var multer=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var path=require(_0xba2a('0x2'));var timeout=require('connect-timeout');var express=require(_0xba2a('0x3'));var router=express[_0xba2a('0x4')]();var fs_extra=require(_0xba2a('0x5'));var auth=require(_0xba2a('0x6'));var interaction=require(_0xba2a('0x7'));var config=require(_0xba2a('0x8'));var controller=require(_0xba2a('0x9'));router['get']('/',auth[_0xba2a('0xa')](),controller[_0xba2a('0xb')]);router[_0xba2a('0xc')]('/:id',auth[_0xba2a('0xa')](),controller[_0xba2a('0xd')]);router[_0xba2a('0xe')]('/',auth[_0xba2a('0xa')](),controller['create']);router[_0xba2a('0xf')](_0xba2a('0x10'),auth[_0xba2a('0xa')](),controller[_0xba2a('0x11')]);router[_0xba2a('0x12')]('/:id',auth[_0xba2a('0xa')](),controller[_0xba2a('0x13')]);module[_0xba2a('0x14')]=router; \ No newline at end of file +var _0x4876=['put','delete','destroy','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x3bfa0d,_0x2d84f0){var _0x49b7e0=function(_0x46fda2){while(--_0x46fda2){_0x3bfa0d['push'](_0x3bfa0d['shift']());}};_0x49b7e0(++_0x2d84f0);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6487('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6487('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x6487('0x2'));var interaction=require(_0x6487('0x3'));var config=require(_0x6487('0x4'));var controller=require(_0x6487('0x5'));router['get']('/',auth[_0x6487('0x6')](),controller[_0x6487('0x7')]);router['get'](_0x6487('0x8'),auth[_0x6487('0x6')](),controller[_0x6487('0x9')]);router[_0x6487('0xa')]('/',auth[_0x6487('0x6')](),controller[_0x6487('0xb')]);router[_0x6487('0xc')](_0x6487('0x8'),auth[_0x6487('0x6')](),controller['update']);router[_0x6487('0xd')](_0x6487('0x8'),auth[_0x6487('0x6')](),controller[_0x6487('0xe')]);module[_0x6487('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 595e36f..4deb7c5 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 _0xc9ba=['sequelize','exports','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x19f20b,_0x31f84d){var _0x3588a1=function(_0x247918){while(--_0x247918){_0x19f20b['push'](_0x19f20b['shift']());}};_0x3588a1(++_0x31f84d);}(_0xc9ba,0x68));var _0xac9b=function(_0xce1a87,_0x372c44){_0xce1a87=_0xce1a87-0x0;var _0x26669d=_0xc9ba[_0xce1a87];return _0x26669d;};'use strict';var Sequelize=require(_0xac9b('0x0'));module[_0xac9b('0x1')]={'type':{'type':Sequelize['ENUM'](_0xac9b('0x2'),_0xac9b('0x3'),_0xac9b('0x4'),_0xac9b('0x5'),'picklist'),'defaultValue':_0xac9b('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xac9b('0x2'),_0xac9b('0x3'),_0xac9b('0x4'))},'keyContent':{'type':Sequelize[_0xac9b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xac9b('0x6')]},'customField':{'type':Sequelize[_0xac9b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcdf2=['STRING','ENUM','BOOLEAN','variable','customVariable','keyValue','picklist','string'];(function(_0x11dc3a,_0x59fa38){var _0x52a9a1=function(_0x1f6515){while(--_0x1f6515){_0x11dc3a['push'](_0x11dc3a['shift']());}};_0x52a9a1(++_0x59fa38);}(_0xcdf2,0x1db));var _0x2cdf=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0xcdf2[_0x119b3e];return _0x1169ae;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x2cdf('0x0'),_0x2cdf('0x1'),_0x2cdf('0x2'),_0x2cdf('0x3')),'defaultValue':_0x2cdf('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2cdf('0x5')]},'keyType':{'type':Sequelize[_0x2cdf('0x6')](_0x2cdf('0x4'),_0x2cdf('0x0'),'customVariable')},'keyContent':{'type':Sequelize[_0x2cdf('0x5')]},'idField':{'type':Sequelize[_0x2cdf('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2cdf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2cdf('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index e3b7c02..089e721 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 _0x75f7=['apply','reject','save','update','then','destroy','end','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','params','includeAll','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','limit','count','offset'];(function(_0x5f26e4,_0x19b926){var _0x3530ba=function(_0x4d654c){while(--_0x4d654c){_0x5f26e4['push'](_0x5f26e4['shift']());}};_0x3530ba(++_0x19b926);}(_0x75f7,0xba));var _0x775f=function(_0x4d89f8,_0x3cbdec){_0x4d89f8=_0x4d89f8-0x0;var _0x1c34ea=_0x75f7[_0x4d89f8];return _0x1c34ea;};'use strict';var emlformat=require(_0x775f('0x0'));var rimraf=require(_0x775f('0x1'));var zipdir=require(_0x775f('0x2'));var jsonpatch=require(_0x775f('0x3'));var rp=require(_0x775f('0x4'));var moment=require(_0x775f('0x5'));var BPromise=require(_0x775f('0x6'));var Mustache=require(_0x775f('0x7'));var util=require(_0x775f('0x8'));var path=require(_0x775f('0x9'));var sox=require(_0x775f('0xa'));var csv=require(_0x775f('0xb'));var ejs=require(_0x775f('0xc'));var fs=require('fs');var fs_extra=require(_0x775f('0xd'));var _=require('lodash');var squel=require(_0x775f('0xe'));var crypto=require(_0x775f('0xf'));var jsforce=require(_0x775f('0x10'));var deskjs=require(_0x775f('0x11'));var toCsv=require(_0x775f('0xb'));var querystring=require(_0x775f('0x12'));var Papa=require(_0x775f('0x13'));var Redis=require('ioredis');var authService=require(_0x775f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x775f('0x15'));var hardwareService=require(_0x775f('0x16'));var logger=require(_0x775f('0x17'))(_0x775f('0x18'));var utils=require(_0x775f('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x775f('0x1a'))['db'];function respondWithStatusCode(_0x29737f,_0x5e5090){_0x5e5090=_0x5e5090||0xcc;return function(_0x5d8228){if(_0x5d8228){return _0x29737f[_0x775f('0x1b')](_0x5e5090);}return _0x29737f[_0x775f('0x1c')](_0x5e5090)['end']();};}function respondWithResult(_0x45974d,_0x1767ed){_0x1767ed=_0x1767ed||0xc8;return function(_0x29f2db){if(_0x29f2db){return _0x45974d[_0x775f('0x1c')](_0x1767ed)[_0x775f('0x1d')](_0x29f2db);}};}function respondWithFilteredResult(_0xe59f8f,_0x17735c){return function(_0x15d7b4){if(_0x15d7b4){var _0x79d3f=typeof _0x17735c['offset']==='undefined'&&typeof _0x17735c[_0x775f('0x1e')]==='undefined';var _0x1e6ec3=_0x15d7b4[_0x775f('0x1f')];var _0x472181=_0x79d3f?0x0:_0x17735c[_0x775f('0x20')];var _0x2975ac=_0x79d3f?_0x15d7b4[_0x775f('0x1f')]:_0x17735c[_0x775f('0x20')]+_0x17735c['limit'];var _0x2f8d3a;if(_0x2975ac>=_0x1e6ec3){_0x2975ac=_0x1e6ec3;_0x2f8d3a=0xc8;}else{_0x2f8d3a=0xce;}_0xe59f8f[_0x775f('0x1c')](_0x2f8d3a);return _0xe59f8f['set']('Content-Range',_0x472181+'-'+_0x2975ac+'/'+_0x1e6ec3)[_0x775f('0x1d')](_0x15d7b4);}return null;};}function patchUpdates(_0x659ded){return function(_0xcec7f){try{jsonpatch[_0x775f('0x21')](_0xcec7f,_0x659ded,!![]);}catch(_0x320188){return BPromise[_0x775f('0x22')](_0x320188);}return _0xcec7f[_0x775f('0x23')]();};}function saveUpdates(_0x2822f1,_0x5a37ec){return function(_0x39016e){if(_0x39016e){return _0x39016e[_0x775f('0x24')](_0x2822f1)[_0x775f('0x25')](function(_0x2e331b){return _0x2e331b;});}return null;};}function removeEntity(_0x9b73d,_0x2a6c07){return function(_0x1d98c6){if(_0x1d98c6){return _0x1d98c6[_0x775f('0x26')]()[_0x775f('0x25')](function(){_0x9b73d['status'](0xcc)[_0x775f('0x27')]();});}};}function handleEntityNotFound(_0x653c3f,_0x30f80c){return function(_0x2dccfb){if(!_0x2dccfb){_0x653c3f['sendStatus'](0x194);}return _0x2dccfb;};}function handleError(_0x210c89,_0x57880a){_0x57880a=_0x57880a||0x1f4;return function(_0x1f8f8a){logger['error'](_0x1f8f8a[_0x775f('0x28')]);if(_0x1f8f8a[_0x775f('0x29')]){delete _0x1f8f8a[_0x775f('0x29')];}_0x210c89[_0x775f('0x1c')](_0x57880a)[_0x775f('0x2a')](_0x1f8f8a);};}exports[_0x775f('0x2b')]=function(_0x4690a9,_0x384f0e){var _0x2cc519={},_0x970190={},_0x2956d3={'count':0x0,'rows':[]};var _0x12760c=_['map'](db[_0x775f('0x2c')][_0x775f('0x2d')],function(_0x98037c){return{'name':_0x98037c[_0x775f('0x2e')],'type':_0x98037c[_0x775f('0x2f')][_0x775f('0x30')]};});_0x970190[_0x775f('0x31')]=_[_0x775f('0x32')](_0x12760c,_0x775f('0x29'));_0x970190['query']=_[_0x775f('0x33')](_0x4690a9[_0x775f('0x34')]);_0x970190[_0x775f('0x35')]=_[_0x775f('0x36')](_0x970190[_0x775f('0x31')],_0x970190[_0x775f('0x34')]);_0x2cc519['attributes']=_[_0x775f('0x36')](_0x970190[_0x775f('0x31')],qs[_0x775f('0x37')](_0x4690a9[_0x775f('0x34')]['fields']));_0x2cc519[_0x775f('0x38')]=_0x2cc519['attributes'][_0x775f('0x39')]?_0x2cc519[_0x775f('0x38')]:_0x970190[_0x775f('0x31')];if(!_0x4690a9[_0x775f('0x34')]['hasOwnProperty']('nolimit')){_0x2cc519['limit']=qs['limit'](_0x4690a9[_0x775f('0x34')][_0x775f('0x1e')]);_0x2cc519[_0x775f('0x20')]=qs[_0x775f('0x20')](_0x4690a9['query'][_0x775f('0x20')]);}_0x2cc519['order']=qs[_0x775f('0x3a')](_0x4690a9['query'][_0x775f('0x3a')]);_0x2cc519[_0x775f('0x3b')]=qs['filters'](_[_0x775f('0x3c')](_0x4690a9[_0x775f('0x34')],_0x970190[_0x775f('0x35')]),_0x12760c);if(_0x4690a9[_0x775f('0x34')][_0x775f('0x3d')]){_0x2cc519[_0x775f('0x3b')]=_['merge'](_0x2cc519[_0x775f('0x3b')],{'$or':_[_0x775f('0x32')](_0x12760c,function(_0x32dc78){if(_0x32dc78[_0x775f('0x2f')]!==_0x775f('0x3e')){var _0x156462={};_0x156462[_0x32dc78['name']]={'$like':'%'+_0x4690a9['query'][_0x775f('0x3d')]+'%'};return _0x156462;}})});}_0x2cc519=_[_0x775f('0x3f')]({},_0x2cc519,_0x4690a9[_0x775f('0x40')]);var _0x33e9de={'where':_0x2cc519['where']};return db['FreshsalesField'][_0x775f('0x1f')](_0x33e9de)[_0x775f('0x25')](function(_0x8a881e){_0x2956d3[_0x775f('0x1f')]=_0x8a881e;if(_0x4690a9[_0x775f('0x34')]['includeAll']){_0x2cc519[_0x775f('0x41')]=[{'all':!![]}];}return db[_0x775f('0x2c')][_0x775f('0x42')](_0x2cc519);})[_0x775f('0x25')](function(_0x230a9a){_0x2956d3['rows']=_0x230a9a;return _0x2956d3;})[_0x775f('0x25')](respondWithFilteredResult(_0x384f0e,_0x2cc519))['catch'](handleError(_0x384f0e,null));};exports['show']=function(_0x125f42,_0x3a97f9){var _0x466ad2={'raw':!![],'where':{'id':_0x125f42[_0x775f('0x43')]['id']}},_0x2c4264={};_0x2c4264['model']=_[_0x775f('0x33')](db[_0x775f('0x2c')][_0x775f('0x2d')]);_0x2c4264[_0x775f('0x34')]=_['keys'](_0x125f42[_0x775f('0x34')]);_0x2c4264[_0x775f('0x35')]=_[_0x775f('0x36')](_0x2c4264[_0x775f('0x31')],_0x2c4264[_0x775f('0x34')]);_0x466ad2[_0x775f('0x38')]=_[_0x775f('0x36')](_0x2c4264[_0x775f('0x31')],qs['fields'](_0x125f42['query'][_0x775f('0x37')]));_0x466ad2['attributes']=_0x466ad2[_0x775f('0x38')][_0x775f('0x39')]?_0x466ad2[_0x775f('0x38')]:_0x2c4264[_0x775f('0x31')];if(_0x125f42[_0x775f('0x34')][_0x775f('0x44')]){_0x466ad2[_0x775f('0x41')]=[{'all':!![]}];}_0x466ad2=_[_0x775f('0x3f')]({},_0x466ad2,_0x125f42[_0x775f('0x40')]);return db['FreshsalesField'][_0x775f('0x45')](_0x466ad2)[_0x775f('0x25')](handleEntityNotFound(_0x3a97f9,null))[_0x775f('0x25')](respondWithResult(_0x3a97f9,null))['catch'](handleError(_0x3a97f9,null));};exports['create']=function(_0x31b80d,_0x3a698f){return db['FreshsalesField'][_0x775f('0x46')](_0x31b80d[_0x775f('0x47')],{})[_0x775f('0x25')](respondWithResult(_0x3a698f,0xc9))[_0x775f('0x48')](handleError(_0x3a698f,null));};exports[_0x775f('0x24')]=function(_0x42abda,_0x4e4b2c){if(_0x42abda['body']['id']){delete _0x42abda[_0x775f('0x47')]['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x42abda['params']['id']}})[_0x775f('0x25')](handleEntityNotFound(_0x4e4b2c,null))[_0x775f('0x25')](saveUpdates(_0x42abda['body'],null))['then'](respondWithResult(_0x4e4b2c,null))[_0x775f('0x48')](handleError(_0x4e4b2c,null));};exports[_0x775f('0x26')]=function(_0x5638a1,_0x490448){return db[_0x775f('0x2c')][_0x775f('0x45')]({'where':{'id':_0x5638a1[_0x775f('0x43')]['id']}})[_0x775f('0x25')](handleEntityNotFound(_0x490448,null))[_0x775f('0x25')](removeEntity(_0x490448,null))['catch'](handleError(_0x490448,null));}; \ No newline at end of file +var _0xdaf0=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','name','options','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','send','index','map','FreshsalesField','rawAttributes','type','model'];(function(_0x106cd8,_0xa2fd7f){var _0x109308=function(_0x3e8cd4){while(--_0x3e8cd4){_0x106cd8['push'](_0x106cd8['shift']());}};_0x109308(++_0xa2fd7f);}(_0xdaf0,0x1bc));var _0x0daf=function(_0x4372db,_0x3ac20e){_0x4372db=_0x4372db-0x0;var _0x4a34dc=_0xdaf0[_0x4372db];return _0x4a34dc;};'use strict';var emlformat=require(_0x0daf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0daf('0x1'));var jsonpatch=require(_0x0daf('0x2'));var rp=require('request-promise');var moment=require(_0x0daf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0daf('0x4'));var util=require(_0x0daf('0x5'));var path=require('path');var sox=require(_0x0daf('0x6'));var csv=require(_0x0daf('0x7'));var ejs=require(_0x0daf('0x8'));var fs=require('fs');var fs_extra=require(_0x0daf('0x9'));var _=require('lodash');var squel=require(_0x0daf('0xa'));var crypto=require(_0x0daf('0xb'));var jsforce=require(_0x0daf('0xc'));var deskjs=require(_0x0daf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0daf('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0daf('0xf'));var qs=require(_0x0daf('0x10'));var as=require(_0x0daf('0x11'));var hardwareService=require(_0x0daf('0x12'));var logger=require('../../config/logger')(_0x0daf('0x13'));var utils=require('../../config/utils');var config=require(_0x0daf('0x14'));var licenseUtil=require(_0x0daf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a2a84,_0x39563f){_0x39563f=_0x39563f||0xcc;return function(_0xa19c0e){if(_0xa19c0e){return _0x3a2a84[_0x0daf('0x16')](_0x39563f);}return _0x3a2a84[_0x0daf('0x17')](_0x39563f)['end']();};}function respondWithResult(_0x1dea07,_0x3c5cff){_0x3c5cff=_0x3c5cff||0xc8;return function(_0x2aa9ef){if(_0x2aa9ef){return _0x1dea07['status'](_0x3c5cff)[_0x0daf('0x18')](_0x2aa9ef);}};}function respondWithFilteredResult(_0x1088b6,_0x19f674){return function(_0x26ccae){if(_0x26ccae){var _0x2add5b=typeof _0x19f674[_0x0daf('0x19')]===_0x0daf('0x1a')&&typeof _0x19f674['limit']===_0x0daf('0x1a');var _0x1d6f31=_0x26ccae[_0x0daf('0x1b')];var _0xec2f59=_0x2add5b?0x0:_0x19f674[_0x0daf('0x19')];var _0x2dfbf0=_0x2add5b?_0x26ccae[_0x0daf('0x1b')]:_0x19f674[_0x0daf('0x19')]+_0x19f674[_0x0daf('0x1c')];var _0xe20f8f;if(_0x2dfbf0>=_0x1d6f31){_0x2dfbf0=_0x1d6f31;_0xe20f8f=0xc8;}else{_0xe20f8f=0xce;}_0x1088b6['status'](_0xe20f8f);return _0x1088b6[_0x0daf('0x1d')](_0x0daf('0x1e'),_0xec2f59+'-'+_0x2dfbf0+'/'+_0x1d6f31)[_0x0daf('0x18')](_0x26ccae);}return null;};}function patchUpdates(_0x3683a7){return function(_0x496e8b){try{jsonpatch[_0x0daf('0x1f')](_0x496e8b,_0x3683a7,!![]);}catch(_0x202408){return BPromise[_0x0daf('0x20')](_0x202408);}return _0x496e8b[_0x0daf('0x21')]();};}function saveUpdates(_0x34fb11,_0x724638){return function(_0x50f7a6){if(_0x50f7a6){return _0x50f7a6[_0x0daf('0x22')](_0x34fb11)[_0x0daf('0x23')](function(_0x10ab5c){return _0x10ab5c;});}return null;};}function removeEntity(_0x9be1fa,_0x31780e){return function(_0x300386){if(_0x300386){return _0x300386[_0x0daf('0x24')]()[_0x0daf('0x23')](function(){_0x9be1fa[_0x0daf('0x17')](0xcc)[_0x0daf('0x25')]();});}};}function handleEntityNotFound(_0x200945,_0x1997d5){return function(_0x653085){if(!_0x653085){_0x200945[_0x0daf('0x16')](0x194);}return _0x653085;};}function handleError(_0x1736c6,_0x51f365){_0x51f365=_0x51f365||0x1f4;return function(_0x5c2922){logger[_0x0daf('0x26')](_0x5c2922['stack']);if(_0x5c2922['name']){delete _0x5c2922['name'];}_0x1736c6[_0x0daf('0x17')](_0x51f365)[_0x0daf('0x27')](_0x5c2922);};}exports[_0x0daf('0x28')]=function(_0x2a8db9,_0x762a3b){var _0x24a31a={},_0x3aec94={},_0x1a272e={'count':0x0,'rows':[]};var _0x27bec7=_[_0x0daf('0x29')](db[_0x0daf('0x2a')][_0x0daf('0x2b')],function(_0x451fa8){return{'name':_0x451fa8['fieldName'],'type':_0x451fa8[_0x0daf('0x2c')]['key']};});_0x3aec94[_0x0daf('0x2d')]=_[_0x0daf('0x29')](_0x27bec7,'name');_0x3aec94['query']=_[_0x0daf('0x2e')](_0x2a8db9[_0x0daf('0x2f')]);_0x3aec94[_0x0daf('0x30')]=_[_0x0daf('0x31')](_0x3aec94[_0x0daf('0x2d')],_0x3aec94['query']);_0x24a31a[_0x0daf('0x32')]=_[_0x0daf('0x31')](_0x3aec94['model'],qs[_0x0daf('0x33')](_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x33')]));_0x24a31a[_0x0daf('0x32')]=_0x24a31a['attributes'][_0x0daf('0x34')]?_0x24a31a[_0x0daf('0x32')]:_0x3aec94[_0x0daf('0x2d')];if(!_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x35')](_0x0daf('0x36'))){_0x24a31a[_0x0daf('0x1c')]=qs[_0x0daf('0x1c')](_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x1c')]);_0x24a31a[_0x0daf('0x19')]=qs[_0x0daf('0x19')](_0x2a8db9['query'][_0x0daf('0x19')]);}_0x24a31a['order']=qs[_0x0daf('0x37')](_0x2a8db9[_0x0daf('0x2f')]['sort']);_0x24a31a[_0x0daf('0x38')]=qs[_0x0daf('0x30')](_['pick'](_0x2a8db9['query'],_0x3aec94[_0x0daf('0x30')]),_0x27bec7);if(_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x39')]){_0x24a31a['where']=_[_0x0daf('0x3a')](_0x24a31a[_0x0daf('0x38')],{'$or':_[_0x0daf('0x29')](_0x27bec7,function(_0x412e7a){if(_0x412e7a[_0x0daf('0x2c')]!=='VIRTUAL'){var _0x53987c={};_0x53987c[_0x412e7a[_0x0daf('0x3b')]]={'$like':'%'+_0x2a8db9[_0x0daf('0x2f')]['filter']+'%'};return _0x53987c;}})});}_0x24a31a=_[_0x0daf('0x3a')]({},_0x24a31a,_0x2a8db9[_0x0daf('0x3c')]);var _0x426265={'where':_0x24a31a['where']};return db[_0x0daf('0x2a')]['count'](_0x426265)['then'](function(_0x1c55fc){_0x1a272e[_0x0daf('0x1b')]=_0x1c55fc;if(_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x3d')]){_0x24a31a[_0x0daf('0x3e')]=[{'all':!![]}];}return db[_0x0daf('0x2a')][_0x0daf('0x3f')](_0x24a31a);})[_0x0daf('0x23')](function(_0x4a2805){_0x1a272e[_0x0daf('0x40')]=_0x4a2805;return _0x1a272e;})[_0x0daf('0x23')](respondWithFilteredResult(_0x762a3b,_0x24a31a))[_0x0daf('0x41')](handleError(_0x762a3b,null));};exports['show']=function(_0x49c5e3,_0x437043){var _0x230cf3={'raw':!![],'where':{'id':_0x49c5e3[_0x0daf('0x42')]['id']}},_0x3d521d={};_0x3d521d[_0x0daf('0x2d')]=_[_0x0daf('0x2e')](db['FreshsalesField'][_0x0daf('0x2b')]);_0x3d521d['query']=_[_0x0daf('0x2e')](_0x49c5e3[_0x0daf('0x2f')]);_0x3d521d[_0x0daf('0x30')]=_['intersection'](_0x3d521d['model'],_0x3d521d[_0x0daf('0x2f')]);_0x230cf3['attributes']=_[_0x0daf('0x31')](_0x3d521d[_0x0daf('0x2d')],qs[_0x0daf('0x33')](_0x49c5e3[_0x0daf('0x2f')]['fields']));_0x230cf3[_0x0daf('0x32')]=_0x230cf3[_0x0daf('0x32')][_0x0daf('0x34')]?_0x230cf3[_0x0daf('0x32')]:_0x3d521d[_0x0daf('0x2d')];if(_0x49c5e3[_0x0daf('0x2f')][_0x0daf('0x3d')]){_0x230cf3['include']=[{'all':!![]}];}_0x230cf3=_[_0x0daf('0x3a')]({},_0x230cf3,_0x49c5e3[_0x0daf('0x3c')]);return db[_0x0daf('0x2a')]['find'](_0x230cf3)[_0x0daf('0x23')](handleEntityNotFound(_0x437043,null))[_0x0daf('0x23')](respondWithResult(_0x437043,null))['catch'](handleError(_0x437043,null));};exports[_0x0daf('0x43')]=function(_0x58e385,_0xffad6e){return db[_0x0daf('0x2a')][_0x0daf('0x43')](_0x58e385[_0x0daf('0x44')],{})['then'](respondWithResult(_0xffad6e,0xc9))[_0x0daf('0x41')](handleError(_0xffad6e,null));};exports['update']=function(_0x51bfc5,_0x49d49c){if(_0x51bfc5['body']['id']){delete _0x51bfc5[_0x0daf('0x44')]['id'];}return db[_0x0daf('0x2a')][_0x0daf('0x45')]({'where':{'id':_0x51bfc5[_0x0daf('0x42')]['id']}})['then'](handleEntityNotFound(_0x49d49c,null))[_0x0daf('0x23')](saveUpdates(_0x51bfc5['body'],null))[_0x0daf('0x23')](respondWithResult(_0x49d49c,null))[_0x0daf('0x41')](handleError(_0x49d49c,null));};exports[_0x0daf('0x24')]=function(_0x475ecc,_0x5077d2){return db[_0x0daf('0x2a')][_0x0daf('0x45')]({'where':{'id':_0x475ecc[_0x0daf('0x42')]['id']}})[_0x0daf('0x23')](handleEntityNotFound(_0x5077d2,null))['then'](removeEntity(_0x5077d2,null))[_0x0daf('0x41')](handleError(_0x5077d2,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 59459d0..220a615 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 _0x8276=['moment','bluebird','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util'];(function(_0x278038,_0x56c03a){var _0x53b217=function(_0x29ce08){while(--_0x29ce08){_0x278038['push'](_0x278038['shift']());}};_0x53b217(++_0x56c03a);}(_0x8276,0xa7));var _0x6827=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8276[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6827('0x0'));var util=require(_0x6827('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6827('0x2'));var BPromise=require(_0x6827('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6827('0x4'));var rimraf=require(_0x6827('0x5'));var config=require('../../config/environment');var attributes=require(_0x6827('0x6'));module[_0x6827('0x7')]=function(_0xc96297,_0x1c7983){return _0xc96297[_0x6827('0x8')](_0x6827('0x9'),attributes,{'tableName':_0x6827('0xa'),'paranoid':![],'indexes':[{'name':_0x6827('0xb'),'fields':[_0x6827('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c99=['idField','FieldId','lodash','../../config/logger','request-promise','path','../../config/environment','./intFreshsalesField.attributes','int_freshsales_fields','freshsales_unique_index'];(function(_0x35d63e,_0x5cab15){var _0x34da15=function(_0x290925){while(--_0x290925){_0x35d63e['push'](_0x35d63e['shift']());}};_0x34da15(++_0x5cab15);}(_0x4c99,0x1ec));var _0x94c9=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x4c99[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x94c9('0x0'));var util=require('util');var logger=require(_0x94c9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x94c9('0x2'));var fs=require('fs');var path=require(_0x94c9('0x3'));var rimraf=require('rimraf');var config=require(_0x94c9('0x4'));var attributes=require(_0x94c9('0x5'));module['exports']=function(_0x42d25e,_0x4e4ffd){return _0x42d25e['define']('FreshsalesField',attributes,{'tableName':_0x94c9('0x6'),'paranoid':![],'indexes':[{'name':_0x94c9('0x7'),'fields':[_0x94c9('0x8'),_0x94c9('0x9')],'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 14d1b7c..8702663 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 _0x326f=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x29e196,_0x2c8e55){var _0x73051=function(_0x36489b){while(--_0x36489b){_0x29e196['push'](_0x29e196['shift']());}};_0x73051(++_0x2c8e55);}(_0x326f,0xd1));var _0xf326=function(_0x1e63f6,_0x364e4c){_0x1e63f6=_0x1e63f6-0x0;var _0x2700a4=_0x326f[_0x1e63f6];return _0x2700a4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +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(_0x71fe37,_0x35c623){var _0x1edffb=function(_0x24bc96){while(--_0x24bc96){_0x71fe37['push'](_0x71fe37['shift']());}};_0x1edffb(++_0x35c623);}(_0xeff8,0x186));var _0x8eff=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xeff8[_0xac151d];return _0x111dba;};'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 diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 8588681..9c00bdb 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(_0x49d29f,_0x140728){var _0x569ea5=function(_0x3f2806){while(--_0x3f2806){_0x49d29f['push'](_0x49d29f['shift']());}};_0x569ea5(++_0x140728);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x32f115,_0x56f838){var _0x2477df=function(_0x53dd22){while(--_0x53dd22){_0x32f115['push'](_0x32f115['shift']());}};_0x2477df(++_0x56f838);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index f3d03f1..1b57ac4 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 _0x1b97=['sequelize','exports','STRING','username','ENUM','integrationTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b97,0x15c));var _0x71b9=function(_0x17048a,_0x3176b3){_0x17048a=_0x17048a-0x0;var _0x3f075d=_0x1b97[_0x17048a];return _0x3f075d;};'use strict';var Sequelize=require(_0x71b9('0x0'));module[_0x71b9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x71b9('0x2')],'unique':_0x71b9('0x3')},'remoteUri':{'type':Sequelize[_0x71b9('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x71b9('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x71b9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x71b9('0x4')](_0x71b9('0x5'),'newTab'),'defaultValue':_0x71b9('0x5')}}; \ No newline at end of file +var _0x434a=['username','ENUM','integrationTab','sequelize','exports','STRING'];(function(_0x53fee4,_0x3c3021){var _0x3cdb68=function(_0x14a15f){while(--_0x14a15f){_0x53fee4['push'](_0x53fee4['shift']());}};_0x3cdb68(++_0x3c3021);}(_0x434a,0x9f));var _0xa434=function(_0x33330b,_0x5eb0c8){_0x33330b=_0x33330b-0x0;var _0x49a98c=_0x434a[_0x33330b];return _0x49a98c;};'use strict';var Sequelize=require(_0xa434('0x0'));module[_0xa434('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa434('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xa434('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa434('0x2')]},'clientId':{'type':Sequelize[_0xa434('0x2')]},'clientSecret':{'type':Sequelize[_0xa434('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa434('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa434('0x4')](_0xa434('0x5'),'newTab'),'defaultValue':_0xa434('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 8915801..2b42e97 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 _0x91e7=['false','test','statusCode','stringify','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','create','body','params','getConfigurations','findOne','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceConfiguration','SalesforceField','getFields','Task','clientSecret','username','securityToken','slice','lastIndexOf','Connection','clientId','login','password','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','string','picklist','boolean','email','textarea','remove','includes','custom','picklistValues','label','value','true','False'];(function(_0x469b7d,_0x4317b0){var _0x5d4b29=function(_0x3b5210){while(--_0x3b5210){_0x469b7d['push'](_0x469b7d['shift']());}};_0x5d4b29(++_0x4317b0);}(_0x91e7,0xf9));var _0x791e=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x91e7[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x791e('0x1'));var moment=require(_0x791e('0x2'));var BPromise=require(_0x791e('0x3'));var Mustache=require(_0x791e('0x4'));var util=require(_0x791e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x791e('0x6'));var ejs=require(_0x791e('0x7'));var fs=require('fs');var fs_extra=require(_0x791e('0x8'));var _=require(_0x791e('0x9'));var squel=require('squel');var crypto=require(_0x791e('0xa'));var jsforce=require(_0x791e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x791e('0x6'));var querystring=require(_0x791e('0xc'));var Papa=require(_0x791e('0xd'));var Redis=require(_0x791e('0xe'));var authService=require(_0x791e('0xf'));var qs=require(_0x791e('0x10'));var as=require(_0x791e('0x11'));var hardwareService=require(_0x791e('0x12'));var logger=require(_0x791e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x791e('0x14'));var licenseUtil=require(_0x791e('0x15'));var db=require(_0x791e('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x19c1c3,_0x15e8b3){_0x15e8b3=_0x15e8b3||0xcc;return function(_0x5d32fb){if(_0x5d32fb){return _0x19c1c3['sendStatus'](_0x15e8b3);}return _0x19c1c3['status'](_0x15e8b3)[_0x791e('0x17')]();};}function respondWithResult(_0x291967,_0x58018f){_0x58018f=_0x58018f||0xc8;return function(_0x381bcc){if(_0x381bcc){return _0x291967[_0x791e('0x18')](_0x58018f)[_0x791e('0x19')](_0x381bcc);}};}function respondWithFilteredResult(_0x24514e,_0x499c05){return function(_0x5be547){if(_0x5be547){var _0x255d42=typeof _0x499c05['offset']===_0x791e('0x1a')&&typeof _0x499c05[_0x791e('0x1b')]===_0x791e('0x1a');var _0x2f7448=_0x5be547[_0x791e('0x1c')];var _0xa08113=_0x255d42?0x0:_0x499c05['offset'];var _0x51b900=_0x255d42?_0x5be547[_0x791e('0x1c')]:_0x499c05['offset']+_0x499c05[_0x791e('0x1b')];var _0x4723b0;if(_0x51b900>=_0x2f7448){_0x51b900=_0x2f7448;_0x4723b0=0xc8;}else{_0x4723b0=0xce;}_0x24514e['status'](_0x4723b0);return _0x24514e[_0x791e('0x1d')](_0x791e('0x1e'),_0xa08113+'-'+_0x51b900+'/'+_0x2f7448)[_0x791e('0x19')](_0x5be547);}return null;};}function patchUpdates(_0x3b26ae){return function(_0x5c180b){try{jsonpatch[_0x791e('0x1f')](_0x5c180b,_0x3b26ae,!![]);}catch(_0x809a8e){return BPromise[_0x791e('0x20')](_0x809a8e);}return _0x5c180b['save']();};}function saveUpdates(_0x506987,_0x3016b7){return function(_0xd89baf){if(_0xd89baf){return _0xd89baf[_0x791e('0x21')](_0x506987)[_0x791e('0x22')](function(_0x1ba250){return _0x1ba250;});}return null;};}function removeEntity(_0x584054,_0x545394){return function(_0x39ae45){if(_0x39ae45){return _0x39ae45[_0x791e('0x23')]()[_0x791e('0x22')](function(){_0x584054[_0x791e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x674f66,_0x48fa1d){return function(_0x46b864){if(!_0x46b864){_0x674f66[_0x791e('0x24')](0x194);}return _0x46b864;};}function handleError(_0x391336,_0x39c9be){_0x39c9be=_0x39c9be||0x1f4;return function(_0x2c4f7e){logger[_0x791e('0x25')](_0x2c4f7e[_0x791e('0x26')]);if(_0x2c4f7e['name']){delete _0x2c4f7e['name'];}_0x391336[_0x791e('0x18')](_0x39c9be)['send'](_0x2c4f7e);};}exports[_0x791e('0x27')]=function(_0x25fc39,_0x70fab){var _0x528f0b={},_0x251391={},_0x70eca={'count':0x0,'rows':[]};var _0x24e9f5=_[_0x791e('0x28')](db[_0x791e('0x29')][_0x791e('0x2a')],function(_0x35b201){return{'name':_0x35b201[_0x791e('0x2b')],'type':_0x35b201[_0x791e('0x2c')][_0x791e('0x2d')]};});_0x251391[_0x791e('0x2e')]=_['map'](_0x24e9f5,_0x791e('0x2f'));_0x251391[_0x791e('0x30')]=_[_0x791e('0x31')](_0x25fc39[_0x791e('0x30')]);_0x251391[_0x791e('0x32')]=_[_0x791e('0x33')](_0x251391[_0x791e('0x2e')],_0x251391[_0x791e('0x30')]);_0x528f0b[_0x791e('0x34')]=_['intersection'](_0x251391[_0x791e('0x2e')],qs[_0x791e('0x35')](_0x25fc39[_0x791e('0x30')][_0x791e('0x35')]));_0x528f0b[_0x791e('0x34')]=_0x528f0b['attributes'][_0x791e('0x36')]?_0x528f0b[_0x791e('0x34')]:_0x251391[_0x791e('0x2e')];if(!_0x25fc39[_0x791e('0x30')]['hasOwnProperty']('nolimit')){_0x528f0b[_0x791e('0x1b')]=qs[_0x791e('0x1b')](_0x25fc39[_0x791e('0x30')][_0x791e('0x1b')]);_0x528f0b[_0x791e('0x37')]=qs['offset'](_0x25fc39[_0x791e('0x30')][_0x791e('0x37')]);}_0x528f0b[_0x791e('0x38')]=qs[_0x791e('0x39')](_0x25fc39[_0x791e('0x30')][_0x791e('0x39')]);_0x528f0b[_0x791e('0x3a')]=qs['filters'](_['pick'](_0x25fc39[_0x791e('0x30')],_0x251391[_0x791e('0x32')]),_0x24e9f5);if(_0x25fc39[_0x791e('0x30')][_0x791e('0x3b')]){_0x528f0b[_0x791e('0x3a')]=_[_0x791e('0x3c')](_0x528f0b[_0x791e('0x3a')],{'$or':_[_0x791e('0x28')](_0x24e9f5,function(_0x433408){if(_0x433408[_0x791e('0x2c')]!==_0x791e('0x3d')){var _0x329b13={};_0x329b13[_0x433408['name']]={'$like':'%'+_0x25fc39[_0x791e('0x30')][_0x791e('0x3b')]+'%'};return _0x329b13;}})});}_0x528f0b=_[_0x791e('0x3c')]({},_0x528f0b,_0x25fc39[_0x791e('0x3e')]);var _0x59b235={'where':_0x528f0b[_0x791e('0x3a')]};return db[_0x791e('0x29')]['count'](_0x59b235)[_0x791e('0x22')](function(_0x20a2bc){_0x70eca[_0x791e('0x1c')]=_0x20a2bc;if(_0x25fc39['query'][_0x791e('0x3f')]){_0x528f0b['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x791e('0x40')](_0x528f0b);})[_0x791e('0x22')](function(_0x182986){_0x70eca[_0x791e('0x41')]=_0x182986;return _0x70eca;})[_0x791e('0x22')](respondWithFilteredResult(_0x70fab,_0x528f0b))[_0x791e('0x42')](handleError(_0x70fab,null));};exports['show']=function(_0x3ab514,_0x518f59){var _0x598543={'raw':![],'where':{'id':_0x3ab514['params']['id']}},_0x3be831={};_0x3be831[_0x791e('0x2e')]=_[_0x791e('0x31')](db[_0x791e('0x29')][_0x791e('0x2a')]);_0x3be831[_0x791e('0x30')]=_[_0x791e('0x31')](_0x3ab514[_0x791e('0x30')]);_0x3be831[_0x791e('0x32')]=_[_0x791e('0x33')](_0x3be831[_0x791e('0x2e')],_0x3be831[_0x791e('0x30')]);_0x598543[_0x791e('0x34')]=_[_0x791e('0x33')](_0x3be831['model'],qs[_0x791e('0x35')](_0x3ab514[_0x791e('0x30')][_0x791e('0x35')]));_0x598543['attributes']=_0x598543['attributes'][_0x791e('0x36')]?_0x598543[_0x791e('0x34')]:_0x3be831[_0x791e('0x2e')];if(_0x3ab514[_0x791e('0x30')][_0x791e('0x3f')]){_0x598543[_0x791e('0x43')]=[{'all':!![]}];}_0x598543=_[_0x791e('0x3c')]({},_0x598543,_0x3ab514['options']);return db[_0x791e('0x29')][_0x791e('0x44')](_0x598543)[_0x791e('0x22')](handleEntityNotFound(_0x518f59,null))[_0x791e('0x22')](respondWithResult(_0x518f59,null))[_0x791e('0x42')](handleError(_0x518f59,null));};exports[_0x791e('0x45')]=function(_0x39d4f2,_0x47cdb6){return db['SalesforceAccount']['create'](_0x39d4f2[_0x791e('0x46')],{})[_0x791e('0x22')](respondWithResult(_0x47cdb6,0xc9))[_0x791e('0x42')](handleError(_0x47cdb6,null));};exports[_0x791e('0x21')]=function(_0x3d1fca,_0x168e75){if(_0x3d1fca[_0x791e('0x46')]['id']){delete _0x3d1fca['body']['id'];}return db[_0x791e('0x29')][_0x791e('0x44')]({'where':{'id':_0x3d1fca[_0x791e('0x47')]['id']}})[_0x791e('0x22')](handleEntityNotFound(_0x168e75,null))[_0x791e('0x22')](saveUpdates(_0x3d1fca['body'],null))['then'](respondWithResult(_0x168e75,null))['catch'](handleError(_0x168e75,null));};exports['destroy']=function(_0xc572ed,_0x7703b1){return db[_0x791e('0x29')][_0x791e('0x44')]({'where':{'id':_0xc572ed[_0x791e('0x47')]['id']}})[_0x791e('0x22')](handleEntityNotFound(_0x7703b1,null))['then'](removeEntity(_0x7703b1,null))['catch'](handleError(_0x7703b1,null));};exports[_0x791e('0x48')]=function(_0x2dc4cf,_0x1bd7e4,_0x324ed1){var _0x2401f3={};var _0x404b59={};var _0x5a5829;var _0x32c0fc;return db[_0x791e('0x29')][_0x791e('0x49')]({'where':{'id':_0x2dc4cf[_0x791e('0x47')]['id']}})[_0x791e('0x22')](handleEntityNotFound(_0x1bd7e4,null))['then'](function(_0x59743c){if(_0x59743c){_0x5a5829=_0x59743c;_0x404b59[_0x791e('0x2e')]=_['keys'](db['SalesforceConfiguration'][_0x791e('0x2a')]);_0x404b59['query']=_[_0x791e('0x31')](_0x2dc4cf['query']);_0x404b59[_0x791e('0x32')]=_[_0x791e('0x33')](_0x404b59[_0x791e('0x2e')],_0x404b59[_0x791e('0x30')]);_0x2401f3[_0x791e('0x34')]=_[_0x791e('0x33')](_0x404b59[_0x791e('0x2e')],qs[_0x791e('0x35')](_0x2dc4cf[_0x791e('0x30')][_0x791e('0x35')]));_0x2401f3[_0x791e('0x34')]=_0x2401f3[_0x791e('0x34')][_0x791e('0x36')]?_0x2401f3['attributes']:_0x404b59[_0x791e('0x2e')];_0x2401f3['order']=qs[_0x791e('0x39')](_0x2dc4cf[_0x791e('0x30')]['sort']);_0x2401f3[_0x791e('0x3a')]=qs[_0x791e('0x32')](_[_0x791e('0x4a')](_0x2dc4cf[_0x791e('0x30')],_0x404b59[_0x791e('0x32')]));if(_0x2dc4cf['query'][_0x791e('0x3b')]){_0x2401f3[_0x791e('0x3a')]=_[_0x791e('0x3c')](_0x2401f3[_0x791e('0x3a')],{'$or':_['map'](_0x2401f3[_0x791e('0x34')],function(_0x469c7a){var _0x4df120={};_0x4df120[_0x469c7a]={'$like':'%'+_0x2dc4cf[_0x791e('0x30')][_0x791e('0x3b')]+'%'};return _0x4df120;})});}_0x2401f3=_['merge']({},_0x2401f3,_0x2dc4cf[_0x791e('0x3e')]);return _0x5a5829[_0x791e('0x48')](_0x2401f3);}})[_0x791e('0x22')](function(_0x4df621){if(_0x4df621){_0x32c0fc=_0x4df621[_0x791e('0x36')];if(!_0x2dc4cf[_0x791e('0x30')][_0x791e('0x4b')](_0x791e('0x4c'))){_0x2401f3[_0x791e('0x1b')]=qs[_0x791e('0x1b')](_0x2dc4cf[_0x791e('0x30')][_0x791e('0x1b')]);_0x2401f3['offset']=qs[_0x791e('0x37')](_0x2dc4cf[_0x791e('0x30')][_0x791e('0x37')]);}return _0x5a5829['getConfigurations'](_0x2401f3);}})[_0x791e('0x22')](function(_0x4b2253){if(_0x4b2253){return _0x4b2253?{'count':_0x32c0fc,'rows':_0x4b2253}:null;}})['then'](respondWithResult(_0x1bd7e4,null))[_0x791e('0x42')](handleError(_0x1bd7e4,null));};exports[_0x791e('0x4d')]=function(_0x3ee2a9,_0x5890e3,_0x552c78){if(_0x3ee2a9[_0x791e('0x46')]['id']){delete _0x3ee2a9['body']['id'];}return db[_0x791e('0x29')]['findOne']({'where':{'id':_0x3ee2a9[_0x791e('0x47')]['id']}})[_0x791e('0x22')](handleEntityNotFound(_0x5890e3,null))[_0x791e('0x22')](function(_0xd7723c){if(_0xd7723c){_0x3ee2a9[_0x791e('0x46')][_0x791e('0x4e')]=_0xd7723c['id'];_0x3ee2a9[_0x791e('0x46')][_0x791e('0x4f')]=integrations[_0x791e('0x50')](_0x3ee2a9[_0x791e('0x46')][_0x791e('0x51')],_0x3ee2a9[_0x791e('0x46')][_0x791e('0x2c')]);_0x3ee2a9[_0x791e('0x46')][_0x791e('0x52')]=integrations['getDescriptions'](_0x3ee2a9[_0x791e('0x46')][_0x791e('0x51')],_0x3ee2a9[_0x791e('0x46')]['type']);return db[_0x791e('0x53')][_0x791e('0x45')](_0x3ee2a9[_0x791e('0x46')],{'include':[{'model':db[_0x791e('0x54')],'as':_0x791e('0x4f')},{'model':db['SalesforceField'],'as':_0x791e('0x52')}]});}return null;})['then'](respondWithResult(_0x5890e3,null))[_0x791e('0x42')](handleError(_0x5890e3,null));};exports[_0x791e('0x55')]=function(_0x31f986,_0x24bca1,_0x1d51f6){var _0x4371af;var _0x1543ae='';var _0x3f2a02=_0x791e('0x56');return db[_0x791e('0x29')][_0x791e('0x49')]({'where':{'id':_0x31f986[_0x791e('0x47')]['id']},'attributes':['id','remoteUri','clientId',_0x791e('0x57'),_0x791e('0x58'),'password',_0x791e('0x59')]})['then'](handleEntityNotFound(_0x24bca1,null))[_0x791e('0x22')](function(_0x425f1b){if(_0x425f1b){_0x1543ae=_0x425f1b['remoteUri'];var _0x569799=_0x1543ae[_0x791e('0x5a')](-0x1);if(_0x569799==='/'){_0x1543ae=_0x1543ae['substring'](0x0,_0x1543ae[_0x791e('0x5b')](_0x569799));}_0x4371af=new jsforce[(_0x791e('0x5c'))]({'oauth2':{'loginUrl':_0x1543ae,'clientId':_0x425f1b[_0x791e('0x5d')],'clientSecret':_0x425f1b[_0x791e('0x57')]}});return _0x4371af[_0x791e('0x5e')](_0x425f1b['username'],_0x425f1b[_0x791e('0x5f')]['concat'](_0x425f1b[_0x791e('0x59')]));}})['then'](function(_0x36fdce){if(_0x36fdce){if(!_[_0x791e('0x60')](_0x31f986[_0x791e('0x30')][_0x791e('0x61')])){_0x3f2a02=_0x31f986[_0x791e('0x30')]['ticketType'];}return _0x4371af[_0x791e('0x62')](_0x3f2a02)[_0x791e('0x63')]();}})[_0x791e('0x22')](function(_0xedbc71){var _0x1f5fc3=[_0x791e('0x64'),_0x791e('0x65'),_0x791e('0x66'),_0x791e('0x67'),'Subject','Description'];var _0x17e819=[_0x791e('0x68'),'int',_0x791e('0x69'),_0x791e('0x6a'),_0x791e('0x6b'),_0x791e('0x6c'),'phone'];if(_0xedbc71){_[_0x791e('0x6d')](_0xedbc71[_0x791e('0x35')],function(_0x374303){return _0x1f5fc3[_0x791e('0x6e')](_0x374303[_0x791e('0x2f')])||!_0x17e819[_0x791e('0x6e')](_0x374303[_0x791e('0x2c')]);});return{'count':_0xedbc71[_0x791e('0x35')][_0x791e('0x36')],'rows':_[_0x791e('0x28')](_0xedbc71[_0x791e('0x35')],function(_0x59c737){return{'id':_0x59c737[_0x791e('0x2f')],'name':_0x59c737['label'],'custom':_0x59c737[_0x791e('0x6f')],'options':_0x59c737[_0x791e('0x70')]['length']>0x0?_[_0x791e('0x28')](_0x59c737[_0x791e('0x70')],function(_0x558e45){return{'name':_0x558e45[_0x791e('0x71')],'value':_0x558e45[_0x791e('0x72')]};}):_0x59c737[_0x791e('0x2c')]==_0x791e('0x6a')?[{'name':'True','value':_0x791e('0x73')},{'name':_0x791e('0x74'),'value':_0x791e('0x75')}]:[]};})};}})[_0x791e('0x22')](respondWithResult(_0x24bca1,null))[_0x791e('0x42')](function(_0x168d11){var _0x2512bf=_0x31f986['query'][_0x791e('0x76')]?0x1f4:_0x168d11[_0x791e('0x77')]||0x1f4;logger[_0x791e('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x791e('0x55'),_0x2512bf,JSON[_0x791e('0x78')](_0x168d11));delete _0x168d11[_0x791e('0x2f')];if(_0x2512bf===0x191){_0x2512bf=0x190;}_0x24bca1['status'](_0x2512bf)['send'](_0x31f986[_0x791e('0x30')][_0x791e('0x76')]?{'message':_0x791e('0x79'),'statusCode':_0x168d11[_0x791e('0x77')]}:_0x168d11);});}; \ No newline at end of file +var _0x8579=['status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','findAll','rows','catch','show','params','options','find','create','body','destroy','findOne','SalesforceConfiguration','order','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','SalesforceField','getFields','Task','remoteUri','clientSecret','username','password','slice','substring','Connection','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','int','picklist','email','textarea','remove','includes','label','custom','picklistValues','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0x1fa469,_0x5e19b1){var _0x22cc36=function(_0x4939bb){while(--_0x4939bb){_0x1fa469['push'](_0x1fa469['shift']());}};_0x22cc36(++_0x5e19b1);}(_0x8579,0x65));var _0x9857=function(_0x40b164,_0x47b205){_0x40b164=_0x40b164-0x0;var _0x3bde36=_0x8579[_0x40b164];return _0x3bde36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9857('0x0'));var zipdir=require(_0x9857('0x1'));var jsonpatch=require(_0x9857('0x2'));var rp=require(_0x9857('0x3'));var moment=require(_0x9857('0x4'));var BPromise=require(_0x9857('0x5'));var Mustache=require(_0x9857('0x6'));var util=require(_0x9857('0x7'));var path=require(_0x9857('0x8'));var sox=require(_0x9857('0x9'));var csv=require(_0x9857('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9857('0xb'));var _=require('lodash');var squel=require(_0x9857('0xc'));var crypto=require(_0x9857('0xd'));var jsforce=require(_0x9857('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9857('0xa'));var querystring=require(_0x9857('0xf'));var Papa=require(_0x9857('0x10'));var Redis=require(_0x9857('0x11'));var authService=require(_0x9857('0x12'));var qs=require(_0x9857('0x13'));var as=require(_0x9857('0x14'));var hardwareService=require(_0x9857('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x9857('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9857('0x17'));var db=require(_0x9857('0x18'))['db'];var integrations=require(_0x9857('0x19'));function respondWithStatusCode(_0x22dad1,_0x1464dd){_0x1464dd=_0x1464dd||0xcc;return function(_0x41ebfb){if(_0x41ebfb){return _0x22dad1[_0x9857('0x1a')](_0x1464dd);}return _0x22dad1[_0x9857('0x1b')](_0x1464dd)[_0x9857('0x1c')]();};}function respondWithResult(_0x5ebb50,_0x14de48){_0x14de48=_0x14de48||0xc8;return function(_0x225001){if(_0x225001){return _0x5ebb50['status'](_0x14de48)[_0x9857('0x1d')](_0x225001);}};}function respondWithFilteredResult(_0x4032ea,_0x35f7a9){return function(_0x3f33d2){if(_0x3f33d2){var _0x1b733f=typeof _0x35f7a9[_0x9857('0x1e')]===_0x9857('0x1f')&&typeof _0x35f7a9['limit']==='undefined';var _0x3d9e96=_0x3f33d2[_0x9857('0x20')];var _0x29fc61=_0x1b733f?0x0:_0x35f7a9[_0x9857('0x1e')];var _0x3fe753=_0x1b733f?_0x3f33d2[_0x9857('0x20')]:_0x35f7a9[_0x9857('0x1e')]+_0x35f7a9[_0x9857('0x21')];var _0x1f6d6f;if(_0x3fe753>=_0x3d9e96){_0x3fe753=_0x3d9e96;_0x1f6d6f=0xc8;}else{_0x1f6d6f=0xce;}_0x4032ea[_0x9857('0x1b')](_0x1f6d6f);return _0x4032ea['set'](_0x9857('0x22'),_0x29fc61+'-'+_0x3fe753+'/'+_0x3d9e96)[_0x9857('0x1d')](_0x3f33d2);}return null;};}function patchUpdates(_0x3d5147){return function(_0xf7e567){try{jsonpatch[_0x9857('0x23')](_0xf7e567,_0x3d5147,!![]);}catch(_0x3bc0a7){return BPromise[_0x9857('0x24')](_0x3bc0a7);}return _0xf7e567[_0x9857('0x25')]();};}function saveUpdates(_0x2a753d,_0x17dd92){return function(_0x344c00){if(_0x344c00){return _0x344c00[_0x9857('0x26')](_0x2a753d)['then'](function(_0x59ebaf){return _0x59ebaf;});}return null;};}function removeEntity(_0x1f4d62,_0x3a8417){return function(_0x25105f){if(_0x25105f){return _0x25105f['destroy']()['then'](function(){_0x1f4d62['status'](0xcc)[_0x9857('0x1c')]();});}};}function handleEntityNotFound(_0x4d719e,_0x10fd16){return function(_0x1ef42d){if(!_0x1ef42d){_0x4d719e[_0x9857('0x1a')](0x194);}return _0x1ef42d;};}function handleError(_0x566b06,_0x5553fd){_0x5553fd=_0x5553fd||0x1f4;return function(_0x4b661a){logger[_0x9857('0x27')](_0x4b661a[_0x9857('0x28')]);if(_0x4b661a[_0x9857('0x29')]){delete _0x4b661a['name'];}_0x566b06[_0x9857('0x1b')](_0x5553fd)[_0x9857('0x2a')](_0x4b661a);};}exports[_0x9857('0x2b')]=function(_0x44a676,_0x2ef99e){var _0x3d88f7={},_0x4249a8={},_0x286072={'count':0x0,'rows':[]};var _0x208f57=_[_0x9857('0x2c')](db[_0x9857('0x2d')][_0x9857('0x2e')],function(_0x5f46e8){return{'name':_0x5f46e8[_0x9857('0x2f')],'type':_0x5f46e8[_0x9857('0x30')][_0x9857('0x31')]};});_0x4249a8[_0x9857('0x32')]=_[_0x9857('0x2c')](_0x208f57,'name');_0x4249a8[_0x9857('0x33')]=_[_0x9857('0x34')](_0x44a676['query']);_0x4249a8[_0x9857('0x35')]=_[_0x9857('0x36')](_0x4249a8['model'],_0x4249a8['query']);_0x3d88f7[_0x9857('0x37')]=_[_0x9857('0x36')](_0x4249a8[_0x9857('0x32')],qs[_0x9857('0x38')](_0x44a676[_0x9857('0x33')]['fields']));_0x3d88f7[_0x9857('0x37')]=_0x3d88f7[_0x9857('0x37')][_0x9857('0x39')]?_0x3d88f7[_0x9857('0x37')]:_0x4249a8[_0x9857('0x32')];if(!_0x44a676[_0x9857('0x33')][_0x9857('0x3a')]('nolimit')){_0x3d88f7[_0x9857('0x21')]=qs[_0x9857('0x21')](_0x44a676['query'][_0x9857('0x21')]);_0x3d88f7[_0x9857('0x1e')]=qs['offset'](_0x44a676[_0x9857('0x33')][_0x9857('0x1e')]);}_0x3d88f7['order']=qs['sort'](_0x44a676[_0x9857('0x33')][_0x9857('0x3b')]);_0x3d88f7[_0x9857('0x3c')]=qs[_0x9857('0x35')](_[_0x9857('0x3d')](_0x44a676[_0x9857('0x33')],_0x4249a8[_0x9857('0x35')]),_0x208f57);if(_0x44a676[_0x9857('0x33')][_0x9857('0x3e')]){_0x3d88f7[_0x9857('0x3c')]=_[_0x9857('0x3f')](_0x3d88f7['where'],{'$or':_[_0x9857('0x2c')](_0x208f57,function(_0x18b949){if(_0x18b949['type']!==_0x9857('0x40')){var _0x2ab53f={};_0x2ab53f[_0x18b949[_0x9857('0x29')]]={'$like':'%'+_0x44a676[_0x9857('0x33')][_0x9857('0x3e')]+'%'};return _0x2ab53f;}})});}_0x3d88f7=_[_0x9857('0x3f')]({},_0x3d88f7,_0x44a676['options']);var _0x4b4540={'where':_0x3d88f7[_0x9857('0x3c')]};return db[_0x9857('0x2d')][_0x9857('0x20')](_0x4b4540)[_0x9857('0x41')](function(_0x3d6f75){_0x286072['count']=_0x3d6f75;if(_0x44a676[_0x9857('0x33')][_0x9857('0x42')]){_0x3d88f7['include']=[{'all':!![]}];}return db[_0x9857('0x2d')][_0x9857('0x43')](_0x3d88f7);})[_0x9857('0x41')](function(_0x5142fa){_0x286072[_0x9857('0x44')]=_0x5142fa;return _0x286072;})[_0x9857('0x41')](respondWithFilteredResult(_0x2ef99e,_0x3d88f7))[_0x9857('0x45')](handleError(_0x2ef99e,null));};exports[_0x9857('0x46')]=function(_0x33eddd,_0x1a044){var _0x304e4e={'raw':![],'where':{'id':_0x33eddd[_0x9857('0x47')]['id']}},_0x4e0a6c={};_0x4e0a6c[_0x9857('0x32')]=_[_0x9857('0x34')](db[_0x9857('0x2d')][_0x9857('0x2e')]);_0x4e0a6c['query']=_[_0x9857('0x34')](_0x33eddd[_0x9857('0x33')]);_0x4e0a6c[_0x9857('0x35')]=_['intersection'](_0x4e0a6c[_0x9857('0x32')],_0x4e0a6c['query']);_0x304e4e[_0x9857('0x37')]=_[_0x9857('0x36')](_0x4e0a6c[_0x9857('0x32')],qs['fields'](_0x33eddd[_0x9857('0x33')][_0x9857('0x38')]));_0x304e4e['attributes']=_0x304e4e[_0x9857('0x37')][_0x9857('0x39')]?_0x304e4e['attributes']:_0x4e0a6c[_0x9857('0x32')];if(_0x33eddd[_0x9857('0x33')][_0x9857('0x42')]){_0x304e4e['include']=[{'all':!![]}];}_0x304e4e=_[_0x9857('0x3f')]({},_0x304e4e,_0x33eddd[_0x9857('0x48')]);return db[_0x9857('0x2d')][_0x9857('0x49')](_0x304e4e)['then'](handleEntityNotFound(_0x1a044,null))[_0x9857('0x41')](respondWithResult(_0x1a044,null))['catch'](handleError(_0x1a044,null));};exports[_0x9857('0x4a')]=function(_0x21ff06,_0x3f9f04){return db[_0x9857('0x2d')][_0x9857('0x4a')](_0x21ff06[_0x9857('0x4b')],{})[_0x9857('0x41')](respondWithResult(_0x3f9f04,0xc9))[_0x9857('0x45')](handleError(_0x3f9f04,null));};exports['update']=function(_0xc4e9b2,_0x2b13e3){if(_0xc4e9b2[_0x9857('0x4b')]['id']){delete _0xc4e9b2[_0x9857('0x4b')]['id'];}return db[_0x9857('0x2d')]['find']({'where':{'id':_0xc4e9b2[_0x9857('0x47')]['id']}})[_0x9857('0x41')](handleEntityNotFound(_0x2b13e3,null))[_0x9857('0x41')](saveUpdates(_0xc4e9b2[_0x9857('0x4b')],null))[_0x9857('0x41')](respondWithResult(_0x2b13e3,null))[_0x9857('0x45')](handleError(_0x2b13e3,null));};exports[_0x9857('0x4c')]=function(_0x1767cb,_0x460fc5){return db['SalesforceAccount'][_0x9857('0x49')]({'where':{'id':_0x1767cb['params']['id']}})[_0x9857('0x41')](handleEntityNotFound(_0x460fc5,null))[_0x9857('0x41')](removeEntity(_0x460fc5,null))['catch'](handleError(_0x460fc5,null));};exports['getConfigurations']=function(_0x3bc269,_0x398327,_0x4f9ed6){var _0x305113={};var _0x33a05c={};var _0x31b457;var _0x10c970;return db[_0x9857('0x2d')][_0x9857('0x4d')]({'where':{'id':_0x3bc269[_0x9857('0x47')]['id']}})[_0x9857('0x41')](handleEntityNotFound(_0x398327,null))[_0x9857('0x41')](function(_0x51656c){if(_0x51656c){_0x31b457=_0x51656c;_0x33a05c[_0x9857('0x32')]=_[_0x9857('0x34')](db[_0x9857('0x4e')][_0x9857('0x2e')]);_0x33a05c[_0x9857('0x33')]=_['keys'](_0x3bc269[_0x9857('0x33')]);_0x33a05c['filters']=_[_0x9857('0x36')](_0x33a05c['model'],_0x33a05c[_0x9857('0x33')]);_0x305113[_0x9857('0x37')]=_[_0x9857('0x36')](_0x33a05c[_0x9857('0x32')],qs[_0x9857('0x38')](_0x3bc269[_0x9857('0x33')][_0x9857('0x38')]));_0x305113[_0x9857('0x37')]=_0x305113[_0x9857('0x37')][_0x9857('0x39')]?_0x305113[_0x9857('0x37')]:_0x33a05c[_0x9857('0x32')];_0x305113[_0x9857('0x4f')]=qs[_0x9857('0x3b')](_0x3bc269['query'][_0x9857('0x3b')]);_0x305113[_0x9857('0x3c')]=qs['filters'](_['pick'](_0x3bc269[_0x9857('0x33')],_0x33a05c['filters']));if(_0x3bc269[_0x9857('0x33')]['filter']){_0x305113[_0x9857('0x3c')]=_[_0x9857('0x3f')](_0x305113[_0x9857('0x3c')],{'$or':_[_0x9857('0x2c')](_0x305113[_0x9857('0x37')],function(_0x2fceb1){var _0x4fedd8={};_0x4fedd8[_0x2fceb1]={'$like':'%'+_0x3bc269['query']['filter']+'%'};return _0x4fedd8;})});}_0x305113=_[_0x9857('0x3f')]({},_0x305113,_0x3bc269['options']);return _0x31b457[_0x9857('0x50')](_0x305113);}})[_0x9857('0x41')](function(_0x180ab6){if(_0x180ab6){_0x10c970=_0x180ab6[_0x9857('0x39')];if(!_0x3bc269[_0x9857('0x33')][_0x9857('0x3a')]('nolimit')){_0x305113[_0x9857('0x21')]=qs[_0x9857('0x21')](_0x3bc269[_0x9857('0x33')][_0x9857('0x21')]);_0x305113[_0x9857('0x1e')]=qs[_0x9857('0x1e')](_0x3bc269[_0x9857('0x33')][_0x9857('0x1e')]);}return _0x31b457['getConfigurations'](_0x305113);}})[_0x9857('0x41')](function(_0x55ecef){if(_0x55ecef){return _0x55ecef?{'count':_0x10c970,'rows':_0x55ecef}:null;}})[_0x9857('0x41')](respondWithResult(_0x398327,null))[_0x9857('0x45')](handleError(_0x398327,null));};exports['addConfiguration']=function(_0x44cfe9,_0x49d02d,_0x2ca72d){if(_0x44cfe9[_0x9857('0x4b')]['id']){delete _0x44cfe9[_0x9857('0x4b')]['id'];}return db[_0x9857('0x2d')][_0x9857('0x4d')]({'where':{'id':_0x44cfe9[_0x9857('0x47')]['id']}})['then'](handleEntityNotFound(_0x49d02d,null))[_0x9857('0x41')](function(_0x1394ed){if(_0x1394ed){_0x44cfe9['body'][_0x9857('0x51')]=_0x1394ed['id'];_0x44cfe9[_0x9857('0x4b')]['Subjects']=integrations[_0x9857('0x52')](_0x44cfe9[_0x9857('0x4b')][_0x9857('0x53')],_0x44cfe9[_0x9857('0x4b')][_0x9857('0x30')]);_0x44cfe9['body'][_0x9857('0x54')]=integrations[_0x9857('0x55')](_0x44cfe9[_0x9857('0x4b')]['channel'],_0x44cfe9[_0x9857('0x4b')][_0x9857('0x30')]);return db[_0x9857('0x4e')][_0x9857('0x4a')](_0x44cfe9['body'],{'include':[{'model':db['SalesforceField'],'as':_0x9857('0x56')},{'model':db[_0x9857('0x57')],'as':'Descriptions'}]});}return null;})[_0x9857('0x41')](respondWithResult(_0x49d02d,null))[_0x9857('0x45')](handleError(_0x49d02d,null));};exports[_0x9857('0x58')]=function(_0x2ea261,_0x22bf66,_0x5b5840){var _0xa8ab23;var _0x23d619='';var _0x37f949=_0x9857('0x59');return db['SalesforceAccount'][_0x9857('0x4d')]({'where':{'id':_0x2ea261['params']['id']},'attributes':['id',_0x9857('0x5a'),'clientId',_0x9857('0x5b'),_0x9857('0x5c'),_0x9857('0x5d'),'securityToken']})['then'](handleEntityNotFound(_0x22bf66,null))[_0x9857('0x41')](function(_0x33a43e){if(_0x33a43e){_0x23d619=_0x33a43e['remoteUri'];var _0x55afed=_0x23d619[_0x9857('0x5e')](-0x1);if(_0x55afed==='/'){_0x23d619=_0x23d619[_0x9857('0x5f')](0x0,_0x23d619['lastIndexOf'](_0x55afed));}_0xa8ab23=new jsforce[(_0x9857('0x60'))]({'oauth2':{'loginUrl':_0x23d619,'clientId':_0x33a43e['clientId'],'clientSecret':_0x33a43e[_0x9857('0x5b')]}});return _0xa8ab23['login'](_0x33a43e['username'],_0x33a43e['password'][_0x9857('0x61')](_0x33a43e[_0x9857('0x62')]));}})[_0x9857('0x41')](function(_0x1cfe83){if(_0x1cfe83){if(!_[_0x9857('0x63')](_0x2ea261[_0x9857('0x33')][_0x9857('0x64')])){_0x37f949=_0x2ea261[_0x9857('0x33')][_0x9857('0x64')];}return _0xa8ab23[_0x9857('0x65')](_0x37f949)[_0x9857('0x66')]();}})[_0x9857('0x41')](function(_0x28f5d8){var _0x296e6a=[_0x9857('0x67'),_0x9857('0x68'),'IsReminderSet',_0x9857('0x69'),_0x9857('0x6a'),_0x9857('0x6b')];var _0x57d59c=[_0x9857('0x6c'),_0x9857('0x6d'),_0x9857('0x6e'),'boolean',_0x9857('0x6f'),_0x9857('0x70'),'phone'];if(_0x28f5d8){_[_0x9857('0x71')](_0x28f5d8['fields'],function(_0x1299e0){return _0x296e6a[_0x9857('0x72')](_0x1299e0[_0x9857('0x29')])||!_0x57d59c['includes'](_0x1299e0['type']);});return{'count':_0x28f5d8[_0x9857('0x38')][_0x9857('0x39')],'rows':_[_0x9857('0x2c')](_0x28f5d8[_0x9857('0x38')],function(_0x153ea4){return{'id':_0x153ea4[_0x9857('0x29')],'name':_0x153ea4[_0x9857('0x73')],'custom':_0x153ea4[_0x9857('0x74')],'options':_0x153ea4[_0x9857('0x75')][_0x9857('0x39')]>0x0?_['map'](_0x153ea4[_0x9857('0x75')],function(_0x5ce153){return{'name':_0x5ce153[_0x9857('0x73')],'value':_0x5ce153[_0x9857('0x76')]};}):_0x153ea4[_0x9857('0x30')]==_0x9857('0x77')?[{'name':_0x9857('0x78'),'value':_0x9857('0x79')},{'name':_0x9857('0x7a'),'value':_0x9857('0x7b')}]:[]};})};}})[_0x9857('0x41')](respondWithResult(_0x22bf66,null))['catch'](function(_0x90448b){var _0xe5d23d=_0x2ea261['query'][_0x9857('0x7c')]?0x1f4:_0x90448b[_0x9857('0x7d')]||0x1f4;logger['error'](_0x9857('0x7e'),_0x9857('0x58'),_0xe5d23d,JSON['stringify'](_0x90448b));delete _0x90448b[_0x9857('0x29')];if(_0xe5d23d===0x191){_0xe5d23d=0x190;}_0x22bf66[_0x9857('0x1b')](_0xe5d23d)['send'](_0x2ea261['query'][_0x9857('0x7c')]?{'message':_0x9857('0x7f'),'statusCode':_0x90448b[_0x9857('0x7d')]}:_0x90448b);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 7f40dcc..14d3d87 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 _0x9fca=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','SalesforceAccount','lodash','util','../../config/logger'];(function(_0x439162,_0x2789b1){var _0x52b012=function(_0x27c25e){while(--_0x27c25e){_0x439162['push'](_0x439162['shift']());}};_0x52b012(++_0x2789b1);}(_0x9fca,0x7f));var _0xa9fc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9fca[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa9fc('0x0'));var util=require(_0xa9fc('0x1'));var logger=require(_0xa9fc('0x2'))(_0xa9fc('0x3'));var moment=require(_0xa9fc('0x4'));var BPromise=require(_0xa9fc('0x5'));var rp=require(_0xa9fc('0x6'));var fs=require('fs');var path=require(_0xa9fc('0x7'));var rimraf=require(_0xa9fc('0x8'));var config=require(_0xa9fc('0x9'));var attributes=require(_0xa9fc('0xa'));var integrations=require('../../components/integrations/configuration');module[_0xa9fc('0xb')]=function(_0x11f4be,_0x7a7b58){return _0x11f4be['define'](_0xa9fc('0xc'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0913=['define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0913,0x10b));var _0x3091=function(_0x2a223d,_0xb934f4){_0x2a223d=_0x2a223d-0x0;var _0x5217c2=_0x0913[_0x2a223d];return _0x5217c2;};'use strict';var _=require(_0x3091('0x0'));var util=require(_0x3091('0x1'));var logger=require(_0x3091('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3091('0x3'));var rp=require(_0x3091('0x4'));var fs=require('fs');var path=require(_0x3091('0x5'));var rimraf=require('rimraf');var config=require(_0x3091('0x6'));var attributes=require(_0x3091('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x3091('0x8')]=function(_0x47ab49,_0x5b8a9c){return _0x47ab49[_0x3091('0x9')](_0x3091('0xa'),attributes,{'tableName':_0x3091('0xb'),'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 b4c36e3..c61e277 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 _0xe14b=['catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','find','then','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2ba4f5,_0x37669c){var _0xb6738b=function(_0x25c8d9){while(--_0x25c8d9){_0x2ba4f5['push'](_0x2ba4f5['shift']());}};_0xb6738b(++_0x37669c);}(_0xe14b,0x16d));var _0xbe14=function(_0x15dfea,_0x4115ab){_0x15dfea=_0x15dfea-0x0;var _0x42be68=_0xe14b[_0x15dfea];return _0x42be68;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rs=require(_0xbe14('0x4'));var fs=require('fs');var Redis=require(_0xbe14('0x5'));var db=require(_0xbe14('0x6'))['db'];var utils=require(_0xbe14('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x8'));var jayson=require(_0xbe14('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x415e41,_0x438bdb,_0x289629){return new BPromise(function(_0x1e388c,_0x5882c2){return client[_0xbe14('0xa')](_0x415e41,_0x289629)['then'](function(_0xd36244){logger[_0xbe14('0xb')](_0xbe14('0xc'),_0x438bdb,_0xbe14('0xd'));logger[_0xbe14('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x438bdb,_0xbe14('0xd'),JSON[_0xbe14('0xf')](_0xd36244));if(_0xd36244['error']){if(_0xd36244[_0xbe14('0x10')][_0xbe14('0x11')]===0x1f4){logger['error'](_0xbe14('0xc'),_0x438bdb,_0xd36244[_0xbe14('0x10')][_0xbe14('0x12')]);return _0x5882c2(_0xd36244['error']['message']);}logger[_0xbe14('0x10')](_0xbe14('0xc'),_0x438bdb,_0xd36244[_0xbe14('0x10')][_0xbe14('0x12')]);return _0x1e388c(_0xd36244[_0xbe14('0x10')][_0xbe14('0x12')]);}else{logger[_0xbe14('0xb')](_0xbe14('0xc'),_0x438bdb,_0xbe14('0xd'));_0x1e388c(_0xd36244[_0xbe14('0x13')][_0xbe14('0x12')]);}})[_0xbe14('0x14')](function(_0x58080d){logger[_0xbe14('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x438bdb,_0x58080d);_0x5882c2(_0x58080d);});});}exports[_0xbe14('0x15')]=function(_0x45ea30){var _0x5db620=this;return new Promise(function(_0x580be5,_0x18c8c5){return db[_0xbe14('0x16')][_0xbe14('0x17')]({'raw':_0x45ea30[_0xbe14('0x18')]?_0x45ea30['options'][_0xbe14('0x19')]===undefined?!![]:![]:!![],'where':_0x45ea30[_0xbe14('0x18')]?_0x45ea30[_0xbe14('0x18')][_0xbe14('0x1a')]||null:null,'attributes':_0x45ea30[_0xbe14('0x18')]?_0x45ea30[_0xbe14('0x18')][_0xbe14('0x1b')]||null:null,'limit':_0x45ea30[_0xbe14('0x18')]?_0x45ea30[_0xbe14('0x18')][_0xbe14('0x1c')]||null:null,'include':_0x45ea30[_0xbe14('0x18')]?_0x45ea30[_0xbe14('0x18')]['include']?_[_0xbe14('0x1d')](_0x45ea30[_0xbe14('0x18')][_0xbe14('0x1e')],function(_0x505648){return{'model':db[_0x505648[_0xbe14('0x1f')]],'as':_0x505648['as'],'attributes':_0x505648['attributes'],'include':_0x505648[_0xbe14('0x1e')]?_[_0xbe14('0x1d')](_0x505648[_0xbe14('0x1e')],function(_0x5ad7ee){return{'model':db[_0x5ad7ee[_0xbe14('0x1f')]],'as':_0x5ad7ee['as'],'attributes':_0x5ad7ee[_0xbe14('0x1b')],'include':_0x5ad7ee[_0xbe14('0x1e')]?_[_0xbe14('0x1d')](_0x5ad7ee[_0xbe14('0x1e')],function(_0x315ff8){return{'model':db[_0x315ff8[_0xbe14('0x1f')]],'as':_0x315ff8['as'],'attributes':_0x315ff8[_0xbe14('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb7df58){logger['info'](_0xbe14('0x15'),_0x45ea30);logger[_0xbe14('0xe')](_0xbe14('0x15'),_0x45ea30,JSON[_0xbe14('0xf')](_0xb7df58));_0x580be5(_0xb7df58);})[_0xbe14('0x14')](function(_0x5a5684){logger[_0xbe14('0x10')]('GetSalesforceAccount',_0x5a5684[_0xbe14('0x12')],_0x45ea30);_0x18c8c5(_0x5db620['error'](0x1f4,_0x5a5684['message']));});});};exports['ShowSalesforceAccount']=function(_0x44e941){var _0x43176b=this;return new Promise(function(_0x4df3b3,_0x59b8fa){return db[_0xbe14('0x16')][_0xbe14('0x20')]({'raw':_0x44e941[_0xbe14('0x18')]?_0x44e941[_0xbe14('0x18')][_0xbe14('0x19')]===undefined?!![]:![]:!![],'where':_0x44e941[_0xbe14('0x18')]?_0x44e941[_0xbe14('0x18')][_0xbe14('0x1a')]||null:null,'attributes':_0x44e941['options']?_0x44e941[_0xbe14('0x18')][_0xbe14('0x1b')]||null:null,'include':_0x44e941[_0xbe14('0x18')]?_0x44e941[_0xbe14('0x18')]['include']?_[_0xbe14('0x1d')](_0x44e941[_0xbe14('0x18')][_0xbe14('0x1e')],function(_0x34dc93){return{'model':db[_0x34dc93[_0xbe14('0x1f')]],'as':_0x34dc93['as'],'attributes':_0x34dc93[_0xbe14('0x1b')],'include':_0x34dc93[_0xbe14('0x1e')]?_[_0xbe14('0x1d')](_0x34dc93[_0xbe14('0x1e')],function(_0x2b8a09){return{'model':db[_0x2b8a09[_0xbe14('0x1f')]],'as':_0x2b8a09['as'],'attributes':_0x2b8a09[_0xbe14('0x1b')],'include':_0x2b8a09['include']?_['map'](_0x2b8a09[_0xbe14('0x1e')],function(_0x1c73c1){return{'model':db[_0x1c73c1['model']],'as':_0x1c73c1['as'],'attributes':_0x1c73c1[_0xbe14('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbe14('0x21')](function(_0x48374b){logger[_0xbe14('0xb')](_0xbe14('0x22'),_0x44e941);logger[_0xbe14('0xe')](_0xbe14('0x22'),_0x44e941,JSON[_0xbe14('0xf')](_0x48374b));_0x4df3b3(_0x48374b);})[_0xbe14('0x14')](function(_0x36fd1a){logger[_0xbe14('0x10')]('ShowSalesforceAccount',_0x36fd1a[_0xbe14('0x12')],_0x44e941);_0x59b8fa(_0x43176b[_0xbe14('0x10')](0x1f4,_0x36fd1a[_0xbe14('0x12')]));});});}; \ No newline at end of file +var _0x8a83=['http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetSalesforceAccount','findAll','options','raw','where','limit','map','include','model','attributes','debug','catch','ShowSalesforceAccount','SalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3199eb,_0x39132f){var _0x4a3b11=function(_0x13ac6a){while(--_0x13ac6a){_0x3199eb['push'](_0x3199eb['shift']());}};_0x4a3b11(++_0x39132f);}(_0x8a83,0x1b0));var _0x38a8=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x8a83[_0x3f94f9];return _0x46f84f;};'use strict';var _=require(_0x38a8('0x0'));var util=require(_0x38a8('0x1'));var moment=require(_0x38a8('0x2'));var BPromise=require(_0x38a8('0x3'));var rs=require(_0x38a8('0x4'));var fs=require('fs');var Redis=require(_0x38a8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x38a8('0x6'));var logger=require(_0x38a8('0x7'))(_0x38a8('0x8'));var config=require(_0x38a8('0x9'));var jayson=require(_0x38a8('0xa'));var client=jayson[_0x38a8('0xb')][_0x38a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x395f81,_0x83f145,_0x2006ec){return new BPromise(function(_0x1cf4d0,_0x3aa21a){return client[_0x38a8('0xd')](_0x395f81,_0x2006ec)[_0x38a8('0xe')](function(_0x2ab7b7){logger[_0x38a8('0xf')](_0x38a8('0x10'),_0x83f145,_0x38a8('0x11'));logger['debug'](_0x38a8('0x12'),_0x83f145,_0x38a8('0x11'),JSON[_0x38a8('0x13')](_0x2ab7b7));if(_0x2ab7b7['error']){if(_0x2ab7b7[_0x38a8('0x14')][_0x38a8('0x15')]===0x1f4){logger[_0x38a8('0x14')](_0x38a8('0x10'),_0x83f145,_0x2ab7b7[_0x38a8('0x14')][_0x38a8('0x16')]);return _0x3aa21a(_0x2ab7b7['error']['message']);}logger[_0x38a8('0x14')](_0x38a8('0x10'),_0x83f145,_0x2ab7b7['error'][_0x38a8('0x16')]);return _0x1cf4d0(_0x2ab7b7[_0x38a8('0x14')][_0x38a8('0x16')]);}else{logger[_0x38a8('0xf')](_0x38a8('0x10'),_0x83f145,_0x38a8('0x11'));_0x1cf4d0(_0x2ab7b7['result'][_0x38a8('0x16')]);}})['catch'](function(_0x44a961){logger[_0x38a8('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x83f145,_0x44a961);_0x3aa21a(_0x44a961);});});}exports[_0x38a8('0x17')]=function(_0x5822fc){var _0x5a370b=this;return new Promise(function(_0x7f3ada,_0x425b47){return db['SalesforceAccount'][_0x38a8('0x18')]({'raw':_0x5822fc['options']?_0x5822fc[_0x38a8('0x19')][_0x38a8('0x1a')]===undefined?!![]:![]:!![],'where':_0x5822fc[_0x38a8('0x19')]?_0x5822fc[_0x38a8('0x19')][_0x38a8('0x1b')]||null:null,'attributes':_0x5822fc[_0x38a8('0x19')]?_0x5822fc['options']['attributes']||null:null,'limit':_0x5822fc['options']?_0x5822fc[_0x38a8('0x19')][_0x38a8('0x1c')]||null:null,'include':_0x5822fc[_0x38a8('0x19')]?_0x5822fc[_0x38a8('0x19')]['include']?_[_0x38a8('0x1d')](_0x5822fc[_0x38a8('0x19')][_0x38a8('0x1e')],function(_0x26659c){return{'model':db[_0x26659c[_0x38a8('0x1f')]],'as':_0x26659c['as'],'attributes':_0x26659c[_0x38a8('0x20')],'include':_0x26659c[_0x38a8('0x1e')]?_['map'](_0x26659c[_0x38a8('0x1e')],function(_0x19fd55){return{'model':db[_0x19fd55[_0x38a8('0x1f')]],'as':_0x19fd55['as'],'attributes':_0x19fd55[_0x38a8('0x20')],'include':_0x19fd55[_0x38a8('0x1e')]?_['map'](_0x19fd55[_0x38a8('0x1e')],function(_0x18ae35){return{'model':db[_0x18ae35[_0x38a8('0x1f')]],'as':_0x18ae35['as'],'attributes':_0x18ae35['attributes']};}):[]};}):[]};}):[]:[]})[_0x38a8('0xe')](function(_0x379397){logger['info'](_0x38a8('0x17'),_0x5822fc);logger[_0x38a8('0x21')](_0x38a8('0x17'),_0x5822fc,JSON['stringify'](_0x379397));_0x7f3ada(_0x379397);})[_0x38a8('0x22')](function(_0x27ede2){logger['error'](_0x38a8('0x17'),_0x27ede2[_0x38a8('0x16')],_0x5822fc);_0x425b47(_0x5a370b[_0x38a8('0x14')](0x1f4,_0x27ede2[_0x38a8('0x16')]));});});};exports[_0x38a8('0x23')]=function(_0x11e3eb){var _0x51a020=this;return new Promise(function(_0x53fb2d,_0x4aaa72){return db[_0x38a8('0x24')]['find']({'raw':_0x11e3eb['options']?_0x11e3eb[_0x38a8('0x19')][_0x38a8('0x1a')]===undefined?!![]:![]:!![],'where':_0x11e3eb[_0x38a8('0x19')]?_0x11e3eb[_0x38a8('0x19')][_0x38a8('0x1b')]||null:null,'attributes':_0x11e3eb['options']?_0x11e3eb['options'][_0x38a8('0x20')]||null:null,'include':_0x11e3eb[_0x38a8('0x19')]?_0x11e3eb[_0x38a8('0x19')][_0x38a8('0x1e')]?_[_0x38a8('0x1d')](_0x11e3eb[_0x38a8('0x19')][_0x38a8('0x1e')],function(_0x3b14e8){return{'model':db[_0x3b14e8['model']],'as':_0x3b14e8['as'],'attributes':_0x3b14e8['attributes'],'include':_0x3b14e8[_0x38a8('0x1e')]?_[_0x38a8('0x1d')](_0x3b14e8['include'],function(_0x3145ee){return{'model':db[_0x3145ee[_0x38a8('0x1f')]],'as':_0x3145ee['as'],'attributes':_0x3145ee[_0x38a8('0x20')],'include':_0x3145ee[_0x38a8('0x1e')]?_[_0x38a8('0x1d')](_0x3145ee['include'],function(_0x21a228){return{'model':db[_0x21a228[_0x38a8('0x1f')]],'as':_0x21a228['as'],'attributes':_0x21a228[_0x38a8('0x20')]};}):[]};}):[]};}):[]:[]})[_0x38a8('0xe')](function(_0x54dcd6){logger[_0x38a8('0xf')](_0x38a8('0x23'),_0x11e3eb);logger[_0x38a8('0x21')](_0x38a8('0x23'),_0x11e3eb,JSON[_0x38a8('0x13')](_0x54dcd6));_0x53fb2d(_0x54dcd6);})['catch'](function(_0x166826){logger[_0x38a8('0x14')](_0x38a8('0x23'),_0x166826[_0x38a8('0x16')],_0x11e3eb);_0x4aaa72(_0x51a020[_0x38a8('0x14')](0x1f4,_0x166826[_0x38a8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 01b333f..f8057d1 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x8be9fb,_0x2f90d9){_0x8be9fb=_0x8be9fb-0x0;var _0x3b41ac=_0x0b0e[_0x8be9fb];return _0x3b41ac;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x549b29,_0x2e2b00){_0x549b29=_0x549b29-0x0;var _0x2b813f=_0x0b0e[_0x549b29];return _0x2b813f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 254c56b..0d1d2f0 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 _0x61b5=['contact_lead','STRING','sequelize','exports','ENUM','Case','Task','contact','lead','account'];(function(_0x5e6d65,_0x5db89c){var _0x5e1f75=function(_0x3729a1){while(--_0x3729a1){_0x5e6d65['push'](_0x5e6d65['shift']());}};_0x5e1f75(++_0x5db89c);}(_0x61b5,0x17e));var _0x561b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x61b5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x561b('0x0'));module[_0x561b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x561b('0x2')]('Task',_0x561b('0x3')),'defaultValue':_0x561b('0x4')},'moduleSearch':{'type':Sequelize[_0x561b('0x2')]('contact_lead',_0x561b('0x5'),_0x561b('0x6'),'account_contact_lead',_0x561b('0x7')),'defaultValue':_0x561b('0x8')},'moduleCreate':{'type':Sequelize[_0x561b('0x2')]('nothing','contact',_0x561b('0x6'),_0x561b('0x7')),'defaultValue':_0x561b('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x561b('0x9')]},'additionalSearchContact':{'type':Sequelize[_0x561b('0x9')]},'additionalSearchLead':{'type':Sequelize[_0x561b('0x9')]}}; \ No newline at end of file +var _0xc041=['STRING','Case','Task','ENUM','contact_lead','contact','account_contact_lead','account','lead','exports'];(function(_0x3297a2,_0x2ec443){var _0x2f32ae=function(_0x3acf69){while(--_0x3acf69){_0x3297a2['push'](_0x3297a2['shift']());}};_0x2f32ae(++_0x2ec443);}(_0xc041,0x153));var _0x1c04=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0xc041[_0x403f5f];return _0x15b1cd;};'use strict';var Sequelize=require('sequelize');module[_0x1c04('0x0')]={'name':{'type':Sequelize[_0x1c04('0x1')]},'description':{'type':Sequelize[_0x1c04('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x1c04('0x2')),'defaultValue':_0x1c04('0x3')},'moduleSearch':{'type':Sequelize[_0x1c04('0x4')](_0x1c04('0x5'),_0x1c04('0x6'),'lead',_0x1c04('0x7'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x1c04('0x4')]('nothing',_0x1c04('0x6'),'lead',_0x1c04('0x8')),'defaultValue':_0x1c04('0x9')},'leadId':{'type':Sequelize[_0x1c04('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x1c04('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x1c04('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x1c04('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 9565494..8dfcfd7 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 _0xb85a=['rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','SalesforceConfiguration','includeAll','include'];(function(_0x23cd00,_0x172a24){var _0x11d52f=function(_0x5528b8){while(--_0x5528b8){_0x23cd00['push'](_0x23cd00['shift']());}};_0x11d52f(++_0x172a24);}(_0xb85a,0xb0));var _0xab85=function(_0x4f5530,_0x14d560){_0x4f5530=_0x4f5530-0x0;var _0x122f09=_0xb85a[_0x4f5530];return _0x122f09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab85('0x0'));var zipdir=require(_0xab85('0x1'));var jsonpatch=require(_0xab85('0x2'));var rp=require(_0xab85('0x3'));var moment=require(_0xab85('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab85('0x5'));var path=require(_0xab85('0x6'));var sox=require(_0xab85('0x7'));var csv=require(_0xab85('0x8'));var ejs=require(_0xab85('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xab85('0xa'));var jsforce=require(_0xab85('0xb'));var deskjs=require(_0xab85('0xc'));var toCsv=require(_0xab85('0x8'));var querystring=require(_0xab85('0xd'));var Papa=require(_0xab85('0xe'));var Redis=require(_0xab85('0xf'));var authService=require(_0xab85('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xab85('0x11'));var hardwareService=require(_0xab85('0x12'));var logger=require('../../config/logger')(_0xab85('0x13'));var utils=require(_0xab85('0x14'));var config=require(_0xab85('0x15'));var licenseUtil=require(_0xab85('0x16'));var db=require(_0xab85('0x17'))['db'];function respondWithStatusCode(_0x4133d2,_0x5ac7f7){_0x5ac7f7=_0x5ac7f7||0xcc;return function(_0x45253b){if(_0x45253b){return _0x4133d2[_0xab85('0x18')](_0x5ac7f7);}return _0x4133d2[_0xab85('0x19')](_0x5ac7f7)['end']();};}function respondWithResult(_0x349d44,_0x543ceb){_0x543ceb=_0x543ceb||0xc8;return function(_0x5e69a0){if(_0x5e69a0){return _0x349d44[_0xab85('0x19')](_0x543ceb)[_0xab85('0x1a')](_0x5e69a0);}};}function respondWithFilteredResult(_0x3e9719,_0xbb28f6){return function(_0x5b2018){if(_0x5b2018){var _0x17028b=typeof _0xbb28f6[_0xab85('0x1b')]===_0xab85('0x1c')&&typeof _0xbb28f6[_0xab85('0x1d')]==='undefined';var _0x25ef05=_0x5b2018[_0xab85('0x1e')];var _0x4050b8=_0x17028b?0x0:_0xbb28f6[_0xab85('0x1b')];var _0x5dc52e=_0x17028b?_0x5b2018[_0xab85('0x1e')]:_0xbb28f6[_0xab85('0x1b')]+_0xbb28f6[_0xab85('0x1d')];var _0x27b323;if(_0x5dc52e>=_0x25ef05){_0x5dc52e=_0x25ef05;_0x27b323=0xc8;}else{_0x27b323=0xce;}_0x3e9719[_0xab85('0x19')](_0x27b323);return _0x3e9719['set'](_0xab85('0x1f'),_0x4050b8+'-'+_0x5dc52e+'/'+_0x25ef05)[_0xab85('0x1a')](_0x5b2018);}return null;};}function patchUpdates(_0x48f0a9){return function(_0x3273be){try{jsonpatch[_0xab85('0x20')](_0x3273be,_0x48f0a9,!![]);}catch(_0x1ad9f1){return BPromise[_0xab85('0x21')](_0x1ad9f1);}return _0x3273be[_0xab85('0x22')]();};}function saveUpdates(_0x442730,_0x163f76){return function(_0x3c2bc2){if(_0x3c2bc2){return _0x3c2bc2[_0xab85('0x23')](_0x442730)[_0xab85('0x24')](function(_0x2541ed){return _0x2541ed;});}return null;};}function removeEntity(_0xdbbf7b,_0x3a4897){return function(_0x13372b){if(_0x13372b){return _0x13372b[_0xab85('0x25')]()['then'](function(){_0xdbbf7b[_0xab85('0x19')](0xcc)[_0xab85('0x26')]();});}};}function handleEntityNotFound(_0x3e6d79,_0x198138){return function(_0x553bd4){if(!_0x553bd4){_0x3e6d79[_0xab85('0x18')](0x194);}return _0x553bd4;};}function handleError(_0x40dfde,_0x4f569a){_0x4f569a=_0x4f569a||0x1f4;return function(_0x78378b){logger[_0xab85('0x27')](_0x78378b[_0xab85('0x28')]);if(_0x78378b[_0xab85('0x29')]){delete _0x78378b['name'];}_0x40dfde[_0xab85('0x19')](_0x4f569a)[_0xab85('0x2a')](_0x78378b);};}exports[_0xab85('0x2b')]=function(_0x21d2e4,_0x4e2d5b){var _0x2c2582={},_0x364cb7={},_0x317558={'count':0x0,'rows':[]};var _0x5581de=_[_0xab85('0x2c')](db['SalesforceConfiguration']['rawAttributes'],function(_0x468a86){return{'name':_0x468a86[_0xab85('0x2d')],'type':_0x468a86['type'][_0xab85('0x2e')]};});_0x364cb7[_0xab85('0x2f')]=_[_0xab85('0x2c')](_0x5581de,_0xab85('0x29'));_0x364cb7['query']=_[_0xab85('0x30')](_0x21d2e4[_0xab85('0x31')]);_0x364cb7[_0xab85('0x32')]=_[_0xab85('0x33')](_0x364cb7[_0xab85('0x2f')],_0x364cb7['query']);_0x2c2582[_0xab85('0x34')]=_['intersection'](_0x364cb7[_0xab85('0x2f')],qs['fields'](_0x21d2e4[_0xab85('0x31')][_0xab85('0x35')]));_0x2c2582[_0xab85('0x34')]=_0x2c2582[_0xab85('0x34')][_0xab85('0x36')]?_0x2c2582['attributes']:_0x364cb7['model'];if(!_0x21d2e4[_0xab85('0x31')][_0xab85('0x37')]('nolimit')){_0x2c2582[_0xab85('0x1d')]=qs[_0xab85('0x1d')](_0x21d2e4[_0xab85('0x31')][_0xab85('0x1d')]);_0x2c2582['offset']=qs[_0xab85('0x1b')](_0x21d2e4[_0xab85('0x31')][_0xab85('0x1b')]);}_0x2c2582[_0xab85('0x38')]=qs[_0xab85('0x39')](_0x21d2e4['query'][_0xab85('0x39')]);_0x2c2582[_0xab85('0x3a')]=qs[_0xab85('0x32')](_[_0xab85('0x3b')](_0x21d2e4[_0xab85('0x31')],_0x364cb7['filters']),_0x5581de);if(_0x21d2e4[_0xab85('0x31')][_0xab85('0x3c')]){_0x2c2582[_0xab85('0x3a')]=_['merge'](_0x2c2582[_0xab85('0x3a')],{'$or':_[_0xab85('0x2c')](_0x5581de,function(_0x3be06a){if(_0x3be06a[_0xab85('0x3d')]!=='VIRTUAL'){var _0x198c06={};_0x198c06[_0x3be06a[_0xab85('0x29')]]={'$like':'%'+_0x21d2e4[_0xab85('0x31')][_0xab85('0x3c')]+'%'};return _0x198c06;}})});}_0x2c2582=_[_0xab85('0x3e')]({},_0x2c2582,_0x21d2e4[_0xab85('0x3f')]);var _0x1a02a1={'where':_0x2c2582[_0xab85('0x3a')]};return db[_0xab85('0x40')][_0xab85('0x1e')](_0x1a02a1)[_0xab85('0x24')](function(_0x2c9224){_0x317558[_0xab85('0x1e')]=_0x2c9224;if(_0x21d2e4[_0xab85('0x31')][_0xab85('0x41')]){_0x2c2582[_0xab85('0x42')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x2c2582);})[_0xab85('0x24')](function(_0x14b3ec){_0x317558[_0xab85('0x43')]=_0x14b3ec;return _0x317558;})[_0xab85('0x24')](respondWithFilteredResult(_0x4e2d5b,_0x2c2582))[_0xab85('0x44')](handleError(_0x4e2d5b,null));};exports[_0xab85('0x45')]=function(_0x5640ab,_0x109c96){var _0x2cb6dd={'raw':![],'where':{'id':_0x5640ab[_0xab85('0x46')]['id']}},_0x1ababb={};_0x1ababb['model']=_[_0xab85('0x30')](db['SalesforceConfiguration'][_0xab85('0x47')]);_0x1ababb[_0xab85('0x31')]=_[_0xab85('0x30')](_0x5640ab[_0xab85('0x31')]);_0x1ababb['filters']=_[_0xab85('0x33')](_0x1ababb['model'],_0x1ababb[_0xab85('0x31')]);_0x2cb6dd[_0xab85('0x34')]=_['intersection'](_0x1ababb[_0xab85('0x2f')],qs[_0xab85('0x35')](_0x5640ab[_0xab85('0x31')][_0xab85('0x35')]));_0x2cb6dd[_0xab85('0x34')]=_0x2cb6dd[_0xab85('0x34')][_0xab85('0x36')]?_0x2cb6dd[_0xab85('0x34')]:_0x1ababb['model'];if(_0x5640ab[_0xab85('0x31')][_0xab85('0x41')]){_0x2cb6dd[_0xab85('0x42')]=[{'all':!![]}];}_0x2cb6dd=_[_0xab85('0x3e')]({},_0x2cb6dd,_0x5640ab[_0xab85('0x3f')]);return db[_0xab85('0x40')][_0xab85('0x48')](_0x2cb6dd)[_0xab85('0x24')](handleEntityNotFound(_0x109c96,null))[_0xab85('0x24')](respondWithResult(_0x109c96,null))[_0xab85('0x44')](handleError(_0x109c96,null));};exports['create']=function(_0x3f9444,_0x1e5558){return db[_0xab85('0x40')][_0xab85('0x49')](_0x3f9444[_0xab85('0x4a')],{})['then'](respondWithResult(_0x1e5558,0xc9))[_0xab85('0x44')](handleError(_0x1e5558,null));};exports[_0xab85('0x23')]=function(_0x1e08c3,_0x1cc9b2){if(_0x1e08c3[_0xab85('0x4a')]['id']){delete _0x1e08c3[_0xab85('0x4a')]['id'];}return db[_0xab85('0x40')][_0xab85('0x48')]({'where':{'id':_0x1e08c3['params']['id']}})['then'](handleEntityNotFound(_0x1cc9b2,null))[_0xab85('0x24')](saveUpdates(_0x1e08c3[_0xab85('0x4a')],null))['then'](respondWithResult(_0x1cc9b2,null))[_0xab85('0x44')](handleError(_0x1cc9b2,null));};exports['destroy']=function(_0x24fc56,_0x2257a2){return db[_0xab85('0x40')]['find']({'where':{'id':_0x24fc56[_0xab85('0x46')]['id']}})[_0xab85('0x24')](handleEntityNotFound(_0x2257a2,null))[_0xab85('0x24')](removeEntity(_0x2257a2,null))[_0xab85('0x44')](handleError(_0x2257a2,null));};exports[_0xab85('0x4b')]=function(_0x4ab7ff,_0x334ce8,_0x591bd4){var _0x11f2f9={};var _0x3618f0={};var _0x5648e6;var _0x29eca1;return db['SalesforceConfiguration'][_0xab85('0x4c')]({'where':{'id':_0x4ab7ff[_0xab85('0x46')]['id']}})[_0xab85('0x24')](handleEntityNotFound(_0x334ce8,null))['then'](function(_0x29f481){if(_0x29f481){_0x5648e6=_0x29f481;_0x3618f0[_0xab85('0x2f')]=_[_0xab85('0x30')](db[_0xab85('0x4d')][_0xab85('0x47')]);_0x3618f0[_0xab85('0x31')]=_[_0xab85('0x30')](_0x4ab7ff['query']);_0x3618f0[_0xab85('0x32')]=_[_0xab85('0x33')](_0x3618f0[_0xab85('0x2f')],_0x3618f0['query']);_0x11f2f9[_0xab85('0x34')]=_[_0xab85('0x33')](_0x3618f0[_0xab85('0x2f')],qs[_0xab85('0x35')](_0x4ab7ff['query'][_0xab85('0x35')]));_0x11f2f9['attributes']=_0x11f2f9[_0xab85('0x34')][_0xab85('0x36')]?_0x11f2f9[_0xab85('0x34')]:_0x3618f0[_0xab85('0x2f')];_0x11f2f9[_0xab85('0x38')]=qs[_0xab85('0x39')](_0x4ab7ff['query']['sort']);_0x11f2f9['where']=qs[_0xab85('0x32')](_[_0xab85('0x3b')](_0x4ab7ff[_0xab85('0x31')],_0x3618f0[_0xab85('0x32')]));if(_0x4ab7ff[_0xab85('0x31')][_0xab85('0x3c')]){_0x11f2f9[_0xab85('0x3a')]=_[_0xab85('0x3e')](_0x11f2f9[_0xab85('0x3a')],{'$or':_[_0xab85('0x2c')](_0x11f2f9[_0xab85('0x34')],function(_0x12a040){var _0x4188f8={};_0x4188f8[_0x12a040]={'$like':'%'+_0x4ab7ff[_0xab85('0x31')]['filter']+'%'};return _0x4188f8;})});}_0x11f2f9=_[_0xab85('0x3e')]({},_0x11f2f9,_0x4ab7ff['options']);return _0x5648e6[_0xab85('0x4b')](_0x11f2f9);}})[_0xab85('0x24')](function(_0x723a1e){if(_0x723a1e){_0x29eca1=_0x723a1e[_0xab85('0x36')];if(!_0x4ab7ff[_0xab85('0x31')][_0xab85('0x37')](_0xab85('0x4e'))){_0x11f2f9['limit']=qs[_0xab85('0x1d')](_0x4ab7ff['query'][_0xab85('0x1d')]);_0x11f2f9[_0xab85('0x1b')]=qs['offset'](_0x4ab7ff['query'][_0xab85('0x1b')]);}return _0x5648e6[_0xab85('0x4b')](_0x11f2f9);}})[_0xab85('0x24')](function(_0x398ffa){if(_0x398ffa){return _0x398ffa?{'count':_0x29eca1,'rows':_0x398ffa}:null;}})[_0xab85('0x24')](respondWithResult(_0x334ce8,null))[_0xab85('0x44')](handleError(_0x334ce8,null));};exports[_0xab85('0x4f')]=function(_0x2ca609,_0xacc47e,_0x3ac8ea){var _0x5f4564={};var _0x45a45b={};var _0x56f99b;var _0x5e6b6f;return db['SalesforceConfiguration'][_0xab85('0x4c')]({'where':{'id':_0x2ca609[_0xab85('0x46')]['id']}})[_0xab85('0x24')](handleEntityNotFound(_0xacc47e,null))['then'](function(_0x1970ad){if(_0x1970ad){_0x56f99b=_0x1970ad;_0x45a45b[_0xab85('0x2f')]=_[_0xab85('0x30')](db[_0xab85('0x4d')][_0xab85('0x47')]);_0x45a45b[_0xab85('0x31')]=_[_0xab85('0x30')](_0x2ca609['query']);_0x45a45b['filters']=_[_0xab85('0x33')](_0x45a45b[_0xab85('0x2f')],_0x45a45b[_0xab85('0x31')]);_0x5f4564[_0xab85('0x34')]=_['intersection'](_0x45a45b[_0xab85('0x2f')],qs[_0xab85('0x35')](_0x2ca609[_0xab85('0x31')][_0xab85('0x35')]));_0x5f4564['attributes']=_0x5f4564[_0xab85('0x34')][_0xab85('0x36')]?_0x5f4564[_0xab85('0x34')]:_0x45a45b[_0xab85('0x2f')];_0x5f4564['order']=qs['sort'](_0x2ca609[_0xab85('0x31')][_0xab85('0x39')]);_0x5f4564[_0xab85('0x3a')]=qs[_0xab85('0x32')](_[_0xab85('0x3b')](_0x2ca609[_0xab85('0x31')],_0x45a45b['filters']));if(_0x2ca609['query'][_0xab85('0x3c')]){_0x5f4564['where']=_[_0xab85('0x3e')](_0x5f4564[_0xab85('0x3a')],{'$or':_[_0xab85('0x2c')](_0x5f4564[_0xab85('0x34')],function(_0x5ea738){var _0x442b81={};_0x442b81[_0x5ea738]={'$like':'%'+_0x2ca609[_0xab85('0x31')][_0xab85('0x3c')]+'%'};return _0x442b81;})});}_0x5f4564=_[_0xab85('0x3e')]({},_0x5f4564,_0x2ca609[_0xab85('0x3f')]);return _0x56f99b['getSubjects'](_0x5f4564);}})[_0xab85('0x24')](function(_0x3cafc4){if(_0x3cafc4){_0x5e6b6f=_0x3cafc4[_0xab85('0x36')];if(!_0x2ca609[_0xab85('0x31')][_0xab85('0x37')](_0xab85('0x4e'))){_0x5f4564[_0xab85('0x1d')]=qs[_0xab85('0x1d')](_0x2ca609[_0xab85('0x31')][_0xab85('0x1d')]);_0x5f4564['offset']=qs[_0xab85('0x1b')](_0x2ca609[_0xab85('0x31')][_0xab85('0x1b')]);}return _0x56f99b['getSubjects'](_0x5f4564);}})[_0xab85('0x24')](function(_0x59d6c3){if(_0x59d6c3){return _0x59d6c3?{'count':_0x5e6b6f,'rows':_0x59d6c3}:null;}})[_0xab85('0x24')](respondWithResult(_0xacc47e,null))[_0xab85('0x44')](handleError(_0xacc47e,null));};exports[_0xab85('0x50')]=function(_0x2a7b57,_0x1680b3,_0x35a337){var _0x23c814={};var _0x4e9f08={};var _0x53bc22;var _0x5baa8b;return db['SalesforceConfiguration'][_0xab85('0x4c')]({'where':{'id':_0x2a7b57[_0xab85('0x46')]['id']}})[_0xab85('0x24')](handleEntityNotFound(_0x1680b3,null))[_0xab85('0x24')](function(_0x59e423){if(_0x59e423){_0x53bc22=_0x59e423;_0x4e9f08['model']=_[_0xab85('0x30')](db[_0xab85('0x4d')][_0xab85('0x47')]);_0x4e9f08[_0xab85('0x31')]=_['keys'](_0x2a7b57['query']);_0x4e9f08['filters']=_[_0xab85('0x33')](_0x4e9f08[_0xab85('0x2f')],_0x4e9f08[_0xab85('0x31')]);_0x23c814['attributes']=_['intersection'](_0x4e9f08[_0xab85('0x2f')],qs[_0xab85('0x35')](_0x2a7b57[_0xab85('0x31')][_0xab85('0x35')]));_0x23c814[_0xab85('0x34')]=_0x23c814['attributes'][_0xab85('0x36')]?_0x23c814[_0xab85('0x34')]:_0x4e9f08[_0xab85('0x2f')];_0x23c814[_0xab85('0x38')]=qs[_0xab85('0x39')](_0x2a7b57[_0xab85('0x31')][_0xab85('0x39')]);_0x23c814[_0xab85('0x3a')]=qs['filters'](_[_0xab85('0x3b')](_0x2a7b57['query'],_0x4e9f08[_0xab85('0x32')]));if(_0x2a7b57[_0xab85('0x31')][_0xab85('0x3c')]){_0x23c814[_0xab85('0x3a')]=_['merge'](_0x23c814[_0xab85('0x3a')],{'$or':_['map'](_0x23c814[_0xab85('0x34')],function(_0x33773b){var _0x33a344={};_0x33a344[_0x33773b]={'$like':'%'+_0x2a7b57[_0xab85('0x31')][_0xab85('0x3c')]+'%'};return _0x33a344;})});}_0x23c814=_[_0xab85('0x3e')]({},_0x23c814,_0x2a7b57[_0xab85('0x3f')]);return _0x53bc22[_0xab85('0x50')](_0x23c814);}})['then'](function(_0x32b258){if(_0x32b258){_0x5baa8b=_0x32b258[_0xab85('0x36')];if(!_0x2a7b57['query'][_0xab85('0x37')](_0xab85('0x4e'))){_0x23c814[_0xab85('0x1d')]=qs[_0xab85('0x1d')](_0x2a7b57[_0xab85('0x31')][_0xab85('0x1d')]);_0x23c814['offset']=qs[_0xab85('0x1b')](_0x2a7b57['query'][_0xab85('0x1b')]);}return _0x53bc22[_0xab85('0x50')](_0x23c814);}})[_0xab85('0x24')](function(_0x2355ea){if(_0x2355ea){return _0x2355ea?{'count':_0x5baa8b,'rows':_0x2355ea}:null;}})[_0xab85('0x24')](respondWithResult(_0x1680b3,null))[_0xab85('0x44')](handleError(_0x1680b3,null));}; \ No newline at end of file +var _0x038b=['save','update','then','error','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','length','include','options','create','body','find','params','destroy','findOne','getFields','hasOwnProperty','nolimit','getSubjects','SalesforceField','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x038b,0x114));var _0xb038=function(_0x11dbdf,_0x58d4d4){_0x11dbdf=_0x11dbdf-0x0;var _0x4277a2=_0x038b[_0x11dbdf];return _0x4277a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb038('0x0'));var zipdir=require(_0xb038('0x1'));var jsonpatch=require(_0xb038('0x2'));var rp=require('request-promise');var moment=require(_0xb038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require('path');var sox=require(_0xb038('0x6'));var csv=require(_0xb038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb038('0x8'));var squel=require(_0xb038('0x9'));var crypto=require(_0xb038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb038('0x7'));var querystring=require(_0xb038('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb038('0xc'));var qs=require(_0xb038('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb038('0xe'));var logger=require(_0xb038('0xf'))(_0xb038('0x10'));var utils=require(_0xb038('0x11'));var config=require(_0xb038('0x12'));var licenseUtil=require(_0xb038('0x13'));var db=require(_0xb038('0x14'))['db'];function respondWithStatusCode(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xcc;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0x15')](_0x16e4a3);}return _0x439751[_0xb038('0x16')](_0x16e4a3)[_0xb038('0x17')]();};}function respondWithResult(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0xc8;return function(_0x13acc7){if(_0x13acc7){return _0x3cc717[_0xb038('0x16')](_0x3a71a6)['json'](_0x13acc7);}};}function respondWithFilteredResult(_0xe8aa7c,_0x26e4f2){return function(_0x183141){if(_0x183141){var _0x39323e=typeof _0x26e4f2[_0xb038('0x18')]===_0xb038('0x19')&&typeof _0x26e4f2['limit']===_0xb038('0x19');var _0x3039b0=_0x183141[_0xb038('0x1a')];var _0x3b095a=_0x39323e?0x0:_0x26e4f2['offset'];var _0x49b237=_0x39323e?_0x183141[_0xb038('0x1a')]:_0x26e4f2[_0xb038('0x18')]+_0x26e4f2[_0xb038('0x1b')];var _0x31c348;if(_0x49b237>=_0x3039b0){_0x49b237=_0x3039b0;_0x31c348=0xc8;}else{_0x31c348=0xce;}_0xe8aa7c['status'](_0x31c348);return _0xe8aa7c[_0xb038('0x1c')](_0xb038('0x1d'),_0x3b095a+'-'+_0x49b237+'/'+_0x3039b0)[_0xb038('0x1e')](_0x183141);}return null;};}function patchUpdates(_0x33a377){return function(_0xc6cd61){try{jsonpatch['apply'](_0xc6cd61,_0x33a377,!![]);}catch(_0x2e0369){return BPromise[_0xb038('0x1f')](_0x2e0369);}return _0xc6cd61[_0xb038('0x20')]();};}function saveUpdates(_0x87b899,_0x5f123d){return function(_0x2812c9){if(_0x2812c9){return _0x2812c9[_0xb038('0x21')](_0x87b899)['then'](function(_0x1eb9cd){return _0x1eb9cd;});}return null;};}function removeEntity(_0x43d403,_0x573f93){return function(_0x241329){if(_0x241329){return _0x241329['destroy']()[_0xb038('0x22')](function(){_0x43d403[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();});}};}function handleEntityNotFound(_0x1df7c4,_0x5d4343){return function(_0xe4ceda){if(!_0xe4ceda){_0x1df7c4[_0xb038('0x15')](0x194);}return _0xe4ceda;};}function handleError(_0x576be5,_0xb6d93f){_0xb6d93f=_0xb6d93f||0x1f4;return function(_0x33cf3c){logger[_0xb038('0x23')](_0x33cf3c['stack']);if(_0x33cf3c[_0xb038('0x24')]){delete _0x33cf3c[_0xb038('0x24')];}_0x576be5[_0xb038('0x16')](_0xb6d93f)['send'](_0x33cf3c);};}exports[_0xb038('0x25')]=function(_0x2855a6,_0x28a6a9){var _0x12b3b6={},_0xc387d={},_0x551b55={'count':0x0,'rows':[]};var _0x1783d4=_[_0xb038('0x26')](db[_0xb038('0x27')][_0xb038('0x28')],function(_0x1abe23){return{'name':_0x1abe23[_0xb038('0x29')],'type':_0x1abe23[_0xb038('0x2a')][_0xb038('0x2b')]};});_0xc387d[_0xb038('0x2c')]=_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24'));_0xc387d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2855a6['query']);_0xc387d[_0xb038('0x2f')]=_['intersection'](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x2d')]);_0x12b3b6[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x32')]));_0x12b3b6[_0xb038('0x30')]=_0x12b3b6[_0xb038('0x30')]['length']?_0x12b3b6[_0xb038('0x30')]:_0xc387d[_0xb038('0x2c')];if(!_0x2855a6[_0xb038('0x2d')]['hasOwnProperty']('nolimit')){_0x12b3b6['limit']=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x2855a6[_0xb038('0x2d')]['offset']);}_0x12b3b6[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x34')]);_0x12b3b6['where']=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x2855a6['query'],_0xc387d['filters']),_0x1783d4);if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]){_0x12b3b6[_0xb038('0x37')]=_[_0xb038('0x38')](_0x12b3b6[_0xb038('0x37')],{'$or':_['map'](_0x1783d4,function(_0x404f82){if(_0x404f82[_0xb038('0x2a')]!==_0xb038('0x39')){var _0x2d1e57={};_0x2d1e57[_0x404f82['name']]={'$like':'%'+_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x2d1e57;}})});}_0x12b3b6=_[_0xb038('0x38')]({},_0x12b3b6,_0x2855a6['options']);var _0x412d71={'where':_0x12b3b6['where']};return db[_0xb038('0x27')][_0xb038('0x1a')](_0x412d71)[_0xb038('0x22')](function(_0x5ce40c){_0x551b55[_0xb038('0x1a')]=_0x5ce40c;if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x3a')]){_0x12b3b6['include']=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3b')](_0x12b3b6);})[_0xb038('0x22')](function(_0x3c291e){_0x551b55['rows']=_0x3c291e;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x3c')](handleError(_0x28a6a9,null));};exports[_0xb038('0x3d')]=function(_0x2a0436,_0x52e1d6){var _0x19dc7b={'raw':![],'where':{'id':_0x2a0436['params']['id']}},_0x269c7d={};_0x269c7d[_0xb038('0x2c')]=_[_0xb038('0x2e')](db[_0xb038('0x27')]['rawAttributes']);_0x269c7d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2a0436['query']);_0x269c7d['filters']=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],_0x269c7d[_0xb038('0x2d')]);_0x19dc7b[_0xb038('0x30')]=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2a0436[_0xb038('0x2d')]['fields']));_0x19dc7b['attributes']=_0x19dc7b['attributes'][_0xb038('0x3e')]?_0x19dc7b[_0xb038('0x30')]:_0x269c7d['model'];if(_0x2a0436[_0xb038('0x2d')][_0xb038('0x3a')]){_0x19dc7b[_0xb038('0x3f')]=[{'all':!![]}];}_0x19dc7b=_['merge']({},_0x19dc7b,_0x2a0436[_0xb038('0x40')]);return db['SalesforceConfiguration']['find'](_0x19dc7b)[_0xb038('0x22')](handleEntityNotFound(_0x52e1d6,null))[_0xb038('0x22')](respondWithResult(_0x52e1d6,null))[_0xb038('0x3c')](handleError(_0x52e1d6,null));};exports[_0xb038('0x41')]=function(_0x304515,_0x3b09e3){return db[_0xb038('0x27')][_0xb038('0x41')](_0x304515[_0xb038('0x42')],{})[_0xb038('0x22')](respondWithResult(_0x3b09e3,0xc9))['catch'](handleError(_0x3b09e3,null));};exports[_0xb038('0x21')]=function(_0x3ed968,_0x5c11d7){if(_0x3ed968[_0xb038('0x42')]['id']){delete _0x3ed968[_0xb038('0x42')]['id'];}return db['SalesforceConfiguration'][_0xb038('0x43')]({'where':{'id':_0x3ed968[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x5c11d7,null))[_0xb038('0x22')](saveUpdates(_0x3ed968[_0xb038('0x42')],null))[_0xb038('0x22')](respondWithResult(_0x5c11d7,null))[_0xb038('0x3c')](handleError(_0x5c11d7,null));};exports[_0xb038('0x45')]=function(_0x3a291d,_0x54a826){return db[_0xb038('0x27')][_0xb038('0x43')]({'where':{'id':_0x3a291d[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x54a826,null))[_0xb038('0x22')](removeEntity(_0x54a826,null))[_0xb038('0x3c')](handleError(_0x54a826,null));};exports['getFields']=function(_0x1f4997,_0x2f3622,_0x2b2b4d){var _0x1fa353={};var _0x2dfa96={};var _0x24198c;var _0xd7a862;return db['SalesforceConfiguration'][_0xb038('0x46')]({'where':{'id':_0x1f4997['params']['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x2f3622,null))[_0xb038('0x22')](function(_0x2315db){if(_0x2315db){_0x24198c=_0x2315db;_0x2dfa96[_0xb038('0x2c')]=_[_0xb038('0x2e')](db['SalesforceField']['rawAttributes']);_0x2dfa96['query']=_[_0xb038('0x2e')](_0x1f4997[_0xb038('0x2d')]);_0x2dfa96[_0xb038('0x2f')]=_[_0xb038('0x31')](_0x2dfa96[_0xb038('0x2c')],_0x2dfa96[_0xb038('0x2d')]);_0x1fa353['attributes']=_[_0xb038('0x31')](_0x2dfa96[_0xb038('0x2c')],qs['fields'](_0x1f4997['query'][_0xb038('0x32')]));_0x1fa353['attributes']=_0x1fa353[_0xb038('0x30')]['length']?_0x1fa353[_0xb038('0x30')]:_0x2dfa96[_0xb038('0x2c')];_0x1fa353[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x1f4997['query'][_0xb038('0x34')]);_0x1fa353[_0xb038('0x37')]=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x1f4997[_0xb038('0x2d')],_0x2dfa96[_0xb038('0x2f')]));if(_0x1f4997[_0xb038('0x2d')][_0xb038('0x36')]){_0x1fa353[_0xb038('0x37')]=_[_0xb038('0x38')](_0x1fa353[_0xb038('0x37')],{'$or':_[_0xb038('0x26')](_0x1fa353['attributes'],function(_0x29e11e){var _0x2fc38d={};_0x2fc38d[_0x29e11e]={'$like':'%'+_0x1f4997[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x2fc38d;})});}_0x1fa353=_[_0xb038('0x38')]({},_0x1fa353,_0x1f4997['options']);return _0x24198c[_0xb038('0x47')](_0x1fa353);}})['then'](function(_0xfb3ce6){if(_0xfb3ce6){_0xd7a862=_0xfb3ce6[_0xb038('0x3e')];if(!_0x1f4997['query'][_0xb038('0x48')](_0xb038('0x49'))){_0x1fa353[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0x1f4997[_0xb038('0x2d')][_0xb038('0x1b')]);_0x1fa353[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x1f4997[_0xb038('0x2d')][_0xb038('0x18')]);}return _0x24198c['getFields'](_0x1fa353);}})[_0xb038('0x22')](function(_0x4f69dc){if(_0x4f69dc){return _0x4f69dc?{'count':_0xd7a862,'rows':_0x4f69dc}:null;}})[_0xb038('0x22')](respondWithResult(_0x2f3622,null))[_0xb038('0x3c')](handleError(_0x2f3622,null));};exports[_0xb038('0x4a')]=function(_0x36568b,_0x1f5f3f,_0x23fb92){var _0x1d6cf5={};var _0x4c23b2={};var _0x572ad4;var _0x24ea03;return db[_0xb038('0x27')][_0xb038('0x46')]({'where':{'id':_0x36568b['params']['id']}})['then'](handleEntityNotFound(_0x1f5f3f,null))[_0xb038('0x22')](function(_0x4b807f){if(_0x4b807f){_0x572ad4=_0x4b807f;_0x4c23b2[_0xb038('0x2c')]=_['keys'](db[_0xb038('0x4b')]['rawAttributes']);_0x4c23b2[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x36568b[_0xb038('0x2d')]);_0x4c23b2[_0xb038('0x2f')]=_[_0xb038('0x31')](_0x4c23b2[_0xb038('0x2c')],_0x4c23b2['query']);_0x1d6cf5['attributes']=_[_0xb038('0x31')](_0x4c23b2['model'],qs[_0xb038('0x32')](_0x36568b[_0xb038('0x2d')][_0xb038('0x32')]));_0x1d6cf5['attributes']=_0x1d6cf5[_0xb038('0x30')]['length']?_0x1d6cf5[_0xb038('0x30')]:_0x4c23b2[_0xb038('0x2c')];_0x1d6cf5[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x36568b[_0xb038('0x2d')][_0xb038('0x34')]);_0x1d6cf5[_0xb038('0x37')]=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x36568b['query'],_0x4c23b2['filters']));if(_0x36568b['query'][_0xb038('0x36')]){_0x1d6cf5['where']=_[_0xb038('0x38')](_0x1d6cf5['where'],{'$or':_[_0xb038('0x26')](_0x1d6cf5[_0xb038('0x30')],function(_0x41c151){var _0x1294d7={};_0x1294d7[_0x41c151]={'$like':'%'+_0x36568b[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x1294d7;})});}_0x1d6cf5=_[_0xb038('0x38')]({},_0x1d6cf5,_0x36568b[_0xb038('0x40')]);return _0x572ad4[_0xb038('0x4a')](_0x1d6cf5);}})[_0xb038('0x22')](function(_0x1db407){if(_0x1db407){_0x24ea03=_0x1db407[_0xb038('0x3e')];if(!_0x36568b[_0xb038('0x2d')][_0xb038('0x48')](_0xb038('0x49'))){_0x1d6cf5[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0x36568b[_0xb038('0x2d')][_0xb038('0x1b')]);_0x1d6cf5['offset']=qs[_0xb038('0x18')](_0x36568b[_0xb038('0x2d')][_0xb038('0x18')]);}return _0x572ad4[_0xb038('0x4a')](_0x1d6cf5);}})[_0xb038('0x22')](function(_0x5ead21){if(_0x5ead21){return _0x5ead21?{'count':_0x24ea03,'rows':_0x5ead21}:null;}})[_0xb038('0x22')](respondWithResult(_0x1f5f3f,null))[_0xb038('0x3c')](handleError(_0x1f5f3f,null));};exports[_0xb038('0x4c')]=function(_0x80d720,_0x34e222,_0x468b41){var _0x2acbf6={};var _0x2d0313={};var _0xd5aa6d;var _0x4ce25a;return db['SalesforceConfiguration'][_0xb038('0x46')]({'where':{'id':_0x80d720['params']['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x34e222,null))['then'](function(_0x5da505){if(_0x5da505){_0xd5aa6d=_0x5da505;_0x2d0313['model']=_[_0xb038('0x2e')](db[_0xb038('0x4b')]['rawAttributes']);_0x2d0313[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x80d720[_0xb038('0x2d')]);_0x2d0313[_0xb038('0x2f')]=_[_0xb038('0x31')](_0x2d0313[_0xb038('0x2c')],_0x2d0313[_0xb038('0x2d')]);_0x2acbf6[_0xb038('0x30')]=_[_0xb038('0x31')](_0x2d0313[_0xb038('0x2c')],qs['fields'](_0x80d720[_0xb038('0x2d')][_0xb038('0x32')]));_0x2acbf6[_0xb038('0x30')]=_0x2acbf6[_0xb038('0x30')][_0xb038('0x3e')]?_0x2acbf6[_0xb038('0x30')]:_0x2d0313[_0xb038('0x2c')];_0x2acbf6['order']=qs[_0xb038('0x34')](_0x80d720[_0xb038('0x2d')][_0xb038('0x34')]);_0x2acbf6['where']=qs['filters'](_[_0xb038('0x35')](_0x80d720[_0xb038('0x2d')],_0x2d0313[_0xb038('0x2f')]));if(_0x80d720['query'][_0xb038('0x36')]){_0x2acbf6[_0xb038('0x37')]=_['merge'](_0x2acbf6[_0xb038('0x37')],{'$or':_[_0xb038('0x26')](_0x2acbf6[_0xb038('0x30')],function(_0x2a41c8){var _0x24f810={};_0x24f810[_0x2a41c8]={'$like':'%'+_0x80d720[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x24f810;})});}_0x2acbf6=_[_0xb038('0x38')]({},_0x2acbf6,_0x80d720[_0xb038('0x40')]);return _0xd5aa6d[_0xb038('0x4c')](_0x2acbf6);}})[_0xb038('0x22')](function(_0x178a92){if(_0x178a92){_0x4ce25a=_0x178a92[_0xb038('0x3e')];if(!_0x80d720[_0xb038('0x2d')]['hasOwnProperty'](_0xb038('0x49'))){_0x2acbf6[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0x80d720[_0xb038('0x2d')][_0xb038('0x1b')]);_0x2acbf6[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x80d720[_0xb038('0x2d')]['offset']);}return _0xd5aa6d[_0xb038('0x4c')](_0x2acbf6);}})[_0xb038('0x22')](function(_0x4d7537){if(_0x4d7537){return _0x4d7537?{'count':_0x4ce25a,'rows':_0x4d7537}:null;}})[_0xb038('0x22')](respondWithResult(_0x34e222,null))['catch'](handleError(_0x34e222,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index dc346af..ea28c15 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 _0xe231=['./intSalesforceConfiguration.attributes','define','int_salesforce_configurations','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x41da18,_0x34efad){var _0x46821e=function(_0x3c5ef9){while(--_0x3c5ef9){_0x41da18['push'](_0x41da18['shift']());}};_0x46821e(++_0x34efad);}(_0xe231,0x139));var _0x1e23=function(_0x2e2ce8,_0x436b78){_0x2e2ce8=_0x2e2ce8-0x0;var _0x1d92a7=_0xe231[_0x2e2ce8];return _0x1d92a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e23('0x0'))(_0x1e23('0x1'));var moment=require('moment');var BPromise=require(_0x1e23('0x2'));var rp=require(_0x1e23('0x3'));var fs=require('fs');var path=require(_0x1e23('0x4'));var rimraf=require(_0x1e23('0x5'));var config=require(_0x1e23('0x6'));var attributes=require(_0x1e23('0x7'));module['exports']=function(_0x8a5d0c,_0x4ba5f7){return _0x8a5d0c[_0x1e23('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0x1e23('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99cf=['../../config/logger','api','rimraf','../../config/environment','exports','define','lodash'];(function(_0x293e39,_0x34315f){var _0x118450=function(_0x1efd24){while(--_0x1efd24){_0x293e39['push'](_0x293e39['shift']());}};_0x118450(++_0x34315f);}(_0x99cf,0x11e));var _0xf99c=function(_0x31c626,_0x40467a){_0x31c626=_0x31c626-0x0;var _0x4bcda1=_0x99cf[_0x31c626];return _0x4bcda1;};'use strict';var _=require(_0xf99c('0x0'));var util=require('util');var logger=require(_0xf99c('0x1'))(_0xf99c('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(_0xf99c('0x3'));var config=require(_0xf99c('0x4'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xf99c('0x5')]=function(_0x5df4a2,_0x3f37ec){return _0x5df4a2[_0xf99c('0x6')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 905f6f0..131087a 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 _0xbb20=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird'];(function(_0x2fa64e,_0x40d833){var _0x16367f=function(_0x10da0e){while(--_0x10da0e){_0x2fa64e['push'](_0x2fa64e['shift']());}};_0x16367f(++_0x40d833);}(_0xbb20,0x6b));var _0x0bb2=function(_0x28c8c6,_0x2d3eff){_0x28c8c6=_0x28c8c6-0x0;var _0x489589=_0xbb20[_0x28c8c6];return _0x489589;};'use strict';var _=require(_0x0bb2('0x0'));var util=require('util');var moment=require(_0x0bb2('0x1'));var BPromise=require(_0x0bb2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bb2('0x3'))['db'];var utils=require(_0x0bb2('0x4'));var logger=require(_0x0bb2('0x5'))('rpc');var config=require(_0x0bb2('0x6'));var jayson=require(_0x0bb2('0x7'));var client=jayson[_0x0bb2('0x8')][_0x0bb2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x304847,_0x3f2b59,_0x21c352){return new BPromise(function(_0x4608e1,_0x18f468){return client[_0x0bb2('0xa')](_0x304847,_0x21c352)[_0x0bb2('0xb')](function(_0x34a2bc){logger['info'](_0x0bb2('0xc'),_0x3f2b59,'request\x20sent');logger['debug'](_0x0bb2('0xd'),_0x3f2b59,_0x0bb2('0xe'),JSON[_0x0bb2('0xf')](_0x34a2bc));if(_0x34a2bc[_0x0bb2('0x10')]){if(_0x34a2bc[_0x0bb2('0x10')][_0x0bb2('0x11')]===0x1f4){logger['error'](_0x0bb2('0xc'),_0x3f2b59,_0x34a2bc['error'][_0x0bb2('0x12')]);return _0x18f468(_0x34a2bc[_0x0bb2('0x10')][_0x0bb2('0x12')]);}logger[_0x0bb2('0x10')](_0x0bb2('0xc'),_0x3f2b59,_0x34a2bc['error']['message']);return _0x4608e1(_0x34a2bc['error'][_0x0bb2('0x12')]);}else{logger[_0x0bb2('0x13')](_0x0bb2('0xc'),_0x3f2b59,_0x0bb2('0xe'));_0x4608e1(_0x34a2bc[_0x0bb2('0x14')][_0x0bb2('0x12')]);}})[_0x0bb2('0x15')](function(_0x2f55be){logger[_0x0bb2('0x10')](_0x0bb2('0xc'),_0x3f2b59,_0x2f55be);_0x18f468(_0x2f55be);});});} \ No newline at end of file +var _0xacff=['catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result'];(function(_0x2e752b,_0x5cb17d){var _0x40a0b4=function(_0x11365a){while(--_0x11365a){_0x2e752b['push'](_0x2e752b['shift']());}};_0x40a0b4(++_0x5cb17d);}(_0xacff,0xa9));var _0xfacf=function(_0x4d86d7,_0x42b0d2){_0x4d86d7=_0x4d86d7-0x0;var _0x49fc76=_0xacff[_0x4d86d7];return _0x49fc76;};'use strict';var _=require(_0xfacf('0x0'));var util=require(_0xfacf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfacf('0x2'));var db=require(_0xfacf('0x3'))['db'];var utils=require(_0xfacf('0x4'));var logger=require('../../config/logger')(_0xfacf('0x5'));var config=require(_0xfacf('0x6'));var jayson=require(_0xfacf('0x7'));var client=jayson['client'][_0xfacf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58973e,_0x5b16bb,_0x1d33c1){return new BPromise(function(_0x26b027,_0x56f42b){return client[_0xfacf('0x9')](_0x58973e,_0x1d33c1)[_0xfacf('0xa')](function(_0x2fcef3){logger[_0xfacf('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5b16bb,'request\x20sent');logger['debug'](_0xfacf('0xc'),_0x5b16bb,_0xfacf('0xd'),JSON[_0xfacf('0xe')](_0x2fcef3));if(_0x2fcef3[_0xfacf('0xf')]){if(_0x2fcef3[_0xfacf('0xf')][_0xfacf('0x10')]===0x1f4){logger[_0xfacf('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5b16bb,_0x2fcef3[_0xfacf('0xf')]['message']);return _0x56f42b(_0x2fcef3['error']['message']);}logger[_0xfacf('0xf')](_0xfacf('0x11'),_0x5b16bb,_0x2fcef3[_0xfacf('0xf')][_0xfacf('0x12')]);return _0x26b027(_0x2fcef3[_0xfacf('0xf')][_0xfacf('0x12')]);}else{logger[_0xfacf('0xb')](_0xfacf('0x11'),_0x5b16bb,_0xfacf('0xd'));_0x26b027(_0x2fcef3[_0xfacf('0x13')][_0xfacf('0x12')]);}})[_0xfacf('0x14')](function(_0x24b486){logger['error'](_0xfacf('0x11'),_0x5b16bb,_0x24b486);_0x56f42b(_0x24b486);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 11df7b9..bfcf812 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 _0x60ed=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','update','exports','multer','util','path'];(function(_0xd3097c,_0x355914){var _0x315815=function(_0x6f899){while(--_0x6f899){_0xd3097c['push'](_0xd3097c['shift']());}};_0x315815(++_0x355914);}(_0x60ed,0xed));var _0xd60e=function(_0x3391fe,_0x5c24d9){_0x3391fe=_0x3391fe-0x0;var _0x1ae383=_0x60ed[_0x3391fe];return _0x1ae383;};'use strict';var multer=require(_0xd60e('0x0'));var util=require(_0xd60e('0x1'));var path=require(_0xd60e('0x2'));var timeout=require(_0xd60e('0x3'));var express=require(_0xd60e('0x4'));var router=express[_0xd60e('0x5')]();var fs_extra=require(_0xd60e('0x6'));var auth=require(_0xd60e('0x7'));var interaction=require(_0xd60e('0x8'));var config=require(_0xd60e('0x9'));var controller=require(_0xd60e('0xa'));router[_0xd60e('0xb')]('/',auth[_0xd60e('0xc')](),controller[_0xd60e('0xd')]);router[_0xd60e('0xb')](_0xd60e('0xe'),auth['isAuthenticated'](),controller[_0xd60e('0xf')]);router[_0xd60e('0x10')]('/',auth['isAuthenticated'](),controller[_0xd60e('0x11')]);router['put'](_0xd60e('0xe'),auth[_0xd60e('0xc')](),controller[_0xd60e('0x12')]);router['delete'](_0xd60e('0xe'),auth[_0xd60e('0xc')](),controller['destroy']);module[_0xd60e('0x13')]=router; \ No newline at end of file +var _0x3c14=['multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','create','update','destroy','exports'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x3c14,0x186));var _0x43c1=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x3c14[_0x5d860f];return _0x236490;};'use strict';var multer=require(_0x43c1('0x0'));var util=require('util');var path=require(_0x43c1('0x1'));var timeout=require(_0x43c1('0x2'));var express=require(_0x43c1('0x3'));var router=express['Router']();var fs_extra=require(_0x43c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x43c1('0x5'));var config=require(_0x43c1('0x6'));var controller=require(_0x43c1('0x7'));router[_0x43c1('0x8')]('/',auth[_0x43c1('0x9')](),controller[_0x43c1('0xa')]);router[_0x43c1('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x43c1('0xb')]);router['put']('/:id',auth[_0x43c1('0x9')](),controller[_0x43c1('0xc')]);router['delete']('/:id',auth[_0x43c1('0x9')](),controller[_0x43c1('0xd')]);module[_0x43c1('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 9151d47..0073f2e 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 _0xdf41=['STRING','variable','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0xb73e2a,_0x1b6936){var _0x56f2ad=function(_0x3de0f6){while(--_0x3de0f6){_0xb73e2a['push'](_0xb73e2a['shift']());}};_0x56f2ad(++_0x1b6936);}(_0xdf41,0x18e));var _0x1df4=function(_0x495c91,_0x430e74){_0x495c91=_0x495c91-0x0;var _0x27c335=_0xdf41[_0x495c91];return _0x27c335;};'use strict';var Sequelize=require(_0x1df4('0x0'));module[_0x1df4('0x1')]={'type':{'type':Sequelize[_0x1df4('0x2')](_0x1df4('0x3'),'variable',_0x1df4('0x4'),_0x1df4('0x5'),_0x1df4('0x6')),'defaultValue':_0x1df4('0x3')},'content':{'type':Sequelize[_0x1df4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1df4('0x2')](_0x1df4('0x3'),_0x1df4('0x8'),_0x1df4('0x4'))},'keyContent':{'type':Sequelize[_0x1df4('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe057=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x61e0e,_0x121e46){var _0x869704=function(_0x456142){while(--_0x456142){_0x61e0e['push'](_0x61e0e['shift']());}};_0x869704(++_0x121e46);}(_0xe057,0x170));var _0x7e05=function(_0x1d70d1,_0x2c74f4){_0x1d70d1=_0x1d70d1-0x0;var _0x4acc42=_0xe057[_0x1d70d1];return _0x4acc42;};'use strict';var Sequelize=require(_0x7e05('0x0'));module[_0x7e05('0x1')]={'type':{'type':Sequelize[_0x7e05('0x2')](_0x7e05('0x3'),_0x7e05('0x4'),_0x7e05('0x5'),'keyValue',_0x7e05('0x6')),'defaultValue':_0x7e05('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7e05('0x7')]},'keyType':{'type':Sequelize[_0x7e05('0x2')]('string',_0x7e05('0x4'),_0x7e05('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7e05('0x7')]},'variableName':{'type':Sequelize[_0x7e05('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 1ea7e04..7e25b7d 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 _0x6a05=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','map','SalesforceField','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1ccc19,_0x2a5e47){var _0x393065=function(_0x1ffa38){while(--_0x1ffa38){_0x1ccc19['push'](_0x1ccc19['shift']());}};_0x393065(++_0x2a5e47);}(_0x6a05,0x136));var _0x56a0=function(_0xcbf03b,_0x2ddbfd){_0xcbf03b=_0xcbf03b-0x0;var _0x2384a6=_0x6a05[_0xcbf03b];return _0x2384a6;};'use strict';var emlformat=require(_0x56a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x56a0('0x1'));var jsonpatch=require(_0x56a0('0x2'));var rp=require(_0x56a0('0x3'));var moment=require(_0x56a0('0x4'));var BPromise=require(_0x56a0('0x5'));var Mustache=require(_0x56a0('0x6'));var util=require('util');var path=require(_0x56a0('0x7'));var sox=require(_0x56a0('0x8'));var csv=require(_0x56a0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56a0('0xa'));var _=require(_0x56a0('0xb'));var squel=require('squel');var crypto=require(_0x56a0('0xc'));var jsforce=require(_0x56a0('0xd'));var deskjs=require(_0x56a0('0xe'));var toCsv=require(_0x56a0('0x9'));var querystring=require(_0x56a0('0xf'));var Papa=require(_0x56a0('0x10'));var Redis=require(_0x56a0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x56a0('0x12'));var as=require(_0x56a0('0x13'));var hardwareService=require(_0x56a0('0x14'));var logger=require(_0x56a0('0x15'))(_0x56a0('0x16'));var utils=require('../../config/utils');var config=require(_0x56a0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x56a0('0x18'))['db'];function respondWithStatusCode(_0x39fda6,_0x41e516){_0x41e516=_0x41e516||0xcc;return function(_0x2fecdb){if(_0x2fecdb){return _0x39fda6[_0x56a0('0x19')](_0x41e516);}return _0x39fda6[_0x56a0('0x1a')](_0x41e516)[_0x56a0('0x1b')]();};}function respondWithResult(_0x4f2883,_0x5933ff){_0x5933ff=_0x5933ff||0xc8;return function(_0x254df7){if(_0x254df7){return _0x4f2883[_0x56a0('0x1a')](_0x5933ff)['json'](_0x254df7);}};}function respondWithFilteredResult(_0x45215a,_0x3af832){return function(_0x4bef81){if(_0x4bef81){var _0x54e7c5=typeof _0x3af832[_0x56a0('0x1c')]===_0x56a0('0x1d')&&typeof _0x3af832[_0x56a0('0x1e')]===_0x56a0('0x1d');var _0x5e95e4=_0x4bef81[_0x56a0('0x1f')];var _0x38df8f=_0x54e7c5?0x0:_0x3af832['offset'];var _0x3032aa=_0x54e7c5?_0x4bef81[_0x56a0('0x1f')]:_0x3af832[_0x56a0('0x1c')]+_0x3af832[_0x56a0('0x1e')];var _0x12e980;if(_0x3032aa>=_0x5e95e4){_0x3032aa=_0x5e95e4;_0x12e980=0xc8;}else{_0x12e980=0xce;}_0x45215a[_0x56a0('0x1a')](_0x12e980);return _0x45215a[_0x56a0('0x20')](_0x56a0('0x21'),_0x38df8f+'-'+_0x3032aa+'/'+_0x5e95e4)[_0x56a0('0x22')](_0x4bef81);}return null;};}function patchUpdates(_0x243f90){return function(_0x398e8d){try{jsonpatch[_0x56a0('0x23')](_0x398e8d,_0x243f90,!![]);}catch(_0x2d21a2){return BPromise['reject'](_0x2d21a2);}return _0x398e8d['save']();};}function saveUpdates(_0x529452,_0x2bf572){return function(_0x372b97){if(_0x372b97){return _0x372b97[_0x56a0('0x24')](_0x529452)[_0x56a0('0x25')](function(_0xb9806){return _0xb9806;});}return null;};}function removeEntity(_0x3288ee,_0x2fe5cb){return function(_0x307485){if(_0x307485){return _0x307485[_0x56a0('0x26')]()['then'](function(){_0x3288ee[_0x56a0('0x1a')](0xcc)[_0x56a0('0x1b')]();});}};}function handleEntityNotFound(_0x37c51d,_0x45d1d6){return function(_0x1bf72f){if(!_0x1bf72f){_0x37c51d[_0x56a0('0x19')](0x194);}return _0x1bf72f;};}function handleError(_0x53ffd1,_0x512b89){_0x512b89=_0x512b89||0x1f4;return function(_0x1f9bc5){logger[_0x56a0('0x27')](_0x1f9bc5[_0x56a0('0x28')]);if(_0x1f9bc5[_0x56a0('0x29')]){delete _0x1f9bc5[_0x56a0('0x29')];}_0x53ffd1['status'](_0x512b89)[_0x56a0('0x2a')](_0x1f9bc5);};}exports['index']=function(_0x11df12,_0x1d416d){var _0x27b691={},_0x37aa98={},_0x152c24={'count':0x0,'rows':[]};var _0x549139=_[_0x56a0('0x2b')](db[_0x56a0('0x2c')][_0x56a0('0x2d')],function(_0x8faec1){return{'name':_0x8faec1['fieldName'],'type':_0x8faec1[_0x56a0('0x2e')][_0x56a0('0x2f')]};});_0x37aa98['model']=_[_0x56a0('0x2b')](_0x549139,'name');_0x37aa98[_0x56a0('0x30')]=_[_0x56a0('0x31')](_0x11df12['query']);_0x37aa98[_0x56a0('0x32')]=_['intersection'](_0x37aa98[_0x56a0('0x33')],_0x37aa98[_0x56a0('0x30')]);_0x27b691['attributes']=_[_0x56a0('0x34')](_0x37aa98[_0x56a0('0x33')],qs['fields'](_0x11df12[_0x56a0('0x30')][_0x56a0('0x35')]));_0x27b691[_0x56a0('0x36')]=_0x27b691[_0x56a0('0x36')][_0x56a0('0x37')]?_0x27b691[_0x56a0('0x36')]:_0x37aa98[_0x56a0('0x33')];if(!_0x11df12[_0x56a0('0x30')][_0x56a0('0x38')](_0x56a0('0x39'))){_0x27b691[_0x56a0('0x1e')]=qs[_0x56a0('0x1e')](_0x11df12[_0x56a0('0x30')]['limit']);_0x27b691[_0x56a0('0x1c')]=qs[_0x56a0('0x1c')](_0x11df12[_0x56a0('0x30')][_0x56a0('0x1c')]);}_0x27b691[_0x56a0('0x3a')]=qs[_0x56a0('0x3b')](_0x11df12['query'][_0x56a0('0x3b')]);_0x27b691[_0x56a0('0x3c')]=qs[_0x56a0('0x32')](_['pick'](_0x11df12['query'],_0x37aa98[_0x56a0('0x32')]),_0x549139);if(_0x11df12[_0x56a0('0x30')]['filter']){_0x27b691['where']=_[_0x56a0('0x3d')](_0x27b691[_0x56a0('0x3c')],{'$or':_[_0x56a0('0x2b')](_0x549139,function(_0x69c0bb){if(_0x69c0bb[_0x56a0('0x2e')]!==_0x56a0('0x3e')){var _0x49acac={};_0x49acac[_0x69c0bb[_0x56a0('0x29')]]={'$like':'%'+_0x11df12[_0x56a0('0x30')]['filter']+'%'};return _0x49acac;}})});}_0x27b691=_[_0x56a0('0x3d')]({},_0x27b691,_0x11df12[_0x56a0('0x3f')]);var _0x20b903={'where':_0x27b691[_0x56a0('0x3c')]};return db[_0x56a0('0x2c')][_0x56a0('0x1f')](_0x20b903)['then'](function(_0x1930d2){_0x152c24[_0x56a0('0x1f')]=_0x1930d2;if(_0x11df12[_0x56a0('0x30')][_0x56a0('0x40')]){_0x27b691[_0x56a0('0x41')]=[{'all':!![]}];}return db[_0x56a0('0x2c')][_0x56a0('0x42')](_0x27b691);})[_0x56a0('0x25')](function(_0x329558){_0x152c24[_0x56a0('0x43')]=_0x329558;return _0x152c24;})[_0x56a0('0x25')](respondWithFilteredResult(_0x1d416d,_0x27b691))[_0x56a0('0x44')](handleError(_0x1d416d,null));};exports[_0x56a0('0x45')]=function(_0x3756c0,_0x86b03){var _0x393c18={'raw':!![],'where':{'id':_0x3756c0[_0x56a0('0x46')]['id']}},_0xbc4c00={};_0xbc4c00[_0x56a0('0x33')]=_[_0x56a0('0x31')](db[_0x56a0('0x2c')][_0x56a0('0x2d')]);_0xbc4c00[_0x56a0('0x30')]=_[_0x56a0('0x31')](_0x3756c0[_0x56a0('0x30')]);_0xbc4c00['filters']=_[_0x56a0('0x34')](_0xbc4c00[_0x56a0('0x33')],_0xbc4c00['query']);_0x393c18[_0x56a0('0x36')]=_[_0x56a0('0x34')](_0xbc4c00[_0x56a0('0x33')],qs[_0x56a0('0x35')](_0x3756c0['query'][_0x56a0('0x35')]));_0x393c18[_0x56a0('0x36')]=_0x393c18['attributes'][_0x56a0('0x37')]?_0x393c18['attributes']:_0xbc4c00[_0x56a0('0x33')];if(_0x3756c0[_0x56a0('0x30')][_0x56a0('0x40')]){_0x393c18[_0x56a0('0x41')]=[{'all':!![]}];}_0x393c18=_[_0x56a0('0x3d')]({},_0x393c18,_0x3756c0[_0x56a0('0x3f')]);return db['SalesforceField'][_0x56a0('0x47')](_0x393c18)[_0x56a0('0x25')](handleEntityNotFound(_0x86b03,null))[_0x56a0('0x25')](respondWithResult(_0x86b03,null))[_0x56a0('0x44')](handleError(_0x86b03,null));};exports[_0x56a0('0x48')]=function(_0x1df011,_0x2fcee1){return db['SalesforceField'][_0x56a0('0x48')](_0x1df011['body'],{})[_0x56a0('0x25')](respondWithResult(_0x2fcee1,0xc9))['catch'](handleError(_0x2fcee1,null));};exports['update']=function(_0x49a1b7,_0x40e12c){if(_0x49a1b7[_0x56a0('0x49')]['id']){delete _0x49a1b7[_0x56a0('0x49')]['id'];}return db['SalesforceField'][_0x56a0('0x47')]({'where':{'id':_0x49a1b7['params']['id']}})['then'](handleEntityNotFound(_0x40e12c,null))[_0x56a0('0x25')](saveUpdates(_0x49a1b7[_0x56a0('0x49')],null))[_0x56a0('0x25')](respondWithResult(_0x40e12c,null))[_0x56a0('0x44')](handleError(_0x40e12c,null));};exports[_0x56a0('0x26')]=function(_0x4aa500,_0x3e6d9e){return db['SalesforceField'][_0x56a0('0x47')]({'where':{'id':_0x4aa500['params']['id']}})[_0x56a0('0x25')](handleEntityNotFound(_0x3e6d9e,null))[_0x56a0('0x25')](removeEntity(_0x3e6d9e,null))[_0x56a0('0x44')](handleError(_0x3e6d9e,null));}; \ No newline at end of file +var _0xcbca=['undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','end','sendStatus','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','options','includeAll','include','findAll','then','rows','params','length','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x5a1c84,_0x4ab450){var _0x263303=function(_0x58d475){while(--_0x58d475){_0x5a1c84['push'](_0x5a1c84['shift']());}};_0x263303(++_0x4ab450);}(_0xcbca,0x14c));var _0xacbc=function(_0x25572c,_0x4e3621){_0x25572c=_0x25572c-0x0;var _0x59bd2e=_0xcbca[_0x25572c];return _0x59bd2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xacbc('0x0'));var zipdir=require(_0xacbc('0x1'));var jsonpatch=require(_0xacbc('0x2'));var rp=require(_0xacbc('0x3'));var moment=require(_0xacbc('0x4'));var BPromise=require(_0xacbc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xacbc('0x6'));var sox=require('sox');var csv=require(_0xacbc('0x7'));var ejs=require(_0xacbc('0x8'));var fs=require('fs');var fs_extra=require(_0xacbc('0x9'));var _=require('lodash');var squel=require(_0xacbc('0xa'));var crypto=require(_0xacbc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xacbc('0xc'));var Papa=require(_0xacbc('0xd'));var Redis=require(_0xacbc('0xe'));var authService=require(_0xacbc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xacbc('0x10'));var utils=require(_0xacbc('0x11'));var config=require(_0xacbc('0x12'));var licenseUtil=require(_0xacbc('0x13'));var db=require(_0xacbc('0x14'))['db'];function respondWithStatusCode(_0x2dc9ac,_0x563835){_0x563835=_0x563835||0xcc;return function(_0x2fb6a9){if(_0x2fb6a9){return _0x2dc9ac['sendStatus'](_0x563835);}return _0x2dc9ac[_0xacbc('0x15')](_0x563835)['end']();};}function respondWithResult(_0x18a3a0,_0x43b837){_0x43b837=_0x43b837||0xc8;return function(_0x104dc3){if(_0x104dc3){return _0x18a3a0[_0xacbc('0x15')](_0x43b837)[_0xacbc('0x16')](_0x104dc3);}};}function respondWithFilteredResult(_0x435617,_0x25f63b){return function(_0x361548){if(_0x361548){var _0x3466eb=typeof _0x25f63b['offset']===_0xacbc('0x17')&&typeof _0x25f63b[_0xacbc('0x18')]===_0xacbc('0x17');var _0x283d60=_0x361548[_0xacbc('0x19')];var _0x513350=_0x3466eb?0x0:_0x25f63b['offset'];var _0x348e81=_0x3466eb?_0x361548['count']:_0x25f63b[_0xacbc('0x1a')]+_0x25f63b[_0xacbc('0x18')];var _0x39e107;if(_0x348e81>=_0x283d60){_0x348e81=_0x283d60;_0x39e107=0xc8;}else{_0x39e107=0xce;}_0x435617['status'](_0x39e107);return _0x435617[_0xacbc('0x1b')](_0xacbc('0x1c'),_0x513350+'-'+_0x348e81+'/'+_0x283d60)['json'](_0x361548);}return null;};}function patchUpdates(_0x396c01){return function(_0x37d86c){try{jsonpatch[_0xacbc('0x1d')](_0x37d86c,_0x396c01,!![]);}catch(_0x179ac1){return BPromise[_0xacbc('0x1e')](_0x179ac1);}return _0x37d86c['save']();};}function saveUpdates(_0x1828ee,_0x50df7){return function(_0x312eb5){if(_0x312eb5){return _0x312eb5[_0xacbc('0x1f')](_0x1828ee)['then'](function(_0x16c190){return _0x16c190;});}return null;};}function removeEntity(_0x38cf0b,_0x92f54e){return function(_0x663d14){if(_0x663d14){return _0x663d14[_0xacbc('0x20')]()['then'](function(){_0x38cf0b['status'](0xcc)[_0xacbc('0x21')]();});}};}function handleEntityNotFound(_0x4587d1,_0x28083f){return function(_0x54f64a){if(!_0x54f64a){_0x4587d1[_0xacbc('0x22')](0x194);}return _0x54f64a;};}function handleError(_0x110c4b,_0x19af26){_0x19af26=_0x19af26||0x1f4;return function(_0x16fb97){logger[_0xacbc('0x23')](_0x16fb97[_0xacbc('0x24')]);if(_0x16fb97['name']){delete _0x16fb97[_0xacbc('0x25')];}_0x110c4b[_0xacbc('0x15')](_0x19af26)[_0xacbc('0x26')](_0x16fb97);};}exports[_0xacbc('0x27')]=function(_0x40986b,_0x19d82e){var _0x4b9959={},_0x20190b={},_0x40f19a={'count':0x0,'rows':[]};var _0x23fa4c=_[_0xacbc('0x28')](db[_0xacbc('0x29')][_0xacbc('0x2a')],function(_0x2a65d3){return{'name':_0x2a65d3['fieldName'],'type':_0x2a65d3[_0xacbc('0x2b')][_0xacbc('0x2c')]};});_0x20190b[_0xacbc('0x2d')]=_[_0xacbc('0x28')](_0x23fa4c,'name');_0x20190b[_0xacbc('0x2e')]=_[_0xacbc('0x2f')](_0x40986b[_0xacbc('0x2e')]);_0x20190b['filters']=_[_0xacbc('0x30')](_0x20190b['model'],_0x20190b[_0xacbc('0x2e')]);_0x4b9959[_0xacbc('0x31')]=_['intersection'](_0x20190b[_0xacbc('0x2d')],qs[_0xacbc('0x32')](_0x40986b['query'][_0xacbc('0x32')]));_0x4b9959[_0xacbc('0x31')]=_0x4b9959[_0xacbc('0x31')]['length']?_0x4b9959[_0xacbc('0x31')]:_0x20190b[_0xacbc('0x2d')];if(!_0x40986b[_0xacbc('0x2e')][_0xacbc('0x33')](_0xacbc('0x34'))){_0x4b9959[_0xacbc('0x18')]=qs[_0xacbc('0x18')](_0x40986b[_0xacbc('0x2e')][_0xacbc('0x18')]);_0x4b9959[_0xacbc('0x1a')]=qs[_0xacbc('0x1a')](_0x40986b[_0xacbc('0x2e')][_0xacbc('0x1a')]);}_0x4b9959[_0xacbc('0x35')]=qs[_0xacbc('0x36')](_0x40986b[_0xacbc('0x2e')][_0xacbc('0x36')]);_0x4b9959['where']=qs['filters'](_['pick'](_0x40986b[_0xacbc('0x2e')],_0x20190b[_0xacbc('0x37')]),_0x23fa4c);if(_0x40986b['query'][_0xacbc('0x38')]){_0x4b9959['where']=_[_0xacbc('0x39')](_0x4b9959[_0xacbc('0x3a')],{'$or':_[_0xacbc('0x28')](_0x23fa4c,function(_0x36e01b){if(_0x36e01b['type']!=='VIRTUAL'){var _0x3c252a={};_0x3c252a[_0x36e01b['name']]={'$like':'%'+_0x40986b[_0xacbc('0x2e')][_0xacbc('0x38')]+'%'};return _0x3c252a;}})});}_0x4b9959=_['merge']({},_0x4b9959,_0x40986b[_0xacbc('0x3b')]);var _0x2d5943={'where':_0x4b9959[_0xacbc('0x3a')]};return db[_0xacbc('0x29')][_0xacbc('0x19')](_0x2d5943)['then'](function(_0x3eca83){_0x40f19a[_0xacbc('0x19')]=_0x3eca83;if(_0x40986b[_0xacbc('0x2e')][_0xacbc('0x3c')]){_0x4b9959[_0xacbc('0x3d')]=[{'all':!![]}];}return db[_0xacbc('0x29')][_0xacbc('0x3e')](_0x4b9959);})[_0xacbc('0x3f')](function(_0x16cc2f){_0x40f19a[_0xacbc('0x40')]=_0x16cc2f;return _0x40f19a;})['then'](respondWithFilteredResult(_0x19d82e,_0x4b9959))['catch'](handleError(_0x19d82e,null));};exports['show']=function(_0x429f9e,_0x306f99){var _0x3b6c77={'raw':!![],'where':{'id':_0x429f9e[_0xacbc('0x41')]['id']}},_0x589a42={};_0x589a42[_0xacbc('0x2d')]=_[_0xacbc('0x2f')](db[_0xacbc('0x29')][_0xacbc('0x2a')]);_0x589a42['query']=_[_0xacbc('0x2f')](_0x429f9e[_0xacbc('0x2e')]);_0x589a42[_0xacbc('0x37')]=_['intersection'](_0x589a42[_0xacbc('0x2d')],_0x589a42[_0xacbc('0x2e')]);_0x3b6c77['attributes']=_['intersection'](_0x589a42['model'],qs[_0xacbc('0x32')](_0x429f9e[_0xacbc('0x2e')][_0xacbc('0x32')]));_0x3b6c77['attributes']=_0x3b6c77['attributes'][_0xacbc('0x42')]?_0x3b6c77['attributes']:_0x589a42[_0xacbc('0x2d')];if(_0x429f9e['query']['includeAll']){_0x3b6c77[_0xacbc('0x3d')]=[{'all':!![]}];}_0x3b6c77=_['merge']({},_0x3b6c77,_0x429f9e['options']);return db[_0xacbc('0x29')][_0xacbc('0x43')](_0x3b6c77)[_0xacbc('0x3f')](handleEntityNotFound(_0x306f99,null))['then'](respondWithResult(_0x306f99,null))[_0xacbc('0x44')](handleError(_0x306f99,null));};exports[_0xacbc('0x45')]=function(_0x3734ab,_0x54b574){return db[_0xacbc('0x29')][_0xacbc('0x45')](_0x3734ab[_0xacbc('0x46')],{})[_0xacbc('0x3f')](respondWithResult(_0x54b574,0xc9))[_0xacbc('0x44')](handleError(_0x54b574,null));};exports[_0xacbc('0x1f')]=function(_0x54496d,_0x112598){if(_0x54496d['body']['id']){delete _0x54496d['body']['id'];}return db[_0xacbc('0x29')][_0xacbc('0x43')]({'where':{'id':_0x54496d[_0xacbc('0x41')]['id']}})[_0xacbc('0x3f')](handleEntityNotFound(_0x112598,null))['then'](saveUpdates(_0x54496d[_0xacbc('0x46')],null))['then'](respondWithResult(_0x112598,null))[_0xacbc('0x44')](handleError(_0x112598,null));};exports['destroy']=function(_0x5a6c42,_0x47e80f){return db['SalesforceField'][_0xacbc('0x43')]({'where':{'id':_0x5a6c42['params']['id']}})[_0xacbc('0x3f')](handleEntityNotFound(_0x47e80f,null))[_0xacbc('0x3f')](removeEntity(_0x47e80f,null))['catch'](handleError(_0x47e80f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 089f4a5..09023a0 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 _0xa664=['int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x3ffb1d,_0x2f0676){var _0x557c0f=function(_0x1d7f67){while(--_0x1d7f67){_0x3ffb1d['push'](_0x3ffb1d['shift']());}};_0x557c0f(++_0x2f0676);}(_0xa664,0x6c));var _0x4a66=function(_0x406197,_0x2e470e){_0x406197=_0x406197-0x0;var _0x455072=_0xa664[_0x406197];return _0x455072;};'use strict';var _=require(_0x4a66('0x0'));var util=require(_0x4a66('0x1'));var logger=require(_0x4a66('0x2'))(_0x4a66('0x3'));var moment=require(_0x4a66('0x4'));var BPromise=require(_0x4a66('0x5'));var rp=require(_0x4a66('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a66('0x7'));var attributes=require(_0x4a66('0x8'));module[_0x4a66('0x9')]=function(_0x49236c,_0x5c1852){return _0x49236c[_0x4a66('0xa')](_0x4a66('0xb'),attributes,{'tableName':_0x4a66('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x4a66('0xd'),_0x4a66('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f03=['exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x2f03,0x68));var _0x32f0=function(_0xa8a408,_0x1e3691){_0xa8a408=_0xa8a408-0x0;var _0x2fc86c=_0x2f03[_0xa8a408];return _0x2fc86c;};'use strict';var _=require('lodash');var util=require(_0x32f0('0x0'));var logger=require(_0x32f0('0x1'))(_0x32f0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x32f0('0x3'));var fs=require('fs');var path=require(_0x32f0('0x4'));var rimraf=require(_0x32f0('0x5'));var config=require(_0x32f0('0x6'));var attributes=require(_0x32f0('0x7'));module[_0x32f0('0x8')]=function(_0x497648,_0x329e01){return _0x497648[_0x32f0('0x9')](_0x32f0('0xa'),attributes,{'tableName':_0x32f0('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x32f0('0xc'),_0x32f0('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 b247a43..2c22949 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 _0x2bce=['stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','request','then','info','request\x20sent','debug'];(function(_0x5c0950,_0x166e08){var _0xc5665a=function(_0x5f2b61){while(--_0x5f2b61){_0x5c0950['push'](_0x5c0950['shift']());}};_0xc5665a(++_0x166e08);}(_0x2bce,0xee));var _0xe2bc=function(_0x4b5d10,_0xbd6f87){_0x4b5d10=_0x4b5d10-0x0;var _0x39c279=_0x2bce[_0x4b5d10];return _0x39c279;};'use strict';var _=require(_0xe2bc('0x0'));var util=require(_0xe2bc('0x1'));var moment=require(_0xe2bc('0x2'));var BPromise=require(_0xe2bc('0x3'));var rs=require(_0xe2bc('0x4'));var fs=require('fs');var Redis=require(_0xe2bc('0x5'));var db=require(_0xe2bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe2bc('0x7'));var config=require('../../config/environment');var jayson=require(_0xe2bc('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f2335,_0x4be5a0,_0x2c9e69){return new BPromise(function(_0xcb141d,_0x185359){return client[_0xe2bc('0x9')](_0x1f2335,_0x2c9e69)[_0xe2bc('0xa')](function(_0x22d83b){logger[_0xe2bc('0xb')]('SalesforceField,\x20%s,\x20%s',_0x4be5a0,_0xe2bc('0xc'));logger[_0xe2bc('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4be5a0,'request\x20sent',JSON[_0xe2bc('0xe')](_0x22d83b));if(_0x22d83b[_0xe2bc('0xf')]){if(_0x22d83b[_0xe2bc('0xf')][_0xe2bc('0x10')]===0x1f4){logger[_0xe2bc('0xf')](_0xe2bc('0x11'),_0x4be5a0,_0x22d83b['error'][_0xe2bc('0x12')]);return _0x185359(_0x22d83b[_0xe2bc('0xf')][_0xe2bc('0x12')]);}logger[_0xe2bc('0xf')]('SalesforceField,\x20%s,\x20%s',_0x4be5a0,_0x22d83b[_0xe2bc('0xf')][_0xe2bc('0x12')]);return _0xcb141d(_0x22d83b[_0xe2bc('0xf')]['message']);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x4be5a0,'request\x20sent');_0xcb141d(_0x22d83b[_0xe2bc('0x13')][_0xe2bc('0x12')]);}})[_0xe2bc('0x14')](function(_0x42c24e){logger[_0xe2bc('0xf')]('SalesforceField,\x20%s,\x20%s',_0x4be5a0,_0x42c24e);_0x185359(_0x42c24e);});});} \ No newline at end of file +var _0x9a35=['request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then'];(function(_0x2e61f2,_0x346b06){var _0x2e1e3d=function(_0x3a56e9){while(--_0x3a56e9){_0x2e61f2['push'](_0x2e61f2['shift']());}};_0x2e1e3d(++_0x346b06);}(_0x9a35,0x8f));var _0x59a3=function(_0x2ba760,_0x5eaceb){_0x2ba760=_0x2ba760-0x0;var _0x32438a=_0x9a35[_0x2ba760];return _0x32438a;};'use strict';var _=require('lodash');var util=require(_0x59a3('0x0'));var moment=require(_0x59a3('0x1'));var BPromise=require(_0x59a3('0x2'));var rs=require(_0x59a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59a3('0x4'))['db'];var utils=require(_0x59a3('0x5'));var logger=require(_0x59a3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x59a3('0x7'));var client=jayson['client'][_0x59a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c73a5,_0x2b117c,_0x27b4a9){return new BPromise(function(_0x34f6af,_0x4d745c){return client[_0x59a3('0x9')](_0x3c73a5,_0x27b4a9)[_0x59a3('0xa')](function(_0x3a7397){logger['info']('SalesforceField,\x20%s,\x20%s',_0x2b117c,_0x59a3('0xb'));logger[_0x59a3('0xc')](_0x59a3('0xd'),_0x2b117c,'request\x20sent',JSON[_0x59a3('0xe')](_0x3a7397));if(_0x3a7397[_0x59a3('0xf')]){if(_0x3a7397['error'][_0x59a3('0x10')]===0x1f4){logger[_0x59a3('0xf')]('SalesforceField,\x20%s,\x20%s',_0x2b117c,_0x3a7397[_0x59a3('0xf')]['message']);return _0x4d745c(_0x3a7397[_0x59a3('0xf')][_0x59a3('0x11')]);}logger[_0x59a3('0xf')](_0x59a3('0x12'),_0x2b117c,_0x3a7397[_0x59a3('0xf')][_0x59a3('0x11')]);return _0x34f6af(_0x3a7397['error'][_0x59a3('0x11')]);}else{logger[_0x59a3('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2b117c,'request\x20sent');_0x34f6af(_0x3a7397[_0x59a3('0x14')][_0x59a3('0x11')]);}})[_0x59a3('0x15')](function(_0x400942){logger[_0x59a3('0xf')]('SalesforceField,\x20%s,\x20%s',_0x2b117c,_0x400942);_0x4d745c(_0x400942);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index f0a336c..30cd387 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 _0xddf2=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','isAuthenticated','create','addConfiguration','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x42183d,_0x18a849){var _0x3a7ae0=function(_0x12dee1){while(--_0x12dee1){_0x42183d['push'](_0x42183d['shift']());}};_0x3a7ae0(++_0x18a849);}(_0xddf2,0x1dd));var _0x2ddf=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xddf2[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2ddf('0x0'));var timeout=require('connect-timeout');var express=require(_0x2ddf('0x1'));var router=express[_0x2ddf('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2ddf('0x3'));var interaction=require(_0x2ddf('0x4'));var config=require(_0x2ddf('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x2ddf('0x6')]('/',auth['isAuthenticated'](),controller[_0x2ddf('0x7')]);router[_0x2ddf('0x6')](_0x2ddf('0x8'),auth['isAuthenticated'](),controller[_0x2ddf('0x9')]);router[_0x2ddf('0x6')](_0x2ddf('0xa'),auth['isAuthenticated'](),controller[_0x2ddf('0xb')]);router[_0x2ddf('0x6')](_0x2ddf('0xc'),auth['isAuthenticated'](),controller[_0x2ddf('0xd')]);router[_0x2ddf('0xe')]('/',auth[_0x2ddf('0xf')](),controller[_0x2ddf('0x10')]);router[_0x2ddf('0xe')]('/:id/configurations',auth[_0x2ddf('0xf')](),controller[_0x2ddf('0x11')]);router['put'](_0x2ddf('0x8'),auth['isAuthenticated'](),controller[_0x2ddf('0x12')]);router[_0x2ddf('0x13')](_0x2ddf('0x8'),auth[_0x2ddf('0xf')](),controller[_0x2ddf('0x14')]);module[_0x2ddf('0x15')]=router; \ No newline at end of file +var _0x4747=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','/:id/fields','post','create','addConfiguration'];(function(_0x359405,_0x5e803c){var _0x1ea410=function(_0x5f1375){while(--_0x5f1375){_0x359405['push'](_0x359405['shift']());}};_0x1ea410(++_0x5e803c);}(_0x4747,0xc9));var _0x7474=function(_0x31a51b,_0x4775e8){_0x31a51b=_0x31a51b-0x0;var _0x38d5d8=_0x4747[_0x31a51b];return _0x38d5d8;};'use strict';var multer=require(_0x7474('0x0'));var util=require('util');var path=require(_0x7474('0x1'));var timeout=require(_0x7474('0x2'));var express=require(_0x7474('0x3'));var router=express[_0x7474('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7474('0x5'));var interaction=require(_0x7474('0x6'));var config=require(_0x7474('0x7'));var controller=require(_0x7474('0x8'));router['get']('/',auth[_0x7474('0x9')](),controller[_0x7474('0xa')]);router['get'](_0x7474('0xb'),auth[_0x7474('0x9')](),controller[_0x7474('0xc')]);router[_0x7474('0xd')](_0x7474('0xe'),auth[_0x7474('0x9')](),controller['getConfigurations']);router['get'](_0x7474('0xf'),auth[_0x7474('0x9')](),controller['getFields']);router[_0x7474('0x10')]('/',auth[_0x7474('0x9')](),controller[_0x7474('0x11')]);router[_0x7474('0x10')](_0x7474('0xe'),auth['isAuthenticated'](),controller[_0x7474('0x12')]);router['put'](_0x7474('0xb'),auth['isAuthenticated'](),controller[_0x7474('0x13')]);router['delete']('/:id',auth[_0x7474('0x9')](),controller[_0x7474('0x14')]);module[_0x7474('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 9afaca3..68b70d3 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 _0x44bd=['STRING','username','remoteUri','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44bd,0x1b7));var _0xd44b=function(_0x406738,_0x3dbc07){_0x406738=_0x406738-0x0;var _0x3a76ca=_0x44bd[_0x406738];return _0x3a76ca;};'use strict';var Sequelize=require(_0xd44b('0x0'));module['exports']={'name':{'type':Sequelize[_0xd44b('0x1')]},'description':{'type':Sequelize[_0xd44b('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xd44b('0x2')},'password':{'type':Sequelize[_0xd44b('0x1')]},'email':{'type':Sequelize[_0xd44b('0x1')]},'remoteUri':{'type':Sequelize[_0xd44b('0x1')],'unique':_0xd44b('0x3')},'serverUrl':{'type':Sequelize[_0xd44b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd96f=['remoteUri','exports','STRING'];(function(_0x30aa90,_0x47e9b3){var _0x2a7b4b=function(_0x2213aa){while(--_0x2213aa){_0x30aa90['push'](_0x30aa90['shift']());}};_0x2a7b4b(++_0x47e9b3);}(_0xd96f,0x11e));var _0xfd96=function(_0x69e2ac,_0x46e136){_0x69e2ac=_0x69e2ac-0x0;var _0x200154=_0xd96f[_0x69e2ac];return _0x200154;};'use strict';var Sequelize=require('sequelize');module[_0xfd96('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfd96('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xfd96('0x1')]},'email':{'type':Sequelize[_0xfd96('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfd96('0x2')},'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 4f81ff9..0011197 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 _0xd2ab=['rows','catch','show','length','find','create','body','params','getConfigurations','ServicenowConfiguration','addConfiguration','findOne','AccountId','Subjects','Descriptions','channel','ServicenowField','getFields','made_sla','hold_reason','subcategory','incident_state','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','work_notes_list','sys_domain_path','rfc','time_worked','expected_start','business_duration','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','sys_id','reopened_by','urgency','problem_id','company','activity_due','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','label','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','name','query','keys','attributes','intersection','fields','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0xdbd525,_0x2187c8){var _0x2a3a33=function(_0x5e4f74){while(--_0x5e4f74){_0xdbd525['push'](_0xdbd525['shift']());}};_0x2a3a33(++_0x2187c8);}(_0xd2ab,0x70));var _0xbd2a=function(_0x44b840,_0x4fc3f9){_0x44b840=_0x44b840-0x0;var _0x5f5730=_0xd2ab[_0x44b840];return _0x5f5730;};'use strict';var emlformat=require(_0xbd2a('0x0'));var rimraf=require(_0xbd2a('0x1'));var zipdir=require(_0xbd2a('0x2'));var jsonpatch=require(_0xbd2a('0x3'));var rp=require('request-promise');var moment=require(_0xbd2a('0x4'));var BPromise=require(_0xbd2a('0x5'));var Mustache=require(_0xbd2a('0x6'));var util=require(_0xbd2a('0x7'));var path=require(_0xbd2a('0x8'));var sox=require(_0xbd2a('0x9'));var csv=require(_0xbd2a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd2a('0xb'));var squel=require(_0xbd2a('0xc'));var crypto=require(_0xbd2a('0xd'));var jsforce=require(_0xbd2a('0xe'));var deskjs=require(_0xbd2a('0xf'));var toCsv=require(_0xbd2a('0xa'));var querystring=require(_0xbd2a('0x10'));var Papa=require('papaparse');var Redis=require(_0xbd2a('0x11'));var authService=require(_0xbd2a('0x12'));var qs=require(_0xbd2a('0x13'));var as=require(_0xbd2a('0x14'));var hardwareService=require(_0xbd2a('0x15'));var logger=require('../../config/logger')(_0xbd2a('0x16'));var utils=require('../../config/utils');var config=require(_0xbd2a('0x17'));var licenseUtil=require(_0xbd2a('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbd2a('0x19'));function respondWithStatusCode(_0x4b7fb0,_0x5ae0c8){_0x5ae0c8=_0x5ae0c8||0xcc;return function(_0x153ec3){if(_0x153ec3){return _0x4b7fb0[_0xbd2a('0x1a')](_0x5ae0c8);}return _0x4b7fb0['status'](_0x5ae0c8)[_0xbd2a('0x1b')]();};}function respondWithResult(_0x37c692,_0x3da7cf){_0x3da7cf=_0x3da7cf||0xc8;return function(_0x390e27){if(_0x390e27){return _0x37c692[_0xbd2a('0x1c')](_0x3da7cf)[_0xbd2a('0x1d')](_0x390e27);}};}function respondWithFilteredResult(_0x40e586,_0x3e4a26){return function(_0x1d3607){if(_0x1d3607){var _0xd05542=typeof _0x3e4a26[_0xbd2a('0x1e')]===_0xbd2a('0x1f')&&typeof _0x3e4a26[_0xbd2a('0x20')]===_0xbd2a('0x1f');var _0x1ec1f1=_0x1d3607[_0xbd2a('0x21')];var _0xa137b9=_0xd05542?0x0:_0x3e4a26[_0xbd2a('0x1e')];var _0x35f9d1=_0xd05542?_0x1d3607['count']:_0x3e4a26['offset']+_0x3e4a26[_0xbd2a('0x20')];var _0x4f9f7b;if(_0x35f9d1>=_0x1ec1f1){_0x35f9d1=_0x1ec1f1;_0x4f9f7b=0xc8;}else{_0x4f9f7b=0xce;}_0x40e586[_0xbd2a('0x1c')](_0x4f9f7b);return _0x40e586[_0xbd2a('0x22')](_0xbd2a('0x23'),_0xa137b9+'-'+_0x35f9d1+'/'+_0x1ec1f1)[_0xbd2a('0x1d')](_0x1d3607);}return null;};}function patchUpdates(_0x43f6ee){return function(_0x411209){try{jsonpatch[_0xbd2a('0x24')](_0x411209,_0x43f6ee,!![]);}catch(_0x1c0365){return BPromise[_0xbd2a('0x25')](_0x1c0365);}return _0x411209[_0xbd2a('0x26')]();};}function saveUpdates(_0x31a48f,_0x251078){return function(_0x199911){if(_0x199911){return _0x199911[_0xbd2a('0x27')](_0x31a48f)[_0xbd2a('0x28')](function(_0x3d0198){return _0x3d0198;});}return null;};}function removeEntity(_0x4fb8ce,_0x1621d9){return function(_0x51a37f){if(_0x51a37f){return _0x51a37f[_0xbd2a('0x29')]()[_0xbd2a('0x28')](function(){_0x4fb8ce[_0xbd2a('0x1c')](0xcc)[_0xbd2a('0x1b')]();});}};}function handleEntityNotFound(_0x494efc,_0x195cbd){return function(_0x4207a8){if(!_0x4207a8){_0x494efc['sendStatus'](0x194);}return _0x4207a8;};}function handleError(_0x4e108f,_0xa60bba){_0xa60bba=_0xa60bba||0x1f4;return function(_0x325a2b){logger[_0xbd2a('0x2a')](_0x325a2b[_0xbd2a('0x2b')]);if(_0x325a2b['name']){delete _0x325a2b['name'];}_0x4e108f[_0xbd2a('0x1c')](_0xa60bba)[_0xbd2a('0x2c')](_0x325a2b);};}exports[_0xbd2a('0x2d')]=function(_0x2c4978,_0x4e487d){var _0xc0bd1e={},_0x4e4cad={},_0x443cf4={'count':0x0,'rows':[]};var _0xf82b69=_[_0xbd2a('0x2e')](db[_0xbd2a('0x2f')][_0xbd2a('0x30')],function(_0x1b67c1){return{'name':_0x1b67c1[_0xbd2a('0x31')],'type':_0x1b67c1['type'][_0xbd2a('0x32')]};});_0x4e4cad[_0xbd2a('0x33')]=_['map'](_0xf82b69,_0xbd2a('0x34'));_0x4e4cad[_0xbd2a('0x35')]=_[_0xbd2a('0x36')](_0x2c4978[_0xbd2a('0x35')]);_0x4e4cad['filters']=_['intersection'](_0x4e4cad[_0xbd2a('0x33')],_0x4e4cad['query']);_0xc0bd1e[_0xbd2a('0x37')]=_[_0xbd2a('0x38')](_0x4e4cad['model'],qs[_0xbd2a('0x39')](_0x2c4978[_0xbd2a('0x35')]['fields']));_0xc0bd1e[_0xbd2a('0x37')]=_0xc0bd1e['attributes']['length']?_0xc0bd1e[_0xbd2a('0x37')]:_0x4e4cad[_0xbd2a('0x33')];if(!_0x2c4978[_0xbd2a('0x35')]['hasOwnProperty'](_0xbd2a('0x3a'))){_0xc0bd1e[_0xbd2a('0x20')]=qs[_0xbd2a('0x20')](_0x2c4978[_0xbd2a('0x35')]['limit']);_0xc0bd1e[_0xbd2a('0x1e')]=qs['offset'](_0x2c4978[_0xbd2a('0x35')][_0xbd2a('0x1e')]);}_0xc0bd1e[_0xbd2a('0x3b')]=qs['sort'](_0x2c4978[_0xbd2a('0x35')][_0xbd2a('0x3c')]);_0xc0bd1e['where']=qs['filters'](_[_0xbd2a('0x3d')](_0x2c4978[_0xbd2a('0x35')],_0x4e4cad[_0xbd2a('0x3e')]),_0xf82b69);if(_0x2c4978['query'][_0xbd2a('0x3f')]){_0xc0bd1e[_0xbd2a('0x40')]=_[_0xbd2a('0x41')](_0xc0bd1e[_0xbd2a('0x40')],{'$or':_['map'](_0xf82b69,function(_0xcf94e){if(_0xcf94e[_0xbd2a('0x42')]!==_0xbd2a('0x43')){var _0x132216={};_0x132216[_0xcf94e[_0xbd2a('0x34')]]={'$like':'%'+_0x2c4978[_0xbd2a('0x35')]['filter']+'%'};return _0x132216;}})});}_0xc0bd1e=_[_0xbd2a('0x41')]({},_0xc0bd1e,_0x2c4978[_0xbd2a('0x44')]);var _0x56796e={'where':_0xc0bd1e[_0xbd2a('0x40')]};return db['ServicenowAccount'][_0xbd2a('0x21')](_0x56796e)['then'](function(_0xd712b4){_0x443cf4[_0xbd2a('0x21')]=_0xd712b4;if(_0x2c4978[_0xbd2a('0x35')][_0xbd2a('0x45')]){_0xc0bd1e[_0xbd2a('0x46')]=[{'all':!![]}];}return db[_0xbd2a('0x2f')][_0xbd2a('0x47')](_0xc0bd1e);})[_0xbd2a('0x28')](function(_0x1a8ce7){_0x443cf4[_0xbd2a('0x48')]=_0x1a8ce7;return _0x443cf4;})[_0xbd2a('0x28')](respondWithFilteredResult(_0x4e487d,_0xc0bd1e))[_0xbd2a('0x49')](handleError(_0x4e487d,null));};exports[_0xbd2a('0x4a')]=function(_0x344c88,_0x2c5999){var _0x4e06d0={'raw':![],'where':{'id':_0x344c88['params']['id']}},_0x3c47c0={};_0x3c47c0['model']=_[_0xbd2a('0x36')](db['ServicenowAccount']['rawAttributes']);_0x3c47c0[_0xbd2a('0x35')]=_['keys'](_0x344c88[_0xbd2a('0x35')]);_0x3c47c0[_0xbd2a('0x3e')]=_[_0xbd2a('0x38')](_0x3c47c0['model'],_0x3c47c0['query']);_0x4e06d0['attributes']=_[_0xbd2a('0x38')](_0x3c47c0[_0xbd2a('0x33')],qs[_0xbd2a('0x39')](_0x344c88[_0xbd2a('0x35')]['fields']));_0x4e06d0['attributes']=_0x4e06d0['attributes'][_0xbd2a('0x4b')]?_0x4e06d0[_0xbd2a('0x37')]:_0x3c47c0[_0xbd2a('0x33')];if(_0x344c88['query'][_0xbd2a('0x45')]){_0x4e06d0[_0xbd2a('0x46')]=[{'all':!![]}];}_0x4e06d0=_[_0xbd2a('0x41')]({},_0x4e06d0,_0x344c88[_0xbd2a('0x44')]);return db[_0xbd2a('0x2f')][_0xbd2a('0x4c')](_0x4e06d0)[_0xbd2a('0x28')](handleEntityNotFound(_0x2c5999,null))[_0xbd2a('0x28')](respondWithResult(_0x2c5999,null))[_0xbd2a('0x49')](handleError(_0x2c5999,null));};exports[_0xbd2a('0x4d')]=function(_0x4fdbfa,_0x23df04){return db['ServicenowAccount'][_0xbd2a('0x4d')](_0x4fdbfa[_0xbd2a('0x4e')],{})[_0xbd2a('0x28')](respondWithResult(_0x23df04,0xc9))[_0xbd2a('0x49')](handleError(_0x23df04,null));};exports[_0xbd2a('0x27')]=function(_0x74b1c5,_0x519775){if(_0x74b1c5[_0xbd2a('0x4e')]['id']){delete _0x74b1c5[_0xbd2a('0x4e')]['id'];}return db[_0xbd2a('0x2f')]['find']({'where':{'id':_0x74b1c5[_0xbd2a('0x4f')]['id']}})[_0xbd2a('0x28')](handleEntityNotFound(_0x519775,null))[_0xbd2a('0x28')](saveUpdates(_0x74b1c5['body'],null))['then'](respondWithResult(_0x519775,null))[_0xbd2a('0x49')](handleError(_0x519775,null));};exports[_0xbd2a('0x29')]=function(_0x4b3a6d,_0xe8d97){return db[_0xbd2a('0x2f')][_0xbd2a('0x4c')]({'where':{'id':_0x4b3a6d['params']['id']}})[_0xbd2a('0x28')](handleEntityNotFound(_0xe8d97,null))[_0xbd2a('0x28')](removeEntity(_0xe8d97,null))[_0xbd2a('0x49')](handleError(_0xe8d97,null));};exports[_0xbd2a('0x50')]=function(_0x4246d1,_0x17fc39,_0x1ca282){var _0x28454d={};var _0x200dc2={};var _0x2adeee;var _0x52bf46;return db[_0xbd2a('0x2f')]['findOne']({'where':{'id':_0x4246d1['params']['id']}})[_0xbd2a('0x28')](handleEntityNotFound(_0x17fc39,null))[_0xbd2a('0x28')](function(_0x42890a){if(_0x42890a){_0x2adeee=_0x42890a;_0x200dc2[_0xbd2a('0x33')]=_[_0xbd2a('0x36')](db[_0xbd2a('0x51')][_0xbd2a('0x30')]);_0x200dc2[_0xbd2a('0x35')]=_['keys'](_0x4246d1['query']);_0x200dc2[_0xbd2a('0x3e')]=_[_0xbd2a('0x38')](_0x200dc2[_0xbd2a('0x33')],_0x200dc2[_0xbd2a('0x35')]);_0x28454d[_0xbd2a('0x37')]=_[_0xbd2a('0x38')](_0x200dc2[_0xbd2a('0x33')],qs[_0xbd2a('0x39')](_0x4246d1[_0xbd2a('0x35')][_0xbd2a('0x39')]));_0x28454d[_0xbd2a('0x37')]=_0x28454d[_0xbd2a('0x37')][_0xbd2a('0x4b')]?_0x28454d[_0xbd2a('0x37')]:_0x200dc2['model'];_0x28454d[_0xbd2a('0x3b')]=qs[_0xbd2a('0x3c')](_0x4246d1[_0xbd2a('0x35')][_0xbd2a('0x3c')]);_0x28454d[_0xbd2a('0x40')]=qs[_0xbd2a('0x3e')](_[_0xbd2a('0x3d')](_0x4246d1[_0xbd2a('0x35')],_0x200dc2[_0xbd2a('0x3e')]));if(_0x4246d1[_0xbd2a('0x35')][_0xbd2a('0x3f')]){_0x28454d[_0xbd2a('0x40')]=_[_0xbd2a('0x41')](_0x28454d['where'],{'$or':_['map'](_0x28454d[_0xbd2a('0x37')],function(_0x49f142){var _0x196d2a={};_0x196d2a[_0x49f142]={'$like':'%'+_0x4246d1[_0xbd2a('0x35')][_0xbd2a('0x3f')]+'%'};return _0x196d2a;})});}_0x28454d=_[_0xbd2a('0x41')]({},_0x28454d,_0x4246d1[_0xbd2a('0x44')]);return _0x2adeee[_0xbd2a('0x50')](_0x28454d);}})[_0xbd2a('0x28')](function(_0x1092ea){if(_0x1092ea){_0x52bf46=_0x1092ea[_0xbd2a('0x4b')];if(!_0x4246d1[_0xbd2a('0x35')]['hasOwnProperty'](_0xbd2a('0x3a'))){_0x28454d[_0xbd2a('0x20')]=qs[_0xbd2a('0x20')](_0x4246d1[_0xbd2a('0x35')][_0xbd2a('0x20')]);_0x28454d[_0xbd2a('0x1e')]=qs['offset'](_0x4246d1[_0xbd2a('0x35')]['offset']);}return _0x2adeee[_0xbd2a('0x50')](_0x28454d);}})['then'](function(_0xa424ab){if(_0xa424ab){return _0xa424ab?{'count':_0x52bf46,'rows':_0xa424ab}:null;}})[_0xbd2a('0x28')](respondWithResult(_0x17fc39,null))[_0xbd2a('0x49')](handleError(_0x17fc39,null));};exports[_0xbd2a('0x52')]=function(_0x4f9f8f,_0x5c16dd,_0x5e6200){if(_0x4f9f8f[_0xbd2a('0x4e')]['id']){delete _0x4f9f8f[_0xbd2a('0x4e')]['id'];}return db[_0xbd2a('0x2f')][_0xbd2a('0x53')]({'where':{'id':_0x4f9f8f[_0xbd2a('0x4f')]['id']}})[_0xbd2a('0x28')](handleEntityNotFound(_0x5c16dd,null))[_0xbd2a('0x28')](function(_0x4c601e){if(_0x4c601e){_0x4f9f8f['body'][_0xbd2a('0x54')]=_0x4c601e['id'];_0x4f9f8f['body'][_0xbd2a('0x55')]=integrations['getSubjects'](_0x4f9f8f['body']['channel'],_0x4f9f8f[_0xbd2a('0x4e')][_0xbd2a('0x42')]);_0x4f9f8f[_0xbd2a('0x4e')][_0xbd2a('0x56')]=integrations['getDescriptions'](_0x4f9f8f[_0xbd2a('0x4e')][_0xbd2a('0x57')],_0x4f9f8f['body'][_0xbd2a('0x42')]);return db[_0xbd2a('0x51')][_0xbd2a('0x4d')](_0x4f9f8f[_0xbd2a('0x4e')],{'include':[{'model':db[_0xbd2a('0x58')],'as':_0xbd2a('0x55')},{'model':db[_0xbd2a('0x58')],'as':_0xbd2a('0x56')}]});}return null;})[_0xbd2a('0x28')](respondWithResult(_0x5c16dd,null))[_0xbd2a('0x49')](handleError(_0x5c16dd,null));};exports[_0xbd2a('0x59')]=function(_0x23f354,_0x55c6b1,_0x20ee55){var _0x45da2b=[_0xbd2a('0x5a'),_0xbd2a('0x5b'),'knowledge',_0xbd2a('0x5c'),'close_code','notify',_0xbd2a('0x5d'),'severity',_0xbd2a('0x5e')];var _0x579782=[_0xbd2a('0x5f'),_0xbd2a('0x5a'),_0xbd2a('0x60'),_0xbd2a('0x61'),'upon_reject',_0xbd2a('0x62'),_0xbd2a('0x63'),_0xbd2a('0x5b'),_0xbd2a('0x64'),_0xbd2a('0x65'),'resolved_by','sys_updated_by',_0xbd2a('0x66'),_0xbd2a('0x67'),_0xbd2a('0x68'),'sys_domain',_0xbd2a('0x69'),_0xbd2a('0x6a'),'knowledge',_0xbd2a('0x3b'),_0xbd2a('0x6b'),_0xbd2a('0x6c'),_0xbd2a('0x6d'),_0xbd2a('0x6e'),'impact','active',_0xbd2a('0x6f'),'business_service','priority',_0xbd2a('0x70'),_0xbd2a('0x71'),_0xbd2a('0x72'),_0xbd2a('0x73'),'opened_at',_0xbd2a('0x74'),'group_list','work_end',_0xbd2a('0x75'),'resolved_at',_0xbd2a('0x76'),_0xbd2a('0x77'),'subcategory',_0xbd2a('0x78'),_0xbd2a('0x79'),'close_code',_0xbd2a('0x7a'),_0xbd2a('0x7b'),_0xbd2a('0x7c'),_0xbd2a('0x7d'),_0xbd2a('0x7e'),_0xbd2a('0x7f'),_0xbd2a('0x80'),_0xbd2a('0x81'),_0xbd2a('0x82'),_0xbd2a('0x83'),_0xbd2a('0x84'),_0xbd2a('0x85'),_0xbd2a('0x86'),'parent_incident',_0xbd2a('0x87'),'contact_type',_0xbd2a('0x88'),'incident_state',_0xbd2a('0x89'),_0xbd2a('0x8a'),_0xbd2a('0x8b'),'reassignment_count',_0xbd2a('0x8c'),'assigned_to',_0xbd2a('0x8d'),_0xbd2a('0x8e'),_0xbd2a('0x8f'),_0xbd2a('0x90'),_0xbd2a('0x91'),_0xbd2a('0x92'),_0xbd2a('0x93'),_0xbd2a('0x94'),'sys_tags',_0xbd2a('0x95'),_0xbd2a('0x96'),_0xbd2a('0x97'),_0xbd2a('0x98'),_0xbd2a('0x5e')];var _0x3e8066='';var _0x5a67fb='';var _0x3236b0=[];var _0x23dad5='';var _0x5a4915='';var _0x125a7d=[];var _0x55c391='';var _0x381fd5='';var _0x2392f8={};var _0x56618b='';return db[_0xbd2a('0x2f')]['findOne']({'where':{'id':_0x23f354[_0xbd2a('0x4f')]['id']},'attributes':['id',_0xbd2a('0x99'),_0xbd2a('0x9a'),_0xbd2a('0x9b'),'remoteUri','serverUrl']})[_0xbd2a('0x28')](handleEntityNotFound(_0x55c6b1,null))[_0xbd2a('0x28')](function(_0x553e43){if(_0x553e43){_0x56618b=_0x553e43[_0xbd2a('0x9c')];var _0x2cd7a2=_0x56618b['slice'](-0x1);if(_0x2cd7a2==='/'){_0x56618b=_0x56618b['substring'](0x0,_0x56618b[_0xbd2a('0x9d')](_0x2cd7a2));}_0x381fd5=util['format'](_0xbd2a('0x9e'),_0x56618b);_0x55c391=util[_0xbd2a('0x9f')](_0xbd2a('0xa0'),_0x56618b);_0x2392f8={'user':_0x553e43[_0xbd2a('0x99')],'pass':_0x553e43[_0xbd2a('0x9a')]};var _0x4354dc={'method':'GET','uri':_0x381fd5+_0xbd2a('0xa1'),'auth':_0x2392f8,'json':!![]};return rp(_0x4354dc);}})[_0xbd2a('0x28')](function(_0x242365){if(_0x242365[_0xbd2a('0xa2')][_0xbd2a('0x4b')]>0x0){_0x3e8066=_0x242365[_0xbd2a('0xa2')];}console[_0xbd2a('0xa3')](_0xbd2a('0xa4'),_0x3e8066);_0x125a7d=[];_0x5a67fb=Object[_0xbd2a('0xa5')]([],_0x3e8066);_['remove'](_0x5a67fb,function(_0x48f53d){return!_0x45da2b[_0xbd2a('0xa6')](_0x48f53d[_0xbd2a('0x34')]);});_0x5a67fb[_0xbd2a('0xa7')](function(_0x2709de){var _0xc87cd7=createFieldObject(_0x55c391,_0x2392f8,_0x2709de['internalType'],_0x2709de[_0xbd2a('0x34')],_0x2709de['label'],![]);_0x125a7d[_0xbd2a('0xa8')](_0xc87cd7);});return Promise[_0xbd2a('0xa9')](_0x125a7d);})[_0xbd2a('0x28')](function(_0x3628cd){_0x3236b0=_0x3628cd;_0x23dad5=Object[_0xbd2a('0xa5')]([],_0x3e8066);console[_0xbd2a('0xa3')](_0xbd2a('0xaa'),_0x3e8066);_[_0xbd2a('0xab')](_0x23dad5,function(_0x10623e){return _0x579782[_0xbd2a('0xa6')](_0x10623e[_0xbd2a('0x34')]);});console[_0xbd2a('0xa3')](_0xbd2a('0xac'),_0x23dad5);_0x125a7d=[];_0x23dad5[_0xbd2a('0xa7')](function(_0x5bfe90){var _0x5e4213=createFieldObject(_0x55c391,_0x2392f8,_0x5bfe90[_0xbd2a('0xad')],_0x5bfe90[_0xbd2a('0x34')],_0x5bfe90[_0xbd2a('0xae')],!![]);_0x125a7d[_0xbd2a('0xa8')](_0x5e4213);});return Promise['all'](_0x125a7d);})['then'](function(_0xe8bf81){_0x5a4915=_0xe8bf81;var _0x1769eb=_0x3236b0[_0xbd2a('0xaf')](_0x5a4915);return{'count':_0x1769eb['length'],'rows':_0x1769eb};})[_0xbd2a('0x28')](respondWithResult(_0x55c6b1,null))['catch'](function(_0x6f49b){console[_0xbd2a('0xa3')](_0xbd2a('0xb0')+_0x6f49b);var _0x35e3b0=_0x23f354[_0xbd2a('0x35')][_0xbd2a('0xb1')]?0x1f4:_0x6f49b['statusCode']||0x1f4;logger['error'](_0x6f49b[_0xbd2a('0x2b')]);delete _0x6f49b[_0xbd2a('0x34')];if(_0x35e3b0===0x191){_0x35e3b0=0x190;}_0x55c6b1[_0xbd2a('0x1c')](_0x35e3b0)[_0xbd2a('0x2c')](_0x23f354['query'][_0xbd2a('0xb1')]?{'message':_0xbd2a('0xb2'),'statusCode':_0x6f49b['statusCode']}:_0x6f49b);});};function createFieldObject(_0x221e77,_0x2b4e7c,_0x20adfa,_0x2af276,_0x12b186,_0x15860c){return new Promise(function(_0x48645e,_0x13a9ba){var _0x2b360c={'id':_0x2af276,'name':_0x12b186,'custom':_0x15860c};if(_0x20adfa==='boolean'){_0x2b360c[_0xbd2a('0x44')]=[{'name':'True','value':_0xbd2a('0xb3')},{'name':_0xbd2a('0xb4'),'value':_0xbd2a('0xb5')}];_0x48645e(_0x2b360c);}else{var _0x275b7c={'method':'GET','uri':_0x221e77+_0xbd2a('0xb6')+_0x2af276,'auth':_0x2b4e7c,'json':!![]};return rp(_0x275b7c)[_0xbd2a('0x28')](function(_0x204823){var _0x41cdc0=[];if(_0x204823[_0xbd2a('0xa2')]['length']>0x0){_0x204823[_0xbd2a('0xa2')][_0xbd2a('0xa7')](function(_0x529daa){if(_0x529daa['inactive']===_0xbd2a('0xb5')){var _0x224a85={'name':_0x529daa[_0xbd2a('0xae')],'value':_0x529daa[_0xbd2a('0xb7')]};_0x41cdc0[_0xbd2a('0xa8')](_0x224a85);}});}_0x2b360c[_0xbd2a('0x44')]=_0x41cdc0;if(_0x2b360c[_0xbd2a('0x44')][_0xbd2a('0x4b')]>0x0){_0x48645e(_0x2b360c);}else{if(_0x15860c==![]){_0x48645e();}else{_0x48645e(_0x2b360c);}}});}});} \ No newline at end of file +var _0x12f2=['query','intersection','fields','attributes','length','sort','pick','filters','filter','where','VIRTUAL','includeAll','include','rows','catch','show','merge','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','options','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','close_code','incident_state','parent','watch_list','child_incidents','approval_history','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','knowledge','order','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','work_notes','short_description','correlation_display','delivery_task','work_start','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','urgency','company','activity_due','severity','approval','comments_and_work_notes','due_date','sys_tags','escalation','upon_approval','correlation_id','category','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','assign','includes','forEach','internalType','push','log','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','all','test','statusCode','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','model','keys'];(function(_0x239dfc,_0x2389ee){var _0x2fb1bf=function(_0x20d992){while(--_0x20d992){_0x239dfc['push'](_0x239dfc['shift']());}};_0x2fb1bf(++_0x2389ee);}(_0x12f2,0x7e));var _0x212f=function(_0x2ac8c5,_0x5a4d96){_0x2ac8c5=_0x2ac8c5-0x0;var _0x149647=_0x12f2[_0x2ac8c5];return _0x149647;};'use strict';var emlformat=require(_0x212f('0x0'));var rimraf=require(_0x212f('0x1'));var zipdir=require(_0x212f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x212f('0x3'));var moment=require('moment');var BPromise=require(_0x212f('0x4'));var Mustache=require(_0x212f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x212f('0x6'));var csv=require(_0x212f('0x7'));var ejs=require(_0x212f('0x8'));var fs=require('fs');var fs_extra=require(_0x212f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x212f('0xa'));var toCsv=require('to-csv');var querystring=require(_0x212f('0xb'));var Papa=require(_0x212f('0xc'));var Redis=require(_0x212f('0xd'));var authService=require(_0x212f('0xe'));var qs=require(_0x212f('0xf'));var as=require(_0x212f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x212f('0x11'))('api');var utils=require(_0x212f('0x12'));var config=require(_0x212f('0x13'));var licenseUtil=require(_0x212f('0x14'));var db=require(_0x212f('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x45a320,_0x5dcf16){_0x5dcf16=_0x5dcf16||0xcc;return function(_0x328be2){if(_0x328be2){return _0x45a320['sendStatus'](_0x5dcf16);}return _0x45a320[_0x212f('0x16')](_0x5dcf16)[_0x212f('0x17')]();};}function respondWithResult(_0x5866b1,_0x1b963a){_0x1b963a=_0x1b963a||0xc8;return function(_0x369196){if(_0x369196){return _0x5866b1['status'](_0x1b963a)['json'](_0x369196);}};}function respondWithFilteredResult(_0x1094de,_0x5cd1d9){return function(_0xce64c){if(_0xce64c){var _0x5be212=typeof _0x5cd1d9[_0x212f('0x18')]===_0x212f('0x19')&&typeof _0x5cd1d9[_0x212f('0x1a')]===_0x212f('0x19');var _0x4fef35=_0xce64c['count'];var _0x26ebd2=_0x5be212?0x0:_0x5cd1d9[_0x212f('0x18')];var _0x5cf029=_0x5be212?_0xce64c[_0x212f('0x1b')]:_0x5cd1d9[_0x212f('0x18')]+_0x5cd1d9[_0x212f('0x1a')];var _0x25525e;if(_0x5cf029>=_0x4fef35){_0x5cf029=_0x4fef35;_0x25525e=0xc8;}else{_0x25525e=0xce;}_0x1094de['status'](_0x25525e);return _0x1094de[_0x212f('0x1c')](_0x212f('0x1d'),_0x26ebd2+'-'+_0x5cf029+'/'+_0x4fef35)['json'](_0xce64c);}return null;};}function patchUpdates(_0x182bea){return function(_0x1214f2){try{jsonpatch[_0x212f('0x1e')](_0x1214f2,_0x182bea,!![]);}catch(_0x38dd81){return BPromise['reject'](_0x38dd81);}return _0x1214f2[_0x212f('0x1f')]();};}function saveUpdates(_0x281e14,_0x2977dd){return function(_0x4ad008){if(_0x4ad008){return _0x4ad008[_0x212f('0x20')](_0x281e14)[_0x212f('0x21')](function(_0x52ad53){return _0x52ad53;});}return null;};}function removeEntity(_0x4d34e4,_0x534aae){return function(_0x466a33){if(_0x466a33){return _0x466a33[_0x212f('0x22')]()[_0x212f('0x21')](function(){_0x4d34e4[_0x212f('0x16')](0xcc)[_0x212f('0x17')]();});}};}function handleEntityNotFound(_0x5c5920,_0x1ee90a){return function(_0x59bb86){if(!_0x59bb86){_0x5c5920[_0x212f('0x23')](0x194);}return _0x59bb86;};}function handleError(_0x5cd002,_0x3b12bc){_0x3b12bc=_0x3b12bc||0x1f4;return function(_0x1e84c5){logger[_0x212f('0x24')](_0x1e84c5[_0x212f('0x25')]);if(_0x1e84c5[_0x212f('0x26')]){delete _0x1e84c5[_0x212f('0x26')];}_0x5cd002[_0x212f('0x16')](_0x3b12bc)[_0x212f('0x27')](_0x1e84c5);};}exports[_0x212f('0x28')]=function(_0x5a6cc3,_0x263a14){var _0x14a757={},_0x42bda0={},_0x42a752={'count':0x0,'rows':[]};var _0x3391eb=_[_0x212f('0x29')](db[_0x212f('0x2a')]['rawAttributes'],function(_0x158485){return{'name':_0x158485[_0x212f('0x2b')],'type':_0x158485[_0x212f('0x2c')][_0x212f('0x2d')]};});_0x42bda0[_0x212f('0x2e')]=_['map'](_0x3391eb,_0x212f('0x26'));_0x42bda0['query']=_[_0x212f('0x2f')](_0x5a6cc3[_0x212f('0x30')]);_0x42bda0['filters']=_[_0x212f('0x31')](_0x42bda0[_0x212f('0x2e')],_0x42bda0[_0x212f('0x30')]);_0x14a757['attributes']=_[_0x212f('0x31')](_0x42bda0[_0x212f('0x2e')],qs[_0x212f('0x32')](_0x5a6cc3[_0x212f('0x30')][_0x212f('0x32')]));_0x14a757[_0x212f('0x33')]=_0x14a757[_0x212f('0x33')][_0x212f('0x34')]?_0x14a757[_0x212f('0x33')]:_0x42bda0[_0x212f('0x2e')];if(!_0x5a6cc3['query']['hasOwnProperty']('nolimit')){_0x14a757[_0x212f('0x1a')]=qs[_0x212f('0x1a')](_0x5a6cc3[_0x212f('0x30')][_0x212f('0x1a')]);_0x14a757['offset']=qs['offset'](_0x5a6cc3[_0x212f('0x30')][_0x212f('0x18')]);}_0x14a757['order']=qs['sort'](_0x5a6cc3[_0x212f('0x30')][_0x212f('0x35')]);_0x14a757['where']=qs['filters'](_[_0x212f('0x36')](_0x5a6cc3[_0x212f('0x30')],_0x42bda0[_0x212f('0x37')]),_0x3391eb);if(_0x5a6cc3[_0x212f('0x30')][_0x212f('0x38')]){_0x14a757[_0x212f('0x39')]=_['merge'](_0x14a757['where'],{'$or':_[_0x212f('0x29')](_0x3391eb,function(_0x26e387){if(_0x26e387[_0x212f('0x2c')]!==_0x212f('0x3a')){var _0xeffdd3={};_0xeffdd3[_0x26e387['name']]={'$like':'%'+_0x5a6cc3[_0x212f('0x30')]['filter']+'%'};return _0xeffdd3;}})});}_0x14a757=_['merge']({},_0x14a757,_0x5a6cc3['options']);var _0x1c90e0={'where':_0x14a757[_0x212f('0x39')]};return db[_0x212f('0x2a')][_0x212f('0x1b')](_0x1c90e0)[_0x212f('0x21')](function(_0x41e3c5){_0x42a752[_0x212f('0x1b')]=_0x41e3c5;if(_0x5a6cc3['query'][_0x212f('0x3b')]){_0x14a757[_0x212f('0x3c')]=[{'all':!![]}];}return db[_0x212f('0x2a')]['findAll'](_0x14a757);})[_0x212f('0x21')](function(_0xe276d5){_0x42a752[_0x212f('0x3d')]=_0xe276d5;return _0x42a752;})['then'](respondWithFilteredResult(_0x263a14,_0x14a757))[_0x212f('0x3e')](handleError(_0x263a14,null));};exports[_0x212f('0x3f')]=function(_0x5c0dbc,_0x16a94a){var _0x3c7455={'raw':![],'where':{'id':_0x5c0dbc['params']['id']}},_0x1a1587={};_0x1a1587[_0x212f('0x2e')]=_[_0x212f('0x2f')](db[_0x212f('0x2a')]['rawAttributes']);_0x1a1587[_0x212f('0x30')]=_[_0x212f('0x2f')](_0x5c0dbc[_0x212f('0x30')]);_0x1a1587[_0x212f('0x37')]=_[_0x212f('0x31')](_0x1a1587[_0x212f('0x2e')],_0x1a1587[_0x212f('0x30')]);_0x3c7455[_0x212f('0x33')]=_[_0x212f('0x31')](_0x1a1587[_0x212f('0x2e')],qs[_0x212f('0x32')](_0x5c0dbc[_0x212f('0x30')][_0x212f('0x32')]));_0x3c7455['attributes']=_0x3c7455[_0x212f('0x33')][_0x212f('0x34')]?_0x3c7455[_0x212f('0x33')]:_0x1a1587[_0x212f('0x2e')];if(_0x5c0dbc['query'][_0x212f('0x3b')]){_0x3c7455[_0x212f('0x3c')]=[{'all':!![]}];}_0x3c7455=_[_0x212f('0x40')]({},_0x3c7455,_0x5c0dbc['options']);return db['ServicenowAccount'][_0x212f('0x41')](_0x3c7455)[_0x212f('0x21')](handleEntityNotFound(_0x16a94a,null))[_0x212f('0x21')](respondWithResult(_0x16a94a,null))[_0x212f('0x3e')](handleError(_0x16a94a,null));};exports[_0x212f('0x42')]=function(_0x12ec29,_0x1e0f42){return db['ServicenowAccount'][_0x212f('0x42')](_0x12ec29[_0x212f('0x43')],{})[_0x212f('0x21')](respondWithResult(_0x1e0f42,0xc9))[_0x212f('0x3e')](handleError(_0x1e0f42,null));};exports[_0x212f('0x20')]=function(_0x1005ce,_0x174e57){if(_0x1005ce[_0x212f('0x43')]['id']){delete _0x1005ce[_0x212f('0x43')]['id'];}return db[_0x212f('0x2a')][_0x212f('0x41')]({'where':{'id':_0x1005ce[_0x212f('0x44')]['id']}})[_0x212f('0x21')](handleEntityNotFound(_0x174e57,null))['then'](saveUpdates(_0x1005ce['body'],null))[_0x212f('0x21')](respondWithResult(_0x174e57,null))[_0x212f('0x3e')](handleError(_0x174e57,null));};exports[_0x212f('0x22')]=function(_0x4fda1f,_0x796cba){return db[_0x212f('0x2a')][_0x212f('0x41')]({'where':{'id':_0x4fda1f['params']['id']}})[_0x212f('0x21')](handleEntityNotFound(_0x796cba,null))[_0x212f('0x21')](removeEntity(_0x796cba,null))[_0x212f('0x3e')](handleError(_0x796cba,null));};exports[_0x212f('0x45')]=function(_0x1890fc,_0x398321,_0x2881d3){var _0x3f8db9={};var _0x43f9ac={};var _0x1b8fd6;var _0x24a735;return db[_0x212f('0x2a')][_0x212f('0x46')]({'where':{'id':_0x1890fc[_0x212f('0x44')]['id']}})[_0x212f('0x21')](handleEntityNotFound(_0x398321,null))['then'](function(_0x56c667){if(_0x56c667){_0x1b8fd6=_0x56c667;_0x43f9ac[_0x212f('0x2e')]=_[_0x212f('0x2f')](db[_0x212f('0x47')]['rawAttributes']);_0x43f9ac[_0x212f('0x30')]=_[_0x212f('0x2f')](_0x1890fc[_0x212f('0x30')]);_0x43f9ac[_0x212f('0x37')]=_[_0x212f('0x31')](_0x43f9ac[_0x212f('0x2e')],_0x43f9ac[_0x212f('0x30')]);_0x3f8db9[_0x212f('0x33')]=_['intersection'](_0x43f9ac['model'],qs[_0x212f('0x32')](_0x1890fc[_0x212f('0x30')]['fields']));_0x3f8db9[_0x212f('0x33')]=_0x3f8db9[_0x212f('0x33')][_0x212f('0x34')]?_0x3f8db9[_0x212f('0x33')]:_0x43f9ac[_0x212f('0x2e')];_0x3f8db9['order']=qs['sort'](_0x1890fc[_0x212f('0x30')][_0x212f('0x35')]);_0x3f8db9[_0x212f('0x39')]=qs[_0x212f('0x37')](_['pick'](_0x1890fc['query'],_0x43f9ac['filters']));if(_0x1890fc[_0x212f('0x30')][_0x212f('0x38')]){_0x3f8db9[_0x212f('0x39')]=_[_0x212f('0x40')](_0x3f8db9[_0x212f('0x39')],{'$or':_['map'](_0x3f8db9[_0x212f('0x33')],function(_0x52ead9){var _0x4a8d94={};_0x4a8d94[_0x52ead9]={'$like':'%'+_0x1890fc['query'][_0x212f('0x38')]+'%'};return _0x4a8d94;})});}_0x3f8db9=_[_0x212f('0x40')]({},_0x3f8db9,_0x1890fc[_0x212f('0x48')]);return _0x1b8fd6[_0x212f('0x45')](_0x3f8db9);}})['then'](function(_0x5494ba){if(_0x5494ba){_0x24a735=_0x5494ba['length'];if(!_0x1890fc[_0x212f('0x30')][_0x212f('0x49')](_0x212f('0x4a'))){_0x3f8db9[_0x212f('0x1a')]=qs[_0x212f('0x1a')](_0x1890fc[_0x212f('0x30')][_0x212f('0x1a')]);_0x3f8db9[_0x212f('0x18')]=qs[_0x212f('0x18')](_0x1890fc[_0x212f('0x30')][_0x212f('0x18')]);}return _0x1b8fd6[_0x212f('0x45')](_0x3f8db9);}})['then'](function(_0x5c640a){if(_0x5c640a){return _0x5c640a?{'count':_0x24a735,'rows':_0x5c640a}:null;}})['then'](respondWithResult(_0x398321,null))[_0x212f('0x3e')](handleError(_0x398321,null));};exports[_0x212f('0x4b')]=function(_0x24b511,_0x4223d6,_0x1b8625){if(_0x24b511[_0x212f('0x43')]['id']){delete _0x24b511[_0x212f('0x43')]['id'];}return db['ServicenowAccount'][_0x212f('0x46')]({'where':{'id':_0x24b511[_0x212f('0x44')]['id']}})[_0x212f('0x21')](handleEntityNotFound(_0x4223d6,null))[_0x212f('0x21')](function(_0x4d6192){if(_0x4d6192){_0x24b511[_0x212f('0x43')][_0x212f('0x4c')]=_0x4d6192['id'];_0x24b511[_0x212f('0x43')][_0x212f('0x4d')]=integrations[_0x212f('0x4e')](_0x24b511[_0x212f('0x43')][_0x212f('0x4f')],_0x24b511[_0x212f('0x43')]['type']);_0x24b511[_0x212f('0x43')][_0x212f('0x50')]=integrations['getDescriptions'](_0x24b511[_0x212f('0x43')][_0x212f('0x4f')],_0x24b511[_0x212f('0x43')][_0x212f('0x2c')]);return db[_0x212f('0x47')][_0x212f('0x42')](_0x24b511[_0x212f('0x43')],{'include':[{'model':db[_0x212f('0x51')],'as':_0x212f('0x4d')},{'model':db[_0x212f('0x51')],'as':_0x212f('0x50')}]});}return null;})[_0x212f('0x21')](respondWithResult(_0x4223d6,null))[_0x212f('0x3e')](handleError(_0x4223d6,null));};exports[_0x212f('0x52')]=function(_0x57b53e,_0x1109e0,_0x4008a3){var _0x16cd25=[_0x212f('0x53'),_0x212f('0x54'),'knowledge','subcategory',_0x212f('0x55'),'notify',_0x212f('0x56'),'severity','category'];var _0x3066fa=[_0x212f('0x57'),'made_sla','caused_by',_0x212f('0x58'),'upon_reject','sys_updated_on',_0x212f('0x59'),_0x212f('0x54'),_0x212f('0x5a'),'number','resolved_by',_0x212f('0x5b'),_0x212f('0x5c'),_0x212f('0x5d'),_0x212f('0x5e'),'sys_domain',_0x212f('0x5f'),_0x212f('0x60'),_0x212f('0x61'),_0x212f('0x62'),'calendar_stc','closed_at',_0x212f('0x63'),_0x212f('0x64'),_0x212f('0x65'),_0x212f('0x66'),_0x212f('0x67'),_0x212f('0x68'),_0x212f('0x69'),_0x212f('0x6a'),_0x212f('0x6b'),_0x212f('0x6c'),_0x212f('0x6d'),_0x212f('0x6e'),'business_duration',_0x212f('0x6f'),_0x212f('0x70'),_0x212f('0x71'),_0x212f('0x72'),'caller_id','approval_set','subcategory',_0x212f('0x73'),_0x212f('0x74'),_0x212f('0x55'),_0x212f('0x75'),_0x212f('0x76'),_0x212f('0x77'),'assignment_group','business_stc',_0x212f('0x78'),_0x212f('0x79'),_0x212f('0x7a'),_0x212f('0x7b'),_0x212f('0x7c'),_0x212f('0x7d'),_0x212f('0x7e'),_0x212f('0x7f'),_0x212f('0x80'),_0x212f('0x81'),'contact_type','reopened_by',_0x212f('0x56'),_0x212f('0x82'),'problem_id',_0x212f('0x83'),'reassignment_count',_0x212f('0x84'),'assigned_to',_0x212f('0x85'),'comments','sla_due',_0x212f('0x86'),_0x212f('0x87'),_0x212f('0x88'),'sys_mod_count','reopen_count',_0x212f('0x89'),_0x212f('0x8a'),_0x212f('0x8b'),_0x212f('0x8c'),'location',_0x212f('0x8d')];var _0x38e23f='';var _0x14ccf5='';var _0x1d42fe=[];var _0x1ff485='';var _0x20f49d='';var _0x3fc8b9=[];var _0xfc6e86='';var _0x42f703='';var _0x15770e={};var _0x4c6613='';return db[_0x212f('0x2a')][_0x212f('0x46')]({'where':{'id':_0x57b53e[_0x212f('0x44')]['id']},'attributes':['id',_0x212f('0x8e'),_0x212f('0x8f'),_0x212f('0x90'),_0x212f('0x91'),_0x212f('0x92')]})[_0x212f('0x21')](handleEntityNotFound(_0x1109e0,null))['then'](function(_0x13faf4){if(_0x13faf4){_0x4c6613=_0x13faf4[_0x212f('0x91')];var _0x9a991b=_0x4c6613[_0x212f('0x93')](-0x1);if(_0x9a991b==='/'){_0x4c6613=_0x4c6613[_0x212f('0x94')](0x0,_0x4c6613['lastIndexOf'](_0x9a991b));}_0x42f703=util[_0x212f('0x95')](_0x212f('0x96'),_0x4c6613);_0xfc6e86=util['format']('%s/api/now/table/',_0x4c6613);_0x15770e={'user':_0x13faf4['username'],'pass':_0x13faf4['password']};var _0x3afada={'method':_0x212f('0x97'),'uri':_0x42f703+_0x212f('0x98'),'auth':_0x15770e,'json':!![]};return rp(_0x3afada);}})[_0x212f('0x21')](function(_0x4b6189){if(_0x4b6189[_0x212f('0x99')][_0x212f('0x34')]>0x0){_0x38e23f=_0x4b6189[_0x212f('0x99')];}console['log']('incident\x20table\x20objects',_0x38e23f);_0x3fc8b9=[];_0x14ccf5=Object[_0x212f('0x9a')]([],_0x38e23f);_['remove'](_0x14ccf5,function(_0xa60cd7){return!_0x16cd25[_0x212f('0x9b')](_0xa60cd7[_0x212f('0x26')]);});_0x14ccf5[_0x212f('0x9c')](function(_0x4a771d){var _0x4083eb=createFieldObject(_0xfc6e86,_0x15770e,_0x4a771d[_0x212f('0x9d')],_0x4a771d[_0x212f('0x26')],_0x4a771d['label'],![]);_0x3fc8b9[_0x212f('0x9e')](_0x4083eb);});return Promise['all'](_0x3fc8b9);})['then'](function(_0x10c520){_0x1d42fe=_0x10c520;_0x1ff485=Object[_0x212f('0x9a')]([],_0x38e23f);console[_0x212f('0x9f')](_0x212f('0xa0'),_0x38e23f);_[_0x212f('0xa1')](_0x1ff485,function(_0x489f1e){return _0x3066fa[_0x212f('0x9b')](_0x489f1e[_0x212f('0x26')]);});console['log'](_0x212f('0xa2'),_0x1ff485);_0x3fc8b9=[];_0x1ff485[_0x212f('0x9c')](function(_0x53e777){var _0x2a7bb5=createFieldObject(_0xfc6e86,_0x15770e,_0x53e777[_0x212f('0x9d')],_0x53e777[_0x212f('0x26')],_0x53e777[_0x212f('0xa3')],!![]);_0x3fc8b9['push'](_0x2a7bb5);});return Promise[_0x212f('0xa4')](_0x3fc8b9);})[_0x212f('0x21')](function(_0x57f199){_0x20f49d=_0x57f199;var _0x1ffcd5=_0x1d42fe['concat'](_0x20f49d);return{'count':_0x1ffcd5[_0x212f('0x34')],'rows':_0x1ffcd5};})['then'](respondWithResult(_0x1109e0,null))[_0x212f('0x3e')](function(_0x148939){console[_0x212f('0x9f')]('ServiceNow\x20error:\x20'+_0x148939);var _0x4e1dc4=_0x57b53e[_0x212f('0x30')][_0x212f('0xa5')]?0x1f4:_0x148939[_0x212f('0xa6')]||0x1f4;logger['error'](_0x148939['stack']);delete _0x148939[_0x212f('0x26')];if(_0x4e1dc4===0x191){_0x4e1dc4=0x190;}_0x1109e0['status'](_0x4e1dc4)[_0x212f('0x27')](_0x57b53e[_0x212f('0x30')][_0x212f('0xa5')]?{'message':_0x212f('0xa7'),'statusCode':_0x148939[_0x212f('0xa6')]}:_0x148939);});};function createFieldObject(_0x27de51,_0xebc3b0,_0x185f07,_0x4b6d87,_0x3fcb4d,_0x2c3491){return new Promise(function(_0x237710,_0x262c66){var _0x2441bf={'id':_0x4b6d87,'name':_0x3fcb4d,'custom':_0x2c3491};if(_0x185f07==='boolean'){_0x2441bf['options']=[{'name':_0x212f('0xa8'),'value':_0x212f('0xa9')},{'name':_0x212f('0xaa'),'value':_0x212f('0xab')}];_0x237710(_0x2441bf);}else{var _0x27879a={'method':_0x212f('0x97'),'uri':_0x27de51+_0x212f('0xac')+_0x4b6d87,'auth':_0xebc3b0,'json':!![]};return rp(_0x27879a)[_0x212f('0x21')](function(_0x459af6){var _0x474722=[];if(_0x459af6[_0x212f('0x99')]['length']>0x0){_0x459af6[_0x212f('0x99')][_0x212f('0x9c')](function(_0x296cca){if(_0x296cca[_0x212f('0xad')]===_0x212f('0xab')){var _0xea1fc9={'name':_0x296cca[_0x212f('0xa3')],'value':_0x296cca['value']};_0x474722[_0x212f('0x9e')](_0xea1fc9);}});}_0x2441bf[_0x212f('0x48')]=_0x474722;if(_0x2441bf[_0x212f('0x48')]['length']>0x0){_0x237710(_0x2441bf);}else{if(_0x2c3491==![]){_0x237710();}else{_0x237710(_0x2441bf);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index a86f12e..53d6f56 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 _0x5d17=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts'];(function(_0x533aa4,_0x2ee804){var _0x1d7868=function(_0x511e42){while(--_0x511e42){_0x533aa4['push'](_0x533aa4['shift']());}};_0x1d7868(++_0x2ee804);}(_0x5d17,0x114));var _0x75d1=function(_0x4d69d1,_0x211712){_0x4d69d1=_0x4d69d1-0x0;var _0x4950ad=_0x5d17[_0x4d69d1];return _0x4950ad;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));var integrations=require(_0x75d1('0x8'));module['exports']=function(_0x458681,_0x116a51){return _0x458681[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba34=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0xb1ff7c,_0xed49e2){var _0x380c16=function(_0x15a842){while(--_0x15a842){_0xb1ff7c['push'](_0xb1ff7c['shift']());}};_0x380c16(++_0xed49e2);}(_0xba34,0x119));var _0x4ba3=function(_0x54595e,_0x3f9b46){_0x54595e=_0x54595e-0x0;var _0x4d36f8=_0xba34[_0x54595e];return _0x4d36f8;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 3d5f1c9..c8f99fc 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 _0x4677=['include','model','attributes','map','ShowServicenowAccount','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','limit'];(function(_0x2df1f2,_0x58d388){var _0x38652b=function(_0x18e322){while(--_0x18e322){_0x2df1f2['push'](_0x2df1f2['shift']());}};_0x38652b(++_0x58d388);}(_0x4677,0x159));var _0x7467=function(_0x36cb42,_0x3fc905){_0x36cb42=_0x36cb42-0x0;var _0x2800d6=_0x4677[_0x36cb42];return _0x2800d6;};'use strict';var _=require('lodash');var util=require(_0x7467('0x0'));var moment=require('moment');var BPromise=require(_0x7467('0x1'));var rs=require(_0x7467('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7467('0x3'))['db'];var utils=require(_0x7467('0x4'));var logger=require(_0x7467('0x5'))(_0x7467('0x6'));var config=require(_0x7467('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7467('0x8')][_0x7467('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x295ad6,_0x55e89f,_0x4fc64){return new BPromise(function(_0x1ed49f,_0x39c06f){return client['request'](_0x295ad6,_0x4fc64)[_0x7467('0xa')](function(_0x7555eb){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x55e89f,_0x7467('0xb'));logger[_0x7467('0xc')](_0x7467('0xd'),_0x55e89f,_0x7467('0xb'),JSON[_0x7467('0xe')](_0x7555eb));if(_0x7555eb['error']){if(_0x7555eb[_0x7467('0xf')][_0x7467('0x10')]===0x1f4){logger[_0x7467('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x55e89f,_0x7555eb[_0x7467('0xf')][_0x7467('0x11')]);return _0x39c06f(_0x7555eb[_0x7467('0xf')][_0x7467('0x11')]);}logger[_0x7467('0xf')](_0x7467('0x12'),_0x55e89f,_0x7555eb[_0x7467('0xf')]['message']);return _0x1ed49f(_0x7555eb[_0x7467('0xf')][_0x7467('0x11')]);}else{logger[_0x7467('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x55e89f,'request\x20sent');_0x1ed49f(_0x7555eb[_0x7467('0x14')][_0x7467('0x11')]);}})[_0x7467('0x15')](function(_0x5628ee){logger[_0x7467('0xf')](_0x7467('0x12'),_0x55e89f,_0x5628ee);_0x39c06f(_0x5628ee);});});}exports[_0x7467('0x16')]=function(_0xac6d6f){var _0x311908=this;return new Promise(function(_0x2a82ed,_0x1e1450){return db[_0x7467('0x17')][_0x7467('0x18')]({'raw':_0xac6d6f[_0x7467('0x19')]?_0xac6d6f[_0x7467('0x19')][_0x7467('0x1a')]===undefined?!![]:![]:!![],'where':_0xac6d6f[_0x7467('0x19')]?_0xac6d6f[_0x7467('0x19')][_0x7467('0x1b')]||null:null,'attributes':_0xac6d6f[_0x7467('0x19')]?_0xac6d6f[_0x7467('0x19')]['attributes']||null:null,'limit':_0xac6d6f[_0x7467('0x19')]?_0xac6d6f['options'][_0x7467('0x1c')]||null:null,'include':_0xac6d6f['options']?_0xac6d6f[_0x7467('0x19')][_0x7467('0x1d')]?_['map'](_0xac6d6f[_0x7467('0x19')][_0x7467('0x1d')],function(_0x3b2eec){return{'model':db[_0x3b2eec[_0x7467('0x1e')]],'as':_0x3b2eec['as'],'attributes':_0x3b2eec[_0x7467('0x1f')],'include':_0x3b2eec[_0x7467('0x1d')]?_[_0x7467('0x20')](_0x3b2eec[_0x7467('0x1d')],function(_0x3e9df2){return{'model':db[_0x3e9df2[_0x7467('0x1e')]],'as':_0x3e9df2['as'],'attributes':_0x3e9df2[_0x7467('0x1f')],'include':_0x3e9df2[_0x7467('0x1d')]?_[_0x7467('0x20')](_0x3e9df2[_0x7467('0x1d')],function(_0x7415b4){return{'model':db[_0x7415b4[_0x7467('0x1e')]],'as':_0x7415b4['as'],'attributes':_0x7415b4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ce8ed){logger[_0x7467('0x13')](_0x7467('0x16'),_0xac6d6f);logger[_0x7467('0xc')](_0x7467('0x16'),_0xac6d6f,JSON['stringify'](_0x5ce8ed));_0x2a82ed(_0x5ce8ed);})[_0x7467('0x15')](function(_0x5109a7){logger['error']('GetServicenowAccount',_0x5109a7[_0x7467('0x11')],_0xac6d6f);_0x1e1450(_0x311908['error'](0x1f4,_0x5109a7[_0x7467('0x11')]));});});};exports[_0x7467('0x21')]=function(_0x1c0670){var _0x1df53d=this;return new Promise(function(_0xf242b4,_0x3640a6){return db[_0x7467('0x17')]['find']({'raw':_0x1c0670['options']?_0x1c0670[_0x7467('0x19')][_0x7467('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c0670['options']?_0x1c0670[_0x7467('0x19')][_0x7467('0x1b')]||null:null,'attributes':_0x1c0670[_0x7467('0x19')]?_0x1c0670[_0x7467('0x19')][_0x7467('0x1f')]||null:null,'include':_0x1c0670['options']?_0x1c0670[_0x7467('0x19')]['include']?_[_0x7467('0x20')](_0x1c0670[_0x7467('0x19')]['include'],function(_0x351170){return{'model':db[_0x351170[_0x7467('0x1e')]],'as':_0x351170['as'],'attributes':_0x351170[_0x7467('0x1f')],'include':_0x351170[_0x7467('0x1d')]?_[_0x7467('0x20')](_0x351170[_0x7467('0x1d')],function(_0x1b4939){return{'model':db[_0x1b4939['model']],'as':_0x1b4939['as'],'attributes':_0x1b4939[_0x7467('0x1f')],'include':_0x1b4939[_0x7467('0x1d')]?_['map'](_0x1b4939[_0x7467('0x1d')],function(_0x576053){return{'model':db[_0x576053[_0x7467('0x1e')]],'as':_0x576053['as'],'attributes':_0x576053['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x348c34){logger[_0x7467('0x13')](_0x7467('0x21'),_0x1c0670);logger['debug'](_0x7467('0x21'),_0x1c0670,JSON['stringify'](_0x348c34));_0xf242b4(_0x348c34);})['catch'](function(_0xda1fb4){logger[_0x7467('0xf')](_0x7467('0x21'),_0xda1fb4[_0x7467('0x11')],_0x1c0670);_0x3640a6(_0x1df53d['error'](0x1f4,_0xda1fb4[_0x7467('0x11')]));});});}; \ No newline at end of file +var _0x59ec=['error','code','message','catch','GetServicenowAccount','options','where','limit','include','map','model','attributes','debug','ShowServicenowAccount','ServicenowAccount','find','raw','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xfc9016,_0x296998){var _0x2190a9=function(_0x497c8f){while(--_0x497c8f){_0xfc9016['push'](_0xfc9016['shift']());}};_0x2190a9(++_0x296998);}(_0x59ec,0x77));var _0xc59e=function(_0x33529b,_0x2e40e5){_0x33529b=_0x33529b-0x0;var _0x3f8e12=_0x59ec[_0x33529b];return _0x3f8e12;};'use strict';var _=require(_0xc59e('0x0'));var util=require('util');var moment=require(_0xc59e('0x1'));var BPromise=require(_0xc59e('0x2'));var rs=require(_0xc59e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc59e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc59e('0x5'));var config=require(_0xc59e('0x6'));var jayson=require(_0xc59e('0x7'));var client=jayson[_0xc59e('0x8')][_0xc59e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa2ec23,_0x1b1ca6,_0x5da18c){return new BPromise(function(_0x10d257,_0xb41b64){return client[_0xc59e('0xa')](_0xa2ec23,_0x5da18c)[_0xc59e('0xb')](function(_0x3a37bf){logger[_0xc59e('0xc')](_0xc59e('0xd'),_0x1b1ca6,_0xc59e('0xe'));logger['debug'](_0xc59e('0xf'),_0x1b1ca6,'request\x20sent',JSON[_0xc59e('0x10')](_0x3a37bf));if(_0x3a37bf[_0xc59e('0x11')]){if(_0x3a37bf[_0xc59e('0x11')][_0xc59e('0x12')]===0x1f4){logger[_0xc59e('0x11')](_0xc59e('0xd'),_0x1b1ca6,_0x3a37bf[_0xc59e('0x11')][_0xc59e('0x13')]);return _0xb41b64(_0x3a37bf['error']['message']);}logger[_0xc59e('0x11')](_0xc59e('0xd'),_0x1b1ca6,_0x3a37bf[_0xc59e('0x11')][_0xc59e('0x13')]);return _0x10d257(_0x3a37bf[_0xc59e('0x11')][_0xc59e('0x13')]);}else{logger[_0xc59e('0xc')](_0xc59e('0xd'),_0x1b1ca6,_0xc59e('0xe'));_0x10d257(_0x3a37bf['result']['message']);}})[_0xc59e('0x14')](function(_0x114bde){logger[_0xc59e('0x11')](_0xc59e('0xd'),_0x1b1ca6,_0x114bde);_0xb41b64(_0x114bde);});});}exports[_0xc59e('0x15')]=function(_0x24de85){var _0x5596f4=this;return new Promise(function(_0x3b4ff9,_0x1c5af3){return db['ServicenowAccount']['findAll']({'raw':_0x24de85['options']?_0x24de85[_0xc59e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x24de85[_0xc59e('0x16')]?_0x24de85[_0xc59e('0x16')][_0xc59e('0x17')]||null:null,'attributes':_0x24de85[_0xc59e('0x16')]?_0x24de85[_0xc59e('0x16')]['attributes']||null:null,'limit':_0x24de85[_0xc59e('0x16')]?_0x24de85[_0xc59e('0x16')][_0xc59e('0x18')]||null:null,'include':_0x24de85['options']?_0x24de85[_0xc59e('0x16')][_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x24de85[_0xc59e('0x16')][_0xc59e('0x19')],function(_0x117bac){return{'model':db[_0x117bac[_0xc59e('0x1b')]],'as':_0x117bac['as'],'attributes':_0x117bac[_0xc59e('0x1c')],'include':_0x117bac[_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x117bac['include'],function(_0x5027ae){return{'model':db[_0x5027ae['model']],'as':_0x5027ae['as'],'attributes':_0x5027ae[_0xc59e('0x1c')],'include':_0x5027ae[_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x5027ae[_0xc59e('0x19')],function(_0x4e33da){return{'model':db[_0x4e33da[_0xc59e('0x1b')]],'as':_0x4e33da['as'],'attributes':_0x4e33da[_0xc59e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ae50d){logger[_0xc59e('0xc')](_0xc59e('0x15'),_0x24de85);logger[_0xc59e('0x1d')](_0xc59e('0x15'),_0x24de85,JSON[_0xc59e('0x10')](_0x4ae50d));_0x3b4ff9(_0x4ae50d);})[_0xc59e('0x14')](function(_0x3ef007){logger[_0xc59e('0x11')](_0xc59e('0x15'),_0x3ef007[_0xc59e('0x13')],_0x24de85);_0x1c5af3(_0x5596f4[_0xc59e('0x11')](0x1f4,_0x3ef007[_0xc59e('0x13')]));});});};exports[_0xc59e('0x1e')]=function(_0x2b823f){var _0x1f8658=this;return new Promise(function(_0x317130,_0x192eba){return db[_0xc59e('0x1f')][_0xc59e('0x20')]({'raw':_0x2b823f[_0xc59e('0x16')]?_0x2b823f[_0xc59e('0x16')][_0xc59e('0x21')]===undefined?!![]:![]:!![],'where':_0x2b823f[_0xc59e('0x16')]?_0x2b823f[_0xc59e('0x16')][_0xc59e('0x17')]||null:null,'attributes':_0x2b823f['options']?_0x2b823f[_0xc59e('0x16')]['attributes']||null:null,'include':_0x2b823f[_0xc59e('0x16')]?_0x2b823f[_0xc59e('0x16')][_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x2b823f['options']['include'],function(_0x591114){return{'model':db[_0x591114[_0xc59e('0x1b')]],'as':_0x591114['as'],'attributes':_0x591114[_0xc59e('0x1c')],'include':_0x591114[_0xc59e('0x19')]?_['map'](_0x591114[_0xc59e('0x19')],function(_0x21cd98){return{'model':db[_0x21cd98[_0xc59e('0x1b')]],'as':_0x21cd98['as'],'attributes':_0x21cd98['attributes'],'include':_0x21cd98[_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x21cd98[_0xc59e('0x19')],function(_0x231f2){return{'model':db[_0x231f2['model']],'as':_0x231f2['as'],'attributes':_0x231f2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x136fc5){logger[_0xc59e('0xc')](_0xc59e('0x1e'),_0x2b823f);logger[_0xc59e('0x1d')]('ShowServicenowAccount',_0x2b823f,JSON[_0xc59e('0x10')](_0x136fc5));_0x317130(_0x136fc5);})[_0xc59e('0x14')](function(_0x1f445e){logger[_0xc59e('0x11')](_0xc59e('0x1e'),_0x1f445e[_0xc59e('0x13')],_0x2b823f);_0x192eba(_0x1f8658[_0xc59e('0x11')](0x1f4,_0x1f445e[_0xc59e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 9879ad1..2a40d54 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 _0xcacf=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','put','update','destroy'];(function(_0x280fdd,_0x258d03){var _0x1af49a=function(_0x35617e){while(--_0x35617e){_0x280fdd['push'](_0x280fdd['shift']());}};_0x1af49a(++_0x258d03);}(_0xcacf,0x13c));var _0xfcac=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xcacf[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require('multer');var util=require(_0xfcac('0x0'));var path=require(_0xfcac('0x1'));var timeout=require(_0xfcac('0x2'));var express=require('express');var router=express[_0xfcac('0x3')]();var fs_extra=require(_0xfcac('0x4'));var auth=require(_0xfcac('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfcac('0x6'));var controller=require(_0xfcac('0x7'));router[_0xfcac('0x8')]('/',auth[_0xfcac('0x9')](),controller[_0xfcac('0xa')]);router[_0xfcac('0x8')](_0xfcac('0xb'),auth[_0xfcac('0x9')](),controller[_0xfcac('0xc')]);router['get'](_0xfcac('0xd'),auth[_0xfcac('0x9')](),controller[_0xfcac('0xe')]);router[_0xfcac('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xfcac('0xf')]);router['get'](_0xfcac('0x10'),auth[_0xfcac('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0xfcac('0x9')](),controller['create']);router[_0xfcac('0x11')](_0xfcac('0xb'),auth['isAuthenticated'](),controller[_0xfcac('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfcac('0x13')]);module[_0xfcac('0x14')]=router; \ No newline at end of file +var _0xd6bc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','/:id/descriptions','getDescriptions','post','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xd6bc,0x88));var _0xcd6b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd6bc[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xcd6b('0x0'));var util=require(_0xcd6b('0x1'));var path=require(_0xcd6b('0x2'));var timeout=require(_0xcd6b('0x3'));var express=require('express');var router=express[_0xcd6b('0x4')]();var fs_extra=require(_0xcd6b('0x5'));var auth=require(_0xcd6b('0x6'));var interaction=require(_0xcd6b('0x7'));var config=require('../../config/environment');var controller=require(_0xcd6b('0x8'));router[_0xcd6b('0x9')]('/',auth[_0xcd6b('0xa')](),controller[_0xcd6b('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcd6b('0xc')]);router[_0xcd6b('0x9')]('/:id/fields',auth[_0xcd6b('0xa')](),controller['getFields']);router[_0xcd6b('0x9')](_0xcd6b('0xd'),auth[_0xcd6b('0xa')](),controller['getSubjects']);router[_0xcd6b('0x9')](_0xcd6b('0xe'),auth[_0xcd6b('0xa')](),controller[_0xcd6b('0xf')]);router[_0xcd6b('0x10')]('/',auth[_0xcd6b('0xa')](),controller['create']);router['put'](_0xcd6b('0x11'),auth[_0xcd6b('0xa')](),controller['update']);router['delete'](_0xcd6b('0x11'),auth['isAuthenticated'](),controller[_0xcd6b('0x12')]);module[_0xcd6b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 589d1d0..b44152d 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 _0x53eb=['STRING','sequelize'];(function(_0x12b167,_0x4a69a0){var _0x22754a=function(_0x3a00eb){while(--_0x3a00eb){_0x12b167['push'](_0x12b167['shift']());}};_0x22754a(++_0x4a69a0);}(_0x53eb,0xcd));var _0xb53e=function(_0x1cb3d0,_0x46d59f){_0x1cb3d0=_0x1cb3d0-0x0;var _0x1f419a=_0x53eb[_0x1cb3d0];return _0x1f419a;};'use strict';var Sequelize=require(_0xb53e('0x0'));module['exports']={'name':{'type':Sequelize[_0xb53e('0x1')]},'description':{'type':Sequelize[_0xb53e('0x1')]}}; \ No newline at end of file +var _0xfa9e=['sequelize','exports','STRING'];(function(_0x7ea55a,_0x408ebd){var _0x1c75e0=function(_0x17f29f){while(--_0x17f29f){_0x7ea55a['push'](_0x7ea55a['shift']());}};_0x1c75e0(++_0x408ebd);}(_0xfa9e,0x1cb));var _0xefa9=function(_0x5d1624,_0x3e848a){_0x5d1624=_0x5d1624-0x0;var _0x32ca97=_0xfa9e[_0x5d1624];return _0x32ca97;};'use strict';var Sequelize=require(_0xefa9('0x0'));module[_0xefa9('0x1')]={'name':{'type':Sequelize[_0xefa9('0x2')]},'description':{'type':Sequelize[_0xefa9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index a8d4a21..d73acd0 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 _0x6a9b=['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','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','ServicenowConfiguration','findAll','rows','params','find','catch','create','body','getFields','ServicenowField','pick','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6a9b,0x1e9));var _0xb6a9=function(_0x3a13d6,_0x27c152){_0x3a13d6=_0x3a13d6-0x0;var _0x3f99a9=_0x6a9b[_0x3a13d6];return _0x3f99a9;};'use strict';var emlformat=require(_0xb6a9('0x0'));var rimraf=require(_0xb6a9('0x1'));var zipdir=require(_0xb6a9('0x2'));var jsonpatch=require(_0xb6a9('0x3'));var rp=require(_0xb6a9('0x4'));var moment=require(_0xb6a9('0x5'));var BPromise=require(_0xb6a9('0x6'));var Mustache=require(_0xb6a9('0x7'));var util=require('util');var path=require('path');var sox=require(_0xb6a9('0x8'));var csv=require(_0xb6a9('0x9'));var ejs=require(_0xb6a9('0xa'));var fs=require('fs');var fs_extra=require(_0xb6a9('0xb'));var _=require(_0xb6a9('0xc'));var squel=require(_0xb6a9('0xd'));var crypto=require(_0xb6a9('0xe'));var jsforce=require(_0xb6a9('0xf'));var deskjs=require(_0xb6a9('0x10'));var toCsv=require(_0xb6a9('0x9'));var querystring=require(_0xb6a9('0x11'));var Papa=require(_0xb6a9('0x12'));var Redis=require('ioredis');var authService=require(_0xb6a9('0x13'));var qs=require(_0xb6a9('0x14'));var as=require(_0xb6a9('0x15'));var hardwareService=require(_0xb6a9('0x16'));var logger=require(_0xb6a9('0x17'))('api');var utils=require(_0xb6a9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb6a9('0x19'));var db=require(_0xb6a9('0x1a'))['db'];function respondWithStatusCode(_0x34b045,_0xad653c){_0xad653c=_0xad653c||0xcc;return function(_0x16fee1){if(_0x16fee1){return _0x34b045[_0xb6a9('0x1b')](_0xad653c);}return _0x34b045[_0xb6a9('0x1c')](_0xad653c)[_0xb6a9('0x1d')]();};}function respondWithResult(_0xd92d04,_0x345763){_0x345763=_0x345763||0xc8;return function(_0x48404e){if(_0x48404e){return _0xd92d04[_0xb6a9('0x1c')](_0x345763)[_0xb6a9('0x1e')](_0x48404e);}};}function respondWithFilteredResult(_0x5baf24,_0xe42020){return function(_0x624c3b){if(_0x624c3b){var _0x3eb26e=typeof _0xe42020[_0xb6a9('0x1f')]===_0xb6a9('0x20')&&typeof _0xe42020['limit']===_0xb6a9('0x20');var _0x150c84=_0x624c3b[_0xb6a9('0x21')];var _0x3647b9=_0x3eb26e?0x0:_0xe42020[_0xb6a9('0x1f')];var _0x1f001a=_0x3eb26e?_0x624c3b[_0xb6a9('0x21')]:_0xe42020[_0xb6a9('0x1f')]+_0xe42020['limit'];var _0x25e0bb;if(_0x1f001a>=_0x150c84){_0x1f001a=_0x150c84;_0x25e0bb=0xc8;}else{_0x25e0bb=0xce;}_0x5baf24[_0xb6a9('0x1c')](_0x25e0bb);return _0x5baf24[_0xb6a9('0x22')]('Content-Range',_0x3647b9+'-'+_0x1f001a+'/'+_0x150c84)[_0xb6a9('0x1e')](_0x624c3b);}return null;};}function patchUpdates(_0x23960d){return function(_0x5e8e94){try{jsonpatch[_0xb6a9('0x23')](_0x5e8e94,_0x23960d,!![]);}catch(_0x3e04ca){return BPromise[_0xb6a9('0x24')](_0x3e04ca);}return _0x5e8e94[_0xb6a9('0x25')]();};}function saveUpdates(_0x4c060d,_0x191df2){return function(_0x3948be){if(_0x3948be){return _0x3948be[_0xb6a9('0x26')](_0x4c060d)[_0xb6a9('0x27')](function(_0x1e1fa0){return _0x1e1fa0;});}return null;};}function removeEntity(_0x321bd9,_0x3e748e){return function(_0x5b2504){if(_0x5b2504){return _0x5b2504[_0xb6a9('0x28')]()['then'](function(){_0x321bd9['status'](0xcc)[_0xb6a9('0x1d')]();});}};}function handleEntityNotFound(_0x34ce8d,_0x48cacb){return function(_0x512320){if(!_0x512320){_0x34ce8d['sendStatus'](0x194);}return _0x512320;};}function handleError(_0x58ad82,_0x393082){_0x393082=_0x393082||0x1f4;return function(_0x254d78){logger['error'](_0x254d78[_0xb6a9('0x29')]);if(_0x254d78[_0xb6a9('0x2a')]){delete _0x254d78[_0xb6a9('0x2a')];}_0x58ad82[_0xb6a9('0x1c')](_0x393082)[_0xb6a9('0x2b')](_0x254d78);};}exports['index']=function(_0x33a370,_0x4d9194){var _0x1c53f8={},_0x3dc138={},_0x3748ac={'count':0x0,'rows':[]};var _0x40d78e=_[_0xb6a9('0x2c')](db['ServicenowConfiguration'][_0xb6a9('0x2d')],function(_0x554b3d){return{'name':_0x554b3d[_0xb6a9('0x2e')],'type':_0x554b3d['type'][_0xb6a9('0x2f')]};});_0x3dc138[_0xb6a9('0x30')]=_['map'](_0x40d78e,_0xb6a9('0x2a'));_0x3dc138[_0xb6a9('0x31')]=_[_0xb6a9('0x32')](_0x33a370['query']);_0x3dc138['filters']=_[_0xb6a9('0x33')](_0x3dc138['model'],_0x3dc138[_0xb6a9('0x31')]);_0x1c53f8[_0xb6a9('0x34')]=_[_0xb6a9('0x33')](_0x3dc138[_0xb6a9('0x30')],qs[_0xb6a9('0x35')](_0x33a370[_0xb6a9('0x31')][_0xb6a9('0x35')]));_0x1c53f8['attributes']=_0x1c53f8[_0xb6a9('0x34')][_0xb6a9('0x36')]?_0x1c53f8[_0xb6a9('0x34')]:_0x3dc138['model'];if(!_0x33a370['query'][_0xb6a9('0x37')]('nolimit')){_0x1c53f8[_0xb6a9('0x38')]=qs[_0xb6a9('0x38')](_0x33a370[_0xb6a9('0x31')][_0xb6a9('0x38')]);_0x1c53f8[_0xb6a9('0x1f')]=qs['offset'](_0x33a370[_0xb6a9('0x31')][_0xb6a9('0x1f')]);}_0x1c53f8[_0xb6a9('0x39')]=qs[_0xb6a9('0x3a')](_0x33a370[_0xb6a9('0x31')]['sort']);_0x1c53f8[_0xb6a9('0x3b')]=qs[_0xb6a9('0x3c')](_['pick'](_0x33a370[_0xb6a9('0x31')],_0x3dc138[_0xb6a9('0x3c')]),_0x40d78e);if(_0x33a370[_0xb6a9('0x31')][_0xb6a9('0x3d')]){_0x1c53f8[_0xb6a9('0x3b')]=_[_0xb6a9('0x3e')](_0x1c53f8[_0xb6a9('0x3b')],{'$or':_[_0xb6a9('0x2c')](_0x40d78e,function(_0x533408){if(_0x533408[_0xb6a9('0x3f')]!==_0xb6a9('0x40')){var _0x3ca9d8={};_0x3ca9d8[_0x533408['name']]={'$like':'%'+_0x33a370['query'][_0xb6a9('0x3d')]+'%'};return _0x3ca9d8;}})});}_0x1c53f8=_['merge']({},_0x1c53f8,_0x33a370[_0xb6a9('0x41')]);var _0x4fbd18={'where':_0x1c53f8[_0xb6a9('0x3b')]};return db['ServicenowConfiguration'][_0xb6a9('0x21')](_0x4fbd18)[_0xb6a9('0x27')](function(_0x4bc99e){_0x3748ac[_0xb6a9('0x21')]=_0x4bc99e;if(_0x33a370['query'][_0xb6a9('0x42')]){_0x1c53f8[_0xb6a9('0x43')]=[{'all':!![]}];}return db[_0xb6a9('0x44')][_0xb6a9('0x45')](_0x1c53f8);})['then'](function(_0x14fce1){_0x3748ac[_0xb6a9('0x46')]=_0x14fce1;return _0x3748ac;})[_0xb6a9('0x27')](respondWithFilteredResult(_0x4d9194,_0x1c53f8))['catch'](handleError(_0x4d9194,null));};exports['show']=function(_0x480c46,_0x12a495){var _0x448b4e={'raw':![],'where':{'id':_0x480c46[_0xb6a9('0x47')]['id']}},_0x139f8b={};_0x139f8b[_0xb6a9('0x30')]=_[_0xb6a9('0x32')](db[_0xb6a9('0x44')][_0xb6a9('0x2d')]);_0x139f8b['query']=_['keys'](_0x480c46[_0xb6a9('0x31')]);_0x139f8b[_0xb6a9('0x3c')]=_[_0xb6a9('0x33')](_0x139f8b[_0xb6a9('0x30')],_0x139f8b['query']);_0x448b4e[_0xb6a9('0x34')]=_[_0xb6a9('0x33')](_0x139f8b[_0xb6a9('0x30')],qs[_0xb6a9('0x35')](_0x480c46[_0xb6a9('0x31')][_0xb6a9('0x35')]));_0x448b4e[_0xb6a9('0x34')]=_0x448b4e['attributes'][_0xb6a9('0x36')]?_0x448b4e[_0xb6a9('0x34')]:_0x139f8b[_0xb6a9('0x30')];if(_0x480c46[_0xb6a9('0x31')][_0xb6a9('0x42')]){_0x448b4e[_0xb6a9('0x43')]=[{'all':!![]}];}_0x448b4e=_[_0xb6a9('0x3e')]({},_0x448b4e,_0x480c46['options']);return db[_0xb6a9('0x44')][_0xb6a9('0x48')](_0x448b4e)['then'](handleEntityNotFound(_0x12a495,null))[_0xb6a9('0x27')](respondWithResult(_0x12a495,null))[_0xb6a9('0x49')](handleError(_0x12a495,null));};exports[_0xb6a9('0x4a')]=function(_0x281266,_0x1c584f){return db['ServicenowConfiguration'][_0xb6a9('0x4a')](_0x281266[_0xb6a9('0x4b')],{})['then'](respondWithResult(_0x1c584f,0xc9))['catch'](handleError(_0x1c584f,null));};exports[_0xb6a9('0x26')]=function(_0x2789e6,_0x5993b5){if(_0x2789e6[_0xb6a9('0x4b')]['id']){delete _0x2789e6[_0xb6a9('0x4b')]['id'];}return db[_0xb6a9('0x44')][_0xb6a9('0x48')]({'where':{'id':_0x2789e6['params']['id']}})[_0xb6a9('0x27')](handleEntityNotFound(_0x5993b5,null))[_0xb6a9('0x27')](saveUpdates(_0x2789e6['body'],null))[_0xb6a9('0x27')](respondWithResult(_0x5993b5,null))['catch'](handleError(_0x5993b5,null));};exports[_0xb6a9('0x28')]=function(_0xad0b31,_0x35b3c1){return db[_0xb6a9('0x44')]['find']({'where':{'id':_0xad0b31['params']['id']}})[_0xb6a9('0x27')](handleEntityNotFound(_0x35b3c1,null))[_0xb6a9('0x27')](removeEntity(_0x35b3c1,null))[_0xb6a9('0x49')](handleError(_0x35b3c1,null));};exports[_0xb6a9('0x4c')]=function(_0x3016d8,_0x1195d1,_0x4c1e13){var _0x110d95={};var _0x816945={};var _0x1b0e65;var _0x4bb48c;return db[_0xb6a9('0x44')]['findOne']({'where':{'id':_0x3016d8['params']['id']}})[_0xb6a9('0x27')](handleEntityNotFound(_0x1195d1,null))[_0xb6a9('0x27')](function(_0x39e967){if(_0x39e967){_0x1b0e65=_0x39e967;_0x816945[_0xb6a9('0x30')]=_['keys'](db[_0xb6a9('0x4d')][_0xb6a9('0x2d')]);_0x816945[_0xb6a9('0x31')]=_[_0xb6a9('0x32')](_0x3016d8['query']);_0x816945['filters']=_['intersection'](_0x816945[_0xb6a9('0x30')],_0x816945[_0xb6a9('0x31')]);_0x110d95['attributes']=_[_0xb6a9('0x33')](_0x816945[_0xb6a9('0x30')],qs[_0xb6a9('0x35')](_0x3016d8[_0xb6a9('0x31')][_0xb6a9('0x35')]));_0x110d95[_0xb6a9('0x34')]=_0x110d95[_0xb6a9('0x34')][_0xb6a9('0x36')]?_0x110d95[_0xb6a9('0x34')]:_0x816945['model'];_0x110d95[_0xb6a9('0x39')]=qs[_0xb6a9('0x3a')](_0x3016d8[_0xb6a9('0x31')]['sort']);_0x110d95['where']=qs['filters'](_[_0xb6a9('0x4e')](_0x3016d8[_0xb6a9('0x31')],_0x816945[_0xb6a9('0x3c')]));if(_0x3016d8[_0xb6a9('0x31')][_0xb6a9('0x3d')]){_0x110d95[_0xb6a9('0x3b')]=_[_0xb6a9('0x3e')](_0x110d95['where'],{'$or':_['map'](_0x110d95[_0xb6a9('0x34')],function(_0x493a9a){var _0x3e66d1={};_0x3e66d1[_0x493a9a]={'$like':'%'+_0x3016d8[_0xb6a9('0x31')][_0xb6a9('0x3d')]+'%'};return _0x3e66d1;})});}_0x110d95=_[_0xb6a9('0x3e')]({},_0x110d95,_0x3016d8[_0xb6a9('0x41')]);return _0x1b0e65[_0xb6a9('0x4c')](_0x110d95);}})[_0xb6a9('0x27')](function(_0x2a19c5){if(_0x2a19c5){_0x4bb48c=_0x2a19c5[_0xb6a9('0x36')];if(!_0x3016d8[_0xb6a9('0x31')][_0xb6a9('0x37')](_0xb6a9('0x4f'))){_0x110d95['limit']=qs['limit'](_0x3016d8['query'][_0xb6a9('0x38')]);_0x110d95[_0xb6a9('0x1f')]=qs[_0xb6a9('0x1f')](_0x3016d8['query'][_0xb6a9('0x1f')]);}return _0x1b0e65['getFields'](_0x110d95);}})[_0xb6a9('0x27')](function(_0x34b90b){if(_0x34b90b){return _0x34b90b?{'count':_0x4bb48c,'rows':_0x34b90b}:null;}})[_0xb6a9('0x27')](respondWithResult(_0x1195d1,null))[_0xb6a9('0x49')](handleError(_0x1195d1,null));};exports[_0xb6a9('0x50')]=function(_0x41cfbc,_0x4cd069,_0x471539){var _0x5daa9c={};var _0x5e192f={};var _0x49ba07;var _0x25861b;return db[_0xb6a9('0x44')][_0xb6a9('0x51')]({'where':{'id':_0x41cfbc[_0xb6a9('0x47')]['id']}})[_0xb6a9('0x27')](handleEntityNotFound(_0x4cd069,null))[_0xb6a9('0x27')](function(_0x3a0fdf){if(_0x3a0fdf){_0x49ba07=_0x3a0fdf;_0x5e192f[_0xb6a9('0x30')]=_['keys'](db[_0xb6a9('0x4d')][_0xb6a9('0x2d')]);_0x5e192f['query']=_['keys'](_0x41cfbc[_0xb6a9('0x31')]);_0x5e192f['filters']=_['intersection'](_0x5e192f[_0xb6a9('0x30')],_0x5e192f[_0xb6a9('0x31')]);_0x5daa9c[_0xb6a9('0x34')]=_[_0xb6a9('0x33')](_0x5e192f[_0xb6a9('0x30')],qs['fields'](_0x41cfbc[_0xb6a9('0x31')][_0xb6a9('0x35')]));_0x5daa9c[_0xb6a9('0x34')]=_0x5daa9c['attributes'][_0xb6a9('0x36')]?_0x5daa9c['attributes']:_0x5e192f[_0xb6a9('0x30')];_0x5daa9c['order']=qs[_0xb6a9('0x3a')](_0x41cfbc[_0xb6a9('0x31')][_0xb6a9('0x3a')]);_0x5daa9c['where']=qs['filters'](_[_0xb6a9('0x4e')](_0x41cfbc['query'],_0x5e192f[_0xb6a9('0x3c')]));if(_0x41cfbc[_0xb6a9('0x31')]['filter']){_0x5daa9c[_0xb6a9('0x3b')]=_[_0xb6a9('0x3e')](_0x5daa9c['where'],{'$or':_[_0xb6a9('0x2c')](_0x5daa9c[_0xb6a9('0x34')],function(_0x119922){var _0x1dc791={};_0x1dc791[_0x119922]={'$like':'%'+_0x41cfbc[_0xb6a9('0x31')][_0xb6a9('0x3d')]+'%'};return _0x1dc791;})});}_0x5daa9c=_[_0xb6a9('0x3e')]({},_0x5daa9c,_0x41cfbc[_0xb6a9('0x41')]);return _0x49ba07[_0xb6a9('0x50')](_0x5daa9c);}})[_0xb6a9('0x27')](function(_0x3007aa){if(_0x3007aa){_0x25861b=_0x3007aa['length'];if(!_0x41cfbc[_0xb6a9('0x31')][_0xb6a9('0x37')](_0xb6a9('0x4f'))){_0x5daa9c[_0xb6a9('0x38')]=qs[_0xb6a9('0x38')](_0x41cfbc[_0xb6a9('0x31')][_0xb6a9('0x38')]);_0x5daa9c[_0xb6a9('0x1f')]=qs[_0xb6a9('0x1f')](_0x41cfbc[_0xb6a9('0x31')][_0xb6a9('0x1f')]);}return _0x49ba07['getSubjects'](_0x5daa9c);}})[_0xb6a9('0x27')](function(_0x1e99b4){if(_0x1e99b4){return _0x1e99b4?{'count':_0x25861b,'rows':_0x1e99b4}:null;}})['then'](respondWithResult(_0x4cd069,null))['catch'](handleError(_0x4cd069,null));};exports[_0xb6a9('0x52')]=function(_0x2a0927,_0x1d46ec,_0x19d853){var _0x23ce00={};var _0x313791={};var _0x347989;var _0x2078fc;return db[_0xb6a9('0x44')][_0xb6a9('0x51')]({'where':{'id':_0x2a0927[_0xb6a9('0x47')]['id']}})[_0xb6a9('0x27')](handleEntityNotFound(_0x1d46ec,null))[_0xb6a9('0x27')](function(_0x398611){if(_0x398611){_0x347989=_0x398611;_0x313791[_0xb6a9('0x30')]=_['keys'](db[_0xb6a9('0x4d')][_0xb6a9('0x2d')]);_0x313791[_0xb6a9('0x31')]=_[_0xb6a9('0x32')](_0x2a0927[_0xb6a9('0x31')]);_0x313791[_0xb6a9('0x3c')]=_[_0xb6a9('0x33')](_0x313791[_0xb6a9('0x30')],_0x313791[_0xb6a9('0x31')]);_0x23ce00[_0xb6a9('0x34')]=_[_0xb6a9('0x33')](_0x313791[_0xb6a9('0x30')],qs[_0xb6a9('0x35')](_0x2a0927[_0xb6a9('0x31')]['fields']));_0x23ce00[_0xb6a9('0x34')]=_0x23ce00['attributes']['length']?_0x23ce00[_0xb6a9('0x34')]:_0x313791['model'];_0x23ce00[_0xb6a9('0x39')]=qs[_0xb6a9('0x3a')](_0x2a0927[_0xb6a9('0x31')][_0xb6a9('0x3a')]);_0x23ce00[_0xb6a9('0x3b')]=qs[_0xb6a9('0x3c')](_['pick'](_0x2a0927[_0xb6a9('0x31')],_0x313791[_0xb6a9('0x3c')]));if(_0x2a0927[_0xb6a9('0x31')][_0xb6a9('0x3d')]){_0x23ce00[_0xb6a9('0x3b')]=_[_0xb6a9('0x3e')](_0x23ce00['where'],{'$or':_[_0xb6a9('0x2c')](_0x23ce00[_0xb6a9('0x34')],function(_0x532da9){var _0x49a87e={};_0x49a87e[_0x532da9]={'$like':'%'+_0x2a0927[_0xb6a9('0x31')]['filter']+'%'};return _0x49a87e;})});}_0x23ce00=_[_0xb6a9('0x3e')]({},_0x23ce00,_0x2a0927[_0xb6a9('0x41')]);return _0x347989[_0xb6a9('0x52')](_0x23ce00);}})[_0xb6a9('0x27')](function(_0x2b96fb){if(_0x2b96fb){_0x2078fc=_0x2b96fb[_0xb6a9('0x36')];if(!_0x2a0927[_0xb6a9('0x31')][_0xb6a9('0x37')](_0xb6a9('0x4f'))){_0x23ce00[_0xb6a9('0x38')]=qs[_0xb6a9('0x38')](_0x2a0927[_0xb6a9('0x31')][_0xb6a9('0x38')]);_0x23ce00[_0xb6a9('0x1f')]=qs[_0xb6a9('0x1f')](_0x2a0927[_0xb6a9('0x31')][_0xb6a9('0x1f')]);}return _0x347989[_0xb6a9('0x52')](_0x23ce00);}})[_0xb6a9('0x27')](function(_0x516f4b){if(_0x516f4b){return _0x516f4b?{'count':_0x2078fc,'rows':_0x516f4b}:null;}})[_0xb6a9('0x27')](respondWithResult(_0x1d46ec,null))['catch'](handleError(_0x1d46ec,null));}; \ No newline at end of file +var _0x5634=['end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','findOne','ServicenowField','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x5617dd,_0x15ad4f){var _0x92c09f=function(_0x24e678){while(--_0x24e678){_0x5617dd['push'](_0x5617dd['shift']());}};_0x92c09f(++_0x15ad4f);}(_0x5634,0xe1));var _0x4563=function(_0x7d930f,_0x1c6fcf){_0x7d930f=_0x7d930f-0x0;var _0x64c9fc=_0x5634[_0x7d930f];return _0x64c9fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4563('0x0'));var zipdir=require(_0x4563('0x1'));var jsonpatch=require(_0x4563('0x2'));var rp=require(_0x4563('0x3'));var moment=require(_0x4563('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4563('0x5'));var util=require(_0x4563('0x6'));var path=require(_0x4563('0x7'));var sox=require('sox');var csv=require(_0x4563('0x8'));var ejs=require(_0x4563('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4563('0xa'));var crypto=require(_0x4563('0xb'));var jsforce=require(_0x4563('0xc'));var deskjs=require(_0x4563('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4563('0xe'));var Redis=require(_0x4563('0xf'));var authService=require(_0x4563('0x10'));var qs=require(_0x4563('0x11'));var as=require(_0x4563('0x12'));var hardwareService=require(_0x4563('0x13'));var logger=require(_0x4563('0x14'))(_0x4563('0x15'));var utils=require(_0x4563('0x16'));var config=require(_0x4563('0x17'));var licenseUtil=require(_0x4563('0x18'));var db=require(_0x4563('0x19'))['db'];function respondWithStatusCode(_0x5a2a41,_0x45a90b){_0x45a90b=_0x45a90b||0xcc;return function(_0x229d43){if(_0x229d43){return _0x5a2a41['sendStatus'](_0x45a90b);}return _0x5a2a41[_0x4563('0x1a')](_0x45a90b)[_0x4563('0x1b')]();};}function respondWithResult(_0x1ba2a7,_0x3baa15){_0x3baa15=_0x3baa15||0xc8;return function(_0x206cf0){if(_0x206cf0){return _0x1ba2a7[_0x4563('0x1a')](_0x3baa15)[_0x4563('0x1c')](_0x206cf0);}};}function respondWithFilteredResult(_0x40dddb,_0x2db0f6){return function(_0x48d7aa){if(_0x48d7aa){var _0x4ffff4=typeof _0x2db0f6[_0x4563('0x1d')]==='undefined'&&typeof _0x2db0f6['limit']===_0x4563('0x1e');var _0x2c01c8=_0x48d7aa[_0x4563('0x1f')];var _0x5391c8=_0x4ffff4?0x0:_0x2db0f6[_0x4563('0x1d')];var _0x1aab5f=_0x4ffff4?_0x48d7aa[_0x4563('0x1f')]:_0x2db0f6[_0x4563('0x1d')]+_0x2db0f6[_0x4563('0x20')];var _0x6cc070;if(_0x1aab5f>=_0x2c01c8){_0x1aab5f=_0x2c01c8;_0x6cc070=0xc8;}else{_0x6cc070=0xce;}_0x40dddb['status'](_0x6cc070);return _0x40dddb[_0x4563('0x21')](_0x4563('0x22'),_0x5391c8+'-'+_0x1aab5f+'/'+_0x2c01c8)[_0x4563('0x1c')](_0x48d7aa);}return null;};}function patchUpdates(_0x3dd894){return function(_0x4e6e66){try{jsonpatch[_0x4563('0x23')](_0x4e6e66,_0x3dd894,!![]);}catch(_0x4313d9){return BPromise['reject'](_0x4313d9);}return _0x4e6e66[_0x4563('0x24')]();};}function saveUpdates(_0x3d1c50,_0x119e48){return function(_0xb89dbf){if(_0xb89dbf){return _0xb89dbf[_0x4563('0x25')](_0x3d1c50)[_0x4563('0x26')](function(_0x41b519){return _0x41b519;});}return null;};}function removeEntity(_0x5e4ca6,_0x4ef45d){return function(_0x3ceb1a){if(_0x3ceb1a){return _0x3ceb1a[_0x4563('0x27')]()[_0x4563('0x26')](function(){_0x5e4ca6[_0x4563('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51632f,_0x1d8507){return function(_0x48fffc){if(!_0x48fffc){_0x51632f[_0x4563('0x28')](0x194);}return _0x48fffc;};}function handleError(_0x52bcb7,_0x274c2d){_0x274c2d=_0x274c2d||0x1f4;return function(_0x1d1c99){logger[_0x4563('0x29')](_0x1d1c99[_0x4563('0x2a')]);if(_0x1d1c99[_0x4563('0x2b')]){delete _0x1d1c99['name'];}_0x52bcb7[_0x4563('0x1a')](_0x274c2d)[_0x4563('0x2c')](_0x1d1c99);};}exports['index']=function(_0x5b0bc1,_0x338cad){var _0x2a2ef0={},_0x4113af={},_0x52040d={'count':0x0,'rows':[]};var _0x478e82=_[_0x4563('0x2d')](db[_0x4563('0x2e')][_0x4563('0x2f')],function(_0x2056c7){return{'name':_0x2056c7[_0x4563('0x30')],'type':_0x2056c7[_0x4563('0x31')][_0x4563('0x32')]};});_0x4113af['model']=_[_0x4563('0x2d')](_0x478e82,'name');_0x4113af['query']=_[_0x4563('0x33')](_0x5b0bc1[_0x4563('0x34')]);_0x4113af[_0x4563('0x35')]=_['intersection'](_0x4113af[_0x4563('0x36')],_0x4113af[_0x4563('0x34')]);_0x2a2ef0['attributes']=_['intersection'](_0x4113af[_0x4563('0x36')],qs[_0x4563('0x37')](_0x5b0bc1[_0x4563('0x34')]['fields']));_0x2a2ef0[_0x4563('0x38')]=_0x2a2ef0[_0x4563('0x38')]['length']?_0x2a2ef0['attributes']:_0x4113af[_0x4563('0x36')];if(!_0x5b0bc1[_0x4563('0x34')][_0x4563('0x39')](_0x4563('0x3a'))){_0x2a2ef0[_0x4563('0x20')]=qs[_0x4563('0x20')](_0x5b0bc1[_0x4563('0x34')]['limit']);_0x2a2ef0[_0x4563('0x1d')]=qs[_0x4563('0x1d')](_0x5b0bc1[_0x4563('0x34')]['offset']);}_0x2a2ef0[_0x4563('0x3b')]=qs[_0x4563('0x3c')](_0x5b0bc1[_0x4563('0x34')]['sort']);_0x2a2ef0[_0x4563('0x3d')]=qs[_0x4563('0x35')](_[_0x4563('0x3e')](_0x5b0bc1[_0x4563('0x34')],_0x4113af[_0x4563('0x35')]),_0x478e82);if(_0x5b0bc1[_0x4563('0x34')][_0x4563('0x3f')]){_0x2a2ef0[_0x4563('0x3d')]=_['merge'](_0x2a2ef0[_0x4563('0x3d')],{'$or':_[_0x4563('0x2d')](_0x478e82,function(_0x4097f9){if(_0x4097f9[_0x4563('0x31')]!==_0x4563('0x40')){var _0x2099dc={};_0x2099dc[_0x4097f9['name']]={'$like':'%'+_0x5b0bc1[_0x4563('0x34')]['filter']+'%'};return _0x2099dc;}})});}_0x2a2ef0=_[_0x4563('0x41')]({},_0x2a2ef0,_0x5b0bc1[_0x4563('0x42')]);var _0x31d122={'where':_0x2a2ef0['where']};return db[_0x4563('0x2e')][_0x4563('0x1f')](_0x31d122)[_0x4563('0x26')](function(_0x25a11c){_0x52040d[_0x4563('0x1f')]=_0x25a11c;if(_0x5b0bc1[_0x4563('0x34')][_0x4563('0x43')]){_0x2a2ef0[_0x4563('0x44')]=[{'all':!![]}];}return db[_0x4563('0x2e')][_0x4563('0x45')](_0x2a2ef0);})[_0x4563('0x26')](function(_0x598ed5){_0x52040d[_0x4563('0x46')]=_0x598ed5;return _0x52040d;})[_0x4563('0x26')](respondWithFilteredResult(_0x338cad,_0x2a2ef0))[_0x4563('0x47')](handleError(_0x338cad,null));};exports[_0x4563('0x48')]=function(_0x59e7d6,_0x69de93){var _0x3ebe50={'raw':![],'where':{'id':_0x59e7d6[_0x4563('0x49')]['id']}},_0x3e5007={};_0x3e5007[_0x4563('0x36')]=_['keys'](db['ServicenowConfiguration'][_0x4563('0x2f')]);_0x3e5007[_0x4563('0x34')]=_[_0x4563('0x33')](_0x59e7d6[_0x4563('0x34')]);_0x3e5007[_0x4563('0x35')]=_[_0x4563('0x4a')](_0x3e5007[_0x4563('0x36')],_0x3e5007[_0x4563('0x34')]);_0x3ebe50[_0x4563('0x38')]=_[_0x4563('0x4a')](_0x3e5007[_0x4563('0x36')],qs[_0x4563('0x37')](_0x59e7d6['query']['fields']));_0x3ebe50['attributes']=_0x3ebe50[_0x4563('0x38')][_0x4563('0x4b')]?_0x3ebe50[_0x4563('0x38')]:_0x3e5007[_0x4563('0x36')];if(_0x59e7d6[_0x4563('0x34')][_0x4563('0x43')]){_0x3ebe50[_0x4563('0x44')]=[{'all':!![]}];}_0x3ebe50=_['merge']({},_0x3ebe50,_0x59e7d6['options']);return db[_0x4563('0x2e')][_0x4563('0x4c')](_0x3ebe50)['then'](handleEntityNotFound(_0x69de93,null))[_0x4563('0x26')](respondWithResult(_0x69de93,null))['catch'](handleError(_0x69de93,null));};exports[_0x4563('0x4d')]=function(_0x1ff322,_0x36ddae){return db['ServicenowConfiguration'][_0x4563('0x4d')](_0x1ff322['body'],{})[_0x4563('0x26')](respondWithResult(_0x36ddae,0xc9))[_0x4563('0x47')](handleError(_0x36ddae,null));};exports[_0x4563('0x25')]=function(_0x630831,_0x21e2c9){if(_0x630831[_0x4563('0x4e')]['id']){delete _0x630831[_0x4563('0x4e')]['id'];}return db[_0x4563('0x2e')][_0x4563('0x4c')]({'where':{'id':_0x630831['params']['id']}})[_0x4563('0x26')](handleEntityNotFound(_0x21e2c9,null))[_0x4563('0x26')](saveUpdates(_0x630831[_0x4563('0x4e')],null))['then'](respondWithResult(_0x21e2c9,null))[_0x4563('0x47')](handleError(_0x21e2c9,null));};exports[_0x4563('0x27')]=function(_0x1688f9,_0x405efc){return db[_0x4563('0x2e')]['find']({'where':{'id':_0x1688f9[_0x4563('0x49')]['id']}})['then'](handleEntityNotFound(_0x405efc,null))[_0x4563('0x26')](removeEntity(_0x405efc,null))[_0x4563('0x47')](handleError(_0x405efc,null));};exports['getFields']=function(_0x551a91,_0x4e1800,_0x27acc2){var _0x5a5bfb={};var _0x78b1db={};var _0x110212;var _0x50ddc3;return db[_0x4563('0x2e')][_0x4563('0x4f')]({'where':{'id':_0x551a91[_0x4563('0x49')]['id']}})[_0x4563('0x26')](handleEntityNotFound(_0x4e1800,null))[_0x4563('0x26')](function(_0x2db024){if(_0x2db024){_0x110212=_0x2db024;_0x78b1db[_0x4563('0x36')]=_['keys'](db[_0x4563('0x50')][_0x4563('0x2f')]);_0x78b1db[_0x4563('0x34')]=_[_0x4563('0x33')](_0x551a91[_0x4563('0x34')]);_0x78b1db[_0x4563('0x35')]=_[_0x4563('0x4a')](_0x78b1db[_0x4563('0x36')],_0x78b1db[_0x4563('0x34')]);_0x5a5bfb[_0x4563('0x38')]=_[_0x4563('0x4a')](_0x78b1db[_0x4563('0x36')],qs[_0x4563('0x37')](_0x551a91[_0x4563('0x34')][_0x4563('0x37')]));_0x5a5bfb[_0x4563('0x38')]=_0x5a5bfb[_0x4563('0x38')]['length']?_0x5a5bfb[_0x4563('0x38')]:_0x78b1db[_0x4563('0x36')];_0x5a5bfb[_0x4563('0x3b')]=qs['sort'](_0x551a91[_0x4563('0x34')][_0x4563('0x3c')]);_0x5a5bfb[_0x4563('0x3d')]=qs[_0x4563('0x35')](_[_0x4563('0x3e')](_0x551a91[_0x4563('0x34')],_0x78b1db[_0x4563('0x35')]));if(_0x551a91[_0x4563('0x34')]['filter']){_0x5a5bfb[_0x4563('0x3d')]=_[_0x4563('0x41')](_0x5a5bfb[_0x4563('0x3d')],{'$or':_['map'](_0x5a5bfb[_0x4563('0x38')],function(_0x55f18e){var _0x313c1f={};_0x313c1f[_0x55f18e]={'$like':'%'+_0x551a91[_0x4563('0x34')][_0x4563('0x3f')]+'%'};return _0x313c1f;})});}_0x5a5bfb=_[_0x4563('0x41')]({},_0x5a5bfb,_0x551a91[_0x4563('0x42')]);return _0x110212[_0x4563('0x51')](_0x5a5bfb);}})[_0x4563('0x26')](function(_0x5448d1){if(_0x5448d1){_0x50ddc3=_0x5448d1[_0x4563('0x4b')];if(!_0x551a91[_0x4563('0x34')][_0x4563('0x39')](_0x4563('0x3a'))){_0x5a5bfb[_0x4563('0x20')]=qs['limit'](_0x551a91[_0x4563('0x34')][_0x4563('0x20')]);_0x5a5bfb[_0x4563('0x1d')]=qs['offset'](_0x551a91[_0x4563('0x34')][_0x4563('0x1d')]);}return _0x110212[_0x4563('0x51')](_0x5a5bfb);}})[_0x4563('0x26')](function(_0xf28a41){if(_0xf28a41){return _0xf28a41?{'count':_0x50ddc3,'rows':_0xf28a41}:null;}})[_0x4563('0x26')](respondWithResult(_0x4e1800,null))[_0x4563('0x47')](handleError(_0x4e1800,null));};exports[_0x4563('0x52')]=function(_0x8b1ba9,_0x38bfe5,_0x5c5c9d){var _0x1598f2={};var _0x16df7a={};var _0x24430d;var _0x57c2a0;return db['ServicenowConfiguration'][_0x4563('0x4f')]({'where':{'id':_0x8b1ba9[_0x4563('0x49')]['id']}})['then'](handleEntityNotFound(_0x38bfe5,null))[_0x4563('0x26')](function(_0x30a66c){if(_0x30a66c){_0x24430d=_0x30a66c;_0x16df7a[_0x4563('0x36')]=_[_0x4563('0x33')](db[_0x4563('0x50')]['rawAttributes']);_0x16df7a[_0x4563('0x34')]=_['keys'](_0x8b1ba9[_0x4563('0x34')]);_0x16df7a[_0x4563('0x35')]=_[_0x4563('0x4a')](_0x16df7a[_0x4563('0x36')],_0x16df7a['query']);_0x1598f2[_0x4563('0x38')]=_[_0x4563('0x4a')](_0x16df7a[_0x4563('0x36')],qs['fields'](_0x8b1ba9['query']['fields']));_0x1598f2[_0x4563('0x38')]=_0x1598f2[_0x4563('0x38')][_0x4563('0x4b')]?_0x1598f2[_0x4563('0x38')]:_0x16df7a['model'];_0x1598f2[_0x4563('0x3b')]=qs['sort'](_0x8b1ba9[_0x4563('0x34')][_0x4563('0x3c')]);_0x1598f2['where']=qs[_0x4563('0x35')](_[_0x4563('0x3e')](_0x8b1ba9[_0x4563('0x34')],_0x16df7a[_0x4563('0x35')]));if(_0x8b1ba9[_0x4563('0x34')]['filter']){_0x1598f2['where']=_[_0x4563('0x41')](_0x1598f2[_0x4563('0x3d')],{'$or':_[_0x4563('0x2d')](_0x1598f2[_0x4563('0x38')],function(_0x3923f8){var _0x97a3c8={};_0x97a3c8[_0x3923f8]={'$like':'%'+_0x8b1ba9[_0x4563('0x34')][_0x4563('0x3f')]+'%'};return _0x97a3c8;})});}_0x1598f2=_['merge']({},_0x1598f2,_0x8b1ba9[_0x4563('0x42')]);return _0x24430d[_0x4563('0x52')](_0x1598f2);}})['then'](function(_0x2ee402){if(_0x2ee402){_0x57c2a0=_0x2ee402['length'];if(!_0x8b1ba9[_0x4563('0x34')][_0x4563('0x39')](_0x4563('0x3a'))){_0x1598f2[_0x4563('0x20')]=qs[_0x4563('0x20')](_0x8b1ba9[_0x4563('0x34')][_0x4563('0x20')]);_0x1598f2[_0x4563('0x1d')]=qs[_0x4563('0x1d')](_0x8b1ba9[_0x4563('0x34')]['offset']);}return _0x24430d[_0x4563('0x52')](_0x1598f2);}})['then'](function(_0x4c96d3){if(_0x4c96d3){return _0x4c96d3?{'count':_0x57c2a0,'rows':_0x4c96d3}:null;}})[_0x4563('0x26')](respondWithResult(_0x38bfe5,null))[_0x4563('0x47')](handleError(_0x38bfe5,null));};exports[_0x4563('0x53')]=function(_0xa246a,_0x4ce85d,_0x4c3bbf){var _0x5a52cb={};var _0x465c28={};var _0x255785;var _0xa6fa3;return db[_0x4563('0x2e')][_0x4563('0x4f')]({'where':{'id':_0xa246a['params']['id']}})[_0x4563('0x26')](handleEntityNotFound(_0x4ce85d,null))[_0x4563('0x26')](function(_0x36c3f5){if(_0x36c3f5){_0x255785=_0x36c3f5;_0x465c28[_0x4563('0x36')]=_[_0x4563('0x33')](db[_0x4563('0x50')][_0x4563('0x2f')]);_0x465c28[_0x4563('0x34')]=_[_0x4563('0x33')](_0xa246a['query']);_0x465c28[_0x4563('0x35')]=_['intersection'](_0x465c28[_0x4563('0x36')],_0x465c28[_0x4563('0x34')]);_0x5a52cb[_0x4563('0x38')]=_['intersection'](_0x465c28[_0x4563('0x36')],qs[_0x4563('0x37')](_0xa246a[_0x4563('0x34')][_0x4563('0x37')]));_0x5a52cb['attributes']=_0x5a52cb[_0x4563('0x38')][_0x4563('0x4b')]?_0x5a52cb[_0x4563('0x38')]:_0x465c28['model'];_0x5a52cb[_0x4563('0x3b')]=qs[_0x4563('0x3c')](_0xa246a['query'][_0x4563('0x3c')]);_0x5a52cb[_0x4563('0x3d')]=qs['filters'](_[_0x4563('0x3e')](_0xa246a['query'],_0x465c28[_0x4563('0x35')]));if(_0xa246a[_0x4563('0x34')][_0x4563('0x3f')]){_0x5a52cb[_0x4563('0x3d')]=_[_0x4563('0x41')](_0x5a52cb[_0x4563('0x3d')],{'$or':_[_0x4563('0x2d')](_0x5a52cb[_0x4563('0x38')],function(_0x46b0a6){var _0x340551={};_0x340551[_0x46b0a6]={'$like':'%'+_0xa246a[_0x4563('0x34')][_0x4563('0x3f')]+'%'};return _0x340551;})});}_0x5a52cb=_[_0x4563('0x41')]({},_0x5a52cb,_0xa246a['options']);return _0x255785[_0x4563('0x53')](_0x5a52cb);}})[_0x4563('0x26')](function(_0x2b0efa){if(_0x2b0efa){_0xa6fa3=_0x2b0efa['length'];if(!_0xa246a[_0x4563('0x34')][_0x4563('0x39')]('nolimit')){_0x5a52cb[_0x4563('0x20')]=qs[_0x4563('0x20')](_0xa246a[_0x4563('0x34')][_0x4563('0x20')]);_0x5a52cb[_0x4563('0x1d')]=qs[_0x4563('0x1d')](_0xa246a[_0x4563('0x34')][_0x4563('0x1d')]);}return _0x255785[_0x4563('0x53')](_0x5a52cb);}})[_0x4563('0x26')](function(_0xda60fb){if(_0xda60fb){return _0xda60fb?{'count':_0xa6fa3,'rows':_0xda60fb}:null;}})['then'](respondWithResult(_0x4ce85d,null))['catch'](handleError(_0x4ce85d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 1aeca8d..72acb7a 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 _0x9354=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0x9354,0x96));var _0x4935=function(_0x1460ab,_0x74d06e){_0x1460ab=_0x1460ab-0x0;var _0x1eeb5c=_0x9354[_0x1460ab];return _0x1eeb5c;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc04a=['exports','int_servicenow_configurations','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac04('0x0'));var util=require('util');var logger=require(_0xac04('0x1'))('api');var moment=require(_0xac04('0x2'));var BPromise=require(_0xac04('0x3'));var rp=require(_0xac04('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac04('0x5'));var config=require(_0xac04('0x6'));var attributes=require(_0xac04('0x7'));module[_0xac04('0x8')]=function(_0x5add53,_0x5c6f52){return _0x5add53['define']('ServicenowConfiguration',attributes,{'tableName':_0xac04('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 6ee936a..d5e0414 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 _0x3aa7=['ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','info'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x3aa7,0xd9));var _0x73aa=function(_0x14147c,_0x13eada){_0x14147c=_0x14147c-0x0;var _0x50158a=_0x3aa7[_0x14147c];return _0x50158a;};'use strict';var _=require(_0x73aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x73aa('0x1'));var rs=require(_0x73aa('0x2'));var fs=require('fs');var Redis=require(_0x73aa('0x3'));var db=require(_0x73aa('0x4'))['db'];var utils=require(_0x73aa('0x5'));var logger=require('../../config/logger')(_0x73aa('0x6'));var config=require(_0x73aa('0x7'));var jayson=require(_0x73aa('0x8'));var client=jayson['client'][_0x73aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477c39,_0x20ded5,_0x3cd8a4){return new BPromise(function(_0x1573aa,_0x5bb4d1){return client['request'](_0x477c39,_0x3cd8a4)['then'](function(_0xaba6b7){logger[_0x73aa('0xa')](_0x73aa('0xb'),_0x20ded5,'request\x20sent');logger['debug'](_0x73aa('0xc'),_0x20ded5,_0x73aa('0xd'),JSON[_0x73aa('0xe')](_0xaba6b7));if(_0xaba6b7[_0x73aa('0xf')]){if(_0xaba6b7['error'][_0x73aa('0x10')]===0x1f4){logger[_0x73aa('0xf')](_0x73aa('0xb'),_0x20ded5,_0xaba6b7[_0x73aa('0xf')]['message']);return _0x5bb4d1(_0xaba6b7[_0x73aa('0xf')]['message']);}logger[_0x73aa('0xf')](_0x73aa('0xb'),_0x20ded5,_0xaba6b7['error'][_0x73aa('0x11')]);return _0x1573aa(_0xaba6b7[_0x73aa('0xf')][_0x73aa('0x11')]);}else{logger['info'](_0x73aa('0xb'),_0x20ded5,_0x73aa('0xd'));_0x1573aa(_0xaba6b7['result'][_0x73aa('0x11')]);}})[_0x73aa('0x12')](function(_0x5c5cb0){logger[_0x73aa('0xf')](_0x73aa('0xb'),_0x20ded5,_0x5c5cb0);_0x5bb4d1(_0x5c5cb0);});});} \ No newline at end of file +var _0x4e86=['message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x4e86,0xf3));var _0x64e8=function(_0x3e6f7d,_0x4f6b24){_0x3e6f7d=_0x3e6f7d-0x0;var _0x7821ef=_0x4e86[_0x3e6f7d];return _0x7821ef;};'use strict';var _=require(_0x64e8('0x0'));var util=require('util');var moment=require(_0x64e8('0x1'));var BPromise=require(_0x64e8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64e8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x64e8('0x4'))('rpc');var config=require(_0x64e8('0x5'));var jayson=require(_0x64e8('0x6'));var client=jayson[_0x64e8('0x7')][_0x64e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x63310,_0x40f6af,_0x331493){return new BPromise(function(_0x30344f,_0xa952d3){return client['request'](_0x63310,_0x331493)[_0x64e8('0x9')](function(_0x530e89){logger[_0x64e8('0xa')]('ServicenowConfiguration,\x20%s,\x20%s',_0x40f6af,_0x64e8('0xb'));logger[_0x64e8('0xc')](_0x64e8('0xd'),_0x40f6af,_0x64e8('0xb'),JSON[_0x64e8('0xe')](_0x530e89));if(_0x530e89[_0x64e8('0xf')]){if(_0x530e89['error']['code']===0x1f4){logger[_0x64e8('0xf')](_0x64e8('0x10'),_0x40f6af,_0x530e89[_0x64e8('0xf')][_0x64e8('0x11')]);return _0xa952d3(_0x530e89['error'][_0x64e8('0x11')]);}logger['error'](_0x64e8('0x10'),_0x40f6af,_0x530e89['error'][_0x64e8('0x11')]);return _0x30344f(_0x530e89[_0x64e8('0xf')][_0x64e8('0x11')]);}else{logger['info'](_0x64e8('0x10'),_0x40f6af,_0x64e8('0xb'));_0x30344f(_0x530e89[_0x64e8('0x12')][_0x64e8('0x11')]);}})[_0x64e8('0x13')](function(_0x72b846){logger[_0x64e8('0xf')](_0x64e8('0x10'),_0x40f6af,_0x72b846);_0xa952d3(_0x72b846);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f09bc7e..21cfe8e 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 _0x9d8b=['create','put','update','delete','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x43fb11,_0x5d4ef5){var _0x1997f4=function(_0x5b851b){while(--_0x5b851b){_0x43fb11['push'](_0x43fb11['shift']());}};_0x1997f4(++_0x5d4ef5);}(_0x9d8b,0x16b));var _0xb9d8=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x9d8b[_0x2b5b44];return _0x32cb66;};'use strict';var multer=require('multer');var util=require(_0xb9d8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb9d8('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb9d8('0x2'));var interaction=require(_0xb9d8('0x3'));var config=require('../../config/environment');var controller=require(_0xb9d8('0x4'));router[_0xb9d8('0x5')]('/',auth['isAuthenticated'](),controller[_0xb9d8('0x6')]);router[_0xb9d8('0x5')](_0xb9d8('0x7'),auth['isAuthenticated'](),controller[_0xb9d8('0x8')]);router[_0xb9d8('0x9')]('/',auth[_0xb9d8('0xa')](),controller[_0xb9d8('0xb')]);router[_0xb9d8('0xc')](_0xb9d8('0x7'),auth['isAuthenticated'](),controller[_0xb9d8('0xd')]);router[_0xb9d8('0xe')](_0xb9d8('0x7'),auth[_0xb9d8('0xa')](),controller[_0xb9d8('0xf')]);module[_0xb9d8('0x10')]=router; \ No newline at end of file +var _0x047d=['get','isAuthenticated','index','/:id','post','put','update','delete','exports','util','path','express','Router','fs-extra','./intServicenowField.controller'];(function(_0x4038e4,_0x294424){var _0x3ef3bb=function(_0x3c7518){while(--_0x3c7518){_0x4038e4['push'](_0x4038e4['shift']());}};_0x3ef3bb(++_0x294424);}(_0x047d,0x19e));var _0xd047=function(_0x718a85,_0x5272fb){_0x718a85=_0x718a85-0x0;var _0x180486=_0x047d[_0x718a85];return _0x180486;};'use strict';var multer=require('multer');var util=require(_0xd047('0x0'));var path=require(_0xd047('0x1'));var timeout=require('connect-timeout');var express=require(_0xd047('0x2'));var router=express[_0xd047('0x3')]();var fs_extra=require(_0xd047('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd047('0x5'));router[_0xd047('0x6')]('/',auth[_0xd047('0x7')](),controller[_0xd047('0x8')]);router['get'](_0xd047('0x9'),auth[_0xd047('0x7')](),controller['show']);router[_0xd047('0xa')]('/',auth[_0xd047('0x7')](),controller['create']);router[_0xd047('0xb')]('/:id',auth[_0xd047('0x7')](),controller[_0xd047('0xc')]);router[_0xd047('0xd')]('/:id',auth[_0xd047('0x7')](),controller['destroy']);module[_0xd047('0xe')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 1914e74..d1ceaa8 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 _0x1276=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x1276,0x8d));var _0x6127=function(_0x1ecf41,_0x5cdd54){_0x1ecf41=_0x1ecf41-0x0;var _0x10c2ef=_0x1276[_0x1ecf41];return _0x10c2ef;};'use strict';var Sequelize=require(_0x6127('0x0'));module['exports']={'type':{'type':Sequelize[_0x6127('0x1')](_0x6127('0x2'),_0x6127('0x3'),_0x6127('0x4'),_0x6127('0x5'),'picklist'),'defaultValue':_0x6127('0x2')},'content':{'type':Sequelize[_0x6127('0x6')]},'key':{'type':Sequelize[_0x6127('0x6')]},'keyType':{'type':Sequelize[_0x6127('0x1')](_0x6127('0x2'),'variable',_0x6127('0x4'))},'keyContent':{'type':Sequelize[_0x6127('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6127('0x6')]},'customField':{'type':Sequelize[_0x6127('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6127('0x6')]}}; \ No newline at end of file +var _0x773d=['sequelize','exports','string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN'];(function(_0x2b7567,_0x412715){var _0x2522dc=function(_0x242d85){while(--_0x242d85){_0x2b7567['push'](_0x2b7567['shift']());}};_0x2522dc(++_0x412715);}(_0x773d,0xe1));var _0xd773=function(_0xdc0501,_0x403f0a){_0xdc0501=_0xdc0501-0x0;var _0x3952b5=_0x773d[_0xdc0501];return _0x3952b5;};'use strict';var Sequelize=require(_0xd773('0x0'));module[_0xd773('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd773('0x2'),_0xd773('0x3'),_0xd773('0x4'),'keyValue',_0xd773('0x5')),'defaultValue':_0xd773('0x2')},'content':{'type':Sequelize[_0xd773('0x6')]},'key':{'type':Sequelize[_0xd773('0x6')]},'keyType':{'type':Sequelize[_0xd773('0x7')](_0xd773('0x2'),_0xd773('0x3'),_0xd773('0x4'))},'keyContent':{'type':Sequelize[_0xd773('0x6')]},'idField':{'type':Sequelize[_0xd773('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd773('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd773('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 65b04be..c54c700 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 _0xc819=['destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','ServicenowField','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x247b2c,_0x52354c){var _0x14986e=function(_0xe60b3d){while(--_0xe60b3d){_0x247b2c['push'](_0x247b2c['shift']());}};_0x14986e(++_0x52354c);}(_0xc819,0x71));var _0x9c81=function(_0x8aa04b,_0x4809d8){_0x8aa04b=_0x8aa04b-0x0;var _0x3bf946=_0xc819[_0x8aa04b];return _0x3bf946;};'use strict';var emlformat=require(_0x9c81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c81('0x1'));var jsonpatch=require(_0x9c81('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9c81('0x3'));var Mustache=require('mustache');var util=require(_0x9c81('0x4'));var path=require(_0x9c81('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9c81('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c81('0x7'));var squel=require(_0x9c81('0x8'));var crypto=require(_0x9c81('0x9'));var jsforce=require(_0x9c81('0xa'));var deskjs=require(_0x9c81('0xb'));var toCsv=require(_0x9c81('0xc'));var querystring=require(_0x9c81('0xd'));var Papa=require(_0x9c81('0xe'));var Redis=require(_0x9c81('0xf'));var authService=require(_0x9c81('0x10'));var qs=require(_0x9c81('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c81('0x12'));var logger=require(_0x9c81('0x13'))(_0x9c81('0x14'));var utils=require('../../config/utils');var config=require(_0x9c81('0x15'));var licenseUtil=require(_0x9c81('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x315cba,_0x4779e){_0x4779e=_0x4779e||0xcc;return function(_0x1b4ba6){if(_0x1b4ba6){return _0x315cba['sendStatus'](_0x4779e);}return _0x315cba[_0x9c81('0x17')](_0x4779e)[_0x9c81('0x18')]();};}function respondWithResult(_0x2776d1,_0x5f4c6c){_0x5f4c6c=_0x5f4c6c||0xc8;return function(_0x2e77ff){if(_0x2e77ff){return _0x2776d1[_0x9c81('0x17')](_0x5f4c6c)[_0x9c81('0x19')](_0x2e77ff);}};}function respondWithFilteredResult(_0x223c77,_0x4e65d9){return function(_0x284d72){if(_0x284d72){var _0x3371fa=typeof _0x4e65d9[_0x9c81('0x1a')]==='undefined'&&typeof _0x4e65d9['limit']===_0x9c81('0x1b');var _0x5dc934=_0x284d72['count'];var _0x550051=_0x3371fa?0x0:_0x4e65d9[_0x9c81('0x1a')];var _0x373a7a=_0x3371fa?_0x284d72[_0x9c81('0x1c')]:_0x4e65d9['offset']+_0x4e65d9[_0x9c81('0x1d')];var _0x376401;if(_0x373a7a>=_0x5dc934){_0x373a7a=_0x5dc934;_0x376401=0xc8;}else{_0x376401=0xce;}_0x223c77[_0x9c81('0x17')](_0x376401);return _0x223c77[_0x9c81('0x1e')](_0x9c81('0x1f'),_0x550051+'-'+_0x373a7a+'/'+_0x5dc934)[_0x9c81('0x19')](_0x284d72);}return null;};}function patchUpdates(_0x2b2b93){return function(_0x4471af){try{jsonpatch[_0x9c81('0x20')](_0x4471af,_0x2b2b93,!![]);}catch(_0xe14f92){return BPromise[_0x9c81('0x21')](_0xe14f92);}return _0x4471af[_0x9c81('0x22')]();};}function saveUpdates(_0x3d1d58,_0x254e5e){return function(_0x14803a){if(_0x14803a){return _0x14803a[_0x9c81('0x23')](_0x3d1d58)[_0x9c81('0x24')](function(_0x63bcc3){return _0x63bcc3;});}return null;};}function removeEntity(_0x5b05d9,_0x1236f2){return function(_0x4d493f){if(_0x4d493f){return _0x4d493f[_0x9c81('0x25')]()['then'](function(){_0x5b05d9[_0x9c81('0x17')](0xcc)[_0x9c81('0x18')]();});}};}function handleEntityNotFound(_0xb5a974,_0x89452b){return function(_0x2b8ade){if(!_0x2b8ade){_0xb5a974[_0x9c81('0x26')](0x194);}return _0x2b8ade;};}function handleError(_0x2de789,_0xb3ace){_0xb3ace=_0xb3ace||0x1f4;return function(_0x5b0e84){logger['error'](_0x5b0e84[_0x9c81('0x27')]);if(_0x5b0e84[_0x9c81('0x28')]){delete _0x5b0e84['name'];}_0x2de789[_0x9c81('0x17')](_0xb3ace)[_0x9c81('0x29')](_0x5b0e84);};}exports[_0x9c81('0x2a')]=function(_0x2c62ea,_0x14a6f6){var _0x2a349a={},_0x51ecdc={},_0xaa138b={'count':0x0,'rows':[]};var _0x3b6a29=_[_0x9c81('0x2b')](db['ServicenowField'][_0x9c81('0x2c')],function(_0x54355c){return{'name':_0x54355c[_0x9c81('0x2d')],'type':_0x54355c[_0x9c81('0x2e')][_0x9c81('0x2f')]};});_0x51ecdc[_0x9c81('0x30')]=_['map'](_0x3b6a29,_0x9c81('0x28'));_0x51ecdc[_0x9c81('0x31')]=_[_0x9c81('0x32')](_0x2c62ea['query']);_0x51ecdc['filters']=_['intersection'](_0x51ecdc[_0x9c81('0x30')],_0x51ecdc[_0x9c81('0x31')]);_0x2a349a['attributes']=_[_0x9c81('0x33')](_0x51ecdc[_0x9c81('0x30')],qs['fields'](_0x2c62ea[_0x9c81('0x31')][_0x9c81('0x34')]));_0x2a349a[_0x9c81('0x35')]=_0x2a349a[_0x9c81('0x35')]['length']?_0x2a349a[_0x9c81('0x35')]:_0x51ecdc[_0x9c81('0x30')];if(!_0x2c62ea[_0x9c81('0x31')][_0x9c81('0x36')](_0x9c81('0x37'))){_0x2a349a['limit']=qs[_0x9c81('0x1d')](_0x2c62ea[_0x9c81('0x31')][_0x9c81('0x1d')]);_0x2a349a[_0x9c81('0x1a')]=qs['offset'](_0x2c62ea[_0x9c81('0x31')][_0x9c81('0x1a')]);}_0x2a349a[_0x9c81('0x38')]=qs[_0x9c81('0x39')](_0x2c62ea[_0x9c81('0x31')]['sort']);_0x2a349a[_0x9c81('0x3a')]=qs[_0x9c81('0x3b')](_[_0x9c81('0x3c')](_0x2c62ea[_0x9c81('0x31')],_0x51ecdc[_0x9c81('0x3b')]),_0x3b6a29);if(_0x2c62ea['query'][_0x9c81('0x3d')]){_0x2a349a['where']=_[_0x9c81('0x3e')](_0x2a349a[_0x9c81('0x3a')],{'$or':_[_0x9c81('0x2b')](_0x3b6a29,function(_0x3583c8){if(_0x3583c8['type']!=='VIRTUAL'){var _0x4bbdd7={};_0x4bbdd7[_0x3583c8['name']]={'$like':'%'+_0x2c62ea[_0x9c81('0x31')]['filter']+'%'};return _0x4bbdd7;}})});}_0x2a349a=_['merge']({},_0x2a349a,_0x2c62ea[_0x9c81('0x3f')]);var _0x262825={'where':_0x2a349a[_0x9c81('0x3a')]};return db[_0x9c81('0x40')]['count'](_0x262825)[_0x9c81('0x24')](function(_0x1b9171){_0xaa138b[_0x9c81('0x1c')]=_0x1b9171;if(_0x2c62ea[_0x9c81('0x31')][_0x9c81('0x41')]){_0x2a349a['include']=[{'all':!![]}];}return db[_0x9c81('0x40')][_0x9c81('0x42')](_0x2a349a);})[_0x9c81('0x24')](function(_0x242b10){_0xaa138b[_0x9c81('0x43')]=_0x242b10;return _0xaa138b;})[_0x9c81('0x24')](respondWithFilteredResult(_0x14a6f6,_0x2a349a))[_0x9c81('0x44')](handleError(_0x14a6f6,null));};exports[_0x9c81('0x45')]=function(_0xfe6466,_0x495c4a){var _0x20826f={'raw':!![],'where':{'id':_0xfe6466[_0x9c81('0x46')]['id']}},_0x1763f9={};_0x1763f9['model']=_[_0x9c81('0x32')](db[_0x9c81('0x40')][_0x9c81('0x2c')]);_0x1763f9[_0x9c81('0x31')]=_[_0x9c81('0x32')](_0xfe6466['query']);_0x1763f9[_0x9c81('0x3b')]=_[_0x9c81('0x33')](_0x1763f9[_0x9c81('0x30')],_0x1763f9[_0x9c81('0x31')]);_0x20826f[_0x9c81('0x35')]=_[_0x9c81('0x33')](_0x1763f9[_0x9c81('0x30')],qs[_0x9c81('0x34')](_0xfe6466[_0x9c81('0x31')][_0x9c81('0x34')]));_0x20826f[_0x9c81('0x35')]=_0x20826f[_0x9c81('0x35')]['length']?_0x20826f[_0x9c81('0x35')]:_0x1763f9['model'];if(_0xfe6466['query'][_0x9c81('0x41')]){_0x20826f[_0x9c81('0x47')]=[{'all':!![]}];}_0x20826f=_[_0x9c81('0x3e')]({},_0x20826f,_0xfe6466[_0x9c81('0x3f')]);return db[_0x9c81('0x40')][_0x9c81('0x48')](_0x20826f)['then'](handleEntityNotFound(_0x495c4a,null))['then'](respondWithResult(_0x495c4a,null))[_0x9c81('0x44')](handleError(_0x495c4a,null));};exports['create']=function(_0x51533f,_0x4a26d0){return db[_0x9c81('0x40')][_0x9c81('0x49')](_0x51533f['body'],{})[_0x9c81('0x24')](respondWithResult(_0x4a26d0,0xc9))['catch'](handleError(_0x4a26d0,null));};exports[_0x9c81('0x23')]=function(_0x28e064,_0x1c1146){if(_0x28e064[_0x9c81('0x4a')]['id']){delete _0x28e064[_0x9c81('0x4a')]['id'];}return db[_0x9c81('0x40')][_0x9c81('0x48')]({'where':{'id':_0x28e064[_0x9c81('0x46')]['id']}})[_0x9c81('0x24')](handleEntityNotFound(_0x1c1146,null))[_0x9c81('0x24')](saveUpdates(_0x28e064[_0x9c81('0x4a')],null))[_0x9c81('0x24')](respondWithResult(_0x1c1146,null))[_0x9c81('0x44')](handleError(_0x1c1146,null));};exports[_0x9c81('0x25')]=function(_0x4ad546,_0x51cf52){return db[_0x9c81('0x40')][_0x9c81('0x48')]({'where':{'id':_0x4ad546[_0x9c81('0x46')]['id']}})['then'](handleEntityNotFound(_0x51cf52,null))[_0x9c81('0x24')](removeEntity(_0x51cf52,null))['catch'](handleError(_0x51cf52,null));}; \ No newline at end of file +var _0xc5cf=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','ServicenowField','findAll','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','name','index','map','rawAttributes','type','key','model','query','keys'];(function(_0x1a42ba,_0x2dee69){var _0x465a86=function(_0x35487a){while(--_0x35487a){_0x1a42ba['push'](_0x1a42ba['shift']());}};_0x465a86(++_0x2dee69);}(_0xc5cf,0x17f));var _0xfc5c=function(_0x30fc7d,_0x2e6584){_0x30fc7d=_0x30fc7d-0x0;var _0x74e15d=_0xc5cf[_0x30fc7d];return _0x74e15d;};'use strict';var emlformat=require(_0xfc5c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc5c('0x1'));var jsonpatch=require(_0xfc5c('0x2'));var rp=require(_0xfc5c('0x3'));var moment=require(_0xfc5c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfc5c('0x5'));var util=require(_0xfc5c('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfc5c('0x7'));var fs=require('fs');var fs_extra=require(_0xfc5c('0x8'));var _=require(_0xfc5c('0x9'));var squel=require(_0xfc5c('0xa'));var crypto=require(_0xfc5c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfc5c('0xc'));var toCsv=require(_0xfc5c('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfc5c('0xe'));var authService=require(_0xfc5c('0xf'));var qs=require(_0xfc5c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc5c('0x11'));var logger=require(_0xfc5c('0x12'))(_0xfc5c('0x13'));var utils=require(_0xfc5c('0x14'));var config=require(_0xfc5c('0x15'));var licenseUtil=require(_0xfc5c('0x16'));var db=require(_0xfc5c('0x17'))['db'];function respondWithStatusCode(_0x2ae694,_0x1c2aab){_0x1c2aab=_0x1c2aab||0xcc;return function(_0x57a432){if(_0x57a432){return _0x2ae694[_0xfc5c('0x18')](_0x1c2aab);}return _0x2ae694[_0xfc5c('0x19')](_0x1c2aab)[_0xfc5c('0x1a')]();};}function respondWithResult(_0x457f65,_0x1afcd5){_0x1afcd5=_0x1afcd5||0xc8;return function(_0x554fba){if(_0x554fba){return _0x457f65[_0xfc5c('0x19')](_0x1afcd5)['json'](_0x554fba);}};}function respondWithFilteredResult(_0x5897b0,_0xf47a65){return function(_0x7ea999){if(_0x7ea999){var _0x22d704=typeof _0xf47a65[_0xfc5c('0x1b')]===_0xfc5c('0x1c')&&typeof _0xf47a65['limit']===_0xfc5c('0x1c');var _0x2cf2f4=_0x7ea999[_0xfc5c('0x1d')];var _0xedb735=_0x22d704?0x0:_0xf47a65[_0xfc5c('0x1b')];var _0x4681b5=_0x22d704?_0x7ea999[_0xfc5c('0x1d')]:_0xf47a65['offset']+_0xf47a65[_0xfc5c('0x1e')];var _0x2660fc;if(_0x4681b5>=_0x2cf2f4){_0x4681b5=_0x2cf2f4;_0x2660fc=0xc8;}else{_0x2660fc=0xce;}_0x5897b0[_0xfc5c('0x19')](_0x2660fc);return _0x5897b0[_0xfc5c('0x1f')](_0xfc5c('0x20'),_0xedb735+'-'+_0x4681b5+'/'+_0x2cf2f4)[_0xfc5c('0x21')](_0x7ea999);}return null;};}function patchUpdates(_0x54d55a){return function(_0x1456fb){try{jsonpatch[_0xfc5c('0x22')](_0x1456fb,_0x54d55a,!![]);}catch(_0x1e4d58){return BPromise['reject'](_0x1e4d58);}return _0x1456fb[_0xfc5c('0x23')]();};}function saveUpdates(_0xbe60ad,_0x58a6f4){return function(_0x209758){if(_0x209758){return _0x209758[_0xfc5c('0x24')](_0xbe60ad)[_0xfc5c('0x25')](function(_0x47b0e4){return _0x47b0e4;});}return null;};}function removeEntity(_0x1743b7,_0x1847cc){return function(_0x32fa85){if(_0x32fa85){return _0x32fa85[_0xfc5c('0x26')]()['then'](function(){_0x1743b7[_0xfc5c('0x19')](0xcc)[_0xfc5c('0x1a')]();});}};}function handleEntityNotFound(_0x3bfd76,_0x47d37c){return function(_0x59eac1){if(!_0x59eac1){_0x3bfd76['sendStatus'](0x194);}return _0x59eac1;};}function handleError(_0x4f06c8,_0x933601){_0x933601=_0x933601||0x1f4;return function(_0x5ed289){logger[_0xfc5c('0x27')](_0x5ed289['stack']);if(_0x5ed289[_0xfc5c('0x28')]){delete _0x5ed289[_0xfc5c('0x28')];}_0x4f06c8[_0xfc5c('0x19')](_0x933601)['send'](_0x5ed289);};}exports[_0xfc5c('0x29')]=function(_0x38d52c,_0xe8232b){var _0x26e061={},_0x10cd3e={},_0x2408ba={'count':0x0,'rows':[]};var _0x2c7a70=_[_0xfc5c('0x2a')](db['ServicenowField'][_0xfc5c('0x2b')],function(_0x42d4b7){return{'name':_0x42d4b7['fieldName'],'type':_0x42d4b7[_0xfc5c('0x2c')][_0xfc5c('0x2d')]};});_0x10cd3e[_0xfc5c('0x2e')]=_[_0xfc5c('0x2a')](_0x2c7a70,_0xfc5c('0x28'));_0x10cd3e[_0xfc5c('0x2f')]=_[_0xfc5c('0x30')](_0x38d52c[_0xfc5c('0x2f')]);_0x10cd3e[_0xfc5c('0x31')]=_[_0xfc5c('0x32')](_0x10cd3e[_0xfc5c('0x2e')],_0x10cd3e[_0xfc5c('0x2f')]);_0x26e061[_0xfc5c('0x33')]=_[_0xfc5c('0x32')](_0x10cd3e[_0xfc5c('0x2e')],qs[_0xfc5c('0x34')](_0x38d52c[_0xfc5c('0x2f')]['fields']));_0x26e061[_0xfc5c('0x33')]=_0x26e061[_0xfc5c('0x33')][_0xfc5c('0x35')]?_0x26e061['attributes']:_0x10cd3e[_0xfc5c('0x2e')];if(!_0x38d52c[_0xfc5c('0x2f')][_0xfc5c('0x36')](_0xfc5c('0x37'))){_0x26e061['limit']=qs[_0xfc5c('0x1e')](_0x38d52c[_0xfc5c('0x2f')][_0xfc5c('0x1e')]);_0x26e061[_0xfc5c('0x1b')]=qs[_0xfc5c('0x1b')](_0x38d52c[_0xfc5c('0x2f')]['offset']);}_0x26e061[_0xfc5c('0x38')]=qs['sort'](_0x38d52c[_0xfc5c('0x2f')][_0xfc5c('0x39')]);_0x26e061[_0xfc5c('0x3a')]=qs['filters'](_[_0xfc5c('0x3b')](_0x38d52c['query'],_0x10cd3e[_0xfc5c('0x31')]),_0x2c7a70);if(_0x38d52c[_0xfc5c('0x2f')]['filter']){_0x26e061[_0xfc5c('0x3a')]=_[_0xfc5c('0x3c')](_0x26e061['where'],{'$or':_['map'](_0x2c7a70,function(_0xc3f532){if(_0xc3f532['type']!=='VIRTUAL'){var _0x1686fb={};_0x1686fb[_0xc3f532[_0xfc5c('0x28')]]={'$like':'%'+_0x38d52c['query']['filter']+'%'};return _0x1686fb;}})});}_0x26e061=_['merge']({},_0x26e061,_0x38d52c[_0xfc5c('0x3d')]);var _0x253802={'where':_0x26e061[_0xfc5c('0x3a')]};return db['ServicenowField'][_0xfc5c('0x1d')](_0x253802)[_0xfc5c('0x25')](function(_0x5a1dcd){_0x2408ba[_0xfc5c('0x1d')]=_0x5a1dcd;if(_0x38d52c['query'][_0xfc5c('0x3e')]){_0x26e061[_0xfc5c('0x3f')]=[{'all':!![]}];}return db[_0xfc5c('0x40')][_0xfc5c('0x41')](_0x26e061);})['then'](function(_0x422360){_0x2408ba['rows']=_0x422360;return _0x2408ba;})[_0xfc5c('0x25')](respondWithFilteredResult(_0xe8232b,_0x26e061))[_0xfc5c('0x42')](handleError(_0xe8232b,null));};exports[_0xfc5c('0x43')]=function(_0x581818,_0x28f412){var _0x588f6d={'raw':!![],'where':{'id':_0x581818[_0xfc5c('0x44')]['id']}},_0xf2d4a4={};_0xf2d4a4['model']=_[_0xfc5c('0x30')](db[_0xfc5c('0x40')][_0xfc5c('0x2b')]);_0xf2d4a4['query']=_[_0xfc5c('0x30')](_0x581818[_0xfc5c('0x2f')]);_0xf2d4a4[_0xfc5c('0x31')]=_[_0xfc5c('0x32')](_0xf2d4a4[_0xfc5c('0x2e')],_0xf2d4a4[_0xfc5c('0x2f')]);_0x588f6d[_0xfc5c('0x33')]=_[_0xfc5c('0x32')](_0xf2d4a4['model'],qs[_0xfc5c('0x34')](_0x581818[_0xfc5c('0x2f')][_0xfc5c('0x34')]));_0x588f6d[_0xfc5c('0x33')]=_0x588f6d['attributes'][_0xfc5c('0x35')]?_0x588f6d[_0xfc5c('0x33')]:_0xf2d4a4[_0xfc5c('0x2e')];if(_0x581818[_0xfc5c('0x2f')][_0xfc5c('0x3e')]){_0x588f6d[_0xfc5c('0x3f')]=[{'all':!![]}];}_0x588f6d=_['merge']({},_0x588f6d,_0x581818[_0xfc5c('0x3d')]);return db['ServicenowField'][_0xfc5c('0x45')](_0x588f6d)[_0xfc5c('0x25')](handleEntityNotFound(_0x28f412,null))[_0xfc5c('0x25')](respondWithResult(_0x28f412,null))['catch'](handleError(_0x28f412,null));};exports[_0xfc5c('0x46')]=function(_0x48d5eb,_0x47106e){return db['ServicenowField'][_0xfc5c('0x46')](_0x48d5eb[_0xfc5c('0x47')],{})[_0xfc5c('0x25')](respondWithResult(_0x47106e,0xc9))[_0xfc5c('0x42')](handleError(_0x47106e,null));};exports['update']=function(_0x1a123b,_0x163281){if(_0x1a123b['body']['id']){delete _0x1a123b[_0xfc5c('0x47')]['id'];}return db[_0xfc5c('0x40')][_0xfc5c('0x45')]({'where':{'id':_0x1a123b[_0xfc5c('0x44')]['id']}})[_0xfc5c('0x25')](handleEntityNotFound(_0x163281,null))['then'](saveUpdates(_0x1a123b['body'],null))[_0xfc5c('0x25')](respondWithResult(_0x163281,null))['catch'](handleError(_0x163281,null));};exports['destroy']=function(_0x343b01,_0x4cfab3){return db[_0xfc5c('0x40')][_0xfc5c('0x45')]({'where':{'id':_0x343b01[_0xfc5c('0x44')]['id']}})[_0xfc5c('0x25')](handleEntityNotFound(_0x4cfab3,null))[_0xfc5c('0x25')](removeEntity(_0x4cfab3,null))['catch'](handleError(_0x4cfab3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 7e09fa5..f93fcfd 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 _0x117a=['moment','request-promise','rimraf','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0x117a,0x80));var _0xa117=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0x117a[_0x35a140];return _0x30ab82;};'use strict';var _=require(_0xa117('0x0'));var util=require(_0xa117('0x1'));var logger=require(_0xa117('0x2'))(_0xa117('0x3'));var moment=require(_0xa117('0x4'));var BPromise=require('bluebird');var rp=require(_0xa117('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa117('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0xa117('0x7')]=function(_0x52a102,_0x13924c){return _0x52a102['define'](_0xa117('0x8'),attributes,{'tableName':_0xa117('0x9'),'paranoid':![],'indexes':[{'name':_0xa117('0xa'),'fields':['idField',_0xa117('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a7c=['servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','ServicenowField'];(function(_0x79ecea,_0x51ae0c){var _0x3974a7=function(_0x595282){while(--_0x595282){_0x79ecea['push'](_0x79ecea['shift']());}};_0x3974a7(++_0x51ae0c);}(_0x7a7c,0xb6));var _0xc7a7=function(_0x331d26,_0x18e069){_0x331d26=_0x331d26-0x0;var _0x3f9959=_0x7a7c[_0x331d26];return _0x3f9959;};'use strict';var _=require(_0xc7a7('0x0'));var util=require(_0xc7a7('0x1'));var logger=require(_0xc7a7('0x2'))(_0xc7a7('0x3'));var moment=require(_0xc7a7('0x4'));var BPromise=require(_0xc7a7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7a7('0x6'));var rimraf=require(_0xc7a7('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0xc7a7('0x8')]=function(_0x112792,_0xe4039d){return _0x112792['define'](_0xc7a7('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xc7a7('0xa'),'fields':[_0xc7a7('0xb'),'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 afaf749..fb88d64 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 _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x503046,_0x5471e8){var _0x6ee761=function(_0x5777e1){while(--_0x5777e1){_0x503046['push'](_0x503046['shift']());}};_0x6ee761(++_0x5471e8);}(_0xe706,0xa3));var _0x6e70=function(_0x204a28,_0x359c57){_0x204a28=_0x204a28-0x0;var _0x2d8e3d=_0xe706[_0x204a28];return _0x2d8e3d;};'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']('ServicenowField,\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']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +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(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xac4a,0x13f));var _0xaac4=function(_0x66084b,_0x32d4dd){_0x66084b=_0x66084b-0x0;var _0xb04b2f=_0xac4a[_0x66084b];return _0xb04b2f;};'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 diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index ab39bc3..8786d59 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(_0x496bb5,_0x3c4280){var _0xf6c618=function(_0x1fd145){while(--_0x1fd145){_0x496bb5['push'](_0x496bb5['shift']());}};_0xf6c618(++_0x3c4280);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _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(_0x3bf93b,_0x3aa6bd){var _0x242a01=function(_0x36a436){while(--_0x36a436){_0x3bf93b['push'](_0x3bf93b['shift']());}};_0x242a01(++_0x3aa6bd);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 27a1ad8..395b35d 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(_0x34ec79,_0x3e9b74){var _0x189669=function(_0x20e481){while(--_0x20e481){_0x34ec79['push'](_0x34ec79['shift']());}};_0x189669(++_0x3e9b74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x254508,_0x5592c1){var _0x4ca20b=function(_0x16ffb3){while(--_0x16ffb3){_0x254508['push'](_0x254508['shift']());}};_0x4ca20b(++_0x5592c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 3d2f157..73cf8ed 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 _0xaee0=['parent_id','parent_type','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','values','module_fields','remove','includes','endsWith','value','test','statusCode','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','catch','show','params','find','create','body','getConfigurations','SugarcrmConfiguration','filter','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','duration_hours'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0xaee0,0x184));var _0x0aee=function(_0x3c86dc,_0x5d22fc){_0x3c86dc=_0x3c86dc-0x0;var _0x4aeb79=_0xaee0[_0x3c86dc];return _0x4aeb79;};'use strict';var emlformat=require(_0x0aee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0aee('0x1'));var jsonpatch=require(_0x0aee('0x2'));var rp=require(_0x0aee('0x3'));var moment=require('moment');var BPromise=require(_0x0aee('0x4'));var Mustache=require(_0x0aee('0x5'));var util=require(_0x0aee('0x6'));var path=require(_0x0aee('0x7'));var sox=require(_0x0aee('0x8'));var csv=require(_0x0aee('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0aee('0xa'));var squel=require(_0x0aee('0xb'));var crypto=require(_0x0aee('0xc'));var jsforce=require(_0x0aee('0xd'));var deskjs=require(_0x0aee('0xe'));var toCsv=require(_0x0aee('0x9'));var querystring=require(_0x0aee('0xf'));var Papa=require(_0x0aee('0x10'));var Redis=require(_0x0aee('0x11'));var authService=require(_0x0aee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0aee('0x13'));var hardwareService=require(_0x0aee('0x14'));var logger=require(_0x0aee('0x15'))(_0x0aee('0x16'));var utils=require(_0x0aee('0x17'));var config=require(_0x0aee('0x18'));var licenseUtil=require(_0x0aee('0x19'));var db=require(_0x0aee('0x1a'))['db'];var integrations=require(_0x0aee('0x1b'));function respondWithStatusCode(_0x1f6684,_0x444922){_0x444922=_0x444922||0xcc;return function(_0x2c934e){if(_0x2c934e){return _0x1f6684[_0x0aee('0x1c')](_0x444922);}return _0x1f6684['status'](_0x444922)[_0x0aee('0x1d')]();};}function respondWithResult(_0x45bfb2,_0x392ec9){_0x392ec9=_0x392ec9||0xc8;return function(_0x3ac443){if(_0x3ac443){return _0x45bfb2[_0x0aee('0x1e')](_0x392ec9)['json'](_0x3ac443);}};}function respondWithFilteredResult(_0x108ec8,_0x85e437){return function(_0x24cd89){if(_0x24cd89){var _0x3a8816=typeof _0x85e437['offset']===_0x0aee('0x1f')&&typeof _0x85e437['limit']===_0x0aee('0x1f');var _0x6b7721=_0x24cd89[_0x0aee('0x20')];var _0x1e183f=_0x3a8816?0x0:_0x85e437['offset'];var _0x4ec096=_0x3a8816?_0x24cd89[_0x0aee('0x20')]:_0x85e437[_0x0aee('0x21')]+_0x85e437[_0x0aee('0x22')];var _0x2bd99b;if(_0x4ec096>=_0x6b7721){_0x4ec096=_0x6b7721;_0x2bd99b=0xc8;}else{_0x2bd99b=0xce;}_0x108ec8['status'](_0x2bd99b);return _0x108ec8[_0x0aee('0x23')](_0x0aee('0x24'),_0x1e183f+'-'+_0x4ec096+'/'+_0x6b7721)[_0x0aee('0x25')](_0x24cd89);}return null;};}function patchUpdates(_0x35aa88){return function(_0x2d0fc7){try{jsonpatch[_0x0aee('0x26')](_0x2d0fc7,_0x35aa88,!![]);}catch(_0xf57cc4){return BPromise[_0x0aee('0x27')](_0xf57cc4);}return _0x2d0fc7[_0x0aee('0x28')]();};}function saveUpdates(_0x453bfb,_0x1e6ee8){return function(_0x4280f1){if(_0x4280f1){return _0x4280f1[_0x0aee('0x29')](_0x453bfb)[_0x0aee('0x2a')](function(_0x254650){return _0x254650;});}return null;};}function removeEntity(_0x357976,_0x31e26a){return function(_0x29c70c){if(_0x29c70c){return _0x29c70c[_0x0aee('0x2b')]()['then'](function(){_0x357976[_0x0aee('0x1e')](0xcc)[_0x0aee('0x1d')]();});}};}function handleEntityNotFound(_0x3b7ac7,_0x4d90a1){return function(_0x3501e1){if(!_0x3501e1){_0x3b7ac7['sendStatus'](0x194);}return _0x3501e1;};}function handleError(_0x294f72,_0x24d136){_0x24d136=_0x24d136||0x1f4;return function(_0x2496a4){logger['error'](_0x2496a4['stack']);if(_0x2496a4[_0x0aee('0x2c')]){delete _0x2496a4[_0x0aee('0x2c')];}_0x294f72['status'](_0x24d136)[_0x0aee('0x2d')](_0x2496a4);};}exports[_0x0aee('0x2e')]=function(_0x3e1c30,_0x229444){var _0x559267={},_0x4308b4={},_0x18d575={'count':0x0,'rows':[]};var _0x4e0d09=_[_0x0aee('0x2f')](db[_0x0aee('0x30')][_0x0aee('0x31')],function(_0x46f066){return{'name':_0x46f066[_0x0aee('0x32')],'type':_0x46f066[_0x0aee('0x33')][_0x0aee('0x34')]};});_0x4308b4[_0x0aee('0x35')]=_[_0x0aee('0x2f')](_0x4e0d09,'name');_0x4308b4[_0x0aee('0x36')]=_[_0x0aee('0x37')](_0x3e1c30[_0x0aee('0x36')]);_0x4308b4[_0x0aee('0x38')]=_['intersection'](_0x4308b4[_0x0aee('0x35')],_0x4308b4[_0x0aee('0x36')]);_0x559267[_0x0aee('0x39')]=_[_0x0aee('0x3a')](_0x4308b4[_0x0aee('0x35')],qs[_0x0aee('0x3b')](_0x3e1c30['query']['fields']));_0x559267[_0x0aee('0x39')]=_0x559267[_0x0aee('0x39')][_0x0aee('0x3c')]?_0x559267['attributes']:_0x4308b4[_0x0aee('0x35')];if(!_0x3e1c30[_0x0aee('0x36')][_0x0aee('0x3d')](_0x0aee('0x3e'))){_0x559267['limit']=qs[_0x0aee('0x22')](_0x3e1c30[_0x0aee('0x36')]['limit']);_0x559267['offset']=qs[_0x0aee('0x21')](_0x3e1c30[_0x0aee('0x36')][_0x0aee('0x21')]);}_0x559267[_0x0aee('0x3f')]=qs[_0x0aee('0x40')](_0x3e1c30[_0x0aee('0x36')][_0x0aee('0x40')]);_0x559267[_0x0aee('0x41')]=qs[_0x0aee('0x38')](_[_0x0aee('0x42')](_0x3e1c30[_0x0aee('0x36')],_0x4308b4[_0x0aee('0x38')]),_0x4e0d09);if(_0x3e1c30[_0x0aee('0x36')]['filter']){_0x559267[_0x0aee('0x41')]=_[_0x0aee('0x43')](_0x559267['where'],{'$or':_[_0x0aee('0x2f')](_0x4e0d09,function(_0x2ff0ed){if(_0x2ff0ed[_0x0aee('0x33')]!=='VIRTUAL'){var _0x30eba6={};_0x30eba6[_0x2ff0ed[_0x0aee('0x2c')]]={'$like':'%'+_0x3e1c30[_0x0aee('0x36')]['filter']+'%'};return _0x30eba6;}})});}_0x559267=_[_0x0aee('0x43')]({},_0x559267,_0x3e1c30[_0x0aee('0x44')]);var _0xff8047={'where':_0x559267[_0x0aee('0x41')]};return db[_0x0aee('0x30')][_0x0aee('0x20')](_0xff8047)[_0x0aee('0x2a')](function(_0x4a1338){_0x18d575[_0x0aee('0x20')]=_0x4a1338;if(_0x3e1c30['query'][_0x0aee('0x45')]){_0x559267[_0x0aee('0x46')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x559267);})['then'](function(_0x522be5){_0x18d575['rows']=_0x522be5;return _0x18d575;})[_0x0aee('0x2a')](respondWithFilteredResult(_0x229444,_0x559267))[_0x0aee('0x47')](handleError(_0x229444,null));};exports[_0x0aee('0x48')]=function(_0x4e9875,_0x4012e7){var _0x404fa5={'raw':![],'where':{'id':_0x4e9875[_0x0aee('0x49')]['id']}},_0x399108={};_0x399108[_0x0aee('0x35')]=_[_0x0aee('0x37')](db[_0x0aee('0x30')][_0x0aee('0x31')]);_0x399108[_0x0aee('0x36')]=_[_0x0aee('0x37')](_0x4e9875[_0x0aee('0x36')]);_0x399108[_0x0aee('0x38')]=_[_0x0aee('0x3a')](_0x399108[_0x0aee('0x35')],_0x399108[_0x0aee('0x36')]);_0x404fa5[_0x0aee('0x39')]=_[_0x0aee('0x3a')](_0x399108[_0x0aee('0x35')],qs[_0x0aee('0x3b')](_0x4e9875[_0x0aee('0x36')][_0x0aee('0x3b')]));_0x404fa5[_0x0aee('0x39')]=_0x404fa5[_0x0aee('0x39')]['length']?_0x404fa5[_0x0aee('0x39')]:_0x399108['model'];if(_0x4e9875['query'][_0x0aee('0x45')]){_0x404fa5[_0x0aee('0x46')]=[{'all':!![]}];}_0x404fa5=_[_0x0aee('0x43')]({},_0x404fa5,_0x4e9875[_0x0aee('0x44')]);return db[_0x0aee('0x30')][_0x0aee('0x4a')](_0x404fa5)[_0x0aee('0x2a')](handleEntityNotFound(_0x4012e7,null))['then'](respondWithResult(_0x4012e7,null))[_0x0aee('0x47')](handleError(_0x4012e7,null));};exports[_0x0aee('0x4b')]=function(_0x15ea8b,_0x36cc4b){return db[_0x0aee('0x30')][_0x0aee('0x4b')](_0x15ea8b[_0x0aee('0x4c')],{})[_0x0aee('0x2a')](respondWithResult(_0x36cc4b,0xc9))[_0x0aee('0x47')](handleError(_0x36cc4b,null));};exports[_0x0aee('0x29')]=function(_0x1a273e,_0xbd5a09){if(_0x1a273e[_0x0aee('0x4c')]['id']){delete _0x1a273e[_0x0aee('0x4c')]['id'];}return db[_0x0aee('0x30')][_0x0aee('0x4a')]({'where':{'id':_0x1a273e[_0x0aee('0x49')]['id']}})['then'](handleEntityNotFound(_0xbd5a09,null))[_0x0aee('0x2a')](saveUpdates(_0x1a273e['body'],null))[_0x0aee('0x2a')](respondWithResult(_0xbd5a09,null))[_0x0aee('0x47')](handleError(_0xbd5a09,null));};exports[_0x0aee('0x2b')]=function(_0x5973d4,_0x4a8986){return db[_0x0aee('0x30')][_0x0aee('0x4a')]({'where':{'id':_0x5973d4[_0x0aee('0x49')]['id']}})[_0x0aee('0x2a')](handleEntityNotFound(_0x4a8986,null))[_0x0aee('0x2a')](removeEntity(_0x4a8986,null))['catch'](handleError(_0x4a8986,null));};exports[_0x0aee('0x4d')]=function(_0x30566c,_0x5cbe3e,_0x19636d){var _0x25face={};var _0x57fad0={};var _0x23d34f;var _0x3e4a28;return db[_0x0aee('0x30')]['findOne']({'where':{'id':_0x30566c[_0x0aee('0x49')]['id']}})[_0x0aee('0x2a')](handleEntityNotFound(_0x5cbe3e,null))['then'](function(_0x292416){if(_0x292416){_0x23d34f=_0x292416;_0x57fad0[_0x0aee('0x35')]=_[_0x0aee('0x37')](db[_0x0aee('0x4e')][_0x0aee('0x31')]);_0x57fad0[_0x0aee('0x36')]=_['keys'](_0x30566c[_0x0aee('0x36')]);_0x57fad0[_0x0aee('0x38')]=_[_0x0aee('0x3a')](_0x57fad0['model'],_0x57fad0[_0x0aee('0x36')]);_0x25face[_0x0aee('0x39')]=_[_0x0aee('0x3a')](_0x57fad0['model'],qs[_0x0aee('0x3b')](_0x30566c[_0x0aee('0x36')][_0x0aee('0x3b')]));_0x25face[_0x0aee('0x39')]=_0x25face['attributes'][_0x0aee('0x3c')]?_0x25face[_0x0aee('0x39')]:_0x57fad0[_0x0aee('0x35')];_0x25face[_0x0aee('0x3f')]=qs[_0x0aee('0x40')](_0x30566c[_0x0aee('0x36')][_0x0aee('0x40')]);_0x25face[_0x0aee('0x41')]=qs['filters'](_[_0x0aee('0x42')](_0x30566c[_0x0aee('0x36')],_0x57fad0[_0x0aee('0x38')]));if(_0x30566c[_0x0aee('0x36')][_0x0aee('0x4f')]){_0x25face['where']=_[_0x0aee('0x43')](_0x25face[_0x0aee('0x41')],{'$or':_[_0x0aee('0x2f')](_0x25face[_0x0aee('0x39')],function(_0x1b20e4){var _0x25a099={};_0x25a099[_0x1b20e4]={'$like':'%'+_0x30566c[_0x0aee('0x36')]['filter']+'%'};return _0x25a099;})});}_0x25face=_[_0x0aee('0x43')]({},_0x25face,_0x30566c[_0x0aee('0x44')]);return _0x23d34f[_0x0aee('0x4d')](_0x25face);}})[_0x0aee('0x2a')](function(_0xb351ba){if(_0xb351ba){_0x3e4a28=_0xb351ba['length'];if(!_0x30566c[_0x0aee('0x36')][_0x0aee('0x3d')](_0x0aee('0x3e'))){_0x25face['limit']=qs[_0x0aee('0x22')](_0x30566c[_0x0aee('0x36')][_0x0aee('0x22')]);_0x25face['offset']=qs[_0x0aee('0x21')](_0x30566c[_0x0aee('0x36')]['offset']);}return _0x23d34f['getConfigurations'](_0x25face);}})[_0x0aee('0x2a')](function(_0x3d335d){if(_0x3d335d){return _0x3d335d?{'count':_0x3e4a28,'rows':_0x3d335d}:null;}})[_0x0aee('0x2a')](respondWithResult(_0x5cbe3e,null))['catch'](handleError(_0x5cbe3e,null));};exports['addConfiguration']=function(_0x2d2194,_0x510081,_0x398b39){if(_0x2d2194[_0x0aee('0x4c')]['id']){delete _0x2d2194[_0x0aee('0x4c')]['id'];}return db[_0x0aee('0x30')][_0x0aee('0x50')]({'where':{'id':_0x2d2194[_0x0aee('0x49')]['id']}})[_0x0aee('0x2a')](handleEntityNotFound(_0x510081,null))[_0x0aee('0x2a')](function(_0x1b87de){if(_0x1b87de){_0x2d2194[_0x0aee('0x4c')][_0x0aee('0x51')]=_0x1b87de['id'];_0x2d2194[_0x0aee('0x4c')][_0x0aee('0x52')]=integrations[_0x0aee('0x53')](_0x2d2194['body'][_0x0aee('0x54')],_0x2d2194[_0x0aee('0x4c')][_0x0aee('0x33')]);_0x2d2194['body'][_0x0aee('0x55')]=integrations[_0x0aee('0x56')](_0x2d2194['body'][_0x0aee('0x54')],_0x2d2194[_0x0aee('0x4c')][_0x0aee('0x33')]);return db[_0x0aee('0x4e')]['create'](_0x2d2194[_0x0aee('0x4c')],{'include':[{'model':db[_0x0aee('0x57')],'as':_0x0aee('0x52')},{'model':db[_0x0aee('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x510081,null))[_0x0aee('0x47')](handleError(_0x510081,null));};exports[_0x0aee('0x58')]=function(_0x4765a5,_0x42f24d,_0x5b0418){var _0x22a5c7='';var _0x406968=['id',_0x0aee('0x2c'),_0x0aee('0x59'),_0x0aee('0x5a'),'description','date_start',_0x0aee('0x5b'),'duration_minutes',_0x0aee('0x5c'),_0x0aee('0x5d'),_0x0aee('0x5e'),'direction'];return db[_0x0aee('0x30')]['findOne']({'where':{'id':_0x4765a5['params']['id']},'attributes':['id',_0x0aee('0x5f'),_0x0aee('0x60'),'remoteUri']})[_0x0aee('0x2a')](handleEntityNotFound(_0x42f24d,null))[_0x0aee('0x2a')](function(_0x5a5609){if(_0x5a5609){_0x22a5c7=_0x5a5609[_0x0aee('0x61')];var _0x4c5901=_0x22a5c7[_0x0aee('0x62')](-0x1);if(_0x4c5901==='/'){_0x22a5c7=_0x22a5c7[_0x0aee('0x63')](0x0,_0x22a5c7[_0x0aee('0x64')](_0x4c5901));}return rp({'method':_0x0aee('0x65'),'uri':util[_0x0aee('0x66')](_0x0aee('0x67'),_0x22a5c7,_0x0aee('0x68')),'json':!![],'form':{'method':'login','input_type':_0x0aee('0x69'),'response_type':_0x0aee('0x69'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5a5609['username'],'password':_0x5a5609['password'],'encryption':_0x0aee('0x6a')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x0aee('0x2a')](function(_0x182f6b){if(_0x182f6b&&_0x182f6b[_0x0aee('0x2c')]!==_0x0aee('0x6b')&&_0x182f6b[_0x0aee('0x2c')]!==_0x0aee('0x6c')){return rp({'method':'POST','uri':util[_0x0aee('0x66')](_0x0aee('0x67'),_0x22a5c7,_0x0aee('0x68')),'json':!![],'form':{'method':_0x0aee('0x6d'),'input_type':_0x0aee('0x69'),'response_type':_0x0aee('0x69'),'rest_data':JSON['stringify']({'session':_0x182f6b['id'],'module_name':'Calls'})}})[_0x0aee('0x2a')](function(_0x1a7a68){if(_0x1a7a68){var _0x46b1ae=_[_0x0aee('0x6e')](_0x1a7a68[_0x0aee('0x6f')]);_[_0x0aee('0x70')](_0x46b1ae,function(_0xcb1769){return _0x406968[_0x0aee('0x71')](_0xcb1769['name']);});return{'count':_0x46b1ae[_0x0aee('0x3c')],'rows':_['map'](_0x46b1ae,function(_0x2f9a00){return{'id':_0x2f9a00[_0x0aee('0x2c')],'name':_0x2f9a00['label'],'custom':_[_0x0aee('0x72')](_0x2f9a00[_0x0aee('0x2c')],'_c')?!![]:![],'options':_0x2f9a00[_0x0aee('0x44')]?_['map'](_[_0x0aee('0x6e')](_0x2f9a00['options']),function(_0x30d081){return{'name':_0x30d081[_0x0aee('0x73')],'value':_0x30d081[_0x0aee('0x2c')]};}):[]};})};}})[_0x0aee('0x2a')](respondWithResult(_0x42f24d,null))[_0x0aee('0x47')](function(_0x1973fe){var _0xc2ba56=_0x4765a5[_0x0aee('0x36')][_0x0aee('0x74')]?0x1f4:_0x1973fe[_0x0aee('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x0aee('0x58'),_0xc2ba56,JSON[_0x0aee('0x76')](_0x1973fe));delete _0x1973fe['name'];if(_0xc2ba56===0x191){_0xc2ba56=0x190;}_0x42f24d[_0x0aee('0x1e')](_0xc2ba56)[_0x0aee('0x2d')](_0x4765a5[_0x0aee('0x36')][_0x0aee('0x74')]?{'message':_0x0aee('0x77'),'statusCode':_0x1973fe[_0x0aee('0x75')]}:_0x1973fe);});}else{var _0x1e478a=0x1f4;_0x42f24d[_0x0aee('0x1e')](_0x1e478a)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xda73=['JSON','PLAIN','Password\x20Expired','stringify','Calls','remove','includes','endsWith','values','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','offset','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','date_start','duration_hours','duration_minutes','parent_name','direction','username','password','remoteUri','slice','POST','format','%s%s','/service/v4_1/rest.php'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xda73,0x160));var _0x3da7=function(_0x18d1d3,_0x238863){_0x18d1d3=_0x18d1d3-0x0;var _0x3287d6=_0xda73[_0x18d1d3];return _0x3287d6;};'use strict';var emlformat=require(_0x3da7('0x0'));var rimraf=require(_0x3da7('0x1'));var zipdir=require(_0x3da7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3da7('0x3'));var BPromise=require(_0x3da7('0x4'));var Mustache=require(_0x3da7('0x5'));var util=require(_0x3da7('0x6'));var path=require(_0x3da7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3da7('0x8'));var _=require(_0x3da7('0x9'));var squel=require(_0x3da7('0xa'));var crypto=require(_0x3da7('0xb'));var jsforce=require(_0x3da7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3da7('0xd'));var querystring=require(_0x3da7('0xe'));var Papa=require('papaparse');var Redis=require(_0x3da7('0xf'));var authService=require(_0x3da7('0x10'));var qs=require(_0x3da7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3da7('0x12'));var logger=require(_0x3da7('0x13'))(_0x3da7('0x14'));var utils=require(_0x3da7('0x15'));var config=require(_0x3da7('0x16'));var licenseUtil=require(_0x3da7('0x17'));var db=require(_0x3da7('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x336bbd,_0x2d30d8){_0x2d30d8=_0x2d30d8||0xcc;return function(_0x2d0229){if(_0x2d0229){return _0x336bbd[_0x3da7('0x19')](_0x2d30d8);}return _0x336bbd['status'](_0x2d30d8)[_0x3da7('0x1a')]();};}function respondWithResult(_0x3ada21,_0xed7354){_0xed7354=_0xed7354||0xc8;return function(_0x4e2c83){if(_0x4e2c83){return _0x3ada21[_0x3da7('0x1b')](_0xed7354)[_0x3da7('0x1c')](_0x4e2c83);}};}function respondWithFilteredResult(_0x550275,_0x4f93c7){return function(_0xf4b9ba){if(_0xf4b9ba){var _0xce073d=typeof _0x4f93c7['offset']==='undefined'&&typeof _0x4f93c7[_0x3da7('0x1d')]===_0x3da7('0x1e');var _0x53c797=_0xf4b9ba['count'];var _0x1e9318=_0xce073d?0x0:_0x4f93c7[_0x3da7('0x1f')];var _0xa1b955=_0xce073d?_0xf4b9ba[_0x3da7('0x20')]:_0x4f93c7[_0x3da7('0x1f')]+_0x4f93c7['limit'];var _0x34db6c;if(_0xa1b955>=_0x53c797){_0xa1b955=_0x53c797;_0x34db6c=0xc8;}else{_0x34db6c=0xce;}_0x550275[_0x3da7('0x1b')](_0x34db6c);return _0x550275[_0x3da7('0x21')](_0x3da7('0x22'),_0x1e9318+'-'+_0xa1b955+'/'+_0x53c797)[_0x3da7('0x1c')](_0xf4b9ba);}return null;};}function patchUpdates(_0x2aecd9){return function(_0xb629e8){try{jsonpatch[_0x3da7('0x23')](_0xb629e8,_0x2aecd9,!![]);}catch(_0x362922){return BPromise['reject'](_0x362922);}return _0xb629e8[_0x3da7('0x24')]();};}function saveUpdates(_0x5868b4,_0x2320a9){return function(_0x4e901f){if(_0x4e901f){return _0x4e901f[_0x3da7('0x25')](_0x5868b4)[_0x3da7('0x26')](function(_0x1dfdf2){return _0x1dfdf2;});}return null;};}function removeEntity(_0x21eef6,_0x1cba93){return function(_0x415503){if(_0x415503){return _0x415503['destroy']()[_0x3da7('0x26')](function(){_0x21eef6[_0x3da7('0x1b')](0xcc)[_0x3da7('0x1a')]();});}};}function handleEntityNotFound(_0x5f1325,_0x378a4a){return function(_0x183c5a){if(!_0x183c5a){_0x5f1325[_0x3da7('0x19')](0x194);}return _0x183c5a;};}function handleError(_0x414949,_0x11d550){_0x11d550=_0x11d550||0x1f4;return function(_0xbed95b){logger[_0x3da7('0x27')](_0xbed95b[_0x3da7('0x28')]);if(_0xbed95b[_0x3da7('0x29')]){delete _0xbed95b[_0x3da7('0x29')];}_0x414949[_0x3da7('0x1b')](_0x11d550)[_0x3da7('0x2a')](_0xbed95b);};}exports[_0x3da7('0x2b')]=function(_0x19d15c,_0x892370){var _0x48009b={},_0x3058f0={},_0x135a14={'count':0x0,'rows':[]};var _0x53423f=_[_0x3da7('0x2c')](db[_0x3da7('0x2d')][_0x3da7('0x2e')],function(_0x810059){return{'name':_0x810059['fieldName'],'type':_0x810059[_0x3da7('0x2f')][_0x3da7('0x30')]};});_0x3058f0[_0x3da7('0x31')]=_['map'](_0x53423f,_0x3da7('0x29'));_0x3058f0['query']=_[_0x3da7('0x32')](_0x19d15c[_0x3da7('0x33')]);_0x3058f0[_0x3da7('0x34')]=_['intersection'](_0x3058f0['model'],_0x3058f0['query']);_0x48009b[_0x3da7('0x35')]=_[_0x3da7('0x36')](_0x3058f0[_0x3da7('0x31')],qs[_0x3da7('0x37')](_0x19d15c[_0x3da7('0x33')][_0x3da7('0x37')]));_0x48009b[_0x3da7('0x35')]=_0x48009b[_0x3da7('0x35')][_0x3da7('0x38')]?_0x48009b[_0x3da7('0x35')]:_0x3058f0['model'];if(!_0x19d15c[_0x3da7('0x33')][_0x3da7('0x39')](_0x3da7('0x3a'))){_0x48009b[_0x3da7('0x1d')]=qs[_0x3da7('0x1d')](_0x19d15c['query'][_0x3da7('0x1d')]);_0x48009b[_0x3da7('0x1f')]=qs[_0x3da7('0x1f')](_0x19d15c[_0x3da7('0x33')]['offset']);}_0x48009b[_0x3da7('0x3b')]=qs['sort'](_0x19d15c[_0x3da7('0x33')][_0x3da7('0x3c')]);_0x48009b[_0x3da7('0x3d')]=qs['filters'](_[_0x3da7('0x3e')](_0x19d15c['query'],_0x3058f0[_0x3da7('0x34')]),_0x53423f);if(_0x19d15c['query']['filter']){_0x48009b['where']=_['merge'](_0x48009b[_0x3da7('0x3d')],{'$or':_[_0x3da7('0x2c')](_0x53423f,function(_0x2134e2){if(_0x2134e2[_0x3da7('0x2f')]!==_0x3da7('0x3f')){var _0x4c7f91={};_0x4c7f91[_0x2134e2[_0x3da7('0x29')]]={'$like':'%'+_0x19d15c['query'][_0x3da7('0x40')]+'%'};return _0x4c7f91;}})});}_0x48009b=_[_0x3da7('0x41')]({},_0x48009b,_0x19d15c[_0x3da7('0x42')]);var _0x11a200={'where':_0x48009b[_0x3da7('0x3d')]};return db[_0x3da7('0x2d')][_0x3da7('0x20')](_0x11a200)['then'](function(_0x169356){_0x135a14['count']=_0x169356;if(_0x19d15c[_0x3da7('0x33')][_0x3da7('0x43')]){_0x48009b[_0x3da7('0x44')]=[{'all':!![]}];}return db[_0x3da7('0x2d')]['findAll'](_0x48009b);})[_0x3da7('0x26')](function(_0x11ca32){_0x135a14[_0x3da7('0x45')]=_0x11ca32;return _0x135a14;})['then'](respondWithFilteredResult(_0x892370,_0x48009b))[_0x3da7('0x46')](handleError(_0x892370,null));};exports[_0x3da7('0x47')]=function(_0xe78d5c,_0x34d423){var _0x3d5c44={'raw':![],'where':{'id':_0xe78d5c[_0x3da7('0x48')]['id']}},_0x3db10f={};_0x3db10f[_0x3da7('0x31')]=_['keys'](db[_0x3da7('0x2d')]['rawAttributes']);_0x3db10f[_0x3da7('0x33')]=_[_0x3da7('0x32')](_0xe78d5c['query']);_0x3db10f[_0x3da7('0x34')]=_[_0x3da7('0x36')](_0x3db10f[_0x3da7('0x31')],_0x3db10f['query']);_0x3d5c44[_0x3da7('0x35')]=_[_0x3da7('0x36')](_0x3db10f[_0x3da7('0x31')],qs[_0x3da7('0x37')](_0xe78d5c[_0x3da7('0x33')][_0x3da7('0x37')]));_0x3d5c44[_0x3da7('0x35')]=_0x3d5c44[_0x3da7('0x35')][_0x3da7('0x38')]?_0x3d5c44[_0x3da7('0x35')]:_0x3db10f[_0x3da7('0x31')];if(_0xe78d5c[_0x3da7('0x33')][_0x3da7('0x43')]){_0x3d5c44[_0x3da7('0x44')]=[{'all':!![]}];}_0x3d5c44=_['merge']({},_0x3d5c44,_0xe78d5c[_0x3da7('0x42')]);return db[_0x3da7('0x2d')][_0x3da7('0x49')](_0x3d5c44)[_0x3da7('0x26')](handleEntityNotFound(_0x34d423,null))[_0x3da7('0x26')](respondWithResult(_0x34d423,null))[_0x3da7('0x46')](handleError(_0x34d423,null));};exports['create']=function(_0x441f93,_0x5d7984){return db[_0x3da7('0x2d')][_0x3da7('0x4a')](_0x441f93['body'],{})[_0x3da7('0x26')](respondWithResult(_0x5d7984,0xc9))[_0x3da7('0x46')](handleError(_0x5d7984,null));};exports[_0x3da7('0x25')]=function(_0x387df8,_0x3adb78){if(_0x387df8[_0x3da7('0x4b')]['id']){delete _0x387df8[_0x3da7('0x4b')]['id'];}return db['SugarcrmAccount'][_0x3da7('0x49')]({'where':{'id':_0x387df8[_0x3da7('0x48')]['id']}})[_0x3da7('0x26')](handleEntityNotFound(_0x3adb78,null))[_0x3da7('0x26')](saveUpdates(_0x387df8[_0x3da7('0x4b')],null))[_0x3da7('0x26')](respondWithResult(_0x3adb78,null))['catch'](handleError(_0x3adb78,null));};exports['destroy']=function(_0x1e0de8,_0x5a86c4){return db[_0x3da7('0x2d')][_0x3da7('0x49')]({'where':{'id':_0x1e0de8[_0x3da7('0x48')]['id']}})[_0x3da7('0x26')](handleEntityNotFound(_0x5a86c4,null))[_0x3da7('0x26')](removeEntity(_0x5a86c4,null))[_0x3da7('0x46')](handleError(_0x5a86c4,null));};exports[_0x3da7('0x4c')]=function(_0x5d4d50,_0x21c86b,_0x58a1ed){var _0x521bb0={};var _0x85e5f8={};var _0x18400c;var _0xa5ba2f;return db['SugarcrmAccount'][_0x3da7('0x4d')]({'where':{'id':_0x5d4d50[_0x3da7('0x48')]['id']}})[_0x3da7('0x26')](handleEntityNotFound(_0x21c86b,null))['then'](function(_0x577f86){if(_0x577f86){_0x18400c=_0x577f86;_0x85e5f8[_0x3da7('0x31')]=_[_0x3da7('0x32')](db[_0x3da7('0x4e')][_0x3da7('0x2e')]);_0x85e5f8[_0x3da7('0x33')]=_['keys'](_0x5d4d50[_0x3da7('0x33')]);_0x85e5f8[_0x3da7('0x34')]=_[_0x3da7('0x36')](_0x85e5f8[_0x3da7('0x31')],_0x85e5f8['query']);_0x521bb0[_0x3da7('0x35')]=_[_0x3da7('0x36')](_0x85e5f8[_0x3da7('0x31')],qs['fields'](_0x5d4d50[_0x3da7('0x33')][_0x3da7('0x37')]));_0x521bb0[_0x3da7('0x35')]=_0x521bb0[_0x3da7('0x35')][_0x3da7('0x38')]?_0x521bb0['attributes']:_0x85e5f8[_0x3da7('0x31')];_0x521bb0['order']=qs[_0x3da7('0x3c')](_0x5d4d50[_0x3da7('0x33')]['sort']);_0x521bb0['where']=qs[_0x3da7('0x34')](_[_0x3da7('0x3e')](_0x5d4d50[_0x3da7('0x33')],_0x85e5f8['filters']));if(_0x5d4d50[_0x3da7('0x33')]['filter']){_0x521bb0['where']=_[_0x3da7('0x41')](_0x521bb0[_0x3da7('0x3d')],{'$or':_[_0x3da7('0x2c')](_0x521bb0[_0x3da7('0x35')],function(_0x1cad09){var _0x58c23f={};_0x58c23f[_0x1cad09]={'$like':'%'+_0x5d4d50['query'][_0x3da7('0x40')]+'%'};return _0x58c23f;})});}_0x521bb0=_['merge']({},_0x521bb0,_0x5d4d50[_0x3da7('0x42')]);return _0x18400c[_0x3da7('0x4c')](_0x521bb0);}})[_0x3da7('0x26')](function(_0x3ee680){if(_0x3ee680){_0xa5ba2f=_0x3ee680[_0x3da7('0x38')];if(!_0x5d4d50[_0x3da7('0x33')]['hasOwnProperty']('nolimit')){_0x521bb0['limit']=qs['limit'](_0x5d4d50[_0x3da7('0x33')][_0x3da7('0x1d')]);_0x521bb0['offset']=qs['offset'](_0x5d4d50['query']['offset']);}return _0x18400c['getConfigurations'](_0x521bb0);}})['then'](function(_0x4389b6){if(_0x4389b6){return _0x4389b6?{'count':_0xa5ba2f,'rows':_0x4389b6}:null;}})[_0x3da7('0x26')](respondWithResult(_0x21c86b,null))[_0x3da7('0x46')](handleError(_0x21c86b,null));};exports[_0x3da7('0x4f')]=function(_0xbca33,_0x3bee9b,_0x10883){if(_0xbca33[_0x3da7('0x4b')]['id']){delete _0xbca33['body']['id'];}return db[_0x3da7('0x2d')][_0x3da7('0x4d')]({'where':{'id':_0xbca33['params']['id']}})[_0x3da7('0x26')](handleEntityNotFound(_0x3bee9b,null))['then'](function(_0x1efb90){if(_0x1efb90){_0xbca33[_0x3da7('0x4b')]['AccountId']=_0x1efb90['id'];_0xbca33[_0x3da7('0x4b')][_0x3da7('0x50')]=integrations[_0x3da7('0x51')](_0xbca33[_0x3da7('0x4b')][_0x3da7('0x52')],_0xbca33['body'][_0x3da7('0x2f')]);_0xbca33[_0x3da7('0x4b')]['Descriptions']=integrations[_0x3da7('0x53')](_0xbca33[_0x3da7('0x4b')][_0x3da7('0x52')],_0xbca33[_0x3da7('0x4b')]['type']);return db[_0x3da7('0x4e')][_0x3da7('0x4a')](_0xbca33['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x3da7('0x50')},{'model':db[_0x3da7('0x54')],'as':_0x3da7('0x55')}]});}return null;})[_0x3da7('0x26')](respondWithResult(_0x3bee9b,null))[_0x3da7('0x46')](handleError(_0x3bee9b,null));};exports[_0x3da7('0x56')]=function(_0x1833e8,_0x513ac3,_0x1d3a89){var _0x58beaa='';var _0x4639c4=['id','name','assigned_user_id','created_by','description',_0x3da7('0x57'),_0x3da7('0x58'),_0x3da7('0x59'),'parent_id','parent_type',_0x3da7('0x5a'),_0x3da7('0x5b')];return db[_0x3da7('0x2d')][_0x3da7('0x4d')]({'where':{'id':_0x1833e8[_0x3da7('0x48')]['id']},'attributes':['id',_0x3da7('0x5c'),_0x3da7('0x5d'),_0x3da7('0x5e')]})['then'](handleEntityNotFound(_0x513ac3,null))[_0x3da7('0x26')](function(_0x54e9a8){if(_0x54e9a8){_0x58beaa=_0x54e9a8['remoteUri'];var _0x4e6629=_0x58beaa[_0x3da7('0x5f')](-0x1);if(_0x4e6629==='/'){_0x58beaa=_0x58beaa['substring'](0x0,_0x58beaa['lastIndexOf'](_0x4e6629));}return rp({'method':_0x3da7('0x60'),'uri':util[_0x3da7('0x61')](_0x3da7('0x62'),_0x58beaa,_0x3da7('0x63')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0x3da7('0x64'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x54e9a8[_0x3da7('0x5c')],'password':_0x54e9a8['password'],'encryption':_0x3da7('0x65')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x3da7('0x26')](function(_0xd690d1){if(_0xd690d1&&_0xd690d1['name']!=='Invalid\x20Login'&&_0xd690d1[_0x3da7('0x29')]!==_0x3da7('0x66')){return rp({'method':_0x3da7('0x60'),'uri':util[_0x3da7('0x61')](_0x3da7('0x62'),_0x58beaa,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x3da7('0x64'),'response_type':_0x3da7('0x64'),'rest_data':JSON[_0x3da7('0x67')]({'session':_0xd690d1['id'],'module_name':_0x3da7('0x68')})}})[_0x3da7('0x26')](function(_0x363746){if(_0x363746){var _0x30608a=_['values'](_0x363746['module_fields']);_[_0x3da7('0x69')](_0x30608a,function(_0x3f7ceb){return _0x4639c4[_0x3da7('0x6a')](_0x3f7ceb[_0x3da7('0x29')]);});return{'count':_0x30608a['length'],'rows':_[_0x3da7('0x2c')](_0x30608a,function(_0x54d22e){return{'id':_0x54d22e['name'],'name':_0x54d22e['label'],'custom':_[_0x3da7('0x6b')](_0x54d22e[_0x3da7('0x29')],'_c')?!![]:![],'options':_0x54d22e[_0x3da7('0x42')]?_[_0x3da7('0x2c')](_[_0x3da7('0x6c')](_0x54d22e['options']),function(_0x22d785){return{'name':_0x22d785[_0x3da7('0x6d')],'value':_0x22d785[_0x3da7('0x29')]};}):[]};})};}})[_0x3da7('0x26')](respondWithResult(_0x513ac3,null))[_0x3da7('0x46')](function(_0x449c14){var _0x4cdae5=_0x1833e8[_0x3da7('0x33')][_0x3da7('0x6e')]?0x1f4:_0x449c14['statusCode']||0x1f4;logger[_0x3da7('0x27')](_0x3da7('0x6f'),_0x3da7('0x56'),_0x4cdae5,JSON[_0x3da7('0x67')](_0x449c14));delete _0x449c14[_0x3da7('0x29')];if(_0x4cdae5===0x191){_0x4cdae5=0x190;}_0x513ac3[_0x3da7('0x1b')](_0x4cdae5)[_0x3da7('0x2a')](_0x1833e8['query'][_0x3da7('0x6e')]?{'message':_0x3da7('0x70'),'statusCode':_0x449c14['statusCode']}:_0x449c14);});}else{var _0x15f9ce=0x1f4;_0x513ac3[_0x3da7('0x1b')](_0x15f9ce)['send']({'message':_0x3da7('0x70'),'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 2920c00..7b49478 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 _0x251f=['exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x54f4f1,_0x2e603b){var _0x14b71f=function(_0x410ca5){while(--_0x410ca5){_0x54f4f1['push'](_0x54f4f1['shift']());}};_0x14b71f(++_0x2e603b);}(_0x251f,0xbe));var _0xf251=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0x251f[_0x29e3b6];return _0x55d4b0;};'use strict';var _=require(_0xf251('0x0'));var util=require(_0xf251('0x1'));var logger=require(_0xf251('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf251('0x3'));var rp=require(_0xf251('0x4'));var fs=require('fs');var path=require(_0xf251('0x5'));var rimraf=require('rimraf');var config=require(_0xf251('0x6'));var attributes=require(_0xf251('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xf251('0x8')]=function(_0x57defb,_0x19a8e8){return _0x57defb['define'](_0xf251('0x9'),attributes,{'tableName':_0xf251('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x847f=['../../config/environment','./intSugarcrmAccount.attributes','define','SugarcrmAccount','lodash','util','api','moment','path','rimraf'];(function(_0x40726e,_0x309ab2){var _0x10eb6e=function(_0x482a97){while(--_0x482a97){_0x40726e['push'](_0x40726e['shift']());}};_0x10eb6e(++_0x309ab2);}(_0x847f,0xb8));var _0xf847=function(_0x3c007e,_0x2e6adc){_0x3c007e=_0x3c007e-0x0;var _0x851f31=_0x847f[_0x3c007e];return _0x851f31;};'use strict';var _=require(_0xf847('0x0'));var util=require(_0xf847('0x1'));var logger=require('../../config/logger')(_0xf847('0x2'));var moment=require(_0xf847('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf847('0x4'));var rimraf=require(_0xf847('0x5'));var config=require(_0xf847('0x6'));var attributes=require(_0xf847('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xf2bc9e,_0x177d10){return _0xf2bc9e[_0xf847('0x8')](_0xf847('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 325b22a..060c583 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 _0x074d=['ShowSugarcrmAccount','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','include','model','attributes','map','then','find','raw'];(function(_0x2f7f59,_0x4068f1){var _0x333048=function(_0x56fc3d){while(--_0x56fc3d){_0x2f7f59['push'](_0x2f7f59['shift']());}};_0x333048(++_0x4068f1);}(_0x074d,0x1f0));var _0xd074=function(_0xe0564e,_0x37cf17){_0xe0564e=_0xe0564e-0x0;var _0x36ffe3=_0x074d[_0xe0564e];return _0x36ffe3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd074('0x0'));var BPromise=require('bluebird');var rs=require(_0xd074('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd074('0x2'))['db'];var utils=require(_0xd074('0x3'));var logger=require(_0xd074('0x4'))(_0xd074('0x5'));var config=require(_0xd074('0x6'));var jayson=require(_0xd074('0x7'));var client=jayson[_0xd074('0x8')][_0xd074('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e23ba,_0x486428,_0x421bda){return new BPromise(function(_0x525e48,_0x294f87){return client['request'](_0x4e23ba,_0x421bda)['then'](function(_0x21a1e2){logger[_0xd074('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0x486428,_0xd074('0xb'));logger[_0xd074('0xc')](_0xd074('0xd'),_0x486428,_0xd074('0xb'),JSON[_0xd074('0xe')](_0x21a1e2));if(_0x21a1e2[_0xd074('0xf')]){if(_0x21a1e2[_0xd074('0xf')][_0xd074('0x10')]===0x1f4){logger['error'](_0xd074('0x11'),_0x486428,_0x21a1e2[_0xd074('0xf')]['message']);return _0x294f87(_0x21a1e2[_0xd074('0xf')]['message']);}logger[_0xd074('0xf')](_0xd074('0x11'),_0x486428,_0x21a1e2['error']['message']);return _0x525e48(_0x21a1e2[_0xd074('0xf')][_0xd074('0x12')]);}else{logger[_0xd074('0xa')](_0xd074('0x11'),_0x486428,_0xd074('0xb'));_0x525e48(_0x21a1e2['result'][_0xd074('0x12')]);}})[_0xd074('0x13')](function(_0x45f4ff){logger[_0xd074('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x486428,_0x45f4ff);_0x294f87(_0x45f4ff);});});}exports[_0xd074('0x14')]=function(_0x3cf66d){var _0x36b7ac=this;return new Promise(function(_0x27bb3a,_0x311e86){return db[_0xd074('0x15')][_0xd074('0x16')]({'raw':_0x3cf66d[_0xd074('0x17')]?_0x3cf66d[_0xd074('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cf66d[_0xd074('0x17')]?_0x3cf66d[_0xd074('0x17')][_0xd074('0x18')]||null:null,'attributes':_0x3cf66d[_0xd074('0x17')]?_0x3cf66d[_0xd074('0x17')]['attributes']||null:null,'limit':_0x3cf66d[_0xd074('0x17')]?_0x3cf66d[_0xd074('0x17')]['limit']||null:null,'include':_0x3cf66d[_0xd074('0x17')]?_0x3cf66d[_0xd074('0x17')]['include']?_['map'](_0x3cf66d[_0xd074('0x17')][_0xd074('0x19')],function(_0x53f979){return{'model':db[_0x53f979['model']],'as':_0x53f979['as'],'attributes':_0x53f979['attributes'],'include':_0x53f979['include']?_['map'](_0x53f979[_0xd074('0x19')],function(_0x485eff){return{'model':db[_0x485eff[_0xd074('0x1a')]],'as':_0x485eff['as'],'attributes':_0x485eff[_0xd074('0x1b')],'include':_0x485eff[_0xd074('0x19')]?_[_0xd074('0x1c')](_0x485eff[_0xd074('0x19')],function(_0x484f37){return{'model':db[_0x484f37[_0xd074('0x1a')]],'as':_0x484f37['as'],'attributes':_0x484f37[_0xd074('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd074('0x1d')](function(_0xbcdc58){logger[_0xd074('0xa')](_0xd074('0x14'),_0x3cf66d);logger[_0xd074('0xc')]('GetSugarcrmAccount',_0x3cf66d,JSON[_0xd074('0xe')](_0xbcdc58));_0x27bb3a(_0xbcdc58);})[_0xd074('0x13')](function(_0x45fcb2){logger[_0xd074('0xf')](_0xd074('0x14'),_0x45fcb2['message'],_0x3cf66d);_0x311e86(_0x36b7ac[_0xd074('0xf')](0x1f4,_0x45fcb2[_0xd074('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x14e9f5){var _0x2db9bc=this;return new Promise(function(_0xdffd33,_0x30fe77){return db[_0xd074('0x15')][_0xd074('0x1e')]({'raw':_0x14e9f5[_0xd074('0x17')]?_0x14e9f5['options'][_0xd074('0x1f')]===undefined?!![]:![]:!![],'where':_0x14e9f5[_0xd074('0x17')]?_0x14e9f5[_0xd074('0x17')][_0xd074('0x18')]||null:null,'attributes':_0x14e9f5[_0xd074('0x17')]?_0x14e9f5[_0xd074('0x17')][_0xd074('0x1b')]||null:null,'include':_0x14e9f5[_0xd074('0x17')]?_0x14e9f5['options']['include']?_[_0xd074('0x1c')](_0x14e9f5[_0xd074('0x17')]['include'],function(_0x2d7e14){return{'model':db[_0x2d7e14['model']],'as':_0x2d7e14['as'],'attributes':_0x2d7e14[_0xd074('0x1b')],'include':_0x2d7e14[_0xd074('0x19')]?_['map'](_0x2d7e14[_0xd074('0x19')],function(_0x457b13){return{'model':db[_0x457b13[_0xd074('0x1a')]],'as':_0x457b13['as'],'attributes':_0x457b13[_0xd074('0x1b')],'include':_0x457b13['include']?_['map'](_0x457b13[_0xd074('0x19')],function(_0x481d3e){return{'model':db[_0x481d3e[_0xd074('0x1a')]],'as':_0x481d3e['as'],'attributes':_0x481d3e[_0xd074('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd074('0x1d')](function(_0x5c1ec2){logger[_0xd074('0xa')](_0xd074('0x20'),_0x14e9f5);logger['debug'](_0xd074('0x20'),_0x14e9f5,JSON[_0xd074('0xe')](_0x5c1ec2));_0xdffd33(_0x5c1ec2);})[_0xd074('0x13')](function(_0x37ce71){logger[_0xd074('0xf')](_0xd074('0x20'),_0x37ce71[_0xd074('0x12')],_0x14e9f5);_0x30fe77(_0x2db9bc[_0xd074('0xf')](0x1f4,_0x37ce71[_0xd074('0x12')]));});});}; \ No newline at end of file +var _0x3174=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSugarcrmAccount','find','moment'];(function(_0x4f3db7,_0x472870){var _0x2c0a30=function(_0x571fcf){while(--_0x571fcf){_0x4f3db7['push'](_0x4f3db7['shift']());}};_0x2c0a30(++_0x472870);}(_0x3174,0x87));var _0x4317=function(_0x572b16,_0x565b54){_0x572b16=_0x572b16-0x0;var _0x5ae671=_0x3174[_0x572b16];return _0x5ae671;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4317('0x0'));var BPromise=require(_0x4317('0x1'));var rs=require(_0x4317('0x2'));var fs=require('fs');var Redis=require(_0x4317('0x3'));var db=require(_0x4317('0x4'))['db'];var utils=require(_0x4317('0x5'));var logger=require(_0x4317('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4317('0x7'));var client=jayson['client'][_0x4317('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x284f04,_0x5daf4d,_0x7326b1){return new BPromise(function(_0x177cc5,_0x5499e8){return client[_0x4317('0x9')](_0x284f04,_0x7326b1)[_0x4317('0xa')](function(_0x31acbb){logger[_0x4317('0xb')](_0x4317('0xc'),_0x5daf4d,_0x4317('0xd'));logger[_0x4317('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x5daf4d,'request\x20sent',JSON[_0x4317('0xf')](_0x31acbb));if(_0x31acbb[_0x4317('0x10')]){if(_0x31acbb[_0x4317('0x10')][_0x4317('0x11')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x5daf4d,_0x31acbb['error']['message']);return _0x5499e8(_0x31acbb[_0x4317('0x10')][_0x4317('0x12')]);}logger[_0x4317('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x5daf4d,_0x31acbb[_0x4317('0x10')][_0x4317('0x12')]);return _0x177cc5(_0x31acbb[_0x4317('0x10')]['message']);}else{logger[_0x4317('0xb')](_0x4317('0xc'),_0x5daf4d,_0x4317('0xd'));_0x177cc5(_0x31acbb[_0x4317('0x13')][_0x4317('0x12')]);}})[_0x4317('0x14')](function(_0x2d6abc){logger[_0x4317('0x10')](_0x4317('0xc'),_0x5daf4d,_0x2d6abc);_0x5499e8(_0x2d6abc);});});}exports[_0x4317('0x15')]=function(_0x27d624){var _0x50c6aa=this;return new Promise(function(_0x543356,_0x172cf2){return db[_0x4317('0x16')][_0x4317('0x17')]({'raw':_0x27d624['options']?_0x27d624[_0x4317('0x18')][_0x4317('0x19')]===undefined?!![]:![]:!![],'where':_0x27d624[_0x4317('0x18')]?_0x27d624[_0x4317('0x18')][_0x4317('0x1a')]||null:null,'attributes':_0x27d624[_0x4317('0x18')]?_0x27d624[_0x4317('0x18')][_0x4317('0x1b')]||null:null,'limit':_0x27d624[_0x4317('0x18')]?_0x27d624['options'][_0x4317('0x1c')]||null:null,'include':_0x27d624[_0x4317('0x18')]?_0x27d624['options']['include']?_[_0x4317('0x1d')](_0x27d624['options'][_0x4317('0x1e')],function(_0x36f58a){return{'model':db[_0x36f58a[_0x4317('0x1f')]],'as':_0x36f58a['as'],'attributes':_0x36f58a[_0x4317('0x1b')],'include':_0x36f58a[_0x4317('0x1e')]?_[_0x4317('0x1d')](_0x36f58a[_0x4317('0x1e')],function(_0x1f8c3b){return{'model':db[_0x1f8c3b['model']],'as':_0x1f8c3b['as'],'attributes':_0x1f8c3b[_0x4317('0x1b')],'include':_0x1f8c3b['include']?_[_0x4317('0x1d')](_0x1f8c3b[_0x4317('0x1e')],function(_0x90f275){return{'model':db[_0x90f275[_0x4317('0x1f')]],'as':_0x90f275['as'],'attributes':_0x90f275[_0x4317('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4317('0xa')](function(_0x130aa3){logger[_0x4317('0xb')](_0x4317('0x15'),_0x27d624);logger[_0x4317('0xe')]('GetSugarcrmAccount',_0x27d624,JSON[_0x4317('0xf')](_0x130aa3));_0x543356(_0x130aa3);})['catch'](function(_0x3d08a4){logger[_0x4317('0x10')](_0x4317('0x15'),_0x3d08a4[_0x4317('0x12')],_0x27d624);_0x172cf2(_0x50c6aa[_0x4317('0x10')](0x1f4,_0x3d08a4['message']));});});};exports[_0x4317('0x20')]=function(_0xe8e0e5){var _0x237fdb=this;return new Promise(function(_0x5f3f4f,_0x3537cf){return db[_0x4317('0x16')][_0x4317('0x21')]({'raw':_0xe8e0e5[_0x4317('0x18')]?_0xe8e0e5['options'][_0x4317('0x19')]===undefined?!![]:![]:!![],'where':_0xe8e0e5['options']?_0xe8e0e5['options'][_0x4317('0x1a')]||null:null,'attributes':_0xe8e0e5[_0x4317('0x18')]?_0xe8e0e5[_0x4317('0x18')]['attributes']||null:null,'include':_0xe8e0e5[_0x4317('0x18')]?_0xe8e0e5[_0x4317('0x18')][_0x4317('0x1e')]?_['map'](_0xe8e0e5['options'][_0x4317('0x1e')],function(_0x43518b){return{'model':db[_0x43518b[_0x4317('0x1f')]],'as':_0x43518b['as'],'attributes':_0x43518b[_0x4317('0x1b')],'include':_0x43518b[_0x4317('0x1e')]?_['map'](_0x43518b['include'],function(_0x1f51c3){return{'model':db[_0x1f51c3[_0x4317('0x1f')]],'as':_0x1f51c3['as'],'attributes':_0x1f51c3[_0x4317('0x1b')],'include':_0x1f51c3['include']?_[_0x4317('0x1d')](_0x1f51c3[_0x4317('0x1e')],function(_0x336656){return{'model':db[_0x336656[_0x4317('0x1f')]],'as':_0x336656['as'],'attributes':_0x336656[_0x4317('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4317('0xa')](function(_0x5b9925){logger[_0x4317('0xb')](_0x4317('0x20'),_0xe8e0e5);logger['debug'](_0x4317('0x20'),_0xe8e0e5,JSON['stringify'](_0x5b9925));_0x5f3f4f(_0x5b9925);})[_0x4317('0x14')](function(_0x144cd3){logger['error'](_0x4317('0x20'),_0x144cd3[_0x4317('0x12')],_0xe8e0e5);_0x3537cf(_0x237fdb[_0x4317('0x10')](0x1f4,_0x144cd3[_0x4317('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index bc1eeae..a0979f0 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 _0xe024=['show','/:id/fields','getFields','get','/:id/descriptions','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','/:id','isAuthenticated'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe024,0xed));var _0x4e02=function(_0x16e0f5,_0x4ec0f3){_0x16e0f5=_0x16e0f5-0x0;var _0x4839d5=_0xe024[_0x16e0f5];return _0x4839d5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4e02('0x0'));var timeout=require(_0x4e02('0x1'));var express=require(_0x4e02('0x2'));var router=express['Router']();var fs_extra=require(_0x4e02('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4e02('0x4'));var config=require(_0x4e02('0x5'));var controller=require(_0x4e02('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e02('0x7')]);router['get'](_0x4e02('0x8'),auth[_0x4e02('0x9')](),controller[_0x4e02('0xa')]);router['get'](_0x4e02('0xb'),auth['isAuthenticated'](),controller[_0x4e02('0xc')]);router[_0x4e02('0xd')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x4e02('0xd')](_0x4e02('0xe'),auth[_0x4e02('0x9')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4e02('0x8'),auth[_0x4e02('0x9')](),controller[_0x4e02('0xf')]);router[_0x4e02('0x10')](_0x4e02('0x8'),auth[_0x4e02('0x9')](),controller[_0x4e02('0x11')]);module[_0x4e02('0x12')]=router; \ No newline at end of file +var _0x8442=['show','getFields','getSubjects','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x429a51,_0x56ee7f){var _0x1071cf=function(_0x1a7665){while(--_0x1a7665){_0x429a51['push'](_0x429a51['shift']());}};_0x1071cf(++_0x56ee7f);}(_0x8442,0x168));var _0x2844=function(_0xd7b39c,_0x3fc443){_0xd7b39c=_0xd7b39c-0x0;var _0x36530e=_0x8442[_0xd7b39c];return _0x36530e;};'use strict';var multer=require(_0x2844('0x0'));var util=require(_0x2844('0x1'));var path=require(_0x2844('0x2'));var timeout=require(_0x2844('0x3'));var express=require(_0x2844('0x4'));var router=express[_0x2844('0x5')]();var fs_extra=require(_0x2844('0x6'));var auth=require(_0x2844('0x7'));var interaction=require(_0x2844('0x8'));var config=require(_0x2844('0x9'));var controller=require(_0x2844('0xa'));router[_0x2844('0xb')]('/',auth[_0x2844('0xc')](),controller[_0x2844('0xd')]);router[_0x2844('0xb')](_0x2844('0xe'),auth[_0x2844('0xc')](),controller[_0x2844('0xf')]);router[_0x2844('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2844('0x10')]);router[_0x2844('0xb')]('/:id/subjects',auth[_0x2844('0xc')](),controller[_0x2844('0x11')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2844('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2844('0x13')]);router[_0x2844('0x14')](_0x2844('0xe'),auth[_0x2844('0xc')](),controller[_0x2844('0x15')]);router[_0x2844('0x16')](_0x2844('0xe'),auth[_0x2844('0xc')](),controller[_0x2844('0x17')]);module[_0x2844('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 4f977d0..8d935e7 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 _0x62c9=['sequelize','exports','STRING'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x62c9,0x168));var _0x962c=function(_0x401d53,_0x5b6dc8){_0x401d53=_0x401d53-0x0;var _0x437c57=_0x62c9[_0x401d53];return _0x437c57;};'use strict';var Sequelize=require(_0x962c('0x0'));module[_0x962c('0x1')]={'name':{'type':Sequelize[_0x962c('0x2')]},'description':{'type':Sequelize[_0x962c('0x2')]}}; \ No newline at end of file +var _0x0a23=['STRING'];(function(_0x4587c1,_0x4a401a){var _0x5051ad=function(_0x1de3c2){while(--_0x1de3c2){_0x4587c1['push'](_0x4587c1['shift']());}};_0x5051ad(++_0x4a401a);}(_0x0a23,0xb2));var _0x30a2=function(_0x5881eb,_0x31be1f){_0x5881eb=_0x5881eb-0x0;var _0x4042ab=_0x0a23[_0x5881eb];return _0x4042ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x30a2('0x0')]},'description':{'type':Sequelize[_0x30a2('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4282eb3..d5761c4 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 _0x1186=['rows','show','params','keys','rawAttributes','options','catch','create','body','find','destroy','getFields','findOne','SugarcrmField','getSubjects','order','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','index','map','fieldName','type','key','model','filters','intersection','attributes','fields','length','query','nolimit','sort','where','pick','filter','merge','VIRTUAL','SugarcrmConfiguration','includeAll','include','findAll'];(function(_0x3a4729,_0x2e78cd){var _0x23f9a9=function(_0x225b8f){while(--_0x225b8f){_0x3a4729['push'](_0x3a4729['shift']());}};_0x23f9a9(++_0x2e78cd);}(_0x1186,0xff));var _0x6118=function(_0x5b498e,_0x25fb49){_0x5b498e=_0x5b498e-0x0;var _0x3e5309=_0x1186[_0x5b498e];return _0x3e5309;};'use strict';var emlformat=require(_0x6118('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6118('0x1'));var jsonpatch=require(_0x6118('0x2'));var rp=require(_0x6118('0x3'));var moment=require(_0x6118('0x4'));var BPromise=require(_0x6118('0x5'));var Mustache=require(_0x6118('0x6'));var util=require('util');var path=require(_0x6118('0x7'));var sox=require('sox');var csv=require(_0x6118('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6118('0x9'));var _=require('lodash');var squel=require(_0x6118('0xa'));var crypto=require(_0x6118('0xb'));var jsforce=require(_0x6118('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6118('0x8'));var querystring=require(_0x6118('0xd'));var Papa=require(_0x6118('0xe'));var Redis=require(_0x6118('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6118('0x10'));var hardwareService=require(_0x6118('0x11'));var logger=require(_0x6118('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6118('0x13'));var db=require(_0x6118('0x14'))['db'];function respondWithStatusCode(_0x2ad6ea,_0x21ebc6){_0x21ebc6=_0x21ebc6||0xcc;return function(_0x324a3d){if(_0x324a3d){return _0x2ad6ea[_0x6118('0x15')](_0x21ebc6);}return _0x2ad6ea[_0x6118('0x16')](_0x21ebc6)[_0x6118('0x17')]();};}function respondWithResult(_0x141933,_0x3f366b){_0x3f366b=_0x3f366b||0xc8;return function(_0x4fe69c){if(_0x4fe69c){return _0x141933[_0x6118('0x16')](_0x3f366b)[_0x6118('0x18')](_0x4fe69c);}};}function respondWithFilteredResult(_0x39c543,_0x25cf21){return function(_0x3f1983){if(_0x3f1983){var _0x38a80a=typeof _0x25cf21[_0x6118('0x19')]===_0x6118('0x1a')&&typeof _0x25cf21[_0x6118('0x1b')]===_0x6118('0x1a');var _0x2f9bef=_0x3f1983[_0x6118('0x1c')];var _0xd2cf0c=_0x38a80a?0x0:_0x25cf21[_0x6118('0x19')];var _0x292f89=_0x38a80a?_0x3f1983[_0x6118('0x1c')]:_0x25cf21[_0x6118('0x19')]+_0x25cf21['limit'];var _0x2c1952;if(_0x292f89>=_0x2f9bef){_0x292f89=_0x2f9bef;_0x2c1952=0xc8;}else{_0x2c1952=0xce;}_0x39c543[_0x6118('0x16')](_0x2c1952);return _0x39c543[_0x6118('0x1d')](_0x6118('0x1e'),_0xd2cf0c+'-'+_0x292f89+'/'+_0x2f9bef)[_0x6118('0x18')](_0x3f1983);}return null;};}function patchUpdates(_0x4c9ebc){return function(_0x2a32a0){try{jsonpatch['apply'](_0x2a32a0,_0x4c9ebc,!![]);}catch(_0x52bf35){return BPromise[_0x6118('0x1f')](_0x52bf35);}return _0x2a32a0[_0x6118('0x20')]();};}function saveUpdates(_0x3f2a91,_0x24e79b){return function(_0x40ff08){if(_0x40ff08){return _0x40ff08[_0x6118('0x21')](_0x3f2a91)[_0x6118('0x22')](function(_0x4b98e3){return _0x4b98e3;});}return null;};}function removeEntity(_0x5d2ab5,_0x532f48){return function(_0x21c401){if(_0x21c401){return _0x21c401['destroy']()['then'](function(){_0x5d2ab5[_0x6118('0x16')](0xcc)[_0x6118('0x17')]();});}};}function handleEntityNotFound(_0x4f8d47,_0x42fb7a){return function(_0x3444e4){if(!_0x3444e4){_0x4f8d47[_0x6118('0x15')](0x194);}return _0x3444e4;};}function handleError(_0x1cc493,_0x2c74a7){_0x2c74a7=_0x2c74a7||0x1f4;return function(_0x2228e7){logger[_0x6118('0x23')](_0x2228e7[_0x6118('0x24')]);if(_0x2228e7[_0x6118('0x25')]){delete _0x2228e7[_0x6118('0x25')];}_0x1cc493[_0x6118('0x16')](_0x2c74a7)['send'](_0x2228e7);};}exports[_0x6118('0x26')]=function(_0x3a2f56,_0x10660b){var _0xbc947c={},_0x1639bd={},_0x219db6={'count':0x0,'rows':[]};var _0x33857c=_[_0x6118('0x27')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x5c5346){return{'name':_0x5c5346[_0x6118('0x28')],'type':_0x5c5346[_0x6118('0x29')][_0x6118('0x2a')]};});_0x1639bd[_0x6118('0x2b')]=_[_0x6118('0x27')](_0x33857c,'name');_0x1639bd['query']=_['keys'](_0x3a2f56['query']);_0x1639bd[_0x6118('0x2c')]=_[_0x6118('0x2d')](_0x1639bd[_0x6118('0x2b')],_0x1639bd['query']);_0xbc947c[_0x6118('0x2e')]=_['intersection'](_0x1639bd[_0x6118('0x2b')],qs[_0x6118('0x2f')](_0x3a2f56['query'][_0x6118('0x2f')]));_0xbc947c[_0x6118('0x2e')]=_0xbc947c[_0x6118('0x2e')][_0x6118('0x30')]?_0xbc947c[_0x6118('0x2e')]:_0x1639bd['model'];if(!_0x3a2f56[_0x6118('0x31')]['hasOwnProperty'](_0x6118('0x32'))){_0xbc947c[_0x6118('0x1b')]=qs['limit'](_0x3a2f56[_0x6118('0x31')][_0x6118('0x1b')]);_0xbc947c[_0x6118('0x19')]=qs[_0x6118('0x19')](_0x3a2f56[_0x6118('0x31')][_0x6118('0x19')]);}_0xbc947c['order']=qs[_0x6118('0x33')](_0x3a2f56[_0x6118('0x31')][_0x6118('0x33')]);_0xbc947c[_0x6118('0x34')]=qs[_0x6118('0x2c')](_[_0x6118('0x35')](_0x3a2f56[_0x6118('0x31')],_0x1639bd['filters']),_0x33857c);if(_0x3a2f56[_0x6118('0x31')][_0x6118('0x36')]){_0xbc947c[_0x6118('0x34')]=_[_0x6118('0x37')](_0xbc947c[_0x6118('0x34')],{'$or':_[_0x6118('0x27')](_0x33857c,function(_0xc4823e){if(_0xc4823e[_0x6118('0x29')]!==_0x6118('0x38')){var _0x3a3859={};_0x3a3859[_0xc4823e[_0x6118('0x25')]]={'$like':'%'+_0x3a2f56['query']['filter']+'%'};return _0x3a3859;}})});}_0xbc947c=_[_0x6118('0x37')]({},_0xbc947c,_0x3a2f56['options']);var _0x4cd1de={'where':_0xbc947c['where']};return db[_0x6118('0x39')][_0x6118('0x1c')](_0x4cd1de)['then'](function(_0x1942ad){_0x219db6[_0x6118('0x1c')]=_0x1942ad;if(_0x3a2f56['query'][_0x6118('0x3a')]){_0xbc947c[_0x6118('0x3b')]=[{'all':!![]}];}return db[_0x6118('0x39')][_0x6118('0x3c')](_0xbc947c);})['then'](function(_0x406728){_0x219db6[_0x6118('0x3d')]=_0x406728;return _0x219db6;})[_0x6118('0x22')](respondWithFilteredResult(_0x10660b,_0xbc947c))['catch'](handleError(_0x10660b,null));};exports[_0x6118('0x3e')]=function(_0x5525c9,_0x2992a1){var _0x8bb575={'raw':![],'where':{'id':_0x5525c9[_0x6118('0x3f')]['id']}},_0x340f03={};_0x340f03[_0x6118('0x2b')]=_[_0x6118('0x40')](db[_0x6118('0x39')][_0x6118('0x41')]);_0x340f03[_0x6118('0x31')]=_[_0x6118('0x40')](_0x5525c9[_0x6118('0x31')]);_0x340f03[_0x6118('0x2c')]=_[_0x6118('0x2d')](_0x340f03[_0x6118('0x2b')],_0x340f03[_0x6118('0x31')]);_0x8bb575[_0x6118('0x2e')]=_[_0x6118('0x2d')](_0x340f03[_0x6118('0x2b')],qs[_0x6118('0x2f')](_0x5525c9[_0x6118('0x31')][_0x6118('0x2f')]));_0x8bb575[_0x6118('0x2e')]=_0x8bb575[_0x6118('0x2e')][_0x6118('0x30')]?_0x8bb575[_0x6118('0x2e')]:_0x340f03[_0x6118('0x2b')];if(_0x5525c9['query'][_0x6118('0x3a')]){_0x8bb575[_0x6118('0x3b')]=[{'all':!![]}];}_0x8bb575=_['merge']({},_0x8bb575,_0x5525c9[_0x6118('0x42')]);return db[_0x6118('0x39')]['find'](_0x8bb575)[_0x6118('0x22')](handleEntityNotFound(_0x2992a1,null))[_0x6118('0x22')](respondWithResult(_0x2992a1,null))[_0x6118('0x43')](handleError(_0x2992a1,null));};exports[_0x6118('0x44')]=function(_0x299573,_0x42e4b4){return db[_0x6118('0x39')]['create'](_0x299573[_0x6118('0x45')],{})['then'](respondWithResult(_0x42e4b4,0xc9))['catch'](handleError(_0x42e4b4,null));};exports[_0x6118('0x21')]=function(_0x41b688,_0x121d2b){if(_0x41b688[_0x6118('0x45')]['id']){delete _0x41b688['body']['id'];}return db[_0x6118('0x39')][_0x6118('0x46')]({'where':{'id':_0x41b688[_0x6118('0x3f')]['id']}})[_0x6118('0x22')](handleEntityNotFound(_0x121d2b,null))[_0x6118('0x22')](saveUpdates(_0x41b688[_0x6118('0x45')],null))[_0x6118('0x22')](respondWithResult(_0x121d2b,null))[_0x6118('0x43')](handleError(_0x121d2b,null));};exports[_0x6118('0x47')]=function(_0x1e9b2a,_0x11c95e){return db[_0x6118('0x39')][_0x6118('0x46')]({'where':{'id':_0x1e9b2a[_0x6118('0x3f')]['id']}})[_0x6118('0x22')](handleEntityNotFound(_0x11c95e,null))[_0x6118('0x22')](removeEntity(_0x11c95e,null))[_0x6118('0x43')](handleError(_0x11c95e,null));};exports[_0x6118('0x48')]=function(_0x1f9001,_0x13a86d,_0x581a4f){var _0x15e097={};var _0x531686={};var _0x121cfb;var _0x31a97e;return db[_0x6118('0x39')][_0x6118('0x49')]({'where':{'id':_0x1f9001[_0x6118('0x3f')]['id']}})[_0x6118('0x22')](handleEntityNotFound(_0x13a86d,null))[_0x6118('0x22')](function(_0x445d9b){if(_0x445d9b){_0x121cfb=_0x445d9b;_0x531686[_0x6118('0x2b')]=_[_0x6118('0x40')](db[_0x6118('0x4a')][_0x6118('0x41')]);_0x531686[_0x6118('0x31')]=_['keys'](_0x1f9001[_0x6118('0x31')]);_0x531686[_0x6118('0x2c')]=_[_0x6118('0x2d')](_0x531686[_0x6118('0x2b')],_0x531686[_0x6118('0x31')]);_0x15e097[_0x6118('0x2e')]=_[_0x6118('0x2d')](_0x531686['model'],qs[_0x6118('0x2f')](_0x1f9001[_0x6118('0x31')][_0x6118('0x2f')]));_0x15e097[_0x6118('0x2e')]=_0x15e097[_0x6118('0x2e')][_0x6118('0x30')]?_0x15e097[_0x6118('0x2e')]:_0x531686[_0x6118('0x2b')];_0x15e097['order']=qs[_0x6118('0x33')](_0x1f9001[_0x6118('0x31')][_0x6118('0x33')]);_0x15e097['where']=qs[_0x6118('0x2c')](_[_0x6118('0x35')](_0x1f9001[_0x6118('0x31')],_0x531686[_0x6118('0x2c')]));if(_0x1f9001[_0x6118('0x31')]['filter']){_0x15e097[_0x6118('0x34')]=_[_0x6118('0x37')](_0x15e097[_0x6118('0x34')],{'$or':_['map'](_0x15e097[_0x6118('0x2e')],function(_0x3ffb28){var _0xe850c5={};_0xe850c5[_0x3ffb28]={'$like':'%'+_0x1f9001['query'][_0x6118('0x36')]+'%'};return _0xe850c5;})});}_0x15e097=_[_0x6118('0x37')]({},_0x15e097,_0x1f9001[_0x6118('0x42')]);return _0x121cfb['getFields'](_0x15e097);}})['then'](function(_0x3187c1){if(_0x3187c1){_0x31a97e=_0x3187c1[_0x6118('0x30')];if(!_0x1f9001[_0x6118('0x31')]['hasOwnProperty'](_0x6118('0x32'))){_0x15e097[_0x6118('0x1b')]=qs[_0x6118('0x1b')](_0x1f9001[_0x6118('0x31')][_0x6118('0x1b')]);_0x15e097[_0x6118('0x19')]=qs[_0x6118('0x19')](_0x1f9001[_0x6118('0x31')][_0x6118('0x19')]);}return _0x121cfb[_0x6118('0x48')](_0x15e097);}})['then'](function(_0x5a0629){if(_0x5a0629){return _0x5a0629?{'count':_0x31a97e,'rows':_0x5a0629}:null;}})[_0x6118('0x22')](respondWithResult(_0x13a86d,null))['catch'](handleError(_0x13a86d,null));};exports[_0x6118('0x4b')]=function(_0x122a63,_0x1622c0,_0x5b11d3){var _0x4bc6ba={};var _0xe16c61={};var _0x4394ca;var _0x1fdba6;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x122a63[_0x6118('0x3f')]['id']}})[_0x6118('0x22')](handleEntityNotFound(_0x1622c0,null))['then'](function(_0x3148ab){if(_0x3148ab){_0x4394ca=_0x3148ab;_0xe16c61['model']=_['keys'](db[_0x6118('0x4a')]['rawAttributes']);_0xe16c61[_0x6118('0x31')]=_[_0x6118('0x40')](_0x122a63['query']);_0xe16c61[_0x6118('0x2c')]=_[_0x6118('0x2d')](_0xe16c61[_0x6118('0x2b')],_0xe16c61[_0x6118('0x31')]);_0x4bc6ba[_0x6118('0x2e')]=_[_0x6118('0x2d')](_0xe16c61[_0x6118('0x2b')],qs['fields'](_0x122a63['query'][_0x6118('0x2f')]));_0x4bc6ba[_0x6118('0x2e')]=_0x4bc6ba[_0x6118('0x2e')][_0x6118('0x30')]?_0x4bc6ba[_0x6118('0x2e')]:_0xe16c61[_0x6118('0x2b')];_0x4bc6ba[_0x6118('0x4c')]=qs[_0x6118('0x33')](_0x122a63[_0x6118('0x31')][_0x6118('0x33')]);_0x4bc6ba[_0x6118('0x34')]=qs[_0x6118('0x2c')](_[_0x6118('0x35')](_0x122a63[_0x6118('0x31')],_0xe16c61[_0x6118('0x2c')]));if(_0x122a63[_0x6118('0x31')][_0x6118('0x36')]){_0x4bc6ba[_0x6118('0x34')]=_['merge'](_0x4bc6ba['where'],{'$or':_[_0x6118('0x27')](_0x4bc6ba[_0x6118('0x2e')],function(_0x16b596){var _0x423167={};_0x423167[_0x16b596]={'$like':'%'+_0x122a63['query'][_0x6118('0x36')]+'%'};return _0x423167;})});}_0x4bc6ba=_[_0x6118('0x37')]({},_0x4bc6ba,_0x122a63['options']);return _0x4394ca[_0x6118('0x4b')](_0x4bc6ba);}})['then'](function(_0x4774d6){if(_0x4774d6){_0x1fdba6=_0x4774d6[_0x6118('0x30')];if(!_0x122a63['query'][_0x6118('0x4d')]('nolimit')){_0x4bc6ba[_0x6118('0x1b')]=qs['limit'](_0x122a63[_0x6118('0x31')][_0x6118('0x1b')]);_0x4bc6ba[_0x6118('0x19')]=qs['offset'](_0x122a63[_0x6118('0x31')][_0x6118('0x19')]);}return _0x4394ca[_0x6118('0x4b')](_0x4bc6ba);}})[_0x6118('0x22')](function(_0x44f5e7){if(_0x44f5e7){return _0x44f5e7?{'count':_0x1fdba6,'rows':_0x44f5e7}:null;}})[_0x6118('0x22')](respondWithResult(_0x1622c0,null))[_0x6118('0x43')](handleError(_0x1622c0,null));};exports[_0x6118('0x4e')]=function(_0x4d0464,_0x40094e,_0x23b23a){var _0x38194={};var _0x3bbfda={};var _0x5d2bbf;var _0x36f004;return db[_0x6118('0x39')][_0x6118('0x49')]({'where':{'id':_0x4d0464[_0x6118('0x3f')]['id']}})['then'](handleEntityNotFound(_0x40094e,null))[_0x6118('0x22')](function(_0x1d671f){if(_0x1d671f){_0x5d2bbf=_0x1d671f;_0x3bbfda[_0x6118('0x2b')]=_['keys'](db[_0x6118('0x4a')][_0x6118('0x41')]);_0x3bbfda['query']=_[_0x6118('0x40')](_0x4d0464['query']);_0x3bbfda[_0x6118('0x2c')]=_[_0x6118('0x2d')](_0x3bbfda[_0x6118('0x2b')],_0x3bbfda[_0x6118('0x31')]);_0x38194[_0x6118('0x2e')]=_['intersection'](_0x3bbfda[_0x6118('0x2b')],qs[_0x6118('0x2f')](_0x4d0464[_0x6118('0x31')][_0x6118('0x2f')]));_0x38194[_0x6118('0x2e')]=_0x38194['attributes']['length']?_0x38194[_0x6118('0x2e')]:_0x3bbfda[_0x6118('0x2b')];_0x38194[_0x6118('0x4c')]=qs[_0x6118('0x33')](_0x4d0464['query'][_0x6118('0x33')]);_0x38194[_0x6118('0x34')]=qs['filters'](_['pick'](_0x4d0464[_0x6118('0x31')],_0x3bbfda[_0x6118('0x2c')]));if(_0x4d0464['query']['filter']){_0x38194[_0x6118('0x34')]=_[_0x6118('0x37')](_0x38194['where'],{'$or':_[_0x6118('0x27')](_0x38194[_0x6118('0x2e')],function(_0x2958bf){var _0x11aa87={};_0x11aa87[_0x2958bf]={'$like':'%'+_0x4d0464[_0x6118('0x31')][_0x6118('0x36')]+'%'};return _0x11aa87;})});}_0x38194=_[_0x6118('0x37')]({},_0x38194,_0x4d0464[_0x6118('0x42')]);return _0x5d2bbf[_0x6118('0x4e')](_0x38194);}})[_0x6118('0x22')](function(_0x5adf38){if(_0x5adf38){_0x36f004=_0x5adf38[_0x6118('0x30')];if(!_0x4d0464[_0x6118('0x31')][_0x6118('0x4d')]('nolimit')){_0x38194[_0x6118('0x1b')]=qs[_0x6118('0x1b')](_0x4d0464['query'][_0x6118('0x1b')]);_0x38194[_0x6118('0x19')]=qs[_0x6118('0x19')](_0x4d0464[_0x6118('0x31')][_0x6118('0x19')]);}return _0x5d2bbf[_0x6118('0x4e')](_0x38194);}})['then'](function(_0x2e8af3){if(_0x2e8af3){return _0x2e8af3?{'count':_0x36f004,'rows':_0x2e8af3}:null;}})[_0x6118('0x22')](respondWithResult(_0x40094e,null))[_0x6118('0x43')](handleError(_0x40094e,null));}; \ No newline at end of file +var _0x515a=['key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','then','catch','show','params','keys','find','create','body','findOne','getFields','SugarcrmField','getSubjects','getDescriptions','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','sendStatus','name','send','SugarcrmConfiguration','fieldName','type'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x515a,0x171));var _0xa515=function(_0x41381f,_0x5b9893){_0x41381f=_0x41381f-0x0;var _0x33a44a=_0x515a[_0x41381f];return _0x33a44a;};'use strict';var emlformat=require(_0xa515('0x0'));var rimraf=require(_0xa515('0x1'));var zipdir=require(_0xa515('0x2'));var jsonpatch=require(_0xa515('0x3'));var rp=require(_0xa515('0x4'));var moment=require(_0xa515('0x5'));var BPromise=require(_0xa515('0x6'));var Mustache=require(_0xa515('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa515('0x8'));var csv=require(_0xa515('0x9'));var ejs=require(_0xa515('0xa'));var fs=require('fs');var fs_extra=require(_0xa515('0xb'));var _=require(_0xa515('0xc'));var squel=require(_0xa515('0xd'));var crypto=require(_0xa515('0xe'));var jsforce=require(_0xa515('0xf'));var deskjs=require(_0xa515('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa515('0x11'));var Redis=require(_0xa515('0x12'));var authService=require(_0xa515('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa515('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa515('0x15'))(_0xa515('0x16'));var utils=require(_0xa515('0x17'));var config=require(_0xa515('0x18'));var licenseUtil=require(_0xa515('0x19'));var db=require(_0xa515('0x1a'))['db'];function respondWithStatusCode(_0x2af738,_0x5c3e4f){_0x5c3e4f=_0x5c3e4f||0xcc;return function(_0x10d6d7){if(_0x10d6d7){return _0x2af738['sendStatus'](_0x5c3e4f);}return _0x2af738[_0xa515('0x1b')](_0x5c3e4f)[_0xa515('0x1c')]();};}function respondWithResult(_0x1d7448,_0x1a11bc){_0x1a11bc=_0x1a11bc||0xc8;return function(_0x557304){if(_0x557304){return _0x1d7448[_0xa515('0x1b')](_0x1a11bc)['json'](_0x557304);}};}function respondWithFilteredResult(_0x38c4e5,_0x13d2f1){return function(_0x273b1e){if(_0x273b1e){var _0x197bb4=typeof _0x13d2f1['offset']===_0xa515('0x1d')&&typeof _0x13d2f1['limit']==='undefined';var _0x1b898e=_0x273b1e[_0xa515('0x1e')];var _0xda098e=_0x197bb4?0x0:_0x13d2f1[_0xa515('0x1f')];var _0x32bc3c=_0x197bb4?_0x273b1e[_0xa515('0x1e')]:_0x13d2f1[_0xa515('0x1f')]+_0x13d2f1[_0xa515('0x20')];var _0x4342d4;if(_0x32bc3c>=_0x1b898e){_0x32bc3c=_0x1b898e;_0x4342d4=0xc8;}else{_0x4342d4=0xce;}_0x38c4e5['status'](_0x4342d4);return _0x38c4e5['set'](_0xa515('0x21'),_0xda098e+'-'+_0x32bc3c+'/'+_0x1b898e)[_0xa515('0x22')](_0x273b1e);}return null;};}function patchUpdates(_0x3bedd2){return function(_0x203137){try{jsonpatch[_0xa515('0x23')](_0x203137,_0x3bedd2,!![]);}catch(_0x551d24){return BPromise[_0xa515('0x24')](_0x551d24);}return _0x203137[_0xa515('0x25')]();};}function saveUpdates(_0x5962cf,_0x5d26bd){return function(_0x24318c){if(_0x24318c){return _0x24318c[_0xa515('0x26')](_0x5962cf)['then'](function(_0x537785){return _0x537785;});}return null;};}function removeEntity(_0x56088a,_0x4e0b64){return function(_0x3396c9){if(_0x3396c9){return _0x3396c9[_0xa515('0x27')]()['then'](function(){_0x56088a[_0xa515('0x1b')](0xcc)[_0xa515('0x1c')]();});}};}function handleEntityNotFound(_0x1f14e5,_0xd5e302){return function(_0x1c7c01){if(!_0x1c7c01){_0x1f14e5[_0xa515('0x28')](0x194);}return _0x1c7c01;};}function handleError(_0x4a6573,_0x280ac9){_0x280ac9=_0x280ac9||0x1f4;return function(_0x33dfbb){logger['error'](_0x33dfbb['stack']);if(_0x33dfbb[_0xa515('0x29')]){delete _0x33dfbb[_0xa515('0x29')];}_0x4a6573[_0xa515('0x1b')](_0x280ac9)[_0xa515('0x2a')](_0x33dfbb);};}exports['index']=function(_0x5ab0ee,_0x2a990a){var _0x3551aa={},_0x3c7555={},_0x5acd1a={'count':0x0,'rows':[]};var _0x1364e1=_['map'](db[_0xa515('0x2b')]['rawAttributes'],function(_0x13e3e9){return{'name':_0x13e3e9[_0xa515('0x2c')],'type':_0x13e3e9[_0xa515('0x2d')][_0xa515('0x2e')]};});_0x3c7555['model']=_[_0xa515('0x2f')](_0x1364e1,_0xa515('0x29'));_0x3c7555[_0xa515('0x30')]=_['keys'](_0x5ab0ee['query']);_0x3c7555['filters']=_[_0xa515('0x31')](_0x3c7555[_0xa515('0x32')],_0x3c7555['query']);_0x3551aa[_0xa515('0x33')]=_[_0xa515('0x31')](_0x3c7555['model'],qs[_0xa515('0x34')](_0x5ab0ee[_0xa515('0x30')]['fields']));_0x3551aa[_0xa515('0x33')]=_0x3551aa['attributes'][_0xa515('0x35')]?_0x3551aa[_0xa515('0x33')]:_0x3c7555[_0xa515('0x32')];if(!_0x5ab0ee[_0xa515('0x30')][_0xa515('0x36')](_0xa515('0x37'))){_0x3551aa[_0xa515('0x20')]=qs[_0xa515('0x20')](_0x5ab0ee[_0xa515('0x30')][_0xa515('0x20')]);_0x3551aa[_0xa515('0x1f')]=qs[_0xa515('0x1f')](_0x5ab0ee[_0xa515('0x30')]['offset']);}_0x3551aa[_0xa515('0x38')]=qs[_0xa515('0x39')](_0x5ab0ee[_0xa515('0x30')]['sort']);_0x3551aa[_0xa515('0x3a')]=qs[_0xa515('0x3b')](_[_0xa515('0x3c')](_0x5ab0ee['query'],_0x3c7555[_0xa515('0x3b')]),_0x1364e1);if(_0x5ab0ee[_0xa515('0x30')][_0xa515('0x3d')]){_0x3551aa[_0xa515('0x3a')]=_[_0xa515('0x3e')](_0x3551aa[_0xa515('0x3a')],{'$or':_[_0xa515('0x2f')](_0x1364e1,function(_0x3b111c){if(_0x3b111c[_0xa515('0x2d')]!==_0xa515('0x3f')){var _0x2b4282={};_0x2b4282[_0x3b111c[_0xa515('0x29')]]={'$like':'%'+_0x5ab0ee[_0xa515('0x30')][_0xa515('0x3d')]+'%'};return _0x2b4282;}})});}_0x3551aa=_[_0xa515('0x3e')]({},_0x3551aa,_0x5ab0ee[_0xa515('0x40')]);var _0x1fcdfb={'where':_0x3551aa[_0xa515('0x3a')]};return db[_0xa515('0x2b')][_0xa515('0x1e')](_0x1fcdfb)['then'](function(_0x4d8183){_0x5acd1a[_0xa515('0x1e')]=_0x4d8183;if(_0x5ab0ee[_0xa515('0x30')][_0xa515('0x41')]){_0x3551aa[_0xa515('0x42')]=[{'all':!![]}];}return db[_0xa515('0x2b')][_0xa515('0x43')](_0x3551aa);})['then'](function(_0x14e8fe){_0x5acd1a[_0xa515('0x44')]=_0x14e8fe;return _0x5acd1a;})[_0xa515('0x45')](respondWithFilteredResult(_0x2a990a,_0x3551aa))[_0xa515('0x46')](handleError(_0x2a990a,null));};exports[_0xa515('0x47')]=function(_0x142c94,_0xd880fc){var _0x216c0f={'raw':![],'where':{'id':_0x142c94[_0xa515('0x48')]['id']}},_0x557965={};_0x557965['model']=_[_0xa515('0x49')](db[_0xa515('0x2b')]['rawAttributes']);_0x557965[_0xa515('0x30')]=_[_0xa515('0x49')](_0x142c94['query']);_0x557965['filters']=_[_0xa515('0x31')](_0x557965[_0xa515('0x32')],_0x557965[_0xa515('0x30')]);_0x216c0f[_0xa515('0x33')]=_[_0xa515('0x31')](_0x557965[_0xa515('0x32')],qs[_0xa515('0x34')](_0x142c94[_0xa515('0x30')]['fields']));_0x216c0f[_0xa515('0x33')]=_0x216c0f[_0xa515('0x33')][_0xa515('0x35')]?_0x216c0f['attributes']:_0x557965['model'];if(_0x142c94[_0xa515('0x30')][_0xa515('0x41')]){_0x216c0f[_0xa515('0x42')]=[{'all':!![]}];}_0x216c0f=_['merge']({},_0x216c0f,_0x142c94[_0xa515('0x40')]);return db[_0xa515('0x2b')][_0xa515('0x4a')](_0x216c0f)[_0xa515('0x45')](handleEntityNotFound(_0xd880fc,null))[_0xa515('0x45')](respondWithResult(_0xd880fc,null))['catch'](handleError(_0xd880fc,null));};exports[_0xa515('0x4b')]=function(_0x47af7d,_0x5e2302){return db[_0xa515('0x2b')][_0xa515('0x4b')](_0x47af7d[_0xa515('0x4c')],{})[_0xa515('0x45')](respondWithResult(_0x5e2302,0xc9))['catch'](handleError(_0x5e2302,null));};exports[_0xa515('0x26')]=function(_0xd58763,_0x523ca4){if(_0xd58763[_0xa515('0x4c')]['id']){delete _0xd58763[_0xa515('0x4c')]['id'];}return db[_0xa515('0x2b')][_0xa515('0x4a')]({'where':{'id':_0xd58763[_0xa515('0x48')]['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x523ca4,null))[_0xa515('0x45')](saveUpdates(_0xd58763[_0xa515('0x4c')],null))[_0xa515('0x45')](respondWithResult(_0x523ca4,null))[_0xa515('0x46')](handleError(_0x523ca4,null));};exports[_0xa515('0x27')]=function(_0x5a1fd6,_0x58ddcc){return db[_0xa515('0x2b')][_0xa515('0x4a')]({'where':{'id':_0x5a1fd6[_0xa515('0x48')]['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x58ddcc,null))[_0xa515('0x45')](removeEntity(_0x58ddcc,null))[_0xa515('0x46')](handleError(_0x58ddcc,null));};exports['getFields']=function(_0x184941,_0x1948a6,_0x4fef7a){var _0x22c3ec={};var _0x4b43f7={};var _0x3d9f7d;var _0x3d2b89;return db[_0xa515('0x2b')][_0xa515('0x4d')]({'where':{'id':_0x184941['params']['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x1948a6,null))[_0xa515('0x45')](function(_0x3b477f){if(_0x3b477f){_0x3d9f7d=_0x3b477f;_0x4b43f7[_0xa515('0x32')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x4b43f7[_0xa515('0x30')]=_[_0xa515('0x49')](_0x184941[_0xa515('0x30')]);_0x4b43f7['filters']=_[_0xa515('0x31')](_0x4b43f7[_0xa515('0x32')],_0x4b43f7[_0xa515('0x30')]);_0x22c3ec[_0xa515('0x33')]=_[_0xa515('0x31')](_0x4b43f7[_0xa515('0x32')],qs[_0xa515('0x34')](_0x184941[_0xa515('0x30')][_0xa515('0x34')]));_0x22c3ec['attributes']=_0x22c3ec['attributes'][_0xa515('0x35')]?_0x22c3ec[_0xa515('0x33')]:_0x4b43f7[_0xa515('0x32')];_0x22c3ec['order']=qs[_0xa515('0x39')](_0x184941[_0xa515('0x30')][_0xa515('0x39')]);_0x22c3ec[_0xa515('0x3a')]=qs[_0xa515('0x3b')](_[_0xa515('0x3c')](_0x184941['query'],_0x4b43f7[_0xa515('0x3b')]));if(_0x184941[_0xa515('0x30')][_0xa515('0x3d')]){_0x22c3ec['where']=_[_0xa515('0x3e')](_0x22c3ec[_0xa515('0x3a')],{'$or':_['map'](_0x22c3ec['attributes'],function(_0x55b653){var _0x48957d={};_0x48957d[_0x55b653]={'$like':'%'+_0x184941[_0xa515('0x30')][_0xa515('0x3d')]+'%'};return _0x48957d;})});}_0x22c3ec=_[_0xa515('0x3e')]({},_0x22c3ec,_0x184941[_0xa515('0x40')]);return _0x3d9f7d['getFields'](_0x22c3ec);}})[_0xa515('0x45')](function(_0x504e29){if(_0x504e29){_0x3d2b89=_0x504e29[_0xa515('0x35')];if(!_0x184941['query'][_0xa515('0x36')]('nolimit')){_0x22c3ec['limit']=qs['limit'](_0x184941['query'][_0xa515('0x20')]);_0x22c3ec[_0xa515('0x1f')]=qs[_0xa515('0x1f')](_0x184941['query'][_0xa515('0x1f')]);}return _0x3d9f7d[_0xa515('0x4e')](_0x22c3ec);}})[_0xa515('0x45')](function(_0xda7d2f){if(_0xda7d2f){return _0xda7d2f?{'count':_0x3d2b89,'rows':_0xda7d2f}:null;}})['then'](respondWithResult(_0x1948a6,null))[_0xa515('0x46')](handleError(_0x1948a6,null));};exports['getSubjects']=function(_0x211272,_0x1c9e9c,_0x5764ec){var _0x4c15e9={};var _0x4aab2f={};var _0x25ce01;var _0x420fc8;return db[_0xa515('0x2b')][_0xa515('0x4d')]({'where':{'id':_0x211272[_0xa515('0x48')]['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x1c9e9c,null))['then'](function(_0x19472a){if(_0x19472a){_0x25ce01=_0x19472a;_0x4aab2f[_0xa515('0x32')]=_['keys'](db[_0xa515('0x4f')]['rawAttributes']);_0x4aab2f['query']=_[_0xa515('0x49')](_0x211272[_0xa515('0x30')]);_0x4aab2f['filters']=_[_0xa515('0x31')](_0x4aab2f[_0xa515('0x32')],_0x4aab2f['query']);_0x4c15e9['attributes']=_['intersection'](_0x4aab2f[_0xa515('0x32')],qs[_0xa515('0x34')](_0x211272[_0xa515('0x30')][_0xa515('0x34')]));_0x4c15e9['attributes']=_0x4c15e9[_0xa515('0x33')][_0xa515('0x35')]?_0x4c15e9[_0xa515('0x33')]:_0x4aab2f[_0xa515('0x32')];_0x4c15e9[_0xa515('0x38')]=qs[_0xa515('0x39')](_0x211272[_0xa515('0x30')][_0xa515('0x39')]);_0x4c15e9[_0xa515('0x3a')]=qs['filters'](_[_0xa515('0x3c')](_0x211272[_0xa515('0x30')],_0x4aab2f[_0xa515('0x3b')]));if(_0x211272[_0xa515('0x30')][_0xa515('0x3d')]){_0x4c15e9[_0xa515('0x3a')]=_['merge'](_0x4c15e9[_0xa515('0x3a')],{'$or':_[_0xa515('0x2f')](_0x4c15e9[_0xa515('0x33')],function(_0x3e3656){var _0x209ec8={};_0x209ec8[_0x3e3656]={'$like':'%'+_0x211272[_0xa515('0x30')][_0xa515('0x3d')]+'%'};return _0x209ec8;})});}_0x4c15e9=_[_0xa515('0x3e')]({},_0x4c15e9,_0x211272[_0xa515('0x40')]);return _0x25ce01[_0xa515('0x50')](_0x4c15e9);}})[_0xa515('0x45')](function(_0x343c0a){if(_0x343c0a){_0x420fc8=_0x343c0a[_0xa515('0x35')];if(!_0x211272[_0xa515('0x30')]['hasOwnProperty']('nolimit')){_0x4c15e9[_0xa515('0x20')]=qs['limit'](_0x211272[_0xa515('0x30')]['limit']);_0x4c15e9[_0xa515('0x1f')]=qs[_0xa515('0x1f')](_0x211272[_0xa515('0x30')][_0xa515('0x1f')]);}return _0x25ce01[_0xa515('0x50')](_0x4c15e9);}})['then'](function(_0x68d9ad){if(_0x68d9ad){return _0x68d9ad?{'count':_0x420fc8,'rows':_0x68d9ad}:null;}})[_0xa515('0x45')](respondWithResult(_0x1c9e9c,null))[_0xa515('0x46')](handleError(_0x1c9e9c,null));};exports[_0xa515('0x51')]=function(_0x2d8615,_0x23c793,_0x1d07b6){var _0x433ded={};var _0x5632e0={};var _0x1dc926;var _0x157377;return db['SugarcrmConfiguration'][_0xa515('0x4d')]({'where':{'id':_0x2d8615[_0xa515('0x48')]['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x23c793,null))[_0xa515('0x45')](function(_0x46ac54){if(_0x46ac54){_0x1dc926=_0x46ac54;_0x5632e0[_0xa515('0x32')]=_['keys'](db[_0xa515('0x4f')][_0xa515('0x52')]);_0x5632e0[_0xa515('0x30')]=_[_0xa515('0x49')](_0x2d8615[_0xa515('0x30')]);_0x5632e0['filters']=_['intersection'](_0x5632e0[_0xa515('0x32')],_0x5632e0[_0xa515('0x30')]);_0x433ded[_0xa515('0x33')]=_['intersection'](_0x5632e0[_0xa515('0x32')],qs[_0xa515('0x34')](_0x2d8615['query'][_0xa515('0x34')]));_0x433ded[_0xa515('0x33')]=_0x433ded[_0xa515('0x33')][_0xa515('0x35')]?_0x433ded[_0xa515('0x33')]:_0x5632e0[_0xa515('0x32')];_0x433ded[_0xa515('0x38')]=qs[_0xa515('0x39')](_0x2d8615[_0xa515('0x30')]['sort']);_0x433ded[_0xa515('0x3a')]=qs[_0xa515('0x3b')](_['pick'](_0x2d8615[_0xa515('0x30')],_0x5632e0[_0xa515('0x3b')]));if(_0x2d8615[_0xa515('0x30')][_0xa515('0x3d')]){_0x433ded[_0xa515('0x3a')]=_[_0xa515('0x3e')](_0x433ded['where'],{'$or':_['map'](_0x433ded[_0xa515('0x33')],function(_0x4a2cb7){var _0x22f6df={};_0x22f6df[_0x4a2cb7]={'$like':'%'+_0x2d8615[_0xa515('0x30')][_0xa515('0x3d')]+'%'};return _0x22f6df;})});}_0x433ded=_[_0xa515('0x3e')]({},_0x433ded,_0x2d8615[_0xa515('0x40')]);return _0x1dc926[_0xa515('0x51')](_0x433ded);}})[_0xa515('0x45')](function(_0x51cc06){if(_0x51cc06){_0x157377=_0x51cc06[_0xa515('0x35')];if(!_0x2d8615[_0xa515('0x30')][_0xa515('0x36')](_0xa515('0x37'))){_0x433ded[_0xa515('0x20')]=qs[_0xa515('0x20')](_0x2d8615[_0xa515('0x30')]['limit']);_0x433ded[_0xa515('0x1f')]=qs['offset'](_0x2d8615['query'][_0xa515('0x1f')]);}return _0x1dc926[_0xa515('0x51')](_0x433ded);}})[_0xa515('0x45')](function(_0x2ce8af){if(_0x2ce8af){return _0x2ce8af?{'count':_0x157377,'rows':_0x2ce8af}:null;}})[_0xa515('0x45')](respondWithResult(_0x23c793,null))[_0xa515('0x46')](handleError(_0x23c793,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index b7e751a..1918094 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 _0x1780=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration'];(function(_0x43841f,_0x4df0c4){var _0x417f61=function(_0x4a354e){while(--_0x4a354e){_0x43841f['push'](_0x43841f['shift']());}};_0x417f61(++_0x4df0c4);}(_0x1780,0xaa));var _0x0178=function(_0x3a7ad6,_0x48fcc7){_0x3a7ad6=_0x3a7ad6-0x0;var _0x10a87d=_0x1780[_0x3a7ad6];return _0x10a87d;};'use strict';var _=require(_0x0178('0x0'));var util=require(_0x0178('0x1'));var logger=require(_0x0178('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0178('0x3'));var fs=require('fs');var path=require(_0x0178('0x4'));var rimraf=require(_0x0178('0x5'));var config=require(_0x0178('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x0178('0x7')]=function(_0x586539,_0x36a851){return _0x586539[_0x0178('0x8')](_0x0178('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3756=['util','../../config/logger','api','bluebird','rimraf','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x376419,_0x4d9431){var _0x54ec18=function(_0x1b0916){while(--_0x1b0916){_0x376419['push'](_0x376419['shift']());}};_0x54ec18(++_0x4d9431);}(_0x3756,0x170));var _0x6375=function(_0x3f0a49,_0x59fcca){_0x3f0a49=_0x3f0a49-0x0;var _0x49798f=_0x3756[_0x3f0a49];return _0x49798f;};'use strict';var _=require(_0x6375('0x0'));var util=require(_0x6375('0x1'));var logger=require(_0x6375('0x2'))(_0x6375('0x3'));var moment=require('moment');var BPromise=require(_0x6375('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6375('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x124343,_0xad3764){return _0x124343[_0x6375('0x6')](_0x6375('0x7'),attributes,{'tableName':_0x6375('0x8'),'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 eb5f612..0a2180b 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 _0x28f4=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x215821,_0x363341){var _0x485e5a=function(_0x4e41cf){while(--_0x4e41cf){_0x215821['push'](_0x215821['shift']());}};_0x485e5a(++_0x363341);}(_0x28f4,0xc9));var _0x428f=function(_0xe518fc,_0x5d2684){_0xe518fc=_0xe518fc-0x0;var _0x759b7a=_0x28f4[_0xe518fc];return _0x759b7a;};'use strict';var _=require(_0x428f('0x0'));var util=require(_0x428f('0x1'));var moment=require(_0x428f('0x2'));var BPromise=require(_0x428f('0x3'));var rs=require(_0x428f('0x4'));var fs=require('fs');var Redis=require(_0x428f('0x5'));var db=require(_0x428f('0x6'))['db'];var utils=require(_0x428f('0x7'));var logger=require(_0x428f('0x8'))(_0x428f('0x9'));var config=require(_0x428f('0xa'));var jayson=require(_0x428f('0xb'));var client=jayson['client'][_0x428f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51aa56,_0x4a6a63,_0x55abdd){return new BPromise(function(_0x355d20,_0x24078e){return client[_0x428f('0xd')](_0x51aa56,_0x55abdd)['then'](function(_0x49ba73){logger[_0x428f('0xe')](_0x428f('0xf'),_0x4a6a63,'request\x20sent');logger[_0x428f('0x10')](_0x428f('0x11'),_0x4a6a63,_0x428f('0x12'),JSON[_0x428f('0x13')](_0x49ba73));if(_0x49ba73[_0x428f('0x14')]){if(_0x49ba73[_0x428f('0x14')][_0x428f('0x15')]===0x1f4){logger[_0x428f('0x14')](_0x428f('0xf'),_0x4a6a63,_0x49ba73[_0x428f('0x14')][_0x428f('0x16')]);return _0x24078e(_0x49ba73[_0x428f('0x14')][_0x428f('0x16')]);}logger[_0x428f('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4a6a63,_0x49ba73[_0x428f('0x14')]['message']);return _0x355d20(_0x49ba73[_0x428f('0x14')][_0x428f('0x16')]);}else{logger['info'](_0x428f('0xf'),_0x4a6a63,_0x428f('0x12'));_0x355d20(_0x49ba73[_0x428f('0x17')][_0x428f('0x16')]);}})[_0x428f('0x18')](function(_0x58b176){logger[_0x428f('0x14')](_0x428f('0xf'),_0x4a6a63,_0x58b176);_0x24078e(_0x58b176);});});} \ No newline at end of file +var _0x0284=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x0284,0x124));var _0x4028=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x0284[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0x4028('0x0'));var moment=require(_0x4028('0x1'));var BPromise=require(_0x4028('0x2'));var rs=require(_0x4028('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4028('0x4'))(_0x4028('0x5'));var config=require(_0x4028('0x6'));var jayson=require(_0x4028('0x7'));var client=jayson[_0x4028('0x8')][_0x4028('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233959,_0x96bffc,_0x386d97){return new BPromise(function(_0x25bd7d,_0x4b0d24){return client[_0x4028('0xa')](_0x233959,_0x386d97)['then'](function(_0x470112){logger[_0x4028('0xb')](_0x4028('0xc'),_0x96bffc,_0x4028('0xd'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x96bffc,_0x4028('0xd'),JSON[_0x4028('0xe')](_0x470112));if(_0x470112[_0x4028('0xf')]){if(_0x470112['error']['code']===0x1f4){logger['error'](_0x4028('0xc'),_0x96bffc,_0x470112[_0x4028('0xf')][_0x4028('0x10')]);return _0x4b0d24(_0x470112[_0x4028('0xf')][_0x4028('0x10')]);}logger[_0x4028('0xf')](_0x4028('0xc'),_0x96bffc,_0x470112[_0x4028('0xf')][_0x4028('0x10')]);return _0x25bd7d(_0x470112[_0x4028('0xf')][_0x4028('0x10')]);}else{logger[_0x4028('0xb')](_0x4028('0xc'),_0x96bffc,_0x4028('0xd'));_0x25bd7d(_0x470112[_0x4028('0x11')]['message']);}})[_0x4028('0x12')](function(_0x11f386){logger[_0x4028('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x96bffc,_0x11f386);_0x4b0d24(_0x11f386);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f9398e5..8cc52c1 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 _0x6976=['./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','put','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x530de2,_0x1ccfad){var _0x379ed3=function(_0x47ba15){while(--_0x47ba15){_0x530de2['push'](_0x530de2['shift']());}};_0x379ed3(++_0x1ccfad);}(_0x6976,0x18e));var _0x6697=function(_0x3be3b9,_0x32c92b){_0x3be3b9=_0x3be3b9-0x0;var _0x1cf8de=_0x6976[_0x3be3b9];return _0x1cf8de;};'use strict';var multer=require(_0x6697('0x0'));var util=require('util');var path=require(_0x6697('0x1'));var timeout=require(_0x6697('0x2'));var express=require(_0x6697('0x3'));var router=express[_0x6697('0x4')]();var fs_extra=require(_0x6697('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6697('0x6'));var controller=require(_0x6697('0x7'));router[_0x6697('0x8')]('/',auth[_0x6697('0x9')](),controller[_0x6697('0xa')]);router['get'](_0x6697('0xb'),auth[_0x6697('0x9')](),controller['show']);router[_0x6697('0xc')]('/',auth[_0x6697('0x9')](),controller[_0x6697('0xd')]);router[_0x6697('0xe')](_0x6697('0xb'),auth[_0x6697('0x9')](),controller['update']);router['delete'](_0x6697('0xb'),auth[_0x6697('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x213f=['../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x48206c,_0xbcbc49){var _0x35f2e3=function(_0x4e4e3f){while(--_0x4e4e3f){_0x48206c['push'](_0x48206c['shift']());}};_0x35f2e3(++_0xbcbc49);}(_0x213f,0x80));var _0xf213=function(_0x4dff07,_0x317b0e){_0x4dff07=_0x4dff07-0x0;var _0x38aba5=_0x213f[_0x4dff07];return _0x38aba5;};'use strict';var multer=require(_0xf213('0x0'));var util=require('util');var path=require(_0xf213('0x1'));var timeout=require('connect-timeout');var express=require(_0xf213('0x2'));var router=express[_0xf213('0x3')]();var fs_extra=require(_0xf213('0x4'));var auth=require(_0xf213('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf213('0x6'));var controller=require(_0xf213('0x7'));router[_0xf213('0x8')]('/',auth[_0xf213('0x9')](),controller[_0xf213('0xa')]);router[_0xf213('0x8')](_0xf213('0xb'),auth[_0xf213('0x9')](),controller[_0xf213('0xc')]);router[_0xf213('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf213('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf213('0xf')]);router[_0xf213('0x10')]('/:id',auth[_0xf213('0x9')](),controller[_0xf213('0x11')]);module[_0xf213('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 21bd2f5..4dac472 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 _0x09fb=['exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x40c3e2,_0x2a076f){var _0x1ef69e=function(_0x2b2bfc){while(--_0x2b2bfc){_0x40c3e2['push'](_0x40c3e2['shift']());}};_0x1ef69e(++_0x2a076f);}(_0x09fb,0x1d8));var _0xb09f=function(_0x7deb4b,_0x2f90cb){_0x7deb4b=_0x7deb4b-0x0;var _0x1933b4=_0x09fb[_0x7deb4b];return _0x1933b4;};'use strict';var Sequelize=require('sequelize');module[_0xb09f('0x0')]={'type':{'type':Sequelize['ENUM'](_0xb09f('0x1'),_0xb09f('0x2'),_0xb09f('0x3'),_0xb09f('0x4'),_0xb09f('0x5')),'defaultValue':_0xb09f('0x1')},'content':{'type':Sequelize[_0xb09f('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb09f('0x7')](_0xb09f('0x1'),_0xb09f('0x2'),_0xb09f('0x3'))},'keyContent':{'type':Sequelize[_0xb09f('0x6')]},'idField':{'type':Sequelize[_0xb09f('0x6')]},'nameField':{'type':Sequelize[_0xb09f('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb09f('0x6')]}}; \ No newline at end of file +var _0x205a=['string','keyValue','STRING','ENUM','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0x3fa937,_0x45f3de){var _0x1d4235=function(_0xf435a3){while(--_0xf435a3){_0x3fa937['push'](_0x3fa937['shift']());}};_0x1d4235(++_0x45f3de);}(_0x205a,0x193));var _0xa205=function(_0xda0ec3,_0xbd14a0){_0xda0ec3=_0xda0ec3-0x0;var _0x258b92=_0x205a[_0xda0ec3];return _0x258b92;};'use strict';var Sequelize=require(_0xa205('0x0'));module[_0xa205('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa205('0x2'),'variable','customVariable',_0xa205('0x3'),'picklist'),'defaultValue':_0xa205('0x2')},'content':{'type':Sequelize[_0xa205('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa205('0x5')](_0xa205('0x2'),_0xa205('0x6'),_0xa205('0x7'))},'keyContent':{'type':Sequelize[_0xa205('0x4')]},'idField':{'type':Sequelize[_0xa205('0x4')]},'nameField':{'type':Sequelize[_0xa205('0x4')]},'customField':{'type':Sequelize[_0xa205('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa205('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index cd8394a..eeabd5a 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 _0x5300=['options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','send','map','SugarcrmField','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','length','nolimit','where','filters','pick','filter','merge','type','VIRTUAL'];(function(_0x1615a7,_0x432c15){var _0x4449b4=function(_0x4b0556){while(--_0x4b0556){_0x1615a7['push'](_0x1615a7['shift']());}};_0x4449b4(++_0x432c15);}(_0x5300,0x9e));var _0x0530=function(_0x30b159,_0x41a60f){_0x30b159=_0x30b159-0x0;var _0x1e2257=_0x5300[_0x30b159];return _0x1e2257;};'use strict';var emlformat=require(_0x0530('0x0'));var rimraf=require(_0x0530('0x1'));var zipdir=require(_0x0530('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0530('0x3'));var moment=require(_0x0530('0x4'));var BPromise=require(_0x0530('0x5'));var Mustache=require(_0x0530('0x6'));var util=require(_0x0530('0x7'));var path=require(_0x0530('0x8'));var sox=require('sox');var csv=require(_0x0530('0x9'));var ejs=require(_0x0530('0xa'));var fs=require('fs');var fs_extra=require(_0x0530('0xb'));var _=require(_0x0530('0xc'));var squel=require(_0x0530('0xd'));var crypto=require(_0x0530('0xe'));var jsforce=require(_0x0530('0xf'));var deskjs=require(_0x0530('0x10'));var toCsv=require(_0x0530('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0530('0x11'));var authService=require(_0x0530('0x12'));var qs=require(_0x0530('0x13'));var as=require(_0x0530('0x14'));var hardwareService=require(_0x0530('0x15'));var logger=require(_0x0530('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x0530('0x17'));var licenseUtil=require(_0x0530('0x18'));var db=require(_0x0530('0x19'))['db'];function respondWithStatusCode(_0x393f55,_0x4f5528){_0x4f5528=_0x4f5528||0xcc;return function(_0xa44a0e){if(_0xa44a0e){return _0x393f55[_0x0530('0x1a')](_0x4f5528);}return _0x393f55[_0x0530('0x1b')](_0x4f5528)[_0x0530('0x1c')]();};}function respondWithResult(_0x11f258,_0x28b073){_0x28b073=_0x28b073||0xc8;return function(_0x54eebf){if(_0x54eebf){return _0x11f258['status'](_0x28b073)[_0x0530('0x1d')](_0x54eebf);}};}function respondWithFilteredResult(_0x564703,_0x32fd4a){return function(_0x3eca80){if(_0x3eca80){var _0x461baf=typeof _0x32fd4a['offset']===_0x0530('0x1e')&&typeof _0x32fd4a[_0x0530('0x1f')]===_0x0530('0x1e');var _0x2d4a4a=_0x3eca80[_0x0530('0x20')];var _0x431493=_0x461baf?0x0:_0x32fd4a[_0x0530('0x21')];var _0x4c85b4=_0x461baf?_0x3eca80[_0x0530('0x20')]:_0x32fd4a[_0x0530('0x21')]+_0x32fd4a[_0x0530('0x1f')];var _0x407d79;if(_0x4c85b4>=_0x2d4a4a){_0x4c85b4=_0x2d4a4a;_0x407d79=0xc8;}else{_0x407d79=0xce;}_0x564703[_0x0530('0x1b')](_0x407d79);return _0x564703[_0x0530('0x22')](_0x0530('0x23'),_0x431493+'-'+_0x4c85b4+'/'+_0x2d4a4a)[_0x0530('0x1d')](_0x3eca80);}return null;};}function patchUpdates(_0x3f3102){return function(_0x3d1468){try{jsonpatch['apply'](_0x3d1468,_0x3f3102,!![]);}catch(_0x5d6b12){return BPromise[_0x0530('0x24')](_0x5d6b12);}return _0x3d1468[_0x0530('0x25')]();};}function saveUpdates(_0x1ede74,_0xe14bdc){return function(_0x537eb9){if(_0x537eb9){return _0x537eb9[_0x0530('0x26')](_0x1ede74)[_0x0530('0x27')](function(_0x994797){return _0x994797;});}return null;};}function removeEntity(_0x33ca2b,_0x3941e9){return function(_0x5d6878){if(_0x5d6878){return _0x5d6878['destroy']()[_0x0530('0x27')](function(){_0x33ca2b[_0x0530('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1689db,_0x40ea78){return function(_0x494f8a){if(!_0x494f8a){_0x1689db[_0x0530('0x1a')](0x194);}return _0x494f8a;};}function handleError(_0x147ba2,_0x1cbc60){_0x1cbc60=_0x1cbc60||0x1f4;return function(_0x4f96ad){logger[_0x0530('0x28')](_0x4f96ad['stack']);if(_0x4f96ad['name']){delete _0x4f96ad['name'];}_0x147ba2[_0x0530('0x1b')](_0x1cbc60)[_0x0530('0x29')](_0x4f96ad);};}exports['index']=function(_0x30c65c,_0xa117b8){var _0xb3fd49={},_0x1fd770={},_0x1d5c01={'count':0x0,'rows':[]};var _0x56faab=_[_0x0530('0x2a')](db[_0x0530('0x2b')][_0x0530('0x2c')],function(_0x409c7b){return{'name':_0x409c7b[_0x0530('0x2d')],'type':_0x409c7b['type'][_0x0530('0x2e')]};});_0x1fd770['model']=_['map'](_0x56faab,'name');_0x1fd770['query']=_[_0x0530('0x2f')](_0x30c65c[_0x0530('0x30')]);_0x1fd770['filters']=_[_0x0530('0x31')](_0x1fd770[_0x0530('0x32')],_0x1fd770[_0x0530('0x30')]);_0xb3fd49[_0x0530('0x33')]=_['intersection'](_0x1fd770['model'],qs['fields'](_0x30c65c[_0x0530('0x30')]['fields']));_0xb3fd49[_0x0530('0x33')]=_0xb3fd49[_0x0530('0x33')][_0x0530('0x34')]?_0xb3fd49[_0x0530('0x33')]:_0x1fd770[_0x0530('0x32')];if(!_0x30c65c[_0x0530('0x30')]['hasOwnProperty'](_0x0530('0x35'))){_0xb3fd49['limit']=qs[_0x0530('0x1f')](_0x30c65c[_0x0530('0x30')][_0x0530('0x1f')]);_0xb3fd49[_0x0530('0x21')]=qs[_0x0530('0x21')](_0x30c65c[_0x0530('0x30')][_0x0530('0x21')]);}_0xb3fd49['order']=qs['sort'](_0x30c65c[_0x0530('0x30')]['sort']);_0xb3fd49[_0x0530('0x36')]=qs[_0x0530('0x37')](_[_0x0530('0x38')](_0x30c65c[_0x0530('0x30')],_0x1fd770[_0x0530('0x37')]),_0x56faab);if(_0x30c65c[_0x0530('0x30')][_0x0530('0x39')]){_0xb3fd49['where']=_[_0x0530('0x3a')](_0xb3fd49[_0x0530('0x36')],{'$or':_[_0x0530('0x2a')](_0x56faab,function(_0x635bc2){if(_0x635bc2[_0x0530('0x3b')]!==_0x0530('0x3c')){var _0x4aeab5={};_0x4aeab5[_0x635bc2['name']]={'$like':'%'+_0x30c65c[_0x0530('0x30')][_0x0530('0x39')]+'%'};return _0x4aeab5;}})});}_0xb3fd49=_[_0x0530('0x3a')]({},_0xb3fd49,_0x30c65c[_0x0530('0x3d')]);var _0xae3545={'where':_0xb3fd49[_0x0530('0x36')]};return db[_0x0530('0x2b')][_0x0530('0x20')](_0xae3545)[_0x0530('0x27')](function(_0xde781){_0x1d5c01[_0x0530('0x20')]=_0xde781;if(_0x30c65c[_0x0530('0x30')][_0x0530('0x3e')]){_0xb3fd49[_0x0530('0x3f')]=[{'all':!![]}];}return db['SugarcrmField'][_0x0530('0x40')](_0xb3fd49);})[_0x0530('0x27')](function(_0x429106){_0x1d5c01[_0x0530('0x41')]=_0x429106;return _0x1d5c01;})['then'](respondWithFilteredResult(_0xa117b8,_0xb3fd49))[_0x0530('0x42')](handleError(_0xa117b8,null));};exports[_0x0530('0x43')]=function(_0x334948,_0x29bf8d){var _0x16c313={'raw':!![],'where':{'id':_0x334948[_0x0530('0x44')]['id']}},_0x253b7f={};_0x253b7f[_0x0530('0x32')]=_[_0x0530('0x2f')](db[_0x0530('0x2b')][_0x0530('0x2c')]);_0x253b7f['query']=_[_0x0530('0x2f')](_0x334948[_0x0530('0x30')]);_0x253b7f[_0x0530('0x37')]=_[_0x0530('0x31')](_0x253b7f[_0x0530('0x32')],_0x253b7f[_0x0530('0x30')]);_0x16c313[_0x0530('0x33')]=_[_0x0530('0x31')](_0x253b7f[_0x0530('0x32')],qs['fields'](_0x334948[_0x0530('0x30')][_0x0530('0x45')]));_0x16c313['attributes']=_0x16c313[_0x0530('0x33')][_0x0530('0x34')]?_0x16c313[_0x0530('0x33')]:_0x253b7f[_0x0530('0x32')];if(_0x334948[_0x0530('0x30')][_0x0530('0x3e')]){_0x16c313[_0x0530('0x3f')]=[{'all':!![]}];}_0x16c313=_[_0x0530('0x3a')]({},_0x16c313,_0x334948[_0x0530('0x3d')]);return db[_0x0530('0x2b')][_0x0530('0x46')](_0x16c313)[_0x0530('0x27')](handleEntityNotFound(_0x29bf8d,null))[_0x0530('0x27')](respondWithResult(_0x29bf8d,null))[_0x0530('0x42')](handleError(_0x29bf8d,null));};exports['create']=function(_0x143fbd,_0x3323c0){return db[_0x0530('0x2b')][_0x0530('0x47')](_0x143fbd[_0x0530('0x48')],{})['then'](respondWithResult(_0x3323c0,0xc9))[_0x0530('0x42')](handleError(_0x3323c0,null));};exports[_0x0530('0x26')]=function(_0x23134e,_0x284500){if(_0x23134e['body']['id']){delete _0x23134e[_0x0530('0x48')]['id'];}return db[_0x0530('0x2b')][_0x0530('0x46')]({'where':{'id':_0x23134e[_0x0530('0x44')]['id']}})['then'](handleEntityNotFound(_0x284500,null))['then'](saveUpdates(_0x23134e[_0x0530('0x48')],null))[_0x0530('0x27')](respondWithResult(_0x284500,null))[_0x0530('0x42')](handleError(_0x284500,null));};exports['destroy']=function(_0x4d8420,_0x1c00ec){return db[_0x0530('0x2b')][_0x0530('0x46')]({'where':{'id':_0x4d8420[_0x0530('0x44')]['id']}})[_0x0530('0x27')](handleEntityNotFound(_0x1c00ec,null))[_0x0530('0x27')](removeEntity(_0x1c00ec,null))[_0x0530('0x42')](handleError(_0x1c00ec,null));}; \ No newline at end of file +var _0xb90f=['rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SugarcrmField','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','destroy','eml-format'];(function(_0x19fa95,_0x1cca0a){var _0x58a835=function(_0x3e1957){while(--_0x3e1957){_0x19fa95['push'](_0x19fa95['shift']());}};_0x58a835(++_0x1cca0a);}(_0xb90f,0x12b));var _0xfb90=function(_0x594db6,_0x7250cc){_0x594db6=_0x594db6-0x0;var _0x2f1e00=_0xb90f[_0x594db6];return _0x2f1e00;};'use strict';var emlformat=require(_0xfb90('0x0'));var rimraf=require(_0xfb90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb90('0x2'));var rp=require(_0xfb90('0x3'));var moment=require(_0xfb90('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfb90('0x5'));var util=require('util');var path=require(_0xfb90('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfb90('0x7'));var fs=require('fs');var fs_extra=require(_0xfb90('0x8'));var _=require(_0xfb90('0x9'));var squel=require(_0xfb90('0xa'));var crypto=require(_0xfb90('0xb'));var jsforce=require(_0xfb90('0xc'));var deskjs=require(_0xfb90('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfb90('0xe'));var Redis=require(_0xfb90('0xf'));var authService=require(_0xfb90('0x10'));var qs=require(_0xfb90('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb90('0x12'));var logger=require(_0xfb90('0x13'))(_0xfb90('0x14'));var utils=require(_0xfb90('0x15'));var config=require(_0xfb90('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb90('0x17'))['db'];function respondWithStatusCode(_0xade337,_0x552f86){_0x552f86=_0x552f86||0xcc;return function(_0x4faa1c){if(_0x4faa1c){return _0xade337['sendStatus'](_0x552f86);}return _0xade337[_0xfb90('0x18')](_0x552f86)[_0xfb90('0x19')]();};}function respondWithResult(_0x115b54,_0x34d7a4){_0x34d7a4=_0x34d7a4||0xc8;return function(_0x20002c){if(_0x20002c){return _0x115b54[_0xfb90('0x18')](_0x34d7a4)['json'](_0x20002c);}};}function respondWithFilteredResult(_0x3e26b3,_0x29d01a){return function(_0x312591){if(_0x312591){var _0x5f3395=typeof _0x29d01a['offset']===_0xfb90('0x1a')&&typeof _0x29d01a[_0xfb90('0x1b')]===_0xfb90('0x1a');var _0x1f7da5=_0x312591['count'];var _0x45d85b=_0x5f3395?0x0:_0x29d01a[_0xfb90('0x1c')];var _0x652029=_0x5f3395?_0x312591[_0xfb90('0x1d')]:_0x29d01a[_0xfb90('0x1c')]+_0x29d01a[_0xfb90('0x1b')];var _0xa3ee98;if(_0x652029>=_0x1f7da5){_0x652029=_0x1f7da5;_0xa3ee98=0xc8;}else{_0xa3ee98=0xce;}_0x3e26b3[_0xfb90('0x18')](_0xa3ee98);return _0x3e26b3[_0xfb90('0x1e')](_0xfb90('0x1f'),_0x45d85b+'-'+_0x652029+'/'+_0x1f7da5)[_0xfb90('0x20')](_0x312591);}return null;};}function patchUpdates(_0x48fee4){return function(_0x5f412d){try{jsonpatch[_0xfb90('0x21')](_0x5f412d,_0x48fee4,!![]);}catch(_0xe11551){return BPromise[_0xfb90('0x22')](_0xe11551);}return _0x5f412d[_0xfb90('0x23')]();};}function saveUpdates(_0x3df6ef,_0x20165d){return function(_0x276fd0){if(_0x276fd0){return _0x276fd0[_0xfb90('0x24')](_0x3df6ef)[_0xfb90('0x25')](function(_0x8ac1a0){return _0x8ac1a0;});}return null;};}function removeEntity(_0x1f260d,_0x761899){return function(_0x34fde8){if(_0x34fde8){return _0x34fde8['destroy']()[_0xfb90('0x25')](function(){_0x1f260d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ae4b,_0x5abcb3){return function(_0x181443){if(!_0x181443){_0x23ae4b[_0xfb90('0x26')](0x194);}return _0x181443;};}function handleError(_0x46546b,_0x42b8c9){_0x42b8c9=_0x42b8c9||0x1f4;return function(_0x1163f3){logger[_0xfb90('0x27')](_0x1163f3[_0xfb90('0x28')]);if(_0x1163f3[_0xfb90('0x29')]){delete _0x1163f3[_0xfb90('0x29')];}_0x46546b[_0xfb90('0x18')](_0x42b8c9)[_0xfb90('0x2a')](_0x1163f3);};}exports[_0xfb90('0x2b')]=function(_0x59061b,_0x171282){var _0xfc4b79={},_0x19c178={},_0x20448d={'count':0x0,'rows':[]};var _0x5b1a3a=_[_0xfb90('0x2c')](db[_0xfb90('0x2d')]['rawAttributes'],function(_0xa39dce){return{'name':_0xa39dce[_0xfb90('0x2e')],'type':_0xa39dce['type']['key']};});_0x19c178[_0xfb90('0x2f')]=_[_0xfb90('0x2c')](_0x5b1a3a,_0xfb90('0x29'));_0x19c178[_0xfb90('0x30')]=_[_0xfb90('0x31')](_0x59061b['query']);_0x19c178[_0xfb90('0x32')]=_[_0xfb90('0x33')](_0x19c178[_0xfb90('0x2f')],_0x19c178[_0xfb90('0x30')]);_0xfc4b79[_0xfb90('0x34')]=_['intersection'](_0x19c178['model'],qs[_0xfb90('0x35')](_0x59061b[_0xfb90('0x30')][_0xfb90('0x35')]));_0xfc4b79[_0xfb90('0x34')]=_0xfc4b79['attributes'][_0xfb90('0x36')]?_0xfc4b79['attributes']:_0x19c178[_0xfb90('0x2f')];if(!_0x59061b[_0xfb90('0x30')][_0xfb90('0x37')](_0xfb90('0x38'))){_0xfc4b79[_0xfb90('0x1b')]=qs[_0xfb90('0x1b')](_0x59061b[_0xfb90('0x30')]['limit']);_0xfc4b79['offset']=qs[_0xfb90('0x1c')](_0x59061b['query'][_0xfb90('0x1c')]);}_0xfc4b79[_0xfb90('0x39')]=qs[_0xfb90('0x3a')](_0x59061b[_0xfb90('0x30')][_0xfb90('0x3a')]);_0xfc4b79[_0xfb90('0x3b')]=qs['filters'](_[_0xfb90('0x3c')](_0x59061b['query'],_0x19c178[_0xfb90('0x32')]),_0x5b1a3a);if(_0x59061b[_0xfb90('0x30')][_0xfb90('0x3d')]){_0xfc4b79[_0xfb90('0x3b')]=_['merge'](_0xfc4b79[_0xfb90('0x3b')],{'$or':_[_0xfb90('0x2c')](_0x5b1a3a,function(_0xa94e1c){if(_0xa94e1c['type']!==_0xfb90('0x3e')){var _0x2768a6={};_0x2768a6[_0xa94e1c[_0xfb90('0x29')]]={'$like':'%'+_0x59061b[_0xfb90('0x30')][_0xfb90('0x3d')]+'%'};return _0x2768a6;}})});}_0xfc4b79=_['merge']({},_0xfc4b79,_0x59061b['options']);var _0x25c16f={'where':_0xfc4b79[_0xfb90('0x3b')]};return db[_0xfb90('0x2d')][_0xfb90('0x1d')](_0x25c16f)['then'](function(_0x3a1d45){_0x20448d[_0xfb90('0x1d')]=_0x3a1d45;if(_0x59061b[_0xfb90('0x30')]['includeAll']){_0xfc4b79[_0xfb90('0x3f')]=[{'all':!![]}];}return db[_0xfb90('0x2d')]['findAll'](_0xfc4b79);})[_0xfb90('0x25')](function(_0x2d6837){_0x20448d[_0xfb90('0x40')]=_0x2d6837;return _0x20448d;})['then'](respondWithFilteredResult(_0x171282,_0xfc4b79))[_0xfb90('0x41')](handleError(_0x171282,null));};exports[_0xfb90('0x42')]=function(_0x97d381,_0xa3ac71){var _0x22ea1e={'raw':!![],'where':{'id':_0x97d381[_0xfb90('0x43')]['id']}},_0x5766b0={};_0x5766b0[_0xfb90('0x2f')]=_[_0xfb90('0x31')](db[_0xfb90('0x2d')][_0xfb90('0x44')]);_0x5766b0[_0xfb90('0x30')]=_[_0xfb90('0x31')](_0x97d381[_0xfb90('0x30')]);_0x5766b0['filters']=_[_0xfb90('0x33')](_0x5766b0[_0xfb90('0x2f')],_0x5766b0[_0xfb90('0x30')]);_0x22ea1e[_0xfb90('0x34')]=_[_0xfb90('0x33')](_0x5766b0['model'],qs[_0xfb90('0x35')](_0x97d381[_0xfb90('0x30')][_0xfb90('0x35')]));_0x22ea1e[_0xfb90('0x34')]=_0x22ea1e[_0xfb90('0x34')][_0xfb90('0x36')]?_0x22ea1e[_0xfb90('0x34')]:_0x5766b0[_0xfb90('0x2f')];if(_0x97d381['query'][_0xfb90('0x45')]){_0x22ea1e[_0xfb90('0x3f')]=[{'all':!![]}];}_0x22ea1e=_['merge']({},_0x22ea1e,_0x97d381[_0xfb90('0x46')]);return db[_0xfb90('0x2d')][_0xfb90('0x47')](_0x22ea1e)[_0xfb90('0x25')](handleEntityNotFound(_0xa3ac71,null))[_0xfb90('0x25')](respondWithResult(_0xa3ac71,null))[_0xfb90('0x41')](handleError(_0xa3ac71,null));};exports[_0xfb90('0x48')]=function(_0x59460f,_0x5cc9a5){return db[_0xfb90('0x2d')][_0xfb90('0x48')](_0x59460f[_0xfb90('0x49')],{})[_0xfb90('0x25')](respondWithResult(_0x5cc9a5,0xc9))[_0xfb90('0x41')](handleError(_0x5cc9a5,null));};exports[_0xfb90('0x24')]=function(_0x13066c,_0x2edcf2){if(_0x13066c['body']['id']){delete _0x13066c[_0xfb90('0x49')]['id'];}return db[_0xfb90('0x2d')]['find']({'where':{'id':_0x13066c['params']['id']}})[_0xfb90('0x25')](handleEntityNotFound(_0x2edcf2,null))[_0xfb90('0x25')](saveUpdates(_0x13066c[_0xfb90('0x49')],null))[_0xfb90('0x25')](respondWithResult(_0x2edcf2,null))['catch'](handleError(_0x2edcf2,null));};exports[_0xfb90('0x4a')]=function(_0xb53c7b,_0x4df23d){return db[_0xfb90('0x2d')]['find']({'where':{'id':_0xb53c7b[_0xfb90('0x43')]['id']}})[_0xfb90('0x25')](handleEntityNotFound(_0x4df23d,null))[_0xfb90('0x25')](removeEntity(_0x4df23d,null))[_0xfb90('0x41')](handleError(_0x4df23d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index cb3d9fc..a33ed45 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 _0x27d5=['int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','define'];(function(_0x5a3d77,_0x1e1898){var _0x40e312=function(_0x541538){while(--_0x541538){_0x5a3d77['push'](_0x5a3d77['shift']());}};_0x40e312(++_0x1e1898);}(_0x27d5,0x9e));var _0x527d=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0x27d5[_0x56e32e];return _0x2a757b;};'use strict';var _=require(_0x527d('0x0'));var util=require(_0x527d('0x1'));var logger=require(_0x527d('0x2'))(_0x527d('0x3'));var moment=require('moment');var BPromise=require(_0x527d('0x4'));var rp=require(_0x527d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x527d('0x6'));var config=require(_0x527d('0x7'));var attributes=require(_0x527d('0x8'));module['exports']=function(_0x3534e9,_0x3fe9fb){return _0x3534e9[_0x527d('0x9')]('SugarcrmField',attributes,{'tableName':_0x527d('0xa'),'paranoid':![],'indexes':[{'name':_0x527d('0xb'),'fields':[_0x527d('0xc'),_0x527d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d03=['./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0x1d03,0x11f));var _0x31d0=function(_0x558e92,_0x516b05){_0x558e92=_0x558e92-0x0;var _0x1acb89=_0x1d03[_0x558e92];return _0x1acb89;};'use strict';var _=require(_0x31d0('0x0'));var util=require(_0x31d0('0x1'));var logger=require(_0x31d0('0x2'))(_0x31d0('0x3'));var moment=require('moment');var BPromise=require(_0x31d0('0x4'));var rp=require(_0x31d0('0x5'));var fs=require('fs');var path=require(_0x31d0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x31d0('0x7'));module[_0x31d0('0x8')]=function(_0x2b5714,_0x378a66){return _0x2b5714[_0x31d0('0x9')]('SugarcrmField',attributes,{'tableName':_0x31d0('0xa'),'paranoid':![],'indexes':[{'name':_0x31d0('0xb'),'fields':[_0x31d0('0xc'),_0x31d0('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 db32d6d..5b8f7de 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 _0x090b=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x397014,_0x17cc12){var _0x1163f7=function(_0x290ac1){while(--_0x290ac1){_0x397014['push'](_0x397014['shift']());}};_0x1163f7(++_0x17cc12);}(_0x090b,0x1e2));var _0xb090=function(_0x48c67c,_0x5d60aa){_0x48c67c=_0x48c67c-0x0;var _0x421706=_0x090b[_0x48c67c];return _0x421706;};'use strict';var _=require(_0xb090('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb090('0x1'));var rs=require(_0xb090('0x2'));var fs=require('fs');var Redis=require(_0xb090('0x3'));var db=require(_0xb090('0x4'))['db'];var utils=require(_0xb090('0x5'));var logger=require(_0xb090('0x6'))(_0xb090('0x7'));var config=require(_0xb090('0x8'));var jayson=require(_0xb090('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x400302,_0x2a4dca,_0x311074){return new BPromise(function(_0x5890fd,_0x1a099e){return client[_0xb090('0xa')](_0x400302,_0x311074)['then'](function(_0x2173c1){logger['info'](_0xb090('0xb'),_0x2a4dca,_0xb090('0xc'));logger[_0xb090('0xd')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2a4dca,_0xb090('0xc'),JSON[_0xb090('0xe')](_0x2173c1));if(_0x2173c1[_0xb090('0xf')]){if(_0x2173c1['error'][_0xb090('0x10')]===0x1f4){logger[_0xb090('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x2a4dca,_0x2173c1[_0xb090('0xf')][_0xb090('0x11')]);return _0x1a099e(_0x2173c1['error'][_0xb090('0x11')]);}logger['error'](_0xb090('0xb'),_0x2a4dca,_0x2173c1[_0xb090('0xf')]['message']);return _0x5890fd(_0x2173c1['error'][_0xb090('0x11')]);}else{logger['info'](_0xb090('0xb'),_0x2a4dca,_0xb090('0xc'));_0x5890fd(_0x2173c1[_0xb090('0x12')]['message']);}})[_0xb090('0x13')](function(_0x750df4){logger['error'](_0xb090('0xb'),_0x2a4dca,_0x750df4);_0x1a099e(_0x750df4);});});} \ No newline at end of file +var _0xe462=['code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x174f49,_0x36b1fa){var _0x220f6f=function(_0x304b5f){while(--_0x304b5f){_0x174f49['push'](_0x174f49['shift']());}};_0x220f6f(++_0x36b1fa);}(_0xe462,0xa4));var _0x2e46=function(_0x27923d,_0xa2c725){_0x27923d=_0x27923d-0x0;var _0x1911d3=_0xe462[_0x27923d];return _0x1911d3;};'use strict';var _=require('lodash');var util=require(_0x2e46('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2e46('0x1'));var fs=require('fs');var Redis=require(_0x2e46('0x2'));var db=require(_0x2e46('0x3'))['db'];var utils=require(_0x2e46('0x4'));var logger=require(_0x2e46('0x5'))(_0x2e46('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e46('0x7'));var client=jayson[_0x2e46('0x8')][_0x2e46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a3539,_0x2869ab,_0xc54875){return new BPromise(function(_0x525f05,_0x4f30b8){return client['request'](_0x1a3539,_0xc54875)['then'](function(_0x5010c8){logger['info'](_0x2e46('0xa'),_0x2869ab,_0x2e46('0xb'));logger[_0x2e46('0xc')](_0x2e46('0xd'),_0x2869ab,_0x2e46('0xb'),JSON[_0x2e46('0xe')](_0x5010c8));if(_0x5010c8['error']){if(_0x5010c8[_0x2e46('0xf')][_0x2e46('0x10')]===0x1f4){logger['error'](_0x2e46('0xa'),_0x2869ab,_0x5010c8[_0x2e46('0xf')][_0x2e46('0x11')]);return _0x4f30b8(_0x5010c8[_0x2e46('0xf')][_0x2e46('0x11')]);}logger[_0x2e46('0xf')](_0x2e46('0xa'),_0x2869ab,_0x5010c8[_0x2e46('0xf')][_0x2e46('0x11')]);return _0x525f05(_0x5010c8[_0x2e46('0xf')][_0x2e46('0x11')]);}else{logger['info'](_0x2e46('0xa'),_0x2869ab,'request\x20sent');_0x525f05(_0x5010c8[_0x2e46('0x12')][_0x2e46('0x11')]);}})[_0x2e46('0x13')](function(_0x28471d){logger[_0x2e46('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x2869ab,_0x28471d);_0x4f30b8(_0x28471d);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 6600f85..98354c5 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 _0x44d4=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','multer','express','Router','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x3863ce,_0x403dd7){var _0x292df5=function(_0x4bffeb){while(--_0x4bffeb){_0x3863ce['push'](_0x3863ce['shift']());}};_0x292df5(++_0x403dd7);}(_0x44d4,0x161));var _0x444d=function(_0x1a7536,_0x30c791){_0x1a7536=_0x1a7536-0x0;var _0x4660d9=_0x44d4[_0x1a7536];return _0x4660d9;};'use strict';var multer=require(_0x444d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x444d('0x1'));var router=express[_0x444d('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x444d('0x3'));var controller=require(_0x444d('0x4'));router[_0x444d('0x5')]('/',auth[_0x444d('0x6')](),controller[_0x444d('0x7')]);router[_0x444d('0x5')](_0x444d('0x8'),auth['isAuthenticated'](),controller[_0x444d('0x9')]);router['get'](_0x444d('0xa'),auth[_0x444d('0x6')](),controller[_0x444d('0xb')]);router[_0x444d('0x5')](_0x444d('0xc'),auth[_0x444d('0x6')](),controller[_0x444d('0xd')]);router[_0x444d('0xe')]('/',auth[_0x444d('0x6')](),controller[_0x444d('0xf')]);router[_0x444d('0xe')]('/:id/configurations',auth[_0x444d('0x6')](),controller[_0x444d('0x10')]);router['put'](_0x444d('0x8'),auth[_0x444d('0x6')](),controller[_0x444d('0x11')]);router['delete'](_0x444d('0x8'),auth[_0x444d('0x6')](),controller[_0x444d('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc1c4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','/:id','update','delete','destroy','exports','multer'];(function(_0xeffc3d,_0x41cc2b){var _0x1b5ec6=function(_0x3f15e6){while(--_0x3f15e6){_0xeffc3d['push'](_0xeffc3d['shift']());}};_0x1b5ec6(++_0x41cc2b);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x297bcf,_0x380dd9){_0x297bcf=_0x297bcf-0x0;var _0x5782=_0xc1c4[_0x297bcf];return _0x5782;};'use strict';var multer=require(_0x4c1c('0x0'));var util=require(_0x4c1c('0x1'));var path=require(_0x4c1c('0x2'));var timeout=require(_0x4c1c('0x3'));var express=require(_0x4c1c('0x4'));var router=express[_0x4c1c('0x5')]();var fs_extra=require(_0x4c1c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4c1c('0x7'));var config=require(_0x4c1c('0x8'));var controller=require(_0x4c1c('0x9'));router[_0x4c1c('0xa')]('/',auth['isAuthenticated'](),controller[_0x4c1c('0xb')]);router['get']('/:id',auth[_0x4c1c('0xc')](),controller[_0x4c1c('0xd')]);router['get'](_0x4c1c('0xe'),auth[_0x4c1c('0xc')](),controller[_0x4c1c('0xf')]);router[_0x4c1c('0xa')](_0x4c1c('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x4c1c('0x11')]('/',auth[_0x4c1c('0xc')](),controller[_0x4c1c('0x12')]);router[_0x4c1c('0x11')](_0x4c1c('0xe'),auth[_0x4c1c('0xc')](),controller['addConfiguration']);router['put'](_0x4c1c('0x13'),auth[_0x4c1c('0xc')](),controller[_0x4c1c('0x14')]);router[_0x4c1c('0x15')](_0x4c1c('0x13'),auth['isAuthenticated'](),controller[_0x4c1c('0x16')]);module[_0x4c1c('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 0490c2d..2dc0cb7 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 _0x72ca=['STRING','HelpDesk','sequelize','exports'];(function(_0xa115c0,_0x50ce1b){var _0x4bc842=function(_0x348250){while(--_0x348250){_0xa115c0['push'](_0xa115c0['shift']());}};_0x4bc842(++_0x50ce1b);}(_0x72ca,0x8e));var _0xa72c=function(_0x31cc4b,_0x6a5cd4){_0x31cc4b=_0x31cc4b-0x0;var _0x7bdd96=_0x72ca[_0x31cc4b];return _0x7bdd96;};'use strict';var Sequelize=require(_0xa72c('0x0'));module[_0xa72c('0x1')]={'name':{'type':Sequelize[_0xa72c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa72c('0x2')]},'username':{'type':Sequelize[_0xa72c('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa72c('0x2')],'allowNull':![],'defaultValue':_0xa72c('0x3')},'remoteUri':{'type':Sequelize[_0xa72c('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xa72c('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa72c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x120e=['HelpDesk','sequelize','exports','STRING'];(function(_0x3337e6,_0x40bd57){var _0x402b4b=function(_0x25cc88){while(--_0x25cc88){_0x3337e6['push'](_0x3337e6['shift']());}};_0x402b4b(++_0x40bd57);}(_0x120e,0x11d));var _0xe120=function(_0x2a2c13,_0x46b0d3){_0x2a2c13=_0x2a2c13-0x0;var _0x993aa9=_0x120e[_0x2a2c13];return _0x993aa9;};'use strict';var Sequelize=require(_0xe120('0x0'));module[_0xe120('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe120('0x2')]},'username':{'type':Sequelize[_0xe120('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe120('0x2')],'allowNull':![],'defaultValue':_0xe120('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe120('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 0b5caaf..4f5e40b 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 _0xabed=['fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VtigerAccount','includeAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','length','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','description','moduleName','serverUrl','accessKey','username','remoteUri','substring','success','POST','login','token','GET','result','sessionName','autogenerated','owner','remove','false','label','startsWith','cf_','picklist','value','log','vTiger\x20error:\x20','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection'];(function(_0x12974b,_0x18f2a8){var _0x11709e=function(_0x175686){while(--_0x175686){_0x12974b['push'](_0x12974b['shift']());}};_0x11709e(++_0x18f2a8);}(_0xabed,0x12c));var _0xdabe=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xabed[_0xb24a3e];return _0x4038d7;};'use strict';var emlformat=require(_0xdabe('0x0'));var rimraf=require(_0xdabe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdabe('0x2'));var rp=require(_0xdabe('0x3'));var moment=require(_0xdabe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdabe('0x5'));var util=require('util');var path=require(_0xdabe('0x6'));var sox=require(_0xdabe('0x7'));var csv=require(_0xdabe('0x8'));var ejs=require(_0xdabe('0x9'));var fs=require('fs');var fs_extra=require(_0xdabe('0xa'));var _=require(_0xdabe('0xb'));var squel=require(_0xdabe('0xc'));var crypto=require('crypto');var jsforce=require(_0xdabe('0xd'));var deskjs=require(_0xdabe('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdabe('0xf'));var Papa=require('papaparse');var Redis=require(_0xdabe('0x10'));var authService=require(_0xdabe('0x11'));var qs=require(_0xdabe('0x12'));var as=require(_0xdabe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdabe('0x14'));var config=require(_0xdabe('0x15'));var licenseUtil=require(_0xdabe('0x16'));var db=require(_0xdabe('0x17'))['db'];var integrations=require(_0xdabe('0x18'));function respondWithStatusCode(_0x2caaa3,_0x161f74){_0x161f74=_0x161f74||0xcc;return function(_0x580bc3){if(_0x580bc3){return _0x2caaa3[_0xdabe('0x19')](_0x161f74);}return _0x2caaa3['status'](_0x161f74)[_0xdabe('0x1a')]();};}function respondWithResult(_0x417553,_0xa94b46){_0xa94b46=_0xa94b46||0xc8;return function(_0x2edb05){if(_0x2edb05){return _0x417553[_0xdabe('0x1b')](_0xa94b46)[_0xdabe('0x1c')](_0x2edb05);}};}function respondWithFilteredResult(_0x12a990,_0x54dc57){return function(_0x6f19d2){if(_0x6f19d2){var _0x322227=typeof _0x54dc57['offset']===_0xdabe('0x1d')&&typeof _0x54dc57[_0xdabe('0x1e')]===_0xdabe('0x1d');var _0x6ca222=_0x6f19d2['count'];var _0x39e481=_0x322227?0x0:_0x54dc57['offset'];var _0x3394bd=_0x322227?_0x6f19d2[_0xdabe('0x1f')]:_0x54dc57[_0xdabe('0x20')]+_0x54dc57[_0xdabe('0x1e')];var _0x57ab64;if(_0x3394bd>=_0x6ca222){_0x3394bd=_0x6ca222;_0x57ab64=0xc8;}else{_0x57ab64=0xce;}_0x12a990[_0xdabe('0x1b')](_0x57ab64);return _0x12a990[_0xdabe('0x21')](_0xdabe('0x22'),_0x39e481+'-'+_0x3394bd+'/'+_0x6ca222)['json'](_0x6f19d2);}return null;};}function patchUpdates(_0x4582e3){return function(_0x5ea204){try{jsonpatch[_0xdabe('0x23')](_0x5ea204,_0x4582e3,!![]);}catch(_0x58c2d0){return BPromise[_0xdabe('0x24')](_0x58c2d0);}return _0x5ea204[_0xdabe('0x25')]();};}function saveUpdates(_0xd05c68,_0x4552fa){return function(_0x3fe4b8){if(_0x3fe4b8){return _0x3fe4b8[_0xdabe('0x26')](_0xd05c68)[_0xdabe('0x27')](function(_0x2f94b5){return _0x2f94b5;});}return null;};}function removeEntity(_0x6cc242,_0x2877d2){return function(_0x2c1c85){if(_0x2c1c85){return _0x2c1c85[_0xdabe('0x28')]()['then'](function(){_0x6cc242[_0xdabe('0x1b')](0xcc)[_0xdabe('0x1a')]();});}};}function handleEntityNotFound(_0x1ecb71,_0x4af241){return function(_0x3027b8){if(!_0x3027b8){_0x1ecb71[_0xdabe('0x19')](0x194);}return _0x3027b8;};}function handleError(_0xe93cda,_0x4fe559){_0x4fe559=_0x4fe559||0x1f4;return function(_0x24b34c){logger['error'](_0x24b34c[_0xdabe('0x29')]);if(_0x24b34c['name']){delete _0x24b34c[_0xdabe('0x2a')];}_0xe93cda[_0xdabe('0x1b')](_0x4fe559)[_0xdabe('0x2b')](_0x24b34c);};}exports[_0xdabe('0x2c')]=function(_0x337934,_0x3e5213){var _0x47034e={},_0x63812e={},_0x26935a={'count':0x0,'rows':[]};var _0x13d998=_[_0xdabe('0x2d')](db['VtigerAccount']['rawAttributes'],function(_0x3d2798){return{'name':_0x3d2798['fieldName'],'type':_0x3d2798[_0xdabe('0x2e')][_0xdabe('0x2f')]};});_0x63812e['model']=_[_0xdabe('0x2d')](_0x13d998,_0xdabe('0x2a'));_0x63812e[_0xdabe('0x30')]=_[_0xdabe('0x31')](_0x337934[_0xdabe('0x30')]);_0x63812e[_0xdabe('0x32')]=_['intersection'](_0x63812e[_0xdabe('0x33')],_0x63812e[_0xdabe('0x30')]);_0x47034e[_0xdabe('0x34')]=_[_0xdabe('0x35')](_0x63812e[_0xdabe('0x33')],qs[_0xdabe('0x36')](_0x337934[_0xdabe('0x30')][_0xdabe('0x36')]));_0x47034e['attributes']=_0x47034e[_0xdabe('0x34')]['length']?_0x47034e['attributes']:_0x63812e[_0xdabe('0x33')];if(!_0x337934[_0xdabe('0x30')]['hasOwnProperty'](_0xdabe('0x37'))){_0x47034e['limit']=qs['limit'](_0x337934['query'][_0xdabe('0x1e')]);_0x47034e['offset']=qs[_0xdabe('0x20')](_0x337934[_0xdabe('0x30')][_0xdabe('0x20')]);}_0x47034e[_0xdabe('0x38')]=qs[_0xdabe('0x39')](_0x337934[_0xdabe('0x30')][_0xdabe('0x39')]);_0x47034e[_0xdabe('0x3a')]=qs[_0xdabe('0x32')](_[_0xdabe('0x3b')](_0x337934['query'],_0x63812e[_0xdabe('0x32')]),_0x13d998);if(_0x337934[_0xdabe('0x30')][_0xdabe('0x3c')]){_0x47034e[_0xdabe('0x3a')]=_[_0xdabe('0x3d')](_0x47034e[_0xdabe('0x3a')],{'$or':_[_0xdabe('0x2d')](_0x13d998,function(_0x5025ab){if(_0x5025ab[_0xdabe('0x2e')]!==_0xdabe('0x3e')){var _0x2032c2={};_0x2032c2[_0x5025ab['name']]={'$like':'%'+_0x337934[_0xdabe('0x30')][_0xdabe('0x3c')]+'%'};return _0x2032c2;}})});}_0x47034e=_[_0xdabe('0x3d')]({},_0x47034e,_0x337934['options']);var _0x4a5098={'where':_0x47034e[_0xdabe('0x3a')]};return db[_0xdabe('0x3f')][_0xdabe('0x1f')](_0x4a5098)[_0xdabe('0x27')](function(_0x23ec9b){_0x26935a[_0xdabe('0x1f')]=_0x23ec9b;if(_0x337934[_0xdabe('0x30')][_0xdabe('0x40')]){_0x47034e['include']=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x47034e);})[_0xdabe('0x27')](function(_0x3cec3d){_0x26935a[_0xdabe('0x41')]=_0x3cec3d;return _0x26935a;})[_0xdabe('0x27')](respondWithFilteredResult(_0x3e5213,_0x47034e))[_0xdabe('0x42')](handleError(_0x3e5213,null));};exports[_0xdabe('0x43')]=function(_0x245786,_0x22e20e){var _0x11c144={'raw':![],'where':{'id':_0x245786[_0xdabe('0x44')]['id']}},_0x142dcf={};_0x142dcf[_0xdabe('0x33')]=_[_0xdabe('0x31')](db['VtigerAccount'][_0xdabe('0x45')]);_0x142dcf[_0xdabe('0x30')]=_[_0xdabe('0x31')](_0x245786[_0xdabe('0x30')]);_0x142dcf[_0xdabe('0x32')]=_[_0xdabe('0x35')](_0x142dcf[_0xdabe('0x33')],_0x142dcf['query']);_0x11c144[_0xdabe('0x34')]=_[_0xdabe('0x35')](_0x142dcf[_0xdabe('0x33')],qs[_0xdabe('0x36')](_0x245786[_0xdabe('0x30')]['fields']));_0x11c144[_0xdabe('0x34')]=_0x11c144[_0xdabe('0x34')]['length']?_0x11c144['attributes']:_0x142dcf[_0xdabe('0x33')];if(_0x245786[_0xdabe('0x30')]['includeAll']){_0x11c144[_0xdabe('0x46')]=[{'all':!![]}];}_0x11c144=_[_0xdabe('0x3d')]({},_0x11c144,_0x245786[_0xdabe('0x47')]);return db[_0xdabe('0x3f')][_0xdabe('0x48')](_0x11c144)['then'](handleEntityNotFound(_0x22e20e,null))[_0xdabe('0x27')](respondWithResult(_0x22e20e,null))[_0xdabe('0x42')](handleError(_0x22e20e,null));};exports[_0xdabe('0x49')]=function(_0x16cdbe,_0x4bda4b){return db[_0xdabe('0x3f')]['create'](_0x16cdbe[_0xdabe('0x4a')],{})[_0xdabe('0x27')](respondWithResult(_0x4bda4b,0xc9))[_0xdabe('0x42')](handleError(_0x4bda4b,null));};exports['update']=function(_0x197a43,_0x119cc0){if(_0x197a43[_0xdabe('0x4a')]['id']){delete _0x197a43[_0xdabe('0x4a')]['id'];}return db[_0xdabe('0x3f')][_0xdabe('0x48')]({'where':{'id':_0x197a43['params']['id']}})[_0xdabe('0x27')](handleEntityNotFound(_0x119cc0,null))[_0xdabe('0x27')](saveUpdates(_0x197a43[_0xdabe('0x4a')],null))['then'](respondWithResult(_0x119cc0,null))[_0xdabe('0x42')](handleError(_0x119cc0,null));};exports[_0xdabe('0x28')]=function(_0x98eca7,_0x4d9109){return db[_0xdabe('0x3f')][_0xdabe('0x48')]({'where':{'id':_0x98eca7['params']['id']}})['then'](handleEntityNotFound(_0x4d9109,null))['then'](removeEntity(_0x4d9109,null))[_0xdabe('0x42')](handleError(_0x4d9109,null));};exports[_0xdabe('0x4b')]=function(_0x51aa57,_0x2945e8,_0x47b839){var _0x57c19e={};var _0x203eb5={};var _0x4500cb;var _0x2645a7;return db[_0xdabe('0x3f')][_0xdabe('0x4c')]({'where':{'id':_0x51aa57[_0xdabe('0x44')]['id']}})[_0xdabe('0x27')](handleEntityNotFound(_0x2945e8,null))[_0xdabe('0x27')](function(_0x4c56fe){if(_0x4c56fe){_0x4500cb=_0x4c56fe;_0x203eb5[_0xdabe('0x33')]=_['keys'](db[_0xdabe('0x4d')][_0xdabe('0x45')]);_0x203eb5['query']=_[_0xdabe('0x31')](_0x51aa57[_0xdabe('0x30')]);_0x203eb5[_0xdabe('0x32')]=_[_0xdabe('0x35')](_0x203eb5[_0xdabe('0x33')],_0x203eb5[_0xdabe('0x30')]);_0x57c19e[_0xdabe('0x34')]=_[_0xdabe('0x35')](_0x203eb5[_0xdabe('0x33')],qs[_0xdabe('0x36')](_0x51aa57[_0xdabe('0x30')]['fields']));_0x57c19e['attributes']=_0x57c19e[_0xdabe('0x34')][_0xdabe('0x4e')]?_0x57c19e[_0xdabe('0x34')]:_0x203eb5[_0xdabe('0x33')];_0x57c19e[_0xdabe('0x38')]=qs[_0xdabe('0x39')](_0x51aa57[_0xdabe('0x30')]['sort']);_0x57c19e[_0xdabe('0x3a')]=qs['filters'](_[_0xdabe('0x3b')](_0x51aa57[_0xdabe('0x30')],_0x203eb5[_0xdabe('0x32')]));if(_0x51aa57[_0xdabe('0x30')][_0xdabe('0x3c')]){_0x57c19e[_0xdabe('0x3a')]=_['merge'](_0x57c19e[_0xdabe('0x3a')],{'$or':_['map'](_0x57c19e[_0xdabe('0x34')],function(_0x2e9334){var _0x474b26={};_0x474b26[_0x2e9334]={'$like':'%'+_0x51aa57[_0xdabe('0x30')][_0xdabe('0x3c')]+'%'};return _0x474b26;})});}_0x57c19e=_[_0xdabe('0x3d')]({},_0x57c19e,_0x51aa57['options']);return _0x4500cb[_0xdabe('0x4b')](_0x57c19e);}})[_0xdabe('0x27')](function(_0x2ec512){if(_0x2ec512){_0x2645a7=_0x2ec512[_0xdabe('0x4e')];if(!_0x51aa57[_0xdabe('0x30')][_0xdabe('0x4f')]('nolimit')){_0x57c19e[_0xdabe('0x1e')]=qs[_0xdabe('0x1e')](_0x51aa57[_0xdabe('0x30')]['limit']);_0x57c19e[_0xdabe('0x20')]=qs[_0xdabe('0x20')](_0x51aa57[_0xdabe('0x30')]['offset']);}return _0x4500cb[_0xdabe('0x4b')](_0x57c19e);}})['then'](function(_0x119b28){if(_0x119b28){return _0x119b28?{'count':_0x2645a7,'rows':_0x119b28}:null;}})[_0xdabe('0x27')](respondWithResult(_0x2945e8,null))[_0xdabe('0x42')](handleError(_0x2945e8,null));};exports[_0xdabe('0x50')]=function(_0x4ae8f8,_0x204ca5,_0x316ba7){if(_0x4ae8f8[_0xdabe('0x4a')]['id']){delete _0x4ae8f8[_0xdabe('0x4a')]['id'];}return db[_0xdabe('0x3f')][_0xdabe('0x4c')]({'where':{'id':_0x4ae8f8[_0xdabe('0x44')]['id']}})[_0xdabe('0x27')](handleEntityNotFound(_0x204ca5,null))['then'](function(_0x29f574){if(_0x29f574){_0x4ae8f8[_0xdabe('0x4a')][_0xdabe('0x51')]=_0x29f574['id'];_0x4ae8f8[_0xdabe('0x4a')][_0xdabe('0x52')]=integrations['getSubjects'](_0x4ae8f8[_0xdabe('0x4a')][_0xdabe('0x53')],_0x4ae8f8[_0xdabe('0x4a')][_0xdabe('0x2e')]);_0x4ae8f8[_0xdabe('0x4a')]['Descriptions']=integrations[_0xdabe('0x54')](_0x4ae8f8[_0xdabe('0x4a')][_0xdabe('0x53')],_0x4ae8f8[_0xdabe('0x4a')][_0xdabe('0x2e')]);return db['VtigerConfiguration']['create'](_0x4ae8f8[_0xdabe('0x4a')],{'include':[{'model':db[_0xdabe('0x55')],'as':_0xdabe('0x52')},{'model':db['VtigerField'],'as':_0xdabe('0x56')}]});}return null;})[_0xdabe('0x27')](respondWithResult(_0x204ca5,null))[_0xdabe('0x42')](handleError(_0x204ca5,null));};var md5=require(_0xdabe('0x57'));exports[_0xdabe('0x58')]=function(_0x4fd6bd,_0x4bf0c4,_0x49dc8d){var _0x4baf51=null;var _0x410a7f=null;var _0x1f0510=null;var _0x4a8c63=null;var _0x44c79b='';return db['VtigerAccount'][_0xdabe('0x4c')]({'where':{'id':_0x4fd6bd[_0xdabe('0x44')]['id']},'attributes':['id',_0xdabe('0x2a'),'username',_0xdabe('0x59'),_0xdabe('0x5a'),'remoteUri',_0xdabe('0x5b'),_0xdabe('0x5c')]})['then'](handleEntityNotFound(_0x4bf0c4,null))[_0xdabe('0x27')](function(_0x2e8dea){if(_0x2e8dea){_0x4baf51=_0x2e8dea[_0xdabe('0x5d')];_0x410a7f=_0x2e8dea[_0xdabe('0x5c')];_0x1f0510=_0x2e8dea['moduleName'];_0x44c79b=_0x2e8dea[_0xdabe('0x5e')];var _0x21d37c=_0x44c79b['slice'](-0x1);if(_0x21d37c==='/'){_0x44c79b=_0x44c79b[_0xdabe('0x5f')](0x0,_0x44c79b['lastIndexOf'](_0x21d37c));}_0x4a8c63=util['format']('%s/webservice.php',_0x44c79b);var _0x5d6a08={'method':'GET','uri':_0x4a8c63,'qs':{'operation':'getchallenge','username':_0x2e8dea[_0xdabe('0x5d')]},'json':!![]};return rp(_0x5d6a08);}})[_0xdabe('0x27')](function(_0x43a1f3){if(_0x43a1f3[_0xdabe('0x60')]){var _0x1d2b56={'method':_0xdabe('0x61'),'uri':_0x4a8c63,'form':{'operation':_0xdabe('0x62'),'username':_0x4baf51,'accessKey':md5(_0x43a1f3['result'][_0xdabe('0x63')]+_0x410a7f)},'json':!![]};return rp(_0x1d2b56);}})[_0xdabe('0x27')](function(_0x4801aa){if(_0x4801aa['success']){var _0x513b8a={'method':_0xdabe('0x64'),'uri':_0x4a8c63,'qs':{'operation':'describe','username':_0x4baf51,'sessionName':_0x4801aa[_0xdabe('0x65')][_0xdabe('0x66')],'elementType':_0x1f0510},'json':!![]};return rp(_0x513b8a);}})[_0xdabe('0x27')](function(_0x810626){if(_0x810626[_0xdabe('0x60')]){var _0x3a71d6=[_0xdabe('0x67'),'reference',_0xdabe('0x68')];_[_0xdabe('0x69')](_0x810626[_0xdabe('0x65')][_0xdabe('0x36')],function(_0x328f22){return _0x3a71d6['includes'](_0x328f22[_0xdabe('0x2e')]['name']);});_[_0xdabe('0x69')](_0x810626[_0xdabe('0x65')][_0xdabe('0x36')],function(_0x594413){return _0x594413['editable']===_0xdabe('0x6a');});return{'count':_0x810626[_0xdabe('0x65')][_0xdabe('0x36')]['length'],'rows':_[_0xdabe('0x2d')](_0x810626['result']['fields'],function(_0x54e7f0){return{'id':_0x54e7f0[_0xdabe('0x2a')],'name':_0x54e7f0[_0xdabe('0x6b')],'custom':_[_0xdabe('0x6c')](_0x54e7f0[_0xdabe('0x2a')],_0xdabe('0x6d'))?!![]:![],'options':_0x54e7f0['type']['name']===_0xdabe('0x6e')&&_0x54e7f0[_0xdabe('0x2e')]['picklistValues']['length']>0x0?_['map'](_0x54e7f0[_0xdabe('0x2e')]['picklistValues'],function(_0x5c231a){return{'name':_0x5c231a['label'],'value':_0x5c231a[_0xdabe('0x6f')]};}):[]};})};}})[_0xdabe('0x27')](respondWithResult(_0x4bf0c4,null))[_0xdabe('0x42')](function(_0x1db8a7){console[_0xdabe('0x70')](_0xdabe('0x71')+_0x1db8a7);var _0x4bf0cb=_0x4fd6bd[_0xdabe('0x30')][_0xdabe('0x72')]?0x1f4:_0x1db8a7['statusCode']||0x1f4;logger[_0xdabe('0x73')](_0xdabe('0x74'),'getFields',_0x4bf0cb,JSON[_0xdabe('0x75')](_0x1db8a7));delete _0x1db8a7[_0xdabe('0x2a')];if(_0x4bf0cb===0x191){_0x4bf0cb=0x190;}_0x4bf0c4[_0xdabe('0x1b')](_0x4bf0cb)[_0xdabe('0x2b')](_0x4fd6bd[_0xdabe('0x30')][_0xdabe('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x1db8a7['statusCode']}:_0x1db8a7);});}; \ No newline at end of file +var _0x5662=['create','body','update','params','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','result','autogenerated','reference','owner','remove','includes','editable','label','startsWith','picklistValues','value','log','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','limit','undefined','count','offset','set','json','apply','reject','then','destroy','sendStatus','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','sort','where','filters','pick','merge','type','filter','options','includeAll','findAll','rows','catch','show','include','find'];(function(_0x34a73e,_0x49b7ba){var _0x264111=function(_0x542592){while(--_0x542592){_0x34a73e['push'](_0x34a73e['shift']());}};_0x264111(++_0x49b7ba);}(_0x5662,0xaa));var _0x2566=function(_0x2d5f97,_0x53d1ba){_0x2d5f97=_0x2d5f97-0x0;var _0xb3d085=_0x5662[_0x2d5f97];return _0xb3d085;};'use strict';var emlformat=require(_0x2566('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2566('0x1'));var jsonpatch=require(_0x2566('0x2'));var rp=require(_0x2566('0x3'));var moment=require(_0x2566('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2566('0x5'));var util=require(_0x2566('0x6'));var path=require(_0x2566('0x7'));var sox=require(_0x2566('0x8'));var csv=require('to-csv');var ejs=require(_0x2566('0x9'));var fs=require('fs');var fs_extra=require(_0x2566('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2566('0xb'));var jsforce=require(_0x2566('0xc'));var deskjs=require(_0x2566('0xd'));var toCsv=require(_0x2566('0xe'));var querystring=require(_0x2566('0xf'));var Papa=require(_0x2566('0x10'));var Redis=require(_0x2566('0x11'));var authService=require(_0x2566('0x12'));var qs=require(_0x2566('0x13'));var as=require(_0x2566('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2566('0x15'))('api');var utils=require(_0x2566('0x16'));var config=require(_0x2566('0x17'));var licenseUtil=require(_0x2566('0x18'));var db=require(_0x2566('0x19'))['db'];var integrations=require(_0x2566('0x1a'));function respondWithStatusCode(_0x3fee99,_0x268f2b){_0x268f2b=_0x268f2b||0xcc;return function(_0x2256b5){if(_0x2256b5){return _0x3fee99['sendStatus'](_0x268f2b);}return _0x3fee99[_0x2566('0x1b')](_0x268f2b)[_0x2566('0x1c')]();};}function respondWithResult(_0x5dd7fc,_0x3f7bde){_0x3f7bde=_0x3f7bde||0xc8;return function(_0x1a707a){if(_0x1a707a){return _0x5dd7fc[_0x2566('0x1b')](_0x3f7bde)['json'](_0x1a707a);}};}function respondWithFilteredResult(_0x403f95,_0x17dffd){return function(_0x1ab1c9){if(_0x1ab1c9){var _0x40763e=typeof _0x17dffd['offset']==='undefined'&&typeof _0x17dffd[_0x2566('0x1d')]===_0x2566('0x1e');var _0x225758=_0x1ab1c9[_0x2566('0x1f')];var _0x4d58ba=_0x40763e?0x0:_0x17dffd[_0x2566('0x20')];var _0x331ccb=_0x40763e?_0x1ab1c9[_0x2566('0x1f')]:_0x17dffd[_0x2566('0x20')]+_0x17dffd[_0x2566('0x1d')];var _0x540b83;if(_0x331ccb>=_0x225758){_0x331ccb=_0x225758;_0x540b83=0xc8;}else{_0x540b83=0xce;}_0x403f95[_0x2566('0x1b')](_0x540b83);return _0x403f95[_0x2566('0x21')]('Content-Range',_0x4d58ba+'-'+_0x331ccb+'/'+_0x225758)[_0x2566('0x22')](_0x1ab1c9);}return null;};}function patchUpdates(_0x45ee96){return function(_0x295351){try{jsonpatch[_0x2566('0x23')](_0x295351,_0x45ee96,!![]);}catch(_0x5cdc98){return BPromise[_0x2566('0x24')](_0x5cdc98);}return _0x295351['save']();};}function saveUpdates(_0x103299,_0x2033f8){return function(_0x2f4359){if(_0x2f4359){return _0x2f4359['update'](_0x103299)[_0x2566('0x25')](function(_0x3950d4){return _0x3950d4;});}return null;};}function removeEntity(_0x55bdff,_0x328ae1){return function(_0x2745f5){if(_0x2745f5){return _0x2745f5[_0x2566('0x26')]()[_0x2566('0x25')](function(){_0x55bdff['status'](0xcc)[_0x2566('0x1c')]();});}};}function handleEntityNotFound(_0x4566b5,_0x44cacd){return function(_0x1bd487){if(!_0x1bd487){_0x4566b5[_0x2566('0x27')](0x194);}return _0x1bd487;};}function handleError(_0x382016,_0x1a3e80){_0x1a3e80=_0x1a3e80||0x1f4;return function(_0x34b5d7){logger[_0x2566('0x28')](_0x34b5d7['stack']);if(_0x34b5d7[_0x2566('0x29')]){delete _0x34b5d7[_0x2566('0x29')];}_0x382016[_0x2566('0x1b')](_0x1a3e80)[_0x2566('0x2a')](_0x34b5d7);};}exports[_0x2566('0x2b')]=function(_0xba62a4,_0x239cdd){var _0x3ce616={},_0x22b3b6={},_0x42282c={'count':0x0,'rows':[]};var _0x3c371b=_[_0x2566('0x2c')](db[_0x2566('0x2d')][_0x2566('0x2e')],function(_0x425933){return{'name':_0x425933[_0x2566('0x2f')],'type':_0x425933['type'][_0x2566('0x30')]};});_0x22b3b6[_0x2566('0x31')]=_[_0x2566('0x2c')](_0x3c371b,_0x2566('0x29'));_0x22b3b6['query']=_[_0x2566('0x32')](_0xba62a4['query']);_0x22b3b6['filters']=_[_0x2566('0x33')](_0x22b3b6[_0x2566('0x31')],_0x22b3b6['query']);_0x3ce616[_0x2566('0x34')]=_[_0x2566('0x33')](_0x22b3b6[_0x2566('0x31')],qs[_0x2566('0x35')](_0xba62a4['query'][_0x2566('0x35')]));_0x3ce616['attributes']=_0x3ce616[_0x2566('0x34')][_0x2566('0x36')]?_0x3ce616['attributes']:_0x22b3b6[_0x2566('0x31')];if(!_0xba62a4[_0x2566('0x37')][_0x2566('0x38')]('nolimit')){_0x3ce616[_0x2566('0x1d')]=qs[_0x2566('0x1d')](_0xba62a4[_0x2566('0x37')]['limit']);_0x3ce616['offset']=qs[_0x2566('0x20')](_0xba62a4[_0x2566('0x37')][_0x2566('0x20')]);}_0x3ce616['order']=qs[_0x2566('0x39')](_0xba62a4[_0x2566('0x37')][_0x2566('0x39')]);_0x3ce616[_0x2566('0x3a')]=qs[_0x2566('0x3b')](_[_0x2566('0x3c')](_0xba62a4[_0x2566('0x37')],_0x22b3b6[_0x2566('0x3b')]),_0x3c371b);if(_0xba62a4['query']['filter']){_0x3ce616[_0x2566('0x3a')]=_[_0x2566('0x3d')](_0x3ce616[_0x2566('0x3a')],{'$or':_['map'](_0x3c371b,function(_0x14ec47){if(_0x14ec47[_0x2566('0x3e')]!=='VIRTUAL'){var _0x43691b={};_0x43691b[_0x14ec47['name']]={'$like':'%'+_0xba62a4[_0x2566('0x37')][_0x2566('0x3f')]+'%'};return _0x43691b;}})});}_0x3ce616=_[_0x2566('0x3d')]({},_0x3ce616,_0xba62a4[_0x2566('0x40')]);var _0x40ba69={'where':_0x3ce616[_0x2566('0x3a')]};return db[_0x2566('0x2d')][_0x2566('0x1f')](_0x40ba69)[_0x2566('0x25')](function(_0x35c56e){_0x42282c[_0x2566('0x1f')]=_0x35c56e;if(_0xba62a4[_0x2566('0x37')][_0x2566('0x41')]){_0x3ce616['include']=[{'all':!![]}];}return db[_0x2566('0x2d')][_0x2566('0x42')](_0x3ce616);})[_0x2566('0x25')](function(_0x685355){_0x42282c[_0x2566('0x43')]=_0x685355;return _0x42282c;})['then'](respondWithFilteredResult(_0x239cdd,_0x3ce616))[_0x2566('0x44')](handleError(_0x239cdd,null));};exports[_0x2566('0x45')]=function(_0x29feb8,_0x422261){var _0x232089={'raw':![],'where':{'id':_0x29feb8['params']['id']}},_0x543283={};_0x543283['model']=_['keys'](db[_0x2566('0x2d')][_0x2566('0x2e')]);_0x543283[_0x2566('0x37')]=_[_0x2566('0x32')](_0x29feb8[_0x2566('0x37')]);_0x543283['filters']=_[_0x2566('0x33')](_0x543283[_0x2566('0x31')],_0x543283[_0x2566('0x37')]);_0x232089['attributes']=_[_0x2566('0x33')](_0x543283[_0x2566('0x31')],qs[_0x2566('0x35')](_0x29feb8[_0x2566('0x37')][_0x2566('0x35')]));_0x232089[_0x2566('0x34')]=_0x232089['attributes'][_0x2566('0x36')]?_0x232089[_0x2566('0x34')]:_0x543283[_0x2566('0x31')];if(_0x29feb8['query'][_0x2566('0x41')]){_0x232089[_0x2566('0x46')]=[{'all':!![]}];}_0x232089=_[_0x2566('0x3d')]({},_0x232089,_0x29feb8['options']);return db[_0x2566('0x2d')][_0x2566('0x47')](_0x232089)[_0x2566('0x25')](handleEntityNotFound(_0x422261,null))[_0x2566('0x25')](respondWithResult(_0x422261,null))[_0x2566('0x44')](handleError(_0x422261,null));};exports[_0x2566('0x48')]=function(_0x50d4fd,_0x3945d0){return db[_0x2566('0x2d')]['create'](_0x50d4fd[_0x2566('0x49')],{})[_0x2566('0x25')](respondWithResult(_0x3945d0,0xc9))[_0x2566('0x44')](handleError(_0x3945d0,null));};exports[_0x2566('0x4a')]=function(_0xc913ed,_0x137bbc){if(_0xc913ed[_0x2566('0x49')]['id']){delete _0xc913ed['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0xc913ed['params']['id']}})[_0x2566('0x25')](handleEntityNotFound(_0x137bbc,null))[_0x2566('0x25')](saveUpdates(_0xc913ed[_0x2566('0x49')],null))['then'](respondWithResult(_0x137bbc,null))[_0x2566('0x44')](handleError(_0x137bbc,null));};exports[_0x2566('0x26')]=function(_0x1aeffe,_0x23fc55){return db[_0x2566('0x2d')][_0x2566('0x47')]({'where':{'id':_0x1aeffe[_0x2566('0x4b')]['id']}})[_0x2566('0x25')](handleEntityNotFound(_0x23fc55,null))[_0x2566('0x25')](removeEntity(_0x23fc55,null))[_0x2566('0x44')](handleError(_0x23fc55,null));};exports[_0x2566('0x4c')]=function(_0x56c1bd,_0x1b8eb3,_0x1e08d8){var _0x194718={};var _0x5256c2={};var _0x350a0a;var _0x3ff1c9;return db[_0x2566('0x2d')][_0x2566('0x4d')]({'where':{'id':_0x56c1bd['params']['id']}})[_0x2566('0x25')](handleEntityNotFound(_0x1b8eb3,null))[_0x2566('0x25')](function(_0x10568a){if(_0x10568a){_0x350a0a=_0x10568a;_0x5256c2[_0x2566('0x31')]=_[_0x2566('0x32')](db[_0x2566('0x4e')][_0x2566('0x2e')]);_0x5256c2[_0x2566('0x37')]=_[_0x2566('0x32')](_0x56c1bd[_0x2566('0x37')]);_0x5256c2[_0x2566('0x3b')]=_[_0x2566('0x33')](_0x5256c2[_0x2566('0x31')],_0x5256c2[_0x2566('0x37')]);_0x194718[_0x2566('0x34')]=_[_0x2566('0x33')](_0x5256c2[_0x2566('0x31')],qs[_0x2566('0x35')](_0x56c1bd[_0x2566('0x37')][_0x2566('0x35')]));_0x194718[_0x2566('0x34')]=_0x194718[_0x2566('0x34')][_0x2566('0x36')]?_0x194718[_0x2566('0x34')]:_0x5256c2[_0x2566('0x31')];_0x194718[_0x2566('0x4f')]=qs[_0x2566('0x39')](_0x56c1bd['query'][_0x2566('0x39')]);_0x194718[_0x2566('0x3a')]=qs[_0x2566('0x3b')](_[_0x2566('0x3c')](_0x56c1bd[_0x2566('0x37')],_0x5256c2[_0x2566('0x3b')]));if(_0x56c1bd['query']['filter']){_0x194718[_0x2566('0x3a')]=_[_0x2566('0x3d')](_0x194718['where'],{'$or':_[_0x2566('0x2c')](_0x194718[_0x2566('0x34')],function(_0x5b16c2){var _0xed5c6e={};_0xed5c6e[_0x5b16c2]={'$like':'%'+_0x56c1bd[_0x2566('0x37')]['filter']+'%'};return _0xed5c6e;})});}_0x194718=_[_0x2566('0x3d')]({},_0x194718,_0x56c1bd[_0x2566('0x40')]);return _0x350a0a[_0x2566('0x4c')](_0x194718);}})[_0x2566('0x25')](function(_0x2fbc5a){if(_0x2fbc5a){_0x3ff1c9=_0x2fbc5a['length'];if(!_0x56c1bd[_0x2566('0x37')][_0x2566('0x38')]('nolimit')){_0x194718[_0x2566('0x1d')]=qs[_0x2566('0x1d')](_0x56c1bd[_0x2566('0x37')][_0x2566('0x1d')]);_0x194718[_0x2566('0x20')]=qs[_0x2566('0x20')](_0x56c1bd[_0x2566('0x37')][_0x2566('0x20')]);}return _0x350a0a[_0x2566('0x4c')](_0x194718);}})['then'](function(_0x543c10){if(_0x543c10){return _0x543c10?{'count':_0x3ff1c9,'rows':_0x543c10}:null;}})[_0x2566('0x25')](respondWithResult(_0x1b8eb3,null))[_0x2566('0x44')](handleError(_0x1b8eb3,null));};exports[_0x2566('0x50')]=function(_0x1c51ac,_0x33b321,_0x20f7ac){if(_0x1c51ac[_0x2566('0x49')]['id']){delete _0x1c51ac['body']['id'];}return db[_0x2566('0x2d')]['findOne']({'where':{'id':_0x1c51ac[_0x2566('0x4b')]['id']}})[_0x2566('0x25')](handleEntityNotFound(_0x33b321,null))[_0x2566('0x25')](function(_0x24c485){if(_0x24c485){_0x1c51ac['body'][_0x2566('0x51')]=_0x24c485['id'];_0x1c51ac[_0x2566('0x49')][_0x2566('0x52')]=integrations[_0x2566('0x53')](_0x1c51ac['body']['channel'],_0x1c51ac['body']['type']);_0x1c51ac[_0x2566('0x49')][_0x2566('0x54')]=integrations[_0x2566('0x55')](_0x1c51ac[_0x2566('0x49')][_0x2566('0x56')],_0x1c51ac[_0x2566('0x49')][_0x2566('0x3e')]);return db['VtigerConfiguration'][_0x2566('0x48')](_0x1c51ac[_0x2566('0x49')],{'include':[{'model':db['VtigerField'],'as':_0x2566('0x52')},{'model':db[_0x2566('0x57')],'as':_0x2566('0x54')}]});}return null;})[_0x2566('0x25')](respondWithResult(_0x33b321,null))[_0x2566('0x44')](handleError(_0x33b321,null));};var md5=require(_0x2566('0x58'));exports['getFields']=function(_0xf586,_0x2fe719,_0xe581ef){var _0x375e20=null;var _0x2ba3b4=null;var _0x4d5ac1=null;var _0x49a8fc=null;var _0x2878f2='';return db['VtigerAccount'][_0x2566('0x4d')]({'where':{'id':_0xf586[_0x2566('0x4b')]['id']},'attributes':['id',_0x2566('0x29'),_0x2566('0x59'),_0x2566('0x5a'),_0x2566('0x5b'),_0x2566('0x5c'),_0x2566('0x5d'),_0x2566('0x5e')]})[_0x2566('0x25')](handleEntityNotFound(_0x2fe719,null))[_0x2566('0x25')](function(_0x1612e7){if(_0x1612e7){_0x375e20=_0x1612e7['username'];_0x2ba3b4=_0x1612e7['accessKey'];_0x4d5ac1=_0x1612e7['moduleName'];_0x2878f2=_0x1612e7[_0x2566('0x5c')];var _0x1b7152=_0x2878f2[_0x2566('0x5f')](-0x1);if(_0x1b7152==='/'){_0x2878f2=_0x2878f2[_0x2566('0x60')](0x0,_0x2878f2[_0x2566('0x61')](_0x1b7152));}_0x49a8fc=util['format'](_0x2566('0x62'),_0x2878f2);var _0x4c3787={'method':_0x2566('0x63'),'uri':_0x49a8fc,'qs':{'operation':_0x2566('0x64'),'username':_0x1612e7['username']},'json':!![]};return rp(_0x4c3787);}})['then'](function(_0x252d3c){if(_0x252d3c[_0x2566('0x65')]){var _0x27e933={'method':_0x2566('0x66'),'uri':_0x49a8fc,'form':{'operation':_0x2566('0x67'),'username':_0x375e20,'accessKey':md5(_0x252d3c['result']['token']+_0x2ba3b4)},'json':!![]};return rp(_0x27e933);}})[_0x2566('0x25')](function(_0x1b7185){if(_0x1b7185[_0x2566('0x65')]){var _0x364bf5={'method':_0x2566('0x63'),'uri':_0x49a8fc,'qs':{'operation':'describe','username':_0x375e20,'sessionName':_0x1b7185[_0x2566('0x68')]['sessionName'],'elementType':_0x4d5ac1},'json':!![]};return rp(_0x364bf5);}})[_0x2566('0x25')](function(_0x3a514c){if(_0x3a514c['success']){var _0x317745=[_0x2566('0x69'),_0x2566('0x6a'),_0x2566('0x6b')];_[_0x2566('0x6c')](_0x3a514c[_0x2566('0x68')][_0x2566('0x35')],function(_0x485234){return _0x317745[_0x2566('0x6d')](_0x485234[_0x2566('0x3e')][_0x2566('0x29')]);});_[_0x2566('0x6c')](_0x3a514c['result'][_0x2566('0x35')],function(_0x47959a){return _0x47959a[_0x2566('0x6e')]==='false';});return{'count':_0x3a514c[_0x2566('0x68')][_0x2566('0x35')][_0x2566('0x36')],'rows':_[_0x2566('0x2c')](_0x3a514c[_0x2566('0x68')][_0x2566('0x35')],function(_0x396f55){return{'id':_0x396f55[_0x2566('0x29')],'name':_0x396f55[_0x2566('0x6f')],'custom':_[_0x2566('0x70')](_0x396f55[_0x2566('0x29')],'cf_')?!![]:![],'options':_0x396f55[_0x2566('0x3e')][_0x2566('0x29')]==='picklist'&&_0x396f55[_0x2566('0x3e')][_0x2566('0x71')][_0x2566('0x36')]>0x0?_['map'](_0x396f55[_0x2566('0x3e')][_0x2566('0x71')],function(_0x478a65){return{'name':_0x478a65[_0x2566('0x6f')],'value':_0x478a65[_0x2566('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x2fe719,null))[_0x2566('0x44')](function(_0x328154){console[_0x2566('0x73')]('vTiger\x20error:\x20'+_0x328154);var _0x323adf=_0xf586[_0x2566('0x37')][_0x2566('0x74')]?0x1f4:_0x328154['statusCode']||0x1f4;logger['error'](_0x2566('0x75'),_0x2566('0x76'),_0x323adf,JSON[_0x2566('0x77')](_0x328154));delete _0x328154[_0x2566('0x29')];if(_0x323adf===0x191){_0x323adf=0x190;}_0x2fe719['status'](_0x323adf)['send'](_0xf586[_0x2566('0x37')][_0x2566('0x74')]?{'message':_0x2566('0x78'),'statusCode':_0x328154['statusCode']}:_0x328154);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 0c0b1dd..acbe92f 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 _0x2947=['../../config/logger','api','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x5007d7,_0x352101){var _0x14bc2b=function(_0x42a379){while(--_0x42a379){_0x5007d7['push'](_0x5007d7['shift']());}};_0x14bc2b(++_0x352101);}(_0x2947,0xb2));var _0x7294=function(_0x2e244b,_0x6cd26a){_0x2e244b=_0x2e244b-0x0;var _0xe038a=_0x2947[_0x2e244b];return _0xe038a;};'use strict';var _=require(_0x7294('0x0'));var util=require(_0x7294('0x1'));var logger=require(_0x7294('0x2'))(_0x7294('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7294('0x4'));var rimraf=require(_0x7294('0x5'));var config=require('../../config/environment');var attributes=require(_0x7294('0x6'));var integrations=require(_0x7294('0x7'));module[_0x7294('0x8')]=function(_0x6cbff5,_0x3ed8e2){return _0x6cbff5[_0x7294('0x9')](_0x7294('0xa'),attributes,{'tableName':_0x7294('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02fb=['moment','bluebird','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x44b124,_0x53f626){var _0x4ada33=function(_0x442b57){while(--_0x442b57){_0x44b124['push'](_0x44b124['shift']());}};_0x4ada33(++_0x53f626);}(_0x02fb,0x1b6));var _0xb02f=function(_0xa8ce3b,_0x36d83d){_0xa8ce3b=_0xa8ce3b-0x0;var _0x4a894e=_0x02fb[_0xa8ce3b];return _0x4a894e;};'use strict';var _=require(_0xb02f('0x0'));var util=require(_0xb02f('0x1'));var logger=require(_0xb02f('0x2'))(_0xb02f('0x3'));var moment=require(_0xb02f('0x4'));var BPromise=require(_0xb02f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb02f('0x6'));var rimraf=require(_0xb02f('0x7'));var config=require('../../config/environment');var attributes=require(_0xb02f('0x8'));var integrations=require(_0xb02f('0x9'));module[_0xb02f('0xa')]=function(_0x219abe,_0x38b740){return _0x219abe[_0xb02f('0xb')]('VtigerAccount',attributes,{'tableName':_0xb02f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index b811a1d..df7c849 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 _0xbaf0=['VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','model','map','ShowVtigerAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetVtigerAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowVtigerAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file +var _0x6c76=['findAll','options','raw','where','attributes','map','include','model','GetVtigerAccount','debug','ShowVtigerAccount','VtigerAccount','find','then','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1b4c64,_0xc02907){var _0x114ace=function(_0x1cc386){while(--_0x1cc386){_0x1b4c64['push'](_0x1b4c64['shift']());}};_0x114ace(++_0xc02907);}(_0x6c76,0x184));var _0x66c7=function(_0x1e2215,_0x2b2bd5){_0x1e2215=_0x1e2215-0x0;var _0x28f0cf=_0x6c76[_0x1e2215];return _0x28f0cf;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['GetVtigerAccount']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['VtigerAccount'][_0x66c7('0x14')]({'raw':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x5129f6['options']?_0x5129f6['options'][_0x66c7('0x17')]||null:null,'attributes':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'limit':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['limit']||null:null,'include':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['include']?_[_0x66c7('0x19')](_0x5129f6[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fc9d3){return{'model':db[_0x1fc9d3['model']],'as':_0x1fc9d3['as'],'attributes':_0x1fc9d3[_0x66c7('0x18')],'include':_0x1fc9d3[_0x66c7('0x1a')]?_['map'](_0x1fc9d3[_0x66c7('0x1a')],function(_0x11a6b9){return{'model':db[_0x11a6b9[_0x66c7('0x1b')]],'as':_0x11a6b9['as'],'attributes':_0x11a6b9[_0x66c7('0x18')],'include':_0x11a6b9[_0x66c7('0x1a')]?_['map'](_0x11a6b9['include'],function(_0x4e514a){return{'model':db[_0x4e514a[_0x66c7('0x1b')]],'as':_0x4e514a['as'],'attributes':_0x4e514a[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9afd50){logger[_0x66c7('0xa')](_0x66c7('0x1c'),_0x5129f6);logger[_0x66c7('0x1d')](_0x66c7('0x1c'),_0x5129f6,JSON[_0x66c7('0xe')](_0x9afd50));_0x19f29d(_0x9afd50);})['catch'](function(_0xccefb2){logger[_0x66c7('0xf')](_0x66c7('0x1c'),_0xccefb2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0xccefb2['message']));});});};exports[_0x66c7('0x1e')]=function(_0x4f1a34){var _0xfbd97=this;return new Promise(function(_0x543fbf,_0x296875){return db[_0x66c7('0x1f')][_0x66c7('0x20')]({'raw':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x4f1a34['options']?_0x4f1a34['options'][_0x66c7('0x17')]||null:null,'attributes':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'include':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fd460){return{'model':db[_0x1fd460[_0x66c7('0x1b')]],'as':_0x1fd460['as'],'attributes':_0x1fd460['attributes'],'include':_0x1fd460['include']?_[_0x66c7('0x19')](_0x1fd460[_0x66c7('0x1a')],function(_0x367ad5){return{'model':db[_0x367ad5[_0x66c7('0x1b')]],'as':_0x367ad5['as'],'attributes':_0x367ad5[_0x66c7('0x18')],'include':_0x367ad5[_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x367ad5['include'],function(_0x30b90f){return{'model':db[_0x30b90f[_0x66c7('0x1b')]],'as':_0x30b90f['as'],'attributes':_0x30b90f[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x66c7('0x21')](function(_0x1e5993){logger[_0x66c7('0xa')](_0x66c7('0x1e'),_0x4f1a34);logger[_0x66c7('0x1d')](_0x66c7('0x1e'),_0x4f1a34,JSON[_0x66c7('0xe')](_0x1e5993));_0x543fbf(_0x1e5993);})[_0x66c7('0x13')](function(_0x4cd663){logger['error'](_0x66c7('0x1e'),_0x4cd663[_0x66c7('0x11')],_0x4f1a34);_0x296875(_0xfbd97[_0x66c7('0xf')](0x1f4,_0x4cd663['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index defa727..aeb0c5c 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 _0xe8f3=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','util','path'];(function(_0x275b0a,_0x1691de){var _0xc01aea=function(_0x579e33){while(--_0x579e33){_0x275b0a['push'](_0x275b0a['shift']());}};_0xc01aea(++_0x1691de);}(_0xe8f3,0xfb));var _0x3e8f=function(_0x379762,_0x27bda8){_0x379762=_0x379762-0x0;var _0x38d916=_0xe8f3[_0x379762];return _0x38d916;};'use strict';var multer=require('multer');var util=require(_0x3e8f('0x0'));var path=require(_0x3e8f('0x1'));var timeout=require(_0x3e8f('0x2'));var express=require('express');var router=express[_0x3e8f('0x3')]();var fs_extra=require(_0x3e8f('0x4'));var auth=require(_0x3e8f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3e8f('0x6'));var controller=require(_0x3e8f('0x7'));router[_0x3e8f('0x8')]('/',auth[_0x3e8f('0x9')](),controller['index']);router[_0x3e8f('0x8')](_0x3e8f('0xa'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0xb')]);router['get'](_0x3e8f('0xc'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0xd')]);router[_0x3e8f('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x3e8f('0xe')]);router['get'](_0x3e8f('0xf'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x10')]);router[_0x3e8f('0x11')]('/',auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x12')]);router['put'](_0x3e8f('0xa'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x13')]);router[_0x3e8f('0x14')]('/:id',auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x15')]);module[_0x3e8f('0x16')]=router; \ No newline at end of file +var _0x20bd=['./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x20bd,0x12e));var _0xd20b=function(_0x39785f,_0x409e74){_0x39785f=_0x39785f-0x0;var _0x5a5138=_0x20bd[_0x39785f];return _0x5a5138;};'use strict';var multer=require(_0xd20b('0x0'));var util=require(_0xd20b('0x1'));var path=require(_0xd20b('0x2'));var timeout=require(_0xd20b('0x3'));var express=require(_0xd20b('0x4'));var router=express[_0xd20b('0x5')]();var fs_extra=require(_0xd20b('0x6'));var auth=require(_0xd20b('0x7'));var interaction=require(_0xd20b('0x8'));var config=require(_0xd20b('0x9'));var controller=require(_0xd20b('0xa'));router[_0xd20b('0xb')]('/',auth[_0xd20b('0xc')](),controller[_0xd20b('0xd')]);router[_0xd20b('0xb')](_0xd20b('0xe'),auth[_0xd20b('0xc')](),controller[_0xd20b('0xf')]);router[_0xd20b('0xb')]('/:id/fields',auth[_0xd20b('0xc')](),controller[_0xd20b('0x10')]);router['get'](_0xd20b('0x11'),auth[_0xd20b('0xc')](),controller[_0xd20b('0x12')]);router[_0xd20b('0xb')](_0xd20b('0x13'),auth[_0xd20b('0xc')](),controller['getDescriptions']);router['post']('/',auth[_0xd20b('0xc')](),controller['create']);router['put'](_0xd20b('0xe'),auth[_0xd20b('0xc')](),controller[_0xd20b('0x14')]);router[_0xd20b('0x15')](_0xd20b('0xe'),auth[_0xd20b('0xc')](),controller[_0xd20b('0x16')]);module[_0xd20b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 7efe636..9c157e4 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 _0xb282=['STRING','exports'];(function(_0x6978c0,_0x1f6765){var _0x361377=function(_0x2d6cfd){while(--_0x2d6cfd){_0x6978c0['push'](_0x6978c0['shift']());}};_0x361377(++_0x1f6765);}(_0xb282,0x17b));var _0x2b28=function(_0x35568e,_0x28512c){_0x35568e=_0x35568e-0x0;var _0x389ad8=_0xb282[_0x35568e];return _0x389ad8;};'use strict';var Sequelize=require('sequelize');module[_0x2b28('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2b28('0x1')]}}; \ No newline at end of file +var _0x5270=['exports','STRING','sequelize'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x5270,0x1af));var _0x0527=function(_0x5452f9,_0x4857eb){_0x5452f9=_0x5452f9-0x0;var _0x495d5a=_0x5270[_0x5452f9];return _0x495d5a;};'use strict';var Sequelize=require(_0x0527('0x0'));module[_0x0527('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0527('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 6635921..f6cec51 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 _0xb549=['pick','filter','where','merge','options','includeAll','include','findAll','catch','show','keys','rawAttributes','create','body','find','params','getFields','findOne','VtigerField','order','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','fieldName','type','query','intersection','model','attributes','fields','length','sort','filters'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0xb549,0x164));var _0x9b54=function(_0x4e2fd5,_0x719591){_0x4e2fd5=_0x4e2fd5-0x0;var _0x134665=_0xb549[_0x4e2fd5];return _0x134665;};'use strict';var emlformat=require(_0x9b54('0x0'));var rimraf=require(_0x9b54('0x1'));var zipdir=require(_0x9b54('0x2'));var jsonpatch=require(_0x9b54('0x3'));var rp=require(_0x9b54('0x4'));var moment=require(_0x9b54('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9b54('0x6'));var util=require(_0x9b54('0x7'));var path=require(_0x9b54('0x8'));var sox=require(_0x9b54('0x9'));var csv=require(_0x9b54('0xa'));var ejs=require(_0x9b54('0xb'));var fs=require('fs');var fs_extra=require(_0x9b54('0xc'));var _=require(_0x9b54('0xd'));var squel=require(_0x9b54('0xe'));var crypto=require(_0x9b54('0xf'));var jsforce=require(_0x9b54('0x10'));var deskjs=require(_0x9b54('0x11'));var toCsv=require(_0x9b54('0xa'));var querystring=require(_0x9b54('0x12'));var Papa=require(_0x9b54('0x13'));var Redis=require(_0x9b54('0x14'));var authService=require(_0x9b54('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x9b54('0x16'));var hardwareService=require(_0x9b54('0x17'));var logger=require(_0x9b54('0x18'))(_0x9b54('0x19'));var utils=require(_0x9b54('0x1a'));var config=require(_0x9b54('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x296945,_0x125e16){_0x125e16=_0x125e16||0xcc;return function(_0x2315d1){if(_0x2315d1){return _0x296945[_0x9b54('0x1c')](_0x125e16);}return _0x296945['status'](_0x125e16)[_0x9b54('0x1d')]();};}function respondWithResult(_0x530333,_0x545296){_0x545296=_0x545296||0xc8;return function(_0xacda27){if(_0xacda27){return _0x530333['status'](_0x545296)[_0x9b54('0x1e')](_0xacda27);}};}function respondWithFilteredResult(_0x2e8072,_0x1458aa){return function(_0x1173ae){if(_0x1173ae){var _0x70729b=typeof _0x1458aa[_0x9b54('0x1f')]===_0x9b54('0x20')&&typeof _0x1458aa[_0x9b54('0x21')]===_0x9b54('0x20');var _0x57d093=_0x1173ae[_0x9b54('0x22')];var _0x4751dd=_0x70729b?0x0:_0x1458aa[_0x9b54('0x1f')];var _0x2fcdd4=_0x70729b?_0x1173ae[_0x9b54('0x22')]:_0x1458aa['offset']+_0x1458aa[_0x9b54('0x21')];var _0x8cc81e;if(_0x2fcdd4>=_0x57d093){_0x2fcdd4=_0x57d093;_0x8cc81e=0xc8;}else{_0x8cc81e=0xce;}_0x2e8072[_0x9b54('0x23')](_0x8cc81e);return _0x2e8072[_0x9b54('0x24')]('Content-Range',_0x4751dd+'-'+_0x2fcdd4+'/'+_0x57d093)[_0x9b54('0x1e')](_0x1173ae);}return null;};}function patchUpdates(_0x93c7d2){return function(_0x1416fa){try{jsonpatch[_0x9b54('0x25')](_0x1416fa,_0x93c7d2,!![]);}catch(_0x5225f6){return BPromise[_0x9b54('0x26')](_0x5225f6);}return _0x1416fa[_0x9b54('0x27')]();};}function saveUpdates(_0x4fa934,_0x815b86){return function(_0x2efe8b){if(_0x2efe8b){return _0x2efe8b[_0x9b54('0x28')](_0x4fa934)[_0x9b54('0x29')](function(_0x294b4b){return _0x294b4b;});}return null;};}function removeEntity(_0x581a7b,_0x385ae8){return function(_0x512291){if(_0x512291){return _0x512291[_0x9b54('0x2a')]()[_0x9b54('0x29')](function(){_0x581a7b['status'](0xcc)[_0x9b54('0x1d')]();});}};}function handleEntityNotFound(_0x3bb32d,_0x26e3ad){return function(_0x1a1dd3){if(!_0x1a1dd3){_0x3bb32d[_0x9b54('0x1c')](0x194);}return _0x1a1dd3;};}function handleError(_0x16439a,_0x2c57cf){_0x2c57cf=_0x2c57cf||0x1f4;return function(_0xa01ee3){logger['error'](_0xa01ee3[_0x9b54('0x2b')]);if(_0xa01ee3[_0x9b54('0x2c')]){delete _0xa01ee3['name'];}_0x16439a[_0x9b54('0x23')](_0x2c57cf)[_0x9b54('0x2d')](_0xa01ee3);};}exports[_0x9b54('0x2e')]=function(_0x4fa54b,_0x2404ab){var _0x1090b3={},_0x5cbfe9={},_0x2cb3ea={'count':0x0,'rows':[]};var _0x3c9491=_[_0x9b54('0x2f')](db[_0x9b54('0x30')]['rawAttributes'],function(_0x3e1a2d){return{'name':_0x3e1a2d[_0x9b54('0x31')],'type':_0x3e1a2d[_0x9b54('0x32')]['key']};});_0x5cbfe9['model']=_[_0x9b54('0x2f')](_0x3c9491,_0x9b54('0x2c'));_0x5cbfe9[_0x9b54('0x33')]=_['keys'](_0x4fa54b[_0x9b54('0x33')]);_0x5cbfe9['filters']=_[_0x9b54('0x34')](_0x5cbfe9[_0x9b54('0x35')],_0x5cbfe9['query']);_0x1090b3[_0x9b54('0x36')]=_['intersection'](_0x5cbfe9[_0x9b54('0x35')],qs[_0x9b54('0x37')](_0x4fa54b['query'][_0x9b54('0x37')]));_0x1090b3[_0x9b54('0x36')]=_0x1090b3[_0x9b54('0x36')][_0x9b54('0x38')]?_0x1090b3[_0x9b54('0x36')]:_0x5cbfe9[_0x9b54('0x35')];if(!_0x4fa54b[_0x9b54('0x33')]['hasOwnProperty']('nolimit')){_0x1090b3[_0x9b54('0x21')]=qs[_0x9b54('0x21')](_0x4fa54b[_0x9b54('0x33')][_0x9b54('0x21')]);_0x1090b3['offset']=qs[_0x9b54('0x1f')](_0x4fa54b[_0x9b54('0x33')][_0x9b54('0x1f')]);}_0x1090b3['order']=qs['sort'](_0x4fa54b['query'][_0x9b54('0x39')]);_0x1090b3['where']=qs[_0x9b54('0x3a')](_[_0x9b54('0x3b')](_0x4fa54b[_0x9b54('0x33')],_0x5cbfe9['filters']),_0x3c9491);if(_0x4fa54b[_0x9b54('0x33')][_0x9b54('0x3c')]){_0x1090b3[_0x9b54('0x3d')]=_[_0x9b54('0x3e')](_0x1090b3[_0x9b54('0x3d')],{'$or':_[_0x9b54('0x2f')](_0x3c9491,function(_0x3fc3cd){if(_0x3fc3cd[_0x9b54('0x32')]!=='VIRTUAL'){var _0x351f7b={};_0x351f7b[_0x3fc3cd[_0x9b54('0x2c')]]={'$like':'%'+_0x4fa54b['query'][_0x9b54('0x3c')]+'%'};return _0x351f7b;}})});}_0x1090b3=_[_0x9b54('0x3e')]({},_0x1090b3,_0x4fa54b[_0x9b54('0x3f')]);var _0x321f18={'where':_0x1090b3[_0x9b54('0x3d')]};return db[_0x9b54('0x30')][_0x9b54('0x22')](_0x321f18)[_0x9b54('0x29')](function(_0x409388){_0x2cb3ea[_0x9b54('0x22')]=_0x409388;if(_0x4fa54b[_0x9b54('0x33')][_0x9b54('0x40')]){_0x1090b3[_0x9b54('0x41')]=[{'all':!![]}];}return db[_0x9b54('0x30')][_0x9b54('0x42')](_0x1090b3);})[_0x9b54('0x29')](function(_0x137dfc){_0x2cb3ea['rows']=_0x137dfc;return _0x2cb3ea;})[_0x9b54('0x29')](respondWithFilteredResult(_0x2404ab,_0x1090b3))[_0x9b54('0x43')](handleError(_0x2404ab,null));};exports[_0x9b54('0x44')]=function(_0xd56d6e,_0x575dfd){var _0x26dd53={'raw':![],'where':{'id':_0xd56d6e['params']['id']}},_0x3525d={};_0x3525d['model']=_[_0x9b54('0x45')](db[_0x9b54('0x30')][_0x9b54('0x46')]);_0x3525d[_0x9b54('0x33')]=_[_0x9b54('0x45')](_0xd56d6e[_0x9b54('0x33')]);_0x3525d[_0x9b54('0x3a')]=_[_0x9b54('0x34')](_0x3525d[_0x9b54('0x35')],_0x3525d[_0x9b54('0x33')]);_0x26dd53[_0x9b54('0x36')]=_[_0x9b54('0x34')](_0x3525d[_0x9b54('0x35')],qs[_0x9b54('0x37')](_0xd56d6e[_0x9b54('0x33')][_0x9b54('0x37')]));_0x26dd53[_0x9b54('0x36')]=_0x26dd53[_0x9b54('0x36')][_0x9b54('0x38')]?_0x26dd53[_0x9b54('0x36')]:_0x3525d['model'];if(_0xd56d6e[_0x9b54('0x33')]['includeAll']){_0x26dd53[_0x9b54('0x41')]=[{'all':!![]}];}_0x26dd53=_[_0x9b54('0x3e')]({},_0x26dd53,_0xd56d6e[_0x9b54('0x3f')]);return db[_0x9b54('0x30')]['find'](_0x26dd53)[_0x9b54('0x29')](handleEntityNotFound(_0x575dfd,null))[_0x9b54('0x29')](respondWithResult(_0x575dfd,null))[_0x9b54('0x43')](handleError(_0x575dfd,null));};exports[_0x9b54('0x47')]=function(_0x5b8992,_0xdbc9d4){return db[_0x9b54('0x30')][_0x9b54('0x47')](_0x5b8992[_0x9b54('0x48')],{})[_0x9b54('0x29')](respondWithResult(_0xdbc9d4,0xc9))[_0x9b54('0x43')](handleError(_0xdbc9d4,null));};exports['update']=function(_0x212af6,_0x192d37){if(_0x212af6[_0x9b54('0x48')]['id']){delete _0x212af6[_0x9b54('0x48')]['id'];}return db[_0x9b54('0x30')]['find']({'where':{'id':_0x212af6['params']['id']}})['then'](handleEntityNotFound(_0x192d37,null))['then'](saveUpdates(_0x212af6[_0x9b54('0x48')],null))[_0x9b54('0x29')](respondWithResult(_0x192d37,null))['catch'](handleError(_0x192d37,null));};exports[_0x9b54('0x2a')]=function(_0x4fc7bc,_0xa6b9e9){return db[_0x9b54('0x30')][_0x9b54('0x49')]({'where':{'id':_0x4fc7bc[_0x9b54('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa6b9e9,null))['then'](removeEntity(_0xa6b9e9,null))[_0x9b54('0x43')](handleError(_0xa6b9e9,null));};exports[_0x9b54('0x4b')]=function(_0x647242,_0x420e83,_0x5df240){var _0x2e45f1={};var _0x41d259={};var _0x247b52;var _0x368b30;return db['VtigerConfiguration'][_0x9b54('0x4c')]({'where':{'id':_0x647242[_0x9b54('0x4a')]['id']}})[_0x9b54('0x29')](handleEntityNotFound(_0x420e83,null))[_0x9b54('0x29')](function(_0x4558db){if(_0x4558db){_0x247b52=_0x4558db;_0x41d259[_0x9b54('0x35')]=_[_0x9b54('0x45')](db[_0x9b54('0x4d')][_0x9b54('0x46')]);_0x41d259[_0x9b54('0x33')]=_[_0x9b54('0x45')](_0x647242[_0x9b54('0x33')]);_0x41d259[_0x9b54('0x3a')]=_[_0x9b54('0x34')](_0x41d259[_0x9b54('0x35')],_0x41d259[_0x9b54('0x33')]);_0x2e45f1['attributes']=_[_0x9b54('0x34')](_0x41d259[_0x9b54('0x35')],qs[_0x9b54('0x37')](_0x647242[_0x9b54('0x33')]['fields']));_0x2e45f1['attributes']=_0x2e45f1[_0x9b54('0x36')]['length']?_0x2e45f1[_0x9b54('0x36')]:_0x41d259['model'];_0x2e45f1[_0x9b54('0x4e')]=qs[_0x9b54('0x39')](_0x647242[_0x9b54('0x33')]['sort']);_0x2e45f1[_0x9b54('0x3d')]=qs['filters'](_[_0x9b54('0x3b')](_0x647242[_0x9b54('0x33')],_0x41d259[_0x9b54('0x3a')]));if(_0x647242['query'][_0x9b54('0x3c')]){_0x2e45f1['where']=_[_0x9b54('0x3e')](_0x2e45f1[_0x9b54('0x3d')],{'$or':_[_0x9b54('0x2f')](_0x2e45f1['attributes'],function(_0x585ea4){var _0x4b4c33={};_0x4b4c33[_0x585ea4]={'$like':'%'+_0x647242[_0x9b54('0x33')]['filter']+'%'};return _0x4b4c33;})});}_0x2e45f1=_[_0x9b54('0x3e')]({},_0x2e45f1,_0x647242[_0x9b54('0x3f')]);return _0x247b52[_0x9b54('0x4b')](_0x2e45f1);}})[_0x9b54('0x29')](function(_0x67aded){if(_0x67aded){_0x368b30=_0x67aded[_0x9b54('0x38')];if(!_0x647242[_0x9b54('0x33')][_0x9b54('0x4f')](_0x9b54('0x50'))){_0x2e45f1[_0x9b54('0x21')]=qs[_0x9b54('0x21')](_0x647242[_0x9b54('0x33')][_0x9b54('0x21')]);_0x2e45f1[_0x9b54('0x1f')]=qs[_0x9b54('0x1f')](_0x647242['query'][_0x9b54('0x1f')]);}return _0x247b52[_0x9b54('0x4b')](_0x2e45f1);}})[_0x9b54('0x29')](function(_0xdbdde7){if(_0xdbdde7){return _0xdbdde7?{'count':_0x368b30,'rows':_0xdbdde7}:null;}})[_0x9b54('0x29')](respondWithResult(_0x420e83,null))[_0x9b54('0x43')](handleError(_0x420e83,null));};exports[_0x9b54('0x51')]=function(_0x5f178e,_0xce9125,_0x43526a){var _0x120ea3={};var _0x2aa357={};var _0x53dcd7;var _0x443496;return db['VtigerConfiguration'][_0x9b54('0x4c')]({'where':{'id':_0x5f178e['params']['id']}})[_0x9b54('0x29')](handleEntityNotFound(_0xce9125,null))['then'](function(_0x49ac9c){if(_0x49ac9c){_0x53dcd7=_0x49ac9c;_0x2aa357['model']=_['keys'](db[_0x9b54('0x4d')]['rawAttributes']);_0x2aa357[_0x9b54('0x33')]=_[_0x9b54('0x45')](_0x5f178e[_0x9b54('0x33')]);_0x2aa357[_0x9b54('0x3a')]=_[_0x9b54('0x34')](_0x2aa357[_0x9b54('0x35')],_0x2aa357[_0x9b54('0x33')]);_0x120ea3['attributes']=_[_0x9b54('0x34')](_0x2aa357['model'],qs[_0x9b54('0x37')](_0x5f178e[_0x9b54('0x33')][_0x9b54('0x37')]));_0x120ea3['attributes']=_0x120ea3[_0x9b54('0x36')][_0x9b54('0x38')]?_0x120ea3[_0x9b54('0x36')]:_0x2aa357[_0x9b54('0x35')];_0x120ea3[_0x9b54('0x4e')]=qs[_0x9b54('0x39')](_0x5f178e[_0x9b54('0x33')][_0x9b54('0x39')]);_0x120ea3[_0x9b54('0x3d')]=qs['filters'](_[_0x9b54('0x3b')](_0x5f178e[_0x9b54('0x33')],_0x2aa357[_0x9b54('0x3a')]));if(_0x5f178e[_0x9b54('0x33')][_0x9b54('0x3c')]){_0x120ea3[_0x9b54('0x3d')]=_[_0x9b54('0x3e')](_0x120ea3[_0x9b54('0x3d')],{'$or':_[_0x9b54('0x2f')](_0x120ea3['attributes'],function(_0xbd76b9){var _0x201ecd={};_0x201ecd[_0xbd76b9]={'$like':'%'+_0x5f178e[_0x9b54('0x33')][_0x9b54('0x3c')]+'%'};return _0x201ecd;})});}_0x120ea3=_[_0x9b54('0x3e')]({},_0x120ea3,_0x5f178e[_0x9b54('0x3f')]);return _0x53dcd7[_0x9b54('0x51')](_0x120ea3);}})[_0x9b54('0x29')](function(_0x375e86){if(_0x375e86){_0x443496=_0x375e86[_0x9b54('0x38')];if(!_0x5f178e[_0x9b54('0x33')]['hasOwnProperty']('nolimit')){_0x120ea3[_0x9b54('0x21')]=qs['limit'](_0x5f178e[_0x9b54('0x33')]['limit']);_0x120ea3[_0x9b54('0x1f')]=qs[_0x9b54('0x1f')](_0x5f178e[_0x9b54('0x33')][_0x9b54('0x1f')]);}return _0x53dcd7[_0x9b54('0x51')](_0x120ea3);}})[_0x9b54('0x29')](function(_0x5358b7){if(_0x5358b7){return _0x5358b7?{'count':_0x443496,'rows':_0x5358b7}:null;}})[_0x9b54('0x29')](respondWithResult(_0xce9125,null))[_0x9b54('0x43')](handleError(_0xce9125,null));};exports[_0x9b54('0x52')]=function(_0x5c4110,_0xa7aaae,_0x1b6384){var _0x49b2e={};var _0x36335b={};var _0x4b5151;var _0x4cfcb1;return db[_0x9b54('0x30')][_0x9b54('0x4c')]({'where':{'id':_0x5c4110[_0x9b54('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa7aaae,null))['then'](function(_0x9d7d2e){if(_0x9d7d2e){_0x4b5151=_0x9d7d2e;_0x36335b['model']=_[_0x9b54('0x45')](db['VtigerField']['rawAttributes']);_0x36335b[_0x9b54('0x33')]=_['keys'](_0x5c4110[_0x9b54('0x33')]);_0x36335b[_0x9b54('0x3a')]=_[_0x9b54('0x34')](_0x36335b[_0x9b54('0x35')],_0x36335b[_0x9b54('0x33')]);_0x49b2e[_0x9b54('0x36')]=_['intersection'](_0x36335b[_0x9b54('0x35')],qs[_0x9b54('0x37')](_0x5c4110[_0x9b54('0x33')][_0x9b54('0x37')]));_0x49b2e[_0x9b54('0x36')]=_0x49b2e[_0x9b54('0x36')]['length']?_0x49b2e[_0x9b54('0x36')]:_0x36335b[_0x9b54('0x35')];_0x49b2e[_0x9b54('0x4e')]=qs['sort'](_0x5c4110[_0x9b54('0x33')]['sort']);_0x49b2e[_0x9b54('0x3d')]=qs[_0x9b54('0x3a')](_['pick'](_0x5c4110[_0x9b54('0x33')],_0x36335b[_0x9b54('0x3a')]));if(_0x5c4110[_0x9b54('0x33')]['filter']){_0x49b2e[_0x9b54('0x3d')]=_['merge'](_0x49b2e[_0x9b54('0x3d')],{'$or':_[_0x9b54('0x2f')](_0x49b2e[_0x9b54('0x36')],function(_0x285291){var _0x109f7e={};_0x109f7e[_0x285291]={'$like':'%'+_0x5c4110[_0x9b54('0x33')][_0x9b54('0x3c')]+'%'};return _0x109f7e;})});}_0x49b2e=_[_0x9b54('0x3e')]({},_0x49b2e,_0x5c4110['options']);return _0x4b5151[_0x9b54('0x52')](_0x49b2e);}})[_0x9b54('0x29')](function(_0x5cc267){if(_0x5cc267){_0x4cfcb1=_0x5cc267['length'];if(!_0x5c4110[_0x9b54('0x33')]['hasOwnProperty'](_0x9b54('0x50'))){_0x49b2e[_0x9b54('0x21')]=qs[_0x9b54('0x21')](_0x5c4110[_0x9b54('0x33')][_0x9b54('0x21')]);_0x49b2e[_0x9b54('0x1f')]=qs['offset'](_0x5c4110['query']['offset']);}return _0x4b5151['getDescriptions'](_0x49b2e);}})[_0x9b54('0x29')](function(_0x5cae60){if(_0x5cae60){return _0x5cae60?{'count':_0x4cfcb1,'rows':_0x5cae60}:null;}})[_0x9b54('0x29')](respondWithResult(_0xa7aaae,null))[_0x9b54('0x43')](handleError(_0xa7aaae,null));}; \ No newline at end of file +var _0xb0c9=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','VtigerConfiguration','rawAttributes','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','VtigerField','sort','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x35d35d,_0xfb8c78){var _0x604622=function(_0x526141){while(--_0x526141){_0x35d35d['push'](_0x35d35d['shift']());}};_0x604622(++_0xfb8c78);}(_0xb0c9,0xd8));var _0x9b0c=function(_0x36041e,_0x3d6420){_0x36041e=_0x36041e-0x0;var _0x4fce84=_0xb0c9[_0x36041e];return _0x4fce84;};'use strict';var emlformat=require(_0x9b0c('0x0'));var rimraf=require(_0x9b0c('0x1'));var zipdir=require(_0x9b0c('0x2'));var jsonpatch=require(_0x9b0c('0x3'));var rp=require(_0x9b0c('0x4'));var moment=require('moment');var BPromise=require(_0x9b0c('0x5'));var Mustache=require(_0x9b0c('0x6'));var util=require('util');var path=require(_0x9b0c('0x7'));var sox=require('sox');var csv=require(_0x9b0c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b0c('0x9'));var _=require('lodash');var squel=require(_0x9b0c('0xa'));var crypto=require(_0x9b0c('0xb'));var jsforce=require(_0x9b0c('0xc'));var deskjs=require(_0x9b0c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9b0c('0xe'));var Papa=require(_0x9b0c('0xf'));var Redis=require(_0x9b0c('0x10'));var authService=require(_0x9b0c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9b0c('0x12'));var hardwareService=require(_0x9b0c('0x13'));var logger=require(_0x9b0c('0x14'))(_0x9b0c('0x15'));var utils=require(_0x9b0c('0x16'));var config=require(_0x9b0c('0x17'));var licenseUtil=require(_0x9b0c('0x18'));var db=require(_0x9b0c('0x19'))['db'];function respondWithStatusCode(_0x12af10,_0x154c32){_0x154c32=_0x154c32||0xcc;return function(_0x5addbf){if(_0x5addbf){return _0x12af10[_0x9b0c('0x1a')](_0x154c32);}return _0x12af10[_0x9b0c('0x1b')](_0x154c32)[_0x9b0c('0x1c')]();};}function respondWithResult(_0x3b729c,_0xad12d2){_0xad12d2=_0xad12d2||0xc8;return function(_0x389986){if(_0x389986){return _0x3b729c['status'](_0xad12d2)[_0x9b0c('0x1d')](_0x389986);}};}function respondWithFilteredResult(_0x28558d,_0x287583){return function(_0x2e6d69){if(_0x2e6d69){var _0x3de5d3=typeof _0x287583[_0x9b0c('0x1e')]===_0x9b0c('0x1f')&&typeof _0x287583[_0x9b0c('0x20')]===_0x9b0c('0x1f');var _0x2bd27c=_0x2e6d69[_0x9b0c('0x21')];var _0x534fa3=_0x3de5d3?0x0:_0x287583[_0x9b0c('0x1e')];var _0x982321=_0x3de5d3?_0x2e6d69[_0x9b0c('0x21')]:_0x287583[_0x9b0c('0x1e')]+_0x287583[_0x9b0c('0x20')];var _0x427782;if(_0x982321>=_0x2bd27c){_0x982321=_0x2bd27c;_0x427782=0xc8;}else{_0x427782=0xce;}_0x28558d[_0x9b0c('0x1b')](_0x427782);return _0x28558d['set'](_0x9b0c('0x22'),_0x534fa3+'-'+_0x982321+'/'+_0x2bd27c)[_0x9b0c('0x1d')](_0x2e6d69);}return null;};}function patchUpdates(_0x48ca12){return function(_0x259ba6){try{jsonpatch['apply'](_0x259ba6,_0x48ca12,!![]);}catch(_0xd1ba44){return BPromise[_0x9b0c('0x23')](_0xd1ba44);}return _0x259ba6['save']();};}function saveUpdates(_0x34372f,_0x5c47bb){return function(_0x4c5aef){if(_0x4c5aef){return _0x4c5aef[_0x9b0c('0x24')](_0x34372f)[_0x9b0c('0x25')](function(_0x37a157){return _0x37a157;});}return null;};}function removeEntity(_0x4f6191,_0x1645e0){return function(_0x15c38a){if(_0x15c38a){return _0x15c38a[_0x9b0c('0x26')]()[_0x9b0c('0x25')](function(){_0x4f6191['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38746c,_0x4751f9){return function(_0x536f99){if(!_0x536f99){_0x38746c[_0x9b0c('0x1a')](0x194);}return _0x536f99;};}function handleError(_0x3e017f,_0x1705ab){_0x1705ab=_0x1705ab||0x1f4;return function(_0x18092f){logger[_0x9b0c('0x27')](_0x18092f[_0x9b0c('0x28')]);if(_0x18092f[_0x9b0c('0x29')]){delete _0x18092f[_0x9b0c('0x29')];}_0x3e017f['status'](_0x1705ab)[_0x9b0c('0x2a')](_0x18092f);};}exports[_0x9b0c('0x2b')]=function(_0x16bb73,_0x2ba998){var _0x4cfe03={},_0x424df4={},_0x351808={'count':0x0,'rows':[]};var _0x15656b=_['map'](db[_0x9b0c('0x2c')][_0x9b0c('0x2d')],function(_0x3a0cb1){return{'name':_0x3a0cb1['fieldName'],'type':_0x3a0cb1[_0x9b0c('0x2e')]['key']};});_0x424df4['model']=_[_0x9b0c('0x2f')](_0x15656b,_0x9b0c('0x29'));_0x424df4[_0x9b0c('0x30')]=_[_0x9b0c('0x31')](_0x16bb73[_0x9b0c('0x30')]);_0x424df4[_0x9b0c('0x32')]=_[_0x9b0c('0x33')](_0x424df4['model'],_0x424df4[_0x9b0c('0x30')]);_0x4cfe03[_0x9b0c('0x34')]=_[_0x9b0c('0x33')](_0x424df4[_0x9b0c('0x35')],qs[_0x9b0c('0x36')](_0x16bb73[_0x9b0c('0x30')]['fields']));_0x4cfe03['attributes']=_0x4cfe03[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x4cfe03['attributes']:_0x424df4[_0x9b0c('0x35')];if(!_0x16bb73[_0x9b0c('0x30')][_0x9b0c('0x38')](_0x9b0c('0x39'))){_0x4cfe03[_0x9b0c('0x20')]=qs[_0x9b0c('0x20')](_0x16bb73['query']['limit']);_0x4cfe03[_0x9b0c('0x1e')]=qs[_0x9b0c('0x1e')](_0x16bb73['query']['offset']);}_0x4cfe03[_0x9b0c('0x3a')]=qs['sort'](_0x16bb73[_0x9b0c('0x30')]['sort']);_0x4cfe03[_0x9b0c('0x3b')]=qs[_0x9b0c('0x32')](_['pick'](_0x16bb73['query'],_0x424df4[_0x9b0c('0x32')]),_0x15656b);if(_0x16bb73[_0x9b0c('0x30')][_0x9b0c('0x3c')]){_0x4cfe03[_0x9b0c('0x3b')]=_['merge'](_0x4cfe03[_0x9b0c('0x3b')],{'$or':_['map'](_0x15656b,function(_0x3d54c6){if(_0x3d54c6['type']!=='VIRTUAL'){var _0x401b87={};_0x401b87[_0x3d54c6['name']]={'$like':'%'+_0x16bb73[_0x9b0c('0x30')][_0x9b0c('0x3c')]+'%'};return _0x401b87;}})});}_0x4cfe03=_[_0x9b0c('0x3d')]({},_0x4cfe03,_0x16bb73[_0x9b0c('0x3e')]);var _0x48f7e8={'where':_0x4cfe03[_0x9b0c('0x3b')]};return db[_0x9b0c('0x2c')][_0x9b0c('0x21')](_0x48f7e8)[_0x9b0c('0x25')](function(_0x144712){_0x351808[_0x9b0c('0x21')]=_0x144712;if(_0x16bb73['query'][_0x9b0c('0x3f')]){_0x4cfe03[_0x9b0c('0x40')]=[{'all':!![]}];}return db[_0x9b0c('0x2c')][_0x9b0c('0x41')](_0x4cfe03);})[_0x9b0c('0x25')](function(_0x4affc4){_0x351808[_0x9b0c('0x42')]=_0x4affc4;return _0x351808;})['then'](respondWithFilteredResult(_0x2ba998,_0x4cfe03))[_0x9b0c('0x43')](handleError(_0x2ba998,null));};exports['show']=function(_0x34580a,_0x1df276){var _0x5b8040={'raw':![],'where':{'id':_0x34580a[_0x9b0c('0x44')]['id']}},_0xaae074={};_0xaae074[_0x9b0c('0x35')]=_[_0x9b0c('0x31')](db[_0x9b0c('0x2c')][_0x9b0c('0x2d')]);_0xaae074[_0x9b0c('0x30')]=_[_0x9b0c('0x31')](_0x34580a[_0x9b0c('0x30')]);_0xaae074['filters']=_[_0x9b0c('0x33')](_0xaae074[_0x9b0c('0x35')],_0xaae074[_0x9b0c('0x30')]);_0x5b8040[_0x9b0c('0x34')]=_[_0x9b0c('0x33')](_0xaae074['model'],qs['fields'](_0x34580a['query'][_0x9b0c('0x36')]));_0x5b8040['attributes']=_0x5b8040[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x5b8040['attributes']:_0xaae074[_0x9b0c('0x35')];if(_0x34580a['query']['includeAll']){_0x5b8040['include']=[{'all':!![]}];}_0x5b8040=_[_0x9b0c('0x3d')]({},_0x5b8040,_0x34580a['options']);return db['VtigerConfiguration'][_0x9b0c('0x45')](_0x5b8040)[_0x9b0c('0x25')](handleEntityNotFound(_0x1df276,null))[_0x9b0c('0x25')](respondWithResult(_0x1df276,null))['catch'](handleError(_0x1df276,null));};exports[_0x9b0c('0x46')]=function(_0x5bc78f,_0x2c9aa3){return db[_0x9b0c('0x2c')][_0x9b0c('0x46')](_0x5bc78f[_0x9b0c('0x47')],{})[_0x9b0c('0x25')](respondWithResult(_0x2c9aa3,0xc9))[_0x9b0c('0x43')](handleError(_0x2c9aa3,null));};exports[_0x9b0c('0x24')]=function(_0x4c48f2,_0x442609){if(_0x4c48f2[_0x9b0c('0x47')]['id']){delete _0x4c48f2[_0x9b0c('0x47')]['id'];}return db[_0x9b0c('0x2c')][_0x9b0c('0x45')]({'where':{'id':_0x4c48f2[_0x9b0c('0x44')]['id']}})[_0x9b0c('0x25')](handleEntityNotFound(_0x442609,null))['then'](saveUpdates(_0x4c48f2[_0x9b0c('0x47')],null))[_0x9b0c('0x25')](respondWithResult(_0x442609,null))[_0x9b0c('0x43')](handleError(_0x442609,null));};exports[_0x9b0c('0x26')]=function(_0x34f084,_0x30d8dc){return db['VtigerConfiguration'][_0x9b0c('0x45')]({'where':{'id':_0x34f084[_0x9b0c('0x44')]['id']}})[_0x9b0c('0x25')](handleEntityNotFound(_0x30d8dc,null))[_0x9b0c('0x25')](removeEntity(_0x30d8dc,null))[_0x9b0c('0x43')](handleError(_0x30d8dc,null));};exports[_0x9b0c('0x48')]=function(_0x9d2870,_0x42b6ad,_0x91703e){var _0x9355ba={};var _0x4a9fcf={};var _0x38a599;var _0x3b1470;return db[_0x9b0c('0x2c')][_0x9b0c('0x49')]({'where':{'id':_0x9d2870['params']['id']}})[_0x9b0c('0x25')](handleEntityNotFound(_0x42b6ad,null))[_0x9b0c('0x25')](function(_0x302721){if(_0x302721){_0x38a599=_0x302721;_0x4a9fcf[_0x9b0c('0x35')]=_[_0x9b0c('0x31')](db[_0x9b0c('0x4a')][_0x9b0c('0x2d')]);_0x4a9fcf[_0x9b0c('0x30')]=_['keys'](_0x9d2870[_0x9b0c('0x30')]);_0x4a9fcf[_0x9b0c('0x32')]=_[_0x9b0c('0x33')](_0x4a9fcf[_0x9b0c('0x35')],_0x4a9fcf[_0x9b0c('0x30')]);_0x9355ba[_0x9b0c('0x34')]=_['intersection'](_0x4a9fcf[_0x9b0c('0x35')],qs[_0x9b0c('0x36')](_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x36')]));_0x9355ba['attributes']=_0x9355ba[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x9355ba[_0x9b0c('0x34')]:_0x4a9fcf[_0x9b0c('0x35')];_0x9355ba[_0x9b0c('0x3a')]=qs['sort'](_0x9d2870['query'][_0x9b0c('0x4b')]);_0x9355ba[_0x9b0c('0x3b')]=qs['filters'](_[_0x9b0c('0x4c')](_0x9d2870['query'],_0x4a9fcf[_0x9b0c('0x32')]));if(_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x3c')]){_0x9355ba[_0x9b0c('0x3b')]=_[_0x9b0c('0x3d')](_0x9355ba[_0x9b0c('0x3b')],{'$or':_[_0x9b0c('0x2f')](_0x9355ba['attributes'],function(_0x29ee5c){var _0x4e7e3d={};_0x4e7e3d[_0x29ee5c]={'$like':'%'+_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x3c')]+'%'};return _0x4e7e3d;})});}_0x9355ba=_[_0x9b0c('0x3d')]({},_0x9355ba,_0x9d2870[_0x9b0c('0x3e')]);return _0x38a599['getFields'](_0x9355ba);}})[_0x9b0c('0x25')](function(_0x4cef89){if(_0x4cef89){_0x3b1470=_0x4cef89[_0x9b0c('0x37')];if(!_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x38')](_0x9b0c('0x39'))){_0x9355ba[_0x9b0c('0x20')]=qs[_0x9b0c('0x20')](_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x20')]);_0x9355ba[_0x9b0c('0x1e')]=qs[_0x9b0c('0x1e')](_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x1e')]);}return _0x38a599[_0x9b0c('0x48')](_0x9355ba);}})['then'](function(_0x598da2){if(_0x598da2){return _0x598da2?{'count':_0x3b1470,'rows':_0x598da2}:null;}})[_0x9b0c('0x25')](respondWithResult(_0x42b6ad,null))[_0x9b0c('0x43')](handleError(_0x42b6ad,null));};exports[_0x9b0c('0x4d')]=function(_0x125a6b,_0x5348df,_0x5a111c){var _0x3b46ea={};var _0x2cf68c={};var _0x4857c2;var _0xf2175e;return db[_0x9b0c('0x2c')][_0x9b0c('0x49')]({'where':{'id':_0x125a6b[_0x9b0c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5348df,null))[_0x9b0c('0x25')](function(_0x319e1f){if(_0x319e1f){_0x4857c2=_0x319e1f;_0x2cf68c[_0x9b0c('0x35')]=_[_0x9b0c('0x31')](db[_0x9b0c('0x4a')][_0x9b0c('0x2d')]);_0x2cf68c[_0x9b0c('0x30')]=_['keys'](_0x125a6b[_0x9b0c('0x30')]);_0x2cf68c['filters']=_['intersection'](_0x2cf68c[_0x9b0c('0x35')],_0x2cf68c[_0x9b0c('0x30')]);_0x3b46ea[_0x9b0c('0x34')]=_[_0x9b0c('0x33')](_0x2cf68c[_0x9b0c('0x35')],qs[_0x9b0c('0x36')](_0x125a6b[_0x9b0c('0x30')][_0x9b0c('0x36')]));_0x3b46ea['attributes']=_0x3b46ea[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x3b46ea[_0x9b0c('0x34')]:_0x2cf68c[_0x9b0c('0x35')];_0x3b46ea['order']=qs[_0x9b0c('0x4b')](_0x125a6b['query']['sort']);_0x3b46ea[_0x9b0c('0x3b')]=qs['filters'](_[_0x9b0c('0x4c')](_0x125a6b[_0x9b0c('0x30')],_0x2cf68c[_0x9b0c('0x32')]));if(_0x125a6b[_0x9b0c('0x30')][_0x9b0c('0x3c')]){_0x3b46ea[_0x9b0c('0x3b')]=_[_0x9b0c('0x3d')](_0x3b46ea[_0x9b0c('0x3b')],{'$or':_['map'](_0x3b46ea['attributes'],function(_0x37a9c4){var _0x326ce8={};_0x326ce8[_0x37a9c4]={'$like':'%'+_0x125a6b[_0x9b0c('0x30')][_0x9b0c('0x3c')]+'%'};return _0x326ce8;})});}_0x3b46ea=_[_0x9b0c('0x3d')]({},_0x3b46ea,_0x125a6b[_0x9b0c('0x3e')]);return _0x4857c2['getSubjects'](_0x3b46ea);}})[_0x9b0c('0x25')](function(_0x1251b6){if(_0x1251b6){_0xf2175e=_0x1251b6[_0x9b0c('0x37')];if(!_0x125a6b[_0x9b0c('0x30')]['hasOwnProperty']('nolimit')){_0x3b46ea[_0x9b0c('0x20')]=qs[_0x9b0c('0x20')](_0x125a6b[_0x9b0c('0x30')]['limit']);_0x3b46ea[_0x9b0c('0x1e')]=qs[_0x9b0c('0x1e')](_0x125a6b[_0x9b0c('0x30')]['offset']);}return _0x4857c2[_0x9b0c('0x4d')](_0x3b46ea);}})['then'](function(_0x200211){if(_0x200211){return _0x200211?{'count':_0xf2175e,'rows':_0x200211}:null;}})['then'](respondWithResult(_0x5348df,null))['catch'](handleError(_0x5348df,null));};exports[_0x9b0c('0x4e')]=function(_0x9a4d08,_0x392e46,_0x33e7fb){var _0x3dd7b0={};var _0x522d31={};var _0x44db09;var _0xef89c7;return db[_0x9b0c('0x2c')][_0x9b0c('0x49')]({'where':{'id':_0x9a4d08[_0x9b0c('0x44')]['id']}})['then'](handleEntityNotFound(_0x392e46,null))[_0x9b0c('0x25')](function(_0x4f43c8){if(_0x4f43c8){_0x44db09=_0x4f43c8;_0x522d31[_0x9b0c('0x35')]=_['keys'](db[_0x9b0c('0x4a')][_0x9b0c('0x2d')]);_0x522d31[_0x9b0c('0x30')]=_[_0x9b0c('0x31')](_0x9a4d08[_0x9b0c('0x30')]);_0x522d31[_0x9b0c('0x32')]=_['intersection'](_0x522d31[_0x9b0c('0x35')],_0x522d31[_0x9b0c('0x30')]);_0x3dd7b0[_0x9b0c('0x34')]=_[_0x9b0c('0x33')](_0x522d31['model'],qs[_0x9b0c('0x36')](_0x9a4d08[_0x9b0c('0x30')][_0x9b0c('0x36')]));_0x3dd7b0[_0x9b0c('0x34')]=_0x3dd7b0[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x3dd7b0[_0x9b0c('0x34')]:_0x522d31[_0x9b0c('0x35')];_0x3dd7b0['order']=qs[_0x9b0c('0x4b')](_0x9a4d08['query'][_0x9b0c('0x4b')]);_0x3dd7b0[_0x9b0c('0x3b')]=qs['filters'](_['pick'](_0x9a4d08['query'],_0x522d31['filters']));if(_0x9a4d08[_0x9b0c('0x30')][_0x9b0c('0x3c')]){_0x3dd7b0[_0x9b0c('0x3b')]=_[_0x9b0c('0x3d')](_0x3dd7b0['where'],{'$or':_['map'](_0x3dd7b0['attributes'],function(_0x1ac869){var _0x5286b9={};_0x5286b9[_0x1ac869]={'$like':'%'+_0x9a4d08[_0x9b0c('0x30')][_0x9b0c('0x3c')]+'%'};return _0x5286b9;})});}_0x3dd7b0=_[_0x9b0c('0x3d')]({},_0x3dd7b0,_0x9a4d08[_0x9b0c('0x3e')]);return _0x44db09[_0x9b0c('0x4e')](_0x3dd7b0);}})[_0x9b0c('0x25')](function(_0x50a694){if(_0x50a694){_0xef89c7=_0x50a694[_0x9b0c('0x37')];if(!_0x9a4d08[_0x9b0c('0x30')][_0x9b0c('0x38')]('nolimit')){_0x3dd7b0[_0x9b0c('0x20')]=qs['limit'](_0x9a4d08[_0x9b0c('0x30')]['limit']);_0x3dd7b0[_0x9b0c('0x1e')]=qs[_0x9b0c('0x1e')](_0x9a4d08[_0x9b0c('0x30')]['offset']);}return _0x44db09['getDescriptions'](_0x3dd7b0);}})[_0x9b0c('0x25')](function(_0x3824e7){if(_0x3824e7){return _0x3824e7?{'count':_0xef89c7,'rows':_0x3824e7}:null;}})['then'](respondWithResult(_0x392e46,null))[_0x9b0c('0x43')](handleError(_0x392e46,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index f4213f1..6fc9c87 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 _0x3c20=['moment','bluebird','request-promise','path','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api'];(function(_0x5becb2,_0x4b002f){var _0x4e1427=function(_0x235f4a){while(--_0x235f4a){_0x5becb2['push'](_0x5becb2['shift']());}};_0x4e1427(++_0x4b002f);}(_0x3c20,0x11a));var _0x03c2=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x3c20[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x03c2('0x0'));var util=require(_0x03c2('0x1'));var logger=require(_0x03c2('0x2'))(_0x03c2('0x3'));var moment=require(_0x03c2('0x4'));var BPromise=require(_0x03c2('0x5'));var rp=require(_0x03c2('0x6'));var fs=require('fs');var path=require(_0x03c2('0x7'));var rimraf=require('rimraf');var config=require(_0x03c2('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x03c2('0x9')]=function(_0x24e45b,_0x273de8){return _0x24e45b[_0x03c2('0xa')](_0x03c2('0xb'),attributes,{'tableName':_0x03c2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x966b=['request-promise','path','../../config/environment','exports','define','int_vtiger_configurations','util','moment','bluebird'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x966b,0x19b));var _0xb966=function(_0x4883cb,_0x3df63c){_0x4883cb=_0x4883cb-0x0;var _0x33aad7=_0x966b[_0x4883cb];return _0x33aad7;};'use strict';var _=require('lodash');var util=require(_0xb966('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb966('0x1'));var BPromise=require(_0xb966('0x2'));var rp=require(_0xb966('0x3'));var fs=require('fs');var path=require(_0xb966('0x4'));var rimraf=require('rimraf');var config=require(_0xb966('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xb966('0x6')]=function(_0x1b5ea8,_0x44ace0){return _0x1b5ea8[_0xb966('0x7')]('VtigerConfiguration',attributes,{'tableName':_0xb966('0x8'),'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 d7e6136..ec04f08 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 _0x3261=['stringify','error','code','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x446f21,_0x44bce3){var _0x558bf4=function(_0x838858){while(--_0x838858){_0x446f21['push'](_0x446f21['shift']());}};_0x558bf4(++_0x44bce3);}(_0x3261,0x93));var _0x1326=function(_0x3a78ef,_0x5398af){_0x3a78ef=_0x3a78ef-0x0;var _0x2d7b8e=_0x3261[_0x3a78ef];return _0x2d7b8e;};'use strict';var _=require(_0x1326('0x0'));var util=require(_0x1326('0x1'));var moment=require(_0x1326('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1326('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1326('0x4'))(_0x1326('0x5'));var config=require(_0x1326('0x6'));var jayson=require(_0x1326('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12bed0,_0x14aa26,_0x3d76af){return new BPromise(function(_0x2a2326,_0x5a6035){return client[_0x1326('0x8')](_0x12bed0,_0x3d76af)['then'](function(_0x189b9e){logger[_0x1326('0x9')]('VtigerConfiguration,\x20%s,\x20%s',_0x14aa26,_0x1326('0xa'));logger[_0x1326('0xb')](_0x1326('0xc'),_0x14aa26,_0x1326('0xa'),JSON[_0x1326('0xd')](_0x189b9e));if(_0x189b9e[_0x1326('0xe')]){if(_0x189b9e['error'][_0x1326('0xf')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x14aa26,_0x189b9e['error'][_0x1326('0x10')]);return _0x5a6035(_0x189b9e[_0x1326('0xe')]['message']);}logger[_0x1326('0xe')](_0x1326('0x11'),_0x14aa26,_0x189b9e[_0x1326('0xe')]['message']);return _0x2a2326(_0x189b9e[_0x1326('0xe')][_0x1326('0x10')]);}else{logger[_0x1326('0x9')](_0x1326('0x11'),_0x14aa26,_0x1326('0xa'));_0x2a2326(_0x189b9e[_0x1326('0x12')]['message']);}})[_0x1326('0x13')](function(_0x4d5d8d){logger[_0x1326('0xe')](_0x1326('0x11'),_0x14aa26,_0x4d5d8d);_0x5a6035(_0x4d5d8d);});});} \ No newline at end of file +var _0x3581=['../../mysqldb','../../config/environment','jayson/promise','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x555e88,_0x15f0ec){var _0x556baa=function(_0x3fee93){while(--_0x3fee93){_0x555e88['push'](_0x555e88['shift']());}};_0x556baa(++_0x15f0ec);}(_0x3581,0x1da));var _0x1358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3581[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1358('0x0'));var util=require(_0x1358('0x1'));var moment=require(_0x1358('0x2'));var BPromise=require(_0x1358('0x3'));var rs=require(_0x1358('0x4'));var fs=require('fs');var Redis=require(_0x1358('0x5'));var db=require(_0x1358('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1358('0x7'));var jayson=require(_0x1358('0x8'));var client=jayson['client'][_0x1358('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12b7b7,_0x32f781,_0x13bf2a){return new BPromise(function(_0x36d9da,_0x666747){return client[_0x1358('0xa')](_0x12b7b7,_0x13bf2a)['then'](function(_0x432f13){logger['info'](_0x1358('0xb'),_0x32f781,_0x1358('0xc'));logger['debug'](_0x1358('0xd'),_0x32f781,_0x1358('0xc'),JSON[_0x1358('0xe')](_0x432f13));if(_0x432f13['error']){if(_0x432f13[_0x1358('0xf')][_0x1358('0x10')]===0x1f4){logger[_0x1358('0xf')](_0x1358('0xb'),_0x32f781,_0x432f13[_0x1358('0xf')][_0x1358('0x11')]);return _0x666747(_0x432f13[_0x1358('0xf')]['message']);}logger['error'](_0x1358('0xb'),_0x32f781,_0x432f13[_0x1358('0xf')][_0x1358('0x11')]);return _0x36d9da(_0x432f13[_0x1358('0xf')][_0x1358('0x11')]);}else{logger['info'](_0x1358('0xb'),_0x32f781,'request\x20sent');_0x36d9da(_0x432f13[_0x1358('0x12')][_0x1358('0x11')]);}})[_0x1358('0x13')](function(_0x2eb2d2){logger[_0x1358('0xf')](_0x1358('0xb'),_0x32f781,_0x2eb2d2);_0x666747(_0x2eb2d2);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 5b2c798..86d1760 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 _0x4f41=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3d8d92,_0x304e72){var _0x1d3ed8=function(_0x380cdb){while(--_0x380cdb){_0x3d8d92['push'](_0x3d8d92['shift']());}};_0x1d3ed8(++_0x304e72);}(_0x4f41,0x1b2));var _0x14f4=function(_0x96198e,_0x49070b){_0x96198e=_0x96198e-0x0;var _0x564cb6=_0x4f41[_0x96198e];return _0x564cb6;};'use strict';var multer=require(_0x14f4('0x0'));var util=require(_0x14f4('0x1'));var path=require(_0x14f4('0x2'));var timeout=require(_0x14f4('0x3'));var express=require('express');var router=express[_0x14f4('0x4')]();var fs_extra=require(_0x14f4('0x5'));var auth=require(_0x14f4('0x6'));var interaction=require(_0x14f4('0x7'));var config=require(_0x14f4('0x8'));var controller=require(_0x14f4('0x9'));router[_0x14f4('0xa')]('/',auth[_0x14f4('0xb')](),controller[_0x14f4('0xc')]);router[_0x14f4('0xa')](_0x14f4('0xd'),auth[_0x14f4('0xb')](),controller[_0x14f4('0xe')]);router[_0x14f4('0xf')]('/',auth[_0x14f4('0xb')](),controller[_0x14f4('0x10')]);router[_0x14f4('0x11')](_0x14f4('0xd'),auth['isAuthenticated'](),controller[_0x14f4('0x12')]);router[_0x14f4('0x13')](_0x14f4('0xd'),auth['isAuthenticated'](),controller[_0x14f4('0x14')]);module[_0x14f4('0x15')]=router; \ No newline at end of file +var _0xa7cf=['path','connect-timeout','express','Router','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','put','update','delete','destroy','exports','multer','util'];(function(_0x550a9f,_0x4784c6){var _0x2a8aa4=function(_0x31bb3b){while(--_0x31bb3b){_0x550a9f['push'](_0x550a9f['shift']());}};_0x2a8aa4(++_0x4784c6);}(_0xa7cf,0x130));var _0xfa7c=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xa7cf[_0x1e500e];return _0x10dc5e;};'use strict';var multer=require(_0xfa7c('0x0'));var util=require(_0xfa7c('0x1'));var path=require(_0xfa7c('0x2'));var timeout=require(_0xfa7c('0x3'));var express=require(_0xfa7c('0x4'));var router=express[_0xfa7c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfa7c('0x6'));var config=require('../../config/environment');var controller=require(_0xfa7c('0x7'));router[_0xfa7c('0x8')]('/',auth[_0xfa7c('0x9')](),controller[_0xfa7c('0xa')]);router[_0xfa7c('0x8')](_0xfa7c('0xb'),auth[_0xfa7c('0x9')](),controller['show']);router['post']('/',auth[_0xfa7c('0x9')](),controller['create']);router[_0xfa7c('0xc')](_0xfa7c('0xb'),auth[_0xfa7c('0x9')](),controller[_0xfa7c('0xd')]);router[_0xfa7c('0xe')](_0xfa7c('0xb'),auth[_0xfa7c('0x9')](),controller[_0xfa7c('0xf')]);module[_0xfa7c('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 6a4a920..e4f05d4 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 _0x4b98=['picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x341954,_0x8418a4){var _0x30ae07=function(_0x331408){while(--_0x331408){_0x341954['push'](_0x341954['shift']());}};_0x30ae07(++_0x8418a4);}(_0x4b98,0x1a2));var _0x84b9=function(_0xcd4ac,_0xad4b8c){_0xcd4ac=_0xcd4ac-0x0;var _0x57a0ff=_0x4b98[_0xcd4ac];return _0x57a0ff;};'use strict';var Sequelize=require(_0x84b9('0x0'));module[_0x84b9('0x1')]={'type':{'type':Sequelize[_0x84b9('0x2')]('string',_0x84b9('0x3'),_0x84b9('0x4'),'keyValue',_0x84b9('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x84b9('0x6')]},'keyType':{'type':Sequelize[_0x84b9('0x2')](_0x84b9('0x7'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x84b9('0x6')]},'nameField':{'type':Sequelize[_0x84b9('0x6')]},'customField':{'type':Sequelize[_0x84b9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x84b9('0x6')]}}; \ No newline at end of file +var _0x5f21=['string','variable','customVariable','picklist','STRING','sequelize','exports','ENUM'];(function(_0xe57185,_0x34a66f){var _0x2c7ab7=function(_0x1a94d9){while(--_0x1a94d9){_0xe57185['push'](_0xe57185['shift']());}};_0x2c7ab7(++_0x34a66f);}(_0x5f21,0x105));var _0x15f2=function(_0xadd386,_0x1fda2a){_0xadd386=_0xadd386-0x0;var _0xb996dd=_0x5f21[_0xadd386];return _0xb996dd;};'use strict';var Sequelize=require(_0x15f2('0x0'));module[_0x15f2('0x1')]={'type':{'type':Sequelize[_0x15f2('0x2')](_0x15f2('0x3'),_0x15f2('0x4'),_0x15f2('0x5'),'keyValue',_0x15f2('0x6')),'defaultValue':_0x15f2('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x15f2('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x15f2('0x3'),_0x15f2('0x4'),_0x15f2('0x5'))},'keyContent':{'type':Sequelize[_0x15f2('0x7')]},'idField':{'type':Sequelize[_0x15f2('0x7')]},'nameField':{'type':Sequelize[_0x15f2('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x15f2('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 0254d74..fbdab16 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 _0x08cb=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','include','rows','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2034ec,_0x4f3668){var _0x34f3d4=function(_0xb9af48){while(--_0xb9af48){_0x2034ec['push'](_0x2034ec['shift']());}};_0x34f3d4(++_0x4f3668);}(_0x08cb,0x163));var _0xb08c=function(_0x26c418,_0x3316a5){_0x26c418=_0x26c418-0x0;var _0x47b343=_0x08cb[_0x26c418];return _0x47b343;};'use strict';var emlformat=require(_0xb08c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb08c('0x1'));var jsonpatch=require(_0xb08c('0x2'));var rp=require(_0xb08c('0x3'));var moment=require('moment');var BPromise=require(_0xb08c('0x4'));var Mustache=require('mustache');var util=require(_0xb08c('0x5'));var path=require(_0xb08c('0x6'));var sox=require('sox');var csv=require(_0xb08c('0x7'));var ejs=require(_0xb08c('0x8'));var fs=require('fs');var fs_extra=require(_0xb08c('0x9'));var _=require(_0xb08c('0xa'));var squel=require(_0xb08c('0xb'));var crypto=require(_0xb08c('0xc'));var jsforce=require(_0xb08c('0xd'));var deskjs=require(_0xb08c('0xe'));var toCsv=require(_0xb08c('0x7'));var querystring=require(_0xb08c('0xf'));var Papa=require(_0xb08c('0x10'));var Redis=require('ioredis');var authService=require(_0xb08c('0x11'));var qs=require(_0xb08c('0x12'));var as=require(_0xb08c('0x13'));var hardwareService=require(_0xb08c('0x14'));var logger=require(_0xb08c('0x15'))(_0xb08c('0x16'));var utils=require('../../config/utils');var config=require(_0xb08c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb08c('0x18'))['db'];function respondWithStatusCode(_0x5de7c1,_0x1c426b){_0x1c426b=_0x1c426b||0xcc;return function(_0x40a195){if(_0x40a195){return _0x5de7c1[_0xb08c('0x19')](_0x1c426b);}return _0x5de7c1[_0xb08c('0x1a')](_0x1c426b)[_0xb08c('0x1b')]();};}function respondWithResult(_0x1d8b8f,_0x9c3d63){_0x9c3d63=_0x9c3d63||0xc8;return function(_0x56d1a1){if(_0x56d1a1){return _0x1d8b8f['status'](_0x9c3d63)[_0xb08c('0x1c')](_0x56d1a1);}};}function respondWithFilteredResult(_0x3a7113,_0x32fd35){return function(_0xaba361){if(_0xaba361){var _0x236760=typeof _0x32fd35[_0xb08c('0x1d')]===_0xb08c('0x1e')&&typeof _0x32fd35[_0xb08c('0x1f')]===_0xb08c('0x1e');var _0x455c7a=_0xaba361[_0xb08c('0x20')];var _0x18a5c7=_0x236760?0x0:_0x32fd35[_0xb08c('0x1d')];var _0x19d5a8=_0x236760?_0xaba361[_0xb08c('0x20')]:_0x32fd35[_0xb08c('0x1d')]+_0x32fd35[_0xb08c('0x1f')];var _0xd5c76;if(_0x19d5a8>=_0x455c7a){_0x19d5a8=_0x455c7a;_0xd5c76=0xc8;}else{_0xd5c76=0xce;}_0x3a7113['status'](_0xd5c76);return _0x3a7113[_0xb08c('0x21')](_0xb08c('0x22'),_0x18a5c7+'-'+_0x19d5a8+'/'+_0x455c7a)['json'](_0xaba361);}return null;};}function patchUpdates(_0x556626){return function(_0x53c545){try{jsonpatch[_0xb08c('0x23')](_0x53c545,_0x556626,!![]);}catch(_0x3e7684){return BPromise[_0xb08c('0x24')](_0x3e7684);}return _0x53c545[_0xb08c('0x25')]();};}function saveUpdates(_0x10218b,_0x17d7d2){return function(_0x45b0b9){if(_0x45b0b9){return _0x45b0b9[_0xb08c('0x26')](_0x10218b)[_0xb08c('0x27')](function(_0x1f0d5e){return _0x1f0d5e;});}return null;};}function removeEntity(_0xf494ef,_0xbd33cf){return function(_0x5b78f3){if(_0x5b78f3){return _0x5b78f3[_0xb08c('0x28')]()['then'](function(){_0xf494ef['status'](0xcc)[_0xb08c('0x1b')]();});}};}function handleEntityNotFound(_0x18db8d,_0x423c03){return function(_0x581b00){if(!_0x581b00){_0x18db8d[_0xb08c('0x19')](0x194);}return _0x581b00;};}function handleError(_0x36866d,_0x2da281){_0x2da281=_0x2da281||0x1f4;return function(_0x55c77c){logger[_0xb08c('0x29')](_0x55c77c[_0xb08c('0x2a')]);if(_0x55c77c[_0xb08c('0x2b')]){delete _0x55c77c[_0xb08c('0x2b')];}_0x36866d[_0xb08c('0x1a')](_0x2da281)[_0xb08c('0x2c')](_0x55c77c);};}exports[_0xb08c('0x2d')]=function(_0x20e6d4,_0x3d8c31){var _0x5b11af={},_0x5b64e6={},_0x4d5a8c={'count':0x0,'rows':[]};var _0x16921e=_[_0xb08c('0x2e')](db[_0xb08c('0x2f')][_0xb08c('0x30')],function(_0x5053f0){return{'name':_0x5053f0[_0xb08c('0x31')],'type':_0x5053f0[_0xb08c('0x32')][_0xb08c('0x33')]};});_0x5b64e6[_0xb08c('0x34')]=_[_0xb08c('0x2e')](_0x16921e,_0xb08c('0x2b'));_0x5b64e6[_0xb08c('0x35')]=_[_0xb08c('0x36')](_0x20e6d4[_0xb08c('0x35')]);_0x5b64e6[_0xb08c('0x37')]=_[_0xb08c('0x38')](_0x5b64e6[_0xb08c('0x34')],_0x5b64e6[_0xb08c('0x35')]);_0x5b11af[_0xb08c('0x39')]=_['intersection'](_0x5b64e6[_0xb08c('0x34')],qs[_0xb08c('0x3a')](_0x20e6d4[_0xb08c('0x35')][_0xb08c('0x3a')]));_0x5b11af[_0xb08c('0x39')]=_0x5b11af['attributes'][_0xb08c('0x3b')]?_0x5b11af[_0xb08c('0x39')]:_0x5b64e6[_0xb08c('0x34')];if(!_0x20e6d4[_0xb08c('0x35')][_0xb08c('0x3c')](_0xb08c('0x3d'))){_0x5b11af['limit']=qs[_0xb08c('0x1f')](_0x20e6d4['query'][_0xb08c('0x1f')]);_0x5b11af[_0xb08c('0x1d')]=qs['offset'](_0x20e6d4['query']['offset']);}_0x5b11af[_0xb08c('0x3e')]=qs['sort'](_0x20e6d4[_0xb08c('0x35')]['sort']);_0x5b11af['where']=qs['filters'](_[_0xb08c('0x3f')](_0x20e6d4['query'],_0x5b64e6[_0xb08c('0x37')]),_0x16921e);if(_0x20e6d4[_0xb08c('0x35')][_0xb08c('0x40')]){_0x5b11af['where']=_['merge'](_0x5b11af[_0xb08c('0x41')],{'$or':_['map'](_0x16921e,function(_0x4343e6){if(_0x4343e6['type']!=='VIRTUAL'){var _0x587dde={};_0x587dde[_0x4343e6['name']]={'$like':'%'+_0x20e6d4['query']['filter']+'%'};return _0x587dde;}})});}_0x5b11af=_[_0xb08c('0x42')]({},_0x5b11af,_0x20e6d4[_0xb08c('0x43')]);var _0x5a1935={'where':_0x5b11af[_0xb08c('0x41')]};return db[_0xb08c('0x2f')][_0xb08c('0x20')](_0x5a1935)[_0xb08c('0x27')](function(_0x430a6d){_0x4d5a8c['count']=_0x430a6d;if(_0x20e6d4[_0xb08c('0x35')]['includeAll']){_0x5b11af[_0xb08c('0x44')]=[{'all':!![]}];}return db[_0xb08c('0x2f')]['findAll'](_0x5b11af);})[_0xb08c('0x27')](function(_0x22d44f){_0x4d5a8c[_0xb08c('0x45')]=_0x22d44f;return _0x4d5a8c;})['then'](respondWithFilteredResult(_0x3d8c31,_0x5b11af))[_0xb08c('0x46')](handleError(_0x3d8c31,null));};exports['show']=function(_0x26f3be,_0x3b7dab){var _0x38ff76={'raw':!![],'where':{'id':_0x26f3be[_0xb08c('0x47')]['id']}},_0x15b3d6={};_0x15b3d6[_0xb08c('0x34')]=_[_0xb08c('0x36')](db['VtigerField'][_0xb08c('0x30')]);_0x15b3d6['query']=_[_0xb08c('0x36')](_0x26f3be['query']);_0x15b3d6['filters']=_[_0xb08c('0x38')](_0x15b3d6[_0xb08c('0x34')],_0x15b3d6[_0xb08c('0x35')]);_0x38ff76['attributes']=_[_0xb08c('0x38')](_0x15b3d6[_0xb08c('0x34')],qs[_0xb08c('0x3a')](_0x26f3be[_0xb08c('0x35')]['fields']));_0x38ff76[_0xb08c('0x39')]=_0x38ff76[_0xb08c('0x39')][_0xb08c('0x3b')]?_0x38ff76[_0xb08c('0x39')]:_0x15b3d6[_0xb08c('0x34')];if(_0x26f3be[_0xb08c('0x35')]['includeAll']){_0x38ff76[_0xb08c('0x44')]=[{'all':!![]}];}_0x38ff76=_[_0xb08c('0x42')]({},_0x38ff76,_0x26f3be[_0xb08c('0x43')]);return db[_0xb08c('0x2f')][_0xb08c('0x48')](_0x38ff76)[_0xb08c('0x27')](handleEntityNotFound(_0x3b7dab,null))['then'](respondWithResult(_0x3b7dab,null))[_0xb08c('0x46')](handleError(_0x3b7dab,null));};exports[_0xb08c('0x49')]=function(_0x4d428a,_0x18c42c){return db['VtigerField'][_0xb08c('0x49')](_0x4d428a[_0xb08c('0x4a')],{})['then'](respondWithResult(_0x18c42c,0xc9))[_0xb08c('0x46')](handleError(_0x18c42c,null));};exports[_0xb08c('0x26')]=function(_0x2eabe8,_0xffe310){if(_0x2eabe8[_0xb08c('0x4a')]['id']){delete _0x2eabe8[_0xb08c('0x4a')]['id'];}return db[_0xb08c('0x2f')][_0xb08c('0x48')]({'where':{'id':_0x2eabe8[_0xb08c('0x47')]['id']}})[_0xb08c('0x27')](handleEntityNotFound(_0xffe310,null))[_0xb08c('0x27')](saveUpdates(_0x2eabe8[_0xb08c('0x4a')],null))[_0xb08c('0x27')](respondWithResult(_0xffe310,null))[_0xb08c('0x46')](handleError(_0xffe310,null));};exports[_0xb08c('0x28')]=function(_0x194fec,_0x144edf){return db[_0xb08c('0x2f')][_0xb08c('0x48')]({'where':{'id':_0x194fec['params']['id']}})['then'](handleEntityNotFound(_0x144edf,null))[_0xb08c('0x27')](removeEntity(_0x144edf,null))['catch'](handleError(_0x144edf,null));}; \ No newline at end of file +var _0xdec6=['index','VtigerField','rawAttributes','type','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','params','keys','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdec6,0xa5));var _0x6dec=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xdec6[_0x17928f];return _0x500b63;};'use strict';var emlformat=require(_0x6dec('0x0'));var rimraf=require(_0x6dec('0x1'));var zipdir=require(_0x6dec('0x2'));var jsonpatch=require(_0x6dec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6dec('0x4'));var Mustache=require(_0x6dec('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6dec('0x6'));var ejs=require(_0x6dec('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6dec('0x8'));var jsforce=require(_0x6dec('0x9'));var deskjs=require(_0x6dec('0xa'));var toCsv=require(_0x6dec('0x6'));var querystring=require(_0x6dec('0xb'));var Papa=require(_0x6dec('0xc'));var Redis=require(_0x6dec('0xd'));var authService=require(_0x6dec('0xe'));var qs=require(_0x6dec('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6dec('0x10'));var logger=require(_0x6dec('0x11'))('api');var utils=require(_0x6dec('0x12'));var config=require(_0x6dec('0x13'));var licenseUtil=require(_0x6dec('0x14'));var db=require(_0x6dec('0x15'))['db'];function respondWithStatusCode(_0x35c1e5,_0x5f5b29){_0x5f5b29=_0x5f5b29||0xcc;return function(_0x2ac44b){if(_0x2ac44b){return _0x35c1e5[_0x6dec('0x16')](_0x5f5b29);}return _0x35c1e5[_0x6dec('0x17')](_0x5f5b29)[_0x6dec('0x18')]();};}function respondWithResult(_0x3c7b9,_0x2c6eb9){_0x2c6eb9=_0x2c6eb9||0xc8;return function(_0x4dfa54){if(_0x4dfa54){return _0x3c7b9[_0x6dec('0x17')](_0x2c6eb9)[_0x6dec('0x19')](_0x4dfa54);}};}function respondWithFilteredResult(_0x1116fd,_0x552bbd){return function(_0x41bb38){if(_0x41bb38){var _0x27b738=typeof _0x552bbd[_0x6dec('0x1a')]===_0x6dec('0x1b')&&typeof _0x552bbd[_0x6dec('0x1c')]===_0x6dec('0x1b');var _0x246302=_0x41bb38['count'];var _0x6322b=_0x27b738?0x0:_0x552bbd['offset'];var _0x420cec=_0x27b738?_0x41bb38[_0x6dec('0x1d')]:_0x552bbd[_0x6dec('0x1a')]+_0x552bbd['limit'];var _0x5947ef;if(_0x420cec>=_0x246302){_0x420cec=_0x246302;_0x5947ef=0xc8;}else{_0x5947ef=0xce;}_0x1116fd['status'](_0x5947ef);return _0x1116fd[_0x6dec('0x1e')](_0x6dec('0x1f'),_0x6322b+'-'+_0x420cec+'/'+_0x246302)[_0x6dec('0x19')](_0x41bb38);}return null;};}function patchUpdates(_0x2e1c86){return function(_0x25e078){try{jsonpatch[_0x6dec('0x20')](_0x25e078,_0x2e1c86,!![]);}catch(_0x387c89){return BPromise['reject'](_0x387c89);}return _0x25e078[_0x6dec('0x21')]();};}function saveUpdates(_0x56351a,_0x1fcc37){return function(_0x106880){if(_0x106880){return _0x106880[_0x6dec('0x22')](_0x56351a)[_0x6dec('0x23')](function(_0x5bf0c5){return _0x5bf0c5;});}return null;};}function removeEntity(_0x22026e,_0x4704a7){return function(_0x3a0bf0){if(_0x3a0bf0){return _0x3a0bf0['destroy']()['then'](function(){_0x22026e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29999d,_0x560770){return function(_0x46624d){if(!_0x46624d){_0x29999d[_0x6dec('0x16')](0x194);}return _0x46624d;};}function handleError(_0x57a0c7,_0x148018){_0x148018=_0x148018||0x1f4;return function(_0x52202f){logger['error'](_0x52202f[_0x6dec('0x24')]);if(_0x52202f['name']){delete _0x52202f[_0x6dec('0x25')];}_0x57a0c7[_0x6dec('0x17')](_0x148018)[_0x6dec('0x26')](_0x52202f);};}exports[_0x6dec('0x27')]=function(_0x108561,_0x13af47){var _0x40090d={},_0x49396c={},_0x2dd40f={'count':0x0,'rows':[]};var _0x197817=_['map'](db[_0x6dec('0x28')][_0x6dec('0x29')],function(_0xf65bb7){return{'name':_0xf65bb7['fieldName'],'type':_0xf65bb7[_0x6dec('0x2a')]['key']};});_0x49396c[_0x6dec('0x2b')]=_[_0x6dec('0x2c')](_0x197817,_0x6dec('0x25'));_0x49396c[_0x6dec('0x2d')]=_['keys'](_0x108561[_0x6dec('0x2d')]);_0x49396c[_0x6dec('0x2e')]=_['intersection'](_0x49396c[_0x6dec('0x2b')],_0x49396c[_0x6dec('0x2d')]);_0x40090d[_0x6dec('0x2f')]=_[_0x6dec('0x30')](_0x49396c[_0x6dec('0x2b')],qs[_0x6dec('0x31')](_0x108561[_0x6dec('0x2d')]['fields']));_0x40090d['attributes']=_0x40090d['attributes'][_0x6dec('0x32')]?_0x40090d[_0x6dec('0x2f')]:_0x49396c[_0x6dec('0x2b')];if(!_0x108561[_0x6dec('0x2d')]['hasOwnProperty'](_0x6dec('0x33'))){_0x40090d[_0x6dec('0x1c')]=qs[_0x6dec('0x1c')](_0x108561[_0x6dec('0x2d')][_0x6dec('0x1c')]);_0x40090d[_0x6dec('0x1a')]=qs[_0x6dec('0x1a')](_0x108561[_0x6dec('0x2d')]['offset']);}_0x40090d[_0x6dec('0x34')]=qs[_0x6dec('0x35')](_0x108561['query']['sort']);_0x40090d[_0x6dec('0x36')]=qs[_0x6dec('0x2e')](_[_0x6dec('0x37')](_0x108561[_0x6dec('0x2d')],_0x49396c['filters']),_0x197817);if(_0x108561[_0x6dec('0x2d')][_0x6dec('0x38')]){_0x40090d[_0x6dec('0x36')]=_[_0x6dec('0x39')](_0x40090d[_0x6dec('0x36')],{'$or':_[_0x6dec('0x2c')](_0x197817,function(_0x409cb2){if(_0x409cb2[_0x6dec('0x2a')]!==_0x6dec('0x3a')){var _0x37fbe9={};_0x37fbe9[_0x409cb2[_0x6dec('0x25')]]={'$like':'%'+_0x108561['query'][_0x6dec('0x38')]+'%'};return _0x37fbe9;}})});}_0x40090d=_[_0x6dec('0x39')]({},_0x40090d,_0x108561[_0x6dec('0x3b')]);var _0x350b78={'where':_0x40090d[_0x6dec('0x36')]};return db[_0x6dec('0x28')][_0x6dec('0x1d')](_0x350b78)[_0x6dec('0x23')](function(_0x128cc3){_0x2dd40f[_0x6dec('0x1d')]=_0x128cc3;if(_0x108561['query']['includeAll']){_0x40090d['include']=[{'all':!![]}];}return db[_0x6dec('0x28')][_0x6dec('0x3c')](_0x40090d);})[_0x6dec('0x23')](function(_0x5e5fca){_0x2dd40f['rows']=_0x5e5fca;return _0x2dd40f;})['then'](respondWithFilteredResult(_0x13af47,_0x40090d))[_0x6dec('0x3d')](handleError(_0x13af47,null));};exports['show']=function(_0x3e2119,_0x144063){var _0x2ab2c0={'raw':!![],'where':{'id':_0x3e2119[_0x6dec('0x3e')]['id']}},_0x261b52={};_0x261b52[_0x6dec('0x2b')]=_['keys'](db[_0x6dec('0x28')][_0x6dec('0x29')]);_0x261b52[_0x6dec('0x2d')]=_[_0x6dec('0x3f')](_0x3e2119[_0x6dec('0x2d')]);_0x261b52['filters']=_[_0x6dec('0x30')](_0x261b52[_0x6dec('0x2b')],_0x261b52[_0x6dec('0x2d')]);_0x2ab2c0[_0x6dec('0x2f')]=_[_0x6dec('0x30')](_0x261b52[_0x6dec('0x2b')],qs['fields'](_0x3e2119[_0x6dec('0x2d')]['fields']));_0x2ab2c0[_0x6dec('0x2f')]=_0x2ab2c0[_0x6dec('0x2f')][_0x6dec('0x32')]?_0x2ab2c0[_0x6dec('0x2f')]:_0x261b52[_0x6dec('0x2b')];if(_0x3e2119[_0x6dec('0x2d')]['includeAll']){_0x2ab2c0[_0x6dec('0x40')]=[{'all':!![]}];}_0x2ab2c0=_[_0x6dec('0x39')]({},_0x2ab2c0,_0x3e2119[_0x6dec('0x3b')]);return db[_0x6dec('0x28')]['find'](_0x2ab2c0)[_0x6dec('0x23')](handleEntityNotFound(_0x144063,null))[_0x6dec('0x23')](respondWithResult(_0x144063,null))[_0x6dec('0x3d')](handleError(_0x144063,null));};exports[_0x6dec('0x41')]=function(_0x47edf4,_0x3beb55){return db[_0x6dec('0x28')][_0x6dec('0x41')](_0x47edf4[_0x6dec('0x42')],{})[_0x6dec('0x23')](respondWithResult(_0x3beb55,0xc9))[_0x6dec('0x3d')](handleError(_0x3beb55,null));};exports['update']=function(_0x2265b5,_0x84918c){if(_0x2265b5[_0x6dec('0x42')]['id']){delete _0x2265b5[_0x6dec('0x42')]['id'];}return db[_0x6dec('0x28')][_0x6dec('0x43')]({'where':{'id':_0x2265b5[_0x6dec('0x3e')]['id']}})['then'](handleEntityNotFound(_0x84918c,null))['then'](saveUpdates(_0x2265b5[_0x6dec('0x42')],null))[_0x6dec('0x23')](respondWithResult(_0x84918c,null))['catch'](handleError(_0x84918c,null));};exports['destroy']=function(_0x1eff86,_0x41a67a){return db[_0x6dec('0x28')]['find']({'where':{'id':_0x1eff86[_0x6dec('0x3e')]['id']}})['then'](handleEntityNotFound(_0x41a67a,null))[_0x6dec('0x23')](removeEntity(_0x41a67a,null))[_0x6dec('0x3d')](handleError(_0x41a67a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 40845bf..33aa85f 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 _0xa026=['idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields'];(function(_0x4f7efe,_0x67e8bc){var _0x4cf904=function(_0x1c2a99){while(--_0x1c2a99){_0x4f7efe['push'](_0x4f7efe['shift']());}};_0x4cf904(++_0x67e8bc);}(_0xa026,0x192));var _0x6a02=function(_0x4ea17a,_0x4b9c83){_0x4ea17a=_0x4ea17a-0x0;var _0x58e65f=_0xa026[_0x4ea17a];return _0x58e65f;};'use strict';var _=require(_0x6a02('0x0'));var util=require(_0x6a02('0x1'));var logger=require(_0x6a02('0x2'))(_0x6a02('0x3'));var moment=require(_0x6a02('0x4'));var BPromise=require('bluebird');var rp=require(_0x6a02('0x5'));var fs=require('fs');var path=require(_0x6a02('0x6'));var rimraf=require(_0x6a02('0x7'));var config=require(_0x6a02('0x8'));var attributes=require(_0x6a02('0x9'));module[_0x6a02('0xa')]=function(_0x15f73a,_0x3fa380){return _0x15f73a[_0x6a02('0xb')](_0x6a02('0xc'),attributes,{'tableName':_0x6a02('0xd'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x6a02('0xe'),_0x6a02('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb5f=['util','../../config/logger','api','moment','path','../../config/environment','VtigerField','int_vtiger_fields','vtiger_unique_index','lodash'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0xdb5f,0x1f3));var _0xfdb5=function(_0x11fa2f,_0x3ad278){_0x11fa2f=_0x11fa2f-0x0;var _0x39ee07=_0xdb5f[_0x11fa2f];return _0x39ee07;};'use strict';var _=require(_0xfdb5('0x0'));var util=require(_0xfdb5('0x1'));var logger=require(_0xfdb5('0x2'))(_0xfdb5('0x3'));var moment=require(_0xfdb5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdb5('0x5'));var rimraf=require('rimraf');var config=require(_0xfdb5('0x6'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x154aaa,_0x35f891){return _0x154aaa['define'](_0xfdb5('0x7'),attributes,{'tableName':_0xfdb5('0x8'),'paranoid':![],'indexes':[{'name':_0xfdb5('0x9'),'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 7dcdf74..63c7523 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 _0x79e3=['message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5be46c,_0x372c84){var _0x2094bf=function(_0x5ef979){while(--_0x5ef979){_0x5be46c['push'](_0x5be46c['shift']());}};_0x2094bf(++_0x372c84);}(_0x79e3,0x77));var _0x379e=function(_0x318635,_0x6a698e){_0x318635=_0x318635-0x0;var _0x50dc96=_0x79e3[_0x318635];return _0x50dc96;};'use strict';var _=require(_0x379e('0x0'));var util=require(_0x379e('0x1'));var moment=require('moment');var BPromise=require(_0x379e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x379e('0x3'));var db=require(_0x379e('0x4'))['db'];var utils=require(_0x379e('0x5'));var logger=require(_0x379e('0x6'))(_0x379e('0x7'));var config=require('../../config/environment');var jayson=require(_0x379e('0x8'));var client=jayson[_0x379e('0x9')][_0x379e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aa72f,_0x567356,_0x394d39){return new BPromise(function(_0x336f0c,_0x5bd7b1){return client[_0x379e('0xb')](_0x4aa72f,_0x394d39)[_0x379e('0xc')](function(_0x2c922f){logger['info'](_0x379e('0xd'),_0x567356,'request\x20sent');logger[_0x379e('0xe')](_0x379e('0xf'),_0x567356,_0x379e('0x10'),JSON[_0x379e('0x11')](_0x2c922f));if(_0x2c922f[_0x379e('0x12')]){if(_0x2c922f[_0x379e('0x12')]['code']===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x567356,_0x2c922f[_0x379e('0x12')][_0x379e('0x13')]);return _0x5bd7b1(_0x2c922f[_0x379e('0x12')]['message']);}logger[_0x379e('0x12')]('VtigerField,\x20%s,\x20%s',_0x567356,_0x2c922f['error']['message']);return _0x336f0c(_0x2c922f[_0x379e('0x12')]['message']);}else{logger[_0x379e('0x14')](_0x379e('0xd'),_0x567356,_0x379e('0x10'));_0x336f0c(_0x2c922f[_0x379e('0x15')][_0x379e('0x13')]);}})[_0x379e('0x16')](function(_0x486b5d){logger['error'](_0x379e('0xd'),_0x567356,_0x486b5d);_0x5bd7b1(_0x486b5d);});});} \ No newline at end of file +var _0x2b9b=['http','request','then','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','info','result','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x292107,_0x3090bf){var _0x4b92ed=function(_0x221c55){while(--_0x221c55){_0x292107['push'](_0x292107['shift']());}};_0x4b92ed(++_0x3090bf);}(_0x2b9b,0xfc));var _0xb2b9=function(_0x3fa074,_0x268d33){_0x3fa074=_0x3fa074-0x0;var _0x530192=_0x2b9b[_0x3fa074];return _0x530192;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb2b9('0x0'));var BPromise=require(_0xb2b9('0x1'));var rs=require(_0xb2b9('0x2'));var fs=require('fs');var Redis=require(_0xb2b9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb2b9('0x4'))(_0xb2b9('0x5'));var config=require(_0xb2b9('0x6'));var jayson=require(_0xb2b9('0x7'));var client=jayson['client'][_0xb2b9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4139fb,_0x3e51a0,_0x2938ab){return new BPromise(function(_0xdcecf1,_0x4baf93){return client[_0xb2b9('0x9')](_0x4139fb,_0x2938ab)[_0xb2b9('0xa')](function(_0x9f50bf){logger['info']('VtigerField,\x20%s,\x20%s',_0x3e51a0,_0xb2b9('0xb'));logger['debug'](_0xb2b9('0xc'),_0x3e51a0,_0xb2b9('0xb'),JSON[_0xb2b9('0xd')](_0x9f50bf));if(_0x9f50bf[_0xb2b9('0xe')]){if(_0x9f50bf[_0xb2b9('0xe')][_0xb2b9('0xf')]===0x1f4){logger[_0xb2b9('0xe')](_0xb2b9('0x10'),_0x3e51a0,_0x9f50bf[_0xb2b9('0xe')][_0xb2b9('0x11')]);return _0x4baf93(_0x9f50bf[_0xb2b9('0xe')][_0xb2b9('0x11')]);}logger[_0xb2b9('0xe')](_0xb2b9('0x10'),_0x3e51a0,_0x9f50bf[_0xb2b9('0xe')]['message']);return _0xdcecf1(_0x9f50bf[_0xb2b9('0xe')][_0xb2b9('0x11')]);}else{logger[_0xb2b9('0x12')](_0xb2b9('0x10'),_0x3e51a0,'request\x20sent');_0xdcecf1(_0x9f50bf[_0xb2b9('0x13')][_0xb2b9('0x11')]);}})['catch'](function(_0x2af15e){logger[_0xb2b9('0xe')](_0xb2b9('0x10'),_0x3e51a0,_0x2af15e);_0x4baf93(_0x2af15e);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 8d435cd..73feef0 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 _0xeb56=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration'];(function(_0x5249bd,_0x1b2a2c){var _0x3c978f=function(_0x4c6165){while(--_0x4c6165){_0x5249bd['push'](_0x5249bd['shift']());}};_0x3c978f(++_0x1b2a2c);}(_0xeb56,0x194));var _0x6eb5=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0xeb56[_0x45ce08];return _0x23dff2;};'use strict';var multer=require('multer');var util=require(_0x6eb5('0x0'));var path=require(_0x6eb5('0x1'));var timeout=require(_0x6eb5('0x2'));var express=require(_0x6eb5('0x3'));var router=express['Router']();var fs_extra=require(_0x6eb5('0x4'));var auth=require(_0x6eb5('0x5'));var interaction=require(_0x6eb5('0x6'));var config=require('../../config/environment');var controller=require(_0x6eb5('0x7'));router[_0x6eb5('0x8')]('/',auth['isAuthenticated'](),controller[_0x6eb5('0x9')]);router[_0x6eb5('0x8')]('/:id',auth[_0x6eb5('0xa')](),controller['show']);router[_0x6eb5('0x8')](_0x6eb5('0xb'),auth[_0x6eb5('0xa')](),controller[_0x6eb5('0xc')]);router['get'](_0x6eb5('0xd'),auth[_0x6eb5('0xa')](),controller['getFields']);router[_0x6eb5('0xe')]('/',auth[_0x6eb5('0xa')](),controller['create']);router[_0x6eb5('0xe')](_0x6eb5('0xb'),auth[_0x6eb5('0xa')](),controller[_0x6eb5('0xf')]);router['put'](_0x6eb5('0x10'),auth[_0x6eb5('0xa')](),controller[_0x6eb5('0x11')]);router[_0x6eb5('0x12')]('/:id',auth[_0x6eb5('0xa')](),controller[_0x6eb5('0x13')]);module[_0x6eb5('0x14')]=router; \ No newline at end of file +var _0xb13e=['Router','../../components/auth/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','destroy','multer','util','path','connect-timeout','express'];(function(_0xa2c510,_0x43dc47){var _0x4dcfd3=function(_0x475791){while(--_0x475791){_0xa2c510['push'](_0xa2c510['shift']());}};_0x4dcfd3(++_0x43dc47);}(_0xb13e,0xa3));var _0xeb13=function(_0x5cb9d6,_0x3c7a06){_0x5cb9d6=_0x5cb9d6-0x0;var _0x12a90f=_0xb13e[_0x5cb9d6];return _0x12a90f;};'use strict';var multer=require(_0xeb13('0x0'));var util=require(_0xeb13('0x1'));var path=require(_0xeb13('0x2'));var timeout=require(_0xeb13('0x3'));var express=require(_0xeb13('0x4'));var router=express[_0xeb13('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeb13('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb13('0x7'));router[_0xeb13('0x8')]('/',auth[_0xeb13('0x9')](),controller[_0xeb13('0xa')]);router[_0xeb13('0x8')](_0xeb13('0xb'),auth[_0xeb13('0x9')](),controller[_0xeb13('0xc')]);router['get'](_0xeb13('0xd'),auth['isAuthenticated'](),controller[_0xeb13('0xe')]);router['get'](_0xeb13('0xf'),auth[_0xeb13('0x9')](),controller[_0xeb13('0x10')]);router[_0xeb13('0x11')]('/',auth[_0xeb13('0x9')](),controller[_0xeb13('0x12')]);router[_0xeb13('0x11')]('/:id/configurations',auth[_0xeb13('0x9')](),controller['addConfiguration']);router['put']('/:id',auth[_0xeb13('0x9')](),controller[_0xeb13('0x13')]);router['delete'](_0xeb13('0xb'),auth[_0xeb13('0x9')](),controller[_0xeb13('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 18a0029..2708003 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 _0x41ec=['integrationTab','exports','STRING','remoteUri','ENUM','password','token'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x41ec,0x143));var _0xc41e=function(_0x18c219,_0x2e8615){_0x18c219=_0x18c219-0x0;var _0x164f0e=_0x41ec[_0x18c219];return _0x164f0e;};'use strict';var Sequelize=require('sequelize');module[_0xc41e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc41e('0x1')]},'username':{'type':Sequelize[_0xc41e('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xc41e('0x1')]},'token':{'type':Sequelize[_0xc41e('0x1')]},'remoteUri':{'type':Sequelize[_0xc41e('0x1')],'unique':_0xc41e('0x2')},'authType':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x4'),_0xc41e('0x5')),'defaultValue':_0xc41e('0x4')},'serverUrl':{'type':Sequelize[_0xc41e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x6'),'newTab'),'defaultValue':_0xc41e('0x6')}}; \ No newline at end of file +var _0xfdbd=['username','ENUM','token','password','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x23c958,_0x188c34){var _0x1d9b73=function(_0x448da3){while(--_0x448da3){_0x23c958['push'](_0x23c958['shift']());}};_0x1d9b73(++_0x188c34);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0xfdbd[_0x323419];return _0x4c0be7;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'username':{'type':Sequelize[_0xdfdb('0x2')],'unique':_0xdfdb('0x3')},'password':{'type':Sequelize[_0xdfdb('0x2')]},'token':{'type':Sequelize[_0xdfdb('0x2')]},'remoteUri':{'type':Sequelize[_0xdfdb('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xdfdb('0x4')]('password',_0xdfdb('0x5')),'defaultValue':_0xdfdb('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xdfdb('0x7')),'defaultValue':_0xdfdb('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 74d8d0c..f3c708e 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 _0xa478=['ZendeskAccount','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','ZendeskField','password','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields','stringify','send','Wrong\x20credentials','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/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','index','map'];(function(_0x4a3459,_0x1a9b9b){var _0x422690=function(_0x3a23ee){while(--_0x3a23ee){_0x4a3459['push'](_0x4a3459['shift']());}};_0x422690(++_0x1a9b9b);}(_0xa478,0x136));var _0x8a47=function(_0x31688a,_0x588c7d){_0x31688a=_0x31688a-0x0;var _0xc7b088=_0xa478[_0x31688a];return _0xc7b088;};'use strict';var emlformat=require(_0x8a47('0x0'));var rimraf=require(_0x8a47('0x1'));var zipdir=require(_0x8a47('0x2'));var jsonpatch=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var moment=require(_0x8a47('0x5'));var BPromise=require(_0x8a47('0x6'));var Mustache=require(_0x8a47('0x7'));var util=require(_0x8a47('0x8'));var path=require(_0x8a47('0x9'));var sox=require(_0x8a47('0xa'));var csv=require(_0x8a47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a47('0xc'));var _=require(_0x8a47('0xd'));var squel=require(_0x8a47('0xe'));var crypto=require(_0x8a47('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8a47('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a47('0x11'));var Papa=require(_0x8a47('0x12'));var Redis=require(_0x8a47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8a47('0x14'));var as=require(_0x8a47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a47('0x16'))('api');var utils=require(_0x8a47('0x17'));var config=require(_0x8a47('0x18'));var licenseUtil=require(_0x8a47('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x59efc7,_0x36941a){_0x36941a=_0x36941a||0xcc;return function(_0x12539c){if(_0x12539c){return _0x59efc7['sendStatus'](_0x36941a);}return _0x59efc7[_0x8a47('0x1a')](_0x36941a)[_0x8a47('0x1b')]();};}function respondWithResult(_0x1a9a6f,_0x55985c){_0x55985c=_0x55985c||0xc8;return function(_0x1c23e3){if(_0x1c23e3){return _0x1a9a6f[_0x8a47('0x1a')](_0x55985c)[_0x8a47('0x1c')](_0x1c23e3);}};}function respondWithFilteredResult(_0x1c8488,_0x41bdaf){return function(_0x18f2be){if(_0x18f2be){var _0x26fd48=typeof _0x41bdaf[_0x8a47('0x1d')]===_0x8a47('0x1e')&&typeof _0x41bdaf['limit']===_0x8a47('0x1e');var _0x1d0b04=_0x18f2be[_0x8a47('0x1f')];var _0x5f5884=_0x26fd48?0x0:_0x41bdaf[_0x8a47('0x1d')];var _0x5c62eb=_0x26fd48?_0x18f2be['count']:_0x41bdaf[_0x8a47('0x1d')]+_0x41bdaf[_0x8a47('0x20')];var _0x158e0c;if(_0x5c62eb>=_0x1d0b04){_0x5c62eb=_0x1d0b04;_0x158e0c=0xc8;}else{_0x158e0c=0xce;}_0x1c8488[_0x8a47('0x1a')](_0x158e0c);return _0x1c8488[_0x8a47('0x21')](_0x8a47('0x22'),_0x5f5884+'-'+_0x5c62eb+'/'+_0x1d0b04)[_0x8a47('0x1c')](_0x18f2be);}return null;};}function patchUpdates(_0x1bbed6){return function(_0x2b88a7){try{jsonpatch[_0x8a47('0x23')](_0x2b88a7,_0x1bbed6,!![]);}catch(_0x54ce6a){return BPromise[_0x8a47('0x24')](_0x54ce6a);}return _0x2b88a7['save']();};}function saveUpdates(_0x289f28,_0x3d7993){return function(_0x36908d){if(_0x36908d){return _0x36908d[_0x8a47('0x25')](_0x289f28)['then'](function(_0x116b5e){return _0x116b5e;});}return null;};}function removeEntity(_0x5ae186,_0x50f6ba){return function(_0x4d71f4){if(_0x4d71f4){return _0x4d71f4['destroy']()[_0x8a47('0x26')](function(){_0x5ae186[_0x8a47('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bb0d4,_0xb4590d){return function(_0x42dae1){if(!_0x42dae1){_0x2bb0d4[_0x8a47('0x27')](0x194);}return _0x42dae1;};}function handleError(_0x44cf20,_0xd06be6){_0xd06be6=_0xd06be6||0x1f4;return function(_0x24a20b){logger['error'](_0x24a20b[_0x8a47('0x28')]);if(_0x24a20b['name']){delete _0x24a20b[_0x8a47('0x29')];}_0x44cf20[_0x8a47('0x1a')](_0xd06be6)['send'](_0x24a20b);};}exports[_0x8a47('0x2a')]=function(_0x526571,_0x4d5d32){var _0x12470a={},_0x9b51b8={},_0x1ddbcf={'count':0x0,'rows':[]};var _0x12f0b7=_[_0x8a47('0x2b')](db[_0x8a47('0x2c')]['rawAttributes'],function(_0x353576){return{'name':_0x353576['fieldName'],'type':_0x353576['type'][_0x8a47('0x2d')]};});_0x9b51b8[_0x8a47('0x2e')]=_[_0x8a47('0x2b')](_0x12f0b7,_0x8a47('0x29'));_0x9b51b8[_0x8a47('0x2f')]=_[_0x8a47('0x30')](_0x526571[_0x8a47('0x2f')]);_0x9b51b8[_0x8a47('0x31')]=_[_0x8a47('0x32')](_0x9b51b8[_0x8a47('0x2e')],_0x9b51b8['query']);_0x12470a[_0x8a47('0x33')]=_[_0x8a47('0x32')](_0x9b51b8[_0x8a47('0x2e')],qs['fields'](_0x526571[_0x8a47('0x2f')][_0x8a47('0x34')]));_0x12470a['attributes']=_0x12470a[_0x8a47('0x33')][_0x8a47('0x35')]?_0x12470a[_0x8a47('0x33')]:_0x9b51b8[_0x8a47('0x2e')];if(!_0x526571['query']['hasOwnProperty'](_0x8a47('0x36'))){_0x12470a[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x526571[_0x8a47('0x2f')][_0x8a47('0x20')]);_0x12470a[_0x8a47('0x1d')]=qs[_0x8a47('0x1d')](_0x526571['query']['offset']);}_0x12470a[_0x8a47('0x37')]=qs[_0x8a47('0x38')](_0x526571[_0x8a47('0x2f')][_0x8a47('0x38')]);_0x12470a[_0x8a47('0x39')]=qs[_0x8a47('0x31')](_[_0x8a47('0x3a')](_0x526571[_0x8a47('0x2f')],_0x9b51b8[_0x8a47('0x31')]),_0x12f0b7);if(_0x526571[_0x8a47('0x2f')][_0x8a47('0x3b')]){_0x12470a['where']=_[_0x8a47('0x3c')](_0x12470a['where'],{'$or':_['map'](_0x12f0b7,function(_0x544fe2){if(_0x544fe2['type']!=='VIRTUAL'){var _0x3edb2e={};_0x3edb2e[_0x544fe2[_0x8a47('0x29')]]={'$like':'%'+_0x526571[_0x8a47('0x2f')][_0x8a47('0x3b')]+'%'};return _0x3edb2e;}})});}_0x12470a=_[_0x8a47('0x3c')]({},_0x12470a,_0x526571[_0x8a47('0x3d')]);var _0x25c45b={'where':_0x12470a[_0x8a47('0x39')]};return db['ZendeskAccount']['count'](_0x25c45b)[_0x8a47('0x26')](function(_0x437b86){_0x1ddbcf[_0x8a47('0x1f')]=_0x437b86;if(_0x526571[_0x8a47('0x2f')]['includeAll']){_0x12470a[_0x8a47('0x3e')]=[{'all':!![]}];}return db[_0x8a47('0x2c')][_0x8a47('0x3f')](_0x12470a);})[_0x8a47('0x26')](function(_0x1ef057){_0x1ddbcf['rows']=_0x1ef057;return _0x1ddbcf;})[_0x8a47('0x26')](respondWithFilteredResult(_0x4d5d32,_0x12470a))[_0x8a47('0x40')](handleError(_0x4d5d32,null));};exports[_0x8a47('0x41')]=function(_0x5d23ed,_0x2b3874){var _0x2c70ea={'raw':![],'where':{'id':_0x5d23ed[_0x8a47('0x42')]['id']}},_0xf313ec={};_0xf313ec['model']=_[_0x8a47('0x30')](db[_0x8a47('0x2c')][_0x8a47('0x43')]);_0xf313ec[_0x8a47('0x2f')]=_[_0x8a47('0x30')](_0x5d23ed[_0x8a47('0x2f')]);_0xf313ec['filters']=_['intersection'](_0xf313ec[_0x8a47('0x2e')],_0xf313ec[_0x8a47('0x2f')]);_0x2c70ea[_0x8a47('0x33')]=_['intersection'](_0xf313ec[_0x8a47('0x2e')],qs[_0x8a47('0x34')](_0x5d23ed['query']['fields']));_0x2c70ea[_0x8a47('0x33')]=_0x2c70ea['attributes'][_0x8a47('0x35')]?_0x2c70ea[_0x8a47('0x33')]:_0xf313ec[_0x8a47('0x2e')];if(_0x5d23ed[_0x8a47('0x2f')][_0x8a47('0x44')]){_0x2c70ea[_0x8a47('0x3e')]=[{'all':!![]}];}_0x2c70ea=_['merge']({},_0x2c70ea,_0x5d23ed['options']);return db[_0x8a47('0x2c')][_0x8a47('0x45')](_0x2c70ea)[_0x8a47('0x26')](handleEntityNotFound(_0x2b3874,null))[_0x8a47('0x26')](respondWithResult(_0x2b3874,null))[_0x8a47('0x40')](handleError(_0x2b3874,null));};exports['create']=function(_0x4898d0,_0x17a755){return db['ZendeskAccount'][_0x8a47('0x46')](_0x4898d0[_0x8a47('0x47')],{})['then'](respondWithResult(_0x17a755,0xc9))[_0x8a47('0x40')](handleError(_0x17a755,null));};exports[_0x8a47('0x25')]=function(_0x14e22c,_0x108c7f){if(_0x14e22c[_0x8a47('0x47')]['id']){delete _0x14e22c[_0x8a47('0x47')]['id'];}return db[_0x8a47('0x2c')][_0x8a47('0x45')]({'where':{'id':_0x14e22c['params']['id']}})[_0x8a47('0x26')](handleEntityNotFound(_0x108c7f,null))[_0x8a47('0x26')](saveUpdates(_0x14e22c[_0x8a47('0x47')],null))[_0x8a47('0x26')](respondWithResult(_0x108c7f,null))['catch'](handleError(_0x108c7f,null));};exports[_0x8a47('0x48')]=function(_0xa428dd,_0x24e123){return db[_0x8a47('0x2c')][_0x8a47('0x45')]({'where':{'id':_0xa428dd[_0x8a47('0x42')]['id']}})['then'](handleEntityNotFound(_0x24e123,null))['then'](removeEntity(_0x24e123,null))[_0x8a47('0x40')](handleError(_0x24e123,null));};exports['getConfigurations']=function(_0x1da8b7,_0x175023,_0x5a1b29){var _0xb05ed1={};var _0x4bf9a8={};var _0x315111;var _0x5c5577;return db[_0x8a47('0x2c')]['findOne']({'where':{'id':_0x1da8b7[_0x8a47('0x42')]['id']}})[_0x8a47('0x26')](handleEntityNotFound(_0x175023,null))[_0x8a47('0x26')](function(_0x144ce6){if(_0x144ce6){_0x315111=_0x144ce6;_0x4bf9a8[_0x8a47('0x2e')]=_[_0x8a47('0x30')](db[_0x8a47('0x49')][_0x8a47('0x43')]);_0x4bf9a8[_0x8a47('0x2f')]=_[_0x8a47('0x30')](_0x1da8b7[_0x8a47('0x2f')]);_0x4bf9a8['filters']=_[_0x8a47('0x32')](_0x4bf9a8[_0x8a47('0x2e')],_0x4bf9a8['query']);_0xb05ed1[_0x8a47('0x33')]=_[_0x8a47('0x32')](_0x4bf9a8[_0x8a47('0x2e')],qs[_0x8a47('0x34')](_0x1da8b7[_0x8a47('0x2f')][_0x8a47('0x34')]));_0xb05ed1[_0x8a47('0x33')]=_0xb05ed1[_0x8a47('0x33')][_0x8a47('0x35')]?_0xb05ed1[_0x8a47('0x33')]:_0x4bf9a8[_0x8a47('0x2e')];_0xb05ed1[_0x8a47('0x37')]=qs['sort'](_0x1da8b7[_0x8a47('0x2f')][_0x8a47('0x38')]);_0xb05ed1[_0x8a47('0x39')]=qs[_0x8a47('0x31')](_[_0x8a47('0x3a')](_0x1da8b7[_0x8a47('0x2f')],_0x4bf9a8[_0x8a47('0x31')]));if(_0x1da8b7[_0x8a47('0x2f')][_0x8a47('0x3b')]){_0xb05ed1[_0x8a47('0x39')]=_[_0x8a47('0x3c')](_0xb05ed1[_0x8a47('0x39')],{'$or':_[_0x8a47('0x2b')](_0xb05ed1[_0x8a47('0x33')],function(_0x2edcaf){var _0x7664a8={};_0x7664a8[_0x2edcaf]={'$like':'%'+_0x1da8b7['query'][_0x8a47('0x3b')]+'%'};return _0x7664a8;})});}_0xb05ed1=_['merge']({},_0xb05ed1,_0x1da8b7[_0x8a47('0x3d')]);return _0x315111[_0x8a47('0x4a')](_0xb05ed1);}})[_0x8a47('0x26')](function(_0x21fdb5){if(_0x21fdb5){_0x5c5577=_0x21fdb5[_0x8a47('0x35')];if(!_0x1da8b7[_0x8a47('0x2f')]['hasOwnProperty'](_0x8a47('0x36'))){_0xb05ed1[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x1da8b7['query']['limit']);_0xb05ed1[_0x8a47('0x1d')]=qs[_0x8a47('0x1d')](_0x1da8b7['query'][_0x8a47('0x1d')]);}return _0x315111[_0x8a47('0x4a')](_0xb05ed1);}})[_0x8a47('0x26')](function(_0x17f20f){if(_0x17f20f){return _0x17f20f?{'count':_0x5c5577,'rows':_0x17f20f}:null;}})[_0x8a47('0x26')](respondWithResult(_0x175023,null))[_0x8a47('0x40')](handleError(_0x175023,null));};exports[_0x8a47('0x4b')]=function(_0x2932f1,_0x99848c,_0x1b834a){if(_0x2932f1[_0x8a47('0x47')]['id']){delete _0x2932f1[_0x8a47('0x47')]['id'];}return db[_0x8a47('0x2c')]['findOne']({'where':{'id':_0x2932f1[_0x8a47('0x42')]['id']}})[_0x8a47('0x26')](handleEntityNotFound(_0x99848c,null))[_0x8a47('0x26')](function(_0x13a002){if(_0x13a002){_0x2932f1[_0x8a47('0x47')][_0x8a47('0x4c')]=_0x13a002['id'];_0x2932f1['body'][_0x8a47('0x4d')]=integrations['getSubjects'](_0x2932f1['body'][_0x8a47('0x4e')],_0x2932f1[_0x8a47('0x47')][_0x8a47('0x4f')]);_0x2932f1[_0x8a47('0x47')][_0x8a47('0x50')]=integrations[_0x8a47('0x51')](_0x2932f1['body']['channel'],_0x2932f1[_0x8a47('0x47')]['type']);return db[_0x8a47('0x49')][_0x8a47('0x46')](_0x2932f1[_0x8a47('0x47')],{'include':[{'model':db[_0x8a47('0x52')],'as':_0x8a47('0x4d')},{'model':db[_0x8a47('0x52')],'as':_0x8a47('0x50')}]});}return null;})[_0x8a47('0x26')](respondWithResult(_0x99848c,null))['catch'](handleError(_0x99848c,null));};exports['getFields']=function(_0x435039,_0x131176,_0x2761bf){var _0x5d6ebc='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x435039[_0x8a47('0x42')]['id']},'attributes':['id','username',_0x8a47('0x53'),_0x8a47('0x54'),_0x8a47('0x55'),_0x8a47('0x56')]})['then'](handleEntityNotFound(_0x131176,null))[_0x8a47('0x26')](function(_0x55c590){if(_0x55c590){_0x5d6ebc=_0x55c590[_0x8a47('0x56')];var _0x430ee2=_0x5d6ebc[_0x8a47('0x57')](-0x1);if(_0x430ee2==='/'){_0x5d6ebc=_0x5d6ebc['substring'](0x0,_0x5d6ebc[_0x8a47('0x58')](_0x430ee2));}var _0x3f53ba={'method':'GET','uri':util[_0x8a47('0x59')](_0x8a47('0x5a'),_0x5d6ebc,_0x8a47('0x5b')),'json':!![]};switch(_0x55c590[_0x8a47('0x55')]){case _0x8a47('0x53'):_0x3f53ba[_0x8a47('0x5c')]={'Authorization':util[_0x8a47('0x59')](_0x8a47('0x5d'),new Buffer(util['format'](_0x8a47('0x5e'),_0x55c590[_0x8a47('0x5f')],_0x55c590['password']))[_0x8a47('0x60')](_0x8a47('0x61')))};break;case'token':_0x3f53ba[_0x8a47('0x5c')]={'Authorization':util[_0x8a47('0x59')](_0x8a47('0x5d'),new Buffer(util[_0x8a47('0x59')](_0x8a47('0x62'),_0x55c590['username'],_0x55c590['token']))[_0x8a47('0x60')](_0x8a47('0x61')))};break;default:throw new db[(_0x8a47('0x63'))][(_0x8a47('0x64'))](_0x8a47('0x65'));}return rp(_0x3f53ba);}})[_0x8a47('0x26')](function(_0x34bb61){if(_0x34bb61){var _0x4845fa=[_0x8a47('0x66'),_0x8a47('0x67'),_0x8a47('0x68'),'assignee'];_[_0x8a47('0x69')](_0x34bb61[_0x8a47('0x5b')],function(_0xa2ea5c){return _0x4845fa[_0x8a47('0x6a')](_0xa2ea5c[_0x8a47('0x4f')]);});return{'count':_0x34bb61[_0x8a47('0x5b')][_0x8a47('0x35')],'rows':_[_0x8a47('0x2b')](_0x34bb61['ticket_fields'],function(_0x509e91){return{'id':_0x509e91['id'],'name':_0x509e91[_0x8a47('0x6b')]>0x7?_0x509e91[_0x8a47('0x6c')]:_0x509e91[_0x8a47('0x4f')],'custom':_0x509e91['position']>0x7?!![]:![],'options':_0x509e91[_0x8a47('0x6d')]?_0x509e91[_0x8a47('0x6d')]:_0x509e91[_0x8a47('0x6e')]?_0x509e91[_0x8a47('0x6e')]:[]};})};}})[_0x8a47('0x26')](respondWithResult(_0x131176,null))[_0x8a47('0x40')](function(_0x18def4){var _0x2a2379=_0x435039[_0x8a47('0x2f')][_0x8a47('0x6f')]?0x1f4:_0x18def4[_0x8a47('0x70')]||0x1f4;logger[_0x8a47('0x71')]('getFields,\x20%s,\x20%s,\x20%s',_0x8a47('0x72'),_0x2a2379,JSON[_0x8a47('0x73')](_0x18def4));delete _0x18def4[_0x8a47('0x29')];if(_0x2a2379===0x191){_0x2a2379=0x190;}_0x131176[_0x8a47('0x1a')](_0x2a2379)[_0x8a47('0x74')](_0x435039[_0x8a47('0x2f')][_0x8a47('0x6f')]?{'message':_0x8a47('0x75'),'statusCode':_0x18def4[_0x8a47('0x70')]}:_0x18def4);});}; \ No newline at end of file +var _0x7334=['params','keys','rawAttributes','includeAll','options','find','create','body','destroy','ZendeskConfiguration','pick','getConfigurations','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','findOne','username','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','password','headers','toString','base64','ValidationError','subject','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','index','map','fieldName','model','name','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','ZendeskAccount','include','findAll','rows','catch','show'];(function(_0x42f24c,_0x302b62){var _0x3878aa=function(_0x253a40){while(--_0x253a40){_0x42f24c['push'](_0x42f24c['shift']());}};_0x3878aa(++_0x302b62);}(_0x7334,0x184));var _0x4733=function(_0x145925,_0xe1d002){_0x145925=_0x145925-0x0;var _0x4a07e0=_0x7334[_0x145925];return _0x4a07e0;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];var integrations=require(_0x4733('0x1a'));function respondWithStatusCode(_0x100ecd,_0x1c146c){_0x1c146c=_0x1c146c||0xcc;return function(_0x2c0f6b){if(_0x2c0f6b){return _0x100ecd['sendStatus'](_0x1c146c);}return _0x100ecd[_0x4733('0x1b')](_0x1c146c)['end']();};}function respondWithResult(_0x4327f3,_0x1a22e4){_0x1a22e4=_0x1a22e4||0xc8;return function(_0x2e5b1b){if(_0x2e5b1b){return _0x4327f3[_0x4733('0x1b')](_0x1a22e4)[_0x4733('0x1c')](_0x2e5b1b);}};}function respondWithFilteredResult(_0x167016,_0x12f111){return function(_0x9fff){if(_0x9fff){var _0x1920ce=typeof _0x12f111['offset']===_0x4733('0x1d')&&typeof _0x12f111[_0x4733('0x1e')]==='undefined';var _0x444824=_0x9fff[_0x4733('0x1f')];var _0x2aa223=_0x1920ce?0x0:_0x12f111[_0x4733('0x20')];var _0x579f67=_0x1920ce?_0x9fff['count']:_0x12f111[_0x4733('0x20')]+_0x12f111[_0x4733('0x1e')];var _0x50c585;if(_0x579f67>=_0x444824){_0x579f67=_0x444824;_0x50c585=0xc8;}else{_0x50c585=0xce;}_0x167016[_0x4733('0x1b')](_0x50c585);return _0x167016[_0x4733('0x21')](_0x4733('0x22'),_0x2aa223+'-'+_0x579f67+'/'+_0x444824)[_0x4733('0x1c')](_0x9fff);}return null;};}function patchUpdates(_0x493cd3){return function(_0x1232e5){try{jsonpatch[_0x4733('0x23')](_0x1232e5,_0x493cd3,!![]);}catch(_0x5d058d){return BPromise[_0x4733('0x24')](_0x5d058d);}return _0x1232e5[_0x4733('0x25')]();};}function saveUpdates(_0x478e34,_0x15a291){return function(_0x115ce4){if(_0x115ce4){return _0x115ce4[_0x4733('0x26')](_0x478e34)[_0x4733('0x27')](function(_0x3a2542){return _0x3a2542;});}return null;};}function removeEntity(_0x24db74,_0x180049){return function(_0x2bb78f){if(_0x2bb78f){return _0x2bb78f['destroy']()[_0x4733('0x27')](function(){_0x24db74[_0x4733('0x1b')](0xcc)[_0x4733('0x28')]();});}};}function handleEntityNotFound(_0x2cb247,_0x30ee9b){return function(_0x3bd683){if(!_0x3bd683){_0x2cb247[_0x4733('0x29')](0x194);}return _0x3bd683;};}function handleError(_0xc3ab0a,_0x13bc12){_0x13bc12=_0x13bc12||0x1f4;return function(_0x23fe6c){logger['error'](_0x23fe6c[_0x4733('0x2a')]);if(_0x23fe6c['name']){delete _0x23fe6c['name'];}_0xc3ab0a[_0x4733('0x1b')](_0x13bc12)['send'](_0x23fe6c);};}exports[_0x4733('0x2b')]=function(_0x479989,_0x4abc0d){var _0x517c73={},_0x2976b0={},_0x3bfe53={'count':0x0,'rows':[]};var _0x29621e=_[_0x4733('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x50f67e){return{'name':_0x50f67e[_0x4733('0x2d')],'type':_0x50f67e['type']['key']};});_0x2976b0[_0x4733('0x2e')]=_[_0x4733('0x2c')](_0x29621e,_0x4733('0x2f'));_0x2976b0['query']=_['keys'](_0x479989[_0x4733('0x30')]);_0x2976b0[_0x4733('0x31')]=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],_0x2976b0[_0x4733('0x30')]);_0x517c73['attributes']=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x479989[_0x4733('0x30')][_0x4733('0x33')]));_0x517c73['attributes']=_0x517c73['attributes'][_0x4733('0x34')]?_0x517c73[_0x4733('0x35')]:_0x2976b0[_0x4733('0x2e')];if(!_0x479989[_0x4733('0x30')][_0x4733('0x36')]('nolimit')){_0x517c73[_0x4733('0x1e')]=qs[_0x4733('0x1e')](_0x479989[_0x4733('0x30')]['limit']);_0x517c73[_0x4733('0x20')]=qs[_0x4733('0x20')](_0x479989[_0x4733('0x30')][_0x4733('0x20')]);}_0x517c73[_0x4733('0x37')]=qs[_0x4733('0x38')](_0x479989[_0x4733('0x30')][_0x4733('0x38')]);_0x517c73['where']=qs[_0x4733('0x31')](_['pick'](_0x479989[_0x4733('0x30')],_0x2976b0[_0x4733('0x31')]),_0x29621e);if(_0x479989[_0x4733('0x30')][_0x4733('0x39')]){_0x517c73[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x517c73[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x29621e,function(_0x592fc2){if(_0x592fc2[_0x4733('0x3c')]!==_0x4733('0x3d')){var _0x5e12c3={};_0x5e12c3[_0x592fc2[_0x4733('0x2f')]]={'$like':'%'+_0x479989[_0x4733('0x30')]['filter']+'%'};return _0x5e12c3;}})});}_0x517c73=_[_0x4733('0x3b')]({},_0x517c73,_0x479989['options']);var _0x43ac2d={'where':_0x517c73['where']};return db[_0x4733('0x3e')][_0x4733('0x1f')](_0x43ac2d)['then'](function(_0x515720){_0x3bfe53[_0x4733('0x1f')]=_0x515720;if(_0x479989[_0x4733('0x30')]['includeAll']){_0x517c73[_0x4733('0x3f')]=[{'all':!![]}];}return db[_0x4733('0x3e')][_0x4733('0x40')](_0x517c73);})[_0x4733('0x27')](function(_0x3ae58c){_0x3bfe53[_0x4733('0x41')]=_0x3ae58c;return _0x3bfe53;})[_0x4733('0x27')](respondWithFilteredResult(_0x4abc0d,_0x517c73))[_0x4733('0x42')](handleError(_0x4abc0d,null));};exports[_0x4733('0x43')]=function(_0x42e055,_0x444471){var _0x1d32df={'raw':![],'where':{'id':_0x42e055[_0x4733('0x44')]['id']}},_0x191c04={};_0x191c04[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x3e')][_0x4733('0x46')]);_0x191c04['query']=_[_0x4733('0x45')](_0x42e055[_0x4733('0x30')]);_0x191c04[_0x4733('0x31')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],_0x191c04[_0x4733('0x30')]);_0x1d32df[_0x4733('0x35')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x42e055[_0x4733('0x30')][_0x4733('0x33')]));_0x1d32df[_0x4733('0x35')]=_0x1d32df[_0x4733('0x35')]['length']?_0x1d32df['attributes']:_0x191c04[_0x4733('0x2e')];if(_0x42e055[_0x4733('0x30')][_0x4733('0x47')]){_0x1d32df[_0x4733('0x3f')]=[{'all':!![]}];}_0x1d32df=_[_0x4733('0x3b')]({},_0x1d32df,_0x42e055[_0x4733('0x48')]);return db[_0x4733('0x3e')][_0x4733('0x49')](_0x1d32df)[_0x4733('0x27')](handleEntityNotFound(_0x444471,null))[_0x4733('0x27')](respondWithResult(_0x444471,null))['catch'](handleError(_0x444471,null));};exports['create']=function(_0x51e201,_0x521ad3){return db[_0x4733('0x3e')][_0x4733('0x4a')](_0x51e201[_0x4733('0x4b')],{})[_0x4733('0x27')](respondWithResult(_0x521ad3,0xc9))[_0x4733('0x42')](handleError(_0x521ad3,null));};exports[_0x4733('0x26')]=function(_0x1c6abf,_0x2484f4){if(_0x1c6abf[_0x4733('0x4b')]['id']){delete _0x1c6abf[_0x4733('0x4b')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x1c6abf[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0x2484f4,null))[_0x4733('0x27')](saveUpdates(_0x1c6abf[_0x4733('0x4b')],null))[_0x4733('0x27')](respondWithResult(_0x2484f4,null))['catch'](handleError(_0x2484f4,null));};exports[_0x4733('0x4c')]=function(_0x45c9ad,_0x31ae69){return db[_0x4733('0x3e')][_0x4733('0x49')]({'where':{'id':_0x45c9ad[_0x4733('0x44')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x31ae69,null))[_0x4733('0x27')](removeEntity(_0x31ae69,null))[_0x4733('0x42')](handleError(_0x31ae69,null));};exports['getConfigurations']=function(_0x31fb69,_0xdb1561,_0x899344){var _0x491fa5={};var _0x2effd2={};var _0x130aee;var _0xafb3f8;return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x31fb69[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0xdb1561,null))[_0x4733('0x27')](function(_0x3b8165){if(_0x3b8165){_0x130aee=_0x3b8165;_0x2effd2[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x4d')]['rawAttributes']);_0x2effd2[_0x4733('0x30')]=_[_0x4733('0x45')](_0x31fb69['query']);_0x2effd2['filters']=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],_0x2effd2[_0x4733('0x30')]);_0x491fa5[_0x4733('0x35')]=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x31fb69[_0x4733('0x30')]['fields']));_0x491fa5['attributes']=_0x491fa5[_0x4733('0x35')]['length']?_0x491fa5[_0x4733('0x35')]:_0x2effd2[_0x4733('0x2e')];_0x491fa5[_0x4733('0x37')]=qs['sort'](_0x31fb69['query']['sort']);_0x491fa5[_0x4733('0x3a')]=qs[_0x4733('0x31')](_[_0x4733('0x4e')](_0x31fb69['query'],_0x2effd2[_0x4733('0x31')]));if(_0x31fb69[_0x4733('0x30')][_0x4733('0x39')]){_0x491fa5[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x491fa5[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x491fa5['attributes'],function(_0x1ed9eb){var _0x2b5eec={};_0x2b5eec[_0x1ed9eb]={'$like':'%'+_0x31fb69['query']['filter']+'%'};return _0x2b5eec;})});}_0x491fa5=_[_0x4733('0x3b')]({},_0x491fa5,_0x31fb69[_0x4733('0x48')]);return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x475dad){if(_0x475dad){_0xafb3f8=_0x475dad[_0x4733('0x34')];if(!_0x31fb69[_0x4733('0x30')][_0x4733('0x36')](_0x4733('0x50'))){_0x491fa5['limit']=qs[_0x4733('0x1e')](_0x31fb69[_0x4733('0x30')][_0x4733('0x1e')]);_0x491fa5['offset']=qs[_0x4733('0x20')](_0x31fb69['query'][_0x4733('0x20')]);}return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x3696d6){if(_0x3696d6){return _0x3696d6?{'count':_0xafb3f8,'rows':_0x3696d6}:null;}})[_0x4733('0x27')](respondWithResult(_0xdb1561,null))[_0x4733('0x42')](handleError(_0xdb1561,null));};exports['addConfiguration']=function(_0x137793,_0x574787,_0x15552d){if(_0x137793[_0x4733('0x4b')]['id']){delete _0x137793['body']['id'];}return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x137793['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x574787,null))[_0x4733('0x27')](function(_0x1a0ebf){if(_0x1a0ebf){_0x137793[_0x4733('0x4b')][_0x4733('0x51')]=_0x1a0ebf['id'];_0x137793[_0x4733('0x4b')][_0x4733('0x52')]=integrations[_0x4733('0x53')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793['body']['type']);_0x137793[_0x4733('0x4b')][_0x4733('0x54')]=integrations[_0x4733('0x55')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793[_0x4733('0x4b')][_0x4733('0x3c')]);return db[_0x4733('0x4d')]['create'](_0x137793[_0x4733('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x4733('0x52')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x4733('0x27')](respondWithResult(_0x574787,null))['catch'](handleError(_0x574787,null));};exports[_0x4733('0x56')]=function(_0x523498,_0x4e835b,_0x1a7baf){var _0x5c6083='';return db['ZendeskAccount'][_0x4733('0x57')]({'where':{'id':_0x523498[_0x4733('0x44')]['id']},'attributes':['id',_0x4733('0x58'),'password',_0x4733('0x59'),_0x4733('0x5a'),_0x4733('0x5b')]})[_0x4733('0x27')](handleEntityNotFound(_0x4e835b,null))[_0x4733('0x27')](function(_0x29f4e8){if(_0x29f4e8){_0x5c6083=_0x29f4e8['remoteUri'];var _0x3c9e3b=_0x5c6083[_0x4733('0x5c')](-0x1);if(_0x3c9e3b==='/'){_0x5c6083=_0x5c6083[_0x4733('0x5d')](0x0,_0x5c6083['lastIndexOf'](_0x3c9e3b));}var _0x2c0377={'method':_0x4733('0x5e'),'uri':util[_0x4733('0x5f')](_0x4733('0x60'),_0x5c6083,_0x4733('0x61')),'json':!![]};switch(_0x29f4e8[_0x4733('0x5a')]){case _0x4733('0x62'):_0x2c0377[_0x4733('0x63')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x62')]))[_0x4733('0x64')](_0x4733('0x65')))};break;case _0x4733('0x59'):_0x2c0377['headers']={'Authorization':util[_0x4733('0x5f')]('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s/token:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x59')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x4733('0x66'))]('Unknown\x20authentication\x20type');}return rp(_0x2c0377);}})[_0x4733('0x27')](function(_0x2fe1d3){if(_0x2fe1d3){var _0x59cc5b=[_0x4733('0x67'),'description','group',_0x4733('0x68')];_[_0x4733('0x69')](_0x2fe1d3[_0x4733('0x61')],function(_0x5a067b){return _0x59cc5b['includes'](_0x5a067b[_0x4733('0x3c')]);});return{'count':_0x2fe1d3['ticket_fields'][_0x4733('0x34')],'rows':_[_0x4733('0x2c')](_0x2fe1d3[_0x4733('0x61')],function(_0x42657b){return{'id':_0x42657b['id'],'name':_0x42657b[_0x4733('0x6a')]>0x7?_0x42657b[_0x4733('0x6b')]:_0x42657b['type'],'custom':_0x42657b[_0x4733('0x6a')]>0x7?!![]:![],'options':_0x42657b[_0x4733('0x6c')]?_0x42657b[_0x4733('0x6c')]:_0x42657b[_0x4733('0x6d')]?_0x42657b['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x4e835b,null))[_0x4733('0x42')](function(_0x4d87c1){var _0x131595=_0x523498[_0x4733('0x30')][_0x4733('0x6e')]?0x1f4:_0x4d87c1[_0x4733('0x6f')]||0x1f4;logger[_0x4733('0x70')](_0x4733('0x71'),_0x4733('0x56'),_0x131595,JSON['stringify'](_0x4d87c1));delete _0x4d87c1[_0x4733('0x2f')];if(_0x131595===0x191){_0x131595=0x190;}_0x4e835b[_0x4733('0x1b')](_0x131595)['send'](_0x523498['query'][_0x4733('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4d87c1[_0x4733('0x6f')]}:_0x4d87c1);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 4a8b8ef..2518633 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 _0x64b4=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','lodash'];(function(_0x393506,_0x299a61){var _0x48f568=function(_0x468b2b){while(--_0x468b2b){_0x393506['push'](_0x393506['shift']());}};_0x48f568(++_0x299a61);}(_0x64b4,0x1df));var _0x464b=function(_0x251fc4,_0x1d0194){_0x251fc4=_0x251fc4-0x0;var _0x59463c=_0x64b4[_0x251fc4];return _0x59463c;};'use strict';var _=require(_0x464b('0x0'));var util=require(_0x464b('0x1'));var logger=require(_0x464b('0x2'))(_0x464b('0x3'));var moment=require('moment');var BPromise=require(_0x464b('0x4'));var rp=require(_0x464b('0x5'));var fs=require('fs');var path=require(_0x464b('0x6'));var rimraf=require('rimraf');var config=require(_0x464b('0x7'));var attributes=require(_0x464b('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x464b('0x9')]=function(_0x15a6f7,_0x41aa41){return _0x15a6f7[_0x464b('0xa')](_0x464b('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x897e=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','util'];(function(_0x34a66e,_0x559c33){var _0x33b6dc=function(_0x68b865){while(--_0x68b865){_0x34a66e['push'](_0x34a66e['shift']());}};_0x33b6dc(++_0x559c33);}(_0x897e,0xb3));var _0xe897=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x897e[_0x1928c9];return _0x51b5fb;};'use strict';var _=require('lodash');var util=require(_0xe897('0x0'));var logger=require(_0xe897('0x1'))(_0xe897('0x2'));var moment=require(_0xe897('0x3'));var BPromise=require(_0xe897('0x4'));var rp=require(_0xe897('0x5'));var fs=require('fs');var path=require(_0xe897('0x6'));var rimraf=require('rimraf');var config=require(_0xe897('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xe897('0x8'));module[_0xe897('0x9')]=function(_0xf63c9d,_0x660b13){return _0xf63c9d['define'](_0xe897('0xa'),attributes,{'tableName':_0xe897('0xb'),'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 24fa80d..5f39ca1 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 _0xc337=['message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','GetZendeskAccount','debug','ShowZendeskAccount','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x24b6a4,_0x5ca958){var _0x10df84=function(_0x527a9d){while(--_0x527a9d){_0x24b6a4['push'](_0x24b6a4['shift']());}};_0x10df84(++_0x5ca958);}(_0xc337,0x150));var _0x7c33=function(_0x86d06c,_0x5e171c){_0x86d06c=_0x86d06c-0x0;var _0x113673=_0xc337[_0x86d06c];return _0x113673;};'use strict';var _=require(_0x7c33('0x0'));var util=require('util');var moment=require(_0x7c33('0x1'));var BPromise=require('bluebird');var rs=require(_0x7c33('0x2'));var fs=require('fs');var Redis=require(_0x7c33('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c33('0x4'))(_0x7c33('0x5'));var config=require(_0x7c33('0x6'));var jayson=require(_0x7c33('0x7'));var client=jayson[_0x7c33('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54646f,_0x1beb4c,_0x5163e0){return new BPromise(function(_0x30bf3e,_0x5c95bf){return client['request'](_0x54646f,_0x5163e0)[_0x7c33('0x9')](function(_0x66aded){logger[_0x7c33('0xa')](_0x7c33('0xb'),_0x1beb4c,_0x7c33('0xc'));logger['debug'](_0x7c33('0xd'),_0x1beb4c,'request\x20sent',JSON[_0x7c33('0xe')](_0x66aded));if(_0x66aded[_0x7c33('0xf')]){if(_0x66aded[_0x7c33('0xf')]['code']===0x1f4){logger['error'](_0x7c33('0xb'),_0x1beb4c,_0x66aded['error'][_0x7c33('0x10')]);return _0x5c95bf(_0x66aded[_0x7c33('0xf')]['message']);}logger['error'](_0x7c33('0xb'),_0x1beb4c,_0x66aded[_0x7c33('0xf')][_0x7c33('0x10')]);return _0x30bf3e(_0x66aded[_0x7c33('0xf')][_0x7c33('0x10')]);}else{logger[_0x7c33('0xa')](_0x7c33('0xb'),_0x1beb4c,_0x7c33('0xc'));_0x30bf3e(_0x66aded[_0x7c33('0x11')][_0x7c33('0x10')]);}})[_0x7c33('0x12')](function(_0x4c572d){logger[_0x7c33('0xf')](_0x7c33('0xb'),_0x1beb4c,_0x4c572d);_0x5c95bf(_0x4c572d);});});}exports['GetZendeskAccount']=function(_0x2b2137){var _0x4e17ad=this;return new Promise(function(_0x5f37fe,_0x555613){return db[_0x7c33('0x13')][_0x7c33('0x14')]({'raw':_0x2b2137['options']?_0x2b2137[_0x7c33('0x15')][_0x7c33('0x16')]===undefined?!![]:![]:!![],'where':_0x2b2137[_0x7c33('0x15')]?_0x2b2137['options'][_0x7c33('0x17')]||null:null,'attributes':_0x2b2137[_0x7c33('0x15')]?_0x2b2137[_0x7c33('0x15')][_0x7c33('0x18')]||null:null,'limit':_0x2b2137[_0x7c33('0x15')]?_0x2b2137['options'][_0x7c33('0x19')]||null:null,'include':_0x2b2137['options']?_0x2b2137[_0x7c33('0x15')]['include']?_[_0x7c33('0x1a')](_0x2b2137[_0x7c33('0x15')]['include'],function(_0x17c17f){return{'model':db[_0x17c17f[_0x7c33('0x1b')]],'as':_0x17c17f['as'],'attributes':_0x17c17f['attributes'],'include':_0x17c17f[_0x7c33('0x1c')]?_[_0x7c33('0x1a')](_0x17c17f[_0x7c33('0x1c')],function(_0x25a168){return{'model':db[_0x25a168[_0x7c33('0x1b')]],'as':_0x25a168['as'],'attributes':_0x25a168[_0x7c33('0x18')],'include':_0x25a168[_0x7c33('0x1c')]?_['map'](_0x25a168['include'],function(_0x8bd66e){return{'model':db[_0x8bd66e[_0x7c33('0x1b')]],'as':_0x8bd66e['as'],'attributes':_0x8bd66e[_0x7c33('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7c33('0x9')](function(_0x401670){logger[_0x7c33('0xa')](_0x7c33('0x1d'),_0x2b2137);logger[_0x7c33('0x1e')]('GetZendeskAccount',_0x2b2137,JSON[_0x7c33('0xe')](_0x401670));_0x5f37fe(_0x401670);})[_0x7c33('0x12')](function(_0x26bf6e){logger[_0x7c33('0xf')]('GetZendeskAccount',_0x26bf6e[_0x7c33('0x10')],_0x2b2137);_0x555613(_0x4e17ad[_0x7c33('0xf')](0x1f4,_0x26bf6e[_0x7c33('0x10')]));});});};exports[_0x7c33('0x1f')]=function(_0x33aa0c){var _0x44deaa=this;return new Promise(function(_0x550fd0,_0x47d495){return db[_0x7c33('0x13')]['find']({'raw':_0x33aa0c[_0x7c33('0x15')]?_0x33aa0c[_0x7c33('0x15')][_0x7c33('0x16')]===undefined?!![]:![]:!![],'where':_0x33aa0c[_0x7c33('0x15')]?_0x33aa0c[_0x7c33('0x15')][_0x7c33('0x17')]||null:null,'attributes':_0x33aa0c[_0x7c33('0x15')]?_0x33aa0c['options'][_0x7c33('0x18')]||null:null,'include':_0x33aa0c[_0x7c33('0x15')]?_0x33aa0c[_0x7c33('0x15')][_0x7c33('0x1c')]?_[_0x7c33('0x1a')](_0x33aa0c[_0x7c33('0x15')][_0x7c33('0x1c')],function(_0x326418){return{'model':db[_0x326418[_0x7c33('0x1b')]],'as':_0x326418['as'],'attributes':_0x326418[_0x7c33('0x18')],'include':_0x326418[_0x7c33('0x1c')]?_[_0x7c33('0x1a')](_0x326418[_0x7c33('0x1c')],function(_0x1d7a96){return{'model':db[_0x1d7a96['model']],'as':_0x1d7a96['as'],'attributes':_0x1d7a96[_0x7c33('0x18')],'include':_0x1d7a96[_0x7c33('0x1c')]?_[_0x7c33('0x1a')](_0x1d7a96[_0x7c33('0x1c')],function(_0x39b06a){return{'model':db[_0x39b06a[_0x7c33('0x1b')]],'as':_0x39b06a['as'],'attributes':_0x39b06a[_0x7c33('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7c33('0x9')](function(_0x52e135){logger[_0x7c33('0xa')](_0x7c33('0x1f'),_0x33aa0c);logger[_0x7c33('0x1e')](_0x7c33('0x1f'),_0x33aa0c,JSON['stringify'](_0x52e135));_0x550fd0(_0x52e135);})[_0x7c33('0x12')](function(_0x481505){logger[_0x7c33('0xf')](_0x7c33('0x1f'),_0x481505['message'],_0x33aa0c);_0x47d495(_0x44deaa['error'](0x1f4,_0x481505[_0x7c33('0x10')]));});});}; \ No newline at end of file +var _0xe963=['stringify','code','error','message','GetZendeskAccount','ZendeskAccount','options','raw','where','include','map','model','attributes','then','info','catch','ShowZendeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x41b8b9,_0x42585c){var _0x1120f5=function(_0x542879){while(--_0x542879){_0x41b8b9['push'](_0x41b8b9['shift']());}};_0x1120f5(++_0x42585c);}(_0xe963,0x99));var _0x3e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe963[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3e96('0x0'));var util=require(_0x3e96('0x1'));var moment=require('moment');var BPromise=require(_0x3e96('0x2'));var rs=require(_0x3e96('0x3'));var fs=require('fs');var Redis=require(_0x3e96('0x4'));var db=require(_0x3e96('0x5'))['db'];var utils=require(_0x3e96('0x6'));var logger=require(_0x3e96('0x7'))(_0x3e96('0x8'));var config=require(_0x3e96('0x9'));var jayson=require(_0x3e96('0xa'));var client=jayson[_0x3e96('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x83f314,_0x454573,_0x4a313e){return new BPromise(function(_0x4ab9d1,_0x58322b){return client[_0x3e96('0xc')](_0x83f314,_0x4a313e)['then'](function(_0x409e6c){logger['info'](_0x3e96('0xd'),_0x454573,_0x3e96('0xe'));logger[_0x3e96('0xf')](_0x3e96('0x10'),_0x454573,_0x3e96('0xe'),JSON[_0x3e96('0x11')](_0x409e6c));if(_0x409e6c['error']){if(_0x409e6c['error'][_0x3e96('0x12')]===0x1f4){logger[_0x3e96('0x13')](_0x3e96('0xd'),_0x454573,_0x409e6c[_0x3e96('0x13')][_0x3e96('0x14')]);return _0x58322b(_0x409e6c[_0x3e96('0x13')]['message']);}logger[_0x3e96('0x13')](_0x3e96('0xd'),_0x454573,_0x409e6c[_0x3e96('0x13')][_0x3e96('0x14')]);return _0x4ab9d1(_0x409e6c['error'][_0x3e96('0x14')]);}else{logger['info'](_0x3e96('0xd'),_0x454573,_0x3e96('0xe'));_0x4ab9d1(_0x409e6c['result'][_0x3e96('0x14')]);}})['catch'](function(_0x3e86f9){logger[_0x3e96('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x454573,_0x3e86f9);_0x58322b(_0x3e86f9);});});}exports[_0x3e96('0x15')]=function(_0x3e2167){var _0xef1571=this;return new Promise(function(_0x4ebe1a,_0x3a2e05){return db[_0x3e96('0x16')]['findAll']({'raw':_0x3e2167[_0x3e96('0x17')]?_0x3e2167[_0x3e96('0x17')][_0x3e96('0x18')]===undefined?!![]:![]:!![],'where':_0x3e2167['options']?_0x3e2167['options'][_0x3e96('0x19')]||null:null,'attributes':_0x3e2167[_0x3e96('0x17')]?_0x3e2167[_0x3e96('0x17')]['attributes']||null:null,'limit':_0x3e2167[_0x3e96('0x17')]?_0x3e2167[_0x3e96('0x17')]['limit']||null:null,'include':_0x3e2167[_0x3e96('0x17')]?_0x3e2167['options'][_0x3e96('0x1a')]?_[_0x3e96('0x1b')](_0x3e2167[_0x3e96('0x17')][_0x3e96('0x1a')],function(_0x37b375){return{'model':db[_0x37b375[_0x3e96('0x1c')]],'as':_0x37b375['as'],'attributes':_0x37b375[_0x3e96('0x1d')],'include':_0x37b375['include']?_[_0x3e96('0x1b')](_0x37b375[_0x3e96('0x1a')],function(_0x5de7e3){return{'model':db[_0x5de7e3['model']],'as':_0x5de7e3['as'],'attributes':_0x5de7e3[_0x3e96('0x1d')],'include':_0x5de7e3[_0x3e96('0x1a')]?_[_0x3e96('0x1b')](_0x5de7e3[_0x3e96('0x1a')],function(_0x80dcbe){return{'model':db[_0x80dcbe[_0x3e96('0x1c')]],'as':_0x80dcbe['as'],'attributes':_0x80dcbe[_0x3e96('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e96('0x1e')](function(_0x7cf888){logger[_0x3e96('0x1f')](_0x3e96('0x15'),_0x3e2167);logger[_0x3e96('0xf')]('GetZendeskAccount',_0x3e2167,JSON['stringify'](_0x7cf888));_0x4ebe1a(_0x7cf888);})[_0x3e96('0x20')](function(_0x1129ca){logger['error']('GetZendeskAccount',_0x1129ca[_0x3e96('0x14')],_0x3e2167);_0x3a2e05(_0xef1571[_0x3e96('0x13')](0x1f4,_0x1129ca['message']));});});};exports[_0x3e96('0x21')]=function(_0x38301d){var _0x3d2f90=this;return new Promise(function(_0x5d3ba1,_0x358e5a){return db['ZendeskAccount']['find']({'raw':_0x38301d['options']?_0x38301d[_0x3e96('0x17')][_0x3e96('0x18')]===undefined?!![]:![]:!![],'where':_0x38301d[_0x3e96('0x17')]?_0x38301d[_0x3e96('0x17')][_0x3e96('0x19')]||null:null,'attributes':_0x38301d[_0x3e96('0x17')]?_0x38301d[_0x3e96('0x17')][_0x3e96('0x1d')]||null:null,'include':_0x38301d[_0x3e96('0x17')]?_0x38301d[_0x3e96('0x17')]['include']?_[_0x3e96('0x1b')](_0x38301d[_0x3e96('0x17')][_0x3e96('0x1a')],function(_0x27c11d){return{'model':db[_0x27c11d[_0x3e96('0x1c')]],'as':_0x27c11d['as'],'attributes':_0x27c11d[_0x3e96('0x1d')],'include':_0x27c11d[_0x3e96('0x1a')]?_[_0x3e96('0x1b')](_0x27c11d[_0x3e96('0x1a')],function(_0xe969ca){return{'model':db[_0xe969ca[_0x3e96('0x1c')]],'as':_0xe969ca['as'],'attributes':_0xe969ca[_0x3e96('0x1d')],'include':_0xe969ca[_0x3e96('0x1a')]?_[_0x3e96('0x1b')](_0xe969ca[_0x3e96('0x1a')],function(_0x42f86c){return{'model':db[_0x42f86c[_0x3e96('0x1c')]],'as':_0x42f86c['as'],'attributes':_0x42f86c[_0x3e96('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e96('0x1e')](function(_0x954df5){logger['info'](_0x3e96('0x21'),_0x38301d);logger[_0x3e96('0xf')](_0x3e96('0x21'),_0x38301d,JSON[_0x3e96('0x11')](_0x954df5));_0x5d3ba1(_0x954df5);})[_0x3e96('0x20')](function(_0x5e6ff5){logger['error']('ShowZendeskAccount',_0x5e6ff5[_0x3e96('0x14')],_0x38301d);_0x358e5a(_0x3d2f90['error'](0x1f4,_0x5e6ff5['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index fde96fa..f0d12bb 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 _0x153f=['/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x49d2fb,_0x53872d){var _0x22855d=function(_0x20255d){while(--_0x20255d){_0x49d2fb['push'](_0x49d2fb['shift']());}};_0x22855d(++_0x53872d);}(_0x153f,0x15b));var _0xf153=function(_0x5961a0,_0x48592f){_0x5961a0=_0x5961a0-0x0;var _0x2cad76=_0x153f[_0x5961a0];return _0x2cad76;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0x9')](_0xf153('0xf'),auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router['get'](_0xf153('0x11'),auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router['get'](_0xf153('0x13'),auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);router[_0xf153('0x15')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x16')]);router[_0xf153('0x15')](_0xf153('0x13'),auth[_0xf153('0xa')](),controller['setTags']);router[_0xf153('0x17')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x19')]);router[_0xf153('0x1a')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xcb91[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 6af6977..02f4e38 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 _0x12d3=['STRING','sequelize','exports'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x12d3,0x142));var _0x312d=function(_0x436d89,_0x413c05){_0x436d89=_0x436d89-0x0;var _0x5c7774=_0x12d3[_0x436d89];return _0x5c7774;};'use strict';var Sequelize=require(_0x312d('0x0'));module[_0x312d('0x1')]={'name':{'type':Sequelize[_0x312d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc1b5=['sequelize','STRING'];(function(_0x1a9142,_0x5539e6){var _0x3f14f6=function(_0x399e79){while(--_0x399e79){_0x1a9142['push'](_0x1a9142['shift']());}};_0x3f14f6(++_0x5539e6);}(_0xc1b5,0x74));var _0x5c1b=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0xc1b5[_0x57486e];return _0x5f110b;};'use strict';var Sequelize=require(_0x5c1b('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c1b('0x1')]},'description':{'type':Sequelize[_0x5c1b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 9db0a16..288892f 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 _0x966f=['pick','where','merge','VIRTUAL','filter','options','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','ZendeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters'];(function(_0x32bce8,_0x54f965){var _0x38badc=function(_0x1ed1ee){while(--_0x1ed1ee){_0x32bce8['push'](_0x32bce8['shift']());}};_0x38badc(++_0x54f965);}(_0x966f,0x6d));var _0xf966=function(_0x8d8968,_0x32f873){_0x8d8968=_0x8d8968-0x0;var _0x1bd43b=_0x966f[_0x8d8968];return _0x1bd43b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf966('0x0'));var rp=require(_0xf966('0x1'));var moment=require(_0xf966('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf966('0x3'));var util=require(_0xf966('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xf966('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf966('0x6'));var _=require(_0xf966('0x7'));var squel=require('squel');var crypto=require(_0xf966('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xf966('0x9'));var toCsv=require('to-csv');var querystring=require(_0xf966('0xa'));var Papa=require(_0xf966('0xb'));var Redis=require(_0xf966('0xc'));var authService=require(_0xf966('0xd'));var qs=require(_0xf966('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf966('0xf'));var logger=require(_0xf966('0x10'))(_0xf966('0x11'));var utils=require(_0xf966('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf966('0x13'));var db=require(_0xf966('0x14'))['db'];function respondWithStatusCode(_0x34a2a5,_0x49834d){_0x49834d=_0x49834d||0xcc;return function(_0x5cb6d6){if(_0x5cb6d6){return _0x34a2a5['sendStatus'](_0x49834d);}return _0x34a2a5['status'](_0x49834d)['end']();};}function respondWithResult(_0x13267f,_0x5d01a3){_0x5d01a3=_0x5d01a3||0xc8;return function(_0x338af9){if(_0x338af9){return _0x13267f[_0xf966('0x15')](_0x5d01a3)['json'](_0x338af9);}};}function respondWithFilteredResult(_0x586109,_0x28566a){return function(_0x295bce){if(_0x295bce){var _0x4ab2b3=typeof _0x28566a[_0xf966('0x16')]===_0xf966('0x17')&&typeof _0x28566a[_0xf966('0x18')]===_0xf966('0x17');var _0x55b0d1=_0x295bce[_0xf966('0x19')];var _0x49f905=_0x4ab2b3?0x0:_0x28566a[_0xf966('0x16')];var _0x6cd4dc=_0x4ab2b3?_0x295bce[_0xf966('0x19')]:_0x28566a[_0xf966('0x16')]+_0x28566a[_0xf966('0x18')];var _0x30db6d;if(_0x6cd4dc>=_0x55b0d1){_0x6cd4dc=_0x55b0d1;_0x30db6d=0xc8;}else{_0x30db6d=0xce;}_0x586109[_0xf966('0x15')](_0x30db6d);return _0x586109['set'](_0xf966('0x1a'),_0x49f905+'-'+_0x6cd4dc+'/'+_0x55b0d1)[_0xf966('0x1b')](_0x295bce);}return null;};}function patchUpdates(_0x8a0d37){return function(_0x5bb329){try{jsonpatch[_0xf966('0x1c')](_0x5bb329,_0x8a0d37,!![]);}catch(_0x65c5df){return BPromise[_0xf966('0x1d')](_0x65c5df);}return _0x5bb329[_0xf966('0x1e')]();};}function saveUpdates(_0x54ad88,_0x1a109a){return function(_0x1f8449){if(_0x1f8449){return _0x1f8449[_0xf966('0x1f')](_0x54ad88)['then'](function(_0x470850){return _0x470850;});}return null;};}function removeEntity(_0x2b7a4b,_0x50e6ec){return function(_0x32e598){if(_0x32e598){return _0x32e598[_0xf966('0x20')]()['then'](function(){_0x2b7a4b[_0xf966('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20968e,_0x3e9e6a){return function(_0xf9f1fa){if(!_0xf9f1fa){_0x20968e[_0xf966('0x21')](0x194);}return _0xf9f1fa;};}function handleError(_0x432369,_0x6594ac){_0x6594ac=_0x6594ac||0x1f4;return function(_0x4e8c12){logger[_0xf966('0x22')](_0x4e8c12[_0xf966('0x23')]);if(_0x4e8c12['name']){delete _0x4e8c12[_0xf966('0x24')];}_0x432369[_0xf966('0x15')](_0x6594ac)[_0xf966('0x25')](_0x4e8c12);};}exports[_0xf966('0x26')]=function(_0x213ecf,_0x100586){var _0x4c8a46={},_0x5be111={},_0xdad0a0={'count':0x0,'rows':[]};var _0x536255=_[_0xf966('0x27')](db[_0xf966('0x28')][_0xf966('0x29')],function(_0x42fea5){return{'name':_0x42fea5[_0xf966('0x2a')],'type':_0x42fea5['type'][_0xf966('0x2b')]};});_0x5be111[_0xf966('0x2c')]=_[_0xf966('0x27')](_0x536255,'name');_0x5be111[_0xf966('0x2d')]=_[_0xf966('0x2e')](_0x213ecf[_0xf966('0x2d')]);_0x5be111['filters']=_['intersection'](_0x5be111[_0xf966('0x2c')],_0x5be111[_0xf966('0x2d')]);_0x4c8a46[_0xf966('0x2f')]=_[_0xf966('0x30')](_0x5be111[_0xf966('0x2c')],qs[_0xf966('0x31')](_0x213ecf['query'][_0xf966('0x31')]));_0x4c8a46[_0xf966('0x2f')]=_0x4c8a46['attributes'][_0xf966('0x32')]?_0x4c8a46[_0xf966('0x2f')]:_0x5be111['model'];if(!_0x213ecf[_0xf966('0x2d')][_0xf966('0x33')]('nolimit')){_0x4c8a46[_0xf966('0x18')]=qs[_0xf966('0x18')](_0x213ecf[_0xf966('0x2d')]['limit']);_0x4c8a46['offset']=qs[_0xf966('0x16')](_0x213ecf[_0xf966('0x2d')]['offset']);}_0x4c8a46[_0xf966('0x34')]=qs[_0xf966('0x35')](_0x213ecf[_0xf966('0x2d')][_0xf966('0x35')]);_0x4c8a46['where']=qs[_0xf966('0x36')](_[_0xf966('0x37')](_0x213ecf['query'],_0x5be111[_0xf966('0x36')]),_0x536255);if(_0x213ecf[_0xf966('0x2d')]['filter']){_0x4c8a46[_0xf966('0x38')]=_[_0xf966('0x39')](_0x4c8a46[_0xf966('0x38')],{'$or':_[_0xf966('0x27')](_0x536255,function(_0x3d5ca6){if(_0x3d5ca6['type']!==_0xf966('0x3a')){var _0x383dae={};_0x383dae[_0x3d5ca6[_0xf966('0x24')]]={'$like':'%'+_0x213ecf[_0xf966('0x2d')][_0xf966('0x3b')]+'%'};return _0x383dae;}})});}_0x4c8a46=_['merge']({},_0x4c8a46,_0x213ecf[_0xf966('0x3c')]);var _0x54c479={'where':_0x4c8a46['where']};return db[_0xf966('0x28')][_0xf966('0x19')](_0x54c479)[_0xf966('0x3d')](function(_0x515f4c){_0xdad0a0[_0xf966('0x19')]=_0x515f4c;if(_0x213ecf['query']['includeAll']){_0x4c8a46[_0xf966('0x3e')]=[{'all':!![]}];}return db[_0xf966('0x28')][_0xf966('0x3f')](_0x4c8a46);})[_0xf966('0x3d')](function(_0x216412){_0xdad0a0[_0xf966('0x40')]=_0x216412;return _0xdad0a0;})[_0xf966('0x3d')](respondWithFilteredResult(_0x100586,_0x4c8a46))[_0xf966('0x41')](handleError(_0x100586,null));};exports[_0xf966('0x42')]=function(_0x34b08a,_0x2a680b){var _0x311119={'raw':![],'where':{'id':_0x34b08a[_0xf966('0x43')]['id']}},_0x44cbaa={};_0x44cbaa[_0xf966('0x2c')]=_[_0xf966('0x2e')](db[_0xf966('0x28')]['rawAttributes']);_0x44cbaa[_0xf966('0x2d')]=_[_0xf966('0x2e')](_0x34b08a['query']);_0x44cbaa['filters']=_['intersection'](_0x44cbaa['model'],_0x44cbaa[_0xf966('0x2d')]);_0x311119[_0xf966('0x2f')]=_[_0xf966('0x30')](_0x44cbaa[_0xf966('0x2c')],qs[_0xf966('0x31')](_0x34b08a[_0xf966('0x2d')][_0xf966('0x31')]));_0x311119[_0xf966('0x2f')]=_0x311119[_0xf966('0x2f')]['length']?_0x311119[_0xf966('0x2f')]:_0x44cbaa[_0xf966('0x2c')];if(_0x34b08a['query'][_0xf966('0x44')]){_0x311119['include']=[{'all':!![]}];}_0x311119=_[_0xf966('0x39')]({},_0x311119,_0x34b08a[_0xf966('0x3c')]);return db[_0xf966('0x28')][_0xf966('0x45')](_0x311119)['then'](handleEntityNotFound(_0x2a680b,null))[_0xf966('0x3d')](respondWithResult(_0x2a680b,null))[_0xf966('0x41')](handleError(_0x2a680b,null));};exports['create']=function(_0x59969e,_0x5ae453){return db[_0xf966('0x28')][_0xf966('0x46')](_0x59969e[_0xf966('0x47')],{})[_0xf966('0x3d')](respondWithResult(_0x5ae453,0xc9))['catch'](handleError(_0x5ae453,null));};exports[_0xf966('0x1f')]=function(_0x3d075e,_0x1f2c52){if(_0x3d075e['body']['id']){delete _0x3d075e[_0xf966('0x47')]['id'];}return db[_0xf966('0x28')][_0xf966('0x45')]({'where':{'id':_0x3d075e[_0xf966('0x43')]['id']}})[_0xf966('0x3d')](handleEntityNotFound(_0x1f2c52,null))['then'](saveUpdates(_0x3d075e['body'],null))[_0xf966('0x3d')](respondWithResult(_0x1f2c52,null))[_0xf966('0x41')](handleError(_0x1f2c52,null));};exports['destroy']=function(_0x26f3ec,_0x22fb79){return db['ZendeskConfiguration']['find']({'where':{'id':_0x26f3ec[_0xf966('0x43')]['id']}})[_0xf966('0x3d')](handleEntityNotFound(_0x22fb79,null))['then'](removeEntity(_0x22fb79,null))[_0xf966('0x41')](handleError(_0x22fb79,null));};exports[_0xf966('0x48')]=function(_0x2ce9ee,_0x58d771,_0x12f820){var _0x4af362={};var _0x4fb52c={};var _0x2313eb;var _0x1a0428;return db[_0xf966('0x28')][_0xf966('0x49')]({'where':{'id':_0x2ce9ee[_0xf966('0x43')]['id']}})[_0xf966('0x3d')](handleEntityNotFound(_0x58d771,null))['then'](function(_0xb49654){if(_0xb49654){_0x2313eb=_0xb49654;_0x4fb52c[_0xf966('0x2c')]=_[_0xf966('0x2e')](db[_0xf966('0x4a')][_0xf966('0x29')]);_0x4fb52c[_0xf966('0x2d')]=_['keys'](_0x2ce9ee[_0xf966('0x2d')]);_0x4fb52c[_0xf966('0x36')]=_[_0xf966('0x30')](_0x4fb52c['model'],_0x4fb52c[_0xf966('0x2d')]);_0x4af362[_0xf966('0x2f')]=_[_0xf966('0x30')](_0x4fb52c[_0xf966('0x2c')],qs['fields'](_0x2ce9ee[_0xf966('0x2d')][_0xf966('0x31')]));_0x4af362[_0xf966('0x2f')]=_0x4af362[_0xf966('0x2f')]['length']?_0x4af362[_0xf966('0x2f')]:_0x4fb52c[_0xf966('0x2c')];_0x4af362[_0xf966('0x34')]=qs[_0xf966('0x35')](_0x2ce9ee[_0xf966('0x2d')][_0xf966('0x35')]);_0x4af362[_0xf966('0x38')]=qs['filters'](_[_0xf966('0x37')](_0x2ce9ee['query'],_0x4fb52c['filters']));if(_0x2ce9ee[_0xf966('0x2d')][_0xf966('0x3b')]){_0x4af362['where']=_[_0xf966('0x39')](_0x4af362['where'],{'$or':_[_0xf966('0x27')](_0x4af362[_0xf966('0x2f')],function(_0x2b2bc8){var _0x2ecf31={};_0x2ecf31[_0x2b2bc8]={'$like':'%'+_0x2ce9ee['query'][_0xf966('0x3b')]+'%'};return _0x2ecf31;})});}_0x4af362=_['merge']({},_0x4af362,_0x2ce9ee[_0xf966('0x3c')]);return _0x2313eb[_0xf966('0x48')](_0x4af362);}})[_0xf966('0x3d')](function(_0x3210de){if(_0x3210de){_0x1a0428=_0x3210de[_0xf966('0x32')];if(!_0x2ce9ee['query'][_0xf966('0x33')](_0xf966('0x4b'))){_0x4af362['limit']=qs['limit'](_0x2ce9ee[_0xf966('0x2d')]['limit']);_0x4af362[_0xf966('0x16')]=qs['offset'](_0x2ce9ee['query']['offset']);}return _0x2313eb[_0xf966('0x48')](_0x4af362);}})['then'](function(_0x4bcb8b){if(_0x4bcb8b){return _0x4bcb8b?{'count':_0x1a0428,'rows':_0x4bcb8b}:null;}})[_0xf966('0x3d')](respondWithResult(_0x58d771,null))[_0xf966('0x41')](handleError(_0x58d771,null));};exports[_0xf966('0x4c')]=function(_0x23c191,_0x525f7e,_0x16f84d){var _0x4eb59c={};var _0x2bd3f2={};var _0x950e4a;var _0x81ae6d;return db[_0xf966('0x28')][_0xf966('0x49')]({'where':{'id':_0x23c191[_0xf966('0x43')]['id']}})[_0xf966('0x3d')](handleEntityNotFound(_0x525f7e,null))[_0xf966('0x3d')](function(_0x921546){if(_0x921546){_0x950e4a=_0x921546;_0x2bd3f2[_0xf966('0x2c')]=_[_0xf966('0x2e')](db[_0xf966('0x4a')][_0xf966('0x29')]);_0x2bd3f2['query']=_[_0xf966('0x2e')](_0x23c191[_0xf966('0x2d')]);_0x2bd3f2['filters']=_[_0xf966('0x30')](_0x2bd3f2[_0xf966('0x2c')],_0x2bd3f2[_0xf966('0x2d')]);_0x4eb59c[_0xf966('0x2f')]=_[_0xf966('0x30')](_0x2bd3f2[_0xf966('0x2c')],qs[_0xf966('0x31')](_0x23c191['query'][_0xf966('0x31')]));_0x4eb59c[_0xf966('0x2f')]=_0x4eb59c[_0xf966('0x2f')][_0xf966('0x32')]?_0x4eb59c[_0xf966('0x2f')]:_0x2bd3f2[_0xf966('0x2c')];_0x4eb59c[_0xf966('0x34')]=qs[_0xf966('0x35')](_0x23c191[_0xf966('0x2d')][_0xf966('0x35')]);_0x4eb59c['where']=qs[_0xf966('0x36')](_['pick'](_0x23c191[_0xf966('0x2d')],_0x2bd3f2['filters']));if(_0x23c191[_0xf966('0x2d')][_0xf966('0x3b')]){_0x4eb59c[_0xf966('0x38')]=_[_0xf966('0x39')](_0x4eb59c[_0xf966('0x38')],{'$or':_[_0xf966('0x27')](_0x4eb59c['attributes'],function(_0x4187fd){var _0x5172b5={};_0x5172b5[_0x4187fd]={'$like':'%'+_0x23c191['query'][_0xf966('0x3b')]+'%'};return _0x5172b5;})});}_0x4eb59c=_[_0xf966('0x39')]({},_0x4eb59c,_0x23c191['options']);return _0x950e4a[_0xf966('0x4c')](_0x4eb59c);}})['then'](function(_0x11ee14){if(_0x11ee14){_0x81ae6d=_0x11ee14[_0xf966('0x32')];if(!_0x23c191['query'][_0xf966('0x33')]('nolimit')){_0x4eb59c[_0xf966('0x18')]=qs[_0xf966('0x18')](_0x23c191[_0xf966('0x2d')][_0xf966('0x18')]);_0x4eb59c['offset']=qs[_0xf966('0x16')](_0x23c191[_0xf966('0x2d')][_0xf966('0x16')]);}return _0x950e4a['getSubjects'](_0x4eb59c);}})['then'](function(_0x4cc4e6){if(_0x4cc4e6){return _0x4cc4e6?{'count':_0x81ae6d,'rows':_0x4cc4e6}:null;}})['then'](respondWithResult(_0x525f7e,null))[_0xf966('0x41')](handleError(_0x525f7e,null));};exports[_0xf966('0x4d')]=function(_0x16c732,_0x1869ee,_0xf02b20){var _0x380b4d={};var _0x3d5fa9={};var _0x3ede68;var _0x2fcd3a;return db[_0xf966('0x28')]['findOne']({'where':{'id':_0x16c732[_0xf966('0x43')]['id']}})[_0xf966('0x3d')](handleEntityNotFound(_0x1869ee,null))[_0xf966('0x3d')](function(_0xdf4247){if(_0xdf4247){_0x3ede68=_0xdf4247;_0x3d5fa9[_0xf966('0x2c')]=_[_0xf966('0x2e')](db[_0xf966('0x4a')][_0xf966('0x29')]);_0x3d5fa9[_0xf966('0x2d')]=_['keys'](_0x16c732['query']);_0x3d5fa9[_0xf966('0x36')]=_[_0xf966('0x30')](_0x3d5fa9[_0xf966('0x2c')],_0x3d5fa9[_0xf966('0x2d')]);_0x380b4d['attributes']=_['intersection'](_0x3d5fa9[_0xf966('0x2c')],qs['fields'](_0x16c732[_0xf966('0x2d')][_0xf966('0x31')]));_0x380b4d[_0xf966('0x2f')]=_0x380b4d['attributes'][_0xf966('0x32')]?_0x380b4d[_0xf966('0x2f')]:_0x3d5fa9[_0xf966('0x2c')];_0x380b4d[_0xf966('0x34')]=qs[_0xf966('0x35')](_0x16c732[_0xf966('0x2d')][_0xf966('0x35')]);_0x380b4d['where']=qs['filters'](_[_0xf966('0x37')](_0x16c732[_0xf966('0x2d')],_0x3d5fa9[_0xf966('0x36')]));if(_0x16c732[_0xf966('0x2d')][_0xf966('0x3b')]){_0x380b4d[_0xf966('0x38')]=_[_0xf966('0x39')](_0x380b4d['where'],{'$or':_[_0xf966('0x27')](_0x380b4d[_0xf966('0x2f')],function(_0x4d6451){var _0x3df4ad={};_0x3df4ad[_0x4d6451]={'$like':'%'+_0x16c732[_0xf966('0x2d')][_0xf966('0x3b')]+'%'};return _0x3df4ad;})});}_0x380b4d=_[_0xf966('0x39')]({},_0x380b4d,_0x16c732[_0xf966('0x3c')]);return _0x3ede68['getDescriptions'](_0x380b4d);}})['then'](function(_0x3dfc53){if(_0x3dfc53){_0x2fcd3a=_0x3dfc53[_0xf966('0x32')];if(!_0x16c732[_0xf966('0x2d')][_0xf966('0x33')]('nolimit')){_0x380b4d[_0xf966('0x18')]=qs[_0xf966('0x18')](_0x16c732[_0xf966('0x2d')]['limit']);_0x380b4d[_0xf966('0x16')]=qs[_0xf966('0x16')](_0x16c732[_0xf966('0x2d')][_0xf966('0x16')]);}return _0x3ede68[_0xf966('0x4d')](_0x380b4d);}})[_0xf966('0x3d')](function(_0x64a914){if(_0x64a914){return _0x64a914?{'count':_0x2fcd3a,'rows':_0x64a914}:null;}})[_0xf966('0x3d')](respondWithResult(_0x1869ee,null))[_0xf966('0x41')](handleError(_0x1869ee,null));};exports[_0xf966('0x4e')]=function(_0x3a2bed,_0x3fa90c,_0x2bfa67){var _0x4a78d8={};var _0x1ce0af={};var _0x46642e;var _0x4bfa2b;return db[_0xf966('0x28')][_0xf966('0x49')]({'where':{'id':_0x3a2bed[_0xf966('0x43')]['id']}})[_0xf966('0x3d')](handleEntityNotFound(_0x3fa90c,null))[_0xf966('0x3d')](function(_0x23caed){if(_0x23caed){_0x46642e=_0x23caed;_0x1ce0af[_0xf966('0x2c')]=_['keys'](db[_0xf966('0x4f')]['rawAttributes']);_0x1ce0af[_0xf966('0x2d')]=_[_0xf966('0x2e')](_0x3a2bed[_0xf966('0x2d')]);_0x1ce0af[_0xf966('0x36')]=_[_0xf966('0x30')](_0x1ce0af['model'],_0x1ce0af[_0xf966('0x2d')]);_0x4a78d8[_0xf966('0x2f')]=_[_0xf966('0x30')](_0x1ce0af['model'],qs[_0xf966('0x31')](_0x3a2bed[_0xf966('0x2d')]['fields']));_0x4a78d8[_0xf966('0x2f')]=_0x4a78d8[_0xf966('0x2f')][_0xf966('0x32')]?_0x4a78d8[_0xf966('0x2f')]:_0x1ce0af['model'];_0x4a78d8[_0xf966('0x34')]=qs[_0xf966('0x35')](_0x3a2bed['query'][_0xf966('0x35')]);_0x4a78d8[_0xf966('0x38')]=qs[_0xf966('0x36')](_[_0xf966('0x37')](_0x3a2bed[_0xf966('0x2d')],_0x1ce0af[_0xf966('0x36')]));if(_0x3a2bed['query'][_0xf966('0x3b')]){_0x4a78d8[_0xf966('0x38')]=_[_0xf966('0x39')](_0x4a78d8[_0xf966('0x38')],{'$or':_['map'](_0x4a78d8[_0xf966('0x2f')],function(_0x4ba0c0){var _0x349681={};_0x349681[_0x4ba0c0]={'$like':'%'+_0x3a2bed[_0xf966('0x2d')][_0xf966('0x3b')]+'%'};return _0x349681;})});}_0x4a78d8=_[_0xf966('0x39')]({},_0x4a78d8,_0x3a2bed[_0xf966('0x3c')]);return _0x46642e[_0xf966('0x4e')](_0x4a78d8);}})[_0xf966('0x3d')](function(_0x311297){if(_0x311297){_0x4bfa2b=_0x311297['length'];if(!_0x3a2bed['query'][_0xf966('0x33')](_0xf966('0x4b'))){_0x4a78d8['limit']=qs[_0xf966('0x18')](_0x3a2bed[_0xf966('0x2d')][_0xf966('0x18')]);_0x4a78d8[_0xf966('0x16')]=qs['offset'](_0x3a2bed['query'][_0xf966('0x16')]);}return _0x46642e[_0xf966('0x4e')](_0x4a78d8);}})[_0xf966('0x3d')](function(_0x108f31){if(_0x108f31){return _0x108f31?{'count':_0x4bfa2b,'rows':_0x108f31}:null;}})[_0xf966('0x3d')](respondWithResult(_0x3fa90c,null))[_0xf966('0x41')](handleError(_0x3fa90c,null));};exports[_0xf966('0x50')]=function(_0x311847,_0x5dc6df,_0x403061){if(_0x311847['body']['id']){delete _0x311847[_0xf966('0x47')]['id'];}return db['ZendeskConfiguration'][_0xf966('0x49')]({'where':{'id':_0x311847[_0xf966('0x43')]['id']}})[_0xf966('0x3d')](handleEntityNotFound(_0x5dc6df,null))[_0xf966('0x3d')](function(_0x1e7921){if(_0x1e7921){return _0x1e7921['setTags'](_0x311847[_0xf966('0x47')][_0xf966('0x51')]||[]);}return null;})['then'](respondWithResult(_0x5dc6df,null))[_0xf966('0x41')](handleError(_0x5dc6df,null));}; \ No newline at end of file +var _0x2c1a=['length','hasOwnProperty','nolimit','where','pick','filter','merge','includeAll','findAll','rows','catch','show','include','create','body','find','params','getFields','findOne','order','sort','options','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c1a,0x1d0));var _0xa2c1=function(_0x3ce33a,_0x19e1d0){_0x3ce33a=_0x3ce33a-0x0;var _0x5b61f3=_0x2c1a[_0x3ce33a];return _0x5b61f3;};'use strict';var emlformat=require(_0xa2c1('0x0'));var rimraf=require(_0xa2c1('0x1'));var zipdir=require(_0xa2c1('0x2'));var jsonpatch=require(_0xa2c1('0x3'));var rp=require(_0xa2c1('0x4'));var moment=require(_0xa2c1('0x5'));var BPromise=require(_0xa2c1('0x6'));var Mustache=require(_0xa2c1('0x7'));var util=require(_0xa2c1('0x8'));var path=require(_0xa2c1('0x9'));var sox=require('sox');var csv=require(_0xa2c1('0xa'));var ejs=require(_0xa2c1('0xb'));var fs=require('fs');var fs_extra=require(_0xa2c1('0xc'));var _=require(_0xa2c1('0xd'));var squel=require(_0xa2c1('0xe'));var crypto=require(_0xa2c1('0xf'));var jsforce=require(_0xa2c1('0x10'));var deskjs=require(_0xa2c1('0x11'));var toCsv=require(_0xa2c1('0xa'));var querystring=require(_0xa2c1('0x12'));var Papa=require(_0xa2c1('0x13'));var Redis=require('ioredis');var authService=require(_0xa2c1('0x14'));var qs=require(_0xa2c1('0x15'));var as=require(_0xa2c1('0x16'));var hardwareService=require(_0xa2c1('0x17'));var logger=require('../../config/logger')(_0xa2c1('0x18'));var utils=require(_0xa2c1('0x19'));var config=require(_0xa2c1('0x1a'));var licenseUtil=require(_0xa2c1('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5521dd,_0x318af7){_0x318af7=_0x318af7||0xcc;return function(_0x176c01){if(_0x176c01){return _0x5521dd['sendStatus'](_0x318af7);}return _0x5521dd[_0xa2c1('0x1c')](_0x318af7)[_0xa2c1('0x1d')]();};}function respondWithResult(_0x2608e4,_0x129881){_0x129881=_0x129881||0xc8;return function(_0x5a7fc7){if(_0x5a7fc7){return _0x2608e4[_0xa2c1('0x1c')](_0x129881)['json'](_0x5a7fc7);}};}function respondWithFilteredResult(_0x4d36de,_0xa61c6d){return function(_0x8ea028){if(_0x8ea028){var _0x496356=typeof _0xa61c6d['offset']===_0xa2c1('0x1e')&&typeof _0xa61c6d[_0xa2c1('0x1f')]===_0xa2c1('0x1e');var _0x2a420a=_0x8ea028[_0xa2c1('0x20')];var _0x156aea=_0x496356?0x0:_0xa61c6d['offset'];var _0x5e8485=_0x496356?_0x8ea028[_0xa2c1('0x20')]:_0xa61c6d[_0xa2c1('0x21')]+_0xa61c6d[_0xa2c1('0x1f')];var _0x2234b0;if(_0x5e8485>=_0x2a420a){_0x5e8485=_0x2a420a;_0x2234b0=0xc8;}else{_0x2234b0=0xce;}_0x4d36de[_0xa2c1('0x1c')](_0x2234b0);return _0x4d36de[_0xa2c1('0x22')]('Content-Range',_0x156aea+'-'+_0x5e8485+'/'+_0x2a420a)[_0xa2c1('0x23')](_0x8ea028);}return null;};}function patchUpdates(_0x195c2e){return function(_0x14f890){try{jsonpatch[_0xa2c1('0x24')](_0x14f890,_0x195c2e,!![]);}catch(_0xcf3893){return BPromise['reject'](_0xcf3893);}return _0x14f890[_0xa2c1('0x25')]();};}function saveUpdates(_0x23d40c,_0x463a8e){return function(_0x270a71){if(_0x270a71){return _0x270a71[_0xa2c1('0x26')](_0x23d40c)[_0xa2c1('0x27')](function(_0x1d5a1c){return _0x1d5a1c;});}return null;};}function removeEntity(_0x11b576,_0x14f0eb){return function(_0x4bff66){if(_0x4bff66){return _0x4bff66[_0xa2c1('0x28')]()[_0xa2c1('0x27')](function(){_0x11b576[_0xa2c1('0x1c')](0xcc)[_0xa2c1('0x1d')]();});}};}function handleEntityNotFound(_0x12f8da,_0x5eea74){return function(_0x4914df){if(!_0x4914df){_0x12f8da[_0xa2c1('0x29')](0x194);}return _0x4914df;};}function handleError(_0x252b4a,_0x2ba055){_0x2ba055=_0x2ba055||0x1f4;return function(_0x1e0554){logger[_0xa2c1('0x2a')](_0x1e0554[_0xa2c1('0x2b')]);if(_0x1e0554[_0xa2c1('0x2c')]){delete _0x1e0554[_0xa2c1('0x2c')];}_0x252b4a['status'](_0x2ba055)['send'](_0x1e0554);};}exports[_0xa2c1('0x2d')]=function(_0x3d4b36,_0x1f5834){var _0x47ec91={},_0x196ec8={},_0x14352f={'count':0x0,'rows':[]};var _0x2b2913=_[_0xa2c1('0x2e')](db[_0xa2c1('0x2f')][_0xa2c1('0x30')],function(_0x4d40ad){return{'name':_0x4d40ad[_0xa2c1('0x31')],'type':_0x4d40ad[_0xa2c1('0x32')]['key']};});_0x196ec8[_0xa2c1('0x33')]=_[_0xa2c1('0x2e')](_0x2b2913,_0xa2c1('0x2c'));_0x196ec8[_0xa2c1('0x34')]=_[_0xa2c1('0x35')](_0x3d4b36[_0xa2c1('0x34')]);_0x196ec8[_0xa2c1('0x36')]=_[_0xa2c1('0x37')](_0x196ec8['model'],_0x196ec8[_0xa2c1('0x34')]);_0x47ec91['attributes']=_[_0xa2c1('0x37')](_0x196ec8[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x3d4b36['query'][_0xa2c1('0x38')]));_0x47ec91[_0xa2c1('0x39')]=_0x47ec91[_0xa2c1('0x39')][_0xa2c1('0x3a')]?_0x47ec91[_0xa2c1('0x39')]:_0x196ec8[_0xa2c1('0x33')];if(!_0x3d4b36[_0xa2c1('0x34')][_0xa2c1('0x3b')](_0xa2c1('0x3c'))){_0x47ec91[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x3d4b36[_0xa2c1('0x34')]['limit']);_0x47ec91[_0xa2c1('0x21')]=qs[_0xa2c1('0x21')](_0x3d4b36[_0xa2c1('0x34')]['offset']);}_0x47ec91['order']=qs['sort'](_0x3d4b36[_0xa2c1('0x34')]['sort']);_0x47ec91[_0xa2c1('0x3d')]=qs['filters'](_[_0xa2c1('0x3e')](_0x3d4b36[_0xa2c1('0x34')],_0x196ec8[_0xa2c1('0x36')]),_0x2b2913);if(_0x3d4b36['query'][_0xa2c1('0x3f')]){_0x47ec91['where']=_['merge'](_0x47ec91[_0xa2c1('0x3d')],{'$or':_[_0xa2c1('0x2e')](_0x2b2913,function(_0x1954dd){if(_0x1954dd[_0xa2c1('0x32')]!=='VIRTUAL'){var _0x19f151={};_0x19f151[_0x1954dd[_0xa2c1('0x2c')]]={'$like':'%'+_0x3d4b36[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x19f151;}})});}_0x47ec91=_[_0xa2c1('0x40')]({},_0x47ec91,_0x3d4b36['options']);var _0x290ca2={'where':_0x47ec91[_0xa2c1('0x3d')]};return db[_0xa2c1('0x2f')][_0xa2c1('0x20')](_0x290ca2)[_0xa2c1('0x27')](function(_0xd59fcd){_0x14352f[_0xa2c1('0x20')]=_0xd59fcd;if(_0x3d4b36['query'][_0xa2c1('0x41')]){_0x47ec91['include']=[{'all':!![]}];}return db[_0xa2c1('0x2f')][_0xa2c1('0x42')](_0x47ec91);})[_0xa2c1('0x27')](function(_0x4c348a){_0x14352f[_0xa2c1('0x43')]=_0x4c348a;return _0x14352f;})[_0xa2c1('0x27')](respondWithFilteredResult(_0x1f5834,_0x47ec91))[_0xa2c1('0x44')](handleError(_0x1f5834,null));};exports[_0xa2c1('0x45')]=function(_0x4ebbe8,_0x1522e3){var _0x183509={'raw':![],'where':{'id':_0x4ebbe8['params']['id']}},_0x2c4aad={};_0x2c4aad[_0xa2c1('0x33')]=_[_0xa2c1('0x35')](db[_0xa2c1('0x2f')]['rawAttributes']);_0x2c4aad['query']=_['keys'](_0x4ebbe8[_0xa2c1('0x34')]);_0x2c4aad['filters']=_[_0xa2c1('0x37')](_0x2c4aad['model'],_0x2c4aad[_0xa2c1('0x34')]);_0x183509[_0xa2c1('0x39')]=_[_0xa2c1('0x37')](_0x2c4aad['model'],qs[_0xa2c1('0x38')](_0x4ebbe8[_0xa2c1('0x34')][_0xa2c1('0x38')]));_0x183509[_0xa2c1('0x39')]=_0x183509[_0xa2c1('0x39')][_0xa2c1('0x3a')]?_0x183509['attributes']:_0x2c4aad[_0xa2c1('0x33')];if(_0x4ebbe8[_0xa2c1('0x34')][_0xa2c1('0x41')]){_0x183509[_0xa2c1('0x46')]=[{'all':!![]}];}_0x183509=_[_0xa2c1('0x40')]({},_0x183509,_0x4ebbe8['options']);return db['ZendeskConfiguration']['find'](_0x183509)['then'](handleEntityNotFound(_0x1522e3,null))[_0xa2c1('0x27')](respondWithResult(_0x1522e3,null))['catch'](handleError(_0x1522e3,null));};exports[_0xa2c1('0x47')]=function(_0x37d123,_0x2f9e0f){return db[_0xa2c1('0x2f')][_0xa2c1('0x47')](_0x37d123[_0xa2c1('0x48')],{})[_0xa2c1('0x27')](respondWithResult(_0x2f9e0f,0xc9))['catch'](handleError(_0x2f9e0f,null));};exports['update']=function(_0x4b5797,_0x1e96a2){if(_0x4b5797[_0xa2c1('0x48')]['id']){delete _0x4b5797['body']['id'];}return db[_0xa2c1('0x2f')][_0xa2c1('0x49')]({'where':{'id':_0x4b5797[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x1e96a2,null))[_0xa2c1('0x27')](saveUpdates(_0x4b5797[_0xa2c1('0x48')],null))['then'](respondWithResult(_0x1e96a2,null))['catch'](handleError(_0x1e96a2,null));};exports[_0xa2c1('0x28')]=function(_0x48c440,_0x469067){return db[_0xa2c1('0x2f')][_0xa2c1('0x49')]({'where':{'id':_0x48c440[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x469067,null))[_0xa2c1('0x27')](removeEntity(_0x469067,null))['catch'](handleError(_0x469067,null));};exports[_0xa2c1('0x4b')]=function(_0x49aaa5,_0x12eba8,_0x524cc9){var _0x13b043={};var _0x185521={};var _0x546773;var _0x4f2e1f;return db['ZendeskConfiguration'][_0xa2c1('0x4c')]({'where':{'id':_0x49aaa5[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x12eba8,null))[_0xa2c1('0x27')](function(_0x136bd6){if(_0x136bd6){_0x546773=_0x136bd6;_0x185521[_0xa2c1('0x33')]=_[_0xa2c1('0x35')](db['ZendeskField'][_0xa2c1('0x30')]);_0x185521[_0xa2c1('0x34')]=_[_0xa2c1('0x35')](_0x49aaa5[_0xa2c1('0x34')]);_0x185521[_0xa2c1('0x36')]=_[_0xa2c1('0x37')](_0x185521['model'],_0x185521[_0xa2c1('0x34')]);_0x13b043[_0xa2c1('0x39')]=_[_0xa2c1('0x37')](_0x185521[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x49aaa5['query'][_0xa2c1('0x38')]));_0x13b043[_0xa2c1('0x39')]=_0x13b043[_0xa2c1('0x39')]['length']?_0x13b043[_0xa2c1('0x39')]:_0x185521['model'];_0x13b043[_0xa2c1('0x4d')]=qs['sort'](_0x49aaa5[_0xa2c1('0x34')][_0xa2c1('0x4e')]);_0x13b043['where']=qs[_0xa2c1('0x36')](_[_0xa2c1('0x3e')](_0x49aaa5['query'],_0x185521[_0xa2c1('0x36')]));if(_0x49aaa5['query'][_0xa2c1('0x3f')]){_0x13b043[_0xa2c1('0x3d')]=_[_0xa2c1('0x40')](_0x13b043[_0xa2c1('0x3d')],{'$or':_['map'](_0x13b043[_0xa2c1('0x39')],function(_0x4b79ec){var _0x502cb4={};_0x502cb4[_0x4b79ec]={'$like':'%'+_0x49aaa5[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x502cb4;})});}_0x13b043=_[_0xa2c1('0x40')]({},_0x13b043,_0x49aaa5[_0xa2c1('0x4f')]);return _0x546773['getFields'](_0x13b043);}})[_0xa2c1('0x27')](function(_0x5a83f4){if(_0x5a83f4){_0x4f2e1f=_0x5a83f4['length'];if(!_0x49aaa5[_0xa2c1('0x34')]['hasOwnProperty'](_0xa2c1('0x3c'))){_0x13b043[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x49aaa5[_0xa2c1('0x34')]['limit']);_0x13b043[_0xa2c1('0x21')]=qs[_0xa2c1('0x21')](_0x49aaa5['query'][_0xa2c1('0x21')]);}return _0x546773[_0xa2c1('0x4b')](_0x13b043);}})[_0xa2c1('0x27')](function(_0x302d1b){if(_0x302d1b){return _0x302d1b?{'count':_0x4f2e1f,'rows':_0x302d1b}:null;}})[_0xa2c1('0x27')](respondWithResult(_0x12eba8,null))[_0xa2c1('0x44')](handleError(_0x12eba8,null));};exports[_0xa2c1('0x50')]=function(_0x52cb4d,_0x5d0801,_0x2d3987){var _0x4ac745={};var _0x32b4c5={};var _0x4173d1;var _0x131303;return db['ZendeskConfiguration'][_0xa2c1('0x4c')]({'where':{'id':_0x52cb4d[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x5d0801,null))[_0xa2c1('0x27')](function(_0x23b28a){if(_0x23b28a){_0x4173d1=_0x23b28a;_0x32b4c5[_0xa2c1('0x33')]=_['keys'](db[_0xa2c1('0x51')][_0xa2c1('0x30')]);_0x32b4c5[_0xa2c1('0x34')]=_[_0xa2c1('0x35')](_0x52cb4d[_0xa2c1('0x34')]);_0x32b4c5[_0xa2c1('0x36')]=_[_0xa2c1('0x37')](_0x32b4c5[_0xa2c1('0x33')],_0x32b4c5['query']);_0x4ac745['attributes']=_['intersection'](_0x32b4c5[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x38')]));_0x4ac745['attributes']=_0x4ac745['attributes'][_0xa2c1('0x3a')]?_0x4ac745[_0xa2c1('0x39')]:_0x32b4c5[_0xa2c1('0x33')];_0x4ac745['order']=qs[_0xa2c1('0x4e')](_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x4e')]);_0x4ac745[_0xa2c1('0x3d')]=qs['filters'](_[_0xa2c1('0x3e')](_0x52cb4d['query'],_0x32b4c5[_0xa2c1('0x36')]));if(_0x52cb4d['query'][_0xa2c1('0x3f')]){_0x4ac745[_0xa2c1('0x3d')]=_['merge'](_0x4ac745[_0xa2c1('0x3d')],{'$or':_[_0xa2c1('0x2e')](_0x4ac745['attributes'],function(_0x6fd548){var _0x3b1fa9={};_0x3b1fa9[_0x6fd548]={'$like':'%'+_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x3b1fa9;})});}_0x4ac745=_[_0xa2c1('0x40')]({},_0x4ac745,_0x52cb4d[_0xa2c1('0x4f')]);return _0x4173d1['getSubjects'](_0x4ac745);}})[_0xa2c1('0x27')](function(_0x3e281d){if(_0x3e281d){_0x131303=_0x3e281d['length'];if(!_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x3b')](_0xa2c1('0x3c'))){_0x4ac745[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x1f')]);_0x4ac745[_0xa2c1('0x21')]=qs['offset'](_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x21')]);}return _0x4173d1['getSubjects'](_0x4ac745);}})[_0xa2c1('0x27')](function(_0x2bab42){if(_0x2bab42){return _0x2bab42?{'count':_0x131303,'rows':_0x2bab42}:null;}})['then'](respondWithResult(_0x5d0801,null))[_0xa2c1('0x44')](handleError(_0x5d0801,null));};exports[_0xa2c1('0x52')]=function(_0x18c0b0,_0x430055,_0x4bb5d2){var _0x2ec351={};var _0x1110dc={};var _0x376661;var _0x13b06e;return db[_0xa2c1('0x2f')][_0xa2c1('0x4c')]({'where':{'id':_0x18c0b0[_0xa2c1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x430055,null))['then'](function(_0x45eba0){if(_0x45eba0){_0x376661=_0x45eba0;_0x1110dc[_0xa2c1('0x33')]=_[_0xa2c1('0x35')](db[_0xa2c1('0x51')][_0xa2c1('0x30')]);_0x1110dc['query']=_[_0xa2c1('0x35')](_0x18c0b0[_0xa2c1('0x34')]);_0x1110dc[_0xa2c1('0x36')]=_['intersection'](_0x1110dc[_0xa2c1('0x33')],_0x1110dc['query']);_0x2ec351[_0xa2c1('0x39')]=_[_0xa2c1('0x37')](_0x1110dc[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x18c0b0[_0xa2c1('0x34')]['fields']));_0x2ec351[_0xa2c1('0x39')]=_0x2ec351[_0xa2c1('0x39')]['length']?_0x2ec351['attributes']:_0x1110dc['model'];_0x2ec351[_0xa2c1('0x4d')]=qs[_0xa2c1('0x4e')](_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x4e')]);_0x2ec351[_0xa2c1('0x3d')]=qs['filters'](_[_0xa2c1('0x3e')](_0x18c0b0[_0xa2c1('0x34')],_0x1110dc['filters']));if(_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x3f')]){_0x2ec351[_0xa2c1('0x3d')]=_['merge'](_0x2ec351['where'],{'$or':_[_0xa2c1('0x2e')](_0x2ec351[_0xa2c1('0x39')],function(_0x41f20f){var _0x2a72a9={};_0x2a72a9[_0x41f20f]={'$like':'%'+_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x2a72a9;})});}_0x2ec351=_[_0xa2c1('0x40')]({},_0x2ec351,_0x18c0b0[_0xa2c1('0x4f')]);return _0x376661[_0xa2c1('0x52')](_0x2ec351);}})[_0xa2c1('0x27')](function(_0x5e447b){if(_0x5e447b){_0x13b06e=_0x5e447b[_0xa2c1('0x3a')];if(!_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x3b')](_0xa2c1('0x3c'))){_0x2ec351[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x1f')]);_0x2ec351[_0xa2c1('0x21')]=qs[_0xa2c1('0x21')](_0x18c0b0['query'][_0xa2c1('0x21')]);}return _0x376661[_0xa2c1('0x52')](_0x2ec351);}})[_0xa2c1('0x27')](function(_0x33931b){if(_0x33931b){return _0x33931b?{'count':_0x13b06e,'rows':_0x33931b}:null;}})['then'](respondWithResult(_0x430055,null))['catch'](handleError(_0x430055,null));};exports[_0xa2c1('0x53')]=function(_0x30314b,_0x48189b,_0x57adbd){var _0x49e8d2={};var _0x4544a9={};var _0x47c56e;var _0x3a0b74;return db[_0xa2c1('0x2f')][_0xa2c1('0x4c')]({'where':{'id':_0x30314b[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x48189b,null))[_0xa2c1('0x27')](function(_0x396c08){if(_0x396c08){_0x47c56e=_0x396c08;_0x4544a9[_0xa2c1('0x33')]=_[_0xa2c1('0x35')](db[_0xa2c1('0x54')][_0xa2c1('0x30')]);_0x4544a9[_0xa2c1('0x34')]=_[_0xa2c1('0x35')](_0x30314b[_0xa2c1('0x34')]);_0x4544a9[_0xa2c1('0x36')]=_[_0xa2c1('0x37')](_0x4544a9[_0xa2c1('0x33')],_0x4544a9[_0xa2c1('0x34')]);_0x49e8d2[_0xa2c1('0x39')]=_[_0xa2c1('0x37')](_0x4544a9[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x38')]));_0x49e8d2[_0xa2c1('0x39')]=_0x49e8d2[_0xa2c1('0x39')][_0xa2c1('0x3a')]?_0x49e8d2[_0xa2c1('0x39')]:_0x4544a9[_0xa2c1('0x33')];_0x49e8d2[_0xa2c1('0x4d')]=qs['sort'](_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x4e')]);_0x49e8d2[_0xa2c1('0x3d')]=qs['filters'](_[_0xa2c1('0x3e')](_0x30314b['query'],_0x4544a9['filters']));if(_0x30314b[_0xa2c1('0x34')]['filter']){_0x49e8d2['where']=_[_0xa2c1('0x40')](_0x49e8d2[_0xa2c1('0x3d')],{'$or':_[_0xa2c1('0x2e')](_0x49e8d2[_0xa2c1('0x39')],function(_0x1b953c){var _0x591fa6={};_0x591fa6[_0x1b953c]={'$like':'%'+_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x591fa6;})});}_0x49e8d2=_[_0xa2c1('0x40')]({},_0x49e8d2,_0x30314b[_0xa2c1('0x4f')]);return _0x47c56e['getTags'](_0x49e8d2);}})[_0xa2c1('0x27')](function(_0x2273df){if(_0x2273df){_0x3a0b74=_0x2273df[_0xa2c1('0x3a')];if(!_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x3b')]('nolimit')){_0x49e8d2[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x30314b['query'][_0xa2c1('0x1f')]);_0x49e8d2[_0xa2c1('0x21')]=qs[_0xa2c1('0x21')](_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x21')]);}return _0x47c56e[_0xa2c1('0x53')](_0x49e8d2);}})[_0xa2c1('0x27')](function(_0x143a6f){if(_0x143a6f){return _0x143a6f?{'count':_0x3a0b74,'rows':_0x143a6f}:null;}})[_0xa2c1('0x27')](respondWithResult(_0x48189b,null))[_0xa2c1('0x44')](handleError(_0x48189b,null));};exports[_0xa2c1('0x55')]=function(_0x216ba0,_0x3bd7a9,_0x5a424d){if(_0x216ba0['body']['id']){delete _0x216ba0[_0xa2c1('0x48')]['id'];}return db['ZendeskConfiguration'][_0xa2c1('0x4c')]({'where':{'id':_0x216ba0[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x3bd7a9,null))[_0xa2c1('0x27')](function(_0x4f5b62){if(_0x4f5b62){return _0x4f5b62[_0xa2c1('0x55')](_0x216ba0['body'][_0xa2c1('0x56')]||[]);}return null;})[_0xa2c1('0x27')](respondWithResult(_0x3bd7a9,null))['catch'](handleError(_0x3bd7a9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index c191a40..4d153bc 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 _0x93e9=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x247f01,_0x290cad){var _0x3193b5=function(_0x1ad81b){while(--_0x1ad81b){_0x247f01['push'](_0x247f01['shift']());}};_0x3193b5(++_0x290cad);}(_0x93e9,0xcc));var _0x993e=function(_0x5286bd,_0x738f43){_0x5286bd=_0x5286bd-0x0;var _0x9333b7=_0x93e9[_0x5286bd];return _0x9333b7;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda2d=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x46d8c6,_0x4b8c84){var _0xd91cc0=function(_0x458eb7){while(--_0x458eb7){_0x46d8c6['push'](_0x46d8c6['shift']());}};_0xd91cc0(++_0x4b8c84);}(_0xda2d,0x102));var _0xdda2=function(_0x4a47c3,_0x2363dd){_0x4a47c3=_0x4a47c3-0x0;var _0x1bdb7c=_0xda2d[_0x4a47c3];return _0x1bdb7c;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 73777b2..8be0947 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 _0xbfba=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','moment'];(function(_0x279d96,_0x46e655){var _0x5c3441=function(_0x387443){while(--_0x387443){_0x279d96['push'](_0x279d96['shift']());}};_0x5c3441(++_0x46e655);}(_0xbfba,0x13a));var _0xabfb=function(_0x14a6c3,_0x5dff43){_0x14a6c3=_0x14a6c3-0x0;var _0x44060f=_0xbfba[_0x14a6c3];return _0x44060f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xabfb('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabfb('0x1'));var db=require(_0xabfb('0x2'))['db'];var utils=require(_0xabfb('0x3'));var logger=require(_0xabfb('0x4'))(_0xabfb('0x5'));var config=require(_0xabfb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xabfb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x202de5,_0x4afa0f,_0x307976){return new BPromise(function(_0x2a4524,_0x33a6a7){return client[_0xabfb('0x8')](_0x202de5,_0x307976)[_0xabfb('0x9')](function(_0x4d5969){logger[_0xabfb('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4afa0f,_0xabfb('0xb'));logger[_0xabfb('0xc')](_0xabfb('0xd'),_0x4afa0f,'request\x20sent',JSON[_0xabfb('0xe')](_0x4d5969));if(_0x4d5969[_0xabfb('0xf')]){if(_0x4d5969[_0xabfb('0xf')][_0xabfb('0x10')]===0x1f4){logger[_0xabfb('0xf')](_0xabfb('0x11'),_0x4afa0f,_0x4d5969[_0xabfb('0xf')][_0xabfb('0x12')]);return _0x33a6a7(_0x4d5969[_0xabfb('0xf')][_0xabfb('0x12')]);}logger['error'](_0xabfb('0x11'),_0x4afa0f,_0x4d5969[_0xabfb('0xf')][_0xabfb('0x12')]);return _0x2a4524(_0x4d5969[_0xabfb('0xf')][_0xabfb('0x12')]);}else{logger[_0xabfb('0xa')](_0xabfb('0x11'),_0x4afa0f,_0xabfb('0xb'));_0x2a4524(_0x4d5969[_0xabfb('0x13')]['message']);}})[_0xabfb('0x14')](function(_0x255fc6){logger[_0xabfb('0xf')](_0xabfb('0x11'),_0x4afa0f,_0x255fc6);_0x33a6a7(_0x255fc6);});});} \ No newline at end of file +var _0x4668=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x53a934,_0x2d33b8){var _0x1fd48a=function(_0x102669){while(--_0x102669){_0x53a934['push'](_0x53a934['shift']());}};_0x1fd48a(++_0x2d33b8);}(_0x4668,0x1bf));var _0x8466=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4668[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8466('0x0'));var util=require(_0x8466('0x1'));var moment=require(_0x8466('0x2'));var BPromise=require(_0x8466('0x3'));var rs=require(_0x8466('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8466('0x5'))['db'];var utils=require(_0x8466('0x6'));var logger=require(_0x8466('0x7'))(_0x8466('0x8'));var config=require(_0x8466('0x9'));var jayson=require(_0x8466('0xa'));var client=jayson[_0x8466('0xb')][_0x8466('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x466797,_0x40d13a,_0x38d846){return new BPromise(function(_0xeab8b,_0x58f1d0){return client[_0x8466('0xd')](_0x466797,_0x38d846)[_0x8466('0xe')](function(_0x39699a){logger[_0x8466('0xf')](_0x8466('0x10'),_0x40d13a,_0x8466('0x11'));logger[_0x8466('0x12')](_0x8466('0x13'),_0x40d13a,_0x8466('0x11'),JSON[_0x8466('0x14')](_0x39699a));if(_0x39699a[_0x8466('0x15')]){if(_0x39699a[_0x8466('0x15')][_0x8466('0x16')]===0x1f4){logger[_0x8466('0x15')](_0x8466('0x10'),_0x40d13a,_0x39699a[_0x8466('0x15')][_0x8466('0x17')]);return _0x58f1d0(_0x39699a['error'][_0x8466('0x17')]);}logger[_0x8466('0x15')](_0x8466('0x10'),_0x40d13a,_0x39699a[_0x8466('0x15')]['message']);return _0xeab8b(_0x39699a[_0x8466('0x15')]['message']);}else{logger[_0x8466('0xf')](_0x8466('0x10'),_0x40d13a,'request\x20sent');_0xeab8b(_0x39699a[_0x8466('0x18')][_0x8466('0x17')]);}})['catch'](function(_0x131c7f){logger[_0x8466('0x15')](_0x8466('0x10'),_0x40d13a,_0x131c7f);_0x58f1d0(_0x131c7f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index a7362ff..a5cb185 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 _0x7aae=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','post','isAuthenticated','create','destroy','exports'];(function(_0x3f3c46,_0x33e972){var _0x7d1132=function(_0x2c7b56){while(--_0x2c7b56){_0x3f3c46['push'](_0x3f3c46['shift']());}};_0x7d1132(++_0x33e972);}(_0x7aae,0x80));var _0xe7aa=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7aae[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7aa('0x0'));var timeout=require(_0xe7aa('0x1'));var express=require(_0xe7aa('0x2'));var router=express['Router']();var fs_extra=require(_0xe7aa('0x3'));var auth=require(_0xe7aa('0x4'));var interaction=require(_0xe7aa('0x5'));var config=require(_0xe7aa('0x6'));var controller=require(_0xe7aa('0x7'));router[_0xe7aa('0x8')]('/',auth['isAuthenticated'](),controller[_0xe7aa('0x9')]);router['get'](_0xe7aa('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe7aa('0xb')]('/',auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xd')]);router['put']('/:id',auth[_0xe7aa('0xc')](),controller['update']);router['delete'](_0xe7aa('0xa'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xe')]);module[_0xe7aa('0xf')]=router; \ No newline at end of file +var _0xf126=['update','delete','/:id','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','index','isAuthenticated','post','create','put'];(function(_0x515c43,_0x9cfc36){var _0x383b71=function(_0x3d2193){while(--_0x3d2193){_0x515c43['push'](_0x515c43['shift']());}};_0x383b71(++_0x9cfc36);}(_0xf126,0x1ea));var _0x6f12=function(_0x53ed0b,_0x25e205){_0x53ed0b=_0x53ed0b-0x0;var _0x453628=_0xf126[_0x53ed0b];return _0x453628;};'use strict';var multer=require(_0x6f12('0x0'));var util=require('util');var path=require(_0x6f12('0x1'));var timeout=require(_0x6f12('0x2'));var express=require(_0x6f12('0x3'));var router=express[_0x6f12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6f12('0x5'));var interaction=require(_0x6f12('0x6'));var config=require('../../config/environment');var controller=require(_0x6f12('0x7'));router[_0x6f12('0x8')]('/',auth['isAuthenticated'](),controller[_0x6f12('0x9')]);router[_0x6f12('0x8')]('/:id',auth[_0x6f12('0xa')](),controller['show']);router[_0x6f12('0xb')]('/',auth['isAuthenticated'](),controller[_0x6f12('0xc')]);router[_0x6f12('0xd')]('/:id',auth[_0x6f12('0xa')](),controller[_0x6f12('0xe')]);router[_0x6f12('0xf')](_0x6f12('0x10'),auth[_0x6f12('0xa')](),controller['destroy']);module[_0x6f12('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index fc3a18c..570180a 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 _0xa023=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize'];(function(_0x327f17,_0x175660){var _0x29df36=function(_0x5b6065){while(--_0x5b6065){_0x327f17['push'](_0x327f17['shift']());}};_0x29df36(++_0x175660);}(_0xa023,0xfb));var _0x3a02=function(_0x5d9555,_0x4dc7d1){_0x5d9555=_0x5d9555-0x0;var _0x39fe1e=_0xa023[_0x5d9555];return _0x39fe1e;};'use strict';var Sequelize=require(_0x3a02('0x0'));module[_0x3a02('0x1')]={'type':{'type':Sequelize[_0x3a02('0x2')](_0x3a02('0x3'),'variable',_0x3a02('0x4'),_0x3a02('0x5'),_0x3a02('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3a02('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x3a02('0x3'),_0x3a02('0x8'),_0x3a02('0x4'))},'keyContent':{'type':Sequelize[_0x3a02('0x7')]},'idField':{'type':Sequelize[_0x3a02('0x7')]},'nameField':{'type':Sequelize[_0x3a02('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3a02('0x7')]}}; \ No newline at end of file +var _0x0612=['ENUM','string','variable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0612,0xf6));var _0x2061=function(_0x3f7852,_0x4871f4){_0x3f7852=_0x3f7852-0x0;var _0x5c68e7=_0x0612[_0x3f7852];return _0x5c68e7;};'use strict';var Sequelize=require(_0x2061('0x0'));module[_0x2061('0x1')]={'type':{'type':Sequelize[_0x2061('0x2')](_0x2061('0x3'),_0x2061('0x4'),'customVariable','keyValue',_0x2061('0x5')),'defaultValue':_0x2061('0x3')},'content':{'type':Sequelize[_0x2061('0x6')]},'key':{'type':Sequelize[_0x2061('0x6')]},'keyType':{'type':Sequelize[_0x2061('0x2')](_0x2061('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2061('0x6')]},'idField':{'type':Sequelize[_0x2061('0x6')]},'nameField':{'type':Sequelize[_0x2061('0x6')]},'customField':{'type':Sequelize[_0x2061('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2061('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 373b00d..fad7c49 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 _0xe42c=['keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model'];(function(_0x161ccf,_0x335749){var _0x1bce59=function(_0x13d412){while(--_0x13d412){_0x161ccf['push'](_0x161ccf['shift']());}};_0x1bce59(++_0x335749);}(_0xe42c,0x149));var _0xce42=function(_0xea43e8,_0x5b5b59){_0xea43e8=_0xea43e8-0x0;var _0x100a5b=_0xe42c[_0xea43e8];return _0x100a5b;};'use strict';var emlformat=require(_0xce42('0x0'));var rimraf=require(_0xce42('0x1'));var zipdir=require(_0xce42('0x2'));var jsonpatch=require(_0xce42('0x3'));var rp=require(_0xce42('0x4'));var moment=require(_0xce42('0x5'));var BPromise=require(_0xce42('0x6'));var Mustache=require(_0xce42('0x7'));var util=require(_0xce42('0x8'));var path=require('path');var sox=require(_0xce42('0x9'));var csv=require(_0xce42('0xa'));var ejs=require(_0xce42('0xb'));var fs=require('fs');var fs_extra=require(_0xce42('0xc'));var _=require(_0xce42('0xd'));var squel=require(_0xce42('0xe'));var crypto=require(_0xce42('0xf'));var jsforce=require(_0xce42('0x10'));var deskjs=require(_0xce42('0x11'));var toCsv=require(_0xce42('0xa'));var querystring=require(_0xce42('0x12'));var Papa=require(_0xce42('0x13'));var Redis=require(_0xce42('0x14'));var authService=require(_0xce42('0x15'));var qs=require(_0xce42('0x16'));var as=require(_0xce42('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce42('0x18'))('api');var utils=require(_0xce42('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xce42('0x1a'));var db=require(_0xce42('0x1b'))['db'];function respondWithStatusCode(_0x5f0cf1,_0x2b2fbd){_0x2b2fbd=_0x2b2fbd||0xcc;return function(_0x18756b){if(_0x18756b){return _0x5f0cf1['sendStatus'](_0x2b2fbd);}return _0x5f0cf1[_0xce42('0x1c')](_0x2b2fbd)[_0xce42('0x1d')]();};}function respondWithResult(_0x2bf247,_0x2b1c48){_0x2b1c48=_0x2b1c48||0xc8;return function(_0xc34917){if(_0xc34917){return _0x2bf247['status'](_0x2b1c48)[_0xce42('0x1e')](_0xc34917);}};}function respondWithFilteredResult(_0x3a3b2d,_0x4cf576){return function(_0x5d6159){if(_0x5d6159){var _0x4a6ca8=typeof _0x4cf576[_0xce42('0x1f')]==='undefined'&&typeof _0x4cf576[_0xce42('0x20')]===_0xce42('0x21');var _0x5314e5=_0x5d6159[_0xce42('0x22')];var _0x45eec6=_0x4a6ca8?0x0:_0x4cf576[_0xce42('0x1f')];var _0x31ced3=_0x4a6ca8?_0x5d6159[_0xce42('0x22')]:_0x4cf576[_0xce42('0x1f')]+_0x4cf576[_0xce42('0x20')];var _0x2f742c;if(_0x31ced3>=_0x5314e5){_0x31ced3=_0x5314e5;_0x2f742c=0xc8;}else{_0x2f742c=0xce;}_0x3a3b2d[_0xce42('0x1c')](_0x2f742c);return _0x3a3b2d[_0xce42('0x23')](_0xce42('0x24'),_0x45eec6+'-'+_0x31ced3+'/'+_0x5314e5)[_0xce42('0x1e')](_0x5d6159);}return null;};}function patchUpdates(_0xecf25c){return function(_0x5037f4){try{jsonpatch['apply'](_0x5037f4,_0xecf25c,!![]);}catch(_0x214906){return BPromise[_0xce42('0x25')](_0x214906);}return _0x5037f4[_0xce42('0x26')]();};}function saveUpdates(_0x3f8d73,_0xe989ca){return function(_0x24253f){if(_0x24253f){return _0x24253f[_0xce42('0x27')](_0x3f8d73)[_0xce42('0x28')](function(_0x2b4044){return _0x2b4044;});}return null;};}function removeEntity(_0x36d0ec,_0x301305){return function(_0x522572){if(_0x522572){return _0x522572[_0xce42('0x29')]()[_0xce42('0x28')](function(){_0x36d0ec[_0xce42('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4405b9,_0x3b8cc3){return function(_0x9784a8){if(!_0x9784a8){_0x4405b9['sendStatus'](0x194);}return _0x9784a8;};}function handleError(_0x36f20f,_0x5c03f6){_0x5c03f6=_0x5c03f6||0x1f4;return function(_0x292ce4){logger['error'](_0x292ce4['stack']);if(_0x292ce4['name']){delete _0x292ce4[_0xce42('0x2a')];}_0x36f20f[_0xce42('0x1c')](_0x5c03f6)['send'](_0x292ce4);};}exports[_0xce42('0x2b')]=function(_0x98f883,_0x3153ca){var _0x2c9baf={},_0x30161c={},_0x59f6ea={'count':0x0,'rows':[]};var _0x303e3a=_[_0xce42('0x2c')](db[_0xce42('0x2d')][_0xce42('0x2e')],function(_0xd97d49){return{'name':_0xd97d49[_0xce42('0x2f')],'type':_0xd97d49[_0xce42('0x30')][_0xce42('0x31')]};});_0x30161c[_0xce42('0x32')]=_[_0xce42('0x2c')](_0x303e3a,_0xce42('0x2a'));_0x30161c['query']=_[_0xce42('0x33')](_0x98f883[_0xce42('0x34')]);_0x30161c[_0xce42('0x35')]=_[_0xce42('0x36')](_0x30161c[_0xce42('0x32')],_0x30161c['query']);_0x2c9baf['attributes']=_['intersection'](_0x30161c[_0xce42('0x32')],qs[_0xce42('0x37')](_0x98f883[_0xce42('0x34')][_0xce42('0x37')]));_0x2c9baf[_0xce42('0x38')]=_0x2c9baf['attributes'][_0xce42('0x39')]?_0x2c9baf['attributes']:_0x30161c[_0xce42('0x32')];if(!_0x98f883[_0xce42('0x34')][_0xce42('0x3a')](_0xce42('0x3b'))){_0x2c9baf[_0xce42('0x20')]=qs[_0xce42('0x20')](_0x98f883[_0xce42('0x34')][_0xce42('0x20')]);_0x2c9baf['offset']=qs[_0xce42('0x1f')](_0x98f883[_0xce42('0x34')]['offset']);}_0x2c9baf[_0xce42('0x3c')]=qs['sort'](_0x98f883[_0xce42('0x34')][_0xce42('0x3d')]);_0x2c9baf[_0xce42('0x3e')]=qs[_0xce42('0x35')](_[_0xce42('0x3f')](_0x98f883[_0xce42('0x34')],_0x30161c[_0xce42('0x35')]),_0x303e3a);if(_0x98f883['query'][_0xce42('0x40')]){_0x2c9baf['where']=_[_0xce42('0x41')](_0x2c9baf[_0xce42('0x3e')],{'$or':_[_0xce42('0x2c')](_0x303e3a,function(_0x73eb85){if(_0x73eb85['type']!==_0xce42('0x42')){var _0xcbd439={};_0xcbd439[_0x73eb85[_0xce42('0x2a')]]={'$like':'%'+_0x98f883[_0xce42('0x34')][_0xce42('0x40')]+'%'};return _0xcbd439;}})});}_0x2c9baf=_['merge']({},_0x2c9baf,_0x98f883[_0xce42('0x43')]);var _0x3e60f6={'where':_0x2c9baf['where']};return db[_0xce42('0x2d')][_0xce42('0x22')](_0x3e60f6)[_0xce42('0x28')](function(_0x1ff660){_0x59f6ea[_0xce42('0x22')]=_0x1ff660;if(_0x98f883['query'][_0xce42('0x44')]){_0x2c9baf[_0xce42('0x45')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x2c9baf);})['then'](function(_0x3e0b23){_0x59f6ea['rows']=_0x3e0b23;return _0x59f6ea;})[_0xce42('0x28')](respondWithFilteredResult(_0x3153ca,_0x2c9baf))[_0xce42('0x46')](handleError(_0x3153ca,null));};exports[_0xce42('0x47')]=function(_0x29704c,_0x40bd28){var _0x334d19={'raw':!![],'where':{'id':_0x29704c[_0xce42('0x48')]['id']}},_0x5d6ace={};_0x5d6ace['model']=_[_0xce42('0x33')](db['ZendeskField']['rawAttributes']);_0x5d6ace[_0xce42('0x34')]=_['keys'](_0x29704c[_0xce42('0x34')]);_0x5d6ace[_0xce42('0x35')]=_[_0xce42('0x36')](_0x5d6ace[_0xce42('0x32')],_0x5d6ace[_0xce42('0x34')]);_0x334d19['attributes']=_[_0xce42('0x36')](_0x5d6ace[_0xce42('0x32')],qs[_0xce42('0x37')](_0x29704c[_0xce42('0x34')][_0xce42('0x37')]));_0x334d19[_0xce42('0x38')]=_0x334d19[_0xce42('0x38')]['length']?_0x334d19[_0xce42('0x38')]:_0x5d6ace['model'];if(_0x29704c['query']['includeAll']){_0x334d19[_0xce42('0x45')]=[{'all':!![]}];}_0x334d19=_[_0xce42('0x41')]({},_0x334d19,_0x29704c[_0xce42('0x43')]);return db[_0xce42('0x2d')][_0xce42('0x49')](_0x334d19)[_0xce42('0x28')](handleEntityNotFound(_0x40bd28,null))[_0xce42('0x28')](respondWithResult(_0x40bd28,null))['catch'](handleError(_0x40bd28,null));};exports[_0xce42('0x4a')]=function(_0x3d64eb,_0x4145a7){return db['ZendeskField'][_0xce42('0x4a')](_0x3d64eb['body'],{})[_0xce42('0x28')](respondWithResult(_0x4145a7,0xc9))['catch'](handleError(_0x4145a7,null));};exports[_0xce42('0x27')]=function(_0x213e09,_0x3234e4){if(_0x213e09[_0xce42('0x4b')]['id']){delete _0x213e09['body']['id'];}return db[_0xce42('0x2d')]['find']({'where':{'id':_0x213e09['params']['id']}})[_0xce42('0x28')](handleEntityNotFound(_0x3234e4,null))[_0xce42('0x28')](saveUpdates(_0x213e09['body'],null))[_0xce42('0x28')](respondWithResult(_0x3234e4,null))[_0xce42('0x46')](handleError(_0x3234e4,null));};exports[_0xce42('0x29')]=function(_0x1f2774,_0x4bb250){return db[_0xce42('0x2d')][_0xce42('0x49')]({'where':{'id':_0x1f2774[_0xce42('0x48')]['id']}})[_0xce42('0x28')](handleEntityNotFound(_0x4bb250,null))['then'](removeEntity(_0x4bb250,null))['catch'](handleError(_0x4bb250,null));}; \ No newline at end of file +var _0xc8de=['where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','update','then','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','nolimit','sort','pick','filter'];(function(_0x46bd16,_0x53e22b){var _0xc1ccfb=function(_0x46d761){while(--_0x46d761){_0x46bd16['push'](_0x46bd16['shift']());}};_0xc1ccfb(++_0x53e22b);}(_0xc8de,0x167));var _0xec8d=function(_0x211e91,_0x3c2485){_0x211e91=_0x211e91-0x0;var _0x521acb=_0xc8de[_0x211e91];return _0x521acb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec8d('0x0'));var zipdir=require(_0xec8d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xec8d('0x2'));var BPromise=require(_0xec8d('0x3'));var Mustache=require(_0xec8d('0x4'));var util=require(_0xec8d('0x5'));var path=require(_0xec8d('0x6'));var sox=require(_0xec8d('0x7'));var csv=require(_0xec8d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec8d('0x9'));var _=require('lodash');var squel=require(_0xec8d('0xa'));var crypto=require('crypto');var jsforce=require(_0xec8d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xec8d('0x8'));var querystring=require('querystring');var Papa=require(_0xec8d('0xc'));var Redis=require(_0xec8d('0xd'));var authService=require(_0xec8d('0xe'));var qs=require(_0xec8d('0xf'));var as=require(_0xec8d('0x10'));var hardwareService=require(_0xec8d('0x11'));var logger=require(_0xec8d('0x12'))(_0xec8d('0x13'));var utils=require(_0xec8d('0x14'));var config=require(_0xec8d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xec8d('0x16'))['db'];function respondWithStatusCode(_0x3ce9f6,_0x194149){_0x194149=_0x194149||0xcc;return function(_0x3a5d6f){if(_0x3a5d6f){return _0x3ce9f6[_0xec8d('0x17')](_0x194149);}return _0x3ce9f6[_0xec8d('0x18')](_0x194149)[_0xec8d('0x19')]();};}function respondWithResult(_0x43b202,_0x10d84d){_0x10d84d=_0x10d84d||0xc8;return function(_0x445ac5){if(_0x445ac5){return _0x43b202[_0xec8d('0x18')](_0x10d84d)[_0xec8d('0x1a')](_0x445ac5);}};}function respondWithFilteredResult(_0x5f316b,_0x2666c2){return function(_0x27ad4a){if(_0x27ad4a){var _0x3b0c6d=typeof _0x2666c2[_0xec8d('0x1b')]==='undefined'&&typeof _0x2666c2[_0xec8d('0x1c')]==='undefined';var _0x4af8f2=_0x27ad4a[_0xec8d('0x1d')];var _0x3b32c8=_0x3b0c6d?0x0:_0x2666c2['offset'];var _0x2bdc72=_0x3b0c6d?_0x27ad4a[_0xec8d('0x1d')]:_0x2666c2[_0xec8d('0x1b')]+_0x2666c2[_0xec8d('0x1c')];var _0x5bdb09;if(_0x2bdc72>=_0x4af8f2){_0x2bdc72=_0x4af8f2;_0x5bdb09=0xc8;}else{_0x5bdb09=0xce;}_0x5f316b['status'](_0x5bdb09);return _0x5f316b[_0xec8d('0x1e')]('Content-Range',_0x3b32c8+'-'+_0x2bdc72+'/'+_0x4af8f2)[_0xec8d('0x1a')](_0x27ad4a);}return null;};}function patchUpdates(_0x19d8f0){return function(_0x83ee70){try{jsonpatch['apply'](_0x83ee70,_0x19d8f0,!![]);}catch(_0x52e5c7){return BPromise['reject'](_0x52e5c7);}return _0x83ee70['save']();};}function saveUpdates(_0x376b4c,_0x154b78){return function(_0x5ed185){if(_0x5ed185){return _0x5ed185[_0xec8d('0x1f')](_0x376b4c)[_0xec8d('0x20')](function(_0x252d96){return _0x252d96;});}return null;};}function removeEntity(_0x5b6f89,_0x1ce3be){return function(_0xa2ad0a){if(_0xa2ad0a){return _0xa2ad0a['destroy']()[_0xec8d('0x20')](function(){_0x5b6f89[_0xec8d('0x18')](0xcc)[_0xec8d('0x19')]();});}};}function handleEntityNotFound(_0x3e90fe,_0x1e8561){return function(_0x2d4e04){if(!_0x2d4e04){_0x3e90fe['sendStatus'](0x194);}return _0x2d4e04;};}function handleError(_0x33983a,_0xdb1709){_0xdb1709=_0xdb1709||0x1f4;return function(_0x59ab92){logger[_0xec8d('0x21')](_0x59ab92[_0xec8d('0x22')]);if(_0x59ab92['name']){delete _0x59ab92[_0xec8d('0x23')];}_0x33983a[_0xec8d('0x18')](_0xdb1709)[_0xec8d('0x24')](_0x59ab92);};}exports[_0xec8d('0x25')]=function(_0x5ea99d,_0x33faf0){var _0x2da751={},_0x5de0ec={},_0x5946ec={'count':0x0,'rows':[]};var _0x41e264=_['map'](db[_0xec8d('0x26')][_0xec8d('0x27')],function(_0x4368df){return{'name':_0x4368df[_0xec8d('0x28')],'type':_0x4368df[_0xec8d('0x29')][_0xec8d('0x2a')]};});_0x5de0ec[_0xec8d('0x2b')]=_[_0xec8d('0x2c')](_0x41e264,_0xec8d('0x23'));_0x5de0ec['query']=_[_0xec8d('0x2d')](_0x5ea99d[_0xec8d('0x2e')]);_0x5de0ec[_0xec8d('0x2f')]=_[_0xec8d('0x30')](_0x5de0ec[_0xec8d('0x2b')],_0x5de0ec[_0xec8d('0x2e')]);_0x2da751[_0xec8d('0x31')]=_[_0xec8d('0x30')](_0x5de0ec[_0xec8d('0x2b')],qs['fields'](_0x5ea99d[_0xec8d('0x2e')]['fields']));_0x2da751[_0xec8d('0x31')]=_0x2da751[_0xec8d('0x31')][_0xec8d('0x32')]?_0x2da751[_0xec8d('0x31')]:_0x5de0ec[_0xec8d('0x2b')];if(!_0x5ea99d[_0xec8d('0x2e')]['hasOwnProperty'](_0xec8d('0x33'))){_0x2da751[_0xec8d('0x1c')]=qs[_0xec8d('0x1c')](_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x1c')]);_0x2da751['offset']=qs['offset'](_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x1b')]);}_0x2da751['order']=qs[_0xec8d('0x34')](_0x5ea99d['query']['sort']);_0x2da751['where']=qs[_0xec8d('0x2f')](_[_0xec8d('0x35')](_0x5ea99d['query'],_0x5de0ec[_0xec8d('0x2f')]),_0x41e264);if(_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x36')]){_0x2da751['where']=_['merge'](_0x2da751[_0xec8d('0x37')],{'$or':_[_0xec8d('0x2c')](_0x41e264,function(_0x49d15){if(_0x49d15[_0xec8d('0x29')]!==_0xec8d('0x38')){var _0x389e7f={};_0x389e7f[_0x49d15[_0xec8d('0x23')]]={'$like':'%'+_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x36')]+'%'};return _0x389e7f;}})});}_0x2da751=_[_0xec8d('0x39')]({},_0x2da751,_0x5ea99d[_0xec8d('0x3a')]);var _0x31b4bb={'where':_0x2da751['where']};return db[_0xec8d('0x26')]['count'](_0x31b4bb)['then'](function(_0x495a38){_0x5946ec[_0xec8d('0x1d')]=_0x495a38;if(_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x3b')]){_0x2da751[_0xec8d('0x3c')]=[{'all':!![]}];}return db[_0xec8d('0x26')][_0xec8d('0x3d')](_0x2da751);})[_0xec8d('0x20')](function(_0x200a63){_0x5946ec[_0xec8d('0x3e')]=_0x200a63;return _0x5946ec;})[_0xec8d('0x20')](respondWithFilteredResult(_0x33faf0,_0x2da751))[_0xec8d('0x3f')](handleError(_0x33faf0,null));};exports['show']=function(_0x1b5c05,_0x59c171){var _0x396578={'raw':!![],'where':{'id':_0x1b5c05[_0xec8d('0x40')]['id']}},_0x399b2b={};_0x399b2b[_0xec8d('0x2b')]=_[_0xec8d('0x2d')](db[_0xec8d('0x26')][_0xec8d('0x27')]);_0x399b2b[_0xec8d('0x2e')]=_['keys'](_0x1b5c05[_0xec8d('0x2e')]);_0x399b2b['filters']=_[_0xec8d('0x30')](_0x399b2b[_0xec8d('0x2b')],_0x399b2b[_0xec8d('0x2e')]);_0x396578[_0xec8d('0x31')]=_[_0xec8d('0x30')](_0x399b2b[_0xec8d('0x2b')],qs['fields'](_0x1b5c05[_0xec8d('0x2e')]['fields']));_0x396578[_0xec8d('0x31')]=_0x396578['attributes'][_0xec8d('0x32')]?_0x396578['attributes']:_0x399b2b[_0xec8d('0x2b')];if(_0x1b5c05[_0xec8d('0x2e')][_0xec8d('0x3b')]){_0x396578[_0xec8d('0x3c')]=[{'all':!![]}];}_0x396578=_[_0xec8d('0x39')]({},_0x396578,_0x1b5c05[_0xec8d('0x3a')]);return db[_0xec8d('0x26')][_0xec8d('0x41')](_0x396578)[_0xec8d('0x20')](handleEntityNotFound(_0x59c171,null))[_0xec8d('0x20')](respondWithResult(_0x59c171,null))[_0xec8d('0x3f')](handleError(_0x59c171,null));};exports[_0xec8d('0x42')]=function(_0x30f73b,_0x238e5a){return db[_0xec8d('0x26')][_0xec8d('0x42')](_0x30f73b[_0xec8d('0x43')],{})[_0xec8d('0x20')](respondWithResult(_0x238e5a,0xc9))['catch'](handleError(_0x238e5a,null));};exports[_0xec8d('0x1f')]=function(_0x462a84,_0x282898){if(_0x462a84[_0xec8d('0x43')]['id']){delete _0x462a84['body']['id'];}return db[_0xec8d('0x26')][_0xec8d('0x41')]({'where':{'id':_0x462a84[_0xec8d('0x40')]['id']}})[_0xec8d('0x20')](handleEntityNotFound(_0x282898,null))[_0xec8d('0x20')](saveUpdates(_0x462a84[_0xec8d('0x43')],null))[_0xec8d('0x20')](respondWithResult(_0x282898,null))['catch'](handleError(_0x282898,null));};exports[_0xec8d('0x44')]=function(_0x4a69b1,_0x579c2e){return db[_0xec8d('0x26')][_0xec8d('0x41')]({'where':{'id':_0x4a69b1['params']['id']}})['then'](handleEntityNotFound(_0x579c2e,null))[_0xec8d('0x20')](removeEntity(_0x579c2e,null))[_0xec8d('0x3f')](handleError(_0x579c2e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5a58d15..c06842b 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 _0xdb3c=['bluebird','request-promise','path','../../config/environment','define','ZendeskField','int_zendesk_fields','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x2fbcf6,_0x2e7155){var _0x3e7265=function(_0x15a3c3){while(--_0x15a3c3){_0x2fbcf6['push'](_0x2fbcf6['shift']());}};_0x3e7265(++_0x2e7155);}(_0xdb3c,0xa4));var _0xcdb3=function(_0x1f5873,_0x1497be){_0x1f5873=_0x1f5873-0x0;var _0x2a75d9=_0xdb3c[_0x1f5873];return _0x2a75d9;};'use strict';var _=require(_0xcdb3('0x0'));var util=require(_0xcdb3('0x1'));var logger=require(_0xcdb3('0x2'))(_0xcdb3('0x3'));var moment=require(_0xcdb3('0x4'));var BPromise=require(_0xcdb3('0x5'));var rp=require(_0xcdb3('0x6'));var fs=require('fs');var path=require(_0xcdb3('0x7'));var rimraf=require('rimraf');var config=require(_0xcdb3('0x8'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x5888a8,_0x3a0f46){return _0x5888a8[_0xcdb3('0x9')](_0xcdb3('0xa'),attributes,{'tableName':_0xcdb3('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xcdb3('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb373=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0x316c70,_0x211df0){var _0x1be905=function(_0x4b3a79){while(--_0x4b3a79){_0x316c70['push'](_0x316c70['shift']());}};_0x1be905(++_0x211df0);}(_0xb373,0x110));var _0x3b37=function(_0x5e1e17,_0x57f65b){_0x5e1e17=_0x5e1e17-0x0;var _0x40f960=_0xb373[_0x5e1e17];return _0x40f960;};'use strict';var _=require(_0x3b37('0x0'));var util=require(_0x3b37('0x1'));var logger=require(_0x3b37('0x2'))(_0x3b37('0x3'));var moment=require(_0x3b37('0x4'));var BPromise=require(_0x3b37('0x5'));var rp=require(_0x3b37('0x6'));var fs=require('fs');var path=require(_0x3b37('0x7'));var rimraf=require(_0x3b37('0x8'));var config=require(_0x3b37('0x9'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x5c56a6,_0x66e006){return _0x5c56a6[_0x3b37('0xa')](_0x3b37('0xb'),attributes,{'tableName':_0x3b37('0xc'),'paranoid':![],'indexes':[{'name':_0x3b37('0xd'),'fields':[_0x3b37('0xe'),_0x3b37('0xf')],'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 5a94080..ce17058 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 _0x1a05=['request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x3e84b0,_0x3c7115){var _0x4c121e=function(_0x259b13){while(--_0x259b13){_0x3e84b0['push'](_0x3e84b0['shift']());}};_0x4c121e(++_0x3c7115);}(_0x1a05,0x138));var _0x51a0=function(_0x1be61f,_0x569533){_0x1be61f=_0x1be61f-0x0;var _0x18caed=_0x1a05[_0x1be61f];return _0x18caed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a0('0x0'));var BPromise=require(_0x51a0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51a0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x51a0('0x3'));var logger=require(_0x51a0('0x4'))(_0x51a0('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a0('0x6'));var client=jayson['client'][_0x51a0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33c9a1,_0x4296dc,_0x30fd13){return new BPromise(function(_0x5f4e35,_0x7c966f){return client[_0x51a0('0x8')](_0x33c9a1,_0x30fd13)[_0x51a0('0x9')](function(_0x426091){logger['info'](_0x51a0('0xa'),_0x4296dc,_0x51a0('0xb'));logger[_0x51a0('0xc')](_0x51a0('0xd'),_0x4296dc,_0x51a0('0xb'),JSON[_0x51a0('0xe')](_0x426091));if(_0x426091['error']){if(_0x426091[_0x51a0('0xf')][_0x51a0('0x10')]===0x1f4){logger[_0x51a0('0xf')](_0x51a0('0xa'),_0x4296dc,_0x426091[_0x51a0('0xf')]['message']);return _0x7c966f(_0x426091[_0x51a0('0xf')][_0x51a0('0x11')]);}logger[_0x51a0('0xf')]('ZendeskField,\x20%s,\x20%s',_0x4296dc,_0x426091[_0x51a0('0xf')][_0x51a0('0x11')]);return _0x5f4e35(_0x426091[_0x51a0('0xf')][_0x51a0('0x11')]);}else{logger[_0x51a0('0x12')](_0x51a0('0xa'),_0x4296dc,'request\x20sent');_0x5f4e35(_0x426091[_0x51a0('0x13')][_0x51a0('0x11')]);}})['catch'](function(_0x4648f0){logger['error']('ZendeskField,\x20%s,\x20%s',_0x4296dc,_0x4648f0);_0x7c966f(_0x4648f0);});});} \ No newline at end of file +var _0x7213=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x13ab39,_0x2df003){var _0x10fb5c=function(_0x3c3c84){while(--_0x3c3c84){_0x13ab39['push'](_0x13ab39['shift']());}};_0x10fb5c(++_0x2df003);}(_0x7213,0x123));var _0x3721=function(_0x2188cd,_0x5d70ca){_0x2188cd=_0x2188cd-0x0;var _0x5c1b21=_0x7213[_0x2188cd];return _0x5c1b21;};'use strict';var _=require(_0x3721('0x0'));var util=require(_0x3721('0x1'));var moment=require(_0x3721('0x2'));var BPromise=require(_0x3721('0x3'));var rs=require(_0x3721('0x4'));var fs=require('fs');var Redis=require(_0x3721('0x5'));var db=require(_0x3721('0x6'))['db'];var utils=require(_0x3721('0x7'));var logger=require(_0x3721('0x8'))('rpc');var config=require(_0x3721('0x9'));var jayson=require(_0x3721('0xa'));var client=jayson[_0x3721('0xb')][_0x3721('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47defe,_0x1566c5,_0x4e49b3){return new BPromise(function(_0x13dba1,_0x247068){return client[_0x3721('0xd')](_0x47defe,_0x4e49b3)['then'](function(_0x45ef25){logger[_0x3721('0xe')](_0x3721('0xf'),_0x1566c5,'request\x20sent');logger['debug'](_0x3721('0x10'),_0x1566c5,_0x3721('0x11'),JSON[_0x3721('0x12')](_0x45ef25));if(_0x45ef25['error']){if(_0x45ef25[_0x3721('0x13')][_0x3721('0x14')]===0x1f4){logger[_0x3721('0x13')](_0x3721('0xf'),_0x1566c5,_0x45ef25[_0x3721('0x13')][_0x3721('0x15')]);return _0x247068(_0x45ef25['error'][_0x3721('0x15')]);}logger[_0x3721('0x13')]('ZendeskField,\x20%s,\x20%s',_0x1566c5,_0x45ef25['error'][_0x3721('0x15')]);return _0x13dba1(_0x45ef25[_0x3721('0x13')][_0x3721('0x15')]);}else{logger['info'](_0x3721('0xf'),_0x1566c5,_0x3721('0x11'));_0x13dba1(_0x45ef25[_0x3721('0x16')][_0x3721('0x15')]);}})[_0x3721('0x17')](function(_0x19fc0d){logger[_0x3721('0x13')](_0x3721('0xf'),_0x1566c5,_0x19fc0d);_0x247068(_0x19fc0d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 65f5e05..faaf491 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 _0xf16f=['getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0xf16f,0x171));var _0xff16=function(_0x45c22b,_0x2f0e39){_0x45c22b=_0x45c22b-0x0;var _0x39fcfe=_0xf16f[_0x45c22b];return _0x39fcfe;};'use strict';var multer=require(_0xff16('0x0'));var util=require(_0xff16('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xff16('0x2'));var router=express[_0xff16('0x3')]();var fs_extra=require(_0xff16('0x4'));var auth=require(_0xff16('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xff16('0x6'));var controller=require('./intZohoAccount.controller');router[_0xff16('0x7')]('/',auth['isAuthenticated'](),controller[_0xff16('0x8')]);router[_0xff16('0x7')]('/:id',auth[_0xff16('0x9')](),controller[_0xff16('0xa')]);router[_0xff16('0x7')]('/:id/configurations',auth[_0xff16('0x9')](),controller['getConfigurations']);router[_0xff16('0x7')]('/:id/fields',auth[_0xff16('0x9')](),controller[_0xff16('0xb')]);router[_0xff16('0xc')]('/',auth[_0xff16('0x9')](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xff16('0xd')]);router[_0xff16('0xe')](_0xff16('0xf'),auth['isAuthenticated'](),controller[_0xff16('0x10')]);router[_0xff16('0x11')](_0xff16('0xf'),auth[_0xff16('0x9')](),controller[_0xff16('0x12')]);module[_0xff16('0x13')]=router; \ No newline at end of file +var _0x2665=['/:id/configurations','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0x2665,0x77));var _0x5266=function(_0x270ae5,_0x29a696){_0x270ae5=_0x270ae5-0x0;var _0x4e55f0=_0x2665[_0x270ae5];return _0x4e55f0;};'use strict';var multer=require(_0x5266('0x0'));var util=require(_0x5266('0x1'));var path=require('path');var timeout=require(_0x5266('0x2'));var express=require(_0x5266('0x3'));var router=express[_0x5266('0x4')]();var fs_extra=require(_0x5266('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5266('0x6'));var config=require('../../config/environment');var controller=require(_0x5266('0x7'));router['get']('/',auth[_0x5266('0x8')](),controller[_0x5266('0x9')]);router[_0x5266('0xa')](_0x5266('0xb'),auth['isAuthenticated'](),controller[_0x5266('0xc')]);router[_0x5266('0xa')]('/:id/configurations',auth[_0x5266('0x8')](),controller[_0x5266('0xd')]);router[_0x5266('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5266('0xe'),auth[_0x5266('0x8')](),controller['addConfiguration']);router[_0x5266('0xf')](_0x5266('0xb'),auth[_0x5266('0x8')](),controller['update']);router[_0x5266('0x10')](_0x5266('0xb'),auth[_0x5266('0x8')](),controller[_0x5266('0x11')]);module[_0x5266('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 352106a..99a0e8d 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 _0x008c=['exports','STRING','sequelize'];(function(_0x23b85e,_0x39b209){var _0x329756=function(_0x3418e1){while(--_0x3418e1){_0x23b85e['push'](_0x23b85e['shift']());}};_0x329756(++_0x39b209);}(_0x008c,0x188));var _0xc008=function(_0x1e9287,_0x37f584){_0x1e9287=_0x1e9287-0x0;var _0x44342e=_0x008c[_0x1e9287];return _0x44342e;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')]},'description':{'type':Sequelize[_0xc008('0x2')]},'host':{'type':Sequelize[_0xc008('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc008('0x2')]},'clientSecret':{'type':Sequelize[_0xc008('0x2')]},'serverUrl':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xc008('0x2')]},'refreshToken':{'type':Sequelize[_0xc008('0x2')]}}; \ No newline at end of file +var _0x9bde=['STRING','exports'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3b2ac1,_0x2f35a9){_0x3b2ac1=_0x3b2ac1-0x0;var _0x573d7a=_0x9bde[_0x3b2ac1];return _0x573d7a;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 3c710e2..b789082 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 _0xe6cb=['attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','includeAll','include','catch','show','length','merge','options','find','create','body','getConfigurations','findOne','params','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','code','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0xe6cb,0x156));var _0xbe6c=function(_0x2ea8b5,_0x1b638c){_0x2ea8b5=_0x2ea8b5-0x0;var _0x5c2666=_0xe6cb[_0x2ea8b5];return _0x5c2666;};'use strict';var emlformat=require(_0xbe6c('0x0'));var rimraf=require(_0xbe6c('0x1'));var zipdir=require(_0xbe6c('0x2'));var jsonpatch=require(_0xbe6c('0x3'));var rp=require(_0xbe6c('0x4'));var moment=require(_0xbe6c('0x5'));var BPromise=require(_0xbe6c('0x6'));var Mustache=require('mustache');var util=require(_0xbe6c('0x7'));var path=require(_0xbe6c('0x8'));var sox=require(_0xbe6c('0x9'));var csv=require(_0xbe6c('0xa'));var ejs=require(_0xbe6c('0xb'));var fs=require('fs');var fs_extra=require(_0xbe6c('0xc'));var _=require(_0xbe6c('0xd'));var squel=require(_0xbe6c('0xe'));var crypto=require(_0xbe6c('0xf'));var jsforce=require(_0xbe6c('0x10'));var deskjs=require(_0xbe6c('0x11'));var toCsv=require(_0xbe6c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbe6c('0x12'));var qs=require(_0xbe6c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe6c('0x14'));var logger=require('../../config/logger')(_0xbe6c('0x15'));var utils=require('../../config/utils');var config=require(_0xbe6c('0x16'));var licenseUtil=require(_0xbe6c('0x17'));var db=require(_0xbe6c('0x18'))['db'];var integrations=require(_0xbe6c('0x19'));function respondWithStatusCode(_0x1a541c,_0x244290){_0x244290=_0x244290||0xcc;return function(_0x353b9b){if(_0x353b9b){return _0x1a541c[_0xbe6c('0x1a')](_0x244290);}return _0x1a541c['status'](_0x244290)['end']();};}function respondWithResult(_0x37404a,_0xac85fa){_0xac85fa=_0xac85fa||0xc8;return function(_0x3c5c4){if(_0x3c5c4){return _0x37404a[_0xbe6c('0x1b')](_0xac85fa)[_0xbe6c('0x1c')](_0x3c5c4);}};}function respondWithFilteredResult(_0x43e5b2,_0x1fd473){return function(_0x1c529c){if(_0x1c529c){var _0x3a940a=typeof _0x1fd473[_0xbe6c('0x1d')]===_0xbe6c('0x1e')&&typeof _0x1fd473[_0xbe6c('0x1f')]===_0xbe6c('0x1e');var _0x498adf=_0x1c529c[_0xbe6c('0x20')];var _0x1f9c59=_0x3a940a?0x0:_0x1fd473['offset'];var _0x1571ab=_0x3a940a?_0x1c529c[_0xbe6c('0x20')]:_0x1fd473[_0xbe6c('0x1d')]+_0x1fd473['limit'];var _0x1e57a6;if(_0x1571ab>=_0x498adf){_0x1571ab=_0x498adf;_0x1e57a6=0xc8;}else{_0x1e57a6=0xce;}_0x43e5b2[_0xbe6c('0x1b')](_0x1e57a6);return _0x43e5b2['set'](_0xbe6c('0x21'),_0x1f9c59+'-'+_0x1571ab+'/'+_0x498adf)[_0xbe6c('0x1c')](_0x1c529c);}return null;};}function patchUpdates(_0x5c430b){return function(_0x286316){try{jsonpatch[_0xbe6c('0x22')](_0x286316,_0x5c430b,!![]);}catch(_0xb5605b){return BPromise[_0xbe6c('0x23')](_0xb5605b);}return _0x286316[_0xbe6c('0x24')]();};}function saveUpdates(_0x349ee4,_0x342621){return function(_0x30fed8){if(_0x30fed8){return _0x30fed8[_0xbe6c('0x25')](_0x349ee4)[_0xbe6c('0x26')](function(_0x1ef8b1){return _0x1ef8b1;});}return null;};}function removeEntity(_0x4c7457,_0x113e37){return function(_0x6eebdb){if(_0x6eebdb){return _0x6eebdb[_0xbe6c('0x27')]()[_0xbe6c('0x26')](function(){_0x4c7457[_0xbe6c('0x1b')](0xcc)[_0xbe6c('0x28')]();});}};}function handleEntityNotFound(_0x10c334,_0x1b0a53){return function(_0x12aca4){if(!_0x12aca4){_0x10c334[_0xbe6c('0x1a')](0x194);}return _0x12aca4;};}function handleError(_0x55e140,_0x7e138e){_0x7e138e=_0x7e138e||0x1f4;return function(_0x11e8e3){logger[_0xbe6c('0x29')](_0x11e8e3[_0xbe6c('0x2a')]);if(_0x11e8e3[_0xbe6c('0x2b')]){delete _0x11e8e3[_0xbe6c('0x2b')];}_0x55e140[_0xbe6c('0x1b')](_0x7e138e)[_0xbe6c('0x2c')](_0x11e8e3);};}exports[_0xbe6c('0x2d')]=function(_0x306415,_0x577059){var _0x500774={},_0x3c5159={},_0x26c176={'count':0x0,'rows':[]};var _0x311964=_[_0xbe6c('0x2e')](db[_0xbe6c('0x2f')][_0xbe6c('0x30')],function(_0x36a9f5){return{'name':_0x36a9f5[_0xbe6c('0x31')],'type':_0x36a9f5[_0xbe6c('0x32')][_0xbe6c('0x33')]};});_0x3c5159[_0xbe6c('0x34')]=_[_0xbe6c('0x2e')](_0x311964,'name');_0x3c5159[_0xbe6c('0x35')]=_[_0xbe6c('0x36')](_0x306415[_0xbe6c('0x35')]);_0x3c5159[_0xbe6c('0x37')]=_[_0xbe6c('0x38')](_0x3c5159['model'],_0x3c5159[_0xbe6c('0x35')]);_0x500774[_0xbe6c('0x39')]=_['intersection'](_0x3c5159[_0xbe6c('0x34')],qs[_0xbe6c('0x3a')](_0x306415['query'][_0xbe6c('0x3a')]));_0x500774[_0xbe6c('0x39')]=_0x500774[_0xbe6c('0x39')]['length']?_0x500774['attributes']:_0x3c5159[_0xbe6c('0x34')];if(!_0x306415[_0xbe6c('0x35')][_0xbe6c('0x3b')](_0xbe6c('0x3c'))){_0x500774[_0xbe6c('0x1f')]=qs[_0xbe6c('0x1f')](_0x306415[_0xbe6c('0x35')][_0xbe6c('0x1f')]);_0x500774[_0xbe6c('0x1d')]=qs[_0xbe6c('0x1d')](_0x306415[_0xbe6c('0x35')][_0xbe6c('0x1d')]);}_0x500774[_0xbe6c('0x3d')]=qs[_0xbe6c('0x3e')](_0x306415['query'][_0xbe6c('0x3e')]);_0x500774['where']=qs[_0xbe6c('0x37')](_[_0xbe6c('0x3f')](_0x306415[_0xbe6c('0x35')],_0x3c5159[_0xbe6c('0x37')]),_0x311964);if(_0x306415[_0xbe6c('0x35')][_0xbe6c('0x40')]){_0x500774[_0xbe6c('0x41')]=_['merge'](_0x500774[_0xbe6c('0x41')],{'$or':_['map'](_0x311964,function(_0xcab59b){if(_0xcab59b[_0xbe6c('0x32')]!=='VIRTUAL'){var _0x14d108={};_0x14d108[_0xcab59b[_0xbe6c('0x2b')]]={'$like':'%'+_0x306415[_0xbe6c('0x35')][_0xbe6c('0x40')]+'%'};return _0x14d108;}})});}_0x500774=_['merge']({},_0x500774,_0x306415['options']);var _0x360744={'where':_0x500774['where']};return db[_0xbe6c('0x2f')][_0xbe6c('0x20')](_0x360744)['then'](function(_0x1330a3){_0x26c176[_0xbe6c('0x20')]=_0x1330a3;if(_0x306415[_0xbe6c('0x35')][_0xbe6c('0x42')]){_0x500774[_0xbe6c('0x43')]=[{'all':!![]}];}return db[_0xbe6c('0x2f')]['findAll'](_0x500774);})[_0xbe6c('0x26')](function(_0xab0a83){_0x26c176['rows']=_0xab0a83;return _0x26c176;})[_0xbe6c('0x26')](respondWithFilteredResult(_0x577059,_0x500774))[_0xbe6c('0x44')](handleError(_0x577059,null));};exports[_0xbe6c('0x45')]=function(_0x3d4b9e,_0x476a35){var _0x1b6149={'raw':![],'where':{'id':_0x3d4b9e['params']['id']}},_0x3f7adc={};_0x3f7adc[_0xbe6c('0x34')]=_[_0xbe6c('0x36')](db['ZohoAccount'][_0xbe6c('0x30')]);_0x3f7adc[_0xbe6c('0x35')]=_[_0xbe6c('0x36')](_0x3d4b9e[_0xbe6c('0x35')]);_0x3f7adc[_0xbe6c('0x37')]=_[_0xbe6c('0x38')](_0x3f7adc[_0xbe6c('0x34')],_0x3f7adc['query']);_0x1b6149[_0xbe6c('0x39')]=_['intersection'](_0x3f7adc[_0xbe6c('0x34')],qs[_0xbe6c('0x3a')](_0x3d4b9e[_0xbe6c('0x35')][_0xbe6c('0x3a')]));_0x1b6149[_0xbe6c('0x39')]=_0x1b6149[_0xbe6c('0x39')][_0xbe6c('0x46')]?_0x1b6149['attributes']:_0x3f7adc[_0xbe6c('0x34')];if(_0x3d4b9e[_0xbe6c('0x35')]['includeAll']){_0x1b6149[_0xbe6c('0x43')]=[{'all':!![]}];}_0x1b6149=_[_0xbe6c('0x47')]({},_0x1b6149,_0x3d4b9e[_0xbe6c('0x48')]);return db[_0xbe6c('0x2f')][_0xbe6c('0x49')](_0x1b6149)['then'](handleEntityNotFound(_0x476a35,null))[_0xbe6c('0x26')](respondWithResult(_0x476a35,null))[_0xbe6c('0x44')](handleError(_0x476a35,null));};exports[_0xbe6c('0x4a')]=function(_0x360794,_0x3caaef){return db['ZohoAccount'][_0xbe6c('0x4a')](_0x360794[_0xbe6c('0x4b')],{})[_0xbe6c('0x26')](respondWithResult(_0x3caaef,0xc9))[_0xbe6c('0x44')](handleError(_0x3caaef,null));};exports[_0xbe6c('0x25')]=function(_0x31ff84,_0x3ff7c4){if(_0x31ff84[_0xbe6c('0x4b')]['id']){delete _0x31ff84[_0xbe6c('0x4b')]['id'];}return db['ZohoAccount'][_0xbe6c('0x49')]({'where':{'id':_0x31ff84['params']['id']}})['then'](handleEntityNotFound(_0x3ff7c4,null))[_0xbe6c('0x26')](saveUpdates(_0x31ff84[_0xbe6c('0x4b')],null))['then'](respondWithResult(_0x3ff7c4,null))['catch'](handleError(_0x3ff7c4,null));};exports[_0xbe6c('0x27')]=function(_0x5feab9,_0x1be9fd){return db['ZohoAccount'][_0xbe6c('0x49')]({'where':{'id':_0x5feab9['params']['id']}})[_0xbe6c('0x26')](handleEntityNotFound(_0x1be9fd,null))['then'](removeEntity(_0x1be9fd,null))[_0xbe6c('0x44')](handleError(_0x1be9fd,null));};exports[_0xbe6c('0x4c')]=function(_0x3894c3,_0x1ee21d,_0x496224){var _0x1be98b={};var _0x3adc28={};var _0x52cb2e;var _0x4cb2ff;return db[_0xbe6c('0x2f')][_0xbe6c('0x4d')]({'where':{'id':_0x3894c3[_0xbe6c('0x4e')]['id']}})[_0xbe6c('0x26')](handleEntityNotFound(_0x1ee21d,null))[_0xbe6c('0x26')](function(_0x34bfe8){if(_0x34bfe8){_0x52cb2e=_0x34bfe8;_0x3adc28[_0xbe6c('0x34')]=_[_0xbe6c('0x36')](db['ZohoConfiguration'][_0xbe6c('0x30')]);_0x3adc28[_0xbe6c('0x35')]=_['keys'](_0x3894c3[_0xbe6c('0x35')]);_0x3adc28[_0xbe6c('0x37')]=_[_0xbe6c('0x38')](_0x3adc28['model'],_0x3adc28[_0xbe6c('0x35')]);_0x1be98b[_0xbe6c('0x39')]=_[_0xbe6c('0x38')](_0x3adc28[_0xbe6c('0x34')],qs[_0xbe6c('0x3a')](_0x3894c3[_0xbe6c('0x35')]['fields']));_0x1be98b[_0xbe6c('0x39')]=_0x1be98b[_0xbe6c('0x39')]['length']?_0x1be98b['attributes']:_0x3adc28[_0xbe6c('0x34')];_0x1be98b[_0xbe6c('0x3d')]=qs[_0xbe6c('0x3e')](_0x3894c3['query']['sort']);_0x1be98b[_0xbe6c('0x41')]=qs[_0xbe6c('0x37')](_[_0xbe6c('0x3f')](_0x3894c3[_0xbe6c('0x35')],_0x3adc28[_0xbe6c('0x37')]));if(_0x3894c3[_0xbe6c('0x35')][_0xbe6c('0x40')]){_0x1be98b[_0xbe6c('0x41')]=_[_0xbe6c('0x47')](_0x1be98b[_0xbe6c('0x41')],{'$or':_[_0xbe6c('0x2e')](_0x1be98b[_0xbe6c('0x39')],function(_0x381b2e){var _0x400d5a={};_0x400d5a[_0x381b2e]={'$like':'%'+_0x3894c3['query'][_0xbe6c('0x40')]+'%'};return _0x400d5a;})});}_0x1be98b=_[_0xbe6c('0x47')]({},_0x1be98b,_0x3894c3[_0xbe6c('0x48')]);return _0x52cb2e[_0xbe6c('0x4c')](_0x1be98b);}})[_0xbe6c('0x26')](function(_0x2ab681){if(_0x2ab681){_0x4cb2ff=_0x2ab681[_0xbe6c('0x46')];if(!_0x3894c3[_0xbe6c('0x35')]['hasOwnProperty'](_0xbe6c('0x3c'))){_0x1be98b[_0xbe6c('0x1f')]=qs[_0xbe6c('0x1f')](_0x3894c3[_0xbe6c('0x35')][_0xbe6c('0x1f')]);_0x1be98b[_0xbe6c('0x1d')]=qs[_0xbe6c('0x1d')](_0x3894c3['query'][_0xbe6c('0x1d')]);}return _0x52cb2e[_0xbe6c('0x4c')](_0x1be98b);}})[_0xbe6c('0x26')](function(_0x2104a3){if(_0x2104a3){return _0x2104a3?{'count':_0x4cb2ff,'rows':_0x2104a3}:null;}})['then'](respondWithResult(_0x1ee21d,null))[_0xbe6c('0x44')](handleError(_0x1ee21d,null));};exports[_0xbe6c('0x4f')]=function(_0x5b842a,_0x2f7910,_0x295f60){if(_0x5b842a[_0xbe6c('0x4b')]['id']){delete _0x5b842a[_0xbe6c('0x4b')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x5b842a['params']['id']}})[_0xbe6c('0x26')](handleEntityNotFound(_0x2f7910,null))[_0xbe6c('0x26')](function(_0x1ff771){if(_0x1ff771){_0x5b842a[_0xbe6c('0x4b')][_0xbe6c('0x50')]=_0x1ff771['id'];_0x5b842a[_0xbe6c('0x4b')][_0xbe6c('0x51')]=integrations[_0xbe6c('0x52')](_0x5b842a[_0xbe6c('0x4b')][_0xbe6c('0x53')],_0x5b842a[_0xbe6c('0x4b')]['type']);_0x5b842a[_0xbe6c('0x4b')][_0xbe6c('0x54')]=integrations['getDescriptions'](_0x5b842a['body'][_0xbe6c('0x53')],_0x5b842a[_0xbe6c('0x4b')][_0xbe6c('0x32')]);return db[_0xbe6c('0x55')][_0xbe6c('0x4a')](_0x5b842a['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0xbe6c('0x56')],'as':_0xbe6c('0x54')}]});}return null;})['then'](respondWithResult(_0x2f7910,null))[_0xbe6c('0x44')](handleError(_0x2f7910,null));};function getAccessToken(_0x32a091){return new Promise(function(_0x40519b,_0x29e627){var _0x9a526;switch(_0x32a091['zone']){case'US':_0x9a526='https://accounts.zoho.com';break;case'AU':_0x9a526=_0xbe6c('0x57');break;case'EU':_0x9a526=_0xbe6c('0x58');break;case'IN':_0x9a526=_0xbe6c('0x59');break;case'CN':_0x9a526=_0xbe6c('0x5a');break;default:_0x9a526=_0xbe6c('0x58');break;}var _0x5b72a5={'method':_0xbe6c('0x5b'),'uri':_0x9a526+_0xbe6c('0x5c'),'qs':{'refresh_token':_0x32a091[_0xbe6c('0x5d')],'client_id':_0x32a091[_0xbe6c('0x5e')],'client_secret':_0x32a091[_0xbe6c('0x5f')],'grant_type':_0xbe6c('0x60')},'json':!![]};return rp(_0x5b72a5)['then'](function(_0x22455c){if(_0x22455c[_0xbe6c('0x61')]){_0x40519b(_0x22455c[_0xbe6c('0x61')]);}else{_0x29e627(_0xbe6c('0x62'));}})['catch'](function(_0x39ea17){_0x29e627(_0x39ea17);});});}exports[_0xbe6c('0x63')]=function(_0x22893f,_0x555a96,_0x538890){var _0x94000a,_0x2566a2,_0x2723b2,_0x32ede5,_0x3b54dc;return db[_0xbe6c('0x2f')][_0xbe6c('0x4d')]({'where':{'id':_0x22893f[_0xbe6c('0x4e')]['id']},'attributes':['id','host',_0xbe6c('0x64'),'clientId',_0xbe6c('0x5f'),_0xbe6c('0x65'),_0xbe6c('0x66'),_0xbe6c('0x5d')]})[_0xbe6c('0x26')](handleEntityNotFound(_0x555a96,null))[_0xbe6c('0x26')](function(_0x34db42){_0x3b54dc=_0x34db42;_0x94000a=_0x3b54dc['host'];_0x2566a2=_0x94000a==='zoho.eu'?'eu':_0xbe6c('0x67');_0x2723b2=_0x3b54dc[_0xbe6c('0x65')];var _0x10eadd=_0x2723b2['slice'](-0x1);if(_0x10eadd==='/'||_0x10eadd==='\x5c'||_0x10eadd===':'){_0x2723b2=_0x2723b2[_0xbe6c('0x68')](0x0,_0x2723b2[_0xbe6c('0x69')](_0x10eadd));}if(!_0x3b54dc[_0xbe6c('0x5d')]){throw new Error(_0xbe6c('0x6a'));}return getAccessToken(_0x3b54dc);})[_0xbe6c('0x26')](function(_0x3f6589){if(_0x3f6589){return rp({'method':_0xbe6c('0x6b'),'uri':util[_0xbe6c('0x6c')](_0xbe6c('0x6d'),_0x2566a2),'qs':{'module':_0xbe6c('0x6e')},'headers':{'Authorization':_0xbe6c('0x6f')+_0x3f6589},'json':!![]});}})[_0xbe6c('0x26')](function(_0x5f7fc1){if(_0x5f7fc1){if(_0x5f7fc1['response']&&_0x5f7fc1[_0xbe6c('0x70')][_0xbe6c('0x29')]){throw new Error(_0x5f7fc1['response'][_0xbe6c('0x29')][_0xbe6c('0x71')]);}var _0x3db77c=[];var _0x1e4021=[];var _0x52b297=[_0xbe6c('0x72'),_0xbe6c('0x73'),_0xbe6c('0x74'),_0xbe6c('0x75'),_0xbe6c('0x76'),_0xbe6c('0x77'),_0xbe6c('0x78'),_0xbe6c('0x79')];_0x1e4021=_[_0xbe6c('0x7a')](_0x5f7fc1['fields'],function(_0x186cae){return _0x52b297[_0xbe6c('0x7b')](_0x186cae['api_name']);});for(var _0x4702b8=0x0;_0x4702b8<_0x1e4021[_0xbe6c('0x46')];_0x4702b8++){if(_0x1e4021[_0x4702b8][_0xbe6c('0x7c')]===![]){_0x3db77c[_0xbe6c('0x7d')]({'id':_0x1e4021[_0x4702b8]['id'],'name':_0x1e4021[_0x4702b8][_0xbe6c('0x7e')],'custom':_0x1e4021[_0x4702b8][_0xbe6c('0x7f')],'options':_0x1e4021[_0x4702b8]['data_type']===_0xbe6c('0x80')&&_0x1e4021[_0x4702b8][_0xbe6c('0x81')]['length']>-0x1?_[_0xbe6c('0x2e')](_0x1e4021[_0x4702b8]['pick_list_values'],function(_0x87ede9){return{'name':_0x87ede9,'value':_0x87ede9};}):[]});}}return{'count':_0x3db77c['length'],'rows':_0x3db77c};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x555a96,null))[_0xbe6c('0x44')](function(_0x27b81b){var _0x329653=_0x22893f[_0xbe6c('0x35')][_0xbe6c('0x82')]?0x1f4:_0x27b81b[_0xbe6c('0x83')]||0x1f4;logger[_0xbe6c('0x29')](_0xbe6c('0x84'),_0xbe6c('0x63'),_0x329653,JSON['stringify'](_0x27b81b));delete _0x27b81b['name'];if(_0x329653===0x191){_0x329653=0x190;}_0x555a96[_0xbe6c('0x1b')](_0x329653)['send'](_0x22893f[_0xbe6c('0x35')][_0xbe6c('0x82')]?{'message':'Wrong\x20credentials','statusCode':_0x27b81b[_0xbe6c('0x83')]}:_0x27b81b);});}; \ No newline at end of file +var _0x02fb=['where','pick','filter','merge','options','findAll','rows','catch','show','keys','includeAll','include','find','create','body','params','ZohoConfiguration','length','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','type','ZohoField','Descriptions','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','getFields','findOne','host','clientSecret','serverUrl','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','system_mandatory','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','limit','undefined','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','send','index','map','ZohoAccount','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x2cb552,_0x3807a9){var _0x16aa22=function(_0x22f99b){while(--_0x22f99b){_0x2cb552['push'](_0x2cb552['shift']());}};_0x16aa22(++_0x3807a9);}(_0x02fb,0x1b0));var _0xb02f=function(_0x7eb67f,_0x4a4d6b){_0x7eb67f=_0x7eb67f-0x0;var _0x5ce007=_0x02fb[_0x7eb67f];return _0x5ce007;};'use strict';var emlformat=require(_0xb02f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb02f('0x1'));var rp=require(_0xb02f('0x2'));var moment=require('moment');var BPromise=require(_0xb02f('0x3'));var Mustache=require(_0xb02f('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb02f('0x5'));var csv=require('to-csv');var ejs=require(_0xb02f('0x6'));var fs=require('fs');var fs_extra=require(_0xb02f('0x7'));var _=require('lodash');var squel=require(_0xb02f('0x8'));var crypto=require('crypto');var jsforce=require(_0xb02f('0x9'));var deskjs=require(_0xb02f('0xa'));var toCsv=require(_0xb02f('0xb'));var querystring=require('querystring');var Papa=require(_0xb02f('0xc'));var Redis=require('ioredis');var authService=require(_0xb02f('0xd'));var qs=require(_0xb02f('0xe'));var as=require(_0xb02f('0xf'));var hardwareService=require(_0xb02f('0x10'));var logger=require('../../config/logger')(_0xb02f('0x11'));var utils=require(_0xb02f('0x12'));var config=require(_0xb02f('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xb02f('0x14'));function respondWithStatusCode(_0x1f15e7,_0xbdfd24){_0xbdfd24=_0xbdfd24||0xcc;return function(_0x29e302){if(_0x29e302){return _0x1f15e7[_0xb02f('0x15')](_0xbdfd24);}return _0x1f15e7[_0xb02f('0x16')](_0xbdfd24)['end']();};}function respondWithResult(_0x257958,_0x4b0e89){_0x4b0e89=_0x4b0e89||0xc8;return function(_0xac9fa){if(_0xac9fa){return _0x257958['status'](_0x4b0e89)['json'](_0xac9fa);}};}function respondWithFilteredResult(_0x47e40e,_0x29d96d){return function(_0x335a27){if(_0x335a27){var _0x4d35e8=typeof _0x29d96d['offset']==='undefined'&&typeof _0x29d96d[_0xb02f('0x17')]===_0xb02f('0x18');var _0x8c2952=_0x335a27[_0xb02f('0x19')];var _0x440aa8=_0x4d35e8?0x0:_0x29d96d[_0xb02f('0x1a')];var _0x1a67f1=_0x4d35e8?_0x335a27[_0xb02f('0x19')]:_0x29d96d[_0xb02f('0x1a')]+_0x29d96d[_0xb02f('0x17')];var _0x436cd9;if(_0x1a67f1>=_0x8c2952){_0x1a67f1=_0x8c2952;_0x436cd9=0xc8;}else{_0x436cd9=0xce;}_0x47e40e[_0xb02f('0x16')](_0x436cd9);return _0x47e40e[_0xb02f('0x1b')](_0xb02f('0x1c'),_0x440aa8+'-'+_0x1a67f1+'/'+_0x8c2952)['json'](_0x335a27);}return null;};}function patchUpdates(_0x8b38ec){return function(_0x1df072){try{jsonpatch[_0xb02f('0x1d')](_0x1df072,_0x8b38ec,!![]);}catch(_0x327bd9){return BPromise['reject'](_0x327bd9);}return _0x1df072[_0xb02f('0x1e')]();};}function saveUpdates(_0x317d1e,_0x5b2d51){return function(_0x5ac62f){if(_0x5ac62f){return _0x5ac62f['update'](_0x317d1e)[_0xb02f('0x1f')](function(_0x24bd5a){return _0x24bd5a;});}return null;};}function removeEntity(_0x2f686e,_0x1c4b51){return function(_0x3abb22){if(_0x3abb22){return _0x3abb22[_0xb02f('0x20')]()[_0xb02f('0x1f')](function(){_0x2f686e[_0xb02f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x912dc,_0x4708f8){return function(_0x1935b0){if(!_0x1935b0){_0x912dc[_0xb02f('0x15')](0x194);}return _0x1935b0;};}function handleError(_0x1f8efb,_0x5115cf){_0x5115cf=_0x5115cf||0x1f4;return function(_0x6a7b60){logger[_0xb02f('0x21')](_0x6a7b60[_0xb02f('0x22')]);if(_0x6a7b60['name']){delete _0x6a7b60['name'];}_0x1f8efb[_0xb02f('0x16')](_0x5115cf)[_0xb02f('0x23')](_0x6a7b60);};}exports[_0xb02f('0x24')]=function(_0xa290e9,_0x4bf65a){var _0x2bb442={},_0x4c9fae={},_0x56a2e6={'count':0x0,'rows':[]};var _0x302282=_[_0xb02f('0x25')](db[_0xb02f('0x26')][_0xb02f('0x27')],function(_0x4c7848){return{'name':_0x4c7848[_0xb02f('0x28')],'type':_0x4c7848['type'][_0xb02f('0x29')]};});_0x4c9fae[_0xb02f('0x2a')]=_[_0xb02f('0x25')](_0x302282,_0xb02f('0x2b'));_0x4c9fae[_0xb02f('0x2c')]=_['keys'](_0xa290e9[_0xb02f('0x2c')]);_0x4c9fae[_0xb02f('0x2d')]=_[_0xb02f('0x2e')](_0x4c9fae['model'],_0x4c9fae['query']);_0x2bb442[_0xb02f('0x2f')]=_[_0xb02f('0x2e')](_0x4c9fae[_0xb02f('0x2a')],qs[_0xb02f('0x30')](_0xa290e9[_0xb02f('0x2c')][_0xb02f('0x30')]));_0x2bb442[_0xb02f('0x2f')]=_0x2bb442[_0xb02f('0x2f')]['length']?_0x2bb442[_0xb02f('0x2f')]:_0x4c9fae[_0xb02f('0x2a')];if(!_0xa290e9[_0xb02f('0x2c')][_0xb02f('0x31')](_0xb02f('0x32'))){_0x2bb442['limit']=qs['limit'](_0xa290e9['query'][_0xb02f('0x17')]);_0x2bb442[_0xb02f('0x1a')]=qs[_0xb02f('0x1a')](_0xa290e9[_0xb02f('0x2c')]['offset']);}_0x2bb442['order']=qs[_0xb02f('0x33')](_0xa290e9[_0xb02f('0x2c')][_0xb02f('0x33')]);_0x2bb442[_0xb02f('0x34')]=qs[_0xb02f('0x2d')](_[_0xb02f('0x35')](_0xa290e9[_0xb02f('0x2c')],_0x4c9fae['filters']),_0x302282);if(_0xa290e9[_0xb02f('0x2c')][_0xb02f('0x36')]){_0x2bb442[_0xb02f('0x34')]=_[_0xb02f('0x37')](_0x2bb442[_0xb02f('0x34')],{'$or':_[_0xb02f('0x25')](_0x302282,function(_0x51d49f){if(_0x51d49f['type']!=='VIRTUAL'){var _0x12379f={};_0x12379f[_0x51d49f['name']]={'$like':'%'+_0xa290e9['query'][_0xb02f('0x36')]+'%'};return _0x12379f;}})});}_0x2bb442=_[_0xb02f('0x37')]({},_0x2bb442,_0xa290e9[_0xb02f('0x38')]);var _0x42712e={'where':_0x2bb442['where']};return db[_0xb02f('0x26')][_0xb02f('0x19')](_0x42712e)[_0xb02f('0x1f')](function(_0x50ecaf){_0x56a2e6[_0xb02f('0x19')]=_0x50ecaf;if(_0xa290e9['query']['includeAll']){_0x2bb442['include']=[{'all':!![]}];}return db[_0xb02f('0x26')][_0xb02f('0x39')](_0x2bb442);})[_0xb02f('0x1f')](function(_0x49550e){_0x56a2e6[_0xb02f('0x3a')]=_0x49550e;return _0x56a2e6;})[_0xb02f('0x1f')](respondWithFilteredResult(_0x4bf65a,_0x2bb442))[_0xb02f('0x3b')](handleError(_0x4bf65a,null));};exports[_0xb02f('0x3c')]=function(_0x4e858d,_0x55ce1e){var _0x83b735={'raw':![],'where':{'id':_0x4e858d['params']['id']}},_0x5d1f7e={};_0x5d1f7e[_0xb02f('0x2a')]=_['keys'](db['ZohoAccount'][_0xb02f('0x27')]);_0x5d1f7e[_0xb02f('0x2c')]=_[_0xb02f('0x3d')](_0x4e858d[_0xb02f('0x2c')]);_0x5d1f7e[_0xb02f('0x2d')]=_[_0xb02f('0x2e')](_0x5d1f7e[_0xb02f('0x2a')],_0x5d1f7e[_0xb02f('0x2c')]);_0x83b735['attributes']=_[_0xb02f('0x2e')](_0x5d1f7e['model'],qs[_0xb02f('0x30')](_0x4e858d[_0xb02f('0x2c')]['fields']));_0x83b735[_0xb02f('0x2f')]=_0x83b735[_0xb02f('0x2f')]['length']?_0x83b735['attributes']:_0x5d1f7e[_0xb02f('0x2a')];if(_0x4e858d[_0xb02f('0x2c')][_0xb02f('0x3e')]){_0x83b735[_0xb02f('0x3f')]=[{'all':!![]}];}_0x83b735=_[_0xb02f('0x37')]({},_0x83b735,_0x4e858d[_0xb02f('0x38')]);return db[_0xb02f('0x26')][_0xb02f('0x40')](_0x83b735)[_0xb02f('0x1f')](handleEntityNotFound(_0x55ce1e,null))[_0xb02f('0x1f')](respondWithResult(_0x55ce1e,null))[_0xb02f('0x3b')](handleError(_0x55ce1e,null));};exports[_0xb02f('0x41')]=function(_0x4c1f85,_0x161d72){return db[_0xb02f('0x26')]['create'](_0x4c1f85['body'],{})[_0xb02f('0x1f')](respondWithResult(_0x161d72,0xc9))['catch'](handleError(_0x161d72,null));};exports['update']=function(_0xdf3168,_0x48b748){if(_0xdf3168['body']['id']){delete _0xdf3168['body']['id'];}return db[_0xb02f('0x26')][_0xb02f('0x40')]({'where':{'id':_0xdf3168['params']['id']}})[_0xb02f('0x1f')](handleEntityNotFound(_0x48b748,null))[_0xb02f('0x1f')](saveUpdates(_0xdf3168[_0xb02f('0x42')],null))[_0xb02f('0x1f')](respondWithResult(_0x48b748,null))[_0xb02f('0x3b')](handleError(_0x48b748,null));};exports[_0xb02f('0x20')]=function(_0x2f4aab,_0x454b30){return db[_0xb02f('0x26')][_0xb02f('0x40')]({'where':{'id':_0x2f4aab[_0xb02f('0x43')]['id']}})['then'](handleEntityNotFound(_0x454b30,null))[_0xb02f('0x1f')](removeEntity(_0x454b30,null))[_0xb02f('0x3b')](handleError(_0x454b30,null));};exports['getConfigurations']=function(_0x5635d3,_0x3f22f9,_0x2c7a47){var _0x557fd5={};var _0x2a1a5a={};var _0x739aa7;var _0x27f24b;return db['ZohoAccount']['findOne']({'where':{'id':_0x5635d3[_0xb02f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f22f9,null))[_0xb02f('0x1f')](function(_0x1665de){if(_0x1665de){_0x739aa7=_0x1665de;_0x2a1a5a['model']=_[_0xb02f('0x3d')](db[_0xb02f('0x44')][_0xb02f('0x27')]);_0x2a1a5a['query']=_[_0xb02f('0x3d')](_0x5635d3['query']);_0x2a1a5a[_0xb02f('0x2d')]=_[_0xb02f('0x2e')](_0x2a1a5a[_0xb02f('0x2a')],_0x2a1a5a['query']);_0x557fd5[_0xb02f('0x2f')]=_[_0xb02f('0x2e')](_0x2a1a5a[_0xb02f('0x2a')],qs['fields'](_0x5635d3[_0xb02f('0x2c')]['fields']));_0x557fd5['attributes']=_0x557fd5['attributes'][_0xb02f('0x45')]?_0x557fd5['attributes']:_0x2a1a5a[_0xb02f('0x2a')];_0x557fd5[_0xb02f('0x46')]=qs[_0xb02f('0x33')](_0x5635d3[_0xb02f('0x2c')]['sort']);_0x557fd5[_0xb02f('0x34')]=qs[_0xb02f('0x2d')](_[_0xb02f('0x35')](_0x5635d3[_0xb02f('0x2c')],_0x2a1a5a[_0xb02f('0x2d')]));if(_0x5635d3[_0xb02f('0x2c')][_0xb02f('0x36')]){_0x557fd5[_0xb02f('0x34')]=_[_0xb02f('0x37')](_0x557fd5['where'],{'$or':_[_0xb02f('0x25')](_0x557fd5['attributes'],function(_0x430d2a){var _0x1624a4={};_0x1624a4[_0x430d2a]={'$like':'%'+_0x5635d3[_0xb02f('0x2c')]['filter']+'%'};return _0x1624a4;})});}_0x557fd5=_['merge']({},_0x557fd5,_0x5635d3['options']);return _0x739aa7[_0xb02f('0x47')](_0x557fd5);}})['then'](function(_0x24258a){if(_0x24258a){_0x27f24b=_0x24258a[_0xb02f('0x45')];if(!_0x5635d3[_0xb02f('0x2c')][_0xb02f('0x31')](_0xb02f('0x32'))){_0x557fd5[_0xb02f('0x17')]=qs[_0xb02f('0x17')](_0x5635d3['query'][_0xb02f('0x17')]);_0x557fd5[_0xb02f('0x1a')]=qs[_0xb02f('0x1a')](_0x5635d3[_0xb02f('0x2c')][_0xb02f('0x1a')]);}return _0x739aa7[_0xb02f('0x47')](_0x557fd5);}})['then'](function(_0x1045c9){if(_0x1045c9){return _0x1045c9?{'count':_0x27f24b,'rows':_0x1045c9}:null;}})[_0xb02f('0x1f')](respondWithResult(_0x3f22f9,null))[_0xb02f('0x3b')](handleError(_0x3f22f9,null));};exports[_0xb02f('0x48')]=function(_0x498926,_0x1a9a8f,_0x54bfd1){if(_0x498926[_0xb02f('0x42')]['id']){delete _0x498926[_0xb02f('0x42')]['id'];}return db[_0xb02f('0x26')]['findOne']({'where':{'id':_0x498926[_0xb02f('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a9a8f,null))[_0xb02f('0x1f')](function(_0x3cd7fb){if(_0x3cd7fb){_0x498926[_0xb02f('0x42')][_0xb02f('0x49')]=_0x3cd7fb['id'];_0x498926[_0xb02f('0x42')][_0xb02f('0x4a')]=integrations[_0xb02f('0x4b')](_0x498926[_0xb02f('0x42')]['channel'],_0x498926[_0xb02f('0x42')]['type']);_0x498926[_0xb02f('0x42')]['Descriptions']=integrations['getDescriptions'](_0x498926['body']['channel'],_0x498926[_0xb02f('0x42')][_0xb02f('0x4c')]);return db[_0xb02f('0x44')][_0xb02f('0x41')](_0x498926['body'],{'include':[{'model':db[_0xb02f('0x4d')],'as':'Subjects'},{'model':db[_0xb02f('0x4d')],'as':_0xb02f('0x4e')}]});}return null;})[_0xb02f('0x1f')](respondWithResult(_0x1a9a8f,null))[_0xb02f('0x3b')](handleError(_0x1a9a8f,null));};function getAccessToken(_0x4457c3){return new Promise(function(_0x551cbb,_0x5c7648){var _0x259ade;switch(_0x4457c3[_0xb02f('0x4f')]){case'US':_0x259ade='https://accounts.zoho.com';break;case'AU':_0x259ade=_0xb02f('0x50');break;case'EU':_0x259ade='https://accounts.zoho.eu';break;case'IN':_0x259ade=_0xb02f('0x51');break;case'CN':_0x259ade='https://accounts.zoho.com.cn';break;default:_0x259ade=_0xb02f('0x52');break;}var _0x4780b7={'method':_0xb02f('0x53'),'uri':_0x259ade+_0xb02f('0x54'),'qs':{'refresh_token':_0x4457c3[_0xb02f('0x55')],'client_id':_0x4457c3[_0xb02f('0x56')],'client_secret':_0x4457c3['clientSecret'],'grant_type':_0xb02f('0x57')},'json':!![]};return rp(_0x4780b7)['then'](function(_0x3e1464){if(_0x3e1464['access_token']){_0x551cbb(_0x3e1464[_0xb02f('0x58')]);}else{_0x5c7648('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xb02f('0x3b')](function(_0x472464){_0x5c7648(_0x472464);});});}exports[_0xb02f('0x59')]=function(_0x5bfef9,_0x4655c6,_0x495e03){var _0x49c8b6,_0x177ebf,_0x4c1ddc,_0x1bb145,_0x55c985;return db[_0xb02f('0x26')][_0xb02f('0x5a')]({'where':{'id':_0x5bfef9[_0xb02f('0x43')]['id']},'attributes':['id',_0xb02f('0x5b'),_0xb02f('0x4f'),'clientId',_0xb02f('0x5c'),_0xb02f('0x5d'),'code',_0xb02f('0x55')]})[_0xb02f('0x1f')](handleEntityNotFound(_0x4655c6,null))[_0xb02f('0x1f')](function(_0x5eda90){_0x55c985=_0x5eda90;_0x49c8b6=_0x55c985[_0xb02f('0x5b')];_0x177ebf=_0x49c8b6===_0xb02f('0x5e')?'eu':_0xb02f('0x5f');_0x4c1ddc=_0x55c985[_0xb02f('0x5d')];var _0x33a96a=_0x4c1ddc[_0xb02f('0x60')](-0x1);if(_0x33a96a==='/'||_0x33a96a==='\x5c'||_0x33a96a===':'){_0x4c1ddc=_0x4c1ddc['substring'](0x0,_0x4c1ddc[_0xb02f('0x61')](_0x33a96a));}if(!_0x55c985[_0xb02f('0x55')]){throw new Error(_0xb02f('0x62'));}return getAccessToken(_0x55c985);})['then'](function(_0x2c3a7a){if(_0x2c3a7a){return rp({'method':'GET','uri':util[_0xb02f('0x63')](_0xb02f('0x64'),_0x177ebf),'qs':{'module':_0xb02f('0x65')},'headers':{'Authorization':_0xb02f('0x66')+_0x2c3a7a},'json':!![]});}})['then'](function(_0x390372){if(_0x390372){if(_0x390372['response']&&_0x390372[_0xb02f('0x67')][_0xb02f('0x21')]){throw new Error(_0x390372[_0xb02f('0x67')]['error'][_0xb02f('0x68')]);}var _0x5f5ca0=[];var _0x33e0e4=[];var _0x2b21d6=['Owner',_0xb02f('0x69'),'Description',_0xb02f('0x6a'),_0xb02f('0x6b'),_0xb02f('0x6c'),_0xb02f('0x6d'),'Call_Type'];_0x33e0e4=_[_0xb02f('0x6e')](_0x390372[_0xb02f('0x30')],function(_0x58f941){return _0x2b21d6[_0xb02f('0x6f')](_0x58f941['api_name']);});for(var _0x4e5790=0x0;_0x4e5790<_0x33e0e4[_0xb02f('0x45')];_0x4e5790++){if(_0x33e0e4[_0x4e5790][_0xb02f('0x70')]===![]){_0x5f5ca0['push']({'id':_0x33e0e4[_0x4e5790]['id'],'name':_0x33e0e4[_0x4e5790][_0xb02f('0x71')],'custom':_0x33e0e4[_0x4e5790]['custom_field'],'options':_0x33e0e4[_0x4e5790][_0xb02f('0x72')]===_0xb02f('0x73')&&_0x33e0e4[_0x4e5790]['pick_list_values']['length']>-0x1?_[_0xb02f('0x25')](_0x33e0e4[_0x4e5790][_0xb02f('0x74')],function(_0x2fe114){return{'name':_0x2fe114,'value':_0x2fe114};}):[]});}}return{'count':_0x5f5ca0[_0xb02f('0x45')],'rows':_0x5f5ca0};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4655c6,null))[_0xb02f('0x3b')](function(_0x3c55c4){var _0x3a9479=_0x5bfef9[_0xb02f('0x2c')][_0xb02f('0x75')]?0x1f4:_0x3c55c4[_0xb02f('0x76')]||0x1f4;logger[_0xb02f('0x21')](_0xb02f('0x77'),_0xb02f('0x59'),_0x3a9479,JSON['stringify'](_0x3c55c4));delete _0x3c55c4['name'];if(_0x3a9479===0x191){_0x3a9479=0x190;}_0x4655c6['status'](_0x3a9479)['send'](_0x5bfef9[_0xb02f('0x2c')][_0xb02f('0x75')]?{'message':_0xb02f('0x78'),'statusCode':_0x3c55c4[_0xb02f('0x76')]}:_0x3c55c4);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index da5e8d5..c573759 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 _0xb05c=['parse','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','refresh_token','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then'];(function(_0x54c85e,_0x2c3a6e){var _0x170bcf=function(_0x354b69){while(--_0x354b69){_0x54c85e['push'](_0x54c85e['shift']());}};_0x170bcf(++_0x2c3a6e);}(_0xb05c,0x93));var _0xcb05=function(_0x14686a,_0x540f0d){_0x14686a=_0x14686a-0x0;var _0xeafc86=_0xb05c[_0x14686a];return _0xeafc86;};'use strict';var _=require(_0xcb05('0x0'));var util=require(_0xcb05('0x1'));var logger=require(_0xcb05('0x2'))(_0xcb05('0x3'));var moment=require(_0xcb05('0x4'));var BPromise=require(_0xcb05('0x5'));var rp=require(_0xcb05('0x6'));var fs=require('fs');var path=require(_0xcb05('0x7'));var rimraf=require(_0xcb05('0x8'));var config=require(_0xcb05('0x9'));var attributes=require(_0xcb05('0xa'));var integrations=require(_0xcb05('0xb'));module[_0xcb05('0xc')]=function(_0x2394c1,_0xf04f08){return _0x2394c1[_0xcb05('0xd')](_0xcb05('0xe'),attributes,{'tableName':_0xcb05('0xf'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x32c6e1,_0x5b22ca,_0x1d69b1){if(_0x32c6e1[_0xcb05('0x10')](_0xcb05('0x11'))||_0x32c6e1[_0xcb05('0x10')](_0xcb05('0x12'))||_0x32c6e1[_0xcb05('0x10')](_0xcb05('0x13'))||_0x32c6e1['changed'](_0xcb05('0x14'))||_0x32c6e1['changed']('code')||_0x32c6e1[_0xcb05('0x10')]('host')){var _0x5c1b18,_0x14cc15;_0x5c1b18=_0x32c6e1[_0xcb05('0x12')];var _0xd368f0=_0x5c1b18[_0xcb05('0x15')](-0x1);if(_0xd368f0==='/'||_0xd368f0==='\x5c'||_0xd368f0===':'){_0x5c1b18=_0x5c1b18[_0xcb05('0x16')](0x0,_0x5c1b18[_0xcb05('0x17')](_0xd368f0));}switch(_0x32c6e1['zone']){case'US':_0x14cc15=_0xcb05('0x18');break;case'AU':_0x14cc15=_0xcb05('0x19');break;case'IN':_0x14cc15='https://accounts.zoho.in';break;case'CN':_0x14cc15='https://accounts.zoho.com.cn';break;default:_0x14cc15=_0xcb05('0x1a');break;}var _0x18efed={'method':_0xcb05('0x1b'),'uri':_0x14cc15+_0xcb05('0x1c'),'form':{'grant_type':_0xcb05('0x1d'),'client_id':_0x32c6e1[_0xcb05('0x13')],'client_secret':_0x32c6e1[_0xcb05('0x14')],'redirect_uri':_0x32c6e1[_0xcb05('0x12')],'code':_0x32c6e1[_0xcb05('0x1e')]},'headers':{'Content-Type':_0xcb05('0x1f')}};return rp(_0x18efed)[_0xcb05('0x20')](function(_0x546d7e){var _0x508fb5=JSON[_0xcb05('0x21')](_0x546d7e);if(_0x508fb5['refresh_token']){_0x32c6e1[_0xcb05('0x22')]=_0x508fb5['refresh_token'];logger[_0xcb05('0x23')](util[_0xcb05('0x24')](_0xcb05('0x25'),_0x32c6e1[_0xcb05('0x26')],_0x32c6e1['id']));}else{logger[_0xcb05('0x27')](util[_0xcb05('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x32c6e1[_0xcb05('0x26')],_0x32c6e1['id']),util[_0xcb05('0x28')](_0x508fb5,{'showHidden':![],'depth':null}));}return _0x1d69b1(null,_0x5b22ca);})[_0xcb05('0x29')](function(_0x22c1e9){logger['error'](util[_0xcb05('0x24')](_0xcb05('0x2a'),_0x32c6e1[_0xcb05('0x26')],_0x32c6e1['id']),util[_0xcb05('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x1d69b1(_0x22c1e9);});}else{return _0x1d69b1(null,_0x5b22ca);}},'beforeUpdate':function(_0x4cc1fc,_0x5852a0,_0x536a7e){if(_0x4cc1fc[_0xcb05('0x10')](_0xcb05('0x11'))||_0x4cc1fc[_0xcb05('0x10')](_0xcb05('0x12'))||_0x4cc1fc[_0xcb05('0x10')]('clientId')||_0x4cc1fc[_0xcb05('0x10')](_0xcb05('0x14'))||_0x4cc1fc[_0xcb05('0x10')](_0xcb05('0x1e'))||_0x4cc1fc[_0xcb05('0x10')](_0xcb05('0x2b'))){var _0x3afe85,_0x185631;_0x3afe85=_0x4cc1fc[_0xcb05('0x12')];var _0x2537d6=_0x3afe85['slice'](-0x1);if(_0x2537d6==='/'||_0x2537d6==='\x5c'||_0x2537d6===':'){_0x3afe85=_0x3afe85['substring'](0x0,_0x3afe85[_0xcb05('0x17')](_0x2537d6));}switch(_0x4cc1fc['zone']){case'US':_0x185631=_0xcb05('0x18');break;case'AU':_0x185631='https://accounts.zoho.com.au';break;case'IN':_0x185631='https://accounts.zoho.in';break;case'CN':_0x185631='https://accounts.zoho.com.cn';break;default:_0x185631=_0xcb05('0x1a');break;}var _0x15a1e4={'method':'POST','uri':_0x185631+_0xcb05('0x1c'),'form':{'grant_type':_0xcb05('0x1d'),'client_id':_0x4cc1fc[_0xcb05('0x13')],'client_secret':_0x4cc1fc[_0xcb05('0x14')],'redirect_uri':_0x4cc1fc[_0xcb05('0x12')],'code':_0x4cc1fc[_0xcb05('0x1e')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x15a1e4)[_0xcb05('0x20')](function(_0x46b638){var _0x42d1c0=JSON[_0xcb05('0x21')](_0x46b638);if(_0x42d1c0['refresh_token']){_0x4cc1fc[_0xcb05('0x22')]=_0x42d1c0[_0xcb05('0x2c')];logger[_0xcb05('0x23')](util['format'](_0xcb05('0x25'),_0x4cc1fc[_0xcb05('0x26')],_0x4cc1fc['id']));}else{logger['error'](util['format'](_0xcb05('0x2a'),_0x4cc1fc[_0xcb05('0x26')],_0x4cc1fc['id']),util[_0xcb05('0x28')](_0x42d1c0,{'showHidden':![],'depth':null}));}return _0x536a7e(null,_0x5852a0);})[_0xcb05('0x29')](function(_0x441a66){logger[_0xcb05('0x27')](util[_0xcb05('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4cc1fc[_0xcb05('0x26')],_0x4cc1fc['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x536a7e(_0x441a66);});}else{return _0x536a7e(null,_0x5852a0);}}}});}; \ No newline at end of file +var _0x8e34=['ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.com.au','catch','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','then','parse','refresh_token','refreshToken','info','format'];(function(_0x44a5dc,_0x4005f1){var _0x369c18=function(_0x5a2994){while(--_0x5a2994){_0x44a5dc['push'](_0x44a5dc['shift']());}};_0x369c18(++_0x4005f1);}(_0x8e34,0x1bf));var _0x48e3=function(_0x4449e4,_0x4c63ca){_0x4449e4=_0x4449e4-0x0;var _0x5a23d9=_0x8e34[_0x4449e4];return _0x5a23d9;};'use strict';var _=require(_0x48e3('0x0'));var util=require('util');var logger=require(_0x48e3('0x1'))('api');var moment=require(_0x48e3('0x2'));var BPromise=require(_0x48e3('0x3'));var rp=require(_0x48e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48e3('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x48e3('0x6'));module[_0x48e3('0x7')]=function(_0x1327a2,_0x2e57b8){return _0x1327a2[_0x48e3('0x8')]('ZohoAccount',attributes,{'tableName':_0x48e3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x277dfc,_0x5078fb,_0x243b19){if(_0x277dfc['changed']('zone')||_0x277dfc[_0x48e3('0xa')](_0x48e3('0xb'))||_0x277dfc[_0x48e3('0xa')](_0x48e3('0xc'))||_0x277dfc[_0x48e3('0xa')](_0x48e3('0xd'))||_0x277dfc[_0x48e3('0xa')]('code')||_0x277dfc[_0x48e3('0xa')](_0x48e3('0xe'))){var _0x5c899c,_0x22e40b;_0x5c899c=_0x277dfc['serverUrl'];var _0x32c977=_0x5c899c[_0x48e3('0xf')](-0x1);if(_0x32c977==='/'||_0x32c977==='\x5c'||_0x32c977===':'){_0x5c899c=_0x5c899c[_0x48e3('0x10')](0x0,_0x5c899c[_0x48e3('0x11')](_0x32c977));}switch(_0x277dfc[_0x48e3('0x12')]){case'US':_0x22e40b=_0x48e3('0x13');break;case'AU':_0x22e40b='https://accounts.zoho.com.au';break;case'IN':_0x22e40b=_0x48e3('0x14');break;case'CN':_0x22e40b=_0x48e3('0x15');break;default:_0x22e40b=_0x48e3('0x16');break;}var _0x310081={'method':_0x48e3('0x17'),'uri':_0x22e40b+_0x48e3('0x18'),'form':{'grant_type':_0x48e3('0x19'),'client_id':_0x277dfc[_0x48e3('0xc')],'client_secret':_0x277dfc['clientSecret'],'redirect_uri':_0x277dfc[_0x48e3('0xb')],'code':_0x277dfc[_0x48e3('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x310081)[_0x48e3('0x1b')](function(_0x1f9f2d){var _0x201d8c=JSON[_0x48e3('0x1c')](_0x1f9f2d);if(_0x201d8c[_0x48e3('0x1d')]){_0x277dfc[_0x48e3('0x1e')]=_0x201d8c[_0x48e3('0x1d')];logger[_0x48e3('0x1f')](util[_0x48e3('0x20')](_0x48e3('0x21'),_0x277dfc[_0x48e3('0x22')],_0x277dfc['id']));}else{logger[_0x48e3('0x23')](util[_0x48e3('0x20')](_0x48e3('0x24'),_0x277dfc[_0x48e3('0x22')],_0x277dfc['id']),util[_0x48e3('0x25')](_0x201d8c,{'showHidden':![],'depth':null}));}return _0x243b19(null,_0x5078fb);})['catch'](function(_0x894072){logger[_0x48e3('0x23')](util[_0x48e3('0x20')](_0x48e3('0x24'),_0x277dfc['name'],_0x277dfc['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x243b19(_0x894072);});}else{return _0x243b19(null,_0x5078fb);}},'beforeUpdate':function(_0x366dcb,_0x2ff61f,_0x1e0275){if(_0x366dcb[_0x48e3('0xa')](_0x48e3('0x12'))||_0x366dcb[_0x48e3('0xa')](_0x48e3('0xb'))||_0x366dcb[_0x48e3('0xa')](_0x48e3('0xc'))||_0x366dcb[_0x48e3('0xa')](_0x48e3('0xd'))||_0x366dcb[_0x48e3('0xa')](_0x48e3('0x1a'))||_0x366dcb[_0x48e3('0xa')]('host')){var _0x43fae8,_0x2b66a4;_0x43fae8=_0x366dcb['serverUrl'];var _0x312399=_0x43fae8[_0x48e3('0xf')](-0x1);if(_0x312399==='/'||_0x312399==='\x5c'||_0x312399===':'){_0x43fae8=_0x43fae8[_0x48e3('0x10')](0x0,_0x43fae8[_0x48e3('0x11')](_0x312399));}switch(_0x366dcb[_0x48e3('0x12')]){case'US':_0x2b66a4=_0x48e3('0x13');break;case'AU':_0x2b66a4=_0x48e3('0x26');break;case'IN':_0x2b66a4=_0x48e3('0x14');break;case'CN':_0x2b66a4=_0x48e3('0x15');break;default:_0x2b66a4=_0x48e3('0x16');break;}var _0x402196={'method':_0x48e3('0x17'),'uri':_0x2b66a4+_0x48e3('0x18'),'form':{'grant_type':_0x48e3('0x19'),'client_id':_0x366dcb[_0x48e3('0xc')],'client_secret':_0x366dcb[_0x48e3('0xd')],'redirect_uri':_0x366dcb[_0x48e3('0xb')],'code':_0x366dcb[_0x48e3('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x402196)[_0x48e3('0x1b')](function(_0x94ae01){var _0x1b76e9=JSON[_0x48e3('0x1c')](_0x94ae01);if(_0x1b76e9[_0x48e3('0x1d')]){_0x366dcb[_0x48e3('0x1e')]=_0x1b76e9[_0x48e3('0x1d')];logger[_0x48e3('0x1f')](util[_0x48e3('0x20')](_0x48e3('0x21'),_0x366dcb[_0x48e3('0x22')],_0x366dcb['id']));}else{logger[_0x48e3('0x23')](util[_0x48e3('0x20')](_0x48e3('0x24'),_0x366dcb[_0x48e3('0x22')],_0x366dcb['id']),util[_0x48e3('0x25')](_0x1b76e9,{'showHidden':![],'depth':null}));}return _0x1e0275(null,_0x2ff61f);})[_0x48e3('0x27')](function(_0x321b48){logger[_0x48e3('0x23')](util[_0x48e3('0x20')](_0x48e3('0x24'),_0x366dcb[_0x48e3('0x22')],_0x366dcb['id']),util[_0x48e3('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1e0275(_0x321b48);});}else{return _0x1e0275(null,_0x2ff61f);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index aebc12c..479fa7e 100644 --- a/server/api/intZohoAccount/intZohoAccount.rpc.js +++ b/server/api/intZohoAccount/intZohoAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48ac=['../../config/environment','jayson/promise','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','catch','find','where','ShowZohoAccount','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x49536b,_0x2abe5d){var _0x30de59=function(_0xb848e3){while(--_0xb848e3){_0x49536b['push'](_0x49536b['shift']());}};_0x30de59(++_0x2abe5d);}(_0x48ac,0xe0));var _0xc48a=function(_0x162113,_0x53a417){_0x162113=_0x162113-0x0;var _0x13c897=_0x48ac[_0x162113];return _0x13c897;};'use strict';var _=require('lodash');var util=require(_0xc48a('0x0'));var moment=require('moment');var BPromise=require(_0xc48a('0x1'));var rs=require(_0xc48a('0x2'));var fs=require('fs');var Redis=require(_0xc48a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc48a('0x4'));var logger=require(_0xc48a('0x5'))(_0xc48a('0x6'));var config=require(_0xc48a('0x7'));var jayson=require(_0xc48a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5df462,_0x5cffd4,_0x1e1e1a){return new BPromise(function(_0xf0c31b,_0x2c3285){return client['request'](_0x5df462,_0x1e1e1a)[_0xc48a('0x9')](function(_0x43461a){logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,_0xc48a('0xc'));logger[_0xc48a('0xd')](_0xc48a('0xe'),_0x5cffd4,_0xc48a('0xc'),JSON[_0xc48a('0xf')](_0x43461a));if(_0x43461a[_0xc48a('0x10')]){if(_0x43461a[_0xc48a('0x10')]['code']===0x1f4){logger[_0xc48a('0x10')](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')]['message']);return _0x2c3285(_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);}logger['error'](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);return _0xf0c31b(_0x43461a['error'][_0xc48a('0x11')]);}else{logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,'request\x20sent');_0xf0c31b(_0x43461a[_0xc48a('0x12')][_0xc48a('0x11')]);}})['catch'](function(_0x5c319b){logger[_0xc48a('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x5cffd4,_0x5c319b);_0x2c3285(_0x5c319b);});});}exports[_0xc48a('0x13')]=function(_0x29a1ad){var _0x188549=this;return new Promise(function(_0x462102,_0x25e389){return db[_0xc48a('0x14')][_0xc48a('0x15')]({'raw':_0x29a1ad['options']?_0x29a1ad[_0xc48a('0x16')][_0xc48a('0x17')]===undefined?!![]:![]:!![],'where':_0x29a1ad['options']?_0x29a1ad[_0xc48a('0x16')]['where']||null:null,'attributes':_0x29a1ad[_0xc48a('0x16')]?_0x29a1ad['options'][_0xc48a('0x18')]||null:null,'limit':_0x29a1ad[_0xc48a('0x16')]?_0x29a1ad[_0xc48a('0x16')][_0xc48a('0x19')]||null:null,'include':_0x29a1ad[_0xc48a('0x16')]?_0x29a1ad[_0xc48a('0x16')][_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x29a1ad[_0xc48a('0x16')][_0xc48a('0x1a')],function(_0x112874){return{'model':db[_0x112874['model']],'as':_0x112874['as'],'attributes':_0x112874['attributes'],'include':_0x112874[_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x112874[_0xc48a('0x1a')],function(_0x1e3618){return{'model':db[_0x1e3618['model']],'as':_0x1e3618['as'],'attributes':_0x1e3618['attributes'],'include':_0x1e3618[_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x1e3618[_0xc48a('0x1a')],function(_0x4ecdaf){return{'model':db[_0x4ecdaf[_0xc48a('0x1c')]],'as':_0x4ecdaf['as'],'attributes':_0x4ecdaf[_0xc48a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc48a('0x9')](function(_0x281100){logger[_0xc48a('0xa')](_0xc48a('0x13'),_0x29a1ad);logger[_0xc48a('0xd')](_0xc48a('0x13'),_0x29a1ad,JSON[_0xc48a('0xf')](_0x281100));_0x462102(_0x281100);})[_0xc48a('0x1d')](function(_0x5da24d){logger['error'](_0xc48a('0x13'),_0x5da24d['message'],_0x29a1ad);_0x25e389(_0x188549[_0xc48a('0x10')](0x1f4,_0x5da24d[_0xc48a('0x11')]));});});};exports['ShowZohoAccount']=function(_0x2f69c7){var _0x2ab3e1=this;return new Promise(function(_0x22e62a,_0x5c6d41){return db[_0xc48a('0x14')][_0xc48a('0x1e')]({'raw':_0x2f69c7['options']?_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x17')]===undefined?!![]:![]:!![],'where':_0x2f69c7[_0xc48a('0x16')]?_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x1f')]||null:null,'attributes':_0x2f69c7['options']?_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x18')]||null:null,'include':_0x2f69c7[_0xc48a('0x16')]?_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x2f69c7[_0xc48a('0x16')][_0xc48a('0x1a')],function(_0x57d803){return{'model':db[_0x57d803[_0xc48a('0x1c')]],'as':_0x57d803['as'],'attributes':_0x57d803[_0xc48a('0x18')],'include':_0x57d803[_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x57d803[_0xc48a('0x1a')],function(_0x35c259){return{'model':db[_0x35c259[_0xc48a('0x1c')]],'as':_0x35c259['as'],'attributes':_0x35c259['attributes'],'include':_0x35c259[_0xc48a('0x1a')]?_[_0xc48a('0x1b')](_0x35c259[_0xc48a('0x1a')],function(_0x2288ce){return{'model':db[_0x2288ce['model']],'as':_0x2288ce['as'],'attributes':_0x2288ce[_0xc48a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc48a('0x9')](function(_0x4b355c){logger[_0xc48a('0xa')]('ShowZohoAccount',_0x2f69c7);logger[_0xc48a('0xd')]('ShowZohoAccount',_0x2f69c7,JSON['stringify'](_0x4b355c));_0x22e62a(_0x4b355c);})[_0xc48a('0x1d')](function(_0x1e9248){logger['error'](_0xc48a('0x20'),_0x1e9248[_0xc48a('0x11')],_0x2f69c7);_0x5c6d41(_0x2ab3e1[_0xc48a('0x10')](0x1f4,_0x1e9248[_0xc48a('0x11')]));});});}; \ No newline at end of file +var _0x8561=['util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','options','raw','attributes','limit','map','include','model','GetZohoAccount','debug','ZohoAccount','find','where','then','ShowZohoAccount'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0x8561,0x1b2));var _0x1856=function(_0x2bd630,_0x494f0a){_0x2bd630=_0x2bd630-0x0;var _0x34d159=_0x8561[_0x2bd630];return _0x34d159;};'use strict';var _=require('lodash');var util=require(_0x1856('0x0'));var moment=require(_0x1856('0x1'));var BPromise=require('bluebird');var rs=require(_0x1856('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1856('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1856('0x4'))('rpc');var config=require(_0x1856('0x5'));var jayson=require(_0x1856('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe76f7e,_0x56a214,_0x598eba){return new BPromise(function(_0x1c79b0,_0x567852){return client['request'](_0xe76f7e,_0x598eba)['then'](function(_0x5c3bc5){logger[_0x1856('0x7')](_0x1856('0x8'),_0x56a214,'request\x20sent');logger['debug'](_0x1856('0x9'),_0x56a214,'request\x20sent',JSON[_0x1856('0xa')](_0x5c3bc5));if(_0x5c3bc5[_0x1856('0xb')]){if(_0x5c3bc5[_0x1856('0xb')]['code']===0x1f4){logger[_0x1856('0xb')](_0x1856('0x8'),_0x56a214,_0x5c3bc5['error'][_0x1856('0xc')]);return _0x567852(_0x5c3bc5[_0x1856('0xb')][_0x1856('0xc')]);}logger['error'](_0x1856('0x8'),_0x56a214,_0x5c3bc5[_0x1856('0xb')][_0x1856('0xc')]);return _0x1c79b0(_0x5c3bc5['error'][_0x1856('0xc')]);}else{logger[_0x1856('0x7')](_0x1856('0x8'),_0x56a214,_0x1856('0xd'));_0x1c79b0(_0x5c3bc5[_0x1856('0xe')][_0x1856('0xc')]);}})[_0x1856('0xf')](function(_0x51ed04){logger['error'](_0x1856('0x8'),_0x56a214,_0x51ed04);_0x567852(_0x51ed04);});});}exports['GetZohoAccount']=function(_0x4ccc42){var _0x1de74a=this;return new Promise(function(_0x2346f6,_0x5b12d0){return db['ZohoAccount'][_0x1856('0x10')]({'raw':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42[_0x1856('0x11')][_0x1856('0x12')]===undefined?!![]:![]:!![],'where':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42[_0x1856('0x11')]['where']||null:null,'attributes':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42[_0x1856('0x11')][_0x1856('0x13')]||null:null,'limit':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42[_0x1856('0x11')][_0x1856('0x14')]||null:null,'include':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42['options']['include']?_[_0x1856('0x15')](_0x4ccc42[_0x1856('0x11')][_0x1856('0x16')],function(_0x4b867e){return{'model':db[_0x4b867e[_0x1856('0x17')]],'as':_0x4b867e['as'],'attributes':_0x4b867e[_0x1856('0x13')],'include':_0x4b867e[_0x1856('0x16')]?_[_0x1856('0x15')](_0x4b867e['include'],function(_0xfd069f){return{'model':db[_0xfd069f[_0x1856('0x17')]],'as':_0xfd069f['as'],'attributes':_0xfd069f[_0x1856('0x13')],'include':_0xfd069f[_0x1856('0x16')]?_['map'](_0xfd069f[_0x1856('0x16')],function(_0x4022e8){return{'model':db[_0x4022e8['model']],'as':_0x4022e8['as'],'attributes':_0x4022e8[_0x1856('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46d381){logger['info'](_0x1856('0x18'),_0x4ccc42);logger[_0x1856('0x19')](_0x1856('0x18'),_0x4ccc42,JSON[_0x1856('0xa')](_0x46d381));_0x2346f6(_0x46d381);})['catch'](function(_0x2f3d8f){logger[_0x1856('0xb')](_0x1856('0x18'),_0x2f3d8f[_0x1856('0xc')],_0x4ccc42);_0x5b12d0(_0x1de74a[_0x1856('0xb')](0x1f4,_0x2f3d8f[_0x1856('0xc')]));});});};exports['ShowZohoAccount']=function(_0x2fbe7b){var _0x16ca12=this;return new Promise(function(_0x35428a,_0x48e78f){return db[_0x1856('0x1a')][_0x1856('0x1b')]({'raw':_0x2fbe7b[_0x1856('0x11')]?_0x2fbe7b['options'][_0x1856('0x12')]===undefined?!![]:![]:!![],'where':_0x2fbe7b['options']?_0x2fbe7b[_0x1856('0x11')][_0x1856('0x1c')]||null:null,'attributes':_0x2fbe7b[_0x1856('0x11')]?_0x2fbe7b[_0x1856('0x11')][_0x1856('0x13')]||null:null,'include':_0x2fbe7b[_0x1856('0x11')]?_0x2fbe7b[_0x1856('0x11')]['include']?_[_0x1856('0x15')](_0x2fbe7b[_0x1856('0x11')][_0x1856('0x16')],function(_0x1ab4c6){return{'model':db[_0x1ab4c6[_0x1856('0x17')]],'as':_0x1ab4c6['as'],'attributes':_0x1ab4c6['attributes'],'include':_0x1ab4c6[_0x1856('0x16')]?_[_0x1856('0x15')](_0x1ab4c6[_0x1856('0x16')],function(_0x4b2fca){return{'model':db[_0x4b2fca[_0x1856('0x17')]],'as':_0x4b2fca['as'],'attributes':_0x4b2fca[_0x1856('0x13')],'include':_0x4b2fca[_0x1856('0x16')]?_[_0x1856('0x15')](_0x4b2fca[_0x1856('0x16')],function(_0x5aa0e4){return{'model':db[_0x5aa0e4['model']],'as':_0x5aa0e4['as'],'attributes':_0x5aa0e4['attributes']};}):[]};}):[]};}):[]:[]})[_0x1856('0x1d')](function(_0x588865){logger[_0x1856('0x7')](_0x1856('0x1e'),_0x2fbe7b);logger['debug']('ShowZohoAccount',_0x2fbe7b,JSON[_0x1856('0xa')](_0x588865));_0x35428a(_0x588865);})[_0x1856('0xf')](function(_0x14b930){logger[_0x1856('0xb')]('ShowZohoAccount',_0x14b930[_0x1856('0xc')],_0x2fbe7b);_0x48e78f(_0x16ca12[_0x1856('0xb')](0x1f4,_0x14b930[_0x1856('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 357d993..ca0e336 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 _0x23ff=['exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','post','put','delete','destroy'];(function(_0x40514c,_0x387dc3){var _0x48f285=function(_0x8145ee){while(--_0x8145ee){_0x40514c['push'](_0x40514c['shift']());}};_0x48f285(++_0x387dc3);}(_0x23ff,0x190));var _0xf23f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x23ff[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf23f('0x0'));var util=require(_0xf23f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf23f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf23f('0x3'));var interaction=require(_0xf23f('0x4'));var config=require('../../config/environment');var controller=require(_0xf23f('0x5'));router[_0xf23f('0x6')]('/',auth[_0xf23f('0x7')](),controller[_0xf23f('0x8')]);router['get'](_0xf23f('0x9'),auth[_0xf23f('0x7')](),controller[_0xf23f('0xa')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get'](_0xf23f('0xb'),auth['isAuthenticated'](),controller[_0xf23f('0xc')]);router['get'](_0xf23f('0xd'),auth[_0xf23f('0x7')](),controller['getDescriptions']);router[_0xf23f('0xe')]('/',auth[_0xf23f('0x7')](),controller['create']);router[_0xf23f('0xf')](_0xf23f('0x9'),auth[_0xf23f('0x7')](),controller['update']);router[_0xf23f('0x10')](_0xf23f('0x9'),auth[_0xf23f('0x7')](),controller[_0xf23f('0x11')]);module[_0xf23f('0x12')]=router; \ No newline at end of file +var _0x52b7=['../../config/environment','./intZohoConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2eeed4,_0x28dc98){var _0x56099d=function(_0x1018a7){while(--_0x1018a7){_0x2eeed4['push'](_0x2eeed4['shift']());}};_0x56099d(++_0x28dc98);}(_0x52b7,0xb2));var _0x752b=function(_0x1b5c07,_0x18f64e){_0x1b5c07=_0x1b5c07-0x0;var _0x472d4f=_0x52b7[_0x1b5c07];return _0x472d4f;};'use strict';var multer=require(_0x752b('0x0'));var util=require(_0x752b('0x1'));var path=require(_0x752b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x752b('0x3'));var auth=require(_0x752b('0x4'));var interaction=require(_0x752b('0x5'));var config=require(_0x752b('0x6'));var controller=require(_0x752b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x752b('0x8')]);router[_0x752b('0x9')](_0x752b('0xa'),auth['isAuthenticated'](),controller[_0x752b('0xb')]);router[_0x752b('0x9')](_0x752b('0xc'),auth[_0x752b('0xd')](),controller['getFields']);router[_0x752b('0x9')](_0x752b('0xe'),auth[_0x752b('0xd')](),controller[_0x752b('0xf')]);router[_0x752b('0x9')](_0x752b('0x10'),auth[_0x752b('0xd')](),controller[_0x752b('0x11')]);router[_0x752b('0x12')]('/',auth['isAuthenticated'](),controller[_0x752b('0x13')]);router[_0x752b('0x14')](_0x752b('0xa'),auth[_0x752b('0xd')](),controller['update']);router['delete'](_0x752b('0xa'),auth[_0x752b('0xd')](),controller[_0x752b('0x15')]);module[_0x752b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 460906d..3faa0ea 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 _0x2907=['contact','lead','STRING','sequelize','exports','ENUM','nothing','contact_lead'];(function(_0x4e8d75,_0x29072a){var _0x48f83b=function(_0x1b88c6){while(--_0x1b88c6){_0x4e8d75['push'](_0x4e8d75['shift']());}};_0x48f83b(++_0x29072a);}(_0x2907,0xdb));var _0x7290=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2907[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7290('0x0'));module[_0x7290('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x7290('0x2')]('lead','contact',_0x7290('0x3')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x7290('0x2')](_0x7290('0x4'),_0x7290('0x5'),_0x7290('0x6')),'defaultValue':_0x7290('0x4')},'description':{'type':Sequelize[_0x7290('0x7')]}}; \ No newline at end of file +var _0x6ed4=['exports','STRING','ENUM','contact','lead','contact_lead','sequelize'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0x6ed4,0x99));var _0x46ed=function(_0x4b6827,_0x4873b0){_0x4b6827=_0x4b6827-0x0;var _0x392499=_0x6ed4[_0x4b6827];return _0x392499;};'use strict';var Sequelize=require(_0x46ed('0x0'));module[_0x46ed('0x1')]={'name':{'type':Sequelize[_0x46ed('0x2')]},'moduleCreate':{'type':Sequelize[_0x46ed('0x3')]('lead',_0x46ed('0x4'),'nothing'),'defaultValue':_0x46ed('0x5')},'moduleSearch':{'type':Sequelize[_0x46ed('0x3')](_0x46ed('0x6'),_0x46ed('0x4'),_0x46ed('0x5')),'defaultValue':_0x46ed('0x6')},'description':{'type':Sequelize[_0x46ed('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 2413e96..df077e1 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 _0x1206=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../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','count','limit','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','query','keys','filters','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','create','body','catch','getFields','findOne','ZohoField','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0x1206,0x132));var _0x6120=function(_0x3051d9,_0x3de423){_0x3051d9=_0x3051d9-0x0;var _0xcc0a87=_0x1206[_0x3051d9];return _0xcc0a87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6120('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6120('0x1'));var rp=require(_0x6120('0x2'));var moment=require('moment');var BPromise=require(_0x6120('0x3'));var Mustache=require(_0x6120('0x4'));var util=require('util');var path=require('path');var sox=require(_0x6120('0x5'));var csv=require(_0x6120('0x6'));var ejs=require(_0x6120('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6120('0x8'));var squel=require(_0x6120('0x9'));var crypto=require('crypto');var jsforce=require(_0x6120('0xa'));var deskjs=require(_0x6120('0xb'));var toCsv=require(_0x6120('0x6'));var querystring=require(_0x6120('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6120('0xd'));var qs=require(_0x6120('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6120('0xf'));var logger=require(_0x6120('0x10'))(_0x6120('0x11'));var utils=require(_0x6120('0x12'));var config=require(_0x6120('0x13'));var licenseUtil=require(_0x6120('0x14'));var db=require(_0x6120('0x15'))['db'];function respondWithStatusCode(_0x18c308,_0x45e6b0){_0x45e6b0=_0x45e6b0||0xcc;return function(_0x1c5523){if(_0x1c5523){return _0x18c308[_0x6120('0x16')](_0x45e6b0);}return _0x18c308[_0x6120('0x17')](_0x45e6b0)[_0x6120('0x18')]();};}function respondWithResult(_0x1daf84,_0x2245ac){_0x2245ac=_0x2245ac||0xc8;return function(_0x20b81a){if(_0x20b81a){return _0x1daf84[_0x6120('0x17')](_0x2245ac)[_0x6120('0x19')](_0x20b81a);}};}function respondWithFilteredResult(_0x2fbdaf,_0x4ff9ec){return function(_0x2e62d9){if(_0x2e62d9){var _0x454687=typeof _0x4ff9ec[_0x6120('0x1a')]===_0x6120('0x1b')&&typeof _0x4ff9ec['limit']===_0x6120('0x1b');var _0x28cc5f=_0x2e62d9['count'];var _0x5ebd23=_0x454687?0x0:_0x4ff9ec[_0x6120('0x1a')];var _0x2b77db=_0x454687?_0x2e62d9[_0x6120('0x1c')]:_0x4ff9ec[_0x6120('0x1a')]+_0x4ff9ec[_0x6120('0x1d')];var _0x422bdf;if(_0x2b77db>=_0x28cc5f){_0x2b77db=_0x28cc5f;_0x422bdf=0xc8;}else{_0x422bdf=0xce;}_0x2fbdaf['status'](_0x422bdf);return _0x2fbdaf['set'](_0x6120('0x1e'),_0x5ebd23+'-'+_0x2b77db+'/'+_0x28cc5f)[_0x6120('0x19')](_0x2e62d9);}return null;};}function patchUpdates(_0x5c8058){return function(_0x2ec0d5){try{jsonpatch[_0x6120('0x1f')](_0x2ec0d5,_0x5c8058,!![]);}catch(_0x356bbc){return BPromise[_0x6120('0x20')](_0x356bbc);}return _0x2ec0d5['save']();};}function saveUpdates(_0x1094ca,_0x41647e){return function(_0x49212a){if(_0x49212a){return _0x49212a[_0x6120('0x21')](_0x1094ca)['then'](function(_0x491625){return _0x491625;});}return null;};}function removeEntity(_0x26a6b4,_0x32cec7){return function(_0x17e0fe){if(_0x17e0fe){return _0x17e0fe[_0x6120('0x22')]()[_0x6120('0x23')](function(){_0x26a6b4[_0x6120('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x461c7f,_0x23a61f){return function(_0x15b134){if(!_0x15b134){_0x461c7f[_0x6120('0x16')](0x194);}return _0x15b134;};}function handleError(_0x835d13,_0x5ec9a1){_0x5ec9a1=_0x5ec9a1||0x1f4;return function(_0xbbc693){logger[_0x6120('0x24')](_0xbbc693[_0x6120('0x25')]);if(_0xbbc693[_0x6120('0x26')]){delete _0xbbc693[_0x6120('0x26')];}_0x835d13[_0x6120('0x17')](_0x5ec9a1)[_0x6120('0x27')](_0xbbc693);};}exports[_0x6120('0x28')]=function(_0x264528,_0x30b4bd){var _0x5009f0={},_0x49b053={},_0x287b2d={'count':0x0,'rows':[]};var _0x27a022=_[_0x6120('0x29')](db[_0x6120('0x2a')][_0x6120('0x2b')],function(_0x3aea42){return{'name':_0x3aea42[_0x6120('0x2c')],'type':_0x3aea42['type']['key']};});_0x49b053['model']=_[_0x6120('0x29')](_0x27a022,_0x6120('0x26'));_0x49b053[_0x6120('0x2d')]=_[_0x6120('0x2e')](_0x264528[_0x6120('0x2d')]);_0x49b053[_0x6120('0x2f')]=_['intersection'](_0x49b053['model'],_0x49b053[_0x6120('0x2d')]);_0x5009f0[_0x6120('0x30')]=_['intersection'](_0x49b053['model'],qs[_0x6120('0x31')](_0x264528['query'][_0x6120('0x31')]));_0x5009f0[_0x6120('0x30')]=_0x5009f0[_0x6120('0x30')][_0x6120('0x32')]?_0x5009f0[_0x6120('0x30')]:_0x49b053[_0x6120('0x33')];if(!_0x264528[_0x6120('0x2d')][_0x6120('0x34')](_0x6120('0x35'))){_0x5009f0[_0x6120('0x1d')]=qs[_0x6120('0x1d')](_0x264528[_0x6120('0x2d')][_0x6120('0x1d')]);_0x5009f0[_0x6120('0x1a')]=qs['offset'](_0x264528[_0x6120('0x2d')][_0x6120('0x1a')]);}_0x5009f0[_0x6120('0x36')]=qs[_0x6120('0x37')](_0x264528[_0x6120('0x2d')][_0x6120('0x37')]);_0x5009f0[_0x6120('0x38')]=qs[_0x6120('0x2f')](_[_0x6120('0x39')](_0x264528['query'],_0x49b053['filters']),_0x27a022);if(_0x264528['query'][_0x6120('0x3a')]){_0x5009f0['where']=_[_0x6120('0x3b')](_0x5009f0[_0x6120('0x38')],{'$or':_[_0x6120('0x29')](_0x27a022,function(_0x1fd661){if(_0x1fd661['type']!==_0x6120('0x3c')){var _0x2944ae={};_0x2944ae[_0x1fd661[_0x6120('0x26')]]={'$like':'%'+_0x264528[_0x6120('0x2d')][_0x6120('0x3a')]+'%'};return _0x2944ae;}})});}_0x5009f0=_[_0x6120('0x3b')]({},_0x5009f0,_0x264528[_0x6120('0x3d')]);var _0x3904ad={'where':_0x5009f0[_0x6120('0x38')]};return db['ZohoConfiguration'][_0x6120('0x1c')](_0x3904ad)['then'](function(_0x264b49){_0x287b2d[_0x6120('0x1c')]=_0x264b49;if(_0x264528[_0x6120('0x2d')][_0x6120('0x3e')]){_0x5009f0[_0x6120('0x3f')]=[{'all':!![]}];}return db[_0x6120('0x2a')][_0x6120('0x40')](_0x5009f0);})[_0x6120('0x23')](function(_0x41a729){_0x287b2d[_0x6120('0x41')]=_0x41a729;return _0x287b2d;})[_0x6120('0x23')](respondWithFilteredResult(_0x30b4bd,_0x5009f0))['catch'](handleError(_0x30b4bd,null));};exports[_0x6120('0x42')]=function(_0x44354b,_0x557102){var _0x5e38dd={'raw':![],'where':{'id':_0x44354b[_0x6120('0x43')]['id']}},_0x1bb9ba={};_0x1bb9ba[_0x6120('0x33')]=_['keys'](db[_0x6120('0x2a')][_0x6120('0x2b')]);_0x1bb9ba[_0x6120('0x2d')]=_[_0x6120('0x2e')](_0x44354b[_0x6120('0x2d')]);_0x1bb9ba[_0x6120('0x2f')]=_['intersection'](_0x1bb9ba[_0x6120('0x33')],_0x1bb9ba['query']);_0x5e38dd[_0x6120('0x30')]=_[_0x6120('0x44')](_0x1bb9ba[_0x6120('0x33')],qs[_0x6120('0x31')](_0x44354b[_0x6120('0x2d')][_0x6120('0x31')]));_0x5e38dd[_0x6120('0x30')]=_0x5e38dd['attributes'][_0x6120('0x32')]?_0x5e38dd['attributes']:_0x1bb9ba[_0x6120('0x33')];if(_0x44354b[_0x6120('0x2d')]['includeAll']){_0x5e38dd[_0x6120('0x3f')]=[{'all':!![]}];}_0x5e38dd=_[_0x6120('0x3b')]({},_0x5e38dd,_0x44354b[_0x6120('0x3d')]);return db[_0x6120('0x2a')][_0x6120('0x45')](_0x5e38dd)[_0x6120('0x23')](handleEntityNotFound(_0x557102,null))['then'](respondWithResult(_0x557102,null))['catch'](handleError(_0x557102,null));};exports[_0x6120('0x46')]=function(_0x343afe,_0x24054f){return db[_0x6120('0x2a')][_0x6120('0x46')](_0x343afe[_0x6120('0x47')],{})[_0x6120('0x23')](respondWithResult(_0x24054f,0xc9))['catch'](handleError(_0x24054f,null));};exports[_0x6120('0x21')]=function(_0x176250,_0x48d307){if(_0x176250['body']['id']){delete _0x176250[_0x6120('0x47')]['id'];}return db[_0x6120('0x2a')]['find']({'where':{'id':_0x176250[_0x6120('0x43')]['id']}})['then'](handleEntityNotFound(_0x48d307,null))[_0x6120('0x23')](saveUpdates(_0x176250['body'],null))[_0x6120('0x23')](respondWithResult(_0x48d307,null))['catch'](handleError(_0x48d307,null));};exports[_0x6120('0x22')]=function(_0x24c424,_0x47d0e7){return db[_0x6120('0x2a')][_0x6120('0x45')]({'where':{'id':_0x24c424[_0x6120('0x43')]['id']}})['then'](handleEntityNotFound(_0x47d0e7,null))[_0x6120('0x23')](removeEntity(_0x47d0e7,null))[_0x6120('0x48')](handleError(_0x47d0e7,null));};exports[_0x6120('0x49')]=function(_0x3b1a26,_0x1c228f,_0x456a77){var _0x106f03={};var _0x4b0d2e={};var _0x22d2dc;var _0x3970df;return db[_0x6120('0x2a')][_0x6120('0x4a')]({'where':{'id':_0x3b1a26[_0x6120('0x43')]['id']}})[_0x6120('0x23')](handleEntityNotFound(_0x1c228f,null))[_0x6120('0x23')](function(_0x1714fe){if(_0x1714fe){_0x22d2dc=_0x1714fe;_0x4b0d2e[_0x6120('0x33')]=_['keys'](db[_0x6120('0x4b')][_0x6120('0x2b')]);_0x4b0d2e['query']=_[_0x6120('0x2e')](_0x3b1a26[_0x6120('0x2d')]);_0x4b0d2e[_0x6120('0x2f')]=_[_0x6120('0x44')](_0x4b0d2e['model'],_0x4b0d2e[_0x6120('0x2d')]);_0x106f03[_0x6120('0x30')]=_[_0x6120('0x44')](_0x4b0d2e[_0x6120('0x33')],qs[_0x6120('0x31')](_0x3b1a26[_0x6120('0x2d')]['fields']));_0x106f03[_0x6120('0x30')]=_0x106f03[_0x6120('0x30')][_0x6120('0x32')]?_0x106f03['attributes']:_0x4b0d2e[_0x6120('0x33')];_0x106f03[_0x6120('0x36')]=qs[_0x6120('0x37')](_0x3b1a26[_0x6120('0x2d')]['sort']);_0x106f03[_0x6120('0x38')]=qs['filters'](_[_0x6120('0x39')](_0x3b1a26[_0x6120('0x2d')],_0x4b0d2e[_0x6120('0x2f')]));if(_0x3b1a26[_0x6120('0x2d')][_0x6120('0x3a')]){_0x106f03[_0x6120('0x38')]=_[_0x6120('0x3b')](_0x106f03[_0x6120('0x38')],{'$or':_[_0x6120('0x29')](_0x106f03[_0x6120('0x30')],function(_0xb2080a){var _0x310a2e={};_0x310a2e[_0xb2080a]={'$like':'%'+_0x3b1a26['query']['filter']+'%'};return _0x310a2e;})});}_0x106f03=_[_0x6120('0x3b')]({},_0x106f03,_0x3b1a26[_0x6120('0x3d')]);return _0x22d2dc[_0x6120('0x49')](_0x106f03);}})['then'](function(_0x2bfd57){if(_0x2bfd57){_0x3970df=_0x2bfd57[_0x6120('0x32')];if(!_0x3b1a26[_0x6120('0x2d')][_0x6120('0x34')](_0x6120('0x35'))){_0x106f03[_0x6120('0x1d')]=qs[_0x6120('0x1d')](_0x3b1a26[_0x6120('0x2d')][_0x6120('0x1d')]);_0x106f03[_0x6120('0x1a')]=qs[_0x6120('0x1a')](_0x3b1a26[_0x6120('0x2d')][_0x6120('0x1a')]);}return _0x22d2dc[_0x6120('0x49')](_0x106f03);}})[_0x6120('0x23')](function(_0x5891d8){if(_0x5891d8){return _0x5891d8?{'count':_0x3970df,'rows':_0x5891d8}:null;}})[_0x6120('0x23')](respondWithResult(_0x1c228f,null))[_0x6120('0x48')](handleError(_0x1c228f,null));};exports[_0x6120('0x4c')]=function(_0x5a2532,_0x591f6b,_0x5bd572){var _0x18dd84={};var _0x2c1ae9={};var _0x450783;var _0x492e62;return db[_0x6120('0x2a')]['findOne']({'where':{'id':_0x5a2532[_0x6120('0x43')]['id']}})[_0x6120('0x23')](handleEntityNotFound(_0x591f6b,null))[_0x6120('0x23')](function(_0x299e88){if(_0x299e88){_0x450783=_0x299e88;_0x2c1ae9['model']=_[_0x6120('0x2e')](db[_0x6120('0x4b')][_0x6120('0x2b')]);_0x2c1ae9[_0x6120('0x2d')]=_[_0x6120('0x2e')](_0x5a2532[_0x6120('0x2d')]);_0x2c1ae9[_0x6120('0x2f')]=_[_0x6120('0x44')](_0x2c1ae9[_0x6120('0x33')],_0x2c1ae9[_0x6120('0x2d')]);_0x18dd84['attributes']=_['intersection'](_0x2c1ae9[_0x6120('0x33')],qs[_0x6120('0x31')](_0x5a2532['query'][_0x6120('0x31')]));_0x18dd84[_0x6120('0x30')]=_0x18dd84[_0x6120('0x30')][_0x6120('0x32')]?_0x18dd84[_0x6120('0x30')]:_0x2c1ae9[_0x6120('0x33')];_0x18dd84[_0x6120('0x36')]=qs[_0x6120('0x37')](_0x5a2532['query'][_0x6120('0x37')]);_0x18dd84['where']=qs['filters'](_[_0x6120('0x39')](_0x5a2532['query'],_0x2c1ae9[_0x6120('0x2f')]));if(_0x5a2532[_0x6120('0x2d')][_0x6120('0x3a')]){_0x18dd84[_0x6120('0x38')]=_[_0x6120('0x3b')](_0x18dd84[_0x6120('0x38')],{'$or':_['map'](_0x18dd84[_0x6120('0x30')],function(_0x323c18){var _0x10fad2={};_0x10fad2[_0x323c18]={'$like':'%'+_0x5a2532[_0x6120('0x2d')][_0x6120('0x3a')]+'%'};return _0x10fad2;})});}_0x18dd84=_[_0x6120('0x3b')]({},_0x18dd84,_0x5a2532[_0x6120('0x3d')]);return _0x450783[_0x6120('0x4c')](_0x18dd84);}})['then'](function(_0xde7c21){if(_0xde7c21){_0x492e62=_0xde7c21[_0x6120('0x32')];if(!_0x5a2532[_0x6120('0x2d')][_0x6120('0x34')](_0x6120('0x35'))){_0x18dd84[_0x6120('0x1d')]=qs[_0x6120('0x1d')](_0x5a2532[_0x6120('0x2d')][_0x6120('0x1d')]);_0x18dd84[_0x6120('0x1a')]=qs[_0x6120('0x1a')](_0x5a2532[_0x6120('0x2d')]['offset']);}return _0x450783[_0x6120('0x4c')](_0x18dd84);}})[_0x6120('0x23')](function(_0x2c2078){if(_0x2c2078){return _0x2c2078?{'count':_0x492e62,'rows':_0x2c2078}:null;}})[_0x6120('0x23')](respondWithResult(_0x591f6b,null))[_0x6120('0x48')](handleError(_0x591f6b,null));};exports[_0x6120('0x4d')]=function(_0x4af45d,_0x236e79,_0x777086){var _0xcfa412={};var _0x10dbf7={};var _0x2ca584;var _0x3eb554;return db['ZohoConfiguration'][_0x6120('0x4a')]({'where':{'id':_0x4af45d[_0x6120('0x43')]['id']}})[_0x6120('0x23')](handleEntityNotFound(_0x236e79,null))['then'](function(_0x286de4){if(_0x286de4){_0x2ca584=_0x286de4;_0x10dbf7[_0x6120('0x33')]=_['keys'](db[_0x6120('0x4b')][_0x6120('0x2b')]);_0x10dbf7['query']=_[_0x6120('0x2e')](_0x4af45d['query']);_0x10dbf7['filters']=_[_0x6120('0x44')](_0x10dbf7[_0x6120('0x33')],_0x10dbf7[_0x6120('0x2d')]);_0xcfa412['attributes']=_[_0x6120('0x44')](_0x10dbf7[_0x6120('0x33')],qs[_0x6120('0x31')](_0x4af45d[_0x6120('0x2d')][_0x6120('0x31')]));_0xcfa412[_0x6120('0x30')]=_0xcfa412[_0x6120('0x30')][_0x6120('0x32')]?_0xcfa412[_0x6120('0x30')]:_0x10dbf7[_0x6120('0x33')];_0xcfa412[_0x6120('0x36')]=qs['sort'](_0x4af45d['query']['sort']);_0xcfa412[_0x6120('0x38')]=qs[_0x6120('0x2f')](_[_0x6120('0x39')](_0x4af45d['query'],_0x10dbf7[_0x6120('0x2f')]));if(_0x4af45d['query'][_0x6120('0x3a')]){_0xcfa412[_0x6120('0x38')]=_[_0x6120('0x3b')](_0xcfa412[_0x6120('0x38')],{'$or':_[_0x6120('0x29')](_0xcfa412[_0x6120('0x30')],function(_0xbfca1a){var _0x2c5a23={};_0x2c5a23[_0xbfca1a]={'$like':'%'+_0x4af45d['query'][_0x6120('0x3a')]+'%'};return _0x2c5a23;})});}_0xcfa412=_[_0x6120('0x3b')]({},_0xcfa412,_0x4af45d[_0x6120('0x3d')]);return _0x2ca584[_0x6120('0x4d')](_0xcfa412);}})['then'](function(_0x5d122d){if(_0x5d122d){_0x3eb554=_0x5d122d[_0x6120('0x32')];if(!_0x4af45d[_0x6120('0x2d')]['hasOwnProperty'](_0x6120('0x35'))){_0xcfa412['limit']=qs['limit'](_0x4af45d['query']['limit']);_0xcfa412[_0x6120('0x1a')]=qs[_0x6120('0x1a')](_0x4af45d[_0x6120('0x2d')]['offset']);}return _0x2ca584['getDescriptions'](_0xcfa412);}})[_0x6120('0x23')](function(_0x7c6fe2){if(_0x7c6fe2){return _0x7c6fe2?{'count':_0x3eb554,'rows':_0x7c6fe2}:null;}})[_0x6120('0x23')](respondWithResult(_0x236e79,null))[_0x6120('0x48')](handleError(_0x236e79,null));}; \ No newline at end of file +var _0xbab6=['sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','error','name','send','index','ZohoConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','then','show','params','length','find','catch','create','body','update','destroy','getFields','ZohoField','sort','map','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x568cd3,_0x435ac2){var _0x3ce9e2=function(_0x19a0f1){while(--_0x19a0f1){_0x568cd3['push'](_0x568cd3['shift']());}};_0x3ce9e2(++_0x435ac2);}(_0xbab6,0x11a));var _0x6bab=function(_0x331537,_0x1945cf){_0x331537=_0x331537-0x0;var _0x29c635=_0xbab6[_0x331537];return _0x29c635;};'use strict';var emlformat=require(_0x6bab('0x0'));var rimraf=require(_0x6bab('0x1'));var zipdir=require(_0x6bab('0x2'));var jsonpatch=require(_0x6bab('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6bab('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6bab('0x5'));var sox=require(_0x6bab('0x6'));var csv=require(_0x6bab('0x7'));var ejs=require(_0x6bab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6bab('0x9'));var squel=require(_0x6bab('0xa'));var crypto=require(_0x6bab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6bab('0xc'));var toCsv=require(_0x6bab('0x7'));var querystring=require('querystring');var Papa=require(_0x6bab('0xd'));var Redis=require('ioredis');var authService=require(_0x6bab('0xe'));var qs=require(_0x6bab('0xf'));var as=require(_0x6bab('0x10'));var hardwareService=require(_0x6bab('0x11'));var logger=require('../../config/logger')(_0x6bab('0x12'));var utils=require(_0x6bab('0x13'));var config=require(_0x6bab('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6bab('0x15'))['db'];function respondWithStatusCode(_0x26ca82,_0x2a1791){_0x2a1791=_0x2a1791||0xcc;return function(_0x1b938c){if(_0x1b938c){return _0x26ca82[_0x6bab('0x16')](_0x2a1791);}return _0x26ca82[_0x6bab('0x17')](_0x2a1791)['end']();};}function respondWithResult(_0xa010d2,_0xc9f7bc){_0xc9f7bc=_0xc9f7bc||0xc8;return function(_0x557450){if(_0x557450){return _0xa010d2[_0x6bab('0x17')](_0xc9f7bc)[_0x6bab('0x18')](_0x557450);}};}function respondWithFilteredResult(_0x211796,_0x26a5ec){return function(_0x7ef4d7){if(_0x7ef4d7){var _0x534be0=typeof _0x26a5ec[_0x6bab('0x19')]===_0x6bab('0x1a')&&typeof _0x26a5ec[_0x6bab('0x1b')]===_0x6bab('0x1a');var _0x36abb7=_0x7ef4d7[_0x6bab('0x1c')];var _0x4b200b=_0x534be0?0x0:_0x26a5ec[_0x6bab('0x19')];var _0x40b9c2=_0x534be0?_0x7ef4d7[_0x6bab('0x1c')]:_0x26a5ec['offset']+_0x26a5ec[_0x6bab('0x1b')];var _0x43e643;if(_0x40b9c2>=_0x36abb7){_0x40b9c2=_0x36abb7;_0x43e643=0xc8;}else{_0x43e643=0xce;}_0x211796[_0x6bab('0x17')](_0x43e643);return _0x211796['set'](_0x6bab('0x1d'),_0x4b200b+'-'+_0x40b9c2+'/'+_0x36abb7)[_0x6bab('0x18')](_0x7ef4d7);}return null;};}function patchUpdates(_0x1c2697){return function(_0x242926){try{jsonpatch[_0x6bab('0x1e')](_0x242926,_0x1c2697,!![]);}catch(_0x10b055){return BPromise[_0x6bab('0x1f')](_0x10b055);}return _0x242926['save']();};}function saveUpdates(_0x51e274,_0x5b7fef){return function(_0x32e657){if(_0x32e657){return _0x32e657['update'](_0x51e274)['then'](function(_0x19f80f){return _0x19f80f;});}return null;};}function removeEntity(_0x556568,_0x5e4791){return function(_0x4fd0a0){if(_0x4fd0a0){return _0x4fd0a0['destroy']()['then'](function(){_0x556568[_0x6bab('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x586ccc,_0xf42b12){return function(_0x1204b1){if(!_0x1204b1){_0x586ccc[_0x6bab('0x16')](0x194);}return _0x1204b1;};}function handleError(_0x278ba2,_0x5b8999){_0x5b8999=_0x5b8999||0x1f4;return function(_0x2b3cc2){logger[_0x6bab('0x20')](_0x2b3cc2['stack']);if(_0x2b3cc2[_0x6bab('0x21')]){delete _0x2b3cc2[_0x6bab('0x21')];}_0x278ba2[_0x6bab('0x17')](_0x5b8999)[_0x6bab('0x22')](_0x2b3cc2);};}exports[_0x6bab('0x23')]=function(_0x35f552,_0x515695){var _0x421eb9={},_0x44acb8={},_0xf826a8={'count':0x0,'rows':[]};var _0x4a4eaa=_['map'](db[_0x6bab('0x24')][_0x6bab('0x25')],function(_0x2802cd){return{'name':_0x2802cd[_0x6bab('0x26')],'type':_0x2802cd['type'][_0x6bab('0x27')]};});_0x44acb8[_0x6bab('0x28')]=_['map'](_0x4a4eaa,'name');_0x44acb8['query']=_[_0x6bab('0x29')](_0x35f552[_0x6bab('0x2a')]);_0x44acb8[_0x6bab('0x2b')]=_[_0x6bab('0x2c')](_0x44acb8[_0x6bab('0x28')],_0x44acb8['query']);_0x421eb9['attributes']=_[_0x6bab('0x2c')](_0x44acb8[_0x6bab('0x28')],qs[_0x6bab('0x2d')](_0x35f552[_0x6bab('0x2a')][_0x6bab('0x2d')]));_0x421eb9[_0x6bab('0x2e')]=_0x421eb9['attributes']['length']?_0x421eb9[_0x6bab('0x2e')]:_0x44acb8[_0x6bab('0x28')];if(!_0x35f552[_0x6bab('0x2a')][_0x6bab('0x2f')](_0x6bab('0x30'))){_0x421eb9[_0x6bab('0x1b')]=qs[_0x6bab('0x1b')](_0x35f552[_0x6bab('0x2a')][_0x6bab('0x1b')]);_0x421eb9['offset']=qs[_0x6bab('0x19')](_0x35f552[_0x6bab('0x2a')][_0x6bab('0x19')]);}_0x421eb9[_0x6bab('0x31')]=qs['sort'](_0x35f552[_0x6bab('0x2a')]['sort']);_0x421eb9['where']=qs[_0x6bab('0x2b')](_[_0x6bab('0x32')](_0x35f552[_0x6bab('0x2a')],_0x44acb8[_0x6bab('0x2b')]),_0x4a4eaa);if(_0x35f552[_0x6bab('0x2a')][_0x6bab('0x33')]){_0x421eb9[_0x6bab('0x34')]=_['merge'](_0x421eb9[_0x6bab('0x34')],{'$or':_['map'](_0x4a4eaa,function(_0x234cf3){if(_0x234cf3[_0x6bab('0x35')]!==_0x6bab('0x36')){var _0x43aeac={};_0x43aeac[_0x234cf3[_0x6bab('0x21')]]={'$like':'%'+_0x35f552[_0x6bab('0x2a')][_0x6bab('0x33')]+'%'};return _0x43aeac;}})});}_0x421eb9=_[_0x6bab('0x37')]({},_0x421eb9,_0x35f552[_0x6bab('0x38')]);var _0x870ebb={'where':_0x421eb9[_0x6bab('0x34')]};return db[_0x6bab('0x24')][_0x6bab('0x1c')](_0x870ebb)['then'](function(_0x4a598){_0xf826a8[_0x6bab('0x1c')]=_0x4a598;if(_0x35f552['query'][_0x6bab('0x39')]){_0x421eb9[_0x6bab('0x3a')]=[{'all':!![]}];}return db[_0x6bab('0x24')][_0x6bab('0x3b')](_0x421eb9);})[_0x6bab('0x3c')](function(_0x5b399d){_0xf826a8['rows']=_0x5b399d;return _0xf826a8;})[_0x6bab('0x3c')](respondWithFilteredResult(_0x515695,_0x421eb9))['catch'](handleError(_0x515695,null));};exports[_0x6bab('0x3d')]=function(_0xa795fd,_0x2a4e03){var _0x5a02b2={'raw':![],'where':{'id':_0xa795fd[_0x6bab('0x3e')]['id']}},_0x255a5d={};_0x255a5d[_0x6bab('0x28')]=_[_0x6bab('0x29')](db[_0x6bab('0x24')]['rawAttributes']);_0x255a5d['query']=_[_0x6bab('0x29')](_0xa795fd[_0x6bab('0x2a')]);_0x255a5d[_0x6bab('0x2b')]=_[_0x6bab('0x2c')](_0x255a5d[_0x6bab('0x28')],_0x255a5d[_0x6bab('0x2a')]);_0x5a02b2[_0x6bab('0x2e')]=_[_0x6bab('0x2c')](_0x255a5d['model'],qs[_0x6bab('0x2d')](_0xa795fd[_0x6bab('0x2a')][_0x6bab('0x2d')]));_0x5a02b2[_0x6bab('0x2e')]=_0x5a02b2['attributes'][_0x6bab('0x3f')]?_0x5a02b2['attributes']:_0x255a5d['model'];if(_0xa795fd[_0x6bab('0x2a')][_0x6bab('0x39')]){_0x5a02b2[_0x6bab('0x3a')]=[{'all':!![]}];}_0x5a02b2=_[_0x6bab('0x37')]({},_0x5a02b2,_0xa795fd[_0x6bab('0x38')]);return db[_0x6bab('0x24')][_0x6bab('0x40')](_0x5a02b2)['then'](handleEntityNotFound(_0x2a4e03,null))[_0x6bab('0x3c')](respondWithResult(_0x2a4e03,null))[_0x6bab('0x41')](handleError(_0x2a4e03,null));};exports[_0x6bab('0x42')]=function(_0x376624,_0x321a56){return db[_0x6bab('0x24')][_0x6bab('0x42')](_0x376624[_0x6bab('0x43')],{})['then'](respondWithResult(_0x321a56,0xc9))[_0x6bab('0x41')](handleError(_0x321a56,null));};exports[_0x6bab('0x44')]=function(_0x1df19c,_0x4954ed){if(_0x1df19c[_0x6bab('0x43')]['id']){delete _0x1df19c[_0x6bab('0x43')]['id'];}return db[_0x6bab('0x24')][_0x6bab('0x40')]({'where':{'id':_0x1df19c[_0x6bab('0x3e')]['id']}})[_0x6bab('0x3c')](handleEntityNotFound(_0x4954ed,null))['then'](saveUpdates(_0x1df19c[_0x6bab('0x43')],null))['then'](respondWithResult(_0x4954ed,null))[_0x6bab('0x41')](handleError(_0x4954ed,null));};exports[_0x6bab('0x45')]=function(_0x17d4b9,_0x23d617){return db[_0x6bab('0x24')]['find']({'where':{'id':_0x17d4b9[_0x6bab('0x3e')]['id']}})['then'](handleEntityNotFound(_0x23d617,null))[_0x6bab('0x3c')](removeEntity(_0x23d617,null))[_0x6bab('0x41')](handleError(_0x23d617,null));};exports[_0x6bab('0x46')]=function(_0x15a74e,_0x1ebdb4,_0x1e49d3){var _0x558924={};var _0x43296b={};var _0x57b49f;var _0x5b118b;return db[_0x6bab('0x24')]['findOne']({'where':{'id':_0x15a74e[_0x6bab('0x3e')]['id']}})[_0x6bab('0x3c')](handleEntityNotFound(_0x1ebdb4,null))['then'](function(_0x1dcba0){if(_0x1dcba0){_0x57b49f=_0x1dcba0;_0x43296b[_0x6bab('0x28')]=_[_0x6bab('0x29')](db[_0x6bab('0x47')][_0x6bab('0x25')]);_0x43296b[_0x6bab('0x2a')]=_[_0x6bab('0x29')](_0x15a74e[_0x6bab('0x2a')]);_0x43296b['filters']=_[_0x6bab('0x2c')](_0x43296b['model'],_0x43296b[_0x6bab('0x2a')]);_0x558924[_0x6bab('0x2e')]=_['intersection'](_0x43296b[_0x6bab('0x28')],qs['fields'](_0x15a74e['query'][_0x6bab('0x2d')]));_0x558924[_0x6bab('0x2e')]=_0x558924['attributes'][_0x6bab('0x3f')]?_0x558924[_0x6bab('0x2e')]:_0x43296b['model'];_0x558924[_0x6bab('0x31')]=qs[_0x6bab('0x48')](_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x48')]);_0x558924[_0x6bab('0x34')]=qs[_0x6bab('0x2b')](_['pick'](_0x15a74e[_0x6bab('0x2a')],_0x43296b[_0x6bab('0x2b')]));if(_0x15a74e[_0x6bab('0x2a')]['filter']){_0x558924[_0x6bab('0x34')]=_['merge'](_0x558924['where'],{'$or':_[_0x6bab('0x49')](_0x558924[_0x6bab('0x2e')],function(_0x2fce17){var _0x1fb704={};_0x1fb704[_0x2fce17]={'$like':'%'+_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x33')]+'%'};return _0x1fb704;})});}_0x558924=_['merge']({},_0x558924,_0x15a74e[_0x6bab('0x38')]);return _0x57b49f[_0x6bab('0x46')](_0x558924);}})[_0x6bab('0x3c')](function(_0x15ad37){if(_0x15ad37){_0x5b118b=_0x15ad37[_0x6bab('0x3f')];if(!_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x2f')](_0x6bab('0x30'))){_0x558924[_0x6bab('0x1b')]=qs['limit'](_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x1b')]);_0x558924[_0x6bab('0x19')]=qs['offset'](_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x19')]);}return _0x57b49f[_0x6bab('0x46')](_0x558924);}})['then'](function(_0x3b60a9){if(_0x3b60a9){return _0x3b60a9?{'count':_0x5b118b,'rows':_0x3b60a9}:null;}})[_0x6bab('0x3c')](respondWithResult(_0x1ebdb4,null))[_0x6bab('0x41')](handleError(_0x1ebdb4,null));};exports['getSubjects']=function(_0x110073,_0x16b201,_0x5c74da){var _0x4743be={};var _0x20686e={};var _0x5f302f;var _0x4bea6d;return db[_0x6bab('0x24')]['findOne']({'where':{'id':_0x110073['params']['id']}})[_0x6bab('0x3c')](handleEntityNotFound(_0x16b201,null))[_0x6bab('0x3c')](function(_0x57e3a0){if(_0x57e3a0){_0x5f302f=_0x57e3a0;_0x20686e[_0x6bab('0x28')]=_[_0x6bab('0x29')](db[_0x6bab('0x47')][_0x6bab('0x25')]);_0x20686e[_0x6bab('0x2a')]=_['keys'](_0x110073[_0x6bab('0x2a')]);_0x20686e['filters']=_[_0x6bab('0x2c')](_0x20686e[_0x6bab('0x28')],_0x20686e['query']);_0x4743be[_0x6bab('0x2e')]=_['intersection'](_0x20686e['model'],qs['fields'](_0x110073[_0x6bab('0x2a')][_0x6bab('0x2d')]));_0x4743be[_0x6bab('0x2e')]=_0x4743be[_0x6bab('0x2e')][_0x6bab('0x3f')]?_0x4743be[_0x6bab('0x2e')]:_0x20686e[_0x6bab('0x28')];_0x4743be[_0x6bab('0x31')]=qs[_0x6bab('0x48')](_0x110073[_0x6bab('0x2a')][_0x6bab('0x48')]);_0x4743be[_0x6bab('0x34')]=qs[_0x6bab('0x2b')](_[_0x6bab('0x32')](_0x110073[_0x6bab('0x2a')],_0x20686e[_0x6bab('0x2b')]));if(_0x110073[_0x6bab('0x2a')][_0x6bab('0x33')]){_0x4743be[_0x6bab('0x34')]=_[_0x6bab('0x37')](_0x4743be['where'],{'$or':_[_0x6bab('0x49')](_0x4743be[_0x6bab('0x2e')],function(_0xe553c7){var _0xb3690c={};_0xb3690c[_0xe553c7]={'$like':'%'+_0x110073[_0x6bab('0x2a')][_0x6bab('0x33')]+'%'};return _0xb3690c;})});}_0x4743be=_[_0x6bab('0x37')]({},_0x4743be,_0x110073[_0x6bab('0x38')]);return _0x5f302f[_0x6bab('0x4a')](_0x4743be);}})['then'](function(_0x24bd75){if(_0x24bd75){_0x4bea6d=_0x24bd75[_0x6bab('0x3f')];if(!_0x110073[_0x6bab('0x2a')]['hasOwnProperty'](_0x6bab('0x30'))){_0x4743be['limit']=qs[_0x6bab('0x1b')](_0x110073[_0x6bab('0x2a')][_0x6bab('0x1b')]);_0x4743be[_0x6bab('0x19')]=qs[_0x6bab('0x19')](_0x110073[_0x6bab('0x2a')][_0x6bab('0x19')]);}return _0x5f302f[_0x6bab('0x4a')](_0x4743be);}})['then'](function(_0x32f5c5){if(_0x32f5c5){return _0x32f5c5?{'count':_0x4bea6d,'rows':_0x32f5c5}:null;}})[_0x6bab('0x3c')](respondWithResult(_0x16b201,null))[_0x6bab('0x41')](handleError(_0x16b201,null));};exports[_0x6bab('0x4b')]=function(_0x4f0962,_0x3c8989,_0x5d8ba5){var _0x48b94d={};var _0x261764={};var _0x22f0ff;var _0x531de6;return db[_0x6bab('0x24')]['findOne']({'where':{'id':_0x4f0962[_0x6bab('0x3e')]['id']}})[_0x6bab('0x3c')](handleEntityNotFound(_0x3c8989,null))['then'](function(_0x4192ee){if(_0x4192ee){_0x22f0ff=_0x4192ee;_0x261764['model']=_[_0x6bab('0x29')](db[_0x6bab('0x47')][_0x6bab('0x25')]);_0x261764[_0x6bab('0x2a')]=_[_0x6bab('0x29')](_0x4f0962[_0x6bab('0x2a')]);_0x261764['filters']=_[_0x6bab('0x2c')](_0x261764['model'],_0x261764[_0x6bab('0x2a')]);_0x48b94d[_0x6bab('0x2e')]=_['intersection'](_0x261764['model'],qs[_0x6bab('0x2d')](_0x4f0962[_0x6bab('0x2a')][_0x6bab('0x2d')]));_0x48b94d[_0x6bab('0x2e')]=_0x48b94d[_0x6bab('0x2e')][_0x6bab('0x3f')]?_0x48b94d[_0x6bab('0x2e')]:_0x261764[_0x6bab('0x28')];_0x48b94d[_0x6bab('0x31')]=qs[_0x6bab('0x48')](_0x4f0962[_0x6bab('0x2a')][_0x6bab('0x48')]);_0x48b94d[_0x6bab('0x34')]=qs[_0x6bab('0x2b')](_['pick'](_0x4f0962['query'],_0x261764['filters']));if(_0x4f0962[_0x6bab('0x2a')]['filter']){_0x48b94d[_0x6bab('0x34')]=_['merge'](_0x48b94d[_0x6bab('0x34')],{'$or':_['map'](_0x48b94d[_0x6bab('0x2e')],function(_0x2025df){var _0xbea6f0={};_0xbea6f0[_0x2025df]={'$like':'%'+_0x4f0962[_0x6bab('0x2a')][_0x6bab('0x33')]+'%'};return _0xbea6f0;})});}_0x48b94d=_[_0x6bab('0x37')]({},_0x48b94d,_0x4f0962[_0x6bab('0x38')]);return _0x22f0ff['getDescriptions'](_0x48b94d);}})[_0x6bab('0x3c')](function(_0x1e99ff){if(_0x1e99ff){_0x531de6=_0x1e99ff['length'];if(!_0x4f0962['query']['hasOwnProperty'](_0x6bab('0x30'))){_0x48b94d[_0x6bab('0x1b')]=qs[_0x6bab('0x1b')](_0x4f0962[_0x6bab('0x2a')][_0x6bab('0x1b')]);_0x48b94d[_0x6bab('0x19')]=qs['offset'](_0x4f0962[_0x6bab('0x2a')]['offset']);}return _0x22f0ff[_0x6bab('0x4b')](_0x48b94d);}})[_0x6bab('0x3c')](function(_0x30647d){if(_0x30647d){return _0x30647d?{'count':_0x531de6,'rows':_0x30647d}:null;}})[_0x6bab('0x3c')](respondWithResult(_0x3c8989,null))['catch'](handleError(_0x3c8989,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index e066801..6182ce4 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 _0x4662=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations'];(function(_0xa6a002,_0x1963b9){var _0xd46897=function(_0x3a7bf5){while(--_0x3a7bf5){_0xa6a002['push'](_0xa6a002['shift']());}};_0xd46897(++_0x1963b9);}(_0x4662,0x196));var _0x2466=function(_0x552476,_0x58aa61){_0x552476=_0x552476-0x0;var _0x317970=_0x4662[_0x552476];return _0x317970;};'use strict';var _=require(_0x2466('0x0'));var util=require(_0x2466('0x1'));var logger=require(_0x2466('0x2'))(_0x2466('0x3'));var moment=require(_0x2466('0x4'));var BPromise=require(_0x2466('0x5'));var rp=require(_0x2466('0x6'));var fs=require('fs');var path=require(_0x2466('0x7'));var rimraf=require(_0x2466('0x8'));var config=require(_0x2466('0x9'));var attributes=require(_0x2466('0xa'));module[_0x2466('0xb')]=function(_0x35f343,_0x382b26){return _0x35f343[_0x2466('0xc')]('ZohoConfiguration',attributes,{'tableName':_0x2466('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4225=['./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1bef92,_0x51d606){var _0x3c0400=function(_0x382ff0){while(--_0x382ff0){_0x1bef92['push'](_0x1bef92['shift']());}};_0x3c0400(++_0x51d606);}(_0x4225,0x10b));var _0x5422=function(_0x7db900,_0x1e5f2e){_0x7db900=_0x7db900-0x0;var _0x12ada8=_0x4225[_0x7db900];return _0x12ada8;};'use strict';var _=require(_0x5422('0x0'));var util=require(_0x5422('0x1'));var logger=require(_0x5422('0x2'))('api');var moment=require(_0x5422('0x3'));var BPromise=require(_0x5422('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5422('0x5'));module['exports']=function(_0x18384b,_0x32c179){return _0x18384b['define'](_0x5422('0x6'),attributes,{'tableName':_0x5422('0x7'),'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 521d0b2..21ac5d0 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 _0x50a5=['catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result'];(function(_0x5e5e99,_0x588c5d){var _0x49a42d=function(_0x11becd){while(--_0x11becd){_0x5e5e99['push'](_0x5e5e99['shift']());}};_0x49a42d(++_0x588c5d);}(_0x50a5,0x1a3));var _0x550a=function(_0x172547,_0x2cc4aa){_0x172547=_0x172547-0x0;var _0x4199e4=_0x50a5[_0x172547];return _0x4199e4;};'use strict';var _=require('lodash');var util=require(_0x550a('0x0'));var moment=require(_0x550a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x550a('0x2'));var db=require(_0x550a('0x3'))['db'];var utils=require(_0x550a('0x4'));var logger=require(_0x550a('0x5'))(_0x550a('0x6'));var config=require(_0x550a('0x7'));var jayson=require(_0x550a('0x8'));var client=jayson[_0x550a('0x9')][_0x550a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e38a9,_0x5f3cc7,_0x1c9dff){return new BPromise(function(_0x55f936,_0x57697e){return client['request'](_0x3e38a9,_0x1c9dff)[_0x550a('0xb')](function(_0x37cb0f){logger[_0x550a('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x5f3cc7,_0x550a('0xd'));logger[_0x550a('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5f3cc7,_0x550a('0xd'),JSON[_0x550a('0xf')](_0x37cb0f));if(_0x37cb0f[_0x550a('0x10')]){if(_0x37cb0f[_0x550a('0x10')][_0x550a('0x11')]===0x1f4){logger[_0x550a('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x5f3cc7,_0x37cb0f[_0x550a('0x10')]['message']);return _0x57697e(_0x37cb0f[_0x550a('0x10')][_0x550a('0x12')]);}logger['error'](_0x550a('0x13'),_0x5f3cc7,_0x37cb0f[_0x550a('0x10')]['message']);return _0x55f936(_0x37cb0f['error']['message']);}else{logger[_0x550a('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x5f3cc7,'request\x20sent');_0x55f936(_0x37cb0f[_0x550a('0x14')][_0x550a('0x12')]);}})[_0x550a('0x15')](function(_0x39b14c){logger[_0x550a('0x10')](_0x550a('0x13'),_0x5f3cc7,_0x39b14c);_0x57697e(_0x39b14c);});});} \ No newline at end of file +var _0x4e76=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x38db92,_0x593c17){var _0x544d98=function(_0x5885eb){while(--_0x5885eb){_0x38db92['push'](_0x38db92['shift']());}};_0x544d98(++_0x593c17);}(_0x4e76,0x147));var _0x64e7=function(_0x5502a7,_0x325618){_0x5502a7=_0x5502a7-0x0;var _0x3946fa=_0x4e76[_0x5502a7];return _0x3946fa;};'use strict';var _=require(_0x64e7('0x0'));var util=require(_0x64e7('0x1'));var moment=require(_0x64e7('0x2'));var BPromise=require(_0x64e7('0x3'));var rs=require(_0x64e7('0x4'));var fs=require('fs');var Redis=require(_0x64e7('0x5'));var db=require(_0x64e7('0x6'))['db'];var utils=require(_0x64e7('0x7'));var logger=require(_0x64e7('0x8'))(_0x64e7('0x9'));var config=require(_0x64e7('0xa'));var jayson=require(_0x64e7('0xb'));var client=jayson['client'][_0x64e7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16408a,_0x2fa014,_0x16190a){return new BPromise(function(_0x2e732a,_0x182f1b){return client[_0x64e7('0xd')](_0x16408a,_0x16190a)[_0x64e7('0xe')](function(_0x5cf86b){logger['info'](_0x64e7('0xf'),_0x2fa014,_0x64e7('0x10'));logger[_0x64e7('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2fa014,_0x64e7('0x10'),JSON[_0x64e7('0x12')](_0x5cf86b));if(_0x5cf86b[_0x64e7('0x13')]){if(_0x5cf86b[_0x64e7('0x13')][_0x64e7('0x14')]===0x1f4){logger[_0x64e7('0x13')](_0x64e7('0xf'),_0x2fa014,_0x5cf86b[_0x64e7('0x13')][_0x64e7('0x15')]);return _0x182f1b(_0x5cf86b['error'][_0x64e7('0x15')]);}logger[_0x64e7('0x13')](_0x64e7('0xf'),_0x2fa014,_0x5cf86b['error'][_0x64e7('0x15')]);return _0x2e732a(_0x5cf86b[_0x64e7('0x13')][_0x64e7('0x15')]);}else{logger[_0x64e7('0x16')](_0x64e7('0xf'),_0x2fa014,_0x64e7('0x10'));_0x2e732a(_0x5cf86b[_0x64e7('0x17')][_0x64e7('0x15')]);}})[_0x64e7('0x18')](function(_0x14fd93){logger[_0x64e7('0x13')](_0x64e7('0xf'),_0x2fa014,_0x14fd93);_0x182f1b(_0x14fd93);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 50d8855..4c6b8a5 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 _0x77af=['./intZohoField.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x77af,0xd5));var _0xf77a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x77af[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0xf77a('0x0'));var path=require(_0xf77a('0x1'));var timeout=require(_0xf77a('0x2'));var express=require(_0xf77a('0x3'));var router=express[_0xf77a('0x4')]();var fs_extra=require(_0xf77a('0x5'));var auth=require(_0xf77a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf77a('0x7'));var controller=require(_0xf77a('0x8'));router[_0xf77a('0x9')]('/',auth[_0xf77a('0xa')](),controller['index']);router[_0xf77a('0x9')](_0xf77a('0xb'),auth[_0xf77a('0xa')](),controller[_0xf77a('0xc')]);router[_0xf77a('0xd')]('/',auth[_0xf77a('0xa')](),controller['create']);router[_0xf77a('0xe')](_0xf77a('0xb'),auth[_0xf77a('0xa')](),controller['update']);router[_0xf77a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf77a('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa904=['/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZohoField.controller','get'];(function(_0x43f1f6,_0x1f908c){var _0x377ab8=function(_0x33e4f4){while(--_0x33e4f4){_0x43f1f6['push'](_0x43f1f6['shift']());}};_0x377ab8(++_0x1f908c);}(_0xa904,0x75));var _0x4a90=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0xa904[_0x58d5ac];return _0x37985c;};'use strict';var multer=require(_0x4a90('0x0'));var util=require(_0x4a90('0x1'));var path=require(_0x4a90('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a90('0x3'));var router=express[_0x4a90('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4a90('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4a90('0x6'));var controller=require(_0x4a90('0x7'));router[_0x4a90('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4a90('0x9'),auth[_0x4a90('0xa')](),controller[_0x4a90('0xb')]);router[_0x4a90('0xc')]('/',auth[_0x4a90('0xa')](),controller[_0x4a90('0xd')]);router['put'](_0x4a90('0x9'),auth[_0x4a90('0xa')](),controller[_0x4a90('0xe')]);router[_0x4a90('0xf')](_0x4a90('0x9'),auth[_0x4a90('0xa')](),controller[_0x4a90('0x10')]);module[_0x4a90('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 51b5da9..6347354 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 _0x8c72=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x2c7780,_0x100f4a){var _0x580bc8=function(_0x3d435c){while(--_0x3d435c){_0x2c7780['push'](_0x2c7780['shift']());}};_0x580bc8(++_0x100f4a);}(_0x8c72,0xbf));var _0x28c7=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x8c72[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0x28c7('0x0'));module[_0x28c7('0x1')]={'type':{'type':Sequelize[_0x28c7('0x2')](_0x28c7('0x3'),_0x28c7('0x4'),_0x28c7('0x5'),_0x28c7('0x6'),_0x28c7('0x7')),'defaultValue':_0x28c7('0x3')},'content':{'type':Sequelize[_0x28c7('0x8')]},'key':{'type':Sequelize[_0x28c7('0x8')]},'keyType':{'type':Sequelize[_0x28c7('0x2')](_0x28c7('0x3'),_0x28c7('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x28c7('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x28c7('0x8')]},'customField':{'type':Sequelize[_0x28c7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7dc7=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x4642b6,_0x29b10d){var _0x43f675=function(_0x580965){while(--_0x580965){_0x4642b6['push'](_0x4642b6['shift']());}};_0x43f675(++_0x29b10d);}(_0x7dc7,0x81));var _0x77dc=function(_0xa11e23,_0x53a81f){_0xa11e23=_0xa11e23-0x0;var _0x4b47a0=_0x7dc7[_0xa11e23];return _0x4b47a0;};'use strict';var Sequelize=require(_0x77dc('0x0'));module['exports']={'type':{'type':Sequelize[_0x77dc('0x1')]('string',_0x77dc('0x2'),_0x77dc('0x3'),_0x77dc('0x4'),'picklist'),'defaultValue':_0x77dc('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x77dc('0x1')](_0x77dc('0x5'),_0x77dc('0x2'),_0x77dc('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x77dc('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x77dc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 2c2e906..84a00e7 100644 --- a/server/api/intZohoField/intZohoField.controller.js +++ b/server/api/intZohoField/intZohoField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13c9=['sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order'];(function(_0x456ab4,_0x3cfa9d){var _0x3b6cbf=function(_0x164728){while(--_0x164728){_0x456ab4['push'](_0x456ab4['shift']());}};_0x3b6cbf(++_0x3cfa9d);}(_0x13c9,0x1c1));var _0x913c=function(_0x5c40ff,_0x5b1ab1){_0x5c40ff=_0x5c40ff-0x0;var _0x36b95f=_0x13c9[_0x5c40ff];return _0x36b95f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x913c('0x0'));var zipdir=require(_0x913c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x913c('0x2'));var moment=require(_0x913c('0x3'));var BPromise=require(_0x913c('0x4'));var Mustache=require('mustache');var util=require(_0x913c('0x5'));var path=require(_0x913c('0x6'));var sox=require(_0x913c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x913c('0x8'));var _=require('lodash');var squel=require(_0x913c('0x9'));var crypto=require(_0x913c('0xa'));var jsforce=require(_0x913c('0xb'));var deskjs=require(_0x913c('0xc'));var toCsv=require(_0x913c('0xd'));var querystring=require(_0x913c('0xe'));var Papa=require(_0x913c('0xf'));var Redis=require(_0x913c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x913c('0x11'));var as=require(_0x913c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x913c('0x13'))(_0x913c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x913c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53e215,_0x28f048){_0x28f048=_0x28f048||0xcc;return function(_0x1edfef){if(_0x1edfef){return _0x53e215[_0x913c('0x16')](_0x28f048);}return _0x53e215['status'](_0x28f048)[_0x913c('0x17')]();};}function respondWithResult(_0x292d24,_0x42d6ce){_0x42d6ce=_0x42d6ce||0xc8;return function(_0x294a7e){if(_0x294a7e){return _0x292d24[_0x913c('0x18')](_0x42d6ce)['json'](_0x294a7e);}};}function respondWithFilteredResult(_0x2b12fa,_0x5f4791){return function(_0x21e73c){if(_0x21e73c){var _0x488602=typeof _0x5f4791[_0x913c('0x19')]==='undefined'&&typeof _0x5f4791[_0x913c('0x1a')]===_0x913c('0x1b');var _0x380707=_0x21e73c[_0x913c('0x1c')];var _0x5f4aa5=_0x488602?0x0:_0x5f4791['offset'];var _0x4cca44=_0x488602?_0x21e73c[_0x913c('0x1c')]:_0x5f4791['offset']+_0x5f4791[_0x913c('0x1a')];var _0x4fa1e8;if(_0x4cca44>=_0x380707){_0x4cca44=_0x380707;_0x4fa1e8=0xc8;}else{_0x4fa1e8=0xce;}_0x2b12fa['status'](_0x4fa1e8);return _0x2b12fa[_0x913c('0x1d')](_0x913c('0x1e'),_0x5f4aa5+'-'+_0x4cca44+'/'+_0x380707)[_0x913c('0x1f')](_0x21e73c);}return null;};}function patchUpdates(_0x3218b7){return function(_0x54abf1){try{jsonpatch[_0x913c('0x20')](_0x54abf1,_0x3218b7,!![]);}catch(_0x17cbd2){return BPromise[_0x913c('0x21')](_0x17cbd2);}return _0x54abf1[_0x913c('0x22')]();};}function saveUpdates(_0x11ce83,_0x59ac77){return function(_0x101213){if(_0x101213){return _0x101213[_0x913c('0x23')](_0x11ce83)[_0x913c('0x24')](function(_0x31bea0){return _0x31bea0;});}return null;};}function removeEntity(_0xf81001,_0xcf4b43){return function(_0x51fa29){if(_0x51fa29){return _0x51fa29[_0x913c('0x25')]()['then'](function(){_0xf81001['status'](0xcc)[_0x913c('0x17')]();});}};}function handleEntityNotFound(_0x4bd3fa,_0x3eadc6){return function(_0x30c89a){if(!_0x30c89a){_0x4bd3fa[_0x913c('0x16')](0x194);}return _0x30c89a;};}function handleError(_0x44b586,_0x2093c0){_0x2093c0=_0x2093c0||0x1f4;return function(_0x5d1023){logger[_0x913c('0x26')](_0x5d1023['stack']);if(_0x5d1023[_0x913c('0x27')]){delete _0x5d1023[_0x913c('0x27')];}_0x44b586[_0x913c('0x18')](_0x2093c0)[_0x913c('0x28')](_0x5d1023);};}exports[_0x913c('0x29')]=function(_0x2a5af0,_0x53cd99){var _0x4e65b3={},_0xf06d83={},_0x312bf1={'count':0x0,'rows':[]};var _0x4efc8e=_[_0x913c('0x2a')](db['ZohoField'][_0x913c('0x2b')],function(_0x4f026a){return{'name':_0x4f026a['fieldName'],'type':_0x4f026a[_0x913c('0x2c')][_0x913c('0x2d')]};});_0xf06d83[_0x913c('0x2e')]=_[_0x913c('0x2a')](_0x4efc8e,_0x913c('0x27'));_0xf06d83[_0x913c('0x2f')]=_[_0x913c('0x30')](_0x2a5af0['query']);_0xf06d83[_0x913c('0x31')]=_[_0x913c('0x32')](_0xf06d83[_0x913c('0x2e')],_0xf06d83[_0x913c('0x2f')]);_0x4e65b3[_0x913c('0x33')]=_[_0x913c('0x32')](_0xf06d83[_0x913c('0x2e')],qs[_0x913c('0x34')](_0x2a5af0[_0x913c('0x2f')]['fields']));_0x4e65b3[_0x913c('0x33')]=_0x4e65b3[_0x913c('0x33')][_0x913c('0x35')]?_0x4e65b3[_0x913c('0x33')]:_0xf06d83[_0x913c('0x2e')];if(!_0x2a5af0[_0x913c('0x2f')]['hasOwnProperty']('nolimit')){_0x4e65b3['limit']=qs[_0x913c('0x1a')](_0x2a5af0[_0x913c('0x2f')]['limit']);_0x4e65b3[_0x913c('0x19')]=qs[_0x913c('0x19')](_0x2a5af0[_0x913c('0x2f')][_0x913c('0x19')]);}_0x4e65b3[_0x913c('0x36')]=qs[_0x913c('0x37')](_0x2a5af0['query']['sort']);_0x4e65b3[_0x913c('0x38')]=qs[_0x913c('0x31')](_[_0x913c('0x39')](_0x2a5af0[_0x913c('0x2f')],_0xf06d83[_0x913c('0x31')]),_0x4efc8e);if(_0x2a5af0[_0x913c('0x2f')][_0x913c('0x3a')]){_0x4e65b3[_0x913c('0x38')]=_[_0x913c('0x3b')](_0x4e65b3[_0x913c('0x38')],{'$or':_[_0x913c('0x2a')](_0x4efc8e,function(_0x3c4804){if(_0x3c4804[_0x913c('0x2c')]!==_0x913c('0x3c')){var _0x30085d={};_0x30085d[_0x3c4804[_0x913c('0x27')]]={'$like':'%'+_0x2a5af0['query'][_0x913c('0x3a')]+'%'};return _0x30085d;}})});}_0x4e65b3=_['merge']({},_0x4e65b3,_0x2a5af0[_0x913c('0x3d')]);var _0x2a92a3={'where':_0x4e65b3[_0x913c('0x38')]};return db[_0x913c('0x3e')]['count'](_0x2a92a3)['then'](function(_0x399fe0){_0x312bf1[_0x913c('0x1c')]=_0x399fe0;if(_0x2a5af0[_0x913c('0x2f')][_0x913c('0x3f')]){_0x4e65b3[_0x913c('0x40')]=[{'all':!![]}];}return db[_0x913c('0x3e')][_0x913c('0x41')](_0x4e65b3);})[_0x913c('0x24')](function(_0x389e72){_0x312bf1[_0x913c('0x42')]=_0x389e72;return _0x312bf1;})[_0x913c('0x24')](respondWithFilteredResult(_0x53cd99,_0x4e65b3))[_0x913c('0x43')](handleError(_0x53cd99,null));};exports['show']=function(_0x2938b1,_0x1ddcbb){var _0x428f2b={'raw':!![],'where':{'id':_0x2938b1[_0x913c('0x44')]['id']}},_0x430eff={};_0x430eff[_0x913c('0x2e')]=_[_0x913c('0x30')](db[_0x913c('0x3e')][_0x913c('0x2b')]);_0x430eff[_0x913c('0x2f')]=_[_0x913c('0x30')](_0x2938b1[_0x913c('0x2f')]);_0x430eff[_0x913c('0x31')]=_[_0x913c('0x32')](_0x430eff['model'],_0x430eff[_0x913c('0x2f')]);_0x428f2b[_0x913c('0x33')]=_['intersection'](_0x430eff[_0x913c('0x2e')],qs[_0x913c('0x34')](_0x2938b1['query'][_0x913c('0x34')]));_0x428f2b[_0x913c('0x33')]=_0x428f2b[_0x913c('0x33')][_0x913c('0x35')]?_0x428f2b[_0x913c('0x33')]:_0x430eff[_0x913c('0x2e')];if(_0x2938b1['query'][_0x913c('0x3f')]){_0x428f2b[_0x913c('0x40')]=[{'all':!![]}];}_0x428f2b=_[_0x913c('0x3b')]({},_0x428f2b,_0x2938b1[_0x913c('0x3d')]);return db[_0x913c('0x3e')][_0x913c('0x45')](_0x428f2b)[_0x913c('0x24')](handleEntityNotFound(_0x1ddcbb,null))[_0x913c('0x24')](respondWithResult(_0x1ddcbb,null))['catch'](handleError(_0x1ddcbb,null));};exports[_0x913c('0x46')]=function(_0xe8d785,_0x18b0bf){return db[_0x913c('0x3e')][_0x913c('0x46')](_0xe8d785[_0x913c('0x47')],{})[_0x913c('0x24')](respondWithResult(_0x18b0bf,0xc9))[_0x913c('0x43')](handleError(_0x18b0bf,null));};exports[_0x913c('0x23')]=function(_0x4492ea,_0x57dd8f){if(_0x4492ea[_0x913c('0x47')]['id']){delete _0x4492ea['body']['id'];}return db[_0x913c('0x3e')]['find']({'where':{'id':_0x4492ea['params']['id']}})[_0x913c('0x24')](handleEntityNotFound(_0x57dd8f,null))[_0x913c('0x24')](saveUpdates(_0x4492ea[_0x913c('0x47')],null))[_0x913c('0x24')](respondWithResult(_0x57dd8f,null))[_0x913c('0x43')](handleError(_0x57dd8f,null));};exports[_0x913c('0x25')]=function(_0x43e329,_0x2f616c){return db[_0x913c('0x3e')][_0x913c('0x45')]({'where':{'id':_0x43e329[_0x913c('0x44')]['id']}})[_0x913c('0x24')](handleEntityNotFound(_0x2f616c,null))[_0x913c('0x24')](removeEntity(_0x2f616c,null))['catch'](handleError(_0x2f616c,null));}; \ No newline at end of file +var _0x7915=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ZohoField','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','show','params','keys','include','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x294925,_0x4ac28e){var _0xb19f18=function(_0x546d18){while(--_0x546d18){_0x294925['push'](_0x294925['shift']());}};_0xb19f18(++_0x4ac28e);}(_0x7915,0x1a9));var _0x5791=function(_0x4fa08a,_0x45b34e){_0x4fa08a=_0x4fa08a-0x0;var _0x514789=_0x7915[_0x4fa08a];return _0x514789;};'use strict';var emlformat=require(_0x5791('0x0'));var rimraf=require(_0x5791('0x1'));var zipdir=require(_0x5791('0x2'));var jsonpatch=require(_0x5791('0x3'));var rp=require(_0x5791('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5791('0x5'));var util=require(_0x5791('0x6'));var path=require(_0x5791('0x7'));var sox=require(_0x5791('0x8'));var csv=require('to-csv');var ejs=require(_0x5791('0x9'));var fs=require('fs');var fs_extra=require(_0x5791('0xa'));var _=require(_0x5791('0xb'));var squel=require(_0x5791('0xc'));var crypto=require(_0x5791('0xd'));var jsforce=require(_0x5791('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5791('0xf'));var querystring=require(_0x5791('0x10'));var Papa=require(_0x5791('0x11'));var Redis=require('ioredis');var authService=require(_0x5791('0x12'));var qs=require(_0x5791('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5791('0x14'));var logger=require(_0x5791('0x15'))(_0x5791('0x16'));var utils=require(_0x5791('0x17'));var config=require(_0x5791('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5791('0x19'))['db'];function respondWithStatusCode(_0x28dcfb,_0x37934e){_0x37934e=_0x37934e||0xcc;return function(_0x53eb50){if(_0x53eb50){return _0x28dcfb[_0x5791('0x1a')](_0x37934e);}return _0x28dcfb[_0x5791('0x1b')](_0x37934e)[_0x5791('0x1c')]();};}function respondWithResult(_0x2f6462,_0x16874a){_0x16874a=_0x16874a||0xc8;return function(_0x1209a1){if(_0x1209a1){return _0x2f6462[_0x5791('0x1b')](_0x16874a)[_0x5791('0x1d')](_0x1209a1);}};}function respondWithFilteredResult(_0x453f19,_0x345af3){return function(_0x5c4a6e){if(_0x5c4a6e){var _0x328e26=typeof _0x345af3[_0x5791('0x1e')]===_0x5791('0x1f')&&typeof _0x345af3[_0x5791('0x20')]===_0x5791('0x1f');var _0x11a449=_0x5c4a6e[_0x5791('0x21')];var _0x4f342c=_0x328e26?0x0:_0x345af3[_0x5791('0x1e')];var _0x42633c=_0x328e26?_0x5c4a6e[_0x5791('0x21')]:_0x345af3[_0x5791('0x1e')]+_0x345af3['limit'];var _0x23cdc2;if(_0x42633c>=_0x11a449){_0x42633c=_0x11a449;_0x23cdc2=0xc8;}else{_0x23cdc2=0xce;}_0x453f19[_0x5791('0x1b')](_0x23cdc2);return _0x453f19[_0x5791('0x22')](_0x5791('0x23'),_0x4f342c+'-'+_0x42633c+'/'+_0x11a449)[_0x5791('0x1d')](_0x5c4a6e);}return null;};}function patchUpdates(_0x5841bf){return function(_0x1cbedd){try{jsonpatch[_0x5791('0x24')](_0x1cbedd,_0x5841bf,!![]);}catch(_0x178fc5){return BPromise[_0x5791('0x25')](_0x178fc5);}return _0x1cbedd['save']();};}function saveUpdates(_0x4da09c,_0x3e6b17){return function(_0x25a1b1){if(_0x25a1b1){return _0x25a1b1[_0x5791('0x26')](_0x4da09c)[_0x5791('0x27')](function(_0x57900d){return _0x57900d;});}return null;};}function removeEntity(_0x4f9f81,_0x1bd93b){return function(_0xe8a1dd){if(_0xe8a1dd){return _0xe8a1dd[_0x5791('0x28')]()[_0x5791('0x27')](function(){_0x4f9f81['status'](0xcc)[_0x5791('0x1c')]();});}};}function handleEntityNotFound(_0x5eeb03,_0x17e85f){return function(_0x95262c){if(!_0x95262c){_0x5eeb03[_0x5791('0x1a')](0x194);}return _0x95262c;};}function handleError(_0x579797,_0x4eaa5d){_0x4eaa5d=_0x4eaa5d||0x1f4;return function(_0x5b2d42){logger[_0x5791('0x29')](_0x5b2d42['stack']);if(_0x5b2d42['name']){delete _0x5b2d42[_0x5791('0x2a')];}_0x579797['status'](_0x4eaa5d)[_0x5791('0x2b')](_0x5b2d42);};}exports[_0x5791('0x2c')]=function(_0x4c1c7f,_0x538d76){var _0x92421a={},_0x226f90={},_0x5eadc7={'count':0x0,'rows':[]};var _0x2769d3=_[_0x5791('0x2d')](db[_0x5791('0x2e')][_0x5791('0x2f')],function(_0x342875){return{'name':_0x342875[_0x5791('0x30')],'type':_0x342875['type'][_0x5791('0x31')]};});_0x226f90['model']=_['map'](_0x2769d3,_0x5791('0x2a'));_0x226f90[_0x5791('0x32')]=_['keys'](_0x4c1c7f[_0x5791('0x32')]);_0x226f90[_0x5791('0x33')]=_[_0x5791('0x34')](_0x226f90[_0x5791('0x35')],_0x226f90['query']);_0x92421a[_0x5791('0x36')]=_[_0x5791('0x34')](_0x226f90[_0x5791('0x35')],qs[_0x5791('0x37')](_0x4c1c7f[_0x5791('0x32')][_0x5791('0x37')]));_0x92421a[_0x5791('0x36')]=_0x92421a[_0x5791('0x36')][_0x5791('0x38')]?_0x92421a['attributes']:_0x226f90[_0x5791('0x35')];if(!_0x4c1c7f[_0x5791('0x32')][_0x5791('0x39')]('nolimit')){_0x92421a['limit']=qs[_0x5791('0x20')](_0x4c1c7f['query'][_0x5791('0x20')]);_0x92421a[_0x5791('0x1e')]=qs[_0x5791('0x1e')](_0x4c1c7f[_0x5791('0x32')][_0x5791('0x1e')]);}_0x92421a['order']=qs[_0x5791('0x3a')](_0x4c1c7f[_0x5791('0x32')][_0x5791('0x3a')]);_0x92421a[_0x5791('0x3b')]=qs[_0x5791('0x33')](_[_0x5791('0x3c')](_0x4c1c7f[_0x5791('0x32')],_0x226f90[_0x5791('0x33')]),_0x2769d3);if(_0x4c1c7f[_0x5791('0x32')][_0x5791('0x3d')]){_0x92421a[_0x5791('0x3b')]=_[_0x5791('0x3e')](_0x92421a[_0x5791('0x3b')],{'$or':_[_0x5791('0x2d')](_0x2769d3,function(_0x23a1d1){if(_0x23a1d1[_0x5791('0x3f')]!=='VIRTUAL'){var _0x53c4fc={};_0x53c4fc[_0x23a1d1[_0x5791('0x2a')]]={'$like':'%'+_0x4c1c7f['query'][_0x5791('0x3d')]+'%'};return _0x53c4fc;}})});}_0x92421a=_[_0x5791('0x3e')]({},_0x92421a,_0x4c1c7f[_0x5791('0x40')]);var _0x3e4b8a={'where':_0x92421a[_0x5791('0x3b')]};return db[_0x5791('0x2e')][_0x5791('0x21')](_0x3e4b8a)[_0x5791('0x27')](function(_0x47a2ef){_0x5eadc7[_0x5791('0x21')]=_0x47a2ef;if(_0x4c1c7f[_0x5791('0x32')][_0x5791('0x41')]){_0x92421a['include']=[{'all':!![]}];}return db['ZohoField'][_0x5791('0x42')](_0x92421a);})[_0x5791('0x27')](function(_0x39e2d1){_0x5eadc7[_0x5791('0x43')]=_0x39e2d1;return _0x5eadc7;})['then'](respondWithFilteredResult(_0x538d76,_0x92421a))['catch'](handleError(_0x538d76,null));};exports[_0x5791('0x44')]=function(_0x39c11e,_0x39fe41){var _0x5660b8={'raw':!![],'where':{'id':_0x39c11e[_0x5791('0x45')]['id']}},_0x359055={};_0x359055[_0x5791('0x35')]=_[_0x5791('0x46')](db[_0x5791('0x2e')]['rawAttributes']);_0x359055[_0x5791('0x32')]=_[_0x5791('0x46')](_0x39c11e[_0x5791('0x32')]);_0x359055[_0x5791('0x33')]=_[_0x5791('0x34')](_0x359055[_0x5791('0x35')],_0x359055[_0x5791('0x32')]);_0x5660b8['attributes']=_[_0x5791('0x34')](_0x359055[_0x5791('0x35')],qs[_0x5791('0x37')](_0x39c11e[_0x5791('0x32')]['fields']));_0x5660b8[_0x5791('0x36')]=_0x5660b8[_0x5791('0x36')]['length']?_0x5660b8['attributes']:_0x359055[_0x5791('0x35')];if(_0x39c11e[_0x5791('0x32')][_0x5791('0x41')]){_0x5660b8[_0x5791('0x47')]=[{'all':!![]}];}_0x5660b8=_['merge']({},_0x5660b8,_0x39c11e[_0x5791('0x40')]);return db['ZohoField'][_0x5791('0x48')](_0x5660b8)[_0x5791('0x27')](handleEntityNotFound(_0x39fe41,null))['then'](respondWithResult(_0x39fe41,null))[_0x5791('0x49')](handleError(_0x39fe41,null));};exports['create']=function(_0x252aee,_0x181a08){return db[_0x5791('0x2e')]['create'](_0x252aee[_0x5791('0x4a')],{})['then'](respondWithResult(_0x181a08,0xc9))[_0x5791('0x49')](handleError(_0x181a08,null));};exports[_0x5791('0x26')]=function(_0x5f0873,_0x1ecf33){if(_0x5f0873[_0x5791('0x4a')]['id']){delete _0x5f0873[_0x5791('0x4a')]['id'];}return db[_0x5791('0x2e')][_0x5791('0x48')]({'where':{'id':_0x5f0873['params']['id']}})[_0x5791('0x27')](handleEntityNotFound(_0x1ecf33,null))[_0x5791('0x27')](saveUpdates(_0x5f0873['body'],null))[_0x5791('0x27')](respondWithResult(_0x1ecf33,null))[_0x5791('0x49')](handleError(_0x1ecf33,null));};exports[_0x5791('0x28')]=function(_0xd31bf2,_0x474337){return db[_0x5791('0x2e')][_0x5791('0x48')]({'where':{'id':_0xd31bf2[_0x5791('0x45')]['id']}})[_0x5791('0x27')](handleEntityNotFound(_0x474337,null))[_0x5791('0x27')](removeEntity(_0x474337,null))[_0x5791('0x49')](handleError(_0x474337,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 26d28eb..ff1bfd0 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 _0x0adf=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index'];(function(_0x5cb2ca,_0x25298a){var _0x2b7e33=function(_0x58f4ef){while(--_0x58f4ef){_0x5cb2ca['push'](_0x5cb2ca['shift']());}};_0x2b7e33(++_0x25298a);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x504ac8,_0x16d0b2){_0x504ac8=_0x504ac8-0x0;var _0x314610=_0x0adf[_0x504ac8];return _0x314610;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var logger=require(_0xf0ad('0x2'))('api');var moment=require(_0xf0ad('0x3'));var BPromise=require(_0xf0ad('0x4'));var rp=require(_0xf0ad('0x5'));var fs=require('fs');var path=require(_0xf0ad('0x6'));var rimraf=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var attributes=require(_0xf0ad('0x9'));module['exports']=function(_0x3bbf85,_0x53221f){return _0x3bbf85[_0xf0ad('0xa')](_0xf0ad('0xb'),attributes,{'tableName':_0xf0ad('0xc'),'paranoid':![],'indexes':[{'name':_0xf0ad('0xd'),'fields':[_0xf0ad('0xe'),_0xf0ad('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x430c=['api','moment','bluebird','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x4c33d6,_0x10048f){var _0x22d6ef=function(_0x48e0ab){while(--_0x48e0ab){_0x4c33d6['push'](_0x4c33d6['shift']());}};_0x22d6ef(++_0x10048f);}(_0x430c,0x1a1));var _0xc430=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x430c[_0x19dd7a];return _0x3feb6a;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[{'name':_0xc430('0x8'),'fields':[_0xc430('0x9'),_0xc430('0xa')],'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 fcbbb87..9e2343f 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 _0x9c3a=['code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c4126,_0x3906f8){var _0x1f4ba3=function(_0x36f1e5){while(--_0x36f1e5){_0x2c4126['push'](_0x2c4126['shift']());}};_0x1f4ba3(++_0x3906f8);}(_0x9c3a,0x1a5));var _0xa9c3=function(_0x3ad7e6,_0x23cc6e){_0x3ad7e6=_0x3ad7e6-0x0;var _0x501df3=_0x9c3a[_0x3ad7e6];return _0x501df3;};'use strict';var _=require(_0xa9c3('0x0'));var util=require(_0xa9c3('0x1'));var moment=require(_0xa9c3('0x2'));var BPromise=require(_0xa9c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9c3('0x5'));var logger=require('../../config/logger')(_0xa9c3('0x6'));var config=require('../../config/environment');var jayson=require(_0xa9c3('0x7'));var client=jayson[_0xa9c3('0x8')][_0xa9c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43557c,_0x32e85e,_0x1ce383){return new BPromise(function(_0x4b3832,_0x2e177e){return client[_0xa9c3('0xa')](_0x43557c,_0x1ce383)[_0xa9c3('0xb')](function(_0x3add97){logger[_0xa9c3('0xc')](_0xa9c3('0xd'),_0x32e85e,_0xa9c3('0xe'));logger[_0xa9c3('0xf')](_0xa9c3('0x10'),_0x32e85e,_0xa9c3('0xe'),JSON[_0xa9c3('0x11')](_0x3add97));if(_0x3add97['error']){if(_0x3add97[_0xa9c3('0x12')][_0xa9c3('0x13')]===0x1f4){logger['error'](_0xa9c3('0xd'),_0x32e85e,_0x3add97[_0xa9c3('0x12')][_0xa9c3('0x14')]);return _0x2e177e(_0x3add97['error'][_0xa9c3('0x14')]);}logger[_0xa9c3('0x12')](_0xa9c3('0xd'),_0x32e85e,_0x3add97[_0xa9c3('0x12')]['message']);return _0x4b3832(_0x3add97[_0xa9c3('0x12')][_0xa9c3('0x14')]);}else{logger[_0xa9c3('0xc')](_0xa9c3('0xd'),_0x32e85e,_0xa9c3('0xe'));_0x4b3832(_0x3add97[_0xa9c3('0x15')]['message']);}})['catch'](function(_0x16ae46){logger[_0xa9c3('0x12')]('ZohoField,\x20%s,\x20%s',_0x32e85e,_0x16ae46);_0x2e177e(_0x16ae46);});});} \ No newline at end of file +var _0x5d6c=['debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x103c7c,_0x3e464d){var _0x18d62b=function(_0x428883){while(--_0x428883){_0x103c7c['push'](_0x103c7c['shift']());}};_0x18d62b(++_0x3e464d);}(_0x5d6c,0x93));var _0xc5d6=function(_0xea80a5,_0x4397d1){_0xea80a5=_0xea80a5-0x0;var _0x4f063f=_0x5d6c[_0xea80a5];return _0x4f063f;};'use strict';var _=require(_0xc5d6('0x0'));var util=require('util');var moment=require(_0xc5d6('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5d6('0x2'));var fs=require('fs');var Redis=require(_0xc5d6('0x3'));var db=require(_0xc5d6('0x4'))['db'];var utils=require(_0xc5d6('0x5'));var logger=require(_0xc5d6('0x6'))(_0xc5d6('0x7'));var config=require('../../config/environment');var jayson=require(_0xc5d6('0x8'));var client=jayson['client'][_0xc5d6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe5d93d,_0x12380a,_0x22ee5a){return new BPromise(function(_0x34906e,_0x1d36b1){return client[_0xc5d6('0xa')](_0xe5d93d,_0x22ee5a)[_0xc5d6('0xb')](function(_0x5e07ee){logger[_0xc5d6('0xc')](_0xc5d6('0xd'),_0x12380a,'request\x20sent');logger[_0xc5d6('0xe')](_0xc5d6('0xf'),_0x12380a,'request\x20sent',JSON[_0xc5d6('0x10')](_0x5e07ee));if(_0x5e07ee['error']){if(_0x5e07ee[_0xc5d6('0x11')][_0xc5d6('0x12')]===0x1f4){logger[_0xc5d6('0x11')](_0xc5d6('0xd'),_0x12380a,_0x5e07ee['error'][_0xc5d6('0x13')]);return _0x1d36b1(_0x5e07ee[_0xc5d6('0x11')]['message']);}logger['error'](_0xc5d6('0xd'),_0x12380a,_0x5e07ee[_0xc5d6('0x11')]['message']);return _0x34906e(_0x5e07ee['error']['message']);}else{logger[_0xc5d6('0xc')](_0xc5d6('0xd'),_0x12380a,_0xc5d6('0x14'));_0x34906e(_0x5e07ee[_0xc5d6('0x15')][_0xc5d6('0x13')]);}})[_0xc5d6('0x16')](function(_0x2ac68e){logger[_0xc5d6('0x11')](_0xc5d6('0xd'),_0x12380a,_0x2ac68e);_0x1d36b1(_0x2ac68e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 2b18255..b9bd6cc 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x40c043,_0x1d064e){var _0x5c2c8d=function(_0xab4403){while(--_0xab4403){_0x40c043['push'](_0x40c043['shift']());}};_0x5c2c8d(++_0x1d064e);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x26ebba,_0x1462c3){var _0x6c04d9=function(_0x13f819){while(--_0x13f819){_0x26ebba['push'](_0x26ebba['shift']());}};_0x6c04d9(++_0x1462c3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xcb91[_0x474bc0];return _0x4b24cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index f1a0084..0813252 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 _0x11a9=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x11a9,0x11b));var _0x911a=function(_0x40e374,_0x66d9e3){_0x40e374=_0x40e374-0x0;var _0x486467=_0x11a9[_0x40e374];return _0x486467;};'use strict';var Sequelize=require(_0x911a('0x0'));module[_0x911a('0x1')]={'name':{'type':Sequelize[_0x911a('0x2')],'allowNull':![],'unique':_0x911a('0x3')},'version':{'type':Sequelize[_0x911a('0x2')],'allowNull':![],'unique':_0x911a('0x3')},'main':{'type':Sequelize[_0x911a('0x2')],'defaultValue':_0x911a('0x4')},'filename':{'type':Sequelize[_0x911a('0x2')]},'path':{'type':Sequelize[_0x911a('0x2')]},'type':{'type':Sequelize[_0x911a('0x2')]},'size':{'type':Sequelize[_0x911a('0x5')]},'active':{'type':Sequelize[_0x911a('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x911a('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x911a('0x7')},'description':{'type':Sequelize[_0x911a('0x2')]},'title':{'type':Sequelize[_0x911a('0x2')]},'remoteUri':{'type':Sequelize[_0x911a('0x2')]},'link':{'type':Sequelize[_0x911a('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xe36f=['state','sequelize','exports','unique_name_and_version','app.js','STRING','INTEGER'];(function(_0x3ba489,_0x1fba52){var _0x241c03=function(_0xec61f1){while(--_0xec61f1){_0x3ba489['push'](_0x3ba489['shift']());}};_0x241c03(++_0x1fba52);}(_0xe36f,0x189));var _0xfe36=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe36f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xfe36('0x0'));module[_0xfe36('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfe36('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfe36('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xfe36('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xfe36('0x4')]},'type':{'type':Sequelize[_0xfe36('0x4')]},'size':{'type':Sequelize[_0xfe36('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xfe36('0x4')]},'state':{'type':Sequelize[_0xfe36('0x4')],'unique':_0xfe36('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xfe36('0x4')]},'remoteUri':{'type':Sequelize[_0xfe36('0x4')]},'link':{'type':Sequelize[_0xfe36('0x4')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index f292abe..fe12ae0 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 _0x6343=['hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','Integration','then','rows','catch','show','params','keys','includeAll','include','create','body','find','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length'];(function(_0x55b39c,_0x5915df){var _0x122834=function(_0xce518){while(--_0xce518){_0x55b39c['push'](_0x55b39c['shift']());}};_0x122834(++_0x5915df);}(_0x6343,0x168));var _0x3634=function(_0x30340a,_0x4e81e6){_0x30340a=_0x30340a-0x0;var _0x40158a=_0x6343[_0x30340a];return _0x40158a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['Integration'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));}; \ No newline at end of file +var _0xe3da=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x39b148,_0x37726e){var _0x17a5ef=function(_0x35a1c0){while(--_0x35a1c0){_0x39b148['push'](_0x39b148['shift']());}};_0x17a5ef(++_0x37726e);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['create'](_0x38f92d['body'],{})['then'](respondWithResult(_0x4ed0f9,0xc9))[_0xae3d('0x48')](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0x39f213,_0x6fa6c){if(_0x39f213['body']['id']){delete _0x39f213['body']['id'];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x39f213[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x6fa6c,null))['then'](saveUpdates(_0x39f213[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x6fa6c,null))[_0xae3d('0x48')](handleError(_0x6fa6c,null));};exports[_0xae3d('0x29')]=function(_0x2a6a24,_0x38ccf1){return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x2a6a24[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x38ccf1,null))[_0xae3d('0x28')](removeEntity(_0x38ccf1,null))[_0xae3d('0x48')](handleError(_0x38ccf1,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d7d98e2..c2cff9c 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 _0xc56c=['moment','bluebird','request-promise','./integration.attributes','exports','Integration','integrations','util'];(function(_0x32a4c4,_0x56d4cd){var _0x3bc99d=function(_0x99a42e){while(--_0x99a42e){_0x32a4c4['push'](_0x32a4c4['shift']());}};_0x3bc99d(++_0x56d4cd);}(_0xc56c,0xff));var _0xcc56=function(_0x1c0876,_0x30bd74){_0x1c0876=_0x1c0876-0x0;var _0xce9b6b=_0xc56c[_0x1c0876];return _0xce9b6b;};'use strict';var _=require('lodash');var util=require(_0xcc56('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xcc56('0x1'));var BPromise=require(_0xcc56('0x2'));var rp=require(_0xcc56('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc56('0x4'));module[_0xcc56('0x5')]=function(_0x45b5db,_0x5a24b8){return _0x45b5db['define'](_0xcc56('0x6'),attributes,{'tableName':_0xcc56('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe71a=['bluebird','path','exports','Integration','integrations','util'];(function(_0x30abc0,_0x397817){var _0x2b34b1=function(_0x4d433a){while(--_0x4d433a){_0x30abc0['push'](_0x30abc0['shift']());}};_0x2b34b1(++_0x397817);}(_0xe71a,0x1bb));var _0xae71=function(_0x5ee57c,_0x5bb461){_0x5ee57c=_0x5ee57c-0x0;var _0x625ca8=_0xe71a[_0x5ee57c];return _0x625ca8;};'use strict';var _=require('lodash');var util=require(_0xae71('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xae71('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae71('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xae71('0x3')]=function(_0x20f9b2,_0x5a4206){return _0x20f9b2['define'](_0xae71('0x4'),attributes,{'tableName':_0xae71('0x5'),'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 6a32311..b442d9f 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x524e,0x15e));var _0xe524=function(_0x11c727,_0x25b72b){_0x11c727=_0x11c727-0x0;var _0xa38b5e=_0x524e[_0x11c727];return _0xa38b5e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x47901d,_0xc6e227){var _0x36bab8=function(_0x25ec39){while(--_0x25ec39){_0x47901d['push'](_0x47901d['shift']());}};_0x36bab8(++_0xc6e227);}(_0x2542,0x169));var _0x2254=function(_0x233048,_0x54803a){_0x233048=_0x233048-0x0;var _0x3ffd8d=_0x2542[_0x233048];return _0x3ffd8d;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index ad836f9..5662f02 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0xe5a4b2,_0x4292d4){var _0x480130=function(_0x140b60){while(--_0x140b60){_0xe5a4b2['push'](_0xe5a4b2['shift']());}};_0x480130(++_0x4292d4);}(_0x2542,0x169));var _0x2254=function(_0x1f920b,_0x483654){_0x1f920b=_0x1f920b-0x0;var _0x17d3c5=_0x2542[_0x1f920b];return _0x17d3c5;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x54e573,_0x129035){_0x54e573=_0x54e573-0x0;var _0x14d781=_0x5f2f[_0x54e573];return _0x14d781;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 4b636a1..b555aeb 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 _0x78c2=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','sequelize','STRING'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x78c2,0x1b6));var _0x278c=function(_0x8871dd,_0x1ccd88){_0x8871dd=_0x8871dd-0x0;var _0x30319e=_0x78c2[_0x8871dd];return _0x30319e;};'use strict';var Sequelize=require(_0x278c('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x278c('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x278c('0x1')]},'integrationId':{'type':Sequelize[_0x278c('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x278c('0x1')]},'calleridnum':{'type':Sequelize[_0x278c('0x1')]},'calleridname':{'type':Sequelize[_0x278c('0x1')]},'queue':{'type':Sequelize[_0x278c('0x1')]},'interface':{'type':Sequelize[_0x278c('0x1')]},'membername':{'type':Sequelize[_0x278c('0x1')]},'agentcalledAt':{'type':Sequelize[_0x278c('0x3')]},'agentconnectAt':{'type':Sequelize[_0x278c('0x3')]},'holdtime':{'type':Sequelize[_0x278c('0x2')]},'agentcomplete':{'type':Sequelize[_0x278c('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x278c('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x278c('0x2')]},'reason':{'type':Sequelize[_0x278c('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x278c('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x278c('0x1')]},'channelstate':{'type':Sequelize[_0x278c('0x2')]},'channelstatedesc':{'type':Sequelize[_0x278c('0x1')]},'connectedlinenum':{'type':Sequelize[_0x278c('0x1')]},'connectedlinename':{'type':Sequelize[_0x278c('0x1')]},'language':{'type':Sequelize[_0x278c('0x1')]},'accountcode':{'type':Sequelize[_0x278c('0x1')]},'context':{'type':Sequelize[_0x278c('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x278c('0x1')]},'destchannel':{'type':Sequelize[_0x278c('0x1')]},'destchannelstate':{'type':Sequelize[_0x278c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x278c('0x1')]},'destcalleridnum':{'type':Sequelize[_0x278c('0x1')]},'destcalleridname':{'type':Sequelize[_0x278c('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x278c('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x278c('0x1')]},'destaccountcode':{'type':Sequelize[_0x278c('0x1')]},'destcontext':{'type':Sequelize[_0x278c('0x1')]},'destexten':{'type':Sequelize[_0x278c('0x1')]},'destpriority':{'type':Sequelize[_0x278c('0x1')]},'destuniqueid':{'type':Sequelize[_0x278c('0x1')]},'messageId':{'type':Sequelize[_0x278c('0x1')]},'inReplyTo':{'type':Sequelize[_0x278c('0x1')]},'subject':{'type':Sequelize[_0x278c('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x278c('0x1')]},'cc':{'type':Sequelize[_0x278c('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x278c('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x278c('0x6')](_0x278c('0x7'),_0x278c('0x8'),'RECEIVED',_0x278c('0x9'))},'url':{'type':Sequelize[_0x278c('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x278c('0x2')]}}; \ No newline at end of file +var _0x2f63=['SENDING','RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x1d4755,_0x274d8a){var _0x20d979=function(_0x3e883b){while(--_0x3e883b){_0x1d4755['push'](_0x1d4755['shift']());}};_0x20d979(++_0x274d8a);}(_0x2f63,0x9c));var _0x32f6=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x2f63[_0x2bddf9];return _0x3f3ae9;};'use strict';var Sequelize=require(_0x32f6('0x0'));module[_0x32f6('0x1')]={'integration':{'type':Sequelize[_0x32f6('0x2')]},'eventChannel':{'type':Sequelize[_0x32f6('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x32f6('0x2')]},'integrationId':{'type':Sequelize[_0x32f6('0x3')]},'contacts':{'type':Sequelize[_0x32f6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x32f6('0x2')]},'calleridname':{'type':Sequelize[_0x32f6('0x2')]},'queue':{'type':Sequelize[_0x32f6('0x2')]},'interface':{'type':Sequelize[_0x32f6('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x32f6('0x4')]},'agentconnectAt':{'type':Sequelize[_0x32f6('0x4')]},'holdtime':{'type':Sequelize[_0x32f6('0x3')]},'agentcomplete':{'type':Sequelize[_0x32f6('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x32f6('0x4')]},'talktime':{'type':Sequelize[_0x32f6('0x3')]},'agentacw':{'type':Sequelize[_0x32f6('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x32f6('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x32f6('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x32f6('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x32f6('0x4')]},'lastevent':{'type':Sequelize[_0x32f6('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x32f6('0x3')]},'channelstatedesc':{'type':Sequelize[_0x32f6('0x2')]},'connectedlinenum':{'type':Sequelize[_0x32f6('0x2')]},'connectedlinename':{'type':Sequelize[_0x32f6('0x2')]},'language':{'type':Sequelize[_0x32f6('0x2')]},'accountcode':{'type':Sequelize[_0x32f6('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x32f6('0x2')]},'destchannelstate':{'type':Sequelize[_0x32f6('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x32f6('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x32f6('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x32f6('0x2')]},'destlanguage':{'type':Sequelize[_0x32f6('0x2')]},'destaccountcode':{'type':Sequelize[_0x32f6('0x2')]},'destcontext':{'type':Sequelize[_0x32f6('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x32f6('0x2')]},'destuniqueid':{'type':Sequelize[_0x32f6('0x2')]},'messageId':{'type':Sequelize[_0x32f6('0x2')]},'inReplyTo':{'type':Sequelize[_0x32f6('0x2')]},'subject':{'type':Sequelize[_0x32f6('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x32f6('0x2')]},'attachment':{'type':Sequelize[_0x32f6('0x6')]},'html':{'type':Sequelize[_0x32f6('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x32f6('0x7')](_0x32f6('0x8'),_0x32f6('0x9'),_0x32f6('0xa'),'FAILED')},'url':{'type':Sequelize[_0x32f6('0x2')]},'app':{'type':Sequelize[_0x32f6('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x32f6('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 6c524a0..d7a9ddb 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 _0x1bfe=['request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','findAll','rows','show','params','keys','length','create','body','catch','find','describe','eml-format','rimraf','fast-json-patch'];(function(_0x317c26,_0x547bab){var _0x535f00=function(_0x3590bd){while(--_0x3590bd){_0x317c26['push'](_0x317c26['shift']());}};_0x535f00(++_0x547bab);}(_0x1bfe,0xe1));var _0xe1bf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1bfe[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xe1bf('0x0'));var rimraf=require(_0xe1bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1bf('0x2'));var rp=require(_0xe1bf('0x3'));var moment=require(_0xe1bf('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe1bf('0x5'));var path=require(_0xe1bf('0x6'));var sox=require('sox');var csv=require(_0xe1bf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe1bf('0x8'));var _=require(_0xe1bf('0x9'));var squel=require(_0xe1bf('0xa'));var crypto=require(_0xe1bf('0xb'));var jsforce=require(_0xe1bf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe1bf('0x7'));var querystring=require(_0xe1bf('0xd'));var Papa=require(_0xe1bf('0xe'));var Redis=require(_0xe1bf('0xf'));var authService=require(_0xe1bf('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe1bf('0x11'));var hardwareService=require(_0xe1bf('0x12'));var logger=require(_0xe1bf('0x13'))('api');var utils=require(_0xe1bf('0x14'));var config=require(_0xe1bf('0x15'));var licenseUtil=require(_0xe1bf('0x16'));var db=require(_0xe1bf('0x17'))['db'];function respondWithStatusCode(_0x56a2f6,_0x122513){_0x122513=_0x122513||0xcc;return function(_0x401c69){if(_0x401c69){return _0x56a2f6['sendStatus'](_0x122513);}return _0x56a2f6['status'](_0x122513)[_0xe1bf('0x18')]();};}function respondWithResult(_0xb15a57,_0x450cac){_0x450cac=_0x450cac||0xc8;return function(_0x32db48){if(_0x32db48){return _0xb15a57[_0xe1bf('0x19')](_0x450cac)[_0xe1bf('0x1a')](_0x32db48);}};}function respondWithFilteredResult(_0x2f7bd9,_0x48c8c6){return function(_0x3d0f49){if(_0x3d0f49){var _0x49740b=typeof _0x48c8c6[_0xe1bf('0x1b')]===_0xe1bf('0x1c')&&typeof _0x48c8c6['limit']===_0xe1bf('0x1c');var _0x932998=_0x3d0f49[_0xe1bf('0x1d')];var _0x2791e7=_0x49740b?0x0:_0x48c8c6[_0xe1bf('0x1b')];var _0x46f568=_0x49740b?_0x3d0f49[_0xe1bf('0x1d')]:_0x48c8c6[_0xe1bf('0x1b')]+_0x48c8c6['limit'];var _0x40bb86;if(_0x46f568>=_0x932998){_0x46f568=_0x932998;_0x40bb86=0xc8;}else{_0x40bb86=0xce;}_0x2f7bd9['status'](_0x40bb86);return _0x2f7bd9[_0xe1bf('0x1e')]('Content-Range',_0x2791e7+'-'+_0x46f568+'/'+_0x932998)[_0xe1bf('0x1a')](_0x3d0f49);}return null;};}function patchUpdates(_0xbf5224){return function(_0x2a145a){try{jsonpatch[_0xe1bf('0x1f')](_0x2a145a,_0xbf5224,!![]);}catch(_0x3dfc84){return BPromise[_0xe1bf('0x20')](_0x3dfc84);}return _0x2a145a['save']();};}function saveUpdates(_0x1a9289,_0x5f41bb){return function(_0x3915a3){if(_0x3915a3){return _0x3915a3[_0xe1bf('0x21')](_0x1a9289)[_0xe1bf('0x22')](function(_0x451804){return _0x451804;});}return null;};}function removeEntity(_0x215d81,_0x3dac1d){return function(_0x71ee43){if(_0x71ee43){return _0x71ee43[_0xe1bf('0x23')]()[_0xe1bf('0x22')](function(){_0x215d81[_0xe1bf('0x19')](0xcc)[_0xe1bf('0x18')]();});}};}function handleEntityNotFound(_0x2bde14,_0x155ed0){return function(_0x48bd14){if(!_0x48bd14){_0x2bde14[_0xe1bf('0x24')](0x194);}return _0x48bd14;};}function handleError(_0x499721,_0x4f8c0b){_0x4f8c0b=_0x4f8c0b||0x1f4;return function(_0x5a5990){logger[_0xe1bf('0x25')](_0x5a5990[_0xe1bf('0x26')]);if(_0x5a5990[_0xe1bf('0x27')]){delete _0x5a5990[_0xe1bf('0x27')];}_0x499721[_0xe1bf('0x19')](_0x4f8c0b)[_0xe1bf('0x28')](_0x5a5990);};}exports['index']=function(_0x40b556,_0x36acf5){var _0x4bb835={},_0x1aae59={},_0x19f88c={'count':0x0,'rows':[]};var _0x33cdfe=_[_0xe1bf('0x29')](db['IntegrationReport'][_0xe1bf('0x2a')],function(_0x5c7829){return{'name':_0x5c7829[_0xe1bf('0x2b')],'type':_0x5c7829[_0xe1bf('0x2c')][_0xe1bf('0x2d')]};});_0x1aae59['model']=_[_0xe1bf('0x29')](_0x33cdfe,_0xe1bf('0x27'));_0x1aae59['query']=_['keys'](_0x40b556[_0xe1bf('0x2e')]);_0x1aae59['filters']=_['intersection'](_0x1aae59[_0xe1bf('0x2f')],_0x1aae59[_0xe1bf('0x2e')]);_0x4bb835[_0xe1bf('0x30')]=_[_0xe1bf('0x31')](_0x1aae59['model'],qs[_0xe1bf('0x32')](_0x40b556[_0xe1bf('0x2e')][_0xe1bf('0x32')]));_0x4bb835[_0xe1bf('0x30')]=_0x4bb835[_0xe1bf('0x30')]['length']?_0x4bb835[_0xe1bf('0x30')]:_0x1aae59[_0xe1bf('0x2f')];if(!_0x40b556[_0xe1bf('0x2e')][_0xe1bf('0x33')](_0xe1bf('0x34'))){_0x4bb835[_0xe1bf('0x35')]=qs[_0xe1bf('0x35')](_0x40b556['query'][_0xe1bf('0x35')]);_0x4bb835[_0xe1bf('0x1b')]=qs['offset'](_0x40b556[_0xe1bf('0x2e')][_0xe1bf('0x1b')]);}_0x4bb835[_0xe1bf('0x36')]=qs['sort'](_0x40b556[_0xe1bf('0x2e')]['sort']);_0x4bb835[_0xe1bf('0x37')]=qs[_0xe1bf('0x38')](_[_0xe1bf('0x39')](_0x40b556[_0xe1bf('0x2e')],_0x1aae59[_0xe1bf('0x38')]),_0x33cdfe);if(_0x40b556[_0xe1bf('0x2e')][_0xe1bf('0x3a')]){_0x4bb835['where']=_[_0xe1bf('0x3b')](_0x4bb835[_0xe1bf('0x37')],{'$or':_[_0xe1bf('0x29')](_0x33cdfe,function(_0x2c1cad){if(_0x2c1cad[_0xe1bf('0x2c')]!==_0xe1bf('0x3c')){var _0x128027={};_0x128027[_0x2c1cad['name']]={'$like':'%'+_0x40b556[_0xe1bf('0x2e')][_0xe1bf('0x3a')]+'%'};return _0x128027;}})});}_0x4bb835=_[_0xe1bf('0x3b')]({},_0x4bb835,_0x40b556[_0xe1bf('0x3d')]);var _0x26dd58={'where':_0x4bb835[_0xe1bf('0x37')]};return db[_0xe1bf('0x3e')][_0xe1bf('0x1d')](_0x26dd58)['then'](function(_0x47255b){_0x19f88c[_0xe1bf('0x1d')]=_0x47255b;if(_0x40b556[_0xe1bf('0x2e')][_0xe1bf('0x3f')]){_0x4bb835[_0xe1bf('0x40')]=[{'all':!![]}];}return db[_0xe1bf('0x3e')][_0xe1bf('0x41')](_0x4bb835);})['then'](function(_0x5110eb){_0x19f88c[_0xe1bf('0x42')]=_0x5110eb;return _0x19f88c;})[_0xe1bf('0x22')](respondWithFilteredResult(_0x36acf5,_0x4bb835))['catch'](handleError(_0x36acf5,null));};exports[_0xe1bf('0x43')]=function(_0x2a3b91,_0x447891){var _0x33736b={'raw':![],'where':{'id':_0x2a3b91[_0xe1bf('0x44')]['id']}},_0x2fde3d={};_0x2fde3d[_0xe1bf('0x2f')]=_[_0xe1bf('0x45')](db[_0xe1bf('0x3e')][_0xe1bf('0x2a')]);_0x2fde3d['query']=_[_0xe1bf('0x45')](_0x2a3b91[_0xe1bf('0x2e')]);_0x2fde3d[_0xe1bf('0x38')]=_[_0xe1bf('0x31')](_0x2fde3d['model'],_0x2fde3d[_0xe1bf('0x2e')]);_0x33736b[_0xe1bf('0x30')]=_[_0xe1bf('0x31')](_0x2fde3d['model'],qs[_0xe1bf('0x32')](_0x2a3b91[_0xe1bf('0x2e')]['fields']));_0x33736b[_0xe1bf('0x30')]=_0x33736b[_0xe1bf('0x30')][_0xe1bf('0x46')]?_0x33736b[_0xe1bf('0x30')]:_0x2fde3d[_0xe1bf('0x2f')];if(_0x2a3b91['query']['includeAll']){_0x33736b['include']=[{'all':!![]}];}_0x33736b=_[_0xe1bf('0x3b')]({},_0x33736b,_0x2a3b91[_0xe1bf('0x3d')]);return db['IntegrationReport']['find'](_0x33736b)[_0xe1bf('0x22')](handleEntityNotFound(_0x447891,null))['then'](respondWithResult(_0x447891,null))['catch'](handleError(_0x447891,null));};exports[_0xe1bf('0x47')]=function(_0x231a16,_0x2cfbd3){return db['IntegrationReport'][_0xe1bf('0x47')](_0x231a16[_0xe1bf('0x48')],{})[_0xe1bf('0x22')](respondWithResult(_0x2cfbd3,0xc9))[_0xe1bf('0x49')](handleError(_0x2cfbd3,null));};exports[_0xe1bf('0x21')]=function(_0x21f6e6,_0x204603){if(_0x21f6e6[_0xe1bf('0x48')]['id']){delete _0x21f6e6['body']['id'];}return db[_0xe1bf('0x3e')][_0xe1bf('0x4a')]({'where':{'id':_0x21f6e6['params']['id']}})[_0xe1bf('0x22')](handleEntityNotFound(_0x204603,null))[_0xe1bf('0x22')](saveUpdates(_0x21f6e6[_0xe1bf('0x48')],null))['then'](respondWithResult(_0x204603,null))[_0xe1bf('0x49')](handleError(_0x204603,null));};exports[_0xe1bf('0x23')]=function(_0x353bb9,_0x3cc293){return db[_0xe1bf('0x3e')]['find']({'where':{'id':_0x353bb9['params']['id']}})[_0xe1bf('0x22')](handleEntityNotFound(_0x3cc293,null))[_0xe1bf('0x22')](removeEntity(_0x3cc293,null))['catch'](handleError(_0x3cc293,null));};exports[_0xe1bf('0x4b')]=function(_0x108808,_0x5323e3){return db[_0xe1bf('0x3e')][_0xe1bf('0x4b')]()[_0xe1bf('0x22')](respondWithResult(_0x5323e3,null))[_0xe1bf('0x49')](handleError(_0x5323e3,null));}; \ No newline at end of file +var _0x759b=['reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','apply'];(function(_0x1ea786,_0x3b172b){var _0xe5d45=function(_0xc5e505){while(--_0xc5e505){_0x1ea786['push'](_0x1ea786['shift']());}};_0xe5d45(++_0x3b172b);}(_0x759b,0x75));var _0xb759=function(_0x4ff1a8,_0xbb3134){_0x4ff1a8=_0x4ff1a8-0x0;var _0x5b5582=_0x759b[_0x4ff1a8];return _0x5b5582;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb759('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb759('0x1'));var rp=require(_0xb759('0x2'));var moment=require('moment');var BPromise=require(_0xb759('0x3'));var Mustache=require(_0xb759('0x4'));var util=require('util');var path=require(_0xb759('0x5'));var sox=require(_0xb759('0x6'));var csv=require('to-csv');var ejs=require(_0xb759('0x7'));var fs=require('fs');var fs_extra=require(_0xb759('0x8'));var _=require(_0xb759('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb759('0xa'));var deskjs=require(_0xb759('0xb'));var toCsv=require(_0xb759('0xc'));var querystring=require(_0xb759('0xd'));var Papa=require('papaparse');var Redis=require(_0xb759('0xe'));var authService=require(_0xb759('0xf'));var qs=require(_0xb759('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb759('0x11'));var logger=require(_0xb759('0x12'))(_0xb759('0x13'));var utils=require(_0xb759('0x14'));var config=require(_0xb759('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb759('0x16'))['db'];function respondWithStatusCode(_0xbfc451,_0x528fa1){_0x528fa1=_0x528fa1||0xcc;return function(_0x3cca90){if(_0x3cca90){return _0xbfc451['sendStatus'](_0x528fa1);}return _0xbfc451[_0xb759('0x17')](_0x528fa1)[_0xb759('0x18')]();};}function respondWithResult(_0x1828e6,_0x2922f9){_0x2922f9=_0x2922f9||0xc8;return function(_0x46768c){if(_0x46768c){return _0x1828e6[_0xb759('0x17')](_0x2922f9)['json'](_0x46768c);}};}function respondWithFilteredResult(_0x4ea3a4,_0x58d22c){return function(_0x2ed7e7){if(_0x2ed7e7){var _0x337afa=typeof _0x58d22c[_0xb759('0x19')]===_0xb759('0x1a')&&typeof _0x58d22c[_0xb759('0x1b')]===_0xb759('0x1a');var _0x1083fb=_0x2ed7e7[_0xb759('0x1c')];var _0x4d7dce=_0x337afa?0x0:_0x58d22c[_0xb759('0x19')];var _0x2ad407=_0x337afa?_0x2ed7e7[_0xb759('0x1c')]:_0x58d22c[_0xb759('0x19')]+_0x58d22c[_0xb759('0x1b')];var _0x52eb6e;if(_0x2ad407>=_0x1083fb){_0x2ad407=_0x1083fb;_0x52eb6e=0xc8;}else{_0x52eb6e=0xce;}_0x4ea3a4[_0xb759('0x17')](_0x52eb6e);return _0x4ea3a4['set'](_0xb759('0x1d'),_0x4d7dce+'-'+_0x2ad407+'/'+_0x1083fb)['json'](_0x2ed7e7);}return null;};}function patchUpdates(_0x42518e){return function(_0x216cf2){try{jsonpatch[_0xb759('0x1e')](_0x216cf2,_0x42518e,!![]);}catch(_0x44a2f2){return BPromise[_0xb759('0x1f')](_0x44a2f2);}return _0x216cf2[_0xb759('0x20')]();};}function saveUpdates(_0x3b5bd3,_0x3c4550){return function(_0x479a97){if(_0x479a97){return _0x479a97[_0xb759('0x21')](_0x3b5bd3)[_0xb759('0x22')](function(_0x12de48){return _0x12de48;});}return null;};}function removeEntity(_0x42d955,_0x3ca8fb){return function(_0xd6a6a5){if(_0xd6a6a5){return _0xd6a6a5[_0xb759('0x23')]()['then'](function(){_0x42d955[_0xb759('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45557a,_0x333a16){return function(_0x7101b3){if(!_0x7101b3){_0x45557a[_0xb759('0x24')](0x194);}return _0x7101b3;};}function handleError(_0x54a15d,_0x2ade24){_0x2ade24=_0x2ade24||0x1f4;return function(_0x26f455){logger['error'](_0x26f455[_0xb759('0x25')]);if(_0x26f455[_0xb759('0x26')]){delete _0x26f455[_0xb759('0x26')];}_0x54a15d[_0xb759('0x17')](_0x2ade24)[_0xb759('0x27')](_0x26f455);};}exports[_0xb759('0x28')]=function(_0x34586b,_0xa67765){var _0x481306={},_0x38480e={},_0x4e7ee4={'count':0x0,'rows':[]};var _0x2163df=_[_0xb759('0x29')](db['IntegrationReport'][_0xb759('0x2a')],function(_0x5d9dad){return{'name':_0x5d9dad['fieldName'],'type':_0x5d9dad[_0xb759('0x2b')][_0xb759('0x2c')]};});_0x38480e[_0xb759('0x2d')]=_[_0xb759('0x29')](_0x2163df,_0xb759('0x26'));_0x38480e[_0xb759('0x2e')]=_['keys'](_0x34586b[_0xb759('0x2e')]);_0x38480e[_0xb759('0x2f')]=_[_0xb759('0x30')](_0x38480e[_0xb759('0x2d')],_0x38480e[_0xb759('0x2e')]);_0x481306[_0xb759('0x31')]=_['intersection'](_0x38480e[_0xb759('0x2d')],qs['fields'](_0x34586b[_0xb759('0x2e')][_0xb759('0x32')]));_0x481306[_0xb759('0x31')]=_0x481306[_0xb759('0x31')][_0xb759('0x33')]?_0x481306[_0xb759('0x31')]:_0x38480e['model'];if(!_0x34586b[_0xb759('0x2e')][_0xb759('0x34')](_0xb759('0x35'))){_0x481306[_0xb759('0x1b')]=qs[_0xb759('0x1b')](_0x34586b['query'][_0xb759('0x1b')]);_0x481306[_0xb759('0x19')]=qs['offset'](_0x34586b[_0xb759('0x2e')][_0xb759('0x19')]);}_0x481306['order']=qs[_0xb759('0x36')](_0x34586b[_0xb759('0x2e')][_0xb759('0x36')]);_0x481306[_0xb759('0x37')]=qs[_0xb759('0x2f')](_[_0xb759('0x38')](_0x34586b[_0xb759('0x2e')],_0x38480e[_0xb759('0x2f')]),_0x2163df);if(_0x34586b['query'][_0xb759('0x39')]){_0x481306[_0xb759('0x37')]=_[_0xb759('0x3a')](_0x481306[_0xb759('0x37')],{'$or':_['map'](_0x2163df,function(_0xbf3b5){if(_0xbf3b5['type']!==_0xb759('0x3b')){var _0x1e8844={};_0x1e8844[_0xbf3b5['name']]={'$like':'%'+_0x34586b[_0xb759('0x2e')][_0xb759('0x39')]+'%'};return _0x1e8844;}})});}_0x481306=_['merge']({},_0x481306,_0x34586b[_0xb759('0x3c')]);var _0x60f176={'where':_0x481306[_0xb759('0x37')]};return db[_0xb759('0x3d')]['count'](_0x60f176)[_0xb759('0x22')](function(_0x79e146){_0x4e7ee4['count']=_0x79e146;if(_0x34586b[_0xb759('0x2e')][_0xb759('0x3e')]){_0x481306[_0xb759('0x3f')]=[{'all':!![]}];}return db[_0xb759('0x3d')][_0xb759('0x40')](_0x481306);})['then'](function(_0x2d2e42){_0x4e7ee4[_0xb759('0x41')]=_0x2d2e42;return _0x4e7ee4;})[_0xb759('0x22')](respondWithFilteredResult(_0xa67765,_0x481306))[_0xb759('0x42')](handleError(_0xa67765,null));};exports[_0xb759('0x43')]=function(_0x4144b1,_0x1a05c4){var _0x10f196={'raw':![],'where':{'id':_0x4144b1[_0xb759('0x44')]['id']}},_0x17d73b={};_0x17d73b[_0xb759('0x2d')]=_[_0xb759('0x45')](db[_0xb759('0x3d')][_0xb759('0x2a')]);_0x17d73b[_0xb759('0x2e')]=_['keys'](_0x4144b1[_0xb759('0x2e')]);_0x17d73b[_0xb759('0x2f')]=_[_0xb759('0x30')](_0x17d73b[_0xb759('0x2d')],_0x17d73b['query']);_0x10f196['attributes']=_[_0xb759('0x30')](_0x17d73b['model'],qs[_0xb759('0x32')](_0x4144b1[_0xb759('0x2e')][_0xb759('0x32')]));_0x10f196[_0xb759('0x31')]=_0x10f196['attributes'][_0xb759('0x33')]?_0x10f196[_0xb759('0x31')]:_0x17d73b[_0xb759('0x2d')];if(_0x4144b1[_0xb759('0x2e')][_0xb759('0x3e')]){_0x10f196[_0xb759('0x3f')]=[{'all':!![]}];}_0x10f196=_[_0xb759('0x3a')]({},_0x10f196,_0x4144b1['options']);return db['IntegrationReport'][_0xb759('0x46')](_0x10f196)['then'](handleEntityNotFound(_0x1a05c4,null))[_0xb759('0x22')](respondWithResult(_0x1a05c4,null))[_0xb759('0x42')](handleError(_0x1a05c4,null));};exports['create']=function(_0x2c1a70,_0x406cf3){return db[_0xb759('0x3d')][_0xb759('0x47')](_0x2c1a70[_0xb759('0x48')],{})['then'](respondWithResult(_0x406cf3,0xc9))[_0xb759('0x42')](handleError(_0x406cf3,null));};exports[_0xb759('0x21')]=function(_0x311909,_0x401659){if(_0x311909['body']['id']){delete _0x311909['body']['id'];}return db[_0xb759('0x3d')][_0xb759('0x46')]({'where':{'id':_0x311909[_0xb759('0x44')]['id']}})[_0xb759('0x22')](handleEntityNotFound(_0x401659,null))['then'](saveUpdates(_0x311909[_0xb759('0x48')],null))[_0xb759('0x22')](respondWithResult(_0x401659,null))[_0xb759('0x42')](handleError(_0x401659,null));};exports[_0xb759('0x23')]=function(_0x52613a,_0x5341cd){return db[_0xb759('0x3d')][_0xb759('0x46')]({'where':{'id':_0x52613a[_0xb759('0x44')]['id']}})['then'](handleEntityNotFound(_0x5341cd,null))[_0xb759('0x22')](removeEntity(_0x5341cd,null))[_0xb759('0x42')](handleError(_0x5341cd,null));};exports[_0xb759('0x49')]=function(_0x221316,_0x5c2fa0){return db[_0xb759('0x3d')][_0xb759('0x49')]()['then'](respondWithResult(_0x5c2fa0,null))[_0xb759('0x42')](handleError(_0x5c2fa0,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 463153c..12488ea 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 _0xcc2a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash'];(function(_0x54acbf,_0x5f25f2){var _0x22cfeb=function(_0x4ee342){while(--_0x4ee342){_0x54acbf['push'](_0x54acbf['shift']());}};_0x22cfeb(++_0x5f25f2);}(_0xcc2a,0x95));var _0xacc2=function(_0x5cc70a,_0x1d7e1c){_0x5cc70a=_0x5cc70a-0x0;var _0x5ede90=_0xcc2a[_0x5cc70a];return _0x5ede90;};'use strict';var _=require(_0xacc2('0x0'));var util=require(_0xacc2('0x1'));var logger=require(_0xacc2('0x2'))(_0xacc2('0x3'));var moment=require(_0xacc2('0x4'));var BPromise=require(_0xacc2('0x5'));var rp=require(_0xacc2('0x6'));var fs=require('fs');var path=require(_0xacc2('0x7'));var rimraf=require(_0xacc2('0x8'));var config=require(_0xacc2('0x9'));var attributes=require(_0xacc2('0xa'));module[_0xacc2('0xb')]=function(_0x35411c,_0x348aa9){return _0x35411c[_0xacc2('0xc')](_0xacc2('0xd'),attributes,{'tableName':_0xacc2('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe646=['rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x167115,_0x41a60a){var _0x1aa523=function(_0x10626f){while(--_0x10626f){_0x167115['push'](_0x167115['shift']());}};_0x1aa523(++_0x41a60a);}(_0xe646,0x1e6));var _0x6e64=function(_0x64c74c,_0x3ab585){_0x64c74c=_0x64c74c-0x0;var _0x202927=_0xe646[_0x64c74c];return _0x202927;};'use strict';var _=require(_0x6e64('0x0'));var util=require('util');var logger=require(_0x6e64('0x1'))(_0x6e64('0x2'));var moment=require('moment');var BPromise=require(_0x6e64('0x3'));var rp=require(_0x6e64('0x4'));var fs=require('fs');var path=require(_0x6e64('0x5'));var rimraf=require(_0x6e64('0x6'));var config=require(_0x6e64('0x7'));var attributes=require('./integrationReport.attributes');module[_0x6e64('0x8')]=function(_0x48db83,_0x29e441){return _0x48db83[_0x6e64('0x9')](_0x6e64('0xa'),attributes,{'tableName':_0x6e64('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index aa651c5..00d52a2 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(_0x53f5b4,_0x29cc2f){var _0x53d7fb=function(_0x534be1){while(--_0x534be1){_0x53f5b4['push'](_0x53f5b4['shift']());}};_0x53d7fb(++_0x29cc2f);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'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 _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0x687b,0x14a));var _0xb687=function(_0x239b5e,_0x208a3f){_0x239b5e=_0x239b5e-0x0;var _0x577f3d=_0x687b[_0x239b5e];return _0x577f3d;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a4b8112..e3f2dbf 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 _0xc2a5=['/:id/sub_intervals','/:id/sub_intervals/create_many','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','post','create'];(function(_0x3cc5bb,_0x41ae40){var _0x180602=function(_0xc4800c){while(--_0xc4800c){_0x3cc5bb['push'](_0x3cc5bb['shift']());}};_0x180602(++_0x41ae40);}(_0xc2a5,0x14e));var _0x5c2a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc2a5[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x5c2a('0x0'));var util=require(_0x5c2a('0x1'));var path=require(_0x5c2a('0x2'));var timeout=require(_0x5c2a('0x3'));var express=require(_0x5c2a('0x4'));var router=express['Router']();var fs_extra=require(_0x5c2a('0x5'));var auth=require(_0x5c2a('0x6'));var interaction=require(_0x5c2a('0x7'));var config=require(_0x5c2a('0x8'));var controller=require(_0x5c2a('0x9'));router[_0x5c2a('0xa')]('/',auth[_0x5c2a('0xb')](),controller[_0x5c2a('0xc')]);router['get'](_0x5c2a('0xd'),auth[_0x5c2a('0xb')](),controller[_0x5c2a('0xe')]);router[_0x5c2a('0xa')]('/:id/sub_intervals',auth[_0x5c2a('0xb')](),controller[_0x5c2a('0xf')]);router[_0x5c2a('0x10')]('/',auth[_0x5c2a('0xb')](),controller[_0x5c2a('0x11')]);router[_0x5c2a('0x10')](_0x5c2a('0x12'),auth['isAuthenticated'](),controller['addInterval']);router[_0x5c2a('0x10')](_0x5c2a('0x13'),auth['isAuthenticated'](),controller['addIntervals']);router[_0x5c2a('0x14')](_0x5c2a('0xd'),auth['isAuthenticated'](),controller[_0x5c2a('0x15')]);router['delete'](_0x5c2a('0xd'),auth[_0x5c2a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x93bb=['show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x1b0a6a,_0x54f6c3){var _0x1ac3d9=function(_0x48d1f6){while(--_0x48d1f6){_0x1b0a6a['push'](_0x1b0a6a['shift']());}};_0x1ac3d9(++_0x54f6c3);}(_0x93bb,0x135));var _0xb93b=function(_0x2f4f6a,_0x378708){_0x2f4f6a=_0x2f4f6a-0x0;var _0x40af1a=_0x93bb[_0x2f4f6a];return _0x40af1a;};'use strict';var multer=require(_0xb93b('0x0'));var util=require(_0xb93b('0x1'));var path=require(_0xb93b('0x2'));var timeout=require(_0xb93b('0x3'));var express=require(_0xb93b('0x4'));var router=express[_0xb93b('0x5')]();var fs_extra=require(_0xb93b('0x6'));var auth=require(_0xb93b('0x7'));var interaction=require(_0xb93b('0x8'));var config=require(_0xb93b('0x9'));var controller=require('./interval.controller');router[_0xb93b('0xa')]('/',auth[_0xb93b('0xb')](),controller['index']);router[_0xb93b('0xa')](_0xb93b('0xc'),auth['isAuthenticated'](),controller[_0xb93b('0xd')]);router[_0xb93b('0xa')](_0xb93b('0xe'),auth[_0xb93b('0xb')](),controller[_0xb93b('0xf')]);router[_0xb93b('0x10')]('/',auth[_0xb93b('0xb')](),controller[_0xb93b('0x11')]);router[_0xb93b('0x10')](_0xb93b('0xe'),auth[_0xb93b('0xb')](),controller['addInterval']);router[_0xb93b('0x10')](_0xb93b('0x12'),auth[_0xb93b('0xb')](),controller[_0xb93b('0x13')]);router['put'](_0xb93b('0xc'),auth[_0xb93b('0xb')](),controller[_0xb93b('0x14')]);router[_0xb93b('0x15')](_0xb93b('0xc'),auth[_0xb93b('0xb')](),controller[_0xb93b('0x16')]);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 42adc67..2bf0205 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 _0x73b0=['sequelize','STRING'];(function(_0x8a1ca4,_0x35f863){var _0x23821a=function(_0xc50bc6){while(--_0xc50bc6){_0x8a1ca4['push'](_0x8a1ca4['shift']());}};_0x23821a(++_0x35f863);}(_0x73b0,0xbc));var _0x073b=function(_0x412c89,_0x1b3784){_0x412c89=_0x412c89-0x0;var _0x5d170a=_0x73b0[_0x412c89];return _0x5d170a;};'use strict';var Sequelize=require(_0x073b('0x0'));module['exports']={'name':{'type':Sequelize[_0x073b('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x073b('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x3c3c=['STRING','sequelize'];(function(_0x7c63ed,_0x3ee1d1){var _0x39c511=function(_0x22d4b8){while(--_0x22d4b8){_0x7c63ed['push'](_0x7c63ed['shift']());}};_0x39c511(++_0x3ee1d1);}(_0x3c3c,0x1a5));var _0xc3c3=function(_0x43ead0,_0x2e45b5){_0x43ead0=_0x43ead0-0x0;var _0x42ee63=_0x3c3c[_0x43ead0];return _0x42ee63;};'use strict';var Sequelize=require(_0xc3c3('0x0'));module['exports']={'name':{'type':Sequelize[_0xc3c3('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index fd37f8b..b383c0a 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 _0x94a6=['save','update','then','destroy','get','Intervals','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Interval','includeAll','include','findAll','rows','params','intersection','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','keys','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x89406a,_0x290e7d){var _0x3ea859=function(_0x432346){while(--_0x432346){_0x89406a['push'](_0x89406a['shift']());}};_0x3ea859(++_0x290e7d);}(_0x94a6,0x1c6));var _0x694a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94a6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x694a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x694a('0x1'));var jsonpatch=require(_0x694a('0x2'));var rp=require(_0x694a('0x3'));var moment=require(_0x694a('0x4'));var BPromise=require(_0x694a('0x5'));var Mustache=require(_0x694a('0x6'));var util=require(_0x694a('0x7'));var path=require('path');var sox=require(_0x694a('0x8'));var csv=require(_0x694a('0x9'));var ejs=require(_0x694a('0xa'));var fs=require('fs');var fs_extra=require(_0x694a('0xb'));var _=require(_0x694a('0xc'));var squel=require(_0x694a('0xd'));var crypto=require(_0x694a('0xe'));var jsforce=require(_0x694a('0xf'));var deskjs=require(_0x694a('0x10'));var toCsv=require(_0x694a('0x9'));var querystring=require(_0x694a('0x11'));var Papa=require(_0x694a('0x12'));var Redis=require(_0x694a('0x13'));var authService=require(_0x694a('0x14'));var qs=require(_0x694a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x694a('0x16'));var logger=require(_0x694a('0x17'))(_0x694a('0x18'));var utils=require(_0x694a('0x19'));var config=require(_0x694a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x694a('0x1b'))['db'];var extensions=require(_0x694a('0x1c'));function respondWithStatusCode(_0x5171f4,_0x22ff57){_0x22ff57=_0x22ff57||0xcc;return function(_0x304577){if(_0x304577){return _0x5171f4[_0x694a('0x1d')](_0x22ff57);}return _0x5171f4[_0x694a('0x1e')](_0x22ff57)[_0x694a('0x1f')]();};}function respondWithResult(_0x1c4a0d,_0x49d024){_0x49d024=_0x49d024||0xc8;return function(_0x203db1){if(_0x203db1){return _0x1c4a0d[_0x694a('0x1e')](_0x49d024)[_0x694a('0x20')](_0x203db1);}};}function respondWithFilteredResult(_0x483d78,_0x45b691){return function(_0x4786f9){if(_0x4786f9){var _0x160ccb=typeof _0x45b691[_0x694a('0x21')]===_0x694a('0x22')&&typeof _0x45b691['limit']===_0x694a('0x22');var _0x4c3373=_0x4786f9[_0x694a('0x23')];var _0x285d7c=_0x160ccb?0x0:_0x45b691[_0x694a('0x21')];var _0x3cbf5e=_0x160ccb?_0x4786f9[_0x694a('0x23')]:_0x45b691[_0x694a('0x21')]+_0x45b691[_0x694a('0x24')];var _0x1c8403;if(_0x3cbf5e>=_0x4c3373){_0x3cbf5e=_0x4c3373;_0x1c8403=0xc8;}else{_0x1c8403=0xce;}_0x483d78[_0x694a('0x1e')](_0x1c8403);return _0x483d78[_0x694a('0x25')](_0x694a('0x26'),_0x285d7c+'-'+_0x3cbf5e+'/'+_0x4c3373)['json'](_0x4786f9);}return null;};}function patchUpdates(_0x41990f){return function(_0x18eb6e){try{jsonpatch[_0x694a('0x27')](_0x18eb6e,_0x41990f,!![]);}catch(_0xcd95c3){return BPromise[_0x694a('0x28')](_0xcd95c3);}return _0x18eb6e[_0x694a('0x29')]();};}function saveUpdates(_0x34111e,_0x4d4a62){return function(_0x3157a6){if(_0x3157a6){return _0x3157a6[_0x694a('0x2a')](_0x34111e)[_0x694a('0x2b')](function(_0xf0ca45){return _0xf0ca45;});}return null;};}function removeEntity(_0x4133e8,_0x4e5104){return function(_0x58e9f0){if(_0x58e9f0){return _0x58e9f0[_0x694a('0x2c')]()[_0x694a('0x2b')](function(){var _0x355cee=_0x58e9f0[_0x694a('0x2d')]({'plain':!![]});var _0x2c7bff=_0x694a('0x2e');return db['UserProfileResource'][_0x694a('0x2c')]({'where':{'type':_0x2c7bff,'resourceId':_0x355cee['id']}})[_0x694a('0x2b')](function(){return _0x58e9f0;});})[_0x694a('0x2b')](function(){_0x4133e8[_0x694a('0x1e')](0xcc)[_0x694a('0x1f')]();});}};}function handleEntityNotFound(_0x33e9fc,_0x1fe516){return function(_0x22d7ec){if(!_0x22d7ec){_0x33e9fc['sendStatus'](0x194);}return _0x22d7ec;};}function handleError(_0x4209aa,_0x4e40b4){_0x4e40b4=_0x4e40b4||0x1f4;return function(_0x139e39){logger[_0x694a('0x2f')](_0x139e39[_0x694a('0x30')]);if(_0x139e39[_0x694a('0x31')]){delete _0x139e39[_0x694a('0x31')];}_0x4209aa['status'](_0x4e40b4)[_0x694a('0x32')](_0x139e39);};}exports[_0x694a('0x33')]=function(_0x40b611,_0x13bee6){var _0xaf3eee={},_0x894ed4={},_0x3435f2={'count':0x0,'rows':[]};var _0x23da18=_[_0x694a('0x34')](db['Interval'][_0x694a('0x35')],function(_0x4242ea){return{'name':_0x4242ea[_0x694a('0x36')],'type':_0x4242ea[_0x694a('0x37')][_0x694a('0x38')]};});_0x894ed4[_0x694a('0x39')]=_[_0x694a('0x34')](_0x23da18,'name');_0x894ed4['query']=_['keys'](_0x40b611['query']);_0x894ed4['filters']=_['intersection'](_0x894ed4['model'],_0x894ed4[_0x694a('0x3a')]);_0xaf3eee[_0x694a('0x3b')]=_['intersection'](_0x894ed4[_0x694a('0x39')],qs[_0x694a('0x3c')](_0x40b611['query'][_0x694a('0x3c')]));_0xaf3eee[_0x694a('0x3b')]=_0xaf3eee[_0x694a('0x3b')][_0x694a('0x3d')]?_0xaf3eee[_0x694a('0x3b')]:_0x894ed4['model'];if(!_0x40b611['query']['hasOwnProperty'](_0x694a('0x3e'))){_0xaf3eee[_0x694a('0x24')]=qs[_0x694a('0x24')](_0x40b611['query'][_0x694a('0x24')]);_0xaf3eee[_0x694a('0x21')]=qs[_0x694a('0x21')](_0x40b611[_0x694a('0x3a')][_0x694a('0x21')]);}_0xaf3eee[_0x694a('0x3f')]=qs['sort'](_0x40b611[_0x694a('0x3a')][_0x694a('0x40')]);_0xaf3eee['where']=qs[_0x694a('0x41')](_[_0x694a('0x42')](_0x40b611[_0x694a('0x3a')],_0x894ed4[_0x694a('0x41')]),_0x23da18);if(_0x40b611['query'][_0x694a('0x43')]){_0xaf3eee[_0x694a('0x44')]=_[_0x694a('0x45')](_0xaf3eee[_0x694a('0x44')],{'$or':_[_0x694a('0x34')](_0x23da18,function(_0x593827){if(_0x593827[_0x694a('0x37')]!==_0x694a('0x46')){var _0x5c7686={};_0x5c7686[_0x593827[_0x694a('0x31')]]={'$like':'%'+_0x40b611[_0x694a('0x3a')]['filter']+'%'};return _0x5c7686;}})});}_0xaf3eee=_[_0x694a('0x45')]({},_0xaf3eee,_0x40b611[_0x694a('0x47')]);var _0x224aa2={'where':_0xaf3eee[_0x694a('0x44')]};return db[_0x694a('0x48')][_0x694a('0x23')](_0x224aa2)['then'](function(_0x5e740b){_0x3435f2['count']=_0x5e740b;if(_0x40b611[_0x694a('0x3a')][_0x694a('0x49')]){_0xaf3eee[_0x694a('0x4a')]=[{'all':!![]}];}return db['Interval'][_0x694a('0x4b')](_0xaf3eee);})['then'](function(_0x36af0f){_0x3435f2[_0x694a('0x4c')]=_0x36af0f;return _0x3435f2;})[_0x694a('0x2b')](respondWithFilteredResult(_0x13bee6,_0xaf3eee))['catch'](handleError(_0x13bee6,null));};exports['show']=function(_0x2352c3,_0x99588d){var _0x30a8e1={'raw':!![],'where':{'id':_0x2352c3[_0x694a('0x4d')]['id']}},_0x1f17c3={};_0x1f17c3['model']=_['keys'](db[_0x694a('0x48')][_0x694a('0x35')]);_0x1f17c3['query']=_['keys'](_0x2352c3['query']);_0x1f17c3[_0x694a('0x41')]=_[_0x694a('0x4e')](_0x1f17c3[_0x694a('0x39')],_0x1f17c3[_0x694a('0x3a')]);_0x30a8e1['attributes']=_[_0x694a('0x4e')](_0x1f17c3[_0x694a('0x39')],qs[_0x694a('0x3c')](_0x2352c3[_0x694a('0x3a')][_0x694a('0x3c')]));_0x30a8e1[_0x694a('0x3b')]=_0x30a8e1['attributes'][_0x694a('0x3d')]?_0x30a8e1[_0x694a('0x3b')]:_0x1f17c3[_0x694a('0x39')];if(_0x2352c3[_0x694a('0x3a')]['includeAll']){_0x30a8e1[_0x694a('0x4a')]=[{'all':!![]}];}_0x30a8e1=_[_0x694a('0x45')]({},_0x30a8e1,_0x2352c3['options']);return db[_0x694a('0x48')]['find'](_0x30a8e1)['then'](handleEntityNotFound(_0x99588d,null))[_0x694a('0x2b')](respondWithResult(_0x99588d,null))[_0x694a('0x4f')](handleError(_0x99588d,null));};exports[_0x694a('0x50')]=function(_0x5b5e7f,_0x15696f){return db['Interval'][_0x694a('0x50')](_0x5b5e7f[_0x694a('0x51')],{})[_0x694a('0x2b')](function(_0x154017){var _0x105776=_0x5b5e7f['user'][_0x694a('0x2d')]({'plain':!![]});if(!_0x105776)throw new Error(_0x694a('0x52'));if(_0x105776[_0x694a('0x53')]==='user'){var _0x209484=_0x154017[_0x694a('0x2d')]({'plain':!![]});var _0x5bc947=_0x694a('0x2e');return db[_0x694a('0x54')][_0x694a('0x55')]({'where':{'name':_0x5bc947,'userProfileId':_0x105776[_0x694a('0x56')]},'raw':!![]})[_0x694a('0x2b')](function(_0x280d47){if(_0x280d47&&_0x280d47[_0x694a('0x57')]===0x0){return db[_0x694a('0x58')][_0x694a('0x50')]({'name':_0x209484[_0x694a('0x31')],'resourceId':_0x209484['id'],'type':_0x280d47[_0x694a('0x31')],'sectionId':_0x280d47['id']},{})[_0x694a('0x2b')](function(){return _0x154017;});}else{return _0x154017;}})[_0x694a('0x4f')](function(_0xef5b1e){logger['error'](_0x694a('0x59'),_0xef5b1e);throw _0xef5b1e;});}return _0x154017;})[_0x694a('0x2b')](respondWithResult(_0x15696f,0xc9))[_0x694a('0x4f')](handleError(_0x15696f,null));};exports[_0x694a('0x2a')]=function(_0x23bfdc,_0x34282f){if(_0x23bfdc['body']['id']){delete _0x23bfdc['body']['id'];}return db[_0x694a('0x48')][_0x694a('0x55')]({'where':{'id':_0x23bfdc[_0x694a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x34282f,null))[_0x694a('0x2b')](saveUpdates(_0x23bfdc[_0x694a('0x51')],null))[_0x694a('0x2b')](respondWithResult(_0x34282f,null))[_0x694a('0x4f')](handleError(_0x34282f,null));};exports[_0x694a('0x2c')]=function(_0x5073dc,_0x374c49){return db[_0x694a('0x48')][_0x694a('0x55')]({'where':{'id':_0x5073dc[_0x694a('0x4d')]['id']}})[_0x694a('0x2b')](handleEntityNotFound(_0x374c49,null))['then'](removeEntity(_0x374c49,null))[_0x694a('0x4f')](handleError(_0x374c49,null));};exports['addInterval']=function(_0x258718,_0x2bf21f,_0x168273){if(_0x258718[_0x694a('0x51')]['id']){delete _0x258718[_0x694a('0x51')]['id'];}return db[_0x694a('0x48')]['find']({'where':{'id':_0x258718[_0x694a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2bf21f,null))[_0x694a('0x2b')](function(_0x1c4ada){if(_0x1c4ada){_0x258718['body'][_0x694a('0x5a')]=_0x1c4ada['id'];return db['Interval'][_0x694a('0x50')](_0x258718['body']);}})[_0x694a('0x2b')](respondWithResult(_0x2bf21f,null))['catch'](handleError(_0x2bf21f,null));};exports[_0x694a('0x5b')]=function(_0x2d9905,_0x120ce8,_0x1776c6){var _0x227b32={};var _0x3dcf60={};var _0x13c813;var _0x47a89f;return db[_0x694a('0x48')][_0x694a('0x5c')]({'where':{'id':_0x2d9905['params']['id']}})[_0x694a('0x2b')](handleEntityNotFound(_0x120ce8,null))[_0x694a('0x2b')](function(_0x3f5ffe){if(_0x3f5ffe){_0x13c813=_0x3f5ffe;_0x3dcf60[_0x694a('0x39')]=_[_0x694a('0x5d')](db[_0x694a('0x48')]['rawAttributes']);_0x3dcf60[_0x694a('0x3a')]=_[_0x694a('0x5d')](_0x2d9905[_0x694a('0x3a')]);_0x3dcf60['filters']=_[_0x694a('0x4e')](_0x3dcf60[_0x694a('0x39')],_0x3dcf60[_0x694a('0x3a')]);_0x227b32['attributes']=_[_0x694a('0x4e')](_0x3dcf60[_0x694a('0x39')],qs[_0x694a('0x3c')](_0x2d9905[_0x694a('0x3a')]['fields']));_0x227b32[_0x694a('0x3b')]=_0x227b32[_0x694a('0x3b')][_0x694a('0x3d')]?_0x227b32[_0x694a('0x3b')]:_0x3dcf60[_0x694a('0x39')];_0x227b32[_0x694a('0x3f')]=qs['sort'](_0x2d9905[_0x694a('0x3a')][_0x694a('0x40')]);_0x227b32[_0x694a('0x44')]=qs[_0x694a('0x41')](_[_0x694a('0x42')](_0x2d9905[_0x694a('0x3a')],_0x3dcf60[_0x694a('0x41')]));if(_0x2d9905[_0x694a('0x3a')]['filter']){_0x227b32['where']=_[_0x694a('0x45')](_0x227b32[_0x694a('0x44')],{'$or':_[_0x694a('0x34')](_0x227b32[_0x694a('0x3b')],function(_0x21e09d){var _0x20a502={};_0x20a502[_0x21e09d]={'$like':'%'+_0x2d9905[_0x694a('0x3a')][_0x694a('0x43')]+'%'};return _0x20a502;})});}_0x227b32=_['merge']({},_0x227b32,_0x2d9905[_0x694a('0x47')]);return _0x13c813[_0x694a('0x5b')](_0x227b32);}})['then'](function(_0x11ca44){if(_0x11ca44){_0x47a89f=_0x11ca44['length'];if(!_0x2d9905['query'][_0x694a('0x5e')](_0x694a('0x3e'))){_0x227b32[_0x694a('0x24')]=qs[_0x694a('0x24')](_0x2d9905[_0x694a('0x3a')][_0x694a('0x24')]);_0x227b32[_0x694a('0x21')]=qs[_0x694a('0x21')](_0x2d9905[_0x694a('0x3a')][_0x694a('0x21')]);}return _0x13c813['getIntervals'](_0x227b32);}})[_0x694a('0x2b')](function(_0x2ca98c){if(_0x2ca98c){return _0x2ca98c?{'count':_0x47a89f,'rows':_0x2ca98c}:null;}})[_0x694a('0x2b')](respondWithResult(_0x120ce8,null))[_0x694a('0x4f')](handleError(_0x120ce8,null));};exports[_0x694a('0x5f')]=function(_0x2ac689,_0x4d7bf1,_0x1247ed){return db[_0x694a('0x48')][_0x694a('0x5c')]({'where':{'id':_0x2ac689[_0x694a('0x4d')]['id']}})[_0x694a('0x2b')](handleEntityNotFound(_0x4d7bf1,null))['then'](function(_0x34fd47){if(_0x34fd47){return db[_0x694a('0x60')][_0x694a('0x61')](function(_0x14e8ee){return db[_0x694a('0x48')][_0x694a('0x2c')]({'where':{'IntervalId':_0x2ac689['params']['id']},'transaction':_0x14e8ee})[_0x694a('0x2b')](function(_0x49eaad){var _0x1d01ed=_[_0x694a('0x34')](_0x2ac689[_0x694a('0x51')],function(_0x2c8958){delete _0x2c8958['id'];_0x2c8958[_0x694a('0x5a')]=_0x2ac689['params']['id'];return _0x2c8958;});return db[_0x694a('0x48')][_0x694a('0x62')](_0x1d01ed,{'transaction':_0x14e8ee});});})[_0x694a('0x2b')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x2ac689[_0x694a('0x4d')]['id']}});});}})[_0x694a('0x2b')](respondWithResult(_0x4d7bf1,null))['catch'](handleError(_0x4d7bf1,null));}; \ No newline at end of file +var _0x3088=['intersection','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','request-promise','mustache','sox','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','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params'];(function(_0x24563c,_0x49d7cd){var _0x14796e=function(_0x3ab3d9){while(--_0x3ab3d9){_0x24563c['push'](_0x24563c['shift']());}};_0x14796e(++_0x49d7cd);}(_0x3088,0x6b));var _0x8308=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0x3088[_0x3b0912];return _0xa8f339;};'use strict';var emlformat=require(_0x8308('0x0'));var rimraf=require(_0x8308('0x1'));var zipdir=require(_0x8308('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8308('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8308('0x4'));var util=require('util');var path=require('path');var sox=require(_0x8308('0x5'));var csv=require(_0x8308('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8308('0x7'));var squel=require(_0x8308('0x8'));var crypto=require(_0x8308('0x9'));var jsforce=require(_0x8308('0xa'));var deskjs=require(_0x8308('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8308('0xc'));var Papa=require(_0x8308('0xd'));var Redis=require(_0x8308('0xe'));var authService=require(_0x8308('0xf'));var qs=require(_0x8308('0x10'));var as=require(_0x8308('0x11'));var hardwareService=require(_0x8308('0x12'));var logger=require('../../config/logger')(_0x8308('0x13'));var utils=require(_0x8308('0x14'));var config=require(_0x8308('0x15'));var licenseUtil=require(_0x8308('0x16'));var db=require(_0x8308('0x17'))['db'];var extensions=require(_0x8308('0x18'));function respondWithStatusCode(_0x5af66a,_0x3fac17){_0x3fac17=_0x3fac17||0xcc;return function(_0xa1c1c6){if(_0xa1c1c6){return _0x5af66a[_0x8308('0x19')](_0x3fac17);}return _0x5af66a[_0x8308('0x1a')](_0x3fac17)[_0x8308('0x1b')]();};}function respondWithResult(_0x3c1a40,_0x3cef95){_0x3cef95=_0x3cef95||0xc8;return function(_0x1df6da){if(_0x1df6da){return _0x3c1a40[_0x8308('0x1a')](_0x3cef95)[_0x8308('0x1c')](_0x1df6da);}};}function respondWithFilteredResult(_0xcf593,_0x583936){return function(_0x2eb2d5){if(_0x2eb2d5){var _0x5cf37a=typeof _0x583936[_0x8308('0x1d')]==='undefined'&&typeof _0x583936[_0x8308('0x1e')]===_0x8308('0x1f');var _0x2553ae=_0x2eb2d5['count'];var _0x48b861=_0x5cf37a?0x0:_0x583936[_0x8308('0x1d')];var _0x3ee001=_0x5cf37a?_0x2eb2d5[_0x8308('0x20')]:_0x583936[_0x8308('0x1d')]+_0x583936['limit'];var _0x143bff;if(_0x3ee001>=_0x2553ae){_0x3ee001=_0x2553ae;_0x143bff=0xc8;}else{_0x143bff=0xce;}_0xcf593[_0x8308('0x1a')](_0x143bff);return _0xcf593[_0x8308('0x21')](_0x8308('0x22'),_0x48b861+'-'+_0x3ee001+'/'+_0x2553ae)[_0x8308('0x1c')](_0x2eb2d5);}return null;};}function patchUpdates(_0x3d7a21){return function(_0x3eb783){try{jsonpatch['apply'](_0x3eb783,_0x3d7a21,!![]);}catch(_0x201cb5){return BPromise['reject'](_0x201cb5);}return _0x3eb783['save']();};}function saveUpdates(_0x5dd410,_0x1a841b){return function(_0x249df6){if(_0x249df6){return _0x249df6[_0x8308('0x23')](_0x5dd410)['then'](function(_0x534e83){return _0x534e83;});}return null;};}function removeEntity(_0x4636a1,_0x322433){return function(_0x512b8f){if(_0x512b8f){return _0x512b8f[_0x8308('0x24')]()[_0x8308('0x25')](function(){var _0x23dffa=_0x512b8f[_0x8308('0x26')]({'plain':!![]});var _0x595554=_0x8308('0x27');return db[_0x8308('0x28')][_0x8308('0x24')]({'where':{'type':_0x595554,'resourceId':_0x23dffa['id']}})[_0x8308('0x25')](function(){return _0x512b8f;});})[_0x8308('0x25')](function(){_0x4636a1[_0x8308('0x1a')](0xcc)[_0x8308('0x1b')]();});}};}function handleEntityNotFound(_0x3d76c3,_0xe5f0b8){return function(_0x5c8dbc){if(!_0x5c8dbc){_0x3d76c3[_0x8308('0x19')](0x194);}return _0x5c8dbc;};}function handleError(_0x363891,_0x5af829){_0x5af829=_0x5af829||0x1f4;return function(_0x448354){logger[_0x8308('0x29')](_0x448354[_0x8308('0x2a')]);if(_0x448354['name']){delete _0x448354[_0x8308('0x2b')];}_0x363891[_0x8308('0x1a')](_0x5af829)[_0x8308('0x2c')](_0x448354);};}exports[_0x8308('0x2d')]=function(_0x809914,_0x384489){var _0xcd7493={},_0x16a667={},_0x613094={'count':0x0,'rows':[]};var _0x404ecf=_[_0x8308('0x2e')](db[_0x8308('0x2f')][_0x8308('0x30')],function(_0x298b9e){return{'name':_0x298b9e[_0x8308('0x31')],'type':_0x298b9e[_0x8308('0x32')][_0x8308('0x33')]};});_0x16a667[_0x8308('0x34')]=_[_0x8308('0x2e')](_0x404ecf,_0x8308('0x2b'));_0x16a667[_0x8308('0x35')]=_[_0x8308('0x36')](_0x809914[_0x8308('0x35')]);_0x16a667[_0x8308('0x37')]=_['intersection'](_0x16a667[_0x8308('0x34')],_0x16a667[_0x8308('0x35')]);_0xcd7493[_0x8308('0x38')]=_['intersection'](_0x16a667['model'],qs[_0x8308('0x39')](_0x809914[_0x8308('0x35')][_0x8308('0x39')]));_0xcd7493[_0x8308('0x38')]=_0xcd7493[_0x8308('0x38')][_0x8308('0x3a')]?_0xcd7493[_0x8308('0x38')]:_0x16a667['model'];if(!_0x809914[_0x8308('0x35')][_0x8308('0x3b')](_0x8308('0x3c'))){_0xcd7493[_0x8308('0x1e')]=qs[_0x8308('0x1e')](_0x809914[_0x8308('0x35')][_0x8308('0x1e')]);_0xcd7493['offset']=qs[_0x8308('0x1d')](_0x809914[_0x8308('0x35')]['offset']);}_0xcd7493[_0x8308('0x3d')]=qs[_0x8308('0x3e')](_0x809914[_0x8308('0x35')]['sort']);_0xcd7493['where']=qs[_0x8308('0x37')](_[_0x8308('0x3f')](_0x809914['query'],_0x16a667[_0x8308('0x37')]),_0x404ecf);if(_0x809914[_0x8308('0x35')][_0x8308('0x40')]){_0xcd7493[_0x8308('0x41')]=_[_0x8308('0x42')](_0xcd7493[_0x8308('0x41')],{'$or':_[_0x8308('0x2e')](_0x404ecf,function(_0x1098a2){if(_0x1098a2[_0x8308('0x32')]!==_0x8308('0x43')){var _0x3dc40a={};_0x3dc40a[_0x1098a2[_0x8308('0x2b')]]={'$like':'%'+_0x809914[_0x8308('0x35')][_0x8308('0x40')]+'%'};return _0x3dc40a;}})});}_0xcd7493=_[_0x8308('0x42')]({},_0xcd7493,_0x809914[_0x8308('0x44')]);var _0x33a56c={'where':_0xcd7493['where']};return db[_0x8308('0x2f')][_0x8308('0x20')](_0x33a56c)[_0x8308('0x25')](function(_0x5290a7){_0x613094[_0x8308('0x20')]=_0x5290a7;if(_0x809914[_0x8308('0x35')][_0x8308('0x45')]){_0xcd7493['include']=[{'all':!![]}];}return db[_0x8308('0x2f')][_0x8308('0x46')](_0xcd7493);})[_0x8308('0x25')](function(_0x160fe7){_0x613094[_0x8308('0x47')]=_0x160fe7;return _0x613094;})[_0x8308('0x25')](respondWithFilteredResult(_0x384489,_0xcd7493))[_0x8308('0x48')](handleError(_0x384489,null));};exports[_0x8308('0x49')]=function(_0x1d5432,_0x30f0e6){var _0x5d5156={'raw':!![],'where':{'id':_0x1d5432[_0x8308('0x4a')]['id']}},_0x140b09={};_0x140b09[_0x8308('0x34')]=_['keys'](db[_0x8308('0x2f')][_0x8308('0x30')]);_0x140b09[_0x8308('0x35')]=_[_0x8308('0x36')](_0x1d5432[_0x8308('0x35')]);_0x140b09[_0x8308('0x37')]=_[_0x8308('0x4b')](_0x140b09[_0x8308('0x34')],_0x140b09[_0x8308('0x35')]);_0x5d5156[_0x8308('0x38')]=_[_0x8308('0x4b')](_0x140b09[_0x8308('0x34')],qs[_0x8308('0x39')](_0x1d5432[_0x8308('0x35')]['fields']));_0x5d5156['attributes']=_0x5d5156[_0x8308('0x38')]['length']?_0x5d5156['attributes']:_0x140b09[_0x8308('0x34')];if(_0x1d5432[_0x8308('0x35')][_0x8308('0x45')]){_0x5d5156[_0x8308('0x4c')]=[{'all':!![]}];}_0x5d5156=_['merge']({},_0x5d5156,_0x1d5432[_0x8308('0x44')]);return db[_0x8308('0x2f')]['find'](_0x5d5156)[_0x8308('0x25')](handleEntityNotFound(_0x30f0e6,null))['then'](respondWithResult(_0x30f0e6,null))[_0x8308('0x48')](handleError(_0x30f0e6,null));};exports[_0x8308('0x4d')]=function(_0x22daf2,_0x2a8998){return db['Interval']['create'](_0x22daf2['body'],{})['then'](function(_0x54984f){var _0xb4b6b9=_0x22daf2['user'][_0x8308('0x26')]({'plain':!![]});if(!_0xb4b6b9)throw new Error(_0x8308('0x4e'));if(_0xb4b6b9['role']==='user'){var _0xd37f2a=_0x54984f[_0x8308('0x26')]({'plain':!![]});var _0x225efd='Intervals';return db[_0x8308('0x4f')][_0x8308('0x50')]({'where':{'name':_0x225efd,'userProfileId':_0xb4b6b9['userProfileId']},'raw':!![]})['then'](function(_0x5a8442){if(_0x5a8442&&_0x5a8442[_0x8308('0x51')]===0x0){return db['UserProfileResource'][_0x8308('0x4d')]({'name':_0xd37f2a['name'],'resourceId':_0xd37f2a['id'],'type':_0x5a8442['name'],'sectionId':_0x5a8442['id']},{})[_0x8308('0x25')](function(){return _0x54984f;});}else{return _0x54984f;}})[_0x8308('0x48')](function(_0x504708){logger[_0x8308('0x29')](_0x8308('0x52'),_0x504708);throw _0x504708;});}return _0x54984f;})[_0x8308('0x25')](respondWithResult(_0x2a8998,0xc9))[_0x8308('0x48')](handleError(_0x2a8998,null));};exports[_0x8308('0x23')]=function(_0x276670,_0x104658){if(_0x276670['body']['id']){delete _0x276670[_0x8308('0x53')]['id'];}return db[_0x8308('0x2f')][_0x8308('0x50')]({'where':{'id':_0x276670['params']['id']}})[_0x8308('0x25')](handleEntityNotFound(_0x104658,null))[_0x8308('0x25')](saveUpdates(_0x276670[_0x8308('0x53')],null))[_0x8308('0x25')](respondWithResult(_0x104658,null))[_0x8308('0x48')](handleError(_0x104658,null));};exports['destroy']=function(_0x2a7899,_0x513ac3){return db['Interval']['find']({'where':{'id':_0x2a7899[_0x8308('0x4a')]['id']}})['then'](handleEntityNotFound(_0x513ac3,null))['then'](removeEntity(_0x513ac3,null))['catch'](handleError(_0x513ac3,null));};exports[_0x8308('0x54')]=function(_0x4c4600,_0x3cb8a5,_0x3184e6){if(_0x4c4600['body']['id']){delete _0x4c4600[_0x8308('0x53')]['id'];}return db[_0x8308('0x2f')][_0x8308('0x50')]({'where':{'id':_0x4c4600[_0x8308('0x4a')]['id']}})[_0x8308('0x25')](handleEntityNotFound(_0x3cb8a5,null))[_0x8308('0x25')](function(_0x3ea288){if(_0x3ea288){_0x4c4600[_0x8308('0x53')]['IntervalId']=_0x3ea288['id'];return db['Interval'][_0x8308('0x4d')](_0x4c4600[_0x8308('0x53')]);}})[_0x8308('0x25')](respondWithResult(_0x3cb8a5,null))[_0x8308('0x48')](handleError(_0x3cb8a5,null));};exports[_0x8308('0x55')]=function(_0x4dfa23,_0x483b8a,_0x4adce1){var _0x3ede26={};var _0x3bd73f={};var _0xbf78ea;var _0x4c7fd7;return db[_0x8308('0x2f')][_0x8308('0x56')]({'where':{'id':_0x4dfa23['params']['id']}})[_0x8308('0x25')](handleEntityNotFound(_0x483b8a,null))[_0x8308('0x25')](function(_0x2432b8){if(_0x2432b8){_0xbf78ea=_0x2432b8;_0x3bd73f[_0x8308('0x34')]=_[_0x8308('0x36')](db[_0x8308('0x2f')][_0x8308('0x30')]);_0x3bd73f['query']=_[_0x8308('0x36')](_0x4dfa23[_0x8308('0x35')]);_0x3bd73f[_0x8308('0x37')]=_[_0x8308('0x4b')](_0x3bd73f[_0x8308('0x34')],_0x3bd73f[_0x8308('0x35')]);_0x3ede26[_0x8308('0x38')]=_[_0x8308('0x4b')](_0x3bd73f[_0x8308('0x34')],qs[_0x8308('0x39')](_0x4dfa23[_0x8308('0x35')][_0x8308('0x39')]));_0x3ede26[_0x8308('0x38')]=_0x3ede26[_0x8308('0x38')][_0x8308('0x3a')]?_0x3ede26[_0x8308('0x38')]:_0x3bd73f[_0x8308('0x34')];_0x3ede26[_0x8308('0x3d')]=qs[_0x8308('0x3e')](_0x4dfa23[_0x8308('0x35')][_0x8308('0x3e')]);_0x3ede26[_0x8308('0x41')]=qs['filters'](_[_0x8308('0x3f')](_0x4dfa23['query'],_0x3bd73f[_0x8308('0x37')]));if(_0x4dfa23[_0x8308('0x35')][_0x8308('0x40')]){_0x3ede26[_0x8308('0x41')]=_[_0x8308('0x42')](_0x3ede26[_0x8308('0x41')],{'$or':_['map'](_0x3ede26[_0x8308('0x38')],function(_0x5146fe){var _0x5f57c8={};_0x5f57c8[_0x5146fe]={'$like':'%'+_0x4dfa23[_0x8308('0x35')][_0x8308('0x40')]+'%'};return _0x5f57c8;})});}_0x3ede26=_[_0x8308('0x42')]({},_0x3ede26,_0x4dfa23['options']);return _0xbf78ea[_0x8308('0x55')](_0x3ede26);}})[_0x8308('0x25')](function(_0x139dfd){if(_0x139dfd){_0x4c7fd7=_0x139dfd['length'];if(!_0x4dfa23[_0x8308('0x35')]['hasOwnProperty'](_0x8308('0x3c'))){_0x3ede26[_0x8308('0x1e')]=qs[_0x8308('0x1e')](_0x4dfa23[_0x8308('0x35')][_0x8308('0x1e')]);_0x3ede26[_0x8308('0x1d')]=qs[_0x8308('0x1d')](_0x4dfa23[_0x8308('0x35')][_0x8308('0x1d')]);}return _0xbf78ea[_0x8308('0x55')](_0x3ede26);}})[_0x8308('0x25')](function(_0x1627db){if(_0x1627db){return _0x1627db?{'count':_0x4c7fd7,'rows':_0x1627db}:null;}})['then'](respondWithResult(_0x483b8a,null))[_0x8308('0x48')](handleError(_0x483b8a,null));};exports[_0x8308('0x57')]=function(_0x5c32ef,_0x15447f,_0x992a20){return db['Interval'][_0x8308('0x56')]({'where':{'id':_0x5c32ef[_0x8308('0x4a')]['id']}})['then'](handleEntityNotFound(_0x15447f,null))[_0x8308('0x25')](function(_0x5d4076){if(_0x5d4076){return db[_0x8308('0x58')][_0x8308('0x59')](function(_0xa24e7e){return db['Interval'][_0x8308('0x24')]({'where':{'IntervalId':_0x5c32ef[_0x8308('0x4a')]['id']},'transaction':_0xa24e7e})[_0x8308('0x25')](function(_0xe17bde){var _0x3b203c=_[_0x8308('0x2e')](_0x5c32ef[_0x8308('0x53')],function(_0x9bc73){delete _0x9bc73['id'];_0x9bc73['IntervalId']=_0x5c32ef[_0x8308('0x4a')]['id'];return _0x9bc73;});return db['Interval'][_0x8308('0x5a')](_0x3b203c,{'transaction':_0xa24e7e});});})[_0x8308('0x25')](function(){return db[_0x8308('0x2f')][_0x8308('0x46')]({'where':{'IntervalId':_0x5c32ef[_0x8308('0x4a')]['id']}});});}})[_0x8308('0x25')](respondWithResult(_0x15447f,null))['catch'](handleError(_0x15447f,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 99808a9..5f5592b 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 _0x38d1=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','define','Interval','tools_intervals','rewrite'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x38d1,0xf2));var _0x138d=function(_0x3216d5,_0x23236e){_0x3216d5=_0x3216d5-0x0;var _0x770c80=_0x38d1[_0x3216d5];return _0x770c80;};'use strict';var _=require(_0x138d('0x0'));var util=require(_0x138d('0x1'));var logger=require(_0x138d('0x2'))(_0x138d('0x3'));var moment=require('moment');var BPromise=require(_0x138d('0x4'));var rp=require(_0x138d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x138d('0x6'));var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x2d1942,_0x1008ee){return _0x2d1942[_0x138d('0x7')](_0x138d('0x8'),attributes,{'tableName':_0x138d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x273a67,_0x3c6df7){extensions['rewrite'](_0x2d1942,_0x273a67);},'afterBulkCreate':function(_0x127de5,_0x59dd10,_0x43fb68){_0x43fb68();extensions[_0x138d('0xa')](_0x2d1942,_0x127de5[0x0]);},'afterUpdate':function(_0x230567,_0x361a9f){extensions[_0x138d('0xa')](_0x2d1942,_0x230567);},'afterDestroy':function(_0x1fefd2,_0x34fbec){extensions['rewrite'](_0x2d1942,_0x1fefd2);}}});}; \ No newline at end of file +var _0xa07e=['rimraf','./interval.attributes','../../components/extensions/rewrite','define','tools_intervals','rewrite','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1c8028,_0x2fa83a){var _0x3c816b=function(_0x446915){while(--_0x446915){_0x1c8028['push'](_0x1c8028['shift']());}};_0x3c816b(++_0x2fa83a);}(_0xa07e,0x156));var _0xea07=function(_0x2c4763,_0x4a64bc){_0x2c4763=_0x2c4763-0x0;var _0x3ad094=_0xa07e[_0x2c4763];return _0x3ad094;};'use strict';var _=require(_0xea07('0x0'));var util=require(_0xea07('0x1'));var logger=require('../../config/logger')(_0xea07('0x2'));var moment=require(_0xea07('0x3'));var BPromise=require(_0xea07('0x4'));var rp=require(_0xea07('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea07('0x6'));var config=require('../../config/environment');var attributes=require(_0xea07('0x7'));var extensions=require(_0xea07('0x8'));module['exports']=function(_0x395e39,_0x5bbb32){return _0x395e39[_0xea07('0x9')]('Interval',attributes,{'tableName':_0xea07('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x26246e,_0x2d4f15){extensions[_0xea07('0xb')](_0x395e39,_0x26246e);},'afterBulkCreate':function(_0x143872,_0x5cd712,_0x5a9c85){_0x5a9c85();extensions[_0xea07('0xb')](_0x395e39,_0x143872[0x0]);},'afterUpdate':function(_0x309fcd,_0x3eee59){extensions[_0xea07('0xb')](_0x395e39,_0x309fcd);},'afterDestroy':function(_0x4ad96e,_0x4ab4ba){extensions['rewrite'](_0x395e39,_0x4ad96e);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 6eff1cf..d5d61fa 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(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 653972f..ea1e332 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2da230,_0x5a5dfc){_0x2da230=_0x2da230-0x0;var _0x3504a9=_0x0b0e[_0x2da230];return _0x3504a9;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x597b93,_0x33e4d5){var _0x583f92=function(_0x33af2a){while(--_0x33af2a){_0x597b93['push'](_0x597b93['shift']());}};_0x583f92(++_0x33e4d5);}(_0xadb5,0xad));var _0x5adb=function(_0x75008f,_0x3dddac){_0x75008f=_0x75008f-0x0;var _0x2af13=_0xadb5[_0x75008f];return _0x2af13;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index f07e9c0..7e9e7c8 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 _0xb83a=['remoteAddress','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11503','name','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','stringify','request','setEncoding','utf8','data','end','status','statusCode','json','api.jira','write','body','headers','x-forwarded-for','connection','socket'];(function(_0x8f0551,_0x24e442){var _0x49948f=function(_0x5397b9){while(--_0x5397b9){_0x8f0551['push'](_0x8f0551['shift']());}};_0x49948f(++_0x24e442);}(_0xb83a,0x191));var _0xab83=function(_0x16ff23,_0x3d7750){_0x16ff23=_0x16ff23-0x0;var _0x41f312=_0xb83a[_0x16ff23];return _0x41f312;};'use strict';var BPromise=require(_0xab83('0x0'));var https=require(_0xab83('0x1'));var logger=require(_0xab83('0x2'))(_0xab83('0x3'));var USERNAME='support';var PASSWORD=_0xab83('0x4');function openIssue(_0x6acf27,_0x437036){var _0x4c14b4={'fields':{'project':{'key':_0x6acf27[_0xab83('0x5')]||'MOTGUI'},'summary':(_0x6acf27[_0xab83('0x6')]||_0xab83('0x7'))+_0xab83('0x8')+_0x6acf27['ip'],'description':_0x6acf27[_0xab83('0x9')]||JSON['stringify'](_0x6acf27),'issuetype':{'name':_0x6acf27['issuetype']||_0xab83('0xa')}}};_0x4c14b4[_0xab83('0xb')][_0xab83('0xc')]=_0x6acf27['email'];_0x4c14b4[_0xab83('0xb')][_0xab83('0xd')]=_0x6acf27[_0xab83('0xe')];_0x4c14b4[_0xab83('0xb')]['customfield_11502']=_0x6acf27['newToken'];_0x4c14b4[_0xab83('0xb')][_0xab83('0xf')]=_0x6acf27[_0xab83('0x10')];_0x4c14b4['fields']['customfield_11504']=_0x6acf27[_0xab83('0x11')];_0x4c14b4['fields'][_0xab83('0x12')]=_0x6acf27['ip'];var _0x469889={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xab83('0x13'),'method':_0xab83('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xab83('0x15'),'Authorization':_0xab83('0x16')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x18aa75=JSON[_0xab83('0x17')](_0x4c14b4);var _0xb17403=https[_0xab83('0x18')](_0x469889,function(_0x24e5bc){_0x24e5bc[_0xab83('0x19')](_0xab83('0x1a'));var _0x4e4235='';_0x24e5bc['on'](_0xab83('0x1b'),function(_0x553b67){_0x4e4235+=_0x553b67;});_0x24e5bc['on'](_0xab83('0x1c'),function(){if(_0x437036){return _0x437036[_0xab83('0x1d')](_0x24e5bc[_0xab83('0x1e')])[_0xab83('0x1f')](JSON['parse'](_0x4e4235));}});});_0xb17403['on']('error',function(_0x23ecdd){if(_0x437036){return _0x437036[_0xab83('0x1d')](0x1f4)[_0xab83('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xab83('0x20')}]});}});_0xb17403[_0xab83('0x21')](_0x18aa75);_0xb17403[_0xab83('0x1c')]();}exports['openIssue']=openIssue;exports['send']=function(_0x9258cd,_0x3c74a3){_0x9258cd[_0xab83('0x22')]['ip']=_0x9258cd[_0xab83('0x23')][_0xab83('0x24')]||_0x9258cd[_0xab83('0x25')]['remoteAddress']||_0x9258cd['socket']['remoteAddress']||_0x9258cd[_0xab83('0x25')][_0xab83('0x26')][_0xab83('0x27')];return openIssue(_0x9258cd[_0xab83('0x22')],_0x3c74a3);}; \ No newline at end of file +var _0xa190=['headers','connection','remoteAddress','https','../../config/logger','support','3eAmWpBVP0','key','summary','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','customfield_11502','customfield_10102','track.xcallymotion.com','application/json','Basic\x20','toString','base64','request','utf8','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xa190,0x8f));var _0x0a19=function(_0x463d10,_0x2592b9){_0x463d10=_0x463d10-0x0;var _0x281e77=_0xa190[_0x463d10];return _0x281e77;};'use strict';var BPromise=require('bluebird');var https=require(_0x0a19('0x0'));var logger=require(_0x0a19('0x1'))('api');var USERNAME=_0x0a19('0x2');var PASSWORD=_0x0a19('0x3');function openIssue(_0x3675c7,_0x2a4e2b){var _0xaea0ec={'fields':{'project':{'key':_0x3675c7[_0x0a19('0x4')]||'MOTGUI'},'summary':(_0x3675c7[_0x0a19('0x5')]||'Report')+'\x20from\x20'+_0x3675c7['ip'],'description':_0x3675c7[_0x0a19('0x6')]||JSON[_0x0a19('0x7')](_0x3675c7),'issuetype':{'name':_0x3675c7[_0x0a19('0x8')]||_0x0a19('0x9')}}};_0xaea0ec[_0x0a19('0xa')][_0x0a19('0xb')]=_0x3675c7['email'];_0xaea0ec[_0x0a19('0xa')][_0x0a19('0xc')]=_0x3675c7['oldToken'];_0xaea0ec['fields'][_0x0a19('0xd')]=_0x3675c7['newToken'];_0xaea0ec[_0x0a19('0xa')]['customfield_11503']=_0x3675c7['name'];_0xaea0ec[_0x0a19('0xa')]['customfield_11504']=_0x3675c7['reason'];_0xaea0ec[_0x0a19('0xa')][_0x0a19('0xe')]=_0x3675c7['ip'];var _0x36d19f={'host':_0x0a19('0xf'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x0a19('0x10'),'Authorization':_0x0a19('0x11')+new Buffer(USERNAME+':'+PASSWORD)[_0x0a19('0x12')](_0x0a19('0x13'))}};var _0x537f0d=JSON[_0x0a19('0x7')](_0xaea0ec);var _0x1c684a=https[_0x0a19('0x14')](_0x36d19f,function(_0x492261){_0x492261['setEncoding'](_0x0a19('0x15'));var _0xe7b8cb='';_0x492261['on'](_0x0a19('0x16'),function(_0x315ae3){_0xe7b8cb+=_0x315ae3;});_0x492261['on'](_0x0a19('0x17'),function(){if(_0x2a4e2b){return _0x2a4e2b[_0x0a19('0x18')](_0x492261[_0x0a19('0x19')])[_0x0a19('0x1a')](JSON[_0x0a19('0x1b')](_0xe7b8cb));}});});_0x1c684a['on']('error',function(_0x2c87d7){if(_0x2a4e2b){return _0x2a4e2b[_0x0a19('0x18')](0x1f4)[_0x0a19('0x1a')]({'errors':[{'message':_0x0a19('0x1c'),'type':_0x0a19('0x1d')}]});}});_0x1c684a[_0x0a19('0x1e')](_0x537f0d);_0x1c684a[_0x0a19('0x17')]();}exports['openIssue']=openIssue;exports['send']=function(_0x27b04b,_0x1ab758){_0x27b04b[_0x0a19('0x1f')]['ip']=_0x27b04b[_0x0a19('0x20')]['x-forwarded-for']||_0x27b04b[_0x0a19('0x21')]['remoteAddress']||_0x27b04b['socket'][_0x0a19('0x22')]||_0x27b04b['connection']['socket']['remoteAddress'];return openIssue(_0x27b04b[_0x0a19('0x1f')],_0x1ab758);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5786071..234c5b0 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 _0x6f0d=['post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','get','/describe','describe','show'];(function(_0x578f6c,_0x387563){var _0x4ae208=function(_0x2cf785){while(--_0x2cf785){_0x578f6c['push'](_0x578f6c['shift']());}};_0x4ae208(++_0x387563);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x142081,_0x50c34b){_0x142081=_0x142081-0x0;var _0x3dd729=_0x6f0d[_0x142081];return _0x3dd729;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xc')]);router['get']('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xe')]('/',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xf')]);router['put'](_0xd6f0('0x10'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x11')]);router[_0xd6f0('0x12')]('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x13')]);module[_0xd6f0('0x14')]=router; \ No newline at end of file +var _0x41bb=['show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x438c4d,_0x45e610){var _0xae169d=function(_0x16e23f){while(--_0x16e23f){_0x438c4d['push'](_0x438c4d['shift']());}};_0xae169d(++_0x45e610);}(_0x41bb,0xc5));var _0xb41b=function(_0x1ab695,_0x131a89){_0x1ab695=_0x1ab695-0x0;var _0xd92d5b=_0x41bb[_0x1ab695];return _0xd92d5b;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require('../../config/environment');var controller=require(_0xb41b('0x7'));router[_0xb41b('0x8')]('/',auth[_0xb41b('0x9')](),controller['index']);router['get']('/describe',auth[_0xb41b('0x9')](),controller[_0xb41b('0xa')]);router['get'](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xc')]);router[_0xb41b('0xd')]('/',auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router[_0xb41b('0xf')]('/:id',auth[_0xb41b('0x9')](),controller['update']);router[_0xb41b('0x10')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x11')]);module[_0xb41b('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 6b29e47..fa1abe0 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(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x44b457,_0x46a8b9){_0x44b457=_0x44b457-0x0;var _0x3a0d78=_0x7a54[_0x44b457];return _0x3a0d78;};'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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5dfa95,_0x7e4bcf){_0x5dfa95=_0x5dfa95-0x0;var _0x1063fa=_0x7a54[_0x5dfa95];return _0x1063fa;};'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 f36f1b2..74305ea 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 _0x8375=['attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','error','stack','name','send','map','JscriptyAnswerReport','fieldName','type','model','query','keys'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x8375,0xa8));var _0x5837=function(_0x4cbb18,_0x1d36bd){_0x4cbb18=_0x4cbb18-0x0;var _0x30da1d=_0x8375[_0x4cbb18];return _0x30da1d;};'use strict';var emlformat=require(_0x5837('0x0'));var rimraf=require(_0x5837('0x1'));var zipdir=require(_0x5837('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require(_0x5837('0x6'));var util=require(_0x5837('0x7'));var path=require(_0x5837('0x8'));var sox=require('sox');var csv=require(_0x5837('0x9'));var ejs=require(_0x5837('0xa'));var fs=require('fs');var fs_extra=require(_0x5837('0xb'));var _=require(_0x5837('0xc'));var squel=require(_0x5837('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x9'));var querystring=require('querystring');var Papa=require(_0x5837('0xf'));var Redis=require('ioredis');var authService=require(_0x5837('0x10'));var qs=require(_0x5837('0x11'));var as=require(_0x5837('0x12'));var hardwareService=require(_0x5837('0x13'));var logger=require(_0x5837('0x14'))(_0x5837('0x15'));var utils=require('../../config/utils');var config=require(_0x5837('0x16'));var licenseUtil=require(_0x5837('0x17'));var db=require(_0x5837('0x18'))['db'];function respondWithStatusCode(_0x10c1a1,_0x143210){_0x143210=_0x143210||0xcc;return function(_0x485366){if(_0x485366){return _0x10c1a1['sendStatus'](_0x143210);}return _0x10c1a1['status'](_0x143210)[_0x5837('0x19')]();};}function respondWithResult(_0x111dbf,_0x469903){_0x469903=_0x469903||0xc8;return function(_0xa5718d){if(_0xa5718d){return _0x111dbf[_0x5837('0x1a')](_0x469903)[_0x5837('0x1b')](_0xa5718d);}};}function respondWithFilteredResult(_0x206f02,_0x754f39){return function(_0x10d882){if(_0x10d882){var _0x59a378=typeof _0x754f39[_0x5837('0x1c')]===_0x5837('0x1d')&&typeof _0x754f39['limit']===_0x5837('0x1d');var _0x2297b4=_0x10d882[_0x5837('0x1e')];var _0x49279d=_0x59a378?0x0:_0x754f39['offset'];var _0x4bee08=_0x59a378?_0x10d882[_0x5837('0x1e')]:_0x754f39[_0x5837('0x1c')]+_0x754f39[_0x5837('0x1f')];var _0x58e7f7;if(_0x4bee08>=_0x2297b4){_0x4bee08=_0x2297b4;_0x58e7f7=0xc8;}else{_0x58e7f7=0xce;}_0x206f02[_0x5837('0x1a')](_0x58e7f7);return _0x206f02[_0x5837('0x20')](_0x5837('0x21'),_0x49279d+'-'+_0x4bee08+'/'+_0x2297b4)[_0x5837('0x1b')](_0x10d882);}return null;};}function patchUpdates(_0x5881ff){return function(_0x4908c2){try{jsonpatch['apply'](_0x4908c2,_0x5881ff,!![]);}catch(_0x3d352f){return BPromise['reject'](_0x3d352f);}return _0x4908c2[_0x5837('0x22')]();};}function saveUpdates(_0x2bd103,_0x32733a){return function(_0x3a7efe){if(_0x3a7efe){return _0x3a7efe['update'](_0x2bd103)['then'](function(_0x1b80db){return _0x1b80db;});}return null;};}function removeEntity(_0x2262b9,_0x406506){return function(_0x5e8089){if(_0x5e8089){return _0x5e8089[_0x5837('0x23')]()[_0x5837('0x24')](function(){_0x2262b9[_0x5837('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f86a,_0x2646ed){return function(_0x39babd){if(!_0x39babd){_0x41f86a['sendStatus'](0x194);}return _0x39babd;};}function handleError(_0x57baed,_0x1d545c){_0x1d545c=_0x1d545c||0x1f4;return function(_0x15655e){logger[_0x5837('0x25')](_0x15655e[_0x5837('0x26')]);if(_0x15655e[_0x5837('0x27')]){delete _0x15655e[_0x5837('0x27')];}_0x57baed[_0x5837('0x1a')](_0x1d545c)[_0x5837('0x28')](_0x15655e);};}exports['index']=function(_0x2f0c8d,_0x13830f){var _0x3cbd3f={},_0x3918ee={},_0x1c9f32={'count':0x0,'rows':[]};var _0x228f1=_[_0x5837('0x29')](db[_0x5837('0x2a')]['rawAttributes'],function(_0x4f7502){return{'name':_0x4f7502[_0x5837('0x2b')],'type':_0x4f7502[_0x5837('0x2c')]['key']};});_0x3918ee[_0x5837('0x2d')]=_[_0x5837('0x29')](_0x228f1,'name');_0x3918ee[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x2f0c8d[_0x5837('0x2e')]);_0x3918ee['filters']=_['intersection'](_0x3918ee['model'],_0x3918ee[_0x5837('0x2e')]);_0x3cbd3f[_0x5837('0x30')]=_[_0x5837('0x31')](_0x3918ee[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x2f0c8d['query']['fields']));_0x3cbd3f[_0x5837('0x30')]=_0x3cbd3f[_0x5837('0x30')]['length']?_0x3cbd3f['attributes']:_0x3918ee[_0x5837('0x2d')];if(!_0x2f0c8d['query']['hasOwnProperty'](_0x5837('0x33'))){_0x3cbd3f[_0x5837('0x1f')]=qs['limit'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1f')]);_0x3cbd3f[_0x5837('0x1c')]=qs['offset'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1c')]);}_0x3cbd3f[_0x5837('0x34')]=qs[_0x5837('0x35')](_0x2f0c8d[_0x5837('0x2e')]['sort']);_0x3cbd3f[_0x5837('0x36')]=qs['filters'](_['pick'](_0x2f0c8d[_0x5837('0x2e')],_0x3918ee[_0x5837('0x37')]),_0x228f1);if(_0x2f0c8d['query'][_0x5837('0x38')]){_0x3cbd3f[_0x5837('0x36')]=_[_0x5837('0x39')](_0x3cbd3f[_0x5837('0x36')],{'$or':_['map'](_0x228f1,function(_0x2ed688){if(_0x2ed688[_0x5837('0x2c')]!==_0x5837('0x3a')){var _0x5dcd18={};_0x5dcd18[_0x2ed688[_0x5837('0x27')]]={'$like':'%'+_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x38')]+'%'};return _0x5dcd18;}})});}_0x3cbd3f=_[_0x5837('0x39')]({},_0x3cbd3f,_0x2f0c8d[_0x5837('0x3b')]);var _0x76f00d={'where':_0x3cbd3f[_0x5837('0x36')]};return db[_0x5837('0x2a')][_0x5837('0x1e')](_0x76f00d)[_0x5837('0x24')](function(_0x1a5e2d){_0x1c9f32[_0x5837('0x1e')]=_0x1a5e2d;if(_0x2f0c8d['query']['includeAll']){_0x3cbd3f[_0x5837('0x3c')]=[{'all':!![]}];}return db[_0x5837('0x2a')]['findAll'](_0x3cbd3f);})[_0x5837('0x24')](function(_0x1ae168){_0x1c9f32[_0x5837('0x3d')]=_0x1ae168;return _0x1c9f32;})['then'](respondWithFilteredResult(_0x13830f,_0x3cbd3f))[_0x5837('0x3e')](handleError(_0x13830f,null));};exports[_0x5837('0x3f')]=function(_0x1c81ed,_0x3acdf5){var _0x4643e3={'raw':!![],'where':{'id':_0x1c81ed[_0x5837('0x40')]['id']}},_0xd443be={};_0xd443be[_0x5837('0x2d')]=_[_0x5837('0x2f')](db['JscriptyAnswerReport'][_0x5837('0x41')]);_0xd443be[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x1c81ed['query']);_0xd443be['filters']=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],_0xd443be[_0x5837('0x2e')]);_0x4643e3[_0x5837('0x30')]=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x1c81ed[_0x5837('0x2e')][_0x5837('0x32')]));_0x4643e3[_0x5837('0x30')]=_0x4643e3[_0x5837('0x30')][_0x5837('0x42')]?_0x4643e3['attributes']:_0xd443be[_0x5837('0x2d')];if(_0x1c81ed['query'][_0x5837('0x43')]){_0x4643e3[_0x5837('0x3c')]=[{'all':!![]}];}_0x4643e3=_['merge']({},_0x4643e3,_0x1c81ed[_0x5837('0x3b')]);return db[_0x5837('0x2a')]['find'](_0x4643e3)[_0x5837('0x24')](handleEntityNotFound(_0x3acdf5,null))[_0x5837('0x24')](respondWithResult(_0x3acdf5,null))[_0x5837('0x3e')](handleError(_0x3acdf5,null));};exports[_0x5837('0x44')]=function(_0x54a23b,_0x55cf2b){return db[_0x5837('0x2a')][_0x5837('0x44')](_0x54a23b['body'],{})['then'](respondWithResult(_0x55cf2b,0xc9))['catch'](handleError(_0x55cf2b,null));};exports['update']=function(_0x38e987,_0x6423f2){if(_0x38e987[_0x5837('0x45')]['id']){delete _0x38e987['body']['id'];}return db['JscriptyAnswerReport'][_0x5837('0x46')]({'where':{'id':_0x38e987[_0x5837('0x40')]['id']}})[_0x5837('0x24')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x24')](saveUpdates(_0x38e987[_0x5837('0x45')],null))[_0x5837('0x24')](respondWithResult(_0x6423f2,null))[_0x5837('0x3e')](handleError(_0x6423f2,null));};exports[_0x5837('0x23')]=function(_0x27f7b9,_0x38743a){return db['JscriptyAnswerReport'][_0x5837('0x46')]({'where':{'id':_0x27f7b9[_0x5837('0x40')]['id']}})['then'](handleEntityNotFound(_0x38743a,null))[_0x5837('0x24')](removeEntity(_0x38743a,null))[_0x5837('0x3e')](handleError(_0x38743a,null));};exports[_0x5837('0x47')]=function(_0x397cd9,_0x38e75d){return db['JscriptyAnswerReport'][_0x5837('0x47')]()[_0x5837('0x24')](respondWithResult(_0x38e75d,null))[_0x5837('0x3e')](handleError(_0x38e75d,null));}; \ No newline at end of file +var _0x078c=['lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','JscriptyAnswerReport','count','include','rows','catch','intersection','includeAll','options','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x31d196,_0x2ec8b6){var _0x9d5ca5=function(_0x59bc45){while(--_0x59bc45){_0x31d196['push'](_0x31d196['shift']());}};_0x9d5ca5(++_0x2ec8b6);}(_0x078c,0x19f));var _0xc078=function(_0x31e584,_0x4d9f7f){_0x31e584=_0x31e584-0x0;var _0x5686d0=_0x078c[_0x31e584];return _0x5686d0;};'use strict';var emlformat=require(_0xc078('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc078('0x1'));var jsonpatch=require(_0xc078('0x2'));var rp=require('request-promise');var moment=require(_0xc078('0x3'));var BPromise=require(_0xc078('0x4'));var Mustache=require(_0xc078('0x5'));var util=require(_0xc078('0x6'));var path=require('path');var sox=require(_0xc078('0x7'));var csv=require(_0xc078('0x8'));var ejs=require(_0xc078('0x9'));var fs=require('fs');var fs_extra=require(_0xc078('0xa'));var _=require(_0xc078('0xb'));var squel=require(_0xc078('0xc'));var crypto=require(_0xc078('0xd'));var jsforce=require(_0xc078('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc078('0xf'));var Redis=require(_0xc078('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc078('0x11'));var as=require(_0xc078('0x12'));var hardwareService=require(_0xc078('0x13'));var logger=require(_0xc078('0x14'))(_0xc078('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc078('0x16'));var db=require(_0xc078('0x17'))['db'];function respondWithStatusCode(_0x3fa2be,_0x25e95d){_0x25e95d=_0x25e95d||0xcc;return function(_0x3e27c7){if(_0x3e27c7){return _0x3fa2be[_0xc078('0x18')](_0x25e95d);}return _0x3fa2be[_0xc078('0x19')](_0x25e95d)[_0xc078('0x1a')]();};}function respondWithResult(_0x11a3c3,_0x393225){_0x393225=_0x393225||0xc8;return function(_0x256d7b){if(_0x256d7b){return _0x11a3c3[_0xc078('0x19')](_0x393225)[_0xc078('0x1b')](_0x256d7b);}};}function respondWithFilteredResult(_0x36b6b1,_0x404ab0){return function(_0x5a1cbc){if(_0x5a1cbc){var _0x39e242=typeof _0x404ab0[_0xc078('0x1c')]===_0xc078('0x1d')&&typeof _0x404ab0['limit']===_0xc078('0x1d');var _0x5ab33a=_0x5a1cbc['count'];var _0xfd361b=_0x39e242?0x0:_0x404ab0['offset'];var _0x2ec2d5=_0x39e242?_0x5a1cbc['count']:_0x404ab0[_0xc078('0x1c')]+_0x404ab0[_0xc078('0x1e')];var _0x25fb75;if(_0x2ec2d5>=_0x5ab33a){_0x2ec2d5=_0x5ab33a;_0x25fb75=0xc8;}else{_0x25fb75=0xce;}_0x36b6b1['status'](_0x25fb75);return _0x36b6b1[_0xc078('0x1f')]('Content-Range',_0xfd361b+'-'+_0x2ec2d5+'/'+_0x5ab33a)[_0xc078('0x1b')](_0x5a1cbc);}return null;};}function patchUpdates(_0x2a9bbf){return function(_0x19b29b){try{jsonpatch[_0xc078('0x20')](_0x19b29b,_0x2a9bbf,!![]);}catch(_0x3f68ca){return BPromise['reject'](_0x3f68ca);}return _0x19b29b[_0xc078('0x21')]();};}function saveUpdates(_0x36efa2,_0x2e56fa){return function(_0x275cbc){if(_0x275cbc){return _0x275cbc['update'](_0x36efa2)[_0xc078('0x22')](function(_0xa4cd22){return _0xa4cd22;});}return null;};}function removeEntity(_0x3bde7a,_0x1cb7cb){return function(_0x41fac6){if(_0x41fac6){return _0x41fac6[_0xc078('0x23')]()[_0xc078('0x22')](function(){_0x3bde7a[_0xc078('0x19')](0xcc)[_0xc078('0x1a')]();});}};}function handleEntityNotFound(_0x3017a3,_0x14f677){return function(_0x531945){if(!_0x531945){_0x3017a3['sendStatus'](0x194);}return _0x531945;};}function handleError(_0x29525b,_0x5c7fc9){_0x5c7fc9=_0x5c7fc9||0x1f4;return function(_0x4a022a){logger['error'](_0x4a022a[_0xc078('0x24')]);if(_0x4a022a['name']){delete _0x4a022a[_0xc078('0x25')];}_0x29525b[_0xc078('0x19')](_0x5c7fc9)[_0xc078('0x26')](_0x4a022a);};}exports[_0xc078('0x27')]=function(_0xd43338,_0x2b257c){var _0x7c965e={},_0x3c481f={},_0x50e5d={'count':0x0,'rows':[]};var _0x43c377=_[_0xc078('0x28')](db['JscriptyAnswerReport'][_0xc078('0x29')],function(_0x560cbb){return{'name':_0x560cbb[_0xc078('0x2a')],'type':_0x560cbb[_0xc078('0x2b')][_0xc078('0x2c')]};});_0x3c481f[_0xc078('0x2d')]=_['map'](_0x43c377,_0xc078('0x25'));_0x3c481f['query']=_['keys'](_0xd43338[_0xc078('0x2e')]);_0x3c481f[_0xc078('0x2f')]=_['intersection'](_0x3c481f[_0xc078('0x2d')],_0x3c481f[_0xc078('0x2e')]);_0x7c965e[_0xc078('0x30')]=_['intersection'](_0x3c481f['model'],qs[_0xc078('0x31')](_0xd43338['query'][_0xc078('0x31')]));_0x7c965e[_0xc078('0x30')]=_0x7c965e['attributes'][_0xc078('0x32')]?_0x7c965e[_0xc078('0x30')]:_0x3c481f[_0xc078('0x2d')];if(!_0xd43338['query'][_0xc078('0x33')](_0xc078('0x34'))){_0x7c965e[_0xc078('0x1e')]=qs['limit'](_0xd43338['query'][_0xc078('0x1e')]);_0x7c965e[_0xc078('0x1c')]=qs['offset'](_0xd43338['query']['offset']);}_0x7c965e['order']=qs['sort'](_0xd43338[_0xc078('0x2e')][_0xc078('0x35')]);_0x7c965e[_0xc078('0x36')]=qs[_0xc078('0x2f')](_['pick'](_0xd43338[_0xc078('0x2e')],_0x3c481f['filters']),_0x43c377);if(_0xd43338['query'][_0xc078('0x37')]){_0x7c965e[_0xc078('0x36')]=_[_0xc078('0x38')](_0x7c965e[_0xc078('0x36')],{'$or':_[_0xc078('0x28')](_0x43c377,function(_0x2d5558){if(_0x2d5558[_0xc078('0x2b')]!==_0xc078('0x39')){var _0x534def={};_0x534def[_0x2d5558['name']]={'$like':'%'+_0xd43338['query']['filter']+'%'};return _0x534def;}})});}_0x7c965e=_[_0xc078('0x38')]({},_0x7c965e,_0xd43338['options']);var _0x122555={'where':_0x7c965e['where']};return db[_0xc078('0x3a')]['count'](_0x122555)['then'](function(_0x13e765){_0x50e5d[_0xc078('0x3b')]=_0x13e765;if(_0xd43338[_0xc078('0x2e')]['includeAll']){_0x7c965e[_0xc078('0x3c')]=[{'all':!![]}];}return db[_0xc078('0x3a')]['findAll'](_0x7c965e);})[_0xc078('0x22')](function(_0x3c2bc9){_0x50e5d[_0xc078('0x3d')]=_0x3c2bc9;return _0x50e5d;})[_0xc078('0x22')](respondWithFilteredResult(_0x2b257c,_0x7c965e))[_0xc078('0x3e')](handleError(_0x2b257c,null));};exports['show']=function(_0x3ffd96,_0x1d8e5b){var _0x3710b6={'raw':!![],'where':{'id':_0x3ffd96['params']['id']}},_0x548507={};_0x548507[_0xc078('0x2d')]=_['keys'](db['JscriptyAnswerReport'][_0xc078('0x29')]);_0x548507[_0xc078('0x2e')]=_['keys'](_0x3ffd96[_0xc078('0x2e')]);_0x548507['filters']=_[_0xc078('0x3f')](_0x548507['model'],_0x548507[_0xc078('0x2e')]);_0x3710b6[_0xc078('0x30')]=_[_0xc078('0x3f')](_0x548507[_0xc078('0x2d')],qs['fields'](_0x3ffd96[_0xc078('0x2e')][_0xc078('0x31')]));_0x3710b6[_0xc078('0x30')]=_0x3710b6[_0xc078('0x30')]['length']?_0x3710b6[_0xc078('0x30')]:_0x548507[_0xc078('0x2d')];if(_0x3ffd96[_0xc078('0x2e')][_0xc078('0x40')]){_0x3710b6[_0xc078('0x3c')]=[{'all':!![]}];}_0x3710b6=_['merge']({},_0x3710b6,_0x3ffd96[_0xc078('0x41')]);return db['JscriptyAnswerReport']['find'](_0x3710b6)['then'](handleEntityNotFound(_0x1d8e5b,null))[_0xc078('0x22')](respondWithResult(_0x1d8e5b,null))[_0xc078('0x3e')](handleError(_0x1d8e5b,null));};exports[_0xc078('0x42')]=function(_0x4c3041,_0x57abc6){return db[_0xc078('0x3a')][_0xc078('0x42')](_0x4c3041['body'],{})[_0xc078('0x22')](respondWithResult(_0x57abc6,0xc9))[_0xc078('0x3e')](handleError(_0x57abc6,null));};exports['update']=function(_0x2a846f,_0x57889b){if(_0x2a846f[_0xc078('0x43')]['id']){delete _0x2a846f[_0xc078('0x43')]['id'];}return db[_0xc078('0x3a')][_0xc078('0x44')]({'where':{'id':_0x2a846f[_0xc078('0x45')]['id']}})[_0xc078('0x22')](handleEntityNotFound(_0x57889b,null))['then'](saveUpdates(_0x2a846f[_0xc078('0x43')],null))[_0xc078('0x22')](respondWithResult(_0x57889b,null))[_0xc078('0x3e')](handleError(_0x57889b,null));};exports[_0xc078('0x23')]=function(_0x71ae97,_0x4c82c6){return db[_0xc078('0x3a')][_0xc078('0x44')]({'where':{'id':_0x71ae97['params']['id']}})[_0xc078('0x22')](handleEntityNotFound(_0x4c82c6,null))[_0xc078('0x22')](removeEntity(_0x4c82c6,null))[_0xc078('0x3e')](handleError(_0x4c82c6,null));};exports['describe']=function(_0x36456e,_0x5e3021){return db[_0xc078('0x3a')][_0xc078('0x46')]()[_0xc078('0x22')](respondWithResult(_0x5e3021,null))[_0xc078('0x3e')](handleError(_0x5e3021,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index d383cc5..2763713 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 _0x752c=['exports','report_jscripty_answers','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0xed90ba,_0x523f6b){var _0x176fee=function(_0x33c54b){while(--_0x33c54b){_0xed90ba['push'](_0xed90ba['shift']());}};_0x176fee(++_0x523f6b);}(_0x752c,0x18e));var _0xc752=function(_0x1729b2,_0xc95bcf){_0x1729b2=_0x1729b2-0x0;var _0x4fe362=_0x752c[_0x1729b2];return _0x4fe362;};'use strict';var _=require(_0xc752('0x0'));var util=require(_0xc752('0x1'));var logger=require(_0xc752('0x2'))('api');var moment=require(_0xc752('0x3'));var BPromise=require(_0xc752('0x4'));var rp=require(_0xc752('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc752('0x6'));var config=require(_0xc752('0x7'));var attributes=require(_0xc752('0x8'));module[_0xc752('0x9')]=function(_0x24c3ec,_0x3ded6a){return _0x24c3ec['define']('JscriptyAnswerReport',attributes,{'tableName':_0xc752('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a6b=['util','../../config/logger','moment','path','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x427138,_0x11e883){var _0x2fdf77=function(_0x2be2ab){while(--_0x2be2ab){_0x427138['push'](_0x427138['shift']());}};_0x2fdf77(++_0x11e883);}(_0x2a6b,0x116));var _0xb2a6=function(_0x3878f1,_0x1710e8){_0x3878f1=_0x3878f1-0x0;var _0xc6067a=_0x2a6b[_0x3878f1];return _0xc6067a;};'use strict';var _=require(_0xb2a6('0x0'));var util=require(_0xb2a6('0x1'));var logger=require(_0xb2a6('0x2'))('api');var moment=require(_0xb2a6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2a6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb2a6('0x5'));module[_0xb2a6('0x6')]=function(_0x21a1ee,_0x11be22){return _0x21a1ee['define'](_0xb2a6('0x7'),attributes,{'tableName':_0xb2a6('0x8'),'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 fbdee37..02cac72 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 _0x6beb=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','bluebird','randomstring'];(function(_0x1b2992,_0x499c9a){var _0xc869a9=function(_0xce3b38){while(--_0xce3b38){_0x1b2992['push'](_0x1b2992['shift']());}};_0xc869a9(++_0x499c9a);}(_0x6beb,0x1b5));var _0xb6be=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6beb[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xb6be('0x0'));var moment=require('moment');var BPromise=require(_0xb6be('0x1'));var rs=require(_0xb6be('0x2'));var fs=require('fs');var Redis=require(_0xb6be('0x3'));var db=require(_0xb6be('0x4'))['db'];var utils=require(_0xb6be('0x5'));var logger=require('../../config/logger')(_0xb6be('0x6'));var config=require(_0xb6be('0x7'));var jayson=require(_0xb6be('0x8'));var client=jayson['client'][_0xb6be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3117a9,_0x43ddbb,_0x3a4e2f){return new BPromise(function(_0x57ae1b,_0x27315f){return client[_0xb6be('0xa')](_0x3117a9,_0x3a4e2f)[_0xb6be('0xb')](function(_0x1677b8){logger['info'](_0xb6be('0xc'),_0x43ddbb,_0xb6be('0xd'));logger[_0xb6be('0xe')](_0xb6be('0xf'),_0x43ddbb,_0xb6be('0xd'),JSON['stringify'](_0x1677b8));if(_0x1677b8[_0xb6be('0x10')]){if(_0x1677b8[_0xb6be('0x10')][_0xb6be('0x11')]===0x1f4){logger[_0xb6be('0x10')](_0xb6be('0xc'),_0x43ddbb,_0x1677b8[_0xb6be('0x10')][_0xb6be('0x12')]);return _0x27315f(_0x1677b8[_0xb6be('0x10')][_0xb6be('0x12')]);}logger[_0xb6be('0x10')](_0xb6be('0xc'),_0x43ddbb,_0x1677b8[_0xb6be('0x10')][_0xb6be('0x12')]);return _0x57ae1b(_0x1677b8[_0xb6be('0x10')][_0xb6be('0x12')]);}else{logger[_0xb6be('0x13')](_0xb6be('0xc'),_0x43ddbb,_0xb6be('0xd'));_0x57ae1b(_0x1677b8[_0xb6be('0x14')]['message']);}})[_0xb6be('0x15')](function(_0x158ea5){logger[_0xb6be('0x10')](_0xb6be('0xc'),_0x43ddbb,_0x158ea5);_0x27315f(_0x158ea5);});});} \ No newline at end of file +var _0x883d=['JscriptyAnswerReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2800e3,_0x5398d3){var _0x4db66e=function(_0x1bcc43){while(--_0x1bcc43){_0x2800e3['push'](_0x2800e3['shift']());}};_0x4db66e(++_0x5398d3);}(_0x883d,0x87));var _0xd883=function(_0x2033a1,_0x6f2ee4){_0x2033a1=_0x2033a1-0x0;var _0x1d4754=_0x883d[_0x2033a1];return _0x1d4754;};'use strict';var _=require(_0xd883('0x0'));var util=require(_0xd883('0x1'));var moment=require('moment');var BPromise=require(_0xd883('0x2'));var rs=require(_0xd883('0x3'));var fs=require('fs');var Redis=require(_0xd883('0x4'));var db=require(_0xd883('0x5'))['db'];var utils=require(_0xd883('0x6'));var logger=require('../../config/logger')(_0xd883('0x7'));var config=require(_0xd883('0x8'));var jayson=require(_0xd883('0x9'));var client=jayson['client'][_0xd883('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47516a,_0xc9a82d,_0x5ad32f){return new BPromise(function(_0x459ecb,_0x37de95){return client[_0xd883('0xb')](_0x47516a,_0x5ad32f)[_0xd883('0xc')](function(_0x2fd2f5){logger[_0xd883('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xc9a82d,_0xd883('0xe'));logger['debug'](_0xd883('0xf'),_0xc9a82d,_0xd883('0xe'),JSON[_0xd883('0x10')](_0x2fd2f5));if(_0x2fd2f5[_0xd883('0x11')]){if(_0x2fd2f5['error'][_0xd883('0x12')]===0x1f4){logger[_0xd883('0x11')](_0xd883('0x13'),_0xc9a82d,_0x2fd2f5[_0xd883('0x11')][_0xd883('0x14')]);return _0x37de95(_0x2fd2f5[_0xd883('0x11')]['message']);}logger[_0xd883('0x11')](_0xd883('0x13'),_0xc9a82d,_0x2fd2f5[_0xd883('0x11')]['message']);return _0x459ecb(_0x2fd2f5[_0xd883('0x11')][_0xd883('0x14')]);}else{logger[_0xd883('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xc9a82d,_0xd883('0xe'));_0x459ecb(_0x2fd2f5[_0xd883('0x15')]['message']);}})['catch'](function(_0x25c261){logger[_0xd883('0x11')](_0xd883('0x13'),_0xc9a82d,_0x25c261);_0x37de95(_0x25c261);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index a8292e8..379acc8 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 _0x25bb=['create','post','/:id/clone','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x25bb,0x176));var _0xb25b=function(_0xfc8aaa,_0x591529){_0xfc8aaa=_0xfc8aaa-0x0;var _0x5e4eb7=_0x25bb[_0xfc8aaa];return _0x5e4eb7;};'use strict';var multer=require('multer');var util=require(_0xb25b('0x0'));var path=require('path');var timeout=require(_0xb25b('0x1'));var express=require(_0xb25b('0x2'));var router=express[_0xb25b('0x3')]();var fs_extra=require(_0xb25b('0x4'));var auth=require(_0xb25b('0x5'));var interaction=require(_0xb25b('0x6'));var config=require(_0xb25b('0x7'));var controller=require('./jscriptyProject.controller');router[_0xb25b('0x8')]('/',auth[_0xb25b('0x9')](),controller['index']);router[_0xb25b('0x8')](_0xb25b('0xa'),auth[_0xb25b('0x9')](),controller[_0xb25b('0xb')]);router[_0xb25b('0x8')](_0xb25b('0xc'),auth[_0xb25b('0x9')](),controller[_0xb25b('0xd')]);router[_0xb25b('0x8')](_0xb25b('0xe'),auth['isAuthenticated'](),controller[_0xb25b('0xf')]);router[_0xb25b('0x8')](_0xb25b('0x10'),auth[_0xb25b('0x9')](),timeout('30s'),controller['getSummary']);router['post']('/',auth[_0xb25b('0x9')](),controller[_0xb25b('0x11')]);router[_0xb25b('0x12')](_0xb25b('0x13'),auth[_0xb25b('0x9')](),controller['clone']);router['put'](_0xb25b('0xa'),auth[_0xb25b('0x9')](),controller[_0xb25b('0x14')]);router[_0xb25b('0x15')](_0xb25b('0xa'),auth[_0xb25b('0x9')](),controller['destroy']);module[_0xb25b('0x16')]=router; \ No newline at end of file +var _0xa6cc=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/sessions','/:id/answers','post','/:id/clone','clone','put','destroy','exports','util','path','connect-timeout','express'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0xa6cc,0x100));var _0xca6c=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0xa6cc[_0x176d14];return _0x89522c;};'use strict';var multer=require('multer');var util=require(_0xca6c('0x0'));var path=require(_0xca6c('0x1'));var timeout=require(_0xca6c('0x2'));var express=require(_0xca6c('0x3'));var router=express[_0xca6c('0x4')]();var fs_extra=require(_0xca6c('0x5'));var auth=require(_0xca6c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca6c('0x7'));var controller=require('./jscriptyProject.controller');router[_0xca6c('0x8')]('/',auth[_0xca6c('0x9')](),controller['index']);router[_0xca6c('0x8')](_0xca6c('0xa'),auth['isAuthenticated'](),controller[_0xca6c('0xb')]);router[_0xca6c('0x8')](_0xca6c('0xc'),auth[_0xca6c('0x9')](),controller['getSessions']);router['get'](_0xca6c('0xd'),auth[_0xca6c('0x9')](),controller['getAnswers']);router[_0xca6c('0x8')]('/:id/summary',auth[_0xca6c('0x9')](),timeout('30s'),controller['getSummary']);router['post']('/',auth[_0xca6c('0x9')](),controller['create']);router[_0xca6c('0xe')](_0xca6c('0xf'),auth['isAuthenticated'](),controller[_0xca6c('0x10')]);router[_0xca6c('0x11')](_0xca6c('0xa'),auth[_0xca6c('0x9')](),controller['update']);router['delete'](_0xca6c('0xa'),auth[_0xca6c('0x9')](),controller[_0xca6c('0x12')]);module[_0xca6c('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 06282ca..cb15a47 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 _0xcb72=['sequelize','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x5d160,_0xa4838e){var _0x1d180d=function(_0x543237){while(--_0x543237){_0x5d160['push'](_0x5d160['shift']());}};_0x1d180d(++_0xa4838e);}(_0xcb72,0x196));var _0x2cb7=function(_0x330c8b,_0x419025){_0x330c8b=_0x330c8b-0x0;var _0x5c1848=_0xcb72[_0x330c8b];return _0x5c1848;};'use strict';var Sequelize=require(_0x2cb7('0x0'));var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0x2cb7('0x1')],'unique':_0x2cb7('0x2')},'description':{'type':Sequelize[_0x2cb7('0x1')]},'formData':{'type':Sequelize[_0x2cb7('0x3')](_0x2cb7('0x4')),'set':function(_0x2eed6f){if(_[_0x2cb7('0x5')](_0x2eed6f)){this['setDataValue'](_0x2cb7('0x6'),JSON[_0x2cb7('0x7')](_0x2eed6f));}else if(_[_0x2cb7('0x8')](_0x2eed6f)){this['setDataValue'](_0x2cb7('0x6'),_0x2eed6f);}else{this[_0x2cb7('0x9')](_0x2cb7('0x6'),util['format'](_0x2cb7('0xa'),this[_0x2cb7('0xb')](_0x2cb7('0x2'))||'',this[_0x2cb7('0xb')](_0x2cb7('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2cb7('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2cb7('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x5cd2=['isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','long','setDataValue','stringify'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x5cd2,0x177));var _0x25cd=function(_0x4b2d2b,_0x1ed17c){_0x4b2d2b=_0x4b2d2b-0x0;var _0x44f986=_0x5cd2[_0x4b2d2b];return _0x44f986;};'use strict';var Sequelize=require(_0x25cd('0x0'));var _=require(_0x25cd('0x1'));var util=require(_0x25cd('0x2'));module[_0x25cd('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x25cd('0x4')]},'formData':{'type':Sequelize[_0x25cd('0x5')](_0x25cd('0x6')),'set':function(_0x508ef5){if(_['isObjectLike'](_0x508ef5)){this[_0x25cd('0x7')]('formData',JSON[_0x25cd('0x8')](_0x508ef5));}else if(_[_0x25cd('0x9')](_0x508ef5)){this[_0x25cd('0x7')](_0x25cd('0xa'),_0x508ef5);}else{this[_0x25cd('0x7')](_0x25cd('0xa'),util[_0x25cd('0xb')](_0x25cd('0xc'),this[_0x25cd('0xd')]('name')||'',this[_0x25cd('0xd')](_0x25cd('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x25cd('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x25cd('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e3e2aed..aa681c5 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 _0x0a6b=['hasOwnProperty','nolimit','sort','where','pick','merge','type','includeAll','findAll','catch','show','rawAttributes','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','clone','params','body','omit','createdAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','JscriptySessionReport','order','ProjectId','filter','findOne','JscriptyAnswerReport','rows','number','toString','indexOf','replace','startTime','starttime','-createdAt','questionId','question','format','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','fieldName','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0xef4ef0,_0x3c72f9){var _0x39b60b=function(_0x1d824c){while(--_0x1d824c){_0xef4ef0['push'](_0xef4ef0['shift']());}};_0x39b60b(++_0x3c72f9);}(_0x0a6b,0x120));var _0xb0a6=function(_0x14af87,_0x149ac3){_0x14af87=_0x14af87-0x0;var _0x4ff770=_0x0a6b[_0x14af87];return _0x4ff770;};'use strict';var emlformat=require(_0xb0a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0a6('0x1'));var jsonpatch=require(_0xb0a6('0x2'));var rp=require(_0xb0a6('0x3'));var moment=require(_0xb0a6('0x4'));var BPromise=require(_0xb0a6('0x5'));var Mustache=require(_0xb0a6('0x6'));var util=require(_0xb0a6('0x7'));var path=require(_0xb0a6('0x8'));var sox=require(_0xb0a6('0x9'));var csv=require(_0xb0a6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0a6('0xb'));var _=require('lodash');var squel=require(_0xb0a6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0a6('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb0a6('0xe'));var Papa=require(_0xb0a6('0xf'));var Redis=require('ioredis');var authService=require(_0xb0a6('0x10'));var qs=require(_0xb0a6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb0a6('0x12'));var logger=require(_0xb0a6('0x13'))(_0xb0a6('0x14'));var utils=require(_0xb0a6('0x15'));var config=require(_0xb0a6('0x16'));var licenseUtil=require(_0xb0a6('0x17'));var db=require(_0xb0a6('0x18'))['db'];function respondWithStatusCode(_0xda8c5f,_0x4b3a7e){_0x4b3a7e=_0x4b3a7e||0xcc;return function(_0x2184f4){if(_0x2184f4){return _0xda8c5f[_0xb0a6('0x19')](_0x4b3a7e);}return _0xda8c5f[_0xb0a6('0x1a')](_0x4b3a7e)[_0xb0a6('0x1b')]();};}function respondWithResult(_0x9e2fda,_0x5c8cd3){_0x5c8cd3=_0x5c8cd3||0xc8;return function(_0x33bc04){if(_0x33bc04){return _0x9e2fda[_0xb0a6('0x1a')](_0x5c8cd3)['json'](_0x33bc04);}};}function respondWithFilteredResult(_0x14b116,_0x5d0759){return function(_0x54b0f5){if(_0x54b0f5){var _0x214699=typeof _0x5d0759[_0xb0a6('0x1c')]===_0xb0a6('0x1d')&&typeof _0x5d0759[_0xb0a6('0x1e')]===_0xb0a6('0x1d');var _0x1aa140=_0x54b0f5[_0xb0a6('0x1f')];var _0x1bd5ed=_0x214699?0x0:_0x5d0759[_0xb0a6('0x1c')];var _0x1375e8=_0x214699?_0x54b0f5[_0xb0a6('0x1f')]:_0x5d0759['offset']+_0x5d0759['limit'];var _0x88692;if(_0x1375e8>=_0x1aa140){_0x1375e8=_0x1aa140;_0x88692=0xc8;}else{_0x88692=0xce;}_0x14b116[_0xb0a6('0x1a')](_0x88692);return _0x14b116['set'](_0xb0a6('0x20'),_0x1bd5ed+'-'+_0x1375e8+'/'+_0x1aa140)['json'](_0x54b0f5);}return null;};}function patchUpdates(_0x1a5472){return function(_0x2077b5){try{jsonpatch[_0xb0a6('0x21')](_0x2077b5,_0x1a5472,!![]);}catch(_0x36312e){return BPromise['reject'](_0x36312e);}return _0x2077b5[_0xb0a6('0x22')]();};}function saveUpdates(_0x5e9765,_0x49a686){return function(_0x15b689){if(_0x15b689){return _0x15b689[_0xb0a6('0x23')](_0x5e9765)[_0xb0a6('0x24')](function(_0xb99553){return _0xb99553;});}return null;};}function removeEntity(_0x48f165,_0x57f2ce){return function(_0x4687d8){if(_0x4687d8){return _0x4687d8[_0xb0a6('0x25')]()[_0xb0a6('0x24')](function(){var _0x2e5101=_0x4687d8[_0xb0a6('0x26')]({'plain':!![]});var _0x49f704=_0xb0a6('0x27');return db[_0xb0a6('0x28')][_0xb0a6('0x25')]({'where':{'type':_0x49f704,'resourceId':_0x2e5101['id']}})['then'](function(){return _0x4687d8;});})[_0xb0a6('0x24')](function(){_0x48f165[_0xb0a6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7236f1,_0x3e4eb4){return function(_0x47ab40){if(!_0x47ab40){_0x7236f1['sendStatus'](0x194);}return _0x47ab40;};}function handleError(_0x543c33,_0x5e6012){_0x5e6012=_0x5e6012||0x1f4;return function(_0x384522){logger[_0xb0a6('0x29')](_0x384522[_0xb0a6('0x2a')]);if(_0x384522[_0xb0a6('0x2b')]){delete _0x384522['name'];}_0x543c33['status'](_0x5e6012)[_0xb0a6('0x2c')](_0x384522);};}exports[_0xb0a6('0x2d')]=function(_0x57d22c,_0x368539){var _0x373ea0={},_0x5d7b78={},_0xac79bd={'count':0x0,'rows':[]};var _0x92efd3=_[_0xb0a6('0x2e')](db[_0xb0a6('0x2f')]['rawAttributes'],function(_0x17c047){return{'name':_0x17c047[_0xb0a6('0x30')],'type':_0x17c047['type']['key']};});_0x5d7b78[_0xb0a6('0x31')]=_[_0xb0a6('0x2e')](_0x92efd3,_0xb0a6('0x2b'));_0x5d7b78['query']=_[_0xb0a6('0x32')](_0x57d22c[_0xb0a6('0x33')]);_0x5d7b78[_0xb0a6('0x34')]=_[_0xb0a6('0x35')](_0x5d7b78[_0xb0a6('0x31')],_0x5d7b78['query']);_0x373ea0[_0xb0a6('0x36')]=_['intersection'](_0x5d7b78[_0xb0a6('0x31')],qs['fields'](_0x57d22c[_0xb0a6('0x33')][_0xb0a6('0x37')]));_0x373ea0[_0xb0a6('0x36')]=_0x373ea0[_0xb0a6('0x36')][_0xb0a6('0x38')]?_0x373ea0[_0xb0a6('0x36')]:_0x5d7b78[_0xb0a6('0x31')];if(!_0x57d22c[_0xb0a6('0x33')][_0xb0a6('0x39')](_0xb0a6('0x3a'))){_0x373ea0['limit']=qs['limit'](_0x57d22c[_0xb0a6('0x33')]['limit']);_0x373ea0[_0xb0a6('0x1c')]=qs[_0xb0a6('0x1c')](_0x57d22c[_0xb0a6('0x33')][_0xb0a6('0x1c')]);}_0x373ea0['order']=qs[_0xb0a6('0x3b')](_0x57d22c[_0xb0a6('0x33')]['sort']);_0x373ea0[_0xb0a6('0x3c')]=qs[_0xb0a6('0x34')](_[_0xb0a6('0x3d')](_0x57d22c[_0xb0a6('0x33')],_0x5d7b78['filters']),_0x92efd3);if(_0x57d22c[_0xb0a6('0x33')]['filter']){_0x373ea0[_0xb0a6('0x3c')]=_[_0xb0a6('0x3e')](_0x373ea0['where'],{'$or':_[_0xb0a6('0x2e')](_0x92efd3,function(_0x509ac0){if(_0x509ac0[_0xb0a6('0x3f')]!=='VIRTUAL'){var _0x2e7da6={};_0x2e7da6[_0x509ac0[_0xb0a6('0x2b')]]={'$like':'%'+_0x57d22c[_0xb0a6('0x33')]['filter']+'%'};return _0x2e7da6;}})});}_0x373ea0=_[_0xb0a6('0x3e')]({},_0x373ea0,_0x57d22c['options']);var _0x2b367c={'where':_0x373ea0[_0xb0a6('0x3c')]};return db[_0xb0a6('0x2f')][_0xb0a6('0x1f')](_0x2b367c)[_0xb0a6('0x24')](function(_0x1c8d91){_0xac79bd[_0xb0a6('0x1f')]=_0x1c8d91;if(_0x57d22c['query'][_0xb0a6('0x40')]){_0x373ea0['include']=[{'all':!![]}];}return db[_0xb0a6('0x2f')][_0xb0a6('0x41')](_0x373ea0);})[_0xb0a6('0x24')](function(_0x14bd17){_0xac79bd['rows']=_0x14bd17;return _0xac79bd;})['then'](respondWithFilteredResult(_0x368539,_0x373ea0))[_0xb0a6('0x42')](handleError(_0x368539,null));};exports[_0xb0a6('0x43')]=function(_0x503cdf,_0x51a434){var _0x40104b={'raw':![],'where':{'id':_0x503cdf['params']['id']}},_0x1d7b04={};_0x1d7b04['model']=_[_0xb0a6('0x32')](db[_0xb0a6('0x2f')][_0xb0a6('0x44')]);_0x1d7b04[_0xb0a6('0x33')]=_[_0xb0a6('0x32')](_0x503cdf[_0xb0a6('0x33')]);_0x1d7b04[_0xb0a6('0x34')]=_['intersection'](_0x1d7b04[_0xb0a6('0x31')],_0x1d7b04[_0xb0a6('0x33')]);_0x40104b['attributes']=_[_0xb0a6('0x35')](_0x1d7b04['model'],qs[_0xb0a6('0x37')](_0x503cdf[_0xb0a6('0x33')][_0xb0a6('0x37')]));_0x40104b['attributes']=_0x40104b['attributes'][_0xb0a6('0x38')]?_0x40104b[_0xb0a6('0x36')]:_0x1d7b04[_0xb0a6('0x31')];if(_0x503cdf['query'][_0xb0a6('0x40')]){_0x40104b[_0xb0a6('0x45')]=[{'all':!![]}];}_0x40104b=_['merge']({},_0x40104b,_0x503cdf[_0xb0a6('0x46')]);return db[_0xb0a6('0x2f')][_0xb0a6('0x47')](_0x40104b)['then'](handleEntityNotFound(_0x51a434,null))[_0xb0a6('0x24')](respondWithResult(_0x51a434,null))[_0xb0a6('0x42')](handleError(_0x51a434,null));};exports['create']=function(_0x58d1f3,_0x338a86){return db['JscriptyProject'][_0xb0a6('0x48')](_0x58d1f3['body'],{})['then'](function(_0x3994bc){var _0x1699cd=_0x58d1f3[_0xb0a6('0x49')][_0xb0a6('0x26')]({'plain':!![]});if(!_0x1699cd)throw new Error(_0xb0a6('0x4a'));if(_0x1699cd[_0xb0a6('0x4b')]===_0xb0a6('0x49')){var _0x1f3410=_0x3994bc[_0xb0a6('0x26')]({'plain':!![]});var _0x3beca8=_0xb0a6('0x27');return db[_0xb0a6('0x4c')]['find']({'where':{'name':_0x3beca8,'userProfileId':_0x1699cd[_0xb0a6('0x4d')]},'raw':!![]})[_0xb0a6('0x24')](function(_0x2c961d){if(_0x2c961d&&_0x2c961d['autoAssociation']===0x0){return db[_0xb0a6('0x28')][_0xb0a6('0x48')]({'name':_0x1f3410[_0xb0a6('0x2b')],'resourceId':_0x1f3410['id'],'type':_0x2c961d[_0xb0a6('0x2b')],'sectionId':_0x2c961d['id']},{})['then'](function(){return _0x3994bc;});}else{return _0x3994bc;}})[_0xb0a6('0x42')](function(_0x537735){logger[_0xb0a6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x537735);throw _0x537735;});}return _0x3994bc;})[_0xb0a6('0x24')](respondWithResult(_0x338a86,0xc9))[_0xb0a6('0x42')](handleError(_0x338a86,null));};exports[_0xb0a6('0x4e')]=function(_0xd37e70,_0x980785){var _0x16ecdb={'where':{'id':_0xd37e70[_0xb0a6('0x4f')]['id']}},_0x49793c={};_0x49793c[_0xb0a6('0x31')]=_['keys'](db[_0xb0a6('0x2f')][_0xb0a6('0x44')]);_0x16ecdb[_0xb0a6('0x36')]=_['intersection'](_0x49793c[_0xb0a6('0x31')],qs['fields'](_0xd37e70[_0xb0a6('0x33')][_0xb0a6('0x37')]));_0x16ecdb[_0xb0a6('0x36')]=_0x16ecdb[_0xb0a6('0x36')][_0xb0a6('0x38')]?_0x16ecdb[_0xb0a6('0x36')]:_0x49793c['model'];if(_0xd37e70['query']['includeAll']){_0x16ecdb[_0xb0a6('0x45')]=[{'all':!![]}];}_0x16ecdb=_[_0xb0a6('0x3e')]({},_0x16ecdb,_0xd37e70[_0xb0a6('0x46')]);return db[_0xb0a6('0x2f')][_0xb0a6('0x47')](_0x16ecdb)[_0xb0a6('0x24')](handleEntityNotFound(_0x980785,null))[_0xb0a6('0x24')](function(_0x3704b0){if(_0x3704b0){var _0x3e5935=_0x3704b0[_0xb0a6('0x26')]({'plain':!![]});_0x3e5935=qs['omit'](_0x3e5935,['id','createdAt','updatedAt']);_0xd37e70[_0xb0a6('0x50')]=_[_0xb0a6('0x51')](_0xd37e70[_0xb0a6('0x50')],['id',_0xb0a6('0x52'),'updatedAt']);return db[_0xb0a6('0x2f')]['create'](_[_0xb0a6('0x3e')](_0x3e5935,_0xd37e70['body']),{'include':_0xd37e70[_0xb0a6('0x33')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x138665){var _0x35c24b=_0xd37e70[_0xb0a6('0x49')]['get']({'plain':!![]});if(!_0x35c24b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35c24b[_0xb0a6('0x4b')]===_0xb0a6('0x49')){var _0x64b032=_0x138665[_0xb0a6('0x26')]({'plain':!![]});var _0x33530a=_0xb0a6('0x27');return db[_0xb0a6('0x4c')][_0xb0a6('0x47')]({'where':{'name':_0x33530a,'userProfileId':_0x35c24b[_0xb0a6('0x4d')]},'raw':!![]})[_0xb0a6('0x24')](function(_0x529bb8){if(_0x529bb8&&_0x529bb8[_0xb0a6('0x53')]===0x0){return db[_0xb0a6('0x28')][_0xb0a6('0x48')]({'name':_0x64b032[_0xb0a6('0x2b')],'resourceId':_0x64b032['id'],'type':_0x529bb8[_0xb0a6('0x2b')],'sectionId':_0x529bb8['id']},{})[_0xb0a6('0x24')](function(){return _0x138665;});}else{return _0x138665;}})[_0xb0a6('0x42')](function(_0x52f8ed){logger[_0xb0a6('0x29')](_0xb0a6('0x54'),_0x52f8ed);throw _0x52f8ed;});}return _0x138665;});}})[_0xb0a6('0x24')](respondWithResult(_0x980785,0xc9))[_0xb0a6('0x42')](handleError(_0x980785,null));};exports[_0xb0a6('0x23')]=function(_0x12bc38,_0xad304e){if(_0x12bc38[_0xb0a6('0x50')]['id']){delete _0x12bc38['body']['id'];}return db[_0xb0a6('0x2f')][_0xb0a6('0x47')]({'where':{'id':_0x12bc38[_0xb0a6('0x4f')]['id']}})[_0xb0a6('0x24')](handleEntityNotFound(_0xad304e,null))[_0xb0a6('0x24')](saveUpdates(_0x12bc38[_0xb0a6('0x50')],null))[_0xb0a6('0x24')](respondWithResult(_0xad304e,null))[_0xb0a6('0x42')](handleError(_0xad304e,null));};exports[_0xb0a6('0x25')]=function(_0x4e4cba,_0x283e5f){return db[_0xb0a6('0x2f')][_0xb0a6('0x47')]({'where':{'id':_0x4e4cba[_0xb0a6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x283e5f,null))[_0xb0a6('0x24')](removeEntity(_0x283e5f,null))[_0xb0a6('0x42')](handleError(_0x283e5f,null));};exports[_0xb0a6('0x55')]=function(_0x58a102,_0x110e81,_0x1aacdb){var _0xd303e3={'raw':!![],'where':{}};var _0x130e84={};var _0x2e4e15={'count':0x0,'rows':[]};return db[_0xb0a6('0x2f')]['findOne']({'where':{'id':_0x58a102[_0xb0a6('0x4f')]['id']}})[_0xb0a6('0x24')](handleEntityNotFound(_0x110e81,null))[_0xb0a6('0x24')](function(_0xaebb86){if(_0xaebb86){_0x130e84[_0xb0a6('0x31')]=_[_0xb0a6('0x32')](db[_0xb0a6('0x56')]['rawAttributes']);_0x130e84[_0xb0a6('0x33')]=_['keys'](_0x58a102[_0xb0a6('0x33')]);_0x130e84['filters']=_['intersection'](_0x130e84['model'],_0x130e84[_0xb0a6('0x33')]);_0xd303e3[_0xb0a6('0x36')]=_[_0xb0a6('0x35')](_0x130e84[_0xb0a6('0x31')],qs[_0xb0a6('0x37')](_0x58a102[_0xb0a6('0x33')][_0xb0a6('0x37')]));_0xd303e3[_0xb0a6('0x36')]=_0xd303e3['attributes']['length']?_0xd303e3[_0xb0a6('0x36')]:_0x130e84[_0xb0a6('0x31')];if(!_0x58a102[_0xb0a6('0x33')][_0xb0a6('0x39')](_0xb0a6('0x3a'))){_0xd303e3[_0xb0a6('0x1e')]=qs['limit'](_0x58a102[_0xb0a6('0x33')][_0xb0a6('0x1e')]);_0xd303e3[_0xb0a6('0x1c')]=qs['offset'](_0x58a102['query'][_0xb0a6('0x1c')]);}_0xd303e3[_0xb0a6('0x57')]=qs[_0xb0a6('0x3b')](_0x58a102[_0xb0a6('0x33')]['sort']);_0xd303e3[_0xb0a6('0x3c')]=qs[_0xb0a6('0x34')](_['pick'](_0x58a102[_0xb0a6('0x33')],_0x130e84['filters']));_0xd303e3[_0xb0a6('0x3c')][_0xb0a6('0x58')]=_0xaebb86['id'];if(_0x58a102['query'][_0xb0a6('0x59')]){_0xd303e3[_0xb0a6('0x3c')]=_[_0xb0a6('0x3e')](_0xd303e3[_0xb0a6('0x3c')],{'$or':_[_0xb0a6('0x2e')](_0xd303e3[_0xb0a6('0x36')],function(_0x1e9ad4){var _0x2816ae={};_0x2816ae[_0x1e9ad4]={'$like':'%'+_0x58a102[_0xb0a6('0x33')][_0xb0a6('0x59')]+'%'};return _0x2816ae;})});}_0xd303e3=_['merge']({},_0xd303e3,_0x58a102[_0xb0a6('0x46')]);return db[_0xb0a6('0x56')]['count']({'where':_0xd303e3[_0xb0a6('0x3c')]})[_0xb0a6('0x24')](function(_0x5c78f9){_0x2e4e15[_0xb0a6('0x1f')]=_0x5c78f9;if(_0x58a102[_0xb0a6('0x33')][_0xb0a6('0x40')]){_0xd303e3[_0xb0a6('0x45')]=[{'all':!![]}];}return db[_0xb0a6('0x56')][_0xb0a6('0x41')](_0xd303e3);})[_0xb0a6('0x24')](function(_0x5a2031){_0x2e4e15['rows']=_0x5a2031;return _0x2e4e15;});}})[_0xb0a6('0x24')](respondWithFilteredResult(_0x110e81,_0xd303e3))[_0xb0a6('0x42')](handleError(_0x110e81,null));};exports['getAnswers']=function(_0x32b000,_0x582e83,_0x3025fd){var _0x1db940={'raw':!![],'where':{}};var _0x38af99={};var _0x4ff5da={'count':0x0,'rows':[]};return db[_0xb0a6('0x2f')][_0xb0a6('0x5a')]({'where':{'id':_0x32b000[_0xb0a6('0x4f')]['id']}})[_0xb0a6('0x24')](handleEntityNotFound(_0x582e83,null))['then'](function(_0x4a7d0b){if(_0x4a7d0b){_0x38af99[_0xb0a6('0x31')]=_[_0xb0a6('0x32')](db[_0xb0a6('0x5b')][_0xb0a6('0x44')]);_0x38af99['query']=_[_0xb0a6('0x32')](_0x32b000[_0xb0a6('0x33')]);_0x38af99[_0xb0a6('0x34')]=_[_0xb0a6('0x35')](_0x38af99[_0xb0a6('0x31')],_0x38af99['query']);_0x1db940[_0xb0a6('0x36')]=_[_0xb0a6('0x35')](_0x38af99[_0xb0a6('0x31')],qs[_0xb0a6('0x37')](_0x32b000[_0xb0a6('0x33')][_0xb0a6('0x37')]));_0x1db940[_0xb0a6('0x36')]=_0x1db940[_0xb0a6('0x36')]['length']?_0x1db940['attributes']:_0x38af99['model'];if(!_0x32b000[_0xb0a6('0x33')][_0xb0a6('0x39')](_0xb0a6('0x3a'))){_0x1db940['limit']=qs[_0xb0a6('0x1e')](_0x32b000[_0xb0a6('0x33')][_0xb0a6('0x1e')]);_0x1db940['offset']=qs['offset'](_0x32b000[_0xb0a6('0x33')][_0xb0a6('0x1c')]);}_0x1db940[_0xb0a6('0x57')]=qs['sort'](_0x32b000['query'][_0xb0a6('0x3b')]);_0x1db940[_0xb0a6('0x3c')]=qs[_0xb0a6('0x34')](_[_0xb0a6('0x3d')](_0x32b000[_0xb0a6('0x33')],_0x38af99[_0xb0a6('0x34')]));_0x1db940['where'][_0xb0a6('0x58')]=_0x4a7d0b['id'];if(_0x32b000[_0xb0a6('0x33')][_0xb0a6('0x59')]){_0x1db940[_0xb0a6('0x3c')]=_[_0xb0a6('0x3e')](_0x1db940[_0xb0a6('0x3c')],{'$or':_[_0xb0a6('0x2e')](_0x1db940['attributes'],function(_0x13e0ea){var _0x1e651d={};_0x1e651d[_0x13e0ea]={'$like':'%'+_0x32b000[_0xb0a6('0x33')][_0xb0a6('0x59')]+'%'};return _0x1e651d;})});}_0x1db940=_['merge']({},_0x1db940,_0x32b000[_0xb0a6('0x46')]);return db[_0xb0a6('0x5b')]['count']({'where':_0x1db940[_0xb0a6('0x3c')]})[_0xb0a6('0x24')](function(_0x525c79){_0x4ff5da[_0xb0a6('0x1f')]=_0x525c79;if(_0x32b000[_0xb0a6('0x33')][_0xb0a6('0x40')]){_0x1db940[_0xb0a6('0x45')]=[{'all':!![]}];}return db[_0xb0a6('0x5b')][_0xb0a6('0x41')](_0x1db940);})['then'](function(_0x249dd7){_0x4ff5da[_0xb0a6('0x5c')]=_0x249dd7;return _0x4ff5da;});}})[_0xb0a6('0x24')](respondWithFilteredResult(_0x582e83,_0x1db940))['catch'](handleError(_0x582e83,null));};function char(_0x3f6c79){return _0xb0a6('0x5d')===typeof _0x3f6c79?String['fromCharCode'][_0xb0a6('0x21')](null,arguments):_0x3f6c79;}function needsEncapsulation(_0x1ae787){return!!_0x1ae787&&(_0x1ae787[_0xb0a6('0x5e')]()[_0xb0a6('0x5f')](char(0xd))>=0x0||_0x1ae787[_0xb0a6('0x5e')]()[_0xb0a6('0x5f')](char(0xa))>=0x0||_0x1ae787[_0xb0a6('0x5e')]()[_0xb0a6('0x5f')](char(0x2c))>=0x0||_0x1ae787[_0xb0a6('0x5e')]()[_0xb0a6('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x365159){var _0x39ba4b=char(0x22),_0x278690='\x5c'+char(0x22),_0xd16982=_0x365159['toString']()[_0xb0a6('0x60')](new RegExp(_0x39ba4b,'g'),_0x278690);return _0x39ba4b+_0xd16982+_0x39ba4b;}exports['getSummary']=function(_0x1f0083,_0x3bc076,_0x175568){var _0x4c6153,_0x21bd2b;var _0x409541={'where':{'ProjectId':_0x1f0083[_0xb0a6('0x4f')]['id']}};if(_0x1f0083['query'][_0xb0a6('0x61')]){_0x409541['where'][_0xb0a6('0x62')]=JSON['parse'](_0x1f0083['query']['startTime']);}return db[_0xb0a6('0x56')][_0xb0a6('0x41')](_0x409541)['then'](handleEntityNotFound(_0x3bc076,null))[_0xb0a6('0x24')](function(_0x59b7bd){if(_0x59b7bd){_0x4c6153=_0x59b7bd;return db['JscriptyQuestionReport'][_0xb0a6('0x41')]({'where':{'SessionId':{'$in':_[_0xb0a6('0x2e')](_0x4c6153,'id')},'ProjectId':_0x1f0083['params']['id']},'order':_0xb0a6('0x63')});}})['then'](handleEntityNotFound(_0x3bc076,null))[_0xb0a6('0x24')](function(_0x22d1d1){if(_0x22d1d1){_0x21bd2b=_0x22d1d1;var _0x1a2378={};for(var _0x489515=0x0,_0x65eb6a=_0x21bd2b[_0xb0a6('0x38')];_0x489515<_0x65eb6a;_0x489515++){if(!_0x1a2378[_0xb0a6('0x39')](_0x21bd2b[_0x489515][_0xb0a6('0x64')])){_0x1a2378[_0x21bd2b[_0x489515][_0xb0a6('0x64')]]=needsEncapsulation(_0x21bd2b[_0x489515][_0xb0a6('0x65')])?encapsulate(_0x21bd2b[_0x489515]['question']):_0x21bd2b[_0x489515][_0xb0a6('0x65')];}}var _0x587f9e=[],_0x1b68ba={};for(var _0x4117de=0x0,_0x20c4b8=_0x4c6153['length'];_0x4117de<_0x20c4b8;_0x4117de++){_0x1b68ba={'ProjectId':_0x1f0083[_0xb0a6('0x4f')]['id'],'SessionId':_0x4c6153[_0x4117de]['id'],'StartTime':moment(_0x4c6153[_0x4117de][_0xb0a6('0x62')])[_0xb0a6('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x2fb47b=0x0,_0x38ac00=_0x21bd2b[_0xb0a6('0x38')];_0x2fb47b<_0x38ac00;_0x2fb47b++){if(_0x21bd2b[_0x2fb47b][_0xb0a6('0x67')]==_0x4c6153[_0x4117de]['id']&&_0x1a2378[_0xb0a6('0x39')](_0x21bd2b[_0x2fb47b][_0xb0a6('0x64')])){_0x1b68ba[_0x1a2378[_0x21bd2b[_0x2fb47b][_0xb0a6('0x64')]]]=_0x21bd2b[_0x2fb47b][_0xb0a6('0x68')];}}for(var _0x22e694 in _0x1a2378){if(!_0x1b68ba[_0xb0a6('0x39')](_0x1a2378[_0x22e694])){_0x1b68ba[_0x1a2378[_0x22e694]]=null;}}_0x587f9e[_0xb0a6('0x69')](_0x1b68ba);}return _0x587f9e;}})[_0xb0a6('0x24')](function(_0x58b5bf){if(!_[_0xb0a6('0x6a')](_0x58b5bf)){var _0x4b8593=toCsv(_0x58b5bf);var _0x438ac7=Date[_0xb0a6('0x6b')]();fs[_0xb0a6('0x6c')](util[_0xb0a6('0x66')](_0xb0a6('0x6d'),_0x1f0083[_0xb0a6('0x4f')]['id'],_0x438ac7),_0x4b8593);_0x3bc076['setHeader']('Content-disposition',_0xb0a6('0x6e')+util['format'](_0xb0a6('0x6f'),_0x1f0083[_0xb0a6('0x4f')]['id'],_0x438ac7));_0x3bc076['setHeader'](_0xb0a6('0x70'),_0xb0a6('0x71'));return _0x3bc076[_0xb0a6('0x72')](util[_0xb0a6('0x66')](_0xb0a6('0x6d'),_0x1f0083[_0xb0a6('0x4f')]['id'],_0x438ac7));}else{return _0x3bc076[_0xb0a6('0x19')](0xcc);}})[_0xb0a6('0x42')](handleError(_0x3bc076,null));}; \ No newline at end of file +var _0x609a=['setHeader','Content-type','text/csv','download','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','Projects','destroy','stack','name','send','index','map','rawAttributes','type','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','findAll','rows','catch','keys','intersection','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','params','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv'];(function(_0x5bd6cd,_0x526dc3){var _0x3d46d7=function(_0xc4a9a6){while(--_0xc4a9a6){_0x5bd6cd['push'](_0x5bd6cd['shift']());}};_0x3d46d7(++_0x526dc3);}(_0x609a,0x1ec));var _0xa609=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x609a[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xa609('0x0'));var rimraf=require(_0xa609('0x1'));var zipdir=require(_0xa609('0x2'));var jsonpatch=require(_0xa609('0x3'));var rp=require(_0xa609('0x4'));var moment=require(_0xa609('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa609('0x6'));var util=require('util');var path=require(_0xa609('0x7'));var sox=require(_0xa609('0x8'));var csv=require(_0xa609('0x9'));var ejs=require(_0xa609('0xa'));var fs=require('fs');var fs_extra=require(_0xa609('0xb'));var _=require(_0xa609('0xc'));var squel=require(_0xa609('0xd'));var crypto=require(_0xa609('0xe'));var jsforce=require(_0xa609('0xf'));var deskjs=require(_0xa609('0x10'));var toCsv=require(_0xa609('0x9'));var querystring=require(_0xa609('0x11'));var Papa=require('papaparse');var Redis=require(_0xa609('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa609('0x13'));var as=require(_0xa609('0x14'));var hardwareService=require(_0xa609('0x15'));var logger=require(_0xa609('0x16'))('api');var utils=require(_0xa609('0x17'));var config=require(_0xa609('0x18'));var licenseUtil=require(_0xa609('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b8729,_0x28312c){_0x28312c=_0x28312c||0xcc;return function(_0x190509){if(_0x190509){return _0x2b8729[_0xa609('0x1a')](_0x28312c);}return _0x2b8729[_0xa609('0x1b')](_0x28312c)[_0xa609('0x1c')]();};}function respondWithResult(_0x142bcd,_0x36d144){_0x36d144=_0x36d144||0xc8;return function(_0x312d4e){if(_0x312d4e){return _0x142bcd[_0xa609('0x1b')](_0x36d144)[_0xa609('0x1d')](_0x312d4e);}};}function respondWithFilteredResult(_0x4809bc,_0x460693){return function(_0x460247){if(_0x460247){var _0x33db9a=typeof _0x460693[_0xa609('0x1e')]===_0xa609('0x1f')&&typeof _0x460693[_0xa609('0x20')]===_0xa609('0x1f');var _0x28726c=_0x460247[_0xa609('0x21')];var _0x1c9bed=_0x33db9a?0x0:_0x460693[_0xa609('0x1e')];var _0x3e6eac=_0x33db9a?_0x460247[_0xa609('0x21')]:_0x460693['offset']+_0x460693['limit'];var _0x4c4b14;if(_0x3e6eac>=_0x28726c){_0x3e6eac=_0x28726c;_0x4c4b14=0xc8;}else{_0x4c4b14=0xce;}_0x4809bc[_0xa609('0x1b')](_0x4c4b14);return _0x4809bc[_0xa609('0x22')](_0xa609('0x23'),_0x1c9bed+'-'+_0x3e6eac+'/'+_0x28726c)[_0xa609('0x1d')](_0x460247);}return null;};}function patchUpdates(_0x103bce){return function(_0x56a064){try{jsonpatch[_0xa609('0x24')](_0x56a064,_0x103bce,!![]);}catch(_0x204e2a){return BPromise['reject'](_0x204e2a);}return _0x56a064[_0xa609('0x25')]();};}function saveUpdates(_0x6b9ee0,_0x535e58){return function(_0x3a7975){if(_0x3a7975){return _0x3a7975[_0xa609('0x26')](_0x6b9ee0)[_0xa609('0x27')](function(_0x202b20){return _0x202b20;});}return null;};}function removeEntity(_0xd4321d,_0x210943){return function(_0x4ca2c3){if(_0x4ca2c3){return _0x4ca2c3['destroy']()[_0xa609('0x27')](function(){var _0x1fe2ab=_0x4ca2c3['get']({'plain':!![]});var _0x33673c=_0xa609('0x28');return db['UserProfileResource'][_0xa609('0x29')]({'where':{'type':_0x33673c,'resourceId':_0x1fe2ab['id']}})[_0xa609('0x27')](function(){return _0x4ca2c3;});})[_0xa609('0x27')](function(){_0xd4321d['status'](0xcc)[_0xa609('0x1c')]();});}};}function handleEntityNotFound(_0x34b7e1,_0x359638){return function(_0x1c46b0){if(!_0x1c46b0){_0x34b7e1[_0xa609('0x1a')](0x194);}return _0x1c46b0;};}function handleError(_0x1fffc5,_0x37d1aa){_0x37d1aa=_0x37d1aa||0x1f4;return function(_0xc8a523){logger['error'](_0xc8a523[_0xa609('0x2a')]);if(_0xc8a523[_0xa609('0x2b')]){delete _0xc8a523['name'];}_0x1fffc5[_0xa609('0x1b')](_0x37d1aa)[_0xa609('0x2c')](_0xc8a523);};}exports[_0xa609('0x2d')]=function(_0x3ba51a,_0x381a88){var _0x5cb635={},_0x32a1cd={},_0x44c1eb={'count':0x0,'rows':[]};var _0x196340=_[_0xa609('0x2e')](db['JscriptyProject'][_0xa609('0x2f')],function(_0x333c6f){return{'name':_0x333c6f['fieldName'],'type':_0x333c6f[_0xa609('0x30')]['key']};});_0x32a1cd[_0xa609('0x31')]=_[_0xa609('0x2e')](_0x196340,'name');_0x32a1cd[_0xa609('0x32')]=_['keys'](_0x3ba51a[_0xa609('0x32')]);_0x32a1cd['filters']=_['intersection'](_0x32a1cd[_0xa609('0x31')],_0x32a1cd['query']);_0x5cb635['attributes']=_['intersection'](_0x32a1cd['model'],qs[_0xa609('0x33')](_0x3ba51a[_0xa609('0x32')]['fields']));_0x5cb635[_0xa609('0x34')]=_0x5cb635[_0xa609('0x34')]['length']?_0x5cb635['attributes']:_0x32a1cd['model'];if(!_0x3ba51a[_0xa609('0x32')][_0xa609('0x35')](_0xa609('0x36'))){_0x5cb635[_0xa609('0x20')]=qs[_0xa609('0x20')](_0x3ba51a[_0xa609('0x32')][_0xa609('0x20')]);_0x5cb635['offset']=qs['offset'](_0x3ba51a['query']['offset']);}_0x5cb635[_0xa609('0x37')]=qs[_0xa609('0x38')](_0x3ba51a['query']['sort']);_0x5cb635[_0xa609('0x39')]=qs[_0xa609('0x3a')](_[_0xa609('0x3b')](_0x3ba51a[_0xa609('0x32')],_0x32a1cd[_0xa609('0x3a')]),_0x196340);if(_0x3ba51a['query'][_0xa609('0x3c')]){_0x5cb635[_0xa609('0x39')]=_[_0xa609('0x3d')](_0x5cb635[_0xa609('0x39')],{'$or':_[_0xa609('0x2e')](_0x196340,function(_0x26a647){if(_0x26a647[_0xa609('0x30')]!==_0xa609('0x3e')){var _0x715543={};_0x715543[_0x26a647['name']]={'$like':'%'+_0x3ba51a[_0xa609('0x32')][_0xa609('0x3c')]+'%'};return _0x715543;}})});}_0x5cb635=_['merge']({},_0x5cb635,_0x3ba51a[_0xa609('0x3f')]);var _0x3f8f3b={'where':_0x5cb635['where']};return db[_0xa609('0x40')][_0xa609('0x21')](_0x3f8f3b)['then'](function(_0x30fceb){_0x44c1eb['count']=_0x30fceb;if(_0x3ba51a['query'][_0xa609('0x41')]){_0x5cb635['include']=[{'all':!![]}];}return db[_0xa609('0x40')][_0xa609('0x42')](_0x5cb635);})[_0xa609('0x27')](function(_0xfa9786){_0x44c1eb[_0xa609('0x43')]=_0xfa9786;return _0x44c1eb;})['then'](respondWithFilteredResult(_0x381a88,_0x5cb635))[_0xa609('0x44')](handleError(_0x381a88,null));};exports['show']=function(_0x413aea,_0x5941b1){var _0x51e9aa={'raw':![],'where':{'id':_0x413aea['params']['id']}},_0x8913b7={};_0x8913b7[_0xa609('0x31')]=_[_0xa609('0x45')](db[_0xa609('0x40')][_0xa609('0x2f')]);_0x8913b7['query']=_[_0xa609('0x45')](_0x413aea[_0xa609('0x32')]);_0x8913b7[_0xa609('0x3a')]=_[_0xa609('0x46')](_0x8913b7[_0xa609('0x31')],_0x8913b7['query']);_0x51e9aa[_0xa609('0x34')]=_['intersection'](_0x8913b7[_0xa609('0x31')],qs[_0xa609('0x33')](_0x413aea[_0xa609('0x32')]['fields']));_0x51e9aa[_0xa609('0x34')]=_0x51e9aa[_0xa609('0x34')][_0xa609('0x47')]?_0x51e9aa[_0xa609('0x34')]:_0x8913b7[_0xa609('0x31')];if(_0x413aea[_0xa609('0x32')]['includeAll']){_0x51e9aa[_0xa609('0x48')]=[{'all':!![]}];}_0x51e9aa=_[_0xa609('0x3d')]({},_0x51e9aa,_0x413aea[_0xa609('0x3f')]);return db['JscriptyProject'][_0xa609('0x49')](_0x51e9aa)['then'](handleEntityNotFound(_0x5941b1,null))[_0xa609('0x27')](respondWithResult(_0x5941b1,null))[_0xa609('0x44')](handleError(_0x5941b1,null));};exports[_0xa609('0x4a')]=function(_0x1ccdf1,_0x4de98b){return db[_0xa609('0x40')][_0xa609('0x4a')](_0x1ccdf1[_0xa609('0x4b')],{})[_0xa609('0x27')](function(_0x73bb54){var _0x4f430e=_0x1ccdf1[_0xa609('0x4c')][_0xa609('0x4d')]({'plain':!![]});if(!_0x4f430e)throw new Error(_0xa609('0x4e'));if(_0x4f430e[_0xa609('0x4f')]===_0xa609('0x4c')){var _0x5dd362=_0x73bb54[_0xa609('0x4d')]({'plain':!![]});var _0x125ad1=_0xa609('0x28');return db[_0xa609('0x50')][_0xa609('0x49')]({'where':{'name':_0x125ad1,'userProfileId':_0x4f430e[_0xa609('0x51')]},'raw':!![]})['then'](function(_0x19b9e8){if(_0x19b9e8&&_0x19b9e8['autoAssociation']===0x0){return db[_0xa609('0x52')]['create']({'name':_0x5dd362[_0xa609('0x2b')],'resourceId':_0x5dd362['id'],'type':_0x19b9e8[_0xa609('0x2b')],'sectionId':_0x19b9e8['id']},{})['then'](function(){return _0x73bb54;});}else{return _0x73bb54;}})[_0xa609('0x44')](function(_0x141fc1){logger[_0xa609('0x53')](_0xa609('0x54'),_0x141fc1);throw _0x141fc1;});}return _0x73bb54;})[_0xa609('0x27')](respondWithResult(_0x4de98b,0xc9))[_0xa609('0x44')](handleError(_0x4de98b,null));};exports[_0xa609('0x55')]=function(_0x52f42d,_0xa21947){var _0x18dfb8={'where':{'id':_0x52f42d['params']['id']}},_0x2c0f59={};_0x2c0f59[_0xa609('0x31')]=_['keys'](db[_0xa609('0x40')][_0xa609('0x2f')]);_0x18dfb8[_0xa609('0x34')]=_[_0xa609('0x46')](_0x2c0f59[_0xa609('0x31')],qs[_0xa609('0x33')](_0x52f42d[_0xa609('0x32')][_0xa609('0x33')]));_0x18dfb8[_0xa609('0x34')]=_0x18dfb8['attributes'][_0xa609('0x47')]?_0x18dfb8[_0xa609('0x34')]:_0x2c0f59['model'];if(_0x52f42d['query'][_0xa609('0x41')]){_0x18dfb8[_0xa609('0x48')]=[{'all':!![]}];}_0x18dfb8=_[_0xa609('0x3d')]({},_0x18dfb8,_0x52f42d['options']);return db[_0xa609('0x40')]['find'](_0x18dfb8)[_0xa609('0x27')](handleEntityNotFound(_0xa21947,null))[_0xa609('0x27')](function(_0xf4aa73){if(_0xf4aa73){var _0x5bc5b3=_0xf4aa73['get']({'plain':!![]});_0x5bc5b3=qs[_0xa609('0x56')](_0x5bc5b3,['id',_0xa609('0x57'),_0xa609('0x58')]);_0x52f42d[_0xa609('0x4b')]=_[_0xa609('0x56')](_0x52f42d[_0xa609('0x4b')],['id',_0xa609('0x57'),_0xa609('0x58')]);return db[_0xa609('0x40')]['create'](_[_0xa609('0x3d')](_0x5bc5b3,_0x52f42d[_0xa609('0x4b')]),{'include':_0x52f42d[_0xa609('0x32')][_0xa609('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0xbb25b9){var _0x2c872a=_0x52f42d[_0xa609('0x4c')][_0xa609('0x4d')]({'plain':!![]});if(!_0x2c872a)throw new Error(_0xa609('0x4e'));if(_0x2c872a[_0xa609('0x4f')]==='user'){var _0x10a8d5=_0xbb25b9['get']({'plain':!![]});var _0x5284e7=_0xa609('0x28');return db['UserProfileSection'][_0xa609('0x49')]({'where':{'name':_0x5284e7,'userProfileId':_0x2c872a[_0xa609('0x51')]},'raw':!![]})[_0xa609('0x27')](function(_0xaa1fef){if(_0xaa1fef&&_0xaa1fef[_0xa609('0x59')]===0x0){return db[_0xa609('0x52')]['create']({'name':_0x10a8d5[_0xa609('0x2b')],'resourceId':_0x10a8d5['id'],'type':_0xaa1fef[_0xa609('0x2b')],'sectionId':_0xaa1fef['id']},{})['then'](function(){return _0xbb25b9;});}else{return _0xbb25b9;}})[_0xa609('0x44')](function(_0x5d0afe){logger[_0xa609('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d0afe);throw _0x5d0afe;});}return _0xbb25b9;});}})['then'](respondWithResult(_0xa21947,0xc9))[_0xa609('0x44')](handleError(_0xa21947,null));};exports[_0xa609('0x26')]=function(_0x3f34b3,_0xd0e0f6){if(_0x3f34b3[_0xa609('0x4b')]['id']){delete _0x3f34b3[_0xa609('0x4b')]['id'];}return db[_0xa609('0x40')][_0xa609('0x49')]({'where':{'id':_0x3f34b3[_0xa609('0x5a')]['id']}})[_0xa609('0x27')](handleEntityNotFound(_0xd0e0f6,null))[_0xa609('0x27')](saveUpdates(_0x3f34b3[_0xa609('0x4b')],null))['then'](respondWithResult(_0xd0e0f6,null))[_0xa609('0x44')](handleError(_0xd0e0f6,null));};exports['destroy']=function(_0x57ec79,_0x476602){return db[_0xa609('0x40')][_0xa609('0x49')]({'where':{'id':_0x57ec79[_0xa609('0x5a')]['id']}})['then'](handleEntityNotFound(_0x476602,null))[_0xa609('0x27')](removeEntity(_0x476602,null))[_0xa609('0x44')](handleError(_0x476602,null));};exports[_0xa609('0x5b')]=function(_0x4a8042,_0x10d571,_0x443eb5){var _0x1f6626={'raw':!![],'where':{}};var _0x264d9e={};var _0x10fd44={'count':0x0,'rows':[]};return db[_0xa609('0x40')][_0xa609('0x5c')]({'where':{'id':_0x4a8042['params']['id']}})[_0xa609('0x27')](handleEntityNotFound(_0x10d571,null))[_0xa609('0x27')](function(_0x251ace){if(_0x251ace){_0x264d9e[_0xa609('0x31')]=_[_0xa609('0x45')](db[_0xa609('0x5d')]['rawAttributes']);_0x264d9e[_0xa609('0x32')]=_[_0xa609('0x45')](_0x4a8042[_0xa609('0x32')]);_0x264d9e[_0xa609('0x3a')]=_[_0xa609('0x46')](_0x264d9e[_0xa609('0x31')],_0x264d9e[_0xa609('0x32')]);_0x1f6626[_0xa609('0x34')]=_[_0xa609('0x46')](_0x264d9e[_0xa609('0x31')],qs[_0xa609('0x33')](_0x4a8042[_0xa609('0x32')][_0xa609('0x33')]));_0x1f6626[_0xa609('0x34')]=_0x1f6626[_0xa609('0x34')][_0xa609('0x47')]?_0x1f6626[_0xa609('0x34')]:_0x264d9e[_0xa609('0x31')];if(!_0x4a8042[_0xa609('0x32')]['hasOwnProperty'](_0xa609('0x36'))){_0x1f6626[_0xa609('0x20')]=qs[_0xa609('0x20')](_0x4a8042['query'][_0xa609('0x20')]);_0x1f6626[_0xa609('0x1e')]=qs[_0xa609('0x1e')](_0x4a8042[_0xa609('0x32')]['offset']);}_0x1f6626[_0xa609('0x37')]=qs[_0xa609('0x38')](_0x4a8042[_0xa609('0x32')][_0xa609('0x38')]);_0x1f6626[_0xa609('0x39')]=qs[_0xa609('0x3a')](_[_0xa609('0x3b')](_0x4a8042[_0xa609('0x32')],_0x264d9e[_0xa609('0x3a')]));_0x1f6626[_0xa609('0x39')][_0xa609('0x5e')]=_0x251ace['id'];if(_0x4a8042['query']['filter']){_0x1f6626[_0xa609('0x39')]=_[_0xa609('0x3d')](_0x1f6626[_0xa609('0x39')],{'$or':_[_0xa609('0x2e')](_0x1f6626[_0xa609('0x34')],function(_0x10ecc9){var _0x454152={};_0x454152[_0x10ecc9]={'$like':'%'+_0x4a8042['query'][_0xa609('0x3c')]+'%'};return _0x454152;})});}_0x1f6626=_['merge']({},_0x1f6626,_0x4a8042[_0xa609('0x3f')]);return db['JscriptySessionReport'][_0xa609('0x21')]({'where':_0x1f6626[_0xa609('0x39')]})['then'](function(_0x595039){_0x10fd44[_0xa609('0x21')]=_0x595039;if(_0x4a8042[_0xa609('0x32')][_0xa609('0x41')]){_0x1f6626[_0xa609('0x48')]=[{'all':!![]}];}return db[_0xa609('0x5d')][_0xa609('0x42')](_0x1f6626);})[_0xa609('0x27')](function(_0x2f49a5){_0x10fd44[_0xa609('0x43')]=_0x2f49a5;return _0x10fd44;});}})[_0xa609('0x27')](respondWithFilteredResult(_0x10d571,_0x1f6626))[_0xa609('0x44')](handleError(_0x10d571,null));};exports[_0xa609('0x5f')]=function(_0x4d280b,_0x46ddcc,_0x558fa3){var _0x1e511e={'raw':!![],'where':{}};var _0x434afe={};var _0x155ac2={'count':0x0,'rows':[]};return db[_0xa609('0x40')][_0xa609('0x5c')]({'where':{'id':_0x4d280b['params']['id']}})[_0xa609('0x27')](handleEntityNotFound(_0x46ddcc,null))[_0xa609('0x27')](function(_0x768c15){if(_0x768c15){_0x434afe[_0xa609('0x31')]=_['keys'](db['JscriptyAnswerReport'][_0xa609('0x2f')]);_0x434afe[_0xa609('0x32')]=_[_0xa609('0x45')](_0x4d280b[_0xa609('0x32')]);_0x434afe[_0xa609('0x3a')]=_['intersection'](_0x434afe[_0xa609('0x31')],_0x434afe['query']);_0x1e511e[_0xa609('0x34')]=_['intersection'](_0x434afe[_0xa609('0x31')],qs[_0xa609('0x33')](_0x4d280b['query']['fields']));_0x1e511e[_0xa609('0x34')]=_0x1e511e['attributes'][_0xa609('0x47')]?_0x1e511e[_0xa609('0x34')]:_0x434afe['model'];if(!_0x4d280b[_0xa609('0x32')][_0xa609('0x35')](_0xa609('0x36'))){_0x1e511e['limit']=qs[_0xa609('0x20')](_0x4d280b['query'][_0xa609('0x20')]);_0x1e511e[_0xa609('0x1e')]=qs[_0xa609('0x1e')](_0x4d280b[_0xa609('0x32')][_0xa609('0x1e')]);}_0x1e511e[_0xa609('0x37')]=qs['sort'](_0x4d280b['query'][_0xa609('0x38')]);_0x1e511e['where']=qs[_0xa609('0x3a')](_['pick'](_0x4d280b[_0xa609('0x32')],_0x434afe[_0xa609('0x3a')]));_0x1e511e[_0xa609('0x39')][_0xa609('0x5e')]=_0x768c15['id'];if(_0x4d280b[_0xa609('0x32')][_0xa609('0x3c')]){_0x1e511e[_0xa609('0x39')]=_[_0xa609('0x3d')](_0x1e511e['where'],{'$or':_[_0xa609('0x2e')](_0x1e511e[_0xa609('0x34')],function(_0x3754f1){var _0x4ad33a={};_0x4ad33a[_0x3754f1]={'$like':'%'+_0x4d280b['query'][_0xa609('0x3c')]+'%'};return _0x4ad33a;})});}_0x1e511e=_[_0xa609('0x3d')]({},_0x1e511e,_0x4d280b['options']);return db[_0xa609('0x60')]['count']({'where':_0x1e511e[_0xa609('0x39')]})[_0xa609('0x27')](function(_0x158206){_0x155ac2[_0xa609('0x21')]=_0x158206;if(_0x4d280b[_0xa609('0x32')][_0xa609('0x41')]){_0x1e511e[_0xa609('0x48')]=[{'all':!![]}];}return db[_0xa609('0x60')]['findAll'](_0x1e511e);})['then'](function(_0x193f87){_0x155ac2['rows']=_0x193f87;return _0x155ac2;});}})['then'](respondWithFilteredResult(_0x46ddcc,_0x1e511e))[_0xa609('0x44')](handleError(_0x46ddcc,null));};function char(_0x58f131){return _0xa609('0x61')===typeof _0x58f131?String['fromCharCode']['apply'](null,arguments):_0x58f131;}function needsEncapsulation(_0x3748ca){return!!_0x3748ca&&(_0x3748ca[_0xa609('0x62')]()['indexOf'](char(0xd))>=0x0||_0x3748ca[_0xa609('0x62')]()[_0xa609('0x63')](char(0xa))>=0x0||_0x3748ca[_0xa609('0x62')]()[_0xa609('0x63')](char(0x2c))>=0x0||_0x3748ca[_0xa609('0x62')]()[_0xa609('0x63')](char(0x22))>=0x0);}function encapsulate(_0x51c8c5){var _0x1f18d0=char(0x22),_0x28cedf='\x5c'+char(0x22),_0xd84905=_0x51c8c5[_0xa609('0x62')]()[_0xa609('0x64')](new RegExp(_0x1f18d0,'g'),_0x28cedf);return _0x1f18d0+_0xd84905+_0x1f18d0;}exports[_0xa609('0x65')]=function(_0x1a25a8,_0x395a34,_0x42a782){var _0x4e3667,_0x569ad4;var _0x453d90={'where':{'ProjectId':_0x1a25a8['params']['id']}};if(_0x1a25a8[_0xa609('0x32')][_0xa609('0x66')]){_0x453d90[_0xa609('0x39')][_0xa609('0x67')]=JSON[_0xa609('0x68')](_0x1a25a8[_0xa609('0x32')][_0xa609('0x66')]);}return db[_0xa609('0x5d')][_0xa609('0x42')](_0x453d90)['then'](handleEntityNotFound(_0x395a34,null))[_0xa609('0x27')](function(_0x489ba2){if(_0x489ba2){_0x4e3667=_0x489ba2;return db[_0xa609('0x69')][_0xa609('0x42')]({'where':{'SessionId':{'$in':_['map'](_0x4e3667,'id')},'ProjectId':_0x1a25a8[_0xa609('0x5a')]['id']},'order':'-createdAt'});}})[_0xa609('0x27')](handleEntityNotFound(_0x395a34,null))[_0xa609('0x27')](function(_0x53af46){if(_0x53af46){_0x569ad4=_0x53af46;var _0x38d81d={};for(var _0x365ea4=0x0,_0x418d90=_0x569ad4[_0xa609('0x47')];_0x365ea4<_0x418d90;_0x365ea4++){if(!_0x38d81d[_0xa609('0x35')](_0x569ad4[_0x365ea4][_0xa609('0x6a')])){_0x38d81d[_0x569ad4[_0x365ea4][_0xa609('0x6a')]]=needsEncapsulation(_0x569ad4[_0x365ea4][_0xa609('0x6b')])?encapsulate(_0x569ad4[_0x365ea4]['question']):_0x569ad4[_0x365ea4][_0xa609('0x6b')];}}var _0x511198=[],_0x114332={};for(var _0x1960d3=0x0,_0x58f253=_0x4e3667[_0xa609('0x47')];_0x1960d3<_0x58f253;_0x1960d3++){_0x114332={'ProjectId':_0x1a25a8[_0xa609('0x5a')]['id'],'SessionId':_0x4e3667[_0x1960d3]['id'],'StartTime':moment(_0x4e3667[_0x1960d3][_0xa609('0x67')])[_0xa609('0x6c')](_0xa609('0x6d'))};for(var _0x2251dd=0x0,_0x5cd885=_0x569ad4[_0xa609('0x47')];_0x2251dd<_0x5cd885;_0x2251dd++){if(_0x569ad4[_0x2251dd][_0xa609('0x6e')]==_0x4e3667[_0x1960d3]['id']&&_0x38d81d['hasOwnProperty'](_0x569ad4[_0x2251dd][_0xa609('0x6a')])){_0x114332[_0x38d81d[_0x569ad4[_0x2251dd][_0xa609('0x6a')]]]=_0x569ad4[_0x2251dd][_0xa609('0x6f')];}}for(var _0xef903f in _0x38d81d){if(!_0x114332[_0xa609('0x35')](_0x38d81d[_0xef903f])){_0x114332[_0x38d81d[_0xef903f]]=null;}}_0x511198['push'](_0x114332);}return _0x511198;}})[_0xa609('0x27')](function(_0x5ec0c4){if(!_[_0xa609('0x70')](_0x5ec0c4)){var _0x1c9c12=toCsv(_0x5ec0c4);var _0x382121=Date[_0xa609('0x71')]();fs['writeFileSync'](util['format'](_0xa609('0x72'),_0x1a25a8[_0xa609('0x5a')]['id'],_0x382121),_0x1c9c12);_0x395a34['setHeader'](_0xa609('0x73'),_0xa609('0x74')+util[_0xa609('0x6c')](_0xa609('0x75'),_0x1a25a8['params']['id'],_0x382121));_0x395a34[_0xa609('0x76')](_0xa609('0x77'),_0xa609('0x78'));return _0x395a34[_0xa609('0x79')](util['format'](_0xa609('0x72'),_0x1a25a8[_0xa609('0x5a')]['id'],_0x382121));}else{return _0x395a34['sendStatus'](0xcc);}})[_0xa609('0x44')](handleError(_0x395a34,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 5862640..be2404f 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 _0x3fc6=['rimraf','../../config/environment','define','jscripty_projects','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5e1854,_0x48fb60){var _0x50eaee=function(_0x275807){while(--_0x275807){_0x5e1854['push'](_0x5e1854['shift']());}};_0x50eaee(++_0x48fb60);}(_0x3fc6,0x159));var _0x63fc=function(_0x22777f,_0x4a42a3){_0x22777f=_0x22777f-0x0;var _0x4d9a5f=_0x3fc6[_0x22777f];return _0x4d9a5f;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var logger=require(_0x63fc('0x2'))('api');var moment=require(_0x63fc('0x3'));var BPromise=require(_0x63fc('0x4'));var rp=require(_0x63fc('0x5'));var fs=require('fs');var path=require(_0x63fc('0x6'));var rimraf=require(_0x63fc('0x7'));var config=require(_0x63fc('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0xdb65b8,_0x7d24f){return _0xdb65b8[_0x63fc('0x9')]('JscriptyProject',attributes,{'tableName':_0x63fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x277c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','jscripty_projects','lodash','../../config/logger'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x277c,0x153));var _0xc277=function(_0x1fc275,_0x429095){_0x1fc275=_0x1fc275-0x0;var _0x3aa041=_0x277c[_0x1fc275];return _0x3aa041;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var logger=require(_0xc277('0x1'))(_0xc277('0x2'));var moment=require(_0xc277('0x3'));var BPromise=require(_0xc277('0x4'));var rp=require(_0xc277('0x5'));var fs=require('fs');var path=require(_0xc277('0x6'));var rimraf=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x1a6582,_0x5a4f03){return _0x1a6582[_0xc277('0x9')]('JscriptyProject',attributes,{'tableName':_0xc277('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 457f4a9..f631299 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x4e0a1e,_0x2b5027){var _0x46d0f9=function(_0x1624da){while(--_0x1624da){_0x4e0a1e['push'](_0x4e0a1e['shift']());}};_0x46d0f9(++_0x2b5027);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x60abfe,_0xc06aec){var _0x56d55f=function(_0x2220cb){while(--_0x2220cb){_0x60abfe['push'](_0x60abfe['shift']());}};_0x56d55f(++_0xc06aec);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 02c9886..80b6d39 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 _0xc0eb=['get','/describe','show','post','create','put','/:id','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0xb3645d,_0x12c299){var _0x29fa7d=function(_0x260159){while(--_0x260159){_0xb3645d['push'](_0xb3645d['shift']());}};_0x29fa7d(++_0x12c299);}(_0xc0eb,0x1d1));var _0xbc0e=function(_0x27153e,_0xe304d5){_0x27153e=_0x27153e-0x0;var _0x4b1254=_0xc0eb[_0x27153e];return _0x4b1254;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc0e('0x0'));var timeout=require(_0xbc0e('0x1'));var express=require(_0xbc0e('0x2'));var router=express[_0xbc0e('0x3')]();var fs_extra=require(_0xbc0e('0x4'));var auth=require(_0xbc0e('0x5'));var interaction=require(_0xbc0e('0x6'));var config=require(_0xbc0e('0x7'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0xbc0e('0x8')](),controller[_0xbc0e('0x9')]);router[_0xbc0e('0xa')](_0xbc0e('0xb'),auth[_0xbc0e('0x8')](),controller['describe']);router['get']('/:id',auth[_0xbc0e('0x8')](),controller[_0xbc0e('0xc')]);router[_0xbc0e('0xd')]('/',auth[_0xbc0e('0x8')](),controller[_0xbc0e('0xe')]);router[_0xbc0e('0xf')](_0xbc0e('0x10'),auth[_0xbc0e('0x8')](),controller[_0xbc0e('0x11')]);router['delete'](_0xbc0e('0x10'),auth['isAuthenticated'](),controller[_0xbc0e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7aa6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','path','express'];(function(_0xc18524,_0x5caaf1){var _0x52b1f7=function(_0x32953f){while(--_0x32953f){_0xc18524['push'](_0xc18524['shift']());}};_0x52b1f7(++_0x5caaf1);}(_0x7aa6,0x10e));var _0x67aa=function(_0x278915,_0x3d7842){_0x278915=_0x278915-0x0;var _0x1f10fd=_0x7aa6[_0x278915];return _0x1f10fd;};'use strict';var multer=require(_0x67aa('0x0'));var util=require('util');var path=require(_0x67aa('0x1'));var timeout=require('connect-timeout');var express=require(_0x67aa('0x2'));var router=express[_0x67aa('0x3')]();var fs_extra=require(_0x67aa('0x4'));var auth=require(_0x67aa('0x5'));var interaction=require(_0x67aa('0x6'));var config=require(_0x67aa('0x7'));var controller=require(_0x67aa('0x8'));router[_0x67aa('0x9')]('/',auth[_0x67aa('0xa')](),controller[_0x67aa('0xb')]);router[_0x67aa('0x9')](_0x67aa('0xc'),auth[_0x67aa('0xa')](),controller[_0x67aa('0xd')]);router['get'](_0x67aa('0xe'),auth[_0x67aa('0xa')](),controller[_0x67aa('0xf')]);router[_0x67aa('0x10')]('/',auth[_0x67aa('0xa')](),controller[_0x67aa('0x11')]);router[_0x67aa('0x12')](_0x67aa('0xe'),auth[_0x67aa('0xa')](),controller[_0x67aa('0x13')]);router['delete'](_0x67aa('0xe'),auth['isAuthenticated'](),controller[_0x67aa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 70a6e09..298bdd0 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0xb67db0,_0xed84f9){_0xb67db0=_0xb67db0-0x0;var _0x12c79c=_0x7a54[_0xb67db0];return _0x12c79c;};'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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x27cb46,_0x5eacaa){_0x27cb46=_0x27cb46-0x0;var _0x3a3f70=_0x7a54[_0x27cb46];return _0x3a3f70;};'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 0bbb968..e94cac1 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 _0xe5fb=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','JscriptyQuestionReport','then','includeAll','rows','catch','params','keys','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model'];(function(_0x1fa8bb,_0x4a9d15){var _0x3d8515=function(_0x5010dd){while(--_0x5010dd){_0x1fa8bb['push'](_0x1fa8bb['shift']());}};_0x3d8515(++_0x4a9d15);}(_0xe5fb,0x183));var _0xbe5f=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0xe5fb[_0x55cc58];return _0x26062e;};'use strict';var emlformat=require(_0xbe5f('0x0'));var rimraf=require(_0xbe5f('0x1'));var zipdir=require(_0xbe5f('0x2'));var jsonpatch=require(_0xbe5f('0x3'));var rp=require(_0xbe5f('0x4'));var moment=require('moment');var BPromise=require(_0xbe5f('0x5'));var Mustache=require(_0xbe5f('0x6'));var util=require('util');var path=require(_0xbe5f('0x7'));var sox=require(_0xbe5f('0x8'));var csv=require(_0xbe5f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe5f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbe5f('0xb'));var deskjs=require(_0xbe5f('0xc'));var toCsv=require(_0xbe5f('0x9'));var querystring=require(_0xbe5f('0xd'));var Papa=require('papaparse');var Redis=require(_0xbe5f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbe5f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe5f('0x10'))(_0xbe5f('0x11'));var utils=require(_0xbe5f('0x12'));var config=require(_0xbe5f('0x13'));var licenseUtil=require(_0xbe5f('0x14'));var db=require(_0xbe5f('0x15'))['db'];function respondWithStatusCode(_0x453d11,_0x3dce5e){_0x3dce5e=_0x3dce5e||0xcc;return function(_0x565753){if(_0x565753){return _0x453d11[_0xbe5f('0x16')](_0x3dce5e);}return _0x453d11[_0xbe5f('0x17')](_0x3dce5e)[_0xbe5f('0x18')]();};}function respondWithResult(_0x4821bc,_0xefa25d){_0xefa25d=_0xefa25d||0xc8;return function(_0x55f40b){if(_0x55f40b){return _0x4821bc[_0xbe5f('0x17')](_0xefa25d)[_0xbe5f('0x19')](_0x55f40b);}};}function respondWithFilteredResult(_0x87b9f2,_0x2edf8c){return function(_0x3cfe71){if(_0x3cfe71){var _0x12235e=typeof _0x2edf8c[_0xbe5f('0x1a')]===_0xbe5f('0x1b')&&typeof _0x2edf8c[_0xbe5f('0x1c')]===_0xbe5f('0x1b');var _0x5395bf=_0x3cfe71[_0xbe5f('0x1d')];var _0x8d4d79=_0x12235e?0x0:_0x2edf8c[_0xbe5f('0x1a')];var _0x55cd74=_0x12235e?_0x3cfe71[_0xbe5f('0x1d')]:_0x2edf8c[_0xbe5f('0x1a')]+_0x2edf8c[_0xbe5f('0x1c')];var _0x8fb33d;if(_0x55cd74>=_0x5395bf){_0x55cd74=_0x5395bf;_0x8fb33d=0xc8;}else{_0x8fb33d=0xce;}_0x87b9f2[_0xbe5f('0x17')](_0x8fb33d);return _0x87b9f2[_0xbe5f('0x1e')]('Content-Range',_0x8d4d79+'-'+_0x55cd74+'/'+_0x5395bf)[_0xbe5f('0x19')](_0x3cfe71);}return null;};}function patchUpdates(_0x252974){return function(_0x120c72){try{jsonpatch[_0xbe5f('0x1f')](_0x120c72,_0x252974,!![]);}catch(_0x3517ea){return BPromise[_0xbe5f('0x20')](_0x3517ea);}return _0x120c72[_0xbe5f('0x21')]();};}function saveUpdates(_0x2227a4,_0x5431e0){return function(_0x33a052){if(_0x33a052){return _0x33a052[_0xbe5f('0x22')](_0x2227a4)['then'](function(_0x4121b4){return _0x4121b4;});}return null;};}function removeEntity(_0x57cb6b,_0x10c913){return function(_0x11eb56){if(_0x11eb56){return _0x11eb56[_0xbe5f('0x23')]()['then'](function(){_0x57cb6b[_0xbe5f('0x17')](0xcc)[_0xbe5f('0x18')]();});}};}function handleEntityNotFound(_0x2533db,_0x377e5d){return function(_0x59dc07){if(!_0x59dc07){_0x2533db['sendStatus'](0x194);}return _0x59dc07;};}function handleError(_0x4fbf3d,_0x391131){_0x391131=_0x391131||0x1f4;return function(_0x314d46){logger['error'](_0x314d46[_0xbe5f('0x24')]);if(_0x314d46[_0xbe5f('0x25')]){delete _0x314d46[_0xbe5f('0x25')];}_0x4fbf3d[_0xbe5f('0x17')](_0x391131)[_0xbe5f('0x26')](_0x314d46);};}exports[_0xbe5f('0x27')]=function(_0x5aafd8,_0x2fc349){var _0x565f3a={},_0x202cfd={},_0x970fd={'count':0x0,'rows':[]};var _0x4b39d3=_[_0xbe5f('0x28')](db['JscriptyQuestionReport'][_0xbe5f('0x29')],function(_0x3a9eea){return{'name':_0x3a9eea[_0xbe5f('0x2a')],'type':_0x3a9eea['type'][_0xbe5f('0x2b')]};});_0x202cfd[_0xbe5f('0x2c')]=_[_0xbe5f('0x28')](_0x4b39d3,'name');_0x202cfd[_0xbe5f('0x2d')]=_['keys'](_0x5aafd8[_0xbe5f('0x2d')]);_0x202cfd[_0xbe5f('0x2e')]=_[_0xbe5f('0x2f')](_0x202cfd[_0xbe5f('0x2c')],_0x202cfd['query']);_0x565f3a[_0xbe5f('0x30')]=_[_0xbe5f('0x2f')](_0x202cfd[_0xbe5f('0x2c')],qs[_0xbe5f('0x31')](_0x5aafd8[_0xbe5f('0x2d')][_0xbe5f('0x31')]));_0x565f3a[_0xbe5f('0x30')]=_0x565f3a[_0xbe5f('0x30')][_0xbe5f('0x32')]?_0x565f3a['attributes']:_0x202cfd[_0xbe5f('0x2c')];if(!_0x5aafd8['query'][_0xbe5f('0x33')](_0xbe5f('0x34'))){_0x565f3a[_0xbe5f('0x1c')]=qs[_0xbe5f('0x1c')](_0x5aafd8[_0xbe5f('0x2d')][_0xbe5f('0x1c')]);_0x565f3a[_0xbe5f('0x1a')]=qs[_0xbe5f('0x1a')](_0x5aafd8['query'][_0xbe5f('0x1a')]);}_0x565f3a[_0xbe5f('0x35')]=qs[_0xbe5f('0x36')](_0x5aafd8[_0xbe5f('0x2d')]['sort']);_0x565f3a[_0xbe5f('0x37')]=qs[_0xbe5f('0x2e')](_['pick'](_0x5aafd8[_0xbe5f('0x2d')],_0x202cfd[_0xbe5f('0x2e')]),_0x4b39d3);if(_0x5aafd8[_0xbe5f('0x2d')][_0xbe5f('0x38')]){_0x565f3a[_0xbe5f('0x37')]=_[_0xbe5f('0x39')](_0x565f3a[_0xbe5f('0x37')],{'$or':_[_0xbe5f('0x28')](_0x4b39d3,function(_0x57f4e8){if(_0x57f4e8[_0xbe5f('0x3a')]!==_0xbe5f('0x3b')){var _0x155760={};_0x155760[_0x57f4e8['name']]={'$like':'%'+_0x5aafd8[_0xbe5f('0x2d')][_0xbe5f('0x38')]+'%'};return _0x155760;}})});}_0x565f3a=_[_0xbe5f('0x39')]({},_0x565f3a,_0x5aafd8[_0xbe5f('0x3c')]);var _0x3b442e={'where':_0x565f3a['where']};return db[_0xbe5f('0x3d')][_0xbe5f('0x1d')](_0x3b442e)[_0xbe5f('0x3e')](function(_0x1d1962){_0x970fd[_0xbe5f('0x1d')]=_0x1d1962;if(_0x5aafd8['query'][_0xbe5f('0x3f')]){_0x565f3a['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x565f3a);})[_0xbe5f('0x3e')](function(_0x595f27){_0x970fd[_0xbe5f('0x40')]=_0x595f27;return _0x970fd;})[_0xbe5f('0x3e')](respondWithFilteredResult(_0x2fc349,_0x565f3a))[_0xbe5f('0x41')](handleError(_0x2fc349,null));};exports['show']=function(_0x1145b2,_0x592e54){var _0x1e307d={'raw':!![],'where':{'id':_0x1145b2[_0xbe5f('0x42')]['id']}},_0x500822={};_0x500822[_0xbe5f('0x2c')]=_[_0xbe5f('0x43')](db['JscriptyQuestionReport'][_0xbe5f('0x29')]);_0x500822[_0xbe5f('0x2d')]=_[_0xbe5f('0x43')](_0x1145b2[_0xbe5f('0x2d')]);_0x500822[_0xbe5f('0x2e')]=_[_0xbe5f('0x2f')](_0x500822[_0xbe5f('0x2c')],_0x500822[_0xbe5f('0x2d')]);_0x1e307d[_0xbe5f('0x30')]=_['intersection'](_0x500822['model'],qs['fields'](_0x1145b2['query'][_0xbe5f('0x31')]));_0x1e307d[_0xbe5f('0x30')]=_0x1e307d['attributes'][_0xbe5f('0x32')]?_0x1e307d[_0xbe5f('0x30')]:_0x500822[_0xbe5f('0x2c')];if(_0x1145b2[_0xbe5f('0x2d')][_0xbe5f('0x3f')]){_0x1e307d[_0xbe5f('0x44')]=[{'all':!![]}];}_0x1e307d=_[_0xbe5f('0x39')]({},_0x1e307d,_0x1145b2['options']);return db['JscriptyQuestionReport']['find'](_0x1e307d)['then'](handleEntityNotFound(_0x592e54,null))[_0xbe5f('0x3e')](respondWithResult(_0x592e54,null))[_0xbe5f('0x41')](handleError(_0x592e54,null));};exports[_0xbe5f('0x45')]=function(_0x5c892f,_0x46b802){return db[_0xbe5f('0x3d')]['create'](_0x5c892f[_0xbe5f('0x46')],{})[_0xbe5f('0x3e')](respondWithResult(_0x46b802,0xc9))[_0xbe5f('0x41')](handleError(_0x46b802,null));};exports[_0xbe5f('0x22')]=function(_0x468feb,_0x4b5b5e){if(_0x468feb[_0xbe5f('0x46')]['id']){delete _0x468feb[_0xbe5f('0x46')]['id'];}return db[_0xbe5f('0x3d')][_0xbe5f('0x47')]({'where':{'id':_0x468feb[_0xbe5f('0x42')]['id']}})['then'](handleEntityNotFound(_0x4b5b5e,null))[_0xbe5f('0x3e')](saveUpdates(_0x468feb['body'],null))[_0xbe5f('0x3e')](respondWithResult(_0x4b5b5e,null))[_0xbe5f('0x41')](handleError(_0x4b5b5e,null));};exports[_0xbe5f('0x23')]=function(_0x282bf6,_0x261e07){return db[_0xbe5f('0x3d')][_0xbe5f('0x47')]({'where':{'id':_0x282bf6[_0xbe5f('0x42')]['id']}})['then'](handleEntityNotFound(_0x261e07,null))[_0xbe5f('0x3e')](removeEntity(_0x261e07,null))[_0xbe5f('0x41')](handleError(_0x261e07,null));};exports['describe']=function(_0x1edf3a,_0x444ba1){return db[_0xbe5f('0x3d')]['describe']()[_0xbe5f('0x3e')](respondWithResult(_0x444ba1,null))[_0xbe5f('0x41')](handleError(_0x444ba1,null));}; \ No newline at end of file +var _0x5c8e=['status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3fb518,_0x37e67d){var _0x42a12a=function(_0x254cc3){while(--_0x254cc3){_0x3fb518['push'](_0x3fb518['shift']());}};_0x42a12a(++_0x37e67d);}(_0x5c8e,0x7b));var _0xe5c8=function(_0x206ec2,_0xb922d0){_0x206ec2=_0x206ec2-0x0;var _0x3df610=_0x5c8e[_0x206ec2];return _0x3df610;};'use strict';var emlformat=require(_0xe5c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5c8('0x1'));var jsonpatch=require(_0xe5c8('0x2'));var rp=require(_0xe5c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe5c8('0x4'));var path=require('path');var sox=require(_0xe5c8('0x5'));var csv=require(_0xe5c8('0x6'));var ejs=require(_0xe5c8('0x7'));var fs=require('fs');var fs_extra=require(_0xe5c8('0x8'));var _=require(_0xe5c8('0x9'));var squel=require(_0xe5c8('0xa'));var crypto=require(_0xe5c8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe5c8('0xc'));var Papa=require(_0xe5c8('0xd'));var Redis=require(_0xe5c8('0xe'));var authService=require(_0xe5c8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe5c8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe5c8('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xe5c8('0x12'));var db=require(_0xe5c8('0x13'))['db'];function respondWithStatusCode(_0x5d101f,_0x426a4d){_0x426a4d=_0x426a4d||0xcc;return function(_0x26d718){if(_0x26d718){return _0x5d101f[_0xe5c8('0x14')](_0x426a4d);}return _0x5d101f[_0xe5c8('0x15')](_0x426a4d)[_0xe5c8('0x16')]();};}function respondWithResult(_0xde47c9,_0x1e7d74){_0x1e7d74=_0x1e7d74||0xc8;return function(_0x515d08){if(_0x515d08){return _0xde47c9[_0xe5c8('0x15')](_0x1e7d74)['json'](_0x515d08);}};}function respondWithFilteredResult(_0x854d69,_0x578210){return function(_0x408d12){if(_0x408d12){var _0x4442d4=typeof _0x578210[_0xe5c8('0x17')]===_0xe5c8('0x18')&&typeof _0x578210[_0xe5c8('0x19')]===_0xe5c8('0x18');var _0x15353e=_0x408d12['count'];var _0x28d50b=_0x4442d4?0x0:_0x578210[_0xe5c8('0x17')];var _0x177a27=_0x4442d4?_0x408d12[_0xe5c8('0x1a')]:_0x578210[_0xe5c8('0x17')]+_0x578210[_0xe5c8('0x19')];var _0x5b4811;if(_0x177a27>=_0x15353e){_0x177a27=_0x15353e;_0x5b4811=0xc8;}else{_0x5b4811=0xce;}_0x854d69[_0xe5c8('0x15')](_0x5b4811);return _0x854d69[_0xe5c8('0x1b')](_0xe5c8('0x1c'),_0x28d50b+'-'+_0x177a27+'/'+_0x15353e)['json'](_0x408d12);}return null;};}function patchUpdates(_0x9de2ba){return function(_0x95b2df){try{jsonpatch[_0xe5c8('0x1d')](_0x95b2df,_0x9de2ba,!![]);}catch(_0x5d3c18){return BPromise[_0xe5c8('0x1e')](_0x5d3c18);}return _0x95b2df[_0xe5c8('0x1f')]();};}function saveUpdates(_0x593c56,_0x43d1d1){return function(_0x56ad66){if(_0x56ad66){return _0x56ad66[_0xe5c8('0x20')](_0x593c56)[_0xe5c8('0x21')](function(_0x1c8ddd){return _0x1c8ddd;});}return null;};}function removeEntity(_0x1d1686,_0x4fc248){return function(_0xeea1e){if(_0xeea1e){return _0xeea1e[_0xe5c8('0x22')]()[_0xe5c8('0x21')](function(){_0x1d1686[_0xe5c8('0x15')](0xcc)[_0xe5c8('0x16')]();});}};}function handleEntityNotFound(_0x6f3048,_0x22aab0){return function(_0x220c5c){if(!_0x220c5c){_0x6f3048[_0xe5c8('0x14')](0x194);}return _0x220c5c;};}function handleError(_0x1c4e96,_0x18fe65){_0x18fe65=_0x18fe65||0x1f4;return function(_0xfa1fc9){logger[_0xe5c8('0x23')](_0xfa1fc9[_0xe5c8('0x24')]);if(_0xfa1fc9['name']){delete _0xfa1fc9[_0xe5c8('0x25')];}_0x1c4e96[_0xe5c8('0x15')](_0x18fe65)['send'](_0xfa1fc9);};}exports[_0xe5c8('0x26')]=function(_0x214b7c,_0x4738a1){var _0x598e46={},_0x3487ed={},_0xaa191b={'count':0x0,'rows':[]};var _0xc0502d=_[_0xe5c8('0x27')](db[_0xe5c8('0x28')][_0xe5c8('0x29')],function(_0x2d6c4c){return{'name':_0x2d6c4c[_0xe5c8('0x2a')],'type':_0x2d6c4c['type']['key']};});_0x3487ed['model']=_[_0xe5c8('0x27')](_0xc0502d,'name');_0x3487ed[_0xe5c8('0x2b')]=_['keys'](_0x214b7c[_0xe5c8('0x2b')]);_0x3487ed[_0xe5c8('0x2c')]=_[_0xe5c8('0x2d')](_0x3487ed[_0xe5c8('0x2e')],_0x3487ed[_0xe5c8('0x2b')]);_0x598e46[_0xe5c8('0x2f')]=_[_0xe5c8('0x2d')](_0x3487ed[_0xe5c8('0x2e')],qs['fields'](_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x30')]));_0x598e46[_0xe5c8('0x2f')]=_0x598e46['attributes'][_0xe5c8('0x31')]?_0x598e46[_0xe5c8('0x2f')]:_0x3487ed[_0xe5c8('0x2e')];if(!_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x32')]('nolimit')){_0x598e46[_0xe5c8('0x19')]=qs[_0xe5c8('0x19')](_0x214b7c[_0xe5c8('0x2b')]['limit']);_0x598e46['offset']=qs['offset'](_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x17')]);}_0x598e46[_0xe5c8('0x33')]=qs[_0xe5c8('0x34')](_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x34')]);_0x598e46['where']=qs[_0xe5c8('0x2c')](_[_0xe5c8('0x35')](_0x214b7c[_0xe5c8('0x2b')],_0x3487ed[_0xe5c8('0x2c')]),_0xc0502d);if(_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x36')]){_0x598e46[_0xe5c8('0x37')]=_[_0xe5c8('0x38')](_0x598e46[_0xe5c8('0x37')],{'$or':_[_0xe5c8('0x27')](_0xc0502d,function(_0x308050){if(_0x308050[_0xe5c8('0x39')]!==_0xe5c8('0x3a')){var _0x153169={};_0x153169[_0x308050[_0xe5c8('0x25')]]={'$like':'%'+_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x36')]+'%'};return _0x153169;}})});}_0x598e46=_['merge']({},_0x598e46,_0x214b7c[_0xe5c8('0x3b')]);var _0x74d020={'where':_0x598e46['where']};return db[_0xe5c8('0x28')][_0xe5c8('0x1a')](_0x74d020)[_0xe5c8('0x21')](function(_0x2e88b2){_0xaa191b[_0xe5c8('0x1a')]=_0x2e88b2;if(_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x3c')]){_0x598e46[_0xe5c8('0x3d')]=[{'all':!![]}];}return db[_0xe5c8('0x28')][_0xe5c8('0x3e')](_0x598e46);})['then'](function(_0x540935){_0xaa191b[_0xe5c8('0x3f')]=_0x540935;return _0xaa191b;})['then'](respondWithFilteredResult(_0x4738a1,_0x598e46))[_0xe5c8('0x40')](handleError(_0x4738a1,null));};exports[_0xe5c8('0x41')]=function(_0x43240d,_0x470692){var _0x75c3f9={'raw':!![],'where':{'id':_0x43240d[_0xe5c8('0x42')]['id']}},_0x225ad7={};_0x225ad7['model']=_[_0xe5c8('0x43')](db[_0xe5c8('0x28')][_0xe5c8('0x29')]);_0x225ad7['query']=_[_0xe5c8('0x43')](_0x43240d[_0xe5c8('0x2b')]);_0x225ad7[_0xe5c8('0x2c')]=_[_0xe5c8('0x2d')](_0x225ad7[_0xe5c8('0x2e')],_0x225ad7[_0xe5c8('0x2b')]);_0x75c3f9[_0xe5c8('0x2f')]=_[_0xe5c8('0x2d')](_0x225ad7[_0xe5c8('0x2e')],qs[_0xe5c8('0x30')](_0x43240d[_0xe5c8('0x2b')][_0xe5c8('0x30')]));_0x75c3f9[_0xe5c8('0x2f')]=_0x75c3f9[_0xe5c8('0x2f')]['length']?_0x75c3f9[_0xe5c8('0x2f')]:_0x225ad7[_0xe5c8('0x2e')];if(_0x43240d[_0xe5c8('0x2b')][_0xe5c8('0x3c')]){_0x75c3f9[_0xe5c8('0x3d')]=[{'all':!![]}];}_0x75c3f9=_['merge']({},_0x75c3f9,_0x43240d[_0xe5c8('0x3b')]);return db['JscriptyQuestionReport'][_0xe5c8('0x44')](_0x75c3f9)['then'](handleEntityNotFound(_0x470692,null))[_0xe5c8('0x21')](respondWithResult(_0x470692,null))[_0xe5c8('0x40')](handleError(_0x470692,null));};exports['create']=function(_0x18ef93,_0x97308f){return db[_0xe5c8('0x28')][_0xe5c8('0x45')](_0x18ef93['body'],{})[_0xe5c8('0x21')](respondWithResult(_0x97308f,0xc9))[_0xe5c8('0x40')](handleError(_0x97308f,null));};exports['update']=function(_0x3dddab,_0x5c2d23){if(_0x3dddab[_0xe5c8('0x46')]['id']){delete _0x3dddab[_0xe5c8('0x46')]['id'];}return db[_0xe5c8('0x28')][_0xe5c8('0x44')]({'where':{'id':_0x3dddab['params']['id']}})[_0xe5c8('0x21')](handleEntityNotFound(_0x5c2d23,null))[_0xe5c8('0x21')](saveUpdates(_0x3dddab['body'],null))[_0xe5c8('0x21')](respondWithResult(_0x5c2d23,null))['catch'](handleError(_0x5c2d23,null));};exports[_0xe5c8('0x22')]=function(_0x46510d,_0x43600e){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x46510d[_0xe5c8('0x42')]['id']}})[_0xe5c8('0x21')](handleEntityNotFound(_0x43600e,null))[_0xe5c8('0x21')](removeEntity(_0x43600e,null))[_0xe5c8('0x40')](handleError(_0x43600e,null));};exports[_0xe5c8('0x47')]=function(_0x1d8e90,_0x3ba059){return db[_0xe5c8('0x28')][_0xe5c8('0x47')]()[_0xe5c8('0x21')](respondWithResult(_0x3ba059,null))[_0xe5c8('0x40')](handleError(_0x3ba059,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 2e0235f..f834c37 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 _0xa8c1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_jscripty_questions','util'];(function(_0x4c7d79,_0xa1ebef){var _0x4644ac=function(_0x5af985){while(--_0x5af985){_0x4c7d79['push'](_0x4c7d79['shift']());}};_0x4644ac(++_0xa1ebef);}(_0xa8c1,0xd7));var _0x1a8c=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0xa8c1[_0x2797c6];return _0x54809f;};'use strict';var _=require('lodash');var util=require(_0x1a8c('0x0'));var logger=require(_0x1a8c('0x1'))(_0x1a8c('0x2'));var moment=require(_0x1a8c('0x3'));var BPromise=require(_0x1a8c('0x4'));var rp=require(_0x1a8c('0x5'));var fs=require('fs');var path=require(_0x1a8c('0x6'));var rimraf=require(_0x1a8c('0x7'));var config=require(_0x1a8c('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x1a8c('0x9')]=function(_0x4b15cc,_0x3c6af8){return _0x4b15cc[_0x1a8c('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x1a8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c9a=['path','rimraf','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','moment','request-promise'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x5c9a,0x87));var _0xa5c9=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x5c9a[_0x5678b5];return _0x4c09a5;};'use strict';var _=require(_0xa5c9('0x0'));var util=require(_0xa5c9('0x1'));var logger=require(_0xa5c9('0x2'))('api');var moment=require(_0xa5c9('0x3'));var BPromise=require('bluebird');var rp=require(_0xa5c9('0x4'));var fs=require('fs');var path=require(_0xa5c9('0x5'));var rimraf=require(_0xa5c9('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0xa5c9('0x7')]=function(_0x34d58a,_0x57684a){return _0x34d58a['define'](_0xa5c9('0x8'),attributes,{'tableName':_0xa5c9('0x9'),'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 1aeb905..b23a8eb 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 _0x0158=['util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x5df39a,_0x11ddd0){var _0x4e9b10=function(_0x3636cd){while(--_0x3636cd){_0x5df39a['push'](_0x5df39a['shift']());}};_0x4e9b10(++_0x11ddd0);}(_0x0158,0x11d));var _0x8015=function(_0x1aca2d,_0xca94d2){_0x1aca2d=_0x1aca2d-0x0;var _0x3f8b55=_0x0158[_0x1aca2d];return _0x3f8b55;};'use strict';var _=require('lodash');var util=require(_0x8015('0x0'));var moment=require(_0x8015('0x1'));var BPromise=require('bluebird');var rs=require(_0x8015('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8015('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8015('0x4'))(_0x8015('0x5'));var config=require(_0x8015('0x6'));var jayson=require(_0x8015('0x7'));var client=jayson[_0x8015('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6890a2,_0x3479b6,_0x47cbc1){return new BPromise(function(_0x218441,_0x420d68){return client['request'](_0x6890a2,_0x47cbc1)[_0x8015('0x9')](function(_0x4b5baa){logger[_0x8015('0xa')](_0x8015('0xb'),_0x3479b6,_0x8015('0xc'));logger['debug'](_0x8015('0xd'),_0x3479b6,_0x8015('0xc'),JSON[_0x8015('0xe')](_0x4b5baa));if(_0x4b5baa[_0x8015('0xf')]){if(_0x4b5baa[_0x8015('0xf')]['code']===0x1f4){logger['error'](_0x8015('0xb'),_0x3479b6,_0x4b5baa[_0x8015('0xf')][_0x8015('0x10')]);return _0x420d68(_0x4b5baa[_0x8015('0xf')][_0x8015('0x10')]);}logger[_0x8015('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3479b6,_0x4b5baa[_0x8015('0xf')][_0x8015('0x10')]);return _0x218441(_0x4b5baa[_0x8015('0xf')]['message']);}else{logger[_0x8015('0xa')](_0x8015('0xb'),_0x3479b6,'request\x20sent');_0x218441(_0x4b5baa[_0x8015('0x11')][_0x8015('0x10')]);}})[_0x8015('0x12')](function(_0x1415a7){logger[_0x8015('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3479b6,_0x1415a7);_0x420d68(_0x1415a7);});});} \ No newline at end of file +var _0x5992=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x582244,_0x33f08b){var _0x81f9e4=function(_0x1f63f8){while(--_0x1f63f8){_0x582244['push'](_0x582244['shift']());}};_0x81f9e4(++_0x33f08b);}(_0x5992,0xbf));var _0x2599=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5992[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x2599('0x0'));var util=require(_0x2599('0x1'));var moment=require(_0x2599('0x2'));var BPromise=require(_0x2599('0x3'));var rs=require(_0x2599('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2599('0x5'))['db'];var utils=require(_0x2599('0x6'));var logger=require(_0x2599('0x7'))(_0x2599('0x8'));var config=require(_0x2599('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2599('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14f551,_0x324de8,_0x29bf0c){return new BPromise(function(_0x2cf30c,_0x50a700){return client[_0x2599('0xb')](_0x14f551,_0x29bf0c)[_0x2599('0xc')](function(_0x39bd26){logger[_0x2599('0xd')](_0x2599('0xe'),_0x324de8,'request\x20sent');logger[_0x2599('0xf')](_0x2599('0x10'),_0x324de8,_0x2599('0x11'),JSON[_0x2599('0x12')](_0x39bd26));if(_0x39bd26[_0x2599('0x13')]){if(_0x39bd26[_0x2599('0x13')][_0x2599('0x14')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x324de8,_0x39bd26[_0x2599('0x13')]['message']);return _0x50a700(_0x39bd26['error']['message']);}logger[_0x2599('0x13')](_0x2599('0xe'),_0x324de8,_0x39bd26[_0x2599('0x13')][_0x2599('0x15')]);return _0x2cf30c(_0x39bd26[_0x2599('0x13')][_0x2599('0x15')]);}else{logger[_0x2599('0xd')](_0x2599('0xe'),_0x324de8,_0x2599('0x11'));_0x2cf30c(_0x39bd26[_0x2599('0x16')][_0x2599('0x15')]);}})[_0x2599('0x17')](function(_0x50f400){logger[_0x2599('0x13')](_0x2599('0xe'),_0x324de8,_0x50f400);_0x50a700(_0x50f400);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 7b6fd97..a8d6834 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 _0x8f70=['index','/describe','describe','/:id','show','getQuestions','post','create','update','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated'];(function(_0x327b49,_0xc232b8){var _0x4e7265=function(_0x4e99c1){while(--_0x4e99c1){_0x327b49['push'](_0x327b49['shift']());}};_0x4e7265(++_0xc232b8);}(_0x8f70,0x19a));var _0x08f7=function(_0x346b2c,_0x1f8698){_0x346b2c=_0x346b2c-0x0;var _0x14165b=_0x8f70[_0x346b2c];return _0x14165b;};'use strict';var multer=require('multer');var util=require(_0x08f7('0x0'));var path=require(_0x08f7('0x1'));var timeout=require(_0x08f7('0x2'));var express=require(_0x08f7('0x3'));var router=express[_0x08f7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x08f7('0x5'));var controller=require('./jscriptySessionReport.controller');router[_0x08f7('0x6')]('/',auth[_0x08f7('0x7')](),controller[_0x08f7('0x8')]);router[_0x08f7('0x6')](_0x08f7('0x9'),auth['isAuthenticated'](),controller[_0x08f7('0xa')]);router[_0x08f7('0x6')](_0x08f7('0xb'),auth[_0x08f7('0x7')](),controller[_0x08f7('0xc')]);router[_0x08f7('0x6')]('/:id/questions',auth[_0x08f7('0x7')](),controller[_0x08f7('0xd')]);router[_0x08f7('0xe')]('/',auth[_0x08f7('0x7')](),controller[_0x08f7('0xf')]);router['put'](_0x08f7('0xb'),auth['isAuthenticated'](),controller[_0x08f7('0x10')]);router['delete'](_0x08f7('0xb'),auth[_0x08f7('0x7')](),controller[_0x08f7('0x11')]);module[_0x08f7('0x12')]=router; \ No newline at end of file +var _0xca98=['../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','update','destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xca98,0x1b4));var _0x8ca9=function(_0x594ece,_0x2a1f27){_0x594ece=_0x594ece-0x0;var _0x471bc4=_0xca98[_0x594ece];return _0x471bc4;};'use strict';var multer=require('multer');var util=require(_0x8ca9('0x0'));var path=require('path');var timeout=require(_0x8ca9('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8ca9('0x2'));var auth=require(_0x8ca9('0x3'));var interaction=require(_0x8ca9('0x4'));var config=require(_0x8ca9('0x5'));var controller=require(_0x8ca9('0x6'));router[_0x8ca9('0x7')]('/',auth[_0x8ca9('0x8')](),controller['index']);router[_0x8ca9('0x7')](_0x8ca9('0x9'),auth['isAuthenticated'](),controller[_0x8ca9('0xa')]);router[_0x8ca9('0x7')](_0x8ca9('0xb'),auth[_0x8ca9('0x8')](),controller[_0x8ca9('0xc')]);router['get'](_0x8ca9('0xd'),auth[_0x8ca9('0x8')](),controller[_0x8ca9('0xe')]);router[_0x8ca9('0xf')]('/',auth[_0x8ca9('0x8')](),controller[_0x8ca9('0x10')]);router['put'](_0x8ca9('0xb'),auth[_0x8ca9('0x8')](),controller[_0x8ca9('0x11')]);router['delete'](_0x8ca9('0xb'),auth[_0x8ca9('0x8')](),controller[_0x8ca9('0x12')]);module[_0x8ca9('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 81bbd56..082ae6f 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 _0x1509=['setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x2ccae6,_0x3a29a6){var _0x3fbfed=function(_0x5a3541){while(--_0x5a3541){_0x2ccae6['push'](_0x2ccae6['shift']());}};_0x3fbfed(++_0x3a29a6);}(_0x1509,0x15c));var _0x9150=function(_0x5d6d5a,_0xc8a56c){_0x5d6d5a=_0x5d6d5a-0x0;var _0x1452c1=_0x1509[_0x5d6d5a];return _0x1452c1;};'use strict';var moment=require(_0x9150('0x0'));var Sequelize=require(_0x9150('0x1'));module[_0x9150('0x2')]={'starttime':{'type':Sequelize[_0x9150('0x3')],'set':function(_0x5ba6b3){this[_0x9150('0x4')](_0x9150('0x5'),_0x5ba6b3);this[_0x9150('0x4')](_0x9150('0x6'),moment()[_0x9150('0x7')](_0x9150('0x8')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x9150('0x9')]},'projectname':{'type':Sequelize[_0x9150('0x9')]},'queue':{'type':Sequelize[_0x9150('0x9')]},'uniqueid':{'type':Sequelize[_0x9150('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9150('0x9')]},'completed':{'type':Sequelize[_0x9150('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0xacfd=['STRING','BOOLEAN','moment','sequelize','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3f267c,_0x150415){var _0x124815=function(_0x1003e2){while(--_0x1003e2){_0x3f267c['push'](_0x3f267c['shift']());}};_0x124815(++_0x150415);}(_0xacfd,0x119));var _0xdacf=function(_0x13d758,_0x38e1fc){_0x13d758=_0x13d758-0x0;var _0x4147f6=_0xacfd[_0x13d758];return _0x4147f6;};'use strict';var moment=require(_0xdacf('0x0'));var Sequelize=require(_0xdacf('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xdacf('0x2')],'set':function(_0x4f227c){this[_0xdacf('0x3')](_0xdacf('0x4'),_0x4f227c);this[_0xdacf('0x3')]('endtime',moment()[_0xdacf('0x5')](_0xdacf('0x6')));}},'endtime':{'type':Sequelize[_0xdacf('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xdacf('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdacf('0x7')]},'calleridnum':{'type':Sequelize[_0xdacf('0x7')]},'completed':{'type':Sequelize[_0xdacf('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 8501492..67fe5b8 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 _0x4fe4=['length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','rows','catch','merge','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','findAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x6e6e45,_0x1d7bf3){var _0x5f21e0=function(_0x16efb6){while(--_0x16efb6){_0x6e6e45['push'](_0x6e6e45['shift']());}};_0x5f21e0(++_0x1d7bf3);}(_0x4fe4,0x15a));var _0x44fe=function(_0x4d189e,_0x2c0a04){_0x4d189e=_0x4d189e-0x0;var _0x1b36df=_0x4fe4[_0x4d189e];return _0x1b36df;};'use strict';var emlformat=require(_0x44fe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x44fe('0x1'));var jsonpatch=require(_0x44fe('0x2'));var rp=require('request-promise');var moment=require(_0x44fe('0x3'));var BPromise=require(_0x44fe('0x4'));var Mustache=require(_0x44fe('0x5'));var util=require(_0x44fe('0x6'));var path=require('path');var sox=require(_0x44fe('0x7'));var csv=require(_0x44fe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44fe('0x9'));var _=require(_0x44fe('0xa'));var squel=require('squel');var crypto=require(_0x44fe('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x44fe('0xc'));var toCsv=require(_0x44fe('0x8'));var querystring=require(_0x44fe('0xd'));var Papa=require(_0x44fe('0xe'));var Redis=require(_0x44fe('0xf'));var authService=require(_0x44fe('0x10'));var qs=require(_0x44fe('0x11'));var as=require(_0x44fe('0x12'));var hardwareService=require(_0x44fe('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x44fe('0x14'));var config=require(_0x44fe('0x15'));var licenseUtil=require(_0x44fe('0x16'));var db=require(_0x44fe('0x17'))['db'];function respondWithStatusCode(_0x33b18e,_0x52bb47){_0x52bb47=_0x52bb47||0xcc;return function(_0x1ed262){if(_0x1ed262){return _0x33b18e['sendStatus'](_0x52bb47);}return _0x33b18e[_0x44fe('0x18')](_0x52bb47)[_0x44fe('0x19')]();};}function respondWithResult(_0xd6b2e6,_0xcac85c){_0xcac85c=_0xcac85c||0xc8;return function(_0x13ffb){if(_0x13ffb){return _0xd6b2e6[_0x44fe('0x18')](_0xcac85c)['json'](_0x13ffb);}};}function respondWithFilteredResult(_0x3ece35,_0x2180f0){return function(_0x96fac9){if(_0x96fac9){var _0xcc3441=typeof _0x2180f0['offset']===_0x44fe('0x1a')&&typeof _0x2180f0[_0x44fe('0x1b')]===_0x44fe('0x1a');var _0x2d3be6=_0x96fac9['count'];var _0x172583=_0xcc3441?0x0:_0x2180f0[_0x44fe('0x1c')];var _0x51e3d6=_0xcc3441?_0x96fac9[_0x44fe('0x1d')]:_0x2180f0['offset']+_0x2180f0[_0x44fe('0x1b')];var _0x8f1656;if(_0x51e3d6>=_0x2d3be6){_0x51e3d6=_0x2d3be6;_0x8f1656=0xc8;}else{_0x8f1656=0xce;}_0x3ece35['status'](_0x8f1656);return _0x3ece35[_0x44fe('0x1e')](_0x44fe('0x1f'),_0x172583+'-'+_0x51e3d6+'/'+_0x2d3be6)[_0x44fe('0x20')](_0x96fac9);}return null;};}function patchUpdates(_0x2cc18d){return function(_0x2824c9){try{jsonpatch[_0x44fe('0x21')](_0x2824c9,_0x2cc18d,!![]);}catch(_0x2ce08f){return BPromise['reject'](_0x2ce08f);}return _0x2824c9[_0x44fe('0x22')]();};}function saveUpdates(_0x579155,_0x38d53f){return function(_0xe726ed){if(_0xe726ed){return _0xe726ed[_0x44fe('0x23')](_0x579155)[_0x44fe('0x24')](function(_0x31565d){return _0x31565d;});}return null;};}function removeEntity(_0xac4e7c,_0x64d9d){return function(_0x533cad){if(_0x533cad){return _0x533cad[_0x44fe('0x25')]()[_0x44fe('0x24')](function(){_0xac4e7c['status'](0xcc)[_0x44fe('0x19')]();});}};}function handleEntityNotFound(_0x2c6b0b,_0x5251d1){return function(_0xbe7ae8){if(!_0xbe7ae8){_0x2c6b0b[_0x44fe('0x26')](0x194);}return _0xbe7ae8;};}function handleError(_0x51ccf1,_0x22c431){_0x22c431=_0x22c431||0x1f4;return function(_0x3888b6){logger['error'](_0x3888b6[_0x44fe('0x27')]);if(_0x3888b6[_0x44fe('0x28')]){delete _0x3888b6[_0x44fe('0x28')];}_0x51ccf1[_0x44fe('0x18')](_0x22c431)['send'](_0x3888b6);};}exports[_0x44fe('0x29')]=function(_0x510244,_0x34b0cb){var _0x36f3a0={},_0x1898c4={},_0x64360f={'count':0x0,'rows':[]};var _0x219389=_[_0x44fe('0x2a')](db[_0x44fe('0x2b')][_0x44fe('0x2c')],function(_0x356e63){return{'name':_0x356e63[_0x44fe('0x2d')],'type':_0x356e63['type'][_0x44fe('0x2e')]};});_0x1898c4[_0x44fe('0x2f')]=_[_0x44fe('0x2a')](_0x219389,'name');_0x1898c4['query']=_[_0x44fe('0x30')](_0x510244[_0x44fe('0x31')]);_0x1898c4[_0x44fe('0x32')]=_[_0x44fe('0x33')](_0x1898c4[_0x44fe('0x2f')],_0x1898c4[_0x44fe('0x31')]);_0x36f3a0[_0x44fe('0x34')]=_['intersection'](_0x1898c4[_0x44fe('0x2f')],qs[_0x44fe('0x35')](_0x510244[_0x44fe('0x31')][_0x44fe('0x35')]));_0x36f3a0[_0x44fe('0x34')]=_0x36f3a0[_0x44fe('0x34')][_0x44fe('0x36')]?_0x36f3a0[_0x44fe('0x34')]:_0x1898c4[_0x44fe('0x2f')];if(!_0x510244['query'][_0x44fe('0x37')]('nolimit')){_0x36f3a0[_0x44fe('0x1b')]=qs['limit'](_0x510244[_0x44fe('0x31')][_0x44fe('0x1b')]);_0x36f3a0['offset']=qs[_0x44fe('0x1c')](_0x510244['query'][_0x44fe('0x1c')]);}_0x36f3a0[_0x44fe('0x38')]=qs[_0x44fe('0x39')](_0x510244[_0x44fe('0x31')]['sort']);_0x36f3a0[_0x44fe('0x3a')]=qs['filters'](_[_0x44fe('0x3b')](_0x510244['query'],_0x1898c4[_0x44fe('0x32')]),_0x219389);if(_0x510244[_0x44fe('0x31')][_0x44fe('0x3c')]){_0x36f3a0[_0x44fe('0x3a')]=_['merge'](_0x36f3a0['where'],{'$or':_['map'](_0x219389,function(_0x2278af){if(_0x2278af[_0x44fe('0x3d')]!==_0x44fe('0x3e')){var _0x2a89be={};_0x2a89be[_0x2278af[_0x44fe('0x28')]]={'$like':'%'+_0x510244['query'][_0x44fe('0x3c')]+'%'};return _0x2a89be;}})});}_0x36f3a0=_['merge']({},_0x36f3a0,_0x510244[_0x44fe('0x3f')]);var _0x107079={'where':_0x36f3a0[_0x44fe('0x3a')]};return db[_0x44fe('0x2b')][_0x44fe('0x1d')](_0x107079)[_0x44fe('0x24')](function(_0x171c6d){_0x64360f['count']=_0x171c6d;if(_0x510244['query'][_0x44fe('0x40')]){_0x36f3a0[_0x44fe('0x41')]=[{'all':!![]}];}return db[_0x44fe('0x2b')]['findAll'](_0x36f3a0);})[_0x44fe('0x24')](function(_0x2707a2){_0x64360f[_0x44fe('0x42')]=_0x2707a2;return _0x64360f;})[_0x44fe('0x24')](respondWithFilteredResult(_0x34b0cb,_0x36f3a0))[_0x44fe('0x43')](handleError(_0x34b0cb,null));};exports['show']=function(_0x6a03b0,_0x479f2a){var _0x6c2c5c={'raw':!![],'where':{'id':_0x6a03b0['params']['id']}},_0x2194fe={};_0x2194fe[_0x44fe('0x2f')]=_[_0x44fe('0x30')](db[_0x44fe('0x2b')]['rawAttributes']);_0x2194fe[_0x44fe('0x31')]=_[_0x44fe('0x30')](_0x6a03b0[_0x44fe('0x31')]);_0x2194fe[_0x44fe('0x32')]=_[_0x44fe('0x33')](_0x2194fe[_0x44fe('0x2f')],_0x2194fe[_0x44fe('0x31')]);_0x6c2c5c[_0x44fe('0x34')]=_[_0x44fe('0x33')](_0x2194fe[_0x44fe('0x2f')],qs[_0x44fe('0x35')](_0x6a03b0[_0x44fe('0x31')][_0x44fe('0x35')]));_0x6c2c5c[_0x44fe('0x34')]=_0x6c2c5c[_0x44fe('0x34')][_0x44fe('0x36')]?_0x6c2c5c[_0x44fe('0x34')]:_0x2194fe[_0x44fe('0x2f')];if(_0x6a03b0['query']['includeAll']){_0x6c2c5c[_0x44fe('0x41')]=[{'all':!![]}];}_0x6c2c5c=_[_0x44fe('0x44')]({},_0x6c2c5c,_0x6a03b0[_0x44fe('0x3f')]);return db[_0x44fe('0x2b')][_0x44fe('0x45')](_0x6c2c5c)[_0x44fe('0x24')](handleEntityNotFound(_0x479f2a,null))[_0x44fe('0x24')](respondWithResult(_0x479f2a,null))[_0x44fe('0x43')](handleError(_0x479f2a,null));};exports['create']=function(_0x57beae,_0x153375){return db[_0x44fe('0x2b')][_0x44fe('0x46')](_0x57beae[_0x44fe('0x47')],{})[_0x44fe('0x24')](respondWithResult(_0x153375,0xc9))['catch'](handleError(_0x153375,null));};exports['update']=function(_0xed3602,_0x5449cd){if(_0xed3602[_0x44fe('0x47')]['id']){delete _0xed3602['body']['id'];}return db[_0x44fe('0x2b')]['find']({'where':{'id':_0xed3602[_0x44fe('0x48')]['id']}})[_0x44fe('0x24')](handleEntityNotFound(_0x5449cd,null))['then'](saveUpdates(_0xed3602['body'],null))['then'](respondWithResult(_0x5449cd,null))[_0x44fe('0x43')](handleError(_0x5449cd,null));};exports['destroy']=function(_0x8bed3c,_0xf6777e){return db[_0x44fe('0x2b')][_0x44fe('0x45')]({'where':{'id':_0x8bed3c['params']['id']}})[_0x44fe('0x24')](handleEntityNotFound(_0xf6777e,null))['then'](removeEntity(_0xf6777e,null))[_0x44fe('0x43')](handleError(_0xf6777e,null));};exports['describe']=function(_0x387473,_0x279e7c){return db[_0x44fe('0x2b')][_0x44fe('0x49')]()[_0x44fe('0x24')](respondWithResult(_0x279e7c,null))[_0x44fe('0x43')](handleError(_0x279e7c,null));};exports[_0x44fe('0x4a')]=function(_0x20ca8c,_0x1f66e2,_0x5c36b8){var _0xa198ce={'raw':!![],'where':{}};var _0x2e76b8={};var _0xc610b0={'count':0x0,'rows':[]};return db[_0x44fe('0x2b')][_0x44fe('0x4b')]({'where':{'id':_0x20ca8c['params']['id']}})['then'](handleEntityNotFound(_0x1f66e2,null))['then'](function(_0x5d4b6d){if(_0x5d4b6d){_0x2e76b8[_0x44fe('0x2f')]=_[_0x44fe('0x30')](db[_0x44fe('0x4c')]['rawAttributes']);_0x2e76b8[_0x44fe('0x31')]=_[_0x44fe('0x30')](_0x20ca8c[_0x44fe('0x31')]);_0x2e76b8[_0x44fe('0x32')]=_[_0x44fe('0x33')](_0x2e76b8[_0x44fe('0x2f')],_0x2e76b8[_0x44fe('0x31')]);_0xa198ce[_0x44fe('0x34')]=_[_0x44fe('0x33')](_0x2e76b8[_0x44fe('0x2f')],qs[_0x44fe('0x35')](_0x20ca8c['query']['fields']));_0xa198ce[_0x44fe('0x34')]=_0xa198ce[_0x44fe('0x34')][_0x44fe('0x36')]?_0xa198ce['attributes']:_0x2e76b8[_0x44fe('0x2f')];if(!_0x20ca8c[_0x44fe('0x31')][_0x44fe('0x37')](_0x44fe('0x4d'))){_0xa198ce[_0x44fe('0x1b')]=qs[_0x44fe('0x1b')](_0x20ca8c[_0x44fe('0x31')][_0x44fe('0x1b')]);_0xa198ce['offset']=qs[_0x44fe('0x1c')](_0x20ca8c[_0x44fe('0x31')][_0x44fe('0x1c')]);}_0xa198ce[_0x44fe('0x38')]=qs[_0x44fe('0x39')](_0x20ca8c[_0x44fe('0x31')][_0x44fe('0x39')]);_0xa198ce[_0x44fe('0x3a')]=qs[_0x44fe('0x32')](_[_0x44fe('0x3b')](_0x20ca8c[_0x44fe('0x31')],_0x2e76b8[_0x44fe('0x32')]));_0xa198ce[_0x44fe('0x3a')][_0x44fe('0x4e')]=_0x5d4b6d['id'];if(_0x20ca8c[_0x44fe('0x31')][_0x44fe('0x3c')]){_0xa198ce[_0x44fe('0x3a')]=_[_0x44fe('0x44')](_0xa198ce[_0x44fe('0x3a')],{'$or':_[_0x44fe('0x2a')](_0xa198ce[_0x44fe('0x34')],function(_0x18bd98){var _0x314b1e={};_0x314b1e[_0x18bd98]={'$like':'%'+_0x20ca8c[_0x44fe('0x31')][_0x44fe('0x3c')]+'%'};return _0x314b1e;})});}_0xa198ce=_[_0x44fe('0x44')]({},_0xa198ce,_0x20ca8c[_0x44fe('0x3f')]);return db[_0x44fe('0x4c')]['count']({'where':_0xa198ce['where']})[_0x44fe('0x24')](function(_0x40e28f){_0xc610b0[_0x44fe('0x1d')]=_0x40e28f;if(_0x20ca8c['query'][_0x44fe('0x40')]){_0xa198ce[_0x44fe('0x41')]=[{'all':!![]}];}return db[_0x44fe('0x4c')][_0x44fe('0x4f')](_0xa198ce);})[_0x44fe('0x24')](function(_0x3e4199){_0xc610b0[_0x44fe('0x42')]=_0x3e4199;return _0xc610b0;});}})[_0x44fe('0x24')](respondWithFilteredResult(_0x1f66e2,_0xa198ce))[_0x44fe('0x43')](handleError(_0x1f66e2,null));}; \ No newline at end of file +var _0x6f79=['JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','JscriptyQuestionReport','sort','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map'];(function(_0x545da4,_0x1503c2){var _0xeed53f=function(_0x51c725){while(--_0x51c725){_0x545da4['push'](_0x545da4['shift']());}};_0xeed53f(++_0x1503c2);}(_0x6f79,0x15a));var _0x96f7=function(_0x299f9a,_0x122c49){_0x299f9a=_0x299f9a-0x0;var _0x5bec96=_0x6f79[_0x299f9a];return _0x5bec96;};'use strict';var emlformat=require(_0x96f7('0x0'));var rimraf=require(_0x96f7('0x1'));var zipdir=require(_0x96f7('0x2'));var jsonpatch=require(_0x96f7('0x3'));var rp=require(_0x96f7('0x4'));var moment=require(_0x96f7('0x5'));var BPromise=require(_0x96f7('0x6'));var Mustache=require(_0x96f7('0x7'));var util=require(_0x96f7('0x8'));var path=require(_0x96f7('0x9'));var sox=require(_0x96f7('0xa'));var csv=require(_0x96f7('0xb'));var ejs=require(_0x96f7('0xc'));var fs=require('fs');var fs_extra=require(_0x96f7('0xd'));var _=require(_0x96f7('0xe'));var squel=require('squel');var crypto=require(_0x96f7('0xf'));var jsforce=require(_0x96f7('0x10'));var deskjs=require(_0x96f7('0x11'));var toCsv=require(_0x96f7('0xb'));var querystring=require(_0x96f7('0x12'));var Papa=require('papaparse');var Redis=require(_0x96f7('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x96f7('0x14'));var hardwareService=require(_0x96f7('0x15'));var logger=require(_0x96f7('0x16'))(_0x96f7('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fa821,_0x46218c){_0x46218c=_0x46218c||0xcc;return function(_0x36a666){if(_0x36a666){return _0x2fa821[_0x96f7('0x18')](_0x46218c);}return _0x2fa821[_0x96f7('0x19')](_0x46218c)[_0x96f7('0x1a')]();};}function respondWithResult(_0x1bcd6e,_0x2fd96b){_0x2fd96b=_0x2fd96b||0xc8;return function(_0x5ec6ec){if(_0x5ec6ec){return _0x1bcd6e['status'](_0x2fd96b)[_0x96f7('0x1b')](_0x5ec6ec);}};}function respondWithFilteredResult(_0x8413f5,_0xb37fc5){return function(_0x7d5189){if(_0x7d5189){var _0x30e787=typeof _0xb37fc5[_0x96f7('0x1c')]===_0x96f7('0x1d')&&typeof _0xb37fc5[_0x96f7('0x1e')]==='undefined';var _0x303584=_0x7d5189[_0x96f7('0x1f')];var _0x3cf27f=_0x30e787?0x0:_0xb37fc5[_0x96f7('0x1c')];var _0x171926=_0x30e787?_0x7d5189[_0x96f7('0x1f')]:_0xb37fc5[_0x96f7('0x1c')]+_0xb37fc5[_0x96f7('0x1e')];var _0x4a8e56;if(_0x171926>=_0x303584){_0x171926=_0x303584;_0x4a8e56=0xc8;}else{_0x4a8e56=0xce;}_0x8413f5['status'](_0x4a8e56);return _0x8413f5[_0x96f7('0x20')](_0x96f7('0x21'),_0x3cf27f+'-'+_0x171926+'/'+_0x303584)[_0x96f7('0x1b')](_0x7d5189);}return null;};}function patchUpdates(_0x1c638f){return function(_0x5e33bf){try{jsonpatch[_0x96f7('0x22')](_0x5e33bf,_0x1c638f,!![]);}catch(_0x292838){return BPromise[_0x96f7('0x23')](_0x292838);}return _0x5e33bf['save']();};}function saveUpdates(_0xb5fd55,_0x37d3a9){return function(_0x381478){if(_0x381478){return _0x381478[_0x96f7('0x24')](_0xb5fd55)[_0x96f7('0x25')](function(_0x2208d0){return _0x2208d0;});}return null;};}function removeEntity(_0x3d987a,_0x4c3491){return function(_0x161d33){if(_0x161d33){return _0x161d33[_0x96f7('0x26')]()['then'](function(){_0x3d987a[_0x96f7('0x19')](0xcc)[_0x96f7('0x1a')]();});}};}function handleEntityNotFound(_0x2bb92e,_0x2c4fbf){return function(_0x2e37ac){if(!_0x2e37ac){_0x2bb92e[_0x96f7('0x18')](0x194);}return _0x2e37ac;};}function handleError(_0x49e0ab,_0x852008){_0x852008=_0x852008||0x1f4;return function(_0x1a9be8){logger[_0x96f7('0x27')](_0x1a9be8[_0x96f7('0x28')]);if(_0x1a9be8[_0x96f7('0x29')]){delete _0x1a9be8['name'];}_0x49e0ab['status'](_0x852008)[_0x96f7('0x2a')](_0x1a9be8);};}exports['index']=function(_0x36cb33,_0x4b13c5){var _0x890767={},_0x24f65b={},_0x329e98={'count':0x0,'rows':[]};var _0x65ae47=_[_0x96f7('0x2b')](db[_0x96f7('0x2c')][_0x96f7('0x2d')],function(_0x510611){return{'name':_0x510611[_0x96f7('0x2e')],'type':_0x510611[_0x96f7('0x2f')][_0x96f7('0x30')]};});_0x24f65b[_0x96f7('0x31')]=_[_0x96f7('0x2b')](_0x65ae47,_0x96f7('0x29'));_0x24f65b['query']=_[_0x96f7('0x32')](_0x36cb33[_0x96f7('0x33')]);_0x24f65b[_0x96f7('0x34')]=_[_0x96f7('0x35')](_0x24f65b[_0x96f7('0x31')],_0x24f65b[_0x96f7('0x33')]);_0x890767[_0x96f7('0x36')]=_[_0x96f7('0x35')](_0x24f65b[_0x96f7('0x31')],qs[_0x96f7('0x37')](_0x36cb33[_0x96f7('0x33')][_0x96f7('0x37')]));_0x890767[_0x96f7('0x36')]=_0x890767['attributes'][_0x96f7('0x38')]?_0x890767[_0x96f7('0x36')]:_0x24f65b[_0x96f7('0x31')];if(!_0x36cb33[_0x96f7('0x33')][_0x96f7('0x39')](_0x96f7('0x3a'))){_0x890767[_0x96f7('0x1e')]=qs[_0x96f7('0x1e')](_0x36cb33[_0x96f7('0x33')][_0x96f7('0x1e')]);_0x890767[_0x96f7('0x1c')]=qs[_0x96f7('0x1c')](_0x36cb33[_0x96f7('0x33')][_0x96f7('0x1c')]);}_0x890767[_0x96f7('0x3b')]=qs['sort'](_0x36cb33[_0x96f7('0x33')]['sort']);_0x890767[_0x96f7('0x3c')]=qs[_0x96f7('0x34')](_[_0x96f7('0x3d')](_0x36cb33[_0x96f7('0x33')],_0x24f65b[_0x96f7('0x34')]),_0x65ae47);if(_0x36cb33[_0x96f7('0x33')][_0x96f7('0x3e')]){_0x890767[_0x96f7('0x3c')]=_[_0x96f7('0x3f')](_0x890767[_0x96f7('0x3c')],{'$or':_[_0x96f7('0x2b')](_0x65ae47,function(_0x11aef5){if(_0x11aef5[_0x96f7('0x2f')]!=='VIRTUAL'){var _0x30781d={};_0x30781d[_0x11aef5[_0x96f7('0x29')]]={'$like':'%'+_0x36cb33[_0x96f7('0x33')][_0x96f7('0x3e')]+'%'};return _0x30781d;}})});}_0x890767=_['merge']({},_0x890767,_0x36cb33[_0x96f7('0x40')]);var _0x149306={'where':_0x890767['where']};return db['JscriptySessionReport'][_0x96f7('0x1f')](_0x149306)[_0x96f7('0x25')](function(_0x4f77d4){_0x329e98[_0x96f7('0x1f')]=_0x4f77d4;if(_0x36cb33[_0x96f7('0x33')][_0x96f7('0x41')]){_0x890767[_0x96f7('0x42')]=[{'all':!![]}];}return db[_0x96f7('0x2c')][_0x96f7('0x43')](_0x890767);})[_0x96f7('0x25')](function(_0x3753b1){_0x329e98[_0x96f7('0x44')]=_0x3753b1;return _0x329e98;})[_0x96f7('0x25')](respondWithFilteredResult(_0x4b13c5,_0x890767))[_0x96f7('0x45')](handleError(_0x4b13c5,null));};exports[_0x96f7('0x46')]=function(_0x51d433,_0x363836){var _0x2f0ae8={'raw':!![],'where':{'id':_0x51d433['params']['id']}},_0x2ad796={};_0x2ad796['model']=_['keys'](db[_0x96f7('0x2c')]['rawAttributes']);_0x2ad796['query']=_[_0x96f7('0x32')](_0x51d433[_0x96f7('0x33')]);_0x2ad796[_0x96f7('0x34')]=_[_0x96f7('0x35')](_0x2ad796[_0x96f7('0x31')],_0x2ad796['query']);_0x2f0ae8[_0x96f7('0x36')]=_['intersection'](_0x2ad796[_0x96f7('0x31')],qs[_0x96f7('0x37')](_0x51d433[_0x96f7('0x33')][_0x96f7('0x37')]));_0x2f0ae8['attributes']=_0x2f0ae8[_0x96f7('0x36')][_0x96f7('0x38')]?_0x2f0ae8[_0x96f7('0x36')]:_0x2ad796[_0x96f7('0x31')];if(_0x51d433[_0x96f7('0x33')][_0x96f7('0x41')]){_0x2f0ae8[_0x96f7('0x42')]=[{'all':!![]}];}_0x2f0ae8=_[_0x96f7('0x3f')]({},_0x2f0ae8,_0x51d433[_0x96f7('0x40')]);return db[_0x96f7('0x2c')][_0x96f7('0x47')](_0x2f0ae8)['then'](handleEntityNotFound(_0x363836,null))[_0x96f7('0x25')](respondWithResult(_0x363836,null))[_0x96f7('0x45')](handleError(_0x363836,null));};exports[_0x96f7('0x48')]=function(_0x24fc85,_0x1a09f2){return db[_0x96f7('0x2c')][_0x96f7('0x48')](_0x24fc85[_0x96f7('0x49')],{})[_0x96f7('0x25')](respondWithResult(_0x1a09f2,0xc9))[_0x96f7('0x45')](handleError(_0x1a09f2,null));};exports['update']=function(_0x24dddc,_0x20413b){if(_0x24dddc['body']['id']){delete _0x24dddc[_0x96f7('0x49')]['id'];}return db['JscriptySessionReport'][_0x96f7('0x47')]({'where':{'id':_0x24dddc['params']['id']}})[_0x96f7('0x25')](handleEntityNotFound(_0x20413b,null))[_0x96f7('0x25')](saveUpdates(_0x24dddc[_0x96f7('0x49')],null))['then'](respondWithResult(_0x20413b,null))['catch'](handleError(_0x20413b,null));};exports[_0x96f7('0x26')]=function(_0x1144ca,_0x396865){return db['JscriptySessionReport']['find']({'where':{'id':_0x1144ca[_0x96f7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x396865,null))[_0x96f7('0x25')](removeEntity(_0x396865,null))[_0x96f7('0x45')](handleError(_0x396865,null));};exports[_0x96f7('0x4b')]=function(_0x5e011a,_0x1fc531){return db[_0x96f7('0x2c')][_0x96f7('0x4b')]()['then'](respondWithResult(_0x1fc531,null))[_0x96f7('0x45')](handleError(_0x1fc531,null));};exports['getQuestions']=function(_0x5e0ccb,_0x435422,_0x48514d){var _0x339323={'raw':!![],'where':{}};var _0x1df40b={};var _0x2d5c44={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x5e0ccb[_0x96f7('0x4a')]['id']}})[_0x96f7('0x25')](handleEntityNotFound(_0x435422,null))['then'](function(_0x3c06ec){if(_0x3c06ec){_0x1df40b[_0x96f7('0x31')]=_[_0x96f7('0x32')](db[_0x96f7('0x4c')][_0x96f7('0x2d')]);_0x1df40b[_0x96f7('0x33')]=_[_0x96f7('0x32')](_0x5e0ccb[_0x96f7('0x33')]);_0x1df40b[_0x96f7('0x34')]=_[_0x96f7('0x35')](_0x1df40b[_0x96f7('0x31')],_0x1df40b[_0x96f7('0x33')]);_0x339323[_0x96f7('0x36')]=_[_0x96f7('0x35')](_0x1df40b[_0x96f7('0x31')],qs[_0x96f7('0x37')](_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x37')]));_0x339323[_0x96f7('0x36')]=_0x339323[_0x96f7('0x36')][_0x96f7('0x38')]?_0x339323[_0x96f7('0x36')]:_0x1df40b[_0x96f7('0x31')];if(!_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x39')](_0x96f7('0x3a'))){_0x339323[_0x96f7('0x1e')]=qs[_0x96f7('0x1e')](_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x1e')]);_0x339323[_0x96f7('0x1c')]=qs[_0x96f7('0x1c')](_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x1c')]);}_0x339323[_0x96f7('0x3b')]=qs[_0x96f7('0x4d')](_0x5e0ccb[_0x96f7('0x33')]['sort']);_0x339323[_0x96f7('0x3c')]=qs[_0x96f7('0x34')](_[_0x96f7('0x3d')](_0x5e0ccb['query'],_0x1df40b[_0x96f7('0x34')]));_0x339323[_0x96f7('0x3c')]['SessionId']=_0x3c06ec['id'];if(_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x3e')]){_0x339323[_0x96f7('0x3c')]=_[_0x96f7('0x3f')](_0x339323[_0x96f7('0x3c')],{'$or':_[_0x96f7('0x2b')](_0x339323[_0x96f7('0x36')],function(_0x311fa6){var _0x495039={};_0x495039[_0x311fa6]={'$like':'%'+_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x3e')]+'%'};return _0x495039;})});}_0x339323=_[_0x96f7('0x3f')]({},_0x339323,_0x5e0ccb['options']);return db['JscriptyQuestionReport'][_0x96f7('0x1f')]({'where':_0x339323[_0x96f7('0x3c')]})[_0x96f7('0x25')](function(_0x87db0f){_0x2d5c44[_0x96f7('0x1f')]=_0x87db0f;if(_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x41')]){_0x339323[_0x96f7('0x42')]=[{'all':!![]}];}return db[_0x96f7('0x4c')][_0x96f7('0x43')](_0x339323);})[_0x96f7('0x25')](function(_0x3af18e){_0x2d5c44[_0x96f7('0x44')]=_0x3af18e;return _0x2d5c44;});}})['then'](respondWithFilteredResult(_0x435422,_0x339323))[_0x96f7('0x45')](handleError(_0x435422,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index f13cd56..1ac532e 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 _0x3baf=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x3baf,0xf7));var _0xf3ba=function(_0x4dd693,_0x20ed73){_0x4dd693=_0x4dd693-0x0;var _0x164ce3=_0x3baf[_0x4dd693];return _0x164ce3;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var logger=require(_0xf3ba('0x2'))(_0xf3ba('0x3'));var moment=require(_0xf3ba('0x4'));var BPromise=require(_0xf3ba('0x5'));var rp=require(_0xf3ba('0x6'));var fs=require('fs');var path=require(_0xf3ba('0x7'));var rimraf=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var attributes=require(_0xf3ba('0xa'));module[_0xf3ba('0xb')]=function(_0x475268,_0x2e6df2){return _0x475268[_0xf3ba('0xc')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x7217,0x19e));var _0x7721=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7217[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 8148bf2..6bb464a 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x197472,_0x19265f){var _0x4db303=function(_0x12e13e){while(--_0x12e13e){_0x197472['push'](_0x197472['shift']());}};_0x4db303(++_0x19265f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x39752b,_0x41c9f0){_0x39752b=_0x39752b-0x0;var _0x221636=_0x5f2f[_0x39752b];return _0x221636;};'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')]('JscriptySessionReport,\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 +var _0x6a55=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','randomstring','../../config/utils','rpc','jayson/promise','client','http','then','info'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x6a55,0xdb));var _0x56a5=function(_0x2df4cc,_0x1233c6){_0x2df4cc=_0x2df4cc-0x0;var _0x40af8d=_0x6a55[_0x2df4cc];return _0x40af8d;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x56a5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x56a5('0x2'));var logger=require('../../config/logger')(_0x56a5('0x3'));var config=require('../../config/environment');var jayson=require(_0x56a5('0x4'));var client=jayson[_0x56a5('0x5')][_0x56a5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x293ea1,_0x444c65,_0x2272d9){return new BPromise(function(_0x2b8f57,_0x387dcb){return client['request'](_0x293ea1,_0x2272d9)[_0x56a5('0x7')](function(_0xf15490){logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,_0x56a5('0xa'));logger[_0x56a5('0xb')](_0x56a5('0xc'),_0x444c65,_0x56a5('0xa'),JSON[_0x56a5('0xd')](_0xf15490));if(_0xf15490['error']){if(_0xf15490['error'][_0x56a5('0xe')]===0x1f4){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x387dcb(_0xf15490[_0x56a5('0xf')]['message']);}logger['error'](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x2b8f57(_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);}else{logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,'request\x20sent');_0x2b8f57(_0xf15490[_0x56a5('0x11')]['message']);}})[_0x56a5('0x12')](function(_0x51d031){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0x51d031);_0x387dcb(_0x51d031);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index a0db1f5..631686d 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 _0x83f7=['get','index','put','/:id','update','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x40f31d,_0x166318){var _0x10d4e4=function(_0x427148){while(--_0x427148){_0x40f31d['push'](_0x40f31d['shift']());}};_0x10d4e4(++_0x166318);}(_0x83f7,0x84));var _0x783f=function(_0x2e53b5,_0x59ace3){_0x2e53b5=_0x2e53b5-0x0;var _0x7aa3a0=_0x83f7[_0x2e53b5];return _0x7aa3a0;};'use strict';var multer=require(_0x783f('0x0'));var util=require(_0x783f('0x1'));var path=require(_0x783f('0x2'));var timeout=require('connect-timeout');var express=require(_0x783f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x783f('0x4'));var interaction=require(_0x783f('0x5'));var config=require(_0x783f('0x6'));var controller=require(_0x783f('0x7'));router[_0x783f('0x8')]('/',controller[_0x783f('0x9')]);router[_0x783f('0xa')](_0x783f('0xb'),auth['isAuthenticated'](),controller[_0x783f('0xc')]);module[_0x783f('0xd')]=router; \ No newline at end of file +var _0xe5d5=['/:id','isAuthenticated','update','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xe5d5,0x156));var _0x5e5d=function(_0x5cfd72,_0x58f356){_0x5cfd72=_0x5cfd72-0x0;var _0x2a4aa1=_0xe5d5[_0x5cfd72];return _0x2a4aa1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e5d('0x0'));var timeout=require('connect-timeout');var express=require(_0x5e5d('0x1'));var router=express['Router']();var fs_extra=require(_0x5e5d('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5e5d('0x3'));var config=require(_0x5e5d('0x4'));var controller=require(_0x5e5d('0x5'));router[_0x5e5d('0x6')]('/',controller[_0x5e5d('0x7')]);router[_0x5e5d('0x8')](_0x5e5d('0x9'),auth[_0x5e5d('0xa')](),controller[_0x5e5d('0xb')]);module[_0x5e5d('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 86aac93..837dd7b 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 _0xd4f4=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x3f2e50,_0x5e95e0){var _0x1eb100=function(_0x351cd){while(--_0x351cd){_0x3f2e50['push'](_0x3f2e50['shift']());}};_0x1eb100(++_0x5e95e0);}(_0xd4f4,0xc1));var _0x4d4f=function(_0x5ae5f0,_0x2890d6){_0x5ae5f0=_0x5ae5f0-0x0;var _0x466282=_0xd4f4[_0x5ae5f0];return _0x466282;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'license':{'type':Sequelize[_0x4d4f('0x2')]},'data1':{'type':Sequelize[_0x4d4f('0x3')]},'data2':{'type':Sequelize[_0x4d4f('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x05cb=['INTEGER','sequelize','TEXT','STRING'];(function(_0x3687ae,_0x3e2ac4){var _0x2af097=function(_0x373b39){while(--_0x373b39){_0x3687ae['push'](_0x3687ae['shift']());}};_0x2af097(++_0x3e2ac4);}(_0x05cb,0x131));var _0xb05c=function(_0x3d9662,_0x236ea2){_0x3d9662=_0x3d9662-0x0;var _0x58c2d5=_0x05cb[_0x3d9662];return _0x58c2d5;};'use strict';var Sequelize=require(_0xb05c('0x0'));module['exports']={'license':{'type':Sequelize[_0xb05c('0x1')]},'data1':{'type':Sequelize[_0xb05c('0x2')]},'data2':{'type':Sequelize[_0xb05c('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xb05c('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 05227ec..4cf981d 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 _0xc4aa=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','eml-format','rimraf'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}var utilLicense=require(_0xac4a('0x15'));exports[_0xac4a('0x2a')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={'raw':!![],'where':{'id':0x1}},_0x47f49c={};_0x47f49c[_0xac4a('0x2b')]=_[_0xac4a('0x2c')](db[_0xac4a('0x2d')]['rawAttributes']);_0x47f49c['query']=_[_0xac4a('0x2c')](_0x2772fe[_0xac4a('0x2e')]);_0x47f49c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x47f49c[_0xac4a('0x2b')],_0x47f49c['query']);_0x4a5a9e[_0xac4a('0x31')]=_['intersection'](_0x47f49c[_0xac4a('0x2b')],qs['fields'](_0x2772fe[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x4a5a9e[_0xac4a('0x31')]=_0x4a5a9e[_0xac4a('0x31')][_0xac4a('0x33')]?_0x4a5a9e[_0xac4a('0x31')]:_0x47f49c[_0xac4a('0x2b')];_0x4a5a9e=_[_0xac4a('0x34')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x35')]);return utilLicense[_0xac4a('0x36')](_0x4a5a9e)[_0xac4a('0x24')](respondWithResult(_0x116700,null))[_0xac4a('0x37')](handleError(_0x116700,null));};exports[_0xac4a('0x23')]=function(_0x1a9d4e,_0x5634e2){if(_0x1a9d4e[_0xac4a('0x38')]['id']){delete _0x1a9d4e[_0xac4a('0x38')]['id'];}return db['License'][_0xac4a('0x39')]({'where':{'id':_0x1a9d4e[_0xac4a('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5634e2,null))['then'](function(_0x11f0be){var _0x1ba096=_0x11f0be[_0xac4a('0x3b')]({'plain':!![]});return utilLicense[_0xac4a('0x3c')](_0x1ba096,_0x1a9d4e['body'][_0xac4a('0x3d')]);})[_0xac4a('0x24')](function(_0x4e7630){if(!_0x4e7630[_0xac4a('0x3e')]){return saveUpdates(_0x1a9d4e[_0xac4a('0x38')],null);}return _0x4e7630;})[_0xac4a('0x24')](respondWithResult(_0x5634e2,null))['catch'](handleError(_0x5634e2,null));}; \ No newline at end of file +var _0x5fab=['checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','merge','then','catch','body','find','params'];(function(_0x1b9c66,_0xcfbe73){var _0x56776d=function(_0x8bf6d8){while(--_0x8bf6d8){_0x1b9c66['push'](_0x1b9c66['shift']());}};_0x56776d(++_0xcfbe73);}(_0x5fab,0x177));var _0xb5fa=function(_0xdf56aa,_0x4d9c15){_0xdf56aa=_0xdf56aa-0x0;var _0x82768=_0x5fab[_0xdf56aa];return _0x82768;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}var utilLicense=require(_0xb5fa('0x18'));exports[_0xb5fa('0x2b')]=function(_0x3506a4,_0x358549){var _0x353314={'raw':!![],'where':{'id':0x1}},_0x409af9={};_0x409af9[_0xb5fa('0x2c')]=_[_0xb5fa('0x2d')](db[_0xb5fa('0x2e')][_0xb5fa('0x2f')]);_0x409af9[_0xb5fa('0x30')]=_[_0xb5fa('0x2d')](_0x3506a4[_0xb5fa('0x30')]);_0x409af9[_0xb5fa('0x31')]=_[_0xb5fa('0x32')](_0x409af9[_0xb5fa('0x2c')],_0x409af9[_0xb5fa('0x30')]);_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x32')](_0x409af9[_0xb5fa('0x2c')],qs[_0xb5fa('0x34')](_0x3506a4['query'][_0xb5fa('0x34')]));_0x353314['attributes']=_0x353314['attributes']['length']?_0x353314[_0xb5fa('0x33')]:_0x409af9['model'];_0x353314=_[_0xb5fa('0x35')]({},_0x353314,_0x3506a4['options']);return utilLicense['getLicense'](_0x353314)[_0xb5fa('0x36')](respondWithResult(_0x358549,null))[_0xb5fa('0x37')](handleError(_0x358549,null));};exports['update']=function(_0x59f41d,_0x3d73c2){if(_0x59f41d[_0xb5fa('0x38')]['id']){delete _0x59f41d[_0xb5fa('0x38')]['id'];}return db['License'][_0xb5fa('0x39')]({'where':{'id':_0x59f41d[_0xb5fa('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3d73c2,null))[_0xb5fa('0x36')](function(_0x2056de){var _0x204d6b=_0x2056de['get']({'plain':!![]});return utilLicense[_0xb5fa('0x3b')](_0x204d6b,_0x59f41d[_0xb5fa('0x38')][_0xb5fa('0x3c')]);})['then'](function(_0x117694){if(!_0x117694[_0xb5fa('0x3d')]){return saveUpdates(_0x59f41d[_0xb5fa('0x38')],null);}return _0x117694;})[_0xb5fa('0x36')](respondWithResult(_0x3d73c2,null))['catch'](handleError(_0x3d73c2,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index c2dca1a..701831d 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 _0x6a73=['../../config/environment','./license.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x576b33,_0x2115ea){var _0x46834d=function(_0x38c45a){while(--_0x38c45a){_0x576b33['push'](_0x576b33['shift']());}};_0x46834d(++_0x2115ea);}(_0x6a73,0xa0));var _0x36a7=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x6a73[_0x5a5395];return _0x4da43d;};'use strict';var _=require(_0x36a7('0x0'));var util=require(_0x36a7('0x1'));var logger=require(_0x36a7('0x2'))('api');var moment=require(_0x36a7('0x3'));var BPromise=require(_0x36a7('0x4'));var rp=require(_0x36a7('0x5'));var fs=require('fs');var path=require(_0x36a7('0x6'));var rimraf=require(_0x36a7('0x7'));var config=require(_0x36a7('0x8'));var attributes=require(_0x36a7('0x9'));module[_0x36a7('0xa')]=function(_0x540f09,_0x9ff748){return _0x540f09[_0x36a7('0xb')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4e0=['License','lodash','util','api','bluebird','request-promise','path','rimraf','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf4e0,0xac));var _0x0f4e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf4e0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0f4e('0x0'));var util=require(_0x0f4e('0x1'));var logger=require('../../config/logger')(_0x0f4e('0x2'));var moment=require('moment');var BPromise=require(_0x0f4e('0x3'));var rp=require(_0x0f4e('0x4'));var fs=require('fs');var path=require(_0x0f4e('0x5'));var rimraf=require(_0x0f4e('0x6'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x4daf7a,_0x262470){return _0x4daf7a[_0x0f4e('0x7')](_0x0f4e('0x8'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index d1a3e72..f39585a 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 _0xa9b1=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x4ea344,_0x331a81){var _0x20ba81=function(_0x5e7da1){while(--_0x5e7da1){_0x4ea344['push'](_0x4ea344['shift']());}};_0x20ba81(++_0x331a81);}(_0xa9b1,0xd8));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1a9b('0x0'));var util=require(_0x1a9b('0x1'));var moment=require(_0x1a9b('0x2'));var BPromise=require(_0x1a9b('0x3'));var rs=require(_0x1a9b('0x4'));var fs=require('fs');var Redis=require(_0x1a9b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a9b('0x6'));var logger=require(_0x1a9b('0x7'))(_0x1a9b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1a9b('0x9')][_0x1a9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x594b5e,_0x153592,_0x17acd5){return new BPromise(function(_0x287d12,_0xd823ab){return client[_0x1a9b('0xb')](_0x594b5e,_0x17acd5)[_0x1a9b('0xc')](function(_0x333575){logger[_0x1a9b('0xd')](_0x1a9b('0xe'),_0x153592,_0x1a9b('0xf'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x153592,_0x1a9b('0xf'),JSON[_0x1a9b('0x10')](_0x333575));if(_0x333575['error']){if(_0x333575[_0x1a9b('0x11')]['code']===0x1f4){logger[_0x1a9b('0x11')](_0x1a9b('0xe'),_0x153592,_0x333575[_0x1a9b('0x11')][_0x1a9b('0x12')]);return _0xd823ab(_0x333575[_0x1a9b('0x11')]['message']);}logger[_0x1a9b('0x11')]('License,\x20%s,\x20%s',_0x153592,_0x333575['error']['message']);return _0x287d12(_0x333575['error'][_0x1a9b('0x12')]);}else{logger[_0x1a9b('0xd')](_0x1a9b('0xe'),_0x153592,_0x1a9b('0xf'));_0x287d12(_0x333575[_0x1a9b('0x13')]['message']);}})['catch'](function(_0x3a77d0){logger[_0x1a9b('0x11')](_0x1a9b('0xe'),_0x153592,_0x3a77d0);_0xd823ab(_0x3a77d0);});});} \ No newline at end of file +var _0xc96c=['../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1f6e3c,_0x791725){var _0x5c2c0c=function(_0x3ed7b3){while(--_0x3ed7b3){_0x1f6e3c['push'](_0x1f6e3c['shift']());}};_0x5c2c0c(++_0x791725);}(_0xc96c,0xa1));var _0xcc96=function(_0x28019c,_0x67743){_0x28019c=_0x28019c-0x0;var _0x48ca39=_0xc96c[_0x28019c];return _0x48ca39;};'use strict';var _=require(_0xcc96('0x0'));var util=require(_0xcc96('0x1'));var moment=require(_0xcc96('0x2'));var BPromise=require(_0xcc96('0x3'));var rs=require(_0xcc96('0x4'));var fs=require('fs');var Redis=require(_0xcc96('0x5'));var db=require(_0xcc96('0x6'))['db'];var utils=require(_0xcc96('0x7'));var logger=require(_0xcc96('0x8'))(_0xcc96('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcc96('0xa')][_0xcc96('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a1186,_0x48d5d0,_0x4cba2d){return new BPromise(function(_0x2c103c,_0x1de7a6){return client[_0xcc96('0xc')](_0x3a1186,_0x4cba2d)['then'](function(_0x5d18f4){logger[_0xcc96('0xd')]('License,\x20%s,\x20%s',_0x48d5d0,_0xcc96('0xe'));logger[_0xcc96('0xf')](_0xcc96('0x10'),_0x48d5d0,'request\x20sent',JSON[_0xcc96('0x11')](_0x5d18f4));if(_0x5d18f4['error']){if(_0x5d18f4[_0xcc96('0x12')][_0xcc96('0x13')]===0x1f4){logger[_0xcc96('0x12')](_0xcc96('0x14'),_0x48d5d0,_0x5d18f4[_0xcc96('0x12')][_0xcc96('0x15')]);return _0x1de7a6(_0x5d18f4[_0xcc96('0x12')][_0xcc96('0x15')]);}logger[_0xcc96('0x12')]('License,\x20%s,\x20%s',_0x48d5d0,_0x5d18f4['error']['message']);return _0x2c103c(_0x5d18f4[_0xcc96('0x12')]['message']);}else{logger[_0xcc96('0xd')]('License,\x20%s,\x20%s',_0x48d5d0,'request\x20sent');_0x2c103c(_0x5d18f4[_0xcc96('0x16')]['message']);}})[_0xcc96('0x17')](function(_0x2698cb){logger['error'](_0xcc96('0x14'),_0x48d5d0,_0x2698cb);_0x1de7a6(_0x2698cb);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 2bdf828..f326ef8 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 _0xfce1=['/:id/send','send','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','/:id/users','getAgents','post','/:id/dispositions','addAnswer','create','addImap','addSmtp'];(function(_0x5f1330,_0x5be4fe){var _0x205aeb=function(_0x6e7a0b){while(--_0x6e7a0b){_0x5f1330['push'](_0x5f1330['shift']());}};_0x205aeb(++_0x5be4fe);}(_0xfce1,0x1c4));var _0x1fce=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xfce1[_0xefd519];return _0x4bb882;};'use strict';var multer=require('multer');var util=require(_0x1fce('0x0'));var path=require(_0x1fce('0x1'));var timeout=require(_0x1fce('0x2'));var express=require(_0x1fce('0x3'));var router=express[_0x1fce('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1fce('0x5'));var config=require(_0x1fce('0x6'));var controller=require(_0x1fce('0x7'));router[_0x1fce('0x8')]('/',auth[_0x1fce('0x9')](),controller['index']);router['get'](_0x1fce('0xa'),auth[_0x1fce('0x9')](),controller['describe']);router[_0x1fce('0x8')]('/:id',auth[_0x1fce('0x9')](),controller['show']);router['get']('/:id/dispositions',auth[_0x1fce('0x9')](),controller[_0x1fce('0xb')]);router[_0x1fce('0x8')](_0x1fce('0xc'),auth['isAuthenticated'](),controller[_0x1fce('0xd')]);router[_0x1fce('0x8')](_0x1fce('0xe'),auth[_0x1fce('0x9')](),controller[_0x1fce('0xf')]);router[_0x1fce('0x8')](_0x1fce('0x10'),auth[_0x1fce('0x9')](),controller[_0x1fce('0x11')]);router[_0x1fce('0x8')](_0x1fce('0x12'),auth['isAuthenticated'](),controller[_0x1fce('0x13')]);router['get'](_0x1fce('0x14'),auth[_0x1fce('0x9')](),controller[_0x1fce('0x15')]);router[_0x1fce('0x8')]('/:id/messages',auth[_0x1fce('0x9')](),controller[_0x1fce('0x16')]);router[_0x1fce('0x8')](_0x1fce('0x17'),auth[_0x1fce('0x9')](),controller['verifySmtp']);router[_0x1fce('0x8')](_0x1fce('0x18'),auth[_0x1fce('0x9')](),controller[_0x1fce('0x19')]);router[_0x1fce('0x1a')](_0x1fce('0x1b'),auth[_0x1fce('0x9')](),controller['addDisposition']);router[_0x1fce('0x1a')](_0x1fce('0xc'),auth[_0x1fce('0x9')](),controller[_0x1fce('0x1c')]);router[_0x1fce('0x1a')]('/',auth['isAuthenticated'](),controller[_0x1fce('0x1d')]);router[_0x1fce('0x1a')](_0x1fce('0xe'),auth[_0x1fce('0x9')](),controller[_0x1fce('0x1e')]);router[_0x1fce('0x1a')](_0x1fce('0x10'),auth[_0x1fce('0x9')](),controller[_0x1fce('0x1f')]);router[_0x1fce('0x1a')](_0x1fce('0x12'),auth[_0x1fce('0x9')](),controller['addInteraction']);router['post'](_0x1fce('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0x1fce('0x1a')](_0x1fce('0x20'),auth['isAuthenticated'](),controller[_0x1fce('0x21')]);router[_0x1fce('0x1a')](_0x1fce('0x18'),auth[_0x1fce('0x9')](),controller[_0x1fce('0x22')]);router[_0x1fce('0x23')](_0x1fce('0x24'),auth['isAuthenticated'](),controller[_0x1fce('0x25')]);router[_0x1fce('0x26')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x1fce('0x27')]);router[_0x1fce('0x26')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1fce('0x28')]);router[_0x1fce('0x26')](_0x1fce('0xe'),auth[_0x1fce('0x9')](),controller[_0x1fce('0x29')]);router['delete'](_0x1fce('0x10'),auth[_0x1fce('0x9')](),controller[_0x1fce('0x2a')]);router[_0x1fce('0x26')]('/:id',auth['isAuthenticated'](),controller[_0x1fce('0x2b')]);router[_0x1fce('0x26')]('/:id/users',auth[_0x1fce('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x0b68=['removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','getDispositions','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','put','update','delete','/:id/dispositions','removeDispositions'];(function(_0x376c6d,_0x50a35f){var _0xb9df10=function(_0x2b0737){while(--_0x2b0737){_0x376c6d['push'](_0x376c6d['shift']());}};_0xb9df10(++_0x50a35f);}(_0x0b68,0x191));var _0x80b6=function(_0x717c93,_0x5945d4){_0x717c93=_0x717c93-0x0;var _0x37ee31=_0x0b68[_0x717c93];return _0x37ee31;};'use strict';var multer=require(_0x80b6('0x0'));var util=require(_0x80b6('0x1'));var path=require('path');var timeout=require(_0x80b6('0x2'));var express=require(_0x80b6('0x3'));var router=express[_0x80b6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x80b6('0x5'));var interaction=require(_0x80b6('0x6'));var config=require(_0x80b6('0x7'));var controller=require('./mailAccount.controller');router[_0x80b6('0x8')]('/',auth[_0x80b6('0x9')](),controller[_0x80b6('0xa')]);router[_0x80b6('0x8')]('/describe',auth[_0x80b6('0x9')](),controller[_0x80b6('0xb')]);router[_0x80b6('0x8')]('/:id',auth[_0x80b6('0x9')](),controller['show']);router[_0x80b6('0x8')]('/:id/dispositions',auth[_0x80b6('0x9')](),controller[_0x80b6('0xc')]);router[_0x80b6('0x8')]('/:id/canned_answers',auth[_0x80b6('0x9')](),controller[_0x80b6('0xd')]);router['get'](_0x80b6('0xe'),auth[_0x80b6('0x9')](),controller['getImap']);router[_0x80b6('0x8')](_0x80b6('0xf'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x10')]);router[_0x80b6('0x8')](_0x80b6('0x11'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x12')]);router[_0x80b6('0x8')](_0x80b6('0x13'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x14')]);router[_0x80b6('0x8')]('/:id/messages',auth[_0x80b6('0x9')](),controller[_0x80b6('0x15')]);router[_0x80b6('0x8')]('/:id/verify',auth[_0x80b6('0x9')](),controller[_0x80b6('0x16')]);router[_0x80b6('0x8')](_0x80b6('0x17'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x18')]);router[_0x80b6('0x19')]('/:id/dispositions',auth[_0x80b6('0x9')](),controller[_0x80b6('0x1a')]);router[_0x80b6('0x19')](_0x80b6('0x1b'),auth[_0x80b6('0x9')](),controller['addAnswer']);router['post']('/',auth[_0x80b6('0x9')](),controller['create']);router['post'](_0x80b6('0xe'),auth['isAuthenticated'](),controller[_0x80b6('0x1c')]);router[_0x80b6('0x19')](_0x80b6('0xf'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x1d')]);router[_0x80b6('0x19')](_0x80b6('0x11'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x1e')]);router[_0x80b6('0x19')](_0x80b6('0x13'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x1f')]);router[_0x80b6('0x19')](_0x80b6('0x20'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x21')]);router['post']('/:id/users',auth[_0x80b6('0x9')](),controller['addAgents']);router[_0x80b6('0x22')]('/:id',auth[_0x80b6('0x9')](),controller[_0x80b6('0x23')]);router[_0x80b6('0x24')](_0x80b6('0x25'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x26')]);router[_0x80b6('0x24')](_0x80b6('0x1b'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x27')]);router[_0x80b6('0x24')](_0x80b6('0xe'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x28')]);router['delete']('/:id/out_servers',auth[_0x80b6('0x9')](),controller[_0x80b6('0x29')]);router[_0x80b6('0x24')]('/:id',auth[_0x80b6('0x9')](),controller[_0x80b6('0x2a')]);router[_0x80b6('0x24')]('/:id/users',auth[_0x80b6('0x9')](),controller[_0x80b6('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 4a6ce8b..ba34486 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 _0x9d92=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0x9d92,0xdf));var _0x29d9=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x9d92[_0x49c057];return _0xd8f0e6;};'use strict';var Sequelize=require(_0x29d9('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x29d9('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x29d9('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x29d9('0x3')]},'markAsUnread':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x29d9('0x1')],'allowNull':![],'defaultValue':_0x29d9('0x4')},'fontSize':{'type':Sequelize[_0x29d9('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x29d9('0x3')],'defaultValue':function(){return _0x29d9('0x6');}},'notificationSound':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x29d9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x29d9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':![],'comment':_0x29d9('0x7'),'set':function(_0x1a8f11){if(!_0x1a8f11)this['setDataValue'](_0x29d9('0x8'),null);this[_0x29d9('0x9')](_0x29d9('0xa'),_0x1a8f11);}}}; \ No newline at end of file +var _0x34e5=['BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e5,0x172));var _0x534e=function(_0x3935fc,_0x456432){_0x3935fc=_0x3935fc-0x0;var _0x1a2e23=_0x34e5[_0x3935fc];return _0x1a2e23;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x534e('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x534e('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x534e('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x534e('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x534e('0x1')],'allowNull':![],'defaultValue':_0x534e('0x3')},'fontSize':{'type':Sequelize[_0x534e('0x4')](0x2)[_0x534e('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x534e('0x6')],'defaultValue':function(){return _0x534e('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x534e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x534e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x534e('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x534e('0x9'),'set':function(_0x310b6d){if(!_0x310b6d)this[_0x534e('0xa')]('mandatoryDispositionPauseId',null);this[_0x534e('0xa')](_0x534e('0xb'),_0x310b6d);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 761b9d9..546dccc 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 _0x49a1=['CannedAnswer','getAnswers','include','removeAnswers','ids','email','ListId','active','isNil','cservice','cauthentication','user','cuser','pass','authentication','host','port','service','role','UserProfileSection','userProfileId','getImap','addImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','format','%s\x20<%s>','attachments','join','server/files/attachments','auth','secure','SendMail','messageId','from','subject','attach','out','Interaction','VerifySmtp','verifySmtp','Sequelize','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./mailAccount.socket','register','client','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','status','undefined','limit','offset','count','Content-Range','json','reject','update','then','destroy','get','MailAccounts','UserProfileResource','end','sendStatus','stack','name','send','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','Imap','intersection','find','body','params','describe','addDisposition','create','getDispositions','findOne','Disposition','nolimit','pick','MailAccountId','removeDispositions','addAnswer'];(function(_0x47b1a9,_0x14e74f){var _0x1be6e2=function(_0x8c39be){while(--_0x8c39be){_0x47b1a9['push'](_0x47b1a9['shift']());}};_0x1be6e2(++_0x14e74f);}(_0x49a1,0x118));var _0x149a=function(_0x578bf8,_0x14cfa5){_0x578bf8=_0x578bf8-0x0;var _0x58aa80=_0x49a1[_0x578bf8];return _0x58aa80;};'use strict';var emlformat=require(_0x149a('0x0'));var rimraf=require(_0x149a('0x1'));var zipdir=require(_0x149a('0x2'));var jsonpatch=require(_0x149a('0x3'));var rp=require('request-promise');var moment=require(_0x149a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x149a('0x5'));var util=require(_0x149a('0x6'));var path=require('path');var sox=require(_0x149a('0x7'));var csv=require('to-csv');var ejs=require(_0x149a('0x8'));var fs=require('fs');var fs_extra=require(_0x149a('0x9'));var _=require(_0x149a('0xa'));var squel=require(_0x149a('0xb'));var crypto=require('crypto');var jsforce=require(_0x149a('0xc'));var deskjs=require(_0x149a('0xd'));var toCsv=require(_0x149a('0xe'));var querystring=require(_0x149a('0xf'));var Papa=require(_0x149a('0x10'));var htmlToText=require(_0x149a('0x11'));var juice=require('juice');var Redis=require(_0x149a('0x12'));var authService=require(_0x149a('0x13'));var qs=require(_0x149a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x149a('0x15'));var logger=require(_0x149a('0x16'))('api');var utils=require(_0x149a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x149a('0x18'));var db=require(_0x149a('0x19'))['db'];config[_0x149a('0x1a')]=_['defaults'](config[_0x149a('0x1a')],{'host':_0x149a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x149a('0x1a')]));require(_0x149a('0x1c'))[_0x149a('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x149a('0x1e')]['http']({'port':0x232b});function respondWithRpcPromise(_0xa710c5,_0x129c9d,_0x4ff875,_0x2a8b2e){return new BPromise(function(_0x852a7,_0x62ad85){var _0x58edb8=_0x2a8b2e||client;return _0x58edb8[_0x149a('0x1f')](_0xa710c5,_0x4ff875)['then'](function(_0x4292e4){logger[_0x149a('0x20')]('MailAccount,\x20%s,\x20%s',_0x129c9d,_0x149a('0x21'));logger[_0x149a('0x22')](_0x149a('0x23'),_0x129c9d,_0x149a('0x21'),JSON[_0x149a('0x24')](_0x4292e4));if(_0x4292e4['error']){if(_0x4292e4[_0x149a('0x25')][_0x149a('0x26')]===0x1f4){logger[_0x149a('0x25')](_0x149a('0x27'),_0x129c9d,_0x4292e4['error']['message']);return _0x62ad85(_0x4292e4[_0x149a('0x25')][_0x149a('0x28')]);}logger[_0x149a('0x25')](_0x149a('0x27'),_0x129c9d,_0x4292e4[_0x149a('0x25')][_0x149a('0x28')]);return _0x852a7(_0x4292e4[_0x149a('0x25')][_0x149a('0x28')]);}else{logger[_0x149a('0x20')](_0x149a('0x27'),_0x129c9d,_0x149a('0x21'));_0x852a7(_0x4292e4[_0x149a('0x29')][_0x149a('0x28')]);}})[_0x149a('0x2a')](function(_0x1c6fa3){logger[_0x149a('0x25')]('MailAccount,\x20%s,\x20%s',_0x129c9d,_0x1c6fa3);_0x62ad85(_0x1c6fa3);});});}function respondWithStatusCode(_0x4bf07e,_0x1bcffb){_0x1bcffb=_0x1bcffb||0xcc;return function(_0x48148b){if(_0x48148b){return _0x4bf07e['sendStatus'](_0x1bcffb);}return _0x4bf07e[_0x149a('0x2b')](_0x1bcffb)['end']();};}function respondWithResult(_0x2d3fd5,_0x4ea823){_0x4ea823=_0x4ea823||0xc8;return function(_0x1c8e58){if(_0x1c8e58){return _0x2d3fd5[_0x149a('0x2b')](_0x4ea823)['json'](_0x1c8e58);}};}function respondWithFilteredResult(_0x662d37,_0x555b37){return function(_0x14db32){if(_0x14db32){var _0xbc7483=typeof _0x555b37['offset']===_0x149a('0x2c')&&typeof _0x555b37[_0x149a('0x2d')]==='undefined';var _0x410456=_0x14db32['count'];var _0x5692e8=_0xbc7483?0x0:_0x555b37[_0x149a('0x2e')];var _0x5cf0e0=_0xbc7483?_0x14db32[_0x149a('0x2f')]:_0x555b37[_0x149a('0x2e')]+_0x555b37['limit'];var _0x1f6dcc;if(_0x5cf0e0>=_0x410456){_0x5cf0e0=_0x410456;_0x1f6dcc=0xc8;}else{_0x1f6dcc=0xce;}_0x662d37[_0x149a('0x2b')](_0x1f6dcc);return _0x662d37['set'](_0x149a('0x30'),_0x5692e8+'-'+_0x5cf0e0+'/'+_0x410456)[_0x149a('0x31')](_0x14db32);}return null;};}function patchUpdates(_0x20014e){return function(_0x317bfb){try{jsonpatch['apply'](_0x317bfb,_0x20014e,!![]);}catch(_0x561b55){return BPromise[_0x149a('0x32')](_0x561b55);}return _0x317bfb['save']();};}function saveUpdates(_0x17780e,_0x54df45){return function(_0x5a6aa3){if(_0x5a6aa3){return _0x5a6aa3[_0x149a('0x33')](_0x17780e)[_0x149a('0x34')](function(_0x1db5c5){return _0x1db5c5;});}return null;};}function removeEntity(_0x43f256,_0x2044f2){return function(_0x54bdcf){if(_0x54bdcf){return _0x54bdcf[_0x149a('0x35')]()[_0x149a('0x34')](function(){var _0x59695e=_0x54bdcf[_0x149a('0x36')]({'plain':!![]});var _0x1f6620=_0x149a('0x37');return db[_0x149a('0x38')][_0x149a('0x35')]({'where':{'type':_0x1f6620,'resourceId':_0x59695e['id']}})[_0x149a('0x34')](function(){return _0x54bdcf;});})[_0x149a('0x34')](function(){_0x43f256['status'](0xcc)[_0x149a('0x39')]();});}};}function handleEntityNotFound(_0x42d2c5,_0x262e3a){return function(_0xb5934a){if(!_0xb5934a){_0x42d2c5[_0x149a('0x3a')](0x194);}return _0xb5934a;};}function handleError(_0x5a7ba0,_0x4c28e7){_0x4c28e7=_0x4c28e7||0x1f4;return function(_0x144c0f){logger['error'](_0x144c0f[_0x149a('0x3b')]);if(_0x144c0f[_0x149a('0x3c')]){delete _0x144c0f[_0x149a('0x3c')];}_0x5a7ba0[_0x149a('0x2b')](_0x4c28e7)[_0x149a('0x3d')](_0x144c0f);};}exports[_0x149a('0x3e')]=function(_0x812097,_0x4d6920){var _0x733d01={'include':[{'model':db[_0x149a('0x3f')],'as':'Imap'},{'model':db[_0x149a('0x40')],'as':_0x149a('0x41')},{'model':db[_0x149a('0x42')],'as':_0x149a('0x43')}]},_0x17befe={},_0x43ce9f={'count':0x0,'rows':[]};var _0x5316f7=_[_0x149a('0x44')](db[_0x149a('0x45')][_0x149a('0x46')],function(_0x40983d){return{'name':_0x40983d['fieldName'],'type':_0x40983d[_0x149a('0x47')][_0x149a('0x48')]};});_0x17befe[_0x149a('0x49')]=_[_0x149a('0x44')](_0x5316f7,_0x149a('0x3c'));_0x17befe[_0x149a('0x4a')]=_[_0x149a('0x4b')](_0x812097[_0x149a('0x4a')]);_0x17befe[_0x149a('0x4c')]=_['intersection'](_0x17befe[_0x149a('0x49')],_0x17befe[_0x149a('0x4a')]);_0x733d01[_0x149a('0x4d')]=_['intersection'](_0x17befe[_0x149a('0x49')],qs[_0x149a('0x4e')](_0x812097[_0x149a('0x4a')][_0x149a('0x4e')]));_0x733d01[_0x149a('0x4d')]=_0x733d01['attributes'][_0x149a('0x4f')]?_0x733d01['attributes']:_0x17befe[_0x149a('0x49')];if(!_0x812097[_0x149a('0x4a')][_0x149a('0x50')]('nolimit')){_0x733d01[_0x149a('0x2d')]=qs[_0x149a('0x2d')](_0x812097['query'][_0x149a('0x2d')]);_0x733d01[_0x149a('0x2e')]=qs[_0x149a('0x2e')](_0x812097[_0x149a('0x4a')][_0x149a('0x2e')]);}_0x733d01[_0x149a('0x51')]=qs[_0x149a('0x52')](_0x812097[_0x149a('0x4a')][_0x149a('0x52')]);_0x733d01[_0x149a('0x53')]=qs['filters'](_['pick'](_0x812097[_0x149a('0x4a')],_0x17befe[_0x149a('0x4c')]),_0x5316f7);if(_0x812097[_0x149a('0x4a')][_0x149a('0x54')]){_0x733d01[_0x149a('0x53')]=_[_0x149a('0x55')](_0x733d01['where'],{'$or':_[_0x149a('0x44')](_0x5316f7,function(_0x448edd){if(_0x448edd[_0x149a('0x47')]!==_0x149a('0x56')){var _0x597722={};_0x597722[_0x448edd['name']]={'$like':'%'+_0x812097[_0x149a('0x4a')][_0x149a('0x54')]+'%'};return _0x597722;}})});}_0x733d01=_[_0x149a('0x55')]({},_0x733d01,_0x812097[_0x149a('0x57')]);var _0x787ada={'where':_0x733d01[_0x149a('0x53')]};return db[_0x149a('0x45')]['count'](_0x787ada)['then'](function(_0x3cf91e){_0x43ce9f['count']=_0x3cf91e;if(_0x812097['query'][_0x149a('0x58')]){_0x733d01['include']=[{'all':!![]}];}return db[_0x149a('0x45')][_0x149a('0x59')](_0x733d01);})['then'](function(_0x2fbaab){_0x43ce9f[_0x149a('0x5a')]=_0x2fbaab;return _0x43ce9f;})['then'](respondWithFilteredResult(_0x4d6920,_0x733d01))['catch'](handleError(_0x4d6920,null));};exports[_0x149a('0x5b')]=function(_0x574ee4,_0x32b0fe){var _0x3b36c3={'raw':![],'where':{'id':_0x574ee4['params']['id']},'include':[{'model':db[_0x149a('0x3f')],'as':_0x149a('0x5c')},{'model':db[_0x149a('0x40')],'as':_0x149a('0x41')},{'model':db['Pause'],'as':_0x149a('0x43')}]},_0xf9919={};_0xf9919['model']=_[_0x149a('0x4b')](db[_0x149a('0x45')][_0x149a('0x46')]);_0xf9919[_0x149a('0x4a')]=_[_0x149a('0x4b')](_0x574ee4[_0x149a('0x4a')]);_0xf9919[_0x149a('0x4c')]=_[_0x149a('0x5d')](_0xf9919[_0x149a('0x49')],_0xf9919['query']);_0x3b36c3['attributes']=_['intersection'](_0xf9919[_0x149a('0x49')],qs[_0x149a('0x4e')](_0x574ee4[_0x149a('0x4a')][_0x149a('0x4e')]));_0x3b36c3[_0x149a('0x4d')]=_0x3b36c3[_0x149a('0x4d')]['length']?_0x3b36c3[_0x149a('0x4d')]:_0xf9919['model'];if(_0x574ee4[_0x149a('0x4a')][_0x149a('0x58')]){_0x3b36c3['include']=[{'all':!![]}];}_0x3b36c3=_[_0x149a('0x55')]({},_0x3b36c3,_0x574ee4[_0x149a('0x57')]);return db['MailAccount'][_0x149a('0x5e')](_0x3b36c3)[_0x149a('0x34')](handleEntityNotFound(_0x32b0fe,null))['then'](respondWithResult(_0x32b0fe,null))[_0x149a('0x2a')](handleError(_0x32b0fe,null));};exports[_0x149a('0x33')]=function(_0x3b29ad,_0x153b69){if(_0x3b29ad['body']['id']){delete _0x3b29ad[_0x149a('0x5f')]['id'];}return db['MailAccount'][_0x149a('0x5e')]({'where':{'id':_0x3b29ad[_0x149a('0x60')]['id']},'include':[{'model':db[_0x149a('0x3f')],'as':_0x149a('0x5c')},{'model':db[_0x149a('0x40')],'as':'Smtp'},{'model':db[_0x149a('0x42')],'as':_0x149a('0x43')}]})[_0x149a('0x34')](handleEntityNotFound(_0x153b69,null))[_0x149a('0x34')](saveUpdates(_0x3b29ad[_0x149a('0x5f')],null))[_0x149a('0x34')](function(_0x525b07){if(_0x525b07&&_0x3b29ad[_0x149a('0x5f')][_0x149a('0x5c')]){return db[_0x149a('0x3f')][_0x149a('0x33')](_0x3b29ad['body']['Imap'],{'where':{'MailAccountId':_0x525b07['id']}})[_0x149a('0x34')](function(){return _0x525b07;});}return _0x525b07;})[_0x149a('0x34')](function(_0xf63135){if(_0xf63135&&_0x3b29ad[_0x149a('0x5f')][_0x149a('0x41')]){return db[_0x149a('0x40')][_0x149a('0x33')](_0x3b29ad[_0x149a('0x5f')][_0x149a('0x41')],{'where':{'MailAccountId':_0xf63135['id']}})[_0x149a('0x34')](function(){return _0xf63135;});}return _0xf63135;})['then'](respondWithResult(_0x153b69,null))['catch'](handleError(_0x153b69,null));};exports['describe']=function(_0x2545d2,_0x3980d9){return db[_0x149a('0x45')][_0x149a('0x61')]()[_0x149a('0x34')](respondWithResult(_0x3980d9,null))['catch'](handleError(_0x3980d9,null));};exports[_0x149a('0x62')]=function(_0x516d7f,_0x27bd4b,_0x1eddea){if(_0x516d7f[_0x149a('0x5f')]['id']){delete _0x516d7f[_0x149a('0x5f')]['id'];}return db['MailAccount'][_0x149a('0x5e')]({'where':{'id':_0x516d7f[_0x149a('0x60')]['id']}})['then'](handleEntityNotFound(_0x27bd4b,null))[_0x149a('0x34')](function(_0xc04548){if(_0xc04548){_0x516d7f[_0x149a('0x5f')]['MailAccountId']=_0xc04548['id'];return db['Disposition'][_0x149a('0x63')](_0x516d7f[_0x149a('0x5f')]);}})[_0x149a('0x34')](respondWithResult(_0x27bd4b,null))[_0x149a('0x2a')](handleError(_0x27bd4b,null));};exports[_0x149a('0x64')]=function(_0x50f872,_0x562265,_0xec12ab){var _0x4b9c15={'raw':![],'where':{}};var _0x184553={};var _0x433a15={'count':0x0,'rows':[]};return db[_0x149a('0x45')][_0x149a('0x65')]({'where':{'id':_0x50f872[_0x149a('0x60')]['id']}})['then'](handleEntityNotFound(_0x562265,null))[_0x149a('0x34')](function(_0x3c9c18){if(_0x3c9c18){_0x184553[_0x149a('0x49')]=_[_0x149a('0x4b')](db[_0x149a('0x66')][_0x149a('0x46')]);_0x184553[_0x149a('0x4a')]=_[_0x149a('0x4b')](_0x50f872[_0x149a('0x4a')]);_0x184553['filters']=_[_0x149a('0x5d')](_0x184553[_0x149a('0x49')],_0x184553[_0x149a('0x4a')]);_0x4b9c15[_0x149a('0x4d')]=_[_0x149a('0x5d')](_0x184553['model'],qs[_0x149a('0x4e')](_0x50f872['query'][_0x149a('0x4e')]));_0x4b9c15[_0x149a('0x4d')]=_0x4b9c15[_0x149a('0x4d')][_0x149a('0x4f')]?_0x4b9c15['attributes']:_0x184553[_0x149a('0x49')];if(!_0x50f872[_0x149a('0x4a')]['hasOwnProperty'](_0x149a('0x67'))){_0x4b9c15[_0x149a('0x2d')]=qs[_0x149a('0x2d')](_0x50f872['query'][_0x149a('0x2d')]);_0x4b9c15[_0x149a('0x2e')]=qs[_0x149a('0x2e')](_0x50f872['query'][_0x149a('0x2e')]);}_0x4b9c15['order']=qs['sort'](_0x50f872['query'][_0x149a('0x52')]);_0x4b9c15[_0x149a('0x53')]=qs['filters'](_[_0x149a('0x68')](_0x50f872['query'],_0x184553['filters']));_0x4b9c15[_0x149a('0x53')][_0x149a('0x69')]=_0x3c9c18['id'];if(_0x50f872[_0x149a('0x4a')][_0x149a('0x54')]){_0x4b9c15['where']=_[_0x149a('0x55')](_0x4b9c15[_0x149a('0x53')],{'$or':_['map'](_0x4b9c15['attributes'],function(_0x338565){var _0x26170b={};_0x26170b[_0x338565]={'$like':'%'+_0x50f872[_0x149a('0x4a')]['filter']+'%'};return _0x26170b;})});}_0x4b9c15=_[_0x149a('0x55')]({},_0x4b9c15,_0x50f872[_0x149a('0x57')]);return db[_0x149a('0x66')][_0x149a('0x2f')]({'where':_0x4b9c15[_0x149a('0x53')]})[_0x149a('0x34')](function(_0x5027e1){_0x433a15[_0x149a('0x2f')]=_0x5027e1;if(_0x50f872['query'][_0x149a('0x58')]){_0x4b9c15['include']=[{'all':!![]}];}return db[_0x149a('0x66')][_0x149a('0x59')](_0x4b9c15);})[_0x149a('0x34')](function(_0x508cac){_0x433a15['rows']=_0x508cac;return _0x433a15;});}})[_0x149a('0x34')](respondWithFilteredResult(_0x562265,_0x4b9c15))[_0x149a('0x2a')](handleError(_0x562265,null));};exports['removeDispositions']=function(_0x5bc5d8,_0x3de0ab,_0x3fd8c8){return db[_0x149a('0x45')]['find']({'where':{'id':_0x5bc5d8['params']['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x3de0ab,null))[_0x149a('0x34')](function(_0x4d7a88){if(_0x4d7a88){return _0x4d7a88[_0x149a('0x6a')](_0x5bc5d8[_0x149a('0x4a')]['ids']);}})[_0x149a('0x34')](respondWithStatusCode(_0x3de0ab,null))[_0x149a('0x2a')](handleError(_0x3de0ab,null));};exports[_0x149a('0x6b')]=function(_0x1d08fb,_0x39751c,_0x3e3c41){if(_0x1d08fb[_0x149a('0x5f')]['id']){delete _0x1d08fb['body']['id'];}return db[_0x149a('0x45')][_0x149a('0x5e')]({'where':{'id':_0x1d08fb[_0x149a('0x60')]['id']}})['then'](handleEntityNotFound(_0x39751c,null))[_0x149a('0x34')](function(_0x3055c8){if(_0x3055c8){_0x1d08fb[_0x149a('0x5f')][_0x149a('0x69')]=_0x3055c8['id'];return db[_0x149a('0x6c')]['create'](_0x1d08fb[_0x149a('0x5f')]);}})['then'](respondWithResult(_0x39751c,null))[_0x149a('0x2a')](handleError(_0x39751c,null));};exports[_0x149a('0x6d')]=function(_0x221651,_0x4a52d5,_0x501ae2){var _0x6f613c={'raw':![],'where':{}};var _0x246638={};var _0x2ad32f={'count':0x0,'rows':[]};return db[_0x149a('0x45')][_0x149a('0x65')]({'where':{'id':_0x221651[_0x149a('0x60')]['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x4a52d5,null))[_0x149a('0x34')](function(_0x1899c4){if(_0x1899c4){_0x246638['model']=_[_0x149a('0x4b')](db[_0x149a('0x6c')][_0x149a('0x46')]);_0x246638[_0x149a('0x4a')]=_[_0x149a('0x4b')](_0x221651[_0x149a('0x4a')]);_0x246638[_0x149a('0x4c')]=_['intersection'](_0x246638[_0x149a('0x49')],_0x246638['query']);_0x6f613c[_0x149a('0x4d')]=_[_0x149a('0x5d')](_0x246638[_0x149a('0x49')],qs[_0x149a('0x4e')](_0x221651[_0x149a('0x4a')]['fields']));_0x6f613c['attributes']=_0x6f613c['attributes'][_0x149a('0x4f')]?_0x6f613c[_0x149a('0x4d')]:_0x246638[_0x149a('0x49')];if(!_0x221651[_0x149a('0x4a')]['hasOwnProperty'](_0x149a('0x67'))){_0x6f613c[_0x149a('0x2d')]=qs[_0x149a('0x2d')](_0x221651[_0x149a('0x4a')][_0x149a('0x2d')]);_0x6f613c[_0x149a('0x2e')]=qs[_0x149a('0x2e')](_0x221651[_0x149a('0x4a')][_0x149a('0x2e')]);}_0x6f613c['order']=qs[_0x149a('0x52')](_0x221651[_0x149a('0x4a')][_0x149a('0x52')]);_0x6f613c[_0x149a('0x53')]=qs[_0x149a('0x4c')](_[_0x149a('0x68')](_0x221651[_0x149a('0x4a')],_0x246638[_0x149a('0x4c')]));_0x6f613c[_0x149a('0x53')][_0x149a('0x69')]=_0x1899c4['id'];if(_0x221651[_0x149a('0x4a')]['filter']){_0x6f613c[_0x149a('0x53')]=_['merge'](_0x6f613c[_0x149a('0x53')],{'$or':_[_0x149a('0x44')](_0x6f613c['attributes'],function(_0x523895){var _0x399344={};_0x399344[_0x523895]={'$like':'%'+_0x221651['query'][_0x149a('0x54')]+'%'};return _0x399344;})});}_0x6f613c=_[_0x149a('0x55')]({},_0x6f613c,_0x221651[_0x149a('0x57')]);return db[_0x149a('0x6c')][_0x149a('0x2f')]({'where':_0x6f613c[_0x149a('0x53')]})[_0x149a('0x34')](function(_0x1da0c6){_0x2ad32f[_0x149a('0x2f')]=_0x1da0c6;if(_0x221651[_0x149a('0x4a')][_0x149a('0x58')]){_0x6f613c[_0x149a('0x6e')]=[{'all':!![]}];}return db[_0x149a('0x6c')][_0x149a('0x59')](_0x6f613c);})[_0x149a('0x34')](function(_0x51a945){_0x2ad32f[_0x149a('0x5a')]=_0x51a945;return _0x2ad32f;});}})[_0x149a('0x34')](respondWithFilteredResult(_0x4a52d5,_0x6f613c))[_0x149a('0x2a')](handleError(_0x4a52d5,null));};exports[_0x149a('0x6f')]=function(_0x4c0714,_0x4a72f2,_0x5882e6){return db[_0x149a('0x45')][_0x149a('0x5e')]({'where':{'id':_0x4c0714[_0x149a('0x60')]['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x4a72f2,null))[_0x149a('0x34')](function(_0x3f1344){if(_0x3f1344){return _0x3f1344[_0x149a('0x6f')](_0x4c0714[_0x149a('0x4a')][_0x149a('0x70')]);}})[_0x149a('0x34')](respondWithStatusCode(_0x4a72f2,null))['catch'](handleError(_0x4a72f2,null));};exports['create']=function(_0x3bc90c,_0x25bd4f){var _0xc23b7f={'name':_0x3bc90c[_0x149a('0x5f')]['name'],'key':_0x3bc90c['body']['key'],'email':_0x3bc90c[_0x149a('0x5f')][_0x149a('0x71')],'ListId':_0x3bc90c[_0x149a('0x5f')][_0x149a('0x72')],'active':!_['isNil'](_0x3bc90c['body'][_0x149a('0x73')])?_0x3bc90c['body'][_0x149a('0x73')]:!![],'description':_0x3bc90c[_0x149a('0x5f')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x149a('0x74')](_0x3bc90c[_0x149a('0x5f')][_0x149a('0x75')])){if(_0x3bc90c[_0x149a('0x5f')][_0x149a('0x76')]){_0xc23b7f['Imap'][_0x149a('0x77')]=_0xc23b7f['Smtp'][_0x149a('0x77')]=_0x3bc90c[_0x149a('0x5f')][_0x149a('0x78')];_0xc23b7f[_0x149a('0x5c')]['password']=_0xc23b7f['Smtp'][_0x149a('0x79')]=_0x3bc90c['body']['cpassword'];}else{_0xc23b7f[_0x149a('0x5c')][_0x149a('0x7a')]=_0xc23b7f[_0x149a('0x41')]['authentication']=![];}_0xc23b7f[_0x149a('0x5c')][_0x149a('0x7b')]=_0x3bc90c['body']['Imap'][_0x149a('0x7b')];_0xc23b7f[_0x149a('0x5c')]['port']=_0x3bc90c[_0x149a('0x5f')][_0x149a('0x5c')][_0x149a('0x7c')];_0xc23b7f['Smtp'][_0x149a('0x7b')]=_0x3bc90c[_0x149a('0x5f')][_0x149a('0x41')]['host'];_0xc23b7f[_0x149a('0x41')][_0x149a('0x7c')]=_0x3bc90c[_0x149a('0x5f')][_0x149a('0x41')][_0x149a('0x7c')];}else{_0xc23b7f['Imap']['service']=_0xc23b7f[_0x149a('0x41')][_0x149a('0x7d')]=_0x3bc90c[_0x149a('0x5f')][_0x149a('0x75')];_0xc23b7f['Imap']['user']=_0xc23b7f[_0x149a('0x41')][_0x149a('0x77')]=_0x3bc90c[_0x149a('0x5f')][_0x149a('0x78')];_0xc23b7f[_0x149a('0x5c')]['password']=_0xc23b7f['Smtp']['pass']=_0x3bc90c[_0x149a('0x5f')]['cpassword'];}return db[_0x149a('0x45')]['create'](_0xc23b7f,{'include':[{'model':db[_0x149a('0x40')],'as':_0x149a('0x41')},{'model':db[_0x149a('0x3f')],'as':_0x149a('0x5c')}]})[_0x149a('0x34')](function(_0x37af46){var _0xa2cf6e=_0x3bc90c[_0x149a('0x77')]['get']({'plain':!![]});if(!_0xa2cf6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa2cf6e[_0x149a('0x7e')]===_0x149a('0x77')){var _0x488c8d=_0x37af46[_0x149a('0x36')]({'plain':!![]});return db[_0x149a('0x7f')][_0x149a('0x5e')]({'where':{'name':_0x149a('0x37'),'userProfileId':_0xa2cf6e[_0x149a('0x80')]},'raw':!![]})['then'](function(_0x5655ab){if(_0x5655ab&&_0x5655ab['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x488c8d[_0x149a('0x3c')],'resourceId':_0x488c8d['id'],'type':_0x5655ab[_0x149a('0x3c')],'sectionId':_0x5655ab['id']},{})['then'](function(){return _0x37af46;});}else{return _0x37af46;}})[_0x149a('0x2a')](function(_0x190e8d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x190e8d);throw _0x190e8d;});}return _0x37af46;})[_0x149a('0x34')](respondWithResult(_0x25bd4f,0xc9))[_0x149a('0x2a')](handleError(_0x25bd4f,null));};exports[_0x149a('0x81')]=function(_0x3ec9e4,_0x20e0c9,_0x289b5a){return db[_0x149a('0x45')][_0x149a('0x65')]({'where':{'id':_0x3ec9e4[_0x149a('0x60')]['id']}})['then'](handleEntityNotFound(_0x20e0c9,null))[_0x149a('0x34')](function(_0x3a94d0){if(_0x3a94d0){return _0x3a94d0[_0x149a('0x81')]();}return null;})[_0x149a('0x34')](respondWithResult(_0x20e0c9,null))[_0x149a('0x2a')](handleError(_0x20e0c9,null));};exports[_0x149a('0x82')]=function(_0xc08485,_0x5b4cc1,_0x26a8da){if(_0xc08485[_0x149a('0x5f')]['id']){delete _0xc08485[_0x149a('0x5f')]['id'];}return db[_0x149a('0x45')][_0x149a('0x5e')]({'where':{'id':_0xc08485[_0x149a('0x60')]['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x5b4cc1,null))['then'](function(_0x3e5e50){if(_0x3e5e50){_0xc08485[_0x149a('0x5f')][_0x149a('0x69')]=_0x3e5e50['id'];return db[_0x149a('0x3f')][_0x149a('0x63')](_0xc08485[_0x149a('0x5f')]);}})[_0x149a('0x34')](respondWithResult(_0x5b4cc1,null))[_0x149a('0x2a')](handleError(_0x5b4cc1,null));};exports['removeImap']=function(_0x375fe8,_0x54f20b,_0x1bee29){return db['MailAccount']['findOne']({'where':{'id':_0x375fe8['params']['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x54f20b,null))[_0x149a('0x34')](function(_0x117049){if(_0x117049){return _0x117049[_0x149a('0x83')](null);}return null;})['then'](respondWithStatusCode(_0x54f20b,null))[_0x149a('0x2a')](handleError(_0x54f20b,null));};exports[_0x149a('0x84')]=function(_0x10e63e,_0xa94811,_0x230059){return db[_0x149a('0x45')]['findOne']({'where':{'id':_0x10e63e[_0x149a('0x60')]['id']}})[_0x149a('0x34')](handleEntityNotFound(_0xa94811,null))[_0x149a('0x34')](function(_0x422f2c){if(_0x422f2c){return _0x422f2c['getSmtp']();}return null;})['then'](respondWithResult(_0xa94811,null))['catch'](handleError(_0xa94811,null));};exports['addSmtp']=function(_0x6fcaf3,_0x483d0c,_0x5903f6){if(_0x6fcaf3['body']['id']){delete _0x6fcaf3[_0x149a('0x5f')]['id'];}return db['MailAccount'][_0x149a('0x5e')]({'where':{'id':_0x6fcaf3['params']['id']}})['then'](handleEntityNotFound(_0x483d0c,null))[_0x149a('0x34')](function(_0x3544da){if(_0x3544da){_0x6fcaf3[_0x149a('0x5f')][_0x149a('0x69')]=_0x3544da['id'];return db[_0x149a('0x40')][_0x149a('0x63')](_0x6fcaf3['body']);}})['then'](respondWithResult(_0x483d0c,null))[_0x149a('0x2a')](handleError(_0x483d0c,null));};exports[_0x149a('0x85')]=function(_0x3b5fb0,_0xc6e8b0,_0x112138){return db[_0x149a('0x45')]['findOne']({'where':{'id':_0x3b5fb0[_0x149a('0x60')]['id']}})['then'](handleEntityNotFound(_0xc6e8b0,null))[_0x149a('0x34')](function(_0x18f70f){if(_0x18f70f){return _0x18f70f[_0x149a('0x86')](null);}return null;})[_0x149a('0x34')](respondWithStatusCode(_0xc6e8b0,null))['catch'](handleError(_0xc6e8b0,null));};exports[_0x149a('0x87')]=function(_0x36b4ed,_0x361c5e,_0x230972){return db[_0x149a('0x88')]['find']({'where':{'id':_0x36b4ed[_0x149a('0x60')]['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x361c5e,null))[_0x149a('0x34')](function(_0x5d6cb2){if(_0x5d6cb2){return _0x5d6cb2[_0x149a('0x87')](_0x36b4ed[_0x149a('0x5f')][_0x149a('0x70')],_[_0x149a('0x89')](_0x36b4ed[_0x149a('0x5f')],['ids','id'])||{});}})[_0x149a('0x34')](respondWithResult(_0x361c5e,null))[_0x149a('0x2a')](handleError(_0x361c5e,null));};exports[_0x149a('0x8a')]=function(_0x412db5,_0x2bd8a8,_0x1224e6){var _0x3f5976={'raw':![],'where':{}};var _0x1fa2bf={};var _0x3a5685={'count':0x0,'rows':[]};return db[_0x149a('0x45')][_0x149a('0x65')]({'where':{'id':_0x412db5[_0x149a('0x60')]['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x2bd8a8,null))['then'](function(_0x3d3411){if(_0x3d3411){_0x1fa2bf[_0x149a('0x49')]=_['keys'](db[_0x149a('0x88')]['rawAttributes']);_0x1fa2bf[_0x149a('0x4a')]=_[_0x149a('0x4b')](_0x412db5[_0x149a('0x4a')]);_0x1fa2bf['filters']=_['intersection'](_0x1fa2bf['model'],_0x1fa2bf[_0x149a('0x4a')]);_0x3f5976[_0x149a('0x4d')]=_[_0x149a('0x5d')](_0x1fa2bf[_0x149a('0x49')],qs[_0x149a('0x4e')](_0x412db5[_0x149a('0x4a')][_0x149a('0x4e')]));_0x3f5976[_0x149a('0x4d')]=_0x3f5976[_0x149a('0x4d')][_0x149a('0x4f')]?_0x3f5976[_0x149a('0x4d')]:_0x1fa2bf[_0x149a('0x49')];if(!_0x412db5[_0x149a('0x4a')][_0x149a('0x50')](_0x149a('0x67'))){_0x3f5976[_0x149a('0x2d')]=qs[_0x149a('0x2d')](_0x412db5['query']['limit']);_0x3f5976[_0x149a('0x2e')]=qs[_0x149a('0x2e')](_0x412db5[_0x149a('0x4a')][_0x149a('0x2e')]);}_0x3f5976['order']=qs[_0x149a('0x52')](_0x412db5[_0x149a('0x4a')][_0x149a('0x52')]);_0x3f5976['where']=qs[_0x149a('0x4c')](_[_0x149a('0x68')](_0x412db5[_0x149a('0x4a')],_0x1fa2bf['filters']));_0x3f5976[_0x149a('0x53')][_0x149a('0x69')]=_0x3d3411['id'];if(_0x412db5['query'][_0x149a('0x54')]){_0x3f5976[_0x149a('0x53')]=_[_0x149a('0x55')](_0x3f5976['where'],{'$or':_[_0x149a('0x44')](_0x3f5976[_0x149a('0x4d')],function(_0x49fb24){var _0x4e1db9={};_0x4e1db9[_0x49fb24]={'$like':'%'+_0x412db5[_0x149a('0x4a')]['filter']+'%'};return _0x4e1db9;})});}_0x3f5976=_['merge']({},_0x3f5976,_0x412db5[_0x149a('0x57')]);return db[_0x149a('0x88')]['count']({'where':_0x3f5976[_0x149a('0x53')]})[_0x149a('0x34')](function(_0x161769){_0x3a5685[_0x149a('0x2f')]=_0x161769;if(_0x412db5[_0x149a('0x4a')][_0x149a('0x58')]){_0x3f5976[_0x149a('0x6e')]=[{'model':db[_0x149a('0x8b')],'as':_0x149a('0x8c'),'required':![]},{'model':db[_0x149a('0x8d')],'as':_0x149a('0x8e'),'attributes':[_0x149a('0x3c'),_0x149a('0x8f'),_0x149a('0x90')],'required':![]},{'model':db[_0x149a('0x91')],'as':_0x149a('0x92'),'attributes':['id',_0x149a('0x3c'),_0x149a('0x93')],'where':_0x412db5[_0x149a('0x4a')][_0x149a('0x94')]?{'id':_0x412db5[_0x149a('0x4a')][_0x149a('0x94')]}:undefined,'required':_0x412db5[_0x149a('0x4a')]['tag']?!![]:![]}];}return db[_0x149a('0x88')][_0x149a('0x59')](_0x3f5976);})[_0x149a('0x34')](function(_0x328f9b){_0x3a5685[_0x149a('0x5a')]=_0x328f9b;return _0x3a5685;});}})[_0x149a('0x34')](respondWithFilteredResult(_0x2bd8a8,_0x3f5976))[_0x149a('0x2a')](handleError(_0x2bd8a8,null));};exports[_0x149a('0x95')]=function(_0x3337ef,_0x572394,_0x24bba0){return db[_0x149a('0x45')]['findOne']({'where':{'id':_0x3337ef[_0x149a('0x60')]['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x572394,null))[_0x149a('0x34')](function(_0x3f2bba){if(_0x3f2bba){return db[_0x149a('0x96')][_0x149a('0x97')](function(_0x3da894){return db[_0x149a('0x98')][_0x149a('0x35')]({'where':{'MailAccountId':_0x3337ef[_0x149a('0x60')]['id']},'transaction':_0x3da894})[_0x149a('0x34')](function(_0x37c40e){var _0x3469dd=_[_0x149a('0x44')](_0x3337ef[_0x149a('0x5f')],function(_0x3b425c){_0x3b425c[_0x149a('0x69')]=_0x3337ef['params']['id'];return _0x3b425c;});return db[_0x149a('0x98')][_0x149a('0x99')](_0x3469dd,{'transaction':_0x3da894});});})[_0x149a('0x34')](function(){return db[_0x149a('0x98')][_0x149a('0x9a')]({'where':{'MailAccountId':_0x3337ef[_0x149a('0x60')]['id']},'order':_0x149a('0x9b')});});}})[_0x149a('0x34')](respondWithResult(_0x572394,null))[_0x149a('0x2a')](handleError(_0x572394,null));};exports[_0x149a('0x9c')]=function(_0x2eaf20,_0x4f2ba3,_0x55fee5){var _0x1eefdc={};var _0x319d45={};var _0x3e8bf8;var _0x43bc3b;return db[_0x149a('0x45')][_0x149a('0x65')]({'where':{'id':_0x2eaf20[_0x149a('0x60')]['id']}})['then'](handleEntityNotFound(_0x4f2ba3,null))['then'](function(_0x447e83){if(_0x447e83){_0x3e8bf8=_0x447e83;_0x319d45[_0x149a('0x49')]=_[_0x149a('0x4b')](db[_0x149a('0x98')]['rawAttributes']);_0x319d45[_0x149a('0x4a')]=_[_0x149a('0x4b')](_0x2eaf20[_0x149a('0x4a')]);_0x319d45[_0x149a('0x4c')]=_[_0x149a('0x5d')](_0x319d45[_0x149a('0x49')],_0x319d45[_0x149a('0x4a')]);_0x1eefdc[_0x149a('0x4d')]=_[_0x149a('0x5d')](_0x319d45[_0x149a('0x49')],qs['fields'](_0x2eaf20[_0x149a('0x4a')][_0x149a('0x4e')]));_0x1eefdc[_0x149a('0x4d')]=_0x1eefdc['attributes'][_0x149a('0x4f')]?_0x1eefdc['attributes']:_0x319d45[_0x149a('0x49')];_0x1eefdc[_0x149a('0x51')]=qs[_0x149a('0x52')](_0x2eaf20[_0x149a('0x4a')][_0x149a('0x52')]);_0x1eefdc[_0x149a('0x53')]=qs['filters'](_['pick'](_0x2eaf20[_0x149a('0x4a')],_0x319d45[_0x149a('0x4c')]));if(_0x2eaf20[_0x149a('0x4a')][_0x149a('0x54')]){_0x1eefdc['where']=_[_0x149a('0x55')](_0x1eefdc[_0x149a('0x53')],{'$or':_[_0x149a('0x44')](_0x1eefdc[_0x149a('0x4d')],function(_0x4870a7){var _0x5297ae={};_0x5297ae[_0x4870a7]={'$like':'%'+_0x2eaf20[_0x149a('0x4a')][_0x149a('0x54')]+'%'};return _0x5297ae;})});}_0x1eefdc=_[_0x149a('0x55')]({},_0x1eefdc,_0x2eaf20[_0x149a('0x57')]);return _0x3e8bf8[_0x149a('0x9c')](_0x1eefdc);}})[_0x149a('0x34')](function(_0x5eee97){if(_0x5eee97){_0x43bc3b=_0x5eee97[_0x149a('0x4f')];if(!_0x2eaf20['query'][_0x149a('0x50')](_0x149a('0x67'))){_0x1eefdc[_0x149a('0x2d')]=qs[_0x149a('0x2d')](_0x2eaf20['query'][_0x149a('0x2d')]);_0x1eefdc[_0x149a('0x2e')]=qs[_0x149a('0x2e')](_0x2eaf20['query'][_0x149a('0x2e')]);}return _0x3e8bf8[_0x149a('0x9c')](_0x1eefdc);}})[_0x149a('0x34')](function(_0x5629e1){if(_0x5629e1){return _0x5629e1?{'count':_0x43bc3b,'rows':_0x5629e1}:null;}})[_0x149a('0x34')](respondWithResult(_0x4f2ba3,null))['catch'](handleError(_0x4f2ba3,null));};exports[_0x149a('0x9d')]=function(_0x28c0b4,_0x2589f4,_0x481c6f){var _0x5db80b={'raw':!![],'where':{}};var _0x4ddd3d={};var _0x31db9d={'count':0x0,'rows':[]};return db[_0x149a('0x45')][_0x149a('0x65')]({'where':{'id':_0x28c0b4[_0x149a('0x60')]['id']}})['then'](handleEntityNotFound(_0x2589f4,null))[_0x149a('0x34')](function(_0xb88305){if(_0xb88305){_0x4ddd3d[_0x149a('0x49')]=_[_0x149a('0x4b')](db[_0x149a('0x9e')]['rawAttributes']);_0x4ddd3d[_0x149a('0x4a')]=_[_0x149a('0x4b')](_0x28c0b4[_0x149a('0x4a')]);_0x4ddd3d['filters']=_[_0x149a('0x5d')](_0x4ddd3d[_0x149a('0x49')],_0x4ddd3d[_0x149a('0x4a')]);_0x5db80b[_0x149a('0x4d')]=_[_0x149a('0x5d')](_0x4ddd3d[_0x149a('0x49')],qs['fields'](_0x28c0b4['query'][_0x149a('0x4e')]));_0x5db80b[_0x149a('0x4d')]=_0x5db80b[_0x149a('0x4d')]['length']?_0x5db80b['attributes']:_0x4ddd3d[_0x149a('0x49')];if(!_0x28c0b4[_0x149a('0x4a')][_0x149a('0x50')](_0x149a('0x67'))){_0x5db80b['limit']=qs[_0x149a('0x2d')](_0x28c0b4[_0x149a('0x4a')]['limit']);_0x5db80b['offset']=qs['offset'](_0x28c0b4['query']['offset']);}_0x5db80b[_0x149a('0x51')]=qs['sort'](_0x28c0b4[_0x149a('0x4a')][_0x149a('0x52')]);_0x5db80b[_0x149a('0x53')]=qs[_0x149a('0x4c')](_[_0x149a('0x68')](_0x28c0b4['query'],_0x4ddd3d[_0x149a('0x4c')]));_0x5db80b[_0x149a('0x53')][_0x149a('0x69')]=_0xb88305['id'];if(_0x28c0b4['query'][_0x149a('0x54')]){_0x5db80b['where']=_[_0x149a('0x55')](_0x5db80b[_0x149a('0x53')],{'$or':_[_0x149a('0x44')](_0x5db80b['attributes'],function(_0x1808a0){var _0x5c6d2d={};_0x5c6d2d[_0x1808a0]={'$like':'%'+_0x28c0b4[_0x149a('0x4a')]['filter']+'%'};return _0x5c6d2d;})});}if(_0x28c0b4[_0x149a('0x4a')][_0x149a('0x9f')]){var _0x46cc98=_0x28c0b4[_0x149a('0x4a')]['$gte'][_0x149a('0xa0')](',');var _0x1a307f={};_0x1a307f[_0x46cc98[0x0]]={'$gte':moment(_0x46cc98[0x1])['format'](_0x149a('0xa1'))};_0x5db80b['where']=_[_0x149a('0x55')](_0x5db80b[_0x149a('0x53')],_0x1a307f);}_0x5db80b=_['merge']({},_0x5db80b,_0x28c0b4[_0x149a('0x57')]);return db['MailMessage'][_0x149a('0x2f')]({'where':_0x5db80b[_0x149a('0x53')]})[_0x149a('0x34')](function(_0x2df52b){_0x31db9d[_0x149a('0x2f')]=_0x2df52b;if(_0x28c0b4[_0x149a('0x4a')][_0x149a('0x58')]){_0x5db80b[_0x149a('0x6e')]=[{'all':!![]}];}return db[_0x149a('0x9e')][_0x149a('0x59')](_0x5db80b);})[_0x149a('0x34')](function(_0x21e80e){if(_0x28c0b4['query'][_0x149a('0xa2')]===_0x149a('0xa3')){for(var _0x358ed2=0x0;_0x358ed2<_0x21e80e[_0x149a('0x4f')];_0x358ed2++){_0x21e80e[_0x358ed2][_0x149a('0x5f')]=juice(_0x21e80e[_0x358ed2][_0x149a('0x5f')]);}}_0x31db9d[_0x149a('0x5a')]=_0x21e80e;return _0x31db9d;});}})[_0x149a('0x34')](respondWithFilteredResult(_0x2589f4,_0x5db80b))[_0x149a('0x2a')](handleError(_0x2589f4,null));};exports[_0x149a('0x3d')]=function(_0xde1344,_0x5a6702,_0x3fd876){var _0x32611d,_0x3b6ba9={},_0x4e4352;if(_0xde1344[_0x149a('0x5f')]['to']){_0x4e4352=_0xde1344[_0x149a('0x5f')]['to'][_0x149a('0xa0')](',')[0x0];}return db[_0x149a('0x45')][_0x149a('0x5e')]({'where':{'id':_0xde1344[_0x149a('0x60')]['id']},'include':[{'model':db[_0x149a('0xa4')],'as':_0x149a('0xa5'),'include':[{'model':db[_0x149a('0x8b')],'as':_0x149a('0xa6'),'where':{'email':_0x4e4352},'limit':0x1,'order':[[_0x149a('0xa7'),_0x149a('0xa8')]]}]},{'model':db[_0x149a('0x40')],'as':_0x149a('0x41'),'raw':!![]}]})[_0x149a('0x34')](handleEntityNotFound(_0x5a6702,null))[_0x149a('0x34')](function(_0x4fd795){if(_0x4fd795){_0x32611d=_0x4fd795;if(_0x4fd795[_0x149a('0x41')]){if(_[_0x149a('0x74')](_0xde1344[_0x149a('0x5f')]['from'])){_0xde1344[_0x149a('0x5f')]['from']=util[_0x149a('0xa9')](_0x149a('0xaa'),_0x4fd795[_0x149a('0x3c')],_0x4fd795[_0x149a('0x71')]||_0x4fd795[_0x149a('0x41')][_0x149a('0x77')]);}if(_0xde1344[_0x149a('0x5f')][_0x149a('0xab')]&&_0xde1344[_0x149a('0x5f')]['attachments'][_0x149a('0x4f')]){for(var _0xc00a16=0x0;_0xc00a16<_0xde1344[_0x149a('0x5f')][_0x149a('0xab')]['length'];_0xc00a16+=0x1){_0xde1344[_0x149a('0x5f')][_0x149a('0xab')][_0xc00a16]={'filename':_0xde1344['body'][_0x149a('0xab')][_0xc00a16][_0x149a('0x3c')],'path':path[_0x149a('0xac')](config['root'],_0x149a('0xad'),_0xde1344[_0x149a('0x5f')][_0x149a('0xab')][_0xc00a16]['basename'])};}}var _0x5770f3={'tls':{'rejectUnauthorized':![]}};if(_[_0x149a('0x74')](_0x4fd795[_0x149a('0x41')]['service'])){if(_0x4fd795[_0x149a('0x41')][_0x149a('0x7a')]){_0x5770f3[_0x149a('0xae')]={'user':_0x4fd795['Smtp']['user'],'pass':_0x4fd795['Smtp']['pass']};}_0x5770f3[_0x149a('0x7b')]=_0x4fd795[_0x149a('0x41')]['host'];_0x5770f3[_0x149a('0x7c')]=_0x4fd795[_0x149a('0x41')][_0x149a('0x7c')];_0x5770f3[_0x149a('0xaf')]=_0x4fd795[_0x149a('0x41')][_0x149a('0xaf')];}else{_0x5770f3[_0x149a('0x7d')]=_0x4fd795['Smtp'][_0x149a('0x7d')];_0x5770f3['auth']={'user':_0x4fd795['Smtp']['user'],'pass':_0x4fd795['Smtp'][_0x149a('0x79')]};}return respondWithRpcPromise(_0x149a('0xb0'),'sendMail',{'account':_0x5770f3,'message':_0xde1344[_0x149a('0x5f')]});}else{throw new Error('List\x20not\x20found');}}})[_0x149a('0x34')](function(_0x3369da){if(_0x3369da){_0x3b6ba9=_0x3369da;if(_0x32611d[_0x149a('0xa5')]){if(_0x32611d['List'][_0x149a('0xa6')][_0x149a('0x4f')]){return _0x32611d[_0x149a('0xa5')][_0x149a('0xa6')][0x0];}else{return db[_0x149a('0x8b')][_0x149a('0x63')](_['defaults'](_0xde1344[_0x149a('0x5f')],{'firstName':_0xde1344[_0x149a('0x5f')]['to'],'email':_0xde1344[_0x149a('0x5f')]['to'],'phone':_0xde1344[_0x149a('0x5f')]['to'],'ListId':_0x32611d[_0x149a('0x72')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x149a('0x34')](function(_0x4e16f1){if(_0x4e16f1){var _0x380062={'UserId':_0xde1344['user']['id'],'ContactId':_0x4e16f1['id'],'MailAccountId':_0x32611d['id'],'inReplyTo':_0x3b6ba9[_0x149a('0xb1')],'to':_0xde1344[_0x149a('0x5f')][_0x149a('0xb2')],'cc':_0xde1344[_0x149a('0x5f')]['cc'],'subject':_0xde1344[_0x149a('0x5f')][_0x149a('0xb3')],'attach':_0xde1344[_0x149a('0x5f')][_0x149a('0xb4')],'firstMsgDirection':_0x149a('0xb5'),'lastMsgAt':moment()[_0x149a('0xa9')](_0x149a('0xa1')),'lastMsgDirection':'out','Messages':[_[_0x149a('0x55')](_0xde1344[_0x149a('0x5f')],{'messageId':_0x3b6ba9[_0x149a('0xb1')],'sentAt':moment()['format'](_0x149a('0xa1')),'read':!![],'MailAccountId':_0x32611d['id'],'UserId':_0xde1344['user']['id'],'ContactId':_0x4e16f1['id']})]};if(_0xde1344['body']['Interaction']){_0x380062=_['merge'](_0x380062,_0xde1344[_0x149a('0x5f')][_0x149a('0xb6')]);}return db[_0x149a('0x88')]['create'](_0x380062,{'include':[{'model':db[_0x149a('0x9e')],'as':'Messages'}]});}})[_0x149a('0x34')](respondWithResult(_0x5a6702,null))[_0x149a('0x2a')](handleError(_0x5a6702,null));};exports['verifySmtp']=function(_0x25a2bc,_0x2126ff,_0x2f8b84){return db[_0x149a('0x45')][_0x149a('0x5e')]({'where':{'id':_0x25a2bc[_0x149a('0x60')]['id']},'include':[{'model':db[_0x149a('0x40')],'as':'Smtp','raw':!![]}]})[_0x149a('0x34')](handleEntityNotFound(_0x2126ff,null))['then'](function(_0x56721e){if(_0x56721e&&_0x56721e[_0x149a('0x41')]){var _0x499249={'id':_0x56721e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x56721e[_0x149a('0x41')][_0x149a('0x7d')]){_0x499249[_0x149a('0x7d')]=_0x56721e['Smtp'][_0x149a('0x7d')];}else{_0x499249[_0x149a('0x7b')]=_0x56721e[_0x149a('0x41')][_0x149a('0x7b')];_0x499249[_0x149a('0x7c')]=_0x56721e[_0x149a('0x41')][_0x149a('0x7c')];_0x499249[_0x149a('0xaf')]=_0x56721e[_0x149a('0x41')][_0x149a('0xaf')];}if(_0x56721e['Smtp'][_0x149a('0x7a')]){_0x499249[_0x149a('0xae')]={'user':_0x56721e[_0x149a('0x41')]['user'],'pass':_0x56721e['Smtp']['pass']};}return respondWithRpcPromise(_0x149a('0xb7'),_0x149a('0xb8'),{'account':_0x499249});}})[_0x149a('0x34')](respondWithResult(_0x2126ff,null))[_0x149a('0x2a')](handleError(_0x2126ff,null));};exports['destroy']=function(_0x492e61,_0x5a2afc){return db[_0x149a('0x45')][_0x149a('0x5e')]({'where':{'id':_0x492e61[_0x149a('0x60')]['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x5a2afc,null))[_0x149a('0x34')](function(_0x1b0717){if(_0x1b0717&&_0x1b0717[_0x149a('0x7d')]){throw new db[(_0x149a('0xb9'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1b0717;})[_0x149a('0x34')](removeEntity(_0x5a2afc,null))[_0x149a('0x2a')](handleError(_0x5a2afc,null));};exports[_0x149a('0xba')]=function(_0x867192,_0x403759,_0x3db1bc){return db[_0x149a('0x45')][_0x149a('0x5e')]({'where':{'id':_0x867192[_0x149a('0x60')]['id']}})['then'](handleEntityNotFound(_0x403759,null))[_0x149a('0x34')](function(_0x2ff374){if(_0x2ff374){return _0x2ff374[_0x149a('0xba')](_0x867192[_0x149a('0x5f')][_0x149a('0x70')],_[_0x149a('0x89')](_0x867192[_0x149a('0x5f')],['ids','id'])||{})[_0x149a('0xbb')](function(_0x3f6dcc){for(var _0x32b4ad=0x0;_0x32b4ad<_0x867192['body'][_0x149a('0x70')][_0x149a('0x4f')];_0x32b4ad+=0x1){socket['emit'](_0x149a('0xbc'),{'UserId':Number(_0x867192[_0x149a('0x5f')][_0x149a('0x70')][_0x32b4ad]),'MailAccountId':Number(_0x867192[_0x149a('0x60')]['id'])});}return _0x3f6dcc;});}})[_0x149a('0x34')](respondWithResult(_0x403759,null))[_0x149a('0x2a')](handleError(_0x403759,null));};exports['removeAgents']=function(_0x248f23,_0x1d462f,_0x162a36){return db['MailAccount'][_0x149a('0x5e')]({'where':{'id':_0x248f23['params']['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x1d462f,null))['then'](function(_0x28ad84){if(_0x28ad84){return _0x28ad84[_0x149a('0xbd')](_0x248f23[_0x149a('0x4a')][_0x149a('0x70')])[_0x149a('0x34')](function(){if(_[_0x149a('0xbe')](_0x248f23[_0x149a('0x4a')][_0x149a('0x70')])){for(var _0x31143b=0x0;_0x31143b<_0x248f23[_0x149a('0x4a')][_0x149a('0x70')][_0x149a('0x4f')];_0x31143b+=0x1){socket[_0x149a('0xbf')](_0x149a('0xc0'),{'UserId':Number(_0x248f23['query'][_0x149a('0x70')][_0x31143b]),'MailAccountId':Number(_0x248f23[_0x149a('0x60')]['id'])});}}else{socket[_0x149a('0xbf')](_0x149a('0xc0'),{'UserId':Number(_0x248f23[_0x149a('0x4a')]['ids']),'MailAccountId':Number(_0x248f23[_0x149a('0x60')]['id'])});}});}})[_0x149a('0x34')](respondWithStatusCode(_0x1d462f,null))[_0x149a('0x2a')](handleError(_0x1d462f,null));};exports[_0x149a('0xc1')]=function(_0x3e8aaa,_0x1e4f2,_0x2551b8){var _0x59f6e0={};var _0xad773c={};var _0x5c8b10;var _0x5dd446;return db[_0x149a('0x45')][_0x149a('0x65')]({'where':{'id':_0x3e8aaa[_0x149a('0x60')]['id']}})[_0x149a('0x34')](handleEntityNotFound(_0x1e4f2,null))[_0x149a('0x34')](function(_0xd6456f){if(_0xd6456f){_0x5c8b10=_0xd6456f;_0xad773c[_0x149a('0x49')]=_[_0x149a('0x4b')](db[_0x149a('0x8d')][_0x149a('0x46')]);_0xad773c[_0x149a('0x4a')]=_[_0x149a('0x4b')](_0x3e8aaa[_0x149a('0x4a')]);_0xad773c[_0x149a('0x4c')]=_[_0x149a('0x5d')](_0xad773c[_0x149a('0x49')],_0xad773c['query']);_0x59f6e0[_0x149a('0x4d')]=_[_0x149a('0x5d')](_0xad773c[_0x149a('0x49')],qs['fields'](_0x3e8aaa['query']['fields']));_0x59f6e0['attributes']=_0x59f6e0[_0x149a('0x4d')]['length']?_0x59f6e0['attributes']:_0xad773c[_0x149a('0x49')];_0x59f6e0[_0x149a('0x51')]=qs[_0x149a('0x52')](_0x3e8aaa[_0x149a('0x4a')][_0x149a('0x52')]);_0x59f6e0['where']=qs[_0x149a('0x4c')](_[_0x149a('0x68')](_0x3e8aaa['query'],_0xad773c[_0x149a('0x4c')]));if(_0x3e8aaa[_0x149a('0x4a')]['filter']){_0x59f6e0[_0x149a('0x53')]=_[_0x149a('0x55')](_0x59f6e0[_0x149a('0x53')],{'$or':_[_0x149a('0x44')](_0x59f6e0[_0x149a('0x4d')],function(_0x27df04){var _0x50b490={};_0x50b490[_0x27df04]={'$like':'%'+_0x3e8aaa[_0x149a('0x4a')][_0x149a('0x54')]+'%'};return _0x50b490;})});}_0x59f6e0=_['merge']({},_0x59f6e0,_0x3e8aaa[_0x149a('0x57')]);return _0x5c8b10['getAgents'](_0x59f6e0);}})[_0x149a('0x34')](function(_0x4589cb){if(_0x4589cb){_0x5dd446=_0x4589cb[_0x149a('0x4f')];if(!_0x3e8aaa[_0x149a('0x4a')][_0x149a('0x50')](_0x149a('0x67'))){_0x59f6e0['limit']=qs[_0x149a('0x2d')](_0x3e8aaa[_0x149a('0x4a')][_0x149a('0x2d')]);_0x59f6e0[_0x149a('0x2e')]=qs[_0x149a('0x2e')](_0x3e8aaa[_0x149a('0x4a')][_0x149a('0x2e')]);}return _0x5c8b10[_0x149a('0xc1')](_0x59f6e0);}})[_0x149a('0x34')](function(_0x2a08ea){if(_0x2a08ea){return _0x2a08ea?{'count':_0x5dd446,'rows':_0x2a08ea}:null;}})['then'](respondWithResult(_0x1e4f2,null))[_0x149a('0x2a')](handleError(_0x1e4f2,null));}; \ No newline at end of file +var _0x471a=['Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','findAll','rows','show','find','body','params','catch','describe','addDisposition','Disposition','create','getDispositions','MailAccountId','includeAll','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','cuser','password','pass','cpassword','authentication','host','port','service','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','MailApplication','bulkCreate','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','CmContact','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','html-to-text','juice','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','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','stack','index','MailServerIn','Imap','MailServerOut'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x471a,0x88));var _0xa471=function(_0x47f937,_0x48a7d9){_0x47f937=_0x47f937-0x0;var _0x2b180f=_0x471a[_0x47f937];return _0x2b180f;};'use strict';var emlformat=require(_0xa471('0x0'));var rimraf=require(_0xa471('0x1'));var zipdir=require(_0xa471('0x2'));var jsonpatch=require(_0xa471('0x3'));var rp=require(_0xa471('0x4'));var moment=require(_0xa471('0x5'));var BPromise=require(_0xa471('0x6'));var Mustache=require('mustache');var util=require(_0xa471('0x7'));var path=require(_0xa471('0x8'));var sox=require(_0xa471('0x9'));var csv=require(_0xa471('0xa'));var ejs=require(_0xa471('0xb'));var fs=require('fs');var fs_extra=require(_0xa471('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa471('0xd'));var jsforce=require(_0xa471('0xe'));var deskjs=require(_0xa471('0xf'));var toCsv=require(_0xa471('0xa'));var querystring=require('querystring');var Papa=require(_0xa471('0x10'));var htmlToText=require(_0xa471('0x11'));var juice=require(_0xa471('0x12'));var Redis=require(_0xa471('0x13'));var authService=require(_0xa471('0x14'));var qs=require(_0xa471('0x15'));var as=require(_0xa471('0x16'));var hardwareService=require(_0xa471('0x17'));var logger=require(_0xa471('0x18'))(_0xa471('0x19'));var utils=require(_0xa471('0x1a'));var config=require(_0xa471('0x1b'));var licenseUtil=require(_0xa471('0x1c'));var db=require(_0xa471('0x1d'))['db'];config[_0xa471('0x1e')]=_[_0xa471('0x1f')](config[_0xa471('0x1e')],{'host':_0xa471('0x20'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa471('0x1e')]));require('./mailAccount.socket')[_0xa471('0x21')](socket);var jayson=require(_0xa471('0x22'));var client=jayson[_0xa471('0x23')][_0xa471('0x24')]({'port':0x232b});function respondWithRpcPromise(_0x553f54,_0x2a8998,_0x5f0c63,_0x2fc856){return new BPromise(function(_0x38290d,_0x58039f){var _0x501348=_0x2fc856||client;return _0x501348['request'](_0x553f54,_0x5f0c63)[_0xa471('0x25')](function(_0x313a67){logger[_0xa471('0x26')](_0xa471('0x27'),_0x2a8998,'request\x20sent');logger[_0xa471('0x28')](_0xa471('0x29'),_0x2a8998,_0xa471('0x2a'),JSON['stringify'](_0x313a67));if(_0x313a67['error']){if(_0x313a67[_0xa471('0x2b')][_0xa471('0x2c')]===0x1f4){logger[_0xa471('0x2b')]('MailAccount,\x20%s,\x20%s',_0x2a8998,_0x313a67[_0xa471('0x2b')][_0xa471('0x2d')]);return _0x58039f(_0x313a67[_0xa471('0x2b')]['message']);}logger[_0xa471('0x2b')](_0xa471('0x27'),_0x2a8998,_0x313a67[_0xa471('0x2b')][_0xa471('0x2d')]);return _0x38290d(_0x313a67[_0xa471('0x2b')]['message']);}else{logger[_0xa471('0x26')](_0xa471('0x27'),_0x2a8998,_0xa471('0x2a'));_0x38290d(_0x313a67[_0xa471('0x2e')][_0xa471('0x2d')]);}})['catch'](function(_0x20f9d8){logger[_0xa471('0x2b')]('MailAccount,\x20%s,\x20%s',_0x2a8998,_0x20f9d8);_0x58039f(_0x20f9d8);});});}function respondWithStatusCode(_0x30b8ad,_0x44ddd1){_0x44ddd1=_0x44ddd1||0xcc;return function(_0x32a40f){if(_0x32a40f){return _0x30b8ad[_0xa471('0x2f')](_0x44ddd1);}return _0x30b8ad[_0xa471('0x30')](_0x44ddd1)[_0xa471('0x31')]();};}function respondWithResult(_0x53f738,_0x4c7fa7){_0x4c7fa7=_0x4c7fa7||0xc8;return function(_0x1db70b){if(_0x1db70b){return _0x53f738[_0xa471('0x30')](_0x4c7fa7)[_0xa471('0x32')](_0x1db70b);}};}function respondWithFilteredResult(_0x2072ed,_0x1a7335){return function(_0x28894c){if(_0x28894c){var _0xd42202=typeof _0x1a7335[_0xa471('0x33')]===_0xa471('0x34')&&typeof _0x1a7335[_0xa471('0x35')]===_0xa471('0x34');var _0x5d8cda=_0x28894c[_0xa471('0x36')];var _0x92f2d=_0xd42202?0x0:_0x1a7335[_0xa471('0x33')];var _0x393756=_0xd42202?_0x28894c[_0xa471('0x36')]:_0x1a7335[_0xa471('0x33')]+_0x1a7335[_0xa471('0x35')];var _0x24d7e4;if(_0x393756>=_0x5d8cda){_0x393756=_0x5d8cda;_0x24d7e4=0xc8;}else{_0x24d7e4=0xce;}_0x2072ed[_0xa471('0x30')](_0x24d7e4);return _0x2072ed[_0xa471('0x37')](_0xa471('0x38'),_0x92f2d+'-'+_0x393756+'/'+_0x5d8cda)[_0xa471('0x32')](_0x28894c);}return null;};}function patchUpdates(_0x5b7fa0){return function(_0x47b595){try{jsonpatch[_0xa471('0x39')](_0x47b595,_0x5b7fa0,!![]);}catch(_0x1dce3e){return BPromise[_0xa471('0x3a')](_0x1dce3e);}return _0x47b595[_0xa471('0x3b')]();};}function saveUpdates(_0x58fbdc,_0x5bc4b9){return function(_0x57e91f){if(_0x57e91f){return _0x57e91f[_0xa471('0x3c')](_0x58fbdc)['then'](function(_0x1dce2b){return _0x1dce2b;});}return null;};}function removeEntity(_0x49ca7c,_0x3ebbec){return function(_0x4108cb){if(_0x4108cb){return _0x4108cb[_0xa471('0x3d')]()[_0xa471('0x25')](function(){var _0x47346f=_0x4108cb[_0xa471('0x3e')]({'plain':!![]});var _0x1e0a07=_0xa471('0x3f');return db['UserProfileResource'][_0xa471('0x3d')]({'where':{'type':_0x1e0a07,'resourceId':_0x47346f['id']}})['then'](function(){return _0x4108cb;});})[_0xa471('0x25')](function(){_0x49ca7c['status'](0xcc)[_0xa471('0x31')]();});}};}function handleEntityNotFound(_0x3e9cd3,_0x31aa6a){return function(_0x60228c){if(!_0x60228c){_0x3e9cd3['sendStatus'](0x194);}return _0x60228c;};}function handleError(_0x3d2381,_0x296546){_0x296546=_0x296546||0x1f4;return function(_0x48f6c9){logger['error'](_0x48f6c9[_0xa471('0x40')]);if(_0x48f6c9['name']){delete _0x48f6c9['name'];}_0x3d2381[_0xa471('0x30')](_0x296546)['send'](_0x48f6c9);};}exports[_0xa471('0x41')]=function(_0x42ded2,_0x3fbb30){var _0x3f442b={'include':[{'model':db[_0xa471('0x42')],'as':_0xa471('0x43')},{'model':db[_0xa471('0x44')],'as':_0xa471('0x45')},{'model':db[_0xa471('0x46')],'as':_0xa471('0x47')}]},_0x5f1156={},_0x4473c={'count':0x0,'rows':[]};var _0x557ba=_['map'](db[_0xa471('0x48')][_0xa471('0x49')],function(_0x40928e){return{'name':_0x40928e['fieldName'],'type':_0x40928e['type'][_0xa471('0x4a')]};});_0x5f1156[_0xa471('0x4b')]=_[_0xa471('0x4c')](_0x557ba,'name');_0x5f1156[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x42ded2[_0xa471('0x4d')]);_0x5f1156[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x5f1156[_0xa471('0x4b')],_0x5f1156['query']);_0x3f442b['attributes']=_[_0xa471('0x50')](_0x5f1156[_0xa471('0x4b')],qs[_0xa471('0x51')](_0x42ded2[_0xa471('0x4d')][_0xa471('0x51')]));_0x3f442b[_0xa471('0x52')]=_0x3f442b[_0xa471('0x52')][_0xa471('0x53')]?_0x3f442b[_0xa471('0x52')]:_0x5f1156['model'];if(!_0x42ded2[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x3f442b[_0xa471('0x35')]=qs['limit'](_0x42ded2[_0xa471('0x4d')][_0xa471('0x35')]);_0x3f442b[_0xa471('0x33')]=qs[_0xa471('0x33')](_0x42ded2[_0xa471('0x4d')][_0xa471('0x33')]);}_0x3f442b[_0xa471('0x56')]=qs['sort'](_0x42ded2[_0xa471('0x4d')][_0xa471('0x57')]);_0x3f442b[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x42ded2[_0xa471('0x4d')],_0x5f1156[_0xa471('0x4f')]),_0x557ba);if(_0x42ded2['query']['filter']){_0x3f442b[_0xa471('0x58')]=_[_0xa471('0x5a')](_0x3f442b[_0xa471('0x58')],{'$or':_[_0xa471('0x4c')](_0x557ba,function(_0x43e0d2){if(_0x43e0d2[_0xa471('0x5b')]!==_0xa471('0x5c')){var _0x42d557={};_0x42d557[_0x43e0d2['name']]={'$like':'%'+_0x42ded2['query'][_0xa471('0x5d')]+'%'};return _0x42d557;}})});}_0x3f442b=_[_0xa471('0x5a')]({},_0x3f442b,_0x42ded2[_0xa471('0x5e')]);var _0x2b63b7={'where':_0x3f442b[_0xa471('0x58')]};return db[_0xa471('0x48')][_0xa471('0x36')](_0x2b63b7)['then'](function(_0x313414){_0x4473c[_0xa471('0x36')]=_0x313414;if(_0x42ded2['query']['includeAll']){_0x3f442b['include']=[{'all':!![]}];}return db['MailAccount'][_0xa471('0x5f')](_0x3f442b);})[_0xa471('0x25')](function(_0x3e4df8){_0x4473c[_0xa471('0x60')]=_0x3e4df8;return _0x4473c;})[_0xa471('0x25')](respondWithFilteredResult(_0x3fbb30,_0x3f442b))['catch'](handleError(_0x3fbb30,null));};exports[_0xa471('0x61')]=function(_0x246399,_0x5c0e15){var _0x5db542={'raw':![],'where':{'id':_0x246399['params']['id']},'include':[{'model':db[_0xa471('0x42')],'as':_0xa471('0x43')},{'model':db[_0xa471('0x44')],'as':_0xa471('0x45')},{'model':db['Pause'],'as':_0xa471('0x47')}]},_0x2aa612={};_0x2aa612[_0xa471('0x4b')]=_[_0xa471('0x4e')](db[_0xa471('0x48')][_0xa471('0x49')]);_0x2aa612[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x246399[_0xa471('0x4d')]);_0x2aa612[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x2aa612['model'],_0x2aa612['query']);_0x5db542[_0xa471('0x52')]=_[_0xa471('0x50')](_0x2aa612[_0xa471('0x4b')],qs[_0xa471('0x51')](_0x246399['query']['fields']));_0x5db542[_0xa471('0x52')]=_0x5db542[_0xa471('0x52')][_0xa471('0x53')]?_0x5db542[_0xa471('0x52')]:_0x2aa612['model'];if(_0x246399[_0xa471('0x4d')]['includeAll']){_0x5db542['include']=[{'all':!![]}];}_0x5db542=_[_0xa471('0x5a')]({},_0x5db542,_0x246399[_0xa471('0x5e')]);return db[_0xa471('0x48')][_0xa471('0x62')](_0x5db542)[_0xa471('0x25')](handleEntityNotFound(_0x5c0e15,null))['then'](respondWithResult(_0x5c0e15,null))['catch'](handleError(_0x5c0e15,null));};exports['update']=function(_0x421a12,_0x1a63f1){if(_0x421a12[_0xa471('0x63')]['id']){delete _0x421a12[_0xa471('0x63')]['id'];}return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0x421a12[_0xa471('0x64')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xa471('0x43')},{'model':db[_0xa471('0x44')],'as':'Smtp'},{'model':db[_0xa471('0x46')],'as':_0xa471('0x47')}]})['then'](handleEntityNotFound(_0x1a63f1,null))[_0xa471('0x25')](saveUpdates(_0x421a12[_0xa471('0x63')],null))[_0xa471('0x25')](function(_0x3de6ec){if(_0x3de6ec&&_0x421a12[_0xa471('0x63')][_0xa471('0x43')]){return db['MailServerIn'][_0xa471('0x3c')](_0x421a12[_0xa471('0x63')][_0xa471('0x43')],{'where':{'MailAccountId':_0x3de6ec['id']}})[_0xa471('0x25')](function(){return _0x3de6ec;});}return _0x3de6ec;})[_0xa471('0x25')](function(_0x54a033){if(_0x54a033&&_0x421a12[_0xa471('0x63')]['Smtp']){return db[_0xa471('0x44')][_0xa471('0x3c')](_0x421a12[_0xa471('0x63')][_0xa471('0x45')],{'where':{'MailAccountId':_0x54a033['id']}})[_0xa471('0x25')](function(){return _0x54a033;});}return _0x54a033;})[_0xa471('0x25')](respondWithResult(_0x1a63f1,null))[_0xa471('0x65')](handleError(_0x1a63f1,null));};exports[_0xa471('0x66')]=function(_0xd4a9a9,_0x419602){return db[_0xa471('0x48')]['describe']()[_0xa471('0x25')](respondWithResult(_0x419602,null))['catch'](handleError(_0x419602,null));};exports[_0xa471('0x67')]=function(_0x1973e7,_0x41b402,_0x44cf7d){if(_0x1973e7['body']['id']){delete _0x1973e7['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x1973e7['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x41b402,null))[_0xa471('0x25')](function(_0x597f31){if(_0x597f31){_0x1973e7[_0xa471('0x63')]['MailAccountId']=_0x597f31['id'];return db[_0xa471('0x68')][_0xa471('0x69')](_0x1973e7[_0xa471('0x63')]);}})[_0xa471('0x25')](respondWithResult(_0x41b402,null))[_0xa471('0x65')](handleError(_0x41b402,null));};exports[_0xa471('0x6a')]=function(_0x423f2b,_0xd3ba55,_0x5a2c36){var _0x396e06={'raw':![],'where':{}};var _0x11e092={};var _0x329448={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x423f2b[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0xd3ba55,null))[_0xa471('0x25')](function(_0x5642e0){if(_0x5642e0){_0x11e092['model']=_[_0xa471('0x4e')](db[_0xa471('0x68')][_0xa471('0x49')]);_0x11e092[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x423f2b['query']);_0x11e092[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x11e092[_0xa471('0x4b')],_0x11e092[_0xa471('0x4d')]);_0x396e06['attributes']=_[_0xa471('0x50')](_0x11e092['model'],qs[_0xa471('0x51')](_0x423f2b[_0xa471('0x4d')][_0xa471('0x51')]));_0x396e06['attributes']=_0x396e06['attributes'][_0xa471('0x53')]?_0x396e06[_0xa471('0x52')]:_0x11e092['model'];if(!_0x423f2b[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x396e06[_0xa471('0x35')]=qs['limit'](_0x423f2b[_0xa471('0x4d')][_0xa471('0x35')]);_0x396e06[_0xa471('0x33')]=qs[_0xa471('0x33')](_0x423f2b[_0xa471('0x4d')][_0xa471('0x33')]);}_0x396e06['order']=qs[_0xa471('0x57')](_0x423f2b[_0xa471('0x4d')][_0xa471('0x57')]);_0x396e06[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x423f2b[_0xa471('0x4d')],_0x11e092[_0xa471('0x4f')]));_0x396e06['where'][_0xa471('0x6b')]=_0x5642e0['id'];if(_0x423f2b[_0xa471('0x4d')][_0xa471('0x5d')]){_0x396e06['where']=_[_0xa471('0x5a')](_0x396e06[_0xa471('0x58')],{'$or':_['map'](_0x396e06['attributes'],function(_0x4bbee3){var _0x569faa={};_0x569faa[_0x4bbee3]={'$like':'%'+_0x423f2b[_0xa471('0x4d')][_0xa471('0x5d')]+'%'};return _0x569faa;})});}_0x396e06=_[_0xa471('0x5a')]({},_0x396e06,_0x423f2b[_0xa471('0x5e')]);return db[_0xa471('0x68')][_0xa471('0x36')]({'where':_0x396e06[_0xa471('0x58')]})[_0xa471('0x25')](function(_0x3057bb){_0x329448[_0xa471('0x36')]=_0x3057bb;if(_0x423f2b[_0xa471('0x4d')][_0xa471('0x6c')]){_0x396e06[_0xa471('0x6d')]=[{'all':!![]}];}return db[_0xa471('0x68')][_0xa471('0x5f')](_0x396e06);})[_0xa471('0x25')](function(_0x55d34e){_0x329448['rows']=_0x55d34e;return _0x329448;});}})[_0xa471('0x25')](respondWithFilteredResult(_0xd3ba55,_0x396e06))[_0xa471('0x65')](handleError(_0xd3ba55,null));};exports[_0xa471('0x6e')]=function(_0x1108b5,_0x3c1544,_0x2f926a){return db[_0xa471('0x48')]['find']({'where':{'id':_0x1108b5[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x3c1544,null))[_0xa471('0x25')](function(_0x3784b5){if(_0x3784b5){return _0x3784b5[_0xa471('0x6e')](_0x1108b5[_0xa471('0x4d')][_0xa471('0x6f')]);}})['then'](respondWithStatusCode(_0x3c1544,null))['catch'](handleError(_0x3c1544,null));};exports[_0xa471('0x70')]=function(_0x52d430,_0x58cb1e,_0x1c14fb){if(_0x52d430[_0xa471('0x63')]['id']){delete _0x52d430['body']['id'];}return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0x52d430[_0xa471('0x64')]['id']}})['then'](handleEntityNotFound(_0x58cb1e,null))[_0xa471('0x25')](function(_0x4a1d4e){if(_0x4a1d4e){_0x52d430[_0xa471('0x63')]['MailAccountId']=_0x4a1d4e['id'];return db[_0xa471('0x71')][_0xa471('0x69')](_0x52d430[_0xa471('0x63')]);}})[_0xa471('0x25')](respondWithResult(_0x58cb1e,null))[_0xa471('0x65')](handleError(_0x58cb1e,null));};exports[_0xa471('0x72')]=function(_0x8be066,_0x471bfb,_0x4f6887){var _0x250bd3={'raw':![],'where':{}};var _0x259264={};var _0x58f4ac={'count':0x0,'rows':[]};return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x8be066[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x471bfb,null))[_0xa471('0x25')](function(_0x3447b7){if(_0x3447b7){_0x259264['model']=_[_0xa471('0x4e')](db[_0xa471('0x71')]['rawAttributes']);_0x259264['query']=_[_0xa471('0x4e')](_0x8be066[_0xa471('0x4d')]);_0x259264[_0xa471('0x4f')]=_['intersection'](_0x259264[_0xa471('0x4b')],_0x259264[_0xa471('0x4d')]);_0x250bd3[_0xa471('0x52')]=_[_0xa471('0x50')](_0x259264[_0xa471('0x4b')],qs[_0xa471('0x51')](_0x8be066[_0xa471('0x4d')][_0xa471('0x51')]));_0x250bd3[_0xa471('0x52')]=_0x250bd3[_0xa471('0x52')][_0xa471('0x53')]?_0x250bd3[_0xa471('0x52')]:_0x259264['model'];if(!_0x8be066[_0xa471('0x4d')]['hasOwnProperty'](_0xa471('0x55'))){_0x250bd3[_0xa471('0x35')]=qs[_0xa471('0x35')](_0x8be066['query'][_0xa471('0x35')]);_0x250bd3['offset']=qs[_0xa471('0x33')](_0x8be066[_0xa471('0x4d')][_0xa471('0x33')]);}_0x250bd3[_0xa471('0x56')]=qs[_0xa471('0x57')](_0x8be066['query'][_0xa471('0x57')]);_0x250bd3[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x8be066[_0xa471('0x4d')],_0x259264['filters']));_0x250bd3[_0xa471('0x58')][_0xa471('0x6b')]=_0x3447b7['id'];if(_0x8be066['query']['filter']){_0x250bd3[_0xa471('0x58')]=_[_0xa471('0x5a')](_0x250bd3[_0xa471('0x58')],{'$or':_[_0xa471('0x4c')](_0x250bd3['attributes'],function(_0xfce415){var _0x5e4225={};_0x5e4225[_0xfce415]={'$like':'%'+_0x8be066[_0xa471('0x4d')]['filter']+'%'};return _0x5e4225;})});}_0x250bd3=_[_0xa471('0x5a')]({},_0x250bd3,_0x8be066[_0xa471('0x5e')]);return db[_0xa471('0x71')][_0xa471('0x36')]({'where':_0x250bd3[_0xa471('0x58')]})[_0xa471('0x25')](function(_0x3a2ff7){_0x58f4ac[_0xa471('0x36')]=_0x3a2ff7;if(_0x8be066['query'][_0xa471('0x6c')]){_0x250bd3[_0xa471('0x6d')]=[{'all':!![]}];}return db[_0xa471('0x71')][_0xa471('0x5f')](_0x250bd3);})[_0xa471('0x25')](function(_0x520029){_0x58f4ac[_0xa471('0x60')]=_0x520029;return _0x58f4ac;});}})[_0xa471('0x25')](respondWithFilteredResult(_0x471bfb,_0x250bd3))[_0xa471('0x65')](handleError(_0x471bfb,null));};exports[_0xa471('0x74')]=function(_0x44b83d,_0x54672d,_0x390e0b){return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0x44b83d[_0xa471('0x64')]['id']}})['then'](handleEntityNotFound(_0x54672d,null))[_0xa471('0x25')](function(_0xb13383){if(_0xb13383){return _0xb13383[_0xa471('0x74')](_0x44b83d[_0xa471('0x4d')]['ids']);}})[_0xa471('0x25')](respondWithStatusCode(_0x54672d,null))[_0xa471('0x65')](handleError(_0x54672d,null));};exports[_0xa471('0x69')]=function(_0x7f5324,_0x74fba9){var _0x1974e9={'name':_0x7f5324['body']['name'],'key':_0x7f5324['body']['key'],'email':_0x7f5324['body'][_0xa471('0x75')],'ListId':_0x7f5324['body'][_0xa471('0x76')],'active':!_[_0xa471('0x77')](_0x7f5324[_0xa471('0x63')]['active'])?_0x7f5324['body'][_0xa471('0x78')]:!![],'description':_0x7f5324[_0xa471('0x63')][_0xa471('0x79')]||null,'Imap':{},'Smtp':{}};if(_[_0xa471('0x77')](_0x7f5324['body'][_0xa471('0x7a')])){if(_0x7f5324[_0xa471('0x63')][_0xa471('0x7b')]){_0x1974e9[_0xa471('0x43')]['user']=_0x1974e9[_0xa471('0x45')]['user']=_0x7f5324[_0xa471('0x63')][_0xa471('0x7c')];_0x1974e9[_0xa471('0x43')][_0xa471('0x7d')]=_0x1974e9[_0xa471('0x45')][_0xa471('0x7e')]=_0x7f5324[_0xa471('0x63')][_0xa471('0x7f')];}else{_0x1974e9['Imap'][_0xa471('0x80')]=_0x1974e9[_0xa471('0x45')][_0xa471('0x80')]=![];}_0x1974e9[_0xa471('0x43')]['host']=_0x7f5324[_0xa471('0x63')][_0xa471('0x43')]['host'];_0x1974e9[_0xa471('0x43')]['port']=_0x7f5324[_0xa471('0x63')]['Imap']['port'];_0x1974e9['Smtp'][_0xa471('0x81')]=_0x7f5324['body'][_0xa471('0x45')][_0xa471('0x81')];_0x1974e9[_0xa471('0x45')][_0xa471('0x82')]=_0x7f5324[_0xa471('0x63')][_0xa471('0x45')][_0xa471('0x82')];}else{_0x1974e9[_0xa471('0x43')][_0xa471('0x83')]=_0x1974e9['Smtp'][_0xa471('0x83')]=_0x7f5324[_0xa471('0x63')][_0xa471('0x7a')];_0x1974e9[_0xa471('0x43')]['user']=_0x1974e9['Smtp']['user']=_0x7f5324[_0xa471('0x63')]['cuser'];_0x1974e9['Imap'][_0xa471('0x7d')]=_0x1974e9[_0xa471('0x45')][_0xa471('0x7e')]=_0x7f5324[_0xa471('0x63')][_0xa471('0x7f')];}return db[_0xa471('0x48')]['create'](_0x1974e9,{'include':[{'model':db[_0xa471('0x44')],'as':_0xa471('0x45')},{'model':db[_0xa471('0x42')],'as':_0xa471('0x43')}]})[_0xa471('0x25')](function(_0x13c835){var _0x17a6bd=_0x7f5324[_0xa471('0x84')][_0xa471('0x3e')]({'plain':!![]});if(!_0x17a6bd)throw new Error(_0xa471('0x85'));if(_0x17a6bd['role']===_0xa471('0x84')){var _0x2b6b80=_0x13c835[_0xa471('0x3e')]({'plain':!![]});return db[_0xa471('0x86')][_0xa471('0x62')]({'where':{'name':_0xa471('0x3f'),'userProfileId':_0x17a6bd[_0xa471('0x87')]},'raw':!![]})['then'](function(_0x3e2189){if(_0x3e2189&&_0x3e2189[_0xa471('0x88')]===0x0){return db[_0xa471('0x89')][_0xa471('0x69')]({'name':_0x2b6b80[_0xa471('0x8a')],'resourceId':_0x2b6b80['id'],'type':_0x3e2189[_0xa471('0x8a')],'sectionId':_0x3e2189['id']},{})[_0xa471('0x25')](function(){return _0x13c835;});}else{return _0x13c835;}})[_0xa471('0x65')](function(_0xc2e8e7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc2e8e7);throw _0xc2e8e7;});}return _0x13c835;})['then'](respondWithResult(_0x74fba9,0xc9))['catch'](handleError(_0x74fba9,null));};exports[_0xa471('0x8b')]=function(_0xd9cdf3,_0x154dee,_0x4bac7f){return db['MailAccount']['findOne']({'where':{'id':_0xd9cdf3[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x154dee,null))[_0xa471('0x25')](function(_0x4274f7){if(_0x4274f7){return _0x4274f7[_0xa471('0x8b')]();}return null;})['then'](respondWithResult(_0x154dee,null))[_0xa471('0x65')](handleError(_0x154dee,null));};exports[_0xa471('0x8c')]=function(_0xf80e6f,_0x3ee2b0,_0x1b03d0){if(_0xf80e6f[_0xa471('0x63')]['id']){delete _0xf80e6f[_0xa471('0x63')]['id'];}return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0xf80e6f[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x3ee2b0,null))[_0xa471('0x25')](function(_0x30102b){if(_0x30102b){_0xf80e6f['body'][_0xa471('0x6b')]=_0x30102b['id'];return db[_0xa471('0x42')][_0xa471('0x69')](_0xf80e6f['body']);}})[_0xa471('0x25')](respondWithResult(_0x3ee2b0,null))['catch'](handleError(_0x3ee2b0,null));};exports[_0xa471('0x8d')]=function(_0x1c6539,_0x2d7515,_0x39b978){return db['MailAccount'][_0xa471('0x73')]({'where':{'id':_0x1c6539['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x2d7515,null))[_0xa471('0x25')](function(_0x21e10e){if(_0x21e10e){return _0x21e10e[_0xa471('0x8e')](null);}return null;})[_0xa471('0x25')](respondWithStatusCode(_0x2d7515,null))[_0xa471('0x65')](handleError(_0x2d7515,null));};exports['getSmtp']=function(_0x4b0b66,_0x5bfba9,_0xf3ef55){return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x4b0b66[_0xa471('0x64')]['id']}})['then'](handleEntityNotFound(_0x5bfba9,null))[_0xa471('0x25')](function(_0x19255f){if(_0x19255f){return _0x19255f[_0xa471('0x8f')]();}return null;})['then'](respondWithResult(_0x5bfba9,null))[_0xa471('0x65')](handleError(_0x5bfba9,null));};exports[_0xa471('0x90')]=function(_0x436577,_0x21b05a,_0x98445c){if(_0x436577[_0xa471('0x63')]['id']){delete _0x436577[_0xa471('0x63')]['id'];}return db[_0xa471('0x48')]['find']({'where':{'id':_0x436577['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x21b05a,null))[_0xa471('0x25')](function(_0x5f114f){if(_0x5f114f){_0x436577[_0xa471('0x63')][_0xa471('0x6b')]=_0x5f114f['id'];return db['MailServerOut'][_0xa471('0x69')](_0x436577[_0xa471('0x63')]);}})[_0xa471('0x25')](respondWithResult(_0x21b05a,null))[_0xa471('0x65')](handleError(_0x21b05a,null));};exports[_0xa471('0x91')]=function(_0xbafc5d,_0x1a7d92,_0x441344){return db[_0xa471('0x48')]['findOne']({'where':{'id':_0xbafc5d[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x1a7d92,null))[_0xa471('0x25')](function(_0x3bc6a4){if(_0x3bc6a4){return _0x3bc6a4[_0xa471('0x92')](null);}return null;})[_0xa471('0x25')](respondWithStatusCode(_0x1a7d92,null))[_0xa471('0x65')](handleError(_0x1a7d92,null));};exports[_0xa471('0x93')]=function(_0x97b8ff,_0x44a9b4,_0x3dfa93){return db[_0xa471('0x94')][_0xa471('0x62')]({'where':{'id':_0x97b8ff[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x44a9b4,null))[_0xa471('0x25')](function(_0x13a1bd){if(_0x13a1bd){return _0x13a1bd[_0xa471('0x93')](_0x97b8ff[_0xa471('0x63')][_0xa471('0x6f')],_[_0xa471('0x95')](_0x97b8ff[_0xa471('0x63')],[_0xa471('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x44a9b4,null))[_0xa471('0x65')](handleError(_0x44a9b4,null));};exports[_0xa471('0x96')]=function(_0x40cd96,_0x5e08d5,_0x33ffbe){var _0x1fcc77={'raw':![],'where':{}};var _0x4f1d97={};var _0x1c21c1={'count':0x0,'rows':[]};return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x40cd96[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x5e08d5,null))[_0xa471('0x25')](function(_0x3d4bb9){if(_0x3d4bb9){_0x4f1d97[_0xa471('0x4b')]=_[_0xa471('0x4e')](db['MailInteraction']['rawAttributes']);_0x4f1d97[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x40cd96[_0xa471('0x4d')]);_0x4f1d97[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x4f1d97[_0xa471('0x4b')],_0x4f1d97[_0xa471('0x4d')]);_0x1fcc77[_0xa471('0x52')]=_[_0xa471('0x50')](_0x4f1d97[_0xa471('0x4b')],qs['fields'](_0x40cd96[_0xa471('0x4d')][_0xa471('0x51')]));_0x1fcc77[_0xa471('0x52')]=_0x1fcc77[_0xa471('0x52')][_0xa471('0x53')]?_0x1fcc77[_0xa471('0x52')]:_0x4f1d97['model'];if(!_0x40cd96[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x1fcc77[_0xa471('0x35')]=qs['limit'](_0x40cd96[_0xa471('0x4d')][_0xa471('0x35')]);_0x1fcc77['offset']=qs[_0xa471('0x33')](_0x40cd96['query']['offset']);}_0x1fcc77[_0xa471('0x56')]=qs[_0xa471('0x57')](_0x40cd96[_0xa471('0x4d')]['sort']);_0x1fcc77[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x40cd96[_0xa471('0x4d')],_0x4f1d97[_0xa471('0x4f')]));_0x1fcc77[_0xa471('0x58')][_0xa471('0x6b')]=_0x3d4bb9['id'];if(_0x40cd96[_0xa471('0x4d')][_0xa471('0x5d')]){_0x1fcc77[_0xa471('0x58')]=_[_0xa471('0x5a')](_0x1fcc77['where'],{'$or':_['map'](_0x1fcc77[_0xa471('0x52')],function(_0x2e7d29){var _0x4c28b0={};_0x4c28b0[_0x2e7d29]={'$like':'%'+_0x40cd96[_0xa471('0x4d')][_0xa471('0x5d')]+'%'};return _0x4c28b0;})});}_0x1fcc77=_[_0xa471('0x5a')]({},_0x1fcc77,_0x40cd96['options']);return db[_0xa471('0x94')][_0xa471('0x36')]({'where':_0x1fcc77[_0xa471('0x58')]})['then'](function(_0x21bece){_0x1c21c1[_0xa471('0x36')]=_0x21bece;if(_0x40cd96[_0xa471('0x4d')][_0xa471('0x6c')]){_0x1fcc77[_0xa471('0x6d')]=[{'model':db['CmContact'],'as':_0xa471('0x97'),'required':![]},{'model':db[_0xa471('0x98')],'as':_0xa471('0x99'),'attributes':[_0xa471('0x8a'),_0xa471('0x9a'),_0xa471('0x9b')],'required':![]},{'model':db[_0xa471('0x9c')],'as':'Tags','attributes':['id','name',_0xa471('0x9d')],'where':_0x40cd96[_0xa471('0x4d')][_0xa471('0x9e')]?{'id':_0x40cd96[_0xa471('0x4d')]['tag']}:undefined,'required':_0x40cd96[_0xa471('0x4d')]['tag']?!![]:![]}];}return db[_0xa471('0x94')]['findAll'](_0x1fcc77);})[_0xa471('0x25')](function(_0xb50765){_0x1c21c1[_0xa471('0x60')]=_0xb50765;return _0x1c21c1;});}})['then'](respondWithFilteredResult(_0x5e08d5,_0x1fcc77))[_0xa471('0x65')](handleError(_0x5e08d5,null));};exports[_0xa471('0x9f')]=function(_0x4e15a0,_0x3f929d,_0x5642c9){return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x4e15a0[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x3f929d,null))[_0xa471('0x25')](function(_0x58f71b){if(_0x58f71b){return db[_0xa471('0xa0')]['transaction'](function(_0x365fc0){return db['MailApplication'][_0xa471('0x3d')]({'where':{'MailAccountId':_0x4e15a0[_0xa471('0x64')]['id']},'transaction':_0x365fc0})[_0xa471('0x25')](function(_0x3465a6){var _0x27be84=_[_0xa471('0x4c')](_0x4e15a0[_0xa471('0x63')],function(_0x597c22){_0x597c22[_0xa471('0x6b')]=_0x4e15a0[_0xa471('0x64')]['id'];return _0x597c22;});return db[_0xa471('0xa1')][_0xa471('0xa2')](_0x27be84,{'transaction':_0x365fc0});});})['then'](function(){return db[_0xa471('0xa1')]['findAndCountAll']({'where':{'MailAccountId':_0x4e15a0['params']['id']},'order':_0xa471('0xa3')});});}})[_0xa471('0x25')](respondWithResult(_0x3f929d,null))[_0xa471('0x65')](handleError(_0x3f929d,null));};exports[_0xa471('0xa4')]=function(_0x152579,_0x8a1fee,_0x3ec49d){var _0x3b5f4f={};var _0x4b221f={};var _0x5f5835;var _0x4de037;return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x152579['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x8a1fee,null))[_0xa471('0x25')](function(_0x29ddb2){if(_0x29ddb2){_0x5f5835=_0x29ddb2;_0x4b221f[_0xa471('0x4b')]=_[_0xa471('0x4e')](db[_0xa471('0xa1')][_0xa471('0x49')]);_0x4b221f[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x152579[_0xa471('0x4d')]);_0x4b221f[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x4b221f[_0xa471('0x4b')],_0x4b221f['query']);_0x3b5f4f['attributes']=_['intersection'](_0x4b221f[_0xa471('0x4b')],qs['fields'](_0x152579[_0xa471('0x4d')][_0xa471('0x51')]));_0x3b5f4f['attributes']=_0x3b5f4f[_0xa471('0x52')][_0xa471('0x53')]?_0x3b5f4f[_0xa471('0x52')]:_0x4b221f[_0xa471('0x4b')];_0x3b5f4f['order']=qs[_0xa471('0x57')](_0x152579[_0xa471('0x4d')][_0xa471('0x57')]);_0x3b5f4f['where']=qs[_0xa471('0x4f')](_['pick'](_0x152579[_0xa471('0x4d')],_0x4b221f[_0xa471('0x4f')]));if(_0x152579[_0xa471('0x4d')]['filter']){_0x3b5f4f[_0xa471('0x58')]=_['merge'](_0x3b5f4f['where'],{'$or':_[_0xa471('0x4c')](_0x3b5f4f[_0xa471('0x52')],function(_0x38f887){var _0x57480c={};_0x57480c[_0x38f887]={'$like':'%'+_0x152579[_0xa471('0x4d')]['filter']+'%'};return _0x57480c;})});}_0x3b5f4f=_[_0xa471('0x5a')]({},_0x3b5f4f,_0x152579[_0xa471('0x5e')]);return _0x5f5835[_0xa471('0xa4')](_0x3b5f4f);}})[_0xa471('0x25')](function(_0x22b498){if(_0x22b498){_0x4de037=_0x22b498[_0xa471('0x53')];if(!_0x152579[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x3b5f4f[_0xa471('0x35')]=qs[_0xa471('0x35')](_0x152579[_0xa471('0x4d')][_0xa471('0x35')]);_0x3b5f4f[_0xa471('0x33')]=qs['offset'](_0x152579[_0xa471('0x4d')][_0xa471('0x33')]);}return _0x5f5835[_0xa471('0xa4')](_0x3b5f4f);}})[_0xa471('0x25')](function(_0x3a49d8){if(_0x3a49d8){return _0x3a49d8?{'count':_0x4de037,'rows':_0x3a49d8}:null;}})[_0xa471('0x25')](respondWithResult(_0x8a1fee,null))[_0xa471('0x65')](handleError(_0x8a1fee,null));};exports['getMessages']=function(_0x487fdb,_0xb9ecab,_0x24068f){var _0x581586={'raw':!![],'where':{}};var _0x4856e7={};var _0x2cf5be={'count':0x0,'rows':[]};return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x487fdb[_0xa471('0x64')]['id']}})['then'](handleEntityNotFound(_0xb9ecab,null))[_0xa471('0x25')](function(_0xdeddc5){if(_0xdeddc5){_0x4856e7[_0xa471('0x4b')]=_[_0xa471('0x4e')](db[_0xa471('0xa5')][_0xa471('0x49')]);_0x4856e7[_0xa471('0x4d')]=_['keys'](_0x487fdb[_0xa471('0x4d')]);_0x4856e7['filters']=_[_0xa471('0x50')](_0x4856e7[_0xa471('0x4b')],_0x4856e7['query']);_0x581586[_0xa471('0x52')]=_[_0xa471('0x50')](_0x4856e7[_0xa471('0x4b')],qs['fields'](_0x487fdb[_0xa471('0x4d')][_0xa471('0x51')]));_0x581586[_0xa471('0x52')]=_0x581586['attributes']['length']?_0x581586[_0xa471('0x52')]:_0x4856e7[_0xa471('0x4b')];if(!_0x487fdb[_0xa471('0x4d')]['hasOwnProperty'](_0xa471('0x55'))){_0x581586[_0xa471('0x35')]=qs[_0xa471('0x35')](_0x487fdb[_0xa471('0x4d')][_0xa471('0x35')]);_0x581586[_0xa471('0x33')]=qs[_0xa471('0x33')](_0x487fdb[_0xa471('0x4d')][_0xa471('0x33')]);}_0x581586['order']=qs[_0xa471('0x57')](_0x487fdb[_0xa471('0x4d')]['sort']);_0x581586[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x487fdb[_0xa471('0x4d')],_0x4856e7[_0xa471('0x4f')]));_0x581586['where'][_0xa471('0x6b')]=_0xdeddc5['id'];if(_0x487fdb['query'][_0xa471('0x5d')]){_0x581586['where']=_['merge'](_0x581586[_0xa471('0x58')],{'$or':_['map'](_0x581586[_0xa471('0x52')],function(_0x2af347){var _0x550de3={};_0x550de3[_0x2af347]={'$like':'%'+_0x487fdb[_0xa471('0x4d')][_0xa471('0x5d')]+'%'};return _0x550de3;})});}if(_0x487fdb['query']['$gte']){var _0x2c173b=_0x487fdb['query'][_0xa471('0xa6')][_0xa471('0xa7')](',');var _0xac187d={};_0xac187d[_0x2c173b[0x0]]={'$gte':moment(_0x2c173b[0x1])[_0xa471('0xa8')](_0xa471('0xa9'))};_0x581586['where']=_[_0xa471('0x5a')](_0x581586[_0xa471('0x58')],_0xac187d);}_0x581586=_['merge']({},_0x581586,_0x487fdb[_0xa471('0x5e')]);return db[_0xa471('0xa5')][_0xa471('0x36')]({'where':_0x581586[_0xa471('0x58')]})['then'](function(_0x24d46f){_0x2cf5be[_0xa471('0x36')]=_0x24d46f;if(_0x487fdb[_0xa471('0x4d')][_0xa471('0x6c')]){_0x581586[_0xa471('0x6d')]=[{'all':!![]}];}return db['MailMessage'][_0xa471('0x5f')](_0x581586);})[_0xa471('0x25')](function(_0x28f864){if(_0x487fdb[_0xa471('0x4d')][_0xa471('0xaa')]===_0xa471('0xab')){for(var _0x145f55=0x0;_0x145f55<_0x28f864[_0xa471('0x53')];_0x145f55++){_0x28f864[_0x145f55][_0xa471('0x63')]=juice(_0x28f864[_0x145f55][_0xa471('0x63')]);}}_0x2cf5be[_0xa471('0x60')]=_0x28f864;return _0x2cf5be;});}})[_0xa471('0x25')](respondWithFilteredResult(_0xb9ecab,_0x581586))[_0xa471('0x65')](handleError(_0xb9ecab,null));};exports['send']=function(_0x43a150,_0x585dbe,_0x28f367){var _0xc3b38b,_0x39cdaf={},_0x25bd23;if(_0x43a150[_0xa471('0x63')]['to']){_0x25bd23=_0x43a150[_0xa471('0x63')]['to'][_0xa471('0xa7')](',')[0x0];}return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0x43a150[_0xa471('0x64')]['id']},'include':[{'model':db[_0xa471('0xac')],'as':_0xa471('0xad'),'include':[{'model':db['CmContact'],'as':_0xa471('0xae'),'where':{'email':_0x25bd23},'limit':0x1,'order':[[_0xa471('0xaf'),_0xa471('0xb0')]]}]},{'model':db[_0xa471('0x44')],'as':_0xa471('0x45'),'raw':!![]}]})[_0xa471('0x25')](handleEntityNotFound(_0x585dbe,null))[_0xa471('0x25')](function(_0x148850){if(_0x148850){_0xc3b38b=_0x148850;if(_0x148850[_0xa471('0x45')]){if(_['isNil'](_0x43a150[_0xa471('0x63')][_0xa471('0xb1')])){_0x43a150['body'][_0xa471('0xb1')]=util[_0xa471('0xa8')](_0xa471('0xb2'),_0x148850[_0xa471('0x8a')],_0x148850[_0xa471('0x75')]||_0x148850[_0xa471('0x45')][_0xa471('0x84')]);}if(_0x43a150[_0xa471('0x63')][_0xa471('0xb3')]&&_0x43a150[_0xa471('0x63')][_0xa471('0xb3')]['length']){for(var _0x5a1ae5=0x0;_0x5a1ae5<_0x43a150['body']['attachments'][_0xa471('0x53')];_0x5a1ae5+=0x1){_0x43a150[_0xa471('0x63')][_0xa471('0xb3')][_0x5a1ae5]={'filename':_0x43a150[_0xa471('0x63')]['attachments'][_0x5a1ae5][_0xa471('0x8a')],'path':path[_0xa471('0xb4')](config[_0xa471('0xb5')],_0xa471('0xb6'),_0x43a150[_0xa471('0x63')][_0xa471('0xb3')][_0x5a1ae5][_0xa471('0xb7')])};}}var _0x122f6b={'tls':{'rejectUnauthorized':![]}};if(_[_0xa471('0x77')](_0x148850['Smtp'][_0xa471('0x83')])){if(_0x148850[_0xa471('0x45')][_0xa471('0x80')]){_0x122f6b[_0xa471('0xb8')]={'user':_0x148850[_0xa471('0x45')][_0xa471('0x84')],'pass':_0x148850[_0xa471('0x45')]['pass']};}_0x122f6b['host']=_0x148850[_0xa471('0x45')][_0xa471('0x81')];_0x122f6b[_0xa471('0x82')]=_0x148850[_0xa471('0x45')][_0xa471('0x82')];_0x122f6b[_0xa471('0xb9')]=_0x148850[_0xa471('0x45')][_0xa471('0xb9')];}else{_0x122f6b[_0xa471('0x83')]=_0x148850[_0xa471('0x45')][_0xa471('0x83')];_0x122f6b['auth']={'user':_0x148850['Smtp'][_0xa471('0x84')],'pass':_0x148850[_0xa471('0x45')][_0xa471('0x7e')]};}return respondWithRpcPromise(_0xa471('0xba'),_0xa471('0xbb'),{'account':_0x122f6b,'message':_0x43a150['body']});}else{throw new Error(_0xa471('0xbc'));}}})[_0xa471('0x25')](function(_0x4be21c){if(_0x4be21c){_0x39cdaf=_0x4be21c;if(_0xc3b38b[_0xa471('0xad')]){if(_0xc3b38b['List']['Contacts'][_0xa471('0x53')]){return _0xc3b38b['List'][_0xa471('0xae')][0x0];}else{return db[_0xa471('0xbd')][_0xa471('0x69')](_[_0xa471('0x1f')](_0x43a150[_0xa471('0x63')],{'firstName':_0x43a150[_0xa471('0x63')]['to'],'email':_0x43a150['body']['to'],'phone':_0x43a150[_0xa471('0x63')]['to'],'ListId':_0xc3b38b['ListId']}));}}else{throw new Error(_0xa471('0xbc'));}}})['then'](function(_0x152a87){if(_0x152a87){var _0xe32784={'UserId':_0x43a150['user']['id'],'ContactId':_0x152a87['id'],'MailAccountId':_0xc3b38b['id'],'inReplyTo':_0x39cdaf['messageId'],'to':_0x43a150[_0xa471('0x63')][_0xa471('0xb1')],'cc':_0x43a150[_0xa471('0x63')]['cc'],'subject':_0x43a150[_0xa471('0x63')]['subject'],'attach':_0x43a150[_0xa471('0x63')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0xa471('0xa8')](_0xa471('0xa9')),'lastMsgDirection':_0xa471('0xbe'),'Messages':[_['merge'](_0x43a150['body'],{'messageId':_0x39cdaf[_0xa471('0xbf')],'sentAt':moment()[_0xa471('0xa8')](_0xa471('0xa9')),'read':!![],'MailAccountId':_0xc3b38b['id'],'UserId':_0x43a150[_0xa471('0x84')]['id'],'ContactId':_0x152a87['id']})]};if(_0x43a150[_0xa471('0x63')][_0xa471('0xc0')]){_0xe32784=_['merge'](_0xe32784,_0x43a150[_0xa471('0x63')][_0xa471('0xc0')]);}return db[_0xa471('0x94')]['create'](_0xe32784,{'include':[{'model':db[_0xa471('0xa5')],'as':_0xa471('0xc1')}]});}})['then'](respondWithResult(_0x585dbe,null))[_0xa471('0x65')](handleError(_0x585dbe,null));};exports[_0xa471('0xc2')]=function(_0x342a2b,_0x28a66e,_0x36974e){return db[_0xa471('0x48')]['find']({'where':{'id':_0x342a2b[_0xa471('0x64')]['id']},'include':[{'model':db[_0xa471('0x44')],'as':_0xa471('0x45'),'raw':!![]}]})[_0xa471('0x25')](handleEntityNotFound(_0x28a66e,null))[_0xa471('0x25')](function(_0x3b7c3){if(_0x3b7c3&&_0x3b7c3[_0xa471('0x45')]){var _0x502072={'id':_0x3b7c3['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3b7c3[_0xa471('0x45')]['service']){_0x502072[_0xa471('0x83')]=_0x3b7c3[_0xa471('0x45')][_0xa471('0x83')];}else{_0x502072[_0xa471('0x81')]=_0x3b7c3[_0xa471('0x45')][_0xa471('0x81')];_0x502072['port']=_0x3b7c3['Smtp'][_0xa471('0x82')];_0x502072[_0xa471('0xb9')]=_0x3b7c3[_0xa471('0x45')][_0xa471('0xb9')];}if(_0x3b7c3['Smtp'][_0xa471('0x80')]){_0x502072[_0xa471('0xb8')]={'user':_0x3b7c3[_0xa471('0x45')]['user'],'pass':_0x3b7c3['Smtp'][_0xa471('0x7e')]};}return respondWithRpcPromise(_0xa471('0xc3'),'verifySmtp',{'account':_0x502072});}})['then'](respondWithResult(_0x28a66e,null))['catch'](handleError(_0x28a66e,null));};exports['destroy']=function(_0x36a936,_0x3d7070){return db['MailAccount'][_0xa471('0x62')]({'where':{'id':_0x36a936['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x3d7070,null))[_0xa471('0x25')](function(_0x23eae8){if(_0x23eae8&&_0x23eae8['service']){throw new db['Sequelize'][(_0xa471('0xc4'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x23eae8;})[_0xa471('0x25')](removeEntity(_0x3d7070,null))[_0xa471('0x65')](handleError(_0x3d7070,null));};exports[_0xa471('0xc5')]=function(_0x30d0d0,_0x4773b1,_0x51684d){return db['MailAccount'][_0xa471('0x62')]({'where':{'id':_0x30d0d0[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x4773b1,null))[_0xa471('0x25')](function(_0x443779){if(_0x443779){return _0x443779[_0xa471('0xc5')](_0x30d0d0[_0xa471('0x63')][_0xa471('0x6f')],_[_0xa471('0x95')](_0x30d0d0[_0xa471('0x63')],[_0xa471('0x6f'),'id'])||{})[_0xa471('0xc6')](function(_0x27ddd5){for(var _0x194352=0x0;_0x194352<_0x30d0d0[_0xa471('0x63')][_0xa471('0x6f')][_0xa471('0x53')];_0x194352+=0x1){socket[_0xa471('0xc7')](_0xa471('0xc8'),{'UserId':Number(_0x30d0d0[_0xa471('0x63')][_0xa471('0x6f')][_0x194352]),'MailAccountId':Number(_0x30d0d0[_0xa471('0x64')]['id'])});}return _0x27ddd5;});}})[_0xa471('0x25')](respondWithResult(_0x4773b1,null))[_0xa471('0x65')](handleError(_0x4773b1,null));};exports['removeAgents']=function(_0x464efe,_0x2bb86b,_0x135d13){return db['MailAccount']['find']({'where':{'id':_0x464efe[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x2bb86b,null))[_0xa471('0x25')](function(_0x4833dd){if(_0x4833dd){return _0x4833dd[_0xa471('0xc9')](_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')])[_0xa471('0x25')](function(){if(_[_0xa471('0xca')](_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')])){for(var _0x155d6e=0x0;_0x155d6e<_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')][_0xa471('0x53')];_0x155d6e+=0x1){socket['emit'](_0xa471('0xcb'),{'UserId':Number(_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')][_0x155d6e]),'MailAccountId':Number(_0x464efe['params']['id'])});}}else{socket[_0xa471('0xc7')](_0xa471('0xcb'),{'UserId':Number(_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')]),'MailAccountId':Number(_0x464efe[_0xa471('0x64')]['id'])});}});}})[_0xa471('0x25')](respondWithStatusCode(_0x2bb86b,null))[_0xa471('0x65')](handleError(_0x2bb86b,null));};exports[_0xa471('0xcc')]=function(_0x105641,_0x4630e3,_0x5ad713){var _0x514484={};var _0x9c3bb0={};var _0x43dfb6;var _0x576210;return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x105641['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x4630e3,null))[_0xa471('0x25')](function(_0x12e429){if(_0x12e429){_0x43dfb6=_0x12e429;_0x9c3bb0['model']=_['keys'](db[_0xa471('0x98')][_0xa471('0x49')]);_0x9c3bb0[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x105641[_0xa471('0x4d')]);_0x9c3bb0[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x9c3bb0[_0xa471('0x4b')],_0x9c3bb0[_0xa471('0x4d')]);_0x514484[_0xa471('0x52')]=_[_0xa471('0x50')](_0x9c3bb0['model'],qs['fields'](_0x105641[_0xa471('0x4d')][_0xa471('0x51')]));_0x514484[_0xa471('0x52')]=_0x514484[_0xa471('0x52')][_0xa471('0x53')]?_0x514484[_0xa471('0x52')]:_0x9c3bb0[_0xa471('0x4b')];_0x514484[_0xa471('0x56')]=qs[_0xa471('0x57')](_0x105641[_0xa471('0x4d')][_0xa471('0x57')]);_0x514484['where']=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x105641[_0xa471('0x4d')],_0x9c3bb0[_0xa471('0x4f')]));if(_0x105641[_0xa471('0x4d')][_0xa471('0x5d')]){_0x514484['where']=_[_0xa471('0x5a')](_0x514484[_0xa471('0x58')],{'$or':_[_0xa471('0x4c')](_0x514484[_0xa471('0x52')],function(_0xf1633b){var _0x51a4d7={};_0x51a4d7[_0xf1633b]={'$like':'%'+_0x105641[_0xa471('0x4d')][_0xa471('0x5d')]+'%'};return _0x51a4d7;})});}_0x514484=_['merge']({},_0x514484,_0x105641[_0xa471('0x5e')]);return _0x43dfb6[_0xa471('0xcc')](_0x514484);}})['then'](function(_0x59f7a1){if(_0x59f7a1){_0x576210=_0x59f7a1[_0xa471('0x53')];if(!_0x105641[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x514484['limit']=qs[_0xa471('0x35')](_0x105641['query'][_0xa471('0x35')]);_0x514484[_0xa471('0x33')]=qs[_0xa471('0x33')](_0x105641[_0xa471('0x4d')]['offset']);}return _0x43dfb6[_0xa471('0xcc')](_0x514484);}})[_0xa471('0x25')](function(_0x2b594d){if(_0x2b594d){return _0x2b594d?{'count':_0x576210,'rows':_0x2b594d}:null;}})['then'](respondWithResult(_0x4630e3,null))[_0xa471('0x65')](handleError(_0x4630e3,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index d4d73e1..b14e1c1 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 _0xc506=['hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x272df8,_0x1904c0){var _0x1100fe=function(_0x571fc9){while(--_0x571fc9){_0x272df8['push'](_0x272df8['shift']());}};_0x1100fe(++_0x1904c0);}(_0xc506,0x86));var _0x6c50=function(_0x1f6775,_0x46110c){_0x1f6775=_0x1f6775-0x0;var _0x908991=_0xc506[_0x1f6775];return _0x908991;};'use strict';var EventEmitter=require(_0x6c50('0x0'));var MailAccount=require(_0x6c50('0x1'))['db'][_0x6c50('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6c50('0x3')](0x0);var events={'afterCreate':_0x6c50('0x4'),'afterUpdate':_0x6c50('0x5'),'afterDestroy':_0x6c50('0x6')};function emitEvent(_0x42bc4f){return function(_0x306ea5,_0x47b9df,_0x4c67c3){MailAccountEvents[_0x6c50('0x7')](_0x42bc4f+':'+_0x306ea5['id'],_0x306ea5);MailAccountEvents['emit'](_0x42bc4f,_0x306ea5);_0x4c67c3(null);};}for(var e in events){if(events[_0x6c50('0x8')](e)){var event=events[e];MailAccount[_0x6c50('0x9')](e,emitEvent(event));}}module[_0x6c50('0xa')]=MailAccountEvents; \ No newline at end of file +var _0x36c3=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x33fd8e,_0x19845d){var _0x1cc3a5=function(_0x4a55d0){while(--_0x4a55d0){_0x33fd8e['push'](_0x33fd8e['shift']());}};_0x1cc3a5(++_0x19845d);}(_0x36c3,0x1a6));var _0x336c=function(_0x39e9f4,_0x7da7be){_0x39e9f4=_0x39e9f4-0x0;var _0x16b495=_0x36c3[_0x39e9f4];return _0x16b495;};'use strict';var EventEmitter=require(_0x336c('0x0'));var MailAccount=require(_0x336c('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x336c('0x2')](0x0);var events={'afterCreate':_0x336c('0x3'),'afterUpdate':_0x336c('0x4'),'afterDestroy':_0x336c('0x5')};function emitEvent(_0x32aed2){return function(_0x2b1194,_0x39ed12,_0x4e4c07){MailAccountEvents[_0x336c('0x6')](_0x32aed2+':'+_0x2b1194['id'],_0x2b1194);MailAccountEvents[_0x336c('0x6')](_0x32aed2,_0x2b1194);_0x4e4c07(null);};}for(var e in events){if(events[_0x336c('0x7')](e)){var event=events[e];MailAccount[_0x336c('0x8')](e,emitEvent(event));}}module[_0x336c('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2e87f29..18df50b 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 _0x1cff=['./mailAccount.attributes','exports','define','mail_accounts','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1c4333,_0x509a89){var _0x407dd9=function(_0xd0be90){while(--_0xd0be90){_0x1c4333['push'](_0x1c4333['shift']());}};_0x407dd9(++_0x509a89);}(_0x1cff,0x1a2));var _0xf1cf=function(_0x21531c,_0x40593b){_0x21531c=_0x21531c-0x0;var _0x32db2e=_0x1cff[_0x21531c];return _0x32db2e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf1cf('0x0'));var rp=require(_0xf1cf('0x1'));var fs=require('fs');var path=require(_0xf1cf('0x2'));var rimraf=require(_0xf1cf('0x3'));var config=require(_0xf1cf('0x4'));var attributes=require(_0xf1cf('0x5'));module[_0xf1cf('0x6')]=function(_0x354076,_0x6644c3){return _0x354076[_0xf1cf('0x7')]('MailAccount',attributes,{'tableName':_0xf1cf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x079b=['exports','MailAccount','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x9e98cf,_0x217d15){var _0x22d06c=function(_0x6a7f0c){while(--_0x6a7f0c){_0x9e98cf['push'](_0x9e98cf['shift']());}};_0x22d06c(++_0x217d15);}(_0x079b,0x1c4));var _0xb079=function(_0x31687e,_0x42b91a){_0x31687e=_0x31687e-0x0;var _0x10fbb4=_0x079b[_0x31687e];return _0x10fbb4;};'use strict';var _=require('lodash');var util=require(_0xb079('0x0'));var logger=require(_0xb079('0x1'))(_0xb079('0x2'));var moment=require(_0xb079('0x3'));var BPromise=require('bluebird');var rp=require(_0xb079('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb079('0x5'));var config=require(_0xb079('0x6'));var attributes=require('./mailAccount.attributes');module[_0xb079('0x7')]=function(_0x1c3bd8,_0x2a5ec0){return _0x1c3bd8['define'](_0xb079('0x8'),attributes,{'tableName':'mail_accounts','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 e59df4e..6931d70 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 _0x2200=['options','raw','where','attributes','limit','include','map','model','then','debug','MailAccount','find','ShowMailAccount','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','CompanyId','isNil','from','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','updatedAt','DESC','MailApplication','Applications','MailServerOut','get','account','omit','applications','list','orderBy','asc','autoclose','close','length','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found','update','interaction','attachments','originTo','originCc','originChannel','Attachments','UserId','User','unshift','agent','name','*,*,*,*','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','register','info','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','findAll'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0x2200,0x174));var _0x0220=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0x2200[_0x3c858f];return _0x198090;};'use strict';var _=require('lodash');var util=require(_0x0220('0x0'));var moment=require(_0x0220('0x1'));var BPromise=require(_0x0220('0x2'));var rs=require(_0x0220('0x3'));var fs=require('fs');var Redis=require(_0x0220('0x4'));var db=require(_0x0220('0x5'))['db'];var utils=require(_0x0220('0x6'));var logger=require('../../config/logger')(_0x0220('0x7'));var config=require(_0x0220('0x8'));var jayson=require(_0x0220('0x9'));var client=jayson['client'][_0x0220('0xa')]({'port':0x232c});config['redis']=_[_0x0220('0xb')](config[_0x0220('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0220('0xd'))(new Redis(config[_0x0220('0xc')]));require('./mailAccount.socket')[_0x0220('0xe')](socket);function respondWithRpcPromise(_0x571376,_0x58fb09,_0x4960ef){return new BPromise(function(_0xa89b80,_0x17f4f5){return client['request'](_0x571376,_0x4960ef)['then'](function(_0x1e5ed1){logger[_0x0220('0xf')]('MailAccount,\x20%s,\x20%s',_0x58fb09,_0x0220('0x10'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x58fb09,_0x0220('0x10'),JSON['stringify'](_0x1e5ed1));if(_0x1e5ed1[_0x0220('0x11')]){if(_0x1e5ed1['error'][_0x0220('0x12')]===0x1f4){logger['error'](_0x0220('0x13'),_0x58fb09,_0x1e5ed1['error'][_0x0220('0x14')]);return _0x17f4f5(_0x1e5ed1[_0x0220('0x11')][_0x0220('0x14')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x58fb09,_0x1e5ed1[_0x0220('0x11')]['message']);return _0xa89b80(_0x1e5ed1[_0x0220('0x11')][_0x0220('0x14')]);}else{logger[_0x0220('0xf')](_0x0220('0x13'),_0x58fb09,'request\x20sent');_0xa89b80(_0x1e5ed1['result'][_0x0220('0x14')]);}})[_0x0220('0x15')](function(_0x4fd848){logger[_0x0220('0x11')]('MailAccount,\x20%s,\x20%s',_0x58fb09,_0x4fd848);_0x17f4f5(_0x4fd848);});});}exports[_0x0220('0x16')]=function(_0x2ea069){var _0x4cd327=this;return new Promise(function(_0x42c768,_0x4f9820){return db['MailAccount'][_0x0220('0x17')]({'raw':_0x2ea069[_0x0220('0x18')]?_0x2ea069[_0x0220('0x18')][_0x0220('0x19')]===undefined?!![]:![]:!![],'where':_0x2ea069[_0x0220('0x18')]?_0x2ea069[_0x0220('0x18')][_0x0220('0x1a')]||null:null,'attributes':_0x2ea069['options']?_0x2ea069[_0x0220('0x18')][_0x0220('0x1b')]||null:null,'limit':_0x2ea069[_0x0220('0x18')]?_0x2ea069[_0x0220('0x18')][_0x0220('0x1c')]||null:null,'include':_0x2ea069[_0x0220('0x18')]?_0x2ea069[_0x0220('0x18')][_0x0220('0x1d')]?_[_0x0220('0x1e')](_0x2ea069[_0x0220('0x18')][_0x0220('0x1d')],function(_0x5b27ea){return{'model':db[_0x5b27ea['model']],'as':_0x5b27ea['as'],'attributes':_0x5b27ea[_0x0220('0x1b')],'include':_0x5b27ea[_0x0220('0x1d')]?_[_0x0220('0x1e')](_0x5b27ea[_0x0220('0x1d')],function(_0x1137f8){return{'model':db[_0x1137f8[_0x0220('0x1f')]],'as':_0x1137f8['as'],'attributes':_0x1137f8[_0x0220('0x1b')],'include':_0x1137f8['include']?_[_0x0220('0x1e')](_0x1137f8[_0x0220('0x1d')],function(_0x384814){return{'model':db[_0x384814[_0x0220('0x1f')]],'as':_0x384814['as'],'attributes':_0x384814[_0x0220('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0220('0x20')](function(_0x1e966b){logger[_0x0220('0xf')]('GetMailAccount',_0x2ea069);logger[_0x0220('0x21')]('GetMailAccount',_0x2ea069,JSON['stringify'](_0x1e966b));_0x42c768(_0x1e966b);})[_0x0220('0x15')](function(_0x20a02f){logger[_0x0220('0x11')](_0x0220('0x16'),_0x20a02f[_0x0220('0x14')],_0x2ea069);_0x4f9820(_0x4cd327['error'](0x1f4,_0x20a02f[_0x0220('0x14')]));});});};exports['ShowMailAccount']=function(_0x4713df){var _0x1b960c=this;return new Promise(function(_0x29c312,_0x56fab7){return db[_0x0220('0x22')][_0x0220('0x23')]({'raw':_0x4713df[_0x0220('0x18')]?_0x4713df['options'][_0x0220('0x19')]===undefined?!![]:![]:!![],'where':_0x4713df[_0x0220('0x18')]?_0x4713df['options'][_0x0220('0x1a')]||null:null,'attributes':_0x4713df['options']?_0x4713df[_0x0220('0x18')][_0x0220('0x1b')]||null:null,'include':_0x4713df['options']?_0x4713df[_0x0220('0x18')][_0x0220('0x1d')]?_[_0x0220('0x1e')](_0x4713df[_0x0220('0x18')]['include'],function(_0x4530c2){return{'model':db[_0x4530c2[_0x0220('0x1f')]],'as':_0x4530c2['as'],'attributes':_0x4530c2['attributes'],'include':_0x4530c2[_0x0220('0x1d')]?_[_0x0220('0x1e')](_0x4530c2['include'],function(_0x547570){return{'model':db[_0x547570[_0x0220('0x1f')]],'as':_0x547570['as'],'attributes':_0x547570[_0x0220('0x1b')],'include':_0x547570['include']?_[_0x0220('0x1e')](_0x547570[_0x0220('0x1d')],function(_0x2b9350){return{'model':db[_0x2b9350[_0x0220('0x1f')]],'as':_0x2b9350['as'],'attributes':_0x2b9350[_0x0220('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0220('0x20')](function(_0x59d78c){logger[_0x0220('0xf')](_0x0220('0x24'),_0x4713df);logger[_0x0220('0x21')](_0x0220('0x24'),_0x4713df,JSON[_0x0220('0x25')](_0x59d78c));_0x29c312(_0x59d78c);})['catch'](function(_0x122d82){logger['error']('ShowMailAccount',_0x122d82['message'],_0x4713df);_0x56fab7(_0x1b960c[_0x0220('0x11')](0x1f4,_0x122d82[_0x0220('0x14')]));});});};exports[_0x0220('0x26')]=function(_0x2058a1){var _0x2aff3b=this;return new Promise(function(_0x49973b,_0x1a5399){var _0x48d9fe={'body':_0x2058a1[_0x0220('0x27')],'channel':_0x0220('0x28')};var _0x225c60=_[_0x0220('0x29')](_[_0x0220('0x2a')](db[_0x0220('0x2b')][_0x0220('0x2c')]),['createdAt','updatedAt',_0x0220('0x2d'),'ListId']);var _0x5ac0ad=![];if(_0x2058a1[_0x0220('0x27')]['id']){delete _0x2058a1['body']['id'];}if(_[_0x0220('0x2e')](_0x2058a1[_0x0220('0x27')][_0x0220('0x2f')])){return _0x1a5399(_0x2aff3b[_0x0220('0x11')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x2058a1['body']['body'])||_0x2058a1[_0x0220('0x27')]['body']===''){return _0x1a5399(_0x2aff3b['error'](0x1f4,_0x0220('0x30')));}if(_[_0x0220('0x2e')](_0x2058a1[_0x0220('0x27')]['mapKey'])){return _0x1a5399(_0x2aff3b['error'](0x1f4,_0x0220('0x31')+_0x225c60));}if(!_[_0x0220('0x32')](_0x225c60,_0x2058a1['body'][_0x0220('0x33')])){return _0x1a5399(_0x2aff3b[_0x0220('0x11')](0x1f4,_0x0220('0x34')+_0x225c60));}var _0x3895ae={};_0x3895ae[_0x2058a1['body'][_0x0220('0x33')]]=_0x2058a1[_0x0220('0x27')][_0x0220('0x2f')];return db[_0x0220('0x22')]['find']({'where':{'id':_0x2058a1['account']['id']},'include':[{'model':db[_0x0220('0x35')],'as':_0x0220('0x36'),'include':[{'model':db[_0x0220('0x2b')],'as':_0x0220('0x37'),'where':_0x3895ae,'limit':0x1,'order':[[_0x0220('0x38'),_0x0220('0x39')]]}]},{'model':db[_0x0220('0x3a')],'as':_0x0220('0x3b')},{'model':db[_0x0220('0x3c')],'as':'Smtp'}]})['then'](function(_0x36081d){if(_0x36081d&&_0x36081d[_0x0220('0x36')]){var _0x4ce798=_0x36081d[_0x0220('0x3d')]({'plain':!![]});_0x48d9fe[_0x0220('0x3e')]=_[_0x0220('0x3f')](_0x4ce798,[_0x0220('0x3b'),_0x0220('0x36')]);_0x48d9fe[_0x0220('0x40')]=_0x4ce798[_0x0220('0x3b')];_0x48d9fe[_0x0220('0x41')]=_0x4ce798[_0x0220('0x36')];_0x48d9fe[_0x0220('0x40')]=_[_0x0220('0x42')](_0x48d9fe[_0x0220('0x40')],['priority'],[_0x0220('0x43')]);if(_0x48d9fe[_0x0220('0x3e')]&&_0x48d9fe[_0x0220('0x3e')][_0x0220('0x44')]){_0x48d9fe[_0x0220('0x40')]['push']({'id':0x0,'priority':_0x48d9fe['applications']['length']+0x1,'app':_0x0220('0x45'),'appdata':_0x0220('0x44'),'interval':'*,*,*,*'});}if(_0x48d9fe[_0x0220('0x3e')][_0x0220('0x3b')]){delete _0x48d9fe['account']['Applications'];}if(_0x48d9fe['account'][_0x0220('0x36')]){delete _0x48d9fe['account']['List'];}if(_0x4ce798[_0x0220('0x36')][_0x0220('0x37')][_0x0220('0x46')]){return _0x4ce798['List']['Contacts'][0x0];}var _0x23310e=_['defaults'](_0x2058a1[_0x0220('0x27')],{'firstName':_0x2058a1[_0x0220('0x27')][_0x0220('0x2f')],'ListId':_0x4ce798[_0x0220('0x47')]});_0x23310e[_0x2058a1[_0x0220('0x27')][_0x0220('0x33')]]=_0x2058a1[_0x0220('0x27')][_0x0220('0x2f')];return db[_0x0220('0x2b')][_0x0220('0x48')](_0x23310e);}else{throw new Error(_0x0220('0x49'));}})[_0x0220('0x20')](function(_0x816ec6){_0x48d9fe[_0x0220('0x4a')]=_0x816ec6;if(_0x816ec6){if(!_0x2058a1[_0x0220('0x27')]['message'][_0x0220('0x4b')]){_0x2058a1['body'][_0x0220('0x14')][_0x0220('0x4b')]=rs[_0x0220('0x4c')]()+'\x20'+_0x2058a1['body'][_0x0220('0x14')]['from'];}var _0x1431d2={'ContactId':_0x816ec6['id'],'MailAccountId':_0x2058a1['account']['id'],'inReplyTo':_0x2058a1['body']['message'][_0x0220('0x4b')],'to':_0x2058a1['body'][_0x0220('0x14')]['from'],'cc':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')]['cc'],'subject':_0x2058a1[_0x0220('0x27')]['message'][_0x0220('0x4d')],'attach':_0x2058a1['body'][_0x0220('0x14')][_0x0220('0x4e')],'lastMsgAt':moment()[_0x0220('0x4f')](_0x0220('0x50')),'lastMsgDirection':'in'};return db[_0x0220('0x51')][_0x0220('0x23')]({'where':{'closed':![],'MailAccountId':_0x2058a1[_0x0220('0x3e')]['id']},'include':[{'model':db[_0x0220('0x52')],'as':'Messages','attributes':[_0x0220('0x4b')],'where':{'messageId':_0x2058a1['body'][_0x0220('0x14')]['inReplyTo']}}]})[_0x0220('0x20')](function(_0x38c960){if(_0x38c960){return[_0x38c960,![]];}return db['MailInteraction']['create'](_0x1431d2)[_0x0220('0x20')](function(_0x41d8f5){return[_0x41d8f5,!![]];});});}else{throw new Error(_0x0220('0x53'));}})['spread'](function(_0x502a3b,_0x2da972){if(_0x502a3b){_0x5ac0ad=_0x2da972;if(!_0x2da972){return _0x502a3b[_0x0220('0x54')]({'inReplyTo':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')]['messageId'],'to':_0x2058a1[_0x0220('0x27')]['message'][_0x0220('0x2f')],'cc':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')]['cc'],'subject':_0x2058a1[_0x0220('0x27')]['message'][_0x0220('0x4d')],'attach':_0x502a3b['attach']?_0x502a3b[_0x0220('0x4e')]:_0x2058a1[_0x0220('0x27')][_0x0220('0x14')][_0x0220('0x4e')],'substatus':null,'substatusAt':moment()[_0x0220('0x4f')](_0x0220('0x50')),'lastMsgAt':moment()[_0x0220('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x502a3b;}}})[_0x0220('0x20')](function(_0x55b5b1){_0x48d9fe['interaction']=_0x55b5b1['get']({'plain':!![]});_0x48d9fe[_0x0220('0x55')]['created']=_0x5ac0ad;return db[_0x0220('0x52')][_0x0220('0x48')]({'body':_0x2058a1['body']['body'],'MailAccountId':_0x2058a1[_0x0220('0x3e')]['id'],'MailInteractionId':_0x55b5b1['id'],'direction':'in','ContactId':_0x48d9fe[_0x0220('0x4a')]['id'],'messageId':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')][_0x0220('0x4b')],'from':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')][_0x0220('0x2f')],'to':_0x2058a1['body'][_0x0220('0x14')]['to'],'cc':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')]['cc'],'subject':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')][_0x0220('0x4d')],'attach':_0x2058a1['body'][_0x0220('0x14')]['attach'],'Attachments':_0x2058a1[_0x0220('0x27')]['message'][_0x0220('0x56')],'originTo':_0x2058a1[_0x0220('0x27')]['message'][_0x0220('0x57')],'originCc':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')][_0x0220('0x58')],'bcc':_0x2058a1['body'][_0x0220('0x14')]['bcc'],'ChatWebsiteId':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')]['ChatWebsiteId']||null,'originChannel':_0x2058a1[_0x0220('0x27')][_0x0220('0x14')][_0x0220('0x59')]||'Email','ChatOfflineMessageId':_0x2058a1[_0x0220('0x27')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0x0220('0x5a')}]});})[_0x0220('0x20')](function(_0x12bdaf){_0x48d9fe[_0x0220('0x14')]=_0x12bdaf;if(_0x48d9fe['interaction'][_0x0220('0x5b')]){return db[_0x0220('0x5c')][_0x0220('0x23')]({'attributes':['id','name'],'where':{'id':_0x48d9fe[_0x0220('0x55')][_0x0220('0x5b')]}})[_0x0220('0x20')](function(_0x2ea1d3){if(_0x2ea1d3){_0x48d9fe[_0x0220('0x40')][_0x0220('0x5d')]({'id':0x0,'priority':0x0,'app':_0x0220('0x5e'),'appdata':_0x2ea1d3[_0x0220('0x5f')]+','+(_0x48d9fe['account']['waitForTheAssignedAgent']||0xa),'interval':_0x0220('0x60')});}return respondWithRpcPromise(_0x0220('0x61'),_0x0220('0x62'),_0x48d9fe);});}return respondWithRpcPromise(_0x0220('0x61'),_0x0220('0x62'),_0x48d9fe);})[_0x0220('0x20')](function(_0x42e23a){_0x49973b(_0x42e23a);})[_0x0220('0x15')](function(_0x266913){_0x1a5399(_0x2aff3b[_0x0220('0x11')](0x1f4,_0x266913[_0x0220('0x14')]));});});}; \ No newline at end of file +var _0xd11f=['register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowMailAccount','find','NotifyMailAccount','mail','keys','CmContact','createdAt','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','Applications','MailServerOut','Smtp','List','get','omit','applications','list','orderBy','priority','push','length','close','autoclose','*,*,*,*','ListId','create','List\x20not\x20found','contact','messageId','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','subject','interaction','created','attachments','originTo','originCc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./mailAccount.socket'];(function(_0x213761,_0x39e4dd){var _0x11b67d=function(_0x45f79d){while(--_0x45f79d){_0x213761['push'](_0x213761['shift']());}};_0x11b67d(++_0x39e4dd);}(_0xd11f,0x133));var _0xfd11=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xd11f[_0x817d9b];return _0x2752e1;};'use strict';var _=require(_0xfd11('0x0'));var util=require(_0xfd11('0x1'));var moment=require(_0xfd11('0x2'));var BPromise=require(_0xfd11('0x3'));var rs=require(_0xfd11('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd11('0x5'));var logger=require(_0xfd11('0x6'))('rpc');var config=require(_0xfd11('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfd11('0x8')][_0xfd11('0x9')]({'port':0x232c});config[_0xfd11('0xa')]=_[_0xfd11('0xb')](config[_0xfd11('0xa')],{'host':_0xfd11('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd11('0xa')]));require(_0xfd11('0xd'))[_0xfd11('0xe')](socket);function respondWithRpcPromise(_0x47c319,_0x4b45f9,_0x356a68){return new BPromise(function(_0x410fa0,_0x588ce0){return client[_0xfd11('0xf')](_0x47c319,_0x356a68)[_0xfd11('0x10')](function(_0x347029){logger[_0xfd11('0x11')](_0xfd11('0x12'),_0x4b45f9,_0xfd11('0x13'));logger[_0xfd11('0x14')](_0xfd11('0x15'),_0x4b45f9,_0xfd11('0x13'),JSON['stringify'](_0x347029));if(_0x347029[_0xfd11('0x16')]){if(_0x347029[_0xfd11('0x16')][_0xfd11('0x17')]===0x1f4){logger[_0xfd11('0x16')](_0xfd11('0x12'),_0x4b45f9,_0x347029['error'][_0xfd11('0x18')]);return _0x588ce0(_0x347029[_0xfd11('0x16')][_0xfd11('0x18')]);}logger['error'](_0xfd11('0x12'),_0x4b45f9,_0x347029[_0xfd11('0x16')]['message']);return _0x410fa0(_0x347029[_0xfd11('0x16')][_0xfd11('0x18')]);}else{logger[_0xfd11('0x11')]('MailAccount,\x20%s,\x20%s',_0x4b45f9,_0xfd11('0x13'));_0x410fa0(_0x347029[_0xfd11('0x19')][_0xfd11('0x18')]);}})[_0xfd11('0x1a')](function(_0x1ff125){logger[_0xfd11('0x16')](_0xfd11('0x12'),_0x4b45f9,_0x1ff125);_0x588ce0(_0x1ff125);});});}exports[_0xfd11('0x1b')]=function(_0xeb2eb2){var _0x5c7f4b=this;return new Promise(function(_0x427985,_0xe1ae54){return db[_0xfd11('0x1c')][_0xfd11('0x1d')]({'raw':_0xeb2eb2['options']?_0xeb2eb2[_0xfd11('0x1e')][_0xfd11('0x1f')]===undefined?!![]:![]:!![],'where':_0xeb2eb2[_0xfd11('0x1e')]?_0xeb2eb2[_0xfd11('0x1e')][_0xfd11('0x20')]||null:null,'attributes':_0xeb2eb2['options']?_0xeb2eb2['options'][_0xfd11('0x21')]||null:null,'limit':_0xeb2eb2[_0xfd11('0x1e')]?_0xeb2eb2[_0xfd11('0x1e')][_0xfd11('0x22')]||null:null,'include':_0xeb2eb2[_0xfd11('0x1e')]?_0xeb2eb2[_0xfd11('0x1e')][_0xfd11('0x23')]?_['map'](_0xeb2eb2['options']['include'],function(_0x1a90a8){return{'model':db[_0x1a90a8[_0xfd11('0x24')]],'as':_0x1a90a8['as'],'attributes':_0x1a90a8[_0xfd11('0x21')],'include':_0x1a90a8[_0xfd11('0x23')]?_[_0xfd11('0x25')](_0x1a90a8['include'],function(_0x28ae5f){return{'model':db[_0x28ae5f[_0xfd11('0x24')]],'as':_0x28ae5f['as'],'attributes':_0x28ae5f[_0xfd11('0x21')],'include':_0x28ae5f['include']?_[_0xfd11('0x25')](_0x28ae5f['include'],function(_0x56b1ca){return{'model':db[_0x56b1ca['model']],'as':_0x56b1ca['as'],'attributes':_0x56b1ca[_0xfd11('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfd11('0x10')](function(_0x258a48){logger[_0xfd11('0x11')](_0xfd11('0x1b'),_0xeb2eb2);logger[_0xfd11('0x14')]('GetMailAccount',_0xeb2eb2,JSON[_0xfd11('0x26')](_0x258a48));_0x427985(_0x258a48);})[_0xfd11('0x1a')](function(_0x1eb45a){logger[_0xfd11('0x16')](_0xfd11('0x1b'),_0x1eb45a[_0xfd11('0x18')],_0xeb2eb2);_0xe1ae54(_0x5c7f4b[_0xfd11('0x16')](0x1f4,_0x1eb45a[_0xfd11('0x18')]));});});};exports[_0xfd11('0x27')]=function(_0x17dfa8){var _0xeb73b=this;return new Promise(function(_0x177e11,_0xab90db){return db[_0xfd11('0x1c')][_0xfd11('0x28')]({'raw':_0x17dfa8[_0xfd11('0x1e')]?_0x17dfa8[_0xfd11('0x1e')][_0xfd11('0x1f')]===undefined?!![]:![]:!![],'where':_0x17dfa8['options']?_0x17dfa8['options'][_0xfd11('0x20')]||null:null,'attributes':_0x17dfa8['options']?_0x17dfa8[_0xfd11('0x1e')]['attributes']||null:null,'include':_0x17dfa8['options']?_0x17dfa8['options'][_0xfd11('0x23')]?_[_0xfd11('0x25')](_0x17dfa8[_0xfd11('0x1e')][_0xfd11('0x23')],function(_0x570391){return{'model':db[_0x570391[_0xfd11('0x24')]],'as':_0x570391['as'],'attributes':_0x570391[_0xfd11('0x21')],'include':_0x570391[_0xfd11('0x23')]?_['map'](_0x570391['include'],function(_0x5c69c7){return{'model':db[_0x5c69c7[_0xfd11('0x24')]],'as':_0x5c69c7['as'],'attributes':_0x5c69c7[_0xfd11('0x21')],'include':_0x5c69c7[_0xfd11('0x23')]?_['map'](_0x5c69c7['include'],function(_0x49a567){return{'model':db[_0x49a567[_0xfd11('0x24')]],'as':_0x49a567['as'],'attributes':_0x49a567['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd11('0x10')](function(_0x1dfbc8){logger[_0xfd11('0x11')](_0xfd11('0x27'),_0x17dfa8);logger[_0xfd11('0x14')](_0xfd11('0x27'),_0x17dfa8,JSON[_0xfd11('0x26')](_0x1dfbc8));_0x177e11(_0x1dfbc8);})['catch'](function(_0x369150){logger[_0xfd11('0x16')](_0xfd11('0x27'),_0x369150[_0xfd11('0x18')],_0x17dfa8);_0xab90db(_0xeb73b[_0xfd11('0x16')](0x1f4,_0x369150['message']));});});};exports[_0xfd11('0x29')]=function(_0x22b8a5){var _0x173bb5=this;return new Promise(function(_0x252513,_0xa9e3c4){var _0x4878a2={'body':_0x22b8a5['body'],'channel':_0xfd11('0x2a')};var _0x3e8123=_['difference'](_[_0xfd11('0x2b')](db[_0xfd11('0x2c')]['rawAttributes']),[_0xfd11('0x2d'),_0xfd11('0x2e'),_0xfd11('0x2f'),'ListId']);var _0x4492f7=![];if(_0x22b8a5[_0xfd11('0x30')]['id']){delete _0x22b8a5[_0xfd11('0x30')]['id'];}if(_['isNil'](_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x31')])){return _0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,_0xfd11('0x32')));}if(_[_0xfd11('0x33')](_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x30')])||_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x30')]===''){return _0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,_0xfd11('0x34')));}if(_[_0xfd11('0x33')](_0x22b8a5['body']['mapKey'])){return _0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e8123));}if(!_[_0xfd11('0x35')](_0x3e8123,_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x36')])){return _0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,_0xfd11('0x37')+_0x3e8123));}var _0xe09b31={};_0xe09b31[_0x22b8a5['body'][_0xfd11('0x36')]]=_0x22b8a5[_0xfd11('0x30')]['from'];return db[_0xfd11('0x1c')][_0xfd11('0x28')]({'where':{'id':_0x22b8a5[_0xfd11('0x38')]['id']},'include':[{'model':db[_0xfd11('0x39')],'as':'List','include':[{'model':db['CmContact'],'as':_0xfd11('0x3a'),'where':_0xe09b31,'limit':0x1,'order':[[_0xfd11('0x2e'),_0xfd11('0x3b')]]}]},{'model':db['MailApplication'],'as':_0xfd11('0x3c')},{'model':db[_0xfd11('0x3d')],'as':_0xfd11('0x3e')}]})[_0xfd11('0x10')](function(_0x13e922){if(_0x13e922&&_0x13e922[_0xfd11('0x3f')]){var _0x79faab=_0x13e922[_0xfd11('0x40')]({'plain':!![]});_0x4878a2[_0xfd11('0x38')]=_[_0xfd11('0x41')](_0x79faab,[_0xfd11('0x3c'),_0xfd11('0x3f')]);_0x4878a2[_0xfd11('0x42')]=_0x79faab[_0xfd11('0x3c')];_0x4878a2[_0xfd11('0x43')]=_0x79faab[_0xfd11('0x3f')];_0x4878a2[_0xfd11('0x42')]=_[_0xfd11('0x44')](_0x4878a2[_0xfd11('0x42')],[_0xfd11('0x45')],['asc']);if(_0x4878a2[_0xfd11('0x38')]&&_0x4878a2[_0xfd11('0x38')]['autoclose']){_0x4878a2[_0xfd11('0x42')][_0xfd11('0x46')]({'id':0x0,'priority':_0x4878a2['applications'][_0xfd11('0x47')]+0x1,'app':_0xfd11('0x48'),'appdata':_0xfd11('0x49'),'interval':_0xfd11('0x4a')});}if(_0x4878a2['account'][_0xfd11('0x3c')]){delete _0x4878a2[_0xfd11('0x38')][_0xfd11('0x3c')];}if(_0x4878a2[_0xfd11('0x38')]['List']){delete _0x4878a2[_0xfd11('0x38')][_0xfd11('0x3f')];}if(_0x79faab[_0xfd11('0x3f')][_0xfd11('0x3a')][_0xfd11('0x47')]){return _0x79faab['List']['Contacts'][0x0];}var _0xf397af=_[_0xfd11('0xb')](_0x22b8a5['body'],{'firstName':_0x22b8a5[_0xfd11('0x30')]['from'],'ListId':_0x79faab[_0xfd11('0x4b')]});_0xf397af[_0x22b8a5[_0xfd11('0x30')]['mapKey']]=_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x31')];return db[_0xfd11('0x2c')][_0xfd11('0x4c')](_0xf397af);}else{throw new Error(_0xfd11('0x4d'));}})['then'](function(_0x238681){_0x4878a2[_0xfd11('0x4e')]=_0x238681;if(_0x238681){if(!_0x22b8a5['body'][_0xfd11('0x18')][_0xfd11('0x4f')]){_0x22b8a5['body'][_0xfd11('0x18')][_0xfd11('0x4f')]=rs['generate']()+'\x20'+_0x22b8a5['body']['message'][_0xfd11('0x31')];}var _0x283e6a={'ContactId':_0x238681['id'],'MailAccountId':_0x22b8a5[_0xfd11('0x38')]['id'],'inReplyTo':_0x22b8a5['body'][_0xfd11('0x18')]['messageId'],'to':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x31')],'cc':_0x22b8a5['body'][_0xfd11('0x18')]['cc'],'subject':_0x22b8a5[_0xfd11('0x30')]['message']['subject'],'attach':_0x22b8a5['body']['message'][_0xfd11('0x50')],'lastMsgAt':moment()[_0xfd11('0x51')](_0xfd11('0x52')),'lastMsgDirection':'in'};return db[_0xfd11('0x53')][_0xfd11('0x28')]({'where':{'closed':![],'MailAccountId':_0x22b8a5[_0xfd11('0x38')]['id']},'include':[{'model':db[_0xfd11('0x54')],'as':_0xfd11('0x55'),'attributes':[_0xfd11('0x4f')],'where':{'messageId':_0x22b8a5['body']['message'][_0xfd11('0x56')]}}]})[_0xfd11('0x10')](function(_0x163539){if(_0x163539){return[_0x163539,![]];}return db[_0xfd11('0x53')]['create'](_0x283e6a)['then'](function(_0x24eaf7){return[_0x24eaf7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfd11('0x57')](function(_0x58da26,_0x38a48a){if(_0x58da26){_0x4492f7=_0x38a48a;if(!_0x38a48a){return _0x58da26[_0xfd11('0x58')]({'inReplyTo':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['messageId'],'to':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x31')],'cc':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['cc'],'subject':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x59')],'attach':_0x58da26[_0xfd11('0x50')]?_0x58da26[_0xfd11('0x50')]:_0x22b8a5[_0xfd11('0x30')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0xfd11('0x51')](_0xfd11('0x52')),'lastMsgAt':moment()[_0xfd11('0x51')](_0xfd11('0x52')),'lastMsgDirection':'in'});}else{return _0x58da26;}}})['then'](function(_0x37504c){_0x4878a2[_0xfd11('0x5a')]=_0x37504c[_0xfd11('0x40')]({'plain':!![]});_0x4878a2['interaction'][_0xfd11('0x5b')]=_0x4492f7;return db[_0xfd11('0x54')][_0xfd11('0x4c')]({'body':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x30')],'MailAccountId':_0x22b8a5[_0xfd11('0x38')]['id'],'MailInteractionId':_0x37504c['id'],'direction':'in','ContactId':_0x4878a2[_0xfd11('0x4e')]['id'],'messageId':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['messageId'],'from':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x31')],'to':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['to'],'cc':_0x22b8a5['body']['message']['cc'],'subject':_0x22b8a5[_0xfd11('0x30')]['message'][_0xfd11('0x59')],'attach':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x50')],'Attachments':_0x22b8a5['body'][_0xfd11('0x18')][_0xfd11('0x5c')],'originTo':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x5d')],'originCc':_0x22b8a5[_0xfd11('0x30')]['message'][_0xfd11('0x5e')],'bcc':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['bcc'],'ChatWebsiteId':_0x22b8a5['body'][_0xfd11('0x18')]['ChatWebsiteId']||null,'originChannel':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x5f')]||_0xfd11('0x60'),'ChatOfflineMessageId':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x61')]||null},{'include':[{'model':db[_0xfd11('0x62')],'as':_0xfd11('0x63')}]});})['then'](function(_0x1d4d68){_0x4878a2[_0xfd11('0x18')]=_0x1d4d68;if(_0x4878a2['interaction'][_0xfd11('0x64')]){return db['User'][_0xfd11('0x28')]({'attributes':['id',_0xfd11('0x65')],'where':{'id':_0x4878a2['interaction']['UserId']}})[_0xfd11('0x10')](function(_0x5b3480){if(_0x5b3480){_0x4878a2[_0xfd11('0x42')][_0xfd11('0x66')]({'id':0x0,'priority':0x0,'app':_0xfd11('0x67'),'appdata':_0x5b3480[_0xfd11('0x65')]+','+(_0x4878a2['account'][_0xfd11('0x68')]||0xa),'interval':_0xfd11('0x4a')});}return respondWithRpcPromise(_0xfd11('0x69'),_0xfd11('0x6a'),_0x4878a2);});}return respondWithRpcPromise(_0xfd11('0x69'),_0xfd11('0x6a'),_0x4878a2);})[_0xfd11('0x10')](function(_0x1f1713){_0x252513(_0x1f1713);})[_0xfd11('0x1a')](function(_0x269c5a){_0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,_0x269c5a[_0xfd11('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index a2193c8..ae6b3a6 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 _0x388a=['update','emit','removeListener','register','save','remove'];(function(_0x5d1dfa,_0x48a32c){var _0x30020b=function(_0x3dcf06){while(--_0x3dcf06){_0x5d1dfa['push'](_0x5d1dfa['shift']());}};_0x30020b(++_0x48a32c);}(_0x388a,0xdc));var _0xa388=function(_0x2cf426,_0x39357e){_0x2cf426=_0x2cf426-0x0;var _0x8972d=_0x388a[_0x2cf426];return _0x8972d;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xa388('0x0'),_0xa388('0x1'),_0xa388('0x2')];function createListener(_0x6bd089,_0x4077a6){return function(_0x36b72d){_0x4077a6[_0xa388('0x3')](_0x6bd089,_0x36b72d);};}function removeListener(_0x32bc46,_0x255d40){return function(){MailAccountEvents[_0xa388('0x4')](_0x32bc46,_0x255d40);};}exports[_0xa388('0x5')]=function(_0x2d30c1){for(var _0x297742=0x0,_0x517b08=events['length'];_0x297742<_0x517b08;_0x297742++){var _0x56966b=events[_0x297742];var _0x47f716=createListener('mailAccount:'+_0x56966b,_0x2d30c1);MailAccountEvents['on'](_0x56966b,_0x47f716);}}; \ No newline at end of file +var _0x594e=['register','length','remove','emit'];(function(_0x5c5db0,_0x3989f0){var _0x379327=function(_0x22ffce){while(--_0x22ffce){_0x5c5db0['push'](_0x5c5db0['shift']());}};_0x379327(++_0x3989f0);}(_0x594e,0x11e));var _0xe594=function(_0x1abcc7,_0x164980){_0x1abcc7=_0x1abcc7-0x0;var _0x33725d=_0x594e[_0x1abcc7];return _0x33725d;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0xe594('0x0'),'update'];function createListener(_0x1db7be,_0x59589f){return function(_0x44b2ad){_0x59589f[_0xe594('0x1')](_0x1db7be,_0x44b2ad);};}function removeListener(_0x13df98,_0x25f947){return function(){MailAccountEvents['removeListener'](_0x13df98,_0x25f947);};}exports[_0xe594('0x2')]=function(_0x48c301){for(var _0x4b17bb=0x0,_0x10d35c=events[_0xe594('0x3')];_0x4b17bb<_0x10d35c;_0x4b17bb++){var _0x4c6875=events[_0x4b17bb];var _0x198d88=createListener('mailAccount:'+_0x4c6875,_0x48c301);MailAccountEvents['on'](_0x4c6875,_0x198d88);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 5de1620..3f5faad 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 _0x2803=['../../config/environment','./mailApplication.controller','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0x2803,0xd6));var _0x3280=function(_0x1b417a,_0x207925){_0x1b417a=_0x1b417a-0x0;var _0x5089aa=_0x2803[_0x1b417a];return _0x5089aa;};'use strict';var multer=require(_0x3280('0x0'));var util=require(_0x3280('0x1'));var path=require(_0x3280('0x2'));var timeout=require('connect-timeout');var express=require(_0x3280('0x3'));var router=express[_0x3280('0x4')]();var fs_extra=require(_0x3280('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3280('0x6'));var config=require(_0x3280('0x7'));var controller=require(_0x3280('0x8'));router['get']('/:id',auth[_0x3280('0x9')](),controller[_0x3280('0xa')]);router[_0x3280('0xb')](_0x3280('0xc'),auth[_0x3280('0x9')](),controller[_0x3280('0xd')]);router[_0x3280('0xe')](_0x3280('0xc'),auth['isAuthenticated'](),controller[_0x3280('0xf')]);module[_0x3280('0x10')]=router; \ No newline at end of file +var _0xca44=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','put','isAuthenticated','update','delete'];(function(_0x424a14,_0x2e6755){var _0x1c7420=function(_0x5f1b51){while(--_0x5f1b51){_0x424a14['push'](_0x424a14['shift']());}};_0x1c7420(++_0x2e6755);}(_0xca44,0xfc));var _0x4ca4=function(_0xa62a5,_0x3dd20e){_0xa62a5=_0xa62a5-0x0;var _0x5af351=_0xca44[_0xa62a5];return _0x5af351;};'use strict';var multer=require(_0x4ca4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4ca4('0x1'));var express=require(_0x4ca4('0x2'));var router=express[_0x4ca4('0x3')]();var fs_extra=require(_0x4ca4('0x4'));var auth=require(_0x4ca4('0x5'));var interaction=require(_0x4ca4('0x6'));var config=require(_0x4ca4('0x7'));var controller=require('./mailApplication.controller');router[_0x4ca4('0x8')](_0x4ca4('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4ca4('0xa')](_0x4ca4('0x9'),auth[_0x4ca4('0xb')](),controller[_0x4ca4('0xc')]);router[_0x4ca4('0xd')](_0x4ca4('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 4fe6c3a..cb76187 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 _0xda86=['noop','sequelize','INTEGER','STRING'];(function(_0x120fc7,_0x5e44c2){var _0xc922e8=function(_0x533bbe){while(--_0x533bbe){_0x120fc7['push'](_0x120fc7['shift']());}};_0xc922e8(++_0x5e44c2);}(_0xda86,0x71));var _0x6da8=function(_0x2cba96,_0x31c0f6){_0x2cba96=_0x2cba96-0x0;var _0x5650e0=_0xda86[_0x2cba96];return _0x5650e0;};'use strict';var Sequelize=require(_0x6da8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x6da8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6da8('0x2')],'allowNull':![],'defaultValue':_0x6da8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6da8('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x930e=['sequelize','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x9d950a,_0x1adee4){var _0x11e6b7=function(_0x2c0f0c){while(--_0x2c0f0c){_0x9d950a['push'](_0x9d950a['shift']());}};_0x11e6b7(++_0x1adee4);}(_0x930e,0xcc));var _0xe930=function(_0x3be3b9,_0x44f144){_0x3be3b9=_0x3be3b9-0x0;var _0x275bd8=_0x930e[_0x3be3b9];return _0x275bd8;};'use strict';var Sequelize=require(_0xe930('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe930('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe930('0x2')},'appdata':{'type':Sequelize[_0xe930('0x3')]()},'description':{'type':Sequelize[_0xe930('0x4')]},'interval':{'type':Sequelize[_0xe930('0x4')],'defaultValue':_0xe930('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 05c78e4..6d9bda2 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 _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','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','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x20a005,_0x3267c4){var _0x318723=function(_0x4dd1e8){while(--_0x4dd1e8){_0x20a005['push'](_0x20a005['shift']());}};_0x318723(++_0x3267c4);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file +var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x1cda79,_0x22d5dd){var _0x253703=function(_0x44617b){while(--_0x44617b){_0x1cda79['push'](_0x1cda79['shift']());}};_0x253703(++_0x22d5dd);}(_0xac4a,0x13f));var _0xaac4=function(_0x1edebe,_0x42be86){_0x1edebe=_0x1edebe-0x0;var _0xc186a9=_0xac4a[_0x1edebe];return _0xc186a9;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 55919aa..0fea99e 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 _0x1367=['utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications'];(function(_0x5031dd,_0x1c85bd){var _0x23237f=function(_0x5cca7b){while(--_0x5cca7b){_0x5031dd['push'](_0x5031dd['shift']());}};_0x23237f(++_0x1c85bd);}(_0x1367,0x169));var _0x7136=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x1367[_0x210718];return _0x541bfc;};'use strict';var _=require(_0x7136('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7136('0x1'));var moment=require(_0x7136('0x2'));var BPromise=require(_0x7136('0x3'));var rp=require(_0x7136('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7136('0x5'));var config=require('../../config/environment');var attributes=require(_0x7136('0x6'));module[_0x7136('0x7')]=function(_0x345de6,_0x589c23){return _0x345de6[_0x7136('0x8')](_0x7136('0x9'),attributes,{'tableName':_0x7136('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7136('0xb')});}; \ No newline at end of file +var _0x5faf=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','bluebird','path','rimraf'];(function(_0x1faf67,_0x7ad662){var _0x387342=function(_0x25dd4a){while(--_0x25dd4a){_0x1faf67['push'](_0x1faf67['shift']());}};_0x387342(++_0x7ad662);}(_0x5faf,0x97));var _0xf5fa=function(_0x5e4629,_0x21868e){_0x5e4629=_0x5e4629-0x0;var _0x2be35d=_0x5faf[_0x5e4629];return _0x2be35d;};'use strict';var _=require(_0xf5fa('0x0'));var util=require(_0xf5fa('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf5fa('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5fa('0x3'));var rimraf=require(_0xf5fa('0x4'));var config=require(_0xf5fa('0x5'));var attributes=require(_0xf5fa('0x6'));module[_0xf5fa('0x7')]=function(_0x38209a,_0x32080e){return _0x38209a[_0xf5fa('0x8')](_0xf5fa('0x9'),attributes,{'tableName':_0xf5fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf5fa('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c6d54d8..c877f09 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 _0x3858=['stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','limit','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x3858,0x8b));var _0x8385=function(_0x477b04,_0x34124f){_0x477b04=_0x477b04-0x0;var _0x429161=_0x3858[_0x477b04];return _0x429161;};'use strict';var _=require('lodash');var util=require(_0x8385('0x0'));var moment=require('moment');var BPromise=require(_0x8385('0x1'));var rs=require(_0x8385('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8385('0x3'));var logger=require(_0x8385('0x4'))(_0x8385('0x5'));var config=require(_0x8385('0x6'));var jayson=require(_0x8385('0x7'));var client=jayson[_0x8385('0x8')][_0x8385('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c57ec,_0x2f44ee,_0x4f8c8c){return new BPromise(function(_0x5ceeb9,_0x125dc3){return client[_0x8385('0xa')](_0x3c57ec,_0x4f8c8c)[_0x8385('0xb')](function(_0x3773f4){logger[_0x8385('0xc')]('MailApplication,\x20%s,\x20%s',_0x2f44ee,'request\x20sent');logger[_0x8385('0xd')](_0x8385('0xe'),_0x2f44ee,_0x8385('0xf'),JSON[_0x8385('0x10')](_0x3773f4));if(_0x3773f4[_0x8385('0x11')]){if(_0x3773f4[_0x8385('0x11')][_0x8385('0x12')]===0x1f4){logger[_0x8385('0x11')](_0x8385('0x13'),_0x2f44ee,_0x3773f4[_0x8385('0x11')][_0x8385('0x14')]);return _0x125dc3(_0x3773f4[_0x8385('0x11')]['message']);}logger[_0x8385('0x11')](_0x8385('0x13'),_0x2f44ee,_0x3773f4[_0x8385('0x11')][_0x8385('0x14')]);return _0x5ceeb9(_0x3773f4[_0x8385('0x11')][_0x8385('0x14')]);}else{logger[_0x8385('0xc')](_0x8385('0x13'),_0x2f44ee,_0x8385('0xf'));_0x5ceeb9(_0x3773f4[_0x8385('0x15')][_0x8385('0x14')]);}})[_0x8385('0x16')](function(_0x47c0ea){logger[_0x8385('0x11')](_0x8385('0x13'),_0x2f44ee,_0x47c0ea);_0x125dc3(_0x47c0ea);});});}exports[_0x8385('0x17')]=function(_0x4d0663){var _0x3e143d=this;return new Promise(function(_0x54320c,_0x476687){return db[_0x8385('0x18')][_0x8385('0x19')](_0x4d0663[_0x8385('0x1a')],{'raw':_0x4d0663['options']?_0x4d0663[_0x8385('0x1b')][_0x8385('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d0663['options']?_0x4d0663[_0x8385('0x1b')][_0x8385('0x1d')]||null:null,'attributes':_0x4d0663[_0x8385('0x1b')]?_0x4d0663[_0x8385('0x1b')]['attributes']||null:null,'limit':_0x4d0663[_0x8385('0x1b')]?_0x4d0663[_0x8385('0x1b')][_0x8385('0x1e')]||null:null})[_0x8385('0xb')](function(_0x3e57bb){logger['info'](_0x8385('0x17'),_0x4d0663);logger['debug'](_0x8385('0x17'),_0x4d0663,JSON[_0x8385('0x10')](_0x3e57bb));_0x54320c(_0x3e57bb);})['catch'](function(_0x45e2b1){logger[_0x8385('0x11')](_0x8385('0x17'),_0x45e2b1[_0x8385('0x14')],_0x4d0663);_0x476687(_0x3e143d['error'](0x1f4,_0x45e2b1[_0x8385('0x14')]));});});}; \ No newline at end of file +var _0xa36b=['stringify','error','code','message','result','catch','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xa36b,0x107));var _0xba36=function(_0x2c0964,_0x504d2f){_0x2c0964=_0x2c0964-0x0;var _0x3c6616=_0xa36b[_0x2c0964];return _0x3c6616;};'use strict';var _=require('lodash');var util=require(_0xba36('0x0'));var moment=require(_0xba36('0x1'));var BPromise=require(_0xba36('0x2'));var rs=require(_0xba36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba36('0x4'))['db'];var utils=require(_0xba36('0x5'));var logger=require(_0xba36('0x6'))(_0xba36('0x7'));var config=require(_0xba36('0x8'));var jayson=require(_0xba36('0x9'));var client=jayson[_0xba36('0xa')][_0xba36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e24ab,_0x3fd7e5,_0x37ca59){return new BPromise(function(_0x1e1141,_0x35c752){return client['request'](_0x1e24ab,_0x37ca59)['then'](function(_0x20a2ea){logger[_0xba36('0xc')](_0xba36('0xd'),_0x3fd7e5,_0xba36('0xe'));logger[_0xba36('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3fd7e5,_0xba36('0xe'),JSON[_0xba36('0x10')](_0x20a2ea));if(_0x20a2ea[_0xba36('0x11')]){if(_0x20a2ea[_0xba36('0x11')][_0xba36('0x12')]===0x1f4){logger['error'](_0xba36('0xd'),_0x3fd7e5,_0x20a2ea[_0xba36('0x11')][_0xba36('0x13')]);return _0x35c752(_0x20a2ea[_0xba36('0x11')][_0xba36('0x13')]);}logger['error'](_0xba36('0xd'),_0x3fd7e5,_0x20a2ea[_0xba36('0x11')][_0xba36('0x13')]);return _0x1e1141(_0x20a2ea[_0xba36('0x11')][_0xba36('0x13')]);}else{logger[_0xba36('0xc')](_0xba36('0xd'),_0x3fd7e5,_0xba36('0xe'));_0x1e1141(_0x20a2ea[_0xba36('0x14')][_0xba36('0x13')]);}})[_0xba36('0x15')](function(_0x2722e0){logger[_0xba36('0x11')](_0xba36('0xd'),_0x3fd7e5,_0x2722e0);_0x35c752(_0x2722e0);});});}exports['UpdateMailApplication']=function(_0x5392c6){var _0x30ce72=this;return new Promise(function(_0x3105a9,_0x577f1b){return db['MailApplication'][_0xba36('0x16')](_0x5392c6[_0xba36('0x17')],{'raw':_0x5392c6[_0xba36('0x18')]?_0x5392c6[_0xba36('0x18')][_0xba36('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5392c6['options']?_0x5392c6['options'][_0xba36('0x1a')]||null:null,'attributes':_0x5392c6[_0xba36('0x18')]?_0x5392c6[_0xba36('0x18')][_0xba36('0x1b')]||null:null,'limit':_0x5392c6[_0xba36('0x18')]?_0x5392c6['options'][_0xba36('0x1c')]||null:null})[_0xba36('0x1d')](function(_0x20d4c1){logger[_0xba36('0xc')]('UpdateMailApplication',_0x5392c6);logger[_0xba36('0xf')](_0xba36('0x1e'),_0x5392c6,JSON['stringify'](_0x20d4c1));_0x3105a9(_0x20d4c1);})[_0xba36('0x15')](function(_0x3c107d){logger[_0xba36('0x11')](_0xba36('0x1e'),_0x3c107d[_0xba36('0x13')],_0x5392c6);_0x577f1b(_0x30ce72['error'](0x1f4,_0x3c107d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 4a77b2d..8c5011a 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 _0xc149=['Router','../../components/auth/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/messages','getMessages','download','post','addMessage','tracked','mailinteraction:update','update','delete','mail','mailinteraction:destroy','destroy','/:id/tags','removeTags'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xc149,0x73));var _0x9c14=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc149[_0x19e35c];return _0x3e1fe8;};'use strict';var express=require('express');var router=express[_0x9c14('0x0')]();var auth=require(_0x9c14('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x9c14('0x2'));router['get']('/',auth[_0x9c14('0x3')](),controller[_0x9c14('0x4')]);router[_0x9c14('0x5')](_0x9c14('0x6'),auth['isAuthenticated'](),controller[_0x9c14('0x7')]);router[_0x9c14('0x5')](_0x9c14('0x8'),auth[_0x9c14('0x3')](),controller['show']);router['get'](_0x9c14('0x9'),auth[_0x9c14('0x3')](),controller[_0x9c14('0xa')]);router[_0x9c14('0x5')]('/:id/download',auth[_0x9c14('0x3')](),controller[_0x9c14('0xb')]);router[_0x9c14('0xc')]('/',auth[_0x9c14('0x3')](),controller['create']);router[_0x9c14('0xc')]('/:id/messages',auth[_0x9c14('0x3')](),controller[_0x9c14('0xd')]);router['post']('/:id/tags',auth[_0x9c14('0x3')](),interaction['tracked']('mail','mailinteraction:addtags'),controller['addTags']);router['put'](_0x9c14('0x8'),auth[_0x9c14('0x3')](),interaction[_0x9c14('0xe')]('mail',_0x9c14('0xf')),controller[_0x9c14('0x10')]);router[_0x9c14('0x11')](_0x9c14('0x8'),auth['isAuthenticated'](),interaction[_0x9c14('0xe')](_0x9c14('0x12'),_0x9c14('0x13')),controller[_0x9c14('0x14')]);router[_0x9c14('0x11')](_0x9c14('0x15'),auth[_0x9c14('0x3')](),controller[_0x9c14('0x16')]);module['exports']=router; \ No newline at end of file +var _0x97d4=['get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','mailinteraction:destroy','destroy','delete','removeTags','express','Router','../../components/auth/service','./mailInteraction.controller'];(function(_0x46ba9c,_0x144189){var _0x36801d=function(_0x3561ba){while(--_0x3561ba){_0x46ba9c['push'](_0x46ba9c['shift']());}};_0x36801d(++_0x144189);}(_0x97d4,0x1d8));var _0x497d=function(_0x53b972,_0x288c5c){_0x53b972=_0x53b972-0x0;var _0x502d0a=_0x97d4[_0x53b972];return _0x502d0a;};'use strict';var express=require(_0x497d('0x0'));var router=express[_0x497d('0x1')]();var auth=require(_0x497d('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x497d('0x3'));router[_0x497d('0x4')]('/',auth[_0x497d('0x5')](),controller[_0x497d('0x6')]);router[_0x497d('0x4')](_0x497d('0x7'),auth[_0x497d('0x5')](),controller['describe']);router[_0x497d('0x4')](_0x497d('0x8'),auth[_0x497d('0x5')](),controller[_0x497d('0x9')]);router[_0x497d('0x4')](_0x497d('0xa'),auth['isAuthenticated'](),controller[_0x497d('0xb')]);router[_0x497d('0x4')](_0x497d('0xc'),auth[_0x497d('0x5')](),controller[_0x497d('0xd')]);router['post']('/',auth[_0x497d('0x5')](),controller[_0x497d('0xe')]);router[_0x497d('0xf')](_0x497d('0xa'),auth[_0x497d('0x5')](),controller[_0x497d('0x10')]);router[_0x497d('0xf')](_0x497d('0x11'),auth[_0x497d('0x5')](),interaction[_0x497d('0x12')](_0x497d('0x13'),_0x497d('0x14')),controller[_0x497d('0x15')]);router[_0x497d('0x16')](_0x497d('0x8'),auth[_0x497d('0x5')](),interaction[_0x497d('0x12')](_0x497d('0x13'),'mailinteraction:update'),controller[_0x497d('0x17')]);router['delete'](_0x497d('0x8'),auth[_0x497d('0x5')](),interaction[_0x497d('0x12')](_0x497d('0x13'),_0x497d('0x18')),controller[_0x497d('0x19')]);router[_0x497d('0x1a')](_0x497d('0x11'),auth[_0x497d('0x5')](),controller[_0x497d('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 9f242a1..a93c146 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 _0x76ba=['DATE','STRING','TEXT','long','BOOLEAN','ENUM','out','sequelize','iconv','exports'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x76ba,0x1ab));var _0xa76b=function(_0x55294f,_0x5b3898){_0x55294f=_0x55294f-0x0;var _0x18316a=_0x76ba[_0x55294f];return _0x18316a;};'use strict';var Sequelize=require(_0xa76b('0x0'));var iconv=require(_0xa76b('0x1'));module[_0xa76b('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa76b('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa76b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xa76b('0x4')](0x1fe)},'to':{'type':Sequelize[_0xa76b('0x4')]},'cc':{'type':Sequelize[_0xa76b('0x5')](_0xa76b('0x6'))},'subject':{'type':Sequelize[_0xa76b('0x5')]()},'attach':{'type':Sequelize[_0xa76b('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xa76b('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xa76b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa76b('0x8')]('in',_0xa76b('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa76b('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa76b('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xa354=['ENUM','out','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa354,0x146));var _0x4a35=function(_0x2e64b5,_0xe7ae4b){_0x2e64b5=_0x2e64b5-0x0;var _0x233e67=_0xa354[_0x2e64b5];return _0x233e67;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x4a35('0x0'));module[_0x4a35('0x1')]={'closed':{'type':Sequelize[_0x4a35('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4a35('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4a35('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4a35('0x4')]},'note':{'type':Sequelize[_0x4a35('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4a35('0x5')](_0x4a35('0x6'))},'subject':{'type':Sequelize[_0x4a35('0x5')]()},'attach':{'type':Sequelize[_0x4a35('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4a35('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x4a35('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4a35('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4a35('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4a35('0x7')]('in',_0x4a35('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4a35('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 9a74c72..16ab578 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x44ad9c,_0x52c1f8){var _0x520c2b=function(_0x1a21bf){while(--_0x1a21bf){_0x44ad9c['push'](_0x44ad9c['shift']());}};_0x520c2b(++_0x52c1f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file +var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c3fac,_0x5f0267){_0x5c3fac=_0x5c3fac-0x0;var _0x382099=_0xb10b[_0x5c3fac];return _0x382099;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a1259c3..dc89f67 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 _0xd600=['hasOwnProperty','hook','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','map','findAll','then','setDataValue','unreadMessages','emit','catch'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xd600,0xf2));var _0x0d60=function(_0x2c7a9a,_0x9c0375){_0x2c7a9a=_0x2c7a9a-0x0;var _0x541088=_0xd600[_0x2c7a9a];return _0x541088;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x0d60('0x0'))['db'][_0x0d60('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x0d60('0x2')](0x0);var events={'afterCreate':_0x0d60('0x3'),'afterUpdate':_0x0d60('0x4'),'afterDestroy':_0x0d60('0x5')};function emitEvent(_0x5338ea){return function(_0x480ccd,_0xc92a5a,_0x2aeab9){_0x480ccd[_0x0d60('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0xeef0e0){_0x480ccd['setDataValue']('Users',_0xeef0e0[_0x0d60('0x7')](function(_0x38aa50){return{'id':_0x38aa50['id']};}));return MailMessage[_0x0d60('0x8')]({'where':{'MailInteractionId':_0x480ccd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0d60('0x9')](function(_0x4ae3c1){_0x480ccd[_0x0d60('0xa')](_0x0d60('0xb'),_0x4ae3c1['length']);MailInteractionEvents[_0x0d60('0xc')](_0x5338ea+':'+_0x480ccd['id'],_0x480ccd);MailInteractionEvents[_0x0d60('0xc')](_0x5338ea,_0x480ccd);_0x2aeab9(null);})[_0x0d60('0xd')](_0x2aeab9(null));};}for(var e in events){if(events[_0x0d60('0xe')](e)){var event=events[e];MailInteraction[_0x0d60('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xb04b=['then','Users','findAll','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','getUsers'];(function(_0x5ec079,_0x44ab9b){var _0x5e795f=function(_0x28ca25){while(--_0x28ca25){_0x5ec079['push'](_0x5ec079['shift']());}};_0x5e795f(++_0x44ab9b);}(_0xb04b,0x13c));var _0xbb04=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb04b[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xbb04('0x0'));var MailInteraction=require(_0xbb04('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xbb04('0x1'))['db'][_0xbb04('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbb04('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb04('0x4'),'afterDestroy':'remove'};function emitEvent(_0xedb816){return function(_0x52e3d9,_0x143118,_0x19d8ed){_0x52e3d9[_0xbb04('0x5')]({'attributes':['id'],'raw':!![]})[_0xbb04('0x6')](function(_0x13ff57){_0x52e3d9['setDataValue'](_0xbb04('0x7'),_0x13ff57['map'](function(_0x217b7a){return{'id':_0x217b7a['id']};}));return MailMessage[_0xbb04('0x8')]({'where':{'MailInteractionId':_0x52e3d9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e3031){_0x52e3d9['setDataValue']('unreadMessages',_0x2e3031[_0xbb04('0x9')]);MailInteractionEvents[_0xbb04('0xa')](_0xedb816+':'+_0x52e3d9['id'],_0x52e3d9);MailInteractionEvents[_0xbb04('0xa')](_0xedb816,_0x52e3d9);_0x19d8ed(null);})['catch'](_0x19d8ed(null));};}for(var e in events){if(events[_0xbb04('0xb')](e)){var event=events[e];MailInteraction[_0xbb04('0xc')](e,emitEvent(event));}}module[_0xbb04('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 28285dd..f0b1548 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 _0x8269=['closed','closedAt','changed','models','get','MailMessage','update','then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x177a10,_0x2b71c6){var _0x2a8609=function(_0x39e8cb){while(--_0x39e8cb){_0x177a10['push'](_0x177a10['shift']());}};_0x2a8609(++_0x2b71c6);}(_0x8269,0x1ae));var _0x9826=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x8269[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x9826('0x0'));var util=require(_0x9826('0x1'));var logger=require(_0x9826('0x2'))(_0x9826('0x3'));var moment=require(_0x9826('0x4'));var BPromise=require(_0x9826('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9826('0x6'));var rimraf=require(_0x9826('0x7'));var config=require(_0x9826('0x8'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x3dbc5f,_0x2c7077){return _0x3dbc5f[_0x9826('0x9')](_0x9826('0xa'),attributes,{'tableName':_0x9826('0xb'),'paranoid':![],'indexes':[{'name':_0x9826('0xc'),'fields':['subject','to'],'type':_0x9826('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x53c268,_0xfba5ec,_0x49e612){if(_0x53c268[_0x9826('0xe')]){_0x53c268[_0x9826('0xf')]=moment()[_0x9826('0x10')](_0x9826('0x11'));}if(_0x53c268[_0x9826('0x12')]){_0x53c268[_0x9826('0x13')]=moment()[_0x9826('0x10')](_0x9826('0x11'));}_0x49e612(null,_0xfba5ec);},'beforeUpdate':function(_0x4fae2b,_0x200a02,_0x2ef19a){if(_0x4fae2b[_0x9826('0x14')](_0x9826('0xe'))){_0x4fae2b[_0x9826('0xf')]=_0x4fae2b['substatus']?moment()[_0x9826('0x10')](_0x9826('0x11')):null;}if(_0x4fae2b[_0x9826('0x14')](_0x9826('0x12'))){_0x4fae2b[_0x9826('0x13')]=moment()[_0x9826('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x4fae2b['substatus']=null;_0x4fae2b[_0x9826('0xf')]=null;}_0x2ef19a(null,_0x4fae2b);},'afterUpdate':function(_0x5c7d06,_0x52bb2b,_0xac87d5){var _0x127f7a=_0x3dbc5f[_0x9826('0x15')];var _0x5c8bd0=_0x5c7d06[_0x9826('0x16')]({'plain':!![]});if(_0x5c8bd0[_0x9826('0x12')]){return _0x127f7a[_0x9826('0x17')][_0x9826('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x5c8bd0['id']}})[_0x9826('0x19')](function(){_0xac87d5();})[_0x9826('0x1a')](function(_0x44c8f8){_0xac87d5(_0x44c8f8);});}else{_0xac87d5();}}},'charset':_0x9826('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd3bb=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','closedAt','models','get','MailMessage','then','catch'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0xd3bb,0x187));var _0xbd3b=function(_0x35e530,_0xaee432){_0x35e530=_0x35e530-0x0;var _0x4e7467=_0xd3bb[_0x35e530];return _0x4e7467;};'use strict';var _=require(_0xbd3b('0x0'));var util=require(_0xbd3b('0x1'));var logger=require(_0xbd3b('0x2'))('api');var moment=require(_0xbd3b('0x3'));var BPromise=require(_0xbd3b('0x4'));var rp=require(_0xbd3b('0x5'));var fs=require('fs');var path=require(_0xbd3b('0x6'));var rimraf=require(_0xbd3b('0x7'));var config=require('../../config/environment');var attributes=require(_0xbd3b('0x8'));module[_0xbd3b('0x9')]=function(_0x192448,_0x3b7bfb){return _0x192448[_0xbd3b('0xa')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xbd3b('0xb'),'fields':[_0xbd3b('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xbdea61,_0x5b1ace,_0x3e3d00){if(_0xbdea61[_0xbd3b('0xd')]){_0xbdea61[_0xbd3b('0xe')]=moment()[_0xbd3b('0xf')](_0xbd3b('0x10'));}if(_0xbdea61[_0xbd3b('0x11')]){_0xbdea61['closedAt']=moment()[_0xbd3b('0xf')](_0xbd3b('0x10'));}_0x3e3d00(null,_0x5b1ace);},'beforeUpdate':function(_0xec1894,_0x2b59fa,_0x511358){if(_0xec1894[_0xbd3b('0x12')](_0xbd3b('0xd'))){_0xec1894[_0xbd3b('0xe')]=_0xec1894['substatus']?moment()[_0xbd3b('0xf')](_0xbd3b('0x10')):null;}if(_0xec1894['changed'](_0xbd3b('0x11'))){_0xec1894[_0xbd3b('0x13')]=moment()[_0xbd3b('0xf')](_0xbd3b('0x10'));_0xec1894[_0xbd3b('0xd')]=null;_0xec1894[_0xbd3b('0xe')]=null;}_0x511358(null,_0xec1894);},'afterUpdate':function(_0x39fadc,_0x2df987,_0x5bca49){var _0x47cee8=_0x192448[_0xbd3b('0x14')];var _0x1724e9=_0x39fadc[_0xbd3b('0x15')]({'plain':!![]});if(_0x1724e9[_0xbd3b('0x11')]){return _0x47cee8[_0xbd3b('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x1724e9['id']}})[_0xbd3b('0x17')](function(){_0x5bca49();})[_0xbd3b('0x18')](function(_0x5272fa){_0x5bca49(_0x5272fa);});}else{_0x5bca49();}}},'charset':_0xbd3b('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 12ac9b8..48eae69 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 _0xc48d=['message','result','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','limit','debug','catch','AddTagsToMailInteraction','addTags','body','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s'];(function(_0x4a6a96,_0x41ed6e){var _0x1191fd=function(_0x575762){while(--_0x575762){_0x4a6a96['push'](_0x4a6a96['shift']());}};_0x1191fd(++_0x41ed6e);}(_0xc48d,0x11a));var _0xdc48=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xc48d[_0x126fb9];return _0xc8a3b1;};'use strict';var _=require(_0xdc48('0x0'));var util=require(_0xdc48('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdc48('0x2'));var fs=require('fs');var Redis=require(_0xdc48('0x3'));var db=require(_0xdc48('0x4'))['db'];var utils=require(_0xdc48('0x5'));var logger=require(_0xdc48('0x6'))(_0xdc48('0x7'));var config=require(_0xdc48('0x8'));var jayson=require(_0xdc48('0x9'));var client=jayson[_0xdc48('0xa')][_0xdc48('0xb')]({'port':0x232a});config[_0xdc48('0xc')]=_[_0xdc48('0xd')](config[_0xdc48('0xc')],{'host':_0xdc48('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc48('0xc')]));require(_0xdc48('0xf'))[_0xdc48('0x10')](socket);function respondWithRpcPromise(_0x31c527,_0x404756,_0x27dd28){return new BPromise(function(_0xfb6101,_0x327146){return client[_0xdc48('0x11')](_0x31c527,_0x27dd28)[_0xdc48('0x12')](function(_0xa225bd){logger[_0xdc48('0x13')]('MailInteraction,\x20%s,\x20%s',_0x404756,_0xdc48('0x14'));logger['debug'](_0xdc48('0x15'),_0x404756,'request\x20sent',JSON[_0xdc48('0x16')](_0xa225bd));if(_0xa225bd[_0xdc48('0x17')]){if(_0xa225bd[_0xdc48('0x17')][_0xdc48('0x18')]===0x1f4){logger['error'](_0xdc48('0x19'),_0x404756,_0xa225bd[_0xdc48('0x17')][_0xdc48('0x1a')]);return _0x327146(_0xa225bd[_0xdc48('0x17')][_0xdc48('0x1a')]);}logger[_0xdc48('0x17')](_0xdc48('0x19'),_0x404756,_0xa225bd[_0xdc48('0x17')][_0xdc48('0x1a')]);return _0xfb6101(_0xa225bd[_0xdc48('0x17')][_0xdc48('0x1a')]);}else{logger[_0xdc48('0x13')](_0xdc48('0x19'),_0x404756,_0xdc48('0x14'));_0xfb6101(_0xa225bd[_0xdc48('0x1b')]['message']);}})['catch'](function(_0x5a3747){logger[_0xdc48('0x17')]('MailInteraction,\x20%s,\x20%s',_0x404756,_0x5a3747);_0x327146(_0x5a3747);});});}exports[_0xdc48('0x1c')]=function(_0x504d24){var _0x35c20c=this;return new Promise(function(_0x3e77c3,_0x77bd0c){return db[_0xdc48('0x1d')][_0xdc48('0x1e')](_0x504d24['body'],{'raw':_0x504d24[_0xdc48('0x1f')]?_0x504d24[_0xdc48('0x1f')][_0xdc48('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x504d24[_0xdc48('0x1f')]?_0x504d24[_0xdc48('0x1f')][_0xdc48('0x21')]||null:null,'attributes':_0x504d24[_0xdc48('0x1f')]?_0x504d24[_0xdc48('0x1f')][_0xdc48('0x22')]||null:null,'limit':_0x504d24[_0xdc48('0x1f')]?_0x504d24[_0xdc48('0x1f')][_0xdc48('0x23')]||null:null})[_0xdc48('0x12')](function(_0x59b4ee){logger[_0xdc48('0x13')](_0xdc48('0x1c'),_0x504d24);logger[_0xdc48('0x24')](_0xdc48('0x1c'),_0x504d24,JSON[_0xdc48('0x16')](_0x59b4ee));_0x3e77c3(_0x59b4ee);})[_0xdc48('0x25')](function(_0x56ac16){logger[_0xdc48('0x17')](_0xdc48('0x1c'),_0x56ac16[_0xdc48('0x1a')],_0x504d24);_0x77bd0c(_0x35c20c['error'](0x1f4,_0x56ac16['message']));});});};exports[_0xdc48('0x26')]=function(_0x2912e2){return new Promise(function(_0x3c8003,_0x22a5e5){return db[_0xdc48('0x1d')]['find']({'where':_0x2912e2[_0xdc48('0x1f')]?_0x2912e2[_0xdc48('0x1f')]['where']||null:null})[_0xdc48('0x12')](function(_0x12d8ce){if(_0x12d8ce){return _0x12d8ce[_0xdc48('0x27')](_0x2912e2[_0xdc48('0x28')][_0xdc48('0x29')],_['omit'](_0x2912e2[_0xdc48('0x28')],[_0xdc48('0x29'),'id'])||{});}})[_0xdc48('0x2a')](function(_0xaacc14){logger['info']('AddTags',_0x2912e2);logger[_0xdc48('0x24')](_0xdc48('0x2b'),_0x2912e2,JSON['stringify'](_0xaacc14));_0x3c8003(_0xaacc14);})[_0xdc48('0x25')](function(_0x56f967){logger[_0xdc48('0x17')]('AddTags',_0x56f967[_0xdc48('0x1a')],_0x2912e2);_0x22a5e5(_this['error'](0x1f4,_0x56f967[_0xdc48('0x1a')]));});});}; \ No newline at end of file +var _0x5668=['socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','AddTagsToMailInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3206fe,_0x2dc7a9){var _0x1ce53a=function(_0xde922e){while(--_0xde922e){_0x3206fe['push'](_0x3206fe['shift']());}};_0x1ce53a(++_0x2dc7a9);}(_0x5668,0xff));var _0x8566=function(_0x2c5c16,_0x255896){_0x2c5c16=_0x2c5c16-0x0;var _0x17a0d7=_0x5668[_0x2c5c16];return _0x17a0d7;};'use strict';var _=require(_0x8566('0x0'));var util=require(_0x8566('0x1'));var moment=require(_0x8566('0x2'));var BPromise=require(_0x8566('0x3'));var rs=require(_0x8566('0x4'));var fs=require('fs');var Redis=require(_0x8566('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8566('0x6'))(_0x8566('0x7'));var config=require(_0x8566('0x8'));var jayson=require(_0x8566('0x9'));var client=jayson[_0x8566('0xa')][_0x8566('0xb')]({'port':0x232a});config[_0x8566('0xc')]=_[_0x8566('0xd')](config[_0x8566('0xc')],{'host':_0x8566('0xe'),'port':0x18eb});var socket=require(_0x8566('0xf'))(new Redis(config['redis']));require(_0x8566('0x10'))[_0x8566('0x11')](socket);function respondWithRpcPromise(_0x384fea,_0x3a29bf,_0x2edd0e){return new BPromise(function(_0x2b4127,_0x1b806e){return client[_0x8566('0x12')](_0x384fea,_0x2edd0e)[_0x8566('0x13')](function(_0x22c392){logger[_0x8566('0x14')](_0x8566('0x15'),_0x3a29bf,'request\x20sent');logger[_0x8566('0x16')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x3a29bf,_0x8566('0x17'),JSON[_0x8566('0x18')](_0x22c392));if(_0x22c392['error']){if(_0x22c392[_0x8566('0x19')][_0x8566('0x1a')]===0x1f4){logger['error'](_0x8566('0x15'),_0x3a29bf,_0x22c392[_0x8566('0x19')]['message']);return _0x1b806e(_0x22c392['error'][_0x8566('0x1b')]);}logger['error'](_0x8566('0x15'),_0x3a29bf,_0x22c392['error'][_0x8566('0x1b')]);return _0x2b4127(_0x22c392['error'][_0x8566('0x1b')]);}else{logger['info'](_0x8566('0x15'),_0x3a29bf,_0x8566('0x17'));_0x2b4127(_0x22c392[_0x8566('0x1c')]['message']);}})[_0x8566('0x1d')](function(_0x477ac0){logger[_0x8566('0x19')](_0x8566('0x15'),_0x3a29bf,_0x477ac0);_0x1b806e(_0x477ac0);});});}exports[_0x8566('0x1e')]=function(_0x45b891){var _0x5ac136=this;return new Promise(function(_0x5364f9,_0x477e99){return db[_0x8566('0x1f')][_0x8566('0x20')](_0x45b891['body'],{'raw':_0x45b891[_0x8566('0x21')]?_0x45b891['options'][_0x8566('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45b891['options']?_0x45b891[_0x8566('0x21')][_0x8566('0x23')]||null:null,'attributes':_0x45b891['options']?_0x45b891[_0x8566('0x21')][_0x8566('0x24')]||null:null,'limit':_0x45b891[_0x8566('0x21')]?_0x45b891[_0x8566('0x21')]['limit']||null:null})['then'](function(_0x516f02){logger[_0x8566('0x14')]('UpdateMailInteraction',_0x45b891);logger[_0x8566('0x16')](_0x8566('0x1e'),_0x45b891,JSON[_0x8566('0x18')](_0x516f02));_0x5364f9(_0x516f02);})[_0x8566('0x1d')](function(_0xb5c88f){logger[_0x8566('0x19')](_0x8566('0x1e'),_0xb5c88f['message'],_0x45b891);_0x477e99(_0x5ac136['error'](0x1f4,_0xb5c88f[_0x8566('0x1b')]));});});};exports[_0x8566('0x25')]=function(_0x3c820a){return new Promise(function(_0x413b04,_0x39b598){return db[_0x8566('0x1f')][_0x8566('0x26')]({'where':_0x3c820a[_0x8566('0x21')]?_0x3c820a[_0x8566('0x21')][_0x8566('0x23')]||null:null})[_0x8566('0x13')](function(_0x1056f4){if(_0x1056f4){return _0x1056f4[_0x8566('0x27')](_0x3c820a['body'][_0x8566('0x28')],_[_0x8566('0x29')](_0x3c820a[_0x8566('0x2a')],[_0x8566('0x28'),'id'])||{});}})[_0x8566('0x2b')](function(_0x222f56){logger[_0x8566('0x14')](_0x8566('0x2c'),_0x3c820a);logger[_0x8566('0x16')](_0x8566('0x2c'),_0x3c820a,JSON[_0x8566('0x18')](_0x222f56));_0x413b04(_0x222f56);})[_0x8566('0x1d')](function(_0x598419){logger[_0x8566('0x19')](_0x8566('0x2c'),_0x598419[_0x8566('0x1b')],_0x3c820a);_0x39b598(_this[_0x8566('0x19')](0x1f4,_0x598419[_0x8566('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 7a77439..dc053ba 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 _0xf460=['removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x4a8276,_0x1911e6){var _0x501c54=function(_0x2bb097){while(--_0x2bb097){_0x4a8276['push'](_0x4a8276['shift']());}};_0x501c54(++_0x1911e6);}(_0xf460,0x82));var _0x0f46=function(_0x300863,_0x186a56){_0x300863=_0x300863-0x0;var _0x534885=_0xf460[_0x300863];return _0x534885;};'use strict';var MailInteractionEvents=require(_0x0f46('0x0'));var events=[_0x0f46('0x1'),_0x0f46('0x2'),_0x0f46('0x3')];function createListener(_0xa18557,_0x2cb5ca){return function(_0x1f540a){_0x2cb5ca[_0x0f46('0x4')](_0xa18557,_0x1f540a);};}function removeListener(_0x187daa,_0x27c4ae){return function(){MailInteractionEvents[_0x0f46('0x5')](_0x187daa,_0x27c4ae);};}exports[_0x0f46('0x6')]=function(_0x1f57ac){for(var _0x336472=0x0,_0x34fc67=events[_0x0f46('0x7')];_0x336472<_0x34fc67;_0x336472++){var _0x4edf66=events[_0x336472];var _0x585674=createListener(_0x0f46('0x8')+_0x4edf66,_0x1f57ac);MailInteractionEvents['on'](_0x4edf66,_0x585674);}}; \ No newline at end of file +var _0x0771=['save','remove','update','emit','removeListener','register'];(function(_0x56f220,_0x9e6544){var _0x187aaa=function(_0xe56fe2){while(--_0xe56fe2){_0x56f220['push'](_0x56f220['shift']());}};_0x187aaa(++_0x9e6544);}(_0x0771,0xae));var _0x1077=function(_0x37628a,_0x92e3c6){_0x37628a=_0x37628a-0x0;var _0x1cf2bf=_0x0771[_0x37628a];return _0x1cf2bf;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x1077('0x0'),_0x1077('0x1'),_0x1077('0x2')];function createListener(_0x8e2e8a,_0x591f1d){return function(_0x4d2c64){_0x591f1d[_0x1077('0x3')](_0x8e2e8a,_0x4d2c64);};}function removeListener(_0x218be1,_0x6759d){return function(){MailInteractionEvents[_0x1077('0x4')](_0x218be1,_0x6759d);};}exports[_0x1077('0x5')]=function(_0x2d5e47){for(var _0x405605=0x0,_0x39d697=events['length'];_0x405605<_0x39d697;_0x405605++){var _0x48e936=events[_0x405605];var _0x51b6cf=createListener('mailInteraction:'+_0x48e936,_0x2d5e47);MailInteractionEvents['on'](_0x48e936,_0x51b6cf);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 16447b8..2dd6504 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 _0xbf82=['reject','destroy','exports','multer','path','express','Router','fs-extra','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','accept','/:id/reject'];(function(_0xd8eea9,_0x17efa9){var _0x2da00e=function(_0x212a2c){while(--_0x212a2c){_0xd8eea9['push'](_0xd8eea9['shift']());}};_0x2da00e(++_0x17efa9);}(_0xbf82,0x1cb));var _0x2bf8=function(_0xd987ca,_0x34290a){_0xd987ca=_0xd987ca-0x0;var _0x2cae07=_0xbf82[_0xd987ca];return _0x2cae07;};'use strict';var multer=require(_0x2bf8('0x0'));var util=require('util');var path=require(_0x2bf8('0x1'));var timeout=require('connect-timeout');var express=require(_0x2bf8('0x2'));var router=express[_0x2bf8('0x3')]();var fs_extra=require(_0x2bf8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2bf8('0x5'));var controller=require(_0x2bf8('0x6'));router[_0x2bf8('0x7')]('/',auth[_0x2bf8('0x8')](),controller[_0x2bf8('0x9')]);router['get']('/describe',auth[_0x2bf8('0x8')](),controller['describe']);router[_0x2bf8('0x7')](_0x2bf8('0xa'),auth[_0x2bf8('0x8')](),controller['show']);router[_0x2bf8('0x7')](_0x2bf8('0xb'),auth[_0x2bf8('0x8')](),controller[_0x2bf8('0xc')]);router[_0x2bf8('0xd')]('/',auth[_0x2bf8('0x8')](),interaction[_0x2bf8('0xe')](_0x2bf8('0xf'),_0x2bf8('0x10')),controller[_0x2bf8('0x11')]);router[_0x2bf8('0x12')]('/:id',auth[_0x2bf8('0x8')](),controller['update']);router[_0x2bf8('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x2bf8('0x13')]);router[_0x2bf8('0x12')](_0x2bf8('0x14'),auth[_0x2bf8('0x8')](),controller[_0x2bf8('0x15')]);router['delete']('/:id',auth[_0x2bf8('0x8')](),controller[_0x2bf8('0x16')]);module[_0x2bf8('0x17')]=router; \ No newline at end of file +var _0x945a=['/:id/download','download','post','tracked','mailmessage:create','create','put','update','accept','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5c72ee,_0x5a8bf8){var _0x231876=function(_0x955276){while(--_0x955276){_0x5c72ee['push'](_0x5c72ee['shift']());}};_0x231876(++_0x5a8bf8);}(_0x945a,0x1d2));var _0xa945=function(_0x47f662,_0x4cdfde){_0x47f662=_0x47f662-0x0;var _0x29e522=_0x945a[_0x47f662];return _0x29e522;};'use strict';var multer=require('multer');var util=require(_0xa945('0x0'));var path=require(_0xa945('0x1'));var timeout=require(_0xa945('0x2'));var express=require('express');var router=express[_0xa945('0x3')]();var fs_extra=require(_0xa945('0x4'));var auth=require(_0xa945('0x5'));var interaction=require(_0xa945('0x6'));var config=require('../../config/environment');var controller=require(_0xa945('0x7'));router[_0xa945('0x8')]('/',auth[_0xa945('0x9')](),controller[_0xa945('0xa')]);router[_0xa945('0x8')](_0xa945('0xb'),auth['isAuthenticated'](),controller[_0xa945('0xc')]);router['get'](_0xa945('0xd'),auth[_0xa945('0x9')](),controller['show']);router[_0xa945('0x8')](_0xa945('0xe'),auth[_0xa945('0x9')](),controller[_0xa945('0xf')]);router[_0xa945('0x10')]('/',auth[_0xa945('0x9')](),interaction[_0xa945('0x11')]('mail',_0xa945('0x12')),controller[_0xa945('0x13')]);router[_0xa945('0x14')](_0xa945('0xd'),auth[_0xa945('0x9')](),controller[_0xa945('0x15')]);router['put']('/:id/accept',auth[_0xa945('0x9')](),controller[_0xa945('0x16')]);router[_0xa945('0x14')]('/:id/reject',auth[_0xa945('0x9')](),controller['reject']);router[_0xa945('0x17')]('/:id',auth[_0xa945('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 71e7810..fec68c9 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 _0x7688=['sequelize','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','Email'];(function(_0x11f85e,_0x14a36f){var _0x3db7b1=function(_0xe298fb){while(--_0xe298fb){_0x11f85e['push'](_0x11f85e['shift']());}};_0x3db7b1(++_0x14a36f);}(_0x7688,0x152));var _0x8768=function(_0x1936f6,_0x1a58f6){_0x1936f6=_0x1936f6-0x0;var _0x5ba5cb=_0x7688[_0x1936f6];return _0x5ba5cb;};'use strict';var Sequelize=require(_0x8768('0x0'));var _=require('lodash');module[_0x8768('0x1')]={'body':{'type':Sequelize[_0x8768('0x2')](_0x8768('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8768('0x2')](_0x8768('0x4'))},'read':{'type':Sequelize[_0x8768('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8768('0x6')]('in','out'),'defaultValue':_0x8768('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x8768('0x8')]},'to':{'type':Sequelize[_0x8768('0x2')](_0x8768('0x3'))},'cc':{'type':Sequelize[_0x8768('0x2')](_0x8768('0x3'))},'bcc':{'type':Sequelize[_0x8768('0x2')](_0x8768('0x3'))},'subject':{'type':Sequelize[_0x8768('0x2')]},'sentAt':{'type':Sequelize[_0x8768('0x9')]},'attach':{'type':Sequelize[_0x8768('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8768('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8768('0x9')]},'originTo':{'type':Sequelize[_0x8768('0x2')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x8768('0x6')]('Email',_0x8768('0xb')),'defaultValue':_0x8768('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x72f1=['medium','BOOLEAN','ENUM','out','STRING','DATE','Email','Chat','lodash','TEXT','long'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x72f1,0x17e));var _0x172f=function(_0x5e4d19,_0x1a198f){_0x5e4d19=_0x5e4d19-0x0;var _0x56375d=_0x72f1[_0x5e4d19];return _0x56375d;};'use strict';var Sequelize=require('sequelize');var _=require(_0x172f('0x0'));module['exports']={'body':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x3'))},'read':{'type':Sequelize[_0x172f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x172f('0x5')]('in',_0x172f('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x172f('0x7')](0x1fe)},'from':{'type':Sequelize[_0x172f('0x7')]},'to':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x2'))},'cc':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x2'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x172f('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x172f('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x172f('0x8')]},'originTo':{'type':Sequelize[_0x172f('0x1')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x172f('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0x172f('0x9'),_0x172f('0xa')),'defaultValue':_0x172f('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 1ebf289..aecb30d 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 _0x1245=['request\x20sent','error','code','MailMessage,\x20%s,\x20%s','message','info','catch','status','json','offset','undefined','count','update','destroy','end','sendStatus','name','send','index','MailMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','includeAll','findAll','show','params','include','body','find','describe','create','secret','split','MailAccount','findOne','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','pass','auth','attachments','root','List','defaults','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','RejectMessage','ContactId','Sequelize','download','unix','toString','files','tmp','server','message-%s.eml','from','bcc','createdAt','Attachment','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','push','readFileSync','writeFileSync','join','unlinkSync','eml-format','bluebird','util','path','ioredis','html-to-text','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x1245,0x88));var _0x5124=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1245[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x5124('0x0'));var moment=require('moment');var BPromise=require(_0x5124('0x1'));var util=require(_0x5124('0x2'));var path=require(_0x5124('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x5124('0x4'));var htmlToText=require(_0x5124('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x5124('0x6'))(_0x5124('0x7'));var interaction_log=require(_0x5124('0x6'))('mail-interactions');var config=require(_0x5124('0x8'));var db=require(_0x5124('0x9'))['db'];config[_0x5124('0xa')]=_['defaults'](config[_0x5124('0xa')],{'host':_0x5124('0xb'),'port':0x18eb});var socket=require(_0x5124('0xc'))(new Redis(config[_0x5124('0xa')]));require(_0x5124('0xd'))[_0x5124('0xe')](socket);var jayson=require(_0x5124('0xf'));var client=jayson[_0x5124('0x10')][_0x5124('0x11')]({'port':0x232c});var client9003=jayson[_0x5124('0x10')][_0x5124('0x11')]({'port':0x232b});var client9002=jayson[_0x5124('0x10')][_0x5124('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x4d1b40,_0x37070d,_0x3f353d,_0x138db1){return new BPromise(function(_0x57b329,_0x3263d3){var _0x16bffd=_0x138db1||client;return _0x16bffd[_0x5124('0x12')](_0x4d1b40,_0x3f353d)[_0x5124('0x13')](function(_0x3c97f2){logger['info']('MailMessage,\x20%s,\x20%s',_0x37070d,'request\x20sent');logger['debug'](_0x5124('0x14'),_0x37070d,_0x5124('0x15'),JSON['stringify'](_0x3c97f2));if(_0x3c97f2[_0x5124('0x16')]){if(_0x3c97f2[_0x5124('0x16')][_0x5124('0x17')]===0x1f4){logger[_0x5124('0x16')](_0x5124('0x18'),_0x37070d,_0x3c97f2[_0x5124('0x16')][_0x5124('0x19')]);return _0x3263d3(_0x3c97f2['error']['message']);}logger[_0x5124('0x16')](_0x5124('0x18'),_0x37070d,_0x3c97f2[_0x5124('0x16')]['message']);return _0x57b329(_0x3c97f2[_0x5124('0x16')]['message']);}else{logger[_0x5124('0x1a')]('MailMessage,\x20%s,\x20%s',_0x37070d,_0x5124('0x15'));_0x57b329(_0x3c97f2['result'][_0x5124('0x19')]);}})[_0x5124('0x1b')](function(_0x77147){logger[_0x5124('0x16')](_0x5124('0x18'),_0x37070d,_0x77147);_0x3263d3(_0x77147);});});}function respondWithResult(_0x1dcc18,_0x350f27){_0x350f27=_0x350f27||0xc8;return function(_0x108d2e){if(_0x108d2e){return _0x1dcc18[_0x5124('0x1c')](_0x350f27)[_0x5124('0x1d')](_0x108d2e);}};}function respondWithFilteredResult(_0x78e76f,_0x4b1495){return function(_0x5add8c){if(_0x5add8c){var _0xa2fa3d=typeof _0x4b1495[_0x5124('0x1e')]===_0x5124('0x1f')&&typeof _0x4b1495['limit']===_0x5124('0x1f');var _0x289f9d=_0x5add8c[_0x5124('0x20')];var _0x34b791=_0xa2fa3d?0x0:_0x4b1495[_0x5124('0x1e')];var _0x192961=_0xa2fa3d?_0x5add8c[_0x5124('0x20')]:_0x4b1495['offset']+_0x4b1495['limit'];var _0x115b1d;if(_0x192961>=_0x289f9d){_0x192961=_0x289f9d;_0x115b1d=0xc8;}else{_0x115b1d=0xce;}_0x78e76f['status'](_0x115b1d);return _0x78e76f['set']('Content-Range',_0x34b791+'-'+_0x192961+'/'+_0x289f9d)[_0x5124('0x1d')](_0x5add8c);}return null;};}function saveUpdates(_0x5d2dca){return function(_0x2bdf15){if(_0x2bdf15){return _0x2bdf15[_0x5124('0x21')](_0x5d2dca)[_0x5124('0x13')](function(_0x27be86){return _0x27be86;});}return null;};}function removeEntity(_0x394a91){return function(_0x1713ec){if(_0x1713ec){return _0x1713ec[_0x5124('0x22')]()[_0x5124('0x13')](function(){_0x394a91[_0x5124('0x1c')](0xcc)[_0x5124('0x23')]();});}};}function handleEntityNotFound(_0xb0e3b5){return function(_0xef12ae){if(!_0xef12ae){_0xb0e3b5[_0x5124('0x24')](0x194);}return _0xef12ae;};}function handleError(_0x7cbf5,_0x24ebc4){_0x24ebc4=_0x24ebc4||0x1f4;return function(_0xe4e025){logger[_0x5124('0x16')](_0xe4e025['stack']);if(_0xe4e025[_0x5124('0x25')]){delete _0xe4e025['name'];}_0x7cbf5[_0x5124('0x1c')](_0x24ebc4)[_0x5124('0x26')](_0xe4e025);};}exports[_0x5124('0x27')]=function(_0x3adc18,_0x40b0bf){var _0x5d1c13={},_0x51208f={},_0xfc8fb1={'count':0x0,'rows':[]};var _0x23a688=_['map'](db[_0x5124('0x28')][_0x5124('0x29')],function(_0xb0492e){return{'name':_0xb0492e[_0x5124('0x2a')],'type':_0xb0492e[_0x5124('0x2b')][_0x5124('0x2c')]};});_0x51208f[_0x5124('0x2d')]=_[_0x5124('0x2e')](_0x23a688,_0x5124('0x25'));_0x51208f[_0x5124('0x2f')]=_[_0x5124('0x30')](_0x3adc18[_0x5124('0x2f')]);_0x51208f[_0x5124('0x31')]=_[_0x5124('0x32')](_0x51208f[_0x5124('0x2d')],_0x51208f[_0x5124('0x2f')]);_0x5d1c13[_0x5124('0x33')]=_[_0x5124('0x32')](_0x51208f[_0x5124('0x2d')],qs[_0x5124('0x34')](_0x3adc18[_0x5124('0x2f')][_0x5124('0x34')]));_0x5d1c13[_0x5124('0x33')]=_0x5d1c13[_0x5124('0x33')][_0x5124('0x35')]?_0x5d1c13[_0x5124('0x33')]:_0x51208f['model'];if(!_0x3adc18[_0x5124('0x2f')][_0x5124('0x36')](_0x5124('0x37'))){_0x5d1c13[_0x5124('0x38')]=qs['limit'](_0x3adc18[_0x5124('0x2f')][_0x5124('0x38')]);_0x5d1c13[_0x5124('0x1e')]=qs['offset'](_0x3adc18[_0x5124('0x2f')]['offset']);}_0x5d1c13['order']=qs[_0x5124('0x39')](_0x3adc18[_0x5124('0x2f')][_0x5124('0x39')]);_0x5d1c13[_0x5124('0x3a')]=qs[_0x5124('0x31')](_[_0x5124('0x3b')](_0x3adc18[_0x5124('0x2f')],_0x51208f[_0x5124('0x31')]),_0x23a688);if(_0x3adc18[_0x5124('0x2f')]['filter']){_0x5d1c13[_0x5124('0x3a')]=_[_0x5124('0x3c')](_0x5d1c13['where'],{'$or':_['map'](_0x23a688,function(_0x346055){if(_0x346055[_0x5124('0x2b')]!=='VIRTUAL'){var _0x31ea53={};_0x31ea53[_0x346055[_0x5124('0x25')]]={'$like':'%'+_0x3adc18[_0x5124('0x2f')]['filter']+'%'};return _0x31ea53;}})});}_0x5d1c13=_[_0x5124('0x3c')]({},_0x5d1c13,_0x3adc18['options']);var _0x35a335={'where':_0x5d1c13['where']};return db[_0x5124('0x28')][_0x5124('0x20')](_0x35a335)[_0x5124('0x13')](function(_0x562e13){_0xfc8fb1['count']=_0x562e13;if(_0x3adc18[_0x5124('0x2f')][_0x5124('0x3d')]){_0x5d1c13['include']=[{'all':!![]}];}return db['MailMessage'][_0x5124('0x3e')](_0x5d1c13);})['then'](function(_0x31de24){_0xfc8fb1['rows']=_0x31de24;return _0xfc8fb1;})[_0x5124('0x13')](respondWithFilteredResult(_0x40b0bf,_0x5d1c13))[_0x5124('0x1b')](handleError(_0x40b0bf,null));};exports[_0x5124('0x3f')]=function(_0x4789e8,_0x365c92){var _0x1f56b8={'raw':!![],'where':{'id':_0x4789e8[_0x5124('0x40')]['id']}},_0x47e13a={};_0x47e13a['model']=_[_0x5124('0x30')](db['MailMessage'][_0x5124('0x29')]);_0x47e13a[_0x5124('0x2f')]=_[_0x5124('0x30')](_0x4789e8['query']);_0x47e13a[_0x5124('0x31')]=_[_0x5124('0x32')](_0x47e13a[_0x5124('0x2d')],_0x47e13a['query']);_0x1f56b8[_0x5124('0x33')]=_[_0x5124('0x32')](_0x47e13a[_0x5124('0x2d')],qs[_0x5124('0x34')](_0x4789e8[_0x5124('0x2f')][_0x5124('0x34')]));_0x1f56b8[_0x5124('0x33')]=_0x1f56b8['attributes'][_0x5124('0x35')]?_0x1f56b8['attributes']:_0x47e13a['model'];if(_0x4789e8[_0x5124('0x2f')]['includeAll']){_0x1f56b8[_0x5124('0x41')]=[{'all':!![]}];}_0x1f56b8=_['merge']({},_0x1f56b8,_0x4789e8['options']);return db[_0x5124('0x28')]['find'](_0x1f56b8)['then'](handleEntityNotFound(_0x365c92,null))[_0x5124('0x13')](respondWithResult(_0x365c92,null))['catch'](handleError(_0x365c92,null));};exports[_0x5124('0x21')]=function(_0x3499bd,_0x5b6275){if(_0x3499bd[_0x5124('0x42')]['id']){delete _0x3499bd[_0x5124('0x42')]['id'];}return db[_0x5124('0x28')][_0x5124('0x43')]({'where':{'id':_0x3499bd[_0x5124('0x40')]['id']}})[_0x5124('0x13')](handleEntityNotFound(_0x5b6275,null))[_0x5124('0x13')](saveUpdates(_0x3499bd['body'],null))[_0x5124('0x13')](respondWithResult(_0x5b6275,null))['catch'](handleError(_0x5b6275,null));};exports[_0x5124('0x22')]=function(_0x1bb177,_0x1e5125){return db[_0x5124('0x28')]['find']({'where':{'id':_0x1bb177[_0x5124('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e5125,null))[_0x5124('0x13')](removeEntity(_0x1e5125,null))['catch'](handleError(_0x1e5125,null));};exports[_0x5124('0x44')]=function(_0x47dae2,_0x27e1e6){return db[_0x5124('0x28')][_0x5124('0x44')]()['then'](respondWithResult(_0x27e1e6,null))[_0x5124('0x1b')](handleError(_0x27e1e6,null));};exports[_0x5124('0x45')]=function(_0x5b0829,_0x53e3a4){return db[_0x5124('0x28')][_0x5124('0x45')](_0x5b0829[_0x5124('0x42')])[_0x5124('0x13')](function(_0x20cd70){if(_0x20cd70){if(_0x20cd70['direction']==='out'&&!_0x20cd70[_0x5124('0x46')]){var _0x49351b,_0x339574,_0x4caf80;if(_0x5b0829['body']['to']){_0x339574=_0x5b0829[_0x5124('0x42')]['to'][_0x5124('0x47')](',')[0x0];}return db[_0x5124('0x48')][_0x5124('0x49')]({'where':{'id':_0x20cd70['MailAccountId']},'include':[{'model':db[_0x5124('0x4a')],'as':'List','include':[{'model':db[_0x5124('0x4b')],'as':_0x5124('0x4c'),'where':{'email':_0x339574},'limit':0x1,'order':[[_0x5124('0x4d'),_0x5124('0x4e')]]}]},{'model':db[_0x5124('0x4f')],'as':'Smtp','raw':!![]}]})['then'](function(_0x32c18c){_0x49351b=_0x32c18c;if(_0x49351b&&_0x49351b[_0x5124('0x50')]){var _0xeae35b={'tls':{'rejectUnauthorized':![]}};if(_[_0x5124('0x51')](_0x49351b[_0x5124('0x50')][_0x5124('0x52')])){_0xeae35b[_0x5124('0x53')]=_0x49351b[_0x5124('0x50')]['host'];_0xeae35b[_0x5124('0x54')]=_0x49351b[_0x5124('0x50')]['port'];_0xeae35b[_0x5124('0x55')]=_0x49351b[_0x5124('0x50')][_0x5124('0x55')];if(_0x49351b[_0x5124('0x50')][_0x5124('0x56')]){_0xeae35b['auth']={'user':_0x49351b[_0x5124('0x50')]['user'],'pass':_0x49351b[_0x5124('0x50')][_0x5124('0x57')]};}}else{_0xeae35b[_0x5124('0x52')]=_0x49351b['Smtp'][_0x5124('0x52')];_0xeae35b[_0x5124('0x58')]={'user':_0x49351b['Smtp']['user'],'pass':_0x49351b['Smtp']['pass']};_0xeae35b[_0x5124('0x55')]=_0x49351b[_0x5124('0x50')][_0x5124('0x55')];}if(_0x5b0829[_0x5124('0x42')][_0x5124('0x59')]&&_0x5b0829[_0x5124('0x42')][_0x5124('0x59')]['length']){for(var _0x31ba20=0x0;_0x31ba20<_0x5b0829['body'][_0x5124('0x59')][_0x5124('0x35')];_0x31ba20+=0x1){_0x5b0829[_0x5124('0x42')][_0x5124('0x59')][_0x31ba20]={'filename':_0x5b0829[_0x5124('0x42')][_0x5124('0x59')][_0x31ba20][_0x5124('0x25')],'path':path['join'](config[_0x5124('0x5a')],'server/files/attachments',_0x5b0829[_0x5124('0x42')][_0x5124('0x59')][_0x31ba20]['basename'])};}}_0x4caf80={'account':_0xeae35b,'message':_0x5b0829[_0x5124('0x42')]};return;}})['then'](function(){if(_0x49351b[_0x5124('0x5b')]){if(_0x49351b[_0x5124('0x5b')][_0x5124('0x4c')][_0x5124('0x35')]){return _0x49351b[_0x5124('0x5b')][_0x5124('0x4c')][0x0];}else{return db[_0x5124('0x4b')][_0x5124('0x45')](_[_0x5124('0x5c')](_0x5b0829[_0x5124('0x42')],{'firstName':_0x5b0829[_0x5124('0x42')]['to'],'email':_0x5b0829[_0x5124('0x42')]['to'],'phone':_0x5b0829[_0x5124('0x42')]['to'],'ListId':_0x49351b['ListId']}));}}else{throw new Error(_0x5124('0x5d'));}})[_0x5124('0x13')](function(){if(_0x4caf80){return respondWithRpcPromise(_0x5124('0x5e'),'sendMail',_0x4caf80,client9003)[_0x5124('0x13')](function(_0x56122e){return _0x20cd70[_0x5124('0x21')]({'read':!![],'messageId':_0x56122e[_0x5124('0x5f')],'sentAt':moment()[_0x5124('0x60')](_0x5124('0x61'))});})[_0x5124('0x1b')](function(_0x4b258b){logger[_0x5124('0x16')]('%s',JSON['stringify'](_0x4b258b));return _0x20cd70;});}return _0x20cd70;});}return _0x20cd70;}})[_0x5124('0x13')](respondWithResult(_0x53e3a4,0xc9))[_0x5124('0x1b')](handleError(_0x53e3a4,null));};exports[_0x5124('0x62')]=function(_0x4b7c2c,_0x2e5805){var _0x2041eb={'agent':{},'channel':'mail'};if(_0x4b7c2c[_0x5124('0x42')]['id']){delete _0x4b7c2c['body']['id'];}_0x4b7c2c[_0x5124('0x42')][_0x5124('0x63')]=!![];_0x4b7c2c[_0x5124('0x42')]['readAt']=moment()[_0x5124('0x60')](_0x5124('0x61'));_0x4b7c2c[_0x5124('0x42')][_0x5124('0x64')]=_0x4b7c2c[_0x5124('0x42')][_0x5124('0x64')]||_0x4b7c2c[_0x5124('0x65')]['id'];_0x2041eb[_0x5124('0x66')]['id']=_0x4b7c2c[_0x5124('0x42')]['UserId'];return db[_0x5124('0x28')][_0x5124('0x43')]({'where':{'id':_0x4b7c2c[_0x5124('0x40')]['id'],'UserId':null}})[_0x5124('0x13')](handleEntityNotFound(_0x2e5805,null))['then'](saveUpdates(_0x4b7c2c['body'],null))[_0x5124('0x13')](function(_0x5c5d57){if(_0x5c5d57){_0x2041eb['message']=_0x5c5d57[_0x5124('0x67')]({'plain':!![]});return db[_0x5124('0x68')][_0x5124('0x43')]({'where':{'id':_0x5c5d57[_0x5124('0x69')]}});}return null;})[_0x5124('0x13')](handleEntityNotFound(_0x2e5805,null))[_0x5124('0x13')](function(_0x11ec14){if(_0x11ec14){return _0x11ec14[_0x5124('0x21')]({'UserId':_0x4b7c2c[_0x5124('0x42')][_0x5124('0x64')],'read1stAt':_[_0x5124('0x51')](_0x11ec14[_0x5124('0x6a')])?moment()['format'](_0x5124('0x61')):undefined});}return null;})[_0x5124('0x13')](function(_0x4314df){if(_0x4314df){_0x2041eb['interaction']=_0x4314df['get']({'plain':!![]});interaction_log[_0x5124('0x1a')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b7c2c['user']['id'],_0x4b7c2c['user']['name'],_0x4b7c2c[_0x5124('0x65')][_0x5124('0x6b')],_0x2041eb['interaction']['id'],_0x4b7c2c[_0x5124('0x42')]?JSON[_0x5124('0x6c')](_0x4b7c2c[_0x5124('0x42')]):'null');return respondWithRpcPromise(_0x5124('0x6d'),_0x5124('0x6e'),_0x2041eb);}return null;})[_0x5124('0x13')](function(_0x156bab){var _0x4577d3=_0x5124('0x6f')+_0x156bab['message']['ContactId'];return db[_0x5124('0x70')][_0x5124('0x2f')](_0x4577d3,{'type':db['Sequelize'][_0x5124('0x71')][_0x5124('0x72')],'raw':!![]})['then'](function(_0x31ab52){return _0x31ab52;});})[_0x5124('0x13')](function(_0x450309){if(_0x450309){_0x2041eb[_0x5124('0x19')][_0x5124('0x73')]=_0x450309[0x0];if(!_0x4b7c2c[_0x5124('0x42')][_0x5124('0x64')])return;return db[_0x5124('0x74')][_0x5124('0x43')]({'where':{'id':_0x4b7c2c['body']['UserId'],'role':_0x5124('0x66')},'attributes':['id',_0x5124('0x25'),_0x5124('0x75'),_0x5124('0x76'),_0x5124('0x77')],'raw':!![]});}return null;})[_0x5124('0x13')](function(_0x192474){if(!_0x192474)return null;_0x2041eb['message']['agent']=_0x192474;return _0x2041eb;})[_0x5124('0x13')](function(_0x2e08f0){if(_0x2e08f0){if(_0x4b7c2c[_0x5124('0x42')][_0x5124('0x78')]){_0x2041eb[_0x5124('0x19')][_0x5124('0x79')]=util[_0x5124('0x60')](_0x5124('0x7a'),_0x4b7c2c[_0x5124('0x65')][_0x5124('0x25')]);_0x2041eb[_0x5124('0x19')][_0x5124('0x7b')]=_0x2041eb[_0x5124('0x7b')];_0x2041eb['message'][_0x5124('0x7c')]=_0x2041eb[_0x5124('0x7b')];_0x2041eb[_0x5124('0x19')][_0x5124('0x7d')]=_0x5124('0x62');_0x2041eb[_0x5124('0x19')][_0x5124('0x42')]=htmlToText[_0x5124('0x7e')](_0x2041eb[_0x5124('0x19')][_0x5124('0x42')]);return respondWithRpcPromise('EventManager',_0x5124('0x7f'),{'event':'acceptmessage','message':_0x2041eb[_0x5124('0x19')]},client9002)[_0x5124('0x13')](function(){return _0x2041eb;});}return _0x2041eb;}return null;})['then'](respondWithResult(_0x2e5805,null))[_0x5124('0x1b')](handleError(_0x2e5805,null));};exports[_0x5124('0x80')]=function(_0x2b681a,_0x115e2a){var _0x228bf2={'agent':{},'channel':'mail'};if(_0x2b681a[_0x5124('0x42')]['id']){delete _0x2b681a[_0x5124('0x42')]['id'];}_0x2b681a[_0x5124('0x42')][_0x5124('0x64')]=_0x2b681a[_0x5124('0x42')][_0x5124('0x64')]||_0x2b681a[_0x5124('0x65')]['id'];_0x228bf2['agent']['id']=_0x2b681a[_0x5124('0x42')][_0x5124('0x64')];return db[_0x5124('0x28')][_0x5124('0x43')]({'where':{'id':_0x2b681a['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x115e2a,null))['then'](function(_0xdae0dc){if(_0xdae0dc){_0x228bf2[_0x5124('0x19')]=_0xdae0dc['get']({'plain':!![]});return db['MailInteraction'][_0x5124('0x43')]({'where':{'id':_0xdae0dc['MailInteractionId']}});}return null;})[_0x5124('0x13')](handleEntityNotFound(_0x115e2a,null))[_0x5124('0x13')](function(_0xc7880b){if(_0xc7880b){_0x228bf2['interaction']=_0xc7880b[_0x5124('0x67')]({'plain':!![]});interaction_log[_0x5124('0x1a')](_0x5124('0x81'),_0x2b681a[_0x5124('0x65')]['id'],_0x2b681a['user'][_0x5124('0x25')],_0x2b681a[_0x5124('0x65')][_0x5124('0x6b')],_0x228bf2[_0x5124('0x82')]['id'],_0x2b681a['body']?JSON[_0x5124('0x6c')](_0x2b681a[_0x5124('0x42')]):_0x5124('0x83'));return respondWithRpcPromise(_0x5124('0x84'),'rejectMessage',_0x228bf2);}return null;})[_0x5124('0x13')](function(_0x2000c5){var _0x4cf22=_0x5124('0x6f')+_0x2000c5['message'][_0x5124('0x85')];return db[_0x5124('0x70')][_0x5124('0x2f')](_0x4cf22,{'type':db[_0x5124('0x86')][_0x5124('0x71')]['SELECT'],'raw':!![]})[_0x5124('0x13')](function(_0x3b2d3a){return _0x3b2d3a;});})[_0x5124('0x13')](function(_0x63d4b5){if(_0x63d4b5){_0x228bf2[_0x5124('0x19')]['contact']=_0x63d4b5[0x0];if(!_0x2b681a[_0x5124('0x42')]['UserId'])return;return db['User'][_0x5124('0x43')]({'where':{'id':_0x2b681a['body'][_0x5124('0x64')],'role':_0x5124('0x66')},'attributes':['id',_0x5124('0x25'),_0x5124('0x75'),_0x5124('0x76'),_0x5124('0x77')],'raw':!![]});}return null;})[_0x5124('0x13')](function(_0x5ee834){if(!_0x5ee834)return null;_0x228bf2[_0x5124('0x19')][_0x5124('0x66')]=_0x5ee834;return _0x228bf2;})[_0x5124('0x13')](function(_0x54318d){if(_0x54318d){_0x54318d[_0x5124('0x19')][_0x5124('0x79')]=util[_0x5124('0x60')](_0x5124('0x7a'),_0x2b681a[_0x5124('0x65')]['name']);_0x54318d[_0x5124('0x19')][_0x5124('0x7b')]=_0x228bf2['channel'];_0x54318d[_0x5124('0x19')][_0x5124('0x7c')]=_0x228bf2['channel'];_0x54318d[_0x5124('0x19')][_0x5124('0x7d')]='reject';_0x54318d[_0x5124('0x19')][_0x5124('0x42')]=htmlToText[_0x5124('0x7e')](_0x228bf2[_0x5124('0x19')][_0x5124('0x42')]);respondWithRpcPromise(_0x5124('0x7f'),_0x5124('0x7f'),{'event':'rejectmessage','message':_0x54318d[_0x5124('0x19')]},client9002);return _0x228bf2;}return null;})[_0x5124('0x13')](respondWithResult(_0x115e2a,null))[_0x5124('0x1b')](handleError(_0x115e2a,null));};exports[_0x5124('0x87')]=function(_0x4239e7,_0x4f8911){var _0x27c364=moment()[_0x5124('0x88')]()[_0x5124('0x89')]();var _0x4bfd36=path['join'](config[_0x5124('0x5a')],'server',_0x5124('0x8a'),_0x5124('0x8b'));var _0x258116=path['join'](config['root'],_0x5124('0x8c'),'files','attachments');var _0x5cf662=util[_0x5124('0x60')](_0x5124('0x8d'),_0x27c364);return db['MailMessage']['find']({'where':{'id':_0x4239e7[_0x5124('0x40')]['id']},'attributes':['id',_0x5124('0x42'),_0x5124('0x8e'),'to','cc',_0x5124('0x8f'),'subject',_0x5124('0x90')],'include':_0x4239e7[_0x5124('0x2f')][_0x5124('0x59')]?[{'model':db[_0x5124('0x91')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x4f8911,null))[_0x5124('0x13')](function(_0x461fdc){if(_0x461fdc){var _0x12ea9d=_0x461fdc;var _0x3c8669={'from':_0x12ea9d[_0x5124('0x8e')],'to':_0x12ea9d['to'],'subject':_0x12ea9d[_0x5124('0x92')],'html':_0x12ea9d['body'],'headers':{'Date':moment(_0x12ea9d[_0x5124('0x90')])[_0x5124('0x60')](_0x5124('0x93'))},'attachments':[]};if(_0x461fdc['cc']){_0x3c8669[_0x5124('0x94')]['Cc']=_0x461fdc['cc'];}if(_0x461fdc[_0x5124('0x8f')]){_0x3c8669['headers'][_0x5124('0x95')]=_0x461fdc['bcc'];}return new BPromise(function(_0x3699e5,_0x202a8a){if(_0x461fdc[_0x5124('0x96')]){for(var _0x592bf9=0x0;_0x592bf9<_0x461fdc[_0x5124('0x96')]['length'];_0x592bf9++){var _0x433c55=_0x461fdc['Attachments'][_0x592bf9];var _0x2bc842=path['join'](_0x258116,_0x433c55[_0x5124('0x97')]);if(fs['existsSync'](_0x2bc842)){_0x3c8669['attachments'][_0x5124('0x98')]({'name':_0x433c55['name'],'contentType':_0x433c55[_0x5124('0x2b')],'data':fs[_0x5124('0x99')](_0x2bc842)});}}}emlformat['build'](_0x3c8669,function(_0x16adec,_0x349cc4){if(_0x16adec)return _0x202a8a(_0x16adec);fs[_0x5124('0x9a')](path[_0x5124('0x9b')](_0x4bfd36,_0x5cf662),_0x349cc4);return _0x3699e5(_0x349cc4);});});}})[_0x5124('0x13')](function(_0x146fb4){if(_0x146fb4){return _0x4f8911[_0x5124('0x87')](path[_0x5124('0x9b')](_0x4bfd36,_0x5cf662),_0x5cf662,function(_0x25c0a1){if(!_0x25c0a1)fs[_0x5124('0x9c')](path[_0x5124('0x9b')](_0x4bfd36,_0x5cf662));});}})['catch'](handleError(_0x4f8911,null));}; \ No newline at end of file +var _0x6a6c=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','merge','options','count','includeAll','include','findAll','catch','show','params','body','find','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','List','CmContact','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','basename','Contacts','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','read','readAt','UserId','agent','get','MailInteraction','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','QueryTypes','User','rejectmessage','download','unix','toString','root','files','tmp','server','message-%s.eml','subject','createdAt','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','moment','util','path','html-to-text','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','status','offset','limit','undefined','set','Content-Range','json','update','then','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x6a6c,0x71));var _0xc6a6=function(_0xa2648b,_0x3ee728){_0xa2648b=_0xa2648b-0x0;var _0x41cfcf=_0x6a6c[_0xa2648b];return _0x41cfcf;};'use strict';var emlformat=require('eml-format');var moment=require(_0xc6a6('0x0'));var BPromise=require('bluebird');var util=require(_0xc6a6('0x1'));var path=require(_0xc6a6('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0xc6a6('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xc6a6('0x4'))('api');var interaction_log=require(_0xc6a6('0x4'))('mail-interactions');var config=require(_0xc6a6('0x5'));var db=require('../../mysqldb')['db'];config[_0xc6a6('0x6')]=_[_0xc6a6('0x7')](config[_0xc6a6('0x6')],{'host':_0xc6a6('0x8'),'port':0x18eb});var socket=require(_0xc6a6('0x9'))(new Redis(config[_0xc6a6('0x6')]));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xc6a6('0xa'));var client=jayson['client'][_0xc6a6('0xb')]({'port':0x232c});var client9003=jayson[_0xc6a6('0xc')][_0xc6a6('0xb')]({'port':0x232b});var client9002=jayson[_0xc6a6('0xc')][_0xc6a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x389c77,_0x3b5dbe,_0x25dd11,_0x26914b){return new BPromise(function(_0x2f72e9,_0x653874){var _0x16918f=_0x26914b||client;return _0x16918f[_0xc6a6('0xd')](_0x389c77,_0x25dd11)['then'](function(_0x1e09ea){logger[_0xc6a6('0xe')](_0xc6a6('0xf'),_0x3b5dbe,_0xc6a6('0x10'));logger['debug'](_0xc6a6('0x11'),_0x3b5dbe,_0xc6a6('0x10'),JSON['stringify'](_0x1e09ea));if(_0x1e09ea[_0xc6a6('0x12')]){if(_0x1e09ea[_0xc6a6('0x12')][_0xc6a6('0x13')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x3b5dbe,_0x1e09ea[_0xc6a6('0x12')]['message']);return _0x653874(_0x1e09ea[_0xc6a6('0x12')][_0xc6a6('0x14')]);}logger[_0xc6a6('0x12')](_0xc6a6('0xf'),_0x3b5dbe,_0x1e09ea[_0xc6a6('0x12')]['message']);return _0x2f72e9(_0x1e09ea[_0xc6a6('0x12')]['message']);}else{logger[_0xc6a6('0xe')](_0xc6a6('0xf'),_0x3b5dbe,_0xc6a6('0x10'));_0x2f72e9(_0x1e09ea[_0xc6a6('0x15')]['message']);}})['catch'](function(_0x15d3df){logger[_0xc6a6('0x12')](_0xc6a6('0xf'),_0x3b5dbe,_0x15d3df);_0x653874(_0x15d3df);});});}function respondWithResult(_0x5a2f39,_0x4b6bb6){_0x4b6bb6=_0x4b6bb6||0xc8;return function(_0x49241b){if(_0x49241b){return _0x5a2f39[_0xc6a6('0x16')](_0x4b6bb6)['json'](_0x49241b);}};}function respondWithFilteredResult(_0x302b06,_0x34da4e){return function(_0x16bb5c){if(_0x16bb5c){var _0x36e17d=typeof _0x34da4e[_0xc6a6('0x17')]==='undefined'&&typeof _0x34da4e[_0xc6a6('0x18')]===_0xc6a6('0x19');var _0x8d6bb7=_0x16bb5c['count'];var _0x4b0fa5=_0x36e17d?0x0:_0x34da4e[_0xc6a6('0x17')];var _0xf181cc=_0x36e17d?_0x16bb5c['count']:_0x34da4e[_0xc6a6('0x17')]+_0x34da4e['limit'];var _0x4ceb8d;if(_0xf181cc>=_0x8d6bb7){_0xf181cc=_0x8d6bb7;_0x4ceb8d=0xc8;}else{_0x4ceb8d=0xce;}_0x302b06[_0xc6a6('0x16')](_0x4ceb8d);return _0x302b06[_0xc6a6('0x1a')](_0xc6a6('0x1b'),_0x4b0fa5+'-'+_0xf181cc+'/'+_0x8d6bb7)[_0xc6a6('0x1c')](_0x16bb5c);}return null;};}function saveUpdates(_0x2041d4){return function(_0x58cd79){if(_0x58cd79){return _0x58cd79[_0xc6a6('0x1d')](_0x2041d4)[_0xc6a6('0x1e')](function(_0x4338ab){return _0x4338ab;});}return null;};}function removeEntity(_0x5b0f4a){return function(_0xf04994){if(_0xf04994){return _0xf04994[_0xc6a6('0x1f')]()[_0xc6a6('0x1e')](function(){_0x5b0f4a[_0xc6a6('0x16')](0xcc)[_0xc6a6('0x20')]();});}};}function handleEntityNotFound(_0x4e6c12){return function(_0x5ca89d){if(!_0x5ca89d){_0x4e6c12[_0xc6a6('0x21')](0x194);}return _0x5ca89d;};}function handleError(_0x28849c,_0x5893b8){_0x5893b8=_0x5893b8||0x1f4;return function(_0x4eee95){logger[_0xc6a6('0x12')](_0x4eee95[_0xc6a6('0x22')]);if(_0x4eee95['name']){delete _0x4eee95[_0xc6a6('0x23')];}_0x28849c[_0xc6a6('0x16')](_0x5893b8)[_0xc6a6('0x24')](_0x4eee95);};}exports[_0xc6a6('0x25')]=function(_0x5a4f38,_0x4cbca3){var _0x358e90={},_0x4a3599={},_0x2f87ec={'count':0x0,'rows':[]};var _0x1a08f3=_[_0xc6a6('0x26')](db[_0xc6a6('0x27')][_0xc6a6('0x28')],function(_0x3c23e7){return{'name':_0x3c23e7[_0xc6a6('0x29')],'type':_0x3c23e7['type'][_0xc6a6('0x2a')]};});_0x4a3599[_0xc6a6('0x2b')]=_[_0xc6a6('0x26')](_0x1a08f3,_0xc6a6('0x23'));_0x4a3599['query']=_[_0xc6a6('0x2c')](_0x5a4f38[_0xc6a6('0x2d')]);_0x4a3599[_0xc6a6('0x2e')]=_[_0xc6a6('0x2f')](_0x4a3599[_0xc6a6('0x2b')],_0x4a3599[_0xc6a6('0x2d')]);_0x358e90[_0xc6a6('0x30')]=_[_0xc6a6('0x2f')](_0x4a3599['model'],qs[_0xc6a6('0x31')](_0x5a4f38[_0xc6a6('0x2d')][_0xc6a6('0x31')]));_0x358e90[_0xc6a6('0x30')]=_0x358e90['attributes'][_0xc6a6('0x32')]?_0x358e90[_0xc6a6('0x30')]:_0x4a3599[_0xc6a6('0x2b')];if(!_0x5a4f38[_0xc6a6('0x2d')][_0xc6a6('0x33')](_0xc6a6('0x34'))){_0x358e90[_0xc6a6('0x18')]=qs[_0xc6a6('0x18')](_0x5a4f38[_0xc6a6('0x2d')]['limit']);_0x358e90[_0xc6a6('0x17')]=qs['offset'](_0x5a4f38['query']['offset']);}_0x358e90[_0xc6a6('0x35')]=qs[_0xc6a6('0x36')](_0x5a4f38['query'][_0xc6a6('0x36')]);_0x358e90[_0xc6a6('0x37')]=qs[_0xc6a6('0x2e')](_[_0xc6a6('0x38')](_0x5a4f38[_0xc6a6('0x2d')],_0x4a3599[_0xc6a6('0x2e')]),_0x1a08f3);if(_0x5a4f38[_0xc6a6('0x2d')]['filter']){_0x358e90['where']=_['merge'](_0x358e90[_0xc6a6('0x37')],{'$or':_[_0xc6a6('0x26')](_0x1a08f3,function(_0x485d52){if(_0x485d52[_0xc6a6('0x39')]!=='VIRTUAL'){var _0x22f8ea={};_0x22f8ea[_0x485d52[_0xc6a6('0x23')]]={'$like':'%'+_0x5a4f38['query']['filter']+'%'};return _0x22f8ea;}})});}_0x358e90=_[_0xc6a6('0x3a')]({},_0x358e90,_0x5a4f38[_0xc6a6('0x3b')]);var _0x4e81ac={'where':_0x358e90[_0xc6a6('0x37')]};return db[_0xc6a6('0x27')][_0xc6a6('0x3c')](_0x4e81ac)[_0xc6a6('0x1e')](function(_0x10f8e4){_0x2f87ec['count']=_0x10f8e4;if(_0x5a4f38['query'][_0xc6a6('0x3d')]){_0x358e90[_0xc6a6('0x3e')]=[{'all':!![]}];}return db[_0xc6a6('0x27')][_0xc6a6('0x3f')](_0x358e90);})['then'](function(_0x50ca6b){_0x2f87ec['rows']=_0x50ca6b;return _0x2f87ec;})[_0xc6a6('0x1e')](respondWithFilteredResult(_0x4cbca3,_0x358e90))[_0xc6a6('0x40')](handleError(_0x4cbca3,null));};exports[_0xc6a6('0x41')]=function(_0x2e9927,_0x19f5df){var _0x263898={'raw':!![],'where':{'id':_0x2e9927[_0xc6a6('0x42')]['id']}},_0x45c148={};_0x45c148[_0xc6a6('0x2b')]=_[_0xc6a6('0x2c')](db[_0xc6a6('0x27')]['rawAttributes']);_0x45c148['query']=_[_0xc6a6('0x2c')](_0x2e9927[_0xc6a6('0x2d')]);_0x45c148[_0xc6a6('0x2e')]=_[_0xc6a6('0x2f')](_0x45c148['model'],_0x45c148[_0xc6a6('0x2d')]);_0x263898[_0xc6a6('0x30')]=_[_0xc6a6('0x2f')](_0x45c148[_0xc6a6('0x2b')],qs['fields'](_0x2e9927[_0xc6a6('0x2d')][_0xc6a6('0x31')]));_0x263898[_0xc6a6('0x30')]=_0x263898[_0xc6a6('0x30')][_0xc6a6('0x32')]?_0x263898[_0xc6a6('0x30')]:_0x45c148[_0xc6a6('0x2b')];if(_0x2e9927[_0xc6a6('0x2d')]['includeAll']){_0x263898[_0xc6a6('0x3e')]=[{'all':!![]}];}_0x263898=_['merge']({},_0x263898,_0x2e9927[_0xc6a6('0x3b')]);return db[_0xc6a6('0x27')]['find'](_0x263898)[_0xc6a6('0x1e')](handleEntityNotFound(_0x19f5df,null))[_0xc6a6('0x1e')](respondWithResult(_0x19f5df,null))['catch'](handleError(_0x19f5df,null));};exports[_0xc6a6('0x1d')]=function(_0x4e24a7,_0x48b0b1){if(_0x4e24a7[_0xc6a6('0x43')]['id']){delete _0x4e24a7[_0xc6a6('0x43')]['id'];}return db[_0xc6a6('0x27')][_0xc6a6('0x44')]({'where':{'id':_0x4e24a7[_0xc6a6('0x42')]['id']}})[_0xc6a6('0x1e')](handleEntityNotFound(_0x48b0b1,null))['then'](saveUpdates(_0x4e24a7[_0xc6a6('0x43')],null))[_0xc6a6('0x1e')](respondWithResult(_0x48b0b1,null))['catch'](handleError(_0x48b0b1,null));};exports[_0xc6a6('0x1f')]=function(_0x4d3e7f,_0x446866){return db[_0xc6a6('0x27')]['find']({'where':{'id':_0x4d3e7f[_0xc6a6('0x42')]['id']}})['then'](handleEntityNotFound(_0x446866,null))[_0xc6a6('0x1e')](removeEntity(_0x446866,null))[_0xc6a6('0x40')](handleError(_0x446866,null));};exports[_0xc6a6('0x45')]=function(_0x306c33,_0x2394ac){return db[_0xc6a6('0x27')][_0xc6a6('0x45')]()[_0xc6a6('0x1e')](respondWithResult(_0x2394ac,null))['catch'](handleError(_0x2394ac,null));};exports[_0xc6a6('0x46')]=function(_0x127cc8,_0x17ab04){return db['MailMessage'][_0xc6a6('0x46')](_0x127cc8['body'])[_0xc6a6('0x1e')](function(_0x3c11d1){if(_0x3c11d1){if(_0x3c11d1[_0xc6a6('0x47')]===_0xc6a6('0x48')&&!_0x3c11d1[_0xc6a6('0x49')]){var _0x46583e,_0x419002,_0x5635e7;if(_0x127cc8[_0xc6a6('0x43')]['to']){_0x419002=_0x127cc8['body']['to'][_0xc6a6('0x4a')](',')[0x0];}return db['MailAccount'][_0xc6a6('0x4b')]({'where':{'id':_0x3c11d1[_0xc6a6('0x4c')]},'include':[{'model':db[_0xc6a6('0x4d')],'as':_0xc6a6('0x4e'),'include':[{'model':db[_0xc6a6('0x4f')],'as':'Contacts','where':{'email':_0x419002},'limit':0x1,'order':[[_0xc6a6('0x50'),'DESC']]}]},{'model':db[_0xc6a6('0x51')],'as':'Smtp','raw':!![]}]})[_0xc6a6('0x1e')](function(_0x247336){_0x46583e=_0x247336;if(_0x46583e&&_0x46583e[_0xc6a6('0x52')]){var _0xd2e42b={'tls':{'rejectUnauthorized':![]}};if(_[_0xc6a6('0x53')](_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x54')])){_0xd2e42b[_0xc6a6('0x55')]=_0x46583e['Smtp'][_0xc6a6('0x55')];_0xd2e42b['port']=_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x56')];_0xd2e42b[_0xc6a6('0x57')]=_0x46583e[_0xc6a6('0x52')]['secure'];if(_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x58')]){_0xd2e42b[_0xc6a6('0x59')]={'user':_0x46583e['Smtp'][_0xc6a6('0x5a')],'pass':_0x46583e[_0xc6a6('0x52')]['pass']};}}else{_0xd2e42b[_0xc6a6('0x54')]=_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x54')];_0xd2e42b[_0xc6a6('0x59')]={'user':_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x5a')],'pass':_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x5b')]};_0xd2e42b[_0xc6a6('0x57')]=_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x57')];}if(_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')]&&_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')][_0xc6a6('0x32')]){for(var _0x4937c2=0x0;_0x4937c2<_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')][_0xc6a6('0x32')];_0x4937c2+=0x1){_0x127cc8['body']['attachments'][_0x4937c2]={'filename':_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')][_0x4937c2]['name'],'path':path[_0xc6a6('0x5d')](config['root'],'server/files/attachments',_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')][_0x4937c2][_0xc6a6('0x5e')])};}}_0x5635e7={'account':_0xd2e42b,'message':_0x127cc8['body']};return;}})[_0xc6a6('0x1e')](function(){if(_0x46583e[_0xc6a6('0x4e')]){if(_0x46583e[_0xc6a6('0x4e')][_0xc6a6('0x5f')][_0xc6a6('0x32')]){return _0x46583e[_0xc6a6('0x4e')]['Contacts'][0x0];}else{return db['CmContact'][_0xc6a6('0x46')](_[_0xc6a6('0x7')](_0x127cc8[_0xc6a6('0x43')],{'firstName':_0x127cc8[_0xc6a6('0x43')]['to'],'email':_0x127cc8[_0xc6a6('0x43')]['to'],'phone':_0x127cc8['body']['to'],'ListId':_0x46583e[_0xc6a6('0x60')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xc6a6('0x1e')](function(){if(_0x5635e7){return respondWithRpcPromise(_0xc6a6('0x61'),'sendMail',_0x5635e7,client9003)[_0xc6a6('0x1e')](function(_0x51f3e8){return _0x3c11d1[_0xc6a6('0x1d')]({'read':!![],'messageId':_0x51f3e8[_0xc6a6('0x62')],'sentAt':moment()[_0xc6a6('0x63')](_0xc6a6('0x64'))});})[_0xc6a6('0x40')](function(_0x3687a2){logger['error']('%s',JSON[_0xc6a6('0x65')](_0x3687a2));return _0x3c11d1;});}return _0x3c11d1;});}return _0x3c11d1;}})[_0xc6a6('0x1e')](respondWithResult(_0x17ab04,0xc9))['catch'](handleError(_0x17ab04,null));};exports['accept']=function(_0x1bba52,_0x3808da){var _0x30c3d9={'agent':{},'channel':'mail'};if(_0x1bba52[_0xc6a6('0x43')]['id']){delete _0x1bba52[_0xc6a6('0x43')]['id'];}_0x1bba52['body'][_0xc6a6('0x66')]=!![];_0x1bba52['body'][_0xc6a6('0x67')]=moment()[_0xc6a6('0x63')](_0xc6a6('0x64'));_0x1bba52[_0xc6a6('0x43')][_0xc6a6('0x68')]=_0x1bba52['body'][_0xc6a6('0x68')]||_0x1bba52[_0xc6a6('0x5a')]['id'];_0x30c3d9[_0xc6a6('0x69')]['id']=_0x1bba52['body'][_0xc6a6('0x68')];return db[_0xc6a6('0x27')][_0xc6a6('0x44')]({'where':{'id':_0x1bba52[_0xc6a6('0x42')]['id'],'UserId':null}})[_0xc6a6('0x1e')](handleEntityNotFound(_0x3808da,null))[_0xc6a6('0x1e')](saveUpdates(_0x1bba52[_0xc6a6('0x43')],null))[_0xc6a6('0x1e')](function(_0x4e3db8){if(_0x4e3db8){_0x30c3d9[_0xc6a6('0x14')]=_0x4e3db8[_0xc6a6('0x6a')]({'plain':!![]});return db[_0xc6a6('0x6b')][_0xc6a6('0x44')]({'where':{'id':_0x4e3db8['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3808da,null))[_0xc6a6('0x1e')](function(_0x5d7c3b){if(_0x5d7c3b){return _0x5d7c3b[_0xc6a6('0x1d')]({'UserId':_0x1bba52['body']['UserId'],'read1stAt':_[_0xc6a6('0x53')](_0x5d7c3b[_0xc6a6('0x6c')])?moment()[_0xc6a6('0x63')](_0xc6a6('0x64')):undefined});}return null;})[_0xc6a6('0x1e')](function(_0x261ca3){if(_0x261ca3){_0x30c3d9['interaction']=_0x261ca3[_0xc6a6('0x6a')]({'plain':!![]});interaction_log[_0xc6a6('0xe')](_0xc6a6('0x6d'),_0x1bba52[_0xc6a6('0x5a')]['id'],_0x1bba52[_0xc6a6('0x5a')][_0xc6a6('0x23')],_0x1bba52[_0xc6a6('0x5a')]['role'],_0x30c3d9[_0xc6a6('0x6e')]['id'],_0x1bba52[_0xc6a6('0x43')]?JSON['stringify'](_0x1bba52[_0xc6a6('0x43')]):_0xc6a6('0x6f'));return respondWithRpcPromise(_0xc6a6('0x70'),_0xc6a6('0x71'),_0x30c3d9);}return null;})[_0xc6a6('0x1e')](function(_0x4d12b8){var _0x6c0c33=_0xc6a6('0x72')+_0x4d12b8['message'][_0xc6a6('0x73')];return db[_0xc6a6('0x74')]['query'](_0x6c0c33,{'type':db[_0xc6a6('0x75')]['QueryTypes'][_0xc6a6('0x76')],'raw':!![]})[_0xc6a6('0x1e')](function(_0x4d4fce){return _0x4d4fce;});})['then'](function(_0x35c200){if(_0x35c200){_0x30c3d9[_0xc6a6('0x14')]['contact']=_0x35c200[0x0];if(!_0x1bba52[_0xc6a6('0x43')]['UserId'])return;return db['User'][_0xc6a6('0x44')]({'where':{'id':_0x1bba52['body']['UserId'],'role':_0xc6a6('0x69')},'attributes':['id','name',_0xc6a6('0x77'),_0xc6a6('0x78'),_0xc6a6('0x79')],'raw':!![]});}return null;})[_0xc6a6('0x1e')](function(_0xd4ecba){if(!_0xd4ecba)return null;_0x30c3d9['message'][_0xc6a6('0x69')]=_0xd4ecba;return _0x30c3d9;})[_0xc6a6('0x1e')](function(_0x13cecc){if(_0x13cecc){if(_0x1bba52[_0xc6a6('0x43')][_0xc6a6('0x7a')]){_0x30c3d9[_0xc6a6('0x14')][_0xc6a6('0x7b')]=util[_0xc6a6('0x63')](_0xc6a6('0x7c'),_0x1bba52[_0xc6a6('0x5a')][_0xc6a6('0x23')]);_0x30c3d9[_0xc6a6('0x14')]['channel']=_0x30c3d9[_0xc6a6('0x7d')];_0x30c3d9[_0xc6a6('0x14')][_0xc6a6('0x7e')]=_0x30c3d9[_0xc6a6('0x7d')];_0x30c3d9[_0xc6a6('0x14')][_0xc6a6('0x7f')]=_0xc6a6('0x80');_0x30c3d9['message'][_0xc6a6('0x43')]=htmlToText[_0xc6a6('0x81')](_0x30c3d9['message'][_0xc6a6('0x43')]);return respondWithRpcPromise(_0xc6a6('0x82'),'EventManager',{'event':_0xc6a6('0x83'),'message':_0x30c3d9[_0xc6a6('0x14')]},client9002)[_0xc6a6('0x1e')](function(){return _0x30c3d9;});}return _0x30c3d9;}return null;})[_0xc6a6('0x1e')](respondWithResult(_0x3808da,null))[_0xc6a6('0x40')](handleError(_0x3808da,null));};exports[_0xc6a6('0x84')]=function(_0x544d80,_0x490276){var _0x219e97={'agent':{},'channel':_0xc6a6('0x85')};if(_0x544d80['body']['id']){delete _0x544d80[_0xc6a6('0x43')]['id'];}_0x544d80['body'][_0xc6a6('0x68')]=_0x544d80[_0xc6a6('0x43')][_0xc6a6('0x68')]||_0x544d80[_0xc6a6('0x5a')]['id'];_0x219e97[_0xc6a6('0x69')]['id']=_0x544d80['body']['UserId'];return db[_0xc6a6('0x27')][_0xc6a6('0x44')]({'where':{'id':_0x544d80['params']['id'],'UserId':null}})[_0xc6a6('0x1e')](handleEntityNotFound(_0x490276,null))[_0xc6a6('0x1e')](function(_0x5e28f0){if(_0x5e28f0){_0x219e97['message']=_0x5e28f0[_0xc6a6('0x6a')]({'plain':!![]});return db[_0xc6a6('0x6b')][_0xc6a6('0x44')]({'where':{'id':_0x5e28f0[_0xc6a6('0x86')]}});}return null;})[_0xc6a6('0x1e')](handleEntityNotFound(_0x490276,null))[_0xc6a6('0x1e')](function(_0x44a470){if(_0x44a470){_0x219e97[_0xc6a6('0x6e')]=_0x44a470[_0xc6a6('0x6a')]({'plain':!![]});interaction_log[_0xc6a6('0xe')](_0xc6a6('0x87'),_0x544d80[_0xc6a6('0x5a')]['id'],_0x544d80[_0xc6a6('0x5a')][_0xc6a6('0x23')],_0x544d80[_0xc6a6('0x5a')][_0xc6a6('0x88')],_0x219e97[_0xc6a6('0x6e')]['id'],_0x544d80[_0xc6a6('0x43')]?JSON[_0xc6a6('0x65')](_0x544d80[_0xc6a6('0x43')]):'null');return respondWithRpcPromise('RejectMessage',_0xc6a6('0x89'),_0x219e97);}return null;})[_0xc6a6('0x1e')](function(_0x10ea53){var _0x37ed6f=_0xc6a6('0x72')+_0x10ea53[_0xc6a6('0x14')]['ContactId'];return db[_0xc6a6('0x74')][_0xc6a6('0x2d')](_0x37ed6f,{'type':db[_0xc6a6('0x75')][_0xc6a6('0x8a')][_0xc6a6('0x76')],'raw':!![]})[_0xc6a6('0x1e')](function(_0x172afa){return _0x172afa;});})['then'](function(_0x2ead56){if(_0x2ead56){_0x219e97['message']['contact']=_0x2ead56[0x0];if(!_0x544d80['body']['UserId'])return;return db[_0xc6a6('0x8b')][_0xc6a6('0x44')]({'where':{'id':_0x544d80['body'][_0xc6a6('0x68')],'role':_0xc6a6('0x69')},'attributes':['id',_0xc6a6('0x23'),_0xc6a6('0x77'),_0xc6a6('0x78'),'internal'],'raw':!![]});}return null;})[_0xc6a6('0x1e')](function(_0x4f642c){if(!_0x4f642c)return null;_0x219e97[_0xc6a6('0x14')][_0xc6a6('0x69')]=_0x4f642c;return _0x219e97;})[_0xc6a6('0x1e')](function(_0x121aba){if(_0x121aba){_0x121aba['message'][_0xc6a6('0x7b')]=util[_0xc6a6('0x63')](_0xc6a6('0x7c'),_0x544d80[_0xc6a6('0x5a')][_0xc6a6('0x23')]);_0x121aba[_0xc6a6('0x14')][_0xc6a6('0x7d')]=_0x219e97[_0xc6a6('0x7d')];_0x121aba[_0xc6a6('0x14')][_0xc6a6('0x7e')]=_0x219e97[_0xc6a6('0x7d')];_0x121aba['message'][_0xc6a6('0x7f')]=_0xc6a6('0x84');_0x121aba[_0xc6a6('0x14')][_0xc6a6('0x43')]=htmlToText[_0xc6a6('0x81')](_0x219e97[_0xc6a6('0x14')]['body']);respondWithRpcPromise(_0xc6a6('0x82'),'EventManager',{'event':_0xc6a6('0x8c'),'message':_0x121aba[_0xc6a6('0x14')]},client9002);return _0x219e97;}return null;})[_0xc6a6('0x1e')](respondWithResult(_0x490276,null))[_0xc6a6('0x40')](handleError(_0x490276,null));};exports[_0xc6a6('0x8d')]=function(_0x3aad58,_0x278b21){var _0x5b6571=moment()[_0xc6a6('0x8e')]()[_0xc6a6('0x8f')]();var _0x58c2ea=path['join'](config[_0xc6a6('0x90')],'server',_0xc6a6('0x91'),_0xc6a6('0x92'));var _0x3fa8a4=path['join'](config['root'],_0xc6a6('0x93'),_0xc6a6('0x91'),_0xc6a6('0x5c'));var _0x46538d=util[_0xc6a6('0x63')](_0xc6a6('0x94'),_0x5b6571);return db[_0xc6a6('0x27')]['find']({'where':{'id':_0x3aad58[_0xc6a6('0x42')]['id']},'attributes':['id','body','from','to','cc','bcc',_0xc6a6('0x95'),_0xc6a6('0x96')],'include':_0x3aad58[_0xc6a6('0x2d')]['attachments']?[{'model':db['Attachment'],'as':_0xc6a6('0x97')}]:undefined})[_0xc6a6('0x1e')](handleEntityNotFound(_0x278b21,null))[_0xc6a6('0x1e')](function(_0x5f4869){if(_0x5f4869){var _0x1619df=_0x5f4869;var _0xbb8c43={'from':_0x1619df[_0xc6a6('0x98')],'to':_0x1619df['to'],'subject':_0x1619df['subject'],'html':_0x1619df[_0xc6a6('0x43')],'headers':{'Date':moment(_0x1619df['createdAt'])[_0xc6a6('0x63')](_0xc6a6('0x99'))},'attachments':[]};if(_0x5f4869['cc']){_0xbb8c43[_0xc6a6('0x9a')]['Cc']=_0x5f4869['cc'];}if(_0x5f4869['bcc']){_0xbb8c43[_0xc6a6('0x9a')][_0xc6a6('0x9b')]=_0x5f4869['bcc'];}return new BPromise(function(_0x4fb17b,_0x5a63bc){if(_0x5f4869[_0xc6a6('0x97')]){for(var _0x36e6e7=0x0;_0x36e6e7<_0x5f4869[_0xc6a6('0x97')]['length'];_0x36e6e7++){var _0x4adcc7=_0x5f4869[_0xc6a6('0x97')][_0x36e6e7];var _0x20c0b8=path[_0xc6a6('0x5d')](_0x3fa8a4,_0x4adcc7[_0xc6a6('0x5e')]);if(fs[_0xc6a6('0x9c')](_0x20c0b8)){_0xbb8c43[_0xc6a6('0x5c')][_0xc6a6('0x9d')]({'name':_0x4adcc7[_0xc6a6('0x23')],'contentType':_0x4adcc7[_0xc6a6('0x39')],'data':fs[_0xc6a6('0x9e')](_0x20c0b8)});}}}emlformat[_0xc6a6('0x9f')](_0xbb8c43,function(_0x2ccc98,_0x309b4c){if(_0x2ccc98)return _0x5a63bc(_0x2ccc98);fs[_0xc6a6('0xa0')](path[_0xc6a6('0x5d')](_0x58c2ea,_0x46538d),_0x309b4c);return _0x4fb17b(_0x309b4c);});});}})[_0xc6a6('0x1e')](function(_0xaaee8b){if(_0xaaee8b){return _0x278b21[_0xc6a6('0x8d')](path[_0xc6a6('0x5d')](_0x58c2ea,_0x46538d),_0x46538d,function(_0x34c4b5){if(!_0x34c4b5)fs[_0xc6a6('0xa1')](path[_0xc6a6('0x5d')](_0x58c2ea,_0x46538d));});}})[_0xc6a6('0x40')](handleError(_0x278b21,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 491a550..d8e58df 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 _0xf672=['MailMessage','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4f83af,_0x3c4dac){var _0xb0c9d5=function(_0x5a70d9){while(--_0x5a70d9){_0x4f83af['push'](_0x4f83af['shift']());}};_0xb0c9d5(++_0x3c4dac);}(_0xf672,0xb7));var _0x2f67=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xf672[_0x36ed48];return _0x51c63a;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x2f67('0x0'))['db'][_0x2f67('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2f67('0x2'),'afterUpdate':'update','afterDestroy':_0x2f67('0x3')};function emitEvent(_0xf9b869){return function(_0x43f1b1,_0xdffca9,_0x5cd6f3){MailMessageEvents[_0x2f67('0x4')](_0xf9b869+':'+_0x43f1b1['id'],_0x43f1b1);MailMessageEvents['emit'](_0xf9b869,_0x43f1b1);_0x5cd6f3(null);};}for(var e in events){if(events[_0x2f67('0x5')](e)){var event=events[e];MailMessage[_0x2f67('0x6')](e,emitEvent(event));}}module[_0x2f67('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x1a23=['MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5df617,_0x36d8e3){var _0x11bac5=function(_0x2aa96e){while(--_0x2aa96e){_0x5df617['push'](_0x5df617['shift']());}};_0x11bac5(++_0x36d8e3);}(_0x1a23,0x1b6));var _0x31a2=function(_0x13009e,_0xb64397){_0x13009e=_0x13009e-0x0;var _0x31e9df=_0x1a23[_0x13009e];return _0x31e9df;};'use strict';var EventEmitter=require(_0x31a2('0x0'));var MailMessage=require(_0x31a2('0x1'))['db'][_0x31a2('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x31a2('0x3')](0x0);var events={'afterCreate':_0x31a2('0x4'),'afterUpdate':_0x31a2('0x5'),'afterDestroy':_0x31a2('0x6')};function emitEvent(_0x3141d8){return function(_0x2c2a27,_0x12ea4c,_0x39cd26){MailMessageEvents[_0x31a2('0x7')](_0x3141d8+':'+_0x2c2a27['id'],_0x2c2a27);MailMessageEvents[_0x31a2('0x7')](_0x3141d8,_0x2c2a27);_0x39cd26(null);};}for(var e in events){if(events[_0x31a2('0x8')](e)){var event=events[e];MailMessage[_0x31a2('0x9')](e,emitEvent(event));}}module[_0x31a2('0xa')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index e8a3e98..03775c7 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 _0xa70c=['findOne','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','./mailMessage.attributes','exports','define','MailMessage','messageId','plainBody','subject','FULLTEXT','body','fromString','get','direction','toLowerCase','out','isNil','UserId','MailInteraction'];(function(_0x251d1e,_0x5b2add){var _0x5e9b71=function(_0x4703ad){while(--_0x4703ad){_0x251d1e['push'](_0x251d1e['shift']());}};_0x5e9b71(++_0x5b2add);}(_0xa70c,0x67));var _0xca70=function(_0x5f2327,_0x123bcd){_0x5f2327=_0x5f2327-0x0;var _0x304698=_0xa70c[_0x5f2327];return _0x304698;};'use strict';var _=require(_0xca70('0x0'));var util=require(_0xca70('0x1'));var logger=require(_0xca70('0x2'))(_0xca70('0x3'));var moment=require('moment');var BPromise=require(_0xca70('0x4'));var rp=require(_0xca70('0x5'));var htmlToText=require(_0xca70('0x6'));var fs=require('fs');var path=require(_0xca70('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca70('0x8'));module[_0xca70('0x9')]=function(_0x3cf739,_0x4fe93b){return _0x3cf739[_0xca70('0xa')](_0xca70('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xca70('0xc'),'fields':[_0xca70('0xc')]},{'name':'fti_mail_messages','fields':[_0xca70('0xd'),_0xca70('0xe')],'type':_0xca70('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36cabd,_0xf9259d,_0x2dece6){if(_0x36cabd[_0xca70('0x10')]){_0x36cabd[_0xca70('0xd')]=htmlToText[_0xca70('0x11')](_0x36cabd[_0xca70('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2dece6(null,_0xf9259d);},'afterCreate':function(_0x1fd7cf,_0x13b81c,_0x3e51cc){var _0x1e2ac1=_0x3cf739['models'];var _0x5ba250=_0x1fd7cf[_0xca70('0x12')]({'plain':!![]});if(_0x5ba250[_0xca70('0x13')][_0xca70('0x14')]()==='in'||_0x5ba250[_0xca70('0x13')][_0xca70('0x14')]()===_0xca70('0x15')&&!_0x5ba250['secret']&&!_[_0xca70('0x16')](_0x5ba250[_0xca70('0x17')])){_0x1e2ac1[_0xca70('0x18')][_0xca70('0x19')]({'where':{'id':_0x5ba250['MailInteractionId']}})[_0xca70('0x1a')](function(_0xd04497){if(_0xd04497){_0xd04497[_0xca70('0x1b')]({'lastMsgAt':_0x5ba250[_0xca70('0x1c')],'lastMsgDirection':_0x5ba250[_0xca70('0x13')]['toLowerCase']()});}})['catch'](function(_0x15a929){console[_0xca70('0x1d')](_0x15a929);});}_0x3e51cc();}},'charset':_0xca70('0x1e'),'collate':_0xca70('0x1f')});}; \ No newline at end of file +var _0xe995=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','fromString','body','models','get','toLowerCase','direction','out','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe995,0x13d));var _0x5e99=function(_0x33ef0e,_0x4ffe34){_0x33ef0e=_0x33ef0e-0x0;var _0xb060fc=_0xe995[_0x33ef0e];return _0xb060fc;};'use strict';var _=require(_0x5e99('0x0'));var util=require('util');var logger=require(_0x5e99('0x1'))('api');var moment=require(_0x5e99('0x2'));var BPromise=require(_0x5e99('0x3'));var rp=require(_0x5e99('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x5e99('0x5'));var rimraf=require(_0x5e99('0x6'));var config=require(_0x5e99('0x7'));var attributes=require('./mailMessage.attributes');module[_0x5e99('0x8')]=function(_0x4042b5,_0x3711a2){return _0x4042b5[_0x5e99('0x9')]('MailMessage',attributes,{'tableName':_0x5e99('0xa'),'paranoid':![],'indexes':[{'name':_0x5e99('0xb'),'fields':['messageId']},{'name':_0x5e99('0xc'),'fields':['plainBody','subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d3b48,_0x16579f,_0xb2c68e){if(_0x5d3b48['body']){_0x5d3b48[_0x5e99('0xd')]=htmlToText[_0x5e99('0xe')](_0x5d3b48[_0x5e99('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xb2c68e(null,_0x16579f);},'afterCreate':function(_0xe43c78,_0x730f8d,_0x29396c){var _0x25ea88=_0x4042b5[_0x5e99('0x10')];var _0x9d9e29=_0xe43c78[_0x5e99('0x11')]({'plain':!![]});if(_0x9d9e29['direction'][_0x5e99('0x12')]()==='in'||_0x9d9e29[_0x5e99('0x13')][_0x5e99('0x12')]()===_0x5e99('0x14')&&!_0x9d9e29['secret']&&!_[_0x5e99('0x15')](_0x9d9e29['UserId'])){_0x25ea88[_0x5e99('0x16')][_0x5e99('0x17')]({'where':{'id':_0x9d9e29[_0x5e99('0x18')]}})[_0x5e99('0x19')](function(_0x4a44a1){if(_0x4a44a1){_0x4a44a1[_0x5e99('0x1a')]({'lastMsgAt':_0x9d9e29[_0x5e99('0x1b')],'lastMsgDirection':_0x9d9e29[_0x5e99('0x13')]['toLowerCase']()});}})[_0x5e99('0x1c')](function(_0x40fd25){console['error'](_0x40fd25);});}_0x29396c();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 18c823f..78c63b1 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 _0xdb28=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateMailMessage','MailMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request'];(function(_0x4e8efd,_0x46bc20){var _0x31e442=function(_0x4c6c00){while(--_0x4c6c00){_0x4e8efd['push'](_0x4e8efd['shift']());}};_0x31e442(++_0x46bc20);}(_0xdb28,0x106));var _0x8db2=function(_0x3ed59e,_0x6da821){_0x3ed59e=_0x3ed59e-0x0;var _0x2dedd9=_0xdb28[_0x3ed59e];return _0x2dedd9;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('MailMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateMailMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateMailMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0xe2cf=['MailMessage,\x20%s,\x20%s','request\x20sent','error','message','result','CreateMailMessage','MailMessage','create','options','debug','stringify','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailMessage.socket','request','then','info'];(function(_0xb1a10,_0x3076f0){var _0x4d0735=function(_0x4c3c3b){while(--_0x4c3c3b){_0xb1a10['push'](_0xb1a10['shift']());}};_0x4d0735(++_0x3076f0);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x42b02c,_0x5c7b99){_0x42b02c=_0x42b02c-0x0;var _0x105518=_0xe2cf[_0x42b02c];return _0x105518;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xfe2c('0x8')]=_[_0xfe2c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe2c('0xa'))(new Redis(config[_0xfe2c('0x8')]));require(_0xfe2c('0xb'))['register'](socket);function respondWithRpcPromise(_0x5b616c,_0x396912,_0x15421e){return new BPromise(function(_0x495513,_0x22278c){return client[_0xfe2c('0xc')](_0x5b616c,_0x15421e)[_0xfe2c('0xd')](function(_0xa176e9){logger[_0xfe2c('0xe')](_0xfe2c('0xf'),_0x396912,_0xfe2c('0x10'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x396912,'request\x20sent',JSON['stringify'](_0xa176e9));if(_0xa176e9[_0xfe2c('0x11')]){if(_0xa176e9['error']['code']===0x1f4){logger[_0xfe2c('0x11')](_0xfe2c('0xf'),_0x396912,_0xa176e9[_0xfe2c('0x11')][_0xfe2c('0x12')]);return _0x22278c(_0xa176e9['error']['message']);}logger[_0xfe2c('0x11')](_0xfe2c('0xf'),_0x396912,_0xa176e9[_0xfe2c('0x11')][_0xfe2c('0x12')]);return _0x495513(_0xa176e9['error'][_0xfe2c('0x12')]);}else{logger[_0xfe2c('0xe')](_0xfe2c('0xf'),_0x396912,_0xfe2c('0x10'));_0x495513(_0xa176e9[_0xfe2c('0x13')][_0xfe2c('0x12')]);}})['catch'](function(_0x22481a){logger[_0xfe2c('0x11')](_0xfe2c('0xf'),_0x396912,_0x22481a);_0x22278c(_0x22481a);});});}exports[_0xfe2c('0x14')]=function(_0x55f751){var _0x1139fe=this;return new Promise(function(_0x59bdeb,_0x4e9137){return db[_0xfe2c('0x15')][_0xfe2c('0x16')](_0x55f751['body'],{'raw':_0x55f751[_0xfe2c('0x17')]?_0x55f751[_0xfe2c('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xfe2c('0xd')](function(_0x5dd54b){logger[_0xfe2c('0xe')](_0xfe2c('0x14'),_0x55f751);logger[_0xfe2c('0x18')](_0xfe2c('0x14'),_0x55f751,JSON[_0xfe2c('0x19')](_0x5dd54b));_0x59bdeb(_0x5dd54b);})[_0xfe2c('0x1a')](function(_0x57cd6d){logger[_0xfe2c('0x11')](_0xfe2c('0x14'),_0x57cd6d[_0xfe2c('0x12')],_0x55f751);_0x4e9137(_0x1139fe[_0xfe2c('0x11')](0x1f4,_0x57cd6d[_0xfe2c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index e510b57..973d303 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 _0x3c8e=['update','emit','register','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x3c8e,0x65));var _0xe3c8=function(_0x381b0b,_0x55c68b){_0x381b0b=_0x381b0b-0x0;var _0x19fb76=_0x3c8e[_0x381b0b];return _0x19fb76;};'use strict';var MailMessageEvents=require(_0xe3c8('0x0'));var events=[_0xe3c8('0x1'),_0xe3c8('0x2'),_0xe3c8('0x3')];function createListener(_0x4839bf,_0x4e43d6){return function(_0x4398ef){_0x4e43d6[_0xe3c8('0x4')](_0x4839bf,_0x4398ef);};}function removeListener(_0x5c49ef,_0x520c40){return function(){MailMessageEvents['removeListener'](_0x5c49ef,_0x520c40);};}exports[_0xe3c8('0x5')]=function(_0x1bb709){for(var _0xd7292b=0x0,_0x2eca95=events[_0xe3c8('0x6')];_0xd7292b<_0x2eca95;_0xd7292b++){var _0x505744=events[_0xd7292b];var _0x46cd46=createListener(_0xe3c8('0x7')+_0x505744,_0x1bb709);MailMessageEvents['on'](_0x505744,_0x46cd46);}}; \ No newline at end of file +var _0xd6e1=['emit','removeListener','length','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x2b0b15,_0xa15cb2){var _0x5e4f5d=function(_0x32f80f){while(--_0x32f80f){_0x2b0b15['push'](_0x2b0b15['shift']());}};_0x5e4f5d(++_0xa15cb2);}(_0xd6e1,0x9c));var _0x1d6e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd6e1[_0x502c7d];return _0x30b7ed;};'use strict';var MailMessageEvents=require(_0x1d6e('0x0'));var events=[_0x1d6e('0x1'),_0x1d6e('0x2'),_0x1d6e('0x3')];function createListener(_0x2fdb6d,_0x1b5666){return function(_0x360601){_0x1b5666[_0x1d6e('0x4')](_0x2fdb6d,_0x360601);};}function removeListener(_0x5b24d4,_0x5ad7cb){return function(){MailMessageEvents[_0x1d6e('0x5')](_0x5b24d4,_0x5ad7cb);};}exports['register']=function(_0x7e022f){for(var _0x44f06f=0x0,_0x2a3bba=events[_0x1d6e('0x6')];_0x44f06f<_0x2a3bba;_0x44f06f++){var _0x5a218c=events[_0x44f06f];var _0x2da0ae=createListener(_0x1d6e('0x7')+_0x5a218c,_0x7e022f);MailMessageEvents['on'](_0x5a218c,_0x2da0ae);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 27ea963..41a5286 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 _0x709f=['../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','/:id','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x518d50,_0x23c6b8){var _0x485a9a=function(_0x355e9f){while(--_0x355e9f){_0x518d50['push'](_0x518d50['shift']());}};_0x485a9a(++_0x23c6b8);}(_0x709f,0xb7));var _0xf709=function(_0x4369ef,_0x55cfbc){_0x4369ef=_0x4369ef-0x0;var _0x5b6913=_0x709f[_0x4369ef];return _0x5b6913;};'use strict';var multer=require(_0xf709('0x0'));var util=require('util');var path=require(_0xf709('0x1'));var timeout=require(_0xf709('0x2'));var express=require(_0xf709('0x3'));var router=express[_0xf709('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf709('0x5'));var interaction=require(_0xf709('0x6'));var config=require(_0xf709('0x7'));var controller=require(_0xf709('0x8'));router[_0xf709('0x9')]('/',auth['isAuthenticated'](),controller[_0xf709('0xa')]);router['get'](_0xf709('0xb'),auth[_0xf709('0xc')](),controller['describe']);router[_0xf709('0x9')]('/:id',auth[_0xf709('0xc')](),controller[_0xf709('0xd')]);router['get']('/:id/members',auth[_0xf709('0xc')](),controller['getMembers']);router[_0xf709('0x9')](_0xf709('0xe'),auth['isAuthenticated'](),controller[_0xf709('0xf')]);router[_0xf709('0x9')](_0xf709('0x10'),auth[_0xf709('0xc')](),controller[_0xf709('0x11')]);router[_0xf709('0x12')]('/',auth[_0xf709('0xc')](),controller[_0xf709('0x13')]);router[_0xf709('0x12')](_0xf709('0xe'),auth[_0xf709('0xc')](),controller['addTeams']);router[_0xf709('0x12')](_0xf709('0x10'),auth[_0xf709('0xc')](),controller[_0xf709('0x14')]);router[_0xf709('0x15')](_0xf709('0x16'),auth[_0xf709('0xc')](),controller['update']);router[_0xf709('0x17')](_0xf709('0x16'),auth['isAuthenticated'](),controller[_0xf709('0x18')]);router[_0xf709('0x17')](_0xf709('0xe'),auth[_0xf709('0xc')](),controller[_0xf709('0x19')]);router[_0xf709('0x17')]('/:id/users',auth[_0xf709('0xc')](),controller[_0xf709('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x7c25=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','/:id','destroy','delete','removeTeams','removeAgents','exports'];(function(_0x32ab72,_0x47dd1b){var _0x83eea5=function(_0x5dc26c){while(--_0x5dc26c){_0x32ab72['push'](_0x32ab72['shift']());}};_0x83eea5(++_0x47dd1b);}(_0x7c25,0x1ed));var _0x57c2=function(_0x19e47b,_0xb92dc6){_0x19e47b=_0x19e47b-0x0;var _0x5727d7=_0x7c25[_0x19e47b];return _0x5727d7;};'use strict';var multer=require(_0x57c2('0x0'));var util=require(_0x57c2('0x1'));var path=require('path');var timeout=require(_0x57c2('0x2'));var express=require(_0x57c2('0x3'));var router=express[_0x57c2('0x4')]();var fs_extra=require(_0x57c2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x57c2('0x6'));var config=require(_0x57c2('0x7'));var controller=require(_0x57c2('0x8'));router[_0x57c2('0x9')]('/',auth[_0x57c2('0xa')](),controller[_0x57c2('0xb')]);router[_0x57c2('0x9')](_0x57c2('0xc'),auth[_0x57c2('0xa')](),controller[_0x57c2('0xd')]);router[_0x57c2('0x9')]('/:id',auth[_0x57c2('0xa')](),controller['show']);router[_0x57c2('0x9')](_0x57c2('0xe'),auth[_0x57c2('0xa')](),controller[_0x57c2('0xf')]);router[_0x57c2('0x9')](_0x57c2('0x10'),auth[_0x57c2('0xa')](),controller['getTeams']);router[_0x57c2('0x9')](_0x57c2('0x11'),auth['isAuthenticated'](),controller[_0x57c2('0x12')]);router[_0x57c2('0x13')]('/',auth[_0x57c2('0xa')](),controller[_0x57c2('0x14')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x57c2('0x15')]);router['post'](_0x57c2('0x11'),auth[_0x57c2('0xa')](),controller['addAgents']);router[_0x57c2('0x16')](_0x57c2('0x17'),auth[_0x57c2('0xa')](),controller['update']);router['delete'](_0x57c2('0x17'),auth[_0x57c2('0xa')](),controller[_0x57c2('0x18')]);router[_0x57c2('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x57c2('0x1a')]);router[_0x57c2('0x19')](_0x57c2('0x11'),auth[_0x57c2('0xa')](),controller[_0x57c2('0x1b')]);module[_0x57c2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 9743750..034fd28 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 _0x22d4=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x342a5b,_0x3a696f){var _0x4ac73d=function(_0x45d48c){while(--_0x45d48c){_0x342a5b['push'](_0x342a5b['shift']());}};_0x4ac73d(++_0x3a696f);}(_0x22d4,0x165));var _0x422d=function(_0x300a0a,_0x1653d4){_0x300a0a=_0x300a0a-0x0;var _0x28b718=_0x22d4[_0x300a0a];return _0x28b718;};'use strict';var Sequelize=require(_0x422d('0x0'));module[_0x422d('0x1')]={'name':{'type':Sequelize[_0x422d('0x2')],'unique':_0x422d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x422d('0x2')]},'timeout':{'type':Sequelize[_0x422d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x422d('0x5')](_0x422d('0x6'),'beepall',_0x422d('0x7'))}}; \ No newline at end of file +var _0xdc52=['rrmemory','beepall','roundrobin','exports','STRING','INTEGER','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc52,0x137));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x2dc5('0x0')]={'name':{'type':Sequelize[_0x2dc5('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2dc5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2dc5('0x3')](_0x2dc5('0x4'),_0x2dc5('0x5'),_0x2dc5('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 5d4a6e7..c8fa35f 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 _0x14fa=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','body','describe','findOne','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','createdAt','rows','format','%s/%s','SIP','mailPause','updatedAt','getTeams','Team','ids','Agents','online','voicePause','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','removeTeams','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','offset','undefined','limit','count','json','apply','reject','save','update','then','get','destroy','end','error','stack','name','send','index','map','MailQueue','rawAttributes','key','keys','intersection','model','query','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','findAll','params','fields','length','include','find','catch'];(function(_0x51df32,_0x7edb05){var _0xd6529d=function(_0x3afa69){while(--_0x3afa69){_0x51df32['push'](_0x51df32['shift']());}};_0xd6529d(++_0x7edb05);}(_0x14fa,0x1e2));var _0xa14f=function(_0x51a182,_0x5639a7){_0x51a182=_0x51a182-0x0;var _0x46aa3e=_0x14fa[_0x51a182];return _0x46aa3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa14f('0x0'));var zipdir=require(_0xa14f('0x1'));var jsonpatch=require(_0xa14f('0x2'));var rp=require(_0xa14f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa14f('0x4'));var path=require(_0xa14f('0x5'));var sox=require(_0xa14f('0x6'));var csv=require(_0xa14f('0x7'));var ejs=require(_0xa14f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa14f('0x9'));var squel=require('squel');var crypto=require(_0xa14f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa14f('0xb'));var toCsv=require(_0xa14f('0x7'));var querystring=require(_0xa14f('0xc'));var Papa=require(_0xa14f('0xd'));var Redis=require(_0xa14f('0xe'));var authService=require(_0xa14f('0xf'));var qs=require(_0xa14f('0x10'));var as=require(_0xa14f('0x11'));var hardwareService=require(_0xa14f('0x12'));var logger=require(_0xa14f('0x13'))(_0xa14f('0x14'));var utils=require(_0xa14f('0x15'));var config=require(_0xa14f('0x16'));var licenseUtil=require(_0xa14f('0x17'));var db=require(_0xa14f('0x18'))['db'];config[_0xa14f('0x19')]=_[_0xa14f('0x1a')](config[_0xa14f('0x19')],{'host':_0xa14f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa14f('0x1c'))[_0xa14f('0x1d')](socket);function respondWithStatusCode(_0x5327c4,_0x4e502b){_0x4e502b=_0x4e502b||0xcc;return function(_0x9d25e7){if(_0x9d25e7){return _0x5327c4[_0xa14f('0x1e')](_0x4e502b);}return _0x5327c4[_0xa14f('0x1f')](_0x4e502b)['end']();};}function respondWithResult(_0x46c2ec,_0x38e29a){_0x38e29a=_0x38e29a||0xc8;return function(_0x1ae425){if(_0x1ae425){return _0x46c2ec[_0xa14f('0x1f')](_0x38e29a)['json'](_0x1ae425);}};}function respondWithFilteredResult(_0x5e427b,_0x3ced25){return function(_0x2d9bef){if(_0x2d9bef){var _0xae95d0=typeof _0x3ced25[_0xa14f('0x20')]===_0xa14f('0x21')&&typeof _0x3ced25[_0xa14f('0x22')]===_0xa14f('0x21');var _0xbb9a9e=_0x2d9bef[_0xa14f('0x23')];var _0x3333d3=_0xae95d0?0x0:_0x3ced25['offset'];var _0x5aa52b=_0xae95d0?_0x2d9bef[_0xa14f('0x23')]:_0x3ced25['offset']+_0x3ced25[_0xa14f('0x22')];var _0x435b60;if(_0x5aa52b>=_0xbb9a9e){_0x5aa52b=_0xbb9a9e;_0x435b60=0xc8;}else{_0x435b60=0xce;}_0x5e427b[_0xa14f('0x1f')](_0x435b60);return _0x5e427b['set']('Content-Range',_0x3333d3+'-'+_0x5aa52b+'/'+_0xbb9a9e)[_0xa14f('0x24')](_0x2d9bef);}return null;};}function patchUpdates(_0xe3f0ce){return function(_0x3535ba){try{jsonpatch[_0xa14f('0x25')](_0x3535ba,_0xe3f0ce,!![]);}catch(_0x3c60b7){return BPromise[_0xa14f('0x26')](_0x3c60b7);}return _0x3535ba[_0xa14f('0x27')]();};}function saveUpdates(_0x27c216,_0x469e98){return function(_0x2e66cd){if(_0x2e66cd){return _0x2e66cd[_0xa14f('0x28')](_0x27c216)[_0xa14f('0x29')](function(_0x1bbe9d){return _0x1bbe9d;});}return null;};}function removeEntity(_0x495617,_0x21c993){return function(_0x158b4c){if(_0x158b4c){return _0x158b4c['destroy']()[_0xa14f('0x29')](function(){var _0x38fdfc=_0x158b4c[_0xa14f('0x2a')]({'plain':!![]});var _0x117199='MailQueues';return db['UserProfileResource'][_0xa14f('0x2b')]({'where':{'type':_0x117199,'resourceId':_0x38fdfc['id']}})[_0xa14f('0x29')](function(){return _0x158b4c;});})['then'](function(){_0x495617['status'](0xcc)[_0xa14f('0x2c')]();});}};}function handleEntityNotFound(_0x55590f,_0xd57bb6){return function(_0x552188){if(!_0x552188){_0x55590f[_0xa14f('0x1e')](0x194);}return _0x552188;};}function handleError(_0x24308a,_0x4bd9eb){_0x4bd9eb=_0x4bd9eb||0x1f4;return function(_0x5230bb){logger[_0xa14f('0x2d')](_0x5230bb[_0xa14f('0x2e')]);if(_0x5230bb[_0xa14f('0x2f')]){delete _0x5230bb[_0xa14f('0x2f')];}_0x24308a[_0xa14f('0x1f')](_0x4bd9eb)[_0xa14f('0x30')](_0x5230bb);};}exports[_0xa14f('0x31')]=function(_0x92dd36,_0x25a38c){var _0x594fda={},_0x56045b={},_0xc4782c={'count':0x0,'rows':[]};var _0x2c68a3=_[_0xa14f('0x32')](db[_0xa14f('0x33')][_0xa14f('0x34')],function(_0x1b8907){return{'name':_0x1b8907['fieldName'],'type':_0x1b8907['type'][_0xa14f('0x35')]};});_0x56045b['model']=_[_0xa14f('0x32')](_0x2c68a3,'name');_0x56045b['query']=_[_0xa14f('0x36')](_0x92dd36['query']);_0x56045b['filters']=_[_0xa14f('0x37')](_0x56045b[_0xa14f('0x38')],_0x56045b[_0xa14f('0x39')]);_0x594fda[_0xa14f('0x3a')]=_[_0xa14f('0x37')](_0x56045b[_0xa14f('0x38')],qs['fields'](_0x92dd36[_0xa14f('0x39')]['fields']));_0x594fda['attributes']=_0x594fda[_0xa14f('0x3a')]['length']?_0x594fda[_0xa14f('0x3a')]:_0x56045b[_0xa14f('0x38')];if(!_0x92dd36[_0xa14f('0x39')][_0xa14f('0x3b')](_0xa14f('0x3c'))){_0x594fda[_0xa14f('0x22')]=qs[_0xa14f('0x22')](_0x92dd36[_0xa14f('0x39')][_0xa14f('0x22')]);_0x594fda[_0xa14f('0x20')]=qs['offset'](_0x92dd36[_0xa14f('0x39')][_0xa14f('0x20')]);}_0x594fda[_0xa14f('0x3d')]=qs[_0xa14f('0x3e')](_0x92dd36[_0xa14f('0x39')][_0xa14f('0x3e')]);_0x594fda[_0xa14f('0x3f')]=qs[_0xa14f('0x40')](_[_0xa14f('0x41')](_0x92dd36[_0xa14f('0x39')],_0x56045b['filters']),_0x2c68a3);if(_0x92dd36[_0xa14f('0x39')][_0xa14f('0x42')]){_0x594fda[_0xa14f('0x3f')]=_[_0xa14f('0x43')](_0x594fda[_0xa14f('0x3f')],{'$or':_['map'](_0x2c68a3,function(_0x2857b3){if(_0x2857b3[_0xa14f('0x44')]!=='VIRTUAL'){var _0xe98dda={};_0xe98dda[_0x2857b3[_0xa14f('0x2f')]]={'$like':'%'+_0x92dd36[_0xa14f('0x39')][_0xa14f('0x42')]+'%'};return _0xe98dda;}})});}_0x594fda=_[_0xa14f('0x43')]({},_0x594fda,_0x92dd36[_0xa14f('0x45')]);var _0x4ffb88={'where':_0x594fda[_0xa14f('0x3f')]};return db[_0xa14f('0x33')][_0xa14f('0x23')](_0x4ffb88)['then'](function(_0x2c4b44){_0xc4782c[_0xa14f('0x23')]=_0x2c4b44;if(_0x92dd36['query'][_0xa14f('0x46')]){_0x594fda['include']=[{'all':!![]}];}return db[_0xa14f('0x33')][_0xa14f('0x47')](_0x594fda);})[_0xa14f('0x29')](function(_0x443122){_0xc4782c['rows']=_0x443122;return _0xc4782c;})['then'](respondWithFilteredResult(_0x25a38c,_0x594fda))['catch'](handleError(_0x25a38c,null));};exports['show']=function(_0x2c13b0,_0x36e80c){var _0x305aca={'raw':!![],'where':{'id':_0x2c13b0[_0xa14f('0x48')]['id']}},_0x4da51e={};_0x4da51e[_0xa14f('0x38')]=_[_0xa14f('0x36')](db[_0xa14f('0x33')][_0xa14f('0x34')]);_0x4da51e['query']=_[_0xa14f('0x36')](_0x2c13b0[_0xa14f('0x39')]);_0x4da51e[_0xa14f('0x40')]=_[_0xa14f('0x37')](_0x4da51e[_0xa14f('0x38')],_0x4da51e[_0xa14f('0x39')]);_0x305aca[_0xa14f('0x3a')]=_['intersection'](_0x4da51e[_0xa14f('0x38')],qs[_0xa14f('0x49')](_0x2c13b0[_0xa14f('0x39')][_0xa14f('0x49')]));_0x305aca[_0xa14f('0x3a')]=_0x305aca['attributes'][_0xa14f('0x4a')]?_0x305aca[_0xa14f('0x3a')]:_0x4da51e[_0xa14f('0x38')];if(_0x2c13b0[_0xa14f('0x39')][_0xa14f('0x46')]){_0x305aca[_0xa14f('0x4b')]=[{'all':!![]}];}_0x305aca=_[_0xa14f('0x43')]({},_0x305aca,_0x2c13b0[_0xa14f('0x45')]);return db[_0xa14f('0x33')][_0xa14f('0x4c')](_0x305aca)['then'](handleEntityNotFound(_0x36e80c,null))[_0xa14f('0x29')](respondWithResult(_0x36e80c,null))[_0xa14f('0x4d')](handleError(_0x36e80c,null));};exports['create']=function(_0x590d3c,_0x234baa){return db['MailQueue'][_0xa14f('0x4e')](_0x590d3c['body'],{})[_0xa14f('0x29')](function(_0x279e9d){var _0x2508fc=_0x590d3c[_0xa14f('0x4f')][_0xa14f('0x2a')]({'plain':!![]});if(!_0x2508fc)throw new Error(_0xa14f('0x50'));if(_0x2508fc['role']===_0xa14f('0x4f')){var _0x4c935a=_0x279e9d[_0xa14f('0x2a')]({'plain':!![]});var _0x126bf3='MailQueues';return db[_0xa14f('0x51')][_0xa14f('0x4c')]({'where':{'name':_0x126bf3,'userProfileId':_0x2508fc['userProfileId']},'raw':!![]})[_0xa14f('0x29')](function(_0x983a81){if(_0x983a81&&_0x983a81[_0xa14f('0x52')]===0x0){return db[_0xa14f('0x53')]['create']({'name':_0x4c935a['name'],'resourceId':_0x4c935a['id'],'type':_0x983a81[_0xa14f('0x2f')],'sectionId':_0x983a81['id']},{})['then'](function(){return _0x279e9d;});}else{return _0x279e9d;}})['catch'](function(_0x3d6f8f){logger[_0xa14f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d6f8f);throw _0x3d6f8f;});}return _0x279e9d;})[_0xa14f('0x29')](respondWithResult(_0x234baa,0xc9))[_0xa14f('0x4d')](handleError(_0x234baa,null));};exports[_0xa14f('0x28')]=function(_0x88020c,_0x36e8d9){if(_0x88020c['body']['id']){delete _0x88020c[_0xa14f('0x54')]['id'];}return db[_0xa14f('0x33')]['find']({'where':{'id':_0x88020c[_0xa14f('0x48')]['id']}})[_0xa14f('0x29')](handleEntityNotFound(_0x36e8d9,null))[_0xa14f('0x29')](saveUpdates(_0x88020c[_0xa14f('0x54')],null))[_0xa14f('0x29')](respondWithResult(_0x36e8d9,null))[_0xa14f('0x4d')](handleError(_0x36e8d9,null));};exports[_0xa14f('0x2b')]=function(_0x559748,_0x1391e8){return db[_0xa14f('0x33')]['find']({'where':{'id':_0x559748['params']['id']}})[_0xa14f('0x29')](handleEntityNotFound(_0x1391e8,null))['then'](removeEntity(_0x1391e8,null))[_0xa14f('0x4d')](handleError(_0x1391e8,null));};exports[_0xa14f('0x55')]=function(_0x2c7afa,_0x39aab6){return db[_0xa14f('0x33')][_0xa14f('0x55')]()['then'](respondWithResult(_0x39aab6,null))[_0xa14f('0x4d')](handleError(_0x39aab6,null));};exports['getMembers']=function(_0xc79013,_0x5221ad,_0x3ee7a6){var _0x4b528a={'raw':!![],'where':{}},_0x3904c8={},_0x37a38a;return db['MailQueue'][_0xa14f('0x56')]({'where':{'id':_0xc79013[_0xa14f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5221ad,null))[_0xa14f('0x29')](function(_0x290146){if(_0x290146){_0x37a38a=_0x290146[_0xa14f('0x2a')]({'plain':!![]});_0x3904c8['model']=_[_0xa14f('0x36')](db['UserMailQueue'][_0xa14f('0x34')]);_0x3904c8[_0xa14f('0x39')]=_[_0xa14f('0x36')](_0xc79013[_0xa14f('0x39')]);_0x3904c8[_0xa14f('0x40')]=_['intersection'](_0x3904c8[_0xa14f('0x38')],_0x3904c8[_0xa14f('0x39')]);_0x4b528a[_0xa14f('0x3a')]=_[_0xa14f('0x37')](_0x3904c8[_0xa14f('0x38')],qs[_0xa14f('0x49')](_0xc79013[_0xa14f('0x39')][_0xa14f('0x49')]));_0x4b528a['attributes']=_0x4b528a['attributes'][_0xa14f('0x4a')]?_0x4b528a['attributes']:_0x3904c8['model'];if(!_0xc79013[_0xa14f('0x39')][_0xa14f('0x3b')](_0xa14f('0x3c'))){_0x4b528a[_0xa14f('0x22')]=qs['limit'](_0xc79013[_0xa14f('0x39')][_0xa14f('0x22')]);_0x4b528a[_0xa14f('0x20')]=qs[_0xa14f('0x20')](_0xc79013['query'][_0xa14f('0x20')]);}_0x4b528a[_0xa14f('0x3d')]=qs[_0xa14f('0x3e')](_0xc79013[_0xa14f('0x39')][_0xa14f('0x3e')]);_0x4b528a[_0xa14f('0x3f')]=qs[_0xa14f('0x40')](_[_0xa14f('0x41')](_0xc79013[_0xa14f('0x39')],_0x3904c8[_0xa14f('0x40')]));_0x4b528a['where'][_0xa14f('0x57')]=_0x290146['id'];if(_0xc79013[_0xa14f('0x39')][_0xa14f('0x42')]){_0x4b528a[_0xa14f('0x3f')]=_[_0xa14f('0x43')](_0x4b528a[_0xa14f('0x3f')],{'$or':_['map'](_0x4b528a['attributes'],function(_0x52d7cc){var _0x42b550={};_0x42b550[_0x52d7cc]={'$like':'%'+_0xc79013[_0xa14f('0x39')]['filter']+'%'};return _0x42b550;})});}_0x4b528a=_[_0xa14f('0x43')]({},_0x4b528a,_0xc79013[_0xa14f('0x45')]);return db[_0xa14f('0x58')]['findAll'](_0x4b528a);}})[_0xa14f('0x29')](function(_0x1a1c2c){if(_0x1a1c2c){return db[_0xa14f('0x59')][_0xa14f('0x5a')]({'where':{'id':_['map'](_0x1a1c2c,_0xa14f('0x5b')),'role':_0xa14f('0x5c')},'attributes':['id',_0xa14f('0x2f'),'mailPause','updatedAt',_0xa14f('0x5d')]});}})[_0xa14f('0x29')](function(_0x3436e7){if(_0x3436e7){return{'count':_0x3436e7[_0xa14f('0x23')],'rows':_['map'](_0x3436e7[_0xa14f('0x5e')],function(_0x461a99){return{'membername':_0x461a99[_0xa14f('0x2f')],'UserId':_0x461a99['id'],'queue_name':_0x37a38a[_0xa14f('0x2f')],'MailQueueId':_0x37a38a['id'],'interface':util[_0xa14f('0x5f')](_0xa14f('0x60'),_0xa14f('0x61'),_0x461a99[_0xa14f('0x2f')]),'penalty':0x0,'paused':_0x461a99[_0xa14f('0x62')],'createdAt':_0x461a99[_0xa14f('0x5d')],'updatedAt':_0x461a99[_0xa14f('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa14f('0x29')](respondWithFilteredResult(_0x5221ad,_0x4b528a))[_0xa14f('0x4d')](handleError(_0x5221ad,null));};exports[_0xa14f('0x64')]=function(_0x3bb5b1,_0x5ea4fa,_0x5ced54){var _0x47df3c={};var _0xa1c27a={};var _0x2c7e39;var _0x303cb5;return db[_0xa14f('0x33')][_0xa14f('0x56')]({'where':{'id':_0x3bb5b1['params']['id']}})['then'](handleEntityNotFound(_0x5ea4fa,null))['then'](function(_0xf554e2){if(_0xf554e2){_0x2c7e39=_0xf554e2;_0xa1c27a['model']=_[_0xa14f('0x36')](db[_0xa14f('0x65')][_0xa14f('0x34')]);_0xa1c27a[_0xa14f('0x39')]=_[_0xa14f('0x36')](_0x3bb5b1['query']);_0xa1c27a[_0xa14f('0x40')]=_[_0xa14f('0x37')](_0xa1c27a['model'],_0xa1c27a[_0xa14f('0x39')]);_0x47df3c[_0xa14f('0x3a')]=_['intersection'](_0xa1c27a['model'],qs['fields'](_0x3bb5b1['query'][_0xa14f('0x49')]));_0x47df3c['attributes']=_0x47df3c[_0xa14f('0x3a')][_0xa14f('0x4a')]?_0x47df3c[_0xa14f('0x3a')]:_0xa1c27a[_0xa14f('0x38')];_0x47df3c['order']=qs[_0xa14f('0x3e')](_0x3bb5b1[_0xa14f('0x39')][_0xa14f('0x3e')]);_0x47df3c['where']=qs['filters'](_[_0xa14f('0x41')](_0x3bb5b1[_0xa14f('0x39')],_0xa1c27a[_0xa14f('0x40')]));if(_0x3bb5b1[_0xa14f('0x39')][_0xa14f('0x42')]){_0x47df3c['where']=_[_0xa14f('0x43')](_0x47df3c[_0xa14f('0x3f')],{'$or':_[_0xa14f('0x32')](_0x47df3c[_0xa14f('0x3a')],function(_0x2f9a5c){var _0x480927={};_0x480927[_0x2f9a5c]={'$like':'%'+_0x3bb5b1[_0xa14f('0x39')][_0xa14f('0x42')]+'%'};return _0x480927;})});}_0x47df3c=_[_0xa14f('0x43')]({},_0x47df3c,_0x3bb5b1[_0xa14f('0x45')]);return _0x2c7e39[_0xa14f('0x64')](_0x47df3c);}})['then'](function(_0x273897){if(_0x273897){_0x303cb5=_0x273897[_0xa14f('0x4a')];if(!_0x3bb5b1['query'][_0xa14f('0x3b')](_0xa14f('0x3c'))){_0x47df3c['limit']=qs[_0xa14f('0x22')](_0x3bb5b1[_0xa14f('0x39')]['limit']);_0x47df3c[_0xa14f('0x20')]=qs[_0xa14f('0x20')](_0x3bb5b1[_0xa14f('0x39')][_0xa14f('0x20')]);}return _0x2c7e39['getTeams'](_0x47df3c);}})['then'](function(_0x56025e){if(_0x56025e){return _0x56025e?{'count':_0x303cb5,'rows':_0x56025e}:null;}})[_0xa14f('0x29')](respondWithResult(_0x5ea4fa,null))[_0xa14f('0x4d')](handleError(_0x5ea4fa,null));};exports['addTeams']=function(_0x1af858,_0x2db66b,_0x2b8847){var _0xd523b9=_0x1af858['body'][_0xa14f('0x66')];return db['Team'][_0xa14f('0x47')]({'where':{'id':_0xd523b9},'attributes':['id'],'include':[{'model':db[_0xa14f('0x59')],'as':_0xa14f('0x67'),'attributes':['id',_0xa14f('0x2f'),_0xa14f('0x68'),_0xa14f('0x69'),'interface'],'raw':!![]}]})[_0xa14f('0x29')](function(_0x3e198d){if(_0x3e198d){var _0x56eb7c=_['flatMap'](_0x3e198d,function(_0x57db38){var _0x163b04=_0x57db38[_0xa14f('0x2a')]({'plain':!![]});return _0x163b04[_0xa14f('0x67')];});return db[_0xa14f('0x33')][_0xa14f('0x4c')]({'where':{'id':_0x1af858[_0xa14f('0x48')]['id']}})[_0xa14f('0x29')](function(_0x3b6036){return db[_0xa14f('0x6a')]['transaction'](function(_0x1f3cf3){return _0x3b6036['addTeams'](_0xd523b9,{'transaction':_0x1f3cf3})[_0xa14f('0x29')](function(){return BPromise[_0xa14f('0x6b')](_0x56eb7c,function(_0x443a5c){return db[_0xa14f('0x58')][_0xa14f('0x6c')]({'where':{'UserId':_0x443a5c['id'],'MailQueueId':_0x1af858['params']['id']},'transaction':_0x1f3cf3});});})[_0xa14f('0x29')](function(){_0x56eb7c[_0xa14f('0x6d')](function(_0x5dc572){socket[_0xa14f('0x6e')](_0xa14f('0x6f'),{'UserId':_0x5dc572['id'],'MailQueueId':_0x3b6036['id']});});});});});}})[_0xa14f('0x29')](respondWithStatusCode(_0x2db66b,null))[_0xa14f('0x4d')](handleError(_0x2db66b,null));};exports['removeTeams']=function(_0x3d444a,_0x455c3b,_0x160bce){return db[_0xa14f('0x65')][_0xa14f('0x47')]({'where':{'id':_0x3d444a[_0xa14f('0x39')][_0xa14f('0x66')]},'attributes':['id'],'include':[{'model':db[_0xa14f('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa14f('0x29')](handleEntityNotFound(_0x455c3b,null))[_0xa14f('0x29')](function(_0x29bf18){var _0x555730=_['map'](_0x29bf18,'id');var _0x8aece7=[];var _0x5255f8=[];var _0x2242d5=squel[_0xa14f('0x70')]();_0x2242d5[_0xa14f('0x71')](_0xa14f('0x72'))[_0xa14f('0x73')](_0xa14f('0x74'),'tq')[_0xa14f('0x75')](_0xa14f('0x76'),'ut',_0xa14f('0x77'))[_0xa14f('0x3f')]('MailQueueId\x20=\x20?',_0x3d444a[_0xa14f('0x48')]['id']);for(var _0x5e1b45=0x0;_0x5e1b45<_0x29bf18[_0xa14f('0x4a')];_0x5e1b45+=0x1){let _0x4d7318=_0x29bf18[_0x5e1b45];for(var _0x1154ea=0x0;_0x1154ea<_0x4d7318['Agents'][_0xa14f('0x4a')];_0x1154ea+=0x1){let _0x223929=_0x4d7318['Agents'][_0x1154ea];var _0x3ded50=_0x2242d5[_0xa14f('0x78')]();_0x3ded50[_0xa14f('0x3f')](_0xa14f('0x79'),_0x223929['id']);_0x5255f8[_0xa14f('0x7a')](db[_0xa14f('0x6a')][_0xa14f('0x39')](_0x3ded50[_0xa14f('0x7b')](),{'type':db['sequelize'][_0xa14f('0x7c')][_0xa14f('0x7d')]})[_0xa14f('0x29')](function(_0xdc0a84){if(_0xdc0a84['length']===0x1){return _0x223929['id'];}else{var _0x56ff9a=_[_0xa14f('0x7e')](_[_0xa14f('0x32')](_0xdc0a84,_0xa14f('0x7f')),function(_0x4bc404){return _[_0xa14f('0x80')](_0x555730,_0x4bc404);});if(_0x56ff9a){return _0x223929['id'];}}}));}}return BPromise['all'](_0x5255f8)[_0xa14f('0x29')](function(_0x3355ef){_0x8aece7=_(_0x8aece7)[_0xa14f('0x81')](_0x3355ef)['compact']()[_0xa14f('0x82')]();return db[_0xa14f('0x33')]['find']({'where':{'id':_0x3d444a[_0xa14f('0x48')]['id']}})[_0xa14f('0x29')](function(_0x7c22e5){return db[_0xa14f('0x6a')]['transaction'](function(_0x4014c4){return _0x7c22e5[_0xa14f('0x83')](_0x3d444a['query'][_0xa14f('0x66')],{'transaction':_0x4014c4})['then'](function(){if(!_[_0xa14f('0x84')](_0x8aece7)){return _0x7c22e5['removeAgents'](_0x8aece7,{'transaction':_0x4014c4});}})[_0xa14f('0x29')](function(){_0x8aece7[_0xa14f('0x6d')](function(_0x4b237e){socket[_0xa14f('0x6e')](_0xa14f('0x85'),{'UserId':_0x4b237e,'MailQueueId':_0x7c22e5['id']});});});});});});})[_0xa14f('0x29')](respondWithStatusCode(_0x455c3b,null))[_0xa14f('0x4d')](handleError(_0x455c3b,null));};exports[_0xa14f('0x86')]=function(_0x4703ea,_0x56b856,_0x312ff7){return db[_0xa14f('0x33')][_0xa14f('0x4c')]({'where':{'id':_0x4703ea['params']['id']}})[_0xa14f('0x29')](handleEntityNotFound(_0x56b856,null))[_0xa14f('0x29')](function(_0x261b15){if(_0x261b15){return _0x261b15['addAgents'](_0x4703ea[_0xa14f('0x54')][_0xa14f('0x66')],_[_0xa14f('0x87')](_0x4703ea[_0xa14f('0x54')],[_0xa14f('0x66'),'id'])||{})[_0xa14f('0x88')](function(_0x186766){for(var _0x3ff012=0x0;_0x3ff012<_0x4703ea[_0xa14f('0x54')][_0xa14f('0x66')][_0xa14f('0x4a')];_0x3ff012+=0x1){socket[_0xa14f('0x6e')](_0xa14f('0x6f'),{'UserId':Number(_0x4703ea[_0xa14f('0x54')]['ids'][_0x3ff012]),'MailQueueId':Number(_0x4703ea[_0xa14f('0x48')]['id'])});}return _0x186766;});}})[_0xa14f('0x29')](respondWithResult(_0x56b856,null))[_0xa14f('0x4d')](handleError(_0x56b856,null));};exports['removeAgents']=function(_0x48ce42,_0x76dda5,_0x489854){return db['MailQueue'][_0xa14f('0x4c')]({'where':{'id':_0x48ce42[_0xa14f('0x48')]['id']}})[_0xa14f('0x29')](handleEntityNotFound(_0x76dda5,null))['then'](function(_0x31008a){if(_0x31008a){return _0x31008a[_0xa14f('0x89')](_0x48ce42[_0xa14f('0x39')]['ids'])[_0xa14f('0x29')](function(){if(_[_0xa14f('0x8a')](_0x48ce42[_0xa14f('0x39')][_0xa14f('0x66')])){for(var _0x1e66d7=0x0;_0x1e66d7<_0x48ce42[_0xa14f('0x39')][_0xa14f('0x66')][_0xa14f('0x4a')];_0x1e66d7+=0x1){socket[_0xa14f('0x6e')](_0xa14f('0x85'),{'UserId':Number(_0x48ce42[_0xa14f('0x39')][_0xa14f('0x66')][_0x1e66d7]),'MailQueueId':Number(_0x48ce42[_0xa14f('0x48')]['id'])});}}else{socket['emit'](_0xa14f('0x85'),{'UserId':Number(_0x48ce42[_0xa14f('0x39')][_0xa14f('0x66')]),'MailQueueId':Number(_0x48ce42[_0xa14f('0x48')]['id'])});}});}})[_0xa14f('0x29')](respondWithStatusCode(_0x76dda5,null))[_0xa14f('0x4d')](handleError(_0x76dda5,null));};exports[_0xa14f('0x8b')]=function(_0x828b62,_0x258a45,_0x6ba5d9){var _0x523a52={};var _0xbb2d2f={};var _0x451a16;var _0x13f60b;return db['MailQueue'][_0xa14f('0x56')]({'where':{'id':_0x828b62[_0xa14f('0x48')]['id']}})['then'](handleEntityNotFound(_0x258a45,null))[_0xa14f('0x29')](function(_0x187db3){if(_0x187db3){_0x451a16=_0x187db3;_0xbb2d2f[_0xa14f('0x38')]=_[_0xa14f('0x36')](db['User'][_0xa14f('0x34')]);_0xbb2d2f[_0xa14f('0x39')]=_[_0xa14f('0x36')](_0x828b62['query']);_0xbb2d2f[_0xa14f('0x40')]=_[_0xa14f('0x37')](_0xbb2d2f[_0xa14f('0x38')],_0xbb2d2f[_0xa14f('0x39')]);_0x523a52[_0xa14f('0x3a')]=_[_0xa14f('0x37')](_0xbb2d2f[_0xa14f('0x38')],qs['fields'](_0x828b62['query'][_0xa14f('0x49')]));_0x523a52['attributes']=_0x523a52['attributes'][_0xa14f('0x4a')]?_0x523a52[_0xa14f('0x3a')]:_0xbb2d2f[_0xa14f('0x38')];_0x523a52[_0xa14f('0x3d')]=qs[_0xa14f('0x3e')](_0x828b62[_0xa14f('0x39')][_0xa14f('0x3e')]);_0x523a52[_0xa14f('0x3f')]=qs[_0xa14f('0x40')](_['pick'](_0x828b62[_0xa14f('0x39')],_0xbb2d2f[_0xa14f('0x40')]));if(_0x828b62[_0xa14f('0x39')][_0xa14f('0x42')]){_0x523a52[_0xa14f('0x3f')]=_[_0xa14f('0x43')](_0x523a52['where'],{'$or':_['map'](_0x523a52['attributes'],function(_0x24dce8){var _0x1d1c49={};_0x1d1c49[_0x24dce8]={'$like':'%'+_0x828b62[_0xa14f('0x39')][_0xa14f('0x42')]+'%'};return _0x1d1c49;})});}_0x523a52=_[_0xa14f('0x43')]({},_0x523a52,_0x828b62['options']);return _0x451a16[_0xa14f('0x8b')](_0x523a52);}})[_0xa14f('0x29')](function(_0x584c6a){if(_0x584c6a){_0x13f60b=_0x584c6a[_0xa14f('0x4a')];if(!_0x828b62['query'][_0xa14f('0x3b')](_0xa14f('0x3c'))){_0x523a52[_0xa14f('0x22')]=qs[_0xa14f('0x22')](_0x828b62['query']['limit']);_0x523a52[_0xa14f('0x20')]=qs['offset'](_0x828b62[_0xa14f('0x39')][_0xa14f('0x20')]);}return _0x451a16[_0xa14f('0x8b')](_0x523a52);}})[_0xa14f('0x29')](function(_0x254b5b){if(_0x254b5b){return _0x254b5b?{'count':_0x13f60b,'rows':_0x254b5b}:null;}})[_0xa14f('0x29')](respondWithResult(_0x258a45,null))[_0xa14f('0x4d')](handleError(_0x258a45,null));}; \ No newline at end of file +var _0xbab3=['transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','SELECT','every','all','union','value','isEmpty','forEach','userMailQueue:remove','addAgents','omit','removeAgents','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','MailQueues','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','key','map','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','intersection','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap'];(function(_0x158129,_0x25039a){var _0x1d1059=function(_0x46c472){while(--_0x46c472){_0x158129['push'](_0x158129['shift']());}};_0x1d1059(++_0x25039a);}(_0xbab3,0x130));var _0x3bab=function(_0x278679,_0x1eb219){_0x278679=_0x278679-0x0;var _0x4874aa=_0xbab3[_0x278679];return _0x4874aa;};'use strict';var emlformat=require(_0x3bab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bab('0x1'));var jsonpatch=require(_0x3bab('0x2'));var rp=require(_0x3bab('0x3'));var moment=require('moment');var BPromise=require(_0x3bab('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3bab('0x5'));var csv=require('to-csv');var ejs=require(_0x3bab('0x6'));var fs=require('fs');var fs_extra=require(_0x3bab('0x7'));var _=require(_0x3bab('0x8'));var squel=require(_0x3bab('0x9'));var crypto=require(_0x3bab('0xa'));var jsforce=require(_0x3bab('0xb'));var deskjs=require(_0x3bab('0xc'));var toCsv=require(_0x3bab('0xd'));var querystring=require(_0x3bab('0xe'));var Papa=require(_0x3bab('0xf'));var Redis=require(_0x3bab('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3bab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bab('0x12'));var logger=require(_0x3bab('0x13'))('api');var utils=require(_0x3bab('0x14'));var config=require(_0x3bab('0x15'));var licenseUtil=require(_0x3bab('0x16'));var db=require(_0x3bab('0x17'))['db'];config[_0x3bab('0x18')]=_[_0x3bab('0x19')](config[_0x3bab('0x18')],{'host':_0x3bab('0x1a'),'port':0x18eb});var socket=require(_0x3bab('0x1b'))(new Redis(config[_0x3bab('0x18')]));require(_0x3bab('0x1c'))[_0x3bab('0x1d')](socket);function respondWithStatusCode(_0x1cc3bd,_0x25ea2e){_0x25ea2e=_0x25ea2e||0xcc;return function(_0x2828ea){if(_0x2828ea){return _0x1cc3bd[_0x3bab('0x1e')](_0x25ea2e);}return _0x1cc3bd[_0x3bab('0x1f')](_0x25ea2e)[_0x3bab('0x20')]();};}function respondWithResult(_0x51b3e3,_0x55f969){_0x55f969=_0x55f969||0xc8;return function(_0x518b89){if(_0x518b89){return _0x51b3e3[_0x3bab('0x1f')](_0x55f969)[_0x3bab('0x21')](_0x518b89);}};}function respondWithFilteredResult(_0x3d38a6,_0x1ccdb5){return function(_0x3c9a22){if(_0x3c9a22){var _0x1f4cad=typeof _0x1ccdb5[_0x3bab('0x22')]===_0x3bab('0x23')&&typeof _0x1ccdb5[_0x3bab('0x24')]==='undefined';var _0x142dc2=_0x3c9a22[_0x3bab('0x25')];var _0x46c8d9=_0x1f4cad?0x0:_0x1ccdb5['offset'];var _0x5a4f54=_0x1f4cad?_0x3c9a22[_0x3bab('0x25')]:_0x1ccdb5[_0x3bab('0x22')]+_0x1ccdb5['limit'];var _0x395469;if(_0x5a4f54>=_0x142dc2){_0x5a4f54=_0x142dc2;_0x395469=0xc8;}else{_0x395469=0xce;}_0x3d38a6['status'](_0x395469);return _0x3d38a6[_0x3bab('0x26')](_0x3bab('0x27'),_0x46c8d9+'-'+_0x5a4f54+'/'+_0x142dc2)[_0x3bab('0x21')](_0x3c9a22);}return null;};}function patchUpdates(_0x28d4bf){return function(_0x377e9e){try{jsonpatch['apply'](_0x377e9e,_0x28d4bf,!![]);}catch(_0x1b8f39){return BPromise[_0x3bab('0x28')](_0x1b8f39);}return _0x377e9e['save']();};}function saveUpdates(_0x497a4f,_0x1493f9){return function(_0x2065e8){if(_0x2065e8){return _0x2065e8[_0x3bab('0x29')](_0x497a4f)[_0x3bab('0x2a')](function(_0x2fcba3){return _0x2fcba3;});}return null;};}function removeEntity(_0x5d08da,_0x2538a3){return function(_0x203981){if(_0x203981){return _0x203981[_0x3bab('0x2b')]()[_0x3bab('0x2a')](function(){var _0x524daf=_0x203981[_0x3bab('0x2c')]({'plain':!![]});var _0x109860=_0x3bab('0x2d');return db['UserProfileResource'][_0x3bab('0x2b')]({'where':{'type':_0x109860,'resourceId':_0x524daf['id']}})[_0x3bab('0x2a')](function(){return _0x203981;});})['then'](function(){_0x5d08da[_0x3bab('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x372926,_0x5148f5){return function(_0x15513e){if(!_0x15513e){_0x372926[_0x3bab('0x1e')](0x194);}return _0x15513e;};}function handleError(_0x2f3629,_0x4bf900){_0x4bf900=_0x4bf900||0x1f4;return function(_0x4b3f5d){logger[_0x3bab('0x2e')](_0x4b3f5d[_0x3bab('0x2f')]);if(_0x4b3f5d['name']){delete _0x4b3f5d[_0x3bab('0x30')];}_0x2f3629[_0x3bab('0x1f')](_0x4bf900)[_0x3bab('0x31')](_0x4b3f5d);};}exports['index']=function(_0x522438,_0x4192c7){var _0x1250c7={},_0x1b53e5={},_0x100ff3={'count':0x0,'rows':[]};var _0x5c0b85=_['map'](db[_0x3bab('0x32')][_0x3bab('0x33')],function(_0x3a4c7f){return{'name':_0x3a4c7f[_0x3bab('0x34')],'type':_0x3a4c7f[_0x3bab('0x35')][_0x3bab('0x36')]};});_0x1b53e5['model']=_[_0x3bab('0x37')](_0x5c0b85,_0x3bab('0x30'));_0x1b53e5[_0x3bab('0x38')]=_['keys'](_0x522438[_0x3bab('0x38')]);_0x1b53e5['filters']=_['intersection'](_0x1b53e5[_0x3bab('0x39')],_0x1b53e5[_0x3bab('0x38')]);_0x1250c7[_0x3bab('0x3a')]=_['intersection'](_0x1b53e5['model'],qs[_0x3bab('0x3b')](_0x522438[_0x3bab('0x38')][_0x3bab('0x3b')]));_0x1250c7[_0x3bab('0x3a')]=_0x1250c7[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0x1250c7[_0x3bab('0x3a')]:_0x1b53e5[_0x3bab('0x39')];if(!_0x522438[_0x3bab('0x38')][_0x3bab('0x3d')](_0x3bab('0x3e'))){_0x1250c7[_0x3bab('0x24')]=qs['limit'](_0x522438[_0x3bab('0x38')][_0x3bab('0x24')]);_0x1250c7['offset']=qs[_0x3bab('0x22')](_0x522438[_0x3bab('0x38')][_0x3bab('0x22')]);}_0x1250c7[_0x3bab('0x3f')]=qs['sort'](_0x522438[_0x3bab('0x38')][_0x3bab('0x40')]);_0x1250c7[_0x3bab('0x41')]=qs[_0x3bab('0x42')](_[_0x3bab('0x43')](_0x522438[_0x3bab('0x38')],_0x1b53e5[_0x3bab('0x42')]),_0x5c0b85);if(_0x522438[_0x3bab('0x38')][_0x3bab('0x44')]){_0x1250c7[_0x3bab('0x41')]=_[_0x3bab('0x45')](_0x1250c7[_0x3bab('0x41')],{'$or':_[_0x3bab('0x37')](_0x5c0b85,function(_0xf57cfe){if(_0xf57cfe[_0x3bab('0x35')]!==_0x3bab('0x46')){var _0x568f43={};_0x568f43[_0xf57cfe[_0x3bab('0x30')]]={'$like':'%'+_0x522438[_0x3bab('0x38')][_0x3bab('0x44')]+'%'};return _0x568f43;}})});}_0x1250c7=_[_0x3bab('0x45')]({},_0x1250c7,_0x522438[_0x3bab('0x47')]);var _0x26fe75={'where':_0x1250c7['where']};return db['MailQueue'][_0x3bab('0x25')](_0x26fe75)[_0x3bab('0x2a')](function(_0x36a3e6){_0x100ff3[_0x3bab('0x25')]=_0x36a3e6;if(_0x522438['query'][_0x3bab('0x48')]){_0x1250c7[_0x3bab('0x49')]=[{'all':!![]}];}return db['MailQueue'][_0x3bab('0x4a')](_0x1250c7);})[_0x3bab('0x2a')](function(_0x37159a){_0x100ff3[_0x3bab('0x4b')]=_0x37159a;return _0x100ff3;})['then'](respondWithFilteredResult(_0x4192c7,_0x1250c7))[_0x3bab('0x4c')](handleError(_0x4192c7,null));};exports['show']=function(_0x4a5766,_0x58f1b5){var _0xdf94e6={'raw':!![],'where':{'id':_0x4a5766[_0x3bab('0x4d')]['id']}},_0x195f3e={};_0x195f3e[_0x3bab('0x39')]=_[_0x3bab('0x4e')](db[_0x3bab('0x32')][_0x3bab('0x33')]);_0x195f3e[_0x3bab('0x38')]=_[_0x3bab('0x4e')](_0x4a5766[_0x3bab('0x38')]);_0x195f3e[_0x3bab('0x42')]=_['intersection'](_0x195f3e[_0x3bab('0x39')],_0x195f3e[_0x3bab('0x38')]);_0xdf94e6[_0x3bab('0x3a')]=_[_0x3bab('0x4f')](_0x195f3e[_0x3bab('0x39')],qs[_0x3bab('0x3b')](_0x4a5766[_0x3bab('0x38')][_0x3bab('0x3b')]));_0xdf94e6[_0x3bab('0x3a')]=_0xdf94e6[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0xdf94e6['attributes']:_0x195f3e['model'];if(_0x4a5766[_0x3bab('0x38')][_0x3bab('0x48')]){_0xdf94e6[_0x3bab('0x49')]=[{'all':!![]}];}_0xdf94e6=_[_0x3bab('0x45')]({},_0xdf94e6,_0x4a5766[_0x3bab('0x47')]);return db['MailQueue'][_0x3bab('0x50')](_0xdf94e6)[_0x3bab('0x2a')](handleEntityNotFound(_0x58f1b5,null))[_0x3bab('0x2a')](respondWithResult(_0x58f1b5,null))[_0x3bab('0x4c')](handleError(_0x58f1b5,null));};exports['create']=function(_0x4bbc0c,_0x2f6821){return db[_0x3bab('0x32')]['create'](_0x4bbc0c['body'],{})[_0x3bab('0x2a')](function(_0x5e1324){var _0x54a553=_0x4bbc0c['user'][_0x3bab('0x2c')]({'plain':!![]});if(!_0x54a553)throw new Error(_0x3bab('0x51'));if(_0x54a553['role']===_0x3bab('0x52')){var _0x414a5c=_0x5e1324['get']({'plain':!![]});var _0x569519=_0x3bab('0x2d');return db[_0x3bab('0x53')][_0x3bab('0x50')]({'where':{'name':_0x569519,'userProfileId':_0x54a553[_0x3bab('0x54')]},'raw':!![]})[_0x3bab('0x2a')](function(_0x552c17){if(_0x552c17&&_0x552c17['autoAssociation']===0x0){return db['UserProfileResource'][_0x3bab('0x55')]({'name':_0x414a5c[_0x3bab('0x30')],'resourceId':_0x414a5c['id'],'type':_0x552c17['name'],'sectionId':_0x552c17['id']},{})['then'](function(){return _0x5e1324;});}else{return _0x5e1324;}})[_0x3bab('0x4c')](function(_0x568fe5){logger['error'](_0x3bab('0x56'),_0x568fe5);throw _0x568fe5;});}return _0x5e1324;})[_0x3bab('0x2a')](respondWithResult(_0x2f6821,0xc9))[_0x3bab('0x4c')](handleError(_0x2f6821,null));};exports[_0x3bab('0x29')]=function(_0x3fa606,_0x4ec971){if(_0x3fa606[_0x3bab('0x57')]['id']){delete _0x3fa606[_0x3bab('0x57')]['id'];}return db[_0x3bab('0x32')]['find']({'where':{'id':_0x3fa606[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x4ec971,null))[_0x3bab('0x2a')](saveUpdates(_0x3fa606[_0x3bab('0x57')],null))[_0x3bab('0x2a')](respondWithResult(_0x4ec971,null))[_0x3bab('0x4c')](handleError(_0x4ec971,null));};exports[_0x3bab('0x2b')]=function(_0x229674,_0x289734){return db['MailQueue'][_0x3bab('0x50')]({'where':{'id':_0x229674[_0x3bab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x289734,null))[_0x3bab('0x2a')](removeEntity(_0x289734,null))[_0x3bab('0x4c')](handleError(_0x289734,null));};exports[_0x3bab('0x58')]=function(_0x42de5a,_0x23fe67){return db[_0x3bab('0x32')]['describe']()['then'](respondWithResult(_0x23fe67,null))[_0x3bab('0x4c')](handleError(_0x23fe67,null));};exports[_0x3bab('0x59')]=function(_0x4f9c38,_0x4c0cbd,_0x4c68b5){var _0x2f4fe8={'raw':!![],'where':{}},_0xcac681={},_0x54e91b;return db[_0x3bab('0x32')][_0x3bab('0x5a')]({'where':{'id':_0x4f9c38[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x4c0cbd,null))['then'](function(_0x2cf3b8){if(_0x2cf3b8){_0x54e91b=_0x2cf3b8[_0x3bab('0x2c')]({'plain':!![]});_0xcac681[_0x3bab('0x39')]=_[_0x3bab('0x4e')](db[_0x3bab('0x5b')][_0x3bab('0x33')]);_0xcac681[_0x3bab('0x38')]=_['keys'](_0x4f9c38[_0x3bab('0x38')]);_0xcac681[_0x3bab('0x42')]=_[_0x3bab('0x4f')](_0xcac681[_0x3bab('0x39')],_0xcac681[_0x3bab('0x38')]);_0x2f4fe8[_0x3bab('0x3a')]=_[_0x3bab('0x4f')](_0xcac681[_0x3bab('0x39')],qs[_0x3bab('0x3b')](_0x4f9c38[_0x3bab('0x38')][_0x3bab('0x3b')]));_0x2f4fe8[_0x3bab('0x3a')]=_0x2f4fe8[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0x2f4fe8['attributes']:_0xcac681[_0x3bab('0x39')];if(!_0x4f9c38[_0x3bab('0x38')]['hasOwnProperty'](_0x3bab('0x3e'))){_0x2f4fe8[_0x3bab('0x24')]=qs[_0x3bab('0x24')](_0x4f9c38[_0x3bab('0x38')]['limit']);_0x2f4fe8[_0x3bab('0x22')]=qs[_0x3bab('0x22')](_0x4f9c38['query']['offset']);}_0x2f4fe8[_0x3bab('0x3f')]=qs[_0x3bab('0x40')](_0x4f9c38[_0x3bab('0x38')][_0x3bab('0x40')]);_0x2f4fe8['where']=qs[_0x3bab('0x42')](_['pick'](_0x4f9c38['query'],_0xcac681['filters']));_0x2f4fe8[_0x3bab('0x41')][_0x3bab('0x5c')]=_0x2cf3b8['id'];if(_0x4f9c38[_0x3bab('0x38')][_0x3bab('0x44')]){_0x2f4fe8[_0x3bab('0x41')]=_[_0x3bab('0x45')](_0x2f4fe8[_0x3bab('0x41')],{'$or':_[_0x3bab('0x37')](_0x2f4fe8[_0x3bab('0x3a')],function(_0x4c8632){var _0x21bb41={};_0x21bb41[_0x4c8632]={'$like':'%'+_0x4f9c38[_0x3bab('0x38')][_0x3bab('0x44')]+'%'};return _0x21bb41;})});}_0x2f4fe8=_[_0x3bab('0x45')]({},_0x2f4fe8,_0x4f9c38[_0x3bab('0x47')]);return db['UserMailQueue'][_0x3bab('0x4a')](_0x2f4fe8);}})['then'](function(_0x3ba0da){if(_0x3ba0da){return db[_0x3bab('0x5d')]['findAndCountAll']({'where':{'id':_[_0x3bab('0x37')](_0x3ba0da,_0x3bab('0x5e')),'role':_0x3bab('0x5f')},'attributes':['id',_0x3bab('0x30'),_0x3bab('0x60'),_0x3bab('0x61'),_0x3bab('0x62')]});}})[_0x3bab('0x2a')](function(_0x335cd5){if(_0x335cd5){return{'count':_0x335cd5[_0x3bab('0x25')],'rows':_[_0x3bab('0x37')](_0x335cd5[_0x3bab('0x4b')],function(_0x592ef2){return{'membername':_0x592ef2['name'],'UserId':_0x592ef2['id'],'queue_name':_0x54e91b[_0x3bab('0x30')],'MailQueueId':_0x54e91b['id'],'interface':util[_0x3bab('0x63')](_0x3bab('0x64'),_0x3bab('0x65'),_0x592ef2[_0x3bab('0x30')]),'penalty':0x0,'paused':_0x592ef2['mailPause'],'createdAt':_0x592ef2[_0x3bab('0x62')],'updatedAt':_0x592ef2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3bab('0x2a')](respondWithFilteredResult(_0x4c0cbd,_0x2f4fe8))[_0x3bab('0x4c')](handleError(_0x4c0cbd,null));};exports[_0x3bab('0x66')]=function(_0x5a5db3,_0x3f7c30,_0x33e167){var _0x4b7671={};var _0x1e8ba6={};var _0x395691;var _0x8bcdb7;return db[_0x3bab('0x32')]['findOne']({'where':{'id':_0x5a5db3[_0x3bab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3f7c30,null))[_0x3bab('0x2a')](function(_0x45537a){if(_0x45537a){_0x395691=_0x45537a;_0x1e8ba6[_0x3bab('0x39')]=_[_0x3bab('0x4e')](db[_0x3bab('0x67')]['rawAttributes']);_0x1e8ba6[_0x3bab('0x38')]=_[_0x3bab('0x4e')](_0x5a5db3[_0x3bab('0x38')]);_0x1e8ba6[_0x3bab('0x42')]=_['intersection'](_0x1e8ba6[_0x3bab('0x39')],_0x1e8ba6[_0x3bab('0x38')]);_0x4b7671['attributes']=_[_0x3bab('0x4f')](_0x1e8ba6[_0x3bab('0x39')],qs[_0x3bab('0x3b')](_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x3b')]));_0x4b7671['attributes']=_0x4b7671[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0x4b7671[_0x3bab('0x3a')]:_0x1e8ba6[_0x3bab('0x39')];_0x4b7671['order']=qs[_0x3bab('0x40')](_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x40')]);_0x4b7671[_0x3bab('0x41')]=qs[_0x3bab('0x42')](_[_0x3bab('0x43')](_0x5a5db3[_0x3bab('0x38')],_0x1e8ba6[_0x3bab('0x42')]));if(_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x44')]){_0x4b7671[_0x3bab('0x41')]=_[_0x3bab('0x45')](_0x4b7671[_0x3bab('0x41')],{'$or':_[_0x3bab('0x37')](_0x4b7671[_0x3bab('0x3a')],function(_0x15826e){var _0x81fedf={};_0x81fedf[_0x15826e]={'$like':'%'+_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x44')]+'%'};return _0x81fedf;})});}_0x4b7671=_[_0x3bab('0x45')]({},_0x4b7671,_0x5a5db3[_0x3bab('0x47')]);return _0x395691[_0x3bab('0x66')](_0x4b7671);}})[_0x3bab('0x2a')](function(_0x4484f3){if(_0x4484f3){_0x8bcdb7=_0x4484f3['length'];if(!_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x3d')](_0x3bab('0x3e'))){_0x4b7671[_0x3bab('0x24')]=qs[_0x3bab('0x24')](_0x5a5db3['query'][_0x3bab('0x24')]);_0x4b7671['offset']=qs[_0x3bab('0x22')](_0x5a5db3[_0x3bab('0x38')]['offset']);}return _0x395691['getTeams'](_0x4b7671);}})[_0x3bab('0x2a')](function(_0x31e6b2){if(_0x31e6b2){return _0x31e6b2?{'count':_0x8bcdb7,'rows':_0x31e6b2}:null;}})[_0x3bab('0x2a')](respondWithResult(_0x3f7c30,null))[_0x3bab('0x4c')](handleError(_0x3f7c30,null));};exports['addTeams']=function(_0x24e9e4,_0x434b54,_0x26852e){var _0x2b0810=_0x24e9e4[_0x3bab('0x57')][_0x3bab('0x68')];return db['Team']['findAll']({'where':{'id':_0x2b0810},'attributes':['id'],'include':[{'model':db[_0x3bab('0x5d')],'as':_0x3bab('0x69'),'attributes':['id',_0x3bab('0x30'),_0x3bab('0x6a'),_0x3bab('0x6b'),_0x3bab('0x6c')],'raw':!![]}]})[_0x3bab('0x2a')](function(_0x4aa1df){if(_0x4aa1df){var _0x509f9b=_[_0x3bab('0x6d')](_0x4aa1df,function(_0x17d86c){var _0x332f64=_0x17d86c[_0x3bab('0x2c')]({'plain':!![]});return _0x332f64[_0x3bab('0x69')];});return db[_0x3bab('0x32')][_0x3bab('0x50')]({'where':{'id':_0x24e9e4[_0x3bab('0x4d')]['id']}})['then'](function(_0x36dca5){return db['sequelize'][_0x3bab('0x6e')](function(_0x1069bf){return _0x36dca5['addTeams'](_0x2b0810,{'transaction':_0x1069bf})[_0x3bab('0x2a')](function(){return BPromise[_0x3bab('0x6f')](_0x509f9b,function(_0x12e0be){return db[_0x3bab('0x5b')][_0x3bab('0x70')]({'where':{'UserId':_0x12e0be['id'],'MailQueueId':_0x24e9e4['params']['id']},'transaction':_0x1069bf});});})['then'](function(){_0x509f9b['forEach'](function(_0x1af596){socket[_0x3bab('0x71')](_0x3bab('0x72'),{'UserId':_0x1af596['id'],'MailQueueId':_0x36dca5['id']});});});});});}})[_0x3bab('0x2a')](respondWithStatusCode(_0x434b54,null))[_0x3bab('0x4c')](handleError(_0x434b54,null));};exports[_0x3bab('0x73')]=function(_0x211223,_0x23b997,_0x3ee272){return db[_0x3bab('0x67')][_0x3bab('0x4a')]({'where':{'id':_0x211223[_0x3bab('0x38')][_0x3bab('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3bab('0x69'),'attributes':['id'],'raw':!![]}]})[_0x3bab('0x2a')](handleEntityNotFound(_0x23b997,null))['then'](function(_0x42ccd3){var _0x419d8d=_[_0x3bab('0x37')](_0x42ccd3,'id');var _0x513031=[];var _0x9ec5d3=[];var _0x3f081e=squel[_0x3bab('0x74')]();_0x3f081e[_0x3bab('0x75')]('tq.TeamId')[_0x3bab('0x76')]('team_has_mail_queues','tq')[_0x3bab('0x77')](_0x3bab('0x78'),'ut',_0x3bab('0x79'))['where']('MailQueueId\x20=\x20?',_0x211223[_0x3bab('0x4d')]['id']);for(var _0x571a72=0x0;_0x571a72<_0x42ccd3[_0x3bab('0x3c')];_0x571a72+=0x1){let _0x35d72f=_0x42ccd3[_0x571a72];for(var _0x1dfe69=0x0;_0x1dfe69<_0x35d72f['Agents'][_0x3bab('0x3c')];_0x1dfe69+=0x1){let _0x2040bd=_0x35d72f['Agents'][_0x1dfe69];var _0x252fac=_0x3f081e[_0x3bab('0x7a')]();_0x252fac[_0x3bab('0x41')](_0x3bab('0x7b'),_0x2040bd['id']);_0x9ec5d3['push'](db[_0x3bab('0x7c')][_0x3bab('0x38')](_0x252fac[_0x3bab('0x7d')](),{'type':db[_0x3bab('0x7c')]['QueryTypes'][_0x3bab('0x7e')]})[_0x3bab('0x2a')](function(_0x35c193){if(_0x35c193['length']===0x1){return _0x2040bd['id'];}else{var _0x3a3014=_[_0x3bab('0x7f')](_['map'](_0x35c193,'TeamId'),function(_0x309230){return _['includes'](_0x419d8d,_0x309230);});if(_0x3a3014){return _0x2040bd['id'];}}}));}}return BPromise[_0x3bab('0x80')](_0x9ec5d3)['then'](function(_0xa7632f){_0x513031=_(_0x513031)[_0x3bab('0x81')](_0xa7632f)['compact']()[_0x3bab('0x82')]();return db[_0x3bab('0x32')]['find']({'where':{'id':_0x211223['params']['id']}})[_0x3bab('0x2a')](function(_0x5aaca5){return db[_0x3bab('0x7c')]['transaction'](function(_0x1994c4){return _0x5aaca5[_0x3bab('0x73')](_0x211223[_0x3bab('0x38')][_0x3bab('0x68')],{'transaction':_0x1994c4})[_0x3bab('0x2a')](function(){if(!_[_0x3bab('0x83')](_0x513031)){return _0x5aaca5['removeAgents'](_0x513031,{'transaction':_0x1994c4});}})[_0x3bab('0x2a')](function(){_0x513031[_0x3bab('0x84')](function(_0x1447f6){socket['emit'](_0x3bab('0x85'),{'UserId':_0x1447f6,'MailQueueId':_0x5aaca5['id']});});});});});});})[_0x3bab('0x2a')](respondWithStatusCode(_0x23b997,null))[_0x3bab('0x4c')](handleError(_0x23b997,null));};exports[_0x3bab('0x86')]=function(_0x56810c,_0x3cb6a6,_0x421558){return db[_0x3bab('0x32')]['find']({'where':{'id':_0x56810c[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x3cb6a6,null))['then'](function(_0x5633da){if(_0x5633da){return _0x5633da[_0x3bab('0x86')](_0x56810c[_0x3bab('0x57')][_0x3bab('0x68')],_[_0x3bab('0x87')](_0x56810c[_0x3bab('0x57')],[_0x3bab('0x68'),'id'])||{})['spread'](function(_0x149238){for(var _0x34d7fe=0x0;_0x34d7fe<_0x56810c[_0x3bab('0x57')][_0x3bab('0x68')][_0x3bab('0x3c')];_0x34d7fe+=0x1){socket[_0x3bab('0x71')](_0x3bab('0x72'),{'UserId':Number(_0x56810c[_0x3bab('0x57')][_0x3bab('0x68')][_0x34d7fe]),'MailQueueId':Number(_0x56810c[_0x3bab('0x4d')]['id'])});}return _0x149238;});}})[_0x3bab('0x2a')](respondWithResult(_0x3cb6a6,null))[_0x3bab('0x4c')](handleError(_0x3cb6a6,null));};exports[_0x3bab('0x88')]=function(_0x29dfef,_0x1f7850,_0x1d8c48){return db[_0x3bab('0x32')][_0x3bab('0x50')]({'where':{'id':_0x29dfef[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x1f7850,null))[_0x3bab('0x2a')](function(_0x4aea4f){if(_0x4aea4f){return _0x4aea4f['removeAgents'](_0x29dfef[_0x3bab('0x38')][_0x3bab('0x68')])['then'](function(){if(_['isArray'](_0x29dfef['query'][_0x3bab('0x68')])){for(var _0x23742c=0x0;_0x23742c<_0x29dfef[_0x3bab('0x38')][_0x3bab('0x68')][_0x3bab('0x3c')];_0x23742c+=0x1){socket[_0x3bab('0x71')](_0x3bab('0x85'),{'UserId':Number(_0x29dfef[_0x3bab('0x38')][_0x3bab('0x68')][_0x23742c]),'MailQueueId':Number(_0x29dfef[_0x3bab('0x4d')]['id'])});}}else{socket[_0x3bab('0x71')](_0x3bab('0x85'),{'UserId':Number(_0x29dfef[_0x3bab('0x38')][_0x3bab('0x68')]),'MailQueueId':Number(_0x29dfef[_0x3bab('0x4d')]['id'])});}});}})[_0x3bab('0x2a')](respondWithStatusCode(_0x1f7850,null))[_0x3bab('0x4c')](handleError(_0x1f7850,null));};exports[_0x3bab('0x89')]=function(_0x279244,_0x16663b,_0x46196b){var _0x22f7b1={};var _0x3d0bbf={};var _0x1d3d12;var _0x2a0d93;return db[_0x3bab('0x32')]['findOne']({'where':{'id':_0x279244[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x16663b,null))[_0x3bab('0x2a')](function(_0x176e42){if(_0x176e42){_0x1d3d12=_0x176e42;_0x3d0bbf['model']=_[_0x3bab('0x4e')](db[_0x3bab('0x5d')][_0x3bab('0x33')]);_0x3d0bbf[_0x3bab('0x38')]=_[_0x3bab('0x4e')](_0x279244['query']);_0x3d0bbf['filters']=_['intersection'](_0x3d0bbf['model'],_0x3d0bbf[_0x3bab('0x38')]);_0x22f7b1['attributes']=_[_0x3bab('0x4f')](_0x3d0bbf[_0x3bab('0x39')],qs[_0x3bab('0x3b')](_0x279244['query'][_0x3bab('0x3b')]));_0x22f7b1[_0x3bab('0x3a')]=_0x22f7b1[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0x22f7b1[_0x3bab('0x3a')]:_0x3d0bbf[_0x3bab('0x39')];_0x22f7b1[_0x3bab('0x3f')]=qs['sort'](_0x279244[_0x3bab('0x38')][_0x3bab('0x40')]);_0x22f7b1[_0x3bab('0x41')]=qs['filters'](_[_0x3bab('0x43')](_0x279244[_0x3bab('0x38')],_0x3d0bbf['filters']));if(_0x279244[_0x3bab('0x38')]['filter']){_0x22f7b1[_0x3bab('0x41')]=_[_0x3bab('0x45')](_0x22f7b1['where'],{'$or':_[_0x3bab('0x37')](_0x22f7b1['attributes'],function(_0xcfa051){var _0x543678={};_0x543678[_0xcfa051]={'$like':'%'+_0x279244[_0x3bab('0x38')][_0x3bab('0x44')]+'%'};return _0x543678;})});}_0x22f7b1=_['merge']({},_0x22f7b1,_0x279244[_0x3bab('0x47')]);return _0x1d3d12['getAgents'](_0x22f7b1);}})[_0x3bab('0x2a')](function(_0x4f27d3){if(_0x4f27d3){_0x2a0d93=_0x4f27d3[_0x3bab('0x3c')];if(!_0x279244['query'][_0x3bab('0x3d')](_0x3bab('0x3e'))){_0x22f7b1['limit']=qs['limit'](_0x279244[_0x3bab('0x38')][_0x3bab('0x24')]);_0x22f7b1['offset']=qs[_0x3bab('0x22')](_0x279244[_0x3bab('0x38')][_0x3bab('0x22')]);}return _0x1d3d12[_0x3bab('0x89')](_0x22f7b1);}})['then'](function(_0x400266){if(_0x400266){return _0x400266?{'count':_0x2a0d93,'rows':_0x400266}:null;}})[_0x3bab('0x2a')](respondWithResult(_0x16663b,null))['catch'](handleError(_0x16663b,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 93b43b1..ed93792 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 _0x2bbd=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x2bbd,0x102));var _0xd2bb=function(_0x57f69b,_0x5cd5d1){_0x57f69b=_0x57f69b-0x0;var _0x556a40=_0x2bbd[_0x57f69b];return _0x556a40;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xd2bb('0x0'))['db'][_0xd2bb('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd2bb('0x2')](0x0);var events={'afterCreate':_0xd2bb('0x3'),'afterUpdate':_0xd2bb('0x4'),'afterDestroy':_0xd2bb('0x5')};function emitEvent(_0x59d540){return function(_0x5e33cf,_0x415cd5,_0x3a1cc9){MailQueueEvents[_0xd2bb('0x6')](_0x59d540+':'+_0x5e33cf['id'],_0x5e33cf);MailQueueEvents[_0xd2bb('0x6')](_0x59d540,_0x5e33cf);_0x3a1cc9(null);};}for(var e in events){if(events[_0xd2bb('0x7')](e)){var event=events[e];MailQueue[_0xd2bb('0x8')](e,emitEvent(event));}}module[_0xd2bb('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x724e=['../../mysqldb','MailQueue','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x43b5ef,_0x9b59c3){var _0x40c238=function(_0x30f021){while(--_0x30f021){_0x43b5ef['push'](_0x43b5ef['shift']());}};_0x40c238(++_0x9b59c3);}(_0x724e,0x128));var _0xe724=function(_0xee6393,_0x2a7d1a){_0xee6393=_0xee6393-0x0;var _0x3ade12=_0x724e[_0xee6393];return _0x3ade12;};'use strict';var EventEmitter=require(_0xe724('0x0'));var MailQueue=require(_0xe724('0x1'))['db'][_0xe724('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe724('0x3'),'afterDestroy':_0xe724('0x4')};function emitEvent(_0x3024b6){return function(_0x1ee3f,_0xc83335,_0x4666cd){MailQueueEvents['emit'](_0x3024b6+':'+_0x1ee3f['id'],_0x1ee3f);MailQueueEvents[_0xe724('0x5')](_0x3024b6,_0x1ee3f);_0x4666cd(null);};}for(var e in events){if(events[_0xe724('0x6')](e)){var event=events[e];MailQueue[_0xe724('0x7')](e,emitEvent(event));}}module[_0xe724('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 29ba32e..c0625ce 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 _0x9317=['./mailQueue.attributes','exports','define','lodash','util','api','path','rimraf','../../config/environment'];(function(_0x7e8f21,_0x3c06d4){var _0x4cbca3=function(_0x364603){while(--_0x364603){_0x7e8f21['push'](_0x7e8f21['shift']());}};_0x4cbca3(++_0x3c06d4);}(_0x9317,0x16b));var _0x7931=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x9317[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0x7931('0x0'));var util=require(_0x7931('0x1'));var logger=require('../../config/logger')(_0x7931('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7931('0x3'));var rimraf=require(_0x7931('0x4'));var config=require(_0x7931('0x5'));var attributes=require(_0x7931('0x6'));module[_0x7931('0x7')]=function(_0x5640bb,_0x3fb721){return _0x5640bb[_0x7931('0x8')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe81c=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','util','api'];(function(_0x39f2d3,_0x7971a0){var _0x488364=function(_0x59182f){while(--_0x59182f){_0x39f2d3['push'](_0x39f2d3['shift']());}};_0x488364(++_0x7971a0);}(_0xe81c,0x174));var _0xce81=function(_0x13b3b5,_0x52d8d8){_0x13b3b5=_0x13b3b5-0x0;var _0x337cd0=_0xe81c[_0x13b3b5];return _0x337cd0;};'use strict';var _=require('lodash');var util=require(_0xce81('0x0'));var logger=require('../../config/logger')(_0xce81('0x1'));var moment=require(_0xce81('0x2'));var BPromise=require(_0xce81('0x3'));var rp=require(_0xce81('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce81('0x5'));var config=require(_0xce81('0x6'));var attributes=require(_0xce81('0x7'));module[_0xce81('0x8')]=function(_0x3f9206,_0x18d155){return _0x3f9206['define'](_0xce81('0x9'),attributes,{'tableName':_0xce81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 08a6461..2e334b6 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 _0x68ef=['model','map','ShowMailQueue','MailQueue','find','attributes','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailQueue.socket','register','request','then','info','debug','request\x20sent','stringify','error','message','MailQueue,\x20%s,\x20%s','result','catch','GetMailQueue','findAll','options','raw','where','limit','include'];(function(_0x5446a9,_0x7c3e62){var _0x3c72ba=function(_0xcfc34){while(--_0xcfc34){_0x5446a9['push'](_0x5446a9['shift']());}};_0x3c72ba(++_0x7c3e62);}(_0x68ef,0x9e));var _0xf68e=function(_0x327e64,_0x3bea90){_0x327e64=_0x327e64-0x0;var _0x5affcc=_0x68ef[_0x327e64];return _0x5affcc;};'use strict';var _=require(_0xf68e('0x0'));var util=require(_0xf68e('0x1'));var moment=require('moment');var BPromise=require(_0xf68e('0x2'));var rs=require(_0xf68e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf68e('0x4'));var logger=require(_0xf68e('0x5'))(_0xf68e('0x6'));var config=require(_0xf68e('0x7'));var jayson=require(_0xf68e('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xf68e('0x9')]=_[_0xf68e('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf68e('0xb'))(new Redis(config['redis']));require(_0xf68e('0xc'))[_0xf68e('0xd')](socket);function respondWithRpcPromise(_0xa6f42,_0x4ce98f,_0x2f6677){return new BPromise(function(_0x57e048,_0x280214){return client[_0xf68e('0xe')](_0xa6f42,_0x2f6677)[_0xf68e('0xf')](function(_0x385efe){logger[_0xf68e('0x10')]('MailQueue,\x20%s,\x20%s',_0x4ce98f,'request\x20sent');logger[_0xf68e('0x11')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x4ce98f,_0xf68e('0x12'),JSON[_0xf68e('0x13')](_0x385efe));if(_0x385efe[_0xf68e('0x14')]){if(_0x385efe['error']['code']===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x4ce98f,_0x385efe[_0xf68e('0x14')][_0xf68e('0x15')]);return _0x280214(_0x385efe[_0xf68e('0x14')]['message']);}logger['error'](_0xf68e('0x16'),_0x4ce98f,_0x385efe['error'][_0xf68e('0x15')]);return _0x57e048(_0x385efe[_0xf68e('0x14')][_0xf68e('0x15')]);}else{logger[_0xf68e('0x10')](_0xf68e('0x16'),_0x4ce98f,_0xf68e('0x12'));_0x57e048(_0x385efe[_0xf68e('0x17')][_0xf68e('0x15')]);}})[_0xf68e('0x18')](function(_0x445e18){logger[_0xf68e('0x14')](_0xf68e('0x16'),_0x4ce98f,_0x445e18);_0x280214(_0x445e18);});});}exports[_0xf68e('0x19')]=function(_0x387a11){var _0xe18352=this;return new Promise(function(_0x2ab6c6,_0x2df1bf){return db['MailQueue'][_0xf68e('0x1a')]({'raw':_0x387a11[_0xf68e('0x1b')]?_0x387a11['options'][_0xf68e('0x1c')]===undefined?!![]:![]:!![],'where':_0x387a11[_0xf68e('0x1b')]?_0x387a11[_0xf68e('0x1b')][_0xf68e('0x1d')]||null:null,'attributes':_0x387a11['options']?_0x387a11['options']['attributes']||null:null,'limit':_0x387a11[_0xf68e('0x1b')]?_0x387a11['options'][_0xf68e('0x1e')]||null:null,'include':_0x387a11[_0xf68e('0x1b')]?_0x387a11[_0xf68e('0x1b')][_0xf68e('0x1f')]?_['map'](_0x387a11[_0xf68e('0x1b')][_0xf68e('0x1f')],function(_0x570c32){return{'model':db[_0x570c32[_0xf68e('0x20')]],'as':_0x570c32['as'],'attributes':_0x570c32['attributes'],'include':_0x570c32[_0xf68e('0x1f')]?_['map'](_0x570c32['include'],function(_0x1a33ca){return{'model':db[_0x1a33ca[_0xf68e('0x20')]],'as':_0x1a33ca['as'],'attributes':_0x1a33ca['attributes'],'include':_0x1a33ca[_0xf68e('0x1f')]?_[_0xf68e('0x21')](_0x1a33ca[_0xf68e('0x1f')],function(_0xb8aa){return{'model':db[_0xb8aa[_0xf68e('0x20')]],'as':_0xb8aa['as'],'attributes':_0xb8aa['attributes']};}):[]};}):[]};}):[]:[]})[_0xf68e('0xf')](function(_0x424cc6){logger[_0xf68e('0x10')]('GetMailQueue',_0x387a11);logger[_0xf68e('0x11')](_0xf68e('0x19'),_0x387a11,JSON[_0xf68e('0x13')](_0x424cc6));_0x2ab6c6(_0x424cc6);})[_0xf68e('0x18')](function(_0x348e90){logger['error']('GetMailQueue',_0x348e90[_0xf68e('0x15')],_0x387a11);_0x2df1bf(_0xe18352['error'](0x1f4,_0x348e90[_0xf68e('0x15')]));});});};exports[_0xf68e('0x22')]=function(_0x2a52bf){var _0x58e013=this;return new Promise(function(_0x28a129,_0x3340ce){return db[_0xf68e('0x23')][_0xf68e('0x24')]({'raw':_0x2a52bf['options']?_0x2a52bf[_0xf68e('0x1b')][_0xf68e('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a52bf['options']?_0x2a52bf['options']['where']||null:null,'attributes':_0x2a52bf[_0xf68e('0x1b')]?_0x2a52bf[_0xf68e('0x1b')][_0xf68e('0x25')]||null:null,'include':_0x2a52bf['options']?_0x2a52bf['options'][_0xf68e('0x1f')]?_['map'](_0x2a52bf[_0xf68e('0x1b')]['include'],function(_0x544f7a){return{'model':db[_0x544f7a[_0xf68e('0x20')]],'as':_0x544f7a['as'],'attributes':_0x544f7a[_0xf68e('0x25')],'include':_0x544f7a[_0xf68e('0x1f')]?_['map'](_0x544f7a[_0xf68e('0x1f')],function(_0x51a308){return{'model':db[_0x51a308['model']],'as':_0x51a308['as'],'attributes':_0x51a308['attributes'],'include':_0x51a308[_0xf68e('0x1f')]?_[_0xf68e('0x21')](_0x51a308['include'],function(_0x3fc9e9){return{'model':db[_0x3fc9e9[_0xf68e('0x20')]],'as':_0x3fc9e9['as'],'attributes':_0x3fc9e9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3797bd){logger['info']('ShowMailQueue',_0x2a52bf);logger[_0xf68e('0x11')](_0xf68e('0x22'),_0x2a52bf,JSON[_0xf68e('0x13')](_0x3797bd));_0x28a129(_0x3797bd);})['catch'](function(_0x49c781){logger[_0xf68e('0x14')](_0xf68e('0x22'),_0x49c781['message'],_0x2a52bf);_0x3340ce(_0x58e013[_0xf68e('0x14')](0x1f4,_0x49c781[_0xf68e('0x15')]));});});}; \ No newline at end of file +var _0x3706=['options','where','attributes','limit','include','map','model','MailQueue','raw','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','findAll'];(function(_0x11b9fa,_0x50b79b){var _0x13410c=function(_0x598256){while(--_0x598256){_0x11b9fa['push'](_0x11b9fa['shift']());}};_0x13410c(++_0x50b79b);}(_0x3706,0x169));var _0x6370=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x3706[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0x6370('0x0'));var util=require(_0x6370('0x1'));var moment=require(_0x6370('0x2'));var BPromise=require(_0x6370('0x3'));var rs=require(_0x6370('0x4'));var fs=require('fs');var Redis=require(_0x6370('0x5'));var db=require(_0x6370('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6370('0x7'))(_0x6370('0x8'));var config=require('../../config/environment');var jayson=require(_0x6370('0x9'));var client=jayson[_0x6370('0xa')][_0x6370('0xb')]({'port':0x232a});config[_0x6370('0xc')]=_['defaults'](config[_0x6370('0xc')],{'host':_0x6370('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6370('0xe'))[_0x6370('0xf')](socket);function respondWithRpcPromise(_0x9ebe7f,_0x39dd7b,_0x40ac61){return new BPromise(function(_0x2eb827,_0x3af8a7){return client['request'](_0x9ebe7f,_0x40ac61)[_0x6370('0x10')](function(_0x3447e3){logger[_0x6370('0x11')](_0x6370('0x12'),_0x39dd7b,'request\x20sent');logger[_0x6370('0x13')](_0x6370('0x14'),_0x39dd7b,_0x6370('0x15'),JSON[_0x6370('0x16')](_0x3447e3));if(_0x3447e3[_0x6370('0x17')]){if(_0x3447e3[_0x6370('0x17')]['code']===0x1f4){logger[_0x6370('0x17')](_0x6370('0x12'),_0x39dd7b,_0x3447e3['error'][_0x6370('0x18')]);return _0x3af8a7(_0x3447e3[_0x6370('0x17')][_0x6370('0x18')]);}logger['error'](_0x6370('0x12'),_0x39dd7b,_0x3447e3[_0x6370('0x17')]['message']);return _0x2eb827(_0x3447e3[_0x6370('0x17')][_0x6370('0x18')]);}else{logger[_0x6370('0x11')](_0x6370('0x12'),_0x39dd7b,_0x6370('0x15'));_0x2eb827(_0x3447e3[_0x6370('0x19')][_0x6370('0x18')]);}})[_0x6370('0x1a')](function(_0x238bbe){logger[_0x6370('0x17')]('MailQueue,\x20%s,\x20%s',_0x39dd7b,_0x238bbe);_0x3af8a7(_0x238bbe);});});}exports[_0x6370('0x1b')]=function(_0x58b823){var _0x1bfb5f=this;return new Promise(function(_0x177e5f,_0x511c3c){return db['MailQueue'][_0x6370('0x1c')]({'raw':_0x58b823[_0x6370('0x1d')]?_0x58b823[_0x6370('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x58b823[_0x6370('0x1d')]?_0x58b823[_0x6370('0x1d')][_0x6370('0x1e')]||null:null,'attributes':_0x58b823['options']?_0x58b823[_0x6370('0x1d')][_0x6370('0x1f')]||null:null,'limit':_0x58b823[_0x6370('0x1d')]?_0x58b823[_0x6370('0x1d')][_0x6370('0x20')]||null:null,'include':_0x58b823[_0x6370('0x1d')]?_0x58b823[_0x6370('0x1d')][_0x6370('0x21')]?_[_0x6370('0x22')](_0x58b823[_0x6370('0x1d')]['include'],function(_0x25c572){return{'model':db[_0x25c572[_0x6370('0x23')]],'as':_0x25c572['as'],'attributes':_0x25c572[_0x6370('0x1f')],'include':_0x25c572[_0x6370('0x21')]?_[_0x6370('0x22')](_0x25c572[_0x6370('0x21')],function(_0x10590e){return{'model':db[_0x10590e[_0x6370('0x23')]],'as':_0x10590e['as'],'attributes':_0x10590e['attributes'],'include':_0x10590e[_0x6370('0x21')]?_[_0x6370('0x22')](_0x10590e['include'],function(_0x4f94ab){return{'model':db[_0x4f94ab['model']],'as':_0x4f94ab['as'],'attributes':_0x4f94ab['attributes']};}):[]};}):[]};}):[]:[]})[_0x6370('0x10')](function(_0x32d880){logger[_0x6370('0x11')](_0x6370('0x1b'),_0x58b823);logger['debug'](_0x6370('0x1b'),_0x58b823,JSON['stringify'](_0x32d880));_0x177e5f(_0x32d880);})[_0x6370('0x1a')](function(_0x1c97cd){logger['error']('GetMailQueue',_0x1c97cd['message'],_0x58b823);_0x511c3c(_0x1bfb5f[_0x6370('0x17')](0x1f4,_0x1c97cd['message']));});});};exports['ShowMailQueue']=function(_0x529369){var _0xb0e56e=this;return new Promise(function(_0x1727e6,_0x64757c){return db[_0x6370('0x24')]['find']({'raw':_0x529369[_0x6370('0x1d')]?_0x529369[_0x6370('0x1d')][_0x6370('0x25')]===undefined?!![]:![]:!![],'where':_0x529369[_0x6370('0x1d')]?_0x529369[_0x6370('0x1d')][_0x6370('0x1e')]||null:null,'attributes':_0x529369[_0x6370('0x1d')]?_0x529369['options'][_0x6370('0x1f')]||null:null,'include':_0x529369[_0x6370('0x1d')]?_0x529369[_0x6370('0x1d')][_0x6370('0x21')]?_[_0x6370('0x22')](_0x529369['options'][_0x6370('0x21')],function(_0x63bb58){return{'model':db[_0x63bb58[_0x6370('0x23')]],'as':_0x63bb58['as'],'attributes':_0x63bb58[_0x6370('0x1f')],'include':_0x63bb58[_0x6370('0x21')]?_[_0x6370('0x22')](_0x63bb58[_0x6370('0x21')],function(_0x14da81){return{'model':db[_0x14da81[_0x6370('0x23')]],'as':_0x14da81['as'],'attributes':_0x14da81[_0x6370('0x1f')],'include':_0x14da81[_0x6370('0x21')]?_[_0x6370('0x22')](_0x14da81[_0x6370('0x21')],function(_0x2e8ac3){return{'model':db[_0x2e8ac3[_0x6370('0x23')]],'as':_0x2e8ac3['as'],'attributes':_0x2e8ac3[_0x6370('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d0661){logger['info'](_0x6370('0x26'),_0x529369);logger[_0x6370('0x13')](_0x6370('0x26'),_0x529369,JSON[_0x6370('0x16')](_0x3d0661));_0x1727e6(_0x3d0661);})['catch'](function(_0x3969ba){logger[_0x6370('0x17')](_0x6370('0x26'),_0x3969ba[_0x6370('0x18')],_0x529369);_0x64757c(_0xb0e56e[_0x6370('0x17')](0x1f4,_0x3969ba['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 8753d92..7e8603f 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 _0x6afd=['length','mailQueue:','save','remove','update','emit','removeListener','register'];(function(_0x37038a,_0x12ca07){var _0x34a005=function(_0x426f67){while(--_0x426f67){_0x37038a['push'](_0x37038a['shift']());}};_0x34a005(++_0x12ca07);}(_0x6afd,0x9a));var _0xd6af=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x6afd[_0x1cfa0d];return _0xe33279;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xd6af('0x0'),_0xd6af('0x1'),_0xd6af('0x2')];function createListener(_0x4a35a4,_0x435c0f){return function(_0x39de8a){_0x435c0f[_0xd6af('0x3')](_0x4a35a4,_0x39de8a);};}function removeListener(_0x5e4286,_0x2ec2f5){return function(){MailQueueEvents[_0xd6af('0x4')](_0x5e4286,_0x2ec2f5);};}exports[_0xd6af('0x5')]=function(_0x565aaf){for(var _0x647903=0x0,_0x36fa8f=events[_0xd6af('0x6')];_0x647903<_0x36fa8f;_0x647903++){var _0x3610cc=events[_0x647903];var _0x1c28fb=createListener(_0xd6af('0x7')+_0x3610cc,_0x565aaf);MailQueueEvents['on'](_0x3610cc,_0x1c28fb);}}; \ No newline at end of file +var _0x2781=['./mailQueue.events','save','remove','update','emit','register'];(function(_0x32be30,_0x2ab00f){var _0x33b63b=function(_0x40d291){while(--_0x40d291){_0x32be30['push'](_0x32be30['shift']());}};_0x33b63b(++_0x2ab00f);}(_0x2781,0xe4));var _0x1278=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2781[_0x160c73];return _0xd9302;};'use strict';var MailQueueEvents=require(_0x1278('0x0'));var events=[_0x1278('0x1'),_0x1278('0x2'),_0x1278('0x3')];function createListener(_0x230714,_0x3d207d){return function(_0x104be9){_0x3d207d[_0x1278('0x4')](_0x230714,_0x104be9);};}function removeListener(_0x1ef54c,_0x102fd4){return function(){MailQueueEvents['removeListener'](_0x1ef54c,_0x102fd4);};}exports[_0x1278('0x5')]=function(_0x216adf){for(var _0x5646b6=0x0,_0x387240=events['length'];_0x5646b6<_0x387240;_0x5646b6++){var _0x2b3476=events[_0x5646b6];var _0x31afae=createListener('mailQueue:'+_0x2b3476,_0x216adf);MailQueueEvents['on'](_0x2b3476,_0x31afae);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 583fc13..ccdbb74 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 _0xe66e=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xe66e,0x76));var _0xee66=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xe66e[_0x307d86];return _0x361745;};'use strict';var multer=require(_0xee66('0x0'));var util=require(_0xee66('0x1'));var path=require(_0xee66('0x2'));var timeout=require('connect-timeout');var express=require(_0xee66('0x3'));var router=express[_0xee66('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xee66('0x5'));var interaction=require(_0xee66('0x6'));var config=require(_0xee66('0x7'));var controller=require('./mailQueueReport.controller');router[_0xee66('0x8')]('/',auth[_0xee66('0x9')](),controller[_0xee66('0xa')]);router[_0xee66('0x8')](_0xee66('0xb'),auth[_0xee66('0x9')](),controller[_0xee66('0xc')]);router[_0xee66('0x8')](_0xee66('0xd'),auth[_0xee66('0x9')](),controller[_0xee66('0xe')]);router['post']('/',auth[_0xee66('0x9')](),controller[_0xee66('0xf')]);router[_0xee66('0x10')](_0xee66('0xd'),auth[_0xee66('0x9')](),controller['update']);router[_0xee66('0x11')](_0xee66('0xd'),auth[_0xee66('0x9')](),controller[_0xee66('0x12')]);module[_0xee66('0x13')]=router; \ No newline at end of file +var _0xe423=['../../config/environment','./mailQueueReport.controller','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x415e5d,_0x44cc86){var _0x1973f3=function(_0x285bcc){while(--_0x285bcc){_0x415e5d['push'](_0x415e5d['shift']());}};_0x1973f3(++_0x44cc86);}(_0xe423,0x199));var _0x3e42=function(_0x5a5f79,_0x48716b){_0x5a5f79=_0x5a5f79-0x0;var _0x2ba09c=_0xe423[_0x5a5f79];return _0x2ba09c;};'use strict';var multer=require(_0x3e42('0x0'));var util=require(_0x3e42('0x1'));var path=require(_0x3e42('0x2'));var timeout=require(_0x3e42('0x3'));var express=require(_0x3e42('0x4'));var router=express[_0x3e42('0x5')]();var fs_extra=require(_0x3e42('0x6'));var auth=require(_0x3e42('0x7'));var interaction=require(_0x3e42('0x8'));var config=require(_0x3e42('0x9'));var controller=require(_0x3e42('0xa'));router['get']('/',auth[_0x3e42('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3e42('0xc')]);router['get'](_0x3e42('0xd'),auth[_0x3e42('0xb')](),controller[_0x3e42('0xe')]);router[_0x3e42('0xf')]('/',auth[_0x3e42('0xb')](),controller[_0x3e42('0x10')]);router[_0x3e42('0x11')](_0x3e42('0xd'),auth['isAuthenticated'](),controller[_0x3e42('0x12')]);router[_0x3e42('0x13')]('/:id',auth[_0x3e42('0xb')](),controller[_0x3e42('0x14')]);module[_0x3e42('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 71931d9..b606f1c 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 _0x9579=['STRING','DATE','moment','exports'];(function(_0xf34ef6,_0x5d852e){var _0x3f4014=function(_0x51dc6e){while(--_0x51dc6e){_0xf34ef6['push'](_0xf34ef6['shift']());}};_0x3f4014(++_0x5d852e);}(_0x9579,0x16e));var _0x9957=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x9579[_0x35ef6b];return _0x3ad145;};'use strict';var moment=require(_0x9957('0x0'));var Sequelize=require('sequelize');module[_0x9957('0x1')]={'uniqueid':{'type':Sequelize[_0x9957('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9957('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9957('0x3')]},'exitAt':{'type':Sequelize[_0x9957('0x3')]},'reason':{'type':Sequelize[_0x9957('0x2')]}}; \ No newline at end of file +var _0x6cfa=['STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cfa,0xa1));var _0xa6cf=function(_0x1d5e0e,_0x40f9eb){_0x1d5e0e=_0x1d5e0e-0x0;var _0x1acedc=_0x6cfa[_0x1d5e0e];return _0x1acedc;};'use strict';var moment=require(_0xa6cf('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa6cf('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa6cf('0x2')]},'leaveAt':{'type':Sequelize[_0xa6cf('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index ce8cacc..b13fb97 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 _0x2542=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','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/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x4a085d,_0x1ba54d){var _0x17c5a5=function(_0x43a511){while(--_0x43a511){_0x4a085d['push'](_0x4a085d['shift']());}};_0x17c5a5(++_0x1ba54d);}(_0x2542,0x169));var _0x2254=function(_0x4c577b,_0x6f3228){_0x4c577b=_0x4c577b-0x0;var _0x29d6b4=_0x2542[_0x4c577b];return _0x29d6b4;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':!![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['MailQueueReport'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));};exports[_0x2254('0x4d')]=function(_0x4ba6ef,_0x4cc18a){return db[_0x2254('0x2c')][_0x2254('0x4d')]()['then'](respondWithResult(_0x4cc18a,null))[_0x2254('0x45')](handleError(_0x4cc18a,null));}; \ No newline at end of file +var _0xd824=['../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0xd824,0xc2));var _0x4d82=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd824[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x4d82('0x0'));var rimraf=require(_0x4d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d82('0x2'));var moment=require(_0x4d82('0x3'));var BPromise=require(_0x4d82('0x4'));var Mustache=require(_0x4d82('0x5'));var util=require(_0x4d82('0x6'));var path=require(_0x4d82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d82('0x9'));var crypto=require(_0x4d82('0xa'));var jsforce=require(_0x4d82('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4d82('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d82('0xd'));var authService=require(_0x4d82('0xe'));var qs=require(_0x4d82('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d82('0x10'));var logger=require('../../config/logger')(_0x4d82('0x11'));var utils=require(_0x4d82('0x12'));var config=require(_0x4d82('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x346394,_0x248eed){_0x248eed=_0x248eed||0xcc;return function(_0x319ba8){if(_0x319ba8){return _0x346394[_0x4d82('0x14')](_0x248eed);}return _0x346394['status'](_0x248eed)[_0x4d82('0x15')]();};}function respondWithResult(_0x2094bc,_0x41f5b2){_0x41f5b2=_0x41f5b2||0xc8;return function(_0x486152){if(_0x486152){return _0x2094bc[_0x4d82('0x16')](_0x41f5b2)['json'](_0x486152);}};}function respondWithFilteredResult(_0x3382c4,_0x5012db){return function(_0x469e09){if(_0x469e09){var _0x496f3b=typeof _0x5012db[_0x4d82('0x17')]===_0x4d82('0x18')&&typeof _0x5012db[_0x4d82('0x19')]===_0x4d82('0x18');var _0x2648a8=_0x469e09[_0x4d82('0x1a')];var _0x258c59=_0x496f3b?0x0:_0x5012db[_0x4d82('0x17')];var _0x2f2127=_0x496f3b?_0x469e09['count']:_0x5012db[_0x4d82('0x17')]+_0x5012db[_0x4d82('0x19')];var _0x1b1e39;if(_0x2f2127>=_0x2648a8){_0x2f2127=_0x2648a8;_0x1b1e39=0xc8;}else{_0x1b1e39=0xce;}_0x3382c4[_0x4d82('0x16')](_0x1b1e39);return _0x3382c4[_0x4d82('0x1b')](_0x4d82('0x1c'),_0x258c59+'-'+_0x2f2127+'/'+_0x2648a8)[_0x4d82('0x1d')](_0x469e09);}return null;};}function patchUpdates(_0x64669c){return function(_0x19832f){try{jsonpatch[_0x4d82('0x1e')](_0x19832f,_0x64669c,!![]);}catch(_0xf2f5a5){return BPromise['reject'](_0xf2f5a5);}return _0x19832f[_0x4d82('0x1f')]();};}function saveUpdates(_0x748ee7,_0x5e5bdf){return function(_0x1a419f){if(_0x1a419f){return _0x1a419f[_0x4d82('0x20')](_0x748ee7)[_0x4d82('0x21')](function(_0x14a2d4){return _0x14a2d4;});}return null;};}function removeEntity(_0xe17d70,_0x15f5d1){return function(_0x11c043){if(_0x11c043){return _0x11c043[_0x4d82('0x22')]()[_0x4d82('0x21')](function(){_0xe17d70[_0x4d82('0x16')](0xcc)[_0x4d82('0x15')]();});}};}function handleEntityNotFound(_0x395efc,_0x7404ba){return function(_0x284c66){if(!_0x284c66){_0x395efc[_0x4d82('0x14')](0x194);}return _0x284c66;};}function handleError(_0x4af6da,_0x5e0b03){_0x5e0b03=_0x5e0b03||0x1f4;return function(_0x3dcb0f){logger[_0x4d82('0x23')](_0x3dcb0f[_0x4d82('0x24')]);if(_0x3dcb0f[_0x4d82('0x25')]){delete _0x3dcb0f['name'];}_0x4af6da[_0x4d82('0x16')](_0x5e0b03)[_0x4d82('0x26')](_0x3dcb0f);};}exports[_0x4d82('0x27')]=function(_0x11d022,_0x5ce98b){var _0x4081f6={},_0x4a7444={},_0x4d9ac4={'count':0x0,'rows':[]};var _0x487581=_['map'](db[_0x4d82('0x28')][_0x4d82('0x29')],function(_0x88318c){return{'name':_0x88318c['fieldName'],'type':_0x88318c[_0x4d82('0x2a')][_0x4d82('0x2b')]};});_0x4a7444['model']=_['map'](_0x487581,_0x4d82('0x25'));_0x4a7444[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x11d022[_0x4d82('0x2c')]);_0x4a7444['filters']=_[_0x4d82('0x2e')](_0x4a7444['model'],_0x4a7444[_0x4d82('0x2c')]);_0x4081f6[_0x4d82('0x2f')]=_['intersection'](_0x4a7444['model'],qs[_0x4d82('0x30')](_0x11d022[_0x4d82('0x2c')][_0x4d82('0x30')]));_0x4081f6[_0x4d82('0x2f')]=_0x4081f6[_0x4d82('0x2f')][_0x4d82('0x31')]?_0x4081f6[_0x4d82('0x2f')]:_0x4a7444[_0x4d82('0x32')];if(!_0x11d022[_0x4d82('0x2c')][_0x4d82('0x33')]('nolimit')){_0x4081f6[_0x4d82('0x19')]=qs[_0x4d82('0x19')](_0x11d022[_0x4d82('0x2c')]['limit']);_0x4081f6[_0x4d82('0x17')]=qs[_0x4d82('0x17')](_0x11d022['query'][_0x4d82('0x17')]);}_0x4081f6[_0x4d82('0x34')]=qs[_0x4d82('0x35')](_0x11d022['query'][_0x4d82('0x35')]);_0x4081f6[_0x4d82('0x36')]=qs['filters'](_[_0x4d82('0x37')](_0x11d022['query'],_0x4a7444[_0x4d82('0x38')]),_0x487581);if(_0x11d022[_0x4d82('0x2c')]['filter']){_0x4081f6[_0x4d82('0x36')]=_['merge'](_0x4081f6[_0x4d82('0x36')],{'$or':_['map'](_0x487581,function(_0x51c705){if(_0x51c705[_0x4d82('0x2a')]!=='VIRTUAL'){var _0x2528d7={};_0x2528d7[_0x51c705['name']]={'$like':'%'+_0x11d022[_0x4d82('0x2c')][_0x4d82('0x39')]+'%'};return _0x2528d7;}})});}_0x4081f6=_['merge']({},_0x4081f6,_0x11d022[_0x4d82('0x3a')]);var _0x5d9444={'where':_0x4081f6[_0x4d82('0x36')]};return db[_0x4d82('0x28')]['count'](_0x5d9444)[_0x4d82('0x21')](function(_0x5521f1){_0x4d9ac4[_0x4d82('0x1a')]=_0x5521f1;if(_0x11d022[_0x4d82('0x2c')][_0x4d82('0x3b')]){_0x4081f6[_0x4d82('0x3c')]=[{'all':!![]}];}return db[_0x4d82('0x28')][_0x4d82('0x3d')](_0x4081f6);})['then'](function(_0x222b35){_0x4d9ac4[_0x4d82('0x3e')]=_0x222b35;return _0x4d9ac4;})[_0x4d82('0x21')](respondWithFilteredResult(_0x5ce98b,_0x4081f6))[_0x4d82('0x3f')](handleError(_0x5ce98b,null));};exports[_0x4d82('0x40')]=function(_0x363158,_0x37498b){var _0x4c474b={'raw':!![],'where':{'id':_0x363158[_0x4d82('0x41')]['id']}},_0x3c80d6={};_0x3c80d6[_0x4d82('0x32')]=_[_0x4d82('0x2d')](db[_0x4d82('0x28')]['rawAttributes']);_0x3c80d6[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x363158[_0x4d82('0x2c')]);_0x3c80d6[_0x4d82('0x38')]=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],_0x3c80d6[_0x4d82('0x2c')]);_0x4c474b['attributes']=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],qs['fields'](_0x363158[_0x4d82('0x2c')]['fields']));_0x4c474b[_0x4d82('0x2f')]=_0x4c474b[_0x4d82('0x2f')]['length']?_0x4c474b[_0x4d82('0x2f')]:_0x3c80d6[_0x4d82('0x32')];if(_0x363158['query'][_0x4d82('0x3b')]){_0x4c474b[_0x4d82('0x3c')]=[{'all':!![]}];}_0x4c474b=_[_0x4d82('0x42')]({},_0x4c474b,_0x363158['options']);return db[_0x4d82('0x28')][_0x4d82('0x43')](_0x4c474b)['then'](handleEntityNotFound(_0x37498b,null))['then'](respondWithResult(_0x37498b,null))[_0x4d82('0x3f')](handleError(_0x37498b,null));};exports[_0x4d82('0x44')]=function(_0x40c5ed,_0xb9d3bd){return db[_0x4d82('0x28')][_0x4d82('0x44')](_0x40c5ed[_0x4d82('0x45')],{})['then'](respondWithResult(_0xb9d3bd,0xc9))[_0x4d82('0x3f')](handleError(_0xb9d3bd,null));};exports[_0x4d82('0x20')]=function(_0x2e4083,_0x234ce3){if(_0x2e4083['body']['id']){delete _0x2e4083['body']['id'];}return db['MailQueueReport'][_0x4d82('0x43')]({'where':{'id':_0x2e4083[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x234ce3,null))[_0x4d82('0x21')](saveUpdates(_0x2e4083[_0x4d82('0x45')],null))[_0x4d82('0x21')](respondWithResult(_0x234ce3,null))['catch'](handleError(_0x234ce3,null));};exports[_0x4d82('0x22')]=function(_0x1c022d,_0x3c0ffc){return db[_0x4d82('0x28')][_0x4d82('0x43')]({'where':{'id':_0x1c022d[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x3c0ffc,null))[_0x4d82('0x21')](removeEntity(_0x3c0ffc,null))[_0x4d82('0x3f')](handleError(_0x3c0ffc,null));};exports['describe']=function(_0x418e6c,_0x25a4de){return db[_0x4d82('0x28')][_0x4d82('0x46')]()[_0x4d82('0x21')](respondWithResult(_0x25a4de,null))[_0x4d82('0x3f')](handleError(_0x25a4de,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 97a0c34..56cd691 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 _0x44ce=['uniqueid','util','../../config/logger','api','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue'];(function(_0x28bd76,_0x5a12c7){var _0x2908bc=function(_0x181d20){while(--_0x181d20){_0x28bd76['push'](_0x28bd76['shift']());}};_0x2908bc(++_0x5a12c7);}(_0x44ce,0x83));var _0xe44c=function(_0x1f794b,_0x1aafe6){_0x1f794b=_0x1f794b-0x0;var _0x22f5cb=_0x44ce[_0x1f794b];return _0x22f5cb;};'use strict';var _=require('lodash');var util=require(_0xe44c('0x0'));var logger=require(_0xe44c('0x1'))(_0xe44c('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(_0xe44c('0x3'));var config=require(_0xe44c('0x4'));var attributes=require(_0xe44c('0x5'));module['exports']=function(_0x3c7ecf,_0x4a58ba){return _0x3c7ecf[_0xe44c('0x6')](_0xe44c('0x7'),attributes,{'tableName':_0xe44c('0x8'),'paranoid':![],'indexes':[{'name':_0xe44c('0x9'),'fields':[_0xe44c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ef0=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util'];(function(_0x17a227,_0x151915){var _0x41ed72=function(_0x208956){while(--_0x208956){_0x17a227['push'](_0x17a227['shift']());}};_0x41ed72(++_0x151915);}(_0x3ef0,0x1da));var _0x03ef=function(_0x1f15b7,_0x5b6e19){_0x1f15b7=_0x1f15b7-0x0;var _0x270405=_0x3ef0[_0x1f15b7];return _0x270405;};'use strict';var _=require(_0x03ef('0x0'));var util=require(_0x03ef('0x1'));var logger=require(_0x03ef('0x2'))('api');var moment=require(_0x03ef('0x3'));var BPromise=require(_0x03ef('0x4'));var rp=require(_0x03ef('0x5'));var fs=require('fs');var path=require(_0x03ef('0x6'));var rimraf=require('rimraf');var config=require(_0x03ef('0x7'));var attributes=require(_0x03ef('0x8'));module[_0x03ef('0x9')]=function(_0x562f85,_0x3b42cb){return _0x562f85[_0x03ef('0xa')](_0x03ef('0xb'),attributes,{'tableName':_0x03ef('0xc'),'paranoid':![],'indexes':[{'name':_0x03ef('0xd'),'fields':[_0x03ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index ad0ca47..cacf69e 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x8f0755,_0x9b2637){var _0x2b2997=function(_0x3a5b77){while(--_0x3a5b77){_0x8f0755['push'](_0x8f0755['shift']());}};_0x2b2997(++_0x9b2637);}(_0xdb28,0x106));var _0x8db2=function(_0x553a4d,_0xf8f3){_0x553a4d=_0x553a4d-0x0;var _0xf66f31=_0xdb28[_0x553a4d];return _0xf66f31;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x97182a,_0x247d91){var _0x95e00c=function(_0x1427cd){while(--_0x1427cd){_0x97182a['push'](_0x97182a['shift']());}};_0x95e00c(++_0x247d91);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 84c9b5e..0993609 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4728d4,_0x1df994){var _0x2a459b=function(_0x1a4b0d){while(--_0x1a4b0d){_0x4728d4['push'](_0x4728d4['shift']());}};_0x2a459b(++_0x1df994);}(_0x70e0,0x17b));var _0x070e=function(_0xf95201,_0x6f28a){_0xf95201=_0xf95201-0x0;var _0x3e0593=_0x70e0[_0xf95201];return _0x3e0593;};'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(_0x3fc7ba,_0x3bf175){var _0x230dbc=function(_0x27a16d){while(--_0x27a16d){_0x3fc7ba['push'](_0x3fc7ba['shift']());}};_0x230dbc(++_0x3bf175);}(_0x70e0,0x17b));var _0x070e=function(_0xa24402,_0x3ee5f1){_0xa24402=_0xa24402-0x0;var _0xef1621=_0x70e0[_0xa24402];return _0xef1621;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index df006ec..60b64f3 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 _0xa25c=['STRING','BOOLEAN','INTEGER','INBOX','exports'];(function(_0x5c0095,_0x511e40){var _0x4c98b0=function(_0x8b5ac9){while(--_0x8b5ac9){_0x5c0095['push'](_0x5c0095['shift']());}};_0x4c98b0(++_0x511e40);}(_0xa25c,0x13f));var _0xca25=function(_0xfb1d9a,_0x2903e0){_0xfb1d9a=_0xfb1d9a-0x0;var _0x2f095b=_0xa25c[_0xfb1d9a];return _0x2f095b;};'use strict';var Sequelize=require('sequelize');module[_0xca25('0x0')]={'description':{'type':Sequelize[_0xca25('0x1')]},'host':{'type':Sequelize[_0xca25('0x1')]},'authentication':{'type':Sequelize[_0xca25('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xca25('0x1')]},'password':{'type':Sequelize[_0xca25('0x1')]},'port':{'type':Sequelize[_0xca25('0x3')]},'tls':{'type':Sequelize[_0xca25('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xca25('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xca25('0x1')]}}; \ No newline at end of file +var _0xa75b=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0xa75b,0x170));var _0xba75=function(_0x5285f0,_0x430d90){_0x5285f0=_0x5285f0-0x0;var _0x1a644e=_0xa75b[_0x5285f0];return _0x1a644e;};'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 eb9c66b..d7f3ad6 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 _0xcc23=['rimraf','define','mail_servers_in','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a0c33,_0x5686bb){var _0x6488f9=function(_0x3bbd97){while(--_0x3bbd97){_0x4a0c33['push'](_0x4a0c33['shift']());}};_0x6488f9(++_0x5686bb);}(_0xcc23,0x1ce));var _0x3cc2=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xcc23[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0x3cc2('0x0'));var logger=require(_0x3cc2('0x1'))(_0x3cc2('0x2'));var moment=require(_0x3cc2('0x3'));var BPromise=require(_0x3cc2('0x4'));var rp=require(_0x3cc2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cc2('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module['exports']=function(_0xd16785,_0x246081){return _0xd16785[_0x3cc2('0x7')]('MailServerIn',attributes,{'tableName':_0x3cc2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1d0=['path','rimraf','exports','define','MailServerIn','../../config/logger','api','moment','request-promise'];(function(_0x851b51,_0x3bfbc0){var _0x5e2c1f=function(_0x549d0d){while(--_0x549d0d){_0x851b51['push'](_0x851b51['shift']());}};_0x5e2c1f(++_0x3bfbc0);}(_0xc1d0,0x1f4));var _0x0c1d=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0xc1d0[_0x35387d];return _0x3aba56;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c1d('0x0'))(_0x0c1d('0x1'));var moment=require(_0x0c1d('0x2'));var BPromise=require('bluebird');var rp=require(_0x0c1d('0x3'));var fs=require('fs');var path=require(_0x0c1d('0x4'));var rimraf=require(_0x0c1d('0x5'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x0c1d('0x6')]=function(_0x4ff9a0,_0x3d8356){return _0x4ff9a0[_0x0c1d('0x7')](_0x0c1d('0x8'),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 9c68351..2688bc6 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 _0x04b8=['error','code','message','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','map','model','include','debug','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04b8,0x159));var _0x804b=function(_0x590333,_0x5ba5e7){_0x590333=_0x590333-0x0;var _0x16a9f2=_0x04b8[_0x590333];return _0x16a9f2;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5404,_0x476262,_0x50826d){return new BPromise(function(_0x27e950,_0x1071b4){return client['request'](_0x3c5404,_0x50826d)[_0x804b('0x9')](function(_0x336325){logger[_0x804b('0xa')](_0x804b('0xb'),_0x476262,_0x804b('0xc'));logger['debug'](_0x804b('0xd'),_0x476262,_0x804b('0xc'),JSON[_0x804b('0xe')](_0x336325));if(_0x336325[_0x804b('0xf')]){if(_0x336325[_0x804b('0xf')][_0x804b('0x10')]===0x1f4){logger['error'](_0x804b('0xb'),_0x476262,_0x336325['error'][_0x804b('0x11')]);return _0x1071b4(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}logger[_0x804b('0xf')]('MailServerIn,\x20%s,\x20%s',_0x476262,_0x336325[_0x804b('0xf')][_0x804b('0x11')]);return _0x27e950(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}else{logger['info'](_0x804b('0xb'),_0x476262,_0x804b('0xc'));_0x27e950(_0x336325['result'][_0x804b('0x11')]);}})['catch'](function(_0x2c90b9){logger[_0x804b('0xf')](_0x804b('0xb'),_0x476262,_0x2c90b9);_0x1071b4(_0x2c90b9);});});}exports[_0x804b('0x12')]=function(_0x3a05c0){var _0x5a0a82=this;return new Promise(function(_0x871d6c,_0x50b4fe){return db[_0x804b('0x13')][_0x804b('0x14')]({'raw':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')][_0x804b('0x16')]||null:null,'attributes':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')][_0x804b('0x17')]||null:null,'limit':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')][_0x804b('0x18')]||null:null,'include':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')]['include']?_[_0x804b('0x19')](_0x3a05c0[_0x804b('0x15')]['include'],function(_0x44a921){return{'model':db[_0x44a921[_0x804b('0x1a')]],'as':_0x44a921['as'],'attributes':_0x44a921[_0x804b('0x17')],'include':_0x44a921[_0x804b('0x1b')]?_[_0x804b('0x19')](_0x44a921['include'],function(_0x2de812){return{'model':db[_0x2de812[_0x804b('0x1a')]],'as':_0x2de812['as'],'attributes':_0x2de812['attributes'],'include':_0x2de812[_0x804b('0x1b')]?_[_0x804b('0x19')](_0x2de812[_0x804b('0x1b')],function(_0x27d5ec){return{'model':db[_0x27d5ec[_0x804b('0x1a')]],'as':_0x27d5ec['as'],'attributes':_0x27d5ec['attributes']};}):[]};}):[]};}):[]:[]})[_0x804b('0x9')](function(_0x22f822){logger[_0x804b('0xa')](_0x804b('0x12'),_0x3a05c0);logger[_0x804b('0x1c')]('GetMailServerIn',_0x3a05c0,JSON[_0x804b('0xe')](_0x22f822));_0x871d6c(_0x22f822);})[_0x804b('0x1d')](function(_0x410871){logger['error'](_0x804b('0x12'),_0x410871[_0x804b('0x11')],_0x3a05c0);_0x50b4fe(_0x5a0a82[_0x804b('0xf')](0x1f4,_0x410871['message']));});});}; \ No newline at end of file +var _0x8e2e=['findAll','options','raw','where','attributes','limit','include','model','map','then','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailServerIn','MailServerIn'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8e2e,0x10b));var _0xe8e2=function(_0x2f88bf,_0x761a0e){_0x2f88bf=_0x2f88bf-0x0;var _0x1b451e=_0x8e2e[_0x2f88bf];return _0x1b451e;};'use strict';var _=require('lodash');var util=require(_0xe8e2('0x0'));var moment=require(_0xe8e2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8e2('0x2'))['db'];var utils=require(_0xe8e2('0x3'));var logger=require(_0xe8e2('0x4'))(_0xe8e2('0x5'));var config=require(_0xe8e2('0x6'));var jayson=require(_0xe8e2('0x7'));var client=jayson[_0xe8e2('0x8')][_0xe8e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x113fef,_0x28a86a,_0x531b72){return new BPromise(function(_0xdd1d8a,_0x2a6c32){return client[_0xe8e2('0xa')](_0x113fef,_0x531b72)['then'](function(_0x10edc7){logger[_0xe8e2('0xb')](_0xe8e2('0xc'),_0x28a86a,'request\x20sent');logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x28a86a,_0xe8e2('0xd'),JSON[_0xe8e2('0xe')](_0x10edc7));if(_0x10edc7[_0xe8e2('0xf')]){if(_0x10edc7[_0xe8e2('0xf')][_0xe8e2('0x10')]===0x1f4){logger[_0xe8e2('0xf')](_0xe8e2('0xc'),_0x28a86a,_0x10edc7[_0xe8e2('0xf')][_0xe8e2('0x11')]);return _0x2a6c32(_0x10edc7[_0xe8e2('0xf')]['message']);}logger[_0xe8e2('0xf')]('MailServerIn,\x20%s,\x20%s',_0x28a86a,_0x10edc7[_0xe8e2('0xf')][_0xe8e2('0x11')]);return _0xdd1d8a(_0x10edc7[_0xe8e2('0xf')][_0xe8e2('0x11')]);}else{logger['info'](_0xe8e2('0xc'),_0x28a86a,_0xe8e2('0xd'));_0xdd1d8a(_0x10edc7[_0xe8e2('0x12')][_0xe8e2('0x11')]);}})['catch'](function(_0x1d8f33){logger[_0xe8e2('0xf')](_0xe8e2('0xc'),_0x28a86a,_0x1d8f33);_0x2a6c32(_0x1d8f33);});});}exports[_0xe8e2('0x13')]=function(_0x99ed04){var _0x3a90c8=this;return new Promise(function(_0x5067a1,_0x9d40c4){return db[_0xe8e2('0x14')][_0xe8e2('0x15')]({'raw':_0x99ed04[_0xe8e2('0x16')]?_0x99ed04[_0xe8e2('0x16')][_0xe8e2('0x17')]===undefined?!![]:![]:!![],'where':_0x99ed04[_0xe8e2('0x16')]?_0x99ed04[_0xe8e2('0x16')][_0xe8e2('0x18')]||null:null,'attributes':_0x99ed04[_0xe8e2('0x16')]?_0x99ed04[_0xe8e2('0x16')][_0xe8e2('0x19')]||null:null,'limit':_0x99ed04[_0xe8e2('0x16')]?_0x99ed04[_0xe8e2('0x16')][_0xe8e2('0x1a')]||null:null,'include':_0x99ed04['options']?_0x99ed04['options'][_0xe8e2('0x1b')]?_['map'](_0x99ed04['options'][_0xe8e2('0x1b')],function(_0x583355){return{'model':db[_0x583355[_0xe8e2('0x1c')]],'as':_0x583355['as'],'attributes':_0x583355[_0xe8e2('0x19')],'include':_0x583355[_0xe8e2('0x1b')]?_[_0xe8e2('0x1d')](_0x583355[_0xe8e2('0x1b')],function(_0x5a9a46){return{'model':db[_0x5a9a46[_0xe8e2('0x1c')]],'as':_0x5a9a46['as'],'attributes':_0x5a9a46[_0xe8e2('0x19')],'include':_0x5a9a46[_0xe8e2('0x1b')]?_[_0xe8e2('0x1d')](_0x5a9a46['include'],function(_0x53fd95){return{'model':db[_0x53fd95['model']],'as':_0x53fd95['as'],'attributes':_0x53fd95['attributes']};}):[]};}):[]};}):[]:[]})[_0xe8e2('0x1e')](function(_0x2d7c32){logger[_0xe8e2('0xb')](_0xe8e2('0x13'),_0x99ed04);logger['debug'](_0xe8e2('0x13'),_0x99ed04,JSON['stringify'](_0x2d7c32));_0x5067a1(_0x2d7c32);})[_0xe8e2('0x1f')](function(_0x39623a){logger[_0xe8e2('0xf')](_0xe8e2('0x13'),_0x39623a[_0xe8e2('0x11')],_0x99ed04);_0x9d40c4(_0x3a90c8['error'](0x1f4,_0x39623a[_0xe8e2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 7985fac..db6f28e 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7a54,0x106));var _0x47a5=function(_0x353a6e,_0x4bcdb8){_0x353a6e=_0x353a6e-0x0;var _0x6b354f=_0x7a54[_0x353a6e];return _0x6b354f;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7a54,0x106));var _0x47a5=function(_0xfd9cb0,_0x445d36){_0xfd9cb0=_0xfd9cb0-0x0;var _0x412fc7=_0x7a54[_0xfd9cb0];return _0x412fc7;};'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 0c9a696..4906f95 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 _0xe0f9=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x25777,_0x1937e6){var _0x4d95d0=function(_0xb0359a){while(--_0xb0359a){_0x25777['push'](_0x25777['shift']());}};_0x4d95d0(++_0x1937e6);}(_0xe0f9,0x6c));var _0x9e0f=function(_0x5d3201,_0x307bcf){_0x5d3201=_0x5d3201-0x0;var _0x4e0049=_0xe0f9[_0x5d3201];return _0x4e0049;};'use strict';var Sequelize=require(_0x9e0f('0x0'));module[_0x9e0f('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9e0f('0x2')]},'user':{'type':Sequelize[_0x9e0f('0x2')]},'pass':{'type':Sequelize[_0x9e0f('0x2')]},'port':{'type':Sequelize[_0x9e0f('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x9e0f('0x2')]},'authentication':{'type':Sequelize[_0x9e0f('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xefb7=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xefb7,0x14b));var _0x7efb=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xefb7[_0x104e21];return _0x605b37;};'use strict';var Sequelize=require(_0x7efb('0x0'));module[_0x7efb('0x1')]={'description':{'type':Sequelize[_0x7efb('0x2')]},'host':{'type':Sequelize[_0x7efb('0x2')]},'user':{'type':Sequelize[_0x7efb('0x2')]},'pass':{'type':Sequelize[_0x7efb('0x2')]},'port':{'type':Sequelize[_0x7efb('0x3')]},'secure':{'type':Sequelize[_0x7efb('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x7efb('0x2')]},'authentication':{'type':Sequelize[_0x7efb('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 033013a..e057cb6 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 _0x797c=['status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','include','rows','catch','params','length','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2b6cbc,_0x477292){var _0x49d8c9=function(_0x2ab13a){while(--_0x2ab13a){_0x2b6cbc['push'](_0x2b6cbc['shift']());}};_0x49d8c9(++_0x477292);}(_0x797c,0xbd));var _0xc797=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x797c[_0x424357];return _0x29c68e;};'use strict';var emlformat=require(_0xc797('0x0'));var rimraf=require(_0xc797('0x1'));var zipdir=require(_0xc797('0x2'));var jsonpatch=require(_0xc797('0x3'));var rp=require(_0xc797('0x4'));var moment=require(_0xc797('0x5'));var BPromise=require(_0xc797('0x6'));var Mustache=require(_0xc797('0x7'));var util=require('util');var path=require(_0xc797('0x8'));var sox=require(_0xc797('0x9'));var csv=require(_0xc797('0xa'));var ejs=require(_0xc797('0xb'));var fs=require('fs');var fs_extra=require(_0xc797('0xc'));var _=require(_0xc797('0xd'));var squel=require(_0xc797('0xe'));var crypto=require(_0xc797('0xf'));var jsforce=require(_0xc797('0x10'));var deskjs=require(_0xc797('0x11'));var toCsv=require(_0xc797('0xa'));var querystring=require(_0xc797('0x12'));var Papa=require('papaparse');var Redis=require(_0xc797('0x13'));var authService=require(_0xc797('0x14'));var qs=require(_0xc797('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc797('0x16'))('api');var utils=require(_0xc797('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc797('0x18'));var db=require(_0xc797('0x19'))['db'];function respondWithStatusCode(_0x5e0fd1,_0x357184){_0x357184=_0x357184||0xcc;return function(_0x1dae6a){if(_0x1dae6a){return _0x5e0fd1[_0xc797('0x1a')](_0x357184);}return _0x5e0fd1[_0xc797('0x1b')](_0x357184)[_0xc797('0x1c')]();};}function respondWithResult(_0x1b728b,_0x5b88ac){_0x5b88ac=_0x5b88ac||0xc8;return function(_0x2636ac){if(_0x2636ac){return _0x1b728b[_0xc797('0x1b')](_0x5b88ac)[_0xc797('0x1d')](_0x2636ac);}};}function respondWithFilteredResult(_0x5b7e7e,_0x4feb32){return function(_0xfd6ccd){if(_0xfd6ccd){var _0xc3ff48=typeof _0x4feb32[_0xc797('0x1e')]==='undefined'&&typeof _0x4feb32[_0xc797('0x1f')]==='undefined';var _0x2e07be=_0xfd6ccd[_0xc797('0x20')];var _0x56a5b4=_0xc3ff48?0x0:_0x4feb32[_0xc797('0x1e')];var _0x2b1981=_0xc3ff48?_0xfd6ccd[_0xc797('0x20')]:_0x4feb32[_0xc797('0x1e')]+_0x4feb32['limit'];var _0x23bafa;if(_0x2b1981>=_0x2e07be){_0x2b1981=_0x2e07be;_0x23bafa=0xc8;}else{_0x23bafa=0xce;}_0x5b7e7e['status'](_0x23bafa);return _0x5b7e7e[_0xc797('0x21')]('Content-Range',_0x56a5b4+'-'+_0x2b1981+'/'+_0x2e07be)['json'](_0xfd6ccd);}return null;};}function patchUpdates(_0x48380b){return function(_0x3e0345){try{jsonpatch[_0xc797('0x22')](_0x3e0345,_0x48380b,!![]);}catch(_0x59d0ea){return BPromise[_0xc797('0x23')](_0x59d0ea);}return _0x3e0345[_0xc797('0x24')]();};}function saveUpdates(_0x4c569c,_0x48ecdb){return function(_0xa69687){if(_0xa69687){return _0xa69687[_0xc797('0x25')](_0x4c569c)['then'](function(_0x502f9){return _0x502f9;});}return null;};}function removeEntity(_0x26d7c5,_0x112371){return function(_0x3e1168){if(_0x3e1168){return _0x3e1168[_0xc797('0x26')]()[_0xc797('0x27')](function(){_0x26d7c5[_0xc797('0x1b')](0xcc)[_0xc797('0x1c')]();});}};}function handleEntityNotFound(_0x16dbd4,_0xb19119){return function(_0x1a1138){if(!_0x1a1138){_0x16dbd4[_0xc797('0x1a')](0x194);}return _0x1a1138;};}function handleError(_0x551059,_0x1a7fb8){_0x1a7fb8=_0x1a7fb8||0x1f4;return function(_0x163682){logger[_0xc797('0x28')](_0x163682[_0xc797('0x29')]);if(_0x163682['name']){delete _0x163682[_0xc797('0x2a')];}_0x551059[_0xc797('0x1b')](_0x1a7fb8)[_0xc797('0x2b')](_0x163682);};}exports[_0xc797('0x2c')]=function(_0x5b4e65,_0x1a4fe4){var _0x3d4c3b={},_0x50fa1b={},_0x598e91={'count':0x0,'rows':[]};var _0x337ca5=_[_0xc797('0x2d')](db[_0xc797('0x2e')][_0xc797('0x2f')],function(_0x3686f8){return{'name':_0x3686f8[_0xc797('0x30')],'type':_0x3686f8[_0xc797('0x31')][_0xc797('0x32')]};});_0x50fa1b[_0xc797('0x33')]=_[_0xc797('0x2d')](_0x337ca5,_0xc797('0x2a'));_0x50fa1b[_0xc797('0x34')]=_['keys'](_0x5b4e65['query']);_0x50fa1b[_0xc797('0x35')]=_[_0xc797('0x36')](_0x50fa1b[_0xc797('0x33')],_0x50fa1b['query']);_0x3d4c3b[_0xc797('0x37')]=_[_0xc797('0x36')](_0x50fa1b['model'],qs[_0xc797('0x38')](_0x5b4e65[_0xc797('0x34')]['fields']));_0x3d4c3b[_0xc797('0x37')]=_0x3d4c3b[_0xc797('0x37')]['length']?_0x3d4c3b['attributes']:_0x50fa1b[_0xc797('0x33')];if(!_0x5b4e65[_0xc797('0x34')][_0xc797('0x39')]('nolimit')){_0x3d4c3b[_0xc797('0x1f')]=qs[_0xc797('0x1f')](_0x5b4e65['query'][_0xc797('0x1f')]);_0x3d4c3b[_0xc797('0x1e')]=qs[_0xc797('0x1e')](_0x5b4e65['query'][_0xc797('0x1e')]);}_0x3d4c3b['order']=qs[_0xc797('0x3a')](_0x5b4e65[_0xc797('0x34')][_0xc797('0x3a')]);_0x3d4c3b[_0xc797('0x3b')]=qs[_0xc797('0x35')](_[_0xc797('0x3c')](_0x5b4e65[_0xc797('0x34')],_0x50fa1b['filters']),_0x337ca5);if(_0x5b4e65[_0xc797('0x34')]['filter']){_0x3d4c3b['where']=_['merge'](_0x3d4c3b[_0xc797('0x3b')],{'$or':_['map'](_0x337ca5,function(_0x20c17a){if(_0x20c17a[_0xc797('0x31')]!=='VIRTUAL'){var _0x79de9c={};_0x79de9c[_0x20c17a[_0xc797('0x2a')]]={'$like':'%'+_0x5b4e65[_0xc797('0x34')][_0xc797('0x3d')]+'%'};return _0x79de9c;}})});}_0x3d4c3b=_['merge']({},_0x3d4c3b,_0x5b4e65['options']);var _0x3f2ce1={'where':_0x3d4c3b[_0xc797('0x3b')]};return db['MailServerOut'][_0xc797('0x20')](_0x3f2ce1)[_0xc797('0x27')](function(_0x43fee1){_0x598e91[_0xc797('0x20')]=_0x43fee1;if(_0x5b4e65[_0xc797('0x34')]['includeAll']){_0x3d4c3b[_0xc797('0x3e')]=[{'all':!![]}];}return db[_0xc797('0x2e')]['findAll'](_0x3d4c3b);})['then'](function(_0x292c92){_0x598e91[_0xc797('0x3f')]=_0x292c92;return _0x598e91;})[_0xc797('0x27')](respondWithFilteredResult(_0x1a4fe4,_0x3d4c3b))[_0xc797('0x40')](handleError(_0x1a4fe4,null));};exports['show']=function(_0xc9db1d,_0x32e454){var _0x3c5ade={'raw':!![],'where':{'id':_0xc9db1d[_0xc797('0x41')]['id']}},_0x355a86={};_0x355a86['model']=_['keys'](db[_0xc797('0x2e')][_0xc797('0x2f')]);_0x355a86[_0xc797('0x34')]=_['keys'](_0xc9db1d[_0xc797('0x34')]);_0x355a86[_0xc797('0x35')]=_[_0xc797('0x36')](_0x355a86['model'],_0x355a86[_0xc797('0x34')]);_0x3c5ade[_0xc797('0x37')]=_[_0xc797('0x36')](_0x355a86['model'],qs['fields'](_0xc9db1d[_0xc797('0x34')][_0xc797('0x38')]));_0x3c5ade['attributes']=_0x3c5ade[_0xc797('0x37')][_0xc797('0x42')]?_0x3c5ade[_0xc797('0x37')]:_0x355a86['model'];if(_0xc9db1d[_0xc797('0x34')][_0xc797('0x43')]){_0x3c5ade['include']=[{'all':!![]}];}_0x3c5ade=_['merge']({},_0x3c5ade,_0xc9db1d[_0xc797('0x44')]);return db[_0xc797('0x2e')][_0xc797('0x45')](_0x3c5ade)[_0xc797('0x27')](handleEntityNotFound(_0x32e454,null))[_0xc797('0x27')](respondWithResult(_0x32e454,null))[_0xc797('0x40')](handleError(_0x32e454,null));};exports[_0xc797('0x46')]=function(_0x3a1913,_0x575431){return db[_0xc797('0x2e')]['create'](_0x3a1913['body'],{})[_0xc797('0x27')](respondWithResult(_0x575431,0xc9))[_0xc797('0x40')](handleError(_0x575431,null));};exports[_0xc797('0x25')]=function(_0x3d1cea,_0x150bbb){if(_0x3d1cea[_0xc797('0x47')]['id']){delete _0x3d1cea[_0xc797('0x47')]['id'];}return db[_0xc797('0x2e')]['find']({'where':{'id':_0x3d1cea[_0xc797('0x41')]['id']}})['then'](handleEntityNotFound(_0x150bbb,null))[_0xc797('0x27')](saveUpdates(_0x3d1cea[_0xc797('0x47')],null))['then'](respondWithResult(_0x150bbb,null))['catch'](handleError(_0x150bbb,null));};exports[_0xc797('0x26')]=function(_0x2907ad,_0x4d8af6){return db[_0xc797('0x2e')][_0xc797('0x45')]({'where':{'id':_0x2907ad[_0xc797('0x41')]['id']}})[_0xc797('0x27')](handleEntityNotFound(_0x4d8af6,null))[_0xc797('0x27')](removeEntity(_0x4d8af6,null))['catch'](handleError(_0x4d8af6,null));}; \ No newline at end of file +var _0x0cff=['params','find','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x0cff,0x1a7));var _0xf0cf=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0cff[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xf0cf('0x0'));var rimraf=require(_0xf0cf('0x1'));var zipdir=require(_0xf0cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0cf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0cf('0x4'));var util=require(_0xf0cf('0x5'));var path=require(_0xf0cf('0x6'));var sox=require(_0xf0cf('0x7'));var csv=require(_0xf0cf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0cf('0x9'));var _=require(_0xf0cf('0xa'));var squel=require(_0xf0cf('0xb'));var crypto=require(_0xf0cf('0xc'));var jsforce=require(_0xf0cf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf0cf('0x8'));var querystring=require(_0xf0cf('0xe'));var Papa=require(_0xf0cf('0xf'));var Redis=require('ioredis');var authService=require(_0xf0cf('0x10'));var qs=require(_0xf0cf('0x11'));var as=require(_0xf0cf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf0cf('0x13'));var utils=require('../../config/utils');var config=require(_0xf0cf('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf0cf('0x15'))['db'];function respondWithStatusCode(_0x32544e,_0x42b9fc){_0x42b9fc=_0x42b9fc||0xcc;return function(_0x5a3f81){if(_0x5a3f81){return _0x32544e[_0xf0cf('0x16')](_0x42b9fc);}return _0x32544e[_0xf0cf('0x17')](_0x42b9fc)[_0xf0cf('0x18')]();};}function respondWithResult(_0x4fbed5,_0x4795f2){_0x4795f2=_0x4795f2||0xc8;return function(_0x493e61){if(_0x493e61){return _0x4fbed5['status'](_0x4795f2)[_0xf0cf('0x19')](_0x493e61);}};}function respondWithFilteredResult(_0x5d0dfa,_0x5bbb92){return function(_0x459613){if(_0x459613){var _0x3499d1=typeof _0x5bbb92[_0xf0cf('0x1a')]===_0xf0cf('0x1b')&&typeof _0x5bbb92['limit']==='undefined';var _0x19abed=_0x459613['count'];var _0xe7ba95=_0x3499d1?0x0:_0x5bbb92['offset'];var _0x22b11f=_0x3499d1?_0x459613[_0xf0cf('0x1c')]:_0x5bbb92[_0xf0cf('0x1a')]+_0x5bbb92[_0xf0cf('0x1d')];var _0xd0042a;if(_0x22b11f>=_0x19abed){_0x22b11f=_0x19abed;_0xd0042a=0xc8;}else{_0xd0042a=0xce;}_0x5d0dfa[_0xf0cf('0x17')](_0xd0042a);return _0x5d0dfa[_0xf0cf('0x1e')](_0xf0cf('0x1f'),_0xe7ba95+'-'+_0x22b11f+'/'+_0x19abed)['json'](_0x459613);}return null;};}function patchUpdates(_0x1e8f23){return function(_0x213436){try{jsonpatch['apply'](_0x213436,_0x1e8f23,!![]);}catch(_0xe46204){return BPromise[_0xf0cf('0x20')](_0xe46204);}return _0x213436[_0xf0cf('0x21')]();};}function saveUpdates(_0x41083e,_0x1a9198){return function(_0x295932){if(_0x295932){return _0x295932[_0xf0cf('0x22')](_0x41083e)[_0xf0cf('0x23')](function(_0xb57002){return _0xb57002;});}return null;};}function removeEntity(_0x27bc45,_0x3ae3a6){return function(_0x1a9b03){if(_0x1a9b03){return _0x1a9b03[_0xf0cf('0x24')]()[_0xf0cf('0x23')](function(){_0x27bc45[_0xf0cf('0x17')](0xcc)[_0xf0cf('0x18')]();});}};}function handleEntityNotFound(_0x8d1b14,_0x5c2978){return function(_0x60692d){if(!_0x60692d){_0x8d1b14['sendStatus'](0x194);}return _0x60692d;};}function handleError(_0x2e02b4,_0x525fff){_0x525fff=_0x525fff||0x1f4;return function(_0x475d0b){logger[_0xf0cf('0x25')](_0x475d0b[_0xf0cf('0x26')]);if(_0x475d0b[_0xf0cf('0x27')]){delete _0x475d0b[_0xf0cf('0x27')];}_0x2e02b4[_0xf0cf('0x17')](_0x525fff)['send'](_0x475d0b);};}exports['index']=function(_0x521ba1,_0x3a947f){var _0x2a1070={},_0x1a1575={},_0x3c89dd={'count':0x0,'rows':[]};var _0x4fc5bc=_[_0xf0cf('0x28')](db[_0xf0cf('0x29')][_0xf0cf('0x2a')],function(_0x8776f9){return{'name':_0x8776f9[_0xf0cf('0x2b')],'type':_0x8776f9[_0xf0cf('0x2c')][_0xf0cf('0x2d')]};});_0x1a1575[_0xf0cf('0x2e')]=_[_0xf0cf('0x28')](_0x4fc5bc,'name');_0x1a1575[_0xf0cf('0x2f')]=_['keys'](_0x521ba1[_0xf0cf('0x2f')]);_0x1a1575['filters']=_['intersection'](_0x1a1575[_0xf0cf('0x2e')],_0x1a1575['query']);_0x2a1070[_0xf0cf('0x30')]=_[_0xf0cf('0x31')](_0x1a1575[_0xf0cf('0x2e')],qs[_0xf0cf('0x32')](_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x32')]));_0x2a1070[_0xf0cf('0x30')]=_0x2a1070[_0xf0cf('0x30')][_0xf0cf('0x33')]?_0x2a1070[_0xf0cf('0x30')]:_0x1a1575['model'];if(!_0x521ba1[_0xf0cf('0x2f')]['hasOwnProperty'](_0xf0cf('0x34'))){_0x2a1070[_0xf0cf('0x1d')]=qs[_0xf0cf('0x1d')](_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x1d')]);_0x2a1070['offset']=qs[_0xf0cf('0x1a')](_0x521ba1[_0xf0cf('0x2f')]['offset']);}_0x2a1070[_0xf0cf('0x35')]=qs['sort'](_0x521ba1[_0xf0cf('0x2f')]['sort']);_0x2a1070[_0xf0cf('0x36')]=qs[_0xf0cf('0x37')](_[_0xf0cf('0x38')](_0x521ba1['query'],_0x1a1575[_0xf0cf('0x37')]),_0x4fc5bc);if(_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x39')]){_0x2a1070['where']=_['merge'](_0x2a1070[_0xf0cf('0x36')],{'$or':_[_0xf0cf('0x28')](_0x4fc5bc,function(_0xbee045){if(_0xbee045['type']!==_0xf0cf('0x3a')){var _0x400d1d={};_0x400d1d[_0xbee045[_0xf0cf('0x27')]]={'$like':'%'+_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x39')]+'%'};return _0x400d1d;}})});}_0x2a1070=_[_0xf0cf('0x3b')]({},_0x2a1070,_0x521ba1[_0xf0cf('0x3c')]);var _0x32a62f={'where':_0x2a1070[_0xf0cf('0x36')]};return db[_0xf0cf('0x29')]['count'](_0x32a62f)[_0xf0cf('0x23')](function(_0x50bf61){_0x3c89dd['count']=_0x50bf61;if(_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x3d')]){_0x2a1070[_0xf0cf('0x3e')]=[{'all':!![]}];}return db[_0xf0cf('0x29')][_0xf0cf('0x3f')](_0x2a1070);})['then'](function(_0x4160e2){_0x3c89dd[_0xf0cf('0x40')]=_0x4160e2;return _0x3c89dd;})[_0xf0cf('0x23')](respondWithFilteredResult(_0x3a947f,_0x2a1070))[_0xf0cf('0x41')](handleError(_0x3a947f,null));};exports[_0xf0cf('0x42')]=function(_0x879eca,_0x2a34f2){var _0x4e62ed={'raw':!![],'where':{'id':_0x879eca[_0xf0cf('0x43')]['id']}},_0x416185={};_0x416185[_0xf0cf('0x2e')]=_['keys'](db['MailServerOut'][_0xf0cf('0x2a')]);_0x416185[_0xf0cf('0x2f')]=_['keys'](_0x879eca[_0xf0cf('0x2f')]);_0x416185[_0xf0cf('0x37')]=_[_0xf0cf('0x31')](_0x416185[_0xf0cf('0x2e')],_0x416185[_0xf0cf('0x2f')]);_0x4e62ed[_0xf0cf('0x30')]=_[_0xf0cf('0x31')](_0x416185[_0xf0cf('0x2e')],qs[_0xf0cf('0x32')](_0x879eca[_0xf0cf('0x2f')][_0xf0cf('0x32')]));_0x4e62ed[_0xf0cf('0x30')]=_0x4e62ed['attributes'][_0xf0cf('0x33')]?_0x4e62ed[_0xf0cf('0x30')]:_0x416185[_0xf0cf('0x2e')];if(_0x879eca[_0xf0cf('0x2f')][_0xf0cf('0x3d')]){_0x4e62ed[_0xf0cf('0x3e')]=[{'all':!![]}];}_0x4e62ed=_['merge']({},_0x4e62ed,_0x879eca[_0xf0cf('0x3c')]);return db['MailServerOut'][_0xf0cf('0x44')](_0x4e62ed)[_0xf0cf('0x23')](handleEntityNotFound(_0x2a34f2,null))[_0xf0cf('0x23')](respondWithResult(_0x2a34f2,null))[_0xf0cf('0x41')](handleError(_0x2a34f2,null));};exports['create']=function(_0x4a4bee,_0x5b4f6e){return db['MailServerOut']['create'](_0x4a4bee['body'],{})[_0xf0cf('0x23')](respondWithResult(_0x5b4f6e,0xc9))['catch'](handleError(_0x5b4f6e,null));};exports[_0xf0cf('0x22')]=function(_0x4563f5,_0x1ea6c2){if(_0x4563f5[_0xf0cf('0x45')]['id']){delete _0x4563f5[_0xf0cf('0x45')]['id'];}return db['MailServerOut'][_0xf0cf('0x44')]({'where':{'id':_0x4563f5[_0xf0cf('0x43')]['id']}})[_0xf0cf('0x23')](handleEntityNotFound(_0x1ea6c2,null))[_0xf0cf('0x23')](saveUpdates(_0x4563f5['body'],null))['then'](respondWithResult(_0x1ea6c2,null))[_0xf0cf('0x41')](handleError(_0x1ea6c2,null));};exports[_0xf0cf('0x24')]=function(_0x4c51a2,_0x49adc7){return db[_0xf0cf('0x29')][_0xf0cf('0x44')]({'where':{'id':_0x4c51a2[_0xf0cf('0x43')]['id']}})[_0xf0cf('0x23')](handleEntityNotFound(_0x49adc7,null))[_0xf0cf('0x23')](removeEntity(_0x49adc7,null))[_0xf0cf('0x41')](handleError(_0x49adc7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 4c4da5f..7d8cf86 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 _0xa688=['moment','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','api'];(function(_0x8c3bf,_0x1ebcec){var _0x153fdb=function(_0xd5bbb7){while(--_0xd5bbb7){_0x8c3bf['push'](_0x8c3bf['shift']());}};_0x153fdb(++_0x1ebcec);}(_0xa688,0xc3));var _0x8a68=function(_0x1c2995,_0x9e2edf){_0x1c2995=_0x1c2995-0x0;var _0x1acd48=_0xa688[_0x1c2995];return _0x1acd48;};'use strict';var _=require(_0x8a68('0x0'));var util=require(_0x8a68('0x1'));var logger=require('../../config/logger')(_0x8a68('0x2'));var moment=require(_0x8a68('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a68('0x4'));var rimraf=require(_0x8a68('0x5'));var config=require(_0x8a68('0x6'));var attributes=require(_0x8a68('0x7'));module[_0x8a68('0x8')]=function(_0x8625bf,_0x55bb6d){return _0x8625bf[_0x8a68('0x9')](_0x8a68('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95bc=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash'];(function(_0x33b101,_0x1fe78f){var _0x5553af=function(_0x31a4ad){while(--_0x31a4ad){_0x33b101['push'](_0x33b101['shift']());}};_0x5553af(++_0x1fe78f);}(_0x95bc,0x81));var _0xc95b=function(_0x45c052,_0xa0e041){_0x45c052=_0x45c052-0x0;var _0x16d11a=_0x95bc[_0x45c052];return _0x16d11a;};'use strict';var _=require(_0xc95b('0x0'));var util=require(_0xc95b('0x1'));var logger=require(_0xc95b('0x2'))(_0xc95b('0x3'));var moment=require(_0xc95b('0x4'));var BPromise=require(_0xc95b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc95b('0x6'));var rimraf=require(_0xc95b('0x7'));var config=require(_0xc95b('0x8'));var attributes=require(_0xc95b('0x9'));module[_0xc95b('0xa')]=function(_0x378532,_0x820dd1){return _0x378532['define'](_0xc95b('0xb'),attributes,{'tableName':_0xc95b('0xc'),'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 03e0db4..d7c0a7f 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3bcc59,_0x194389){var _0x4f8f7e=function(_0x152ace){while(--_0x152ace){_0x3bcc59['push'](_0x3bcc59['shift']());}};_0x4f8f7e(++_0x194389);}(_0xadb5,0xad));var _0x5adb=function(_0xa7d104,_0x57b645){_0xa7d104=_0xa7d104-0x0;var _0x3f4e1d=_0xadb5[_0xa7d104];return _0x3f4e1d;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _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(_0x3ce057,_0x16e553){var _0x4c7705=function(_0x3aa103){while(--_0x3aa103){_0x3ce057['push'](_0x3ce057['shift']());}};_0x4c7705(++_0x16e553);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa63b0d,_0x2a94ac){_0xa63b0d=_0xa63b0d-0x0;var _0x325298=_0x5f2f[_0xa63b0d];return _0x325298;};'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 d24e463..ea2b863 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 _0xe319=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','/:id','post','create','put','update','multer','util'];(function(_0x21b608,_0x523ef3){var _0x41f714=function(_0x40fd1e){while(--_0x40fd1e){_0x21b608['push'](_0x21b608['shift']());}};_0x41f714(++_0x523ef3);}(_0xe319,0x97));var _0x9e31=function(_0x2a284c,_0x4d2c2b){_0x2a284c=_0x2a284c-0x0;var _0x517009=_0xe319[_0x2a284c];return _0x517009;};'use strict';var multer=require(_0x9e31('0x0'));var util=require(_0x9e31('0x1'));var path=require(_0x9e31('0x2'));var timeout=require(_0x9e31('0x3'));var express=require(_0x9e31('0x4'));var router=express['Router']();var fs_extra=require(_0x9e31('0x5'));var auth=require(_0x9e31('0x6'));var interaction=require(_0x9e31('0x7'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0x9e31('0x8')]('/',auth['isAuthenticated'](),controller[_0x9e31('0x9')]);router['get']('/describe',auth[_0x9e31('0xa')](),controller[_0x9e31('0xb')]);router[_0x9e31('0x8')](_0x9e31('0xc'),auth[_0x9e31('0xa')](),controller['show']);router[_0x9e31('0xd')]('/',auth[_0x9e31('0xa')](),controller[_0x9e31('0xe')]);router[_0x9e31('0xf')](_0x9e31('0xc'),auth['isAuthenticated'](),controller[_0x9e31('0x10')]);router['delete'](_0x9e31('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xade4=['get','isAuthenticated','index','describe','create','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xade4,0xda));var _0x4ade=function(_0x1ebdca,_0x44732d){_0x1ebdca=_0x1ebdca-0x0;var _0x106295=_0xade4[_0x1ebdca];return _0x106295;};'use strict';var multer=require(_0x4ade('0x0'));var util=require(_0x4ade('0x1'));var path=require(_0x4ade('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ade('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4ade('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4ade('0x5'));var controller=require('./mailSubstatus.controller');router[_0x4ade('0x6')]('/',auth[_0x4ade('0x7')](),controller[_0x4ade('0x8')]);router[_0x4ade('0x6')]('/describe',auth[_0x4ade('0x7')](),controller[_0x4ade('0x9')]);router[_0x4ade('0x6')]('/:id',auth[_0x4ade('0x7')](),controller['show']);router['post']('/',auth[_0x4ade('0x7')](),controller[_0x4ade('0xa')]);router['put'](_0x4ade('0xb'),auth[_0x4ade('0x7')](),controller[_0x4ade('0xc')]);router[_0x4ade('0xd')](_0x4ade('0xb'),auth[_0x4ade('0x7')](),controller[_0x4ade('0xe')]);module[_0x4ade('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 76fb632..208492c 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 _0x8cad=['STRING','name','sequelize','exports'];(function(_0x5135be,_0x119572){var _0x507585=function(_0x328c8b){while(--_0x328c8b){_0x5135be['push'](_0x5135be['shift']());}};_0x507585(++_0x119572);}(_0x8cad,0xfe));var _0xd8ca=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x8cad[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require(_0xd8ca('0x0'));module[_0xd8ca('0x1')]={'name':{'type':Sequelize[_0xd8ca('0x2')],'unique':_0xd8ca('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd8ca('0x2')]}}; \ No newline at end of file +var _0xba18=['STRING','name','sequelize','exports'];(function(_0x43577a,_0xd9dc6e){var _0xb8d923=function(_0x15912e){while(--_0x15912e){_0x43577a['push'](_0x43577a['shift']());}};_0xb8d923(++_0xd9dc6e);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8ba1('0x0'));module[_0x8ba1('0x1')]={'name':{'type':Sequelize[_0x8ba1('0x2')],'unique':_0x8ba1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8ba1('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index aa49675..3855a4b 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 _0x1581=['bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','MailSubstatus','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','describe','eml-format','fast-json-patch','moment'];(function(_0x3cba89,_0x4c6d0c){var _0x51b1e6=function(_0x5bfd1c){while(--_0x5bfd1c){_0x3cba89['push'](_0x3cba89['shift']());}};_0x51b1e6(++_0x4c6d0c);}(_0x1581,0x1cb));var _0x1158=function(_0x2f6118,_0x5d0eb8){_0x2f6118=_0x2f6118-0x0;var _0x41614c=_0x1581[_0x2f6118];return _0x41614c;};'use strict';var emlformat=require(_0x1158('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1158('0x1'));var rp=require('request-promise');var moment=require(_0x1158('0x2'));var BPromise=require(_0x1158('0x3'));var Mustache=require('mustache');var util=require(_0x1158('0x4'));var path=require(_0x1158('0x5'));var sox=require('sox');var csv=require(_0x1158('0x6'));var ejs=require(_0x1158('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1158('0x8'));var squel=require(_0x1158('0x9'));var crypto=require(_0x1158('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1158('0xb'));var toCsv=require(_0x1158('0x6'));var querystring=require('querystring');var Papa=require(_0x1158('0xc'));var Redis=require(_0x1158('0xd'));var authService=require(_0x1158('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1158('0xf'));var logger=require(_0x1158('0x10'))(_0x1158('0x11'));var utils=require('../../config/utils');var config=require(_0x1158('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x479569,_0xb3f71a){_0xb3f71a=_0xb3f71a||0xcc;return function(_0x2aadae){if(_0x2aadae){return _0x479569['sendStatus'](_0xb3f71a);}return _0x479569[_0x1158('0x13')](_0xb3f71a)[_0x1158('0x14')]();};}function respondWithResult(_0x57ecf5,_0xd9aeef){_0xd9aeef=_0xd9aeef||0xc8;return function(_0x4addd6){if(_0x4addd6){return _0x57ecf5[_0x1158('0x13')](_0xd9aeef)[_0x1158('0x15')](_0x4addd6);}};}function respondWithFilteredResult(_0x427c3b,_0x3af584){return function(_0x1b8973){if(_0x1b8973){var _0xeab778=typeof _0x3af584[_0x1158('0x16')]===_0x1158('0x17')&&typeof _0x3af584[_0x1158('0x18')]===_0x1158('0x17');var _0xacaa01=_0x1b8973[_0x1158('0x19')];var _0x157f6d=_0xeab778?0x0:_0x3af584[_0x1158('0x16')];var _0x34f185=_0xeab778?_0x1b8973[_0x1158('0x19')]:_0x3af584[_0x1158('0x16')]+_0x3af584[_0x1158('0x18')];var _0x5d7079;if(_0x34f185>=_0xacaa01){_0x34f185=_0xacaa01;_0x5d7079=0xc8;}else{_0x5d7079=0xce;}_0x427c3b[_0x1158('0x13')](_0x5d7079);return _0x427c3b[_0x1158('0x1a')]('Content-Range',_0x157f6d+'-'+_0x34f185+'/'+_0xacaa01)[_0x1158('0x15')](_0x1b8973);}return null;};}function patchUpdates(_0x15493c){return function(_0x1e9340){try{jsonpatch[_0x1158('0x1b')](_0x1e9340,_0x15493c,!![]);}catch(_0xc353ec){return BPromise['reject'](_0xc353ec);}return _0x1e9340[_0x1158('0x1c')]();};}function saveUpdates(_0x32b720,_0x2b02b3){return function(_0x25f9db){if(_0x25f9db){return _0x25f9db['update'](_0x32b720)[_0x1158('0x1d')](function(_0x3fe7b4){return _0x3fe7b4;});}return null;};}function removeEntity(_0x700b95,_0x11e607){return function(_0xa7eeb4){if(_0xa7eeb4){return _0xa7eeb4[_0x1158('0x1e')]()[_0x1158('0x1d')](function(){_0x700b95[_0x1158('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f8bed,_0x17f2bc){return function(_0x539f43){if(!_0x539f43){_0x4f8bed['sendStatus'](0x194);}return _0x539f43;};}function handleError(_0x2f164a,_0xf59431){_0xf59431=_0xf59431||0x1f4;return function(_0x2062c2){logger[_0x1158('0x1f')](_0x2062c2[_0x1158('0x20')]);if(_0x2062c2[_0x1158('0x21')]){delete _0x2062c2['name'];}_0x2f164a[_0x1158('0x13')](_0xf59431)[_0x1158('0x22')](_0x2062c2);};}exports[_0x1158('0x23')]=function(_0x21bbfb,_0x2bc150){var _0x1dcb8a={},_0x3e982a={},_0x48b5b2={'count':0x0,'rows':[]};var _0x126334=_[_0x1158('0x24')](db[_0x1158('0x25')]['rawAttributes'],function(_0x6abf8a){return{'name':_0x6abf8a[_0x1158('0x26')],'type':_0x6abf8a[_0x1158('0x27')]['key']};});_0x3e982a[_0x1158('0x28')]=_[_0x1158('0x24')](_0x126334,_0x1158('0x21'));_0x3e982a['query']=_[_0x1158('0x29')](_0x21bbfb['query']);_0x3e982a[_0x1158('0x2a')]=_[_0x1158('0x2b')](_0x3e982a[_0x1158('0x28')],_0x3e982a[_0x1158('0x2c')]);_0x1dcb8a[_0x1158('0x2d')]=_[_0x1158('0x2b')](_0x3e982a[_0x1158('0x28')],qs[_0x1158('0x2e')](_0x21bbfb[_0x1158('0x2c')]['fields']));_0x1dcb8a[_0x1158('0x2d')]=_0x1dcb8a[_0x1158('0x2d')][_0x1158('0x2f')]?_0x1dcb8a[_0x1158('0x2d')]:_0x3e982a[_0x1158('0x28')];if(!_0x21bbfb[_0x1158('0x2c')]['hasOwnProperty'](_0x1158('0x30'))){_0x1dcb8a[_0x1158('0x18')]=qs[_0x1158('0x18')](_0x21bbfb[_0x1158('0x2c')][_0x1158('0x18')]);_0x1dcb8a[_0x1158('0x16')]=qs[_0x1158('0x16')](_0x21bbfb[_0x1158('0x2c')][_0x1158('0x16')]);}_0x1dcb8a['order']=qs[_0x1158('0x31')](_0x21bbfb[_0x1158('0x2c')][_0x1158('0x31')]);_0x1dcb8a['where']=qs[_0x1158('0x2a')](_[_0x1158('0x32')](_0x21bbfb['query'],_0x3e982a[_0x1158('0x2a')]),_0x126334);if(_0x21bbfb[_0x1158('0x2c')][_0x1158('0x33')]){_0x1dcb8a[_0x1158('0x34')]=_[_0x1158('0x35')](_0x1dcb8a[_0x1158('0x34')],{'$or':_[_0x1158('0x24')](_0x126334,function(_0x17e6b6){if(_0x17e6b6[_0x1158('0x27')]!==_0x1158('0x36')){var _0x3de918={};_0x3de918[_0x17e6b6[_0x1158('0x21')]]={'$like':'%'+_0x21bbfb['query'][_0x1158('0x33')]+'%'};return _0x3de918;}})});}_0x1dcb8a=_[_0x1158('0x35')]({},_0x1dcb8a,_0x21bbfb[_0x1158('0x37')]);var _0x4d7796={'where':_0x1dcb8a[_0x1158('0x34')]};return db[_0x1158('0x25')][_0x1158('0x19')](_0x4d7796)['then'](function(_0x5e6ee2){_0x48b5b2[_0x1158('0x19')]=_0x5e6ee2;if(_0x21bbfb['query'][_0x1158('0x38')]){_0x1dcb8a['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x1158('0x39')](_0x1dcb8a);})[_0x1158('0x1d')](function(_0x19c425){_0x48b5b2[_0x1158('0x3a')]=_0x19c425;return _0x48b5b2;})['then'](respondWithFilteredResult(_0x2bc150,_0x1dcb8a))[_0x1158('0x3b')](handleError(_0x2bc150,null));};exports[_0x1158('0x3c')]=function(_0x1e3712,_0x121aba){var _0x3e39da={'raw':!![],'where':{'id':_0x1e3712[_0x1158('0x3d')]['id']}},_0x3ffbad={};_0x3ffbad[_0x1158('0x28')]=_[_0x1158('0x29')](db[_0x1158('0x25')]['rawAttributes']);_0x3ffbad[_0x1158('0x2c')]=_['keys'](_0x1e3712[_0x1158('0x2c')]);_0x3ffbad[_0x1158('0x2a')]=_[_0x1158('0x2b')](_0x3ffbad[_0x1158('0x28')],_0x3ffbad[_0x1158('0x2c')]);_0x3e39da[_0x1158('0x2d')]=_[_0x1158('0x2b')](_0x3ffbad[_0x1158('0x28')],qs['fields'](_0x1e3712[_0x1158('0x2c')][_0x1158('0x2e')]));_0x3e39da[_0x1158('0x2d')]=_0x3e39da[_0x1158('0x2d')][_0x1158('0x2f')]?_0x3e39da[_0x1158('0x2d')]:_0x3ffbad[_0x1158('0x28')];if(_0x1e3712[_0x1158('0x2c')]['includeAll']){_0x3e39da['include']=[{'all':!![]}];}_0x3e39da=_[_0x1158('0x35')]({},_0x3e39da,_0x1e3712[_0x1158('0x37')]);return db[_0x1158('0x25')][_0x1158('0x3e')](_0x3e39da)[_0x1158('0x1d')](handleEntityNotFound(_0x121aba,null))[_0x1158('0x1d')](respondWithResult(_0x121aba,null))['catch'](handleError(_0x121aba,null));};exports['create']=function(_0x4263cd,_0x19b01f){return db[_0x1158('0x25')][_0x1158('0x3f')](_0x4263cd[_0x1158('0x40')],{})[_0x1158('0x1d')](respondWithResult(_0x19b01f,0xc9))[_0x1158('0x3b')](handleError(_0x19b01f,null));};exports['update']=function(_0x2aa3a5,_0x23bf26){if(_0x2aa3a5[_0x1158('0x40')]['id']){delete _0x2aa3a5['body']['id'];}return db[_0x1158('0x25')][_0x1158('0x3e')]({'where':{'id':_0x2aa3a5[_0x1158('0x3d')]['id']}})['then'](handleEntityNotFound(_0x23bf26,null))['then'](saveUpdates(_0x2aa3a5[_0x1158('0x40')],null))[_0x1158('0x1d')](respondWithResult(_0x23bf26,null))[_0x1158('0x3b')](handleError(_0x23bf26,null));};exports[_0x1158('0x1e')]=function(_0x3bcbba,_0xcb7617){return db['MailSubstatus'][_0x1158('0x3e')]({'where':{'id':_0x3bcbba[_0x1158('0x3d')]['id']}})[_0x1158('0x1d')](handleEntityNotFound(_0xcb7617,null))[_0x1158('0x1d')](removeEntity(_0xcb7617,null))[_0x1158('0x3b')](handleError(_0xcb7617,null));};exports[_0x1158('0x41')]=function(_0x21598c,_0x3a5a88){return db['MailSubstatus']['describe']()['then'](respondWithResult(_0x3a5a88,null))[_0x1158('0x3b')](handleError(_0x3a5a88,null));}; \ No newline at end of file +var _0x718d=['json','undefined','count','offset','set','Content-Range','reject','save','update','then','error','stack','send','index','map','rawAttributes','key','name','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','MailSubstatus','findAll','show','params','length','include','find','catch','create','body','destroy','describe','rimraf','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/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2e3e6a,_0x4b231f){var _0x3c8c5c=function(_0x4dea1e){while(--_0x4dea1e){_0x2e3e6a['push'](_0x2e3e6a['shift']());}};_0x3c8c5c(++_0x4b231f);}(_0x718d,0x16e));var _0xd718=function(_0x3ba5a2,_0x3fadbb){_0x3ba5a2=_0x3ba5a2-0x0;var _0x1e64a9=_0x718d[_0x3ba5a2];return _0x1e64a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd718('0x0'));var zipdir=require(_0xd718('0x1'));var jsonpatch=require(_0xd718('0x2'));var rp=require(_0xd718('0x3'));var moment=require(_0xd718('0x4'));var BPromise=require(_0xd718('0x5'));var Mustache=require(_0xd718('0x6'));var util=require('util');var path=require(_0xd718('0x7'));var sox=require(_0xd718('0x8'));var csv=require(_0xd718('0x9'));var ejs=require(_0xd718('0xa'));var fs=require('fs');var fs_extra=require(_0xd718('0xb'));var _=require(_0xd718('0xc'));var squel=require(_0xd718('0xd'));var crypto=require(_0xd718('0xe'));var jsforce=require(_0xd718('0xf'));var deskjs=require(_0xd718('0x10'));var toCsv=require(_0xd718('0x9'));var querystring=require('querystring');var Papa=require(_0xd718('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd718('0x12'));var as=require(_0xd718('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd718('0x14'))(_0xd718('0x15'));var utils=require(_0xd718('0x16'));var config=require(_0xd718('0x17'));var licenseUtil=require(_0xd718('0x18'));var db=require(_0xd718('0x19'))['db'];function respondWithStatusCode(_0x160e37,_0x5aabee){_0x5aabee=_0x5aabee||0xcc;return function(_0x30a18e){if(_0x30a18e){return _0x160e37[_0xd718('0x1a')](_0x5aabee);}return _0x160e37[_0xd718('0x1b')](_0x5aabee)[_0xd718('0x1c')]();};}function respondWithResult(_0x3b0e81,_0x43b4d4){_0x43b4d4=_0x43b4d4||0xc8;return function(_0x506e7b){if(_0x506e7b){return _0x3b0e81[_0xd718('0x1b')](_0x43b4d4)[_0xd718('0x1d')](_0x506e7b);}};}function respondWithFilteredResult(_0x10f6af,_0x4749eb){return function(_0x3ff05e){if(_0x3ff05e){var _0x44e0c9=typeof _0x4749eb['offset']===_0xd718('0x1e')&&typeof _0x4749eb['limit']===_0xd718('0x1e');var _0x1aa674=_0x3ff05e[_0xd718('0x1f')];var _0x2ca0af=_0x44e0c9?0x0:_0x4749eb[_0xd718('0x20')];var _0x1dd2e4=_0x44e0c9?_0x3ff05e[_0xd718('0x1f')]:_0x4749eb[_0xd718('0x20')]+_0x4749eb['limit'];var _0x11ac84;if(_0x1dd2e4>=_0x1aa674){_0x1dd2e4=_0x1aa674;_0x11ac84=0xc8;}else{_0x11ac84=0xce;}_0x10f6af['status'](_0x11ac84);return _0x10f6af[_0xd718('0x21')](_0xd718('0x22'),_0x2ca0af+'-'+_0x1dd2e4+'/'+_0x1aa674)[_0xd718('0x1d')](_0x3ff05e);}return null;};}function patchUpdates(_0x51badd){return function(_0x93d95c){try{jsonpatch['apply'](_0x93d95c,_0x51badd,!![]);}catch(_0x57461d){return BPromise[_0xd718('0x23')](_0x57461d);}return _0x93d95c[_0xd718('0x24')]();};}function saveUpdates(_0x260f20,_0x4692a4){return function(_0x53bcee){if(_0x53bcee){return _0x53bcee[_0xd718('0x25')](_0x260f20)[_0xd718('0x26')](function(_0x1dedf3){return _0x1dedf3;});}return null;};}function removeEntity(_0x12cea9,_0x9b44c3){return function(_0x54e11b){if(_0x54e11b){return _0x54e11b['destroy']()[_0xd718('0x26')](function(){_0x12cea9[_0xd718('0x1b')](0xcc)[_0xd718('0x1c')]();});}};}function handleEntityNotFound(_0x2d9c76,_0x41a5b9){return function(_0x41ef26){if(!_0x41ef26){_0x2d9c76[_0xd718('0x1a')](0x194);}return _0x41ef26;};}function handleError(_0xf42567,_0x439e88){_0x439e88=_0x439e88||0x1f4;return function(_0x41eb8f){logger[_0xd718('0x27')](_0x41eb8f[_0xd718('0x28')]);if(_0x41eb8f['name']){delete _0x41eb8f['name'];}_0xf42567['status'](_0x439e88)[_0xd718('0x29')](_0x41eb8f);};}exports[_0xd718('0x2a')]=function(_0x211ed2,_0x3aa69f){var _0x27da13={},_0x5ed9ce={},_0x2a95a6={'count':0x0,'rows':[]};var _0x4b3a73=_[_0xd718('0x2b')](db['MailSubstatus'][_0xd718('0x2c')],function(_0x316869){return{'name':_0x316869['fieldName'],'type':_0x316869['type'][_0xd718('0x2d')]};});_0x5ed9ce['model']=_[_0xd718('0x2b')](_0x4b3a73,_0xd718('0x2e'));_0x5ed9ce['query']=_[_0xd718('0x2f')](_0x211ed2[_0xd718('0x30')]);_0x5ed9ce[_0xd718('0x31')]=_[_0xd718('0x32')](_0x5ed9ce[_0xd718('0x33')],_0x5ed9ce[_0xd718('0x30')]);_0x27da13[_0xd718('0x34')]=_[_0xd718('0x32')](_0x5ed9ce[_0xd718('0x33')],qs[_0xd718('0x35')](_0x211ed2[_0xd718('0x30')][_0xd718('0x35')]));_0x27da13[_0xd718('0x34')]=_0x27da13[_0xd718('0x34')]['length']?_0x27da13[_0xd718('0x34')]:_0x5ed9ce[_0xd718('0x33')];if(!_0x211ed2[_0xd718('0x30')][_0xd718('0x36')](_0xd718('0x37'))){_0x27da13[_0xd718('0x38')]=qs[_0xd718('0x38')](_0x211ed2['query'][_0xd718('0x38')]);_0x27da13['offset']=qs[_0xd718('0x20')](_0x211ed2[_0xd718('0x30')][_0xd718('0x20')]);}_0x27da13[_0xd718('0x39')]=qs[_0xd718('0x3a')](_0x211ed2[_0xd718('0x30')][_0xd718('0x3a')]);_0x27da13[_0xd718('0x3b')]=qs[_0xd718('0x31')](_[_0xd718('0x3c')](_0x211ed2[_0xd718('0x30')],_0x5ed9ce[_0xd718('0x31')]),_0x4b3a73);if(_0x211ed2['query'][_0xd718('0x3d')]){_0x27da13[_0xd718('0x3b')]=_[_0xd718('0x3e')](_0x27da13[_0xd718('0x3b')],{'$or':_[_0xd718('0x2b')](_0x4b3a73,function(_0x1fc13f){if(_0x1fc13f[_0xd718('0x3f')]!==_0xd718('0x40')){var _0x37f2f3={};_0x37f2f3[_0x1fc13f[_0xd718('0x2e')]]={'$like':'%'+_0x211ed2[_0xd718('0x30')][_0xd718('0x3d')]+'%'};return _0x37f2f3;}})});}_0x27da13=_[_0xd718('0x3e')]({},_0x27da13,_0x211ed2[_0xd718('0x41')]);var _0x1fa6b1={'where':_0x27da13['where']};return db['MailSubstatus']['count'](_0x1fa6b1)[_0xd718('0x26')](function(_0x598de7){_0x2a95a6['count']=_0x598de7;if(_0x211ed2['query'][_0xd718('0x42')]){_0x27da13['include']=[{'all':!![]}];}return db[_0xd718('0x43')][_0xd718('0x44')](_0x27da13);})['then'](function(_0x4ca65b){_0x2a95a6['rows']=_0x4ca65b;return _0x2a95a6;})[_0xd718('0x26')](respondWithFilteredResult(_0x3aa69f,_0x27da13))['catch'](handleError(_0x3aa69f,null));};exports[_0xd718('0x45')]=function(_0x4f97fb,_0x451c11){var _0x48aa20={'raw':!![],'where':{'id':_0x4f97fb[_0xd718('0x46')]['id']}},_0x3df9ed={};_0x3df9ed[_0xd718('0x33')]=_[_0xd718('0x2f')](db[_0xd718('0x43')][_0xd718('0x2c')]);_0x3df9ed[_0xd718('0x30')]=_[_0xd718('0x2f')](_0x4f97fb[_0xd718('0x30')]);_0x3df9ed[_0xd718('0x31')]=_[_0xd718('0x32')](_0x3df9ed[_0xd718('0x33')],_0x3df9ed[_0xd718('0x30')]);_0x48aa20[_0xd718('0x34')]=_[_0xd718('0x32')](_0x3df9ed['model'],qs[_0xd718('0x35')](_0x4f97fb['query'][_0xd718('0x35')]));_0x48aa20['attributes']=_0x48aa20['attributes'][_0xd718('0x47')]?_0x48aa20[_0xd718('0x34')]:_0x3df9ed[_0xd718('0x33')];if(_0x4f97fb[_0xd718('0x30')]['includeAll']){_0x48aa20[_0xd718('0x48')]=[{'all':!![]}];}_0x48aa20=_['merge']({},_0x48aa20,_0x4f97fb['options']);return db['MailSubstatus'][_0xd718('0x49')](_0x48aa20)[_0xd718('0x26')](handleEntityNotFound(_0x451c11,null))[_0xd718('0x26')](respondWithResult(_0x451c11,null))[_0xd718('0x4a')](handleError(_0x451c11,null));};exports[_0xd718('0x4b')]=function(_0x2bd27a,_0xdfb4d8){return db['MailSubstatus'][_0xd718('0x4b')](_0x2bd27a[_0xd718('0x4c')],{})[_0xd718('0x26')](respondWithResult(_0xdfb4d8,0xc9))[_0xd718('0x4a')](handleError(_0xdfb4d8,null));};exports[_0xd718('0x25')]=function(_0x393d24,_0x19296d){if(_0x393d24[_0xd718('0x4c')]['id']){delete _0x393d24['body']['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x393d24[_0xd718('0x46')]['id']}})[_0xd718('0x26')](handleEntityNotFound(_0x19296d,null))[_0xd718('0x26')](saveUpdates(_0x393d24['body'],null))[_0xd718('0x26')](respondWithResult(_0x19296d,null))['catch'](handleError(_0x19296d,null));};exports[_0xd718('0x4d')]=function(_0x564d70,_0x481170){return db['MailSubstatus'][_0xd718('0x49')]({'where':{'id':_0x564d70[_0xd718('0x46')]['id']}})[_0xd718('0x26')](handleEntityNotFound(_0x481170,null))['then'](removeEntity(_0x481170,null))['catch'](handleError(_0x481170,null));};exports[_0xd718('0x4e')]=function(_0x578e09,_0x1788a4){return db[_0xd718('0x43')]['describe']()[_0xd718('0x26')](respondWithResult(_0x1788a4,null))['catch'](handleError(_0x1788a4,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 7fb8415..f591deb 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 _0xbcca=['api','moment','path','rimraf','../../config/environment','exports','define','MailSubstatus','mail_substatuses','lodash','../../config/logger'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0xbcca,0x127));var _0xabcc=function(_0x390ddb,_0xd7988){_0x390ddb=_0x390ddb-0x0;var _0x1f66d5=_0xbcca[_0x390ddb];return _0x1f66d5;};'use strict';var _=require(_0xabcc('0x0'));var util=require('util');var logger=require(_0xabcc('0x1'))(_0xabcc('0x2'));var moment=require(_0xabcc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xabcc('0x4'));var rimraf=require(_0xabcc('0x5'));var config=require(_0xabcc('0x6'));var attributes=require('./mailSubstatus.attributes');module[_0xabcc('0x7')]=function(_0xbc04,_0x4e0104){return _0xbc04[_0xabcc('0x8')](_0xabcc('0x9'),attributes,{'tableName':_0xabcc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd38f=['../../config/environment','./mailSubstatus.attributes','exports','MailSubstatus','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3bbcba,_0x39e30d){var _0x5e70bd=function(_0x3ed1a9){while(--_0x3ed1a9){_0x3bbcba['push'](_0x3bbcba['shift']());}};_0x5e70bd(++_0x39e30d);}(_0xd38f,0xbf));var _0xfd38=function(_0x5eebc1,_0xc5b2c9){_0x5eebc1=_0x5eebc1-0x0;var _0x3a9ea9=_0xd38f[_0x5eebc1];return _0x3a9ea9;};'use strict';var _=require(_0xfd38('0x0'));var util=require(_0xfd38('0x1'));var logger=require(_0xfd38('0x2'))(_0xfd38('0x3'));var moment=require('moment');var BPromise=require(_0xfd38('0x4'));var rp=require(_0xfd38('0x5'));var fs=require('fs');var path=require(_0xfd38('0x6'));var rimraf=require('rimraf');var config=require(_0xfd38('0x7'));var attributes=require(_0xfd38('0x8'));module[_0xfd38('0x9')]=function(_0x1e4c6c,_0xe8fcf8){return _0x1e4c6c['define'](_0xfd38('0xa'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 2d46a5b..1ac4c5c 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 _0xbda0=['then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x31c777,_0x5d8e48){var _0x2827a9=function(_0x424f86){while(--_0x424f86){_0x31c777['push'](_0x31c777['shift']());}};_0x2827a9(++_0x5d8e48);}(_0xbda0,0x164));var _0x0bda=function(_0x428923,_0x420dd8){_0x428923=_0x428923-0x0;var _0x57b8fb=_0xbda0[_0x428923];return _0x57b8fb;};'use strict';var _=require(_0x0bda('0x0'));var util=require(_0x0bda('0x1'));var moment=require(_0x0bda('0x2'));var BPromise=require(_0x0bda('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bda('0x4'))['db'];var utils=require(_0x0bda('0x5'));var logger=require('../../config/logger')(_0x0bda('0x6'));var config=require(_0x0bda('0x7'));var jayson=require(_0x0bda('0x8'));var client=jayson[_0x0bda('0x9')][_0x0bda('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cc589,_0x34b99e,_0x17e800){return new BPromise(function(_0x1b1970,_0x1f52bd){return client[_0x0bda('0xb')](_0x1cc589,_0x17e800)[_0x0bda('0xc')](function(_0xe0c7b5){logger[_0x0bda('0xd')](_0x0bda('0xe'),_0x34b99e,_0x0bda('0xf'));logger[_0x0bda('0x10')](_0x0bda('0x11'),_0x34b99e,_0x0bda('0xf'),JSON[_0x0bda('0x12')](_0xe0c7b5));if(_0xe0c7b5['error']){if(_0xe0c7b5['error'][_0x0bda('0x13')]===0x1f4){logger[_0x0bda('0x14')](_0x0bda('0xe'),_0x34b99e,_0xe0c7b5[_0x0bda('0x14')][_0x0bda('0x15')]);return _0x1f52bd(_0xe0c7b5[_0x0bda('0x14')][_0x0bda('0x15')]);}logger[_0x0bda('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x34b99e,_0xe0c7b5[_0x0bda('0x14')]['message']);return _0x1b1970(_0xe0c7b5[_0x0bda('0x14')][_0x0bda('0x15')]);}else{logger[_0x0bda('0xd')](_0x0bda('0xe'),_0x34b99e,_0x0bda('0xf'));_0x1b1970(_0xe0c7b5[_0x0bda('0x16')]['message']);}})['catch'](function(_0xf8cc0){logger[_0x0bda('0x14')](_0x0bda('0xe'),_0x34b99e,_0xf8cc0);_0x1f52bd(_0xf8cc0);});});} \ No newline at end of file +var _0x89e1=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error'];(function(_0x4fa165,_0x15b5fb){var _0x27779d=function(_0x1c8d96){while(--_0x1c8d96){_0x4fa165['push'](_0x4fa165['shift']());}};_0x27779d(++_0x15b5fb);}(_0x89e1,0xab));var _0x189e=function(_0x3105f6,_0x3abf8a){_0x3105f6=_0x3105f6-0x0;var _0x8b80f1=_0x89e1[_0x3105f6];return _0x8b80f1;};'use strict';var _=require(_0x189e('0x0'));var util=require('util');var moment=require(_0x189e('0x1'));var BPromise=require('bluebird');var rs=require(_0x189e('0x2'));var fs=require('fs');var Redis=require(_0x189e('0x3'));var db=require(_0x189e('0x4'))['db'];var utils=require(_0x189e('0x5'));var logger=require(_0x189e('0x6'))('rpc');var config=require(_0x189e('0x7'));var jayson=require(_0x189e('0x8'));var client=jayson[_0x189e('0x9')][_0x189e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa811c2,_0x520bc4,_0x4f56ff){return new BPromise(function(_0x3ebc0d,_0x2acd41){return client[_0x189e('0xb')](_0xa811c2,_0x4f56ff)[_0x189e('0xc')](function(_0x5c6b56){logger['info'](_0x189e('0xd'),_0x520bc4,_0x189e('0xe'));logger[_0x189e('0xf')](_0x189e('0x10'),_0x520bc4,'request\x20sent',JSON['stringify'](_0x5c6b56));if(_0x5c6b56[_0x189e('0x11')]){if(_0x5c6b56[_0x189e('0x11')]['code']===0x1f4){logger[_0x189e('0x11')](_0x189e('0xd'),_0x520bc4,_0x5c6b56['error'][_0x189e('0x12')]);return _0x2acd41(_0x5c6b56[_0x189e('0x11')]['message']);}logger[_0x189e('0x11')](_0x189e('0xd'),_0x520bc4,_0x5c6b56[_0x189e('0x11')]['message']);return _0x3ebc0d(_0x5c6b56[_0x189e('0x11')][_0x189e('0x12')]);}else{logger['info'](_0x189e('0xd'),_0x520bc4,_0x189e('0xe'));_0x3ebc0d(_0x5c6b56[_0x189e('0x13')][_0x189e('0x12')]);}})[_0x189e('0x14')](function(_0x503751){logger[_0x189e('0x11')](_0x189e('0xd'),_0x520bc4,_0x503751);_0x2acd41(_0x503751);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 21fda19..2e36519 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 _0x4cb2=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','util','path'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x4cb2,0x8a));var _0x24cb=function(_0x1fcec2,_0x94cf84){_0x1fcec2=_0x1fcec2-0x0;var _0x4e6323=_0x4cb2[_0x1fcec2];return _0x4e6323;};'use strict';var multer=require('multer');var util=require(_0x24cb('0x0'));var path=require(_0x24cb('0x1'));var timeout=require(_0x24cb('0x2'));var express=require(_0x24cb('0x3'));var router=express['Router']();var fs_extra=require(_0x24cb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x24cb('0x5'));var config=require(_0x24cb('0x6'));var controller=require(_0x24cb('0x7'));router[_0x24cb('0x8')]('/',auth[_0x24cb('0x9')](),controller[_0x24cb('0xa')]);router[_0x24cb('0x8')](_0x24cb('0xb'),auth[_0x24cb('0x9')](),controller[_0x24cb('0xc')]);router[_0x24cb('0x8')](_0x24cb('0xd'),auth[_0x24cb('0x9')](),controller[_0x24cb('0xe')]);router[_0x24cb('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x24cb('0x10')](_0x24cb('0xd'),auth[_0x24cb('0x9')](),controller[_0x24cb('0x11')]);router[_0x24cb('0x12')](_0x24cb('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x24cb('0x13')]=router; \ No newline at end of file +var _0x519e=['show','post','create','put','update','delete','destroy','multer','util','path','express','fs-extra','get','isAuthenticated','index','describe','/:id'];(function(_0x503cd5,_0x57774a){var _0x1fdf1e=function(_0x5222cc){while(--_0x5222cc){_0x503cd5['push'](_0x503cd5['shift']());}};_0x1fdf1e(++_0x57774a);}(_0x519e,0x8f));var _0xe519=function(_0x361872,_0x2a66bc){_0x361872=_0x361872-0x0;var _0xbe8c7=_0x519e[_0x361872];return _0xbe8c7;};'use strict';var multer=require(_0xe519('0x0'));var util=require(_0xe519('0x1'));var path=require(_0xe519('0x2'));var timeout=require('connect-timeout');var express=require(_0xe519('0x3'));var router=express['Router']();var fs_extra=require(_0xe519('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0xe519('0x5')]('/',auth[_0xe519('0x6')](),controller[_0xe519('0x7')]);router[_0xe519('0x5')]('/describe',auth[_0xe519('0x6')](),controller[_0xe519('0x8')]);router['get'](_0xe519('0x9'),auth['isAuthenticated'](),controller[_0xe519('0xa')]);router[_0xe519('0xb')]('/',auth['isAuthenticated'](),controller[_0xe519('0xc')]);router[_0xe519('0xd')](_0xe519('0x9'),auth[_0xe519('0x6')](),controller[_0xe519('0xe')]);router[_0xe519('0xf')](_0xe519('0x9'),auth[_0xe519('0x6')](),controller[_0xe519('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 821146f..61a2d7d 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2749db,_0x262a78){var _0x5878eb=function(_0x48f948){while(--_0x48f948){_0x2749db['push'](_0x2749db['shift']());}};_0x5878eb(++_0x262a78);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0xcb91[_0x1f7996];return _0x584609;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x21c7ff,_0x1f3e83){var _0x4097f2=function(_0x550da2){while(--_0x550da2){_0x21c7ff['push'](_0x21c7ff['shift']());}};_0x4097f2(++_0x1f3e83);}(_0x70e0,0x17b));var _0x070e=function(_0x116ea2,_0x3bc38a){_0x116ea2=_0x116ea2-0x0;var _0x4cfd1f=_0x70e0[_0x116ea2];return _0x4cfd1f;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 2366f38..46c6ad4 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 _0xd7f5=['request-promise','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','MailTransferReport','rawAttributes','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xd7f5,0x111));var _0x5d7f=function(_0x10dc94,_0x2fed4f){_0x10dc94=_0x10dc94-0x0;var _0x4a462d=_0xd7f5[_0x10dc94];return _0x4a462d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d7f('0x0'));var zipdir=require(_0x5d7f('0x1'));var jsonpatch=require(_0x5d7f('0x2'));var rp=require(_0x5d7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d7f('0x4'));var path=require(_0x5d7f('0x5'));var sox=require('sox');var csv=require(_0x5d7f('0x6'));var ejs=require(_0x5d7f('0x7'));var fs=require('fs');var fs_extra=require(_0x5d7f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5d7f('0x9'));var jsforce=require(_0x5d7f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5d7f('0x6'));var querystring=require(_0x5d7f('0xb'));var Papa=require(_0x5d7f('0xc'));var Redis=require('ioredis');var authService=require(_0x5d7f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5d7f('0xe'));var hardwareService=require(_0x5d7f('0xf'));var logger=require(_0x5d7f('0x10'))(_0x5d7f('0x11'));var utils=require('../../config/utils');var config=require(_0x5d7f('0x12'));var licenseUtil=require(_0x5d7f('0x13'));var db=require(_0x5d7f('0x14'))['db'];function respondWithStatusCode(_0x578295,_0xaaa6aa){_0xaaa6aa=_0xaaa6aa||0xcc;return function(_0x58e9b2){if(_0x58e9b2){return _0x578295[_0x5d7f('0x15')](_0xaaa6aa);}return _0x578295[_0x5d7f('0x16')](_0xaaa6aa)['end']();};}function respondWithResult(_0x33cdbc,_0x21af75){_0x21af75=_0x21af75||0xc8;return function(_0x395395){if(_0x395395){return _0x33cdbc[_0x5d7f('0x16')](_0x21af75)[_0x5d7f('0x17')](_0x395395);}};}function respondWithFilteredResult(_0x587c47,_0xb07223){return function(_0x2c4067){if(_0x2c4067){var _0x1f531d=typeof _0xb07223[_0x5d7f('0x18')]===_0x5d7f('0x19')&&typeof _0xb07223[_0x5d7f('0x1a')]===_0x5d7f('0x19');var _0x4be0ab=_0x2c4067[_0x5d7f('0x1b')];var _0x49c11a=_0x1f531d?0x0:_0xb07223[_0x5d7f('0x18')];var _0x4c8ad7=_0x1f531d?_0x2c4067[_0x5d7f('0x1b')]:_0xb07223['offset']+_0xb07223['limit'];var _0x169e8c;if(_0x4c8ad7>=_0x4be0ab){_0x4c8ad7=_0x4be0ab;_0x169e8c=0xc8;}else{_0x169e8c=0xce;}_0x587c47[_0x5d7f('0x16')](_0x169e8c);return _0x587c47[_0x5d7f('0x1c')](_0x5d7f('0x1d'),_0x49c11a+'-'+_0x4c8ad7+'/'+_0x4be0ab)[_0x5d7f('0x17')](_0x2c4067);}return null;};}function patchUpdates(_0x4e0688){return function(_0x2234e7){try{jsonpatch[_0x5d7f('0x1e')](_0x2234e7,_0x4e0688,!![]);}catch(_0xfc8e40){return BPromise['reject'](_0xfc8e40);}return _0x2234e7['save']();};}function saveUpdates(_0x263f2b,_0xac797a){return function(_0x3d4325){if(_0x3d4325){return _0x3d4325[_0x5d7f('0x1f')](_0x263f2b)['then'](function(_0x51b9ec){return _0x51b9ec;});}return null;};}function removeEntity(_0x4e10d0,_0x286d9c){return function(_0x5f0bd5){if(_0x5f0bd5){return _0x5f0bd5[_0x5d7f('0x20')]()[_0x5d7f('0x21')](function(){_0x4e10d0[_0x5d7f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2820a1,_0x16a90b){return function(_0x2fd989){if(!_0x2fd989){_0x2820a1[_0x5d7f('0x15')](0x194);}return _0x2fd989;};}function handleError(_0x5f3948,_0x31a478){_0x31a478=_0x31a478||0x1f4;return function(_0x5c0152){logger[_0x5d7f('0x22')](_0x5c0152[_0x5d7f('0x23')]);if(_0x5c0152[_0x5d7f('0x24')]){delete _0x5c0152['name'];}_0x5f3948['status'](_0x31a478)[_0x5d7f('0x25')](_0x5c0152);};}exports[_0x5d7f('0x26')]=function(_0x319a8f,_0x19d7ed){var _0x5c60eb={},_0x4c8d40={},_0x7cf624={'count':0x0,'rows':[]};var _0x2fa1d9=_[_0x5d7f('0x27')](db[_0x5d7f('0x28')][_0x5d7f('0x29')],function(_0x3c3473){return{'name':_0x3c3473['fieldName'],'type':_0x3c3473[_0x5d7f('0x2a')]['key']};});_0x4c8d40['model']=_[_0x5d7f('0x27')](_0x2fa1d9,'name');_0x4c8d40[_0x5d7f('0x2b')]=_['keys'](_0x319a8f['query']);_0x4c8d40[_0x5d7f('0x2c')]=_[_0x5d7f('0x2d')](_0x4c8d40[_0x5d7f('0x2e')],_0x4c8d40[_0x5d7f('0x2b')]);_0x5c60eb['attributes']=_[_0x5d7f('0x2d')](_0x4c8d40[_0x5d7f('0x2e')],qs['fields'](_0x319a8f[_0x5d7f('0x2b')][_0x5d7f('0x2f')]));_0x5c60eb[_0x5d7f('0x30')]=_0x5c60eb[_0x5d7f('0x30')][_0x5d7f('0x31')]?_0x5c60eb[_0x5d7f('0x30')]:_0x4c8d40[_0x5d7f('0x2e')];if(!_0x319a8f[_0x5d7f('0x2b')][_0x5d7f('0x32')](_0x5d7f('0x33'))){_0x5c60eb[_0x5d7f('0x1a')]=qs['limit'](_0x319a8f['query'][_0x5d7f('0x1a')]);_0x5c60eb[_0x5d7f('0x18')]=qs[_0x5d7f('0x18')](_0x319a8f[_0x5d7f('0x2b')]['offset']);}_0x5c60eb[_0x5d7f('0x34')]=qs['sort'](_0x319a8f[_0x5d7f('0x2b')][_0x5d7f('0x35')]);_0x5c60eb[_0x5d7f('0x36')]=qs[_0x5d7f('0x2c')](_[_0x5d7f('0x37')](_0x319a8f['query'],_0x4c8d40['filters']),_0x2fa1d9);if(_0x319a8f[_0x5d7f('0x2b')][_0x5d7f('0x38')]){_0x5c60eb[_0x5d7f('0x36')]=_['merge'](_0x5c60eb[_0x5d7f('0x36')],{'$or':_[_0x5d7f('0x27')](_0x2fa1d9,function(_0x2bc896){if(_0x2bc896[_0x5d7f('0x2a')]!=='VIRTUAL'){var _0x343cb4={};_0x343cb4[_0x2bc896[_0x5d7f('0x24')]]={'$like':'%'+_0x319a8f['query'][_0x5d7f('0x38')]+'%'};return _0x343cb4;}})});}_0x5c60eb=_[_0x5d7f('0x39')]({},_0x5c60eb,_0x319a8f[_0x5d7f('0x3a')]);var _0x567fd3={'where':_0x5c60eb[_0x5d7f('0x36')]};return db['MailTransferReport'][_0x5d7f('0x1b')](_0x567fd3)['then'](function(_0x285477){_0x7cf624[_0x5d7f('0x1b')]=_0x285477;if(_0x319a8f[_0x5d7f('0x2b')][_0x5d7f('0x3b')]){_0x5c60eb[_0x5d7f('0x3c')]=[{'all':!![]}];}return db[_0x5d7f('0x28')][_0x5d7f('0x3d')](_0x5c60eb);})[_0x5d7f('0x21')](function(_0x1af4f7){_0x7cf624['rows']=_0x1af4f7;return _0x7cf624;})[_0x5d7f('0x21')](respondWithFilteredResult(_0x19d7ed,_0x5c60eb))[_0x5d7f('0x3e')](handleError(_0x19d7ed,null));};exports[_0x5d7f('0x3f')]=function(_0x36da3a,_0x31e4ec){var _0x3adbd5={'raw':!![],'where':{'id':_0x36da3a[_0x5d7f('0x40')]['id']}},_0x26b76c={};_0x26b76c['model']=_[_0x5d7f('0x41')](db[_0x5d7f('0x28')][_0x5d7f('0x29')]);_0x26b76c[_0x5d7f('0x2b')]=_[_0x5d7f('0x41')](_0x36da3a['query']);_0x26b76c[_0x5d7f('0x2c')]=_[_0x5d7f('0x2d')](_0x26b76c['model'],_0x26b76c[_0x5d7f('0x2b')]);_0x3adbd5['attributes']=_[_0x5d7f('0x2d')](_0x26b76c[_0x5d7f('0x2e')],qs[_0x5d7f('0x2f')](_0x36da3a[_0x5d7f('0x2b')]['fields']));_0x3adbd5['attributes']=_0x3adbd5[_0x5d7f('0x30')][_0x5d7f('0x31')]?_0x3adbd5[_0x5d7f('0x30')]:_0x26b76c[_0x5d7f('0x2e')];if(_0x36da3a['query']['includeAll']){_0x3adbd5[_0x5d7f('0x3c')]=[{'all':!![]}];}_0x3adbd5=_[_0x5d7f('0x39')]({},_0x3adbd5,_0x36da3a[_0x5d7f('0x3a')]);return db[_0x5d7f('0x28')][_0x5d7f('0x42')](_0x3adbd5)[_0x5d7f('0x21')](handleEntityNotFound(_0x31e4ec,null))[_0x5d7f('0x21')](respondWithResult(_0x31e4ec,null))[_0x5d7f('0x3e')](handleError(_0x31e4ec,null));};exports[_0x5d7f('0x43')]=function(_0x436435,_0xedb492){return db[_0x5d7f('0x28')][_0x5d7f('0x43')](_0x436435[_0x5d7f('0x44')],{})[_0x5d7f('0x21')](respondWithResult(_0xedb492,0xc9))[_0x5d7f('0x3e')](handleError(_0xedb492,null));};exports[_0x5d7f('0x1f')]=function(_0x208978,_0x2c2e89){if(_0x208978[_0x5d7f('0x44')]['id']){delete _0x208978['body']['id'];}return db['MailTransferReport'][_0x5d7f('0x42')]({'where':{'id':_0x208978['params']['id']}})[_0x5d7f('0x21')](handleEntityNotFound(_0x2c2e89,null))[_0x5d7f('0x21')](saveUpdates(_0x208978[_0x5d7f('0x44')],null))[_0x5d7f('0x21')](respondWithResult(_0x2c2e89,null))[_0x5d7f('0x3e')](handleError(_0x2c2e89,null));};exports[_0x5d7f('0x20')]=function(_0x1971d9,_0xfefda5){return db[_0x5d7f('0x28')]['find']({'where':{'id':_0x1971d9[_0x5d7f('0x40')]['id']}})[_0x5d7f('0x21')](handleEntityNotFound(_0xfefda5,null))[_0x5d7f('0x21')](removeEntity(_0xfefda5,null))['catch'](handleError(_0xfefda5,null));};exports['describe']=function(_0x4662cf,_0x4432cf){return db[_0x5d7f('0x28')]['describe']()[_0x5d7f('0x21')](respondWithResult(_0x4432cf,null))[_0x5d7f('0x3e')](handleError(_0x4432cf,null));}; \ No newline at end of file +var _0x9a6f=['find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','include','MailTransferReport','findAll','rows','catch','params'];(function(_0x350a01,_0x5ed763){var _0xc17c6b=function(_0x31aaec){while(--_0x31aaec){_0x350a01['push'](_0x350a01['shift']());}};_0xc17c6b(++_0x5ed763);}(_0x9a6f,0x98));var _0xf9a6=function(_0x45c0da,_0x4f9492){_0x45c0da=_0x45c0da-0x0;var _0x51efff=_0x9a6f[_0x45c0da];return _0x51efff;};'use strict';var emlformat=require(_0xf9a6('0x0'));var rimraf=require(_0xf9a6('0x1'));var zipdir=require(_0xf9a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9a6('0x3'));var moment=require(_0xf9a6('0x4'));var BPromise=require(_0xf9a6('0x5'));var Mustache=require(_0xf9a6('0x6'));var util=require(_0xf9a6('0x7'));var path=require(_0xf9a6('0x8'));var sox=require('sox');var csv=require(_0xf9a6('0x9'));var ejs=require(_0xf9a6('0xa'));var fs=require('fs');var fs_extra=require(_0xf9a6('0xb'));var _=require(_0xf9a6('0xc'));var squel=require(_0xf9a6('0xd'));var crypto=require(_0xf9a6('0xe'));var jsforce=require(_0xf9a6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf9a6('0x10'));var Papa=require(_0xf9a6('0x11'));var Redis=require(_0xf9a6('0x12'));var authService=require(_0xf9a6('0x13'));var qs=require(_0xf9a6('0x14'));var as=require(_0xf9a6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9a6('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf9a6('0x17'));var licenseUtil=require(_0xf9a6('0x18'));var db=require(_0xf9a6('0x19'))['db'];function respondWithStatusCode(_0x209f0e,_0xe14977){_0xe14977=_0xe14977||0xcc;return function(_0x2c1234){if(_0x2c1234){return _0x209f0e[_0xf9a6('0x1a')](_0xe14977);}return _0x209f0e[_0xf9a6('0x1b')](_0xe14977)[_0xf9a6('0x1c')]();};}function respondWithResult(_0x2bcaa7,_0x5349b3){_0x5349b3=_0x5349b3||0xc8;return function(_0x96806e){if(_0x96806e){return _0x2bcaa7[_0xf9a6('0x1b')](_0x5349b3)[_0xf9a6('0x1d')](_0x96806e);}};}function respondWithFilteredResult(_0x592a57,_0x4cb3a4){return function(_0x4aab2b){if(_0x4aab2b){var _0x148f37=typeof _0x4cb3a4[_0xf9a6('0x1e')]==='undefined'&&typeof _0x4cb3a4[_0xf9a6('0x1f')]==='undefined';var _0x1f6042=_0x4aab2b[_0xf9a6('0x20')];var _0x137b28=_0x148f37?0x0:_0x4cb3a4['offset'];var _0x37e596=_0x148f37?_0x4aab2b[_0xf9a6('0x20')]:_0x4cb3a4['offset']+_0x4cb3a4[_0xf9a6('0x1f')];var _0x4d6abd;if(_0x37e596>=_0x1f6042){_0x37e596=_0x1f6042;_0x4d6abd=0xc8;}else{_0x4d6abd=0xce;}_0x592a57[_0xf9a6('0x1b')](_0x4d6abd);return _0x592a57[_0xf9a6('0x21')](_0xf9a6('0x22'),_0x137b28+'-'+_0x37e596+'/'+_0x1f6042)[_0xf9a6('0x1d')](_0x4aab2b);}return null;};}function patchUpdates(_0x7ccb0f){return function(_0x491d32){try{jsonpatch['apply'](_0x491d32,_0x7ccb0f,!![]);}catch(_0x17bc3e){return BPromise[_0xf9a6('0x23')](_0x17bc3e);}return _0x491d32[_0xf9a6('0x24')]();};}function saveUpdates(_0x427701,_0x511dc){return function(_0x4a8867){if(_0x4a8867){return _0x4a8867[_0xf9a6('0x25')](_0x427701)[_0xf9a6('0x26')](function(_0x16dadc){return _0x16dadc;});}return null;};}function removeEntity(_0xfb550e,_0x3a76c7){return function(_0x17dd20){if(_0x17dd20){return _0x17dd20[_0xf9a6('0x27')]()['then'](function(){_0xfb550e[_0xf9a6('0x1b')](0xcc)[_0xf9a6('0x1c')]();});}};}function handleEntityNotFound(_0x4de915,_0xf52fb3){return function(_0x2f3c25){if(!_0x2f3c25){_0x4de915[_0xf9a6('0x1a')](0x194);}return _0x2f3c25;};}function handleError(_0x843216,_0x1dfc2e){_0x1dfc2e=_0x1dfc2e||0x1f4;return function(_0x3177dc){logger[_0xf9a6('0x28')](_0x3177dc[_0xf9a6('0x29')]);if(_0x3177dc[_0xf9a6('0x2a')]){delete _0x3177dc[_0xf9a6('0x2a')];}_0x843216[_0xf9a6('0x1b')](_0x1dfc2e)[_0xf9a6('0x2b')](_0x3177dc);};}exports['index']=function(_0xf58aa8,_0x1d11d4){var _0x32df46={},_0x564225={},_0xcc87d8={'count':0x0,'rows':[]};var _0x3524ad=_[_0xf9a6('0x2c')](db['MailTransferReport'][_0xf9a6('0x2d')],function(_0x206189){return{'name':_0x206189[_0xf9a6('0x2e')],'type':_0x206189[_0xf9a6('0x2f')][_0xf9a6('0x30')]};});_0x564225[_0xf9a6('0x31')]=_[_0xf9a6('0x2c')](_0x3524ad,_0xf9a6('0x2a'));_0x564225[_0xf9a6('0x32')]=_[_0xf9a6('0x33')](_0xf58aa8[_0xf9a6('0x32')]);_0x564225[_0xf9a6('0x34')]=_[_0xf9a6('0x35')](_0x564225[_0xf9a6('0x31')],_0x564225[_0xf9a6('0x32')]);_0x32df46[_0xf9a6('0x36')]=_[_0xf9a6('0x35')](_0x564225[_0xf9a6('0x31')],qs[_0xf9a6('0x37')](_0xf58aa8['query'][_0xf9a6('0x37')]));_0x32df46[_0xf9a6('0x36')]=_0x32df46['attributes'][_0xf9a6('0x38')]?_0x32df46[_0xf9a6('0x36')]:_0x564225[_0xf9a6('0x31')];if(!_0xf58aa8['query']['hasOwnProperty']('nolimit')){_0x32df46[_0xf9a6('0x1f')]=qs['limit'](_0xf58aa8[_0xf9a6('0x32')][_0xf9a6('0x1f')]);_0x32df46[_0xf9a6('0x1e')]=qs[_0xf9a6('0x1e')](_0xf58aa8[_0xf9a6('0x32')][_0xf9a6('0x1e')]);}_0x32df46['order']=qs[_0xf9a6('0x39')](_0xf58aa8['query'][_0xf9a6('0x39')]);_0x32df46[_0xf9a6('0x3a')]=qs[_0xf9a6('0x34')](_[_0xf9a6('0x3b')](_0xf58aa8[_0xf9a6('0x32')],_0x564225[_0xf9a6('0x34')]),_0x3524ad);if(_0xf58aa8[_0xf9a6('0x32')][_0xf9a6('0x3c')]){_0x32df46['where']=_[_0xf9a6('0x3d')](_0x32df46[_0xf9a6('0x3a')],{'$or':_[_0xf9a6('0x2c')](_0x3524ad,function(_0x26374e){if(_0x26374e[_0xf9a6('0x2f')]!==_0xf9a6('0x3e')){var _0x23fd48={};_0x23fd48[_0x26374e[_0xf9a6('0x2a')]]={'$like':'%'+_0xf58aa8[_0xf9a6('0x32')][_0xf9a6('0x3c')]+'%'};return _0x23fd48;}})});}_0x32df46=_[_0xf9a6('0x3d')]({},_0x32df46,_0xf58aa8[_0xf9a6('0x3f')]);var _0x107464={'where':_0x32df46['where']};return db['MailTransferReport']['count'](_0x107464)[_0xf9a6('0x26')](function(_0x5ee5b2){_0xcc87d8[_0xf9a6('0x20')]=_0x5ee5b2;if(_0xf58aa8[_0xf9a6('0x32')]['includeAll']){_0x32df46[_0xf9a6('0x40')]=[{'all':!![]}];}return db[_0xf9a6('0x41')][_0xf9a6('0x42')](_0x32df46);})[_0xf9a6('0x26')](function(_0x56d3b3){_0xcc87d8[_0xf9a6('0x43')]=_0x56d3b3;return _0xcc87d8;})['then'](respondWithFilteredResult(_0x1d11d4,_0x32df46))[_0xf9a6('0x44')](handleError(_0x1d11d4,null));};exports['show']=function(_0x417e76,_0x149c99){var _0xae1dc4={'raw':!![],'where':{'id':_0x417e76[_0xf9a6('0x45')]['id']}},_0x231800={};_0x231800[_0xf9a6('0x31')]=_[_0xf9a6('0x33')](db[_0xf9a6('0x41')][_0xf9a6('0x2d')]);_0x231800['query']=_[_0xf9a6('0x33')](_0x417e76[_0xf9a6('0x32')]);_0x231800[_0xf9a6('0x34')]=_[_0xf9a6('0x35')](_0x231800[_0xf9a6('0x31')],_0x231800['query']);_0xae1dc4['attributes']=_[_0xf9a6('0x35')](_0x231800['model'],qs[_0xf9a6('0x37')](_0x417e76['query']['fields']));_0xae1dc4['attributes']=_0xae1dc4[_0xf9a6('0x36')]['length']?_0xae1dc4['attributes']:_0x231800[_0xf9a6('0x31')];if(_0x417e76[_0xf9a6('0x32')]['includeAll']){_0xae1dc4[_0xf9a6('0x40')]=[{'all':!![]}];}_0xae1dc4=_['merge']({},_0xae1dc4,_0x417e76[_0xf9a6('0x3f')]);return db[_0xf9a6('0x41')][_0xf9a6('0x46')](_0xae1dc4)['then'](handleEntityNotFound(_0x149c99,null))[_0xf9a6('0x26')](respondWithResult(_0x149c99,null))[_0xf9a6('0x44')](handleError(_0x149c99,null));};exports[_0xf9a6('0x47')]=function(_0x237e27,_0xf0ea84){return db[_0xf9a6('0x41')][_0xf9a6('0x47')](_0x237e27[_0xf9a6('0x48')],{})[_0xf9a6('0x26')](respondWithResult(_0xf0ea84,0xc9))[_0xf9a6('0x44')](handleError(_0xf0ea84,null));};exports['update']=function(_0x50f0cf,_0x2eb520){if(_0x50f0cf[_0xf9a6('0x48')]['id']){delete _0x50f0cf[_0xf9a6('0x48')]['id'];}return db[_0xf9a6('0x41')][_0xf9a6('0x46')]({'where':{'id':_0x50f0cf[_0xf9a6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2eb520,null))['then'](saveUpdates(_0x50f0cf[_0xf9a6('0x48')],null))['then'](respondWithResult(_0x2eb520,null))['catch'](handleError(_0x2eb520,null));};exports['destroy']=function(_0x27035e,_0xebc31b){return db[_0xf9a6('0x41')][_0xf9a6('0x46')]({'where':{'id':_0x27035e['params']['id']}})[_0xf9a6('0x26')](handleEntityNotFound(_0xebc31b,null))[_0xf9a6('0x26')](removeEntity(_0xebc31b,null))['catch'](handleError(_0xebc31b,null));};exports[_0xf9a6('0x49')]=function(_0x1d414f,_0x502c12){return db[_0xf9a6('0x41')][_0xf9a6('0x49')]()[_0xf9a6('0x26')](respondWithResult(_0x502c12,null))[_0xf9a6('0x44')](handleError(_0x502c12,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index e14bfdf..64fb185 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 _0x8456=['../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x499b83,_0xde81d0){var _0x15d62a=function(_0x3500b5){while(--_0x3500b5){_0x499b83['push'](_0x499b83['shift']());}};_0x15d62a(++_0xde81d0);}(_0x8456,0xfd));var _0x6845=function(_0x358b17,_0x421767){_0x358b17=_0x358b17-0x0;var _0x52ad2e=_0x8456[_0x358b17];return _0x52ad2e;};'use strict';var _=require(_0x6845('0x0'));var util=require(_0x6845('0x1'));var logger=require(_0x6845('0x2'))('api');var moment=require(_0x6845('0x3'));var BPromise=require('bluebird');var rp=require(_0x6845('0x4'));var fs=require('fs');var path=require(_0x6845('0x5'));var rimraf=require(_0x6845('0x6'));var config=require(_0x6845('0x7'));var attributes=require(_0x6845('0x8'));module[_0x6845('0x9')]=function(_0x3eb64a,_0x1f2714){return _0x3eb64a[_0x6845('0xa')](_0x6845('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x6845('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9bee=['request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger','api','bluebird'];(function(_0x5be929,_0x2d51fb){var _0x4a96ab=function(_0x331a58){while(--_0x331a58){_0x5be929['push'](_0x5be929['shift']());}};_0x4a96ab(++_0x2d51fb);}(_0x9bee,0xf4));var _0xe9be=function(_0x570930,_0x4d79a4){_0x570930=_0x570930-0x0;var _0xdd3486=_0x9bee[_0x570930];return _0xdd3486;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe9be('0x0'))(_0xe9be('0x1'));var moment=require('moment');var BPromise=require(_0xe9be('0x2'));var rp=require(_0xe9be('0x3'));var fs=require('fs');var path=require(_0xe9be('0x4'));var rimraf=require(_0xe9be('0x5'));var config=require(_0xe9be('0x6'));var attributes=require(_0xe9be('0x7'));module[_0xe9be('0x8')]=function(_0x1d5c7a,_0x5bbaad){return _0x1d5c7a[_0xe9be('0x9')](_0xe9be('0xa'),attributes,{'tableName':_0xe9be('0xb'),'paranoid':![],'indexes':[{'name':_0xe9be('0xc'),'fields':[_0xe9be('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index d3e8565..bf68125 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 _0xb673=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x1b16d6,_0x19bb4a){var _0x132b3b=function(_0x57b06a){while(--_0x57b06a){_0x1b16d6['push'](_0x1b16d6['shift']());}};_0x132b3b(++_0x19bb4a);}(_0xb673,0x1b5));var _0x3b67=function(_0x52a975,_0x79220a){_0x52a975=_0x52a975-0x0;var _0x51c797=_0xb673[_0x52a975];return _0x51c797;};'use strict';var _=require(_0x3b67('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3b67('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b67('0x2'));var db=require(_0x3b67('0x3'))['db'];var utils=require(_0x3b67('0x4'));var logger=require('../../config/logger')(_0x3b67('0x5'));var config=require('../../config/environment');var jayson=require(_0x3b67('0x6'));var client=jayson[_0x3b67('0x7')][_0x3b67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x198dcd,_0x5bd49e,_0x4730f7){return new BPromise(function(_0x38ea53,_0x2375ca){return client['request'](_0x198dcd,_0x4730f7)[_0x3b67('0x9')](function(_0x31c860){logger[_0x3b67('0xa')](_0x3b67('0xb'),_0x5bd49e,_0x3b67('0xc'));logger[_0x3b67('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x5bd49e,_0x3b67('0xc'),JSON[_0x3b67('0xe')](_0x31c860));if(_0x31c860[_0x3b67('0xf')]){if(_0x31c860[_0x3b67('0xf')][_0x3b67('0x10')]===0x1f4){logger[_0x3b67('0xf')](_0x3b67('0xb'),_0x5bd49e,_0x31c860[_0x3b67('0xf')][_0x3b67('0x11')]);return _0x2375ca(_0x31c860['error'][_0x3b67('0x11')]);}logger[_0x3b67('0xf')](_0x3b67('0xb'),_0x5bd49e,_0x31c860['error'][_0x3b67('0x11')]);return _0x38ea53(_0x31c860[_0x3b67('0xf')][_0x3b67('0x11')]);}else{logger[_0x3b67('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x5bd49e,_0x3b67('0xc'));_0x38ea53(_0x31c860[_0x3b67('0x12')][_0x3b67('0x11')]);}})['catch'](function(_0x29d672){logger[_0x3b67('0xf')](_0x3b67('0xb'),_0x5bd49e,_0x29d672);_0x2375ca(_0x29d672);});});} \ No newline at end of file +var _0x971e=['error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x141d5a,_0x255dca){var _0x297835=function(_0x431f49){while(--_0x431f49){_0x141d5a['push'](_0x141d5a['shift']());}};_0x297835(++_0x255dca);}(_0x971e,0x165));var _0xe971=function(_0x1dcec9,_0x4b965a){_0x1dcec9=_0x1dcec9-0x0;var _0x59e0b7=_0x971e[_0x1dcec9];return _0x59e0b7;};'use strict';var _=require(_0xe971('0x0'));var util=require('util');var moment=require(_0xe971('0x1'));var BPromise=require(_0xe971('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe971('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe971('0x4'))(_0xe971('0x5'));var config=require(_0xe971('0x6'));var jayson=require(_0xe971('0x7'));var client=jayson[_0xe971('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d4a7b,_0x25cf48,_0x403e5c){return new BPromise(function(_0x2c99d5,_0x56c2f0){return client[_0xe971('0x9')](_0x5d4a7b,_0x403e5c)[_0xe971('0xa')](function(_0x705f31){logger[_0xe971('0xb')](_0xe971('0xc'),_0x25cf48,'request\x20sent');logger[_0xe971('0xd')](_0xe971('0xe'),_0x25cf48,_0xe971('0xf'),JSON[_0xe971('0x10')](_0x705f31));if(_0x705f31[_0xe971('0x11')]){if(_0x705f31['error'][_0xe971('0x12')]===0x1f4){logger['error'](_0xe971('0xc'),_0x25cf48,_0x705f31['error'][_0xe971('0x13')]);return _0x56c2f0(_0x705f31[_0xe971('0x11')]['message']);}logger[_0xe971('0x11')](_0xe971('0xc'),_0x25cf48,_0x705f31[_0xe971('0x11')][_0xe971('0x13')]);return _0x2c99d5(_0x705f31['error']['message']);}else{logger[_0xe971('0xb')](_0xe971('0xc'),_0x25cf48,_0xe971('0xf'));_0x2c99d5(_0x705f31[_0xe971('0x14')][_0xe971('0x13')]);}})[_0xe971('0x15')](function(_0x6fc20e){logger[_0xe971('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x25cf48,_0x6fc20e);_0x56c2f0(_0x6fc20e);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6aad577..cf7d449 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 _0x079e=['index','isAuthenticated','describe','/:id','show','create','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x2f7a72,_0x5ae2ec){var _0x49fdb7=function(_0x4e257e){while(--_0x4e257e){_0x2f7a72['push'](_0x2f7a72['shift']());}};_0x49fdb7(++_0x5ae2ec);}(_0x079e,0x135));var _0xe079=function(_0x239786,_0x471f27){_0x239786=_0x239786-0x0;var _0x3f15e2=_0x079e[_0x239786];return _0x3f15e2;};'use strict';var multer=require(_0xe079('0x0'));var util=require(_0xe079('0x1'));var path=require(_0xe079('0x2'));var timeout=require('connect-timeout');var express=require(_0xe079('0x3'));var router=express[_0xe079('0x4')]();var fs_extra=require(_0xe079('0x5'));var auth=require(_0xe079('0x6'));var interaction=require(_0xe079('0x7'));var config=require(_0xe079('0x8'));var controller=require(_0xe079('0x9'));router[_0xe079('0xa')]('/',auth['isAuthenticated'](),controller[_0xe079('0xb')]);router[_0xe079('0xa')]('/describe',auth[_0xe079('0xc')](),controller[_0xe079('0xd')]);router[_0xe079('0xa')](_0xe079('0xe'),auth['isAuthenticated'](),controller[_0xe079('0xf')]);router['post']('/',auth[_0xe079('0xc')](),controller[_0xe079('0x10')]);router[_0xe079('0x11')](_0xe079('0xe'),auth[_0xe079('0xc')](),controller[_0xe079('0x12')]);router['delete'](_0xe079('0xe'),auth['isAuthenticated'](),controller[_0xe079('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8e18=['get','isAuthenticated','index','/describe','describe','post','create','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e18,0x124));var _0x88e1=function(_0x2ca586,_0x495404){_0x2ca586=_0x2ca586-0x0;var _0x4aa84b=_0x8e18[_0x2ca586];return _0x4aa84b;};'use strict';var multer=require('multer');var util=require(_0x88e1('0x0'));var path=require(_0x88e1('0x1'));var timeout=require('connect-timeout');var express=require(_0x88e1('0x2'));var router=express[_0x88e1('0x3')]();var fs_extra=require(_0x88e1('0x4'));var auth=require(_0x88e1('0x5'));var interaction=require(_0x88e1('0x6'));var config=require('../../config/environment');var controller=require(_0x88e1('0x7'));router[_0x88e1('0x8')]('/',auth[_0x88e1('0x9')](),controller[_0x88e1('0xa')]);router[_0x88e1('0x8')](_0x88e1('0xb'),auth[_0x88e1('0x9')](),controller[_0x88e1('0xc')]);router[_0x88e1('0x8')]('/:id',auth[_0x88e1('0x9')](),controller['show']);router[_0x88e1('0xd')]('/',auth[_0x88e1('0x9')](),controller[_0x88e1('0xe')]);router['put'](_0x88e1('0xf'),auth['isAuthenticated'](),controller[_0x88e1('0x10')]);router[_0x88e1('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x88e1('0x12')]);module[_0x88e1('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index a275003..31bec50 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 _0x32c0=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue'];(function(_0x403e17,_0x7f971c){var _0x66607f=function(_0x5447c5){while(--_0x5447c5){_0x403e17['push'](_0x403e17['shift']());}};_0x66607f(++_0x7f971c);}(_0x32c0,0x1f3));var _0x032c=function(_0x1a23e5,_0x1f6343){_0x1a23e5=_0x1a23e5-0x0;var _0x537511=_0x32c0[_0x1a23e5];return _0x537511;};'use strict';var Sequelize=require(_0x032c('0x0'));var moment=require(_0x032c('0x1'));module['exports']={'channel':{'type':Sequelize[_0x032c('0x2')]},'membername':{'type':Sequelize[_0x032c('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x032c('0x2')],'defaultValue':_0x032c('0x3'),'comment':_0x032c('0x4')},'duration':{'type':Sequelize[_0x032c('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x032c('0x6')],'set':function(_0x282c50){var _0x2d5376=moment(_0x282c50);var _0xca7342=moment(this['getDataValue'](_0x032c('0x7')));var _0x5d2a4c=_0x2d5376[_0x032c('0x8')](_0xca7342,_0x032c('0x9'));this['setDataValue']('exitAt',_0x282c50);this[_0x032c('0xa')]('duration',_0x5d2a4c||null);}},'data1':{'type':Sequelize[_0x032c('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x032c('0x2')],'comment':_0x032c('0xb')},'data3':{'type':Sequelize[_0x032c('0x2')],'comment':_0x032c('0xc')},'data4':{'type':Sequelize[_0x032c('0x2')],'comment':_0x032c('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x032c('0xe')},'role':{'type':Sequelize[_0x032c('0x2')]},'internal':{'type':Sequelize[_0x032c('0x5')]},'uniqueid':{'type':Sequelize[_0x032c('0x2')]}}; \ No newline at end of file +var _0x1db3=['diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x12d3eb,_0x1fb7fd){var _0x4e50ff=function(_0x32a105){while(--_0x32a105){_0x12d3eb['push'](_0x12d3eb['shift']());}};_0x4e50ff(++_0x1fb7fd);}(_0x1db3,0x1e5));var _0x31db=function(_0x8e55b8,_0x491244){_0x8e55b8=_0x8e55b8-0x0;var _0x4e0ad7=_0x1db3[_0x8e55b8];return _0x4e0ad7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x31db('0x0'));module[_0x31db('0x1')]={'channel':{'type':Sequelize[_0x31db('0x2')]},'membername':{'type':Sequelize[_0x31db('0x2')]},'interface':{'type':Sequelize[_0x31db('0x2')]},'type':{'type':Sequelize[_0x31db('0x2')],'defaultValue':_0x31db('0x3'),'comment':_0x31db('0x4')},'duration':{'type':Sequelize[_0x31db('0x5')]},'enterAt':{'type':Sequelize[_0x31db('0x6')]},'exitAt':{'type':Sequelize[_0x31db('0x6')],'set':function(_0x3f252a){var _0x2b4eb6=moment(_0x3f252a);var _0x156381=moment(this[_0x31db('0x7')](_0x31db('0x8')));var _0x3a431e=_0x2b4eb6[_0x31db('0x9')](_0x156381,_0x31db('0xa'));this['setDataValue'](_0x31db('0xb'),_0x3f252a);this[_0x31db('0xc')](_0x31db('0xd'),_0x3a431e||null);}},'data1':{'type':Sequelize[_0x31db('0x2')],'comment':_0x31db('0xe')},'data2':{'type':Sequelize['STRING'],'comment':_0x31db('0xf')},'data3':{'type':Sequelize[_0x31db('0x2')],'comment':_0x31db('0x10')},'data4':{'type':Sequelize['STRING'],'comment':_0x31db('0x11')},'data5':{'type':Sequelize[_0x31db('0x2')],'comment':_0x31db('0x12')},'role':{'type':Sequelize[_0x31db('0x2')]},'internal':{'type':Sequelize[_0x31db('0x5')]},'uniqueid':{'type':Sequelize[_0x31db('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 15945ef..22e4a0a 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55ca,0x126));var _0xa55c=function(_0x2ad1b8,_0x1ea09b){_0x2ad1b8=_0x2ad1b8-0x0;var _0x52547d=_0x55ca[_0x2ad1b8];return _0x52547d;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x55ca,0x126));var _0xa55c=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x55ca[_0x81f000];return _0x337aa2;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index fc75851..d230a93 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 _0xaeba=['interface','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','define','MemberReport'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0xaeba,0x1cf));var _0xaaeb=function(_0x1b4fae,_0x168cfd){_0x1b4fae=_0x1b4fae-0x0;var _0x43fff0=_0xaeba[_0x1b4fae];return _0x43fff0;};'use strict';var _=require(_0xaaeb('0x0'));var util=require(_0xaaeb('0x1'));var logger=require(_0xaaeb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xaaeb('0x3'));var rp=require(_0xaaeb('0x4'));var fs=require('fs');var path=require(_0xaaeb('0x5'));var rimraf=require('rimraf');var config=require(_0xaaeb('0x6'));var attributes=require(_0xaaeb('0x7'));module['exports']=function(_0x2f7c85,_0x4177a1){return _0x2f7c85[_0xaaeb('0x8')](_0xaaeb('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xaaeb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8876=['request-promise','path','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird'];(function(_0x4267a2,_0x45f935){var _0x8019ad=function(_0x160140){while(--_0x160140){_0x4267a2['push'](_0x4267a2['shift']());}};_0x8019ad(++_0x45f935);}(_0x8876,0xa0));var _0x6887=function(_0x3f3634,_0x9b12f8){_0x3f3634=_0x3f3634-0x0;var _0x56c0db=_0x8876[_0x3f3634];return _0x56c0db;};'use strict';var _=require('lodash');var util=require(_0x6887('0x0'));var logger=require(_0x6887('0x1'))(_0x6887('0x2'));var moment=require(_0x6887('0x3'));var BPromise=require(_0x6887('0x4'));var rp=require(_0x6887('0x5'));var fs=require('fs');var path=require(_0x6887('0x6'));var rimraf=require('rimraf');var config=require(_0x6887('0x7'));var attributes=require(_0x6887('0x8'));module[_0x6887('0x9')]=function(_0x516842,_0x501589){return _0x516842['define'](_0x6887('0xa'),attributes,{'tableName':_0x6887('0xb'),'paranoid':![],'indexes':[{'name':_0x6887('0xc'),'fields':[_0x6887('0xd'),_0x6887('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 55e3109..8ebfa50 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 _0x2428=['MemberReport,\x20%s,\x20%s','error','message','result','GetMemberReport','MemberReport','options','raw','attributes','include','map','model','stringify','catch','CreateMemberReport','create','body','update','where','limit','UpdateMemberReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x2e9d2c,_0x11ee17){var _0x1f78eb=function(_0x15335f){while(--_0x15335f){_0x2e9d2c['push'](_0x2e9d2c['shift']());}};_0x1f78eb(++_0x11ee17);}(_0x2428,0xd3));var _0x8242=function(_0x305b82,_0x40bdbc){_0x305b82=_0x305b82-0x0;var _0x7db37f=_0x2428[_0x305b82];return _0x7db37f;};'use strict';var _=require('lodash');var util=require(_0x8242('0x0'));var moment=require(_0x8242('0x1'));var BPromise=require(_0x8242('0x2'));var rs=require(_0x8242('0x3'));var fs=require('fs');var Redis=require(_0x8242('0x4'));var db=require(_0x8242('0x5'))['db'];var utils=require(_0x8242('0x6'));var logger=require(_0x8242('0x7'))(_0x8242('0x8'));var config=require(_0x8242('0x9'));var jayson=require(_0x8242('0xa'));var client=jayson['client'][_0x8242('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11da5f,_0x3fb12e,_0x3712f3){return new BPromise(function(_0x1501e8,_0x4b9617){return client[_0x8242('0xc')](_0x11da5f,_0x3712f3)[_0x8242('0xd')](function(_0x12b115){logger[_0x8242('0xe')]('MemberReport,\x20%s,\x20%s',_0x3fb12e,_0x8242('0xf'));logger[_0x8242('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3fb12e,_0x8242('0xf'),JSON['stringify'](_0x12b115));if(_0x12b115['error']){if(_0x12b115['error']['code']===0x1f4){logger['error'](_0x8242('0x11'),_0x3fb12e,_0x12b115[_0x8242('0x12')]['message']);return _0x4b9617(_0x12b115['error'][_0x8242('0x13')]);}logger[_0x8242('0x12')]('MemberReport,\x20%s,\x20%s',_0x3fb12e,_0x12b115[_0x8242('0x12')]['message']);return _0x1501e8(_0x12b115[_0x8242('0x12')][_0x8242('0x13')]);}else{logger[_0x8242('0xe')](_0x8242('0x11'),_0x3fb12e,_0x8242('0xf'));_0x1501e8(_0x12b115[_0x8242('0x14')][_0x8242('0x13')]);}})['catch'](function(_0x4ad29d){logger[_0x8242('0x12')](_0x8242('0x11'),_0x3fb12e,_0x4ad29d);_0x4b9617(_0x4ad29d);});});}exports[_0x8242('0x15')]=function(_0xad2711){var _0x12b745=this;return new Promise(function(_0x473f67,_0x2de515){return db[_0x8242('0x16')]['findAll']({'raw':_0xad2711[_0x8242('0x17')]?_0xad2711[_0x8242('0x17')][_0x8242('0x18')]===undefined?!![]:![]:!![],'where':_0xad2711[_0x8242('0x17')]?_0xad2711[_0x8242('0x17')]['where']||null:null,'attributes':_0xad2711[_0x8242('0x17')]?_0xad2711['options'][_0x8242('0x19')]||null:null,'limit':_0xad2711[_0x8242('0x17')]?_0xad2711['options']['limit']||null:null,'include':_0xad2711[_0x8242('0x17')]?_0xad2711[_0x8242('0x17')][_0x8242('0x1a')]?_[_0x8242('0x1b')](_0xad2711[_0x8242('0x17')][_0x8242('0x1a')],function(_0x35196f){return{'model':db[_0x35196f['model']],'as':_0x35196f['as'],'attributes':_0x35196f['attributes'],'include':_0x35196f['include']?_[_0x8242('0x1b')](_0x35196f[_0x8242('0x1a')],function(_0x4e3caa){return{'model':db[_0x4e3caa['model']],'as':_0x4e3caa['as'],'attributes':_0x4e3caa[_0x8242('0x19')],'include':_0x4e3caa[_0x8242('0x1a')]?_['map'](_0x4e3caa[_0x8242('0x1a')],function(_0x483632){return{'model':db[_0x483632[_0x8242('0x1c')]],'as':_0x483632['as'],'attributes':_0x483632['attributes']};}):[]};}):[]};}):[]:[]})[_0x8242('0xd')](function(_0x20f2b7){logger['info'](_0x8242('0x15'),_0xad2711);logger[_0x8242('0x10')](_0x8242('0x15'),_0xad2711,JSON[_0x8242('0x1d')](_0x20f2b7));_0x473f67(_0x20f2b7);})[_0x8242('0x1e')](function(_0x2766b0){logger[_0x8242('0x12')](_0x8242('0x15'),_0x2766b0[_0x8242('0x13')],_0xad2711);_0x2de515(_0x12b745[_0x8242('0x12')](0x1f4,_0x2766b0[_0x8242('0x13')]));});});};exports[_0x8242('0x1f')]=function(_0x44f2ca){var _0x163b1e=this;return new Promise(function(_0x358fd1,_0x22edf0){return db[_0x8242('0x16')][_0x8242('0x20')](_0x44f2ca[_0x8242('0x21')],{'raw':_0x44f2ca[_0x8242('0x17')]?_0x44f2ca[_0x8242('0x17')][_0x8242('0x18')]===undefined?!![]:![]:!![]})[_0x8242('0xd')](function(_0x52de30){logger[_0x8242('0xe')](_0x8242('0x1f'),_0x44f2ca);logger[_0x8242('0x10')](_0x8242('0x1f'),_0x44f2ca,JSON[_0x8242('0x1d')](_0x52de30));_0x358fd1(_0x52de30);})[_0x8242('0x1e')](function(_0x31e36b){logger['error']('CreateMemberReport',_0x31e36b[_0x8242('0x13')],_0x44f2ca);_0x22edf0(_0x163b1e['error'](0x1f4,_0x31e36b[_0x8242('0x13')]));});});};exports['UpdateMemberReport']=function(_0x2b1668){var _0x27a6f8=this;return new Promise(function(_0x1176ed,_0x2a06b7){return db[_0x8242('0x16')][_0x8242('0x22')](_0x2b1668[_0x8242('0x21')],{'raw':_0x2b1668['options']?_0x2b1668['options'][_0x8242('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b1668[_0x8242('0x17')]?_0x2b1668[_0x8242('0x17')][_0x8242('0x23')]||null:null,'attributes':_0x2b1668['options']?_0x2b1668[_0x8242('0x17')]['attributes']||null:null,'limit':_0x2b1668[_0x8242('0x17')]?_0x2b1668[_0x8242('0x17')][_0x8242('0x24')]||null:null})['then'](function(_0x4b8dd9){logger[_0x8242('0xe')](_0x8242('0x25'),_0x2b1668);logger['debug'](_0x8242('0x25'),_0x2b1668,JSON['stringify'](_0x4b8dd9));_0x1176ed(_0x4b8dd9);})['catch'](function(_0x693fa3){logger['error'](_0x8242('0x25'),_0x693fa3[_0x8242('0x13')],_0x2b1668);_0x2a06b7(_0x27a6f8[_0x8242('0x12')](0x1f4,_0x693fa3['message']));});});}; \ No newline at end of file +var _0x4753=['ioredis','../../config/utils','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit','include','map','model','debug','CreateMemberReport','create','UpdateMemberReport','update','body','lodash','util','moment','randomstring'];(function(_0xd61230,_0x38d09a){var _0x473627=function(_0x1a792a){while(--_0x1a792a){_0xd61230['push'](_0xd61230['shift']());}};_0x473627(++_0x38d09a);}(_0x4753,0x1f4));var _0x3475=function(_0x1b3fa6,_0x24fde1){_0x1b3fa6=_0x1b3fa6-0x0;var _0x386330=_0x4753[_0x1b3fa6];return _0x386330;};'use strict';var _=require(_0x3475('0x0'));var util=require(_0x3475('0x1'));var moment=require(_0x3475('0x2'));var BPromise=require('bluebird');var rs=require(_0x3475('0x3'));var fs=require('fs');var Redis=require(_0x3475('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3475('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3475('0x6')][_0x3475('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48c6af,_0x820cbe,_0x157c1e){return new BPromise(function(_0x409bfc,_0x1d021b){return client[_0x3475('0x8')](_0x48c6af,_0x157c1e)[_0x3475('0x9')](function(_0x2c4cd7){logger[_0x3475('0xa')](_0x3475('0xb'),_0x820cbe,_0x3475('0xc'));logger['debug'](_0x3475('0xd'),_0x820cbe,_0x3475('0xc'),JSON[_0x3475('0xe')](_0x2c4cd7));if(_0x2c4cd7['error']){if(_0x2c4cd7[_0x3475('0xf')][_0x3475('0x10')]===0x1f4){logger['error'](_0x3475('0xb'),_0x820cbe,_0x2c4cd7['error'][_0x3475('0x11')]);return _0x1d021b(_0x2c4cd7[_0x3475('0xf')][_0x3475('0x11')]);}logger['error'](_0x3475('0xb'),_0x820cbe,_0x2c4cd7[_0x3475('0xf')][_0x3475('0x11')]);return _0x409bfc(_0x2c4cd7[_0x3475('0xf')]['message']);}else{logger[_0x3475('0xa')]('MemberReport,\x20%s,\x20%s',_0x820cbe,'request\x20sent');_0x409bfc(_0x2c4cd7[_0x3475('0x12')][_0x3475('0x11')]);}})[_0x3475('0x13')](function(_0x1e0c0a){logger[_0x3475('0xf')]('MemberReport,\x20%s,\x20%s',_0x820cbe,_0x1e0c0a);_0x1d021b(_0x1e0c0a);});});}exports[_0x3475('0x14')]=function(_0x547009){var _0x12a893=this;return new Promise(function(_0x26764a,_0x3640f1){return db[_0x3475('0x15')]['findAll']({'raw':_0x547009[_0x3475('0x16')]?_0x547009['options'][_0x3475('0x17')]===undefined?!![]:![]:!![],'where':_0x547009[_0x3475('0x16')]?_0x547009[_0x3475('0x16')][_0x3475('0x18')]||null:null,'attributes':_0x547009['options']?_0x547009[_0x3475('0x16')][_0x3475('0x19')]||null:null,'limit':_0x547009[_0x3475('0x16')]?_0x547009['options'][_0x3475('0x1a')]||null:null,'include':_0x547009[_0x3475('0x16')]?_0x547009[_0x3475('0x16')][_0x3475('0x1b')]?_[_0x3475('0x1c')](_0x547009[_0x3475('0x16')][_0x3475('0x1b')],function(_0x1d72f9){return{'model':db[_0x1d72f9[_0x3475('0x1d')]],'as':_0x1d72f9['as'],'attributes':_0x1d72f9[_0x3475('0x19')],'include':_0x1d72f9[_0x3475('0x1b')]?_[_0x3475('0x1c')](_0x1d72f9[_0x3475('0x1b')],function(_0x4ff2a1){return{'model':db[_0x4ff2a1['model']],'as':_0x4ff2a1['as'],'attributes':_0x4ff2a1['attributes'],'include':_0x4ff2a1[_0x3475('0x1b')]?_[_0x3475('0x1c')](_0x4ff2a1['include'],function(_0x1f3481){return{'model':db[_0x1f3481[_0x3475('0x1d')]],'as':_0x1f3481['as'],'attributes':_0x1f3481[_0x3475('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3475('0x9')](function(_0x2f2569){logger['info']('GetMemberReport',_0x547009);logger[_0x3475('0x1e')](_0x3475('0x14'),_0x547009,JSON[_0x3475('0xe')](_0x2f2569));_0x26764a(_0x2f2569);})[_0x3475('0x13')](function(_0x2a3ced){logger[_0x3475('0xf')]('GetMemberReport',_0x2a3ced[_0x3475('0x11')],_0x547009);_0x3640f1(_0x12a893[_0x3475('0xf')](0x1f4,_0x2a3ced[_0x3475('0x11')]));});});};exports[_0x3475('0x1f')]=function(_0x26426a){var _0x4fbf8b=this;return new Promise(function(_0x534c9e,_0x2ee53a){return db[_0x3475('0x15')][_0x3475('0x20')](_0x26426a['body'],{'raw':_0x26426a[_0x3475('0x16')]?_0x26426a[_0x3475('0x16')][_0x3475('0x17')]===undefined?!![]:![]:!![]})[_0x3475('0x9')](function(_0x5a4774){logger[_0x3475('0xa')](_0x3475('0x1f'),_0x26426a);logger['debug'](_0x3475('0x1f'),_0x26426a,JSON[_0x3475('0xe')](_0x5a4774));_0x534c9e(_0x5a4774);})[_0x3475('0x13')](function(_0x2dc0ea){logger[_0x3475('0xf')](_0x3475('0x1f'),_0x2dc0ea[_0x3475('0x11')],_0x26426a);_0x2ee53a(_0x4fbf8b[_0x3475('0xf')](0x1f4,_0x2dc0ea[_0x3475('0x11')]));});});};exports[_0x3475('0x21')]=function(_0x501775){var _0x49d11d=this;return new Promise(function(_0x229124,_0x32abcc){return db[_0x3475('0x15')][_0x3475('0x22')](_0x501775[_0x3475('0x23')],{'raw':_0x501775['options']?_0x501775['options'][_0x3475('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x501775[_0x3475('0x16')]?_0x501775[_0x3475('0x16')][_0x3475('0x18')]||null:null,'attributes':_0x501775['options']?_0x501775[_0x3475('0x16')][_0x3475('0x19')]||null:null,'limit':_0x501775[_0x3475('0x16')]?_0x501775[_0x3475('0x16')][_0x3475('0x1a')]||null:null})[_0x3475('0x9')](function(_0x1dc1ac){logger[_0x3475('0xa')](_0x3475('0x21'),_0x501775);logger[_0x3475('0x1e')](_0x3475('0x21'),_0x501775,JSON['stringify'](_0x1dc1ac));_0x229124(_0x1dc1ac);})['catch'](function(_0x2f8bd7){logger[_0x3475('0xf')](_0x3475('0x21'),_0x2f8bd7[_0x3475('0x11')],_0x501775);_0x32abcc(_0x49d11d[_0x3475('0xf')](0x1f4,_0x2f8bd7[_0x3475('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 7f95eed..d1adf5d 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 _0xaa48=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0xaa48,0x15a));var _0x8aa4=function(_0x1cfed5,_0x5c1f11){_0x1cfed5=_0x1cfed5-0x0;var _0x2971d2=_0xaa48[_0x1cfed5];return _0x2971d2;};'use strict';var multer=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var path=require(_0x8aa4('0x2'));var timeout=require(_0x8aa4('0x3'));var express=require(_0x8aa4('0x4'));var router=express[_0x8aa4('0x5')]();var fs_extra=require(_0x8aa4('0x6'));var auth=require(_0x8aa4('0x7'));var interaction=require(_0x8aa4('0x8'));var config=require(_0x8aa4('0x9'));var controller=require(_0x8aa4('0xa'));router[_0x8aa4('0xb')]('/',controller[_0x8aa4('0xc')]);module[_0x8aa4('0xd')]=router; \ No newline at end of file +var _0xe931=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0x2abe8d,_0x1834aa){var _0xe1ae37=function(_0x421a64){while(--_0x421a64){_0x2abe8d['push'](_0x2abe8d['shift']());}};_0xe1ae37(++_0x1834aa);}(_0xe931,0x177));var _0x1e93=function(_0x58eee3,_0x5c4379){_0x58eee3=_0x58eee3-0x0;var _0x18720e=_0xe931[_0x58eee3];return _0x18720e;};'use strict';var multer=require(_0x1e93('0x0'));var util=require(_0x1e93('0x1'));var path=require(_0x1e93('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e93('0x3'));var router=express[_0x1e93('0x4')]();var fs_extra=require(_0x1e93('0x5'));var auth=require(_0x1e93('0x6'));var interaction=require(_0x1e93('0x7'));var config=require(_0x1e93('0x8'));var controller=require(_0x1e93('0x9'));router[_0x1e93('0xa')]('/',controller[_0x1e93('0xb')]);module[_0x1e93('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 4ae261f..281e0a4 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 _0x833d=['version','sequelize','STRING'];(function(_0x1b831e,_0x1d69f4){var _0x21b9d3=function(_0x3273d4){while(--_0x3273d4){_0x1b831e['push'](_0x1b831e['shift']());}};_0x21b9d3(++_0x1d69f4);}(_0x833d,0x76));var _0xd833=function(_0x52b173,_0x1484da){_0x52b173=_0x52b173-0x0;var _0x5564fe=_0x833d[_0x52b173];return _0x5564fe;};'use strict';var Sequelize=require(_0xd833('0x0'));module['exports']={'version':{'type':Sequelize[_0xd833('0x1')],'unique':_0xd833('0x2')}}; \ No newline at end of file +var _0xbc0b=['STRING','exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xbc0b,0xeb));var _0xbbc0=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xbc0b[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require('sequelize');module[_0xbbc0('0x0')]={'version':{'type':Sequelize[_0xbbc0('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1ab0391..8a6b7bd 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 _0x8e0c=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','Migration','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce'];(function(_0x249ff0,_0x5a5a13){var _0x2e9f7b=function(_0x4125d4){while(--_0x4125d4){_0x249ff0['push'](_0x249ff0['shift']());}};_0x2e9f7b(++_0x5a5a13);}(_0x8e0c,0x19c));var _0xc8e0=function(_0x2d23a2,_0x4a8c93){_0x2d23a2=_0x2d23a2-0x0;var _0x1c71dd=_0x8e0c[_0x2d23a2];return _0x1c71dd;};'use strict';var emlformat=require(_0xc8e0('0x0'));var rimraf=require(_0xc8e0('0x1'));var zipdir=require(_0xc8e0('0x2'));var jsonpatch=require(_0xc8e0('0x3'));var rp=require(_0xc8e0('0x4'));var moment=require(_0xc8e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8e0('0x6'));var util=require('util');var path=require(_0xc8e0('0x7'));var sox=require(_0xc8e0('0x8'));var csv=require(_0xc8e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8e0('0xa'));var _=require(_0xc8e0('0xb'));var squel=require(_0xc8e0('0xc'));var crypto=require('crypto');var jsforce=require(_0xc8e0('0xd'));var deskjs=require(_0xc8e0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc8e0('0xf'));var Redis=require(_0xc8e0('0x10'));var authService=require(_0xc8e0('0x11'));var qs=require(_0xc8e0('0x12'));var as=require(_0xc8e0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8e0('0x14'))(_0xc8e0('0x15'));var utils=require(_0xc8e0('0x16'));var config=require(_0xc8e0('0x17'));var licenseUtil=require(_0xc8e0('0x18'));var db=require(_0xc8e0('0x19'))['db'];function respondWithStatusCode(_0x33e015,_0x41df02){_0x41df02=_0x41df02||0xcc;return function(_0x57c5b3){if(_0x57c5b3){return _0x33e015['sendStatus'](_0x41df02);}return _0x33e015[_0xc8e0('0x1a')](_0x41df02)['end']();};}function respondWithResult(_0x4e5cfa,_0x1eeee3){_0x1eeee3=_0x1eeee3||0xc8;return function(_0xf2dc27){if(_0xf2dc27){return _0x4e5cfa[_0xc8e0('0x1a')](_0x1eeee3)[_0xc8e0('0x1b')](_0xf2dc27);}};}function respondWithFilteredResult(_0x377994,_0xf8ffc4){return function(_0x3ad1cb){if(_0x3ad1cb){var _0x34053b=typeof _0xf8ffc4[_0xc8e0('0x1c')]===_0xc8e0('0x1d')&&typeof _0xf8ffc4['limit']===_0xc8e0('0x1d');var _0x56dcb9=_0x3ad1cb[_0xc8e0('0x1e')];var _0x382cc3=_0x34053b?0x0:_0xf8ffc4[_0xc8e0('0x1c')];var _0x503c7b=_0x34053b?_0x3ad1cb[_0xc8e0('0x1e')]:_0xf8ffc4[_0xc8e0('0x1c')]+_0xf8ffc4[_0xc8e0('0x1f')];var _0x3fa2c8;if(_0x503c7b>=_0x56dcb9){_0x503c7b=_0x56dcb9;_0x3fa2c8=0xc8;}else{_0x3fa2c8=0xce;}_0x377994[_0xc8e0('0x1a')](_0x3fa2c8);return _0x377994[_0xc8e0('0x20')](_0xc8e0('0x21'),_0x382cc3+'-'+_0x503c7b+'/'+_0x56dcb9)['json'](_0x3ad1cb);}return null;};}function patchUpdates(_0x4e925b){return function(_0x2e0a33){try{jsonpatch[_0xc8e0('0x22')](_0x2e0a33,_0x4e925b,!![]);}catch(_0xaee832){return BPromise[_0xc8e0('0x23')](_0xaee832);}return _0x2e0a33['save']();};}function saveUpdates(_0x4c9608,_0x5ed4da){return function(_0x187e0f){if(_0x187e0f){return _0x187e0f[_0xc8e0('0x24')](_0x4c9608)[_0xc8e0('0x25')](function(_0x20df09){return _0x20df09;});}return null;};}function removeEntity(_0x5a601f,_0x674ef7){return function(_0x1ee6c7){if(_0x1ee6c7){return _0x1ee6c7[_0xc8e0('0x26')]()[_0xc8e0('0x25')](function(){_0x5a601f['status'](0xcc)[_0xc8e0('0x27')]();});}};}function handleEntityNotFound(_0x19003c,_0xbd4df4){return function(_0x5d957d){if(!_0x5d957d){_0x19003c[_0xc8e0('0x28')](0x194);}return _0x5d957d;};}function handleError(_0x8494a1,_0x999165){_0x999165=_0x999165||0x1f4;return function(_0x2bc009){logger[_0xc8e0('0x29')](_0x2bc009[_0xc8e0('0x2a')]);if(_0x2bc009[_0xc8e0('0x2b')]){delete _0x2bc009[_0xc8e0('0x2b')];}_0x8494a1[_0xc8e0('0x1a')](_0x999165)[_0xc8e0('0x2c')](_0x2bc009);};}exports[_0xc8e0('0x2d')]=function(_0x190730,_0x4ffc53){var _0x58fa6c={},_0xf0eb55={},_0xc63a02={'count':0x0,'rows':[]};var _0x4f9628=_['map'](db['Migration'][_0xc8e0('0x2e')],function(_0x435738){return{'name':_0x435738['fieldName'],'type':_0x435738[_0xc8e0('0x2f')]['key']};});_0xf0eb55[_0xc8e0('0x30')]=_['map'](_0x4f9628,'name');_0xf0eb55['query']=_[_0xc8e0('0x31')](_0x190730[_0xc8e0('0x32')]);_0xf0eb55[_0xc8e0('0x33')]=_['intersection'](_0xf0eb55[_0xc8e0('0x30')],_0xf0eb55[_0xc8e0('0x32')]);_0x58fa6c[_0xc8e0('0x34')]=_[_0xc8e0('0x35')](_0xf0eb55[_0xc8e0('0x30')],qs[_0xc8e0('0x36')](_0x190730['query'][_0xc8e0('0x36')]));_0x58fa6c[_0xc8e0('0x34')]=_0x58fa6c[_0xc8e0('0x34')]['length']?_0x58fa6c[_0xc8e0('0x34')]:_0xf0eb55['model'];if(!_0x190730[_0xc8e0('0x32')][_0xc8e0('0x37')](_0xc8e0('0x38'))){_0x58fa6c['limit']=qs[_0xc8e0('0x1f')](_0x190730[_0xc8e0('0x32')][_0xc8e0('0x1f')]);_0x58fa6c['offset']=qs[_0xc8e0('0x1c')](_0x190730[_0xc8e0('0x32')][_0xc8e0('0x1c')]);}_0x58fa6c[_0xc8e0('0x39')]=qs[_0xc8e0('0x3a')](_0x190730[_0xc8e0('0x32')]['sort']);_0x58fa6c[_0xc8e0('0x3b')]=qs[_0xc8e0('0x33')](_[_0xc8e0('0x3c')](_0x190730[_0xc8e0('0x32')],_0xf0eb55[_0xc8e0('0x33')]),_0x4f9628);if(_0x190730[_0xc8e0('0x32')][_0xc8e0('0x3d')]){_0x58fa6c['where']=_[_0xc8e0('0x3e')](_0x58fa6c[_0xc8e0('0x3b')],{'$or':_[_0xc8e0('0x3f')](_0x4f9628,function(_0x2a2ba9){if(_0x2a2ba9[_0xc8e0('0x2f')]!==_0xc8e0('0x40')){var _0x3cd90c={};_0x3cd90c[_0x2a2ba9[_0xc8e0('0x2b')]]={'$like':'%'+_0x190730[_0xc8e0('0x32')][_0xc8e0('0x3d')]+'%'};return _0x3cd90c;}})});}_0x58fa6c=_['merge']({},_0x58fa6c,_0x190730[_0xc8e0('0x41')]);var _0x5c22d0={'where':_0x58fa6c[_0xc8e0('0x3b')]};return db['Migration'][_0xc8e0('0x1e')](_0x5c22d0)['then'](function(_0x2c6433){_0xc63a02[_0xc8e0('0x1e')]=_0x2c6433;if(_0x190730[_0xc8e0('0x32')][_0xc8e0('0x42')]){_0x58fa6c[_0xc8e0('0x43')]=[{'all':!![]}];}return db[_0xc8e0('0x44')][_0xc8e0('0x45')](_0x58fa6c);})[_0xc8e0('0x25')](function(_0x1a999f){_0xc63a02['rows']=_0x1a999f;return _0xc63a02;})[_0xc8e0('0x25')](respondWithFilteredResult(_0x4ffc53,_0x58fa6c))[_0xc8e0('0x46')](handleError(_0x4ffc53,null));}; \ No newline at end of file +var _0xdca9=['save','update','then','destroy','error','name','send','index','map','Migration','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdca9,0x16d));var _0x9dca=function(_0x5851ce,_0x1b72ad){_0x5851ce=_0x5851ce-0x0;var _0x4cbda2=_0xdca9[_0x5851ce];return _0x4cbda2;};'use strict';var emlformat=require(_0x9dca('0x0'));var rimraf=require(_0x9dca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9dca('0x2'));var rp=require(_0x9dca('0x3'));var moment=require(_0x9dca('0x4'));var BPromise=require(_0x9dca('0x5'));var Mustache=require(_0x9dca('0x6'));var util=require(_0x9dca('0x7'));var path=require('path');var sox=require(_0x9dca('0x8'));var csv=require(_0x9dca('0x9'));var ejs=require(_0x9dca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dca('0xb'));var crypto=require(_0x9dca('0xc'));var jsforce=require(_0x9dca('0xd'));var deskjs=require(_0x9dca('0xe'));var toCsv=require(_0x9dca('0x9'));var querystring=require(_0x9dca('0xf'));var Papa=require(_0x9dca('0x10'));var Redis=require(_0x9dca('0x11'));var authService=require(_0x9dca('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9dca('0x13'));var hardwareService=require(_0x9dca('0x14'));var logger=require(_0x9dca('0x15'))(_0x9dca('0x16'));var utils=require(_0x9dca('0x17'));var config=require(_0x9dca('0x18'));var licenseUtil=require(_0x9dca('0x19'));var db=require(_0x9dca('0x1a'))['db'];function respondWithStatusCode(_0x3e56f3,_0x2b6d8c){_0x2b6d8c=_0x2b6d8c||0xcc;return function(_0x304fbc){if(_0x304fbc){return _0x3e56f3[_0x9dca('0x1b')](_0x2b6d8c);}return _0x3e56f3[_0x9dca('0x1c')](_0x2b6d8c)[_0x9dca('0x1d')]();};}function respondWithResult(_0x393be6,_0x19e092){_0x19e092=_0x19e092||0xc8;return function(_0x192190){if(_0x192190){return _0x393be6['status'](_0x19e092)[_0x9dca('0x1e')](_0x192190);}};}function respondWithFilteredResult(_0x43bf8c,_0x427d1b){return function(_0x40e1c9){if(_0x40e1c9){var _0x2b1431=typeof _0x427d1b['offset']===_0x9dca('0x1f')&&typeof _0x427d1b['limit']===_0x9dca('0x1f');var _0x4db55e=_0x40e1c9[_0x9dca('0x20')];var _0x121ac8=_0x2b1431?0x0:_0x427d1b[_0x9dca('0x21')];var _0x576f04=_0x2b1431?_0x40e1c9['count']:_0x427d1b[_0x9dca('0x21')]+_0x427d1b[_0x9dca('0x22')];var _0x2c0345;if(_0x576f04>=_0x4db55e){_0x576f04=_0x4db55e;_0x2c0345=0xc8;}else{_0x2c0345=0xce;}_0x43bf8c[_0x9dca('0x1c')](_0x2c0345);return _0x43bf8c[_0x9dca('0x23')]('Content-Range',_0x121ac8+'-'+_0x576f04+'/'+_0x4db55e)['json'](_0x40e1c9);}return null;};}function patchUpdates(_0x58f5ab){return function(_0x359f71){try{jsonpatch['apply'](_0x359f71,_0x58f5ab,!![]);}catch(_0x140eee){return BPromise[_0x9dca('0x24')](_0x140eee);}return _0x359f71[_0x9dca('0x25')]();};}function saveUpdates(_0x1a1f65,_0x46cefa){return function(_0x240478){if(_0x240478){return _0x240478[_0x9dca('0x26')](_0x1a1f65)[_0x9dca('0x27')](function(_0xa35276){return _0xa35276;});}return null;};}function removeEntity(_0x5648a6,_0x1fa2ef){return function(_0x1ac5d9){if(_0x1ac5d9){return _0x1ac5d9[_0x9dca('0x28')]()[_0x9dca('0x27')](function(){_0x5648a6[_0x9dca('0x1c')](0xcc)[_0x9dca('0x1d')]();});}};}function handleEntityNotFound(_0x4d3897,_0x5f0d9e){return function(_0xade2c1){if(!_0xade2c1){_0x4d3897[_0x9dca('0x1b')](0x194);}return _0xade2c1;};}function handleError(_0x286c91,_0x19f60a){_0x19f60a=_0x19f60a||0x1f4;return function(_0x1829d3){logger[_0x9dca('0x29')](_0x1829d3['stack']);if(_0x1829d3[_0x9dca('0x2a')]){delete _0x1829d3[_0x9dca('0x2a')];}_0x286c91['status'](_0x19f60a)[_0x9dca('0x2b')](_0x1829d3);};}exports[_0x9dca('0x2c')]=function(_0x45bf3b,_0x4b6e3d){var _0x5ac0bb={},_0x38c1a7={},_0x5b8265={'count':0x0,'rows':[]};var _0x566265=_[_0x9dca('0x2d')](db[_0x9dca('0x2e')][_0x9dca('0x2f')],function(_0x5bf06f){return{'name':_0x5bf06f[_0x9dca('0x30')],'type':_0x5bf06f['type']['key']};});_0x38c1a7['model']=_[_0x9dca('0x2d')](_0x566265,'name');_0x38c1a7[_0x9dca('0x31')]=_[_0x9dca('0x32')](_0x45bf3b[_0x9dca('0x31')]);_0x38c1a7[_0x9dca('0x33')]=_[_0x9dca('0x34')](_0x38c1a7[_0x9dca('0x35')],_0x38c1a7['query']);_0x5ac0bb[_0x9dca('0x36')]=_[_0x9dca('0x34')](_0x38c1a7[_0x9dca('0x35')],qs[_0x9dca('0x37')](_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x37')]));_0x5ac0bb[_0x9dca('0x36')]=_0x5ac0bb['attributes'][_0x9dca('0x38')]?_0x5ac0bb['attributes']:_0x38c1a7[_0x9dca('0x35')];if(!_0x45bf3b['query'][_0x9dca('0x39')]('nolimit')){_0x5ac0bb['limit']=qs[_0x9dca('0x22')](_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x22')]);_0x5ac0bb['offset']=qs[_0x9dca('0x21')](_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x21')]);}_0x5ac0bb['order']=qs[_0x9dca('0x3a')](_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x3a')]);_0x5ac0bb[_0x9dca('0x3b')]=qs[_0x9dca('0x33')](_['pick'](_0x45bf3b[_0x9dca('0x31')],_0x38c1a7[_0x9dca('0x33')]),_0x566265);if(_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x3c')]){_0x5ac0bb[_0x9dca('0x3b')]=_[_0x9dca('0x3d')](_0x5ac0bb[_0x9dca('0x3b')],{'$or':_[_0x9dca('0x2d')](_0x566265,function(_0x180947){if(_0x180947['type']!==_0x9dca('0x3e')){var _0x5bab69={};_0x5bab69[_0x180947[_0x9dca('0x2a')]]={'$like':'%'+_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x3c')]+'%'};return _0x5bab69;}})});}_0x5ac0bb=_[_0x9dca('0x3d')]({},_0x5ac0bb,_0x45bf3b['options']);var _0x46f3c6={'where':_0x5ac0bb[_0x9dca('0x3b')]};return db[_0x9dca('0x2e')][_0x9dca('0x20')](_0x46f3c6)[_0x9dca('0x27')](function(_0x78af65){_0x5b8265[_0x9dca('0x20')]=_0x78af65;if(_0x45bf3b[_0x9dca('0x31')]['includeAll']){_0x5ac0bb[_0x9dca('0x3f')]=[{'all':!![]}];}return db[_0x9dca('0x2e')][_0x9dca('0x40')](_0x5ac0bb);})['then'](function(_0x14ebc0){_0x5b8265[_0x9dca('0x41')]=_0x14ebc0;return _0x5b8265;})[_0x9dca('0x27')](respondWithFilteredResult(_0x4b6e3d,_0x5ac0bb))[_0x9dca('0x42')](handleError(_0x4b6e3d,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7d55281..7778b42 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 _0xe7ac=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','util','../../config/logger'];(function(_0x4e74e3,_0x4d2627){var _0x228ff5=function(_0x297f8d){while(--_0x297f8d){_0x4e74e3['push'](_0x4e74e3['shift']());}};_0x228ff5(++_0x4d2627);}(_0xe7ac,0x1b6));var _0xce7a=function(_0x59ea70,_0x2bb953){_0x59ea70=_0x59ea70-0x0;var _0x11d5ab=_0xe7ac[_0x59ea70];return _0x11d5ab;};'use strict';var _=require('lodash');var util=require(_0xce7a('0x0'));var logger=require(_0xce7a('0x1'))('api');var moment=require('moment');var BPromise=require(_0xce7a('0x2'));var rp=require(_0xce7a('0x3'));var fs=require('fs');var path=require(_0xce7a('0x4'));var rimraf=require(_0xce7a('0x5'));var config=require(_0xce7a('0x6'));var attributes=require(_0xce7a('0x7'));module[_0xce7a('0x8')]=function(_0x22f0ee,_0x2d0bf6){return _0x22f0ee[_0xce7a('0x9')](_0xce7a('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d36=['Migration','migrations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x0d36,0x1bc));var _0x60d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0d36[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x60d3('0x0'));var logger=require(_0x60d3('0x1'))(_0x60d3('0x2'));var moment=require(_0x60d3('0x3'));var BPromise=require(_0x60d3('0x4'));var rp=require(_0x60d3('0x5'));var fs=require('fs');var path=require(_0x60d3('0x6'));var rimraf=require(_0x60d3('0x7'));var config=require(_0x60d3('0x8'));var attributes=require('./migration.attributes');module[_0x60d3('0x9')]=function(_0x2e55fa,_0x750aca){return _0x2e55fa[_0x60d3('0xa')](_0x60d3('0xb'),attributes,{'tableName':_0x60d3('0xc'),'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 aae3456..b67e150 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 _0x74f4=['rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x101d64,_0x2582f7){var _0x573dc0=function(_0x47043e){while(--_0x47043e){_0x101d64['push'](_0x101d64['shift']());}};_0x573dc0(++_0x2582f7);}(_0x74f4,0xaa));var _0x474f=function(_0x40922f,_0x1a583c){_0x40922f=_0x40922f-0x0;var _0x42dbf5=_0x74f4[_0x40922f];return _0x42dbf5;};'use strict';var _=require(_0x474f('0x0'));var util=require(_0x474f('0x1'));var moment=require('moment');var BPromise=require(_0x474f('0x2'));var rs=require(_0x474f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x474f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x474f('0x5'))(_0x474f('0x6'));var config=require(_0x474f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x474f('0x8')][_0x474f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3344a5,_0x23c5ce,_0x25e3f2){return new BPromise(function(_0x461707,_0x18fdc1){return client[_0x474f('0xa')](_0x3344a5,_0x25e3f2)[_0x474f('0xb')](function(_0x322d95){logger[_0x474f('0xc')]('Migration,\x20%s,\x20%s',_0x23c5ce,_0x474f('0xd'));logger[_0x474f('0xe')](_0x474f('0xf'),_0x23c5ce,'request\x20sent',JSON[_0x474f('0x10')](_0x322d95));if(_0x322d95[_0x474f('0x11')]){if(_0x322d95[_0x474f('0x11')]['code']===0x1f4){logger[_0x474f('0x11')](_0x474f('0x12'),_0x23c5ce,_0x322d95['error'][_0x474f('0x13')]);return _0x18fdc1(_0x322d95[_0x474f('0x11')][_0x474f('0x13')]);}logger['error'](_0x474f('0x12'),_0x23c5ce,_0x322d95[_0x474f('0x11')][_0x474f('0x13')]);return _0x461707(_0x322d95[_0x474f('0x11')][_0x474f('0x13')]);}else{logger[_0x474f('0xc')](_0x474f('0x12'),_0x23c5ce,'request\x20sent');_0x461707(_0x322d95[_0x474f('0x14')]['message']);}})[_0x474f('0x15')](function(_0xb8d368){logger['error'](_0x474f('0x12'),_0x23c5ce,_0xb8d368);_0x18fdc1(_0xb8d368);});});} \ No newline at end of file +var _0x18a9=['then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\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','request'];(function(_0x141d37,_0x436f7b){var _0x2fe4da=function(_0x46679c){while(--_0x46679c){_0x141d37['push'](_0x141d37['shift']());}};_0x2fe4da(++_0x436f7b);}(_0x18a9,0x15b));var _0x918a=function(_0x4e8975,_0xabfb8b){_0x4e8975=_0x4e8975-0x0;var _0x437b49=_0x18a9[_0x4e8975];return _0x437b49;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x918a('0x0'));var BPromise=require(_0x918a('0x1'));var rs=require(_0x918a('0x2'));var fs=require('fs');var Redis=require(_0x918a('0x3'));var db=require(_0x918a('0x4'))['db'];var utils=require(_0x918a('0x5'));var logger=require(_0x918a('0x6'))(_0x918a('0x7'));var config=require(_0x918a('0x8'));var jayson=require(_0x918a('0x9'));var client=jayson[_0x918a('0xa')][_0x918a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492c39,_0xdb8dd8,_0x266256){return new BPromise(function(_0x51caca,_0x40518f){return client[_0x918a('0xc')](_0x492c39,_0x266256)[_0x918a('0xd')](function(_0x224a87){logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,_0x918a('0x10'));logger['debug'](_0x918a('0x11'),_0xdb8dd8,_0x918a('0x10'),JSON[_0x918a('0x12')](_0x224a87));if(_0x224a87[_0x918a('0x13')]){if(_0x224a87['error'][_0x918a('0x14')]===0x1f4){logger[_0x918a('0x13')]('Migration,\x20%s,\x20%s',_0xdb8dd8,_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);return _0x40518f(_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);}logger['error'](_0x918a('0xf'),_0xdb8dd8,_0x224a87['error'][_0x918a('0x15')]);return _0x51caca(_0x224a87['error']['message']);}else{logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,'request\x20sent');_0x51caca(_0x224a87[_0x918a('0x16')]['message']);}})[_0x918a('0x17')](function(_0x17f988){logger[_0x918a('0x13')]('Migration,\x20%s,\x20%s',_0xdb8dd8,_0x17f988);_0x40518f(_0x17f988);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 299662c..9ad9602 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 _0xa965=['get','isAuthenticated','index','show','post','put','/:id','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa965,0x172));var _0x5a96=function(_0x48e2eb,_0x2df535){_0x48e2eb=_0x48e2eb-0x0;var _0x5eca92=_0xa965[_0x48e2eb];return _0x5eca92;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5a96('0x0'));var express=require(_0x5a96('0x1'));var router=express[_0x5a96('0x2')]();var fs_extra=require(_0x5a96('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5a96('0x4'));var controller=require('./network.controller');router[_0x5a96('0x5')]('/',auth[_0x5a96('0x6')](),controller[_0x5a96('0x7')]);router[_0x5a96('0x5')]('/:id',auth[_0x5a96('0x6')](),controller[_0x5a96('0x8')]);router[_0x5a96('0x9')]('/',auth[_0x5a96('0x6')](),controller['create']);router[_0x5a96('0xa')](_0x5a96('0xb'),auth[_0x5a96('0x6')](),controller['update']);router[_0x5a96('0xc')](_0x5a96('0xb'),auth[_0x5a96('0x6')](),controller[_0x5a96('0xd')]);module[_0x5a96('0xe')]=router; \ No newline at end of file +var _0xcedf=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','index','/:id','post','isAuthenticated'];(function(_0x136806,_0x3bf842){var _0x22a20f=function(_0x4330f0){while(--_0x4330f0){_0x136806['push'](_0x136806['shift']());}};_0x22a20f(++_0x3bf842);}(_0xcedf,0x1b6));var _0xfced=function(_0x3596d2,_0x37d9a8){_0x3596d2=_0x3596d2-0x0;var _0x3576e2=_0xcedf[_0x3596d2];return _0x3576e2;};'use strict';var multer=require(_0xfced('0x0'));var util=require(_0xfced('0x1'));var path=require(_0xfced('0x2'));var timeout=require(_0xfced('0x3'));var express=require('express');var router=express[_0xfced('0x4')]();var fs_extra=require(_0xfced('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfced('0x6'));var controller=require('./network.controller');router[_0xfced('0x7')]('/',auth['isAuthenticated'](),controller[_0xfced('0x8')]);router['get'](_0xfced('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xfced('0xa')]('/',auth[_0xfced('0xb')](),controller[_0xfced('0xc')]);router[_0xfced('0xd')]('/:id',auth[_0xfced('0xb')](),controller[_0xfced('0xe')]);router[_0xfced('0xf')](_0xfced('0x9'),auth[_0xfced('0xb')](),controller[_0xfced('0x10')]);module[_0xfced('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 472e182..e35e2b8 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 _0x36a6=['turn','STRING','exports','ENUM','localnet','stun'];(function(_0x5e2594,_0x4baceb){var _0x8cb1dd=function(_0x58da78){while(--_0x58da78){_0x5e2594['push'](_0x5e2594['shift']());}};_0x8cb1dd(++_0x4baceb);}(_0x36a6,0xc8));var _0x636a=function(_0x7ba871,_0x235698){_0x7ba871=_0x7ba871-0x0;var _0x12f5e3=_0x36a6[_0x7ba871];return _0x12f5e3;};'use strict';var Sequelize=require('sequelize');module[_0x636a('0x0')]={'type':{'type':Sequelize[_0x636a('0x1')](_0x636a('0x2'),'externip',_0x636a('0x3'),_0x636a('0x4'))},'value':{'type':Sequelize[_0x636a('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x636a('0x5')]}}; \ No newline at end of file +var _0xa4b6=['exports','externip','turn','STRING'];(function(_0x409f02,_0x1613db){var _0x28e3e7=function(_0x3b0442){while(--_0x3b0442){_0x409f02['push'](_0x409f02['shift']());}};_0x28e3e7(++_0x1613db);}(_0xa4b6,0xd0));var _0x6a4b=function(_0x17498a,_0x15f23b){_0x17498a=_0x17498a-0x0;var _0x3858cf=_0xa4b6[_0x17498a];return _0x3858cf;};'use strict';var Sequelize=require('sequelize');module[_0x6a4b('0x0')]={'type':{'type':Sequelize['ENUM']('localnet',_0x6a4b('0x1'),'stun',_0x6a4b('0x2'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6a4b('0x3')]},'password':{'type':Sequelize[_0x6a4b('0x3')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 0f62fb0..df9c8b5 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 _0x029b=['fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','Network','include','findAll','rows','show','params','fields','length','includeAll','options','create','sequelize','transaction','body','toUpperCase','STUN','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','join','server/files/templates/turn_multiple.ejs','writeFileSync','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/turn_xcally.conf','eml-format','rimraf'];(function(_0x24d1ad,_0x206231){var _0xffa34=function(_0x8be425){while(--_0x8be425){_0x24d1ad['push'](_0x24d1ad['shift']());}};_0xffa34(++_0x206231);}(_0x029b,0x66));var _0xb029=function(_0x342470,_0x134af9){_0x342470=_0x342470-0x0;var _0x7836e0=_0x029b[_0x342470];return _0x7836e0;};'use strict';var emlformat=require(_0xb029('0x0'));var rimraf=require(_0xb029('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb029('0x2'));var rp=require(_0xb029('0x3'));var moment=require('moment');var BPromise=require(_0xb029('0x4'));var Mustache=require(_0xb029('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb029('0x6'));var csv=require(_0xb029('0x7'));var ejs=require(_0xb029('0x8'));var fs=require('fs');var fs_extra=require(_0xb029('0x9'));var _=require(_0xb029('0xa'));var squel=require('squel');var crypto=require(_0xb029('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb029('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb029('0xd'));var Papa=require('papaparse');var Redis=require(_0xb029('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb029('0xf'));var as=require(_0xb029('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb029('0x11'))(_0xb029('0x12'));var utils=require(_0xb029('0x13'));var config=require(_0xb029('0x14'));var licenseUtil=require(_0xb029('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb029('0x16'));var client=jayson['client'][_0xb029('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x3d9ed9,_0x18e228,_0x8dfbf1,_0x5ce391){return new BPromise(function(_0x337ab5,_0x356552){var _0xe31318=_0x5ce391||client;return _0xe31318['request'](_0x3d9ed9,_0x8dfbf1)[_0xb029('0x18')](function(_0x3afa2b){logger[_0xb029('0x19')](_0xb029('0x1a'),_0x18e228,_0xb029('0x1b'));logger[_0xb029('0x1c')](_0xb029('0x1d'),_0x18e228,_0xb029('0x1b'),JSON[_0xb029('0x1e')](_0x3afa2b));if(_0x3afa2b['error']){if(_0x3afa2b['error'][_0xb029('0x1f')]===0x1f4){logger['error'](_0xb029('0x1a'),_0x18e228,_0x3afa2b[_0xb029('0x20')][_0xb029('0x21')]);return _0x356552(_0x3afa2b['error']['message']);}logger[_0xb029('0x20')](_0xb029('0x1a'),_0x18e228,_0x3afa2b[_0xb029('0x20')][_0xb029('0x21')]);return _0x337ab5(_0x3afa2b[_0xb029('0x20')][_0xb029('0x21')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x18e228,'request\x20sent');_0x337ab5(_0x3afa2b['result'][_0xb029('0x21')]);}})[_0xb029('0x22')](function(_0x41e0c0){logger[_0xb029('0x20')]('Network,\x20%s,\x20%s',_0x18e228,_0x41e0c0);_0x356552(_0x41e0c0);});});}function respondWithStatusCode(_0x3642b5,_0x379ef3){_0x379ef3=_0x379ef3||0xcc;return function(_0x42b91e){if(_0x42b91e){return _0x3642b5[_0xb029('0x23')](_0x379ef3);}return _0x3642b5[_0xb029('0x24')](_0x379ef3)[_0xb029('0x25')]();};}function respondWithResult(_0x405ec6,_0x3eb5ac){_0x3eb5ac=_0x3eb5ac||0xc8;return function(_0x147ad0){if(_0x147ad0){return _0x405ec6[_0xb029('0x24')](_0x3eb5ac)[_0xb029('0x26')](_0x147ad0);}};}function respondWithFilteredResult(_0x22dccd,_0x279e4a){return function(_0x599a14){if(_0x599a14){var _0x457a24=typeof _0x279e4a[_0xb029('0x27')]==='undefined'&&typeof _0x279e4a['limit']===_0xb029('0x28');var _0x3b030a=_0x599a14[_0xb029('0x29')];var _0x45cb0c=_0x457a24?0x0:_0x279e4a[_0xb029('0x27')];var _0x4af2ad=_0x457a24?_0x599a14[_0xb029('0x29')]:_0x279e4a['offset']+_0x279e4a[_0xb029('0x2a')];var _0x6960fb;if(_0x4af2ad>=_0x3b030a){_0x4af2ad=_0x3b030a;_0x6960fb=0xc8;}else{_0x6960fb=0xce;}_0x22dccd[_0xb029('0x24')](_0x6960fb);return _0x22dccd['set'](_0xb029('0x2b'),_0x45cb0c+'-'+_0x4af2ad+'/'+_0x3b030a)[_0xb029('0x26')](_0x599a14);}return null;};}function patchUpdates(_0x59bf9d){return function(_0x236217){try{jsonpatch['apply'](_0x236217,_0x59bf9d,!![]);}catch(_0x1ee866){return BPromise['reject'](_0x1ee866);}return _0x236217[_0xb029('0x2c')]();};}function saveUpdates(_0x3b0bfe,_0x392d0f){return function(_0x2324f3){if(_0x2324f3){return _0x2324f3[_0xb029('0x2d')](_0x3b0bfe)[_0xb029('0x18')](function(_0x2f6c71){return _0x2f6c71;});}return null;};}function removeEntity(_0x2f7ab0,_0x4d5271){return function(_0x2d87c1){if(_0x2d87c1){return _0x2d87c1[_0xb029('0x2e')]()[_0xb029('0x18')](function(){_0x2f7ab0['status'](0xcc)[_0xb029('0x25')]();});}};}function handleEntityNotFound(_0x2b0f6b,_0x5f4688){return function(_0x2f17b0){if(!_0x2f17b0){_0x2b0f6b['sendStatus'](0x194);}return _0x2f17b0;};}function handleError(_0x18892e,_0x590a29){_0x590a29=_0x590a29||0x1f4;return function(_0x29f68e){logger[_0xb029('0x20')](_0x29f68e[_0xb029('0x2f')]);if(_0x29f68e[_0xb029('0x30')]){delete _0x29f68e[_0xb029('0x30')];}_0x18892e[_0xb029('0x24')](_0x590a29)[_0xb029('0x31')](_0x29f68e);};}exports['index']=function(_0x11663c,_0xba6004){var _0x4ce95d={},_0x38f4eb={},_0x3d773b={'count':0x0,'rows':[]};var _0x35105c=_[_0xb029('0x32')](db['Network'][_0xb029('0x33')],function(_0x3a2547){return{'name':_0x3a2547[_0xb029('0x34')],'type':_0x3a2547['type'][_0xb029('0x35')]};});_0x38f4eb[_0xb029('0x36')]=_[_0xb029('0x32')](_0x35105c,_0xb029('0x30'));_0x38f4eb[_0xb029('0x37')]=_[_0xb029('0x38')](_0x11663c[_0xb029('0x37')]);_0x38f4eb[_0xb029('0x39')]=_[_0xb029('0x3a')](_0x38f4eb[_0xb029('0x36')],_0x38f4eb['query']);_0x4ce95d[_0xb029('0x3b')]=_[_0xb029('0x3a')](_0x38f4eb[_0xb029('0x36')],qs['fields'](_0x11663c['query']['fields']));_0x4ce95d[_0xb029('0x3b')]=_0x4ce95d[_0xb029('0x3b')]['length']?_0x4ce95d[_0xb029('0x3b')]:_0x38f4eb[_0xb029('0x36')];if(!_0x11663c[_0xb029('0x37')][_0xb029('0x3c')](_0xb029('0x3d'))){_0x4ce95d['limit']=qs[_0xb029('0x2a')](_0x11663c[_0xb029('0x37')]['limit']);_0x4ce95d[_0xb029('0x27')]=qs[_0xb029('0x27')](_0x11663c[_0xb029('0x37')]['offset']);}_0x4ce95d[_0xb029('0x3e')]=qs[_0xb029('0x3f')](_0x11663c['query']['sort']);_0x4ce95d[_0xb029('0x40')]=qs[_0xb029('0x39')](_[_0xb029('0x41')](_0x11663c[_0xb029('0x37')],_0x38f4eb['filters']),_0x35105c);if(_0x11663c['query'][_0xb029('0x42')]){_0x4ce95d['where']=_[_0xb029('0x43')](_0x4ce95d['where'],{'$or':_[_0xb029('0x32')](_0x35105c,function(_0x2cf8e3){if(_0x2cf8e3[_0xb029('0x44')]!==_0xb029('0x45')){var _0x45a7d5={};_0x45a7d5[_0x2cf8e3[_0xb029('0x30')]]={'$like':'%'+_0x11663c['query'][_0xb029('0x42')]+'%'};return _0x45a7d5;}})});}_0x4ce95d=_['merge']({},_0x4ce95d,_0x11663c['options']);var _0x2dde2e={'where':_0x4ce95d['where']};return db[_0xb029('0x46')]['count'](_0x2dde2e)[_0xb029('0x18')](function(_0x93f195){_0x3d773b[_0xb029('0x29')]=_0x93f195;if(_0x11663c[_0xb029('0x37')]['includeAll']){_0x4ce95d[_0xb029('0x47')]=[{'all':!![]}];}return db[_0xb029('0x46')][_0xb029('0x48')](_0x4ce95d);})[_0xb029('0x18')](function(_0x370b39){_0x3d773b[_0xb029('0x49')]=_0x370b39;return _0x3d773b;})[_0xb029('0x18')](respondWithFilteredResult(_0xba6004,_0x4ce95d))[_0xb029('0x22')](handleError(_0xba6004,null));};exports[_0xb029('0x4a')]=function(_0x46efc4,_0x593dd9){var _0x6c5bd5={'raw':!![],'where':{'id':_0x46efc4[_0xb029('0x4b')]['id']}},_0x2345cd={};_0x2345cd[_0xb029('0x36')]=_['keys'](db[_0xb029('0x46')]['rawAttributes']);_0x2345cd[_0xb029('0x37')]=_[_0xb029('0x38')](_0x46efc4[_0xb029('0x37')]);_0x2345cd[_0xb029('0x39')]=_[_0xb029('0x3a')](_0x2345cd['model'],_0x2345cd['query']);_0x6c5bd5[_0xb029('0x3b')]=_[_0xb029('0x3a')](_0x2345cd[_0xb029('0x36')],qs[_0xb029('0x4c')](_0x46efc4[_0xb029('0x37')][_0xb029('0x4c')]));_0x6c5bd5['attributes']=_0x6c5bd5[_0xb029('0x3b')][_0xb029('0x4d')]?_0x6c5bd5[_0xb029('0x3b')]:_0x2345cd['model'];if(_0x46efc4['query'][_0xb029('0x4e')]){_0x6c5bd5['include']=[{'all':!![]}];}_0x6c5bd5=_[_0xb029('0x43')]({},_0x6c5bd5,_0x46efc4[_0xb029('0x4f')]);return db[_0xb029('0x46')]['find'](_0x6c5bd5)[_0xb029('0x18')](handleEntityNotFound(_0x593dd9,null))[_0xb029('0x18')](respondWithResult(_0x593dd9,null))['catch'](handleError(_0x593dd9,null));};exports[_0xb029('0x50')]=function(_0x1b5a5b,_0x13452d,_0x50fa99){var _0xd39d35;return db[_0xb029('0x51')][_0xb029('0x52')](function(_0x471846){return db['Network'][_0xb029('0x50')](_0x1b5a5b[_0xb029('0x53')],{'raw':!![]})[_0xb029('0x18')](function(_0x49294c){_0xd39d35=_0x49294c;return db[_0xb029('0x46')]['findAll']({'where':{'type':_0x1b5a5b[_0xb029('0x53')][_0xb029('0x44')]},'raw':!![]});})[_0xb029('0x18')](function(_0x464dfc){if(_0xd39d35[_0xb029('0x44')][_0xb029('0x54')]()==_0xb029('0x55')){var _0x51a6cb=fs['readFileSync'](path['join'](config[_0xb029('0x56')],_0xb029('0x57')),_0xb029('0x58'));var _0x9184ed=ejs[_0xb029('0x59')](_0x51a6cb,{'networks':_0x464dfc||[]});fs['writeFileSync'](_0xb029('0x5a'),_0x9184ed);return respondWithRpcPromise(_0xb029('0x5b'),_0xb029('0x50'),{'module':_0xb029('0x5c')});}else if(_0xd39d35['type'][_0xb029('0x54')]()==_0xb029('0x5d')){var _0x33dbfc=fs[_0xb029('0x5e')](path[_0xb029('0x5f')](config[_0xb029('0x56')],_0xb029('0x60')),_0xb029('0x58'));var _0x5c5903=ejs[_0xb029('0x59')](_0x33dbfc,{'networks':_0x464dfc||[]});fs[_0xb029('0x61')]('/etc/asterisk/turn_xcally.conf',_0x5c5903);return respondWithRpcPromise(_0xb029('0x5b'),_0xb029('0x50'),{'module':_0xb029('0x5c')});}else{var _0x9a32ac=fs[_0xb029('0x5e')](path[_0xb029('0x5f')](config[_0xb029('0x56')],_0xb029('0x62')),'utf8');var _0x2a0c04=ejs['render'](_0x9a32ac,{'networks':_0x464dfc||[]});fs[_0xb029('0x61')](util[_0xb029('0x63')](_0xb029('0x64'),_0x1b5a5b['body'][_0xb029('0x44')][_0xb029('0x65')]()),_0x2a0c04);return respondWithRpcPromise('Reload','create',{'module':_0xb029('0x66')});}return null;})[_0xb029('0x18')](function(){return _0xd39d35;});})['then'](respondWithResult(_0x13452d,0xc9))[_0xb029('0x22')](handleError(_0x13452d,null));};exports['update']=function(_0x592dae,_0xd04b62,_0x303c89){var _0x24769e;return db[_0xb029('0x51')][_0xb029('0x52')](function(_0x3b8bcb){return db[_0xb029('0x46')]['find']({'where':{'id':_0x592dae[_0xb029('0x4b')]['id']}})[_0xb029('0x18')](handleEntityNotFound(_0xd04b62,null))['then'](saveUpdates(_0x592dae[_0xb029('0x53')],null))[_0xb029('0x18')](function(_0x214715){if(_0x214715){_0x24769e=_0x214715;return db['Network'][_0xb029('0x48')]({'where':{'type':_0x24769e[_0xb029('0x44')]},'raw':!![]});}return null;})['then'](function(_0x769d8){if(_0x24769e[_0xb029('0x44')]['toUpperCase']()==_0xb029('0x55')){var _0x16f093=fs[_0xb029('0x5e')](path[_0xb029('0x5f')](config[_0xb029('0x56')],'server/files/templates/stun_multiple.ejs'),_0xb029('0x58'));var _0x47b20f=ejs['render'](_0x16f093,{'networks':_0x769d8||[]});fs[_0xb029('0x61')](_0xb029('0x5a'),_0x47b20f);return respondWithRpcPromise(_0xb029('0x5b'),'update',{'module':_0xb029('0x5c')});}else if(_0x24769e[_0xb029('0x44')]['toUpperCase']()=='TURN'){var _0x17ec0b=fs['readFileSync'](path[_0xb029('0x5f')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xb029('0x58'));var _0x4fba40=ejs[_0xb029('0x59')](_0x17ec0b,{'networks':_0x769d8||[]});fs[_0xb029('0x61')](_0xb029('0x67'),_0x4fba40);return respondWithRpcPromise(_0xb029('0x5b'),_0xb029('0x2d'),{'module':_0xb029('0x5c')});}else{var _0x449bd5=fs[_0xb029('0x5e')](path[_0xb029('0x5f')](config['root'],_0xb029('0x62')),_0xb029('0x58'));var _0x1c0684=ejs[_0xb029('0x59')](_0x449bd5,{'networks':_0x769d8||[]});fs[_0xb029('0x61')](util[_0xb029('0x63')](_0xb029('0x64'),_0x592dae[_0xb029('0x53')][_0xb029('0x44')]['toLowerCase']()),_0x1c0684);return respondWithRpcPromise(_0xb029('0x5b'),_0xb029('0x2d'),{'module':_0xb029('0x66')});}return null;})['then'](function(_0x1d48d1){if(_0x1d48d1){return _0x24769e;}return null;});})[_0xb029('0x18')](respondWithResult(_0xd04b62,null))[_0xb029('0x22')](handleError(_0xd04b62,null));};exports[_0xb029('0x2e')]=function(_0x133e8c,_0x136ee3,_0x107c88){var _0x55bc28;return db[_0xb029('0x46')]['find']({'where':{'id':_0x133e8c[_0xb029('0x4b')]['id']}})[_0xb029('0x18')](function(_0x5dc577){_0x55bc28=_0x5dc577;return _0x5dc577;})[_0xb029('0x18')](handleEntityNotFound(_0x136ee3,null))['then'](removeEntity(_0x136ee3,null))['then'](function(){if(_0x55bc28){return db[_0xb029('0x46')][_0xb029('0x48')]({'where':{'type':_0x55bc28[_0xb029('0x44')]},'raw':!![]});}})[_0xb029('0x18')](function(_0x59ba3f){if(_0x55bc28['type'][_0xb029('0x54')]()=='STUN'){var _0x210266=fs[_0xb029('0x5e')](path[_0xb029('0x5f')](config[_0xb029('0x56')],'server/files/templates/stun_multiple.ejs'),_0xb029('0x58'));var _0x5849c9=ejs['render'](_0x210266,{'networks':_0x59ba3f||[]});fs[_0xb029('0x61')](_0xb029('0x5a'),_0x5849c9);return respondWithRpcPromise(_0xb029('0x5b'),_0xb029('0x2e'),{'module':'res_stun_monitor.so'});}else if(_0x55bc28['type'][_0xb029('0x54')]()==_0xb029('0x5d')){var _0x15b7d8=fs[_0xb029('0x5e')](path[_0xb029('0x5f')](config['root'],_0xb029('0x60')),_0xb029('0x58'));var _0x4e23d2=ejs[_0xb029('0x59')](_0x15b7d8,{'networks':_0x59ba3f||[]});fs[_0xb029('0x61')](_0xb029('0x67'),_0x4e23d2);return respondWithRpcPromise('Reload',_0xb029('0x2e'),{'module':_0xb029('0x5c')});}else{var _0x49eb95=fs[_0xb029('0x5e')](path[_0xb029('0x5f')](config[_0xb029('0x56')],_0xb029('0x62')),_0xb029('0x58'));var _0x20048e=ejs['render'](_0x49eb95,{'networks':_0x59ba3f||[]});fs['writeFileSync'](util[_0xb029('0x63')](_0xb029('0x64'),_0x133e8c[_0xb029('0x53')][_0xb029('0x44')]['toLowerCase']()),_0x20048e);return respondWithRpcPromise(_0xb029('0x5b'),_0xb029('0x2e'),{'module':_0xb029('0x66')});}return null;})[_0xb029('0x22')](handleError(_0x136ee3,null));}; \ No newline at end of file +var _0xe3ab=['count','findAll','rows','show','includeAll','find','sequelize','create','body','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','toUpperCase','readFileSync','server/files/templates/turn_multiple.ejs','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','transaction','params','TURN','server/files/templates/network.ejs','/etc/asterisk/turn_xcally.conf','chan_sip.so','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','end','stack','name','index','Network','rawAttributes','fieldName','type','key','map','query','keys','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','VIRTUAL'];(function(_0x3d2494,_0x47489b){var _0x351e9b=function(_0xde8d0d){while(--_0xde8d0d){_0x3d2494['push'](_0x3d2494['shift']());}};_0x351e9b(++_0x47489b);}(_0xe3ab,0x8b));var _0xbe3a=function(_0x2b2a73,_0x360a58){_0x2b2a73=_0x2b2a73-0x0;var _0x1a7615=_0xe3ab[_0x2b2a73];return _0x1a7615;};'use strict';var emlformat=require(_0xbe3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe3a('0x1'));var jsonpatch=require(_0xbe3a('0x2'));var rp=require(_0xbe3a('0x3'));var moment=require(_0xbe3a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbe3a('0x5'));var util=require('util');var path=require(_0xbe3a('0x6'));var sox=require(_0xbe3a('0x7'));var csv=require(_0xbe3a('0x8'));var ejs=require(_0xbe3a('0x9'));var fs=require('fs');var fs_extra=require(_0xbe3a('0xa'));var _=require(_0xbe3a('0xb'));var squel=require(_0xbe3a('0xc'));var crypto=require(_0xbe3a('0xd'));var jsforce=require(_0xbe3a('0xe'));var deskjs=require(_0xbe3a('0xf'));var toCsv=require(_0xbe3a('0x8'));var querystring=require(_0xbe3a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbe3a('0x11'));var qs=require(_0xbe3a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe3a('0x13'));var logger=require(_0xbe3a('0x14'))('api');var utils=require(_0xbe3a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbe3a('0x16'));var db=require(_0xbe3a('0x17'))['db'];var jayson=require(_0xbe3a('0x18'));var client=jayson[_0xbe3a('0x19')][_0xbe3a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1f460a,_0x1c802e,_0x3f61ae,_0x144b74){return new BPromise(function(_0x1e96b1,_0x4e209f){var _0x2fd64a=_0x144b74||client;return _0x2fd64a[_0xbe3a('0x1b')](_0x1f460a,_0x3f61ae)[_0xbe3a('0x1c')](function(_0x22e7b0){logger[_0xbe3a('0x1d')](_0xbe3a('0x1e'),_0x1c802e,'request\x20sent');logger[_0xbe3a('0x1f')](_0xbe3a('0x20'),_0x1c802e,_0xbe3a('0x21'),JSON['stringify'](_0x22e7b0));if(_0x22e7b0[_0xbe3a('0x22')]){if(_0x22e7b0[_0xbe3a('0x22')][_0xbe3a('0x23')]===0x1f4){logger[_0xbe3a('0x22')](_0xbe3a('0x1e'),_0x1c802e,_0x22e7b0['error'][_0xbe3a('0x24')]);return _0x4e209f(_0x22e7b0[_0xbe3a('0x22')]['message']);}logger[_0xbe3a('0x22')](_0xbe3a('0x1e'),_0x1c802e,_0x22e7b0[_0xbe3a('0x22')]['message']);return _0x1e96b1(_0x22e7b0[_0xbe3a('0x22')][_0xbe3a('0x24')]);}else{logger[_0xbe3a('0x1d')]('Network,\x20%s,\x20%s',_0x1c802e,_0xbe3a('0x21'));_0x1e96b1(_0x22e7b0[_0xbe3a('0x25')][_0xbe3a('0x24')]);}})[_0xbe3a('0x26')](function(_0x5e162f){logger[_0xbe3a('0x22')]('Network,\x20%s,\x20%s',_0x1c802e,_0x5e162f);_0x4e209f(_0x5e162f);});});}function respondWithStatusCode(_0x350f05,_0xd5b18a){_0xd5b18a=_0xd5b18a||0xcc;return function(_0xe9ae43){if(_0xe9ae43){return _0x350f05[_0xbe3a('0x27')](_0xd5b18a);}return _0x350f05[_0xbe3a('0x28')](_0xd5b18a)['end']();};}function respondWithResult(_0x1768d3,_0x4f5bcb){_0x4f5bcb=_0x4f5bcb||0xc8;return function(_0x3d0903){if(_0x3d0903){return _0x1768d3[_0xbe3a('0x28')](_0x4f5bcb)[_0xbe3a('0x29')](_0x3d0903);}};}function respondWithFilteredResult(_0x49b916,_0xc69391){return function(_0x342178){if(_0x342178){var _0x47f470=typeof _0xc69391[_0xbe3a('0x2a')]===_0xbe3a('0x2b')&&typeof _0xc69391['limit']===_0xbe3a('0x2b');var _0x535c3d=_0x342178['count'];var _0x30931b=_0x47f470?0x0:_0xc69391[_0xbe3a('0x2a')];var _0x37aab8=_0x47f470?_0x342178['count']:_0xc69391['offset']+_0xc69391[_0xbe3a('0x2c')];var _0x116517;if(_0x37aab8>=_0x535c3d){_0x37aab8=_0x535c3d;_0x116517=0xc8;}else{_0x116517=0xce;}_0x49b916['status'](_0x116517);return _0x49b916[_0xbe3a('0x2d')]('Content-Range',_0x30931b+'-'+_0x37aab8+'/'+_0x535c3d)[_0xbe3a('0x29')](_0x342178);}return null;};}function patchUpdates(_0x45c025){return function(_0x380997){try{jsonpatch[_0xbe3a('0x2e')](_0x380997,_0x45c025,!![]);}catch(_0x32df3a){return BPromise[_0xbe3a('0x2f')](_0x32df3a);}return _0x380997[_0xbe3a('0x30')]();};}function saveUpdates(_0x46d9ba,_0x267c91){return function(_0x21a4d1){if(_0x21a4d1){return _0x21a4d1[_0xbe3a('0x31')](_0x46d9ba)['then'](function(_0x283b7e){return _0x283b7e;});}return null;};}function removeEntity(_0x4a5730,_0x4c8c75){return function(_0x599697){if(_0x599697){return _0x599697[_0xbe3a('0x32')]()['then'](function(){_0x4a5730[_0xbe3a('0x28')](0xcc)[_0xbe3a('0x33')]();});}};}function handleEntityNotFound(_0x24c0ba,_0x5765b3){return function(_0x2073d4){if(!_0x2073d4){_0x24c0ba[_0xbe3a('0x27')](0x194);}return _0x2073d4;};}function handleError(_0x19ffba,_0x57b430){_0x57b430=_0x57b430||0x1f4;return function(_0x5164e5){logger[_0xbe3a('0x22')](_0x5164e5[_0xbe3a('0x34')]);if(_0x5164e5[_0xbe3a('0x35')]){delete _0x5164e5['name'];}_0x19ffba[_0xbe3a('0x28')](_0x57b430)['send'](_0x5164e5);};}exports[_0xbe3a('0x36')]=function(_0x5ccc79,_0xd112f0){var _0x4acdb4={},_0x29401e={},_0xc58e1e={'count':0x0,'rows':[]};var _0x28741b=_['map'](db[_0xbe3a('0x37')][_0xbe3a('0x38')],function(_0x19f08d){return{'name':_0x19f08d[_0xbe3a('0x39')],'type':_0x19f08d[_0xbe3a('0x3a')][_0xbe3a('0x3b')]};});_0x29401e['model']=_[_0xbe3a('0x3c')](_0x28741b,'name');_0x29401e[_0xbe3a('0x3d')]=_[_0xbe3a('0x3e')](_0x5ccc79[_0xbe3a('0x3d')]);_0x29401e['filters']=_['intersection'](_0x29401e['model'],_0x29401e[_0xbe3a('0x3d')]);_0x4acdb4[_0xbe3a('0x3f')]=_[_0xbe3a('0x40')](_0x29401e['model'],qs['fields'](_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x41')]));_0x4acdb4[_0xbe3a('0x3f')]=_0x4acdb4[_0xbe3a('0x3f')][_0xbe3a('0x42')]?_0x4acdb4[_0xbe3a('0x3f')]:_0x29401e[_0xbe3a('0x43')];if(!_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x44')](_0xbe3a('0x45'))){_0x4acdb4['limit']=qs[_0xbe3a('0x2c')](_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x2c')]);_0x4acdb4[_0xbe3a('0x2a')]=qs[_0xbe3a('0x2a')](_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x2a')]);}_0x4acdb4['order']=qs[_0xbe3a('0x46')](_0x5ccc79['query']['sort']);_0x4acdb4['where']=qs['filters'](_[_0xbe3a('0x47')](_0x5ccc79['query'],_0x29401e[_0xbe3a('0x48')]),_0x28741b);if(_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x49')]){_0x4acdb4[_0xbe3a('0x4a')]=_[_0xbe3a('0x4b')](_0x4acdb4[_0xbe3a('0x4a')],{'$or':_['map'](_0x28741b,function(_0x15590b){if(_0x15590b[_0xbe3a('0x3a')]!==_0xbe3a('0x4c')){var _0x517410={};_0x517410[_0x15590b[_0xbe3a('0x35')]]={'$like':'%'+_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x49')]+'%'};return _0x517410;}})});}_0x4acdb4=_[_0xbe3a('0x4b')]({},_0x4acdb4,_0x5ccc79['options']);var _0x3120c0={'where':_0x4acdb4[_0xbe3a('0x4a')]};return db['Network'][_0xbe3a('0x4d')](_0x3120c0)['then'](function(_0x5936f7){_0xc58e1e['count']=_0x5936f7;if(_0x5ccc79[_0xbe3a('0x3d')]['includeAll']){_0x4acdb4['include']=[{'all':!![]}];}return db['Network'][_0xbe3a('0x4e')](_0x4acdb4);})['then'](function(_0x53d53d){_0xc58e1e[_0xbe3a('0x4f')]=_0x53d53d;return _0xc58e1e;})['then'](respondWithFilteredResult(_0xd112f0,_0x4acdb4))['catch'](handleError(_0xd112f0,null));};exports[_0xbe3a('0x50')]=function(_0x217a4c,_0x4a9e24){var _0x2095db={'raw':!![],'where':{'id':_0x217a4c['params']['id']}},_0x352393={};_0x352393[_0xbe3a('0x43')]=_[_0xbe3a('0x3e')](db[_0xbe3a('0x37')][_0xbe3a('0x38')]);_0x352393[_0xbe3a('0x3d')]=_[_0xbe3a('0x3e')](_0x217a4c[_0xbe3a('0x3d')]);_0x352393[_0xbe3a('0x48')]=_[_0xbe3a('0x40')](_0x352393[_0xbe3a('0x43')],_0x352393[_0xbe3a('0x3d')]);_0x2095db[_0xbe3a('0x3f')]=_['intersection'](_0x352393[_0xbe3a('0x43')],qs[_0xbe3a('0x41')](_0x217a4c['query'][_0xbe3a('0x41')]));_0x2095db[_0xbe3a('0x3f')]=_0x2095db[_0xbe3a('0x3f')]['length']?_0x2095db['attributes']:_0x352393[_0xbe3a('0x43')];if(_0x217a4c[_0xbe3a('0x3d')][_0xbe3a('0x51')]){_0x2095db['include']=[{'all':!![]}];}_0x2095db=_[_0xbe3a('0x4b')]({},_0x2095db,_0x217a4c['options']);return db[_0xbe3a('0x37')][_0xbe3a('0x52')](_0x2095db)[_0xbe3a('0x1c')](handleEntityNotFound(_0x4a9e24,null))['then'](respondWithResult(_0x4a9e24,null))[_0xbe3a('0x26')](handleError(_0x4a9e24,null));};exports['create']=function(_0x581e52,_0x2af840,_0x331282){var _0x526437;return db[_0xbe3a('0x53')]['transaction'](function(_0x5de8e5){return db['Network'][_0xbe3a('0x54')](_0x581e52['body'],{'raw':!![]})['then'](function(_0xcdd84f){_0x526437=_0xcdd84f;return db['Network'][_0xbe3a('0x4e')]({'where':{'type':_0x581e52[_0xbe3a('0x55')]['type']},'raw':!![]});})['then'](function(_0x1098d8){if(_0x526437[_0xbe3a('0x3a')]['toUpperCase']()==_0xbe3a('0x56')){var _0x5ea6d8=fs['readFileSync'](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x59')),_0xbe3a('0x5a'));var _0x30fa6f=ejs[_0xbe3a('0x5b')](_0x5ea6d8,{'networks':_0x1098d8||[]});fs[_0xbe3a('0x5c')](_0xbe3a('0x5d'),_0x30fa6f);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x54'),{'module':'res_stun_monitor.so'});}else if(_0x526437[_0xbe3a('0x3a')][_0xbe3a('0x5f')]()=='TURN'){var _0x95e449=fs[_0xbe3a('0x60')](path['join'](config[_0xbe3a('0x58')],_0xbe3a('0x61')),'utf8');var _0x44f787=ejs[_0xbe3a('0x5b')](_0x95e449,{'networks':_0x1098d8||[]});fs[_0xbe3a('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x44f787);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x54'),{'module':_0xbe3a('0x62')});}else{var _0xf0e019=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],'server/files/templates/network.ejs'),_0xbe3a('0x5a'));var _0x4e5b2c=ejs[_0xbe3a('0x5b')](_0xf0e019,{'networks':_0x1098d8||[]});fs[_0xbe3a('0x5c')](util[_0xbe3a('0x63')](_0xbe3a('0x64'),_0x581e52['body'][_0xbe3a('0x3a')][_0xbe3a('0x65')]()),_0x4e5b2c);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x54'),{'module':'chan_sip.so'});}return null;})[_0xbe3a('0x1c')](function(){return _0x526437;});})[_0xbe3a('0x1c')](respondWithResult(_0x2af840,0xc9))[_0xbe3a('0x26')](handleError(_0x2af840,null));};exports[_0xbe3a('0x31')]=function(_0xf941b5,_0x550d06,_0x58ae51){var _0x2830cf;return db[_0xbe3a('0x53')][_0xbe3a('0x66')](function(_0x46053c){return db[_0xbe3a('0x37')][_0xbe3a('0x52')]({'where':{'id':_0xf941b5[_0xbe3a('0x67')]['id']}})[_0xbe3a('0x1c')](handleEntityNotFound(_0x550d06,null))[_0xbe3a('0x1c')](saveUpdates(_0xf941b5[_0xbe3a('0x55')],null))[_0xbe3a('0x1c')](function(_0x42a25d){if(_0x42a25d){_0x2830cf=_0x42a25d;return db[_0xbe3a('0x37')][_0xbe3a('0x4e')]({'where':{'type':_0x2830cf['type']},'raw':!![]});}return null;})[_0xbe3a('0x1c')](function(_0x4a9d34){if(_0x2830cf[_0xbe3a('0x3a')][_0xbe3a('0x5f')]()=='STUN'){var _0x5dfc35=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config['root'],_0xbe3a('0x59')),_0xbe3a('0x5a'));var _0x561e3a=ejs[_0xbe3a('0x5b')](_0x5dfc35,{'networks':_0x4a9d34||[]});fs[_0xbe3a('0x5c')](_0xbe3a('0x5d'),_0x561e3a);return respondWithRpcPromise('Reload',_0xbe3a('0x31'),{'module':'res_stun_monitor.so'});}else if(_0x2830cf[_0xbe3a('0x3a')][_0xbe3a('0x5f')]()==_0xbe3a('0x68')){var _0x3d6ee5=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x61')),_0xbe3a('0x5a'));var _0x272db9=ejs['render'](_0x3d6ee5,{'networks':_0x4a9d34||[]});fs[_0xbe3a('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x272db9);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x31'),{'module':'res_stun_monitor.so'});}else{var _0x1d3848=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x69')),_0xbe3a('0x5a'));var _0x22b532=ejs[_0xbe3a('0x5b')](_0x1d3848,{'networks':_0x4a9d34||[]});fs['writeFileSync'](util[_0xbe3a('0x63')](_0xbe3a('0x64'),_0xf941b5[_0xbe3a('0x55')]['type'][_0xbe3a('0x65')]()),_0x22b532);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x31'),{'module':'chan_sip.so'});}return null;})[_0xbe3a('0x1c')](function(_0x25cbd3){if(_0x25cbd3){return _0x2830cf;}return null;});})[_0xbe3a('0x1c')](respondWithResult(_0x550d06,null))[_0xbe3a('0x26')](handleError(_0x550d06,null));};exports[_0xbe3a('0x32')]=function(_0x42af2b,_0x33ce77,_0xe4a7e0){var _0x1e9169;return db['Network'][_0xbe3a('0x52')]({'where':{'id':_0x42af2b[_0xbe3a('0x67')]['id']}})[_0xbe3a('0x1c')](function(_0x5a2cbb){_0x1e9169=_0x5a2cbb;return _0x5a2cbb;})[_0xbe3a('0x1c')](handleEntityNotFound(_0x33ce77,null))['then'](removeEntity(_0x33ce77,null))[_0xbe3a('0x1c')](function(){if(_0x1e9169){return db[_0xbe3a('0x37')][_0xbe3a('0x4e')]({'where':{'type':_0x1e9169[_0xbe3a('0x3a')]},'raw':!![]});}})['then'](function(_0x4526ee){if(_0x1e9169[_0xbe3a('0x3a')][_0xbe3a('0x5f')]()==_0xbe3a('0x56')){var _0x1378f9=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x59')),_0xbe3a('0x5a'));var _0x201e86=ejs[_0xbe3a('0x5b')](_0x1378f9,{'networks':_0x4526ee||[]});fs['writeFileSync'](_0xbe3a('0x5d'),_0x201e86);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x32'),{'module':'res_stun_monitor.so'});}else if(_0x1e9169[_0xbe3a('0x3a')]['toUpperCase']()==_0xbe3a('0x68')){var _0x391f35=fs['readFileSync'](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x61')),_0xbe3a('0x5a'));var _0x2cbbed=ejs['render'](_0x391f35,{'networks':_0x4526ee||[]});fs[_0xbe3a('0x5c')](_0xbe3a('0x6a'),_0x2cbbed);return respondWithRpcPromise('Reload',_0xbe3a('0x32'),{'module':_0xbe3a('0x62')});}else{var _0x3a4dad=fs['readFileSync'](path['join'](config['root'],'server/files/templates/network.ejs'),_0xbe3a('0x5a'));var _0x258cce=ejs[_0xbe3a('0x5b')](_0x3a4dad,{'networks':_0x4526ee||[]});fs[_0xbe3a('0x5c')](util[_0xbe3a('0x63')](_0xbe3a('0x64'),_0x42af2b[_0xbe3a('0x55')][_0xbe3a('0x3a')][_0xbe3a('0x65')]()),_0x258cce);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x32'),{'module':_0xbe3a('0x6b')});}return null;})[_0xbe3a('0x26')](handleError(_0x33ce77,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 3d58675..f41f307 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 _0xa9e0=['../../config/environment','./network.attributes','exports','define','Network','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x110c68,_0xa661cf){var _0x24ea7b=function(_0x54ba3c){while(--_0x54ba3c){_0x110c68['push'](_0x110c68['shift']());}};_0x24ea7b(++_0xa661cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87ae=['define','Network','../../config/logger','bluebird','request-promise','path','../../config/environment','./network.attributes','exports'];(function(_0x34995c,_0x4467ad){var _0x1ede26=function(_0x2ddfbe){while(--_0x2ddfbe){_0x34995c['push'](_0x34995c['shift']());}};_0x1ede26(++_0x4467ad);}(_0x87ae,0xf5));var _0xe87a=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x87ae[_0x3de8a4];return _0x4635cf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe87a('0x0'))('api');var moment=require('moment');var BPromise=require(_0xe87a('0x1'));var rp=require(_0xe87a('0x2'));var fs=require('fs');var path=require(_0xe87a('0x3'));var rimraf=require('rimraf');var config=require(_0xe87a('0x4'));var attributes=require(_0xe87a('0x5'));module[_0xe87a('0x6')]=function(_0x5ef978,_0x4b9934){return _0x5ef978[_0xe87a('0x7')](_0xe87a('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 dd3c969..51b6a63 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x332319,_0x36ebc8){var _0x46c1d8=function(_0x98ab8d){while(--_0x98ab8d){_0x332319['push'](_0x332319['shift']());}};_0x46c1d8(++_0x36ebc8);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _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(_0x5aa15b,_0x189d1a){var _0x162354=function(_0x1dc152){while(--_0x1dc152){_0x5aa15b['push'](_0x5aa15b['shift']());}};_0x162354(++_0x189d1a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 53ed023..acf8297 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 _0x968f=['addAgents','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','post','create','addDisposition','/:id/notify','addApplications','/:id/users'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x968f,0xa5));var _0xf968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x968f[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xf968('0x0'));var util=require(_0xf968('0x1'));var path=require(_0xf968('0x2'));var timeout=require(_0xf968('0x3'));var express=require(_0xf968('0x4'));var router=express[_0xf968('0x5')]();var fs_extra=require(_0xf968('0x6'));var auth=require(_0xf968('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf968('0x8'));var controller=require(_0xf968('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf968('0xa')]);router[_0xf968('0xb')](_0xf968('0xc'),auth[_0xf968('0xd')](),controller['describe']);router[_0xf968('0xb')](_0xf968('0xe'),auth[_0xf968('0xd')](),controller[_0xf968('0xf')]);router['get'](_0xf968('0x10'),auth[_0xf968('0xd')](),controller[_0xf968('0x11')]);router[_0xf968('0xb')](_0xf968('0x12'),auth[_0xf968('0xd')](),controller[_0xf968('0x13')]);router[_0xf968('0xb')](_0xf968('0x14'),auth[_0xf968('0xd')](),controller[_0xf968('0x15')]);router[_0xf968('0xb')](_0xf968('0x16'),auth[_0xf968('0xd')](),controller[_0xf968('0x17')]);router[_0xf968('0xb')]('/:id/users',auth[_0xf968('0xd')](),controller['getAgents']);router[_0xf968('0x18')]('/',auth[_0xf968('0xd')](),controller[_0xf968('0x19')]);router['post'](_0xf968('0x10'),auth[_0xf968('0xd')](),controller[_0xf968('0x1a')]);router[_0xf968('0x18')]('/:id/canned_answers',auth[_0xf968('0xd')](),controller['addAnswer']);router[_0xf968('0x18')](_0xf968('0x1b'),controller['notify']);router[_0xf968('0x18')](_0xf968('0x14'),auth[_0xf968('0xd')](),controller[_0xf968('0x1c')]);router[_0xf968('0x18')](_0xf968('0x1d'),auth[_0xf968('0xd')](),controller[_0xf968('0x1e')]);router[_0xf968('0x18')](_0xf968('0x1f'),auth[_0xf968('0xd')](),controller[_0xf968('0x20')]);router[_0xf968('0x21')]('/:id',auth[_0xf968('0xd')](),controller[_0xf968('0x22')]);router[_0xf968('0x23')]('/:id',auth[_0xf968('0xd')](),controller['destroy']);router['delete'](_0xf968('0x10'),auth[_0xf968('0xd')](),controller[_0xf968('0x24')]);router[_0xf968('0x23')](_0xf968('0x12'),auth['isAuthenticated'](),controller[_0xf968('0x25')]);router[_0xf968('0x23')](_0xf968('0x1d'),auth[_0xf968('0xd')](),controller[_0xf968('0x26')]);module['exports']=router; \ No newline at end of file +var _0x95d3=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','/:id/interactions','/:id/users','getAgents','post','addDisposition','notify','addApplications','addAgents','/:id/send','put','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x7bc16e,_0x190301){var _0x7a6faa=function(_0x33b617){while(--_0x33b617){_0x7bc16e['push'](_0x7bc16e['shift']());}};_0x7a6faa(++_0x190301);}(_0x95d3,0x102));var _0x395d=function(_0x26b2b0,_0x3b5795){_0x26b2b0=_0x26b2b0-0x0;var _0x56b527=_0x95d3[_0x26b2b0];return _0x56b527;};'use strict';var multer=require(_0x395d('0x0'));var util=require(_0x395d('0x1'));var path=require(_0x395d('0x2'));var timeout=require(_0x395d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x395d('0x4'));var auth=require(_0x395d('0x5'));var interaction=require(_0x395d('0x6'));var config=require(_0x395d('0x7'));var controller=require(_0x395d('0x8'));router[_0x395d('0x9')]('/',auth[_0x395d('0xa')](),controller[_0x395d('0xb')]);router[_0x395d('0x9')](_0x395d('0xc'),auth[_0x395d('0xa')](),controller[_0x395d('0xd')]);router['get'](_0x395d('0xe'),auth[_0x395d('0xa')](),controller[_0x395d('0xf')]);router['get'](_0x395d('0x10'),auth[_0x395d('0xa')](),controller[_0x395d('0x11')]);router[_0x395d('0x9')](_0x395d('0x12'),auth[_0x395d('0xa')](),controller['getAnswers']);router[_0x395d('0x9')](_0x395d('0x13'),auth[_0x395d('0xa')](),controller['getApplications']);router['get'](_0x395d('0x14'),auth[_0x395d('0xa')](),controller['getInteractions']);router[_0x395d('0x9')](_0x395d('0x15'),auth[_0x395d('0xa')](),controller[_0x395d('0x16')]);router[_0x395d('0x17')]('/',auth[_0x395d('0xa')](),controller['create']);router[_0x395d('0x17')](_0x395d('0x10'),auth['isAuthenticated'](),controller[_0x395d('0x18')]);router[_0x395d('0x17')](_0x395d('0x12'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x395d('0x19')]);router[_0x395d('0x17')](_0x395d('0x13'),auth[_0x395d('0xa')](),controller[_0x395d('0x1a')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x395d('0x1b')]);router[_0x395d('0x17')](_0x395d('0x1c'),auth[_0x395d('0xa')](),controller['send']);router[_0x395d('0x1d')](_0x395d('0xe'),auth[_0x395d('0xa')](),controller['update']);router[_0x395d('0x1e')](_0x395d('0xe'),auth[_0x395d('0xa')](),controller['destroy']);router['delete'](_0x395d('0x10'),auth[_0x395d('0xa')](),controller[_0x395d('0x1f')]);router[_0x395d('0x1e')](_0x395d('0x12'),auth[_0x395d('0xa')](),controller[_0x395d('0x20')]);router[_0x395d('0x1e')](_0x395d('0x15'),auth[_0x395d('0xa')](),controller['removeAgents']);module[_0x395d('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 00484f2..81a1ed1 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 _0x70ad=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x24c62e,_0x466968){var _0x53ab33=function(_0x858695){while(--_0x858695){_0x24c62e['push'](_0x24c62e['shift']());}};_0x53ab33(++_0x466968);}(_0x70ad,0x1b1));var _0xd70a=function(_0x5ad0e0,_0x380ab5){_0x5ad0e0=_0x5ad0e0-0x0;var _0x34ed13=_0x70ad[_0x5ad0e0];return _0x34ed13;};'use strict';var Sequelize=require(_0xd70a('0x0'));var rs=require('randomstring');module[_0xd70a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd70a('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xd70a('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd70a('0x4')]();}},'replyUri':{'type':Sequelize[_0xd70a('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd70a('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd70a('0x5')],'defaultValue':function(){return _0xd70a('0x6');}},'notificationSound':{'type':Sequelize[_0xd70a('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd70a('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd70a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd70a('0x3')]},'queueTransfer':{'type':Sequelize[_0xd70a('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd70a('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd70a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xd70a('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xd70a('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x52558d){if(!_0x52558d)this[_0xd70a('0xa')](_0xd70a('0xb'),null);this[_0xd70a('0xa')](_0xd70a('0xc'),_0x52558d);}}}; \ No newline at end of file +var _0xe58b=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xe58b,0x6e));var _0xbe58=function(_0x4e7f89,_0x128d45){_0x4e7f89=_0x4e7f89-0x0;var _0x512524=_0xe58b[_0x4e7f89];return _0x512524;};'use strict';var Sequelize=require(_0xbe58('0x0'));var rs=require(_0xbe58('0x1'));module[_0xbe58('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xbe58('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xbe58('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xbe58('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xbe58('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbe58('0x5');}},'notificationSound':{'type':Sequelize[_0xbe58('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbe58('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbe58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xbe58('0x4')]},'queueTransfer':{'type':Sequelize[_0xbe58('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbe58('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbe58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbe58('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xbe58('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x59dbce){if(!_0x59dbce)this[_0xbe58('0x9')](_0xbe58('0xa'),null);this[_0xbe58('0x9')](_0xbe58('0xb'),_0x59dbce);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 6c9c93b..aaf0f0f 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 _0x8b21=['OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','getAgents','out','OpenchannelMessage','Messages','dataValues','push','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','length','create','body','user','get','role','OpenchannelAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','applications','orderBy','asc','account','from','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x8b21,0xd7));var _0x18b2=function(_0x2e9c5f,_0x304e3a){_0x2e9c5f=_0x2e9c5f-0x0;var _0x1f1fb0=_0x8b21[_0x2e9c5f];return _0x1f1fb0;};'use strict';var emlformat=require(_0x18b2('0x0'));var rimraf=require(_0x18b2('0x1'));var zipdir=require(_0x18b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x18b2('0x3'));var moment=require('moment');var BPromise=require(_0x18b2('0x4'));var Mustache=require(_0x18b2('0x5'));var util=require('util');var path=require(_0x18b2('0x6'));var sox=require(_0x18b2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x18b2('0x8'));var _=require(_0x18b2('0x9'));var squel=require(_0x18b2('0xa'));var crypto=require(_0x18b2('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x18b2('0xc'));var querystring=require(_0x18b2('0xd'));var Papa=require(_0x18b2('0xe'));var Redis=require(_0x18b2('0xf'));var authService=require(_0x18b2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x18b2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x18b2('0x12'))(_0x18b2('0x13'));var utils=require(_0x18b2('0x14'));var config=require(_0x18b2('0x15'));var licenseUtil=require(_0x18b2('0x16'));var db=require(_0x18b2('0x17'))['db'];config[_0x18b2('0x18')]=_[_0x18b2('0x19')](config[_0x18b2('0x18')],{'host':_0x18b2('0x1a'),'port':0x18eb});var socket=require(_0x18b2('0x1b'))(new Redis(config[_0x18b2('0x18')]));require(_0x18b2('0x1c'))[_0x18b2('0x1d')](socket);var jayson=require(_0x18b2('0x1e'));var client=jayson[_0x18b2('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x18b2('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37e85c,_0x544ab1,_0x13535d,_0x240a84){return new BPromise(function(_0x69e40d,_0x23dac8){var _0x5c135b=_0x240a84||client;return _0x5c135b[_0x18b2('0x20')](_0x37e85c,_0x13535d)[_0x18b2('0x21')](function(_0x4965a4){logger[_0x18b2('0x22')](_0x18b2('0x23'),_0x544ab1,_0x18b2('0x24'));logger[_0x18b2('0x25')](_0x18b2('0x26'),_0x544ab1,'request\x20sent',JSON[_0x18b2('0x27')](_0x4965a4));if(_0x4965a4[_0x18b2('0x28')]){if(_0x4965a4[_0x18b2('0x28')][_0x18b2('0x29')]===0x1f4){logger[_0x18b2('0x28')](_0x18b2('0x23'),_0x544ab1,_0x4965a4[_0x18b2('0x28')]['message']);return _0x23dac8(_0x4965a4['error'][_0x18b2('0x2a')]);}logger[_0x18b2('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x544ab1,_0x4965a4[_0x18b2('0x28')][_0x18b2('0x2a')]);return _0x69e40d(_0x4965a4[_0x18b2('0x28')][_0x18b2('0x2a')]);}else{logger[_0x18b2('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x544ab1,'request\x20sent');_0x69e40d(_0x4965a4[_0x18b2('0x2b')][_0x18b2('0x2a')]);}})[_0x18b2('0x2c')](function(_0x3d4047){logger[_0x18b2('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x544ab1,_0x3d4047);_0x23dac8(_0x3d4047);});});}function respondWithStatusCode(_0x37943a,_0x4535bf){_0x4535bf=_0x4535bf||0xcc;return function(_0x3be0e2){if(_0x3be0e2){return _0x37943a['sendStatus'](_0x4535bf);}return _0x37943a[_0x18b2('0x2d')](_0x4535bf)[_0x18b2('0x2e')]();};}function respondWithResult(_0x3acd48,_0x542dd7){_0x542dd7=_0x542dd7||0xc8;return function(_0x2a3cfc){if(_0x2a3cfc){return _0x3acd48[_0x18b2('0x2d')](_0x542dd7)[_0x18b2('0x2f')](_0x2a3cfc);}};}function respondWithFilteredResult(_0x47f715,_0x1b581a){return function(_0x324d8f){if(_0x324d8f){var _0x5df551=typeof _0x1b581a[_0x18b2('0x30')]===_0x18b2('0x31')&&typeof _0x1b581a[_0x18b2('0x32')]===_0x18b2('0x31');var _0x1f75d1=_0x324d8f[_0x18b2('0x33')];var _0x5d2c69=_0x5df551?0x0:_0x1b581a['offset'];var _0x44e068=_0x5df551?_0x324d8f[_0x18b2('0x33')]:_0x1b581a[_0x18b2('0x30')]+_0x1b581a[_0x18b2('0x32')];var _0x2e7c14;if(_0x44e068>=_0x1f75d1){_0x44e068=_0x1f75d1;_0x2e7c14=0xc8;}else{_0x2e7c14=0xce;}_0x47f715[_0x18b2('0x2d')](_0x2e7c14);return _0x47f715[_0x18b2('0x34')]('Content-Range',_0x5d2c69+'-'+_0x44e068+'/'+_0x1f75d1)[_0x18b2('0x2f')](_0x324d8f);}return null;};}function patchUpdates(_0xd4b7cc){return function(_0x53d7aa){try{jsonpatch['apply'](_0x53d7aa,_0xd4b7cc,!![]);}catch(_0x11b648){return BPromise[_0x18b2('0x35')](_0x11b648);}return _0x53d7aa[_0x18b2('0x36')]();};}function saveUpdates(_0x1a785b,_0x45d953){return function(_0x5abb3d){if(_0x5abb3d){return _0x5abb3d[_0x18b2('0x37')](_0x1a785b)['then'](function(_0x1d652f){return _0x1d652f;});}return null;};}function removeEntity(_0x1a8724,_0x11f7cb){return function(_0x17c22d){if(_0x17c22d){return _0x17c22d[_0x18b2('0x38')]()['then'](function(){var _0x583b50=_0x17c22d['get']({'plain':!![]});var _0x5cff86='OpenchannelAccounts';return db[_0x18b2('0x39')][_0x18b2('0x38')]({'where':{'type':_0x5cff86,'resourceId':_0x583b50['id']}})[_0x18b2('0x21')](function(){return _0x17c22d;});})[_0x18b2('0x21')](function(){_0x1a8724[_0x18b2('0x2d')](0xcc)[_0x18b2('0x2e')]();});}};}function handleEntityNotFound(_0x328383,_0x492caf){return function(_0x57d668){if(!_0x57d668){_0x328383[_0x18b2('0x3a')](0x194);}return _0x57d668;};}function handleError(_0x387e81,_0x253cce){_0x253cce=_0x253cce||0x1f4;return function(_0x2fc701){logger['error'](_0x2fc701[_0x18b2('0x3b')]);if(_0x2fc701[_0x18b2('0x3c')]){delete _0x2fc701[_0x18b2('0x3c')];}_0x387e81[_0x18b2('0x2d')](_0x253cce)[_0x18b2('0x3d')](_0x2fc701);};}exports[_0x18b2('0x3e')]=function(_0x41bc86,_0x58ddc2){var _0x3d4846={'include':[{'model':db[_0x18b2('0x3f')],'as':'mandatoryDispositionPause'}]},_0x48423d={},_0xe9f3cd={'count':0x0,'rows':[]};var _0x558456=_[_0x18b2('0x40')](db[_0x18b2('0x41')][_0x18b2('0x42')],function(_0x17fc49){return{'name':_0x17fc49[_0x18b2('0x43')],'type':_0x17fc49[_0x18b2('0x44')][_0x18b2('0x45')]};});_0x48423d['model']=_[_0x18b2('0x40')](_0x558456,_0x18b2('0x3c'));_0x48423d['query']=_[_0x18b2('0x46')](_0x41bc86[_0x18b2('0x47')]);_0x48423d[_0x18b2('0x48')]=_['intersection'](_0x48423d['model'],_0x48423d[_0x18b2('0x47')]);_0x3d4846['attributes']=_[_0x18b2('0x49')](_0x48423d[_0x18b2('0x4a')],qs[_0x18b2('0x4b')](_0x41bc86[_0x18b2('0x47')][_0x18b2('0x4b')]));_0x3d4846['attributes']=_0x3d4846[_0x18b2('0x4c')]['length']?_0x3d4846['attributes']:_0x48423d[_0x18b2('0x4a')];if(!_0x41bc86[_0x18b2('0x47')][_0x18b2('0x4d')](_0x18b2('0x4e'))){_0x3d4846[_0x18b2('0x32')]=qs[_0x18b2('0x32')](_0x41bc86[_0x18b2('0x47')][_0x18b2('0x32')]);_0x3d4846[_0x18b2('0x30')]=qs['offset'](_0x41bc86[_0x18b2('0x47')][_0x18b2('0x30')]);}_0x3d4846[_0x18b2('0x4f')]=qs['sort'](_0x41bc86['query'][_0x18b2('0x50')]);_0x3d4846[_0x18b2('0x51')]=qs[_0x18b2('0x48')](_[_0x18b2('0x52')](_0x41bc86['query'],_0x48423d[_0x18b2('0x48')]),_0x558456);if(_0x41bc86[_0x18b2('0x47')][_0x18b2('0x53')]){_0x3d4846['where']=_[_0x18b2('0x54')](_0x3d4846[_0x18b2('0x51')],{'$or':_['map'](_0x558456,function(_0x3838b1){if(_0x3838b1[_0x18b2('0x44')]!==_0x18b2('0x55')){var _0x5ac4da={};_0x5ac4da[_0x3838b1[_0x18b2('0x3c')]]={'$like':'%'+_0x41bc86[_0x18b2('0x47')][_0x18b2('0x53')]+'%'};return _0x5ac4da;}})});}_0x3d4846=_[_0x18b2('0x54')]({},_0x3d4846,_0x41bc86[_0x18b2('0x56')]);var _0x4872ff={'where':_0x3d4846[_0x18b2('0x51')]};return db[_0x18b2('0x41')][_0x18b2('0x33')](_0x4872ff)[_0x18b2('0x21')](function(_0x27ddde){_0xe9f3cd['count']=_0x27ddde;if(_0x41bc86[_0x18b2('0x47')][_0x18b2('0x57')]){_0x3d4846[_0x18b2('0x58')]=[{'all':!![]}];}return db[_0x18b2('0x41')][_0x18b2('0x59')](_0x3d4846);})[_0x18b2('0x21')](function(_0x31d7a1){_0xe9f3cd[_0x18b2('0x5a')]=_0x31d7a1;return _0xe9f3cd;})[_0x18b2('0x21')](respondWithFilteredResult(_0x58ddc2,_0x3d4846))[_0x18b2('0x2c')](handleError(_0x58ddc2,null));};exports[_0x18b2('0x5b')]=function(_0x3a58e3,_0x1ee730){var _0x5f5164={'raw':![],'where':{'id':_0x3a58e3[_0x18b2('0x5c')]['id']},'include':[{'model':db[_0x18b2('0x3f')],'as':_0x18b2('0x5d')}]},_0x4526e2={};_0x4526e2[_0x18b2('0x4a')]=_['keys'](db[_0x18b2('0x41')][_0x18b2('0x42')]);_0x4526e2[_0x18b2('0x47')]=_[_0x18b2('0x46')](_0x3a58e3[_0x18b2('0x47')]);_0x4526e2['filters']=_[_0x18b2('0x49')](_0x4526e2[_0x18b2('0x4a')],_0x4526e2[_0x18b2('0x47')]);_0x5f5164['attributes']=_[_0x18b2('0x49')](_0x4526e2[_0x18b2('0x4a')],qs[_0x18b2('0x4b')](_0x3a58e3[_0x18b2('0x47')][_0x18b2('0x4b')]));_0x5f5164[_0x18b2('0x4c')]=_0x5f5164[_0x18b2('0x4c')][_0x18b2('0x5e')]?_0x5f5164['attributes']:_0x4526e2[_0x18b2('0x4a')];if(_0x3a58e3[_0x18b2('0x47')][_0x18b2('0x57')]){_0x5f5164[_0x18b2('0x58')]=[{'all':!![]}];}_0x5f5164=_[_0x18b2('0x54')]({},_0x5f5164,_0x3a58e3['options']);return db[_0x18b2('0x41')]['find'](_0x5f5164)[_0x18b2('0x21')](handleEntityNotFound(_0x1ee730,null))[_0x18b2('0x21')](respondWithResult(_0x1ee730,null))[_0x18b2('0x2c')](handleError(_0x1ee730,null));};exports[_0x18b2('0x5f')]=function(_0x2818c6,_0x242df6){return db[_0x18b2('0x41')][_0x18b2('0x5f')](_0x2818c6[_0x18b2('0x60')],{})[_0x18b2('0x21')](function(_0x433e2a){var _0x2242e8=_0x2818c6[_0x18b2('0x61')][_0x18b2('0x62')]({'plain':!![]});if(!_0x2242e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2242e8[_0x18b2('0x63')]===_0x18b2('0x61')){var _0x593a4f=_0x433e2a[_0x18b2('0x62')]({'plain':!![]});var _0xeeecbd=_0x18b2('0x64');return db[_0x18b2('0x65')][_0x18b2('0x66')]({'where':{'name':_0xeeecbd,'userProfileId':_0x2242e8[_0x18b2('0x67')]},'raw':!![]})['then'](function(_0x2f00c0){if(_0x2f00c0&&_0x2f00c0[_0x18b2('0x68')]===0x0){return db[_0x18b2('0x39')][_0x18b2('0x5f')]({'name':_0x593a4f['name'],'resourceId':_0x593a4f['id'],'type':_0x2f00c0['name'],'sectionId':_0x2f00c0['id']},{})[_0x18b2('0x21')](function(){return _0x433e2a;});}else{return _0x433e2a;}})[_0x18b2('0x2c')](function(_0x1cc563){logger[_0x18b2('0x28')](_0x18b2('0x69'),_0x1cc563);throw _0x1cc563;});}return _0x433e2a;})[_0x18b2('0x21')](respondWithResult(_0x242df6,0xc9))[_0x18b2('0x2c')](handleError(_0x242df6,null));};exports[_0x18b2('0x37')]=function(_0x380a93,_0x4c70d6){if(_0x380a93['body']['id']){delete _0x380a93[_0x18b2('0x60')]['id'];}return db[_0x18b2('0x41')][_0x18b2('0x66')]({'where':{'id':_0x380a93[_0x18b2('0x5c')]['id']},'include':[{'model':db[_0x18b2('0x3f')],'as':_0x18b2('0x5d')}]})[_0x18b2('0x21')](handleEntityNotFound(_0x4c70d6,null))[_0x18b2('0x21')](saveUpdates(_0x380a93[_0x18b2('0x60')],null))[_0x18b2('0x21')](respondWithResult(_0x4c70d6,null))['catch'](handleError(_0x4c70d6,null));};exports['destroy']=function(_0xdbdadc,_0x23bdad){return db['OpenchannelAccount']['find']({'where':{'id':_0xdbdadc[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x23bdad,null))[_0x18b2('0x21')](removeEntity(_0x23bdad,null))['catch'](handleError(_0x23bdad,null));};exports['describe']=function(_0x583c9c,_0x53d0ec){return db['OpenchannelAccount'][_0x18b2('0x6a')]()['then'](respondWithResult(_0x53d0ec,null))['catch'](handleError(_0x53d0ec,null));};exports[_0x18b2('0x6b')]=function(_0x415400,_0x13c21e,_0xfce0d0){if(_0x415400[_0x18b2('0x60')]['id']){delete _0x415400[_0x18b2('0x60')]['id'];}return db[_0x18b2('0x41')][_0x18b2('0x66')]({'where':{'id':_0x415400['params']['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x13c21e,null))[_0x18b2('0x21')](function(_0x34f0cc){if(_0x34f0cc){_0x415400['body'][_0x18b2('0x6c')]=_0x34f0cc['id'];return db[_0x18b2('0x6d')][_0x18b2('0x5f')](_0x415400[_0x18b2('0x60')]);}})[_0x18b2('0x21')](respondWithResult(_0x13c21e,null))['catch'](handleError(_0x13c21e,null));};exports[_0x18b2('0x6e')]=function(_0x42dfb1,_0x6a903c,_0x1dcb25){var _0x4b5f30={'raw':![],'where':{}};var _0x271a42={};var _0x59f102={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x18b2('0x6f')]({'where':{'id':_0x42dfb1[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x6a903c,null))['then'](function(_0x2cf549){if(_0x2cf549){_0x271a42[_0x18b2('0x4a')]=_[_0x18b2('0x46')](db[_0x18b2('0x6d')][_0x18b2('0x42')]);_0x271a42[_0x18b2('0x47')]=_[_0x18b2('0x46')](_0x42dfb1[_0x18b2('0x47')]);_0x271a42[_0x18b2('0x48')]=_[_0x18b2('0x49')](_0x271a42[_0x18b2('0x4a')],_0x271a42[_0x18b2('0x47')]);_0x4b5f30['attributes']=_[_0x18b2('0x49')](_0x271a42[_0x18b2('0x4a')],qs[_0x18b2('0x4b')](_0x42dfb1[_0x18b2('0x47')]['fields']));_0x4b5f30[_0x18b2('0x4c')]=_0x4b5f30['attributes'][_0x18b2('0x5e')]?_0x4b5f30[_0x18b2('0x4c')]:_0x271a42[_0x18b2('0x4a')];if(!_0x42dfb1[_0x18b2('0x47')][_0x18b2('0x4d')](_0x18b2('0x4e'))){_0x4b5f30[_0x18b2('0x32')]=qs[_0x18b2('0x32')](_0x42dfb1[_0x18b2('0x47')][_0x18b2('0x32')]);_0x4b5f30[_0x18b2('0x30')]=qs[_0x18b2('0x30')](_0x42dfb1['query'][_0x18b2('0x30')]);}_0x4b5f30[_0x18b2('0x4f')]=qs[_0x18b2('0x50')](_0x42dfb1[_0x18b2('0x47')][_0x18b2('0x50')]);_0x4b5f30[_0x18b2('0x51')]=qs[_0x18b2('0x48')](_['pick'](_0x42dfb1[_0x18b2('0x47')],_0x271a42[_0x18b2('0x48')]));_0x4b5f30[_0x18b2('0x51')][_0x18b2('0x6c')]=_0x2cf549['id'];if(_0x42dfb1[_0x18b2('0x47')][_0x18b2('0x53')]){_0x4b5f30['where']=_['merge'](_0x4b5f30[_0x18b2('0x51')],{'$or':_[_0x18b2('0x40')](_0x4b5f30['attributes'],function(_0x4e5549){var _0x5ee2b7={};_0x5ee2b7[_0x4e5549]={'$like':'%'+_0x42dfb1[_0x18b2('0x47')][_0x18b2('0x53')]+'%'};return _0x5ee2b7;})});}_0x4b5f30=_[_0x18b2('0x54')]({},_0x4b5f30,_0x42dfb1[_0x18b2('0x56')]);return db[_0x18b2('0x6d')]['count']({'where':_0x4b5f30['where']})[_0x18b2('0x21')](function(_0x574929){_0x59f102[_0x18b2('0x33')]=_0x574929;if(_0x42dfb1[_0x18b2('0x47')][_0x18b2('0x57')]){_0x4b5f30[_0x18b2('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x18b2('0x59')](_0x4b5f30);})[_0x18b2('0x21')](function(_0x304114){_0x59f102[_0x18b2('0x5a')]=_0x304114;return _0x59f102;});}})[_0x18b2('0x21')](respondWithFilteredResult(_0x6a903c,_0x4b5f30))['catch'](handleError(_0x6a903c,null));};exports[_0x18b2('0x70')]=function(_0x1cc413,_0x539445,_0x5eed83){return db['OpenchannelAccount'][_0x18b2('0x66')]({'where':{'id':_0x1cc413[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x539445,null))[_0x18b2('0x21')](function(_0x290bb4){if(_0x290bb4){return _0x290bb4[_0x18b2('0x70')](_0x1cc413[_0x18b2('0x47')]['ids']);}})[_0x18b2('0x21')](respondWithStatusCode(_0x539445,null))[_0x18b2('0x2c')](handleError(_0x539445,null));};exports[_0x18b2('0x71')]=function(_0xdb2802,_0x1c7a8c,_0x5a460f){if(_0xdb2802[_0x18b2('0x60')]['id']){delete _0xdb2802[_0x18b2('0x60')]['id'];}return db['OpenchannelAccount'][_0x18b2('0x66')]({'where':{'id':_0xdb2802[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x1c7a8c,null))[_0x18b2('0x21')](function(_0x233c03){if(_0x233c03){_0xdb2802['body']['OpenchannelAccountId']=_0x233c03['id'];return db[_0x18b2('0x72')][_0x18b2('0x5f')](_0xdb2802[_0x18b2('0x60')]);}})[_0x18b2('0x21')](respondWithResult(_0x1c7a8c,null))[_0x18b2('0x2c')](handleError(_0x1c7a8c,null));};exports['getAnswers']=function(_0x22736e,_0x2c62d1,_0x2d6f43){var _0x9fef7e={'raw':![],'where':{}};var _0x3cb0cf={};var _0xe6a8d1={'count':0x0,'rows':[]};return db[_0x18b2('0x41')][_0x18b2('0x6f')]({'where':{'id':_0x22736e[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x2c62d1,null))['then'](function(_0x5e0a8c){if(_0x5e0a8c){_0x3cb0cf['model']=_[_0x18b2('0x46')](db[_0x18b2('0x72')][_0x18b2('0x42')]);_0x3cb0cf[_0x18b2('0x47')]=_[_0x18b2('0x46')](_0x22736e[_0x18b2('0x47')]);_0x3cb0cf['filters']=_['intersection'](_0x3cb0cf[_0x18b2('0x4a')],_0x3cb0cf[_0x18b2('0x47')]);_0x9fef7e['attributes']=_['intersection'](_0x3cb0cf[_0x18b2('0x4a')],qs['fields'](_0x22736e[_0x18b2('0x47')][_0x18b2('0x4b')]));_0x9fef7e['attributes']=_0x9fef7e['attributes']['length']?_0x9fef7e['attributes']:_0x3cb0cf['model'];if(!_0x22736e[_0x18b2('0x47')][_0x18b2('0x4d')](_0x18b2('0x4e'))){_0x9fef7e[_0x18b2('0x32')]=qs['limit'](_0x22736e[_0x18b2('0x47')][_0x18b2('0x32')]);_0x9fef7e[_0x18b2('0x30')]=qs['offset'](_0x22736e[_0x18b2('0x47')][_0x18b2('0x30')]);}_0x9fef7e[_0x18b2('0x4f')]=qs[_0x18b2('0x50')](_0x22736e['query'][_0x18b2('0x50')]);_0x9fef7e[_0x18b2('0x51')]=qs[_0x18b2('0x48')](_[_0x18b2('0x52')](_0x22736e[_0x18b2('0x47')],_0x3cb0cf[_0x18b2('0x48')]));_0x9fef7e[_0x18b2('0x51')][_0x18b2('0x6c')]=_0x5e0a8c['id'];if(_0x22736e[_0x18b2('0x47')]['filter']){_0x9fef7e['where']=_[_0x18b2('0x54')](_0x9fef7e[_0x18b2('0x51')],{'$or':_[_0x18b2('0x40')](_0x9fef7e['attributes'],function(_0x5f2fa0){var _0x3ae0e6={};_0x3ae0e6[_0x5f2fa0]={'$like':'%'+_0x22736e[_0x18b2('0x47')][_0x18b2('0x53')]+'%'};return _0x3ae0e6;})});}_0x9fef7e=_[_0x18b2('0x54')]({},_0x9fef7e,_0x22736e[_0x18b2('0x56')]);return db[_0x18b2('0x72')]['count']({'where':_0x9fef7e[_0x18b2('0x51')]})[_0x18b2('0x21')](function(_0x49fe6f){_0xe6a8d1[_0x18b2('0x33')]=_0x49fe6f;if(_0x22736e['query'][_0x18b2('0x57')]){_0x9fef7e[_0x18b2('0x58')]=[{'all':!![]}];}return db[_0x18b2('0x72')][_0x18b2('0x59')](_0x9fef7e);})[_0x18b2('0x21')](function(_0x346f95){_0xe6a8d1[_0x18b2('0x5a')]=_0x346f95;return _0xe6a8d1;});}})[_0x18b2('0x21')](respondWithFilteredResult(_0x2c62d1,_0x9fef7e))[_0x18b2('0x2c')](handleError(_0x2c62d1,null));};exports[_0x18b2('0x73')]=function(_0x183ee8,_0x3fd330,_0x2062ed){return db[_0x18b2('0x41')][_0x18b2('0x66')]({'where':{'id':_0x183ee8['params']['id']}})['then'](handleEntityNotFound(_0x3fd330,null))[_0x18b2('0x21')](function(_0x5eaad7){if(_0x5eaad7){return _0x5eaad7[_0x18b2('0x73')](_0x183ee8['query'][_0x18b2('0x74')]);}})[_0x18b2('0x21')](respondWithStatusCode(_0x3fd330,null))['catch'](handleError(_0x3fd330,null));};exports[_0x18b2('0x75')]=function(_0x15feca,_0x6b13e5,_0x43a0cd){var _0x11f535={'body':_0x15feca[_0x18b2('0x60')],'channel':_0x18b2('0x76')};var _0x3090f2=[];var _0x258e49=[];var _0x3d76ec={};var _0x3d4860=![];return db[_0x18b2('0x77')][_0x18b2('0x6a')]()[_0x18b2('0x21')](function(_0x198255){if(!_0x198255){throw new db[(_0x18b2('0x78'))][(_0x18b2('0x79'))](_0x18b2('0x7a'));}_0x3090f2=_[_0x18b2('0x7b')](_[_0x18b2('0x46')](_0x198255),[_0x18b2('0x7c'),_0x18b2('0x7d')]);_0x258e49=_[_0x18b2('0x7b')](_[_0x18b2('0x46')](_0x198255),[_0x18b2('0x7c'),_0x18b2('0x7d'),'CompanyId',_0x18b2('0x7e')]);if(_0x15feca[_0x18b2('0x60')]['id']){delete _0x15feca[_0x18b2('0x60')]['id'];}if(_['isNil'](_0x15feca[_0x18b2('0x60')]['from'])){throw new db['Sequelize'][(_0x18b2('0x79'))]('from\x20is\x20mandatory');}if(_[_0x18b2('0x7f')](_0x15feca[_0x18b2('0x60')]['body'])||_0x15feca['body']['body']===''){throw new db[(_0x18b2('0x78'))][(_0x18b2('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x18b2('0x7f')](_0x15feca[_0x18b2('0x60')][_0x18b2('0x80')])){throw new db[(_0x18b2('0x78'))][(_0x18b2('0x79'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x258e49);}if(!_['includes'](_0x258e49,_0x15feca['body'][_0x18b2('0x80')])){throw new db['Sequelize'][(_0x18b2('0x79'))](_0x18b2('0x81')+_0x258e49);}_0x3d76ec[_0x15feca[_0x18b2('0x60')][_0x18b2('0x80')]]=_0x15feca[_0x18b2('0x60')]['from'];})['then'](function(){return db[_0x18b2('0x41')][_0x18b2('0x66')]({'where':{'id':_0x15feca[_0x18b2('0x5c')]['id']},'include':[{'model':db[_0x18b2('0x82')],'as':'List','include':[{'model':db['CmContact'],'as':_0x18b2('0x83'),'where':_0x3d76ec,'limit':0x1,'order':[[_0x18b2('0x7d'),_0x18b2('0x84')]]}]},{'model':db['OpenchannelApplication'],'as':_0x18b2('0x85')}]});})[_0x18b2('0x21')](handleEntityNotFound(_0x6b13e5,null))[_0x18b2('0x21')](function(_0x461562){if(_0x461562&&_0x461562[_0x18b2('0x86')]){_0x11f535['account']=_0x461562;_0x11f535[_0x18b2('0x87')]=_0x461562[_0x18b2('0x85')];_0x11f535['list']=_0x461562['List'];_0x11f535[_0x18b2('0x87')]=_[_0x18b2('0x88')](_0x11f535[_0x18b2('0x87')],['priority'],[_0x18b2('0x89')]);if(_0x11f535[_0x18b2('0x8a')]['Applications']){delete _0x11f535['account'][_0x18b2('0x85')];}if(_0x11f535[_0x18b2('0x8a')][_0x18b2('0x86')]&&_0x11f535[_0x18b2('0x8a')][_0x18b2('0x86')][_0x18b2('0x83')][_0x18b2('0x5e')]){return _0x11f535['account'][_0x18b2('0x86')]['Contacts'][0x0];}var _0x242ad5=_[_0x18b2('0x19')](_0x15feca[_0x18b2('0x60')],{'firstName':_0x15feca[_0x18b2('0x60')][_0x18b2('0x8b')],'ListId':_0x461562[_0x18b2('0x7e')]});_0x242ad5[_0x15feca[_0x18b2('0x60')][_0x18b2('0x80')]]=_0x15feca[_0x18b2('0x60')][_0x18b2('0x8b')];return db[_0x18b2('0x77')]['create'](_0x242ad5,{'fields':_0x3090f2,'raw':!![]});}})[_0x18b2('0x21')](handleEntityNotFound(_0x6b13e5,null))[_0x18b2('0x21')](function(_0x1e8f56){_0x11f535[_0x18b2('0x8c')]=_0x1e8f56;if(_0x1e8f56){var _0x1d312f={'ContactId':_0x1e8f56['id'],'OpenchannelAccountId':_0x15feca['params']['id'],'from':(_0x1e8f56[_0x18b2('0x8d')]||'')+'\x20'+(_0x1e8f56[_0x18b2('0x8e')]||'')};var _0x39f918={'OpenchannelAccountId':_0x15feca[_0x18b2('0x5c')]['id'],'closed':![]};if(_0x15feca['body'][_0x18b2('0x8f')]){_0x39f918[_0x18b2('0x8f')]=_0x15feca[_0x18b2('0x60')][_0x18b2('0x8f')];return db[_0x18b2('0x90')][_0x18b2('0x66')]({'where':_0x39f918})[_0x18b2('0x21')](function(_0x306408){if(_0x306408){return[_0x306408,![]];}_0x1d312f['threadId']=_0x15feca[_0x18b2('0x60')][_0x18b2('0x8f')];_0x1d312f[_0x18b2('0x91')]=_0x15feca[_0x18b2('0x60')]['externalUrl'];return db[_0x18b2('0x90')]['create'](_0x1d312f)[_0x18b2('0x21')](function(_0x46745e){return[_0x46745e,!![]];});});}else{_0x39f918[_0x18b2('0x8f')]=null;}_0x39f918[_0x18b2('0x92')]=_0x1e8f56['id'];return db[_0x18b2('0x90')][_0x18b2('0x66')]({'where':_0x39f918})[_0x18b2('0x21')](function(_0x2e74b2){if(_0x2e74b2){return[_0x2e74b2,![]];}return db[_0x18b2('0x90')][_0x18b2('0x5f')](_0x1d312f)[_0x18b2('0x21')](function(_0x1001e2){return[_0x1001e2,!![]];});});}})[_0x18b2('0x93')](function(_0x12aa3b,_0x5d43d2){if(_0x12aa3b){_0x3d4860=_0x5d43d2;if(!_0x5d43d2){var _0x27d3eb={'from':(_0x11f535['contact'][_0x18b2('0x8d')]||'')+'\x20'+(_0x11f535[_0x18b2('0x8c')]['lastName']||'')};if(_0x15feca['body'][_0x18b2('0x8f')]&&_0x15feca[_0x18b2('0x60')][_0x18b2('0x94')]&&_0x15feca['body'][_0x18b2('0x8f')]!=_0x15feca[_0x18b2('0x60')][_0x18b2('0x94')]){_0x27d3eb[_0x18b2('0x8f')]=_0x15feca['body'][_0x18b2('0x94')];}return _0x12aa3b[_0x18b2('0x37')](_0x27d3eb);}else{return _0x12aa3b;}}})[_0x18b2('0x21')](function(_0x57b263){_0x11f535['interaction']=_0x57b263['get']({'plain':!![]});_0x11f535[_0x18b2('0x95')][_0x18b2('0x96')]=_0x3d4860;if(_0x11f535[_0x18b2('0x95')][_0x18b2('0x96')]){if(_0x11f535[_0x18b2('0x8a')]['autoclose']){_0x11f535['applications']['push']({'id':0x0,'priority':_0x11f535[_0x18b2('0x87')][_0x18b2('0x5e')]+0x1,'app':_0x18b2('0x97'),'appdata':_0x18b2('0x98'),'interval':_0x18b2('0x99')});}}return db['OpenchannelMessage'][_0x18b2('0x5f')]({'body':_0x15feca['body']['body'],'OpenchannelAccountId':_0x15feca['params']['id'],'OpenchannelInteractionId':_0x57b263['id'],'direction':'in','ContactId':_0x11f535['contact']['id'],'AttachmentId':_0x15feca[_0x18b2('0x60')][_0x18b2('0x9a')]});})[_0x18b2('0x21')](function(_0x1f9522){_0x11f535['message']=_0x1f9522;if(_0x11f535[_0x18b2('0x95')][_0x18b2('0x9b')]){return db[_0x18b2('0x9c')][_0x18b2('0x66')]({'attributes':['id','name'],'where':{'id':_0x11f535[_0x18b2('0x95')][_0x18b2('0x9b')]}})['then'](function(_0x5b6ba1){if(_0x5b6ba1){_0x11f535[_0x18b2('0x87')][_0x18b2('0x9d')]({'id':0x0,'priority':0x0,'app':_0x18b2('0x9e'),'appdata':_0x5b6ba1['name']+','+(_0x11f535[_0x18b2('0x8a')][_0x18b2('0x9f')]||0xa),'interval':_0x18b2('0x99')});_0x11f535[_0x18b2('0xa0')]=![];}return respondWithRpcPromise(_0x18b2('0xa1'),_0x18b2('0xa2'),_0x11f535);});}return respondWithRpcPromise(_0x18b2('0xa1'),_0x18b2('0xa2'),_0x11f535);})[_0x18b2('0x21')](function(_0x41df80){respondWithRpcPromise(_0x18b2('0xa3'),_0x18b2('0xa3'),{'event':'notify','message':_0x41df80},client9002);return _0x41df80;})['then'](respondWithResult(_0x6b13e5,null))[_0x18b2('0x2c')](handleError(_0x6b13e5,null));};exports[_0x18b2('0xa4')]=function(_0x2ec37c,_0xdf7a9d,_0x49c6f2){return db[_0x18b2('0x41')]['findOne']({'where':{'id':_0x2ec37c[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0xdf7a9d,null))[_0x18b2('0x21')](function(_0x40eb61){if(_0x40eb61){return db[_0x18b2('0xa5')][_0x18b2('0xa6')](function(_0x5e2a3b){return db[_0x18b2('0xa7')][_0x18b2('0x38')]({'where':{'OpenchannelAccountId':_0x2ec37c['params']['id']},'transaction':_0x5e2a3b})[_0x18b2('0x21')](function(_0x1899b4){var _0x2dd4a6=_[_0x18b2('0x40')](_0x2ec37c[_0x18b2('0x60')],function(_0x3c3b99){_0x3c3b99[_0x18b2('0x6c')]=_0x2ec37c[_0x18b2('0x5c')]['id'];return _0x3c3b99;});return db[_0x18b2('0xa7')][_0x18b2('0xa8')](_0x2dd4a6,{'transaction':_0x5e2a3b});});})[_0x18b2('0x21')](function(){return db['OpenchannelApplication'][_0x18b2('0xa9')]({'where':{'OpenchannelAccountId':_0x2ec37c['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0xdf7a9d,null))[_0x18b2('0x2c')](handleError(_0xdf7a9d,null));};exports[_0x18b2('0xaa')]=function(_0x2f3777,_0x58a8ea,_0x1a3244){var _0x427739={};var _0x28a5f5={};var _0x3384a3;var _0x4dd16a;return db[_0x18b2('0x41')]['findOne']({'where':{'id':_0x2f3777[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x58a8ea,null))['then'](function(_0x1cbce3){if(_0x1cbce3){_0x3384a3=_0x1cbce3;_0x28a5f5[_0x18b2('0x4a')]=_[_0x18b2('0x46')](db[_0x18b2('0xa7')][_0x18b2('0x42')]);_0x28a5f5['query']=_['keys'](_0x2f3777[_0x18b2('0x47')]);_0x28a5f5['filters']=_['intersection'](_0x28a5f5[_0x18b2('0x4a')],_0x28a5f5['query']);_0x427739[_0x18b2('0x4c')]=_['intersection'](_0x28a5f5['model'],qs[_0x18b2('0x4b')](_0x2f3777['query'][_0x18b2('0x4b')]));_0x427739['attributes']=_0x427739[_0x18b2('0x4c')][_0x18b2('0x5e')]?_0x427739[_0x18b2('0x4c')]:_0x28a5f5['model'];_0x427739[_0x18b2('0x4f')]=qs[_0x18b2('0x50')](_0x2f3777[_0x18b2('0x47')]['sort']);_0x427739[_0x18b2('0x51')]=qs[_0x18b2('0x48')](_[_0x18b2('0x52')](_0x2f3777[_0x18b2('0x47')],_0x28a5f5[_0x18b2('0x48')]));if(_0x2f3777['query'][_0x18b2('0x53')]){_0x427739[_0x18b2('0x51')]=_[_0x18b2('0x54')](_0x427739['where'],{'$or':_['map'](_0x427739[_0x18b2('0x4c')],function(_0x373388){var _0x2aa398={};_0x2aa398[_0x373388]={'$like':'%'+_0x2f3777[_0x18b2('0x47')][_0x18b2('0x53')]+'%'};return _0x2aa398;})});}_0x427739=_[_0x18b2('0x54')]({},_0x427739,_0x2f3777[_0x18b2('0x56')]);return _0x3384a3['getApplications'](_0x427739);}})[_0x18b2('0x21')](function(_0x219f9d){if(_0x219f9d){_0x4dd16a=_0x219f9d[_0x18b2('0x5e')];if(!_0x2f3777['query']['hasOwnProperty']('nolimit')){_0x427739[_0x18b2('0x32')]=qs[_0x18b2('0x32')](_0x2f3777[_0x18b2('0x47')][_0x18b2('0x32')]);_0x427739['offset']=qs[_0x18b2('0x30')](_0x2f3777[_0x18b2('0x47')][_0x18b2('0x30')]);}return _0x3384a3['getApplications'](_0x427739);}})[_0x18b2('0x21')](function(_0x1f4ea5){if(_0x1f4ea5){return _0x1f4ea5?{'count':_0x4dd16a,'rows':_0x1f4ea5}:null;}})['then'](respondWithResult(_0x58a8ea,null))[_0x18b2('0x2c')](handleError(_0x58a8ea,null));};exports[_0x18b2('0xab')]=function(_0x4914c9,_0x531a7a,_0xe52278){var _0x4196f8={'raw':![],'where':{}};var _0x326878={};var _0x23da9f={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x18b2('0x6f')]({'where':{'id':_0x4914c9[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x531a7a,null))[_0x18b2('0x21')](function(_0x4f1f26){if(_0x4f1f26){_0x326878[_0x18b2('0x4a')]=_[_0x18b2('0x46')](db[_0x18b2('0x90')]['rawAttributes']);_0x326878[_0x18b2('0x47')]=_[_0x18b2('0x46')](_0x4914c9['query']);_0x326878[_0x18b2('0x48')]=_[_0x18b2('0x49')](_0x326878[_0x18b2('0x4a')],_0x326878[_0x18b2('0x47')]);_0x4196f8[_0x18b2('0x4c')]=_[_0x18b2('0x49')](_0x326878[_0x18b2('0x4a')],qs[_0x18b2('0x4b')](_0x4914c9['query'][_0x18b2('0x4b')]));_0x4196f8[_0x18b2('0x4c')]=_0x4196f8[_0x18b2('0x4c')][_0x18b2('0x5e')]?_0x4196f8[_0x18b2('0x4c')]:_0x326878['model'];if(!_0x4914c9[_0x18b2('0x47')][_0x18b2('0x4d')]('nolimit')){_0x4196f8[_0x18b2('0x32')]=qs[_0x18b2('0x32')](_0x4914c9['query'][_0x18b2('0x32')]);_0x4196f8[_0x18b2('0x30')]=qs[_0x18b2('0x30')](_0x4914c9[_0x18b2('0x47')][_0x18b2('0x30')]);}_0x4196f8[_0x18b2('0x4f')]=qs[_0x18b2('0x50')](_0x4914c9['query'][_0x18b2('0x50')]);_0x4196f8[_0x18b2('0x51')]=qs[_0x18b2('0x48')](_[_0x18b2('0x52')](_0x4914c9[_0x18b2('0x47')],_0x326878[_0x18b2('0x48')]));_0x4196f8[_0x18b2('0x51')][_0x18b2('0x6c')]=_0x4f1f26['id'];if(_0x4914c9[_0x18b2('0x47')][_0x18b2('0x53')]){_0x4196f8[_0x18b2('0x51')]=_[_0x18b2('0x54')](_0x4196f8[_0x18b2('0x51')],{'$or':_[_0x18b2('0x40')](_0x4196f8[_0x18b2('0x4c')],function(_0x20266d){var _0x510ab5={};_0x510ab5[_0x20266d]={'$like':'%'+_0x4914c9[_0x18b2('0x47')]['filter']+'%'};return _0x510ab5;})});}_0x4196f8=_[_0x18b2('0x54')]({},_0x4196f8,_0x4914c9[_0x18b2('0x56')]);return db[_0x18b2('0x90')][_0x18b2('0x33')]({'where':_0x4196f8[_0x18b2('0x51')]})['then'](function(_0x40cb51){_0x23da9f['count']=_0x40cb51;if(_0x4914c9[_0x18b2('0x47')][_0x18b2('0x57')]){_0x4196f8[_0x18b2('0x58')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0x18b2('0xac'),'attributes':[_0x18b2('0x3c'),_0x18b2('0xad'),_0x18b2('0xae')],'required':![]},{'model':db[_0x18b2('0xaf')],'as':_0x18b2('0xb0'),'attributes':['id',_0x18b2('0x3c'),_0x18b2('0xb1')],'where':_0x4914c9[_0x18b2('0x47')][_0x18b2('0xb2')]?{'id':_0x4914c9['query'][_0x18b2('0xb2')]}:undefined,'required':_0x4914c9['query'][_0x18b2('0xb2')]?!![]:![]}];}return db[_0x18b2('0x90')][_0x18b2('0x59')](_0x4196f8);})[_0x18b2('0x21')](function(_0x450d4f){_0x23da9f[_0x18b2('0x5a')]=_0x450d4f;return _0x23da9f;});}})[_0x18b2('0x21')](respondWithFilteredResult(_0x531a7a,_0x4196f8))[_0x18b2('0x2c')](handleError(_0x531a7a,null));};exports[_0x18b2('0xb3')]=function(_0x5142d8,_0x18fe8c,_0x2cbe96){return db[_0x18b2('0x41')]['find']({'where':{'id':_0x5142d8[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x18fe8c,null))['then'](function(_0x4b3247){if(_0x4b3247){return _0x4b3247[_0x18b2('0xb3')](_0x5142d8['body'][_0x18b2('0x74')],_[_0x18b2('0xb4')](_0x5142d8[_0x18b2('0x60')],[_0x18b2('0x74'),'id'])||{})[_0x18b2('0x93')](function(_0x1f3ba0){for(var _0xd6aff6=0x0;_0xd6aff6<_0x5142d8[_0x18b2('0x60')][_0x18b2('0x74')][_0x18b2('0x5e')];_0xd6aff6+=0x1){socket[_0x18b2('0xb5')](_0x18b2('0xb6'),{'UserId':Number(_0x5142d8[_0x18b2('0x60')][_0x18b2('0x74')][_0xd6aff6]),'OpenchannelAccountId':Number(_0x5142d8[_0x18b2('0x5c')]['id'])});}return _0x1f3ba0;});}})[_0x18b2('0x21')](respondWithResult(_0x18fe8c,null))[_0x18b2('0x2c')](handleError(_0x18fe8c,null));};exports[_0x18b2('0xb7')]=function(_0x1ea55e,_0x4669fc,_0xb36cf2){return db['OpenchannelAccount'][_0x18b2('0x66')]({'where':{'id':_0x1ea55e['params']['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x4669fc,null))['then'](function(_0x539321){if(_0x539321){return _0x539321[_0x18b2('0xb7')](_0x1ea55e[_0x18b2('0x47')][_0x18b2('0x74')])[_0x18b2('0x21')](function(){if(_[_0x18b2('0xb8')](_0x1ea55e['query'][_0x18b2('0x74')])){for(var _0x48bb5a=0x0;_0x48bb5a<_0x1ea55e['query'][_0x18b2('0x74')][_0x18b2('0x5e')];_0x48bb5a+=0x1){socket[_0x18b2('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1ea55e[_0x18b2('0x47')]['ids'][_0x48bb5a]),'OpenchannelAccountId':Number(_0x1ea55e['params']['id'])});}}else{socket[_0x18b2('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1ea55e[_0x18b2('0x47')][_0x18b2('0x74')]),'OpenchannelAccountId':Number(_0x1ea55e[_0x18b2('0x5c')]['id'])});}});}})[_0x18b2('0x21')](respondWithStatusCode(_0x4669fc,null))[_0x18b2('0x2c')](handleError(_0x4669fc,null));};exports[_0x18b2('0xb9')]=function(_0x429fc5,_0x411278,_0x36f046){var _0x501ff2={};var _0x4c691f={};var _0x2dd939;var _0x542034;return db[_0x18b2('0x41')]['findOne']({'where':{'id':_0x429fc5['params']['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x411278,null))[_0x18b2('0x21')](function(_0x10e7ef){if(_0x10e7ef){_0x2dd939=_0x10e7ef;_0x4c691f[_0x18b2('0x4a')]=_[_0x18b2('0x46')](db['User'][_0x18b2('0x42')]);_0x4c691f['query']=_['keys'](_0x429fc5[_0x18b2('0x47')]);_0x4c691f[_0x18b2('0x48')]=_[_0x18b2('0x49')](_0x4c691f[_0x18b2('0x4a')],_0x4c691f[_0x18b2('0x47')]);_0x501ff2[_0x18b2('0x4c')]=_[_0x18b2('0x49')](_0x4c691f[_0x18b2('0x4a')],qs[_0x18b2('0x4b')](_0x429fc5['query'][_0x18b2('0x4b')]));_0x501ff2['attributes']=_0x501ff2['attributes']['length']?_0x501ff2[_0x18b2('0x4c')]:_0x4c691f[_0x18b2('0x4a')];_0x501ff2[_0x18b2('0x4f')]=qs[_0x18b2('0x50')](_0x429fc5[_0x18b2('0x47')]['sort']);_0x501ff2[_0x18b2('0x51')]=qs[_0x18b2('0x48')](_[_0x18b2('0x52')](_0x429fc5[_0x18b2('0x47')],_0x4c691f['filters']));if(_0x429fc5[_0x18b2('0x47')]['filter']){_0x501ff2['where']=_[_0x18b2('0x54')](_0x501ff2[_0x18b2('0x51')],{'$or':_[_0x18b2('0x40')](_0x501ff2[_0x18b2('0x4c')],function(_0x31c040){var _0x3eb78f={};_0x3eb78f[_0x31c040]={'$like':'%'+_0x429fc5[_0x18b2('0x47')][_0x18b2('0x53')]+'%'};return _0x3eb78f;})});}_0x501ff2=_[_0x18b2('0x54')]({},_0x501ff2,_0x429fc5[_0x18b2('0x56')]);return _0x2dd939[_0x18b2('0xb9')](_0x501ff2);}})[_0x18b2('0x21')](function(_0x56d6c6){if(_0x56d6c6){_0x542034=_0x56d6c6['length'];if(!_0x429fc5[_0x18b2('0x47')][_0x18b2('0x4d')](_0x18b2('0x4e'))){_0x501ff2[_0x18b2('0x32')]=qs[_0x18b2('0x32')](_0x429fc5[_0x18b2('0x47')][_0x18b2('0x32')]);_0x501ff2[_0x18b2('0x30')]=qs[_0x18b2('0x30')](_0x429fc5[_0x18b2('0x47')]['offset']);}return _0x2dd939[_0x18b2('0xb9')](_0x501ff2);}})['then'](function(_0x1e80f1){if(_0x1e80f1){return _0x1e80f1?{'count':_0x542034,'rows':_0x1e80f1}:null;}})['then'](respondWithResult(_0x411278,null))[_0x18b2('0x2c')](handleError(_0x411278,null));};exports['send']=function(_0x4acaa3,_0x58c9fb,_0x256286){var _0x7d766c,_0x2ffc38,_0x25a2ed;if(_['isNil'](_0x4acaa3[_0x18b2('0x60')]['body'])||_0x4acaa3['body'][_0x18b2('0x60')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x18b2('0x7f')](_0x4acaa3['body']['to'])){}_0x7d766c=_0x4acaa3[_0x18b2('0x60')]['to'];return db[_0x18b2('0x41')][_0x18b2('0x6f')]({'where':{'id':_0x4acaa3[_0x18b2('0x5c')]['id']}})[_0x18b2('0x21')](handleEntityNotFound(_0x58c9fb,null))[_0x18b2('0x21')](function(_0x555df3){if(_0x555df3){return db[_0x18b2('0x41')][_0x18b2('0x66')]({'where':{'id':_0x555df3['id']},'include':[{'model':db[_0x18b2('0x82')],'as':_0x18b2('0x86'),'include':[{'model':db['CmContact'],'as':_0x18b2('0x83'),'where':{[_0x555df3[_0x18b2('0x80')]]:_0x7d766c},'limit':0x1,'order':[['updatedAt',_0x18b2('0x84')]]}]}]})['then'](handleEntityNotFound(_0x58c9fb,null))[_0x18b2('0x21')](function(_0x295238){if(_0x295238&&_0x295238[_0x18b2('0x86')]){_0x2ffc38=_0x295238[_0x18b2('0x62')]({'plain':!![]});if(_0x2ffc38[_0x18b2('0x86')]&&_0x2ffc38['List'][_0x18b2('0x83')][_0x18b2('0x5e')]){return _0x2ffc38[_0x18b2('0x86')][_0x18b2('0x83')][0x0];}return db[_0x18b2('0x77')][_0x18b2('0x5f')](_[_0x18b2('0x19')](_0x4acaa3['body'],{'firstName':_0x7d766c,[_0x295238[_0x18b2('0x80')]]:_0x7d766c,'phone':_0x7d766c,'ListId':_0x2ffc38[_0x18b2('0x7e')]}));}})['then'](handleEntityNotFound(_0x58c9fb,null))[_0x18b2('0x21')](function(_0x320da8){if(_0x320da8){_0x25a2ed=_0x320da8;return db[_0x18b2('0x90')][_0x18b2('0x66')]({'where':{'ContactId':_0x25a2ed['id'],'closed':![],'OpenchannelAccountId':_0x2ffc38['id']}})[_0x18b2('0x21')](function(_0x1ae38a){if(_0x1ae38a){return[_0x1ae38a,![]];}return db[_0x18b2('0x90')][_0x18b2('0x5f')]({'UserId':_0x4acaa3[_0x18b2('0x61')]['id'],'ContactId':_0x25a2ed['id'],'OpenchannelAccountId':_0x2ffc38['id'],'lastMsgDirection':_0x18b2('0xba'),'Messages':[_[_0x18b2('0x54')](_0x4acaa3['body'],{'read':![],'body':_0x4acaa3['body'][_0x18b2('0x60')],'OpenchannelAccountId':_0x2ffc38['id'],'UserId':_0x4acaa3['user']['id'],'ContactId':_0x25a2ed['id']})]},{'include':[{'model':db[_0x18b2('0xbb')],'as':_0x18b2('0xbc')}]})['then'](function(_0x19118c){return[_0x19118c,!![]];});});}})[_0x18b2('0x93')](function(_0x15ab76,_0x9bcc2a){if(_0x9bcc2a){return _0x15ab76;}return db['OpenchannelMessage'][_0x18b2('0x5f')](_[_0x18b2('0x54')](_0x4acaa3['body'],{'read':![],'body':_0x4acaa3['body'][_0x18b2('0x60')],'OpenchannelAccountId':_0x2ffc38['id'],'OpenchannelInteractionId':_0x15ab76['id'],'UserId':_0x4acaa3[_0x18b2('0x61')]['id'],'ContactId':_0x25a2ed['id']}))[_0x18b2('0x21')](function(_0x7d6692){_0x15ab76[_0x18b2('0xbd')][_0x18b2('0xbc')]=[];_0x15ab76[_0x18b2('0xbd')][_0x18b2('0xbc')][_0x18b2('0xbe')](_0x7d6692[_0x18b2('0xbd')]);return _0x15ab76;});});}})[_0x18b2('0x21')](respondWithResult(_0x58c9fb,null))[_0x18b2('0x2c')](handleError(_0x58c9fb,null));}; \ No newline at end of file +var _0xa679=['startRouting','EventManager','addApplications','sequelize','findAndCountAll','priority','getApplications','findOne','pick','getInteractions','Contact','User','Owner','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','OpenchannelMessage','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','offset','limit','Content-Range','apply','update','destroy','end','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','sort','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','list','orderBy','asc','account','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','close','unmanaged','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xa679,0x1a3));var _0x9a67=function(_0x15760d,_0x271933){_0x15760d=_0x15760d-0x0;var _0x5981ad=_0xa679[_0x15760d];return _0x5981ad;};'use strict';var emlformat=require(_0x9a67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a67('0x1'));var jsonpatch=require(_0x9a67('0x2'));var rp=require(_0x9a67('0x3'));var moment=require(_0x9a67('0x4'));var BPromise=require(_0x9a67('0x5'));var Mustache=require(_0x9a67('0x6'));var util=require(_0x9a67('0x7'));var path=require(_0x9a67('0x8'));var sox=require(_0x9a67('0x9'));var csv=require(_0x9a67('0xa'));var ejs=require(_0x9a67('0xb'));var fs=require('fs');var fs_extra=require(_0x9a67('0xc'));var _=require(_0x9a67('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a67('0xa'));var querystring=require(_0x9a67('0xe'));var Papa=require('papaparse');var Redis=require(_0x9a67('0xf'));var authService=require(_0x9a67('0x10'));var qs=require(_0x9a67('0x11'));var as=require(_0x9a67('0x12'));var hardwareService=require(_0x9a67('0x13'));var logger=require('../../config/logger')(_0x9a67('0x14'));var utils=require(_0x9a67('0x15'));var config=require(_0x9a67('0x16'));var licenseUtil=require(_0x9a67('0x17'));var db=require(_0x9a67('0x18'))['db'];config[_0x9a67('0x19')]=_[_0x9a67('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9a67('0x1b'))(new Redis(config[_0x9a67('0x19')]));require(_0x9a67('0x1c'))[_0x9a67('0x1d')](socket);var jayson=require(_0x9a67('0x1e'));var client=jayson['client'][_0x9a67('0x1f')]({'port':0x232c});var client9002=jayson[_0x9a67('0x20')][_0x9a67('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3b917b,_0x445da6,_0x24ca19,_0x3ba6f2){return new BPromise(function(_0x385bcf,_0x1af7a5){var _0x53e41b=_0x3ba6f2||client;return _0x53e41b[_0x9a67('0x21')](_0x3b917b,_0x24ca19)[_0x9a67('0x22')](function(_0x2ee204){logger[_0x9a67('0x23')](_0x9a67('0x24'),_0x445da6,_0x9a67('0x25'));logger[_0x9a67('0x26')](_0x9a67('0x27'),_0x445da6,_0x9a67('0x25'),JSON[_0x9a67('0x28')](_0x2ee204));if(_0x2ee204[_0x9a67('0x29')]){if(_0x2ee204[_0x9a67('0x29')][_0x9a67('0x2a')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x445da6,_0x2ee204[_0x9a67('0x29')][_0x9a67('0x2b')]);return _0x1af7a5(_0x2ee204['error'][_0x9a67('0x2b')]);}logger['error'](_0x9a67('0x24'),_0x445da6,_0x2ee204['error'][_0x9a67('0x2b')]);return _0x385bcf(_0x2ee204[_0x9a67('0x29')][_0x9a67('0x2b')]);}else{logger['info'](_0x9a67('0x24'),_0x445da6,_0x9a67('0x25'));_0x385bcf(_0x2ee204[_0x9a67('0x2c')]['message']);}})[_0x9a67('0x2d')](function(_0x20b06d){logger[_0x9a67('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x445da6,_0x20b06d);_0x1af7a5(_0x20b06d);});});}function respondWithStatusCode(_0x398297,_0x125edd){_0x125edd=_0x125edd||0xcc;return function(_0xf724dc){if(_0xf724dc){return _0x398297[_0x9a67('0x2e')](_0x125edd);}return _0x398297['status'](_0x125edd)['end']();};}function respondWithResult(_0x53c12c,_0x338e63){_0x338e63=_0x338e63||0xc8;return function(_0x511699){if(_0x511699){return _0x53c12c[_0x9a67('0x2f')](_0x338e63)[_0x9a67('0x30')](_0x511699);}};}function respondWithFilteredResult(_0x351adb,_0x573d2b){return function(_0x200d19){if(_0x200d19){var _0xb05ea6=typeof _0x573d2b['offset']===_0x9a67('0x31')&&typeof _0x573d2b['limit']==='undefined';var _0x451c27=_0x200d19['count'];var _0x2b5bf2=_0xb05ea6?0x0:_0x573d2b[_0x9a67('0x32')];var _0x5eaaba=_0xb05ea6?_0x200d19['count']:_0x573d2b[_0x9a67('0x32')]+_0x573d2b[_0x9a67('0x33')];var _0x4343dc;if(_0x5eaaba>=_0x451c27){_0x5eaaba=_0x451c27;_0x4343dc=0xc8;}else{_0x4343dc=0xce;}_0x351adb[_0x9a67('0x2f')](_0x4343dc);return _0x351adb['set'](_0x9a67('0x34'),_0x2b5bf2+'-'+_0x5eaaba+'/'+_0x451c27)['json'](_0x200d19);}return null;};}function patchUpdates(_0xc47f0e){return function(_0x2a71a8){try{jsonpatch[_0x9a67('0x35')](_0x2a71a8,_0xc47f0e,!![]);}catch(_0x5872e3){return BPromise['reject'](_0x5872e3);}return _0x2a71a8['save']();};}function saveUpdates(_0x537640,_0x3baf9a){return function(_0x4725f7){if(_0x4725f7){return _0x4725f7[_0x9a67('0x36')](_0x537640)[_0x9a67('0x22')](function(_0x2d56bb){return _0x2d56bb;});}return null;};}function removeEntity(_0x3aaa78,_0x97101){return function(_0x1844f9){if(_0x1844f9){return _0x1844f9[_0x9a67('0x37')]()[_0x9a67('0x22')](function(){var _0x36a53b=_0x1844f9['get']({'plain':!![]});var _0x536399='OpenchannelAccounts';return db['UserProfileResource'][_0x9a67('0x37')]({'where':{'type':_0x536399,'resourceId':_0x36a53b['id']}})[_0x9a67('0x22')](function(){return _0x1844f9;});})['then'](function(){_0x3aaa78['status'](0xcc)[_0x9a67('0x38')]();});}};}function handleEntityNotFound(_0xdec942,_0x4e5609){return function(_0x5859d1){if(!_0x5859d1){_0xdec942[_0x9a67('0x2e')](0x194);}return _0x5859d1;};}function handleError(_0x561623,_0x164d07){_0x164d07=_0x164d07||0x1f4;return function(_0x207c90){logger[_0x9a67('0x29')](_0x207c90['stack']);if(_0x207c90[_0x9a67('0x39')]){delete _0x207c90[_0x9a67('0x39')];}_0x561623[_0x9a67('0x2f')](_0x164d07)[_0x9a67('0x3a')](_0x207c90);};}exports[_0x9a67('0x3b')]=function(_0xea6b2f,_0x3f50d7){var _0x2d145d={'include':[{'model':db[_0x9a67('0x3c')],'as':_0x9a67('0x3d')}]},_0xb27319={},_0xc82b4f={'count':0x0,'rows':[]};var _0x55a06f=_[_0x9a67('0x3e')](db[_0x9a67('0x3f')][_0x9a67('0x40')],function(_0x539193){return{'name':_0x539193[_0x9a67('0x41')],'type':_0x539193[_0x9a67('0x42')][_0x9a67('0x43')]};});_0xb27319[_0x9a67('0x44')]=_[_0x9a67('0x3e')](_0x55a06f,_0x9a67('0x39'));_0xb27319[_0x9a67('0x45')]=_[_0x9a67('0x46')](_0xea6b2f[_0x9a67('0x45')]);_0xb27319[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0xb27319[_0x9a67('0x44')],_0xb27319[_0x9a67('0x45')]);_0x2d145d[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0xb27319[_0x9a67('0x44')],qs[_0x9a67('0x4a')](_0xea6b2f[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x2d145d[_0x9a67('0x49')]=_0x2d145d[_0x9a67('0x49')][_0x9a67('0x4b')]?_0x2d145d[_0x9a67('0x49')]:_0xb27319[_0x9a67('0x44')];if(!_0xea6b2f['query'][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x2d145d[_0x9a67('0x33')]=qs[_0x9a67('0x33')](_0xea6b2f['query']['limit']);_0x2d145d[_0x9a67('0x32')]=qs['offset'](_0xea6b2f[_0x9a67('0x45')][_0x9a67('0x32')]);}_0x2d145d[_0x9a67('0x4e')]=qs['sort'](_0xea6b2f[_0x9a67('0x45')]['sort']);_0x2d145d[_0x9a67('0x4f')]=qs[_0x9a67('0x47')](_['pick'](_0xea6b2f['query'],_0xb27319['filters']),_0x55a06f);if(_0xea6b2f[_0x9a67('0x45')][_0x9a67('0x50')]){_0x2d145d[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x2d145d[_0x9a67('0x4f')],{'$or':_[_0x9a67('0x3e')](_0x55a06f,function(_0x2aebe6){if(_0x2aebe6[_0x9a67('0x42')]!==_0x9a67('0x52')){var _0x4202b9={};_0x4202b9[_0x2aebe6[_0x9a67('0x39')]]={'$like':'%'+_0xea6b2f[_0x9a67('0x45')][_0x9a67('0x50')]+'%'};return _0x4202b9;}})});}_0x2d145d=_['merge']({},_0x2d145d,_0xea6b2f[_0x9a67('0x53')]);var _0x2e1d1e={'where':_0x2d145d['where']};return db[_0x9a67('0x3f')][_0x9a67('0x54')](_0x2e1d1e)[_0x9a67('0x22')](function(_0x4169a1){_0xc82b4f[_0x9a67('0x54')]=_0x4169a1;if(_0xea6b2f['query']['includeAll']){_0x2d145d[_0x9a67('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x9a67('0x56')](_0x2d145d);})[_0x9a67('0x22')](function(_0x405578){_0xc82b4f[_0x9a67('0x57')]=_0x405578;return _0xc82b4f;})[_0x9a67('0x22')](respondWithFilteredResult(_0x3f50d7,_0x2d145d))['catch'](handleError(_0x3f50d7,null));};exports[_0x9a67('0x58')]=function(_0x528b8f,_0x42d817){var _0x307f3b={'raw':![],'where':{'id':_0x528b8f['params']['id']},'include':[{'model':db[_0x9a67('0x3c')],'as':'mandatoryDispositionPause'}]},_0xb89705={};_0xb89705[_0x9a67('0x44')]=_[_0x9a67('0x46')](db[_0x9a67('0x3f')]['rawAttributes']);_0xb89705['query']=_[_0x9a67('0x46')](_0x528b8f[_0x9a67('0x45')]);_0xb89705[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0xb89705['model'],_0xb89705[_0x9a67('0x45')]);_0x307f3b[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0xb89705['model'],qs[_0x9a67('0x4a')](_0x528b8f['query'][_0x9a67('0x4a')]));_0x307f3b['attributes']=_0x307f3b['attributes'][_0x9a67('0x4b')]?_0x307f3b[_0x9a67('0x49')]:_0xb89705['model'];if(_0x528b8f[_0x9a67('0x45')][_0x9a67('0x59')]){_0x307f3b[_0x9a67('0x55')]=[{'all':!![]}];}_0x307f3b=_[_0x9a67('0x51')]({},_0x307f3b,_0x528b8f[_0x9a67('0x53')]);return db[_0x9a67('0x3f')]['find'](_0x307f3b)[_0x9a67('0x22')](handleEntityNotFound(_0x42d817,null))[_0x9a67('0x22')](respondWithResult(_0x42d817,null))[_0x9a67('0x2d')](handleError(_0x42d817,null));};exports[_0x9a67('0x5a')]=function(_0x3cd3db,_0x59f0c6){return db['OpenchannelAccount'][_0x9a67('0x5a')](_0x3cd3db[_0x9a67('0x5b')],{})[_0x9a67('0x22')](function(_0x32f348){var _0x458514=_0x3cd3db[_0x9a67('0x5c')][_0x9a67('0x5d')]({'plain':!![]});if(!_0x458514)throw new Error(_0x9a67('0x5e'));if(_0x458514[_0x9a67('0x5f')]==='user'){var _0x3eae11=_0x32f348[_0x9a67('0x5d')]({'plain':!![]});var _0xdb417a=_0x9a67('0x60');return db[_0x9a67('0x61')]['find']({'where':{'name':_0xdb417a,'userProfileId':_0x458514[_0x9a67('0x62')]},'raw':!![]})['then'](function(_0x182599){if(_0x182599&&_0x182599[_0x9a67('0x63')]===0x0){return db[_0x9a67('0x64')]['create']({'name':_0x3eae11['name'],'resourceId':_0x3eae11['id'],'type':_0x182599['name'],'sectionId':_0x182599['id']},{})[_0x9a67('0x22')](function(){return _0x32f348;});}else{return _0x32f348;}})[_0x9a67('0x2d')](function(_0x3a1a66){logger[_0x9a67('0x29')](_0x9a67('0x65'),_0x3a1a66);throw _0x3a1a66;});}return _0x32f348;})['then'](respondWithResult(_0x59f0c6,0xc9))[_0x9a67('0x2d')](handleError(_0x59f0c6,null));};exports['update']=function(_0x40c720,_0x2cb9b8){if(_0x40c720['body']['id']){delete _0x40c720[_0x9a67('0x5b')]['id'];}return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x40c720[_0x9a67('0x67')]['id']},'include':[{'model':db[_0x9a67('0x3c')],'as':_0x9a67('0x3d')}]})[_0x9a67('0x22')](handleEntityNotFound(_0x2cb9b8,null))[_0x9a67('0x22')](saveUpdates(_0x40c720['body'],null))[_0x9a67('0x22')](respondWithResult(_0x2cb9b8,null))['catch'](handleError(_0x2cb9b8,null));};exports[_0x9a67('0x37')]=function(_0x155105,_0x1d4144){return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x155105[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x1d4144,null))[_0x9a67('0x22')](removeEntity(_0x1d4144,null))[_0x9a67('0x2d')](handleError(_0x1d4144,null));};exports[_0x9a67('0x68')]=function(_0x458248,_0x5c774b){return db['OpenchannelAccount'][_0x9a67('0x68')]()['then'](respondWithResult(_0x5c774b,null))[_0x9a67('0x2d')](handleError(_0x5c774b,null));};exports[_0x9a67('0x69')]=function(_0x4684cd,_0x23746c,_0x5d236b){if(_0x4684cd['body']['id']){delete _0x4684cd[_0x9a67('0x5b')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x4684cd[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x23746c,null))[_0x9a67('0x22')](function(_0x27ead5){if(_0x27ead5){_0x4684cd[_0x9a67('0x5b')][_0x9a67('0x6a')]=_0x27ead5['id'];return db[_0x9a67('0x6b')][_0x9a67('0x5a')](_0x4684cd[_0x9a67('0x5b')]);}})[_0x9a67('0x22')](respondWithResult(_0x23746c,null))[_0x9a67('0x2d')](handleError(_0x23746c,null));};exports[_0x9a67('0x6c')]=function(_0x1d69b1,_0x149eca,_0x3a546b){var _0x2501d3={'raw':![],'where':{}};var _0x1d641f={};var _0x55f105={'count':0x0,'rows':[]};return db[_0x9a67('0x3f')]['findOne']({'where':{'id':_0x1d69b1['params']['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x149eca,null))[_0x9a67('0x22')](function(_0x50e4c0){if(_0x50e4c0){_0x1d641f[_0x9a67('0x44')]=_['keys'](db[_0x9a67('0x6b')]['rawAttributes']);_0x1d641f['query']=_[_0x9a67('0x46')](_0x1d69b1['query']);_0x1d641f[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0x1d641f[_0x9a67('0x44')],_0x1d641f['query']);_0x2501d3[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0x1d641f['model'],qs['fields'](_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x2501d3['attributes']=_0x2501d3[_0x9a67('0x49')][_0x9a67('0x4b')]?_0x2501d3[_0x9a67('0x49')]:_0x1d641f[_0x9a67('0x44')];if(!_0x1d69b1['query'][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x2501d3[_0x9a67('0x33')]=qs['limit'](_0x1d69b1[_0x9a67('0x45')]['limit']);_0x2501d3[_0x9a67('0x32')]=qs['offset'](_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x32')]);}_0x2501d3[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x1d69b1['query'][_0x9a67('0x6d')]);_0x2501d3['where']=qs['filters'](_['pick'](_0x1d69b1[_0x9a67('0x45')],_0x1d641f[_0x9a67('0x47')]));_0x2501d3[_0x9a67('0x4f')]['OpenchannelAccountId']=_0x50e4c0['id'];if(_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x50')]){_0x2501d3[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x2501d3[_0x9a67('0x4f')],{'$or':_[_0x9a67('0x3e')](_0x2501d3[_0x9a67('0x49')],function(_0x197330){var _0x1e5f7d={};_0x1e5f7d[_0x197330]={'$like':'%'+_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x50')]+'%'};return _0x1e5f7d;})});}_0x2501d3=_[_0x9a67('0x51')]({},_0x2501d3,_0x1d69b1[_0x9a67('0x53')]);return db['Disposition'][_0x9a67('0x54')]({'where':_0x2501d3[_0x9a67('0x4f')]})[_0x9a67('0x22')](function(_0x5915ba){_0x55f105[_0x9a67('0x54')]=_0x5915ba;if(_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x59')]){_0x2501d3['include']=[{'all':!![]}];}return db[_0x9a67('0x6b')][_0x9a67('0x56')](_0x2501d3);})[_0x9a67('0x22')](function(_0x212ec8){_0x55f105[_0x9a67('0x57')]=_0x212ec8;return _0x55f105;});}})[_0x9a67('0x22')](respondWithFilteredResult(_0x149eca,_0x2501d3))[_0x9a67('0x2d')](handleError(_0x149eca,null));};exports[_0x9a67('0x6e')]=function(_0x2fe2bb,_0x30a4b2,_0x5e23ba){return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x2fe2bb[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x30a4b2,null))[_0x9a67('0x22')](function(_0x4625b3){if(_0x4625b3){return _0x4625b3['removeDispositions'](_0x2fe2bb[_0x9a67('0x45')]['ids']);}})[_0x9a67('0x22')](respondWithStatusCode(_0x30a4b2,null))['catch'](handleError(_0x30a4b2,null));};exports['addAnswer']=function(_0x164d35,_0x56703c,_0x15dd88){if(_0x164d35['body']['id']){delete _0x164d35[_0x9a67('0x5b')]['id'];}return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x164d35[_0x9a67('0x67')]['id']}})['then'](handleEntityNotFound(_0x56703c,null))[_0x9a67('0x22')](function(_0x327448){if(_0x327448){_0x164d35[_0x9a67('0x5b')][_0x9a67('0x6a')]=_0x327448['id'];return db['CannedAnswer'][_0x9a67('0x5a')](_0x164d35[_0x9a67('0x5b')]);}})[_0x9a67('0x22')](respondWithResult(_0x56703c,null))[_0x9a67('0x2d')](handleError(_0x56703c,null));};exports[_0x9a67('0x6f')]=function(_0x12ab64,_0x5e6677,_0x3d0b80){var _0x3e9380={'raw':![],'where':{}};var _0x469f13={};var _0x5a2096={'count':0x0,'rows':[]};return db[_0x9a67('0x3f')]['findOne']({'where':{'id':_0x12ab64[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x5e6677,null))[_0x9a67('0x22')](function(_0x1f6a98){if(_0x1f6a98){_0x469f13[_0x9a67('0x44')]=_[_0x9a67('0x46')](db[_0x9a67('0x70')][_0x9a67('0x40')]);_0x469f13[_0x9a67('0x45')]=_[_0x9a67('0x46')](_0x12ab64[_0x9a67('0x45')]);_0x469f13[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0x469f13[_0x9a67('0x44')],_0x469f13[_0x9a67('0x45')]);_0x3e9380[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0x469f13['model'],qs['fields'](_0x12ab64[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x3e9380[_0x9a67('0x49')]=_0x3e9380[_0x9a67('0x49')]['length']?_0x3e9380['attributes']:_0x469f13[_0x9a67('0x44')];if(!_0x12ab64['query'][_0x9a67('0x4c')]('nolimit')){_0x3e9380[_0x9a67('0x33')]=qs['limit'](_0x12ab64[_0x9a67('0x45')]['limit']);_0x3e9380[_0x9a67('0x32')]=qs[_0x9a67('0x32')](_0x12ab64[_0x9a67('0x45')][_0x9a67('0x32')]);}_0x3e9380[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x12ab64[_0x9a67('0x45')][_0x9a67('0x6d')]);_0x3e9380['where']=qs[_0x9a67('0x47')](_['pick'](_0x12ab64[_0x9a67('0x45')],_0x469f13['filters']));_0x3e9380[_0x9a67('0x4f')][_0x9a67('0x6a')]=_0x1f6a98['id'];if(_0x12ab64[_0x9a67('0x45')][_0x9a67('0x50')]){_0x3e9380[_0x9a67('0x4f')]=_['merge'](_0x3e9380[_0x9a67('0x4f')],{'$or':_[_0x9a67('0x3e')](_0x3e9380[_0x9a67('0x49')],function(_0x4ec9f0){var _0x3d8d62={};_0x3d8d62[_0x4ec9f0]={'$like':'%'+_0x12ab64[_0x9a67('0x45')][_0x9a67('0x50')]+'%'};return _0x3d8d62;})});}_0x3e9380=_[_0x9a67('0x51')]({},_0x3e9380,_0x12ab64[_0x9a67('0x53')]);return db['CannedAnswer'][_0x9a67('0x54')]({'where':_0x3e9380[_0x9a67('0x4f')]})[_0x9a67('0x22')](function(_0x3128fd){_0x5a2096[_0x9a67('0x54')]=_0x3128fd;if(_0x12ab64[_0x9a67('0x45')][_0x9a67('0x59')]){_0x3e9380[_0x9a67('0x55')]=[{'all':!![]}];}return db[_0x9a67('0x70')][_0x9a67('0x56')](_0x3e9380);})[_0x9a67('0x22')](function(_0x5ae208){_0x5a2096['rows']=_0x5ae208;return _0x5a2096;});}})['then'](respondWithFilteredResult(_0x5e6677,_0x3e9380))[_0x9a67('0x2d')](handleError(_0x5e6677,null));};exports[_0x9a67('0x71')]=function(_0x1c7def,_0x572aa7,_0x2d5a9e){return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x1c7def[_0x9a67('0x67')]['id']}})['then'](handleEntityNotFound(_0x572aa7,null))[_0x9a67('0x22')](function(_0x47cba0){if(_0x47cba0){return _0x47cba0['removeAnswers'](_0x1c7def[_0x9a67('0x45')][_0x9a67('0x72')]);}})[_0x9a67('0x22')](respondWithStatusCode(_0x572aa7,null))['catch'](handleError(_0x572aa7,null));};exports[_0x9a67('0x73')]=function(_0x3da1fb,_0x1c151e,_0x3e73fd){var _0x432553={'body':_0x3da1fb['body'],'channel':_0x9a67('0x74')};var _0x52ec09=[];var _0x2bf9f8=[];var _0x42bca8={};var _0x5593b1=![];return db[_0x9a67('0x75')][_0x9a67('0x68')]()['then'](function(_0x1c1007){if(!_0x1c1007){throw new db['Sequelize'][(_0x9a67('0x76'))](_0x9a67('0x77'));}_0x52ec09=_[_0x9a67('0x78')](_['keys'](_0x1c1007),[_0x9a67('0x79'),_0x9a67('0x7a')]);_0x2bf9f8=_[_0x9a67('0x78')](_['keys'](_0x1c1007),['createdAt',_0x9a67('0x7a'),'CompanyId',_0x9a67('0x7b')]);if(_0x3da1fb[_0x9a67('0x5b')]['id']){delete _0x3da1fb[_0x9a67('0x5b')]['id'];}if(_[_0x9a67('0x7c')](_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x7d')])){throw new db[(_0x9a67('0x7e'))][(_0x9a67('0x76'))](_0x9a67('0x7f'));}if(_[_0x9a67('0x7c')](_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x5b')])||_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x5b')]===''){throw new db[(_0x9a67('0x7e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3da1fb[_0x9a67('0x5b')]['mapKey'])){throw new db[(_0x9a67('0x7e'))][(_0x9a67('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2bf9f8);}if(!_[_0x9a67('0x80')](_0x2bf9f8,_0x3da1fb['body'][_0x9a67('0x81')])){throw new db['Sequelize'][(_0x9a67('0x76'))](_0x9a67('0x82')+_0x2bf9f8);}_0x42bca8[_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x81')]]=_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x7d')];})[_0x9a67('0x22')](function(){return db[_0x9a67('0x3f')]['find']({'where':{'id':_0x3da1fb[_0x9a67('0x67')]['id']},'include':[{'model':db[_0x9a67('0x83')],'as':_0x9a67('0x84'),'include':[{'model':db['CmContact'],'as':_0x9a67('0x85'),'where':_0x42bca8,'limit':0x1,'order':[[_0x9a67('0x7a'),_0x9a67('0x86')]]}]},{'model':db[_0x9a67('0x87')],'as':_0x9a67('0x88')}]});})[_0x9a67('0x22')](handleEntityNotFound(_0x1c151e,null))[_0x9a67('0x22')](function(_0x33370a){if(_0x33370a&&_0x33370a[_0x9a67('0x84')]){_0x432553['account']=_0x33370a;_0x432553[_0x9a67('0x89')]=_0x33370a[_0x9a67('0x88')];_0x432553[_0x9a67('0x8a')]=_0x33370a['List'];_0x432553[_0x9a67('0x89')]=_[_0x9a67('0x8b')](_0x432553[_0x9a67('0x89')],['priority'],[_0x9a67('0x8c')]);if(_0x432553[_0x9a67('0x8d')][_0x9a67('0x88')]){delete _0x432553[_0x9a67('0x8d')]['Applications'];}if(_0x432553[_0x9a67('0x8d')][_0x9a67('0x84')]&&_0x432553['account'][_0x9a67('0x84')][_0x9a67('0x85')][_0x9a67('0x4b')]){return _0x432553['account'][_0x9a67('0x84')]['Contacts'][0x0];}var _0x561694=_['defaults'](_0x3da1fb['body'],{'firstName':_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x7d')],'ListId':_0x33370a[_0x9a67('0x7b')]});_0x561694[_0x3da1fb['body']['mapKey']]=_0x3da1fb[_0x9a67('0x5b')]['from'];return db[_0x9a67('0x75')][_0x9a67('0x5a')](_0x561694,{'fields':_0x52ec09,'raw':!![]});}})['then'](handleEntityNotFound(_0x1c151e,null))[_0x9a67('0x22')](function(_0x4397bd){_0x432553[_0x9a67('0x8e')]=_0x4397bd;if(_0x4397bd){var _0xe0f18b={'ContactId':_0x4397bd['id'],'OpenchannelAccountId':_0x3da1fb['params']['id'],'from':(_0x4397bd[_0x9a67('0x8f')]||'')+'\x20'+(_0x4397bd[_0x9a67('0x90')]||'')};var _0x35569e={'OpenchannelAccountId':_0x3da1fb[_0x9a67('0x67')]['id'],'closed':![]};if(_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x91')]){_0x35569e['threadId']=_0x3da1fb[_0x9a67('0x5b')]['threadId'];return db['OpenchannelInteraction'][_0x9a67('0x66')]({'where':_0x35569e})[_0x9a67('0x22')](function(_0x27b08e){if(_0x27b08e){return[_0x27b08e,![]];}_0xe0f18b[_0x9a67('0x91')]=_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x91')];_0xe0f18b[_0x9a67('0x92')]=_0x3da1fb[_0x9a67('0x5b')]['externalUrl'];return db[_0x9a67('0x93')][_0x9a67('0x5a')](_0xe0f18b)['then'](function(_0x2ed874){return[_0x2ed874,!![]];});});}else{_0x35569e[_0x9a67('0x91')]=null;}_0x35569e['ContactId']=_0x4397bd['id'];return db['OpenchannelInteraction']['find']({'where':_0x35569e})[_0x9a67('0x22')](function(_0x17f7ab){if(_0x17f7ab){return[_0x17f7ab,![]];}return db[_0x9a67('0x93')][_0x9a67('0x5a')](_0xe0f18b)[_0x9a67('0x22')](function(_0x3868ce){return[_0x3868ce,!![]];});});}})[_0x9a67('0x94')](function(_0x6114,_0x4ff596){if(_0x6114){_0x5593b1=_0x4ff596;if(!_0x4ff596){var _0x47ebf3={'from':(_0x432553['contact'][_0x9a67('0x8f')]||'')+'\x20'+(_0x432553['contact'][_0x9a67('0x90')]||'')};if(_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x91')]&&_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x95')]&&_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x91')]!=_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x95')]){_0x47ebf3[_0x9a67('0x91')]=_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x95')];}return _0x6114['update'](_0x47ebf3);}else{return _0x6114;}}})['then'](function(_0x42e0e4){_0x432553[_0x9a67('0x96')]=_0x42e0e4['get']({'plain':!![]});_0x432553[_0x9a67('0x96')][_0x9a67('0x97')]=_0x5593b1;if(_0x432553[_0x9a67('0x96')]['created']){if(_0x432553[_0x9a67('0x8d')][_0x9a67('0x98')]){_0x432553[_0x9a67('0x89')][_0x9a67('0x99')]({'id':0x0,'priority':_0x432553[_0x9a67('0x89')]['length']+0x1,'app':_0x9a67('0x9a'),'appdata':_0x9a67('0x9b'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x3da1fb[_0x9a67('0x5b')]['body'],'OpenchannelAccountId':_0x3da1fb['params']['id'],'OpenchannelInteractionId':_0x42e0e4['id'],'direction':'in','ContactId':_0x432553[_0x9a67('0x8e')]['id'],'AttachmentId':_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x9c')]});})[_0x9a67('0x22')](function(_0x39ba5c){_0x432553[_0x9a67('0x2b')]=_0x39ba5c;if(_0x432553[_0x9a67('0x96')][_0x9a67('0x9d')]){return db['User']['find']({'attributes':['id',_0x9a67('0x39')],'where':{'id':_0x432553[_0x9a67('0x96')]['UserId']}})[_0x9a67('0x22')](function(_0x5f19f0){if(_0x5f19f0){_0x432553[_0x9a67('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9a67('0x9e'),'appdata':_0x5f19f0[_0x9a67('0x39')]+','+(_0x432553[_0x9a67('0x8d')][_0x9a67('0x9f')]||0xa),'interval':_0x9a67('0xa0')});_0x432553[_0x9a67('0xa1')]=![];}return respondWithRpcPromise('Start','startRouting',_0x432553);});}return respondWithRpcPromise(_0x9a67('0xa2'),_0x9a67('0xa3'),_0x432553);})['then'](function(_0x343de6){respondWithRpcPromise(_0x9a67('0xa4'),_0x9a67('0xa4'),{'event':_0x9a67('0x73'),'message':_0x343de6},client9002);return _0x343de6;})['then'](respondWithResult(_0x1c151e,null))[_0x9a67('0x2d')](handleError(_0x1c151e,null));};exports[_0x9a67('0xa5')]=function(_0x120b95,_0x3b8a70,_0x2679c7){return db[_0x9a67('0x3f')]['findOne']({'where':{'id':_0x120b95[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x3b8a70,null))[_0x9a67('0x22')](function(_0x1e5bfb){if(_0x1e5bfb){return db[_0x9a67('0xa6')]['transaction'](function(_0x52354d){return db[_0x9a67('0x87')][_0x9a67('0x37')]({'where':{'OpenchannelAccountId':_0x120b95[_0x9a67('0x67')]['id']},'transaction':_0x52354d})['then'](function(_0x6b4636){var _0x34ebaf=_[_0x9a67('0x3e')](_0x120b95['body'],function(_0x2720b4){_0x2720b4[_0x9a67('0x6a')]=_0x120b95[_0x9a67('0x67')]['id'];return _0x2720b4;});return db[_0x9a67('0x87')]['bulkCreate'](_0x34ebaf,{'transaction':_0x52354d});});})['then'](function(){return db[_0x9a67('0x87')][_0x9a67('0xa7')]({'where':{'OpenchannelAccountId':_0x120b95[_0x9a67('0x67')]['id']},'order':_0x9a67('0xa8')});});}})['then'](respondWithResult(_0x3b8a70,null))[_0x9a67('0x2d')](handleError(_0x3b8a70,null));};exports[_0x9a67('0xa9')]=function(_0x2a4181,_0x294659,_0x5b6a8f){var _0x4c88c1={};var _0x598d43={};var _0x4a297d;var _0x456ac4;return db[_0x9a67('0x3f')][_0x9a67('0xaa')]({'where':{'id':_0x2a4181['params']['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x294659,null))['then'](function(_0x2e2c3e){if(_0x2e2c3e){_0x4a297d=_0x2e2c3e;_0x598d43[_0x9a67('0x44')]=_[_0x9a67('0x46')](db[_0x9a67('0x87')]['rawAttributes']);_0x598d43['query']=_[_0x9a67('0x46')](_0x2a4181['query']);_0x598d43[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0x598d43[_0x9a67('0x44')],_0x598d43[_0x9a67('0x45')]);_0x4c88c1['attributes']=_['intersection'](_0x598d43[_0x9a67('0x44')],qs[_0x9a67('0x4a')](_0x2a4181[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x4c88c1[_0x9a67('0x49')]=_0x4c88c1[_0x9a67('0x49')]['length']?_0x4c88c1[_0x9a67('0x49')]:_0x598d43[_0x9a67('0x44')];_0x4c88c1[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x2a4181[_0x9a67('0x45')]['sort']);_0x4c88c1[_0x9a67('0x4f')]=qs[_0x9a67('0x47')](_[_0x9a67('0xab')](_0x2a4181[_0x9a67('0x45')],_0x598d43[_0x9a67('0x47')]));if(_0x2a4181[_0x9a67('0x45')][_0x9a67('0x50')]){_0x4c88c1[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x4c88c1[_0x9a67('0x4f')],{'$or':_[_0x9a67('0x3e')](_0x4c88c1[_0x9a67('0x49')],function(_0x2d14a4){var _0x1a669f={};_0x1a669f[_0x2d14a4]={'$like':'%'+_0x2a4181['query'][_0x9a67('0x50')]+'%'};return _0x1a669f;})});}_0x4c88c1=_[_0x9a67('0x51')]({},_0x4c88c1,_0x2a4181['options']);return _0x4a297d[_0x9a67('0xa9')](_0x4c88c1);}})[_0x9a67('0x22')](function(_0x3b432b){if(_0x3b432b){_0x456ac4=_0x3b432b['length'];if(!_0x2a4181['query'][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x4c88c1[_0x9a67('0x33')]=qs['limit'](_0x2a4181[_0x9a67('0x45')]['limit']);_0x4c88c1[_0x9a67('0x32')]=qs['offset'](_0x2a4181['query']['offset']);}return _0x4a297d[_0x9a67('0xa9')](_0x4c88c1);}})[_0x9a67('0x22')](function(_0x3b73d6){if(_0x3b73d6){return _0x3b73d6?{'count':_0x456ac4,'rows':_0x3b73d6}:null;}})['then'](respondWithResult(_0x294659,null))[_0x9a67('0x2d')](handleError(_0x294659,null));};exports[_0x9a67('0xac')]=function(_0x1503c4,_0x310982,_0xe4122b){var _0x413ea5={'raw':![],'where':{}};var _0x5076e9={};var _0x461e37={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9a67('0xaa')]({'where':{'id':_0x1503c4[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x310982,null))['then'](function(_0x13eee5){if(_0x13eee5){_0x5076e9[_0x9a67('0x44')]=_[_0x9a67('0x46')](db['OpenchannelInteraction'][_0x9a67('0x40')]);_0x5076e9[_0x9a67('0x45')]=_['keys'](_0x1503c4[_0x9a67('0x45')]);_0x5076e9[_0x9a67('0x47')]=_['intersection'](_0x5076e9['model'],_0x5076e9[_0x9a67('0x45')]);_0x413ea5[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0x5076e9[_0x9a67('0x44')],qs['fields'](_0x1503c4[_0x9a67('0x45')]['fields']));_0x413ea5[_0x9a67('0x49')]=_0x413ea5[_0x9a67('0x49')]['length']?_0x413ea5[_0x9a67('0x49')]:_0x5076e9[_0x9a67('0x44')];if(!_0x1503c4[_0x9a67('0x45')][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x413ea5[_0x9a67('0x33')]=qs['limit'](_0x1503c4[_0x9a67('0x45')][_0x9a67('0x33')]);_0x413ea5[_0x9a67('0x32')]=qs[_0x9a67('0x32')](_0x1503c4[_0x9a67('0x45')][_0x9a67('0x32')]);}_0x413ea5[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x1503c4['query']['sort']);_0x413ea5[_0x9a67('0x4f')]=qs[_0x9a67('0x47')](_[_0x9a67('0xab')](_0x1503c4[_0x9a67('0x45')],_0x5076e9['filters']));_0x413ea5['where'][_0x9a67('0x6a')]=_0x13eee5['id'];if(_0x1503c4['query'][_0x9a67('0x50')]){_0x413ea5[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x413ea5['where'],{'$or':_[_0x9a67('0x3e')](_0x413ea5['attributes'],function(_0x582ded){var _0x36e348={};_0x36e348[_0x582ded]={'$like':'%'+_0x1503c4['query'][_0x9a67('0x50')]+'%'};return _0x36e348;})});}_0x413ea5=_['merge']({},_0x413ea5,_0x1503c4[_0x9a67('0x53')]);return db[_0x9a67('0x93')][_0x9a67('0x54')]({'where':_0x413ea5[_0x9a67('0x4f')]})['then'](function(_0xbeebce){_0x461e37[_0x9a67('0x54')]=_0xbeebce;if(_0x1503c4[_0x9a67('0x45')][_0x9a67('0x59')]){_0x413ea5[_0x9a67('0x55')]=[{'model':db[_0x9a67('0x75')],'as':_0x9a67('0xad'),'required':![]},{'model':db[_0x9a67('0xae')],'as':_0x9a67('0xaf'),'attributes':[_0x9a67('0x39'),'fullname',_0x9a67('0xb0')],'required':![]},{'model':db[_0x9a67('0xb1')],'as':_0x9a67('0xb2'),'attributes':['id',_0x9a67('0x39'),_0x9a67('0xb3')],'where':_0x1503c4[_0x9a67('0x45')][_0x9a67('0xb4')]?{'id':_0x1503c4[_0x9a67('0x45')][_0x9a67('0xb4')]}:undefined,'required':_0x1503c4[_0x9a67('0x45')][_0x9a67('0xb4')]?!![]:![]}];}return db[_0x9a67('0x93')][_0x9a67('0x56')](_0x413ea5);})[_0x9a67('0x22')](function(_0x13afde){_0x461e37['rows']=_0x13afde;return _0x461e37;});}})['then'](respondWithFilteredResult(_0x310982,_0x413ea5))[_0x9a67('0x2d')](handleError(_0x310982,null));};exports[_0x9a67('0xb5')]=function(_0x56f9e8,_0x46b91d,_0x454f0e){return db[_0x9a67('0x3f')]['find']({'where':{'id':_0x56f9e8[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x46b91d,null))['then'](function(_0x299deb){if(_0x299deb){return _0x299deb['addAgents'](_0x56f9e8[_0x9a67('0x5b')]['ids'],_[_0x9a67('0xb6')](_0x56f9e8['body'],[_0x9a67('0x72'),'id'])||{})['spread'](function(_0x2e2716){for(var _0x48a36f=0x0;_0x48a36f<_0x56f9e8[_0x9a67('0x5b')][_0x9a67('0x72')]['length'];_0x48a36f+=0x1){socket['emit'](_0x9a67('0xb7'),{'UserId':Number(_0x56f9e8[_0x9a67('0x5b')][_0x9a67('0x72')][_0x48a36f]),'OpenchannelAccountId':Number(_0x56f9e8['params']['id'])});}return _0x2e2716;});}})['then'](respondWithResult(_0x46b91d,null))['catch'](handleError(_0x46b91d,null));};exports[_0x9a67('0xb8')]=function(_0xb93568,_0x16494a,_0x4792b7){return db[_0x9a67('0x3f')]['find']({'where':{'id':_0xb93568[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x16494a,null))[_0x9a67('0x22')](function(_0x6df63e){if(_0x6df63e){return _0x6df63e[_0x9a67('0xb8')](_0xb93568[_0x9a67('0x45')][_0x9a67('0x72')])[_0x9a67('0x22')](function(){if(_[_0x9a67('0xb9')](_0xb93568[_0x9a67('0x45')][_0x9a67('0x72')])){for(var _0xdb7bd5=0x0;_0xdb7bd5<_0xb93568[_0x9a67('0x45')]['ids'][_0x9a67('0x4b')];_0xdb7bd5+=0x1){socket[_0x9a67('0xba')](_0x9a67('0xbb'),{'UserId':Number(_0xb93568['query'][_0x9a67('0x72')][_0xdb7bd5]),'OpenchannelAccountId':Number(_0xb93568[_0x9a67('0x67')]['id'])});}}else{socket[_0x9a67('0xba')](_0x9a67('0xbb'),{'UserId':Number(_0xb93568[_0x9a67('0x45')]['ids']),'OpenchannelAccountId':Number(_0xb93568[_0x9a67('0x67')]['id'])});}});}})[_0x9a67('0x22')](respondWithStatusCode(_0x16494a,null))[_0x9a67('0x2d')](handleError(_0x16494a,null));};exports[_0x9a67('0xbc')]=function(_0x3221e6,_0x40cc7a,_0x2dcb15){var _0x180308={};var _0x44abe4={};var _0x1fb8e2;var _0x4a4c25;return db[_0x9a67('0x3f')][_0x9a67('0xaa')]({'where':{'id':_0x3221e6[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x40cc7a,null))[_0x9a67('0x22')](function(_0x517622){if(_0x517622){_0x1fb8e2=_0x517622;_0x44abe4['model']=_[_0x9a67('0x46')](db[_0x9a67('0xae')]['rawAttributes']);_0x44abe4[_0x9a67('0x45')]=_[_0x9a67('0x46')](_0x3221e6[_0x9a67('0x45')]);_0x44abe4[_0x9a67('0x47')]=_['intersection'](_0x44abe4['model'],_0x44abe4['query']);_0x180308[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0x44abe4[_0x9a67('0x44')],qs[_0x9a67('0x4a')](_0x3221e6[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x180308[_0x9a67('0x49')]=_0x180308[_0x9a67('0x49')][_0x9a67('0x4b')]?_0x180308[_0x9a67('0x49')]:_0x44abe4[_0x9a67('0x44')];_0x180308[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x3221e6[_0x9a67('0x45')][_0x9a67('0x6d')]);_0x180308[_0x9a67('0x4f')]=qs[_0x9a67('0x47')](_['pick'](_0x3221e6[_0x9a67('0x45')],_0x44abe4[_0x9a67('0x47')]));if(_0x3221e6[_0x9a67('0x45')][_0x9a67('0x50')]){_0x180308[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x180308['where'],{'$or':_[_0x9a67('0x3e')](_0x180308[_0x9a67('0x49')],function(_0x5ef7b0){var _0x4815bb={};_0x4815bb[_0x5ef7b0]={'$like':'%'+_0x3221e6[_0x9a67('0x45')]['filter']+'%'};return _0x4815bb;})});}_0x180308=_[_0x9a67('0x51')]({},_0x180308,_0x3221e6[_0x9a67('0x53')]);return _0x1fb8e2[_0x9a67('0xbc')](_0x180308);}})[_0x9a67('0x22')](function(_0x33a501){if(_0x33a501){_0x4a4c25=_0x33a501[_0x9a67('0x4b')];if(!_0x3221e6[_0x9a67('0x45')][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x180308[_0x9a67('0x33')]=qs['limit'](_0x3221e6[_0x9a67('0x45')][_0x9a67('0x33')]);_0x180308[_0x9a67('0x32')]=qs['offset'](_0x3221e6[_0x9a67('0x45')]['offset']);}return _0x1fb8e2[_0x9a67('0xbc')](_0x180308);}})[_0x9a67('0x22')](function(_0x48fc00){if(_0x48fc00){return _0x48fc00?{'count':_0x4a4c25,'rows':_0x48fc00}:null;}})[_0x9a67('0x22')](respondWithResult(_0x40cc7a,null))['catch'](handleError(_0x40cc7a,null));};exports[_0x9a67('0x3a')]=function(_0xdafeb5,_0x346f65,_0x384500){var _0x3066f7,_0x93376,_0x1e7eab;if(_[_0x9a67('0x7c')](_0xdafeb5['body'][_0x9a67('0x5b')])||_0xdafeb5[_0x9a67('0x5b')][_0x9a67('0x5b')]===''){throw new db['Sequelize'][(_0x9a67('0x76'))](_0x9a67('0xbd'));}if(_[_0x9a67('0x7c')](_0xdafeb5[_0x9a67('0x5b')]['to'])){}_0x3066f7=_0xdafeb5['body']['to'];return db[_0x9a67('0x3f')][_0x9a67('0xaa')]({'where':{'id':_0xdafeb5['params']['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x346f65,null))[_0x9a67('0x22')](function(_0x267458){if(_0x267458){return db['OpenchannelAccount']['find']({'where':{'id':_0x267458['id']},'include':[{'model':db[_0x9a67('0x83')],'as':_0x9a67('0x84'),'include':[{'model':db[_0x9a67('0x75')],'as':'Contacts','where':{[_0x267458['mapKey']]:_0x3066f7},'limit':0x1,'order':[[_0x9a67('0x7a'),_0x9a67('0x86')]]}]}]})['then'](handleEntityNotFound(_0x346f65,null))[_0x9a67('0x22')](function(_0x3afc07){if(_0x3afc07&&_0x3afc07[_0x9a67('0x84')]){_0x93376=_0x3afc07[_0x9a67('0x5d')]({'plain':!![]});if(_0x93376[_0x9a67('0x84')]&&_0x93376[_0x9a67('0x84')][_0x9a67('0x85')][_0x9a67('0x4b')]){return _0x93376[_0x9a67('0x84')][_0x9a67('0x85')][0x0];}return db[_0x9a67('0x75')]['create'](_[_0x9a67('0x1a')](_0xdafeb5['body'],{'firstName':_0x3066f7,[_0x3afc07[_0x9a67('0x81')]]:_0x3066f7,'phone':_0x3066f7,'ListId':_0x93376[_0x9a67('0x7b')]}));}})[_0x9a67('0x22')](handleEntityNotFound(_0x346f65,null))['then'](function(_0x2e61a8){if(_0x2e61a8){_0x1e7eab=_0x2e61a8;return db[_0x9a67('0x93')][_0x9a67('0x66')]({'where':{'ContactId':_0x1e7eab['id'],'closed':![],'OpenchannelAccountId':_0x93376['id']}})[_0x9a67('0x22')](function(_0x2e6571){if(_0x2e6571){return[_0x2e6571,![]];}return db[_0x9a67('0x93')][_0x9a67('0x5a')]({'UserId':_0xdafeb5[_0x9a67('0x5c')]['id'],'ContactId':_0x1e7eab['id'],'OpenchannelAccountId':_0x93376['id'],'lastMsgDirection':_0x9a67('0xbe'),'Messages':[_['merge'](_0xdafeb5[_0x9a67('0x5b')],{'read':![],'body':_0xdafeb5['body']['body'],'OpenchannelAccountId':_0x93376['id'],'UserId':_0xdafeb5[_0x9a67('0x5c')]['id'],'ContactId':_0x1e7eab['id']})]},{'include':[{'model':db[_0x9a67('0xbf')],'as':_0x9a67('0xc0')}]})[_0x9a67('0x22')](function(_0x46633e){return[_0x46633e,!![]];});});}})[_0x9a67('0x94')](function(_0x3bec3c,_0x45ef2b){if(_0x45ef2b){return _0x3bec3c;}return db[_0x9a67('0xbf')]['create'](_[_0x9a67('0x51')](_0xdafeb5[_0x9a67('0x5b')],{'read':![],'body':_0xdafeb5[_0x9a67('0x5b')]['body'],'OpenchannelAccountId':_0x93376['id'],'OpenchannelInteractionId':_0x3bec3c['id'],'UserId':_0xdafeb5[_0x9a67('0x5c')]['id'],'ContactId':_0x1e7eab['id']}))['then'](function(_0x1b731f){_0x3bec3c[_0x9a67('0xc1')][_0x9a67('0xc0')]=[];_0x3bec3c[_0x9a67('0xc1')][_0x9a67('0xc0')][_0x9a67('0x99')](_0x1b731f[_0x9a67('0xc1')]);return _0x3bec3c;});});}})['then'](respondWithResult(_0x346f65,null))[_0x9a67('0x2d')](handleError(_0x346f65,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index def2460..7a1a3b2 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 _0x0bb5=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0x0bb5,0x148));var _0x50bb=function(_0x4e396d,_0x3b182e){_0x4e396d=_0x4e396d-0x0;var _0x3d7e8b=_0x0bb5[_0x4e396d];return _0x3d7e8b;};'use strict';var EventEmitter=require(_0x50bb('0x0'));var OpenchannelAccount=require(_0x50bb('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50bb('0x2'),'afterUpdate':_0x50bb('0x3'),'afterDestroy':_0x50bb('0x4')};function emitEvent(_0x117e36){return function(_0x29c72b,_0xfdc9d4,_0x451b4c){OpenchannelAccountEvents[_0x50bb('0x5')](_0x117e36+':'+_0x29c72b['id'],_0x29c72b);OpenchannelAccountEvents['emit'](_0x117e36,_0x29c72b);_0x451b4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x50bb('0x6')](e,emitEvent(event));}}module[_0x50bb('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x1339=['update','remove','emit','hasOwnProperty','exports','OpenchannelAccount','setMaxListeners','save'];(function(_0x51d39,_0x73a608){var _0x396254=function(_0x1cc7bb){while(--_0x1cc7bb){_0x51d39['push'](_0x51d39['shift']());}};_0x396254(++_0x73a608);}(_0x1339,0x1ed));var _0x9133=function(_0x5a89b1,_0xe5d6a){_0x5a89b1=_0x5a89b1-0x0;var _0xe9ff0a=_0x1339[_0x5a89b1];return _0xe9ff0a;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x9133('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9133('0x1')](0x0);var events={'afterCreate':_0x9133('0x2'),'afterUpdate':_0x9133('0x3'),'afterDestroy':_0x9133('0x4')};function emitEvent(_0x192d48){return function(_0x176e80,_0x110c51,_0x558345){OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48+':'+_0x176e80['id'],_0x176e80);OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48,_0x176e80);_0x558345(null);};}for(var e in events){if(events[_0x9133('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x9133('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index b0eff81..23e2dd7 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(_0x4f3505,_0x24f8f9){var _0x2360f3=function(_0xcd2d5){while(--_0xcd2d5){_0x4f3505['push'](_0x4f3505['shift']());}};_0x2360f3(++_0x24f8f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x107092,_0x477659){var _0x5cb31f=function(_0x58e88b){while(--_0x58e88b){_0x107092['push'](_0x107092['shift']());}};_0x5cb31f(++_0x477659);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 4868f21..959ad76 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 _0xe605=['jayson/promise','client','http','redis','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5a259b,_0x8df795){var _0x3ba520=function(_0x23e74c){while(--_0x23e74c){_0x5a259b['push'](_0x5a259b['shift']());}};_0x3ba520(++_0x8df795);}(_0xe605,0x92));var _0x5e60=function(_0x45f2a7,_0x365036){_0x45f2a7=_0x45f2a7-0x0;var _0x4eabfa=_0xe605[_0x45f2a7];return _0x4eabfa;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});config[_0x5e60('0xd')]=_['defaults'](config[_0x5e60('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5e60('0xe'))[_0x5e60('0xf')](socket);function respondWithRpcPromise(_0x150a51,_0x2c5425,_0x331b3e){return new BPromise(function(_0x2cbe4e,_0x56f05a){return client[_0x5e60('0x10')](_0x150a51,_0x331b3e)['then'](function(_0x1d2558){logger[_0x5e60('0x11')](_0x5e60('0x12'),_0x2c5425,'request\x20sent');logger[_0x5e60('0x13')](_0x5e60('0x14'),_0x2c5425,_0x5e60('0x15'),JSON[_0x5e60('0x16')](_0x1d2558));if(_0x1d2558[_0x5e60('0x17')]){if(_0x1d2558[_0x5e60('0x17')]['code']===0x1f4){logger[_0x5e60('0x17')](_0x5e60('0x12'),_0x2c5425,_0x1d2558[_0x5e60('0x17')][_0x5e60('0x18')]);return _0x56f05a(_0x1d2558['error'][_0x5e60('0x18')]);}logger['error'](_0x5e60('0x12'),_0x2c5425,_0x1d2558[_0x5e60('0x17')]['message']);return _0x2cbe4e(_0x1d2558[_0x5e60('0x17')][_0x5e60('0x18')]);}else{logger[_0x5e60('0x11')](_0x5e60('0x12'),_0x2c5425,'request\x20sent');_0x2cbe4e(_0x1d2558[_0x5e60('0x19')][_0x5e60('0x18')]);}})['catch'](function(_0x1fa0f8){logger[_0x5e60('0x17')](_0x5e60('0x12'),_0x2c5425,_0x1fa0f8);_0x56f05a(_0x1fa0f8);});});} \ No newline at end of file +var _0xb62e=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xb62e,0x1de));var _0xeb62=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb62e[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});config[_0xeb62('0xc')]=_['defaults'](config[_0xeb62('0xc')],{'host':_0xeb62('0xd'),'port':0x18eb});var socket=require(_0xeb62('0xe'))(new Redis(config[_0xeb62('0xc')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4693c9,_0x40584b,_0x6d5e94){return new BPromise(function(_0xf93c21,_0x2fe923){return client[_0xeb62('0xf')](_0x4693c9,_0x6d5e94)[_0xeb62('0x10')](function(_0x3a826a){logger[_0xeb62('0x11')](_0xeb62('0x12'),_0x40584b,'request\x20sent');logger[_0xeb62('0x13')](_0xeb62('0x14'),_0x40584b,_0xeb62('0x15'),JSON[_0xeb62('0x16')](_0x3a826a));if(_0x3a826a['error']){if(_0x3a826a[_0xeb62('0x17')][_0xeb62('0x18')]===0x1f4){logger[_0xeb62('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x40584b,_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);return _0x2fe923(_0x3a826a[_0xeb62('0x17')]['message']);}logger[_0xeb62('0x17')](_0xeb62('0x12'),_0x40584b,_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);return _0xf93c21(_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);}else{logger[_0xeb62('0x11')](_0xeb62('0x12'),_0x40584b,_0xeb62('0x15'));_0xf93c21(_0x3a826a[_0xeb62('0x1a')][_0xeb62('0x19')]);}})[_0xeb62('0x1b')](function(_0x3cdf76){logger['error'](_0xeb62('0x12'),_0x40584b,_0x3cdf76);_0x2fe923(_0x3cdf76);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 42f88d7..d168c3d 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 _0x2917=['length','openchannelAccount:','./openchannelAccount.events','save','remove','update','removeListener','register'];(function(_0x5311b6,_0x3b17ab){var _0x16932e=function(_0x47fa2c){while(--_0x47fa2c){_0x5311b6['push'](_0x5311b6['shift']());}};_0x16932e(++_0x3b17ab);}(_0x2917,0x142));var _0x7291=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x2917[_0x2e2681];return _0x368a64;};'use strict';var OpenchannelAccountEvents=require(_0x7291('0x0'));var events=[_0x7291('0x1'),_0x7291('0x2'),_0x7291('0x3')];function createListener(_0x37515c,_0x398f9f){return function(_0x90e67){_0x398f9f['emit'](_0x37515c,_0x90e67);};}function removeListener(_0x5d5d51,_0x22afb9){return function(){OpenchannelAccountEvents[_0x7291('0x4')](_0x5d5d51,_0x22afb9);};}exports[_0x7291('0x5')]=function(_0x6aac19){for(var _0x1ee790=0x0,_0x237997=events[_0x7291('0x6')];_0x1ee790<_0x237997;_0x1ee790++){var _0x1f0fd8=events[_0x1ee790];var _0x452fc5=createListener(_0x7291('0x7')+_0x1f0fd8,_0x6aac19);OpenchannelAccountEvents['on'](_0x1f0fd8,_0x452fc5);}}; \ No newline at end of file +var _0x9e9b=['register','length','openchannelAccount:','./openchannelAccount.events','update'];(function(_0x41cc2c,_0x53e9bc){var _0x22eead=function(_0x567c73){while(--_0x567c73){_0x41cc2c['push'](_0x41cc2c['shift']());}};_0x22eead(++_0x53e9bc);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0x2df2d0,_0x1d6ea8){_0x2df2d0=_0x2df2d0-0x0;var _0x3c4438=_0x9e9b[_0x2df2d0];return _0x3c4438;};'use strict';var OpenchannelAccountEvents=require(_0xb9e9('0x0'));var events=['save','remove',_0xb9e9('0x1')];function createListener(_0x3d68be,_0x42d119){return function(_0x1ccb2d){_0x42d119['emit'](_0x3d68be,_0x1ccb2d);};}function removeListener(_0x430131,_0x394a8e){return function(){OpenchannelAccountEvents['removeListener'](_0x430131,_0x394a8e);};}exports[_0xb9e9('0x2')]=function(_0x7b18d5){for(var _0x3e4023=0x0,_0x119d31=events[_0xb9e9('0x3')];_0x3e4023<_0x119d31;_0x3e4023++){var _0x3e199b=events[_0x3e4023];var _0x2e9b34=createListener(_0xb9e9('0x4')+_0x3e199b,_0x7b18d5);OpenchannelAccountEvents['on'](_0x3e199b,_0x2e9b34);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 76858a2..638608e 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 _0x78b5=['./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','put','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1face9,_0x107066){var _0x142dae=function(_0x4f86d3){while(--_0x4f86d3){_0x1face9['push'](_0x1face9['shift']());}};_0x142dae(++_0x107066);}(_0x78b5,0x14c));var _0x578b=function(_0x8f79e,_0x1c8d8c){_0x8f79e=_0x8f79e-0x0;var _0x5627a9=_0x78b5[_0x8f79e];return _0x5627a9;};'use strict';var multer=require(_0x578b('0x0'));var util=require(_0x578b('0x1'));var path=require('path');var timeout=require(_0x578b('0x2'));var express=require(_0x578b('0x3'));var router=express['Router']();var fs_extra=require(_0x578b('0x4'));var auth=require(_0x578b('0x5'));var interaction=require(_0x578b('0x6'));var config=require(_0x578b('0x7'));var controller=require(_0x578b('0x8'));router[_0x578b('0x9')]('/',auth['isAuthenticated'](),controller[_0x578b('0xa')]);router[_0x578b('0x9')](_0x578b('0xb'),auth[_0x578b('0xc')](),controller[_0x578b('0xd')]);router['post']('/',auth[_0x578b('0xc')](),controller['create']);router[_0x578b('0xe')](_0x578b('0xb'),auth[_0x578b('0xc')](),controller[_0x578b('0xf')]);router['delete']('/:id',auth[_0x578b('0xc')](),controller['destroy']);module[_0x578b('0x10')]=router; \ No newline at end of file +var _0x10cb=['isAuthenticated','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id'];(function(_0x5538f8,_0x74a03){var _0x21b08e=function(_0x486f5f){while(--_0x486f5f){_0x5538f8['push'](_0x5538f8['shift']());}};_0x21b08e(++_0x74a03);}(_0x10cb,0xc5));var _0xb10c=function(_0x51cea2,_0x3ae57c){_0x51cea2=_0x51cea2-0x0;var _0x485abc=_0x10cb[_0x51cea2];return _0x485abc;};'use strict';var multer=require(_0xb10c('0x0'));var util=require('util');var path=require(_0xb10c('0x1'));var timeout=require(_0xb10c('0x2'));var express=require(_0xb10c('0x3'));var router=express[_0xb10c('0x4')]();var fs_extra=require(_0xb10c('0x5'));var auth=require(_0xb10c('0x6'));var interaction=require(_0xb10c('0x7'));var config=require(_0xb10c('0x8'));var controller=require(_0xb10c('0x9'));router[_0xb10c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb10c('0xa')](_0xb10c('0xb'),auth[_0xb10c('0xc')](),controller['show']);router[_0xb10c('0xd')]('/',auth['isAuthenticated'](),controller[_0xb10c('0xe')]);router[_0xb10c('0xf')]('/:id',auth[_0xb10c('0xc')](),controller['update']);router[_0xb10c('0x10')](_0xb10c('0xb'),auth[_0xb10c('0xc')](),controller[_0xb10c('0x11')]);module[_0xb10c('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 116df48..27f10a2 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 _0x28f4=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x14d437,_0x49f993){var _0x5903b8=function(_0x3c5f62){while(--_0x3c5f62){_0x14d437['push'](_0x14d437['shift']());}};_0x5903b8(++_0x49f993);}(_0x28f4,0xa3));var _0x428f=function(_0x5dff94,_0x23fd6a){_0x5dff94=_0x5dff94-0x0;var _0x317afe=_0x28f4[_0x5dff94];return _0x317afe;};'use strict';var Sequelize=require(_0x428f('0x0'));module[_0x428f('0x1')]={'priority':{'type':Sequelize[_0x428f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x428f('0x3')],'allowNull':![],'defaultValue':_0x428f('0x4')},'appdata':{'type':Sequelize[_0x428f('0x5')]()},'description':{'type':Sequelize[_0x428f('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x428f('0x6')}}; \ No newline at end of file +var _0xca63=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x446f11,_0x95cf21){var _0x385cb5=function(_0x426715){while(--_0x426715){_0x446f11['push'](_0x446f11['shift']());}};_0x385cb5(++_0x95cf21);}(_0xca63,0x1ba));var _0x3ca6=function(_0x2e57ca,_0x54c316){_0x2e57ca=_0x2e57ca-0x0;var _0x17d8cc=_0xca63[_0x2e57ca];return _0x17d8cc;};'use strict';var Sequelize=require(_0x3ca6('0x0'));module[_0x3ca6('0x1')]={'priority':{'type':Sequelize[_0x3ca6('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3ca6('0x3')},'appdata':{'type':Sequelize[_0x3ca6('0x4')]()},'description':{'type':Sequelize[_0x3ca6('0x5')]},'interval':{'type':Sequelize[_0x3ca6('0x5')],'defaultValue':_0x3ca6('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index e441cbe..196c3b1 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 _0x8a92=['nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x8a92,0xf5));var _0x28a9=function(_0x452765,_0x27d7f0){_0x452765=_0x452765-0x0;var _0x2aa7a7=_0x8a92[_0x452765];return _0x2aa7a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28a9('0x0'));var zipdir=require(_0x28a9('0x1'));var jsonpatch=require(_0x28a9('0x2'));var rp=require(_0x28a9('0x3'));var moment=require(_0x28a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28a9('0x5'));var util=require(_0x28a9('0x6'));var path=require(_0x28a9('0x7'));var sox=require(_0x28a9('0x8'));var csv=require(_0x28a9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28a9('0xa'));var _=require(_0x28a9('0xb'));var squel=require(_0x28a9('0xc'));var crypto=require(_0x28a9('0xd'));var jsforce=require(_0x28a9('0xe'));var deskjs=require(_0x28a9('0xf'));var toCsv=require(_0x28a9('0x9'));var querystring=require(_0x28a9('0x10'));var Papa=require(_0x28a9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x28a9('0x12'));var as=require(_0x28a9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28a9('0x14'))('api');var utils=require(_0x28a9('0x15'));var config=require(_0x28a9('0x16'));var licenseUtil=require(_0x28a9('0x17'));var db=require(_0x28a9('0x18'))['db'];function respondWithStatusCode(_0x6a2b5c,_0x3c9ebd){_0x3c9ebd=_0x3c9ebd||0xcc;return function(_0x13887f){if(_0x13887f){return _0x6a2b5c[_0x28a9('0x19')](_0x3c9ebd);}return _0x6a2b5c[_0x28a9('0x1a')](_0x3c9ebd)[_0x28a9('0x1b')]();};}function respondWithResult(_0xb3fd02,_0x2cd91a){_0x2cd91a=_0x2cd91a||0xc8;return function(_0x4479ef){if(_0x4479ef){return _0xb3fd02[_0x28a9('0x1a')](_0x2cd91a)[_0x28a9('0x1c')](_0x4479ef);}};}function respondWithFilteredResult(_0x154fab,_0x5eb902){return function(_0x2b37c0){if(_0x2b37c0){var _0x3bc672=typeof _0x5eb902[_0x28a9('0x1d')]==='undefined'&&typeof _0x5eb902[_0x28a9('0x1e')]===_0x28a9('0x1f');var _0xba0375=_0x2b37c0[_0x28a9('0x20')];var _0x25c55c=_0x3bc672?0x0:_0x5eb902[_0x28a9('0x1d')];var _0x5a59de=_0x3bc672?_0x2b37c0['count']:_0x5eb902['offset']+_0x5eb902[_0x28a9('0x1e')];var _0x8edb5c;if(_0x5a59de>=_0xba0375){_0x5a59de=_0xba0375;_0x8edb5c=0xc8;}else{_0x8edb5c=0xce;}_0x154fab[_0x28a9('0x1a')](_0x8edb5c);return _0x154fab[_0x28a9('0x21')](_0x28a9('0x22'),_0x25c55c+'-'+_0x5a59de+'/'+_0xba0375)[_0x28a9('0x1c')](_0x2b37c0);}return null;};}function patchUpdates(_0x43ee5e){return function(_0x1e09f3){try{jsonpatch['apply'](_0x1e09f3,_0x43ee5e,!![]);}catch(_0x1d6af2){return BPromise['reject'](_0x1d6af2);}return _0x1e09f3[_0x28a9('0x23')]();};}function saveUpdates(_0x4e600d,_0x352f8b){return function(_0x35f3a1){if(_0x35f3a1){return _0x35f3a1['update'](_0x4e600d)[_0x28a9('0x24')](function(_0x30f82b){return _0x30f82b;});}return null;};}function removeEntity(_0x5d9f5a,_0x531775){return function(_0x163e18){if(_0x163e18){return _0x163e18[_0x28a9('0x25')]()[_0x28a9('0x24')](function(){_0x5d9f5a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x554721,_0x248bd5){return function(_0x2a4c51){if(!_0x2a4c51){_0x554721[_0x28a9('0x19')](0x194);}return _0x2a4c51;};}function handleError(_0x2d669a,_0x3c680a){_0x3c680a=_0x3c680a||0x1f4;return function(_0x45817c){logger[_0x28a9('0x26')](_0x45817c[_0x28a9('0x27')]);if(_0x45817c[_0x28a9('0x28')]){delete _0x45817c['name'];}_0x2d669a[_0x28a9('0x1a')](_0x3c680a)[_0x28a9('0x29')](_0x45817c);};}exports[_0x28a9('0x2a')]=function(_0x2b9c2e,_0x314f13){var _0x2e87de={},_0x525fe={},_0x238a55={'count':0x0,'rows':[]};var _0x313619=_[_0x28a9('0x2b')](db[_0x28a9('0x2c')][_0x28a9('0x2d')],function(_0x1cfaac){return{'name':_0x1cfaac[_0x28a9('0x2e')],'type':_0x1cfaac[_0x28a9('0x2f')]['key']};});_0x525fe[_0x28a9('0x30')]=_[_0x28a9('0x2b')](_0x313619,_0x28a9('0x28'));_0x525fe[_0x28a9('0x31')]=_[_0x28a9('0x32')](_0x2b9c2e[_0x28a9('0x31')]);_0x525fe['filters']=_[_0x28a9('0x33')](_0x525fe[_0x28a9('0x30')],_0x525fe[_0x28a9('0x31')]);_0x2e87de[_0x28a9('0x34')]=_[_0x28a9('0x33')](_0x525fe[_0x28a9('0x30')],qs[_0x28a9('0x35')](_0x2b9c2e[_0x28a9('0x31')]['fields']));_0x2e87de[_0x28a9('0x34')]=_0x2e87de[_0x28a9('0x34')][_0x28a9('0x36')]?_0x2e87de['attributes']:_0x525fe[_0x28a9('0x30')];if(!_0x2b9c2e[_0x28a9('0x31')]['hasOwnProperty'](_0x28a9('0x37'))){_0x2e87de['limit']=qs['limit'](_0x2b9c2e[_0x28a9('0x31')]['limit']);_0x2e87de[_0x28a9('0x1d')]=qs['offset'](_0x2b9c2e[_0x28a9('0x31')][_0x28a9('0x1d')]);}_0x2e87de[_0x28a9('0x38')]=qs['sort'](_0x2b9c2e[_0x28a9('0x31')][_0x28a9('0x39')]);_0x2e87de[_0x28a9('0x3a')]=qs['filters'](_['pick'](_0x2b9c2e[_0x28a9('0x31')],_0x525fe[_0x28a9('0x3b')]),_0x313619);if(_0x2b9c2e[_0x28a9('0x31')][_0x28a9('0x3c')]){_0x2e87de[_0x28a9('0x3a')]=_[_0x28a9('0x3d')](_0x2e87de[_0x28a9('0x3a')],{'$or':_[_0x28a9('0x2b')](_0x313619,function(_0x3ce626){if(_0x3ce626[_0x28a9('0x2f')]!==_0x28a9('0x3e')){var _0x3ef8c8={};_0x3ef8c8[_0x3ce626[_0x28a9('0x28')]]={'$like':'%'+_0x2b9c2e['query']['filter']+'%'};return _0x3ef8c8;}})});}_0x2e87de=_[_0x28a9('0x3d')]({},_0x2e87de,_0x2b9c2e[_0x28a9('0x3f')]);var _0x4ad8d4={'where':_0x2e87de['where']};return db['OpenchannelApplication'][_0x28a9('0x20')](_0x4ad8d4)[_0x28a9('0x24')](function(_0x13fcde){_0x238a55[_0x28a9('0x20')]=_0x13fcde;if(_0x2b9c2e['query'][_0x28a9('0x40')]){_0x2e87de[_0x28a9('0x41')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x28a9('0x42')](_0x2e87de);})[_0x28a9('0x24')](function(_0x5a2337){_0x238a55[_0x28a9('0x43')]=_0x5a2337;return _0x238a55;})[_0x28a9('0x24')](respondWithFilteredResult(_0x314f13,_0x2e87de))[_0x28a9('0x44')](handleError(_0x314f13,null));};exports[_0x28a9('0x45')]=function(_0x589d03,_0x180126){var _0x1149db={'raw':!![],'where':{'id':_0x589d03[_0x28a9('0x46')]['id']}},_0x4d9f0b={};_0x4d9f0b[_0x28a9('0x30')]=_['keys'](db[_0x28a9('0x2c')][_0x28a9('0x2d')]);_0x4d9f0b[_0x28a9('0x31')]=_[_0x28a9('0x32')](_0x589d03[_0x28a9('0x31')]);_0x4d9f0b[_0x28a9('0x3b')]=_[_0x28a9('0x33')](_0x4d9f0b[_0x28a9('0x30')],_0x4d9f0b['query']);_0x1149db[_0x28a9('0x34')]=_[_0x28a9('0x33')](_0x4d9f0b['model'],qs['fields'](_0x589d03[_0x28a9('0x31')][_0x28a9('0x35')]));_0x1149db[_0x28a9('0x34')]=_0x1149db[_0x28a9('0x34')][_0x28a9('0x36')]?_0x1149db[_0x28a9('0x34')]:_0x4d9f0b[_0x28a9('0x30')];if(_0x589d03['query'][_0x28a9('0x40')]){_0x1149db[_0x28a9('0x41')]=[{'all':!![]}];}_0x1149db=_[_0x28a9('0x3d')]({},_0x1149db,_0x589d03[_0x28a9('0x3f')]);return db[_0x28a9('0x2c')][_0x28a9('0x47')](_0x1149db)[_0x28a9('0x24')](handleEntityNotFound(_0x180126,null))[_0x28a9('0x24')](respondWithResult(_0x180126,null))[_0x28a9('0x44')](handleError(_0x180126,null));};exports['create']=function(_0x44a17d,_0x4b06ba){return db[_0x28a9('0x2c')][_0x28a9('0x48')](_0x44a17d['body'],{})[_0x28a9('0x24')](respondWithResult(_0x4b06ba,0xc9))[_0x28a9('0x44')](handleError(_0x4b06ba,null));};exports[_0x28a9('0x49')]=function(_0x325577,_0x42a57d){if(_0x325577[_0x28a9('0x4a')]['id']){delete _0x325577[_0x28a9('0x4a')]['id'];}return db[_0x28a9('0x2c')][_0x28a9('0x47')]({'where':{'id':_0x325577[_0x28a9('0x46')]['id']}})[_0x28a9('0x24')](handleEntityNotFound(_0x42a57d,null))['then'](saveUpdates(_0x325577['body'],null))[_0x28a9('0x24')](respondWithResult(_0x42a57d,null))['catch'](handleError(_0x42a57d,null));};exports[_0x28a9('0x25')]=function(_0x38bf47,_0x15404b){return db['OpenchannelApplication'][_0x28a9('0x47')]({'where':{'id':_0x38bf47[_0x28a9('0x46')]['id']}})['then'](handleEntityNotFound(_0x15404b,null))['then'](removeEntity(_0x15404b,null))[_0x28a9('0x44')](handleError(_0x15404b,null));}; \ No newline at end of file +var _0xec0f=['includeAll','findAll','rows','catch','params','length','include','find','create','body','destroy','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0x3442ba,_0x57040f){var _0x80c090=function(_0x164635){while(--_0x164635){_0x3442ba['push'](_0x3442ba['shift']());}};_0x80c090(++_0x57040f);}(_0xec0f,0x1b5));var _0xfec0=function(_0x55572a,_0x3d75a5){_0x55572a=_0x55572a-0x0;var _0x5b3b99=_0xec0f[_0x55572a];return _0x5b3b99;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfec0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfec0('0x1'));var moment=require(_0xfec0('0x2'));var BPromise=require(_0xfec0('0x3'));var Mustache=require(_0xfec0('0x4'));var util=require(_0xfec0('0x5'));var path=require('path');var sox=require(_0xfec0('0x6'));var csv=require('to-csv');var ejs=require(_0xfec0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfec0('0x8'));var squel=require(_0xfec0('0x9'));var crypto=require(_0xfec0('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfec0('0xb'));var querystring=require(_0xfec0('0xc'));var Papa=require(_0xfec0('0xd'));var Redis=require(_0xfec0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfec0('0xf'));var hardwareService=require(_0xfec0('0x10'));var logger=require(_0xfec0('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xfec0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xfec0('0x13'))['db'];function respondWithStatusCode(_0x8046a8,_0x447259){_0x447259=_0x447259||0xcc;return function(_0x6d0767){if(_0x6d0767){return _0x8046a8[_0xfec0('0x14')](_0x447259);}return _0x8046a8['status'](_0x447259)[_0xfec0('0x15')]();};}function respondWithResult(_0x7a37e2,_0x5789d0){_0x5789d0=_0x5789d0||0xc8;return function(_0x149c30){if(_0x149c30){return _0x7a37e2[_0xfec0('0x16')](_0x5789d0)[_0xfec0('0x17')](_0x149c30);}};}function respondWithFilteredResult(_0x511ff6,_0x6d2ab8){return function(_0x10e44a){if(_0x10e44a){var _0x33939f=typeof _0x6d2ab8[_0xfec0('0x18')]===_0xfec0('0x19')&&typeof _0x6d2ab8['limit']===_0xfec0('0x19');var _0x4ed20f=_0x10e44a['count'];var _0x3d5333=_0x33939f?0x0:_0x6d2ab8[_0xfec0('0x18')];var _0x3f9c7b=_0x33939f?_0x10e44a[_0xfec0('0x1a')]:_0x6d2ab8['offset']+_0x6d2ab8[_0xfec0('0x1b')];var _0x44397e;if(_0x3f9c7b>=_0x4ed20f){_0x3f9c7b=_0x4ed20f;_0x44397e=0xc8;}else{_0x44397e=0xce;}_0x511ff6['status'](_0x44397e);return _0x511ff6[_0xfec0('0x1c')](_0xfec0('0x1d'),_0x3d5333+'-'+_0x3f9c7b+'/'+_0x4ed20f)[_0xfec0('0x17')](_0x10e44a);}return null;};}function patchUpdates(_0x56da21){return function(_0x2917de){try{jsonpatch[_0xfec0('0x1e')](_0x2917de,_0x56da21,!![]);}catch(_0x2d75f3){return BPromise[_0xfec0('0x1f')](_0x2d75f3);}return _0x2917de[_0xfec0('0x20')]();};}function saveUpdates(_0x5a8aa6,_0x99f477){return function(_0x1e6b4c){if(_0x1e6b4c){return _0x1e6b4c[_0xfec0('0x21')](_0x5a8aa6)[_0xfec0('0x22')](function(_0x320e3e){return _0x320e3e;});}return null;};}function removeEntity(_0x5c4b4b,_0xcaf35a){return function(_0x48f46b){if(_0x48f46b){return _0x48f46b['destroy']()[_0xfec0('0x22')](function(){_0x5c4b4b['status'](0xcc)[_0xfec0('0x15')]();});}};}function handleEntityNotFound(_0x15851a,_0x91ecfb){return function(_0x2f7b0a){if(!_0x2f7b0a){_0x15851a[_0xfec0('0x14')](0x194);}return _0x2f7b0a;};}function handleError(_0x4319d5,_0x1d0e88){_0x1d0e88=_0x1d0e88||0x1f4;return function(_0x578518){logger['error'](_0x578518[_0xfec0('0x23')]);if(_0x578518['name']){delete _0x578518[_0xfec0('0x24')];}_0x4319d5['status'](_0x1d0e88)[_0xfec0('0x25')](_0x578518);};}exports[_0xfec0('0x26')]=function(_0x2e5bfa,_0x47d2b6){var _0x1177f5={},_0x10ca3c={},_0x9cd710={'count':0x0,'rows':[]};var _0x19168a=_['map'](db[_0xfec0('0x27')][_0xfec0('0x28')],function(_0x26f26a){return{'name':_0x26f26a[_0xfec0('0x29')],'type':_0x26f26a['type'][_0xfec0('0x2a')]};});_0x10ca3c['model']=_[_0xfec0('0x2b')](_0x19168a,'name');_0x10ca3c[_0xfec0('0x2c')]=_[_0xfec0('0x2d')](_0x2e5bfa[_0xfec0('0x2c')]);_0x10ca3c[_0xfec0('0x2e')]=_[_0xfec0('0x2f')](_0x10ca3c[_0xfec0('0x30')],_0x10ca3c[_0xfec0('0x2c')]);_0x1177f5['attributes']=_[_0xfec0('0x2f')](_0x10ca3c[_0xfec0('0x30')],qs[_0xfec0('0x31')](_0x2e5bfa['query']['fields']));_0x1177f5[_0xfec0('0x32')]=_0x1177f5[_0xfec0('0x32')]['length']?_0x1177f5[_0xfec0('0x32')]:_0x10ca3c[_0xfec0('0x30')];if(!_0x2e5bfa[_0xfec0('0x2c')]['hasOwnProperty'](_0xfec0('0x33'))){_0x1177f5[_0xfec0('0x1b')]=qs[_0xfec0('0x1b')](_0x2e5bfa[_0xfec0('0x2c')]['limit']);_0x1177f5[_0xfec0('0x18')]=qs['offset'](_0x2e5bfa[_0xfec0('0x2c')][_0xfec0('0x18')]);}_0x1177f5[_0xfec0('0x34')]=qs['sort'](_0x2e5bfa['query'][_0xfec0('0x35')]);_0x1177f5[_0xfec0('0x36')]=qs['filters'](_['pick'](_0x2e5bfa['query'],_0x10ca3c[_0xfec0('0x2e')]),_0x19168a);if(_0x2e5bfa['query'][_0xfec0('0x37')]){_0x1177f5['where']=_[_0xfec0('0x38')](_0x1177f5[_0xfec0('0x36')],{'$or':_[_0xfec0('0x2b')](_0x19168a,function(_0xac36f1){if(_0xac36f1[_0xfec0('0x39')]!==_0xfec0('0x3a')){var _0x48a287={};_0x48a287[_0xac36f1[_0xfec0('0x24')]]={'$like':'%'+_0x2e5bfa['query'][_0xfec0('0x37')]+'%'};return _0x48a287;}})});}_0x1177f5=_['merge']({},_0x1177f5,_0x2e5bfa[_0xfec0('0x3b')]);var _0x422d22={'where':_0x1177f5[_0xfec0('0x36')]};return db['OpenchannelApplication'][_0xfec0('0x1a')](_0x422d22)[_0xfec0('0x22')](function(_0x1b20fe){_0x9cd710[_0xfec0('0x1a')]=_0x1b20fe;if(_0x2e5bfa[_0xfec0('0x2c')][_0xfec0('0x3c')]){_0x1177f5['include']=[{'all':!![]}];}return db[_0xfec0('0x27')][_0xfec0('0x3d')](_0x1177f5);})['then'](function(_0x58117c){_0x9cd710[_0xfec0('0x3e')]=_0x58117c;return _0x9cd710;})[_0xfec0('0x22')](respondWithFilteredResult(_0x47d2b6,_0x1177f5))[_0xfec0('0x3f')](handleError(_0x47d2b6,null));};exports['show']=function(_0x2d9af5,_0x3b9722){var _0x140a5d={'raw':!![],'where':{'id':_0x2d9af5[_0xfec0('0x40')]['id']}},_0xccc82e={};_0xccc82e[_0xfec0('0x30')]=_[_0xfec0('0x2d')](db[_0xfec0('0x27')]['rawAttributes']);_0xccc82e['query']=_['keys'](_0x2d9af5[_0xfec0('0x2c')]);_0xccc82e['filters']=_[_0xfec0('0x2f')](_0xccc82e[_0xfec0('0x30')],_0xccc82e[_0xfec0('0x2c')]);_0x140a5d[_0xfec0('0x32')]=_[_0xfec0('0x2f')](_0xccc82e[_0xfec0('0x30')],qs[_0xfec0('0x31')](_0x2d9af5['query'][_0xfec0('0x31')]));_0x140a5d[_0xfec0('0x32')]=_0x140a5d[_0xfec0('0x32')][_0xfec0('0x41')]?_0x140a5d['attributes']:_0xccc82e[_0xfec0('0x30')];if(_0x2d9af5[_0xfec0('0x2c')][_0xfec0('0x3c')]){_0x140a5d[_0xfec0('0x42')]=[{'all':!![]}];}_0x140a5d=_[_0xfec0('0x38')]({},_0x140a5d,_0x2d9af5[_0xfec0('0x3b')]);return db[_0xfec0('0x27')][_0xfec0('0x43')](_0x140a5d)[_0xfec0('0x22')](handleEntityNotFound(_0x3b9722,null))[_0xfec0('0x22')](respondWithResult(_0x3b9722,null))['catch'](handleError(_0x3b9722,null));};exports[_0xfec0('0x44')]=function(_0x4caca9,_0x3bd234){return db[_0xfec0('0x27')][_0xfec0('0x44')](_0x4caca9[_0xfec0('0x45')],{})[_0xfec0('0x22')](respondWithResult(_0x3bd234,0xc9))[_0xfec0('0x3f')](handleError(_0x3bd234,null));};exports[_0xfec0('0x21')]=function(_0x561600,_0x38897f){if(_0x561600[_0xfec0('0x45')]['id']){delete _0x561600[_0xfec0('0x45')]['id'];}return db[_0xfec0('0x27')][_0xfec0('0x43')]({'where':{'id':_0x561600[_0xfec0('0x40')]['id']}})[_0xfec0('0x22')](handleEntityNotFound(_0x38897f,null))['then'](saveUpdates(_0x561600['body'],null))['then'](respondWithResult(_0x38897f,null))[_0xfec0('0x3f')](handleError(_0x38897f,null));};exports[_0xfec0('0x46')]=function(_0x11c4ad,_0x3d20c8){return db[_0xfec0('0x27')][_0xfec0('0x43')]({'where':{'id':_0x11c4ad[_0xfec0('0x40')]['id']}})[_0xfec0('0x22')](handleEntityNotFound(_0x3d20c8,null))[_0xfec0('0x22')](removeEntity(_0x3d20c8,null))['catch'](handleError(_0x3d20c8,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 82797dc..1a3c977 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 _0x2850=['OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define'];(function(_0x2f7186,_0x4fc49e){var _0x18d611=function(_0x4baa16){while(--_0x4baa16){_0x2f7186['push'](_0x2f7186['shift']());}};_0x18d611(++_0x4fc49e);}(_0x2850,0x1a3));var _0x0285=function(_0x2b92de,_0x4d4856){_0x2b92de=_0x2b92de-0x0;var _0x8cb5c7=_0x2850[_0x2b92de];return _0x8cb5c7;};'use strict';var _=require(_0x0285('0x0'));var util=require('util');var logger=require(_0x0285('0x1'))(_0x0285('0x2'));var moment=require('moment');var BPromise=require(_0x0285('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0285('0x4'));var rimraf=require(_0x0285('0x5'));var config=require(_0x0285('0x6'));var attributes=require(_0x0285('0x7'));module[_0x0285('0x8')]=function(_0x2d71d6,_0x40ca49){return _0x2d71d6[_0x0285('0x9')](_0x0285('0xa'),attributes,{'tableName':_0x0285('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0285('0xc')});}; \ No newline at end of file +var _0x200c=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','OpenchannelApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0xaf524,_0x288431){var _0x4a5cf2=function(_0x5c1330){while(--_0x5c1330){_0xaf524['push'](_0xaf524['shift']());}};_0x4a5cf2(++_0x288431);}(_0x200c,0x10c));var _0xc200=function(_0xc3075a,_0x51279c){_0xc3075a=_0xc3075a-0x0;var _0x3ce7af=_0x200c[_0xc3075a];return _0x3ce7af;};'use strict';var _=require(_0xc200('0x0'));var util=require(_0xc200('0x1'));var logger=require(_0xc200('0x2'))(_0xc200('0x3'));var moment=require(_0xc200('0x4'));var BPromise=require(_0xc200('0x5'));var rp=require(_0xc200('0x6'));var fs=require('fs');var path=require(_0xc200('0x7'));var rimraf=require(_0xc200('0x8'));var config=require(_0xc200('0x9'));var attributes=require(_0xc200('0xa'));module['exports']=function(_0x15f12d,_0xf05b44){return _0x15f12d['define'](_0xc200('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc200('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index ace85ed..d0f3855 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 _0x4ec7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','limit','stringify','catch','lodash','util','moment','randomstring','ioredis'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x4ec7,0x6b));var _0x74ec=function(_0x2c5250,_0x4acb9b){_0x2c5250=_0x2c5250-0x0;var _0x52f25d=_0x4ec7[_0x2c5250];return _0x52f25d;};'use strict';var _=require(_0x74ec('0x0'));var util=require(_0x74ec('0x1'));var moment=require(_0x74ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x74ec('0x3'));var fs=require('fs');var Redis=require(_0x74ec('0x4'));var db=require(_0x74ec('0x5'))['db'];var utils=require(_0x74ec('0x6'));var logger=require(_0x74ec('0x7'))(_0x74ec('0x8'));var config=require(_0x74ec('0x9'));var jayson=require(_0x74ec('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x447d01,_0xb11b6f,_0xab254d){return new BPromise(function(_0x442206,_0x4d25b1){return client['request'](_0x447d01,_0xab254d)['then'](function(_0x2bbf8e){logger[_0x74ec('0xb')](_0x74ec('0xc'),_0xb11b6f,_0x74ec('0xd'));logger[_0x74ec('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xb11b6f,_0x74ec('0xd'),JSON['stringify'](_0x2bbf8e));if(_0x2bbf8e[_0x74ec('0xf')]){if(_0x2bbf8e[_0x74ec('0xf')][_0x74ec('0x10')]===0x1f4){logger[_0x74ec('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0xb11b6f,_0x2bbf8e[_0x74ec('0xf')]['message']);return _0x4d25b1(_0x2bbf8e[_0x74ec('0xf')][_0x74ec('0x11')]);}logger['error'](_0x74ec('0xc'),_0xb11b6f,_0x2bbf8e['error']['message']);return _0x442206(_0x2bbf8e[_0x74ec('0xf')][_0x74ec('0x11')]);}else{logger[_0x74ec('0xb')](_0x74ec('0xc'),_0xb11b6f,_0x74ec('0xd'));_0x442206(_0x2bbf8e[_0x74ec('0x12')][_0x74ec('0x11')]);}})['catch'](function(_0xaf544f){logger[_0x74ec('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0xb11b6f,_0xaf544f);_0x4d25b1(_0xaf544f);});});}exports[_0x74ec('0x13')]=function(_0x215cb2){var _0x52f498=this;return new Promise(function(_0x2182dc,_0x51f4fb){return db[_0x74ec('0x14')][_0x74ec('0x15')](_0x215cb2['body'],{'raw':_0x215cb2['options']?_0x215cb2[_0x74ec('0x16')][_0x74ec('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x215cb2[_0x74ec('0x16')]?_0x215cb2[_0x74ec('0x16')][_0x74ec('0x18')]||null:null,'attributes':_0x215cb2[_0x74ec('0x16')]?_0x215cb2[_0x74ec('0x16')]['attributes']||null:null,'limit':_0x215cb2['options']?_0x215cb2[_0x74ec('0x16')][_0x74ec('0x19')]||null:null})['then'](function(_0x497e8b){logger[_0x74ec('0xb')]('UpdateOpenchannelApplication',_0x215cb2);logger[_0x74ec('0xe')](_0x74ec('0x13'),_0x215cb2,JSON[_0x74ec('0x1a')](_0x497e8b));_0x2182dc(_0x497e8b);})[_0x74ec('0x1b')](function(_0xde2ebb){logger[_0x74ec('0xf')](_0x74ec('0x13'),_0xde2ebb[_0x74ec('0x11')],_0x215cb2);_0x51f4fb(_0x52f498['error'](0x1f4,_0xde2ebb['message']));});});}; \ No newline at end of file +var _0x7891=['UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelApplication','update','body','options','where'];(function(_0x11160d,_0x413adc){var _0x21520a=function(_0x272f3c){while(--_0x272f3c){_0x11160d['push'](_0x11160d['shift']());}};_0x21520a(++_0x413adc);}(_0x7891,0x79));var _0x1789=function(_0x48de7d,_0x23bd65){_0x48de7d=_0x48de7d-0x0;var _0x276f39=_0x7891[_0x48de7d];return _0x276f39;};'use strict';var _=require(_0x1789('0x0'));var util=require(_0x1789('0x1'));var moment=require(_0x1789('0x2'));var BPromise=require(_0x1789('0x3'));var rs=require(_0x1789('0x4'));var fs=require('fs');var Redis=require(_0x1789('0x5'));var db=require(_0x1789('0x6'))['db'];var utils=require(_0x1789('0x7'));var logger=require(_0x1789('0x8'))(_0x1789('0x9'));var config=require(_0x1789('0xa'));var jayson=require(_0x1789('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ef839,_0x933482,_0x56c2dc){return new BPromise(function(_0x211d2b,_0x562eb0){return client['request'](_0x4ef839,_0x56c2dc)[_0x1789('0xc')](function(_0x2da10a){logger[_0x1789('0xd')](_0x1789('0xe'),_0x933482,_0x1789('0xf'));logger[_0x1789('0x10')](_0x1789('0x11'),_0x933482,_0x1789('0xf'),JSON[_0x1789('0x12')](_0x2da10a));if(_0x2da10a[_0x1789('0x13')]){if(_0x2da10a['error'][_0x1789('0x14')]===0x1f4){logger[_0x1789('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x933482,_0x2da10a['error']['message']);return _0x562eb0(_0x2da10a[_0x1789('0x13')][_0x1789('0x15')]);}logger[_0x1789('0x13')](_0x1789('0xe'),_0x933482,_0x2da10a[_0x1789('0x13')][_0x1789('0x15')]);return _0x211d2b(_0x2da10a[_0x1789('0x13')][_0x1789('0x15')]);}else{logger[_0x1789('0xd')](_0x1789('0xe'),_0x933482,'request\x20sent');_0x211d2b(_0x2da10a[_0x1789('0x16')][_0x1789('0x15')]);}})[_0x1789('0x17')](function(_0x4f40a3){logger['error'](_0x1789('0xe'),_0x933482,_0x4f40a3);_0x562eb0(_0x4f40a3);});});}exports['UpdateOpenchannelApplication']=function(_0xa8a10){var _0x16205b=this;return new Promise(function(_0x5ec497,_0x9085b4){return db[_0x1789('0x18')][_0x1789('0x19')](_0xa8a10[_0x1789('0x1a')],{'raw':_0xa8a10[_0x1789('0x1b')]?_0xa8a10[_0x1789('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa8a10[_0x1789('0x1b')]?_0xa8a10[_0x1789('0x1b')][_0x1789('0x1c')]||null:null,'attributes':_0xa8a10[_0x1789('0x1b')]?_0xa8a10[_0x1789('0x1b')]['attributes']||null:null,'limit':_0xa8a10[_0x1789('0x1b')]?_0xa8a10[_0x1789('0x1b')]['limit']||null:null})[_0x1789('0xc')](function(_0x25c5ab){logger['info'](_0x1789('0x1d'),_0xa8a10);logger['debug'](_0x1789('0x1d'),_0xa8a10,JSON[_0x1789('0x12')](_0x25c5ab));_0x5ec497(_0x25c5ab);})[_0x1789('0x17')](function(_0x2d960f){logger['error'](_0x1789('0x1d'),_0x2d960f[_0x1789('0x15')],_0xa8a10);_0x9085b4(_0x16205b[_0x1789('0x13')](0x1f4,_0x2d960f[_0x1789('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index b551d90..472c6f3 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 _0xef6f=['delete','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','put','/:id','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xef6f,0xf4));var _0xfef6=function(_0x36258e,_0x343bc8){_0x36258e=_0x36258e-0x0;var _0x38bbfa=_0xef6f[_0x36258e];return _0x38bbfa;};'use strict';var multer=require('multer');var util=require(_0xfef6('0x0'));var path=require('path');var timeout=require(_0xfef6('0x1'));var express=require(_0xfef6('0x2'));var router=express[_0xfef6('0x3')]();var fs_extra=require(_0xfef6('0x4'));var auth=require(_0xfef6('0x5'));var interaction=require(_0xfef6('0x6'));var config=require(_0xfef6('0x7'));var controller=require(_0xfef6('0x8'));router[_0xfef6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfef6('0x9')]('/describe',auth[_0xfef6('0xa')](),controller['describe']);router['get']('/:id',auth[_0xfef6('0xa')](),controller[_0xfef6('0xb')]);router[_0xfef6('0x9')](_0xfef6('0xc'),auth['isAuthenticated'](),controller[_0xfef6('0xd')]);router[_0xfef6('0x9')](_0xfef6('0xe'),auth[_0xfef6('0xa')](),controller[_0xfef6('0xf')]);router[_0xfef6('0x10')]('/',auth[_0xfef6('0xa')](),controller[_0xfef6('0x11')]);router[_0xfef6('0x10')]('/:id/messages',auth[_0xfef6('0xa')](),controller['addMessage']);router[_0xfef6('0x10')](_0xfef6('0x12'),auth[_0xfef6('0xa')](),interaction[_0xfef6('0x13')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0xfef6('0x14')](_0xfef6('0x15'),auth[_0xfef6('0xa')](),interaction['tracked'](_0xfef6('0x16'),_0xfef6('0x17')),controller[_0xfef6('0x18')]);router['delete'](_0xfef6('0x15'),auth['isAuthenticated'](),interaction[_0xfef6('0x13')]('openchannel',_0xfef6('0x19')),controller['destroy']);router[_0xfef6('0x1a')](_0xfef6('0x12'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x18df=['isAuthenticated','download','post','create','addMessage','/:id/tags','openchannelinteraction:addtags','put','tracked','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','describe','/:id','show','/:id/messages'];(function(_0x28a376,_0x409968){var _0x1f3797=function(_0x589232){while(--_0x589232){_0x28a376['push'](_0x28a376['shift']());}};_0x1f3797(++_0x409968);}(_0x18df,0x88));var _0xf18d=function(_0x48238e,_0x2b4921){_0x48238e=_0x48238e-0x0;var _0x5c6400=_0x18df[_0x48238e];return _0x5c6400;};'use strict';var multer=require(_0xf18d('0x0'));var util=require(_0xf18d('0x1'));var path=require(_0xf18d('0x2'));var timeout=require(_0xf18d('0x3'));var express=require('express');var router=express[_0xf18d('0x4')]();var fs_extra=require(_0xf18d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf18d('0x6'));var config=require(_0xf18d('0x7'));var controller=require(_0xf18d('0x8'));router[_0xf18d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf18d('0xa')]);router[_0xf18d('0x9')](_0xf18d('0xb'),auth['isAuthenticated'](),controller[_0xf18d('0xc')]);router[_0xf18d('0x9')](_0xf18d('0xd'),auth[_0xf18d('0xe')](),controller['getMessages']);router['get']('/:id/download',auth[_0xf18d('0xe')](),controller[_0xf18d('0xf')]);router[_0xf18d('0x10')]('/',auth[_0xf18d('0xe')](),controller[_0xf18d('0x11')]);router[_0xf18d('0x10')](_0xf18d('0xd'),auth[_0xf18d('0xe')](),controller[_0xf18d('0x12')]);router[_0xf18d('0x10')](_0xf18d('0x13'),auth[_0xf18d('0xe')](),interaction['tracked']('openchannel',_0xf18d('0x14')),controller['addTags']);router[_0xf18d('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0xf18d('0x16')](_0xf18d('0x17'),_0xf18d('0x18')),controller[_0xf18d('0x19')]);router['delete'](_0xf18d('0xb'),auth[_0xf18d('0xe')](),interaction[_0xf18d('0x16')](_0xf18d('0x17'),_0xf18d('0x1a')),controller[_0xf18d('0x1b')]);router['delete'](_0xf18d('0x13'),auth['isAuthenticated'](),controller[_0xf18d('0x1c')]);module[_0xf18d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 2aeac21..176fec4 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 _0xc02d=['out','exports','BOOLEAN','DATE','STRING'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xc02d,0x1aa));var _0xdc02=function(_0x27c329,_0x29f72d){_0x27c329=_0x27c329-0x0;var _0x3c5a2d=_0xc02d[_0x27c329];return _0x3c5a2d;};'use strict';var Sequelize=require('sequelize');module[_0xdc02('0x0')]={'closed':{'type':Sequelize[_0xdc02('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdc02('0x2')]},'disposition':{'type':Sequelize[_0xdc02('0x3')]},'secondDisposition':{'type':Sequelize[_0xdc02('0x3')]},'thirdDisposition':{'type':Sequelize[_0xdc02('0x3')]},'note':{'type':Sequelize[_0xdc02('0x3')]},'read1stAt':{'type':Sequelize[_0xdc02('0x2')]},'threadId':{'type':Sequelize[_0xdc02('0x3')]},'externalUrl':{'type':Sequelize[_0xdc02('0x3')]},'lastMsgAt':{'type':Sequelize[_0xdc02('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xdc02('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xdc02('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xdc02('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x61e6=['sequelize','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0xe2dce0,_0xacbb6a){var _0x134a7d=function(_0x17f8b0){while(--_0x17f8b0){_0xe2dce0['push'](_0xe2dce0['shift']());}};_0x134a7d(++_0xacbb6a);}(_0x61e6,0x9a));var _0x661e=function(_0x243834,_0x256db1){_0x243834=_0x243834-0x0;var _0xe3519=_0x61e6[_0x243834];return _0xe3519;};'use strict';var Sequelize=require(_0x661e('0x0'));module[_0x661e('0x1')]={'closed':{'type':Sequelize[_0x661e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x661e('0x3')]},'secondDisposition':{'type':Sequelize[_0x661e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x661e('0x3')]},'note':{'type':Sequelize[_0x661e('0x3')]},'read1stAt':{'type':Sequelize[_0x661e('0x4')]},'threadId':{'type':Sequelize[_0x661e('0x3')]},'externalUrl':{'type':Sequelize[_0x661e('0x3')]},'lastMsgAt':{'type':Sequelize[_0x661e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x661e('0x5')]('in',_0x661e('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x661e('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x661e('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 6b57155..6bf31a8 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 _0x452a=['api','../../config/utils','../../mysqldb','defaults','redis','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Users','Tags','TagIds','split','forEach','push','catch','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','sort','where','select','field','from','tools_tags','u.fullname','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','Contact','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','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','text','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','keyBy','merge','OpenchannelInteraction','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','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.OpenchannelInteractionId\x20IN\x20?','all','params','includeAll','create','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','hasOwnProperty','pick','filter','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','rows','addTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','join','files','tmp','root','server','transcript-%d-%s.zip','fullname','CmContact','lastName','Attachment','Messages','direction','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','closed','closedAt','threadId','Public','basename','createReadStream','pipe','createWriteStream','createdAt','out','System','firstName','secret','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x452a,0xd5));var _0xa452=function(_0x57645b,_0x25f73a){_0x57645b=_0x57645b-0x0;var _0xe82f00=_0x452a[_0x57645b];return _0xe82f00;};'use strict';var emlformat=require(_0xa452('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa452('0x1'));var rp=require(_0xa452('0x2'));var moment=require(_0xa452('0x3'));var BPromise=require(_0xa452('0x4'));var Mustache=require(_0xa452('0x5'));var util=require(_0xa452('0x6'));var path=require('path');var sox=require(_0xa452('0x7'));var csv=require(_0xa452('0x8'));var ejs=require(_0xa452('0x9'));var fs=require('fs');var fs_extra=require(_0xa452('0xa'));var _=require('lodash');var squel=require(_0xa452('0xb'));var crypto=require(_0xa452('0xc'));var jsforce=require(_0xa452('0xd'));var deskjs=require(_0xa452('0xe'));var toCsv=require(_0xa452('0x8'));var querystring=require(_0xa452('0xf'));var Papa=require('papaparse');var Redis=require(_0xa452('0x10'));var authService=require(_0xa452('0x11'));var qs=require(_0xa452('0x12'));var as=require(_0xa452('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa452('0x14'));var utils=require(_0xa452('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa452('0x16'))['db'];config['redis']=_[_0xa452('0x17')](config[_0xa452('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa452('0x19'))[_0xa452('0x1a')](socket);function respondWithStatusCode(_0x1301a9,_0x186138){_0x186138=_0x186138||0xcc;return function(_0x20c196){if(_0x20c196){return _0x1301a9[_0xa452('0x1b')](_0x186138);}return _0x1301a9[_0xa452('0x1c')](_0x186138)[_0xa452('0x1d')]();};}function respondWithResult(_0x2cada5,_0x189c37){_0x189c37=_0x189c37||0xc8;return function(_0x4278c2){if(_0x4278c2){return _0x2cada5[_0xa452('0x1c')](_0x189c37)[_0xa452('0x1e')](_0x4278c2);}};}function respondWithFilteredResult(_0x237293,_0x2ad4d3){return function(_0x378e14){if(_0x378e14){var _0x464832=typeof _0x2ad4d3['offset']===_0xa452('0x1f')&&typeof _0x2ad4d3[_0xa452('0x20')]==='undefined';var _0x2afa07=_0x378e14[_0xa452('0x21')];var _0x4fa2e6=_0x464832?0x0:_0x2ad4d3[_0xa452('0x22')];var _0x40fb48=_0x464832?_0x378e14[_0xa452('0x21')]:_0x2ad4d3[_0xa452('0x22')]+_0x2ad4d3['limit'];var _0x289ae2;if(_0x40fb48>=_0x2afa07){_0x40fb48=_0x2afa07;_0x289ae2=0xc8;}else{_0x289ae2=0xce;}_0x237293['status'](_0x289ae2);return _0x237293['set'](_0xa452('0x23'),_0x4fa2e6+'-'+_0x40fb48+'/'+_0x2afa07)[_0xa452('0x1e')](_0x378e14);}return null;};}function patchUpdates(_0x17d3c6){return function(_0x55c114){try{jsonpatch[_0xa452('0x24')](_0x55c114,_0x17d3c6,!![]);}catch(_0x5e9639){return BPromise[_0xa452('0x25')](_0x5e9639);}return _0x55c114[_0xa452('0x26')]();};}function saveUpdates(_0x42c95f,_0x32eb78){return function(_0x2354db){if(_0x2354db){return _0x2354db[_0xa452('0x27')](_0x42c95f)[_0xa452('0x28')](function(_0x2ac7cb){return _0x2ac7cb;});}return null;};}function removeEntity(_0x1969f7,_0x286884){return function(_0x1f58df){if(_0x1f58df){return _0x1f58df[_0xa452('0x29')]()[_0xa452('0x28')](function(){_0x1969f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8aff,_0x38026f){return function(_0x1c3ef8){if(!_0x1c3ef8){_0x4e8aff[_0xa452('0x1b')](0x194);}return _0x1c3ef8;};}function handleError(_0x568372,_0x225120){_0x225120=_0x225120||0x1f4;return function(_0x325b11){logger[_0xa452('0x2a')](_0x325b11[_0xa452('0x2b')]);if(_0x325b11[_0xa452('0x2c')]){delete _0x325b11[_0xa452('0x2c')];}_0x568372[_0xa452('0x1c')](_0x225120)['send'](_0x325b11);};}function getInteractionUsers(_0x588dab,_0x9fc2a9){return new BPromise(function(_0x2456fb,_0x3d5a01){try{if(_0x9fc2a9[_0x588dab['id']]){_0x588dab[_0xa452('0x2d')]=_['map'](_0x9fc2a9[_0x588dab['id']],function(_0x30e85a){return{'id':_0x30e85a['id'],'fullname':_0x30e85a['fullname']};});}}catch(_0x1351d2){_0x3d5a01(_0x1351d2);}_0x2456fb(_0x588dab);});}function getInteractionTags(_0x57f96b,_0x1d10ce){return new BPromise(function(_0x4aa805,_0x574d7e){try{if(_0x57f96b['TagIds']){_0x57f96b[_0xa452('0x2e')]=[];_0x57f96b[_0xa452('0x2f')][_0xa452('0x30')](',')[_0xa452('0x31')](function(_0x3e63e1){_0x57f96b['Tags'][_0xa452('0x32')](_0x1d10ce[_0x3e63e1]);});}delete _0x57f96b[_0xa452('0x2f')];}catch(_0x901b15){_0x574d7e(_0x901b15);}_0x4aa805(_0x57f96b);});}function updateOpenchannelInteraction(_0x4ac8f8,_0x4f1811,_0x31bc5c){return new BPromise(function(_0x437db5,_0x3803b7){return getInteractionUsers(_0x4ac8f8,_0x31bc5c)[_0xa452('0x28')](function(_0x586d27){return getInteractionTags(_0x586d27,_0x4f1811);})['then'](function(_0x25fdbd){_0x437db5(_0x25fdbd);})[_0xa452('0x33')](function(_0xfe6041){_0x3803b7(_0xfe6041);});});}exports[_0xa452('0x34')]=function(_0x27cacf,_0x5b7d38){var _0x1c2623={},_0x447223={},_0x3b2394={'count':0x0,'rows':[]};var _0x3820df=_['map'](db['OpenchannelInteraction'][_0xa452('0x35')],function(_0x51bc08){return{'name':_0x51bc08[_0xa452('0x36')],'type':_0x51bc08[_0xa452('0x37')][_0xa452('0x38')]};});_0x447223['model']=_[_0xa452('0x39')](_0x3820df,_0xa452('0x2c'));_0x447223[_0xa452('0x3a')]=_[_0xa452('0x3b')](_0x27cacf[_0xa452('0x3a')]);_0x447223[_0xa452('0x3c')]=_[_0xa452('0x3d')](_0x447223['model'],_0x447223[_0xa452('0x3a')]);_0x1c2623[_0xa452('0x3e')]=_[_0xa452('0x3d')](_0x447223[_0xa452('0x3f')],qs[_0xa452('0x40')](_0x27cacf[_0xa452('0x3a')][_0xa452('0x40')]));_0x1c2623[_0xa452('0x3e')]=_0x1c2623[_0xa452('0x3e')][_0xa452('0x41')]?_0x1c2623[_0xa452('0x3e')]:_0x447223[_0xa452('0x3f')];if(!_0x27cacf[_0xa452('0x3a')]['hasOwnProperty'](_0xa452('0x42'))){_0x1c2623[_0xa452('0x20')]=qs[_0xa452('0x20')](_0x27cacf[_0xa452('0x3a')][_0xa452('0x20')]);_0x1c2623[_0xa452('0x22')]=qs[_0xa452('0x22')](_0x27cacf[_0xa452('0x3a')][_0xa452('0x22')]);}_0x1c2623['order']=qs[_0xa452('0x43')](_0x27cacf[_0xa452('0x3a')][_0xa452('0x43')]);_0x1c2623[_0xa452('0x44')]=qs[_0xa452('0x3c')](_['pick'](_0x27cacf[_0xa452('0x3a')],_0x447223[_0xa452('0x3c')]),_0x3820df);var _0x4ef162=[];var _0x594d3e=squel[_0xa452('0x45')]()[_0xa452('0x46')]('id')[_0xa452('0x46')]('name')['field']('color')[_0xa452('0x47')](_0xa452('0x48'));var _0x146184=squel['select']()[_0xa452('0x46')]('u.id')[_0xa452('0x46')](_0xa452('0x49'))['field']('ui.OpenchannelInteractionId')[_0xa452('0x47')]('user_has_openchannel_interactions','ui')['left_join'](_0xa452('0x4a'),'u',_0xa452('0x4b'));var _0x5f16f4=squel['select']()[_0xa452('0x47')](_0xa452('0x4c'),'i')[_0xa452('0x4d')](_0xa452('0x4e'),'c',_0xa452('0x4f'))[_0xa452('0x4d')](_0xa452('0x4a'),'o',_0xa452('0x50'))[_0xa452('0x4d')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0xa452('0x51'),'me',_0xa452('0x52'))['left_join'](_0xa452('0x53'),'it',_0xa452('0x54'))['left_join'](_0xa452('0x48'),'t','t.id\x20=\x20it.TagId');var _0x3b2abc=squel['expr']();var _0x396d67=[];var _0x320f05=squel[_0xa452('0x55')]();var _0x2c7536;if(_0x27cacf[_0xa452('0x3a')][_0xa452('0x56')]){_0x2c7536=as[_0xa452('0x57')](_0x27cacf[_0xa452('0x3a')][_0xa452('0x56')]);var _0x194a61=_0x2c7536[_0xa452('0x58')];for(var _0x4c3687=0x0;_0x4c3687<_0x2c7536[_0xa452('0x59')]['length'];_0x4c3687++){var _0x1e110e=_0x2c7536[_0xa452('0x59')][_0x4c3687];var _0x45fb1a='i';var _0x400382=_[_0xa452('0x5a')](_0x3820df,['name',_0x1e110e[_0xa452('0x46')]]);if(!_0x400382){switch(_0x1e110e[_0xa452('0x46')]){case _0xa452('0x5b'):if(_0x1e110e[_0xa452('0x5c')]==0x1){_0x5f16f4[_0xa452('0x5d')]('`'+_0x1e110e[_0xa452('0x46')]+'`\x20=\x200');}else{_0x5f16f4[_0xa452('0x5d')]('`'+_0x1e110e['field']+'`\x20>\x200');}break;case _0xa452('0x5e'):if(_0x1e110e[_0xa452('0x5f')]===_0xa452('0x60')){if(_0x1e110e['value'][_0xa452('0x30')]('\x20')[_0xa452('0x41')]>0x1){_0x3b2abc[_0x194a61](_0xa452('0x61'),qs['getFullTextValue'](_0x1e110e[_0xa452('0x5c')]),null);}else{var _0x2f4c10='%'+_0x1e110e['value']+'%';_0x3b2abc[_0x194a61](_0xa452('0x62'),_0x2f4c10,_0x2f4c10,_0x2f4c10);}}else{_0x400382=_[_0xa452('0x5a')](_0x3820df,['name',_0xa452('0x63')]);_0x1e110e[_0xa452('0x46')]=_0xa452('0x63');_0x505e78=as[_0xa452('0x64')](_0x45fb1a,_0x400382[_0xa452('0x37')],_0x1e110e);_0x3b2abc[_0x194a61](_0x505e78['text'],_0x505e78[_0xa452('0x5c')]['start'],_0x505e78[_0xa452('0x5c')][_0xa452('0x1d')]);}break;case _0xa452('0x65'):var _0x420af0=_0x1e110e['value'][_0xa452('0x30')](',')['map'](function(_0x1a866f){return Number(_0x1a866f);});_0x420af0[_0xa452('0x31')](function(_0x49d900){_0x320f05['or'](_0xa452('0x66'),'%,'+_0x49d900+',%');});_0x396d67=_[_0xa452('0x67')](_0x396d67,_0x420af0);break;case _0xa452('0x68'):if(_0x1e110e[_0xa452('0x5f')]==='$substring'){_0x3b2abc[_0x194a61](_0xa452('0x69'),'%'+_0x1e110e[_0xa452('0x5c')]+'%',null);}else{_0x400382=_['find'](_0x3820df,['name',_0xa452('0x6a')]);_0x1e110e[_0xa452('0x46')]=_0xa452('0x6a');_0x505e78=as['buildExpression'](_0x45fb1a,_0x400382[_0xa452('0x37')],_0x1e110e);_0x3b2abc[_0x194a61](_0x505e78['text'],_0x505e78['value'][_0xa452('0x6b')],_0x505e78[_0xa452('0x5c')][_0xa452('0x1d')]);}break;case _0xa452('0x6c'):_0x505e78=as[_0xa452('0x64')]('me',null,_0x1e110e);_0x3b2abc[_0x194a61](_0x505e78[_0xa452('0x6d')],_0x505e78[_0xa452('0x5c')][_0xa452('0x6b')],_0x505e78[_0xa452('0x5c')][_0xa452('0x1d')]);break;}}else{var _0x505e78=as[_0xa452('0x64')](_0x45fb1a,_0x400382[_0xa452('0x37')],_0x1e110e);_0x3b2abc[_0x194a61](_0x505e78['text'],_0x505e78[_0xa452('0x5c')][_0xa452('0x6b')],_0x505e78[_0xa452('0x5c')][_0xa452('0x1d')]);}}}else{var _0x19b467=_(_0x27cacf[_0xa452('0x3a')])[_0xa452('0x3b')]()[_0xa452('0x39')](function(_0x5dc6a6){return _[_0xa452('0x6e')](_0x3820df,[_0xa452('0x2c'),_0x5dc6a6])?_0x5dc6a6:undefined;})['compact']()[_0xa452('0x5c')]();if(!_[_0xa452('0x6f')](_0x19b467)){_0x19b467['forEach'](function(_0x20bcf0){if(_0x20bcf0===_0xa452('0x70')){_0x5f16f4[_0xa452('0x44')](_0xa452('0x71'),[][_0xa452('0x72')](_0x27cacf['query'][_0x20bcf0]));}else if(_0x20bcf0==='createdAt'){var _0x18086d=JSON[_0xa452('0x73')](_0x27cacf[_0xa452('0x3a')][_0x20bcf0])[_0xa452('0x74')];var _0x2ec82a=JSON[_0xa452('0x73')](_0x27cacf['query'][_0x20bcf0])[_0xa452('0x75')];_0x5f16f4[_0xa452('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x18086d,_0x2ec82a);}else{if(_0x27cacf[_0xa452('0x3a')][_0x20bcf0]===_0xa452('0x76')){_0x5f16f4[_0xa452('0x44')]('i.'+_0x20bcf0+'\x20IS\x20NULL');}else{_0x5f16f4[_0xa452('0x44')]('i.'+_0x20bcf0+_0xa452('0x77'),_0x27cacf[_0xa452('0x3a')][_0x20bcf0]);}}});}if(_0x27cacf[_0xa452('0x3a')][_0xa452('0x78')]){if(_0x27cacf[_0xa452('0x3a')][_0xa452('0x78')]==0x1){_0x5f16f4[_0xa452('0x5d')](_0xa452('0x79'));}else{_0x5f16f4[_0xa452('0x5d')]('`unreadMessages`\x20>\x200');}}if(_0x27cacf['query'][_0xa452('0x7a')]){_0x396d67=_['isArray'](_0x27cacf[_0xa452('0x3a')][_0xa452('0x7a')])?_0x27cacf[_0xa452('0x3a')][_0xa452('0x7a')]:new Array(_0x27cacf['query'][_0xa452('0x7a')]);_0x396d67[_0xa452('0x31')](function(_0xf1ded7){_0x320f05['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xf1ded7+',%');});}if(_0x27cacf[_0xa452('0x3a')]['filter']){var _0x31ecbe=_0x27cacf['query']['filter'][_0xa452('0x7b')]('\x5c','\x5c\x5c')[_0xa452('0x7b')](/'/g,'\x27\x27');if(qs[_0xa452('0x7c')](_0x31ecbe)){_0x3b2abc['or']('i.id\x20LIKE\x20?',_0x31ecbe+'%');}else{_0x3b2abc['or'](_0xa452('0x7d'),qs[_0xa452('0x7e')](_0x31ecbe))['or'](_0xa452('0x7f'),_0x31ecbe+'%')['or'](_0xa452('0x80'),_0x31ecbe+'%');}}}_0x5f16f4[_0xa452('0x44')](_0x3b2abc);_0x5f16f4[_0xa452('0x81')](_0xa452('0x82'));var _0x56c07f={'type':db[_0xa452('0x83')][_0xa452('0x84')]['SELECT'],'raw':!![]};var _0x15897d=_0x5f16f4[_0xa452('0x85')]();_0x15897d[_0xa452('0x46')](_0xa452('0x82'));_0x15897d[_0xa452('0x46')](_0xa452('0x86'),_0xa452('0x5b'));if(_0x1c2623[_0xa452('0x87')]){_0x1c2623['order']['forEach'](function(_0xa77214){var _0x102514=_0xa77214[0x0]===_0xa452('0x88')?_0xa77214[0x0]:'i.'+_0xa77214[0x0];_0x5f16f4[_0xa452('0x87')](_0x102514,_0xa77214[0x1]===_0xa452('0x89')?![]:!![]);});}if(!_[_0xa452('0x6f')](_0x396d67)){_0x5f16f4[_0xa452('0x5d')](_0x320f05);_0x15897d['where'](_0xa452('0x8a'),_0x396d67);}BPromise[_0xa452('0x8b')]()[_0xa452('0x28')](function(){if(!_0x2c7536){if(_0x27cacf['query'][_0xa452('0x70')])return;_0x15897d[_0xa452('0x44')](_0xa452('0x8c'));_0x5f16f4[_0xa452('0x44')](_0xa452('0x8c'));return;}if(_0x27cacf['user'][_0xa452('0x8d')]!==_0xa452('0x8e'))return;return _0x27cacf[_0xa452('0x8f')][_0xa452('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4c4417){if(_[_0xa452('0x6f')](_0x4c4417)){_0x15897d[_0xa452('0x44')](_0xa452('0x91'));_0x5f16f4[_0xa452('0x44')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x15897d[_0xa452('0x44')](_0xa452('0x71'),_[_0xa452('0x39')](_0x4c4417,'id'));_0x5f16f4[_0xa452('0x44')](_0xa452('0x71'),_[_0xa452('0x39')](_0x4c4417,'id'));}});})[_0xa452('0x28')](function(){if(_0x27cacf['user'][_0xa452('0x8d')]===_0xa452('0x8e')&&!_0x2c7536&&!_0x27cacf[_0xa452('0x3a')][_0xa452('0x70')])return[];return db[_0xa452('0x92')][_0xa452('0x3a')](_0x15897d['toString'](),_0x56c07f);})[_0xa452('0x28')](function(_0x146565){_0x3b2394[_0xa452('0x21')]=_0x146565['length'];if(_0x3b2394['count']===0x0)return[];return db[_0xa452('0x92')]['query'](_0x594d3e['toString'](),_0x56c07f)[_0xa452('0x28')](function(_0xcc7123){_0x4ef162=_[_0xa452('0x93')](_0xcc7123,'id');_0x56c07f=_[_0xa452('0x94')](_0x56c07f,{'model':db[_0xa452('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27cacf[_0xa452('0x3a')][_0xa452('0x40')]){_0x1c2623[_0xa452('0x3e')][_0xa452('0x31')](function(_0x4a5625){_0x5f16f4[_0xa452('0x46')]('i.'+_0x4a5625);});}else{_0x5f16f4[_0xa452('0x46')](_0xa452('0x86'),_0xa452('0x5b'));_0x5f16f4[_0xa452('0x46')]('a.key',_0xa452('0x96'));_0x5f16f4['field'](_0xa452('0x97'),_0xa452('0x98'));_0x5f16f4[_0xa452('0x46')](_0xa452('0x99'),_0xa452('0x88'));_0x5f16f4[_0xa452('0x46')](_0xa452('0x9a'));_0x5f16f4[_0xa452('0x46')](_0xa452('0x9b'),_0xa452('0x9c'));_0x5f16f4[_0xa452('0x46')](_0xa452('0x9d'),_0xa452('0x9e'));_0x5f16f4['field'](_0xa452('0x9f'),'Contact.email');_0x5f16f4[_0xa452('0x46')](_0xa452('0xa0'),_0xa452('0xa1'));_0x5f16f4['field'](_0xa452('0xa2'),_0xa452('0xa3'));_0x5f16f4[_0xa452('0x46')]('c.fax','Contact.fax');_0x5f16f4[_0xa452('0x46')]('o.fullname',_0xa452('0xa4'));_0x5f16f4[_0xa452('0x46')](_0xa452('0xa5'),'Owner.internal');_0x5f16f4['field'](_0xa452('0xa6'),_0xa452('0x2f'));}if(_0x1c2623['limit'])_0x5f16f4[_0xa452('0x20')](_0x1c2623[_0xa452('0x20')]);if(_0x1c2623['offset'])_0x5f16f4[_0xa452('0x22')](_0x1c2623[_0xa452('0x22')]);return db[_0xa452('0x92')]['query'](_0x5f16f4[_0xa452('0xa7')](),_0x56c07f);})[_0xa452('0x28')](function(_0x48c4b3){if(_0x48c4b3[_0xa452('0x41')]>0x0)_0x146184[_0xa452('0x44')](_0xa452('0xa8'),_[_0xa452('0x39')](_0x48c4b3,'id'));return db['sequelize'][_0xa452('0x3a')](_0x146184['toString'](),_0x56c07f)['then'](function(_0x4de7cc){var _0x5e318b=_['groupBy'](_0x4de7cc,'OpenchannelInteractionId');var _0x3152df=[];_0x48c4b3[_0xa452('0x31')](function(_0x20e7b2){_0x3152df[_0xa452('0x32')](updateOpenchannelInteraction(_0x20e7b2,_0x4ef162,_0x5e318b));});return BPromise[_0xa452('0xa9')](_0x3152df);});});})[_0xa452('0x28')](function(_0x54ccc4){_0x3b2394['rows']=_0x54ccc4;return _0x3b2394;})[_0xa452('0x28')](respondWithFilteredResult(_0x5b7d38,_0x1c2623))[_0xa452('0x33')](handleError(_0x5b7d38,null));};exports['show']=function(_0x22cb2a,_0x52db8c){var _0x871940={};if(_0x22cb2a[_0xa452('0x3a')]['type']&&_0x22cb2a[_0xa452('0x3a')][_0xa452('0x37')]==='from'){_0x871940[_0xa452('0x47')]=_0x22cb2a[_0xa452('0xaa')]['id'];}else{_0x871940['id']=_0x22cb2a[_0xa452('0xaa')]['id'];}var _0x4e8e05={'raw':![],'where':_0x871940},_0x26d435={};_0x26d435[_0xa452('0x3f')]=_[_0xa452('0x3b')](db[_0xa452('0x95')][_0xa452('0x35')]);_0x26d435[_0xa452('0x3a')]=_[_0xa452('0x3b')](_0x22cb2a[_0xa452('0x3a')]);_0x26d435['filters']=_[_0xa452('0x3d')](_0x26d435[_0xa452('0x3f')],_0x26d435[_0xa452('0x3a')]);_0x4e8e05[_0xa452('0x3e')]=_[_0xa452('0x3d')](_0x26d435[_0xa452('0x3f')],qs[_0xa452('0x40')](_0x22cb2a[_0xa452('0x3a')][_0xa452('0x40')]));_0x4e8e05[_0xa452('0x3e')]=_0x4e8e05[_0xa452('0x3e')][_0xa452('0x41')]?_0x4e8e05[_0xa452('0x3e')]:_0x26d435[_0xa452('0x3f')];if(_0x22cb2a[_0xa452('0x3a')][_0xa452('0xab')]){_0x4e8e05['include']=[{'all':!![]}];}_0x4e8e05=_[_0xa452('0x94')]({},_0x4e8e05,_0x22cb2a['options']);return db[_0xa452('0x95')][_0xa452('0x5a')](_0x4e8e05)[_0xa452('0x28')](handleEntityNotFound(_0x52db8c,null))[_0xa452('0x28')](respondWithResult(_0x52db8c,null))[_0xa452('0x33')](handleError(_0x52db8c,null));};exports[_0xa452('0xac')]=function(_0x1cc5ae,_0x5ba8ef){return db[_0xa452('0x95')][_0xa452('0xac')](_0x1cc5ae['body'],{})[_0xa452('0x28')](respondWithResult(_0x5ba8ef,0xc9))[_0xa452('0x33')](handleError(_0x5ba8ef,null));};exports[_0xa452('0x27')]=function(_0x45eab9,_0x582e19){if(_0x45eab9[_0xa452('0x6c')]['id']){delete _0x45eab9['body']['id'];}return db[_0xa452('0x95')][_0xa452('0x5a')]({'where':{'id':_0x45eab9['params']['id']}})[_0xa452('0x28')](handleEntityNotFound(_0x582e19,null))['then'](saveUpdates(_0x45eab9[_0xa452('0x6c')],null))['then'](respondWithResult(_0x582e19,null))[_0xa452('0x33')](handleError(_0x582e19,null));};exports['destroy']=function(_0x43791e,_0x193f51){return db[_0xa452('0x95')][_0xa452('0x5a')]({'where':{'id':_0x43791e[_0xa452('0xaa')]['id']}})[_0xa452('0x28')](handleEntityNotFound(_0x193f51,null))[_0xa452('0x28')](removeEntity(_0x193f51,null))[_0xa452('0x33')](handleError(_0x193f51,null));};exports['describe']=function(_0x59b79a,_0x56ad01){return db['OpenchannelInteraction'][_0xa452('0xad')]()[_0xa452('0x28')](respondWithResult(_0x56ad01,null))['catch'](handleError(_0x56ad01,null));};exports['addMessage']=function(_0x153456,_0x3acd27,_0x3d4de3){return db['OpenchannelMessage'][_0xa452('0x5a')]({'where':{'id':_0x153456[_0xa452('0xaa')]['id']}})[_0xa452('0x28')](handleEntityNotFound(_0x3acd27,null))[_0xa452('0x28')](function(_0x3f72ba){if(_0x3f72ba){return _0x3f72ba[_0xa452('0xae')](_0x153456[_0xa452('0x6c')][_0xa452('0xaf')],_[_0xa452('0xb0')](_0x153456[_0xa452('0x6c')],[_0xa452('0xaf'),'id'])||{});}})[_0xa452('0x28')](respondWithResult(_0x3acd27,null))[_0xa452('0x33')](handleError(_0x3acd27,null));};exports[_0xa452('0xb1')]=function(_0x4fc188,_0x59b8b0,_0x3fadf5){var _0x4967d8={'raw':![],'where':{}};var _0x3abb43={};var _0x42c335={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x4fc188[_0xa452('0xaa')]['id']}})[_0xa452('0x28')](handleEntityNotFound(_0x59b8b0,null))[_0xa452('0x28')](function(_0x5c68dd){if(_0x5c68dd){_0x3abb43[_0xa452('0x3f')]=_[_0xa452('0x3b')](db[_0xa452('0xb2')][_0xa452('0x35')]);_0x3abb43[_0xa452('0x3a')]=_[_0xa452('0x3b')](_0x4fc188[_0xa452('0x3a')]);_0x3abb43[_0xa452('0x3c')]=_[_0xa452('0x3d')](_0x3abb43[_0xa452('0x3f')],_0x3abb43[_0xa452('0x3a')]);_0x4967d8[_0xa452('0x3e')]=_['intersection'](_0x3abb43[_0xa452('0x3f')],qs['fields'](_0x4fc188['query'][_0xa452('0x40')]));_0x4967d8[_0xa452('0x3e')]=_0x4967d8[_0xa452('0x3e')][_0xa452('0x41')]?_0x4967d8[_0xa452('0x3e')]:_0x3abb43[_0xa452('0x3f')];if(!_0x4fc188[_0xa452('0x3a')][_0xa452('0xb3')](_0xa452('0x42'))){_0x4967d8['limit']=qs[_0xa452('0x20')](_0x4fc188[_0xa452('0x3a')][_0xa452('0x20')]);_0x4967d8[_0xa452('0x22')]=qs['offset'](_0x4fc188['query'][_0xa452('0x22')]);}_0x4967d8['order']=qs[_0xa452('0x43')](_0x4fc188[_0xa452('0x3a')][_0xa452('0x43')]);_0x4967d8[_0xa452('0x44')]=qs['filters'](_[_0xa452('0xb4')](_0x4fc188['query'],_0x3abb43[_0xa452('0x3c')]));_0x4967d8[_0xa452('0x44')]['OpenchannelInteractionId']=_0x5c68dd['id'];if(_0x4fc188[_0xa452('0x3a')][_0xa452('0xb5')]){_0x4967d8[_0xa452('0x44')]=_[_0xa452('0x94')](_0x4967d8[_0xa452('0x44')],{'$or':_[_0xa452('0x39')](_0x4967d8[_0xa452('0x3e')],function(_0x8c913e){var _0x892fd6={};_0x892fd6[_0x8c913e]={'$like':'%'+_0x4fc188[_0xa452('0x3a')][_0xa452('0xb5')]+'%'};return _0x892fd6;})});}if(_0x4fc188[_0xa452('0x3a')][_0xa452('0x74')]){var _0x51ad91=_0x4fc188['query']['$gte'][_0xa452('0x30')](',');var _0x1e14a3={};_0x1e14a3[_0x51ad91[0x0]]={'$gte':moment(_0x51ad91[0x1])[_0xa452('0xb6')](_0xa452('0xb7'))};_0x4967d8['where']=_['merge'](_0x4967d8[_0xa452('0x44')],_0x1e14a3);}_0x4967d8=_['merge']({},_0x4967d8,_0x4fc188[_0xa452('0xb8')]);return db['OpenchannelMessage'][_0xa452('0x21')]({'where':_0x4967d8[_0xa452('0x44')]})[_0xa452('0x28')](function(_0x251291){_0x42c335[_0xa452('0x21')]=_0x251291;if(_0x4fc188[_0xa452('0x3a')][_0xa452('0xab')]){_0x4967d8[_0xa452('0xb9')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xa452('0xba')](_0x4967d8);})[_0xa452('0x28')](function(_0x4cbb2a){_0x42c335[_0xa452('0xbb')]=_0x4cbb2a;return _0x42c335;});}})[_0xa452('0x28')](respondWithFilteredResult(_0x59b8b0,_0x4967d8))[_0xa452('0x33')](handleError(_0x59b8b0,null));};exports[_0xa452('0xbc')]=function(_0x2ef60a,_0x16ae5e,_0x16e5df){return db[_0xa452('0x95')][_0xa452('0x5a')]({'where':{'id':_0x2ef60a[_0xa452('0xaa')]['id']}})[_0xa452('0x28')](handleEntityNotFound(_0x16ae5e,null))[_0xa452('0x28')](function(_0x328f76){if(_0x328f76){return _0x328f76['setTags'](_0x2ef60a[_0xa452('0x6c')]['ids'],_[_0xa452('0xb0')](_0x2ef60a[_0xa452('0x6c')],[_0xa452('0xaf'),'id'])||{})[_0xa452('0xbd')](function(){return db['Tag'][_0xa452('0xba')]({'attributes':['id',_0xa452('0x2c'),_0xa452('0xbe')],'where':{'id':_0x2ef60a[_0xa452('0x6c')][_0xa452('0xaf')]}});})[_0xa452('0x28')](function(_0x15039c){socket[_0xa452('0xbf')](_0xa452('0xc0'),{'id':Number(_0x2ef60a[_0xa452('0xaa')]['id']),'tags':_0x15039c||[]});return{'id':Number(_0x2ef60a[_0xa452('0xaa')]['id']),'tags':_0x15039c||[]};});}})['then'](respondWithResult(_0x16ae5e,null))[_0xa452('0x33')](handleError(_0x16ae5e,null));};exports[_0xa452('0xc1')]=function(_0x28bf61,_0x56f983,_0x1fbed5){return db[_0xa452('0x95')][_0xa452('0x5a')]({'where':{'id':_0x28bf61[_0xa452('0xaa')]['id']}})[_0xa452('0x28')](handleEntityNotFound(_0x56f983,null))[_0xa452('0x28')](function(_0x23c317){if(_0x23c317){return _0x23c317[_0xa452('0xc1')](_0x28bf61[_0xa452('0x3a')][_0xa452('0xaf')]);}})['then'](respondWithStatusCode(_0x56f983,null))[_0xa452('0x33')](handleError(_0x56f983,null));};exports[_0xa452('0xc2')]=function(_0x498049,_0x574e37){var _0x3e9ba3=moment()['unix']()['toString']();var _0x7e5ced=path[_0xa452('0xc3')](config['root'],'server',_0xa452('0xc4'),_0xa452('0xc5'));var _0x365481=path[_0xa452('0xc3')](config[_0xa452('0xc6')],_0xa452('0xc7'),'files','attachments');var _0x3ff4ea=path['join'](_0x7e5ced,_0x3e9ba3);var _0x2c3142=util['format'](_0xa452('0xc8'),_0x498049['params']['id'],_0x3e9ba3);var _0x507be0=path[_0xa452('0xc3')](_0x7e5ced,_0x2c3142);var _0x5278c2=[];_0x5278c2[_0xa452('0x32')]({'model':db[_0xa452('0x68')],'as':'User','attributes':['id',_0xa452('0xc9')],'raw':!![]});_0x5278c2[_0xa452('0x32')]({'model':db[_0xa452('0xca')],'as':_0xa452('0x5e'),'attributes':['id','firstName',_0xa452('0xcb')],'raw':!![]});if(_0x498049[_0xa452('0x3a')]['attachments']){_0x5278c2['push']({'model':db[_0xa452('0xcc')],'as':_0xa452('0xcc'),'raw':!![]});}var _0x55a4d6=[{'model':db['OpenchannelMessage'],'as':_0xa452('0xcd'),'attributes':['id',_0xa452('0x6c'),'createdAt',_0xa452('0xce'),'secret',_0xa452('0x78')],'include':_0x5278c2}];_0x55a4d6[_0xa452('0x32')]({'model':db[_0xa452('0xcf')],'as':_0xa452('0xd0'),'attributes':['id',_0xa452('0x2c')]});_0x55a4d6[_0xa452('0x32')]({'model':db[_0xa452('0x68')],'as':'Owner','attributes':['id',_0xa452('0xc9')]});return db[_0xa452('0x95')][_0xa452('0x5a')]({'where':{'id':_0x498049[_0xa452('0xaa')]['id']},'include':_0x55a4d6})['then'](handleEntityNotFound(_0x574e37,null))[_0xa452('0x28')](function(_0x169b50){if(_0x169b50){var _0x5b2bc5=_0x169b50[_0xa452('0xd1')]({'plain':!![]});fs[_0xa452('0xd2')](_0x3ff4ea);var _0x2b274c={'channel':_0xa452('0xd3'),'account':_0x5b2bc5[_0xa452('0xd0')][_0xa452('0x2c')],'agent':_0x5b2bc5[_0xa452('0xd4')]?_0x5b2bc5[_0xa452('0xd4')][_0xa452('0xc9')]:_0xa452('0xd5'),'createdAt':moment(_0x5b2bc5['createdAt'])[_0xa452('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa452('0xa7')](),'closedAt':_0x5b2bc5[_0xa452('0xd6')]?moment(_0x5b2bc5[_0xa452('0xd7')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa452('0xa7')]():'','disposition':_0x5b2bc5['disposition'],'visibility':_0x5b2bc5[_0xa452('0xd8')]?_0xa452('0xd9'):'Private','messages':_(_0x5b2bc5['Messages'])[_0xa452('0xb5')]({'secret':![]})[_0xa452('0x39')](function(_0x234706){if(_0x234706[_0xa452('0xcc')]){var _0x516751=path[_0xa452('0xc3')](_0x365481,_0x234706[_0xa452('0xcc')][_0xa452('0xda')]);if(fs['existsSync'](_0x516751)){fs[_0xa452('0xdb')](_0x516751)[_0xa452('0xdc')](fs[_0xa452('0xdd')](path[_0xa452('0xc3')](_0x3ff4ea,_0x234706['Attachment']['basename'])));}}return{'date':moment(_0x234706[_0xa452('0xde')])[_0xa452('0xb6')](_0xa452('0xb7'))['toString'](),'sender':_0x234706[_0xa452('0xce')]===_0xa452('0xdf')?_0x234706['User']?_0x234706[_0xa452('0x68')][_0xa452('0xc9')]:_0xa452('0xe0'):_0x234706[_0xa452('0x5e')][_0xa452('0xe1')]+(_0x234706[_0xa452('0x5e')]['lastName']?'\x20'+_0x234706[_0xa452('0x5e')][_0xa452('0xcb')]:''),'body':_0x234706['Attachment']?_0x234706[_0xa452('0xcc')][_0xa452('0xda')]:_0x234706[_0xa452('0x6c')],'direction':_0x234706[_0xa452('0xce')]===_0xa452('0xdf')?'A':'C','secret':_0x234706[_0xa452('0xe2')],'read':_0x234706[_0xa452('0x78')],'attachment':_0x234706['Attachment']};})[_0xa452('0x5c')]()};return ejs['renderFile'](path[_0xa452('0xc3')](config['root'],_0xa452('0xc7'),'views',_0xa452('0xe3')),{'interaction':_0x2b274c})[_0xa452('0x28')](function(_0x316e82){var _0x1654c6=path['join'](_0x3ff4ea,_0xa452('0xe4')+_0x5b2bc5['id']+'-'+_0x3e9ba3+_0xa452('0xe5'));var _0x477dcc={'path':_0x1654c6,'channel':'Openchannel','interactionId':_0x5b2bc5['id']};return pdf['createPdfFromHTML'](_0x316e82,_0x477dcc);})[_0xa452('0x28')](function(){return new BPromise(function(_0x537daa,_0xc5494e){zipdir(_0x3ff4ea,{'saveTo':_0x507be0},function(_0x4b59db,_0x1bf2d6){if(_0x4b59db)return _0xc5494e(_0x4b59db);return _0x537daa(_0x1bf2d6);});})[_0xa452('0x28')](function(){return new BPromise(function(_0xdfdd4d,_0x233ac9){rimraf(_0x3ff4ea,function(_0x3fedeb){if(_0x3fedeb)_0x233ac9(_0x3fedeb);return _0xdfdd4d();});});})['then'](function(){return _0x574e37[_0xa452('0xc2')](_0x507be0,_0x2c3142,function(_0x1e02f0){if(_0x1e02f0){console[_0xa452('0xe6')](_0xa452('0xe7'),_0x1e02f0);}else{fs[_0xa452('0xe8')](_0x507be0);}});});});}else{return _0x574e37[_0xa452('0x1b')](0xc8);}})[_0xa452('0x33')](handleError(_0x574e37,null));}; \ No newline at end of file +var _0xc551=['pipe','createWriteStream','System','firstName','out','views','downloadInteraction.ejs','.pdf','Openchannel','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','index','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','select','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','u.id\x20=\x20ui.UserId','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','value','`\x20=\x200','having','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','forEach','OpenchannelAccountId','where','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','isEmpty','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IN\x20?','role','agent','sequelize','toString','OpenchannelInteraction','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','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','catch','show','params','includeAll','include','options','create','update','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','merge','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','removeTags','root','server','join','files','attachments','transcript-%d-%s.zip','CmContact','Contact','lastName','Attachment','Messages','direction','secret','Account','Owner','mkdirSync','closedAt','disposition','threadId','basename','createReadStream'];(function(_0x320ea7,_0x4313af){var _0xc3d97d=function(_0x236cc2){while(--_0x236cc2){_0x320ea7['push'](_0x320ea7['shift']());}};_0xc3d97d(++_0x4313af);}(_0xc551,0xf6));var _0x1c55=function(_0x494965,_0x31a20a){_0x494965=_0x494965-0x0;var _0x55e7ff=_0xc551[_0x494965];return _0x55e7ff;};'use strict';var emlformat=require(_0x1c55('0x0'));var rimraf=require(_0x1c55('0x1'));var zipdir=require(_0x1c55('0x2'));var jsonpatch=require(_0x1c55('0x3'));var rp=require(_0x1c55('0x4'));var moment=require(_0x1c55('0x5'));var BPromise=require(_0x1c55('0x6'));var Mustache=require(_0x1c55('0x7'));var util=require(_0x1c55('0x8'));var path=require(_0x1c55('0x9'));var sox=require(_0x1c55('0xa'));var csv=require(_0x1c55('0xb'));var ejs=require(_0x1c55('0xc'));var fs=require('fs');var fs_extra=require(_0x1c55('0xd'));var _=require(_0x1c55('0xe'));var squel=require(_0x1c55('0xf'));var crypto=require('crypto');var jsforce=require(_0x1c55('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1c55('0xb'));var querystring=require('querystring');var Papa=require(_0x1c55('0x11'));var Redis=require('ioredis');var authService=require(_0x1c55('0x12'));var qs=require(_0x1c55('0x13'));var as=require(_0x1c55('0x14'));var pdf=require(_0x1c55('0x15'));var hardwareService=require(_0x1c55('0x16'));var logger=require(_0x1c55('0x17'))(_0x1c55('0x18'));var utils=require(_0x1c55('0x19'));var config=require(_0x1c55('0x1a'));var licenseUtil=require(_0x1c55('0x1b'));var db=require(_0x1c55('0x1c'))['db'];config[_0x1c55('0x1d')]=_[_0x1c55('0x1e')](config[_0x1c55('0x1d')],{'host':_0x1c55('0x1f'),'port':0x18eb});var socket=require(_0x1c55('0x20'))(new Redis(config[_0x1c55('0x1d')]));require(_0x1c55('0x21'))['register'](socket);function respondWithStatusCode(_0x220b95,_0x20da6b){_0x20da6b=_0x20da6b||0xcc;return function(_0x4eb81d){if(_0x4eb81d){return _0x220b95[_0x1c55('0x22')](_0x20da6b);}return _0x220b95[_0x1c55('0x23')](_0x20da6b)[_0x1c55('0x24')]();};}function respondWithResult(_0x5b0a8b,_0x1623d7){_0x1623d7=_0x1623d7||0xc8;return function(_0x2ff562){if(_0x2ff562){return _0x5b0a8b[_0x1c55('0x23')](_0x1623d7)[_0x1c55('0x25')](_0x2ff562);}};}function respondWithFilteredResult(_0x3dfa39,_0x28b439){return function(_0x475e1e){if(_0x475e1e){var _0x283934=typeof _0x28b439[_0x1c55('0x26')]==='undefined'&&typeof _0x28b439[_0x1c55('0x27')]===_0x1c55('0x28');var _0x2ef47b=_0x475e1e[_0x1c55('0x29')];var _0x27ad06=_0x283934?0x0:_0x28b439['offset'];var _0x8483d5=_0x283934?_0x475e1e[_0x1c55('0x29')]:_0x28b439['offset']+_0x28b439[_0x1c55('0x27')];var _0x1c63a7;if(_0x8483d5>=_0x2ef47b){_0x8483d5=_0x2ef47b;_0x1c63a7=0xc8;}else{_0x1c63a7=0xce;}_0x3dfa39[_0x1c55('0x23')](_0x1c63a7);return _0x3dfa39[_0x1c55('0x2a')](_0x1c55('0x2b'),_0x27ad06+'-'+_0x8483d5+'/'+_0x2ef47b)[_0x1c55('0x25')](_0x475e1e);}return null;};}function patchUpdates(_0x55c09e){return function(_0x26d07c){try{jsonpatch[_0x1c55('0x2c')](_0x26d07c,_0x55c09e,!![]);}catch(_0x2679c0){return BPromise[_0x1c55('0x2d')](_0x2679c0);}return _0x26d07c[_0x1c55('0x2e')]();};}function saveUpdates(_0x2784aa,_0x4d625f){return function(_0x4f7d70){if(_0x4f7d70){return _0x4f7d70['update'](_0x2784aa)[_0x1c55('0x2f')](function(_0x30b397){return _0x30b397;});}return null;};}function removeEntity(_0x1398d5,_0x49ccb5){return function(_0x469c91){if(_0x469c91){return _0x469c91['destroy']()['then'](function(){_0x1398d5[_0x1c55('0x23')](0xcc)[_0x1c55('0x24')]();});}};}function handleEntityNotFound(_0x1a577c,_0x370c64){return function(_0x531ca9){if(!_0x531ca9){_0x1a577c['sendStatus'](0x194);}return _0x531ca9;};}function handleError(_0x34ba24,_0x31d5a5){_0x31d5a5=_0x31d5a5||0x1f4;return function(_0x3791c1){logger[_0x1c55('0x30')](_0x3791c1[_0x1c55('0x31')]);if(_0x3791c1[_0x1c55('0x32')]){delete _0x3791c1[_0x1c55('0x32')];}_0x34ba24[_0x1c55('0x23')](_0x31d5a5)[_0x1c55('0x33')](_0x3791c1);};}function getInteractionUsers(_0x39008f,_0x7759d2){return new BPromise(function(_0x4e8368,_0x3623f7){try{if(_0x7759d2[_0x39008f['id']]){_0x39008f[_0x1c55('0x34')]=_[_0x1c55('0x35')](_0x7759d2[_0x39008f['id']],function(_0x124530){return{'id':_0x124530['id'],'fullname':_0x124530[_0x1c55('0x36')]};});}}catch(_0x4a039d){_0x3623f7(_0x4a039d);}_0x4e8368(_0x39008f);});}function getInteractionTags(_0xf34592,_0x50a16f){return new BPromise(function(_0x255cc7,_0x1c7c1d){try{if(_0xf34592[_0x1c55('0x37')]){_0xf34592[_0x1c55('0x38')]=[];_0xf34592[_0x1c55('0x37')][_0x1c55('0x39')](',')['forEach'](function(_0x16ff45){_0xf34592[_0x1c55('0x38')][_0x1c55('0x3a')](_0x50a16f[_0x16ff45]);});}delete _0xf34592[_0x1c55('0x37')];}catch(_0x53a0ad){_0x1c7c1d(_0x53a0ad);}_0x255cc7(_0xf34592);});}function updateOpenchannelInteraction(_0x38317e,_0x23dd45,_0x4d5571){return new BPromise(function(_0x281071,_0xb4bcc9){return getInteractionUsers(_0x38317e,_0x4d5571)[_0x1c55('0x2f')](function(_0x2277b0){return getInteractionTags(_0x2277b0,_0x23dd45);})[_0x1c55('0x2f')](function(_0x5dc518){_0x281071(_0x5dc518);})['catch'](function(_0x2e405a){_0xb4bcc9(_0x2e405a);});});}exports[_0x1c55('0x3b')]=function(_0xe31e67,_0x3fe34c){var _0x21cb12={},_0x2618e0={},_0x53caa4={'count':0x0,'rows':[]};var _0x587613=_['map'](db['OpenchannelInteraction'][_0x1c55('0x3c')],function(_0x36c24a){return{'name':_0x36c24a['fieldName'],'type':_0x36c24a[_0x1c55('0x3d')][_0x1c55('0x3e')]};});_0x2618e0[_0x1c55('0x3f')]=_[_0x1c55('0x35')](_0x587613,_0x1c55('0x32'));_0x2618e0[_0x1c55('0x40')]=_['keys'](_0xe31e67['query']);_0x2618e0['filters']=_[_0x1c55('0x41')](_0x2618e0[_0x1c55('0x3f')],_0x2618e0[_0x1c55('0x40')]);_0x21cb12[_0x1c55('0x42')]=_['intersection'](_0x2618e0['model'],qs[_0x1c55('0x43')](_0xe31e67[_0x1c55('0x40')][_0x1c55('0x43')]));_0x21cb12[_0x1c55('0x42')]=_0x21cb12[_0x1c55('0x42')][_0x1c55('0x44')]?_0x21cb12['attributes']:_0x2618e0['model'];if(!_0xe31e67[_0x1c55('0x40')][_0x1c55('0x45')]('nolimit')){_0x21cb12[_0x1c55('0x27')]=qs[_0x1c55('0x27')](_0xe31e67['query'][_0x1c55('0x27')]);_0x21cb12['offset']=qs[_0x1c55('0x26')](_0xe31e67['query'][_0x1c55('0x26')]);}_0x21cb12[_0x1c55('0x46')]=qs[_0x1c55('0x47')](_0xe31e67['query']['sort']);_0x21cb12['where']=qs['filters'](_[_0x1c55('0x48')](_0xe31e67[_0x1c55('0x40')],_0x2618e0[_0x1c55('0x49')]),_0x587613);var _0x1fb905=[];var _0x1283bb=squel[_0x1c55('0x4a')]()[_0x1c55('0x4b')]('id')['field'](_0x1c55('0x32'))[_0x1c55('0x4b')](_0x1c55('0x4c'))['from'](_0x1c55('0x4d'));var _0x93bf44=squel[_0x1c55('0x4a')]()['field'](_0x1c55('0x4e'))['field'](_0x1c55('0x4f'))[_0x1c55('0x4b')](_0x1c55('0x50'))['from']('user_has_openchannel_interactions','ui')[_0x1c55('0x51')]('users','u',_0x1c55('0x52'));var _0x3e96ea=squel['select']()[_0x1c55('0x53')]('openchannel_interactions','i')[_0x1c55('0x51')](_0x1c55('0x54'),'c',_0x1c55('0x55'))[_0x1c55('0x51')](_0x1c55('0x56'),'o',_0x1c55('0x57'))['left_join'](_0x1c55('0x58'),'a',_0x1c55('0x59'))[_0x1c55('0x51')](_0x1c55('0x5a'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x1c55('0x51')](_0x1c55('0x5b'),'it',_0x1c55('0x5c'))[_0x1c55('0x51')](_0x1c55('0x4d'),'t',_0x1c55('0x5d'));var _0x104ff0=squel[_0x1c55('0x5e')]();var _0x93b16=[];var _0x54523c=squel[_0x1c55('0x5e')]();var _0x211ca2;if(_0xe31e67['query'][_0x1c55('0x5f')]){_0x211ca2=as[_0x1c55('0x60')](_0xe31e67[_0x1c55('0x40')][_0x1c55('0x5f')]);var _0x4167e1=_0x211ca2[_0x1c55('0x61')];for(var _0x3fa4ea=0x0;_0x3fa4ea<_0x211ca2['conditions'][_0x1c55('0x44')];_0x3fa4ea++){var _0x40db2a=_0x211ca2['conditions'][_0x3fa4ea];var _0x15bb6b='i';var _0x1770a3=_['find'](_0x587613,[_0x1c55('0x32'),_0x40db2a[_0x1c55('0x4b')]]);if(!_0x1770a3){switch(_0x40db2a[_0x1c55('0x4b')]){case'unreadMessages':if(_0x40db2a[_0x1c55('0x62')]==0x1){_0x3e96ea['having']('`'+_0x40db2a['field']+_0x1c55('0x63'));}else{_0x3e96ea[_0x1c55('0x64')]('`'+_0x40db2a[_0x1c55('0x4b')]+'`\x20>\x200');}break;case'Contact':if(_0x40db2a[_0x1c55('0x65')]===_0x1c55('0x66')){if(_0x40db2a[_0x1c55('0x62')][_0x1c55('0x39')]('\x20')[_0x1c55('0x44')]>0x1){_0x104ff0[_0x4167e1](_0x1c55('0x67'),qs[_0x1c55('0x68')](_0x40db2a[_0x1c55('0x62')]),null);}else{var _0x6f4597='%'+_0x40db2a[_0x1c55('0x62')]+'%';_0x104ff0[_0x4167e1](_0x1c55('0x69'),_0x6f4597,_0x6f4597,_0x6f4597);}}else{_0x1770a3=_[_0x1c55('0x6a')](_0x587613,[_0x1c55('0x32'),_0x1c55('0x6b')]);_0x40db2a['field']=_0x1c55('0x6b');_0xdf53c1=as[_0x1c55('0x6c')](_0x15bb6b,_0x1770a3['type'],_0x40db2a);_0x104ff0[_0x4167e1](_0xdf53c1[_0x1c55('0x6d')],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x6e')],_0xdf53c1['value'][_0x1c55('0x24')]);}break;case _0x1c55('0x6f'):var _0x5acb2d=_0x40db2a[_0x1c55('0x62')][_0x1c55('0x39')](',')[_0x1c55('0x35')](function(_0xf5d6){return Number(_0xf5d6);});_0x5acb2d['forEach'](function(_0x5b05bf){_0x54523c['or'](_0x1c55('0x70'),'%,'+_0x5b05bf+',%');});_0x93b16=_[_0x1c55('0x71')](_0x93b16,_0x5acb2d);break;case _0x1c55('0x72'):if(_0x40db2a['operator']==='$substring'){_0x104ff0[_0x4167e1](_0x1c55('0x73'),'%'+_0x40db2a['value']+'%',null);}else{_0x1770a3=_['find'](_0x587613,['name','UserId']);_0x40db2a['field']='UserId';_0xdf53c1=as['buildExpression'](_0x15bb6b,_0x1770a3['type'],_0x40db2a);_0x104ff0[_0x4167e1](_0xdf53c1['text'],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x6e')],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x24')]);}break;case _0x1c55('0x74'):_0xdf53c1=as['buildExpression']('me',null,_0x40db2a);_0x104ff0[_0x4167e1](_0xdf53c1[_0x1c55('0x6d')],_0xdf53c1['value']['start'],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x24')]);break;}}else{var _0xdf53c1=as[_0x1c55('0x6c')](_0x15bb6b,_0x1770a3[_0x1c55('0x3d')],_0x40db2a);_0x104ff0[_0x4167e1](_0xdf53c1[_0x1c55('0x6d')],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x6e')],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x24')]);}}}else{var _0x455a95=_(_0xe31e67[_0x1c55('0x40')])[_0x1c55('0x75')]()[_0x1c55('0x35')](function(_0x1898f3){return _[_0x1c55('0x76')](_0x587613,[_0x1c55('0x32'),_0x1898f3])?_0x1898f3:undefined;})[_0x1c55('0x77')]()[_0x1c55('0x62')]();if(!_['isEmpty'](_0x455a95)){_0x455a95[_0x1c55('0x78')](function(_0x16b1ed){if(_0x16b1ed===_0x1c55('0x79')){_0x3e96ea[_0x1c55('0x7a')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x1c55('0x7b')](_0xe31e67[_0x1c55('0x40')][_0x16b1ed]));}else if(_0x16b1ed===_0x1c55('0x7c')){var _0x2c8907=JSON[_0x1c55('0x7d')](_0xe31e67[_0x1c55('0x40')][_0x16b1ed])[_0x1c55('0x7e')];var _0x1f8d17=JSON['parse'](_0xe31e67[_0x1c55('0x40')][_0x16b1ed])[_0x1c55('0x7f')];_0x3e96ea[_0x1c55('0x7a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2c8907,_0x1f8d17);}else{if(_0xe31e67[_0x1c55('0x40')][_0x16b1ed]===_0x1c55('0x80')){_0x3e96ea['where']('i.'+_0x16b1ed+_0x1c55('0x81'));}else{_0x3e96ea[_0x1c55('0x7a')]('i.'+_0x16b1ed+_0x1c55('0x82'),_0xe31e67['query'][_0x16b1ed]);}}});}if(_0xe31e67[_0x1c55('0x40')]['read']){if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x83')]==0x1){_0x3e96ea['having']('`unreadMessages`\x20=\x200');}else{_0x3e96ea[_0x1c55('0x64')]('`unreadMessages`\x20>\x200');}}if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x84')]){_0x93b16=_['isArray'](_0xe31e67['query'][_0x1c55('0x84')])?_0xe31e67['query'][_0x1c55('0x84')]:new Array(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x84')]);_0x93b16[_0x1c55('0x78')](function(_0x57a992){_0x54523c['or'](_0x1c55('0x70'),'%,'+_0x57a992+',%');});}if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x85')]){var _0x217ed3=_0xe31e67['query'][_0x1c55('0x85')]['replace']('\x5c','\x5c\x5c')[_0x1c55('0x86')](/'/g,'\x27\x27');if(qs[_0x1c55('0x87')](_0x217ed3)){_0x104ff0['or']('i.id\x20LIKE\x20?',_0x217ed3+'%');}else{_0x104ff0['or'](_0x1c55('0x88'),qs[_0x1c55('0x68')](_0x217ed3))['or']('i.from\x20LIKE\x20?',_0x217ed3+'%')['or'](_0x1c55('0x89'),_0x217ed3+'%');}}}_0x3e96ea[_0x1c55('0x7a')](_0x104ff0);_0x3e96ea[_0x1c55('0x8a')](_0x1c55('0x8b'));var _0x498922={'type':db['Sequelize'][_0x1c55('0x8c')][_0x1c55('0x8d')],'raw':!![]};var _0x5f24b8=_0x3e96ea['clone']();_0x5f24b8[_0x1c55('0x4b')](_0x1c55('0x8b'));_0x5f24b8['field'](_0x1c55('0x8e'),_0x1c55('0x8f'));if(_0x21cb12['order']){_0x21cb12[_0x1c55('0x46')][_0x1c55('0x78')](function(_0x4c35fd){var _0x5791c8=_0x4c35fd[0x0]===_0x1c55('0x90')?_0x4c35fd[0x0]:'i.'+_0x4c35fd[0x0];_0x3e96ea[_0x1c55('0x46')](_0x5791c8,_0x4c35fd[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1c55('0x91')](_0x93b16)){_0x3e96ea[_0x1c55('0x64')](_0x54523c);_0x5f24b8[_0x1c55('0x7a')]('t.id\x20IN\x20?',_0x93b16);}BPromise[_0x1c55('0x92')]()['then'](function(){if(!_0x211ca2){if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x79')])return;_0x5f24b8[_0x1c55('0x7a')](_0x1c55('0x93'));_0x3e96ea[_0x1c55('0x7a')](_0x1c55('0x93'));return;}if(_0xe31e67['user']['role']!=='agent')return;return _0xe31e67[_0x1c55('0x94')][_0x1c55('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x16efde){if(_[_0x1c55('0x91')](_0x16efde)){_0x5f24b8[_0x1c55('0x7a')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x3e96ea[_0x1c55('0x7a')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x5f24b8['where'](_0x1c55('0x96'),_[_0x1c55('0x35')](_0x16efde,'id'));_0x3e96ea[_0x1c55('0x7a')](_0x1c55('0x96'),_[_0x1c55('0x35')](_0x16efde,'id'));}});})[_0x1c55('0x2f')](function(){if(_0xe31e67[_0x1c55('0x94')][_0x1c55('0x97')]===_0x1c55('0x98')&&!_0x211ca2&&!_0xe31e67[_0x1c55('0x40')][_0x1c55('0x79')])return[];return db[_0x1c55('0x99')][_0x1c55('0x40')](_0x5f24b8[_0x1c55('0x9a')](),_0x498922);})[_0x1c55('0x2f')](function(_0x4d7701){_0x53caa4['count']=_0x4d7701[_0x1c55('0x44')];if(_0x53caa4[_0x1c55('0x29')]===0x0)return[];return db['sequelize'][_0x1c55('0x40')](_0x1283bb['toString'](),_0x498922)[_0x1c55('0x2f')](function(_0x1cfbb9){_0x1fb905=_['keyBy'](_0x1cfbb9,'id');_0x498922=_['merge'](_0x498922,{'model':db[_0x1c55('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x43')]){_0x21cb12[_0x1c55('0x42')]['forEach'](function(_0x31d1ac){_0x3e96ea[_0x1c55('0x4b')]('i.'+_0x31d1ac);});}else{_0x3e96ea[_0x1c55('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3e96ea[_0x1c55('0x4b')]('a.key',_0x1c55('0x9c'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0x9d'),_0x1c55('0x9e'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0x9f'),_0x1c55('0x90'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa0'));_0x3e96ea[_0x1c55('0x4b')]('c.firstName',_0x1c55('0xa1'));_0x3e96ea['field'](_0x1c55('0xa2'),_0x1c55('0xa3'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa4'),'Contact.email');_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa5'),_0x1c55('0xa6'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa7'),'Contact.mobile');_0x3e96ea[_0x1c55('0x4b')]('c.fax',_0x1c55('0xa8'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa9'),_0x1c55('0xaa'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xab'),_0x1c55('0xac'));_0x3e96ea['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x21cb12[_0x1c55('0x27')])_0x3e96ea[_0x1c55('0x27')](_0x21cb12[_0x1c55('0x27')]);if(_0x21cb12[_0x1c55('0x26')])_0x3e96ea[_0x1c55('0x26')](_0x21cb12['offset']);return db[_0x1c55('0x99')]['query'](_0x3e96ea[_0x1c55('0x9a')](),_0x498922);})[_0x1c55('0x2f')](function(_0x10004e){if(_0x10004e[_0x1c55('0x44')]>0x0)_0x93bf44[_0x1c55('0x7a')](_0x1c55('0xad'),_[_0x1c55('0x35')](_0x10004e,'id'));return db[_0x1c55('0x99')][_0x1c55('0x40')](_0x93bf44[_0x1c55('0x9a')](),_0x498922)[_0x1c55('0x2f')](function(_0x24d4be){var _0x1dfa3f=_['groupBy'](_0x24d4be,_0x1c55('0xae'));var _0x4a35a4=[];_0x10004e[_0x1c55('0x78')](function(_0x2af199){_0x4a35a4[_0x1c55('0x3a')](updateOpenchannelInteraction(_0x2af199,_0x1fb905,_0x1dfa3f));});return BPromise[_0x1c55('0xaf')](_0x4a35a4);});});})[_0x1c55('0x2f')](function(_0x208ab4){_0x53caa4[_0x1c55('0xb0')]=_0x208ab4;return _0x53caa4;})['then'](respondWithFilteredResult(_0x3fe34c,_0x21cb12))[_0x1c55('0xb1')](handleError(_0x3fe34c,null));};exports[_0x1c55('0xb2')]=function(_0x113ccb,_0x5f448f){var _0x21709e={};if(_0x113ccb[_0x1c55('0x40')][_0x1c55('0x3d')]&&_0x113ccb[_0x1c55('0x40')][_0x1c55('0x3d')]===_0x1c55('0x53')){_0x21709e['from']=_0x113ccb[_0x1c55('0xb3')]['id'];}else{_0x21709e['id']=_0x113ccb['params']['id'];}var _0x57f172={'raw':![],'where':_0x21709e},_0x5a8930={};_0x5a8930[_0x1c55('0x3f')]=_[_0x1c55('0x75')](db[_0x1c55('0x9b')]['rawAttributes']);_0x5a8930[_0x1c55('0x40')]=_[_0x1c55('0x75')](_0x113ccb['query']);_0x5a8930['filters']=_[_0x1c55('0x41')](_0x5a8930[_0x1c55('0x3f')],_0x5a8930[_0x1c55('0x40')]);_0x57f172[_0x1c55('0x42')]=_['intersection'](_0x5a8930['model'],qs[_0x1c55('0x43')](_0x113ccb[_0x1c55('0x40')][_0x1c55('0x43')]));_0x57f172[_0x1c55('0x42')]=_0x57f172[_0x1c55('0x42')][_0x1c55('0x44')]?_0x57f172[_0x1c55('0x42')]:_0x5a8930[_0x1c55('0x3f')];if(_0x113ccb['query'][_0x1c55('0xb4')]){_0x57f172[_0x1c55('0xb5')]=[{'all':!![]}];}_0x57f172=_['merge']({},_0x57f172,_0x113ccb[_0x1c55('0xb6')]);return db[_0x1c55('0x9b')]['find'](_0x57f172)[_0x1c55('0x2f')](handleEntityNotFound(_0x5f448f,null))[_0x1c55('0x2f')](respondWithResult(_0x5f448f,null))[_0x1c55('0xb1')](handleError(_0x5f448f,null));};exports[_0x1c55('0xb7')]=function(_0x268cc4,_0xc179be){return db[_0x1c55('0x9b')][_0x1c55('0xb7')](_0x268cc4['body'],{})[_0x1c55('0x2f')](respondWithResult(_0xc179be,0xc9))['catch'](handleError(_0xc179be,null));};exports[_0x1c55('0xb8')]=function(_0x4d8efc,_0x1bb487){if(_0x4d8efc[_0x1c55('0x74')]['id']){delete _0x4d8efc[_0x1c55('0x74')]['id'];}return db[_0x1c55('0x9b')]['find']({'where':{'id':_0x4d8efc['params']['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x1bb487,null))[_0x1c55('0x2f')](saveUpdates(_0x4d8efc[_0x1c55('0x74')],null))[_0x1c55('0x2f')](respondWithResult(_0x1bb487,null))[_0x1c55('0xb1')](handleError(_0x1bb487,null));};exports[_0x1c55('0xb9')]=function(_0x167943,_0x2593b3){return db[_0x1c55('0x9b')][_0x1c55('0x6a')]({'where':{'id':_0x167943['params']['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x2593b3,null))[_0x1c55('0x2f')](removeEntity(_0x2593b3,null))[_0x1c55('0xb1')](handleError(_0x2593b3,null));};exports[_0x1c55('0xba')]=function(_0x5324e7,_0x4bdb83){return db[_0x1c55('0x9b')][_0x1c55('0xba')]()[_0x1c55('0x2f')](respondWithResult(_0x4bdb83,null))[_0x1c55('0xb1')](handleError(_0x4bdb83,null));};exports[_0x1c55('0xbb')]=function(_0x5ef0bd,_0x44bec4,_0x147816){return db[_0x1c55('0xbc')][_0x1c55('0x6a')]({'where':{'id':_0x5ef0bd[_0x1c55('0xb3')]['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x44bec4,null))[_0x1c55('0x2f')](function(_0x554210){if(_0x554210){return _0x554210[_0x1c55('0xbb')](_0x5ef0bd['body'][_0x1c55('0xbd')],_[_0x1c55('0xbe')](_0x5ef0bd['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x44bec4,null))[_0x1c55('0xb1')](handleError(_0x44bec4,null));};exports[_0x1c55('0xbf')]=function(_0x4db896,_0x1965b1,_0x49d55c){var _0x572e46={'raw':![],'where':{}};var _0x328970={};var _0x5e9134={'count':0x0,'rows':[]};return db[_0x1c55('0x9b')][_0x1c55('0xc0')]({'where':{'id':_0x4db896[_0x1c55('0xb3')]['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x1965b1,null))[_0x1c55('0x2f')](function(_0x1a06da){if(_0x1a06da){_0x328970['model']=_['keys'](db[_0x1c55('0xbc')][_0x1c55('0x3c')]);_0x328970[_0x1c55('0x40')]=_['keys'](_0x4db896[_0x1c55('0x40')]);_0x328970[_0x1c55('0x49')]=_[_0x1c55('0x41')](_0x328970[_0x1c55('0x3f')],_0x328970[_0x1c55('0x40')]);_0x572e46['attributes']=_[_0x1c55('0x41')](_0x328970['model'],qs['fields'](_0x4db896['query'][_0x1c55('0x43')]));_0x572e46[_0x1c55('0x42')]=_0x572e46['attributes'][_0x1c55('0x44')]?_0x572e46[_0x1c55('0x42')]:_0x328970[_0x1c55('0x3f')];if(!_0x4db896[_0x1c55('0x40')]['hasOwnProperty']('nolimit')){_0x572e46[_0x1c55('0x27')]=qs[_0x1c55('0x27')](_0x4db896[_0x1c55('0x40')][_0x1c55('0x27')]);_0x572e46['offset']=qs[_0x1c55('0x26')](_0x4db896[_0x1c55('0x40')]['offset']);}_0x572e46[_0x1c55('0x46')]=qs['sort'](_0x4db896[_0x1c55('0x40')][_0x1c55('0x47')]);_0x572e46[_0x1c55('0x7a')]=qs[_0x1c55('0x49')](_[_0x1c55('0x48')](_0x4db896[_0x1c55('0x40')],_0x328970[_0x1c55('0x49')]));_0x572e46[_0x1c55('0x7a')][_0x1c55('0xae')]=_0x1a06da['id'];if(_0x4db896['query'][_0x1c55('0x85')]){_0x572e46[_0x1c55('0x7a')]=_[_0x1c55('0xc1')](_0x572e46[_0x1c55('0x7a')],{'$or':_[_0x1c55('0x35')](_0x572e46[_0x1c55('0x42')],function(_0x5c70a1){var _0x1082e4={};_0x1082e4[_0x5c70a1]={'$like':'%'+_0x4db896[_0x1c55('0x40')][_0x1c55('0x85')]+'%'};return _0x1082e4;})});}if(_0x4db896['query'][_0x1c55('0x7e')]){var _0xb30278=_0x4db896[_0x1c55('0x40')][_0x1c55('0x7e')][_0x1c55('0x39')](',');var _0x33341e={};_0x33341e[_0xb30278[0x0]]={'$gte':moment(_0xb30278[0x1])[_0x1c55('0xc2')](_0x1c55('0xc3'))};_0x572e46[_0x1c55('0x7a')]=_[_0x1c55('0xc1')](_0x572e46['where'],_0x33341e);}_0x572e46=_[_0x1c55('0xc1')]({},_0x572e46,_0x4db896['options']);return db[_0x1c55('0xbc')][_0x1c55('0x29')]({'where':_0x572e46[_0x1c55('0x7a')]})[_0x1c55('0x2f')](function(_0x1940f7){_0x5e9134[_0x1c55('0x29')]=_0x1940f7;if(_0x4db896[_0x1c55('0x40')][_0x1c55('0xb4')]){_0x572e46['include']=[{'all':!![]}];}return db[_0x1c55('0xbc')][_0x1c55('0xc4')](_0x572e46);})[_0x1c55('0x2f')](function(_0x5c9d5c){_0x5e9134[_0x1c55('0xb0')]=_0x5c9d5c;return _0x5e9134;});}})[_0x1c55('0x2f')](respondWithFilteredResult(_0x1965b1,_0x572e46))['catch'](handleError(_0x1965b1,null));};exports[_0x1c55('0xc5')]=function(_0x2f76e9,_0x48690c,_0x5301bc){return db['OpenchannelInteraction'][_0x1c55('0x6a')]({'where':{'id':_0x2f76e9['params']['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x48690c,null))[_0x1c55('0x2f')](function(_0x1524cb){if(_0x1524cb){return _0x1524cb['setTags'](_0x2f76e9['body'][_0x1c55('0xbd')],_[_0x1c55('0xbe')](_0x2f76e9[_0x1c55('0x74')],[_0x1c55('0xbd'),'id'])||{})[_0x1c55('0xc6')](function(){return db[_0x1c55('0x6f')][_0x1c55('0xc4')]({'attributes':['id',_0x1c55('0x32'),'color'],'where':{'id':_0x2f76e9[_0x1c55('0x74')][_0x1c55('0xbd')]}});})[_0x1c55('0x2f')](function(_0x11693f){socket[_0x1c55('0xc7')]('openchannelInteractionTags:save',{'id':Number(_0x2f76e9[_0x1c55('0xb3')]['id']),'tags':_0x11693f||[]});return{'id':Number(_0x2f76e9[_0x1c55('0xb3')]['id']),'tags':_0x11693f||[]};});}})[_0x1c55('0x2f')](respondWithResult(_0x48690c,null))[_0x1c55('0xb1')](handleError(_0x48690c,null));};exports[_0x1c55('0xc8')]=function(_0x14c758,_0x222ac3,_0x5d9f12){return db[_0x1c55('0x9b')][_0x1c55('0x6a')]({'where':{'id':_0x14c758[_0x1c55('0xb3')]['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x222ac3,null))[_0x1c55('0x2f')](function(_0x4e35fa){if(_0x4e35fa){return _0x4e35fa[_0x1c55('0xc8')](_0x14c758[_0x1c55('0x40')][_0x1c55('0xbd')]);}})[_0x1c55('0x2f')](respondWithStatusCode(_0x222ac3,null))['catch'](handleError(_0x222ac3,null));};exports['download']=function(_0x82c3f5,_0x4f7428){var _0x2b3911=moment()['unix']()[_0x1c55('0x9a')]();var _0x3f02c9=path['join'](config[_0x1c55('0xc9')],_0x1c55('0xca'),'files','tmp');var _0xb1976b=path[_0x1c55('0xcb')](config[_0x1c55('0xc9')],_0x1c55('0xca'),_0x1c55('0xcc'),_0x1c55('0xcd'));var _0x192045=path['join'](_0x3f02c9,_0x2b3911);var _0x59fdbb=util[_0x1c55('0xc2')](_0x1c55('0xce'),_0x82c3f5['params']['id'],_0x2b3911);var _0x49edf9=path['join'](_0x3f02c9,_0x59fdbb);var _0x33b523=[];_0x33b523[_0x1c55('0x3a')]({'model':db[_0x1c55('0x72')],'as':_0x1c55('0x72'),'attributes':['id',_0x1c55('0x36')],'raw':!![]});_0x33b523[_0x1c55('0x3a')]({'model':db[_0x1c55('0xcf')],'as':_0x1c55('0xd0'),'attributes':['id','firstName',_0x1c55('0xd1')],'raw':!![]});if(_0x82c3f5[_0x1c55('0x40')][_0x1c55('0xcd')]){_0x33b523[_0x1c55('0x3a')]({'model':db[_0x1c55('0xd2')],'as':_0x1c55('0xd2'),'raw':!![]});}var _0x5f169e=[{'model':db[_0x1c55('0xbc')],'as':_0x1c55('0xd3'),'attributes':['id',_0x1c55('0x74'),'createdAt',_0x1c55('0xd4'),_0x1c55('0xd5'),'read'],'include':_0x33b523}];_0x5f169e[_0x1c55('0x3a')]({'model':db['OpenchannelAccount'],'as':_0x1c55('0xd6'),'attributes':['id',_0x1c55('0x32')]});_0x5f169e[_0x1c55('0x3a')]({'model':db[_0x1c55('0x72')],'as':_0x1c55('0xd7'),'attributes':['id',_0x1c55('0x36')]});return db[_0x1c55('0x9b')][_0x1c55('0x6a')]({'where':{'id':_0x82c3f5[_0x1c55('0xb3')]['id']},'include':_0x5f169e})[_0x1c55('0x2f')](handleEntityNotFound(_0x4f7428,null))[_0x1c55('0x2f')](function(_0x4607d4){if(_0x4607d4){var _0x56a5f7=_0x4607d4['get']({'plain':!![]});fs[_0x1c55('0xd8')](_0x192045);var _0x5e7509={'channel':'Openchannel','account':_0x56a5f7[_0x1c55('0xd6')][_0x1c55('0x32')],'agent':_0x56a5f7[_0x1c55('0xd7')]?_0x56a5f7[_0x1c55('0xd7')][_0x1c55('0x36')]:'N.A.','createdAt':moment(_0x56a5f7[_0x1c55('0x7c')])[_0x1c55('0xc2')](_0x1c55('0xc3'))[_0x1c55('0x9a')](),'closedAt':_0x56a5f7['closed']?moment(_0x56a5f7[_0x1c55('0xd9')])[_0x1c55('0xc2')](_0x1c55('0xc3'))['toString']():'','disposition':_0x56a5f7[_0x1c55('0xda')],'visibility':_0x56a5f7[_0x1c55('0xdb')]?'Public':'Private','messages':_(_0x56a5f7[_0x1c55('0xd3')])[_0x1c55('0x85')]({'secret':![]})[_0x1c55('0x35')](function(_0x1122a6){if(_0x1122a6['Attachment']){var _0x28b615=path['join'](_0xb1976b,_0x1122a6[_0x1c55('0xd2')][_0x1c55('0xdc')]);if(fs['existsSync'](_0x28b615)){fs[_0x1c55('0xdd')](_0x28b615)[_0x1c55('0xde')](fs[_0x1c55('0xdf')](path[_0x1c55('0xcb')](_0x192045,_0x1122a6['Attachment']['basename'])));}}return{'date':moment(_0x1122a6['createdAt'])[_0x1c55('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1c55('0x9a')](),'sender':_0x1122a6[_0x1c55('0xd4')]==='out'?_0x1122a6[_0x1c55('0x72')]?_0x1122a6[_0x1c55('0x72')][_0x1c55('0x36')]:_0x1c55('0xe0'):_0x1122a6[_0x1c55('0xd0')][_0x1c55('0xe1')]+(_0x1122a6[_0x1c55('0xd0')]['lastName']?'\x20'+_0x1122a6[_0x1c55('0xd0')][_0x1c55('0xd1')]:''),'body':_0x1122a6[_0x1c55('0xd2')]?_0x1122a6['Attachment'][_0x1c55('0xdc')]:_0x1122a6[_0x1c55('0x74')],'direction':_0x1122a6[_0x1c55('0xd4')]===_0x1c55('0xe2')?'A':'C','secret':_0x1122a6[_0x1c55('0xd5')],'read':_0x1122a6[_0x1c55('0x83')],'attachment':_0x1122a6[_0x1c55('0xd2')]};})['value']()};return ejs['renderFile'](path[_0x1c55('0xcb')](config[_0x1c55('0xc9')],'server',_0x1c55('0xe3'),_0x1c55('0xe4')),{'interaction':_0x5e7509})[_0x1c55('0x2f')](function(_0x426b59){var _0x5875a1=path[_0x1c55('0xcb')](_0x192045,'transcript-'+_0x56a5f7['id']+'-'+_0x2b3911+_0x1c55('0xe5'));var _0x4aade2={'path':_0x5875a1,'channel':_0x1c55('0xe6'),'interactionId':_0x56a5f7['id']};return pdf['createPdfFromHTML'](_0x426b59,_0x4aade2);})[_0x1c55('0x2f')](function(){return new BPromise(function(_0x5164eb,_0x49af32){zipdir(_0x192045,{'saveTo':_0x49edf9},function(_0x2c16bd,_0x125e42){if(_0x2c16bd)return _0x49af32(_0x2c16bd);return _0x5164eb(_0x125e42);});})[_0x1c55('0x2f')](function(){return new BPromise(function(_0x4cb817,_0x50b36a){rimraf(_0x192045,function(_0x259cc8){if(_0x259cc8)_0x50b36a(_0x259cc8);return _0x4cb817();});});})[_0x1c55('0x2f')](function(){return _0x4f7428[_0x1c55('0xe7')](_0x49edf9,_0x59fdbb,function(_0x9121a7){if(_0x9121a7){console[_0x1c55('0xe8')](_0x1c55('0xe9'),_0x9121a7);}else{fs['unlinkSync'](_0x49edf9);}});});});}else{return _0x4f7428[_0x1c55('0x22')](0xc8);}})['catch'](handleError(_0x4f7428,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 13045ca..f34087d 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 _0xd353=['OpenchannelMessage','update','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xe35b46,_0x2a2cf1){var _0x40c8c4=function(_0x2a9b36){while(--_0x2a9b36){_0xe35b46['push'](_0xe35b46['shift']());}};_0x40c8c4(++_0x2a2cf1);}(_0xd353,0xde));var _0x3d35=function(_0x160c4c,_0x242b2b){_0x160c4c=_0x160c4c-0x0;var _0xd82e0c=_0xd353[_0x160c4c];return _0xd82e0c;};'use strict';var EventEmitter=require(_0x3d35('0x0'));var OpenchannelInteraction=require(_0x3d35('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x3d35('0x1'))['db'][_0x3d35('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d35('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1a3b97){return function(_0x7d73f0,_0x2252d3,_0x4fcde9){_0x7d73f0[_0x3d35('0x4')]({'attributes':['id'],'raw':!![]})[_0x3d35('0x5')](function(_0xbcb6ef){_0x7d73f0[_0x3d35('0x6')](_0x3d35('0x7'),_0xbcb6ef[_0x3d35('0x8')](function(_0x376537){return{'id':_0x376537['id']};}));return OpenchannelMessage[_0x3d35('0x9')]({'where':{'OpenchannelInteractionId':_0x7d73f0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d35('0x5')](function(_0x42f5af){_0x7d73f0['setDataValue']('unreadMessages',_0x42f5af[_0x3d35('0xa')]);OpenchannelInteractionEvents[_0x3d35('0xb')](_0x1a3b97+':'+_0x7d73f0['id'],_0x7d73f0);OpenchannelInteractionEvents['emit'](_0x1a3b97,_0x7d73f0);_0x4fcde9(null);})[_0x3d35('0xc')](_0x4fcde9(null));};}for(var e in events){if(events[_0x3d35('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x3d35('0xe')](e,emitEvent(event));}}module[_0x3d35('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x4ca1=['unreadMessages','length','emit','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','remove','getUsers','then','setDataValue','findAll'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x4ca1,0x14f));var _0x14ca=function(_0x5ba513,_0x459c3b){_0x5ba513=_0x5ba513-0x0;var _0x1132a0=_0x4ca1[_0x5ba513];return _0x1132a0;};'use strict';var EventEmitter=require(_0x14ca('0x0'));var OpenchannelInteraction=require(_0x14ca('0x1'))['db'][_0x14ca('0x2')];var OpenchannelMessage=require(_0x14ca('0x1'))['db'][_0x14ca('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x14ca('0x4'),'afterUpdate':'update','afterDestroy':_0x14ca('0x5')};function emitEvent(_0x54c8a6){return function(_0x1fa5a2,_0x283118,_0xa9ea14){_0x1fa5a2[_0x14ca('0x6')]({'attributes':['id'],'raw':!![]})[_0x14ca('0x7')](function(_0x40d1fa){_0x1fa5a2[_0x14ca('0x8')]('Users',_0x40d1fa['map'](function(_0x37762b){return{'id':_0x37762b['id']};}));return OpenchannelMessage[_0x14ca('0x9')]({'where':{'OpenchannelInteractionId':_0x1fa5a2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x14ca('0x7')](function(_0x545b72){_0x1fa5a2[_0x14ca('0x8')](_0x14ca('0xa'),_0x545b72[_0x14ca('0xb')]);OpenchannelInteractionEvents[_0x14ca('0xc')](_0x54c8a6+':'+_0x1fa5a2['id'],_0x1fa5a2);OpenchannelInteractionEvents[_0x14ca('0xc')](_0x54c8a6,_0x1fa5a2);_0xa9ea14(null);})['catch'](_0xa9ea14(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x14ca('0xd')](e,emitEvent(event));}}module[_0x14ca('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 1f6519e..9669b21 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 _0xb557=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb557,0x12e));var _0x7b55=function(_0x571ff3,_0x47edb1){_0x571ff3=_0x571ff3-0x0;var _0x349964=_0xb557[_0x571ff3];return _0x349964;};'use strict';var _=require(_0x7b55('0x0'));var util=require(_0x7b55('0x1'));var logger=require(_0x7b55('0x2'))(_0x7b55('0x3'));var moment=require(_0x7b55('0x4'));var BPromise=require(_0x7b55('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b55('0x6'));var rimraf=require(_0x7b55('0x7'));var config=require(_0x7b55('0x8'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x9a35ec,_0x506e2c){return _0x9a35ec[_0x7b55('0x9')](_0x7b55('0xa'),attributes,{'tableName':_0x7b55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b55('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x2d2eea,_0x5cdb32,_0x96a416){if(_0x2d2eea['changed']('closed')){_0x2d2eea[_0x7b55('0xd')]=moment()[_0x7b55('0xe')](_0x7b55('0xf'));}_0x96a416(null,_0x2d2eea);}}});}; \ No newline at end of file +var _0xcff7=['openchannel_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2a534f,_0x23705b){var _0x23d365=function(_0x2f5849){while(--_0x2f5849){_0x2a534f['push'](_0x2a534f['shift']());}};_0x23d365(++_0x23705b);}(_0xcff7,0xc8));var _0x7cff=function(_0x1b3fe4,_0x342870){_0x1b3fe4=_0x1b3fe4-0x0;var _0x379ad5=_0xcff7[_0x1b3fe4];return _0x379ad5;};'use strict';var _=require(_0x7cff('0x0'));var util=require(_0x7cff('0x1'));var logger=require(_0x7cff('0x2'))(_0x7cff('0x3'));var moment=require('moment');var BPromise=require(_0x7cff('0x4'));var rp=require(_0x7cff('0x5'));var fs=require('fs');var path=require(_0x7cff('0x6'));var rimraf=require(_0x7cff('0x7'));var config=require(_0x7cff('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x7cff('0x9')]=function(_0x1f4f8b,_0x3549ee){return _0x1f4f8b['define']('OpenchannelInteraction',attributes,{'tableName':_0x7cff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x32a6e1,_0x50ad4f,_0x5234f5){if(_0x32a6e1[_0x7cff('0xb')](_0x7cff('0xc'))){_0x32a6e1['closedAt']=moment()['format'](_0x7cff('0xd'));}_0x5234f5(null,_0x32a6e1);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index ef99f5c..25048c6 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 _0x10d9=['rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./openchannelInteraction.socket','register','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','OpenchannelInteraction,\x20%s,\x20%s','UpdateOpenchannelInteraction','update','raw','options','attributes','limit','AddTagsToOpenchannelInteraction','find','where','body','ids','omit','spread','AddTags','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x4304fd,_0x52a766){var _0x284ba7=function(_0x156ca6){while(--_0x156ca6){_0x4304fd['push'](_0x4304fd['shift']());}};_0x284ba7(++_0x52a766);}(_0x10d9,0x1a8));var _0x910d=function(_0x2723ec,_0x1f4427){_0x2723ec=_0x2723ec-0x0;var _0x22c550=_0x10d9[_0x2723ec];return _0x22c550;};'use strict';var _=require('lodash');var util=require(_0x910d('0x0'));var moment=require(_0x910d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x910d('0x2'));var db=require(_0x910d('0x3'))['db'];var utils=require(_0x910d('0x4'));var logger=require('../../config/logger')(_0x910d('0x5'));var config=require(_0x910d('0x6'));var jayson=require(_0x910d('0x7'));var client=jayson[_0x910d('0x8')]['http']({'port':0x232a});config['redis']=_[_0x910d('0x9')](config[_0x910d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x910d('0xb'))(new Redis(config[_0x910d('0xa')]));require(_0x910d('0xc'))[_0x910d('0xd')](socket);function respondWithRpcPromise(_0x36db83,_0x461744,_0x207b23){return new BPromise(function(_0x223622,_0x381fb0){return client['request'](_0x36db83,_0x207b23)[_0x910d('0xe')](function(_0x195610){logger[_0x910d('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x461744,_0x910d('0x10'));logger[_0x910d('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x461744,_0x910d('0x10'),JSON[_0x910d('0x12')](_0x195610));if(_0x195610['error']){if(_0x195610[_0x910d('0x13')][_0x910d('0x14')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x461744,_0x195610['error']['message']);return _0x381fb0(_0x195610['error']['message']);}logger[_0x910d('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x461744,_0x195610[_0x910d('0x13')][_0x910d('0x15')]);return _0x223622(_0x195610[_0x910d('0x13')][_0x910d('0x15')]);}else{logger[_0x910d('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x461744,_0x910d('0x10'));_0x223622(_0x195610[_0x910d('0x16')][_0x910d('0x15')]);}})[_0x910d('0x17')](function(_0x513be5){logger[_0x910d('0x13')](_0x910d('0x18'),_0x461744,_0x513be5);_0x381fb0(_0x513be5);});});}exports[_0x910d('0x19')]=function(_0x12c227){var _0x45075d=this;return new Promise(function(_0x5c53e6,_0xf550c0){return db['OpenchannelInteraction'][_0x910d('0x1a')](_0x12c227['body'],{'raw':_0x12c227['options']?_0x12c227['options'][_0x910d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c227['options']?_0x12c227[_0x910d('0x1c')]['where']||null:null,'attributes':_0x12c227[_0x910d('0x1c')]?_0x12c227[_0x910d('0x1c')][_0x910d('0x1d')]||null:null,'limit':_0x12c227[_0x910d('0x1c')]?_0x12c227['options'][_0x910d('0x1e')]||null:null})[_0x910d('0xe')](function(_0x2bf210){logger[_0x910d('0xf')](_0x910d('0x19'),_0x12c227);logger['debug'](_0x910d('0x19'),_0x12c227,JSON[_0x910d('0x12')](_0x2bf210));_0x5c53e6(_0x2bf210);})[_0x910d('0x17')](function(_0x136b0f){logger['error'](_0x910d('0x19'),_0x136b0f[_0x910d('0x15')],_0x12c227);_0xf550c0(_0x45075d[_0x910d('0x13')](0x1f4,_0x136b0f[_0x910d('0x15')]));});});};exports[_0x910d('0x1f')]=function(_0x3f4bb2){return new Promise(function(_0xf76f83,_0x511565){return db['OpenchannelInteraction'][_0x910d('0x20')]({'where':_0x3f4bb2[_0x910d('0x1c')]?_0x3f4bb2[_0x910d('0x1c')][_0x910d('0x21')]||null:null})['then'](function(_0x3a3ca1){if(_0x3a3ca1){return _0x3a3ca1['addTags'](_0x3f4bb2[_0x910d('0x22')][_0x910d('0x23')],_[_0x910d('0x24')](_0x3f4bb2[_0x910d('0x22')],['ids','id'])||{});}})[_0x910d('0x25')](function(_0x29f7fe){logger[_0x910d('0xf')](_0x910d('0x26'),_0x3f4bb2);logger[_0x910d('0x11')](_0x910d('0x26'),_0x3f4bb2,JSON['stringify'](_0x29f7fe));_0xf76f83(_0x29f7fe);})[_0x910d('0x17')](function(_0x9c8ca3){logger[_0x910d('0x13')](_0x910d('0x26'),_0x9c8ca3['message'],_0x3f4bb2);_0x511565(_this[_0x910d('0x13')](0x1f4,_0x9c8ca3[_0x910d('0x15')]));});});}; \ No newline at end of file +var _0x38fe=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','OpenchannelInteraction','update','body','options','raw','where','limit','UpdateOpenchannelInteraction','debug','find','omit','ids','spread','AddTags','stringify','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x38fe,0xe9));var _0xe38f=function(_0x283613,_0x1dbd06){_0x283613=_0x283613-0x0;var _0x4a5abf=_0x38fe[_0x283613];return _0x4a5abf;};'use strict';var _=require(_0xe38f('0x0'));var util=require(_0xe38f('0x1'));var moment=require('moment');var BPromise=require(_0xe38f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe38f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe38f('0x4'));var logger=require(_0xe38f('0x5'))(_0xe38f('0x6'));var config=require('../../config/environment');var jayson=require(_0xe38f('0x7'));var client=jayson['client'][_0xe38f('0x8')]({'port':0x232a});config[_0xe38f('0x9')]=_[_0xe38f('0xa')](config[_0xe38f('0x9')],{'host':_0xe38f('0xb'),'port':0x18eb});var socket=require(_0xe38f('0xc'))(new Redis(config['redis']));require(_0xe38f('0xd'))[_0xe38f('0xe')](socket);function respondWithRpcPromise(_0x2bf594,_0x23bc51,_0x4d919b){return new BPromise(function(_0x51ef78,_0x5a6278){return client[_0xe38f('0xf')](_0x2bf594,_0x4d919b)['then'](function(_0x4200d9){logger['info'](_0xe38f('0x10'),_0x23bc51,_0xe38f('0x11'));logger['debug'](_0xe38f('0x12'),_0x23bc51,_0xe38f('0x11'),JSON['stringify'](_0x4200d9));if(_0x4200d9['error']){if(_0x4200d9['error'][_0xe38f('0x13')]===0x1f4){logger[_0xe38f('0x14')](_0xe38f('0x10'),_0x23bc51,_0x4200d9[_0xe38f('0x14')][_0xe38f('0x15')]);return _0x5a6278(_0x4200d9['error']['message']);}logger[_0xe38f('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x23bc51,_0x4200d9[_0xe38f('0x14')][_0xe38f('0x15')]);return _0x51ef78(_0x4200d9[_0xe38f('0x14')]['message']);}else{logger[_0xe38f('0x16')](_0xe38f('0x10'),_0x23bc51,_0xe38f('0x11'));_0x51ef78(_0x4200d9[_0xe38f('0x17')]['message']);}})[_0xe38f('0x18')](function(_0xa4d103){logger[_0xe38f('0x14')](_0xe38f('0x10'),_0x23bc51,_0xa4d103);_0x5a6278(_0xa4d103);});});}exports['UpdateOpenchannelInteraction']=function(_0x5f2a95){var _0x4e9e5a=this;return new Promise(function(_0x1ca972,_0x4381e5){return db[_0xe38f('0x19')][_0xe38f('0x1a')](_0x5f2a95[_0xe38f('0x1b')],{'raw':_0x5f2a95[_0xe38f('0x1c')]?_0x5f2a95['options'][_0xe38f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f2a95[_0xe38f('0x1c')]?_0x5f2a95[_0xe38f('0x1c')][_0xe38f('0x1e')]||null:null,'attributes':_0x5f2a95['options']?_0x5f2a95[_0xe38f('0x1c')]['attributes']||null:null,'limit':_0x5f2a95[_0xe38f('0x1c')]?_0x5f2a95[_0xe38f('0x1c')][_0xe38f('0x1f')]||null:null})['then'](function(_0x5e11f6){logger[_0xe38f('0x16')](_0xe38f('0x20'),_0x5f2a95);logger[_0xe38f('0x21')](_0xe38f('0x20'),_0x5f2a95,JSON['stringify'](_0x5e11f6));_0x1ca972(_0x5e11f6);})['catch'](function(_0x127818){logger[_0xe38f('0x14')]('UpdateOpenchannelInteraction',_0x127818[_0xe38f('0x15')],_0x5f2a95);_0x4381e5(_0x4e9e5a[_0xe38f('0x14')](0x1f4,_0x127818[_0xe38f('0x15')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x362a74){return new Promise(function(_0x2ef970,_0x5908f3){return db[_0xe38f('0x19')][_0xe38f('0x22')]({'where':_0x362a74['options']?_0x362a74['options'][_0xe38f('0x1e')]||null:null})['then'](function(_0xeea6f6){if(_0xeea6f6){return _0xeea6f6['addTags'](_0x362a74[_0xe38f('0x1b')]['ids'],_[_0xe38f('0x23')](_0x362a74[_0xe38f('0x1b')],[_0xe38f('0x24'),'id'])||{});}})[_0xe38f('0x25')](function(_0x5d27c0){logger[_0xe38f('0x16')]('AddTags',_0x362a74);logger['debug'](_0xe38f('0x26'),_0x362a74,JSON[_0xe38f('0x27')](_0x5d27c0));_0x2ef970(_0x5d27c0);})[_0xe38f('0x18')](function(_0x509e3e){logger['error']('AddTags',_0x509e3e[_0xe38f('0x15')],_0x362a74);_0x5908f3(_this['error'](0x1f4,_0x509e3e[_0xe38f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 336a2a5..4e541a7 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 _0x103e=['./openchannelInteraction.events','remove','emit','register','length'];(function(_0x19fec1,_0x1cc62f){var _0x29cd35=function(_0x712a4f){while(--_0x712a4f){_0x19fec1['push'](_0x19fec1['shift']());}};_0x29cd35(++_0x1cc62f);}(_0x103e,0xf0));var _0xe103=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x103e[_0xa464c9];return _0x3d73c4;};'use strict';var OpenchannelInteractionEvents=require(_0xe103('0x0'));var events=['save',_0xe103('0x1'),'update'];function createListener(_0x4814c3,_0x1a3a5e){return function(_0x5532b6){_0x1a3a5e[_0xe103('0x2')](_0x4814c3,_0x5532b6);};}function removeListener(_0x54c584,_0x141932){return function(){OpenchannelInteractionEvents['removeListener'](_0x54c584,_0x141932);};}exports[_0xe103('0x3')]=function(_0x176777){for(var _0x3fd882=0x0,_0x5945d8=events[_0xe103('0x4')];_0x3fd882<_0x5945d8;_0x3fd882++){var _0x553165=events[_0x3fd882];var _0x4403b5=createListener('openchannelInteraction:'+_0x553165,_0x176777);OpenchannelInteractionEvents['on'](_0x553165,_0x4403b5);}}; \ No newline at end of file +var _0x0550=['./openchannelInteraction.events','save','remove','emit','register','length','openchannelInteraction:'];(function(_0x2a4148,_0x72b950){var _0x36c495=function(_0x20854a){while(--_0x20854a){_0x2a4148['push'](_0x2a4148['shift']());}};_0x36c495(++_0x72b950);}(_0x0550,0xd2));var _0x0055=function(_0x552252,_0xdb0d75){_0x552252=_0x552252-0x0;var _0x16ae8d=_0x0550[_0x552252];return _0x16ae8d;};'use strict';var OpenchannelInteractionEvents=require(_0x0055('0x0'));var events=[_0x0055('0x1'),_0x0055('0x2'),'update'];function createListener(_0x41f5db,_0x14dc19){return function(_0x3e9a82){_0x14dc19[_0x0055('0x3')](_0x41f5db,_0x3e9a82);};}function removeListener(_0x59a90d,_0x4314c3){return function(){OpenchannelInteractionEvents['removeListener'](_0x59a90d,_0x4314c3);};}exports[_0x0055('0x4')]=function(_0x16423e){for(var _0x351554=0x0,_0x5cb169=events[_0x0055('0x5')];_0x351554<_0x5cb169;_0x351554++){var _0x4c3a47=events[_0x351554];var _0x470eca=createListener(_0x0055('0x6')+_0x4c3a47,_0x16423e);OpenchannelInteractionEvents['on'](_0x4c3a47,_0x470eca);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 4f9edd7..7638523 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(_0xfc3efb,_0x58aa14){var _0xfcd987=function(_0x4b80ce){while(--_0x4b80ce){_0xfc3efb['push'](_0xfc3efb['shift']());}};_0xfcd987(++_0x58aa14);}(_0xe706,0xa3));var _0x6e70=function(_0x19fa95,_0x1cca0a){_0x19fa95=_0x19fa95-0x0;var _0x58a835=_0xe706[_0x19fa95];return _0x58a835;};'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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x50efe2,_0x1a8c58){_0x50efe2=_0x50efe2-0x0;var _0xc9b57a=_0x70e0[_0x50efe2];return _0xc9b57a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 2ba3f2f..ab27c15 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 _0x4e5c=['TEXT','BOOLEAN','ENUM','STRING','sequelize'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x4e5c,0x149));var _0xc4e5=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x4e5c[_0x44bcb0];return _0xfaf881;};'use strict';var Sequelize=require(_0xc4e5('0x0'));module['exports']={'body':{'type':Sequelize[_0xc4e5('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc4e5('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc4e5('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc4e5('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc4e5('0x4')]},'providerResponse':{'type':Sequelize[_0xc4e5('0x1')]}}; \ No newline at end of file +var _0x173d=['exports','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x44bfef,_0x399046){var _0x38a406=function(_0x5e7995){while(--_0x5e7995){_0x44bfef['push'](_0x44bfef['shift']());}};_0x38a406(++_0x399046);}(_0x173d,0x108));var _0xd173=function(_0x52c5ef,_0x5ba79c){_0x52c5ef=_0x52c5ef-0x0;var _0x538fbf=_0x173d[_0x52c5ef];return _0x538fbf;};'use strict';var Sequelize=require('sequelize');module[_0xd173('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd173('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd173('0x2')]('in',_0xd173('0x3')),'defaultValue':_0xd173('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd173('0x4')]},'providerName':{'type':Sequelize[_0xd173('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 1af9b9a..b1598bb 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 _0x869e=['OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelMessage','includeAll','include','findAll','params','create','body','find','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','openchannel','RejectMessage','rejectMessage','SELECT','contact','User','fullname','event','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','then','info'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x869e,0x15c));var _0xe869=function(_0x51a1ec,_0x19f6f6){_0x51a1ec=_0x51a1ec-0x0;var _0x3b7db0=_0x869e[_0x51a1ec];return _0x3b7db0;};'use strict';var emlformat=require(_0xe869('0x0'));var rimraf=require(_0xe869('0x1'));var zipdir=require(_0xe869('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe869('0x3'));var moment=require(_0xe869('0x4'));var BPromise=require(_0xe869('0x5'));var Mustache=require(_0xe869('0x6'));var util=require(_0xe869('0x7'));var path=require('path');var sox=require(_0xe869('0x8'));var csv=require(_0xe869('0x9'));var ejs=require(_0xe869('0xa'));var fs=require('fs');var fs_extra=require(_0xe869('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe869('0xc'));var jsforce=require(_0xe869('0xd'));var deskjs=require(_0xe869('0xe'));var toCsv=require(_0xe869('0x9'));var querystring=require(_0xe869('0xf'));var Papa=require(_0xe869('0x10'));var Redis=require(_0xe869('0x11'));var authService=require(_0xe869('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe869('0x13'));var logger=require(_0xe869('0x14'))(_0xe869('0x15'));var utils=require(_0xe869('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe869('0x17'))['db'];config['redis']=_[_0xe869('0x18')](config[_0xe869('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe869('0x1a'))(new Redis(config[_0xe869('0x19')]));require(_0xe869('0x1b'))[_0xe869('0x1c')](socket);var jayson=require(_0xe869('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xe869('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4ed173,_0x201091,_0x2a7b44,_0x3d5d31){return new BPromise(function(_0x51c4c1,_0x1770db){var _0x10f5e1=_0x3d5d31||client;return _0x10f5e1['request'](_0x4ed173,_0x2a7b44)[_0xe869('0x1f')](function(_0x4fa1f2){logger[_0xe869('0x20')](_0xe869('0x21'),_0x201091,'request\x20sent');logger['debug'](_0xe869('0x22'),_0x201091,'request\x20sent',JSON[_0xe869('0x23')](_0x4fa1f2));if(_0x4fa1f2[_0xe869('0x24')]){if(_0x4fa1f2[_0xe869('0x24')][_0xe869('0x25')]===0x1f4){logger[_0xe869('0x24')](_0xe869('0x21'),_0x201091,_0x4fa1f2[_0xe869('0x24')][_0xe869('0x26')]);return _0x1770db(_0x4fa1f2[_0xe869('0x24')][_0xe869('0x26')]);}logger['error'](_0xe869('0x21'),_0x201091,_0x4fa1f2[_0xe869('0x24')][_0xe869('0x26')]);return _0x51c4c1(_0x4fa1f2[_0xe869('0x24')][_0xe869('0x26')]);}else{logger['info'](_0xe869('0x21'),_0x201091,_0xe869('0x27'));_0x51c4c1(_0x4fa1f2[_0xe869('0x28')][_0xe869('0x26')]);}})[_0xe869('0x29')](function(_0x42320b){logger[_0xe869('0x24')](_0xe869('0x21'),_0x201091,_0x42320b);_0x1770db(_0x42320b);});});}function respondWithStatusCode(_0x11c408,_0x30df68){_0x30df68=_0x30df68||0xcc;return function(_0x2775bc){if(_0x2775bc){return _0x11c408[_0xe869('0x2a')](_0x30df68);}return _0x11c408[_0xe869('0x2b')](_0x30df68)['end']();};}function respondWithResult(_0x2d0913,_0x2be430){_0x2be430=_0x2be430||0xc8;return function(_0x12da29){if(_0x12da29){return _0x2d0913[_0xe869('0x2b')](_0x2be430)[_0xe869('0x2c')](_0x12da29);}};}function respondWithFilteredResult(_0x22a823,_0x4f0e7f){return function(_0x367969){if(_0x367969){var _0x3f3574=typeof _0x4f0e7f['offset']==='undefined'&&typeof _0x4f0e7f[_0xe869('0x2d')]==='undefined';var _0x32a874=_0x367969['count'];var _0x538717=_0x3f3574?0x0:_0x4f0e7f[_0xe869('0x2e')];var _0x42df51=_0x3f3574?_0x367969[_0xe869('0x2f')]:_0x4f0e7f['offset']+_0x4f0e7f[_0xe869('0x2d')];var _0x541ff2;if(_0x42df51>=_0x32a874){_0x42df51=_0x32a874;_0x541ff2=0xc8;}else{_0x541ff2=0xce;}_0x22a823[_0xe869('0x2b')](_0x541ff2);return _0x22a823[_0xe869('0x30')](_0xe869('0x31'),_0x538717+'-'+_0x42df51+'/'+_0x32a874)[_0xe869('0x2c')](_0x367969);}return null;};}function patchUpdates(_0x17a0fa){return function(_0x3adfa7){try{jsonpatch[_0xe869('0x32')](_0x3adfa7,_0x17a0fa,!![]);}catch(_0x54b9b1){return BPromise[_0xe869('0x33')](_0x54b9b1);}return _0x3adfa7[_0xe869('0x34')]();};}function saveUpdates(_0x30dfdb,_0x5da05a){return function(_0x59e1c1){if(_0x59e1c1){return _0x59e1c1[_0xe869('0x35')](_0x30dfdb)['then'](function(_0x4a59fe){return _0x4a59fe;});}return null;};}function removeEntity(_0x1f2a1d,_0x327bef){return function(_0x4db04b){if(_0x4db04b){return _0x4db04b[_0xe869('0x36')]()[_0xe869('0x1f')](function(){_0x1f2a1d[_0xe869('0x2b')](0xcc)[_0xe869('0x37')]();});}};}function handleEntityNotFound(_0x4dbe1f,_0x15f803){return function(_0x2b0fce){if(!_0x2b0fce){_0x4dbe1f[_0xe869('0x2a')](0x194);}return _0x2b0fce;};}function handleError(_0x479686,_0x2accec){_0x2accec=_0x2accec||0x1f4;return function(_0x244181){logger['error'](_0x244181[_0xe869('0x38')]);if(_0x244181[_0xe869('0x39')]){delete _0x244181['name'];}_0x479686[_0xe869('0x2b')](_0x2accec)['send'](_0x244181);};}exports[_0xe869('0x3a')]=function(_0x391025,_0x4ff975){var _0x2b8408={},_0x16fd9d={},_0xded834={'count':0x0,'rows':[]};var _0x2cb7cc=_[_0xe869('0x3b')](db['OpenchannelMessage'][_0xe869('0x3c')],function(_0xee8898){return{'name':_0xee8898[_0xe869('0x3d')],'type':_0xee8898['type'][_0xe869('0x3e')]};});_0x16fd9d[_0xe869('0x3f')]=_[_0xe869('0x3b')](_0x2cb7cc,_0xe869('0x39'));_0x16fd9d[_0xe869('0x40')]=_[_0xe869('0x41')](_0x391025['query']);_0x16fd9d[_0xe869('0x42')]=_[_0xe869('0x43')](_0x16fd9d[_0xe869('0x3f')],_0x16fd9d['query']);_0x2b8408[_0xe869('0x44')]=_['intersection'](_0x16fd9d[_0xe869('0x3f')],qs[_0xe869('0x45')](_0x391025[_0xe869('0x40')][_0xe869('0x45')]));_0x2b8408['attributes']=_0x2b8408[_0xe869('0x44')][_0xe869('0x46')]?_0x2b8408['attributes']:_0x16fd9d[_0xe869('0x3f')];if(!_0x391025[_0xe869('0x40')][_0xe869('0x47')](_0xe869('0x48'))){_0x2b8408[_0xe869('0x2d')]=qs[_0xe869('0x2d')](_0x391025['query'][_0xe869('0x2d')]);_0x2b8408['offset']=qs[_0xe869('0x2e')](_0x391025[_0xe869('0x40')][_0xe869('0x2e')]);}_0x2b8408[_0xe869('0x49')]=qs[_0xe869('0x4a')](_0x391025[_0xe869('0x40')][_0xe869('0x4a')]);_0x2b8408[_0xe869('0x4b')]=qs[_0xe869('0x42')](_[_0xe869('0x4c')](_0x391025[_0xe869('0x40')],_0x16fd9d[_0xe869('0x42')]),_0x2cb7cc);if(_0x391025[_0xe869('0x40')][_0xe869('0x4d')]){_0x2b8408['where']=_[_0xe869('0x4e')](_0x2b8408[_0xe869('0x4b')],{'$or':_['map'](_0x2cb7cc,function(_0x198da0){if(_0x198da0['type']!==_0xe869('0x4f')){var _0xb235e0={};_0xb235e0[_0x198da0[_0xe869('0x39')]]={'$like':'%'+_0x391025[_0xe869('0x40')][_0xe869('0x4d')]+'%'};return _0xb235e0;}})});}_0x2b8408=_[_0xe869('0x4e')]({},_0x2b8408,_0x391025[_0xe869('0x50')]);var _0x9250bd={'where':_0x2b8408[_0xe869('0x4b')]};return db[_0xe869('0x51')]['count'](_0x9250bd)[_0xe869('0x1f')](function(_0x417ba3){_0xded834[_0xe869('0x2f')]=_0x417ba3;if(_0x391025[_0xe869('0x40')][_0xe869('0x52')]){_0x2b8408[_0xe869('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xe869('0x54')](_0x2b8408);})['then'](function(_0x159579){_0xded834['rows']=_0x159579;return _0xded834;})['then'](respondWithFilteredResult(_0x4ff975,_0x2b8408))[_0xe869('0x29')](handleError(_0x4ff975,null));};exports['show']=function(_0x5905a8,_0x322603){var _0x362f71={'raw':!![],'where':{'id':_0x5905a8[_0xe869('0x55')]['id']}},_0x2ca166={};_0x2ca166[_0xe869('0x3f')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x2ca166[_0xe869('0x40')]=_['keys'](_0x5905a8[_0xe869('0x40')]);_0x2ca166[_0xe869('0x42')]=_['intersection'](_0x2ca166[_0xe869('0x3f')],_0x2ca166['query']);_0x362f71[_0xe869('0x44')]=_[_0xe869('0x43')](_0x2ca166[_0xe869('0x3f')],qs[_0xe869('0x45')](_0x5905a8[_0xe869('0x40')][_0xe869('0x45')]));_0x362f71[_0xe869('0x44')]=_0x362f71[_0xe869('0x44')][_0xe869('0x46')]?_0x362f71[_0xe869('0x44')]:_0x2ca166[_0xe869('0x3f')];if(_0x5905a8['query']['includeAll']){_0x362f71[_0xe869('0x53')]=[{'all':!![]}];}_0x362f71=_[_0xe869('0x4e')]({},_0x362f71,_0x5905a8[_0xe869('0x50')]);return db['OpenchannelMessage']['find'](_0x362f71)[_0xe869('0x1f')](handleEntityNotFound(_0x322603,null))[_0xe869('0x1f')](respondWithResult(_0x322603,null))['catch'](handleError(_0x322603,null));};exports[_0xe869('0x56')]=function(_0x598604,_0x42a811){return db[_0xe869('0x51')][_0xe869('0x56')](_0x598604[_0xe869('0x57')],{})[_0xe869('0x1f')](respondWithResult(_0x42a811,0xc9))[_0xe869('0x29')](handleError(_0x42a811,null));};exports[_0xe869('0x35')]=function(_0x6cf802,_0x206d74){if(_0x6cf802[_0xe869('0x57')]['id']){delete _0x6cf802[_0xe869('0x57')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x6cf802[_0xe869('0x55')]['id']}})[_0xe869('0x1f')](handleEntityNotFound(_0x206d74,null))[_0xe869('0x1f')](saveUpdates(_0x6cf802[_0xe869('0x57')],null))['then'](respondWithResult(_0x206d74,null))[_0xe869('0x29')](handleError(_0x206d74,null));};exports[_0xe869('0x36')]=function(_0x2a40a8,_0x35fab5){return db['OpenchannelMessage'][_0xe869('0x58')]({'where':{'id':_0x2a40a8[_0xe869('0x55')]['id']}})['then'](handleEntityNotFound(_0x35fab5,null))[_0xe869('0x1f')](removeEntity(_0x35fab5,null))[_0xe869('0x29')](handleError(_0x35fab5,null));};exports[_0xe869('0x59')]=function(_0x43fd1e,_0x1039ed){return db['OpenchannelMessage']['describe']()['then'](respondWithResult(_0x1039ed,null))[_0xe869('0x29')](handleError(_0x1039ed,null));};var interaction_log=require(_0xe869('0x14'))('openchannel-interactions');exports[_0xe869('0x5a')]=function(_0x6631d1,_0x39b8cb,_0x1c0b1c){var _0x352812={'agent':{},'channel':'openchannel'};if(_0x6631d1[_0xe869('0x57')]['id']){delete _0x6631d1[_0xe869('0x57')]['id'];}_0x6631d1[_0xe869('0x57')][_0xe869('0x5b')]=!![];_0x6631d1[_0xe869('0x57')]['readAt']=moment()[_0xe869('0x5c')](_0xe869('0x5d'));_0x6631d1[_0xe869('0x57')][_0xe869('0x5e')]=_0x6631d1[_0xe869('0x57')][_0xe869('0x5e')]||_0x6631d1[_0xe869('0x5f')]['id'];_0x352812[_0xe869('0x60')]['id']=_0x6631d1[_0xe869('0x57')][_0xe869('0x5e')];return db[_0xe869('0x51')]['find']({'where':{'id':_0x6631d1[_0xe869('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x39b8cb,null))[_0xe869('0x1f')](saveUpdates(_0x6631d1['body'],null))[_0xe869('0x1f')](function(_0x4fd829){if(_0x4fd829){_0x352812[_0xe869('0x26')]=_0x4fd829[_0xe869('0x61')]({'plain':!![]});return db[_0xe869('0x62')][_0xe869('0x58')]({'where':{'id':_0x4fd829['OpenchannelInteractionId']}});}return null;})[_0xe869('0x1f')](handleEntityNotFound(_0x39b8cb,null))['then'](function(_0xac7238){if(_0xac7238){return _0xac7238[_0xe869('0x35')]({'UserId':_0x6631d1[_0xe869('0x57')][_0xe869('0x5e')],'read1stAt':_[_0xe869('0x63')](_0xac7238[_0xe869('0x64')])?moment()['format'](_0xe869('0x5d')):undefined});}return null;})[_0xe869('0x1f')](function(_0x435259){if(_0x435259){_0x352812[_0xe869('0x65')]=_0x435259[_0xe869('0x61')]({'plain':!![]});interaction_log['info'](_0xe869('0x66'),_0x6631d1[_0xe869('0x5f')]['id'],_0x6631d1[_0xe869('0x5f')]['name'],_0x6631d1[_0xe869('0x5f')][_0xe869('0x67')],_0x352812['interaction']['id'],_0x6631d1[_0xe869('0x57')]?JSON[_0xe869('0x23')](_0x6631d1[_0xe869('0x57')]):_0xe869('0x68'));return respondWithRpcPromise(_0xe869('0x69'),_0xe869('0x6a'),_0x352812);}return null;})[_0xe869('0x1f')](function(_0xa05aea){var _0x37ab3d=_0xe869('0x6b')+_0xa05aea[_0xe869('0x26')][_0xe869('0x6c')];return db[_0xe869('0x6d')][_0xe869('0x40')](_0x37ab3d,{'type':db['Sequelize'][_0xe869('0x6e')]['SELECT'],'raw':!![]})[_0xe869('0x1f')](function(_0x38de96){return _0x38de96;});})[_0xe869('0x1f')](function(_0x1dcf74){if(_0x1dcf74){_0x352812[_0xe869('0x26')]['contact']=_0x1dcf74[0x0];if(!_0x6631d1[_0xe869('0x57')]['UserId'])return;return db['User'][_0xe869('0x58')]({'where':{'id':_0x6631d1[_0xe869('0x57')][_0xe869('0x5e')],'role':'agent'},'attributes':['id',_0xe869('0x39'),'fullname',_0xe869('0x6f'),_0xe869('0x70')],'raw':!![]});}return null;})[_0xe869('0x1f')](function(_0x2226f1){if(!_0x2226f1)return null;_0x352812[_0xe869('0x26')][_0xe869('0x60')]=_0x2226f1;return _0x352812;})[_0xe869('0x1f')](function(_0x4b155b){if(_0x4b155b){if(_0x6631d1['body']['manual']){_0x352812['message'][_0xe869('0x71')]=util[_0xe869('0x5c')](_0xe869('0x72'),_0x6631d1[_0xe869('0x5f')][_0xe869('0x39')]);_0x352812[_0xe869('0x26')]['channel']=_0x352812[_0xe869('0x73')];_0x352812[_0xe869('0x26')][_0xe869('0x74')]=_0x352812[_0xe869('0x73')];_0x352812['message']['event']=_0xe869('0x5a');return respondWithRpcPromise(_0xe869('0x75'),_0xe869('0x75'),{'event':'acceptmessage','message':_0x352812['message']},client9002)[_0xe869('0x1f')](function(){return _0x352812;});}return _0x352812;}return null;})[_0xe869('0x1f')](respondWithResult(_0x39b8cb,null))[_0xe869('0x29')](handleError(_0x39b8cb,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xe869('0x33')]=function(_0x3936d2,_0x14c1b4,_0x482bf8){var _0x5b056f={'agent':{},'channel':_0xe869('0x76')};if(_0x3936d2[_0xe869('0x57')]['id']){delete _0x3936d2[_0xe869('0x57')]['id'];}_0x3936d2[_0xe869('0x57')][_0xe869('0x5e')]=_0x3936d2['body'][_0xe869('0x5e')]||_0x3936d2[_0xe869('0x5f')]['id'];_0x5b056f[_0xe869('0x60')]['id']=_0x3936d2[_0xe869('0x57')][_0xe869('0x5e')];return db[_0xe869('0x51')][_0xe869('0x58')]({'where':{'id':_0x3936d2[_0xe869('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x14c1b4,null))[_0xe869('0x1f')](function(_0xd2dc8a){if(_0xd2dc8a){_0x5b056f['message']=_0xd2dc8a['get']({'plain':!![]});return db[_0xe869('0x62')][_0xe869('0x58')]({'where':{'id':_0xd2dc8a['OpenchannelInteractionId']}});}return null;})[_0xe869('0x1f')](handleEntityNotFound(_0x14c1b4,null))[_0xe869('0x1f')](function(_0x4c421c){if(_0x4c421c){_0x5b056f[_0xe869('0x65')]=_0x4c421c[_0xe869('0x61')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3936d2[_0xe869('0x5f')]['id'],_0x3936d2[_0xe869('0x5f')][_0xe869('0x39')],_0x3936d2[_0xe869('0x5f')][_0xe869('0x67')],_0x5b056f[_0xe869('0x65')]['id'],_0x3936d2['body']?JSON[_0xe869('0x23')](_0x3936d2[_0xe869('0x57')]):_0xe869('0x68'));return respondWithRpcPromise(_0xe869('0x77'),_0xe869('0x78'),_0x5b056f);}return null;})['then'](function(_0x20d7ed){var _0x306ecd=_0xe869('0x6b')+_0x20d7ed[_0xe869('0x26')]['ContactId'];return db[_0xe869('0x6d')][_0xe869('0x40')](_0x306ecd,{'type':db['Sequelize'][_0xe869('0x6e')][_0xe869('0x79')],'raw':!![]})[_0xe869('0x1f')](function(_0x41c4d3){return _0x41c4d3;});})['then'](function(_0x353a52){if(_0x353a52){_0x5b056f[_0xe869('0x26')][_0xe869('0x7a')]=_0x353a52[0x0];if(!_0x3936d2[_0xe869('0x57')]['UserId'])return;return db[_0xe869('0x7b')]['find']({'where':{'id':_0x3936d2[_0xe869('0x57')][_0xe869('0x5e')],'role':_0xe869('0x60')},'attributes':['id',_0xe869('0x39'),_0xe869('0x7c'),_0xe869('0x6f'),_0xe869('0x70')],'raw':!![]});}return null;})[_0xe869('0x1f')](function(_0x37a596){if(!_0x37a596)return null;_0x5b056f[_0xe869('0x26')][_0xe869('0x60')]=_0x37a596;return _0x5b056f;})[_0xe869('0x1f')](function(_0x288362){if(_0x288362){_0x288362[_0xe869('0x26')][_0xe869('0x71')]=util[_0xe869('0x5c')]('SIP/%s',_0x3936d2[_0xe869('0x5f')][_0xe869('0x39')]);_0x288362[_0xe869('0x26')][_0xe869('0x73')]=_0x5b056f[_0xe869('0x73')];_0x288362[_0xe869('0x26')][_0xe869('0x74')]=_0x5b056f['channel'];_0x288362['message'][_0xe869('0x7d')]=_0xe869('0x33');respondWithRpcPromise('EventManager',_0xe869('0x75'),{'event':_0xe869('0x7e'),'message':_0x288362[_0xe869('0x26')]},client9002);return _0x5b056f;}return null;})[_0xe869('0x1f')](respondWithResult(_0x14c1b4,null))[_0xe869('0x29')](handleError(_0x14c1b4,null));}; \ No newline at end of file +var _0x90b5=['show','intersection','includeAll','find','catch','body','update','params','describe','../../config/logger','openchannel-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','role','interaction','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','User','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','OpenchannelMessage','findAll','rows'];(function(_0x587180,_0x146b3a){var _0x1eee3c=function(_0x3845e7){while(--_0x3845e7){_0x587180['push'](_0x587180['shift']());}};_0x1eee3c(++_0x146b3a);}(_0x90b5,0x139));var _0x590b=function(_0xae01dd,_0xbd8a3c){_0xae01dd=_0xae01dd-0x0;var _0x8c26df=_0x90b5[_0xae01dd];return _0x8c26df;};'use strict';var emlformat=require(_0x590b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x590b('0x1'));var jsonpatch=require(_0x590b('0x2'));var rp=require(_0x590b('0x3'));var moment=require(_0x590b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x590b('0x5'));var path=require(_0x590b('0x6'));var sox=require('sox');var csv=require(_0x590b('0x7'));var ejs=require(_0x590b('0x8'));var fs=require('fs');var fs_extra=require(_0x590b('0x9'));var _=require('lodash');var squel=require(_0x590b('0xa'));var crypto=require(_0x590b('0xb'));var jsforce=require(_0x590b('0xc'));var deskjs=require(_0x590b('0xd'));var toCsv=require(_0x590b('0x7'));var querystring=require(_0x590b('0xe'));var Papa=require(_0x590b('0xf'));var Redis=require(_0x590b('0x10'));var authService=require(_0x590b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x590b('0x12'));var hardwareService=require(_0x590b('0x13'));var logger=require('../../config/logger')(_0x590b('0x14'));var utils=require('../../config/utils');var config=require(_0x590b('0x15'));var licenseUtil=require(_0x590b('0x16'));var db=require(_0x590b('0x17'))['db'];config[_0x590b('0x18')]=_['defaults'](config[_0x590b('0x18')],{'host':_0x590b('0x19'),'port':0x18eb});var socket=require(_0x590b('0x1a'))(new Redis(config[_0x590b('0x18')]));require(_0x590b('0x1b'))[_0x590b('0x1c')](socket);var jayson=require(_0x590b('0x1d'));var client=jayson[_0x590b('0x1e')][_0x590b('0x1f')]({'port':0x232c});var client9002=jayson[_0x590b('0x1e')][_0x590b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x260f47,_0x3e4723,_0x378490,_0x3b9601){return new BPromise(function(_0x4f2512,_0x1ec65a){var _0x530e24=_0x3b9601||client;return _0x530e24[_0x590b('0x20')](_0x260f47,_0x378490)[_0x590b('0x21')](function(_0xf05b00){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x3e4723,_0x590b('0x22'));logger['debug'](_0x590b('0x23'),_0x3e4723,_0x590b('0x22'),JSON[_0x590b('0x24')](_0xf05b00));if(_0xf05b00['error']){if(_0xf05b00[_0x590b('0x25')][_0x590b('0x26')]===0x1f4){logger[_0x590b('0x25')](_0x590b('0x27'),_0x3e4723,_0xf05b00['error'][_0x590b('0x28')]);return _0x1ec65a(_0xf05b00['error'][_0x590b('0x28')]);}logger[_0x590b('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e4723,_0xf05b00['error'][_0x590b('0x28')]);return _0x4f2512(_0xf05b00[_0x590b('0x25')]['message']);}else{logger[_0x590b('0x29')](_0x590b('0x27'),_0x3e4723,'request\x20sent');_0x4f2512(_0xf05b00['result'][_0x590b('0x28')]);}})['catch'](function(_0x39fead){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3e4723,_0x39fead);_0x1ec65a(_0x39fead);});});}function respondWithStatusCode(_0x2314d0,_0x20571b){_0x20571b=_0x20571b||0xcc;return function(_0x5cf6b6){if(_0x5cf6b6){return _0x2314d0[_0x590b('0x2a')](_0x20571b);}return _0x2314d0[_0x590b('0x2b')](_0x20571b)[_0x590b('0x2c')]();};}function respondWithResult(_0x2914dd,_0x320a45){_0x320a45=_0x320a45||0xc8;return function(_0x5c5903){if(_0x5c5903){return _0x2914dd[_0x590b('0x2b')](_0x320a45)[_0x590b('0x2d')](_0x5c5903);}};}function respondWithFilteredResult(_0x333af8,_0x38a64a){return function(_0x1ee769){if(_0x1ee769){var _0x3b881f=typeof _0x38a64a['offset']===_0x590b('0x2e')&&typeof _0x38a64a['limit']===_0x590b('0x2e');var _0x3f9fd0=_0x1ee769[_0x590b('0x2f')];var _0x33931e=_0x3b881f?0x0:_0x38a64a['offset'];var _0x1041e5=_0x3b881f?_0x1ee769['count']:_0x38a64a[_0x590b('0x30')]+_0x38a64a[_0x590b('0x31')];var _0x2ea853;if(_0x1041e5>=_0x3f9fd0){_0x1041e5=_0x3f9fd0;_0x2ea853=0xc8;}else{_0x2ea853=0xce;}_0x333af8[_0x590b('0x2b')](_0x2ea853);return _0x333af8[_0x590b('0x32')]('Content-Range',_0x33931e+'-'+_0x1041e5+'/'+_0x3f9fd0)[_0x590b('0x2d')](_0x1ee769);}return null;};}function patchUpdates(_0x129516){return function(_0x4303f6){try{jsonpatch[_0x590b('0x33')](_0x4303f6,_0x129516,!![]);}catch(_0x5efcae){return BPromise['reject'](_0x5efcae);}return _0x4303f6[_0x590b('0x34')]();};}function saveUpdates(_0x125ee3,_0x48408d){return function(_0x38c312){if(_0x38c312){return _0x38c312['update'](_0x125ee3)['then'](function(_0x2387f7){return _0x2387f7;});}return null;};}function removeEntity(_0x4b0616,_0x87bee6){return function(_0x4561ac){if(_0x4561ac){return _0x4561ac[_0x590b('0x35')]()[_0x590b('0x21')](function(){_0x4b0616[_0x590b('0x2b')](0xcc)[_0x590b('0x2c')]();});}};}function handleEntityNotFound(_0x251cab,_0x4579e3){return function(_0x422a5b){if(!_0x422a5b){_0x251cab[_0x590b('0x2a')](0x194);}return _0x422a5b;};}function handleError(_0x58a110,_0x5d3fe6){_0x5d3fe6=_0x5d3fe6||0x1f4;return function(_0x322940){logger[_0x590b('0x25')](_0x322940[_0x590b('0x36')]);if(_0x322940[_0x590b('0x37')]){delete _0x322940[_0x590b('0x37')];}_0x58a110['status'](_0x5d3fe6)[_0x590b('0x38')](_0x322940);};}exports[_0x590b('0x39')]=function(_0x3e5ca5,_0x1d1fe7){var _0x1e2b8d={},_0x4b7604={},_0x433922={'count':0x0,'rows':[]};var _0x2fd86b=_['map'](db['OpenchannelMessage'][_0x590b('0x3a')],function(_0x4be52e){return{'name':_0x4be52e[_0x590b('0x3b')],'type':_0x4be52e[_0x590b('0x3c')][_0x590b('0x3d')]};});_0x4b7604[_0x590b('0x3e')]=_[_0x590b('0x3f')](_0x2fd86b,_0x590b('0x37'));_0x4b7604[_0x590b('0x40')]=_[_0x590b('0x41')](_0x3e5ca5[_0x590b('0x40')]);_0x4b7604[_0x590b('0x42')]=_['intersection'](_0x4b7604[_0x590b('0x3e')],_0x4b7604[_0x590b('0x40')]);_0x1e2b8d[_0x590b('0x43')]=_['intersection'](_0x4b7604[_0x590b('0x3e')],qs[_0x590b('0x44')](_0x3e5ca5[_0x590b('0x40')][_0x590b('0x44')]));_0x1e2b8d[_0x590b('0x43')]=_0x1e2b8d[_0x590b('0x43')][_0x590b('0x45')]?_0x1e2b8d[_0x590b('0x43')]:_0x4b7604['model'];if(!_0x3e5ca5[_0x590b('0x40')]['hasOwnProperty'](_0x590b('0x46'))){_0x1e2b8d[_0x590b('0x31')]=qs[_0x590b('0x31')](_0x3e5ca5['query'][_0x590b('0x31')]);_0x1e2b8d[_0x590b('0x30')]=qs[_0x590b('0x30')](_0x3e5ca5[_0x590b('0x40')]['offset']);}_0x1e2b8d[_0x590b('0x47')]=qs[_0x590b('0x48')](_0x3e5ca5['query']['sort']);_0x1e2b8d['where']=qs[_0x590b('0x42')](_[_0x590b('0x49')](_0x3e5ca5[_0x590b('0x40')],_0x4b7604['filters']),_0x2fd86b);if(_0x3e5ca5['query'][_0x590b('0x4a')]){_0x1e2b8d[_0x590b('0x4b')]=_['merge'](_0x1e2b8d[_0x590b('0x4b')],{'$or':_[_0x590b('0x3f')](_0x2fd86b,function(_0x44d1d8){if(_0x44d1d8[_0x590b('0x3c')]!==_0x590b('0x4c')){var _0x25ae14={};_0x25ae14[_0x44d1d8[_0x590b('0x37')]]={'$like':'%'+_0x3e5ca5[_0x590b('0x40')][_0x590b('0x4a')]+'%'};return _0x25ae14;}})});}_0x1e2b8d=_[_0x590b('0x4d')]({},_0x1e2b8d,_0x3e5ca5[_0x590b('0x4e')]);var _0x146961={'where':_0x1e2b8d[_0x590b('0x4b')]};return db['OpenchannelMessage']['count'](_0x146961)[_0x590b('0x21')](function(_0x1c1e35){_0x433922[_0x590b('0x2f')]=_0x1c1e35;if(_0x3e5ca5[_0x590b('0x40')]['includeAll']){_0x1e2b8d[_0x590b('0x4f')]=[{'all':!![]}];}return db[_0x590b('0x50')][_0x590b('0x51')](_0x1e2b8d);})['then'](function(_0x1964c5){_0x433922[_0x590b('0x52')]=_0x1964c5;return _0x433922;})['then'](respondWithFilteredResult(_0x1d1fe7,_0x1e2b8d))['catch'](handleError(_0x1d1fe7,null));};exports[_0x590b('0x53')]=function(_0x224a9b,_0x4ff15f){var _0x218c86={'raw':!![],'where':{'id':_0x224a9b['params']['id']}},_0x466f2c={};_0x466f2c[_0x590b('0x3e')]=_[_0x590b('0x41')](db[_0x590b('0x50')]['rawAttributes']);_0x466f2c['query']=_[_0x590b('0x41')](_0x224a9b[_0x590b('0x40')]);_0x466f2c['filters']=_[_0x590b('0x54')](_0x466f2c[_0x590b('0x3e')],_0x466f2c[_0x590b('0x40')]);_0x218c86[_0x590b('0x43')]=_[_0x590b('0x54')](_0x466f2c[_0x590b('0x3e')],qs[_0x590b('0x44')](_0x224a9b['query'][_0x590b('0x44')]));_0x218c86['attributes']=_0x218c86[_0x590b('0x43')][_0x590b('0x45')]?_0x218c86[_0x590b('0x43')]:_0x466f2c['model'];if(_0x224a9b['query'][_0x590b('0x55')]){_0x218c86[_0x590b('0x4f')]=[{'all':!![]}];}_0x218c86=_[_0x590b('0x4d')]({},_0x218c86,_0x224a9b[_0x590b('0x4e')]);return db['OpenchannelMessage'][_0x590b('0x56')](_0x218c86)['then'](handleEntityNotFound(_0x4ff15f,null))['then'](respondWithResult(_0x4ff15f,null))[_0x590b('0x57')](handleError(_0x4ff15f,null));};exports['create']=function(_0x10d9a3,_0x5663ef){return db[_0x590b('0x50')]['create'](_0x10d9a3[_0x590b('0x58')],{})[_0x590b('0x21')](respondWithResult(_0x5663ef,0xc9))[_0x590b('0x57')](handleError(_0x5663ef,null));};exports[_0x590b('0x59')]=function(_0xf1addd,_0x1537e9){if(_0xf1addd[_0x590b('0x58')]['id']){delete _0xf1addd[_0x590b('0x58')]['id'];}return db[_0x590b('0x50')]['find']({'where':{'id':_0xf1addd[_0x590b('0x5a')]['id']}})[_0x590b('0x21')](handleEntityNotFound(_0x1537e9,null))['then'](saveUpdates(_0xf1addd[_0x590b('0x58')],null))[_0x590b('0x21')](respondWithResult(_0x1537e9,null))[_0x590b('0x57')](handleError(_0x1537e9,null));};exports[_0x590b('0x35')]=function(_0x57e442,_0x1c2e0d){return db[_0x590b('0x50')][_0x590b('0x56')]({'where':{'id':_0x57e442[_0x590b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1c2e0d,null))[_0x590b('0x21')](removeEntity(_0x1c2e0d,null))['catch'](handleError(_0x1c2e0d,null));};exports[_0x590b('0x5b')]=function(_0x26e488,_0x3d4151){return db[_0x590b('0x50')]['describe']()[_0x590b('0x21')](respondWithResult(_0x3d4151,null))['catch'](handleError(_0x3d4151,null));};var interaction_log=require(_0x590b('0x5c'))(_0x590b('0x5d'));exports[_0x590b('0x5e')]=function(_0x556276,_0x2dff4f,_0x48f49a){var _0x1b0cbb={'agent':{},'channel':'openchannel'};if(_0x556276[_0x590b('0x58')]['id']){delete _0x556276[_0x590b('0x58')]['id'];}_0x556276[_0x590b('0x58')]['read']=!![];_0x556276['body'][_0x590b('0x5f')]=moment()[_0x590b('0x60')](_0x590b('0x61'));_0x556276[_0x590b('0x58')]['UserId']=_0x556276[_0x590b('0x58')]['UserId']||_0x556276[_0x590b('0x62')]['id'];_0x1b0cbb[_0x590b('0x63')]['id']=_0x556276[_0x590b('0x58')][_0x590b('0x64')];return db[_0x590b('0x50')]['find']({'where':{'id':_0x556276['params']['id'],'UserId':null}})[_0x590b('0x21')](handleEntityNotFound(_0x2dff4f,null))['then'](saveUpdates(_0x556276['body'],null))[_0x590b('0x21')](function(_0x1c14bf){if(_0x1c14bf){_0x1b0cbb['message']=_0x1c14bf[_0x590b('0x65')]({'plain':!![]});return db[_0x590b('0x66')]['find']({'where':{'id':_0x1c14bf[_0x590b('0x67')]}});}return null;})[_0x590b('0x21')](handleEntityNotFound(_0x2dff4f,null))['then'](function(_0xdbd073){if(_0xdbd073){return _0xdbd073['update']({'UserId':_0x556276[_0x590b('0x58')][_0x590b('0x64')],'read1stAt':_[_0x590b('0x68')](_0xdbd073['read1stAt'])?moment()[_0x590b('0x60')](_0x590b('0x61')):undefined});}return null;})[_0x590b('0x21')](function(_0x35bc9c){if(_0x35bc9c){_0x1b0cbb['interaction']=_0x35bc9c[_0x590b('0x65')]({'plain':!![]});interaction_log[_0x590b('0x29')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x556276[_0x590b('0x62')]['id'],_0x556276['user'][_0x590b('0x37')],_0x556276[_0x590b('0x62')][_0x590b('0x69')],_0x1b0cbb[_0x590b('0x6a')]['id'],_0x556276[_0x590b('0x58')]?JSON[_0x590b('0x24')](_0x556276[_0x590b('0x58')]):_0x590b('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x590b('0x6c'),_0x1b0cbb);}return null;})[_0x590b('0x21')](function(_0x474e26){var _0x329139='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x474e26['message'][_0x590b('0x6d')];return db[_0x590b('0x6e')]['query'](_0x329139,{'type':db[_0x590b('0x6f')][_0x590b('0x70')][_0x590b('0x71')],'raw':!![]})['then'](function(_0x23ee83){return _0x23ee83;});})['then'](function(_0x43dedf){if(_0x43dedf){_0x1b0cbb['message']['contact']=_0x43dedf[0x0];if(!_0x556276[_0x590b('0x58')][_0x590b('0x64')])return;return db['User'][_0x590b('0x56')]({'where':{'id':_0x556276[_0x590b('0x58')][_0x590b('0x64')],'role':_0x590b('0x63')},'attributes':['id','name',_0x590b('0x72'),_0x590b('0x73'),_0x590b('0x74')],'raw':!![]});}return null;})[_0x590b('0x21')](function(_0x1be3fc){if(!_0x1be3fc)return null;_0x1b0cbb[_0x590b('0x28')][_0x590b('0x63')]=_0x1be3fc;return _0x1b0cbb;})[_0x590b('0x21')](function(_0x421547){if(_0x421547){if(_0x556276['body'][_0x590b('0x75')]){_0x1b0cbb['message'][_0x590b('0x76')]=util[_0x590b('0x60')](_0x590b('0x77'),_0x556276[_0x590b('0x62')]['name']);_0x1b0cbb[_0x590b('0x28')][_0x590b('0x78')]=_0x1b0cbb[_0x590b('0x78')];_0x1b0cbb['message'][_0x590b('0x79')]=_0x1b0cbb[_0x590b('0x78')];_0x1b0cbb[_0x590b('0x28')][_0x590b('0x7a')]=_0x590b('0x5e');return respondWithRpcPromise('EventManager',_0x590b('0x7b'),{'event':_0x590b('0x7c'),'message':_0x1b0cbb['message']},client9002)['then'](function(){return _0x1b0cbb;});}return _0x1b0cbb;}return null;})['then'](respondWithResult(_0x2dff4f,null))[_0x590b('0x57')](handleError(_0x2dff4f,null));};var interaction_log=require(_0x590b('0x5c'))('openchannel-interactions');exports['reject']=function(_0xa529a8,_0x53c729,_0x440929){var _0x2acd6f={'agent':{},'channel':_0x590b('0x7d')};if(_0xa529a8['body']['id']){delete _0xa529a8[_0x590b('0x58')]['id'];}_0xa529a8[_0x590b('0x58')][_0x590b('0x64')]=_0xa529a8['body'][_0x590b('0x64')]||_0xa529a8[_0x590b('0x62')]['id'];_0x2acd6f[_0x590b('0x63')]['id']=_0xa529a8['body'][_0x590b('0x64')];return db[_0x590b('0x50')][_0x590b('0x56')]({'where':{'id':_0xa529a8[_0x590b('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x53c729,null))[_0x590b('0x21')](function(_0x1df0a7){if(_0x1df0a7){_0x2acd6f[_0x590b('0x28')]=_0x1df0a7[_0x590b('0x65')]({'plain':!![]});return db[_0x590b('0x66')][_0x590b('0x56')]({'where':{'id':_0x1df0a7['OpenchannelInteractionId']}});}return null;})[_0x590b('0x21')](handleEntityNotFound(_0x53c729,null))[_0x590b('0x21')](function(_0xaf4bff){if(_0xaf4bff){_0x2acd6f[_0x590b('0x6a')]=_0xaf4bff[_0x590b('0x65')]({'plain':!![]});interaction_log['info'](_0x590b('0x7e'),_0xa529a8[_0x590b('0x62')]['id'],_0xa529a8[_0x590b('0x62')]['name'],_0xa529a8['user'][_0x590b('0x69')],_0x2acd6f[_0x590b('0x6a')]['id'],_0xa529a8[_0x590b('0x58')]?JSON[_0x590b('0x24')](_0xa529a8[_0x590b('0x58')]):'null');return respondWithRpcPromise(_0x590b('0x7f'),_0x590b('0x80'),_0x2acd6f);}return null;})['then'](function(_0xa3f06f){var _0xd24046='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa3f06f[_0x590b('0x28')][_0x590b('0x6d')];return db[_0x590b('0x6e')][_0x590b('0x40')](_0xd24046,{'type':db[_0x590b('0x6f')][_0x590b('0x70')]['SELECT'],'raw':!![]})[_0x590b('0x21')](function(_0x44c344){return _0x44c344;});})['then'](function(_0x17291b){if(_0x17291b){_0x2acd6f[_0x590b('0x28')][_0x590b('0x81')]=_0x17291b[0x0];if(!_0xa529a8['body'][_0x590b('0x64')])return;return db[_0x590b('0x82')][_0x590b('0x56')]({'where':{'id':_0xa529a8['body']['UserId'],'role':_0x590b('0x63')},'attributes':['id',_0x590b('0x37'),'fullname',_0x590b('0x73'),_0x590b('0x74')],'raw':!![]});}return null;})[_0x590b('0x21')](function(_0x1ef93c){if(!_0x1ef93c)return null;_0x2acd6f[_0x590b('0x28')][_0x590b('0x63')]=_0x1ef93c;return _0x2acd6f;})[_0x590b('0x21')](function(_0x32e2de){if(_0x32e2de){_0x32e2de[_0x590b('0x28')][_0x590b('0x76')]=util['format'](_0x590b('0x77'),_0xa529a8[_0x590b('0x62')][_0x590b('0x37')]);_0x32e2de[_0x590b('0x28')][_0x590b('0x78')]=_0x2acd6f[_0x590b('0x78')];_0x32e2de[_0x590b('0x28')][_0x590b('0x79')]=_0x2acd6f[_0x590b('0x78')];_0x32e2de[_0x590b('0x28')][_0x590b('0x7a')]='reject';respondWithRpcPromise(_0x590b('0x7b'),_0x590b('0x7b'),{'event':_0x590b('0x83'),'message':_0x32e2de[_0x590b('0x28')]},client9002);return _0x2acd6f;}return null;})[_0x590b('0x21')](respondWithResult(_0x53c729,null))[_0x590b('0x57')](handleError(_0x53c729,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index f3ef49b..5046fc3 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 _0x4e5d=['hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e5d,0x191));var _0xd4e5=function(_0x331a2c,_0xc59b3e){_0x331a2c=_0x331a2c-0x0;var _0x508e83=_0x4e5d[_0x331a2c];return _0x508e83;};'use strict';var EventEmitter=require(_0xd4e5('0x0'));var OpenchannelMessage=require(_0xd4e5('0x1'))['db'][_0xd4e5('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd4e5('0x3')](0x0);var events={'afterCreate':_0xd4e5('0x4'),'afterUpdate':_0xd4e5('0x5'),'afterDestroy':_0xd4e5('0x6')};function emitEvent(_0x993bdf){return function(_0x657b7c,_0x4210a4,_0x20f38c){OpenchannelMessageEvents[_0xd4e5('0x7')](_0x993bdf+':'+_0x657b7c['id'],_0x657b7c);OpenchannelMessageEvents['emit'](_0x993bdf,_0x657b7c);_0x20f38c(null);};}for(var e in events){if(events[_0xd4e5('0x8')](e)){var event=events[e];OpenchannelMessage[_0xd4e5('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x806e=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0xe61e71,_0x4ee5b5){var _0x1b2384=function(_0x4b09e2){while(--_0x4b09e2){_0xe61e71['push'](_0xe61e71['shift']());}};_0x1b2384(++_0x4ee5b5);}(_0x806e,0x150));var _0xe806=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x806e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xe806('0x0'));var OpenchannelMessage=require(_0xe806('0x1'))['db'][_0xe806('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xe806('0x3')](0x0);var events={'afterCreate':_0xe806('0x4'),'afterUpdate':_0xe806('0x5'),'afterDestroy':_0xe806('0x6')};function emitEvent(_0x54fb7c){return function(_0x19caf3,_0x5c16eb,_0x18b5ec){OpenchannelMessageEvents[_0xe806('0x7')](_0x54fb7c+':'+_0x19caf3['id'],_0x19caf3);OpenchannelMessageEvents[_0xe806('0x7')](_0x54fb7c,_0x19caf3);_0x18b5ec(null);};}for(var e in events){if(events[_0xe806('0x8')](e)){var event=events[e];OpenchannelMessage[_0xe806('0x9')](e,emitEvent(event));}}module[_0xe806('0xa')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 24b8e09..23da170 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 _0xea28=['moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','catch','error','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','get','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','Contact','POST','GET','afterCreate','threadId','finally','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x561cd2,_0x17e5c7){var _0x47ae5e=function(_0x55ef41){while(--_0x55ef41){_0x561cd2['push'](_0x561cd2['shift']());}};_0x47ae5e(++_0x17e5c7);}(_0xea28,0x13a));var _0x8ea2=function(_0x2d421f,_0x46cff8){_0x2d421f=_0x2d421f-0x0;var _0x5f4fdb=_0xea28[_0x2d421f];return _0x5f4fdb;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[{'name':_0x8ea2('0xe'),'fields':[_0x8ea2('0xf')],'type':_0x8ea2('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x320750,_0x3de4a1,_0x3000f9){var _0x3d0b35=_0x513a0d[_0x8ea2('0x11')];var _0x500b82=_0x320750['get']({'plain':!![]});if(_0x500b82[_0x8ea2('0x12')][_0x8ea2('0x13')]()==='in'||_0x500b82[_0x8ea2('0x12')]['toLowerCase']()===_0x8ea2('0x14')&&!_0x500b82[_0x8ea2('0x15')]&&!_[_0x8ea2('0x16')](_0x500b82[_0x8ea2('0x17')])){_0x3d0b35[_0x8ea2('0x18')]['findOne']({'where':{'id':_0x500b82[_0x8ea2('0x19')]}})['then'](function(_0x4b2192){if(_0x4b2192){_0x4b2192[_0x8ea2('0x1a')]({'lastMsgAt':_0x500b82[_0x8ea2('0x1b')],'lastMsgDirection':_0x500b82[_0x8ea2('0x12')][_0x8ea2('0x13')]()});}})[_0x8ea2('0x1c')](function(_0xbb9bd1){console[_0x8ea2('0x1d')](_0xbb9bd1);});}if(_0x500b82[_0x8ea2('0x12')]===_0x8ea2('0x14')&&!_0x500b82[_0x8ea2('0x15')]){var _0x2dfa7c;_0x3d0b35[_0x8ea2('0x1e')][_0x8ea2('0x1f')]()[_0x8ea2('0x20')](function(_0x1b64cf){return _0x3d0b35[_0x8ea2('0x21')][_0x8ea2('0x22')]({'where':{'id':_0x500b82[_0x8ea2('0x23')]},'include':[{'model':_0x3d0b35[_0x8ea2('0x18')],'as':_0x8ea2('0x24'),'where':{'id':_0x500b82[_0x8ea2('0x19')]},'limit':0x1,'include':[{'model':_0x3d0b35[_0x8ea2('0x1e')],'as':'Contact','attributes':_['keys'](_0x1b64cf)}]}]});})[_0x8ea2('0x20')](function(_0x248c18){_0x2dfa7c=_0x248c18[_0x8ea2('0x25')]({'plain':!![]});if(_0x2dfa7c&&_0x2dfa7c['replyUri']){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),'afterCreate',util[_0x8ea2('0x28')](_0x8ea2('0x29'),_0x500b82['id'],_0x2dfa7c[_0x8ea2('0x2a')]));if(_0x2dfa7c[_0x8ea2('0x24')]&&_0x2dfa7c[_0x8ea2('0x24')][_0x8ea2('0x2b')]){_0x500b82[_0x8ea2('0x2c')]=_[_0x8ea2('0x2d')](_0x2dfa7c[_0x8ea2('0x24')][0x0],'Contact');_0x500b82[_0x8ea2('0x2e')]=_0x2dfa7c['Interactions'][0x0][_0x8ea2('0x2e')];}var _0x3de4a1={'method':_0x8ea2('0x2f'),'uri':encodeURI(_0x2dfa7c['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3de4a1['method']){case _0x8ea2('0x30'):_0x3de4a1['qs']=_0x500b82;break;case'POST':_0x3de4a1[_0x8ea2('0xf')]=_0x500b82;break;}return rp(_0x3de4a1)['then'](function(_0x3be291){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),_0x8ea2('0x31'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x500b82['id'],_0x2dfa7c[_0x8ea2('0x2a')]));if(_0x3be291['body'][_0x8ea2('0x32')]&&_0x3be291[_0x8ea2('0xf')][_0x8ea2('0x32')]!=_0x500b82[_0x8ea2('0x2c')][_0x8ea2('0x32')]){return _0x3d0b35[_0x8ea2('0x18')][_0x8ea2('0x1a')]({'threadId':_0x3be291[_0x8ea2('0xf')][_0x8ea2('0x32')]},{'logging':!![],'where':{'id':_0x500b82[_0x8ea2('0x2c')]['id']}});}else{return;}})['then'](function(){return _0x320750['update']({'read':!![]});})[_0x8ea2('0x1c')](function(_0x188553){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x8ea2('0x31'),util['inspect'](_0x188553,{'showHidden':![],'depth':null}));_0x3000f9();});}else{_0x3000f9();}})[_0x8ea2('0x33')](function(){_0x3000f9();});}else{_0x3000f9();}}},'charset':_0x8ea2('0x34'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5c3c=['Forwarding\x20message\x20%d\x20to\x20%s','omit','Contact','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','describe','OpenchannelAccount','find','Interactions','CmContact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0x1034c1,_0x16ccf7){var _0x33adf9=function(_0xd6e1ac){while(--_0xd6e1ac){_0x1034c1['push'](_0x1034c1['shift']());}};_0x33adf9(++_0x16ccf7);}(_0x5c3c,0x132));var _0xc5c3=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x5c3c[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x110b89,_0x46e2c1,_0x52f3eb){var _0x14140f=_0x23a6b5[_0xc5c3('0xd')];var _0x4e329f=_0x110b89[_0xc5c3('0xe')]({'plain':!![]});if(_0x4e329f[_0xc5c3('0xf')][_0xc5c3('0x10')]()==='in'||_0x4e329f['direction'][_0xc5c3('0x10')]()===_0xc5c3('0x11')&&!_0x4e329f['secret']&&!_[_0xc5c3('0x12')](_0x4e329f[_0xc5c3('0x13')])){_0x14140f[_0xc5c3('0x14')]['findOne']({'where':{'id':_0x4e329f[_0xc5c3('0x15')]}})[_0xc5c3('0x16')](function(_0x1488ab){if(_0x1488ab){_0x1488ab[_0xc5c3('0x17')]({'lastMsgAt':_0x4e329f[_0xc5c3('0x18')],'lastMsgDirection':_0x4e329f['direction']['toLowerCase']()});}})[_0xc5c3('0x19')](function(_0x577e1a){console[_0xc5c3('0x1a')](_0x577e1a);});}if(_0x4e329f[_0xc5c3('0xf')]==='out'&&!_0x4e329f['secret']){var _0x467ba9;_0x14140f['CmContact'][_0xc5c3('0x1b')]()[_0xc5c3('0x16')](function(_0x2ff158){return _0x14140f[_0xc5c3('0x1c')][_0xc5c3('0x1d')]({'where':{'id':_0x4e329f['OpenchannelAccountId']},'include':[{'model':_0x14140f[_0xc5c3('0x14')],'as':_0xc5c3('0x1e'),'where':{'id':_0x4e329f[_0xc5c3('0x15')]},'limit':0x1,'include':[{'model':_0x14140f[_0xc5c3('0x1f')],'as':'Contact','attributes':_[_0xc5c3('0x20')](_0x2ff158)}]}]});})[_0xc5c3('0x16')](function(_0x3cc612){_0x467ba9=_0x3cc612[_0xc5c3('0xe')]({'plain':!![]});if(_0x467ba9&&_0x467ba9[_0xc5c3('0x21')]){logger['info'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x467ba9[_0xc5c3('0x1e')]&&_0x467ba9[_0xc5c3('0x1e')]['length']){_0x4e329f['Interaction']=_[_0xc5c3('0x26')](_0x467ba9[_0xc5c3('0x1e')][0x0],'Contact');_0x4e329f['Contact']=_0x467ba9[_0xc5c3('0x1e')][0x0][_0xc5c3('0x27')];}var _0x46e2c1={'method':'POST','uri':encodeURI(_0x467ba9['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x46e2c1[_0xc5c3('0x28')]){case _0xc5c3('0x29'):_0x46e2c1['qs']=_0x4e329f;break;case _0xc5c3('0x2a'):_0x46e2c1[_0xc5c3('0xc')]=_0x4e329f;break;}return rp(_0x46e2c1)['then'](function(_0x21efd6){logger['info'](_0xc5c3('0x22'),'afterCreate',util[_0xc5c3('0x24')](_0xc5c3('0x2b'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]&&_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]!=_0x4e329f['Interaction'][_0xc5c3('0x2c')]){return _0x14140f['OpenchannelInteraction'][_0xc5c3('0x17')]({'threadId':_0x21efd6[_0xc5c3('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x4e329f['Interaction']['id']}});}else{return;}})[_0xc5c3('0x16')](function(){return _0x110b89[_0xc5c3('0x17')]({'read':!![]});})[_0xc5c3('0x19')](function(_0x19e482){logger['error'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x2d')](_0x19e482,{'showHidden':![],'depth':null}));_0x52f3eb();});}else{_0x52f3eb();}})[_0xc5c3('0x2e')](function(){_0x52f3eb();});}else{_0x52f3eb();}}},'charset':_0xc5c3('0x2f'),'collate':_0xc5c3('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 189f148..b5b9b65 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x469fc4,_0x427a80){var _0x11f6d4=function(_0x1b7238){while(--_0x1b7238){_0x469fc4['push'](_0x469fc4['shift']());}};_0x11f6d4(++_0x427a80);}(_0xdb28,0x106));var _0x8db2=function(_0x3ae30f,_0xd47dea){_0x3ae30f=_0x3ae30f-0x0;var _0x288e36=_0xdb28[_0x3ae30f];return _0x288e36;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3d274d,_0x28f77e){var _0x2b135c=function(_0x33aee5){while(--_0x33aee5){_0x3d274d['push'](_0x3d274d['shift']());}};_0x2b135c(++_0x28f77e);}(_0x7a54,0x106));var _0x47a5=function(_0x5e6449,_0x4f3d82){_0x5e6449=_0x5e6449-0x0;var _0x2f3d38=_0x7a54[_0x5e6449];return _0x2f3d38;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index dc42012..4e1a2a1 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 _0x3d4b=['register','length','openchannelMessage:','./openchannelMessage.events','save','update','emit','removeListener'];(function(_0x25ada9,_0x5f0e07){var _0x59e1ab=function(_0x241d91){while(--_0x241d91){_0x25ada9['push'](_0x25ada9['shift']());}};_0x59e1ab(++_0x5f0e07);}(_0x3d4b,0xf3));var _0xb3d4=function(_0x5aff19,_0x1b2577){_0x5aff19=_0x5aff19-0x0;var _0x30d5ff=_0x3d4b[_0x5aff19];return _0x30d5ff;};'use strict';var OpenchannelMessageEvents=require(_0xb3d4('0x0'));var events=[_0xb3d4('0x1'),'remove',_0xb3d4('0x2')];function createListener(_0x2b7376,_0x13168d){return function(_0x4d05c4){_0x13168d[_0xb3d4('0x3')](_0x2b7376,_0x4d05c4);};}function removeListener(_0x1f81be,_0x19a897){return function(){OpenchannelMessageEvents[_0xb3d4('0x4')](_0x1f81be,_0x19a897);};}exports[_0xb3d4('0x5')]=function(_0x1a7434){for(var _0x22525d=0x0,_0x448c49=events[_0xb3d4('0x6')];_0x22525d<_0x448c49;_0x22525d++){var _0x35e0b3=events[_0x22525d];var _0xd1d4c4=createListener(_0xb3d4('0x7')+_0x35e0b3,_0x1a7434);OpenchannelMessageEvents['on'](_0x35e0b3,_0xd1d4c4);}}; \ No newline at end of file +var _0x0e50=['removeListener','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit'];(function(_0x9db798,_0x3f5685){var _0x417009=function(_0x44ad92){while(--_0x44ad92){_0x9db798['push'](_0x9db798['shift']());}};_0x417009(++_0x3f5685);}(_0x0e50,0x168));var _0x00e5=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x0e50[_0x1b2ff7];return _0x31656a;};'use strict';var OpenchannelMessageEvents=require(_0x00e5('0x0'));var events=[_0x00e5('0x1'),_0x00e5('0x2'),'update'];function createListener(_0x1b3523,_0xa345ef){return function(_0x4a0533){_0xa345ef[_0x00e5('0x3')](_0x1b3523,_0x4a0533);};}function removeListener(_0x3d2263,_0x4f38ad){return function(){OpenchannelMessageEvents[_0x00e5('0x4')](_0x3d2263,_0x4f38ad);};}exports['register']=function(_0x3efbe7){for(var _0xeb6242=0x0,_0x255aec=events[_0x00e5('0x5')];_0xeb6242<_0x255aec;_0xeb6242++){var _0x40b93e=events[_0xeb6242];var _0x4c91eb=createListener(_0x00e5('0x6')+_0x40b93e,_0x3efbe7);OpenchannelMessageEvents['on'](_0x40b93e,_0x4c91eb);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 334a93d..09ce032 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 _0xf481=['update','delete','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','get','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents'];(function(_0xbe7e4d,_0xa6f18b){var _0x4f2051=function(_0x4b3949){while(--_0x4b3949){_0xbe7e4d['push'](_0xbe7e4d['shift']());}};_0x4f2051(++_0xa6f18b);}(_0xf481,0xd3));var _0x1f48=function(_0x4fbaf9,_0x3b8190){_0x4fbaf9=_0x4fbaf9-0x0;var _0x1d89a0=_0xf481[_0x4fbaf9];return _0x1d89a0;};'use strict';var multer=require(_0x1f48('0x0'));var util=require(_0x1f48('0x1'));var path=require(_0x1f48('0x2'));var timeout=require(_0x1f48('0x3'));var express=require(_0x1f48('0x4'));var router=express['Router']();var fs_extra=require(_0x1f48('0x5'));var auth=require(_0x1f48('0x6'));var interaction=require(_0x1f48('0x7'));var config=require(_0x1f48('0x8'));var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0x1f48('0x9')](),controller[_0x1f48('0xa')]);router['get']('/describe',auth[_0x1f48('0x9')](),controller[_0x1f48('0xb')]);router[_0x1f48('0xc')](_0x1f48('0xd'),auth[_0x1f48('0x9')](),controller[_0x1f48('0xe')]);router[_0x1f48('0xc')]('/:id/members',auth[_0x1f48('0x9')](),controller['getMembers']);router['get'](_0x1f48('0xf'),auth[_0x1f48('0x9')](),controller[_0x1f48('0x10')]);router['get'](_0x1f48('0x11'),auth[_0x1f48('0x9')](),controller[_0x1f48('0x12')]);router[_0x1f48('0x13')]('/',auth[_0x1f48('0x9')](),controller[_0x1f48('0x14')]);router[_0x1f48('0x13')]('/:id/teams',auth[_0x1f48('0x9')](),controller[_0x1f48('0x15')]);router[_0x1f48('0x13')](_0x1f48('0x11'),auth[_0x1f48('0x9')](),controller[_0x1f48('0x16')]);router['put'](_0x1f48('0xd'),auth[_0x1f48('0x9')](),controller[_0x1f48('0x17')]);router[_0x1f48('0x18')](_0x1f48('0xd'),auth[_0x1f48('0x9')](),controller['destroy']);router['delete'](_0x1f48('0xf'),auth[_0x1f48('0x9')](),controller[_0x1f48('0x19')]);router[_0x1f48('0x18')](_0x1f48('0x11'),auth[_0x1f48('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x5024=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','create','post','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5024,0xac));var _0x4502=function(_0x17f57c,_0x5994ae){_0x17f57c=_0x17f57c-0x0;var _0x2cf32e=_0x5024[_0x17f57c];return _0x2cf32e;};'use strict';var multer=require(_0x4502('0x0'));var util=require(_0x4502('0x1'));var path=require(_0x4502('0x2'));var timeout=require('connect-timeout');var express=require(_0x4502('0x3'));var router=express['Router']();var fs_extra=require(_0x4502('0x4'));var auth=require(_0x4502('0x5'));var interaction=require(_0x4502('0x6'));var config=require('../../config/environment');var controller=require(_0x4502('0x7'));router[_0x4502('0x8')]('/',auth[_0x4502('0x9')](),controller[_0x4502('0xa')]);router[_0x4502('0x8')](_0x4502('0xb'),auth[_0x4502('0x9')](),controller[_0x4502('0xc')]);router['get'](_0x4502('0xd'),auth[_0x4502('0x9')](),controller[_0x4502('0xe')]);router[_0x4502('0x8')](_0x4502('0xf'),auth[_0x4502('0x9')](),controller[_0x4502('0x10')]);router[_0x4502('0x8')](_0x4502('0x11'),auth[_0x4502('0x9')](),controller['getTeams']);router[_0x4502('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x4502('0x12')]);router['post']('/',auth[_0x4502('0x9')](),controller[_0x4502('0x13')]);router[_0x4502('0x14')](_0x4502('0x11'),auth[_0x4502('0x9')](),controller[_0x4502('0x15')]);router[_0x4502('0x14')](_0x4502('0x16'),auth[_0x4502('0x9')](),controller[_0x4502('0x17')]);router[_0x4502('0x18')](_0x4502('0xd'),auth['isAuthenticated'](),controller[_0x4502('0x19')]);router[_0x4502('0x1a')](_0x4502('0xd'),auth[_0x4502('0x9')](),controller[_0x4502('0x1b')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x4502('0x1c')]);router[_0x4502('0x1a')](_0x4502('0x16'),auth[_0x4502('0x9')](),controller['removeAgents']);module[_0x4502('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index ab77827..863f259 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 _0xaffa=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xaffa,0xae));var _0xaaff=function(_0x2d4245,_0x36e4f5){_0x2d4245=_0x2d4245-0x0;var _0xf710e5=_0xaffa[_0x2d4245];return _0xf710e5;};'use strict';var Sequelize=require(_0xaaff('0x0'));module[_0xaaff('0x1')]={'name':{'type':Sequelize[_0xaaff('0x2')],'unique':_0xaaff('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaaff('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaaff('0x5')](_0xaaff('0x6'),_0xaaff('0x7'),_0xaaff('0x8'))}}; \ No newline at end of file +var _0xf032=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x1304a3,_0xccf246){var _0x2acc66=function(_0x4c7d65){while(--_0x4c7d65){_0x1304a3['push'](_0x1304a3['shift']());}};_0x2acc66(++_0xccf246);}(_0xf032,0x1e9));var _0x2f03=function(_0x378e85,_0x3a8add){_0x378e85=_0x378e85-0x0;var _0x8a97a=_0xf032[_0x378e85];return _0x8a97a;};'use strict';var Sequelize=require(_0x2f03('0x0'));module[_0x2f03('0x1')]={'name':{'type':Sequelize[_0x2f03('0x2')],'unique':_0x2f03('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2f03('0x2')]},'timeout':{'type':Sequelize[_0x2f03('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2f03('0x5'),_0x2f03('0x6'),_0x2f03('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index fae13cc..c464e88 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 _0x8f87=['where','pick','merge','type','filter','options','include','rows','catch','params','includeAll','find','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','interface','flatMap','sequelize','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','findAll','ids','map','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','defaults','redis','localhost','./openchannelQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','index','OpenchannelQueue','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3b816e,_0x19cb4b){var _0x1781ed=function(_0x1dc1ca){while(--_0x1dc1ca){_0x3b816e['push'](_0x3b816e['shift']());}};_0x1781ed(++_0x19cb4b);}(_0x8f87,0x1ea));var _0x78f8=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x8f87[_0x5b7788];return _0x573871;};'use strict';var emlformat=require(_0x78f8('0x0'));var rimraf=require(_0x78f8('0x1'));var zipdir=require(_0x78f8('0x2'));var jsonpatch=require(_0x78f8('0x3'));var rp=require(_0x78f8('0x4'));var moment=require(_0x78f8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x78f8('0x6'));var util=require(_0x78f8('0x7'));var path=require('path');var sox=require(_0x78f8('0x8'));var csv=require(_0x78f8('0x9'));var ejs=require(_0x78f8('0xa'));var fs=require('fs');var fs_extra=require(_0x78f8('0xb'));var _=require(_0x78f8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x78f8('0xd'));var deskjs=require(_0x78f8('0xe'));var toCsv=require(_0x78f8('0x9'));var querystring=require(_0x78f8('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x78f8('0x10'));var as=require(_0x78f8('0x11'));var hardwareService=require(_0x78f8('0x12'));var logger=require(_0x78f8('0x13'))(_0x78f8('0x14'));var utils=require(_0x78f8('0x15'));var config=require(_0x78f8('0x16'));var licenseUtil=require(_0x78f8('0x17'));var db=require(_0x78f8('0x18'))['db'];config['redis']=_[_0x78f8('0x19')](config[_0x78f8('0x1a')],{'host':_0x78f8('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78f8('0x1a')]));require(_0x78f8('0x1c'))['register'](socket);function respondWithStatusCode(_0x2ce3e9,_0x23ef0f){_0x23ef0f=_0x23ef0f||0xcc;return function(_0x3da3c2){if(_0x3da3c2){return _0x2ce3e9[_0x78f8('0x1d')](_0x23ef0f);}return _0x2ce3e9[_0x78f8('0x1e')](_0x23ef0f)[_0x78f8('0x1f')]();};}function respondWithResult(_0x2f6d37,_0x57ab90){_0x57ab90=_0x57ab90||0xc8;return function(_0x26ec64){if(_0x26ec64){return _0x2f6d37[_0x78f8('0x1e')](_0x57ab90)[_0x78f8('0x20')](_0x26ec64);}};}function respondWithFilteredResult(_0x46ef73,_0x2f9ed8){return function(_0x2bf92b){if(_0x2bf92b){var _0x3e1956=typeof _0x2f9ed8['offset']===_0x78f8('0x21')&&typeof _0x2f9ed8[_0x78f8('0x22')]==='undefined';var _0x37e65f=_0x2bf92b[_0x78f8('0x23')];var _0x45bad2=_0x3e1956?0x0:_0x2f9ed8[_0x78f8('0x24')];var _0x408326=_0x3e1956?_0x2bf92b[_0x78f8('0x23')]:_0x2f9ed8[_0x78f8('0x24')]+_0x2f9ed8[_0x78f8('0x22')];var _0x19a864;if(_0x408326>=_0x37e65f){_0x408326=_0x37e65f;_0x19a864=0xc8;}else{_0x19a864=0xce;}_0x46ef73[_0x78f8('0x1e')](_0x19a864);return _0x46ef73[_0x78f8('0x25')](_0x78f8('0x26'),_0x45bad2+'-'+_0x408326+'/'+_0x37e65f)[_0x78f8('0x20')](_0x2bf92b);}return null;};}function patchUpdates(_0x563c50){return function(_0x12bd6d){try{jsonpatch[_0x78f8('0x27')](_0x12bd6d,_0x563c50,!![]);}catch(_0x45bb4a){return BPromise[_0x78f8('0x28')](_0x45bb4a);}return _0x12bd6d[_0x78f8('0x29')]();};}function saveUpdates(_0x27e79d,_0x397ad1){return function(_0x3a2e29){if(_0x3a2e29){return _0x3a2e29[_0x78f8('0x2a')](_0x27e79d)[_0x78f8('0x2b')](function(_0x34c286){return _0x34c286;});}return null;};}function removeEntity(_0x137618,_0x57db9e){return function(_0x4ccd8c){if(_0x4ccd8c){return _0x4ccd8c[_0x78f8('0x2c')]()['then'](function(){var _0x5a3cde=_0x4ccd8c[_0x78f8('0x2d')]({'plain':!![]});var _0x4056f6=_0x78f8('0x2e');return db[_0x78f8('0x2f')][_0x78f8('0x2c')]({'where':{'type':_0x4056f6,'resourceId':_0x5a3cde['id']}})[_0x78f8('0x2b')](function(){return _0x4ccd8c;});})['then'](function(){_0x137618[_0x78f8('0x1e')](0xcc)[_0x78f8('0x1f')]();});}};}function handleEntityNotFound(_0x2c048b,_0x457daa){return function(_0x223839){if(!_0x223839){_0x2c048b[_0x78f8('0x1d')](0x194);}return _0x223839;};}function handleError(_0x389c99,_0x28e2d0){_0x28e2d0=_0x28e2d0||0x1f4;return function(_0x14eab1){logger[_0x78f8('0x30')](_0x14eab1[_0x78f8('0x31')]);if(_0x14eab1[_0x78f8('0x32')]){delete _0x14eab1[_0x78f8('0x32')];}_0x389c99[_0x78f8('0x1e')](_0x28e2d0)['send'](_0x14eab1);};}exports[_0x78f8('0x33')]=function(_0x514aa5,_0x1138b1){var _0x5de06f={},_0x2eddc3={},_0x371a88={'count':0x0,'rows':[]};var _0x24ccfc=_['map'](db[_0x78f8('0x34')][_0x78f8('0x35')],function(_0xd06880){return{'name':_0xd06880['fieldName'],'type':_0xd06880['type']['key']};});_0x2eddc3['model']=_['map'](_0x24ccfc,_0x78f8('0x32'));_0x2eddc3['query']=_[_0x78f8('0x36')](_0x514aa5[_0x78f8('0x37')]);_0x2eddc3[_0x78f8('0x38')]=_['intersection'](_0x2eddc3[_0x78f8('0x39')],_0x2eddc3[_0x78f8('0x37')]);_0x5de06f[_0x78f8('0x3a')]=_[_0x78f8('0x3b')](_0x2eddc3[_0x78f8('0x39')],qs[_0x78f8('0x3c')](_0x514aa5['query']['fields']));_0x5de06f[_0x78f8('0x3a')]=_0x5de06f[_0x78f8('0x3a')][_0x78f8('0x3d')]?_0x5de06f[_0x78f8('0x3a')]:_0x2eddc3[_0x78f8('0x39')];if(!_0x514aa5[_0x78f8('0x37')][_0x78f8('0x3e')](_0x78f8('0x3f'))){_0x5de06f[_0x78f8('0x22')]=qs[_0x78f8('0x22')](_0x514aa5[_0x78f8('0x37')][_0x78f8('0x22')]);_0x5de06f['offset']=qs[_0x78f8('0x24')](_0x514aa5[_0x78f8('0x37')][_0x78f8('0x24')]);}_0x5de06f[_0x78f8('0x40')]=qs[_0x78f8('0x41')](_0x514aa5[_0x78f8('0x37')][_0x78f8('0x41')]);_0x5de06f[_0x78f8('0x42')]=qs[_0x78f8('0x38')](_[_0x78f8('0x43')](_0x514aa5[_0x78f8('0x37')],_0x2eddc3[_0x78f8('0x38')]),_0x24ccfc);if(_0x514aa5['query']['filter']){_0x5de06f[_0x78f8('0x42')]=_[_0x78f8('0x44')](_0x5de06f[_0x78f8('0x42')],{'$or':_['map'](_0x24ccfc,function(_0x429f99){if(_0x429f99[_0x78f8('0x45')]!=='VIRTUAL'){var _0x3f6b64={};_0x3f6b64[_0x429f99['name']]={'$like':'%'+_0x514aa5[_0x78f8('0x37')][_0x78f8('0x46')]+'%'};return _0x3f6b64;}})});}_0x5de06f=_[_0x78f8('0x44')]({},_0x5de06f,_0x514aa5[_0x78f8('0x47')]);var _0x5b2f11={'where':_0x5de06f['where']};return db['OpenchannelQueue'][_0x78f8('0x23')](_0x5b2f11)[_0x78f8('0x2b')](function(_0x5c0584){_0x371a88['count']=_0x5c0584;if(_0x514aa5[_0x78f8('0x37')]['includeAll']){_0x5de06f[_0x78f8('0x48')]=[{'all':!![]}];}return db[_0x78f8('0x34')]['findAll'](_0x5de06f);})[_0x78f8('0x2b')](function(_0x39382d){_0x371a88[_0x78f8('0x49')]=_0x39382d;return _0x371a88;})[_0x78f8('0x2b')](respondWithFilteredResult(_0x1138b1,_0x5de06f))[_0x78f8('0x4a')](handleError(_0x1138b1,null));};exports['show']=function(_0x26268b,_0x1233ad){var _0x574183={'raw':!![],'where':{'id':_0x26268b[_0x78f8('0x4b')]['id']}},_0x3db30a={};_0x3db30a[_0x78f8('0x39')]=_[_0x78f8('0x36')](db['OpenchannelQueue'][_0x78f8('0x35')]);_0x3db30a[_0x78f8('0x37')]=_[_0x78f8('0x36')](_0x26268b[_0x78f8('0x37')]);_0x3db30a[_0x78f8('0x38')]=_['intersection'](_0x3db30a[_0x78f8('0x39')],_0x3db30a['query']);_0x574183[_0x78f8('0x3a')]=_[_0x78f8('0x3b')](_0x3db30a[_0x78f8('0x39')],qs['fields'](_0x26268b[_0x78f8('0x37')][_0x78f8('0x3c')]));_0x574183[_0x78f8('0x3a')]=_0x574183[_0x78f8('0x3a')][_0x78f8('0x3d')]?_0x574183['attributes']:_0x3db30a[_0x78f8('0x39')];if(_0x26268b[_0x78f8('0x37')][_0x78f8('0x4c')]){_0x574183[_0x78f8('0x48')]=[{'all':!![]}];}_0x574183=_[_0x78f8('0x44')]({},_0x574183,_0x26268b[_0x78f8('0x47')]);return db[_0x78f8('0x34')][_0x78f8('0x4d')](_0x574183)[_0x78f8('0x2b')](handleEntityNotFound(_0x1233ad,null))['then'](respondWithResult(_0x1233ad,null))['catch'](handleError(_0x1233ad,null));};exports['create']=function(_0xc4c9d7,_0x1581e9){return db[_0x78f8('0x34')]['create'](_0xc4c9d7[_0x78f8('0x4e')],{})[_0x78f8('0x2b')](function(_0x59f31c){var _0x487646=_0xc4c9d7['user'][_0x78f8('0x2d')]({'plain':!![]});if(!_0x487646)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x487646[_0x78f8('0x4f')]===_0x78f8('0x50')){var _0x4bbfb0=_0x59f31c['get']({'plain':!![]});var _0xd3c87=_0x78f8('0x2e');return db[_0x78f8('0x51')][_0x78f8('0x4d')]({'where':{'name':_0xd3c87,'userProfileId':_0x487646['userProfileId']},'raw':!![]})[_0x78f8('0x2b')](function(_0x2a44e8){if(_0x2a44e8&&_0x2a44e8[_0x78f8('0x52')]===0x0){return db[_0x78f8('0x2f')]['create']({'name':_0x4bbfb0[_0x78f8('0x32')],'resourceId':_0x4bbfb0['id'],'type':_0x2a44e8[_0x78f8('0x32')],'sectionId':_0x2a44e8['id']},{})[_0x78f8('0x2b')](function(){return _0x59f31c;});}else{return _0x59f31c;}})[_0x78f8('0x4a')](function(_0x29b024){logger[_0x78f8('0x30')](_0x78f8('0x53'),_0x29b024);throw _0x29b024;});}return _0x59f31c;})['then'](respondWithResult(_0x1581e9,0xc9))[_0x78f8('0x4a')](handleError(_0x1581e9,null));};exports[_0x78f8('0x2a')]=function(_0xc916d9,_0x5da2c0){if(_0xc916d9[_0x78f8('0x4e')]['id']){delete _0xc916d9[_0x78f8('0x4e')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0xc916d9['params']['id']}})[_0x78f8('0x2b')](handleEntityNotFound(_0x5da2c0,null))['then'](saveUpdates(_0xc916d9[_0x78f8('0x4e')],null))[_0x78f8('0x2b')](respondWithResult(_0x5da2c0,null))['catch'](handleError(_0x5da2c0,null));};exports[_0x78f8('0x2c')]=function(_0x289a4d,_0x36bc7c){return db[_0x78f8('0x34')]['find']({'where':{'id':_0x289a4d[_0x78f8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x36bc7c,null))[_0x78f8('0x2b')](removeEntity(_0x36bc7c,null))[_0x78f8('0x4a')](handleError(_0x36bc7c,null));};exports[_0x78f8('0x54')]=function(_0x5db3c0,_0xdf38ac){return db[_0x78f8('0x34')][_0x78f8('0x54')]()[_0x78f8('0x2b')](respondWithResult(_0xdf38ac,null))[_0x78f8('0x4a')](handleError(_0xdf38ac,null));};exports[_0x78f8('0x55')]=function(_0x505d77,_0x3aa937,_0x211702){var _0x2b279c={'raw':!![],'where':{}},_0x31e7c1={},_0x2a246d;return db[_0x78f8('0x34')][_0x78f8('0x56')]({'where':{'id':_0x505d77[_0x78f8('0x4b')]['id']}})[_0x78f8('0x2b')](handleEntityNotFound(_0x3aa937,null))[_0x78f8('0x2b')](function(_0xf24fe3){if(_0xf24fe3){_0x2a246d=_0xf24fe3[_0x78f8('0x2d')]({'plain':!![]});_0x31e7c1[_0x78f8('0x39')]=_[_0x78f8('0x36')](db[_0x78f8('0x57')][_0x78f8('0x35')]);_0x31e7c1['query']=_[_0x78f8('0x36')](_0x505d77['query']);_0x31e7c1[_0x78f8('0x38')]=_[_0x78f8('0x3b')](_0x31e7c1['model'],_0x31e7c1[_0x78f8('0x37')]);_0x2b279c[_0x78f8('0x3a')]=_['intersection'](_0x31e7c1[_0x78f8('0x39')],qs[_0x78f8('0x3c')](_0x505d77[_0x78f8('0x37')][_0x78f8('0x3c')]));_0x2b279c[_0x78f8('0x3a')]=_0x2b279c[_0x78f8('0x3a')][_0x78f8('0x3d')]?_0x2b279c['attributes']:_0x31e7c1[_0x78f8('0x39')];if(!_0x505d77['query']['hasOwnProperty'](_0x78f8('0x3f'))){_0x2b279c['limit']=qs[_0x78f8('0x22')](_0x505d77[_0x78f8('0x37')][_0x78f8('0x22')]);_0x2b279c[_0x78f8('0x24')]=qs[_0x78f8('0x24')](_0x505d77['query'][_0x78f8('0x24')]);}_0x2b279c[_0x78f8('0x40')]=qs[_0x78f8('0x41')](_0x505d77[_0x78f8('0x37')][_0x78f8('0x41')]);_0x2b279c[_0x78f8('0x42')]=qs[_0x78f8('0x38')](_['pick'](_0x505d77[_0x78f8('0x37')],_0x31e7c1[_0x78f8('0x38')]));_0x2b279c[_0x78f8('0x42')][_0x78f8('0x58')]=_0xf24fe3['id'];if(_0x505d77[_0x78f8('0x37')][_0x78f8('0x46')]){_0x2b279c[_0x78f8('0x42')]=_['merge'](_0x2b279c[_0x78f8('0x42')],{'$or':_['map'](_0x2b279c[_0x78f8('0x3a')],function(_0x3a425c){var _0x4aa3eb={};_0x4aa3eb[_0x3a425c]={'$like':'%'+_0x505d77[_0x78f8('0x37')]['filter']+'%'};return _0x4aa3eb;})});}_0x2b279c=_[_0x78f8('0x44')]({},_0x2b279c,_0x505d77['options']);return db[_0x78f8('0x57')]['findAll'](_0x2b279c);}})['then'](function(_0x45728f){if(_0x45728f){return db[_0x78f8('0x59')][_0x78f8('0x5a')]({'where':{'id':_['map'](_0x45728f,'UserId'),'role':_0x78f8('0x5b')},'attributes':['id',_0x78f8('0x32'),_0x78f8('0x5c'),_0x78f8('0x5d'),_0x78f8('0x5e')]});}})[_0x78f8('0x2b')](function(_0x665079){if(_0x665079){return{'count':_0x665079[_0x78f8('0x23')],'rows':_['map'](_0x665079[_0x78f8('0x49')],function(_0x1b421c){return{'membername':_0x1b421c[_0x78f8('0x32')],'UserId':_0x1b421c['id'],'queue_name':_0x2a246d['name'],'OpenchannelQueueId':_0x2a246d['id'],'interface':util[_0x78f8('0x5f')](_0x78f8('0x60'),_0x78f8('0x61'),_0x1b421c[_0x78f8('0x32')]),'penalty':0x0,'paused':_0x1b421c[_0x78f8('0x5c')],'createdAt':_0x1b421c[_0x78f8('0x5e')],'updatedAt':_0x1b421c[_0x78f8('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x78f8('0x2b')](respondWithFilteredResult(_0x3aa937,_0x2b279c))[_0x78f8('0x4a')](handleError(_0x3aa937,null));};exports[_0x78f8('0x62')]=function(_0x2bad93,_0x5e1aa2,_0xbfc2b9){var _0x3f31a9={};var _0x331192={};var _0x32dbc2;var _0x499508;return db[_0x78f8('0x34')]['findOne']({'where':{'id':_0x2bad93[_0x78f8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e1aa2,null))[_0x78f8('0x2b')](function(_0x22c0fa){if(_0x22c0fa){_0x32dbc2=_0x22c0fa;_0x331192[_0x78f8('0x39')]=_[_0x78f8('0x36')](db[_0x78f8('0x63')][_0x78f8('0x35')]);_0x331192[_0x78f8('0x37')]=_[_0x78f8('0x36')](_0x2bad93[_0x78f8('0x37')]);_0x331192[_0x78f8('0x38')]=_[_0x78f8('0x3b')](_0x331192[_0x78f8('0x39')],_0x331192[_0x78f8('0x37')]);_0x3f31a9[_0x78f8('0x3a')]=_['intersection'](_0x331192[_0x78f8('0x39')],qs[_0x78f8('0x3c')](_0x2bad93[_0x78f8('0x37')][_0x78f8('0x3c')]));_0x3f31a9[_0x78f8('0x3a')]=_0x3f31a9['attributes']['length']?_0x3f31a9['attributes']:_0x331192[_0x78f8('0x39')];_0x3f31a9[_0x78f8('0x40')]=qs[_0x78f8('0x41')](_0x2bad93[_0x78f8('0x37')]['sort']);_0x3f31a9[_0x78f8('0x42')]=qs[_0x78f8('0x38')](_['pick'](_0x2bad93[_0x78f8('0x37')],_0x331192[_0x78f8('0x38')]));if(_0x2bad93[_0x78f8('0x37')][_0x78f8('0x46')]){_0x3f31a9[_0x78f8('0x42')]=_['merge'](_0x3f31a9[_0x78f8('0x42')],{'$or':_['map'](_0x3f31a9[_0x78f8('0x3a')],function(_0x25bb7f){var _0x29b191={};_0x29b191[_0x25bb7f]={'$like':'%'+_0x2bad93[_0x78f8('0x37')]['filter']+'%'};return _0x29b191;})});}_0x3f31a9=_[_0x78f8('0x44')]({},_0x3f31a9,_0x2bad93['options']);return _0x32dbc2[_0x78f8('0x62')](_0x3f31a9);}})[_0x78f8('0x2b')](function(_0x2abac9){if(_0x2abac9){_0x499508=_0x2abac9[_0x78f8('0x3d')];if(!_0x2bad93[_0x78f8('0x37')][_0x78f8('0x3e')](_0x78f8('0x3f'))){_0x3f31a9[_0x78f8('0x22')]=qs[_0x78f8('0x22')](_0x2bad93['query'][_0x78f8('0x22')]);_0x3f31a9['offset']=qs[_0x78f8('0x24')](_0x2bad93[_0x78f8('0x37')][_0x78f8('0x24')]);}return _0x32dbc2[_0x78f8('0x62')](_0x3f31a9);}})[_0x78f8('0x2b')](function(_0x5f512f){if(_0x5f512f){return _0x5f512f?{'count':_0x499508,'rows':_0x5f512f}:null;}})['then'](respondWithResult(_0x5e1aa2,null))[_0x78f8('0x4a')](handleError(_0x5e1aa2,null));};exports[_0x78f8('0x64')]=function(_0x5c0c44,_0x5abdf1,_0xb09563){var _0x63df5a=_0x5c0c44[_0x78f8('0x4e')]['ids'];return db[_0x78f8('0x63')]['findAll']({'where':{'id':_0x63df5a},'attributes':['id'],'include':[{'model':db[_0x78f8('0x59')],'as':_0x78f8('0x65'),'attributes':['id',_0x78f8('0x32'),'online','voicePause',_0x78f8('0x66')],'raw':!![]}]})[_0x78f8('0x2b')](function(_0x4ad9be){if(_0x4ad9be){var _0x47c513=_[_0x78f8('0x67')](_0x4ad9be,function(_0x14f267){var _0x581b30=_0x14f267[_0x78f8('0x2d')]({'plain':!![]});return _0x581b30[_0x78f8('0x65')];});return db[_0x78f8('0x34')][_0x78f8('0x4d')]({'where':{'id':_0x5c0c44[_0x78f8('0x4b')]['id']}})[_0x78f8('0x2b')](function(_0x1ff2bf){return db[_0x78f8('0x68')]['transaction'](function(_0x247d19){return _0x1ff2bf[_0x78f8('0x64')](_0x63df5a,{'transaction':_0x247d19})['then'](function(){return BPromise[_0x78f8('0x69')](_0x47c513,function(_0x43662c){return db[_0x78f8('0x57')][_0x78f8('0x6a')]({'where':{'UserId':_0x43662c['id'],'OpenchannelQueueId':_0x5c0c44[_0x78f8('0x4b')]['id']},'transaction':_0x247d19});});})[_0x78f8('0x2b')](function(){_0x47c513[_0x78f8('0x6b')](function(_0x4baac8){socket['emit'](_0x78f8('0x6c'),{'UserId':_0x4baac8['id'],'OpenchannelQueueId':_0x1ff2bf['id']});});});});});}})[_0x78f8('0x2b')](respondWithStatusCode(_0x5abdf1,null))[_0x78f8('0x4a')](handleError(_0x5abdf1,null));};exports[_0x78f8('0x6d')]=function(_0x217333,_0x4f235b,_0x427d7b){return db[_0x78f8('0x63')][_0x78f8('0x6e')]({'where':{'id':_0x217333[_0x78f8('0x37')][_0x78f8('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x78f8('0x59')],'as':_0x78f8('0x65'),'attributes':['id'],'raw':!![]}]})[_0x78f8('0x2b')](handleEntityNotFound(_0x4f235b,null))[_0x78f8('0x2b')](function(_0x392fa7){var _0x18812d=_[_0x78f8('0x70')](_0x392fa7,'id');var _0x69c09=[];var _0x523a75=[];var _0x3706a0=squel[_0x78f8('0x71')]();_0x3706a0[_0x78f8('0x72')](_0x78f8('0x73'))['from']('team_has_openchannel_queues','tq')[_0x78f8('0x74')](_0x78f8('0x75'),'ut',_0x78f8('0x76'))[_0x78f8('0x42')]('OpenchannelQueueId\x20=\x20?',_0x217333['params']['id']);for(var _0x44ed6c=0x0;_0x44ed6c<_0x392fa7[_0x78f8('0x3d')];_0x44ed6c+=0x1){let _0x8c1e97=_0x392fa7[_0x44ed6c];for(var _0x3b2417=0x0;_0x3b2417<_0x8c1e97[_0x78f8('0x65')][_0x78f8('0x3d')];_0x3b2417+=0x1){let _0x21fdac=_0x8c1e97[_0x78f8('0x65')][_0x3b2417];var _0x21a289=_0x3706a0[_0x78f8('0x77')]();_0x21a289[_0x78f8('0x42')](_0x78f8('0x78'),_0x21fdac['id']);_0x523a75[_0x78f8('0x79')](db[_0x78f8('0x68')][_0x78f8('0x37')](_0x21a289[_0x78f8('0x7a')](),{'type':db['sequelize'][_0x78f8('0x7b')][_0x78f8('0x7c')]})[_0x78f8('0x2b')](function(_0x1487f4){if(_0x1487f4['length']===0x1){return _0x21fdac['id'];}else{var _0x4f5434=_['every'](_[_0x78f8('0x70')](_0x1487f4,_0x78f8('0x7d')),function(_0x50a931){return _[_0x78f8('0x7e')](_0x18812d,_0x50a931);});if(_0x4f5434){return _0x21fdac['id'];}}}));}}return BPromise[_0x78f8('0x7f')](_0x523a75)[_0x78f8('0x2b')](function(_0x91323f){_0x69c09=_(_0x69c09)[_0x78f8('0x80')](_0x91323f)['compact']()[_0x78f8('0x81')]();return db[_0x78f8('0x34')][_0x78f8('0x4d')]({'where':{'id':_0x217333[_0x78f8('0x4b')]['id']}})[_0x78f8('0x2b')](function(_0x32abdf){return db[_0x78f8('0x68')][_0x78f8('0x82')](function(_0x107699){return _0x32abdf[_0x78f8('0x6d')](_0x217333[_0x78f8('0x37')][_0x78f8('0x6f')],{'transaction':_0x107699})[_0x78f8('0x2b')](function(){if(!_[_0x78f8('0x83')](_0x69c09)){return _0x32abdf[_0x78f8('0x84')](_0x69c09,{'transaction':_0x107699});}})['then'](function(){_0x69c09[_0x78f8('0x6b')](function(_0x17965c){socket[_0x78f8('0x85')](_0x78f8('0x86'),{'UserId':_0x17965c,'OpenchannelQueueId':_0x32abdf['id']});});});});});});})[_0x78f8('0x2b')](respondWithStatusCode(_0x4f235b,null))[_0x78f8('0x4a')](handleError(_0x4f235b,null));};exports['addAgents']=function(_0xaa6167,_0x2cfbf9,_0x53dc35){return db[_0x78f8('0x34')][_0x78f8('0x4d')]({'where':{'id':_0xaa6167[_0x78f8('0x4b')]['id']}})[_0x78f8('0x2b')](handleEntityNotFound(_0x2cfbf9,null))[_0x78f8('0x2b')](function(_0x1d4dc8){if(_0x1d4dc8){return _0x1d4dc8[_0x78f8('0x87')](_0xaa6167['body'][_0x78f8('0x6f')],_[_0x78f8('0x88')](_0xaa6167[_0x78f8('0x4e')],[_0x78f8('0x6f'),'id'])||{})['spread'](function(_0x2a2481){for(var _0x32f8f5=0x0;_0x32f8f5<_0xaa6167[_0x78f8('0x4e')][_0x78f8('0x6f')]['length'];_0x32f8f5+=0x1){socket[_0x78f8('0x85')](_0x78f8('0x6c'),{'UserId':Number(_0xaa6167[_0x78f8('0x4e')][_0x78f8('0x6f')][_0x32f8f5]),'OpenchannelQueueId':Number(_0xaa6167[_0x78f8('0x4b')]['id'])});}return _0x2a2481;});}})[_0x78f8('0x2b')](respondWithResult(_0x2cfbf9,null))[_0x78f8('0x4a')](handleError(_0x2cfbf9,null));};exports['removeAgents']=function(_0x5ecd9a,_0x46d8e6,_0x583c4f){return db[_0x78f8('0x34')][_0x78f8('0x4d')]({'where':{'id':_0x5ecd9a[_0x78f8('0x4b')]['id']}})[_0x78f8('0x2b')](handleEntityNotFound(_0x46d8e6,null))['then'](function(_0x61f348){if(_0x61f348){return _0x61f348['removeAgents'](_0x5ecd9a[_0x78f8('0x37')][_0x78f8('0x6f')])['then'](function(){if(_[_0x78f8('0x89')](_0x5ecd9a[_0x78f8('0x37')][_0x78f8('0x6f')])){for(var _0x10dece=0x0;_0x10dece<_0x5ecd9a[_0x78f8('0x37')][_0x78f8('0x6f')][_0x78f8('0x3d')];_0x10dece+=0x1){socket[_0x78f8('0x85')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5ecd9a[_0x78f8('0x37')]['ids'][_0x10dece]),'OpenchannelQueueId':Number(_0x5ecd9a[_0x78f8('0x4b')]['id'])});}}else{socket[_0x78f8('0x85')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5ecd9a[_0x78f8('0x37')][_0x78f8('0x6f')]),'OpenchannelQueueId':Number(_0x5ecd9a['params']['id'])});}});}})[_0x78f8('0x2b')](respondWithStatusCode(_0x46d8e6,null))['catch'](handleError(_0x46d8e6,null));};exports[_0x78f8('0x8a')]=function(_0xd5b19a,_0x33a66d,_0x1af4bc){var _0x1a84d7={};var _0xed15d4={};var _0x52fb51;var _0x455f42;return db[_0x78f8('0x34')][_0x78f8('0x56')]({'where':{'id':_0xd5b19a[_0x78f8('0x4b')]['id']}})[_0x78f8('0x2b')](handleEntityNotFound(_0x33a66d,null))['then'](function(_0x54041d){if(_0x54041d){_0x52fb51=_0x54041d;_0xed15d4[_0x78f8('0x39')]=_[_0x78f8('0x36')](db[_0x78f8('0x59')][_0x78f8('0x35')]);_0xed15d4[_0x78f8('0x37')]=_['keys'](_0xd5b19a[_0x78f8('0x37')]);_0xed15d4[_0x78f8('0x38')]=_['intersection'](_0xed15d4['model'],_0xed15d4[_0x78f8('0x37')]);_0x1a84d7['attributes']=_[_0x78f8('0x3b')](_0xed15d4[_0x78f8('0x39')],qs[_0x78f8('0x3c')](_0xd5b19a[_0x78f8('0x37')][_0x78f8('0x3c')]));_0x1a84d7['attributes']=_0x1a84d7[_0x78f8('0x3a')][_0x78f8('0x3d')]?_0x1a84d7[_0x78f8('0x3a')]:_0xed15d4['model'];_0x1a84d7[_0x78f8('0x40')]=qs[_0x78f8('0x41')](_0xd5b19a[_0x78f8('0x37')][_0x78f8('0x41')]);_0x1a84d7['where']=qs[_0x78f8('0x38')](_[_0x78f8('0x43')](_0xd5b19a[_0x78f8('0x37')],_0xed15d4[_0x78f8('0x38')]));if(_0xd5b19a[_0x78f8('0x37')][_0x78f8('0x46')]){_0x1a84d7[_0x78f8('0x42')]=_[_0x78f8('0x44')](_0x1a84d7['where'],{'$or':_[_0x78f8('0x70')](_0x1a84d7['attributes'],function(_0x9897aa){var _0xd5f4ea={};_0xd5f4ea[_0x9897aa]={'$like':'%'+_0xd5b19a[_0x78f8('0x37')]['filter']+'%'};return _0xd5f4ea;})});}_0x1a84d7=_[_0x78f8('0x44')]({},_0x1a84d7,_0xd5b19a[_0x78f8('0x47')]);return _0x52fb51[_0x78f8('0x8a')](_0x1a84d7);}})[_0x78f8('0x2b')](function(_0x54d805){if(_0x54d805){_0x455f42=_0x54d805[_0x78f8('0x3d')];if(!_0xd5b19a[_0x78f8('0x37')][_0x78f8('0x3e')](_0x78f8('0x3f'))){_0x1a84d7[_0x78f8('0x22')]=qs['limit'](_0xd5b19a['query']['limit']);_0x1a84d7[_0x78f8('0x24')]=qs['offset'](_0xd5b19a[_0x78f8('0x37')][_0x78f8('0x24')]);}return _0x52fb51[_0x78f8('0x8a')](_0x1a84d7);}})['then'](function(_0xa5211d){if(_0xa5211d){return _0xa5211d?{'count':_0x455f42,'rows':_0xa5211d}:null;}})[_0x78f8('0x2b')](respondWithResult(_0x33a66d,null))['catch'](handleError(_0x33a66d,null));}; \ No newline at end of file +var _0xdaa1=['findAll','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','filter','agent','openchannelPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','User','online','voicePause','interface','Agents','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','options','OpenchannelQueue','includeAll','include'];(function(_0x38e210,_0x1520c2){var _0x458b4d=function(_0x146ce8){while(--_0x146ce8){_0x38e210['push'](_0x38e210['shift']());}};_0x458b4d(++_0x1520c2);}(_0xdaa1,0xcd));var _0x1daa=function(_0x549979,_0x323771){_0x549979=_0x549979-0x0;var _0x28bfdf=_0xdaa1[_0x549979];return _0x28bfdf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1daa('0x0'));var zipdir=require(_0x1daa('0x1'));var jsonpatch=require(_0x1daa('0x2'));var rp=require('request-promise');var moment=require(_0x1daa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1daa('0x4'));var util=require(_0x1daa('0x5'));var path=require(_0x1daa('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1daa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1daa('0x8'));var squel=require(_0x1daa('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1daa('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1daa('0xb'));var Papa=require(_0x1daa('0xc'));var Redis=require(_0x1daa('0xd'));var authService=require(_0x1daa('0xe'));var qs=require(_0x1daa('0xf'));var as=require(_0x1daa('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1daa('0x11'))(_0x1daa('0x12'));var utils=require(_0x1daa('0x13'));var config=require(_0x1daa('0x14'));var licenseUtil=require(_0x1daa('0x15'));var db=require(_0x1daa('0x16'))['db'];config['redis']=_[_0x1daa('0x17')](config[_0x1daa('0x18')],{'host':_0x1daa('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1daa('0x18')]));require(_0x1daa('0x1a'))[_0x1daa('0x1b')](socket);function respondWithStatusCode(_0x71ccae,_0x3bf34f){_0x3bf34f=_0x3bf34f||0xcc;return function(_0x1ffa6e){if(_0x1ffa6e){return _0x71ccae[_0x1daa('0x1c')](_0x3bf34f);}return _0x71ccae[_0x1daa('0x1d')](_0x3bf34f)[_0x1daa('0x1e')]();};}function respondWithResult(_0x4349e1,_0x474138){_0x474138=_0x474138||0xc8;return function(_0xe3b557){if(_0xe3b557){return _0x4349e1[_0x1daa('0x1d')](_0x474138)[_0x1daa('0x1f')](_0xe3b557);}};}function respondWithFilteredResult(_0x13cd0f,_0xee66d5){return function(_0x1c3f98){if(_0x1c3f98){var _0x17e053=typeof _0xee66d5[_0x1daa('0x20')]==='undefined'&&typeof _0xee66d5[_0x1daa('0x21')]==='undefined';var _0x28261e=_0x1c3f98[_0x1daa('0x22')];var _0x32937d=_0x17e053?0x0:_0xee66d5[_0x1daa('0x20')];var _0x46a93f=_0x17e053?_0x1c3f98['count']:_0xee66d5[_0x1daa('0x20')]+_0xee66d5[_0x1daa('0x21')];var _0x4fa758;if(_0x46a93f>=_0x28261e){_0x46a93f=_0x28261e;_0x4fa758=0xc8;}else{_0x4fa758=0xce;}_0x13cd0f[_0x1daa('0x1d')](_0x4fa758);return _0x13cd0f[_0x1daa('0x23')](_0x1daa('0x24'),_0x32937d+'-'+_0x46a93f+'/'+_0x28261e)[_0x1daa('0x1f')](_0x1c3f98);}return null;};}function patchUpdates(_0x546870){return function(_0x244a32){try{jsonpatch[_0x1daa('0x25')](_0x244a32,_0x546870,!![]);}catch(_0x18f320){return BPromise['reject'](_0x18f320);}return _0x244a32[_0x1daa('0x26')]();};}function saveUpdates(_0x1b7ce7,_0x182beb){return function(_0x533699){if(_0x533699){return _0x533699['update'](_0x1b7ce7)[_0x1daa('0x27')](function(_0x4f3d69){return _0x4f3d69;});}return null;};}function removeEntity(_0x8e73ab,_0x3917c0){return function(_0x46bd55){if(_0x46bd55){return _0x46bd55[_0x1daa('0x28')]()[_0x1daa('0x27')](function(){var _0x3d10b5=_0x46bd55[_0x1daa('0x29')]({'plain':!![]});var _0x35bf95=_0x1daa('0x2a');return db[_0x1daa('0x2b')][_0x1daa('0x28')]({'where':{'type':_0x35bf95,'resourceId':_0x3d10b5['id']}})[_0x1daa('0x27')](function(){return _0x46bd55;});})[_0x1daa('0x27')](function(){_0x8e73ab[_0x1daa('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x362ac1,_0x38d9df){return function(_0x3329fc){if(!_0x3329fc){_0x362ac1[_0x1daa('0x1c')](0x194);}return _0x3329fc;};}function handleError(_0x5629f8,_0xe0b25c){_0xe0b25c=_0xe0b25c||0x1f4;return function(_0x23d655){logger[_0x1daa('0x2c')](_0x23d655[_0x1daa('0x2d')]);if(_0x23d655[_0x1daa('0x2e')]){delete _0x23d655[_0x1daa('0x2e')];}_0x5629f8[_0x1daa('0x1d')](_0xe0b25c)[_0x1daa('0x2f')](_0x23d655);};}exports[_0x1daa('0x30')]=function(_0x2b591e,_0x4e45db){var _0x3216b3={},_0x8407b2={},_0x53dc2e={'count':0x0,'rows':[]};var _0x555e0e=_[_0x1daa('0x31')](db['OpenchannelQueue'][_0x1daa('0x32')],function(_0x18c35b){return{'name':_0x18c35b[_0x1daa('0x33')],'type':_0x18c35b['type'][_0x1daa('0x34')]};});_0x8407b2['model']=_['map'](_0x555e0e,_0x1daa('0x2e'));_0x8407b2[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x2b591e[_0x1daa('0x35')]);_0x8407b2[_0x1daa('0x37')]=_['intersection'](_0x8407b2[_0x1daa('0x38')],_0x8407b2['query']);_0x3216b3[_0x1daa('0x39')]=_[_0x1daa('0x3a')](_0x8407b2[_0x1daa('0x38')],qs['fields'](_0x2b591e[_0x1daa('0x35')]['fields']));_0x3216b3['attributes']=_0x3216b3[_0x1daa('0x39')][_0x1daa('0x3b')]?_0x3216b3[_0x1daa('0x39')]:_0x8407b2[_0x1daa('0x38')];if(!_0x2b591e[_0x1daa('0x35')][_0x1daa('0x3c')](_0x1daa('0x3d'))){_0x3216b3['limit']=qs[_0x1daa('0x21')](_0x2b591e[_0x1daa('0x35')][_0x1daa('0x21')]);_0x3216b3['offset']=qs[_0x1daa('0x20')](_0x2b591e[_0x1daa('0x35')][_0x1daa('0x20')]);}_0x3216b3[_0x1daa('0x3e')]=qs[_0x1daa('0x3f')](_0x2b591e[_0x1daa('0x35')][_0x1daa('0x3f')]);_0x3216b3[_0x1daa('0x40')]=qs[_0x1daa('0x37')](_[_0x1daa('0x41')](_0x2b591e[_0x1daa('0x35')],_0x8407b2['filters']),_0x555e0e);if(_0x2b591e[_0x1daa('0x35')]['filter']){_0x3216b3[_0x1daa('0x40')]=_['merge'](_0x3216b3['where'],{'$or':_[_0x1daa('0x31')](_0x555e0e,function(_0x464147){if(_0x464147[_0x1daa('0x42')]!==_0x1daa('0x43')){var _0x14651a={};_0x14651a[_0x464147[_0x1daa('0x2e')]]={'$like':'%'+_0x2b591e[_0x1daa('0x35')]['filter']+'%'};return _0x14651a;}})});}_0x3216b3=_[_0x1daa('0x44')]({},_0x3216b3,_0x2b591e[_0x1daa('0x45')]);var _0x3e4479={'where':_0x3216b3[_0x1daa('0x40')]};return db[_0x1daa('0x46')][_0x1daa('0x22')](_0x3e4479)[_0x1daa('0x27')](function(_0x3c19ac){_0x53dc2e['count']=_0x3c19ac;if(_0x2b591e[_0x1daa('0x35')][_0x1daa('0x47')]){_0x3216b3[_0x1daa('0x48')]=[{'all':!![]}];}return db[_0x1daa('0x46')][_0x1daa('0x49')](_0x3216b3);})['then'](function(_0x1c7248){_0x53dc2e[_0x1daa('0x4a')]=_0x1c7248;return _0x53dc2e;})['then'](respondWithFilteredResult(_0x4e45db,_0x3216b3))[_0x1daa('0x4b')](handleError(_0x4e45db,null));};exports[_0x1daa('0x4c')]=function(_0x4a3668,_0x3e88c5){var _0x4e7afe={'raw':!![],'where':{'id':_0x4a3668[_0x1daa('0x4d')]['id']}},_0x26f24e={};_0x26f24e['model']=_[_0x1daa('0x36')](db['OpenchannelQueue'][_0x1daa('0x32')]);_0x26f24e[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x4a3668[_0x1daa('0x35')]);_0x26f24e[_0x1daa('0x37')]=_[_0x1daa('0x3a')](_0x26f24e[_0x1daa('0x38')],_0x26f24e[_0x1daa('0x35')]);_0x4e7afe[_0x1daa('0x39')]=_[_0x1daa('0x3a')](_0x26f24e[_0x1daa('0x38')],qs['fields'](_0x4a3668[_0x1daa('0x35')][_0x1daa('0x4e')]));_0x4e7afe[_0x1daa('0x39')]=_0x4e7afe[_0x1daa('0x39')][_0x1daa('0x3b')]?_0x4e7afe['attributes']:_0x26f24e[_0x1daa('0x38')];if(_0x4a3668[_0x1daa('0x35')]['includeAll']){_0x4e7afe[_0x1daa('0x48')]=[{'all':!![]}];}_0x4e7afe=_[_0x1daa('0x44')]({},_0x4e7afe,_0x4a3668[_0x1daa('0x45')]);return db['OpenchannelQueue'][_0x1daa('0x4f')](_0x4e7afe)[_0x1daa('0x27')](handleEntityNotFound(_0x3e88c5,null))[_0x1daa('0x27')](respondWithResult(_0x3e88c5,null))[_0x1daa('0x4b')](handleError(_0x3e88c5,null));};exports['create']=function(_0x42fa3b,_0x5e6a7a){return db[_0x1daa('0x46')][_0x1daa('0x50')](_0x42fa3b[_0x1daa('0x51')],{})[_0x1daa('0x27')](function(_0x4af14a){var _0x14954a=_0x42fa3b[_0x1daa('0x52')][_0x1daa('0x29')]({'plain':!![]});if(!_0x14954a)throw new Error(_0x1daa('0x53'));if(_0x14954a[_0x1daa('0x54')]===_0x1daa('0x52')){var _0x5544a6=_0x4af14a[_0x1daa('0x29')]({'plain':!![]});var _0x122a92=_0x1daa('0x2a');return db[_0x1daa('0x55')]['find']({'where':{'name':_0x122a92,'userProfileId':_0x14954a['userProfileId']},'raw':!![]})['then'](function(_0x3bd57c){if(_0x3bd57c&&_0x3bd57c[_0x1daa('0x56')]===0x0){return db[_0x1daa('0x2b')][_0x1daa('0x50')]({'name':_0x5544a6['name'],'resourceId':_0x5544a6['id'],'type':_0x3bd57c['name'],'sectionId':_0x3bd57c['id']},{})['then'](function(){return _0x4af14a;});}else{return _0x4af14a;}})[_0x1daa('0x4b')](function(_0x31892a){logger[_0x1daa('0x2c')](_0x1daa('0x57'),_0x31892a);throw _0x31892a;});}return _0x4af14a;})[_0x1daa('0x27')](respondWithResult(_0x5e6a7a,0xc9))[_0x1daa('0x4b')](handleError(_0x5e6a7a,null));};exports[_0x1daa('0x58')]=function(_0x8c50c4,_0x143bb5){if(_0x8c50c4[_0x1daa('0x51')]['id']){delete _0x8c50c4[_0x1daa('0x51')]['id'];}return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x8c50c4[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](handleEntityNotFound(_0x143bb5,null))[_0x1daa('0x27')](saveUpdates(_0x8c50c4[_0x1daa('0x51')],null))[_0x1daa('0x27')](respondWithResult(_0x143bb5,null))['catch'](handleError(_0x143bb5,null));};exports[_0x1daa('0x28')]=function(_0x5da7a5,_0x5ec0fe){return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x5da7a5[_0x1daa('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5ec0fe,null))[_0x1daa('0x27')](removeEntity(_0x5ec0fe,null))[_0x1daa('0x4b')](handleError(_0x5ec0fe,null));};exports[_0x1daa('0x59')]=function(_0x4543e4,_0x4cec9a){return db[_0x1daa('0x46')][_0x1daa('0x59')]()['then'](respondWithResult(_0x4cec9a,null))[_0x1daa('0x4b')](handleError(_0x4cec9a,null));};exports[_0x1daa('0x5a')]=function(_0x228245,_0xddf1c9,_0x16b3c3){var _0x141a82={'raw':!![],'where':{}},_0x12ee76={},_0x53da85;return db[_0x1daa('0x46')][_0x1daa('0x5b')]({'where':{'id':_0x228245[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](handleEntityNotFound(_0xddf1c9,null))[_0x1daa('0x27')](function(_0x429b89){if(_0x429b89){_0x53da85=_0x429b89[_0x1daa('0x29')]({'plain':!![]});_0x12ee76['model']=_[_0x1daa('0x36')](db[_0x1daa('0x5c')][_0x1daa('0x32')]);_0x12ee76[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x228245[_0x1daa('0x35')]);_0x12ee76['filters']=_['intersection'](_0x12ee76['model'],_0x12ee76[_0x1daa('0x35')]);_0x141a82['attributes']=_[_0x1daa('0x3a')](_0x12ee76[_0x1daa('0x38')],qs['fields'](_0x228245[_0x1daa('0x35')][_0x1daa('0x4e')]));_0x141a82['attributes']=_0x141a82[_0x1daa('0x39')]['length']?_0x141a82[_0x1daa('0x39')]:_0x12ee76[_0x1daa('0x38')];if(!_0x228245[_0x1daa('0x35')][_0x1daa('0x3c')](_0x1daa('0x3d'))){_0x141a82[_0x1daa('0x21')]=qs[_0x1daa('0x21')](_0x228245[_0x1daa('0x35')][_0x1daa('0x21')]);_0x141a82[_0x1daa('0x20')]=qs['offset'](_0x228245[_0x1daa('0x35')][_0x1daa('0x20')]);}_0x141a82[_0x1daa('0x3e')]=qs['sort'](_0x228245[_0x1daa('0x35')]['sort']);_0x141a82['where']=qs[_0x1daa('0x37')](_['pick'](_0x228245[_0x1daa('0x35')],_0x12ee76['filters']));_0x141a82['where'][_0x1daa('0x5d')]=_0x429b89['id'];if(_0x228245[_0x1daa('0x35')][_0x1daa('0x5e')]){_0x141a82['where']=_[_0x1daa('0x44')](_0x141a82[_0x1daa('0x40')],{'$or':_[_0x1daa('0x31')](_0x141a82[_0x1daa('0x39')],function(_0x1e77d1){var _0x3d2ae1={};_0x3d2ae1[_0x1e77d1]={'$like':'%'+_0x228245[_0x1daa('0x35')][_0x1daa('0x5e')]+'%'};return _0x3d2ae1;})});}_0x141a82=_['merge']({},_0x141a82,_0x228245['options']);return db[_0x1daa('0x5c')][_0x1daa('0x49')](_0x141a82);}})['then'](function(_0x2fc9a5){if(_0x2fc9a5){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x2fc9a5,'UserId'),'role':_0x1daa('0x5f')},'attributes':['id',_0x1daa('0x2e'),_0x1daa('0x60'),_0x1daa('0x61'),_0x1daa('0x62')]});}})[_0x1daa('0x27')](function(_0x383f25){if(_0x383f25){return{'count':_0x383f25[_0x1daa('0x22')],'rows':_[_0x1daa('0x31')](_0x383f25[_0x1daa('0x4a')],function(_0x4993e9){return{'membername':_0x4993e9['name'],'UserId':_0x4993e9['id'],'queue_name':_0x53da85[_0x1daa('0x2e')],'OpenchannelQueueId':_0x53da85['id'],'interface':util[_0x1daa('0x63')]('%s/%s','SIP',_0x4993e9[_0x1daa('0x2e')]),'penalty':0x0,'paused':_0x4993e9[_0x1daa('0x60')],'createdAt':_0x4993e9['createdAt'],'updatedAt':_0x4993e9[_0x1daa('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xddf1c9,_0x141a82))[_0x1daa('0x4b')](handleError(_0xddf1c9,null));};exports[_0x1daa('0x64')]=function(_0x14fa03,_0x7c21f,_0x536447){var _0x3837a1={};var _0x2f11f6={};var _0x117149;var _0x2958c6;return db[_0x1daa('0x46')][_0x1daa('0x5b')]({'where':{'id':_0x14fa03[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](handleEntityNotFound(_0x7c21f,null))['then'](function(_0x40a6f8){if(_0x40a6f8){_0x117149=_0x40a6f8;_0x2f11f6['model']=_[_0x1daa('0x36')](db[_0x1daa('0x65')]['rawAttributes']);_0x2f11f6[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x14fa03['query']);_0x2f11f6['filters']=_[_0x1daa('0x3a')](_0x2f11f6[_0x1daa('0x38')],_0x2f11f6[_0x1daa('0x35')]);_0x3837a1[_0x1daa('0x39')]=_[_0x1daa('0x3a')](_0x2f11f6[_0x1daa('0x38')],qs[_0x1daa('0x4e')](_0x14fa03[_0x1daa('0x35')][_0x1daa('0x4e')]));_0x3837a1[_0x1daa('0x39')]=_0x3837a1[_0x1daa('0x39')]['length']?_0x3837a1[_0x1daa('0x39')]:_0x2f11f6[_0x1daa('0x38')];_0x3837a1[_0x1daa('0x3e')]=qs[_0x1daa('0x3f')](_0x14fa03[_0x1daa('0x35')][_0x1daa('0x3f')]);_0x3837a1[_0x1daa('0x40')]=qs['filters'](_['pick'](_0x14fa03['query'],_0x2f11f6[_0x1daa('0x37')]));if(_0x14fa03['query'][_0x1daa('0x5e')]){_0x3837a1[_0x1daa('0x40')]=_['merge'](_0x3837a1[_0x1daa('0x40')],{'$or':_[_0x1daa('0x31')](_0x3837a1[_0x1daa('0x39')],function(_0x2b2968){var _0x37a424={};_0x37a424[_0x2b2968]={'$like':'%'+_0x14fa03[_0x1daa('0x35')]['filter']+'%'};return _0x37a424;})});}_0x3837a1=_['merge']({},_0x3837a1,_0x14fa03[_0x1daa('0x45')]);return _0x117149['getTeams'](_0x3837a1);}})['then'](function(_0x5ee733){if(_0x5ee733){_0x2958c6=_0x5ee733[_0x1daa('0x3b')];if(!_0x14fa03[_0x1daa('0x35')][_0x1daa('0x3c')](_0x1daa('0x3d'))){_0x3837a1[_0x1daa('0x21')]=qs['limit'](_0x14fa03[_0x1daa('0x35')][_0x1daa('0x21')]);_0x3837a1[_0x1daa('0x20')]=qs[_0x1daa('0x20')](_0x14fa03[_0x1daa('0x35')]['offset']);}return _0x117149[_0x1daa('0x64')](_0x3837a1);}})[_0x1daa('0x27')](function(_0xc97eb){if(_0xc97eb){return _0xc97eb?{'count':_0x2958c6,'rows':_0xc97eb}:null;}})[_0x1daa('0x27')](respondWithResult(_0x7c21f,null))['catch'](handleError(_0x7c21f,null));};exports[_0x1daa('0x66')]=function(_0x5cb2e7,_0x5400c2,_0x50659b){var _0x5b3f9a=_0x5cb2e7[_0x1daa('0x51')][_0x1daa('0x67')];return db[_0x1daa('0x65')][_0x1daa('0x49')]({'where':{'id':_0x5b3f9a},'attributes':['id'],'include':[{'model':db[_0x1daa('0x68')],'as':'Agents','attributes':['id',_0x1daa('0x2e'),_0x1daa('0x69'),_0x1daa('0x6a'),_0x1daa('0x6b')],'raw':!![]}]})[_0x1daa('0x27')](function(_0x247b7e){if(_0x247b7e){var _0x142bc8=_['flatMap'](_0x247b7e,function(_0x2604cf){var _0x50f6ee=_0x2604cf[_0x1daa('0x29')]({'plain':!![]});return _0x50f6ee[_0x1daa('0x6c')];});return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x5cb2e7[_0x1daa('0x4d')]['id']}})['then'](function(_0x19a3f9){return db['sequelize'][_0x1daa('0x6d')](function(_0x2f8e0a){return _0x19a3f9[_0x1daa('0x66')](_0x5b3f9a,{'transaction':_0x2f8e0a})['then'](function(){return BPromise[_0x1daa('0x6e')](_0x142bc8,function(_0x2d772d){return db[_0x1daa('0x5c')][_0x1daa('0x6f')]({'where':{'UserId':_0x2d772d['id'],'OpenchannelQueueId':_0x5cb2e7[_0x1daa('0x4d')]['id']},'transaction':_0x2f8e0a});});})['then'](function(){_0x142bc8[_0x1daa('0x70')](function(_0x1a360e){socket[_0x1daa('0x71')](_0x1daa('0x72'),{'UserId':_0x1a360e['id'],'OpenchannelQueueId':_0x19a3f9['id']});});});});});}})[_0x1daa('0x27')](respondWithStatusCode(_0x5400c2,null))[_0x1daa('0x4b')](handleError(_0x5400c2,null));};exports[_0x1daa('0x73')]=function(_0x311f03,_0x257ade,_0x284598){return db[_0x1daa('0x65')][_0x1daa('0x49')]({'where':{'id':_0x311f03[_0x1daa('0x35')][_0x1daa('0x67')]},'attributes':['id'],'include':[{'model':db[_0x1daa('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x257ade,null))[_0x1daa('0x27')](function(_0x4a038e){var _0x3ddb53=_['map'](_0x4a038e,'id');var _0x50d763=[];var _0x27f1b7=[];var _0x28d250=squel[_0x1daa('0x74')]();_0x28d250[_0x1daa('0x75')](_0x1daa('0x76'))['from']('team_has_openchannel_queues','tq')[_0x1daa('0x77')](_0x1daa('0x78'),'ut',_0x1daa('0x79'))[_0x1daa('0x40')](_0x1daa('0x7a'),_0x311f03[_0x1daa('0x4d')]['id']);for(var _0x2d966e=0x0;_0x2d966e<_0x4a038e[_0x1daa('0x3b')];_0x2d966e+=0x1){let _0x51a0ee=_0x4a038e[_0x2d966e];for(var _0x561385=0x0;_0x561385<_0x51a0ee[_0x1daa('0x6c')]['length'];_0x561385+=0x1){let _0x31eb46=_0x51a0ee[_0x1daa('0x6c')][_0x561385];var _0xc40b91=_0x28d250[_0x1daa('0x7b')]();_0xc40b91[_0x1daa('0x40')]('ut.UserId\x20=\x20?',_0x31eb46['id']);_0x27f1b7[_0x1daa('0x7c')](db[_0x1daa('0x7d')][_0x1daa('0x35')](_0xc40b91['toString'](),{'type':db[_0x1daa('0x7d')][_0x1daa('0x7e')][_0x1daa('0x7f')]})[_0x1daa('0x27')](function(_0x12a3aa){if(_0x12a3aa['length']===0x1){return _0x31eb46['id'];}else{var _0x767287=_['every'](_['map'](_0x12a3aa,_0x1daa('0x80')),function(_0x5df1b7){return _[_0x1daa('0x81')](_0x3ddb53,_0x5df1b7);});if(_0x767287){return _0x31eb46['id'];}}}));}}return BPromise[_0x1daa('0x82')](_0x27f1b7)['then'](function(_0x17b28f){_0x50d763=_(_0x50d763)[_0x1daa('0x83')](_0x17b28f)[_0x1daa('0x84')]()[_0x1daa('0x85')]();return db[_0x1daa('0x46')]['find']({'where':{'id':_0x311f03[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](function(_0x4ff3e3){return db['sequelize'][_0x1daa('0x6d')](function(_0x263099){return _0x4ff3e3[_0x1daa('0x73')](_0x311f03[_0x1daa('0x35')][_0x1daa('0x67')],{'transaction':_0x263099})[_0x1daa('0x27')](function(){if(!_['isEmpty'](_0x50d763)){return _0x4ff3e3[_0x1daa('0x86')](_0x50d763,{'transaction':_0x263099});}})['then'](function(){_0x50d763[_0x1daa('0x70')](function(_0x3d5748){socket['emit'](_0x1daa('0x87'),{'UserId':_0x3d5748,'OpenchannelQueueId':_0x4ff3e3['id']});});});});});});})[_0x1daa('0x27')](respondWithStatusCode(_0x257ade,null))[_0x1daa('0x4b')](handleError(_0x257ade,null));};exports[_0x1daa('0x88')]=function(_0x548e45,_0x4a3a35,_0x402c7d){return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x548e45[_0x1daa('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a3a35,null))[_0x1daa('0x27')](function(_0x3b4a15){if(_0x3b4a15){return _0x3b4a15[_0x1daa('0x88')](_0x548e45[_0x1daa('0x51')][_0x1daa('0x67')],_['omit'](_0x548e45[_0x1daa('0x51')],[_0x1daa('0x67'),'id'])||{})['spread'](function(_0x49d696){for(var _0x2e8997=0x0;_0x2e8997<_0x548e45[_0x1daa('0x51')][_0x1daa('0x67')][_0x1daa('0x3b')];_0x2e8997+=0x1){socket[_0x1daa('0x71')](_0x1daa('0x72'),{'UserId':Number(_0x548e45[_0x1daa('0x51')][_0x1daa('0x67')][_0x2e8997]),'OpenchannelQueueId':Number(_0x548e45[_0x1daa('0x4d')]['id'])});}return _0x49d696;});}})[_0x1daa('0x27')](respondWithResult(_0x4a3a35,null))[_0x1daa('0x4b')](handleError(_0x4a3a35,null));};exports[_0x1daa('0x86')]=function(_0x2f1af0,_0x339e43,_0x834a10){return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x2f1af0['params']['id']}})['then'](handleEntityNotFound(_0x339e43,null))[_0x1daa('0x27')](function(_0x1ba02d){if(_0x1ba02d){return _0x1ba02d[_0x1daa('0x86')](_0x2f1af0[_0x1daa('0x35')][_0x1daa('0x67')])[_0x1daa('0x27')](function(){if(_[_0x1daa('0x89')](_0x2f1af0[_0x1daa('0x35')][_0x1daa('0x67')])){for(var _0x3e039e=0x0;_0x3e039e<_0x2f1af0[_0x1daa('0x35')][_0x1daa('0x67')][_0x1daa('0x3b')];_0x3e039e+=0x1){socket[_0x1daa('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2f1af0['query']['ids'][_0x3e039e]),'OpenchannelQueueId':Number(_0x2f1af0[_0x1daa('0x4d')]['id'])});}}else{socket[_0x1daa('0x71')](_0x1daa('0x87'),{'UserId':Number(_0x2f1af0[_0x1daa('0x35')]['ids']),'OpenchannelQueueId':Number(_0x2f1af0['params']['id'])});}});}})[_0x1daa('0x27')](respondWithStatusCode(_0x339e43,null))['catch'](handleError(_0x339e43,null));};exports[_0x1daa('0x8a')]=function(_0x338151,_0x4effde,_0x299142){var _0x187709={};var _0xf11454={};var _0x5235b5;var _0x423363;return db[_0x1daa('0x46')][_0x1daa('0x5b')]({'where':{'id':_0x338151[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](handleEntityNotFound(_0x4effde,null))['then'](function(_0x44d058){if(_0x44d058){_0x5235b5=_0x44d058;_0xf11454['model']=_['keys'](db[_0x1daa('0x68')][_0x1daa('0x32')]);_0xf11454[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x338151['query']);_0xf11454[_0x1daa('0x37')]=_[_0x1daa('0x3a')](_0xf11454[_0x1daa('0x38')],_0xf11454[_0x1daa('0x35')]);_0x187709[_0x1daa('0x39')]=_[_0x1daa('0x3a')](_0xf11454[_0x1daa('0x38')],qs[_0x1daa('0x4e')](_0x338151[_0x1daa('0x35')][_0x1daa('0x4e')]));_0x187709[_0x1daa('0x39')]=_0x187709[_0x1daa('0x39')][_0x1daa('0x3b')]?_0x187709[_0x1daa('0x39')]:_0xf11454['model'];_0x187709['order']=qs['sort'](_0x338151[_0x1daa('0x35')][_0x1daa('0x3f')]);_0x187709['where']=qs[_0x1daa('0x37')](_[_0x1daa('0x41')](_0x338151[_0x1daa('0x35')],_0xf11454[_0x1daa('0x37')]));if(_0x338151[_0x1daa('0x35')][_0x1daa('0x5e')]){_0x187709[_0x1daa('0x40')]=_['merge'](_0x187709['where'],{'$or':_[_0x1daa('0x31')](_0x187709['attributes'],function(_0x80ca6){var _0x359a9b={};_0x359a9b[_0x80ca6]={'$like':'%'+_0x338151[_0x1daa('0x35')][_0x1daa('0x5e')]+'%'};return _0x359a9b;})});}_0x187709=_['merge']({},_0x187709,_0x338151[_0x1daa('0x45')]);return _0x5235b5[_0x1daa('0x8a')](_0x187709);}})['then'](function(_0x2c9019){if(_0x2c9019){_0x423363=_0x2c9019[_0x1daa('0x3b')];if(!_0x338151[_0x1daa('0x35')][_0x1daa('0x3c')](_0x1daa('0x3d'))){_0x187709[_0x1daa('0x21')]=qs[_0x1daa('0x21')](_0x338151[_0x1daa('0x35')][_0x1daa('0x21')]);_0x187709['offset']=qs[_0x1daa('0x20')](_0x338151[_0x1daa('0x35')]['offset']);}return _0x5235b5[_0x1daa('0x8a')](_0x187709);}})[_0x1daa('0x27')](function(_0x3c68c9){if(_0x3c68c9){return _0x3c68c9?{'count':_0x423363,'rows':_0x3c68c9}:null;}})[_0x1daa('0x27')](respondWithResult(_0x4effde,null))[_0x1daa('0x4b')](handleError(_0x4effde,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 7ddb178..719c3a9 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 _0x50b3=['remove','emit','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x4ffa74,_0x489552){var _0x4148b7=function(_0x5119f3){while(--_0x5119f3){_0x4ffa74['push'](_0x4ffa74['shift']());}};_0x4148b7(++_0x489552);}(_0x50b3,0x199));var _0x350b=function(_0x1a8469,_0x2ffccf){_0x1a8469=_0x1a8469-0x0;var _0x19c2dd=_0x50b3[_0x1a8469];return _0x19c2dd;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x350b('0x0'))['db'][_0x350b('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x350b('0x2')](0x0);var events={'afterCreate':_0x350b('0x3'),'afterUpdate':_0x350b('0x4'),'afterDestroy':_0x350b('0x5')};function emitEvent(_0x274ae9){return function(_0x4b1ccb,_0x30cd60,_0x1c300a){OpenchannelQueueEvents[_0x350b('0x6')](_0x274ae9+':'+_0x4b1ccb['id'],_0x4b1ccb);OpenchannelQueueEvents[_0x350b('0x6')](_0x274ae9,_0x4b1ccb);_0x1c300a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x350b('0x7')](e,emitEvent(event));}}module[_0x350b('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x0762=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x3ccbbe,_0x2dd3a9){var _0x50344e=function(_0x1648f2){while(--_0x1648f2){_0x3ccbbe['push'](_0x3ccbbe['shift']());}};_0x50344e(++_0x2dd3a9);}(_0x0762,0x1d1));var _0x2076=function(_0x518e33,_0x5253a3){_0x518e33=_0x518e33-0x0;var _0x299619=_0x0762[_0x518e33];return _0x299619;};'use strict';var EventEmitter=require(_0x2076('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2076('0x1')](0x0);var events={'afterCreate':_0x2076('0x2'),'afterUpdate':_0x2076('0x3'),'afterDestroy':_0x2076('0x4')};function emitEvent(_0x53b001){return function(_0x313cc2,_0x2fe33b,_0x5ae731){OpenchannelQueueEvents[_0x2076('0x5')](_0x53b001+':'+_0x313cc2['id'],_0x313cc2);OpenchannelQueueEvents[_0x2076('0x5')](_0x53b001,_0x313cc2);_0x5ae731(null);};}for(var e in events){if(events[_0x2076('0x6')](e)){var event=events[e];OpenchannelQueue[_0x2076('0x7')](e,emitEvent(event));}}module[_0x2076('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 78dd553..09b8f42 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 _0x3318=['define','OpenchannelQueue','openchannel_queues','api','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x3318,0x11b));var _0x8331=function(_0x3f6b47,_0x1256d8){_0x3f6b47=_0x3f6b47-0x0;var _0x3c70ec=_0x3318[_0x3f6b47];return _0x3c70ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8331('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8331('0x1'));var fs=require('fs');var path=require(_0x8331('0x2'));var rimraf=require(_0x8331('0x3'));var config=require(_0x8331('0x4'));var attributes=require(_0x8331('0x5'));module[_0x8331('0x6')]=function(_0x386ca3,_0x48a724){return _0x386ca3[_0x8331('0x7')](_0x8331('0x8'),attributes,{'tableName':_0x8331('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61c7=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x61c7,0x1ad));var _0x761c=function(_0x3098ec,_0x179c9a){_0x3098ec=_0x3098ec-0x0;var _0x2d8589=_0x61c7[_0x3098ec];return _0x2d8589;};'use strict';var _=require(_0x761c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x761c('0x1'));var moment=require(_0x761c('0x2'));var BPromise=require(_0x761c('0x3'));var rp=require(_0x761c('0x4'));var fs=require('fs');var path=require(_0x761c('0x5'));var rimraf=require(_0x761c('0x6'));var config=require(_0x761c('0x7'));var attributes=require(_0x761c('0x8'));module[_0x761c('0x9')]=function(_0x45b373,_0x22da9a){return _0x45b373[_0x761c('0xa')](_0x761c('0xb'),attributes,{'tableName':_0x761c('0xc'),'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 f9c5a9a..a31d5d9 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 _0x8e30=['defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueue','findAll','options','raw','where','limit','include','model','attributes','map','GetOpenchannelQueue','ShowOpenchannelQueue','then','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x35fe37,_0x2b64e1){var _0x22756a=function(_0x1c703d){while(--_0x1c703d){_0x35fe37['push'](_0x35fe37['shift']());}};_0x22756a(++_0x2b64e1);}(_0x8e30,0x135));var _0x08e3=function(_0x27c87b,_0x5bca0b){_0x27c87b=_0x27c87b-0x0;var _0x1a7e13=_0x8e30[_0x27c87b];return _0x1a7e13;};'use strict';var _=require(_0x08e3('0x0'));var util=require(_0x08e3('0x1'));var moment=require(_0x08e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x08e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x08e3('0x4'));var logger=require(_0x08e3('0x5'))(_0x08e3('0x6'));var config=require(_0x08e3('0x7'));var jayson=require(_0x08e3('0x8'));var client=jayson[_0x08e3('0x9')]['http']({'port':0x232a});config[_0x08e3('0xa')]=_[_0x08e3('0xb')](config['redis'],{'host':_0x08e3('0xc'),'port':0x18eb});var socket=require(_0x08e3('0xd'))(new Redis(config[_0x08e3('0xa')]));require(_0x08e3('0xe'))['register'](socket);function respondWithRpcPromise(_0x1bbaf7,_0x2f2ca1,_0x56a135){return new BPromise(function(_0xea4ca5,_0xb1f2ed){return client[_0x08e3('0xf')](_0x1bbaf7,_0x56a135)['then'](function(_0x418aed){logger[_0x08e3('0x10')](_0x08e3('0x11'),_0x2f2ca1,'request\x20sent');logger[_0x08e3('0x12')](_0x08e3('0x13'),_0x2f2ca1,_0x08e3('0x14'),JSON[_0x08e3('0x15')](_0x418aed));if(_0x418aed[_0x08e3('0x16')]){if(_0x418aed[_0x08e3('0x16')][_0x08e3('0x17')]===0x1f4){logger[_0x08e3('0x16')](_0x08e3('0x11'),_0x2f2ca1,_0x418aed['error'][_0x08e3('0x18')]);return _0xb1f2ed(_0x418aed[_0x08e3('0x16')]['message']);}logger['error'](_0x08e3('0x11'),_0x2f2ca1,_0x418aed[_0x08e3('0x16')][_0x08e3('0x18')]);return _0xea4ca5(_0x418aed[_0x08e3('0x16')][_0x08e3('0x18')]);}else{logger[_0x08e3('0x10')](_0x08e3('0x11'),_0x2f2ca1,_0x08e3('0x14'));_0xea4ca5(_0x418aed[_0x08e3('0x19')][_0x08e3('0x18')]);}})[_0x08e3('0x1a')](function(_0x41283e){logger[_0x08e3('0x16')](_0x08e3('0x11'),_0x2f2ca1,_0x41283e);_0xb1f2ed(_0x41283e);});});}exports['GetOpenchannelQueue']=function(_0xab40f0){var _0x33af70=this;return new Promise(function(_0x5b9e3a,_0x3f0891){return db[_0x08e3('0x1b')][_0x08e3('0x1c')]({'raw':_0xab40f0[_0x08e3('0x1d')]?_0xab40f0[_0x08e3('0x1d')][_0x08e3('0x1e')]===undefined?!![]:![]:!![],'where':_0xab40f0[_0x08e3('0x1d')]?_0xab40f0[_0x08e3('0x1d')][_0x08e3('0x1f')]||null:null,'attributes':_0xab40f0[_0x08e3('0x1d')]?_0xab40f0[_0x08e3('0x1d')]['attributes']||null:null,'limit':_0xab40f0['options']?_0xab40f0[_0x08e3('0x1d')][_0x08e3('0x20')]||null:null,'include':_0xab40f0[_0x08e3('0x1d')]?_0xab40f0['options']['include']?_['map'](_0xab40f0['options'][_0x08e3('0x21')],function(_0x3e698f){return{'model':db[_0x3e698f[_0x08e3('0x22')]],'as':_0x3e698f['as'],'attributes':_0x3e698f[_0x08e3('0x23')],'include':_0x3e698f[_0x08e3('0x21')]?_[_0x08e3('0x24')](_0x3e698f[_0x08e3('0x21')],function(_0x4b02ea){return{'model':db[_0x4b02ea[_0x08e3('0x22')]],'as':_0x4b02ea['as'],'attributes':_0x4b02ea[_0x08e3('0x23')],'include':_0x4b02ea[_0x08e3('0x21')]?_[_0x08e3('0x24')](_0x4b02ea['include'],function(_0x343caf){return{'model':db[_0x343caf[_0x08e3('0x22')]],'as':_0x343caf['as'],'attributes':_0x343caf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x454517){logger['info'](_0x08e3('0x25'),_0xab40f0);logger['debug'](_0x08e3('0x25'),_0xab40f0,JSON['stringify'](_0x454517));_0x5b9e3a(_0x454517);})[_0x08e3('0x1a')](function(_0x1f5cf7){logger[_0x08e3('0x16')](_0x08e3('0x25'),_0x1f5cf7[_0x08e3('0x18')],_0xab40f0);_0x3f0891(_0x33af70[_0x08e3('0x16')](0x1f4,_0x1f5cf7['message']));});});};exports[_0x08e3('0x26')]=function(_0x35283b){var _0x8a1f47=this;return new Promise(function(_0x9c05dc,_0x18a1e8){return db[_0x08e3('0x1b')]['find']({'raw':_0x35283b['options']?_0x35283b[_0x08e3('0x1d')][_0x08e3('0x1e')]===undefined?!![]:![]:!![],'where':_0x35283b[_0x08e3('0x1d')]?_0x35283b['options']['where']||null:null,'attributes':_0x35283b['options']?_0x35283b[_0x08e3('0x1d')][_0x08e3('0x23')]||null:null,'include':_0x35283b['options']?_0x35283b[_0x08e3('0x1d')][_0x08e3('0x21')]?_['map'](_0x35283b[_0x08e3('0x1d')]['include'],function(_0x37db2d){return{'model':db[_0x37db2d['model']],'as':_0x37db2d['as'],'attributes':_0x37db2d[_0x08e3('0x23')],'include':_0x37db2d['include']?_[_0x08e3('0x24')](_0x37db2d['include'],function(_0x2b6db3){return{'model':db[_0x2b6db3['model']],'as':_0x2b6db3['as'],'attributes':_0x2b6db3[_0x08e3('0x23')],'include':_0x2b6db3[_0x08e3('0x21')]?_[_0x08e3('0x24')](_0x2b6db3[_0x08e3('0x21')],function(_0x45beaa){return{'model':db[_0x45beaa['model']],'as':_0x45beaa['as'],'attributes':_0x45beaa[_0x08e3('0x23')]};}):[]};}):[]};}):[]:[]})[_0x08e3('0x27')](function(_0x4f5b33){logger[_0x08e3('0x10')](_0x08e3('0x26'),_0x35283b);logger[_0x08e3('0x12')](_0x08e3('0x26'),_0x35283b,JSON[_0x08e3('0x15')](_0x4f5b33));_0x9c05dc(_0x4f5b33);})[_0x08e3('0x1a')](function(_0xbd2eff){logger[_0x08e3('0x16')](_0x08e3('0x26'),_0xbd2eff[_0x08e3('0x18')],_0x35283b);_0x18a1e8(_0x8a1f47[_0x08e3('0x16')](0x1f4,_0xbd2eff[_0x08e3('0x18')]));});});}; \ No newline at end of file +var _0x8434=['redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','map','include','model','debug','find','where','ShowOpenchannelQueue','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x10baf1,_0x21d520){var _0x2cc1d8=function(_0x5e91a8){while(--_0x5e91a8){_0x10baf1['push'](_0x10baf1['shift']());}};_0x2cc1d8(++_0x21d520);}(_0x8434,0x197));var _0x4843=function(_0x466afb,_0xd83e04){_0x466afb=_0x466afb-0x0;var _0x41b4b2=_0x8434[_0x466afb];return _0x41b4b2;};'use strict';var _=require(_0x4843('0x0'));var util=require(_0x4843('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4843('0x2'));var fs=require('fs');var Redis=require(_0x4843('0x3'));var db=require(_0x4843('0x4'))['db'];var utils=require(_0x4843('0x5'));var logger=require(_0x4843('0x6'))(_0x4843('0x7'));var config=require(_0x4843('0x8'));var jayson=require(_0x4843('0x9'));var client=jayson[_0x4843('0xa')][_0x4843('0xb')]({'port':0x232a});config['redis']=_[_0x4843('0xc')](config[_0x4843('0xd')],{'host':_0x4843('0xe'),'port':0x18eb});var socket=require(_0x4843('0xf'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x4843('0x10')](socket);function respondWithRpcPromise(_0x843b83,_0x3a4201,_0x37c0ac){return new BPromise(function(_0x173bcb,_0xa489ad){return client[_0x4843('0x11')](_0x843b83,_0x37c0ac)[_0x4843('0x12')](function(_0x4ef44b){logger[_0x4843('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x3a4201,_0x4843('0x14'));logger['debug'](_0x4843('0x15'),_0x3a4201,_0x4843('0x14'),JSON[_0x4843('0x16')](_0x4ef44b));if(_0x4ef44b[_0x4843('0x17')]){if(_0x4ef44b[_0x4843('0x17')]['code']===0x1f4){logger['error'](_0x4843('0x18'),_0x3a4201,_0x4ef44b['error'][_0x4843('0x19')]);return _0xa489ad(_0x4ef44b['error'][_0x4843('0x19')]);}logger[_0x4843('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x3a4201,_0x4ef44b[_0x4843('0x17')][_0x4843('0x19')]);return _0x173bcb(_0x4ef44b['error'][_0x4843('0x19')]);}else{logger[_0x4843('0x13')](_0x4843('0x18'),_0x3a4201,_0x4843('0x14'));_0x173bcb(_0x4ef44b[_0x4843('0x1a')][_0x4843('0x19')]);}})[_0x4843('0x1b')](function(_0x4a78a7){logger[_0x4843('0x17')](_0x4843('0x18'),_0x3a4201,_0x4a78a7);_0xa489ad(_0x4a78a7);});});}exports[_0x4843('0x1c')]=function(_0x31aa3d){var _0x24059a=this;return new Promise(function(_0x407128,_0x2b6662){return db[_0x4843('0x1d')][_0x4843('0x1e')]({'raw':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d['options'][_0x4843('0x20')]===undefined?!![]:![]:!![],'where':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d[_0x4843('0x1f')]['where']||null:null,'attributes':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d[_0x4843('0x1f')][_0x4843('0x21')]||null:null,'limit':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d[_0x4843('0x1f')][_0x4843('0x22')]||null:null,'include':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d[_0x4843('0x1f')]['include']?_[_0x4843('0x23')](_0x31aa3d[_0x4843('0x1f')][_0x4843('0x24')],function(_0x5ab4a3){return{'model':db[_0x5ab4a3[_0x4843('0x25')]],'as':_0x5ab4a3['as'],'attributes':_0x5ab4a3[_0x4843('0x21')],'include':_0x5ab4a3[_0x4843('0x24')]?_[_0x4843('0x23')](_0x5ab4a3[_0x4843('0x24')],function(_0x190365){return{'model':db[_0x190365[_0x4843('0x25')]],'as':_0x190365['as'],'attributes':_0x190365['attributes'],'include':_0x190365[_0x4843('0x24')]?_['map'](_0x190365[_0x4843('0x24')],function(_0x593b9e){return{'model':db[_0x593b9e[_0x4843('0x25')]],'as':_0x593b9e['as'],'attributes':_0x593b9e['attributes']};}):[]};}):[]};}):[]:[]})[_0x4843('0x12')](function(_0x5cd402){logger[_0x4843('0x13')](_0x4843('0x1c'),_0x31aa3d);logger[_0x4843('0x26')]('GetOpenchannelQueue',_0x31aa3d,JSON[_0x4843('0x16')](_0x5cd402));_0x407128(_0x5cd402);})[_0x4843('0x1b')](function(_0x47a40e){logger['error'](_0x4843('0x1c'),_0x47a40e[_0x4843('0x19')],_0x31aa3d);_0x2b6662(_0x24059a['error'](0x1f4,_0x47a40e[_0x4843('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x181c69){var _0x47ea46=this;return new Promise(function(_0x2ebd52,_0x5c9074){return db[_0x4843('0x1d')][_0x4843('0x27')]({'raw':_0x181c69[_0x4843('0x1f')]?_0x181c69['options']['raw']===undefined?!![]:![]:!![],'where':_0x181c69['options']?_0x181c69[_0x4843('0x1f')][_0x4843('0x28')]||null:null,'attributes':_0x181c69[_0x4843('0x1f')]?_0x181c69['options'][_0x4843('0x21')]||null:null,'include':_0x181c69[_0x4843('0x1f')]?_0x181c69[_0x4843('0x1f')][_0x4843('0x24')]?_[_0x4843('0x23')](_0x181c69[_0x4843('0x1f')][_0x4843('0x24')],function(_0x375223){return{'model':db[_0x375223[_0x4843('0x25')]],'as':_0x375223['as'],'attributes':_0x375223[_0x4843('0x21')],'include':_0x375223[_0x4843('0x24')]?_['map'](_0x375223[_0x4843('0x24')],function(_0xd70253){return{'model':db[_0xd70253[_0x4843('0x25')]],'as':_0xd70253['as'],'attributes':_0xd70253[_0x4843('0x21')],'include':_0xd70253[_0x4843('0x24')]?_['map'](_0xd70253[_0x4843('0x24')],function(_0x1a89e9){return{'model':db[_0x1a89e9[_0x4843('0x25')]],'as':_0x1a89e9['as'],'attributes':_0x1a89e9[_0x4843('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4843('0x12')](function(_0x183ab1){logger['info']('ShowOpenchannelQueue',_0x181c69);logger['debug']('ShowOpenchannelQueue',_0x181c69,JSON[_0x4843('0x16')](_0x183ab1));_0x2ebd52(_0x183ab1);})[_0x4843('0x1b')](function(_0x1ff3c3){logger['error'](_0x4843('0x29'),_0x1ff3c3[_0x4843('0x19')],_0x181c69);_0x5c9074(_0x47ea46[_0x4843('0x17')](0x1f4,_0x1ff3c3[_0x4843('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 7942756..b404124 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 _0x7b3b=['emit','register','length','openchannelQueue:','remove','update'];(function(_0x1e79b9,_0x223ef3){var _0x2c2d29=function(_0x4573aa){while(--_0x4573aa){_0x1e79b9['push'](_0x1e79b9['shift']());}};_0x2c2d29(++_0x223ef3);}(_0x7b3b,0x178));var _0xb7b3=function(_0x4818c2,_0x34e65b){_0x4818c2=_0x4818c2-0x0;var _0x442d78=_0x7b3b[_0x4818c2];return _0x442d78;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xb7b3('0x0'),_0xb7b3('0x1')];function createListener(_0x5388d5,_0x54270b){return function(_0x2fccbb){_0x54270b[_0xb7b3('0x2')](_0x5388d5,_0x2fccbb);};}function removeListener(_0x6f71ca,_0xc34bc4){return function(){OpenchannelQueueEvents['removeListener'](_0x6f71ca,_0xc34bc4);};}exports[_0xb7b3('0x3')]=function(_0x576e49){for(var _0x332bc5=0x0,_0x44db92=events[_0xb7b3('0x4')];_0x332bc5<_0x44db92;_0x332bc5++){var _0x4156b1=events[_0x332bc5];var _0x495cbe=createListener(_0xb7b3('0x5')+_0x4156b1,_0x576e49);OpenchannelQueueEvents['on'](_0x4156b1,_0x495cbe);}}; \ No newline at end of file +var _0x9897=['update','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0x2f8255,_0x44ff85){var _0x2207f6=function(_0x30c5c2){while(--_0x30c5c2){_0x2f8255['push'](_0x2f8255['shift']());}};_0x2207f6(++_0x44ff85);}(_0x9897,0xc5));var _0x7989=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x9897[_0x4d8ed9];return _0x1e2140;};'use strict';var OpenchannelQueueEvents=require(_0x7989('0x0'));var events=[_0x7989('0x1'),_0x7989('0x2'),_0x7989('0x3')];function createListener(_0x15e5c0,_0x22fead){return function(_0x2bd955){_0x22fead[_0x7989('0x4')](_0x15e5c0,_0x2bd955);};}function removeListener(_0x1dbcb6,_0x368211){return function(){OpenchannelQueueEvents[_0x7989('0x5')](_0x1dbcb6,_0x368211);};}exports['register']=function(_0x4ca49d){for(var _0x20696e=0x0,_0x5340cc=events[_0x7989('0x6')];_0x20696e<_0x5340cc;_0x20696e++){var _0x5c3547=events[_0x20696e];var _0x243ba9=createListener(_0x7989('0x7')+_0x5c3547,_0x4ca49d);OpenchannelQueueEvents['on'](_0x5c3547,_0x243ba9);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 83c3cd8..53c6431 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 _0x0bcd=['delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update'];(function(_0x57ec30,_0x45e26c){var _0x27827e=function(_0x5abfac){while(--_0x5abfac){_0x57ec30['push'](_0x57ec30['shift']());}};_0x27827e(++_0x45e26c);}(_0x0bcd,0x9a));var _0xd0bc=function(_0x56bf97,_0x31506a){_0x56bf97=_0x56bf97-0x0;var _0x1071ee=_0x0bcd[_0x56bf97];return _0x1071ee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd0bc('0x0'));var timeout=require(_0xd0bc('0x1'));var express=require(_0xd0bc('0x2'));var router=express[_0xd0bc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd0bc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd0bc('0x5'));var controller=require(_0xd0bc('0x6'));router[_0xd0bc('0x7')]('/',auth[_0xd0bc('0x8')](),controller[_0xd0bc('0x9')]);router[_0xd0bc('0x7')](_0xd0bc('0xa'),auth['isAuthenticated'](),controller[_0xd0bc('0xb')]);router[_0xd0bc('0x7')]('/:id',auth[_0xd0bc('0x8')](),controller['show']);router[_0xd0bc('0xc')]('/',auth[_0xd0bc('0x8')](),controller[_0xd0bc('0xd')]);router[_0xd0bc('0xe')](_0xd0bc('0xf'),auth[_0xd0bc('0x8')](),controller[_0xd0bc('0x10')]);router[_0xd0bc('0x11')]('/:id',auth[_0xd0bc('0x8')](),controller[_0xd0bc('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8f73=['./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4fbba2,_0xc4dde5){var _0x36569b=function(_0x46d1e6){while(--_0x46d1e6){_0x4fbba2['push'](_0x4fbba2['shift']());}};_0x36569b(++_0xc4dde5);}(_0x8f73,0x1e6));var _0x38f7=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x8f73[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0x38f7('0x0'));var util=require(_0x38f7('0x1'));var path=require(_0x38f7('0x2'));var timeout=require(_0x38f7('0x3'));var express=require(_0x38f7('0x4'));var router=express['Router']();var fs_extra=require(_0x38f7('0x5'));var auth=require(_0x38f7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x38f7('0x7'));var controller=require(_0x38f7('0x8'));router[_0x38f7('0x9')]('/',auth['isAuthenticated'](),controller[_0x38f7('0xa')]);router[_0x38f7('0x9')](_0x38f7('0xb'),auth[_0x38f7('0xc')](),controller[_0x38f7('0xd')]);router[_0x38f7('0x9')](_0x38f7('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x38f7('0xf')]('/',auth['isAuthenticated'](),controller[_0x38f7('0x10')]);router[_0x38f7('0x11')](_0x38f7('0xe'),auth[_0x38f7('0xc')](),controller['update']);router[_0x38f7('0x12')](_0x38f7('0xe'),auth[_0x38f7('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index dc790fe..b8614c3 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 _0x05bc=['moment','sequelize','exports','STRING','DATE'];(function(_0x5f2a50,_0x4700e0){var _0x7577ca=function(_0x45f47e){while(--_0x45f47e){_0x5f2a50['push'](_0x5f2a50['shift']());}};_0x7577ca(++_0x4700e0);}(_0x05bc,0x109));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xc05b('0x0'));var Sequelize=require(_0xc05b('0x1'));module[_0xc05b('0x2')]={'uniqueid':{'type':Sequelize[_0xc05b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc05b('0x3')]},'joinAt':{'type':Sequelize[_0xc05b('0x4')]},'leaveAt':{'type':Sequelize[_0xc05b('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc05b('0x3')]}}; \ No newline at end of file +var _0xfe9d=['STRING','DATE','moment','sequelize','exports'];(function(_0x4aaa10,_0x1dd1d3){var _0x23202d=function(_0x4fc131){while(--_0x4fc131){_0x4aaa10['push'](_0x4aaa10['shift']());}};_0x23202d(++_0x1dd1d3);}(_0xfe9d,0x1a1));var _0xdfe9=function(_0x1a6b00,_0x18f4d6){_0x1a6b00=_0x1a6b00-0x0;var _0x5dbb28=_0xfe9d[_0x1a6b00];return _0x5dbb28;};'use strict';var moment=require(_0xdfe9('0x0'));var Sequelize=require(_0xdfe9('0x1'));module[_0xdfe9('0x2')]={'uniqueid':{'type':Sequelize[_0xdfe9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdfe9('0x3')]},'joinAt':{'type':Sequelize[_0xdfe9('0x4')]},'leaveAt':{'type':Sequelize[_0xdfe9('0x4')]},'acceptAt':{'type':Sequelize[_0xdfe9('0x4')]},'exitAt':{'type':Sequelize[_0xdfe9('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index fec85ff..bdb2127 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 _0x9e01=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','stack','name','index','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','include','rows','show','includeAll','find','catch','create','update','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','api'];(function(_0x3a9c63,_0x324482){var _0x503047=function(_0xa35ab3){while(--_0xa35ab3){_0x3a9c63['push'](_0x3a9c63['shift']());}};_0x503047(++_0x324482);}(_0x9e01,0x197));var _0x19e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9e01[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x19e0('0x0'));var jsonpatch=require(_0x19e0('0x1'));var rp=require(_0x19e0('0x2'));var moment=require(_0x19e0('0x3'));var BPromise=require(_0x19e0('0x4'));var Mustache=require(_0x19e0('0x5'));var util=require(_0x19e0('0x6'));var path=require(_0x19e0('0x7'));var sox=require(_0x19e0('0x8'));var csv=require(_0x19e0('0x9'));var ejs=require(_0x19e0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x19e0('0xb'));var squel=require(_0x19e0('0xc'));var crypto=require(_0x19e0('0xd'));var jsforce=require(_0x19e0('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x19e0('0xf'));var Redis=require('ioredis');var authService=require(_0x19e0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19e0('0x11'));var logger=require('../../config/logger')(_0x19e0('0x12'));var utils=require('../../config/utils');var config=require(_0x19e0('0x13'));var licenseUtil=require(_0x19e0('0x14'));var db=require(_0x19e0('0x15'))['db'];function respondWithStatusCode(_0x46ab5c,_0x37f21e){_0x37f21e=_0x37f21e||0xcc;return function(_0x31f27c){if(_0x31f27c){return _0x46ab5c[_0x19e0('0x16')](_0x37f21e);}return _0x46ab5c[_0x19e0('0x17')](_0x37f21e)[_0x19e0('0x18')]();};}function respondWithResult(_0x41d303,_0x56534e){_0x56534e=_0x56534e||0xc8;return function(_0x19af99){if(_0x19af99){return _0x41d303[_0x19e0('0x17')](_0x56534e)[_0x19e0('0x19')](_0x19af99);}};}function respondWithFilteredResult(_0x3cfe3c,_0x173fd7){return function(_0x104a54){if(_0x104a54){var _0x1e964a=typeof _0x173fd7[_0x19e0('0x1a')]===_0x19e0('0x1b')&&typeof _0x173fd7[_0x19e0('0x1c')]===_0x19e0('0x1b');var _0x35a8a3=_0x104a54['count'];var _0x429b67=_0x1e964a?0x0:_0x173fd7[_0x19e0('0x1a')];var _0x2553cf=_0x1e964a?_0x104a54[_0x19e0('0x1d')]:_0x173fd7[_0x19e0('0x1a')]+_0x173fd7[_0x19e0('0x1c')];var _0xf7a437;if(_0x2553cf>=_0x35a8a3){_0x2553cf=_0x35a8a3;_0xf7a437=0xc8;}else{_0xf7a437=0xce;}_0x3cfe3c[_0x19e0('0x17')](_0xf7a437);return _0x3cfe3c[_0x19e0('0x1e')](_0x19e0('0x1f'),_0x429b67+'-'+_0x2553cf+'/'+_0x35a8a3)[_0x19e0('0x19')](_0x104a54);}return null;};}function patchUpdates(_0x44c952){return function(_0x5ac502){try{jsonpatch[_0x19e0('0x20')](_0x5ac502,_0x44c952,!![]);}catch(_0x3d0c13){return BPromise['reject'](_0x3d0c13);}return _0x5ac502['save']();};}function saveUpdates(_0x4cf5d3,_0xe89417){return function(_0x42abaa){if(_0x42abaa){return _0x42abaa['update'](_0x4cf5d3)[_0x19e0('0x21')](function(_0x31030b){return _0x31030b;});}return null;};}function removeEntity(_0x9c40d8,_0x1f9d74){return function(_0x53ad9c){if(_0x53ad9c){return _0x53ad9c[_0x19e0('0x22')]()[_0x19e0('0x21')](function(){_0x9c40d8[_0x19e0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc8be,_0x34389c){return function(_0x5efaba){if(!_0x5efaba){_0x4fc8be['sendStatus'](0x194);}return _0x5efaba;};}function handleError(_0x276b2e,_0x5dea7f){_0x5dea7f=_0x5dea7f||0x1f4;return function(_0x6d99af){logger[_0x19e0('0x23')](_0x6d99af[_0x19e0('0x24')]);if(_0x6d99af[_0x19e0('0x25')]){delete _0x6d99af[_0x19e0('0x25')];}_0x276b2e[_0x19e0('0x17')](_0x5dea7f)['send'](_0x6d99af);};}exports[_0x19e0('0x26')]=function(_0x56bf96,_0xf38fb0){var _0x19cd4f={},_0x503bda={},_0x3c89be={'count':0x0,'rows':[]};var _0x2ca18b=_['map'](db[_0x19e0('0x27')][_0x19e0('0x28')],function(_0x52e485){return{'name':_0x52e485[_0x19e0('0x29')],'type':_0x52e485[_0x19e0('0x2a')][_0x19e0('0x2b')]};});_0x503bda[_0x19e0('0x2c')]=_[_0x19e0('0x2d')](_0x2ca18b,'name');_0x503bda[_0x19e0('0x2e')]=_[_0x19e0('0x2f')](_0x56bf96[_0x19e0('0x2e')]);_0x503bda[_0x19e0('0x30')]=_[_0x19e0('0x31')](_0x503bda['model'],_0x503bda['query']);_0x19cd4f['attributes']=_['intersection'](_0x503bda[_0x19e0('0x2c')],qs[_0x19e0('0x32')](_0x56bf96[_0x19e0('0x2e')][_0x19e0('0x32')]));_0x19cd4f[_0x19e0('0x33')]=_0x19cd4f['attributes'][_0x19e0('0x34')]?_0x19cd4f[_0x19e0('0x33')]:_0x503bda[_0x19e0('0x2c')];if(!_0x56bf96[_0x19e0('0x2e')][_0x19e0('0x35')]('nolimit')){_0x19cd4f['limit']=qs[_0x19e0('0x1c')](_0x56bf96[_0x19e0('0x2e')]['limit']);_0x19cd4f[_0x19e0('0x1a')]=qs[_0x19e0('0x1a')](_0x56bf96[_0x19e0('0x2e')][_0x19e0('0x1a')]);}_0x19cd4f[_0x19e0('0x36')]=qs['sort'](_0x56bf96[_0x19e0('0x2e')][_0x19e0('0x37')]);_0x19cd4f['where']=qs[_0x19e0('0x30')](_[_0x19e0('0x38')](_0x56bf96[_0x19e0('0x2e')],_0x503bda[_0x19e0('0x30')]),_0x2ca18b);if(_0x56bf96[_0x19e0('0x2e')]['filter']){_0x19cd4f[_0x19e0('0x39')]=_[_0x19e0('0x3a')](_0x19cd4f['where'],{'$or':_[_0x19e0('0x2d')](_0x2ca18b,function(_0x185764){if(_0x185764['type']!=='VIRTUAL'){var _0x52408e={};_0x52408e[_0x185764['name']]={'$like':'%'+_0x56bf96[_0x19e0('0x2e')][_0x19e0('0x3b')]+'%'};return _0x52408e;}})});}_0x19cd4f=_[_0x19e0('0x3a')]({},_0x19cd4f,_0x56bf96[_0x19e0('0x3c')]);var _0x485068={'where':_0x19cd4f['where']};return db['OpenchannelQueueReport'][_0x19e0('0x1d')](_0x485068)[_0x19e0('0x21')](function(_0x5f5077){_0x3c89be[_0x19e0('0x1d')]=_0x5f5077;if(_0x56bf96[_0x19e0('0x2e')]['includeAll']){_0x19cd4f[_0x19e0('0x3d')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x19cd4f);})[_0x19e0('0x21')](function(_0x44c4ee){_0x3c89be[_0x19e0('0x3e')]=_0x44c4ee;return _0x3c89be;})[_0x19e0('0x21')](respondWithFilteredResult(_0xf38fb0,_0x19cd4f))['catch'](handleError(_0xf38fb0,null));};exports[_0x19e0('0x3f')]=function(_0x4138d7,_0xeabdd){var _0x470b40={'raw':!![],'where':{'id':_0x4138d7['params']['id']}},_0x57bd75={};_0x57bd75[_0x19e0('0x2c')]=_[_0x19e0('0x2f')](db[_0x19e0('0x27')][_0x19e0('0x28')]);_0x57bd75[_0x19e0('0x2e')]=_[_0x19e0('0x2f')](_0x4138d7[_0x19e0('0x2e')]);_0x57bd75['filters']=_[_0x19e0('0x31')](_0x57bd75[_0x19e0('0x2c')],_0x57bd75[_0x19e0('0x2e')]);_0x470b40['attributes']=_[_0x19e0('0x31')](_0x57bd75[_0x19e0('0x2c')],qs[_0x19e0('0x32')](_0x4138d7[_0x19e0('0x2e')][_0x19e0('0x32')]));_0x470b40[_0x19e0('0x33')]=_0x470b40[_0x19e0('0x33')][_0x19e0('0x34')]?_0x470b40[_0x19e0('0x33')]:_0x57bd75['model'];if(_0x4138d7[_0x19e0('0x2e')][_0x19e0('0x40')]){_0x470b40[_0x19e0('0x3d')]=[{'all':!![]}];}_0x470b40=_['merge']({},_0x470b40,_0x4138d7['options']);return db[_0x19e0('0x27')][_0x19e0('0x41')](_0x470b40)[_0x19e0('0x21')](handleEntityNotFound(_0xeabdd,null))['then'](respondWithResult(_0xeabdd,null))[_0x19e0('0x42')](handleError(_0xeabdd,null));};exports['create']=function(_0x508284,_0x29014d){return db[_0x19e0('0x27')][_0x19e0('0x43')](_0x508284['body'],{})[_0x19e0('0x21')](respondWithResult(_0x29014d,0xc9))[_0x19e0('0x42')](handleError(_0x29014d,null));};exports[_0x19e0('0x44')]=function(_0x27d8fb,_0x35a8b0){if(_0x27d8fb['body']['id']){delete _0x27d8fb[_0x19e0('0x45')]['id'];}return db[_0x19e0('0x27')][_0x19e0('0x41')]({'where':{'id':_0x27d8fb[_0x19e0('0x46')]['id']}})[_0x19e0('0x21')](handleEntityNotFound(_0x35a8b0,null))[_0x19e0('0x21')](saveUpdates(_0x27d8fb[_0x19e0('0x45')],null))['then'](respondWithResult(_0x35a8b0,null))[_0x19e0('0x42')](handleError(_0x35a8b0,null));};exports[_0x19e0('0x22')]=function(_0x1f4194,_0x2f9673){return db[_0x19e0('0x27')][_0x19e0('0x41')]({'where':{'id':_0x1f4194['params']['id']}})[_0x19e0('0x21')](handleEntityNotFound(_0x2f9673,null))[_0x19e0('0x21')](removeEntity(_0x2f9673,null))[_0x19e0('0x42')](handleError(_0x2f9673,null));};exports['describe']=function(_0x2e35f9,_0x474521){return db[_0x19e0('0x27')]['describe']()[_0x19e0('0x21')](respondWithResult(_0x474521,null))[_0x19e0('0x42')](handleError(_0x474521,null));}; \ No newline at end of file +var _0x4be4=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','findAll','rows','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring'];(function(_0x5f2ed0,_0xaf721b){var _0x4f2eed=function(_0x251648){while(--_0x251648){_0x5f2ed0['push'](_0x5f2ed0['shift']());}};_0x4f2eed(++_0xaf721b);}(_0x4be4,0x168));var _0x44be=function(_0x28cde3,_0x5d4fc6){_0x28cde3=_0x28cde3-0x0;var _0x2dba45=_0x4be4[_0x28cde3];return _0x2dba45;};'use strict';var emlformat=require(_0x44be('0x0'));var rimraf=require(_0x44be('0x1'));var zipdir=require(_0x44be('0x2'));var jsonpatch=require(_0x44be('0x3'));var rp=require(_0x44be('0x4'));var moment=require(_0x44be('0x5'));var BPromise=require(_0x44be('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x44be('0x7'));var sox=require(_0x44be('0x8'));var csv=require(_0x44be('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44be('0xa'));var squel=require(_0x44be('0xb'));var crypto=require(_0x44be('0xc'));var jsforce=require(_0x44be('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44be('0xe'));var Papa=require(_0x44be('0xf'));var Redis=require('ioredis');var authService=require(_0x44be('0x10'));var qs=require(_0x44be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44be('0x12'));var logger=require(_0x44be('0x13'))(_0x44be('0x14'));var utils=require(_0x44be('0x15'));var config=require(_0x44be('0x16'));var licenseUtil=require(_0x44be('0x17'));var db=require(_0x44be('0x18'))['db'];function respondWithStatusCode(_0x4596ca,_0x155636){_0x155636=_0x155636||0xcc;return function(_0x427552){if(_0x427552){return _0x4596ca['sendStatus'](_0x155636);}return _0x4596ca[_0x44be('0x19')](_0x155636)[_0x44be('0x1a')]();};}function respondWithResult(_0x418ab4,_0x44985f){_0x44985f=_0x44985f||0xc8;return function(_0x37039d){if(_0x37039d){return _0x418ab4['status'](_0x44985f)[_0x44be('0x1b')](_0x37039d);}};}function respondWithFilteredResult(_0x5891eb,_0x3ab5d6){return function(_0x20943c){if(_0x20943c){var _0x592205=typeof _0x3ab5d6[_0x44be('0x1c')]===_0x44be('0x1d')&&typeof _0x3ab5d6[_0x44be('0x1e')]===_0x44be('0x1d');var _0xa1e8dc=_0x20943c['count'];var _0x14dad5=_0x592205?0x0:_0x3ab5d6[_0x44be('0x1c')];var _0x472609=_0x592205?_0x20943c[_0x44be('0x1f')]:_0x3ab5d6['offset']+_0x3ab5d6[_0x44be('0x1e')];var _0x567440;if(_0x472609>=_0xa1e8dc){_0x472609=_0xa1e8dc;_0x567440=0xc8;}else{_0x567440=0xce;}_0x5891eb['status'](_0x567440);return _0x5891eb[_0x44be('0x20')](_0x44be('0x21'),_0x14dad5+'-'+_0x472609+'/'+_0xa1e8dc)[_0x44be('0x1b')](_0x20943c);}return null;};}function patchUpdates(_0x3bb892){return function(_0x1c7219){try{jsonpatch[_0x44be('0x22')](_0x1c7219,_0x3bb892,!![]);}catch(_0x8afb2e){return BPromise[_0x44be('0x23')](_0x8afb2e);}return _0x1c7219['save']();};}function saveUpdates(_0x371b1a,_0x410acb){return function(_0x3797a1){if(_0x3797a1){return _0x3797a1[_0x44be('0x24')](_0x371b1a)[_0x44be('0x25')](function(_0x4fceea){return _0x4fceea;});}return null;};}function removeEntity(_0x4c1313,_0x5d9406){return function(_0x5eb665){if(_0x5eb665){return _0x5eb665[_0x44be('0x26')]()[_0x44be('0x25')](function(){_0x4c1313[_0x44be('0x19')](0xcc)[_0x44be('0x1a')]();});}};}function handleEntityNotFound(_0x4e62fb,_0x13ead4){return function(_0x47c1e5){if(!_0x47c1e5){_0x4e62fb[_0x44be('0x27')](0x194);}return _0x47c1e5;};}function handleError(_0x407042,_0x157809){_0x157809=_0x157809||0x1f4;return function(_0x3214aa){logger[_0x44be('0x28')](_0x3214aa[_0x44be('0x29')]);if(_0x3214aa[_0x44be('0x2a')]){delete _0x3214aa[_0x44be('0x2a')];}_0x407042[_0x44be('0x19')](_0x157809)['send'](_0x3214aa);};}exports['index']=function(_0x13db24,_0x5be5af){var _0x184fab={},_0x19f758={},_0x2f1918={'count':0x0,'rows':[]};var _0x2a0e7f=_[_0x44be('0x2b')](db['OpenchannelQueueReport'][_0x44be('0x2c')],function(_0x12e090){return{'name':_0x12e090[_0x44be('0x2d')],'type':_0x12e090[_0x44be('0x2e')]['key']};});_0x19f758[_0x44be('0x2f')]=_[_0x44be('0x2b')](_0x2a0e7f,'name');_0x19f758['query']=_[_0x44be('0x30')](_0x13db24[_0x44be('0x31')]);_0x19f758[_0x44be('0x32')]=_[_0x44be('0x33')](_0x19f758['model'],_0x19f758[_0x44be('0x31')]);_0x184fab[_0x44be('0x34')]=_[_0x44be('0x33')](_0x19f758[_0x44be('0x2f')],qs[_0x44be('0x35')](_0x13db24[_0x44be('0x31')][_0x44be('0x35')]));_0x184fab['attributes']=_0x184fab[_0x44be('0x34')][_0x44be('0x36')]?_0x184fab[_0x44be('0x34')]:_0x19f758[_0x44be('0x2f')];if(!_0x13db24[_0x44be('0x31')][_0x44be('0x37')]('nolimit')){_0x184fab[_0x44be('0x1e')]=qs[_0x44be('0x1e')](_0x13db24[_0x44be('0x31')][_0x44be('0x1e')]);_0x184fab['offset']=qs['offset'](_0x13db24['query'][_0x44be('0x1c')]);}_0x184fab[_0x44be('0x38')]=qs[_0x44be('0x39')](_0x13db24['query'][_0x44be('0x39')]);_0x184fab[_0x44be('0x3a')]=qs[_0x44be('0x32')](_[_0x44be('0x3b')](_0x13db24['query'],_0x19f758[_0x44be('0x32')]),_0x2a0e7f);if(_0x13db24[_0x44be('0x31')][_0x44be('0x3c')]){_0x184fab[_0x44be('0x3a')]=_[_0x44be('0x3d')](_0x184fab[_0x44be('0x3a')],{'$or':_[_0x44be('0x2b')](_0x2a0e7f,function(_0x35c7a3){if(_0x35c7a3[_0x44be('0x2e')]!==_0x44be('0x3e')){var _0xe36dba={};_0xe36dba[_0x35c7a3[_0x44be('0x2a')]]={'$like':'%'+_0x13db24[_0x44be('0x31')][_0x44be('0x3c')]+'%'};return _0xe36dba;}})});}_0x184fab=_[_0x44be('0x3d')]({},_0x184fab,_0x13db24[_0x44be('0x3f')]);var _0x38834c={'where':_0x184fab[_0x44be('0x3a')]};return db[_0x44be('0x40')][_0x44be('0x1f')](_0x38834c)[_0x44be('0x25')](function(_0x3c03a6){_0x2f1918[_0x44be('0x1f')]=_0x3c03a6;if(_0x13db24[_0x44be('0x31')]['includeAll']){_0x184fab['include']=[{'all':!![]}];}return db[_0x44be('0x40')][_0x44be('0x41')](_0x184fab);})[_0x44be('0x25')](function(_0x3fa0c4){_0x2f1918[_0x44be('0x42')]=_0x3fa0c4;return _0x2f1918;})['then'](respondWithFilteredResult(_0x5be5af,_0x184fab))['catch'](handleError(_0x5be5af,null));};exports[_0x44be('0x43')]=function(_0xd1b1ad,_0x2a0a39){var _0x145645={'raw':!![],'where':{'id':_0xd1b1ad[_0x44be('0x44')]['id']}},_0x590187={};_0x590187[_0x44be('0x2f')]=_[_0x44be('0x30')](db[_0x44be('0x40')][_0x44be('0x2c')]);_0x590187['query']=_[_0x44be('0x30')](_0xd1b1ad[_0x44be('0x31')]);_0x590187['filters']=_[_0x44be('0x33')](_0x590187[_0x44be('0x2f')],_0x590187[_0x44be('0x31')]);_0x145645['attributes']=_[_0x44be('0x33')](_0x590187[_0x44be('0x2f')],qs[_0x44be('0x35')](_0xd1b1ad[_0x44be('0x31')][_0x44be('0x35')]));_0x145645[_0x44be('0x34')]=_0x145645['attributes'][_0x44be('0x36')]?_0x145645[_0x44be('0x34')]:_0x590187[_0x44be('0x2f')];if(_0xd1b1ad[_0x44be('0x31')][_0x44be('0x45')]){_0x145645['include']=[{'all':!![]}];}_0x145645=_[_0x44be('0x3d')]({},_0x145645,_0xd1b1ad['options']);return db['OpenchannelQueueReport'][_0x44be('0x46')](_0x145645)[_0x44be('0x25')](handleEntityNotFound(_0x2a0a39,null))[_0x44be('0x25')](respondWithResult(_0x2a0a39,null))[_0x44be('0x47')](handleError(_0x2a0a39,null));};exports[_0x44be('0x48')]=function(_0xb98a65,_0x1c4c17){return db[_0x44be('0x40')][_0x44be('0x48')](_0xb98a65[_0x44be('0x49')],{})[_0x44be('0x25')](respondWithResult(_0x1c4c17,0xc9))['catch'](handleError(_0x1c4c17,null));};exports['update']=function(_0x18af1b,_0x13ca44){if(_0x18af1b[_0x44be('0x49')]['id']){delete _0x18af1b[_0x44be('0x49')]['id'];}return db[_0x44be('0x40')][_0x44be('0x46')]({'where':{'id':_0x18af1b[_0x44be('0x44')]['id']}})[_0x44be('0x25')](handleEntityNotFound(_0x13ca44,null))[_0x44be('0x25')](saveUpdates(_0x18af1b[_0x44be('0x49')],null))[_0x44be('0x25')](respondWithResult(_0x13ca44,null))[_0x44be('0x47')](handleError(_0x13ca44,null));};exports[_0x44be('0x26')]=function(_0x5dd4da,_0x3ea877){return db[_0x44be('0x40')]['find']({'where':{'id':_0x5dd4da[_0x44be('0x44')]['id']}})[_0x44be('0x25')](handleEntityNotFound(_0x3ea877,null))[_0x44be('0x25')](removeEntity(_0x3ea877,null))[_0x44be('0x47')](handleError(_0x3ea877,null));};exports['describe']=function(_0x3ce32d,_0x3c46e8){return db[_0x44be('0x40')][_0x44be('0x4a')]()['then'](respondWithResult(_0x3c46e8,null))[_0x44be('0x47')](handleError(_0x3c46e8,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 07728cf..7c7fc89 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x3d0657,_0x3bb132){var _0x133ea8=function(_0x1d44b6){while(--_0x1d44b6){_0x3d0657['push'](_0x3d0657['shift']());}};_0x133ea8(++_0x3bb132);}(_0x326f,0xd1));var _0xf326=function(_0x140dda,_0x4931f1){_0x140dda=_0x140dda-0x0;var _0x12f424=_0x326f[_0x140dda];return _0x12f424;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x42abed,_0x4bca02){var _0x2dcbf0=function(_0x5eb843){while(--_0x5eb843){_0x42abed['push'](_0x42abed['shift']());}};_0x2dcbf0(++_0x4bca02);}(_0x5fc3,0xa8));var _0x35fc=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x5fc3[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index ed9294a..0402555 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 _0x4024=['http','request','info','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','debug','UpdateOpenchannelQueueReport','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x4024,0x89));var _0x4402=function(_0x2ae429,_0x589a76){_0x2ae429=_0x2ae429-0x0;var _0x3b251c=_0x4024[_0x2ae429];return _0x3b251c;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168acd,_0x4ed77d,_0x3045ae){return new BPromise(function(_0x5d7ca4,_0x5c0b70){return client[_0x4402('0x9')](_0x168acd,_0x3045ae)['then'](function(_0x4d2882){logger[_0x4402('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4ed77d,_0x4402('0xb'));logger['debug'](_0x4402('0xc'),_0x4ed77d,'request\x20sent',JSON[_0x4402('0xd')](_0x4d2882));if(_0x4d2882[_0x4402('0xe')]){if(_0x4d2882['error'][_0x4402('0xf')]===0x1f4){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882['error'][_0x4402('0x11')]);return _0x5c0b70(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);return _0x5d7ca4(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}else{logger[_0x4402('0xa')](_0x4402('0x10'),_0x4ed77d,_0x4402('0xb'));_0x5d7ca4(_0x4d2882[_0x4402('0x12')][_0x4402('0x11')]);}})[_0x4402('0x13')](function(_0x30c390){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x30c390);_0x5c0b70(_0x30c390);});});}exports[_0x4402('0x14')]=function(_0x231382){var _0x5b127f=this;return new Promise(function(_0x494389,_0x663ab7){return db[_0x4402('0x15')]['create'](_0x231382[_0x4402('0x16')],{'raw':_0x231382[_0x4402('0x17')]?_0x231382['options'][_0x4402('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55cc8c){logger[_0x4402('0xa')](_0x4402('0x14'),_0x231382);logger[_0x4402('0x19')]('CreateOpenchannelQueueReport',_0x231382,JSON[_0x4402('0xd')](_0x55cc8c));_0x494389(_0x55cc8c);})['catch'](function(_0x47ab54){logger[_0x4402('0xe')](_0x4402('0x14'),_0x47ab54[_0x4402('0x11')],_0x231382);_0x663ab7(_0x5b127f[_0x4402('0xe')](0x1f4,_0x47ab54[_0x4402('0x11')]));});});};exports[_0x4402('0x1a')]=function(_0x289a3e){var _0x6b1fc5=this;return new Promise(function(_0x24a9b8,_0x4d6846){return db[_0x4402('0x15')]['update'](_0x289a3e[_0x4402('0x16')],{'raw':_0x289a3e[_0x4402('0x17')]?_0x289a3e[_0x4402('0x17')][_0x4402('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x289a3e['options']?_0x289a3e[_0x4402('0x17')]['where']||null:null,'attributes':_0x289a3e['options']?_0x289a3e[_0x4402('0x17')][_0x4402('0x1b')]||null:null,'limit':_0x289a3e[_0x4402('0x17')]?_0x289a3e[_0x4402('0x17')][_0x4402('0x1c')]||null:null})['then'](function(_0x41de44){logger['info'](_0x4402('0x1a'),_0x289a3e);logger[_0x4402('0x19')](_0x4402('0x1a'),_0x289a3e,JSON['stringify'](_0x41de44));_0x24a9b8(_0x41de44);})[_0x4402('0x13')](function(_0x6c87f6){logger[_0x4402('0xe')](_0x4402('0x1a'),_0x6c87f6[_0x4402('0x11')],_0x289a3e);_0x4d6846(_0x6b1fc5[_0x4402('0xe')](0x1f4,_0x6c87f6[_0x4402('0x11')]));});});}; \ No newline at end of file +var _0xf7b4=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','OpenchannelQueueReport','create','body','options','then','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','raw','attributes','limit','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0xb09cb8,_0x13f7ce){var _0x235e64=function(_0x2aa4e7){while(--_0x2aa4e7){_0xb09cb8['push'](_0xb09cb8['shift']());}};_0x235e64(++_0x13f7ce);}(_0xf7b4,0x152));var _0x4f7b=function(_0x542d87,_0x3f1428){_0x542d87=_0x542d87-0x0;var _0x18f154=_0xf7b4[_0x542d87];return _0x18f154;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ad135,_0x173784,_0x351036){return new BPromise(function(_0x36ea9c,_0x3ef6e1){return client[_0x4f7b('0xa')](_0x3ad135,_0x351036)['then'](function(_0x433563){logger[_0x4f7b('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x173784,_0x4f7b('0xc'));logger[_0x4f7b('0xd')](_0x4f7b('0xe'),_0x173784,_0x4f7b('0xc'),JSON[_0x4f7b('0xf')](_0x433563));if(_0x433563['error']){if(_0x433563[_0x4f7b('0x10')]['code']===0x1f4){logger['error'](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x3ef6e1(_0x433563[_0x4f7b('0x10')]['message']);}logger[_0x4f7b('0x10')](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x36ea9c(_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);}else{logger[_0x4f7b('0xb')](_0x4f7b('0x11'),_0x173784,_0x4f7b('0xc'));_0x36ea9c(_0x433563[_0x4f7b('0x13')][_0x4f7b('0x12')]);}})[_0x4f7b('0x14')](function(_0x50a161){logger[_0x4f7b('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x173784,_0x50a161);_0x3ef6e1(_0x50a161);});});}exports['CreateOpenchannelQueueReport']=function(_0x24e5cf){var _0x3813da=this;return new Promise(function(_0x519d90,_0x2b34c9){return db[_0x4f7b('0x15')][_0x4f7b('0x16')](_0x24e5cf[_0x4f7b('0x17')],{'raw':_0x24e5cf['options']?_0x24e5cf[_0x4f7b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4f7b('0x19')](function(_0x12374b){logger[_0x4f7b('0xb')](_0x4f7b('0x1a'),_0x24e5cf);logger[_0x4f7b('0xd')](_0x4f7b('0x1a'),_0x24e5cf,JSON[_0x4f7b('0xf')](_0x12374b));_0x519d90(_0x12374b);})[_0x4f7b('0x14')](function(_0x2a8b50){logger['error'](_0x4f7b('0x1a'),_0x2a8b50[_0x4f7b('0x12')],_0x24e5cf);_0x2b34c9(_0x3813da[_0x4f7b('0x10')](0x1f4,_0x2a8b50['message']));});});};exports[_0x4f7b('0x1b')]=function(_0x4610a4){var _0x5d22f4=this;return new Promise(function(_0x15dbec,_0x59ec24){return db[_0x4f7b('0x15')][_0x4f7b('0x1c')](_0x4610a4[_0x4f7b('0x17')],{'raw':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')]['where']||null:null,'attributes':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1e')]||null:null,'limit':_0x4610a4['options']?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1f')]||null:null})[_0x4f7b('0x19')](function(_0x3a56ff){logger[_0x4f7b('0xb')]('UpdateOpenchannelQueueReport',_0x4610a4);logger[_0x4f7b('0xd')](_0x4f7b('0x1b'),_0x4610a4,JSON[_0x4f7b('0xf')](_0x3a56ff));_0x15dbec(_0x3a56ff);})['catch'](function(_0x7de561){logger['error']('UpdateOpenchannelQueueReport',_0x7de561[_0x4f7b('0x12')],_0x4610a4);_0x59ec24(_0x5d22f4['error'](0x1f4,_0x7de561[_0x4f7b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0ba34b9..27e9bbb 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 _0x992f=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','destroy'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x992f,0x1b9));var _0xf992=function(_0x36fc29,_0x4e02aa){_0x36fc29=_0x36fc29-0x0;var _0xab0c=_0x992f[_0x36fc29];return _0xab0c;};'use strict';var multer=require(_0xf992('0x0'));var util=require(_0xf992('0x1'));var path=require(_0xf992('0x2'));var timeout=require(_0xf992('0x3'));var express=require(_0xf992('0x4'));var router=express[_0xf992('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf992('0x6'));var interaction=require(_0xf992('0x7'));var config=require(_0xf992('0x8'));var controller=require(_0xf992('0x9'));router[_0xf992('0xa')]('/',auth[_0xf992('0xb')](),controller[_0xf992('0xc')]);router[_0xf992('0xa')](_0xf992('0xd'),auth[_0xf992('0xb')](),controller[_0xf992('0xe')]);router['get'](_0xf992('0xf'),auth[_0xf992('0xb')](),controller[_0xf992('0x10')]);router[_0xf992('0x11')]('/',auth['isAuthenticated'](),controller[_0xf992('0x12')]);router['put'](_0xf992('0xf'),auth[_0xf992('0xb')](),controller['update']);router[_0xf992('0x13')](_0xf992('0xf'),auth[_0xf992('0xb')](),controller[_0xf992('0x14')]);module[_0xf992('0x15')]=router; \ No newline at end of file +var _0x808a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','multer','util','Router','fs-extra'];(function(_0x23e9e5,_0x262b98){var _0x4d643c=function(_0x1699de){while(--_0x1699de){_0x23e9e5['push'](_0x23e9e5['shift']());}};_0x4d643c(++_0x262b98);}(_0x808a,0x178));var _0xa808=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0x808a[_0x36940e];return _0x3283f2;};'use strict';var multer=require(_0xa808('0x0'));var util=require(_0xa808('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa808('0x2')]();var fs_extra=require(_0xa808('0x3'));var auth=require(_0xa808('0x4'));var interaction=require(_0xa808('0x5'));var config=require(_0xa808('0x6'));var controller=require(_0xa808('0x7'));router[_0xa808('0x8')]('/',auth[_0xa808('0x9')](),controller[_0xa808('0xa')]);router[_0xa808('0x8')](_0xa808('0xb'),auth['isAuthenticated'](),controller[_0xa808('0xc')]);router[_0xa808('0x8')](_0xa808('0xd'),auth[_0xa808('0x9')](),controller['show']);router[_0xa808('0xe')]('/',auth[_0xa808('0x9')](),controller[_0xa808('0xf')]);router[_0xa808('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa808('0x11')]);router[_0xa808('0x12')](_0xa808('0xd'),auth[_0xa808('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 24a1573..de67f18 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x4fa79b,_0x232977){var _0x5946a1=function(_0x30f48d){while(--_0x30f48d){_0x4fa79b['push'](_0x4fa79b['shift']());}};_0x5946a1(++_0x232977);}(_0xedd9,0xfc));var _0x9edd=function(_0x1e9a7b,_0x13312c){_0x1e9a7b=_0x1e9a7b-0x0;var _0x1d1d96=_0xedd9[_0x1e9a7b];return _0x1d1d96;};'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 +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4dcdfc,_0x11374f){var _0x25d086=function(_0x4e1141){while(--_0x4e1141){_0x4dcdfc['push'](_0x4dcdfc['shift']());}};_0x25d086(++_0x11374f);}(_0x008c,0x188));var _0xc008=function(_0x112e6a,_0x4dfc41){_0x112e6a=_0x112e6a-0x0;var _0x1b691b=_0x008c[_0x112e6a];return _0x1b691b;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 134ee55..d20973c 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 _0x6b3e=['type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelTransferReport','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','stack','map','rawAttributes','fieldName'];(function(_0x44607d,_0x3f4bdd){var _0x2a1b53=function(_0xfc2982){while(--_0xfc2982){_0x44607d['push'](_0x44607d['shift']());}};_0x2a1b53(++_0x3f4bdd);}(_0x6b3e,0x1f3));var _0xe6b3=function(_0x50ab8b,_0x1ec64f){_0x50ab8b=_0x50ab8b-0x0;var _0x546065=_0x6b3e[_0x50ab8b];return _0x546065;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6b3('0x0'));var zipdir=require(_0xe6b3('0x1'));var jsonpatch=require(_0xe6b3('0x2'));var rp=require('request-promise');var moment=require(_0xe6b3('0x3'));var BPromise=require(_0xe6b3('0x4'));var Mustache=require(_0xe6b3('0x5'));var util=require(_0xe6b3('0x6'));var path=require(_0xe6b3('0x7'));var sox=require(_0xe6b3('0x8'));var csv=require(_0xe6b3('0x9'));var ejs=require(_0xe6b3('0xa'));var fs=require('fs');var fs_extra=require(_0xe6b3('0xb'));var _=require(_0xe6b3('0xc'));var squel=require(_0xe6b3('0xd'));var crypto=require(_0xe6b3('0xe'));var jsforce=require(_0xe6b3('0xf'));var deskjs=require(_0xe6b3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe6b3('0x11'));var Papa=require(_0xe6b3('0x12'));var Redis=require(_0xe6b3('0x13'));var authService=require(_0xe6b3('0x14'));var qs=require(_0xe6b3('0x15'));var as=require(_0xe6b3('0x16'));var hardwareService=require(_0xe6b3('0x17'));var logger=require(_0xe6b3('0x18'))(_0xe6b3('0x19'));var utils=require(_0xe6b3('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xe6b3('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fd51c,_0x4af8b1){_0x4af8b1=_0x4af8b1||0xcc;return function(_0x363d4c){if(_0x363d4c){return _0x2fd51c[_0xe6b3('0x1c')](_0x4af8b1);}return _0x2fd51c['status'](_0x4af8b1)[_0xe6b3('0x1d')]();};}function respondWithResult(_0x216452,_0xe12e76){_0xe12e76=_0xe12e76||0xc8;return function(_0x502eb1){if(_0x502eb1){return _0x216452[_0xe6b3('0x1e')](_0xe12e76)['json'](_0x502eb1);}};}function respondWithFilteredResult(_0x8abf14,_0x84b181){return function(_0x2a9ea2){if(_0x2a9ea2){var _0x53609d=typeof _0x84b181[_0xe6b3('0x1f')]===_0xe6b3('0x20')&&typeof _0x84b181[_0xe6b3('0x21')]==='undefined';var _0x231cb9=_0x2a9ea2['count'];var _0x5775a2=_0x53609d?0x0:_0x84b181[_0xe6b3('0x1f')];var _0x38ca19=_0x53609d?_0x2a9ea2[_0xe6b3('0x22')]:_0x84b181[_0xe6b3('0x1f')]+_0x84b181['limit'];var _0x109ff6;if(_0x38ca19>=_0x231cb9){_0x38ca19=_0x231cb9;_0x109ff6=0xc8;}else{_0x109ff6=0xce;}_0x8abf14['status'](_0x109ff6);return _0x8abf14[_0xe6b3('0x23')](_0xe6b3('0x24'),_0x5775a2+'-'+_0x38ca19+'/'+_0x231cb9)[_0xe6b3('0x25')](_0x2a9ea2);}return null;};}function patchUpdates(_0x172553){return function(_0x4d5d10){try{jsonpatch[_0xe6b3('0x26')](_0x4d5d10,_0x172553,!![]);}catch(_0x55eb8c){return BPromise['reject'](_0x55eb8c);}return _0x4d5d10[_0xe6b3('0x27')]();};}function saveUpdates(_0x45ef53,_0x25d360){return function(_0x1d7a08){if(_0x1d7a08){return _0x1d7a08[_0xe6b3('0x28')](_0x45ef53)[_0xe6b3('0x29')](function(_0x4c2417){return _0x4c2417;});}return null;};}function removeEntity(_0xbca7c1,_0x2cd970){return function(_0x3049e1){if(_0x3049e1){return _0x3049e1[_0xe6b3('0x2a')]()['then'](function(){_0xbca7c1[_0xe6b3('0x1e')](0xcc)[_0xe6b3('0x1d')]();});}};}function handleEntityNotFound(_0x4d34c4,_0x102e91){return function(_0xec6f45){if(!_0xec6f45){_0x4d34c4[_0xe6b3('0x1c')](0x194);}return _0xec6f45;};}function handleError(_0x21fbef,_0x8e8811){_0x8e8811=_0x8e8811||0x1f4;return function(_0x204412){logger['error'](_0x204412[_0xe6b3('0x2b')]);if(_0x204412['name']){delete _0x204412['name'];}_0x21fbef[_0xe6b3('0x1e')](_0x8e8811)['send'](_0x204412);};}exports['index']=function(_0x149834,_0x283a6f){var _0x484131={},_0x5f4dfd={},_0x46afc5={'count':0x0,'rows':[]};var _0x35b2df=_[_0xe6b3('0x2c')](db['OpenchannelTransferReport'][_0xe6b3('0x2d')],function(_0x29d103){return{'name':_0x29d103[_0xe6b3('0x2e')],'type':_0x29d103[_0xe6b3('0x2f')]['key']};});_0x5f4dfd['model']=_[_0xe6b3('0x2c')](_0x35b2df,_0xe6b3('0x30'));_0x5f4dfd[_0xe6b3('0x31')]=_[_0xe6b3('0x32')](_0x149834['query']);_0x5f4dfd[_0xe6b3('0x33')]=_[_0xe6b3('0x34')](_0x5f4dfd[_0xe6b3('0x35')],_0x5f4dfd[_0xe6b3('0x31')]);_0x484131[_0xe6b3('0x36')]=_[_0xe6b3('0x34')](_0x5f4dfd[_0xe6b3('0x35')],qs[_0xe6b3('0x37')](_0x149834['query']['fields']));_0x484131['attributes']=_0x484131[_0xe6b3('0x36')][_0xe6b3('0x38')]?_0x484131[_0xe6b3('0x36')]:_0x5f4dfd[_0xe6b3('0x35')];if(!_0x149834[_0xe6b3('0x31')][_0xe6b3('0x39')](_0xe6b3('0x3a'))){_0x484131['limit']=qs[_0xe6b3('0x21')](_0x149834[_0xe6b3('0x31')]['limit']);_0x484131['offset']=qs[_0xe6b3('0x1f')](_0x149834[_0xe6b3('0x31')][_0xe6b3('0x1f')]);}_0x484131[_0xe6b3('0x3b')]=qs[_0xe6b3('0x3c')](_0x149834[_0xe6b3('0x31')][_0xe6b3('0x3c')]);_0x484131[_0xe6b3('0x3d')]=qs[_0xe6b3('0x33')](_[_0xe6b3('0x3e')](_0x149834['query'],_0x5f4dfd[_0xe6b3('0x33')]),_0x35b2df);if(_0x149834[_0xe6b3('0x31')][_0xe6b3('0x3f')]){_0x484131['where']=_[_0xe6b3('0x40')](_0x484131[_0xe6b3('0x3d')],{'$or':_[_0xe6b3('0x2c')](_0x35b2df,function(_0x58e155){if(_0x58e155[_0xe6b3('0x2f')]!=='VIRTUAL'){var _0x1b7361={};_0x1b7361[_0x58e155[_0xe6b3('0x30')]]={'$like':'%'+_0x149834[_0xe6b3('0x31')][_0xe6b3('0x3f')]+'%'};return _0x1b7361;}})});}_0x484131=_['merge']({},_0x484131,_0x149834[_0xe6b3('0x41')]);var _0x21888f={'where':_0x484131[_0xe6b3('0x3d')]};return db[_0xe6b3('0x42')]['count'](_0x21888f)[_0xe6b3('0x29')](function(_0x2ae58a){_0x46afc5[_0xe6b3('0x22')]=_0x2ae58a;if(_0x149834[_0xe6b3('0x31')][_0xe6b3('0x43')]){_0x484131[_0xe6b3('0x44')]=[{'all':!![]}];}return db[_0xe6b3('0x42')][_0xe6b3('0x45')](_0x484131);})[_0xe6b3('0x29')](function(_0x38f914){_0x46afc5[_0xe6b3('0x46')]=_0x38f914;return _0x46afc5;})[_0xe6b3('0x29')](respondWithFilteredResult(_0x283a6f,_0x484131))['catch'](handleError(_0x283a6f,null));};exports[_0xe6b3('0x47')]=function(_0x539821,_0x244a7f){var _0x60a89e={'raw':!![],'where':{'id':_0x539821[_0xe6b3('0x48')]['id']}},_0xc318a9={};_0xc318a9[_0xe6b3('0x35')]=_[_0xe6b3('0x32')](db[_0xe6b3('0x42')]['rawAttributes']);_0xc318a9['query']=_['keys'](_0x539821[_0xe6b3('0x31')]);_0xc318a9[_0xe6b3('0x33')]=_['intersection'](_0xc318a9[_0xe6b3('0x35')],_0xc318a9[_0xe6b3('0x31')]);_0x60a89e[_0xe6b3('0x36')]=_[_0xe6b3('0x34')](_0xc318a9[_0xe6b3('0x35')],qs['fields'](_0x539821['query'][_0xe6b3('0x37')]));_0x60a89e[_0xe6b3('0x36')]=_0x60a89e[_0xe6b3('0x36')][_0xe6b3('0x38')]?_0x60a89e[_0xe6b3('0x36')]:_0xc318a9['model'];if(_0x539821['query'][_0xe6b3('0x43')]){_0x60a89e['include']=[{'all':!![]}];}_0x60a89e=_[_0xe6b3('0x40')]({},_0x60a89e,_0x539821[_0xe6b3('0x41')]);return db['OpenchannelTransferReport']['find'](_0x60a89e)['then'](handleEntityNotFound(_0x244a7f,null))[_0xe6b3('0x29')](respondWithResult(_0x244a7f,null))[_0xe6b3('0x49')](handleError(_0x244a7f,null));};exports[_0xe6b3('0x4a')]=function(_0xb13583,_0x313f2a){return db['OpenchannelTransferReport'][_0xe6b3('0x4a')](_0xb13583[_0xe6b3('0x4b')],{})[_0xe6b3('0x29')](respondWithResult(_0x313f2a,0xc9))['catch'](handleError(_0x313f2a,null));};exports[_0xe6b3('0x28')]=function(_0x36db7e,_0x2972b6){if(_0x36db7e['body']['id']){delete _0x36db7e[_0xe6b3('0x4b')]['id'];}return db[_0xe6b3('0x42')][_0xe6b3('0x4c')]({'where':{'id':_0x36db7e['params']['id']}})['then'](handleEntityNotFound(_0x2972b6,null))['then'](saveUpdates(_0x36db7e[_0xe6b3('0x4b')],null))[_0xe6b3('0x29')](respondWithResult(_0x2972b6,null))[_0xe6b3('0x49')](handleError(_0x2972b6,null));};exports[_0xe6b3('0x2a')]=function(_0x343193,_0x1dc987){return db['OpenchannelTransferReport'][_0xe6b3('0x4c')]({'where':{'id':_0x343193[_0xe6b3('0x48')]['id']}})[_0xe6b3('0x29')](handleEntityNotFound(_0x1dc987,null))[_0xe6b3('0x29')](removeEntity(_0x1dc987,null))['catch'](handleError(_0x1dc987,null));};exports[_0xe6b3('0x4d')]=function(_0x15e2f5,_0x45b8a1){return db[_0xe6b3('0x42')]['describe']()[_0xe6b3('0x29')](respondWithResult(_0x45b8a1,null))[_0xe6b3('0x49')](handleError(_0x45b8a1,null));}; \ No newline at end of file +var _0x5f57=['find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','Content-Range','save','update','then','destroy','error','stack','name','send','OpenchannelTransferReport','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length'];(function(_0x23bb5d,_0x3f6e11){var _0x5a88b3=function(_0xbd02b0){while(--_0xbd02b0){_0x23bb5d['push'](_0x23bb5d['shift']());}};_0x5a88b3(++_0x3f6e11);}(_0x5f57,0xdf));var _0x75f5=function(_0x3e6117,_0x445636){_0x3e6117=_0x3e6117-0x0;var _0x89111d=_0x5f57[_0x3e6117];return _0x89111d;};'use strict';var emlformat=require(_0x75f5('0x0'));var rimraf=require(_0x75f5('0x1'));var zipdir=require(_0x75f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x75f5('0x3'));var moment=require(_0x75f5('0x4'));var BPromise=require(_0x75f5('0x5'));var Mustache=require('mustache');var util=require(_0x75f5('0x6'));var path=require('path');var sox=require(_0x75f5('0x7'));var csv=require(_0x75f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75f5('0x9'));var squel=require(_0x75f5('0xa'));var crypto=require('crypto');var jsforce=require(_0x75f5('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x75f5('0xc'));var Papa=require(_0x75f5('0xd'));var Redis=require(_0x75f5('0xe'));var authService=require(_0x75f5('0xf'));var qs=require(_0x75f5('0x10'));var as=require(_0x75f5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x75f5('0x12'))(_0x75f5('0x13'));var utils=require(_0x75f5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x75f5('0x15'));var db=require(_0x75f5('0x16'))['db'];function respondWithStatusCode(_0x48734a,_0x4c3d80){_0x4c3d80=_0x4c3d80||0xcc;return function(_0xf9759){if(_0xf9759){return _0x48734a[_0x75f5('0x17')](_0x4c3d80);}return _0x48734a['status'](_0x4c3d80)[_0x75f5('0x18')]();};}function respondWithResult(_0x353dcb,_0x48d472){_0x48d472=_0x48d472||0xc8;return function(_0xee74b0){if(_0xee74b0){return _0x353dcb[_0x75f5('0x19')](_0x48d472)[_0x75f5('0x1a')](_0xee74b0);}};}function respondWithFilteredResult(_0x2ad441,_0x194442){return function(_0x47e17a){if(_0x47e17a){var _0x56e7ff=typeof _0x194442['offset']===_0x75f5('0x1b')&&typeof _0x194442['limit']===_0x75f5('0x1b');var _0x72ceb1=_0x47e17a[_0x75f5('0x1c')];var _0x91ef87=_0x56e7ff?0x0:_0x194442[_0x75f5('0x1d')];var _0x5076a5=_0x56e7ff?_0x47e17a[_0x75f5('0x1c')]:_0x194442[_0x75f5('0x1d')]+_0x194442['limit'];var _0x2e1bda;if(_0x5076a5>=_0x72ceb1){_0x5076a5=_0x72ceb1;_0x2e1bda=0xc8;}else{_0x2e1bda=0xce;}_0x2ad441[_0x75f5('0x19')](_0x2e1bda);return _0x2ad441['set'](_0x75f5('0x1e'),_0x91ef87+'-'+_0x5076a5+'/'+_0x72ceb1)[_0x75f5('0x1a')](_0x47e17a);}return null;};}function patchUpdates(_0x4b6034){return function(_0x32b156){try{jsonpatch['apply'](_0x32b156,_0x4b6034,!![]);}catch(_0x3d79f5){return BPromise['reject'](_0x3d79f5);}return _0x32b156[_0x75f5('0x1f')]();};}function saveUpdates(_0x509ea1,_0xbf0c88){return function(_0x42ab84){if(_0x42ab84){return _0x42ab84[_0x75f5('0x20')](_0x509ea1)[_0x75f5('0x21')](function(_0x16c612){return _0x16c612;});}return null;};}function removeEntity(_0x518f2e,_0x21cd29){return function(_0xdac329){if(_0xdac329){return _0xdac329[_0x75f5('0x22')]()['then'](function(){_0x518f2e[_0x75f5('0x19')](0xcc)[_0x75f5('0x18')]();});}};}function handleEntityNotFound(_0x3d7614,_0xb5dec4){return function(_0x30c560){if(!_0x30c560){_0x3d7614[_0x75f5('0x17')](0x194);}return _0x30c560;};}function handleError(_0x22ab0c,_0x439b3a){_0x439b3a=_0x439b3a||0x1f4;return function(_0x246e8b){logger[_0x75f5('0x23')](_0x246e8b[_0x75f5('0x24')]);if(_0x246e8b[_0x75f5('0x25')]){delete _0x246e8b[_0x75f5('0x25')];}_0x22ab0c[_0x75f5('0x19')](_0x439b3a)[_0x75f5('0x26')](_0x246e8b);};}exports['index']=function(_0x48f566,_0x30b9ef){var _0x27bc38={},_0x5a1cc4={},_0x165dcc={'count':0x0,'rows':[]};var _0x1686cf=_['map'](db[_0x75f5('0x27')]['rawAttributes'],function(_0x50cae8){return{'name':_0x50cae8[_0x75f5('0x28')],'type':_0x50cae8[_0x75f5('0x29')][_0x75f5('0x2a')]};});_0x5a1cc4[_0x75f5('0x2b')]=_[_0x75f5('0x2c')](_0x1686cf,'name');_0x5a1cc4[_0x75f5('0x2d')]=_['keys'](_0x48f566[_0x75f5('0x2d')]);_0x5a1cc4[_0x75f5('0x2e')]=_[_0x75f5('0x2f')](_0x5a1cc4[_0x75f5('0x2b')],_0x5a1cc4[_0x75f5('0x2d')]);_0x27bc38[_0x75f5('0x30')]=_['intersection'](_0x5a1cc4[_0x75f5('0x2b')],qs[_0x75f5('0x31')](_0x48f566[_0x75f5('0x2d')][_0x75f5('0x31')]));_0x27bc38[_0x75f5('0x30')]=_0x27bc38[_0x75f5('0x30')]['length']?_0x27bc38[_0x75f5('0x30')]:_0x5a1cc4['model'];if(!_0x48f566['query'][_0x75f5('0x32')]('nolimit')){_0x27bc38['limit']=qs[_0x75f5('0x33')](_0x48f566[_0x75f5('0x2d')][_0x75f5('0x33')]);_0x27bc38['offset']=qs[_0x75f5('0x1d')](_0x48f566[_0x75f5('0x2d')][_0x75f5('0x1d')]);}_0x27bc38[_0x75f5('0x34')]=qs['sort'](_0x48f566['query'][_0x75f5('0x35')]);_0x27bc38[_0x75f5('0x36')]=qs[_0x75f5('0x2e')](_['pick'](_0x48f566[_0x75f5('0x2d')],_0x5a1cc4[_0x75f5('0x2e')]),_0x1686cf);if(_0x48f566[_0x75f5('0x2d')][_0x75f5('0x37')]){_0x27bc38[_0x75f5('0x36')]=_[_0x75f5('0x38')](_0x27bc38[_0x75f5('0x36')],{'$or':_[_0x75f5('0x2c')](_0x1686cf,function(_0x3b8d2b){if(_0x3b8d2b['type']!==_0x75f5('0x39')){var _0x3327f3={};_0x3327f3[_0x3b8d2b[_0x75f5('0x25')]]={'$like':'%'+_0x48f566[_0x75f5('0x2d')][_0x75f5('0x37')]+'%'};return _0x3327f3;}})});}_0x27bc38=_[_0x75f5('0x38')]({},_0x27bc38,_0x48f566[_0x75f5('0x3a')]);var _0xbdec56={'where':_0x27bc38[_0x75f5('0x36')]};return db[_0x75f5('0x27')][_0x75f5('0x1c')](_0xbdec56)['then'](function(_0x3fe147){_0x165dcc[_0x75f5('0x1c')]=_0x3fe147;if(_0x48f566[_0x75f5('0x2d')][_0x75f5('0x3b')]){_0x27bc38[_0x75f5('0x3c')]=[{'all':!![]}];}return db[_0x75f5('0x27')][_0x75f5('0x3d')](_0x27bc38);})[_0x75f5('0x21')](function(_0x6183b0){_0x165dcc[_0x75f5('0x3e')]=_0x6183b0;return _0x165dcc;})[_0x75f5('0x21')](respondWithFilteredResult(_0x30b9ef,_0x27bc38))[_0x75f5('0x3f')](handleError(_0x30b9ef,null));};exports[_0x75f5('0x40')]=function(_0x52ba6a,_0x261225){var _0x5a959e={'raw':!![],'where':{'id':_0x52ba6a[_0x75f5('0x41')]['id']}},_0xcd6dfa={};_0xcd6dfa[_0x75f5('0x2b')]=_[_0x75f5('0x42')](db[_0x75f5('0x27')][_0x75f5('0x43')]);_0xcd6dfa[_0x75f5('0x2d')]=_['keys'](_0x52ba6a[_0x75f5('0x2d')]);_0xcd6dfa[_0x75f5('0x2e')]=_[_0x75f5('0x2f')](_0xcd6dfa[_0x75f5('0x2b')],_0xcd6dfa[_0x75f5('0x2d')]);_0x5a959e[_0x75f5('0x30')]=_[_0x75f5('0x2f')](_0xcd6dfa[_0x75f5('0x2b')],qs[_0x75f5('0x31')](_0x52ba6a[_0x75f5('0x2d')][_0x75f5('0x31')]));_0x5a959e['attributes']=_0x5a959e[_0x75f5('0x30')][_0x75f5('0x44')]?_0x5a959e[_0x75f5('0x30')]:_0xcd6dfa[_0x75f5('0x2b')];if(_0x52ba6a[_0x75f5('0x2d')][_0x75f5('0x3b')]){_0x5a959e['include']=[{'all':!![]}];}_0x5a959e=_['merge']({},_0x5a959e,_0x52ba6a[_0x75f5('0x3a')]);return db[_0x75f5('0x27')][_0x75f5('0x45')](_0x5a959e)[_0x75f5('0x21')](handleEntityNotFound(_0x261225,null))['then'](respondWithResult(_0x261225,null))[_0x75f5('0x3f')](handleError(_0x261225,null));};exports[_0x75f5('0x46')]=function(_0x13c950,_0x1d9afc){return db[_0x75f5('0x27')][_0x75f5('0x46')](_0x13c950['body'],{})[_0x75f5('0x21')](respondWithResult(_0x1d9afc,0xc9))[_0x75f5('0x3f')](handleError(_0x1d9afc,null));};exports[_0x75f5('0x20')]=function(_0x19e9e2,_0x44d832){if(_0x19e9e2[_0x75f5('0x47')]['id']){delete _0x19e9e2[_0x75f5('0x47')]['id'];}return db[_0x75f5('0x27')]['find']({'where':{'id':_0x19e9e2['params']['id']}})[_0x75f5('0x21')](handleEntityNotFound(_0x44d832,null))[_0x75f5('0x21')](saveUpdates(_0x19e9e2[_0x75f5('0x47')],null))[_0x75f5('0x21')](respondWithResult(_0x44d832,null))[_0x75f5('0x3f')](handleError(_0x44d832,null));};exports[_0x75f5('0x22')]=function(_0x956fdb,_0x34041d){return db[_0x75f5('0x27')][_0x75f5('0x45')]({'where':{'id':_0x956fdb['params']['id']}})[_0x75f5('0x21')](handleEntityNotFound(_0x34041d,null))[_0x75f5('0x21')](removeEntity(_0x34041d,null))[_0x75f5('0x3f')](handleError(_0x34041d,null));};exports[_0x75f5('0x48')]=function(_0x48901b,_0x1e8cf2){return db[_0x75f5('0x27')]['describe']()[_0x75f5('0x21')](respondWithResult(_0x1e8cf2,null))[_0x75f5('0x3f')](handleError(_0x1e8cf2,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index aa61589..b929317 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 _0x1428=['define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x197d2,_0x4df90d){var _0x5a1927=function(_0x3b34fe){while(--_0x3b34fe){_0x197d2['push'](_0x197d2['shift']());}};_0x5a1927(++_0x4df90d);}(_0x1428,0x11b));var _0x8142=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x1428[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x8142('0x0'));var util=require(_0x8142('0x1'));var logger=require(_0x8142('0x2'))(_0x8142('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8142('0x4'));var rimraf=require(_0x8142('0x5'));var config=require(_0x8142('0x6'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x13a180,_0x470aba){return _0x13a180[_0x8142('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0x8142('0x8'),'paranoid':![],'indexes':[{'name':_0x8142('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe31a=['../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0xe31a,0x68));var _0xae31=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xe31a[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae31('0x0'))(_0xae31('0x1'));var moment=require(_0xae31('0x2'));var BPromise=require(_0xae31('0x3'));var rp=require(_0xae31('0x4'));var fs=require('fs');var path=require(_0xae31('0x5'));var rimraf=require('rimraf');var config=require(_0xae31('0x6'));var attributes=require(_0xae31('0x7'));module['exports']=function(_0x293427,_0x44a40d){return _0x293427[_0xae31('0x8')](_0xae31('0x9'),attributes,{'tableName':_0xae31('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 9758408..7913c50 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 _0xeb5d=['then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xeb5d[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0xdeb5('0x0'));var moment=require(_0xdeb5('0x1'));var BPromise=require(_0xdeb5('0x2'));var rs=require(_0xdeb5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdeb5('0x4'));var logger=require(_0xdeb5('0x5'))('rpc');var config=require(_0xdeb5('0x6'));var jayson=require(_0xdeb5('0x7'));var client=jayson[_0xdeb5('0x8')][_0xdeb5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x120329,_0x12484b,_0x328d6b){return new BPromise(function(_0x35c086,_0x2c8509){return client[_0xdeb5('0xa')](_0x120329,_0x328d6b)[_0xdeb5('0xb')](function(_0x2114ba){logger[_0xdeb5('0xc')](_0xdeb5('0xd'),_0x12484b,_0xdeb5('0xe'));logger[_0xdeb5('0xf')](_0xdeb5('0x10'),_0x12484b,'request\x20sent',JSON[_0xdeb5('0x11')](_0x2114ba));if(_0x2114ba[_0xdeb5('0x12')]){if(_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x13')]===0x1f4){logger[_0xdeb5('0x12')](_0xdeb5('0xd'),_0x12484b,_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);return _0x2c8509(_0x2114ba['error'][_0xdeb5('0x14')]);}logger['error'](_0xdeb5('0xd'),_0x12484b,_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);return _0x35c086(_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);}else{logger['info'](_0xdeb5('0xd'),_0x12484b,_0xdeb5('0xe'));_0x35c086(_0x2114ba['result'][_0xdeb5('0x14')]);}})[_0xdeb5('0x15')](function(_0x3521b2){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x12484b,_0x3521b2);_0x2c8509(_0x3521b2);});});} \ No newline at end of file +var _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5577,0x1b4));var _0x7557=function(_0x45f9ca,_0x368549){_0x45f9ca=_0x45f9ca-0x0;var _0x4ce72a=_0x5577[_0x45f9ca];return _0x4ce72a;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 16dd224..1c613d1 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 _0x1fa6=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x54bb02,_0x3a72c0){var _0xc0d65a=function(_0x273074){while(--_0x273074){_0x54bb02['push'](_0x54bb02['shift']());}};_0xc0d65a(++_0x3a72c0);}(_0x1fa6,0x10b));var _0x61fa=function(_0x5e6e32,_0x309f3d){_0x5e6e32=_0x5e6e32-0x0;var _0xecdacd=_0x1fa6[_0x5e6e32];return _0xecdacd;};'use strict';var multer=require(_0x61fa('0x0'));var util=require(_0x61fa('0x1'));var path=require(_0x61fa('0x2'));var timeout=require(_0x61fa('0x3'));var express=require(_0x61fa('0x4'));var router=express[_0x61fa('0x5')]();var fs_extra=require(_0x61fa('0x6'));var auth=require(_0x61fa('0x7'));var interaction=require(_0x61fa('0x8'));var config=require(_0x61fa('0x9'));var controller=require(_0x61fa('0xa'));router[_0x61fa('0xb')]('/',auth[_0x61fa('0xc')](),controller[_0x61fa('0xd')]);router[_0x61fa('0xb')](_0x61fa('0xe'),auth[_0x61fa('0xc')](),controller[_0x61fa('0xf')]);router[_0x61fa('0x10')]('/',auth['isAuthenticated'](),controller[_0x61fa('0x11')]);router[_0x61fa('0x12')](_0x61fa('0xe'),auth['isAuthenticated'](),controller[_0x61fa('0x13')]);router['delete'](_0x61fa('0xe'),auth[_0x61fa('0xc')](),controller[_0x61fa('0x14')]);module[_0x61fa('0x15')]=router; \ No newline at end of file +var _0x8cbf=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0x480d67,_0x3110a9){var _0x32752b=function(_0xb665ab){while(--_0xb665ab){_0x480d67['push'](_0x480d67['shift']());}};_0x32752b(++_0x3110a9);}(_0x8cbf,0x144));var _0xf8cb=function(_0x301bf7,_0x28cba8){_0x301bf7=_0x301bf7-0x0;var _0x274ae9=_0x8cbf[_0x301bf7];return _0x274ae9;};'use strict';var multer=require('multer');var util=require(_0xf8cb('0x0'));var path=require(_0xf8cb('0x1'));var timeout=require(_0xf8cb('0x2'));var express=require(_0xf8cb('0x3'));var router=express[_0xf8cb('0x4')]();var fs_extra=require(_0xf8cb('0x5'));var auth=require(_0xf8cb('0x6'));var interaction=require(_0xf8cb('0x7'));var config=require(_0xf8cb('0x8'));var controller=require('./pause.controller');router['get']('/',auth[_0xf8cb('0x9')](),controller[_0xf8cb('0xa')]);router['get'](_0xf8cb('0xb'),auth[_0xf8cb('0x9')](),controller[_0xf8cb('0xc')]);router['post']('/',auth[_0xf8cb('0x9')](),controller[_0xf8cb('0xd')]);router[_0xf8cb('0xe')](_0xf8cb('0xb'),auth['isAuthenticated'](),controller[_0xf8cb('0xf')]);router[_0xf8cb('0x10')](_0xf8cb('0xb'),auth[_0xf8cb('0x9')](),controller[_0xf8cb('0x11')]);module[_0xf8cb('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 381bcda..9b1b7b0 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 _0x4614=['sequelize','exports','STRING','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4614,0x1e8));var _0x4461=function(_0x4ea98b,_0x10b9b8){_0x4ea98b=_0x4ea98b-0x0;var _0x1a0a7d=_0x4614[_0x4ea98b];return _0x1a0a7d;};'use strict';var Sequelize=require(_0x4461('0x0'));module[_0x4461('0x1')]={'name':{'type':Sequelize[_0x4461('0x2')],'unique':_0x4461('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x4461('0x2')]}}; \ No newline at end of file +var _0xee86=['sequelize','STRING','name'];(function(_0x1bfba4,_0x141daa){var _0x4930d0=function(_0x426271){while(--_0x426271){_0x1bfba4['push'](_0x1bfba4['shift']());}};_0x4930d0(++_0x141daa);}(_0xee86,0x1bf));var _0x6ee8=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xee86[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require(_0x6ee8('0x0'));module['exports']={'name':{'type':Sequelize[_0x6ee8('0x1')],'unique':_0x6ee8('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x6ee8('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c36f385..66b7277 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 _0x1ddf=['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','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','Pause','fieldName','type','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir'];(function(_0x1a9c3c,_0x4fa203){var _0x46ec33=function(_0x4796ef){while(--_0x4796ef){_0x1a9c3c['push'](_0x1a9c3c['shift']());}};_0x46ec33(++_0x4fa203);}(_0x1ddf,0x159));var _0xf1dd=function(_0x2ff8e3,_0x15553b){_0x2ff8e3=_0x2ff8e3-0x0;var _0x2f60b5=_0x1ddf[_0x2ff8e3];return _0x2f60b5;};'use strict';var emlformat=require(_0xf1dd('0x0'));var rimraf=require(_0xf1dd('0x1'));var zipdir=require(_0xf1dd('0x2'));var jsonpatch=require(_0xf1dd('0x3'));var rp=require(_0xf1dd('0x4'));var moment=require(_0xf1dd('0x5'));var BPromise=require(_0xf1dd('0x6'));var Mustache=require(_0xf1dd('0x7'));var util=require(_0xf1dd('0x8'));var path=require(_0xf1dd('0x9'));var sox=require(_0xf1dd('0xa'));var csv=require(_0xf1dd('0xb'));var ejs=require(_0xf1dd('0xc'));var fs=require('fs');var fs_extra=require(_0xf1dd('0xd'));var _=require(_0xf1dd('0xe'));var squel=require(_0xf1dd('0xf'));var crypto=require(_0xf1dd('0x10'));var jsforce=require(_0xf1dd('0x11'));var deskjs=require(_0xf1dd('0x12'));var toCsv=require(_0xf1dd('0xb'));var querystring=require(_0xf1dd('0x13'));var Papa=require(_0xf1dd('0x14'));var Redis=require(_0xf1dd('0x15'));var authService=require(_0xf1dd('0x16'));var qs=require(_0xf1dd('0x17'));var as=require(_0xf1dd('0x18'));var hardwareService=require(_0xf1dd('0x19'));var logger=require('../../config/logger')(_0xf1dd('0x1a'));var utils=require(_0xf1dd('0x1b'));var config=require(_0xf1dd('0x1c'));var licenseUtil=require(_0xf1dd('0x1d'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34590b,_0x379486){_0x379486=_0x379486||0xcc;return function(_0x425b3e){if(_0x425b3e){return _0x34590b['sendStatus'](_0x379486);}return _0x34590b['status'](_0x379486)[_0xf1dd('0x1e')]();};}function respondWithResult(_0x5e552d,_0x4491ef){_0x4491ef=_0x4491ef||0xc8;return function(_0x2c23ed){if(_0x2c23ed){return _0x5e552d['status'](_0x4491ef)[_0xf1dd('0x1f')](_0x2c23ed);}};}function respondWithFilteredResult(_0x30cd81,_0x96b481){return function(_0x97240d){if(_0x97240d){var _0xad0c2=typeof _0x96b481[_0xf1dd('0x20')]===_0xf1dd('0x21')&&typeof _0x96b481[_0xf1dd('0x22')]==='undefined';var _0x400d10=_0x97240d[_0xf1dd('0x23')];var _0x33aa57=_0xad0c2?0x0:_0x96b481['offset'];var _0x3cf87e=_0xad0c2?_0x97240d['count']:_0x96b481[_0xf1dd('0x20')]+_0x96b481[_0xf1dd('0x22')];var _0x173a1d;if(_0x3cf87e>=_0x400d10){_0x3cf87e=_0x400d10;_0x173a1d=0xc8;}else{_0x173a1d=0xce;}_0x30cd81[_0xf1dd('0x24')](_0x173a1d);return _0x30cd81[_0xf1dd('0x25')](_0xf1dd('0x26'),_0x33aa57+'-'+_0x3cf87e+'/'+_0x400d10)['json'](_0x97240d);}return null;};}function patchUpdates(_0x10ffe9){return function(_0x4ce440){try{jsonpatch[_0xf1dd('0x27')](_0x4ce440,_0x10ffe9,!![]);}catch(_0x5423f2){return BPromise[_0xf1dd('0x28')](_0x5423f2);}return _0x4ce440[_0xf1dd('0x29')]();};}function saveUpdates(_0x3d581a,_0x5e7ecc){return function(_0xb16407){if(_0xb16407){return _0xb16407['update'](_0x3d581a)[_0xf1dd('0x2a')](function(_0x11f8af){return _0x11f8af;});}return null;};}function removeEntity(_0x338b29,_0x2fb65b){return function(_0x2204a6){if(_0x2204a6){return _0x2204a6['destroy']()[_0xf1dd('0x2a')](function(){var _0x503b12=_0x2204a6[_0xf1dd('0x2b')]({'plain':!![]});var _0x50b3b5='Pauses';return db[_0xf1dd('0x2c')][_0xf1dd('0x2d')]({'where':{'type':_0x50b3b5,'resourceId':_0x503b12['id']}})[_0xf1dd('0x2a')](function(){return _0x2204a6;});})[_0xf1dd('0x2a')](function(){_0x338b29['status'](0xcc)[_0xf1dd('0x1e')]();});}};}function handleEntityNotFound(_0xc51ad8,_0x204036){return function(_0xea3978){if(!_0xea3978){_0xc51ad8[_0xf1dd('0x2e')](0x194);}return _0xea3978;};}function handleError(_0x49a80f,_0x793675){_0x793675=_0x793675||0x1f4;return function(_0x12c846){logger[_0xf1dd('0x2f')](_0x12c846[_0xf1dd('0x30')]);if(_0x12c846[_0xf1dd('0x31')]){delete _0x12c846[_0xf1dd('0x31')];}_0x49a80f[_0xf1dd('0x24')](_0x793675)[_0xf1dd('0x32')](_0x12c846);};}exports[_0xf1dd('0x33')]=function(_0x17bd24,_0x4911aa){var _0x1a9324={},_0x171afc={},_0x361813={'count':0x0,'rows':[]};var _0x18dc3c=_[_0xf1dd('0x34')](db[_0xf1dd('0x35')]['rawAttributes'],function(_0x2b70e2){return{'name':_0x2b70e2[_0xf1dd('0x36')],'type':_0x2b70e2[_0xf1dd('0x37')]['key']};});_0x171afc[_0xf1dd('0x38')]=_['map'](_0x18dc3c,_0xf1dd('0x31'));_0x171afc['query']=_[_0xf1dd('0x39')](_0x17bd24[_0xf1dd('0x3a')]);_0x171afc['filters']=_['intersection'](_0x171afc[_0xf1dd('0x38')],_0x171afc['query']);_0x1a9324[_0xf1dd('0x3b')]=_[_0xf1dd('0x3c')](_0x171afc[_0xf1dd('0x38')],qs[_0xf1dd('0x3d')](_0x17bd24[_0xf1dd('0x3a')][_0xf1dd('0x3d')]));_0x1a9324[_0xf1dd('0x3b')]=_0x1a9324[_0xf1dd('0x3b')][_0xf1dd('0x3e')]?_0x1a9324[_0xf1dd('0x3b')]:_0x171afc[_0xf1dd('0x38')];if(!_0x17bd24[_0xf1dd('0x3a')]['hasOwnProperty']('nolimit')){_0x1a9324['limit']=qs[_0xf1dd('0x22')](_0x17bd24[_0xf1dd('0x3a')]['limit']);_0x1a9324['offset']=qs[_0xf1dd('0x20')](_0x17bd24[_0xf1dd('0x3a')][_0xf1dd('0x20')]);}_0x1a9324[_0xf1dd('0x3f')]=qs[_0xf1dd('0x40')](_0x17bd24[_0xf1dd('0x3a')][_0xf1dd('0x40')]);_0x1a9324[_0xf1dd('0x41')]=qs[_0xf1dd('0x42')](_[_0xf1dd('0x43')](_0x17bd24[_0xf1dd('0x3a')],_0x171afc[_0xf1dd('0x42')]),_0x18dc3c);if(_0x17bd24['query']['filter']){_0x1a9324[_0xf1dd('0x41')]=_['merge'](_0x1a9324['where'],{'$or':_[_0xf1dd('0x34')](_0x18dc3c,function(_0x2424fe){if(_0x2424fe[_0xf1dd('0x37')]!==_0xf1dd('0x44')){var _0x34d0e5={};_0x34d0e5[_0x2424fe['name']]={'$like':'%'+_0x17bd24['query'][_0xf1dd('0x45')]+'%'};return _0x34d0e5;}})});}_0x1a9324=_[_0xf1dd('0x46')]({},_0x1a9324,_0x17bd24[_0xf1dd('0x47')]);var _0xc4ec34={'where':_0x1a9324['where']};return db[_0xf1dd('0x35')][_0xf1dd('0x23')](_0xc4ec34)[_0xf1dd('0x2a')](function(_0x4e2ff8){_0x361813[_0xf1dd('0x23')]=_0x4e2ff8;if(_0x17bd24[_0xf1dd('0x3a')][_0xf1dd('0x48')]){_0x1a9324[_0xf1dd('0x49')]=[{'all':!![]}];}return db[_0xf1dd('0x35')][_0xf1dd('0x4a')](_0x1a9324);})[_0xf1dd('0x2a')](function(_0x3730af){_0x361813[_0xf1dd('0x4b')]=_0x3730af;return _0x361813;})[_0xf1dd('0x2a')](respondWithFilteredResult(_0x4911aa,_0x1a9324))[_0xf1dd('0x4c')](handleError(_0x4911aa,null));};exports['show']=function(_0x54e591,_0x33e5b8){var _0x5282c6={'raw':!![],'where':{'id':_0x54e591[_0xf1dd('0x4d')]['id']}},_0x3e6c5f={};_0x3e6c5f[_0xf1dd('0x38')]=_[_0xf1dd('0x39')](db[_0xf1dd('0x35')][_0xf1dd('0x4e')]);_0x3e6c5f['query']=_[_0xf1dd('0x39')](_0x54e591['query']);_0x3e6c5f['filters']=_[_0xf1dd('0x3c')](_0x3e6c5f[_0xf1dd('0x38')],_0x3e6c5f['query']);_0x5282c6[_0xf1dd('0x3b')]=_[_0xf1dd('0x3c')](_0x3e6c5f[_0xf1dd('0x38')],qs[_0xf1dd('0x3d')](_0x54e591['query'][_0xf1dd('0x3d')]));_0x5282c6[_0xf1dd('0x3b')]=_0x5282c6[_0xf1dd('0x3b')][_0xf1dd('0x3e')]?_0x5282c6['attributes']:_0x3e6c5f[_0xf1dd('0x38')];if(_0x54e591[_0xf1dd('0x3a')][_0xf1dd('0x48')]){_0x5282c6[_0xf1dd('0x49')]=[{'all':!![]}];}_0x5282c6=_[_0xf1dd('0x46')]({},_0x5282c6,_0x54e591[_0xf1dd('0x47')]);return db[_0xf1dd('0x35')][_0xf1dd('0x4f')](_0x5282c6)[_0xf1dd('0x2a')](handleEntityNotFound(_0x33e5b8,null))['then'](respondWithResult(_0x33e5b8,null))[_0xf1dd('0x4c')](handleError(_0x33e5b8,null));};exports[_0xf1dd('0x50')]=function(_0x2cdc25,_0x551fb0){return db[_0xf1dd('0x35')][_0xf1dd('0x50')](_0x2cdc25[_0xf1dd('0x51')],{})['then'](function(_0x8695fb){var _0x472574=_0x2cdc25[_0xf1dd('0x52')][_0xf1dd('0x2b')]({'plain':!![]});if(!_0x472574)throw new Error(_0xf1dd('0x53'));if(_0x472574[_0xf1dd('0x54')]==='user'){var _0x3e0591=_0x8695fb[_0xf1dd('0x2b')]({'plain':!![]});var _0x55c50d='Pauses';return db[_0xf1dd('0x55')]['find']({'where':{'name':_0x55c50d,'userProfileId':_0x472574['userProfileId']},'raw':!![]})[_0xf1dd('0x2a')](function(_0x38e17f){if(_0x38e17f&&_0x38e17f[_0xf1dd('0x56')]===0x0){return db['UserProfileResource'][_0xf1dd('0x50')]({'name':_0x3e0591[_0xf1dd('0x31')],'resourceId':_0x3e0591['id'],'type':_0x38e17f[_0xf1dd('0x31')],'sectionId':_0x38e17f['id']},{})[_0xf1dd('0x2a')](function(){return _0x8695fb;});}else{return _0x8695fb;}})[_0xf1dd('0x4c')](function(_0x180452){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x180452);throw _0x180452;});}return _0x8695fb;})[_0xf1dd('0x2a')](respondWithResult(_0x551fb0,0xc9))[_0xf1dd('0x4c')](handleError(_0x551fb0,null));};exports['update']=function(_0x311876,_0x1cbf6b){if(_0x311876[_0xf1dd('0x51')]['id']){delete _0x311876['body']['id'];}return db[_0xf1dd('0x35')]['find']({'where':{'id':_0x311876['params']['id']}})['then'](handleEntityNotFound(_0x1cbf6b,null))[_0xf1dd('0x2a')](saveUpdates(_0x311876[_0xf1dd('0x51')],null))[_0xf1dd('0x2a')](respondWithResult(_0x1cbf6b,null))[_0xf1dd('0x4c')](handleError(_0x1cbf6b,null));};exports['destroy']=function(_0x234f92,_0x2b5b1f){return db['Pause'][_0xf1dd('0x4f')]({'where':{'id':_0x234f92[_0xf1dd('0x4d')]['id']}})[_0xf1dd('0x2a')](handleEntityNotFound(_0x2b5b1f,null))[_0xf1dd('0x2a')](removeEntity(_0x2b5b1f,null))[_0xf1dd('0x4c')](handleError(_0x2b5b1f,null));}; \ No newline at end of file +var _0x3b69=['query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','Pauses','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','keys'];(function(_0xdd0f95,_0x4709af){var _0x28ec00=function(_0x2918c2){while(--_0x2918c2){_0xdd0f95['push'](_0xdd0f95['shift']());}};_0x28ec00(++_0x4709af);}(_0x3b69,0x127));var _0x93b6=function(_0x4c20bd,_0x499f40){_0x4c20bd=_0x4c20bd-0x0;var _0x3a51f5=_0x3b69[_0x4c20bd];return _0x3a51f5;};'use strict';var emlformat=require(_0x93b6('0x0'));var rimraf=require(_0x93b6('0x1'));var zipdir=require(_0x93b6('0x2'));var jsonpatch=require(_0x93b6('0x3'));var rp=require(_0x93b6('0x4'));var moment=require(_0x93b6('0x5'));var BPromise=require(_0x93b6('0x6'));var Mustache=require('mustache');var util=require(_0x93b6('0x7'));var path=require(_0x93b6('0x8'));var sox=require(_0x93b6('0x9'));var csv=require(_0x93b6('0xa'));var ejs=require(_0x93b6('0xb'));var fs=require('fs');var fs_extra=require(_0x93b6('0xc'));var _=require(_0x93b6('0xd'));var squel=require(_0x93b6('0xe'));var crypto=require('crypto');var jsforce=require(_0x93b6('0xf'));var deskjs=require(_0x93b6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x93b6('0x11'));var Papa=require(_0x93b6('0x12'));var Redis=require(_0x93b6('0x13'));var authService=require(_0x93b6('0x14'));var qs=require(_0x93b6('0x15'));var as=require(_0x93b6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93b6('0x17'))('api');var utils=require(_0x93b6('0x18'));var config=require(_0x93b6('0x19'));var licenseUtil=require(_0x93b6('0x1a'));var db=require(_0x93b6('0x1b'))['db'];function respondWithStatusCode(_0x4b07a2,_0x2c11cf){_0x2c11cf=_0x2c11cf||0xcc;return function(_0x24dea5){if(_0x24dea5){return _0x4b07a2['sendStatus'](_0x2c11cf);}return _0x4b07a2[_0x93b6('0x1c')](_0x2c11cf)[_0x93b6('0x1d')]();};}function respondWithResult(_0x1fdce6,_0x3986e3){_0x3986e3=_0x3986e3||0xc8;return function(_0x4df99d){if(_0x4df99d){return _0x1fdce6[_0x93b6('0x1c')](_0x3986e3)[_0x93b6('0x1e')](_0x4df99d);}};}function respondWithFilteredResult(_0x3b1e3e,_0x4f4f6f){return function(_0x4ea7dc){if(_0x4ea7dc){var _0x3d0a7c=typeof _0x4f4f6f[_0x93b6('0x1f')]===_0x93b6('0x20')&&typeof _0x4f4f6f[_0x93b6('0x21')]===_0x93b6('0x20');var _0x1eb4dd=_0x4ea7dc[_0x93b6('0x22')];var _0x59d6ff=_0x3d0a7c?0x0:_0x4f4f6f[_0x93b6('0x1f')];var _0x46b927=_0x3d0a7c?_0x4ea7dc[_0x93b6('0x22')]:_0x4f4f6f[_0x93b6('0x1f')]+_0x4f4f6f[_0x93b6('0x21')];var _0x59227b;if(_0x46b927>=_0x1eb4dd){_0x46b927=_0x1eb4dd;_0x59227b=0xc8;}else{_0x59227b=0xce;}_0x3b1e3e['status'](_0x59227b);return _0x3b1e3e['set'](_0x93b6('0x23'),_0x59d6ff+'-'+_0x46b927+'/'+_0x1eb4dd)[_0x93b6('0x1e')](_0x4ea7dc);}return null;};}function patchUpdates(_0x4f11db){return function(_0x3f181b){try{jsonpatch[_0x93b6('0x24')](_0x3f181b,_0x4f11db,!![]);}catch(_0x585b49){return BPromise[_0x93b6('0x25')](_0x585b49);}return _0x3f181b[_0x93b6('0x26')]();};}function saveUpdates(_0x3f13e5,_0x1c7b9e){return function(_0x2603da){if(_0x2603da){return _0x2603da['update'](_0x3f13e5)[_0x93b6('0x27')](function(_0x16a134){return _0x16a134;});}return null;};}function removeEntity(_0x5b0b2f,_0x1bb6fb){return function(_0x22d9b9){if(_0x22d9b9){return _0x22d9b9['destroy']()['then'](function(){var _0x6ac091=_0x22d9b9[_0x93b6('0x28')]({'plain':!![]});var _0x2016ea=_0x93b6('0x29');return db[_0x93b6('0x2a')][_0x93b6('0x2b')]({'where':{'type':_0x2016ea,'resourceId':_0x6ac091['id']}})[_0x93b6('0x27')](function(){return _0x22d9b9;});})[_0x93b6('0x27')](function(){_0x5b0b2f[_0x93b6('0x1c')](0xcc)[_0x93b6('0x1d')]();});}};}function handleEntityNotFound(_0x29ad2a,_0x29ab76){return function(_0x3eb5b8){if(!_0x3eb5b8){_0x29ad2a[_0x93b6('0x2c')](0x194);}return _0x3eb5b8;};}function handleError(_0xb2a182,_0x1273dc){_0x1273dc=_0x1273dc||0x1f4;return function(_0x2f475a){logger['error'](_0x2f475a[_0x93b6('0x2d')]);if(_0x2f475a[_0x93b6('0x2e')]){delete _0x2f475a[_0x93b6('0x2e')];}_0xb2a182[_0x93b6('0x1c')](_0x1273dc)[_0x93b6('0x2f')](_0x2f475a);};}exports[_0x93b6('0x30')]=function(_0x2a27e3,_0x1dfaff){var _0x341207={},_0x220d0a={},_0x15a6fb={'count':0x0,'rows':[]};var _0x294b48=_[_0x93b6('0x31')](db[_0x93b6('0x32')][_0x93b6('0x33')],function(_0x346903){return{'name':_0x346903[_0x93b6('0x34')],'type':_0x346903[_0x93b6('0x35')][_0x93b6('0x36')]};});_0x220d0a[_0x93b6('0x37')]=_[_0x93b6('0x31')](_0x294b48,'name');_0x220d0a['query']=_[_0x93b6('0x38')](_0x2a27e3[_0x93b6('0x39')]);_0x220d0a[_0x93b6('0x3a')]=_['intersection'](_0x220d0a[_0x93b6('0x37')],_0x220d0a[_0x93b6('0x39')]);_0x341207[_0x93b6('0x3b')]=_[_0x93b6('0x3c')](_0x220d0a[_0x93b6('0x37')],qs[_0x93b6('0x3d')](_0x2a27e3[_0x93b6('0x39')][_0x93b6('0x3d')]));_0x341207['attributes']=_0x341207['attributes'][_0x93b6('0x3e')]?_0x341207['attributes']:_0x220d0a['model'];if(!_0x2a27e3[_0x93b6('0x39')][_0x93b6('0x3f')](_0x93b6('0x40'))){_0x341207['limit']=qs[_0x93b6('0x21')](_0x2a27e3['query']['limit']);_0x341207[_0x93b6('0x1f')]=qs[_0x93b6('0x1f')](_0x2a27e3[_0x93b6('0x39')][_0x93b6('0x1f')]);}_0x341207[_0x93b6('0x41')]=qs[_0x93b6('0x42')](_0x2a27e3['query'][_0x93b6('0x42')]);_0x341207[_0x93b6('0x43')]=qs[_0x93b6('0x3a')](_[_0x93b6('0x44')](_0x2a27e3[_0x93b6('0x39')],_0x220d0a[_0x93b6('0x3a')]),_0x294b48);if(_0x2a27e3[_0x93b6('0x39')][_0x93b6('0x45')]){_0x341207['where']=_[_0x93b6('0x46')](_0x341207[_0x93b6('0x43')],{'$or':_[_0x93b6('0x31')](_0x294b48,function(_0x4ac79c){if(_0x4ac79c[_0x93b6('0x35')]!==_0x93b6('0x47')){var _0x5eb4f7={};_0x5eb4f7[_0x4ac79c['name']]={'$like':'%'+_0x2a27e3[_0x93b6('0x39')]['filter']+'%'};return _0x5eb4f7;}})});}_0x341207=_['merge']({},_0x341207,_0x2a27e3[_0x93b6('0x48')]);var _0x3edd82={'where':_0x341207[_0x93b6('0x43')]};return db[_0x93b6('0x32')][_0x93b6('0x22')](_0x3edd82)['then'](function(_0x2228bc){_0x15a6fb['count']=_0x2228bc;if(_0x2a27e3['query'][_0x93b6('0x49')]){_0x341207[_0x93b6('0x4a')]=[{'all':!![]}];}return db['Pause'][_0x93b6('0x4b')](_0x341207);})[_0x93b6('0x27')](function(_0x38d9f3){_0x15a6fb[_0x93b6('0x4c')]=_0x38d9f3;return _0x15a6fb;})[_0x93b6('0x27')](respondWithFilteredResult(_0x1dfaff,_0x341207))[_0x93b6('0x4d')](handleError(_0x1dfaff,null));};exports['show']=function(_0x5c6c14,_0x2b8cb9){var _0x32cb27={'raw':!![],'where':{'id':_0x5c6c14[_0x93b6('0x4e')]['id']}},_0x163b17={};_0x163b17[_0x93b6('0x37')]=_['keys'](db[_0x93b6('0x32')]['rawAttributes']);_0x163b17[_0x93b6('0x39')]=_[_0x93b6('0x38')](_0x5c6c14['query']);_0x163b17[_0x93b6('0x3a')]=_['intersection'](_0x163b17[_0x93b6('0x37')],_0x163b17[_0x93b6('0x39')]);_0x32cb27[_0x93b6('0x3b')]=_[_0x93b6('0x3c')](_0x163b17[_0x93b6('0x37')],qs[_0x93b6('0x3d')](_0x5c6c14[_0x93b6('0x39')][_0x93b6('0x3d')]));_0x32cb27[_0x93b6('0x3b')]=_0x32cb27[_0x93b6('0x3b')][_0x93b6('0x3e')]?_0x32cb27[_0x93b6('0x3b')]:_0x163b17[_0x93b6('0x37')];if(_0x5c6c14[_0x93b6('0x39')]['includeAll']){_0x32cb27[_0x93b6('0x4a')]=[{'all':!![]}];}_0x32cb27=_['merge']({},_0x32cb27,_0x5c6c14[_0x93b6('0x48')]);return db[_0x93b6('0x32')][_0x93b6('0x4f')](_0x32cb27)[_0x93b6('0x27')](handleEntityNotFound(_0x2b8cb9,null))[_0x93b6('0x27')](respondWithResult(_0x2b8cb9,null))[_0x93b6('0x4d')](handleError(_0x2b8cb9,null));};exports[_0x93b6('0x50')]=function(_0x47c19b,_0x4ee7b3){return db['Pause'][_0x93b6('0x50')](_0x47c19b[_0x93b6('0x51')],{})['then'](function(_0x1a566b){var _0x2f5011=_0x47c19b[_0x93b6('0x52')][_0x93b6('0x28')]({'plain':!![]});if(!_0x2f5011)throw new Error(_0x93b6('0x53'));if(_0x2f5011['role']===_0x93b6('0x52')){var _0x1e51aa=_0x1a566b[_0x93b6('0x28')]({'plain':!![]});var _0x1ec756=_0x93b6('0x29');return db[_0x93b6('0x54')][_0x93b6('0x4f')]({'where':{'name':_0x1ec756,'userProfileId':_0x2f5011[_0x93b6('0x55')]},'raw':!![]})[_0x93b6('0x27')](function(_0x1cb342){if(_0x1cb342&&_0x1cb342[_0x93b6('0x56')]===0x0){return db[_0x93b6('0x2a')]['create']({'name':_0x1e51aa[_0x93b6('0x2e')],'resourceId':_0x1e51aa['id'],'type':_0x1cb342[_0x93b6('0x2e')],'sectionId':_0x1cb342['id']},{})['then'](function(){return _0x1a566b;});}else{return _0x1a566b;}})[_0x93b6('0x4d')](function(_0x40b2b8){logger['error'](_0x93b6('0x57'),_0x40b2b8);throw _0x40b2b8;});}return _0x1a566b;})['then'](respondWithResult(_0x4ee7b3,0xc9))['catch'](handleError(_0x4ee7b3,null));};exports['update']=function(_0xb231b4,_0x297527){if(_0xb231b4[_0x93b6('0x51')]['id']){delete _0xb231b4[_0x93b6('0x51')]['id'];}return db[_0x93b6('0x32')][_0x93b6('0x4f')]({'where':{'id':_0xb231b4[_0x93b6('0x4e')]['id']}})[_0x93b6('0x27')](handleEntityNotFound(_0x297527,null))[_0x93b6('0x27')](saveUpdates(_0xb231b4[_0x93b6('0x51')],null))[_0x93b6('0x27')](respondWithResult(_0x297527,null))['catch'](handleError(_0x297527,null));};exports[_0x93b6('0x2b')]=function(_0x26c4c4,_0x24eada){return db[_0x93b6('0x32')][_0x93b6('0x4f')]({'where':{'id':_0x26c4c4[_0x93b6('0x4e')]['id']}})[_0x93b6('0x27')](handleEntityNotFound(_0x24eada,null))[_0x93b6('0x27')](removeEntity(_0x24eada,null))[_0x93b6('0x4d')](handleError(_0x24eada,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index e109a3d..6ec1c81 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 _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x268f2c,_0x35d9b4){var _0x37bef5=function(_0x8ef997){while(--_0x8ef997){_0x268f2c['push'](_0x268f2c['shift']());}};_0x37bef5(++_0x35d9b4);}(_0x814b,0x1a2));var _0xb814=function(_0x55257d,_0x3998ec){_0x55257d=_0x55257d-0x0;var _0x4d296d=_0x814b[_0x55257d];return _0x4d296d;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x49ada1,_0x52170f){var _0x3c08c8=function(_0x12f942){while(--_0x12f942){_0x49ada1['push'](_0x49ada1['shift']());}};_0x3c08c8(++_0x52170f);}(_0x5fab,0x177));var _0xb5fa=function(_0x27638d,_0x4094db){_0x27638d=_0x27638d-0x0;var _0x35da35=_0x5fab[_0x27638d];return _0x35da35;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index ec48f38..8cf44ce 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(_0x5f0eb1,_0x6048f6){var _0x151ef9=function(_0xcc722f){while(--_0xcc722f){_0x5f0eb1['push'](_0x5f0eb1['shift']());}};_0x151ef9(++_0x6048f6);}(_0xb10b,0x12a));var _0xbb10=function(_0x27e321,_0x222eb5){_0x27e321=_0x27e321-0x0;var _0x19ac6c=_0xb10b[_0x27e321];return _0x19ac6c;};'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(_0x5ccac6,_0x750631){var _0x59a198=function(_0x4d6bc5){while(--_0x4d6bc5){_0x5ccac6['push'](_0x5ccac6['shift']());}};_0x59a198(++_0x750631);}(_0xb10b,0x12a));var _0xbb10=function(_0x35ebae,_0x4f86c4){_0x35ebae=_0x35ebae-0x0;var _0x1924cf=_0xb10b[_0x35ebae];return _0x1924cf;};'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 ff30efc..606a129 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','upload','webhookPost','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x3324b8,_0x14ba83){var _0x2500b3=function(_0x396f34){while(--_0x396f34){_0x3324b8['push'](_0x3324b8['shift']());}};_0x2500b3(++_0x14ba83);}(_0xbec5,0xe5));var _0x5bec=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0xbec5[_0x11deef];return _0xe9ba85;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),controller[_0x5bec('0xc')]);router[_0x5bec('0x9')](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0xf')]);router['get'](_0x5bec('0x10'),auth['isAuthenticated'](),controller[_0x5bec('0x11')]);var upload=multer({'storage':multer[_0x5bec('0x12')]({'destination':function(_0x117162,_0x4a5482,_0x288d1b){_0x288d1b(null,path[_0x5bec('0x13')](config[_0x5bec('0x14')],'server/files/plugins'));},'filename':function(_0x6bee21,_0x1c888f,_0x589d14){_0x1c888f[_0x5bec('0x15')]=_0x1c888f[_0x5bec('0x15')][_0x5bec('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589d14(null,util[_0x5bec('0x17')](_0x5bec('0x18'),path[_0x5bec('0x19')](_0x1c888f[_0x5bec('0x15')],path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])),Date[_0x5bec('0x1b')](),path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])));}})});router[_0x5bec('0x1c')]('/',upload['single']('file'),controller[_0x5bec('0x1d')]);router[_0x5bec('0x1c')](_0x5bec('0xb'),controller[_0x5bec('0x1e')]);router['put']('/:id',auth[_0x5bec('0xe')](),controller[_0x5bec('0x1f')]);router['delete'](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0x20')]);module[_0x5bec('0x21')]=router; \ No newline at end of file +var _0xb458=['show','/:id/download','diskStorage','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','upload','webhookPost','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','index','get','/webhook','webhookGet','isAuthenticated'];(function(_0x4ac6ca,_0x190469){var _0x43cbdc=function(_0x1c861b){while(--_0x1c861b){_0x4ac6ca['push'](_0x4ac6ca['shift']());}};_0x43cbdc(++_0x190469);}(_0xb458,0x103));var _0x8b45=function(_0x3ab0f7,_0x421925){_0x3ab0f7=_0x3ab0f7-0x0;var _0x55ab91=_0xb458[_0x3ab0f7];return _0x55ab91;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var fs_extra=require(_0x8b45('0x4'));var auth=require(_0x8b45('0x5'));var interaction=require(_0x8b45('0x6'));var config=require('../../config/environment');var controller=require(_0x8b45('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b45('0x8')]);router[_0x8b45('0x9')](_0x8b45('0xa'),controller[_0x8b45('0xb')]);router[_0x8b45('0x9')]('/:id',auth[_0x8b45('0xc')](),controller[_0x8b45('0xd')]);router[_0x8b45('0x9')](_0x8b45('0xe'),auth[_0x8b45('0xc')](),controller['download']);var upload=multer({'storage':multer[_0x8b45('0xf')]({'destination':function(_0x7cc49b,_0x57faf9,_0x5316af){_0x5316af(null,path['join'](config['root'],_0x8b45('0x10')));},'filename':function(_0x285728,_0x37c220,_0x52c4db){_0x37c220[_0x8b45('0x11')]=_0x37c220[_0x8b45('0x11')][_0x8b45('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52c4db(null,util[_0x8b45('0x13')](_0x8b45('0x14'),path[_0x8b45('0x15')](_0x37c220['originalname'],path['extname'](_0x37c220[_0x8b45('0x11')])),Date[_0x8b45('0x16')](),path[_0x8b45('0x17')](_0x37c220[_0x8b45('0x11')])));}})});router[_0x8b45('0x18')]('/',upload[_0x8b45('0x19')](_0x8b45('0x1a')),controller[_0x8b45('0x1b')]);router[_0x8b45('0x18')](_0x8b45('0xa'),controller[_0x8b45('0x1c')]);router[_0x8b45('0x1d')](_0x8b45('0x1e'),auth[_0x8b45('0xc')](),controller[_0x8b45('0x1f')]);router[_0x8b45('0x20')](_0x8b45('0x1e'),auth[_0x8b45('0xc')](),controller['delete']);module[_0x8b45('0x21')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 2b9788b..5308ca9 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 _0x4c69=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x1a8d89,_0x12c91d){var _0xb41953=function(_0x3d4777){while(--_0x3d4777){_0x1a8d89['push'](_0x1a8d89['shift']());}};_0xb41953(++_0x12c91d);}(_0x4c69,0x1e5));var _0x94c6=function(_0x2e9523,_0x5608bb){_0x2e9523=_0x2e9523-0x0;var _0x401c7f=_0x4c69[_0x2e9523];return _0x401c7f;};'use strict';var Sequelize=require(_0x94c6('0x0'));module[_0x94c6('0x1')]={'name':{'type':Sequelize[_0x94c6('0x2')]},'type':{'type':Sequelize[_0x94c6('0x3')](_0x94c6('0x4'),_0x94c6('0x5'))},'description':{'type':Sequelize[_0x94c6('0x6')]},'version':{'type':Sequelize[_0x94c6('0x6')]},'path':{'type':Sequelize['STRING'],'comment':_0x94c6('0x7')},'active':{'type':Sequelize[_0x94c6('0x8')],'defaultValue':0x0,'comment':_0x94c6('0x9')},'sidebar':{'type':Sequelize[_0x94c6('0x3')](_0x94c6('0xa'),_0x94c6('0xb'),_0x94c6('0xc'),_0x94c6('0xd')),'defaultValue':_0x94c6('0xc'),'comment':_0x94c6('0xe')},'icon':{'type':Sequelize[_0x94c6('0x2')]},'adminUrl':{'type':Sequelize[_0x94c6('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x94c6('0x2')]},'scriptPath':{'type':Sequelize[_0x94c6('0x2')]}}; \ No newline at end of file +var _0xff7f=['script','TEXT','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x2ab84a,_0x24cb76){var _0x5330e1=function(_0x57a48a){while(--_0x57a48a){_0x2ab84a['push'](_0x2ab84a['shift']());}};_0x5330e1(++_0x24cb76);}(_0xff7f,0x1b7));var _0xfff7=function(_0x7bdfc6,_0x17e1b9){_0x7bdfc6=_0x7bdfc6-0x0;var _0x23d65f=_0xff7f[_0x7bdfc6];return _0x23d65f;};'use strict';var Sequelize=require(_0xfff7('0x0'));module[_0xfff7('0x1')]={'name':{'type':Sequelize[_0xfff7('0x2')]},'type':{'type':Sequelize[_0xfff7('0x3')](_0xfff7('0x4'),_0xfff7('0x5'))},'description':{'type':Sequelize[_0xfff7('0x6')]},'version':{'type':Sequelize[_0xfff7('0x6')]},'path':{'type':Sequelize[_0xfff7('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xfff7('0x3')](_0xfff7('0x7'),_0xfff7('0x8'),_0xfff7('0x9'),_0xfff7('0xa')),'defaultValue':_0xfff7('0x9'),'comment':_0xfff7('0xb')},'icon':{'type':Sequelize[_0xfff7('0x2')]},'adminUrl':{'type':Sequelize[_0xfff7('0x2')]},'agentUrl':{'type':Sequelize[_0xfff7('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 9f65f60..34c0f3e 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 _0x05b2=['Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','join','root','server/files/plugins','format','basename','zip','warning','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','finalize','existsSync','Plugin\x20not\x20found','download','%s.zip','Error','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','Warning:\x20admin\x20view\x20not\x20specified','test','plugins','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','json','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','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','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy'];(function(_0x28ff20,_0x59da9c){var _0x1aaa85=function(_0x51c15e){while(--_0x51c15e){_0x28ff20['push'](_0x28ff20['shift']());}};_0x1aaa85(++_0x59da9c);}(_0x05b2,0x7a));var _0x205b=function(_0x551239,_0x4258f9){_0x551239=_0x551239-0x0;var _0x22de9f=_0x05b2[_0x551239];return _0x22de9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x205b('0x0'));var zipdir=require(_0x205b('0x1'));var jsonpatch=require(_0x205b('0x2'));var rp=require(_0x205b('0x3'));var moment=require(_0x205b('0x4'));var BPromise=require(_0x205b('0x5'));var Mustache=require(_0x205b('0x6'));var util=require(_0x205b('0x7'));var path=require(_0x205b('0x8'));var sox=require(_0x205b('0x9'));var csv=require(_0x205b('0xa'));var ejs=require(_0x205b('0xb'));var fs=require('fs');var fs_extra=require(_0x205b('0xc'));var _=require(_0x205b('0xd'));var squel=require(_0x205b('0xe'));var crypto=require(_0x205b('0xf'));var jsforce=require(_0x205b('0x10'));var deskjs=require(_0x205b('0x11'));var toCsv=require(_0x205b('0xa'));var querystring=require(_0x205b('0x12'));var Papa=require(_0x205b('0x13'));var extract=require(_0x205b('0x14'));var rimraf=require('rimraf');var archiver=require(_0x205b('0x15'));var Redis=require(_0x205b('0x16'));var authService=require(_0x205b('0x17'));var qs=require('../../components/parsers/qs');var as=require(_0x205b('0x18'));var hardwareService=require(_0x205b('0x19'));var logger=require(_0x205b('0x1a'))('api');var utils=require(_0x205b('0x1b'));var config=require(_0x205b('0x1c'));var licenseUtil=require(_0x205b('0x1d'));var db=require(_0x205b('0x1e'))['db'];config['redis']=_[_0x205b('0x1f')](config[_0x205b('0x20')],{'host':_0x205b('0x21'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x205b('0x20')]));require(_0x205b('0x22'))[_0x205b('0x23')](socket);function respondWithStatusCode(_0xaf930b,_0xbb6cd5){_0xbb6cd5=_0xbb6cd5||0xcc;return function(_0x7a1a16){if(_0x7a1a16){return _0xaf930b[_0x205b('0x24')](_0xbb6cd5);}return _0xaf930b[_0x205b('0x25')](_0xbb6cd5)[_0x205b('0x26')]();};}function respondWithResult(_0x5888cb,_0x438352){_0x438352=_0x438352||0xc8;return function(_0x59d8a0){if(_0x59d8a0){return _0x5888cb[_0x205b('0x25')](_0x438352)['json'](_0x59d8a0);}};}function respondWithFilteredResult(_0x2e75d3,_0x4bde45){return function(_0x5e7bb6){if(_0x5e7bb6){var _0x146b68=typeof _0x4bde45[_0x205b('0x27')]===_0x205b('0x28')&&typeof _0x4bde45[_0x205b('0x29')]===_0x205b('0x28');var _0x4dfc92=_0x5e7bb6[_0x205b('0x2a')];var _0x410108=_0x146b68?0x0:_0x4bde45[_0x205b('0x27')];var _0x4a1bb4=_0x146b68?_0x5e7bb6[_0x205b('0x2a')]:_0x4bde45[_0x205b('0x27')]+_0x4bde45[_0x205b('0x29')];var _0x158e75;if(_0x4a1bb4>=_0x4dfc92){_0x4a1bb4=_0x4dfc92;_0x158e75=0xc8;}else{_0x158e75=0xce;}_0x2e75d3[_0x205b('0x25')](_0x158e75);return _0x2e75d3[_0x205b('0x2b')](_0x205b('0x2c'),_0x410108+'-'+_0x4a1bb4+'/'+_0x4dfc92)['json'](_0x5e7bb6);}return null;};}function patchUpdates(_0x395c19){return function(_0x51f2d6){try{jsonpatch[_0x205b('0x2d')](_0x51f2d6,_0x395c19,!![]);}catch(_0x4262c8){return BPromise['reject'](_0x4262c8);}return _0x51f2d6[_0x205b('0x2e')]();};}function saveUpdates(_0x12e3eb,_0x47749d){return function(_0x387680){if(_0x387680){return _0x387680[_0x205b('0x2f')](_0x12e3eb)[_0x205b('0x30')](function(_0x2f7374){return _0x2f7374;});}return null;};}function removeEntity(_0x34a74e,_0xb9f2f4){return function(_0x3872c3){if(_0x3872c3){return _0x3872c3[_0x205b('0x31')]()['then'](function(){var _0x2543a2=_0x3872c3['get']({'plain':!![]});var _0x2dd007=_0x205b('0x32');return db[_0x205b('0x33')][_0x205b('0x31')]({'where':{'type':_0x2dd007,'resourceId':_0x2543a2['id']}})[_0x205b('0x30')](function(){return _0x3872c3;});})['then'](function(){_0x34a74e[_0x205b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x136b02,_0x5a16f5){return function(_0x17c5f1){if(!_0x17c5f1){_0x136b02[_0x205b('0x24')](0x194);}return _0x17c5f1;};}function handleError(_0x1bcab7,_0x5acb7d){_0x5acb7d=_0x5acb7d||0x1f4;return function(_0x5aa7c7){logger[_0x205b('0x34')](_0x5aa7c7[_0x205b('0x35')]);if(_0x5aa7c7[_0x205b('0x36')]){delete _0x5aa7c7[_0x205b('0x36')];}_0x1bcab7[_0x205b('0x25')](_0x5acb7d)[_0x205b('0x37')](_0x5aa7c7);};}exports[_0x205b('0x38')]=function(_0x1c7bb8,_0x31692f){var _0x1613e2={},_0x2bdc67={},_0x30a9e8={'count':0x0,'rows':[]};var _0x274678=_[_0x205b('0x39')](db[_0x205b('0x3a')][_0x205b('0x3b')],function(_0x3bafec){return{'name':_0x3bafec[_0x205b('0x3c')],'type':_0x3bafec[_0x205b('0x3d')][_0x205b('0x3e')]};});_0x2bdc67[_0x205b('0x3f')]=_[_0x205b('0x39')](_0x274678,'name');_0x2bdc67[_0x205b('0x40')]=_[_0x205b('0x41')](_0x1c7bb8[_0x205b('0x40')]);_0x2bdc67[_0x205b('0x42')]=_['intersection'](_0x2bdc67[_0x205b('0x3f')],_0x2bdc67['query']);_0x1613e2[_0x205b('0x43')]=_[_0x205b('0x44')](_0x2bdc67[_0x205b('0x3f')],qs[_0x205b('0x45')](_0x1c7bb8[_0x205b('0x40')][_0x205b('0x45')]));_0x1613e2[_0x205b('0x43')]=_0x1613e2[_0x205b('0x43')]['length']?_0x1613e2['attributes']:_0x2bdc67[_0x205b('0x3f')];if(!_0x1c7bb8[_0x205b('0x40')]['hasOwnProperty'](_0x205b('0x46'))){_0x1613e2[_0x205b('0x29')]=qs[_0x205b('0x29')](_0x1c7bb8[_0x205b('0x40')][_0x205b('0x29')]);_0x1613e2[_0x205b('0x27')]=qs['offset'](_0x1c7bb8[_0x205b('0x40')][_0x205b('0x27')]);}_0x1613e2['order']=qs[_0x205b('0x47')](_0x1c7bb8[_0x205b('0x40')][_0x205b('0x47')]);_0x1613e2[_0x205b('0x48')]=qs[_0x205b('0x42')](_['pick'](_0x1c7bb8['query'],_0x2bdc67['filters']),_0x274678);if(_0x1c7bb8[_0x205b('0x40')][_0x205b('0x49')]){_0x1613e2['where']=_[_0x205b('0x4a')](_0x1613e2[_0x205b('0x48')],{'$or':_['map'](_0x274678,function(_0x125415){if(_0x125415['type']!==_0x205b('0x4b')){var _0x22b4cc={};_0x22b4cc[_0x125415[_0x205b('0x36')]]={'$like':'%'+_0x1c7bb8[_0x205b('0x40')][_0x205b('0x49')]+'%'};return _0x22b4cc;}})});}_0x1613e2=_[_0x205b('0x4a')]({},_0x1613e2,_0x1c7bb8[_0x205b('0x4c')]);var _0x23fbe2={'where':_0x1613e2[_0x205b('0x48')]};return db[_0x205b('0x3a')][_0x205b('0x2a')](_0x23fbe2)[_0x205b('0x30')](function(_0x55a4a3){_0x30a9e8['count']=_0x55a4a3;if(_0x1c7bb8[_0x205b('0x40')][_0x205b('0x4d')]){_0x1613e2['include']=[{'all':!![]}];}return db[_0x205b('0x3a')][_0x205b('0x4e')](_0x1613e2);})['then'](function(_0x334b68){_0x30a9e8[_0x205b('0x4f')]=_0x334b68;return _0x30a9e8;})['then'](respondWithFilteredResult(_0x31692f,_0x1613e2))[_0x205b('0x50')](handleError(_0x31692f,null));};exports[_0x205b('0x51')]=function(_0x37d08c,_0x33a584){var _0xa83b9a={'raw':!![],'where':{'id':_0x37d08c[_0x205b('0x52')]['id']}},_0x524f28={};_0x524f28['model']=_['keys'](db[_0x205b('0x3a')][_0x205b('0x3b')]);_0x524f28['query']=_[_0x205b('0x41')](_0x37d08c[_0x205b('0x40')]);_0x524f28['filters']=_[_0x205b('0x44')](_0x524f28[_0x205b('0x3f')],_0x524f28[_0x205b('0x40')]);_0xa83b9a[_0x205b('0x43')]=_[_0x205b('0x44')](_0x524f28[_0x205b('0x3f')],qs[_0x205b('0x45')](_0x37d08c[_0x205b('0x40')][_0x205b('0x45')]));_0xa83b9a[_0x205b('0x43')]=_0xa83b9a[_0x205b('0x43')][_0x205b('0x53')]?_0xa83b9a['attributes']:_0x524f28[_0x205b('0x3f')];if(_0x37d08c['query']['includeAll']){_0xa83b9a[_0x205b('0x54')]=[{'all':!![]}];}_0xa83b9a=_['merge']({},_0xa83b9a,_0x37d08c['options']);return db[_0x205b('0x3a')]['find'](_0xa83b9a)[_0x205b('0x30')](handleEntityNotFound(_0x33a584,null))[_0x205b('0x30')](respondWithResult(_0x33a584,null))[_0x205b('0x50')](handleError(_0x33a584,null));};exports['download']=function(_0x12281b,_0x3f548f,_0x5c4b0b){return db[_0x205b('0x3a')][_0x205b('0x55')]({'where':{'id':_0x12281b['params']['id']},'attributes':['name',_0x205b('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x3f548f,null))['then'](function(_0xd26918){if(_0xd26918){var _0x19de71=path[_0x205b('0x56')](config[_0x205b('0x57')],_0x205b('0x58'),util[_0x205b('0x59')]('%s.zip',path[_0x205b('0x5a')](_0xd26918[_0x205b('0x8')])));var _0x2e1ce2=fs['createWriteStream'](_0x19de71);var _0x5488b9=archiver(_0x205b('0x5b'),{'zlib':{'level':0x9}});_0x5488b9['on'](_0x205b('0x5c'),function(_0x597416){if(_0x597416['code']===_0x205b('0x5d')){logger[_0x205b('0x34')](_0x597416);}else{throw new db['Sequelize']['Error'](_0x205b('0x5e'));}});_0x5488b9['on']('error',function(_0x2e1247){throw new db[(_0x205b('0x5f'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5488b9[_0x205b('0x60')](_0x2e1ce2);_0x5488b9[_0x205b('0x61')]('**/*',{'cwd':path['join'](config[_0x205b('0x57')],_0x205b('0x58'),path['dirname'](_0xd26918[_0x205b('0x8')])),'ignore':[path[_0x205b('0x56')](path[_0x205b('0x5a')](_0xd26918[_0x205b('0x8')]),'node_modules/**/*'),path['join'](path['basename'](_0xd26918[_0x205b('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x205b('0x62')]();_0x2e1ce2['on']('close',function(){if(!fs[_0x205b('0x63')](_0x19de71)){throw new db[(_0x205b('0x5f'))]['Error'](_0x205b('0x64'));}return _0x3f548f[_0x205b('0x65')](_0x19de71,util[_0x205b('0x59')](_0x205b('0x66'),path['basename'](_0xd26918[_0x205b('0x8')])),function(_0x2a9dae){if(_0x2a9dae){throw new db[(_0x205b('0x5f'))][(_0x205b('0x67'))](_0x205b('0x68'));}fs[_0x205b('0x69')](_0x19de71);logger['info'](_0x205b('0x6a'));logger[_0x205b('0x6b')](_0x205b('0x6c'));});});}return null;})[_0x205b('0x50')](handleError(_0x3f548f,null));};exports[_0x205b('0x6d')]=function(_0x5980e2,_0xe2a375,_0x4f28e1){var _0x42bcd1=path[_0x205b('0x5a')](_0x5980e2[_0x205b('0x6e')][_0x205b('0x6f')],path[_0x205b('0x70')](_0x5980e2['file'][_0x205b('0x6f')]));var _0x26e487=path[_0x205b('0x56')](config[_0x205b('0x57')],_0x205b('0x58'),_0x5980e2[_0x205b('0x6e')][_0x205b('0x6f')]);var _0x329eff=path[_0x205b('0x56')](config[_0x205b('0x57')],_0x205b('0x58'),_0x42bcd1);logger[_0x205b('0x6b')](_0x205b('0x71'),_0x26e487);logger[_0x205b('0x6b')](_0x205b('0x72'),_0x329eff);try{fs['chmodSync'](_0x26e487,parseInt(_0x205b('0x73'),0x8));extract(_0x26e487,{'dir':_0x329eff},function(_0x5babd3){if(_0x5babd3){logger['error'](_0x5babd3);handleError(_0x5babd3,!![]);};var _0x1f9343=fs[_0x205b('0x74')](_0x329eff);if(_0x1f9343[_0x205b('0x53')]>0x1){removeReferences(_0x26e487,_0x329eff);logger[_0x205b('0x34')](_0x205b('0x75'));return _0x4f28e1(new Error(_0x205b('0x75')));}var _0x3ed30d=fs[_0x205b('0x76')](path[_0x205b('0x56')](_0x329eff,_0x1f9343[0x0]));if(_0x3ed30d['isFile']()){removeReferences(_0x26e487,_0x329eff);logger[_0x205b('0x34')](_0x205b('0x75'));return _0x4f28e1(new Error(_0x205b('0x75')));}if(_0x3ed30d['isDirectory']()){var _0x3559b1=fs[_0x205b('0x74')](path[_0x205b('0x56')](_0x329eff,_0x1f9343[0x0]));if(_0x3559b1[_0x205b('0x53')]===0x0){removeReferences(_0x26e487,_0x329eff);logger[_0x205b('0x34')](_0x205b('0x75'));return _0x4f28e1(new Error('Invalid\x20plugin\x20structure'));}var _0xe85ea=_0x3559b1[_0x205b('0x77')](function(_0x5b840c){return _0x5b840c==='manifest.json';});if(!_0xe85ea){return _0x4f28e1(new Error(_0x205b('0x78')));}var _0x24de5d=fs['readFileSync'](path[_0x205b('0x56')](_0x329eff,_0x1f9343[0x0],_0x205b('0x79')));var _0x55a849=JSON[_0x205b('0x7a')](_0x24de5d);if(_0x205b('0x28')==typeof _0x55a849[_0x205b('0x36')]){return _0x4f28e1(new Error(_0x205b('0x7b')));}if(_0x205b('0x28')==typeof _0x55a849['type']){return _0x4f28e1(new Error(_0x205b('0x7c')));}if(_0x205b('0x28')==typeof _0x55a849[_0x205b('0x7d')]){return _0x4f28e1(new Error(_0x205b('0x7e')));}if('undefined'==typeof _0x55a849[_0x205b('0x7f')]){return _0x4f28e1(new Error(_0x205b('0x80')));}if(_0x55a849['type']===_0x205b('0x81')){if(_0x205b('0x28')==typeof _0x55a849[_0x205b('0x7f')][_0x205b('0x82')]){return _0x4f28e1(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x205b('0x28')==typeof _0x55a849['parameters'][_0x205b('0x82')][_0x205b('0x83')]&&_0x205b('0x28')==typeof _0x55a849[_0x205b('0x7f')]['views'][_0x205b('0x84')]){return _0x4f28e1(new Error(_0x205b('0x85')));}}else if(_0x55a849[_0x205b('0x3d')]===_0x205b('0x86')){if(_0x205b('0x28')==typeof _0x55a849['parameters']['scriptName']){return _0x4f28e1(new Error(_0x205b('0x87')));}if(_0x205b('0x28')==typeof _0x55a849[_0x205b('0x7f')][_0x205b('0x88')]){return _0x4f28e1(new Error(_0x205b('0x89')));}}else{return _0x4f28e1(new Error(_0x205b('0x8a')));}var _0x27e44d=_0x55a849[_0x205b('0x36')];var _0x18148b=_0x55a849['description'];var _0x4ae588=_0x55a849['type'];var _0xf6bb7b=_0x55a849[_0x205b('0x8b')]?_0x55a849[_0x205b('0x8b')]:'always';var _0x3f7df6=_0x55a849[_0x205b('0x8c')]?_0x55a849[_0x205b('0x8c')]:_0x205b('0x8d');var _0x31179f='';var _0xc84995='';var _0x486375='';var _0x240c1e='';var _0x2abf5a=_0x55a849[_0x205b('0x7d')];if(_0x4ae588===_0x205b('0x81')){if(_0x205b('0x28')!=typeof _0x55a849[_0x205b('0x7f')]['views'][_0x205b('0x83')]){var _0x452ca1=_0x55a849['parameters'][_0x205b('0x82')][_0x205b('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x452ca1)){_0x31179f=path[_0x205b('0x56')]('plugins',_0x42bcd1,_0x1f9343[0x0],_0x452ca1);}else{_0x31179f=_0x452ca1;}}else{logger[_0x205b('0x6b')](_0x205b('0x8e'));}if(_0x205b('0x28')!=typeof _0x55a849[_0x205b('0x7f')][_0x205b('0x82')][_0x205b('0x84')]){var _0x47f604=_0x55a849[_0x205b('0x7f')]['views'][_0x205b('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x205b('0x8f')](_0x47f604)){_0xc84995=path['join'](_0x205b('0x90'),_0x42bcd1,_0x1f9343[0x0],_0x47f604);}else{_0xc84995=_0x47f604;}}else{logger[_0x205b('0x6b')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x4ae588==='script'){_0x486375=_0x55a849[_0x205b('0x7f')]['scriptName'];_0x240c1e=_0x55a849[_0x205b('0x7f')][_0x205b('0x88')];if(_0x205b('0x28')!=typeof _0x55a849['parameters'][_0x205b('0x82')]){if(_0x205b('0x28')!=typeof _0x55a849[_0x205b('0x7f')][_0x205b('0x82')][_0x205b('0x83')]){var _0x452ca1=_0x55a849[_0x205b('0x7f')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x205b('0x8f')](_0x452ca1)){_0x31179f=path['join']('plugins',_0x42bcd1,_0x1f9343[0x0],_0x452ca1);}else{_0x31179f=_0x452ca1;}}if('undefined'!=typeof _0x55a849[_0x205b('0x7f')][_0x205b('0x82')]['agent']){var _0x47f604=_0x55a849[_0x205b('0x7f')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x205b('0x8f')](_0x47f604)){_0xc84995=path[_0x205b('0x56')](_0x205b('0x90'),_0x42bcd1,_0x1f9343[0x0],_0x47f604);}else{_0xc84995=_0x47f604;}}}}var _0x44d6be={'name':_0x27e44d,'description':_0x18148b,'path':path[_0x205b('0x56')](_0x42bcd1,_0x1f9343[0x0]),'type':_0x4ae588,'sidebar':_0xf6bb7b,'icon':_0x3f7df6,'adminUrl':_0x31179f,'agentUrl':_0xc84995,'scriptName':_0x486375,'scriptPath':_0x240c1e,'version':_0x2abf5a};removeReferences(_0x26e487,null);return db[_0x205b('0x3a')]['create'](_0x44d6be)[_0x205b('0x30')](function(_0x299b03){var _0x4c0168={'role':_0x5980e2['body'][_0x205b('0x91')],'userProfileId':_0x5980e2[_0x205b('0x92')][_0x205b('0x93')]};if(!_0x4c0168)throw new Error(_0x205b('0x94'));if(_0x4c0168[_0x205b('0x91')]==='user'){var _0x5128fc=_0x299b03['get']({'plain':!![]});return db[_0x205b('0x95')][_0x205b('0x55')]({'where':{'name':_0x205b('0x32'),'userProfileId':_0x4c0168[_0x205b('0x93')]},'raw':!![]})['then'](function(_0x43171d){if(_0x43171d&&_0x43171d[_0x205b('0x96')]===0x0){return db[_0x205b('0x33')][_0x205b('0x97')]({'name':_0x5128fc[_0x205b('0x36')],'resourceId':_0x5128fc['id'],'type':_0x43171d[_0x205b('0x36')],'sectionId':_0x43171d['id']},{})[_0x205b('0x30')](function(){return _0x299b03;});}else{return _0x299b03;}})[_0x205b('0x50')](function(_0x40a4e5){logger[_0x205b('0x34')](_0x205b('0x98'),_0x40a4e5);throw _0x40a4e5;});}return _0x299b03;})[_0x205b('0x30')](respondWithResult(_0xe2a375,null))[_0x205b('0x50')](handleError(_0xe2a375,null));}});}catch(_0x186776){_0xe2a375[_0x205b('0x25')](0x1f4)[_0x205b('0x37')](_0x186776);}};function removeReferences(_0x4b52e8,_0x23eac0){try{if(_0x4b52e8){fs['unlinkSync'](_0x4b52e8);logger[_0x205b('0x6b')](_0x205b('0x99'));}if(_0x23eac0){rimraf(_0x23eac0,function(){});logger[_0x205b('0x6b')](_0x205b('0x9a'));}}catch(_0x1c7f85){logger[_0x205b('0x34')](_0x1c7f85);}}exports[_0x205b('0x2f')]=function(_0x2ff191,_0x4bc6fb,_0x24a1bb){return db[_0x205b('0x3a')]['find']({'where':{'id':_0x2ff191['params']['id']}})[_0x205b('0x30')](handleEntityNotFound(_0x4bc6fb,null))[_0x205b('0x30')](saveUpdates(_0x2ff191[_0x205b('0x92')],null))[_0x205b('0x30')](respondWithResult(_0x4bc6fb,null))[_0x205b('0x50')](handleError(_0x4bc6fb,null));};exports[_0x205b('0x9b')]=function(_0x55aeaa,_0x4ab7f3,_0x4874c2){return db[_0x205b('0x3a')][_0x205b('0x55')]({'where':{'id':_0x55aeaa['params']['id']}})['then'](function(_0x26bd1d){if(_0x26bd1d){return _0x26bd1d[_0x205b('0x31')]();}})[_0x205b('0x30')](function(_0x44e68e){rimraf(path[_0x205b('0x56')](config[_0x205b('0x57')],_0x205b('0x58'),path[_0x205b('0x9c')](_0x44e68e[_0x205b('0x8')])),function(){});return _0x44e68e;})[_0x205b('0x30')](handleEntityNotFound(_0x4ab7f3,null))[_0x205b('0x30')](respondWithStatusCode(_0x4ab7f3,null))['catch'](handleError(_0x4ab7f3,null));};exports[_0x205b('0x9d')]=function(_0x2fddf6,_0x5c5055,_0x50b585){return BPromise['resolve']()[_0x205b('0x30')](function(){if(!_0x2fddf6[_0x205b('0x40')][_0x205b('0x8')]){throw new Error(_0x205b('0x9e'));}if(!_0x2fddf6[_0x205b('0x40')][_0x205b('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x324e4e=_0x2fddf6[_0x205b('0x40')][_0x205b('0xa0')]?_0x2fddf6[_0x205b('0x40')][_0x205b('0xa0')]+':'+_0x2fddf6[_0x205b('0x40')][_0x205b('0x9f')]:_0x205b('0xa1')+_0x2fddf6[_0x205b('0x40')][_0x205b('0x9f')];var _0x4575dc=_0x2fddf6[_0x205b('0x40')][_0x205b('0xa2')]?_0x2fddf6[_0x205b('0x40')][_0x205b('0xa2')]:!![];var _0x4cbc45=_0x2fddf6[_0x205b('0x40')][_0x205b('0xa3')]?_0x2fddf6['query'][_0x205b('0xa3')]:null;var _0xaea040={'method':_0x2fddf6['method'],'uri':util[_0x205b('0x59')](_0x205b('0xa4'),_0x324e4e,_0x2fddf6[_0x205b('0x40')][_0x205b('0x8')]),'json':_0x4575dc,'resolveWithFullResponse':!![],'encoding':_0x4cbc45,'qs':_0x2fddf6[_0x205b('0x40')]};if(_0x2fddf6[_0x205b('0xa5')]){_0xaea040['headers']=_0x2fddf6[_0x205b('0xa5')];if(_0xaea040[_0x205b('0xa5')][_0x205b('0xa6')]){delete _0xaea040[_0x205b('0xa5')][_0x205b('0xa6')];}}if(_0xaea040[_0x205b('0xa5')][_0x205b('0xa7')]){delete _0xaea040[_0x205b('0xa5')][_0x205b('0xa7')];}return rp(_0xaea040);})[_0x205b('0x30')](function(_0x2c5daf){if(_0x2c5daf){_0x5c5055[_0x205b('0x2b')](_0x2c5daf[_0x205b('0xa5')]);logger[_0x205b('0x6b')](_0x2c5daf[_0x205b('0x92')]);if(_[_0x205b('0xa8')](_0x2fddf6[_0x205b('0x40')][_0x205b('0x8')],'download')&&_0x2c5daf[_0x205b('0xa9')]==0x1f4){return _0x5c5055[_0x205b('0x24')](_0x2c5daf['statusCode']);}else{return _0x5c5055[_0x205b('0x25')](_0x2c5daf[_0x205b('0xa9')])[_0x205b('0x37')](_0x2c5daf[_0x205b('0x92')]);}}else{return _0x5c5055[_0x205b('0x24')](0xc8);}})[_0x205b('0x50')](handleError(_0x5c5055,null));};exports['webhookPost']=function(_0x4dc83d,_0x3faae9,_0x1de715){return BPromise[_0x205b('0xaa')]()[_0x205b('0x30')](function(){if(!_0x4dc83d[_0x205b('0x40')][_0x205b('0x8')]){throw new Error(_0x205b('0x9e'));}if(!_0x4dc83d['query'][_0x205b('0x9f')]){throw new Error(_0x205b('0xab'));}var _0x1267ed=_0x4dc83d[_0x205b('0x40')][_0x205b('0xa0')]?_0x4dc83d['query'][_0x205b('0xa0')]+':'+_0x4dc83d['query'][_0x205b('0x9f')]:'http://localhost:'+_0x4dc83d[_0x205b('0x40')][_0x205b('0x9f')];var _0x135e2e=_0x4dc83d[_0x205b('0x40')][_0x205b('0xa2')]?_0x4dc83d[_0x205b('0x40')][_0x205b('0xa2')]:!![];var _0x52e6b9=_0x4dc83d[_0x205b('0x40')][_0x205b('0xa3')]?_0x4dc83d[_0x205b('0x40')]['encoding']:null;var _0x2a17f4={'method':_0x4dc83d['method'],'uri':util[_0x205b('0x59')](_0x205b('0xa4'),_0x1267ed,_0x4dc83d[_0x205b('0x40')]['path']),'json':_0x135e2e,'resolveWithFullResponse':!![],'encoding':_0x52e6b9,'body':_0x4dc83d[_0x205b('0x92')]};if(_0x4dc83d[_0x205b('0xa5')]){_0x2a17f4[_0x205b('0xa5')]=_0x4dc83d['headers'];if(_0x2a17f4[_0x205b('0xa5')][_0x205b('0xa6')]){delete _0x2a17f4[_0x205b('0xa5')]['content-length'];}}if(_0x2a17f4['headers'][_0x205b('0xa7')]){delete _0x2a17f4[_0x205b('0xa5')][_0x205b('0xa7')];}return rp(_0x2a17f4);})[_0x205b('0x30')](function(_0x4a69b0){if(_0x4a69b0){_0x3faae9['set'](_0x4a69b0[_0x205b('0xa5')]);logger[_0x205b('0x6b')](_0x4a69b0[_0x205b('0x92')]);return _0x3faae9['status'](_0x4a69b0[_0x205b('0xa9')])['send'](_0x4a69b0[_0x205b('0x92')]);}else{return _0x3faae9['sendStatus'](0xc8);}})['catch'](handleError(_0x3faae9,null));}; \ No newline at end of file +var _0x59e9=['Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','admin','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','body','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','format','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','method','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','get','sendStatus','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','query','keys','intersection','attributes','fields','model','hasOwnProperty','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','length','find','download','root','%s.zip','basename','createWriteStream','zip','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','join','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0x59e9,0x19d));var _0x959e=function(_0x4e4d94,_0x442eae){_0x4e4d94=_0x4e4d94-0x0;var _0x330a1f=_0x59e9[_0x4e4d94];return _0x330a1f;};'use strict';var emlformat=require(_0x959e('0x0'));var rimraf=require(_0x959e('0x1'));var zipdir=require(_0x959e('0x2'));var jsonpatch=require(_0x959e('0x3'));var rp=require(_0x959e('0x4'));var moment=require(_0x959e('0x5'));var BPromise=require(_0x959e('0x6'));var Mustache=require(_0x959e('0x7'));var util=require('util');var path=require(_0x959e('0x8'));var sox=require(_0x959e('0x9'));var csv=require(_0x959e('0xa'));var ejs=require(_0x959e('0xb'));var fs=require('fs');var fs_extra=require(_0x959e('0xc'));var _=require(_0x959e('0xd'));var squel=require(_0x959e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x959e('0xf'));var Papa=require(_0x959e('0x10'));var extract=require(_0x959e('0x11'));var rimraf=require(_0x959e('0x1'));var archiver=require(_0x959e('0x12'));var Redis=require(_0x959e('0x13'));var authService=require(_0x959e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x959e('0x15'));var hardwareService=require(_0x959e('0x16'));var logger=require(_0x959e('0x17'))(_0x959e('0x18'));var utils=require(_0x959e('0x19'));var config=require(_0x959e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x959e('0x1b'))['db'];config[_0x959e('0x1c')]=_[_0x959e('0x1d')](config[_0x959e('0x1c')],{'host':_0x959e('0x1e'),'port':0x18eb});var socket=require(_0x959e('0x1f'))(new Redis(config[_0x959e('0x1c')]));require(_0x959e('0x20'))[_0x959e('0x21')](socket);function respondWithStatusCode(_0x255d60,_0x48065a){_0x48065a=_0x48065a||0xcc;return function(_0x56f2b4){if(_0x56f2b4){return _0x255d60['sendStatus'](_0x48065a);}return _0x255d60[_0x959e('0x22')](_0x48065a)[_0x959e('0x23')]();};}function respondWithResult(_0x431488,_0x115104){_0x115104=_0x115104||0xc8;return function(_0x484600){if(_0x484600){return _0x431488[_0x959e('0x22')](_0x115104)['json'](_0x484600);}};}function respondWithFilteredResult(_0x5346c3,_0x26d294){return function(_0x18a4a6){if(_0x18a4a6){var _0x3bd4c0=typeof _0x26d294[_0x959e('0x24')]===_0x959e('0x25')&&typeof _0x26d294[_0x959e('0x26')]===_0x959e('0x25');var _0x1b7373=_0x18a4a6['count'];var _0x13070f=_0x3bd4c0?0x0:_0x26d294['offset'];var _0x324fec=_0x3bd4c0?_0x18a4a6[_0x959e('0x27')]:_0x26d294[_0x959e('0x24')]+_0x26d294['limit'];var _0xcb9c47;if(_0x324fec>=_0x1b7373){_0x324fec=_0x1b7373;_0xcb9c47=0xc8;}else{_0xcb9c47=0xce;}_0x5346c3[_0x959e('0x22')](_0xcb9c47);return _0x5346c3['set'](_0x959e('0x28'),_0x13070f+'-'+_0x324fec+'/'+_0x1b7373)['json'](_0x18a4a6);}return null;};}function patchUpdates(_0x818814){return function(_0x1a5eb2){try{jsonpatch[_0x959e('0x29')](_0x1a5eb2,_0x818814,!![]);}catch(_0x215a6e){return BPromise['reject'](_0x215a6e);}return _0x1a5eb2['save']();};}function saveUpdates(_0x532a06,_0x579c2a){return function(_0x950f72){if(_0x950f72){return _0x950f72[_0x959e('0x2a')](_0x532a06)[_0x959e('0x2b')](function(_0x80bd98){return _0x80bd98;});}return null;};}function removeEntity(_0x179a1a,_0x5c514e){return function(_0x45eed8){if(_0x45eed8){return _0x45eed8[_0x959e('0x2c')]()[_0x959e('0x2b')](function(){var _0x1dcb1d=_0x45eed8[_0x959e('0x2d')]({'plain':!![]});var _0x2f5961='Plugins';return db['UserProfileResource'][_0x959e('0x2c')]({'where':{'type':_0x2f5961,'resourceId':_0x1dcb1d['id']}})[_0x959e('0x2b')](function(){return _0x45eed8;});})[_0x959e('0x2b')](function(){_0x179a1a[_0x959e('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c9d42,_0x32f74d){return function(_0x14952b){if(!_0x14952b){_0x4c9d42[_0x959e('0x2e')](0x194);}return _0x14952b;};}function handleError(_0x4ce9af,_0x447c10){_0x447c10=_0x447c10||0x1f4;return function(_0x3e10a2){logger[_0x959e('0x2f')](_0x3e10a2['stack']);if(_0x3e10a2[_0x959e('0x30')]){delete _0x3e10a2[_0x959e('0x30')];}_0x4ce9af[_0x959e('0x22')](_0x447c10)[_0x959e('0x31')](_0x3e10a2);};}exports[_0x959e('0x32')]=function(_0x2bcc0b,_0x5e1e5e){var _0x54e245={},_0x641dd9={},_0x216b30={'count':0x0,'rows':[]};var _0x2ff1bc=_[_0x959e('0x33')](db[_0x959e('0x34')][_0x959e('0x35')],function(_0x121f8e){return{'name':_0x121f8e[_0x959e('0x36')],'type':_0x121f8e[_0x959e('0x37')]['key']};});_0x641dd9['model']=_[_0x959e('0x33')](_0x2ff1bc,_0x959e('0x30'));_0x641dd9[_0x959e('0x38')]=_[_0x959e('0x39')](_0x2bcc0b[_0x959e('0x38')]);_0x641dd9['filters']=_[_0x959e('0x3a')](_0x641dd9['model'],_0x641dd9[_0x959e('0x38')]);_0x54e245[_0x959e('0x3b')]=_[_0x959e('0x3a')](_0x641dd9['model'],qs['fields'](_0x2bcc0b[_0x959e('0x38')][_0x959e('0x3c')]));_0x54e245[_0x959e('0x3b')]=_0x54e245[_0x959e('0x3b')]['length']?_0x54e245[_0x959e('0x3b')]:_0x641dd9[_0x959e('0x3d')];if(!_0x2bcc0b[_0x959e('0x38')][_0x959e('0x3e')]('nolimit')){_0x54e245[_0x959e('0x26')]=qs[_0x959e('0x26')](_0x2bcc0b[_0x959e('0x38')]['limit']);_0x54e245[_0x959e('0x24')]=qs['offset'](_0x2bcc0b['query'][_0x959e('0x24')]);}_0x54e245[_0x959e('0x3f')]=qs[_0x959e('0x40')](_0x2bcc0b[_0x959e('0x38')][_0x959e('0x40')]);_0x54e245['where']=qs[_0x959e('0x41')](_[_0x959e('0x42')](_0x2bcc0b[_0x959e('0x38')],_0x641dd9[_0x959e('0x41')]),_0x2ff1bc);if(_0x2bcc0b[_0x959e('0x38')][_0x959e('0x43')]){_0x54e245[_0x959e('0x44')]=_['merge'](_0x54e245[_0x959e('0x44')],{'$or':_[_0x959e('0x33')](_0x2ff1bc,function(_0x48192f){if(_0x48192f[_0x959e('0x37')]!==_0x959e('0x45')){var _0x14a942={};_0x14a942[_0x48192f[_0x959e('0x30')]]={'$like':'%'+_0x2bcc0b[_0x959e('0x38')][_0x959e('0x43')]+'%'};return _0x14a942;}})});}_0x54e245=_[_0x959e('0x46')]({},_0x54e245,_0x2bcc0b[_0x959e('0x47')]);var _0x225741={'where':_0x54e245[_0x959e('0x44')]};return db['Plugin'][_0x959e('0x27')](_0x225741)[_0x959e('0x2b')](function(_0x2020b8){_0x216b30[_0x959e('0x27')]=_0x2020b8;if(_0x2bcc0b[_0x959e('0x38')][_0x959e('0x48')]){_0x54e245[_0x959e('0x49')]=[{'all':!![]}];}return db[_0x959e('0x34')][_0x959e('0x4a')](_0x54e245);})[_0x959e('0x2b')](function(_0x39772d){_0x216b30['rows']=_0x39772d;return _0x216b30;})[_0x959e('0x2b')](respondWithFilteredResult(_0x5e1e5e,_0x54e245))[_0x959e('0x4b')](handleError(_0x5e1e5e,null));};exports[_0x959e('0x4c')]=function(_0x31e269,_0x3d3f67){var _0x2b002a={'raw':!![],'where':{'id':_0x31e269[_0x959e('0x4d')]['id']}},_0x2ba1d9={};_0x2ba1d9[_0x959e('0x3d')]=_[_0x959e('0x39')](db['Plugin']['rawAttributes']);_0x2ba1d9[_0x959e('0x38')]=_[_0x959e('0x39')](_0x31e269['query']);_0x2ba1d9[_0x959e('0x41')]=_[_0x959e('0x3a')](_0x2ba1d9[_0x959e('0x3d')],_0x2ba1d9[_0x959e('0x38')]);_0x2b002a['attributes']=_[_0x959e('0x3a')](_0x2ba1d9['model'],qs[_0x959e('0x3c')](_0x31e269[_0x959e('0x38')]['fields']));_0x2b002a['attributes']=_0x2b002a[_0x959e('0x3b')][_0x959e('0x4e')]?_0x2b002a[_0x959e('0x3b')]:_0x2ba1d9[_0x959e('0x3d')];if(_0x31e269[_0x959e('0x38')]['includeAll']){_0x2b002a[_0x959e('0x49')]=[{'all':!![]}];}_0x2b002a=_['merge']({},_0x2b002a,_0x31e269[_0x959e('0x47')]);return db[_0x959e('0x34')][_0x959e('0x4f')](_0x2b002a)[_0x959e('0x2b')](handleEntityNotFound(_0x3d3f67,null))[_0x959e('0x2b')](respondWithResult(_0x3d3f67,null))[_0x959e('0x4b')](handleError(_0x3d3f67,null));};exports[_0x959e('0x50')]=function(_0x5af7b7,_0x240160,_0xa55590){return db[_0x959e('0x34')][_0x959e('0x4f')]({'where':{'id':_0x5af7b7[_0x959e('0x4d')]['id']},'attributes':['name',_0x959e('0x8')],'raw':!![]})[_0x959e('0x2b')](handleEntityNotFound(_0x240160,null))['then'](function(_0x5a3ae7){if(_0x5a3ae7){var _0x112dfb=path['join'](config[_0x959e('0x51')],'server/files/plugins',util['format'](_0x959e('0x52'),path[_0x959e('0x53')](_0x5a3ae7[_0x959e('0x8')])));var _0x2f550f=fs[_0x959e('0x54')](_0x112dfb);var _0x4f93ed=archiver(_0x959e('0x55'),{'zlib':{'level':0x9}});_0x4f93ed['on']('warning',function(_0x3a4f14){if(_0x3a4f14['code']===_0x959e('0x56')){logger[_0x959e('0x2f')](_0x3a4f14);}else{throw new db[(_0x959e('0x57'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4f93ed['on'](_0x959e('0x2f'),function(_0x535ddc){throw new db[(_0x959e('0x57'))][(_0x959e('0x58'))](_0x959e('0x59'));});_0x4f93ed[_0x959e('0x5a')](_0x2f550f);_0x4f93ed[_0x959e('0x5b')](_0x959e('0x5c'),{'cwd':path['join'](config['root'],_0x959e('0x5d'),path[_0x959e('0x5e')](_0x5a3ae7['path'])),'ignore':[path[_0x959e('0x5f')](path['basename'](_0x5a3ae7['path']),'node_modules/**/*'),path['join'](path[_0x959e('0x53')](_0x5a3ae7[_0x959e('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x959e('0x60')]();_0x2f550f['on'](_0x959e('0x61'),function(){if(!fs[_0x959e('0x62')](_0x112dfb)){throw new db[(_0x959e('0x57'))][(_0x959e('0x58'))](_0x959e('0x63'));}return _0x240160[_0x959e('0x50')](_0x112dfb,util['format'](_0x959e('0x52'),path['basename'](_0x5a3ae7['path'])),function(_0x552b00){if(_0x552b00){throw new db[(_0x959e('0x57'))][(_0x959e('0x58'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x959e('0x64')](_0x112dfb);logger[_0x959e('0x65')](_0x959e('0x66'));logger['info'](_0x959e('0x67'));});});}return null;})[_0x959e('0x4b')](handleError(_0x240160,null));};exports[_0x959e('0x68')]=function(_0x20c339,_0x1d3522,_0x540ade){var _0x2b3cc2=path[_0x959e('0x53')](_0x20c339[_0x959e('0x69')][_0x959e('0x6a')],path['extname'](_0x20c339[_0x959e('0x69')][_0x959e('0x6a')]));var _0x5828a1=path['join'](config[_0x959e('0x51')],_0x959e('0x5d'),_0x20c339[_0x959e('0x69')][_0x959e('0x6a')]);var _0x3e71de=path['join'](config[_0x959e('0x51')],_0x959e('0x5d'),_0x2b3cc2);logger[_0x959e('0x65')](_0x959e('0x6b'),_0x5828a1);logger[_0x959e('0x65')](_0x959e('0x6c'),_0x3e71de);try{fs[_0x959e('0x6d')](_0x5828a1,parseInt(_0x959e('0x6e'),0x8));extract(_0x5828a1,{'dir':_0x3e71de},function(_0x46c256){if(_0x46c256){logger[_0x959e('0x2f')](_0x46c256);handleError(_0x46c256,!![]);};var _0x3dca80=fs['readdirSync'](_0x3e71de);if(_0x3dca80[_0x959e('0x4e')]>0x1){removeReferences(_0x5828a1,_0x3e71de);logger[_0x959e('0x2f')](_0x959e('0x6f'));return _0x540ade(new Error(_0x959e('0x6f')));}var _0x37c303=fs[_0x959e('0x70')](path[_0x959e('0x5f')](_0x3e71de,_0x3dca80[0x0]));if(_0x37c303[_0x959e('0x71')]()){removeReferences(_0x5828a1,_0x3e71de);logger[_0x959e('0x2f')](_0x959e('0x6f'));return _0x540ade(new Error(_0x959e('0x6f')));}if(_0x37c303[_0x959e('0x72')]()){var _0x4c040c=fs[_0x959e('0x73')](path['join'](_0x3e71de,_0x3dca80[0x0]));if(_0x4c040c[_0x959e('0x4e')]===0x0){removeReferences(_0x5828a1,_0x3e71de);logger[_0x959e('0x2f')](_0x959e('0x6f'));return _0x540ade(new Error(_0x959e('0x6f')));}var _0x36a8f4=_0x4c040c[_0x959e('0x74')](function(_0x4707fa){return _0x4707fa===_0x959e('0x75');});if(!_0x36a8f4){return _0x540ade(new Error(_0x959e('0x76')));}var _0xe702ae=fs[_0x959e('0x77')](path[_0x959e('0x5f')](_0x3e71de,_0x3dca80[0x0],_0x959e('0x75')));var _0x29ed1e=JSON[_0x959e('0x78')](_0xe702ae);if(_0x959e('0x25')==typeof _0x29ed1e[_0x959e('0x30')]){return _0x540ade(new Error(_0x959e('0x79')));}if(_0x959e('0x25')==typeof _0x29ed1e['type']){return _0x540ade(new Error(_0x959e('0x7a')));}if(_0x959e('0x25')==typeof _0x29ed1e[_0x959e('0x7b')]){return _0x540ade(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x29ed1e[_0x959e('0x7c')]){return _0x540ade(new Error(_0x959e('0x7d')));}if(_0x29ed1e['type']==='html'){if('undefined'==typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')]){return _0x540ade(new Error(_0x959e('0x7f')));}if('undefined'==typeof _0x29ed1e[_0x959e('0x7c')]['views']['admin']&&_0x959e('0x25')==typeof _0x29ed1e[_0x959e('0x7c')]['views']['agent']){return _0x540ade(new Error(_0x959e('0x80')));}}else if(_0x29ed1e[_0x959e('0x37')]===_0x959e('0x81')){if(_0x959e('0x25')==typeof _0x29ed1e[_0x959e('0x7c')]['scriptName']){return _0x540ade(new Error(_0x959e('0x82')));}if('undefined'==typeof _0x29ed1e['parameters'][_0x959e('0x83')]){return _0x540ade(new Error(_0x959e('0x84')));}}else{return _0x540ade(new Error(_0x959e('0x85')));}var _0x1e694e=_0x29ed1e[_0x959e('0x30')];var _0x4e2dce=_0x29ed1e[_0x959e('0x86')];var _0x1787d8=_0x29ed1e['type'];var _0x3e63a0=_0x29ed1e['sidebar']?_0x29ed1e[_0x959e('0x87')]:_0x959e('0x88');var _0x29f301=_0x29ed1e[_0x959e('0x89')]?_0x29ed1e['icon']:_0x959e('0x8a');var _0x110563='';var _0x3c5a7d='';var _0x2e1182='';var _0x3e1e3a='';var _0x4d0bbb=_0x29ed1e[_0x959e('0x7b')];if(_0x1787d8===_0x959e('0x8b')){if(_0x959e('0x25')!=typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8c')]){var _0xf34f08=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x959e('0x8d')](_0xf34f08)){_0x110563=path[_0x959e('0x5f')]('plugins',_0x2b3cc2,_0x3dca80[0x0],_0xf34f08);}else{_0x110563=_0xf34f08;}}else{logger['info'](_0x959e('0x8e'));}if(_0x959e('0x25')!=typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8f')]){var _0x13522d=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x959e('0x8d')](_0x13522d)){_0x3c5a7d=path[_0x959e('0x5f')](_0x959e('0x90'),_0x2b3cc2,_0x3dca80[0x0],_0x13522d);}else{_0x3c5a7d=_0x13522d;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1787d8==='script'){_0x2e1182=_0x29ed1e[_0x959e('0x7c')]['scriptName'];_0x3e1e3a=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x83')];if(_0x959e('0x25')!=typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')]){if(_0x959e('0x25')!=typeof _0x29ed1e['parameters'][_0x959e('0x7e')][_0x959e('0x8c')]){var _0xf34f08=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0xf34f08)){_0x110563=path[_0x959e('0x5f')](_0x959e('0x90'),_0x2b3cc2,_0x3dca80[0x0],_0xf34f08);}else{_0x110563=_0xf34f08;}}if('undefined'!=typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8f')]){var _0x13522d=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x959e('0x8d')](_0x13522d)){_0x3c5a7d=path[_0x959e('0x5f')](_0x959e('0x90'),_0x2b3cc2,_0x3dca80[0x0],_0x13522d);}else{_0x3c5a7d=_0x13522d;}}}}var _0x2e8402={'name':_0x1e694e,'description':_0x4e2dce,'path':path[_0x959e('0x5f')](_0x2b3cc2,_0x3dca80[0x0]),'type':_0x1787d8,'sidebar':_0x3e63a0,'icon':_0x29f301,'adminUrl':_0x110563,'agentUrl':_0x3c5a7d,'scriptName':_0x2e1182,'scriptPath':_0x3e1e3a,'version':_0x4d0bbb};removeReferences(_0x5828a1,null);return db[_0x959e('0x34')]['create'](_0x2e8402)[_0x959e('0x2b')](function(_0x2e7982){var _0x85cfd1={'role':_0x20c339[_0x959e('0x91')][_0x959e('0x92')],'userProfileId':_0x20c339[_0x959e('0x91')]['userProfileId']};if(!_0x85cfd1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x85cfd1[_0x959e('0x92')]===_0x959e('0x93')){var _0x4ea202=_0x2e7982[_0x959e('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0x959e('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x85cfd1[_0x959e('0x94')]},'raw':!![]})[_0x959e('0x2b')](function(_0x4333e2){if(_0x4333e2&&_0x4333e2['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4ea202['name'],'resourceId':_0x4ea202['id'],'type':_0x4333e2[_0x959e('0x30')],'sectionId':_0x4333e2['id']},{})[_0x959e('0x2b')](function(){return _0x2e7982;});}else{return _0x2e7982;}})[_0x959e('0x4b')](function(_0x2e92ed){logger[_0x959e('0x2f')](_0x959e('0x95'),_0x2e92ed);throw _0x2e92ed;});}return _0x2e7982;})['then'](respondWithResult(_0x1d3522,null))['catch'](handleError(_0x1d3522,null));}});}catch(_0x5c1e49){_0x1d3522[_0x959e('0x22')](0x1f4)[_0x959e('0x31')](_0x5c1e49);}};function removeReferences(_0x6073ef,_0x5c56b0){try{if(_0x6073ef){fs[_0x959e('0x64')](_0x6073ef);logger[_0x959e('0x65')](_0x959e('0x96'));}if(_0x5c56b0){rimraf(_0x5c56b0,function(){});logger['info'](_0x959e('0x97'));}}catch(_0x3f86ce){logger[_0x959e('0x2f')](_0x3f86ce);}}exports[_0x959e('0x2a')]=function(_0x45541d,_0x56e77b,_0x120d83){return db['Plugin']['find']({'where':{'id':_0x45541d[_0x959e('0x4d')]['id']}})[_0x959e('0x2b')](handleEntityNotFound(_0x56e77b,null))[_0x959e('0x2b')](saveUpdates(_0x45541d['body'],null))['then'](respondWithResult(_0x56e77b,null))[_0x959e('0x4b')](handleError(_0x56e77b,null));};exports[_0x959e('0x98')]=function(_0x1ce224,_0x16fb4b,_0x3afc64){return db[_0x959e('0x34')]['find']({'where':{'id':_0x1ce224['params']['id']}})[_0x959e('0x2b')](function(_0x4f323a){if(_0x4f323a){return _0x4f323a['destroy']();}})[_0x959e('0x2b')](function(_0x28960){rimraf(path[_0x959e('0x5f')](config['root'],'server/files/plugins',path[_0x959e('0x5e')](_0x28960[_0x959e('0x8')])),function(){});return _0x28960;})[_0x959e('0x2b')](handleEntityNotFound(_0x16fb4b,null))[_0x959e('0x2b')](respondWithStatusCode(_0x16fb4b,null))[_0x959e('0x4b')](handleError(_0x16fb4b,null));};exports[_0x959e('0x99')]=function(_0xf85288,_0x474420,_0x1a3f94){return BPromise[_0x959e('0x9a')]()[_0x959e('0x2b')](function(){if(!_0xf85288[_0x959e('0x38')][_0x959e('0x8')]){throw new Error(_0x959e('0x9b'));}if(!_0xf85288[_0x959e('0x38')][_0x959e('0x9c')]){throw new Error(_0x959e('0x9d'));}var _0x5a0a85=_0xf85288[_0x959e('0x38')][_0x959e('0x9e')]?_0xf85288[_0x959e('0x38')][_0x959e('0x9e')]+':'+_0xf85288[_0x959e('0x38')][_0x959e('0x9c')]:_0x959e('0x9f')+_0xf85288[_0x959e('0x38')][_0x959e('0x9c')];var _0x224277=_0xf85288[_0x959e('0x38')][_0x959e('0xa0')]?_0xf85288[_0x959e('0x38')][_0x959e('0xa0')]:!![];var _0x382ef6=_0xf85288['query'][_0x959e('0xa1')]?_0xf85288[_0x959e('0x38')][_0x959e('0xa1')]:null;var _0x1bd563={'method':_0xf85288['method'],'uri':util[_0x959e('0xa2')](_0x959e('0xa3'),_0x5a0a85,_0xf85288[_0x959e('0x38')][_0x959e('0x8')]),'json':_0x224277,'resolveWithFullResponse':!![],'encoding':_0x382ef6,'qs':_0xf85288[_0x959e('0x38')]};if(_0xf85288['headers']){_0x1bd563[_0x959e('0xa4')]=_0xf85288[_0x959e('0xa4')];if(_0x1bd563[_0x959e('0xa4')][_0x959e('0xa5')]){delete _0x1bd563['headers']['content-length'];}}if(_0x1bd563['headers'][_0x959e('0xa6')]){delete _0x1bd563[_0x959e('0xa4')][_0x959e('0xa6')];}return rp(_0x1bd563);})[_0x959e('0x2b')](function(_0x5bc8e1){if(_0x5bc8e1){_0x474420['set'](_0x5bc8e1['headers']);logger[_0x959e('0x65')](_0x5bc8e1[_0x959e('0x91')]);if(_[_0x959e('0xa7')](_0xf85288[_0x959e('0x38')][_0x959e('0x8')],'download')&&_0x5bc8e1['statusCode']==0x1f4){return _0x474420[_0x959e('0x2e')](_0x5bc8e1[_0x959e('0xa8')]);}else{return _0x474420[_0x959e('0x22')](_0x5bc8e1[_0x959e('0xa8')])[_0x959e('0x31')](_0x5bc8e1[_0x959e('0x91')]);}}else{return _0x474420[_0x959e('0x2e')](0xc8);}})[_0x959e('0x4b')](handleError(_0x474420,null));};exports[_0x959e('0xa9')]=function(_0x553f90,_0x40c0e2,_0xa43386){return BPromise['resolve']()[_0x959e('0x2b')](function(){if(!_0x553f90[_0x959e('0x38')][_0x959e('0x8')]){throw new Error(_0x959e('0x9b'));}if(!_0x553f90[_0x959e('0x38')][_0x959e('0x9c')]){throw new Error(_0x959e('0x9d'));}var _0x81fd82=_0x553f90[_0x959e('0x38')][_0x959e('0x9e')]?_0x553f90[_0x959e('0x38')][_0x959e('0x9e')]+':'+_0x553f90['query'][_0x959e('0x9c')]:'http://localhost:'+_0x553f90[_0x959e('0x38')][_0x959e('0x9c')];var _0x32238b=_0x553f90[_0x959e('0x38')][_0x959e('0xa0')]?_0x553f90[_0x959e('0x38')]['json']:!![];var _0x587abb=_0x553f90[_0x959e('0x38')][_0x959e('0xa1')]?_0x553f90[_0x959e('0x38')]['encoding']:null;var _0x15fdbb={'method':_0x553f90[_0x959e('0xaa')],'uri':util[_0x959e('0xa2')](_0x959e('0xa3'),_0x81fd82,_0x553f90[_0x959e('0x38')][_0x959e('0x8')]),'json':_0x32238b,'resolveWithFullResponse':!![],'encoding':_0x587abb,'body':_0x553f90['body']};if(_0x553f90['headers']){_0x15fdbb[_0x959e('0xa4')]=_0x553f90[_0x959e('0xa4')];if(_0x15fdbb[_0x959e('0xa4')][_0x959e('0xa5')]){delete _0x15fdbb[_0x959e('0xa4')][_0x959e('0xa5')];}}if(_0x15fdbb['headers'][_0x959e('0xa6')]){delete _0x15fdbb[_0x959e('0xa4')][_0x959e('0xa6')];}return rp(_0x15fdbb);})[_0x959e('0x2b')](function(_0x597450){if(_0x597450){_0x40c0e2[_0x959e('0xab')](_0x597450[_0x959e('0xa4')]);logger[_0x959e('0x65')](_0x597450['body']);return _0x40c0e2['status'](_0x597450['statusCode'])['send'](_0x597450[_0x959e('0x91')]);}else{return _0x40c0e2['sendStatus'](0xc8);}})[_0x959e('0x4b')](handleError(_0x40c0e2,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 1a68b0e..51a2dc4 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 _0xaa37=['../../mysqldb','Plugin','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x4235b3,_0x4295b9){var _0x5a6cc9=function(_0x3cd80d){while(--_0x3cd80d){_0x4235b3['push'](_0x4235b3['shift']());}};_0x5a6cc9(++_0x4295b9);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xaa37[_0x2dea24];return _0x309d58;};'use strict';var EventEmitter=require(_0x7aa3('0x0'));var Plugin=require(_0x7aa3('0x1'))['db'][_0x7aa3('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x7aa3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7aa3('0x4'),'afterDestroy':_0x7aa3('0x5')};function emitEvent(_0x27333d){return function(_0x11e64c,_0x334919,_0x2801a2){PluginEvents[_0x7aa3('0x6')](_0x27333d+':'+_0x11e64c['id'],_0x11e64c);PluginEvents['emit'](_0x27333d,_0x11e64c);_0x2801a2(null);};}for(var e in events){if(events[_0x7aa3('0x7')](e)){var event=events[e];Plugin[_0x7aa3('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x5496=['setMaxListeners','save','remove','hasOwnProperty','hook','events','../../mysqldb','Plugin'];(function(_0x1d962f,_0x4aa293){var _0x1602ae=function(_0x3a3ad3){while(--_0x3a3ad3){_0x1d962f['push'](_0x1d962f['shift']());}};_0x1602ae(++_0x4aa293);}(_0x5496,0x175));var _0x6549=function(_0x3c8086,_0x5ddac9){_0x3c8086=_0x3c8086-0x0;var _0x5de319=_0x5496[_0x3c8086];return _0x5de319;};'use strict';var EventEmitter=require(_0x6549('0x0'));var Plugin=require(_0x6549('0x1'))['db'][_0x6549('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6549('0x3')](0x0);var events={'afterCreate':_0x6549('0x4'),'afterUpdate':'update','afterDestroy':_0x6549('0x5')};function emitEvent(_0x4de1db){return function(_0x2d2155,_0x8112c5,_0x3750cc){PluginEvents['emit'](_0x4de1db+':'+_0x2d2155['id'],_0x2d2155);PluginEvents['emit'](_0x4de1db,_0x2d2155);_0x3750cc(null);};}for(var e in events){if(events[_0x6549('0x6')](e)){var event=events[e];Plugin[_0x6549('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 7346b1c..cbb6993 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 _0xd9fb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','plugins'];(function(_0x9d2ae9,_0xe43b7e){var _0x356d6f=function(_0x2c32cf){while(--_0x2c32cf){_0x9d2ae9['push'](_0x9d2ae9['shift']());}};_0x356d6f(++_0xe43b7e);}(_0xd9fb,0x197));var _0xbd9f=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xd9fb[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require(_0xbd9f('0x0'));var logger=require(_0xbd9f('0x1'))(_0xbd9f('0x2'));var moment=require(_0xbd9f('0x3'));var BPromise=require(_0xbd9f('0x4'));var rp=require(_0xbd9f('0x5'));var fs=require('fs');var path=require(_0xbd9f('0x6'));var rimraf=require(_0xbd9f('0x7'));var config=require(_0xbd9f('0x8'));var attributes=require('./plugin.attributes');module[_0xbd9f('0x9')]=function(_0x59320a,_0x3d03eb){return _0x59320a['define']('Plugin',attributes,{'tableName':_0xbd9f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd53a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd53a,0x14e));var _0xad53=function(_0x55621a,_0x52aee7){_0x55621a=_0x55621a-0x0;var _0x45933c=_0xd53a[_0x55621a];return _0x45933c;};'use strict';var _=require(_0xad53('0x0'));var util=require(_0xad53('0x1'));var logger=require(_0xad53('0x2'))('api');var moment=require(_0xad53('0x3'));var BPromise=require(_0xad53('0x4'));var rp=require(_0xad53('0x5'));var fs=require('fs');var path=require(_0xad53('0x6'));var rimraf=require(_0xad53('0x7'));var config=require(_0xad53('0x8'));var attributes=require(_0xad53('0x9'));module[_0xad53('0xa')]=function(_0x384211,_0x1cceca){return _0x384211[_0xad53('0xb')](_0xad53('0xc'),attributes,{'tableName':_0xad53('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 3851492..1d92005 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 _0xe7d5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','catch','Plugin','create','body','options','raw','then','CreatePlugin','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x56b602,_0x4006ae){var _0x5ab26b=function(_0x3f2dd7){while(--_0x3f2dd7){_0x56b602['push'](_0x56b602['shift']());}};_0x5ab26b(++_0x4006ae);}(_0xe7d5,0x1c1));var _0x5e7d=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xe7d5[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x5e7d('0x0'));var util=require(_0x5e7d('0x1'));var moment=require(_0x5e7d('0x2'));var BPromise=require('bluebird');var rs=require(_0x5e7d('0x3'));var fs=require('fs');var Redis=require(_0x5e7d('0x4'));var db=require(_0x5e7d('0x5'))['db'];var utils=require(_0x5e7d('0x6'));var logger=require(_0x5e7d('0x7'))(_0x5e7d('0x8'));var config=require(_0x5e7d('0x9'));var jayson=require(_0x5e7d('0xa'));var client=jayson[_0x5e7d('0xb')][_0x5e7d('0xc')]({'port':0x232a});config[_0x5e7d('0xd')]=_['defaults'](config[_0x5e7d('0xd')],{'host':_0x5e7d('0xe'),'port':0x18eb});var socket=require(_0x5e7d('0xf'))(new Redis(config[_0x5e7d('0xd')]));require(_0x5e7d('0x10'))[_0x5e7d('0x11')](socket);function respondWithRpcPromise(_0x1f03db,_0x5cd4c1,_0xc87d93){return new BPromise(function(_0x1fb6a9,_0x5b3c17){return client[_0x5e7d('0x12')](_0x1f03db,_0xc87d93)['then'](function(_0x24aedc){logger[_0x5e7d('0x13')](_0x5e7d('0x14'),_0x5cd4c1,_0x5e7d('0x15'));logger['debug'](_0x5e7d('0x16'),_0x5cd4c1,'request\x20sent',JSON['stringify'](_0x24aedc));if(_0x24aedc['error']){if(_0x24aedc[_0x5e7d('0x17')][_0x5e7d('0x18')]===0x1f4){logger[_0x5e7d('0x17')](_0x5e7d('0x14'),_0x5cd4c1,_0x24aedc[_0x5e7d('0x17')][_0x5e7d('0x19')]);return _0x5b3c17(_0x24aedc[_0x5e7d('0x17')][_0x5e7d('0x19')]);}logger[_0x5e7d('0x17')](_0x5e7d('0x14'),_0x5cd4c1,_0x24aedc['error'][_0x5e7d('0x19')]);return _0x1fb6a9(_0x24aedc[_0x5e7d('0x17')][_0x5e7d('0x19')]);}else{logger[_0x5e7d('0x13')]('Plugin,\x20%s,\x20%s',_0x5cd4c1,_0x5e7d('0x15'));_0x1fb6a9(_0x24aedc['result'][_0x5e7d('0x19')]);}})[_0x5e7d('0x1a')](function(_0x35109d){logger['error'](_0x5e7d('0x14'),_0x5cd4c1,_0x35109d);_0x5b3c17(_0x35109d);});});}exports['CreatePlugin']=function(_0x30cb0f){var _0x1e7a10=this;return new Promise(function(_0xa7fb16,_0x906fc2){return db[_0x5e7d('0x1b')][_0x5e7d('0x1c')](_0x30cb0f[_0x5e7d('0x1d')],{'raw':_0x30cb0f['options']?_0x30cb0f[_0x5e7d('0x1e')][_0x5e7d('0x1f')]===undefined?!![]:![]:!![]})[_0x5e7d('0x20')](function(_0xea283a){logger[_0x5e7d('0x13')](_0x5e7d('0x21'),_0x30cb0f);logger[_0x5e7d('0x22')](_0x5e7d('0x21'),_0x30cb0f,JSON['stringify'](_0xea283a));_0xa7fb16(_0xea283a);})[_0x5e7d('0x1a')](function(_0x35efd9){logger[_0x5e7d('0x17')](_0x5e7d('0x21'),_0x35efd9[_0x5e7d('0x19')],_0x30cb0f);_0x906fc2(_0x1e7a10[_0x5e7d('0x17')](0x1f4,_0x35efd9[_0x5e7d('0x19')]));});});}; \ No newline at end of file +var _0xa2a1=['info','Plugin,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreatePlugin','create','body','raw','then','debug','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0xa2a1,0xf6));var _0x1a2a=function(_0x29f6a8,_0x434270){_0x29f6a8=_0x29f6a8-0x0;var _0x29064c=_0xa2a1[_0x29f6a8];return _0x29064c;};'use strict';var _=require(_0x1a2a('0x0'));var util=require('util');var moment=require(_0x1a2a('0x1'));var BPromise=require(_0x1a2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a2a('0x3'));var db=require(_0x1a2a('0x4'))['db'];var utils=require(_0x1a2a('0x5'));var logger=require(_0x1a2a('0x6'))(_0x1a2a('0x7'));var config=require(_0x1a2a('0x8'));var jayson=require(_0x1a2a('0x9'));var client=jayson[_0x1a2a('0xa')][_0x1a2a('0xb')]({'port':0x232a});config[_0x1a2a('0xc')]=_[_0x1a2a('0xd')](config[_0x1a2a('0xc')],{'host':_0x1a2a('0xe'),'port':0x18eb});var socket=require(_0x1a2a('0xf'))(new Redis(config[_0x1a2a('0xc')]));require('./plugin.socket')[_0x1a2a('0x10')](socket);function respondWithRpcPromise(_0x254835,_0x51dd3c,_0x355c6d){return new BPromise(function(_0x32a372,_0x183423){return client[_0x1a2a('0x11')](_0x254835,_0x355c6d)['then'](function(_0xf730ef){logger[_0x1a2a('0x12')](_0x1a2a('0x13'),_0x51dd3c,_0x1a2a('0x14'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x51dd3c,_0x1a2a('0x14'),JSON['stringify'](_0xf730ef));if(_0xf730ef[_0x1a2a('0x15')]){if(_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x16')]===0x1f4){logger[_0x1a2a('0x15')](_0x1a2a('0x13'),_0x51dd3c,_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x17')]);return _0x183423(_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x17')]);}logger[_0x1a2a('0x15')](_0x1a2a('0x13'),_0x51dd3c,_0xf730ef[_0x1a2a('0x15')]['message']);return _0x32a372(_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x17')]);}else{logger[_0x1a2a('0x12')]('Plugin,\x20%s,\x20%s',_0x51dd3c,_0x1a2a('0x14'));_0x32a372(_0xf730ef[_0x1a2a('0x18')][_0x1a2a('0x17')]);}})[_0x1a2a('0x19')](function(_0x16a0e9){logger[_0x1a2a('0x15')](_0x1a2a('0x13'),_0x51dd3c,_0x16a0e9);_0x183423(_0x16a0e9);});});}exports[_0x1a2a('0x1a')]=function(_0x1fb90c){var _0x968bc4=this;return new Promise(function(_0x4c5e43,_0x2ba51a){return db['Plugin'][_0x1a2a('0x1b')](_0x1fb90c[_0x1a2a('0x1c')],{'raw':_0x1fb90c['options']?_0x1fb90c['options'][_0x1a2a('0x1d')]===undefined?!![]:![]:!![]})[_0x1a2a('0x1e')](function(_0x3f6fd7){logger['info'](_0x1a2a('0x1a'),_0x1fb90c);logger[_0x1a2a('0x1f')]('CreatePlugin',_0x1fb90c,JSON[_0x1a2a('0x20')](_0x3f6fd7));_0x4c5e43(_0x3f6fd7);})[_0x1a2a('0x19')](function(_0x26cd5b){logger['error'](_0x1a2a('0x1a'),_0x26cd5b[_0x1a2a('0x17')],_0x1fb90c);_0x2ba51a(_0x968bc4[_0x1a2a('0x15')](0x1f4,_0x26cd5b[_0x1a2a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index d407309..3c58a37 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 _0x8d85=['plugin:','./plugin.events','save','remove','update','emit','register','length'];(function(_0x35f616,_0xc97542){var _0x4057dc=function(_0x526fd9){while(--_0x526fd9){_0x35f616['push'](_0x35f616['shift']());}};_0x4057dc(++_0xc97542);}(_0x8d85,0x131));var _0x58d8=function(_0x398b0d,_0x2d3b1d){_0x398b0d=_0x398b0d-0x0;var _0x122c7c=_0x8d85[_0x398b0d];return _0x122c7c;};'use strict';var PluginEvents=require(_0x58d8('0x0'));var events=[_0x58d8('0x1'),_0x58d8('0x2'),_0x58d8('0x3')];function createListener(_0x1574f5,_0x21f10d){return function(_0x53690d){_0x21f10d[_0x58d8('0x4')](_0x1574f5,_0x53690d);};}function removeListener(_0x1a6d2e,_0x130038){return function(){PluginEvents['removeListener'](_0x1a6d2e,_0x130038);};}exports[_0x58d8('0x5')]=function(_0x4aeb4e){for(var _0xf305c4=0x0,_0xe435b6=events[_0x58d8('0x6')];_0xf305c4<_0xe435b6;_0xf305c4++){var _0x5eb61d=events[_0xf305c4];var _0x43341b=createListener(_0x58d8('0x7')+_0x5eb61d,_0x4aeb4e);PluginEvents['on'](_0x5eb61d,_0x43341b);}}; \ No newline at end of file +var _0x0c49=['./plugin.events','save','remove','update','emit','removeListener','register','length','plugin:'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x0c49,0x15f));var _0x90c4=function(_0x3a582c,_0x2b4cf7){_0x3a582c=_0x3a582c-0x0;var _0x1f1109=_0x0c49[_0x3a582c];return _0x1f1109;};'use strict';var PluginEvents=require(_0x90c4('0x0'));var events=[_0x90c4('0x1'),_0x90c4('0x2'),_0x90c4('0x3')];function createListener(_0xef33d0,_0x35bc9e){return function(_0x4a7c4a){_0x35bc9e[_0x90c4('0x4')](_0xef33d0,_0x4a7c4a);};}function removeListener(_0x558255,_0x3bb93){return function(){PluginEvents[_0x90c4('0x5')](_0x558255,_0x3bb93);};}exports[_0x90c4('0x6')]=function(_0xcb519){for(var _0xd56739=0x0,_0x5cadf8=events[_0x90c4('0x7')];_0xd56739<_0x5cadf8;_0xd56739++){var _0x989bd3=events[_0xd56739];var _0xae3e19=createListener(_0x90c4('0x8')+_0x989bd3,_0xcb519);PluginEvents['on'](_0x989bd3,_0xae3e19);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index e2e1976..7941ab3 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(_0x257c14,_0x13cf81){var _0x20fd38=function(_0x358562){while(--_0x358562){_0x257c14['push'](_0x257c14['shift']());}};_0x20fd38(++_0x13cf81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./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(_0x5520c6,_0x24f3c7){var _0x196c04=function(_0x143fd1){while(--_0x143fd1){_0x5520c6['push'](_0x5520c6['shift']());}};_0x196c04(++_0x24f3c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 84b1b37..98af217 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 _0x2750=['exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','list','then','motion2','catch','body','script','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','Unknown\x20status','destroy','lodash','../../config/logger','api','path','child_process'];(function(_0x593555,_0x218fe6){var _0x2031cf=function(_0x1578a2){while(--_0x1578a2){_0x593555['push'](_0x593555['shift']());}};_0x2031cf(++_0x218fe6);}(_0x2750,0x13b));var _0x0275=function(_0xd0a677,_0x48668a){_0xd0a677=_0xd0a677-0x0;var _0x532005=_0x2750[_0xd0a677];return _0x532005;};'use strict';var _=require(_0x0275('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var path=require(_0x0275('0x3'));var exec=require(_0x0275('0x4'))[_0x0275('0x5')];var BPromise=require(_0x0275('0x6'));function handleEntityNotFound(_0x20273d,_0x4960){return function(_0x3d0c9c){if(!_0x3d0c9c){_0x20273d[_0x0275('0x7')](0x194);;}return _0x3d0c9c;};}function respondWithResult(_0x5953f9,_0x3f645f){_0x3f645f=_0x3f645f||0xc8;return function(_0x2421fd){if(_0x2421fd){return _0x5953f9[_0x0275('0x8')](_0x3f645f)[_0x0275('0x9')](_0x2421fd);}return null;};}function handleError(_0x4dffd1,_0x1f7c4a){_0x1f7c4a=_0x1f7c4a||0x1f4;return function(_0x30632d){logger[_0x0275('0xa')](_0x30632d['stack']);if(_0x30632d['name']){delete _0x30632d[_0x0275('0xb')];}_0x4dffd1['status'](_0x1f7c4a)[_0x0275('0xc')](_0x30632d);};}function execChildProcess(){return new BPromise(function(_0x377087,_0x14f68c){exec(_0x0275('0xd'),function(_0x14bc3e,_0x5ae208,_0x2e8723){logger[_0x0275('0xe')](_0x5ae208);logger[_0x0275('0xe')](_0x2e8723);if(_0x14bc3e){logger['error'](_0x14bc3e);return _0x14f68c(_0x14bc3e);}return _0x377087(_0x5ae208);});});}exports['index']=function(_0x292f93,_0x395398){return pm2[_0x0275('0xf')]()[_0x0275('0x10')](function(_0x28827b){if(_0x28827b){var _0x36921c=_['reject'](_0x28827b,function(_0x3e0791){return _0x3e0791[_0x0275('0xb')]==='express'||_0x3e0791[_0x0275('0xb')]===_0x0275('0x11');});return{'rows':_0x36921c,'count':_0x36921c['length']};}return null;})[_0x0275('0x10')](respondWithResult(_0x395398,null))[_0x0275('0x12')](handleError(_0x395398,null));};exports['show']=function(_0x5e7466,_0x56e719){return pm2['describe'](_0x5e7466['params']['id'])[_0x0275('0x10')](respondWithResult(_0x56e719,null))[_0x0275('0x10')](handleEntityNotFound(_0x56e719,null))[_0x0275('0x12')](handleError(_0x56e719,null));};exports['create']=function(_0x7075c9,_0x30730a){if(_0x7075c9[_0x0275('0x13')]['name']&&_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]){var _0x575786=path['join'](__dirname,_0x0275('0x15'),_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]);var _0x592a53=process[_0x0275('0x16')]();process['chdir'](path[_0x0275('0x17')](_0x575786));return execChildProcess()['then'](function(_0x26f2c2){process[_0x0275('0x18')](_0x592a53);return pm2['start']({'name':_0x7075c9[_0x0275('0x13')][_0x0275('0xb')],'script':_0x575786});})[_0x0275('0x10')](function(_0x52946b){pm2[_0x0275('0x19')]();return _0x52946b[0x0];})[_0x0275('0x10')](respondWithResult(_0x30730a,0xc9))[_0x0275('0x12')](handleError(_0x30730a,null));}else{return _0x30730a[_0x0275('0x8')](0x1f4)[_0x0275('0xc')]({'message':_0x0275('0x1a')});}};exports['update']=function(_0x35343c,_0x14d7d8){if(_0x35343c[_0x0275('0x13')]['id']){delete _0x35343c[_0x0275('0x13')]['id'];}var _0x4689a3={'online':'restart','stopped':_0x0275('0x1b')};if(_0x4689a3[_0x0275('0x1c')](_0x35343c[_0x0275('0x13')][_0x0275('0x8')])){return pm2[_0x4689a3[_0x35343c[_0x0275('0x13')]['status']]](_0x35343c[_0x0275('0x1d')]['id'])[_0x0275('0x10')](respondWithResult(_0x14d7d8,0xc8))[_0x0275('0x12')](handleError(_0x14d7d8,null));}else{return _0x14d7d8['status'](0x1f4)['send']({'message':_0x0275('0x1e')});}};exports[_0x0275('0x1f')]=function(_0x5dc2bc,_0x7eff96){if(_0x5dc2bc[_0x0275('0x13')]['id']){delete _0x5dc2bc[_0x0275('0x13')]['id'];}if(_0x5dc2bc[_0x0275('0x1d')]['id']){return pm2['delete'](_0x5dc2bc[_0x0275('0x1d')]['id'])[_0x0275('0x10')](function(_0x3bba47){pm2[_0x0275('0x19')]();return _0x3bba47[0x0];})['then'](respondWithResult(_0x7eff96,null))[_0x0275('0x12')](handleError(_0x7eff96,null));}else{return _0x7eff96['status'](0x1f4)[_0x0275('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x4fdb=['lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','status','json','error','stack','name','send','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dump','restart','stop','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id'];(function(_0x3d39b2,_0x80e7b6){var _0x3a4df3=function(_0x40740a){while(--_0x40740a){_0x3d39b2['push'](_0x3d39b2['shift']());}};_0x3a4df3(++_0x80e7b6);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x1555bf,_0x20bbc5){_0x1555bf=_0x1555bf-0x0;var _0x135c18=_0x4fdb[_0x1555bf];return _0x135c18;};'use strict';var _=require(_0xb4fd('0x0'));var pm2=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var path=require(_0xb4fd('0x4'));var exec=require(_0xb4fd('0x5'))[_0xb4fd('0x6')];var BPromise=require(_0xb4fd('0x7'));function handleEntityNotFound(_0x1c0b08,_0x5b73bb){return function(_0x308de6){if(!_0x308de6){_0x1c0b08['sendStatus'](0x194);;}return _0x308de6;};}function respondWithResult(_0x14052b,_0x5d8b39){_0x5d8b39=_0x5d8b39||0xc8;return function(_0x53273f){if(_0x53273f){return _0x14052b[_0xb4fd('0x8')](_0x5d8b39)[_0xb4fd('0x9')](_0x53273f);}return null;};}function handleError(_0x1151b5,_0x52dca2){_0x52dca2=_0x52dca2||0x1f4;return function(_0x526d3b){logger[_0xb4fd('0xa')](_0x526d3b[_0xb4fd('0xb')]);if(_0x526d3b[_0xb4fd('0xc')]){delete _0x526d3b['name'];}_0x1151b5[_0xb4fd('0x8')](_0x52dca2)[_0xb4fd('0xd')](_0x526d3b);};}function execChildProcess(){return new BPromise(function(_0x2148db,_0x23b08f){exec(_0xb4fd('0xe'),function(_0x502379,_0xd05458,_0x1f3e30){logger[_0xb4fd('0xf')](_0xd05458);logger[_0xb4fd('0xf')](_0x1f3e30);if(_0x502379){logger['error'](_0x502379);return _0x23b08f(_0x502379);}return _0x2148db(_0xd05458);});});}exports[_0xb4fd('0x10')]=function(_0x65f08a,_0x345d35){return pm2['list']()[_0xb4fd('0x11')](function(_0x1234d7){if(_0x1234d7){var _0xc35d8d=_[_0xb4fd('0x12')](_0x1234d7,function(_0x36e88f){return _0x36e88f[_0xb4fd('0xc')]===_0xb4fd('0x13')||_0x36e88f['name']===_0xb4fd('0x14');});return{'rows':_0xc35d8d,'count':_0xc35d8d[_0xb4fd('0x15')]};}return null;})[_0xb4fd('0x11')](respondWithResult(_0x345d35,null))[_0xb4fd('0x16')](handleError(_0x345d35,null));};exports[_0xb4fd('0x17')]=function(_0x137e51,_0x1d0812){return pm2[_0xb4fd('0x18')](_0x137e51[_0xb4fd('0x19')]['id'])[_0xb4fd('0x11')](respondWithResult(_0x1d0812,null))[_0xb4fd('0x11')](handleEntityNotFound(_0x1d0812,null))['catch'](handleError(_0x1d0812,null));};exports['create']=function(_0x504e80,_0x5c14c0){if(_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0xc')]&&_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0x1b')]){var _0x458133=path[_0xb4fd('0x1c')](__dirname,_0xb4fd('0x1d'),_0x504e80['body']['script']);var _0x216307=process[_0xb4fd('0x1e')]();process[_0xb4fd('0x1f')](path['dirname'](_0x458133));return execChildProcess()[_0xb4fd('0x11')](function(_0x49d42c){process[_0xb4fd('0x1f')](_0x216307);return pm2['start']({'name':_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0xc')],'script':_0x458133});})[_0xb4fd('0x11')](function(_0x261eda){pm2[_0xb4fd('0x20')]();return _0x261eda[0x0];})[_0xb4fd('0x11')](respondWithResult(_0x5c14c0,0xc9))[_0xb4fd('0x16')](handleError(_0x5c14c0,null));}else{return _0x5c14c0[_0xb4fd('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x453982,_0x4bad85){if(_0x453982[_0xb4fd('0x1a')]['id']){delete _0x453982['body']['id'];}var _0x5738c2={'online':_0xb4fd('0x21'),'stopped':_0xb4fd('0x22')};if(_0x5738c2[_0xb4fd('0x23')](_0x453982['body'][_0xb4fd('0x8')])){return pm2[_0x5738c2[_0x453982[_0xb4fd('0x1a')][_0xb4fd('0x8')]]](_0x453982[_0xb4fd('0x19')]['id'])['then'](respondWithResult(_0x4bad85,0xc8))[_0xb4fd('0x16')](handleError(_0x4bad85,null));}else{return _0x4bad85[_0xb4fd('0x8')](0x1f4)['send']({'message':_0xb4fd('0x24')});}};exports[_0xb4fd('0x25')]=function(_0xbe7d2c,_0x597874){if(_0xbe7d2c[_0xb4fd('0x1a')]['id']){delete _0xbe7d2c[_0xb4fd('0x1a')]['id'];}if(_0xbe7d2c[_0xb4fd('0x19')]['id']){return pm2['delete'](_0xbe7d2c['params']['id'])['then'](function(_0x5f36e4){pm2[_0xb4fd('0x20')]();return _0x5f36e4[0x0];})[_0xb4fd('0x11')](respondWithResult(_0x597874,null))[_0xb4fd('0x16')](handleError(_0x597874,null));}else{return _0x597874[_0xb4fd('0x8')](0x1f4)[_0xb4fd('0xd')]({'message':_0xb4fd('0x26')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 425c953..51bdcb5 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 _0xb982=['../../components/auth/service','./realtime.controller','get','/queues','isAuthenticated','getQueues','exports'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0xb982,0x15e));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x2b98('0x0'));var controller=require(_0x2b98('0x1'));router[_0x2b98('0x2')](_0x2b98('0x3'),auth[_0x2b98('0x4')](),controller[_0x2b98('0x5')]);module[_0x2b98('0x6')]=router; \ No newline at end of file +var _0x4baa=['../../components/auth/service','get','/queues','isAuthenticated','getQueues'];(function(_0x385359,_0x325c57){var _0x2ea4dd=function(_0x1bcf4f){while(--_0x1bcf4f){_0x385359['push'](_0x385359['shift']());}};_0x2ea4dd(++_0x325c57);}(_0x4baa,0x14f));var _0xa4ba=function(_0x53f463,_0x25e271){_0x53f463=_0x53f463-0x0;var _0x4f4cdd=_0x4baa[_0x53f463];return _0x4f4cdd;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xa4ba('0x0'));var controller=require('./realtime.controller');router[_0xa4ba('0x1')](_0xa4ba('0x2'),auth[_0xa4ba('0x3')](),controller[_0xa4ba('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index b8d1346..c9a4807 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 _0x741c=['error','stack','name','send','getQueues','mail','chat','sms','whatsapp','then','query','channel','toLowerCase','Invalid\x20channel','startCase','rawAttributes','fieldName','type','key','user','outbound','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','voice','request','format','waiting','talking','paused','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','get','loggedInDb','available','agents','find','merge','getAgents','getMembers','length','UserId','online','push','User','Queue','findAll','agent','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','http','offset','undefined','count','limit','status','set','Content-Range'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0x741c,0x196));var _0xc741=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x741c[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0xc741('0x0'));var _=require(_0xc741('0x1'));var jayson=require(_0xc741('0x2'));var qs=require(_0xc741('0x3'));var logger=require(_0xc741('0x4'))(_0xc741('0x5'));var db=require('../../mysqldb')['db'];var client=jayson['client'][_0xc741('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0xc741('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x1935b4,_0x3708ae){return function(_0x133bc4){if(_0x133bc4){var _0x3f3d82=typeof _0x3708ae[_0xc741('0x7')]===_0xc741('0x8')&&typeof _0x3708ae['limit']===_0xc741('0x8');var _0x1f53bf=_0x133bc4['count'];var _0xc6555=_0x3f3d82?0x0:_0x3708ae['offset'];var _0x4a4693=_0x3f3d82?_0x133bc4[_0xc741('0x9')]:_0x3708ae[_0xc741('0x7')]+_0x3708ae[_0xc741('0xa')];var _0x47501c;if(_0x4a4693>=_0x1f53bf){_0x4a4693=_0x1f53bf;_0x47501c=0xc8;}else{_0x47501c=0xce;}_0x1935b4[_0xc741('0xb')](_0x47501c);return _0x1935b4[_0xc741('0xc')](_0xc741('0xd'),_0xc6555+'-'+_0x4a4693+'/'+_0x1f53bf)['json'](_0x133bc4);}return null;};}function handleError(_0x4c8ef0,_0x51bc33){_0x51bc33=_0x51bc33||0x1f4;return function(_0x12a073){logger[_0xc741('0xe')](_0x12a073[_0xc741('0xf')]);if(_0x12a073[_0xc741('0x10')]){delete _0x12a073[_0xc741('0x10')];}_0x4c8ef0['status'](_0x51bc33)[_0xc741('0x11')](_0x12a073);};}exports[_0xc741('0x12')]=function(_0x4c190d,_0xc0383){var _0x3c7569=[_0xc741('0x13'),_0xc741('0x14'),_0xc741('0x15'),'openchannel','fax',_0xc741('0x16'),'voice'];var _0x1c4f3a={'count':0x0,'rows':[]},_0x3903c6={},_0x575184;Promise['resolve']()[_0xc741('0x17')](function(){if(_0x4c190d[_0xc741('0x18')][_0xc741('0x19')]){if(!_['includes'](_0x3c7569,_0x4c190d[_0xc741('0x18')][_0xc741('0x19')][_0xc741('0x1a')]()))throw new Error(_0xc741('0x1b'));_0x575184=_0x4c190d[_0xc741('0x18')][_0xc741('0x19')][_0xc741('0x1a')]();}var _0x30b7ea=_[_0xc741('0x1c')](_0x575184)+'Queue';var _0x26bf01=_['map'](db[_0x30b7ea][_0xc741('0x1d')],function(_0x4b5b31){return{'name':_0x4b5b31[_0xc741('0x1e')],'type':_0x4b5b31[_0xc741('0x1f')][_0xc741('0x20')]};});_0x3903c6=qs['getOptions'](_0x26bf01,_0x4c190d);if(_0x4c190d[_0xc741('0x21')]['role']===_0xc741('0x21')){var _0x28a041={'params':{'id':_0x4c190d[_0xc741('0x21')]['userProfileId']},'query':{'section':_0x575184==='voice'&&_0x4c190d['query'][_0xc741('0x1f')]===_0xc741('0x22')?_0xc741('0x23'):_[_0xc741('0x1c')](_0x575184)+_0xc741('0x24'),'type':_0x4c190d['query']['type'],'nolimit':!![],'sort':_0xc741('0x10'),'filter':_0x4c190d[_0xc741('0x18')][_0xc741('0x25')]}};return db[_0xc741('0x26')][_0xc741('0x27')](_0x28a041);}return db[_0x30b7ea][_0xc741('0x28')](_0x3903c6);})['then'](function(_0x353729){_0x1c4f3a[_0xc741('0x9')]=_0x353729['count'];var _0x3797c5=_0x575184===_0xc741('0x29')?client:routingClient;return _0x3797c5[_0xc741('0x2a')](_[_0xc741('0x1c')](_0x575184)+_0xc741('0x24'),_0x4c190d)[_0xc741('0x17')](function(_0x3b3703){if(_0x3b3703[_0xc741('0xe')])throw new Error(util[_0xc741('0x2b')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x575184));var _0x3094de=_0x3b3703['result'];var _0xbf2274=['loggedIn','available',_0xc741('0x2c'),_0xc741('0x2d'),_0xc741('0x2e')];if(_0x575184==='voice'&&_0x4c190d[_0xc741('0x18')][_0xc741('0x1f')]===_0xc741('0x22')){_0xbf2274['push'](_0xc741('0x2f'),_0xc741('0x30'),_0xc741('0x31'),_0xc741('0x32'),_0xc741('0x33'),_0xc741('0x34'),_0xc741('0x35'),'startProgressive','erlangCalls',_0xc741('0x36'),_0xc741('0x37'),_0xc741('0x38'),_0xc741('0x39'),_0xc741('0x3a'),_0xc741('0x3b'),'predictiveIntervalAvailable',_0xc741('0x3c'),_0xc741('0x3d'),'predictiveIntervalDroppedCallsTimeout',_0xc741('0x3e'),_0xc741('0x3f'),_0xc741('0x40'));}var _0x560e85=_0x353729[_0xc741('0x41')][_0xc741('0x42')](function(_0x85e752){var _0x39e9fb=_0x85e752[_0xc741('0x43')]({'plain':!![]});_0x39e9fb[_0xc741('0x2e')]=0x0;_0x39e9fb[_0xc741('0x44')]=0x0;_0x39e9fb['loggedIn']=0x0;_0x39e9fb[_0xc741('0x45')]=0x0;_0x39e9fb[_0xc741('0x2e')]=0x0;_0x39e9fb[_0xc741('0x2c')]=0x0;if(_0x575184===_0xc741('0x29')){_0x39e9fb[_0xc741('0x2d')]=0x0;if(_0x4c190d[_0xc741('0x18')][_0xc741('0x1f')]===_0xc741('0x22')){_0x39e9fb['pTalking']=0x0;_0x39e9fb[_0xc741('0x30')]=0x0;}}_0x39e9fb[_0xc741('0x46')]=[];var _0x29bc62=_[_0xc741('0x47')](_0x3094de['rows'],['id',_0x39e9fb['id']]);if(_0x29bc62)_[_0xc741('0x48')](_0x39e9fb,_['pick'](_0x29bc62,_0xbf2274));if(_0x575184===_0xc741('0x29')){return _0x85e752[_0xc741('0x49')]({'attributes':['id',_0xc741('0x10'),'online'],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x3686b2){return _0x85e752[_0xc741('0x4a')]({'raw':!![]})[_0xc741('0x17')](function(_0x3f12ea){for(var _0x1336f7=0x0;_0x1336f7<_0x3686b2[_0xc741('0x4b')];_0x1336f7++){var _0x3e7b76=_[_0xc741('0x47')](_0x3f12ea,[_0xc741('0x4c'),_0x3686b2[_0x1336f7]['id']]);var _0x2542aa={'id':_0x3686b2[_0x1336f7]['id'],'name':_0x3686b2[_0x1336f7][_0xc741('0x10')],'online':Boolean(_0x3686b2[_0x1336f7][_0xc741('0x4d')]),'paused':_0x3e7b76?Boolean(_0x3e7b76[_0xc741('0x2e')]):![]};if(_0x2542aa[_0xc741('0x4d')])_0x39e9fb[_0xc741('0x44')]++;if(_0x2542aa[_0xc741('0x2e')])_0x39e9fb[_0xc741('0x2e')]++;_0x39e9fb['agents'][_0xc741('0x4e')](_0x2542aa);}return _0x39e9fb;});});}else{var _0x497598=_0xc741('0x4f')+_['startCase'](_0x575184)+_0xc741('0x50');var _0x258281=_0x575184+'Pause';return db[_0x497598][_0xc741('0x51')]({'where':{[_[_0xc741('0x1c')](_0x575184)+'QueueId']:_0x85e752['id']},'raw':!![]})[_0xc741('0x17')](function(_0x14ce60){return db[_0xc741('0x4f')][_0xc741('0x51')]({'attributes':['id',_0xc741('0x10'),_0xc741('0x4d'),_0x258281],'where':{'id':_[_0xc741('0x42')](_0x14ce60,'UserId'),'role':_0xc741('0x52')},'raw':!![]});})['then'](function(_0x47ac55){for(var _0x61bfc7=0x0;_0x61bfc7<_0x47ac55['length'];_0x61bfc7++){var _0x113c1e={'id':_0x47ac55[_0x61bfc7]['id'],'name':_0x47ac55[_0x61bfc7][_0xc741('0x10')],'online':Boolean(_0x47ac55[_0x61bfc7][_0xc741('0x4d')]),'paused':Boolean(_0x47ac55[_0x61bfc7][_0x258281])};if(_0x113c1e[_0xc741('0x4d')])_0x39e9fb[_0xc741('0x44')]++;if(_0x113c1e[_0xc741('0x2e')])_0x39e9fb[_0xc741('0x2e')]++;_0x39e9fb[_0xc741('0x46')][_0xc741('0x4e')](_0x113c1e);}return _0x39e9fb;});}});return Promise['all'](_0x560e85);});})['then'](function(_0x12dde4){_0x1c4f3a[_0xc741('0x41')]=_0x12dde4;return _0x1c4f3a;})[_0xc741('0x17')](respondWithFilteredResult(_0xc0383,_0x3903c6))[_0xc741('0x53')](handleError(_0xc0383,null));}; \ No newline at end of file +var _0xfdbd=['user','role','userProfileId','type','outbound','QueueCampaigns','Queues','UserProfile','getResources','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','push','pTalking','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','get','paused','loggedInDb','originated','agents','find','pick','getAgents','online','getMembers','UserId','User','QueueId','findAll','agent','length','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','limit','undefined','count','offset','status','set','json','error','stack','name','getQueues','mail','chat','sms','openchannel','voice','resolve','then','query','channel','includes','toLowerCase','startCase','Queue','rawAttributes','fieldName','key'];(function(_0x4c9206,_0x5155d0){var _0x197c5b=function(_0x5c8cae){while(--_0x5c8cae){_0x4c9206['push'](_0x4c9206['shift']());}};_0x197c5b(++_0x5155d0);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x5e848d,_0x1dbd20){_0x5e848d=_0x5e848d-0x0;var _0x3785e5=_0xfdbd[_0x5e848d];return _0x3785e5;};'use strict';var util=require(_0xdfdb('0x0'));var _=require(_0xdfdb('0x1'));var jayson=require(_0xdfdb('0x2'));var qs=require(_0xdfdb('0x3'));var logger=require(_0xdfdb('0x4'))(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var client=jayson[_0xdfdb('0x7')][_0xdfdb('0x8')]({'port':0x232a});var routingClient=jayson['client'][_0xdfdb('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x4a4a3f,_0x453ef6){return function(_0x41bd5e){if(_0x41bd5e){var _0x489f19=typeof _0x453ef6['offset']==='undefined'&&typeof _0x453ef6[_0xdfdb('0x9')]===_0xdfdb('0xa');var _0x47c629=_0x41bd5e[_0xdfdb('0xb')];var _0x444c19=_0x489f19?0x0:_0x453ef6[_0xdfdb('0xc')];var _0x27ddcd=_0x489f19?_0x41bd5e[_0xdfdb('0xb')]:_0x453ef6[_0xdfdb('0xc')]+_0x453ef6[_0xdfdb('0x9')];var _0x47dccc;if(_0x27ddcd>=_0x47c629){_0x27ddcd=_0x47c629;_0x47dccc=0xc8;}else{_0x47dccc=0xce;}_0x4a4a3f[_0xdfdb('0xd')](_0x47dccc);return _0x4a4a3f[_0xdfdb('0xe')]('Content-Range',_0x444c19+'-'+_0x27ddcd+'/'+_0x47c629)[_0xdfdb('0xf')](_0x41bd5e);}return null;};}function handleError(_0x33a706,_0x2bee3b){_0x2bee3b=_0x2bee3b||0x1f4;return function(_0x1918c1){logger[_0xdfdb('0x10')](_0x1918c1[_0xdfdb('0x11')]);if(_0x1918c1[_0xdfdb('0x12')]){delete _0x1918c1[_0xdfdb('0x12')];}_0x33a706['status'](_0x2bee3b)['send'](_0x1918c1);};}exports[_0xdfdb('0x13')]=function(_0x4b1ff7,_0x471ddc){var _0x9f3039=[_0xdfdb('0x14'),_0xdfdb('0x15'),_0xdfdb('0x16'),_0xdfdb('0x17'),'fax','whatsapp',_0xdfdb('0x18')];var _0x8b9193={'count':0x0,'rows':[]},_0x2c1070={},_0x55ab5a;Promise[_0xdfdb('0x19')]()[_0xdfdb('0x1a')](function(){if(_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x1c')]){if(!_[_0xdfdb('0x1d')](_0x9f3039,_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x1c')][_0xdfdb('0x1e')]()))throw new Error('Invalid\x20channel');_0x55ab5a=_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x1c')][_0xdfdb('0x1e')]();}var _0x5cc70b=_[_0xdfdb('0x1f')](_0x55ab5a)+_0xdfdb('0x20');var _0x2c7dd1=_['map'](db[_0x5cc70b][_0xdfdb('0x21')],function(_0x789bd2){return{'name':_0x789bd2[_0xdfdb('0x22')],'type':_0x789bd2['type'][_0xdfdb('0x23')]};});_0x2c1070=qs['getOptions'](_0x2c7dd1,_0x4b1ff7);if(_0x4b1ff7[_0xdfdb('0x24')][_0xdfdb('0x25')]===_0xdfdb('0x24')){var _0x2a560c={'params':{'id':_0x4b1ff7['user'][_0xdfdb('0x26')]},'query':{'section':_0x55ab5a===_0xdfdb('0x18')&&_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x27')]===_0xdfdb('0x28')?_0xdfdb('0x29'):_['startCase'](_0x55ab5a)+_0xdfdb('0x2a'),'type':_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x27')],'nolimit':!![],'sort':'name','filter':_0x4b1ff7[_0xdfdb('0x1b')]['filter']}};return db[_0xdfdb('0x2b')][_0xdfdb('0x2c')](_0x2a560c);}return db[_0x5cc70b][_0xdfdb('0x2d')](_0x2c1070);})['then'](function(_0x5bc174){_0x8b9193[_0xdfdb('0xb')]=_0x5bc174[_0xdfdb('0xb')];var _0xedbb91=_0x55ab5a===_0xdfdb('0x18')?client:routingClient;return _0xedbb91[_0xdfdb('0x2e')](_[_0xdfdb('0x1f')](_0x55ab5a)+'Queues',_0x4b1ff7)[_0xdfdb('0x1a')](function(_0x364805){if(_0x364805[_0xdfdb('0x10')])throw new Error(util[_0xdfdb('0x2f')](_0xdfdb('0x30'),_0x55ab5a));var _0x157de8=_0x364805[_0xdfdb('0x31')];var _0x1ce036=[_0xdfdb('0x32'),_0xdfdb('0x33'),_0xdfdb('0x34'),'talking','paused'];if(_0x55ab5a===_0xdfdb('0x18')&&_0x4b1ff7['query'][_0xdfdb('0x27')]===_0xdfdb('0x28')){_0x1ce036[_0xdfdb('0x35')](_0xdfdb('0x36'),'originated',_0xdfdb('0x37'),'dialActive',_0xdfdb('0x38'),_0xdfdb('0x39'),_0xdfdb('0x3a'),_0xdfdb('0x3b'),_0xdfdb('0x3c'),_0xdfdb('0x3d'),'erlangAbandonmentRate',_0xdfdb('0x3e'),_0xdfdb('0x3f'),'dialPredictiveIntervalMaxThreshold',_0xdfdb('0x40'),_0xdfdb('0x41'),_0xdfdb('0x42'),_0xdfdb('0x43'),_0xdfdb('0x44'),_0xdfdb('0x45'),_0xdfdb('0x46'),_0xdfdb('0x47'));}var _0x21f4c7=_0x5bc174[_0xdfdb('0x48')][_0xdfdb('0x49')](function(_0x5530d8){var _0x2defcc=_0x5530d8[_0xdfdb('0x4a')]({'plain':!![]});_0x2defcc[_0xdfdb('0x4b')]=0x0;_0x2defcc[_0xdfdb('0x4c')]=0x0;_0x2defcc[_0xdfdb('0x32')]=0x0;_0x2defcc[_0xdfdb('0x33')]=0x0;_0x2defcc[_0xdfdb('0x4b')]=0x0;_0x2defcc[_0xdfdb('0x34')]=0x0;if(_0x55ab5a==='voice'){_0x2defcc['talking']=0x0;if(_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x27')]===_0xdfdb('0x28')){_0x2defcc[_0xdfdb('0x36')]=0x0;_0x2defcc[_0xdfdb('0x4d')]=0x0;}}_0x2defcc[_0xdfdb('0x4e')]=[];var _0x3da4ca=_[_0xdfdb('0x4f')](_0x157de8[_0xdfdb('0x48')],['id',_0x2defcc['id']]);if(_0x3da4ca)_['merge'](_0x2defcc,_[_0xdfdb('0x50')](_0x3da4ca,_0x1ce036));if(_0x55ab5a===_0xdfdb('0x18')){return _0x5530d8[_0xdfdb('0x51')]({'attributes':['id',_0xdfdb('0x12'),_0xdfdb('0x52')],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x281cec){return _0x5530d8[_0xdfdb('0x53')]({'raw':!![]})[_0xdfdb('0x1a')](function(_0x3f95fe){for(var _0x431004=0x0;_0x431004<_0x281cec['length'];_0x431004++){var _0x1d7a3a=_[_0xdfdb('0x4f')](_0x3f95fe,[_0xdfdb('0x54'),_0x281cec[_0x431004]['id']]);var _0x5b4381={'id':_0x281cec[_0x431004]['id'],'name':_0x281cec[_0x431004][_0xdfdb('0x12')],'online':Boolean(_0x281cec[_0x431004]['online']),'paused':_0x1d7a3a?Boolean(_0x1d7a3a[_0xdfdb('0x4b')]):![]};if(_0x5b4381['online'])_0x2defcc[_0xdfdb('0x4c')]++;if(_0x5b4381[_0xdfdb('0x4b')])_0x2defcc['paused']++;_0x2defcc[_0xdfdb('0x4e')]['push'](_0x5b4381);}return _0x2defcc;});});}else{var _0xfea790=_0xdfdb('0x55')+_[_0xdfdb('0x1f')](_0x55ab5a)+_0xdfdb('0x20');var _0x25cc2f=_0x55ab5a+'Pause';return db[_0xfea790]['findAll']({'where':{[_[_0xdfdb('0x1f')](_0x55ab5a)+_0xdfdb('0x56')]:_0x5530d8['id']},'raw':!![]})['then'](function(_0x2b0a8b){return db['User'][_0xdfdb('0x57')]({'attributes':['id',_0xdfdb('0x12'),_0xdfdb('0x52'),_0x25cc2f],'where':{'id':_[_0xdfdb('0x49')](_0x2b0a8b,_0xdfdb('0x54')),'role':_0xdfdb('0x58')},'raw':!![]});})[_0xdfdb('0x1a')](function(_0x11ce58){for(var _0x2ac36e=0x0;_0x2ac36e<_0x11ce58[_0xdfdb('0x59')];_0x2ac36e++){var _0x24f88a={'id':_0x11ce58[_0x2ac36e]['id'],'name':_0x11ce58[_0x2ac36e][_0xdfdb('0x12')],'online':Boolean(_0x11ce58[_0x2ac36e][_0xdfdb('0x52')]),'paused':Boolean(_0x11ce58[_0x2ac36e][_0x25cc2f])};if(_0x24f88a[_0xdfdb('0x52')])_0x2defcc[_0xdfdb('0x4c')]++;if(_0x24f88a[_0xdfdb('0x4b')])_0x2defcc['paused']++;_0x2defcc['agents'][_0xdfdb('0x35')](_0x24f88a);}return _0x2defcc;});}});return Promise[_0xdfdb('0x5a')](_0x21f4c7);});})[_0xdfdb('0x1a')](function(_0x4bbb88){_0x8b9193[_0xdfdb('0x48')]=_0x4bbb88;return _0x8b9193;})[_0xdfdb('0x1a')](respondWithFilteredResult(_0x471ddc,_0x2c1070))[_0xdfdb('0x5b')](handleError(_0x471ddc,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 682ab50..fbe05b9 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5d5ad9,_0x9fe65c){var _0x461f64=function(_0x97c064){while(--_0x97c064){_0x5d5ad9['push'](_0x5d5ad9['shift']());}};_0x461f64(++_0x9fe65c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2456cd,_0x26bd74){var _0x1e14b2=function(_0x45e61c){while(--_0x45e61c){_0x2456cd['push'](_0x2456cd['shift']());}};_0x1e14b2(++_0x26bd74);}(_0xe706,0xa3));var _0x6e70=function(_0x1575cf,_0x1190d4){_0x1575cf=_0x1575cf-0x0;var _0x2b7a4e=_0xe706[_0x1575cf];return _0x2b7a4e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 3455b18..b4ce738 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 _0x7ee1=['INTEGER','sequelize','DATE','STRING'];(function(_0x33f965,_0x4f7cb7){var _0x544810=function(_0x530b06){while(--_0x530b06){_0x33f965['push'](_0x33f965['shift']());}};_0x544810(++_0x4f7cb7);}(_0x7ee1,0x8d));var _0x17ee=function(_0x110d14,_0x26bcfc){_0x110d14=_0x110d14-0x0;var _0x18dc53=_0x7ee1[_0x110d14];return _0x18dc53;};'use strict';var Sequelize=require(_0x17ee('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x17ee('0x1')]},'uniqueid':{'type':Sequelize[_0x17ee('0x2')]},'starttime':{'type':Sequelize[_0x17ee('0x1')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x17ee('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x17ee('0x2')]},'campaigntype':{'type':Sequelize[_0x17ee('0x2')]},'membername':{'type':Sequelize[_0x17ee('0x2')]}}; \ No newline at end of file +var _0x1883=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x30ae02,_0x2d8a4a){var _0xc8abc8=function(_0xcaa8a7){while(--_0xcaa8a7){_0x30ae02['push'](_0x30ae02['shift']());}};_0xc8abc8(++_0x2d8a4a);}(_0x1883,0xab));var _0x3188=function(_0x59eccd,_0x4f9f97){_0x59eccd=_0x59eccd-0x0;var _0x40f30d=_0x1883[_0x59eccd];return _0x40f30d;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'state':{'type':Sequelize[_0x3188('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x3188('0x3')]},'scheduledat':{'type':Sequelize[_0x3188('0x4')]},'uniqueid':{'type':Sequelize[_0x3188('0x3')]},'starttime':{'type':Sequelize[_0x3188('0x4')]},'responsetime':{'type':Sequelize[_0x3188('0x4')]},'ringtime':{'type':Sequelize[_0x3188('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x3188('0x3')]},'campaigntype':{'type':Sequelize[_0x3188('0x3')]},'membername':{'type':Sequelize[_0x3188('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 2f3af4b..99335f3 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 _0xf6de=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api'];(function(_0x515c44,_0x182ec9){var _0x5a763c=function(_0x1df3db){while(--_0x1df3db){_0x515c44['push'](_0x515c44['shift']());}};_0x5a763c(++_0x182ec9);}(_0xf6de,0x13e));var _0xef6d=function(_0x90a39a,_0x32020d){_0x90a39a=_0x90a39a-0x0;var _0x2b62f7=_0xf6de[_0x90a39a];return _0x2b62f7;};'use strict';var _=require(_0xef6d('0x0'));var util=require(_0xef6d('0x1'));var logger=require(_0xef6d('0x2'))(_0xef6d('0x3'));var moment=require(_0xef6d('0x4'));var BPromise=require(_0xef6d('0x5'));var rp=require(_0xef6d('0x6'));var fs=require('fs');var path=require(_0xef6d('0x7'));var rimraf=require(_0xef6d('0x8'));var config=require(_0xef6d('0x9'));var attributes=require('./reportAgentPreview.attributes');module[_0xef6d('0xa')]=function(_0x65b348,_0x4d2436){return _0x65b348[_0xef6d('0xb')](_0xef6d('0xc'),attributes,{'tableName':_0xef6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84cb=['bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','util','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x84cb,0x116));var _0xb84c=function(_0x293838,_0x541252){_0x293838=_0x293838-0x0;var _0x5b50c3=_0x84cb[_0x293838];return _0x5b50c3;};'use strict';var _=require('lodash');var util=require(_0xb84c('0x0'));var logger=require(_0xb84c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb84c('0x2'));var rp=require(_0xb84c('0x3'));var fs=require('fs');var path=require(_0xb84c('0x4'));var rimraf=require('rimraf');var config=require(_0xb84c('0x5'));var attributes=require(_0xb84c('0x6'));module['exports']=function(_0x1174ad,_0x58464f){return _0x1174ad[_0xb84c('0x7')](_0xb84c('0x8'),attributes,{'tableName':_0xb84c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 8563828..7e50ce3 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 _0x08d3=['../../config/utils','../../config/logger','rpc','client','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','lodash','moment','../../mysqldb'];(function(_0x16efb3,_0xad75c6){var _0x5798b3=function(_0x2a14e1){while(--_0x2a14e1){_0x16efb3['push'](_0x16efb3['shift']());}};_0x5798b3(++_0xad75c6);}(_0x08d3,0x11d));var _0x308d=function(_0x2df2d0,_0x1d6ea8){_0x2df2d0=_0x2df2d0-0x0;var _0x3c4438=_0x08d3[_0x2df2d0];return _0x3c4438;};'use strict';var _=require(_0x308d('0x0'));var util=require('util');var moment=require(_0x308d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x308d('0x2'))['db'];var utils=require(_0x308d('0x3'));var logger=require(_0x308d('0x4'))(_0x308d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x308d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x534280,_0x339471,_0x521900){return new BPromise(function(_0x2049f5,_0x505a8e){return client['request'](_0x534280,_0x521900)['then'](function(_0x48528e){logger[_0x308d('0x7')]('ReportAgentPreview,\x20%s,\x20%s',_0x339471,_0x308d('0x8'));logger[_0x308d('0x9')](_0x308d('0xa'),_0x339471,_0x308d('0x8'),JSON['stringify'](_0x48528e));if(_0x48528e[_0x308d('0xb')]){if(_0x48528e[_0x308d('0xb')][_0x308d('0xc')]===0x1f4){logger[_0x308d('0xb')](_0x308d('0xd'),_0x339471,_0x48528e[_0x308d('0xb')][_0x308d('0xe')]);return _0x505a8e(_0x48528e[_0x308d('0xb')]['message']);}logger['error'](_0x308d('0xd'),_0x339471,_0x48528e['error'][_0x308d('0xe')]);return _0x2049f5(_0x48528e[_0x308d('0xb')][_0x308d('0xe')]);}else{logger[_0x308d('0x7')]('ReportAgentPreview,\x20%s,\x20%s',_0x339471,_0x308d('0x8'));_0x2049f5(_0x48528e[_0x308d('0xf')][_0x308d('0xe')]);}})[_0x308d('0x10')](function(_0x23b0a2){logger[_0x308d('0xb')](_0x308d('0xd'),_0x339471,_0x23b0a2);_0x505a8e(_0x23b0a2);});});}exports[_0x308d('0x11')]=function(_0x20446f){var _0x426f14=this;return new Promise(function(_0x5afcf4,_0x1e16bb){return db[_0x308d('0x12')][_0x308d('0x13')](_0x20446f[_0x308d('0x14')],{'raw':_0x20446f[_0x308d('0x15')]?_0x20446f[_0x308d('0x15')][_0x308d('0x16')]===undefined?!![]:![]:!![]})[_0x308d('0x17')](function(_0x319726){logger[_0x308d('0x7')]('CreateReportAgentPreview',_0x20446f);logger['debug'](_0x308d('0x11'),_0x20446f,JSON['stringify'](_0x319726));_0x5afcf4(_0x319726);})['catch'](function(_0x28995e){logger[_0x308d('0xb')](_0x308d('0x11'),_0x28995e['message'],_0x20446f);_0x1e16bb(_0x426f14['error'](0x1f4,_0x28995e[_0x308d('0xe')]));});});}; \ No newline at end of file +var _0xb392=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','info','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x48ee31,_0x15b628){var _0x1da5e0=function(_0x55d07a){while(--_0x55d07a){_0x48ee31['push'](_0x48ee31['shift']());}};_0x1da5e0(++_0x15b628);}(_0xb392,0x15a));var _0x2b39=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xb392[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x2b39('0x0'));var util=require(_0x2b39('0x1'));var moment=require(_0x2b39('0x2'));var BPromise=require(_0x2b39('0x3'));var rs=require(_0x2b39('0x4'));var fs=require('fs');var Redis=require(_0x2b39('0x5'));var db=require(_0x2b39('0x6'))['db'];var utils=require(_0x2b39('0x7'));var logger=require(_0x2b39('0x8'))(_0x2b39('0x9'));var config=require(_0x2b39('0xa'));var jayson=require(_0x2b39('0xb'));var client=jayson[_0x2b39('0xc')][_0x2b39('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5af652,_0x55d1a3,_0x32236c){return new BPromise(function(_0x1e1eb0,_0x2c53c0){return client[_0x2b39('0xe')](_0x5af652,_0x32236c)[_0x2b39('0xf')](function(_0x57dbf2){logger['info'](_0x2b39('0x10'),_0x55d1a3,_0x2b39('0x11'));logger['debug'](_0x2b39('0x12'),_0x55d1a3,_0x2b39('0x11'),JSON[_0x2b39('0x13')](_0x57dbf2));if(_0x57dbf2[_0x2b39('0x14')]){if(_0x57dbf2[_0x2b39('0x14')][_0x2b39('0x15')]===0x1f4){logger['error'](_0x2b39('0x10'),_0x55d1a3,_0x57dbf2['error']['message']);return _0x2c53c0(_0x57dbf2[_0x2b39('0x14')][_0x2b39('0x16')]);}logger['error'](_0x2b39('0x10'),_0x55d1a3,_0x57dbf2[_0x2b39('0x14')]['message']);return _0x1e1eb0(_0x57dbf2['error'][_0x2b39('0x16')]);}else{logger['info'](_0x2b39('0x10'),_0x55d1a3,_0x2b39('0x11'));_0x1e1eb0(_0x57dbf2['result']['message']);}})[_0x2b39('0x17')](function(_0x19aab7){logger['error'](_0x2b39('0x10'),_0x55d1a3,_0x19aab7);_0x2c53c0(_0x19aab7);});});}exports[_0x2b39('0x18')]=function(_0x4a1ec2){var _0xcd306f=this;return new Promise(function(_0x6da874,_0x23c77e){return db[_0x2b39('0x19')][_0x2b39('0x1a')](_0x4a1ec2[_0x2b39('0x1b')],{'raw':_0x4a1ec2[_0x2b39('0x1c')]?_0x4a1ec2[_0x2b39('0x1c')][_0x2b39('0x1d')]===undefined?!![]:![]:!![]})[_0x2b39('0xf')](function(_0x207d2a){logger[_0x2b39('0x1e')](_0x2b39('0x18'),_0x4a1ec2);logger[_0x2b39('0x1f')](_0x2b39('0x18'),_0x4a1ec2,JSON[_0x2b39('0x13')](_0x207d2a));_0x6da874(_0x207d2a);})[_0x2b39('0x17')](function(_0x9b7021){logger[_0x2b39('0x14')]('CreateReportAgentPreview',_0x9b7021[_0x2b39('0x16')],_0x4a1ec2);_0x23c77e(_0xcd306f['error'](0x1f4,_0x9b7021['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 10b7997..fdf7882 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 _0xc695=['queueNotify','mail','/mail/queues/:id','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','agents','put','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xc695,0x1cc));var _0x5c69=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0xc695[_0x1ad926];return _0x1b81dc;};'use strict';var multer=require(_0x5c69('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x5c69('0x1'));router[_0x5c69('0x2')]('/voice/channels',auth[_0x5c69('0x3')](),controller[_0x5c69('0x4')]);router['get'](_0x5c69('0x5'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x6')]);router['get'](_0x5c69('0x7'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x5c69('0x2')](_0x5c69('0x8'),auth[_0x5c69('0x3')](),controller['voiceQueues']);router[_0x5c69('0x2')]('/chat/queues',auth[_0x5c69('0x3')](),controller[_0x5c69('0x9')]);router[_0x5c69('0x2')](_0x5c69('0xa'),auth[_0x5c69('0x3')](),controller[_0x5c69('0xb')]);router[_0x5c69('0x2')](_0x5c69('0xc'),auth[_0x5c69('0x3')](),controller['mailAccounts']);router[_0x5c69('0x2')](_0x5c69('0xd'),auth[_0x5c69('0x3')](),controller[_0x5c69('0xe')]);router['get'](_0x5c69('0xf'),auth[_0x5c69('0x3')](),controller['smsQueues']);router['get'](_0x5c69('0x10'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x11')]);router[_0x5c69('0x2')](_0x5c69('0x12'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x13')]);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x5c69('0x14')]);router[_0x5c69('0x2')](_0x5c69('0x15'),auth[_0x5c69('0x3')](),controller['voiceQueuesChannels']);router['get']('/voice/queues/channels/:uniqueid',auth[_0x5c69('0x3')](),controller[_0x5c69('0x16')]);router[_0x5c69('0x2')](_0x5c69('0x17'),auth[_0x5c69('0x3')](),controller['voiceQueuesChannelHangup']);router['get'](_0x5c69('0x18'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x19')]);router[_0x5c69('0x2')](_0x5c69('0x1a'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x1b')]);router['put'](_0x5c69('0x1a'),auth[_0x5c69('0x3')](),controller['updateVoiceQueue']);router[_0x5c69('0x2')](_0x5c69('0x1c'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x1d')]);router['get']('/outbound/channels',auth['isAuthenticated'](),controller[_0x5c69('0x1e')]);router[_0x5c69('0x2')]('/agents',auth['isAuthenticated'](),controller[_0x5c69('0x1f')]);router[_0x5c69('0x20')]('/agents/:id/capacity',auth[_0x5c69('0x3')](),controller['agentCapacity']);router[_0x5c69('0x2')](_0x5c69('0x21'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x22')]);router['get']('/trunks',auth[_0x5c69('0x3')](),controller[_0x5c69('0x23')]);router['get'](_0x5c69('0x24'),auth['isAuthenticated'](),controller[_0x5c69('0x25')]);router[_0x5c69('0x2')](_0x5c69('0x26'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x27')]);router[_0x5c69('0x2')](_0x5c69('0x28'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x29')]);router['get'](_0x5c69('0x2a'),auth[_0x5c69('0x3')](),controller['mailQueuesWaitingInteractions']);router[_0x5c69('0x2')](_0x5c69('0x2b'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x2c')]);router[_0x5c69('0x2')]('/openchannel/queues/:id/waitinginteractions',auth[_0x5c69('0x3')](),controller[_0x5c69('0x2d')]);router['get'](_0x5c69('0x2e'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x2f')]);router[_0x5c69('0x2')](_0x5c69('0x30'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x5c69('0x2')](_0x5c69('0x31'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x32')]);router['post']('/mail/queues/:id/notify',auth[_0x5c69('0x3')](),controller[_0x5c69('0x33')](_0x5c69('0x34')));router[_0x5c69('0x2')](_0x5c69('0x35'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x5c69('0x36')](_0x5c69('0x37'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x33')](_0x5c69('0x38')));router[_0x5c69('0x2')](_0x5c69('0x39'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x3a')]);router['post']('/fax/queues/:id/notify',auth[_0x5c69('0x3')](),controller[_0x5c69('0x33')](_0x5c69('0x3b')));router[_0x5c69('0x2')](_0x5c69('0x3c'),auth[_0x5c69('0x3')](),controller['showFaxQueues']);router[_0x5c69('0x36')](_0x5c69('0x3d'),auth[_0x5c69('0x3')](),controller['queueNotify']('openchannel'));router['get'](_0x5c69('0x3e'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x3f')]);router[_0x5c69('0x36')](_0x5c69('0x40'),auth['isAuthenticated'](),controller[_0x5c69('0x33')](_0x5c69('0x41')));router[_0x5c69('0x36')](_0x5c69('0x42'),auth[_0x5c69('0x3')](),controller['queueNotify']('whatsapp'));router['get'](_0x5c69('0x43'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x44')]);router['get'](_0x5c69('0x45'),auth[_0x5c69('0x3')](),controller[_0x5c69('0x46')]);router['post'](_0x5c69('0x47'),auth['isAuthenticated'](),controller[_0x5c69('0x48')]);module['exports']=router; \ No newline at end of file +var _0xf289=['mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','util','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0xf289,0x132));var _0x9f28=function(_0x464f32,_0x4d9ecb){_0x464f32=_0x464f32-0x0;var _0x24f5ec=_0xf289[_0x464f32];return _0x24f5ec;};'use strict';var multer=require(_0x9f28('0x0'));var util=require(_0x9f28('0x1'));var path=require('path');var express=require('express');var router=express[_0x9f28('0x2')]();var auth=require(_0x9f28('0x3'));var controller=require(_0x9f28('0x4'));router[_0x9f28('0x5')](_0x9f28('0x6'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x8')]);router[_0x9f28('0x5')](_0x9f28('0x9'),auth[_0x9f28('0x7')](),controller[_0x9f28('0xa')]);router[_0x9f28('0x5')](_0x9f28('0xb'),auth[_0x9f28('0x7')](),controller[_0x9f28('0xc')]);router[_0x9f28('0x5')](_0x9f28('0xd'),auth['isAuthenticated'](),controller[_0x9f28('0xe')]);router[_0x9f28('0x5')](_0x9f28('0xf'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x10')]);router[_0x9f28('0x5')](_0x9f28('0x11'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x12')]);router[_0x9f28('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x9f28('0x13')]);router['get']('/openchannel/queues',auth[_0x9f28('0x7')](),controller[_0x9f28('0x14')]);router[_0x9f28('0x5')](_0x9f28('0x15'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x16')]);router[_0x9f28('0x5')](_0x9f28('0x17'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x18')]);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0x9f28('0x19')]);router[_0x9f28('0x5')](_0x9f28('0x1a'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x1b')]);router[_0x9f28('0x5')](_0x9f28('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x9f28('0x5')](_0x9f28('0x1d'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router['get'](_0x9f28('0x1e'),auth[_0x9f28('0x7')](),controller['voiceQueuesChannelHangup']);router[_0x9f28('0x5')](_0x9f28('0x1f'),auth[_0x9f28('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x9f28('0x5')](_0x9f28('0x20'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x21')]);router[_0x9f28('0x22')]('/voice/queues/:id',auth[_0x9f28('0x7')](),controller[_0x9f28('0x23')]);router['get']('/outbound',auth['isAuthenticated'](),controller[_0x9f28('0x24')]);router[_0x9f28('0x5')](_0x9f28('0x25'),auth['isAuthenticated'](),controller[_0x9f28('0x26')]);router[_0x9f28('0x5')](_0x9f28('0x27'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x28')]);router[_0x9f28('0x22')](_0x9f28('0x29'),auth[_0x9f28('0x7')](),controller['agentCapacity']);router['get']('/telephones',auth[_0x9f28('0x7')](),controller[_0x9f28('0x2a')]);router[_0x9f28('0x5')](_0x9f28('0x2b'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x2c')]);router[_0x9f28('0x5')]('/campaigns',auth[_0x9f28('0x7')](),controller[_0x9f28('0x2d')]);router[_0x9f28('0x5')](_0x9f28('0x2e'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x2f')]);router[_0x9f28('0x5')]('/chat/queues/waitinginteractions',auth[_0x9f28('0x7')](),controller[_0x9f28('0x30')]);router[_0x9f28('0x5')](_0x9f28('0x31'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x32')]);router[_0x9f28('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x9f28('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0x9f28('0x5')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x9f28('0x33')]);router['get'](_0x9f28('0x34'),auth['isAuthenticated'](),controller[_0x9f28('0x35')]);router['get'](_0x9f28('0x36'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x37')]);router[_0x9f28('0x5')](_0x9f28('0x38'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x39')]);router[_0x9f28('0x3a')](_0x9f28('0x3b'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x3c')](_0x9f28('0x3d')));router[_0x9f28('0x5')](_0x9f28('0x3e'),auth['isAuthenticated'](),controller[_0x9f28('0x3f')]);router['post'](_0x9f28('0x40'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x3c')]('chat'));router[_0x9f28('0x5')](_0x9f28('0x41'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x42')]);router['post'](_0x9f28('0x43'),auth['isAuthenticated'](),controller[_0x9f28('0x3c')](_0x9f28('0x44')));router[_0x9f28('0x5')]('/fax/queues/:id',auth[_0x9f28('0x7')](),controller['showFaxQueues']);router['post']('/openchannel/queues/:id/notify',auth[_0x9f28('0x7')](),controller[_0x9f28('0x3c')](_0x9f28('0x45')));router[_0x9f28('0x5')](_0x9f28('0x46'),auth['isAuthenticated'](),controller[_0x9f28('0x47')]);router[_0x9f28('0x3a')](_0x9f28('0x48'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x3c')](_0x9f28('0x49')));router[_0x9f28('0x3a')](_0x9f28('0x4a'),auth[_0x9f28('0x7')](),controller['queueNotify'](_0x9f28('0x4b')));router['get'](_0x9f28('0x4c'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x4d')]);router[_0x9f28('0x5')](_0x9f28('0x4e'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x4f')]);router[_0x9f28('0x3a')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x9f28('0x50')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 87a4365..14993d6 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 _0x7dfd=['interface','format','SIP/%s','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','filter','indexOf','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','findOne','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes'];(function(_0x2e9f39,_0x436def){var _0x3bf3bc=function(_0x2ee611){while(--_0x2ee611){_0x2e9f39['push'](_0x2e9f39['shift']());}};_0x3bf3bc(++_0x436def);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xd7df('0x0'));var moment=require(_0xd7df('0x1'));var _=require(_0xd7df('0x2'));var util=require(_0xd7df('0x3'));var db=require(_0xd7df('0x4'))['db'];var logger=require(_0xd7df('0x5'))(_0xd7df('0x6'));var jayson=require(_0xd7df('0x7'));var amiClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232a});var mailClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232b});var routingClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x354ea7,_0x16e50,_0x2c48a4){return new BPromise(function(_0x5c220a,_0xab6742){var _0xb3557a=_0x2c48a4?_0x2c48a4:amiClient;return _0xb3557a[_0xd7df('0xa')](_0x354ea7,_0x16e50)[_0xd7df('0xb')](function(_0x5e59c3){if(_0x5e59c3[_0xd7df('0xc')]){if(_0x5e59c3['error'][_0xd7df('0xd')]===0x1f4){return _0xab6742(_0x5e59c3['error'][_0xd7df('0xe')]);}return _0x5c220a(_0x5e59c3[_0xd7df('0xc')][_0xd7df('0xe')]);}else{_0x5c220a(_0x5e59c3[_0xd7df('0xf')]);}})[_0xd7df('0x10')](function(_0x174c88){_0xab6742(_0x174c88);});});}function respondWithResult(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xc8;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x11')](_0x3da618)[_0xd7df('0x12')](_0x7ba3c);}return _0x2e8187[_0xd7df('0x13')](0x194);};}function handleError(_0xe1595f,_0x196632){_0x196632=_0x196632||0x1f4;return function(_0x3b2559){logger[_0xd7df('0xc')](_0x3b2559[_0xd7df('0x14')]);if(_0x3b2559['name']){delete _0x3b2559[_0xd7df('0x15')];}_0xe1595f[_0xd7df('0x11')](_0x196632)['send'](_0x3b2559);};}function findById(_0x18d38f){return function(_0xbe1c5e){if(!_['isNil'](_0x18d38f)&&!_[_0xd7df('0x16')](_0xbe1c5e)&&!_[_0xd7df('0x16')](_0xbe1c5e[_0xd7df('0x17')])){return _['find'](_0xbe1c5e[_0xd7df('0x17')],function(_0x471621){return _0x471621['id']==_0x18d38f;});}return null;};}exports[_0xd7df('0x18')]=function(_0x5ba653,_0x96d86e){return respondWithRpcPromise(_0xd7df('0x19'),_0x5ba653[_0xd7df('0x1a')])['then'](respondWithResult(_0x96d86e,null))[_0xd7df('0x10')](handleError(_0x96d86e,null));};exports['voiceChannelMixMonitor']=function(_0x225e33,_0x5ab737){return respondWithRpcPromise(_0xd7df('0x1b'),_[_0xd7df('0x1c')](_0x225e33[_0xd7df('0x1a')],_0x225e33['params']))[_0xd7df('0xb')](respondWithResult(_0x5ab737,null))['catch'](handleError(_0x5ab737,null));};exports[_0xd7df('0x1d')]=function(_0x379e4a,_0x40e7af){return respondWithRpcPromise(_0xd7df('0x1e'),_[_0xd7df('0x1c')](_0x379e4a[_0xd7df('0x1a')],_0x379e4a[_0xd7df('0x1f')]))['then'](respondWithResult(_0x40e7af,null))['catch'](handleError(_0x40e7af,null));};exports[_0xd7df('0x20')]=function(_0x38db14,_0x26047f){return respondWithRpcPromise(_0xd7df('0x21'),_0x38db14[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x26047f,null))[_0xd7df('0x10')](handleError(_0x26047f,null));};exports[_0xd7df('0x22')]=function(_0x163904,_0x5c4d17){return respondWithRpcPromise(_0xd7df('0x21'),_0x163904[_0xd7df('0x1a')])[_0xd7df('0xb')](findById(_0x163904[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x5c4d17,null))[_0xd7df('0x10')](handleError(_0x5c4d17,null));};exports[_0xd7df('0x23')]=function(_0x36de76,_0x5195cf){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x36de76['body'],_0x36de76['params']))[_0xd7df('0xb')](respondWithResult(_0x5195cf,null))['catch'](handleError(_0x5195cf,null));};exports[_0xd7df('0x24')]=function(_0x156612,_0x503a90){return respondWithRpcPromise(_0xd7df('0x25'),_[_0xd7df('0x1c')](_0x156612['query'],_0x156612[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x503a90,null))[_0xd7df('0x10')](handleError(_0x503a90,null));};exports[_0xd7df('0x26')]=function(_0x40f965,_0x3304c4){return respondWithRpcPromise('VoiceQueuesChannels',_0x40f965[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x3304c4,null))[_0xd7df('0x10')](handleError(_0x3304c4,null));};exports[_0xd7df('0x27')]=function(_0x363f2d,_0x4cecf2){return respondWithRpcPromise(_0xd7df('0x28'),_[_0xd7df('0x1c')](_0x363f2d[_0xd7df('0x1a')],_0x363f2d[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x4cecf2,null))['catch'](handleError(_0x4cecf2,null));};exports['voiceQueuesChannelHangup']=function(_0x4051fb,_0x564562){return respondWithRpcPromise(_0xd7df('0x29'),_[_0xd7df('0x1c')](_0x4051fb[_0xd7df('0x1a')],_0x4051fb[_0xd7df('0x1f')]))['then'](respondWithResult(_0x564562,null))['catch'](handleError(_0x564562,null));};exports['voiceQueuesChannelRedirect']=function(_0x2a96e3,_0x15e682){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd7df('0x1c')](_0x2a96e3[_0xd7df('0x1a')],_0x2a96e3[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x15e682,null))['catch'](handleError(_0x15e682,null));};exports[_0xd7df('0x2a')]=function(_0x45642c,_0x5f0a6d){return respondWithRpcPromise(_0xd7df('0x2b'),_0x45642c['query'])[_0xd7df('0xb')](respondWithResult(_0x5f0a6d,null))[_0xd7df('0x10')](handleError(_0x5f0a6d,null));};exports[_0xd7df('0x2c')]=function(_0x59c755,_0x138391){return respondWithRpcPromise(_0xd7df('0x2d'),_0x59c755[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x138391,null))['catch'](handleError(_0x138391,null));};exports[_0xd7df('0x2e')]=function(_0x230857,_0x2314e6){var _0x4f6286;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')])[_0xd7df('0xb')](function(_0x517824){_0x4f6286=_0x517824;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')],routingClient);})['then'](function(_0x4b2561){return _[_0xd7df('0x1c')]({},_0x4b2561,_0x4f6286);})[_0xd7df('0xb')](respondWithResult(_0x2314e6,null))[_0xd7df('0x10')](handleError(_0x2314e6,null));};exports['agentCapacity']=function(_0x5e8cd0,_0x2c149e){if(_0x5e8cd0['body']&&_0x5e8cd0[_0xd7df('0x30')]['interaction']&&_0x5e8cd0['user']&&_0x5e8cd0[_0xd7df('0x31')]['name']){for(var _0x18ef10 in _0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')]){if(_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0xd7df('0x33')](_0x18ef10)){db[_0xd7df('0x34')][_0xd7df('0x35')]({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')]['name'],'type':_0xd7df('0x36'),'exitAt':null,'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10]&&_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0xd7df('0x37')]?{'$notIn':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10]}:{'$ne':null}}})[_0xd7df('0xb')](function(_0x38056b){var _0x3a3c1a=moment()['format'](_0xd7df('0x38'));for(var _0x563f90=0x0,_0x49085b=_0x38056b['length'];_0x563f90<_0x49085b;_0x563f90+=0x1){_0x38056b[_0x563f90][_0xd7df('0x39')]({'exitAt':_0x3a3c1a});}});for(var _0x162900=0x0;_0x162900<_0x5e8cd0[_0xd7df('0x30')]['interaction'][_0x18ef10]['length'];_0x162900+=0x1){db[_0xd7df('0x34')]['findOrCreate']({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'type':_0xd7df('0x36'),'uniqueid':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0x162900],'exitAt':null},'defaults':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'interface':_[_0xd7df('0x16')](_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')])?util[_0xd7df('0x3b')](_0xd7df('0x3c'),_0x5e8cd0['user'][_0xd7df('0x15')]):_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')],'type':_0xd7df('0x36'),'enterAt':moment()[_0xd7df('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd7df('0x3d'),'internal':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3e')],'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10][_0x162900]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5e8cd0[_0xd7df('0x1f')]['id'],'capacity':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x3f')]},routingClient)[_0xd7df('0xb')](respondWithResult(_0x2c149e,null))[_0xd7df('0x10')](handleError(_0x2c149e,null));};exports['telephones']=function(_0x4abe81,_0x53ec02){return respondWithRpcPromise(_0xd7df('0x40'),_0x4abe81['query'])[_0xd7df('0xb')](respondWithResult(_0x53ec02,null))[_0xd7df('0x10')](handleError(_0x53ec02,null));};exports[_0xd7df('0x41')]=function(_0xdf3046,_0x275af9){return respondWithRpcPromise(_0xd7df('0x42'),_0xdf3046[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x275af9,null))[_0xd7df('0x10')](handleError(_0x275af9,null));};exports[_0xd7df('0x43')]=function(_0x382d11,_0x327365){return respondWithRpcPromise(_0xd7df('0x44'),_0x382d11[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x327365,null))[_0xd7df('0x10')](handleError(_0x327365,null));};exports['chatQueues']=function(_0x332db5,_0x28c9b7){return respondWithRpcPromise('ChatQueues',_0x332db5['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x28c9b7,null))['catch'](handleError(_0x28c9b7,null));};exports[_0xd7df('0x45')]=function(_0x4fb55a,_0x1f34c2){return respondWithRpcPromise(_0xd7df('0x46'),_0x4fb55a[_0xd7df('0x1a')],routingClient)['then'](findById(_0x4fb55a['params']['id']))['then'](respondWithResult(_0x1f34c2,null))[_0xd7df('0x10')](handleError(_0x1f34c2,null));};exports[_0xd7df('0x47')]=function(_0x19c387,_0x527b6f){return respondWithRpcPromise(_0xd7df('0x48'),_0x19c387[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x527b6f,null))[_0xd7df('0x10')](handleError(_0x527b6f,null));};exports[_0xd7df('0x49')]=function(_0x35204f,_0x25d187){return respondWithRpcPromise(_0xd7df('0x48'),_0x35204f[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x35204f[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x25d187,null))[_0xd7df('0x10')](handleError(_0x25d187,null));};exports[_0xd7df('0x4a')]=function(_0x398e43,_0x3dba78){return respondWithRpcPromise(_0xd7df('0x4b'),_0x398e43[_0xd7df('0x1a')],mailClient)[_0xd7df('0xb')](respondWithResult(_0x3dba78,null))[_0xd7df('0x10')](handleError(_0x3dba78,null));};exports[_0xd7df('0x4c')]=function(_0x3f2775,_0x1e6277){return respondWithRpcPromise(_0xd7df('0x4d'),_0x3f2775[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x1e6277,null))[_0xd7df('0x10')](handleError(_0x1e6277,null));};exports[_0xd7df('0x4e')]=function(_0x3912d6,_0x51ae2b){return respondWithRpcPromise('OpenchannelQueues',_0x3912d6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3912d6[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x51ae2b,null))[_0xd7df('0x10')](handleError(_0x51ae2b,null));};exports[_0xd7df('0x4f')]=function(_0x1e87aa,_0x2786a6){return respondWithRpcPromise('SmsQueues',_0x1e87aa[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2786a6,null))[_0xd7df('0x10')](handleError(_0x2786a6,null));};exports[_0xd7df('0x50')]=function(_0x19a25b,_0x2fbc53){return respondWithRpcPromise(_0xd7df('0x51'),_0x19a25b[_0xd7df('0x1a')],routingClient)['then'](findById(_0x19a25b[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x2fbc53,null))['catch'](handleError(_0x2fbc53,null));};exports['whatsappQueues']=function(_0x481fa5,_0x264c5b){return respondWithRpcPromise(_0xd7df('0x52'),_0x481fa5[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x264c5b,null))['catch'](handleError(_0x264c5b,null));};exports[_0xd7df('0x53')]=function(_0x3d45cf,_0x19df03){return respondWithRpcPromise(_0xd7df('0x52'),_0x3d45cf[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3d45cf[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x19df03,null))['catch'](handleError(_0x19df03,null));};exports[_0xd7df('0x54')]=function(_0x5c1e68,_0x588537){return respondWithRpcPromise(_0xd7df('0x55'),_0x5c1e68[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x588537,null))['catch'](handleError(_0x588537,null));};exports[_0xd7df('0x56')]=function(_0x44d824,_0x49bf7e){return respondWithRpcPromise(_0xd7df('0x55'),_0x44d824[_0xd7df('0x1a')],routingClient)['then'](findById(_0x44d824[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x49bf7e,null))['catch'](handleError(_0x49bf7e,null));};exports[_0xd7df('0x57')]=function(_0x519f72,_0x56f55d){return respondWithRpcPromise(_0xd7df('0x58'),_0x519f72[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x56f55d,null))[_0xd7df('0x10')](handleError(_0x56f55d,null));};exports[_0xd7df('0x59')]=function(_0x40b2a1,_0x5831c1){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x40b2a1[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x5831c1,null))[_0xd7df('0x10')](handleError(_0x5831c1,null));};exports[_0xd7df('0x5a')]=function(_0x19b0e6,_0x31f681){return respondWithRpcPromise(_0xd7df('0x5b'),_0x19b0e6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x31f681,null))['catch'](handleError(_0x31f681,null));};exports[_0xd7df('0x5c')]=function(_0x1682ca,_0x4e9806){return respondWithRpcPromise(_0xd7df('0x5d'),_0x1682ca[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4e9806,null))[_0xd7df('0x10')](handleError(_0x4e9806,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4e5363,_0x5628ed){return respondWithRpcPromise(_0xd7df('0x5d'),_0x4e5363['query'],routingClient)[_0xd7df('0xb')](function(_0x2b1b30){if(_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')]!==undefined){var _0x2d8a31=_(_0x2b1b30[_0xd7df('0x17')])['filter']([_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')],_0x4e5363[_0xd7df('0x1f')]['id']])['map'](_0xd7df('0x5f'))[_0xd7df('0x60')]()['value']();return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x157290){return _0x2d8a31[_0xd7df('0x62')](_0x157290[_0xd7df('0x5f')])>-0x1;});}else{return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x5e93cc){return _0x5e93cc[_0xd7df('0x5f')]===parseInt(_0x4e5363[_0xd7df('0x1f')]['id']);});}})[_0xd7df('0xb')](respondWithResult(_0x5628ed,null))[_0xd7df('0x10')](handleError(_0x5628ed,null));};exports['smsQueuesWaitingInteractions']=function(_0x531a07,_0x2e1e96){return respondWithRpcPromise(_0xd7df('0x63'),_0x531a07[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2e1e96,null))[_0xd7df('0x10')](handleError(_0x2e1e96,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2329ce,_0x4f739b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2329ce[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4f739b,null))[_0xd7df('0x10')](handleError(_0x4f739b,null));};exports[_0xd7df('0x64')]=function(_0x30c401,_0x3ece24){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x30c401['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x3ece24,null))[_0xd7df('0x10')](handleError(_0x3ece24,null));};exports[_0xd7df('0x65')]=function(_0x175a36){return function(_0x5cb2b0,_0xac3b73){var _0x5df36d,_0x158bd9;var _0x5b73e5=_[_0xd7df('0x66')](_0x175a36);var _0x1ed032=_0x175a36===_0xd7df('0x67')?_0xd7df('0x68'):_0xd7df('0x69');return db[_0x5b73e5+_0xd7df('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x5cb2b0[_0xd7df('0x1f')]['id']}})['then'](function(_0x1e2355){if(_[_0xd7df('0x16')](_0x1e2355)){throw new Error(_0x5b73e5+_0xd7df('0x6b'));}_0x5df36d=_0x1e2355;return db[_0x5b73e5+_0xd7df('0x6c')]['findOne']({'where':{'id':_0x5cb2b0[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x5b73e5+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x5b73e5+_0x1ed032],'as':_0xd7df('0x69')}]});})[_0xd7df('0xb')](function(_0x40a665){if(_[_0xd7df('0x16')](_0x40a665)){throw new Error(_0x5b73e5+_0xd7df('0x6f'));}_0x158bd9=_0x40a665;return _0x40a665[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0x15bd27={'uniqueid':_0x175a36+'.'+_0x158bd9['id']+'.'+_0x158bd9['Interaction']['id'],'FromUserId':_0x5cb2b0[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71')};_0x15bd27[_0x5b73e5+_0xd7df('0x72')]=_0x158bd9['id'];_0x15bd27[_0x5b73e5+'InteractionId']=_0x158bd9['Interaction']['id'];_0x15bd27[_0xd7df('0x73')+_0x5b73e5+_0x1ed032+'Id']=_0x158bd9[_0xd7df('0x69')]['id'];_0x15bd27['To'+_0x5b73e5+_0xd7df('0x74')]=_0x5df36d['id'];return db[_0x5b73e5+_0xd7df('0x75')][_0xd7df('0x76')](_0x15bd27);})[_0xd7df('0xb')](function(){return respondWithRpcPromise(_0xd7df('0x77'),{'channel':_0x175a36,'interaction':_0x158bd9[_0xd7df('0x6e')],'message':_0x158bd9,'account':_0x158bd9[_0xd7df('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x71'),'appdata':_0x5df36d['name']+','+(_0x158bd9[_0xd7df('0x69')][_0xd7df('0x78')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0xac3b73,null))[_0xd7df('0x10')](handleError(_0xac3b73,null));};};exports[_0xd7df('0x7a')]=function(_0x50c5b9,_0x518092){var _0xa3ae43,_0x31b159;if(_[_0xd7df('0x16')](_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x1a888c=_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')];var _0x3d9fba=_[_0xd7df('0x66')](_0x1a888c);var _0x2861e3=_0x1a888c===_0xd7df('0x67')?'Website':_0xd7df('0x69');return db['User']['findOne']({'raw':!![],'where':{'id':_0x50c5b9[_0xd7df('0x1f')]['id'],'role':_0xd7df('0x3d')}})[_0xd7df('0xb')](function(_0x5092d2){if(_[_0xd7df('0x16')](_0x5092d2)){throw new Error('Agent\x20not\x20found');}_0xa3ae43=_0x5092d2;return db[_0x3d9fba+'Message'][_0xd7df('0x7c')]({'where':{'id':_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x3d9fba+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x3d9fba+_0x2861e3],'as':'Account'}]});})['then'](function(_0x3f2ecd){if(_[_0xd7df('0x16')](_0x3f2ecd)){throw new Error(_0x3d9fba+_0xd7df('0x6f'));}_0x31b159=_0x3f2ecd;return _0x3f2ecd[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0xc447e8={'uniqueid':_0x1a888c+'.'+_0x31b159['id']+'.'+_0x31b159[_0xd7df('0x6e')]['id'],'FromUserId':_0x50c5b9[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71'),'ToUserId':_0xa3ae43['id']};_0xc447e8[_0x3d9fba+_0xd7df('0x72')]=_0x31b159['id'];_0xc447e8[_0x3d9fba+_0xd7df('0x7d')]=_0x31b159[_0xd7df('0x6e')]['id'];_0xc447e8[_0xd7df('0x73')+_0x3d9fba+_0x2861e3+'Id']=_0x31b159['Account']['id'];return db[_0x3d9fba+_0xd7df('0x75')][_0xd7df('0x76')](_0xc447e8);})[_0xd7df('0xb')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a888c,'interaction':_0x31b159[_0xd7df('0x6e')],'message':_0x31b159,'account':_0x31b159['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x3d'),'appdata':_0xa3ae43[_0xd7df('0x15')]+','+(_0x31b159['Account'][_0xd7df('0x7e')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0x518092,null))[_0xd7df('0x10')](handleError(_0x518092,null));}; \ No newline at end of file +var _0xa41a=['name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','user','INTERACTION','interface','SIP/%s','agent','AgentCapacity','capacity','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','Account','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','sendStatus','stack'];(function(_0x4e607f,_0x473052){var _0x202d88=function(_0x3dd7c1){while(--_0x3dd7c1){_0x4e607f['push'](_0x4e607f['shift']());}};_0x202d88(++_0x473052);}(_0xa41a,0x6b));var _0xaa41=function(_0x4c7ffe,_0x29ba20){_0x4c7ffe=_0x4c7ffe-0x0;var _0x4a9017=_0xa41a[_0x4c7ffe];return _0x4a9017;};'use strict';var BPromise=require(_0xaa41('0x0'));var moment=require(_0xaa41('0x1'));var _=require('lodash');var util=require(_0xaa41('0x2'));var db=require(_0xaa41('0x3'))['db'];var logger=require(_0xaa41('0x4'))(_0xaa41('0x5'));var jayson=require(_0xaa41('0x6'));var amiClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232a});var mailClient=jayson[_0xaa41('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){var _0x31df43=_0x179545?_0x179545:amiClient;return _0x31df43[_0xaa41('0x9')](_0x54bc5a,_0x5b1fff)[_0xaa41('0xa')](function(_0x1cc344){if(_0x1cc344[_0xaa41('0xb')]){if(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xc')]===0x1f4){return _0x588ab4(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xd')]);}return _0x202cce(_0x1cc344['error'][_0xaa41('0xd')]);}else{_0x202cce(_0x1cc344[_0xaa41('0xe')]);}})['catch'](function(_0x54827c){_0x588ab4(_0x54827c);});});}function respondWithResult(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xc8;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0xf')](_0x518b5b)[_0xaa41('0x10')](_0x19bd69);}return _0x1d0a54[_0xaa41('0x11')](0x194);};}function handleError(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0x1f4;return function(_0x1e9d7f){logger[_0xaa41('0xb')](_0x1e9d7f[_0xaa41('0x12')]);if(_0x1e9d7f[_0xaa41('0x13')]){delete _0x1e9d7f[_0xaa41('0x13')];}_0x6f9ade[_0xaa41('0xf')](_0x4eaf81)[_0xaa41('0x14')](_0x1e9d7f);};}function findById(_0x550ad5){return function(_0x2d868a){if(!_[_0xaa41('0x15')](_0x550ad5)&&!_[_0xaa41('0x15')](_0x2d868a)&&!_[_0xaa41('0x15')](_0x2d868a[_0xaa41('0x16')])){return _[_0xaa41('0x17')](_0x2d868a[_0xaa41('0x16')],function(_0x46e6d3){return _0x46e6d3['id']==_0x550ad5;});}return null;};}exports[_0xaa41('0x18')]=function(_0x4fe1a4,_0x5cd936){return respondWithRpcPromise(_0xaa41('0x19'),_0x4fe1a4[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5cd936,null))['catch'](handleError(_0x5cd936,null));};exports[_0xaa41('0x1b')]=function(_0x1f692b,_0x4e768e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xaa41('0x1c')](_0x1f692b['query'],_0x1f692b[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4e768e,null))[_0xaa41('0x1e')](handleError(_0x4e768e,null));};exports[_0xaa41('0x1f')]=function(_0x1d623c,_0x4eb01f){return respondWithRpcPromise(_0xaa41('0x20'),_[_0xaa41('0x1c')](_0x1d623c[_0xaa41('0x1a')],_0x1d623c[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4eb01f,null))[_0xaa41('0x1e')](handleError(_0x4eb01f,null));};exports['voiceQueues']=function(_0x5795f4,_0x16aec5){return respondWithRpcPromise('VoiceQueues',_0x5795f4['query'])[_0xaa41('0xa')](respondWithResult(_0x16aec5,null))['catch'](handleError(_0x16aec5,null));};exports['showVoiceQueues']=function(_0x2d0ac0,_0x9c8c21){return respondWithRpcPromise(_0xaa41('0x21'),_0x2d0ac0[_0xaa41('0x1a')])[_0xaa41('0xa')](findById(_0x2d0ac0[_0xaa41('0x1d')]['id']))['then'](respondWithResult(_0x9c8c21,null))[_0xaa41('0x1e')](handleError(_0x9c8c21,null));};exports[_0xaa41('0x22')]=function(_0x63c18c,_0x9a16e3){return respondWithRpcPromise(_0xaa41('0x23'),_[_0xaa41('0x1c')](_0x63c18c[_0xaa41('0x24')],_0x63c18c[_0xaa41('0x1d')]))['then'](respondWithResult(_0x9a16e3,null))[_0xaa41('0x1e')](handleError(_0x9a16e3,null));};exports['voiceQueuesPreview']=function(_0x5dad80,_0x714537){return respondWithRpcPromise(_0xaa41('0x25'),_['merge'](_0x5dad80[_0xaa41('0x1a')],_0x5dad80[_0xaa41('0x1d')]))['then'](respondWithResult(_0x714537,null))['catch'](handleError(_0x714537,null));};exports['voiceQueuesChannels']=function(_0x1cf3da,_0x2f5cc0){return respondWithRpcPromise(_0xaa41('0x26'),_0x1cf3da[_0xaa41('0x1a')])['then'](respondWithResult(_0x2f5cc0,null))[_0xaa41('0x1e')](handleError(_0x2f5cc0,null));};exports[_0xaa41('0x27')]=function(_0x3e0204,_0x4de770){return respondWithRpcPromise(_0xaa41('0x28'),_[_0xaa41('0x1c')](_0x3e0204[_0xaa41('0x1a')],_0x3e0204['params']))[_0xaa41('0xa')](respondWithResult(_0x4de770,null))[_0xaa41('0x1e')](handleError(_0x4de770,null));};exports['voiceQueuesChannelHangup']=function(_0x23eb50,_0x13b6d4){return respondWithRpcPromise(_0xaa41('0x29'),_['merge'](_0x23eb50[_0xaa41('0x1a')],_0x23eb50['params']))[_0xaa41('0xa')](respondWithResult(_0x13b6d4,null))[_0xaa41('0x1e')](handleError(_0x13b6d4,null));};exports[_0xaa41('0x2a')]=function(_0x49b77a,_0x526377){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xaa41('0x1c')](_0x49b77a[_0xaa41('0x1a')],_0x49b77a[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x526377,null))['catch'](handleError(_0x526377,null));};exports['outbound']=function(_0x267999,_0x5673c){return respondWithRpcPromise(_0xaa41('0x2b'),_0x267999[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5673c,null))[_0xaa41('0x1e')](handleError(_0x5673c,null));};exports[_0xaa41('0x2c')]=function(_0x5e9879,_0x3adc28){return respondWithRpcPromise(_0xaa41('0x2d'),_0x5e9879[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x3adc28,null))['catch'](handleError(_0x3adc28,null));};exports['agents']=function(_0x42b759,_0x275fa3){var _0x5eae08;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759['query'])[_0xaa41('0xa')](function(_0x25f2df){_0x5eae08=_0x25f2df;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759[_0xaa41('0x1a')],routingClient);})[_0xaa41('0xa')](function(_0x12ba1a){return _[_0xaa41('0x1c')]({},_0x12ba1a,_0x5eae08);})[_0xaa41('0xa')](respondWithResult(_0x275fa3,null))['catch'](handleError(_0x275fa3,null));};exports[_0xaa41('0x2f')]=function(_0x2abf39,_0x35c685){if(_0x2abf39[_0xaa41('0x24')]&&_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]&&_0x2abf39['user']&&_0x2abf39['user'][_0xaa41('0x13')]){for(var _0x4f9086 in _0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]){if(_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0xaa41('0x31')](_0x4f9086)){db[_0xaa41('0x32')][_0xaa41('0x33')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x2abf39['body'][_0xaa41('0x30')][_0x4f9086]&&_0x2abf39['body']['interaction'][_0x4f9086]['length']?{'$notIn':_0x2abf39[_0xaa41('0x24')]['interaction'][_0x4f9086]}:{'$ne':null}}})[_0xaa41('0xa')](function(_0x198716){var _0x4a6882=moment()['format'](_0xaa41('0x34'));for(var _0x1b7b97=0x0,_0x1bb973=_0x198716[_0xaa41('0x35')];_0x1b7b97<_0x1bb973;_0x1b7b97+=0x1){_0x198716[_0x1b7b97][_0xaa41('0x36')]({'exitAt':_0x4a6882});}});for(var _0x337993=0x0;_0x337993<_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0xaa41('0x35')];_0x337993+=0x1){db['MemberReport'][_0xaa41('0x37')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39[_0xaa41('0x38')][_0xaa41('0x13')],'type':_0xaa41('0x39'),'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993],'exitAt':null},'defaults':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'interface':_[_0xaa41('0x15')](_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')])?util['format'](_0xaa41('0x3b'),_0x2abf39['user']['name']):_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')],'type':_0xaa41('0x39'),'enterAt':moment()['format'](_0xaa41('0x34')),'role':_0xaa41('0x3c'),'internal':_0x2abf39[_0xaa41('0x38')]['internal'],'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993]}});}}}}return respondWithRpcPromise(_0xaa41('0x3d'),{'id':_0x2abf39[_0xaa41('0x1d')]['id'],'capacity':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x3e')]},routingClient)[_0xaa41('0xa')](respondWithResult(_0x35c685,null))[_0xaa41('0x1e')](handleError(_0x35c685,null));};exports['telephones']=function(_0x9f0a81,_0x5bef5f){return respondWithRpcPromise('Telephones',_0x9f0a81[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5bef5f,null))[_0xaa41('0x1e')](handleError(_0x5bef5f,null));};exports[_0xaa41('0x3f')]=function(_0x14aab0,_0x288db3){return respondWithRpcPromise(_0xaa41('0x40'),_0x14aab0[_0xaa41('0x1a')])['then'](respondWithResult(_0x288db3,null))[_0xaa41('0x1e')](handleError(_0x288db3,null));};exports[_0xaa41('0x41')]=function(_0x1d518f,_0x4f9e92){return respondWithRpcPromise(_0xaa41('0x42'),_0x1d518f[_0xaa41('0x1a')])['then'](respondWithResult(_0x4f9e92,null))[_0xaa41('0x1e')](handleError(_0x4f9e92,null));};exports[_0xaa41('0x43')]=function(_0x283b3b,_0x4e5a2e){return respondWithRpcPromise(_0xaa41('0x44'),_0x283b3b[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x4e5a2e,null))['catch'](handleError(_0x4e5a2e,null));};exports[_0xaa41('0x45')]=function(_0x3cd14f,_0x3a29d2){return respondWithRpcPromise('ChatQueues',_0x3cd14f[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x3cd14f[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x3a29d2,null))[_0xaa41('0x1e')](handleError(_0x3a29d2,null));};exports['mailQueues']=function(_0x2ae70c,_0x57cb70){return respondWithRpcPromise('MailQueues',_0x2ae70c[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x57cb70,null))[_0xaa41('0x1e')](handleError(_0x57cb70,null));};exports[_0xaa41('0x46')]=function(_0x169ddf,_0x5e83e1){return respondWithRpcPromise(_0xaa41('0x47'),_0x169ddf[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x169ddf[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5e83e1,null))[_0xaa41('0x1e')](handleError(_0x5e83e1,null));};exports[_0xaa41('0x48')]=function(_0x337059,_0x3f91f3){return respondWithRpcPromise('MailAccounts',_0x337059[_0xaa41('0x1a')],mailClient)[_0xaa41('0xa')](respondWithResult(_0x3f91f3,null))[_0xaa41('0x1e')](handleError(_0x3f91f3,null));};exports['openchannelQueues']=function(_0x3fe47a,_0x2caf5c){return respondWithRpcPromise(_0xaa41('0x49'),_0x3fe47a[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2caf5c,null))[_0xaa41('0x1e')](handleError(_0x2caf5c,null));};exports[_0xaa41('0x4a')]=function(_0x5ea056,_0x55a85c){return respondWithRpcPromise('OpenchannelQueues',_0x5ea056['query'],routingClient)['then'](findById(_0x5ea056['params']['id']))[_0xaa41('0xa')](respondWithResult(_0x55a85c,null))['catch'](handleError(_0x55a85c,null));};exports['smsQueues']=function(_0x24c6f3,_0x40a524){return respondWithRpcPromise(_0xaa41('0x4b'),_0x24c6f3[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x40a524,null))[_0xaa41('0x1e')](handleError(_0x40a524,null));};exports[_0xaa41('0x4c')]=function(_0x1ddb6c,_0x46822f){return respondWithRpcPromise(_0xaa41('0x4b'),_0x1ddb6c[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x1ddb6c[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x46822f,null))['catch'](handleError(_0x46822f,null));};exports[_0xaa41('0x4d')]=function(_0x2d2af8,_0x50170f){return respondWithRpcPromise('WhatsappQueues',_0x2d2af8['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x50170f,null))['catch'](handleError(_0x50170f,null));};exports[_0xaa41('0x4e')]=function(_0x5c8028,_0x5423b6){return respondWithRpcPromise(_0xaa41('0x4f'),_0x5c8028['query'],routingClient)[_0xaa41('0xa')](findById(_0x5c8028[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5423b6,null))[_0xaa41('0x1e')](handleError(_0x5423b6,null));};exports['faxQueues']=function(_0x5be61b,_0x339db3){return respondWithRpcPromise(_0xaa41('0x50'),_0x5be61b['query'],routingClient)['then'](respondWithResult(_0x339db3,null))[_0xaa41('0x1e')](handleError(_0x339db3,null));};exports[_0xaa41('0x51')]=function(_0x304694,_0xbeafb5){return respondWithRpcPromise(_0xaa41('0x50'),_0x304694['query'],routingClient)[_0xaa41('0xa')](findById(_0x304694['params']['id']))['then'](respondWithResult(_0xbeafb5,null))['catch'](handleError(_0xbeafb5,null));};exports[_0xaa41('0x52')]=function(_0x19ec63,_0x436362){return respondWithRpcPromise('FaxAccounts',_0x19ec63[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x436362,null))[_0xaa41('0x1e')](handleError(_0x436362,null));};exports[_0xaa41('0x53')]=function(_0x457515,_0x3ffbf8){return respondWithRpcPromise(_0xaa41('0x54'),_0x457515['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x3ffbf8,null))[_0xaa41('0x1e')](handleError(_0x3ffbf8,null));};exports[_0xaa41('0x55')]=function(_0x175ca9,_0x51ff61){return respondWithRpcPromise(_0xaa41('0x56'),_0x175ca9['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x51ff61,null))[_0xaa41('0x1e')](handleError(_0x51ff61,null));};exports[_0xaa41('0x57')]=function(_0x143ef0,_0x491cad){return respondWithRpcPromise(_0xaa41('0x58'),_0x143ef0[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x491cad,null))[_0xaa41('0x1e')](handleError(_0x491cad,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x140d78,_0x50197b){return respondWithRpcPromise(_0xaa41('0x58'),_0x140d78[_0xaa41('0x1a')],routingClient)['then'](function(_0x1ac05e){if(_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')]!==undefined){var _0x582d79=_(_0x1ac05e[_0xaa41('0x16')])[_0xaa41('0x5a')]([_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')],_0x140d78[_0xaa41('0x1d')]['id']])[_0xaa41('0x5b')](_0xaa41('0x5c'))['uniq']()[_0xaa41('0x5d')]();return _0x1ac05e[_0xaa41('0x16')][_0xaa41('0x5a')](function(_0x530982){return _0x582d79['indexOf'](_0x530982[_0xaa41('0x5c')])>-0x1;});}else{return _0x1ac05e[_0xaa41('0x16')]['filter'](function(_0x1ce957){return _0x1ce957[_0xaa41('0x5c')]===parseInt(_0x140d78['params']['id']);});}})[_0xaa41('0xa')](respondWithResult(_0x50197b,null))[_0xaa41('0x1e')](handleError(_0x50197b,null));};exports[_0xaa41('0x5e')]=function(_0xe8731,_0x46feb2){return respondWithRpcPromise(_0xaa41('0x5f'),_0xe8731[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x46feb2,null))['catch'](handleError(_0x46feb2,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x397526,_0x481db9){return respondWithRpcPromise(_0xaa41('0x60'),_0x397526[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x481db9,null))['catch'](handleError(_0x481db9,null));};exports[_0xaa41('0x61')]=function(_0x404c38,_0x2d7493){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x404c38[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2d7493,null))['catch'](handleError(_0x2d7493,null));};exports[_0xaa41('0x62')]=function(_0x4de25c){return function(_0x53faf4,_0x3f6a2b){var _0x34d0e4,_0x5eded3;var _0x5a8cb0=_[_0xaa41('0x63')](_0x4de25c);var _0x1726ec=_0x4de25c===_0xaa41('0x64')?_0xaa41('0x65'):'Account';return db[_0x5a8cb0+_0xaa41('0x66')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0x53faf4[_0xaa41('0x1d')]['id']}})['then'](function(_0x1ad3aa){if(_[_0xaa41('0x15')](_0x1ad3aa)){throw new Error(_0x5a8cb0+_0xaa41('0x68'));}_0x34d0e4=_0x1ad3aa;return db[_0x5a8cb0+'Message'][_0xaa41('0x67')]({'where':{'id':_0x53faf4['body']['messageId']},'include':[{'model':db[_0x5a8cb0+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x5a8cb0+_0x1726ec],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x9e8ebb){if(_[_0xaa41('0x15')](_0x9e8ebb)){throw new Error(_0x5a8cb0+'\x20Message\x20not\x20found');}_0x5eded3=_0x9e8ebb;return _0x9e8ebb[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x1a2deb={'uniqueid':_0x4de25c+'.'+_0x5eded3['id']+'.'+_0x5eded3[_0xaa41('0x69')]['id'],'FromUserId':_0x53faf4[_0xaa41('0x38')]['id'],'type':'queue'};_0x1a2deb[_0x5a8cb0+_0xaa41('0x6b')]=_0x5eded3['id'];_0x1a2deb[_0x5a8cb0+'InteractionId']=_0x5eded3[_0xaa41('0x69')]['id'];_0x1a2deb[_0xaa41('0x6c')+_0x5a8cb0+_0x1726ec+'Id']=_0x5eded3[_0xaa41('0x6d')]['id'];_0x1a2deb['To'+_0x5a8cb0+_0xaa41('0x6e')]=_0x34d0e4['id'];return db[_0x5a8cb0+_0xaa41('0x6f')][_0xaa41('0x70')](_0x1a2deb);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x4de25c,'interaction':_0x5eded3[_0xaa41('0x69')],'message':_0x5eded3,'account':_0x5eded3[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaa41('0x72'),'appdata':_0x34d0e4['name']+','+(_0x5eded3[_0xaa41('0x6d')][_0xaa41('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x3f6a2b,null))['catch'](handleError(_0x3f6a2b,null));};};exports[_0xaa41('0x74')]=function(_0xb44b1f,_0x472eb3){var _0x38d759,_0x2dc55e;if(_[_0xaa41('0x15')](_0xb44b1f[_0xaa41('0x24')]['channel'])){throw new Error(_0xaa41('0x75'));}var _0x1d50db=_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x76')];var _0x585ce7=_[_0xaa41('0x63')](_0x1d50db);var _0x5c9beb=_0x1d50db===_0xaa41('0x64')?_0xaa41('0x65'):_0xaa41('0x6d');return db[_0xaa41('0x77')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0xb44b1f['params']['id'],'role':_0xaa41('0x3c')}})[_0xaa41('0xa')](function(_0x5819ac){if(_[_0xaa41('0x15')](_0x5819ac)){throw new Error(_0xaa41('0x78'));}_0x38d759=_0x5819ac;return db[_0x585ce7+_0xaa41('0x79')][_0xaa41('0x67')]({'where':{'id':_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x7a')]},'include':[{'model':db[_0x585ce7+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x585ce7+_0x5c9beb],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x39d3cc){if(_[_0xaa41('0x15')](_0x39d3cc)){throw new Error(_0x585ce7+_0xaa41('0x7b'));}_0x2dc55e=_0x39d3cc;return _0x39d3cc[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x5489be={'uniqueid':_0x1d50db+'.'+_0x2dc55e['id']+'.'+_0x2dc55e['Interaction']['id'],'FromUserId':_0xb44b1f['user']['id'],'type':_0xaa41('0x72'),'ToUserId':_0x38d759['id']};_0x5489be[_0x585ce7+_0xaa41('0x6b')]=_0x2dc55e['id'];_0x5489be[_0x585ce7+'InteractionId']=_0x2dc55e[_0xaa41('0x69')]['id'];_0x5489be[_0xaa41('0x6c')+_0x585ce7+_0x5c9beb+'Id']=_0x2dc55e['Account']['id'];return db[_0x585ce7+_0xaa41('0x6f')][_0xaa41('0x70')](_0x5489be);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x1d50db,'interaction':_0x2dc55e['Interaction'],'message':_0x2dc55e,'account':_0x2dc55e[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x38d759[_0xaa41('0x13')]+','+(_0x2dc55e[_0xaa41('0x6d')][_0xaa41('0x7c')]||0x12c),'interval':_0xaa41('0x7d')}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x472eb3,null))[_0xaa41('0x1e')](handleError(_0x472eb3,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index d098c08..f12448d 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 _0xe291=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','post','put','update','destroy','multer','util'];(function(_0xc6ad36,_0x1cc3c8){var _0x29634d=function(_0x486897){while(--_0x486897){_0xc6ad36['push'](_0xc6ad36['shift']());}};_0x29634d(++_0x1cc3c8);}(_0xe291,0x91));var _0x1e29=function(_0x2b4d4a,_0xc31aba){_0x2b4d4a=_0x2b4d4a-0x0;var _0x328a1f=_0xe291[_0x2b4d4a];return _0x328a1f;};'use strict';var multer=require(_0x1e29('0x0'));var util=require(_0x1e29('0x1'));var path=require(_0x1e29('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e29('0x3'));var router=express[_0x1e29('0x4')]();var fs_extra=require(_0x1e29('0x5'));var auth=require(_0x1e29('0x6'));var interaction=require(_0x1e29('0x7'));var config=require(_0x1e29('0x8'));var controller=require(_0x1e29('0x9'));router['get']('/',auth[_0x1e29('0xa')](),controller[_0x1e29('0xb')]);router[_0x1e29('0xc')](_0x1e29('0xd'),auth[_0x1e29('0xa')](),controller[_0x1e29('0xe')]);router[_0x1e29('0xc')](_0x1e29('0xf'),auth[_0x1e29('0xa')](),controller[_0x1e29('0x10')]);router[_0x1e29('0x11')]('/',auth[_0x1e29('0xa')](),controller['create']);router[_0x1e29('0x12')](_0x1e29('0xd'),auth[_0x1e29('0xa')](),controller[_0x1e29('0x13')]);router['delete'](_0x1e29('0xd'),auth[_0x1e29('0xa')](),controller[_0x1e29('0x14')]);module['exports']=router; \ No newline at end of file +var _0x460b=['index','/:id','show','get','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x25ec49,_0x22739c){var _0x9b9e03=function(_0x37cfff){while(--_0x37cfff){_0x25ec49['push'](_0x25ec49['shift']());}};_0x9b9e03(++_0x22739c);}(_0x460b,0x187));var _0xb460=function(_0x4be79b,_0x21e987){_0x4be79b=_0x4be79b-0x0;var _0x14d71e=_0x460b[_0x4be79b];return _0x14d71e;};'use strict';var multer=require(_0xb460('0x0'));var util=require(_0xb460('0x1'));var path=require(_0xb460('0x2'));var timeout=require(_0xb460('0x3'));var express=require(_0xb460('0x4'));var router=express['Router']();var fs_extra=require(_0xb460('0x5'));var auth=require(_0xb460('0x6'));var interaction=require(_0xb460('0x7'));var config=require('../../config/environment');var controller=require('./schedule.controller');router['get']('/',auth[_0xb460('0x8')](),controller[_0xb460('0x9')]);router['get'](_0xb460('0xa'),auth[_0xb460('0x8')](),controller[_0xb460('0xb')]);router[_0xb460('0xc')]('/:id/run',auth[_0xb460('0x8')](),controller['run']);router[_0xb460('0xd')]('/',auth[_0xb460('0x8')](),controller[_0xb460('0xe')]);router[_0xb460('0xf')](_0xb460('0xa'),auth['isAuthenticated'](),controller[_0xb460('0x10')]);router[_0xb460('0x11')](_0xb460('0xa'),auth[_0xb460('0x8')](),controller[_0xb460('0x12')]);module[_0xb460('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 1b3c731..55e1e57 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 _0x63b6=['TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','weeks','days','hours','ENUM','csv','pdf','custom','default'];(function(_0x5eb981,_0x1b833c){var _0x159b1f=function(_0x3d6e49){while(--_0x3d6e49){_0x5eb981['push'](_0x5eb981['shift']());}};_0x159b1f(++_0x1b833c);}(_0x63b6,0xe5));var _0x663b=function(_0x9b389c,_0x304f5e){_0x9b389c=_0x9b389c-0x0;var _0xa04b83=_0x63b6[_0x9b389c];return _0xa04b83;};'use strict';var Sequelize=require(_0x663b('0x0'));module[_0x663b('0x1')]={'name':{'type':Sequelize[_0x663b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x663b('0x2')]},'active':{'type':Sequelize[_0x663b('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x663b('0x4')},'startAt':{'type':Sequelize[_0x663b('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x663b('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x663b('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x663b('0x7'),_0x663b('0x8'),_0x663b('0x9'),_0x663b('0xa'),_0x663b('0xb'),_0x663b('0xc'),'minutes'),'allowNull':![],'defaultValue':_0x663b('0xb')},'output':{'type':Sequelize[_0x663b('0xd')](_0x663b('0xe'),_0x663b('0xf'),'xlsx'),'allowNull':![],'defaultValue':_0x663b('0xe')},'type':{'type':Sequelize[_0x663b('0xd')](_0x663b('0x10'),_0x663b('0x11')),'allowNull':![],'defaultValue':_0x663b('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x663b('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x663b('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x84c7=['csv','pdf','custom','default','TEXT','sequelize','exports','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x84c7,0x69));var _0x784c=function(_0x33997d,_0x3dc314){_0x33997d=_0x33997d-0x0;var _0x4de84d=_0x84c7[_0x33997d];return _0x4de84d;};'use strict';var Sequelize=require(_0x784c('0x0'));module[_0x784c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x784c('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x784c('0x3')],'allowNull':![],'defaultValue':_0x784c('0x4')},'startAt':{'type':Sequelize[_0x784c('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x784c('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x784c('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x784c('0x7')](_0x784c('0x8'),_0x784c('0x9'),_0x784c('0xa'),_0x784c('0xb'),_0x784c('0xc'),_0x784c('0xd'),_0x784c('0xe')),'allowNull':![],'defaultValue':_0x784c('0xc')},'output':{'type':Sequelize[_0x784c('0x7')](_0x784c('0xf'),_0x784c('0x10'),'xlsx'),'allowNull':![],'defaultValue':_0x784c('0xf')},'type':{'type':Sequelize[_0x784c('0x7')](_0x784c('0x11'),_0x784c('0x12')),'allowNull':![],'defaultValue':_0x784c('0x11')},'sendMail':{'type':Sequelize[_0x784c('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x784c('0x13')]},'bcc':{'type':Sequelize[_0x784c('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x784c('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index d004095..266b133 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 _0xc0ea=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','end','error','name','send','index','map','Schedule','rawAttributes','key','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','params','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x223a00,_0x1f1e9f){var _0x152f91=function(_0x511bf6){while(--_0x511bf6){_0x223a00['push'](_0x223a00['shift']());}};_0x152f91(++_0x1f1e9f);}(_0xc0ea,0x8f));var _0xac0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0ea[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xac0e('0x0'));var rimraf=require(_0xac0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac0e('0x2'));var moment=require(_0xac0e('0x3'));var BPromise=require(_0xac0e('0x4'));var Mustache=require('mustache');var util=require(_0xac0e('0x5'));var path=require('path');var sox=require(_0xac0e('0x6'));var csv=require(_0xac0e('0x7'));var ejs=require(_0xac0e('0x8'));var fs=require('fs');var fs_extra=require(_0xac0e('0x9'));var _=require(_0xac0e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac0e('0xb'));var deskjs=require(_0xac0e('0xc'));var toCsv=require(_0xac0e('0x7'));var querystring=require(_0xac0e('0xd'));var Papa=require('papaparse');var Redis=require(_0xac0e('0xe'));var authService=require(_0xac0e('0xf'));var qs=require(_0xac0e('0x10'));var as=require(_0xac0e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xac0e('0x12'));var utils=require(_0xac0e('0x13'));var config=require(_0xac0e('0x14'));var licenseUtil=require(_0xac0e('0x15'));var db=require(_0xac0e('0x16'))['db'];function respondWithStatusCode(_0x2f6c30,_0x20ee3d){_0x20ee3d=_0x20ee3d||0xcc;return function(_0x11eff3){if(_0x11eff3){return _0x2f6c30[_0xac0e('0x17')](_0x20ee3d);}return _0x2f6c30[_0xac0e('0x18')](_0x20ee3d)['end']();};}function respondWithResult(_0x31031f,_0x4ef0d1){_0x4ef0d1=_0x4ef0d1||0xc8;return function(_0x2a87c8){if(_0x2a87c8){return _0x31031f[_0xac0e('0x18')](_0x4ef0d1)[_0xac0e('0x19')](_0x2a87c8);}};}function respondWithFilteredResult(_0x5e56ce,_0x1f31cf){return function(_0x408058){if(_0x408058){var _0x49c03d=typeof _0x1f31cf[_0xac0e('0x1a')]===_0xac0e('0x1b')&&typeof _0x1f31cf[_0xac0e('0x1c')]===_0xac0e('0x1b');var _0x202421=_0x408058[_0xac0e('0x1d')];var _0x281f9a=_0x49c03d?0x0:_0x1f31cf[_0xac0e('0x1a')];var _0x3adfb9=_0x49c03d?_0x408058[_0xac0e('0x1d')]:_0x1f31cf[_0xac0e('0x1a')]+_0x1f31cf['limit'];var _0x18afdd;if(_0x3adfb9>=_0x202421){_0x3adfb9=_0x202421;_0x18afdd=0xc8;}else{_0x18afdd=0xce;}_0x5e56ce[_0xac0e('0x18')](_0x18afdd);return _0x5e56ce['set'](_0xac0e('0x1e'),_0x281f9a+'-'+_0x3adfb9+'/'+_0x202421)['json'](_0x408058);}return null;};}function patchUpdates(_0x16b13d){return function(_0x269ea1){try{jsonpatch[_0xac0e('0x1f')](_0x269ea1,_0x16b13d,!![]);}catch(_0x42be9f){return BPromise[_0xac0e('0x20')](_0x42be9f);}return _0x269ea1[_0xac0e('0x21')]();};}function saveUpdates(_0x10fa2d,_0x2fe7de){return function(_0x13238a){if(_0x13238a){return _0x13238a[_0xac0e('0x22')](_0x10fa2d)['then'](function(_0x548e33){return _0x548e33;});}return null;};}function removeEntity(_0xa943b9,_0x2ee68b){return function(_0x501d94){if(_0x501d94){return _0x501d94[_0xac0e('0x23')]()[_0xac0e('0x24')](function(){var _0x2b6bd8=_0x501d94['get']({'plain':!![]});var _0x4ee8db='Scheduler';return db[_0xac0e('0x25')][_0xac0e('0x23')]({'where':{'type':_0x4ee8db,'resourceId':_0x2b6bd8['id']}})['then'](function(){return _0x501d94;});})[_0xac0e('0x24')](function(){_0xa943b9['status'](0xcc)[_0xac0e('0x26')]();});}};}function handleEntityNotFound(_0x55635e,_0x56a7bd){return function(_0x33a866){if(!_0x33a866){_0x55635e['sendStatus'](0x194);}return _0x33a866;};}function handleError(_0x8c84dd,_0x1c5b34){_0x1c5b34=_0x1c5b34||0x1f4;return function(_0x37b93c){logger[_0xac0e('0x27')](_0x37b93c['stack']);if(_0x37b93c[_0xac0e('0x28')]){delete _0x37b93c[_0xac0e('0x28')];}_0x8c84dd['status'](_0x1c5b34)[_0xac0e('0x29')](_0x37b93c);};}exports[_0xac0e('0x2a')]=function(_0x6d4f46,_0x3edc86){var _0x1c298a={},_0x187d36={},_0x5bb749={'count':0x0,'rows':[]};var _0x1baa7b=_[_0xac0e('0x2b')](db[_0xac0e('0x2c')][_0xac0e('0x2d')],function(_0x655e4b){return{'name':_0x655e4b['fieldName'],'type':_0x655e4b['type'][_0xac0e('0x2e')]};});_0x187d36[_0xac0e('0x2f')]=_['map'](_0x1baa7b,_0xac0e('0x28'));_0x187d36['query']=_[_0xac0e('0x30')](_0x6d4f46[_0xac0e('0x31')]);_0x187d36[_0xac0e('0x32')]=_['intersection'](_0x187d36[_0xac0e('0x2f')],_0x187d36[_0xac0e('0x31')]);_0x1c298a[_0xac0e('0x33')]=_[_0xac0e('0x34')](_0x187d36[_0xac0e('0x2f')],qs['fields'](_0x6d4f46[_0xac0e('0x31')]['fields']));_0x1c298a[_0xac0e('0x33')]=_0x1c298a[_0xac0e('0x33')][_0xac0e('0x35')]?_0x1c298a[_0xac0e('0x33')]:_0x187d36['model'];if(!_0x6d4f46[_0xac0e('0x31')][_0xac0e('0x36')](_0xac0e('0x37'))){_0x1c298a[_0xac0e('0x1c')]=qs[_0xac0e('0x1c')](_0x6d4f46['query']['limit']);_0x1c298a[_0xac0e('0x1a')]=qs[_0xac0e('0x1a')](_0x6d4f46[_0xac0e('0x31')][_0xac0e('0x1a')]);}_0x1c298a[_0xac0e('0x38')]=qs['sort'](_0x6d4f46[_0xac0e('0x31')]['sort']);_0x1c298a['where']=qs[_0xac0e('0x32')](_[_0xac0e('0x39')](_0x6d4f46[_0xac0e('0x31')],_0x187d36[_0xac0e('0x32')]),_0x1baa7b);if(_0x6d4f46['query']['filter']){_0x1c298a[_0xac0e('0x3a')]=_[_0xac0e('0x3b')](_0x1c298a[_0xac0e('0x3a')],{'$or':_['map'](_0x1baa7b,function(_0x331ee8){if(_0x331ee8[_0xac0e('0x3c')]!==_0xac0e('0x3d')){var _0x4333ee={};_0x4333ee[_0x331ee8[_0xac0e('0x28')]]={'$like':'%'+_0x6d4f46[_0xac0e('0x31')][_0xac0e('0x3e')]+'%'};return _0x4333ee;}})});}_0x1c298a=_[_0xac0e('0x3b')]({},_0x1c298a,_0x6d4f46[_0xac0e('0x3f')]);var _0x4a2d8c={'where':_0x1c298a[_0xac0e('0x3a')]};return db[_0xac0e('0x2c')][_0xac0e('0x1d')](_0x4a2d8c)['then'](function(_0x3c6a65){_0x5bb749['count']=_0x3c6a65;if(_0x6d4f46[_0xac0e('0x31')][_0xac0e('0x40')]){_0x1c298a[_0xac0e('0x41')]=[{'all':!![]}];}return db[_0xac0e('0x2c')]['findAll'](_0x1c298a);})[_0xac0e('0x24')](function(_0x585fa0){_0x5bb749['rows']=_0x585fa0;return _0x5bb749;})[_0xac0e('0x24')](respondWithFilteredResult(_0x3edc86,_0x1c298a))[_0xac0e('0x42')](handleError(_0x3edc86,null));};exports[_0xac0e('0x43')]=function(_0x1998ed,_0x43a766){var _0x5559ac={'raw':![],'where':{'id':_0x1998ed[_0xac0e('0x44')]['id']}},_0x37dd60={};_0x37dd60[_0xac0e('0x2f')]=_[_0xac0e('0x30')](db[_0xac0e('0x2c')][_0xac0e('0x2d')]);_0x37dd60[_0xac0e('0x31')]=_[_0xac0e('0x30')](_0x1998ed[_0xac0e('0x31')]);_0x37dd60['filters']=_[_0xac0e('0x34')](_0x37dd60[_0xac0e('0x2f')],_0x37dd60[_0xac0e('0x31')]);_0x5559ac[_0xac0e('0x33')]=_[_0xac0e('0x34')](_0x37dd60['model'],qs[_0xac0e('0x45')](_0x1998ed['query'][_0xac0e('0x45')]));_0x5559ac['attributes']=_0x5559ac[_0xac0e('0x33')]['length']?_0x5559ac[_0xac0e('0x33')]:_0x37dd60[_0xac0e('0x2f')];if(_0x1998ed['query']['includeAll']){_0x5559ac[_0xac0e('0x41')]=[{'all':!![]}];}_0x5559ac=_[_0xac0e('0x3b')]({},_0x5559ac,_0x1998ed['options']);return db[_0xac0e('0x2c')][_0xac0e('0x46')](_0x5559ac)[_0xac0e('0x24')](handleEntityNotFound(_0x43a766,null))['then'](respondWithResult(_0x43a766,null))['catch'](handleError(_0x43a766,null));};exports[_0xac0e('0x47')]=function(_0x2001d0,_0x46a7e4){return db[_0xac0e('0x2c')]['create'](_0x2001d0[_0xac0e('0x48')],{})[_0xac0e('0x24')](function(_0x13383d){var _0x1c1854=_0x2001d0[_0xac0e('0x49')][_0xac0e('0x4a')]({'plain':!![]});if(!_0x1c1854)throw new Error(_0xac0e('0x4b'));if(_0x1c1854['role']===_0xac0e('0x49')){var _0x485d4e=_0x13383d['get']({'plain':!![]});var _0x248ee2='Scheduler';return db[_0xac0e('0x4c')][_0xac0e('0x46')]({'where':{'name':_0x248ee2,'userProfileId':_0x1c1854[_0xac0e('0x4d')]},'raw':!![]})[_0xac0e('0x24')](function(_0x538fd8){if(_0x538fd8&&_0x538fd8['autoAssociation']===0x0){return db[_0xac0e('0x25')][_0xac0e('0x47')]({'name':_0x485d4e[_0xac0e('0x28')],'resourceId':_0x485d4e['id'],'type':_0x538fd8[_0xac0e('0x28')],'sectionId':_0x538fd8['id']},{})[_0xac0e('0x24')](function(){return _0x13383d;});}else{return _0x13383d;}})['catch'](function(_0x3f873f){logger[_0xac0e('0x27')](_0xac0e('0x4e'),_0x3f873f);throw _0x3f873f;});}return _0x13383d;})[_0xac0e('0x24')](respondWithResult(_0x46a7e4,0xc9))['catch'](handleError(_0x46a7e4,null));};exports[_0xac0e('0x22')]=function(_0x3f6cb8,_0x559e64){if(_0x3f6cb8['body']['id']){delete _0x3f6cb8[_0xac0e('0x48')]['id'];}return db[_0xac0e('0x2c')][_0xac0e('0x46')]({'where':{'id':_0x3f6cb8['params']['id']}})[_0xac0e('0x24')](handleEntityNotFound(_0x559e64,null))[_0xac0e('0x24')](saveUpdates(_0x3f6cb8[_0xac0e('0x48')],null))[_0xac0e('0x24')](respondWithResult(_0x559e64,null))[_0xac0e('0x42')](handleError(_0x559e64,null));};exports[_0xac0e('0x23')]=function(_0x27f2cd,_0x17f7f1){return db[_0xac0e('0x2c')][_0xac0e('0x46')]({'where':{'id':_0x27f2cd[_0xac0e('0x44')]['id']}})[_0xac0e('0x24')](handleEntityNotFound(_0x17f7f1,null))[_0xac0e('0x24')](removeEntity(_0x17f7f1,null))['catch'](handleError(_0x17f7f1,null));};exports['run']=function(_0x3f1636,_0x1249b5,_0x1f3553){var _0x1da539=require(_0xac0e('0x4f'));return db[_0xac0e('0x2c')][_0xac0e('0x46')]({'where':{'id':_0x3f1636[_0xac0e('0x44')]['id']},'raw':!![]})[_0xac0e('0x24')](handleEntityNotFound(_0x1249b5,null))[_0xac0e('0x24')](function(){_0x1da539['run'](_0x3f1636[_0xac0e('0x44')]['id']);})[_0xac0e('0x24')](respondWithStatusCode(_0x1249b5,null))[_0xac0e('0x42')](handleError(_0x1249b5,null));}; \ No newline at end of file +var _0x24a3=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','update','then','destroy','get','Scheduler','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','Schedule','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x3feceb,_0x2c9359){var _0x24dc29=function(_0x4e47e8){while(--_0x4e47e8){_0x3feceb['push'](_0x3feceb['shift']());}};_0x24dc29(++_0x2c9359);}(_0x24a3,0x14c));var _0x324a=function(_0x28625c,_0x3e1338){_0x28625c=_0x28625c-0x0;var _0x169996=_0x24a3[_0x28625c];return _0x169996;};'use strict';var emlformat=require(_0x324a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x324a('0x1'));var jsonpatch=require(_0x324a('0x2'));var rp=require(_0x324a('0x3'));var moment=require(_0x324a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x324a('0x5'));var util=require(_0x324a('0x6'));var path=require('path');var sox=require(_0x324a('0x7'));var csv=require(_0x324a('0x8'));var ejs=require(_0x324a('0x9'));var fs=require('fs');var fs_extra=require(_0x324a('0xa'));var _=require(_0x324a('0xb'));var squel=require(_0x324a('0xc'));var crypto=require('crypto');var jsforce=require(_0x324a('0xd'));var deskjs=require(_0x324a('0xe'));var toCsv=require(_0x324a('0x8'));var querystring=require(_0x324a('0xf'));var Papa=require(_0x324a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x324a('0x11'));var as=require(_0x324a('0x12'));var hardwareService=require(_0x324a('0x13'));var logger=require(_0x324a('0x14'))(_0x324a('0x15'));var utils=require(_0x324a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x324a('0x17'));var db=require(_0x324a('0x18'))['db'];function respondWithStatusCode(_0x4df02e,_0x28c576){_0x28c576=_0x28c576||0xcc;return function(_0x25654a){if(_0x25654a){return _0x4df02e[_0x324a('0x19')](_0x28c576);}return _0x4df02e['status'](_0x28c576)['end']();};}function respondWithResult(_0x487e01,_0x3ed346){_0x3ed346=_0x3ed346||0xc8;return function(_0x44f8e7){if(_0x44f8e7){return _0x487e01[_0x324a('0x1a')](_0x3ed346)[_0x324a('0x1b')](_0x44f8e7);}};}function respondWithFilteredResult(_0x7e6bf4,_0x2773e5){return function(_0x4a5dad){if(_0x4a5dad){var _0x3de66f=typeof _0x2773e5[_0x324a('0x1c')]==='undefined'&&typeof _0x2773e5[_0x324a('0x1d')]==='undefined';var _0x246b0b=_0x4a5dad[_0x324a('0x1e')];var _0x4ecc19=_0x3de66f?0x0:_0x2773e5[_0x324a('0x1c')];var _0x59da02=_0x3de66f?_0x4a5dad[_0x324a('0x1e')]:_0x2773e5[_0x324a('0x1c')]+_0x2773e5[_0x324a('0x1d')];var _0x38592f;if(_0x59da02>=_0x246b0b){_0x59da02=_0x246b0b;_0x38592f=0xc8;}else{_0x38592f=0xce;}_0x7e6bf4[_0x324a('0x1a')](_0x38592f);return _0x7e6bf4[_0x324a('0x1f')]('Content-Range',_0x4ecc19+'-'+_0x59da02+'/'+_0x246b0b)['json'](_0x4a5dad);}return null;};}function patchUpdates(_0x284a43){return function(_0x1c1120){try{jsonpatch[_0x324a('0x20')](_0x1c1120,_0x284a43,!![]);}catch(_0x5eae17){return BPromise['reject'](_0x5eae17);}return _0x1c1120['save']();};}function saveUpdates(_0x347248,_0x22e76){return function(_0x7d3213){if(_0x7d3213){return _0x7d3213[_0x324a('0x21')](_0x347248)[_0x324a('0x22')](function(_0x45d00b){return _0x45d00b;});}return null;};}function removeEntity(_0x48becb,_0x35117d){return function(_0x3a6345){if(_0x3a6345){return _0x3a6345[_0x324a('0x23')]()[_0x324a('0x22')](function(){var _0x446396=_0x3a6345[_0x324a('0x24')]({'plain':!![]});var _0x1a0142=_0x324a('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a0142,'resourceId':_0x446396['id']}})['then'](function(){return _0x3a6345;});})[_0x324a('0x22')](function(){_0x48becb[_0x324a('0x1a')](0xcc)[_0x324a('0x26')]();});}};}function handleEntityNotFound(_0x4d8e44,_0x2084df){return function(_0x302dc4){if(!_0x302dc4){_0x4d8e44[_0x324a('0x19')](0x194);}return _0x302dc4;};}function handleError(_0x4c9abc,_0xec6f34){_0xec6f34=_0xec6f34||0x1f4;return function(_0xfe1cb6){logger[_0x324a('0x27')](_0xfe1cb6[_0x324a('0x28')]);if(_0xfe1cb6[_0x324a('0x29')]){delete _0xfe1cb6['name'];}_0x4c9abc[_0x324a('0x1a')](_0xec6f34)['send'](_0xfe1cb6);};}exports[_0x324a('0x2a')]=function(_0x299bb7,_0xf4f18b){var _0x9f5180={},_0x14b4d4={},_0x1983ef={'count':0x0,'rows':[]};var _0x29911c=_[_0x324a('0x2b')](db['Schedule'][_0x324a('0x2c')],function(_0x41f51d){return{'name':_0x41f51d[_0x324a('0x2d')],'type':_0x41f51d[_0x324a('0x2e')][_0x324a('0x2f')]};});_0x14b4d4[_0x324a('0x30')]=_[_0x324a('0x2b')](_0x29911c,'name');_0x14b4d4['query']=_[_0x324a('0x31')](_0x299bb7[_0x324a('0x32')]);_0x14b4d4['filters']=_[_0x324a('0x33')](_0x14b4d4[_0x324a('0x30')],_0x14b4d4[_0x324a('0x32')]);_0x9f5180['attributes']=_[_0x324a('0x33')](_0x14b4d4[_0x324a('0x30')],qs[_0x324a('0x34')](_0x299bb7[_0x324a('0x32')][_0x324a('0x34')]));_0x9f5180[_0x324a('0x35')]=_0x9f5180[_0x324a('0x35')][_0x324a('0x36')]?_0x9f5180['attributes']:_0x14b4d4[_0x324a('0x30')];if(!_0x299bb7[_0x324a('0x32')][_0x324a('0x37')](_0x324a('0x38'))){_0x9f5180[_0x324a('0x1d')]=qs[_0x324a('0x1d')](_0x299bb7[_0x324a('0x32')][_0x324a('0x1d')]);_0x9f5180[_0x324a('0x1c')]=qs[_0x324a('0x1c')](_0x299bb7[_0x324a('0x32')]['offset']);}_0x9f5180['order']=qs[_0x324a('0x39')](_0x299bb7['query'][_0x324a('0x39')]);_0x9f5180[_0x324a('0x3a')]=qs[_0x324a('0x3b')](_[_0x324a('0x3c')](_0x299bb7[_0x324a('0x32')],_0x14b4d4[_0x324a('0x3b')]),_0x29911c);if(_0x299bb7[_0x324a('0x32')][_0x324a('0x3d')]){_0x9f5180['where']=_[_0x324a('0x3e')](_0x9f5180['where'],{'$or':_[_0x324a('0x2b')](_0x29911c,function(_0x402c7a){if(_0x402c7a[_0x324a('0x2e')]!=='VIRTUAL'){var _0x981f34={};_0x981f34[_0x402c7a[_0x324a('0x29')]]={'$like':'%'+_0x299bb7['query'][_0x324a('0x3d')]+'%'};return _0x981f34;}})});}_0x9f5180=_[_0x324a('0x3e')]({},_0x9f5180,_0x299bb7['options']);var _0x22ec8b={'where':_0x9f5180[_0x324a('0x3a')]};return db['Schedule'][_0x324a('0x1e')](_0x22ec8b)[_0x324a('0x22')](function(_0x8a0d7a){_0x1983ef['count']=_0x8a0d7a;if(_0x299bb7[_0x324a('0x32')][_0x324a('0x3f')]){_0x9f5180[_0x324a('0x40')]=[{'all':!![]}];}return db[_0x324a('0x41')][_0x324a('0x42')](_0x9f5180);})[_0x324a('0x22')](function(_0x4147a3){_0x1983ef['rows']=_0x4147a3;return _0x1983ef;})['then'](respondWithFilteredResult(_0xf4f18b,_0x9f5180))[_0x324a('0x43')](handleError(_0xf4f18b,null));};exports[_0x324a('0x44')]=function(_0x5adb23,_0x5eac48){var _0x5d7274={'raw':![],'where':{'id':_0x5adb23[_0x324a('0x45')]['id']}},_0x44d65b={};_0x44d65b[_0x324a('0x30')]=_[_0x324a('0x31')](db[_0x324a('0x41')]['rawAttributes']);_0x44d65b['query']=_[_0x324a('0x31')](_0x5adb23[_0x324a('0x32')]);_0x44d65b[_0x324a('0x3b')]=_[_0x324a('0x33')](_0x44d65b['model'],_0x44d65b[_0x324a('0x32')]);_0x5d7274[_0x324a('0x35')]=_[_0x324a('0x33')](_0x44d65b['model'],qs[_0x324a('0x34')](_0x5adb23[_0x324a('0x32')][_0x324a('0x34')]));_0x5d7274[_0x324a('0x35')]=_0x5d7274[_0x324a('0x35')]['length']?_0x5d7274['attributes']:_0x44d65b['model'];if(_0x5adb23[_0x324a('0x32')]['includeAll']){_0x5d7274[_0x324a('0x40')]=[{'all':!![]}];}_0x5d7274=_['merge']({},_0x5d7274,_0x5adb23['options']);return db[_0x324a('0x41')][_0x324a('0x46')](_0x5d7274)[_0x324a('0x22')](handleEntityNotFound(_0x5eac48,null))[_0x324a('0x22')](respondWithResult(_0x5eac48,null))[_0x324a('0x43')](handleError(_0x5eac48,null));};exports[_0x324a('0x47')]=function(_0x6ce950,_0x365218){return db[_0x324a('0x41')][_0x324a('0x47')](_0x6ce950[_0x324a('0x48')],{})[_0x324a('0x22')](function(_0x1848ea){var _0x3528b9=_0x6ce950[_0x324a('0x49')]['get']({'plain':!![]});if(!_0x3528b9)throw new Error(_0x324a('0x4a'));if(_0x3528b9[_0x324a('0x4b')]==='user'){var _0x925ffc=_0x1848ea[_0x324a('0x24')]({'plain':!![]});var _0x213f99='Scheduler';return db[_0x324a('0x4c')][_0x324a('0x46')]({'where':{'name':_0x213f99,'userProfileId':_0x3528b9[_0x324a('0x4d')]},'raw':!![]})['then'](function(_0x4e2167){if(_0x4e2167&&_0x4e2167[_0x324a('0x4e')]===0x0){return db['UserProfileResource'][_0x324a('0x47')]({'name':_0x925ffc['name'],'resourceId':_0x925ffc['id'],'type':_0x4e2167[_0x324a('0x29')],'sectionId':_0x4e2167['id']},{})['then'](function(){return _0x1848ea;});}else{return _0x1848ea;}})['catch'](function(_0x3f9b75){logger['error'](_0x324a('0x4f'),_0x3f9b75);throw _0x3f9b75;});}return _0x1848ea;})[_0x324a('0x22')](respondWithResult(_0x365218,0xc9))[_0x324a('0x43')](handleError(_0x365218,null));};exports[_0x324a('0x21')]=function(_0x29a575,_0x60aaa5){if(_0x29a575[_0x324a('0x48')]['id']){delete _0x29a575[_0x324a('0x48')]['id'];}return db[_0x324a('0x41')][_0x324a('0x46')]({'where':{'id':_0x29a575[_0x324a('0x45')]['id']}})[_0x324a('0x22')](handleEntityNotFound(_0x60aaa5,null))[_0x324a('0x22')](saveUpdates(_0x29a575[_0x324a('0x48')],null))[_0x324a('0x22')](respondWithResult(_0x60aaa5,null))[_0x324a('0x43')](handleError(_0x60aaa5,null));};exports[_0x324a('0x23')]=function(_0x3de18f,_0x5f2770){return db['Schedule'][_0x324a('0x46')]({'where':{'id':_0x3de18f['params']['id']}})[_0x324a('0x22')](handleEntityNotFound(_0x5f2770,null))[_0x324a('0x22')](removeEntity(_0x5f2770,null))[_0x324a('0x43')](handleError(_0x5f2770,null));};exports[_0x324a('0x50')]=function(_0x593831,_0x35550a,_0xc409ef){var _0xf28663=require(_0x324a('0x51'));return db['Schedule'][_0x324a('0x46')]({'where':{'id':_0x593831[_0x324a('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x35550a,null))[_0x324a('0x22')](function(){_0xf28663['run'](_0x593831[_0x324a('0x45')]['id']);})[_0x324a('0x22')](respondWithStatusCode(_0x35550a,null))[_0x324a('0x43')](handleError(_0x35550a,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 1b1774d..f19415e 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 _0xfe01=['moment','path','rimraf','exports','Schedule','tools_schedules','util','../../config/logger'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0xfe01,0x12e));var _0x1fe0=function(_0x31e326,_0x5a98f0){_0x31e326=_0x31e326-0x0;var _0x30afa5=_0xfe01[_0x31e326];return _0x30afa5;};'use strict';var _=require('lodash');var util=require(_0x1fe0('0x0'));var logger=require(_0x1fe0('0x1'))('api');var moment=require(_0x1fe0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fe0('0x3'));var rimraf=require(_0x1fe0('0x4'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x1fe0('0x5')]=function(_0x3ec323,_0x4e9313){return _0x3ec323['define'](_0x1fe0('0x6'),attributes,{'tableName':_0x1fe0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6095=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','tools_schedules','lodash'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x6095,0xdb));var _0x5609=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x6095[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x5609('0x0'));var util=require('util');var logger=require(_0x5609('0x1'))(_0x5609('0x2'));var moment=require(_0x5609('0x3'));var BPromise=require('bluebird');var rp=require(_0x5609('0x4'));var fs=require('fs');var path=require(_0x5609('0x5'));var rimraf=require(_0x5609('0x6'));var config=require(_0x5609('0x7'));var attributes=require('./schedule.attributes');module[_0x5609('0x8')]=function(_0x5926e8,_0x150669){return _0x5926e8[_0x5609('0x9')]('Schedule',attributes,{'tableName':_0x5609('0xa'),'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 a145166..4011eac 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 _0x1795=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4cc1ed,_0x5586e3){var _0x287ab6=function(_0x2b8b28){while(--_0x2b8b28){_0x4cc1ed['push'](_0x4cc1ed['shift']());}};_0x287ab6(++_0x5586e3);}(_0x1795,0x102));var _0x5179=function(_0x3b3ab1,_0x4faa91){_0x3b3ab1=_0x3b3ab1-0x0;var _0x50db32=_0x1795[_0x3b3ab1];return _0x50db32;};'use strict';var _=require(_0x5179('0x0'));var util=require(_0x5179('0x1'));var moment=require(_0x5179('0x2'));var BPromise=require(_0x5179('0x3'));var rs=require(_0x5179('0x4'));var fs=require('fs');var Redis=require(_0x5179('0x5'));var db=require(_0x5179('0x6'))['db'];var utils=require(_0x5179('0x7'));var logger=require(_0x5179('0x8'))(_0x5179('0x9'));var config=require(_0x5179('0xa'));var jayson=require(_0x5179('0xb'));var client=jayson[_0x5179('0xc')][_0x5179('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x21cbbc,_0x4459db,_0xe572ed){return new BPromise(function(_0x5dd142,_0x1c9be4){return client['request'](_0x21cbbc,_0xe572ed)[_0x5179('0xe')](function(_0xc52aa9){logger[_0x5179('0xf')](_0x5179('0x10'),_0x4459db,_0x5179('0x11'));logger[_0x5179('0x12')](_0x5179('0x13'),_0x4459db,_0x5179('0x11'),JSON[_0x5179('0x14')](_0xc52aa9));if(_0xc52aa9['error']){if(_0xc52aa9[_0x5179('0x15')][_0x5179('0x16')]===0x1f4){logger[_0x5179('0x15')](_0x5179('0x10'),_0x4459db,_0xc52aa9[_0x5179('0x15')][_0x5179('0x17')]);return _0x1c9be4(_0xc52aa9[_0x5179('0x15')][_0x5179('0x17')]);}logger[_0x5179('0x15')](_0x5179('0x10'),_0x4459db,_0xc52aa9[_0x5179('0x15')][_0x5179('0x17')]);return _0x5dd142(_0xc52aa9[_0x5179('0x15')][_0x5179('0x17')]);}else{logger[_0x5179('0xf')]('Schedule,\x20%s,\x20%s',_0x4459db,_0x5179('0x11'));_0x5dd142(_0xc52aa9[_0x5179('0x18')]['message']);}})[_0x5179('0x19')](function(_0x5b5d33){logger['error'](_0x5179('0x10'),_0x4459db,_0x5b5d33);_0x1c9be4(_0x5b5d33);});});} \ No newline at end of file +var _0x720b=['request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4dc700,_0x10191b){var _0x484b91=function(_0x45bacb){while(--_0x45bacb){_0x4dc700['push'](_0x4dc700['shift']());}};_0x484b91(++_0x10191b);}(_0x720b,0x9b));var _0xb720=function(_0x8df0a9,_0x181195){_0x8df0a9=_0x8df0a9-0x0;var _0x2fa3cb=_0x720b[_0x8df0a9];return _0x2fa3cb;};'use strict';var _=require(_0xb720('0x0'));var util=require(_0xb720('0x1'));var moment=require(_0xb720('0x2'));var BPromise=require(_0xb720('0x3'));var rs=require(_0xb720('0x4'));var fs=require('fs');var Redis=require(_0xb720('0x5'));var db=require(_0xb720('0x6'))['db'];var utils=require(_0xb720('0x7'));var logger=require(_0xb720('0x8'))(_0xb720('0x9'));var config=require(_0xb720('0xa'));var jayson=require(_0xb720('0xb'));var client=jayson[_0xb720('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54ba70,_0x29f852,_0x4df52b){return new BPromise(function(_0x2f78e5,_0x33bc4d){return client[_0xb720('0xd')](_0x54ba70,_0x4df52b)[_0xb720('0xe')](function(_0x3bbc90){logger[_0xb720('0xf')](_0xb720('0x10'),_0x29f852,_0xb720('0x11'));logger['debug'](_0xb720('0x12'),_0x29f852,_0xb720('0x11'),JSON[_0xb720('0x13')](_0x3bbc90));if(_0x3bbc90[_0xb720('0x14')]){if(_0x3bbc90[_0xb720('0x14')]['code']===0x1f4){logger[_0xb720('0x14')]('Schedule,\x20%s,\x20%s',_0x29f852,_0x3bbc90[_0xb720('0x14')][_0xb720('0x15')]);return _0x33bc4d(_0x3bbc90[_0xb720('0x14')]['message']);}logger[_0xb720('0x14')]('Schedule,\x20%s,\x20%s',_0x29f852,_0x3bbc90[_0xb720('0x14')][_0xb720('0x15')]);return _0x2f78e5(_0x3bbc90[_0xb720('0x14')][_0xb720('0x15')]);}else{logger[_0xb720('0xf')](_0xb720('0x10'),_0x29f852,_0xb720('0x11'));_0x2f78e5(_0x3bbc90[_0xb720('0x16')]['message']);}})[_0xb720('0x17')](function(_0xfeb5c0){logger[_0xb720('0x14')](_0xb720('0x10'),_0x29f852,_0xfeb5c0);_0x33bc4d(_0xfeb5c0);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index bf4d05a..74141d9 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 _0x1ee4=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download'];(function(_0x49192,_0x2fc6fb){var _0x57d8e8=function(_0xc4ed8d){while(--_0xc4ed8d){_0x49192['push'](_0x49192['shift']());}};_0x57d8e8(++_0x2fc6fb);}(_0x1ee4,0xcb));var _0x41ee=function(_0x232700,_0x2c2479){_0x232700=_0x232700-0x0;var _0x1a71e6=_0x1ee4[_0x232700];return _0x1a71e6;};'use strict';var multer=require(_0x41ee('0x0'));var util=require(_0x41ee('0x1'));var path=require(_0x41ee('0x2'));var timeout=require(_0x41ee('0x3'));var express=require(_0x41ee('0x4'));var router=express['Router']();var fs_extra=require(_0x41ee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x41ee('0x6'));var config=require(_0x41ee('0x7'));var controller=require('./screenRecording.controller');router[_0x41ee('0x8')]('/',auth[_0x41ee('0x9')](),controller[_0x41ee('0xa')]);router[_0x41ee('0x8')](_0x41ee('0xb'),auth['isAuthenticated'](),controller[_0x41ee('0xc')]);router[_0x41ee('0x8')](_0x41ee('0xd'),auth[_0x41ee('0x9')](),controller[_0x41ee('0xe')]);router['get'](_0x41ee('0xf'),auth[_0x41ee('0x9')](),controller[_0x41ee('0x10')]);router['post']('/',auth[_0x41ee('0x9')](),controller[_0x41ee('0x11')]);router['put'](_0x41ee('0xd'),auth[_0x41ee('0x9')](),controller[_0x41ee('0x12')]);router[_0x41ee('0x13')](_0x41ee('0xd'),auth[_0x41ee('0x9')](),controller[_0x41ee('0x14')]);module[_0x41ee('0x15')]=router; \ No newline at end of file +var _0x46be=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','show','download','post','create'];(function(_0x32527b,_0x5ea21d){var _0x22b77b=function(_0x106e09){while(--_0x106e09){_0x32527b['push'](_0x32527b['shift']());}};_0x22b77b(++_0x5ea21d);}(_0x46be,0x193));var _0xe46b=function(_0x4a8e14,_0x519668){_0x4a8e14=_0x4a8e14-0x0;var _0x28be98=_0x46be[_0x4a8e14];return _0x28be98;};'use strict';var multer=require(_0xe46b('0x0'));var util=require(_0xe46b('0x1'));var path=require(_0xe46b('0x2'));var timeout=require(_0xe46b('0x3'));var express=require(_0xe46b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe46b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe46b('0x6'));router[_0xe46b('0x7')]('/',auth['isAuthenticated'](),controller[_0xe46b('0x8')]);router[_0xe46b('0x7')](_0xe46b('0x9'),auth[_0xe46b('0xa')](),controller[_0xe46b('0xb')]);router['get'](_0xe46b('0xc'),auth[_0xe46b('0xa')](),controller[_0xe46b('0xd')]);router[_0xe46b('0x7')]('/:id/download',auth[_0xe46b('0xa')](),controller[_0xe46b('0xe')]);router[_0xe46b('0xf')]('/',auth[_0xe46b('0xa')](),controller[_0xe46b('0x10')]);router['put'](_0xe46b('0xc'),auth[_0xe46b('0xa')](),controller[_0xe46b('0x11')]);router[_0xe46b('0x12')](_0xe46b('0xc'),auth[_0xe46b('0xa')](),controller[_0xe46b('0x13')]);module[_0xe46b('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 65e9a23..d47183b 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 _0x119c=['getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','moment','../../config/environment','exports','VIRTUAL','value','extname'];(function(_0x20ddfd,_0x7e2ed2){var _0x5d1988=function(_0x3f992d){while(--_0x3f992d){_0x20ddfd['push'](_0x20ddfd['shift']());}};_0x5d1988(++_0x7e2ed2);}(_0x119c,0xea));var _0xc119=function(_0x174a2d,_0x44cf92){_0x174a2d=_0x174a2d-0x0;var _0x3a58c3=_0x119c[_0x174a2d];return _0x3a58c3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc119('0x0'));var path=require('path');var config=require(_0xc119('0x1'));module[_0xc119('0x2')]={'format':{'type':Sequelize[_0xc119('0x3')],'get':function(){return this['getDataValue'](_0xc119('0x4'))?path[_0xc119('0x5')](this[_0xc119('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xc119('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xc119('0x7')],'set':function(_0x57bc8a){var _0x16b3d2=_0x57bc8a[_0xc119('0x8')](/\\/g,'/');this[_0xc119('0x9')](_0xc119('0x4'),_0x16b3d2);}},'rating':{'type':Sequelize[_0xc119('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xc119('0xa')],'set':function(_0x367745){this[_0xc119('0x9')](_0xc119('0xb'),moment()[_0xc119('0xc')](_0x367745,'ms'));this[_0xc119('0x9')]('closedAt',moment());this[_0xc119('0x9')]('duration',_0x367745);}},'startedAt':{'type':Sequelize[_0xc119('0xd')],'get':function(){return moment(this[_0xc119('0x6')](_0xc119('0xb')))[_0xc119('0xe')](_0xc119('0xf'))[_0xc119('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xc119('0x11')))[_0xc119('0xe')](_0xc119('0xf'))[_0xc119('0x10')]();}},'createdAt':{'type':Sequelize[_0xc119('0xd')],'get':function(){return moment(this['getDataValue'](_0xc119('0x12')))['format'](_0xc119('0xf'))[_0xc119('0x10')]();}},'updatedAt':{'type':Sequelize[_0xc119('0xd')],'get':function(){return moment(this[_0xc119('0x6')](_0xc119('0x13')))[_0xc119('0xe')](_0xc119('0xf'))[_0xc119('0x10')]();}}}; \ No newline at end of file +var _0xc74c=['extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','exports','VIRTUAL','value'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0xc74c,0x163));var _0xcc74=function(_0x1a0487,_0x205461){_0x1a0487=_0x1a0487-0x0;var _0xa3b36d=_0xc74c[_0x1a0487];return _0xa3b36d;};'use strict';var Sequelize=require(_0xcc74('0x0'));var moment=require(_0xcc74('0x1'));var path=require('path');var config=require('../../config/environment');module[_0xcc74('0x2')]={'format':{'type':Sequelize[_0xcc74('0x3')],'get':function(){return this['getDataValue'](_0xcc74('0x4'))?path[_0xcc74('0x5')](this[_0xcc74('0x6')](_0xcc74('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xcc74('0x7')]},'channel':{'type':Sequelize[_0xcc74('0x7')]},'value':{'type':Sequelize[_0xcc74('0x7')],'set':function(_0x5d46a6){var _0x15248f=_0x5d46a6[_0xcc74('0x8')](/\\/g,'/');this[_0xcc74('0x9')](_0xcc74('0x4'),_0x15248f);}},'rating':{'type':Sequelize[_0xcc74('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x4b4534){this[_0xcc74('0x9')](_0xcc74('0xb'),moment()[_0xcc74('0xc')](_0x4b4534,'ms'));this['setDataValue'](_0xcc74('0xd'),moment());this[_0xcc74('0x9')](_0xcc74('0xe'),_0x4b4534);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcc74('0x6')]('startedAt'))[_0xcc74('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcc74('0x6')](_0xcc74('0xd')))[_0xcc74('0xf')](_0xcc74('0x10'))[_0xcc74('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcc74('0x6')](_0xcc74('0x12')))[_0xcc74('0xf')](_0xcc74('0x10'))[_0xcc74('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcc74('0x6')](_0xcc74('0x13')))[_0xcc74('0xf')](_0xcc74('0x10'))[_0xcc74('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index c8646e6..fafe0f5 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 _0x7217=['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','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5d755e,_0x5306e8){var _0x320fd3=function(_0x55e29b){while(--_0x55e29b){_0x5d755e['push'](_0x5d755e['shift']());}};_0x320fd3(++_0x5306e8);}(_0x7217,0x19e));var _0x7721=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7217[_0x5c3c0b];return _0x52ecd2;};'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('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));}; \ No newline at end of file +var _0x8958=['pick','merge','VIRTUAL','filter','options','ScreenRecording','include','findAll','params','rawAttributes','includeAll','create','catch','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x26310a,_0x5f02ea){var _0x172460=function(_0x310de6){while(--_0x310de6){_0x26310a['push'](_0x26310a['shift']());}};_0x172460(++_0x5f02ea);}(_0x8958,0x93));var _0x8895=function(_0x10197a,_0x5b7bb6){_0x10197a=_0x10197a-0x0;var _0x11ad2b=_0x8958[_0x10197a];return _0x11ad2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['ScreenRecording']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['differenceBy'](_[_0x8895('0x29')](_0x16b65b,'name'),[_0x8895('0x2e')]);_0x37ac3a['query']=_[_0x8895('0x2f')](_0x5c03ea[_0x8895('0x30')]);_0x37ac3a[_0x8895('0x31')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a['query']);_0x6e449d[_0x8895('0x33')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x5c03ea[_0x8895('0x30')]['fields']));_0x6e449d[_0x8895('0x33')]=_0x6e449d['attributes'][_0x8895('0x35')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea[_0x8895('0x30')][_0x8895('0x36')](_0x8895('0x37'))){_0x6e449d[_0x8895('0x1d')]=qs['limit'](_0x5c03ea[_0x8895('0x30')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs[_0x8895('0x1f')](_0x5c03ea[_0x8895('0x30')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x38')]=qs[_0x8895('0x39')](_0x5c03ea['query'][_0x8895('0x39')]);_0x6e449d[_0x8895('0x3a')]=qs['filters'](_[_0x8895('0x3b')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x31')]),_0x16b65b);if(_0x5c03ea[_0x8895('0x30')]['filter']){_0x6e449d[_0x8895('0x3a')]=_[_0x8895('0x3c')](_0x6e449d['where'],{'$or':_['map'](_0x16b65b,function(_0x202130){if(_0x202130[_0x8895('0x2b')]!==_0x8895('0x3d')){var _0x331a9e={};_0x331a9e[_0x202130[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea['query'][_0x8895('0x3e')]+'%'};return _0x331a9e;}})});}_0x6e449d=_[_0x8895('0x3c')]({},_0x6e449d,_0x5c03ea[_0x8895('0x3f')]);var _0x10005f={'where':_0x6e449d[_0x8895('0x3a')]};return db[_0x8895('0x40')]['count'](_0x10005f)[_0x8895('0x24')](function(_0x5ebfc4){_0x3fc4cc[_0x8895('0x1e')]=_0x5ebfc4;if(_0x5c03ea[_0x8895('0x30')]['includeAll']){_0x6e449d[_0x8895('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x8895('0x42')](_0x6e449d);})['then'](function(_0x4af3b1){_0x3fc4cc['rows']=_0x4af3b1;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x447ed6,_0x206f57){var _0x596531={'raw':![],'where':{'id':_0x447ed6[_0x8895('0x43')]['id']}},_0x4835d7={};_0x4835d7[_0x8895('0x2d')]=_['keys'](db[_0x8895('0x40')][_0x8895('0x44')]);_0x4835d7[_0x8895('0x30')]=_[_0x8895('0x2f')](_0x447ed6[_0x8895('0x30')]);_0x4835d7['filters']=_['intersection'](_0x4835d7['model'],_0x4835d7[_0x8895('0x30')]);_0x596531['attributes']=_[_0x8895('0x32')](_0x4835d7[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x447ed6[_0x8895('0x30')]['fields']));_0x596531[_0x8895('0x33')]=_0x596531[_0x8895('0x33')][_0x8895('0x35')]?_0x596531[_0x8895('0x33')]:_0x4835d7[_0x8895('0x2d')];if(_0x447ed6[_0x8895('0x30')][_0x8895('0x45')]){_0x596531[_0x8895('0x41')]=[{'all':!![]}];}_0x596531=_['merge']({},_0x596531,_0x447ed6[_0x8895('0x3f')]);return db[_0x8895('0x40')]['find'](_0x596531)[_0x8895('0x24')](handleEntityNotFound(_0x206f57,null))['then'](respondWithResult(_0x206f57,null))['catch'](handleError(_0x206f57,null));};exports[_0x8895('0x46')]=function(_0x337a9f,_0x130018){return db['ScreenRecording'][_0x8895('0x46')](_0x337a9f['body'],{})[_0x8895('0x24')](respondWithResult(_0x130018,0xc9))[_0x8895('0x47')](handleError(_0x130018,null));};exports[_0x8895('0x23')]=function(_0x1ca539,_0x2f3bf1){if(_0x1ca539[_0x8895('0x48')]['id']){delete _0x1ca539[_0x8895('0x48')]['id'];}delete _0x1ca539['body']['duration'];delete _0x1ca539[_0x8895('0x48')][_0x8895('0x49')];delete _0x1ca539['body'][_0x8895('0x4a')];delete _0x1ca539['body']['value'];return db[_0x8895('0x40')]['find']({'where':{'id':_0x1ca539[_0x8895('0x43')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2f3bf1,null))[_0x8895('0x24')](saveUpdates(_0x1ca539[_0x8895('0x48')],null))[_0x8895('0x24')](respondWithResult(_0x2f3bf1,null))[_0x8895('0x47')](handleError(_0x2f3bf1,null));};exports[_0x8895('0x4b')]=function(_0x38d6ae,_0x583419){return db[_0x8895('0x40')][_0x8895('0x4b')]()[_0x8895('0x24')](respondWithResult(_0x583419,null))['catch'](handleError(_0x583419,null));};exports[_0x8895('0x4c')]=function(_0x3935fd,_0xd7ffeb,_0x14e769){var _0x1e264a=require(_0x8895('0x4d'));var _0x434ab8=![];var _0x216e6e={};if(_0x3935fd[_0x8895('0x30')][_0x8895('0x2b')]&&_0x3935fd['query'][_0x8895('0x2b')]===_0x8895('0x4e')){_0x216e6e[_0x8895('0x4e')]=_0x3935fd[_0x8895('0x43')]['id'];}else{_0x216e6e['id']=_0x3935fd[_0x8895('0x43')]['id'];}return db['ScreenRecording'][_0x8895('0x4f')]({'where':_0x216e6e,'attributes':['id',_0x8895('0x50')],'raw':!![]})[_0x8895('0x24')](handleEntityNotFound(_0xd7ffeb,null))[_0x8895('0x24')](function(_0x37a7b4){if(_0x37a7b4){var _0x58dd6c=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x37a7b4['value']);var _0x20422f=util[_0x8895('0x2e')](_0x8895('0x54'),_0x58dd6c);if(fs['existsSync'](_0x20422f)){_0x434ab8=!![];return _0x1e264a[_0x8895('0x55')](_0x20422f,_0x58dd6c,config[_0x8895('0x56')]['recording'])[_0x8895('0x24')](function(){return _0x37a7b4;});}return _0x37a7b4;}})[_0x8895('0x24')](function(_0x5198f8){if(_0x5198f8){var _0x2f990a=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x5198f8['value']);if(!fs['existsSync'](_0x2f990a)){throw new db[(_0x8895('0x57'))][(_0x8895('0x58'))](_0x8895('0x59'));}if(_0x5198f8['filename']){return _0xd7ffeb[_0x8895('0x4c')](_0x2f990a,_0x5198f8[_0x8895('0x5a')]+path['extname'](_0x2f990a),function(){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}else{return _0xd7ffeb['download'](_0x2f990a,function(_0x435e36){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}}})[_0x8895('0x47')](function(_0x14f8a4){if(_0x14f8a4[_0x8895('0x5c')]==='ScreenRecording\x20not\x20found'){_0xd7ffeb['status'](0x194)[_0x8895('0x27')](_0x8895('0x5d'));}else{return handleError(_0xd7ffeb,null);}});};exports['destroy']=function(_0x46f8ae,_0x131476){return db[_0x8895('0x40')][_0x8895('0x4f')]({'where':{'id':_0x46f8ae['params']['id']}})[_0x8895('0x24')](function(_0x2d2bf9){if(_[_0x8895('0x5e')](_0x2d2bf9)){throw new ReferenceError(_0x8895('0x5f'));}return _0x2d2bf9;})[_0x8895('0x24')](function(_0x41a2fe){var _0x261d4b=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x41a2fe[_0x8895('0x50')]);logger[_0x8895('0x60')](_0x8895('0x61'),_0x261d4b);if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger['info']('File:\x20\x22'+_0x261d4b+_0x8895('0x62'));fs[_0x8895('0x63')](_0x261d4b);}_0x261d4b=_0x261d4b+_0x8895('0x64');if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger[_0x8895('0x60')](_0x8895('0x65')+_0x261d4b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8895('0x63')](_0x261d4b);}return _0x41a2fe;})[_0x8895('0x24')](function(_0xf51f48){if(!_0xf51f48)throw new InternalError();return _0xf51f48[_0x8895('0x66')]();})[_0x8895('0x24')](function(){_0x131476['status'](0xcc)[_0x8895('0x1a')]();})[_0x8895('0x47')](handleError(_0x131476,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 68c5857..dc7e9a3 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 _0xe4a5=['./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x89183,_0x12e560){var _0x513118=function(_0x4fb7c0){while(--_0x4fb7c0){_0x89183['push'](_0x89183['shift']());}};_0x513118(++_0x12e560);}(_0xe4a5,0x162));var _0x5e4a=function(_0x5008c8,_0x342e4a){_0x5008c8=_0x5008c8-0x0;var _0x28d778=_0xe4a5[_0x5008c8];return _0x28d778;};'use strict';var _=require(_0x5e4a('0x0'));var util=require('util');var logger=require(_0x5e4a('0x1'))('api');var moment=require(_0x5e4a('0x2'));var BPromise=require('bluebird');var rp=require(_0x5e4a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e4a('0x4'));var config=require(_0x5e4a('0x5'));var attributes=require(_0x5e4a('0x6'));module[_0x5e4a('0x7')]=function(_0x45dc75,_0x5e90cc){return _0x45dc75[_0x5e4a('0x8')](_0x5e4a('0x9'),attributes,{'tableName':_0x5e4a('0xa'),'paranoid':![],'indexes':[{'name':_0x5e4a('0xb'),'fields':[_0x5e4a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1988=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x66d929,_0x2c9e16){var _0x868705=function(_0x4e153f){while(--_0x4e153f){_0x66d929['push'](_0x66d929['shift']());}};_0x868705(++_0x2c9e16);}(_0x1988,0x15f));var _0x8198=function(_0x19da0d,_0x52e92e){_0x19da0d=_0x19da0d-0x0;var _0x4d1b49=_0x1988[_0x19da0d];return _0x4d1b49;};'use strict';var _=require(_0x8198('0x0'));var util=require(_0x8198('0x1'));var logger=require('../../config/logger')(_0x8198('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8198('0x3'));var fs=require('fs');var path=require(_0x8198('0x4'));var rimraf=require(_0x8198('0x5'));var config=require(_0x8198('0x6'));var attributes=require(_0x8198('0x7'));module[_0x8198('0x8')]=function(_0xb735e0,_0x29af74){return _0xb735e0[_0x8198('0x9')](_0x8198('0xa'),attributes,{'tableName':_0x8198('0xb'),'paranoid':![],'indexes':[{'name':_0x8198('0xc'),'fields':[_0x8198('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 11a8ac6..d258cef 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 _0xcc4e=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x42b0bd,_0x24eb2f){var _0x22a2cd=function(_0x169fb0){while(--_0x169fb0){_0x42b0bd['push'](_0x42b0bd['shift']());}};_0x22a2cd(++_0x24eb2f);}(_0xcc4e,0xe8));var _0xecc4=function(_0x488b77,_0x2fbd49){_0x488b77=_0x488b77-0x0;var _0x43039a=_0xcc4e[_0x488b77];return _0x43039a;};'use strict';var _=require(_0xecc4('0x0'));var util=require(_0xecc4('0x1'));var moment=require(_0xecc4('0x2'));var BPromise=require(_0xecc4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecc4('0x4'));var db=require(_0xecc4('0x5'))['db'];var utils=require(_0xecc4('0x6'));var logger=require(_0xecc4('0x7'))(_0xecc4('0x8'));var config=require(_0xecc4('0x9'));var jayson=require(_0xecc4('0xa'));var client=jayson[_0xecc4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x141771,_0x1193b8,_0x587671){return new BPromise(function(_0x49a124,_0x1a4704){return client[_0xecc4('0xc')](_0x141771,_0x587671)[_0xecc4('0xd')](function(_0x34aaec){logger['info'](_0xecc4('0xe'),_0x1193b8,_0xecc4('0xf'));logger[_0xecc4('0x10')](_0xecc4('0x11'),_0x1193b8,_0xecc4('0xf'),JSON['stringify'](_0x34aaec));if(_0x34aaec[_0xecc4('0x12')]){if(_0x34aaec[_0xecc4('0x12')]['code']===0x1f4){logger[_0xecc4('0x12')](_0xecc4('0xe'),_0x1193b8,_0x34aaec['error'][_0xecc4('0x13')]);return _0x1a4704(_0x34aaec[_0xecc4('0x12')][_0xecc4('0x13')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1193b8,_0x34aaec[_0xecc4('0x12')]['message']);return _0x49a124(_0x34aaec[_0xecc4('0x12')][_0xecc4('0x13')]);}else{logger['info'](_0xecc4('0xe'),_0x1193b8,'request\x20sent');_0x49a124(_0x34aaec[_0xecc4('0x14')]['message']);}})['catch'](function(_0x3977fb){logger['error'](_0xecc4('0xe'),_0x1193b8,_0x3977fb);_0x1a4704(_0x3977fb);});});} \ No newline at end of file +var _0xb19e=['request','then','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x28973c,_0x31a176){var _0x906cfd=function(_0x477797){while(--_0x477797){_0x28973c['push'](_0x28973c['shift']());}};_0x906cfd(++_0x31a176);}(_0xb19e,0x7d));var _0xeb19=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb19e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xeb19('0x0'));var util=require(_0xeb19('0x1'));var moment=require(_0xeb19('0x2'));var BPromise=require(_0xeb19('0x3'));var rs=require(_0xeb19('0x4'));var fs=require('fs');var Redis=require(_0xeb19('0x5'));var db=require(_0xeb19('0x6'))['db'];var utils=require(_0xeb19('0x7'));var logger=require(_0xeb19('0x8'))(_0xeb19('0x9'));var config=require(_0xeb19('0xa'));var jayson=require(_0xeb19('0xb'));var client=jayson[_0xeb19('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x459bb7,_0x209893,_0x4f6dd2){return new BPromise(function(_0x4867fc,_0x5e3aa6){return client[_0xeb19('0xd')](_0x459bb7,_0x4f6dd2)[_0xeb19('0xe')](function(_0x1134b1){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x209893,'request\x20sent');logger['debug'](_0xeb19('0xf'),_0x209893,_0xeb19('0x10'),JSON[_0xeb19('0x11')](_0x1134b1));if(_0x1134b1[_0xeb19('0x12')]){if(_0x1134b1['error'][_0xeb19('0x13')]===0x1f4){logger['error'](_0xeb19('0x14'),_0x209893,_0x1134b1[_0xeb19('0x12')][_0xeb19('0x15')]);return _0x5e3aa6(_0x1134b1[_0xeb19('0x12')][_0xeb19('0x15')]);}logger[_0xeb19('0x12')](_0xeb19('0x14'),_0x209893,_0x1134b1['error'][_0xeb19('0x15')]);return _0x4867fc(_0x1134b1[_0xeb19('0x12')][_0xeb19('0x15')]);}else{logger['info'](_0xeb19('0x14'),_0x209893,_0xeb19('0x10'));_0x4867fc(_0x1134b1['result'][_0xeb19('0x15')]);}})[_0xeb19('0x16')](function(_0x146b57){logger[_0xeb19('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x209893,_0x146b57);_0x5e3aa6(_0x146b57);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index dbb3589..6add5e7 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 _0xf5a7=['single','server/files/images/logos/','preferred','addPreferred','format','favicon','addFavicon','put','/:id','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','show','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','/:id/favicon','getFavicon','join','%s%s','logo','extname','originalname','post','file','addLogo','diskStorage','root','logologin'];(function(_0x504f0a,_0x2a072c){var _0x24f83f=function(_0x75d913){while(--_0x75d913){_0x504f0a['push'](_0x504f0a['shift']());}};_0x24f83f(++_0x2a072c);}(_0xf5a7,0x163));var _0x7f5a=function(_0x48cc28,_0x20bbf1){_0x48cc28=_0x48cc28-0x0;var _0x4b5201=_0xf5a7[_0x48cc28];return _0x4b5201;};'use strict';var multer=require(_0x7f5a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7f5a('0x1'));var express=require(_0x7f5a('0x2'));var router=express[_0x7f5a('0x3')]();var fs_extra=require(_0x7f5a('0x4'));var auth=require(_0x7f5a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7f5a('0x6'));var controller=require(_0x7f5a('0x7'));router[_0x7f5a('0x8')]('/',auth[_0x7f5a('0x9')](),controller[_0x7f5a('0xa')]);router[_0x7f5a('0x8')](_0x7f5a('0xb'),controller[_0x7f5a('0xc')]);router[_0x7f5a('0x8')]('/:id',controller[_0x7f5a('0xd')]);router[_0x7f5a('0x8')]('/:id/logo',controller[_0x7f5a('0xe')]);router[_0x7f5a('0x8')](_0x7f5a('0xf'),controller[_0x7f5a('0x10')]);router[_0x7f5a('0x8')]('/:id/gdpr',controller[_0x7f5a('0x11')]);router[_0x7f5a('0x8')](_0x7f5a('0x12'),controller['getPreferred']);router[_0x7f5a('0x8')](_0x7f5a('0x13'),controller[_0x7f5a('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1859f5,_0x2e9405,_0x12cd18){_0x12cd18(null,path[_0x7f5a('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x905fec,_0x2655c1,_0x29c4d5){_0x29c4d5(null,util['format'](_0x7f5a('0x16'),_0x7f5a('0x17'),path[_0x7f5a('0x18')](_0x2655c1[_0x7f5a('0x19')])));}})});router[_0x7f5a('0x1a')]('/:id/logo',upload['single'](_0x7f5a('0x1b')),controller[_0x7f5a('0x1c')]);var upload=multer({'storage':multer[_0x7f5a('0x1d')]({'destination':function(_0x243c49,_0x472cfd,_0xb80606){_0xb80606(null,path[_0x7f5a('0x15')](config[_0x7f5a('0x1e')],'server/files/images/logos/'));},'filename':function(_0x32f93e,_0x1568fa,_0x3767ba){_0x3767ba(null,util['format'](_0x7f5a('0x16'),_0x7f5a('0x1f'),path[_0x7f5a('0x18')](_0x1568fa['originalname'])));}})});router[_0x7f5a('0x1a')](_0x7f5a('0xf'),upload[_0x7f5a('0x20')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x7f5a('0x1d')]({'destination':function(_0x27621e,_0x205d6a,_0x54c895){_0x54c895(null,path['join'](config[_0x7f5a('0x1e')],_0x7f5a('0x21')));},'filename':function(_0x502f9a,_0x308ebc,_0x35b7c5){_0x35b7c5(null,util['format'](_0x7f5a('0x16'),_0x7f5a('0x22'),path[_0x7f5a('0x18')](_0x308ebc[_0x7f5a('0x19')])));}})});router[_0x7f5a('0x1a')]('/:id/preferred',upload[_0x7f5a('0x20')](_0x7f5a('0x1b')),controller[_0x7f5a('0x23')]);var upload=multer({'storage':multer[_0x7f5a('0x1d')]({'destination':function(_0x223fcb,_0x485488,_0xe7a834){_0xe7a834(null,path['join'](config[_0x7f5a('0x1e')],_0x7f5a('0x21')));},'filename':function(_0x2806ba,_0x3a145e,_0x37fa3e){_0x37fa3e(null,util[_0x7f5a('0x24')](_0x7f5a('0x16'),_0x7f5a('0x25'),path[_0x7f5a('0x18')](_0x3a145e['originalname'])));}})});router[_0x7f5a('0x1a')](_0x7f5a('0x13'),upload[_0x7f5a('0x20')]('file'),controller[_0x7f5a('0x26')]);router[_0x7f5a('0x27')](_0x7f5a('0x28'),auth[_0x7f5a('0x9')](),controller[_0x7f5a('0x29')]);module[_0x7f5a('0x2a')]=router; \ No newline at end of file +var _0xc610=['/:id/favicon','diskStorage','server/files/images/logos/','%s%s','extname','post','single','addLogo','format','logologin','originalname','file','join','root','addPreferred','addFavicon','/:id','update','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred'];(function(_0x1dd0c7,_0x390510){var _0x1a9a81=function(_0x18921f){while(--_0x18921f){_0x1dd0c7['push'](_0x1dd0c7['shift']());}};_0x1a9a81(++_0x390510);}(_0xc610,0x1c2));var _0x0c61=function(_0x25bb9d,_0x4f12cc){_0x25bb9d=_0x25bb9d-0x0;var _0x5e7a45=_0xc610[_0x25bb9d];return _0x5e7a45;};'use strict';var multer=require(_0x0c61('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c61('0x1')]();var fs_extra=require(_0x0c61('0x2'));var auth=require(_0x0c61('0x3'));var interaction=require(_0x0c61('0x4'));var config=require(_0x0c61('0x5'));var controller=require(_0x0c61('0x6'));router[_0x0c61('0x7')]('/',auth['isAuthenticated'](),controller[_0x0c61('0x8')]);router[_0x0c61('0x7')](_0x0c61('0x9'),controller[_0x0c61('0xa')]);router[_0x0c61('0x7')]('/:id',controller['show']);router[_0x0c61('0x7')](_0x0c61('0xb'),controller[_0x0c61('0xc')]);router[_0x0c61('0x7')](_0x0c61('0xd'),controller[_0x0c61('0xe')]);router[_0x0c61('0x7')](_0x0c61('0xf'),controller[_0x0c61('0x10')]);router['get'](_0x0c61('0x11'),controller['getPreferred']);router[_0x0c61('0x7')](_0x0c61('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0x0c61('0x13')]({'destination':function(_0x49f52c,_0x4d7fd9,_0x278db7){_0x278db7(null,path['join'](config['root'],_0x0c61('0x14')));},'filename':function(_0x18258d,_0xe2fe83,_0x4c8480){_0x4c8480(null,util['format'](_0x0c61('0x15'),'logo',path[_0x0c61('0x16')](_0xe2fe83['originalname'])));}})});router[_0x0c61('0x17')]('/:id/logo',upload[_0x0c61('0x18')]('file'),controller[_0x0c61('0x19')]);var upload=multer({'storage':multer[_0x0c61('0x13')]({'destination':function(_0xa3aef9,_0x5423cf,_0x5b9561){_0x5b9561(null,path['join'](config['root'],_0x0c61('0x14')));},'filename':function(_0x398cab,_0xeadd83,_0x4140a1){_0x4140a1(null,util[_0x0c61('0x1a')](_0x0c61('0x15'),_0x0c61('0x1b'),path[_0x0c61('0x16')](_0xeadd83[_0x0c61('0x1c')])));}})});router[_0x0c61('0x17')](_0x0c61('0xd'),upload[_0x0c61('0x18')](_0x0c61('0x1d')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x0c61('0x13')]({'destination':function(_0x1b9c86,_0x24b7c7,_0x3fa983){_0x3fa983(null,path[_0x0c61('0x1e')](config[_0x0c61('0x1f')],'server/files/images/logos/'));},'filename':function(_0x46da86,_0x191da4,_0x4e8f8c){_0x4e8f8c(null,util[_0x0c61('0x1a')](_0x0c61('0x15'),'preferred',path['extname'](_0x191da4[_0x0c61('0x1c')])));}})});router[_0x0c61('0x17')](_0x0c61('0x11'),upload['single'](_0x0c61('0x1d')),controller[_0x0c61('0x20')]);var upload=multer({'storage':multer[_0x0c61('0x13')]({'destination':function(_0x433981,_0x56a645,_0x5f3ac0){_0x5f3ac0(null,path[_0x0c61('0x1e')](config['root'],_0x0c61('0x14')));},'filename':function(_0x154c90,_0x30a533,_0x57f79b){_0x57f79b(null,util[_0x0c61('0x1a')](_0x0c61('0x15'),'favicon',path[_0x0c61('0x16')](_0x30a533['originalname'])));}})});router['post'](_0x0c61('0x12'),upload[_0x0c61('0x18')](_0x0c61('0x1d')),controller[_0x0c61('0x21')]);router['put'](_0x0c61('0x22'),auth['isAuthenticated'](),controller[_0x0c61('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 478bf10..6e82cc6 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 _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0xadb5,0xad));var _0x5adb=function(_0x4b28e2,_0x324431){_0x4b28e2=_0x4b28e2-0x0;var _0x387f9b=_0xadb5[_0x4b28e2];return _0x387f9b;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x57b41a,_0x18ae3e){var _0xe2ef65=function(_0x481a60){while(--_0x481a60){_0x57b41a['push'](_0x57b41a['shift']());}};_0xe2ef65(++_0x18ae3e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x569dda,_0x29f743){_0x569dda=_0x569dda-0x0;var _0x9fb40b=_0x5f2f[_0x569dda];return _0x9fb40b;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('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 3dfa016..869dc19 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 _0x9da2=['request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','sendStatus','stack','name','send','index','Setting','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','download','getLogoLogin','preferred','favicon','default_loginLogo.svg','existsSync','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch'];(function(_0x20375d,_0x307d3d){var _0x4da999=function(_0x1d7271){while(--_0x1d7271){_0x20375d['push'](_0x20375d['shift']());}};_0x4da999(++_0x307d3d);}(_0x9da2,0xf1));var _0x29da=function(_0x809324,_0x3e5e0e){_0x809324=_0x809324-0x0;var _0x5b9c19=_0x9da2[_0x809324];return _0x5b9c19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29da('0x0'));var zipdir=require(_0x29da('0x1'));var jsonpatch=require(_0x29da('0x2'));var rp=require(_0x29da('0x3'));var moment=require(_0x29da('0x4'));var BPromise=require(_0x29da('0x5'));var Mustache=require('mustache');var util=require(_0x29da('0x6'));var path=require(_0x29da('0x7'));var sox=require('sox');var csv=require(_0x29da('0x8'));var ejs=require(_0x29da('0x9'));var fs=require('fs');var fs_extra=require(_0x29da('0xa'));var _=require('lodash');var squel=require(_0x29da('0xb'));var crypto=require(_0x29da('0xc'));var jsforce=require(_0x29da('0xd'));var deskjs=require(_0x29da('0xe'));var toCsv=require(_0x29da('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29da('0xf'));var authService=require(_0x29da('0x10'));var qs=require(_0x29da('0x11'));var as=require(_0x29da('0x12'));var hardwareService=require(_0x29da('0x13'));var logger=require('../../config/logger')(_0x29da('0x14'));var utils=require(_0x29da('0x15'));var config=require(_0x29da('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x29da('0x17'))['db'];var jayson=require(_0x29da('0x18'));var client=jayson[_0x29da('0x19')][_0x29da('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5bbfcc,_0x279aad,_0x3af2c8,_0x35fe59){return new BPromise(function(_0x14f165,_0x1d0655){var _0x4f8a38=_0x35fe59||client;return _0x4f8a38['request'](_0x5bbfcc,_0x3af2c8)[_0x29da('0x1b')](function(_0x38494d){logger[_0x29da('0x1c')](_0x29da('0x1d'),_0x279aad,'request\x20sent');logger[_0x29da('0x1e')](_0x29da('0x1f'),_0x279aad,_0x29da('0x20'),JSON[_0x29da('0x21')](_0x38494d));if(_0x38494d[_0x29da('0x22')]){if(_0x38494d[_0x29da('0x22')][_0x29da('0x23')]===0x1f4){logger[_0x29da('0x22')]('Setting,\x20%s,\x20%s',_0x279aad,_0x38494d[_0x29da('0x22')]['message']);return _0x1d0655(_0x38494d[_0x29da('0x22')]['message']);}logger[_0x29da('0x22')](_0x29da('0x1d'),_0x279aad,_0x38494d[_0x29da('0x22')]['message']);return _0x14f165(_0x38494d[_0x29da('0x22')][_0x29da('0x24')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x279aad,_0x29da('0x20'));_0x14f165(_0x38494d['result'][_0x29da('0x24')]);}})['catch'](function(_0x1e9253){logger[_0x29da('0x22')](_0x29da('0x1d'),_0x279aad,_0x1e9253);_0x1d0655(_0x1e9253);});});}function respondWithStatusCode(_0x1a14f2,_0x186860){_0x186860=_0x186860||0xcc;return function(_0xc197cb){if(_0xc197cb){return _0x1a14f2['sendStatus'](_0x186860);}return _0x1a14f2[_0x29da('0x25')](_0x186860)[_0x29da('0x26')]();};}function respondWithResult(_0x112e60,_0x2fe6b4){_0x2fe6b4=_0x2fe6b4||0xc8;return function(_0xfe8fc6){if(_0xfe8fc6){return _0x112e60[_0x29da('0x25')](_0x2fe6b4)['json'](_0xfe8fc6);}};}function respondWithFilteredResult(_0x363a5a,_0x21835b){return function(_0x576c2f){if(_0x576c2f){var _0x319e6f=typeof _0x21835b['offset']==='undefined'&&typeof _0x21835b[_0x29da('0x27')]===_0x29da('0x28');var _0x1244b9=_0x576c2f[_0x29da('0x29')];var _0x53c5f2=_0x319e6f?0x0:_0x21835b[_0x29da('0x2a')];var _0x1de4c3=_0x319e6f?_0x576c2f[_0x29da('0x29')]:_0x21835b[_0x29da('0x2a')]+_0x21835b[_0x29da('0x27')];var _0x395b46;if(_0x1de4c3>=_0x1244b9){_0x1de4c3=_0x1244b9;_0x395b46=0xc8;}else{_0x395b46=0xce;}_0x363a5a[_0x29da('0x25')](_0x395b46);return _0x363a5a[_0x29da('0x2b')](_0x29da('0x2c'),_0x53c5f2+'-'+_0x1de4c3+'/'+_0x1244b9)[_0x29da('0x2d')](_0x576c2f);}return null;};}function patchUpdates(_0x2ca4f1){return function(_0x2dbb5d){try{jsonpatch[_0x29da('0x2e')](_0x2dbb5d,_0x2ca4f1,!![]);}catch(_0x276c4f){return BPromise[_0x29da('0x2f')](_0x276c4f);}return _0x2dbb5d['save']();};}function saveUpdates(_0x158587,_0x342775){return function(_0xdc2548){if(_0xdc2548){return _0xdc2548[_0x29da('0x30')](_0x158587)[_0x29da('0x1b')](function(_0x1f413c){return _0x1f413c;});}return null;};}function removeEntity(_0x361f51,_0x4df75f){return function(_0x90439b){if(_0x90439b){return _0x90439b['destroy']()[_0x29da('0x1b')](function(){_0x361f51[_0x29da('0x25')](0xcc)[_0x29da('0x26')]();});}};}function handleEntityNotFound(_0xa1d4ff,_0x412a6f){return function(_0x4eb66c){if(!_0x4eb66c){_0xa1d4ff[_0x29da('0x31')](0x194);}return _0x4eb66c;};}function handleError(_0x3767d6,_0x5b5307){_0x5b5307=_0x5b5307||0x1f4;return function(_0x4ff77b){logger[_0x29da('0x22')](_0x4ff77b[_0x29da('0x32')]);if(_0x4ff77b[_0x29da('0x33')]){delete _0x4ff77b['name'];}_0x3767d6[_0x29da('0x25')](_0x5b5307)[_0x29da('0x34')](_0x4ff77b);};}exports[_0x29da('0x35')]=function(_0xcfdc3a,_0x2cf461){var _0x10be8e={},_0x74027a={},_0x21ccbb={'count':0x0,'rows':[]};var _0x6d602e=_['map'](db[_0x29da('0x36')][_0x29da('0x37')],function(_0x8de221){return{'name':_0x8de221['fieldName'],'type':_0x8de221[_0x29da('0x38')][_0x29da('0x39')]};});_0x74027a[_0x29da('0x3a')]=_[_0x29da('0x3b')](_0x6d602e,_0x29da('0x33'));_0x74027a['query']=_['keys'](_0xcfdc3a[_0x29da('0x3c')]);_0x74027a[_0x29da('0x3d')]=_[_0x29da('0x3e')](_0x74027a[_0x29da('0x3a')],_0x74027a[_0x29da('0x3c')]);_0x10be8e[_0x29da('0x3f')]=_['intersection'](_0x74027a['model'],qs[_0x29da('0x40')](_0xcfdc3a['query']['fields']));_0x10be8e[_0x29da('0x3f')]=_0x10be8e[_0x29da('0x3f')]['length']?_0x10be8e[_0x29da('0x3f')]:_0x74027a[_0x29da('0x3a')];if(!_0xcfdc3a[_0x29da('0x3c')][_0x29da('0x41')](_0x29da('0x42'))){_0x10be8e['limit']=qs[_0x29da('0x27')](_0xcfdc3a[_0x29da('0x3c')][_0x29da('0x27')]);_0x10be8e[_0x29da('0x2a')]=qs['offset'](_0xcfdc3a[_0x29da('0x3c')][_0x29da('0x2a')]);}_0x10be8e[_0x29da('0x43')]=qs['sort'](_0xcfdc3a[_0x29da('0x3c')][_0x29da('0x44')]);_0x10be8e[_0x29da('0x45')]=qs[_0x29da('0x3d')](_[_0x29da('0x46')](_0xcfdc3a[_0x29da('0x3c')],_0x74027a[_0x29da('0x3d')]),_0x6d602e);if(_0xcfdc3a[_0x29da('0x3c')]['filter']){_0x10be8e['where']=_[_0x29da('0x47')](_0x10be8e['where'],{'$or':_[_0x29da('0x3b')](_0x6d602e,function(_0x191f8c){if(_0x191f8c['type']!==_0x29da('0x48')){var _0x35cfcd={};_0x35cfcd[_0x191f8c['name']]={'$like':'%'+_0xcfdc3a[_0x29da('0x3c')][_0x29da('0x49')]+'%'};return _0x35cfcd;}})});}_0x10be8e=_['merge']({},_0x10be8e,_0xcfdc3a[_0x29da('0x4a')]);var _0x5670b1={'where':_0x10be8e[_0x29da('0x45')]};return db[_0x29da('0x36')]['count'](_0x5670b1)[_0x29da('0x1b')](function(_0x452b2f){_0x21ccbb[_0x29da('0x29')]=_0x452b2f;if(_0xcfdc3a[_0x29da('0x3c')][_0x29da('0x4b')]){_0x10be8e[_0x29da('0x4c')]=[{'all':!![]}];}return db[_0x29da('0x36')][_0x29da('0x4d')](_0x10be8e);})['then'](function(_0x4f3e3c){_0x21ccbb[_0x29da('0x4e')]=_0x4f3e3c;return _0x21ccbb;})[_0x29da('0x1b')](respondWithFilteredResult(_0x2cf461,_0x10be8e))[_0x29da('0x4f')](handleError(_0x2cf461,null));};exports[_0x29da('0x50')]=function(_0x106e57,_0x59ddda){var _0x552762={'raw':![],'where':{'id':_0x106e57[_0x29da('0x51')]['id']}},_0x3d972e={};_0x3d972e[_0x29da('0x3a')]=_['keys'](db[_0x29da('0x36')][_0x29da('0x37')]);_0x3d972e[_0x29da('0x3c')]=_['keys'](_0x106e57[_0x29da('0x3c')]);_0x3d972e[_0x29da('0x3d')]=_[_0x29da('0x3e')](_0x3d972e[_0x29da('0x3a')],_0x3d972e[_0x29da('0x3c')]);_0x552762[_0x29da('0x3f')]=_['intersection'](_0x3d972e[_0x29da('0x3a')],qs[_0x29da('0x40')](_0x106e57['query']['fields']));_0x552762[_0x29da('0x3f')]=_0x552762[_0x29da('0x3f')]['length']?_0x552762[_0x29da('0x3f')]:_0x3d972e[_0x29da('0x3a')];if(_0x106e57[_0x29da('0x3c')][_0x29da('0x4b')]){_0x552762['include']=[{'all':!![]}];}_0x552762=_[_0x29da('0x47')]({},_0x552762,_0x106e57['options']);return db[_0x29da('0x36')][_0x29da('0x52')](_0x552762)[_0x29da('0x1b')](handleEntityNotFound(_0x59ddda,null))['then'](respondWithResult(_0x59ddda,null))[_0x29da('0x4f')](handleError(_0x59ddda,null));};exports[_0x29da('0x30')]=function(_0x4a53da,_0x6530e3){if(_0x4a53da['body']['id']){delete _0x4a53da['body']['id'];}return db[_0x29da('0x36')][_0x29da('0x52')]({'where':{'id':_0x4a53da[_0x29da('0x51')]['id']}})[_0x29da('0x1b')](handleEntityNotFound(_0x6530e3,null))[_0x29da('0x1b')](saveUpdates(_0x4a53da[_0x29da('0x53')],null))[_0x29da('0x1b')](respondWithResult(_0x6530e3,null))[_0x29da('0x4f')](handleError(_0x6530e3,null));};exports['addLogo']=function(_0x53dac1,_0x3188fd,_0x40faa2){if(_0x53dac1[_0x29da('0x54')]&&_0x53dac1[_0x29da('0x54')][_0x29da('0x55')]){_0x53dac1[_0x29da('0x53')][_0x29da('0x56')]=_0x53dac1[_0x29da('0x54')]['filename'];}return db[_0x29da('0x36')][_0x29da('0x52')]({'where':{'id':_0x53dac1[_0x29da('0x51')]['id']}})['then'](handleEntityNotFound(_0x3188fd,null))[_0x29da('0x1b')](saveUpdates(_0x53dac1[_0x29da('0x53')],null))[_0x29da('0x1b')](respondWithResult(_0x3188fd,null))['catch'](handleError(_0x3188fd,null));};exports[_0x29da('0x57')]=function(_0x1c2d25,_0x2746ec,_0x5990b2){if(_0x1c2d25[_0x29da('0x54')]&&_0x1c2d25['file']['filename']){_0x1c2d25[_0x29da('0x53')][_0x29da('0x58')]=_0x1c2d25['file'][_0x29da('0x55')];}return db[_0x29da('0x36')][_0x29da('0x52')]({'where':{'id':_0x1c2d25[_0x29da('0x51')]['id']}})[_0x29da('0x1b')](handleEntityNotFound(_0x2746ec,null))[_0x29da('0x1b')](saveUpdates(_0x1c2d25[_0x29da('0x53')],null))[_0x29da('0x1b')](respondWithResult(_0x2746ec,null))[_0x29da('0x4f')](handleError(_0x2746ec,null));};var utilLicense=require(_0x29da('0x59'));exports['getLogo']=function(_0x570c8,_0x155dab,_0x5baa3b){var _0x340495=_0x29da('0x5a');var _0x139305={'custom':![]};return utilLicense[_0x29da('0x5b')]()[_0x29da('0x1b')](function(_0x450436){if(_0x450436){_0x139305=_0x450436;}return db[_0x29da('0x36')][_0x29da('0x52')]({'where':{'id':_0x570c8[_0x29da('0x51')]['id']},'attributes':[_0x29da('0x56'),_0x29da('0x58'),'preferred','favicon',_0x29da('0x5c'),_0x29da('0x5d'),_0x29da('0x5e'),_0x29da('0x5f')],'raw':!![]});})[_0x29da('0x1b')](handleEntityNotFound(_0x155dab,null))[_0x29da('0x1b')](function(_0x22830d){if(_0x22830d){var _0x2d7167=_0x22830d[_0x29da('0x56')]&&fs['existsSync'](path[_0x29da('0x60')](config[_0x29da('0x61')],_0x340495,_[_0x29da('0x62')](_0x22830d[_0x29da('0x56')])))?path[_0x29da('0x60')](config[_0x29da('0x61')],_0x340495,_[_0x29da('0x62')](_0x22830d[_0x29da('0x56')])):path[_0x29da('0x60')](config[_0x29da('0x61')],_0x340495,_[_0x29da('0x62')]('default_logo.svg'));var _0x179cb1=_0x29da('0x63')+_[_0x29da('0x64')](_0x29da('0x56'));if(_0x22830d[_0x179cb1]||!_0x139305[_0x29da('0x65')]){_0x2d7167=path[_0x29da('0x60')](config[_0x29da('0x61')],_0x340495,_[_0x29da('0x62')](_0x29da('0x66')));}if(!fs['existsSync'](_0x2d7167)){throw new db[(_0x29da('0x67'))][(_0x29da('0x68'))](_[_0x29da('0x64')]('logo')+'\x20not\x20found');}return _0x155dab[_0x29da('0x69')](_0x2d7167);}})[_0x29da('0x4f')](handleError(_0x155dab,null));};var utilLicense=require(_0x29da('0x59'));exports[_0x29da('0x6a')]=function(_0x27418c,_0x53ceca,_0x4d87a9){var _0x186303=_0x29da('0x5a');var _0x14a68b={'custom':![]};return utilLicense['getLicense']()[_0x29da('0x1b')](function(_0x408d63){if(_0x408d63){_0x14a68b=_0x408d63;}return db[_0x29da('0x36')]['find']({'where':{'id':_0x27418c[_0x29da('0x51')]['id']},'attributes':[_0x29da('0x56'),_0x29da('0x58'),_0x29da('0x6b'),_0x29da('0x6c'),_0x29da('0x5c'),_0x29da('0x5d'),_0x29da('0x5e'),_0x29da('0x5f')],'raw':!![]});})[_0x29da('0x1b')](handleEntityNotFound(_0x53ceca,null))['then'](function(_0x59cf70){if(_0x59cf70){var _0x34b499=_0x59cf70[_0x29da('0x58')]&&fs['existsSync'](path[_0x29da('0x60')](config[_0x29da('0x61')],_0x186303,_[_0x29da('0x62')](_0x59cf70[_0x29da('0x58')])))?path['join'](config[_0x29da('0x61')],_0x186303,_[_0x29da('0x62')](_0x59cf70[_0x29da('0x58')])):path[_0x29da('0x60')](config[_0x29da('0x61')],_0x186303,_[_0x29da('0x62')](_0x29da('0x6d')));var _0x3bec09='default'+_[_0x29da('0x64')]('loginLogo');if(_0x59cf70[_0x3bec09]||!_0x14a68b['custom']){_0x34b499=path['join'](config[_0x29da('0x61')],_0x186303,_['toLower']('default_loginLogo.svg'));}if(!fs[_0x29da('0x6e')](_0x34b499)){throw new db[(_0x29da('0x67'))][(_0x29da('0x68'))](_[_0x29da('0x64')](_0x29da('0x58'))+_0x29da('0x6f'));}return _0x53ceca[_0x29da('0x69')](_0x34b499);}})[_0x29da('0x4f')](handleError(_0x53ceca,null));};exports[_0x29da('0x70')]=function(_0x3be5c6,_0x4f2d3e){return db[_0x29da('0x36')]['find']({'where':{'id':_0x3be5c6['params']['id']},'attributes':[_0x29da('0x71')]})['then'](respondWithResult(_0x4f2d3e,null))['catch'](handleError(_0x4f2d3e,null));};exports[_0x29da('0x72')]=function(_0x268f89,_0x1d5396,_0x59af5f){if(_0x268f89[_0x29da('0x54')]&&_0x268f89['file'][_0x29da('0x55')]){_0x268f89['body'][_0x29da('0x6b')]=_0x268f89[_0x29da('0x54')][_0x29da('0x55')];}return db[_0x29da('0x36')][_0x29da('0x52')]({'where':{'id':_0x268f89[_0x29da('0x51')]['id']}})[_0x29da('0x1b')](handleEntityNotFound(_0x1d5396,null))['then'](saveUpdates(_0x268f89[_0x29da('0x53')],null))[_0x29da('0x1b')](respondWithResult(_0x1d5396,null))['catch'](handleError(_0x1d5396,null));};var utilLicense=require(_0x29da('0x59'));exports[_0x29da('0x73')]=function(_0x1f89a2,_0xa28e14,_0x431176){var _0x51b15c=_0x29da('0x5a');var _0x2b9fe5={'custom':![]};return utilLicense[_0x29da('0x5b')]()[_0x29da('0x1b')](function(_0x203765){if(_0x203765){_0x2b9fe5=_0x203765;}return db['Setting'][_0x29da('0x52')]({'where':{'id':_0x1f89a2[_0x29da('0x51')]['id']},'attributes':['logo','loginLogo',_0x29da('0x6b'),_0x29da('0x6c'),'defaultLogo',_0x29da('0x5d'),_0x29da('0x5e'),_0x29da('0x5f')],'raw':!![]});})[_0x29da('0x1b')](handleEntityNotFound(_0xa28e14,null))[_0x29da('0x1b')](function(_0x30a2bb){if(_0x30a2bb){var _0x4f195d=_0x30a2bb[_0x29da('0x6b')]&&fs[_0x29da('0x6e')](path[_0x29da('0x60')](config[_0x29da('0x61')],_0x51b15c,_['toLower'](_0x30a2bb[_0x29da('0x6b')])))?path[_0x29da('0x60')](config[_0x29da('0x61')],_0x51b15c,_['toLower'](_0x30a2bb[_0x29da('0x6b')])):path['join'](config[_0x29da('0x61')],_0x51b15c,_[_0x29da('0x62')](_0x29da('0x74')));var _0x15ebf6=_0x29da('0x63')+_[_0x29da('0x64')]('preferred');if(_0x30a2bb[_0x15ebf6]||!_0x2b9fe5[_0x29da('0x65')]||!_0x2b9fe5[_0x29da('0x6b')]){_0x4f195d=path[_0x29da('0x60')](config[_0x29da('0x61')],_0x51b15c,_[_0x29da('0x62')](_0x29da('0x74')));}if(!fs['existsSync'](_0x4f195d)){throw new db[(_0x29da('0x67'))][(_0x29da('0x68'))](_[_0x29da('0x64')](_0x29da('0x6b'))+_0x29da('0x6f'));}return _0xa28e14[_0x29da('0x69')](_0x4f195d);}})[_0x29da('0x4f')](handleError(_0xa28e14,null));};exports['addFavicon']=function(_0x2d1985,_0x884c44,_0x4e2c27){if(_0x2d1985[_0x29da('0x54')]&&_0x2d1985[_0x29da('0x54')][_0x29da('0x55')]){_0x2d1985['body'][_0x29da('0x6c')]=_0x2d1985[_0x29da('0x54')][_0x29da('0x55')];}return db['Setting'][_0x29da('0x52')]({'where':{'id':_0x2d1985[_0x29da('0x51')]['id']}})[_0x29da('0x1b')](handleEntityNotFound(_0x884c44,null))[_0x29da('0x1b')](saveUpdates(_0x2d1985[_0x29da('0x53')],null))['then'](respondWithResult(_0x884c44,null))[_0x29da('0x4f')](handleError(_0x884c44,null));};var utilLicense=require(_0x29da('0x59'));exports['getFavicon']=function(_0x4ea006,_0x12994a,_0x34e846){var _0x1ae87a=_0x29da('0x5a');var _0x32ae92={'custom':![]};return utilLicense[_0x29da('0x5b')]()[_0x29da('0x1b')](function(_0x172a68){if(_0x172a68){_0x32ae92=_0x172a68;}return db[_0x29da('0x36')][_0x29da('0x52')]({'where':{'id':_0x4ea006[_0x29da('0x51')]['id']},'attributes':[_0x29da('0x56'),'loginLogo',_0x29da('0x6b'),'favicon','defaultLogo',_0x29da('0x5d'),_0x29da('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x29da('0x1b')](handleEntityNotFound(_0x12994a,null))[_0x29da('0x1b')](function(_0x464f61){if(_0x464f61){var _0x25d7c9=_0x464f61['favicon']&&fs['existsSync'](path[_0x29da('0x60')](config[_0x29da('0x61')],_0x1ae87a,_[_0x29da('0x62')](_0x464f61[_0x29da('0x6c')])))?path[_0x29da('0x60')](config[_0x29da('0x61')],_0x1ae87a,_[_0x29da('0x62')](_0x464f61[_0x29da('0x6c')])):path[_0x29da('0x60')](config[_0x29da('0x61')],_0x1ae87a,_[_0x29da('0x62')](_0x29da('0x75')));var _0x5d1102=_0x29da('0x63')+_[_0x29da('0x64')](_0x29da('0x6c'));if(_0x464f61[_0x5d1102]||!_0x32ae92[_0x29da('0x65')]){_0x25d7c9=path[_0x29da('0x60')](config['root'],_0x1ae87a,_[_0x29da('0x62')](_0x29da('0x75')));}if(!fs[_0x29da('0x6e')](_0x25d7c9)){throw new db['Sequelize'][(_0x29da('0x68'))](_['upperFirst'](_0x29da('0x6c'))+_0x29da('0x6f'));}return _0x12994a[_0x29da('0x69')](_0x25d7c9);}})[_0x29da('0x4f')](handleError(_0x12994a,null));};exports[_0x29da('0x76')]=function(_0x3ae70d,_0x497da9){var _0x25cfde={'offset':moment()[_0x29da('0x77')]()};_0x25cfde['now']=moment()['utcOffset'](_0x25cfde[_0x29da('0x2a')])[_0x29da('0x78')](_0x29da('0x79'));return _0x497da9[_0x29da('0x25')](0xc8)[_0x29da('0x34')](_0x25cfde);}; \ No newline at end of file +var _0xf5b7=['utcOffset','now','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','destroy','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','Setting','includeAll','include','rows','catch','show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','favicon','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','upperFirst','custom','default_logo.svg','ValidationError','download','getLogoLogin','getLicense','default_loginLogo.svg','default','Sequelize','\x20not\x20found','securePassword','preferred','getPreferred','defaultFavicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf5b7,0xf7));var _0x7f5b=function(_0x50471b,_0x10054a){_0x50471b=_0x50471b-0x0;var _0xd6d011=_0xf5b7[_0x50471b];return _0xd6d011;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f5b('0x0'));var zipdir=require(_0x7f5b('0x1'));var jsonpatch=require(_0x7f5b('0x2'));var rp=require(_0x7f5b('0x3'));var moment=require(_0x7f5b('0x4'));var BPromise=require(_0x7f5b('0x5'));var Mustache=require('mustache');var util=require(_0x7f5b('0x6'));var path=require('path');var sox=require(_0x7f5b('0x7'));var csv=require(_0x7f5b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f5b('0x9'));var _=require(_0x7f5b('0xa'));var squel=require(_0x7f5b('0xb'));var crypto=require(_0x7f5b('0xc'));var jsforce=require(_0x7f5b('0xd'));var deskjs=require(_0x7f5b('0xe'));var toCsv=require(_0x7f5b('0x8'));var querystring=require(_0x7f5b('0xf'));var Papa=require(_0x7f5b('0x10'));var Redis=require(_0x7f5b('0x11'));var authService=require(_0x7f5b('0x12'));var qs=require(_0x7f5b('0x13'));var as=require(_0x7f5b('0x14'));var hardwareService=require(_0x7f5b('0x15'));var logger=require(_0x7f5b('0x16'))('api');var utils=require(_0x7f5b('0x17'));var config=require(_0x7f5b('0x18'));var licenseUtil=require(_0x7f5b('0x19'));var db=require(_0x7f5b('0x1a'))['db'];var jayson=require(_0x7f5b('0x1b'));var client=jayson[_0x7f5b('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cd761,_0x319b70,_0x1bc1e9,_0x434f2c){return new BPromise(function(_0x1172dd,_0x4321cb){var _0x481824=_0x434f2c||client;return _0x481824['request'](_0x2cd761,_0x1bc1e9)['then'](function(_0x1cc067){logger[_0x7f5b('0x1d')](_0x7f5b('0x1e'),_0x319b70,_0x7f5b('0x1f'));logger[_0x7f5b('0x20')](_0x7f5b('0x21'),_0x319b70,_0x7f5b('0x1f'),JSON['stringify'](_0x1cc067));if(_0x1cc067['error']){if(_0x1cc067[_0x7f5b('0x22')]['code']===0x1f4){logger[_0x7f5b('0x22')](_0x7f5b('0x1e'),_0x319b70,_0x1cc067['error'][_0x7f5b('0x23')]);return _0x4321cb(_0x1cc067[_0x7f5b('0x22')]['message']);}logger['error'](_0x7f5b('0x1e'),_0x319b70,_0x1cc067[_0x7f5b('0x22')][_0x7f5b('0x23')]);return _0x1172dd(_0x1cc067['error'][_0x7f5b('0x23')]);}else{logger[_0x7f5b('0x1d')](_0x7f5b('0x1e'),_0x319b70,_0x7f5b('0x1f'));_0x1172dd(_0x1cc067['result'][_0x7f5b('0x23')]);}})['catch'](function(_0x2722a8){logger[_0x7f5b('0x22')]('Setting,\x20%s,\x20%s',_0x319b70,_0x2722a8);_0x4321cb(_0x2722a8);});});}function respondWithStatusCode(_0x42020e,_0x5c2b40){_0x5c2b40=_0x5c2b40||0xcc;return function(_0x262cba){if(_0x262cba){return _0x42020e[_0x7f5b('0x24')](_0x5c2b40);}return _0x42020e[_0x7f5b('0x25')](_0x5c2b40)[_0x7f5b('0x26')]();};}function respondWithResult(_0x3064de,_0x2f8ce4){_0x2f8ce4=_0x2f8ce4||0xc8;return function(_0x246ab1){if(_0x246ab1){return _0x3064de[_0x7f5b('0x25')](_0x2f8ce4)[_0x7f5b('0x27')](_0x246ab1);}};}function respondWithFilteredResult(_0x376b0a,_0x400ca7){return function(_0x46449a){if(_0x46449a){var _0x469dac=typeof _0x400ca7['offset']===_0x7f5b('0x28')&&typeof _0x400ca7['limit']===_0x7f5b('0x28');var _0x59affb=_0x46449a[_0x7f5b('0x29')];var _0x58e005=_0x469dac?0x0:_0x400ca7['offset'];var _0x3d987c=_0x469dac?_0x46449a[_0x7f5b('0x29')]:_0x400ca7[_0x7f5b('0x2a')]+_0x400ca7[_0x7f5b('0x2b')];var _0x30b996;if(_0x3d987c>=_0x59affb){_0x3d987c=_0x59affb;_0x30b996=0xc8;}else{_0x30b996=0xce;}_0x376b0a[_0x7f5b('0x25')](_0x30b996);return _0x376b0a['set'](_0x7f5b('0x2c'),_0x58e005+'-'+_0x3d987c+'/'+_0x59affb)[_0x7f5b('0x27')](_0x46449a);}return null;};}function patchUpdates(_0x5a8615){return function(_0x71ec85){try{jsonpatch['apply'](_0x71ec85,_0x5a8615,!![]);}catch(_0x528b0e){return BPromise[_0x7f5b('0x2d')](_0x528b0e);}return _0x71ec85[_0x7f5b('0x2e')]();};}function saveUpdates(_0x2b904d,_0x78b62c){return function(_0x54df44){if(_0x54df44){return _0x54df44[_0x7f5b('0x2f')](_0x2b904d)[_0x7f5b('0x30')](function(_0x35f2e2){return _0x35f2e2;});}return null;};}function removeEntity(_0xadc1be,_0x2da69e){return function(_0x1c1df9){if(_0x1c1df9){return _0x1c1df9[_0x7f5b('0x31')]()[_0x7f5b('0x30')](function(){_0xadc1be[_0x7f5b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1af2e3,_0x1128a6){return function(_0x1ca6ce){if(!_0x1ca6ce){_0x1af2e3[_0x7f5b('0x24')](0x194);}return _0x1ca6ce;};}function handleError(_0x89e9ec,_0x584614){_0x584614=_0x584614||0x1f4;return function(_0x108f3e){logger[_0x7f5b('0x22')](_0x108f3e['stack']);if(_0x108f3e[_0x7f5b('0x32')]){delete _0x108f3e[_0x7f5b('0x32')];}_0x89e9ec[_0x7f5b('0x25')](_0x584614)[_0x7f5b('0x33')](_0x108f3e);};}exports[_0x7f5b('0x34')]=function(_0x57e9f3,_0x3d44e5){var _0x44e37e={},_0x1914c7={},_0x42745c={'count':0x0,'rows':[]};var _0x814e5c=_['map'](db['Setting'][_0x7f5b('0x35')],function(_0x2e8bcd){return{'name':_0x2e8bcd[_0x7f5b('0x36')],'type':_0x2e8bcd[_0x7f5b('0x37')][_0x7f5b('0x38')]};});_0x1914c7['model']=_[_0x7f5b('0x39')](_0x814e5c,_0x7f5b('0x32'));_0x1914c7[_0x7f5b('0x3a')]=_[_0x7f5b('0x3b')](_0x57e9f3[_0x7f5b('0x3a')]);_0x1914c7[_0x7f5b('0x3c')]=_[_0x7f5b('0x3d')](_0x1914c7[_0x7f5b('0x3e')],_0x1914c7[_0x7f5b('0x3a')]);_0x44e37e[_0x7f5b('0x3f')]=_[_0x7f5b('0x3d')](_0x1914c7['model'],qs[_0x7f5b('0x40')](_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x40')]));_0x44e37e[_0x7f5b('0x3f')]=_0x44e37e['attributes'][_0x7f5b('0x41')]?_0x44e37e[_0x7f5b('0x3f')]:_0x1914c7[_0x7f5b('0x3e')];if(!_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x42')](_0x7f5b('0x43'))){_0x44e37e[_0x7f5b('0x2b')]=qs[_0x7f5b('0x2b')](_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x2b')]);_0x44e37e['offset']=qs['offset'](_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x2a')]);}_0x44e37e[_0x7f5b('0x44')]=qs[_0x7f5b('0x45')](_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x45')]);_0x44e37e[_0x7f5b('0x46')]=qs['filters'](_[_0x7f5b('0x47')](_0x57e9f3[_0x7f5b('0x3a')],_0x1914c7['filters']),_0x814e5c);if(_0x57e9f3[_0x7f5b('0x3a')]['filter']){_0x44e37e[_0x7f5b('0x46')]=_['merge'](_0x44e37e[_0x7f5b('0x46')],{'$or':_[_0x7f5b('0x39')](_0x814e5c,function(_0xe61f03){if(_0xe61f03[_0x7f5b('0x37')]!==_0x7f5b('0x48')){var _0x25e400={};_0x25e400[_0xe61f03[_0x7f5b('0x32')]]={'$like':'%'+_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x49')]+'%'};return _0x25e400;}})});}_0x44e37e=_[_0x7f5b('0x4a')]({},_0x44e37e,_0x57e9f3[_0x7f5b('0x4b')]);var _0x2b9d47={'where':_0x44e37e['where']};return db[_0x7f5b('0x4c')]['count'](_0x2b9d47)[_0x7f5b('0x30')](function(_0x100594){_0x42745c[_0x7f5b('0x29')]=_0x100594;if(_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x4d')]){_0x44e37e[_0x7f5b('0x4e')]=[{'all':!![]}];}return db[_0x7f5b('0x4c')]['findAll'](_0x44e37e);})[_0x7f5b('0x30')](function(_0x3630f5){_0x42745c[_0x7f5b('0x4f')]=_0x3630f5;return _0x42745c;})['then'](respondWithFilteredResult(_0x3d44e5,_0x44e37e))[_0x7f5b('0x50')](handleError(_0x3d44e5,null));};exports[_0x7f5b('0x51')]=function(_0x47b5c0,_0x4739a1){var _0x4a5d3c={'raw':![],'where':{'id':_0x47b5c0[_0x7f5b('0x52')]['id']}},_0x468c0d={};_0x468c0d['model']=_[_0x7f5b('0x3b')](db[_0x7f5b('0x4c')]['rawAttributes']);_0x468c0d[_0x7f5b('0x3a')]=_[_0x7f5b('0x3b')](_0x47b5c0['query']);_0x468c0d[_0x7f5b('0x3c')]=_['intersection'](_0x468c0d[_0x7f5b('0x3e')],_0x468c0d['query']);_0x4a5d3c[_0x7f5b('0x3f')]=_[_0x7f5b('0x3d')](_0x468c0d['model'],qs[_0x7f5b('0x40')](_0x47b5c0[_0x7f5b('0x3a')][_0x7f5b('0x40')]));_0x4a5d3c[_0x7f5b('0x3f')]=_0x4a5d3c['attributes']['length']?_0x4a5d3c[_0x7f5b('0x3f')]:_0x468c0d[_0x7f5b('0x3e')];if(_0x47b5c0[_0x7f5b('0x3a')][_0x7f5b('0x4d')]){_0x4a5d3c[_0x7f5b('0x4e')]=[{'all':!![]}];}_0x4a5d3c=_[_0x7f5b('0x4a')]({},_0x4a5d3c,_0x47b5c0['options']);return db[_0x7f5b('0x4c')][_0x7f5b('0x53')](_0x4a5d3c)[_0x7f5b('0x30')](handleEntityNotFound(_0x4739a1,null))[_0x7f5b('0x30')](respondWithResult(_0x4739a1,null))['catch'](handleError(_0x4739a1,null));};exports['update']=function(_0x49d16b,_0x4e9845){if(_0x49d16b[_0x7f5b('0x54')]['id']){delete _0x49d16b['body']['id'];}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x49d16b['params']['id']}})['then'](handleEntityNotFound(_0x4e9845,null))[_0x7f5b('0x30')](saveUpdates(_0x49d16b[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x4e9845,null))[_0x7f5b('0x50')](handleError(_0x4e9845,null));};exports[_0x7f5b('0x55')]=function(_0x5bbcac,_0x340f55,_0x39fba6){if(_0x5bbcac[_0x7f5b('0x56')]&&_0x5bbcac[_0x7f5b('0x56')][_0x7f5b('0x57')]){_0x5bbcac[_0x7f5b('0x54')][_0x7f5b('0x58')]=_0x5bbcac[_0x7f5b('0x56')]['filename'];}return db[_0x7f5b('0x4c')]['find']({'where':{'id':_0x5bbcac[_0x7f5b('0x52')]['id']}})[_0x7f5b('0x30')](handleEntityNotFound(_0x340f55,null))[_0x7f5b('0x30')](saveUpdates(_0x5bbcac[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x340f55,null))[_0x7f5b('0x50')](handleError(_0x340f55,null));};exports[_0x7f5b('0x59')]=function(_0x199bd4,_0x284151,_0x1b1694){if(_0x199bd4[_0x7f5b('0x56')]&&_0x199bd4['file'][_0x7f5b('0x57')]){_0x199bd4['body'][_0x7f5b('0x5a')]=_0x199bd4['file'][_0x7f5b('0x57')];}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x199bd4[_0x7f5b('0x52')]['id']}})['then'](handleEntityNotFound(_0x284151,null))['then'](saveUpdates(_0x199bd4[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x284151,null))[_0x7f5b('0x50')](handleError(_0x284151,null));};var utilLicense=require('../../config/license/util');exports[_0x7f5b('0x5b')]=function(_0x6b43e0,_0x1c1779,_0x40e7ba){var _0x1c967a=_0x7f5b('0x5c');var _0x4b19bf={'custom':![]};return utilLicense['getLicense']()[_0x7f5b('0x30')](function(_0x2bdd49){if(_0x2bdd49){_0x4b19bf=_0x2bdd49;}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x6b43e0[_0x7f5b('0x52')]['id']},'attributes':[_0x7f5b('0x58'),_0x7f5b('0x5a'),'preferred',_0x7f5b('0x5d'),'defaultLogo',_0x7f5b('0x5e'),_0x7f5b('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x7f5b('0x30')](handleEntityNotFound(_0x1c1779,null))[_0x7f5b('0x30')](function(_0x33fdd9){if(_0x33fdd9){var _0x220e24=_0x33fdd9[_0x7f5b('0x58')]&&fs[_0x7f5b('0x60')](path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x1c967a,_['toLower'](_0x33fdd9[_0x7f5b('0x58')])))?path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x1c967a,_['toLower'](_0x33fdd9['logo'])):path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x1c967a,_[_0x7f5b('0x63')]('default_logo.svg'));var _0x90ab7='default'+_[_0x7f5b('0x64')](_0x7f5b('0x58'));if(_0x33fdd9[_0x90ab7]||!_0x4b19bf[_0x7f5b('0x65')]){_0x220e24=path['join'](config['root'],_0x1c967a,_[_0x7f5b('0x63')](_0x7f5b('0x66')));}if(!fs[_0x7f5b('0x60')](_0x220e24)){throw new db['Sequelize'][(_0x7f5b('0x67'))](_['upperFirst'](_0x7f5b('0x58'))+'\x20not\x20found');}return _0x1c1779[_0x7f5b('0x68')](_0x220e24);}})['catch'](handleError(_0x1c1779,null));};var utilLicense=require(_0x7f5b('0x19'));exports[_0x7f5b('0x69')]=function(_0xac7aad,_0x3be91c,_0x4d158e){var _0x2cae95=_0x7f5b('0x5c');var _0x56b928={'custom':![]};return utilLicense[_0x7f5b('0x6a')]()[_0x7f5b('0x30')](function(_0x44e7a8){if(_0x44e7a8){_0x56b928=_0x44e7a8;}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0xac7aad[_0x7f5b('0x52')]['id']},'attributes':[_0x7f5b('0x58'),_0x7f5b('0x5a'),'preferred',_0x7f5b('0x5d'),'defaultLogo',_0x7f5b('0x5e'),_0x7f5b('0x5f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3be91c,null))['then'](function(_0x10ca11){if(_0x10ca11){var _0x26730d=_0x10ca11[_0x7f5b('0x5a')]&&fs[_0x7f5b('0x60')](path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x2cae95,_['toLower'](_0x10ca11[_0x7f5b('0x5a')])))?path['join'](config[_0x7f5b('0x62')],_0x2cae95,_[_0x7f5b('0x63')](_0x10ca11[_0x7f5b('0x5a')])):path['join'](config[_0x7f5b('0x62')],_0x2cae95,_[_0x7f5b('0x63')](_0x7f5b('0x6b')));var _0x2b5f72=_0x7f5b('0x6c')+_[_0x7f5b('0x64')]('loginLogo');if(_0x10ca11[_0x2b5f72]||!_0x56b928[_0x7f5b('0x65')]){_0x26730d=path['join'](config[_0x7f5b('0x62')],_0x2cae95,_[_0x7f5b('0x63')]('default_loginLogo.svg'));}if(!fs[_0x7f5b('0x60')](_0x26730d)){throw new db[(_0x7f5b('0x6d'))][(_0x7f5b('0x67'))](_['upperFirst'](_0x7f5b('0x5a'))+_0x7f5b('0x6e'));}return _0x3be91c[_0x7f5b('0x68')](_0x26730d);}})['catch'](handleError(_0x3be91c,null));};exports['gdpr']=function(_0x4ff35c,_0x4accd1){return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x4ff35c['params']['id']},'attributes':[_0x7f5b('0x6f')]})[_0x7f5b('0x30')](respondWithResult(_0x4accd1,null))[_0x7f5b('0x50')](handleError(_0x4accd1,null));};exports['addPreferred']=function(_0x343c83,_0x55708b,_0x46417f){if(_0x343c83[_0x7f5b('0x56')]&&_0x343c83[_0x7f5b('0x56')]['filename']){_0x343c83['body'][_0x7f5b('0x70')]=_0x343c83[_0x7f5b('0x56')]['filename'];}return db[_0x7f5b('0x4c')]['find']({'where':{'id':_0x343c83['params']['id']}})['then'](handleEntityNotFound(_0x55708b,null))[_0x7f5b('0x30')](saveUpdates(_0x343c83[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x55708b,null))[_0x7f5b('0x50')](handleError(_0x55708b,null));};var utilLicense=require('../../config/license/util');exports[_0x7f5b('0x71')]=function(_0x2cfeba,_0x4cb5b8,_0x534c78){var _0x865aa5=_0x7f5b('0x5c');var _0x45ecfd={'custom':![]};return utilLicense[_0x7f5b('0x6a')]()[_0x7f5b('0x30')](function(_0x570023){if(_0x570023){_0x45ecfd=_0x570023;}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x2cfeba[_0x7f5b('0x52')]['id']},'attributes':[_0x7f5b('0x58'),_0x7f5b('0x5a'),'preferred',_0x7f5b('0x5d'),'defaultLogo',_0x7f5b('0x5e'),'defaultPreferred',_0x7f5b('0x72')],'raw':!![]});})[_0x7f5b('0x30')](handleEntityNotFound(_0x4cb5b8,null))['then'](function(_0x2b3135){if(_0x2b3135){var _0x5be767=_0x2b3135[_0x7f5b('0x70')]&&fs['existsSync'](path['join'](config['root'],_0x865aa5,_[_0x7f5b('0x63')](_0x2b3135[_0x7f5b('0x70')])))?path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x865aa5,_[_0x7f5b('0x63')](_0x2b3135[_0x7f5b('0x70')])):path['join'](config[_0x7f5b('0x62')],_0x865aa5,_['toLower'](_0x7f5b('0x73')));var _0x22bdeb=_0x7f5b('0x6c')+_[_0x7f5b('0x64')](_0x7f5b('0x70'));if(_0x2b3135[_0x22bdeb]||!_0x45ecfd[_0x7f5b('0x65')]||!_0x45ecfd[_0x7f5b('0x70')]){_0x5be767=path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x865aa5,_[_0x7f5b('0x63')](_0x7f5b('0x73')));}if(!fs[_0x7f5b('0x60')](_0x5be767)){throw new db['Sequelize'][(_0x7f5b('0x67'))](_['upperFirst'](_0x7f5b('0x70'))+'\x20not\x20found');}return _0x4cb5b8[_0x7f5b('0x68')](_0x5be767);}})[_0x7f5b('0x50')](handleError(_0x4cb5b8,null));};exports[_0x7f5b('0x74')]=function(_0x1f172a,_0x49796f,_0xa115fb){if(_0x1f172a[_0x7f5b('0x56')]&&_0x1f172a[_0x7f5b('0x56')][_0x7f5b('0x57')]){_0x1f172a[_0x7f5b('0x54')][_0x7f5b('0x5d')]=_0x1f172a[_0x7f5b('0x56')][_0x7f5b('0x57')];}return db['Setting'][_0x7f5b('0x53')]({'where':{'id':_0x1f172a[_0x7f5b('0x52')]['id']}})[_0x7f5b('0x30')](handleEntityNotFound(_0x49796f,null))[_0x7f5b('0x30')](saveUpdates(_0x1f172a[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x49796f,null))[_0x7f5b('0x50')](handleError(_0x49796f,null));};var utilLicense=require('../../config/license/util');exports[_0x7f5b('0x75')]=function(_0x45dd9f,_0x4dc06f,_0x41d6ad){var _0x13b939=_0x7f5b('0x5c');var _0x4c4e38={'custom':![]};return utilLicense[_0x7f5b('0x6a')]()['then'](function(_0x312ad0){if(_0x312ad0){_0x4c4e38=_0x312ad0;}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x45dd9f[_0x7f5b('0x52')]['id']},'attributes':[_0x7f5b('0x58'),'loginLogo','preferred','favicon','defaultLogo',_0x7f5b('0x5e'),'defaultPreferred',_0x7f5b('0x72')],'raw':!![]});})[_0x7f5b('0x30')](handleEntityNotFound(_0x4dc06f,null))[_0x7f5b('0x30')](function(_0x418571){if(_0x418571){var _0x421ea9=_0x418571[_0x7f5b('0x5d')]&&fs[_0x7f5b('0x60')](path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x13b939,_[_0x7f5b('0x63')](_0x418571[_0x7f5b('0x5d')])))?path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x13b939,_[_0x7f5b('0x63')](_0x418571[_0x7f5b('0x5d')])):path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x13b939,_[_0x7f5b('0x63')](_0x7f5b('0x76')));var _0x1a1561=_0x7f5b('0x6c')+_[_0x7f5b('0x64')]('favicon');if(_0x418571[_0x1a1561]||!_0x4c4e38[_0x7f5b('0x65')]){_0x421ea9=path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x13b939,_[_0x7f5b('0x63')]('default_favicon.ico'));}if(!fs['existsSync'](_0x421ea9)){throw new db['Sequelize'][(_0x7f5b('0x67'))](_['upperFirst'](_0x7f5b('0x5d'))+_0x7f5b('0x6e'));}return _0x4dc06f[_0x7f5b('0x68')](_0x421ea9);}})[_0x7f5b('0x50')](handleError(_0x4dc06f,null));};exports['getDate']=function(_0x206769,_0x214c1d){var _0x2e6434={'offset':moment()[_0x7f5b('0x77')]()};_0x2e6434[_0x7f5b('0x78')]=moment()[_0x7f5b('0x77')](_0x2e6434['offset'])[_0x7f5b('0x79')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x214c1d['status'](0xc8)[_0x7f5b('0x33')](_0x2e6434);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 884c73a..ab1c937 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x21a0bc,_0x680faf){var _0x2c0057=function(_0x2dcc2e){while(--_0x2dcc2e){_0x21a0bc['push'](_0x21a0bc['shift']());}};_0x2c0057(++_0x680faf);}(_0x34e8,0x12c));var _0x834e=function(_0xbbdd26,_0x1dd094){_0xbbdd26=_0xbbdd26-0x0;var _0x5470ca=_0x34e8[_0xbbdd26];return _0x5470ca;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x475aa9,_0x439aab){var _0x360bbc=function(_0x331a22){while(--_0x331a22){_0x475aa9['push'](_0x475aa9['shift']());}};_0x360bbc(++_0x439aab);}(_0x008c,0x188));var _0xc008=function(_0x13eaae,_0x11ec0a){_0x13eaae=_0x13eaae-0x0;var _0x4493db=_0x008c[_0x13eaae];return _0x4493db;};'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')]('Setting',attributes,{'tableName':_0xc008('0xc'),'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 3e4e803..8100634 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 _0x636f=['map','model','moment','bluebird','ioredis','../../mysqldb','../../config/utils','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','attributes','include'];(function(_0x5a0d39,_0x4f44fe){var _0xff8c02=function(_0x6335b1){while(--_0x6335b1){_0x5a0d39['push'](_0x5a0d39['shift']());}};_0xff8c02(++_0x4f44fe);}(_0x636f,0xbf));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf636('0x0'));var BPromise=require(_0xf636('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf636('0x2'));var db=require(_0xf636('0x3'))['db'];var utils=require(_0xf636('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a5b64,_0x5d0c69,_0x15d317){return new BPromise(function(_0x1529ba,_0x201e0a){return client[_0xf636('0x5')](_0x1a5b64,_0x15d317)[_0xf636('0x6')](function(_0x1c2a03){logger[_0xf636('0x7')](_0xf636('0x8'),_0x5d0c69,_0xf636('0x9'));logger[_0xf636('0xa')](_0xf636('0xb'),_0x5d0c69,_0xf636('0x9'),JSON[_0xf636('0xc')](_0x1c2a03));if(_0x1c2a03['error']){if(_0x1c2a03[_0xf636('0xd')][_0xf636('0xe')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x5d0c69,_0x1c2a03[_0xf636('0xd')]['message']);return _0x201e0a(_0x1c2a03['error']['message']);}logger['error']('Setting,\x20%s,\x20%s',_0x5d0c69,_0x1c2a03[_0xf636('0xd')]['message']);return _0x1529ba(_0x1c2a03[_0xf636('0xd')][_0xf636('0xf')]);}else{logger[_0xf636('0x7')](_0xf636('0x8'),_0x5d0c69,'request\x20sent');_0x1529ba(_0x1c2a03[_0xf636('0x10')][_0xf636('0xf')]);}})[_0xf636('0x11')](function(_0x4f6052){logger[_0xf636('0xd')](_0xf636('0x8'),_0x5d0c69,_0x4f6052);_0x201e0a(_0x4f6052);});});}exports[_0xf636('0x12')]=function(_0x5da4f1){var _0xf43595=this;return new Promise(function(_0x254302,_0x1b9f33){return db[_0xf636('0x13')][_0xf636('0x14')]({'raw':_0x5da4f1[_0xf636('0x15')]?_0x5da4f1[_0xf636('0x15')][_0xf636('0x16')]===undefined?!![]:![]:!![],'where':_0x5da4f1[_0xf636('0x15')]?_0x5da4f1[_0xf636('0x15')]['where']||null:null,'attributes':_0x5da4f1[_0xf636('0x15')]?_0x5da4f1[_0xf636('0x15')][_0xf636('0x17')]||null:null,'include':_0x5da4f1[_0xf636('0x15')]?_0x5da4f1['options'][_0xf636('0x18')]?_[_0xf636('0x19')](_0x5da4f1[_0xf636('0x15')][_0xf636('0x18')],function(_0x3d6660){return{'model':db[_0x3d6660[_0xf636('0x1a')]],'as':_0x3d6660['as'],'attributes':_0x3d6660[_0xf636('0x17')],'include':_0x3d6660[_0xf636('0x18')]?_['map'](_0x3d6660[_0xf636('0x18')],function(_0x5e4b9b){return{'model':db[_0x5e4b9b['model']],'as':_0x5e4b9b['as'],'attributes':_0x5e4b9b[_0xf636('0x17')],'include':_0x5e4b9b[_0xf636('0x18')]?_[_0xf636('0x19')](_0x5e4b9b[_0xf636('0x18')],function(_0x421525){return{'model':db[_0x421525['model']],'as':_0x421525['as'],'attributes':_0x421525[_0xf636('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf636('0x6')](function(_0x538e1d){logger[_0xf636('0x7')]('ShowSetting',_0x5da4f1);logger['debug']('ShowSetting',_0x5da4f1,JSON['stringify'](_0x538e1d));_0x254302(_0x538e1d);})[_0xf636('0x11')](function(_0x319864){logger[_0xf636('0xd')]('ShowSetting',_0x319864[_0xf636('0xf')],_0x5da4f1);_0x1b9f33(_0xf43595[_0xf636('0xd')](0x1f4,_0x319864[_0xf636('0xf')]));});});}; \ No newline at end of file +var _0x1174=['code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','then','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1174,0x10f));var _0x4117=function(_0x5387da,_0x5979fe){_0x5387da=_0x5387da-0x0;var _0x4f62f7=_0x1174[_0x5387da];return _0x4f62f7;};'use strict';var _=require('lodash');var util=require(_0x4117('0x0'));var moment=require(_0x4117('0x1'));var BPromise=require(_0x4117('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4117('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4117('0x4'));var logger=require(_0x4117('0x5'))(_0x4117('0x6'));var config=require(_0x4117('0x7'));var jayson=require(_0x4117('0x8'));var client=jayson[_0x4117('0x9')][_0x4117('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e113c,_0x56ce85,_0x535ba9){return new BPromise(function(_0x16e55b,_0x934e1c){return client[_0x4117('0xb')](_0x4e113c,_0x535ba9)['then'](function(_0x32220e){logger[_0x4117('0xc')](_0x4117('0xd'),_0x56ce85,_0x4117('0xe'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x56ce85,'request\x20sent',JSON[_0x4117('0xf')](_0x32220e));if(_0x32220e[_0x4117('0x10')]){if(_0x32220e[_0x4117('0x10')][_0x4117('0x11')]===0x1f4){logger[_0x4117('0x10')]('Setting,\x20%s,\x20%s',_0x56ce85,_0x32220e[_0x4117('0x10')][_0x4117('0x12')]);return _0x934e1c(_0x32220e[_0x4117('0x10')]['message']);}logger['error'](_0x4117('0xd'),_0x56ce85,_0x32220e[_0x4117('0x10')][_0x4117('0x12')]);return _0x16e55b(_0x32220e[_0x4117('0x10')][_0x4117('0x12')]);}else{logger[_0x4117('0xc')]('Setting,\x20%s,\x20%s',_0x56ce85,_0x4117('0xe'));_0x16e55b(_0x32220e[_0x4117('0x13')][_0x4117('0x12')]);}})[_0x4117('0x14')](function(_0x433f70){logger[_0x4117('0x10')]('Setting,\x20%s,\x20%s',_0x56ce85,_0x433f70);_0x934e1c(_0x433f70);});});}exports[_0x4117('0x15')]=function(_0x5784fe){var _0x49d703=this;return new Promise(function(_0x590735,_0x114395){return db[_0x4117('0x16')][_0x4117('0x17')]({'raw':_0x5784fe[_0x4117('0x18')]?_0x5784fe[_0x4117('0x18')][_0x4117('0x19')]===undefined?!![]:![]:!![],'where':_0x5784fe['options']?_0x5784fe[_0x4117('0x18')][_0x4117('0x1a')]||null:null,'attributes':_0x5784fe['options']?_0x5784fe[_0x4117('0x18')][_0x4117('0x1b')]||null:null,'include':_0x5784fe['options']?_0x5784fe[_0x4117('0x18')][_0x4117('0x1c')]?_['map'](_0x5784fe['options']['include'],function(_0x1a9677){return{'model':db[_0x1a9677[_0x4117('0x1d')]],'as':_0x1a9677['as'],'attributes':_0x1a9677[_0x4117('0x1b')],'include':_0x1a9677['include']?_[_0x4117('0x1e')](_0x1a9677['include'],function(_0x1a19b9){return{'model':db[_0x1a19b9[_0x4117('0x1d')]],'as':_0x1a19b9['as'],'attributes':_0x1a19b9[_0x4117('0x1b')],'include':_0x1a19b9['include']?_['map'](_0x1a19b9[_0x4117('0x1c')],function(_0x45e294){return{'model':db[_0x45e294[_0x4117('0x1d')]],'as':_0x45e294['as'],'attributes':_0x45e294[_0x4117('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4117('0x1f')](function(_0x38dd09){logger['info'](_0x4117('0x15'),_0x5784fe);logger['debug'](_0x4117('0x15'),_0x5784fe,JSON['stringify'](_0x38dd09));_0x590735(_0x38dd09);})['catch'](function(_0x256835){logger[_0x4117('0x10')](_0x4117('0x15'),_0x256835[_0x4117('0x12')],_0x5784fe);_0x114395(_0x49d703['error'](0x1f4,_0x256835[_0x4117('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 3df2d6b..95429c9 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 _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x523671,_0x4657fc){var _0x5b0bdc=function(_0x301007){while(--_0x301007){_0x523671['push'](_0x523671['shift']());}};_0x5b0bdc(++_0x4657fc);}(_0xe14b,0x93));var _0xbe14=function(_0x196fba,_0x9c572){_0x196fba=_0x196fba-0x0;var _0x115fb6=_0xe14b[_0x196fba];return _0x115fb6;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file +var _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x3383f0,_0x8736c0){var _0x14e0fc=function(_0x372922){while(--_0x372922){_0x3383f0['push'](_0x3383f0['shift']());}};_0x14e0fc(++_0x8736c0);}(_0xabce,0x103));var _0xeabc=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xabce[_0x363ef8];return _0x148822;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 8d072e8..8896460 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 _0xb8b8=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','plivo','clickatell','bandwidth','infobip','intelepeer','BOOLEAN'];(function(_0x145713,_0x82e388){var _0x26c130=function(_0x41188f){while(--_0x41188f){_0x145713['push'](_0x145713['shift']());}};_0x26c130(++_0x82e388);}(_0xb8b8,0x12d));var _0x8b8b=function(_0xa6a560,_0x57e0d5){_0xa6a560=_0xa6a560-0x0;var _0x1d06d7=_0xb8b8[_0xa6a560];return _0x1d06d7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x8b8b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8b8b('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x8b8b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x8b8b('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8b8b('0x3')]();}},'phone':{'type':Sequelize[_0x8b8b('0x2')]},'type':{'type':Sequelize[_0x8b8b('0x4')](_0x8b8b('0x5'),_0x8b8b('0x6'),_0x8b8b('0x7'),'clicksend',_0x8b8b('0x8'),_0x8b8b('0x9'),_0x8b8b('0xa'),'csc',_0x8b8b('0xb'),_0x8b8b('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x8b8b('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x8b8b('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x8b8b('0x2')]},'applicationId':{'type':Sequelize[_0x8b8b('0x2')]},'accountId':{'type':Sequelize[_0x8b8b('0x2')]},'senderString':{'type':Sequelize[_0x8b8b('0x2')]},'deliveryReport':{'type':Sequelize[_0x8b8b('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8b8b('0xe')],'defaultValue':function(){return _0x8b8b('0xf');}},'notificationSound':{'type':Sequelize[_0x8b8b('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8b8b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8b8b('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8b8b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8b8b('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8b8b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x8b8b('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x13006b){if(!_0x13006b)this[_0x8b8b('0x12')](_0x8b8b('0x13'),null);this[_0x8b8b('0x12')](_0x8b8b('0x14'),_0x13006b);}}}; \ No newline at end of file +var _0xce74=['mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','connectel','clicksend','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId'];(function(_0x37fa88,_0x3f39bd){var _0x4c1bef=function(_0x2a0d04){while(--_0x2a0d04){_0x37fa88['push'](_0x37fa88['shift']());}};_0x4c1bef(++_0x3f39bd);}(_0xce74,0x155));var _0x4ce7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xce74[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x4ce7('0x0'));var rs=require(_0x4ce7('0x1'));module[_0x4ce7('0x2')]={'name':{'type':Sequelize[_0x4ce7('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x4ce7('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4ce7('0x3')],'defaultValue':function(){return rs[_0x4ce7('0x4')]();}},'phone':{'type':Sequelize[_0x4ce7('0x3')]},'type':{'type':Sequelize[_0x4ce7('0x5')](_0x4ce7('0x6'),'skebby',_0x4ce7('0x7'),_0x4ce7('0x8'),'plivo',_0x4ce7('0x9'),'bandwidth',_0x4ce7('0xa'),_0x4ce7('0xb'),_0x4ce7('0xc'))},'accountSid':{'type':Sequelize[_0x4ce7('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x4ce7('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x4ce7('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x4ce7('0x3')]},'applicationId':{'type':Sequelize[_0x4ce7('0x3')]},'accountId':{'type':Sequelize[_0x4ce7('0x3')]},'senderString':{'type':Sequelize[_0x4ce7('0x3')]},'deliveryReport':{'type':Sequelize[_0x4ce7('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x4ce7('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4ce7('0xe');}},'notificationSound':{'type':Sequelize[_0x4ce7('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4ce7('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4ce7('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4ce7('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4ce7('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4ce7('0xf')],'comment':_0x4ce7('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x4ce7('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x331b89){if(!_0x331b89)this[_0x4ce7('0x11')](_0x4ce7('0x12'),null);this[_0x4ce7('0x11')](_0x4ce7('0x13'),_0x331b89);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 147f05a..721f4f9 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 _0xa321=['requestid','statusInt','message_id','status_code','bandwidth','redif','inspect','error_code','groupName','DELIVERED','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','undefined','count','reject','save','destroy','get','SmsAccounts','UserProfileResource','sendStatus','stack','name','index','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','includeAll','findAll','rows','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','getDispositions','Disposition','nolimit','pick','SmsAccountId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','describe','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','type','From','Body','messageId','MessageSid','from','sender','text','clicksend','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','push','*,*,*,*','SmsMessage','ContactId','User','UserId','unshift','agent','startRouting','Start','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','send','\x0a','addApplications','findOne','transaction','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','connectel'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xa321,0xf3));var _0x1a32=function(_0x1c6efd,_0xb2f3cd){_0x1c6efd=_0x1c6efd-0x0;var _0x53a918=_0xa321[_0x1c6efd];return _0x53a918;};'use strict';var emlformat=require(_0x1a32('0x0'));var rimraf=require(_0x1a32('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a32('0x2'));var rp=require(_0x1a32('0x3'));var moment=require('moment');var BPromise=require(_0x1a32('0x4'));var Mustache=require(_0x1a32('0x5'));var util=require(_0x1a32('0x6'));var path=require(_0x1a32('0x7'));var sox=require(_0x1a32('0x8'));var csv=require('to-csv');var ejs=require(_0x1a32('0x9'));var fs=require('fs');var fs_extra=require(_0x1a32('0xa'));var _=require(_0x1a32('0xb'));var squel=require(_0x1a32('0xc'));var crypto=require(_0x1a32('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a32('0xe'));var toCsv=require(_0x1a32('0xf'));var querystring=require(_0x1a32('0x10'));var Papa=require(_0x1a32('0x11'));var Redis=require('ioredis');var authService=require(_0x1a32('0x12'));var qs=require(_0x1a32('0x13'));var as=require(_0x1a32('0x14'));var hardwareService=require(_0x1a32('0x15'));var logger=require(_0x1a32('0x16'))('api');var utils=require(_0x1a32('0x17'));var config=require(_0x1a32('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1a32('0x19')]=_[_0x1a32('0x1a')](config[_0x1a32('0x19')],{'host':_0x1a32('0x1b'),'port':0x18eb});var socket=require(_0x1a32('0x1c'))(new Redis(config[_0x1a32('0x19')]));require(_0x1a32('0x1d'))[_0x1a32('0x1e')](socket);var jayson=require(_0x1a32('0x1f'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xfbeacb,_0x2b8171,_0xeae0b9,_0x322294){return new BPromise(function(_0x4fece3,_0x35b296){var _0x4770b4=_0x322294||client;return _0x4770b4[_0x1a32('0x20')](_0xfbeacb,_0xeae0b9)[_0x1a32('0x21')](function(_0x5840d7){logger[_0x1a32('0x22')](_0x1a32('0x23'),_0x2b8171,_0x1a32('0x24'));logger['debug'](_0x1a32('0x25'),_0x2b8171,_0x1a32('0x24'),JSON[_0x1a32('0x26')](_0x5840d7));if(_0x5840d7[_0x1a32('0x27')]){if(_0x5840d7[_0x1a32('0x27')][_0x1a32('0x28')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2b8171,_0x5840d7['error'][_0x1a32('0x29')]);return _0x35b296(_0x5840d7[_0x1a32('0x27')]['message']);}logger[_0x1a32('0x27')](_0x1a32('0x23'),_0x2b8171,_0x5840d7[_0x1a32('0x27')][_0x1a32('0x29')]);return _0x4fece3(_0x5840d7['error'][_0x1a32('0x29')]);}else{logger[_0x1a32('0x22')](_0x1a32('0x23'),_0x2b8171,_0x1a32('0x24'));_0x4fece3(_0x5840d7[_0x1a32('0x2a')][_0x1a32('0x29')]);}})[_0x1a32('0x2b')](function(_0x4834b6){logger['error'](_0x1a32('0x23'),_0x2b8171,_0x4834b6);_0x35b296(_0x4834b6);});});}function respondWithStatusCode(_0x551a07,_0x58dcf3){_0x58dcf3=_0x58dcf3||0xcc;return function(_0x15ceb2){if(_0x15ceb2){return _0x551a07['sendStatus'](_0x58dcf3);}return _0x551a07['status'](_0x58dcf3)[_0x1a32('0x2c')]();};}function respondWithResult(_0x4bd954,_0x1a5de0){_0x1a5de0=_0x1a5de0||0xc8;return function(_0x1a5e17){if(_0x1a5e17){return _0x4bd954[_0x1a32('0x2d')](_0x1a5de0)[_0x1a32('0x2e')](_0x1a5e17);}};}function respondWithFilteredResult(_0x39fd3e,_0x876cda){return function(_0x326c92){if(_0x326c92){var _0x414c96=typeof _0x876cda[_0x1a32('0x2f')]===_0x1a32('0x30')&&typeof _0x876cda['limit']===_0x1a32('0x30');var _0x566a79=_0x326c92['count'];var _0x16e45c=_0x414c96?0x0:_0x876cda[_0x1a32('0x2f')];var _0x32039c=_0x414c96?_0x326c92[_0x1a32('0x31')]:_0x876cda[_0x1a32('0x2f')]+_0x876cda['limit'];var _0x3dbba8;if(_0x32039c>=_0x566a79){_0x32039c=_0x566a79;_0x3dbba8=0xc8;}else{_0x3dbba8=0xce;}_0x39fd3e[_0x1a32('0x2d')](_0x3dbba8);return _0x39fd3e['set']('Content-Range',_0x16e45c+'-'+_0x32039c+'/'+_0x566a79)['json'](_0x326c92);}return null;};}function patchUpdates(_0x44bdc7){return function(_0x306f0e){try{jsonpatch['apply'](_0x306f0e,_0x44bdc7,!![]);}catch(_0x23c614){return BPromise[_0x1a32('0x32')](_0x23c614);}return _0x306f0e[_0x1a32('0x33')]();};}function saveUpdates(_0x54addc,_0xa34cde){return function(_0x272b8a){if(_0x272b8a){return _0x272b8a['update'](_0x54addc)[_0x1a32('0x21')](function(_0x27f080){return _0x27f080;});}return null;};}function removeEntity(_0x591479,_0x1e6091){return function(_0x1e5757){if(_0x1e5757){return _0x1e5757[_0x1a32('0x34')]()[_0x1a32('0x21')](function(){var _0x377669=_0x1e5757[_0x1a32('0x35')]({'plain':!![]});var _0x3d3d81=_0x1a32('0x36');return db[_0x1a32('0x37')][_0x1a32('0x34')]({'where':{'type':_0x3d3d81,'resourceId':_0x377669['id']}})[_0x1a32('0x21')](function(){return _0x1e5757;});})[_0x1a32('0x21')](function(){_0x591479['status'](0xcc)[_0x1a32('0x2c')]();});}};}function handleEntityNotFound(_0x39a07d,_0x488013){return function(_0x395b20){if(!_0x395b20){_0x39a07d[_0x1a32('0x38')](0x194);}return _0x395b20;};}function handleError(_0x1cb978,_0x4cf371){_0x4cf371=_0x4cf371||0x1f4;return function(_0x4b9784){logger['error'](_0x4b9784[_0x1a32('0x39')]);if(_0x4b9784[_0x1a32('0x3a')]){delete _0x4b9784[_0x1a32('0x3a')];}_0x1cb978[_0x1a32('0x2d')](_0x4cf371)['send'](_0x4b9784);};}exports[_0x1a32('0x3b')]=function(_0x143377,_0x41525e){var _0x127971={'include':[{'model':db['Pause'],'as':_0x1a32('0x3c')}]},_0x2e9cf1={},_0x460ec6={'count':0x0,'rows':[]};var _0x4407b1=_['map'](db[_0x1a32('0x3d')][_0x1a32('0x3e')],function(_0x16f1f6){return{'name':_0x16f1f6[_0x1a32('0x3f')],'type':_0x16f1f6['type']['key']};});_0x2e9cf1[_0x1a32('0x40')]=_[_0x1a32('0x41')](_0x4407b1,'name');_0x2e9cf1[_0x1a32('0x42')]=_[_0x1a32('0x43')](_0x143377[_0x1a32('0x42')]);_0x2e9cf1[_0x1a32('0x44')]=_[_0x1a32('0x45')](_0x2e9cf1[_0x1a32('0x40')],_0x2e9cf1['query']);_0x127971[_0x1a32('0x46')]=_[_0x1a32('0x45')](_0x2e9cf1['model'],qs[_0x1a32('0x47')](_0x143377[_0x1a32('0x42')]['fields']));_0x127971[_0x1a32('0x46')]=_0x127971[_0x1a32('0x46')][_0x1a32('0x48')]?_0x127971['attributes']:_0x2e9cf1['model'];if(!_0x143377[_0x1a32('0x42')][_0x1a32('0x49')]('nolimit')){_0x127971[_0x1a32('0x4a')]=qs[_0x1a32('0x4a')](_0x143377[_0x1a32('0x42')]['limit']);_0x127971[_0x1a32('0x2f')]=qs['offset'](_0x143377['query'][_0x1a32('0x2f')]);}_0x127971[_0x1a32('0x4b')]=qs[_0x1a32('0x4c')](_0x143377[_0x1a32('0x42')][_0x1a32('0x4c')]);_0x127971[_0x1a32('0x4d')]=qs['filters'](_['pick'](_0x143377[_0x1a32('0x42')],_0x2e9cf1[_0x1a32('0x44')]),_0x4407b1);if(_0x143377[_0x1a32('0x42')][_0x1a32('0x4e')]){_0x127971[_0x1a32('0x4d')]=_[_0x1a32('0x4f')](_0x127971[_0x1a32('0x4d')],{'$or':_[_0x1a32('0x41')](_0x4407b1,function(_0x4857d6){if(_0x4857d6['type']!=='VIRTUAL'){var _0x2e9756={};_0x2e9756[_0x4857d6[_0x1a32('0x3a')]]={'$like':'%'+_0x143377['query'][_0x1a32('0x4e')]+'%'};return _0x2e9756;}})});}_0x127971=_[_0x1a32('0x4f')]({},_0x127971,_0x143377['options']);var _0x113630={'where':_0x127971[_0x1a32('0x4d')]};return db[_0x1a32('0x3d')][_0x1a32('0x31')](_0x113630)[_0x1a32('0x21')](function(_0x492e8b){_0x460ec6['count']=_0x492e8b;if(_0x143377[_0x1a32('0x42')][_0x1a32('0x50')]){_0x127971['include']=[{'all':!![]}];}return db[_0x1a32('0x3d')][_0x1a32('0x51')](_0x127971);})[_0x1a32('0x21')](function(_0x1872ab){_0x460ec6[_0x1a32('0x52')]=_0x1872ab;return _0x460ec6;})['then'](respondWithFilteredResult(_0x41525e,_0x127971))[_0x1a32('0x2b')](handleError(_0x41525e,null));};exports['show']=function(_0x19f269,_0x2c549e){var _0x1356b2={'raw':![],'where':{'id':_0x19f269[_0x1a32('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x1a32('0x3c')}]},_0x1b19e2={};_0x1b19e2[_0x1a32('0x40')]=_[_0x1a32('0x43')](db[_0x1a32('0x3d')][_0x1a32('0x3e')]);_0x1b19e2[_0x1a32('0x42')]=_['keys'](_0x19f269['query']);_0x1b19e2[_0x1a32('0x44')]=_['intersection'](_0x1b19e2[_0x1a32('0x40')],_0x1b19e2[_0x1a32('0x42')]);_0x1356b2[_0x1a32('0x46')]=_[_0x1a32('0x45')](_0x1b19e2['model'],qs['fields'](_0x19f269[_0x1a32('0x42')][_0x1a32('0x47')]));_0x1356b2[_0x1a32('0x46')]=_0x1356b2[_0x1a32('0x46')][_0x1a32('0x48')]?_0x1356b2[_0x1a32('0x46')]:_0x1b19e2[_0x1a32('0x40')];if(_0x19f269[_0x1a32('0x42')][_0x1a32('0x50')]){_0x1356b2[_0x1a32('0x54')]=[{'all':!![]}];}_0x1356b2=_['merge']({},_0x1356b2,_0x19f269[_0x1a32('0x55')]);return db[_0x1a32('0x3d')][_0x1a32('0x56')](_0x1356b2)['then'](handleEntityNotFound(_0x2c549e,null))[_0x1a32('0x21')](respondWithResult(_0x2c549e,null))[_0x1a32('0x2b')](handleError(_0x2c549e,null));};exports['create']=function(_0x3e5c8b,_0x58aea3){return db[_0x1a32('0x3d')][_0x1a32('0x57')](_0x3e5c8b[_0x1a32('0x58')],{})[_0x1a32('0x21')](function(_0xccc17a){var _0x47f300=_0x3e5c8b[_0x1a32('0x59')][_0x1a32('0x35')]({'plain':!![]});if(!_0x47f300)throw new Error(_0x1a32('0x5a'));if(_0x47f300[_0x1a32('0x5b')]===_0x1a32('0x59')){var _0x5ee03f=_0xccc17a[_0x1a32('0x35')]({'plain':!![]});var _0x2d485f=_0x1a32('0x36');return db['UserProfileSection'][_0x1a32('0x56')]({'where':{'name':_0x2d485f,'userProfileId':_0x47f300[_0x1a32('0x5c')]},'raw':!![]})[_0x1a32('0x21')](function(_0x54a716){if(_0x54a716&&_0x54a716[_0x1a32('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5ee03f[_0x1a32('0x3a')],'resourceId':_0x5ee03f['id'],'type':_0x54a716[_0x1a32('0x3a')],'sectionId':_0x54a716['id']},{})['then'](function(){return _0xccc17a;});}else{return _0xccc17a;}})[_0x1a32('0x2b')](function(_0x5a0833){logger[_0x1a32('0x27')](_0x1a32('0x5e'),_0x5a0833);throw _0x5a0833;});}return _0xccc17a;})[_0x1a32('0x21')](respondWithResult(_0x58aea3,0xc9))['catch'](handleError(_0x58aea3,null));};exports[_0x1a32('0x5f')]=function(_0x352386,_0x3594de){if(_0x352386[_0x1a32('0x58')]['id']){delete _0x352386['body']['id'];}return db['SmsAccount'][_0x1a32('0x56')]({'where':{'id':_0x352386[_0x1a32('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x1a32('0x3c')}]})[_0x1a32('0x21')](handleEntityNotFound(_0x3594de,null))[_0x1a32('0x21')](saveUpdates(_0x352386['body'],null))['then'](respondWithResult(_0x3594de,null))['catch'](handleError(_0x3594de,null));};exports[_0x1a32('0x34')]=function(_0x5bf8d9,_0x2a1bd8){return db[_0x1a32('0x3d')]['find']({'where':{'id':_0x5bf8d9[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x2a1bd8,null))[_0x1a32('0x21')](removeEntity(_0x2a1bd8,null))[_0x1a32('0x2b')](handleError(_0x2a1bd8,null));};exports['describe']=function(_0x24d18b,_0xfc0c5){return db['SmsAccount']['describe']()[_0x1a32('0x21')](respondWithResult(_0xfc0c5,null))[_0x1a32('0x2b')](handleError(_0xfc0c5,null));};exports[_0x1a32('0x60')]=function(_0x3828b8,_0x2b9797,_0x3b8408){if(_0x3828b8['body']['id']){delete _0x3828b8[_0x1a32('0x58')]['id'];}return db[_0x1a32('0x3d')][_0x1a32('0x56')]({'where':{'id':_0x3828b8[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x2b9797,null))['then'](function(_0x540cf9){if(_0x540cf9){_0x3828b8[_0x1a32('0x58')]['SmsAccountId']=_0x540cf9['id'];return db['Disposition'][_0x1a32('0x57')](_0x3828b8[_0x1a32('0x58')]);}})[_0x1a32('0x21')](respondWithResult(_0x2b9797,null))[_0x1a32('0x2b')](handleError(_0x2b9797,null));};exports[_0x1a32('0x61')]=function(_0x5232e,_0x32c104,_0x123f8e){var _0x26aafb={'raw':![],'where':{}};var _0x17c801={};var _0x387632={'count':0x0,'rows':[]};return db[_0x1a32('0x3d')]['findOne']({'where':{'id':_0x5232e[_0x1a32('0x53')]['id']}})['then'](handleEntityNotFound(_0x32c104,null))['then'](function(_0x4f6bdb){if(_0x4f6bdb){_0x17c801[_0x1a32('0x40')]=_[_0x1a32('0x43')](db[_0x1a32('0x62')]['rawAttributes']);_0x17c801[_0x1a32('0x42')]=_[_0x1a32('0x43')](_0x5232e[_0x1a32('0x42')]);_0x17c801[_0x1a32('0x44')]=_[_0x1a32('0x45')](_0x17c801[_0x1a32('0x40')],_0x17c801[_0x1a32('0x42')]);_0x26aafb[_0x1a32('0x46')]=_[_0x1a32('0x45')](_0x17c801[_0x1a32('0x40')],qs[_0x1a32('0x47')](_0x5232e['query'][_0x1a32('0x47')]));_0x26aafb['attributes']=_0x26aafb[_0x1a32('0x46')][_0x1a32('0x48')]?_0x26aafb[_0x1a32('0x46')]:_0x17c801[_0x1a32('0x40')];if(!_0x5232e[_0x1a32('0x42')][_0x1a32('0x49')](_0x1a32('0x63'))){_0x26aafb[_0x1a32('0x4a')]=qs[_0x1a32('0x4a')](_0x5232e[_0x1a32('0x42')]['limit']);_0x26aafb['offset']=qs[_0x1a32('0x2f')](_0x5232e[_0x1a32('0x42')][_0x1a32('0x2f')]);}_0x26aafb[_0x1a32('0x4b')]=qs['sort'](_0x5232e[_0x1a32('0x42')][_0x1a32('0x4c')]);_0x26aafb[_0x1a32('0x4d')]=qs[_0x1a32('0x44')](_[_0x1a32('0x64')](_0x5232e[_0x1a32('0x42')],_0x17c801[_0x1a32('0x44')]));_0x26aafb['where'][_0x1a32('0x65')]=_0x4f6bdb['id'];if(_0x5232e[_0x1a32('0x42')][_0x1a32('0x4e')]){_0x26aafb[_0x1a32('0x4d')]=_[_0x1a32('0x4f')](_0x26aafb[_0x1a32('0x4d')],{'$or':_[_0x1a32('0x41')](_0x26aafb[_0x1a32('0x46')],function(_0x329379){var _0x30c4d2={};_0x30c4d2[_0x329379]={'$like':'%'+_0x5232e[_0x1a32('0x42')][_0x1a32('0x4e')]+'%'};return _0x30c4d2;})});}_0x26aafb=_['merge']({},_0x26aafb,_0x5232e['options']);return db[_0x1a32('0x62')][_0x1a32('0x31')]({'where':_0x26aafb[_0x1a32('0x4d')]})[_0x1a32('0x21')](function(_0x48d68a){_0x387632[_0x1a32('0x31')]=_0x48d68a;if(_0x5232e['query']['includeAll']){_0x26aafb[_0x1a32('0x54')]=[{'all':!![]}];}return db[_0x1a32('0x62')][_0x1a32('0x51')](_0x26aafb);})['then'](function(_0x29ccd6){_0x387632[_0x1a32('0x52')]=_0x29ccd6;return _0x387632;});}})['then'](respondWithFilteredResult(_0x32c104,_0x26aafb))[_0x1a32('0x2b')](handleError(_0x32c104,null));};exports['removeDispositions']=function(_0x36dff4,_0x5000b7,_0x5cef4f){return db[_0x1a32('0x3d')][_0x1a32('0x56')]({'where':{'id':_0x36dff4[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x5000b7,null))[_0x1a32('0x21')](function(_0x1def58){if(_0x1def58){return _0x1def58[_0x1a32('0x66')](_0x36dff4[_0x1a32('0x42')]['ids']);}})[_0x1a32('0x21')](respondWithStatusCode(_0x5000b7,null))[_0x1a32('0x2b')](handleError(_0x5000b7,null));};exports[_0x1a32('0x67')]=function(_0x5694a6,_0x3b8feb,_0x29ae04){if(_0x5694a6['body']['id']){delete _0x5694a6['body']['id'];}return db[_0x1a32('0x3d')]['find']({'where':{'id':_0x5694a6['params']['id']}})['then'](handleEntityNotFound(_0x3b8feb,null))['then'](function(_0x459dec){if(_0x459dec){_0x5694a6[_0x1a32('0x58')][_0x1a32('0x65')]=_0x459dec['id'];return db[_0x1a32('0x68')][_0x1a32('0x57')](_0x5694a6[_0x1a32('0x58')]);}})[_0x1a32('0x21')](respondWithResult(_0x3b8feb,null))[_0x1a32('0x2b')](handleError(_0x3b8feb,null));};exports['getAnswers']=function(_0x442906,_0x44e8cd,_0x5aa8da){var _0x41d5b6={'raw':![],'where':{}};var _0x6de6a3={};var _0x30b006={'count':0x0,'rows':[]};return db[_0x1a32('0x3d')]['findOne']({'where':{'id':_0x442906['params']['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x44e8cd,null))[_0x1a32('0x21')](function(_0x2074eb){if(_0x2074eb){_0x6de6a3[_0x1a32('0x40')]=_[_0x1a32('0x43')](db[_0x1a32('0x68')][_0x1a32('0x3e')]);_0x6de6a3[_0x1a32('0x42')]=_['keys'](_0x442906[_0x1a32('0x42')]);_0x6de6a3[_0x1a32('0x44')]=_[_0x1a32('0x45')](_0x6de6a3[_0x1a32('0x40')],_0x6de6a3[_0x1a32('0x42')]);_0x41d5b6[_0x1a32('0x46')]=_[_0x1a32('0x45')](_0x6de6a3['model'],qs[_0x1a32('0x47')](_0x442906[_0x1a32('0x42')][_0x1a32('0x47')]));_0x41d5b6[_0x1a32('0x46')]=_0x41d5b6[_0x1a32('0x46')][_0x1a32('0x48')]?_0x41d5b6[_0x1a32('0x46')]:_0x6de6a3['model'];if(!_0x442906[_0x1a32('0x42')][_0x1a32('0x49')](_0x1a32('0x63'))){_0x41d5b6[_0x1a32('0x4a')]=qs[_0x1a32('0x4a')](_0x442906[_0x1a32('0x42')][_0x1a32('0x4a')]);_0x41d5b6['offset']=qs[_0x1a32('0x2f')](_0x442906[_0x1a32('0x42')]['offset']);}_0x41d5b6['order']=qs[_0x1a32('0x4c')](_0x442906['query']['sort']);_0x41d5b6['where']=qs[_0x1a32('0x44')](_['pick'](_0x442906['query'],_0x6de6a3[_0x1a32('0x44')]));_0x41d5b6[_0x1a32('0x4d')][_0x1a32('0x65')]=_0x2074eb['id'];if(_0x442906['query']['filter']){_0x41d5b6[_0x1a32('0x4d')]=_['merge'](_0x41d5b6['where'],{'$or':_['map'](_0x41d5b6[_0x1a32('0x46')],function(_0x20b8ed){var _0x5aadeb={};_0x5aadeb[_0x20b8ed]={'$like':'%'+_0x442906[_0x1a32('0x42')][_0x1a32('0x4e')]+'%'};return _0x5aadeb;})});}_0x41d5b6=_[_0x1a32('0x4f')]({},_0x41d5b6,_0x442906['options']);return db[_0x1a32('0x68')]['count']({'where':_0x41d5b6[_0x1a32('0x4d')]})[_0x1a32('0x21')](function(_0x467036){_0x30b006['count']=_0x467036;if(_0x442906[_0x1a32('0x42')]['includeAll']){_0x41d5b6[_0x1a32('0x54')]=[{'all':!![]}];}return db[_0x1a32('0x68')]['findAll'](_0x41d5b6);})[_0x1a32('0x21')](function(_0x1fab28){_0x30b006[_0x1a32('0x52')]=_0x1fab28;return _0x30b006;});}})[_0x1a32('0x21')](respondWithFilteredResult(_0x44e8cd,_0x41d5b6))['catch'](handleError(_0x44e8cd,null));};exports[_0x1a32('0x69')]=function(_0x11a7bd,_0x56942d,_0x7d8a98){return db[_0x1a32('0x3d')][_0x1a32('0x56')]({'where':{'id':_0x11a7bd[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x56942d,null))['then'](function(_0x411c31){if(_0x411c31){return _0x411c31[_0x1a32('0x69')](_0x11a7bd[_0x1a32('0x42')][_0x1a32('0x6a')]);}})[_0x1a32('0x21')](respondWithStatusCode(_0x56942d,null))['catch'](handleError(_0x56942d,null));};exports[_0x1a32('0x6b')]=function(_0x151d55,_0x5c41c7,_0x507a73){var _0x19066d={'channel':_0x1a32('0x6c')};var _0x175d6a=[];var _0x26cca8=[];var _0x465aa2={};return db['SmsAccount']['find']({'where':{'id':_0x151d55['params']['id']},'include':[{'model':db[_0x1a32('0x6d')],'as':_0x1a32('0x6e')}]})[_0x1a32('0x21')](handleEntityNotFound(_0x5c41c7,null))[_0x1a32('0x21')](function(_0x3116f0){_0x19066d['account']=_0x3116f0;_0x19066d[_0x1a32('0x6f')]=_[_0x1a32('0x70')](_0x3116f0[_0x1a32('0x6e')],[_0x1a32('0x71')],[_0x1a32('0x72')]);if(_0x19066d[_0x1a32('0x73')]['Applications']){delete _0x19066d[_0x1a32('0x73')][_0x1a32('0x6e')];}return db[_0x1a32('0x74')][_0x1a32('0x75')]();})[_0x1a32('0x21')](function(_0x11d417){if(!_0x11d417){throw new db['Sequelize'][(_0x1a32('0x76'))](_0x1a32('0x77'));}_0x175d6a=_['difference'](_[_0x1a32('0x43')](_0x11d417),[_0x1a32('0x78'),_0x1a32('0x79')]);_0x26cca8=_[_0x1a32('0x7a')](_[_0x1a32('0x43')](_0x11d417),[_0x1a32('0x78'),_0x1a32('0x79'),_0x1a32('0x7b'),_0x1a32('0x7c')]);_0x19066d[_0x1a32('0x58')]={'mapKey':_0x1a32('0x7d')};if(_0x19066d[_0x1a32('0x73')][_0x1a32('0x7e')]){switch(_0x19066d[_0x1a32('0x73')][_0x1a32('0x7e')]){case'twilio':_0x19066d[_0x1a32('0x58')]['from']=_0x151d55[_0x1a32('0x58')][_0x1a32('0x7f')];_0x19066d[_0x1a32('0x58')][_0x1a32('0x58')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x80')];_0x19066d[_0x1a32('0x58')][_0x1a32('0x81')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x82')];break;case'skebby':_0x19066d['body'][_0x1a32('0x83')]='+'+_0x151d55[_0x1a32('0x58')][_0x1a32('0x84')];_0x19066d['body']['body']=_0x151d55['body'][_0x1a32('0x85')];break;case'connectel':_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x83')];_0x19066d['body'][_0x1a32('0x58')]=_0x151d55['body'][_0x1a32('0x29')];break;case _0x1a32('0x86'):_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x83')];_0x19066d['body']['body']=_0x151d55['body'][_0x1a32('0x58')];_0x19066d[_0x1a32('0x58')]['messageId']=_0x151d55[_0x1a32('0x58')]['message_id'];break;case _0x1a32('0x87'):_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x7f')];_0x19066d[_0x1a32('0x58')][_0x1a32('0x58')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x88')];_0x19066d[_0x1a32('0x58')][_0x1a32('0x81')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x89')];break;case _0x1a32('0x8a'):_0x19066d['body']['from']='+'+_0x151d55[_0x1a32('0x58')][_0x1a32('0x8b')][0x0]['from'];_0x19066d[_0x1a32('0x58')][_0x1a32('0x58')]=_0x151d55[_0x1a32('0x58')]['results'][0x0][_0x1a32('0x85')];_0x19066d['body'][_0x1a32('0x81')]=_0x151d55[_0x1a32('0x58')]['results'][0x0][_0x1a32('0x81')];break;case _0x1a32('0x8c'):_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x8d')];_0x19066d['body'][_0x1a32('0x58')]=_0x151d55['body']['segmentedMessage'][_0x1a32('0x29')];break;case _0x1a32('0x8e'):_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x8f')];_0x19066d[_0x1a32('0x58')][_0x1a32('0x58')]=_0x151d55['body'][_0x1a32('0x85')];_0x19066d[_0x1a32('0x58')][_0x1a32('0x81')]=_0x151d55['body'][_0x1a32('0x90')];break;case'bandwidth':_0x19066d[_0x1a32('0x58')][_0x1a32('0x81')]=_0x151d55[_0x1a32('0x58')][0x0][_0x1a32('0x29')]['id'];_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')]=_0x151d55[_0x1a32('0x58')][0x0]['message'][_0x1a32('0x83')];_0x19066d[_0x1a32('0x58')][_0x1a32('0x58')]=_0x151d55[_0x1a32('0x58')][0x0][_0x1a32('0x29')][_0x1a32('0x85')];break;case _0x1a32('0x91'):_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')]=_0x151d55[_0x1a32('0x58')][_0x1a32('0x83')];_0x19066d[_0x1a32('0x58')]['body']=_0x151d55[_0x1a32('0x58')][_0x1a32('0x29')];_0x19066d['body'][_0x1a32('0x81')]=_0x151d55[_0x1a32('0x58')]['refid'];break;}}if(_0x19066d['body']['id']){delete _0x19066d[_0x1a32('0x58')]['id'];}if(_[_0x1a32('0x92')](_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')])){throw new db['Sequelize'][(_0x1a32('0x76'))]('from\x20is\x20mandatory');}if(_[_0x1a32('0x92')](_0x19066d[_0x1a32('0x58')]['body'])||_0x19066d['body'][_0x1a32('0x58')]===''){throw new db[(_0x1a32('0x93'))][(_0x1a32('0x76'))](_0x1a32('0x94'));}if(_['isNil'](_0x19066d[_0x1a32('0x58')]['mapKey'])){throw new db[(_0x1a32('0x93'))][(_0x1a32('0x76'))](_0x1a32('0x95')+_0x26cca8);}if(!_['includes'](_0x26cca8,_0x19066d[_0x1a32('0x58')][_0x1a32('0x96')])){throw new db['Sequelize'][(_0x1a32('0x76'))](_0x1a32('0x97')+_0x26cca8);}_0x465aa2[_0x19066d[_0x1a32('0x58')][_0x1a32('0x96')]]=_0x19066d['body'][_0x1a32('0x83')];return db[_0x1a32('0x98')][_0x1a32('0x56')]({'where':{'id':_0x19066d[_0x1a32('0x73')][_0x1a32('0x7c')]},'include':[{'model':db[_0x1a32('0x74')],'as':_0x1a32('0x99'),'where':_0x465aa2,'limit':0x1,'order':[[_0x1a32('0x79'),_0x1a32('0x9a')]]}]});})[_0x1a32('0x21')](handleEntityNotFound(_0x5c41c7,null))[_0x1a32('0x21')](function(_0x4255dd){if(_0x4255dd){_0x19066d[_0x1a32('0x9b')]=_[_0x1a32('0x9c')](_0x4255dd,['Contacts']);if(_0x4255dd['Contacts'][_0x1a32('0x48')]){return _0x4255dd[_0x1a32('0x99')][0x0];}var _0x58d7df=_[_0x1a32('0x1a')](_0x19066d[_0x1a32('0x58')],{'firstName':_0x19066d['body'][_0x1a32('0x83')],'ListId':_0x4255dd['id']});_0x58d7df[_0x19066d['body']['mapKey']]=_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')];return db[_0x1a32('0x74')]['create'](_0x58d7df,{'fields':_0x175d6a,'raw':!![]});}})[_0x1a32('0x21')](handleEntityNotFound(_0x5c41c7,null))['then'](function(_0x572ff9){if(_0x572ff9){_0x19066d[_0x1a32('0x9d')]=_0x572ff9;var _0x52b19d={'ContactId':_0x572ff9['id'],'phone':_0x19066d[_0x1a32('0x58')][_0x1a32('0x83')],'SmsAccountId':_0x151d55['params']['id']};var _0x188bf4={'ContactId':_0x572ff9['id'],'SmsAccountId':_0x151d55[_0x1a32('0x53')]['id'],'closed':![]};return db[_0x1a32('0x9e')][_0x1a32('0x56')]({'where':_0x188bf4})[_0x1a32('0x21')](function(_0x28614c){if(_0x28614c){return[_0x28614c,![]];}return db[_0x1a32('0x9e')][_0x1a32('0x57')](_0x52b19d)[_0x1a32('0x21')](function(_0xe4daa4){return[_0xe4daa4,!![]];});});}})[_0x1a32('0x9f')](function(_0x14f4e8,_0x290de9){_0x19066d['interaction']=_0x14f4e8[_0x1a32('0x35')]({'plain':!![]});_0x19066d[_0x1a32('0xa0')][_0x1a32('0xa1')]=![];if(_0x290de9){if(_0x19066d[_0x1a32('0x73')]['autoclose']){_0x19066d[_0x1a32('0x6f')][_0x1a32('0xa2')]({'id':0x0,'priority':_0x19066d[_0x1a32('0x6f')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x1a32('0xa3')});}_0x19066d[_0x1a32('0xa0')][_0x1a32('0xa1')]=!![];}return db[_0x1a32('0xa4')][_0x1a32('0x57')]({'phone':_0x19066d[_0x1a32('0x58')]['from'],'messageId':_0x19066d[_0x1a32('0x58')][_0x1a32('0x81')],'body':_0x19066d['body']['body'],'SmsAccountId':_0x151d55[_0x1a32('0x53')]['id'],'SmsInteractionId':_0x14f4e8['id'],'direction':'in','ContactId':_0x14f4e8[_0x1a32('0xa5')],'AttachmentId':_0x19066d['body']['AttachmentId']});})[_0x1a32('0x21')](function(_0x532b06){_0x19066d[_0x1a32('0x29')]=_0x532b06;if(_0x19066d[_0x1a32('0xa0')]['UserId']){return db[_0x1a32('0xa6')][_0x1a32('0x56')]({'attributes':['id',_0x1a32('0x3a')],'where':{'id':_0x19066d[_0x1a32('0xa0')][_0x1a32('0xa7')]}})['then'](function(_0x458627){if(_0x458627){_0x19066d[_0x1a32('0x6f')][_0x1a32('0xa8')]({'id':0x0,'priority':0x0,'app':_0x1a32('0xa9'),'appdata':_0x458627[_0x1a32('0x3a')]+','+(_0x19066d['account']['waitForTheAssignedAgent']||0xa),'interval':_0x1a32('0xa3')});}return respondWithRpcPromise('Start',_0x1a32('0xaa'),_0x19066d);});}return respondWithRpcPromise(_0x1a32('0xab'),_0x1a32('0xaa'),_0x19066d);})[_0x1a32('0x21')](function(_0x3e6fa8){if(_0x3e6fa8){var _0x544517=0xc8;var _0x280e84=_0x1a32('0xac');logger['info'](_0x1a32('0x25'),_0x280e84,_0x544517,_0x1a32('0xad'));logger[_0x1a32('0xae')](_0x1a32('0xaf'),_0x280e84,_0x544517,_0x1a32('0xad'),JSON[_0x1a32('0x26')](_0x3e6fa8));if(_0x19066d['account'][_0x1a32('0x7e')]===_0x1a32('0xb0')){return _0x5c41c7[_0x1a32('0x2d')](_0x544517)[_0x1a32('0xb1')]('Content-Type','text/xml')[_0x1a32('0xb2')](_0x1a32('0xb3'));}else{return _0x5c41c7['status'](_0x544517)[_0x1a32('0x2e')](_0x3e6fa8);}}})['catch'](handleError(_0x5c41c7,null));};exports[_0x1a32('0xb4')]=function(_0x20f120,_0x3f272f,_0x5df2df){return db[_0x1a32('0x3d')][_0x1a32('0xb5')]({'where':{'id':_0x20f120[_0x1a32('0x53')]['id']}})['then'](handleEntityNotFound(_0x3f272f,null))[_0x1a32('0x21')](function(_0x47dfae){if(_0x47dfae){return db['sequelize'][_0x1a32('0xb6')](function(_0x3208fc){return db[_0x1a32('0x6d')][_0x1a32('0x34')]({'where':{'SmsAccountId':_0x20f120['params']['id']},'transaction':_0x3208fc})['then'](function(_0x1506db){var _0x83030e=_[_0x1a32('0x41')](_0x20f120[_0x1a32('0x58')],function(_0x4e4a09){_0x4e4a09[_0x1a32('0x65')]=_0x20f120[_0x1a32('0x53')]['id'];return _0x4e4a09;});return db[_0x1a32('0x6d')]['bulkCreate'](_0x83030e,{'transaction':_0x3208fc});});})[_0x1a32('0x21')](function(){return db[_0x1a32('0x6d')][_0x1a32('0xb7')]({'where':{'SmsAccountId':_0x20f120[_0x1a32('0x53')]['id']},'order':_0x1a32('0x71')});});}})['then'](respondWithResult(_0x3f272f,null))[_0x1a32('0x2b')](handleError(_0x3f272f,null));};exports[_0x1a32('0xb8')]=function(_0x1ad474,_0x3c6c89,_0x4d88f0){var _0xae94e7={};var _0x2c972f={};var _0x389865;var _0x4f1e85;return db[_0x1a32('0x3d')][_0x1a32('0xb5')]({'where':{'id':_0x1ad474[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x3c6c89,null))[_0x1a32('0x21')](function(_0xa3c808){if(_0xa3c808){_0x389865=_0xa3c808;_0x2c972f[_0x1a32('0x40')]=_['keys'](db['SmsApplication'][_0x1a32('0x3e')]);_0x2c972f[_0x1a32('0x42')]=_['keys'](_0x1ad474[_0x1a32('0x42')]);_0x2c972f['filters']=_['intersection'](_0x2c972f[_0x1a32('0x40')],_0x2c972f[_0x1a32('0x42')]);_0xae94e7[_0x1a32('0x46')]=_['intersection'](_0x2c972f[_0x1a32('0x40')],qs[_0x1a32('0x47')](_0x1ad474[_0x1a32('0x42')][_0x1a32('0x47')]));_0xae94e7[_0x1a32('0x46')]=_0xae94e7[_0x1a32('0x46')][_0x1a32('0x48')]?_0xae94e7[_0x1a32('0x46')]:_0x2c972f[_0x1a32('0x40')];_0xae94e7[_0x1a32('0x4b')]=qs[_0x1a32('0x4c')](_0x1ad474['query'][_0x1a32('0x4c')]);_0xae94e7[_0x1a32('0x4d')]=qs[_0x1a32('0x44')](_[_0x1a32('0x64')](_0x1ad474[_0x1a32('0x42')],_0x2c972f['filters']));if(_0x1ad474[_0x1a32('0x42')][_0x1a32('0x4e')]){_0xae94e7[_0x1a32('0x4d')]=_[_0x1a32('0x4f')](_0xae94e7['where'],{'$or':_[_0x1a32('0x41')](_0xae94e7['attributes'],function(_0x187565){var _0x59c750={};_0x59c750[_0x187565]={'$like':'%'+_0x1ad474[_0x1a32('0x42')][_0x1a32('0x4e')]+'%'};return _0x59c750;})});}_0xae94e7=_[_0x1a32('0x4f')]({},_0xae94e7,_0x1ad474[_0x1a32('0x55')]);return _0x389865[_0x1a32('0xb8')](_0xae94e7);}})['then'](function(_0x2ecd62){if(_0x2ecd62){_0x4f1e85=_0x2ecd62[_0x1a32('0x48')];if(!_0x1ad474[_0x1a32('0x42')][_0x1a32('0x49')](_0x1a32('0x63'))){_0xae94e7['limit']=qs[_0x1a32('0x4a')](_0x1ad474[_0x1a32('0x42')][_0x1a32('0x4a')]);_0xae94e7['offset']=qs[_0x1a32('0x2f')](_0x1ad474[_0x1a32('0x42')][_0x1a32('0x2f')]);}return _0x389865[_0x1a32('0xb8')](_0xae94e7);}})[_0x1a32('0x21')](function(_0x46def7){if(_0x46def7){return _0x46def7?{'count':_0x4f1e85,'rows':_0x46def7}:null;}})['then'](respondWithResult(_0x3c6c89,null))[_0x1a32('0x2b')](handleError(_0x3c6c89,null));};exports['getInteractions']=function(_0x110d29,_0x372c28,_0x3d9b7b){var _0x5223d1={'raw':![],'where':{}};var _0x45aee2={};var _0x22cd6e={'count':0x0,'rows':[]};return db['SmsAccount'][_0x1a32('0xb5')]({'where':{'id':_0x110d29[_0x1a32('0x53')]['id']}})['then'](handleEntityNotFound(_0x372c28,null))[_0x1a32('0x21')](function(_0x3490c8){if(_0x3490c8){_0x45aee2[_0x1a32('0x40')]=_[_0x1a32('0x43')](db[_0x1a32('0x9e')][_0x1a32('0x3e')]);_0x45aee2[_0x1a32('0x42')]=_['keys'](_0x110d29[_0x1a32('0x42')]);_0x45aee2[_0x1a32('0x44')]=_[_0x1a32('0x45')](_0x45aee2[_0x1a32('0x40')],_0x45aee2['query']);_0x5223d1['attributes']=_['intersection'](_0x45aee2[_0x1a32('0x40')],qs[_0x1a32('0x47')](_0x110d29[_0x1a32('0x42')]['fields']));_0x5223d1[_0x1a32('0x46')]=_0x5223d1[_0x1a32('0x46')][_0x1a32('0x48')]?_0x5223d1[_0x1a32('0x46')]:_0x45aee2['model'];if(!_0x110d29[_0x1a32('0x42')][_0x1a32('0x49')]('nolimit')){_0x5223d1['limit']=qs[_0x1a32('0x4a')](_0x110d29[_0x1a32('0x42')][_0x1a32('0x4a')]);_0x5223d1[_0x1a32('0x2f')]=qs[_0x1a32('0x2f')](_0x110d29[_0x1a32('0x42')][_0x1a32('0x2f')]);}_0x5223d1[_0x1a32('0x4b')]=qs['sort'](_0x110d29[_0x1a32('0x42')][_0x1a32('0x4c')]);_0x5223d1[_0x1a32('0x4d')]=qs[_0x1a32('0x44')](_[_0x1a32('0x64')](_0x110d29[_0x1a32('0x42')],_0x45aee2[_0x1a32('0x44')]));_0x5223d1[_0x1a32('0x4d')]['SmsAccountId']=_0x3490c8['id'];if(_0x110d29[_0x1a32('0x42')][_0x1a32('0x4e')]){_0x5223d1[_0x1a32('0x4d')]=_[_0x1a32('0x4f')](_0x5223d1[_0x1a32('0x4d')],{'$or':_[_0x1a32('0x41')](_0x5223d1[_0x1a32('0x46')],function(_0x139ef8){var _0x51a6a2={};_0x51a6a2[_0x139ef8]={'$like':'%'+_0x110d29[_0x1a32('0x42')][_0x1a32('0x4e')]+'%'};return _0x51a6a2;})});}_0x5223d1=_[_0x1a32('0x4f')]({},_0x5223d1,_0x110d29['options']);return db[_0x1a32('0x9e')][_0x1a32('0x31')]({'where':_0x5223d1[_0x1a32('0x4d')]})['then'](function(_0x30c5ee){_0x22cd6e['count']=_0x30c5ee;if(_0x110d29[_0x1a32('0x42')]['includeAll']){_0x5223d1['include']=[{'model':db[_0x1a32('0x74')],'as':_0x1a32('0xb9'),'required':![]},{'model':db[_0x1a32('0xa6')],'as':_0x1a32('0xba'),'attributes':[_0x1a32('0x3a'),_0x1a32('0xbb'),_0x1a32('0xbc')],'required':![]},{'model':db[_0x1a32('0xbd')],'as':_0x1a32('0xbe'),'attributes':['id',_0x1a32('0x3a'),'color'],'where':_0x110d29['query'][_0x1a32('0xbf')]?{'id':_0x110d29[_0x1a32('0x42')][_0x1a32('0xbf')]}:undefined,'required':_0x110d29[_0x1a32('0x42')][_0x1a32('0xbf')]?!![]:![]}];}return db[_0x1a32('0x9e')][_0x1a32('0x51')](_0x5223d1);})[_0x1a32('0x21')](function(_0x567d5f){_0x22cd6e['rows']=_0x567d5f;return _0x22cd6e;});}})[_0x1a32('0x21')](respondWithFilteredResult(_0x372c28,_0x5223d1))[_0x1a32('0x2b')](handleError(_0x372c28,null));};exports[_0x1a32('0xb2')]=function(_0x527305,_0x261b67,_0x411ddf){var _0xe29839,_0x4bd36b,_0x485913;if(_[_0x1a32('0x92')](_0x527305[_0x1a32('0x58')][_0x1a32('0x58')])||_0x527305[_0x1a32('0x58')][_0x1a32('0x58')]===''){throw new db[(_0x1a32('0x93'))]['ValidationError'](_0x1a32('0x94'));}if(_[_0x1a32('0x92')](_0x527305[_0x1a32('0x58')]['to'])){throw new db[(_0x1a32('0x93'))]['ValidationError'](_0x1a32('0xc0'));}_0xe29839=_0x527305[_0x1a32('0x58')]['to'];return db[_0x1a32('0x3d')][_0x1a32('0x56')]({'where':{'id':_0x527305['params']['id']},'include':[{'model':db['CmList'],'as':_0x1a32('0xc1'),'include':[{'model':db[_0x1a32('0x74')],'as':_0x1a32('0x99'),'where':{'mobile':_0xe29839},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x1a32('0x21')](handleEntityNotFound(_0x261b67,null))[_0x1a32('0x21')](function(_0x1c2886){if(_0x1c2886&&_0x1c2886[_0x1a32('0xc1')]){_0x4bd36b=_0x1c2886[_0x1a32('0x35')]({'plain':!![]});if(_0x4bd36b[_0x1a32('0xc1')]&&_0x4bd36b[_0x1a32('0xc1')][_0x1a32('0x99')]['length']){return _0x4bd36b[_0x1a32('0xc1')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x1a32('0x1a')](_0x527305['body'],{'firstName':_0xe29839,'mobile':_0xe29839,'phone':_0xe29839,'ListId':_0x4bd36b[_0x1a32('0x7c')]}));}})['then'](handleEntityNotFound(_0x261b67,null))[_0x1a32('0x21')](function(_0x497a8e){if(_0x497a8e){_0x485913=_0x497a8e;return db[_0x1a32('0x9e')][_0x1a32('0x56')]({'where':{'ContactId':_0x485913['id'],'closed':![],'SmsAccountId':_0x4bd36b['id']}})[_0x1a32('0x21')](function(_0x479c77){if(_0x479c77){return[_0x479c77,![]];}return db[_0x1a32('0x9e')]['create']({'UserId':_0x527305[_0x1a32('0x59')]['id'],'ContactId':_0x485913['id'],'SmsAccountId':_0x4bd36b['id'],'phone':_0xe29839,'firstMsgDirection':_0x1a32('0xc2'),'Messages':[_[_0x1a32('0x4f')](_0x527305['body'],{'read':![],'body':_0x527305[_0x1a32('0x58')]['body'],'phone':_0xe29839,'SmsAccountId':_0x4bd36b['id'],'UserId':_0x527305[_0x1a32('0x59')]['id'],'ContactId':_0x485913['id']})]},{'include':[{'model':db[_0x1a32('0xa4')],'as':_0x1a32('0xc3')}]})['then'](function(_0x57c001){return[_0x57c001,!![]];});});}})[_0x1a32('0x9f')](function(_0x1a45b2,_0x4ab4c8){if(_0x4ab4c8){return _0x1a45b2;}return db['SmsMessage']['create'](_[_0x1a32('0x4f')](_0x527305['body'],{'read':![],'body':_0x527305['body'][_0x1a32('0x58')],'phone':_0xe29839,'SmsAccountId':_0x4bd36b['id'],'SmsInteractionId':_0x1a45b2['id'],'UserId':_0x527305[_0x1a32('0x59')]['id'],'ContactId':_0x485913['id']}))[_0x1a32('0x21')](function(_0x4779f2){_0x1a45b2[_0x1a32('0xc4')][_0x1a32('0xc3')]=[];_0x1a45b2[_0x1a32('0xc4')]['Messages'][_0x1a32('0xa2')](_0x4779f2['dataValues']);return _0x1a45b2;});})[_0x1a32('0x21')](respondWithResult(_0x261b67,null))[_0x1a32('0x2b')](handleError(_0x261b67,null));};exports['status']=function(_0x2dd207,_0x1891c0,_0x38ed10){if(_0x2dd207[_0x1a32('0x58')]['id']){delete _0x2dd207[_0x1a32('0x58')]['id'];}var _0x1d0172,_0x24a345,_0x5a08ec;return db[_0x1a32('0x3d')][_0x1a32('0x56')]({'where':{'id':_0x2dd207[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x1891c0,null))[_0x1a32('0x21')](function(_0x474d2d){if(_0x474d2d){_0x5a08ec=_0x474d2d;logger[_0x1a32('0xae')](_0x1a32('0x25'),_0x1a32('0x2d'),_0x1a32('0xc5'),_0x474d2d['type'],util['inspect'](_0x2dd207['body'],{'showHidden':![],'depth':null}));switch(_0x474d2d[_0x1a32('0x7e')]){case _0x1a32('0xc6'):if(_0x2dd207[_0x1a32('0x58')]['skebby_dispatch_id']&&_0x2dd207[_0x1a32('0x58')][_0x1a32('0x2d')]){_0x24a345=_0x2dd207[_0x1a32('0x58')][_0x1a32('0x2d')];return db[_0x1a32('0xa4')][_0x1a32('0x56')]({'where':{'messageId':_0x2dd207[_0x1a32('0x58')][_0x1a32('0xc7')]}});}break;case _0x1a32('0xc8'):if(_0x2dd207[_0x1a32('0x58')][_0x1a32('0xc9')]&&_0x2dd207[_0x1a32('0x58')][_0x1a32('0xca')]){_0x24a345=_0x2dd207['body'][_0x1a32('0xca')];return db[_0x1a32('0xa4')]['find']({'where':{'messageId':_0x2dd207[_0x1a32('0x58')][_0x1a32('0xc9')]}});}break;case'clicksend':if(_0x2dd207[_0x1a32('0x58')][_0x1a32('0xcb')]&&_0x2dd207['body']['status_code']){_0x24a345=_0x2dd207['body'][_0x1a32('0xcc')];return db['SmsMessage']['find']({'where':{'messageId':_0x2dd207[_0x1a32('0x58')][_0x1a32('0xcb')]}});}break;case _0x1a32('0x8a'):var _0x92121e=_0x2dd207[_0x1a32('0x58')][_0x1a32('0x8b')][0x0];if(_0x92121e['messageId']&&_0x92121e[_0x1a32('0x2d')]['groupName']==='DELIVERED'){_0x24a345=_0x92121e[_0x1a32('0x2d')]['groupName'];return db[_0x1a32('0xa4')]['find']({'where':{'messageId':_0x92121e[_0x1a32('0x81')]}});}break;case _0x1a32('0x8e'):if(_0x2dd207['body']['messageId']&&_0x2dd207['body'][_0x1a32('0x2d')]){_0x24a345=_0x2dd207[_0x1a32('0x58')][_0x1a32('0x2d')];return db[_0x1a32('0xa4')][_0x1a32('0x56')]({'where':{'messageId':_0x2dd207[_0x1a32('0x58')][_0x1a32('0x81')]}});}break;case _0x1a32('0xcd'):if(_0x2dd207[_0x1a32('0x58')][0x0][_0x1a32('0x29')]['id']){_0x24a345=_0x2dd207['body'][0x0][_0x1a32('0x7e')];return db[_0x1a32('0xa4')]['find']({'where':{'messageId':_0x2dd207[_0x1a32('0x58')][0x0]['message']['id']}});}break;case _0x1a32('0x91'):if(_0x2dd207['body']['redif']&&_0x2dd207[_0x1a32('0x58')][_0x1a32('0x2d')]){_0x24a345=_0x2dd207[_0x1a32('0x58')][_0x1a32('0x2d')];return db[_0x1a32('0xa4')][_0x1a32('0x56')]({'where':{'messageId':_0x2dd207[_0x1a32('0x58')][_0x1a32('0xce')]}});}break;}}})[_0x1a32('0x21')](handleEntityNotFound(_0x1891c0,null))['then'](function(_0x4a7137){if(_0x4a7137){_0x1d0172=_0x4a7137;switch(_0x5a08ec['type']){case'skebby':if(_0x24a345==='DELIVERED'){return _0x1d0172[_0x1a32('0x5f')]({'read':!![]});}else{logger[_0x1a32('0x27')](_0x1a32('0x25'),_0x1a32('0x2d'),_0x1a32('0xc6'),util[_0x1a32('0xcf')](_0x2dd207[_0x1a32('0x58')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x24a345==='1'){return _0x1d0172['update']({'read':!![]});}else{logger[_0x1a32('0x27')](_0x1a32('0x25'),'status',_0x1a32('0xc6'),util[_0x1a32('0xcf')](_0x2dd207[_0x1a32('0x58')],{'showHidden':![],'depth':null}));}break;case _0x1a32('0x86'):if(!_0x2dd207[_0x1a32('0x58')][_0x1a32('0xd0')]&&_0x24a345>=0xc8&&_0x24a345<=0xce){return _0x1d0172[_0x1a32('0x5f')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1a32('0x2d'),_0x1a32('0x86'),util[_0x1a32('0xcf')](_0x2dd207[_0x1a32('0x58')],{'showHidden':![],'depth':null}));}break;case _0x1a32('0x8a'):var _0x38bf3f=_0x2dd207[_0x1a32('0x58')]['results'][0x0];if(_0x38bf3f[_0x1a32('0x2d')][_0x1a32('0xd1')]===_0x1a32('0xd2')){return _0x1d0172[_0x1a32('0x5f')]({'read':!![]});}else{logger[_0x1a32('0x27')](_0x1a32('0x25'),_0x1a32('0x2d'),_0x1a32('0x8a'),util[_0x1a32('0xcf')](_0x2dd207[_0x1a32('0x58')],{'showHidden':![],'depth':null}));}break;case _0x1a32('0x8e'):if(_0x24a345=='DELIVERED_TO_GATEWAY'||_0x24a345=='RECEIVED_BY_RECIPIENT'){return _0x1d0172[_0x1a32('0x5f')]({'read':!![]});}else{logger[_0x1a32('0x27')](_0x1a32('0x25'),_0x1a32('0x2d'),'clickatell',util[_0x1a32('0xcf')](_0x2dd207[_0x1a32('0x58')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x24a345==_0x1a32('0xd3')){return _0x1d0172[_0x1a32('0x5f')]({'read':!![]});}else{logger[_0x1a32('0x27')](_0x1a32('0x25'),_0x1a32('0x2d'),_0x1a32('0xcd'),util['inspect'](_0x2dd207[_0x1a32('0x58')],{'showHidden':![],'depth':null}));}break;case _0x1a32('0x91'):if(_0x24a345===_0x1a32('0xd4')||_0x24a345===_0x1a32('0xd5')){return _0x1d0172[_0x1a32('0x5f')]({'read':!![]});}else{logger[_0x1a32('0x27')](_0x1a32('0x25'),_0x1a32('0x2d'),_0x1a32('0x91'),util[_0x1a32('0xcf')](_0x2dd207['body'],{'showHidden':![],'depth':null}));}break;}return _0x1d0172;}})['then'](respondWithResult(_0x1891c0,null))[_0x1a32('0x2b')](handleError(_0x1891c0,null));};exports[_0x1a32('0xd6')]=function(_0x4476ba,_0x4ed9e5,_0xcbbf25){var _0x4d01be,_0x5181f0,_0x254212;return db[_0x1a32('0x3d')][_0x1a32('0x56')]({'where':{'id':_0x4476ba[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x4ed9e5,null))[_0x1a32('0x21')](function(_0x13fc68){if(_0x13fc68){_0x254212=_0x13fc68;logger[_0x1a32('0xae')](_0x1a32('0x25'),_0x1a32('0x2d'),_0x1a32('0xc5'),_0x13fc68[_0x1a32('0x7e')],util[_0x1a32('0xcf')](_0x4476ba['query'],{'showHidden':![],'depth':null}));switch(_0x13fc68[_0x1a32('0x7e')]){case'csc':if(_0x4476ba[_0x1a32('0x42')][_0x1a32('0xd7')]&&_0x4476ba[_0x1a32('0x42')][_0x1a32('0xd8')]){_0x5181f0=_0x4476ba[_0x1a32('0x42')][_0x1a32('0xd8')];return db[_0x1a32('0xa4')][_0x1a32('0x56')]({'where':{'messageId':_0x4476ba[_0x1a32('0x42')][_0x1a32('0xd7')]}});}break;}}})[_0x1a32('0x21')](handleEntityNotFound(_0x4ed9e5,null))['then'](function(_0x4f2899){if(_0x4f2899){_0x4d01be=_0x4f2899;switch(_0x254212[_0x1a32('0x7e')]){case'csc':if(_0x5181f0==='2'||_0x5181f0==='6'){return _0x4d01be[_0x1a32('0x5f')]({'read':!![]});}else{logger[_0x1a32('0x27')](_0x1a32('0x25'),_0x1a32('0x2d'),'csc',util[_0x1a32('0xcf')](_0x4476ba[_0x1a32('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x4d01be;}})['then'](respondWithResult(_0x4ed9e5,null))[_0x1a32('0x2b')](handleError(_0x4ed9e5,null));};exports[_0x1a32('0xd9')]=function(_0x352584,_0x466bb0,_0xd0a0cb){return db[_0x1a32('0x3d')]['find']({'where':{'id':_0x352584[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x466bb0,null))[_0x1a32('0x21')](function(_0xf01ac8){if(_0xf01ac8){return _0xf01ac8['addAgents'](_0x352584[_0x1a32('0x58')][_0x1a32('0x6a')],_[_0x1a32('0x9c')](_0x352584[_0x1a32('0x58')],[_0x1a32('0x6a'),'id'])||{})[_0x1a32('0x9f')](function(_0x3c1ae8){for(var _0xbbb2aa=0x0;_0xbbb2aa<_0x352584['body'][_0x1a32('0x6a')][_0x1a32('0x48')];_0xbbb2aa+=0x1){socket[_0x1a32('0xda')]('userSmsAccount:save',{'UserId':Number(_0x352584[_0x1a32('0x58')][_0x1a32('0x6a')][_0xbbb2aa]),'SmsAccountId':Number(_0x352584['params']['id'])});}return _0x3c1ae8;});}})[_0x1a32('0x21')](respondWithResult(_0x466bb0,null))[_0x1a32('0x2b')](handleError(_0x466bb0,null));};exports[_0x1a32('0xdb')]=function(_0x47cbb6,_0x522d55,_0x231608){return db[_0x1a32('0x3d')][_0x1a32('0x56')]({'where':{'id':_0x47cbb6[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0x522d55,null))[_0x1a32('0x21')](function(_0x3bd45a){if(_0x3bd45a){return _0x3bd45a['removeAgents'](_0x47cbb6[_0x1a32('0x42')][_0x1a32('0x6a')])[_0x1a32('0x21')](function(){if(_['isArray'](_0x47cbb6[_0x1a32('0x42')][_0x1a32('0x6a')])){for(var _0x39c044=0x0;_0x39c044<_0x47cbb6[_0x1a32('0x42')][_0x1a32('0x6a')][_0x1a32('0x48')];_0x39c044+=0x1){socket['emit'](_0x1a32('0xdc'),{'UserId':Number(_0x47cbb6['query'][_0x1a32('0x6a')][_0x39c044]),'SmsAccountId':Number(_0x47cbb6[_0x1a32('0x53')]['id'])});}}else{socket[_0x1a32('0xda')](_0x1a32('0xdc'),{'UserId':Number(_0x47cbb6['query'][_0x1a32('0x6a')]),'SmsAccountId':Number(_0x47cbb6['params']['id'])});}});}})[_0x1a32('0x21')](respondWithStatusCode(_0x522d55,null))[_0x1a32('0x2b')](handleError(_0x522d55,null));};exports[_0x1a32('0xdd')]=function(_0x5485db,_0xe07d55,_0xb2ee0d){var _0x53d0f1={};var _0x394ce4={};var _0x319f0f;var _0x59ff84;return db[_0x1a32('0x3d')][_0x1a32('0xb5')]({'where':{'id':_0x5485db[_0x1a32('0x53')]['id']}})[_0x1a32('0x21')](handleEntityNotFound(_0xe07d55,null))['then'](function(_0x3b3900){if(_0x3b3900){_0x319f0f=_0x3b3900;_0x394ce4[_0x1a32('0x40')]=_['keys'](db[_0x1a32('0xa6')][_0x1a32('0x3e')]);_0x394ce4[_0x1a32('0x42')]=_[_0x1a32('0x43')](_0x5485db['query']);_0x394ce4['filters']=_['intersection'](_0x394ce4['model'],_0x394ce4[_0x1a32('0x42')]);_0x53d0f1['attributes']=_[_0x1a32('0x45')](_0x394ce4[_0x1a32('0x40')],qs[_0x1a32('0x47')](_0x5485db[_0x1a32('0x42')]['fields']));_0x53d0f1[_0x1a32('0x46')]=_0x53d0f1[_0x1a32('0x46')][_0x1a32('0x48')]?_0x53d0f1[_0x1a32('0x46')]:_0x394ce4[_0x1a32('0x40')];_0x53d0f1[_0x1a32('0x4b')]=qs['sort'](_0x5485db[_0x1a32('0x42')][_0x1a32('0x4c')]);_0x53d0f1['where']=qs[_0x1a32('0x44')](_[_0x1a32('0x64')](_0x5485db[_0x1a32('0x42')],_0x394ce4[_0x1a32('0x44')]));if(_0x5485db[_0x1a32('0x42')][_0x1a32('0x4e')]){_0x53d0f1[_0x1a32('0x4d')]=_['merge'](_0x53d0f1[_0x1a32('0x4d')],{'$or':_[_0x1a32('0x41')](_0x53d0f1[_0x1a32('0x46')],function(_0x45b6c3){var _0x35663e={};_0x35663e[_0x45b6c3]={'$like':'%'+_0x5485db['query']['filter']+'%'};return _0x35663e;})});}_0x53d0f1=_['merge']({},_0x53d0f1,_0x5485db['options']);return _0x319f0f['getAgents'](_0x53d0f1);}})[_0x1a32('0x21')](function(_0x4585fa){if(_0x4585fa){_0x59ff84=_0x4585fa['length'];if(!_0x5485db[_0x1a32('0x42')]['hasOwnProperty']('nolimit')){_0x53d0f1[_0x1a32('0x4a')]=qs['limit'](_0x5485db[_0x1a32('0x42')][_0x1a32('0x4a')]);_0x53d0f1[_0x1a32('0x2f')]=qs[_0x1a32('0x2f')](_0x5485db['query'][_0x1a32('0x2f')]);}return _0x319f0f[_0x1a32('0xdd')](_0x53d0f1);}})[_0x1a32('0x21')](function(_0x30c45e){if(_0x30c45e){return _0x30c45e?{'count':_0x59ff84,'rows':_0x30c45e}:null;}})[_0x1a32('0x21')](respondWithResult(_0xe07d55,null))['catch'](handleError(_0xe07d55,null));}; \ No newline at end of file +var _0x82c1=['count','set','Content-Range','json','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','sendStatus','stack','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','user','get','UserProfileSection','find','userProfileId','autoAssociation','create','body','params','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','account','applications','priority','asc','Applications','CmContact','describe','Sequelize','ValidationError','createdAt','updatedAt','difference','ListId','twilio','from','Body','messageId','MessageSid','skebby','sender','text','clicksend','message_id','Text','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','SmsInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','interaction','created','SmsMessage','ContactId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','text/xml','send','\x0a','addApplications','sequelize','transaction','SmsApplication','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','bandwidth','redif','DELIVERED','connectel','error_code','infobip','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','offset','undefined','limit'];(function(_0x3c5e6b,_0x31674d){var _0x2c33ba=function(_0x55b146){while(--_0x55b146){_0x3c5e6b['push'](_0x3c5e6b['shift']());}};_0x2c33ba(++_0x31674d);}(_0x82c1,0xae));var _0x182c=function(_0x35e1a3,_0xd37ecc){_0x35e1a3=_0x35e1a3-0x0;var _0x24312d=_0x82c1[_0x35e1a3];return _0x24312d;};'use strict';var emlformat=require(_0x182c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x182c('0x1'));var rp=require(_0x182c('0x2'));var moment=require(_0x182c('0x3'));var BPromise=require(_0x182c('0x4'));var Mustache=require(_0x182c('0x5'));var util=require(_0x182c('0x6'));var path=require(_0x182c('0x7'));var sox=require('sox');var csv=require(_0x182c('0x8'));var ejs=require(_0x182c('0x9'));var fs=require('fs');var fs_extra=require(_0x182c('0xa'));var _=require(_0x182c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x182c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x182c('0x8'));var querystring=require(_0x182c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x182c('0xe'));var qs=require(_0x182c('0xf'));var as=require(_0x182c('0x10'));var hardwareService=require(_0x182c('0x11'));var logger=require(_0x182c('0x12'))(_0x182c('0x13'));var utils=require(_0x182c('0x14'));var config=require(_0x182c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x182c('0x16')](config[_0x182c('0x17')],{'host':_0x182c('0x18'),'port':0x18eb});var socket=require(_0x182c('0x19'))(new Redis(config['redis']));require(_0x182c('0x1a'))[_0x182c('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x182c('0x1c')][_0x182c('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xce0f8f,_0x240b6c,_0x35a420,_0x1c05c5){return new BPromise(function(_0x241df4,_0x372fdf){var _0x3f34c4=_0x1c05c5||client;return _0x3f34c4['request'](_0xce0f8f,_0x35a420)[_0x182c('0x1e')](function(_0x486f33){logger[_0x182c('0x1f')](_0x182c('0x20'),_0x240b6c,_0x182c('0x21'));logger[_0x182c('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x240b6c,'request\x20sent',JSON['stringify'](_0x486f33));if(_0x486f33[_0x182c('0x23')]){if(_0x486f33['error'][_0x182c('0x24')]===0x1f4){logger[_0x182c('0x23')](_0x182c('0x20'),_0x240b6c,_0x486f33[_0x182c('0x23')][_0x182c('0x25')]);return _0x372fdf(_0x486f33[_0x182c('0x23')]['message']);}logger[_0x182c('0x23')](_0x182c('0x20'),_0x240b6c,_0x486f33['error'][_0x182c('0x25')]);return _0x241df4(_0x486f33[_0x182c('0x23')][_0x182c('0x25')]);}else{logger[_0x182c('0x1f')](_0x182c('0x20'),_0x240b6c,_0x182c('0x21'));_0x241df4(_0x486f33[_0x182c('0x26')][_0x182c('0x25')]);}})[_0x182c('0x27')](function(_0x32b8b8){logger['error'](_0x182c('0x20'),_0x240b6c,_0x32b8b8);_0x372fdf(_0x32b8b8);});});}function respondWithStatusCode(_0x3b2aaa,_0x3c56d7){_0x3c56d7=_0x3c56d7||0xcc;return function(_0x46f91e){if(_0x46f91e){return _0x3b2aaa['sendStatus'](_0x3c56d7);}return _0x3b2aaa[_0x182c('0x28')](_0x3c56d7)[_0x182c('0x29')]();};}function respondWithResult(_0x25fc10,_0x4b84a3){_0x4b84a3=_0x4b84a3||0xc8;return function(_0x2d6ef3){if(_0x2d6ef3){return _0x25fc10[_0x182c('0x28')](_0x4b84a3)['json'](_0x2d6ef3);}};}function respondWithFilteredResult(_0x2e09c3,_0x5632d4){return function(_0x336857){if(_0x336857){var _0x1bdee4=typeof _0x5632d4[_0x182c('0x2a')]===_0x182c('0x2b')&&typeof _0x5632d4[_0x182c('0x2c')]===_0x182c('0x2b');var _0x232062=_0x336857['count'];var _0x1bbf9b=_0x1bdee4?0x0:_0x5632d4['offset'];var _0x4831e8=_0x1bdee4?_0x336857[_0x182c('0x2d')]:_0x5632d4[_0x182c('0x2a')]+_0x5632d4['limit'];var _0x4dbae1;if(_0x4831e8>=_0x232062){_0x4831e8=_0x232062;_0x4dbae1=0xc8;}else{_0x4dbae1=0xce;}_0x2e09c3[_0x182c('0x28')](_0x4dbae1);return _0x2e09c3[_0x182c('0x2e')](_0x182c('0x2f'),_0x1bbf9b+'-'+_0x4831e8+'/'+_0x232062)[_0x182c('0x30')](_0x336857);}return null;};}function patchUpdates(_0x2310ad){return function(_0x1fdd17){try{jsonpatch[_0x182c('0x31')](_0x1fdd17,_0x2310ad,!![]);}catch(_0x59a185){return BPromise[_0x182c('0x32')](_0x59a185);}return _0x1fdd17[_0x182c('0x33')]();};}function saveUpdates(_0x57b082,_0x5debec){return function(_0x1fdf2d){if(_0x1fdf2d){return _0x1fdf2d[_0x182c('0x34')](_0x57b082)['then'](function(_0x2d8648){return _0x2d8648;});}return null;};}function removeEntity(_0xe684ff,_0x23d26a){return function(_0x537a2d){if(_0x537a2d){return _0x537a2d[_0x182c('0x35')]()['then'](function(){var _0x260e3f=_0x537a2d['get']({'plain':!![]});var _0x3b0f92=_0x182c('0x36');return db[_0x182c('0x37')]['destroy']({'where':{'type':_0x3b0f92,'resourceId':_0x260e3f['id']}})[_0x182c('0x1e')](function(){return _0x537a2d;});})[_0x182c('0x1e')](function(){_0xe684ff['status'](0xcc)[_0x182c('0x29')]();});}};}function handleEntityNotFound(_0xccd354,_0x20b032){return function(_0x4b588c){if(!_0x4b588c){_0xccd354[_0x182c('0x38')](0x194);}return _0x4b588c;};}function handleError(_0x185a20,_0x3b50ac){_0x3b50ac=_0x3b50ac||0x1f4;return function(_0x3e26f0){logger[_0x182c('0x23')](_0x3e26f0[_0x182c('0x39')]);if(_0x3e26f0['name']){delete _0x3e26f0['name'];}_0x185a20[_0x182c('0x28')](_0x3b50ac)['send'](_0x3e26f0);};}exports['index']=function(_0x3da1e9,_0x13e94e){var _0xeb0bf7={'include':[{'model':db[_0x182c('0x3a')],'as':_0x182c('0x3b')}]},_0x13dbc6={},_0x4725e4={'count':0x0,'rows':[]};var _0x34dc15=_[_0x182c('0x3c')](db[_0x182c('0x3d')][_0x182c('0x3e')],function(_0x2b4982){return{'name':_0x2b4982[_0x182c('0x3f')],'type':_0x2b4982[_0x182c('0x40')]['key']};});_0x13dbc6[_0x182c('0x41')]=_['map'](_0x34dc15,_0x182c('0x42'));_0x13dbc6[_0x182c('0x43')]=_[_0x182c('0x44')](_0x3da1e9['query']);_0x13dbc6[_0x182c('0x45')]=_[_0x182c('0x46')](_0x13dbc6['model'],_0x13dbc6[_0x182c('0x43')]);_0xeb0bf7['attributes']=_[_0x182c('0x46')](_0x13dbc6[_0x182c('0x41')],qs[_0x182c('0x47')](_0x3da1e9[_0x182c('0x43')][_0x182c('0x47')]));_0xeb0bf7['attributes']=_0xeb0bf7[_0x182c('0x48')][_0x182c('0x49')]?_0xeb0bf7[_0x182c('0x48')]:_0x13dbc6['model'];if(!_0x3da1e9[_0x182c('0x43')]['hasOwnProperty'](_0x182c('0x4a'))){_0xeb0bf7[_0x182c('0x2c')]=qs[_0x182c('0x2c')](_0x3da1e9[_0x182c('0x43')][_0x182c('0x2c')]);_0xeb0bf7['offset']=qs[_0x182c('0x2a')](_0x3da1e9[_0x182c('0x43')]['offset']);}_0xeb0bf7[_0x182c('0x4b')]=qs[_0x182c('0x4c')](_0x3da1e9['query'][_0x182c('0x4c')]);_0xeb0bf7[_0x182c('0x4d')]=qs[_0x182c('0x45')](_[_0x182c('0x4e')](_0x3da1e9[_0x182c('0x43')],_0x13dbc6['filters']),_0x34dc15);if(_0x3da1e9['query'][_0x182c('0x4f')]){_0xeb0bf7[_0x182c('0x4d')]=_[_0x182c('0x50')](_0xeb0bf7[_0x182c('0x4d')],{'$or':_['map'](_0x34dc15,function(_0x355714){if(_0x355714[_0x182c('0x40')]!=='VIRTUAL'){var _0x42d37b={};_0x42d37b[_0x355714[_0x182c('0x42')]]={'$like':'%'+_0x3da1e9[_0x182c('0x43')][_0x182c('0x4f')]+'%'};return _0x42d37b;}})});}_0xeb0bf7=_['merge']({},_0xeb0bf7,_0x3da1e9[_0x182c('0x51')]);var _0x27f7d7={'where':_0xeb0bf7[_0x182c('0x4d')]};return db[_0x182c('0x3d')][_0x182c('0x2d')](_0x27f7d7)[_0x182c('0x1e')](function(_0x47dd75){_0x4725e4[_0x182c('0x2d')]=_0x47dd75;if(_0x3da1e9[_0x182c('0x43')][_0x182c('0x52')]){_0xeb0bf7[_0x182c('0x53')]=[{'all':!![]}];}return db['SmsAccount'][_0x182c('0x54')](_0xeb0bf7);})[_0x182c('0x1e')](function(_0x3e314f){_0x4725e4['rows']=_0x3e314f;return _0x4725e4;})['then'](respondWithFilteredResult(_0x13e94e,_0xeb0bf7))[_0x182c('0x27')](handleError(_0x13e94e,null));};exports[_0x182c('0x55')]=function(_0x443023,_0x576291){var _0x168f15={'raw':![],'where':{'id':_0x443023['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xe2ebb4={};_0xe2ebb4[_0x182c('0x41')]=_['keys'](db[_0x182c('0x3d')][_0x182c('0x3e')]);_0xe2ebb4[_0x182c('0x43')]=_[_0x182c('0x44')](_0x443023[_0x182c('0x43')]);_0xe2ebb4[_0x182c('0x45')]=_['intersection'](_0xe2ebb4['model'],_0xe2ebb4[_0x182c('0x43')]);_0x168f15[_0x182c('0x48')]=_[_0x182c('0x46')](_0xe2ebb4[_0x182c('0x41')],qs[_0x182c('0x47')](_0x443023[_0x182c('0x43')][_0x182c('0x47')]));_0x168f15[_0x182c('0x48')]=_0x168f15[_0x182c('0x48')]['length']?_0x168f15[_0x182c('0x48')]:_0xe2ebb4[_0x182c('0x41')];if(_0x443023[_0x182c('0x43')][_0x182c('0x52')]){_0x168f15[_0x182c('0x53')]=[{'all':!![]}];}_0x168f15=_['merge']({},_0x168f15,_0x443023['options']);return db[_0x182c('0x3d')]['find'](_0x168f15)[_0x182c('0x1e')](handleEntityNotFound(_0x576291,null))[_0x182c('0x1e')](respondWithResult(_0x576291,null))[_0x182c('0x27')](handleError(_0x576291,null));};exports['create']=function(_0x58aa67,_0x4fe440){return db['SmsAccount']['create'](_0x58aa67['body'],{})[_0x182c('0x1e')](function(_0x99d9a0){var _0x7605b=_0x58aa67[_0x182c('0x56')][_0x182c('0x57')]({'plain':!![]});if(!_0x7605b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7605b['role']==='user'){var _0x1d5c84=_0x99d9a0[_0x182c('0x57')]({'plain':!![]});var _0x11f67a=_0x182c('0x36');return db[_0x182c('0x58')][_0x182c('0x59')]({'where':{'name':_0x11f67a,'userProfileId':_0x7605b[_0x182c('0x5a')]},'raw':!![]})[_0x182c('0x1e')](function(_0x7caef7){if(_0x7caef7&&_0x7caef7[_0x182c('0x5b')]===0x0){return db[_0x182c('0x37')][_0x182c('0x5c')]({'name':_0x1d5c84[_0x182c('0x42')],'resourceId':_0x1d5c84['id'],'type':_0x7caef7[_0x182c('0x42')],'sectionId':_0x7caef7['id']},{})[_0x182c('0x1e')](function(){return _0x99d9a0;});}else{return _0x99d9a0;}})[_0x182c('0x27')](function(_0x20a36c){logger[_0x182c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20a36c);throw _0x20a36c;});}return _0x99d9a0;})[_0x182c('0x1e')](respondWithResult(_0x4fe440,0xc9))['catch'](handleError(_0x4fe440,null));};exports[_0x182c('0x34')]=function(_0x51c540,_0x24a1ff){if(_0x51c540['body']['id']){delete _0x51c540[_0x182c('0x5d')]['id'];}return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x51c540[_0x182c('0x5e')]['id']},'include':[{'model':db[_0x182c('0x3a')],'as':_0x182c('0x3b')}]})['then'](handleEntityNotFound(_0x24a1ff,null))['then'](saveUpdates(_0x51c540[_0x182c('0x5d')],null))['then'](respondWithResult(_0x24a1ff,null))[_0x182c('0x27')](handleError(_0x24a1ff,null));};exports[_0x182c('0x35')]=function(_0x43e237,_0x18f9a9){return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x43e237[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x18f9a9,null))[_0x182c('0x1e')](removeEntity(_0x18f9a9,null))[_0x182c('0x27')](handleError(_0x18f9a9,null));};exports['describe']=function(_0xe18f91,_0xbd22f1){return db[_0x182c('0x3d')]['describe']()[_0x182c('0x1e')](respondWithResult(_0xbd22f1,null))[_0x182c('0x27')](handleError(_0xbd22f1,null));};exports[_0x182c('0x5f')]=function(_0x38da2f,_0x1dfc92,_0x61ab02){if(_0x38da2f['body']['id']){delete _0x38da2f[_0x182c('0x5d')]['id'];}return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x38da2f[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x1dfc92,null))[_0x182c('0x1e')](function(_0x565457){if(_0x565457){_0x38da2f['body'][_0x182c('0x60')]=_0x565457['id'];return db[_0x182c('0x61')][_0x182c('0x5c')](_0x38da2f[_0x182c('0x5d')]);}})[_0x182c('0x1e')](respondWithResult(_0x1dfc92,null))[_0x182c('0x27')](handleError(_0x1dfc92,null));};exports[_0x182c('0x62')]=function(_0x48b678,_0x1e071e,_0x46c1a4){var _0x1d18f4={'raw':![],'where':{}};var _0x5aa005={};var _0x5c514b={'count':0x0,'rows':[]};return db[_0x182c('0x3d')][_0x182c('0x63')]({'where':{'id':_0x48b678[_0x182c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1e071e,null))[_0x182c('0x1e')](function(_0x5af773){if(_0x5af773){_0x5aa005[_0x182c('0x41')]=_[_0x182c('0x44')](db['Disposition'][_0x182c('0x3e')]);_0x5aa005[_0x182c('0x43')]=_[_0x182c('0x44')](_0x48b678[_0x182c('0x43')]);_0x5aa005[_0x182c('0x45')]=_['intersection'](_0x5aa005['model'],_0x5aa005[_0x182c('0x43')]);_0x1d18f4[_0x182c('0x48')]=_[_0x182c('0x46')](_0x5aa005[_0x182c('0x41')],qs[_0x182c('0x47')](_0x48b678['query']['fields']));_0x1d18f4[_0x182c('0x48')]=_0x1d18f4[_0x182c('0x48')][_0x182c('0x49')]?_0x1d18f4[_0x182c('0x48')]:_0x5aa005[_0x182c('0x41')];if(!_0x48b678[_0x182c('0x43')][_0x182c('0x64')](_0x182c('0x4a'))){_0x1d18f4[_0x182c('0x2c')]=qs[_0x182c('0x2c')](_0x48b678['query'][_0x182c('0x2c')]);_0x1d18f4[_0x182c('0x2a')]=qs[_0x182c('0x2a')](_0x48b678[_0x182c('0x43')][_0x182c('0x2a')]);}_0x1d18f4[_0x182c('0x4b')]=qs['sort'](_0x48b678[_0x182c('0x43')][_0x182c('0x4c')]);_0x1d18f4[_0x182c('0x4d')]=qs[_0x182c('0x45')](_['pick'](_0x48b678[_0x182c('0x43')],_0x5aa005[_0x182c('0x45')]));_0x1d18f4['where'][_0x182c('0x60')]=_0x5af773['id'];if(_0x48b678[_0x182c('0x43')][_0x182c('0x4f')]){_0x1d18f4[_0x182c('0x4d')]=_[_0x182c('0x50')](_0x1d18f4['where'],{'$or':_[_0x182c('0x3c')](_0x1d18f4[_0x182c('0x48')],function(_0x44b5f8){var _0x3d4b53={};_0x3d4b53[_0x44b5f8]={'$like':'%'+_0x48b678['query'][_0x182c('0x4f')]+'%'};return _0x3d4b53;})});}_0x1d18f4=_['merge']({},_0x1d18f4,_0x48b678[_0x182c('0x51')]);return db[_0x182c('0x61')][_0x182c('0x2d')]({'where':_0x1d18f4[_0x182c('0x4d')]})[_0x182c('0x1e')](function(_0x4e35b5){_0x5c514b[_0x182c('0x2d')]=_0x4e35b5;if(_0x48b678[_0x182c('0x43')][_0x182c('0x52')]){_0x1d18f4['include']=[{'all':!![]}];}return db['Disposition'][_0x182c('0x54')](_0x1d18f4);})[_0x182c('0x1e')](function(_0x28fd0c){_0x5c514b[_0x182c('0x65')]=_0x28fd0c;return _0x5c514b;});}})['then'](respondWithFilteredResult(_0x1e071e,_0x1d18f4))[_0x182c('0x27')](handleError(_0x1e071e,null));};exports[_0x182c('0x66')]=function(_0x5dd985,_0x8d8ce,_0x215a13){return db[_0x182c('0x3d')]['find']({'where':{'id':_0x5dd985[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x8d8ce,null))['then'](function(_0x5d9e07){if(_0x5d9e07){return _0x5d9e07['removeDispositions'](_0x5dd985[_0x182c('0x43')][_0x182c('0x67')]);}})['then'](respondWithStatusCode(_0x8d8ce,null))[_0x182c('0x27')](handleError(_0x8d8ce,null));};exports[_0x182c('0x68')]=function(_0x31c053,_0x34cdf5,_0x5d2978){if(_0x31c053['body']['id']){delete _0x31c053[_0x182c('0x5d')]['id'];}return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x31c053[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x34cdf5,null))['then'](function(_0x2ba385){if(_0x2ba385){_0x31c053[_0x182c('0x5d')][_0x182c('0x60')]=_0x2ba385['id'];return db[_0x182c('0x69')]['create'](_0x31c053[_0x182c('0x5d')]);}})['then'](respondWithResult(_0x34cdf5,null))[_0x182c('0x27')](handleError(_0x34cdf5,null));};exports[_0x182c('0x6a')]=function(_0x4e13ba,_0x32ce51,_0xc43ef3){var _0x43382c={'raw':![],'where':{}};var _0x305423={};var _0x36e96a={'count':0x0,'rows':[]};return db['SmsAccount'][_0x182c('0x63')]({'where':{'id':_0x4e13ba[_0x182c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x32ce51,null))[_0x182c('0x1e')](function(_0x34b0fa){if(_0x34b0fa){_0x305423['model']=_[_0x182c('0x44')](db['CannedAnswer'][_0x182c('0x3e')]);_0x305423['query']=_[_0x182c('0x44')](_0x4e13ba['query']);_0x305423[_0x182c('0x45')]=_['intersection'](_0x305423[_0x182c('0x41')],_0x305423[_0x182c('0x43')]);_0x43382c['attributes']=_[_0x182c('0x46')](_0x305423[_0x182c('0x41')],qs[_0x182c('0x47')](_0x4e13ba[_0x182c('0x43')][_0x182c('0x47')]));_0x43382c['attributes']=_0x43382c[_0x182c('0x48')][_0x182c('0x49')]?_0x43382c['attributes']:_0x305423[_0x182c('0x41')];if(!_0x4e13ba[_0x182c('0x43')][_0x182c('0x64')]('nolimit')){_0x43382c[_0x182c('0x2c')]=qs['limit'](_0x4e13ba[_0x182c('0x43')][_0x182c('0x2c')]);_0x43382c[_0x182c('0x2a')]=qs['offset'](_0x4e13ba['query'][_0x182c('0x2a')]);}_0x43382c[_0x182c('0x4b')]=qs[_0x182c('0x4c')](_0x4e13ba[_0x182c('0x43')][_0x182c('0x4c')]);_0x43382c[_0x182c('0x4d')]=qs[_0x182c('0x45')](_[_0x182c('0x4e')](_0x4e13ba['query'],_0x305423[_0x182c('0x45')]));_0x43382c[_0x182c('0x4d')][_0x182c('0x60')]=_0x34b0fa['id'];if(_0x4e13ba[_0x182c('0x43')][_0x182c('0x4f')]){_0x43382c['where']=_[_0x182c('0x50')](_0x43382c[_0x182c('0x4d')],{'$or':_[_0x182c('0x3c')](_0x43382c['attributes'],function(_0x19b6a5){var _0x2fe48e={};_0x2fe48e[_0x19b6a5]={'$like':'%'+_0x4e13ba[_0x182c('0x43')][_0x182c('0x4f')]+'%'};return _0x2fe48e;})});}_0x43382c=_[_0x182c('0x50')]({},_0x43382c,_0x4e13ba[_0x182c('0x51')]);return db[_0x182c('0x69')][_0x182c('0x2d')]({'where':_0x43382c[_0x182c('0x4d')]})['then'](function(_0x219b87){_0x36e96a[_0x182c('0x2d')]=_0x219b87;if(_0x4e13ba[_0x182c('0x43')]['includeAll']){_0x43382c[_0x182c('0x53')]=[{'all':!![]}];}return db[_0x182c('0x69')][_0x182c('0x54')](_0x43382c);})[_0x182c('0x1e')](function(_0x27a021){_0x36e96a[_0x182c('0x65')]=_0x27a021;return _0x36e96a;});}})[_0x182c('0x1e')](respondWithFilteredResult(_0x32ce51,_0x43382c))[_0x182c('0x27')](handleError(_0x32ce51,null));};exports[_0x182c('0x6b')]=function(_0xd90177,_0x3f1170,_0x280df3){return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0xd90177[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x3f1170,null))[_0x182c('0x1e')](function(_0x5ca344){if(_0x5ca344){return _0x5ca344[_0x182c('0x6b')](_0xd90177[_0x182c('0x43')][_0x182c('0x67')]);}})[_0x182c('0x1e')](respondWithStatusCode(_0x3f1170,null))['catch'](handleError(_0x3f1170,null));};exports['notify']=function(_0x24a10d,_0x58fa87,_0x49a9f2){var _0x3fd3a8={'channel':'sms'};var _0x2203ec=[];var _0x1efb03=[];var _0x20a9fe={};return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x24a10d[_0x182c('0x5e')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x182c('0x1e')](handleEntityNotFound(_0x58fa87,null))[_0x182c('0x1e')](function(_0x5f203b){_0x3fd3a8[_0x182c('0x6c')]=_0x5f203b;_0x3fd3a8[_0x182c('0x6d')]=_['orderBy'](_0x5f203b['Applications'],[_0x182c('0x6e')],[_0x182c('0x6f')]);if(_0x3fd3a8['account'][_0x182c('0x70')]){delete _0x3fd3a8[_0x182c('0x6c')][_0x182c('0x70')];}return db[_0x182c('0x71')][_0x182c('0x72')]();})[_0x182c('0x1e')](function(_0x2b07db){if(!_0x2b07db){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))]('no\x20available\x20attributes');}_0x2203ec=_['difference'](_['keys'](_0x2b07db),[_0x182c('0x75'),_0x182c('0x76')]);_0x1efb03=_[_0x182c('0x77')](_[_0x182c('0x44')](_0x2b07db),[_0x182c('0x75'),'updatedAt','CompanyId',_0x182c('0x78')]);_0x3fd3a8[_0x182c('0x5d')]={'mapKey':'mobile'};if(_0x3fd3a8[_0x182c('0x6c')]['type']){switch(_0x3fd3a8[_0x182c('0x6c')][_0x182c('0x40')]){case _0x182c('0x79'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')]['From'];_0x3fd3a8[_0x182c('0x5d')]['body']=_0x24a10d[_0x182c('0x5d')][_0x182c('0x7b')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7c')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x7d')];break;case _0x182c('0x7e'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]='+'+_0x24a10d['body'][_0x182c('0x7f')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')]=_0x24a10d['body'][_0x182c('0x80')];break;case'connectel':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x7a')];_0x3fd3a8['body']['body']=_0x24a10d['body'][_0x182c('0x25')];break;case _0x182c('0x81'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x7a')];_0x3fd3a8['body']['body']=_0x24a10d[_0x182c('0x5d')][_0x182c('0x5d')];_0x3fd3a8['body']['messageId']=_0x24a10d['body'][_0x182c('0x82')];break;case'plivo':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')]['From'];_0x3fd3a8[_0x182c('0x5d')]['body']=_0x24a10d[_0x182c('0x5d')][_0x182c('0x83')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7c')]=_0x24a10d[_0x182c('0x5d')]['MessageUUID'];break;case'infobip':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]='+'+_0x24a10d[_0x182c('0x5d')][_0x182c('0x84')][0x0][_0x182c('0x7a')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')]=_0x24a10d[_0x182c('0x5d')]['results'][0x0][_0x182c('0x80')];_0x3fd3a8[_0x182c('0x5d')]['messageId']=_0x24a10d[_0x182c('0x5d')][_0x182c('0x84')][0x0][_0x182c('0x7c')];break;case _0x182c('0x85'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x86')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')]=_0x24a10d['body'][_0x182c('0x87')][_0x182c('0x25')];break;case _0x182c('0x88'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')]['fromNumber'];_0x3fd3a8['body'][_0x182c('0x5d')]=_0x24a10d['body']['text'];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7c')]=_0x24a10d['body'][_0x182c('0x89')];break;case'bandwidth':_0x3fd3a8['body'][_0x182c('0x7c')]=_0x24a10d[_0x182c('0x5d')][0x0]['message']['id'];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')][0x0][_0x182c('0x25')]['from'];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')]=_0x24a10d[_0x182c('0x5d')][0x0][_0x182c('0x25')]['text'];break;case _0x182c('0x8a'):_0x3fd3a8[_0x182c('0x5d')]['from']=_0x24a10d['body'][_0x182c('0x7a')];_0x3fd3a8['body'][_0x182c('0x5d')]=_0x24a10d['body'][_0x182c('0x25')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7c')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x8b')];break;}}if(_0x3fd3a8[_0x182c('0x5d')]['id']){delete _0x3fd3a8[_0x182c('0x5d')]['id'];}if(_[_0x182c('0x8c')](_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')])){throw new db['Sequelize'][(_0x182c('0x74'))](_0x182c('0x8d'));}if(_['isNil'](_0x3fd3a8['body'][_0x182c('0x5d')])||_0x3fd3a8['body'][_0x182c('0x5d')]===''){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))](_0x182c('0x8e'));}if(_[_0x182c('0x8c')](_0x3fd3a8[_0x182c('0x5d')]['mapKey'])){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))](_0x182c('0x8f')+_0x1efb03);}if(!_['includes'](_0x1efb03,_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x90')])){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))](_0x182c('0x91')+_0x1efb03);}_0x20a9fe[_0x3fd3a8['body']['mapKey']]=_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')];return db[_0x182c('0x92')]['find']({'where':{'id':_0x3fd3a8[_0x182c('0x6c')][_0x182c('0x78')]},'include':[{'model':db['CmContact'],'as':_0x182c('0x93'),'where':_0x20a9fe,'limit':0x1,'order':[[_0x182c('0x76'),_0x182c('0x94')]]}]});})[_0x182c('0x1e')](handleEntityNotFound(_0x58fa87,null))['then'](function(_0x5ad362){if(_0x5ad362){_0x3fd3a8[_0x182c('0x95')]=_[_0x182c('0x96')](_0x5ad362,[_0x182c('0x93')]);if(_0x5ad362['Contacts'][_0x182c('0x49')]){return _0x5ad362[_0x182c('0x93')][0x0];}var _0x396151=_[_0x182c('0x16')](_0x3fd3a8[_0x182c('0x5d')],{'firstName':_0x3fd3a8['body'][_0x182c('0x7a')],'ListId':_0x5ad362['id']});_0x396151[_0x3fd3a8['body']['mapKey']]=_0x3fd3a8['body'][_0x182c('0x7a')];return db['CmContact'][_0x182c('0x5c')](_0x396151,{'fields':_0x2203ec,'raw':!![]});}})['then'](handleEntityNotFound(_0x58fa87,null))[_0x182c('0x1e')](function(_0x3ee132){if(_0x3ee132){_0x3fd3a8['contact']=_0x3ee132;var _0xe4b77a={'ContactId':_0x3ee132['id'],'phone':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')],'SmsAccountId':_0x24a10d[_0x182c('0x5e')]['id']};var _0x2dd0b0={'ContactId':_0x3ee132['id'],'SmsAccountId':_0x24a10d[_0x182c('0x5e')]['id'],'closed':![]};return db[_0x182c('0x97')][_0x182c('0x59')]({'where':_0x2dd0b0})[_0x182c('0x1e')](function(_0x230d8e){if(_0x230d8e){return[_0x230d8e,![]];}return db[_0x182c('0x97')]['create'](_0xe4b77a)[_0x182c('0x1e')](function(_0x70b061){return[_0x70b061,!![]];});});}})[_0x182c('0x98')](function(_0x1102ab,_0x473d73){_0x3fd3a8['interaction']=_0x1102ab['get']({'plain':!![]});_0x3fd3a8['interaction']['created']=![];if(_0x473d73){if(_0x3fd3a8[_0x182c('0x6c')][_0x182c('0x99')]){_0x3fd3a8[_0x182c('0x6d')][_0x182c('0x9a')]({'id':0x0,'priority':_0x3fd3a8[_0x182c('0x6d')]['length']+0x1,'app':_0x182c('0x9b'),'appdata':_0x182c('0x9c'),'interval':_0x182c('0x9d')});}_0x3fd3a8[_0x182c('0x9e')][_0x182c('0x9f')]=!![];}return db[_0x182c('0xa0')][_0x182c('0x5c')]({'phone':_0x3fd3a8[_0x182c('0x5d')]['from'],'messageId':_0x3fd3a8[_0x182c('0x5d')]['messageId'],'body':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')],'SmsAccountId':_0x24a10d[_0x182c('0x5e')]['id'],'SmsInteractionId':_0x1102ab['id'],'direction':'in','ContactId':_0x1102ab[_0x182c('0xa1')],'AttachmentId':_0x3fd3a8[_0x182c('0x5d')]['AttachmentId']});})[_0x182c('0x1e')](function(_0x5d60d2){_0x3fd3a8['message']=_0x5d60d2;if(_0x3fd3a8[_0x182c('0x9e')][_0x182c('0xa2')]){return db[_0x182c('0xa3')][_0x182c('0x59')]({'attributes':['id',_0x182c('0x42')],'where':{'id':_0x3fd3a8[_0x182c('0x9e')][_0x182c('0xa2')]}})[_0x182c('0x1e')](function(_0x3ac284){if(_0x3ac284){_0x3fd3a8[_0x182c('0x6d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x182c('0xa4'),'appdata':_0x3ac284[_0x182c('0x42')]+','+(_0x3fd3a8['account'][_0x182c('0xa5')]||0xa),'interval':_0x182c('0x9d')});}return respondWithRpcPromise(_0x182c('0xa6'),'startRouting',_0x3fd3a8);});}return respondWithRpcPromise('Start',_0x182c('0xa7'),_0x3fd3a8);})[_0x182c('0x1e')](function(_0x49420d){if(_0x49420d){var _0x177b74=0xc8;var _0x62cf4d='receiveMessage';logger[_0x182c('0x1f')](_0x182c('0xa8'),_0x62cf4d,_0x177b74,'entity\x20found');logger[_0x182c('0x22')](_0x182c('0xa9'),_0x62cf4d,_0x177b74,_0x182c('0xaa'),JSON[_0x182c('0xab')](_0x49420d));if(_0x3fd3a8[_0x182c('0x6c')]['type']===_0x182c('0x79')){return _0x58fa87[_0x182c('0x28')](_0x177b74)[_0x182c('0x2e')]('Content-Type',_0x182c('0xac'))[_0x182c('0xad')](_0x182c('0xae'));}else{return _0x58fa87[_0x182c('0x28')](_0x177b74)[_0x182c('0x30')](_0x49420d);}}})['catch'](handleError(_0x58fa87,null));};exports[_0x182c('0xaf')]=function(_0x1bab10,_0x5589ec,_0x4c3216){return db[_0x182c('0x3d')]['findOne']({'where':{'id':_0x1bab10[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x5589ec,null))[_0x182c('0x1e')](function(_0x3d7f90){if(_0x3d7f90){return db[_0x182c('0xb0')][_0x182c('0xb1')](function(_0x3f76bd){return db[_0x182c('0xb2')]['destroy']({'where':{'SmsAccountId':_0x1bab10[_0x182c('0x5e')]['id']},'transaction':_0x3f76bd})['then'](function(_0x45b010){var _0x337927=_[_0x182c('0x3c')](_0x1bab10[_0x182c('0x5d')],function(_0x5f4e4c){_0x5f4e4c[_0x182c('0x60')]=_0x1bab10['params']['id'];return _0x5f4e4c;});return db[_0x182c('0xb2')]['bulkCreate'](_0x337927,{'transaction':_0x3f76bd});});})[_0x182c('0x1e')](function(){return db[_0x182c('0xb2')][_0x182c('0xb3')]({'where':{'SmsAccountId':_0x1bab10[_0x182c('0x5e')]['id']},'order':'priority'});});}})[_0x182c('0x1e')](respondWithResult(_0x5589ec,null))[_0x182c('0x27')](handleError(_0x5589ec,null));};exports[_0x182c('0xb4')]=function(_0x21c250,_0x344bb6,_0x504413){var _0x1b4d03={};var _0x4e66d8={};var _0x99e223;var _0x4f0a3b;return db[_0x182c('0x3d')][_0x182c('0x63')]({'where':{'id':_0x21c250[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x344bb6,null))[_0x182c('0x1e')](function(_0x56d568){if(_0x56d568){_0x99e223=_0x56d568;_0x4e66d8['model']=_[_0x182c('0x44')](db[_0x182c('0xb2')]['rawAttributes']);_0x4e66d8[_0x182c('0x43')]=_[_0x182c('0x44')](_0x21c250[_0x182c('0x43')]);_0x4e66d8[_0x182c('0x45')]=_['intersection'](_0x4e66d8[_0x182c('0x41')],_0x4e66d8[_0x182c('0x43')]);_0x1b4d03[_0x182c('0x48')]=_[_0x182c('0x46')](_0x4e66d8['model'],qs[_0x182c('0x47')](_0x21c250[_0x182c('0x43')][_0x182c('0x47')]));_0x1b4d03[_0x182c('0x48')]=_0x1b4d03[_0x182c('0x48')]['length']?_0x1b4d03[_0x182c('0x48')]:_0x4e66d8['model'];_0x1b4d03[_0x182c('0x4b')]=qs['sort'](_0x21c250[_0x182c('0x43')][_0x182c('0x4c')]);_0x1b4d03[_0x182c('0x4d')]=qs[_0x182c('0x45')](_[_0x182c('0x4e')](_0x21c250[_0x182c('0x43')],_0x4e66d8[_0x182c('0x45')]));if(_0x21c250[_0x182c('0x43')][_0x182c('0x4f')]){_0x1b4d03['where']=_[_0x182c('0x50')](_0x1b4d03[_0x182c('0x4d')],{'$or':_['map'](_0x1b4d03[_0x182c('0x48')],function(_0x25877b){var _0x2c50cf={};_0x2c50cf[_0x25877b]={'$like':'%'+_0x21c250['query'][_0x182c('0x4f')]+'%'};return _0x2c50cf;})});}_0x1b4d03=_[_0x182c('0x50')]({},_0x1b4d03,_0x21c250['options']);return _0x99e223[_0x182c('0xb4')](_0x1b4d03);}})[_0x182c('0x1e')](function(_0x359f45){if(_0x359f45){_0x4f0a3b=_0x359f45[_0x182c('0x49')];if(!_0x21c250[_0x182c('0x43')][_0x182c('0x64')](_0x182c('0x4a'))){_0x1b4d03[_0x182c('0x2c')]=qs[_0x182c('0x2c')](_0x21c250[_0x182c('0x43')]['limit']);_0x1b4d03[_0x182c('0x2a')]=qs[_0x182c('0x2a')](_0x21c250['query']['offset']);}return _0x99e223[_0x182c('0xb4')](_0x1b4d03);}})[_0x182c('0x1e')](function(_0x2fe9aa){if(_0x2fe9aa){return _0x2fe9aa?{'count':_0x4f0a3b,'rows':_0x2fe9aa}:null;}})[_0x182c('0x1e')](respondWithResult(_0x344bb6,null))[_0x182c('0x27')](handleError(_0x344bb6,null));};exports[_0x182c('0xb5')]=function(_0x29c669,_0x3513ae,_0x1d7000){var _0x3d9d58={'raw':![],'where':{}};var _0x13891d={};var _0x5a18f1={'count':0x0,'rows':[]};return db[_0x182c('0x3d')][_0x182c('0x63')]({'where':{'id':_0x29c669['params']['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x3513ae,null))[_0x182c('0x1e')](function(_0x1f50e7){if(_0x1f50e7){_0x13891d['model']=_[_0x182c('0x44')](db[_0x182c('0x97')][_0x182c('0x3e')]);_0x13891d[_0x182c('0x43')]=_['keys'](_0x29c669[_0x182c('0x43')]);_0x13891d[_0x182c('0x45')]=_[_0x182c('0x46')](_0x13891d[_0x182c('0x41')],_0x13891d[_0x182c('0x43')]);_0x3d9d58[_0x182c('0x48')]=_[_0x182c('0x46')](_0x13891d[_0x182c('0x41')],qs[_0x182c('0x47')](_0x29c669['query']['fields']));_0x3d9d58[_0x182c('0x48')]=_0x3d9d58[_0x182c('0x48')]['length']?_0x3d9d58[_0x182c('0x48')]:_0x13891d[_0x182c('0x41')];if(!_0x29c669[_0x182c('0x43')][_0x182c('0x64')](_0x182c('0x4a'))){_0x3d9d58[_0x182c('0x2c')]=qs[_0x182c('0x2c')](_0x29c669['query'][_0x182c('0x2c')]);_0x3d9d58[_0x182c('0x2a')]=qs[_0x182c('0x2a')](_0x29c669['query'][_0x182c('0x2a')]);}_0x3d9d58[_0x182c('0x4b')]=qs[_0x182c('0x4c')](_0x29c669[_0x182c('0x43')][_0x182c('0x4c')]);_0x3d9d58[_0x182c('0x4d')]=qs['filters'](_['pick'](_0x29c669[_0x182c('0x43')],_0x13891d[_0x182c('0x45')]));_0x3d9d58[_0x182c('0x4d')][_0x182c('0x60')]=_0x1f50e7['id'];if(_0x29c669[_0x182c('0x43')][_0x182c('0x4f')]){_0x3d9d58['where']=_[_0x182c('0x50')](_0x3d9d58[_0x182c('0x4d')],{'$or':_[_0x182c('0x3c')](_0x3d9d58['attributes'],function(_0x3b7ba1){var _0x4099c7={};_0x4099c7[_0x3b7ba1]={'$like':'%'+_0x29c669['query'][_0x182c('0x4f')]+'%'};return _0x4099c7;})});}_0x3d9d58=_[_0x182c('0x50')]({},_0x3d9d58,_0x29c669[_0x182c('0x51')]);return db[_0x182c('0x97')][_0x182c('0x2d')]({'where':_0x3d9d58['where']})[_0x182c('0x1e')](function(_0x2564c8){_0x5a18f1[_0x182c('0x2d')]=_0x2564c8;if(_0x29c669['query'][_0x182c('0x52')]){_0x3d9d58[_0x182c('0x53')]=[{'model':db[_0x182c('0x71')],'as':_0x182c('0xb6'),'required':![]},{'model':db[_0x182c('0xa3')],'as':'Owner','attributes':[_0x182c('0x42'),_0x182c('0xb7'),_0x182c('0xb8')],'required':![]},{'model':db[_0x182c('0xb9')],'as':_0x182c('0xba'),'attributes':['id',_0x182c('0x42'),_0x182c('0xbb')],'where':_0x29c669[_0x182c('0x43')][_0x182c('0xbc')]?{'id':_0x29c669[_0x182c('0x43')][_0x182c('0xbc')]}:undefined,'required':_0x29c669[_0x182c('0x43')][_0x182c('0xbc')]?!![]:![]}];}return db[_0x182c('0x97')][_0x182c('0x54')](_0x3d9d58);})['then'](function(_0x3100db){_0x5a18f1[_0x182c('0x65')]=_0x3100db;return _0x5a18f1;});}})['then'](respondWithFilteredResult(_0x3513ae,_0x3d9d58))[_0x182c('0x27')](handleError(_0x3513ae,null));};exports[_0x182c('0xad')]=function(_0x27f14c,_0x587c7e,_0x4295a8){var _0x3e7026,_0x222412,_0x3e0e16;if(_[_0x182c('0x8c')](_0x27f14c[_0x182c('0x5d')][_0x182c('0x5d')])||_0x27f14c['body'][_0x182c('0x5d')]===''){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x182c('0x8c')](_0x27f14c[_0x182c('0x5d')]['to'])){throw new db['Sequelize']['ValidationError'](_0x182c('0xbd'));}_0x3e7026=_0x27f14c['body']['to'];return db[_0x182c('0x3d')]['find']({'where':{'id':_0x27f14c[_0x182c('0x5e')]['id']},'include':[{'model':db[_0x182c('0x92')],'as':_0x182c('0xbe'),'include':[{'model':db['CmContact'],'as':_0x182c('0x93'),'where':{'mobile':_0x3e7026},'limit':0x1,'order':[[_0x182c('0x76'),_0x182c('0x94')]]}]}]})[_0x182c('0x1e')](handleEntityNotFound(_0x587c7e,null))[_0x182c('0x1e')](function(_0x6ddcf7){if(_0x6ddcf7&&_0x6ddcf7[_0x182c('0xbe')]){_0x222412=_0x6ddcf7[_0x182c('0x57')]({'plain':!![]});if(_0x222412['List']&&_0x222412['List'][_0x182c('0x93')][_0x182c('0x49')]){return _0x222412['List'][_0x182c('0x93')][0x0];}return db[_0x182c('0x71')][_0x182c('0x5c')](_[_0x182c('0x16')](_0x27f14c['body'],{'firstName':_0x3e7026,'mobile':_0x3e7026,'phone':_0x3e7026,'ListId':_0x222412[_0x182c('0x78')]}));}})['then'](handleEntityNotFound(_0x587c7e,null))[_0x182c('0x1e')](function(_0x224b84){if(_0x224b84){_0x3e0e16=_0x224b84;return db[_0x182c('0x97')]['find']({'where':{'ContactId':_0x3e0e16['id'],'closed':![],'SmsAccountId':_0x222412['id']}})[_0x182c('0x1e')](function(_0x529aeb){if(_0x529aeb){return[_0x529aeb,![]];}return db[_0x182c('0x97')][_0x182c('0x5c')]({'UserId':_0x27f14c['user']['id'],'ContactId':_0x3e0e16['id'],'SmsAccountId':_0x222412['id'],'phone':_0x3e7026,'firstMsgDirection':_0x182c('0xbf'),'Messages':[_[_0x182c('0x50')](_0x27f14c['body'],{'read':![],'body':_0x27f14c[_0x182c('0x5d')][_0x182c('0x5d')],'phone':_0x3e7026,'SmsAccountId':_0x222412['id'],'UserId':_0x27f14c[_0x182c('0x56')]['id'],'ContactId':_0x3e0e16['id']})]},{'include':[{'model':db[_0x182c('0xa0')],'as':_0x182c('0xc0')}]})[_0x182c('0x1e')](function(_0x165024){return[_0x165024,!![]];});});}})[_0x182c('0x98')](function(_0x434412,_0x5e46a1){if(_0x5e46a1){return _0x434412;}return db['SmsMessage'][_0x182c('0x5c')](_[_0x182c('0x50')](_0x27f14c[_0x182c('0x5d')],{'read':![],'body':_0x27f14c[_0x182c('0x5d')][_0x182c('0x5d')],'phone':_0x3e7026,'SmsAccountId':_0x222412['id'],'SmsInteractionId':_0x434412['id'],'UserId':_0x27f14c[_0x182c('0x56')]['id'],'ContactId':_0x3e0e16['id']}))['then'](function(_0x56b229){_0x434412[_0x182c('0xc1')][_0x182c('0xc0')]=[];_0x434412[_0x182c('0xc1')][_0x182c('0xc0')]['push'](_0x56b229[_0x182c('0xc1')]);return _0x434412;});})['then'](respondWithResult(_0x587c7e,null))[_0x182c('0x27')](handleError(_0x587c7e,null));};exports[_0x182c('0x28')]=function(_0x52ef2c,_0x513ad8,_0x6dd85b){if(_0x52ef2c[_0x182c('0x5d')]['id']){delete _0x52ef2c['body']['id'];}var _0xab1971,_0x641470,_0x34be23;return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x52ef2c['params']['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x513ad8,null))[_0x182c('0x1e')](function(_0x337e4c){if(_0x337e4c){_0x34be23=_0x337e4c;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x182c('0x28'),_0x182c('0xc2'),_0x337e4c[_0x182c('0x40')],util[_0x182c('0xc3')](_0x52ef2c['body'],{'showHidden':![],'depth':null}));switch(_0x337e4c['type']){case'skebby':if(_0x52ef2c[_0x182c('0x5d')]['skebby_dispatch_id']&&_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')]){_0x641470=_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')];return db[_0x182c('0xa0')][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][_0x182c('0xc4')]}});}break;case'connectel':if(_0x52ef2c['body']['requestid']&&_0x52ef2c['body'][_0x182c('0xc5')]){_0x641470=_0x52ef2c[_0x182c('0x5d')][_0x182c('0xc5')];return db['SmsMessage'][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][_0x182c('0xc6')]}});}break;case _0x182c('0x81'):if(_0x52ef2c['body'][_0x182c('0x82')]&&_0x52ef2c[_0x182c('0x5d')][_0x182c('0xc7')]){_0x641470=_0x52ef2c[_0x182c('0x5d')]['status_code'];return db[_0x182c('0xa0')][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c['body'][_0x182c('0x82')]}});}break;case'infobip':var _0x4e2e3c=_0x52ef2c[_0x182c('0x5d')][_0x182c('0x84')][0x0];if(_0x4e2e3c[_0x182c('0x7c')]&&_0x4e2e3c[_0x182c('0x28')][_0x182c('0xc8')]==='DELIVERED'){_0x641470=_0x4e2e3c[_0x182c('0x28')]['groupName'];return db['SmsMessage'][_0x182c('0x59')]({'where':{'messageId':_0x4e2e3c['messageId']}});}break;case'clickatell':if(_0x52ef2c[_0x182c('0x5d')][_0x182c('0x7c')]&&_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')]){_0x641470=_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')];return db['SmsMessage'][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][_0x182c('0x7c')]}});}break;case _0x182c('0xc9'):if(_0x52ef2c[_0x182c('0x5d')][0x0][_0x182c('0x25')]['id']){_0x641470=_0x52ef2c[_0x182c('0x5d')][0x0][_0x182c('0x40')];return db[_0x182c('0xa0')][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][0x0][_0x182c('0x25')]['id']}});}break;case _0x182c('0x8a'):if(_0x52ef2c[_0x182c('0x5d')][_0x182c('0xca')]&&_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')]){_0x641470=_0x52ef2c['body'][_0x182c('0x28')];return db[_0x182c('0xa0')][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][_0x182c('0xca')]}});}break;}}})['then'](handleEntityNotFound(_0x513ad8,null))[_0x182c('0x1e')](function(_0x593358){if(_0x593358){_0xab1971=_0x593358;switch(_0x34be23[_0x182c('0x40')]){case _0x182c('0x7e'):if(_0x641470===_0x182c('0xcb')){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger[_0x182c('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x182c('0x7e'),util[_0x182c('0xc3')](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x182c('0xcc'):if(_0x641470==='1'){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger[_0x182c('0x23')](_0x182c('0xa8'),'status',_0x182c('0x7e'),util['inspect'](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x182c('0x81'):if(!_0x52ef2c[_0x182c('0x5d')][_0x182c('0xcd')]&&_0x641470>=0xc8&&_0x641470<=0xce){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger['error'](_0x182c('0xa8'),_0x182c('0x28'),'clicksend',util['inspect'](_0x52ef2c['body'],{'showHidden':![],'depth':null}));}break;case _0x182c('0xce'):var _0x1f375a=_0x52ef2c[_0x182c('0x5d')][_0x182c('0x84')][0x0];if(_0x1f375a['status']['groupName']===_0x182c('0xcb')){return _0xab1971['update']({'read':!![]});}else{logger['error'](_0x182c('0xa8'),_0x182c('0x28'),_0x182c('0xce'),util[_0x182c('0xc3')](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x182c('0x88'):if(_0x641470==_0x182c('0xcf')||_0x641470=='RECEIVED_BY_RECIPIENT'){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger['error'](_0x182c('0xa8'),_0x182c('0x28'),_0x182c('0x88'),util[_0x182c('0xc3')](_0x52ef2c['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x641470==_0x182c('0xd0')){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger[_0x182c('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x182c('0xc9'),util[_0x182c('0xc3')](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x182c('0x8a'):if(_0x641470===_0x182c('0xd1')||_0x641470===_0x182c('0xd2')){return _0xab1971['update']({'read':!![]});}else{logger[_0x182c('0x23')](_0x182c('0xa8'),_0x182c('0x28'),_0x182c('0x8a'),util[_0x182c('0xc3')](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0xab1971;}})[_0x182c('0x1e')](respondWithResult(_0x513ad8,null))[_0x182c('0x27')](handleError(_0x513ad8,null));};exports['statusGet']=function(_0x3416d1,_0x473b07,_0x5633fa){var _0x47a821,_0x986373,_0x17f6f7;return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x3416d1['params']['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x473b07,null))[_0x182c('0x1e')](function(_0x1e65df){if(_0x1e65df){_0x17f6f7=_0x1e65df;logger[_0x182c('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x182c('0x28'),_0x182c('0xc2'),_0x1e65df[_0x182c('0x40')],util['inspect'](_0x3416d1['query'],{'showHidden':![],'depth':null}));switch(_0x1e65df['type']){case _0x182c('0x85'):if(_0x3416d1[_0x182c('0x43')]['message-id']&&_0x3416d1[_0x182c('0x43')][_0x182c('0xd3')]){_0x986373=_0x3416d1[_0x182c('0x43')]['state'];return db['SmsMessage'][_0x182c('0x59')]({'where':{'messageId':_0x3416d1['query'][_0x182c('0xd4')]}});}break;}}})[_0x182c('0x1e')](handleEntityNotFound(_0x473b07,null))[_0x182c('0x1e')](function(_0x30d458){if(_0x30d458){_0x47a821=_0x30d458;switch(_0x17f6f7[_0x182c('0x40')]){case _0x182c('0x85'):if(_0x986373==='2'||_0x986373==='6'){return _0x47a821[_0x182c('0x34')]({'read':!![]});}else{logger['error'](_0x182c('0xa8'),_0x182c('0x28'),_0x182c('0x85'),util[_0x182c('0xc3')](_0x3416d1[_0x182c('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x47a821;}})[_0x182c('0x1e')](respondWithResult(_0x473b07,null))[_0x182c('0x27')](handleError(_0x473b07,null));};exports['addAgents']=function(_0x246b97,_0x202b39,_0x7bb7c2){return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x246b97['params']['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x202b39,null))[_0x182c('0x1e')](function(_0x4bca2b){if(_0x4bca2b){return _0x4bca2b[_0x182c('0xd5')](_0x246b97[_0x182c('0x5d')]['ids'],_[_0x182c('0x96')](_0x246b97[_0x182c('0x5d')],[_0x182c('0x67'),'id'])||{})[_0x182c('0x98')](function(_0x5ee1f4){for(var _0x16334e=0x0;_0x16334e<_0x246b97[_0x182c('0x5d')][_0x182c('0x67')][_0x182c('0x49')];_0x16334e+=0x1){socket[_0x182c('0xd6')]('userSmsAccount:save',{'UserId':Number(_0x246b97['body'][_0x182c('0x67')][_0x16334e]),'SmsAccountId':Number(_0x246b97[_0x182c('0x5e')]['id'])});}return _0x5ee1f4;});}})['then'](respondWithResult(_0x202b39,null))[_0x182c('0x27')](handleError(_0x202b39,null));};exports[_0x182c('0xd7')]=function(_0x5956e3,_0x49b6af,_0xbaef58){return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x5956e3[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x49b6af,null))[_0x182c('0x1e')](function(_0x527b09){if(_0x527b09){return _0x527b09['removeAgents'](_0x5956e3[_0x182c('0x43')][_0x182c('0x67')])['then'](function(){if(_[_0x182c('0xd8')](_0x5956e3[_0x182c('0x43')][_0x182c('0x67')])){for(var _0x5e58b7=0x0;_0x5e58b7<_0x5956e3['query'][_0x182c('0x67')][_0x182c('0x49')];_0x5e58b7+=0x1){socket[_0x182c('0xd6')](_0x182c('0xd9'),{'UserId':Number(_0x5956e3[_0x182c('0x43')][_0x182c('0x67')][_0x5e58b7]),'SmsAccountId':Number(_0x5956e3['params']['id'])});}}else{socket['emit'](_0x182c('0xd9'),{'UserId':Number(_0x5956e3['query'][_0x182c('0x67')]),'SmsAccountId':Number(_0x5956e3[_0x182c('0x5e')]['id'])});}});}})[_0x182c('0x1e')](respondWithStatusCode(_0x49b6af,null))[_0x182c('0x27')](handleError(_0x49b6af,null));};exports[_0x182c('0xda')]=function(_0x5c7691,_0x5432c5,_0x1bd200){var _0x330331={};var _0x5b844d={};var _0x2b5b31;var _0x4c8d10;return db[_0x182c('0x3d')][_0x182c('0x63')]({'where':{'id':_0x5c7691[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x5432c5,null))[_0x182c('0x1e')](function(_0x5c4022){if(_0x5c4022){_0x2b5b31=_0x5c4022;_0x5b844d[_0x182c('0x41')]=_[_0x182c('0x44')](db[_0x182c('0xa3')][_0x182c('0x3e')]);_0x5b844d[_0x182c('0x43')]=_[_0x182c('0x44')](_0x5c7691['query']);_0x5b844d[_0x182c('0x45')]=_[_0x182c('0x46')](_0x5b844d[_0x182c('0x41')],_0x5b844d[_0x182c('0x43')]);_0x330331['attributes']=_[_0x182c('0x46')](_0x5b844d['model'],qs[_0x182c('0x47')](_0x5c7691['query'][_0x182c('0x47')]));_0x330331[_0x182c('0x48')]=_0x330331[_0x182c('0x48')]['length']?_0x330331[_0x182c('0x48')]:_0x5b844d['model'];_0x330331[_0x182c('0x4b')]=qs[_0x182c('0x4c')](_0x5c7691[_0x182c('0x43')][_0x182c('0x4c')]);_0x330331[_0x182c('0x4d')]=qs[_0x182c('0x45')](_['pick'](_0x5c7691[_0x182c('0x43')],_0x5b844d[_0x182c('0x45')]));if(_0x5c7691[_0x182c('0x43')][_0x182c('0x4f')]){_0x330331[_0x182c('0x4d')]=_['merge'](_0x330331['where'],{'$or':_[_0x182c('0x3c')](_0x330331[_0x182c('0x48')],function(_0x3ceca0){var _0x5a88f5={};_0x5a88f5[_0x3ceca0]={'$like':'%'+_0x5c7691[_0x182c('0x43')][_0x182c('0x4f')]+'%'};return _0x5a88f5;})});}_0x330331=_[_0x182c('0x50')]({},_0x330331,_0x5c7691[_0x182c('0x51')]);return _0x2b5b31[_0x182c('0xda')](_0x330331);}})[_0x182c('0x1e')](function(_0x50faa3){if(_0x50faa3){_0x4c8d10=_0x50faa3[_0x182c('0x49')];if(!_0x5c7691[_0x182c('0x43')][_0x182c('0x64')]('nolimit')){_0x330331['limit']=qs[_0x182c('0x2c')](_0x5c7691[_0x182c('0x43')][_0x182c('0x2c')]);_0x330331[_0x182c('0x2a')]=qs[_0x182c('0x2a')](_0x5c7691['query'][_0x182c('0x2a')]);}return _0x2b5b31[_0x182c('0xda')](_0x330331);}})[_0x182c('0x1e')](function(_0x45da11){if(_0x45da11){return _0x45da11?{'count':_0x4c8d10,'rows':_0x45da11}:null;}})[_0x182c('0x1e')](respondWithResult(_0x5432c5,null))[_0x182c('0x27')](handleError(_0x5432c5,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index fcbc38d..d57daa3 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 _0xda9a=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','remove'];(function(_0x293026,_0x47e8de){var _0x567dec=function(_0x204eab){while(--_0x204eab){_0x293026['push'](_0x293026['shift']());}};_0x567dec(++_0x47e8de);}(_0xda9a,0x15b));var _0xada9=function(_0x5a5dce,_0x1d8cdf){_0x5a5dce=_0x5a5dce-0x0;var _0xb98def=_0xda9a[_0x5a5dce];return _0xb98def;};'use strict';var EventEmitter=require(_0xada9('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xada9('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xada9('0x2')};function emitEvent(_0x43cdfa){return function(_0x4ddf4a,_0x3c01b6,_0x38489d){SmsAccountEvents[_0xada9('0x3')](_0x43cdfa+':'+_0x4ddf4a['id'],_0x4ddf4a);SmsAccountEvents[_0xada9('0x3')](_0x43cdfa,_0x4ddf4a);_0x38489d(null);};}for(var e in events){if(events[_0xada9('0x4')](e)){var event=events[e];SmsAccount[_0xada9('0x5')](e,emitEvent(event));}}module[_0xada9('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0xdaf9=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x364221,_0x18b5f0){var _0x148011=function(_0x206142){while(--_0x206142){_0x364221['push'](_0x364221['shift']());}};_0x148011(++_0x18b5f0);}(_0xdaf9,0x179));var _0x9daf=function(_0x3e9bea,_0x198c86){_0x3e9bea=_0x3e9bea-0x0;var _0x4835ea=_0xdaf9[_0x3e9bea];return _0x4835ea;};'use strict';var EventEmitter=require(_0x9daf('0x0'));var SmsAccount=require(_0x9daf('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9daf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9daf('0x3'),'afterDestroy':_0x9daf('0x4')};function emitEvent(_0x58acd1){return function(_0x5bf282,_0x574f89,_0x3d632b){SmsAccountEvents[_0x9daf('0x5')](_0x58acd1+':'+_0x5bf282['id'],_0x5bf282);SmsAccountEvents[_0x9daf('0x5')](_0x58acd1,_0x5bf282);_0x3d632b(null);};}for(var e in events){if(events[_0x9daf('0x6')](e)){var event=events[e];SmsAccount[_0x9daf('0x7')](e,emitEvent(event));}}module[_0x9daf('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 0e915ee..a196426 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 _0x4871=['bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3126ba,_0x1bd64c){var _0x1d072f=function(_0x3ebe41){while(--_0x3ebe41){_0x3126ba['push'](_0x3126ba['shift']());}};_0x1d072f(++_0x1bd64c);}(_0x4871,0x1cf));var _0x1487=function(_0xa2f7ff,_0x236587){_0xa2f7ff=_0xa2f7ff-0x0;var _0x34a447=_0x4871[_0xa2f7ff];return _0x34a447;};'use strict';var _=require(_0x1487('0x0'));var util=require(_0x1487('0x1'));var logger=require(_0x1487('0x2'))(_0x1487('0x3'));var moment=require(_0x1487('0x4'));var BPromise=require(_0x1487('0x5'));var rp=require(_0x1487('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1487('0x7'));var config=require(_0x1487('0x8'));var attributes=require(_0x1487('0x9'));module[_0x1487('0xa')]=function(_0x589321,_0x5aa2fc){return _0x589321['define'](_0x1487('0xb'),attributes,{'tableName':_0x1487('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcce5=['SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x16bc92,_0x1b0935){var _0x27a2d2=function(_0x334beb){while(--_0x334beb){_0x16bc92['push'](_0x16bc92['shift']());}};_0x27a2d2(++_0x1b0935);}(_0xcce5,0x11a));var _0x5cce=function(_0x6f230c,_0x178930){_0x6f230c=_0x6f230c-0x0;var _0x55e608=_0xcce5[_0x6f230c];return _0x55e608;};'use strict';var _=require(_0x5cce('0x0'));var util=require(_0x5cce('0x1'));var logger=require(_0x5cce('0x2'))(_0x5cce('0x3'));var moment=require(_0x5cce('0x4'));var BPromise=require(_0x5cce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cce('0x6'));var rimraf=require(_0x5cce('0x7'));var config=require(_0x5cce('0x8'));var attributes=require(_0x5cce('0x9'));module[_0x5cce('0xa')]=function(_0x1f1005,_0x32debb){return _0x1f1005[_0x5cce('0xb')](_0x5cce('0xc'),attributes,{'tableName':_0x5cce('0xd'),'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 4f6c910..e67c226 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 _0x6c65=['redis','defaults','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','find','options','raw','include','map','model','attributes','then','ShowSmsAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x231a08,_0x469037){var _0x98c8ab=function(_0x4ae0ac){while(--_0x4ae0ac){_0x231a08['push'](_0x231a08['shift']());}};_0x98c8ab(++_0x469037);}(_0x6c65,0xd3));var _0x56c6=function(_0x30df0e,_0x4756b2){_0x30df0e=_0x30df0e-0x0;var _0x1bc476=_0x6c65[_0x30df0e];return _0x1bc476;};'use strict';var _=require(_0x56c6('0x0'));var util=require(_0x56c6('0x1'));var moment=require(_0x56c6('0x2'));var BPromise=require(_0x56c6('0x3'));var rs=require(_0x56c6('0x4'));var fs=require('fs');var Redis=require(_0x56c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x56c6('0x6'))(_0x56c6('0x7'));var config=require(_0x56c6('0x8'));var jayson=require(_0x56c6('0x9'));var client=jayson['client'][_0x56c6('0xa')]({'port':0x232a});config[_0x56c6('0xb')]=_[_0x56c6('0xc')](config[_0x56c6('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56c6('0xb')]));require(_0x56c6('0xd'))[_0x56c6('0xe')](socket);function respondWithRpcPromise(_0x233475,_0x5bd444,_0x2e82af){return new BPromise(function(_0x109592,_0x74a0ed){return client[_0x56c6('0xf')](_0x233475,_0x2e82af)['then'](function(_0x11b51a){logger[_0x56c6('0x10')](_0x56c6('0x11'),_0x5bd444,_0x56c6('0x12'));logger['debug'](_0x56c6('0x13'),_0x5bd444,'request\x20sent',JSON[_0x56c6('0x14')](_0x11b51a));if(_0x11b51a[_0x56c6('0x15')]){if(_0x11b51a[_0x56c6('0x15')][_0x56c6('0x16')]===0x1f4){logger[_0x56c6('0x15')]('SmsAccount,\x20%s,\x20%s',_0x5bd444,_0x11b51a[_0x56c6('0x15')][_0x56c6('0x17')]);return _0x74a0ed(_0x11b51a[_0x56c6('0x15')][_0x56c6('0x17')]);}logger[_0x56c6('0x15')](_0x56c6('0x11'),_0x5bd444,_0x11b51a['error']['message']);return _0x109592(_0x11b51a[_0x56c6('0x15')][_0x56c6('0x17')]);}else{logger[_0x56c6('0x10')](_0x56c6('0x11'),_0x5bd444,_0x56c6('0x12'));_0x109592(_0x11b51a[_0x56c6('0x18')]['message']);}})[_0x56c6('0x19')](function(_0x586626){logger[_0x56c6('0x15')](_0x56c6('0x11'),_0x5bd444,_0x586626);_0x74a0ed(_0x586626);});});}exports['ShowSmsAccount']=function(_0x4400f0){var _0xaac24d=this;return new Promise(function(_0x412397,_0x58437e){return db[_0x56c6('0x1a')][_0x56c6('0x1b')]({'raw':_0x4400f0['options']?_0x4400f0[_0x56c6('0x1c')][_0x56c6('0x1d')]===undefined?!![]:![]:!![],'where':_0x4400f0[_0x56c6('0x1c')]?_0x4400f0[_0x56c6('0x1c')]['where']||null:null,'attributes':_0x4400f0[_0x56c6('0x1c')]?_0x4400f0[_0x56c6('0x1c')]['attributes']||null:null,'include':_0x4400f0[_0x56c6('0x1c')]?_0x4400f0[_0x56c6('0x1c')][_0x56c6('0x1e')]?_[_0x56c6('0x1f')](_0x4400f0[_0x56c6('0x1c')]['include'],function(_0x161192){return{'model':db[_0x161192[_0x56c6('0x20')]],'as':_0x161192['as'],'attributes':_0x161192[_0x56c6('0x21')],'include':_0x161192[_0x56c6('0x1e')]?_['map'](_0x161192['include'],function(_0x466157){return{'model':db[_0x466157[_0x56c6('0x20')]],'as':_0x466157['as'],'attributes':_0x466157[_0x56c6('0x21')],'include':_0x466157[_0x56c6('0x1e')]?_[_0x56c6('0x1f')](_0x466157[_0x56c6('0x1e')],function(_0x55eef6){return{'model':db[_0x55eef6['model']],'as':_0x55eef6['as'],'attributes':_0x55eef6[_0x56c6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x56c6('0x22')](function(_0x577798){logger[_0x56c6('0x10')](_0x56c6('0x23'),_0x4400f0);logger[_0x56c6('0x24')](_0x56c6('0x23'),_0x4400f0,JSON[_0x56c6('0x14')](_0x577798));_0x412397(_0x577798);})[_0x56c6('0x19')](function(_0x4ac3ad){logger[_0x56c6('0x15')](_0x56c6('0x23'),_0x4ac3ad[_0x56c6('0x17')],_0x4400f0);_0x58437e(_0xaac24d[_0x56c6('0x15')](0x1f4,_0x4ac3ad[_0x56c6('0x17')]));});});}; \ No newline at end of file +var _0xd02d=['model','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSmsAccount','find','options','attributes','include','map'];(function(_0x1833ec,_0x46a830){var _0xea3f81=function(_0x37e3d4){while(--_0x37e3d4){_0x1833ec['push'](_0x1833ec['shift']());}};_0xea3f81(++_0x46a830);}(_0xd02d,0x1a1));var _0xdd02=function(_0xea651b,_0x2c974c){_0xea651b=_0xea651b-0x0;var _0x1559c1=_0xd02d[_0xea651b];return _0x1559c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdd02('0x0'));var BPromise=require(_0xdd02('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd02('0x2'))['db'];var utils=require(_0xdd02('0x3'));var logger=require(_0xdd02('0x4'))(_0xdd02('0x5'));var config=require(_0xdd02('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdd02('0x7')][_0xdd02('0x8')]({'port':0x232a});config[_0xdd02('0x9')]=_[_0xdd02('0xa')](config[_0xdd02('0x9')],{'host':_0xdd02('0xb'),'port':0x18eb});var socket=require(_0xdd02('0xc'))(new Redis(config[_0xdd02('0x9')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4c59e9,_0x595a29,_0xea07b){return new BPromise(function(_0x17b3b9,_0x7de9d7){return client[_0xdd02('0xd')](_0x4c59e9,_0xea07b)[_0xdd02('0xe')](function(_0x3c8426){logger[_0xdd02('0xf')](_0xdd02('0x10'),_0x595a29,_0xdd02('0x11'));logger[_0xdd02('0x12')](_0xdd02('0x13'),_0x595a29,_0xdd02('0x11'),JSON[_0xdd02('0x14')](_0x3c8426));if(_0x3c8426[_0xdd02('0x15')]){if(_0x3c8426[_0xdd02('0x15')][_0xdd02('0x16')]===0x1f4){logger[_0xdd02('0x15')]('SmsAccount,\x20%s,\x20%s',_0x595a29,_0x3c8426[_0xdd02('0x15')][_0xdd02('0x17')]);return _0x7de9d7(_0x3c8426[_0xdd02('0x15')]['message']);}logger[_0xdd02('0x15')](_0xdd02('0x10'),_0x595a29,_0x3c8426[_0xdd02('0x15')][_0xdd02('0x17')]);return _0x17b3b9(_0x3c8426[_0xdd02('0x15')][_0xdd02('0x17')]);}else{logger[_0xdd02('0xf')](_0xdd02('0x10'),_0x595a29,_0xdd02('0x11'));_0x17b3b9(_0x3c8426['result']['message']);}})[_0xdd02('0x18')](function(_0x3d7d75){logger[_0xdd02('0x15')](_0xdd02('0x10'),_0x595a29,_0x3d7d75);_0x7de9d7(_0x3d7d75);});});}exports[_0xdd02('0x19')]=function(_0x8c92ec){var _0x1992d7=this;return new Promise(function(_0x38494d,_0x562bc5){return db['SmsAccount'][_0xdd02('0x1a')]({'raw':_0x8c92ec[_0xdd02('0x1b')]?_0x8c92ec[_0xdd02('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x8c92ec[_0xdd02('0x1b')]?_0x8c92ec[_0xdd02('0x1b')]['where']||null:null,'attributes':_0x8c92ec[_0xdd02('0x1b')]?_0x8c92ec[_0xdd02('0x1b')][_0xdd02('0x1c')]||null:null,'include':_0x8c92ec[_0xdd02('0x1b')]?_0x8c92ec['options'][_0xdd02('0x1d')]?_[_0xdd02('0x1e')](_0x8c92ec['options'][_0xdd02('0x1d')],function(_0x513af2){return{'model':db[_0x513af2[_0xdd02('0x1f')]],'as':_0x513af2['as'],'attributes':_0x513af2[_0xdd02('0x1c')],'include':_0x513af2[_0xdd02('0x1d')]?_[_0xdd02('0x1e')](_0x513af2[_0xdd02('0x1d')],function(_0x3da556){return{'model':db[_0x3da556['model']],'as':_0x3da556['as'],'attributes':_0x3da556[_0xdd02('0x1c')],'include':_0x3da556[_0xdd02('0x1d')]?_[_0xdd02('0x1e')](_0x3da556[_0xdd02('0x1d')],function(_0x3453c1){return{'model':db[_0x3453c1[_0xdd02('0x1f')]],'as':_0x3453c1['as'],'attributes':_0x3453c1[_0xdd02('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdd02('0xe')](function(_0x58b754){logger['info'](_0xdd02('0x19'),_0x8c92ec);logger['debug']('ShowSmsAccount',_0x8c92ec,JSON[_0xdd02('0x14')](_0x58b754));_0x38494d(_0x58b754);})[_0xdd02('0x18')](function(_0x3d11b8){logger[_0xdd02('0x15')](_0xdd02('0x19'),_0x3d11b8[_0xdd02('0x17')],_0x8c92ec);_0x562bc5(_0x1992d7['error'](0x1f4,_0x3d11b8[_0xdd02('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 5ea0b0d..3052f22 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 c7a500a..26d764d 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 _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x2dd152,_0x720248){var _0x5f7325=function(_0x1abe00){while(--_0x1abe00){_0x2dd152['push'](_0x2dd152['shift']());}};_0x5f7325(++_0x720248);}(_0xe14b,0x93));var _0xbe14=function(_0x325d3f,_0x39fc21){_0x325d3f=_0x325d3f-0x0;var _0x4ffaaa=_0xe14b[_0x325d3f];return _0x4ffaaa;};'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['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router; \ No newline at end of file +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(_0x1ca6b9,_0x341300){var _0x364fdc=function(_0x2499e3){while(--_0x2499e3){_0x1ca6b9['push'](_0x1ca6b9['shift']());}};_0x364fdc(++_0x341300);}(_0x3e74,0x175));var _0x43e7=function(_0x4b645e,_0x3151c8){_0x4b645e=_0x4b645e-0x0;var _0x7ac9bf=_0x3e74[_0x4b645e];return _0x7ac9bf;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 4d731f6..50f5c67 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 _0xf3ed=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x9eb4ef,_0x2628a0){var _0x135a4b=function(_0x19f183){while(--_0x19f183){_0x9eb4ef['push'](_0x9eb4ef['shift']());}};_0x135a4b(++_0x2628a0);}(_0xf3ed,0x1bd));var _0xdf3e=function(_0x2d8090,_0x372c81){_0x2d8090=_0x2d8090-0x0;var _0x316b1e=_0xf3ed[_0x2d8090];return _0x316b1e;};'use strict';var Sequelize=require(_0xdf3e('0x0'));module[_0xdf3e('0x1')]={'priority':{'type':Sequelize[_0xdf3e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdf3e('0x3')],'allowNull':![],'defaultValue':_0xdf3e('0x4')},'appdata':{'type':Sequelize[_0xdf3e('0x5')]()},'description':{'type':Sequelize[_0xdf3e('0x3')]},'interval':{'type':Sequelize[_0xdf3e('0x3')],'defaultValue':_0xdf3e('0x6')}}; \ No newline at end of file +var _0xb8cc=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb8cc,0x11a));var _0xcb8c=function(_0x30ff1c,_0x4ed1f4){_0x30ff1c=_0x30ff1c-0x0;var _0x1e5f51=_0xb8cc[_0x30ff1c];return _0x1e5f51;};'use strict';var Sequelize=require(_0xcb8c('0x0'));module[_0xcb8c('0x1')]={'priority':{'type':Sequelize[_0xcb8c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcb8c('0x3')],'allowNull':![],'defaultValue':_0xcb8c('0x4')},'appdata':{'type':Sequelize[_0xcb8c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcb8c('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 273ad6b..018dd47 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 _0x6bf3=['moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','eml-format','zip-dir','request-promise'];(function(_0x2721f9,_0x43437c){var _0x44ae6d=function(_0x31140b){while(--_0x31140b){_0x2721f9['push'](_0x2721f9['shift']());}};_0x44ae6d(++_0x43437c);}(_0x6bf3,0x16a));var _0x36bf=function(_0x44fd21,_0x47cebc){_0x44fd21=_0x44fd21-0x0;var _0x35c3a8=_0x6bf3[_0x44fd21];return _0x35c3a8;};'use strict';var emlformat=require(_0x36bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x36bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36bf('0x2'));var moment=require(_0x36bf('0x3'));var BPromise=require(_0x36bf('0x4'));var Mustache=require('mustache');var util=require(_0x36bf('0x5'));var path=require('path');var sox=require(_0x36bf('0x6'));var csv=require(_0x36bf('0x7'));var ejs=require(_0x36bf('0x8'));var fs=require('fs');var fs_extra=require(_0x36bf('0x9'));var _=require(_0x36bf('0xa'));var squel=require(_0x36bf('0xb'));var crypto=require(_0x36bf('0xc'));var jsforce=require(_0x36bf('0xd'));var deskjs=require(_0x36bf('0xe'));var toCsv=require(_0x36bf('0x7'));var querystring=require(_0x36bf('0xf'));var Papa=require('papaparse');var Redis=require(_0x36bf('0x10'));var authService=require(_0x36bf('0x11'));var qs=require(_0x36bf('0x12'));var as=require(_0x36bf('0x13'));var hardwareService=require(_0x36bf('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x36bf('0x15'));var config=require(_0x36bf('0x16'));var licenseUtil=require(_0x36bf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x428a4e,_0x2313aa){_0x2313aa=_0x2313aa||0xcc;return function(_0x7aa07f){if(_0x7aa07f){return _0x428a4e[_0x36bf('0x18')](_0x2313aa);}return _0x428a4e[_0x36bf('0x19')](_0x2313aa)[_0x36bf('0x1a')]();};}function respondWithResult(_0x41f845,_0x465558){_0x465558=_0x465558||0xc8;return function(_0x45fb4e){if(_0x45fb4e){return _0x41f845['status'](_0x465558)['json'](_0x45fb4e);}};}function respondWithFilteredResult(_0x2ed6fd,_0x44e3b6){return function(_0x2a8d4e){if(_0x2a8d4e){var _0x311546=typeof _0x44e3b6[_0x36bf('0x1b')]===_0x36bf('0x1c')&&typeof _0x44e3b6[_0x36bf('0x1d')]===_0x36bf('0x1c');var _0x26b75a=_0x2a8d4e[_0x36bf('0x1e')];var _0x7a4ac9=_0x311546?0x0:_0x44e3b6[_0x36bf('0x1b')];var _0x4b02db=_0x311546?_0x2a8d4e[_0x36bf('0x1e')]:_0x44e3b6[_0x36bf('0x1b')]+_0x44e3b6[_0x36bf('0x1d')];var _0x67bc09;if(_0x4b02db>=_0x26b75a){_0x4b02db=_0x26b75a;_0x67bc09=0xc8;}else{_0x67bc09=0xce;}_0x2ed6fd['status'](_0x67bc09);return _0x2ed6fd[_0x36bf('0x1f')](_0x36bf('0x20'),_0x7a4ac9+'-'+_0x4b02db+'/'+_0x26b75a)[_0x36bf('0x21')](_0x2a8d4e);}return null;};}function patchUpdates(_0x3ccb1f){return function(_0x4b9c44){try{jsonpatch['apply'](_0x4b9c44,_0x3ccb1f,!![]);}catch(_0xf22c35){return BPromise[_0x36bf('0x22')](_0xf22c35);}return _0x4b9c44[_0x36bf('0x23')]();};}function saveUpdates(_0x16cdbd,_0x392a17){return function(_0x648ece){if(_0x648ece){return _0x648ece[_0x36bf('0x24')](_0x16cdbd)[_0x36bf('0x25')](function(_0x5d602c){return _0x5d602c;});}return null;};}function removeEntity(_0x2560e9,_0x41a268){return function(_0x532c58){if(_0x532c58){return _0x532c58[_0x36bf('0x26')]()[_0x36bf('0x25')](function(){_0x2560e9[_0x36bf('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d9e51,_0x1836de){return function(_0x1e8c61){if(!_0x1e8c61){_0x4d9e51[_0x36bf('0x18')](0x194);}return _0x1e8c61;};}function handleError(_0x4e1a63,_0x43c973){_0x43c973=_0x43c973||0x1f4;return function(_0x33b95c){logger['error'](_0x33b95c[_0x36bf('0x27')]);if(_0x33b95c[_0x36bf('0x28')]){delete _0x33b95c[_0x36bf('0x28')];}_0x4e1a63[_0x36bf('0x19')](_0x43c973)[_0x36bf('0x29')](_0x33b95c);};}exports['index']=function(_0x2036b5,_0x45af8c){var _0x548ae1={},_0x2b5b3d={},_0x280a93={'count':0x0,'rows':[]};var _0x2692e4=_[_0x36bf('0x2a')](db[_0x36bf('0x2b')][_0x36bf('0x2c')],function(_0x3f1aad){return{'name':_0x3f1aad[_0x36bf('0x2d')],'type':_0x3f1aad[_0x36bf('0x2e')][_0x36bf('0x2f')]};});_0x2b5b3d[_0x36bf('0x30')]=_[_0x36bf('0x2a')](_0x2692e4,_0x36bf('0x28'));_0x2b5b3d[_0x36bf('0x31')]=_['keys'](_0x2036b5['query']);_0x2b5b3d[_0x36bf('0x32')]=_['intersection'](_0x2b5b3d[_0x36bf('0x30')],_0x2b5b3d['query']);_0x548ae1['attributes']=_[_0x36bf('0x33')](_0x2b5b3d[_0x36bf('0x30')],qs[_0x36bf('0x34')](_0x2036b5[_0x36bf('0x31')][_0x36bf('0x34')]));_0x548ae1[_0x36bf('0x35')]=_0x548ae1[_0x36bf('0x35')][_0x36bf('0x36')]?_0x548ae1['attributes']:_0x2b5b3d[_0x36bf('0x30')];if(!_0x2036b5[_0x36bf('0x31')]['hasOwnProperty']('nolimit')){_0x548ae1[_0x36bf('0x1d')]=qs[_0x36bf('0x1d')](_0x2036b5[_0x36bf('0x31')][_0x36bf('0x1d')]);_0x548ae1[_0x36bf('0x1b')]=qs[_0x36bf('0x1b')](_0x2036b5[_0x36bf('0x31')][_0x36bf('0x1b')]);}_0x548ae1[_0x36bf('0x37')]=qs[_0x36bf('0x38')](_0x2036b5['query'][_0x36bf('0x38')]);_0x548ae1[_0x36bf('0x39')]=qs[_0x36bf('0x32')](_[_0x36bf('0x3a')](_0x2036b5[_0x36bf('0x31')],_0x2b5b3d[_0x36bf('0x32')]),_0x2692e4);if(_0x2036b5[_0x36bf('0x31')][_0x36bf('0x3b')]){_0x548ae1[_0x36bf('0x39')]=_['merge'](_0x548ae1['where'],{'$or':_[_0x36bf('0x2a')](_0x2692e4,function(_0x4da7a6){if(_0x4da7a6[_0x36bf('0x2e')]!==_0x36bf('0x3c')){var _0x106fbd={};_0x106fbd[_0x4da7a6[_0x36bf('0x28')]]={'$like':'%'+_0x2036b5[_0x36bf('0x31')][_0x36bf('0x3b')]+'%'};return _0x106fbd;}})});}_0x548ae1=_[_0x36bf('0x3d')]({},_0x548ae1,_0x2036b5[_0x36bf('0x3e')]);var _0x19f2ee={'where':_0x548ae1[_0x36bf('0x39')]};return db[_0x36bf('0x2b')][_0x36bf('0x1e')](_0x19f2ee)[_0x36bf('0x25')](function(_0x12c341){_0x280a93[_0x36bf('0x1e')]=_0x12c341;if(_0x2036b5['query']['includeAll']){_0x548ae1[_0x36bf('0x3f')]=[{'all':!![]}];}return db[_0x36bf('0x2b')][_0x36bf('0x40')](_0x548ae1);})[_0x36bf('0x25')](function(_0x32df97){_0x280a93[_0x36bf('0x41')]=_0x32df97;return _0x280a93;})[_0x36bf('0x25')](respondWithFilteredResult(_0x45af8c,_0x548ae1))[_0x36bf('0x42')](handleError(_0x45af8c,null));};exports['show']=function(_0x17cf3d,_0x431dbd){var _0x3693f6={'raw':!![],'where':{'id':_0x17cf3d[_0x36bf('0x43')]['id']}},_0x1b6eab={};_0x1b6eab[_0x36bf('0x30')]=_[_0x36bf('0x44')](db[_0x36bf('0x2b')]['rawAttributes']);_0x1b6eab['query']=_[_0x36bf('0x44')](_0x17cf3d[_0x36bf('0x31')]);_0x1b6eab[_0x36bf('0x32')]=_[_0x36bf('0x33')](_0x1b6eab[_0x36bf('0x30')],_0x1b6eab[_0x36bf('0x31')]);_0x3693f6[_0x36bf('0x35')]=_[_0x36bf('0x33')](_0x1b6eab[_0x36bf('0x30')],qs[_0x36bf('0x34')](_0x17cf3d[_0x36bf('0x31')][_0x36bf('0x34')]));_0x3693f6[_0x36bf('0x35')]=_0x3693f6[_0x36bf('0x35')]['length']?_0x3693f6['attributes']:_0x1b6eab[_0x36bf('0x30')];if(_0x17cf3d['query'][_0x36bf('0x45')]){_0x3693f6[_0x36bf('0x3f')]=[{'all':!![]}];}_0x3693f6=_['merge']({},_0x3693f6,_0x17cf3d[_0x36bf('0x3e')]);return db[_0x36bf('0x2b')][_0x36bf('0x46')](_0x3693f6)[_0x36bf('0x25')](handleEntityNotFound(_0x431dbd,null))[_0x36bf('0x25')](respondWithResult(_0x431dbd,null))[_0x36bf('0x42')](handleError(_0x431dbd,null));};exports[_0x36bf('0x47')]=function(_0x592c54,_0x4635ad){return db[_0x36bf('0x2b')][_0x36bf('0x47')](_0x592c54[_0x36bf('0x48')],{})[_0x36bf('0x25')](respondWithResult(_0x4635ad,0xc9))['catch'](handleError(_0x4635ad,null));};exports[_0x36bf('0x24')]=function(_0x4eb763,_0x5dca88){if(_0x4eb763[_0x36bf('0x48')]['id']){delete _0x4eb763[_0x36bf('0x48')]['id'];}return db[_0x36bf('0x2b')][_0x36bf('0x46')]({'where':{'id':_0x4eb763['params']['id']}})['then'](handleEntityNotFound(_0x5dca88,null))[_0x36bf('0x25')](saveUpdates(_0x4eb763[_0x36bf('0x48')],null))[_0x36bf('0x25')](respondWithResult(_0x5dca88,null))['catch'](handleError(_0x5dca88,null));};exports[_0x36bf('0x26')]=function(_0x1230d2,_0x226949){return db[_0x36bf('0x2b')]['find']({'where':{'id':_0x1230d2[_0x36bf('0x43')]['id']}})['then'](handleEntityNotFound(_0x226949,null))[_0x36bf('0x25')](removeEntity(_0x226949,null))[_0x36bf('0x42')](handleError(_0x226949,null));}; \ No newline at end of file +var _0x2112=['request-promise','bluebird','mustache','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','eml-format','zip-dir'];(function(_0x4970d6,_0x2e6b07){var _0x2857f3=function(_0x447128){while(--_0x447128){_0x4970d6['push'](_0x4970d6['shift']());}};_0x2857f3(++_0x2e6b07);}(_0x2112,0x8c));var _0x2211=function(_0xaab0a9,_0x394bcc){_0xaab0a9=_0xaab0a9-0x0;var _0x367f01=_0x2112[_0xaab0a9];return _0x367f01;};'use strict';var emlformat=require(_0x2211('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2211('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2211('0x2'));var moment=require('moment');var BPromise=require(_0x2211('0x3'));var Mustache=require(_0x2211('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2211('0x5'));var _=require(_0x2211('0x6'));var squel=require(_0x2211('0x7'));var crypto=require('crypto');var jsforce=require(_0x2211('0x8'));var deskjs=require(_0x2211('0x9'));var toCsv=require('to-csv');var querystring=require(_0x2211('0xa'));var Papa=require(_0x2211('0xb'));var Redis=require('ioredis');var authService=require(_0x2211('0xc'));var qs=require(_0x2211('0xd'));var as=require(_0x2211('0xe'));var hardwareService=require(_0x2211('0xf'));var logger=require(_0x2211('0x10'))(_0x2211('0x11'));var utils=require(_0x2211('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x2211('0x13'));var db=require(_0x2211('0x14'))['db'];function respondWithStatusCode(_0x34acd2,_0x5e508d){_0x5e508d=_0x5e508d||0xcc;return function(_0x5474d3){if(_0x5474d3){return _0x34acd2[_0x2211('0x15')](_0x5e508d);}return _0x34acd2[_0x2211('0x16')](_0x5e508d)[_0x2211('0x17')]();};}function respondWithResult(_0x5cc309,_0x14c563){_0x14c563=_0x14c563||0xc8;return function(_0x6a12be){if(_0x6a12be){return _0x5cc309[_0x2211('0x16')](_0x14c563)[_0x2211('0x18')](_0x6a12be);}};}function respondWithFilteredResult(_0x1dcb43,_0x3e41de){return function(_0x2e9969){if(_0x2e9969){var _0x37edbf=typeof _0x3e41de[_0x2211('0x19')]==='undefined'&&typeof _0x3e41de[_0x2211('0x1a')]===_0x2211('0x1b');var _0x2a8770=_0x2e9969[_0x2211('0x1c')];var _0x4ddfb1=_0x37edbf?0x0:_0x3e41de[_0x2211('0x19')];var _0x461654=_0x37edbf?_0x2e9969[_0x2211('0x1c')]:_0x3e41de['offset']+_0x3e41de['limit'];var _0x2220f4;if(_0x461654>=_0x2a8770){_0x461654=_0x2a8770;_0x2220f4=0xc8;}else{_0x2220f4=0xce;}_0x1dcb43['status'](_0x2220f4);return _0x1dcb43[_0x2211('0x1d')](_0x2211('0x1e'),_0x4ddfb1+'-'+_0x461654+'/'+_0x2a8770)[_0x2211('0x18')](_0x2e9969);}return null;};}function patchUpdates(_0x27c1a3){return function(_0x35db54){try{jsonpatch['apply'](_0x35db54,_0x27c1a3,!![]);}catch(_0xea2edf){return BPromise[_0x2211('0x1f')](_0xea2edf);}return _0x35db54[_0x2211('0x20')]();};}function saveUpdates(_0x3adbcb,_0xc7af86){return function(_0x5767c5){if(_0x5767c5){return _0x5767c5[_0x2211('0x21')](_0x3adbcb)[_0x2211('0x22')](function(_0x4d0e1a){return _0x4d0e1a;});}return null;};}function removeEntity(_0x333c6c,_0x1f445e){return function(_0x1a4786){if(_0x1a4786){return _0x1a4786[_0x2211('0x23')]()[_0x2211('0x22')](function(){_0x333c6c[_0x2211('0x16')](0xcc)[_0x2211('0x17')]();});}};}function handleEntityNotFound(_0x163aba,_0x57b4c4){return function(_0x460d21){if(!_0x460d21){_0x163aba[_0x2211('0x15')](0x194);}return _0x460d21;};}function handleError(_0xa1277a,_0x1fc1b0){_0x1fc1b0=_0x1fc1b0||0x1f4;return function(_0x13201c){logger['error'](_0x13201c['stack']);if(_0x13201c[_0x2211('0x24')]){delete _0x13201c[_0x2211('0x24')];}_0xa1277a['status'](_0x1fc1b0)[_0x2211('0x25')](_0x13201c);};}exports[_0x2211('0x26')]=function(_0x328971,_0x5232a6){var _0x71e239={},_0x5d9aaf={},_0x2f9300={'count':0x0,'rows':[]};var _0x4e3afd=_[_0x2211('0x27')](db[_0x2211('0x28')][_0x2211('0x29')],function(_0x5d8820){return{'name':_0x5d8820[_0x2211('0x2a')],'type':_0x5d8820[_0x2211('0x2b')][_0x2211('0x2c')]};});_0x5d9aaf[_0x2211('0x2d')]=_[_0x2211('0x27')](_0x4e3afd,_0x2211('0x24'));_0x5d9aaf[_0x2211('0x2e')]=_[_0x2211('0x2f')](_0x328971[_0x2211('0x2e')]);_0x5d9aaf[_0x2211('0x30')]=_[_0x2211('0x31')](_0x5d9aaf[_0x2211('0x2d')],_0x5d9aaf['query']);_0x71e239[_0x2211('0x32')]=_[_0x2211('0x31')](_0x5d9aaf['model'],qs['fields'](_0x328971[_0x2211('0x2e')][_0x2211('0x33')]));_0x71e239['attributes']=_0x71e239['attributes'][_0x2211('0x34')]?_0x71e239[_0x2211('0x32')]:_0x5d9aaf[_0x2211('0x2d')];if(!_0x328971[_0x2211('0x2e')][_0x2211('0x35')](_0x2211('0x36'))){_0x71e239[_0x2211('0x1a')]=qs[_0x2211('0x1a')](_0x328971[_0x2211('0x2e')][_0x2211('0x1a')]);_0x71e239['offset']=qs[_0x2211('0x19')](_0x328971[_0x2211('0x2e')][_0x2211('0x19')]);}_0x71e239[_0x2211('0x37')]=qs[_0x2211('0x38')](_0x328971[_0x2211('0x2e')]['sort']);_0x71e239[_0x2211('0x39')]=qs['filters'](_[_0x2211('0x3a')](_0x328971[_0x2211('0x2e')],_0x5d9aaf[_0x2211('0x30')]),_0x4e3afd);if(_0x328971[_0x2211('0x2e')]['filter']){_0x71e239[_0x2211('0x39')]=_[_0x2211('0x3b')](_0x71e239['where'],{'$or':_[_0x2211('0x27')](_0x4e3afd,function(_0x10fe46){if(_0x10fe46[_0x2211('0x2b')]!==_0x2211('0x3c')){var _0x4376e0={};_0x4376e0[_0x10fe46['name']]={'$like':'%'+_0x328971[_0x2211('0x2e')]['filter']+'%'};return _0x4376e0;}})});}_0x71e239=_[_0x2211('0x3b')]({},_0x71e239,_0x328971['options']);var _0x58f77a={'where':_0x71e239[_0x2211('0x39')]};return db[_0x2211('0x28')][_0x2211('0x1c')](_0x58f77a)[_0x2211('0x22')](function(_0x51f22a){_0x2f9300['count']=_0x51f22a;if(_0x328971[_0x2211('0x2e')]['includeAll']){_0x71e239[_0x2211('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0x2211('0x3e')](_0x71e239);})[_0x2211('0x22')](function(_0x5e5c2c){_0x2f9300['rows']=_0x5e5c2c;return _0x2f9300;})[_0x2211('0x22')](respondWithFilteredResult(_0x5232a6,_0x71e239))[_0x2211('0x3f')](handleError(_0x5232a6,null));};exports[_0x2211('0x40')]=function(_0x2a5a48,_0x34e24b){var _0x5c70d7={'raw':!![],'where':{'id':_0x2a5a48[_0x2211('0x41')]['id']}},_0x243937={};_0x243937[_0x2211('0x2d')]=_[_0x2211('0x2f')](db['SmsApplication']['rawAttributes']);_0x243937[_0x2211('0x2e')]=_[_0x2211('0x2f')](_0x2a5a48[_0x2211('0x2e')]);_0x243937[_0x2211('0x30')]=_[_0x2211('0x31')](_0x243937[_0x2211('0x2d')],_0x243937[_0x2211('0x2e')]);_0x5c70d7[_0x2211('0x32')]=_[_0x2211('0x31')](_0x243937[_0x2211('0x2d')],qs[_0x2211('0x33')](_0x2a5a48['query']['fields']));_0x5c70d7[_0x2211('0x32')]=_0x5c70d7['attributes'][_0x2211('0x34')]?_0x5c70d7[_0x2211('0x32')]:_0x243937[_0x2211('0x2d')];if(_0x2a5a48[_0x2211('0x2e')][_0x2211('0x42')]){_0x5c70d7[_0x2211('0x3d')]=[{'all':!![]}];}_0x5c70d7=_['merge']({},_0x5c70d7,_0x2a5a48[_0x2211('0x43')]);return db[_0x2211('0x28')][_0x2211('0x44')](_0x5c70d7)[_0x2211('0x22')](handleEntityNotFound(_0x34e24b,null))['then'](respondWithResult(_0x34e24b,null))['catch'](handleError(_0x34e24b,null));};exports[_0x2211('0x45')]=function(_0x23cc63,_0x579ac7){return db[_0x2211('0x28')][_0x2211('0x45')](_0x23cc63[_0x2211('0x46')],{})[_0x2211('0x22')](respondWithResult(_0x579ac7,0xc9))[_0x2211('0x3f')](handleError(_0x579ac7,null));};exports[_0x2211('0x21')]=function(_0x5b09d9,_0x330888){if(_0x5b09d9['body']['id']){delete _0x5b09d9['body']['id'];}return db[_0x2211('0x28')]['find']({'where':{'id':_0x5b09d9[_0x2211('0x41')]['id']}})[_0x2211('0x22')](handleEntityNotFound(_0x330888,null))['then'](saveUpdates(_0x5b09d9[_0x2211('0x46')],null))['then'](respondWithResult(_0x330888,null))[_0x2211('0x3f')](handleError(_0x330888,null));};exports[_0x2211('0x23')]=function(_0x21ff6a,_0x3c892c){return db[_0x2211('0x28')]['find']({'where':{'id':_0x21ff6a[_0x2211('0x41')]['id']}})[_0x2211('0x22')](handleEntityNotFound(_0x3c892c,null))[_0x2211('0x22')](removeEntity(_0x3c892c,null))['catch'](handleError(_0x3c892c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 43ade8f..41463fb 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 _0x2fc8=['../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x2fc8,0x12d));var _0x82fc=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2fc8[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x82fc('0x0'));var util=require('util');var logger=require(_0x82fc('0x1'))(_0x82fc('0x2'));var moment=require(_0x82fc('0x3'));var BPromise=require(_0x82fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x82fc('0x5'));var rimraf=require(_0x82fc('0x6'));var config=require(_0x82fc('0x7'));var attributes=require(_0x82fc('0x8'));module[_0x82fc('0x9')]=function(_0x38a60d,_0x128c4d){return _0x38a60d[_0x82fc('0xa')]('SmsApplication',attributes,{'tableName':_0x82fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x82fc('0xc'),'collate':_0x82fc('0xd')});}; \ No newline at end of file +var _0x131a=['sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','SmsApplication'];(function(_0x440454,_0x4a323d){var _0x4bb436=function(_0x525122){while(--_0x525122){_0x440454['push'](_0x440454['shift']());}};_0x4bb436(++_0x4a323d);}(_0x131a,0x18b));var _0xa131=function(_0x4e80e1,_0xe94205){_0x4e80e1=_0x4e80e1-0x0;var _0x38be88=_0x131a[_0x4e80e1];return _0x38be88;};'use strict';var _=require(_0xa131('0x0'));var util=require(_0xa131('0x1'));var logger=require(_0xa131('0x2'))(_0xa131('0x3'));var moment=require(_0xa131('0x4'));var BPromise=require('bluebird');var rp=require(_0xa131('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa131('0x6'));var config=require(_0xa131('0x7'));var attributes=require('./smsApplication.attributes');module[_0xa131('0x8')]=function(_0xdb263c,_0x1a51cf){return _0xdb263c[_0xa131('0x9')](_0xa131('0xa'),attributes,{'tableName':_0xa131('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa131('0xc'),'collate':_0xa131('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index dcd3277..0111333 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 _0x3588=['rpc','../../config/environment','jayson/promise','http','request','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3588,0x82));var _0x8358=function(_0x3f9602,_0x132175){_0x3f9602=_0x3f9602-0x0;var _0x5133ea=_0x3588[_0x3f9602];return _0x5133ea;};'use strict';var _=require(_0x8358('0x0'));var util=require(_0x8358('0x1'));var moment=require(_0x8358('0x2'));var BPromise=require(_0x8358('0x3'));var rs=require(_0x8358('0x4'));var fs=require('fs');var Redis=require(_0x8358('0x5'));var db=require(_0x8358('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8358('0x7'))(_0x8358('0x8'));var config=require(_0x8358('0x9'));var jayson=require(_0x8358('0xa'));var client=jayson['client'][_0x8358('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x846201,_0x49d515,_0x11d369){return new BPromise(function(_0x583720,_0x1bf7dc){return client[_0x8358('0xc')](_0x846201,_0x11d369)[_0x8358('0xd')](function(_0x1085d9){logger['info'](_0x8358('0xe'),_0x49d515,'request\x20sent');logger[_0x8358('0xf')](_0x8358('0x10'),_0x49d515,_0x8358('0x11'),JSON[_0x8358('0x12')](_0x1085d9));if(_0x1085d9[_0x8358('0x13')]){if(_0x1085d9[_0x8358('0x13')][_0x8358('0x14')]===0x1f4){logger[_0x8358('0x13')](_0x8358('0xe'),_0x49d515,_0x1085d9[_0x8358('0x13')][_0x8358('0x15')]);return _0x1bf7dc(_0x1085d9[_0x8358('0x13')][_0x8358('0x15')]);}logger[_0x8358('0x13')](_0x8358('0xe'),_0x49d515,_0x1085d9[_0x8358('0x13')]['message']);return _0x583720(_0x1085d9['error'][_0x8358('0x15')]);}else{logger['info'](_0x8358('0xe'),_0x49d515,'request\x20sent');_0x583720(_0x1085d9['result']['message']);}})[_0x8358('0x16')](function(_0x31d71f){logger[_0x8358('0x13')](_0x8358('0xe'),_0x49d515,_0x31d71f);_0x1bf7dc(_0x31d71f);});});} \ No newline at end of file +var _0x8a5c=['request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x58eae0,_0x3a2bc2){var _0x4f63cf=function(_0x55c14a){while(--_0x55c14a){_0x58eae0['push'](_0x58eae0['shift']());}};_0x4f63cf(++_0x3a2bc2);}(_0x8a5c,0x136));var _0xc8a5=function(_0x5e5718,_0x36258a){_0x5e5718=_0x5e5718-0x0;var _0x33d659=_0x8a5c[_0x5e5718];return _0x33d659;};'use strict';var _=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var moment=require(_0xc8a5('0x2'));var BPromise=require(_0xc8a5('0x3'));var rs=require(_0xc8a5('0x4'));var fs=require('fs');var Redis=require(_0xc8a5('0x5'));var db=require(_0xc8a5('0x6'))['db'];var utils=require(_0xc8a5('0x7'));var logger=require(_0xc8a5('0x8'))('rpc');var config=require(_0xc8a5('0x9'));var jayson=require(_0xc8a5('0xa'));var client=jayson['client'][_0xc8a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcee97e,_0xd6de78,_0xa9f42c){return new BPromise(function(_0x4d25e4,_0x3ecf08){return client[_0xc8a5('0xc')](_0xcee97e,_0xa9f42c)[_0xc8a5('0xd')](function(_0x2c1fe9){logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,_0xc8a5('0x10'));logger[_0xc8a5('0x11')](_0xc8a5('0x12'),_0xd6de78,'request\x20sent',JSON['stringify'](_0x2c1fe9));if(_0x2c1fe9[_0xc8a5('0x13')]){if(_0x2c1fe9['error'][_0xc8a5('0x14')]===0x1f4){logger[_0xc8a5('0x13')](_0xc8a5('0xf'),_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x3ecf08(_0x2c1fe9['error'][_0xc8a5('0x15')]);}logger[_0xc8a5('0x13')]('SmsApplication,\x20%s,\x20%s',_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x4d25e4(_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);}else{logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,'request\x20sent');_0x4d25e4(_0x2c1fe9[_0xc8a5('0x16')][_0xc8a5('0x15')]);}})['catch'](function(_0x36a78b){logger[_0xc8a5('0x13')]('SmsApplication,\x20%s,\x20%s',_0xd6de78,_0x36a78b);_0x3ecf08(_0x36a78b);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index c1e1fa1..431ec34 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9348=['addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','put','/:id','tracked','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id/messages','getMessages','/:id/download','download','post','create'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x9348,0x10d));var _0x8934=function(_0x2fc5ce,_0x177847){_0x2fc5ce=_0x2fc5ce-0x0;var _0xcb2f1=_0x9348[_0x2fc5ce];return _0xcb2f1;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var fs_extra=require(_0x8934('0x5'));var auth=require(_0x8934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8934('0x7'));var controller=require(_0x8934('0x8'));router[_0x8934('0x9')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0xb')]);router[_0x8934('0x9')]('/describe',auth[_0x8934('0xa')](),controller[_0x8934('0xc')]);router[_0x8934('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x8934('0xd'),auth['isAuthenticated'](),controller[_0x8934('0xe')]);router[_0x8934('0x9')](_0x8934('0xf'),auth[_0x8934('0xa')](),controller[_0x8934('0x10')]);router[_0x8934('0x11')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0x12')]);router['post'](_0x8934('0xd'),auth[_0x8934('0xa')](),controller[_0x8934('0x13')]);router[_0x8934('0x11')](_0x8934('0x14'),auth[_0x8934('0xa')](),interaction['tracked'](_0x8934('0x15'),_0x8934('0x16')),controller[_0x8934('0x17')]);router[_0x8934('0x18')](_0x8934('0x19'),auth[_0x8934('0xa')](),interaction[_0x8934('0x1a')](_0x8934('0x15'),'smsinteraction:update'),controller[_0x8934('0x1b')]);router[_0x8934('0x1c')](_0x8934('0x19'),auth['isAuthenticated'](),interaction['tracked']('sms',_0x8934('0x1d')),controller['destroy']);router[_0x8934('0x1c')](_0x8934('0x14'),auth[_0x8934('0xa')](),controller[_0x8934('0x1e')]);module[_0x8934('0x1f')]=router; \ No newline at end of file +var _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x56da9c,_0x100463){var _0x475fbb=function(_0x488bce){while(--_0x488bce){_0x56da9c['push'](_0x56da9c['shift']());}};_0x475fbb(++_0x100463);}(_0x955f,0x1eb));var _0xf955=function(_0x35c3a6,_0x272182){_0x35c3a6=_0x35c3a6-0x0;var _0x4d72a5=_0x955f[_0x35c3a6];return _0x4d72a5;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 8ad721e..66859b4 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 _0xc1fa=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x2c5340,_0x5c86e5){var _0x3c505e=function(_0x1089d9){while(--_0x1089d9){_0x2c5340['push'](_0x2c5340['shift']());}};_0x3c505e(++_0x5c86e5);}(_0xc1fa,0x83));var _0xac1f=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0xc1fa[_0x40911a];return _0x27e8e3;};'use strict';var Sequelize=require(_0xac1f('0x0'));var moment=require(_0xac1f('0x1'));module[_0xac1f('0x2')]={'closed':{'type':Sequelize[_0xac1f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xac1f('0x4')]},'disposition':{'type':Sequelize[_0xac1f('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xac1f('0x5')]},'note':{'type':Sequelize[_0xac1f('0x5')]},'phone':{'type':Sequelize[_0xac1f('0x5')]},'read1stAt':{'type':Sequelize[_0xac1f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xac1f('0x6')]('in',_0xac1f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xac1f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xac1f('0x6')]('in',_0xac1f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xac1f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2494=['DATE','STRING','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x54f6a,_0x331aa8){var _0x15081a=function(_0x16a9f6){while(--_0x16a9f6){_0x54f6a['push'](_0x54f6a['shift']());}};_0x15081a(++_0x331aa8);}(_0x2494,0x82));var _0x4249=function(_0xfefa58,_0x33c53d){_0xfefa58=_0xfefa58-0x0;var _0x38dc12=_0x2494[_0xfefa58];return _0x38dc12;};'use strict';var Sequelize=require(_0x4249('0x0'));var moment=require('moment');module[_0x4249('0x1')]={'closed':{'type':Sequelize[_0x4249('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4249('0x3')]},'disposition':{'type':Sequelize[_0x4249('0x4')]},'secondDisposition':{'type':Sequelize[_0x4249('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4249('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4249('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4249('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4249('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4249('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4249('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index dbc7d6d..b70748f 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 _0x05a0=['sqlOperator','conditions','find','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','ContactId','buildExpression','type','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','role','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.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','groupBy','push','all','rows','show','includeAll','include','create','update','params','destroy','describe','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','SmsInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','setTags','findAll','emit','removeTags','unix','join','server','tmp','root','files','attachments','fullname','CmContact','lastName','Messages','direction','secret','SmsAccount','get','mkdirSync','Sms','Account','Owner','N.A.','closed','closedAt','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','status','json','undefined','limit','count','offset','set','apply','then','error','stack','name','send','map','TagIds','Tags','split','forEach','catch','index','SmsInteraction','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','field','color','from','tools_tags','select','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch'];(function(_0x20eacd,_0x2394e2){var _0x57942a=function(_0xd86eda){while(--_0xd86eda){_0x20eacd['push'](_0x20eacd['shift']());}};_0x57942a(++_0x2394e2);}(_0x05a0,0x94));var _0x005a=function(_0x1fe694,_0x258d8f){_0x1fe694=_0x1fe694-0x0;var _0x41dcac=_0x05a0[_0x1fe694];return _0x41dcac;};'use strict';var emlformat=require(_0x005a('0x0'));var rimraf=require(_0x005a('0x1'));var zipdir=require(_0x005a('0x2'));var jsonpatch=require(_0x005a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x005a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x005a('0x5'));var sox=require(_0x005a('0x6'));var csv=require(_0x005a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x005a('0x8'));var squel=require(_0x005a('0x9'));var crypto=require(_0x005a('0xa'));var jsforce=require(_0x005a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x005a('0x7'));var querystring=require('querystring');var Papa=require(_0x005a('0xc'));var Redis=require(_0x005a('0xd'));var authService=require(_0x005a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x005a('0xf'));var pdf=require(_0x005a('0x10'));var hardwareService=require(_0x005a('0x11'));var logger=require(_0x005a('0x12'))(_0x005a('0x13'));var utils=require(_0x005a('0x14'));var config=require(_0x005a('0x15'));var licenseUtil=require(_0x005a('0x16'));var db=require(_0x005a('0x17'))['db'];config[_0x005a('0x18')]=_['defaults'](config[_0x005a('0x18')],{'host':_0x005a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x51ce6c,_0x30742c){_0x30742c=_0x30742c||0xcc;return function(_0x10e312){if(_0x10e312){return _0x51ce6c['sendStatus'](_0x30742c);}return _0x51ce6c[_0x005a('0x1a')](_0x30742c)['end']();};}function respondWithResult(_0x5aed59,_0x3fd599){_0x3fd599=_0x3fd599||0xc8;return function(_0x4eb786){if(_0x4eb786){return _0x5aed59[_0x005a('0x1a')](_0x3fd599)[_0x005a('0x1b')](_0x4eb786);}};}function respondWithFilteredResult(_0x188dcc,_0x58f16f){return function(_0x1bc4ca){if(_0x1bc4ca){var _0xe89a1f=typeof _0x58f16f['offset']===_0x005a('0x1c')&&typeof _0x58f16f[_0x005a('0x1d')]===_0x005a('0x1c');var _0x28081b=_0x1bc4ca[_0x005a('0x1e')];var _0x13fabd=_0xe89a1f?0x0:_0x58f16f[_0x005a('0x1f')];var _0x3a681f=_0xe89a1f?_0x1bc4ca['count']:_0x58f16f[_0x005a('0x1f')]+_0x58f16f['limit'];var _0x46138b;if(_0x3a681f>=_0x28081b){_0x3a681f=_0x28081b;_0x46138b=0xc8;}else{_0x46138b=0xce;}_0x188dcc['status'](_0x46138b);return _0x188dcc[_0x005a('0x20')]('Content-Range',_0x13fabd+'-'+_0x3a681f+'/'+_0x28081b)[_0x005a('0x1b')](_0x1bc4ca);}return null;};}function patchUpdates(_0x4adb93){return function(_0x20bceb){try{jsonpatch[_0x005a('0x21')](_0x20bceb,_0x4adb93,!![]);}catch(_0x52684a){return BPromise['reject'](_0x52684a);}return _0x20bceb['save']();};}function saveUpdates(_0x520230,_0x5ec221){return function(_0x1da082){if(_0x1da082){return _0x1da082['update'](_0x520230)[_0x005a('0x22')](function(_0x4a5174){return _0x4a5174;});}return null;};}function removeEntity(_0x40f032,_0x19feb7){return function(_0x2f4a9f){if(_0x2f4a9f){return _0x2f4a9f['destroy']()[_0x005a('0x22')](function(){_0x40f032[_0x005a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e11b6,_0x54658b){return function(_0x5d3b99){if(!_0x5d3b99){_0x2e11b6['sendStatus'](0x194);}return _0x5d3b99;};}function handleError(_0x1b0586,_0x3491c6){_0x3491c6=_0x3491c6||0x1f4;return function(_0x2ecbc7){logger[_0x005a('0x23')](_0x2ecbc7[_0x005a('0x24')]);if(_0x2ecbc7[_0x005a('0x25')]){delete _0x2ecbc7[_0x005a('0x25')];}_0x1b0586[_0x005a('0x1a')](_0x3491c6)[_0x005a('0x26')](_0x2ecbc7);};}function getInteractionUsers(_0x358f3e,_0x2fa971){return new BPromise(function(_0x4d6f66,_0xb1a657){try{if(_0x2fa971[_0x358f3e['id']]){_0x358f3e['Users']=_[_0x005a('0x27')](_0x2fa971[_0x358f3e['id']],function(_0x13a885){return{'id':_0x13a885['id'],'fullname':_0x13a885['fullname']};});}}catch(_0x30721a){_0xb1a657(_0x30721a);}_0x4d6f66(_0x358f3e);});}function getInteractionTags(_0x3b8f1c,_0x4ca7c9){return new BPromise(function(_0x4f72c6,_0x5c6a52){try{if(_0x3b8f1c[_0x005a('0x28')]){_0x3b8f1c[_0x005a('0x29')]=[];_0x3b8f1c['TagIds'][_0x005a('0x2a')](',')[_0x005a('0x2b')](function(_0x9415cf){_0x3b8f1c[_0x005a('0x29')]['push'](_0x4ca7c9[_0x9415cf]);});}delete _0x3b8f1c[_0x005a('0x28')];}catch(_0x3fcf8d){_0x5c6a52(_0x3fcf8d);}_0x4f72c6(_0x3b8f1c);});}function updateSmsInteraction(_0x45222c,_0x3fc151,_0x1f335e){return new BPromise(function(_0x4adf27,_0x530869){return getInteractionUsers(_0x45222c,_0x1f335e)[_0x005a('0x22')](function(_0x5cdf8f){return getInteractionTags(_0x5cdf8f,_0x3fc151);})['then'](function(_0x1dd566){_0x4adf27(_0x1dd566);})[_0x005a('0x2c')](function(_0x32844d){_0x530869(_0x32844d);});});}exports[_0x005a('0x2d')]=function(_0x4f799c,_0x13d2c3){var _0x2aface={},_0x569835={},_0x38129a={'count':0x0,'rows':[]};var _0x4430b9=_['map'](db[_0x005a('0x2e')][_0x005a('0x2f')],function(_0xfc134b){return{'name':_0xfc134b[_0x005a('0x30')],'type':_0xfc134b['type'][_0x005a('0x31')]};});_0x569835[_0x005a('0x32')]=_[_0x005a('0x27')](_0x4430b9,'name');_0x569835[_0x005a('0x33')]=_['keys'](_0x4f799c['query']);_0x569835[_0x005a('0x34')]=_[_0x005a('0x35')](_0x569835[_0x005a('0x32')],_0x569835[_0x005a('0x33')]);_0x2aface[_0x005a('0x36')]=_['intersection'](_0x569835[_0x005a('0x32')],qs[_0x005a('0x37')](_0x4f799c[_0x005a('0x33')][_0x005a('0x37')]));_0x2aface[_0x005a('0x36')]=_0x2aface[_0x005a('0x36')][_0x005a('0x38')]?_0x2aface[_0x005a('0x36')]:_0x569835[_0x005a('0x32')];if(!_0x4f799c[_0x005a('0x33')]['hasOwnProperty'](_0x005a('0x39'))){_0x2aface[_0x005a('0x1d')]=qs['limit'](_0x4f799c[_0x005a('0x33')][_0x005a('0x1d')]);_0x2aface['offset']=qs[_0x005a('0x1f')](_0x4f799c[_0x005a('0x33')][_0x005a('0x1f')]);}_0x2aface[_0x005a('0x3a')]=qs[_0x005a('0x3b')](_0x4f799c[_0x005a('0x33')]['sort']);_0x2aface[_0x005a('0x3c')]=qs[_0x005a('0x34')](_['pick'](_0x4f799c[_0x005a('0x33')],_0x569835[_0x005a('0x34')]),_0x4430b9);var _0x3d3f3b=[];var _0xb39a66=squel['select']()[_0x005a('0x3d')]('id')['field'](_0x005a('0x25'))[_0x005a('0x3d')](_0x005a('0x3e'))[_0x005a('0x3f')](_0x005a('0x40'));var _0xb4daef=squel[_0x005a('0x41')]()['field']('u.id')['field'](_0x005a('0x42'))[_0x005a('0x3d')](_0x005a('0x43'))[_0x005a('0x3f')](_0x005a('0x44'),'ui')[_0x005a('0x45')]('users','u','u.id\x20=\x20ui.UserId');var _0x24d21b=squel[_0x005a('0x41')]()[_0x005a('0x3f')]('sms_interactions','i')[_0x005a('0x45')](_0x005a('0x46'),'c',_0x005a('0x47'))[_0x005a('0x45')](_0x005a('0x48'),'o',_0x005a('0x49'))['left_join'](_0x005a('0x4a'),'a',_0x005a('0x4b'))[_0x005a('0x45')](_0x005a('0x4c'),'me',_0x005a('0x4d'))[_0x005a('0x45')](_0x005a('0x4e'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x005a('0x45')]('tools_tags','t',_0x005a('0x4f'));var _0x49204c=squel[_0x005a('0x50')]();var _0x132f20=[];var _0x10f315=squel[_0x005a('0x50')]();var _0x40f4f1;if(_0x4f799c[_0x005a('0x33')][_0x005a('0x51')]){_0x40f4f1=as[_0x005a('0x52')](_0x4f799c['query']['search']);var _0x4f9f11=_0x40f4f1[_0x005a('0x53')];for(var _0x14a662=0x0;_0x14a662<_0x40f4f1[_0x005a('0x54')][_0x005a('0x38')];_0x14a662++){var _0x2b4f07=_0x40f4f1[_0x005a('0x54')][_0x14a662];var _0x4f4342='i';var _0xfaf7be=_[_0x005a('0x55')](_0x4430b9,[_0x005a('0x25'),_0x2b4f07[_0x005a('0x3d')]]);if(!_0xfaf7be){switch(_0x2b4f07[_0x005a('0x3d')]){case'unreadMessages':if(_0x2b4f07['value']==0x1){_0x24d21b[_0x005a('0x56')]('`'+_0x2b4f07[_0x005a('0x3d')]+_0x005a('0x57'));}else{_0x24d21b[_0x005a('0x56')]('`'+_0x2b4f07[_0x005a('0x3d')]+'`\x20>\x200');}break;case _0x005a('0x58'):if(_0x2b4f07[_0x005a('0x59')]===_0x005a('0x5a')){if(_0x2b4f07[_0x005a('0x5b')]['split']('\x20')[_0x005a('0x38')]>0x1){_0x49204c[_0x4f9f11](_0x005a('0x5c'),qs[_0x005a('0x5d')](_0x2b4f07[_0x005a('0x5b')]),null);}else{var _0x5e200e='%'+_0x2b4f07['value']+'%';_0x49204c[_0x4f9f11]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5e200e,_0x5e200e,_0x5e200e);}}else{_0xfaf7be=_[_0x005a('0x55')](_0x4430b9,[_0x005a('0x25'),_0x005a('0x5e')]);_0x2b4f07['field']=_0x005a('0x5e');_0x48dcad=as[_0x005a('0x5f')](_0x4f4342,_0xfaf7be[_0x005a('0x60')],_0x2b4f07);_0x49204c[_0x4f9f11](_0x48dcad[_0x005a('0x61')],_0x48dcad[_0x005a('0x5b')][_0x005a('0x62')],_0x48dcad['value'][_0x005a('0x63')]);}break;case _0x005a('0x64'):var _0x15bf5b=_0x2b4f07[_0x005a('0x5b')][_0x005a('0x2a')](',')[_0x005a('0x27')](function(_0x53fc2e){return Number(_0x53fc2e);});_0x15bf5b['forEach'](function(_0x47504f){_0x10f315['or'](_0x005a('0x65'),'%,'+_0x47504f+',%');});_0x132f20=_[_0x005a('0x66')](_0x132f20,_0x15bf5b);break;case _0x005a('0x67'):if(_0x2b4f07[_0x005a('0x59')]==='$substring'){_0x49204c[_0x4f9f11](_0x005a('0x68'),'%'+_0x2b4f07[_0x005a('0x5b')]+'%',null);}else{_0xfaf7be=_[_0x005a('0x55')](_0x4430b9,['name',_0x005a('0x69')]);_0x2b4f07[_0x005a('0x3d')]=_0x005a('0x69');_0x48dcad=as[_0x005a('0x5f')](_0x4f4342,_0xfaf7be[_0x005a('0x60')],_0x2b4f07);_0x49204c[_0x4f9f11](_0x48dcad[_0x005a('0x61')],_0x48dcad[_0x005a('0x5b')][_0x005a('0x62')],_0x48dcad[_0x005a('0x5b')][_0x005a('0x63')]);}break;case _0x005a('0x6a'):_0x48dcad=as[_0x005a('0x5f')]('me',null,_0x2b4f07);_0x49204c[_0x4f9f11](_0x48dcad[_0x005a('0x61')],_0x48dcad[_0x005a('0x5b')][_0x005a('0x62')],_0x48dcad['value'][_0x005a('0x63')]);break;}}else{var _0x48dcad=as[_0x005a('0x5f')](_0x4f4342,_0xfaf7be['type'],_0x2b4f07);_0x49204c[_0x4f9f11](_0x48dcad[_0x005a('0x61')],_0x48dcad[_0x005a('0x5b')][_0x005a('0x62')],_0x48dcad[_0x005a('0x5b')]['end']);}}}else{var _0x130a32=_(_0x4f799c[_0x005a('0x33')])[_0x005a('0x6b')]()[_0x005a('0x27')](function(_0x1835bf){return _['some'](_0x4430b9,[_0x005a('0x25'),_0x1835bf])?_0x1835bf:undefined;})[_0x005a('0x6c')]()['value']();if(!_[_0x005a('0x6d')](_0x130a32)){_0x130a32[_0x005a('0x2b')](function(_0x5572fa){if(_0x5572fa===_0x005a('0x6e')){_0x24d21b['where'](_0x005a('0x6f'),[][_0x005a('0x70')](_0x4f799c[_0x005a('0x33')][_0x5572fa]));}else if(_0x5572fa===_0x005a('0x71')){var _0xa56929=JSON[_0x005a('0x72')](_0x4f799c[_0x005a('0x33')][_0x5572fa])['$gte'];var _0x21a9a9=JSON[_0x005a('0x72')](_0x4f799c[_0x005a('0x33')][_0x5572fa])[_0x005a('0x73')];_0x24d21b[_0x005a('0x3c')](_0x005a('0x74'),_0xa56929,_0x21a9a9);}else{if(_0x4f799c[_0x005a('0x33')][_0x5572fa]===_0x005a('0x75')){_0x24d21b[_0x005a('0x3c')]('i.'+_0x5572fa+'\x20IS\x20NULL');}else{_0x24d21b[_0x005a('0x3c')]('i.'+_0x5572fa+_0x005a('0x76'),_0x4f799c[_0x005a('0x33')][_0x5572fa]);}}});}if(_0x4f799c[_0x005a('0x33')][_0x005a('0x77')]){if(_0x4f799c[_0x005a('0x33')][_0x005a('0x77')]==0x1){_0x24d21b['having'](_0x005a('0x78'));}else{_0x24d21b['having']('`unreadMessages`\x20>\x200');}}if(_0x4f799c['query']['tag']){_0x132f20=_[_0x005a('0x79')](_0x4f799c[_0x005a('0x33')][_0x005a('0x7a')])?_0x4f799c[_0x005a('0x33')]['tag']:new Array(_0x4f799c[_0x005a('0x33')][_0x005a('0x7a')]);_0x132f20[_0x005a('0x2b')](function(_0x5c3c71){_0x10f315['or'](_0x005a('0x65'),'%,'+_0x5c3c71+',%');});}if(_0x4f799c['query'][_0x005a('0x7b')]){var _0x50e91a=_0x4f799c[_0x005a('0x33')][_0x005a('0x7b')][_0x005a('0x7c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x50e91a)){_0x49204c['or'](_0x005a('0x7d'),_0x50e91a+'%')['or'](_0x005a('0x7e'),_0x50e91a+'%');}else{_0x49204c['or'](_0x005a('0x7f'),qs[_0x005a('0x5d')](_0x50e91a))['or'](_0x005a('0x80'),_0x50e91a+'%');}}}_0x24d21b['where'](_0x49204c);_0x24d21b[_0x005a('0x81')](_0x005a('0x82'));var _0x4804ba={'type':db[_0x005a('0x83')][_0x005a('0x84')][_0x005a('0x85')],'raw':!![]};var _0x1d4259=_0x24d21b[_0x005a('0x86')]();_0x1d4259['field'](_0x005a('0x82'));_0x1d4259[_0x005a('0x3d')](_0x005a('0x87'),'unreadMessages');if(_0x2aface[_0x005a('0x3a')]){_0x2aface['order']['forEach'](function(_0x4253ee){var _0x1906b2=_0x4253ee[0x0]===_0x005a('0x88')?_0x4253ee[0x0]:'i.'+_0x4253ee[0x0];_0x24d21b[_0x005a('0x3a')](_0x1906b2,_0x4253ee[0x1]===_0x005a('0x89')?![]:!![]);});}if(!_[_0x005a('0x6d')](_0x132f20)){_0x24d21b[_0x005a('0x56')](_0x10f315);_0x1d4259[_0x005a('0x3c')]('t.id\x20IN\x20?',_0x132f20);}BPromise[_0x005a('0x8a')]()[_0x005a('0x22')](function(){if(!_0x40f4f1){if(_0x4f799c[_0x005a('0x33')]['SmsAccountId'])return;_0x1d4259[_0x005a('0x3c')](_0x005a('0x8b'));_0x24d21b[_0x005a('0x3c')](_0x005a('0x8b'));return;}if(_0x4f799c['user']['role']!==_0x005a('0x8c'))return;return _0x4f799c[_0x005a('0x8d')][_0x005a('0x8e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x10b782){if(_[_0x005a('0x6d')](_0x10b782)){_0x1d4259['where'](_0x005a('0x8f'));_0x24d21b[_0x005a('0x3c')](_0x005a('0x8f'));}else{_0x1d4259[_0x005a('0x3c')](_0x005a('0x6f'),_[_0x005a('0x27')](_0x10b782,'id'));_0x24d21b[_0x005a('0x3c')](_0x005a('0x6f'),_[_0x005a('0x27')](_0x10b782,'id'));}});})['then'](function(){if(_0x4f799c[_0x005a('0x8d')][_0x005a('0x90')]===_0x005a('0x8c')&&!_0x40f4f1&&!_0x4f799c[_0x005a('0x33')][_0x005a('0x6e')])return[];return db['sequelize']['query'](_0x1d4259[_0x005a('0x91')](),_0x4804ba);})[_0x005a('0x22')](function(_0x13c993){_0x38129a[_0x005a('0x1e')]=_0x13c993[_0x005a('0x38')];if(_0x38129a[_0x005a('0x1e')]===0x0)return[];return db['sequelize'][_0x005a('0x33')](_0xb39a66[_0x005a('0x91')](),_0x4804ba)[_0x005a('0x22')](function(_0xb14b20){_0x3d3f3b=_[_0x005a('0x92')](_0xb14b20,'id');_0x4804ba=_[_0x005a('0x93')](_0x4804ba,{'model':db[_0x005a('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f799c[_0x005a('0x33')][_0x005a('0x37')]){_0x2aface['attributes'][_0x005a('0x2b')](function(_0x7c354){_0x24d21b[_0x005a('0x3d')]('i.'+_0x7c354);});}else{_0x24d21b['field'](_0x005a('0x87'),'unreadMessages');_0x24d21b[_0x005a('0x3d')](_0x005a('0x94'),_0x005a('0x95'));_0x24d21b[_0x005a('0x3d')](_0x005a('0x96'),'Account.mandatoryDisposition');_0x24d21b['field'](_0x005a('0x97'),_0x005a('0x88'));_0x24d21b['field'](_0x005a('0x98'));_0x24d21b[_0x005a('0x3d')](_0x005a('0x99'),_0x005a('0x9a'));_0x24d21b['field']('c.lastName','Contact.lastName');_0x24d21b[_0x005a('0x3d')](_0x005a('0x9b'),_0x005a('0x9c'));_0x24d21b[_0x005a('0x3d')](_0x005a('0x9d'),_0x005a('0x9e'));_0x24d21b[_0x005a('0x3d')]('c.mobile',_0x005a('0x9f'));_0x24d21b[_0x005a('0x3d')](_0x005a('0xa0'),_0x005a('0xa1'));_0x24d21b[_0x005a('0x3d')](_0x005a('0xa2'),_0x005a('0xa3'));_0x24d21b[_0x005a('0x3d')](_0x005a('0xa4'),_0x005a('0xa5'));_0x24d21b[_0x005a('0x3d')](_0x005a('0xa6'),_0x005a('0x28'));}if(_0x2aface[_0x005a('0x1d')])_0x24d21b[_0x005a('0x1d')](_0x2aface['limit']);if(_0x2aface[_0x005a('0x1f')])_0x24d21b['offset'](_0x2aface[_0x005a('0x1f')]);return db[_0x005a('0xa7')][_0x005a('0x33')](_0x24d21b[_0x005a('0x91')](),_0x4804ba);})[_0x005a('0x22')](function(_0x397ea7){if(_0x397ea7[_0x005a('0x38')]>0x0)_0xb4daef[_0x005a('0x3c')](_0x005a('0xa8'),_[_0x005a('0x27')](_0x397ea7,'id'));return db[_0x005a('0xa7')][_0x005a('0x33')](_0xb4daef[_0x005a('0x91')](),_0x4804ba)[_0x005a('0x22')](function(_0x8a5888){var _0xf4fa23=_[_0x005a('0xa9')](_0x8a5888,'SmsInteractionId');var _0x15a643=[];_0x397ea7[_0x005a('0x2b')](function(_0x2d579c){_0x15a643[_0x005a('0xaa')](updateSmsInteraction(_0x2d579c,_0x3d3f3b,_0xf4fa23));});return BPromise[_0x005a('0xab')](_0x15a643);});});})[_0x005a('0x22')](function(_0x5b8f56){_0x38129a[_0x005a('0xac')]=_0x5b8f56;return _0x38129a;})[_0x005a('0x22')](respondWithFilteredResult(_0x13d2c3,_0x2aface))[_0x005a('0x2c')](handleError(_0x13d2c3,null));};exports[_0x005a('0xad')]=function(_0x34b299,_0x30f43e){var _0x38cc37={'raw':![],'where':{'id':_0x34b299['params']['id']}},_0x50ef34={};_0x50ef34[_0x005a('0x32')]=_[_0x005a('0x6b')](db[_0x005a('0x2e')][_0x005a('0x2f')]);_0x50ef34[_0x005a('0x33')]=_[_0x005a('0x6b')](_0x34b299['query']);_0x50ef34['filters']=_['intersection'](_0x50ef34[_0x005a('0x32')],_0x50ef34[_0x005a('0x33')]);_0x38cc37['attributes']=_[_0x005a('0x35')](_0x50ef34['model'],qs[_0x005a('0x37')](_0x34b299['query'][_0x005a('0x37')]));_0x38cc37[_0x005a('0x36')]=_0x38cc37['attributes'][_0x005a('0x38')]?_0x38cc37[_0x005a('0x36')]:_0x50ef34[_0x005a('0x32')];if(_0x34b299[_0x005a('0x33')][_0x005a('0xae')]){_0x38cc37[_0x005a('0xaf')]=[{'all':!![]}];}_0x38cc37=_['merge']({},_0x38cc37,_0x34b299['options']);return db[_0x005a('0x2e')][_0x005a('0x55')](_0x38cc37)[_0x005a('0x22')](handleEntityNotFound(_0x30f43e,null))[_0x005a('0x22')](respondWithResult(_0x30f43e,null))['catch'](handleError(_0x30f43e,null));};exports[_0x005a('0xb0')]=function(_0x37acdd,_0x4a3cad){return db['SmsInteraction'][_0x005a('0xb0')](_0x37acdd[_0x005a('0x6a')],{})[_0x005a('0x22')](respondWithResult(_0x4a3cad,0xc9))[_0x005a('0x2c')](handleError(_0x4a3cad,null));};exports[_0x005a('0xb1')]=function(_0x29427f,_0x39d125){if(_0x29427f[_0x005a('0x6a')]['id']){delete _0x29427f[_0x005a('0x6a')]['id'];}return db[_0x005a('0x2e')]['find']({'where':{'id':_0x29427f[_0x005a('0xb2')]['id']}})[_0x005a('0x22')](handleEntityNotFound(_0x39d125,null))[_0x005a('0x22')](saveUpdates(_0x29427f['body'],null))[_0x005a('0x22')](respondWithResult(_0x39d125,null))[_0x005a('0x2c')](handleError(_0x39d125,null));};exports[_0x005a('0xb3')]=function(_0x4731bf,_0x314a76){return db[_0x005a('0x2e')]['find']({'where':{'id':_0x4731bf[_0x005a('0xb2')]['id']}})[_0x005a('0x22')](handleEntityNotFound(_0x314a76,null))[_0x005a('0x22')](removeEntity(_0x314a76,null))[_0x005a('0x2c')](handleError(_0x314a76,null));};exports[_0x005a('0xb4')]=function(_0x15a4ff,_0x31f274){return db[_0x005a('0x2e')]['describe']()[_0x005a('0x22')](respondWithResult(_0x31f274,null))[_0x005a('0x2c')](handleError(_0x31f274,null));};exports['addMessage']=function(_0x233d82,_0x182cd5,_0x380f58){return db[_0x005a('0xb5')][_0x005a('0x55')]({'where':{'id':_0x233d82[_0x005a('0xb2')]['id']}})[_0x005a('0x22')](handleEntityNotFound(_0x182cd5,null))[_0x005a('0x22')](function(_0x13ff91){if(_0x13ff91){return _0x13ff91['addMessage'](_0x233d82[_0x005a('0x6a')][_0x005a('0xb6')],_[_0x005a('0xb7')](_0x233d82[_0x005a('0x6a')],[_0x005a('0xb6'),'id'])||{});}})['then'](respondWithResult(_0x182cd5,null))[_0x005a('0x2c')](handleError(_0x182cd5,null));};exports[_0x005a('0xb8')]=function(_0x520062,_0x3150f8,_0x53ef9b){var _0x360496={'raw':![],'where':{}};var _0x346f51={};var _0x28f6ea={'count':0x0,'rows':[]};return db[_0x005a('0x2e')][_0x005a('0xb9')]({'where':{'id':_0x520062[_0x005a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x3150f8,null))[_0x005a('0x22')](function(_0x405e5b){if(_0x405e5b){_0x346f51[_0x005a('0x32')]=_[_0x005a('0x6b')](db[_0x005a('0xb5')][_0x005a('0x2f')]);_0x346f51[_0x005a('0x33')]=_[_0x005a('0x6b')](_0x520062[_0x005a('0x33')]);_0x346f51[_0x005a('0x34')]=_[_0x005a('0x35')](_0x346f51['model'],_0x346f51[_0x005a('0x33')]);_0x360496[_0x005a('0x36')]=_[_0x005a('0x35')](_0x346f51[_0x005a('0x32')],qs[_0x005a('0x37')](_0x520062['query'][_0x005a('0x37')]));_0x360496[_0x005a('0x36')]=_0x360496[_0x005a('0x36')]['length']?_0x360496[_0x005a('0x36')]:_0x346f51[_0x005a('0x32')];if(!_0x520062[_0x005a('0x33')][_0x005a('0xba')](_0x005a('0x39'))){_0x360496['limit']=qs[_0x005a('0x1d')](_0x520062[_0x005a('0x33')][_0x005a('0x1d')]);_0x360496['offset']=qs[_0x005a('0x1f')](_0x520062[_0x005a('0x33')][_0x005a('0x1f')]);}_0x360496['order']=qs[_0x005a('0x3b')](_0x520062['query']['sort']);_0x360496[_0x005a('0x3c')]=qs[_0x005a('0x34')](_[_0x005a('0xbb')](_0x520062['query'],_0x346f51[_0x005a('0x34')]));_0x360496[_0x005a('0x3c')][_0x005a('0xbc')]=_0x405e5b['id'];if(_0x520062[_0x005a('0x33')][_0x005a('0x7b')]){_0x360496[_0x005a('0x3c')]=_['merge'](_0x360496[_0x005a('0x3c')],{'$or':_[_0x005a('0x27')](_0x360496[_0x005a('0x36')],function(_0x2d35a5){var _0x2711a4={};_0x2711a4[_0x2d35a5]={'$like':'%'+_0x520062[_0x005a('0x33')][_0x005a('0x7b')]+'%'};return _0x2711a4;})});}if(_0x520062[_0x005a('0x33')][_0x005a('0xbd')]){var _0x3883f6=_0x520062[_0x005a('0x33')][_0x005a('0xbd')][_0x005a('0x2a')](',');var _0x4447eb={};_0x4447eb[_0x3883f6[0x0]]={'$gte':moment(_0x3883f6[0x1])[_0x005a('0xbe')](_0x005a('0xbf'))};_0x360496['where']=_[_0x005a('0x93')](_0x360496[_0x005a('0x3c')],_0x4447eb);}_0x360496=_[_0x005a('0x93')]({},_0x360496,_0x520062[_0x005a('0xc0')]);return db['SmsMessage'][_0x005a('0x1e')]({'where':_0x360496[_0x005a('0x3c')]})['then'](function(_0x149bbd){_0x28f6ea[_0x005a('0x1e')]=_0x149bbd;if(_0x520062[_0x005a('0x33')][_0x005a('0xae')]){_0x360496[_0x005a('0xaf')]=[{'all':!![]}];}return db[_0x005a('0xb5')]['findAll'](_0x360496);})[_0x005a('0x22')](function(_0x4f5382){_0x28f6ea[_0x005a('0xac')]=_0x4f5382;return _0x28f6ea;});}})[_0x005a('0x22')](respondWithFilteredResult(_0x3150f8,_0x360496))[_0x005a('0x2c')](handleError(_0x3150f8,null));};exports[_0x005a('0xc1')]=function(_0x37656d,_0x33f360,_0x4c9bf7){return db[_0x005a('0x2e')]['find']({'where':{'id':_0x37656d[_0x005a('0xb2')]['id']}})[_0x005a('0x22')](handleEntityNotFound(_0x33f360,null))['then'](function(_0x1e4cea){if(_0x1e4cea){return _0x1e4cea[_0x005a('0xc2')](_0x37656d[_0x005a('0x6a')][_0x005a('0xb6')],_['omit'](_0x37656d['body'],[_0x005a('0xb6'),'id'])||{})['spread'](function(){return db[_0x005a('0x64')][_0x005a('0xc3')]({'attributes':['id',_0x005a('0x25'),_0x005a('0x3e')],'where':{'id':_0x37656d[_0x005a('0x6a')][_0x005a('0xb6')]}});})[_0x005a('0x22')](function(_0x99080d){socket[_0x005a('0xc4')]('smsInteractionTags:save',{'id':Number(_0x37656d[_0x005a('0xb2')]['id']),'tags':_0x99080d||[]});return{'id':Number(_0x37656d[_0x005a('0xb2')]['id']),'tags':_0x99080d||[]};});}})['then'](respondWithResult(_0x33f360,null))['catch'](handleError(_0x33f360,null));};exports['removeTags']=function(_0x1166d3,_0x24bde7,_0x3d3fb8){return db['SmsInteraction'][_0x005a('0x55')]({'where':{'id':_0x1166d3[_0x005a('0xb2')]['id']}})[_0x005a('0x22')](handleEntityNotFound(_0x24bde7,null))[_0x005a('0x22')](function(_0x55f237){if(_0x55f237){return _0x55f237[_0x005a('0xc5')](_0x1166d3['query'][_0x005a('0xb6')]);}})[_0x005a('0x22')](respondWithStatusCode(_0x24bde7,null))['catch'](handleError(_0x24bde7,null));};exports['download']=function(_0x47ce95,_0x325a20){var _0x182fc9=moment()[_0x005a('0xc6')]()[_0x005a('0x91')]();var _0x18cae4=path[_0x005a('0xc7')](config['root'],_0x005a('0xc8'),'files',_0x005a('0xc9'));var _0x151d0e=path[_0x005a('0xc7')](config[_0x005a('0xca')],_0x005a('0xc8'),_0x005a('0xcb'),_0x005a('0xcc'));var _0x4d3719=path[_0x005a('0xc7')](_0x18cae4,_0x182fc9);var _0x21e5c2=util[_0x005a('0xbe')]('transcript-%d-%s.zip',_0x47ce95[_0x005a('0xb2')]['id'],_0x182fc9);var _0x11a1fb=path[_0x005a('0xc7')](_0x18cae4,_0x21e5c2);var _0x1893b3=[];_0x1893b3[_0x005a('0xaa')]({'model':db[_0x005a('0x67')],'as':_0x005a('0x67'),'attributes':['id',_0x005a('0xcd')],'raw':!![]});_0x1893b3['push']({'model':db[_0x005a('0xce')],'as':_0x005a('0x58'),'attributes':['id','firstName',_0x005a('0xcf')],'raw':!![]});var _0x3c6fe6=[{'model':db['SmsMessage'],'as':_0x005a('0xd0'),'attributes':['id',_0x005a('0x6a'),_0x005a('0x71'),_0x005a('0xd1'),_0x005a('0xd2'),_0x005a('0x77')],'include':_0x1893b3}];_0x3c6fe6[_0x005a('0xaa')]({'model':db[_0x005a('0xd3')],'as':'Account','attributes':['id',_0x005a('0x25')]});_0x3c6fe6[_0x005a('0xaa')]({'model':db[_0x005a('0x67')],'as':'Owner','attributes':['id',_0x005a('0xcd')]});return db[_0x005a('0x2e')]['find']({'where':{'id':_0x47ce95[_0x005a('0xb2')]['id']},'include':_0x3c6fe6})['then'](handleEntityNotFound(_0x325a20,null))[_0x005a('0x22')](function(_0x2a35a3){if(_0x2a35a3){var _0x3ede2f=_0x2a35a3[_0x005a('0xd4')]({'plain':!![]});fs[_0x005a('0xd5')](_0x4d3719);var _0x421441={'channel':_0x005a('0xd6'),'account':_0x3ede2f[_0x005a('0xd7')]['name'],'agent':_0x3ede2f[_0x005a('0xd8')]?_0x3ede2f[_0x005a('0xd8')][_0x005a('0xcd')]:_0x005a('0xd9'),'createdAt':moment(_0x3ede2f['createdAt'])[_0x005a('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0x005a('0x91')](),'closedAt':_0x3ede2f[_0x005a('0xda')]?moment(_0x3ede2f[_0x005a('0xdb')])[_0x005a('0xbe')](_0x005a('0xbf'))['toString']():'','disposition':_0x3ede2f['disposition'],'messages':_(_0x3ede2f['Messages'])[_0x005a('0x7b')]({'secret':![]})[_0x005a('0x27')](function(_0xf367b){return{'date':moment(_0xf367b[_0x005a('0x71')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x005a('0x91')](),'sender':_0xf367b['direction']===_0x005a('0xdc')?_0xf367b['User']?_0xf367b[_0x005a('0x67')][_0x005a('0xcd')]:_0x005a('0xdd'):_0xf367b[_0x005a('0x58')]['firstName']+(_0xf367b[_0x005a('0x58')][_0x005a('0xcf')]?'\x20'+_0xf367b[_0x005a('0x58')][_0x005a('0xcf')]:''),'body':_0xf367b['body'],'direction':_0xf367b[_0x005a('0xd1')]===_0x005a('0xdc')?'A':'C','secret':_0xf367b[_0x005a('0xd2')],'read':_0xf367b[_0x005a('0x77')]};})['value']()};return ejs[_0x005a('0xde')](path[_0x005a('0xc7')](config[_0x005a('0xca')],_0x005a('0xc8'),'views',_0x005a('0xdf')),{'interaction':_0x421441})[_0x005a('0x22')](function(_0x5b0ca0){var _0x4bb338=path['join'](_0x4d3719,_0x005a('0xe0')+_0x3ede2f['id']+'-'+_0x182fc9+_0x005a('0xe1'));var _0x25a1db={'path':_0x4bb338,'channel':_0x005a('0xd6'),'interactionId':_0x3ede2f['id']};return pdf['createPdfFromHTML'](_0x5b0ca0,_0x25a1db);})[_0x005a('0x22')](function(){return new BPromise(function(_0x475a77,_0x14feb8){zipdir(_0x4d3719,{'saveTo':_0x11a1fb},function(_0x2e3a97,_0xe7894d){if(_0x2e3a97)return _0x14feb8(_0x2e3a97);return _0x475a77(_0xe7894d);});})[_0x005a('0x22')](function(){return new BPromise(function(_0x1ab2e4,_0xed51b9){rimraf(_0x4d3719,function(_0x1e9b44){if(_0x1e9b44)_0xed51b9(_0x1e9b44);return _0x1ab2e4();});});})[_0x005a('0x22')](function(){return _0x325a20[_0x005a('0xe2')](_0x11a1fb,_0x21e5c2,function(_0x2d6647){if(_0x2d6647){console[_0x005a('0xe3')](_0x005a('0xe4'),_0x2d6647);}else{fs[_0x005a('0xe5')](_0x11a1fb);}});});});}else{return _0x325a20[_0x005a('0xe6')](0xc8);}})[_0x005a('0x2c')](handleError(_0x325a20,null));}; \ No newline at end of file +var _0x0ee8=['save','update','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','then','catch','SmsInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','field','from','u.id','u.fullname','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','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','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','merge','options','create','body','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','findAll','smsInteractionTags:save','removeTags','download','server','tmp','join','root','attachments','format','transcript-%d-%s.zip','User','CmContact','lastName','createdAt','direction','SmsAccount','Account','Owner','get','N.A.','closedAt','disposition','Messages','out','System','firstName','secret','renderFile','Sms','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x23e028,_0x3287ca){var _0x2514bf=function(_0x2845a2){while(--_0x2845a2){_0x23e028['push'](_0x23e028['shift']());}};_0x2514bf(++_0x3287ca);}(_0x0ee8,0xbc));var _0x80ee=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0ee8[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80ee('0x0'));var zipdir=require(_0x80ee('0x1'));var jsonpatch=require(_0x80ee('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x80ee('0x3'));var Mustache=require(_0x80ee('0x4'));var util=require(_0x80ee('0x5'));var path=require(_0x80ee('0x6'));var sox=require(_0x80ee('0x7'));var csv=require('to-csv');var ejs=require(_0x80ee('0x8'));var fs=require('fs');var fs_extra=require(_0x80ee('0x9'));var _=require(_0x80ee('0xa'));var squel=require(_0x80ee('0xb'));var crypto=require(_0x80ee('0xc'));var jsforce=require(_0x80ee('0xd'));var deskjs=require(_0x80ee('0xe'));var toCsv=require(_0x80ee('0xf'));var querystring=require(_0x80ee('0x10'));var Papa=require('papaparse');var Redis=require(_0x80ee('0x11'));var authService=require(_0x80ee('0x12'));var qs=require(_0x80ee('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x80ee('0x14'));var hardwareService=require(_0x80ee('0x15'));var logger=require('../../config/logger')(_0x80ee('0x16'));var utils=require(_0x80ee('0x17'));var config=require(_0x80ee('0x18'));var licenseUtil=require(_0x80ee('0x19'));var db=require(_0x80ee('0x1a'))['db'];config['redis']=_[_0x80ee('0x1b')](config[_0x80ee('0x1c')],{'host':_0x80ee('0x1d'),'port':0x18eb});var socket=require(_0x80ee('0x1e'))(new Redis(config[_0x80ee('0x1c')]));require(_0x80ee('0x1f'))[_0x80ee('0x20')](socket);function respondWithStatusCode(_0x1a36ff,_0x219508){_0x219508=_0x219508||0xcc;return function(_0x35d68f){if(_0x35d68f){return _0x1a36ff[_0x80ee('0x21')](_0x219508);}return _0x1a36ff[_0x80ee('0x22')](_0x219508)[_0x80ee('0x23')]();};}function respondWithResult(_0xed6df,_0x1c6afd){_0x1c6afd=_0x1c6afd||0xc8;return function(_0x1878b9){if(_0x1878b9){return _0xed6df['status'](_0x1c6afd)[_0x80ee('0x24')](_0x1878b9);}};}function respondWithFilteredResult(_0x560dc7,_0x5621b5){return function(_0x462c8a){if(_0x462c8a){var _0xfe39ed=typeof _0x5621b5[_0x80ee('0x25')]==='undefined'&&typeof _0x5621b5[_0x80ee('0x26')]===_0x80ee('0x27');var _0x597967=_0x462c8a[_0x80ee('0x28')];var _0x5cf9a7=_0xfe39ed?0x0:_0x5621b5[_0x80ee('0x25')];var _0x4604be=_0xfe39ed?_0x462c8a[_0x80ee('0x28')]:_0x5621b5['offset']+_0x5621b5['limit'];var _0x20ede6;if(_0x4604be>=_0x597967){_0x4604be=_0x597967;_0x20ede6=0xc8;}else{_0x20ede6=0xce;}_0x560dc7[_0x80ee('0x22')](_0x20ede6);return _0x560dc7[_0x80ee('0x29')](_0x80ee('0x2a'),_0x5cf9a7+'-'+_0x4604be+'/'+_0x597967)[_0x80ee('0x24')](_0x462c8a);}return null;};}function patchUpdates(_0x3238a0){return function(_0x1a9202){try{jsonpatch[_0x80ee('0x2b')](_0x1a9202,_0x3238a0,!![]);}catch(_0xacd47e){return BPromise[_0x80ee('0x2c')](_0xacd47e);}return _0x1a9202[_0x80ee('0x2d')]();};}function saveUpdates(_0x8a1976,_0x598c5e){return function(_0x42af66){if(_0x42af66){return _0x42af66[_0x80ee('0x2e')](_0x8a1976)['then'](function(_0x57e22e){return _0x57e22e;});}return null;};}function removeEntity(_0x42d68c,_0x36ae71){return function(_0x18bf3b){if(_0x18bf3b){return _0x18bf3b[_0x80ee('0x2f')]()['then'](function(){_0x42d68c[_0x80ee('0x22')](0xcc)[_0x80ee('0x23')]();});}};}function handleEntityNotFound(_0x1c97e8,_0x23159a){return function(_0x1c3f32){if(!_0x1c3f32){_0x1c97e8['sendStatus'](0x194);}return _0x1c3f32;};}function handleError(_0x4df0c6,_0x3aeaa6){_0x3aeaa6=_0x3aeaa6||0x1f4;return function(_0x33a7b0){logger[_0x80ee('0x30')](_0x33a7b0[_0x80ee('0x31')]);if(_0x33a7b0[_0x80ee('0x32')]){delete _0x33a7b0[_0x80ee('0x32')];}_0x4df0c6[_0x80ee('0x22')](_0x3aeaa6)[_0x80ee('0x33')](_0x33a7b0);};}function getInteractionUsers(_0x248840,_0x1a91ac){return new BPromise(function(_0x2f8eb7,_0x5a65b5){try{if(_0x1a91ac[_0x248840['id']]){_0x248840[_0x80ee('0x34')]=_[_0x80ee('0x35')](_0x1a91ac[_0x248840['id']],function(_0x94af0b){return{'id':_0x94af0b['id'],'fullname':_0x94af0b[_0x80ee('0x36')]};});}}catch(_0x6627dc){_0x5a65b5(_0x6627dc);}_0x2f8eb7(_0x248840);});}function getInteractionTags(_0x157d6a,_0xa0870d){return new BPromise(function(_0x34b000,_0x1fca8c){try{if(_0x157d6a[_0x80ee('0x37')]){_0x157d6a[_0x80ee('0x38')]=[];_0x157d6a[_0x80ee('0x37')][_0x80ee('0x39')](',')[_0x80ee('0x3a')](function(_0x56763a){_0x157d6a['Tags'][_0x80ee('0x3b')](_0xa0870d[_0x56763a]);});}delete _0x157d6a[_0x80ee('0x37')];}catch(_0x5f06cb){_0x1fca8c(_0x5f06cb);}_0x34b000(_0x157d6a);});}function updateSmsInteraction(_0x3bc59b,_0x361b1f,_0x4eadbf){return new BPromise(function(_0x99ec4,_0x25d0f8){return getInteractionUsers(_0x3bc59b,_0x4eadbf)[_0x80ee('0x3c')](function(_0x55c5d9){return getInteractionTags(_0x55c5d9,_0x361b1f);})['then'](function(_0x38660f){_0x99ec4(_0x38660f);})[_0x80ee('0x3d')](function(_0x3cc040){_0x25d0f8(_0x3cc040);});});}exports['index']=function(_0x4536a4,_0x2e7971){var _0x47a6c5={},_0x33100e={},_0x1e9ae0={'count':0x0,'rows':[]};var _0x186ca0=_[_0x80ee('0x35')](db[_0x80ee('0x3e')][_0x80ee('0x3f')],function(_0x393190){return{'name':_0x393190['fieldName'],'type':_0x393190[_0x80ee('0x40')][_0x80ee('0x41')]};});_0x33100e[_0x80ee('0x42')]=_[_0x80ee('0x35')](_0x186ca0,_0x80ee('0x32'));_0x33100e[_0x80ee('0x43')]=_[_0x80ee('0x44')](_0x4536a4[_0x80ee('0x43')]);_0x33100e['filters']=_[_0x80ee('0x45')](_0x33100e[_0x80ee('0x42')],_0x33100e['query']);_0x47a6c5[_0x80ee('0x46')]=_['intersection'](_0x33100e[_0x80ee('0x42')],qs[_0x80ee('0x47')](_0x4536a4[_0x80ee('0x43')][_0x80ee('0x47')]));_0x47a6c5[_0x80ee('0x46')]=_0x47a6c5[_0x80ee('0x46')]['length']?_0x47a6c5[_0x80ee('0x46')]:_0x33100e[_0x80ee('0x42')];if(!_0x4536a4[_0x80ee('0x43')][_0x80ee('0x48')](_0x80ee('0x49'))){_0x47a6c5[_0x80ee('0x26')]=qs[_0x80ee('0x26')](_0x4536a4[_0x80ee('0x43')]['limit']);_0x47a6c5[_0x80ee('0x25')]=qs[_0x80ee('0x25')](_0x4536a4[_0x80ee('0x43')]['offset']);}_0x47a6c5[_0x80ee('0x4a')]=qs['sort'](_0x4536a4['query'][_0x80ee('0x4b')]);_0x47a6c5['where']=qs[_0x80ee('0x4c')](_[_0x80ee('0x4d')](_0x4536a4[_0x80ee('0x43')],_0x33100e[_0x80ee('0x4c')]),_0x186ca0);var _0x3be8d7=[];var _0x5c1909=squel['select']()[_0x80ee('0x4e')]('id')['field'](_0x80ee('0x32'))[_0x80ee('0x4e')]('color')[_0x80ee('0x4f')]('tools_tags');var _0x491d8b=squel['select']()[_0x80ee('0x4e')](_0x80ee('0x50'))['field'](_0x80ee('0x51'))['field']('ui.SmsInteractionId')['from'](_0x80ee('0x52'),'ui')[_0x80ee('0x53')]('users','u',_0x80ee('0x54'));var _0x398c97=squel['select']()[_0x80ee('0x4f')](_0x80ee('0x55'),'i')[_0x80ee('0x53')](_0x80ee('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x80ee('0x53')](_0x80ee('0x57'),'o',_0x80ee('0x58'))[_0x80ee('0x53')](_0x80ee('0x59'),'a',_0x80ee('0x5a'))[_0x80ee('0x53')](_0x80ee('0x5b'),'me',_0x80ee('0x5c'))[_0x80ee('0x53')](_0x80ee('0x5d'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x80ee('0x53')](_0x80ee('0x5e'),'t',_0x80ee('0x5f'));var _0x14dcb7=squel['expr']();var _0x44eee9=[];var _0x1834de=squel[_0x80ee('0x60')]();var _0x174199;if(_0x4536a4['query'][_0x80ee('0x61')]){_0x174199=as[_0x80ee('0x62')](_0x4536a4[_0x80ee('0x43')][_0x80ee('0x61')]);var _0x25430b=_0x174199[_0x80ee('0x63')];for(var _0x4f6bfa=0x0;_0x4f6bfa<_0x174199[_0x80ee('0x64')][_0x80ee('0x65')];_0x4f6bfa++){var _0x3a0779=_0x174199[_0x80ee('0x64')][_0x4f6bfa];var _0x4cf352='i';var _0x132963=_[_0x80ee('0x66')](_0x186ca0,[_0x80ee('0x32'),_0x3a0779[_0x80ee('0x4e')]]);if(!_0x132963){switch(_0x3a0779[_0x80ee('0x4e')]){case _0x80ee('0x67'):if(_0x3a0779[_0x80ee('0x68')]==0x1){_0x398c97[_0x80ee('0x69')]('`'+_0x3a0779['field']+_0x80ee('0x6a'));}else{_0x398c97[_0x80ee('0x69')]('`'+_0x3a0779[_0x80ee('0x4e')]+_0x80ee('0x6b'));}break;case _0x80ee('0x6c'):if(_0x3a0779[_0x80ee('0x6d')]===_0x80ee('0x6e')){if(_0x3a0779[_0x80ee('0x68')]['split']('\x20')[_0x80ee('0x65')]>0x1){_0x14dcb7[_0x25430b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x80ee('0x6f')](_0x3a0779[_0x80ee('0x68')]),null);}else{var _0x5ade25='%'+_0x3a0779['value']+'%';_0x14dcb7[_0x25430b](_0x80ee('0x70'),_0x5ade25,_0x5ade25,_0x5ade25);}}else{_0x132963=_[_0x80ee('0x66')](_0x186ca0,[_0x80ee('0x32'),_0x80ee('0x71')]);_0x3a0779['field']='ContactId';_0xd783=as[_0x80ee('0x72')](_0x4cf352,_0x132963[_0x80ee('0x40')],_0x3a0779);_0x14dcb7[_0x25430b](_0xd783[_0x80ee('0x73')],_0xd783['value'][_0x80ee('0x74')],_0xd783[_0x80ee('0x68')]['end']);}break;case _0x80ee('0x75'):var _0x126358=_0x3a0779[_0x80ee('0x68')][_0x80ee('0x39')](',')[_0x80ee('0x35')](function(_0x2d666a){return Number(_0x2d666a);});_0x126358[_0x80ee('0x3a')](function(_0x27317b){_0x1834de['or'](_0x80ee('0x76'),'%,'+_0x27317b+',%');});_0x44eee9=_[_0x80ee('0x77')](_0x44eee9,_0x126358);break;case'User':if(_0x3a0779['operator']==='$substring'){_0x14dcb7[_0x25430b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3a0779[_0x80ee('0x68')]+'%',null);}else{_0x132963=_[_0x80ee('0x66')](_0x186ca0,[_0x80ee('0x32'),'UserId']);_0x3a0779[_0x80ee('0x4e')]=_0x80ee('0x78');_0xd783=as[_0x80ee('0x72')](_0x4cf352,_0x132963[_0x80ee('0x40')],_0x3a0779);_0x14dcb7[_0x25430b](_0xd783[_0x80ee('0x73')],_0xd783['value'][_0x80ee('0x74')],_0xd783[_0x80ee('0x68')]['end']);}break;case'body':_0xd783=as[_0x80ee('0x72')]('me',null,_0x3a0779);_0x14dcb7[_0x25430b](_0xd783[_0x80ee('0x73')],_0xd783[_0x80ee('0x68')]['start'],_0xd783[_0x80ee('0x68')][_0x80ee('0x23')]);break;}}else{var _0xd783=as[_0x80ee('0x72')](_0x4cf352,_0x132963['type'],_0x3a0779);_0x14dcb7[_0x25430b](_0xd783[_0x80ee('0x73')],_0xd783[_0x80ee('0x68')][_0x80ee('0x74')],_0xd783[_0x80ee('0x68')][_0x80ee('0x23')]);}}}else{var _0x3fe3f5=_(_0x4536a4[_0x80ee('0x43')])[_0x80ee('0x44')]()[_0x80ee('0x35')](function(_0x3b2a4f){return _['some'](_0x186ca0,['name',_0x3b2a4f])?_0x3b2a4f:undefined;})[_0x80ee('0x79')]()[_0x80ee('0x68')]();if(!_[_0x80ee('0x7a')](_0x3fe3f5)){_0x3fe3f5['forEach'](function(_0x371546){if(_0x371546===_0x80ee('0x7b')){_0x398c97[_0x80ee('0x7c')](_0x80ee('0x7d'),[][_0x80ee('0x7e')](_0x4536a4[_0x80ee('0x43')][_0x371546]));}else if(_0x371546==='createdAt'){var _0x44775d=JSON[_0x80ee('0x7f')](_0x4536a4[_0x80ee('0x43')][_0x371546])['$gte'];var _0x29cbce=JSON[_0x80ee('0x7f')](_0x4536a4['query'][_0x371546])[_0x80ee('0x80')];_0x398c97[_0x80ee('0x7c')](_0x80ee('0x81'),_0x44775d,_0x29cbce);}else{if(_0x4536a4[_0x80ee('0x43')][_0x371546]===_0x80ee('0x82')){_0x398c97[_0x80ee('0x7c')]('i.'+_0x371546+_0x80ee('0x83'));}else{_0x398c97[_0x80ee('0x7c')]('i.'+_0x371546+_0x80ee('0x84'),_0x4536a4[_0x80ee('0x43')][_0x371546]);}}});}if(_0x4536a4['query'][_0x80ee('0x85')]){if(_0x4536a4[_0x80ee('0x43')][_0x80ee('0x85')]==0x1){_0x398c97[_0x80ee('0x69')](_0x80ee('0x86'));}else{_0x398c97[_0x80ee('0x69')](_0x80ee('0x87'));}}if(_0x4536a4['query']['tag']){_0x44eee9=_[_0x80ee('0x88')](_0x4536a4[_0x80ee('0x43')][_0x80ee('0x89')])?_0x4536a4['query']['tag']:new Array(_0x4536a4[_0x80ee('0x43')][_0x80ee('0x89')]);_0x44eee9['forEach'](function(_0x242858){_0x1834de['or'](_0x80ee('0x76'),'%,'+_0x242858+',%');});}if(_0x4536a4[_0x80ee('0x43')][_0x80ee('0x8a')]){var _0x44a313=_0x4536a4[_0x80ee('0x43')]['filter'][_0x80ee('0x8b')]('\x5c','\x5c\x5c')[_0x80ee('0x8b')](/'/g,'\x27\x27');if(qs[_0x80ee('0x8c')](_0x44a313)){_0x14dcb7['or'](_0x80ee('0x8d'),_0x44a313+'%')['or'](_0x80ee('0x8e'),_0x44a313+'%');}else{_0x14dcb7['or'](_0x80ee('0x8f'),qs[_0x80ee('0x6f')](_0x44a313))['or'](_0x80ee('0x90'),_0x44a313+'%');}}}_0x398c97[_0x80ee('0x7c')](_0x14dcb7);_0x398c97[_0x80ee('0x91')](_0x80ee('0x92'));var _0x371faa={'type':db['Sequelize'][_0x80ee('0x93')][_0x80ee('0x94')],'raw':!![]};var _0x192367=_0x398c97['clone']();_0x192367['field'](_0x80ee('0x92'));_0x192367[_0x80ee('0x4e')](_0x80ee('0x95'),_0x80ee('0x67'));if(_0x47a6c5['order']){_0x47a6c5[_0x80ee('0x4a')]['forEach'](function(_0x1e2de8){var _0x4bca0c=_0x1e2de8[0x0]===_0x80ee('0x96')?_0x1e2de8[0x0]:'i.'+_0x1e2de8[0x0];_0x398c97[_0x80ee('0x4a')](_0x4bca0c,_0x1e2de8[0x1]===_0x80ee('0x97')?![]:!![]);});}if(!_['isEmpty'](_0x44eee9)){_0x398c97[_0x80ee('0x69')](_0x1834de);_0x192367[_0x80ee('0x7c')](_0x80ee('0x98'),_0x44eee9);}BPromise[_0x80ee('0x99')]()['then'](function(){if(!_0x174199){if(_0x4536a4[_0x80ee('0x43')]['SmsAccountId'])return;_0x192367[_0x80ee('0x7c')](_0x80ee('0x9a'));_0x398c97[_0x80ee('0x7c')](_0x80ee('0x9a'));return;}if(_0x4536a4[_0x80ee('0x9b')][_0x80ee('0x9c')]!==_0x80ee('0x9d'))return;return _0x4536a4[_0x80ee('0x9b')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x80ee('0x3c')](function(_0x4bf2d2){if(_[_0x80ee('0x7a')](_0x4bf2d2)){_0x192367[_0x80ee('0x7c')]('i.SmsAccountId\x20IS\x20NULL');_0x398c97[_0x80ee('0x7c')](_0x80ee('0x9e'));}else{_0x192367['where'](_0x80ee('0x7d'),_[_0x80ee('0x35')](_0x4bf2d2,'id'));_0x398c97['where']('i.SmsAccountId\x20IN\x20?',_[_0x80ee('0x35')](_0x4bf2d2,'id'));}});})[_0x80ee('0x3c')](function(){if(_0x4536a4[_0x80ee('0x9b')][_0x80ee('0x9c')]==='agent'&&!_0x174199&&!_0x4536a4[_0x80ee('0x43')][_0x80ee('0x7b')])return[];return db['sequelize'][_0x80ee('0x43')](_0x192367[_0x80ee('0x9f')](),_0x371faa);})[_0x80ee('0x3c')](function(_0x505fa8){_0x1e9ae0[_0x80ee('0x28')]=_0x505fa8[_0x80ee('0x65')];if(_0x1e9ae0['count']===0x0)return[];return db['sequelize'][_0x80ee('0x43')](_0x5c1909[_0x80ee('0x9f')](),_0x371faa)[_0x80ee('0x3c')](function(_0x5763b6){_0x3be8d7=_[_0x80ee('0xa0')](_0x5763b6,'id');_0x371faa=_['merge'](_0x371faa,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4536a4[_0x80ee('0x43')][_0x80ee('0x47')]){_0x47a6c5['attributes'][_0x80ee('0x3a')](function(_0x4215b9){_0x398c97[_0x80ee('0x4e')]('i.'+_0x4215b9);});}else{_0x398c97['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x80ee('0x67'));_0x398c97[_0x80ee('0x4e')]('a.key',_0x80ee('0xa1'));_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa2'),_0x80ee('0xa3'));_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa4'),'contactName');_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa5'));_0x398c97[_0x80ee('0x4e')]('c.firstName',_0x80ee('0xa6'));_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa7'),_0x80ee('0xa8'));_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa9'),_0x80ee('0xaa'));_0x398c97[_0x80ee('0x4e')]('c.phone',_0x80ee('0xab'));_0x398c97[_0x80ee('0x4e')]('c.mobile','Contact.mobile');_0x398c97[_0x80ee('0x4e')](_0x80ee('0xac'),'Contact.fax');_0x398c97[_0x80ee('0x4e')](_0x80ee('0xad'),'Owner.fullname');_0x398c97[_0x80ee('0x4e')]('o.internal','Owner.internal');_0x398c97[_0x80ee('0x4e')](_0x80ee('0xae'),_0x80ee('0x37'));}if(_0x47a6c5['limit'])_0x398c97[_0x80ee('0x26')](_0x47a6c5[_0x80ee('0x26')]);if(_0x47a6c5['offset'])_0x398c97[_0x80ee('0x25')](_0x47a6c5[_0x80ee('0x25')]);return db['sequelize'][_0x80ee('0x43')](_0x398c97[_0x80ee('0x9f')](),_0x371faa);})[_0x80ee('0x3c')](function(_0x5b4003){if(_0x5b4003[_0x80ee('0x65')]>0x0)_0x491d8b['where'](_0x80ee('0xaf'),_[_0x80ee('0x35')](_0x5b4003,'id'));return db['sequelize'][_0x80ee('0x43')](_0x491d8b['toString'](),_0x371faa)['then'](function(_0x59006f){var _0x339d2a=_[_0x80ee('0xb0')](_0x59006f,_0x80ee('0xb1'));var _0x4a578d=[];_0x5b4003[_0x80ee('0x3a')](function(_0x53b427){_0x4a578d[_0x80ee('0x3b')](updateSmsInteraction(_0x53b427,_0x3be8d7,_0x339d2a));});return BPromise[_0x80ee('0xb2')](_0x4a578d);});});})['then'](function(_0xb53b78){_0x1e9ae0[_0x80ee('0xb3')]=_0xb53b78;return _0x1e9ae0;})[_0x80ee('0x3c')](respondWithFilteredResult(_0x2e7971,_0x47a6c5))['catch'](handleError(_0x2e7971,null));};exports[_0x80ee('0xb4')]=function(_0x41d60f,_0x400ec8){var _0x41fb02={'raw':![],'where':{'id':_0x41d60f[_0x80ee('0xb5')]['id']}},_0x2fe51b={};_0x2fe51b[_0x80ee('0x42')]=_[_0x80ee('0x44')](db[_0x80ee('0x3e')][_0x80ee('0x3f')]);_0x2fe51b[_0x80ee('0x43')]=_[_0x80ee('0x44')](_0x41d60f['query']);_0x2fe51b[_0x80ee('0x4c')]=_[_0x80ee('0x45')](_0x2fe51b['model'],_0x2fe51b[_0x80ee('0x43')]);_0x41fb02['attributes']=_['intersection'](_0x2fe51b[_0x80ee('0x42')],qs[_0x80ee('0x47')](_0x41d60f[_0x80ee('0x43')][_0x80ee('0x47')]));_0x41fb02[_0x80ee('0x46')]=_0x41fb02[_0x80ee('0x46')][_0x80ee('0x65')]?_0x41fb02[_0x80ee('0x46')]:_0x2fe51b[_0x80ee('0x42')];if(_0x41d60f['query'][_0x80ee('0xb6')]){_0x41fb02[_0x80ee('0xb7')]=[{'all':!![]}];}_0x41fb02=_[_0x80ee('0xb8')]({},_0x41fb02,_0x41d60f[_0x80ee('0xb9')]);return db['SmsInteraction'][_0x80ee('0x66')](_0x41fb02)['then'](handleEntityNotFound(_0x400ec8,null))['then'](respondWithResult(_0x400ec8,null))['catch'](handleError(_0x400ec8,null));};exports['create']=function(_0x53b48f,_0x260935){return db[_0x80ee('0x3e')][_0x80ee('0xba')](_0x53b48f[_0x80ee('0xbb')],{})['then'](respondWithResult(_0x260935,0xc9))[_0x80ee('0x3d')](handleError(_0x260935,null));};exports['update']=function(_0x1b35ff,_0x4ff367){if(_0x1b35ff[_0x80ee('0xbb')]['id']){delete _0x1b35ff[_0x80ee('0xbb')]['id'];}return db[_0x80ee('0x3e')]['find']({'where':{'id':_0x1b35ff[_0x80ee('0xb5')]['id']}})[_0x80ee('0x3c')](handleEntityNotFound(_0x4ff367,null))[_0x80ee('0x3c')](saveUpdates(_0x1b35ff['body'],null))[_0x80ee('0x3c')](respondWithResult(_0x4ff367,null))[_0x80ee('0x3d')](handleError(_0x4ff367,null));};exports[_0x80ee('0x2f')]=function(_0x3e8693,_0x39d429){return db['SmsInteraction'][_0x80ee('0x66')]({'where':{'id':_0x3e8693[_0x80ee('0xb5')]['id']}})['then'](handleEntityNotFound(_0x39d429,null))['then'](removeEntity(_0x39d429,null))[_0x80ee('0x3d')](handleError(_0x39d429,null));};exports[_0x80ee('0xbc')]=function(_0x3a2cbc,_0x2ce608){return db['SmsInteraction']['describe']()[_0x80ee('0x3c')](respondWithResult(_0x2ce608,null))[_0x80ee('0x3d')](handleError(_0x2ce608,null));};exports[_0x80ee('0xbd')]=function(_0x1e78eb,_0x344de,_0x27571b){return db['SmsMessage'][_0x80ee('0x66')]({'where':{'id':_0x1e78eb[_0x80ee('0xb5')]['id']}})['then'](handleEntityNotFound(_0x344de,null))[_0x80ee('0x3c')](function(_0x342cf7){if(_0x342cf7){return _0x342cf7[_0x80ee('0xbd')](_0x1e78eb['body']['ids'],_[_0x80ee('0xbe')](_0x1e78eb[_0x80ee('0xbb')],[_0x80ee('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x344de,null))['catch'](handleError(_0x344de,null));};exports[_0x80ee('0xc0')]=function(_0x24337d,_0xf0617c,_0x43de64){var _0x5a255d={'raw':![],'where':{}};var _0x34a65b={};var _0x36e37f={'count':0x0,'rows':[]};return db[_0x80ee('0x3e')][_0x80ee('0xc1')]({'where':{'id':_0x24337d['params']['id']}})[_0x80ee('0x3c')](handleEntityNotFound(_0xf0617c,null))[_0x80ee('0x3c')](function(_0x5c1a65){if(_0x5c1a65){_0x34a65b[_0x80ee('0x42')]=_[_0x80ee('0x44')](db[_0x80ee('0xc2')][_0x80ee('0x3f')]);_0x34a65b[_0x80ee('0x43')]=_[_0x80ee('0x44')](_0x24337d[_0x80ee('0x43')]);_0x34a65b['filters']=_[_0x80ee('0x45')](_0x34a65b['model'],_0x34a65b[_0x80ee('0x43')]);_0x5a255d[_0x80ee('0x46')]=_['intersection'](_0x34a65b['model'],qs[_0x80ee('0x47')](_0x24337d['query']['fields']));_0x5a255d['attributes']=_0x5a255d[_0x80ee('0x46')][_0x80ee('0x65')]?_0x5a255d['attributes']:_0x34a65b[_0x80ee('0x42')];if(!_0x24337d[_0x80ee('0x43')][_0x80ee('0x48')](_0x80ee('0x49'))){_0x5a255d['limit']=qs[_0x80ee('0x26')](_0x24337d[_0x80ee('0x43')][_0x80ee('0x26')]);_0x5a255d['offset']=qs['offset'](_0x24337d[_0x80ee('0x43')][_0x80ee('0x25')]);}_0x5a255d[_0x80ee('0x4a')]=qs[_0x80ee('0x4b')](_0x24337d['query'][_0x80ee('0x4b')]);_0x5a255d[_0x80ee('0x7c')]=qs[_0x80ee('0x4c')](_[_0x80ee('0x4d')](_0x24337d['query'],_0x34a65b[_0x80ee('0x4c')]));_0x5a255d[_0x80ee('0x7c')]['SmsInteractionId']=_0x5c1a65['id'];if(_0x24337d[_0x80ee('0x43')]['filter']){_0x5a255d[_0x80ee('0x7c')]=_['merge'](_0x5a255d['where'],{'$or':_[_0x80ee('0x35')](_0x5a255d['attributes'],function(_0x2d2a05){var _0x1a3ff4={};_0x1a3ff4[_0x2d2a05]={'$like':'%'+_0x24337d[_0x80ee('0x43')][_0x80ee('0x8a')]+'%'};return _0x1a3ff4;})});}if(_0x24337d['query'][_0x80ee('0xc3')]){var _0x1e516d=_0x24337d[_0x80ee('0x43')][_0x80ee('0xc3')][_0x80ee('0x39')](',');var _0x3f09ec={};_0x3f09ec[_0x1e516d[0x0]]={'$gte':moment(_0x1e516d[0x1])['format'](_0x80ee('0xc4'))};_0x5a255d['where']=_[_0x80ee('0xb8')](_0x5a255d['where'],_0x3f09ec);}_0x5a255d=_['merge']({},_0x5a255d,_0x24337d[_0x80ee('0xb9')]);return db[_0x80ee('0xc2')][_0x80ee('0x28')]({'where':_0x5a255d[_0x80ee('0x7c')]})[_0x80ee('0x3c')](function(_0x2766a0){_0x36e37f[_0x80ee('0x28')]=_0x2766a0;if(_0x24337d[_0x80ee('0x43')][_0x80ee('0xb6')]){_0x5a255d[_0x80ee('0xb7')]=[{'all':!![]}];}return db[_0x80ee('0xc2')]['findAll'](_0x5a255d);})[_0x80ee('0x3c')](function(_0x3d6e7b){_0x36e37f[_0x80ee('0xb3')]=_0x3d6e7b;return _0x36e37f;});}})['then'](respondWithFilteredResult(_0xf0617c,_0x5a255d))[_0x80ee('0x3d')](handleError(_0xf0617c,null));};exports['addTags']=function(_0x296bec,_0x54f694,_0x26ba96){return db[_0x80ee('0x3e')][_0x80ee('0x66')]({'where':{'id':_0x296bec[_0x80ee('0xb5')]['id']}})[_0x80ee('0x3c')](handleEntityNotFound(_0x54f694,null))[_0x80ee('0x3c')](function(_0x3b470f){if(_0x3b470f){return _0x3b470f[_0x80ee('0xc5')](_0x296bec[_0x80ee('0xbb')][_0x80ee('0xbf')],_[_0x80ee('0xbe')](_0x296bec['body'],[_0x80ee('0xbf'),'id'])||{})[_0x80ee('0xc6')](function(){return db[_0x80ee('0x75')][_0x80ee('0xc7')]({'attributes':['id',_0x80ee('0x32'),'color'],'where':{'id':_0x296bec[_0x80ee('0xbb')][_0x80ee('0xbf')]}});})[_0x80ee('0x3c')](function(_0xbbb7a0){socket['emit'](_0x80ee('0xc8'),{'id':Number(_0x296bec[_0x80ee('0xb5')]['id']),'tags':_0xbbb7a0||[]});return{'id':Number(_0x296bec[_0x80ee('0xb5')]['id']),'tags':_0xbbb7a0||[]};});}})[_0x80ee('0x3c')](respondWithResult(_0x54f694,null))[_0x80ee('0x3d')](handleError(_0x54f694,null));};exports['removeTags']=function(_0x5500ea,_0x3c4a78,_0x4263fb){return db[_0x80ee('0x3e')][_0x80ee('0x66')]({'where':{'id':_0x5500ea[_0x80ee('0xb5')]['id']}})[_0x80ee('0x3c')](handleEntityNotFound(_0x3c4a78,null))[_0x80ee('0x3c')](function(_0x2ef12d){if(_0x2ef12d){return _0x2ef12d[_0x80ee('0xc9')](_0x5500ea[_0x80ee('0x43')][_0x80ee('0xbf')]);}})[_0x80ee('0x3c')](respondWithStatusCode(_0x3c4a78,null))[_0x80ee('0x3d')](handleError(_0x3c4a78,null));};exports[_0x80ee('0xca')]=function(_0x311b4d,_0x5d81fc){var _0x42154d=moment()['unix']()[_0x80ee('0x9f')]();var _0x49dcf3=path['join'](config['root'],_0x80ee('0xcb'),'files',_0x80ee('0xcc'));var _0x429d48=path[_0x80ee('0xcd')](config[_0x80ee('0xce')],'server','files',_0x80ee('0xcf'));var _0x327d91=path[_0x80ee('0xcd')](_0x49dcf3,_0x42154d);var _0x16d986=util[_0x80ee('0xd0')](_0x80ee('0xd1'),_0x311b4d['params']['id'],_0x42154d);var _0x2333c1=path[_0x80ee('0xcd')](_0x49dcf3,_0x16d986);var _0x145614=[];_0x145614[_0x80ee('0x3b')]({'model':db['User'],'as':_0x80ee('0xd2'),'attributes':['id',_0x80ee('0x36')],'raw':!![]});_0x145614[_0x80ee('0x3b')]({'model':db[_0x80ee('0xd3')],'as':_0x80ee('0x6c'),'attributes':['id','firstName',_0x80ee('0xd4')],'raw':!![]});var _0x1cacbe=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x80ee('0xbb'),_0x80ee('0xd5'),_0x80ee('0xd6'),'secret',_0x80ee('0x85')],'include':_0x145614}];_0x1cacbe['push']({'model':db[_0x80ee('0xd7')],'as':_0x80ee('0xd8'),'attributes':['id','name']});_0x1cacbe[_0x80ee('0x3b')]({'model':db[_0x80ee('0xd2')],'as':_0x80ee('0xd9'),'attributes':['id',_0x80ee('0x36')]});return db[_0x80ee('0x3e')][_0x80ee('0x66')]({'where':{'id':_0x311b4d[_0x80ee('0xb5')]['id']},'include':_0x1cacbe})[_0x80ee('0x3c')](handleEntityNotFound(_0x5d81fc,null))[_0x80ee('0x3c')](function(_0xc31935){if(_0xc31935){var _0x5115d4=_0xc31935[_0x80ee('0xda')]({'plain':!![]});fs['mkdirSync'](_0x327d91);var _0x439b44={'channel':'Sms','account':_0x5115d4[_0x80ee('0xd8')][_0x80ee('0x32')],'agent':_0x5115d4['Owner']?_0x5115d4[_0x80ee('0xd9')][_0x80ee('0x36')]:_0x80ee('0xdb'),'createdAt':moment(_0x5115d4['createdAt'])[_0x80ee('0xd0')](_0x80ee('0xc4'))['toString'](),'closedAt':_0x5115d4['closed']?moment(_0x5115d4[_0x80ee('0xdc')])[_0x80ee('0xd0')](_0x80ee('0xc4'))['toString']():'','disposition':_0x5115d4[_0x80ee('0xdd')],'messages':_(_0x5115d4[_0x80ee('0xde')])[_0x80ee('0x8a')]({'secret':![]})[_0x80ee('0x35')](function(_0x2e3a41){return{'date':moment(_0x2e3a41[_0x80ee('0xd5')])[_0x80ee('0xd0')](_0x80ee('0xc4'))[_0x80ee('0x9f')](),'sender':_0x2e3a41[_0x80ee('0xd6')]===_0x80ee('0xdf')?_0x2e3a41[_0x80ee('0xd2')]?_0x2e3a41[_0x80ee('0xd2')][_0x80ee('0x36')]:_0x80ee('0xe0'):_0x2e3a41['Contact'][_0x80ee('0xe1')]+(_0x2e3a41[_0x80ee('0x6c')][_0x80ee('0xd4')]?'\x20'+_0x2e3a41[_0x80ee('0x6c')][_0x80ee('0xd4')]:''),'body':_0x2e3a41[_0x80ee('0xbb')],'direction':_0x2e3a41['direction']==='out'?'A':'C','secret':_0x2e3a41[_0x80ee('0xe2')],'read':_0x2e3a41[_0x80ee('0x85')]};})[_0x80ee('0x68')]()};return ejs[_0x80ee('0xe3')](path[_0x80ee('0xcd')](config[_0x80ee('0xce')],'server','views','downloadInteraction.ejs'),{'interaction':_0x439b44})[_0x80ee('0x3c')](function(_0x498784){var _0x46692e=path[_0x80ee('0xcd')](_0x327d91,'transcript-'+_0x5115d4['id']+'-'+_0x42154d+'.pdf');var _0xaa1f70={'path':_0x46692e,'channel':_0x80ee('0xe4'),'interactionId':_0x5115d4['id']};return pdf[_0x80ee('0xe5')](_0x498784,_0xaa1f70);})['then'](function(){return new BPromise(function(_0x5d96a7,_0x4d965e){zipdir(_0x327d91,{'saveTo':_0x2333c1},function(_0x106e3c,_0x42ac53){if(_0x106e3c)return _0x4d965e(_0x106e3c);return _0x5d96a7(_0x42ac53);});})[_0x80ee('0x3c')](function(){return new BPromise(function(_0x39776c,_0x76c157){rimraf(_0x327d91,function(_0x57bdf5){if(_0x57bdf5)_0x76c157(_0x57bdf5);return _0x39776c();});});})[_0x80ee('0x3c')](function(){return _0x5d81fc[_0x80ee('0xca')](_0x2333c1,_0x16d986,function(_0xbcd4db){if(_0xbcd4db){console[_0x80ee('0xe6')](_0x80ee('0xe7'),_0xbcd4db);}else{fs[_0x80ee('0xe8')](_0x2333c1);}});});});}else{return _0x5d81fc[_0x80ee('0x21')](0xc8);}})[_0x80ee('0x3d')](handleError(_0x5d81fc,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index c2dc98f..9de2e6b 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 _0x6d11=['../../mysqldb','SmsInteraction','SmsMessage','save','update','getUsers','then','setDataValue','findAll','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x1ca3fb,_0x413a32){var _0x5c571c=function(_0x49d744){while(--_0x49d744){_0x1ca3fb['push'](_0x1ca3fb['shift']());}};_0x5c571c(++_0x413a32);}(_0x6d11,0xbf));var _0x16d1=function(_0x490403,_0xd2381){_0x490403=_0x490403-0x0;var _0x37974b=_0x6d11[_0x490403];return _0x37974b;};'use strict';var EventEmitter=require(_0x16d1('0x0'));var SmsInteraction=require(_0x16d1('0x1'))['db'][_0x16d1('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x16d1('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16d1('0x4'),'afterUpdate':_0x16d1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48754e){return function(_0x3e0e86,_0x46f7d7,_0x3eb9e2){_0x3e0e86[_0x16d1('0x6')]({'attributes':['id'],'raw':!![]})[_0x16d1('0x7')](function(_0x150217){_0x3e0e86[_0x16d1('0x8')]('Users',_0x150217['map'](function(_0x4fca47){return{'id':_0x4fca47['id']};}));return SmsMessage[_0x16d1('0x9')]({'where':{'SmsInteractionId':_0x3e0e86['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16d1('0x7')](function(_0xe67758){_0x3e0e86[_0x16d1('0x8')]('unreadMessages',_0xe67758[_0x16d1('0xa')]);SmsInteractionEvents[_0x16d1('0xb')](_0x48754e+':'+_0x3e0e86['id'],_0x3e0e86);SmsInteractionEvents[_0x16d1('0xb')](_0x48754e,_0x3e0e86);_0x3eb9e2(null);})[_0x16d1('0xc')](_0x3eb9e2(null));};}for(var e in events){if(events[_0x16d1('0xd')](e)){var event=events[e];SmsInteraction[_0x16d1('0xe')](e,emitEvent(event));}}module[_0x16d1('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x4991=['then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','events','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3e499b,_0x10a026){var _0xd73a78=function(_0x1aa661){while(--_0x1aa661){_0x3e499b['push'](_0x3e499b['shift']());}};_0xd73a78(++_0x10a026);}(_0x4991,0xf7));var _0x1499=function(_0x29b7b4,_0x416c2d){_0x29b7b4=_0x29b7b4-0x0;var _0x28a1fc=_0x4991[_0x29b7b4];return _0x28a1fc;};'use strict';var EventEmitter=require(_0x1499('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x1499('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x1499('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1499('0x3')](0x0);var events={'afterCreate':_0x1499('0x4'),'afterUpdate':_0x1499('0x5'),'afterDestroy':_0x1499('0x6')};function emitEvent(_0x158134){return function(_0x19adff,_0x209616,_0x4b6154){_0x19adff[_0x1499('0x7')]({'attributes':['id'],'raw':!![]})[_0x1499('0x8')](function(_0x1c65c3){_0x19adff[_0x1499('0x9')](_0x1499('0xa'),_0x1c65c3[_0x1499('0xb')](function(_0x3277b3){return{'id':_0x3277b3['id']};}));return SmsMessage[_0x1499('0xc')]({'where':{'SmsInteractionId':_0x19adff['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16e8ad){_0x19adff[_0x1499('0x9')]('unreadMessages',_0x16e8ad[_0x1499('0xd')]);SmsInteractionEvents[_0x1499('0xe')](_0x158134+':'+_0x19adff['id'],_0x19adff);SmsInteractionEvents['emit'](_0x158134,_0x19adff);_0x4b6154(null);})[_0x1499('0xf')](_0x4b6154(null));};}for(var e in events){if(events[_0x1499('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 99d5931..4fecb0b 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 _0xb87a=['request-promise','path','rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','lodash','util','api'];(function(_0x159f91,_0xe8a30f){var _0x26bd65=function(_0x5680d1){while(--_0x5680d1){_0x159f91['push'](_0x159f91['shift']());}};_0x26bd65(++_0xe8a30f);}(_0xb87a,0x15b));var _0xab87=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb87a[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xab87('0x0'));var util=require(_0xab87('0x1'));var logger=require('../../config/logger')(_0xab87('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xab87('0x3'));var fs=require('fs');var path=require(_0xab87('0x4'));var rimraf=require(_0xab87('0x5'));var config=require(_0xab87('0x6'));var attributes=require('./smsInteraction.attributes');module[_0xab87('0x7')]=function(_0x29fcd3,_0x90c2d7){return _0x29fcd3['define'](_0xab87('0x8'),attributes,{'tableName':_0xab87('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x109147,_0x16122a,_0x3e9bec){if(_0x109147[_0xab87('0xa')](_0xab87('0xb'))){_0x109147[_0xab87('0xc')]=moment()[_0xab87('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3e9bec(null,_0x109147);}}});}; \ No newline at end of file +var _0xe7f8=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions'];(function(_0x3ebd7f,_0x1567e3){var _0x428414=function(_0x39fef3){while(--_0x39fef3){_0x3ebd7f['push'](_0x3ebd7f['shift']());}};_0x428414(++_0x1567e3);}(_0xe7f8,0x95));var _0x8e7f=function(_0x2a185e,_0xdd0cae){_0x2a185e=_0x2a185e-0x0;var _0x1e7380=_0xe7f8[_0x2a185e];return _0x1e7380;};'use strict';var _=require(_0x8e7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8e7f('0x1'));var moment=require(_0x8e7f('0x2'));var BPromise=require(_0x8e7f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e7f('0x4'));var rimraf=require(_0x8e7f('0x5'));var config=require(_0x8e7f('0x6'));var attributes=require(_0x8e7f('0x7'));module[_0x8e7f('0x8')]=function(_0x5ad16f,_0x379293){return _0x5ad16f['define'](_0x8e7f('0x9'),attributes,{'tableName':_0x8e7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4eab8e,_0x22493b,_0x167195){if(_0x4eab8e[_0x8e7f('0xb')](_0x8e7f('0xc'))){_0x4eab8e[_0x8e7f('0xd')]=moment()[_0x8e7f('0xe')](_0x8e7f('0xf'));}_0x167195(null,_0x4eab8e);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 09d0481..2765cbd 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 _0xac8f=['SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateSmsInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','debug','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./smsInteraction.socket','register','request','then','info'];(function(_0x5e08bf,_0x453102){var _0x2e7fc4=function(_0x1da5d9){while(--_0x1da5d9){_0x5e08bf['push'](_0x5e08bf['shift']());}};_0x2e7fc4(++_0x453102);}(_0xac8f,0x92));var _0xfac8=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0xac8f[_0xb3b452];return _0x238983;};'use strict';var _=require(_0xfac8('0x0'));var util=require(_0xfac8('0x1'));var moment=require(_0xfac8('0x2'));var BPromise=require(_0xfac8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfac8('0x4'))['db'];var utils=require(_0xfac8('0x5'));var logger=require(_0xfac8('0x6'))(_0xfac8('0x7'));var config=require(_0xfac8('0x8'));var jayson=require(_0xfac8('0x9'));var client=jayson[_0xfac8('0xa')]['http']({'port':0x232a});config[_0xfac8('0xb')]=_['defaults'](config[_0xfac8('0xb')],{'host':_0xfac8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfac8('0xb')]));require(_0xfac8('0xd'))[_0xfac8('0xe')](socket);function respondWithRpcPromise(_0x3320a2,_0xa2d7a8,_0x2c5d7f){return new BPromise(function(_0x1dd97f,_0x32ebcf){return client[_0xfac8('0xf')](_0x3320a2,_0x2c5d7f)[_0xfac8('0x10')](function(_0xa6101f){logger[_0xfac8('0x11')](_0xfac8('0x12'),_0xa2d7a8,_0xfac8('0x13'));logger['debug'](_0xfac8('0x14'),_0xa2d7a8,_0xfac8('0x13'),JSON[_0xfac8('0x15')](_0xa6101f));if(_0xa6101f[_0xfac8('0x16')]){if(_0xa6101f[_0xfac8('0x16')][_0xfac8('0x17')]===0x1f4){logger['error'](_0xfac8('0x12'),_0xa2d7a8,_0xa6101f['error'][_0xfac8('0x18')]);return _0x32ebcf(_0xa6101f[_0xfac8('0x16')]['message']);}logger[_0xfac8('0x16')](_0xfac8('0x12'),_0xa2d7a8,_0xa6101f[_0xfac8('0x16')][_0xfac8('0x18')]);return _0x1dd97f(_0xa6101f[_0xfac8('0x16')][_0xfac8('0x18')]);}else{logger[_0xfac8('0x11')]('SmsInteraction,\x20%s,\x20%s',_0xa2d7a8,_0xfac8('0x13'));_0x1dd97f(_0xa6101f['result'][_0xfac8('0x18')]);}})['catch'](function(_0x38ac18){logger[_0xfac8('0x16')](_0xfac8('0x12'),_0xa2d7a8,_0x38ac18);_0x32ebcf(_0x38ac18);});});}exports[_0xfac8('0x19')]=function(_0x4319b6){var _0x93d9aa=this;return new Promise(function(_0x206e85,_0x11b724){return db['SmsInteraction'][_0xfac8('0x1a')](_0x4319b6[_0xfac8('0x1b')],{'raw':_0x4319b6['options']?_0x4319b6[_0xfac8('0x1c')][_0xfac8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4319b6[_0xfac8('0x1c')]?_0x4319b6[_0xfac8('0x1c')][_0xfac8('0x1e')]||null:null,'attributes':_0x4319b6['options']?_0x4319b6[_0xfac8('0x1c')][_0xfac8('0x1f')]||null:null,'limit':_0x4319b6[_0xfac8('0x1c')]?_0x4319b6[_0xfac8('0x1c')][_0xfac8('0x20')]||null:null})[_0xfac8('0x10')](function(_0x3d7bc6){logger['info']('UpdateSmsInteraction',_0x4319b6);logger['debug'](_0xfac8('0x19'),_0x4319b6,JSON[_0xfac8('0x15')](_0x3d7bc6));_0x206e85(_0x3d7bc6);})[_0xfac8('0x21')](function(_0x516535){logger['error'](_0xfac8('0x19'),_0x516535[_0xfac8('0x18')],_0x4319b6);_0x11b724(_0x93d9aa[_0xfac8('0x16')](0x1f4,_0x516535[_0xfac8('0x18')]));});});};exports[_0xfac8('0x22')]=function(_0x57783b){return new Promise(function(_0x4fa48c,_0xfb8132){return db[_0xfac8('0x23')][_0xfac8('0x24')]({'where':_0x57783b['options']?_0x57783b[_0xfac8('0x1c')][_0xfac8('0x1e')]||null:null})[_0xfac8('0x10')](function(_0x39748e){if(_0x39748e){return _0x39748e[_0xfac8('0x25')](_0x57783b['body'][_0xfac8('0x26')],_['omit'](_0x57783b[_0xfac8('0x1b')],[_0xfac8('0x26'),'id'])||{});}})['spread'](function(_0x3f2d48){logger['info']('AddTags',_0x57783b);logger[_0xfac8('0x27')](_0xfac8('0x28'),_0x57783b,JSON[_0xfac8('0x15')](_0x3f2d48));_0x4fa48c(_0x3f2d48);})[_0xfac8('0x21')](function(_0xab1bb8){logger[_0xfac8('0x16')](_0xfac8('0x28'),_0xab1bb8['message'],_0x57783b);_0xfb8132(_this[_0xfac8('0x16')](0x1f4,_0xab1bb8[_0xfac8('0x18')]));});});}; \ No newline at end of file +var _0x3f90=['catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','stringify','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x242bbb,_0x5f250a){var _0x1eb3de=function(_0x292628){while(--_0x292628){_0x242bbb['push'](_0x242bbb['shift']());}};_0x1eb3de(++_0x5f250a);}(_0x3f90,0x105));var _0x03f9=function(_0x4cb1d0,_0x2f8643){_0x4cb1d0=_0x4cb1d0-0x0;var _0x1875a4=_0x3f90[_0x4cb1d0];return _0x1875a4;};'use strict';var _=require(_0x03f9('0x0'));var util=require(_0x03f9('0x1'));var moment=require(_0x03f9('0x2'));var BPromise=require(_0x03f9('0x3'));var rs=require(_0x03f9('0x4'));var fs=require('fs');var Redis=require(_0x03f9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x03f9('0x6'))(_0x03f9('0x7'));var config=require(_0x03f9('0x8'));var jayson=require(_0x03f9('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x03f9('0xa')]=_[_0x03f9('0xb')](config[_0x03f9('0xa')],{'host':_0x03f9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03f9('0xa')]));require(_0x03f9('0xd'))[_0x03f9('0xe')](socket);function respondWithRpcPromise(_0x239e5e,_0x15386d,_0x11c080){return new BPromise(function(_0x3ae62d,_0xc324e4){return client[_0x03f9('0xf')](_0x239e5e,_0x11c080)[_0x03f9('0x10')](function(_0x4f1f81){logger['info'](_0x03f9('0x11'),_0x15386d,_0x03f9('0x12'));logger[_0x03f9('0x13')](_0x03f9('0x14'),_0x15386d,_0x03f9('0x12'),JSON['stringify'](_0x4f1f81));if(_0x4f1f81[_0x03f9('0x15')]){if(_0x4f1f81[_0x03f9('0x15')][_0x03f9('0x16')]===0x1f4){logger[_0x03f9('0x15')](_0x03f9('0x11'),_0x15386d,_0x4f1f81[_0x03f9('0x15')][_0x03f9('0x17')]);return _0xc324e4(_0x4f1f81['error'][_0x03f9('0x17')]);}logger[_0x03f9('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x15386d,_0x4f1f81[_0x03f9('0x15')]['message']);return _0x3ae62d(_0x4f1f81[_0x03f9('0x15')][_0x03f9('0x17')]);}else{logger[_0x03f9('0x18')](_0x03f9('0x11'),_0x15386d,'request\x20sent');_0x3ae62d(_0x4f1f81[_0x03f9('0x19')][_0x03f9('0x17')]);}})[_0x03f9('0x1a')](function(_0x3c6347){logger[_0x03f9('0x15')](_0x03f9('0x11'),_0x15386d,_0x3c6347);_0xc324e4(_0x3c6347);});});}exports[_0x03f9('0x1b')]=function(_0x555d66){var _0x30616b=this;return new Promise(function(_0xf8a62,_0x432930){return db['SmsInteraction'][_0x03f9('0x1c')](_0x555d66[_0x03f9('0x1d')],{'raw':_0x555d66[_0x03f9('0x1e')]?_0x555d66['options'][_0x03f9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x555d66[_0x03f9('0x1e')]?_0x555d66[_0x03f9('0x1e')][_0x03f9('0x20')]||null:null,'attributes':_0x555d66[_0x03f9('0x1e')]?_0x555d66[_0x03f9('0x1e')][_0x03f9('0x21')]||null:null,'limit':_0x555d66[_0x03f9('0x1e')]?_0x555d66['options']['limit']||null:null})[_0x03f9('0x10')](function(_0x374bcd){logger[_0x03f9('0x18')](_0x03f9('0x1b'),_0x555d66);logger['debug'](_0x03f9('0x1b'),_0x555d66,JSON[_0x03f9('0x22')](_0x374bcd));_0xf8a62(_0x374bcd);})[_0x03f9('0x1a')](function(_0x5ca348){logger['error']('UpdateSmsInteraction',_0x5ca348['message'],_0x555d66);_0x432930(_0x30616b[_0x03f9('0x15')](0x1f4,_0x5ca348['message']));});});};exports[_0x03f9('0x23')]=function(_0x58aa3a){return new Promise(function(_0x18ea68,_0x39b298){return db['SmsInteraction'][_0x03f9('0x24')]({'where':_0x58aa3a['options']?_0x58aa3a['options'][_0x03f9('0x20')]||null:null})['then'](function(_0x49dcd0){if(_0x49dcd0){return _0x49dcd0[_0x03f9('0x25')](_0x58aa3a[_0x03f9('0x1d')][_0x03f9('0x26')],_['omit'](_0x58aa3a[_0x03f9('0x1d')],[_0x03f9('0x26'),'id'])||{});}})[_0x03f9('0x27')](function(_0x532bfd){logger[_0x03f9('0x18')]('AddTags',_0x58aa3a);logger[_0x03f9('0x13')]('AddTags',_0x58aa3a,JSON[_0x03f9('0x22')](_0x532bfd));_0x18ea68(_0x532bfd);})[_0x03f9('0x1a')](function(_0x2c645e){logger[_0x03f9('0x15')](_0x03f9('0x28'),_0x2c645e[_0x03f9('0x17')],_0x58aa3a);_0x39b298(_this[_0x03f9('0x15')](0x1f4,_0x2c645e[_0x03f9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 7dfceb5..195629f 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 _0x199b=['length','./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x199b,0x131));var _0xb199=function(_0x4401c1,_0x763fd){_0x4401c1=_0x4401c1-0x0;var _0x3c1cdb=_0x199b[_0x4401c1];return _0x3c1cdb;};'use strict';var SmsInteractionEvents=require(_0xb199('0x0'));var events=[_0xb199('0x1'),_0xb199('0x2'),_0xb199('0x3')];function createListener(_0x238f49,_0x9940ec){return function(_0x2e4919){_0x9940ec[_0xb199('0x4')](_0x238f49,_0x2e4919);};}function removeListener(_0x435813,_0x37419d){return function(){SmsInteractionEvents[_0xb199('0x5')](_0x435813,_0x37419d);};}exports[_0xb199('0x6')]=function(_0x5a41ed){for(var _0x2198e1=0x0,_0x26db77=events[_0xb199('0x7')];_0x2198e1<_0x26db77;_0x2198e1++){var _0x348eee=events[_0x2198e1];var _0x4db6a2=createListener('smsInteraction:'+_0x348eee,_0x5a41ed);SmsInteractionEvents['on'](_0x348eee,_0x4db6a2);}}; \ No newline at end of file +var _0xb99b=['register','length','smsInteraction:','./smsInteraction.events','update','removeListener'];(function(_0x5a8e51,_0x434eec){var _0x23dc86=function(_0x34c82d){while(--_0x34c82d){_0x5a8e51['push'](_0x5a8e51['shift']());}};_0x23dc86(++_0x434eec);}(_0xb99b,0x177));var _0xbb99=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb99b[_0x14add3];return _0x4a174f;};'use strict';var SmsInteractionEvents=require(_0xbb99('0x0'));var events=['save','remove',_0xbb99('0x1')];function createListener(_0xe3fb6,_0xf43f1a){return function(_0x12b2e0){_0xf43f1a['emit'](_0xe3fb6,_0x12b2e0);};}function removeListener(_0x390b35,_0x5104c7){return function(){SmsInteractionEvents[_0xbb99('0x2')](_0x390b35,_0x5104c7);};}exports[_0xbb99('0x3')]=function(_0x14649d){for(var _0x4fd91c=0x0,_0x42ef2d=events[_0xbb99('0x4')];_0x4fd91c<_0x42ef2d;_0x4fd91c++){var _0x3d5ea5=events[_0x4fd91c];var _0x1738a1=createListener(_0xbb99('0x5')+_0x3d5ea5,_0x14649d);SmsInteractionEvents['on'](_0x3d5ea5,_0x1738a1);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 791826e..a1476fb 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 _0x0797=['../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','show','post','tracked','sms','create','/:id/status','status','/:id','put','/:id/accept','reject','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2515e7,_0x4f500b){var _0x153722=function(_0x52fe7e){while(--_0x52fe7e){_0x2515e7['push'](_0x2515e7['shift']());}};_0x153722(++_0x4f500b);}(_0x0797,0x18e));var _0x7079=function(_0x3db145,_0x4e84fb){_0x3db145=_0x3db145-0x0;var _0x510c13=_0x0797[_0x3db145];return _0x510c13;};'use strict';var multer=require(_0x7079('0x0'));var util=require(_0x7079('0x1'));var path=require(_0x7079('0x2'));var timeout=require(_0x7079('0x3'));var express=require(_0x7079('0x4'));var router=express[_0x7079('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7079('0x6'));var interaction=require(_0x7079('0x7'));var config=require(_0x7079('0x8'));var controller=require(_0x7079('0x9'));router[_0x7079('0xa')]('/',auth['isAuthenticated'](),controller[_0x7079('0xb')]);router[_0x7079('0xa')](_0x7079('0xc'),auth[_0x7079('0xd')](),controller[_0x7079('0xe')]);router[_0x7079('0xa')]('/:id',auth[_0x7079('0xd')](),controller[_0x7079('0xf')]);router[_0x7079('0x10')]('/',auth[_0x7079('0xd')](),interaction[_0x7079('0x11')](_0x7079('0x12'),'smsmessage:create'),controller[_0x7079('0x13')]);router[_0x7079('0x10')](_0x7079('0x14'),controller[_0x7079('0x15')]);router['put'](_0x7079('0x16'),auth[_0x7079('0xd')](),controller['update']);router[_0x7079('0x17')](_0x7079('0x18'),auth[_0x7079('0xd')](),controller['accept']);router[_0x7079('0x17')]('/:id/reject',auth['isAuthenticated'](),controller[_0x7079('0x19')]);router['delete'](_0x7079('0x16'),auth[_0x7079('0xd')](),controller['destroy']);module[_0x7079('0x1a')]=router; \ No newline at end of file +var _0x4147=['./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','update','put','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0x4147,0x1b8));var _0x7414=function(_0x2c765a,_0x129729){_0x2c765a=_0x2c765a-0x0;var _0x3570c1=_0x4147[_0x2c765a];return _0x3570c1;};'use strict';var multer=require(_0x7414('0x0'));var util=require(_0x7414('0x1'));var path=require(_0x7414('0x2'));var timeout=require(_0x7414('0x3'));var express=require(_0x7414('0x4'));var router=express['Router']();var fs_extra=require(_0x7414('0x5'));var auth=require(_0x7414('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7414('0x7'));var controller=require(_0x7414('0x8'));router[_0x7414('0x9')]('/',auth[_0x7414('0xa')](),controller[_0x7414('0xb')]);router[_0x7414('0x9')](_0x7414('0xc'),auth[_0x7414('0xa')](),controller['describe']);router[_0x7414('0x9')](_0x7414('0xd'),auth[_0x7414('0xa')](),controller[_0x7414('0xe')]);router[_0x7414('0xf')]('/',auth['isAuthenticated'](),interaction[_0x7414('0x10')](_0x7414('0x11'),_0x7414('0x12')),controller[_0x7414('0x13')]);router[_0x7414('0xf')](_0x7414('0x14'),controller[_0x7414('0x15')]);router['put'](_0x7414('0xd'),auth['isAuthenticated'](),controller[_0x7414('0x16')]);router[_0x7414('0x17')]('/:id/accept',auth['isAuthenticated'](),controller[_0x7414('0x18')]);router[_0x7414('0x17')](_0x7414('0x19'),auth[_0x7414('0xa')](),controller[_0x7414('0x1a')]);router['delete'](_0x7414('0xd'),auth['isAuthenticated'](),controller[_0x7414('0x1b')]);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 a7d53e0..e8e1fc0 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 _0xc592=['ENUM','out','STRING','DATE','sequelize','exports','medium'];(function(_0xe47bb1,_0x1b8038){var _0x5082e8=function(_0x28a055){while(--_0x28a055){_0xe47bb1['push'](_0xe47bb1['shift']());}};_0x5082e8(++_0x1b8038);}(_0xc592,0x18c));var _0x2c59=function(_0x4ed902,_0x504687){_0x4ed902=_0x4ed902-0x0;var _0x4fc509=_0xc592[_0x4ed902];return _0x4fc509;};'use strict';var Sequelize=require(_0x2c59('0x0'));module[_0x2c59('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2c59('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2c59('0x3')]('in',_0x2c59('0x4')),'defaultValue':_0x2c59('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2c59('0x5')](0xbe)},'phone':{'type':Sequelize[_0x2c59('0x5')]},'readAt':{'type':Sequelize[_0x2c59('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2c59('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9688=['medium','BOOLEAN','ENUM','out','STRING','DATE','exports','TEXT'];(function(_0x30265b,_0x37ea96){var _0x31e035=function(_0x231656){while(--_0x231656){_0x30265b['push'](_0x30265b['shift']());}};_0x31e035(++_0x37ea96);}(_0x9688,0xce));var _0x8968=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9688[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require('sequelize');module[_0x8968('0x0')]={'body':{'type':Sequelize[_0x8968('0x1')](_0x8968('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8968('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8968('0x4')]('in',_0x8968('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x8968('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8968('0x6')]},'readAt':{'type':Sequelize[_0x8968('0x7')]},'secret':{'type':Sequelize[_0x8968('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8968('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 48c5170..39bbaa1 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 _0x3e2a=['lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','http','client','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','name','send','index','map','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','SmsMessage','rows','params','rawAttributes','find','create','body','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','update','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','internal','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra'];(function(_0x92c6f9,_0x375acf){var _0x5cd987=function(_0xc79ddf){while(--_0xc79ddf){_0x92c6f9['push'](_0x92c6f9['shift']());}};_0x5cd987(++_0x375acf);}(_0x3e2a,0x10c));var _0xa3e2=function(_0x550e3c,_0x1ffe38){_0x550e3c=_0x550e3c-0x0;var _0xaeb1c4=_0x3e2a[_0x550e3c];return _0xaeb1c4;};'use strict';var emlformat=require(_0xa3e2('0x0'));var rimraf=require(_0xa3e2('0x1'));var zipdir=require(_0xa3e2('0x2'));var jsonpatch=require(_0xa3e2('0x3'));var rp=require(_0xa3e2('0x4'));var moment=require(_0xa3e2('0x5'));var BPromise=require(_0xa3e2('0x6'));var Mustache=require(_0xa3e2('0x7'));var util=require(_0xa3e2('0x8'));var path=require('path');var sox=require(_0xa3e2('0x9'));var csv=require('to-csv');var ejs=require(_0xa3e2('0xa'));var fs=require('fs');var fs_extra=require(_0xa3e2('0xb'));var _=require(_0xa3e2('0xc'));var squel=require(_0xa3e2('0xd'));var crypto=require(_0xa3e2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa3e2('0xf'));var toCsv=require(_0xa3e2('0x10'));var querystring=require('querystring');var Papa=require(_0xa3e2('0x11'));var Redis=require(_0xa3e2('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3e2('0x13'));var logger=require(_0xa3e2('0x14'))(_0xa3e2('0x15'));var utils=require('../../config/utils');var config=require(_0xa3e2('0x16'));var licenseUtil=require(_0xa3e2('0x17'));var db=require(_0xa3e2('0x18'))['db'];config['redis']=_[_0xa3e2('0x19')](config[_0xa3e2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xa3e2('0x1b'))(new Redis(config[_0xa3e2('0x1a')]));require('./smsMessage.socket')[_0xa3e2('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xa3e2('0x1d')]({'port':0x232c});var client9002=jayson[_0xa3e2('0x1e')][_0xa3e2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4d1c19,_0x2dd399,_0x596293,_0x34bf13){return new BPromise(function(_0x4995b1,_0x152de3){var _0xde7e29=_0x34bf13||client;return _0xde7e29[_0xa3e2('0x1f')](_0x4d1c19,_0x596293)[_0xa3e2('0x20')](function(_0x1390b6){logger[_0xa3e2('0x21')]('SmsMessage,\x20%s,\x20%s',_0x2dd399,_0xa3e2('0x22'));logger[_0xa3e2('0x23')](_0xa3e2('0x24'),_0x2dd399,_0xa3e2('0x22'),JSON[_0xa3e2('0x25')](_0x1390b6));if(_0x1390b6[_0xa3e2('0x26')]){if(_0x1390b6[_0xa3e2('0x26')][_0xa3e2('0x27')]===0x1f4){logger[_0xa3e2('0x26')]('SmsMessage,\x20%s,\x20%s',_0x2dd399,_0x1390b6[_0xa3e2('0x26')]['message']);return _0x152de3(_0x1390b6[_0xa3e2('0x26')][_0xa3e2('0x28')]);}logger[_0xa3e2('0x26')]('SmsMessage,\x20%s,\x20%s',_0x2dd399,_0x1390b6[_0xa3e2('0x26')][_0xa3e2('0x28')]);return _0x4995b1(_0x1390b6['error'][_0xa3e2('0x28')]);}else{logger[_0xa3e2('0x21')](_0xa3e2('0x29'),_0x2dd399,'request\x20sent');_0x4995b1(_0x1390b6['result']['message']);}})[_0xa3e2('0x2a')](function(_0x32c1e7){logger[_0xa3e2('0x26')]('SmsMessage,\x20%s,\x20%s',_0x2dd399,_0x32c1e7);_0x152de3(_0x32c1e7);});});}function respondWithStatusCode(_0x4e9854,_0x40348e){_0x40348e=_0x40348e||0xcc;return function(_0x3b06bb){if(_0x3b06bb){return _0x4e9854[_0xa3e2('0x2b')](_0x40348e);}return _0x4e9854['status'](_0x40348e)['end']();};}function respondWithResult(_0x586431,_0x190b80){_0x190b80=_0x190b80||0xc8;return function(_0x4637de){if(_0x4637de){return _0x586431[_0xa3e2('0x2c')](_0x190b80)[_0xa3e2('0x2d')](_0x4637de);}};}function respondWithFilteredResult(_0x4098a6,_0x217d0b){return function(_0xa260de){if(_0xa260de){var _0x2d6d88=typeof _0x217d0b[_0xa3e2('0x2e')]===_0xa3e2('0x2f')&&typeof _0x217d0b[_0xa3e2('0x30')]==='undefined';var _0x8cdaa2=_0xa260de['count'];var _0x434e86=_0x2d6d88?0x0:_0x217d0b[_0xa3e2('0x2e')];var _0x4eea0d=_0x2d6d88?_0xa260de[_0xa3e2('0x31')]:_0x217d0b[_0xa3e2('0x2e')]+_0x217d0b['limit'];var _0x23efe9;if(_0x4eea0d>=_0x8cdaa2){_0x4eea0d=_0x8cdaa2;_0x23efe9=0xc8;}else{_0x23efe9=0xce;}_0x4098a6[_0xa3e2('0x2c')](_0x23efe9);return _0x4098a6[_0xa3e2('0x32')](_0xa3e2('0x33'),_0x434e86+'-'+_0x4eea0d+'/'+_0x8cdaa2)[_0xa3e2('0x2d')](_0xa260de);}return null;};}function patchUpdates(_0x705d23){return function(_0x43cacb){try{jsonpatch[_0xa3e2('0x34')](_0x43cacb,_0x705d23,!![]);}catch(_0x5f13fd){return BPromise[_0xa3e2('0x35')](_0x5f13fd);}return _0x43cacb[_0xa3e2('0x36')]();};}function saveUpdates(_0x1f12fc,_0x143798){return function(_0x38ef9f){if(_0x38ef9f){return _0x38ef9f['update'](_0x1f12fc)['then'](function(_0x3dd2ec){return _0x3dd2ec;});}return null;};}function removeEntity(_0x3383e4,_0x3fc77f){return function(_0x4fd920){if(_0x4fd920){return _0x4fd920[_0xa3e2('0x37')]()[_0xa3e2('0x20')](function(){_0x3383e4[_0xa3e2('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3487ad,_0x48172e){return function(_0x486884){if(!_0x486884){_0x3487ad[_0xa3e2('0x2b')](0x194);}return _0x486884;};}function handleError(_0x557f8d,_0x48f1f5){_0x48f1f5=_0x48f1f5||0x1f4;return function(_0x2943ad){logger[_0xa3e2('0x26')](_0x2943ad['stack']);if(_0x2943ad[_0xa3e2('0x38')]){delete _0x2943ad['name'];}_0x557f8d[_0xa3e2('0x2c')](_0x48f1f5)[_0xa3e2('0x39')](_0x2943ad);};}exports[_0xa3e2('0x3a')]=function(_0x217c9f,_0x2f22f8){var _0x710d5a={},_0x31104a={},_0x3dd9cc={'count':0x0,'rows':[]};var _0x1df74d=_[_0xa3e2('0x3b')](db['SmsMessage']['rawAttributes'],function(_0x3df635){return{'name':_0x3df635[_0xa3e2('0x3c')],'type':_0x3df635['type']['key']};});_0x31104a[_0xa3e2('0x3d')]=_[_0xa3e2('0x3b')](_0x1df74d,_0xa3e2('0x38'));_0x31104a[_0xa3e2('0x3e')]=_[_0xa3e2('0x3f')](_0x217c9f[_0xa3e2('0x3e')]);_0x31104a['filters']=_[_0xa3e2('0x40')](_0x31104a[_0xa3e2('0x3d')],_0x31104a['query']);_0x710d5a[_0xa3e2('0x41')]=_['intersection'](_0x31104a[_0xa3e2('0x3d')],qs[_0xa3e2('0x42')](_0x217c9f[_0xa3e2('0x3e')][_0xa3e2('0x42')]));_0x710d5a['attributes']=_0x710d5a[_0xa3e2('0x41')][_0xa3e2('0x43')]?_0x710d5a[_0xa3e2('0x41')]:_0x31104a[_0xa3e2('0x3d')];if(!_0x217c9f[_0xa3e2('0x3e')]['hasOwnProperty'](_0xa3e2('0x44'))){_0x710d5a[_0xa3e2('0x30')]=qs[_0xa3e2('0x30')](_0x217c9f['query'][_0xa3e2('0x30')]);_0x710d5a[_0xa3e2('0x2e')]=qs[_0xa3e2('0x2e')](_0x217c9f[_0xa3e2('0x3e')][_0xa3e2('0x2e')]);}_0x710d5a['order']=qs[_0xa3e2('0x45')](_0x217c9f[_0xa3e2('0x3e')][_0xa3e2('0x45')]);_0x710d5a['where']=qs['filters'](_[_0xa3e2('0x46')](_0x217c9f[_0xa3e2('0x3e')],_0x31104a['filters']),_0x1df74d);if(_0x217c9f[_0xa3e2('0x3e')][_0xa3e2('0x47')]){_0x710d5a[_0xa3e2('0x48')]=_[_0xa3e2('0x49')](_0x710d5a[_0xa3e2('0x48')],{'$or':_[_0xa3e2('0x3b')](_0x1df74d,function(_0x1a1e0e){if(_0x1a1e0e[_0xa3e2('0x4a')]!==_0xa3e2('0x4b')){var _0x6c1221={};_0x6c1221[_0x1a1e0e[_0xa3e2('0x38')]]={'$like':'%'+_0x217c9f[_0xa3e2('0x3e')][_0xa3e2('0x47')]+'%'};return _0x6c1221;}})});}_0x710d5a=_[_0xa3e2('0x49')]({},_0x710d5a,_0x217c9f[_0xa3e2('0x4c')]);var _0x2ef98b={'where':_0x710d5a['where']};return db['SmsMessage'][_0xa3e2('0x31')](_0x2ef98b)['then'](function(_0x21ce4c){_0x3dd9cc[_0xa3e2('0x31')]=_0x21ce4c;if(_0x217c9f['query'][_0xa3e2('0x4d')]){_0x710d5a[_0xa3e2('0x4e')]=[{'all':!![]}];}return db[_0xa3e2('0x4f')]['findAll'](_0x710d5a);})[_0xa3e2('0x20')](function(_0x59e9fc){_0x3dd9cc[_0xa3e2('0x50')]=_0x59e9fc;return _0x3dd9cc;})[_0xa3e2('0x20')](respondWithFilteredResult(_0x2f22f8,_0x710d5a))[_0xa3e2('0x2a')](handleError(_0x2f22f8,null));};exports['show']=function(_0x26c22e,_0x12f116){var _0x4f118f={'raw':!![],'where':{'id':_0x26c22e[_0xa3e2('0x51')]['id']}},_0x4b5a20={};_0x4b5a20[_0xa3e2('0x3d')]=_[_0xa3e2('0x3f')](db[_0xa3e2('0x4f')][_0xa3e2('0x52')]);_0x4b5a20[_0xa3e2('0x3e')]=_['keys'](_0x26c22e[_0xa3e2('0x3e')]);_0x4b5a20['filters']=_['intersection'](_0x4b5a20['model'],_0x4b5a20[_0xa3e2('0x3e')]);_0x4f118f[_0xa3e2('0x41')]=_[_0xa3e2('0x40')](_0x4b5a20['model'],qs[_0xa3e2('0x42')](_0x26c22e[_0xa3e2('0x3e')][_0xa3e2('0x42')]));_0x4f118f[_0xa3e2('0x41')]=_0x4f118f[_0xa3e2('0x41')][_0xa3e2('0x43')]?_0x4f118f[_0xa3e2('0x41')]:_0x4b5a20[_0xa3e2('0x3d')];if(_0x26c22e[_0xa3e2('0x3e')][_0xa3e2('0x4d')]){_0x4f118f[_0xa3e2('0x4e')]=[{'all':!![]}];}_0x4f118f=_[_0xa3e2('0x49')]({},_0x4f118f,_0x26c22e['options']);return db[_0xa3e2('0x4f')][_0xa3e2('0x53')](_0x4f118f)[_0xa3e2('0x20')](handleEntityNotFound(_0x12f116,null))[_0xa3e2('0x20')](respondWithResult(_0x12f116,null))['catch'](handleError(_0x12f116,null));};exports[_0xa3e2('0x54')]=function(_0x4a1bea,_0x5429c4){return db[_0xa3e2('0x4f')][_0xa3e2('0x54')](_0x4a1bea[_0xa3e2('0x55')],{})[_0xa3e2('0x20')](respondWithResult(_0x5429c4,0xc9))[_0xa3e2('0x2a')](handleError(_0x5429c4,null));};exports['update']=function(_0x341adb,_0x344984){if(_0x341adb[_0xa3e2('0x55')]['id']){delete _0x341adb[_0xa3e2('0x55')]['id'];}return db[_0xa3e2('0x4f')]['find']({'where':{'id':_0x341adb[_0xa3e2('0x51')]['id']}})[_0xa3e2('0x20')](handleEntityNotFound(_0x344984,null))[_0xa3e2('0x20')](saveUpdates(_0x341adb[_0xa3e2('0x55')],null))[_0xa3e2('0x20')](respondWithResult(_0x344984,null))[_0xa3e2('0x2a')](handleError(_0x344984,null));};exports[_0xa3e2('0x37')]=function(_0x4db89d,_0x189ff4){return db[_0xa3e2('0x4f')][_0xa3e2('0x53')]({'where':{'id':_0x4db89d['params']['id']}})[_0xa3e2('0x20')](handleEntityNotFound(_0x189ff4,null))[_0xa3e2('0x20')](removeEntity(_0x189ff4,null))['catch'](handleError(_0x189ff4,null));};exports[_0xa3e2('0x56')]=function(_0x11a225,_0x352e15){return db[_0xa3e2('0x4f')][_0xa3e2('0x56')]()['then'](respondWithResult(_0x352e15,null))[_0xa3e2('0x2a')](handleError(_0x352e15,null));};var interaction_log=require(_0xa3e2('0x14'))(_0xa3e2('0x57'));exports[_0xa3e2('0x58')]=function(_0x5e4c02,_0x2b239a,_0x44aece){var _0x243b68={'agent':{},'channel':'sms'};if(_0x5e4c02[_0xa3e2('0x55')]['id']){delete _0x5e4c02[_0xa3e2('0x55')]['id'];}_0x5e4c02[_0xa3e2('0x55')][_0xa3e2('0x59')]=!![];_0x5e4c02[_0xa3e2('0x55')][_0xa3e2('0x5a')]=moment()[_0xa3e2('0x5b')](_0xa3e2('0x5c'));_0x5e4c02[_0xa3e2('0x55')]['UserId']=_0x5e4c02[_0xa3e2('0x55')][_0xa3e2('0x5d')]||_0x5e4c02[_0xa3e2('0x5e')]['id'];_0x243b68[_0xa3e2('0x5f')]['id']=_0x5e4c02['body']['UserId'];return db[_0xa3e2('0x4f')][_0xa3e2('0x53')]({'where':{'id':_0x5e4c02[_0xa3e2('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b239a,null))['then'](saveUpdates(_0x5e4c02['body'],null))[_0xa3e2('0x20')](function(_0x1d3f9f){if(_0x1d3f9f){_0x243b68['message']=_0x1d3f9f[_0xa3e2('0x60')]({'plain':!![]});return db[_0xa3e2('0x61')]['find']({'where':{'id':_0x1d3f9f['SmsInteractionId']}});}return null;})[_0xa3e2('0x20')](handleEntityNotFound(_0x2b239a,null))[_0xa3e2('0x20')](function(_0x2b05c8){if(_0x2b05c8){return _0x2b05c8[_0xa3e2('0x62')]({'UserId':_0x5e4c02[_0xa3e2('0x55')][_0xa3e2('0x5d')],'read1stAt':_[_0xa3e2('0x63')](_0x2b05c8[_0xa3e2('0x64')])?moment()['format'](_0xa3e2('0x5c')):undefined});}return null;})[_0xa3e2('0x20')](function(_0xd977cb){if(_0xd977cb){_0x243b68[_0xa3e2('0x65')]=_0xd977cb['get']({'plain':!![]});interaction_log[_0xa3e2('0x21')](_0xa3e2('0x66'),_0x5e4c02[_0xa3e2('0x5e')]['id'],_0x5e4c02[_0xa3e2('0x5e')][_0xa3e2('0x38')],_0x5e4c02[_0xa3e2('0x5e')]['role'],_0x243b68[_0xa3e2('0x65')]['id'],_0x5e4c02[_0xa3e2('0x55')]?JSON[_0xa3e2('0x25')](_0x5e4c02[_0xa3e2('0x55')]):_0xa3e2('0x67'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x243b68);}return null;})[_0xa3e2('0x20')](function(_0x279576){var _0x51361f=_0xa3e2('0x68')+_0x279576[_0xa3e2('0x28')][_0xa3e2('0x69')];return db[_0xa3e2('0x6a')][_0xa3e2('0x3e')](_0x51361f,{'type':db[_0xa3e2('0x6b')][_0xa3e2('0x6c')][_0xa3e2('0x6d')],'raw':!![]})[_0xa3e2('0x20')](function(_0x56f208){return _0x56f208;});})[_0xa3e2('0x20')](function(_0x3fdfa6){if(_0x3fdfa6){_0x243b68[_0xa3e2('0x28')][_0xa3e2('0x6e')]=_0x3fdfa6[0x0];if(!_0x5e4c02['body'][_0xa3e2('0x5d')])return;return db[_0xa3e2('0x6f')][_0xa3e2('0x53')]({'where':{'id':_0x5e4c02['body'][_0xa3e2('0x5d')],'role':'agent'},'attributes':['id',_0xa3e2('0x38'),_0xa3e2('0x70'),_0xa3e2('0x71'),'internal'],'raw':!![]});}return null;})['then'](function(_0x161d37){if(!_0x161d37)return null;_0x243b68[_0xa3e2('0x28')][_0xa3e2('0x5f')]=_0x161d37;return _0x243b68;})[_0xa3e2('0x20')](function(_0x3919cf){if(_0x3919cf){if(_0x5e4c02[_0xa3e2('0x55')][_0xa3e2('0x72')]){_0x243b68[_0xa3e2('0x28')][_0xa3e2('0x73')]=util[_0xa3e2('0x5b')]('SIP/%s',_0x5e4c02[_0xa3e2('0x5e')][_0xa3e2('0x38')]);_0x243b68[_0xa3e2('0x28')][_0xa3e2('0x74')]=_0x243b68['channel'];_0x243b68[_0xa3e2('0x28')][_0xa3e2('0x75')]=_0x243b68['channel'];_0x243b68[_0xa3e2('0x28')][_0xa3e2('0x76')]=_0xa3e2('0x58');return respondWithRpcPromise(_0xa3e2('0x77'),_0xa3e2('0x77'),{'event':_0xa3e2('0x78'),'message':_0x243b68[_0xa3e2('0x28')]},client9002)['then'](function(){return _0x243b68;});}return _0x243b68;}return null;})['then'](respondWithResult(_0x2b239a,null))[_0xa3e2('0x2a')](handleError(_0x2b239a,null));};var interaction_log=require(_0xa3e2('0x14'))(_0xa3e2('0x57'));exports[_0xa3e2('0x35')]=function(_0x43f155,_0x25dcc8,_0x11549d){var _0x16cfe0={'agent':{},'channel':_0xa3e2('0x79')};if(_0x43f155['body']['id']){delete _0x43f155['body']['id'];}_0x43f155[_0xa3e2('0x55')][_0xa3e2('0x5d')]=_0x43f155['body'][_0xa3e2('0x5d')]||_0x43f155[_0xa3e2('0x5e')]['id'];_0x16cfe0[_0xa3e2('0x5f')]['id']=_0x43f155['body'][_0xa3e2('0x5d')];return db[_0xa3e2('0x4f')][_0xa3e2('0x53')]({'where':{'id':_0x43f155[_0xa3e2('0x51')]['id'],'UserId':null}})[_0xa3e2('0x20')](handleEntityNotFound(_0x25dcc8,null))[_0xa3e2('0x20')](function(_0x1a2bc4){if(_0x1a2bc4){_0x16cfe0[_0xa3e2('0x28')]=_0x1a2bc4[_0xa3e2('0x60')]({'plain':!![]});return db[_0xa3e2('0x61')][_0xa3e2('0x53')]({'where':{'id':_0x1a2bc4['SmsInteractionId']}});}return null;})[_0xa3e2('0x20')](handleEntityNotFound(_0x25dcc8,null))[_0xa3e2('0x20')](function(_0x4b5118){if(_0x4b5118){_0x16cfe0[_0xa3e2('0x65')]=_0x4b5118['get']({'plain':!![]});interaction_log[_0xa3e2('0x21')](_0xa3e2('0x7a'),_0x43f155[_0xa3e2('0x5e')]['id'],_0x43f155[_0xa3e2('0x5e')]['name'],_0x43f155[_0xa3e2('0x5e')]['role'],_0x16cfe0[_0xa3e2('0x65')]['id'],_0x43f155[_0xa3e2('0x55')]?JSON[_0xa3e2('0x25')](_0x43f155['body']):_0xa3e2('0x67'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x16cfe0);}return null;})[_0xa3e2('0x20')](function(_0x464e49){var _0x122343=_0xa3e2('0x68')+_0x464e49['message'][_0xa3e2('0x69')];return db[_0xa3e2('0x6a')][_0xa3e2('0x3e')](_0x122343,{'type':db[_0xa3e2('0x6b')][_0xa3e2('0x6c')][_0xa3e2('0x6d')],'raw':!![]})[_0xa3e2('0x20')](function(_0x103b6f){return _0x103b6f;});})[_0xa3e2('0x20')](function(_0x269f15){if(_0x269f15){_0x16cfe0['message'][_0xa3e2('0x6e')]=_0x269f15[0x0];if(!_0x43f155['body']['UserId'])return;return db[_0xa3e2('0x6f')][_0xa3e2('0x53')]({'where':{'id':_0x43f155[_0xa3e2('0x55')][_0xa3e2('0x5d')],'role':'agent'},'attributes':['id',_0xa3e2('0x38'),_0xa3e2('0x70'),_0xa3e2('0x71'),_0xa3e2('0x7b')],'raw':!![]});}return null;})[_0xa3e2('0x20')](function(_0x4d3ec2){if(!_0x4d3ec2)return null;_0x16cfe0[_0xa3e2('0x28')][_0xa3e2('0x5f')]=_0x4d3ec2;return _0x16cfe0;})[_0xa3e2('0x20')](function(_0xb35a01){if(_0xb35a01){_0xb35a01[_0xa3e2('0x28')][_0xa3e2('0x73')]=util['format']('SIP/%s',_0x43f155[_0xa3e2('0x5e')][_0xa3e2('0x38')]);_0xb35a01['message'][_0xa3e2('0x74')]=_0x16cfe0[_0xa3e2('0x74')];_0xb35a01[_0xa3e2('0x28')][_0xa3e2('0x75')]=_0x16cfe0[_0xa3e2('0x74')];_0xb35a01[_0xa3e2('0x28')][_0xa3e2('0x76')]=_0xa3e2('0x35');respondWithRpcPromise('EventManager',_0xa3e2('0x77'),{'event':'rejectmessage','message':_0xb35a01[_0xa3e2('0x28')]},client9002);return _0x16cfe0;}return null;})['then'](respondWithResult(_0x25dcc8,null))[_0xa3e2('0x2a')](handleError(_0x25dcc8,null));};exports[_0xa3e2('0x2c')]=function(_0x2719cd,_0x9a197a,_0x311e9d){if(_0x2719cd[_0xa3e2('0x55')]['id']){delete _0x2719cd['body']['id'];}var _0x367c12;return db[_0xa3e2('0x4f')]['find']({'where':{'id':_0x2719cd[_0xa3e2('0x51')]['id']}})[_0xa3e2('0x20')](handleEntityNotFound(_0x9a197a,null))[_0xa3e2('0x20')](function(_0x261b60){if(_0x261b60){_0x367c12=_0x261b60;return db[_0xa3e2('0x7c')]['find']({'where':{'id':_0x261b60['SmsAccountId']}});}})[_0xa3e2('0x20')](handleEntityNotFound(_0x9a197a,null))[_0xa3e2('0x20')](function(_0x4c5175){if(_0x4c5175){logger[_0xa3e2('0x23')](_0xa3e2('0x24'),'status',_0xa3e2('0x7d'),_0x4c5175[_0xa3e2('0x4a')],util[_0xa3e2('0x7e')](_0x2719cd[_0xa3e2('0x55')],{'showHidden':![],'depth':null}));switch(_0x4c5175[_0xa3e2('0x4a')]){case _0xa3e2('0x7f'):if(_0x2719cd[_0xa3e2('0x55')][_0xa3e2('0x80')]&&_0x2719cd[_0xa3e2('0x55')][_0xa3e2('0x80')]===_0x367c12[_0xa3e2('0x81')]){return _0x367c12[_0xa3e2('0x62')]({'read':!![]});}else{logger[_0xa3e2('0x26')](_0xa3e2('0x82'),'status',_0xa3e2('0x7f'),util[_0xa3e2('0x7e')](_0x2719cd[_0xa3e2('0x55')],{'showHidden':![],'depth':null}));}break;case _0xa3e2('0x83'):if(_0x2719cd[_0xa3e2('0x55')]['MessageUUID']&&_0x2719cd[_0xa3e2('0x55')][_0xa3e2('0x84')]===_0x367c12['messageId']&&_[_0xa3e2('0x85')]([_0xa3e2('0x86'),_0xa3e2('0x87')],_0x2719cd[_0xa3e2('0x55')]['Status'])>=0x0){return _0x367c12[_0xa3e2('0x62')]({'read':!![]});}else{logger[_0xa3e2('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa3e2('0x2c'),_0xa3e2('0x88'),util['inspect'](_0x2719cd[_0xa3e2('0x55')],{'showHidden':![],'depth':null}));}break;case _0xa3e2('0x89'):var _0x5f483c=_0x2719cd['body'][_0xa3e2('0x8a')][0x0];if(_0x5f483c[_0xa3e2('0x2c')]['groupName']===_0xa3e2('0x8b')){return _0x367c12['update']({'read':!![]});}else{logger[_0xa3e2('0x26')](_0xa3e2('0x82'),_0xa3e2('0x2c'),_0xa3e2('0x89'),util[_0xa3e2('0x7e')](_0x2719cd[_0xa3e2('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x367c12;}})[_0xa3e2('0x20')](respondWithResult(_0x9a197a,null))[_0xa3e2('0x2a')](handleError(_0x9a197a,null));}; \ No newline at end of file +var _0xa456=['null','RejectMessage','rejectMessage','ContactId','sequelize','contact','User','SIP/%s','SmsAccount','debug','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','messageId','indexOf','sent','delivered','Status','infobip','groupName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','rows','show','length','create','body','find','params','describe','../../config/logger','accept','read','readAt','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x49f3d8,_0x1b74c4){var _0x174c80=function(_0x3127f9){while(--_0x3127f9){_0x49f3d8['push'](_0x49f3d8['shift']());}};_0x174c80(++_0x1b74c4);}(_0xa456,0x142));var _0x6a45=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa456[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x6a45('0x0'));var rimraf=require(_0x6a45('0x1'));var zipdir=require(_0x6a45('0x2'));var jsonpatch=require(_0x6a45('0x3'));var rp=require('request-promise');var moment=require(_0x6a45('0x4'));var BPromise=require(_0x6a45('0x5'));var Mustache=require(_0x6a45('0x6'));var util=require('util');var path=require(_0x6a45('0x7'));var sox=require(_0x6a45('0x8'));var csv=require(_0x6a45('0x9'));var ejs=require(_0x6a45('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a45('0xb'));var squel=require(_0x6a45('0xc'));var crypto=require(_0x6a45('0xd'));var jsforce=require(_0x6a45('0xe'));var deskjs=require(_0x6a45('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6a45('0x10'));var Papa=require('papaparse');var Redis=require(_0x6a45('0x11'));var authService=require(_0x6a45('0x12'));var qs=require(_0x6a45('0x13'));var as=require(_0x6a45('0x14'));var hardwareService=require(_0x6a45('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6a45('0x16'));var config=require(_0x6a45('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x6a45('0x18')](config[_0x6a45('0x19')],{'host':_0x6a45('0x1a'),'port':0x18eb});var socket=require(_0x6a45('0x1b'))(new Redis(config[_0x6a45('0x19')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x6a45('0x1c'));var client=jayson[_0x6a45('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x6a45('0x1d')][_0x6a45('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3fab82,_0x13adc0,_0x548634,_0x54507b){return new BPromise(function(_0x49023f,_0x396d7d){var _0x391f81=_0x54507b||client;return _0x391f81[_0x6a45('0x1f')](_0x3fab82,_0x548634)['then'](function(_0x379c22){logger[_0x6a45('0x20')](_0x6a45('0x21'),_0x13adc0,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x13adc0,_0x6a45('0x22'),JSON[_0x6a45('0x23')](_0x379c22));if(_0x379c22['error']){if(_0x379c22[_0x6a45('0x24')][_0x6a45('0x25')]===0x1f4){logger['error'](_0x6a45('0x21'),_0x13adc0,_0x379c22[_0x6a45('0x24')][_0x6a45('0x26')]);return _0x396d7d(_0x379c22[_0x6a45('0x24')][_0x6a45('0x26')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x13adc0,_0x379c22[_0x6a45('0x24')][_0x6a45('0x26')]);return _0x49023f(_0x379c22[_0x6a45('0x24')][_0x6a45('0x26')]);}else{logger[_0x6a45('0x20')](_0x6a45('0x21'),_0x13adc0,_0x6a45('0x22'));_0x49023f(_0x379c22[_0x6a45('0x27')][_0x6a45('0x26')]);}})[_0x6a45('0x28')](function(_0x1310d7){logger[_0x6a45('0x24')]('SmsMessage,\x20%s,\x20%s',_0x13adc0,_0x1310d7);_0x396d7d(_0x1310d7);});});}function respondWithStatusCode(_0x3cb4d5,_0x5a0389){_0x5a0389=_0x5a0389||0xcc;return function(_0x1b83fa){if(_0x1b83fa){return _0x3cb4d5[_0x6a45('0x29')](_0x5a0389);}return _0x3cb4d5[_0x6a45('0x2a')](_0x5a0389)[_0x6a45('0x2b')]();};}function respondWithResult(_0x3ede76,_0x526062){_0x526062=_0x526062||0xc8;return function(_0x2b8cc8){if(_0x2b8cc8){return _0x3ede76[_0x6a45('0x2a')](_0x526062)[_0x6a45('0x2c')](_0x2b8cc8);}};}function respondWithFilteredResult(_0x1ccff0,_0x8265d9){return function(_0x227b6f){if(_0x227b6f){var _0x3fac9b=typeof _0x8265d9[_0x6a45('0x2d')]==='undefined'&&typeof _0x8265d9[_0x6a45('0x2e')]===_0x6a45('0x2f');var _0x22b320=_0x227b6f[_0x6a45('0x30')];var _0x3b07a1=_0x3fac9b?0x0:_0x8265d9['offset'];var _0x1f95d4=_0x3fac9b?_0x227b6f[_0x6a45('0x30')]:_0x8265d9[_0x6a45('0x2d')]+_0x8265d9[_0x6a45('0x2e')];var _0x4d5d0f;if(_0x1f95d4>=_0x22b320){_0x1f95d4=_0x22b320;_0x4d5d0f=0xc8;}else{_0x4d5d0f=0xce;}_0x1ccff0['status'](_0x4d5d0f);return _0x1ccff0[_0x6a45('0x31')]('Content-Range',_0x3b07a1+'-'+_0x1f95d4+'/'+_0x22b320)[_0x6a45('0x2c')](_0x227b6f);}return null;};}function patchUpdates(_0x5e9324){return function(_0x3dcddf){try{jsonpatch[_0x6a45('0x32')](_0x3dcddf,_0x5e9324,!![]);}catch(_0x429900){return BPromise[_0x6a45('0x33')](_0x429900);}return _0x3dcddf[_0x6a45('0x34')]();};}function saveUpdates(_0x3cab47,_0x351e70){return function(_0x2b6cc5){if(_0x2b6cc5){return _0x2b6cc5[_0x6a45('0x35')](_0x3cab47)[_0x6a45('0x36')](function(_0x421fe2){return _0x421fe2;});}return null;};}function removeEntity(_0x1893b9,_0x44c1cc){return function(_0x483b00){if(_0x483b00){return _0x483b00[_0x6a45('0x37')]()['then'](function(){_0x1893b9[_0x6a45('0x2a')](0xcc)[_0x6a45('0x2b')]();});}};}function handleEntityNotFound(_0x6f7f98,_0x2b052e){return function(_0x462d1f){if(!_0x462d1f){_0x6f7f98[_0x6a45('0x29')](0x194);}return _0x462d1f;};}function handleError(_0x5da21a,_0x2030a2){_0x2030a2=_0x2030a2||0x1f4;return function(_0x2abd19){logger[_0x6a45('0x24')](_0x2abd19[_0x6a45('0x38')]);if(_0x2abd19[_0x6a45('0x39')]){delete _0x2abd19[_0x6a45('0x39')];}_0x5da21a['status'](_0x2030a2)[_0x6a45('0x3a')](_0x2abd19);};}exports[_0x6a45('0x3b')]=function(_0x5c76bd,_0xb99ba3){var _0x32f014={},_0x10cb71={},_0x303d2e={'count':0x0,'rows':[]};var _0x476176=_['map'](db[_0x6a45('0x3c')][_0x6a45('0x3d')],function(_0x205afd){return{'name':_0x205afd[_0x6a45('0x3e')],'type':_0x205afd[_0x6a45('0x3f')][_0x6a45('0x40')]};});_0x10cb71[_0x6a45('0x41')]=_['map'](_0x476176,_0x6a45('0x39'));_0x10cb71['query']=_[_0x6a45('0x42')](_0x5c76bd[_0x6a45('0x43')]);_0x10cb71[_0x6a45('0x44')]=_[_0x6a45('0x45')](_0x10cb71['model'],_0x10cb71['query']);_0x32f014[_0x6a45('0x46')]=_[_0x6a45('0x45')](_0x10cb71['model'],qs[_0x6a45('0x47')](_0x5c76bd[_0x6a45('0x43')][_0x6a45('0x47')]));_0x32f014[_0x6a45('0x46')]=_0x32f014['attributes']['length']?_0x32f014['attributes']:_0x10cb71['model'];if(!_0x5c76bd[_0x6a45('0x43')][_0x6a45('0x48')](_0x6a45('0x49'))){_0x32f014[_0x6a45('0x2e')]=qs[_0x6a45('0x2e')](_0x5c76bd[_0x6a45('0x43')][_0x6a45('0x2e')]);_0x32f014[_0x6a45('0x2d')]=qs['offset'](_0x5c76bd[_0x6a45('0x43')]['offset']);}_0x32f014['order']=qs[_0x6a45('0x4a')](_0x5c76bd[_0x6a45('0x43')]['sort']);_0x32f014[_0x6a45('0x4b')]=qs['filters'](_[_0x6a45('0x4c')](_0x5c76bd[_0x6a45('0x43')],_0x10cb71[_0x6a45('0x44')]),_0x476176);if(_0x5c76bd[_0x6a45('0x43')]['filter']){_0x32f014[_0x6a45('0x4b')]=_[_0x6a45('0x4d')](_0x32f014[_0x6a45('0x4b')],{'$or':_[_0x6a45('0x4e')](_0x476176,function(_0x364cab){if(_0x364cab['type']!==_0x6a45('0x4f')){var _0x4b9de1={};_0x4b9de1[_0x364cab[_0x6a45('0x39')]]={'$like':'%'+_0x5c76bd[_0x6a45('0x43')]['filter']+'%'};return _0x4b9de1;}})});}_0x32f014=_[_0x6a45('0x4d')]({},_0x32f014,_0x5c76bd[_0x6a45('0x50')]);var _0x31d55d={'where':_0x32f014[_0x6a45('0x4b')]};return db['SmsMessage'][_0x6a45('0x30')](_0x31d55d)['then'](function(_0x1fb773){_0x303d2e['count']=_0x1fb773;if(_0x5c76bd[_0x6a45('0x43')][_0x6a45('0x51')]){_0x32f014[_0x6a45('0x52')]=[{'all':!![]}];}return db[_0x6a45('0x3c')]['findAll'](_0x32f014);})[_0x6a45('0x36')](function(_0x2c9465){_0x303d2e[_0x6a45('0x53')]=_0x2c9465;return _0x303d2e;})[_0x6a45('0x36')](respondWithFilteredResult(_0xb99ba3,_0x32f014))[_0x6a45('0x28')](handleError(_0xb99ba3,null));};exports[_0x6a45('0x54')]=function(_0xc7ee18,_0x17cfe4){var _0x134ace={'raw':!![],'where':{'id':_0xc7ee18['params']['id']}},_0x265fa1={};_0x265fa1[_0x6a45('0x41')]=_[_0x6a45('0x42')](db[_0x6a45('0x3c')][_0x6a45('0x3d')]);_0x265fa1['query']=_[_0x6a45('0x42')](_0xc7ee18[_0x6a45('0x43')]);_0x265fa1[_0x6a45('0x44')]=_['intersection'](_0x265fa1['model'],_0x265fa1['query']);_0x134ace[_0x6a45('0x46')]=_[_0x6a45('0x45')](_0x265fa1[_0x6a45('0x41')],qs[_0x6a45('0x47')](_0xc7ee18['query'][_0x6a45('0x47')]));_0x134ace[_0x6a45('0x46')]=_0x134ace[_0x6a45('0x46')][_0x6a45('0x55')]?_0x134ace['attributes']:_0x265fa1[_0x6a45('0x41')];if(_0xc7ee18[_0x6a45('0x43')][_0x6a45('0x51')]){_0x134ace['include']=[{'all':!![]}];}_0x134ace=_['merge']({},_0x134ace,_0xc7ee18[_0x6a45('0x50')]);return db[_0x6a45('0x3c')]['find'](_0x134ace)[_0x6a45('0x36')](handleEntityNotFound(_0x17cfe4,null))[_0x6a45('0x36')](respondWithResult(_0x17cfe4,null))[_0x6a45('0x28')](handleError(_0x17cfe4,null));};exports[_0x6a45('0x56')]=function(_0x3c30cc,_0x4b469b){return db['SmsMessage'][_0x6a45('0x56')](_0x3c30cc['body'],{})['then'](respondWithResult(_0x4b469b,0xc9))['catch'](handleError(_0x4b469b,null));};exports[_0x6a45('0x35')]=function(_0x364a68,_0x1a8604){if(_0x364a68[_0x6a45('0x57')]['id']){delete _0x364a68['body']['id'];}return db[_0x6a45('0x3c')][_0x6a45('0x58')]({'where':{'id':_0x364a68[_0x6a45('0x59')]['id']}})[_0x6a45('0x36')](handleEntityNotFound(_0x1a8604,null))[_0x6a45('0x36')](saveUpdates(_0x364a68[_0x6a45('0x57')],null))['then'](respondWithResult(_0x1a8604,null))[_0x6a45('0x28')](handleError(_0x1a8604,null));};exports[_0x6a45('0x37')]=function(_0x37b1f6,_0x3dd06f){return db[_0x6a45('0x3c')][_0x6a45('0x58')]({'where':{'id':_0x37b1f6[_0x6a45('0x59')]['id']}})[_0x6a45('0x36')](handleEntityNotFound(_0x3dd06f,null))[_0x6a45('0x36')](removeEntity(_0x3dd06f,null))['catch'](handleError(_0x3dd06f,null));};exports[_0x6a45('0x5a')]=function(_0x302923,_0x3bd27){return db['SmsMessage'][_0x6a45('0x5a')]()['then'](respondWithResult(_0x3bd27,null))[_0x6a45('0x28')](handleError(_0x3bd27,null));};var interaction_log=require(_0x6a45('0x5b'))('sms-interactions');exports[_0x6a45('0x5c')]=function(_0x1270f9,_0x5ea08c,_0x9da93b){var _0x124cdd={'agent':{},'channel':'sms'};if(_0x1270f9['body']['id']){delete _0x1270f9[_0x6a45('0x57')]['id'];}_0x1270f9[_0x6a45('0x57')][_0x6a45('0x5d')]=!![];_0x1270f9[_0x6a45('0x57')][_0x6a45('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1270f9[_0x6a45('0x57')][_0x6a45('0x5f')]=_0x1270f9['body'][_0x6a45('0x5f')]||_0x1270f9[_0x6a45('0x60')]['id'];_0x124cdd[_0x6a45('0x61')]['id']=_0x1270f9[_0x6a45('0x57')]['UserId'];return db[_0x6a45('0x3c')][_0x6a45('0x58')]({'where':{'id':_0x1270f9[_0x6a45('0x59')]['id'],'UserId':null}})[_0x6a45('0x36')](handleEntityNotFound(_0x5ea08c,null))[_0x6a45('0x36')](saveUpdates(_0x1270f9[_0x6a45('0x57')],null))[_0x6a45('0x36')](function(_0x2e8b1d){if(_0x2e8b1d){_0x124cdd[_0x6a45('0x26')]=_0x2e8b1d[_0x6a45('0x62')]({'plain':!![]});return db[_0x6a45('0x63')][_0x6a45('0x58')]({'where':{'id':_0x2e8b1d[_0x6a45('0x64')]}});}return null;})[_0x6a45('0x36')](handleEntityNotFound(_0x5ea08c,null))[_0x6a45('0x36')](function(_0x5dbe64){if(_0x5dbe64){return _0x5dbe64[_0x6a45('0x35')]({'UserId':_0x1270f9[_0x6a45('0x57')]['UserId'],'read1stAt':_[_0x6a45('0x65')](_0x5dbe64['read1stAt'])?moment()[_0x6a45('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6a45('0x36')](function(_0x3aed89){if(_0x3aed89){_0x124cdd[_0x6a45('0x67')]=_0x3aed89[_0x6a45('0x62')]({'plain':!![]});interaction_log[_0x6a45('0x20')](_0x6a45('0x68'),_0x1270f9[_0x6a45('0x60')]['id'],_0x1270f9[_0x6a45('0x60')][_0x6a45('0x39')],_0x1270f9['user'][_0x6a45('0x69')],_0x124cdd['interaction']['id'],_0x1270f9[_0x6a45('0x57')]?JSON[_0x6a45('0x23')](_0x1270f9[_0x6a45('0x57')]):'null');return respondWithRpcPromise(_0x6a45('0x6a'),_0x6a45('0x6b'),_0x124cdd);}return null;})[_0x6a45('0x36')](function(_0x3f3d7d){var _0x24d924=_0x6a45('0x6c')+_0x3f3d7d[_0x6a45('0x26')]['ContactId'];return db['sequelize'][_0x6a45('0x43')](_0x24d924,{'type':db[_0x6a45('0x6d')][_0x6a45('0x6e')][_0x6a45('0x6f')],'raw':!![]})[_0x6a45('0x36')](function(_0x140ead){return _0x140ead;});})['then'](function(_0x9692e1){if(_0x9692e1){_0x124cdd[_0x6a45('0x26')]['contact']=_0x9692e1[0x0];if(!_0x1270f9[_0x6a45('0x57')]['UserId'])return;return db['User']['find']({'where':{'id':_0x1270f9[_0x6a45('0x57')][_0x6a45('0x5f')],'role':_0x6a45('0x61')},'attributes':['id','name',_0x6a45('0x70'),_0x6a45('0x71'),_0x6a45('0x72')],'raw':!![]});}return null;})[_0x6a45('0x36')](function(_0x3c329c){if(!_0x3c329c)return null;_0x124cdd[_0x6a45('0x26')][_0x6a45('0x61')]=_0x3c329c;return _0x124cdd;})['then'](function(_0x4cbdf7){if(_0x4cbdf7){if(_0x1270f9[_0x6a45('0x57')][_0x6a45('0x73')]){_0x124cdd[_0x6a45('0x26')][_0x6a45('0x74')]=util[_0x6a45('0x66')]('SIP/%s',_0x1270f9[_0x6a45('0x60')][_0x6a45('0x39')]);_0x124cdd[_0x6a45('0x26')][_0x6a45('0x75')]=_0x124cdd[_0x6a45('0x75')];_0x124cdd[_0x6a45('0x26')][_0x6a45('0x76')]=_0x124cdd['channel'];_0x124cdd[_0x6a45('0x26')][_0x6a45('0x77')]='accept';return respondWithRpcPromise(_0x6a45('0x78'),_0x6a45('0x78'),{'event':_0x6a45('0x79'),'message':_0x124cdd[_0x6a45('0x26')]},client9002)['then'](function(){return _0x124cdd;});}return _0x124cdd;}return null;})[_0x6a45('0x36')](respondWithResult(_0x5ea08c,null))[_0x6a45('0x28')](handleError(_0x5ea08c,null));};var interaction_log=require('../../config/logger')(_0x6a45('0x7a'));exports[_0x6a45('0x33')]=function(_0x997f93,_0x5b979f,_0x275cdf){var _0x38e379={'agent':{},'channel':_0x6a45('0x7b')};if(_0x997f93[_0x6a45('0x57')]['id']){delete _0x997f93[_0x6a45('0x57')]['id'];}_0x997f93['body'][_0x6a45('0x5f')]=_0x997f93[_0x6a45('0x57')][_0x6a45('0x5f')]||_0x997f93[_0x6a45('0x60')]['id'];_0x38e379['agent']['id']=_0x997f93[_0x6a45('0x57')][_0x6a45('0x5f')];return db[_0x6a45('0x3c')]['find']({'where':{'id':_0x997f93['params']['id'],'UserId':null}})[_0x6a45('0x36')](handleEntityNotFound(_0x5b979f,null))['then'](function(_0x203108){if(_0x203108){_0x38e379[_0x6a45('0x26')]=_0x203108[_0x6a45('0x62')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x203108['SmsInteractionId']}});}return null;})[_0x6a45('0x36')](handleEntityNotFound(_0x5b979f,null))[_0x6a45('0x36')](function(_0x12f831){if(_0x12f831){_0x38e379[_0x6a45('0x67')]=_0x12f831[_0x6a45('0x62')]({'plain':!![]});interaction_log['info'](_0x6a45('0x7c'),_0x997f93['user']['id'],_0x997f93['user'][_0x6a45('0x39')],_0x997f93[_0x6a45('0x60')][_0x6a45('0x69')],_0x38e379[_0x6a45('0x67')]['id'],_0x997f93['body']?JSON[_0x6a45('0x23')](_0x997f93['body']):_0x6a45('0x7d'));return respondWithRpcPromise(_0x6a45('0x7e'),_0x6a45('0x7f'),_0x38e379);}return null;})[_0x6a45('0x36')](function(_0x2fff47){var _0xa5be78=_0x6a45('0x6c')+_0x2fff47[_0x6a45('0x26')][_0x6a45('0x80')];return db[_0x6a45('0x81')][_0x6a45('0x43')](_0xa5be78,{'type':db[_0x6a45('0x6d')][_0x6a45('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x3cfd02){return _0x3cfd02;});})['then'](function(_0x1acb5a){if(_0x1acb5a){_0x38e379[_0x6a45('0x26')][_0x6a45('0x82')]=_0x1acb5a[0x0];if(!_0x997f93[_0x6a45('0x57')][_0x6a45('0x5f')])return;return db[_0x6a45('0x83')][_0x6a45('0x58')]({'where':{'id':_0x997f93[_0x6a45('0x57')]['UserId'],'role':_0x6a45('0x61')},'attributes':['id','name','fullname','email',_0x6a45('0x72')],'raw':!![]});}return null;})[_0x6a45('0x36')](function(_0x244e4e){if(!_0x244e4e)return null;_0x38e379[_0x6a45('0x26')][_0x6a45('0x61')]=_0x244e4e;return _0x38e379;})['then'](function(_0xb0d2ca){if(_0xb0d2ca){_0xb0d2ca[_0x6a45('0x26')][_0x6a45('0x74')]=util[_0x6a45('0x66')](_0x6a45('0x84'),_0x997f93[_0x6a45('0x60')][_0x6a45('0x39')]);_0xb0d2ca[_0x6a45('0x26')][_0x6a45('0x75')]=_0x38e379['channel'];_0xb0d2ca['message']['motionChannel']=_0x38e379[_0x6a45('0x75')];_0xb0d2ca[_0x6a45('0x26')][_0x6a45('0x77')]=_0x6a45('0x33');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0xb0d2ca[_0x6a45('0x26')]},client9002);return _0x38e379;}return null;})['then'](respondWithResult(_0x5b979f,null))['catch'](handleError(_0x5b979f,null));};exports['status']=function(_0x3ad100,_0x40021e,_0x2ef522){if(_0x3ad100[_0x6a45('0x57')]['id']){delete _0x3ad100[_0x6a45('0x57')]['id'];}var _0x4a6358;return db[_0x6a45('0x3c')]['find']({'where':{'id':_0x3ad100[_0x6a45('0x59')]['id']}})[_0x6a45('0x36')](handleEntityNotFound(_0x40021e,null))[_0x6a45('0x36')](function(_0x142414){if(_0x142414){_0x4a6358=_0x142414;return db[_0x6a45('0x85')]['find']({'where':{'id':_0x142414['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x40021e,null))[_0x6a45('0x36')](function(_0xd389bc){if(_0xd389bc){logger[_0x6a45('0x86')](_0x6a45('0x87'),_0x6a45('0x2a'),_0x6a45('0x88'),_0xd389bc[_0x6a45('0x3f')],util[_0x6a45('0x89')](_0x3ad100[_0x6a45('0x57')],{'showHidden':![],'depth':null}));switch(_0xd389bc['type']){case _0x6a45('0x8a'):if(_0x3ad100[_0x6a45('0x57')][_0x6a45('0x8b')]&&_0x3ad100['body'][_0x6a45('0x8b')]===_0x4a6358['messageId']){return _0x4a6358[_0x6a45('0x35')]({'read':!![]});}else{logger[_0x6a45('0x24')](_0x6a45('0x8c'),_0x6a45('0x2a'),_0x6a45('0x8a'),util['inspect'](_0x3ad100[_0x6a45('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3ad100[_0x6a45('0x57')][_0x6a45('0x8d')]&&_0x3ad100[_0x6a45('0x57')][_0x6a45('0x8d')]===_0x4a6358[_0x6a45('0x8e')]&&_[_0x6a45('0x8f')]([_0x6a45('0x90'),_0x6a45('0x91')],_0x3ad100[_0x6a45('0x57')][_0x6a45('0x92')])>=0x0){return _0x4a6358['update']({'read':!![]});}else{logger[_0x6a45('0x24')](_0x6a45('0x8c'),_0x6a45('0x2a'),'plivio',util[_0x6a45('0x89')](_0x3ad100[_0x6a45('0x57')],{'showHidden':![],'depth':null}));}break;case _0x6a45('0x93'):var _0x3834ad=_0x3ad100[_0x6a45('0x57')]['results'][0x0];if(_0x3834ad[_0x6a45('0x2a')][_0x6a45('0x94')]==='DELIVERED'){return _0x4a6358[_0x6a45('0x35')]({'read':!![]});}else{logger[_0x6a45('0x24')](_0x6a45('0x8c'),_0x6a45('0x2a'),'infobip',util['inspect'](_0x3ad100['body'],{'showHidden':![],'depth':null}));}break;}return _0x4a6358;}})['then'](respondWithResult(_0x40021e,null))['catch'](handleError(_0x40021e,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 0d1c3c3..db7111d 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 _0x6d1a=['save','remove','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x4ed788,_0x27f718){var _0x1fc7dc=function(_0x1989ca){while(--_0x1989ca){_0x4ed788['push'](_0x4ed788['shift']());}};_0x1fc7dc(++_0x27f718);}(_0x6d1a,0x188));var _0xa6d1=function(_0x16014c,_0x10ee69){_0x16014c=_0x16014c-0x0;var _0x2839e9=_0x6d1a[_0x16014c];return _0x2839e9;};'use strict';var EventEmitter=require(_0xa6d1('0x0'));var SmsMessage=require(_0xa6d1('0x1'))['db'][_0xa6d1('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xa6d1('0x3')](0x0);var events={'afterCreate':_0xa6d1('0x4'),'afterUpdate':'update','afterDestroy':_0xa6d1('0x5')};function emitEvent(_0x29a31b){return function(_0x11b7cf,_0x57fa57,_0x1765a6){SmsMessageEvents[_0xa6d1('0x6')](_0x29a31b+':'+_0x11b7cf['id'],_0x11b7cf);SmsMessageEvents[_0xa6d1('0x6')](_0x29a31b,_0x11b7cf);_0x1765a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xa6d1('0x7')](e,emitEvent(event));}}module[_0xa6d1('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xfbba=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x5d2365,_0x16ca11){var _0x41c80f=function(_0x296060){while(--_0x296060){_0x5d2365['push'](_0x5d2365['shift']());}};_0x41c80f(++_0x16ca11);}(_0xfbba,0x100));var _0xafbb=function(_0x5b9236,_0x35d61d){_0x5b9236=_0x5b9236-0x0;var _0x466544=_0xfbba[_0x5b9236];return _0x466544;};'use strict';var EventEmitter=require(_0xafbb('0x0'));var SmsMessage=require(_0xafbb('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xafbb('0x2')](0x0);var events={'afterCreate':_0xafbb('0x3'),'afterUpdate':_0xafbb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e72a5){return function(_0x5daf60,_0x491865,_0x267bea){SmsMessageEvents[_0xafbb('0x5')](_0x2e72a5+':'+_0x5daf60['id'],_0x5daf60);SmsMessageEvents[_0xafbb('0x5')](_0x2e72a5,_0x5daf60);_0x267bea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xafbb('0x6')](e,emitEvent(event));}}module[_0xafbb('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index f9f5ef5..b6df97c 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 _0x9879=['application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','length','createHash','digest','hex','signature=','GET','/external/get/send.php?','keys','Missing\x20parameters:\x20apiKey','clickatell','apiKey','https://platform.clickatell.com/messages','uuid','accountId','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','body','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','secret','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','create','phone','remote','/api/sms/messages/','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','username','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','http_code','data','messages','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','toString','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x9879,0x98));var _0x9987=function(_0x191346,_0x567cd6){_0x191346=_0x191346-0x0;var _0xbf1ac7=_0x9879[_0x191346];return _0xbf1ac7;};'use strict';var _=require('lodash');var util=require(_0x9987('0x0'));var logger=require(_0x9987('0x1'))(_0x9987('0x2'));var moment=require(_0x9987('0x3'));var BPromise=require(_0x9987('0x4'));var rp=require(_0x9987('0x5'));var fs=require('fs');var path=require(_0x9987('0x6'));var rimraf=require(_0x9987('0x7'));var config=require(_0x9987('0x8'));var attributes=require(_0x9987('0x9'));module[_0x9987('0xa')]=function(_0x473510,_0x15193d){return _0x473510[_0x9987('0xb')](_0x9987('0xc'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x9987('0xd'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x9987('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x23c008,_0x15a223,_0x45a08f){var _0x286f03=_0x473510[_0x9987('0xf')];var _0x3bb4ed=_0x23c008[_0x9987('0x10')]({'plain':!![]});if(_0x3bb4ed[_0x9987('0x11')][_0x9987('0x12')]()==='in'||_0x3bb4ed[_0x9987('0x11')][_0x9987('0x12')]()===_0x9987('0x13')&&!_0x3bb4ed['secret']&&!_[_0x9987('0x14')](_0x3bb4ed[_0x9987('0x15')])){_0x286f03[_0x9987('0x16')][_0x9987('0x17')]({'where':{'id':_0x3bb4ed[_0x9987('0x18')]}})[_0x9987('0x19')](function(_0x40cd6c){if(_0x40cd6c){_0x40cd6c[_0x9987('0x1a')]({'lastMsgAt':_0x3bb4ed[_0x9987('0x1b')],'lastMsgDirection':_0x3bb4ed[_0x9987('0x11')][_0x9987('0x12')]()});}})[_0x9987('0x1c')](function(_0x598a6f){console['error'](_0x598a6f);});}if(_0x3bb4ed[_0x9987('0x11')]===_0x9987('0x13')&&!_0x3bb4ed[_0x9987('0x1d')]){var _0x38df2b;_0x286f03[_0x9987('0x1e')]['find']({'where':{'id':_0x3bb4ed[_0x9987('0x1f')]},'raw':!![]})[_0x9987('0x19')](function(_0x42ad45){_0x38df2b=_0x42ad45;if(_0x38df2b&&_0x38df2b[_0x9987('0x20')]){switch(_0x38df2b[_0x9987('0x20')]){case _0x9987('0x21'):var _0x3488bb=require('twilio');if(_0x38df2b[_0x9987('0x22')]&&_0x38df2b[_0x9987('0x23')]&&_0x38df2b['phone']){var _0x5b2adb=new _0x3488bb(_0x38df2b[_0x9987('0x22')],_0x38df2b['authToken']);_0x5b2adb['messages'][_0x9987('0x24')]({'body':_0x3bb4ed[_0x9987('0xe')],'to':_0x3bb4ed[_0x9987('0x25')],'from':_0x38df2b[_0x9987('0x25')],'statusCallback':_0x38df2b[_0x9987('0x26')]+_0x9987('0x27')+_0x3bb4ed['id']+'/status?token='+_0x38df2b[_0x9987('0x28')]})[_0x9987('0x19')](function(_0x10b59c){if(_0x10b59c[_0x9987('0x29')]){return _0x23c008['update']({'messageId':_0x10b59c[_0x9987('0x29')]});}})[_0x9987('0x1c')](function(_0x490475){logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),'twilio',util[_0x9987('0x2d')](_0x490475,{'showHidden':![],'depth':null}));});}else{logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x21'),_0x9987('0x2e'));}break;case _0x9987('0x2f'):var _0x474c42='https://api.skebby.it/API/v1.0/REST/';if(_0x38df2b['username']&&_0x38df2b[_0x9987('0x30')]){var _0x40248f={'recipient':[_0x3bb4ed[_0x9987('0x25')]],'message':_0x3bb4ed['body'],'message_type':_0x38df2b['smsMethod']};if(_0x38df2b[_0x9987('0x31')]&&_0x38df2b[_0x9987('0x31')]!=='SI'){_0x40248f[_0x9987('0x32')]=_0x38df2b[_0x9987('0x25')];}var _0x3059ce={'url':_0x474c42+'login?username='+_0x38df2b[_0x9987('0x33')]+'&password='+_0x38df2b['password'],'method':'GET'};rp(_0x3059ce)[_0x9987('0x19')](function(_0x300842){var _0x3971c7=_0x300842[_0x9987('0x34')](';');var _0x165309={'user_key':_0x3971c7[0x0],'session_key':_0x3971c7[0x1]};_0x3059ce={'url':_0x474c42+_0x9987('0x35'),'method':_0x9987('0x36'),'headers':{'user_key':_0x165309[_0x9987('0x37')],'Session_key':_0x165309[_0x9987('0x38')]},'json':!![],'body':_0x40248f};return rp(_0x3059ce);})[_0x9987('0x19')](function(_0x21d449){if(_0x21d449[_0x9987('0x39')]>=0x1){var _0x52d3b3={'messageId':_0x21d449[_0x9987('0x3a')]};if(_0x38df2b[_0x9987('0x31')]!=='GP'||!_0x38df2b[_0x9987('0x3b')]){_0x52d3b3[_0x9987('0x3c')]=!![];}return _0x23c008[_0x9987('0x1a')](_0x52d3b3);}else{return logger[_0x9987('0x2a')](_0x9987('0x2b'),'afterCreate',_0x9987('0x2f'),util[_0x9987('0x2d')](_0x21d449,{'showHidden':![],'depth':null}));}})[_0x9987('0x1c')](function(_0x25221a){return logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),'skebby',util['inspect'](_0x25221a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x2f'),_0x9987('0x3d'));}break;case _0x9987('0x3e'):if(_0x38df2b[_0x9987('0x23')]){var _0x5c5177={'recipient':_0x3bb4ed['phone'],'message':_0x3bb4ed[_0x9987('0xe')],'sender':_0x38df2b[_0x9987('0x3f')]||_0x38df2b['phone'],'authorization':_0x38df2b[_0x9987('0x23')]};var _0x15a223={'method':'POST','uri':_0x9987('0x40'),'body':_0x5c5177,'json':!![]};rp(_0x15a223)[_0x9987('0x19')](function(_0x4f445c){var _0x2ce5c4={'messageId':_0x4f445c[_0x9987('0x41')]};if(!_0x38df2b[_0x9987('0x3b')]){_0x2ce5c4[_0x9987('0x3c')]=!![];}return _0x23c008['update'](_0x2ce5c4);})['catch'](function(_0xc36478){logger[_0x9987('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9987('0x2c'),_0x9987('0x3e'),util[_0x9987('0x2d')](_0xc36478,{'showHidden':![],'depth':null}));});}else{logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x3e'),_0x9987('0x42'));}break;case'clicksend':if(_0x38df2b[_0x9987('0x33')]&&_0x38df2b[_0x9987('0x30')]){var _0x5c5177={'messages':[{'source':_0x9987('0x43'),'to':_0x3bb4ed['phone'],'body':_0x3bb4ed[_0x9987('0xe')],'from':_0x38df2b[_0x9987('0x3f')]||_0x38df2b[_0x9987('0x25')]}]};var _0x182e69=util[_0x9987('0x44')](_0x9987('0x45'),_0x38df2b['username'],_0x38df2b[_0x9987('0x30')]);var _0x15a223={'method':_0x9987('0x36'),'uri':_0x9987('0x46'),'body':_0x5c5177,'headers':{'Authorization':util[_0x9987('0x44')](_0x9987('0x47'),new Buffer(_0x182e69)['toString']('base64'))},'json':!![]};rp(_0x15a223)[_0x9987('0x19')](function(_0x556ff4){if(_0x556ff4['http_code']>=0xc8&&_0x556ff4[_0x9987('0x48')]<=0xce){if(_0x556ff4[_0x9987('0x49')]&&_0x556ff4[_0x9987('0x49')]['queued_count']>0x0){var _0x854b1=_['head'](_0x556ff4[_0x9987('0x49')][_0x9987('0x4a')]);var _0x5ab194={'messageId':_0x854b1[_0x9987('0x4b')]};if(!_0x38df2b[_0x9987('0x3b')]){_0x5ab194[_0x9987('0x3c')]=!![];}return _0x23c008[_0x9987('0x1a')](_0x5ab194);}else{logger[_0x9987('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9987('0x2c'),'clickSend',util[_0x9987('0x2d')](_0x556ff4,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x9987('0x2b'),'afterCreate',_0x9987('0x4c'),util['inspect'](_0x556ff4,{'showHidden':![],'depth':null}));}})[_0x9987('0x1c')](function(_0x5038e2){logger[_0x9987('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9987('0x2c'),'clickSend',util[_0x9987('0x2d')](_0x5038e2,{'showHidden':![],'depth':null}));});}else{logger[_0x9987('0x2a')](_0x9987('0x2b'),'afterCreate',_0x9987('0x4c'),_0x9987('0x3d'));}break;case _0x9987('0x4d'):if(_0x38df2b[_0x9987('0x4e')]&&_0x38df2b[_0x9987('0x23')]){var _0x5c5177={'dst':_0x3bb4ed[_0x9987('0x25')],'text':_0x3bb4ed[_0x9987('0xe')],'src':_0x38df2b[_0x9987('0x3f')]||_0x38df2b[_0x9987('0x25')],'url':_0x38df2b[_0x9987('0x26')]+'/api/sms/messages/'+_0x3bb4ed['id']+_0x9987('0x4f')+_0x38df2b[_0x9987('0x28')]};var _0x182e69=util[_0x9987('0x44')](_0x9987('0x45'),_0x38df2b[_0x9987('0x4e')],_0x38df2b[_0x9987('0x23')]);var _0x15a223={'method':'POST','uri':util[_0x9987('0x44')](_0x9987('0x50'),_0x38df2b[_0x9987('0x4e')]),'body':_0x5c5177,'headers':{'Authorization':util[_0x9987('0x44')](_0x9987('0x47'),new Buffer(_0x182e69)[_0x9987('0x51')](_0x9987('0x52')))},'json':!![]};rp(_0x15a223)[_0x9987('0x19')](function(_0x410948){var _0x40f8e9={'messageId':_0x410948[_0x9987('0x53')][0x0]};return _0x23c008[_0x9987('0x1a')](_0x40f8e9);})[_0x9987('0x1c')](function(_0x129d88){logger[_0x9987('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9987('0x2c'),_0x9987('0x4d'),util['inspect'](_0x129d88,{'showHidden':![],'depth':null}));});}else{logger[_0x9987('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9987('0x2c'),_0x9987('0x4d'),_0x9987('0x54'));}break;case _0x9987('0x55'):if(_0x38df2b[_0x9987('0x33')]&&_0x38df2b['password']){if(_0x38df2b[_0x9987('0x56')]){var _0x25fe58={'method':'POST','uri':_0x38df2b[_0x9987('0x56')]+'/auth/1/session','body':{'username':_0x38df2b[_0x9987('0x33')],'password':_0x38df2b[_0x9987('0x30')]},'json':!![]};return rp(_0x25fe58)[_0x9987('0x19')](function(_0x5343f4){var _0x156db2={'method':_0x9987('0x36'),'uri':_0x38df2b[_0x9987('0x56')]+_0x9987('0x57'),'body':{'messages':[{'from':_0x38df2b[_0x9987('0x25')],'destinations':[{'to':_0x3bb4ed[_0x9987('0x25')]}],'text':_0x3bb4ed[_0x9987('0xe')],'notifyUrl':_0x38df2b[_0x9987('0x26')]+_0x9987('0x27')+_0x3bb4ed['id']+'/status?token='+_0x38df2b[_0x9987('0x28')],'notifyContentType':_0x9987('0x58'),'callbackData':_0x38df2b[_0x9987('0x25')]+';'+_0x3bb4ed[_0x9987('0xe')]}]},'headers':{'Authorization':_0x9987('0x59')+_0x5343f4['token']},'json':!![]};return rp(_0x156db2)['then'](function(_0x29ea4d){if(_0x29ea4d[_0x9987('0x4a')]){var _0xf46a69={'messageId':_0x29ea4d[_0x9987('0x4a')][0x0]['messageId']};if(!_0x38df2b[_0x9987('0x3b')]){_0xf46a69['read']=!![];}return _0x23c008[_0x9987('0x1a')](_0xf46a69);}else{return logger[_0x9987('0x2a')](_0x9987('0x2b'),'afterCreate',_0x9987('0x55'),util['inspect'](_0x29ea4d,{'showHidden':![],'depth':null}));}});})[_0x9987('0x1c')](function(_0x1b512d){return logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x55'),util['inspect'](_0x1b512d,{'showHidden':![],'depth':null}));});}else{logger[_0x9987('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9987('0x2c'),_0x9987('0x55'),_0x9987('0x5a'));}}else{logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x55'),_0x9987('0x3d'));}break;case _0x9987('0x5b'):var _0x2df521=require(_0x9987('0x5c'));if(_0x38df2b['apiKey']){var _0x155ff7={};_0x155ff7[_0x9987('0x5d')]=_0x38df2b['username'];_0x155ff7[_0x9987('0x25')]=_0x3bb4ed[_0x9987('0x25')];_0x155ff7[_0x9987('0x32')]=_0x38df2b[_0x9987('0x25')];_0x155ff7[_0x9987('0x5e')]=_0x3bb4ed['body'];_0x155ff7[_0x9987('0x5f')]=+new Date();var _0x5429e5='';var _0x5c7367='';var _0x6330e2=Object['keys'](_0x155ff7);_0x6330e2['sort']();for(var _0x5072a7=0x0;_0x5072a7<_0x6330e2[_0x9987('0x60')];_0x5072a7++){if(_0x5429e5!=''){_0x5429e5+='&';}_0x5429e5+=_0x6330e2[_0x5072a7]+'='+encodeURIComponent(_0x155ff7[_0x6330e2[_0x5072a7]]);_0x5c7367+=_0x155ff7[_0x6330e2[_0x5072a7]];}_0x5c7367+=_0x38df2b['apiKey'];_0x5c7367=_0x2df521[_0x9987('0x61')]('md5')[_0x9987('0x1a')](_0x5c7367)[_0x9987('0x62')](_0x9987('0x63'));if(_0x5429e5!==''){_0x5429e5+='&';}_0x5429e5+=_0x9987('0x64')+_0x5c7367;var _0x3059ce={'method':_0x9987('0x65'),'uri':_0x38df2b[_0x9987('0x56')]+_0x9987('0x66')+_0x5429e5,'json':!![]};return rp(_0x3059ce)[_0x9987('0x19')](function(_0x260154){var _0x408dce=Object[_0x9987('0x67')](_0x260154);if(_0x260154[_0x408dce[0x0]][_0x9987('0x2a')]&&parseInt(_0x260154[_0x408dce[0x0]]['error'])===0x0){var _0x4ad3cc={'messageId':_0x260154[_0x408dce[0x0]]['id_sms']};if(!_0x38df2b[_0x9987('0x3b')]){_0x4ad3cc[_0x9987('0x3c')]=!![];}return _0x23c008[_0x9987('0x1a')](_0x4ad3cc);}else{return logger[_0x9987('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9987('0x2c'),_0x9987('0x5b'),util[_0x9987('0x2d')](_0x260154[_0x9987('0x2a')],{'showHidden':![],'depth':null}));}})[_0x9987('0x1c')](function(_0x111c6b){return logger[_0x9987('0x2a')](_0x9987('0x2b'),'afterCreate',_0x9987('0x5b'),util['inspect'](_0x111c6b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9987('0x2b'),'afterCreate','csc',_0x9987('0x68'));}break;case _0x9987('0x69'):if(_0x38df2b[_0x9987('0x6a')]){var _0x2acda5={'method':'POST','uri':_0x9987('0x6b'),'headers':{'Authorization':_0x38df2b[_0x9987('0x6a')]},'body':{'content':_0x3bb4ed[_0x9987('0xe')],'to':[_0x3bb4ed[_0x9987('0x25')]],'from':_0x38df2b['phone'],'binary':![],'clientMessageId':_0x9987('0x6c'),'charset':'UTF-8'},'json':!![]};rp(_0x2acda5)[_0x9987('0x19')](function(_0x542550){if(!_0x542550['error']){var _0x113026={'messageId':_0x542550['messages'][0x0]['apiMessageId']};if(!_0x38df2b[_0x9987('0x3b')]){_0x113026[_0x9987('0x3c')]=!![];}return _0x23c008[_0x9987('0x1a')](_0x113026);}else{return logger['error'](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x69'),util[_0x9987('0x2d')](_0x542550[_0x9987('0x2a')],{'showHidden':![],'depth':null}));}})[_0x9987('0x1c')](function(_0x311696){return logger['error'](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x69'),util[_0x9987('0x2d')](_0x311696,{'showHidden':![],'depth':null}));});}else{logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x69'),_0x9987('0x68'));}break;case'bandwidth':if(_0x38df2b['username']&&_0x38df2b[_0x9987('0x30')]){var _0x182e69=util[_0x9987('0x44')](_0x9987('0x45'),_0x38df2b[_0x9987('0x33')],_0x38df2b[_0x9987('0x30')]);var _0x15a223={'method':_0x9987('0x36'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x38df2b[_0x9987('0x6d')]+'/messages','body':{'to':[_0x3bb4ed[_0x9987('0x25')]],'text':_0x3bb4ed['body'],'from':_0x38df2b[_0x9987('0x25')],'applicationId':_0x38df2b[_0x9987('0x6e')]},'headers':{'Authorization':util[_0x9987('0x44')]('Basic\x20%s',new Buffer(_0x182e69)[_0x9987('0x51')]('base64'))},'json':!![]};rp(_0x15a223)[_0x9987('0x19')](function(_0x364e6){if(_0x364e6['id']){var _0x539c10={'messageId':_0x364e6['id']};return _0x23c008[_0x9987('0x1a')](_0x539c10);}else{logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x6f'),util[_0x9987('0x2d')](_0x364e6,{'showHidden':![],'depth':null}));}})[_0x9987('0x1c')](function(_0x3993e1){logger[_0x9987('0x2a')](_0x9987('0x2b'),'afterCreate',_0x9987('0x6f'),util[_0x9987('0x2d')](_0x3993e1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9987('0x2c'),_0x9987('0x6f'),_0x9987('0x3d'));}break;case _0x9987('0x70'):if(_0x38df2b[_0x9987('0x6a')]){var _0x2b80b0={};var _0x3059ce={'method':_0x9987('0x36'),'uri':_0x9987('0x71'),'headers':{'Authorization':'Bearer\x20'+_0x38df2b['apiKey'],'Content-Type':_0x9987('0x58')},'body':{'from':_0x38df2b[_0x9987('0x25')],'to':_0x3bb4ed[_0x9987('0x25')],'text':_0x3bb4ed[_0x9987('0xe')]},'json':!![]};return rp(_0x3059ce)[_0x9987('0x19')](function(_0x32159a){if(_0x32159a['code']==0xca){_0x2b80b0[_0x9987('0x72')]=_0x32159a;var _0x44b3ef={'method':_0x9987('0x36'),'uri':_0x9987('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x38df2b[_0x9987('0x6a')],'Content-Type':'application/json'},'body':{'refid':_0x2b80b0[_0x9987('0x72')][_0x9987('0x74')]},'json':!![]};return rp(_0x44b3ef)[_0x9987('0x19')](function(_0x244d28){_0x2b80b0[_0x9987('0x75')]=_0x244d28;var _0x76f53={'messageId':_0x2b80b0['message'][_0x9987('0x74')],'read':!![]};return _0x23c008[_0x9987('0x1a')](_0x76f53);});}else{return logger[_0x9987('0x2a')](_0x9987('0x2b'),'afterCreate','intelepeer',util[_0x9987('0x2d')](_0x32159a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x43d5bc){return logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),'intelepeer',util['inspect'](_0x43d5bc,{'showHidden':![],'depth':null}));});}else{return logger[_0x9987('0x2a')](_0x9987('0x2b'),_0x9987('0x2c'),_0x9987('0x70'),_0x9987('0x76'));}break;}}})['finally'](function(){_0x45a08f();});}else{_0x45a08f();}}},'charset':_0x9987('0x77'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x710e=['https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','token','application/json','IBSSO\x20','csc','crypto','login','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','apiKey','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','finally','utf8mb4','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','models','get','direction','toLowerCase','out','secret','SmsInteraction','findOne','SmsInteractionId','then','update','catch','error','SmsAccount','find','SmsAccountId','type','authToken','phone','create','body','remote','/api/sms/messages/','/status?token=','sid','afterCreate','twilio','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','password','split','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString'];(function(_0x243694,_0x5619a3){var _0x16b6d5=function(_0x271100){while(--_0x271100){_0x243694['push'](_0x243694['shift']());}};_0x16b6d5(++_0x5619a3);}(_0x710e,0xb6));var _0xe710=function(_0x273419,_0x4c3fb5){_0x273419=_0x273419-0x0;var _0x32d493=_0x710e[_0x273419];return _0x32d493;};'use strict';var _=require(_0xe710('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe710('0x1'));var moment=require(_0xe710('0x2'));var BPromise=require(_0xe710('0x3'));var rp=require(_0xe710('0x4'));var fs=require('fs');var path=require(_0xe710('0x5'));var rimraf=require('rimraf');var config=require(_0xe710('0x6'));var attributes=require(_0xe710('0x7'));module['exports']=function(_0x5a9e4c,_0xd8271b){return _0x5a9e4c[_0xe710('0x8')](_0xe710('0x9'),attributes,{'tableName':_0xe710('0xa'),'paranoid':![],'indexes':[{'name':_0xe710('0xb'),'fields':[_0xe710('0xb')]},{'name':'fti_sms_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21aa4f,_0x1d1160,_0x3c11a4){var _0x3a8adf=_0x5a9e4c[_0xe710('0xc')];var _0xef820e=_0x21aa4f[_0xe710('0xd')]({'plain':!![]});if(_0xef820e[_0xe710('0xe')][_0xe710('0xf')]()==='in'||_0xef820e[_0xe710('0xe')][_0xe710('0xf')]()===_0xe710('0x10')&&!_0xef820e[_0xe710('0x11')]&&!_['isNil'](_0xef820e['UserId'])){_0x3a8adf[_0xe710('0x12')][_0xe710('0x13')]({'where':{'id':_0xef820e[_0xe710('0x14')]}})[_0xe710('0x15')](function(_0x422a84){if(_0x422a84){_0x422a84[_0xe710('0x16')]({'lastMsgAt':_0xef820e['createdAt'],'lastMsgDirection':_0xef820e[_0xe710('0xe')][_0xe710('0xf')]()});}})[_0xe710('0x17')](function(_0x145312){console[_0xe710('0x18')](_0x145312);});}if(_0xef820e[_0xe710('0xe')]===_0xe710('0x10')&&!_0xef820e[_0xe710('0x11')]){var _0x3daac1;_0x3a8adf[_0xe710('0x19')][_0xe710('0x1a')]({'where':{'id':_0xef820e[_0xe710('0x1b')]},'raw':!![]})[_0xe710('0x15')](function(_0x5f28a4){_0x3daac1=_0x5f28a4;if(_0x3daac1&&_0x3daac1[_0xe710('0x1c')]){switch(_0x3daac1['type']){case'twilio':var _0x5dbfa5=require('twilio');if(_0x3daac1['accountSid']&&_0x3daac1[_0xe710('0x1d')]&&_0x3daac1[_0xe710('0x1e')]){var _0x1c3d82=new _0x5dbfa5(_0x3daac1['accountSid'],_0x3daac1[_0xe710('0x1d')]);_0x1c3d82['messages'][_0xe710('0x1f')]({'body':_0xef820e[_0xe710('0x20')],'to':_0xef820e[_0xe710('0x1e')],'from':_0x3daac1[_0xe710('0x1e')],'statusCallback':_0x3daac1[_0xe710('0x21')]+_0xe710('0x22')+_0xef820e['id']+_0xe710('0x23')+_0x3daac1['token']})['then'](function(_0x2401ac){if(_0x2401ac[_0xe710('0x24')]){return _0x21aa4f['update']({'messageId':_0x2401ac[_0xe710('0x24')]});}})[_0xe710('0x17')](function(_0x34ab78){logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe710('0x25'),_0xe710('0x26'),util[_0xe710('0x27')](_0x34ab78,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x26'),_0xe710('0x29'));}break;case _0xe710('0x2a'):var _0x2541ce=_0xe710('0x2b');if(_0x3daac1[_0xe710('0x2c')]&&_0x3daac1['password']){var _0x20cf73={'recipient':[_0xef820e[_0xe710('0x1e')]],'message':_0xef820e[_0xe710('0x20')],'message_type':_0x3daac1[_0xe710('0x2d')]};if(_0x3daac1[_0xe710('0x2d')]&&_0x3daac1[_0xe710('0x2d')]!=='SI'){_0x20cf73[_0xe710('0x2e')]=_0x3daac1[_0xe710('0x1e')];}var _0x1a0989={'url':_0x2541ce+_0xe710('0x2f')+_0x3daac1[_0xe710('0x2c')]+_0xe710('0x30')+_0x3daac1[_0xe710('0x31')],'method':'GET'};rp(_0x1a0989)[_0xe710('0x15')](function(_0x5c816c){var _0x4e8aff=_0x5c816c[_0xe710('0x32')](';');var _0x1482f8={'user_key':_0x4e8aff[0x0],'session_key':_0x4e8aff[0x1]};_0x1a0989={'url':_0x2541ce+'sms','method':_0xe710('0x33'),'headers':{'user_key':_0x1482f8[_0xe710('0x34')],'Session_key':_0x1482f8[_0xe710('0x35')]},'json':!![],'body':_0x20cf73};return rp(_0x1a0989);})[_0xe710('0x15')](function(_0x167268){if(_0x167268[_0xe710('0x36')]>=0x1){var _0x148fe2={'messageId':_0x167268[_0xe710('0x37')]};if(_0x3daac1['smsMethod']!=='GP'||!_0x3daac1['deliveryReport']){_0x148fe2[_0xe710('0x38')]=!![];}return _0x21aa4f[_0xe710('0x16')](_0x148fe2);}else{return logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x2a'),util[_0xe710('0x27')](_0x167268,{'showHidden':![],'depth':null}));}})[_0xe710('0x17')](function(_0x5ce14d){return logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x2a'),util[_0xe710('0x27')](_0x5ce14d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x2a'),_0xe710('0x39'));}break;case _0xe710('0x3a'):if(_0x3daac1['authToken']){var _0x44af9f={'recipient':_0xef820e[_0xe710('0x1e')],'message':_0xef820e['body'],'sender':_0x3daac1[_0xe710('0x3b')]||_0x3daac1[_0xe710('0x1e')],'authorization':_0x3daac1[_0xe710('0x1d')]};var _0x1d1160={'method':_0xe710('0x33'),'uri':_0xe710('0x3c'),'body':_0x44af9f,'json':!![]};rp(_0x1d1160)[_0xe710('0x15')](function(_0x424b40){var _0x435202={'messageId':_0x424b40[_0xe710('0x3d')]};if(!_0x3daac1[_0xe710('0x3e')]){_0x435202[_0xe710('0x38')]=!![];}return _0x21aa4f[_0xe710('0x16')](_0x435202);})[_0xe710('0x17')](function(_0x446c90){logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x3a'),util[_0xe710('0x27')](_0x446c90,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe710('0x25'),_0xe710('0x3a'),_0xe710('0x3f'));}break;case _0xe710('0x40'):if(_0x3daac1[_0xe710('0x2c')]&&_0x3daac1[_0xe710('0x31')]){var _0x44af9f={'messages':[{'source':_0xe710('0x41'),'to':_0xef820e[_0xe710('0x1e')],'body':_0xef820e[_0xe710('0x20')],'from':_0x3daac1[_0xe710('0x3b')]||_0x3daac1['phone']}]};var _0x528a91=util['format'](_0xe710('0x42'),_0x3daac1[_0xe710('0x2c')],_0x3daac1['password']);var _0x1d1160={'method':'POST','uri':_0xe710('0x43'),'body':_0x44af9f,'headers':{'Authorization':util[_0xe710('0x44')](_0xe710('0x45'),new Buffer(_0x528a91)[_0xe710('0x46')]('base64'))},'json':!![]};rp(_0x1d1160)[_0xe710('0x15')](function(_0x1307ac){if(_0x1307ac[_0xe710('0x47')]>=0xc8&&_0x1307ac[_0xe710('0x47')]<=0xce){if(_0x1307ac[_0xe710('0x48')]&&_0x1307ac[_0xe710('0x48')][_0xe710('0x49')]>0x0){var _0x597f74=_[_0xe710('0x4a')](_0x1307ac[_0xe710('0x48')][_0xe710('0x4b')]);var _0x3d5de7={'messageId':_0x597f74[_0xe710('0x4c')]};if(!_0x3daac1[_0xe710('0x3e')]){_0x3d5de7[_0xe710('0x38')]=!![];}return _0x21aa4f['update'](_0x3d5de7);}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),'clickSend',util['inspect'](_0x1307ac,{'showHidden':![],'depth':null}));}}else{logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe710('0x4d'),util[_0xe710('0x27')](_0x1307ac,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5e4943){logger[_0xe710('0x18')](_0xe710('0x28'),'afterCreate',_0xe710('0x4d'),util[_0xe710('0x27')](_0x5e4943,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x4d'),_0xe710('0x39'));}break;case _0xe710('0x4e'):if(_0x3daac1[_0xe710('0x4f')]&&_0x3daac1[_0xe710('0x1d')]){var _0x44af9f={'dst':_0xef820e['phone'],'text':_0xef820e['body'],'src':_0x3daac1[_0xe710('0x3b')]||_0x3daac1[_0xe710('0x1e')],'url':_0x3daac1['remote']+_0xe710('0x22')+_0xef820e['id']+_0xe710('0x23')+_0x3daac1['token']};var _0x528a91=util[_0xe710('0x44')](_0xe710('0x42'),_0x3daac1['authId'],_0x3daac1[_0xe710('0x1d')]);var _0x1d1160={'method':_0xe710('0x33'),'uri':util['format'](_0xe710('0x50'),_0x3daac1[_0xe710('0x4f')]),'body':_0x44af9f,'headers':{'Authorization':util[_0xe710('0x44')](_0xe710('0x45'),new Buffer(_0x528a91)[_0xe710('0x46')](_0xe710('0x51')))},'json':!![]};rp(_0x1d1160)['then'](function(_0x2275b){var _0x441f67={'messageId':_0x2275b[_0xe710('0x52')][0x0]};return _0x21aa4f['update'](_0x441f67);})[_0xe710('0x17')](function(_0x60fc34){logger['error'](_0xe710('0x28'),'afterCreate',_0xe710('0x4e'),util[_0xe710('0x27')](_0x60fc34,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),'plivo',_0xe710('0x53'));}break;case _0xe710('0x54'):if(_0x3daac1['username']&&_0x3daac1[_0xe710('0x31')]){if(_0x3daac1[_0xe710('0x55')]){var _0x102bdd={'method':'POST','uri':_0x3daac1[_0xe710('0x55')]+'/auth/1/session','body':{'username':_0x3daac1[_0xe710('0x2c')],'password':_0x3daac1[_0xe710('0x31')]},'json':!![]};return rp(_0x102bdd)[_0xe710('0x15')](function(_0x4557b0){var _0x36750e={'method':_0xe710('0x33'),'uri':_0x3daac1[_0xe710('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3daac1[_0xe710('0x1e')],'destinations':[{'to':_0xef820e['phone']}],'text':_0xef820e[_0xe710('0x20')],'notifyUrl':_0x3daac1[_0xe710('0x21')]+_0xe710('0x22')+_0xef820e['id']+_0xe710('0x23')+_0x3daac1[_0xe710('0x56')],'notifyContentType':_0xe710('0x57'),'callbackData':_0x3daac1[_0xe710('0x1e')]+';'+_0xef820e[_0xe710('0x20')]}]},'headers':{'Authorization':_0xe710('0x58')+_0x4557b0[_0xe710('0x56')]},'json':!![]};return rp(_0x36750e)[_0xe710('0x15')](function(_0x802c48){if(_0x802c48['messages']){var _0x43e2b7={'messageId':_0x802c48[_0xe710('0x4b')][0x0]['messageId']};if(!_0x3daac1[_0xe710('0x3e')]){_0x43e2b7['read']=!![];}return _0x21aa4f[_0xe710('0x16')](_0x43e2b7);}else{return logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),'infobip',util['inspect'](_0x802c48,{'showHidden':![],'depth':null}));}});})[_0xe710('0x17')](function(_0x3df7bc){return logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe710('0x25'),'infobip',util[_0xe710('0x27')](_0x3df7bc,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe710('0x25'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xe710('0x18')](_0xe710('0x28'),'afterCreate',_0xe710('0x54'),_0xe710('0x39'));}break;case _0xe710('0x59'):var _0x5e4e23=require(_0xe710('0x5a'));if(_0x3daac1['apiKey']){var _0xcee43b={};_0xcee43b[_0xe710('0x5b')]=_0x3daac1[_0xe710('0x2c')];_0xcee43b[_0xe710('0x1e')]=_0xef820e[_0xe710('0x1e')];_0xcee43b[_0xe710('0x2e')]=_0x3daac1[_0xe710('0x1e')];_0xcee43b['text']=_0xef820e['body'];_0xcee43b[_0xe710('0x5c')]=+new Date();var _0x2dae6b='';var _0x2ac34d='';var _0x4d1b3a=Object[_0xe710('0x5d')](_0xcee43b);_0x4d1b3a[_0xe710('0x5e')]();for(var _0x27cd4e=0x0;_0x27cd4e<_0x4d1b3a[_0xe710('0x5f')];_0x27cd4e++){if(_0x2dae6b!=''){_0x2dae6b+='&';}_0x2dae6b+=_0x4d1b3a[_0x27cd4e]+'='+encodeURIComponent(_0xcee43b[_0x4d1b3a[_0x27cd4e]]);_0x2ac34d+=_0xcee43b[_0x4d1b3a[_0x27cd4e]];}_0x2ac34d+=_0x3daac1['apiKey'];_0x2ac34d=_0x5e4e23[_0xe710('0x60')](_0xe710('0x61'))[_0xe710('0x16')](_0x2ac34d)[_0xe710('0x62')](_0xe710('0x63'));if(_0x2dae6b!==''){_0x2dae6b+='&';}_0x2dae6b+=_0xe710('0x64')+_0x2ac34d;var _0x1a0989={'method':_0xe710('0x65'),'uri':_0x3daac1[_0xe710('0x55')]+_0xe710('0x66')+_0x2dae6b,'json':!![]};return rp(_0x1a0989)[_0xe710('0x15')](function(_0xb3aeb6){var _0x480e43=Object[_0xe710('0x5d')](_0xb3aeb6);if(_0xb3aeb6[_0x480e43[0x0]][_0xe710('0x18')]&&parseInt(_0xb3aeb6[_0x480e43[0x0]]['error'])===0x0){var _0x45a795={'messageId':_0xb3aeb6[_0x480e43[0x0]][_0xe710('0x67')]};if(!_0x3daac1['deliveryReport']){_0x45a795[_0xe710('0x38')]=!![];}return _0x21aa4f[_0xe710('0x16')](_0x45a795);}else{return logger['error'](_0xe710('0x28'),_0xe710('0x25'),'csc',util[_0xe710('0x27')](_0xb3aeb6[_0xe710('0x18')],{'showHidden':![],'depth':null}));}})[_0xe710('0x17')](function(_0x2710ee){return logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe710('0x59'),util[_0xe710('0x27')](_0x2710ee,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x59'),_0xe710('0x68'));}break;case'clickatell':if(_0x3daac1['apiKey']){var _0x1a73ad={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3daac1[_0xe710('0x69')]},'body':{'content':_0xef820e['body'],'to':[_0xef820e[_0xe710('0x1e')]],'from':_0x3daac1[_0xe710('0x1e')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x1a73ad)[_0xe710('0x15')](function(_0x4a3d85){if(!_0x4a3d85['error']){var _0x2d590f={'messageId':_0x4a3d85[_0xe710('0x4b')][0x0][_0xe710('0x6a')]};if(!_0x3daac1[_0xe710('0x3e')]){_0x2d590f[_0xe710('0x38')]=!![];}return _0x21aa4f[_0xe710('0x16')](_0x2d590f);}else{return logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x6b'),util[_0xe710('0x27')](_0x4a3d85[_0xe710('0x18')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x296bca){return logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe710('0x6b'),util['inspect'](_0x296bca,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x6b'),'Missing\x20parameters:\x20apiKey');}break;case _0xe710('0x6c'):if(_0x3daac1[_0xe710('0x2c')]&&_0x3daac1[_0xe710('0x31')]){var _0x528a91=util[_0xe710('0x44')](_0xe710('0x42'),_0x3daac1[_0xe710('0x2c')],_0x3daac1[_0xe710('0x31')]);var _0x1d1160={'method':_0xe710('0x33'),'uri':_0xe710('0x6d')+_0x3daac1[_0xe710('0x6e')]+_0xe710('0x6f'),'body':{'to':[_0xef820e['phone']],'text':_0xef820e['body'],'from':_0x3daac1[_0xe710('0x1e')],'applicationId':_0x3daac1['applicationId']},'headers':{'Authorization':util[_0xe710('0x44')](_0xe710('0x45'),new Buffer(_0x528a91)[_0xe710('0x46')](_0xe710('0x51')))},'json':!![]};rp(_0x1d1160)[_0xe710('0x15')](function(_0x301eca){if(_0x301eca['id']){var _0x3b373b={'messageId':_0x301eca['id']};return _0x21aa4f['update'](_0x3b373b);}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x6c'),util['inspect'](_0x301eca,{'showHidden':![],'depth':null}));}})[_0xe710('0x17')](function(_0x36a7a8){logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x6c'),util[_0xe710('0x27')](_0x36a7a8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe710('0x28'),'afterCreate',_0xe710('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe710('0x70'):if(_0x3daac1[_0xe710('0x69')]){var _0x375d66={};var _0x1a0989={'method':_0xe710('0x33'),'uri':_0xe710('0x71'),'headers':{'Authorization':'Bearer\x20'+_0x3daac1[_0xe710('0x69')],'Content-Type':_0xe710('0x57')},'body':{'from':_0x3daac1[_0xe710('0x1e')],'to':_0xef820e[_0xe710('0x1e')],'text':_0xef820e['body']},'json':!![]};return rp(_0x1a0989)[_0xe710('0x15')](function(_0x3d591d){if(_0x3d591d[_0xe710('0x72')]==0xca){_0x375d66[_0xe710('0x73')]=_0x3d591d;var _0x213da8={'method':'POST','uri':_0xe710('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x3daac1[_0xe710('0x69')],'Content-Type':'application/json'},'body':{'refid':_0x375d66[_0xe710('0x73')][_0xe710('0x75')]},'json':!![]};return rp(_0x213da8)[_0xe710('0x15')](function(_0x35bfa1){_0x375d66['status']=_0x35bfa1;var _0xbcc64c={'messageId':_0x375d66[_0xe710('0x73')]['refid'],'read':!![]};return _0x21aa4f[_0xe710('0x16')](_0xbcc64c);});}else{return logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x70'),util[_0xe710('0x27')](_0x3d591d,{'showHidden':![],'depth':null}));}})[_0xe710('0x17')](function(_0x117d9e){return logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x70'),util[_0xe710('0x27')](_0x117d9e,{'showHidden':![],'depth':null}));});}else{return logger[_0xe710('0x18')](_0xe710('0x28'),'afterCreate',_0xe710('0x70'),_0xe710('0x76'));}break;}}})[_0xe710('0x77')](function(){_0x3c11a4();});}else{_0x3c11a4();}}},'charset':_0xe710('0x78'),'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 2c6d96d..177b373 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 _0x962f=['defaults','localhost','request','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateSmsMessage','create','body','options','raw','then','debug','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4bbf6c,_0x622c5b){var _0x5085b9=function(_0x432a0b){while(--_0x432a0b){_0x4bbf6c['push'](_0x4bbf6c['shift']());}};_0x5085b9(++_0x622c5b);}(_0x962f,0x169));var _0xf962=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x962f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf962('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf962('0x1'));var rs=require(_0xf962('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf962('0x3'))['db'];var utils=require(_0xf962('0x4'));var logger=require(_0xf962('0x5'))('rpc');var config=require(_0xf962('0x6'));var jayson=require(_0xf962('0x7'));var client=jayson[_0xf962('0x8')][_0xf962('0x9')]({'port':0x232a});config[_0xf962('0xa')]=_[_0xf962('0xb')](config[_0xf962('0xa')],{'host':_0xf962('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf962('0xa')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3dc74f,_0x584fc3,_0x115cf8){return new BPromise(function(_0x2fdbd9,_0x2bff84){return client[_0xf962('0xd')](_0x3dc74f,_0x115cf8)['then'](function(_0x879859){logger[_0xf962('0xe')](_0xf962('0xf'),_0x584fc3,'request\x20sent');logger['debug'](_0xf962('0x10'),_0x584fc3,'request\x20sent',JSON['stringify'](_0x879859));if(_0x879859[_0xf962('0x11')]){if(_0x879859['error'][_0xf962('0x12')]===0x1f4){logger[_0xf962('0x11')](_0xf962('0xf'),_0x584fc3,_0x879859[_0xf962('0x11')]['message']);return _0x2bff84(_0x879859[_0xf962('0x11')][_0xf962('0x13')]);}logger['error'](_0xf962('0xf'),_0x584fc3,_0x879859[_0xf962('0x11')][_0xf962('0x13')]);return _0x2fdbd9(_0x879859['error'][_0xf962('0x13')]);}else{logger[_0xf962('0xe')](_0xf962('0xf'),_0x584fc3,_0xf962('0x14'));_0x2fdbd9(_0x879859[_0xf962('0x15')][_0xf962('0x13')]);}})[_0xf962('0x16')](function(_0x22a6ac){logger[_0xf962('0x11')](_0xf962('0xf'),_0x584fc3,_0x22a6ac);_0x2bff84(_0x22a6ac);});});}exports[_0xf962('0x17')]=function(_0x7abf8a){var _0x4ef8a4=this;return new Promise(function(_0x33505d,_0x1e95c0){return db['SmsMessage'][_0xf962('0x18')](_0x7abf8a[_0xf962('0x19')],{'raw':_0x7abf8a[_0xf962('0x1a')]?_0x7abf8a[_0xf962('0x1a')][_0xf962('0x1b')]===undefined?!![]:![]:!![]})[_0xf962('0x1c')](function(_0x2dff13){logger[_0xf962('0xe')](_0xf962('0x17'),_0x7abf8a);logger[_0xf962('0x1d')]('CreateSmsMessage',_0x7abf8a,JSON[_0xf962('0x1e')](_0x2dff13));_0x33505d(_0x2dff13);})[_0xf962('0x16')](function(_0x3b2701){logger[_0xf962('0x11')]('CreateSmsMessage',_0x3b2701['message'],_0x7abf8a);_0x1e95c0(_0x4ef8a4['error'](0x1f4,_0x3b2701[_0xf962('0x13')]));});});}; \ No newline at end of file +var _0xd4fd=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','body','options','raw','CreateSmsMessage','lodash','util'];(function(_0x5dec97,_0x1454c7){var _0x47992d=function(_0x204e5c){while(--_0x204e5c){_0x5dec97['push'](_0x5dec97['shift']());}};_0x47992d(++_0x1454c7);}(_0xd4fd,0x106));var _0xdd4f=function(_0x3446e1,_0x5d58b2){_0x3446e1=_0x3446e1-0x0;var _0x36c55c=_0xd4fd[_0x3446e1];return _0x36c55c;};'use strict';var _=require(_0xdd4f('0x0'));var util=require(_0xdd4f('0x1'));var moment=require(_0xdd4f('0x2'));var BPromise=require(_0xdd4f('0x3'));var rs=require(_0xdd4f('0x4'));var fs=require('fs');var Redis=require(_0xdd4f('0x5'));var db=require(_0xdd4f('0x6'))['db'];var utils=require(_0xdd4f('0x7'));var logger=require('../../config/logger')(_0xdd4f('0x8'));var config=require(_0xdd4f('0x9'));var jayson=require(_0xdd4f('0xa'));var client=jayson[_0xdd4f('0xb')][_0xdd4f('0xc')]({'port':0x232a});config[_0xdd4f('0xd')]=_[_0xdd4f('0xe')](config['redis'],{'host':_0xdd4f('0xf'),'port':0x18eb});var socket=require(_0xdd4f('0x10'))(new Redis(config[_0xdd4f('0xd')]));require('./smsMessage.socket')[_0xdd4f('0x11')](socket);function respondWithRpcPromise(_0x1b2fc1,_0x570694,_0xaa98f4){return new BPromise(function(_0xbce99a,_0x51cfaa){return client[_0xdd4f('0x12')](_0x1b2fc1,_0xaa98f4)[_0xdd4f('0x13')](function(_0x4660ca){logger[_0xdd4f('0x14')](_0xdd4f('0x15'),_0x570694,_0xdd4f('0x16'));logger[_0xdd4f('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x570694,_0xdd4f('0x16'),JSON[_0xdd4f('0x18')](_0x4660ca));if(_0x4660ca[_0xdd4f('0x19')]){if(_0x4660ca['error']['code']===0x1f4){logger[_0xdd4f('0x19')](_0xdd4f('0x15'),_0x570694,_0x4660ca[_0xdd4f('0x19')][_0xdd4f('0x1a')]);return _0x51cfaa(_0x4660ca[_0xdd4f('0x19')][_0xdd4f('0x1a')]);}logger[_0xdd4f('0x19')](_0xdd4f('0x15'),_0x570694,_0x4660ca['error']['message']);return _0xbce99a(_0x4660ca[_0xdd4f('0x19')]['message']);}else{logger[_0xdd4f('0x14')](_0xdd4f('0x15'),_0x570694,_0xdd4f('0x16'));_0xbce99a(_0x4660ca[_0xdd4f('0x1b')][_0xdd4f('0x1a')]);}})[_0xdd4f('0x1c')](function(_0x414936){logger[_0xdd4f('0x19')]('SmsMessage,\x20%s,\x20%s',_0x570694,_0x414936);_0x51cfaa(_0x414936);});});}exports['CreateSmsMessage']=function(_0x52ba6f){var _0x4bb2e2=this;return new Promise(function(_0x31399d,_0x20ac82){return db['SmsMessage']['create'](_0x52ba6f[_0xdd4f('0x1d')],{'raw':_0x52ba6f['options']?_0x52ba6f[_0xdd4f('0x1e')][_0xdd4f('0x1f')]===undefined?!![]:![]:!![]})[_0xdd4f('0x13')](function(_0x4cbf1b){logger['info'](_0xdd4f('0x20'),_0x52ba6f);logger[_0xdd4f('0x17')](_0xdd4f('0x20'),_0x52ba6f,JSON[_0xdd4f('0x18')](_0x4cbf1b));_0x31399d(_0x4cbf1b);})[_0xdd4f('0x1c')](function(_0xafdfbb){logger[_0xdd4f('0x19')](_0xdd4f('0x20'),_0xafdfbb[_0xdd4f('0x1a')],_0x52ba6f);_0x20ac82(_0x4bb2e2[_0xdd4f('0x19')](0x1f4,_0xafdfbb[_0xdd4f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d40d75d..482a4b5 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 _0x6292=['register','length','smsMessage:','save','remove','update','emit','removeListener'];(function(_0x15b3af,_0x299d9f){var _0x304ad8=function(_0x2a7880){while(--_0x2a7880){_0x15b3af['push'](_0x15b3af['shift']());}};_0x304ad8(++_0x299d9f);}(_0x6292,0x1db));var _0x2629=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x6292[_0x295314];return _0x584b0c;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x2629('0x0'),_0x2629('0x1'),_0x2629('0x2')];function createListener(_0x36b6ec,_0x426f70){return function(_0x3199a7){_0x426f70[_0x2629('0x3')](_0x36b6ec,_0x3199a7);};}function removeListener(_0x41b4ea,_0x5574cd){return function(){SmsMessageEvents[_0x2629('0x4')](_0x41b4ea,_0x5574cd);};}exports[_0x2629('0x5')]=function(_0x5ed778){for(var _0x4da04a=0x0,_0x838d73=events[_0x2629('0x6')];_0x4da04a<_0x838d73;_0x4da04a++){var _0x2063df=events[_0x4da04a];var _0x2caf30=createListener(_0x2629('0x7')+_0x2063df,_0x5ed778);SmsMessageEvents['on'](_0x2063df,_0x2caf30);}}; \ No newline at end of file +var _0x0d9a=['./smsMessage.events','save','update','emit','removeListener','register','smsMessage:'];(function(_0x54fda5,_0x1093c6){var _0x34c133=function(_0x4da6ac){while(--_0x4da6ac){_0x54fda5['push'](_0x54fda5['shift']());}};_0x34c133(++_0x1093c6);}(_0x0d9a,0x13b));var _0xa0d9=function(_0x4b0db2,_0x654f7d){_0x4b0db2=_0x4b0db2-0x0;var _0x1e87c1=_0x0d9a[_0x4b0db2];return _0x1e87c1;};'use strict';var SmsMessageEvents=require(_0xa0d9('0x0'));var events=[_0xa0d9('0x1'),'remove',_0xa0d9('0x2')];function createListener(_0x5d425d,_0x18047f){return function(_0x5ba23f){_0x18047f[_0xa0d9('0x3')](_0x5d425d,_0x5ba23f);};}function removeListener(_0x3222a2,_0x3b9d1d){return function(){SmsMessageEvents[_0xa0d9('0x4')](_0x3222a2,_0x3b9d1d);};}exports[_0xa0d9('0x5')]=function(_0xf19d3c){for(var _0x1955d6=0x0,_0xb7cce6=events['length'];_0x1955d6<_0xb7cce6;_0x1955d6++){var _0x912149=events[_0x1955d6];var _0xb76152=createListener(_0xa0d9('0x6')+_0x912149,_0xf19d3c);SmsMessageEvents['on'](_0x912149,_0xb76152);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 38b74e5..2c62f05 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 _0x6c8d=['getTeams','getAgents','post','create','addTeams','put','delete','destroy','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMembers','/:id/teams'];(function(_0x53d513,_0x5829f7){var _0x4edbfc=function(_0x484799){while(--_0x484799){_0x53d513['push'](_0x53d513['shift']());}};_0x4edbfc(++_0x5829f7);}(_0x6c8d,0x103));var _0xd6c8=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x6c8d[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0xd6c8('0x0'));var util=require(_0xd6c8('0x1'));var path=require(_0xd6c8('0x2'));var timeout=require(_0xd6c8('0x3'));var express=require(_0xd6c8('0x4'));var router=express[_0xd6c8('0x5')]();var fs_extra=require(_0xd6c8('0x6'));var auth=require(_0xd6c8('0x7'));var interaction=require(_0xd6c8('0x8'));var config=require(_0xd6c8('0x9'));var controller=require(_0xd6c8('0xa'));router['get']('/',auth[_0xd6c8('0xb')](),controller[_0xd6c8('0xc')]);router[_0xd6c8('0xd')](_0xd6c8('0xe'),auth[_0xd6c8('0xb')](),controller[_0xd6c8('0xf')]);router[_0xd6c8('0xd')](_0xd6c8('0x10'),auth[_0xd6c8('0xb')](),controller[_0xd6c8('0x11')]);router[_0xd6c8('0xd')]('/:id/members',auth['isAuthenticated'](),controller[_0xd6c8('0x12')]);router['get'](_0xd6c8('0x13'),auth['isAuthenticated'](),controller[_0xd6c8('0x14')]);router[_0xd6c8('0xd')]('/:id/users',auth[_0xd6c8('0xb')](),controller[_0xd6c8('0x15')]);router[_0xd6c8('0x16')]('/',auth[_0xd6c8('0xb')](),controller[_0xd6c8('0x17')]);router[_0xd6c8('0x16')](_0xd6c8('0x13'),auth[_0xd6c8('0xb')](),controller[_0xd6c8('0x18')]);router['post']('/:id/users',auth[_0xd6c8('0xb')](),controller['addAgents']);router[_0xd6c8('0x19')](_0xd6c8('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xd6c8('0x1a')](_0xd6c8('0x10'),auth[_0xd6c8('0xb')](),controller[_0xd6c8('0x1b')]);router[_0xd6c8('0x1a')](_0xd6c8('0x13'),auth[_0xd6c8('0xb')](),controller['removeTeams']);router['delete'](_0xd6c8('0x1c'),auth[_0xd6c8('0xb')](),controller[_0xd6c8('0x1d')]);module[_0xd6c8('0x1e')]=router; \ No newline at end of file +var _0x0df6=['show','/:id/members','/:id/teams','getAgents','post','create','addTeams','/:id/users','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x4108ee,_0xecfeee){var _0x12cb40=function(_0x3950a9){while(--_0x3950a9){_0x4108ee['push'](_0x4108ee['shift']());}};_0x12cb40(++_0xecfeee);}(_0x0df6,0x1cd));var _0x60df=function(_0x4f657c,_0x2c485a){_0x4f657c=_0x4f657c-0x0;var _0x21fcc=_0x0df6[_0x4f657c];return _0x21fcc;};'use strict';var multer=require(_0x60df('0x0'));var util=require(_0x60df('0x1'));var path=require('path');var timeout=require(_0x60df('0x2'));var express=require(_0x60df('0x3'));var router=express[_0x60df('0x4')]();var fs_extra=require(_0x60df('0x5'));var auth=require(_0x60df('0x6'));var interaction=require(_0x60df('0x7'));var config=require(_0x60df('0x8'));var controller=require(_0x60df('0x9'));router[_0x60df('0xa')]('/',auth[_0x60df('0xb')](),controller[_0x60df('0xc')]);router['get'](_0x60df('0xd'),auth[_0x60df('0xb')](),controller['describe']);router['get'](_0x60df('0xe'),auth[_0x60df('0xb')](),controller[_0x60df('0xf')]);router[_0x60df('0xa')](_0x60df('0x10'),auth[_0x60df('0xb')](),controller['getMembers']);router[_0x60df('0xa')](_0x60df('0x11'),auth[_0x60df('0xb')](),controller['getTeams']);router[_0x60df('0xa')]('/:id/users',auth[_0x60df('0xb')](),controller[_0x60df('0x12')]);router[_0x60df('0x13')]('/',auth['isAuthenticated'](),controller[_0x60df('0x14')]);router['post'](_0x60df('0x11'),auth['isAuthenticated'](),controller[_0x60df('0x15')]);router[_0x60df('0x13')](_0x60df('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x60df('0xb')](),controller[_0x60df('0x17')]);router[_0x60df('0x18')](_0x60df('0xe'),auth[_0x60df('0xb')](),controller['destroy']);router[_0x60df('0x18')](_0x60df('0x11'),auth['isAuthenticated'](),controller[_0x60df('0x19')]);router[_0x60df('0x18')]('/:id/users',auth[_0x60df('0xb')](),controller[_0x60df('0x1a')]);module[_0x60df('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 0c05902..508350e 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 _0x443b=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0xd5160a,_0x572c4b){var _0x576cf9=function(_0xa95da6){while(--_0xa95da6){_0xd5160a['push'](_0xd5160a['shift']());}};_0x576cf9(++_0x572c4b);}(_0x443b,0x162));var _0xb443=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x443b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xb443('0x0')]={'name':{'type':Sequelize[_0xb443('0x1')],'unique':_0xb443('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb443('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb443('0x3')](_0xb443('0x4'),_0xb443('0x5'),_0xb443('0x6'))}}; \ No newline at end of file +var _0xddd3=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x47903a,_0x540e6b){var _0xa98e35=function(_0x4f4eb6){while(--_0x4f4eb6){_0x47903a['push'](_0x47903a['shift']());}};_0xa98e35(++_0x540e6b);}(_0xddd3,0x9f));var _0x3ddd=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xddd3[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x3ddd('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ddd('0x1')],'unique':_0x3ddd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3ddd('0x1')]},'timeout':{'type':Sequelize[_0x3ddd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3ddd('0x4')](_0x3ddd('0x5'),_0x3ddd('0x6'),_0x3ddd('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 269261f..cf29f8a 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 _0xbe4a=['hasOwnProperty','SmsQueueId','filter','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','online','voicePause','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','ids','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','SmsQueues','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','map','VIRTUAL','options','include','SmsQueue','findAll','rows','catch','params','includeAll','create','body','user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserSmsQueue'];(function(_0x1544fd,_0xb2c82d){var _0x36c2be=function(_0x24b204){while(--_0x24b204){_0x1544fd['push'](_0x1544fd['shift']());}};_0x36c2be(++_0xb2c82d);}(_0xbe4a,0x1d8));var _0xabe4=function(_0x4fd75e,_0x219e4a){_0x4fd75e=_0x4fd75e-0x0;var _0x5b6338=_0xbe4a[_0x4fd75e];return _0x5b6338;};'use strict';var emlformat=require(_0xabe4('0x0'));var rimraf=require(_0xabe4('0x1'));var zipdir=require(_0xabe4('0x2'));var jsonpatch=require(_0xabe4('0x3'));var rp=require('request-promise');var moment=require(_0xabe4('0x4'));var BPromise=require(_0xabe4('0x5'));var Mustache=require(_0xabe4('0x6'));var util=require(_0xabe4('0x7'));var path=require('path');var sox=require(_0xabe4('0x8'));var csv=require(_0xabe4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabe4('0xa'));var squel=require(_0xabe4('0xb'));var crypto=require(_0xabe4('0xc'));var jsforce=require(_0xabe4('0xd'));var deskjs=require(_0xabe4('0xe'));var toCsv=require(_0xabe4('0x9'));var querystring=require(_0xabe4('0xf'));var Papa=require(_0xabe4('0x10'));var Redis=require(_0xabe4('0x11'));var authService=require(_0xabe4('0x12'));var qs=require(_0xabe4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabe4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xabe4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xabe4('0x16'));var db=require('../../mysqldb')['db'];config[_0xabe4('0x17')]=_[_0xabe4('0x18')](config[_0xabe4('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabe4('0x17')]));require(_0xabe4('0x19'))[_0xabe4('0x1a')](socket);function respondWithStatusCode(_0x586ff0,_0x588597){_0x588597=_0x588597||0xcc;return function(_0x14996b){if(_0x14996b){return _0x586ff0[_0xabe4('0x1b')](_0x588597);}return _0x586ff0['status'](_0x588597)['end']();};}function respondWithResult(_0x253462,_0x4be43c){_0x4be43c=_0x4be43c||0xc8;return function(_0x4e7a6e){if(_0x4e7a6e){return _0x253462[_0xabe4('0x1c')](_0x4be43c)[_0xabe4('0x1d')](_0x4e7a6e);}};}function respondWithFilteredResult(_0x5de997,_0xf88ff7){return function(_0x2bbb8c){if(_0x2bbb8c){var _0x23813b=typeof _0xf88ff7[_0xabe4('0x1e')]===_0xabe4('0x1f')&&typeof _0xf88ff7[_0xabe4('0x20')]===_0xabe4('0x1f');var _0x4ade37=_0x2bbb8c[_0xabe4('0x21')];var _0x253e47=_0x23813b?0x0:_0xf88ff7[_0xabe4('0x1e')];var _0x2d3fcb=_0x23813b?_0x2bbb8c['count']:_0xf88ff7['offset']+_0xf88ff7[_0xabe4('0x20')];var _0x402516;if(_0x2d3fcb>=_0x4ade37){_0x2d3fcb=_0x4ade37;_0x402516=0xc8;}else{_0x402516=0xce;}_0x5de997[_0xabe4('0x1c')](_0x402516);return _0x5de997['set'](_0xabe4('0x22'),_0x253e47+'-'+_0x2d3fcb+'/'+_0x4ade37)[_0xabe4('0x1d')](_0x2bbb8c);}return null;};}function patchUpdates(_0x4d927c){return function(_0x1747f0){try{jsonpatch[_0xabe4('0x23')](_0x1747f0,_0x4d927c,!![]);}catch(_0x358e64){return BPromise[_0xabe4('0x24')](_0x358e64);}return _0x1747f0[_0xabe4('0x25')]();};}function saveUpdates(_0xed276a,_0x9f3ff5){return function(_0x468eec){if(_0x468eec){return _0x468eec['update'](_0xed276a)[_0xabe4('0x26')](function(_0x346ae3){return _0x346ae3;});}return null;};}function removeEntity(_0x328b25,_0xec73c3){return function(_0x280acb){if(_0x280acb){return _0x280acb['destroy']()[_0xabe4('0x26')](function(){var _0x530035=_0x280acb[_0xabe4('0x27')]({'plain':!![]});var _0x2e2eb8=_0xabe4('0x28');return db['UserProfileResource'][_0xabe4('0x29')]({'where':{'type':_0x2e2eb8,'resourceId':_0x530035['id']}})[_0xabe4('0x26')](function(){return _0x280acb;});})[_0xabe4('0x26')](function(){_0x328b25['status'](0xcc)[_0xabe4('0x2a')]();});}};}function handleEntityNotFound(_0x5e41c7,_0x4f3d65){return function(_0x243990){if(!_0x243990){_0x5e41c7['sendStatus'](0x194);}return _0x243990;};}function handleError(_0x3e7df4,_0x5b040f){_0x5b040f=_0x5b040f||0x1f4;return function(_0x340036){logger[_0xabe4('0x2b')](_0x340036[_0xabe4('0x2c')]);if(_0x340036[_0xabe4('0x2d')]){delete _0x340036[_0xabe4('0x2d')];}_0x3e7df4[_0xabe4('0x1c')](_0x5b040f)[_0xabe4('0x2e')](_0x340036);};}exports[_0xabe4('0x2f')]=function(_0x73c5cc,_0x1a99ec){var _0x872f60={},_0x15b820={},_0xdd0625={'count':0x0,'rows':[]};var _0x24a68d=_['map'](db['SmsQueue'][_0xabe4('0x30')],function(_0x4e39fe){return{'name':_0x4e39fe[_0xabe4('0x31')],'type':_0x4e39fe[_0xabe4('0x32')][_0xabe4('0x33')]};});_0x15b820[_0xabe4('0x34')]=_['map'](_0x24a68d,'name');_0x15b820[_0xabe4('0x35')]=_[_0xabe4('0x36')](_0x73c5cc[_0xabe4('0x35')]);_0x15b820[_0xabe4('0x37')]=_[_0xabe4('0x38')](_0x15b820[_0xabe4('0x34')],_0x15b820[_0xabe4('0x35')]);_0x872f60[_0xabe4('0x39')]=_['intersection'](_0x15b820[_0xabe4('0x34')],qs[_0xabe4('0x3a')](_0x73c5cc[_0xabe4('0x35')]['fields']));_0x872f60['attributes']=_0x872f60['attributes'][_0xabe4('0x3b')]?_0x872f60[_0xabe4('0x39')]:_0x15b820[_0xabe4('0x34')];if(!_0x73c5cc[_0xabe4('0x35')]['hasOwnProperty'](_0xabe4('0x3c'))){_0x872f60[_0xabe4('0x20')]=qs[_0xabe4('0x20')](_0x73c5cc['query'][_0xabe4('0x20')]);_0x872f60[_0xabe4('0x1e')]=qs[_0xabe4('0x1e')](_0x73c5cc['query'][_0xabe4('0x1e')]);}_0x872f60[_0xabe4('0x3d')]=qs[_0xabe4('0x3e')](_0x73c5cc[_0xabe4('0x35')][_0xabe4('0x3e')]);_0x872f60['where']=qs[_0xabe4('0x37')](_[_0xabe4('0x3f')](_0x73c5cc[_0xabe4('0x35')],_0x15b820[_0xabe4('0x37')]),_0x24a68d);if(_0x73c5cc['query']['filter']){_0x872f60['where']=_[_0xabe4('0x40')](_0x872f60[_0xabe4('0x41')],{'$or':_[_0xabe4('0x42')](_0x24a68d,function(_0x189439){if(_0x189439[_0xabe4('0x32')]!==_0xabe4('0x43')){var _0x2a8e6b={};_0x2a8e6b[_0x189439[_0xabe4('0x2d')]]={'$like':'%'+_0x73c5cc[_0xabe4('0x35')]['filter']+'%'};return _0x2a8e6b;}})});}_0x872f60=_['merge']({},_0x872f60,_0x73c5cc[_0xabe4('0x44')]);var _0x2ac96b={'where':_0x872f60[_0xabe4('0x41')]};return db['SmsQueue']['count'](_0x2ac96b)[_0xabe4('0x26')](function(_0x3ccf3){_0xdd0625[_0xabe4('0x21')]=_0x3ccf3;if(_0x73c5cc[_0xabe4('0x35')]['includeAll']){_0x872f60[_0xabe4('0x45')]=[{'all':!![]}];}return db[_0xabe4('0x46')][_0xabe4('0x47')](_0x872f60);})[_0xabe4('0x26')](function(_0x3bc203){_0xdd0625[_0xabe4('0x48')]=_0x3bc203;return _0xdd0625;})[_0xabe4('0x26')](respondWithFilteredResult(_0x1a99ec,_0x872f60))[_0xabe4('0x49')](handleError(_0x1a99ec,null));};exports['show']=function(_0xe01f71,_0x48ff6d){var _0x4c7b15={'raw':!![],'where':{'id':_0xe01f71[_0xabe4('0x4a')]['id']}},_0x16dd48={};_0x16dd48[_0xabe4('0x34')]=_['keys'](db[_0xabe4('0x46')][_0xabe4('0x30')]);_0x16dd48['query']=_[_0xabe4('0x36')](_0xe01f71[_0xabe4('0x35')]);_0x16dd48[_0xabe4('0x37')]=_[_0xabe4('0x38')](_0x16dd48[_0xabe4('0x34')],_0x16dd48['query']);_0x4c7b15[_0xabe4('0x39')]=_[_0xabe4('0x38')](_0x16dd48[_0xabe4('0x34')],qs[_0xabe4('0x3a')](_0xe01f71[_0xabe4('0x35')]['fields']));_0x4c7b15[_0xabe4('0x39')]=_0x4c7b15['attributes'][_0xabe4('0x3b')]?_0x4c7b15['attributes']:_0x16dd48[_0xabe4('0x34')];if(_0xe01f71[_0xabe4('0x35')][_0xabe4('0x4b')]){_0x4c7b15[_0xabe4('0x45')]=[{'all':!![]}];}_0x4c7b15=_[_0xabe4('0x40')]({},_0x4c7b15,_0xe01f71[_0xabe4('0x44')]);return db[_0xabe4('0x46')]['find'](_0x4c7b15)[_0xabe4('0x26')](handleEntityNotFound(_0x48ff6d,null))[_0xabe4('0x26')](respondWithResult(_0x48ff6d,null))[_0xabe4('0x49')](handleError(_0x48ff6d,null));};exports[_0xabe4('0x4c')]=function(_0x14a7a4,_0x3fa5bc){return db['SmsQueue'][_0xabe4('0x4c')](_0x14a7a4[_0xabe4('0x4d')],{})[_0xabe4('0x26')](function(_0xc41f5a){var _0x146cd5=_0x14a7a4[_0xabe4('0x4e')][_0xabe4('0x27')]({'plain':!![]});if(!_0x146cd5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x146cd5[_0xabe4('0x4f')]===_0xabe4('0x4e')){var _0x2b8162=_0xc41f5a[_0xabe4('0x27')]({'plain':!![]});var _0x209528=_0xabe4('0x28');return db[_0xabe4('0x50')]['find']({'where':{'name':_0x209528,'userProfileId':_0x146cd5['userProfileId']},'raw':!![]})[_0xabe4('0x26')](function(_0x5e38c4){if(_0x5e38c4&&_0x5e38c4['autoAssociation']===0x0){return db[_0xabe4('0x51')]['create']({'name':_0x2b8162[_0xabe4('0x2d')],'resourceId':_0x2b8162['id'],'type':_0x5e38c4[_0xabe4('0x2d')],'sectionId':_0x5e38c4['id']},{})[_0xabe4('0x26')](function(){return _0xc41f5a;});}else{return _0xc41f5a;}})['catch'](function(_0x1c48ad){logger['error'](_0xabe4('0x52'),_0x1c48ad);throw _0x1c48ad;});}return _0xc41f5a;})[_0xabe4('0x26')](respondWithResult(_0x3fa5bc,0xc9))[_0xabe4('0x49')](handleError(_0x3fa5bc,null));};exports['update']=function(_0x8ebf25,_0x5366aa){if(_0x8ebf25[_0xabe4('0x4d')]['id']){delete _0x8ebf25[_0xabe4('0x4d')]['id'];}return db[_0xabe4('0x46')][_0xabe4('0x53')]({'where':{'id':_0x8ebf25[_0xabe4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5366aa,null))[_0xabe4('0x26')](saveUpdates(_0x8ebf25[_0xabe4('0x4d')],null))['then'](respondWithResult(_0x5366aa,null))[_0xabe4('0x49')](handleError(_0x5366aa,null));};exports[_0xabe4('0x29')]=function(_0x2b0280,_0x2444ee){return db[_0xabe4('0x46')][_0xabe4('0x53')]({'where':{'id':_0x2b0280[_0xabe4('0x4a')]['id']}})[_0xabe4('0x26')](handleEntityNotFound(_0x2444ee,null))[_0xabe4('0x26')](removeEntity(_0x2444ee,null))[_0xabe4('0x49')](handleError(_0x2444ee,null));};exports[_0xabe4('0x54')]=function(_0x49fcb0,_0x2e69d5){return db[_0xabe4('0x46')][_0xabe4('0x54')]()[_0xabe4('0x26')](respondWithResult(_0x2e69d5,null))[_0xabe4('0x49')](handleError(_0x2e69d5,null));};exports[_0xabe4('0x55')]=function(_0x28b861,_0x2d5dd9,_0x220d86){var _0x53f61f={'raw':!![],'where':{}},_0x12dabe={},_0x533efe;return db[_0xabe4('0x46')][_0xabe4('0x56')]({'where':{'id':_0x28b861[_0xabe4('0x4a')]['id']}})[_0xabe4('0x26')](handleEntityNotFound(_0x2d5dd9,null))[_0xabe4('0x26')](function(_0x1be826){if(_0x1be826){_0x533efe=_0x1be826[_0xabe4('0x27')]({'plain':!![]});_0x12dabe[_0xabe4('0x34')]=_[_0xabe4('0x36')](db[_0xabe4('0x57')][_0xabe4('0x30')]);_0x12dabe['query']=_[_0xabe4('0x36')](_0x28b861[_0xabe4('0x35')]);_0x12dabe[_0xabe4('0x37')]=_[_0xabe4('0x38')](_0x12dabe['model'],_0x12dabe[_0xabe4('0x35')]);_0x53f61f[_0xabe4('0x39')]=_[_0xabe4('0x38')](_0x12dabe['model'],qs[_0xabe4('0x3a')](_0x28b861[_0xabe4('0x35')][_0xabe4('0x3a')]));_0x53f61f[_0xabe4('0x39')]=_0x53f61f[_0xabe4('0x39')][_0xabe4('0x3b')]?_0x53f61f[_0xabe4('0x39')]:_0x12dabe['model'];if(!_0x28b861[_0xabe4('0x35')][_0xabe4('0x58')](_0xabe4('0x3c'))){_0x53f61f[_0xabe4('0x20')]=qs[_0xabe4('0x20')](_0x28b861['query'][_0xabe4('0x20')]);_0x53f61f[_0xabe4('0x1e')]=qs[_0xabe4('0x1e')](_0x28b861[_0xabe4('0x35')][_0xabe4('0x1e')]);}_0x53f61f[_0xabe4('0x3d')]=qs[_0xabe4('0x3e')](_0x28b861[_0xabe4('0x35')][_0xabe4('0x3e')]);_0x53f61f[_0xabe4('0x41')]=qs[_0xabe4('0x37')](_['pick'](_0x28b861['query'],_0x12dabe[_0xabe4('0x37')]));_0x53f61f['where'][_0xabe4('0x59')]=_0x1be826['id'];if(_0x28b861['query'][_0xabe4('0x5a')]){_0x53f61f[_0xabe4('0x41')]=_['merge'](_0x53f61f[_0xabe4('0x41')],{'$or':_[_0xabe4('0x42')](_0x53f61f[_0xabe4('0x39')],function(_0x119071){var _0x4aeb80={};_0x4aeb80[_0x119071]={'$like':'%'+_0x28b861[_0xabe4('0x35')][_0xabe4('0x5a')]+'%'};return _0x4aeb80;})});}_0x53f61f=_['merge']({},_0x53f61f,_0x28b861[_0xabe4('0x44')]);return db['UserSmsQueue'][_0xabe4('0x47')](_0x53f61f);}})[_0xabe4('0x26')](function(_0x3c69e7){if(_0x3c69e7){return db[_0xabe4('0x5b')][_0xabe4('0x5c')]({'where':{'id':_['map'](_0x3c69e7,_0xabe4('0x5d')),'role':_0xabe4('0x5e')},'attributes':['id',_0xabe4('0x2d'),_0xabe4('0x5f'),_0xabe4('0x60'),_0xabe4('0x61')]});}})[_0xabe4('0x26')](function(_0x116397){if(_0x116397){return{'count':_0x116397[_0xabe4('0x21')],'rows':_[_0xabe4('0x42')](_0x116397[_0xabe4('0x48')],function(_0x3a155b){return{'membername':_0x3a155b[_0xabe4('0x2d')],'UserId':_0x3a155b['id'],'queue_name':_0x533efe[_0xabe4('0x2d')],'SmsQueueId':_0x533efe['id'],'interface':util[_0xabe4('0x62')](_0xabe4('0x63'),'SIP',_0x3a155b[_0xabe4('0x2d')]),'penalty':0x0,'paused':_0x3a155b['smsPause'],'createdAt':_0x3a155b[_0xabe4('0x61')],'updatedAt':_0x3a155b[_0xabe4('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xabe4('0x26')](respondWithFilteredResult(_0x2d5dd9,_0x53f61f))['catch'](handleError(_0x2d5dd9,null));};exports[_0xabe4('0x64')]=function(_0xcd4bd,_0x476dad,_0x54aa6f){var _0x39da2d={};var _0x176594={};var _0x415ea9;var _0x289e77;return db[_0xabe4('0x46')][_0xabe4('0x56')]({'where':{'id':_0xcd4bd[_0xabe4('0x4a')]['id']}})[_0xabe4('0x26')](handleEntityNotFound(_0x476dad,null))[_0xabe4('0x26')](function(_0x2e06b6){if(_0x2e06b6){_0x415ea9=_0x2e06b6;_0x176594[_0xabe4('0x34')]=_[_0xabe4('0x36')](db[_0xabe4('0x65')][_0xabe4('0x30')]);_0x176594['query']=_[_0xabe4('0x36')](_0xcd4bd[_0xabe4('0x35')]);_0x176594[_0xabe4('0x37')]=_[_0xabe4('0x38')](_0x176594[_0xabe4('0x34')],_0x176594[_0xabe4('0x35')]);_0x39da2d[_0xabe4('0x39')]=_[_0xabe4('0x38')](_0x176594[_0xabe4('0x34')],qs['fields'](_0xcd4bd[_0xabe4('0x35')]['fields']));_0x39da2d['attributes']=_0x39da2d[_0xabe4('0x39')]['length']?_0x39da2d[_0xabe4('0x39')]:_0x176594[_0xabe4('0x34')];_0x39da2d[_0xabe4('0x3d')]=qs['sort'](_0xcd4bd[_0xabe4('0x35')]['sort']);_0x39da2d['where']=qs[_0xabe4('0x37')](_['pick'](_0xcd4bd[_0xabe4('0x35')],_0x176594[_0xabe4('0x37')]));if(_0xcd4bd[_0xabe4('0x35')][_0xabe4('0x5a')]){_0x39da2d[_0xabe4('0x41')]=_[_0xabe4('0x40')](_0x39da2d['where'],{'$or':_[_0xabe4('0x42')](_0x39da2d[_0xabe4('0x39')],function(_0x3b173e){var _0xb91afe={};_0xb91afe[_0x3b173e]={'$like':'%'+_0xcd4bd['query'][_0xabe4('0x5a')]+'%'};return _0xb91afe;})});}_0x39da2d=_[_0xabe4('0x40')]({},_0x39da2d,_0xcd4bd[_0xabe4('0x44')]);return _0x415ea9[_0xabe4('0x64')](_0x39da2d);}})[_0xabe4('0x26')](function(_0x35483a){if(_0x35483a){_0x289e77=_0x35483a[_0xabe4('0x3b')];if(!_0xcd4bd[_0xabe4('0x35')][_0xabe4('0x58')](_0xabe4('0x3c'))){_0x39da2d[_0xabe4('0x20')]=qs[_0xabe4('0x20')](_0xcd4bd[_0xabe4('0x35')]['limit']);_0x39da2d[_0xabe4('0x1e')]=qs[_0xabe4('0x1e')](_0xcd4bd['query']['offset']);}return _0x415ea9['getTeams'](_0x39da2d);}})[_0xabe4('0x26')](function(_0x1436a4){if(_0x1436a4){return _0x1436a4?{'count':_0x289e77,'rows':_0x1436a4}:null;}})[_0xabe4('0x26')](respondWithResult(_0x476dad,null))['catch'](handleError(_0x476dad,null));};exports[_0xabe4('0x66')]=function(_0x33d40f,_0x2e308d,_0x1a33b2){var _0x341082=_0x33d40f['body']['ids'];return db[_0xabe4('0x65')][_0xabe4('0x47')]({'where':{'id':_0x341082},'attributes':['id'],'include':[{'model':db[_0xabe4('0x5b')],'as':'Agents','attributes':['id',_0xabe4('0x2d'),_0xabe4('0x67'),_0xabe4('0x68'),'interface'],'raw':!![]}]})[_0xabe4('0x26')](function(_0x542c41){if(_0x542c41){var _0x5b5473=_[_0xabe4('0x69')](_0x542c41,function(_0x59ec4f){var _0x55cc3d=_0x59ec4f[_0xabe4('0x27')]({'plain':!![]});return _0x55cc3d[_0xabe4('0x6a')];});return db['SmsQueue'][_0xabe4('0x53')]({'where':{'id':_0x33d40f[_0xabe4('0x4a')]['id']}})['then'](function(_0x39060d){return db[_0xabe4('0x6b')][_0xabe4('0x6c')](function(_0x529bd1){return _0x39060d[_0xabe4('0x66')](_0x341082,{'transaction':_0x529bd1})[_0xabe4('0x26')](function(){return BPromise['each'](_0x5b5473,function(_0x2e085c){return db[_0xabe4('0x57')][_0xabe4('0x6d')]({'where':{'UserId':_0x2e085c['id'],'SmsQueueId':_0x33d40f[_0xabe4('0x4a')]['id']},'transaction':_0x529bd1});});})[_0xabe4('0x26')](function(){_0x5b5473[_0xabe4('0x6e')](function(_0x294fa5){socket[_0xabe4('0x6f')](_0xabe4('0x70'),{'UserId':_0x294fa5['id'],'SmsQueueId':_0x39060d['id']});});});});});}})[_0xabe4('0x26')](respondWithStatusCode(_0x2e308d,null))[_0xabe4('0x49')](handleError(_0x2e308d,null));};exports[_0xabe4('0x71')]=function(_0x3e3ecf,_0x4fa595,_0x5c793){return db[_0xabe4('0x65')][_0xabe4('0x47')]({'where':{'id':_0x3e3ecf['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xabe4('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xabe4('0x26')](handleEntityNotFound(_0x4fa595,null))[_0xabe4('0x26')](function(_0x3b2f74){var _0x1ce130=_[_0xabe4('0x42')](_0x3b2f74,'id');var _0xdac8bf=[];var _0x15f2aa=[];var _0x42510d=squel['select']();_0x42510d[_0xabe4('0x72')](_0xabe4('0x73'))[_0xabe4('0x74')](_0xabe4('0x75'),'tq')[_0xabe4('0x76')](_0xabe4('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xabe4('0x41')]('SmsQueueId\x20=\x20?',_0x3e3ecf[_0xabe4('0x4a')]['id']);for(var _0x5637d8=0x0;_0x5637d8<_0x3b2f74[_0xabe4('0x3b')];_0x5637d8+=0x1){let _0xc0900b=_0x3b2f74[_0x5637d8];for(var _0x279bd4=0x0;_0x279bd4<_0xc0900b[_0xabe4('0x6a')][_0xabe4('0x3b')];_0x279bd4+=0x1){let _0x52b9d1=_0xc0900b[_0xabe4('0x6a')][_0x279bd4];var _0x371af4=_0x42510d[_0xabe4('0x78')]();_0x371af4[_0xabe4('0x41')](_0xabe4('0x79'),_0x52b9d1['id']);_0x15f2aa[_0xabe4('0x7a')](db[_0xabe4('0x6b')][_0xabe4('0x35')](_0x371af4[_0xabe4('0x7b')](),{'type':db[_0xabe4('0x6b')]['QueryTypes'][_0xabe4('0x7c')]})[_0xabe4('0x26')](function(_0x16a5ad){if(_0x16a5ad[_0xabe4('0x3b')]===0x1){return _0x52b9d1['id'];}else{var _0x79407f=_['every'](_[_0xabe4('0x42')](_0x16a5ad,_0xabe4('0x7d')),function(_0x389714){return _[_0xabe4('0x7e')](_0x1ce130,_0x389714);});if(_0x79407f){return _0x52b9d1['id'];}}}));}}return BPromise[_0xabe4('0x7f')](_0x15f2aa)[_0xabe4('0x26')](function(_0x3c8dcc){_0xdac8bf=_(_0xdac8bf)[_0xabe4('0x80')](_0x3c8dcc)[_0xabe4('0x81')]()[_0xabe4('0x82')]();return db[_0xabe4('0x46')][_0xabe4('0x53')]({'where':{'id':_0x3e3ecf[_0xabe4('0x4a')]['id']}})['then'](function(_0x2f9f91){return db[_0xabe4('0x6b')][_0xabe4('0x6c')](function(_0x53139e){return _0x2f9f91['removeTeams'](_0x3e3ecf[_0xabe4('0x35')][_0xabe4('0x83')],{'transaction':_0x53139e})[_0xabe4('0x26')](function(){if(!_[_0xabe4('0x84')](_0xdac8bf)){return _0x2f9f91[_0xabe4('0x85')](_0xdac8bf,{'transaction':_0x53139e});}})[_0xabe4('0x26')](function(){_0xdac8bf[_0xabe4('0x6e')](function(_0x47716b){socket[_0xabe4('0x6f')](_0xabe4('0x86'),{'UserId':_0x47716b,'SmsQueueId':_0x2f9f91['id']});});});});});});})[_0xabe4('0x26')](respondWithStatusCode(_0x4fa595,null))[_0xabe4('0x49')](handleError(_0x4fa595,null));};exports[_0xabe4('0x87')]=function(_0x46bfe8,_0x52f9ab,_0x3097f4){return db[_0xabe4('0x46')][_0xabe4('0x53')]({'where':{'id':_0x46bfe8[_0xabe4('0x4a')]['id']}})[_0xabe4('0x26')](handleEntityNotFound(_0x52f9ab,null))['then'](function(_0x69745e){if(_0x69745e){return _0x69745e['addAgents'](_0x46bfe8['body'][_0xabe4('0x83')],_[_0xabe4('0x88')](_0x46bfe8[_0xabe4('0x4d')],['ids','id'])||{})[_0xabe4('0x89')](function(_0x665c46){for(var _0xcbf876=0x0;_0xcbf876<_0x46bfe8[_0xabe4('0x4d')]['ids']['length'];_0xcbf876+=0x1){socket[_0xabe4('0x6f')](_0xabe4('0x70'),{'UserId':Number(_0x46bfe8[_0xabe4('0x4d')]['ids'][_0xcbf876]),'SmsQueueId':Number(_0x46bfe8[_0xabe4('0x4a')]['id'])});}return _0x665c46;});}})[_0xabe4('0x26')](respondWithResult(_0x52f9ab,null))['catch'](handleError(_0x52f9ab,null));};exports[_0xabe4('0x85')]=function(_0x206fcb,_0x51d81f,_0x25ad79){return db[_0xabe4('0x46')][_0xabe4('0x53')]({'where':{'id':_0x206fcb[_0xabe4('0x4a')]['id']}})[_0xabe4('0x26')](handleEntityNotFound(_0x51d81f,null))[_0xabe4('0x26')](function(_0x1f4c2a){if(_0x1f4c2a){return _0x1f4c2a[_0xabe4('0x85')](_0x206fcb['query'][_0xabe4('0x83')])[_0xabe4('0x26')](function(){if(_[_0xabe4('0x8a')](_0x206fcb[_0xabe4('0x35')][_0xabe4('0x83')])){for(var _0x57d2db=0x0;_0x57d2db<_0x206fcb[_0xabe4('0x35')]['ids'][_0xabe4('0x3b')];_0x57d2db+=0x1){socket[_0xabe4('0x6f')](_0xabe4('0x86'),{'UserId':Number(_0x206fcb[_0xabe4('0x35')][_0xabe4('0x83')][_0x57d2db]),'SmsQueueId':Number(_0x206fcb[_0xabe4('0x4a')]['id'])});}}else{socket[_0xabe4('0x6f')](_0xabe4('0x86'),{'UserId':Number(_0x206fcb[_0xabe4('0x35')]['ids']),'SmsQueueId':Number(_0x206fcb[_0xabe4('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x51d81f,null))[_0xabe4('0x49')](handleError(_0x51d81f,null));};exports[_0xabe4('0x8b')]=function(_0x43182c,_0x940191,_0x295b8b){var _0x5bd595={};var _0xf33c89={};var _0x5149ad;var _0x46e4b4;return db[_0xabe4('0x46')]['findOne']({'where':{'id':_0x43182c[_0xabe4('0x4a')]['id']}})[_0xabe4('0x26')](handleEntityNotFound(_0x940191,null))[_0xabe4('0x26')](function(_0x1a195a){if(_0x1a195a){_0x5149ad=_0x1a195a;_0xf33c89[_0xabe4('0x34')]=_[_0xabe4('0x36')](db[_0xabe4('0x5b')]['rawAttributes']);_0xf33c89[_0xabe4('0x35')]=_[_0xabe4('0x36')](_0x43182c[_0xabe4('0x35')]);_0xf33c89[_0xabe4('0x37')]=_[_0xabe4('0x38')](_0xf33c89[_0xabe4('0x34')],_0xf33c89[_0xabe4('0x35')]);_0x5bd595[_0xabe4('0x39')]=_[_0xabe4('0x38')](_0xf33c89[_0xabe4('0x34')],qs[_0xabe4('0x3a')](_0x43182c[_0xabe4('0x35')][_0xabe4('0x3a')]));_0x5bd595[_0xabe4('0x39')]=_0x5bd595['attributes'][_0xabe4('0x3b')]?_0x5bd595[_0xabe4('0x39')]:_0xf33c89[_0xabe4('0x34')];_0x5bd595['order']=qs[_0xabe4('0x3e')](_0x43182c['query'][_0xabe4('0x3e')]);_0x5bd595['where']=qs['filters'](_[_0xabe4('0x3f')](_0x43182c[_0xabe4('0x35')],_0xf33c89[_0xabe4('0x37')]));if(_0x43182c[_0xabe4('0x35')]['filter']){_0x5bd595[_0xabe4('0x41')]=_[_0xabe4('0x40')](_0x5bd595['where'],{'$or':_[_0xabe4('0x42')](_0x5bd595['attributes'],function(_0x555359){var _0xc7d493={};_0xc7d493[_0x555359]={'$like':'%'+_0x43182c[_0xabe4('0x35')][_0xabe4('0x5a')]+'%'};return _0xc7d493;})});}_0x5bd595=_['merge']({},_0x5bd595,_0x43182c[_0xabe4('0x44')]);return _0x5149ad[_0xabe4('0x8b')](_0x5bd595);}})[_0xabe4('0x26')](function(_0xf2c08a){if(_0xf2c08a){_0x46e4b4=_0xf2c08a[_0xabe4('0x3b')];if(!_0x43182c['query'][_0xabe4('0x58')](_0xabe4('0x3c'))){_0x5bd595[_0xabe4('0x20')]=qs[_0xabe4('0x20')](_0x43182c['query'][_0xabe4('0x20')]);_0x5bd595[_0xabe4('0x1e')]=qs['offset'](_0x43182c[_0xabe4('0x35')][_0xabe4('0x1e')]);}return _0x5149ad[_0xabe4('0x8b')](_0x5bd595);}})['then'](function(_0x57439f){if(_0x57439f){return _0x57439f?{'count':_0x46e4b4,'rows':_0x57439f}:null;}})[_0xabe4('0x26')](respondWithResult(_0x940191,null))['catch'](handleError(_0x940191,null));}; \ No newline at end of file +var _0xe0a8=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','agent','smsPause','updatedAt','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','get','UserProfileResource','destroy','end','name','map','SmsQueue','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','role','SmsQueues','UserProfileSection','find'];(function(_0x293188,_0xee98e){var _0x5f242e=function(_0x291ba2){while(--_0x291ba2){_0x293188['push'](_0x293188['shift']());}};_0x5f242e(++_0xee98e);}(_0xe0a8,0x161));var _0x8e0a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe0a8[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e0a('0x0'));var zipdir=require(_0x8e0a('0x1'));var jsonpatch=require(_0x8e0a('0x2'));var rp=require(_0x8e0a('0x3'));var moment=require(_0x8e0a('0x4'));var BPromise=require(_0x8e0a('0x5'));var Mustache=require(_0x8e0a('0x6'));var util=require(_0x8e0a('0x7'));var path=require(_0x8e0a('0x8'));var sox=require(_0x8e0a('0x9'));var csv=require('to-csv');var ejs=require(_0x8e0a('0xa'));var fs=require('fs');var fs_extra=require(_0x8e0a('0xb'));var _=require(_0x8e0a('0xc'));var squel=require('squel');var crypto=require(_0x8e0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e0a('0xe'));var toCsv=require(_0x8e0a('0xf'));var querystring=require(_0x8e0a('0x10'));var Papa=require(_0x8e0a('0x11'));var Redis=require(_0x8e0a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8e0a('0x13'));var as=require(_0x8e0a('0x14'));var hardwareService=require(_0x8e0a('0x15'));var logger=require(_0x8e0a('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8e0a('0x17'));var licenseUtil=require(_0x8e0a('0x18'));var db=require(_0x8e0a('0x19'))['db'];config[_0x8e0a('0x1a')]=_[_0x8e0a('0x1b')](config['redis'],{'host':_0x8e0a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8e0a('0x1d'))[_0x8e0a('0x1e')](socket);function respondWithStatusCode(_0x5a2df7,_0x481617){_0x481617=_0x481617||0xcc;return function(_0x4cc4f7){if(_0x4cc4f7){return _0x5a2df7[_0x8e0a('0x1f')](_0x481617);}return _0x5a2df7[_0x8e0a('0x20')](_0x481617)['end']();};}function respondWithResult(_0x5eb144,_0x38dd37){_0x38dd37=_0x38dd37||0xc8;return function(_0x635f4b){if(_0x635f4b){return _0x5eb144[_0x8e0a('0x20')](_0x38dd37)[_0x8e0a('0x21')](_0x635f4b);}};}function respondWithFilteredResult(_0x2b2007,_0x36aee7){return function(_0x5d1b00){if(_0x5d1b00){var _0x1c71ad=typeof _0x36aee7[_0x8e0a('0x22')]==='undefined'&&typeof _0x36aee7[_0x8e0a('0x23')]===_0x8e0a('0x24');var _0x190c13=_0x5d1b00[_0x8e0a('0x25')];var _0x339e3b=_0x1c71ad?0x0:_0x36aee7[_0x8e0a('0x22')];var _0x102415=_0x1c71ad?_0x5d1b00['count']:_0x36aee7[_0x8e0a('0x22')]+_0x36aee7[_0x8e0a('0x23')];var _0x4f2703;if(_0x102415>=_0x190c13){_0x102415=_0x190c13;_0x4f2703=0xc8;}else{_0x4f2703=0xce;}_0x2b2007['status'](_0x4f2703);return _0x2b2007['set']('Content-Range',_0x339e3b+'-'+_0x102415+'/'+_0x190c13)['json'](_0x5d1b00);}return null;};}function patchUpdates(_0x29625a){return function(_0x3c1527){try{jsonpatch[_0x8e0a('0x26')](_0x3c1527,_0x29625a,!![]);}catch(_0x3095b9){return BPromise[_0x8e0a('0x27')](_0x3095b9);}return _0x3c1527[_0x8e0a('0x28')]();};}function saveUpdates(_0x4a29c5,_0xcff72d){return function(_0x45edc4){if(_0x45edc4){return _0x45edc4[_0x8e0a('0x29')](_0x4a29c5)[_0x8e0a('0x2a')](function(_0x1feba5){return _0x1feba5;});}return null;};}function removeEntity(_0x418e19,_0x11895b){return function(_0x209518){if(_0x209518){return _0x209518['destroy']()[_0x8e0a('0x2a')](function(){var _0x43dad9=_0x209518[_0x8e0a('0x2b')]({'plain':!![]});var _0x22fcbe='SmsQueues';return db[_0x8e0a('0x2c')][_0x8e0a('0x2d')]({'where':{'type':_0x22fcbe,'resourceId':_0x43dad9['id']}})[_0x8e0a('0x2a')](function(){return _0x209518;});})[_0x8e0a('0x2a')](function(){_0x418e19[_0x8e0a('0x20')](0xcc)[_0x8e0a('0x2e')]();});}};}function handleEntityNotFound(_0x3e6b24,_0x554e24){return function(_0x2230f9){if(!_0x2230f9){_0x3e6b24[_0x8e0a('0x1f')](0x194);}return _0x2230f9;};}function handleError(_0x4b6c4c,_0x4d0d11){_0x4d0d11=_0x4d0d11||0x1f4;return function(_0x416eed){logger['error'](_0x416eed['stack']);if(_0x416eed[_0x8e0a('0x2f')]){delete _0x416eed[_0x8e0a('0x2f')];}_0x4b6c4c[_0x8e0a('0x20')](_0x4d0d11)['send'](_0x416eed);};}exports['index']=function(_0x2daa94,_0x26d7b2){var _0x4b8a9d={},_0x46d810={},_0x589005={'count':0x0,'rows':[]};var _0x2ce503=_[_0x8e0a('0x30')](db[_0x8e0a('0x31')][_0x8e0a('0x32')],function(_0x303a0c){return{'name':_0x303a0c['fieldName'],'type':_0x303a0c[_0x8e0a('0x33')][_0x8e0a('0x34')]};});_0x46d810['model']=_[_0x8e0a('0x30')](_0x2ce503,_0x8e0a('0x2f'));_0x46d810[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x2daa94[_0x8e0a('0x35')]);_0x46d810[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x46d810[_0x8e0a('0x39')],_0x46d810[_0x8e0a('0x35')]);_0x4b8a9d[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0x46d810[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x3b')]));_0x4b8a9d['attributes']=_0x4b8a9d[_0x8e0a('0x3a')][_0x8e0a('0x3c')]?_0x4b8a9d[_0x8e0a('0x3a')]:_0x46d810[_0x8e0a('0x39')];if(!_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x3d')](_0x8e0a('0x3e'))){_0x4b8a9d[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x4b8a9d[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x2daa94['query'][_0x8e0a('0x22')]);}_0x4b8a9d[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x40')]);_0x4b8a9d[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x2daa94['query'],_0x46d810[_0x8e0a('0x37')]),_0x2ce503);if(_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x43')]){_0x4b8a9d[_0x8e0a('0x41')]=_[_0x8e0a('0x44')](_0x4b8a9d['where'],{'$or':_[_0x8e0a('0x30')](_0x2ce503,function(_0x35d4dc){if(_0x35d4dc[_0x8e0a('0x33')]!==_0x8e0a('0x45')){var _0x4d3749={};_0x4d3749[_0x35d4dc[_0x8e0a('0x2f')]]={'$like':'%'+_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0x4d3749;}})});}_0x4b8a9d=_[_0x8e0a('0x44')]({},_0x4b8a9d,_0x2daa94[_0x8e0a('0x46')]);var _0x28a02e={'where':_0x4b8a9d['where']};return db[_0x8e0a('0x31')][_0x8e0a('0x25')](_0x28a02e)['then'](function(_0xb2a7c7){_0x589005[_0x8e0a('0x25')]=_0xb2a7c7;if(_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x47')]){_0x4b8a9d['include']=[{'all':!![]}];}return db[_0x8e0a('0x31')][_0x8e0a('0x48')](_0x4b8a9d);})[_0x8e0a('0x2a')](function(_0x4c6ef0){_0x589005[_0x8e0a('0x49')]=_0x4c6ef0;return _0x589005;})[_0x8e0a('0x2a')](respondWithFilteredResult(_0x26d7b2,_0x4b8a9d))[_0x8e0a('0x4a')](handleError(_0x26d7b2,null));};exports[_0x8e0a('0x4b')]=function(_0x51bf04,_0x4431c9){var _0x2f2d86={'raw':!![],'where':{'id':_0x51bf04[_0x8e0a('0x4c')]['id']}},_0xaa831a={};_0xaa831a[_0x8e0a('0x39')]=_[_0x8e0a('0x36')](db[_0x8e0a('0x31')][_0x8e0a('0x32')]);_0xaa831a[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x51bf04[_0x8e0a('0x35')]);_0xaa831a[_0x8e0a('0x37')]=_['intersection'](_0xaa831a['model'],_0xaa831a[_0x8e0a('0x35')]);_0x2f2d86[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0xaa831a[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x51bf04['query']['fields']));_0x2f2d86['attributes']=_0x2f2d86[_0x8e0a('0x3a')]['length']?_0x2f2d86['attributes']:_0xaa831a['model'];if(_0x51bf04[_0x8e0a('0x35')][_0x8e0a('0x47')]){_0x2f2d86[_0x8e0a('0x4d')]=[{'all':!![]}];}_0x2f2d86=_['merge']({},_0x2f2d86,_0x51bf04[_0x8e0a('0x46')]);return db[_0x8e0a('0x31')]['find'](_0x2f2d86)[_0x8e0a('0x2a')](handleEntityNotFound(_0x4431c9,null))[_0x8e0a('0x2a')](respondWithResult(_0x4431c9,null))[_0x8e0a('0x4a')](handleError(_0x4431c9,null));};exports[_0x8e0a('0x4e')]=function(_0xe37838,_0x1674b8){return db['SmsQueue'][_0x8e0a('0x4e')](_0xe37838[_0x8e0a('0x4f')],{})[_0x8e0a('0x2a')](function(_0x704770){var _0x55795b=_0xe37838[_0x8e0a('0x50')]['get']({'plain':!![]});if(!_0x55795b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55795b[_0x8e0a('0x51')]==='user'){var _0x6ba9d0=_0x704770[_0x8e0a('0x2b')]({'plain':!![]});var _0x92d311=_0x8e0a('0x52');return db[_0x8e0a('0x53')][_0x8e0a('0x54')]({'where':{'name':_0x92d311,'userProfileId':_0x55795b[_0x8e0a('0x55')]},'raw':!![]})[_0x8e0a('0x2a')](function(_0x51c8d3){if(_0x51c8d3&&_0x51c8d3[_0x8e0a('0x56')]===0x0){return db[_0x8e0a('0x2c')][_0x8e0a('0x4e')]({'name':_0x6ba9d0['name'],'resourceId':_0x6ba9d0['id'],'type':_0x51c8d3['name'],'sectionId':_0x51c8d3['id']},{})[_0x8e0a('0x2a')](function(){return _0x704770;});}else{return _0x704770;}})[_0x8e0a('0x4a')](function(_0x11abef){logger[_0x8e0a('0x57')](_0x8e0a('0x58'),_0x11abef);throw _0x11abef;});}return _0x704770;})[_0x8e0a('0x2a')](respondWithResult(_0x1674b8,0xc9))[_0x8e0a('0x4a')](handleError(_0x1674b8,null));};exports['update']=function(_0x3f3b46,_0x1f6930){if(_0x3f3b46[_0x8e0a('0x4f')]['id']){delete _0x3f3b46['body']['id'];}return db[_0x8e0a('0x31')]['find']({'where':{'id':_0x3f3b46[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1f6930,null))[_0x8e0a('0x2a')](saveUpdates(_0x3f3b46['body'],null))[_0x8e0a('0x2a')](respondWithResult(_0x1f6930,null))[_0x8e0a('0x4a')](handleError(_0x1f6930,null));};exports[_0x8e0a('0x2d')]=function(_0x8d34a3,_0x1d6a58){return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x8d34a3[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1d6a58,null))[_0x8e0a('0x2a')](removeEntity(_0x1d6a58,null))[_0x8e0a('0x4a')](handleError(_0x1d6a58,null));};exports['describe']=function(_0x1362ce,_0x5e775d){return db['SmsQueue'][_0x8e0a('0x59')]()['then'](respondWithResult(_0x5e775d,null))[_0x8e0a('0x4a')](handleError(_0x5e775d,null));};exports[_0x8e0a('0x5a')]=function(_0x1e4446,_0x350538,_0x28e868){var _0x46ce59={'raw':!![],'where':{}},_0x4549eb={},_0x56e466;return db[_0x8e0a('0x31')][_0x8e0a('0x5b')]({'where':{'id':_0x1e4446[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x350538,null))['then'](function(_0x52f10d){if(_0x52f10d){_0x56e466=_0x52f10d['get']({'plain':!![]});_0x4549eb['model']=_[_0x8e0a('0x36')](db[_0x8e0a('0x5c')][_0x8e0a('0x32')]);_0x4549eb['query']=_['keys'](_0x1e4446[_0x8e0a('0x35')]);_0x4549eb[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x4549eb[_0x8e0a('0x39')],_0x4549eb[_0x8e0a('0x35')]);_0x46ce59[_0x8e0a('0x3a')]=_['intersection'](_0x4549eb[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x1e4446['query'][_0x8e0a('0x3b')]));_0x46ce59[_0x8e0a('0x3a')]=_0x46ce59['attributes'][_0x8e0a('0x3c')]?_0x46ce59[_0x8e0a('0x3a')]:_0x4549eb[_0x8e0a('0x39')];if(!_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x3d')]('nolimit')){_0x46ce59[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x46ce59[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x1e4446['query'][_0x8e0a('0x22')]);}_0x46ce59[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x40')]);_0x46ce59[_0x8e0a('0x41')]=qs[_0x8e0a('0x37')](_[_0x8e0a('0x42')](_0x1e4446[_0x8e0a('0x35')],_0x4549eb[_0x8e0a('0x37')]));_0x46ce59[_0x8e0a('0x41')][_0x8e0a('0x5d')]=_0x52f10d['id'];if(_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x43')]){_0x46ce59[_0x8e0a('0x41')]=_[_0x8e0a('0x44')](_0x46ce59[_0x8e0a('0x41')],{'$or':_[_0x8e0a('0x30')](_0x46ce59['attributes'],function(_0x4f2b51){var _0x50bbc0={};_0x50bbc0[_0x4f2b51]={'$like':'%'+_0x1e4446['query'][_0x8e0a('0x43')]+'%'};return _0x50bbc0;})});}_0x46ce59=_[_0x8e0a('0x44')]({},_0x46ce59,_0x1e4446[_0x8e0a('0x46')]);return db[_0x8e0a('0x5c')]['findAll'](_0x46ce59);}})[_0x8e0a('0x2a')](function(_0x5de647){if(_0x5de647){return db[_0x8e0a('0x5e')][_0x8e0a('0x5f')]({'where':{'id':_[_0x8e0a('0x30')](_0x5de647,'UserId'),'role':_0x8e0a('0x60')},'attributes':['id',_0x8e0a('0x2f'),_0x8e0a('0x61'),_0x8e0a('0x62'),'createdAt']});}})[_0x8e0a('0x2a')](function(_0x2e775d){if(_0x2e775d){return{'count':_0x2e775d[_0x8e0a('0x25')],'rows':_['map'](_0x2e775d['rows'],function(_0x1cb48e){return{'membername':_0x1cb48e[_0x8e0a('0x2f')],'UserId':_0x1cb48e['id'],'queue_name':_0x56e466[_0x8e0a('0x2f')],'SmsQueueId':_0x56e466['id'],'interface':util[_0x8e0a('0x63')](_0x8e0a('0x64'),'SIP',_0x1cb48e[_0x8e0a('0x2f')]),'penalty':0x0,'paused':_0x1cb48e[_0x8e0a('0x61')],'createdAt':_0x1cb48e[_0x8e0a('0x65')],'updatedAt':_0x1cb48e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e0a('0x2a')](respondWithFilteredResult(_0x350538,_0x46ce59))[_0x8e0a('0x4a')](handleError(_0x350538,null));};exports[_0x8e0a('0x66')]=function(_0x223e25,_0x6b5d90,_0x4ca2ad){var _0x2d1a2a={};var _0x200912={};var _0x56d3c1;var _0x2981dc;return db[_0x8e0a('0x31')][_0x8e0a('0x5b')]({'where':{'id':_0x223e25['params']['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x6b5d90,null))[_0x8e0a('0x2a')](function(_0x7e3227){if(_0x7e3227){_0x56d3c1=_0x7e3227;_0x200912[_0x8e0a('0x39')]=_[_0x8e0a('0x36')](db[_0x8e0a('0x67')][_0x8e0a('0x32')]);_0x200912[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x223e25[_0x8e0a('0x35')]);_0x200912['filters']=_[_0x8e0a('0x38')](_0x200912['model'],_0x200912[_0x8e0a('0x35')]);_0x2d1a2a[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0x200912[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x223e25[_0x8e0a('0x35')]['fields']));_0x2d1a2a['attributes']=_0x2d1a2a['attributes']['length']?_0x2d1a2a[_0x8e0a('0x3a')]:_0x200912['model'];_0x2d1a2a[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x223e25['query'][_0x8e0a('0x40')]);_0x2d1a2a[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x223e25[_0x8e0a('0x35')],_0x200912['filters']));if(_0x223e25[_0x8e0a('0x35')]['filter']){_0x2d1a2a[_0x8e0a('0x41')]=_['merge'](_0x2d1a2a['where'],{'$or':_['map'](_0x2d1a2a[_0x8e0a('0x3a')],function(_0x549b56){var _0xf0ffd2={};_0xf0ffd2[_0x549b56]={'$like':'%'+_0x223e25[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0xf0ffd2;})});}_0x2d1a2a=_['merge']({},_0x2d1a2a,_0x223e25[_0x8e0a('0x46')]);return _0x56d3c1[_0x8e0a('0x66')](_0x2d1a2a);}})[_0x8e0a('0x2a')](function(_0x4b75d1){if(_0x4b75d1){_0x2981dc=_0x4b75d1[_0x8e0a('0x3c')];if(!_0x223e25[_0x8e0a('0x35')]['hasOwnProperty'](_0x8e0a('0x3e'))){_0x2d1a2a[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x223e25[_0x8e0a('0x35')]['limit']);_0x2d1a2a[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x223e25[_0x8e0a('0x35')][_0x8e0a('0x22')]);}return _0x56d3c1['getTeams'](_0x2d1a2a);}})[_0x8e0a('0x2a')](function(_0x5eb7f7){if(_0x5eb7f7){return _0x5eb7f7?{'count':_0x2981dc,'rows':_0x5eb7f7}:null;}})['then'](respondWithResult(_0x6b5d90,null))[_0x8e0a('0x4a')](handleError(_0x6b5d90,null));};exports[_0x8e0a('0x68')]=function(_0x1e0c64,_0x828ce4,_0x3e4fb4){var _0x54d1a6=_0x1e0c64[_0x8e0a('0x4f')][_0x8e0a('0x69')];return db[_0x8e0a('0x67')][_0x8e0a('0x48')]({'where':{'id':_0x54d1a6},'attributes':['id'],'include':[{'model':db[_0x8e0a('0x5e')],'as':_0x8e0a('0x6a'),'attributes':['id','name',_0x8e0a('0x6b'),_0x8e0a('0x6c'),_0x8e0a('0x6d')],'raw':!![]}]})['then'](function(_0x259f66){if(_0x259f66){var _0x25da85=_[_0x8e0a('0x6e')](_0x259f66,function(_0x1682dc){var _0x756692=_0x1682dc[_0x8e0a('0x2b')]({'plain':!![]});return _0x756692['Agents'];});return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x1e0c64[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](function(_0x544fe5){return db[_0x8e0a('0x6f')][_0x8e0a('0x70')](function(_0x35ecad){return _0x544fe5[_0x8e0a('0x68')](_0x54d1a6,{'transaction':_0x35ecad})[_0x8e0a('0x2a')](function(){return BPromise[_0x8e0a('0x71')](_0x25da85,function(_0xeb6faa){return db['UserSmsQueue'][_0x8e0a('0x72')]({'where':{'UserId':_0xeb6faa['id'],'SmsQueueId':_0x1e0c64['params']['id']},'transaction':_0x35ecad});});})[_0x8e0a('0x2a')](function(){_0x25da85[_0x8e0a('0x73')](function(_0x870906){socket[_0x8e0a('0x74')]('userSmsQueue:save',{'UserId':_0x870906['id'],'SmsQueueId':_0x544fe5['id']});});});});});}})[_0x8e0a('0x2a')](respondWithStatusCode(_0x828ce4,null))[_0x8e0a('0x4a')](handleError(_0x828ce4,null));};exports['removeTeams']=function(_0x751214,_0x268ed2,_0x3ad0bf){return db[_0x8e0a('0x67')][_0x8e0a('0x48')]({'where':{'id':_0x751214[_0x8e0a('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8e0a('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x8e0a('0x2a')](handleEntityNotFound(_0x268ed2,null))[_0x8e0a('0x2a')](function(_0x282e79){var _0x264c7a=_['map'](_0x282e79,'id');var _0x465cdc=[];var _0x432efa=[];var _0x2d2ca5=squel[_0x8e0a('0x75')]();_0x2d2ca5[_0x8e0a('0x76')](_0x8e0a('0x77'))[_0x8e0a('0x78')](_0x8e0a('0x79'),'tq')[_0x8e0a('0x7a')](_0x8e0a('0x7b'),'ut',_0x8e0a('0x7c'))[_0x8e0a('0x41')](_0x8e0a('0x7d'),_0x751214[_0x8e0a('0x4c')]['id']);for(var _0x15a792=0x0;_0x15a792<_0x282e79[_0x8e0a('0x3c')];_0x15a792+=0x1){let _0x3e7d30=_0x282e79[_0x15a792];for(var _0x20566c=0x0;_0x20566c<_0x3e7d30[_0x8e0a('0x6a')][_0x8e0a('0x3c')];_0x20566c+=0x1){let _0x1cc944=_0x3e7d30[_0x8e0a('0x6a')][_0x20566c];var _0x43df3c=_0x2d2ca5[_0x8e0a('0x7e')]();_0x43df3c['where']('ut.UserId\x20=\x20?',_0x1cc944['id']);_0x432efa[_0x8e0a('0x7f')](db['sequelize'][_0x8e0a('0x35')](_0x43df3c[_0x8e0a('0x80')](),{'type':db[_0x8e0a('0x6f')]['QueryTypes'][_0x8e0a('0x81')]})[_0x8e0a('0x2a')](function(_0x50c855){if(_0x50c855[_0x8e0a('0x3c')]===0x1){return _0x1cc944['id'];}else{var _0x52775a=_[_0x8e0a('0x82')](_['map'](_0x50c855,_0x8e0a('0x83')),function(_0x4131e1){return _[_0x8e0a('0x84')](_0x264c7a,_0x4131e1);});if(_0x52775a){return _0x1cc944['id'];}}}));}}return BPromise['all'](_0x432efa)['then'](function(_0x3c5639){_0x465cdc=_(_0x465cdc)[_0x8e0a('0x85')](_0x3c5639)[_0x8e0a('0x86')]()[_0x8e0a('0x87')]();return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x751214[_0x8e0a('0x4c')]['id']}})['then'](function(_0x1ee98e){return db['sequelize'][_0x8e0a('0x70')](function(_0x3beb00){return _0x1ee98e[_0x8e0a('0x88')](_0x751214[_0x8e0a('0x35')][_0x8e0a('0x69')],{'transaction':_0x3beb00})['then'](function(){if(!_[_0x8e0a('0x89')](_0x465cdc)){return _0x1ee98e['removeAgents'](_0x465cdc,{'transaction':_0x3beb00});}})[_0x8e0a('0x2a')](function(){_0x465cdc[_0x8e0a('0x73')](function(_0x4863bd){socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':_0x4863bd,'SmsQueueId':_0x1ee98e['id']});});});});});});})[_0x8e0a('0x2a')](respondWithStatusCode(_0x268ed2,null))[_0x8e0a('0x4a')](handleError(_0x268ed2,null));};exports[_0x8e0a('0x8b')]=function(_0x5f05e3,_0x8498f7,_0x451d23){return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x5f05e3[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x8498f7,null))['then'](function(_0x4ed2c5){if(_0x4ed2c5){return _0x4ed2c5['addAgents'](_0x5f05e3[_0x8e0a('0x4f')]['ids'],_[_0x8e0a('0x8c')](_0x5f05e3['body'],[_0x8e0a('0x69'),'id'])||{})[_0x8e0a('0x8d')](function(_0x15037a){for(var _0x5af85f=0x0;_0x5af85f<_0x5f05e3['body'][_0x8e0a('0x69')]['length'];_0x5af85f+=0x1){socket[_0x8e0a('0x74')](_0x8e0a('0x8e'),{'UserId':Number(_0x5f05e3[_0x8e0a('0x4f')]['ids'][_0x5af85f]),'SmsQueueId':Number(_0x5f05e3[_0x8e0a('0x4c')]['id'])});}return _0x15037a;});}})[_0x8e0a('0x2a')](respondWithResult(_0x8498f7,null))['catch'](handleError(_0x8498f7,null));};exports[_0x8e0a('0x8f')]=function(_0xecff65,_0x4b274b,_0x440f6d){return db['SmsQueue']['find']({'where':{'id':_0xecff65[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x4b274b,null))['then'](function(_0x2ea517){if(_0x2ea517){return _0x2ea517['removeAgents'](_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')])[_0x8e0a('0x2a')](function(){if(_[_0x8e0a('0x90')](_0xecff65['query'][_0x8e0a('0x69')])){for(var _0xb25ec=0x0;_0xb25ec<_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')][_0x8e0a('0x3c')];_0xb25ec+=0x1){socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':Number(_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')][_0xb25ec]),'SmsQueueId':Number(_0xecff65[_0x8e0a('0x4c')]['id'])});}}else{socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':Number(_0xecff65['query']['ids']),'SmsQueueId':Number(_0xecff65[_0x8e0a('0x4c')]['id'])});}});}})[_0x8e0a('0x2a')](respondWithStatusCode(_0x4b274b,null))[_0x8e0a('0x4a')](handleError(_0x4b274b,null));};exports[_0x8e0a('0x91')]=function(_0x12ca1b,_0x1763a2,_0x489d4f){var _0x261eef={};var _0x542f84={};var _0x152155;var _0x8842;return db[_0x8e0a('0x31')]['findOne']({'where':{'id':_0x12ca1b[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1763a2,null))[_0x8e0a('0x2a')](function(_0x20bd26){if(_0x20bd26){_0x152155=_0x20bd26;_0x542f84['model']=_[_0x8e0a('0x36')](db[_0x8e0a('0x5e')][_0x8e0a('0x32')]);_0x542f84[_0x8e0a('0x35')]=_['keys'](_0x12ca1b['query']);_0x542f84[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x542f84[_0x8e0a('0x39')],_0x542f84['query']);_0x261eef[_0x8e0a('0x3a')]=_['intersection'](_0x542f84[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x3b')]));_0x261eef[_0x8e0a('0x3a')]=_0x261eef['attributes']['length']?_0x261eef[_0x8e0a('0x3a')]:_0x542f84[_0x8e0a('0x39')];_0x261eef[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x12ca1b['query'][_0x8e0a('0x40')]);_0x261eef[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x12ca1b[_0x8e0a('0x35')],_0x542f84[_0x8e0a('0x37')]));if(_0x12ca1b[_0x8e0a('0x35')]['filter']){_0x261eef[_0x8e0a('0x41')]=_['merge'](_0x261eef[_0x8e0a('0x41')],{'$or':_[_0x8e0a('0x30')](_0x261eef[_0x8e0a('0x3a')],function(_0x580caa){var _0x10927c={};_0x10927c[_0x580caa]={'$like':'%'+_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0x10927c;})});}_0x261eef=_['merge']({},_0x261eef,_0x12ca1b[_0x8e0a('0x46')]);return _0x152155[_0x8e0a('0x91')](_0x261eef);}})['then'](function(_0x47065a){if(_0x47065a){_0x8842=_0x47065a[_0x8e0a('0x3c')];if(!_0x12ca1b[_0x8e0a('0x35')]['hasOwnProperty'](_0x8e0a('0x3e'))){_0x261eef[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x261eef[_0x8e0a('0x22')]=qs['offset'](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x22')]);}return _0x152155[_0x8e0a('0x91')](_0x261eef);}})['then'](function(_0xa6bf8c){if(_0xa6bf8c){return _0xa6bf8c?{'count':_0x8842,'rows':_0xa6bf8c}:null;}})[_0x8e0a('0x2a')](respondWithResult(_0x1763a2,null))[_0x8e0a('0x4a')](handleError(_0x1763a2,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 74401e6..f26c87b 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 _0x768b=['hook','exports','setMaxListeners','save','update','hasOwnProperty'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x768b,0xb6));var _0xb768=function(_0x594ba0,_0x37b988){_0x594ba0=_0x594ba0-0x0;var _0x3d19d8=_0x768b[_0x594ba0];return _0x3d19d8;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb768('0x0')](0x0);var events={'afterCreate':_0xb768('0x1'),'afterUpdate':_0xb768('0x2'),'afterDestroy':'remove'};function emitEvent(_0x56e242){return function(_0x1929ea,_0x43709d,_0x1c5627){SmsQueueEvents['emit'](_0x56e242+':'+_0x1929ea['id'],_0x1929ea);SmsQueueEvents['emit'](_0x56e242,_0x1929ea);_0x1c5627(null);};}for(var e in events){if(events[_0xb768('0x3')](e)){var event=events[e];SmsQueue[_0xb768('0x4')](e,emitEvent(event));}}module[_0xb768('0x5')]=SmsQueueEvents; \ No newline at end of file +var _0x2dad=['update','remove','emit','hasOwnProperty','events','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x2dad,0x1cf));var _0xd2da=function(_0x178867,_0xa3b61){_0x178867=_0x178867-0x0;var _0x1e8aa2=_0x2dad[_0x178867];return _0x1e8aa2;};'use strict';var EventEmitter=require(_0xd2da('0x0'));var SmsQueue=require(_0xd2da('0x1'))['db'][_0xd2da('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd2da('0x3')](0x0);var events={'afterCreate':_0xd2da('0x4'),'afterUpdate':_0xd2da('0x5'),'afterDestroy':_0xd2da('0x6')};function emitEvent(_0x17ef91){return function(_0x1b02c7,_0x3ca067,_0x5be107){SmsQueueEvents[_0xd2da('0x7')](_0x17ef91+':'+_0x1b02c7['id'],_0x1b02c7);SmsQueueEvents[_0xd2da('0x7')](_0x17ef91,_0x1b02c7);_0x5be107(null);};}for(var e in events){if(events[_0xd2da('0x8')](e)){var event=events[e];SmsQueue['hook'](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 c7c45c4..945cb75 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 _0x2dc2=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues'];(function(_0x538fee,_0x478ba2){var _0x1f249d=function(_0x28f98a){while(--_0x28f98a){_0x538fee['push'](_0x538fee['shift']());}};_0x1f249d(++_0x478ba2);}(_0x2dc2,0x1e0));var _0x22dc=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x2dc2[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0x22dc('0x0'));var util=require('util');var logger=require(_0x22dc('0x1'))(_0x22dc('0x2'));var moment=require(_0x22dc('0x3'));var BPromise=require(_0x22dc('0x4'));var rp=require(_0x22dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22dc('0x6'));var config=require(_0x22dc('0x7'));var attributes=require(_0x22dc('0x8'));module[_0x22dc('0x9')]=function(_0x23fb55,_0x4cf502){return _0x23fb55[_0x22dc('0xa')]('SmsQueue',attributes,{'tableName':_0x22dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf609=['request-promise','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','../../config/logger'];(function(_0x237625,_0x143187){var _0x59a363=function(_0x292458){while(--_0x292458){_0x237625['push'](_0x237625['shift']());}};_0x59a363(++_0x143187);}(_0xf609,0x1f2));var _0x9f60=function(_0x18b065,_0x5aea14){_0x18b065=_0x18b065-0x0;var _0xb23375=_0xf609[_0x18b065];return _0xb23375;};'use strict';var _=require('lodash');var util=require(_0x9f60('0x0'));var logger=require(_0x9f60('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f60('0x2'));var fs=require('fs');var path=require(_0x9f60('0x3'));var rimraf=require(_0x9f60('0x4'));var config=require('../../config/environment');var attributes=require(_0x9f60('0x5'));module[_0x9f60('0x6')]=function(_0x43e1b8,_0x3f400e){return _0x43e1b8[_0x9f60('0x7')](_0x9f60('0x8'),attributes,{'tableName':_0x9f60('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 2af58b9..a4004ec 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 _0xaf44=['catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','debug','ShowSmsQueue','SmsQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5abb47,_0x157bb8){var _0x1b8d2e=function(_0x53e639){while(--_0x53e639){_0x5abb47['push'](_0x5abb47['shift']());}};_0x1b8d2e(++_0x157bb8);}(_0xaf44,0x1b3));var _0x4af4=function(_0x980c20,_0x1ce317){_0x980c20=_0x980c20-0x0;var _0x33180f=_0xaf44[_0x980c20];return _0x33180f;};'use strict';var _=require(_0x4af4('0x0'));var util=require(_0x4af4('0x1'));var moment=require('moment');var BPromise=require(_0x4af4('0x2'));var rs=require(_0x4af4('0x3'));var fs=require('fs');var Redis=require(_0x4af4('0x4'));var db=require(_0x4af4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4af4('0x6'))(_0x4af4('0x7'));var config=require(_0x4af4('0x8'));var jayson=require(_0x4af4('0x9'));var client=jayson[_0x4af4('0xa')][_0x4af4('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4af4('0xc')],{'host':_0x4af4('0xd'),'port':0x18eb});var socket=require(_0x4af4('0xe'))(new Redis(config[_0x4af4('0xc')]));require(_0x4af4('0xf'))[_0x4af4('0x10')](socket);function respondWithRpcPromise(_0x961f37,_0x4af38a,_0x266854){return new BPromise(function(_0x48e762,_0x34b3bf){return client[_0x4af4('0x11')](_0x961f37,_0x266854)[_0x4af4('0x12')](function(_0x1a41d9){logger[_0x4af4('0x13')](_0x4af4('0x14'),_0x4af38a,_0x4af4('0x15'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x4af38a,_0x4af4('0x15'),JSON[_0x4af4('0x16')](_0x1a41d9));if(_0x1a41d9[_0x4af4('0x17')]){if(_0x1a41d9['error'][_0x4af4('0x18')]===0x1f4){logger[_0x4af4('0x17')]('SmsQueue,\x20%s,\x20%s',_0x4af38a,_0x1a41d9['error'][_0x4af4('0x19')]);return _0x34b3bf(_0x1a41d9['error'][_0x4af4('0x19')]);}logger[_0x4af4('0x17')](_0x4af4('0x14'),_0x4af38a,_0x1a41d9[_0x4af4('0x17')][_0x4af4('0x19')]);return _0x48e762(_0x1a41d9[_0x4af4('0x17')][_0x4af4('0x19')]);}else{logger[_0x4af4('0x13')](_0x4af4('0x14'),_0x4af38a,_0x4af4('0x15'));_0x48e762(_0x1a41d9[_0x4af4('0x1a')][_0x4af4('0x19')]);}})[_0x4af4('0x1b')](function(_0x24a17d){logger[_0x4af4('0x17')](_0x4af4('0x14'),_0x4af38a,_0x24a17d);_0x34b3bf(_0x24a17d);});});}exports[_0x4af4('0x1c')]=function(_0x5c5e65){var _0x5a0a8c=this;return new Promise(function(_0x3132c6,_0x44f15a){return db['SmsQueue'][_0x4af4('0x1d')]({'raw':_0x5c5e65[_0x4af4('0x1e')]?_0x5c5e65[_0x4af4('0x1e')][_0x4af4('0x1f')]===undefined?!![]:![]:!![],'where':_0x5c5e65[_0x4af4('0x1e')]?_0x5c5e65['options'][_0x4af4('0x20')]||null:null,'attributes':_0x5c5e65[_0x4af4('0x1e')]?_0x5c5e65['options'][_0x4af4('0x21')]||null:null,'limit':_0x5c5e65[_0x4af4('0x1e')]?_0x5c5e65[_0x4af4('0x1e')][_0x4af4('0x22')]||null:null,'include':_0x5c5e65[_0x4af4('0x1e')]?_0x5c5e65[_0x4af4('0x1e')]['include']?_[_0x4af4('0x23')](_0x5c5e65['options'][_0x4af4('0x24')],function(_0x4bf90e){return{'model':db[_0x4bf90e['model']],'as':_0x4bf90e['as'],'attributes':_0x4bf90e['attributes'],'include':_0x4bf90e[_0x4af4('0x24')]?_[_0x4af4('0x23')](_0x4bf90e[_0x4af4('0x24')],function(_0x45b388){return{'model':db[_0x45b388[_0x4af4('0x25')]],'as':_0x45b388['as'],'attributes':_0x45b388[_0x4af4('0x21')],'include':_0x45b388[_0x4af4('0x24')]?_['map'](_0x45b388['include'],function(_0x4ae048){return{'model':db[_0x4ae048[_0x4af4('0x25')]],'as':_0x4ae048['as'],'attributes':_0x4ae048['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58b96d){logger[_0x4af4('0x13')](_0x4af4('0x1c'),_0x5c5e65);logger[_0x4af4('0x26')](_0x4af4('0x1c'),_0x5c5e65,JSON[_0x4af4('0x16')](_0x58b96d));_0x3132c6(_0x58b96d);})[_0x4af4('0x1b')](function(_0x43610d){logger['error']('GetSmsQueue',_0x43610d[_0x4af4('0x19')],_0x5c5e65);_0x44f15a(_0x5a0a8c[_0x4af4('0x17')](0x1f4,_0x43610d[_0x4af4('0x19')]));});});};exports[_0x4af4('0x27')]=function(_0x16e85e){var _0x633bb6=this;return new Promise(function(_0x1b7794,_0x55d8de){return db[_0x4af4('0x28')][_0x4af4('0x29')]({'raw':_0x16e85e[_0x4af4('0x1e')]?_0x16e85e[_0x4af4('0x1e')][_0x4af4('0x1f')]===undefined?!![]:![]:!![],'where':_0x16e85e[_0x4af4('0x1e')]?_0x16e85e[_0x4af4('0x1e')][_0x4af4('0x20')]||null:null,'attributes':_0x16e85e[_0x4af4('0x1e')]?_0x16e85e[_0x4af4('0x1e')][_0x4af4('0x21')]||null:null,'include':_0x16e85e[_0x4af4('0x1e')]?_0x16e85e[_0x4af4('0x1e')]['include']?_[_0x4af4('0x23')](_0x16e85e[_0x4af4('0x1e')][_0x4af4('0x24')],function(_0x112e62){return{'model':db[_0x112e62[_0x4af4('0x25')]],'as':_0x112e62['as'],'attributes':_0x112e62[_0x4af4('0x21')],'include':_0x112e62[_0x4af4('0x24')]?_[_0x4af4('0x23')](_0x112e62[_0x4af4('0x24')],function(_0x109e4e){return{'model':db[_0x109e4e['model']],'as':_0x109e4e['as'],'attributes':_0x109e4e[_0x4af4('0x21')],'include':_0x109e4e[_0x4af4('0x24')]?_['map'](_0x109e4e[_0x4af4('0x24')],function(_0x19b058){return{'model':db[_0x19b058[_0x4af4('0x25')]],'as':_0x19b058['as'],'attributes':_0x19b058[_0x4af4('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4af4('0x12')](function(_0x4b600b){logger[_0x4af4('0x13')](_0x4af4('0x27'),_0x16e85e);logger[_0x4af4('0x26')](_0x4af4('0x27'),_0x16e85e,JSON[_0x4af4('0x16')](_0x4b600b));_0x1b7794(_0x4b600b);})[_0x4af4('0x1b')](function(_0x5864eb){logger[_0x4af4('0x17')](_0x4af4('0x27'),_0x5864eb[_0x4af4('0x19')],_0x16e85e);_0x55d8de(_0x633bb6[_0x4af4('0x17')](0x1f4,_0x5864eb[_0x4af4('0x19')]));});});}; \ No newline at end of file +var _0xea5b=['code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','model','map','then','ShowSmsQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c50c6,_0x1138cf){var _0x29c06c=function(_0x486927){while(--_0x486927){_0x2c50c6['push'](_0x2c50c6['shift']());}};_0x29c06c(++_0x1138cf);}(_0xea5b,0x183));var _0xbea5=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xea5b[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xbea5('0x0'));var util=require(_0xbea5('0x1'));var moment=require(_0xbea5('0x2'));var BPromise=require('bluebird');var rs=require(_0xbea5('0x3'));var fs=require('fs');var Redis=require(_0xbea5('0x4'));var db=require(_0xbea5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbea5('0x6'))(_0xbea5('0x7'));var config=require(_0xbea5('0x8'));var jayson=require(_0xbea5('0x9'));var client=jayson['client'][_0xbea5('0xa')]({'port':0x232a});config[_0xbea5('0xb')]=_['defaults'](config[_0xbea5('0xb')],{'host':_0xbea5('0xc'),'port':0x18eb});var socket=require(_0xbea5('0xd'))(new Redis(config[_0xbea5('0xb')]));require('./smsQueue.socket')[_0xbea5('0xe')](socket);function respondWithRpcPromise(_0x1cd8aa,_0x3bd99f,_0x2085b0){return new BPromise(function(_0x2229d7,_0x1bf122){return client[_0xbea5('0xf')](_0x1cd8aa,_0x2085b0)['then'](function(_0x22ea72){logger[_0xbea5('0x10')](_0xbea5('0x11'),_0x3bd99f,_0xbea5('0x12'));logger[_0xbea5('0x13')](_0xbea5('0x14'),_0x3bd99f,_0xbea5('0x12'),JSON[_0xbea5('0x15')](_0x22ea72));if(_0x22ea72['error']){if(_0x22ea72[_0xbea5('0x16')][_0xbea5('0x17')]===0x1f4){logger[_0xbea5('0x16')](_0xbea5('0x11'),_0x3bd99f,_0x22ea72[_0xbea5('0x16')][_0xbea5('0x18')]);return _0x1bf122(_0x22ea72[_0xbea5('0x16')][_0xbea5('0x18')]);}logger[_0xbea5('0x16')](_0xbea5('0x11'),_0x3bd99f,_0x22ea72[_0xbea5('0x16')][_0xbea5('0x18')]);return _0x2229d7(_0x22ea72[_0xbea5('0x16')][_0xbea5('0x18')]);}else{logger['info'](_0xbea5('0x11'),_0x3bd99f,_0xbea5('0x12'));_0x2229d7(_0x22ea72[_0xbea5('0x19')]['message']);}})[_0xbea5('0x1a')](function(_0x3af208){logger[_0xbea5('0x16')](_0xbea5('0x11'),_0x3bd99f,_0x3af208);_0x1bf122(_0x3af208);});});}exports[_0xbea5('0x1b')]=function(_0x469ab0){var _0x38a42b=this;return new Promise(function(_0x4c61a1,_0x270712){return db[_0xbea5('0x1c')][_0xbea5('0x1d')]({'raw':_0x469ab0[_0xbea5('0x1e')]?_0x469ab0['options']['raw']===undefined?!![]:![]:!![],'where':_0x469ab0['options']?_0x469ab0[_0xbea5('0x1e')][_0xbea5('0x1f')]||null:null,'attributes':_0x469ab0[_0xbea5('0x1e')]?_0x469ab0[_0xbea5('0x1e')][_0xbea5('0x20')]||null:null,'limit':_0x469ab0['options']?_0x469ab0['options'][_0xbea5('0x21')]||null:null,'include':_0x469ab0['options']?_0x469ab0[_0xbea5('0x1e')]['include']?_['map'](_0x469ab0[_0xbea5('0x1e')][_0xbea5('0x22')],function(_0x175ed9){return{'model':db[_0x175ed9[_0xbea5('0x23')]],'as':_0x175ed9['as'],'attributes':_0x175ed9[_0xbea5('0x20')],'include':_0x175ed9['include']?_['map'](_0x175ed9['include'],function(_0x42ad22){return{'model':db[_0x42ad22['model']],'as':_0x42ad22['as'],'attributes':_0x42ad22[_0xbea5('0x20')],'include':_0x42ad22['include']?_[_0xbea5('0x24')](_0x42ad22['include'],function(_0x522b65){return{'model':db[_0x522b65[_0xbea5('0x23')]],'as':_0x522b65['as'],'attributes':_0x522b65['attributes']};}):[]};}):[]};}):[]:[]})[_0xbea5('0x25')](function(_0x1da0d0){logger['info'](_0xbea5('0x1b'),_0x469ab0);logger['debug']('GetSmsQueue',_0x469ab0,JSON[_0xbea5('0x15')](_0x1da0d0));_0x4c61a1(_0x1da0d0);})['catch'](function(_0x2309fa){logger['error'](_0xbea5('0x1b'),_0x2309fa[_0xbea5('0x18')],_0x469ab0);_0x270712(_0x38a42b[_0xbea5('0x16')](0x1f4,_0x2309fa[_0xbea5('0x18')]));});});};exports[_0xbea5('0x26')]=function(_0x33c03f){var _0x1a1c13=this;return new Promise(function(_0x3d8759,_0x1c99c4){return db['SmsQueue'][_0xbea5('0x27')]({'raw':_0x33c03f[_0xbea5('0x1e')]?_0x33c03f['options'][_0xbea5('0x28')]===undefined?!![]:![]:!![],'where':_0x33c03f['options']?_0x33c03f[_0xbea5('0x1e')][_0xbea5('0x1f')]||null:null,'attributes':_0x33c03f[_0xbea5('0x1e')]?_0x33c03f[_0xbea5('0x1e')]['attributes']||null:null,'include':_0x33c03f[_0xbea5('0x1e')]?_0x33c03f[_0xbea5('0x1e')][_0xbea5('0x22')]?_[_0xbea5('0x24')](_0x33c03f['options']['include'],function(_0x1891b3){return{'model':db[_0x1891b3[_0xbea5('0x23')]],'as':_0x1891b3['as'],'attributes':_0x1891b3['attributes'],'include':_0x1891b3['include']?_[_0xbea5('0x24')](_0x1891b3['include'],function(_0x267a7f){return{'model':db[_0x267a7f[_0xbea5('0x23')]],'as':_0x267a7f['as'],'attributes':_0x267a7f[_0xbea5('0x20')],'include':_0x267a7f[_0xbea5('0x22')]?_[_0xbea5('0x24')](_0x267a7f[_0xbea5('0x22')],function(_0xaad620){return{'model':db[_0xaad620[_0xbea5('0x23')]],'as':_0xaad620['as'],'attributes':_0xaad620[_0xbea5('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17e259){logger[_0xbea5('0x10')](_0xbea5('0x26'),_0x33c03f);logger[_0xbea5('0x13')](_0xbea5('0x26'),_0x33c03f,JSON[_0xbea5('0x15')](_0x17e259));_0x3d8759(_0x17e259);})[_0xbea5('0x1a')](function(_0x555d92){logger['error'](_0xbea5('0x26'),_0x555d92[_0xbea5('0x18')],_0x33c03f);_0x1c99c4(_0x1a1c13[_0xbea5('0x16')](0x1f4,_0x555d92['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 0adf755..43d07ec 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 _0xa6ef=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','remove','update'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xa6ef,0x125));var _0xfa6e=function(_0xa5c67c,_0x16c857){_0xa5c67c=_0xa5c67c-0x0;var _0x299c46=_0xa6ef[_0xa5c67c];return _0x299c46;};'use strict';var SmsQueueEvents=require(_0xfa6e('0x0'));var events=['save',_0xfa6e('0x1'),_0xfa6e('0x2')];function createListener(_0x53f2b0,_0x24a67c){return function(_0x2ede6d){_0x24a67c[_0xfa6e('0x3')](_0x53f2b0,_0x2ede6d);};}function removeListener(_0x5d543e,_0x5b543b){return function(){SmsQueueEvents[_0xfa6e('0x4')](_0x5d543e,_0x5b543b);};}exports[_0xfa6e('0x5')]=function(_0x3acf78){for(var _0x445809=0x0,_0x3fae79=events[_0xfa6e('0x6')];_0x445809<_0x3fae79;_0x445809++){var _0x8a378f=events[_0x445809];var _0x504cb2=createListener(_0xfa6e('0x7')+_0x8a378f,_0x3acf78);SmsQueueEvents['on'](_0x8a378f,_0x504cb2);}}; \ No newline at end of file +var _0x9bcb=['register','length','smsQueue:','./smsQueue.events','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9bcb,0x1ef));var _0xb9bc=function(_0x4f1ae3,_0x56855d){_0x4f1ae3=_0x4f1ae3-0x0;var _0x25b8f0=_0x9bcb[_0x4f1ae3];return _0x25b8f0;};'use strict';var SmsQueueEvents=require(_0xb9bc('0x0'));var events=[_0xb9bc('0x1'),'remove','update'];function createListener(_0x3986ea,_0x193489){return function(_0x58c6c4){_0x193489[_0xb9bc('0x2')](_0x3986ea,_0x58c6c4);};}function removeListener(_0x53c2c5,_0x313d11){return function(){SmsQueueEvents['removeListener'](_0x53c2c5,_0x313d11);};}exports[_0xb9bc('0x3')]=function(_0x21a989){for(var _0x2953fb=0x0,_0x24d2c5=events[_0xb9bc('0x4')];_0x2953fb<_0x24d2c5;_0x2953fb++){var _0x2df6ec=events[_0x2953fb];var _0x41fdb2=createListener(_0xb9bc('0x5')+_0x2df6ec,_0x21a989);SmsQueueEvents['on'](_0x2df6ec,_0x41fdb2);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 253e792..cc76df9 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 _0x15a0=['post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/:id','show'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x15a0,0x8d));var _0x015a=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x15a0[_0x4f35f4];return _0x2e9a70;};'use strict';var multer=require(_0x015a('0x0'));var util=require('util');var path=require(_0x015a('0x1'));var timeout=require(_0x015a('0x2'));var express=require(_0x015a('0x3'));var router=express['Router']();var fs_extra=require(_0x015a('0x4'));var auth=require(_0x015a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x015a('0x6'));var controller=require(_0x015a('0x7'));router[_0x015a('0x8')]('/',auth[_0x015a('0x9')](),controller['index']);router[_0x015a('0x8')]('/describe',auth[_0x015a('0x9')](),controller['describe']);router['get'](_0x015a('0xa'),auth[_0x015a('0x9')](),controller[_0x015a('0xb')]);router[_0x015a('0xc')]('/',auth[_0x015a('0x9')](),controller['create']);router[_0x015a('0xd')](_0x015a('0xa'),auth[_0x015a('0x9')](),controller['update']);router[_0x015a('0xe')](_0x015a('0xa'),auth[_0x015a('0x9')](),controller[_0x015a('0xf')]);module[_0x015a('0x10')]=router; \ No newline at end of file +var _0x5c91=['show','post','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x14076e,_0x776d5c){var _0x1e9c14=function(_0x4f404f){while(--_0x4f404f){_0x14076e['push'](_0x14076e['shift']());}};_0x1e9c14(++_0x776d5c);}(_0x5c91,0x1e9));var _0x15c9=function(_0x3a190a,_0x2893cb){_0x3a190a=_0x3a190a-0x0;var _0x3065e9=_0x5c91[_0x3a190a];return _0x3065e9;};'use strict';var multer=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var path=require(_0x15c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x15c9('0x3'));var router=express[_0x15c9('0x4')]();var fs_extra=require(_0x15c9('0x5'));var auth=require(_0x15c9('0x6'));var interaction=require(_0x15c9('0x7'));var config=require(_0x15c9('0x8'));var controller=require('./smsQueueReport.controller');router[_0x15c9('0x9')]('/',auth[_0x15c9('0xa')](),controller[_0x15c9('0xb')]);router[_0x15c9('0x9')](_0x15c9('0xc'),auth['isAuthenticated'](),controller[_0x15c9('0xd')]);router[_0x15c9('0x9')](_0x15c9('0xe'),auth['isAuthenticated'](),controller[_0x15c9('0xf')]);router[_0x15c9('0x10')]('/',auth[_0x15c9('0xa')](),controller['create']);router['put'](_0x15c9('0xe'),auth[_0x15c9('0xa')](),controller['update']);router['delete']('/:id',auth[_0x15c9('0xa')](),controller[_0x15c9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index fea8de5..44340b5 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 _0x83ad=['sequelize','exports','STRING','DATE','moment'];(function(_0x4e33c8,_0x6e252d){var _0x466d5f=function(_0x132fb3){while(--_0x132fb3){_0x4e33c8['push'](_0x4e33c8['shift']());}};_0x466d5f(++_0x6e252d);}(_0x83ad,0x1df));var _0xd83a=function(_0x295e7f,_0x1a4d59){_0x295e7f=_0x295e7f-0x0;var _0xdb8b56=_0x83ad[_0x295e7f];return _0xdb8b56;};'use strict';var moment=require(_0xd83a('0x0'));var Sequelize=require(_0xd83a('0x1'));module[_0xd83a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd83a('0x3')]},'joinAt':{'type':Sequelize[_0xd83a('0x4')]},'leaveAt':{'type':Sequelize[_0xd83a('0x4')]},'acceptAt':{'type':Sequelize[_0xd83a('0x4')]},'exitAt':{'type':Sequelize[_0xd83a('0x4')]},'reason':{'type':Sequelize[_0xd83a('0x3')]}}; \ No newline at end of file +var _0x041d=['STRING','DATE','moment','exports'];(function(_0x59ae8f,_0x148344){var _0x3900b5=function(_0x63af51){while(--_0x63af51){_0x59ae8f['push'](_0x59ae8f['shift']());}};_0x3900b5(++_0x148344);}(_0x041d,0xce));var _0xd041=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x041d[_0x36eaaa];return _0x461349;};'use strict';var moment=require(_0xd041('0x0'));var Sequelize=require('sequelize');module[_0xd041('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd041('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd041('0x3')]},'acceptAt':{'type':Sequelize[_0xd041('0x3')]},'exitAt':{'type':Sequelize[_0xd041('0x3')]},'reason':{'type':Sequelize[_0xd041('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index f633992..06dfc9c 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 _0x1d18=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsQueueReport','include','findAll','rows','params','rawAttributes','includeAll','find','create','body','describe','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x4c9478,_0x176f48){var _0x3ac3b4=function(_0x56f89d){while(--_0x56f89d){_0x4c9478['push'](_0x4c9478['shift']());}};_0x3ac3b4(++_0x176f48);}(_0x1d18,0x1b5));var _0x81d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d18[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81d1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x81d1('0x1'));var rp=require(_0x81d1('0x2'));var moment=require(_0x81d1('0x3'));var BPromise=require(_0x81d1('0x4'));var Mustache=require(_0x81d1('0x5'));var util=require(_0x81d1('0x6'));var path=require(_0x81d1('0x7'));var sox=require(_0x81d1('0x8'));var csv=require(_0x81d1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x81d1('0xa'));var _=require('lodash');var squel=require(_0x81d1('0xb'));var crypto=require(_0x81d1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x81d1('0xd'));var toCsv=require(_0x81d1('0x9'));var querystring=require(_0x81d1('0xe'));var Papa=require(_0x81d1('0xf'));var Redis=require(_0x81d1('0x10'));var authService=require(_0x81d1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81d1('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x81d1('0x13'));var config=require(_0x81d1('0x14'));var licenseUtil=require(_0x81d1('0x15'));var db=require(_0x81d1('0x16'))['db'];function respondWithStatusCode(_0x1a3b35,_0x1d53e0){_0x1d53e0=_0x1d53e0||0xcc;return function(_0x5d2329){if(_0x5d2329){return _0x1a3b35[_0x81d1('0x17')](_0x1d53e0);}return _0x1a3b35['status'](_0x1d53e0)[_0x81d1('0x18')]();};}function respondWithResult(_0x598d4a,_0x3548e2){_0x3548e2=_0x3548e2||0xc8;return function(_0x277983){if(_0x277983){return _0x598d4a[_0x81d1('0x19')](_0x3548e2)[_0x81d1('0x1a')](_0x277983);}};}function respondWithFilteredResult(_0x1f1f9b,_0x24515e){return function(_0x3f209e){if(_0x3f209e){var _0x3e2c03=typeof _0x24515e['offset']===_0x81d1('0x1b')&&typeof _0x24515e[_0x81d1('0x1c')]==='undefined';var _0x2e54d5=_0x3f209e[_0x81d1('0x1d')];var _0x5b0715=_0x3e2c03?0x0:_0x24515e[_0x81d1('0x1e')];var _0x269301=_0x3e2c03?_0x3f209e[_0x81d1('0x1d')]:_0x24515e[_0x81d1('0x1e')]+_0x24515e[_0x81d1('0x1c')];var _0x21394c;if(_0x269301>=_0x2e54d5){_0x269301=_0x2e54d5;_0x21394c=0xc8;}else{_0x21394c=0xce;}_0x1f1f9b[_0x81d1('0x19')](_0x21394c);return _0x1f1f9b[_0x81d1('0x1f')](_0x81d1('0x20'),_0x5b0715+'-'+_0x269301+'/'+_0x2e54d5)[_0x81d1('0x1a')](_0x3f209e);}return null;};}function patchUpdates(_0x2cb9d4){return function(_0x1b1d50){try{jsonpatch[_0x81d1('0x21')](_0x1b1d50,_0x2cb9d4,!![]);}catch(_0x1fd836){return BPromise[_0x81d1('0x22')](_0x1fd836);}return _0x1b1d50['save']();};}function saveUpdates(_0x3752f0,_0x16cf44){return function(_0x1f25f8){if(_0x1f25f8){return _0x1f25f8[_0x81d1('0x23')](_0x3752f0)[_0x81d1('0x24')](function(_0x26ec0b){return _0x26ec0b;});}return null;};}function removeEntity(_0x24fadb,_0x73bf5){return function(_0x52ab2b){if(_0x52ab2b){return _0x52ab2b[_0x81d1('0x25')]()[_0x81d1('0x24')](function(){_0x24fadb['status'](0xcc)[_0x81d1('0x18')]();});}};}function handleEntityNotFound(_0x3d853b,_0x2b4df1){return function(_0x52e2d4){if(!_0x52e2d4){_0x3d853b[_0x81d1('0x17')](0x194);}return _0x52e2d4;};}function handleError(_0x429e23,_0x3b49b2){_0x3b49b2=_0x3b49b2||0x1f4;return function(_0x2cdb5c){logger['error'](_0x2cdb5c[_0x81d1('0x26')]);if(_0x2cdb5c[_0x81d1('0x27')]){delete _0x2cdb5c[_0x81d1('0x27')];}_0x429e23['status'](_0x3b49b2)[_0x81d1('0x28')](_0x2cdb5c);};}exports[_0x81d1('0x29')]=function(_0x140a12,_0xaad427){var _0x29e040={},_0x52f094={},_0x27c173={'count':0x0,'rows':[]};var _0x40e14e=_[_0x81d1('0x2a')](db['SmsQueueReport']['rawAttributes'],function(_0x4b2479){return{'name':_0x4b2479[_0x81d1('0x2b')],'type':_0x4b2479[_0x81d1('0x2c')]['key']};});_0x52f094[_0x81d1('0x2d')]=_['map'](_0x40e14e,'name');_0x52f094[_0x81d1('0x2e')]=_[_0x81d1('0x2f')](_0x140a12[_0x81d1('0x2e')]);_0x52f094[_0x81d1('0x30')]=_[_0x81d1('0x31')](_0x52f094[_0x81d1('0x2d')],_0x52f094[_0x81d1('0x2e')]);_0x29e040[_0x81d1('0x32')]=_[_0x81d1('0x31')](_0x52f094[_0x81d1('0x2d')],qs[_0x81d1('0x33')](_0x140a12[_0x81d1('0x2e')][_0x81d1('0x33')]));_0x29e040['attributes']=_0x29e040[_0x81d1('0x32')][_0x81d1('0x34')]?_0x29e040[_0x81d1('0x32')]:_0x52f094[_0x81d1('0x2d')];if(!_0x140a12[_0x81d1('0x2e')][_0x81d1('0x35')](_0x81d1('0x36'))){_0x29e040[_0x81d1('0x1c')]=qs['limit'](_0x140a12[_0x81d1('0x2e')][_0x81d1('0x1c')]);_0x29e040[_0x81d1('0x1e')]=qs['offset'](_0x140a12[_0x81d1('0x2e')][_0x81d1('0x1e')]);}_0x29e040[_0x81d1('0x37')]=qs[_0x81d1('0x38')](_0x140a12[_0x81d1('0x2e')][_0x81d1('0x38')]);_0x29e040[_0x81d1('0x39')]=qs['filters'](_[_0x81d1('0x3a')](_0x140a12[_0x81d1('0x2e')],_0x52f094[_0x81d1('0x30')]),_0x40e14e);if(_0x140a12[_0x81d1('0x2e')][_0x81d1('0x3b')]){_0x29e040[_0x81d1('0x39')]=_[_0x81d1('0x3c')](_0x29e040[_0x81d1('0x39')],{'$or':_[_0x81d1('0x2a')](_0x40e14e,function(_0x4ce14d){if(_0x4ce14d['type']!==_0x81d1('0x3d')){var _0x5ae910={};_0x5ae910[_0x4ce14d[_0x81d1('0x27')]]={'$like':'%'+_0x140a12[_0x81d1('0x2e')][_0x81d1('0x3b')]+'%'};return _0x5ae910;}})});}_0x29e040=_[_0x81d1('0x3c')]({},_0x29e040,_0x140a12[_0x81d1('0x3e')]);var _0x552056={'where':_0x29e040['where']};return db[_0x81d1('0x3f')][_0x81d1('0x1d')](_0x552056)[_0x81d1('0x24')](function(_0x85246b){_0x27c173['count']=_0x85246b;if(_0x140a12['query']['includeAll']){_0x29e040[_0x81d1('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x81d1('0x41')](_0x29e040);})['then'](function(_0x4e56a8){_0x27c173[_0x81d1('0x42')]=_0x4e56a8;return _0x27c173;})['then'](respondWithFilteredResult(_0xaad427,_0x29e040))['catch'](handleError(_0xaad427,null));};exports['show']=function(_0x307196,_0x11df9f){var _0xe7050e={'raw':!![],'where':{'id':_0x307196[_0x81d1('0x43')]['id']}},_0x45943b={};_0x45943b[_0x81d1('0x2d')]=_[_0x81d1('0x2f')](db['SmsQueueReport'][_0x81d1('0x44')]);_0x45943b[_0x81d1('0x2e')]=_[_0x81d1('0x2f')](_0x307196[_0x81d1('0x2e')]);_0x45943b[_0x81d1('0x30')]=_[_0x81d1('0x31')](_0x45943b[_0x81d1('0x2d')],_0x45943b['query']);_0xe7050e[_0x81d1('0x32')]=_[_0x81d1('0x31')](_0x45943b[_0x81d1('0x2d')],qs['fields'](_0x307196[_0x81d1('0x2e')]['fields']));_0xe7050e[_0x81d1('0x32')]=_0xe7050e[_0x81d1('0x32')]['length']?_0xe7050e[_0x81d1('0x32')]:_0x45943b[_0x81d1('0x2d')];if(_0x307196[_0x81d1('0x2e')][_0x81d1('0x45')]){_0xe7050e[_0x81d1('0x40')]=[{'all':!![]}];}_0xe7050e=_[_0x81d1('0x3c')]({},_0xe7050e,_0x307196[_0x81d1('0x3e')]);return db[_0x81d1('0x3f')][_0x81d1('0x46')](_0xe7050e)[_0x81d1('0x24')](handleEntityNotFound(_0x11df9f,null))[_0x81d1('0x24')](respondWithResult(_0x11df9f,null))['catch'](handleError(_0x11df9f,null));};exports[_0x81d1('0x47')]=function(_0x2dc445,_0x4ca928){return db[_0x81d1('0x3f')][_0x81d1('0x47')](_0x2dc445[_0x81d1('0x48')],{})['then'](respondWithResult(_0x4ca928,0xc9))['catch'](handleError(_0x4ca928,null));};exports[_0x81d1('0x23')]=function(_0x90ad93,_0x171ee5){if(_0x90ad93['body']['id']){delete _0x90ad93['body']['id'];}return db[_0x81d1('0x3f')][_0x81d1('0x46')]({'where':{'id':_0x90ad93[_0x81d1('0x43')]['id']}})[_0x81d1('0x24')](handleEntityNotFound(_0x171ee5,null))[_0x81d1('0x24')](saveUpdates(_0x90ad93['body'],null))[_0x81d1('0x24')](respondWithResult(_0x171ee5,null))['catch'](handleError(_0x171ee5,null));};exports[_0x81d1('0x25')]=function(_0x4f7e6,_0x3e66aa){return db[_0x81d1('0x3f')][_0x81d1('0x46')]({'where':{'id':_0x4f7e6[_0x81d1('0x43')]['id']}})[_0x81d1('0x24')](handleEntityNotFound(_0x3e66aa,null))[_0x81d1('0x24')](removeEntity(_0x3e66aa,null))['catch'](handleError(_0x3e66aa,null));};exports[_0x81d1('0x49')]=function(_0x19606f,_0x1edb0c){return db[_0x81d1('0x3f')][_0x81d1('0x49')]()[_0x81d1('0x24')](respondWithResult(_0x1edb0c,null))[_0x81d1('0x4a')](handleError(_0x1edb0c,null));}; \ No newline at end of file +var _0x6970=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','then','name','map','SmsQueueReport','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','show','rawAttributes','include','find','create','body','update','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x414594,_0xfc8177){var _0x30700c=function(_0x4668f4){while(--_0x4668f4){_0x414594['push'](_0x414594['shift']());}};_0x30700c(++_0xfc8177);}(_0x6970,0x102));var _0x0697=function(_0x353e5b,_0x2fd6e1){_0x353e5b=_0x353e5b-0x0;var _0xbcb30d=_0x6970[_0x353e5b];return _0xbcb30d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0697('0x0'));var zipdir=require(_0x0697('0x1'));var jsonpatch=require(_0x0697('0x2'));var rp=require(_0x0697('0x3'));var moment=require(_0x0697('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0697('0x5'));var util=require(_0x0697('0x6'));var path=require(_0x0697('0x7'));var sox=require(_0x0697('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0697('0x9'));var _=require(_0x0697('0xa'));var squel=require(_0x0697('0xb'));var crypto=require('crypto');var jsforce=require(_0x0697('0xc'));var deskjs=require(_0x0697('0xd'));var toCsv=require(_0x0697('0xe'));var querystring=require(_0x0697('0xf'));var Papa=require(_0x0697('0x10'));var Redis=require('ioredis');var authService=require(_0x0697('0x11'));var qs=require(_0x0697('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0697('0x13'));var logger=require('../../config/logger')(_0x0697('0x14'));var utils=require(_0x0697('0x15'));var config=require(_0x0697('0x16'));var licenseUtil=require(_0x0697('0x17'));var db=require(_0x0697('0x18'))['db'];function respondWithStatusCode(_0x45116f,_0x489163){_0x489163=_0x489163||0xcc;return function(_0x2cfc10){if(_0x2cfc10){return _0x45116f[_0x0697('0x19')](_0x489163);}return _0x45116f[_0x0697('0x1a')](_0x489163)[_0x0697('0x1b')]();};}function respondWithResult(_0x366d61,_0x1cc5dc){_0x1cc5dc=_0x1cc5dc||0xc8;return function(_0x269d5d){if(_0x269d5d){return _0x366d61[_0x0697('0x1a')](_0x1cc5dc)['json'](_0x269d5d);}};}function respondWithFilteredResult(_0x32a35d,_0x5b6aac){return function(_0x59e091){if(_0x59e091){var _0x580d4a=typeof _0x5b6aac['offset']===_0x0697('0x1c')&&typeof _0x5b6aac[_0x0697('0x1d')]===_0x0697('0x1c');var _0x2bde38=_0x59e091[_0x0697('0x1e')];var _0x2b882a=_0x580d4a?0x0:_0x5b6aac['offset'];var _0x130d99=_0x580d4a?_0x59e091[_0x0697('0x1e')]:_0x5b6aac[_0x0697('0x1f')]+_0x5b6aac[_0x0697('0x1d')];var _0x485297;if(_0x130d99>=_0x2bde38){_0x130d99=_0x2bde38;_0x485297=0xc8;}else{_0x485297=0xce;}_0x32a35d[_0x0697('0x1a')](_0x485297);return _0x32a35d[_0x0697('0x20')](_0x0697('0x21'),_0x2b882a+'-'+_0x130d99+'/'+_0x2bde38)['json'](_0x59e091);}return null;};}function patchUpdates(_0x249dd6){return function(_0x2a17d4){try{jsonpatch['apply'](_0x2a17d4,_0x249dd6,!![]);}catch(_0xaa5155){return BPromise[_0x0697('0x22')](_0xaa5155);}return _0x2a17d4[_0x0697('0x23')]();};}function saveUpdates(_0x104208,_0x46cb75){return function(_0x1b124c){if(_0x1b124c){return _0x1b124c['update'](_0x104208)['then'](function(_0x461993){return _0x461993;});}return null;};}function removeEntity(_0x5cbe52,_0xaccf0e){return function(_0x150fa2){if(_0x150fa2){return _0x150fa2[_0x0697('0x24')]()[_0x0697('0x25')](function(){_0x5cbe52[_0x0697('0x1a')](0xcc)[_0x0697('0x1b')]();});}};}function handleEntityNotFound(_0x3d4719,_0x4c6270){return function(_0x87965a){if(!_0x87965a){_0x3d4719[_0x0697('0x19')](0x194);}return _0x87965a;};}function handleError(_0x382cc1,_0x15a9b2){_0x15a9b2=_0x15a9b2||0x1f4;return function(_0xbe842e){logger['error'](_0xbe842e['stack']);if(_0xbe842e[_0x0697('0x26')]){delete _0xbe842e['name'];}_0x382cc1[_0x0697('0x1a')](_0x15a9b2)['send'](_0xbe842e);};}exports['index']=function(_0x2d53f8,_0x4ce006){var _0x2f4ba0={},_0x5585be={},_0xd7c884={'count':0x0,'rows':[]};var _0x483fec=_[_0x0697('0x27')](db[_0x0697('0x28')]['rawAttributes'],function(_0x6e9737){return{'name':_0x6e9737['fieldName'],'type':_0x6e9737['type'][_0x0697('0x29')]};});_0x5585be['model']=_[_0x0697('0x27')](_0x483fec,_0x0697('0x26'));_0x5585be[_0x0697('0x2a')]=_[_0x0697('0x2b')](_0x2d53f8[_0x0697('0x2a')]);_0x5585be[_0x0697('0x2c')]=_[_0x0697('0x2d')](_0x5585be[_0x0697('0x2e')],_0x5585be['query']);_0x2f4ba0[_0x0697('0x2f')]=_[_0x0697('0x2d')](_0x5585be['model'],qs[_0x0697('0x30')](_0x2d53f8['query'][_0x0697('0x30')]));_0x2f4ba0[_0x0697('0x2f')]=_0x2f4ba0[_0x0697('0x2f')][_0x0697('0x31')]?_0x2f4ba0[_0x0697('0x2f')]:_0x5585be['model'];if(!_0x2d53f8[_0x0697('0x2a')][_0x0697('0x32')](_0x0697('0x33'))){_0x2f4ba0['limit']=qs['limit'](_0x2d53f8[_0x0697('0x2a')][_0x0697('0x1d')]);_0x2f4ba0[_0x0697('0x1f')]=qs['offset'](_0x2d53f8['query'][_0x0697('0x1f')]);}_0x2f4ba0[_0x0697('0x34')]=qs[_0x0697('0x35')](_0x2d53f8[_0x0697('0x2a')][_0x0697('0x35')]);_0x2f4ba0[_0x0697('0x36')]=qs[_0x0697('0x2c')](_[_0x0697('0x37')](_0x2d53f8[_0x0697('0x2a')],_0x5585be[_0x0697('0x2c')]),_0x483fec);if(_0x2d53f8['query']['filter']){_0x2f4ba0['where']=_[_0x0697('0x38')](_0x2f4ba0['where'],{'$or':_[_0x0697('0x27')](_0x483fec,function(_0x4dde9f){if(_0x4dde9f['type']!=='VIRTUAL'){var _0x409181={};_0x409181[_0x4dde9f[_0x0697('0x26')]]={'$like':'%'+_0x2d53f8[_0x0697('0x2a')][_0x0697('0x39')]+'%'};return _0x409181;}})});}_0x2f4ba0=_[_0x0697('0x38')]({},_0x2f4ba0,_0x2d53f8[_0x0697('0x3a')]);var _0x3e86be={'where':_0x2f4ba0[_0x0697('0x36')]};return db[_0x0697('0x28')][_0x0697('0x1e')](_0x3e86be)[_0x0697('0x25')](function(_0x49d117){_0xd7c884['count']=_0x49d117;if(_0x2d53f8['query'][_0x0697('0x3b')]){_0x2f4ba0['include']=[{'all':!![]}];}return db[_0x0697('0x28')][_0x0697('0x3c')](_0x2f4ba0);})[_0x0697('0x25')](function(_0x364859){_0xd7c884['rows']=_0x364859;return _0xd7c884;})[_0x0697('0x25')](respondWithFilteredResult(_0x4ce006,_0x2f4ba0))['catch'](handleError(_0x4ce006,null));};exports[_0x0697('0x3d')]=function(_0x46d584,_0x22248c){var _0x5b0c5c={'raw':!![],'where':{'id':_0x46d584['params']['id']}},_0x1fc034={};_0x1fc034['model']=_[_0x0697('0x2b')](db[_0x0697('0x28')][_0x0697('0x3e')]);_0x1fc034['query']=_[_0x0697('0x2b')](_0x46d584[_0x0697('0x2a')]);_0x1fc034[_0x0697('0x2c')]=_['intersection'](_0x1fc034[_0x0697('0x2e')],_0x1fc034[_0x0697('0x2a')]);_0x5b0c5c[_0x0697('0x2f')]=_[_0x0697('0x2d')](_0x1fc034['model'],qs[_0x0697('0x30')](_0x46d584[_0x0697('0x2a')][_0x0697('0x30')]));_0x5b0c5c[_0x0697('0x2f')]=_0x5b0c5c['attributes'][_0x0697('0x31')]?_0x5b0c5c[_0x0697('0x2f')]:_0x1fc034['model'];if(_0x46d584['query'][_0x0697('0x3b')]){_0x5b0c5c[_0x0697('0x3f')]=[{'all':!![]}];}_0x5b0c5c=_[_0x0697('0x38')]({},_0x5b0c5c,_0x46d584[_0x0697('0x3a')]);return db[_0x0697('0x28')][_0x0697('0x40')](_0x5b0c5c)[_0x0697('0x25')](handleEntityNotFound(_0x22248c,null))[_0x0697('0x25')](respondWithResult(_0x22248c,null))['catch'](handleError(_0x22248c,null));};exports[_0x0697('0x41')]=function(_0x59fd30,_0x38eb07){return db[_0x0697('0x28')][_0x0697('0x41')](_0x59fd30[_0x0697('0x42')],{})[_0x0697('0x25')](respondWithResult(_0x38eb07,0xc9))['catch'](handleError(_0x38eb07,null));};exports[_0x0697('0x43')]=function(_0x4039d0,_0x47818d){if(_0x4039d0[_0x0697('0x42')]['id']){delete _0x4039d0[_0x0697('0x42')]['id'];}return db[_0x0697('0x28')]['find']({'where':{'id':_0x4039d0[_0x0697('0x44')]['id']}})[_0x0697('0x25')](handleEntityNotFound(_0x47818d,null))[_0x0697('0x25')](saveUpdates(_0x4039d0[_0x0697('0x42')],null))[_0x0697('0x25')](respondWithResult(_0x47818d,null))[_0x0697('0x45')](handleError(_0x47818d,null));};exports[_0x0697('0x24')]=function(_0x4a3773,_0x41f5a0){return db['SmsQueueReport'][_0x0697('0x40')]({'where':{'id':_0x4a3773[_0x0697('0x44')]['id']}})['then'](handleEntityNotFound(_0x41f5a0,null))[_0x0697('0x25')](removeEntity(_0x41f5a0,null))[_0x0697('0x45')](handleError(_0x41f5a0,null));};exports['describe']=function(_0x58b752,_0x2efdea){return db[_0x0697('0x28')]['describe']()['then'](respondWithResult(_0x2efdea,null))[_0x0697('0x45')](handleError(_0x2efdea,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index c9c8e9e..43d6fcc 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x16719f,_0x10e6cc){var _0x823dfd=function(_0x5e5b61){while(--_0x5e5b61){_0x16719f['push'](_0x16719f['shift']());}};_0x823dfd(++_0x10e6cc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xb7e7[_0x75f869];return _0x10af8b;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 14507cf..c4aa7b1 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 _0x80ac=['options','raw','catch','UpdateSmsQueueReport','where','attributes','limit','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','body'];(function(_0x35ba0a,_0x57eaeb){var _0x4bddb0=function(_0x4a5600){while(--_0x4a5600){_0x35ba0a['push'](_0x35ba0a['shift']());}};_0x4bddb0(++_0x57eaeb);}(_0x80ac,0x131));var _0xc80a=function(_0x2b6902,_0x5e686f){_0x2b6902=_0x2b6902-0x0;var _0x54255f=_0x80ac[_0x2b6902];return _0x54255f;};'use strict';var _=require(_0xc80a('0x0'));var util=require(_0xc80a('0x1'));var moment=require(_0xc80a('0x2'));var BPromise=require('bluebird');var rs=require(_0xc80a('0x3'));var fs=require('fs');var Redis=require(_0xc80a('0x4'));var db=require(_0xc80a('0x5'))['db'];var utils=require(_0xc80a('0x6'));var logger=require('../../config/logger')(_0xc80a('0x7'));var config=require(_0xc80a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc80a('0x9')][_0xc80a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2360f8,_0x53b28d,_0x58ee1d){return new BPromise(function(_0x265fe7,_0x294300){return client[_0xc80a('0xb')](_0x2360f8,_0x58ee1d)['then'](function(_0x2d3c00){logger[_0xc80a('0xc')](_0xc80a('0xd'),_0x53b28d,_0xc80a('0xe'));logger[_0xc80a('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x53b28d,_0xc80a('0xe'),JSON[_0xc80a('0x10')](_0x2d3c00));if(_0x2d3c00[_0xc80a('0x11')]){if(_0x2d3c00['error'][_0xc80a('0x12')]===0x1f4){logger[_0xc80a('0x11')](_0xc80a('0xd'),_0x53b28d,_0x2d3c00[_0xc80a('0x11')][_0xc80a('0x13')]);return _0x294300(_0x2d3c00[_0xc80a('0x11')][_0xc80a('0x13')]);}logger[_0xc80a('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x53b28d,_0x2d3c00[_0xc80a('0x11')][_0xc80a('0x13')]);return _0x265fe7(_0x2d3c00[_0xc80a('0x11')]['message']);}else{logger[_0xc80a('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x53b28d,'request\x20sent');_0x265fe7(_0x2d3c00[_0xc80a('0x14')][_0xc80a('0x13')]);}})['catch'](function(_0x5772e5){logger[_0xc80a('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x53b28d,_0x5772e5);_0x294300(_0x5772e5);});});}exports[_0xc80a('0x15')]=function(_0x297c47){var _0x14ff2a=this;return new Promise(function(_0x489e50,_0x587d0f){return db[_0xc80a('0x16')][_0xc80a('0x17')](_0x297c47[_0xc80a('0x18')],{'raw':_0x297c47['options']?_0x297c47[_0xc80a('0x19')][_0xc80a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5f514c){logger[_0xc80a('0xc')](_0xc80a('0x15'),_0x297c47);logger[_0xc80a('0xf')](_0xc80a('0x15'),_0x297c47,JSON[_0xc80a('0x10')](_0x5f514c));_0x489e50(_0x5f514c);})[_0xc80a('0x1b')](function(_0x5b8643){logger[_0xc80a('0x11')](_0xc80a('0x15'),_0x5b8643['message'],_0x297c47);_0x587d0f(_0x14ff2a[_0xc80a('0x11')](0x1f4,_0x5b8643[_0xc80a('0x13')]));});});};exports[_0xc80a('0x1c')]=function(_0x9fcfe6){var _0x310a14=this;return new Promise(function(_0xefbad2,_0x2919e6){return db['SmsQueueReport']['update'](_0x9fcfe6[_0xc80a('0x18')],{'raw':_0x9fcfe6['options']?_0x9fcfe6[_0xc80a('0x19')][_0xc80a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9fcfe6[_0xc80a('0x19')]?_0x9fcfe6['options'][_0xc80a('0x1d')]||null:null,'attributes':_0x9fcfe6[_0xc80a('0x19')]?_0x9fcfe6['options'][_0xc80a('0x1e')]||null:null,'limit':_0x9fcfe6[_0xc80a('0x19')]?_0x9fcfe6['options'][_0xc80a('0x1f')]||null:null})[_0xc80a('0x20')](function(_0xc683f3){logger[_0xc80a('0xc')]('UpdateSmsQueueReport',_0x9fcfe6);logger[_0xc80a('0xf')](_0xc80a('0x1c'),_0x9fcfe6,JSON[_0xc80a('0x10')](_0xc683f3));_0xefbad2(_0xc683f3);})[_0xc80a('0x1b')](function(_0x119ddb){logger[_0xc80a('0x11')](_0xc80a('0x1c'),_0x119ddb[_0xc80a('0x13')],_0x9fcfe6);_0x2919e6(_0x310a14[_0xc80a('0x11')](0x1f4,_0x119ddb['message']));});});}; \ No newline at end of file +var _0x899d=['request','then','info','request\x20sent','debug','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','create','options','raw','SmsQueueReport','update','body','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5c9d90,_0x67a0f){var _0x6bca4c=function(_0x8931b2){while(--_0x8931b2){_0x5c9d90['push'](_0x5c9d90['shift']());}};_0x6bca4c(++_0x67a0f);}(_0x899d,0x160));var _0xd899=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x899d[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xd899('0x0'));var util=require(_0xd899('0x1'));var moment=require(_0xd899('0x2'));var BPromise=require(_0xd899('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd899('0x4'));var db=require(_0xd899('0x5'))['db'];var utils=require(_0xd899('0x6'));var logger=require(_0xd899('0x7'))('rpc');var config=require(_0xd899('0x8'));var jayson=require(_0xd899('0x9'));var client=jayson[_0xd899('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x63f31b,_0x29b977,_0xb3b452){return new BPromise(function(_0x1ee811,_0x39ea09){return client[_0xd899('0xb')](_0x63f31b,_0xb3b452)[_0xd899('0xc')](function(_0x301f1b){logger[_0xd899('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x29b977,_0xd899('0xe'));logger[_0xd899('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x29b977,_0xd899('0xe'),JSON[_0xd899('0x10')](_0x301f1b));if(_0x301f1b[_0xd899('0x11')]){if(_0x301f1b[_0xd899('0x11')][_0xd899('0x12')]===0x1f4){logger[_0xd899('0x11')](_0xd899('0x13'),_0x29b977,_0x301f1b[_0xd899('0x11')][_0xd899('0x14')]);return _0x39ea09(_0x301f1b[_0xd899('0x11')]['message']);}logger['error'](_0xd899('0x13'),_0x29b977,_0x301f1b[_0xd899('0x11')][_0xd899('0x14')]);return _0x1ee811(_0x301f1b[_0xd899('0x11')][_0xd899('0x14')]);}else{logger[_0xd899('0xd')](_0xd899('0x13'),_0x29b977,_0xd899('0xe'));_0x1ee811(_0x301f1b['result'][_0xd899('0x14')]);}})[_0xd899('0x15')](function(_0x29b99d){logger['error'](_0xd899('0x13'),_0x29b977,_0x29b99d);_0x39ea09(_0x29b99d);});});}exports[_0xd899('0x16')]=function(_0x2d98ca){var _0x34d02a=this;return new Promise(function(_0x5ac690,_0x18910d){return db['SmsQueueReport'][_0xd899('0x17')](_0x2d98ca['body'],{'raw':_0x2d98ca[_0xd899('0x18')]?_0x2d98ca[_0xd899('0x18')][_0xd899('0x19')]===undefined?!![]:![]:!![]})[_0xd899('0xc')](function(_0x133d30){logger['info'](_0xd899('0x16'),_0x2d98ca);logger['debug']('CreateSmsQueueReport',_0x2d98ca,JSON[_0xd899('0x10')](_0x133d30));_0x5ac690(_0x133d30);})[_0xd899('0x15')](function(_0x58b719){logger[_0xd899('0x11')](_0xd899('0x16'),_0x58b719[_0xd899('0x14')],_0x2d98ca);_0x18910d(_0x34d02a[_0xd899('0x11')](0x1f4,_0x58b719[_0xd899('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x4321f7){var _0x275657=this;return new Promise(function(_0x451b4c,_0x1363c8){return db[_0xd899('0x1a')][_0xd899('0x1b')](_0x4321f7[_0xd899('0x1c')],{'raw':_0x4321f7['options']?_0x4321f7[_0xd899('0x18')][_0xd899('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4321f7[_0xd899('0x18')]?_0x4321f7[_0xd899('0x18')][_0xd899('0x1d')]||null:null,'attributes':_0x4321f7[_0xd899('0x18')]?_0x4321f7[_0xd899('0x18')][_0xd899('0x1e')]||null:null,'limit':_0x4321f7[_0xd899('0x18')]?_0x4321f7[_0xd899('0x18')][_0xd899('0x1f')]||null:null})[_0xd899('0xc')](function(_0x96c76a){logger[_0xd899('0xd')](_0xd899('0x20'),_0x4321f7);logger['debug'](_0xd899('0x20'),_0x4321f7,JSON['stringify'](_0x96c76a));_0x451b4c(_0x96c76a);})[_0xd899('0x15')](function(_0x51be12){logger[_0xd899('0x11')]('UpdateSmsQueueReport',_0x51be12[_0xd899('0x14')],_0x4321f7);_0x1363c8(_0x275657['error'](0x1f4,_0x51be12[_0xd899('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index f7ce912..50530e3 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 _0x7da7=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x7adc9f,_0xd98ac9){var _0x8d4c7a=function(_0x37af19){while(--_0x37af19){_0x7adc9f['push'](_0x7adc9f['shift']());}};_0x8d4c7a(++_0xd98ac9);}(_0x7da7,0x10d));var _0x77da=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0x7da7[_0x272d90];return _0x2bf4a2;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./smsTransferReport.controller');router[_0x77da('0x7')]('/',auth[_0x77da('0x8')](),controller['index']);router[_0x77da('0x7')]('/describe',auth[_0x77da('0x8')](),controller[_0x77da('0x9')]);router[_0x77da('0x7')](_0x77da('0xa'),auth[_0x77da('0x8')](),controller['show']);router[_0x77da('0xb')]('/',auth[_0x77da('0x8')](),controller[_0x77da('0xc')]);router['put'](_0x77da('0xa'),auth[_0x77da('0x8')](),controller[_0x77da('0xd')]);router[_0x77da('0xe')]('/:id',auth[_0x77da('0x8')](),controller[_0x77da('0xf')]);module[_0x77da('0x10')]=router; \ No newline at end of file +var _0x8c46=['destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1a6bde,_0x3e8809){var _0x490911=function(_0x1da913){while(--_0x1da913){_0x1a6bde['push'](_0x1a6bde['shift']());}};_0x490911(++_0x3e8809);}(_0x8c46,0x171));var _0x68c4=function(_0x14d874,_0x482fef){_0x14d874=_0x14d874-0x0;var _0x3f5289=_0x8c46[_0x14d874];return _0x3f5289;};'use strict';var multer=require(_0x68c4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x68c4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x68c4('0x2'));var auth=require(_0x68c4('0x3'));var interaction=require(_0x68c4('0x4'));var config=require(_0x68c4('0x5'));var controller=require(_0x68c4('0x6'));router[_0x68c4('0x7')]('/',auth[_0x68c4('0x8')](),controller[_0x68c4('0x9')]);router[_0x68c4('0x7')](_0x68c4('0xa'),auth['isAuthenticated'](),controller[_0x68c4('0xb')]);router[_0x68c4('0x7')](_0x68c4('0xc'),auth['isAuthenticated'](),controller[_0x68c4('0xd')]);router[_0x68c4('0xe')]('/',auth[_0x68c4('0x8')](),controller['create']);router['put'](_0x68c4('0xc'),auth[_0x68c4('0x8')](),controller['update']);router['delete'](_0x68c4('0xc'),auth[_0x68c4('0x8')](),controller[_0x68c4('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 8402322..82596b4 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5d7005,_0x41f35a){var _0x31ed20=function(_0x3624f8){while(--_0x3624f8){_0x5d7005['push'](_0x5d7005['shift']());}};_0x31ed20(++_0x41f35a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x00bb[_0x47e7cb];return _0x2a8874;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2ea28a,_0x4c9b3){_0x2ea28a=_0x2ea28a-0x0;var _0x138d21=_0xb43b[_0x2ea28a];return _0x138d21;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9ad79e8..7e58714 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 _0xa6b8=['undefined','limit','count','set','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset'];(function(_0x2f20f8,_0x54a3f2){var _0xfcb1b7=function(_0xfd0c0d){while(--_0xfd0c0d){_0x2f20f8['push'](_0x2f20f8['shift']());}};_0xfcb1b7(++_0x54a3f2);}(_0xa6b8,0x1bd));var _0x8a6b=function(_0x260375,_0x3029ec){_0x260375=_0x260375-0x0;var _0x130020=_0xa6b8[_0x260375];return _0x130020;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a6b('0x0'));var zipdir=require(_0x8a6b('0x1'));var jsonpatch=require(_0x8a6b('0x2'));var rp=require(_0x8a6b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8a6b('0x4'));var util=require(_0x8a6b('0x5'));var path=require(_0x8a6b('0x6'));var sox=require(_0x8a6b('0x7'));var csv=require(_0x8a6b('0x8'));var ejs=require(_0x8a6b('0x9'));var fs=require('fs');var fs_extra=require(_0x8a6b('0xa'));var _=require(_0x8a6b('0xb'));var squel=require(_0x8a6b('0xc'));var crypto=require('crypto');var jsforce=require(_0x8a6b('0xd'));var deskjs=require(_0x8a6b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8a6b('0xf'));var Papa=require('papaparse');var Redis=require(_0x8a6b('0x10'));var authService=require(_0x8a6b('0x11'));var qs=require(_0x8a6b('0x12'));var as=require(_0x8a6b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a6b('0x14'))(_0x8a6b('0x15'));var utils=require(_0x8a6b('0x16'));var config=require(_0x8a6b('0x17'));var licenseUtil=require(_0x8a6b('0x18'));var db=require(_0x8a6b('0x19'))['db'];function respondWithStatusCode(_0xb7f109,_0x43860b){_0x43860b=_0x43860b||0xcc;return function(_0x2603b7){if(_0x2603b7){return _0xb7f109['sendStatus'](_0x43860b);}return _0xb7f109[_0x8a6b('0x1a')](_0x43860b)[_0x8a6b('0x1b')]();};}function respondWithResult(_0x2cdb27,_0x549c97){_0x549c97=_0x549c97||0xc8;return function(_0x202c4b){if(_0x202c4b){return _0x2cdb27[_0x8a6b('0x1a')](_0x549c97)['json'](_0x202c4b);}};}function respondWithFilteredResult(_0x3f3b08,_0x4444e4){return function(_0x3ed90e){if(_0x3ed90e){var _0x47bd22=typeof _0x4444e4[_0x8a6b('0x1c')]===_0x8a6b('0x1d')&&typeof _0x4444e4[_0x8a6b('0x1e')]===_0x8a6b('0x1d');var _0x524649=_0x3ed90e[_0x8a6b('0x1f')];var _0x2253d3=_0x47bd22?0x0:_0x4444e4[_0x8a6b('0x1c')];var _0x2a3288=_0x47bd22?_0x3ed90e[_0x8a6b('0x1f')]:_0x4444e4['offset']+_0x4444e4[_0x8a6b('0x1e')];var _0x5dd3e6;if(_0x2a3288>=_0x524649){_0x2a3288=_0x524649;_0x5dd3e6=0xc8;}else{_0x5dd3e6=0xce;}_0x3f3b08['status'](_0x5dd3e6);return _0x3f3b08[_0x8a6b('0x20')]('Content-Range',_0x2253d3+'-'+_0x2a3288+'/'+_0x524649)[_0x8a6b('0x21')](_0x3ed90e);}return null;};}function patchUpdates(_0x494d58){return function(_0x169933){try{jsonpatch['apply'](_0x169933,_0x494d58,!![]);}catch(_0x8490f4){return BPromise[_0x8a6b('0x22')](_0x8490f4);}return _0x169933[_0x8a6b('0x23')]();};}function saveUpdates(_0x3f3936,_0x56bccb){return function(_0x3bf14c){if(_0x3bf14c){return _0x3bf14c[_0x8a6b('0x24')](_0x3f3936)[_0x8a6b('0x25')](function(_0x2447ea){return _0x2447ea;});}return null;};}function removeEntity(_0x4614ad,_0x324628){return function(_0x4303fe){if(_0x4303fe){return _0x4303fe[_0x8a6b('0x26')]()[_0x8a6b('0x25')](function(){_0x4614ad[_0x8a6b('0x1a')](0xcc)[_0x8a6b('0x1b')]();});}};}function handleEntityNotFound(_0x2fe3cd,_0x495857){return function(_0x4d7c19){if(!_0x4d7c19){_0x2fe3cd[_0x8a6b('0x27')](0x194);}return _0x4d7c19;};}function handleError(_0x1874ca,_0x54d220){_0x54d220=_0x54d220||0x1f4;return function(_0x22f382){logger[_0x8a6b('0x28')](_0x22f382[_0x8a6b('0x29')]);if(_0x22f382[_0x8a6b('0x2a')]){delete _0x22f382[_0x8a6b('0x2a')];}_0x1874ca[_0x8a6b('0x1a')](_0x54d220)[_0x8a6b('0x2b')](_0x22f382);};}exports[_0x8a6b('0x2c')]=function(_0x48515b,_0x564b15){var _0x3469a4={},_0x31d162={},_0x1c1797={'count':0x0,'rows':[]};var _0x4ad851=_[_0x8a6b('0x2d')](db[_0x8a6b('0x2e')][_0x8a6b('0x2f')],function(_0x4dcd6f){return{'name':_0x4dcd6f[_0x8a6b('0x30')],'type':_0x4dcd6f['type']['key']};});_0x31d162[_0x8a6b('0x31')]=_[_0x8a6b('0x2d')](_0x4ad851,_0x8a6b('0x2a'));_0x31d162['query']=_[_0x8a6b('0x32')](_0x48515b[_0x8a6b('0x33')]);_0x31d162['filters']=_[_0x8a6b('0x34')](_0x31d162[_0x8a6b('0x31')],_0x31d162[_0x8a6b('0x33')]);_0x3469a4['attributes']=_[_0x8a6b('0x34')](_0x31d162['model'],qs['fields'](_0x48515b[_0x8a6b('0x33')][_0x8a6b('0x35')]));_0x3469a4[_0x8a6b('0x36')]=_0x3469a4[_0x8a6b('0x36')][_0x8a6b('0x37')]?_0x3469a4[_0x8a6b('0x36')]:_0x31d162[_0x8a6b('0x31')];if(!_0x48515b[_0x8a6b('0x33')][_0x8a6b('0x38')](_0x8a6b('0x39'))){_0x3469a4[_0x8a6b('0x1e')]=qs['limit'](_0x48515b[_0x8a6b('0x33')]['limit']);_0x3469a4[_0x8a6b('0x1c')]=qs[_0x8a6b('0x1c')](_0x48515b[_0x8a6b('0x33')][_0x8a6b('0x1c')]);}_0x3469a4[_0x8a6b('0x3a')]=qs[_0x8a6b('0x3b')](_0x48515b[_0x8a6b('0x33')][_0x8a6b('0x3b')]);_0x3469a4[_0x8a6b('0x3c')]=qs[_0x8a6b('0x3d')](_[_0x8a6b('0x3e')](_0x48515b[_0x8a6b('0x33')],_0x31d162[_0x8a6b('0x3d')]),_0x4ad851);if(_0x48515b[_0x8a6b('0x33')][_0x8a6b('0x3f')]){_0x3469a4[_0x8a6b('0x3c')]=_[_0x8a6b('0x40')](_0x3469a4['where'],{'$or':_['map'](_0x4ad851,function(_0x415362){if(_0x415362[_0x8a6b('0x41')]!==_0x8a6b('0x42')){var _0x465a60={};_0x465a60[_0x415362[_0x8a6b('0x2a')]]={'$like':'%'+_0x48515b[_0x8a6b('0x33')]['filter']+'%'};return _0x465a60;}})});}_0x3469a4=_[_0x8a6b('0x40')]({},_0x3469a4,_0x48515b[_0x8a6b('0x43')]);var _0x36a0df={'where':_0x3469a4[_0x8a6b('0x3c')]};return db[_0x8a6b('0x2e')]['count'](_0x36a0df)['then'](function(_0x807f35){_0x1c1797[_0x8a6b('0x1f')]=_0x807f35;if(_0x48515b[_0x8a6b('0x33')][_0x8a6b('0x44')]){_0x3469a4[_0x8a6b('0x45')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x8a6b('0x46')](_0x3469a4);})[_0x8a6b('0x25')](function(_0x552c91){_0x1c1797[_0x8a6b('0x47')]=_0x552c91;return _0x1c1797;})[_0x8a6b('0x25')](respondWithFilteredResult(_0x564b15,_0x3469a4))['catch'](handleError(_0x564b15,null));};exports[_0x8a6b('0x48')]=function(_0x4d8155,_0x2f25ca){var _0x5d6a9f={'raw':!![],'where':{'id':_0x4d8155[_0x8a6b('0x49')]['id']}},_0x4036b5={};_0x4036b5[_0x8a6b('0x31')]=_[_0x8a6b('0x32')](db['SmsTransferReport']['rawAttributes']);_0x4036b5[_0x8a6b('0x33')]=_[_0x8a6b('0x32')](_0x4d8155[_0x8a6b('0x33')]);_0x4036b5[_0x8a6b('0x3d')]=_['intersection'](_0x4036b5[_0x8a6b('0x31')],_0x4036b5[_0x8a6b('0x33')]);_0x5d6a9f[_0x8a6b('0x36')]=_[_0x8a6b('0x34')](_0x4036b5['model'],qs[_0x8a6b('0x35')](_0x4d8155[_0x8a6b('0x33')][_0x8a6b('0x35')]));_0x5d6a9f['attributes']=_0x5d6a9f['attributes'][_0x8a6b('0x37')]?_0x5d6a9f['attributes']:_0x4036b5['model'];if(_0x4d8155[_0x8a6b('0x33')][_0x8a6b('0x44')]){_0x5d6a9f[_0x8a6b('0x45')]=[{'all':!![]}];}_0x5d6a9f=_[_0x8a6b('0x40')]({},_0x5d6a9f,_0x4d8155[_0x8a6b('0x43')]);return db[_0x8a6b('0x2e')][_0x8a6b('0x4a')](_0x5d6a9f)[_0x8a6b('0x25')](handleEntityNotFound(_0x2f25ca,null))['then'](respondWithResult(_0x2f25ca,null))[_0x8a6b('0x4b')](handleError(_0x2f25ca,null));};exports[_0x8a6b('0x4c')]=function(_0x42b9c8,_0x5de4cc){return db[_0x8a6b('0x2e')]['create'](_0x42b9c8[_0x8a6b('0x4d')],{})[_0x8a6b('0x25')](respondWithResult(_0x5de4cc,0xc9))['catch'](handleError(_0x5de4cc,null));};exports[_0x8a6b('0x24')]=function(_0x3e90a5,_0x489123){if(_0x3e90a5[_0x8a6b('0x4d')]['id']){delete _0x3e90a5[_0x8a6b('0x4d')]['id'];}return db['SmsTransferReport'][_0x8a6b('0x4a')]({'where':{'id':_0x3e90a5[_0x8a6b('0x49')]['id']}})[_0x8a6b('0x25')](handleEntityNotFound(_0x489123,null))[_0x8a6b('0x25')](saveUpdates(_0x3e90a5[_0x8a6b('0x4d')],null))[_0x8a6b('0x25')](respondWithResult(_0x489123,null))[_0x8a6b('0x4b')](handleError(_0x489123,null));};exports[_0x8a6b('0x26')]=function(_0xf1b98f,_0x13134a){return db[_0x8a6b('0x2e')]['find']({'where':{'id':_0xf1b98f[_0x8a6b('0x49')]['id']}})[_0x8a6b('0x25')](handleEntityNotFound(_0x13134a,null))[_0x8a6b('0x25')](removeEntity(_0x13134a,null))[_0x8a6b('0x4b')](handleError(_0x13134a,null));};exports['describe']=function(_0xaae2b4,_0x1213cb){return db[_0x8a6b('0x2e')][_0x8a6b('0x4e')]()['then'](respondWithResult(_0x1213cb,null))[_0x8a6b('0x4b')](handleError(_0x1213cb,null));}; \ No newline at end of file +var _0x53f2=['options','includeAll','include','SmsTransferReport','findAll','rows','catch','show','params','fields','find','create','body','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','length','sort','where','merge','type','VIRTUAL','filter'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x53f2,0x95));var _0x253f=function(_0x2c34ac,_0x2940ba){_0x2c34ac=_0x2c34ac-0x0;var _0x9cc461=_0x53f2[_0x2c34ac];return _0x9cc461;};'use strict';var emlformat=require(_0x253f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x253f('0x1'));var rp=require(_0x253f('0x2'));var moment=require(_0x253f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x253f('0x4'));var util=require(_0x253f('0x5'));var path=require(_0x253f('0x6'));var sox=require('sox');var csv=require(_0x253f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x253f('0x8'));var _=require('lodash');var squel=require(_0x253f('0x9'));var crypto=require(_0x253f('0xa'));var jsforce=require(_0x253f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x253f('0xc'));var Papa=require(_0x253f('0xd'));var Redis=require(_0x253f('0xe'));var authService=require(_0x253f('0xf'));var qs=require(_0x253f('0x10'));var as=require(_0x253f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x253f('0x12'))(_0x253f('0x13'));var utils=require(_0x253f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x253f('0x15'));var db=require(_0x253f('0x16'))['db'];function respondWithStatusCode(_0x4a6fae,_0x28958e){_0x28958e=_0x28958e||0xcc;return function(_0x1521e1){if(_0x1521e1){return _0x4a6fae['sendStatus'](_0x28958e);}return _0x4a6fae['status'](_0x28958e)[_0x253f('0x17')]();};}function respondWithResult(_0x183a52,_0x313afb){_0x313afb=_0x313afb||0xc8;return function(_0x484ded){if(_0x484ded){return _0x183a52['status'](_0x313afb)[_0x253f('0x18')](_0x484ded);}};}function respondWithFilteredResult(_0x1d425c,_0x24de81){return function(_0x5aea83){if(_0x5aea83){var _0xd6275d=typeof _0x24de81[_0x253f('0x19')]==='undefined'&&typeof _0x24de81[_0x253f('0x1a')]===_0x253f('0x1b');var _0x1f1828=_0x5aea83[_0x253f('0x1c')];var _0x48dc57=_0xd6275d?0x0:_0x24de81['offset'];var _0x5cfdf1=_0xd6275d?_0x5aea83[_0x253f('0x1c')]:_0x24de81['offset']+_0x24de81[_0x253f('0x1a')];var _0x28d6d2;if(_0x5cfdf1>=_0x1f1828){_0x5cfdf1=_0x1f1828;_0x28d6d2=0xc8;}else{_0x28d6d2=0xce;}_0x1d425c['status'](_0x28d6d2);return _0x1d425c[_0x253f('0x1d')]('Content-Range',_0x48dc57+'-'+_0x5cfdf1+'/'+_0x1f1828)[_0x253f('0x18')](_0x5aea83);}return null;};}function patchUpdates(_0x4368d5){return function(_0x9de5e9){try{jsonpatch[_0x253f('0x1e')](_0x9de5e9,_0x4368d5,!![]);}catch(_0x256078){return BPromise['reject'](_0x256078);}return _0x9de5e9[_0x253f('0x1f')]();};}function saveUpdates(_0x4f2929,_0x43915e){return function(_0x29037d){if(_0x29037d){return _0x29037d[_0x253f('0x20')](_0x4f2929)[_0x253f('0x21')](function(_0xbb70c4){return _0xbb70c4;});}return null;};}function removeEntity(_0x5e61c7,_0x16b29f){return function(_0x581610){if(_0x581610){return _0x581610[_0x253f('0x22')]()[_0x253f('0x21')](function(){_0x5e61c7['status'](0xcc)[_0x253f('0x17')]();});}};}function handleEntityNotFound(_0x13e3f0,_0x26cc75){return function(_0x6c1f3f){if(!_0x6c1f3f){_0x13e3f0['sendStatus'](0x194);}return _0x6c1f3f;};}function handleError(_0x17e89b,_0x51aab0){_0x51aab0=_0x51aab0||0x1f4;return function(_0x153222){logger[_0x253f('0x23')](_0x153222['stack']);if(_0x153222['name']){delete _0x153222[_0x253f('0x24')];}_0x17e89b['status'](_0x51aab0)[_0x253f('0x25')](_0x153222);};}exports[_0x253f('0x26')]=function(_0x273062,_0x2a2ddd){var _0x433901={},_0x3ceca4={},_0x2ddf9a={'count':0x0,'rows':[]};var _0x158c88=_[_0x253f('0x27')](db['SmsTransferReport'][_0x253f('0x28')],function(_0xaa0302){return{'name':_0xaa0302[_0x253f('0x29')],'type':_0xaa0302['type']['key']};});_0x3ceca4[_0x253f('0x2a')]=_['map'](_0x158c88,_0x253f('0x24'));_0x3ceca4['query']=_[_0x253f('0x2b')](_0x273062['query']);_0x3ceca4[_0x253f('0x2c')]=_[_0x253f('0x2d')](_0x3ceca4['model'],_0x3ceca4[_0x253f('0x2e')]);_0x433901[_0x253f('0x2f')]=_['intersection'](_0x3ceca4[_0x253f('0x2a')],qs['fields'](_0x273062[_0x253f('0x2e')]['fields']));_0x433901['attributes']=_0x433901[_0x253f('0x2f')][_0x253f('0x30')]?_0x433901[_0x253f('0x2f')]:_0x3ceca4[_0x253f('0x2a')];if(!_0x273062[_0x253f('0x2e')]['hasOwnProperty']('nolimit')){_0x433901[_0x253f('0x1a')]=qs['limit'](_0x273062['query']['limit']);_0x433901[_0x253f('0x19')]=qs[_0x253f('0x19')](_0x273062[_0x253f('0x2e')][_0x253f('0x19')]);}_0x433901['order']=qs[_0x253f('0x31')](_0x273062[_0x253f('0x2e')][_0x253f('0x31')]);_0x433901['where']=qs[_0x253f('0x2c')](_['pick'](_0x273062[_0x253f('0x2e')],_0x3ceca4[_0x253f('0x2c')]),_0x158c88);if(_0x273062[_0x253f('0x2e')]['filter']){_0x433901[_0x253f('0x32')]=_[_0x253f('0x33')](_0x433901[_0x253f('0x32')],{'$or':_[_0x253f('0x27')](_0x158c88,function(_0x2fd2f0){if(_0x2fd2f0[_0x253f('0x34')]!==_0x253f('0x35')){var _0x5d1f3c={};_0x5d1f3c[_0x2fd2f0[_0x253f('0x24')]]={'$like':'%'+_0x273062[_0x253f('0x2e')][_0x253f('0x36')]+'%'};return _0x5d1f3c;}})});}_0x433901=_[_0x253f('0x33')]({},_0x433901,_0x273062[_0x253f('0x37')]);var _0x2a0e46={'where':_0x433901[_0x253f('0x32')]};return db['SmsTransferReport'][_0x253f('0x1c')](_0x2a0e46)['then'](function(_0x42f7c4){_0x2ddf9a[_0x253f('0x1c')]=_0x42f7c4;if(_0x273062['query'][_0x253f('0x38')]){_0x433901[_0x253f('0x39')]=[{'all':!![]}];}return db[_0x253f('0x3a')][_0x253f('0x3b')](_0x433901);})[_0x253f('0x21')](function(_0xa045df){_0x2ddf9a[_0x253f('0x3c')]=_0xa045df;return _0x2ddf9a;})[_0x253f('0x21')](respondWithFilteredResult(_0x2a2ddd,_0x433901))[_0x253f('0x3d')](handleError(_0x2a2ddd,null));};exports[_0x253f('0x3e')]=function(_0x3abcf6,_0x3102e0){var _0x50c78d={'raw':!![],'where':{'id':_0x3abcf6[_0x253f('0x3f')]['id']}},_0x744df1={};_0x744df1['model']=_[_0x253f('0x2b')](db[_0x253f('0x3a')][_0x253f('0x28')]);_0x744df1[_0x253f('0x2e')]=_['keys'](_0x3abcf6['query']);_0x744df1[_0x253f('0x2c')]=_[_0x253f('0x2d')](_0x744df1['model'],_0x744df1[_0x253f('0x2e')]);_0x50c78d[_0x253f('0x2f')]=_['intersection'](_0x744df1['model'],qs[_0x253f('0x40')](_0x3abcf6['query'][_0x253f('0x40')]));_0x50c78d['attributes']=_0x50c78d[_0x253f('0x2f')][_0x253f('0x30')]?_0x50c78d[_0x253f('0x2f')]:_0x744df1[_0x253f('0x2a')];if(_0x3abcf6[_0x253f('0x2e')][_0x253f('0x38')]){_0x50c78d['include']=[{'all':!![]}];}_0x50c78d=_[_0x253f('0x33')]({},_0x50c78d,_0x3abcf6[_0x253f('0x37')]);return db['SmsTransferReport'][_0x253f('0x41')](_0x50c78d)[_0x253f('0x21')](handleEntityNotFound(_0x3102e0,null))[_0x253f('0x21')](respondWithResult(_0x3102e0,null))[_0x253f('0x3d')](handleError(_0x3102e0,null));};exports[_0x253f('0x42')]=function(_0x4c4bd4,_0x8f69fd){return db[_0x253f('0x3a')][_0x253f('0x42')](_0x4c4bd4[_0x253f('0x43')],{})[_0x253f('0x21')](respondWithResult(_0x8f69fd,0xc9))['catch'](handleError(_0x8f69fd,null));};exports[_0x253f('0x20')]=function(_0x2cef78,_0x25110d){if(_0x2cef78[_0x253f('0x43')]['id']){delete _0x2cef78['body']['id'];}return db[_0x253f('0x3a')][_0x253f('0x41')]({'where':{'id':_0x2cef78[_0x253f('0x3f')]['id']}})[_0x253f('0x21')](handleEntityNotFound(_0x25110d,null))[_0x253f('0x21')](saveUpdates(_0x2cef78[_0x253f('0x43')],null))[_0x253f('0x21')](respondWithResult(_0x25110d,null))['catch'](handleError(_0x25110d,null));};exports[_0x253f('0x22')]=function(_0x3f86bf,_0x592b2b){return db['SmsTransferReport']['find']({'where':{'id':_0x3f86bf[_0x253f('0x3f')]['id']}})[_0x253f('0x21')](handleEntityNotFound(_0x592b2b,null))['then'](removeEntity(_0x592b2b,null))['catch'](handleError(_0x592b2b,null));};exports['describe']=function(_0x2eb283,_0x4f5d7b){return db[_0x253f('0x3a')]['describe']()[_0x253f('0x21')](respondWithResult(_0x4f5d7b,null))[_0x253f('0x3d')](handleError(_0x4f5d7b,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e632511..ebb3370 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 _0xa5c0=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','report_sms_transfer'];(function(_0x1e3c54,_0x4e0ad3){var _0x10fa5f=function(_0xf05983){while(--_0xf05983){_0x1e3c54['push'](_0x1e3c54['shift']());}};_0x10fa5f(++_0x4e0ad3);}(_0xa5c0,0xbf));var _0x0a5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0a5c('0x0'));var util=require(_0x0a5c('0x1'));var logger=require(_0x0a5c('0x2'))('api');var moment=require(_0x0a5c('0x3'));var BPromise=require(_0x0a5c('0x4'));var rp=require(_0x0a5c('0x5'));var fs=require('fs');var path=require(_0x0a5c('0x6'));var rimraf=require(_0x0a5c('0x7'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x48540c,_0x456437){return _0x48540c['define']('SmsTransferReport',attributes,{'tableName':_0x0a5c('0x8'),'paranoid':![],'indexes':[{'name':_0x0a5c('0x9'),'fields':[_0x0a5c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x066a=['util','../../config/logger','moment','bluebird','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0x066a,0x9b));var _0xa066=function(_0x26ed7e,_0x27bd8e){_0x26ed7e=_0x26ed7e-0x0;var _0x2dd90f=_0x066a[_0x26ed7e];return _0x2dd90f;};'use strict';var _=require(_0xa066('0x0'));var util=require(_0xa066('0x1'));var logger=require(_0xa066('0x2'))('api');var moment=require(_0xa066('0x3'));var BPromise=require(_0xa066('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa066('0x5'));var rimraf=require('rimraf');var config=require(_0xa066('0x6'));var attributes=require(_0xa066('0x7'));module[_0xa066('0x8')]=function(_0x5360f4,_0x24a782){return _0x5360f4[_0xa066('0x9')](_0xa066('0xa'),attributes,{'tableName':_0xa066('0xb'),'paranoid':![],'indexes':[{'name':_0xa066('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index c88e59c..04e79d8 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 _0xfd8f=['http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x26a68c,_0x32df39){var _0x1f58ea=function(_0x5c0527){while(--_0x5c0527){_0x26a68c['push'](_0x26a68c['shift']());}};_0x1f58ea(++_0x32df39);}(_0xfd8f,0xae));var _0xffd8=function(_0x335c81,_0x5ab767){_0x335c81=_0x335c81-0x0;var _0x1fada4=_0xfd8f[_0x335c81];return _0x1fada4;};'use strict';var _=require(_0xffd8('0x0'));var util=require(_0xffd8('0x1'));var moment=require('moment');var BPromise=require(_0xffd8('0x2'));var rs=require(_0xffd8('0x3'));var fs=require('fs');var Redis=require(_0xffd8('0x4'));var db=require(_0xffd8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xffd8('0x6'))(_0xffd8('0x7'));var config=require('../../config/environment');var jayson=require(_0xffd8('0x8'));var client=jayson[_0xffd8('0x9')][_0xffd8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1785ea,_0x3245ab,_0x254e4f){return new BPromise(function(_0x519e5d,_0x1fb036){return client[_0xffd8('0xb')](_0x1785ea,_0x254e4f)[_0xffd8('0xc')](function(_0x1275c5){logger['info'](_0xffd8('0xd'),_0x3245ab,_0xffd8('0xe'));logger[_0xffd8('0xf')](_0xffd8('0x10'),_0x3245ab,_0xffd8('0xe'),JSON[_0xffd8('0x11')](_0x1275c5));if(_0x1275c5[_0xffd8('0x12')]){if(_0x1275c5[_0xffd8('0x12')][_0xffd8('0x13')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x3245ab,_0x1275c5['error'][_0xffd8('0x14')]);return _0x1fb036(_0x1275c5[_0xffd8('0x12')][_0xffd8('0x14')]);}logger[_0xffd8('0x12')](_0xffd8('0xd'),_0x3245ab,_0x1275c5['error'][_0xffd8('0x14')]);return _0x519e5d(_0x1275c5[_0xffd8('0x12')][_0xffd8('0x14')]);}else{logger[_0xffd8('0x15')](_0xffd8('0xd'),_0x3245ab,'request\x20sent');_0x519e5d(_0x1275c5[_0xffd8('0x16')][_0xffd8('0x14')]);}})['catch'](function(_0x86251f){logger[_0xffd8('0x12')](_0xffd8('0xd'),_0x3245ab,_0x86251f);_0x1fb036(_0x86251f);});});} \ No newline at end of file +var _0xe8f7=['then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x25f0ea,_0xd6d029){var _0x275268=function(_0x35492a){while(--_0x35492a){_0x25f0ea['push'](_0x25f0ea['shift']());}};_0x275268(++_0xd6d029);}(_0xe8f7,0x137));var _0x7e8f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe8f7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7e8f('0x0'));var util=require('util');var moment=require(_0x7e8f('0x1'));var BPromise=require(_0x7e8f('0x2'));var rs=require(_0x7e8f('0x3'));var fs=require('fs');var Redis=require(_0x7e8f('0x4'));var db=require(_0x7e8f('0x5'))['db'];var utils=require(_0x7e8f('0x6'));var logger=require(_0x7e8f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7e8f('0x8'));var client=jayson[_0x7e8f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3524f2,_0x337175,_0x8e9115){return new BPromise(function(_0x13471b,_0x17bc6a){return client[_0x7e8f('0xa')](_0x3524f2,_0x8e9115)[_0x7e8f('0xb')](function(_0x583df2){logger[_0x7e8f('0xc')](_0x7e8f('0xd'),_0x337175,'request\x20sent');logger[_0x7e8f('0xe')](_0x7e8f('0xf'),_0x337175,_0x7e8f('0x10'),JSON[_0x7e8f('0x11')](_0x583df2));if(_0x583df2['error']){if(_0x583df2[_0x7e8f('0x12')][_0x7e8f('0x13')]===0x1f4){logger['error'](_0x7e8f('0xd'),_0x337175,_0x583df2[_0x7e8f('0x12')]['message']);return _0x17bc6a(_0x583df2['error'][_0x7e8f('0x14')]);}logger[_0x7e8f('0x12')](_0x7e8f('0xd'),_0x337175,_0x583df2[_0x7e8f('0x12')][_0x7e8f('0x14')]);return _0x13471b(_0x583df2[_0x7e8f('0x12')][_0x7e8f('0x14')]);}else{logger[_0x7e8f('0xc')](_0x7e8f('0xd'),_0x337175,_0x7e8f('0x10'));_0x13471b(_0x583df2[_0x7e8f('0x15')][_0x7e8f('0x14')]);}})[_0x7e8f('0x16')](function(_0x2e8211){logger[_0x7e8f('0x12')](_0x7e8f('0xd'),_0x337175,_0x2e8211);_0x17bc6a(_0x2e8211);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index cacecc1..3c789e6 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 _0x2e49=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','now','post','file','create','/:id','delete','exports','multer','util','connect-timeout','express'];(function(_0x24e795,_0x16e804){var _0xfbc655=function(_0x31e488){while(--_0x31e488){_0x24e795['push'](_0x24e795['shift']());}};_0xfbc655(++_0x16e804);}(_0x2e49,0x175));var _0x92e4=function(_0x3decb4,_0x2c8c64){_0x3decb4=_0x3decb4-0x0;var _0x30202b=_0x2e49[_0x3decb4];return _0x30202b;};'use strict';var multer=require(_0x92e4('0x0'));var util=require(_0x92e4('0x1'));var path=require('path');var timeout=require(_0x92e4('0x2'));var express=require(_0x92e4('0x3'));var router=express[_0x92e4('0x4')]();var fs_extra=require(_0x92e4('0x5'));var auth=require(_0x92e4('0x6'));var interaction=require(_0x92e4('0x7'));var config=require(_0x92e4('0x8'));var controller=require('./sound.controller');router['get']('/',auth[_0x92e4('0x9')](),controller[_0x92e4('0xa')]);router[_0x92e4('0xb')]('/:id',auth[_0x92e4('0x9')](),controller[_0x92e4('0xc')]);router[_0x92e4('0xb')](_0x92e4('0xd'),auth[_0x92e4('0x9')](),controller[_0x92e4('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x27eba7,_0x55d907,_0x4fd0b7){_0x4fd0b7(null,path[_0x92e4('0xf')](config[_0x92e4('0x10')],_0x92e4('0x11')));},'filename':function(_0xac69,_0x1f3bf1,_0x50654a){_0x1f3bf1[_0x92e4('0x12')]=_0x1f3bf1[_0x92e4('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x50654a(null,util[_0x92e4('0x13')](_0x92e4('0x14'),path[_0x92e4('0x15')](_0x1f3bf1['originalname'],path['extname'](_0x1f3bf1['originalname'])),Date[_0x92e4('0x16')](),path['extname'](_0x1f3bf1['originalname'])));}})});router[_0x92e4('0x17')]('/',upload['single'](_0x92e4('0x18')),controller[_0x92e4('0x19')]);router['put'](_0x92e4('0x1a'),auth[_0x92e4('0x9')](),controller['update']);router[_0x92e4('0x1b')](_0x92e4('0x1a'),auth['isAuthenticated'](),controller['delete']);module[_0x92e4('0x1c')]=router; \ No newline at end of file +var _0x0d0f=['/:id/download','diskStorage','join','root','server/files/sounds/original/','format','%s-%s%s','originalname','now','extname','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show'];(function(_0x13376b,_0x44fd91){var _0x38759c=function(_0x3782eb){while(--_0x3782eb){_0x13376b['push'](_0x13376b['shift']());}};_0x38759c(++_0x44fd91);}(_0x0d0f,0x6e));var _0xf0d0=function(_0x42c7cb,_0x5dece9){_0x42c7cb=_0x42c7cb-0x0;var _0x143efe=_0x0d0f[_0x42c7cb];return _0x143efe;};'use strict';var multer=require(_0xf0d0('0x0'));var util=require(_0xf0d0('0x1'));var path=require(_0xf0d0('0x2'));var timeout=require(_0xf0d0('0x3'));var express=require(_0xf0d0('0x4'));var router=express[_0xf0d0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf0d0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf0d0('0x7'));var controller=require(_0xf0d0('0x8'));router[_0xf0d0('0x9')]('/',auth[_0xf0d0('0xa')](),controller[_0xf0d0('0xb')]);router[_0xf0d0('0x9')](_0xf0d0('0xc'),auth[_0xf0d0('0xa')](),controller[_0xf0d0('0xd')]);router[_0xf0d0('0x9')](_0xf0d0('0xe'),auth[_0xf0d0('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xf0d0('0xf')]({'destination':function(_0x25129a,_0x176417,_0x436acb){_0x436acb(null,path[_0xf0d0('0x10')](config[_0xf0d0('0x11')],_0xf0d0('0x12')));},'filename':function(_0x2e9327,_0x1966c3,_0xd74cee){_0x1966c3['originalname']=_0x1966c3['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xd74cee(null,util[_0xf0d0('0x13')](_0xf0d0('0x14'),path['basename'](_0x1966c3[_0xf0d0('0x15')],path['extname'](_0x1966c3[_0xf0d0('0x15')])),Date[_0xf0d0('0x16')](),path[_0xf0d0('0x17')](_0x1966c3[_0xf0d0('0x15')])));}})});router['post']('/',upload[_0xf0d0('0x18')](_0xf0d0('0x19')),controller[_0xf0d0('0x1a')]);router[_0xf0d0('0x1b')](_0xf0d0('0xc'),auth['isAuthenticated'](),controller[_0xf0d0('0x1c')]);router[_0xf0d0('0x1d')](_0xf0d0('0xc'),auth['isAuthenticated'](),controller[_0xf0d0('0x1d')]);module[_0xf0d0('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c0e99b0..2f0df6c 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 _0x6fbb=['BIGINT','INTEGER','exports','name','STRING','FLOAT'];(function(_0x3717c5,_0x1255ac){var _0xf14cca=function(_0x426f66){while(--_0x426f66){_0x3717c5['push'](_0x3717c5['shift']());}};_0xf14cca(++_0x1255ac);}(_0x6fbb,0x158));var _0xb6fb=function(_0x591b52,_0x3ea0d8){_0x591b52=_0x591b52-0x0;var _0x443f0e=_0x6fbb[_0x591b52];return _0x443f0e;};'use strict';var Sequelize=require('sequelize');module[_0xb6fb('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb6fb('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xb6fb('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xb6fb('0x2')]},'original_format':{'type':Sequelize[_0xb6fb('0x2')]},'original_duration':{'type':Sequelize[_0xb6fb('0x3')]},'original_sampleCount':{'type':Sequelize[_0xb6fb('0x4')]},'original_channelCount':{'type':Sequelize[_0xb6fb('0x5')]},'original_bitRate':{'type':Sequelize[_0xb6fb('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xb6fb('0x2')]},'converted_duration':{'type':Sequelize[_0xb6fb('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xb6fb('0x5')]},'converted_bitRate':{'type':Sequelize[_0xb6fb('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xb6fb('0x5')]}}; \ No newline at end of file +var _0x4730=['BIGINT','INTEGER','STRING','name'];(function(_0x297abe,_0x302c4c){var _0x34fca2=function(_0x557558){while(--_0x557558){_0x297abe['push'](_0x297abe['shift']());}};_0x34fca2(++_0x302c4c);}(_0x4730,0x182));var _0x0473=function(_0x313e3d,_0x2d149f){_0x313e3d=_0x313e3d-0x0;var _0x3989d0=_0x4730[_0x313e3d];return _0x3989d0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0473('0x0')],'unique':_0x0473('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x0473('0x0')]},'display_name':{'type':Sequelize[_0x0473('0x0')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x0473('0x0')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x0473('0x2')]},'original_channelCount':{'type':Sequelize[_0x0473('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x0473('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x0473('0x3')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x0473('0x3')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 746346d..43115b8 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 _0x3ac2=['update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','Sound','includeAll','include','findAll','rows','catch','show','params','find','download','existsSync','server/files/sounds/converted','save_name','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','join','root','%s.%s','format','create','basename','file','extname','originalname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','original_format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x2ac980,_0x33829d){var _0x53974d=function(_0x4cd40c){while(--_0x4cd40c){_0x2ac980['push'](_0x2ac980['shift']());}};_0x53974d(++_0x33829d);}(_0x3ac2,0xdb));var _0x23ac=function(_0x341ca3,_0x517ac5){_0x341ca3=_0x341ca3-0x0;var _0x422997=_0x3ac2[_0x341ca3];return _0x422997;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x23ac('0x0'));var jsonpatch=require(_0x23ac('0x1'));var rp=require(_0x23ac('0x2'));var moment=require(_0x23ac('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x23ac('0x4'));var util=require(_0x23ac('0x5'));var path=require(_0x23ac('0x6'));var sox=require('sox');var csv=require(_0x23ac('0x7'));var ejs=require(_0x23ac('0x8'));var fs=require('fs');var fs_extra=require(_0x23ac('0x9'));var _=require(_0x23ac('0xa'));var squel=require(_0x23ac('0xb'));var crypto=require(_0x23ac('0xc'));var jsforce=require(_0x23ac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x23ac('0x7'));var querystring=require(_0x23ac('0xe'));var Papa=require(_0x23ac('0xf'));var Redis=require(_0x23ac('0x10'));var authService=require(_0x23ac('0x11'));var qs=require(_0x23ac('0x12'));var as=require(_0x23ac('0x13'));var hardwareService=require(_0x23ac('0x14'));var logger=require(_0x23ac('0x15'))('api');var utils=require(_0x23ac('0x16'));var config=require(_0x23ac('0x17'));var licenseUtil=require(_0x23ac('0x18'));var db=require(_0x23ac('0x19'))['db'];function respondWithStatusCode(_0x4130fe,_0x1892f9){_0x1892f9=_0x1892f9||0xcc;return function(_0x532ddb){if(_0x532ddb){return _0x4130fe[_0x23ac('0x1a')](_0x1892f9);}return _0x4130fe[_0x23ac('0x1b')](_0x1892f9)[_0x23ac('0x1c')]();};}function respondWithResult(_0x49133e,_0x1c9469){_0x1c9469=_0x1c9469||0xc8;return function(_0x2d3fc2){if(_0x2d3fc2){return _0x49133e[_0x23ac('0x1b')](_0x1c9469)[_0x23ac('0x1d')](_0x2d3fc2);}};}function respondWithFilteredResult(_0xefb714,_0x451db5){return function(_0x2fbb9b){if(_0x2fbb9b){var _0x36f7f9=typeof _0x451db5['offset']==='undefined'&&typeof _0x451db5['limit']===_0x23ac('0x1e');var _0x5b03fc=_0x2fbb9b[_0x23ac('0x1f')];var _0xa36838=_0x36f7f9?0x0:_0x451db5[_0x23ac('0x20')];var _0x33bc8d=_0x36f7f9?_0x2fbb9b[_0x23ac('0x1f')]:_0x451db5[_0x23ac('0x20')]+_0x451db5[_0x23ac('0x21')];var _0x268fc6;if(_0x33bc8d>=_0x5b03fc){_0x33bc8d=_0x5b03fc;_0x268fc6=0xc8;}else{_0x268fc6=0xce;}_0xefb714[_0x23ac('0x1b')](_0x268fc6);return _0xefb714[_0x23ac('0x22')](_0x23ac('0x23'),_0xa36838+'-'+_0x33bc8d+'/'+_0x5b03fc)[_0x23ac('0x1d')](_0x2fbb9b);}return null;};}function patchUpdates(_0x28d6f4){return function(_0xf51e27){try{jsonpatch[_0x23ac('0x24')](_0xf51e27,_0x28d6f4,!![]);}catch(_0x4a93d4){return BPromise[_0x23ac('0x25')](_0x4a93d4);}return _0xf51e27[_0x23ac('0x26')]();};}function saveUpdates(_0x46e458,_0x477d37){return function(_0x12deb0){if(_0x12deb0){return _0x12deb0[_0x23ac('0x27')](_0x46e458)[_0x23ac('0x28')](function(_0x184169){return _0x184169;});}return null;};}function removeEntity(_0x28764d,_0x2462f5){return function(_0x84af8d){if(_0x84af8d){return _0x84af8d[_0x23ac('0x29')]()[_0x23ac('0x28')](function(){var _0x42cb6b=_0x84af8d[_0x23ac('0x2a')]({'plain':!![]});var _0x3b6993=_0x23ac('0x2b');return db[_0x23ac('0x2c')][_0x23ac('0x29')]({'where':{'type':_0x3b6993,'resourceId':_0x42cb6b['id']}})[_0x23ac('0x28')](function(){return _0x84af8d;});})[_0x23ac('0x28')](function(){_0x28764d[_0x23ac('0x1b')](0xcc)[_0x23ac('0x1c')]();});}};}function handleEntityNotFound(_0x4290d7,_0x31bb3f){return function(_0x16575a){if(!_0x16575a){_0x4290d7[_0x23ac('0x1a')](0x194);}return _0x16575a;};}function handleError(_0x4f58a1,_0x50f61a){_0x50f61a=_0x50f61a||0x1f4;return function(_0x4942d0){logger[_0x23ac('0x2d')](_0x4942d0[_0x23ac('0x2e')]);if(_0x4942d0['name']){delete _0x4942d0[_0x23ac('0x2f')];}_0x4f58a1[_0x23ac('0x1b')](_0x50f61a)[_0x23ac('0x30')](_0x4942d0);};}exports[_0x23ac('0x31')]=function(_0x2472d2,_0x522ff2){var _0x435c2d={},_0x2fb83b={},_0x391d82={'count':0x0,'rows':[]};var _0x377b48=_['map'](db['Sound'][_0x23ac('0x32')],function(_0x4486f3){return{'name':_0x4486f3[_0x23ac('0x33')],'type':_0x4486f3[_0x23ac('0x34')]['key']};});_0x2fb83b[_0x23ac('0x35')]=_[_0x23ac('0x36')](_0x377b48,'name');_0x2fb83b['query']=_[_0x23ac('0x37')](_0x2472d2[_0x23ac('0x38')]);_0x2fb83b['filters']=_[_0x23ac('0x39')](_0x2fb83b[_0x23ac('0x35')],_0x2fb83b[_0x23ac('0x38')]);_0x435c2d[_0x23ac('0x3a')]=_[_0x23ac('0x39')](_0x2fb83b[_0x23ac('0x35')],qs[_0x23ac('0x3b')](_0x2472d2[_0x23ac('0x38')][_0x23ac('0x3b')]));_0x435c2d['attributes']=_0x435c2d[_0x23ac('0x3a')][_0x23ac('0x3c')]?_0x435c2d[_0x23ac('0x3a')]:_0x2fb83b[_0x23ac('0x35')];if(!_0x2472d2['query'][_0x23ac('0x3d')](_0x23ac('0x3e'))){_0x435c2d[_0x23ac('0x21')]=qs['limit'](_0x2472d2[_0x23ac('0x38')][_0x23ac('0x21')]);_0x435c2d[_0x23ac('0x20')]=qs[_0x23ac('0x20')](_0x2472d2[_0x23ac('0x38')][_0x23ac('0x20')]);}_0x435c2d[_0x23ac('0x3f')]=qs[_0x23ac('0x40')](_0x2472d2['query'][_0x23ac('0x40')]);_0x435c2d['where']=qs[_0x23ac('0x41')](_[_0x23ac('0x42')](_0x2472d2[_0x23ac('0x38')],_0x2fb83b['filters']),_0x377b48);if(_0x2472d2['query'][_0x23ac('0x43')]){_0x435c2d[_0x23ac('0x44')]=_[_0x23ac('0x45')](_0x435c2d[_0x23ac('0x44')],{'$or':_['map'](_0x377b48,function(_0x57cd00){if(_0x57cd00[_0x23ac('0x34')]!=='VIRTUAL'){var _0xec0b0a={};_0xec0b0a[_0x57cd00[_0x23ac('0x2f')]]={'$like':'%'+_0x2472d2[_0x23ac('0x38')][_0x23ac('0x43')]+'%'};return _0xec0b0a;}})});}_0x435c2d=_[_0x23ac('0x45')]({},_0x435c2d,_0x2472d2[_0x23ac('0x46')]);var _0x2ade81={'where':_0x435c2d['where']};return db[_0x23ac('0x47')][_0x23ac('0x1f')](_0x2ade81)[_0x23ac('0x28')](function(_0x1892d3){_0x391d82['count']=_0x1892d3;if(_0x2472d2[_0x23ac('0x38')][_0x23ac('0x48')]){_0x435c2d[_0x23ac('0x49')]=[{'all':!![]}];}return db['Sound'][_0x23ac('0x4a')](_0x435c2d);})['then'](function(_0x362fac){_0x391d82[_0x23ac('0x4b')]=_0x362fac;return _0x391d82;})[_0x23ac('0x28')](respondWithFilteredResult(_0x522ff2,_0x435c2d))[_0x23ac('0x4c')](handleError(_0x522ff2,null));};exports[_0x23ac('0x4d')]=function(_0x5dcde8,_0x48c174){var _0x324d98={'raw':!![],'where':{'id':_0x5dcde8[_0x23ac('0x4e')]['id']}},_0x3da43f={};_0x3da43f['model']=_['keys'](db[_0x23ac('0x47')]['rawAttributes']);_0x3da43f[_0x23ac('0x38')]=_[_0x23ac('0x37')](_0x5dcde8[_0x23ac('0x38')]);_0x3da43f[_0x23ac('0x41')]=_[_0x23ac('0x39')](_0x3da43f[_0x23ac('0x35')],_0x3da43f[_0x23ac('0x38')]);_0x324d98['attributes']=_[_0x23ac('0x39')](_0x3da43f[_0x23ac('0x35')],qs[_0x23ac('0x3b')](_0x5dcde8[_0x23ac('0x38')][_0x23ac('0x3b')]));_0x324d98[_0x23ac('0x3a')]=_0x324d98[_0x23ac('0x3a')][_0x23ac('0x3c')]?_0x324d98[_0x23ac('0x3a')]:_0x3da43f['model'];if(_0x5dcde8[_0x23ac('0x38')][_0x23ac('0x48')]){_0x324d98[_0x23ac('0x49')]=[{'all':!![]}];}_0x324d98=_[_0x23ac('0x45')]({},_0x324d98,_0x5dcde8[_0x23ac('0x46')]);return db[_0x23ac('0x47')][_0x23ac('0x4f')](_0x324d98)[_0x23ac('0x28')](handleEntityNotFound(_0x48c174,null))[_0x23ac('0x28')](respondWithResult(_0x48c174,null))[_0x23ac('0x4c')](handleError(_0x48c174,null));};exports[_0x23ac('0x50')]=function(_0x55a2be,_0x3dd566,_0x5d2b03){return db['Sound']['find']({'where':{'id':_0x55a2be[_0x23ac('0x4e')]['id']},'attributes':[_0x23ac('0x2f'),'save_name','converted_format'],'raw':!![]})[_0x23ac('0x28')](handleEntityNotFound(_0x3dd566,null))[_0x23ac('0x28')](function(_0x39c91e){if(_0x39c91e){if(!fs[_0x23ac('0x51')](path['join'](config['root'],_0x23ac('0x52'),_0x39c91e[_0x23ac('0x53')]+'.'+_0x39c91e[_0x23ac('0x54')]))){throw new db[(_0x23ac('0x55'))][(_0x23ac('0x56'))](_0x23ac('0x57'));}return _0x3dd566['download'](path[_0x23ac('0x58')](config[_0x23ac('0x59')],'server/files/sounds/converted',util['format'](_0x23ac('0x5a'),_0x39c91e[_0x23ac('0x53')],_0x39c91e[_0x23ac('0x54')])),util[_0x23ac('0x5b')]('%s.%s',_0x39c91e[_0x23ac('0x2f')],_0x39c91e['converted_format']));}return null;})[_0x23ac('0x4c')](handleError(_0x3dd566,null));};exports[_0x23ac('0x5c')]=function(_0x50638b,_0x2b2e3f,_0x3214d6){var _0x32d676={'name':path[_0x23ac('0x5d')](_0x50638b[_0x23ac('0x5e')]['originalname'],path[_0x23ac('0x5f')](_0x50638b[_0x23ac('0x5e')][_0x23ac('0x60')])),'save_name':path[_0x23ac('0x5d')](_0x50638b[_0x23ac('0x5e')]['filename'],path[_0x23ac('0x5f')](_0x50638b[_0x23ac('0x5e')][_0x23ac('0x61')])),'original_format':path[_0x23ac('0x5f')](_0x50638b[_0x23ac('0x5e')][_0x23ac('0x60')])[_0x23ac('0x62')](0x1),'converted_format':'wav'};var _0x5636bf=path[_0x23ac('0x58')](config['root'],_0x23ac('0x63'),_0x50638b['file']['filename']);var _0x11c13b=path[_0x23ac('0x58')](config[_0x23ac('0x59')],'server/files/sounds/converted',util['format'](_0x23ac('0x5a'),path['basename'](_0x50638b[_0x23ac('0x5e')][_0x23ac('0x61')],path['extname'](_0x50638b[_0x23ac('0x5e')][_0x23ac('0x61')])),_0x32d676[_0x23ac('0x54')]));logger[_0x23ac('0x64')]('Sound\x20upload\x20filepath:\x20%s',_0x5636bf);logger[_0x23ac('0x64')](_0x23ac('0x65'),_0x11c13b);try{fs['chmodSync'](_0x5636bf,parseInt(_0x23ac('0x66'),0x8));var _0x3f5dda=sox[_0x23ac('0x67')](_0x5636bf,_0x11c13b,{'sampleRate':0x1f40,'format':_0x23ac('0x68'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3f5dda['on'](_0x23ac('0x2d'),function(_0x59f910){fs[_0x23ac('0x69')](_0x5636bf);_0x2b2e3f['status'](0x1f4)[_0x23ac('0x30')](_0x59f910);});_0x3f5dda['on'](_0x23ac('0x6a'),function(_0x2e8793){_0x32d676[_0x23ac('0x6b')]=isNaN(_0x2e8793[_0x23ac('0x6c')])?null:_0x2e8793['duration']*0x3e8;_0x32d676['original_sampleCount']=isNaN(_0x2e8793['sampleCount'])?null:_0x2e8793[_0x23ac('0x6d')];_0x32d676[_0x23ac('0x6e')]=isNaN(_0x2e8793[_0x23ac('0x6f')])?null:_0x2e8793[_0x23ac('0x6f')];_0x32d676[_0x23ac('0x70')]=isNaN(_0x2e8793[_0x23ac('0x71')])?null:_0x2e8793['bitRate'];_0x32d676[_0x23ac('0x72')]=isNaN(_0x2e8793[_0x23ac('0x73')])?null:_0x2e8793['sampleRate'];});_0x3f5dda['on'](_0x23ac('0x74'),function(_0x56e040){_0x32d676[_0x23ac('0x75')]=isNaN(_0x56e040[_0x23ac('0x6c')])?null:_0x56e040[_0x23ac('0x6c')]*0x3e8;_0x32d676[_0x23ac('0x76')]=isNaN(_0x56e040['sampleCount'])?null:_0x56e040['sampleCount'];_0x32d676['converted_channelCount']=isNaN(_0x56e040['channelCount'])?null:_0x56e040[_0x23ac('0x6f')];_0x32d676[_0x23ac('0x77')]=isNaN(_0x56e040['bitRate'])?null:_0x56e040[_0x23ac('0x71')];_0x32d676[_0x23ac('0x78')]=isNaN(_0x56e040[_0x23ac('0x73')])?null:_0x56e040['sampleRate'];});_0x3f5dda['on'](_0x23ac('0x1c'),function(){fs['chmodSync'](_0x11c13b,parseInt(_0x23ac('0x66'),0x8));return db[_0x23ac('0x47')][_0x23ac('0x5c')](_0x32d676)['then'](function(_0x58fe5e){var _0x46ab8b={'role':_0x50638b[_0x23ac('0x79')][_0x23ac('0x7a')],'userProfileId':_0x50638b[_0x23ac('0x79')][_0x23ac('0x7b')]};if(!_0x46ab8b)throw new Error(_0x23ac('0x7c'));if(_0x46ab8b[_0x23ac('0x7a')]===_0x23ac('0x7d')){var _0x47cf08=_0x58fe5e[_0x23ac('0x2a')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x23ac('0x2b'),'userProfileId':_0x46ab8b[_0x23ac('0x7b')]},'raw':!![]})[_0x23ac('0x28')](function(_0x12f81a){if(_0x12f81a&&_0x12f81a['autoAssociation']===0x0){return db['UserProfileResource'][_0x23ac('0x5c')]({'name':_0x47cf08[_0x23ac('0x2f')],'resourceId':_0x47cf08['id'],'type':_0x12f81a['name'],'sectionId':_0x12f81a['id']},{})[_0x23ac('0x28')](function(){return _0x58fe5e;});}else{return _0x58fe5e;}})['catch'](function(_0x291eb8){logger[_0x23ac('0x2d')](_0x23ac('0x7e'),_0x291eb8);throw _0x291eb8;});}return _0x58fe5e;})[_0x23ac('0x28')](respondWithResult(_0x2b2e3f,null))[_0x23ac('0x4c')](handleError(_0x2b2e3f,null));});_0x3f5dda['start']();}catch(_0x9bac26){_0x2b2e3f[_0x23ac('0x1b')](0x1f4)[_0x23ac('0x30')](_0x9bac26);}};exports['update']=function(_0x14bbc1,_0x310102,_0x547f18){return db[_0x23ac('0x47')][_0x23ac('0x4f')]({'where':{'id':_0x14bbc1[_0x23ac('0x4e')]['id']}})[_0x23ac('0x28')](handleEntityNotFound(_0x310102,null))[_0x23ac('0x28')](saveUpdates(_[_0x23ac('0x42')](_0x14bbc1[_0x23ac('0x79')],[_0x23ac('0x2f'),_0x23ac('0x7f')]),null))['then'](respondWithResult(_0x310102,null))[_0x23ac('0x4c')](handleError(_0x310102,null));};exports['delete']=function(_0x231e0a,_0x578efc,_0x549206){return db[_0x23ac('0x47')][_0x23ac('0x4f')]({'where':{'id':_0x231e0a[_0x23ac('0x4e')]['id']}})[_0x23ac('0x28')](function(_0x5e91aa){if(_0x5e91aa){return _0x5e91aa['destroy']();}})[_0x23ac('0x28')](function(_0x4aca1d){var _0x31f1af=path[_0x23ac('0x58')](config['root'],_0x23ac('0x63'),util[_0x23ac('0x5b')]('%s.%s',_0x4aca1d[_0x23ac('0x53')],_0x4aca1d[_0x23ac('0x80')]));var _0x1f6421=path[_0x23ac('0x58')](config[_0x23ac('0x59')],'server/files/sounds/converted',util[_0x23ac('0x5b')](_0x23ac('0x5a'),_0x4aca1d[_0x23ac('0x53')],_0x4aca1d[_0x23ac('0x54')]));fs[_0x23ac('0x69')](_0x31f1af);fs[_0x23ac('0x69')](_0x1f6421);return _0x4aca1d;})['then'](function(_0xe7658f){if(_0xe7658f){return _0x578efc[_0x23ac('0x1b')](0xcc)['end']();}})[_0x23ac('0x28')](handleEntityNotFound(_0x578efc,null))[_0x23ac('0x4c')](handleError(_0x578efc,null));}; \ No newline at end of file +var _0x46ba=['then','get','Sounds','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','catch','show','params','download','save_name','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','extname','file','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','converted_bitRate','converted_sampleRate','end','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','start','description','delete','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','Content-Range','apply','save','update'];(function(_0x42ab07,_0x48b94e){var _0x13910f=function(_0x10d9d5){while(--_0x10d9d5){_0x42ab07['push'](_0x42ab07['shift']());}};_0x13910f(++_0x48b94e);}(_0x46ba,0xd3));var _0xa46b=function(_0x52de1d,_0x5ed6d8){_0x52de1d=_0x52de1d-0x0;var _0x42f47a=_0x46ba[_0x52de1d];return _0x42f47a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa46b('0x0'));var jsonpatch=require(_0xa46b('0x1'));var rp=require(_0xa46b('0x2'));var moment=require(_0xa46b('0x3'));var BPromise=require(_0xa46b('0x4'));var Mustache=require(_0xa46b('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa46b('0x6'));var csv=require(_0xa46b('0x7'));var ejs=require(_0xa46b('0x8'));var fs=require('fs');var fs_extra=require(_0xa46b('0x9'));var _=require(_0xa46b('0xa'));var squel=require(_0xa46b('0xb'));var crypto=require('crypto');var jsforce=require(_0xa46b('0xc'));var deskjs=require(_0xa46b('0xd'));var toCsv=require(_0xa46b('0x7'));var querystring=require(_0xa46b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa46b('0xf'));var authService=require(_0xa46b('0x10'));var qs=require(_0xa46b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa46b('0x12'));var logger=require(_0xa46b('0x13'))(_0xa46b('0x14'));var utils=require(_0xa46b('0x15'));var config=require(_0xa46b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa46b('0x17'))['db'];function respondWithStatusCode(_0x13b0fa,_0xe66354){_0xe66354=_0xe66354||0xcc;return function(_0x30e9b7){if(_0x30e9b7){return _0x13b0fa['sendStatus'](_0xe66354);}return _0x13b0fa[_0xa46b('0x18')](_0xe66354)['end']();};}function respondWithResult(_0x1352f3,_0x21fe97){_0x21fe97=_0x21fe97||0xc8;return function(_0x174acc){if(_0x174acc){return _0x1352f3[_0xa46b('0x18')](_0x21fe97)['json'](_0x174acc);}};}function respondWithFilteredResult(_0x317d45,_0x9384b0){return function(_0x571224){if(_0x571224){var _0x240e5e=typeof _0x9384b0[_0xa46b('0x19')]===_0xa46b('0x1a')&&typeof _0x9384b0[_0xa46b('0x1b')]===_0xa46b('0x1a');var _0x5a1b46=_0x571224[_0xa46b('0x1c')];var _0x3aadf7=_0x240e5e?0x0:_0x9384b0[_0xa46b('0x19')];var _0x405075=_0x240e5e?_0x571224['count']:_0x9384b0[_0xa46b('0x19')]+_0x9384b0['limit'];var _0x308f49;if(_0x405075>=_0x5a1b46){_0x405075=_0x5a1b46;_0x308f49=0xc8;}else{_0x308f49=0xce;}_0x317d45[_0xa46b('0x18')](_0x308f49);return _0x317d45['set'](_0xa46b('0x1d'),_0x3aadf7+'-'+_0x405075+'/'+_0x5a1b46)['json'](_0x571224);}return null;};}function patchUpdates(_0x58d3fe){return function(_0x59d537){try{jsonpatch[_0xa46b('0x1e')](_0x59d537,_0x58d3fe,!![]);}catch(_0x46d1f6){return BPromise['reject'](_0x46d1f6);}return _0x59d537[_0xa46b('0x1f')]();};}function saveUpdates(_0x1f3a59,_0x1e8f8f){return function(_0x5397a0){if(_0x5397a0){return _0x5397a0[_0xa46b('0x20')](_0x1f3a59)[_0xa46b('0x21')](function(_0xd9aee7){return _0xd9aee7;});}return null;};}function removeEntity(_0xe68707,_0x102b80){return function(_0x1673e0){if(_0x1673e0){return _0x1673e0['destroy']()[_0xa46b('0x21')](function(){var _0x475532=_0x1673e0[_0xa46b('0x22')]({'plain':!![]});var _0x59a866=_0xa46b('0x23');return db[_0xa46b('0x24')][_0xa46b('0x25')]({'where':{'type':_0x59a866,'resourceId':_0x475532['id']}})[_0xa46b('0x21')](function(){return _0x1673e0;});})['then'](function(){_0xe68707['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35c52d,_0x4a81f3){return function(_0x585110){if(!_0x585110){_0x35c52d[_0xa46b('0x26')](0x194);}return _0x585110;};}function handleError(_0x2b6280,_0x4e9c1c){_0x4e9c1c=_0x4e9c1c||0x1f4;return function(_0x5aceb9){logger[_0xa46b('0x27')](_0x5aceb9[_0xa46b('0x28')]);if(_0x5aceb9[_0xa46b('0x29')]){delete _0x5aceb9[_0xa46b('0x29')];}_0x2b6280['status'](_0x4e9c1c)[_0xa46b('0x2a')](_0x5aceb9);};}exports[_0xa46b('0x2b')]=function(_0x3d86e6,_0x5d6888){var _0x143052={},_0x3c1f1a={},_0x496c3f={'count':0x0,'rows':[]};var _0xf39950=_[_0xa46b('0x2c')](db[_0xa46b('0x2d')][_0xa46b('0x2e')],function(_0x400d38){return{'name':_0x400d38[_0xa46b('0x2f')],'type':_0x400d38[_0xa46b('0x30')]['key']};});_0x3c1f1a[_0xa46b('0x31')]=_[_0xa46b('0x2c')](_0xf39950,_0xa46b('0x29'));_0x3c1f1a[_0xa46b('0x32')]=_[_0xa46b('0x33')](_0x3d86e6[_0xa46b('0x32')]);_0x3c1f1a[_0xa46b('0x34')]=_['intersection'](_0x3c1f1a[_0xa46b('0x31')],_0x3c1f1a[_0xa46b('0x32')]);_0x143052[_0xa46b('0x35')]=_[_0xa46b('0x36')](_0x3c1f1a[_0xa46b('0x31')],qs['fields'](_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x37')]));_0x143052[_0xa46b('0x35')]=_0x143052[_0xa46b('0x35')][_0xa46b('0x38')]?_0x143052[_0xa46b('0x35')]:_0x3c1f1a[_0xa46b('0x31')];if(!_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x39')]('nolimit')){_0x143052[_0xa46b('0x1b')]=qs[_0xa46b('0x1b')](_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x1b')]);_0x143052[_0xa46b('0x19')]=qs[_0xa46b('0x19')](_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x19')]);}_0x143052[_0xa46b('0x3a')]=qs[_0xa46b('0x3b')](_0x3d86e6[_0xa46b('0x32')]['sort']);_0x143052['where']=qs[_0xa46b('0x34')](_[_0xa46b('0x3c')](_0x3d86e6[_0xa46b('0x32')],_0x3c1f1a['filters']),_0xf39950);if(_0x3d86e6['query'][_0xa46b('0x3d')]){_0x143052['where']=_[_0xa46b('0x3e')](_0x143052['where'],{'$or':_[_0xa46b('0x2c')](_0xf39950,function(_0x4f0d90){if(_0x4f0d90[_0xa46b('0x30')]!=='VIRTUAL'){var _0x58ed17={};_0x58ed17[_0x4f0d90['name']]={'$like':'%'+_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x3d')]+'%'};return _0x58ed17;}})});}_0x143052=_[_0xa46b('0x3e')]({},_0x143052,_0x3d86e6[_0xa46b('0x3f')]);var _0x1e1af0={'where':_0x143052[_0xa46b('0x40')]};return db[_0xa46b('0x2d')]['count'](_0x1e1af0)[_0xa46b('0x21')](function(_0x559020){_0x496c3f[_0xa46b('0x1c')]=_0x559020;if(_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x41')]){_0x143052[_0xa46b('0x42')]=[{'all':!![]}];}return db[_0xa46b('0x2d')][_0xa46b('0x43')](_0x143052);})[_0xa46b('0x21')](function(_0x4e8503){_0x496c3f['rows']=_0x4e8503;return _0x496c3f;})[_0xa46b('0x21')](respondWithFilteredResult(_0x5d6888,_0x143052))[_0xa46b('0x44')](handleError(_0x5d6888,null));};exports[_0xa46b('0x45')]=function(_0x286db4,_0x4f037e){var _0x1ab6e6={'raw':!![],'where':{'id':_0x286db4[_0xa46b('0x46')]['id']}},_0x57b503={};_0x57b503['model']=_[_0xa46b('0x33')](db['Sound'][_0xa46b('0x2e')]);_0x57b503[_0xa46b('0x32')]=_[_0xa46b('0x33')](_0x286db4[_0xa46b('0x32')]);_0x57b503['filters']=_[_0xa46b('0x36')](_0x57b503[_0xa46b('0x31')],_0x57b503['query']);_0x1ab6e6[_0xa46b('0x35')]=_['intersection'](_0x57b503[_0xa46b('0x31')],qs['fields'](_0x286db4[_0xa46b('0x32')]['fields']));_0x1ab6e6['attributes']=_0x1ab6e6['attributes'][_0xa46b('0x38')]?_0x1ab6e6['attributes']:_0x57b503[_0xa46b('0x31')];if(_0x286db4['query'][_0xa46b('0x41')]){_0x1ab6e6[_0xa46b('0x42')]=[{'all':!![]}];}_0x1ab6e6=_[_0xa46b('0x3e')]({},_0x1ab6e6,_0x286db4[_0xa46b('0x3f')]);return db[_0xa46b('0x2d')]['find'](_0x1ab6e6)['then'](handleEntityNotFound(_0x4f037e,null))[_0xa46b('0x21')](respondWithResult(_0x4f037e,null))['catch'](handleError(_0x4f037e,null));};exports[_0xa46b('0x47')]=function(_0x2463c7,_0x43ad7e,_0xcc8526){return db[_0xa46b('0x2d')]['find']({'where':{'id':_0x2463c7[_0xa46b('0x46')]['id']},'attributes':['name',_0xa46b('0x48'),'converted_format'],'raw':!![]})[_0xa46b('0x21')](handleEntityNotFound(_0x43ad7e,null))['then'](function(_0x177847){if(_0x177847){if(!fs['existsSync'](path[_0xa46b('0x49')](config[_0xa46b('0x4a')],_0xa46b('0x4b'),_0x177847[_0xa46b('0x48')]+'.'+_0x177847[_0xa46b('0x4c')]))){throw new db[(_0xa46b('0x4d'))][(_0xa46b('0x4e'))](_0xa46b('0x4f'));}return _0x43ad7e[_0xa46b('0x47')](path[_0xa46b('0x49')](config[_0xa46b('0x4a')],_0xa46b('0x4b'),util[_0xa46b('0x50')](_0xa46b('0x51'),_0x177847['save_name'],_0x177847[_0xa46b('0x4c')])),util[_0xa46b('0x50')]('%s.%s',_0x177847['name'],_0x177847['converted_format']));}return null;})[_0xa46b('0x44')](handleError(_0x43ad7e,null));};exports[_0xa46b('0x52')]=function(_0x13e812,_0x4b9bf8,_0x3e49d6){var _0x576d3b={'name':path[_0xa46b('0x53')](_0x13e812['file']['originalname'],path[_0xa46b('0x54')](_0x13e812[_0xa46b('0x55')][_0xa46b('0x56')])),'save_name':path[_0xa46b('0x53')](_0x13e812[_0xa46b('0x55')][_0xa46b('0x57')],path[_0xa46b('0x54')](_0x13e812[_0xa46b('0x55')][_0xa46b('0x57')])),'original_format':path[_0xa46b('0x54')](_0x13e812['file'][_0xa46b('0x56')])[_0xa46b('0x58')](0x1),'converted_format':_0xa46b('0x59')};var _0x185ae1=path[_0xa46b('0x49')](config[_0xa46b('0x4a')],_0xa46b('0x5a'),_0x13e812[_0xa46b('0x55')]['filename']);var _0x1ee924=path[_0xa46b('0x49')](config[_0xa46b('0x4a')],_0xa46b('0x4b'),util[_0xa46b('0x50')]('%s.%s',path[_0xa46b('0x53')](_0x13e812['file'][_0xa46b('0x57')],path[_0xa46b('0x54')](_0x13e812['file'][_0xa46b('0x57')])),_0x576d3b[_0xa46b('0x4c')]));logger[_0xa46b('0x5b')](_0xa46b('0x5c'),_0x185ae1);logger[_0xa46b('0x5b')](_0xa46b('0x5d'),_0x1ee924);try{fs[_0xa46b('0x5e')](_0x185ae1,parseInt(_0xa46b('0x5f'),0x8));var _0x533142=sox[_0xa46b('0x60')](_0x185ae1,_0x1ee924,{'sampleRate':0x1f40,'format':_0xa46b('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x533142['on'](_0xa46b('0x27'),function(_0x18b79f){fs[_0xa46b('0x61')](_0x185ae1);_0x4b9bf8[_0xa46b('0x18')](0x1f4)[_0xa46b('0x2a')](_0x18b79f);});_0x533142['on'](_0xa46b('0x62'),function(_0x3e83b5){_0x576d3b[_0xa46b('0x63')]=isNaN(_0x3e83b5[_0xa46b('0x64')])?null:_0x3e83b5[_0xa46b('0x64')]*0x3e8;_0x576d3b[_0xa46b('0x65')]=isNaN(_0x3e83b5[_0xa46b('0x66')])?null:_0x3e83b5[_0xa46b('0x66')];_0x576d3b[_0xa46b('0x67')]=isNaN(_0x3e83b5[_0xa46b('0x68')])?null:_0x3e83b5[_0xa46b('0x68')];_0x576d3b['original_bitRate']=isNaN(_0x3e83b5[_0xa46b('0x69')])?null:_0x3e83b5[_0xa46b('0x69')];_0x576d3b[_0xa46b('0x6a')]=isNaN(_0x3e83b5[_0xa46b('0x6b')])?null:_0x3e83b5[_0xa46b('0x6b')];});_0x533142['on'](_0xa46b('0x6c'),function(_0x4211d1){_0x576d3b['converted_duration']=isNaN(_0x4211d1['duration'])?null:_0x4211d1[_0xa46b('0x64')]*0x3e8;_0x576d3b['converted_sampleCount']=isNaN(_0x4211d1[_0xa46b('0x66')])?null:_0x4211d1[_0xa46b('0x66')];_0x576d3b[_0xa46b('0x6d')]=isNaN(_0x4211d1['channelCount'])?null:_0x4211d1[_0xa46b('0x68')];_0x576d3b[_0xa46b('0x6e')]=isNaN(_0x4211d1['bitRate'])?null:_0x4211d1[_0xa46b('0x69')];_0x576d3b[_0xa46b('0x6f')]=isNaN(_0x4211d1[_0xa46b('0x6b')])?null:_0x4211d1[_0xa46b('0x6b')];});_0x533142['on'](_0xa46b('0x70'),function(){fs[_0xa46b('0x5e')](_0x1ee924,parseInt(_0xa46b('0x5f'),0x8));return db[_0xa46b('0x2d')][_0xa46b('0x52')](_0x576d3b)[_0xa46b('0x21')](function(_0x362e32){var _0x1d6fd0={'role':_0x13e812['body']['role'],'userProfileId':_0x13e812[_0xa46b('0x71')][_0xa46b('0x72')]};if(!_0x1d6fd0)throw new Error(_0xa46b('0x73'));if(_0x1d6fd0[_0xa46b('0x74')]==='user'){var _0x2a4ce2=_0x362e32[_0xa46b('0x22')]({'plain':!![]});return db[_0xa46b('0x75')]['find']({'where':{'name':_0xa46b('0x23'),'userProfileId':_0x1d6fd0['userProfileId']},'raw':!![]})['then'](function(_0x156b0e){if(_0x156b0e&&_0x156b0e[_0xa46b('0x76')]===0x0){return db[_0xa46b('0x24')]['create']({'name':_0x2a4ce2['name'],'resourceId':_0x2a4ce2['id'],'type':_0x156b0e[_0xa46b('0x29')],'sectionId':_0x156b0e['id']},{})[_0xa46b('0x21')](function(){return _0x362e32;});}else{return _0x362e32;}})['catch'](function(_0x2c30be){logger[_0xa46b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c30be);throw _0x2c30be;});}return _0x362e32;})[_0xa46b('0x21')](respondWithResult(_0x4b9bf8,null))[_0xa46b('0x44')](handleError(_0x4b9bf8,null));});_0x533142[_0xa46b('0x77')]();}catch(_0x2284d3){_0x4b9bf8[_0xa46b('0x18')](0x1f4)[_0xa46b('0x2a')](_0x2284d3);}};exports[_0xa46b('0x20')]=function(_0x4f5891,_0x42fabd,_0x45b4d0){return db[_0xa46b('0x2d')]['find']({'where':{'id':_0x4f5891[_0xa46b('0x46')]['id']}})[_0xa46b('0x21')](handleEntityNotFound(_0x42fabd,null))[_0xa46b('0x21')](saveUpdates(_[_0xa46b('0x3c')](_0x4f5891[_0xa46b('0x71')],['name',_0xa46b('0x78')]),null))[_0xa46b('0x21')](respondWithResult(_0x42fabd,null))['catch'](handleError(_0x42fabd,null));};exports[_0xa46b('0x79')]=function(_0x32e0fb,_0x334940,_0x1fef83){return db[_0xa46b('0x2d')]['find']({'where':{'id':_0x32e0fb['params']['id']}})[_0xa46b('0x21')](function(_0x1aa943){if(_0x1aa943){return _0x1aa943['destroy']();}})[_0xa46b('0x21')](function(_0x3ca2ed){var _0x52ad77=path[_0xa46b('0x49')](config['root'],_0xa46b('0x5a'),util['format'](_0xa46b('0x51'),_0x3ca2ed[_0xa46b('0x48')],_0x3ca2ed['original_format']));var _0x224061=path[_0xa46b('0x49')](config[_0xa46b('0x4a')],'server/files/sounds/converted',util[_0xa46b('0x50')](_0xa46b('0x51'),_0x3ca2ed[_0xa46b('0x48')],_0x3ca2ed[_0xa46b('0x4c')]));fs[_0xa46b('0x61')](_0x52ad77);fs[_0xa46b('0x61')](_0x224061);return _0x3ca2ed;})[_0xa46b('0x21')](function(_0x2fc0ae){if(_0x2fc0ae){return _0x334940[_0xa46b('0x18')](0xcc)['end']();}})[_0xa46b('0x21')](handleEntityNotFound(_0x334940,null))[_0xa46b('0x44')](handleError(_0x334940,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f627d0b..6c3c588 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 _0xa4d0=['tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','Sound'];(function(_0x32753a,_0x313eff){var _0x5cc638=function(_0x87e14c){while(--_0x87e14c){_0x32753a['push'](_0x32753a['shift']());}};_0x5cc638(++_0x313eff);}(_0xa4d0,0xd1));var _0x0a4d=function(_0x95ee74,_0x2efe97){_0x95ee74=_0x95ee74-0x0;var _0xd45707=_0xa4d0[_0x95ee74];return _0xd45707;};'use strict';var _=require(_0x0a4d('0x0'));var util=require(_0x0a4d('0x1'));var logger=require(_0x0a4d('0x2'))(_0x0a4d('0x3'));var moment=require(_0x0a4d('0x4'));var BPromise=require(_0x0a4d('0x5'));var rp=require(_0x0a4d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a4d('0x7'));var config=require(_0x0a4d('0x8'));var attributes=require(_0x0a4d('0x9'));module[_0x0a4d('0xa')]=function(_0x5d1e77,_0x1b3b79){return _0x5d1e77['define'](_0x0a4d('0xb'),attributes,{'tableName':_0x0a4d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51af=['../../config/environment','./sound.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird','rimraf'];(function(_0x53a1ba,_0x17136b){var _0xf7e6cb=function(_0x50d7be){while(--_0x50d7be){_0x53a1ba['push'](_0x53a1ba['shift']());}};_0xf7e6cb(++_0x17136b);}(_0x51af,0xf4));var _0xf51a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x51af[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xf51a('0x0'));var util=require(_0xf51a('0x1'));var logger=require(_0xf51a('0x2'))('api');var moment=require(_0xf51a('0x3'));var BPromise=require(_0xf51a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf51a('0x5'));var config=require(_0xf51a('0x6'));var attributes=require(_0xf51a('0x7'));module[_0xf51a('0x8')]=function(_0xc66017,_0x999f3a){return _0xc66017[_0xf51a('0x9')]('Sound',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 fa513b4..9955236 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 _0x0705=['attributes','ShowSound','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','where','include','map','model'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x0705,0xce));var _0x5070=function(_0x34ac63,_0x40f4da){_0x34ac63=_0x34ac63-0x0;var _0x44aee2=_0x0705[_0x34ac63];return _0x44aee2;};'use strict';var _=require(_0x5070('0x0'));var util=require(_0x5070('0x1'));var moment=require(_0x5070('0x2'));var BPromise=require(_0x5070('0x3'));var rs=require(_0x5070('0x4'));var fs=require('fs');var Redis=require(_0x5070('0x5'));var db=require(_0x5070('0x6'))['db'];var utils=require(_0x5070('0x7'));var logger=require(_0x5070('0x8'))(_0x5070('0x9'));var config=require(_0x5070('0xa'));var jayson=require(_0x5070('0xb'));var client=jayson[_0x5070('0xc')][_0x5070('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xe5fc42,_0x3e50c8,_0x31eb95){return new BPromise(function(_0xef7b22,_0x9b406e){return client[_0x5070('0xe')](_0xe5fc42,_0x31eb95)[_0x5070('0xf')](function(_0x29f74c){logger[_0x5070('0x10')](_0x5070('0x11'),_0x3e50c8,_0x5070('0x12'));logger[_0x5070('0x13')](_0x5070('0x14'),_0x3e50c8,_0x5070('0x12'),JSON[_0x5070('0x15')](_0x29f74c));if(_0x29f74c['error']){if(_0x29f74c[_0x5070('0x16')][_0x5070('0x17')]===0x1f4){logger[_0x5070('0x16')](_0x5070('0x11'),_0x3e50c8,_0x29f74c['error']['message']);return _0x9b406e(_0x29f74c['error'][_0x5070('0x18')]);}logger[_0x5070('0x16')]('Sound,\x20%s,\x20%s',_0x3e50c8,_0x29f74c[_0x5070('0x16')][_0x5070('0x18')]);return _0xef7b22(_0x29f74c['error'][_0x5070('0x18')]);}else{logger[_0x5070('0x10')]('Sound,\x20%s,\x20%s',_0x3e50c8,_0x5070('0x12'));_0xef7b22(_0x29f74c[_0x5070('0x19')][_0x5070('0x18')]);}})[_0x5070('0x1a')](function(_0x3598e8){logger[_0x5070('0x16')](_0x5070('0x11'),_0x3e50c8,_0x3598e8);_0x9b406e(_0x3598e8);});});}exports['ShowSound']=function(_0x3fdae9){var _0x8bd88a=this;return new Promise(function(_0x3ba1e0,_0x4b1996){return db['Sound']['find']({'raw':_0x3fdae9[_0x5070('0x1b')]?_0x3fdae9[_0x5070('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3fdae9[_0x5070('0x1b')]?_0x3fdae9['options'][_0x5070('0x1c')]||null:null,'attributes':_0x3fdae9[_0x5070('0x1b')]?_0x3fdae9[_0x5070('0x1b')]['attributes']||null:null,'include':_0x3fdae9[_0x5070('0x1b')]?_0x3fdae9[_0x5070('0x1b')][_0x5070('0x1d')]?_[_0x5070('0x1e')](_0x3fdae9['options'][_0x5070('0x1d')],function(_0x25a881){return{'model':db[_0x25a881[_0x5070('0x1f')]],'as':_0x25a881['as'],'attributes':_0x25a881[_0x5070('0x20')],'include':_0x25a881[_0x5070('0x1d')]?_[_0x5070('0x1e')](_0x25a881['include'],function(_0x1aa7ba){return{'model':db[_0x1aa7ba[_0x5070('0x1f')]],'as':_0x1aa7ba['as'],'attributes':_0x1aa7ba['attributes'],'include':_0x1aa7ba[_0x5070('0x1d')]?_[_0x5070('0x1e')](_0x1aa7ba[_0x5070('0x1d')],function(_0x242f59){return{'model':db[_0x242f59[_0x5070('0x1f')]],'as':_0x242f59['as'],'attributes':_0x242f59[_0x5070('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5070('0xf')](function(_0x19e1b3){logger[_0x5070('0x10')]('ShowSound',_0x3fdae9);logger[_0x5070('0x13')](_0x5070('0x21'),_0x3fdae9,JSON['stringify'](_0x19e1b3));_0x3ba1e0(_0x19e1b3);})[_0x5070('0x1a')](function(_0x8174cc){logger[_0x5070('0x16')](_0x5070('0x21'),_0x8174cc[_0x5070('0x18')],_0x3fdae9);_0x4b1996(_0x8bd88a[_0x5070('0x16')](0x1f4,_0x8174cc[_0x5070('0x18')]));});});}; \ No newline at end of file +var _0x1ad7=['Sound','find','options','raw','where','include','map','model','attributes','then','debug','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSound'];(function(_0x141bd8,_0xde2cfa){var _0x343827=function(_0x3fbed9){while(--_0x3fbed9){_0x141bd8['push'](_0x141bd8['shift']());}};_0x343827(++_0xde2cfa);}(_0x1ad7,0x16b));var _0x71ad=function(_0x5c619e,_0x1bccdf){_0x5c619e=_0x5c619e-0x0;var _0x445cf8=_0x1ad7[_0x5c619e];return _0x445cf8;};'use strict';var _=require('lodash');var util=require(_0x71ad('0x0'));var moment=require(_0x71ad('0x1'));var BPromise=require(_0x71ad('0x2'));var rs=require(_0x71ad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x71ad('0x4'));var logger=require(_0x71ad('0x5'))(_0x71ad('0x6'));var config=require(_0x71ad('0x7'));var jayson=require(_0x71ad('0x8'));var client=jayson['client'][_0x71ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x432e49,_0x331cb2,_0xe7327f){return new BPromise(function(_0x551f96,_0x4bb973){return client[_0x71ad('0xa')](_0x432e49,_0xe7327f)['then'](function(_0x416863){logger[_0x71ad('0xb')](_0x71ad('0xc'),_0x331cb2,'request\x20sent');logger['debug'](_0x71ad('0xd'),_0x331cb2,_0x71ad('0xe'),JSON[_0x71ad('0xf')](_0x416863));if(_0x416863[_0x71ad('0x10')]){if(_0x416863['error']['code']===0x1f4){logger[_0x71ad('0x10')]('Sound,\x20%s,\x20%s',_0x331cb2,_0x416863[_0x71ad('0x10')][_0x71ad('0x11')]);return _0x4bb973(_0x416863['error'][_0x71ad('0x11')]);}logger[_0x71ad('0x10')](_0x71ad('0xc'),_0x331cb2,_0x416863['error'][_0x71ad('0x11')]);return _0x551f96(_0x416863[_0x71ad('0x10')][_0x71ad('0x11')]);}else{logger[_0x71ad('0xb')](_0x71ad('0xc'),_0x331cb2,_0x71ad('0xe'));_0x551f96(_0x416863[_0x71ad('0x12')][_0x71ad('0x11')]);}})[_0x71ad('0x13')](function(_0x10cc9d){logger[_0x71ad('0x10')]('Sound,\x20%s,\x20%s',_0x331cb2,_0x10cc9d);_0x4bb973(_0x10cc9d);});});}exports[_0x71ad('0x14')]=function(_0x3e6be8){var _0x26ddde=this;return new Promise(function(_0x59898d,_0x4daef6){return db[_0x71ad('0x15')][_0x71ad('0x16')]({'raw':_0x3e6be8['options']?_0x3e6be8[_0x71ad('0x17')][_0x71ad('0x18')]===undefined?!![]:![]:!![],'where':_0x3e6be8['options']?_0x3e6be8['options'][_0x71ad('0x19')]||null:null,'attributes':_0x3e6be8[_0x71ad('0x17')]?_0x3e6be8['options']['attributes']||null:null,'include':_0x3e6be8[_0x71ad('0x17')]?_0x3e6be8[_0x71ad('0x17')][_0x71ad('0x1a')]?_[_0x71ad('0x1b')](_0x3e6be8['options'][_0x71ad('0x1a')],function(_0xb523e0){return{'model':db[_0xb523e0[_0x71ad('0x1c')]],'as':_0xb523e0['as'],'attributes':_0xb523e0[_0x71ad('0x1d')],'include':_0xb523e0[_0x71ad('0x1a')]?_[_0x71ad('0x1b')](_0xb523e0[_0x71ad('0x1a')],function(_0x4150b2){return{'model':db[_0x4150b2[_0x71ad('0x1c')]],'as':_0x4150b2['as'],'attributes':_0x4150b2[_0x71ad('0x1d')],'include':_0x4150b2[_0x71ad('0x1a')]?_[_0x71ad('0x1b')](_0x4150b2['include'],function(_0x33ea1f){return{'model':db[_0x33ea1f[_0x71ad('0x1c')]],'as':_0x33ea1f['as'],'attributes':_0x33ea1f[_0x71ad('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x71ad('0x1e')](function(_0x22c83e){logger['info'](_0x71ad('0x14'),_0x3e6be8);logger[_0x71ad('0x1f')](_0x71ad('0x14'),_0x3e6be8,JSON[_0x71ad('0xf')](_0x22c83e));_0x59898d(_0x22c83e);})['catch'](function(_0x340704){logger[_0x71ad('0x10')](_0x71ad('0x14'),_0x340704[_0x71ad('0x11')],_0x3e6be8);_0x4daef6(_0x26ddde[_0x71ad('0x10')](0x1f4,_0x340704[_0x71ad('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 1fd6bd0..e6989ce 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(_0x269e23,_0x14d11c){var _0x69ad53=function(_0x34066c){while(--_0x34066c){_0x269e23['push'](_0x269e23['shift']());}};_0x69ad53(++_0x14d11c);}(_0x4fc2,0x111));var _0x24fc=function(_0x149653,_0x3bcd29){_0x149653=_0x149653-0x0;var _0x12bfff=_0x4fc2[_0x149653];return _0x12bfff;};'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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x306409,_0x2971a5){var _0x1712bc=function(_0x368efc){while(--_0x368efc){_0x306409['push'](_0x306409['shift']());}};_0x1712bc(++_0x2971a5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index aeaefb3..a906ce0 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 _0x4e58=['TEXT','ENUM','out','exports','STRING'];(function(_0x52c118,_0x409c00){var _0x566b96=function(_0x516a3f){while(--_0x516a3f){_0x52c118['push'](_0x52c118['shift']());}};_0x566b96(++_0x409c00);}(_0x4e58,0x11b));var _0x84e5=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x4e58[_0x1fa759];return _0x2da9f4;};'use strict';var Sequelize=require('sequelize');module[_0x84e5('0x0')]={'uniqueid':{'type':Sequelize[_0x84e5('0x1')]},'body':{'type':Sequelize[_0x84e5('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x84e5('0x3')]('in',_0x84e5('0x4')),'defaultValue':_0x84e5('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x84e5('0x1')]},'providerResponse':{'type':Sequelize[_0x84e5('0x2')]}}; \ No newline at end of file +var _0xc779=['sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0xc779,0xde));var _0x9c77=function(_0x176167,_0x5d0d05){_0x176167=_0x176167-0x0;var _0x987919=_0xc779[_0x176167];return _0x987919;};'use strict';var Sequelize=require(_0x9c77('0x0'));module[_0x9c77('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x9c77('0x2')](_0x9c77('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9c77('0x4')]('in',_0x9c77('0x5')),'defaultValue':_0x9c77('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'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 df23b89..2eda417 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 _0xe1bd=['save','then','destroy','error','stack','send','index','SquareMessage','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','name','options','includeAll','findAll','rows','catch','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0xb746a4,_0x355bdc){var _0x4b6a58=function(_0x3ebf70){while(--_0x3ebf70){_0xb746a4['push'](_0xb746a4['shift']());}};_0x4b6a58(++_0x355bdc);}(_0xe1bd,0x1a3));var _0xde1b=function(_0x5f5c9b,_0x57a7c5){_0x5f5c9b=_0x5f5c9b-0x0;var _0x3486de=_0xe1bd[_0x5f5c9b];return _0x3486de;};'use strict';var emlformat=require(_0xde1b('0x0'));var rimraf=require(_0xde1b('0x1'));var zipdir=require(_0xde1b('0x2'));var jsonpatch=require(_0xde1b('0x3'));var rp=require(_0xde1b('0x4'));var moment=require(_0xde1b('0x5'));var BPromise=require(_0xde1b('0x6'));var Mustache=require(_0xde1b('0x7'));var util=require(_0xde1b('0x8'));var path=require(_0xde1b('0x9'));var sox=require('sox');var csv=require(_0xde1b('0xa'));var ejs=require(_0xde1b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde1b('0xc'));var squel=require(_0xde1b('0xd'));var crypto=require(_0xde1b('0xe'));var jsforce=require(_0xde1b('0xf'));var deskjs=require(_0xde1b('0x10'));var toCsv=require(_0xde1b('0xa'));var querystring=require(_0xde1b('0x11'));var Papa=require('papaparse');var Redis=require(_0xde1b('0x12'));var authService=require(_0xde1b('0x13'));var qs=require(_0xde1b('0x14'));var as=require(_0xde1b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde1b('0x16'));var utils=require('../../config/utils');var config=require(_0xde1b('0x17'));var licenseUtil=require(_0xde1b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfec5d6,_0xb46906){_0xb46906=_0xb46906||0xcc;return function(_0x58a637){if(_0x58a637){return _0xfec5d6[_0xde1b('0x19')](_0xb46906);}return _0xfec5d6[_0xde1b('0x1a')](_0xb46906)[_0xde1b('0x1b')]();};}function respondWithResult(_0x35ee00,_0x44168e){_0x44168e=_0x44168e||0xc8;return function(_0x5af5a4){if(_0x5af5a4){return _0x35ee00[_0xde1b('0x1a')](_0x44168e)[_0xde1b('0x1c')](_0x5af5a4);}};}function respondWithFilteredResult(_0x59e81a,_0x1ee14e){return function(_0x379740){if(_0x379740){var _0x12e8c0=typeof _0x1ee14e['offset']===_0xde1b('0x1d')&&typeof _0x1ee14e[_0xde1b('0x1e')]===_0xde1b('0x1d');var _0x3b97ad=_0x379740[_0xde1b('0x1f')];var _0x4d0557=_0x12e8c0?0x0:_0x1ee14e['offset'];var _0x4c9404=_0x12e8c0?_0x379740[_0xde1b('0x1f')]:_0x1ee14e[_0xde1b('0x20')]+_0x1ee14e['limit'];var _0x42cc27;if(_0x4c9404>=_0x3b97ad){_0x4c9404=_0x3b97ad;_0x42cc27=0xc8;}else{_0x42cc27=0xce;}_0x59e81a['status'](_0x42cc27);return _0x59e81a[_0xde1b('0x21')](_0xde1b('0x22'),_0x4d0557+'-'+_0x4c9404+'/'+_0x3b97ad)[_0xde1b('0x1c')](_0x379740);}return null;};}function patchUpdates(_0x56a024){return function(_0x40dbe2){try{jsonpatch[_0xde1b('0x23')](_0x40dbe2,_0x56a024,!![]);}catch(_0x54781b){return BPromise[_0xde1b('0x24')](_0x54781b);}return _0x40dbe2[_0xde1b('0x25')]();};}function saveUpdates(_0xeb5a77,_0xdf8c24){return function(_0x38f1ee){if(_0x38f1ee){return _0x38f1ee['update'](_0xeb5a77)[_0xde1b('0x26')](function(_0x1207aa){return _0x1207aa;});}return null;};}function removeEntity(_0x284780,_0x8681dd){return function(_0x556655){if(_0x556655){return _0x556655[_0xde1b('0x27')]()['then'](function(){_0x284780[_0xde1b('0x1a')](0xcc)[_0xde1b('0x1b')]();});}};}function handleEntityNotFound(_0x156241,_0x23ca5c){return function(_0x5041ce){if(!_0x5041ce){_0x156241[_0xde1b('0x19')](0x194);}return _0x5041ce;};}function handleError(_0xe6b097,_0x322b97){_0x322b97=_0x322b97||0x1f4;return function(_0x4d0873){logger[_0xde1b('0x28')](_0x4d0873[_0xde1b('0x29')]);if(_0x4d0873['name']){delete _0x4d0873['name'];}_0xe6b097[_0xde1b('0x1a')](_0x322b97)[_0xde1b('0x2a')](_0x4d0873);};}exports[_0xde1b('0x2b')]=function(_0x306031,_0x111073){var _0x444fba={},_0x278ead={},_0x517ada={'count':0x0,'rows':[]};var _0xc945b5=_['map'](db[_0xde1b('0x2c')][_0xde1b('0x2d')],function(_0x36f4fb){return{'name':_0x36f4fb['fieldName'],'type':_0x36f4fb['type'][_0xde1b('0x2e')]};});_0x278ead[_0xde1b('0x2f')]=_[_0xde1b('0x30')](_0xc945b5,'name');_0x278ead[_0xde1b('0x31')]=_[_0xde1b('0x32')](_0x306031[_0xde1b('0x31')]);_0x278ead[_0xde1b('0x33')]=_['intersection'](_0x278ead[_0xde1b('0x2f')],_0x278ead[_0xde1b('0x31')]);_0x444fba[_0xde1b('0x34')]=_[_0xde1b('0x35')](_0x278ead['model'],qs[_0xde1b('0x36')](_0x306031[_0xde1b('0x31')][_0xde1b('0x36')]));_0x444fba[_0xde1b('0x34')]=_0x444fba[_0xde1b('0x34')][_0xde1b('0x37')]?_0x444fba['attributes']:_0x278ead[_0xde1b('0x2f')];if(!_0x306031['query'][_0xde1b('0x38')](_0xde1b('0x39'))){_0x444fba[_0xde1b('0x1e')]=qs[_0xde1b('0x1e')](_0x306031['query'][_0xde1b('0x1e')]);_0x444fba[_0xde1b('0x20')]=qs['offset'](_0x306031[_0xde1b('0x31')][_0xde1b('0x20')]);}_0x444fba[_0xde1b('0x3a')]=qs[_0xde1b('0x3b')](_0x306031['query'][_0xde1b('0x3b')]);_0x444fba[_0xde1b('0x3c')]=qs['filters'](_['pick'](_0x306031[_0xde1b('0x31')],_0x278ead[_0xde1b('0x33')]),_0xc945b5);if(_0x306031[_0xde1b('0x31')][_0xde1b('0x3d')]){_0x444fba[_0xde1b('0x3c')]=_[_0xde1b('0x3e')](_0x444fba[_0xde1b('0x3c')],{'$or':_[_0xde1b('0x30')](_0xc945b5,function(_0x4e8537){if(_0x4e8537[_0xde1b('0x3f')]!==_0xde1b('0x40')){var _0xce4754={};_0xce4754[_0x4e8537[_0xde1b('0x41')]]={'$like':'%'+_0x306031[_0xde1b('0x31')][_0xde1b('0x3d')]+'%'};return _0xce4754;}})});}_0x444fba=_[_0xde1b('0x3e')]({},_0x444fba,_0x306031[_0xde1b('0x42')]);var _0x143cc1={'where':_0x444fba['where']};return db[_0xde1b('0x2c')][_0xde1b('0x1f')](_0x143cc1)[_0xde1b('0x26')](function(_0x4bb478){_0x517ada[_0xde1b('0x1f')]=_0x4bb478;if(_0x306031['query'][_0xde1b('0x43')]){_0x444fba['include']=[{'all':!![]}];}return db[_0xde1b('0x2c')][_0xde1b('0x44')](_0x444fba);})[_0xde1b('0x26')](function(_0x3a3a70){_0x517ada[_0xde1b('0x45')]=_0x3a3a70;return _0x517ada;})['then'](respondWithFilteredResult(_0x111073,_0x444fba))[_0xde1b('0x46')](handleError(_0x111073,null));};exports['show']=function(_0x4a36e7,_0x247be3){var _0x35fd39={'raw':!![],'where':{'id':_0x4a36e7[_0xde1b('0x47')]['id']}},_0x3b3dd3={};_0x3b3dd3['model']=_[_0xde1b('0x32')](db[_0xde1b('0x2c')][_0xde1b('0x2d')]);_0x3b3dd3[_0xde1b('0x31')]=_['keys'](_0x4a36e7['query']);_0x3b3dd3[_0xde1b('0x33')]=_[_0xde1b('0x35')](_0x3b3dd3[_0xde1b('0x2f')],_0x3b3dd3[_0xde1b('0x31')]);_0x35fd39[_0xde1b('0x34')]=_[_0xde1b('0x35')](_0x3b3dd3['model'],qs[_0xde1b('0x36')](_0x4a36e7[_0xde1b('0x31')][_0xde1b('0x36')]));_0x35fd39[_0xde1b('0x34')]=_0x35fd39[_0xde1b('0x34')][_0xde1b('0x37')]?_0x35fd39['attributes']:_0x3b3dd3[_0xde1b('0x2f')];if(_0x4a36e7[_0xde1b('0x31')]['includeAll']){_0x35fd39[_0xde1b('0x48')]=[{'all':!![]}];}_0x35fd39=_[_0xde1b('0x3e')]({},_0x35fd39,_0x4a36e7[_0xde1b('0x42')]);return db[_0xde1b('0x2c')][_0xde1b('0x49')](_0x35fd39)['then'](handleEntityNotFound(_0x247be3,null))['then'](respondWithResult(_0x247be3,null))[_0xde1b('0x46')](handleError(_0x247be3,null));};exports[_0xde1b('0x4a')]=function(_0x463175,_0x48dae2){return db[_0xde1b('0x2c')]['create'](_0x463175['body'],{})[_0xde1b('0x26')](respondWithResult(_0x48dae2,0xc9))[_0xde1b('0x46')](handleError(_0x48dae2,null));};exports['update']=function(_0x23673c,_0x2811b7){if(_0x23673c[_0xde1b('0x4b')]['id']){delete _0x23673c[_0xde1b('0x4b')]['id'];}return db[_0xde1b('0x2c')][_0xde1b('0x49')]({'where':{'id':_0x23673c[_0xde1b('0x47')]['id']}})[_0xde1b('0x26')](handleEntityNotFound(_0x2811b7,null))[_0xde1b('0x26')](saveUpdates(_0x23673c['body'],null))[_0xde1b('0x26')](respondWithResult(_0x2811b7,null))[_0xde1b('0x46')](handleError(_0x2811b7,null));};exports['destroy']=function(_0x41e22b,_0x5f378c){return db[_0xde1b('0x2c')][_0xde1b('0x49')]({'where':{'id':_0x41e22b[_0xde1b('0x47')]['id']}})['then'](handleEntityNotFound(_0x5f378c,null))[_0xde1b('0x26')](removeEntity(_0x5f378c,null))[_0xde1b('0x46')](handleError(_0x5f378c,null));}; \ No newline at end of file +var _0xa6f8=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy'];(function(_0x7a84f2,_0x1e1e67){var _0x2822f0=function(_0x5eac00){while(--_0x5eac00){_0x7a84f2['push'](_0x7a84f2['shift']());}};_0x2822f0(++_0x1e1e67);}(_0xa6f8,0x94));var _0x8a6f=function(_0x1b3f52,_0x4f5b13){_0x1b3f52=_0x1b3f52-0x0;var _0x36bf2c=_0xa6f8[_0x1b3f52];return _0x36bf2c;};'use strict';var emlformat=require(_0x8a6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a6f('0x1'));var jsonpatch=require(_0x8a6f('0x2'));var rp=require(_0x8a6f('0x3'));var moment=require(_0x8a6f('0x4'));var BPromise=require(_0x8a6f('0x5'));var Mustache=require(_0x8a6f('0x6'));var util=require(_0x8a6f('0x7'));var path=require(_0x8a6f('0x8'));var sox=require(_0x8a6f('0x9'));var csv=require('to-csv');var ejs=require(_0x8a6f('0xa'));var fs=require('fs');var fs_extra=require(_0x8a6f('0xb'));var _=require(_0x8a6f('0xc'));var squel=require('squel');var crypto=require(_0x8a6f('0xd'));var jsforce=require(_0x8a6f('0xe'));var deskjs=require(_0x8a6f('0xf'));var toCsv=require(_0x8a6f('0x10'));var querystring=require(_0x8a6f('0x11'));var Papa=require(_0x8a6f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a6f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a6f('0x14'))('api');var utils=require(_0x8a6f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8a6f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x140c65,_0x1fff9f){_0x1fff9f=_0x1fff9f||0xcc;return function(_0x2c40db){if(_0x2c40db){return _0x140c65['sendStatus'](_0x1fff9f);}return _0x140c65[_0x8a6f('0x17')](_0x1fff9f)['end']();};}function respondWithResult(_0x5568c4,_0x3e1c07){_0x3e1c07=_0x3e1c07||0xc8;return function(_0x5aacc9){if(_0x5aacc9){return _0x5568c4[_0x8a6f('0x17')](_0x3e1c07)[_0x8a6f('0x18')](_0x5aacc9);}};}function respondWithFilteredResult(_0x478c3a,_0x2fde81){return function(_0x8418d){if(_0x8418d){var _0x496a5f=typeof _0x2fde81['offset']==='undefined'&&typeof _0x2fde81['limit']===_0x8a6f('0x19');var _0x4cd281=_0x8418d[_0x8a6f('0x1a')];var _0x3f7760=_0x496a5f?0x0:_0x2fde81[_0x8a6f('0x1b')];var _0x4ec3fb=_0x496a5f?_0x8418d[_0x8a6f('0x1a')]:_0x2fde81[_0x8a6f('0x1b')]+_0x2fde81[_0x8a6f('0x1c')];var _0x28e9df;if(_0x4ec3fb>=_0x4cd281){_0x4ec3fb=_0x4cd281;_0x28e9df=0xc8;}else{_0x28e9df=0xce;}_0x478c3a[_0x8a6f('0x17')](_0x28e9df);return _0x478c3a[_0x8a6f('0x1d')]('Content-Range',_0x3f7760+'-'+_0x4ec3fb+'/'+_0x4cd281)['json'](_0x8418d);}return null;};}function patchUpdates(_0x3fad42){return function(_0x4b453a){try{jsonpatch[_0x8a6f('0x1e')](_0x4b453a,_0x3fad42,!![]);}catch(_0xe08190){return BPromise[_0x8a6f('0x1f')](_0xe08190);}return _0x4b453a[_0x8a6f('0x20')]();};}function saveUpdates(_0x3f6f5c,_0x189c35){return function(_0x4a380a){if(_0x4a380a){return _0x4a380a[_0x8a6f('0x21')](_0x3f6f5c)[_0x8a6f('0x22')](function(_0x1ae4c4){return _0x1ae4c4;});}return null;};}function removeEntity(_0x1b943b,_0xf124b2){return function(_0x15cebe){if(_0x15cebe){return _0x15cebe['destroy']()[_0x8a6f('0x22')](function(){_0x1b943b[_0x8a6f('0x17')](0xcc)[_0x8a6f('0x23')]();});}};}function handleEntityNotFound(_0x245007,_0x1f2607){return function(_0x4266e0){if(!_0x4266e0){_0x245007[_0x8a6f('0x24')](0x194);}return _0x4266e0;};}function handleError(_0x33fa2e,_0x4d11c6){_0x4d11c6=_0x4d11c6||0x1f4;return function(_0x3ac959){logger[_0x8a6f('0x25')](_0x3ac959[_0x8a6f('0x26')]);if(_0x3ac959['name']){delete _0x3ac959[_0x8a6f('0x27')];}_0x33fa2e[_0x8a6f('0x17')](_0x4d11c6)[_0x8a6f('0x28')](_0x3ac959);};}exports[_0x8a6f('0x29')]=function(_0x104d04,_0x5395ae){var _0x5e42fc={},_0x5b87b4={},_0x37c966={'count':0x0,'rows':[]};var _0x2cc465=_[_0x8a6f('0x2a')](db[_0x8a6f('0x2b')][_0x8a6f('0x2c')],function(_0x27a35b){return{'name':_0x27a35b[_0x8a6f('0x2d')],'type':_0x27a35b[_0x8a6f('0x2e')]['key']};});_0x5b87b4[_0x8a6f('0x2f')]=_[_0x8a6f('0x2a')](_0x2cc465,_0x8a6f('0x27'));_0x5b87b4[_0x8a6f('0x30')]=_[_0x8a6f('0x31')](_0x104d04[_0x8a6f('0x30')]);_0x5b87b4[_0x8a6f('0x32')]=_[_0x8a6f('0x33')](_0x5b87b4[_0x8a6f('0x2f')],_0x5b87b4[_0x8a6f('0x30')]);_0x5e42fc[_0x8a6f('0x34')]=_[_0x8a6f('0x33')](_0x5b87b4['model'],qs[_0x8a6f('0x35')](_0x104d04[_0x8a6f('0x30')][_0x8a6f('0x35')]));_0x5e42fc[_0x8a6f('0x34')]=_0x5e42fc[_0x8a6f('0x34')][_0x8a6f('0x36')]?_0x5e42fc[_0x8a6f('0x34')]:_0x5b87b4[_0x8a6f('0x2f')];if(!_0x104d04[_0x8a6f('0x30')][_0x8a6f('0x37')](_0x8a6f('0x38'))){_0x5e42fc['limit']=qs[_0x8a6f('0x1c')](_0x104d04[_0x8a6f('0x30')]['limit']);_0x5e42fc[_0x8a6f('0x1b')]=qs[_0x8a6f('0x1b')](_0x104d04['query'][_0x8a6f('0x1b')]);}_0x5e42fc[_0x8a6f('0x39')]=qs[_0x8a6f('0x3a')](_0x104d04['query'][_0x8a6f('0x3a')]);_0x5e42fc[_0x8a6f('0x3b')]=qs['filters'](_[_0x8a6f('0x3c')](_0x104d04[_0x8a6f('0x30')],_0x5b87b4[_0x8a6f('0x32')]),_0x2cc465);if(_0x104d04[_0x8a6f('0x30')]['filter']){_0x5e42fc[_0x8a6f('0x3b')]=_[_0x8a6f('0x3d')](_0x5e42fc[_0x8a6f('0x3b')],{'$or':_[_0x8a6f('0x2a')](_0x2cc465,function(_0x21cdee){if(_0x21cdee[_0x8a6f('0x2e')]!==_0x8a6f('0x3e')){var _0x1b1942={};_0x1b1942[_0x21cdee[_0x8a6f('0x27')]]={'$like':'%'+_0x104d04[_0x8a6f('0x30')]['filter']+'%'};return _0x1b1942;}})});}_0x5e42fc=_[_0x8a6f('0x3d')]({},_0x5e42fc,_0x104d04[_0x8a6f('0x3f')]);var _0x180f9b={'where':_0x5e42fc[_0x8a6f('0x3b')]};return db[_0x8a6f('0x2b')][_0x8a6f('0x1a')](_0x180f9b)['then'](function(_0x327993){_0x37c966[_0x8a6f('0x1a')]=_0x327993;if(_0x104d04[_0x8a6f('0x30')][_0x8a6f('0x40')]){_0x5e42fc['include']=[{'all':!![]}];}return db['SquareMessage'][_0x8a6f('0x41')](_0x5e42fc);})[_0x8a6f('0x22')](function(_0x1d696d){_0x37c966['rows']=_0x1d696d;return _0x37c966;})[_0x8a6f('0x22')](respondWithFilteredResult(_0x5395ae,_0x5e42fc))[_0x8a6f('0x42')](handleError(_0x5395ae,null));};exports[_0x8a6f('0x43')]=function(_0x129d73,_0x49d28e){var _0x3f92f6={'raw':!![],'where':{'id':_0x129d73[_0x8a6f('0x44')]['id']}},_0xabf44a={};_0xabf44a['model']=_[_0x8a6f('0x31')](db[_0x8a6f('0x2b')][_0x8a6f('0x2c')]);_0xabf44a['query']=_[_0x8a6f('0x31')](_0x129d73[_0x8a6f('0x30')]);_0xabf44a[_0x8a6f('0x32')]=_[_0x8a6f('0x33')](_0xabf44a[_0x8a6f('0x2f')],_0xabf44a[_0x8a6f('0x30')]);_0x3f92f6[_0x8a6f('0x34')]=_[_0x8a6f('0x33')](_0xabf44a[_0x8a6f('0x2f')],qs[_0x8a6f('0x35')](_0x129d73['query']['fields']));_0x3f92f6[_0x8a6f('0x34')]=_0x3f92f6[_0x8a6f('0x34')]['length']?_0x3f92f6[_0x8a6f('0x34')]:_0xabf44a['model'];if(_0x129d73[_0x8a6f('0x30')]['includeAll']){_0x3f92f6[_0x8a6f('0x45')]=[{'all':!![]}];}_0x3f92f6=_[_0x8a6f('0x3d')]({},_0x3f92f6,_0x129d73[_0x8a6f('0x3f')]);return db[_0x8a6f('0x2b')][_0x8a6f('0x46')](_0x3f92f6)[_0x8a6f('0x22')](handleEntityNotFound(_0x49d28e,null))[_0x8a6f('0x22')](respondWithResult(_0x49d28e,null))['catch'](handleError(_0x49d28e,null));};exports[_0x8a6f('0x47')]=function(_0x208c21,_0x52c655){return db['SquareMessage']['create'](_0x208c21[_0x8a6f('0x48')],{})[_0x8a6f('0x22')](respondWithResult(_0x52c655,0xc9))['catch'](handleError(_0x52c655,null));};exports[_0x8a6f('0x21')]=function(_0x576e31,_0x39507c){if(_0x576e31[_0x8a6f('0x48')]['id']){delete _0x576e31[_0x8a6f('0x48')]['id'];}return db[_0x8a6f('0x2b')]['find']({'where':{'id':_0x576e31[_0x8a6f('0x44')]['id']}})[_0x8a6f('0x22')](handleEntityNotFound(_0x39507c,null))[_0x8a6f('0x22')](saveUpdates(_0x576e31[_0x8a6f('0x48')],null))['then'](respondWithResult(_0x39507c,null))[_0x8a6f('0x42')](handleError(_0x39507c,null));};exports[_0x8a6f('0x49')]=function(_0x5c9848,_0x23cc12){return db['SquareMessage'][_0x8a6f('0x46')]({'where':{'id':_0x5c9848[_0x8a6f('0x44')]['id']}})[_0x8a6f('0x22')](handleEntityNotFound(_0x23cc12,null))[_0x8a6f('0x22')](removeEntity(_0x23cc12,null))[_0x8a6f('0x42')](handleError(_0x23cc12,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 134b2f6..42ea48e 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 _0x5d21=['exports','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x552b6a,_0x3748ef){var _0x491222=function(_0x4a6f96){while(--_0x4a6f96){_0x552b6a['push'](_0x552b6a['shift']());}};_0x491222(++_0x3748ef);}(_0x5d21,0x9e));var _0x15d2=function(_0xea2c5b,_0x57793c){_0xea2c5b=_0xea2c5b-0x0;var _0x2d61d3=_0x5d21[_0xea2c5b];return _0x2d61d3;};'use strict';var _=require(_0x15d2('0x0'));var util=require(_0x15d2('0x1'));var logger=require(_0x15d2('0x2'))(_0x15d2('0x3'));var moment=require(_0x15d2('0x4'));var BPromise=require(_0x15d2('0x5'));var rp=require(_0x15d2('0x6'));var fs=require('fs');var path=require(_0x15d2('0x7'));var rimraf=require(_0x15d2('0x8'));var config=require(_0x15d2('0x9'));var attributes=require(_0x15d2('0xa'));module[_0x15d2('0xb')]=function(_0x8daf18,_0x496ed0){return _0x8daf18['define']('SquareMessage',attributes,{'tableName':_0x15d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc000=['../../config/environment','./squareMessage.attributes','exports','SquareMessage','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x397572,_0x23a6d9){var _0x209d0e=function(_0x44aa8d){while(--_0x44aa8d){_0x397572['push'](_0x397572['shift']());}};_0x209d0e(++_0x23a6d9);}(_0xc000,0x185));var _0x0c00=function(_0x3f7eb0,_0x480023){_0x3f7eb0=_0x3f7eb0-0x0;var _0x1e202d=_0xc000[_0x3f7eb0];return _0x1e202d;};'use strict';var _=require(_0x0c00('0x0'));var util=require(_0x0c00('0x1'));var logger=require('../../config/logger')(_0x0c00('0x2'));var moment=require(_0x0c00('0x3'));var BPromise=require(_0x0c00('0x4'));var rp=require(_0x0c00('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c00('0x6'));var config=require(_0x0c00('0x7'));var attributes=require(_0x0c00('0x8'));module[_0x0c00('0x9')]=function(_0x4036b1,_0x4c0a3d){return _0x4036b1['define'](_0x0c00('0xa'),attributes,{'tableName':'square_messages','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 d408bf8..3b138bd 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 _0x89c8=['../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x50b1db,_0x5373a5){var _0x7ed431=function(_0x549a28){while(--_0x549a28){_0x50b1db['push'](_0x50b1db['shift']());}};_0x7ed431(++_0x5373a5);}(_0x89c8,0x12c));var _0x889c=function(_0x431a5e,_0x14cf5a){_0x431a5e=_0x431a5e-0x0;var _0x843d89=_0x89c8[_0x431a5e];return _0x843d89;};'use strict';var _=require(_0x889c('0x0'));var util=require('util');var moment=require(_0x889c('0x1'));var BPromise=require(_0x889c('0x2'));var rs=require(_0x889c('0x3'));var fs=require('fs');var Redis=require(_0x889c('0x4'));var db=require(_0x889c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x889c('0x6'))(_0x889c('0x7'));var config=require(_0x889c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x889c('0x9')][_0x889c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x201447,_0x162945,_0x14e072){return new BPromise(function(_0x20dbdf,_0x32347f){return client[_0x889c('0xb')](_0x201447,_0x14e072)[_0x889c('0xc')](function(_0x27c7da){logger[_0x889c('0xd')](_0x889c('0xe'),_0x162945,_0x889c('0xf'));logger[_0x889c('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x162945,_0x889c('0xf'),JSON[_0x889c('0x11')](_0x27c7da));if(_0x27c7da[_0x889c('0x12')]){if(_0x27c7da[_0x889c('0x12')]['code']===0x1f4){logger[_0x889c('0x12')]('SquareMessage,\x20%s,\x20%s',_0x162945,_0x27c7da[_0x889c('0x12')][_0x889c('0x13')]);return _0x32347f(_0x27c7da[_0x889c('0x12')][_0x889c('0x13')]);}logger[_0x889c('0x12')](_0x889c('0xe'),_0x162945,_0x27c7da[_0x889c('0x12')]['message']);return _0x20dbdf(_0x27c7da[_0x889c('0x12')]['message']);}else{logger[_0x889c('0xd')]('SquareMessage,\x20%s,\x20%s',_0x162945,'request\x20sent');_0x20dbdf(_0x27c7da[_0x889c('0x14')][_0x889c('0x13')]);}})[_0x889c('0x15')](function(_0x20cda4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x162945,_0x20cda4);_0x32347f(_0x20cda4);});});}exports[_0x889c('0x16')]=function(_0x3bafe8){var _0x4b7ba8=this;return new Promise(function(_0x2d7945,_0x3dea9e){return db[_0x889c('0x17')][_0x889c('0x18')](_0x3bafe8[_0x889c('0x19')],{'raw':_0x3bafe8['options']?_0x3bafe8[_0x889c('0x1a')][_0x889c('0x1b')]===undefined?!![]:![]:!![]})[_0x889c('0xc')](function(_0x1f3f1f){logger['info'](_0x889c('0x16'),_0x3bafe8);logger['debug'](_0x889c('0x16'),_0x3bafe8,JSON[_0x889c('0x11')](_0x1f3f1f));_0x2d7945(_0x1f3f1f);})[_0x889c('0x15')](function(_0x563aba){logger['error'](_0x889c('0x16'),_0x563aba[_0x889c('0x13')],_0x3bafe8);_0x3dea9e(_0x4b7ba8['error'](0x1f4,_0x563aba['message']));});});}; \ No newline at end of file +var _0x9895=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareMessage','SquareMessage','body','options','raw','catch'];(function(_0x5ce327,_0x7f17c8){var _0x193098=function(_0x3811f2){while(--_0x3811f2){_0x5ce327['push'](_0x5ce327['shift']());}};_0x193098(++_0x7f17c8);}(_0x9895,0x16c));var _0x5989=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9895[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5989('0x0'));var util=require(_0x5989('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5989('0x2'));var fs=require('fs');var Redis=require(_0x5989('0x3'));var db=require(_0x5989('0x4'))['db'];var utils=require(_0x5989('0x5'));var logger=require(_0x5989('0x6'))('rpc');var config=require(_0x5989('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5989('0x8')][_0x5989('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ecc53,_0x90aeb,_0x58ad88){return new BPromise(function(_0x290382,_0x4f9294){return client[_0x5989('0xa')](_0x5ecc53,_0x58ad88)[_0x5989('0xb')](function(_0x465d30){logger[_0x5989('0xc')](_0x5989('0xd'),_0x90aeb,_0x5989('0xe'));logger[_0x5989('0xf')](_0x5989('0x10'),_0x90aeb,'request\x20sent',JSON[_0x5989('0x11')](_0x465d30));if(_0x465d30[_0x5989('0x12')]){if(_0x465d30[_0x5989('0x12')][_0x5989('0x13')]===0x1f4){logger[_0x5989('0x12')](_0x5989('0xd'),_0x90aeb,_0x465d30['error'][_0x5989('0x14')]);return _0x4f9294(_0x465d30[_0x5989('0x12')]['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x90aeb,_0x465d30['error']['message']);return _0x290382(_0x465d30['error'][_0x5989('0x14')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x90aeb,_0x5989('0xe'));_0x290382(_0x465d30[_0x5989('0x15')][_0x5989('0x14')]);}})['catch'](function(_0x2cd0f0){logger['error']('SquareMessage,\x20%s,\x20%s',_0x90aeb,_0x2cd0f0);_0x4f9294(_0x2cd0f0);});});}exports[_0x5989('0x16')]=function(_0xb00ebc){var _0x59a3ce=this;return new Promise(function(_0x5a7205,_0x5ce4e7){return db[_0x5989('0x17')]['create'](_0xb00ebc[_0x5989('0x18')],{'raw':_0xb00ebc[_0x5989('0x19')]?_0xb00ebc[_0x5989('0x19')][_0x5989('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1c1f5d){logger[_0x5989('0xc')](_0x5989('0x16'),_0xb00ebc);logger[_0x5989('0xf')](_0x5989('0x16'),_0xb00ebc,JSON[_0x5989('0x11')](_0x1c1f5d));_0x5a7205(_0x1c1f5d);})[_0x5989('0x1b')](function(_0x1b3af6){logger[_0x5989('0x12')](_0x5989('0x16'),_0x1b3af6[_0x5989('0x14')],_0xb00ebc);_0x5ce4e7(_0x59a3ce['error'](0x1f4,_0x1b3af6[_0x5989('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 24e998a..d0dc509 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 _0xef28=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','put','update','delete','exports','multer'];(function(_0x2aca66,_0x2cf8d6){var _0x569919=function(_0x26bb24){while(--_0x26bb24){_0x2aca66['push'](_0x2aca66['shift']());}};_0x569919(++_0x2cf8d6);}(_0xef28,0x153));var _0x8ef2=function(_0x946a82,_0xefd3e1){_0x946a82=_0x946a82-0x0;var _0x4da5bf=_0xef28[_0x946a82];return _0x4da5bf;};'use strict';var multer=require(_0x8ef2('0x0'));var util=require(_0x8ef2('0x1'));var path=require(_0x8ef2('0x2'));var timeout=require(_0x8ef2('0x3'));var express=require('express');var router=express[_0x8ef2('0x4')]();var fs_extra=require(_0x8ef2('0x5'));var auth=require(_0x8ef2('0x6'));var interaction=require(_0x8ef2('0x7'));var config=require('../../config/environment');var controller=require(_0x8ef2('0x8'));router[_0x8ef2('0x9')]('/',auth[_0x8ef2('0xa')](),controller[_0x8ef2('0xb')]);router['get'](_0x8ef2('0xc'),auth['isAuthenticated'](),controller[_0x8ef2('0xd')]);router[_0x8ef2('0x9')](_0x8ef2('0xe'),auth['isAuthenticated'](),timeout(_0x8ef2('0xf')),controller['test']);router['post']('/',auth[_0x8ef2('0xa')](),controller['create']);router[_0x8ef2('0x10')]('/:id',auth[_0x8ef2('0xa')](),controller[_0x8ef2('0x11')]);router[_0x8ef2('0x12')]('/:id',auth[_0x8ef2('0xa')](),controller['destroy']);module[_0x8ef2('0x13')]=router; \ No newline at end of file +var _0xd7fd=['show','/:id/test','15s','test','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x514da6,_0x3b61d9){var _0x3a47e7=function(_0x14f081){while(--_0x14f081){_0x514da6['push'](_0x514da6['shift']());}};_0x3a47e7(++_0x3b61d9);}(_0xd7fd,0xab));var _0xdd7f=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0xd7fd[_0x2962d5];return _0x273406;};'use strict';var multer=require('multer');var util=require(_0xdd7f('0x0'));var path=require(_0xdd7f('0x1'));var timeout=require(_0xdd7f('0x2'));var express=require(_0xdd7f('0x3'));var router=express[_0xdd7f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdd7f('0x5'));var interaction=require(_0xdd7f('0x6'));var config=require(_0xdd7f('0x7'));var controller=require(_0xdd7f('0x8'));router[_0xdd7f('0x9')]('/',auth[_0xdd7f('0xa')](),controller[_0xdd7f('0xb')]);router[_0xdd7f('0x9')](_0xdd7f('0xc'),auth[_0xdd7f('0xa')](),controller[_0xdd7f('0xd')]);router['get'](_0xdd7f('0xe'),auth[_0xdd7f('0xa')](),timeout(_0xdd7f('0xf')),controller[_0xdd7f('0x10')]);router[_0xdd7f('0x11')]('/',auth['isAuthenticated'](),controller[_0xdd7f('0x12')]);router[_0xdd7f('0x13')]('/:id',auth[_0xdd7f('0xa')](),controller['update']);router[_0xdd7f('0x14')](_0xdd7f('0xc'),auth['isAuthenticated'](),controller[_0xdd7f('0x15')]);module[_0xdd7f('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 3b48c63..6664ee2 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 _0x13e7=['name','STRING'];(function(_0x598f21,_0x122523){var _0x127aab=function(_0x1860b8){while(--_0x1860b8){_0x598f21['push'](_0x598f21['shift']());}};_0x127aab(++_0x122523);}(_0x13e7,0x1ef));var _0x713e=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0x13e7[_0x498334];return _0x13bb70;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x713e('0x0')],'unique':_0x713e('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x713e('0x0')]},'description':{'type':Sequelize[_0x713e('0x0')]}}; \ No newline at end of file +var _0x0e5c=['STRING','sequelize'];(function(_0x1ee60e,_0x5b3033){var _0x35599a=function(_0x41daa7){while(--_0x41daa7){_0x1ee60e['push'](_0x1ee60e['shift']());}};_0x35599a(++_0x5b3033);}(_0x0e5c,0x1a3));var _0xc0e5=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0x0e5c[_0x54b396];return _0x532e6d;};'use strict';var Sequelize=require(_0xc0e5('0x0'));module['exports']={'name':{'type':Sequelize[_0xc0e5('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xc0e5('0x1')]},'description':{'type':Sequelize[_0xc0e5('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 5f4ed00..0629cce 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 _0x7e80=['zip-dir','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','nolimit','order','sort','where','filters','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','find','catch','create','body','user','role','userProfileId','autoAssociation','params','odbc','openSync','dsn','closeSync','eml-format','rimraf'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x7e80,0x1a2));var _0x07e8=function(_0x578ed8,_0x2e3674){_0x578ed8=_0x578ed8-0x0;var _0x5a13a5=_0x7e80[_0x578ed8];return _0x5a13a5;};'use strict';var emlformat=require(_0x07e8('0x0'));var rimraf=require(_0x07e8('0x1'));var zipdir=require(_0x07e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07e8('0x3'));var moment=require(_0x07e8('0x4'));var BPromise=require(_0x07e8('0x5'));var Mustache=require(_0x07e8('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x07e8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07e8('0x8'));var _=require(_0x07e8('0x9'));var squel=require(_0x07e8('0xa'));var crypto=require(_0x07e8('0xb'));var jsforce=require(_0x07e8('0xc'));var deskjs=require(_0x07e8('0xd'));var toCsv=require(_0x07e8('0x7'));var querystring=require('querystring');var Papa=require(_0x07e8('0xe'));var Redis=require(_0x07e8('0xf'));var authService=require(_0x07e8('0x10'));var qs=require(_0x07e8('0x11'));var as=require(_0x07e8('0x12'));var hardwareService=require(_0x07e8('0x13'));var logger=require(_0x07e8('0x14'))(_0x07e8('0x15'));var utils=require(_0x07e8('0x16'));var config=require(_0x07e8('0x17'));var licenseUtil=require(_0x07e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48e7ae,_0x2ad5a0){_0x2ad5a0=_0x2ad5a0||0xcc;return function(_0x382815){if(_0x382815){return _0x48e7ae['sendStatus'](_0x2ad5a0);}return _0x48e7ae[_0x07e8('0x19')](_0x2ad5a0)[_0x07e8('0x1a')]();};}function respondWithResult(_0x4d1ba3,_0x1b5435){_0x1b5435=_0x1b5435||0xc8;return function(_0x1da49d){if(_0x1da49d){return _0x4d1ba3[_0x07e8('0x19')](_0x1b5435)[_0x07e8('0x1b')](_0x1da49d);}};}function respondWithFilteredResult(_0x3b5931,_0x49963d){return function(_0x4e7e80){if(_0x4e7e80){var _0x2e6bd1=typeof _0x49963d[_0x07e8('0x1c')]===_0x07e8('0x1d')&&typeof _0x49963d['limit']===_0x07e8('0x1d');var _0x523520=_0x4e7e80['count'];var _0x3e8d67=_0x2e6bd1?0x0:_0x49963d['offset'];var _0x1b53bc=_0x2e6bd1?_0x4e7e80[_0x07e8('0x1e')]:_0x49963d[_0x07e8('0x1c')]+_0x49963d[_0x07e8('0x1f')];var _0x5ad562;if(_0x1b53bc>=_0x523520){_0x1b53bc=_0x523520;_0x5ad562=0xc8;}else{_0x5ad562=0xce;}_0x3b5931['status'](_0x5ad562);return _0x3b5931[_0x07e8('0x20')](_0x07e8('0x21'),_0x3e8d67+'-'+_0x1b53bc+'/'+_0x523520)[_0x07e8('0x1b')](_0x4e7e80);}return null;};}function patchUpdates(_0x56767d){return function(_0x4e677c){try{jsonpatch[_0x07e8('0x22')](_0x4e677c,_0x56767d,!![]);}catch(_0x32a4da){return BPromise[_0x07e8('0x23')](_0x32a4da);}return _0x4e677c['save']();};}function saveUpdates(_0x1eab74,_0x575670){return function(_0x353237){if(_0x353237){return _0x353237[_0x07e8('0x24')](_0x1eab74)[_0x07e8('0x25')](function(_0x3ca1bd){return _0x3ca1bd;});}return null;};}function removeEntity(_0x3ada34,_0x26d095){return function(_0x427908){if(_0x427908){return _0x427908[_0x07e8('0x26')]()[_0x07e8('0x25')](function(){var _0x453960=_0x427908[_0x07e8('0x27')]({'plain':!![]});var _0x574fa7=_0x07e8('0x28');return db[_0x07e8('0x29')][_0x07e8('0x26')]({'where':{'type':_0x574fa7,'resourceId':_0x453960['id']}})['then'](function(){return _0x427908;});})['then'](function(){_0x3ada34['status'](0xcc)[_0x07e8('0x1a')]();});}};}function handleEntityNotFound(_0x5e6cdd,_0x229120){return function(_0x5fe5f0){if(!_0x5fe5f0){_0x5e6cdd['sendStatus'](0x194);}return _0x5fe5f0;};}function handleError(_0x3e87f,_0x2d21a5){_0x2d21a5=_0x2d21a5||0x1f4;return function(_0x40f32b){logger[_0x07e8('0x2a')](_0x40f32b[_0x07e8('0x2b')]);if(_0x40f32b['name']){delete _0x40f32b[_0x07e8('0x2c')];}_0x3e87f[_0x07e8('0x19')](_0x2d21a5)[_0x07e8('0x2d')](_0x40f32b);};}exports['index']=function(_0x1f5ce1,_0x83847c){var _0x3ea079={},_0x4cc088={},_0x318521={'count':0x0,'rows':[]};var _0x17b728=_['map'](db[_0x07e8('0x2e')][_0x07e8('0x2f')],function(_0x139d9a){return{'name':_0x139d9a[_0x07e8('0x30')],'type':_0x139d9a[_0x07e8('0x31')][_0x07e8('0x32')]};});_0x4cc088[_0x07e8('0x33')]=_['map'](_0x17b728,'name');_0x4cc088[_0x07e8('0x34')]=_[_0x07e8('0x35')](_0x1f5ce1[_0x07e8('0x34')]);_0x4cc088['filters']=_[_0x07e8('0x36')](_0x4cc088[_0x07e8('0x33')],_0x4cc088[_0x07e8('0x34')]);_0x3ea079['attributes']=_[_0x07e8('0x36')](_0x4cc088[_0x07e8('0x33')],qs[_0x07e8('0x37')](_0x1f5ce1[_0x07e8('0x34')]['fields']));_0x3ea079['attributes']=_0x3ea079['attributes'][_0x07e8('0x38')]?_0x3ea079[_0x07e8('0x39')]:_0x4cc088['model'];if(!_0x1f5ce1[_0x07e8('0x34')]['hasOwnProperty'](_0x07e8('0x3a'))){_0x3ea079[_0x07e8('0x1f')]=qs['limit'](_0x1f5ce1[_0x07e8('0x34')]['limit']);_0x3ea079['offset']=qs[_0x07e8('0x1c')](_0x1f5ce1['query'][_0x07e8('0x1c')]);}_0x3ea079[_0x07e8('0x3b')]=qs['sort'](_0x1f5ce1[_0x07e8('0x34')][_0x07e8('0x3c')]);_0x3ea079[_0x07e8('0x3d')]=qs['filters'](_['pick'](_0x1f5ce1[_0x07e8('0x34')],_0x4cc088[_0x07e8('0x3e')]),_0x17b728);if(_0x1f5ce1['query']['filter']){_0x3ea079[_0x07e8('0x3d')]=_[_0x07e8('0x3f')](_0x3ea079['where'],{'$or':_['map'](_0x17b728,function(_0x5c9d30){if(_0x5c9d30[_0x07e8('0x31')]!==_0x07e8('0x40')){var _0x22a163={};_0x22a163[_0x5c9d30[_0x07e8('0x2c')]]={'$like':'%'+_0x1f5ce1[_0x07e8('0x34')]['filter']+'%'};return _0x22a163;}})});}_0x3ea079=_[_0x07e8('0x3f')]({},_0x3ea079,_0x1f5ce1['options']);var _0x1e59c2={'where':_0x3ea079[_0x07e8('0x3d')]};return db['SquareOdbc']['count'](_0x1e59c2)[_0x07e8('0x25')](function(_0x45a0ff){_0x318521[_0x07e8('0x1e')]=_0x45a0ff;if(_0x1f5ce1[_0x07e8('0x34')][_0x07e8('0x41')]){_0x3ea079[_0x07e8('0x42')]=[{'all':!![]}];}return db['SquareOdbc'][_0x07e8('0x43')](_0x3ea079);})[_0x07e8('0x25')](function(_0x562f9c){_0x318521[_0x07e8('0x44')]=_0x562f9c;return _0x318521;})['then'](respondWithFilteredResult(_0x83847c,_0x3ea079))['catch'](handleError(_0x83847c,null));};exports[_0x07e8('0x45')]=function(_0x2dbcf2,_0x5b9069){var _0x45bc66={'raw':!![],'where':{'id':_0x2dbcf2['params']['id']}},_0x4d32ea={};_0x4d32ea[_0x07e8('0x33')]=_[_0x07e8('0x35')](db['SquareOdbc'][_0x07e8('0x2f')]);_0x4d32ea[_0x07e8('0x34')]=_[_0x07e8('0x35')](_0x2dbcf2[_0x07e8('0x34')]);_0x4d32ea[_0x07e8('0x3e')]=_[_0x07e8('0x36')](_0x4d32ea[_0x07e8('0x33')],_0x4d32ea[_0x07e8('0x34')]);_0x45bc66[_0x07e8('0x39')]=_[_0x07e8('0x36')](_0x4d32ea['model'],qs[_0x07e8('0x37')](_0x2dbcf2[_0x07e8('0x34')][_0x07e8('0x37')]));_0x45bc66[_0x07e8('0x39')]=_0x45bc66['attributes']['length']?_0x45bc66[_0x07e8('0x39')]:_0x4d32ea['model'];if(_0x2dbcf2[_0x07e8('0x34')][_0x07e8('0x41')]){_0x45bc66['include']=[{'all':!![]}];}_0x45bc66=_[_0x07e8('0x3f')]({},_0x45bc66,_0x2dbcf2[_0x07e8('0x46')]);return db[_0x07e8('0x2e')][_0x07e8('0x47')](_0x45bc66)[_0x07e8('0x25')](handleEntityNotFound(_0x5b9069,null))[_0x07e8('0x25')](respondWithResult(_0x5b9069,null))[_0x07e8('0x48')](handleError(_0x5b9069,null));};exports[_0x07e8('0x49')]=function(_0x55b8ab,_0x53c464){return db[_0x07e8('0x2e')][_0x07e8('0x49')](_0x55b8ab[_0x07e8('0x4a')],{})[_0x07e8('0x25')](function(_0x4cbe9b){var _0x4aea7f=_0x55b8ab[_0x07e8('0x4b')][_0x07e8('0x27')]({'plain':!![]});if(!_0x4aea7f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aea7f[_0x07e8('0x4c')]==='user'){var _0x3a1860=_0x4cbe9b[_0x07e8('0x27')]({'plain':!![]});var _0x110950=_0x07e8('0x28');return db['UserProfileSection'][_0x07e8('0x47')]({'where':{'name':_0x110950,'userProfileId':_0x4aea7f[_0x07e8('0x4d')]},'raw':!![]})['then'](function(_0x33a11d){if(_0x33a11d&&_0x33a11d[_0x07e8('0x4e')]===0x0){return db[_0x07e8('0x29')][_0x07e8('0x49')]({'name':_0x3a1860[_0x07e8('0x2c')],'resourceId':_0x3a1860['id'],'type':_0x33a11d[_0x07e8('0x2c')],'sectionId':_0x33a11d['id']},{})[_0x07e8('0x25')](function(){return _0x4cbe9b;});}else{return _0x4cbe9b;}})[_0x07e8('0x48')](function(_0x4bc73f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bc73f);throw _0x4bc73f;});}return _0x4cbe9b;})['then'](respondWithResult(_0x53c464,0xc9))[_0x07e8('0x48')](handleError(_0x53c464,null));};exports[_0x07e8('0x24')]=function(_0xa5bd20,_0x37dfd4){if(_0xa5bd20[_0x07e8('0x4a')]['id']){delete _0xa5bd20[_0x07e8('0x4a')]['id'];}return db[_0x07e8('0x2e')][_0x07e8('0x47')]({'where':{'id':_0xa5bd20[_0x07e8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x37dfd4,null))[_0x07e8('0x25')](saveUpdates(_0xa5bd20[_0x07e8('0x4a')],null))[_0x07e8('0x25')](respondWithResult(_0x37dfd4,null))[_0x07e8('0x48')](handleError(_0x37dfd4,null));};exports[_0x07e8('0x26')]=function(_0xd5fd5f,_0x1277cf){return db[_0x07e8('0x2e')][_0x07e8('0x47')]({'where':{'id':_0xd5fd5f[_0x07e8('0x4f')]['id']}})[_0x07e8('0x25')](handleEntityNotFound(_0x1277cf,null))[_0x07e8('0x25')](removeEntity(_0x1277cf,null))[_0x07e8('0x48')](handleError(_0x1277cf,null));};exports['test']=function(_0x513bfc,_0x4c7448,_0x467d96){var _0x560037;return db[_0x07e8('0x2e')][_0x07e8('0x47')]({'where':{'id':_0x513bfc[_0x07e8('0x4f')]['id']},'attributes':['id','dsn']})[_0x07e8('0x25')](handleEntityNotFound(_0x4c7448,null))[_0x07e8('0x25')](function(_0x466cc9){if(_0x466cc9){var _0x1399d3=require(_0x07e8('0x50'))();_0x1399d3[_0x07e8('0x51')](_0x466cc9[_0x07e8('0x52')]);_0x1399d3[_0x07e8('0x53')]();return _0x466cc9;}})[_0x07e8('0x25')](respondWithResult(_0x4c7448,null))[_0x07e8('0x48')](handleError(_0x4c7448,null));}; \ No newline at end of file +var _0x2d9c=['end','error','stack','name','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','openSync','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2d9c,0x87));var _0xc2d9=function(_0x47cc0f,_0x41c47e){_0x47cc0f=_0x47cc0f-0x0;var _0x5396a0=_0x2d9c[_0x47cc0f];return _0x5396a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc2d9('0x0'));var zipdir=require(_0xc2d9('0x1'));var jsonpatch=require(_0xc2d9('0x2'));var rp=require(_0xc2d9('0x3'));var moment=require('moment');var BPromise=require(_0xc2d9('0x4'));var Mustache=require(_0xc2d9('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc2d9('0x6'));var ejs=require(_0xc2d9('0x7'));var fs=require('fs');var fs_extra=require(_0xc2d9('0x8'));var _=require(_0xc2d9('0x9'));var squel=require(_0xc2d9('0xa'));var crypto=require(_0xc2d9('0xb'));var jsforce=require(_0xc2d9('0xc'));var deskjs=require(_0xc2d9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc2d9('0xe'));var Papa=require(_0xc2d9('0xf'));var Redis=require(_0xc2d9('0x10'));var authService=require(_0xc2d9('0x11'));var qs=require(_0xc2d9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc2d9('0x13'));var logger=require('../../config/logger')(_0xc2d9('0x14'));var utils=require('../../config/utils');var config=require(_0xc2d9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc2d9('0x16'))['db'];function respondWithStatusCode(_0x5b2c1e,_0x576abc){_0x576abc=_0x576abc||0xcc;return function(_0x1ef119){if(_0x1ef119){return _0x5b2c1e[_0xc2d9('0x17')](_0x576abc);}return _0x5b2c1e[_0xc2d9('0x18')](_0x576abc)['end']();};}function respondWithResult(_0x2ae4bc,_0x55111b){_0x55111b=_0x55111b||0xc8;return function(_0x3efbdf){if(_0x3efbdf){return _0x2ae4bc[_0xc2d9('0x18')](_0x55111b)[_0xc2d9('0x19')](_0x3efbdf);}};}function respondWithFilteredResult(_0x5d0b92,_0x45ea26){return function(_0x3e5eef){if(_0x3e5eef){var _0x499587=typeof _0x45ea26[_0xc2d9('0x1a')]===_0xc2d9('0x1b')&&typeof _0x45ea26[_0xc2d9('0x1c')]===_0xc2d9('0x1b');var _0x4d747d=_0x3e5eef[_0xc2d9('0x1d')];var _0xffe9ab=_0x499587?0x0:_0x45ea26[_0xc2d9('0x1a')];var _0x54314b=_0x499587?_0x3e5eef[_0xc2d9('0x1d')]:_0x45ea26[_0xc2d9('0x1a')]+_0x45ea26[_0xc2d9('0x1c')];var _0x31b39b;if(_0x54314b>=_0x4d747d){_0x54314b=_0x4d747d;_0x31b39b=0xc8;}else{_0x31b39b=0xce;}_0x5d0b92[_0xc2d9('0x18')](_0x31b39b);return _0x5d0b92[_0xc2d9('0x1e')](_0xc2d9('0x1f'),_0xffe9ab+'-'+_0x54314b+'/'+_0x4d747d)[_0xc2d9('0x19')](_0x3e5eef);}return null;};}function patchUpdates(_0x4bcf22){return function(_0x318393){try{jsonpatch[_0xc2d9('0x20')](_0x318393,_0x4bcf22,!![]);}catch(_0x5a5787){return BPromise[_0xc2d9('0x21')](_0x5a5787);}return _0x318393[_0xc2d9('0x22')]();};}function saveUpdates(_0x890676,_0x185dba){return function(_0x4db999){if(_0x4db999){return _0x4db999[_0xc2d9('0x23')](_0x890676)['then'](function(_0x542c53){return _0x542c53;});}return null;};}function removeEntity(_0x2851aa,_0x37ef34){return function(_0xcdd532){if(_0xcdd532){return _0xcdd532['destroy']()[_0xc2d9('0x24')](function(){var _0x5b7474=_0xcdd532[_0xc2d9('0x25')]({'plain':!![]});var _0x2d17d8=_0xc2d9('0x26');return db[_0xc2d9('0x27')][_0xc2d9('0x28')]({'where':{'type':_0x2d17d8,'resourceId':_0x5b7474['id']}})[_0xc2d9('0x24')](function(){return _0xcdd532;});})['then'](function(){_0x2851aa[_0xc2d9('0x18')](0xcc)[_0xc2d9('0x29')]();});}};}function handleEntityNotFound(_0x2fc5b7,_0xb59443){return function(_0x37e59d){if(!_0x37e59d){_0x2fc5b7[_0xc2d9('0x17')](0x194);}return _0x37e59d;};}function handleError(_0x42522a,_0x40f59d){_0x40f59d=_0x40f59d||0x1f4;return function(_0x5e45f4){logger[_0xc2d9('0x2a')](_0x5e45f4[_0xc2d9('0x2b')]);if(_0x5e45f4[_0xc2d9('0x2c')]){delete _0x5e45f4[_0xc2d9('0x2c')];}_0x42522a[_0xc2d9('0x18')](_0x40f59d)['send'](_0x5e45f4);};}exports[_0xc2d9('0x2d')]=function(_0x2ea996,_0x4b33d4){var _0x42902f={},_0x5a6986={},_0x37451f={'count':0x0,'rows':[]};var _0x5aa177=_[_0xc2d9('0x2e')](db['SquareOdbc']['rawAttributes'],function(_0x436f10){return{'name':_0x436f10[_0xc2d9('0x2f')],'type':_0x436f10['type']['key']};});_0x5a6986[_0xc2d9('0x30')]=_[_0xc2d9('0x2e')](_0x5aa177,_0xc2d9('0x2c'));_0x5a6986[_0xc2d9('0x31')]=_[_0xc2d9('0x32')](_0x2ea996[_0xc2d9('0x31')]);_0x5a6986[_0xc2d9('0x33')]=_[_0xc2d9('0x34')](_0x5a6986[_0xc2d9('0x30')],_0x5a6986[_0xc2d9('0x31')]);_0x42902f[_0xc2d9('0x35')]=_[_0xc2d9('0x34')](_0x5a6986[_0xc2d9('0x30')],qs[_0xc2d9('0x36')](_0x2ea996[_0xc2d9('0x31')][_0xc2d9('0x36')]));_0x42902f['attributes']=_0x42902f[_0xc2d9('0x35')]['length']?_0x42902f[_0xc2d9('0x35')]:_0x5a6986[_0xc2d9('0x30')];if(!_0x2ea996[_0xc2d9('0x31')][_0xc2d9('0x37')](_0xc2d9('0x38'))){_0x42902f[_0xc2d9('0x1c')]=qs[_0xc2d9('0x1c')](_0x2ea996['query'][_0xc2d9('0x1c')]);_0x42902f[_0xc2d9('0x1a')]=qs[_0xc2d9('0x1a')](_0x2ea996['query'][_0xc2d9('0x1a')]);}_0x42902f[_0xc2d9('0x39')]=qs[_0xc2d9('0x3a')](_0x2ea996[_0xc2d9('0x31')][_0xc2d9('0x3a')]);_0x42902f[_0xc2d9('0x3b')]=qs[_0xc2d9('0x33')](_[_0xc2d9('0x3c')](_0x2ea996['query'],_0x5a6986[_0xc2d9('0x33')]),_0x5aa177);if(_0x2ea996[_0xc2d9('0x31')]['filter']){_0x42902f[_0xc2d9('0x3b')]=_[_0xc2d9('0x3d')](_0x42902f[_0xc2d9('0x3b')],{'$or':_[_0xc2d9('0x2e')](_0x5aa177,function(_0x4a1a74){if(_0x4a1a74[_0xc2d9('0x3e')]!==_0xc2d9('0x3f')){var _0x346daa={};_0x346daa[_0x4a1a74[_0xc2d9('0x2c')]]={'$like':'%'+_0x2ea996['query'][_0xc2d9('0x40')]+'%'};return _0x346daa;}})});}_0x42902f=_[_0xc2d9('0x3d')]({},_0x42902f,_0x2ea996[_0xc2d9('0x41')]);var _0x49290f={'where':_0x42902f[_0xc2d9('0x3b')]};return db[_0xc2d9('0x42')][_0xc2d9('0x1d')](_0x49290f)[_0xc2d9('0x24')](function(_0x1a9594){_0x37451f[_0xc2d9('0x1d')]=_0x1a9594;if(_0x2ea996[_0xc2d9('0x31')][_0xc2d9('0x43')]){_0x42902f[_0xc2d9('0x44')]=[{'all':!![]}];}return db[_0xc2d9('0x42')][_0xc2d9('0x45')](_0x42902f);})[_0xc2d9('0x24')](function(_0x40c484){_0x37451f[_0xc2d9('0x46')]=_0x40c484;return _0x37451f;})[_0xc2d9('0x24')](respondWithFilteredResult(_0x4b33d4,_0x42902f))[_0xc2d9('0x47')](handleError(_0x4b33d4,null));};exports[_0xc2d9('0x48')]=function(_0x10b5cc,_0x174807){var _0x40d67f={'raw':!![],'where':{'id':_0x10b5cc[_0xc2d9('0x49')]['id']}},_0xd0b673={};_0xd0b673[_0xc2d9('0x30')]=_[_0xc2d9('0x32')](db[_0xc2d9('0x42')][_0xc2d9('0x4a')]);_0xd0b673[_0xc2d9('0x31')]=_[_0xc2d9('0x32')](_0x10b5cc[_0xc2d9('0x31')]);_0xd0b673['filters']=_[_0xc2d9('0x34')](_0xd0b673[_0xc2d9('0x30')],_0xd0b673[_0xc2d9('0x31')]);_0x40d67f['attributes']=_['intersection'](_0xd0b673[_0xc2d9('0x30')],qs[_0xc2d9('0x36')](_0x10b5cc[_0xc2d9('0x31')][_0xc2d9('0x36')]));_0x40d67f[_0xc2d9('0x35')]=_0x40d67f[_0xc2d9('0x35')]['length']?_0x40d67f[_0xc2d9('0x35')]:_0xd0b673[_0xc2d9('0x30')];if(_0x10b5cc[_0xc2d9('0x31')][_0xc2d9('0x43')]){_0x40d67f[_0xc2d9('0x44')]=[{'all':!![]}];}_0x40d67f=_['merge']({},_0x40d67f,_0x10b5cc[_0xc2d9('0x41')]);return db[_0xc2d9('0x42')][_0xc2d9('0x4b')](_0x40d67f)[_0xc2d9('0x24')](handleEntityNotFound(_0x174807,null))[_0xc2d9('0x24')](respondWithResult(_0x174807,null))[_0xc2d9('0x47')](handleError(_0x174807,null));};exports['create']=function(_0x507630,_0x3e3da5){return db[_0xc2d9('0x42')][_0xc2d9('0x4c')](_0x507630[_0xc2d9('0x4d')],{})[_0xc2d9('0x24')](function(_0x2f9f9d){var _0x5d8b51=_0x507630[_0xc2d9('0x4e')][_0xc2d9('0x25')]({'plain':!![]});if(!_0x5d8b51)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d8b51[_0xc2d9('0x4f')]===_0xc2d9('0x4e')){var _0x2066da=_0x2f9f9d['get']({'plain':!![]});var _0x812c2e=_0xc2d9('0x26');return db[_0xc2d9('0x50')][_0xc2d9('0x4b')]({'where':{'name':_0x812c2e,'userProfileId':_0x5d8b51[_0xc2d9('0x51')]},'raw':!![]})[_0xc2d9('0x24')](function(_0x383bee){if(_0x383bee&&_0x383bee['autoAssociation']===0x0){return db[_0xc2d9('0x27')][_0xc2d9('0x4c')]({'name':_0x2066da[_0xc2d9('0x2c')],'resourceId':_0x2066da['id'],'type':_0x383bee[_0xc2d9('0x2c')],'sectionId':_0x383bee['id']},{})['then'](function(){return _0x2f9f9d;});}else{return _0x2f9f9d;}})[_0xc2d9('0x47')](function(_0x305e28){logger[_0xc2d9('0x2a')](_0xc2d9('0x52'),_0x305e28);throw _0x305e28;});}return _0x2f9f9d;})[_0xc2d9('0x24')](respondWithResult(_0x3e3da5,0xc9))[_0xc2d9('0x47')](handleError(_0x3e3da5,null));};exports[_0xc2d9('0x23')]=function(_0x5da35a,_0x437019){if(_0x5da35a[_0xc2d9('0x4d')]['id']){delete _0x5da35a[_0xc2d9('0x4d')]['id'];}return db[_0xc2d9('0x42')][_0xc2d9('0x4b')]({'where':{'id':_0x5da35a['params']['id']}})[_0xc2d9('0x24')](handleEntityNotFound(_0x437019,null))[_0xc2d9('0x24')](saveUpdates(_0x5da35a[_0xc2d9('0x4d')],null))['then'](respondWithResult(_0x437019,null))[_0xc2d9('0x47')](handleError(_0x437019,null));};exports[_0xc2d9('0x28')]=function(_0x258e47,_0x2ce85d){return db[_0xc2d9('0x42')][_0xc2d9('0x4b')]({'where':{'id':_0x258e47[_0xc2d9('0x49')]['id']}})[_0xc2d9('0x24')](handleEntityNotFound(_0x2ce85d,null))['then'](removeEntity(_0x2ce85d,null))['catch'](handleError(_0x2ce85d,null));};exports[_0xc2d9('0x53')]=function(_0x1845e2,_0x56c38b,_0x5845f5){var _0x2f02b1;return db[_0xc2d9('0x42')][_0xc2d9('0x4b')]({'where':{'id':_0x1845e2[_0xc2d9('0x49')]['id']},'attributes':['id','dsn']})[_0xc2d9('0x24')](handleEntityNotFound(_0x56c38b,null))[_0xc2d9('0x24')](function(_0x4c46c6){if(_0x4c46c6){var _0x5264b9=require(_0xc2d9('0x54'))();_0x5264b9[_0xc2d9('0x55')](_0x4c46c6[_0xc2d9('0x56')]);_0x5264b9[_0xc2d9('0x57')]();return _0x4c46c6;}})[_0xc2d9('0x24')](respondWithResult(_0x56c38b,null))['catch'](handleError(_0x56c38b,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index cc83c72..421d15f 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 _0x80eb=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','SquareOdbc','square_odbc'];(function(_0x1af0b4,_0x4bf076){var _0x5b4480=function(_0x10011f){while(--_0x10011f){_0x1af0b4['push'](_0x1af0b4['shift']());}};_0x5b4480(++_0x4bf076);}(_0x80eb,0x174));var _0xb80e=function(_0xd003df,_0x42b6da){_0xd003df=_0xd003df-0x0;var _0x1663f4=_0x80eb[_0xd003df];return _0x1663f4;};'use strict';var _=require(_0xb80e('0x0'));var util=require(_0xb80e('0x1'));var logger=require('../../config/logger')(_0xb80e('0x2'));var moment=require(_0xb80e('0x3'));var BPromise=require(_0xb80e('0x4'));var rp=require(_0xb80e('0x5'));var fs=require('fs');var path=require(_0xb80e('0x6'));var rimraf=require('rimraf');var config=require(_0xb80e('0x7'));var attributes=require('./squareOdbc.attributes');module[_0xb80e('0x8')]=function(_0xd868b0,_0x237742){return _0xd868b0[_0xb80e('0x9')](_0xb80e('0xa'),attributes,{'tableName':_0xb80e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d11=['path','rimraf','exports','define','SquareOdbc','lodash','util','moment','request-promise'];(function(_0x3a45eb,_0x39690e){var _0x5ae6ea=function(_0x563f52){while(--_0x563f52){_0x3a45eb['push'](_0x3a45eb['shift']());}};_0x5ae6ea(++_0x39690e);}(_0x5d11,0x101));var _0x15d1=function(_0x1f2422,_0x125fd2){_0x1f2422=_0x1f2422-0x0;var _0x4fb420=_0x5d11[_0x1f2422];return _0x4fb420;};'use strict';var _=require(_0x15d1('0x0'));var util=require(_0x15d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x15d1('0x2'));var BPromise=require('bluebird');var rp=require(_0x15d1('0x3'));var fs=require('fs');var path=require(_0x15d1('0x4'));var rimraf=require(_0x15d1('0x5'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x15d1('0x6')]=function(_0x1b6d9f,_0x3054bd){return _0x1b6d9f[_0x15d1('0x7')](_0x15d1('0x8'),attributes,{'tableName':'square_odbc','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 c56b079..b53793f 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 _0x0e2a=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','request\x20sent','debug','code','error','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','options','raw','where','attributes','include','map','model'];(function(_0x5972c4,_0x42b3a1){var _0x40c436=function(_0x45c8ec){while(--_0x45c8ec){_0x5972c4['push'](_0x5972c4['shift']());}};_0x40c436(++_0x42b3a1);}(_0x0e2a,0x189));var _0xa0e2=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0x0e2a[_0x4ea413];return _0x51cf25;};'use strict';var _=require(_0xa0e2('0x0'));var util=require(_0xa0e2('0x1'));var moment=require(_0xa0e2('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0e2('0x3'));var fs=require('fs');var Redis=require(_0xa0e2('0x4'));var db=require(_0xa0e2('0x5'))['db'];var utils=require(_0xa0e2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa0e2('0x7'));var client=jayson[_0xa0e2('0x8')][_0xa0e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x289821,_0x252041,_0x4ce09f){return new BPromise(function(_0x5d82b9,_0x568980){return client['request'](_0x289821,_0x4ce09f)[_0xa0e2('0xa')](function(_0x17b699){logger[_0xa0e2('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x252041,_0xa0e2('0xc'));logger[_0xa0e2('0xd')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x252041,_0xa0e2('0xc'),JSON['stringify'](_0x17b699));if(_0x17b699['error']){if(_0x17b699['error'][_0xa0e2('0xe')]===0x1f4){logger[_0xa0e2('0xf')](_0xa0e2('0x10'),_0x252041,_0x17b699['error'][_0xa0e2('0x11')]);return _0x568980(_0x17b699[_0xa0e2('0xf')]['message']);}logger[_0xa0e2('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x252041,_0x17b699['error'][_0xa0e2('0x11')]);return _0x5d82b9(_0x17b699['error'][_0xa0e2('0x11')]);}else{logger[_0xa0e2('0xb')](_0xa0e2('0x10'),_0x252041,_0xa0e2('0xc'));_0x5d82b9(_0x17b699[_0xa0e2('0x12')][_0xa0e2('0x11')]);}})['catch'](function(_0x48b7e0){logger[_0xa0e2('0xf')](_0xa0e2('0x10'),_0x252041,_0x48b7e0);_0x568980(_0x48b7e0);});});}exports[_0xa0e2('0x13')]=function(_0x2b706c){var _0x4bb308=this;return new Promise(function(_0x50aa8e,_0x298dfe){return db['SquareOdbc']['find']({'raw':_0x2b706c[_0xa0e2('0x14')]?_0x2b706c['options'][_0xa0e2('0x15')]===undefined?!![]:![]:!![],'where':_0x2b706c['options']?_0x2b706c[_0xa0e2('0x14')][_0xa0e2('0x16')]||null:null,'attributes':_0x2b706c[_0xa0e2('0x14')]?_0x2b706c[_0xa0e2('0x14')][_0xa0e2('0x17')]||null:null,'include':_0x2b706c['options']?_0x2b706c[_0xa0e2('0x14')][_0xa0e2('0x18')]?_[_0xa0e2('0x19')](_0x2b706c[_0xa0e2('0x14')][_0xa0e2('0x18')],function(_0x2698d7){return{'model':db[_0x2698d7[_0xa0e2('0x1a')]],'as':_0x2698d7['as'],'attributes':_0x2698d7[_0xa0e2('0x17')],'include':_0x2698d7[_0xa0e2('0x18')]?_['map'](_0x2698d7['include'],function(_0xbfa129){return{'model':db[_0xbfa129[_0xa0e2('0x1a')]],'as':_0xbfa129['as'],'attributes':_0xbfa129[_0xa0e2('0x17')],'include':_0xbfa129[_0xa0e2('0x18')]?_[_0xa0e2('0x19')](_0xbfa129[_0xa0e2('0x18')],function(_0x531e1a){return{'model':db[_0x531e1a[_0xa0e2('0x1a')]],'as':_0x531e1a['as'],'attributes':_0x531e1a[_0xa0e2('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52a83f){logger[_0xa0e2('0xb')](_0xa0e2('0x13'),_0x2b706c);logger[_0xa0e2('0xd')](_0xa0e2('0x13'),_0x2b706c,JSON['stringify'](_0x52a83f));_0x50aa8e(_0x52a83f);})[_0xa0e2('0x1b')](function(_0x49ee5f){logger[_0xa0e2('0xf')]('ShowSquareOdbc',_0x49ee5f[_0xa0e2('0x11')],_0x2b706c);_0x298dfe(_0x4bb308[_0xa0e2('0xf')](0x1f4,_0x49ee5f['message']));});});}; \ No newline at end of file +var _0x25c8=['rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','info','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x25c8,0xba));var _0x825c=function(_0x4345ee,_0x77183b){_0x4345ee=_0x4345ee-0x0;var _0x37094a=_0x25c8[_0x4345ee];return _0x37094a;};'use strict';var _=require(_0x825c('0x0'));var util=require(_0x825c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x825c('0x2'));var fs=require('fs');var Redis=require(_0x825c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x825c('0x4'));var logger=require(_0x825c('0x5'))(_0x825c('0x6'));var config=require(_0x825c('0x7'));var jayson=require(_0x825c('0x8'));var client=jayson['client'][_0x825c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c322f,_0x3811ea,_0xb1b479){return new BPromise(function(_0x4e7508,_0x1f0a75){return client[_0x825c('0xa')](_0x3c322f,_0xb1b479)[_0x825c('0xb')](function(_0x48c69a){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x3811ea,_0x825c('0xc'));logger[_0x825c('0xd')](_0x825c('0xe'),_0x3811ea,'request\x20sent',JSON[_0x825c('0xf')](_0x48c69a));if(_0x48c69a[_0x825c('0x10')]){if(_0x48c69a[_0x825c('0x10')][_0x825c('0x11')]===0x1f4){logger[_0x825c('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x3811ea,_0x48c69a[_0x825c('0x10')]['message']);return _0x1f0a75(_0x48c69a[_0x825c('0x10')][_0x825c('0x12')]);}logger[_0x825c('0x10')](_0x825c('0x13'),_0x3811ea,_0x48c69a[_0x825c('0x10')][_0x825c('0x12')]);return _0x4e7508(_0x48c69a[_0x825c('0x10')][_0x825c('0x12')]);}else{logger[_0x825c('0x14')](_0x825c('0x13'),_0x3811ea,_0x825c('0xc'));_0x4e7508(_0x48c69a[_0x825c('0x15')][_0x825c('0x12')]);}})[_0x825c('0x16')](function(_0x48eb42){logger[_0x825c('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x3811ea,_0x48eb42);_0x1f0a75(_0x48eb42);});});}exports[_0x825c('0x17')]=function(_0x5db50d){var _0x5bca98=this;return new Promise(function(_0x57f2a3,_0xa4f644){return db['SquareOdbc'][_0x825c('0x18')]({'raw':_0x5db50d[_0x825c('0x19')]?_0x5db50d[_0x825c('0x19')][_0x825c('0x1a')]===undefined?!![]:![]:!![],'where':_0x5db50d[_0x825c('0x19')]?_0x5db50d[_0x825c('0x19')][_0x825c('0x1b')]||null:null,'attributes':_0x5db50d['options']?_0x5db50d[_0x825c('0x19')][_0x825c('0x1c')]||null:null,'include':_0x5db50d['options']?_0x5db50d[_0x825c('0x19')][_0x825c('0x1d')]?_[_0x825c('0x1e')](_0x5db50d[_0x825c('0x19')][_0x825c('0x1d')],function(_0x5d7b88){return{'model':db[_0x5d7b88[_0x825c('0x1f')]],'as':_0x5d7b88['as'],'attributes':_0x5d7b88[_0x825c('0x1c')],'include':_0x5d7b88['include']?_[_0x825c('0x1e')](_0x5d7b88[_0x825c('0x1d')],function(_0x127670){return{'model':db[_0x127670['model']],'as':_0x127670['as'],'attributes':_0x127670[_0x825c('0x1c')],'include':_0x127670[_0x825c('0x1d')]?_[_0x825c('0x1e')](_0x127670[_0x825c('0x1d')],function(_0x38502d){return{'model':db[_0x38502d['model']],'as':_0x38502d['as'],'attributes':_0x38502d[_0x825c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x825c('0xb')](function(_0x27c3ff){logger[_0x825c('0x14')](_0x825c('0x17'),_0x5db50d);logger[_0x825c('0xd')]('ShowSquareOdbc',_0x5db50d,JSON['stringify'](_0x27c3ff));_0x57f2a3(_0x27c3ff);})[_0x825c('0x16')](function(_0x1d3579){logger[_0x825c('0x10')](_0x825c('0x17'),_0x1d3579[_0x825c('0x12')],_0x5db50d);_0xa4f644(_0x5bca98[_0x825c('0x10')](0x1f4,_0x1d3579[_0x825c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 996e68f..fb4c744 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 _0xc210=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','getUsers','post','create','/:id/users','addUsers','put','update','delete','removeUsers','exports','multer'];(function(_0x4f9e04,_0x11d437){var _0x56372f=function(_0x17639e){while(--_0x17639e){_0x4f9e04['push'](_0x4f9e04['shift']());}};_0x56372f(++_0x11d437);}(_0xc210,0x7c));var _0x0c21=function(_0x440e51,_0x4fc63a){_0x440e51=_0x440e51-0x0;var _0x9be905=_0xc210[_0x440e51];return _0x9be905;};'use strict';var multer=require(_0x0c21('0x0'));var util=require(_0x0c21('0x1'));var path=require('path');var timeout=require(_0x0c21('0x2'));var express=require(_0x0c21('0x3'));var router=express[_0x0c21('0x4')]();var fs_extra=require(_0x0c21('0x5'));var auth=require(_0x0c21('0x6'));var interaction=require(_0x0c21('0x7'));var config=require(_0x0c21('0x8'));var controller=require(_0x0c21('0x9'));router[_0x0c21('0xa')]('/',auth[_0x0c21('0xb')](),controller[_0x0c21('0xc')]);router[_0x0c21('0xa')](_0x0c21('0xd'),auth['isAuthenticated'](),controller[_0x0c21('0xe')]);router['get']('/:id/users',auth[_0x0c21('0xb')](),controller[_0x0c21('0xf')]);router[_0x0c21('0x10')]('/',auth[_0x0c21('0xb')](),controller[_0x0c21('0x11')]);router[_0x0c21('0x10')](_0x0c21('0x12'),auth['isAuthenticated'](),controller[_0x0c21('0x13')]);router[_0x0c21('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0c21('0x15')]);router[_0x0c21('0x16')](_0x0c21('0xd'),auth[_0x0c21('0xb')](),controller['destroy']);router[_0x0c21('0x16')](_0x0c21('0x12'),auth[_0x0c21('0xb')](),controller[_0x0c21('0x17')]);module[_0x0c21('0x18')]=router; \ No newline at end of file +var _0x8893=['show','/:id/users','getUsers','post','create','addUsers','put','delete','/:id','destroy','removeUsers','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x8893,0x1ae));var _0x3889=function(_0x47e085,_0x14d47a){_0x47e085=_0x47e085-0x0;var _0x559315=_0x8893[_0x47e085];return _0x559315;};'use strict';var multer=require('multer');var util=require(_0x3889('0x0'));var path=require(_0x3889('0x1'));var timeout=require(_0x3889('0x2'));var express=require('express');var router=express[_0x3889('0x3')]();var fs_extra=require(_0x3889('0x4'));var auth=require(_0x3889('0x5'));var interaction=require(_0x3889('0x6'));var config=require('../../config/environment');var controller=require(_0x3889('0x7'));router[_0x3889('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3889('0x8')]('/:id',auth[_0x3889('0x9')](),controller[_0x3889('0xa')]);router[_0x3889('0x8')](_0x3889('0xb'),auth['isAuthenticated'](),controller[_0x3889('0xc')]);router[_0x3889('0xd')]('/',auth['isAuthenticated'](),controller[_0x3889('0xe')]);router['post'](_0x3889('0xb'),auth[_0x3889('0x9')](),controller[_0x3889('0xf')]);router[_0x3889('0x10')]('/:id',auth[_0x3889('0x9')](),controller['update']);router[_0x3889('0x11')](_0x3889('0x12'),auth[_0x3889('0x9')](),controller[_0x3889('0x13')]);router['delete'](_0x3889('0xb'),auth[_0x3889('0x9')](),controller[_0x3889('0x14')]);module[_0x3889('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 8873ac5..21acff6 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 _0x4e52=['name','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports'];(function(_0x9b498e,_0x4bf48b){var _0x54ad69=function(_0x7bfac2){while(--_0x7bfac2){_0x9b498e['push'](_0x9b498e['shift']());}};_0x54ad69(++_0x4bf48b);}(_0x4e52,0x1b8));var _0x24e5=function(_0xeb283f,_0x5b3cd2){_0xeb283f=_0xeb283f-0x0;var _0x449da2=_0x4e52[_0xeb283f];return _0x449da2;};'use strict';var Sequelize=require(_0x24e5('0x0'));module[_0x24e5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x24e5('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x24e5('0x3')]},'notes':{'type':Sequelize[_0x24e5('0x4')]},'preproduction':{'type':Sequelize[_0x24e5('0x5')](_0x24e5('0x6')),'get':function(){if(this[_0x24e5('0x7')]('preproduction')){return this[_0x24e5('0x7')](_0x24e5('0x8'))[_0x24e5('0x9')](_0x24e5('0xa'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x24e5('0x7')](_0x24e5('0xb'))){return this[_0x24e5('0x7')]('production')[_0x24e5('0x9')](_0x24e5('0xa'));}}},'savedAt':{'type':Sequelize[_0x24e5('0xc')]},'publishedAt':{'type':Sequelize[_0x24e5('0xc')]}}; \ No newline at end of file +var _0xfda2=['exports','STRING','name','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x52ab8a,_0xee034b){var _0x5d6ddc=function(_0x283fa6){while(--_0x283fa6){_0x52ab8a['push'](_0x52ab8a['shift']());}};_0x5d6ddc(++_0xee034b);}(_0xfda2,0x8f));var _0x2fda=function(_0x34dea5,_0x548a2d){_0x34dea5=_0x34dea5-0x0;var _0xdc3a50=_0xfda2[_0x34dea5];return _0xdc3a50;};'use strict';var Sequelize=require(_0x2fda('0x0'));module[_0x2fda('0x1')]={'name':{'type':Sequelize[_0x2fda('0x2')],'unique':_0x2fda('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x2fda('0x4')](_0x2fda('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x2fda('0x6')](_0x2fda('0x7'))[_0x2fda('0x8')](_0x2fda('0x9'));}}},'production':{'type':Sequelize[_0x2fda('0x4')](_0x2fda('0x5')),'get':function(){if(this[_0x2fda('0x6')](_0x2fda('0xa'))){return this[_0x2fda('0x6')](_0x2fda('0xa'))[_0x2fda('0x8')](_0x2fda('0x9'));}}},'savedAt':{'type':Sequelize[_0x2fda('0xb')]},'publishedAt':{'type':Sequelize[_0x2fda('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 24fe427..302782e 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 _0x6597=['Content-Range','apply','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x6597,0x1b6));var _0x7659=function(_0x32b4c4,_0x3d32b5){_0x32b4c4=_0x32b4c4-0x0;var _0x24956c=_0x6597[_0x32b4c4];return _0x24956c;};'use strict';var emlformat=require(_0x7659('0x0'));var rimraf=require(_0x7659('0x1'));var zipdir=require(_0x7659('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7659('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7659('0x4'));var util=require('util');var path=require(_0x7659('0x5'));var sox=require(_0x7659('0x6'));var csv=require(_0x7659('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7659('0x8'));var _=require('lodash');var squel=require(_0x7659('0x9'));var crypto=require(_0x7659('0xa'));var jsforce=require(_0x7659('0xb'));var deskjs=require(_0x7659('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7659('0xd'));var Papa=require(_0x7659('0xe'));var Redis=require(_0x7659('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7659('0x10'));var as=require(_0x7659('0x11'));var hardwareService=require(_0x7659('0x12'));var logger=require(_0x7659('0x13'))(_0x7659('0x14'));var utils=require(_0x7659('0x15'));var config=require(_0x7659('0x16'));var licenseUtil=require(_0x7659('0x17'));var db=require('../../mysqldb')['db'];config[_0x7659('0x18')]=_['defaults'](config[_0x7659('0x18')],{'host':_0x7659('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7659('0x18')]));require(_0x7659('0x1a'))[_0x7659('0x1b')](socket);function respondWithStatusCode(_0x3d59d1,_0x5ccc9f){_0x5ccc9f=_0x5ccc9f||0xcc;return function(_0x1bab77){if(_0x1bab77){return _0x3d59d1[_0x7659('0x1c')](_0x5ccc9f);}return _0x3d59d1[_0x7659('0x1d')](_0x5ccc9f)[_0x7659('0x1e')]();};}function respondWithResult(_0x3ec55f,_0xbbe6af){_0xbbe6af=_0xbbe6af||0xc8;return function(_0x5ebdfe){if(_0x5ebdfe){return _0x3ec55f[_0x7659('0x1d')](_0xbbe6af)[_0x7659('0x1f')](_0x5ebdfe);}};}function respondWithFilteredResult(_0x306c2a,_0x2f7bf4){return function(_0x3bce14){if(_0x3bce14){var _0x1552b9=typeof _0x2f7bf4[_0x7659('0x20')]===_0x7659('0x21')&&typeof _0x2f7bf4[_0x7659('0x22')]==='undefined';var _0x3bc56c=_0x3bce14[_0x7659('0x23')];var _0x15b038=_0x1552b9?0x0:_0x2f7bf4[_0x7659('0x20')];var _0xd9d315=_0x1552b9?_0x3bce14['count']:_0x2f7bf4['offset']+_0x2f7bf4[_0x7659('0x22')];var _0x48c3ba;if(_0xd9d315>=_0x3bc56c){_0xd9d315=_0x3bc56c;_0x48c3ba=0xc8;}else{_0x48c3ba=0xce;}_0x306c2a[_0x7659('0x1d')](_0x48c3ba);return _0x306c2a[_0x7659('0x24')](_0x7659('0x25'),_0x15b038+'-'+_0xd9d315+'/'+_0x3bc56c)[_0x7659('0x1f')](_0x3bce14);}return null;};}function patchUpdates(_0x22d1f1){return function(_0x5e7e32){try{jsonpatch[_0x7659('0x26')](_0x5e7e32,_0x22d1f1,!![]);}catch(_0x51e13e){return BPromise['reject'](_0x51e13e);}return _0x5e7e32['save']();};}function saveUpdates(_0x17aac7,_0x15124e){return function(_0x338317){if(_0x338317){return _0x338317[_0x7659('0x27')](_0x17aac7)[_0x7659('0x28')](function(_0x2911a8){return _0x2911a8;});}return null;};}function removeEntity(_0x4605d8,_0x10e61f){return function(_0x4b5ad1){if(_0x4b5ad1){return _0x4b5ad1[_0x7659('0x29')]()[_0x7659('0x28')](function(){var _0x523650=_0x4b5ad1[_0x7659('0x2a')]({'plain':!![]});var _0x54c9df=_0x7659('0x2b');return db[_0x7659('0x2c')]['destroy']({'where':{'type':_0x54c9df,'resourceId':_0x523650['id']}})[_0x7659('0x28')](function(){return _0x4b5ad1;});})[_0x7659('0x28')](function(){_0x4605d8['status'](0xcc)[_0x7659('0x1e')]();});}};}function handleEntityNotFound(_0x17b52b,_0xc7afe8){return function(_0x15c4e5){if(!_0x15c4e5){_0x17b52b[_0x7659('0x1c')](0x194);}return _0x15c4e5;};}function handleError(_0x4ffaa4,_0x270f3b){_0x270f3b=_0x270f3b||0x1f4;return function(_0xcd7aeb){logger[_0x7659('0x2d')](_0xcd7aeb[_0x7659('0x2e')]);if(_0xcd7aeb[_0x7659('0x2f')]){delete _0xcd7aeb[_0x7659('0x2f')];}_0x4ffaa4[_0x7659('0x1d')](_0x270f3b)[_0x7659('0x30')](_0xcd7aeb);};}exports['index']=function(_0x24f43b,_0x20b772){var _0x5cfaa9={},_0x33377a={},_0x249b24={'count':0x0,'rows':[]};var _0x3660cb=_[_0x7659('0x31')](db[_0x7659('0x32')][_0x7659('0x33')],function(_0x10f596){return{'name':_0x10f596[_0x7659('0x34')],'type':_0x10f596[_0x7659('0x35')][_0x7659('0x36')]};});_0x33377a[_0x7659('0x37')]=_[_0x7659('0x31')](_0x3660cb,_0x7659('0x2f'));_0x33377a[_0x7659('0x38')]=_[_0x7659('0x39')](_0x24f43b['query']);_0x33377a[_0x7659('0x3a')]=_[_0x7659('0x3b')](_0x33377a['model'],_0x33377a['query']);_0x5cfaa9[_0x7659('0x3c')]=_[_0x7659('0x3b')](_0x33377a['model'],qs[_0x7659('0x3d')](_0x24f43b[_0x7659('0x38')]['fields']));_0x5cfaa9['attributes']=_0x5cfaa9['attributes'][_0x7659('0x3e')]?_0x5cfaa9[_0x7659('0x3c')]:_0x33377a['model'];if(!_0x24f43b['query'][_0x7659('0x3f')](_0x7659('0x40'))){_0x5cfaa9['limit']=qs[_0x7659('0x22')](_0x24f43b['query'][_0x7659('0x22')]);_0x5cfaa9['offset']=qs[_0x7659('0x20')](_0x24f43b[_0x7659('0x38')][_0x7659('0x20')]);}_0x5cfaa9[_0x7659('0x41')]=qs[_0x7659('0x42')](_0x24f43b[_0x7659('0x38')][_0x7659('0x42')]);_0x5cfaa9[_0x7659('0x43')]=qs[_0x7659('0x3a')](_[_0x7659('0x44')](_0x24f43b[_0x7659('0x38')],_0x33377a['filters']),_0x3660cb);if(_0x24f43b[_0x7659('0x38')]['filter']){_0x5cfaa9['where']=_[_0x7659('0x45')](_0x5cfaa9[_0x7659('0x43')],{'$or':_['map'](_0x3660cb,function(_0x3a828f){if(_0x3a828f[_0x7659('0x35')]!==_0x7659('0x46')){var _0x13ff39={};_0x13ff39[_0x3a828f[_0x7659('0x2f')]]={'$like':'%'+_0x24f43b[_0x7659('0x38')][_0x7659('0x47')]+'%'};return _0x13ff39;}})});}_0x5cfaa9=_['merge']({},_0x5cfaa9,_0x24f43b[_0x7659('0x48')]);var _0x220059={'where':_0x5cfaa9[_0x7659('0x43')]};return db[_0x7659('0x32')][_0x7659('0x23')](_0x220059)[_0x7659('0x28')](function(_0xb7bdb9){_0x249b24['count']=_0xb7bdb9;if(_0x24f43b[_0x7659('0x38')]['includeAll']){_0x5cfaa9[_0x7659('0x49')]=[{'all':!![]}];}return db[_0x7659('0x32')]['findAll'](_0x5cfaa9);})[_0x7659('0x28')](function(_0x52880e){_0x249b24['rows']=_0x52880e;return _0x249b24;})['then'](respondWithFilteredResult(_0x20b772,_0x5cfaa9))[_0x7659('0x4a')](handleError(_0x20b772,null));};exports[_0x7659('0x4b')]=function(_0x4ba6e2,_0x3db6e8){var _0x34ef07={'raw':![],'where':{'id':_0x4ba6e2[_0x7659('0x4c')]['id']}},_0x42438b={};_0x42438b[_0x7659('0x37')]=_['keys'](db[_0x7659('0x32')][_0x7659('0x33')]);_0x42438b[_0x7659('0x38')]=_[_0x7659('0x39')](_0x4ba6e2[_0x7659('0x38')]);_0x42438b['filters']=_[_0x7659('0x3b')](_0x42438b[_0x7659('0x37')],_0x42438b[_0x7659('0x38')]);_0x34ef07[_0x7659('0x3c')]=_['intersection'](_0x42438b[_0x7659('0x37')],qs['fields'](_0x4ba6e2[_0x7659('0x38')]['fields']));_0x34ef07[_0x7659('0x3c')]=_0x34ef07['attributes'][_0x7659('0x3e')]?_0x34ef07[_0x7659('0x3c')]:_0x42438b[_0x7659('0x37')];if(_0x4ba6e2[_0x7659('0x38')][_0x7659('0x4d')]){_0x34ef07[_0x7659('0x49')]=[{'all':!![]}];}_0x34ef07=_['merge']({},_0x34ef07,_0x4ba6e2['options']);return db[_0x7659('0x32')][_0x7659('0x4e')](_0x34ef07)[_0x7659('0x28')](handleEntityNotFound(_0x3db6e8,null))[_0x7659('0x28')](respondWithResult(_0x3db6e8,null))[_0x7659('0x4a')](handleError(_0x3db6e8,null));};exports[_0x7659('0x4f')]=function(_0x17f553,_0x5b3b99){return db[_0x7659('0x32')]['create'](_0x17f553[_0x7659('0x50')],{})[_0x7659('0x28')](function(_0x36f4a8){var _0x4a84c8=_0x17f553[_0x7659('0x51')]['get']({'plain':!![]});if(!_0x4a84c8)throw new Error(_0x7659('0x52'));if(_0x4a84c8[_0x7659('0x53')]===_0x7659('0x51')){var _0x54f0ae=_0x36f4a8['get']({'plain':!![]});var _0x2df7d3=_0x7659('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x2df7d3,'userProfileId':_0x4a84c8[_0x7659('0x54')]},'raw':!![]})[_0x7659('0x28')](function(_0x3c2db8){if(_0x3c2db8&&_0x3c2db8[_0x7659('0x55')]===0x0){return db['UserProfileResource'][_0x7659('0x4f')]({'name':_0x54f0ae[_0x7659('0x2f')],'resourceId':_0x54f0ae['id'],'type':_0x3c2db8[_0x7659('0x2f')],'sectionId':_0x3c2db8['id']},{})[_0x7659('0x28')](function(){return _0x36f4a8;});}else{return _0x36f4a8;}})[_0x7659('0x4a')](function(_0x8ab507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8ab507);throw _0x8ab507;});}return _0x36f4a8;})[_0x7659('0x28')](respondWithResult(_0x5b3b99,0xc9))[_0x7659('0x4a')](handleError(_0x5b3b99,null));};exports['update']=function(_0x235602,_0x4df2b3){if(_0x235602[_0x7659('0x50')]['id']){delete _0x235602['body']['id'];}return db[_0x7659('0x32')][_0x7659('0x4e')]({'where':{'id':_0x235602[_0x7659('0x4c')]['id']}})[_0x7659('0x28')](handleEntityNotFound(_0x4df2b3,null))[_0x7659('0x28')](saveUpdates(_0x235602['body'],null))['then'](respondWithResult(_0x4df2b3,null))[_0x7659('0x4a')](handleError(_0x4df2b3,null));};exports[_0x7659('0x29')]=function(_0x3c1253,_0x30b2b4){return db[_0x7659('0x32')][_0x7659('0x4e')]({'where':{'id':_0x3c1253['params']['id']}})[_0x7659('0x28')](handleEntityNotFound(_0x30b2b4,null))[_0x7659('0x28')](removeEntity(_0x30b2b4,null))[_0x7659('0x4a')](handleError(_0x30b2b4,null));};exports[_0x7659('0x56')]=function(_0xed5919,_0x32439e,_0x293fa3){return db[_0x7659('0x32')][_0x7659('0x4e')]({'where':{'id':_0xed5919[_0x7659('0x4c')]['id']}})[_0x7659('0x28')](handleEntityNotFound(_0x32439e,null))['then'](function(_0x23f010){if(_0x23f010){return _0x23f010[_0x7659('0x56')](_0xed5919[_0x7659('0x50')][_0x7659('0x57')],_[_0x7659('0x58')](_0xed5919[_0x7659('0x50')],[_0x7659('0x57'),'id'])||{});}})[_0x7659('0x28')](respondWithResult(_0x32439e,null))[_0x7659('0x4a')](handleError(_0x32439e,null));};exports[_0x7659('0x59')]=function(_0xee08f4,_0x2a6a11,_0x276103){return db[_0x7659('0x32')]['find']({'where':{'id':_0xee08f4[_0x7659('0x4c')]['id']}})[_0x7659('0x28')](handleEntityNotFound(_0x2a6a11,null))['then'](function(_0x25e49b){if(_0x25e49b){return _0x25e49b[_0x7659('0x59')](_0xee08f4['query'][_0x7659('0x57')])[_0x7659('0x28')](function(){if(_[_0x7659('0x5a')](_0xee08f4[_0x7659('0x38')][_0x7659('0x57')])){for(var _0x1d6c81=0x0;_0x1d6c81<_0xee08f4[_0x7659('0x38')]['ids']['length'];_0x1d6c81+=0x1){socket[_0x7659('0x5b')](_0x7659('0x5c'),{'UserId':Number(_0xee08f4[_0x7659('0x38')]['ids'][_0x1d6c81]),'SquareProjectId':Number(_0xee08f4[_0x7659('0x4c')]['id'])});}}else{socket[_0x7659('0x5b')]('userSquareProject:remove',{'UserId':Number(_0xee08f4['query'][_0x7659('0x57')]),'SquareProjectId':Number(_0xee08f4[_0x7659('0x4c')]['id'])});}});}})[_0x7659('0x28')](respondWithStatusCode(_0x2a6a11,null))[_0x7659('0x4a')](handleError(_0x2a6a11,null));};exports[_0x7659('0x5d')]=function(_0x4dffc5,_0x3ebdcf,_0x188ce8){var _0x18e97c={};var _0x438de3={};var _0x9017bf;var _0x2ad089;return db[_0x7659('0x32')]['findOne']({'where':{'id':_0x4dffc5[_0x7659('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ebdcf,null))[_0x7659('0x28')](function(_0x26163a){if(_0x26163a){_0x9017bf=_0x26163a;_0x438de3[_0x7659('0x37')]=_[_0x7659('0x39')](db[_0x7659('0x5e')][_0x7659('0x33')]);_0x438de3[_0x7659('0x38')]=_['keys'](_0x4dffc5[_0x7659('0x38')]);_0x438de3['filters']=_['intersection'](_0x438de3[_0x7659('0x37')],_0x438de3[_0x7659('0x38')]);_0x18e97c[_0x7659('0x3c')]=_[_0x7659('0x3b')](_0x438de3['model'],qs[_0x7659('0x3d')](_0x4dffc5[_0x7659('0x38')]['fields']));_0x18e97c[_0x7659('0x3c')]=_0x18e97c[_0x7659('0x3c')][_0x7659('0x3e')]?_0x18e97c[_0x7659('0x3c')]:_0x438de3['model'];_0x18e97c[_0x7659('0x41')]=qs[_0x7659('0x42')](_0x4dffc5[_0x7659('0x38')]['sort']);_0x18e97c[_0x7659('0x43')]=qs[_0x7659('0x3a')](_['pick'](_0x4dffc5['query'],_0x438de3[_0x7659('0x3a')]));if(_0x4dffc5['query'][_0x7659('0x47')]){_0x18e97c[_0x7659('0x43')]=_[_0x7659('0x45')](_0x18e97c[_0x7659('0x43')],{'$or':_[_0x7659('0x31')](_0x18e97c['attributes'],function(_0x1b90fa){var _0x41ee02={};_0x41ee02[_0x1b90fa]={'$like':'%'+_0x4dffc5[_0x7659('0x38')][_0x7659('0x47')]+'%'};return _0x41ee02;})});}_0x18e97c=_[_0x7659('0x45')]({},_0x18e97c,_0x4dffc5[_0x7659('0x48')]);return _0x9017bf[_0x7659('0x5d')](_0x18e97c);}})['then'](function(_0x2ee779){if(_0x2ee779){_0x2ad089=_0x2ee779[_0x7659('0x3e')];if(!_0x4dffc5['query'][_0x7659('0x3f')](_0x7659('0x40'))){_0x18e97c[_0x7659('0x22')]=qs[_0x7659('0x22')](_0x4dffc5['query'][_0x7659('0x22')]);_0x18e97c[_0x7659('0x20')]=qs[_0x7659('0x20')](_0x4dffc5['query'][_0x7659('0x20')]);}return _0x9017bf[_0x7659('0x5d')](_0x18e97c);}})[_0x7659('0x28')](function(_0x41f128){if(_0x41f128){return _0x41f128?{'count':_0x2ad089,'rows':_0x41f128}:null;}})[_0x7659('0x28')](respondWithResult(_0x3ebdcf,null))[_0x7659('0x4a')](handleError(_0x3ebdcf,null));}; \ No newline at end of file +var _0xec83=['UserProfileSection','userProfileId','autoAssociation','catch','params','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','order','filter','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','offset','undefined','limit','count','json','apply','reject','update','then','get','SquareProjects','UserProfileResource','destroy','error','stack','name','index','map','SquareProject','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','options','includeAll','include','findAll','rows','show','rawAttributes','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x2590fc,_0x676871){var _0x1defb7=function(_0x418aa4){while(--_0x418aa4){_0x2590fc['push'](_0x2590fc['shift']());}};_0x1defb7(++_0x676871);}(_0xec83,0x6d));var _0x3ec8=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0xec83[_0x1f1511];return _0x1d9ab8;};'use strict';var emlformat=require(_0x3ec8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ec8('0x1'));var jsonpatch=require(_0x3ec8('0x2'));var rp=require(_0x3ec8('0x3'));var moment=require('moment');var BPromise=require(_0x3ec8('0x4'));var Mustache=require('mustache');var util=require(_0x3ec8('0x5'));var path=require(_0x3ec8('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(_0x3ec8('0x7'));var squel=require(_0x3ec8('0x8'));var crypto=require('crypto');var jsforce=require(_0x3ec8('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x3ec8('0xa'));var querystring=require(_0x3ec8('0xb'));var Papa=require('papaparse');var Redis=require(_0x3ec8('0xc'));var authService=require(_0x3ec8('0xd'));var qs=require(_0x3ec8('0xe'));var as=require(_0x3ec8('0xf'));var hardwareService=require(_0x3ec8('0x10'));var logger=require('../../config/logger')(_0x3ec8('0x11'));var utils=require(_0x3ec8('0x12'));var config=require(_0x3ec8('0x13'));var licenseUtil=require(_0x3ec8('0x14'));var db=require(_0x3ec8('0x15'))['db'];config[_0x3ec8('0x16')]=_['defaults'](config[_0x3ec8('0x16')],{'host':_0x3ec8('0x17'),'port':0x18eb});var socket=require(_0x3ec8('0x18'))(new Redis(config[_0x3ec8('0x16')]));require(_0x3ec8('0x19'))['register'](socket);function respondWithStatusCode(_0x3f9438,_0x25c2f6){_0x25c2f6=_0x25c2f6||0xcc;return function(_0x2c96a4){if(_0x2c96a4){return _0x3f9438[_0x3ec8('0x1a')](_0x25c2f6);}return _0x3f9438[_0x3ec8('0x1b')](_0x25c2f6)['end']();};}function respondWithResult(_0x42eb7f,_0x217671){_0x217671=_0x217671||0xc8;return function(_0x3a8d6d){if(_0x3a8d6d){return _0x42eb7f[_0x3ec8('0x1b')](_0x217671)['json'](_0x3a8d6d);}};}function respondWithFilteredResult(_0x280b56,_0x10607b){return function(_0x59ad42){if(_0x59ad42){var _0x5b81c8=typeof _0x10607b[_0x3ec8('0x1c')]===_0x3ec8('0x1d')&&typeof _0x10607b[_0x3ec8('0x1e')]===_0x3ec8('0x1d');var _0x332421=_0x59ad42['count'];var _0x28135e=_0x5b81c8?0x0:_0x10607b[_0x3ec8('0x1c')];var _0x3960e3=_0x5b81c8?_0x59ad42[_0x3ec8('0x1f')]:_0x10607b[_0x3ec8('0x1c')]+_0x10607b['limit'];var _0x457f45;if(_0x3960e3>=_0x332421){_0x3960e3=_0x332421;_0x457f45=0xc8;}else{_0x457f45=0xce;}_0x280b56['status'](_0x457f45);return _0x280b56['set']('Content-Range',_0x28135e+'-'+_0x3960e3+'/'+_0x332421)[_0x3ec8('0x20')](_0x59ad42);}return null;};}function patchUpdates(_0x3330c5){return function(_0x188ec2){try{jsonpatch[_0x3ec8('0x21')](_0x188ec2,_0x3330c5,!![]);}catch(_0x1f549c){return BPromise[_0x3ec8('0x22')](_0x1f549c);}return _0x188ec2['save']();};}function saveUpdates(_0x4329c0,_0x106168){return function(_0x319056){if(_0x319056){return _0x319056[_0x3ec8('0x23')](_0x4329c0)['then'](function(_0x51a565){return _0x51a565;});}return null;};}function removeEntity(_0x26802c,_0x3c337b){return function(_0x45828c){if(_0x45828c){return _0x45828c['destroy']()[_0x3ec8('0x24')](function(){var _0x205fe9=_0x45828c[_0x3ec8('0x25')]({'plain':!![]});var _0x5ec797=_0x3ec8('0x26');return db[_0x3ec8('0x27')][_0x3ec8('0x28')]({'where':{'type':_0x5ec797,'resourceId':_0x205fe9['id']}})[_0x3ec8('0x24')](function(){return _0x45828c;});})[_0x3ec8('0x24')](function(){_0x26802c[_0x3ec8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x148823,_0x43508d){return function(_0x293676){if(!_0x293676){_0x148823[_0x3ec8('0x1a')](0x194);}return _0x293676;};}function handleError(_0x1a8c39,_0x248700){_0x248700=_0x248700||0x1f4;return function(_0x27a7bb){logger[_0x3ec8('0x29')](_0x27a7bb[_0x3ec8('0x2a')]);if(_0x27a7bb['name']){delete _0x27a7bb[_0x3ec8('0x2b')];}_0x1a8c39[_0x3ec8('0x1b')](_0x248700)['send'](_0x27a7bb);};}exports[_0x3ec8('0x2c')]=function(_0xda71cc,_0x5f5dbe){var _0x3345ba={},_0x4587fe={},_0x468837={'count':0x0,'rows':[]};var _0x192cdd=_[_0x3ec8('0x2d')](db[_0x3ec8('0x2e')]['rawAttributes'],function(_0x1eb105){return{'name':_0x1eb105[_0x3ec8('0x2f')],'type':_0x1eb105[_0x3ec8('0x30')][_0x3ec8('0x31')]};});_0x4587fe['model']=_[_0x3ec8('0x2d')](_0x192cdd,_0x3ec8('0x2b'));_0x4587fe[_0x3ec8('0x32')]=_[_0x3ec8('0x33')](_0xda71cc['query']);_0x4587fe['filters']=_[_0x3ec8('0x34')](_0x4587fe[_0x3ec8('0x35')],_0x4587fe[_0x3ec8('0x32')]);_0x3345ba[_0x3ec8('0x36')]=_[_0x3ec8('0x34')](_0x4587fe[_0x3ec8('0x35')],qs[_0x3ec8('0x37')](_0xda71cc[_0x3ec8('0x32')]['fields']));_0x3345ba['attributes']=_0x3345ba['attributes'][_0x3ec8('0x38')]?_0x3345ba[_0x3ec8('0x36')]:_0x4587fe[_0x3ec8('0x35')];if(!_0xda71cc['query']['hasOwnProperty'](_0x3ec8('0x39'))){_0x3345ba[_0x3ec8('0x1e')]=qs[_0x3ec8('0x1e')](_0xda71cc[_0x3ec8('0x32')][_0x3ec8('0x1e')]);_0x3345ba['offset']=qs['offset'](_0xda71cc[_0x3ec8('0x32')][_0x3ec8('0x1c')]);}_0x3345ba['order']=qs[_0x3ec8('0x3a')](_0xda71cc[_0x3ec8('0x32')]['sort']);_0x3345ba[_0x3ec8('0x3b')]=qs[_0x3ec8('0x3c')](_[_0x3ec8('0x3d')](_0xda71cc[_0x3ec8('0x32')],_0x4587fe['filters']),_0x192cdd);if(_0xda71cc['query']['filter']){_0x3345ba[_0x3ec8('0x3b')]=_['merge'](_0x3345ba[_0x3ec8('0x3b')],{'$or':_[_0x3ec8('0x2d')](_0x192cdd,function(_0x434f27){if(_0x434f27[_0x3ec8('0x30')]!=='VIRTUAL'){var _0x222139={};_0x222139[_0x434f27[_0x3ec8('0x2b')]]={'$like':'%'+_0xda71cc[_0x3ec8('0x32')]['filter']+'%'};return _0x222139;}})});}_0x3345ba=_['merge']({},_0x3345ba,_0xda71cc[_0x3ec8('0x3e')]);var _0x1bdfaf={'where':_0x3345ba['where']};return db[_0x3ec8('0x2e')][_0x3ec8('0x1f')](_0x1bdfaf)[_0x3ec8('0x24')](function(_0x1cf0ba){_0x468837[_0x3ec8('0x1f')]=_0x1cf0ba;if(_0xda71cc[_0x3ec8('0x32')][_0x3ec8('0x3f')]){_0x3345ba[_0x3ec8('0x40')]=[{'all':!![]}];}return db[_0x3ec8('0x2e')][_0x3ec8('0x41')](_0x3345ba);})['then'](function(_0x5e995a){_0x468837[_0x3ec8('0x42')]=_0x5e995a;return _0x468837;})[_0x3ec8('0x24')](respondWithFilteredResult(_0x5f5dbe,_0x3345ba))['catch'](handleError(_0x5f5dbe,null));};exports[_0x3ec8('0x43')]=function(_0x499d86,_0x4f9f46){var _0x496046={'raw':![],'where':{'id':_0x499d86['params']['id']}},_0x49e816={};_0x49e816[_0x3ec8('0x35')]=_[_0x3ec8('0x33')](db[_0x3ec8('0x2e')][_0x3ec8('0x44')]);_0x49e816['query']=_[_0x3ec8('0x33')](_0x499d86[_0x3ec8('0x32')]);_0x49e816['filters']=_[_0x3ec8('0x34')](_0x49e816[_0x3ec8('0x35')],_0x49e816[_0x3ec8('0x32')]);_0x496046[_0x3ec8('0x36')]=_[_0x3ec8('0x34')](_0x49e816[_0x3ec8('0x35')],qs[_0x3ec8('0x37')](_0x499d86[_0x3ec8('0x32')]['fields']));_0x496046['attributes']=_0x496046[_0x3ec8('0x36')][_0x3ec8('0x38')]?_0x496046[_0x3ec8('0x36')]:_0x49e816[_0x3ec8('0x35')];if(_0x499d86[_0x3ec8('0x32')]['includeAll']){_0x496046[_0x3ec8('0x40')]=[{'all':!![]}];}_0x496046=_[_0x3ec8('0x45')]({},_0x496046,_0x499d86[_0x3ec8('0x3e')]);return db[_0x3ec8('0x2e')][_0x3ec8('0x46')](_0x496046)['then'](handleEntityNotFound(_0x4f9f46,null))[_0x3ec8('0x24')](respondWithResult(_0x4f9f46,null))['catch'](handleError(_0x4f9f46,null));};exports[_0x3ec8('0x47')]=function(_0x2d6966,_0x1ddee5){return db['SquareProject'][_0x3ec8('0x47')](_0x2d6966[_0x3ec8('0x48')],{})[_0x3ec8('0x24')](function(_0x27dc3d){var _0x4fb9f3=_0x2d6966['user']['get']({'plain':!![]});if(!_0x4fb9f3)throw new Error(_0x3ec8('0x49'));if(_0x4fb9f3['role']===_0x3ec8('0x4a')){var _0x5251aa=_0x27dc3d[_0x3ec8('0x25')]({'plain':!![]});var _0x80e270='SquareProjects';return db[_0x3ec8('0x4b')][_0x3ec8('0x46')]({'where':{'name':_0x80e270,'userProfileId':_0x4fb9f3[_0x3ec8('0x4c')]},'raw':!![]})[_0x3ec8('0x24')](function(_0x502847){if(_0x502847&&_0x502847[_0x3ec8('0x4d')]===0x0){return db[_0x3ec8('0x27')][_0x3ec8('0x47')]({'name':_0x5251aa[_0x3ec8('0x2b')],'resourceId':_0x5251aa['id'],'type':_0x502847[_0x3ec8('0x2b')],'sectionId':_0x502847['id']},{})[_0x3ec8('0x24')](function(){return _0x27dc3d;});}else{return _0x27dc3d;}})[_0x3ec8('0x4e')](function(_0x435339){logger[_0x3ec8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x435339);throw _0x435339;});}return _0x27dc3d;})['then'](respondWithResult(_0x1ddee5,0xc9))['catch'](handleError(_0x1ddee5,null));};exports[_0x3ec8('0x23')]=function(_0x26175e,_0x1b58ed){if(_0x26175e[_0x3ec8('0x48')]['id']){delete _0x26175e[_0x3ec8('0x48')]['id'];}return db[_0x3ec8('0x2e')]['find']({'where':{'id':_0x26175e[_0x3ec8('0x4f')]['id']}})[_0x3ec8('0x24')](handleEntityNotFound(_0x1b58ed,null))[_0x3ec8('0x24')](saveUpdates(_0x26175e['body'],null))[_0x3ec8('0x24')](respondWithResult(_0x1b58ed,null))['catch'](handleError(_0x1b58ed,null));};exports['destroy']=function(_0x584f4f,_0x13c3ef){return db[_0x3ec8('0x2e')][_0x3ec8('0x46')]({'where':{'id':_0x584f4f['params']['id']}})[_0x3ec8('0x24')](handleEntityNotFound(_0x13c3ef,null))[_0x3ec8('0x24')](removeEntity(_0x13c3ef,null))[_0x3ec8('0x4e')](handleError(_0x13c3ef,null));};exports[_0x3ec8('0x50')]=function(_0x218d2d,_0x19f1d5,_0x48093a){return db['SquareProject'][_0x3ec8('0x46')]({'where':{'id':_0x218d2d[_0x3ec8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x19f1d5,null))[_0x3ec8('0x24')](function(_0x1edb9c){if(_0x1edb9c){return _0x1edb9c[_0x3ec8('0x50')](_0x218d2d[_0x3ec8('0x48')]['ids'],_[_0x3ec8('0x51')](_0x218d2d[_0x3ec8('0x48')],[_0x3ec8('0x52'),'id'])||{});}})[_0x3ec8('0x24')](respondWithResult(_0x19f1d5,null))[_0x3ec8('0x4e')](handleError(_0x19f1d5,null));};exports['removeUsers']=function(_0x376030,_0xb4e365,_0x3ffb10){return db[_0x3ec8('0x2e')]['find']({'where':{'id':_0x376030[_0x3ec8('0x4f')]['id']}})[_0x3ec8('0x24')](handleEntityNotFound(_0xb4e365,null))[_0x3ec8('0x24')](function(_0x44a259){if(_0x44a259){return _0x44a259[_0x3ec8('0x53')](_0x376030[_0x3ec8('0x32')]['ids'])['then'](function(){if(_[_0x3ec8('0x54')](_0x376030[_0x3ec8('0x32')][_0x3ec8('0x52')])){for(var _0x230044=0x0;_0x230044<_0x376030[_0x3ec8('0x32')][_0x3ec8('0x52')][_0x3ec8('0x38')];_0x230044+=0x1){socket[_0x3ec8('0x55')](_0x3ec8('0x56'),{'UserId':Number(_0x376030[_0x3ec8('0x32')]['ids'][_0x230044]),'SquareProjectId':Number(_0x376030['params']['id'])});}}else{socket[_0x3ec8('0x55')](_0x3ec8('0x56'),{'UserId':Number(_0x376030[_0x3ec8('0x32')]['ids']),'SquareProjectId':Number(_0x376030[_0x3ec8('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0xb4e365,null))[_0x3ec8('0x4e')](handleError(_0xb4e365,null));};exports[_0x3ec8('0x57')]=function(_0x19afcc,_0x2224e6,_0x183b34){var _0x1cd334={};var _0x2592be={};var _0x8a707d;var _0x29359d;return db['SquareProject']['findOne']({'where':{'id':_0x19afcc[_0x3ec8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2224e6,null))[_0x3ec8('0x24')](function(_0x14fb80){if(_0x14fb80){_0x8a707d=_0x14fb80;_0x2592be['model']=_[_0x3ec8('0x33')](db[_0x3ec8('0x58')][_0x3ec8('0x44')]);_0x2592be[_0x3ec8('0x32')]=_[_0x3ec8('0x33')](_0x19afcc[_0x3ec8('0x32')]);_0x2592be[_0x3ec8('0x3c')]=_[_0x3ec8('0x34')](_0x2592be[_0x3ec8('0x35')],_0x2592be[_0x3ec8('0x32')]);_0x1cd334[_0x3ec8('0x36')]=_[_0x3ec8('0x34')](_0x2592be['model'],qs[_0x3ec8('0x37')](_0x19afcc[_0x3ec8('0x32')][_0x3ec8('0x37')]));_0x1cd334[_0x3ec8('0x36')]=_0x1cd334[_0x3ec8('0x36')]['length']?_0x1cd334[_0x3ec8('0x36')]:_0x2592be[_0x3ec8('0x35')];_0x1cd334[_0x3ec8('0x59')]=qs[_0x3ec8('0x3a')](_0x19afcc[_0x3ec8('0x32')][_0x3ec8('0x3a')]);_0x1cd334['where']=qs[_0x3ec8('0x3c')](_[_0x3ec8('0x3d')](_0x19afcc[_0x3ec8('0x32')],_0x2592be[_0x3ec8('0x3c')]));if(_0x19afcc['query'][_0x3ec8('0x5a')]){_0x1cd334[_0x3ec8('0x3b')]=_[_0x3ec8('0x45')](_0x1cd334[_0x3ec8('0x3b')],{'$or':_[_0x3ec8('0x2d')](_0x1cd334[_0x3ec8('0x36')],function(_0x28a20c){var _0x4e4ede={};_0x4e4ede[_0x28a20c]={'$like':'%'+_0x19afcc['query']['filter']+'%'};return _0x4e4ede;})});}_0x1cd334=_[_0x3ec8('0x45')]({},_0x1cd334,_0x19afcc[_0x3ec8('0x3e')]);return _0x8a707d['getUsers'](_0x1cd334);}})[_0x3ec8('0x24')](function(_0x3290fc){if(_0x3290fc){_0x29359d=_0x3290fc[_0x3ec8('0x38')];if(!_0x19afcc[_0x3ec8('0x32')][_0x3ec8('0x5b')](_0x3ec8('0x39'))){_0x1cd334[_0x3ec8('0x1e')]=qs[_0x3ec8('0x1e')](_0x19afcc[_0x3ec8('0x32')]['limit']);_0x1cd334[_0x3ec8('0x1c')]=qs[_0x3ec8('0x1c')](_0x19afcc[_0x3ec8('0x32')][_0x3ec8('0x1c')]);}return _0x8a707d[_0x3ec8('0x57')](_0x1cd334);}})[_0x3ec8('0x24')](function(_0xe4b30e){if(_0xe4b30e){return _0xe4b30e?{'count':_0x29359d,'rows':_0xe4b30e}:null;}})[_0x3ec8('0x24')](respondWithResult(_0x2224e6,null))[_0x3ec8('0x4e')](handleError(_0x2224e6,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index af00226..3ad45e1 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 _0xb945=['emit','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x148546,_0x8cfe61){var _0xf301a7=function(_0x4f8760){while(--_0x4f8760){_0x148546['push'](_0x148546['shift']());}};_0xf301a7(++_0x8cfe61);}(_0xb945,0x8f));var _0x5b94=function(_0x2ea857,_0x466b31){_0x2ea857=_0x2ea857-0x0;var _0x20429a=_0xb945[_0x2ea857];return _0x20429a;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x5b94('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5b94('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5b94('0x2'),'afterDestroy':_0x5b94('0x3')};function emitEvent(_0x40c389){return function(_0x2abfbc,_0x4e46af,_0x93b4e1){SquareProjectEvents['emit'](_0x40c389+':'+_0x2abfbc['id'],_0x2abfbc);SquareProjectEvents[_0x5b94('0x4')](_0x40c389,_0x2abfbc);_0x93b4e1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x5b94('0x5')](e,emitEvent(event));}}module[_0x5b94('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x529c=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x529c,0xdd));var _0xc529=function(_0x2d6c96,_0x3515d2){_0x2d6c96=_0x2d6c96-0x0;var _0x2e99aa=_0x529c[_0x2d6c96];return _0x2e99aa;};'use strict';var EventEmitter=require(_0xc529('0x0'));var SquareProject=require(_0xc529('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc529('0x2')](0x0);var events={'afterCreate':_0xc529('0x3'),'afterUpdate':_0xc529('0x4'),'afterDestroy':_0xc529('0x5')};function emitEvent(_0x315b5b){return function(_0x40c5f0,_0x3bb9af,_0x5adca8){SquareProjectEvents[_0xc529('0x6')](_0x315b5b+':'+_0x40c5f0['id'],_0x40c5f0);SquareProjectEvents[_0xc529('0x6')](_0x315b5b,_0x40c5f0);_0x5adca8(null);};}for(var e in events){if(events[_0xc529('0x7')](e)){var event=events[e];SquareProject[_0xc529('0x8')](e,emitEvent(event));}}module[_0xc529('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index bf39299..da92959 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 _0x5630=['../../config/logger','api','bluebird','path','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x5630,0x8e));var _0x0563=function(_0x3833f5,_0x1725cf){_0x3833f5=_0x3833f5-0x0;var _0x356a24=_0x5630[_0x3833f5];return _0x356a24;};'use strict';var _=require(_0x0563('0x0'));var util=require(_0x0563('0x1'));var logger=require(_0x0563('0x2'))(_0x0563('0x3'));var moment=require('moment');var BPromise=require(_0x0563('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0563('0x5'));var rimraf=require('rimraf');var config=require(_0x0563('0x6'));var attributes=require(_0x0563('0x7'));module['exports']=function(_0x1d5d6b,_0x3038f6){return _0x1d5d6b[_0x0563('0x8')](_0x0563('0x9'),attributes,{'tableName':_0x0563('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x176b0c,_0x12952e,_0xe881e8){if(_0x176b0c[_0x0563('0xb')]('preproduction')){_0x176b0c['savedAt']=moment()[_0x0563('0xc')](_0x0563('0xd'));}if(_0x176b0c[_0x0563('0xb')](_0x0563('0xe'))){_0x176b0c[_0x0563('0xf')]=moment()[_0x0563('0xc')](_0x0563('0xd'));}_0xe881e8(null,_0x176b0c);}}});}; \ No newline at end of file +var _0xb0fa=['bluebird','request-promise','rimraf','define','square_projects','changed','preproduction','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','util','api'];(function(_0x4d2652,_0x4dc964){var _0x1a37ac=function(_0x9f8454){while(--_0x9f8454){_0x4d2652['push'](_0x4d2652['shift']());}};_0x1a37ac(++_0x4dc964);}(_0xb0fa,0xa6));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xab0f('0x0'));var logger=require('../../config/logger')(_0xab0f('0x1'));var moment=require('moment');var BPromise=require(_0xab0f('0x2'));var rp=require(_0xab0f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab0f('0x4'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x2d467d,_0x15df90){return _0x2d467d[_0xab0f('0x5')]('SquareProject',attributes,{'tableName':_0xab0f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f8ccf,_0x1e9922,_0x18ed62){if(_0x2f8ccf[_0xab0f('0x7')](_0xab0f('0x8'))){_0x2f8ccf[_0xab0f('0x9')]=moment()[_0xab0f('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2f8ccf[_0xab0f('0x7')](_0xab0f('0xb'))){_0x2f8ccf[_0xab0f('0xc')]=moment()[_0xab0f('0xa')](_0xab0f('0xd'));}_0x18ed62(null,_0x2f8ccf);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 9527387..d12bba1 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 _0x495d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareProject,\x20%s,\x20%s','SquareProject','find','options','raw','where','attributes','include','map','model','ShowSquareProject','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36ce70,_0x5f57a2){var _0x52d9f5=function(_0x24b2d3){while(--_0x24b2d3){_0x36ce70['push'](_0x36ce70['shift']());}};_0x52d9f5(++_0x5f57a2);}(_0x495d,0x112));var _0xd495=function(_0x24d34e,_0x2c8aff){_0x24d34e=_0x24d34e-0x0;var _0x2af80d=_0x495d[_0x24d34e];return _0x2af80d;};'use strict';var _=require(_0xd495('0x0'));var util=require('util');var moment=require(_0xd495('0x1'));var BPromise=require(_0xd495('0x2'));var rs=require(_0xd495('0x3'));var fs=require('fs');var Redis=require(_0xd495('0x4'));var db=require(_0xd495('0x5'))['db'];var utils=require(_0xd495('0x6'));var logger=require(_0xd495('0x7'))(_0xd495('0x8'));var config=require(_0xd495('0x9'));var jayson=require(_0xd495('0xa'));var client=jayson[_0xd495('0xb')][_0xd495('0xc')]({'port':0x232a});config[_0xd495('0xd')]=_[_0xd495('0xe')](config[_0xd495('0xd')],{'host':_0xd495('0xf'),'port':0x18eb});var socket=require(_0xd495('0x10'))(new Redis(config[_0xd495('0xd')]));require(_0xd495('0x11'))[_0xd495('0x12')](socket);function respondWithRpcPromise(_0xbed065,_0x2ab58d,_0xd3947a){return new BPromise(function(_0x5d1e95,_0x4adcdf){return client[_0xd495('0x13')](_0xbed065,_0xd3947a)[_0xd495('0x14')](function(_0x45387e){logger[_0xd495('0x15')]('SquareProject,\x20%s,\x20%s',_0x2ab58d,_0xd495('0x16'));logger[_0xd495('0x17')](_0xd495('0x18'),_0x2ab58d,'request\x20sent',JSON[_0xd495('0x19')](_0x45387e));if(_0x45387e[_0xd495('0x1a')]){if(_0x45387e[_0xd495('0x1a')]['code']===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x2ab58d,_0x45387e[_0xd495('0x1a')][_0xd495('0x1b')]);return _0x4adcdf(_0x45387e['error'][_0xd495('0x1b')]);}logger[_0xd495('0x1a')](_0xd495('0x1c'),_0x2ab58d,_0x45387e['error'][_0xd495('0x1b')]);return _0x5d1e95(_0x45387e['error'][_0xd495('0x1b')]);}else{logger[_0xd495('0x15')](_0xd495('0x1c'),_0x2ab58d,_0xd495('0x16'));_0x5d1e95(_0x45387e['result']['message']);}})['catch'](function(_0x236937){logger[_0xd495('0x1a')](_0xd495('0x1c'),_0x2ab58d,_0x236937);_0x4adcdf(_0x236937);});});}exports['ShowSquareProject']=function(_0x545b06){var _0x5f1ccc=this;return new Promise(function(_0x2cd307,_0x2c3d9b){return db[_0xd495('0x1d')][_0xd495('0x1e')]({'raw':_0x545b06[_0xd495('0x1f')]?_0x545b06[_0xd495('0x1f')][_0xd495('0x20')]===undefined?!![]:![]:!![],'where':_0x545b06['options']?_0x545b06['options'][_0xd495('0x21')]||null:null,'attributes':_0x545b06['options']?_0x545b06['options'][_0xd495('0x22')]||null:null,'include':_0x545b06['options']?_0x545b06['options'][_0xd495('0x23')]?_[_0xd495('0x24')](_0x545b06['options']['include'],function(_0x4ea0f1){return{'model':db[_0x4ea0f1[_0xd495('0x25')]],'as':_0x4ea0f1['as'],'attributes':_0x4ea0f1['attributes'],'include':_0x4ea0f1[_0xd495('0x23')]?_['map'](_0x4ea0f1[_0xd495('0x23')],function(_0x5d2523){return{'model':db[_0x5d2523[_0xd495('0x25')]],'as':_0x5d2523['as'],'attributes':_0x5d2523[_0xd495('0x22')],'include':_0x5d2523[_0xd495('0x23')]?_[_0xd495('0x24')](_0x5d2523[_0xd495('0x23')],function(_0x25fca1){return{'model':db[_0x25fca1[_0xd495('0x25')]],'as':_0x25fca1['as'],'attributes':_0x25fca1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd495('0x14')](function(_0x53f460){logger[_0xd495('0x15')](_0xd495('0x26'),_0x545b06);logger[_0xd495('0x17')](_0xd495('0x26'),_0x545b06,JSON[_0xd495('0x19')](_0x53f460));_0x2cd307(_0x53f460);})[_0xd495('0x27')](function(_0x40b985){logger[_0xd495('0x1a')](_0xd495('0x26'),_0x40b985[_0xd495('0x1b')],_0x545b06);_0x2c3d9b(_0x5f1ccc[_0xd495('0x1a')](0x1f4,_0x40b985[_0xd495('0x1b')]));});});}; \ No newline at end of file +var _0x7dca=['localhost','socket.io-emitter','./squareProject.socket','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSquareProject','find','options','raw','include','map','model','attributes','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x7dca,0x13e));var _0xa7dc=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x7dca[_0x280f4a];return _0x1bb157;};'use strict';var _=require(_0xa7dc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa7dc('0x1'));var rs=require(_0xa7dc('0x2'));var fs=require('fs');var Redis=require(_0xa7dc('0x3'));var db=require(_0xa7dc('0x4'))['db'];var utils=require(_0xa7dc('0x5'));var logger=require(_0xa7dc('0x6'))('rpc');var config=require(_0xa7dc('0x7'));var jayson=require(_0xa7dc('0x8'));var client=jayson[_0xa7dc('0x9')][_0xa7dc('0xa')]({'port':0x232a});config[_0xa7dc('0xb')]=_['defaults'](config[_0xa7dc('0xb')],{'host':_0xa7dc('0xc'),'port':0x18eb});var socket=require(_0xa7dc('0xd'))(new Redis(config[_0xa7dc('0xb')]));require(_0xa7dc('0xe'))['register'](socket);function respondWithRpcPromise(_0x3a1547,_0x565c30,_0x1f0c33){return new BPromise(function(_0x272153,_0xb2d756){return client['request'](_0x3a1547,_0x1f0c33)[_0xa7dc('0xf')](function(_0x3aad81){logger[_0xa7dc('0x10')](_0xa7dc('0x11'),_0x565c30,_0xa7dc('0x12'));logger['debug'](_0xa7dc('0x13'),_0x565c30,'request\x20sent',JSON['stringify'](_0x3aad81));if(_0x3aad81[_0xa7dc('0x14')]){if(_0x3aad81[_0xa7dc('0x14')]['code']===0x1f4){logger[_0xa7dc('0x14')](_0xa7dc('0x11'),_0x565c30,_0x3aad81[_0xa7dc('0x14')][_0xa7dc('0x15')]);return _0xb2d756(_0x3aad81[_0xa7dc('0x14')]['message']);}logger[_0xa7dc('0x14')](_0xa7dc('0x11'),_0x565c30,_0x3aad81[_0xa7dc('0x14')][_0xa7dc('0x15')]);return _0x272153(_0x3aad81[_0xa7dc('0x14')][_0xa7dc('0x15')]);}else{logger[_0xa7dc('0x10')](_0xa7dc('0x11'),_0x565c30,_0xa7dc('0x12'));_0x272153(_0x3aad81[_0xa7dc('0x16')]['message']);}})[_0xa7dc('0x17')](function(_0x1092ec){logger[_0xa7dc('0x14')](_0xa7dc('0x11'),_0x565c30,_0x1092ec);_0xb2d756(_0x1092ec);});});}exports[_0xa7dc('0x18')]=function(_0x40ae63){var _0x5cc9d8=this;return new Promise(function(_0x355223,_0x21ccb2){return db['SquareProject'][_0xa7dc('0x19')]({'raw':_0x40ae63[_0xa7dc('0x1a')]?_0x40ae63[_0xa7dc('0x1a')][_0xa7dc('0x1b')]===undefined?!![]:![]:!![],'where':_0x40ae63[_0xa7dc('0x1a')]?_0x40ae63[_0xa7dc('0x1a')]['where']||null:null,'attributes':_0x40ae63[_0xa7dc('0x1a')]?_0x40ae63['options']['attributes']||null:null,'include':_0x40ae63[_0xa7dc('0x1a')]?_0x40ae63[_0xa7dc('0x1a')][_0xa7dc('0x1c')]?_[_0xa7dc('0x1d')](_0x40ae63['options'][_0xa7dc('0x1c')],function(_0x1039db){return{'model':db[_0x1039db[_0xa7dc('0x1e')]],'as':_0x1039db['as'],'attributes':_0x1039db[_0xa7dc('0x1f')],'include':_0x1039db[_0xa7dc('0x1c')]?_[_0xa7dc('0x1d')](_0x1039db[_0xa7dc('0x1c')],function(_0x407d1b){return{'model':db[_0x407d1b['model']],'as':_0x407d1b['as'],'attributes':_0x407d1b[_0xa7dc('0x1f')],'include':_0x407d1b[_0xa7dc('0x1c')]?_[_0xa7dc('0x1d')](_0x407d1b[_0xa7dc('0x1c')],function(_0x54487b){return{'model':db[_0x54487b[_0xa7dc('0x1e')]],'as':_0x54487b['as'],'attributes':_0x54487b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa7dc('0xf')](function(_0x15e03e){logger[_0xa7dc('0x10')](_0xa7dc('0x18'),_0x40ae63);logger[_0xa7dc('0x20')](_0xa7dc('0x18'),_0x40ae63,JSON['stringify'](_0x15e03e));_0x355223(_0x15e03e);})[_0xa7dc('0x17')](function(_0x2e2584){logger[_0xa7dc('0x14')](_0xa7dc('0x18'),_0x2e2584['message'],_0x40ae63);_0x21ccb2(_0x5cc9d8[_0xa7dc('0x14')](0x1f4,_0x2e2584[_0xa7dc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index bf736ce..d8fcbcb 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 _0x193c=['emit','removeListener','register'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x193c,0x1dd));var _0xc193=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x193c[_0x167cc1];return _0x10bc4b;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove','update'];function createListener(_0x1a20ef,_0x5d5029){return function(_0x5ec721){_0x5d5029[_0xc193('0x0')](_0x1a20ef,_0x5ec721);};}function removeListener(_0xd186bd,_0xef0b55){return function(){SquareProjectEvents[_0xc193('0x1')](_0xd186bd,_0xef0b55);};}exports[_0xc193('0x2')]=function(_0x49b639){for(var _0xd8b9a8=0x0,_0x46854e=events['length'];_0xd8b9a8<_0x46854e;_0xd8b9a8++){var _0x285e01=events[_0xd8b9a8];var _0x58a98e=createListener('squareProject:'+_0x285e01,_0x49b639);SquareProjectEvents['on'](_0x285e01,_0x58a98e);}}; \ No newline at end of file +var _0x527e=['removeListener','register','length','./squareProject.events','save','update','emit'];(function(_0x1d7c5e,_0x37f142){var _0x9232a7=function(_0x531b27){while(--_0x531b27){_0x1d7c5e['push'](_0x1d7c5e['shift']());}};_0x9232a7(++_0x37f142);}(_0x527e,0xc7));var _0xe527=function(_0x32dcfd,_0x1ec0f3){_0x32dcfd=_0x32dcfd-0x0;var _0x472ad3=_0x527e[_0x32dcfd];return _0x472ad3;};'use strict';var SquareProjectEvents=require(_0xe527('0x0'));var events=[_0xe527('0x1'),'remove',_0xe527('0x2')];function createListener(_0x539a2c,_0x1315dc){return function(_0x403979){_0x1315dc[_0xe527('0x3')](_0x539a2c,_0x403979);};}function removeListener(_0x106a1f,_0x2c35a7){return function(){SquareProjectEvents[_0xe527('0x4')](_0x106a1f,_0x2c35a7);};}exports[_0xe527('0x5')]=function(_0x2a5eb5){for(var _0x54fb13=0x0,_0x485eaa=events[_0xe527('0x6')];_0x54fb13<_0x485eaa;_0x54fb13++){var _0x1798b8=events[_0x54fb13];var _0x3ae9a0=createListener('squareProject:'+_0x1798b8,_0x2a5eb5);SquareProjectEvents['on'](_0x1798b8,_0x3ae9a0);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index aa10890..fc1a622 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x4c862f,_0x1d2f49){var _0x9a0fa3=function(_0x3a1e88){while(--_0x3a1e88){_0x4c862f['push'](_0x4c862f['shift']());}};_0x9a0fa3(++_0x1d2f49);}(_0x7a54,0x106));var _0x47a5=function(_0x187594,_0x2998f0){_0x187594=_0x187594-0x0;var _0x36439a=_0x7a54[_0x187594];return _0x36439a;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _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(_0x49436b,_0x2d06b4){var _0x261047=function(_0x1beb4a){while(--_0x1beb4a){_0x49436b['push'](_0x49436b['shift']());}};_0x261047(++_0x2d06b4);}(_0x814b,0x1a2));var _0xb814=function(_0x2f02d4,_0x27b24a){_0x2f02d4=_0x2f02d4-0x0;var _0x4b707d=_0x814b[_0x2f02d4];return _0x4b707d;};'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 f1540a8..6ef78d7 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 _0x8d0e=['exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize'];(function(_0x1f6e7b,_0xfee648){var _0x39ed35=function(_0x28a1b9){while(--_0x28a1b9){_0x1f6e7b['push'](_0x1f6e7b['shift']());}};_0x39ed35(++_0xfee648);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1534ab,_0x11d0db){_0x1534ab=_0x1534ab-0x0;var _0x77c1ba=_0x8d0e[_0x1534ab];return _0x77c1ba;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'callerid':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'context':{'type':Sequelize[_0xe8d0('0x2')]},'extension':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize[_0xe8d0('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xe8d0('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xe8d0('0x2')]},'format':{'type':Sequelize[_0xe8d0('0x3')],'get':function(){var _0x469d37='';var _0xcc03d0=this[_0xe8d0('0x4')](_0xe8d0('0x5'));if(_0xcc03d0){_0x469d37=_0xcc03d0[_0xe8d0('0x6')](_0xcc03d0[_0xe8d0('0x7')]('.'));}return _0x469d37;}}}; \ No newline at end of file +var _0xe14b=['VIRTUAL','lastIndexOf','sequelize','exports','STRING'];(function(_0x2cd23b,_0x15bca3){var _0x354343=function(_0x5d0467){while(--_0x5d0467){_0x2cd23b['push'](_0x2cd23b['shift']());}};_0x354343(++_0x15bca3);}(_0xe14b,0x93));var _0xbe14=function(_0x1f4738,_0x1a6bbb){_0x1f4738=_0x1f4738-0x0;var _0x314206=_0xe14b[_0x1f4738];return _0x314206;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbe14('0x2')]},'context':{'type':Sequelize[_0xbe14('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbe14('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xbe14('0x2')]},'saveName':{'type':Sequelize[_0xbe14('0x2')]},'filename':{'type':Sequelize[_0xbe14('0x2')]},'savePath':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x3')],'get':function(){var _0x39387e='';var _0x196fca=this['getDataValue']('savePath');if(_0x196fca){_0x39387e=_0x196fca['substring'](_0x196fca[_0xbe14('0x4')]('.'));}return _0x39387e;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index a1ffc58..565b840 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 _0xefa2=['then','destroy','end','error','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','find','catch','create','body','params','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update'];(function(_0x5a1087,_0x7382d8){var _0xbc900e=function(_0xcd6cfd){while(--_0xcd6cfd){_0x5a1087['push'](_0x5a1087['shift']());}};_0xbc900e(++_0x7382d8);}(_0xefa2,0x162));var _0x2efa=function(_0x36b8bf,_0x58356e){_0x36b8bf=_0x36b8bf-0x0;var _0x4a14c7=_0xefa2[_0x36b8bf];return _0x4a14c7;};'use strict';var emlformat=require(_0x2efa('0x0'));var rimraf=require(_0x2efa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2efa('0x2'));var moment=require(_0x2efa('0x3'));var BPromise=require(_0x2efa('0x4'));var Mustache=require(_0x2efa('0x5'));var util=require('util');var path=require(_0x2efa('0x6'));var sox=require(_0x2efa('0x7'));var csv=require(_0x2efa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2efa('0x9'));var _=require('lodash');var squel=require(_0x2efa('0xa'));var crypto=require(_0x2efa('0xb'));var jsforce=require(_0x2efa('0xc'));var deskjs=require(_0x2efa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2efa('0xe'));var Papa=require(_0x2efa('0xf'));var Redis=require(_0x2efa('0x10'));var authService=require(_0x2efa('0x11'));var qs=require(_0x2efa('0x12'));var as=require(_0x2efa('0x13'));var hardwareService=require(_0x2efa('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2efa('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2efa('0x16'))['db'];function respondWithStatusCode(_0xa9b73b,_0x3b8f85){_0x3b8f85=_0x3b8f85||0xcc;return function(_0x92a6df){if(_0x92a6df){return _0xa9b73b[_0x2efa('0x17')](_0x3b8f85);}return _0xa9b73b[_0x2efa('0x18')](_0x3b8f85)['end']();};}function respondWithResult(_0x4d5e3c,_0x4c5503){_0x4c5503=_0x4c5503||0xc8;return function(_0x415c6d){if(_0x415c6d){return _0x4d5e3c['status'](_0x4c5503)[_0x2efa('0x19')](_0x415c6d);}};}function respondWithFilteredResult(_0x3f8cb0,_0x310e9d){return function(_0x11a2d8){if(_0x11a2d8){var _0x5f0d05=typeof _0x310e9d['offset']===_0x2efa('0x1a')&&typeof _0x310e9d[_0x2efa('0x1b')]===_0x2efa('0x1a');var _0x4783ff=_0x11a2d8[_0x2efa('0x1c')];var _0x48190e=_0x5f0d05?0x0:_0x310e9d[_0x2efa('0x1d')];var _0x1e91b3=_0x5f0d05?_0x11a2d8[_0x2efa('0x1c')]:_0x310e9d[_0x2efa('0x1d')]+_0x310e9d[_0x2efa('0x1b')];var _0x1e3e1e;if(_0x1e91b3>=_0x4783ff){_0x1e91b3=_0x4783ff;_0x1e3e1e=0xc8;}else{_0x1e3e1e=0xce;}_0x3f8cb0[_0x2efa('0x18')](_0x1e3e1e);return _0x3f8cb0[_0x2efa('0x1e')](_0x2efa('0x1f'),_0x48190e+'-'+_0x1e91b3+'/'+_0x4783ff)[_0x2efa('0x19')](_0x11a2d8);}return null;};}function patchUpdates(_0x4c1abd){return function(_0x27f99f){try{jsonpatch['apply'](_0x27f99f,_0x4c1abd,!![]);}catch(_0x5cb0cb){return BPromise['reject'](_0x5cb0cb);}return _0x27f99f[_0x2efa('0x20')]();};}function saveUpdates(_0x203f96,_0x3e3abf){return function(_0x55ca90){if(_0x55ca90){return _0x55ca90[_0x2efa('0x21')](_0x203f96)[_0x2efa('0x22')](function(_0x143e01){return _0x143e01;});}return null;};}function removeEntity(_0x273eff,_0x4f83e1){return function(_0x3818ce){if(_0x3818ce){return _0x3818ce[_0x2efa('0x23')]()[_0x2efa('0x22')](function(){_0x273eff['status'](0xcc)[_0x2efa('0x24')]();});}};}function handleEntityNotFound(_0x20e215,_0x9e330c){return function(_0x2a85c7){if(!_0x2a85c7){_0x20e215[_0x2efa('0x17')](0x194);}return _0x2a85c7;};}function handleError(_0x59ea0e,_0x1d4681){_0x1d4681=_0x1d4681||0x1f4;return function(_0x25ed2c){logger[_0x2efa('0x25')](_0x25ed2c[_0x2efa('0x26')]);if(_0x25ed2c[_0x2efa('0x27')]){delete _0x25ed2c[_0x2efa('0x27')];}_0x59ea0e[_0x2efa('0x18')](_0x1d4681)['send'](_0x25ed2c);};}exports[_0x2efa('0x28')]=function(_0x2cac9d,_0x1a659b){var _0x19028a={},_0x413ed5={},_0x403341={'count':0x0,'rows':[]};var _0x1dadc8=_[_0x2efa('0x29')](db[_0x2efa('0x2a')][_0x2efa('0x2b')],function(_0x5c7e3c){return{'name':_0x5c7e3c[_0x2efa('0x2c')],'type':_0x5c7e3c[_0x2efa('0x2d')]['key']};});_0x413ed5[_0x2efa('0x2e')]=_[_0x2efa('0x29')](_0x1dadc8,_0x2efa('0x27'));_0x413ed5['query']=_[_0x2efa('0x2f')](_0x2cac9d[_0x2efa('0x30')]);_0x413ed5['filters']=_[_0x2efa('0x31')](_0x413ed5[_0x2efa('0x2e')],_0x413ed5[_0x2efa('0x30')]);_0x19028a[_0x2efa('0x32')]=_['intersection'](_0x413ed5[_0x2efa('0x2e')],qs['fields'](_0x2cac9d[_0x2efa('0x30')][_0x2efa('0x33')]));_0x19028a[_0x2efa('0x32')]=_0x19028a[_0x2efa('0x32')][_0x2efa('0x34')]?_0x19028a[_0x2efa('0x32')]:_0x413ed5[_0x2efa('0x2e')];if(!_0x2cac9d[_0x2efa('0x30')][_0x2efa('0x35')](_0x2efa('0x36'))){_0x19028a[_0x2efa('0x1b')]=qs[_0x2efa('0x1b')](_0x2cac9d[_0x2efa('0x30')][_0x2efa('0x1b')]);_0x19028a[_0x2efa('0x1d')]=qs['offset'](_0x2cac9d[_0x2efa('0x30')][_0x2efa('0x1d')]);}_0x19028a[_0x2efa('0x37')]=qs['sort'](_0x2cac9d['query'][_0x2efa('0x38')]);_0x19028a[_0x2efa('0x39')]=qs[_0x2efa('0x3a')](_[_0x2efa('0x3b')](_0x2cac9d[_0x2efa('0x30')],_0x413ed5[_0x2efa('0x3a')]),_0x1dadc8);if(_0x2cac9d[_0x2efa('0x30')][_0x2efa('0x3c')]){_0x19028a[_0x2efa('0x39')]=_['merge'](_0x19028a[_0x2efa('0x39')],{'$or':_['map'](_0x1dadc8,function(_0x1b9a66){if(_0x1b9a66[_0x2efa('0x2d')]!=='VIRTUAL'){var _0x522bb1={};_0x522bb1[_0x1b9a66['name']]={'$like':'%'+_0x2cac9d['query']['filter']+'%'};return _0x522bb1;}})});}_0x19028a=_[_0x2efa('0x3d')]({},_0x19028a,_0x2cac9d[_0x2efa('0x3e')]);var _0x104048={'where':_0x19028a['where']};return db[_0x2efa('0x2a')]['count'](_0x104048)[_0x2efa('0x22')](function(_0x258751){_0x403341[_0x2efa('0x1c')]=_0x258751;if(_0x2cac9d['query']['includeAll']){_0x19028a[_0x2efa('0x3f')]=[{'all':!![]}];}return db[_0x2efa('0x2a')][_0x2efa('0x40')](_0x19028a);})[_0x2efa('0x22')](function(_0x3c8a71){_0x403341[_0x2efa('0x41')]=_0x3c8a71;return _0x403341;})[_0x2efa('0x22')](respondWithFilteredResult(_0x1a659b,_0x19028a))['catch'](handleError(_0x1a659b,null));};exports['show']=function(_0x6a6635,_0x20f0e8){var _0x2b4269={'raw':!![],'where':{'id':_0x6a6635['params']['id']}},_0x36d6aa={};_0x36d6aa[_0x2efa('0x2e')]=_[_0x2efa('0x2f')](db['SquareRecording']['rawAttributes']);_0x36d6aa['query']=_[_0x2efa('0x2f')](_0x6a6635[_0x2efa('0x30')]);_0x36d6aa[_0x2efa('0x3a')]=_[_0x2efa('0x31')](_0x36d6aa['model'],_0x36d6aa['query']);_0x2b4269[_0x2efa('0x32')]=_[_0x2efa('0x31')](_0x36d6aa[_0x2efa('0x2e')],qs[_0x2efa('0x33')](_0x6a6635['query'][_0x2efa('0x33')]));_0x2b4269['attributes']=_0x2b4269['attributes'][_0x2efa('0x34')]?_0x2b4269['attributes']:_0x36d6aa[_0x2efa('0x2e')];if(_0x6a6635['query']['includeAll']){_0x2b4269[_0x2efa('0x3f')]=[{'all':!![]}];}_0x2b4269=_[_0x2efa('0x3d')]({},_0x2b4269,_0x6a6635['options']);return db[_0x2efa('0x2a')][_0x2efa('0x42')](_0x2b4269)[_0x2efa('0x22')](handleEntityNotFound(_0x20f0e8,null))[_0x2efa('0x22')](respondWithResult(_0x20f0e8,null))[_0x2efa('0x43')](handleError(_0x20f0e8,null));};exports[_0x2efa('0x44')]=function(_0x261e5a,_0x5cb513){return db['SquareRecording'][_0x2efa('0x44')](_0x261e5a[_0x2efa('0x45')],{})['then'](respondWithResult(_0x5cb513,0xc9))[_0x2efa('0x43')](handleError(_0x5cb513,null));};exports[_0x2efa('0x21')]=function(_0x4b91f3,_0x42caf5){if(_0x4b91f3[_0x2efa('0x45')]['id']){delete _0x4b91f3[_0x2efa('0x45')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x4b91f3[_0x2efa('0x46')]['id']}})[_0x2efa('0x22')](handleEntityNotFound(_0x42caf5,null))[_0x2efa('0x22')](saveUpdates(_0x4b91f3['body'],null))['then'](respondWithResult(_0x42caf5,null))[_0x2efa('0x43')](handleError(_0x42caf5,null));};exports[_0x2efa('0x47')]=function(_0x5d8eb2,_0x52b6c1,_0x19a6d7){var _0x1e5f4a=require(_0x2efa('0x48'));var _0x611557=![];var _0x466bbd={};if(_0x5d8eb2[_0x2efa('0x30')][_0x2efa('0x2d')]&&_0x5d8eb2[_0x2efa('0x30')]['type']===_0x2efa('0x49')){_0x466bbd[_0x2efa('0x49')]=_0x5d8eb2[_0x2efa('0x46')]['id'];}else{_0x466bbd['id']=_0x5d8eb2[_0x2efa('0x46')]['id'];}return db[_0x2efa('0x2a')][_0x2efa('0x42')]({'where':_0x466bbd,'attributes':['id',_0x2efa('0x4a'),_0x2efa('0x4b')],'raw':!![]})[_0x2efa('0x22')](handleEntityNotFound(_0x52b6c1,null))[_0x2efa('0x22')](function(_0x1dadc0){if(_0x1dadc0){var _0x344c59=_0x1dadc0[_0x2efa('0x4a')];var _0x1e305f=util[_0x2efa('0x4c')](_0x2efa('0x4d'),_0x344c59);if(fs[_0x2efa('0x4e')](_0x1e305f)){_0x611557=!![];return _0x1e5f4a[_0x2efa('0x4f')](_0x1e305f,_0x344c59,config['secrets'][_0x2efa('0x50')])[_0x2efa('0x22')](function(){return _0x1dadc0;});}return _0x1dadc0;}})['then'](function(_0x26f467){if(_0x26f467){var _0x3577a0=_0x26f467[_0x2efa('0x4a')];if(!fs[_0x2efa('0x4e')](_0x3577a0)){throw new db[(_0x2efa('0x51'))][(_0x2efa('0x52'))](_0x2efa('0x53'));}if(_0x26f467[_0x2efa('0x4b')]){return _0x52b6c1[_0x2efa('0x47')](_0x3577a0,_0x26f467[_0x2efa('0x4b')]+path[_0x2efa('0x54')](_0x3577a0),function(){if(_0x611557){fs[_0x2efa('0x55')](_0x3577a0);}});}else{return _0x52b6c1[_0x2efa('0x47')](_0x3577a0,function(_0x32618e){if(_0x611557){fs[_0x2efa('0x55')](_0x3577a0);}});}}})[_0x2efa('0x43')](function(_0x1b3c59){if(_0x1b3c59[_0x2efa('0x56')]===_0x2efa('0x53')){_0x52b6c1[_0x2efa('0x18')](0x194)[_0x2efa('0x57')](_0x2efa('0x58'));}else{return handleError(_0x52b6c1,null);}});};exports['destroy']=function(_0x21e32e,_0x4c43cc){return db[_0x2efa('0x2a')][_0x2efa('0x42')]({'where':{'id':_0x21e32e[_0x2efa('0x46')]['id']}})[_0x2efa('0x22')](function(_0x3e555a){if(_[_0x2efa('0x59')](_0x3e555a)){throw new ReferenceError(_0x2efa('0x5a'));}return _0x3e555a;})[_0x2efa('0x22')](function(_0x83de74){var _0x285e8b=_0x83de74[_0x2efa('0x4a')];logger[_0x2efa('0x5b')](_0x2efa('0x5c'),_0x285e8b);if(!_[_0x2efa('0x59')](_0x83de74[_0x2efa('0x4a')])&&fs[_0x2efa('0x4e')](_0x285e8b)){logger['info'](_0x2efa('0x5d')+_0x285e8b+_0x2efa('0x5e'));fs[_0x2efa('0x5f')](_0x285e8b);}_0x285e8b=_0x285e8b+_0x2efa('0x60');if(!_[_0x2efa('0x59')](_0x83de74[_0x2efa('0x4a')])&&fs[_0x2efa('0x4e')](_0x285e8b)){logger[_0x2efa('0x5b')](_0x2efa('0x5d')+_0x285e8b+_0x2efa('0x5e'));fs['unlinkSync'](_0x285e8b);}return _0x83de74;})['then'](function(_0x421348){if(!_0x421348)throw new InternalError();return _0x421348[_0x2efa('0x23')]();})['then'](function(){_0x4c43cc['status'](0xcc)[_0x2efa('0x24')]();})[_0x2efa('0x43')](handleError(_0x4c43cc,null));}; \ No newline at end of file +var _0xf492=['send','index','map','SquareRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','rows','catch','show','rawAttributes','include','create','body','find','../../components/encryptor','uniqueid','params','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','isNil','savePath','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','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','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','name'];(function(_0x6e8248,_0x44d2c1){var _0x88d71e=function(_0x34d0a7){while(--_0x34d0a7){_0x6e8248['push'](_0x6e8248['shift']());}};_0x88d71e(++_0x44d2c1);}(_0xf492,0x14a));var _0x2f49=function(_0x26bee7,_0x3da1af){_0x26bee7=_0x26bee7-0x0;var _0x162702=_0xf492[_0x26bee7];return _0x162702;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f49('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2f49('0x1'));var moment=require(_0x2f49('0x2'));var BPromise=require(_0x2f49('0x3'));var Mustache=require(_0x2f49('0x4'));var util=require(_0x2f49('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2f49('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f49('0x7'));var _=require('lodash');var squel=require(_0x2f49('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2f49('0x9'));var toCsv=require(_0x2f49('0x6'));var querystring=require(_0x2f49('0xa'));var Papa=require(_0x2f49('0xb'));var Redis=require(_0x2f49('0xc'));var authService=require(_0x2f49('0xd'));var qs=require(_0x2f49('0xe'));var as=require(_0x2f49('0xf'));var hardwareService=require(_0x2f49('0x10'));var logger=require(_0x2f49('0x11'))(_0x2f49('0x12'));var utils=require(_0x2f49('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2f49('0x14'));var db=require(_0x2f49('0x15'))['db'];function respondWithStatusCode(_0x3d6d98,_0x176203){_0x176203=_0x176203||0xcc;return function(_0xf37bb0){if(_0xf37bb0){return _0x3d6d98[_0x2f49('0x16')](_0x176203);}return _0x3d6d98['status'](_0x176203)[_0x2f49('0x17')]();};}function respondWithResult(_0x49bdec,_0x5882b6){_0x5882b6=_0x5882b6||0xc8;return function(_0x27e0a4){if(_0x27e0a4){return _0x49bdec[_0x2f49('0x18')](_0x5882b6)[_0x2f49('0x19')](_0x27e0a4);}};}function respondWithFilteredResult(_0x43f554,_0x465ade){return function(_0x95b84f){if(_0x95b84f){var _0x177102=typeof _0x465ade['offset']===_0x2f49('0x1a')&&typeof _0x465ade[_0x2f49('0x1b')]==='undefined';var _0x26d8e0=_0x95b84f[_0x2f49('0x1c')];var _0x148b18=_0x177102?0x0:_0x465ade[_0x2f49('0x1d')];var _0x2f3256=_0x177102?_0x95b84f[_0x2f49('0x1c')]:_0x465ade[_0x2f49('0x1d')]+_0x465ade[_0x2f49('0x1b')];var _0x488b54;if(_0x2f3256>=_0x26d8e0){_0x2f3256=_0x26d8e0;_0x488b54=0xc8;}else{_0x488b54=0xce;}_0x43f554['status'](_0x488b54);return _0x43f554[_0x2f49('0x1e')](_0x2f49('0x1f'),_0x148b18+'-'+_0x2f3256+'/'+_0x26d8e0)[_0x2f49('0x19')](_0x95b84f);}return null;};}function patchUpdates(_0x28fb00){return function(_0x4731f0){try{jsonpatch[_0x2f49('0x20')](_0x4731f0,_0x28fb00,!![]);}catch(_0x56372e){return BPromise['reject'](_0x56372e);}return _0x4731f0['save']();};}function saveUpdates(_0x7b735d,_0x572638){return function(_0x9db557){if(_0x9db557){return _0x9db557[_0x2f49('0x21')](_0x7b735d)[_0x2f49('0x22')](function(_0x5e8138){return _0x5e8138;});}return null;};}function removeEntity(_0x1740d2,_0x2dc126){return function(_0x5bc4dc){if(_0x5bc4dc){return _0x5bc4dc[_0x2f49('0x23')]()[_0x2f49('0x22')](function(){_0x1740d2[_0x2f49('0x18')](0xcc)[_0x2f49('0x17')]();});}};}function handleEntityNotFound(_0x30e746,_0x542201){return function(_0x3c8f19){if(!_0x3c8f19){_0x30e746[_0x2f49('0x16')](0x194);}return _0x3c8f19;};}function handleError(_0x551df1,_0x21ef41){_0x21ef41=_0x21ef41||0x1f4;return function(_0x1a727e){logger[_0x2f49('0x24')](_0x1a727e['stack']);if(_0x1a727e[_0x2f49('0x25')]){delete _0x1a727e[_0x2f49('0x25')];}_0x551df1[_0x2f49('0x18')](_0x21ef41)[_0x2f49('0x26')](_0x1a727e);};}exports[_0x2f49('0x27')]=function(_0x401401,_0x284b1c){var _0x43438f={},_0x544670={},_0x49464a={'count':0x0,'rows':[]};var _0x227f64=_[_0x2f49('0x28')](db[_0x2f49('0x29')]['rawAttributes'],function(_0x182c8e){return{'name':_0x182c8e[_0x2f49('0x2a')],'type':_0x182c8e['type'][_0x2f49('0x2b')]};});_0x544670[_0x2f49('0x2c')]=_[_0x2f49('0x28')](_0x227f64,_0x2f49('0x25'));_0x544670[_0x2f49('0x2d')]=_[_0x2f49('0x2e')](_0x401401[_0x2f49('0x2d')]);_0x544670[_0x2f49('0x2f')]=_[_0x2f49('0x30')](_0x544670[_0x2f49('0x2c')],_0x544670[_0x2f49('0x2d')]);_0x43438f[_0x2f49('0x31')]=_['intersection'](_0x544670[_0x2f49('0x2c')],qs['fields'](_0x401401[_0x2f49('0x2d')][_0x2f49('0x32')]));_0x43438f[_0x2f49('0x31')]=_0x43438f[_0x2f49('0x31')][_0x2f49('0x33')]?_0x43438f['attributes']:_0x544670[_0x2f49('0x2c')];if(!_0x401401[_0x2f49('0x2d')]['hasOwnProperty'](_0x2f49('0x34'))){_0x43438f[_0x2f49('0x1b')]=qs[_0x2f49('0x1b')](_0x401401[_0x2f49('0x2d')][_0x2f49('0x1b')]);_0x43438f['offset']=qs[_0x2f49('0x1d')](_0x401401[_0x2f49('0x2d')][_0x2f49('0x1d')]);}_0x43438f[_0x2f49('0x35')]=qs[_0x2f49('0x36')](_0x401401[_0x2f49('0x2d')][_0x2f49('0x36')]);_0x43438f[_0x2f49('0x37')]=qs[_0x2f49('0x2f')](_[_0x2f49('0x38')](_0x401401['query'],_0x544670[_0x2f49('0x2f')]),_0x227f64);if(_0x401401[_0x2f49('0x2d')][_0x2f49('0x39')]){_0x43438f[_0x2f49('0x37')]=_[_0x2f49('0x3a')](_0x43438f[_0x2f49('0x37')],{'$or':_[_0x2f49('0x28')](_0x227f64,function(_0x1cf085){if(_0x1cf085[_0x2f49('0x3b')]!==_0x2f49('0x3c')){var _0x3be2e6={};_0x3be2e6[_0x1cf085['name']]={'$like':'%'+_0x401401[_0x2f49('0x2d')]['filter']+'%'};return _0x3be2e6;}})});}_0x43438f=_[_0x2f49('0x3a')]({},_0x43438f,_0x401401[_0x2f49('0x3d')]);var _0xcb89ab={'where':_0x43438f['where']};return db[_0x2f49('0x29')][_0x2f49('0x1c')](_0xcb89ab)['then'](function(_0x1f4e9e){_0x49464a[_0x2f49('0x1c')]=_0x1f4e9e;if(_0x401401['query']['includeAll']){_0x43438f['include']=[{'all':!![]}];}return db[_0x2f49('0x29')]['findAll'](_0x43438f);})[_0x2f49('0x22')](function(_0x3ed240){_0x49464a[_0x2f49('0x3e')]=_0x3ed240;return _0x49464a;})[_0x2f49('0x22')](respondWithFilteredResult(_0x284b1c,_0x43438f))[_0x2f49('0x3f')](handleError(_0x284b1c,null));};exports[_0x2f49('0x40')]=function(_0x26f741,_0xabbbdf){var _0x17e1d3={'raw':!![],'where':{'id':_0x26f741['params']['id']}},_0x571ef4={};_0x571ef4[_0x2f49('0x2c')]=_[_0x2f49('0x2e')](db[_0x2f49('0x29')][_0x2f49('0x41')]);_0x571ef4['query']=_['keys'](_0x26f741['query']);_0x571ef4[_0x2f49('0x2f')]=_['intersection'](_0x571ef4[_0x2f49('0x2c')],_0x571ef4[_0x2f49('0x2d')]);_0x17e1d3[_0x2f49('0x31')]=_['intersection'](_0x571ef4[_0x2f49('0x2c')],qs['fields'](_0x26f741[_0x2f49('0x2d')][_0x2f49('0x32')]));_0x17e1d3[_0x2f49('0x31')]=_0x17e1d3[_0x2f49('0x31')][_0x2f49('0x33')]?_0x17e1d3[_0x2f49('0x31')]:_0x571ef4['model'];if(_0x26f741[_0x2f49('0x2d')]['includeAll']){_0x17e1d3[_0x2f49('0x42')]=[{'all':!![]}];}_0x17e1d3=_[_0x2f49('0x3a')]({},_0x17e1d3,_0x26f741['options']);return db[_0x2f49('0x29')]['find'](_0x17e1d3)['then'](handleEntityNotFound(_0xabbbdf,null))['then'](respondWithResult(_0xabbbdf,null))[_0x2f49('0x3f')](handleError(_0xabbbdf,null));};exports[_0x2f49('0x43')]=function(_0x43c7d9,_0x53ddeb){return db[_0x2f49('0x29')]['create'](_0x43c7d9['body'],{})['then'](respondWithResult(_0x53ddeb,0xc9))[_0x2f49('0x3f')](handleError(_0x53ddeb,null));};exports[_0x2f49('0x21')]=function(_0xfcf4a,_0xd0c007){if(_0xfcf4a[_0x2f49('0x44')]['id']){delete _0xfcf4a[_0x2f49('0x44')]['id'];}return db['SquareRecording'][_0x2f49('0x45')]({'where':{'id':_0xfcf4a['params']['id']}})[_0x2f49('0x22')](handleEntityNotFound(_0xd0c007,null))[_0x2f49('0x22')](saveUpdates(_0xfcf4a['body'],null))[_0x2f49('0x22')](respondWithResult(_0xd0c007,null))['catch'](handleError(_0xd0c007,null));};exports['download']=function(_0x5ebeb6,_0x2d49dd,_0x4f7a20){var _0x5dbf25=require(_0x2f49('0x46'));var _0xe0557=![];var _0x20ced4={};if(_0x5ebeb6[_0x2f49('0x2d')][_0x2f49('0x3b')]&&_0x5ebeb6['query'][_0x2f49('0x3b')]==='uniqueid'){_0x20ced4[_0x2f49('0x47')]=_0x5ebeb6['params']['id'];}else{_0x20ced4['id']=_0x5ebeb6[_0x2f49('0x48')]['id'];}return db[_0x2f49('0x29')][_0x2f49('0x45')]({'where':_0x20ced4,'attributes':['id','savePath','filename'],'raw':!![]})[_0x2f49('0x22')](handleEntityNotFound(_0x2d49dd,null))['then'](function(_0x4ce5a9){if(_0x4ce5a9){var _0x447ef3=_0x4ce5a9['savePath'];var _0x12b5b2=util['format'](_0x2f49('0x49'),_0x447ef3);if(fs[_0x2f49('0x4a')](_0x12b5b2)){_0xe0557=!![];return _0x5dbf25[_0x2f49('0x4b')](_0x12b5b2,_0x447ef3,config[_0x2f49('0x4c')][_0x2f49('0x4d')])[_0x2f49('0x22')](function(){return _0x4ce5a9;});}return _0x4ce5a9;}})[_0x2f49('0x22')](function(_0x36803b){if(_0x36803b){var _0x16dc13=_0x36803b['savePath'];if(!fs['existsSync'](_0x16dc13)){throw new db[(_0x2f49('0x4e'))][(_0x2f49('0x4f'))](_0x2f49('0x50'));}if(_0x36803b[_0x2f49('0x51')]){return _0x2d49dd['download'](_0x16dc13,_0x36803b[_0x2f49('0x51')]+path[_0x2f49('0x52')](_0x16dc13),function(){if(_0xe0557){fs[_0x2f49('0x53')](_0x16dc13);}});}else{return _0x2d49dd[_0x2f49('0x54')](_0x16dc13,function(_0x27a213){if(_0xe0557){fs[_0x2f49('0x53')](_0x16dc13);}});}}})[_0x2f49('0x3f')](function(_0xb7c7e6){if(_0xb7c7e6[_0x2f49('0x55')]===_0x2f49('0x50')){_0x2d49dd['status'](0x194)[_0x2f49('0x26')](_0x2f49('0x56'));}else{return handleError(_0x2d49dd,null);}});};exports[_0x2f49('0x23')]=function(_0x260bd2,_0x43fcee){return db['SquareRecording'][_0x2f49('0x45')]({'where':{'id':_0x260bd2[_0x2f49('0x48')]['id']}})[_0x2f49('0x22')](function(_0x1d0e19){if(_[_0x2f49('0x57')](_0x1d0e19)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1d0e19;})[_0x2f49('0x22')](function(_0x3fa88e){var _0x39e4e3=_0x3fa88e[_0x2f49('0x58')];logger['info'](_0x2f49('0x59'),_0x39e4e3);if(!_[_0x2f49('0x57')](_0x3fa88e[_0x2f49('0x58')])&&fs[_0x2f49('0x4a')](_0x39e4e3)){logger[_0x2f49('0x5a')](_0x2f49('0x5b')+_0x39e4e3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x39e4e3);}_0x39e4e3=_0x39e4e3+'.cypher';if(!_['isNil'](_0x3fa88e[_0x2f49('0x58')])&&fs[_0x2f49('0x4a')](_0x39e4e3)){logger[_0x2f49('0x5a')]('File:\x20\x22'+_0x39e4e3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x39e4e3);}return _0x3fa88e;})['then'](function(_0x3b12a8){if(!_0x3b12a8)throw new InternalError();return _0x3b12a8[_0x2f49('0x23')]();})[_0x2f49('0x22')](function(){_0x43fcee[_0x2f49('0x18')](0xcc)[_0x2f49('0x17')]();})['catch'](handleError(_0x43fcee,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 19696c5..df2848e 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 _0x8f25=['bluebird','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x220c23,_0x18dc5f){var _0x4e4ffc=function(_0x270300){while(--_0x270300){_0x220c23['push'](_0x220c23['shift']());}};_0x4e4ffc(++_0x18dc5f);}(_0x8f25,0x14b));var _0x58f2=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8f25[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x58f2('0x0'));var util=require(_0x58f2('0x1'));var logger=require(_0x58f2('0x2'))(_0x58f2('0x3'));var moment=require(_0x58f2('0x4'));var BPromise=require(_0x58f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x58f2('0x6'));var attributes=require(_0x58f2('0x7'));module[_0x58f2('0x8')]=function(_0x486395,_0x415a68){return _0x486395[_0x58f2('0x9')](_0x58f2('0xa'),attributes,{'tableName':_0x58f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07fa=['../../config/logger','api','moment','bluebird','path','rimraf','SquareRecording','util'];(function(_0x4860c0,_0x3b2564){var _0x2f1938=function(_0x20da29){while(--_0x20da29){_0x4860c0['push'](_0x4860c0['shift']());}};_0x2f1938(++_0x3b2564);}(_0x07fa,0x177));var _0xa07f=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x07fa[_0x1589dd];return _0x1bddd1;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var logger=require(_0xa07f('0x1'))(_0xa07f('0x2'));var moment=require(_0xa07f('0x3'));var BPromise=require(_0xa07f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa07f('0x5'));var rimraf=require(_0xa07f('0x6'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x3fb738,_0x362c91){return _0x3fb738['define'](_0xa07f('0x7'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 3c89531..a7f9202 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 _0xcade=['info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateSquareRecording','create','body','options','raw','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x37edcf,_0x298717){var _0x8ab26=function(_0x6eeca6){while(--_0x6eeca6){_0x37edcf['push'](_0x37edcf['shift']());}};_0x8ab26(++_0x298717);}(_0xcade,0xab));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xecad('0x0'));var moment=require('moment');var BPromise=require(_0xecad('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecad('0x2'))['db'];var utils=require(_0xecad('0x3'));var logger=require('../../config/logger')(_0xecad('0x4'));var config=require(_0xecad('0x5'));var jayson=require(_0xecad('0x6'));var client=jayson[_0xecad('0x7')][_0xecad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ea175,_0x2a9c6d,_0x11c219){return new BPromise(function(_0x30a5c7,_0x24570e){return client[_0xecad('0x9')](_0x4ea175,_0x11c219)[_0xecad('0xa')](function(_0x1018c1){logger[_0xecad('0xb')](_0xecad('0xc'),_0x2a9c6d,_0xecad('0xd'));logger[_0xecad('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x2a9c6d,_0xecad('0xd'),JSON[_0xecad('0xf')](_0x1018c1));if(_0x1018c1[_0xecad('0x10')]){if(_0x1018c1['error'][_0xecad('0x11')]===0x1f4){logger[_0xecad('0x10')]('SquareRecording,\x20%s,\x20%s',_0x2a9c6d,_0x1018c1[_0xecad('0x10')][_0xecad('0x12')]);return _0x24570e(_0x1018c1[_0xecad('0x10')][_0xecad('0x12')]);}logger[_0xecad('0x10')](_0xecad('0xc'),_0x2a9c6d,_0x1018c1['error'][_0xecad('0x12')]);return _0x30a5c7(_0x1018c1[_0xecad('0x10')]['message']);}else{logger[_0xecad('0xb')]('SquareRecording,\x20%s,\x20%s',_0x2a9c6d,'request\x20sent');_0x30a5c7(_0x1018c1[_0xecad('0x13')][_0xecad('0x12')]);}})['catch'](function(_0x4d3b73){logger[_0xecad('0x10')](_0xecad('0xc'),_0x2a9c6d,_0x4d3b73);_0x24570e(_0x4d3b73);});});}exports[_0xecad('0x14')]=function(_0x5cab86){var _0x3ae5b3=this;return new Promise(function(_0x2794e0,_0x2443fb){return db['SquareRecording'][_0xecad('0x15')](_0x5cab86[_0xecad('0x16')],{'raw':_0x5cab86[_0xecad('0x17')]?_0x5cab86[_0xecad('0x17')][_0xecad('0x18')]===undefined?!![]:![]:!![]})[_0xecad('0xa')](function(_0x499f30){logger[_0xecad('0xb')](_0xecad('0x14'),_0x5cab86);logger[_0xecad('0xe')]('CreateSquareRecording',_0x5cab86,JSON[_0xecad('0xf')](_0x499f30));_0x2794e0(_0x499f30);})[_0xecad('0x19')](function(_0x70b890){logger[_0xecad('0x10')](_0xecad('0x14'),_0x70b890['message'],_0x5cab86);_0x2443fb(_0x3ae5b3[_0xecad('0x10')](0x1f4,_0x70b890[_0xecad('0x12')]));});});}; \ No newline at end of file +var _0x2582=['CreateSquareRecording','SquareRecording','body','options','raw','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','info','debug','request\x20sent','error','code','message','SquareRecording,\x20%s,\x20%s'];(function(_0x3557e7,_0x556071){var _0x20287b=function(_0x2167f9){while(--_0x2167f9){_0x3557e7['push'](_0x3557e7['shift']());}};_0x20287b(++_0x556071);}(_0x2582,0x11a));var _0x2258=function(_0x47f84a,_0x33b10f){_0x47f84a=_0x47f84a-0x0;var _0x328233=_0x2582[_0x47f84a];return _0x328233;};'use strict';var _=require(_0x2258('0x0'));var util=require(_0x2258('0x1'));var moment=require(_0x2258('0x2'));var BPromise=require(_0x2258('0x3'));var rs=require(_0x2258('0x4'));var fs=require('fs');var Redis=require(_0x2258('0x5'));var db=require(_0x2258('0x6'))['db'];var utils=require(_0x2258('0x7'));var logger=require('../../config/logger')(_0x2258('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2258('0x9')][_0x2258('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x293e4a,_0xc313d7,_0x4def66){return new BPromise(function(_0x5b94fc,_0x2461e3){return client['request'](_0x293e4a,_0x4def66)['then'](function(_0x3c94e4){logger[_0x2258('0xb')]('SquareRecording,\x20%s,\x20%s',_0xc313d7,'request\x20sent');logger[_0x2258('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0xc313d7,_0x2258('0xd'),JSON['stringify'](_0x3c94e4));if(_0x3c94e4[_0x2258('0xe')]){if(_0x3c94e4['error'][_0x2258('0xf')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0xc313d7,_0x3c94e4[_0x2258('0xe')][_0x2258('0x10')]);return _0x2461e3(_0x3c94e4['error'][_0x2258('0x10')]);}logger['error'](_0x2258('0x11'),_0xc313d7,_0x3c94e4[_0x2258('0xe')][_0x2258('0x10')]);return _0x5b94fc(_0x3c94e4[_0x2258('0xe')][_0x2258('0x10')]);}else{logger[_0x2258('0xb')](_0x2258('0x11'),_0xc313d7,_0x2258('0xd'));_0x5b94fc(_0x3c94e4['result'][_0x2258('0x10')]);}})['catch'](function(_0x5a2688){logger[_0x2258('0xe')](_0x2258('0x11'),_0xc313d7,_0x5a2688);_0x2461e3(_0x5a2688);});});}exports[_0x2258('0x12')]=function(_0x451706){var _0x4ecc76=this;return new Promise(function(_0x16b262,_0xbb4ca5){return db[_0x2258('0x13')]['create'](_0x451706[_0x2258('0x14')],{'raw':_0x451706[_0x2258('0x15')]?_0x451706[_0x2258('0x15')][_0x2258('0x16')]===undefined?!![]:![]:!![]})[_0x2258('0x17')](function(_0x4005e4){logger['info'](_0x2258('0x12'),_0x451706);logger[_0x2258('0xc')](_0x2258('0x12'),_0x451706,JSON[_0x2258('0x18')](_0x4005e4));_0x16b262(_0x4005e4);})['catch'](function(_0x39813d){logger[_0x2258('0xe')](_0x2258('0x12'),_0x39813d[_0x2258('0x10')],_0x451706);_0xbb4ca5(_0x4ecc76[_0x2258('0xe')](0x1f4,_0x39813d['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 6b16f77..1fdde1e 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x1b26eb,_0x257320){var _0x2ea833=function(_0x909bfd){while(--_0x909bfd){_0x1b26eb['push'](_0x1b26eb['shift']());}};_0x2ea833(++_0x257320);}(_0xe706,0xa3));var _0x6e70=function(_0x313e62,_0x51d3a1){_0x313e62=_0x313e62-0x0;var _0x568cdc=_0xe706[_0x313e62];return _0x568cdc;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x508a24,_0x7e0da7){var _0x1957f3=function(_0x6fec50){while(--_0x6fec50){_0x508a24['push'](_0x508a24['shift']());}};_0x1957f3(++_0x7e0da7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 52a562e..d5a6b1f 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 _0xa3cc=['STRING','DATE','exports'];(function(_0x4e29fd,_0xb8dd08){var _0x1f954c=function(_0x2c333b){while(--_0x2c333b){_0x4e29fd['push'](_0x4e29fd['shift']());}};_0x1f954c(++_0xb8dd08);}(_0xa3cc,0x1c7));var _0xca3c=function(_0x26af06,_0x586bc8){_0x26af06=_0x26af06-0x0;var _0x177db7=_0xa3cc[_0x26af06];return _0x177db7;};'use strict';var Sequelize=require('sequelize');module[_0xca3c('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xca3c('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xca3c('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xca3c('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xca3c('0x1')]},'calleridname':{'type':Sequelize[_0xca3c('0x1')]},'callingpres':{'type':Sequelize[_0xca3c('0x1')]},'callingani2':{'type':Sequelize[_0xca3c('0x1')]},'callington':{'type':Sequelize[_0xca3c('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xca3c('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xca3c('0x1')]},'extension':{'type':Sequelize[_0xca3c('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xca3c('0x1')]},'accountcode':{'type':Sequelize[_0xca3c('0x1')]},'threadid':{'type':Sequelize[_0xca3c('0x1')]},'project_name':{'type':Sequelize[_0xca3c('0x1')]},'joinAt':{'type':Sequelize[_0xca3c('0x2')]},'leaveAt':{'type':Sequelize[_0xca3c('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xcf10=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0xcf10,0x72));var _0x0cf1=function(_0x48df04,_0x1522b1){_0x48df04=_0x48df04-0x0;var _0x4de5fa=_0xcf10[_0x48df04];return _0x4de5fa;};'use strict';var Sequelize=require(_0x0cf1('0x0'));module[_0x0cf1('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x0cf1('0x2')]},'request':{'type':Sequelize[_0x0cf1('0x2')]},'channel':{'type':Sequelize[_0x0cf1('0x2')]},'language':{'type':Sequelize[_0x0cf1('0x2')]},'type':{'type':Sequelize[_0x0cf1('0x2')]},'uniqueid':{'type':Sequelize[_0x0cf1('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0cf1('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x0cf1('0x2')]},'callingtns':{'type':Sequelize[_0x0cf1('0x2')]},'dnid':{'type':Sequelize[_0x0cf1('0x2')]},'rdnis':{'type':Sequelize[_0x0cf1('0x2')]},'context':{'type':Sequelize[_0x0cf1('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0cf1('0x2')]},'enhanced':{'type':Sequelize[_0x0cf1('0x2')]},'accountcode':{'type':Sequelize[_0x0cf1('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x0cf1('0x2')]},'joinAt':{'type':Sequelize[_0x0cf1('0x3')]},'leaveAt':{'type':Sequelize[_0x0cf1('0x3')]},'bot':{'type':Sequelize[_0x0cf1('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 772aa75..6bc8846 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 _0x2998=['query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','map','type','filter','merge','options','SquareReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','index','fieldName','key','model'];(function(_0x342018,_0xa99df8){var _0x199267=function(_0x2b523c){while(--_0x2b523c){_0x342018['push'](_0x342018['shift']());}};_0x199267(++_0xa99df8);}(_0x2998,0x146));var _0x8299=function(_0x6f3f81,_0x49a278){_0x6f3f81=_0x6f3f81-0x0;var _0x2b8b59=_0x2998[_0x6f3f81];return _0x2b8b59;};'use strict';var emlformat=require(_0x8299('0x0'));var rimraf=require(_0x8299('0x1'));var zipdir=require(_0x8299('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8299('0x3'));var moment=require(_0x8299('0x4'));var BPromise=require(_0x8299('0x5'));var Mustache=require('mustache');var util=require(_0x8299('0x6'));var path=require(_0x8299('0x7'));var sox=require('sox');var csv=require(_0x8299('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8299('0x9'));var squel=require(_0x8299('0xa'));var crypto=require(_0x8299('0xb'));var jsforce=require(_0x8299('0xc'));var deskjs=require(_0x8299('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8299('0xe'));var Papa=require('papaparse');var Redis=require(_0x8299('0xf'));var authService=require(_0x8299('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8299('0x11'));var hardwareService=require(_0x8299('0x12'));var logger=require(_0x8299('0x13'))('api');var utils=require(_0x8299('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8299('0x15'));var db=require(_0x8299('0x16'))['db'];function respondWithStatusCode(_0x27768c,_0x286d1c){_0x286d1c=_0x286d1c||0xcc;return function(_0xad0941){if(_0xad0941){return _0x27768c[_0x8299('0x17')](_0x286d1c);}return _0x27768c[_0x8299('0x18')](_0x286d1c)[_0x8299('0x19')]();};}function respondWithResult(_0x39adfd,_0x4f9247){_0x4f9247=_0x4f9247||0xc8;return function(_0x5a9ddd){if(_0x5a9ddd){return _0x39adfd[_0x8299('0x18')](_0x4f9247)[_0x8299('0x1a')](_0x5a9ddd);}};}function respondWithFilteredResult(_0x7d044b,_0x58716c){return function(_0x4035dd){if(_0x4035dd){var _0x290710=typeof _0x58716c[_0x8299('0x1b')]===_0x8299('0x1c')&&typeof _0x58716c['limit']==='undefined';var _0x1253b2=_0x4035dd[_0x8299('0x1d')];var _0x46835f=_0x290710?0x0:_0x58716c['offset'];var _0x31464d=_0x290710?_0x4035dd[_0x8299('0x1d')]:_0x58716c[_0x8299('0x1b')]+_0x58716c[_0x8299('0x1e')];var _0x3363ec;if(_0x31464d>=_0x1253b2){_0x31464d=_0x1253b2;_0x3363ec=0xc8;}else{_0x3363ec=0xce;}_0x7d044b[_0x8299('0x18')](_0x3363ec);return _0x7d044b[_0x8299('0x1f')](_0x8299('0x20'),_0x46835f+'-'+_0x31464d+'/'+_0x1253b2)[_0x8299('0x1a')](_0x4035dd);}return null;};}function patchUpdates(_0x47e9cd){return function(_0x3c6ad7){try{jsonpatch[_0x8299('0x21')](_0x3c6ad7,_0x47e9cd,!![]);}catch(_0x16234e){return BPromise[_0x8299('0x22')](_0x16234e);}return _0x3c6ad7['save']();};}function saveUpdates(_0x1990fe,_0x4ecde0){return function(_0x6f6dff){if(_0x6f6dff){return _0x6f6dff['update'](_0x1990fe)[_0x8299('0x23')](function(_0x30a23f){return _0x30a23f;});}return null;};}function removeEntity(_0x23d557,_0x59a8e0){return function(_0x3cbca9){if(_0x3cbca9){return _0x3cbca9[_0x8299('0x24')]()[_0x8299('0x23')](function(){_0x23d557[_0x8299('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e626f,_0x157f91){return function(_0xb27be7){if(!_0xb27be7){_0x1e626f[_0x8299('0x17')](0x194);}return _0xb27be7;};}function handleError(_0x28204e,_0x15803f){_0x15803f=_0x15803f||0x1f4;return function(_0x299787){logger[_0x8299('0x25')](_0x299787['stack']);if(_0x299787[_0x8299('0x26')]){delete _0x299787[_0x8299('0x26')];}_0x28204e[_0x8299('0x18')](_0x15803f)[_0x8299('0x27')](_0x299787);};}exports[_0x8299('0x28')]=function(_0x38abdc,_0x2bfa67){var _0x5784d7={},_0x2a3e0e={},_0xa1c4f8={'count':0x0,'rows':[]};var _0x1b7967=_['map'](db['SquareReport']['rawAttributes'],function(_0x50dc3b){return{'name':_0x50dc3b[_0x8299('0x29')],'type':_0x50dc3b['type'][_0x8299('0x2a')]};});_0x2a3e0e[_0x8299('0x2b')]=_['map'](_0x1b7967,_0x8299('0x26'));_0x2a3e0e[_0x8299('0x2c')]=_[_0x8299('0x2d')](_0x38abdc[_0x8299('0x2c')]);_0x2a3e0e[_0x8299('0x2e')]=_[_0x8299('0x2f')](_0x2a3e0e['model'],_0x2a3e0e['query']);_0x5784d7['attributes']=_['intersection'](_0x2a3e0e[_0x8299('0x2b')],qs[_0x8299('0x30')](_0x38abdc[_0x8299('0x2c')][_0x8299('0x30')]));_0x5784d7[_0x8299('0x31')]=_0x5784d7[_0x8299('0x31')]['length']?_0x5784d7['attributes']:_0x2a3e0e[_0x8299('0x2b')];if(!_0x38abdc[_0x8299('0x2c')][_0x8299('0x32')](_0x8299('0x33'))){_0x5784d7[_0x8299('0x1e')]=qs['limit'](_0x38abdc[_0x8299('0x2c')][_0x8299('0x1e')]);_0x5784d7['offset']=qs['offset'](_0x38abdc['query'][_0x8299('0x1b')]);}_0x5784d7[_0x8299('0x34')]=qs[_0x8299('0x35')](_0x38abdc[_0x8299('0x2c')][_0x8299('0x35')]);_0x5784d7[_0x8299('0x36')]=qs['filters'](_['pick'](_0x38abdc[_0x8299('0x2c')],_0x2a3e0e[_0x8299('0x2e')]),_0x1b7967);if(_0x38abdc[_0x8299('0x2c')]['filter']){_0x5784d7['where']=_['merge'](_0x5784d7[_0x8299('0x36')],{'$or':_[_0x8299('0x37')](_0x1b7967,function(_0x4b52e9){if(_0x4b52e9[_0x8299('0x38')]!=='VIRTUAL'){var _0x2eb332={};_0x2eb332[_0x4b52e9[_0x8299('0x26')]]={'$like':'%'+_0x38abdc['query'][_0x8299('0x39')]+'%'};return _0x2eb332;}})});}_0x5784d7=_[_0x8299('0x3a')]({},_0x5784d7,_0x38abdc[_0x8299('0x3b')]);var _0x3761b0={'where':_0x5784d7['where']};return db[_0x8299('0x3c')][_0x8299('0x1d')](_0x3761b0)[_0x8299('0x23')](function(_0x440572){_0xa1c4f8[_0x8299('0x1d')]=_0x440572;if(_0x38abdc['query'][_0x8299('0x3d')]){_0x5784d7[_0x8299('0x3e')]=[{'all':!![]}];}return db[_0x8299('0x3c')][_0x8299('0x3f')](_0x5784d7);})[_0x8299('0x23')](function(_0x366d16){_0xa1c4f8[_0x8299('0x40')]=_0x366d16;return _0xa1c4f8;})[_0x8299('0x23')](respondWithFilteredResult(_0x2bfa67,_0x5784d7))[_0x8299('0x41')](handleError(_0x2bfa67,null));};exports[_0x8299('0x42')]=function(_0x58ab6c,_0x406b24){var _0x1ee9dc={'raw':!![],'where':{'id':_0x58ab6c[_0x8299('0x43')]['id']}},_0x4cb568={};_0x4cb568[_0x8299('0x2b')]=_['keys'](db[_0x8299('0x3c')][_0x8299('0x44')]);_0x4cb568[_0x8299('0x2c')]=_[_0x8299('0x2d')](_0x58ab6c['query']);_0x4cb568[_0x8299('0x2e')]=_[_0x8299('0x2f')](_0x4cb568[_0x8299('0x2b')],_0x4cb568[_0x8299('0x2c')]);_0x1ee9dc['attributes']=_['intersection'](_0x4cb568[_0x8299('0x2b')],qs[_0x8299('0x30')](_0x58ab6c[_0x8299('0x2c')]['fields']));_0x1ee9dc[_0x8299('0x31')]=_0x1ee9dc['attributes'][_0x8299('0x45')]?_0x1ee9dc[_0x8299('0x31')]:_0x4cb568['model'];if(_0x58ab6c[_0x8299('0x2c')][_0x8299('0x3d')]){_0x1ee9dc[_0x8299('0x3e')]=[{'all':!![]}];}_0x1ee9dc=_[_0x8299('0x3a')]({},_0x1ee9dc,_0x58ab6c[_0x8299('0x3b')]);return db['SquareReport'][_0x8299('0x46')](_0x1ee9dc)['then'](handleEntityNotFound(_0x406b24,null))[_0x8299('0x23')](respondWithResult(_0x406b24,null))['catch'](handleError(_0x406b24,null));};exports[_0x8299('0x47')]=function(_0x584216,_0x5b3873){return db[_0x8299('0x3c')]['create'](_0x584216[_0x8299('0x48')],{})[_0x8299('0x23')](respondWithResult(_0x5b3873,0xc9))[_0x8299('0x41')](handleError(_0x5b3873,null));};exports['update']=function(_0x460610,_0x12ba1f){if(_0x460610[_0x8299('0x48')]['id']){delete _0x460610[_0x8299('0x48')]['id'];}return db[_0x8299('0x3c')][_0x8299('0x46')]({'where':{'id':_0x460610[_0x8299('0x43')]['id']}})[_0x8299('0x23')](handleEntityNotFound(_0x12ba1f,null))[_0x8299('0x23')](saveUpdates(_0x460610[_0x8299('0x48')],null))[_0x8299('0x23')](respondWithResult(_0x12ba1f,null))[_0x8299('0x41')](handleError(_0x12ba1f,null));};exports[_0x8299('0x24')]=function(_0x120db9,_0x2890d0){return db[_0x8299('0x3c')][_0x8299('0x46')]({'where':{'id':_0x120db9[_0x8299('0x43')]['id']}})[_0x8299('0x23')](handleEntityNotFound(_0x2890d0,null))[_0x8299('0x23')](removeEntity(_0x2890d0,null))[_0x8299('0x41')](handleError(_0x2890d0,null));};exports['describe']=function(_0x5af241,_0x180001){return db[_0x8299('0x3c')][_0x8299('0x49')]()[_0x8299('0x23')](respondWithResult(_0x180001,null))['catch'](handleError(_0x180001,null));}; \ No newline at end of file +var _0x7893=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','count','limit','set','update','destroy','then','status','error','name','send','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x7893,0x11c));var _0x3789=function(_0x3804a6,_0x3194e9){_0x3804a6=_0x3804a6-0x0;var _0x236bde=_0x7893[_0x3804a6];return _0x236bde;};'use strict';var emlformat=require(_0x3789('0x0'));var rimraf=require(_0x3789('0x1'));var zipdir=require(_0x3789('0x2'));var jsonpatch=require(_0x3789('0x3'));var rp=require(_0x3789('0x4'));var moment=require(_0x3789('0x5'));var BPromise=require(_0x3789('0x6'));var Mustache=require(_0x3789('0x7'));var util=require('util');var path=require(_0x3789('0x8'));var sox=require(_0x3789('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3789('0xa'));var _=require(_0x3789('0xb'));var squel=require('squel');var crypto=require(_0x3789('0xc'));var jsforce=require(_0x3789('0xd'));var deskjs=require(_0x3789('0xe'));var toCsv=require(_0x3789('0xf'));var querystring=require('querystring');var Papa=require(_0x3789('0x10'));var Redis=require(_0x3789('0x11'));var authService=require(_0x3789('0x12'));var qs=require(_0x3789('0x13'));var as=require(_0x3789('0x14'));var hardwareService=require(_0x3789('0x15'));var logger=require(_0x3789('0x16'))(_0x3789('0x17'));var utils=require(_0x3789('0x18'));var config=require(_0x3789('0x19'));var licenseUtil=require(_0x3789('0x1a'));var db=require(_0x3789('0x1b'))['db'];function respondWithStatusCode(_0x4bf0b9,_0xfbdff6){_0xfbdff6=_0xfbdff6||0xcc;return function(_0x5ca1af){if(_0x5ca1af){return _0x4bf0b9[_0x3789('0x1c')](_0xfbdff6);}return _0x4bf0b9['status'](_0xfbdff6)[_0x3789('0x1d')]();};}function respondWithResult(_0x2ac9cb,_0x124254){_0x124254=_0x124254||0xc8;return function(_0x5d7875){if(_0x5d7875){return _0x2ac9cb['status'](_0x124254)[_0x3789('0x1e')](_0x5d7875);}};}function respondWithFilteredResult(_0x2802c6,_0x28361c){return function(_0x25fa0f){if(_0x25fa0f){var _0x302feb=typeof _0x28361c[_0x3789('0x1f')]==='undefined'&&typeof _0x28361c['limit']==='undefined';var _0x3ec2ac=_0x25fa0f['count'];var _0x15f462=_0x302feb?0x0:_0x28361c[_0x3789('0x1f')];var _0x20f3e2=_0x302feb?_0x25fa0f[_0x3789('0x20')]:_0x28361c[_0x3789('0x1f')]+_0x28361c[_0x3789('0x21')];var _0x706aeb;if(_0x20f3e2>=_0x3ec2ac){_0x20f3e2=_0x3ec2ac;_0x706aeb=0xc8;}else{_0x706aeb=0xce;}_0x2802c6['status'](_0x706aeb);return _0x2802c6[_0x3789('0x22')]('Content-Range',_0x15f462+'-'+_0x20f3e2+'/'+_0x3ec2ac)[_0x3789('0x1e')](_0x25fa0f);}return null;};}function patchUpdates(_0x20c677){return function(_0x28bb5a){try{jsonpatch['apply'](_0x28bb5a,_0x20c677,!![]);}catch(_0x4969b0){return BPromise['reject'](_0x4969b0);}return _0x28bb5a['save']();};}function saveUpdates(_0x93f3de,_0x52f2cd){return function(_0x1be211){if(_0x1be211){return _0x1be211[_0x3789('0x23')](_0x93f3de)['then'](function(_0x51e872){return _0x51e872;});}return null;};}function removeEntity(_0x1779c2,_0x3c3500){return function(_0x51bb51){if(_0x51bb51){return _0x51bb51[_0x3789('0x24')]()[_0x3789('0x25')](function(){_0x1779c2[_0x3789('0x26')](0xcc)[_0x3789('0x1d')]();});}};}function handleEntityNotFound(_0x1edb0c,_0x16e1fc){return function(_0x12780a){if(!_0x12780a){_0x1edb0c[_0x3789('0x1c')](0x194);}return _0x12780a;};}function handleError(_0x26041a,_0x4e3325){_0x4e3325=_0x4e3325||0x1f4;return function(_0x5822b7){logger[_0x3789('0x27')](_0x5822b7['stack']);if(_0x5822b7[_0x3789('0x28')]){delete _0x5822b7[_0x3789('0x28')];}_0x26041a[_0x3789('0x26')](_0x4e3325)[_0x3789('0x29')](_0x5822b7);};}exports['index']=function(_0x37ccf0,_0x3d74bc){var _0x2b3911={},_0x1e8a4f={},_0x177119={'count':0x0,'rows':[]};var _0x1debef=_[_0x3789('0x2a')](db[_0x3789('0x2b')][_0x3789('0x2c')],function(_0xa55694){return{'name':_0xa55694[_0x3789('0x2d')],'type':_0xa55694[_0x3789('0x2e')][_0x3789('0x2f')]};});_0x1e8a4f[_0x3789('0x30')]=_[_0x3789('0x2a')](_0x1debef,_0x3789('0x28'));_0x1e8a4f[_0x3789('0x31')]=_[_0x3789('0x32')](_0x37ccf0['query']);_0x1e8a4f[_0x3789('0x33')]=_[_0x3789('0x34')](_0x1e8a4f[_0x3789('0x30')],_0x1e8a4f[_0x3789('0x31')]);_0x2b3911['attributes']=_[_0x3789('0x34')](_0x1e8a4f['model'],qs[_0x3789('0x35')](_0x37ccf0[_0x3789('0x31')][_0x3789('0x35')]));_0x2b3911[_0x3789('0x36')]=_0x2b3911['attributes'][_0x3789('0x37')]?_0x2b3911['attributes']:_0x1e8a4f[_0x3789('0x30')];if(!_0x37ccf0['query'][_0x3789('0x38')](_0x3789('0x39'))){_0x2b3911['limit']=qs[_0x3789('0x21')](_0x37ccf0[_0x3789('0x31')][_0x3789('0x21')]);_0x2b3911['offset']=qs[_0x3789('0x1f')](_0x37ccf0[_0x3789('0x31')][_0x3789('0x1f')]);}_0x2b3911[_0x3789('0x3a')]=qs[_0x3789('0x3b')](_0x37ccf0['query'][_0x3789('0x3b')]);_0x2b3911[_0x3789('0x3c')]=qs[_0x3789('0x33')](_['pick'](_0x37ccf0['query'],_0x1e8a4f[_0x3789('0x33')]),_0x1debef);if(_0x37ccf0['query'][_0x3789('0x3d')]){_0x2b3911[_0x3789('0x3c')]=_[_0x3789('0x3e')](_0x2b3911[_0x3789('0x3c')],{'$or':_[_0x3789('0x2a')](_0x1debef,function(_0xf57b86){if(_0xf57b86['type']!=='VIRTUAL'){var _0x1506b5={};_0x1506b5[_0xf57b86[_0x3789('0x28')]]={'$like':'%'+_0x37ccf0[_0x3789('0x31')][_0x3789('0x3d')]+'%'};return _0x1506b5;}})});}_0x2b3911=_['merge']({},_0x2b3911,_0x37ccf0[_0x3789('0x3f')]);var _0x6730fb={'where':_0x2b3911['where']};return db[_0x3789('0x2b')][_0x3789('0x20')](_0x6730fb)[_0x3789('0x25')](function(_0x4c6f2b){_0x177119[_0x3789('0x20')]=_0x4c6f2b;if(_0x37ccf0[_0x3789('0x31')][_0x3789('0x40')]){_0x2b3911[_0x3789('0x41')]=[{'all':!![]}];}return db[_0x3789('0x2b')][_0x3789('0x42')](_0x2b3911);})['then'](function(_0x5b5f3a){_0x177119['rows']=_0x5b5f3a;return _0x177119;})[_0x3789('0x25')](respondWithFilteredResult(_0x3d74bc,_0x2b3911))['catch'](handleError(_0x3d74bc,null));};exports[_0x3789('0x43')]=function(_0x3a3202,_0x484293){var _0x31e307={'raw':!![],'where':{'id':_0x3a3202[_0x3789('0x44')]['id']}},_0x121909={};_0x121909['model']=_[_0x3789('0x32')](db['SquareReport']['rawAttributes']);_0x121909[_0x3789('0x31')]=_[_0x3789('0x32')](_0x3a3202[_0x3789('0x31')]);_0x121909[_0x3789('0x33')]=_[_0x3789('0x34')](_0x121909[_0x3789('0x30')],_0x121909[_0x3789('0x31')]);_0x31e307[_0x3789('0x36')]=_[_0x3789('0x34')](_0x121909[_0x3789('0x30')],qs['fields'](_0x3a3202[_0x3789('0x31')]['fields']));_0x31e307[_0x3789('0x36')]=_0x31e307['attributes']['length']?_0x31e307[_0x3789('0x36')]:_0x121909[_0x3789('0x30')];if(_0x3a3202['query'][_0x3789('0x40')]){_0x31e307['include']=[{'all':!![]}];}_0x31e307=_[_0x3789('0x3e')]({},_0x31e307,_0x3a3202[_0x3789('0x3f')]);return db['SquareReport'][_0x3789('0x45')](_0x31e307)[_0x3789('0x25')](handleEntityNotFound(_0x484293,null))[_0x3789('0x25')](respondWithResult(_0x484293,null))[_0x3789('0x46')](handleError(_0x484293,null));};exports['create']=function(_0x554079,_0x4a8655){return db[_0x3789('0x2b')][_0x3789('0x47')](_0x554079['body'],{})[_0x3789('0x25')](respondWithResult(_0x4a8655,0xc9))[_0x3789('0x46')](handleError(_0x4a8655,null));};exports[_0x3789('0x23')]=function(_0xa1e11,_0x982cc6){if(_0xa1e11[_0x3789('0x48')]['id']){delete _0xa1e11[_0x3789('0x48')]['id'];}return db[_0x3789('0x2b')][_0x3789('0x45')]({'where':{'id':_0xa1e11['params']['id']}})[_0x3789('0x25')](handleEntityNotFound(_0x982cc6,null))['then'](saveUpdates(_0xa1e11[_0x3789('0x48')],null))['then'](respondWithResult(_0x982cc6,null))[_0x3789('0x46')](handleError(_0x982cc6,null));};exports[_0x3789('0x24')]=function(_0x42e77f,_0x24730c){return db[_0x3789('0x2b')]['find']({'where':{'id':_0x42e77f[_0x3789('0x44')]['id']}})[_0x3789('0x25')](handleEntityNotFound(_0x24730c,null))['then'](removeEntity(_0x24730c,null))[_0x3789('0x46')](handleError(_0x24730c,null));};exports[_0x3789('0x49')]=function(_0x32f422,_0x5696e5){return db[_0x3789('0x2b')]['describe']()[_0x3789('0x25')](respondWithResult(_0x5696e5,null))[_0x3789('0x46')](handleError(_0x5696e5,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 9015a70..1905694 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 _0x5640=['../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','leaveAt','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3829a1,_0xe45ef7){var _0x6d9998=function(_0x2c10dd){while(--_0x2c10dd){_0x3829a1['push'](_0x3829a1['shift']());}};_0x6d9998(++_0xe45ef7);}(_0x5640,0x8a));var _0x0564=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5640[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x0564('0x0'));var logger=require(_0x0564('0x1'))(_0x0564('0x2'));var moment=require('moment');var BPromise=require(_0x0564('0x3'));var rp=require(_0x0564('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0564('0x5'));var attributes=require(_0x0564('0x6'));module[_0x0564('0x7')]=function(_0x41793c,_0x3de87f){return _0x41793c[_0x0564('0x8')](_0x0564('0x9'),attributes,{'tableName':_0x0564('0xa'),'paranoid':![],'indexes':[{'name':_0x0564('0xb'),'fields':['uniqueid','project_name']},{'name':_0x0564('0xc'),'fields':[_0x0564('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7341=['request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','util','../../config/logger'];(function(_0x288a23,_0x456e8a){var _0x372d6c=function(_0x349bb6){while(--_0x349bb6){_0x288a23['push'](_0x288a23['shift']());}};_0x372d6c(++_0x456e8a);}(_0x7341,0x136));var _0x1734=function(_0x20af6d,_0x54ad66){_0x20af6d=_0x20af6d-0x0;var _0x2b00b0=_0x7341[_0x20af6d];return _0x2b00b0;};'use strict';var _=require('lodash');var util=require(_0x1734('0x0'));var logger=require(_0x1734('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1734('0x2'));var fs=require('fs');var path=require(_0x1734('0x3'));var rimraf=require(_0x1734('0x4'));var config=require(_0x1734('0x5'));var attributes=require(_0x1734('0x6'));module[_0x1734('0x7')]=function(_0x25d38d,_0x4d3c81){return _0x25d38d[_0x1734('0x8')](_0x1734('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x1734('0xa'),'fields':[_0x1734('0xb'),'project_name']},{'name':_0x1734('0xc'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 291f778..8f7ea38 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 _0x7f46=['UpdateSquareReport','update','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','SquareReport','create','body','options','debug','CreateSquareReport'];(function(_0x25b298,_0x5d4fc6){var _0x2bc16c=function(_0x3516f7){while(--_0x3516f7){_0x25b298['push'](_0x25b298['shift']());}};_0x2bc16c(++_0x5d4fc6);}(_0x7f46,0x11b));var _0x67f4=function(_0x4ec805,_0x3b8515){_0x4ec805=_0x4ec805-0x0;var _0x386805=_0x7f46[_0x4ec805];return _0x386805;};'use strict';var _=require(_0x67f4('0x0'));var util=require(_0x67f4('0x1'));var moment=require('moment');var BPromise=require(_0x67f4('0x2'));var rs=require(_0x67f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x67f4('0x4'))(_0x67f4('0x5'));var config=require('../../config/environment');var jayson=require(_0x67f4('0x6'));var client=jayson[_0x67f4('0x7')][_0x67f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f707c,_0x3dfd31,_0x2420b5){return new BPromise(function(_0x4f31e4,_0x3c97b6){return client[_0x67f4('0x9')](_0x2f707c,_0x2420b5)[_0x67f4('0xa')](function(_0x3a5805){logger[_0x67f4('0xb')](_0x67f4('0xc'),_0x3dfd31,'request\x20sent');logger['debug'](_0x67f4('0xd'),_0x3dfd31,'request\x20sent',JSON[_0x67f4('0xe')](_0x3a5805));if(_0x3a5805[_0x67f4('0xf')]){if(_0x3a5805[_0x67f4('0xf')][_0x67f4('0x10')]===0x1f4){logger[_0x67f4('0xf')](_0x67f4('0xc'),_0x3dfd31,_0x3a5805[_0x67f4('0xf')][_0x67f4('0x11')]);return _0x3c97b6(_0x3a5805['error']['message']);}logger[_0x67f4('0xf')](_0x67f4('0xc'),_0x3dfd31,_0x3a5805[_0x67f4('0xf')][_0x67f4('0x11')]);return _0x4f31e4(_0x3a5805['error'][_0x67f4('0x11')]);}else{logger[_0x67f4('0xb')](_0x67f4('0xc'),_0x3dfd31,_0x67f4('0x12'));_0x4f31e4(_0x3a5805[_0x67f4('0x13')][_0x67f4('0x11')]);}})[_0x67f4('0x14')](function(_0x5ac7f4){logger[_0x67f4('0xf')](_0x67f4('0xc'),_0x3dfd31,_0x5ac7f4);_0x3c97b6(_0x5ac7f4);});});}exports['CreateSquareReport']=function(_0x3c4c9b){var _0x5c2156=this;return new Promise(function(_0x54360c,_0x17ee0a){return db[_0x67f4('0x15')][_0x67f4('0x16')](_0x3c4c9b[_0x67f4('0x17')],{'raw':_0x3c4c9b[_0x67f4('0x18')]?_0x3c4c9b[_0x67f4('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x67f4('0xa')](function(_0x21c526){logger[_0x67f4('0xb')]('CreateSquareReport',_0x3c4c9b);logger[_0x67f4('0x19')](_0x67f4('0x1a'),_0x3c4c9b,JSON[_0x67f4('0xe')](_0x21c526));_0x54360c(_0x21c526);})['catch'](function(_0xd6449f){logger['error'](_0x67f4('0x1a'),_0xd6449f[_0x67f4('0x11')],_0x3c4c9b);_0x17ee0a(_0x5c2156[_0x67f4('0xf')](0x1f4,_0xd6449f[_0x67f4('0x11')]));});});};exports[_0x67f4('0x1b')]=function(_0x252957){var _0x2fea92=this;return new Promise(function(_0x33d718,_0x4b72b3){return db[_0x67f4('0x15')][_0x67f4('0x1c')](_0x252957[_0x67f4('0x17')],{'raw':_0x252957[_0x67f4('0x18')]?_0x252957[_0x67f4('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x252957[_0x67f4('0x18')]?_0x252957['options']['where']||null:null,'attributes':_0x252957[_0x67f4('0x18')]?_0x252957[_0x67f4('0x18')][_0x67f4('0x1d')]||null:null,'limit':_0x252957[_0x67f4('0x18')]?_0x252957[_0x67f4('0x18')][_0x67f4('0x1e')]||null:null})[_0x67f4('0xa')](function(_0x262597){logger['info'](_0x67f4('0x1b'),_0x252957);logger['debug'](_0x67f4('0x1b'),_0x252957,JSON['stringify'](_0x262597));_0x33d718(_0x262597);})['catch'](function(_0x2a4a5c){logger[_0x67f4('0xf')](_0x67f4('0x1b'),_0x2a4a5c[_0x67f4('0x11')],_0x252957);_0x4b72b3(_0x2fea92[_0x67f4('0xf')](0x1f4,_0x2a4a5c[_0x67f4('0x11')]));});});}; \ No newline at end of file +var _0x9538=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareReport','SquareReport','body','options','raw','stringify','UpdateSquareReport','update','where','attributes','then','catch','moment'];(function(_0x176317,_0x4897b3){var _0xef2759=function(_0x581e2b){while(--_0x581e2b){_0x176317['push'](_0x176317['shift']());}};_0xef2759(++_0x4897b3);}(_0x9538,0x95));var _0x8953=function(_0xa3e26d,_0x55bc26){_0xa3e26d=_0xa3e26d-0x0;var _0xe26930=_0x9538[_0xa3e26d];return _0xe26930;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8953('0x0'));var BPromise=require(_0x8953('0x1'));var rs=require(_0x8953('0x2'));var fs=require('fs');var Redis=require(_0x8953('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8953('0x4'));var logger=require('../../config/logger')(_0x8953('0x5'));var config=require(_0x8953('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8953('0x7')][_0x8953('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f9b06,_0x2dfff2,_0x54807f){return new BPromise(function(_0x26373a,_0x2e5eec){return client['request'](_0x3f9b06,_0x54807f)['then'](function(_0xac2b66){logger[_0x8953('0x9')](_0x8953('0xa'),_0x2dfff2,_0x8953('0xb'));logger[_0x8953('0xc')](_0x8953('0xd'),_0x2dfff2,_0x8953('0xb'),JSON['stringify'](_0xac2b66));if(_0xac2b66[_0x8953('0xe')]){if(_0xac2b66[_0x8953('0xe')][_0x8953('0xf')]===0x1f4){logger[_0x8953('0xe')](_0x8953('0xa'),_0x2dfff2,_0xac2b66[_0x8953('0xe')][_0x8953('0x10')]);return _0x2e5eec(_0xac2b66[_0x8953('0xe')][_0x8953('0x10')]);}logger['error'](_0x8953('0xa'),_0x2dfff2,_0xac2b66[_0x8953('0xe')][_0x8953('0x10')]);return _0x26373a(_0xac2b66[_0x8953('0xe')][_0x8953('0x10')]);}else{logger['info'](_0x8953('0xa'),_0x2dfff2,_0x8953('0xb'));_0x26373a(_0xac2b66[_0x8953('0x11')][_0x8953('0x10')]);}})['catch'](function(_0xf1043e){logger[_0x8953('0xe')](_0x8953('0xa'),_0x2dfff2,_0xf1043e);_0x2e5eec(_0xf1043e);});});}exports[_0x8953('0x12')]=function(_0x28cbf3){var _0x52f4df=this;return new Promise(function(_0xc2fcf7,_0x5f3ad6){return db[_0x8953('0x13')]['create'](_0x28cbf3[_0x8953('0x14')],{'raw':_0x28cbf3[_0x8953('0x15')]?_0x28cbf3[_0x8953('0x15')][_0x8953('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1fa622){logger['info']('CreateSquareReport',_0x28cbf3);logger[_0x8953('0xc')]('CreateSquareReport',_0x28cbf3,JSON[_0x8953('0x17')](_0x1fa622));_0xc2fcf7(_0x1fa622);})['catch'](function(_0x88561c){logger[_0x8953('0xe')]('CreateSquareReport',_0x88561c[_0x8953('0x10')],_0x28cbf3);_0x5f3ad6(_0x52f4df[_0x8953('0xe')](0x1f4,_0x88561c[_0x8953('0x10')]));});});};exports[_0x8953('0x18')]=function(_0x228c3e){var _0xf20e6e=this;return new Promise(function(_0x4398b0,_0x5cbc09){return db[_0x8953('0x13')][_0x8953('0x19')](_0x228c3e[_0x8953('0x14')],{'raw':_0x228c3e[_0x8953('0x15')]?_0x228c3e['options'][_0x8953('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228c3e['options']?_0x228c3e[_0x8953('0x15')][_0x8953('0x1a')]||null:null,'attributes':_0x228c3e[_0x8953('0x15')]?_0x228c3e[_0x8953('0x15')][_0x8953('0x1b')]||null:null,'limit':_0x228c3e[_0x8953('0x15')]?_0x228c3e[_0x8953('0x15')]['limit']||null:null})[_0x8953('0x1c')](function(_0x13bbca){logger[_0x8953('0x9')]('UpdateSquareReport',_0x228c3e);logger[_0x8953('0xc')](_0x8953('0x18'),_0x228c3e,JSON[_0x8953('0x17')](_0x13bbca));_0x4398b0(_0x13bbca);})[_0x8953('0x1d')](function(_0x5a0018){logger['error']('UpdateSquareReport',_0x5a0018[_0x8953('0x10')],_0x228c3e);_0x5cbc09(_0xf20e6e[_0x8953('0xe')](0x1f4,_0x5a0018[_0x8953('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 7d82428..4c98196 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 _0xe08c=['../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','../../components/auth/service'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0xe08c,0x1dc));var _0xce08=function(_0x5cca84,_0x3889cd){_0x5cca84=_0x5cca84-0x0;var _0x129dad=_0xe08c[_0x5cca84];return _0x129dad;};'use strict';var multer=require(_0xce08('0x0'));var util=require(_0xce08('0x1'));var path=require(_0xce08('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xce08('0x3'));var interaction=require(_0xce08('0x4'));var config=require('../../config/environment');var controller=require(_0xce08('0x5'));router[_0xce08('0x6')]('/',auth[_0xce08('0x7')](),controller[_0xce08('0x8')]);router[_0xce08('0x6')](_0xce08('0x9'),auth['isAuthenticated'](),controller[_0xce08('0xa')]);router[_0xce08('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xce08('0xb')]);router[_0xce08('0xc')]('/',auth[_0xce08('0x7')](),controller[_0xce08('0xd')]);router[_0xce08('0xe')](_0xce08('0xf'),auth['isAuthenticated'](),controller[_0xce08('0x10')]);router[_0xce08('0x11')](_0xce08('0xf'),auth['isAuthenticated'](),controller[_0xce08('0x12')]);module[_0xce08('0x13')]=router; \ No newline at end of file +var _0x7a49=['create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','post'];(function(_0x35825e,_0x657421){var _0x4f4d90=function(_0x160265){while(--_0x160265){_0x35825e['push'](_0x35825e['shift']());}};_0x4f4d90(++_0x657421);}(_0x7a49,0x14a));var _0x97a4=function(_0x5ea77e,_0x548f40){_0x5ea77e=_0x5ea77e-0x0;var _0x28b82b=_0x7a49[_0x5ea77e];return _0x28b82b;};'use strict';var multer=require(_0x97a4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x97a4('0x1'));var express=require('express');var router=express[_0x97a4('0x2')]();var fs_extra=require(_0x97a4('0x3'));var auth=require(_0x97a4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x97a4('0x5'));var controller=require('./squareReportDetail.controller');router[_0x97a4('0x6')]('/',auth[_0x97a4('0x7')](),controller['index']);router[_0x97a4('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x97a4('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x97a4('0x9')]('/',auth['isAuthenticated'](),controller[_0x97a4('0xa')]);router[_0x97a4('0xb')](_0x97a4('0xc'),auth[_0x97a4('0x7')](),controller[_0x97a4('0xd')]);router[_0x97a4('0xe')](_0x97a4('0xc'),auth[_0x97a4('0x7')](),controller[_0x97a4('0xf')]);module[_0x97a4('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index c103ce6..31c108a 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 _0x16f7=['STRING','TEXT','sequelize','exports'];(function(_0x111cfb,_0x1d0579){var _0x4be5fd=function(_0x456f44){while(--_0x456f44){_0x111cfb['push'](_0x111cfb['shift']());}};_0x4be5fd(++_0x1d0579);}(_0x16f7,0x8e));var _0x716f=function(_0x17106a,_0x1e62e5){_0x17106a=_0x17106a-0x0;var _0x133547=_0x16f7[_0x17106a];return _0x133547;};'use strict';var Sequelize=require(_0x716f('0x0'));module[_0x716f('0x1')]={'uniqueid':{'type':Sequelize[_0x716f('0x2')]},'node':{'type':Sequelize[_0x716f('0x2')]},'application':{'type':Sequelize[_0x716f('0x2')]},'data':{'type':Sequelize[_0x716f('0x3')]},'project_name':{'type':Sequelize[_0x716f('0x2')]},'callerid':{'type':Sequelize[_0x716f('0x2')]}}; \ No newline at end of file +var _0xdc43=['TEXT','sequelize','exports','STRING'];(function(_0x3228ff,_0x5ea23e){var _0x39a21e=function(_0x21e371){while(--_0x21e371){_0x3228ff['push'](_0x3228ff['shift']());}};_0x39a21e(++_0x5ea23e);}(_0xdc43,0xa1));var _0x3dc4=function(_0xfe6fe6,_0x52df7b){_0xfe6fe6=_0xfe6fe6-0x0;var _0x2c49d6=_0xdc43[_0xfe6fe6];return _0x2c49d6;};'use strict';var Sequelize=require(_0x3dc4('0x0'));module[_0x3dc4('0x1')]={'uniqueid':{'type':Sequelize[_0x3dc4('0x2')]},'node':{'type':Sequelize[_0x3dc4('0x2')]},'application':{'type':Sequelize[_0x3dc4('0x2')]},'data':{'type':Sequelize[_0x3dc4('0x3')]},'project_name':{'type':Sequelize[_0x3dc4('0x2')]},'callerid':{'type':Sequelize[_0x3dc4('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 391ad57..75d90b2 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 _0xd436=['fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','sox','ejs'];(function(_0x487b09,_0x349b11){var _0x28830b=function(_0x51705f){while(--_0x51705f){_0x487b09['push'](_0x487b09['shift']());}};_0x28830b(++_0x349b11);}(_0xd436,0x1ea));var _0x6d43=function(_0x11f0a6,_0x1ce59d){_0x11f0a6=_0x11f0a6-0x0;var _0xa5ab4b=_0xd436[_0x11f0a6];return _0xa5ab4b;};'use strict';var emlformat=require(_0x6d43('0x0'));var rimraf=require(_0x6d43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d43('0x2'));var rp=require('request-promise');var moment=require(_0x6d43('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6d43('0x4'));var util=require('util');var path=require('path');var sox=require(_0x6d43('0x5'));var csv=require('to-csv');var ejs=require(_0x6d43('0x6'));var fs=require('fs');var fs_extra=require(_0x6d43('0x7'));var _=require(_0x6d43('0x8'));var squel=require(_0x6d43('0x9'));var crypto=require('crypto');var jsforce=require(_0x6d43('0xa'));var deskjs=require(_0x6d43('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6d43('0xc'));var Redis=require('ioredis');var authService=require(_0x6d43('0xd'));var qs=require(_0x6d43('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d43('0xf'));var logger=require(_0x6d43('0x10'))(_0x6d43('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6d43('0x12'));var db=require(_0x6d43('0x13'))['db'];function respondWithStatusCode(_0x14ca5b,_0x1059d8){_0x1059d8=_0x1059d8||0xcc;return function(_0x13b190){if(_0x13b190){return _0x14ca5b[_0x6d43('0x14')](_0x1059d8);}return _0x14ca5b[_0x6d43('0x15')](_0x1059d8)[_0x6d43('0x16')]();};}function respondWithResult(_0x468586,_0x1bf242){_0x1bf242=_0x1bf242||0xc8;return function(_0x385455){if(_0x385455){return _0x468586[_0x6d43('0x15')](_0x1bf242)[_0x6d43('0x17')](_0x385455);}};}function respondWithFilteredResult(_0x428bad,_0x548de2){return function(_0xbaaf77){if(_0xbaaf77){var _0xea12d1=typeof _0x548de2[_0x6d43('0x18')]==='undefined'&&typeof _0x548de2[_0x6d43('0x19')]===_0x6d43('0x1a');var _0x4b9c56=_0xbaaf77['count'];var _0x5294f9=_0xea12d1?0x0:_0x548de2[_0x6d43('0x18')];var _0x2f118e=_0xea12d1?_0xbaaf77['count']:_0x548de2[_0x6d43('0x18')]+_0x548de2['limit'];var _0x322c5d;if(_0x2f118e>=_0x4b9c56){_0x2f118e=_0x4b9c56;_0x322c5d=0xc8;}else{_0x322c5d=0xce;}_0x428bad[_0x6d43('0x15')](_0x322c5d);return _0x428bad[_0x6d43('0x1b')](_0x6d43('0x1c'),_0x5294f9+'-'+_0x2f118e+'/'+_0x4b9c56)['json'](_0xbaaf77);}return null;};}function patchUpdates(_0x282e3e){return function(_0x142025){try{jsonpatch['apply'](_0x142025,_0x282e3e,!![]);}catch(_0x1677f2){return BPromise[_0x6d43('0x1d')](_0x1677f2);}return _0x142025['save']();};}function saveUpdates(_0x172258,_0x3296e0){return function(_0xaf329d){if(_0xaf329d){return _0xaf329d[_0x6d43('0x1e')](_0x172258)[_0x6d43('0x1f')](function(_0x333f98){return _0x333f98;});}return null;};}function removeEntity(_0x2bd68f,_0x143c6c){return function(_0x3ec116){if(_0x3ec116){return _0x3ec116[_0x6d43('0x20')]()[_0x6d43('0x1f')](function(){_0x2bd68f[_0x6d43('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16f5a3,_0x15fadf){return function(_0xa2b323){if(!_0xa2b323){_0x16f5a3[_0x6d43('0x14')](0x194);}return _0xa2b323;};}function handleError(_0x1fc581,_0x311ad2){_0x311ad2=_0x311ad2||0x1f4;return function(_0x3c6004){logger[_0x6d43('0x21')](_0x3c6004[_0x6d43('0x22')]);if(_0x3c6004[_0x6d43('0x23')]){delete _0x3c6004[_0x6d43('0x23')];}_0x1fc581[_0x6d43('0x15')](_0x311ad2)[_0x6d43('0x24')](_0x3c6004);};}exports[_0x6d43('0x25')]=function(_0x3f2227,_0x41e781){var _0xa857a7={},_0x1ec6df={},_0x5449bc={'count':0x0,'rows':[]};var _0x3bed81=_[_0x6d43('0x26')](db[_0x6d43('0x27')]['rawAttributes'],function(_0xfebbaf){return{'name':_0xfebbaf[_0x6d43('0x28')],'type':_0xfebbaf[_0x6d43('0x29')][_0x6d43('0x2a')]};});_0x1ec6df[_0x6d43('0x2b')]=_['map'](_0x3bed81,_0x6d43('0x23'));_0x1ec6df[_0x6d43('0x2c')]=_['keys'](_0x3f2227[_0x6d43('0x2c')]);_0x1ec6df[_0x6d43('0x2d')]=_[_0x6d43('0x2e')](_0x1ec6df[_0x6d43('0x2b')],_0x1ec6df[_0x6d43('0x2c')]);_0xa857a7['attributes']=_[_0x6d43('0x2e')](_0x1ec6df[_0x6d43('0x2b')],qs[_0x6d43('0x2f')](_0x3f2227[_0x6d43('0x2c')]['fields']));_0xa857a7[_0x6d43('0x30')]=_0xa857a7[_0x6d43('0x30')][_0x6d43('0x31')]?_0xa857a7[_0x6d43('0x30')]:_0x1ec6df[_0x6d43('0x2b')];if(!_0x3f2227[_0x6d43('0x2c')]['hasOwnProperty'](_0x6d43('0x32'))){_0xa857a7['limit']=qs[_0x6d43('0x19')](_0x3f2227[_0x6d43('0x2c')]['limit']);_0xa857a7['offset']=qs['offset'](_0x3f2227[_0x6d43('0x2c')]['offset']);}_0xa857a7[_0x6d43('0x33')]=qs['sort'](_0x3f2227[_0x6d43('0x2c')]['sort']);_0xa857a7['where']=qs[_0x6d43('0x2d')](_[_0x6d43('0x34')](_0x3f2227[_0x6d43('0x2c')],_0x1ec6df[_0x6d43('0x2d')]),_0x3bed81);if(_0x3f2227['query'][_0x6d43('0x35')]){_0xa857a7[_0x6d43('0x36')]=_[_0x6d43('0x37')](_0xa857a7[_0x6d43('0x36')],{'$or':_[_0x6d43('0x26')](_0x3bed81,function(_0x1286b4){if(_0x1286b4[_0x6d43('0x29')]!==_0x6d43('0x38')){var _0x4a80ca={};_0x4a80ca[_0x1286b4['name']]={'$like':'%'+_0x3f2227[_0x6d43('0x2c')][_0x6d43('0x35')]+'%'};return _0x4a80ca;}})});}_0xa857a7=_[_0x6d43('0x37')]({},_0xa857a7,_0x3f2227[_0x6d43('0x39')]);var _0x249b34={'where':_0xa857a7['where']};return db[_0x6d43('0x27')]['count'](_0x249b34)[_0x6d43('0x1f')](function(_0x11ad14){_0x5449bc['count']=_0x11ad14;if(_0x3f2227[_0x6d43('0x2c')][_0x6d43('0x3a')]){_0xa857a7['include']=[{'all':!![]}];}return db[_0x6d43('0x27')][_0x6d43('0x3b')](_0xa857a7);})[_0x6d43('0x1f')](function(_0x9d80e4){_0x5449bc[_0x6d43('0x3c')]=_0x9d80e4;return _0x5449bc;})[_0x6d43('0x1f')](respondWithFilteredResult(_0x41e781,_0xa857a7))[_0x6d43('0x3d')](handleError(_0x41e781,null));};exports[_0x6d43('0x3e')]=function(_0x220263,_0x573643){var _0x44ae23={'raw':!![],'where':{'id':_0x220263[_0x6d43('0x3f')]['id']}},_0x50b349={};_0x50b349[_0x6d43('0x2b')]=_[_0x6d43('0x40')](db['SquareDetailsReport'][_0x6d43('0x41')]);_0x50b349[_0x6d43('0x2c')]=_[_0x6d43('0x40')](_0x220263[_0x6d43('0x2c')]);_0x50b349[_0x6d43('0x2d')]=_[_0x6d43('0x2e')](_0x50b349[_0x6d43('0x2b')],_0x50b349[_0x6d43('0x2c')]);_0x44ae23[_0x6d43('0x30')]=_[_0x6d43('0x2e')](_0x50b349[_0x6d43('0x2b')],qs[_0x6d43('0x2f')](_0x220263[_0x6d43('0x2c')][_0x6d43('0x2f')]));_0x44ae23[_0x6d43('0x30')]=_0x44ae23[_0x6d43('0x30')][_0x6d43('0x31')]?_0x44ae23[_0x6d43('0x30')]:_0x50b349['model'];if(_0x220263[_0x6d43('0x2c')][_0x6d43('0x3a')]){_0x44ae23[_0x6d43('0x42')]=[{'all':!![]}];}_0x44ae23=_[_0x6d43('0x37')]({},_0x44ae23,_0x220263[_0x6d43('0x39')]);return db[_0x6d43('0x27')][_0x6d43('0x43')](_0x44ae23)[_0x6d43('0x1f')](handleEntityNotFound(_0x573643,null))[_0x6d43('0x1f')](respondWithResult(_0x573643,null))[_0x6d43('0x3d')](handleError(_0x573643,null));};exports[_0x6d43('0x44')]=function(_0x565dba,_0x2152e5){return db['SquareDetailsReport'][_0x6d43('0x44')](_0x565dba[_0x6d43('0x45')],{})[_0x6d43('0x1f')](respondWithResult(_0x2152e5,0xc9))[_0x6d43('0x3d')](handleError(_0x2152e5,null));};exports[_0x6d43('0x1e')]=function(_0x5f4bbb,_0x5c8ea6){if(_0x5f4bbb['body']['id']){delete _0x5f4bbb[_0x6d43('0x45')]['id'];}return db[_0x6d43('0x27')][_0x6d43('0x43')]({'where':{'id':_0x5f4bbb[_0x6d43('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5c8ea6,null))[_0x6d43('0x1f')](saveUpdates(_0x5f4bbb[_0x6d43('0x45')],null))[_0x6d43('0x1f')](respondWithResult(_0x5c8ea6,null))[_0x6d43('0x3d')](handleError(_0x5c8ea6,null));};exports['destroy']=function(_0x370b56,_0x5c9f6d){return db[_0x6d43('0x27')][_0x6d43('0x43')]({'where':{'id':_0x370b56[_0x6d43('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5c9f6d,null))[_0x6d43('0x1f')](removeEntity(_0x5c9f6d,null))[_0x6d43('0x3d')](handleError(_0x5c9f6d,null));};exports[_0x6d43('0x46')]=function(_0x1e04f2,_0x3176a5){return db[_0x6d43('0x27')][_0x6d43('0x46')]()[_0x6d43('0x1f')](respondWithResult(_0x3176a5,null))[_0x6d43('0x3d')](handleError(_0x3176a5,null));}; \ No newline at end of file +var _0x76e2=['undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x51ab33,_0x71a8a8){var _0x5e1298=function(_0x1bd8cf){while(--_0x1bd8cf){_0x51ab33['push'](_0x51ab33['shift']());}};_0x5e1298(++_0x71a8a8);}(_0x76e2,0x107));var _0x276e=function(_0x40f04d,_0x26bfb3){_0x40f04d=_0x40f04d-0x0;var _0x4063bc=_0x76e2[_0x40f04d];return _0x4063bc;};'use strict';var emlformat=require(_0x276e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x276e('0x1'));var jsonpatch=require(_0x276e('0x2'));var rp=require('request-promise');var moment=require(_0x276e('0x3'));var BPromise=require(_0x276e('0x4'));var Mustache=require(_0x276e('0x5'));var util=require(_0x276e('0x6'));var path=require(_0x276e('0x7'));var sox=require(_0x276e('0x8'));var csv=require(_0x276e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x276e('0xa'));var _=require('lodash');var squel=require(_0x276e('0xb'));var crypto=require('crypto');var jsforce=require(_0x276e('0xc'));var deskjs=require(_0x276e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x276e('0xe'));var Papa=require('papaparse');var Redis=require(_0x276e('0xf'));var authService=require(_0x276e('0x10'));var qs=require(_0x276e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x276e('0x12'));var logger=require(_0x276e('0x13'))(_0x276e('0x14'));var utils=require(_0x276e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x276e('0x16'));var db=require(_0x276e('0x17'))['db'];function respondWithStatusCode(_0x429811,_0x3e33e1){_0x3e33e1=_0x3e33e1||0xcc;return function(_0x78ca48){if(_0x78ca48){return _0x429811[_0x276e('0x18')](_0x3e33e1);}return _0x429811['status'](_0x3e33e1)[_0x276e('0x19')]();};}function respondWithResult(_0x21a6e,_0x4ed964){_0x4ed964=_0x4ed964||0xc8;return function(_0xedb244){if(_0xedb244){return _0x21a6e[_0x276e('0x1a')](_0x4ed964)[_0x276e('0x1b')](_0xedb244);}};}function respondWithFilteredResult(_0x145fa4,_0x57b532){return function(_0x2d93b9){if(_0x2d93b9){var _0x18dd4a=typeof _0x57b532[_0x276e('0x1c')]===_0x276e('0x1d')&&typeof _0x57b532[_0x276e('0x1e')]===_0x276e('0x1d');var _0x3e0784=_0x2d93b9[_0x276e('0x1f')];var _0xd10c96=_0x18dd4a?0x0:_0x57b532[_0x276e('0x1c')];var _0x100824=_0x18dd4a?_0x2d93b9['count']:_0x57b532['offset']+_0x57b532[_0x276e('0x1e')];var _0x517625;if(_0x100824>=_0x3e0784){_0x100824=_0x3e0784;_0x517625=0xc8;}else{_0x517625=0xce;}_0x145fa4[_0x276e('0x1a')](_0x517625);return _0x145fa4['set']('Content-Range',_0xd10c96+'-'+_0x100824+'/'+_0x3e0784)[_0x276e('0x1b')](_0x2d93b9);}return null;};}function patchUpdates(_0x3eaccd){return function(_0x10a2d9){try{jsonpatch[_0x276e('0x20')](_0x10a2d9,_0x3eaccd,!![]);}catch(_0x5bf19f){return BPromise[_0x276e('0x21')](_0x5bf19f);}return _0x10a2d9[_0x276e('0x22')]();};}function saveUpdates(_0x67dd5c,_0x54b6fb){return function(_0x56e4fb){if(_0x56e4fb){return _0x56e4fb[_0x276e('0x23')](_0x67dd5c)[_0x276e('0x24')](function(_0x29a075){return _0x29a075;});}return null;};}function removeEntity(_0x15d57d,_0x2c0894){return function(_0x1930d8){if(_0x1930d8){return _0x1930d8[_0x276e('0x25')]()[_0x276e('0x24')](function(){_0x15d57d[_0x276e('0x1a')](0xcc)[_0x276e('0x19')]();});}};}function handleEntityNotFound(_0x14d9d1,_0x33242c){return function(_0x1faaea){if(!_0x1faaea){_0x14d9d1[_0x276e('0x18')](0x194);}return _0x1faaea;};}function handleError(_0x2c482f,_0x33c161){_0x33c161=_0x33c161||0x1f4;return function(_0x53def5){logger['error'](_0x53def5[_0x276e('0x26')]);if(_0x53def5[_0x276e('0x27')]){delete _0x53def5['name'];}_0x2c482f[_0x276e('0x1a')](_0x33c161)['send'](_0x53def5);};}exports[_0x276e('0x28')]=function(_0xc35ad3,_0x41871a){var _0xc19f44={},_0x1a5b6b={},_0x639eff={'count':0x0,'rows':[]};var _0x3267f1=_[_0x276e('0x29')](db['SquareDetailsReport'][_0x276e('0x2a')],function(_0x38a48a){return{'name':_0x38a48a[_0x276e('0x2b')],'type':_0x38a48a[_0x276e('0x2c')][_0x276e('0x2d')]};});_0x1a5b6b[_0x276e('0x2e')]=_[_0x276e('0x29')](_0x3267f1,'name');_0x1a5b6b[_0x276e('0x2f')]=_[_0x276e('0x30')](_0xc35ad3[_0x276e('0x2f')]);_0x1a5b6b[_0x276e('0x31')]=_[_0x276e('0x32')](_0x1a5b6b[_0x276e('0x2e')],_0x1a5b6b[_0x276e('0x2f')]);_0xc19f44[_0x276e('0x33')]=_[_0x276e('0x32')](_0x1a5b6b['model'],qs[_0x276e('0x34')](_0xc35ad3[_0x276e('0x2f')][_0x276e('0x34')]));_0xc19f44[_0x276e('0x33')]=_0xc19f44['attributes']['length']?_0xc19f44[_0x276e('0x33')]:_0x1a5b6b[_0x276e('0x2e')];if(!_0xc35ad3['query'][_0x276e('0x35')](_0x276e('0x36'))){_0xc19f44[_0x276e('0x1e')]=qs[_0x276e('0x1e')](_0xc35ad3[_0x276e('0x2f')]['limit']);_0xc19f44[_0x276e('0x1c')]=qs[_0x276e('0x1c')](_0xc35ad3['query'][_0x276e('0x1c')]);}_0xc19f44['order']=qs[_0x276e('0x37')](_0xc35ad3[_0x276e('0x2f')][_0x276e('0x37')]);_0xc19f44[_0x276e('0x38')]=qs[_0x276e('0x31')](_[_0x276e('0x39')](_0xc35ad3[_0x276e('0x2f')],_0x1a5b6b['filters']),_0x3267f1);if(_0xc35ad3[_0x276e('0x2f')][_0x276e('0x3a')]){_0xc19f44[_0x276e('0x38')]=_[_0x276e('0x3b')](_0xc19f44[_0x276e('0x38')],{'$or':_[_0x276e('0x29')](_0x3267f1,function(_0x467db2){if(_0x467db2['type']!==_0x276e('0x3c')){var _0x59fc8d={};_0x59fc8d[_0x467db2[_0x276e('0x27')]]={'$like':'%'+_0xc35ad3[_0x276e('0x2f')]['filter']+'%'};return _0x59fc8d;}})});}_0xc19f44=_['merge']({},_0xc19f44,_0xc35ad3[_0x276e('0x3d')]);var _0x3ff9d1={'where':_0xc19f44[_0x276e('0x38')]};return db[_0x276e('0x3e')][_0x276e('0x1f')](_0x3ff9d1)[_0x276e('0x24')](function(_0x185b5e){_0x639eff[_0x276e('0x1f')]=_0x185b5e;if(_0xc35ad3[_0x276e('0x2f')]['includeAll']){_0xc19f44[_0x276e('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x276e('0x40')](_0xc19f44);})[_0x276e('0x24')](function(_0x453561){_0x639eff[_0x276e('0x41')]=_0x453561;return _0x639eff;})[_0x276e('0x24')](respondWithFilteredResult(_0x41871a,_0xc19f44))[_0x276e('0x42')](handleError(_0x41871a,null));};exports['show']=function(_0x41b0e0,_0x182389){var _0xd26582={'raw':!![],'where':{'id':_0x41b0e0[_0x276e('0x43')]['id']}},_0x2656b3={};_0x2656b3[_0x276e('0x2e')]=_[_0x276e('0x30')](db[_0x276e('0x3e')][_0x276e('0x2a')]);_0x2656b3['query']=_['keys'](_0x41b0e0[_0x276e('0x2f')]);_0x2656b3[_0x276e('0x31')]=_[_0x276e('0x32')](_0x2656b3[_0x276e('0x2e')],_0x2656b3['query']);_0xd26582[_0x276e('0x33')]=_['intersection'](_0x2656b3['model'],qs[_0x276e('0x34')](_0x41b0e0[_0x276e('0x2f')][_0x276e('0x34')]));_0xd26582[_0x276e('0x33')]=_0xd26582[_0x276e('0x33')][_0x276e('0x44')]?_0xd26582[_0x276e('0x33')]:_0x2656b3[_0x276e('0x2e')];if(_0x41b0e0['query']['includeAll']){_0xd26582['include']=[{'all':!![]}];}_0xd26582=_[_0x276e('0x3b')]({},_0xd26582,_0x41b0e0[_0x276e('0x3d')]);return db[_0x276e('0x3e')][_0x276e('0x45')](_0xd26582)[_0x276e('0x24')](handleEntityNotFound(_0x182389,null))[_0x276e('0x24')](respondWithResult(_0x182389,null))[_0x276e('0x42')](handleError(_0x182389,null));};exports[_0x276e('0x46')]=function(_0x6138d8,_0x223b54){return db['SquareDetailsReport'][_0x276e('0x46')](_0x6138d8[_0x276e('0x47')],{})[_0x276e('0x24')](respondWithResult(_0x223b54,0xc9))['catch'](handleError(_0x223b54,null));};exports['update']=function(_0x2cb17c,_0x72a117){if(_0x2cb17c[_0x276e('0x47')]['id']){delete _0x2cb17c[_0x276e('0x47')]['id'];}return db['SquareDetailsReport'][_0x276e('0x45')]({'where':{'id':_0x2cb17c['params']['id']}})[_0x276e('0x24')](handleEntityNotFound(_0x72a117,null))[_0x276e('0x24')](saveUpdates(_0x2cb17c[_0x276e('0x47')],null))['then'](respondWithResult(_0x72a117,null))[_0x276e('0x42')](handleError(_0x72a117,null));};exports[_0x276e('0x25')]=function(_0x3d2867,_0x4344e1){return db['SquareDetailsReport']['find']({'where':{'id':_0x3d2867[_0x276e('0x43')]['id']}})['then'](handleEntityNotFound(_0x4344e1,null))['then'](removeEntity(_0x4344e1,null))[_0x276e('0x42')](handleError(_0x4344e1,null));};exports[_0x276e('0x48')]=function(_0x3efe36,_0x563315){return db[_0x276e('0x3e')][_0x276e('0x48')]()[_0x276e('0x24')](respondWithResult(_0x563315,null))['catch'](handleError(_0x563315,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 36ceeb0..a1084e8 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 _0x6ba3=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','lodash'];(function(_0x3c34ee,_0x52fd4e){var _0x1da140=function(_0x60a9f4){while(--_0x60a9f4){_0x3c34ee['push'](_0x3c34ee['shift']());}};_0x1da140(++_0x52fd4e);}(_0x6ba3,0x15f));var _0x36ba=function(_0x45416a,_0x50d3ec){_0x45416a=_0x45416a-0x0;var _0x5c24f3=_0x6ba3[_0x45416a];return _0x5c24f3;};'use strict';var _=require(_0x36ba('0x0'));var util=require(_0x36ba('0x1'));var logger=require(_0x36ba('0x2'))(_0x36ba('0x3'));var moment=require('moment');var BPromise=require(_0x36ba('0x4'));var rp=require(_0x36ba('0x5'));var fs=require('fs');var path=require(_0x36ba('0x6'));var rimraf=require('rimraf');var config=require(_0x36ba('0x7'));var attributes=require(_0x36ba('0x8'));module[_0x36ba('0x9')]=function(_0x5c8936,_0x3b1b3c){return _0x5c8936['define'](_0x36ba('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e81=['bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','util','../../config/logger','api','moment'];(function(_0xf79bd7,_0x56c2a1){var _0x8d016f=function(_0x152068){while(--_0x152068){_0xf79bd7['push'](_0xf79bd7['shift']());}};_0x8d016f(++_0x56c2a1);}(_0x3e81,0x1a9));var _0x13e8=function(_0x2cefd6,_0x320d0b){_0x2cefd6=_0x2cefd6-0x0;var _0x56d9ea=_0x3e81[_0x2cefd6];return _0x56d9ea;};'use strict';var _=require('lodash');var util=require(_0x13e8('0x0'));var logger=require(_0x13e8('0x1'))(_0x13e8('0x2'));var moment=require(_0x13e8('0x3'));var BPromise=require(_0x13e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13e8('0x5'));var rimraf=require(_0x13e8('0x6'));var config=require(_0x13e8('0x7'));var attributes=require(_0x13e8('0x8'));module[_0x13e8('0x9')]=function(_0x22b606,_0x6fe334){return _0x22b606[_0x13e8('0xa')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 7a549ef..02a61d8 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 _0x282b=['../../config/environment','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x282b,0xec));var _0xb282=function(_0x3db06d,_0xdf5490){_0x3db06d=_0x3db06d-0x0;var _0x3c6e1e=_0x282b[_0x3db06d];return _0x3c6e1e;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33635f,_0x4f0410,_0x4a0d28){return new BPromise(function(_0x17fba1,_0x436eaa){return client['request'](_0x33635f,_0x4a0d28)[_0xb282('0xb')](function(_0x20f517){logger[_0xb282('0xc')](_0xb282('0xd'),_0x4f0410,'request\x20sent');logger['debug'](_0xb282('0xe'),_0x4f0410,_0xb282('0xf'),JSON[_0xb282('0x10')](_0x20f517));if(_0x20f517[_0xb282('0x11')]){if(_0x20f517[_0xb282('0x11')]['code']===0x1f4){logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);return _0x436eaa(_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);}logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517['error'][_0xb282('0x12')]);return _0x17fba1(_0x20f517[_0xb282('0x11')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x4f0410,_0xb282('0xf'));_0x17fba1(_0x20f517[_0xb282('0x13')][_0xb282('0x12')]);}})[_0xb282('0x14')](function(_0x438a05){logger['error'](_0xb282('0xd'),_0x4f0410,_0x438a05);_0x436eaa(_0x438a05);});});}exports[_0xb282('0x15')]=function(_0xca5f12){var _0x45b070=this;return new Promise(function(_0x3f8a3f,_0x492d20){return db['SquareDetailsReport'][_0xb282('0x16')](_0xca5f12[_0xb282('0x17')],{'raw':_0xca5f12['options']?_0xca5f12[_0xb282('0x18')][_0xb282('0x19')]===undefined?!![]:![]:!![]})[_0xb282('0xb')](function(_0x438dbe){logger[_0xb282('0xc')]('CreateSquareDetailsReport',_0xca5f12);logger[_0xb282('0x1a')](_0xb282('0x15'),_0xca5f12,JSON[_0xb282('0x10')](_0x438dbe));_0x3f8a3f(_0x438dbe);})['catch'](function(_0x437d66){logger[_0xb282('0x11')](_0xb282('0x15'),_0x437d66[_0xb282('0x12')],_0xca5f12);_0x492d20(_0x45b070[_0xb282('0x11')](0x1f4,_0x437d66['message']));});});}; \ No newline at end of file +var _0xd523=['jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x58c299,_0x35e6bc){var _0x2763dc=function(_0x13dca8){while(--_0x13dca8){_0x58c299['push'](_0x58c299['shift']());}};_0x2763dc(++_0x35e6bc);}(_0xd523,0x153));var _0x3d52=function(_0x1fff63,_0xc9abad){_0x1fff63=_0x1fff63-0x0;var _0xd93023=_0xd523[_0x1fff63];return _0xd93023;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require(_0x3d52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d52('0x4'));var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require('../../config/logger')(_0x3d52('0x7'));var config=require(_0x3d52('0x8'));var jayson=require(_0x3d52('0x9'));var client=jayson[_0x3d52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fcc92,_0x189147,_0x2f3ebc){return new BPromise(function(_0x232bd4,_0x2e03c0){return client[_0x3d52('0xb')](_0x4fcc92,_0x2f3ebc)[_0x3d52('0xc')](function(_0x34c184){logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,'request\x20sent');logger[_0x3d52('0xf')](_0x3d52('0x10'),_0x189147,_0x3d52('0x11'),JSON[_0x3d52('0x12')](_0x34c184));if(_0x34c184[_0x3d52('0x13')]){if(_0x34c184['error'][_0x3d52('0x14')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x2e03c0(_0x34c184['error']['message']);}logger['error'](_0x3d52('0xe'),_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x232bd4(_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);}else{logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,_0x3d52('0x11'));_0x232bd4(_0x34c184[_0x3d52('0x16')][_0x3d52('0x15')]);}})[_0x3d52('0x17')](function(_0x15cc02){logger[_0x3d52('0x13')](_0x3d52('0xe'),_0x189147,_0x15cc02);_0x2e03c0(_0x15cc02);});});}exports[_0x3d52('0x18')]=function(_0x5bce9a){var _0x163d88=this;return new Promise(function(_0x3b3451,_0x386cdb){return db['SquareDetailsReport'][_0x3d52('0x19')](_0x5bce9a[_0x3d52('0x1a')],{'raw':_0x5bce9a[_0x3d52('0x1b')]?_0x5bce9a['options'][_0x3d52('0x1c')]===undefined?!![]:![]:!![]})[_0x3d52('0xc')](function(_0x1163c5){logger[_0x3d52('0xd')](_0x3d52('0x18'),_0x5bce9a);logger[_0x3d52('0xf')](_0x3d52('0x18'),_0x5bce9a,JSON[_0x3d52('0x12')](_0x1163c5));_0x3b3451(_0x1163c5);})['catch'](function(_0x419c05){logger[_0x3d52('0x13')](_0x3d52('0x18'),_0x419c05['message'],_0x5bce9a);_0x386cdb(_0x163d88[_0x3d52('0x13')](0x1f4,_0x419c05[_0x3d52('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 766b8d4..bbf2be7 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 _0x6c27=['/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c27,0xa3));var _0x76c2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6c27[_0x19950b];return _0x3c6b41;};'use strict';var express=require(_0x76c2('0x0'));var router=express[_0x76c2('0x1')]();var auth=require(_0x76c2('0x2'));var controller=require(_0x76c2('0x3'));router[_0x76c2('0x4')]('/',auth[_0x76c2('0x5')](),controller[_0x76c2('0x6')]);router['get'](_0x76c2('0x7'),auth['isAuthenticated'](),controller[_0x76c2('0x8')]);module[_0x76c2('0x9')]=router; \ No newline at end of file +var _0xaa7c=['../../components/auth/service','./system.controller','get','isAuthenticated','exports','express'];(function(_0xb935ec,_0x2e217e){var _0x309513=function(_0x20339f){while(--_0x20339f){_0xb935ec['push'](_0xb935ec['shift']());}};_0x309513(++_0x2e217e);}(_0xaa7c,0x7d));var _0xcaa7=function(_0x363f5d,_0x166886){_0x363f5d=_0x363f5d-0x0;var _0x2e41a8=_0xaa7c[_0x363f5d];return _0x2e41a8;};'use strict';var express=require(_0xcaa7('0x0'));var router=express['Router']();var auth=require(_0xcaa7('0x1'));var controller=require(_0xcaa7('0x2'));router[_0xcaa7('0x3')]('/',auth[_0xcaa7('0x4')](),controller['index']);router[_0xcaa7('0x3')]('/process/:pid/kill',auth['isAuthenticated'](),controller['killProcess']);module[_0xcaa7('0x5')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index fb888ff..c80bccc 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 _0xac75=['components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','then','split','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process','exec','api','bluebird','lodash','inspect','name','status','send','index','getAllData','json','catch'];(function(_0x281678,_0x1dd450){var _0x5c9ac8=function(_0xdb3716){while(--_0xdb3716){_0x281678['push'](_0x281678['shift']());}};_0x5c9ac8(++_0x1dd450);}(_0xac75,0xd4));var _0x5ac7=function(_0x30443f,_0x179887){_0x30443f=_0x30443f-0x0;var _0x300854=_0xac75[_0x30443f];return _0x300854;};'use strict';var info=require('systeminformation');var exec=require(_0x5ac7('0x0'))[_0x5ac7('0x1')];var logger=require('../../config/logger')(_0x5ac7('0x2'));var util=require('util');var BPromise=require(_0x5ac7('0x3'));var _=require(_0x5ac7('0x4'));function handleError(_0x61d439,_0x419d86,_0x2afd37){_0x419d86=_0x419d86||0x1f4;return function(_0x157ef3){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x2afd37,_0x419d86,util[_0x5ac7('0x5')](_0x157ef3,{'showHidden':![],'depth':null}));delete _0x157ef3[_0x5ac7('0x6')];_0x61d439[_0x5ac7('0x7')](_0x419d86)[_0x5ac7('0x8')](_0x157ef3);};}exports[_0x5ac7('0x9')]=function(_0x47771f,_0x5b9b93){return info[_0x5ac7('0xa')]()['then'](function(_0x550930){return _0x5b9b93['status'](0xc8)[_0x5ac7('0xb')](_0x550930);})[_0x5ac7('0xc')](function(_0x2cf407){return _0x5b9b93[_0x5ac7('0x7')](0x1f4)['json'](_0x2cf407);});};exports['killProcess']=function(_0x40c0bd,_0x25d347){var _0x25632e=[_0x5ac7('0xd')];return new BPromise(function(_0x10a383,_0x2f33a2){return exec(util[_0x5ac7('0xe')](_0x5ac7('0xf'),_0x40c0bd['params'][_0x5ac7('0x10')]),function(_0x1135ee,_0x13d0d7,_0x5f5093){if(_0x1135ee){return _0x2f33a2(_0x1135ee);}return _0x10a383(_0x13d0d7);});})[_0x5ac7('0x11')](function(_0x56b52d){var _0x373018=![];var _0x1e1807=_0x56b52d[_0x5ac7('0x12')](/\n/);for(var _0x56bd81=0x0,_0x5e2271=_0x25632e['length'];_0x56bd81<_0x5e2271,_0x373018===![];_0x56bd81+=0x1){if(_0x56b52d['indexOf'](_0x25632e[_0x56bd81])>=0x0){_0x373018=!![];}}if(!_0x373018){throw new Error(util[_0x5ac7('0xe')](_0x5ac7('0x13'),_0x40c0bd[_0x5ac7('0x14')]['pid']));}process[_0x5ac7('0x15')](_0x40c0bd['params']['pid'],_0x5ac7('0x16'));return _0x25d347[_0x5ac7('0x7')](0xc8)[_0x5ac7('0xb')]({'message':util['format'](_0x5ac7('0x17'),_0x40c0bd[_0x5ac7('0x14')]['pid'])});})[_0x5ac7('0xc')](handleError(_0x25d347,null,_0x5ac7('0x18')));}; \ No newline at end of file +var _0xdb06=['killProcess','systeminformation','child_process','error','name','status','send','index','getAllData','then','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb06,0x13c));var _0x6db0=function(_0x2a2ea0,_0x5a6a33){_0x2a2ea0=_0x2a2ea0-0x0;var _0x18f49d=_0xdb06[_0x2a2ea0];return _0x18f49d;};'use strict';var info=require(_0x6db0('0x0'));var exec=require(_0x6db0('0x1'))['exec'];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x470e8c,_0x4be41d,_0x502a85){_0x4be41d=_0x4be41d||0x1f4;return function(_0x5b8a3d){logger[_0x6db0('0x2')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x502a85,_0x4be41d,util['inspect'](_0x5b8a3d,{'showHidden':![],'depth':null}));delete _0x5b8a3d[_0x6db0('0x3')];_0x470e8c[_0x6db0('0x4')](_0x4be41d)[_0x6db0('0x5')](_0x5b8a3d);};}exports[_0x6db0('0x6')]=function(_0x6d5995,_0x3904da){return info[_0x6db0('0x7')]()[_0x6db0('0x8')](function(_0x31d6d8){return _0x3904da['status'](0xc8)[_0x6db0('0x9')](_0x31d6d8);})[_0x6db0('0xa')](function(_0x519f70){return _0x3904da[_0x6db0('0x4')](0x1f4)['json'](_0x519f70);});};exports['killProcess']=function(_0x2c967a,_0x494ac6){var _0x24f675=[_0x6db0('0xb')];return new BPromise(function(_0xf11c43,_0x359eb3){return exec(util['format'](_0x6db0('0xc'),_0x2c967a[_0x6db0('0xd')]['pid']),function(_0x540bf1,_0x3ef758,_0x388788){if(_0x540bf1){return _0x359eb3(_0x540bf1);}return _0xf11c43(_0x3ef758);});})[_0x6db0('0x8')](function(_0x12bc5f){var _0x57e31e=![];var _0xcb3022=_0x12bc5f[_0x6db0('0xe')](/\n/);for(var _0x47f066=0x0,_0x3059c5=_0x24f675['length'];_0x47f066<_0x3059c5,_0x57e31e===![];_0x47f066+=0x1){if(_0x12bc5f[_0x6db0('0xf')](_0x24f675[_0x47f066])>=0x0){_0x57e31e=!![];}}if(!_0x57e31e){throw new Error(util[_0x6db0('0x10')](_0x6db0('0x11'),_0x2c967a[_0x6db0('0xd')][_0x6db0('0x12')]));}process[_0x6db0('0x13')](_0x2c967a[_0x6db0('0xd')][_0x6db0('0x12')],'SIGINT');return _0x494ac6[_0x6db0('0x4')](0xc8)['json']({'message':util[_0x6db0('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x2c967a[_0x6db0('0xd')][_0x6db0('0x12')])});})['catch'](handleError(_0x494ac6,null,_0x6db0('0x14')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 3b6c63f..8610e03 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 _0x5d7b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','show','post','/:id','multer','util','path','connect-timeout'];(function(_0x426410,_0x38574b){var _0x100281=function(_0x642f1a){while(--_0x642f1a){_0x426410['push'](_0x426410['shift']());}};_0x100281(++_0x38574b);}(_0x5d7b,0xfb));var _0xb5d7=function(_0x15b78c,_0x364a98){_0x15b78c=_0x15b78c-0x0;var _0x46804e=_0x5d7b[_0x15b78c];return _0x46804e;};'use strict';var multer=require(_0xb5d7('0x0'));var util=require(_0xb5d7('0x1'));var path=require(_0xb5d7('0x2'));var timeout=require(_0xb5d7('0x3'));var express=require(_0xb5d7('0x4'));var router=express[_0xb5d7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb5d7('0x6'));var interaction=require(_0xb5d7('0x7'));var config=require(_0xb5d7('0x8'));var controller=require(_0xb5d7('0x9'));router[_0xb5d7('0xa')]('/',auth[_0xb5d7('0xb')](),controller['index']);router[_0xb5d7('0xa')]('/:id',auth[_0xb5d7('0xb')](),controller[_0xb5d7('0xc')]);router[_0xb5d7('0xd')]('/',auth[_0xb5d7('0xb')](),controller['create']);router['put'](_0xb5d7('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb5d7('0xe'),auth[_0xb5d7('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4074=['create','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','/:id','isAuthenticated','show','post'];(function(_0xb460c3,_0x526b34){var _0x23f75b=function(_0xcc9d3){while(--_0xcc9d3){_0xb460c3['push'](_0xb460c3['shift']());}};_0x23f75b(++_0x526b34);}(_0x4074,0x1b4));var _0x4407=function(_0x4a8733,_0x21b30c){_0x4a8733=_0x4a8733-0x0;var _0x52b67b=_0x4074[_0x4a8733];return _0x52b67b;};'use strict';var multer=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var path=require(_0x4407('0x2'));var timeout=require(_0x4407('0x3'));var express=require(_0x4407('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4407('0x5'));var interaction=require(_0x4407('0x6'));var config=require(_0x4407('0x7'));var controller=require(_0x4407('0x8'));router[_0x4407('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4407('0x9')](_0x4407('0xa'),auth[_0x4407('0xb')](),controller[_0x4407('0xc')]);router[_0x4407('0xd')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0xe')]);router[_0x4407('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4407('0x10')]);router['delete']('/:id',auth[_0x4407('0xb')](),controller[_0x4407('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index f3d362d..87635ae 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 _0xf603=['exports','STRING','#0091EA','sequelize'];(function(_0x1bffc9,_0x505bf0){var _0x26177e=function(_0x586707){while(--_0x586707){_0x1bffc9['push'](_0x1bffc9['shift']());}};_0x26177e(++_0x505bf0);}(_0xf603,0xeb));var _0x3f60=function(_0x2d29ac,_0x317a42){_0x2d29ac=_0x2d29ac-0x0;var _0x10d461=_0xf603[_0x2d29ac];return _0x10d461;};'use strict';var Sequelize=require(_0x3f60('0x0'));module[_0x3f60('0x1')]={'name':{'type':Sequelize[_0x3f60('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3f60('0x2')],'defaultValue':_0x3f60('0x3')},'description':{'type':Sequelize[_0x3f60('0x2')]}}; \ No newline at end of file +var _0x9458=['STRING','#0091EA'];(function(_0x5a43b8,_0x2e0eb2){var _0x26eeef=function(_0x4b1451){while(--_0x4b1451){_0x5a43b8['push'](_0x5a43b8['shift']());}};_0x26eeef(++_0x2e0eb2);}(_0x9458,0x1b8));var _0x8945=function(_0x1cd52d,_0x2b3bb5){_0x1cd52d=_0x1cd52d-0x0;var _0x7b5de1=_0x9458[_0x1cd52d];return _0x7b5de1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8945('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x8945('0x1')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index ccc18d9..0944a43 100644 --- a/server/api/tag/tag.controller.js +++ b/server/api/tag/tag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2504=['update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','map','Tag','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','where','merge','VIRTUAL','filter','findAll','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x2504,0xee));var _0x4250=function(_0x320db3,_0x2cd626){_0x320db3=_0x320db3-0x0;var _0x5da675=_0x2504[_0x320db3];return _0x5da675;};'use strict';var emlformat=require(_0x4250('0x0'));var rimraf=require(_0x4250('0x1'));var zipdir=require(_0x4250('0x2'));var jsonpatch=require(_0x4250('0x3'));var rp=require(_0x4250('0x4'));var moment=require(_0x4250('0x5'));var BPromise=require(_0x4250('0x6'));var Mustache=require(_0x4250('0x7'));var util=require(_0x4250('0x8'));var path=require(_0x4250('0x9'));var sox=require(_0x4250('0xa'));var csv=require(_0x4250('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4250('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4250('0xd'));var jsforce=require(_0x4250('0xe'));var deskjs=require(_0x4250('0xf'));var toCsv=require(_0x4250('0xb'));var querystring=require(_0x4250('0x10'));var Papa=require('papaparse');var Redis=require(_0x4250('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4250('0x12'));var as=require(_0x4250('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4250('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4250('0x15'));var licenseUtil=require(_0x4250('0x16'));var db=require(_0x4250('0x17'))['db'];function respondWithStatusCode(_0x3c1e7e,_0x2a496b){_0x2a496b=_0x2a496b||0xcc;return function(_0x5d62a0){if(_0x5d62a0){return _0x3c1e7e[_0x4250('0x18')](_0x2a496b);}return _0x3c1e7e[_0x4250('0x19')](_0x2a496b)[_0x4250('0x1a')]();};}function respondWithResult(_0x2c8a75,_0xfa4d8a){_0xfa4d8a=_0xfa4d8a||0xc8;return function(_0x33f317){if(_0x33f317){return _0x2c8a75['status'](_0xfa4d8a)[_0x4250('0x1b')](_0x33f317);}};}function respondWithFilteredResult(_0x46ba15,_0x1b0c66){return function(_0x3cff02){if(_0x3cff02){var _0x2979cd=typeof _0x1b0c66[_0x4250('0x1c')]===_0x4250('0x1d')&&typeof _0x1b0c66['limit']===_0x4250('0x1d');var _0x35d232=_0x3cff02[_0x4250('0x1e')];var _0x17a8a9=_0x2979cd?0x0:_0x1b0c66[_0x4250('0x1c')];var _0x30e48c=_0x2979cd?_0x3cff02[_0x4250('0x1e')]:_0x1b0c66['offset']+_0x1b0c66[_0x4250('0x1f')];var _0x4f0154;if(_0x30e48c>=_0x35d232){_0x30e48c=_0x35d232;_0x4f0154=0xc8;}else{_0x4f0154=0xce;}_0x46ba15['status'](_0x4f0154);return _0x46ba15[_0x4250('0x20')](_0x4250('0x21'),_0x17a8a9+'-'+_0x30e48c+'/'+_0x35d232)[_0x4250('0x1b')](_0x3cff02);}return null;};}function patchUpdates(_0x42c331){return function(_0x242cf1){try{jsonpatch[_0x4250('0x22')](_0x242cf1,_0x42c331,!![]);}catch(_0x1ba772){return BPromise[_0x4250('0x23')](_0x1ba772);}return _0x242cf1[_0x4250('0x24')]();};}function saveUpdates(_0x3818c0,_0x728862){return function(_0x30e2ae){if(_0x30e2ae){return _0x30e2ae['update'](_0x3818c0)[_0x4250('0x25')](function(_0x171df4){return _0x171df4;});}return null;};}function removeEntity(_0x1feb98,_0x523053){return function(_0x5d1a74){if(_0x5d1a74){return _0x5d1a74[_0x4250('0x26')]()[_0x4250('0x25')](function(){var _0x1c1294=_0x5d1a74[_0x4250('0x27')]({'plain':!![]});var _0x328ffb='Tags';return db[_0x4250('0x28')][_0x4250('0x26')]({'where':{'type':_0x328ffb,'resourceId':_0x1c1294['id']}})[_0x4250('0x25')](function(){return _0x5d1a74;});})['then'](function(){_0x1feb98['status'](0xcc)[_0x4250('0x1a')]();});}};}function handleEntityNotFound(_0x5d0fa2,_0x3e8b4d){return function(_0x1c4fa5){if(!_0x1c4fa5){_0x5d0fa2[_0x4250('0x18')](0x194);}return _0x1c4fa5;};}function handleError(_0x2cdfdf,_0xb82299){_0xb82299=_0xb82299||0x1f4;return function(_0x501c5f){logger[_0x4250('0x29')](_0x501c5f[_0x4250('0x2a')]);if(_0x501c5f['name']){delete _0x501c5f[_0x4250('0x2b')];}_0x2cdfdf['status'](_0xb82299)[_0x4250('0x2c')](_0x501c5f);};}exports['index']=function(_0x5e0fe6,_0xea7ccc){var _0x5f20d5={},_0x16b8a4={},_0x281be9={'count':0x0,'rows':[]};var _0x4bed2b=_[_0x4250('0x2d')](db[_0x4250('0x2e')]['rawAttributes'],function(_0x217188){return{'name':_0x217188[_0x4250('0x2f')],'type':_0x217188['type'][_0x4250('0x30')]};});_0x16b8a4[_0x4250('0x31')]=_[_0x4250('0x2d')](_0x4bed2b,_0x4250('0x2b'));_0x16b8a4[_0x4250('0x32')]=_[_0x4250('0x33')](_0x5e0fe6[_0x4250('0x32')]);_0x16b8a4[_0x4250('0x34')]=_[_0x4250('0x35')](_0x16b8a4[_0x4250('0x31')],_0x16b8a4[_0x4250('0x32')]);_0x5f20d5[_0x4250('0x36')]=_[_0x4250('0x35')](_0x16b8a4['model'],qs[_0x4250('0x37')](_0x5e0fe6['query'][_0x4250('0x37')]));_0x5f20d5[_0x4250('0x36')]=_0x5f20d5['attributes'][_0x4250('0x38')]?_0x5f20d5[_0x4250('0x36')]:_0x16b8a4[_0x4250('0x31')];if(!_0x5e0fe6[_0x4250('0x32')]['hasOwnProperty']('nolimit')){_0x5f20d5['limit']=qs[_0x4250('0x1f')](_0x5e0fe6[_0x4250('0x32')]['limit']);_0x5f20d5[_0x4250('0x1c')]=qs[_0x4250('0x1c')](_0x5e0fe6[_0x4250('0x32')][_0x4250('0x1c')]);}_0x5f20d5[_0x4250('0x39')]=qs['sort'](_0x5e0fe6[_0x4250('0x32')]['sort']);_0x5f20d5['where']=qs[_0x4250('0x34')](_['pick'](_0x5e0fe6[_0x4250('0x32')],_0x16b8a4[_0x4250('0x34')]),_0x4bed2b);if(_0x5e0fe6[_0x4250('0x32')]['filter']){_0x5f20d5[_0x4250('0x3a')]=_[_0x4250('0x3b')](_0x5f20d5[_0x4250('0x3a')],{'$or':_[_0x4250('0x2d')](_0x4bed2b,function(_0x3bcdbf){if(_0x3bcdbf['type']!==_0x4250('0x3c')){var _0x1d8459={};_0x1d8459[_0x3bcdbf[_0x4250('0x2b')]]={'$like':'%'+_0x5e0fe6[_0x4250('0x32')][_0x4250('0x3d')]+'%'};return _0x1d8459;}})});}_0x5f20d5=_[_0x4250('0x3b')]({},_0x5f20d5,_0x5e0fe6['options']);var _0x3a340a={'where':_0x5f20d5['where']};return db[_0x4250('0x2e')][_0x4250('0x1e')](_0x3a340a)[_0x4250('0x25')](function(_0x2a10b9){_0x281be9[_0x4250('0x1e')]=_0x2a10b9;if(_0x5e0fe6[_0x4250('0x32')]['includeAll']){_0x5f20d5['include']=[{'all':!![]}];}return db['Tag'][_0x4250('0x3e')](_0x5f20d5);})[_0x4250('0x25')](function(_0x2e4a22){_0x281be9['rows']=_0x2e4a22;return _0x281be9;})[_0x4250('0x25')](respondWithFilteredResult(_0xea7ccc,_0x5f20d5))[_0x4250('0x3f')](handleError(_0xea7ccc,null));};exports[_0x4250('0x40')]=function(_0x53fb93,_0x100727){var _0x307d2c={'raw':!![],'where':{'id':_0x53fb93[_0x4250('0x41')]['id']}},_0x366cb7={};_0x366cb7['model']=_['keys'](db[_0x4250('0x2e')][_0x4250('0x42')]);_0x366cb7[_0x4250('0x32')]=_[_0x4250('0x33')](_0x53fb93[_0x4250('0x32')]);_0x366cb7['filters']=_[_0x4250('0x35')](_0x366cb7['model'],_0x366cb7[_0x4250('0x32')]);_0x307d2c[_0x4250('0x36')]=_[_0x4250('0x35')](_0x366cb7['model'],qs[_0x4250('0x37')](_0x53fb93[_0x4250('0x32')][_0x4250('0x37')]));_0x307d2c['attributes']=_0x307d2c['attributes']['length']?_0x307d2c[_0x4250('0x36')]:_0x366cb7[_0x4250('0x31')];if(_0x53fb93[_0x4250('0x32')][_0x4250('0x43')]){_0x307d2c[_0x4250('0x44')]=[{'all':!![]}];}_0x307d2c=_[_0x4250('0x3b')]({},_0x307d2c,_0x53fb93['options']);return db[_0x4250('0x2e')][_0x4250('0x45')](_0x307d2c)[_0x4250('0x25')](handleEntityNotFound(_0x100727,null))['then'](respondWithResult(_0x100727,null))[_0x4250('0x3f')](handleError(_0x100727,null));};exports['create']=function(_0x5895ea,_0x2e0d9d){return db[_0x4250('0x2e')][_0x4250('0x46')](_0x5895ea[_0x4250('0x47')],{})[_0x4250('0x25')](function(_0x34d672){var _0x59d51a=_0x5895ea[_0x4250('0x48')]['get']({'plain':!![]});if(!_0x59d51a)throw new Error(_0x4250('0x49'));if(_0x59d51a[_0x4250('0x4a')]===_0x4250('0x48')){var _0x544048=_0x34d672[_0x4250('0x27')]({'plain':!![]});var _0x440aa4='Tags';return db['UserProfileSection']['find']({'where':{'name':_0x440aa4,'userProfileId':_0x59d51a[_0x4250('0x4b')]},'raw':!![]})['then'](function(_0x4e3158){if(_0x4e3158&&_0x4e3158[_0x4250('0x4c')]===0x0){return db[_0x4250('0x28')][_0x4250('0x46')]({'name':_0x544048[_0x4250('0x2b')],'resourceId':_0x544048['id'],'type':_0x4e3158[_0x4250('0x2b')],'sectionId':_0x4e3158['id']},{})['then'](function(){return _0x34d672;});}else{return _0x34d672;}})[_0x4250('0x3f')](function(_0xb82981){logger[_0x4250('0x29')](_0x4250('0x4d'),_0xb82981);throw _0xb82981;});}return _0x34d672;})['then'](respondWithResult(_0x2e0d9d,0xc9))[_0x4250('0x3f')](handleError(_0x2e0d9d,null));};exports[_0x4250('0x4e')]=function(_0x59efc0,_0xc7ba0){if(_0x59efc0[_0x4250('0x47')]['id']){delete _0x59efc0['body']['id'];}return db[_0x4250('0x2e')][_0x4250('0x45')]({'where':{'id':_0x59efc0[_0x4250('0x41')]['id']}})[_0x4250('0x25')](handleEntityNotFound(_0xc7ba0,null))[_0x4250('0x25')](saveUpdates(_0x59efc0[_0x4250('0x47')],null))[_0x4250('0x25')](respondWithResult(_0xc7ba0,null))['catch'](handleError(_0xc7ba0,null));};exports[_0x4250('0x26')]=function(_0x39e9f5,_0x6094fb){return db['Tag']['find']({'where':{'id':_0x39e9f5[_0x4250('0x41')]['id']}})[_0x4250('0x25')](handleEntityNotFound(_0x6094fb,null))['then'](removeEntity(_0x6094fb,null))[_0x4250('0x3f')](handleError(_0x6094fb,null));}; \ No newline at end of file +var _0x5178=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5057a0,_0xff7a76){var _0x556c47=function(_0x290ab7){while(--_0x290ab7){_0x5057a0['push'](_0x5057a0['shift']());}};_0x556c47(++_0xff7a76);}(_0x5178,0x171));var _0x8517=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5178[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8517('0x0'));var zipdir=require(_0x8517('0x1'));var jsonpatch=require(_0x8517('0x2'));var rp=require(_0x8517('0x3'));var moment=require(_0x8517('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8517('0x5'));var path=require(_0x8517('0x6'));var sox=require('sox');var csv=require(_0x8517('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8517('0x8'));var _=require(_0x8517('0x9'));var squel=require(_0x8517('0xa'));var crypto=require(_0x8517('0xb'));var jsforce=require(_0x8517('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8517('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8517('0xd'));var authService=require(_0x8517('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8517('0xf'));var hardwareService=require(_0x8517('0x10'));var logger=require(_0x8517('0x11'))(_0x8517('0x12'));var utils=require(_0x8517('0x13'));var config=require(_0x8517('0x14'));var licenseUtil=require(_0x8517('0x15'));var db=require(_0x8517('0x16'))['db'];function respondWithStatusCode(_0x4b9768,_0x9c57de){_0x9c57de=_0x9c57de||0xcc;return function(_0x7f429a){if(_0x7f429a){return _0x4b9768[_0x8517('0x17')](_0x9c57de);}return _0x4b9768[_0x8517('0x18')](_0x9c57de)[_0x8517('0x19')]();};}function respondWithResult(_0x49eba7,_0x385219){_0x385219=_0x385219||0xc8;return function(_0x19dd9d){if(_0x19dd9d){return _0x49eba7[_0x8517('0x18')](_0x385219)[_0x8517('0x1a')](_0x19dd9d);}};}function respondWithFilteredResult(_0x411d29,_0x18a984){return function(_0x260a15){if(_0x260a15){var _0x30cea1=typeof _0x18a984[_0x8517('0x1b')]===_0x8517('0x1c')&&typeof _0x18a984[_0x8517('0x1d')]===_0x8517('0x1c');var _0x50e2de=_0x260a15[_0x8517('0x1e')];var _0x100b76=_0x30cea1?0x0:_0x18a984[_0x8517('0x1b')];var _0xf1b53b=_0x30cea1?_0x260a15[_0x8517('0x1e')]:_0x18a984[_0x8517('0x1b')]+_0x18a984[_0x8517('0x1d')];var _0x5b5408;if(_0xf1b53b>=_0x50e2de){_0xf1b53b=_0x50e2de;_0x5b5408=0xc8;}else{_0x5b5408=0xce;}_0x411d29[_0x8517('0x18')](_0x5b5408);return _0x411d29['set']('Content-Range',_0x100b76+'-'+_0xf1b53b+'/'+_0x50e2de)[_0x8517('0x1a')](_0x260a15);}return null;};}function patchUpdates(_0x157bea){return function(_0xf35d95){try{jsonpatch[_0x8517('0x1f')](_0xf35d95,_0x157bea,!![]);}catch(_0x238d75){return BPromise[_0x8517('0x20')](_0x238d75);}return _0xf35d95['save']();};}function saveUpdates(_0x4b145f,_0x2dd1df){return function(_0x37861d){if(_0x37861d){return _0x37861d[_0x8517('0x21')](_0x4b145f)[_0x8517('0x22')](function(_0x3a5f0b){return _0x3a5f0b;});}return null;};}function removeEntity(_0x2e6e47,_0x5f02ee){return function(_0x181500){if(_0x181500){return _0x181500[_0x8517('0x23')]()['then'](function(){var _0x7f4cf8=_0x181500[_0x8517('0x24')]({'plain':!![]});var _0x42c779='Tags';return db[_0x8517('0x25')]['destroy']({'where':{'type':_0x42c779,'resourceId':_0x7f4cf8['id']}})[_0x8517('0x22')](function(){return _0x181500;});})[_0x8517('0x22')](function(){_0x2e6e47[_0x8517('0x18')](0xcc)[_0x8517('0x19')]();});}};}function handleEntityNotFound(_0x238f2c,_0x300e3f){return function(_0x481ceb){if(!_0x481ceb){_0x238f2c[_0x8517('0x17')](0x194);}return _0x481ceb;};}function handleError(_0x51d516,_0x197aaf){_0x197aaf=_0x197aaf||0x1f4;return function(_0x70ee9d){logger[_0x8517('0x26')](_0x70ee9d[_0x8517('0x27')]);if(_0x70ee9d[_0x8517('0x28')]){delete _0x70ee9d[_0x8517('0x28')];}_0x51d516['status'](_0x197aaf)[_0x8517('0x29')](_0x70ee9d);};}exports['index']=function(_0x3b1928,_0x4b9983){var _0x1dd9fb={},_0x2d360c={},_0x3cf945={'count':0x0,'rows':[]};var _0x14eb04=_[_0x8517('0x2a')](db[_0x8517('0x2b')][_0x8517('0x2c')],function(_0x559707){return{'name':_0x559707[_0x8517('0x2d')],'type':_0x559707[_0x8517('0x2e')][_0x8517('0x2f')]};});_0x2d360c['model']=_['map'](_0x14eb04,'name');_0x2d360c[_0x8517('0x30')]=_[_0x8517('0x31')](_0x3b1928[_0x8517('0x30')]);_0x2d360c[_0x8517('0x32')]=_[_0x8517('0x33')](_0x2d360c[_0x8517('0x34')],_0x2d360c['query']);_0x1dd9fb[_0x8517('0x35')]=_[_0x8517('0x33')](_0x2d360c[_0x8517('0x34')],qs['fields'](_0x3b1928[_0x8517('0x30')]['fields']));_0x1dd9fb[_0x8517('0x35')]=_0x1dd9fb[_0x8517('0x35')]['length']?_0x1dd9fb['attributes']:_0x2d360c[_0x8517('0x34')];if(!_0x3b1928[_0x8517('0x30')][_0x8517('0x36')](_0x8517('0x37'))){_0x1dd9fb['limit']=qs['limit'](_0x3b1928[_0x8517('0x30')][_0x8517('0x1d')]);_0x1dd9fb[_0x8517('0x1b')]=qs['offset'](_0x3b1928[_0x8517('0x30')][_0x8517('0x1b')]);}_0x1dd9fb['order']=qs[_0x8517('0x38')](_0x3b1928[_0x8517('0x30')][_0x8517('0x38')]);_0x1dd9fb[_0x8517('0x39')]=qs['filters'](_[_0x8517('0x3a')](_0x3b1928[_0x8517('0x30')],_0x2d360c[_0x8517('0x32')]),_0x14eb04);if(_0x3b1928[_0x8517('0x30')][_0x8517('0x3b')]){_0x1dd9fb[_0x8517('0x39')]=_[_0x8517('0x3c')](_0x1dd9fb[_0x8517('0x39')],{'$or':_[_0x8517('0x2a')](_0x14eb04,function(_0x183310){if(_0x183310[_0x8517('0x2e')]!==_0x8517('0x3d')){var _0x232e49={};_0x232e49[_0x183310['name']]={'$like':'%'+_0x3b1928['query'][_0x8517('0x3b')]+'%'};return _0x232e49;}})});}_0x1dd9fb=_[_0x8517('0x3c')]({},_0x1dd9fb,_0x3b1928[_0x8517('0x3e')]);var _0x30942f={'where':_0x1dd9fb[_0x8517('0x39')]};return db['Tag'][_0x8517('0x1e')](_0x30942f)[_0x8517('0x22')](function(_0x531ca7){_0x3cf945[_0x8517('0x1e')]=_0x531ca7;if(_0x3b1928[_0x8517('0x30')][_0x8517('0x3f')]){_0x1dd9fb[_0x8517('0x40')]=[{'all':!![]}];}return db['Tag'][_0x8517('0x41')](_0x1dd9fb);})[_0x8517('0x22')](function(_0x5c342c){_0x3cf945[_0x8517('0x42')]=_0x5c342c;return _0x3cf945;})[_0x8517('0x22')](respondWithFilteredResult(_0x4b9983,_0x1dd9fb))[_0x8517('0x43')](handleError(_0x4b9983,null));};exports['show']=function(_0x368bb8,_0x31c0b9){var _0x35adf2={'raw':!![],'where':{'id':_0x368bb8[_0x8517('0x44')]['id']}},_0x404a40={};_0x404a40[_0x8517('0x34')]=_[_0x8517('0x31')](db['Tag'][_0x8517('0x2c')]);_0x404a40[_0x8517('0x30')]=_['keys'](_0x368bb8[_0x8517('0x30')]);_0x404a40[_0x8517('0x32')]=_[_0x8517('0x33')](_0x404a40[_0x8517('0x34')],_0x404a40[_0x8517('0x30')]);_0x35adf2[_0x8517('0x35')]=_['intersection'](_0x404a40[_0x8517('0x34')],qs[_0x8517('0x45')](_0x368bb8[_0x8517('0x30')]['fields']));_0x35adf2[_0x8517('0x35')]=_0x35adf2[_0x8517('0x35')]['length']?_0x35adf2[_0x8517('0x35')]:_0x404a40[_0x8517('0x34')];if(_0x368bb8['query']['includeAll']){_0x35adf2['include']=[{'all':!![]}];}_0x35adf2=_[_0x8517('0x3c')]({},_0x35adf2,_0x368bb8[_0x8517('0x3e')]);return db['Tag'][_0x8517('0x46')](_0x35adf2)['then'](handleEntityNotFound(_0x31c0b9,null))['then'](respondWithResult(_0x31c0b9,null))[_0x8517('0x43')](handleError(_0x31c0b9,null));};exports[_0x8517('0x47')]=function(_0x3c8ecb,_0x6c2607){return db['Tag'][_0x8517('0x47')](_0x3c8ecb[_0x8517('0x48')],{})[_0x8517('0x22')](function(_0x5a6812){var _0x15102f=_0x3c8ecb[_0x8517('0x49')][_0x8517('0x24')]({'plain':!![]});if(!_0x15102f)throw new Error(_0x8517('0x4a'));if(_0x15102f[_0x8517('0x4b')]===_0x8517('0x49')){var _0x3cccd9=_0x5a6812['get']({'plain':!![]});var _0x3a5adb='Tags';return db['UserProfileSection'][_0x8517('0x46')]({'where':{'name':_0x3a5adb,'userProfileId':_0x15102f[_0x8517('0x4c')]},'raw':!![]})[_0x8517('0x22')](function(_0x2d604f){if(_0x2d604f&&_0x2d604f['autoAssociation']===0x0){return db[_0x8517('0x25')][_0x8517('0x47')]({'name':_0x3cccd9['name'],'resourceId':_0x3cccd9['id'],'type':_0x2d604f['name'],'sectionId':_0x2d604f['id']},{})[_0x8517('0x22')](function(){return _0x5a6812;});}else{return _0x5a6812;}})[_0x8517('0x43')](function(_0x28c1fb){logger['error'](_0x8517('0x4d'),_0x28c1fb);throw _0x28c1fb;});}return _0x5a6812;})['then'](respondWithResult(_0x6c2607,0xc9))[_0x8517('0x43')](handleError(_0x6c2607,null));};exports[_0x8517('0x21')]=function(_0x1ba2f,_0x58c98b){if(_0x1ba2f[_0x8517('0x48')]['id']){delete _0x1ba2f[_0x8517('0x48')]['id'];}return db[_0x8517('0x2b')][_0x8517('0x46')]({'where':{'id':_0x1ba2f[_0x8517('0x44')]['id']}})['then'](handleEntityNotFound(_0x58c98b,null))['then'](saveUpdates(_0x1ba2f[_0x8517('0x48')],null))[_0x8517('0x22')](respondWithResult(_0x58c98b,null))[_0x8517('0x43')](handleError(_0x58c98b,null));};exports['destroy']=function(_0x4dcf7b,_0x1ce476){return db[_0x8517('0x2b')]['find']({'where':{'id':_0x4dcf7b['params']['id']}})[_0x8517('0x22')](handleEntityNotFound(_0x1ce476,null))[_0x8517('0x22')](removeEntity(_0x1ce476,null))[_0x8517('0x43')](handleError(_0x1ce476,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6183d7b..b494c46 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 _0xb790=['tools_tags','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xb790,0x1ae));var _0x0b79=function(_0x475bf1,_0x5235b6){_0x475bf1=_0x475bf1-0x0;var _0x4095d1=_0xb790[_0x475bf1];return _0x4095d1;};'use strict';var _=require('lodash');var util=require(_0x0b79('0x0'));var logger=require(_0x0b79('0x1'))(_0x0b79('0x2'));var moment=require(_0x0b79('0x3'));var BPromise=require(_0x0b79('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b79('0x5'));var rimraf=require(_0x0b79('0x6'));var config=require(_0x0b79('0x7'));var attributes=require(_0x0b79('0x8'));module[_0x0b79('0x9')]=function(_0x3d104a,_0x43510f){return _0x3d104a[_0x0b79('0xa')](_0x0b79('0xb'),attributes,{'tableName':_0x0b79('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4793=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','tools_tags','lodash','util','../../config/logger'];(function(_0x42623b,_0x1a5488){var _0x8ae8f2=function(_0x36c76c){while(--_0x36c76c){_0x42623b['push'](_0x42623b['shift']());}};_0x8ae8f2(++_0x1a5488);}(_0x4793,0xb3));var _0x3479=function(_0x54603a,_0x199824){_0x54603a=_0x54603a-0x0;var _0x467b1d=_0x4793[_0x54603a];return _0x467b1d;};'use strict';var _=require(_0x3479('0x0'));var util=require(_0x3479('0x1'));var logger=require(_0x3479('0x2'))(_0x3479('0x3'));var moment=require(_0x3479('0x4'));var BPromise=require(_0x3479('0x5'));var rp=require(_0x3479('0x6'));var fs=require('fs');var path=require(_0x3479('0x7'));var rimraf=require(_0x3479('0x8'));var config=require(_0x3479('0x9'));var attributes=require(_0x3479('0xa'));module[_0x3479('0xb')]=function(_0x13319a,_0x1ac355){return _0x13319a['define']('Tag',attributes,{'tableName':_0x3479('0xc'),'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 09ed1e8..45ae87f 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 _0x5712=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0x5712,0x140));var _0x2571=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5712[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var moment=require(_0x2571('0x2'));var BPromise=require(_0x2571('0x3'));var rs=require(_0x2571('0x4'));var fs=require('fs');var Redis=require(_0x2571('0x5'));var db=require(_0x2571('0x6'))['db'];var utils=require(_0x2571('0x7'));var logger=require(_0x2571('0x8'))(_0x2571('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2571('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e19b2,_0x251ee6,_0x3ca885){return new BPromise(function(_0x204ecc,_0xda659a){return client[_0x2571('0xb')](_0x3e19b2,_0x3ca885)['then'](function(_0x1f0c98){logger['info'](_0x2571('0xc'),_0x251ee6,_0x2571('0xd'));logger[_0x2571('0xe')](_0x2571('0xf'),_0x251ee6,_0x2571('0xd'),JSON[_0x2571('0x10')](_0x1f0c98));if(_0x1f0c98[_0x2571('0x11')]){if(_0x1f0c98[_0x2571('0x11')]['code']===0x1f4){logger['error'](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0xda659a(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0x204ecc(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}else{logger[_0x2571('0x13')]('Tag,\x20%s,\x20%s',_0x251ee6,_0x2571('0xd'));_0x204ecc(_0x1f0c98['result']['message']);}})['catch'](function(_0x4c3e11){logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x4c3e11);_0xda659a(_0x4c3e11);});});} \ No newline at end of file +var _0xbd50=['Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbd50,0x196));var _0x0bd5=function(_0x5ddbb4,_0x550725){_0x5ddbb4=_0x5ddbb4-0x0;var _0x4d6592=_0xbd50[_0x5ddbb4];return _0x4d6592;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e37ebd6..731dcb5 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 14aecdf..a6c1c05 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 _0x757a=['exports','STRING'];(function(_0x1ef447,_0x2b6d60){var _0x319aa9=function(_0xffe7fe){while(--_0xffe7fe){_0x1ef447['push'](_0x1ef447['shift']());}};_0x319aa9(++_0x2b6d60);}(_0x757a,0xde));var _0xa757=function(_0x1236cd,_0x5e5408){_0x1236cd=_0x1236cd-0x0;var _0x34be21=_0x757a[_0x1236cd];return _0x34be21;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xb7e7[_0x42f009];return _0x22a1e0;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 912178a..0625833 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 _0x2326=['remove','addAgents','isArray','Voice','Chat','Mail','Fax','Whatsapp','transaction','through','penalty','findOrCreate','emit','Queue:save','QueueId','User','online','voicePause','interface','UserVoiceQueueRt','upsert','format','TeamVoiceQueue','all','spread','removeAgents','Openchannel','Queue:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','rawAttributes','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','type','merge','options','Team','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','TeamVoicePrefix','VoicePrefixId','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','UserVoicePrefix','Teams','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queues','add','ids','removeQueues'];(function(_0x28ec4b,_0x26ad3c){var _0x331c9e=function(_0x55657b){while(--_0x55657b){_0x28ec4b['push'](_0x28ec4b['shift']());}};_0x331c9e(++_0x26ad3c);}(_0x2326,0x129));var _0x6232=function(_0x302326,_0x4503eb){_0x302326=_0x302326-0x0;var _0xafc351=_0x2326[_0x302326];return _0xafc351;};'use strict';var emlformat=require(_0x6232('0x0'));var rimraf=require(_0x6232('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6232('0x2'));var moment=require(_0x6232('0x3'));var BPromise=require(_0x6232('0x4'));var Mustache=require('mustache');var util=require(_0x6232('0x5'));var path=require(_0x6232('0x6'));var sox=require(_0x6232('0x7'));var csv=require('to-csv');var ejs=require(_0x6232('0x8'));var fs=require('fs');var fs_extra=require(_0x6232('0x9'));var _=require(_0x6232('0xa'));var squel=require('squel');var crypto=require(_0x6232('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6232('0xc'));var querystring=require(_0x6232('0xd'));var Papa=require(_0x6232('0xe'));var Redis=require(_0x6232('0xf'));var authService=require(_0x6232('0x10'));var qs=require(_0x6232('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6232('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6232('0x13'));var config=require(_0x6232('0x14'));var licenseUtil=require(_0x6232('0x15'));var db=require(_0x6232('0x16'))['db'];config[_0x6232('0x17')]=_[_0x6232('0x18')](config[_0x6232('0x17')],{'host':_0x6232('0x19'),'port':0x18eb});var socket=require(_0x6232('0x1a'))(new Redis(config['redis']));require(_0x6232('0x1b'))[_0x6232('0x1c')](socket);function respondWithStatusCode(_0xebc4e,_0x408140){_0x408140=_0x408140||0xcc;return function(_0x1c1ed8){if(_0x1c1ed8){return _0xebc4e[_0x6232('0x1d')](_0x408140);}return _0xebc4e[_0x6232('0x1e')](_0x408140)[_0x6232('0x1f')]();};}function respondWithResult(_0x209624,_0x58b76e){_0x58b76e=_0x58b76e||0xc8;return function(_0x58d06c){if(_0x58d06c){return _0x209624[_0x6232('0x1e')](_0x58b76e)[_0x6232('0x20')](_0x58d06c);}};}function respondWithFilteredResult(_0x40c617,_0x9782ef){return function(_0x120373){if(_0x120373){var _0x162802=typeof _0x9782ef[_0x6232('0x21')]==='undefined'&&typeof _0x9782ef[_0x6232('0x22')]==='undefined';var _0x1869e8=_0x120373[_0x6232('0x23')];var _0x9c0d28=_0x162802?0x0:_0x9782ef[_0x6232('0x21')];var _0x245b0f=_0x162802?_0x120373[_0x6232('0x23')]:_0x9782ef[_0x6232('0x21')]+_0x9782ef[_0x6232('0x22')];var _0x22cd8b;if(_0x245b0f>=_0x1869e8){_0x245b0f=_0x1869e8;_0x22cd8b=0xc8;}else{_0x22cd8b=0xce;}_0x40c617[_0x6232('0x1e')](_0x22cd8b);return _0x40c617['set'](_0x6232('0x24'),_0x9c0d28+'-'+_0x245b0f+'/'+_0x1869e8)[_0x6232('0x20')](_0x120373);}return null;};}function patchUpdates(_0x5f596){return function(_0x14add8){try{jsonpatch[_0x6232('0x25')](_0x14add8,_0x5f596,!![]);}catch(_0x22d2f8){return BPromise[_0x6232('0x26')](_0x22d2f8);}return _0x14add8[_0x6232('0x27')]();};}function saveUpdates(_0x44b7b4,_0x3e1f9e){return function(_0x426ebb){if(_0x426ebb){return _0x426ebb[_0x6232('0x28')](_0x44b7b4)[_0x6232('0x29')](function(_0x3969c6){return _0x3969c6;});}return null;};}function handleEntityNotFound(_0x387a7c,_0x1c0d4b){return function(_0x568c48){if(!_0x568c48){_0x387a7c[_0x6232('0x1d')](0x194);}return _0x568c48;};}function handleError(_0x25ed62,_0x335bee){_0x335bee=_0x335bee||0x1f4;return function(_0x350344){logger[_0x6232('0x2a')](_0x350344['stack']);if(_0x350344[_0x6232('0x2b')]){delete _0x350344[_0x6232('0x2b')];}_0x25ed62[_0x6232('0x1e')](_0x335bee)[_0x6232('0x2c')](_0x350344);};}exports['index']=function(_0x436841,_0x2d8cf3){var _0x30eed6={},_0x410680={},_0xd77251={'count':0x0,'rows':[]};var _0x3614ed=_['map'](db['Team'][_0x6232('0x2d')],function(_0x633f62){return{'name':_0x633f62['fieldName'],'type':_0x633f62['type']['key']};});_0x410680[_0x6232('0x2e')]=_[_0x6232('0x2f')](_0x3614ed,_0x6232('0x2b'));_0x410680['query']=_[_0x6232('0x30')](_0x436841[_0x6232('0x31')]);_0x410680[_0x6232('0x32')]=_[_0x6232('0x33')](_0x410680[_0x6232('0x2e')],_0x410680['query']);_0x30eed6['attributes']=_['intersection'](_0x410680[_0x6232('0x2e')],qs[_0x6232('0x34')](_0x436841['query'][_0x6232('0x34')]));_0x30eed6[_0x6232('0x35')]=_0x30eed6[_0x6232('0x35')][_0x6232('0x36')]?_0x30eed6[_0x6232('0x35')]:_0x410680['model'];if(!_0x436841[_0x6232('0x31')][_0x6232('0x37')]('nolimit')){_0x30eed6['limit']=qs[_0x6232('0x22')](_0x436841[_0x6232('0x31')][_0x6232('0x22')]);_0x30eed6[_0x6232('0x21')]=qs[_0x6232('0x21')](_0x436841['query'][_0x6232('0x21')]);}_0x30eed6[_0x6232('0x38')]=qs['sort'](_0x436841[_0x6232('0x31')][_0x6232('0x39')]);_0x30eed6['where']=qs['filters'](_[_0x6232('0x3a')](_0x436841[_0x6232('0x31')],_0x410680['filters']),_0x3614ed);if(_0x436841[_0x6232('0x31')][_0x6232('0x3b')]){_0x30eed6[_0x6232('0x3c')]=_['merge'](_0x30eed6[_0x6232('0x3c')],{'$or':_[_0x6232('0x2f')](_0x3614ed,function(_0x961d7d){if(_0x961d7d[_0x6232('0x3d')]!=='VIRTUAL'){var _0x497d78={};_0x497d78[_0x961d7d[_0x6232('0x2b')]]={'$like':'%'+_0x436841[_0x6232('0x31')][_0x6232('0x3b')]+'%'};return _0x497d78;}})});}_0x30eed6=_[_0x6232('0x3e')]({},_0x30eed6,_0x436841[_0x6232('0x3f')]);var _0x282274={'where':_0x30eed6[_0x6232('0x3c')]};return db[_0x6232('0x40')]['count'](_0x282274)[_0x6232('0x29')](function(_0xdc555a){_0xd77251[_0x6232('0x23')]=_0xdc555a;if(_0x436841[_0x6232('0x31')]['includeAll']){_0x30eed6[_0x6232('0x41')]=[{'all':!![]}];}return db[_0x6232('0x40')][_0x6232('0x42')](_0x30eed6);})[_0x6232('0x29')](function(_0x11a215){_0xd77251[_0x6232('0x43')]=_0x11a215;return _0xd77251;})[_0x6232('0x29')](respondWithFilteredResult(_0x2d8cf3,_0x30eed6))[_0x6232('0x44')](handleError(_0x2d8cf3,null));};exports[_0x6232('0x45')]=function(_0x5a1ad0,_0xf33951){var _0x2355f2={'raw':![],'where':{'id':_0x5a1ad0[_0x6232('0x46')]['id']}},_0x10dbe4={};_0x10dbe4[_0x6232('0x2e')]=_[_0x6232('0x30')](db[_0x6232('0x40')][_0x6232('0x2d')]);_0x10dbe4['query']=_['keys'](_0x5a1ad0[_0x6232('0x31')]);_0x10dbe4[_0x6232('0x32')]=_[_0x6232('0x33')](_0x10dbe4[_0x6232('0x2e')],_0x10dbe4[_0x6232('0x31')]);_0x2355f2['attributes']=_[_0x6232('0x33')](_0x10dbe4[_0x6232('0x2e')],qs[_0x6232('0x34')](_0x5a1ad0[_0x6232('0x31')][_0x6232('0x34')]));_0x2355f2[_0x6232('0x35')]=_0x2355f2[_0x6232('0x35')][_0x6232('0x36')]?_0x2355f2['attributes']:_0x10dbe4[_0x6232('0x2e')];if(_0x5a1ad0[_0x6232('0x31')][_0x6232('0x47')]){_0x2355f2[_0x6232('0x41')]=[{'all':!![]}];}_0x2355f2=_[_0x6232('0x3e')]({},_0x2355f2,_0x5a1ad0[_0x6232('0x3f')]);return db['Team'][_0x6232('0x48')](_0x2355f2)[_0x6232('0x29')](handleEntityNotFound(_0xf33951,null))[_0x6232('0x29')](respondWithResult(_0xf33951,null))[_0x6232('0x44')](handleError(_0xf33951,null));};exports[_0x6232('0x49')]=function(_0x5accd6,_0xfb966a){return db[_0x6232('0x40')][_0x6232('0x49')](_0x5accd6[_0x6232('0x4a')],{})[_0x6232('0x29')](function(_0x475b2a){var _0x2625a2=_0x5accd6[_0x6232('0x4b')][_0x6232('0x4c')]({'plain':!![]});if(!_0x2625a2)throw new Error(_0x6232('0x4d'));if(_0x2625a2[_0x6232('0x4e')]===_0x6232('0x4b')){var _0x28e1cb=_0x475b2a[_0x6232('0x4c')]({'plain':!![]});var _0x1ec45c='Teams';return db[_0x6232('0x4f')][_0x6232('0x48')]({'where':{'name':_0x1ec45c,'userProfileId':_0x2625a2[_0x6232('0x50')]},'raw':!![]})['then'](function(_0x529ad3){if(_0x529ad3&&_0x529ad3[_0x6232('0x51')]===0x0){return db[_0x6232('0x52')][_0x6232('0x49')]({'name':_0x28e1cb[_0x6232('0x2b')],'resourceId':_0x28e1cb['id'],'type':_0x529ad3[_0x6232('0x2b')],'sectionId':_0x529ad3['id']},{})[_0x6232('0x29')](function(){return _0x475b2a;});}else{return _0x475b2a;}})[_0x6232('0x44')](function(_0x24f8e9){logger['error'](_0x6232('0x53'),_0x24f8e9);throw _0x24f8e9;});}return _0x475b2a;})[_0x6232('0x29')](respondWithResult(_0xfb966a,0xc9))[_0x6232('0x44')](handleError(_0xfb966a,null));};exports[_0x6232('0x28')]=function(_0x57901f,_0x53e192){if(_0x57901f[_0x6232('0x4a')]['id']){delete _0x57901f[_0x6232('0x4a')]['id'];}return db[_0x6232('0x40')][_0x6232('0x48')]({'where':{'id':_0x57901f[_0x6232('0x46')]['id']}})[_0x6232('0x29')](handleEntityNotFound(_0x53e192,null))[_0x6232('0x29')](saveUpdates(_0x57901f[_0x6232('0x4a')],null))[_0x6232('0x29')](respondWithResult(_0x53e192,null))[_0x6232('0x44')](handleError(_0x53e192,null));};exports[_0x6232('0x54')]=function(_0x10f64c,_0x108177){var _0x3e0bc3=_0x10f64c[_0x6232('0x46')]['id'];var _0x5404c0=0x0;return db['sequelize']['transaction'](function(_0x5cc82a){return db[_0x6232('0x55')]['find']({'where':{'TeamId':_0x3e0bc3}})['then'](function(_0x205123){_0x5404c0=_0x205123[_0x6232('0x56')];var _0x3d3423=_0x6232('0x57')+_0x3e0bc3;return db[_0x6232('0x58')][_0x6232('0x31')](_0x3d3423,{'type':db[_0x6232('0x59')][_0x6232('0x5a')]['SELECT'],'raw':!![],'transaction':_0x5cc82a})[_0x6232('0x29')](function(_0x498728){var _0x334359=_[_0x6232('0x2f')](_0x498728,function(_0x442ef2){return Number(_0x442ef2['UserId']);});return db[_0x6232('0x5b')][_0x6232('0x54')]({'where':{'UserId':{'$in':_0x334359},'VoicePrefixId':_0x5404c0},'transaction':_0x5cc82a});})[_0x6232('0x29')](function(){return db['Team'][_0x6232('0x54')]({'where':{'id':_0x3e0bc3},'cascade':!![],'transaction':_0x5cc82a});})[_0x6232('0x29')](function(_0x2b5e99){if(_0x2b5e99===0x0){_0x108177[_0x6232('0x1d')](0x194);}else{return db[_0x6232('0x52')][_0x6232('0x54')]({'where':{'type':_0x6232('0x5c'),'resourceId':_0x3e0bc3},'cascade':!![],'transaction':_0x5cc82a})[_0x6232('0x29')](function(){_0x108177['status'](0xcc)[_0x6232('0x1f')]();});}})[_0x6232('0x44')](function(_0x42cae7){_0x108177[_0x6232('0x1e')](0x1f4)[_0x6232('0x2c')](_0x42cae7);});});});};exports[_0x6232('0x5d')]=function(_0x3c5b39,_0x251ff2,_0x3ef181){return db['Team'][_0x6232('0x5e')]({'where':{'id':_0x3c5b39[_0x6232('0x46')]['id']}})['then'](handleEntityNotFound(_0x251ff2,null))[_0x6232('0x29')](function(_0xb1576c){if(!_0x3c5b39[_0x6232('0x31')]['channel']||!utils[_0x6232('0x5f')](_0x3c5b39[_0x6232('0x31')][_0x6232('0x60')])){throw new db['Sequelize'][(_0x6232('0x61'))](_0x6232('0x62'));}var _0x21e39a={};var _0x1c22db={};_0x1c22db[_0x6232('0x2e')]=_[_0x6232('0x30')](db[_[_0x6232('0x63')](_0x3c5b39[_0x6232('0x31')]['channel']['toLowerCase']())+'Queue']['rawAttributes']);_0x1c22db[_0x6232('0x31')]=_[_0x6232('0x30')](_0x3c5b39[_0x6232('0x31')]);_0x1c22db['filters']=_['intersection'](_0x1c22db[_0x6232('0x2e')],_0x1c22db[_0x6232('0x31')]);_0x21e39a[_0x6232('0x35')]=_['intersection'](_0x1c22db['model'],qs[_0x6232('0x34')](_0x3c5b39[_0x6232('0x31')][_0x6232('0x34')]));_0x21e39a['attributes']=_0x21e39a[_0x6232('0x35')]['length']?_0x21e39a['attributes']:_0x1c22db[_0x6232('0x2e')];_0x21e39a[_0x6232('0x22')]=qs[_0x6232('0x22')](_0x3c5b39['query'][_0x6232('0x22')]);_0x21e39a[_0x6232('0x21')]=qs[_0x6232('0x21')](_0x3c5b39[_0x6232('0x31')]['offset']);_0x21e39a[_0x6232('0x38')]=qs[_0x6232('0x39')](_0x3c5b39[_0x6232('0x31')][_0x6232('0x39')]);_0x21e39a['where']=qs[_0x6232('0x32')](_[_0x6232('0x3a')](_0x3c5b39[_0x6232('0x31')],_0x1c22db[_0x6232('0x32')]));_0x21e39a=_[_0x6232('0x3e')]({},_0x21e39a,_0x3c5b39['options']);return _0xb1576c[_0x6232('0x4c')+_[_0x6232('0x63')](_0x3c5b39[_0x6232('0x31')][_0x6232('0x60')][_0x6232('0x64')]())+_0x6232('0x65')](_0x21e39a);})['then'](respondWithResult(_0x251ff2,null))[_0x6232('0x44')](handleError(_0x251ff2,null));};exports['addQueues']=function(_0x351758,_0x49d88f,_0x24a84c){return db[_0x6232('0x40')][_0x6232('0x5e')]({'where':{'id':_0x351758['params']['id']}})['then'](function(_0x1dc7e9){if(_0x1dc7e9){if(!_0x351758[_0x6232('0x4a')][_0x6232('0x60')]||!utils[_0x6232('0x5f')](_0x351758[_0x6232('0x4a')][_0x6232('0x60')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x1dc7e9[_0x6232('0x66')+_[_0x6232('0x63')](_0x351758['body']['channel'][_0x6232('0x64')]())+_0x6232('0x65')](_0x351758[_0x6232('0x4a')][_0x6232('0x67')]);}return null;})[_0x6232('0x29')](handleEntityNotFound(_0x49d88f,null))[_0x6232('0x29')](respondWithStatusCode(_0x49d88f,null))['catch'](handleError(_0x49d88f,null));};exports[_0x6232('0x68')]=function(_0x491e20,_0x1e1fe6,_0x4b0cb5){return db[_0x6232('0x40')][_0x6232('0x5e')]({'where':{'id':_0x491e20[_0x6232('0x46')]['id']}})[_0x6232('0x29')](function(_0x24e738){if(_0x24e738){if(!_0x491e20[_0x6232('0x31')][_0x6232('0x60')]||!utils[_0x6232('0x5f')](_0x491e20[_0x6232('0x31')][_0x6232('0x60')])){throw new db[(_0x6232('0x59'))]['ValidationError']('Unknown\x20channel');}return _0x24e738[_0x6232('0x69')+_[_0x6232('0x63')](_0x491e20[_0x6232('0x31')]['channel'][_0x6232('0x64')]())+_0x6232('0x65')](_0x491e20[_0x6232('0x31')][_0x6232('0x67')]);}return null;})['then'](handleEntityNotFound(_0x1e1fe6,null))['then'](respondWithStatusCode(_0x1e1fe6,null))['catch'](handleError(_0x1e1fe6,null));};exports[_0x6232('0x6a')]=function(_0x16bd77,_0x49ac27){var _0x5d315d=_[_0x6232('0x6b')](_0x16bd77[_0x6232('0x4a')][_0x6232('0x67')])?_0x16bd77[_0x6232('0x4a')]['ids']:[_0x16bd77[_0x6232('0x4a')][_0x6232('0x67')]];var _0x18dc11=_0x16bd77['params']['id'];return db[_0x6232('0x40')][_0x6232('0x48')]({'where':{'id':_0x18dc11}})[_0x6232('0x29')](handleEntityNotFound(_0x49ac27,null))[_0x6232('0x29')](function(_0xff6ac4){if(_0xff6ac4){var _0x512df6=[_0x6232('0x6c'),_0x6232('0x6d'),_0x6232('0x6e'),'Sms',_0x6232('0x6f'),'Openchannel',_0x6232('0x70')];return db[_0x6232('0x58')][_0x6232('0x71')](function(_0x701564){var _0x124089=_[_0x6232('0x2f')](_0x512df6,function(_0x5be347){var _0x2b1f69={'attributes':['id',_0x6232('0x2b')]};if(_0x5be347===_0x6232('0x6c')){_0x2b1f69[_0x6232('0x72')]={'attributes':[_0x6232('0x73')]};}return _0xff6ac4[_0x6232('0x4c')+_0x5be347+_0x6232('0x65')](_0x2b1f69)[_0x6232('0x29')](function(_0x130ab6){var _0x395cf2=_[_0x6232('0x2f')](_0x130ab6,function(_0x19c0ef){var _0x28aa6a=_['map'](_0x5d315d,function(_0x4bcdff){var _0x38c2c0={'where':{'UserId':_0x4bcdff,[_0x5be347+'QueueId']:_0x19c0ef['id']},'transaction':_0x701564};if(_0x5be347===_0x6232('0x6c')){_0x38c2c0[_0x6232('0x18')]={'penalty':_0x19c0ef['TeamVoiceQueue'][_0x6232('0x73')]};}return db['User'+_0x5be347+'Queue'][_0x6232('0x74')](_0x38c2c0)[_0x6232('0x29')](function(){socket[_0x6232('0x75')](_0x6232('0x4b')+_0x5be347+_0x6232('0x76'),{'UserId':_0x4bcdff,[_0x5be347+_0x6232('0x77')]:_0x19c0ef['id']});if(_0x5be347!=='Voice'){return;}return db[_0x6232('0x78')][_0x6232('0x42')]({'where':{'id':_0x5d315d,'online':0x1},'attributes':['id',_0x6232('0x2b'),_0x6232('0x79'),_0x6232('0x7a'),_0x6232('0x7b')],'raw':!![]})[_0x6232('0x29')](function(_0x2dc1ea){var _0x153965=_[_0x6232('0x2f')](_0x2dc1ea,function(_0x547407){return db[_0x6232('0x7c')][_0x6232('0x7d')]({'membername':_0x547407[_0x6232('0x2b')],'UserId':_0x547407['id'],'queue_name':_0x19c0ef['name'],'VoiceQueueId':_0x19c0ef['id'],'interface':_['isNil'](_0x547407[_0x6232('0x7b')])?util[_0x6232('0x7e')]('SIP/%s',_0x547407[_0x6232('0x2b')]):_0x547407[_0x6232('0x7b')],'paused':_0x547407[_0x6232('0x7a')]||![],'penalty':_0x19c0ef[_0x6232('0x7f')][_0x6232('0x73')]},{'transaction':_0x701564});});return Promise[_0x6232('0x80')](_0x153965);});});});return Promise[_0x6232('0x80')](_0x28aa6a);});return Promise[_0x6232('0x80')](_0x395cf2);})[_0x6232('0x29')](function(){return db[_0x6232('0x55')][_0x6232('0x5e')]({'where':{'teamId':_0x18dc11}})[_0x6232('0x29')](function(_0x164f7d){if(_0x164f7d){var _0x2e71f1=_[_0x6232('0x2f')](_0x5d315d,function(_0x3513f7){db[_0x6232('0x5b')][_0x6232('0x7d')]({'UserId':_0x3513f7,'VoicePrefixId':_0x164f7d['VoicePrefixId']});});return Promise['all'](_0x2e71f1);}});});});return Promise[_0x6232('0x80')](_0x124089)[_0x6232('0x29')](function(){return _0xff6ac4[_0x6232('0x6a')](_0x5d315d,{'transaction':_0x701564})[_0x6232('0x81')](function(_0x491947){return _0x491947;});});});}})[_0x6232('0x29')](respondWithResult(_0x49ac27,null))[_0x6232('0x44')](handleError(_0x49ac27,null));};exports[_0x6232('0x82')]=function(_0x469e27,_0x14901b){var _0x5be741=_['isArray'](_0x469e27[_0x6232('0x31')][_0x6232('0x67')])?_0x469e27[_0x6232('0x31')][_0x6232('0x67')]:[_0x469e27[_0x6232('0x31')]['ids']];var _0x30932c=_0x469e27[_0x6232('0x46')]['id'];return db[_0x6232('0x40')][_0x6232('0x48')]({'where':{'id':_0x30932c}})[_0x6232('0x29')](handleEntityNotFound(_0x14901b,null))[_0x6232('0x29')](function(_0x2eddf3){if(_0x2eddf3){var _0x366e4b=[_0x6232('0x6c'),_0x6232('0x6d'),_0x6232('0x6e'),'Sms',_0x6232('0x6f'),_0x6232('0x83'),_0x6232('0x70')];return db[_0x6232('0x58')][_0x6232('0x71')](function(_0x186600){var _0x2122e9=_['map'](_0x366e4b,function(_0x3fc2e8){var _0x36263d={'attributes':['id','name']};return _0x2eddf3['get'+_0x3fc2e8+_0x6232('0x65')](_0x36263d)['then'](function(_0x25cb23){var _0x48d67c=_['map'](_0x25cb23,function(_0x404afb){return _0x404afb[_0x6232('0x82')](_0x5be741,{'transaction':_0x186600})[_0x6232('0x29')](function(){var _0x5d5d72=_[_0x6232('0x2f')](_0x5be741,function(_0x1d625c){socket[_0x6232('0x75')](_0x6232('0x4b')+_0x3fc2e8+_0x6232('0x84'),{'UserId':Number(_0x1d625c),[_0x3fc2e8+_0x6232('0x77')]:_0x404afb['id']});if(_0x3fc2e8!==_0x6232('0x6c')){return;}return db[_0x6232('0x7c')][_0x6232('0x54')]({'where':{'VoiceQueueId':_0x404afb['id'],'UserId':_0x1d625c},'transaction':_0x186600});});return Promise['all'](_0x5d5d72);});});return Promise[_0x6232('0x80')](_0x48d67c);});});return Promise[_0x6232('0x80')](_0x2122e9)[_0x6232('0x29')](function(){return _0x2eddf3[_0x6232('0x82')](_0x5be741,{'transaction':_0x186600});})['then'](function(){return db[_0x6232('0x55')][_0x6232('0x5e')]({'where':{'teamId':_0x30932c}})[_0x6232('0x29')](function(_0x317cac){if(_0x317cac){var _0x1d83b6=_[_0x6232('0x2f')](_0x5be741,function(_0x37aad){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x37aad,'VoicePrefixId':_0x317cac[_0x6232('0x56')]}});});return Promise['all'](_0x1d83b6);}});});});}})[_0x6232('0x29')](respondWithStatusCode(_0x14901b,null))[_0x6232('0x44')](handleError(_0x14901b,null));};exports[_0x6232('0x85')]=function(_0xfe70c6,_0x3ef78a,_0x12f00d){var _0x51fd54={};var _0xaf8698={};var _0xf9c786;var _0x31890b;return db[_0x6232('0x40')][_0x6232('0x5e')]({'where':{'id':_0xfe70c6['params']['id']}})[_0x6232('0x29')](handleEntityNotFound(_0x3ef78a,null))[_0x6232('0x29')](function(_0x5cc4b3){if(_0x5cc4b3){_0xf9c786=_0x5cc4b3;_0xaf8698[_0x6232('0x2e')]=_[_0x6232('0x30')](db[_0x6232('0x78')][_0x6232('0x2d')]);_0xaf8698[_0x6232('0x31')]=_['keys'](_0xfe70c6['query']);_0xaf8698[_0x6232('0x32')]=_[_0x6232('0x33')](_0xaf8698['model'],_0xaf8698['query']);_0x51fd54[_0x6232('0x35')]=_[_0x6232('0x33')](_0xaf8698['model'],qs[_0x6232('0x34')](_0xfe70c6['query'][_0x6232('0x34')]));_0x51fd54[_0x6232('0x35')]=_0x51fd54['attributes'][_0x6232('0x36')]?_0x51fd54[_0x6232('0x35')]:_0xaf8698[_0x6232('0x2e')];_0x51fd54[_0x6232('0x38')]=qs[_0x6232('0x39')](_0xfe70c6['query'][_0x6232('0x39')]);_0x51fd54['where']=qs[_0x6232('0x32')](_[_0x6232('0x3a')](_0xfe70c6['query'],_0xaf8698[_0x6232('0x32')]));if(_0xfe70c6['query'][_0x6232('0x3b')]){_0x51fd54['where']=_[_0x6232('0x3e')](_0x51fd54['where'],{'$or':_[_0x6232('0x2f')](_0x51fd54[_0x6232('0x35')],function(_0x6832da){var _0x47998e={};_0x47998e[_0x6832da]={'$like':'%'+_0xfe70c6[_0x6232('0x31')][_0x6232('0x3b')]+'%'};return _0x47998e;})});}_0x51fd54=_[_0x6232('0x3e')]({},_0x51fd54,_0xfe70c6[_0x6232('0x3f')]);return _0xf9c786['getAgents'](_0x51fd54);}})[_0x6232('0x29')](function(_0x3a38d3){if(_0x3a38d3){_0x31890b=_0x3a38d3[_0x6232('0x36')];if(!_0xfe70c6[_0x6232('0x31')][_0x6232('0x37')]('nolimit')){_0x51fd54[_0x6232('0x22')]=qs[_0x6232('0x22')](_0xfe70c6[_0x6232('0x31')][_0x6232('0x22')]);_0x51fd54[_0x6232('0x21')]=qs[_0x6232('0x21')](_0xfe70c6['query']['offset']);}return _0xf9c786[_0x6232('0x85')](_0x51fd54);}})[_0x6232('0x29')](function(_0x565bb5){if(_0x565bb5){return _0x565bb5?{'count':_0x31890b,'rows':_0x565bb5}:null;}})[_0x6232('0x29')](respondWithResult(_0x3ef78a,null))['catch'](handleError(_0x3ef78a,null));}; \ No newline at end of file +var _0x149f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','error','stack','name','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','includeAll','show','params','keys','include','find','catch','create','body','user','get','role','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','TeamVoicePrefix','VoicePrefixId','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','UserVoicePrefix','end','send','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','Queues','addQueues','capitalize','ids','removeQueues','Voice','Mail','Sms','Openchannel','Whatsapp','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','addAgents','removeAgents','Chat','Queue:remove','getAgents','eml-format','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x482da9,_0x37d4f4){var _0x3a0624=function(_0x593a13){while(--_0x593a13){_0x482da9['push'](_0x482da9['shift']());}};_0x3a0624(++_0x37d4f4);}(_0x149f,0x180));var _0xf149=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x149f[_0x2ec461];return _0x28603d;};'use strict';var emlformat=require(_0xf149('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf149('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf149('0x2'));var moment=require('moment');var BPromise=require(_0xf149('0x3'));var Mustache=require('mustache');var util=require(_0xf149('0x4'));var path=require('path');var sox=require(_0xf149('0x5'));var csv=require(_0xf149('0x6'));var ejs=require(_0xf149('0x7'));var fs=require('fs');var fs_extra=require(_0xf149('0x8'));var _=require(_0xf149('0x9'));var squel=require(_0xf149('0xa'));var crypto=require(_0xf149('0xb'));var jsforce=require(_0xf149('0xc'));var deskjs=require(_0xf149('0xd'));var toCsv=require(_0xf149('0x6'));var querystring=require(_0xf149('0xe'));var Papa=require('papaparse');var Redis=require(_0xf149('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf149('0x10'));var as=require(_0xf149('0x11'));var hardwareService=require(_0xf149('0x12'));var logger=require(_0xf149('0x13'))(_0xf149('0x14'));var utils=require(_0xf149('0x15'));var config=require(_0xf149('0x16'));var licenseUtil=require(_0xf149('0x17'));var db=require(_0xf149('0x18'))['db'];config[_0xf149('0x19')]=_[_0xf149('0x1a')](config[_0xf149('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf149('0x1b'))(new Redis(config[_0xf149('0x19')]));require('./team.socket')[_0xf149('0x1c')](socket);function respondWithStatusCode(_0x227c74,_0x20c864){_0x20c864=_0x20c864||0xcc;return function(_0x22b569){if(_0x22b569){return _0x227c74[_0xf149('0x1d')](_0x20c864);}return _0x227c74[_0xf149('0x1e')](_0x20c864)['end']();};}function respondWithResult(_0x189114,_0x1ed4b1){_0x1ed4b1=_0x1ed4b1||0xc8;return function(_0xdea1d0){if(_0xdea1d0){return _0x189114[_0xf149('0x1e')](_0x1ed4b1)['json'](_0xdea1d0);}};}function respondWithFilteredResult(_0x528a60,_0x5f2639){return function(_0x50cdda){if(_0x50cdda){var _0x529538=typeof _0x5f2639[_0xf149('0x1f')]===_0xf149('0x20')&&typeof _0x5f2639[_0xf149('0x21')]==='undefined';var _0x4fbd07=_0x50cdda[_0xf149('0x22')];var _0x457420=_0x529538?0x0:_0x5f2639[_0xf149('0x1f')];var _0x41c9c6=_0x529538?_0x50cdda[_0xf149('0x22')]:_0x5f2639[_0xf149('0x1f')]+_0x5f2639[_0xf149('0x21')];var _0x227ab6;if(_0x41c9c6>=_0x4fbd07){_0x41c9c6=_0x4fbd07;_0x227ab6=0xc8;}else{_0x227ab6=0xce;}_0x528a60[_0xf149('0x1e')](_0x227ab6);return _0x528a60[_0xf149('0x23')](_0xf149('0x24'),_0x457420+'-'+_0x41c9c6+'/'+_0x4fbd07)[_0xf149('0x25')](_0x50cdda);}return null;};}function patchUpdates(_0x47ee84){return function(_0x3f031d){try{jsonpatch[_0xf149('0x26')](_0x3f031d,_0x47ee84,!![]);}catch(_0x409a51){return BPromise[_0xf149('0x27')](_0x409a51);}return _0x3f031d['save']();};}function saveUpdates(_0x3a9446,_0x1b4dde){return function(_0x57b9f3){if(_0x57b9f3){return _0x57b9f3[_0xf149('0x28')](_0x3a9446)[_0xf149('0x29')](function(_0x7132de){return _0x7132de;});}return null;};}function handleEntityNotFound(_0x4dd499,_0x1a51b7){return function(_0x4b272f){if(!_0x4b272f){_0x4dd499[_0xf149('0x1d')](0x194);}return _0x4b272f;};}function handleError(_0x5d337f,_0x2cd891){_0x2cd891=_0x2cd891||0x1f4;return function(_0x6c4afa){logger[_0xf149('0x2a')](_0x6c4afa[_0xf149('0x2b')]);if(_0x6c4afa[_0xf149('0x2c')]){delete _0x6c4afa['name'];}_0x5d337f[_0xf149('0x1e')](_0x2cd891)['send'](_0x6c4afa);};}exports[_0xf149('0x2d')]=function(_0x31bba4,_0x3391e3){var _0xd06dc={},_0x37ec4b={},_0x176223={'count':0x0,'rows':[]};var _0x162e7a=_[_0xf149('0x2e')](db['Team'][_0xf149('0x2f')],function(_0x1af42e){return{'name':_0x1af42e['fieldName'],'type':_0x1af42e[_0xf149('0x30')][_0xf149('0x31')]};});_0x37ec4b['model']=_[_0xf149('0x2e')](_0x162e7a,_0xf149('0x2c'));_0x37ec4b[_0xf149('0x32')]=_['keys'](_0x31bba4['query']);_0x37ec4b[_0xf149('0x33')]=_[_0xf149('0x34')](_0x37ec4b[_0xf149('0x35')],_0x37ec4b[_0xf149('0x32')]);_0xd06dc[_0xf149('0x36')]=_[_0xf149('0x34')](_0x37ec4b['model'],qs[_0xf149('0x37')](_0x31bba4[_0xf149('0x32')][_0xf149('0x37')]));_0xd06dc[_0xf149('0x36')]=_0xd06dc[_0xf149('0x36')][_0xf149('0x38')]?_0xd06dc[_0xf149('0x36')]:_0x37ec4b[_0xf149('0x35')];if(!_0x31bba4[_0xf149('0x32')][_0xf149('0x39')](_0xf149('0x3a'))){_0xd06dc[_0xf149('0x21')]=qs[_0xf149('0x21')](_0x31bba4[_0xf149('0x32')][_0xf149('0x21')]);_0xd06dc[_0xf149('0x1f')]=qs['offset'](_0x31bba4[_0xf149('0x32')][_0xf149('0x1f')]);}_0xd06dc[_0xf149('0x3b')]=qs[_0xf149('0x3c')](_0x31bba4[_0xf149('0x32')]['sort']);_0xd06dc[_0xf149('0x3d')]=qs[_0xf149('0x33')](_[_0xf149('0x3e')](_0x31bba4['query'],_0x37ec4b[_0xf149('0x33')]),_0x162e7a);if(_0x31bba4[_0xf149('0x32')][_0xf149('0x3f')]){_0xd06dc[_0xf149('0x3d')]=_[_0xf149('0x40')](_0xd06dc[_0xf149('0x3d')],{'$or':_['map'](_0x162e7a,function(_0x1c5976){if(_0x1c5976['type']!==_0xf149('0x41')){var _0xf08e9={};_0xf08e9[_0x1c5976[_0xf149('0x2c')]]={'$like':'%'+_0x31bba4[_0xf149('0x32')][_0xf149('0x3f')]+'%'};return _0xf08e9;}})});}_0xd06dc=_[_0xf149('0x40')]({},_0xd06dc,_0x31bba4[_0xf149('0x42')]);var _0x24129b={'where':_0xd06dc[_0xf149('0x3d')]};return db[_0xf149('0x43')][_0xf149('0x22')](_0x24129b)['then'](function(_0x412aac){_0x176223[_0xf149('0x22')]=_0x412aac;if(_0x31bba4[_0xf149('0x32')][_0xf149('0x44')]){_0xd06dc['include']=[{'all':!![]}];}return db['Team']['findAll'](_0xd06dc);})[_0xf149('0x29')](function(_0x51f3d7){_0x176223['rows']=_0x51f3d7;return _0x176223;})[_0xf149('0x29')](respondWithFilteredResult(_0x3391e3,_0xd06dc))['catch'](handleError(_0x3391e3,null));};exports[_0xf149('0x45')]=function(_0x4beb8a,_0x2f450b){var _0x2e8aba={'raw':![],'where':{'id':_0x4beb8a[_0xf149('0x46')]['id']}},_0x338bea={};_0x338bea['model']=_[_0xf149('0x47')](db['Team'][_0xf149('0x2f')]);_0x338bea[_0xf149('0x32')]=_[_0xf149('0x47')](_0x4beb8a[_0xf149('0x32')]);_0x338bea[_0xf149('0x33')]=_[_0xf149('0x34')](_0x338bea[_0xf149('0x35')],_0x338bea[_0xf149('0x32')]);_0x2e8aba[_0xf149('0x36')]=_['intersection'](_0x338bea[_0xf149('0x35')],qs['fields'](_0x4beb8a[_0xf149('0x32')][_0xf149('0x37')]));_0x2e8aba[_0xf149('0x36')]=_0x2e8aba[_0xf149('0x36')][_0xf149('0x38')]?_0x2e8aba[_0xf149('0x36')]:_0x338bea[_0xf149('0x35')];if(_0x4beb8a['query'][_0xf149('0x44')]){_0x2e8aba[_0xf149('0x48')]=[{'all':!![]}];}_0x2e8aba=_[_0xf149('0x40')]({},_0x2e8aba,_0x4beb8a[_0xf149('0x42')]);return db[_0xf149('0x43')][_0xf149('0x49')](_0x2e8aba)[_0xf149('0x29')](handleEntityNotFound(_0x2f450b,null))[_0xf149('0x29')](respondWithResult(_0x2f450b,null))[_0xf149('0x4a')](handleError(_0x2f450b,null));};exports[_0xf149('0x4b')]=function(_0x545668,_0x2b3b78){return db['Team'][_0xf149('0x4b')](_0x545668[_0xf149('0x4c')],{})['then'](function(_0x15330e){var _0xc573e9=_0x545668[_0xf149('0x4d')][_0xf149('0x4e')]({'plain':!![]});if(!_0xc573e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc573e9[_0xf149('0x4f')]==='user'){var _0x47dbf1=_0x15330e[_0xf149('0x4e')]({'plain':!![]});var _0x5dbacc=_0xf149('0x50');return db[_0xf149('0x51')]['find']({'where':{'name':_0x5dbacc,'userProfileId':_0xc573e9[_0xf149('0x52')]},'raw':!![]})['then'](function(_0x2fa699){if(_0x2fa699&&_0x2fa699['autoAssociation']===0x0){return db[_0xf149('0x53')][_0xf149('0x4b')]({'name':_0x47dbf1[_0xf149('0x2c')],'resourceId':_0x47dbf1['id'],'type':_0x2fa699['name'],'sectionId':_0x2fa699['id']},{})[_0xf149('0x29')](function(){return _0x15330e;});}else{return _0x15330e;}})[_0xf149('0x4a')](function(_0x38fb9d){logger['error'](_0xf149('0x54'),_0x38fb9d);throw _0x38fb9d;});}return _0x15330e;})['then'](respondWithResult(_0x2b3b78,0xc9))['catch'](handleError(_0x2b3b78,null));};exports[_0xf149('0x28')]=function(_0x5375d5,_0x3b7faf){if(_0x5375d5[_0xf149('0x4c')]['id']){delete _0x5375d5[_0xf149('0x4c')]['id'];}return db[_0xf149('0x43')][_0xf149('0x49')]({'where':{'id':_0x5375d5['params']['id']}})['then'](handleEntityNotFound(_0x3b7faf,null))['then'](saveUpdates(_0x5375d5['body'],null))[_0xf149('0x29')](respondWithResult(_0x3b7faf,null))[_0xf149('0x4a')](handleError(_0x3b7faf,null));};exports[_0xf149('0x55')]=function(_0x4503f0,_0x2a94ad){var _0x501f98=_0x4503f0[_0xf149('0x46')]['id'];var _0x210e45=0x0;return db[_0xf149('0x56')][_0xf149('0x57')](function(_0x25dc53){return db[_0xf149('0x58')][_0xf149('0x49')]({'where':{'TeamId':_0x501f98}})[_0xf149('0x29')](function(_0x213867){if(_0x213867===null){return;}_0x210e45=_0x213867[_0xf149('0x59')];var _0x22b7ed=_0xf149('0x5a')+_0x501f98;return db['sequelize'][_0xf149('0x32')](_0x22b7ed,{'type':db[_0xf149('0x5b')][_0xf149('0x5c')]['SELECT'],'raw':!![],'transaction':_0x25dc53})[_0xf149('0x29')](function(_0x24017c){var _0x1ff39c=_[_0xf149('0x2e')](_0x24017c,function(_0x2ce2bf){return Number(_0x2ce2bf[_0xf149('0x5d')]);});return db[_0xf149('0x5e')][_0xf149('0x55')]({'where':{'UserId':{'$in':_0x1ff39c},'VoicePrefixId':_0x210e45},'transaction':_0x25dc53});})[_0xf149('0x29')](function(){return db[_0xf149('0x43')][_0xf149('0x55')]({'where':{'id':_0x501f98},'cascade':!![],'transaction':_0x25dc53});})['then'](function(_0x4b50b0){if(_0x4b50b0===0x0){_0x2a94ad[_0xf149('0x1d')](0x194);}else{return db[_0xf149('0x53')][_0xf149('0x55')]({'where':{'type':_0xf149('0x50'),'resourceId':_0x501f98},'cascade':!![],'transaction':_0x25dc53})['then'](function(){_0x2a94ad[_0xf149('0x1e')](0xcc)[_0xf149('0x5f')]();});}})[_0xf149('0x4a')](function(_0x16dbf2){_0x2a94ad[_0xf149('0x1e')](0x1f4)[_0xf149('0x60')](_0x16dbf2);});});});};exports['getQueues']=function(_0x20a73b,_0x156255,_0x39b421){return db[_0xf149('0x43')][_0xf149('0x61')]({'where':{'id':_0x20a73b[_0xf149('0x46')]['id']}})[_0xf149('0x29')](handleEntityNotFound(_0x156255,null))[_0xf149('0x29')](function(_0xb32e0a){if(!_0x20a73b[_0xf149('0x32')][_0xf149('0x62')]||!utils[_0xf149('0x63')](_0x20a73b[_0xf149('0x32')][_0xf149('0x62')])){throw new db[(_0xf149('0x5b'))][(_0xf149('0x64'))](_0xf149('0x65'));}var _0x235dc0={};var _0x488506={};_0x488506[_0xf149('0x35')]=_[_0xf149('0x47')](db[_['capitalize'](_0x20a73b['query'][_0xf149('0x62')][_0xf149('0x66')]())+_0xf149('0x67')][_0xf149('0x2f')]);_0x488506[_0xf149('0x32')]=_['keys'](_0x20a73b[_0xf149('0x32')]);_0x488506[_0xf149('0x33')]=_['intersection'](_0x488506[_0xf149('0x35')],_0x488506[_0xf149('0x32')]);_0x235dc0['attributes']=_['intersection'](_0x488506['model'],qs[_0xf149('0x37')](_0x20a73b['query'][_0xf149('0x37')]));_0x235dc0[_0xf149('0x36')]=_0x235dc0[_0xf149('0x36')]['length']?_0x235dc0[_0xf149('0x36')]:_0x488506[_0xf149('0x35')];_0x235dc0[_0xf149('0x21')]=qs[_0xf149('0x21')](_0x20a73b[_0xf149('0x32')][_0xf149('0x21')]);_0x235dc0['offset']=qs[_0xf149('0x1f')](_0x20a73b[_0xf149('0x32')]['offset']);_0x235dc0[_0xf149('0x3b')]=qs[_0xf149('0x3c')](_0x20a73b['query']['sort']);_0x235dc0[_0xf149('0x3d')]=qs['filters'](_['pick'](_0x20a73b[_0xf149('0x32')],_0x488506['filters']));_0x235dc0=_[_0xf149('0x40')]({},_0x235dc0,_0x20a73b[_0xf149('0x42')]);return _0xb32e0a[_0xf149('0x4e')+_['capitalize'](_0x20a73b[_0xf149('0x32')][_0xf149('0x62')][_0xf149('0x66')]())+_0xf149('0x68')](_0x235dc0);})['then'](respondWithResult(_0x156255,null))[_0xf149('0x4a')](handleError(_0x156255,null));};exports[_0xf149('0x69')]=function(_0x2834bc,_0x5ea1d8,_0x174190){return db[_0xf149('0x43')][_0xf149('0x61')]({'where':{'id':_0x2834bc[_0xf149('0x46')]['id']}})[_0xf149('0x29')](function(_0x1c49c3){if(_0x1c49c3){if(!_0x2834bc[_0xf149('0x4c')][_0xf149('0x62')]||!utils[_0xf149('0x63')](_0x2834bc[_0xf149('0x4c')][_0xf149('0x62')])){throw new db[(_0xf149('0x5b'))]['ValidationError'](_0xf149('0x65'));}return _0x1c49c3['add'+_[_0xf149('0x6a')](_0x2834bc[_0xf149('0x4c')][_0xf149('0x62')][_0xf149('0x66')]())+_0xf149('0x68')](_0x2834bc[_0xf149('0x4c')][_0xf149('0x6b')]);}return null;})['then'](handleEntityNotFound(_0x5ea1d8,null))[_0xf149('0x29')](respondWithStatusCode(_0x5ea1d8,null))[_0xf149('0x4a')](handleError(_0x5ea1d8,null));};exports[_0xf149('0x6c')]=function(_0x70c70b,_0x312a3e,_0x4ea55d){return db[_0xf149('0x43')]['findOne']({'where':{'id':_0x70c70b['params']['id']}})['then'](function(_0x3d869a){if(_0x3d869a){if(!_0x70c70b[_0xf149('0x32')][_0xf149('0x62')]||!utils[_0xf149('0x63')](_0x70c70b[_0xf149('0x32')][_0xf149('0x62')])){throw new db[(_0xf149('0x5b'))]['ValidationError'](_0xf149('0x65'));}return _0x3d869a['remove'+_[_0xf149('0x6a')](_0x70c70b[_0xf149('0x32')][_0xf149('0x62')][_0xf149('0x66')]())+'Queues'](_0x70c70b[_0xf149('0x32')][_0xf149('0x6b')]);}return null;})[_0xf149('0x29')](handleEntityNotFound(_0x312a3e,null))['then'](respondWithStatusCode(_0x312a3e,null))[_0xf149('0x4a')](handleError(_0x312a3e,null));};exports['addAgents']=function(_0x2cc3b7,_0x4d9737){var _0x121648=_['isArray'](_0x2cc3b7['body'][_0xf149('0x6b')])?_0x2cc3b7[_0xf149('0x4c')][_0xf149('0x6b')]:[_0x2cc3b7['body'][_0xf149('0x6b')]];var _0x172491=_0x2cc3b7[_0xf149('0x46')]['id'];return db[_0xf149('0x43')][_0xf149('0x49')]({'where':{'id':_0x172491}})[_0xf149('0x29')](handleEntityNotFound(_0x4d9737,null))[_0xf149('0x29')](function(_0x215ab2){if(_0x215ab2){var _0x39f8ef=[_0xf149('0x6d'),'Chat',_0xf149('0x6e'),_0xf149('0x6f'),'Fax',_0xf149('0x70'),_0xf149('0x71')];return db['sequelize'][_0xf149('0x57')](function(_0x318173){var _0x500324=_[_0xf149('0x2e')](_0x39f8ef,function(_0x2244b7){var _0x209a2d={'attributes':['id',_0xf149('0x2c')]};if(_0x2244b7===_0xf149('0x6d')){_0x209a2d['through']={'attributes':[_0xf149('0x72')]};}return _0x215ab2[_0xf149('0x4e')+_0x2244b7+_0xf149('0x68')](_0x209a2d)[_0xf149('0x29')](function(_0xb1cc3){var _0x15ad23=_['map'](_0xb1cc3,function(_0x45d625){var _0x5b9517=_[_0xf149('0x2e')](_0x121648,function(_0x3ac2d4){var _0x1c9e3d={'where':{'UserId':_0x3ac2d4,[_0x2244b7+_0xf149('0x73')]:_0x45d625['id']},'transaction':_0x318173};if(_0x2244b7===_0xf149('0x6d')){_0x1c9e3d[_0xf149('0x1a')]={'penalty':_0x45d625[_0xf149('0x74')]['penalty']};}return db[_0xf149('0x75')+_0x2244b7+_0xf149('0x67')]['findOrCreate'](_0x1c9e3d)[_0xf149('0x29')](function(){socket[_0xf149('0x76')](_0xf149('0x4d')+_0x2244b7+_0xf149('0x77'),{'UserId':_0x3ac2d4,[_0x2244b7+_0xf149('0x73')]:_0x45d625['id']});if(_0x2244b7!=='Voice'){return;}return db[_0xf149('0x75')][_0xf149('0x78')]({'where':{'id':_0x121648,'online':0x1},'attributes':['id',_0xf149('0x2c'),_0xf149('0x79'),_0xf149('0x7a'),_0xf149('0x7b')],'raw':!![]})[_0xf149('0x29')](function(_0x382d0a){var _0x48fdf9=_[_0xf149('0x2e')](_0x382d0a,function(_0x4c0645){return db[_0xf149('0x7c')][_0xf149('0x7d')]({'membername':_0x4c0645[_0xf149('0x2c')],'UserId':_0x4c0645['id'],'queue_name':_0x45d625[_0xf149('0x2c')],'VoiceQueueId':_0x45d625['id'],'interface':_[_0xf149('0x7e')](_0x4c0645['interface'])?util[_0xf149('0x7f')](_0xf149('0x80'),_0x4c0645['name']):_0x4c0645[_0xf149('0x7b')],'paused':_0x4c0645['voicePause']||![],'penalty':_0x45d625[_0xf149('0x74')]['penalty']},{'transaction':_0x318173});});return Promise[_0xf149('0x81')](_0x48fdf9);});});});return Promise[_0xf149('0x81')](_0x5b9517);});return Promise[_0xf149('0x81')](_0x15ad23);})[_0xf149('0x29')](function(){return db['TeamVoicePrefix'][_0xf149('0x61')]({'where':{'teamId':_0x172491}})[_0xf149('0x29')](function(_0x2090f3){if(_0x2090f3){var _0x2e9e20=_[_0xf149('0x2e')](_0x121648,function(_0x529bd7){db[_0xf149('0x5e')][_0xf149('0x7d')]({'UserId':_0x529bd7,'VoicePrefixId':_0x2090f3['VoicePrefixId']});});return Promise['all'](_0x2e9e20);}});});});return Promise[_0xf149('0x81')](_0x500324)['then'](function(){return _0x215ab2[_0xf149('0x82')](_0x121648,{'transaction':_0x318173})['spread'](function(_0x57b826){return _0x57b826;});});});}})['then'](respondWithResult(_0x4d9737,null))['catch'](handleError(_0x4d9737,null));};exports[_0xf149('0x83')]=function(_0x13fafc,_0x29c39c){var _0x13ddf7=_['isArray'](_0x13fafc[_0xf149('0x32')][_0xf149('0x6b')])?_0x13fafc[_0xf149('0x32')][_0xf149('0x6b')]:[_0x13fafc[_0xf149('0x32')][_0xf149('0x6b')]];var _0x143680=_0x13fafc[_0xf149('0x46')]['id'];return db[_0xf149('0x43')][_0xf149('0x49')]({'where':{'id':_0x143680}})['then'](handleEntityNotFound(_0x29c39c,null))[_0xf149('0x29')](function(_0x558585){if(_0x558585){var _0x5a91f4=['Voice',_0xf149('0x84'),_0xf149('0x6e'),'Sms','Fax','Openchannel',_0xf149('0x71')];return db[_0xf149('0x56')][_0xf149('0x57')](function(_0x593644){var _0x31bae6=_[_0xf149('0x2e')](_0x5a91f4,function(_0x1eeb80){var _0x12ccf6={'attributes':['id',_0xf149('0x2c')]};return _0x558585[_0xf149('0x4e')+_0x1eeb80+_0xf149('0x68')](_0x12ccf6)[_0xf149('0x29')](function(_0x48b7de){var _0x4778d6=_[_0xf149('0x2e')](_0x48b7de,function(_0x5921a3){return _0x5921a3[_0xf149('0x83')](_0x13ddf7,{'transaction':_0x593644})[_0xf149('0x29')](function(){var _0x19ecd1=_[_0xf149('0x2e')](_0x13ddf7,function(_0xd5fe2d){socket['emit'](_0xf149('0x4d')+_0x1eeb80+_0xf149('0x85'),{'UserId':Number(_0xd5fe2d),[_0x1eeb80+_0xf149('0x73')]:_0x5921a3['id']});if(_0x1eeb80!==_0xf149('0x6d')){return;}return db['UserVoiceQueueRt'][_0xf149('0x55')]({'where':{'VoiceQueueId':_0x5921a3['id'],'UserId':_0xd5fe2d},'transaction':_0x593644});});return Promise[_0xf149('0x81')](_0x19ecd1);});});return Promise[_0xf149('0x81')](_0x4778d6);});});return Promise[_0xf149('0x81')](_0x31bae6)['then'](function(){return _0x558585[_0xf149('0x83')](_0x13ddf7,{'transaction':_0x593644});})[_0xf149('0x29')](function(){return db[_0xf149('0x58')][_0xf149('0x61')]({'where':{'teamId':_0x143680}})[_0xf149('0x29')](function(_0x4ab3fa){if(_0x4ab3fa){var _0x4a83ac=_[_0xf149('0x2e')](_0x13ddf7,function(_0x4f04bd){db[_0xf149('0x5e')][_0xf149('0x55')]({'where':{'UserId':_0x4f04bd,'VoicePrefixId':_0x4ab3fa[_0xf149('0x59')]}});});return Promise[_0xf149('0x81')](_0x4a83ac);}});});});}})[_0xf149('0x29')](respondWithStatusCode(_0x29c39c,null))[_0xf149('0x4a')](handleError(_0x29c39c,null));};exports[_0xf149('0x86')]=function(_0x48b18b,_0xff71fa,_0x4547de){var _0x25a464={};var _0x61654f={};var _0x477a0f;var _0x2b1135;return db[_0xf149('0x43')]['findOne']({'where':{'id':_0x48b18b[_0xf149('0x46')]['id']}})[_0xf149('0x29')](handleEntityNotFound(_0xff71fa,null))[_0xf149('0x29')](function(_0x5cd71a){if(_0x5cd71a){_0x477a0f=_0x5cd71a;_0x61654f[_0xf149('0x35')]=_[_0xf149('0x47')](db[_0xf149('0x75')][_0xf149('0x2f')]);_0x61654f[_0xf149('0x32')]=_['keys'](_0x48b18b[_0xf149('0x32')]);_0x61654f[_0xf149('0x33')]=_['intersection'](_0x61654f[_0xf149('0x35')],_0x61654f[_0xf149('0x32')]);_0x25a464[_0xf149('0x36')]=_[_0xf149('0x34')](_0x61654f['model'],qs[_0xf149('0x37')](_0x48b18b[_0xf149('0x32')][_0xf149('0x37')]));_0x25a464[_0xf149('0x36')]=_0x25a464[_0xf149('0x36')][_0xf149('0x38')]?_0x25a464[_0xf149('0x36')]:_0x61654f[_0xf149('0x35')];_0x25a464[_0xf149('0x3b')]=qs[_0xf149('0x3c')](_0x48b18b[_0xf149('0x32')][_0xf149('0x3c')]);_0x25a464['where']=qs['filters'](_[_0xf149('0x3e')](_0x48b18b['query'],_0x61654f[_0xf149('0x33')]));if(_0x48b18b[_0xf149('0x32')][_0xf149('0x3f')]){_0x25a464[_0xf149('0x3d')]=_[_0xf149('0x40')](_0x25a464[_0xf149('0x3d')],{'$or':_['map'](_0x25a464[_0xf149('0x36')],function(_0x211433){var _0x843ca1={};_0x843ca1[_0x211433]={'$like':'%'+_0x48b18b[_0xf149('0x32')][_0xf149('0x3f')]+'%'};return _0x843ca1;})});}_0x25a464=_[_0xf149('0x40')]({},_0x25a464,_0x48b18b[_0xf149('0x42')]);return _0x477a0f[_0xf149('0x86')](_0x25a464);}})[_0xf149('0x29')](function(_0x24ab34){if(_0x24ab34){_0x2b1135=_0x24ab34[_0xf149('0x38')];if(!_0x48b18b['query'][_0xf149('0x39')](_0xf149('0x3a'))){_0x25a464[_0xf149('0x21')]=qs[_0xf149('0x21')](_0x48b18b[_0xf149('0x32')][_0xf149('0x21')]);_0x25a464[_0xf149('0x1f')]=qs[_0xf149('0x1f')](_0x48b18b['query'][_0xf149('0x1f')]);}return _0x477a0f[_0xf149('0x86')](_0x25a464);}})[_0xf149('0x29')](function(_0x2c5da0){if(_0x2c5da0){return _0x2c5da0?{'count':_0x2b1135,'rows':_0x2c5da0}:null;}})[_0xf149('0x29')](respondWithResult(_0xff71fa,null))[_0xf149('0x4a')](handleError(_0xff71fa,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 5365901..6f12d70 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 _0x37f7=['Team','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x397bd5,_0x268806){var _0x4d96d6=function(_0x7b5cfd){while(--_0x7b5cfd){_0x397bd5['push'](_0x397bd5['shift']());}};_0x4d96d6(++_0x268806);}(_0x37f7,0xd0));var _0x737f=function(_0x11cfbf,_0x4823ad){_0x11cfbf=_0x11cfbf-0x0;var _0x116bec=_0x37f7[_0x11cfbf];return _0x116bec;};'use strict';var EventEmitter=require(_0x737f('0x0'));var Team=require(_0x737f('0x1'))['db'][_0x737f('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x737f('0x3')](0x0);var events={'afterCreate':_0x737f('0x4'),'afterUpdate':_0x737f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x39be41){return function(_0xa8efda,_0x4ce86e,_0x251580){TeamEvents[_0x737f('0x6')](_0x39be41+':'+_0xa8efda['id'],_0xa8efda);TeamEvents[_0x737f('0x6')](_0x39be41,_0xa8efda);_0x251580(null);};}for(var e in events){if(events[_0x737f('0x7')](e)){var event=events[e];Team[_0x737f('0x8')](e,emitEvent(event));}}module[_0x737f('0x9')]=TeamEvents; \ No newline at end of file +var _0x3fd5=['emit','hook','exports','../../mysqldb','Team','setMaxListeners','save','remove'];(function(_0x25806f,_0x16dbdd){var _0x163f12=function(_0x3d1990){while(--_0x3d1990){_0x25806f['push'](_0x25806f['shift']());}};_0x163f12(++_0x16dbdd);}(_0x3fd5,0x143));var _0x53fd=function(_0x147e91,_0x17aae8){_0x147e91=_0x147e91-0x0;var _0x3a2e14=_0x3fd5[_0x147e91];return _0x3a2e14;};'use strict';var EventEmitter=require('events');var Team=require(_0x53fd('0x0'))['db'][_0x53fd('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x53fd('0x2')](0x0);var events={'afterCreate':_0x53fd('0x3'),'afterUpdate':'update','afterDestroy':_0x53fd('0x4')};function emitEvent(_0x58e978){return function(_0x209cff,_0x12ac9f,_0x147063){TeamEvents['emit'](_0x58e978+':'+_0x209cff['id'],_0x209cff);TeamEvents[_0x53fd('0x5')](_0x58e978,_0x209cff);_0x147063(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x53fd('0x6')](e,emitEvent(event));}}module[_0x53fd('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 9bd5bbd..d6d6285 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 _0x8a69=['lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./team.attributes','exports','define','Team','teams'];(function(_0x2a28d2,_0x28be05){var _0x1237d9=function(_0x6d34ae){while(--_0x6d34ae){_0x2a28d2['push'](_0x2a28d2['shift']());}};_0x1237d9(++_0x28be05);}(_0x8a69,0xe4));var _0x98a6=function(_0x4fb29f,_0x1463e5){_0x4fb29f=_0x4fb29f-0x0;var _0x5a1ae5=_0x8a69[_0x4fb29f];return _0x5a1ae5;};'use strict';var _=require(_0x98a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x98a6('0x1'));var moment=require(_0x98a6('0x2'));var BPromise=require(_0x98a6('0x3'));var rp=require(_0x98a6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x98a6('0x5'));var config=require(_0x98a6('0x6'));var attributes=require(_0x98a6('0x7'));module[_0x98a6('0x8')]=function(_0x2aa051,_0x4f075e){return _0x2aa051[_0x98a6('0x9')](_0x98a6('0xa'),attributes,{'tableName':_0x98a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d60=['Team','teams','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define'];(function(_0xd62e7a,_0xac4f19){var _0x1bf0c8=function(_0x5f6f96){while(--_0x5f6f96){_0xd62e7a['push'](_0xd62e7a['shift']());}};_0x1bf0c8(++_0xac4f19);}(_0x1d60,0x106));var _0x01d6=function(_0x58fd90,_0x21358b){_0x58fd90=_0x58fd90-0x0;var _0x1542d4=_0x1d60[_0x58fd90];return _0x1542d4;};'use strict';var _=require(_0x01d6('0x0'));var util=require(_0x01d6('0x1'));var logger=require(_0x01d6('0x2'))('api');var moment=require(_0x01d6('0x3'));var BPromise=require('bluebird');var rp=require(_0x01d6('0x4'));var fs=require('fs');var path=require(_0x01d6('0x5'));var rimraf=require(_0x01d6('0x6'));var config=require(_0x01d6('0x7'));var attributes=require(_0x01d6('0x8'));module[_0x01d6('0x9')]=function(_0x562d26,_0x7d0c10){return _0x562d26[_0x01d6('0xa')](_0x01d6('0xb'),attributes,{'tableName':_0x01d6('0xc'),'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 1abef5d..a6fe249 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 _0xb2d1=['Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','./team.socket','register','then','info','Team,\x20%s,\x20%s','debug'];(function(_0x56ced2,_0x3042e1){var _0x28e5f6=function(_0x1ea45f){while(--_0x1ea45f){_0x56ced2['push'](_0x56ced2['shift']());}};_0x28e5f6(++_0x3042e1);}(_0xb2d1,0x150));var _0x1b2d=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xb2d1[_0x3e2fcf];return _0x497db7;};'use strict';var _=require(_0x1b2d('0x0'));var util=require('util');var moment=require(_0x1b2d('0x1'));var BPromise=require(_0x1b2d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b2d('0x3'));var db=require(_0x1b2d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b2d('0x5'))('rpc');var config=require(_0x1b2d('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x1b2d('0x7')]=_[_0x1b2d('0x8')](config[_0x1b2d('0x7')],{'host':_0x1b2d('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b2d('0x7')]));require(_0x1b2d('0xa'))[_0x1b2d('0xb')](socket);function respondWithRpcPromise(_0xe6008c,_0x29eefc,_0xdc8844){return new BPromise(function(_0x14dd58,_0x411523){return client['request'](_0xe6008c,_0xdc8844)[_0x1b2d('0xc')](function(_0x519515){logger[_0x1b2d('0xd')](_0x1b2d('0xe'),_0x29eefc,'request\x20sent');logger[_0x1b2d('0xf')](_0x1b2d('0x10'),_0x29eefc,_0x1b2d('0x11'),JSON[_0x1b2d('0x12')](_0x519515));if(_0x519515[_0x1b2d('0x13')]){if(_0x519515['error']['code']===0x1f4){logger[_0x1b2d('0x13')](_0x1b2d('0xe'),_0x29eefc,_0x519515['error'][_0x1b2d('0x14')]);return _0x411523(_0x519515[_0x1b2d('0x13')][_0x1b2d('0x14')]);}logger[_0x1b2d('0x13')](_0x1b2d('0xe'),_0x29eefc,_0x519515[_0x1b2d('0x13')]['message']);return _0x14dd58(_0x519515[_0x1b2d('0x13')][_0x1b2d('0x14')]);}else{logger['info'](_0x1b2d('0xe'),_0x29eefc,_0x1b2d('0x11'));_0x14dd58(_0x519515['result'][_0x1b2d('0x14')]);}})[_0x1b2d('0x15')](function(_0xd84aef){logger[_0x1b2d('0x13')]('Team,\x20%s,\x20%s',_0x29eefc,_0xd84aef);_0x411523(_0xd84aef);});});} \ No newline at end of file +var _0x9738=['redis','localhost','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x307101,_0x45fd0a){var _0x5d4775=function(_0x5864ff){while(--_0x5864ff){_0x307101['push'](_0x307101['shift']());}};_0x5d4775(++_0x45fd0a);}(_0x9738,0x75));var _0x8973=function(_0x5bfdbb,_0x7c3752){_0x5bfdbb=_0x5bfdbb-0x0;var _0x5a62b6=_0x9738[_0x5bfdbb];return _0x5a62b6;};'use strict';var _=require(_0x8973('0x0'));var util=require(_0x8973('0x1'));var moment=require(_0x8973('0x2'));var BPromise=require(_0x8973('0x3'));var rs=require(_0x8973('0x4'));var fs=require('fs');var Redis=require(_0x8973('0x5'));var db=require(_0x8973('0x6'))['db'];var utils=require(_0x8973('0x7'));var logger=require(_0x8973('0x8'))(_0x8973('0x9'));var config=require('../../config/environment');var jayson=require(_0x8973('0xa'));var client=jayson[_0x8973('0xb')][_0x8973('0xc')]({'port':0x232a});config[_0x8973('0xd')]=_['defaults'](config[_0x8973('0xd')],{'host':_0x8973('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8973('0xf'))[_0x8973('0x10')](socket);function respondWithRpcPromise(_0x106425,_0x2bc43f,_0x1a3f9d){return new BPromise(function(_0x481cee,_0xf1f545){return client[_0x8973('0x11')](_0x106425,_0x1a3f9d)[_0x8973('0x12')](function(_0x4dd5c8){logger[_0x8973('0x13')](_0x8973('0x14'),_0x2bc43f,_0x8973('0x15'));logger['debug'](_0x8973('0x16'),_0x2bc43f,'request\x20sent',JSON[_0x8973('0x17')](_0x4dd5c8));if(_0x4dd5c8[_0x8973('0x18')]){if(_0x4dd5c8[_0x8973('0x18')]['code']===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x2bc43f,_0x4dd5c8[_0x8973('0x18')][_0x8973('0x19')]);return _0xf1f545(_0x4dd5c8['error'][_0x8973('0x19')]);}logger[_0x8973('0x18')](_0x8973('0x14'),_0x2bc43f,_0x4dd5c8[_0x8973('0x18')][_0x8973('0x19')]);return _0x481cee(_0x4dd5c8['error'][_0x8973('0x19')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x2bc43f,_0x8973('0x15'));_0x481cee(_0x4dd5c8['result'][_0x8973('0x19')]);}})['catch'](function(_0x4beed0){logger[_0x8973('0x18')](_0x8973('0x14'),_0x2bc43f,_0x4beed0);_0xf1f545(_0x4beed0);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 40db1b5..f7c3660 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 _0xf485=['remove','emit','register','length','team:','./team.events'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0xf485,0x1af));var _0x5f48=function(_0x54b697,_0x56586f){_0x54b697=_0x54b697-0x0;var _0x48d110=_0xf485[_0x54b697];return _0x48d110;};'use strict';var TeamEvents=require(_0x5f48('0x0'));var events=['save',_0x5f48('0x1'),'update'];function createListener(_0x2e7b21,_0x299b5c){return function(_0x54a596){_0x299b5c[_0x5f48('0x2')](_0x2e7b21,_0x54a596);};}function removeListener(_0x624603,_0x1266d0){return function(){TeamEvents['removeListener'](_0x624603,_0x1266d0);};}exports[_0x5f48('0x3')]=function(_0x3859af){for(var _0x447ae8=0x0,_0x427713=events[_0x5f48('0x4')];_0x447ae8<_0x427713;_0x447ae8++){var _0x475a1a=events[_0x447ae8];var _0x1c33dd=createListener(_0x5f48('0x5')+_0x475a1a,_0x3859af);TeamEvents['on'](_0x475a1a,_0x1c33dd);}}; \ No newline at end of file +var _0x7b10=['emit','removeListener','length','team:','./team.events','save','remove','update'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x7b10,0x1ac));var _0x07b1=function(_0x323460,_0x134f2b){_0x323460=_0x323460-0x0;var _0x3c540d=_0x7b10[_0x323460];return _0x3c540d;};'use strict';var TeamEvents=require(_0x07b1('0x0'));var events=[_0x07b1('0x1'),_0x07b1('0x2'),_0x07b1('0x3')];function createListener(_0x2493b7,_0x5711dc){return function(_0xbc25fb){_0x5711dc[_0x07b1('0x4')](_0x2493b7,_0xbc25fb);};}function removeListener(_0x7c39e7,_0x443b4f){return function(){TeamEvents[_0x07b1('0x5')](_0x7c39e7,_0x443b4f);};}exports['register']=function(_0x3cf5e4){for(var _0x106f8d=0x0,_0xece33d=events[_0x07b1('0x6')];_0x106f8d<_0xece33d;_0x106f8d++){var _0x1bfc1d=events[_0x106f8d];var _0x2bd721=createListener(_0x07b1('0x7')+_0x1bfc1d,_0x3cf5e4);TeamEvents['on'](_0x1bfc1d,_0x2bd721);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 48a869a..1c17034 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 _0x2182=['sequelize','exports','INTEGER'];(function(_0x13083c,_0xdfd4b4){var _0x37704d=function(_0x18d253){while(--_0x18d253){_0x13083c['push'](_0x13083c['shift']());}};_0x37704d(++_0xdfd4b4);}(_0x2182,0xea));var _0x2218=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2182[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x2218('0x0'));module[_0x2218('0x1')]={'TeamId':{'type':Sequelize[_0x2218('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x2218('0x2')]}}; \ No newline at end of file +var _0xb088=['sequelize','exports','INTEGER'];(function(_0x1542f1,_0x5dd8b0){var _0x1e54c6=function(_0x30b197){while(--_0x30b197){_0x1542f1['push'](_0x1542f1['shift']());}};_0x1e54c6(++_0x5dd8b0);}(_0xb088,0x7b));var _0x8b08=function(_0x8b1c66,_0x280022){_0x8b1c66=_0x8b1c66-0x0;var _0x4d73a2=_0xb088[_0x8b1c66];return _0x4d73a2;};'use strict';var Sequelize=require(_0x8b08('0x0'));module[_0x8b08('0x1')]={'TeamId':{'type':Sequelize[_0x8b08('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x8b08('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index bf7c274..215665c 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 _0x34b7=['request-promise','path','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','../../config/logger','api','moment','bluebird'];(function(_0x51f012,_0x629f0d){var _0x1e3e8f=function(_0x5f4175){while(--_0x5f4175){_0x51f012['push'](_0x51f012['shift']());}};_0x1e3e8f(++_0x629f0d);}(_0x34b7,0x196));var _0x734b=function(_0x74118b,_0x239694){_0x74118b=_0x74118b-0x0;var _0x257525=_0x34b7[_0x74118b];return _0x257525;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x734b('0x0'))(_0x734b('0x1'));var moment=require(_0x734b('0x2'));var BPromise=require(_0x734b('0x3'));var rp=require(_0x734b('0x4'));var fs=require('fs');var path=require(_0x734b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x734b('0x6'));module[_0x734b('0x7')]=function(_0x2f3128,_0x34fd70){return _0x2f3128[_0x734b('0x8')](_0x734b('0x9'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7980=['../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x491608,_0x328619){var _0x1e4c05=function(_0x24bd8b){while(--_0x24bd8b){_0x491608['push'](_0x491608['shift']());}};_0x1e4c05(++_0x328619);}(_0x7980,0x123));var _0x0798=function(_0x50ffd4,_0x54eced){_0x50ffd4=_0x50ffd4-0x0;var _0x244f3f=_0x7980[_0x50ffd4];return _0x244f3f;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var logger=require('../../config/logger')(_0x0798('0x2'));var moment=require(_0x0798('0x3'));var BPromise=require(_0x0798('0x4'));var rp=require(_0x0798('0x5'));var fs=require('fs');var path=require(_0x0798('0x6'));var rimraf=require(_0x0798('0x7'));var config=require(_0x0798('0x8'));var attributes=require(_0x0798('0x9'));module['exports']=function(_0x12ea59,_0x22a15f){return _0x12ea59[_0x0798('0xa')](_0x0798('0xb'),attributes,{'tableName':_0x0798('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 91b0cef..4675b10 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x360585,_0x2284ce){var _0x5371e4=function(_0x47c698){while(--_0x47c698){_0x360585['push'](_0x360585['shift']());}};_0x5371e4(++_0x2284ce);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2f965f,_0x100aca){var _0x73f2b9=function(_0x25705d){while(--_0x25705d){_0x2f965f['push'](_0x2f965f['shift']());}};_0x73f2b9(++_0x100aca);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 178e71a..f734644 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 _0x1979=['sequelize','INTEGER'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0x1979,0xa2));var _0x9197=function(_0x75ce5b,_0x3b582f){_0x75ce5b=_0x75ce5b-0x0;var _0x22195e=_0x1979[_0x75ce5b];return _0x22195e;};'use strict';var Sequelize=require(_0x9197('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9197('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb524=['INTEGER','exports'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xb524,0xcd));var _0x4b52=function(_0x411365,_0xad8c71){_0x411365=_0x411365-0x0;var _0x3f3c29=_0xb524[_0x411365];return _0x3f3c29;};'use strict';var Sequelize=require('sequelize');module[_0x4b52('0x0')]={'penalty':{'type':Sequelize[_0x4b52('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index c875303..6e0950f 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 _0x14ee=['team_has_voice_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue'];(function(_0x54cdb2,_0x4e0001){var _0x329b25=function(_0x1dc1db){while(--_0x1dc1db){_0x54cdb2['push'](_0x54cdb2['shift']());}};_0x329b25(++_0x4e0001);}(_0x14ee,0x115));var _0xe14e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x14ee[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe14e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe14e('0x1'));var moment=require(_0xe14e('0x2'));var BPromise=require(_0xe14e('0x3'));var rp=require(_0xe14e('0x4'));var fs=require('fs');var path=require(_0xe14e('0x5'));var rimraf=require(_0xe14e('0x6'));var config=require(_0xe14e('0x7'));var attributes=require(_0xe14e('0x8'));module['exports']=function(_0x55d396,_0x4c78d1){return _0x55d396[_0xe14e('0x9')](_0xe14e('0xa'),attributes,{'tableName':_0xe14e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2333=['../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','moment','bluebird','path','rimraf'];(function(_0x575c59,_0x69a429){var _0x1af0f1=function(_0x1f1d09){while(--_0x1f1d09){_0x575c59['push'](_0x575c59['shift']());}};_0x1af0f1(++_0x69a429);}(_0x2333,0x11a));var _0x3233=function(_0x338940,_0x17ce8a){_0x338940=_0x338940-0x0;var _0x3ca9a9=_0x2333[_0x338940];return _0x3ca9a9;};'use strict';var _=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3233('0x2'));var BPromise=require(_0x3233('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3233('0x4'));var rimraf=require(_0x3233('0x5'));var config=require(_0x3233('0x6'));var attributes=require(_0x3233('0x7'));module[_0x3233('0x8')]=function(_0x31452c,_0x4120f6){return _0x31452c[_0x3233('0x9')](_0x3233('0xa'),attributes,{'tableName':_0x3233('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 34c8e64..c65e05a 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 _0x04e5=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x478e79,_0x3d51de){var _0x38f3d7=function(_0x3625af){while(--_0x3625af){_0x478e79['push'](_0x478e79['shift']());}};_0x38f3d7(++_0x3d51de);}(_0x04e5,0x1e8));var _0x504e=function(_0x59efc4,_0x2fa41c){_0x59efc4=_0x59efc4-0x0;var _0x175a0b=_0x04e5[_0x59efc4];return _0x175a0b;};'use strict';var _=require(_0x504e('0x0'));var util=require(_0x504e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x504e('0x2'));var fs=require('fs');var Redis=require(_0x504e('0x3'));var db=require(_0x504e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x504e('0x5'));var jayson=require(_0x504e('0x6'));var client=jayson[_0x504e('0x7')][_0x504e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27f0a3,_0x55ed9a,_0xb6fa5f){return new BPromise(function(_0x51d497,_0x21c7f7){return client['request'](_0x27f0a3,_0xb6fa5f)[_0x504e('0x9')](function(_0x15ffb3){logger['info'](_0x504e('0xa'),_0x55ed9a,_0x504e('0xb'));logger[_0x504e('0xc')](_0x504e('0xd'),_0x55ed9a,_0x504e('0xb'),JSON[_0x504e('0xe')](_0x15ffb3));if(_0x15ffb3[_0x504e('0xf')]){if(_0x15ffb3['error'][_0x504e('0x10')]===0x1f4){logger[_0x504e('0xf')](_0x504e('0xa'),_0x55ed9a,_0x15ffb3[_0x504e('0xf')]['message']);return _0x21c7f7(_0x15ffb3[_0x504e('0xf')]['message']);}logger[_0x504e('0xf')](_0x504e('0xa'),_0x55ed9a,_0x15ffb3[_0x504e('0xf')][_0x504e('0x11')]);return _0x51d497(_0x15ffb3[_0x504e('0xf')]['message']);}else{logger['info'](_0x504e('0xa'),_0x55ed9a,_0x504e('0xb'));_0x51d497(_0x15ffb3[_0x504e('0x12')][_0x504e('0x11')]);}})[_0x504e('0x13')](function(_0x251878){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x55ed9a,_0x251878);_0x21c7f7(_0x251878);});});} \ No newline at end of file +var _0x7d19=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird'];(function(_0x2aa4e8,_0x2dafe5){var _0x251709=function(_0x203184){while(--_0x203184){_0x2aa4e8['push'](_0x2aa4e8['shift']());}};_0x251709(++_0x2dafe5);}(_0x7d19,0x9e));var _0x97d1=function(_0xa0ab99,_0x5496c1){_0xa0ab99=_0xa0ab99-0x0;var _0x3bf6b5=_0x7d19[_0xa0ab99];return _0x3bf6b5;};'use strict';var _=require(_0x97d1('0x0'));var util=require('util');var moment=require(_0x97d1('0x1'));var BPromise=require(_0x97d1('0x2'));var rs=require(_0x97d1('0x3'));var fs=require('fs');var Redis=require(_0x97d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97d1('0x5'));var logger=require(_0x97d1('0x6'))(_0x97d1('0x7'));var config=require(_0x97d1('0x8'));var jayson=require(_0x97d1('0x9'));var client=jayson[_0x97d1('0xa')][_0x97d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c26e0,_0x494a1e,_0x5236c6){return new BPromise(function(_0x58312a,_0x2f0b27){return client[_0x97d1('0xc')](_0x3c26e0,_0x5236c6)[_0x97d1('0xd')](function(_0x25ed01){logger[_0x97d1('0xe')](_0x97d1('0xf'),_0x494a1e,'request\x20sent');logger['debug'](_0x97d1('0x10'),_0x494a1e,_0x97d1('0x11'),JSON[_0x97d1('0x12')](_0x25ed01));if(_0x25ed01[_0x97d1('0x13')]){if(_0x25ed01[_0x97d1('0x13')][_0x97d1('0x14')]===0x1f4){logger['error'](_0x97d1('0xf'),_0x494a1e,_0x25ed01[_0x97d1('0x13')]['message']);return _0x2f0b27(_0x25ed01[_0x97d1('0x13')]['message']);}logger[_0x97d1('0x13')](_0x97d1('0xf'),_0x494a1e,_0x25ed01[_0x97d1('0x13')][_0x97d1('0x15')]);return _0x58312a(_0x25ed01[_0x97d1('0x13')][_0x97d1('0x15')]);}else{logger[_0x97d1('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x494a1e,_0x97d1('0x11'));_0x58312a(_0x25ed01['result'][_0x97d1('0x15')]);}})[_0x97d1('0x16')](function(_0x4b67be){logger[_0x97d1('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x494a1e,_0x4b67be);_0x2f0b27(_0x4b67be);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ce3c713..a0313e3 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 _0xa486=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa486,0x17d));var _0x6a48=function(_0x99ee0c,_0x4f10a8){_0x99ee0c=_0x99ee0c-0x0;var _0x4a2c98=_0xa486[_0x99ee0c];return _0x4a2c98;};'use strict';var multer=require(_0x6a48('0x0'));var util=require('util');var path=require(_0x6a48('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a48('0x2'));var router=express['Router']();var fs_extra=require(_0x6a48('0x3'));var auth=require(_0x6a48('0x4'));var interaction=require(_0x6a48('0x5'));var config=require(_0x6a48('0x6'));var controller=require(_0x6a48('0x7'));router[_0x6a48('0x8')]('/',auth[_0x6a48('0x9')](),controller[_0x6a48('0xa')]);router[_0x6a48('0x8')](_0x6a48('0xb'),auth[_0x6a48('0x9')](),controller[_0x6a48('0xc')]);router[_0x6a48('0xd')]('/',auth[_0x6a48('0x9')](),controller[_0x6a48('0xe')]);router[_0x6a48('0xf')]('/:id',auth[_0x6a48('0x9')](),controller['update']);router[_0x6a48('0x10')](_0x6a48('0xb'),auth[_0x6a48('0x9')](),controller[_0x6a48('0x11')]);module[_0x6a48('0x12')]=router; \ No newline at end of file +var _0xb78e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x1d05c2,_0x1a6c2d){var _0x4766f5=function(_0xa0df0){while(--_0xa0df0){_0x1d05c2['push'](_0x1d05c2['shift']());}};_0x4766f5(++_0x1a6c2d);}(_0xb78e,0x1c9));var _0xeb78=function(_0x49df93,_0x524a6e){_0x49df93=_0x49df93-0x0;var _0x4c6eb3=_0xb78e[_0x49df93];return _0x4c6eb3;};'use strict';var multer=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var path=require('path');var timeout=require(_0xeb78('0x2'));var express=require(_0xeb78('0x3'));var router=express[_0xeb78('0x4')]();var fs_extra=require(_0xeb78('0x5'));var auth=require(_0xeb78('0x6'));var interaction=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var controller=require(_0xeb78('0x9'));router['get']('/',auth[_0xeb78('0xa')](),controller[_0xeb78('0xb')]);router[_0xeb78('0xc')](_0xeb78('0xd'),auth[_0xeb78('0xa')](),controller[_0xeb78('0xe')]);router[_0xeb78('0xf')]('/',auth['isAuthenticated'](),controller[_0xeb78('0x10')]);router[_0xeb78('0x11')](_0xeb78('0xd'),auth[_0xeb78('0xa')](),controller[_0xeb78('0x12')]);router[_0xeb78('0x13')](_0xeb78('0xd'),auth[_0xeb78('0xa')](),controller[_0xeb78('0x14')]);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 1f49b56..d2cf18c 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 _0xb7c4=['STRING','TEXT','exports'];(function(_0x53ddea,_0x94e95d){var _0x36a628=function(_0x2b66a6){while(--_0x2b66a6){_0x53ddea['push'](_0x53ddea['shift']());}};_0x36a628(++_0x94e95d);}(_0xb7c4,0x116));var _0x4b7c=function(_0x1fd5b5,_0x22f904){_0x1fd5b5=_0x1fd5b5-0x0;var _0x2b0881=_0xb7c4[_0x1fd5b5];return _0x2b0881;};'use strict';var Sequelize=require('sequelize');module[_0x4b7c('0x0')]={'name':{'type':Sequelize[_0x4b7c('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x4b7c('0x2')]}}; \ No newline at end of file +var _0xf45a=['TEXT','sequelize','exports','STRING'];(function(_0x13d529,_0x3ac403){var _0x163cad=function(_0x5bf2c6){while(--_0x5bf2c6){_0x13d529['push'](_0x13d529['shift']());}};_0x163cad(++_0x3ac403);}(_0xf45a,0x85));var _0xaf45=function(_0x44b24b,_0x20c709){_0x44b24b=_0x44b24b-0x0;var _0xe682c0=_0xf45a[_0x44b24b];return _0xe682c0;};'use strict';var Sequelize=require(_0xaf45('0x0'));module[_0xaf45('0x1')]={'name':{'type':Sequelize[_0xaf45('0x2')]},'description':{'type':Sequelize[_0xaf45('0x2')]},'html':{'type':Sequelize[_0xaf45('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 448ea4f..8cfd250 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 _0x2987=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','Templates','UserProfileResource','destroy','name','send','index','Template','rawAttributes','type','key','model','map','query','keys','intersection'];(function(_0x3da66a,_0x6a5f21){var _0x1f136d=function(_0x422711){while(--_0x422711){_0x3da66a['push'](_0x3da66a['shift']());}};_0x1f136d(++_0x6a5f21);}(_0x2987,0x1bd));var _0x7298=function(_0x4c6373,_0x47cb5d){_0x4c6373=_0x4c6373-0x0;var _0x8ed848=_0x2987[_0x4c6373];return _0x8ed848;};'use strict';var emlformat=require(_0x7298('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7298('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7298('0x2'));var BPromise=require(_0x7298('0x3'));var Mustache=require('mustache');var util=require(_0x7298('0x4'));var path=require(_0x7298('0x5'));var sox=require(_0x7298('0x6'));var csv=require(_0x7298('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7298('0x8'));var _=require(_0x7298('0x9'));var squel=require(_0x7298('0xa'));var crypto=require(_0x7298('0xb'));var jsforce=require(_0x7298('0xc'));var deskjs=require(_0x7298('0xd'));var toCsv=require(_0x7298('0x7'));var querystring=require('querystring');var Papa=require(_0x7298('0xe'));var Redis=require(_0x7298('0xf'));var authService=require(_0x7298('0x10'));var qs=require(_0x7298('0x11'));var as=require(_0x7298('0x12'));var hardwareService=require(_0x7298('0x13'));var logger=require(_0x7298('0x14'))(_0x7298('0x15'));var utils=require(_0x7298('0x16'));var config=require(_0x7298('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7298('0x18'))['db'];function respondWithStatusCode(_0x5469bf,_0x4b34a2){_0x4b34a2=_0x4b34a2||0xcc;return function(_0x38d09a){if(_0x38d09a){return _0x5469bf[_0x7298('0x19')](_0x4b34a2);}return _0x5469bf['status'](_0x4b34a2)[_0x7298('0x1a')]();};}function respondWithResult(_0xa55688,_0x238e66){_0x238e66=_0x238e66||0xc8;return function(_0x296ad1){if(_0x296ad1){return _0xa55688[_0x7298('0x1b')](_0x238e66)[_0x7298('0x1c')](_0x296ad1);}};}function respondWithFilteredResult(_0x311c65,_0x5c0efd){return function(_0x531f5e){if(_0x531f5e){var _0x3f9313=typeof _0x5c0efd[_0x7298('0x1d')]===_0x7298('0x1e')&&typeof _0x5c0efd[_0x7298('0x1f')]===_0x7298('0x1e');var _0xc8d889=_0x531f5e[_0x7298('0x20')];var _0x310003=_0x3f9313?0x0:_0x5c0efd[_0x7298('0x1d')];var _0x1d8604=_0x3f9313?_0x531f5e[_0x7298('0x20')]:_0x5c0efd[_0x7298('0x1d')]+_0x5c0efd['limit'];var _0x59c98a;if(_0x1d8604>=_0xc8d889){_0x1d8604=_0xc8d889;_0x59c98a=0xc8;}else{_0x59c98a=0xce;}_0x311c65[_0x7298('0x1b')](_0x59c98a);return _0x311c65[_0x7298('0x21')](_0x7298('0x22'),_0x310003+'-'+_0x1d8604+'/'+_0xc8d889)['json'](_0x531f5e);}return null;};}function patchUpdates(_0x3fc698){return function(_0x967e18){try{jsonpatch['apply'](_0x967e18,_0x3fc698,!![]);}catch(_0x482aa4){return BPromise[_0x7298('0x23')](_0x482aa4);}return _0x967e18['save']();};}function saveUpdates(_0x2b311f,_0x359bf3){return function(_0x4a8c47){if(_0x4a8c47){return _0x4a8c47[_0x7298('0x24')](_0x2b311f)[_0x7298('0x25')](function(_0x4d3009){return _0x4d3009;});}return null;};}function removeEntity(_0x4c31dc,_0x1b3530){return function(_0x165bcc){if(_0x165bcc){return _0x165bcc['destroy']()[_0x7298('0x25')](function(){var _0x50633b=_0x165bcc['get']({'plain':!![]});var _0x4c011a=_0x7298('0x26');return db[_0x7298('0x27')][_0x7298('0x28')]({'where':{'type':_0x4c011a,'resourceId':_0x50633b['id']}})['then'](function(){return _0x165bcc;});})[_0x7298('0x25')](function(){_0x4c31dc[_0x7298('0x1b')](0xcc)[_0x7298('0x1a')]();});}};}function handleEntityNotFound(_0x220032,_0x3263c3){return function(_0x4f8bed){if(!_0x4f8bed){_0x220032['sendStatus'](0x194);}return _0x4f8bed;};}function handleError(_0xc09157,_0x20e43c){_0x20e43c=_0x20e43c||0x1f4;return function(_0x3e5760){logger['error'](_0x3e5760['stack']);if(_0x3e5760[_0x7298('0x29')]){delete _0x3e5760[_0x7298('0x29')];}_0xc09157[_0x7298('0x1b')](_0x20e43c)[_0x7298('0x2a')](_0x3e5760);};}exports[_0x7298('0x2b')]=function(_0x1b62b7,_0x1acc73){var _0x3d915a={},_0x60b40d={},_0x4e3f57={'count':0x0,'rows':[]};var _0x578210=_['map'](db[_0x7298('0x2c')][_0x7298('0x2d')],function(_0x31e0ff){return{'name':_0x31e0ff['fieldName'],'type':_0x31e0ff[_0x7298('0x2e')][_0x7298('0x2f')]};});_0x60b40d[_0x7298('0x30')]=_[_0x7298('0x31')](_0x578210,_0x7298('0x29'));_0x60b40d[_0x7298('0x32')]=_[_0x7298('0x33')](_0x1b62b7[_0x7298('0x32')]);_0x60b40d['filters']=_[_0x7298('0x34')](_0x60b40d[_0x7298('0x30')],_0x60b40d['query']);_0x3d915a[_0x7298('0x35')]=_[_0x7298('0x34')](_0x60b40d['model'],qs[_0x7298('0x36')](_0x1b62b7[_0x7298('0x32')][_0x7298('0x36')]));_0x3d915a[_0x7298('0x35')]=_0x3d915a[_0x7298('0x35')][_0x7298('0x37')]?_0x3d915a[_0x7298('0x35')]:_0x60b40d[_0x7298('0x30')];if(!_0x1b62b7['query'][_0x7298('0x38')](_0x7298('0x39'))){_0x3d915a[_0x7298('0x1f')]=qs[_0x7298('0x1f')](_0x1b62b7['query'][_0x7298('0x1f')]);_0x3d915a['offset']=qs['offset'](_0x1b62b7[_0x7298('0x32')][_0x7298('0x1d')]);}_0x3d915a[_0x7298('0x3a')]=qs[_0x7298('0x3b')](_0x1b62b7['query'][_0x7298('0x3b')]);_0x3d915a[_0x7298('0x3c')]=qs[_0x7298('0x3d')](_[_0x7298('0x3e')](_0x1b62b7[_0x7298('0x32')],_0x60b40d[_0x7298('0x3d')]),_0x578210);if(_0x1b62b7[_0x7298('0x32')][_0x7298('0x3f')]){_0x3d915a[_0x7298('0x3c')]=_[_0x7298('0x40')](_0x3d915a[_0x7298('0x3c')],{'$or':_['map'](_0x578210,function(_0x47b220){if(_0x47b220[_0x7298('0x2e')]!==_0x7298('0x41')){var _0x4847bc={};_0x4847bc[_0x47b220[_0x7298('0x29')]]={'$like':'%'+_0x1b62b7['query'][_0x7298('0x3f')]+'%'};return _0x4847bc;}})});}_0x3d915a=_[_0x7298('0x40')]({},_0x3d915a,_0x1b62b7[_0x7298('0x42')]);var _0x8689cf={'where':_0x3d915a[_0x7298('0x3c')]};return db[_0x7298('0x2c')]['count'](_0x8689cf)[_0x7298('0x25')](function(_0x2d4d11){_0x4e3f57['count']=_0x2d4d11;if(_0x1b62b7[_0x7298('0x32')][_0x7298('0x43')]){_0x3d915a[_0x7298('0x44')]=[{'all':!![]}];}return db['Template']['findAll'](_0x3d915a);})[_0x7298('0x25')](function(_0x5ec377){_0x4e3f57[_0x7298('0x45')]=_0x5ec377;return _0x4e3f57;})[_0x7298('0x25')](respondWithFilteredResult(_0x1acc73,_0x3d915a))['catch'](handleError(_0x1acc73,null));};exports['show']=function(_0x3ff0f6,_0x5329cb){var _0x254c64={'raw':!![],'where':{'id':_0x3ff0f6[_0x7298('0x46')]['id']}},_0x2c3eb8={};_0x2c3eb8['model']=_[_0x7298('0x33')](db['Template']['rawAttributes']);_0x2c3eb8[_0x7298('0x32')]=_[_0x7298('0x33')](_0x3ff0f6[_0x7298('0x32')]);_0x2c3eb8['filters']=_['intersection'](_0x2c3eb8[_0x7298('0x30')],_0x2c3eb8['query']);_0x254c64[_0x7298('0x35')]=_[_0x7298('0x34')](_0x2c3eb8[_0x7298('0x30')],qs['fields'](_0x3ff0f6[_0x7298('0x32')][_0x7298('0x36')]));_0x254c64[_0x7298('0x35')]=_0x254c64[_0x7298('0x35')]['length']?_0x254c64['attributes']:_0x2c3eb8[_0x7298('0x30')];if(_0x3ff0f6[_0x7298('0x32')][_0x7298('0x43')]){_0x254c64[_0x7298('0x44')]=[{'all':!![]}];}_0x254c64=_['merge']({},_0x254c64,_0x3ff0f6[_0x7298('0x42')]);return db[_0x7298('0x2c')]['find'](_0x254c64)[_0x7298('0x25')](handleEntityNotFound(_0x5329cb,null))[_0x7298('0x25')](respondWithResult(_0x5329cb,null))[_0x7298('0x47')](handleError(_0x5329cb,null));};exports[_0x7298('0x48')]=function(_0x56ea14,_0x3dcdf5){return db['Template'][_0x7298('0x48')](_0x56ea14['body'],{})['then'](function(_0x5b333d){var _0x5650bc=_0x56ea14[_0x7298('0x49')][_0x7298('0x4a')]({'plain':!![]});if(!_0x5650bc)throw new Error(_0x7298('0x4b'));if(_0x5650bc[_0x7298('0x4c')]===_0x7298('0x49')){var _0x589da2=_0x5b333d[_0x7298('0x4a')]({'plain':!![]});var _0x491dde=_0x7298('0x26');return db['UserProfileSection'][_0x7298('0x4d')]({'where':{'name':_0x491dde,'userProfileId':_0x5650bc[_0x7298('0x4e')]},'raw':!![]})[_0x7298('0x25')](function(_0x315b2c){if(_0x315b2c&&_0x315b2c[_0x7298('0x4f')]===0x0){return db[_0x7298('0x27')][_0x7298('0x48')]({'name':_0x589da2[_0x7298('0x29')],'resourceId':_0x589da2['id'],'type':_0x315b2c[_0x7298('0x29')],'sectionId':_0x315b2c['id']},{})[_0x7298('0x25')](function(){return _0x5b333d;});}else{return _0x5b333d;}})[_0x7298('0x47')](function(_0x494391){logger[_0x7298('0x50')](_0x7298('0x51'),_0x494391);throw _0x494391;});}return _0x5b333d;})['then'](respondWithResult(_0x3dcdf5,0xc9))['catch'](handleError(_0x3dcdf5,null));};exports[_0x7298('0x24')]=function(_0x2c9486,_0x4c1db7){if(_0x2c9486[_0x7298('0x52')]['id']){delete _0x2c9486['body']['id'];}return db['Template'][_0x7298('0x4d')]({'where':{'id':_0x2c9486['params']['id']}})['then'](handleEntityNotFound(_0x4c1db7,null))['then'](saveUpdates(_0x2c9486[_0x7298('0x52')],null))[_0x7298('0x25')](respondWithResult(_0x4c1db7,null))[_0x7298('0x47')](handleError(_0x4c1db7,null));};exports[_0x7298('0x28')]=function(_0x37802d,_0x567608){return db[_0x7298('0x2c')]['find']({'where':{'id':_0x37802d[_0x7298('0x46')]['id']}})['then'](handleEntityNotFound(_0x567608,null))[_0x7298('0x25')](removeEntity(_0x567608,null))['catch'](handleError(_0x567608,null));}; \ No newline at end of file +var _0x6ea1=['map','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','Template','includeAll','findAll','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','destroy','then','get','Templates','error','stack','name','send','index'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6ea1,0x121));var _0x16ea=function(_0x1d558a,_0x2b74aa){_0x1d558a=_0x1d558a-0x0;var _0x8936ff=_0x6ea1[_0x1d558a];return _0x8936ff;};'use strict';var emlformat=require(_0x16ea('0x0'));var rimraf=require(_0x16ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16ea('0x2'));var rp=require('request-promise');var moment=require(_0x16ea('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x16ea('0x4'));var util=require(_0x16ea('0x5'));var path=require(_0x16ea('0x6'));var sox=require(_0x16ea('0x7'));var csv=require(_0x16ea('0x8'));var ejs=require(_0x16ea('0x9'));var fs=require('fs');var fs_extra=require(_0x16ea('0xa'));var _=require(_0x16ea('0xb'));var squel=require(_0x16ea('0xc'));var crypto=require('crypto');var jsforce=require(_0x16ea('0xd'));var deskjs=require(_0x16ea('0xe'));var toCsv=require(_0x16ea('0x8'));var querystring=require('querystring');var Papa=require(_0x16ea('0xf'));var Redis=require(_0x16ea('0x10'));var authService=require(_0x16ea('0x11'));var qs=require(_0x16ea('0x12'));var as=require(_0x16ea('0x13'));var hardwareService=require(_0x16ea('0x14'));var logger=require(_0x16ea('0x15'))(_0x16ea('0x16'));var utils=require(_0x16ea('0x17'));var config=require(_0x16ea('0x18'));var licenseUtil=require(_0x16ea('0x19'));var db=require(_0x16ea('0x1a'))['db'];function respondWithStatusCode(_0x3850e2,_0x440421){_0x440421=_0x440421||0xcc;return function(_0x15a809){if(_0x15a809){return _0x3850e2[_0x16ea('0x1b')](_0x440421);}return _0x3850e2[_0x16ea('0x1c')](_0x440421)[_0x16ea('0x1d')]();};}function respondWithResult(_0x19145f,_0x2479d0){_0x2479d0=_0x2479d0||0xc8;return function(_0x286fb5){if(_0x286fb5){return _0x19145f[_0x16ea('0x1c')](_0x2479d0)[_0x16ea('0x1e')](_0x286fb5);}};}function respondWithFilteredResult(_0x18d987,_0x1d8844){return function(_0x45ed75){if(_0x45ed75){var _0x52d39d=typeof _0x1d8844[_0x16ea('0x1f')]===_0x16ea('0x20')&&typeof _0x1d8844['limit']===_0x16ea('0x20');var _0x2181a9=_0x45ed75[_0x16ea('0x21')];var _0x4976bf=_0x52d39d?0x0:_0x1d8844['offset'];var _0x452b09=_0x52d39d?_0x45ed75[_0x16ea('0x21')]:_0x1d8844[_0x16ea('0x1f')]+_0x1d8844[_0x16ea('0x22')];var _0x4f108c;if(_0x452b09>=_0x2181a9){_0x452b09=_0x2181a9;_0x4f108c=0xc8;}else{_0x4f108c=0xce;}_0x18d987[_0x16ea('0x1c')](_0x4f108c);return _0x18d987[_0x16ea('0x23')]('Content-Range',_0x4976bf+'-'+_0x452b09+'/'+_0x2181a9)[_0x16ea('0x1e')](_0x45ed75);}return null;};}function patchUpdates(_0x9cd543){return function(_0x5b18b2){try{jsonpatch['apply'](_0x5b18b2,_0x9cd543,!![]);}catch(_0x51f31a){return BPromise[_0x16ea('0x24')](_0x51f31a);}return _0x5b18b2['save']();};}function saveUpdates(_0x4c7bf8,_0x252718){return function(_0x2011bc){if(_0x2011bc){return _0x2011bc[_0x16ea('0x25')](_0x4c7bf8)['then'](function(_0x5ee07e){return _0x5ee07e;});}return null;};}function removeEntity(_0xb5c0f8,_0x264666){return function(_0x6fd0c6){if(_0x6fd0c6){return _0x6fd0c6[_0x16ea('0x26')]()[_0x16ea('0x27')](function(){var _0x15ae18=_0x6fd0c6[_0x16ea('0x28')]({'plain':!![]});var _0x1d6466=_0x16ea('0x29');return db['UserProfileResource'][_0x16ea('0x26')]({'where':{'type':_0x1d6466,'resourceId':_0x15ae18['id']}})[_0x16ea('0x27')](function(){return _0x6fd0c6;});})[_0x16ea('0x27')](function(){_0xb5c0f8[_0x16ea('0x1c')](0xcc)[_0x16ea('0x1d')]();});}};}function handleEntityNotFound(_0xb1d708,_0x4a9b8c){return function(_0x2fbd52){if(!_0x2fbd52){_0xb1d708[_0x16ea('0x1b')](0x194);}return _0x2fbd52;};}function handleError(_0x7a1ee1,_0x100e40){_0x100e40=_0x100e40||0x1f4;return function(_0x2995ad){logger[_0x16ea('0x2a')](_0x2995ad[_0x16ea('0x2b')]);if(_0x2995ad[_0x16ea('0x2c')]){delete _0x2995ad[_0x16ea('0x2c')];}_0x7a1ee1[_0x16ea('0x1c')](_0x100e40)[_0x16ea('0x2d')](_0x2995ad);};}exports[_0x16ea('0x2e')]=function(_0x15ed8f,_0x3f3881){var _0x1c733a={},_0x4ff111={},_0x1a8a0d={'count':0x0,'rows':[]};var _0x195f20=_[_0x16ea('0x2f')](db['Template'][_0x16ea('0x30')],function(_0x4a59a2){return{'name':_0x4a59a2[_0x16ea('0x31')],'type':_0x4a59a2[_0x16ea('0x32')]['key']};});_0x4ff111[_0x16ea('0x33')]=_[_0x16ea('0x2f')](_0x195f20,'name');_0x4ff111['query']=_[_0x16ea('0x34')](_0x15ed8f[_0x16ea('0x35')]);_0x4ff111['filters']=_[_0x16ea('0x36')](_0x4ff111[_0x16ea('0x33')],_0x4ff111[_0x16ea('0x35')]);_0x1c733a[_0x16ea('0x37')]=_[_0x16ea('0x36')](_0x4ff111[_0x16ea('0x33')],qs[_0x16ea('0x38')](_0x15ed8f['query']['fields']));_0x1c733a[_0x16ea('0x37')]=_0x1c733a[_0x16ea('0x37')][_0x16ea('0x39')]?_0x1c733a[_0x16ea('0x37')]:_0x4ff111[_0x16ea('0x33')];if(!_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x3a')]('nolimit')){_0x1c733a['limit']=qs[_0x16ea('0x22')](_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x22')]);_0x1c733a[_0x16ea('0x1f')]=qs[_0x16ea('0x1f')](_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x1f')]);}_0x1c733a[_0x16ea('0x3b')]=qs[_0x16ea('0x3c')](_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x3c')]);_0x1c733a[_0x16ea('0x3d')]=qs[_0x16ea('0x3e')](_['pick'](_0x15ed8f[_0x16ea('0x35')],_0x4ff111[_0x16ea('0x3e')]),_0x195f20);if(_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x3f')]){_0x1c733a[_0x16ea('0x3d')]=_['merge'](_0x1c733a[_0x16ea('0x3d')],{'$or':_['map'](_0x195f20,function(_0x78a8d3){if(_0x78a8d3[_0x16ea('0x32')]!=='VIRTUAL'){var _0xbe4891={};_0xbe4891[_0x78a8d3[_0x16ea('0x2c')]]={'$like':'%'+_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x3f')]+'%'};return _0xbe4891;}})});}_0x1c733a=_[_0x16ea('0x40')]({},_0x1c733a,_0x15ed8f[_0x16ea('0x41')]);var _0x41f694={'where':_0x1c733a[_0x16ea('0x3d')]};return db[_0x16ea('0x42')][_0x16ea('0x21')](_0x41f694)[_0x16ea('0x27')](function(_0x47ddb0){_0x1a8a0d['count']=_0x47ddb0;if(_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x43')]){_0x1c733a['include']=[{'all':!![]}];}return db[_0x16ea('0x42')][_0x16ea('0x44')](_0x1c733a);})[_0x16ea('0x27')](function(_0x2c4495){_0x1a8a0d['rows']=_0x2c4495;return _0x1a8a0d;})[_0x16ea('0x27')](respondWithFilteredResult(_0x3f3881,_0x1c733a))[_0x16ea('0x45')](handleError(_0x3f3881,null));};exports[_0x16ea('0x46')]=function(_0x2d0bc0,_0x396800){var _0x8e9e4={'raw':!![],'where':{'id':_0x2d0bc0[_0x16ea('0x47')]['id']}},_0x4ea8e2={};_0x4ea8e2['model']=_['keys'](db[_0x16ea('0x42')][_0x16ea('0x30')]);_0x4ea8e2[_0x16ea('0x35')]=_[_0x16ea('0x34')](_0x2d0bc0[_0x16ea('0x35')]);_0x4ea8e2['filters']=_['intersection'](_0x4ea8e2[_0x16ea('0x33')],_0x4ea8e2[_0x16ea('0x35')]);_0x8e9e4[_0x16ea('0x37')]=_['intersection'](_0x4ea8e2['model'],qs['fields'](_0x2d0bc0[_0x16ea('0x35')][_0x16ea('0x38')]));_0x8e9e4[_0x16ea('0x37')]=_0x8e9e4['attributes'][_0x16ea('0x39')]?_0x8e9e4[_0x16ea('0x37')]:_0x4ea8e2['model'];if(_0x2d0bc0[_0x16ea('0x35')][_0x16ea('0x43')]){_0x8e9e4[_0x16ea('0x48')]=[{'all':!![]}];}_0x8e9e4=_['merge']({},_0x8e9e4,_0x2d0bc0['options']);return db['Template']['find'](_0x8e9e4)[_0x16ea('0x27')](handleEntityNotFound(_0x396800,null))['then'](respondWithResult(_0x396800,null))[_0x16ea('0x45')](handleError(_0x396800,null));};exports[_0x16ea('0x49')]=function(_0x730203,_0x1e7d16){return db[_0x16ea('0x42')][_0x16ea('0x49')](_0x730203[_0x16ea('0x4a')],{})['then'](function(_0x3db447){var _0x432f6e=_0x730203[_0x16ea('0x4b')][_0x16ea('0x28')]({'plain':!![]});if(!_0x432f6e)throw new Error(_0x16ea('0x4c'));if(_0x432f6e[_0x16ea('0x4d')]===_0x16ea('0x4b')){var _0x142968=_0x3db447[_0x16ea('0x28')]({'plain':!![]});var _0x26daf8=_0x16ea('0x29');return db[_0x16ea('0x4e')][_0x16ea('0x4f')]({'where':{'name':_0x26daf8,'userProfileId':_0x432f6e[_0x16ea('0x50')]},'raw':!![]})[_0x16ea('0x27')](function(_0x596776){if(_0x596776&&_0x596776[_0x16ea('0x51')]===0x0){return db[_0x16ea('0x52')][_0x16ea('0x49')]({'name':_0x142968[_0x16ea('0x2c')],'resourceId':_0x142968['id'],'type':_0x596776[_0x16ea('0x2c')],'sectionId':_0x596776['id']},{})['then'](function(){return _0x3db447;});}else{return _0x3db447;}})[_0x16ea('0x45')](function(_0x1b5792){logger[_0x16ea('0x2a')](_0x16ea('0x53'),_0x1b5792);throw _0x1b5792;});}return _0x3db447;})['then'](respondWithResult(_0x1e7d16,0xc9))[_0x16ea('0x45')](handleError(_0x1e7d16,null));};exports[_0x16ea('0x25')]=function(_0x324db1,_0x2ee0b0){if(_0x324db1[_0x16ea('0x4a')]['id']){delete _0x324db1[_0x16ea('0x4a')]['id'];}return db['Template']['find']({'where':{'id':_0x324db1[_0x16ea('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ee0b0,null))['then'](saveUpdates(_0x324db1[_0x16ea('0x4a')],null))[_0x16ea('0x27')](respondWithResult(_0x2ee0b0,null))[_0x16ea('0x45')](handleError(_0x2ee0b0,null));};exports[_0x16ea('0x26')]=function(_0x367d2a,_0x13d194){return db[_0x16ea('0x42')][_0x16ea('0x4f')]({'where':{'id':_0x367d2a['params']['id']}})['then'](handleEntityNotFound(_0x13d194,null))[_0x16ea('0x27')](removeEntity(_0x13d194,null))[_0x16ea('0x45')](handleError(_0x13d194,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index d98b3b8..7238e7c 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 _0x6e6a=['./template.attributes','exports','define','Template','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x516b68,_0x1a1146){var _0x394cd1=function(_0x5203fd){while(--_0x5203fd){_0x516b68['push'](_0x516b68['shift']());}};_0x394cd1(++_0x1a1146);}(_0x6e6a,0xf4));var _0xa6e6=function(_0x871875,_0x19b71c){_0x871875=_0x871875-0x0;var _0x213ed8=_0x6e6a[_0x871875];return _0x213ed8;};'use strict';var _=require(_0xa6e6('0x0'));var util=require('util');var logger=require(_0xa6e6('0x1'))(_0xa6e6('0x2'));var moment=require(_0xa6e6('0x3'));var BPromise=require(_0xa6e6('0x4'));var rp=require(_0xa6e6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa6e6('0x6'));module[_0xa6e6('0x7')]=function(_0x18deba,_0x1e5bb9){return _0x18deba[_0xa6e6('0x8')](_0xa6e6('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa84c=['path','rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x43b89d,_0x30fcc2){var _0x54fdaf=function(_0x592a82){while(--_0x592a82){_0x43b89d['push'](_0x43b89d['shift']());}};_0x54fdaf(++_0x30fcc2);}(_0xa84c,0x1a7));var _0xca84=function(_0x385380,_0x1a8069){_0x385380=_0x385380-0x0;var _0x1cfcd3=_0xa84c[_0x385380];return _0x1cfcd3;};'use strict';var _=require(_0xca84('0x0'));var util=require('util');var logger=require(_0xca84('0x1'))(_0xca84('0x2'));var moment=require(_0xca84('0x3'));var BPromise=require(_0xca84('0x4'));var rp=require(_0xca84('0x5'));var fs=require('fs');var path=require(_0xca84('0x6'));var rimraf=require(_0xca84('0x7'));var config=require(_0xca84('0x8'));var attributes=require(_0xca84('0x9'));module['exports']=function(_0x31a197,_0xf6a360){return _0x31a197[_0xca84('0xa')](_0xca84('0xb'),attributes,{'tableName':_0xca84('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 6746a77..db83d4f 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 _0x8e8f=['message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8e8f,0x16d));var _0xf8e8=function(_0x227698,_0x228d79){_0x227698=_0x227698-0x0;var _0x4b3f2e=_0x8e8f[_0x227698];return _0x4b3f2e;};'use strict';var _=require(_0xf8e8('0x0'));var util=require(_0xf8e8('0x1'));var moment=require(_0xf8e8('0x2'));var BPromise=require(_0xf8e8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf8e8('0x4'));var logger=require(_0xf8e8('0x5'))(_0xf8e8('0x6'));var config=require(_0xf8e8('0x7'));var jayson=require(_0xf8e8('0x8'));var client=jayson[_0xf8e8('0x9')][_0xf8e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x330e2e,_0xe91dbe,_0x5cad90){return new BPromise(function(_0x373c38,_0x17a6a6){return client[_0xf8e8('0xb')](_0x330e2e,_0x5cad90)[_0xf8e8('0xc')](function(_0x2debe4){logger[_0xf8e8('0xd')](_0xf8e8('0xe'),_0xe91dbe,_0xf8e8('0xf'));logger[_0xf8e8('0x10')](_0xf8e8('0x11'),_0xe91dbe,_0xf8e8('0xf'),JSON['stringify'](_0x2debe4));if(_0x2debe4[_0xf8e8('0x12')]){if(_0x2debe4[_0xf8e8('0x12')][_0xf8e8('0x13')]===0x1f4){logger['error'](_0xf8e8('0xe'),_0xe91dbe,_0x2debe4['error']['message']);return _0x17a6a6(_0x2debe4[_0xf8e8('0x12')][_0xf8e8('0x14')]);}logger[_0xf8e8('0x12')]('Template,\x20%s,\x20%s',_0xe91dbe,_0x2debe4[_0xf8e8('0x12')][_0xf8e8('0x14')]);return _0x373c38(_0x2debe4[_0xf8e8('0x12')][_0xf8e8('0x14')]);}else{logger[_0xf8e8('0xd')]('Template,\x20%s,\x20%s',_0xe91dbe,_0xf8e8('0xf'));_0x373c38(_0x2debe4[_0xf8e8('0x15')][_0xf8e8('0x14')]);}})[_0xf8e8('0x16')](function(_0x2a5021){logger[_0xf8e8('0x12')](_0xf8e8('0xe'),_0xe91dbe,_0x2a5021);_0x17a6a6(_0x2a5021);});});}exports[_0xf8e8('0x17')]=function(_0x37d804){var _0x4353b5=this;return new Promise(function(_0x1f8a3a,_0x37cd95){return db[_0xf8e8('0x18')][_0xf8e8('0x19')]({'raw':_0x37d804[_0xf8e8('0x1a')]?_0x37d804[_0xf8e8('0x1a')][_0xf8e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x37d804[_0xf8e8('0x1a')]?_0x37d804['options'][_0xf8e8('0x1c')]||null:null,'attributes':_0x37d804[_0xf8e8('0x1a')]?_0x37d804['options'][_0xf8e8('0x1d')]||null:null,'limit':_0x37d804[_0xf8e8('0x1a')]?_0x37d804['options'][_0xf8e8('0x1e')]||null:null,'include':_0x37d804[_0xf8e8('0x1a')]?_0x37d804['options'][_0xf8e8('0x1f')]?_[_0xf8e8('0x20')](_0x37d804[_0xf8e8('0x1a')][_0xf8e8('0x1f')],function(_0xe79d09){return{'model':db[_0xe79d09[_0xf8e8('0x21')]],'as':_0xe79d09['as'],'attributes':_0xe79d09[_0xf8e8('0x1d')],'include':_0xe79d09[_0xf8e8('0x1f')]?_[_0xf8e8('0x20')](_0xe79d09[_0xf8e8('0x1f')],function(_0x5dcf73){return{'model':db[_0x5dcf73[_0xf8e8('0x21')]],'as':_0x5dcf73['as'],'attributes':_0x5dcf73['attributes'],'include':_0x5dcf73[_0xf8e8('0x1f')]?_[_0xf8e8('0x20')](_0x5dcf73[_0xf8e8('0x1f')],function(_0x5a8a2e){return{'model':db[_0x5a8a2e[_0xf8e8('0x21')]],'as':_0x5a8a2e['as'],'attributes':_0x5a8a2e['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8e8('0xc')](function(_0x36db0c){logger[_0xf8e8('0xd')](_0xf8e8('0x17'),_0x37d804);logger['debug'](_0xf8e8('0x17'),_0x37d804,JSON[_0xf8e8('0x22')](_0x36db0c));_0x1f8a3a(_0x36db0c);})[_0xf8e8('0x16')](function(_0x19d0a0){logger[_0xf8e8('0x12')](_0xf8e8('0x17'),_0x19d0a0[_0xf8e8('0x14')],_0x37d804);_0x37cd95(_0x4353b5[_0xf8e8('0x12')](0x1f4,_0x19d0a0[_0xf8e8('0x14')]));});});}; \ No newline at end of file +var _0xdaa8=['client','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTemplate','Template','raw','options','attributes','include','model','map','lodash','util','moment','bluebird','../../config/environment','jayson/promise'];(function(_0x20afbf,_0x55041c){var _0x55dd65=function(_0x4481cb){while(--_0x4481cb){_0x20afbf['push'](_0x20afbf['shift']());}};_0x55dd65(++_0x55041c);}(_0xdaa8,0xe4));var _0x8daa=function(_0x5eac79,_0x417188){_0x5eac79=_0x5eac79-0x0;var _0x44088e=_0xdaa8[_0x5eac79];return _0x44088e;};'use strict';var _=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var moment=require(_0x8daa('0x2'));var BPromise=require(_0x8daa('0x3'));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('../../config/logger')('rpc');var config=require(_0x8daa('0x4'));var jayson=require(_0x8daa('0x5'));var client=jayson[_0x8daa('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8116,_0x1f5a97,_0x48bf41){return new BPromise(function(_0x41de3e,_0x2df1a0){return client[_0x8daa('0x7')](_0x4e8116,_0x48bf41)[_0x8daa('0x8')](function(_0x207291){logger['info'](_0x8daa('0x9'),_0x1f5a97,_0x8daa('0xa'));logger[_0x8daa('0xb')](_0x8daa('0xc'),_0x1f5a97,_0x8daa('0xa'),JSON[_0x8daa('0xd')](_0x207291));if(_0x207291[_0x8daa('0xe')]){if(_0x207291[_0x8daa('0xe')][_0x8daa('0xf')]===0x1f4){logger[_0x8daa('0xe')](_0x8daa('0x9'),_0x1f5a97,_0x207291['error'][_0x8daa('0x10')]);return _0x2df1a0(_0x207291[_0x8daa('0xe')][_0x8daa('0x10')]);}logger['error'](_0x8daa('0x9'),_0x1f5a97,_0x207291['error'][_0x8daa('0x10')]);return _0x41de3e(_0x207291[_0x8daa('0xe')][_0x8daa('0x10')]);}else{logger['info'](_0x8daa('0x9'),_0x1f5a97,_0x8daa('0xa'));_0x41de3e(_0x207291['result']['message']);}})[_0x8daa('0x11')](function(_0x2fc822){logger[_0x8daa('0xe')](_0x8daa('0x9'),_0x1f5a97,_0x2fc822);_0x2df1a0(_0x2fc822);});});}exports[_0x8daa('0x12')]=function(_0x1bca53){var _0x87f873=this;return new Promise(function(_0x15ab40,_0x1304f0){return db[_0x8daa('0x13')]['findAll']({'raw':_0x1bca53['options']?_0x1bca53['options'][_0x8daa('0x14')]===undefined?!![]:![]:!![],'where':_0x1bca53[_0x8daa('0x15')]?_0x1bca53[_0x8daa('0x15')]['where']||null:null,'attributes':_0x1bca53[_0x8daa('0x15')]?_0x1bca53['options'][_0x8daa('0x16')]||null:null,'limit':_0x1bca53[_0x8daa('0x15')]?_0x1bca53[_0x8daa('0x15')]['limit']||null:null,'include':_0x1bca53[_0x8daa('0x15')]?_0x1bca53['options'][_0x8daa('0x17')]?_['map'](_0x1bca53['options'][_0x8daa('0x17')],function(_0x15a4be){return{'model':db[_0x15a4be[_0x8daa('0x18')]],'as':_0x15a4be['as'],'attributes':_0x15a4be['attributes'],'include':_0x15a4be[_0x8daa('0x17')]?_[_0x8daa('0x19')](_0x15a4be['include'],function(_0x35dbc1){return{'model':db[_0x35dbc1[_0x8daa('0x18')]],'as':_0x35dbc1['as'],'attributes':_0x35dbc1[_0x8daa('0x16')],'include':_0x35dbc1[_0x8daa('0x17')]?_[_0x8daa('0x19')](_0x35dbc1[_0x8daa('0x17')],function(_0x23c938){return{'model':db[_0x23c938['model']],'as':_0x23c938['as'],'attributes':_0x23c938[_0x8daa('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41e96a){logger['info'](_0x8daa('0x12'),_0x1bca53);logger['debug'](_0x8daa('0x12'),_0x1bca53,JSON[_0x8daa('0xd')](_0x41e96a));_0x15ab40(_0x41e96a);})[_0x8daa('0x11')](function(_0x1981db){logger['error'](_0x8daa('0x12'),_0x1981db[_0x8daa('0x10')],_0x1bca53);_0x1304f0(_0x87f873[_0x8daa('0xe')](0x1f4,_0x1981db[_0x8daa('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 7f7f819..118f1fd 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 _0x9068=['/:id/any_conditions','/:id/actions','getActions','post','create','addAnyCondition','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions'];(function(_0x44d9cc,_0x3d912c){var _0x15b090=function(_0xf25ca3){while(--_0xf25ca3){_0x44d9cc['push'](_0x44d9cc['shift']());}};_0x15b090(++_0x3d912c);}(_0x9068,0xea));var _0x8906=function(_0x3707ed,_0x5ddbdf){_0x3707ed=_0x3707ed-0x0;var _0x31d6a5=_0x9068[_0x3707ed];return _0x31d6a5;};'use strict';var multer=require(_0x8906('0x0'));var util=require('util');var path=require(_0x8906('0x1'));var timeout=require(_0x8906('0x2'));var express=require(_0x8906('0x3'));var router=express[_0x8906('0x4')]();var fs_extra=require(_0x8906('0x5'));var auth=require(_0x8906('0x6'));var interaction=require(_0x8906('0x7'));var config=require(_0x8906('0x8'));var controller=require(_0x8906('0x9'));router[_0x8906('0xa')]('/',auth[_0x8906('0xb')](),controller[_0x8906('0xc')]);router['get'](_0x8906('0xd'),auth['isAuthenticated'](),controller[_0x8906('0xe')]);router[_0x8906('0xa')](_0x8906('0xf'),auth[_0x8906('0xb')](),controller['getAllConditions']);router[_0x8906('0xa')](_0x8906('0x10'),auth[_0x8906('0xb')](),controller['getAnyConditions']);router[_0x8906('0xa')](_0x8906('0x11'),auth[_0x8906('0xb')](),controller[_0x8906('0x12')]);router[_0x8906('0x13')]('/',auth[_0x8906('0xb')](),controller[_0x8906('0x14')]);router['post'](_0x8906('0xf'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0x8906('0x13')]('/:id/any_conditions',auth[_0x8906('0xb')](),controller[_0x8906('0x15')]);router[_0x8906('0x13')](_0x8906('0x11'),auth[_0x8906('0xb')](),controller['addAction']);router[_0x8906('0x16')](_0x8906('0xd'),auth[_0x8906('0xb')](),controller['update']);router[_0x8906('0x17')](_0x8906('0xd'),auth[_0x8906('0xb')](),controller[_0x8906('0x18')]);module['exports']=router; \ No newline at end of file +var _0xafcb=['../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAction','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafcb,0xb6));var _0xbafc=function(_0x1bf3fa,_0x3acffc){_0x1bf3fa=_0x1bf3fa-0x0;var _0x5df8a2=_0xafcb[_0x1bf3fa];return _0x5df8a2;};'use strict';var multer=require(_0xbafc('0x0'));var util=require(_0xbafc('0x1'));var path=require(_0xbafc('0x2'));var timeout=require(_0xbafc('0x3'));var express=require(_0xbafc('0x4'));var router=express[_0xbafc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbafc('0x6'));var interaction=require(_0xbafc('0x7'));var config=require(_0xbafc('0x8'));var controller=require(_0xbafc('0x9'));router['get']('/',auth[_0xbafc('0xa')](),controller[_0xbafc('0xb')]);router[_0xbafc('0xc')](_0xbafc('0xd'),auth['isAuthenticated'](),controller[_0xbafc('0xe')]);router[_0xbafc('0xc')](_0xbafc('0xf'),auth['isAuthenticated'](),controller[_0xbafc('0x10')]);router['get'](_0xbafc('0x11'),auth[_0xbafc('0xa')](),controller[_0xbafc('0x12')]);router[_0xbafc('0xc')](_0xbafc('0x13'),auth[_0xbafc('0xa')](),controller[_0xbafc('0x14')]);router['post']('/',auth[_0xbafc('0xa')](),controller[_0xbafc('0x15')]);router[_0xbafc('0x16')](_0xbafc('0xf'),auth[_0xbafc('0xa')](),controller['addAllCondition']);router[_0xbafc('0x16')]('/:id/any_conditions',auth[_0xbafc('0xa')](),controller['addAnyCondition']);router['post']('/:id/actions',auth[_0xbafc('0xa')](),controller[_0xbafc('0x17')]);router['put'](_0xbafc('0xd'),auth['isAuthenticated'](),controller[_0xbafc('0x18')]);router['delete'](_0xbafc('0xd'),auth['isAuthenticated'](),controller[_0xbafc('0x19')]);module[_0xbafc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 16751be..fdda28a 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 _0x1ce2=['sequelize','STRING'];(function(_0x11be15,_0x1e66b3){var _0x3f75be=function(_0x51ae34){while(--_0x51ae34){_0x11be15['push'](_0x11be15['shift']());}};_0x3f75be(++_0x1e66b3);}(_0x1ce2,0x94));var _0x21ce=function(_0x4dcbc0,_0x3298f4){_0x4dcbc0=_0x4dcbc0-0x0;var _0x4261d8=_0x1ce2[_0x4dcbc0];return _0x4261d8;};'use strict';var Sequelize=require(_0x21ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x21ce('0x1')]},'channel':{'type':Sequelize[_0x21ce('0x1')]},'description':{'type':Sequelize[_0x21ce('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2dad=['BOOLEAN','sequelize','STRING'];(function(_0x46ccd5,_0x2c29ac){var _0x46fd6c=function(_0x4f4b84){while(--_0x4f4b84){_0x46ccd5['push'](_0x46ccd5['shift']());}};_0x46fd6c(++_0x2c29ac);}(_0x2dad,0xd9));var _0xd2da=function(_0x1b903e,_0x214e55){_0x1b903e=_0x1b903e-0x0;var _0x37727a=_0x2dad[_0x1b903e];return _0x37727a;};'use strict';var Sequelize=require(_0xd2da('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2da('0x1')]},'channel':{'type':Sequelize[_0xd2da('0x1')]},'description':{'type':Sequelize[_0xd2da('0x1')]},'status':{'type':Sequelize[_0xd2da('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index f5066ec..4d81d2a 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 _0x0529=['include','findAll','rows','catch','show','params','includeAll','create','body','role','user','Triggers','UserProfileSection','find','autoAssociation','destroy','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','getAnyConditions','addAction','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','then','get','UserProfileResource','end','error','stack','name','index','map','Trigger','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','options','where'];(function(_0x178d5e,_0x3adbc4){var _0x17758f=function(_0x543700){while(--_0x543700){_0x178d5e['push'](_0x178d5e['shift']());}};_0x17758f(++_0x3adbc4);}(_0x0529,0x137));var _0x9052=function(_0x402153,_0x2b3255){_0x402153=_0x402153-0x0;var _0x59fbef=_0x0529[_0x402153];return _0x59fbef;};'use strict';var emlformat=require(_0x9052('0x0'));var rimraf=require(_0x9052('0x1'));var zipdir=require(_0x9052('0x2'));var jsonpatch=require(_0x9052('0x3'));var rp=require(_0x9052('0x4'));var moment=require(_0x9052('0x5'));var BPromise=require(_0x9052('0x6'));var Mustache=require(_0x9052('0x7'));var util=require(_0x9052('0x8'));var path=require(_0x9052('0x9'));var sox=require(_0x9052('0xa'));var csv=require(_0x9052('0xb'));var ejs=require(_0x9052('0xc'));var fs=require('fs');var fs_extra=require(_0x9052('0xd'));var _=require(_0x9052('0xe'));var squel=require(_0x9052('0xf'));var crypto=require(_0x9052('0x10'));var jsforce=require(_0x9052('0x11'));var deskjs=require(_0x9052('0x12'));var toCsv=require(_0x9052('0xb'));var querystring=require(_0x9052('0x13'));var Papa=require(_0x9052('0x14'));var Redis=require('ioredis');var authService=require(_0x9052('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x9052('0x16'));var hardwareService=require(_0x9052('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x9052('0x18'));var config=require(_0x9052('0x19'));var licenseUtil=require(_0x9052('0x1a'));var db=require(_0x9052('0x1b'))['db'];function respondWithStatusCode(_0x12ee5b,_0x286894){_0x286894=_0x286894||0xcc;return function(_0xce9bc9){if(_0xce9bc9){return _0x12ee5b[_0x9052('0x1c')](_0x286894);}return _0x12ee5b['status'](_0x286894)['end']();};}function respondWithResult(_0x53b954,_0x2eb839){_0x2eb839=_0x2eb839||0xc8;return function(_0x48129a){if(_0x48129a){return _0x53b954[_0x9052('0x1d')](_0x2eb839)[_0x9052('0x1e')](_0x48129a);}};}function respondWithFilteredResult(_0x49ca6f,_0x2c25ef){return function(_0x30dbb8){if(_0x30dbb8){var _0x2b3944=typeof _0x2c25ef['offset']===_0x9052('0x1f')&&typeof _0x2c25ef[_0x9052('0x20')]===_0x9052('0x1f');var _0x17fd57=_0x30dbb8[_0x9052('0x21')];var _0x37fb49=_0x2b3944?0x0:_0x2c25ef[_0x9052('0x22')];var _0x3ca5d7=_0x2b3944?_0x30dbb8[_0x9052('0x21')]:_0x2c25ef['offset']+_0x2c25ef[_0x9052('0x20')];var _0x4d1ae6;if(_0x3ca5d7>=_0x17fd57){_0x3ca5d7=_0x17fd57;_0x4d1ae6=0xc8;}else{_0x4d1ae6=0xce;}_0x49ca6f['status'](_0x4d1ae6);return _0x49ca6f[_0x9052('0x23')]('Content-Range',_0x37fb49+'-'+_0x3ca5d7+'/'+_0x17fd57)['json'](_0x30dbb8);}return null;};}function patchUpdates(_0xb0b649){return function(_0x5ef373){try{jsonpatch[_0x9052('0x24')](_0x5ef373,_0xb0b649,!![]);}catch(_0x40398b){return BPromise[_0x9052('0x25')](_0x40398b);}return _0x5ef373[_0x9052('0x26')]();};}function saveUpdates(_0x50c051,_0x53ce31){return function(_0x5e6e4c){if(_0x5e6e4c){return _0x5e6e4c['update'](_0x50c051)[_0x9052('0x27')](function(_0x4104d0){return _0x4104d0;});}return null;};}function removeEntity(_0x5798b2,_0x14fa08){return function(_0x267799){if(_0x267799){return _0x267799['destroy']()[_0x9052('0x27')](function(){var _0x226f52=_0x267799[_0x9052('0x28')]({'plain':!![]});var _0x1cd897='Triggers';return db[_0x9052('0x29')]['destroy']({'where':{'type':_0x1cd897,'resourceId':_0x226f52['id']}})[_0x9052('0x27')](function(){return _0x267799;});})['then'](function(){_0x5798b2[_0x9052('0x1d')](0xcc)[_0x9052('0x2a')]();});}};}function handleEntityNotFound(_0x3e0904,_0x2a4d2a){return function(_0x5043cf){if(!_0x5043cf){_0x3e0904['sendStatus'](0x194);}return _0x5043cf;};}function handleError(_0x3d445c,_0x3a3f1d){_0x3a3f1d=_0x3a3f1d||0x1f4;return function(_0x40c6f5){logger[_0x9052('0x2b')](_0x40c6f5[_0x9052('0x2c')]);if(_0x40c6f5[_0x9052('0x2d')]){delete _0x40c6f5['name'];}_0x3d445c[_0x9052('0x1d')](_0x3a3f1d)['send'](_0x40c6f5);};}exports[_0x9052('0x2e')]=function(_0x481f5b,_0x4018ea){var _0x1c748a={},_0x56b620={},_0x54d2b5={'count':0x0,'rows':[]};var _0x401329=_[_0x9052('0x2f')](db[_0x9052('0x30')][_0x9052('0x31')],function(_0x5873a2){return{'name':_0x5873a2['fieldName'],'type':_0x5873a2['type'][_0x9052('0x32')]};});_0x56b620[_0x9052('0x33')]=_['map'](_0x401329,_0x9052('0x2d'));_0x56b620['query']=_[_0x9052('0x34')](_0x481f5b[_0x9052('0x35')]);_0x56b620[_0x9052('0x36')]=_[_0x9052('0x37')](_0x56b620[_0x9052('0x33')],_0x56b620['query']);_0x1c748a[_0x9052('0x38')]=_[_0x9052('0x37')](_0x56b620[_0x9052('0x33')],qs[_0x9052('0x39')](_0x481f5b[_0x9052('0x35')]['fields']));_0x1c748a[_0x9052('0x38')]=_0x1c748a['attributes'][_0x9052('0x3a')]?_0x1c748a[_0x9052('0x38')]:_0x56b620['model'];if(!_0x481f5b['query'][_0x9052('0x3b')](_0x9052('0x3c'))){_0x1c748a[_0x9052('0x20')]=qs['limit'](_0x481f5b[_0x9052('0x35')][_0x9052('0x20')]);_0x1c748a[_0x9052('0x22')]=qs[_0x9052('0x22')](_0x481f5b[_0x9052('0x35')][_0x9052('0x22')]);}_0x1c748a[_0x9052('0x3d')]=qs[_0x9052('0x3e')](_0x481f5b[_0x9052('0x35')][_0x9052('0x3e')]);_0x1c748a['where']=qs['filters'](_[_0x9052('0x3f')](_0x481f5b[_0x9052('0x35')],_0x56b620[_0x9052('0x36')]),_0x401329);if(_0x481f5b[_0x9052('0x35')][_0x9052('0x40')]){_0x1c748a['where']=_[_0x9052('0x41')](_0x1c748a['where'],{'$or':_[_0x9052('0x2f')](_0x401329,function(_0x107454){if(_0x107454[_0x9052('0x42')]!=='VIRTUAL'){var _0x5862f7={};_0x5862f7[_0x107454[_0x9052('0x2d')]]={'$like':'%'+_0x481f5b['query'][_0x9052('0x40')]+'%'};return _0x5862f7;}})});}_0x1c748a=_['merge']({},_0x1c748a,_0x481f5b[_0x9052('0x43')]);var _0x489786={'where':_0x1c748a[_0x9052('0x44')]};return db[_0x9052('0x30')][_0x9052('0x21')](_0x489786)['then'](function(_0x3d21ea){_0x54d2b5[_0x9052('0x21')]=_0x3d21ea;if(_0x481f5b['query']['includeAll']){_0x1c748a[_0x9052('0x45')]=[{'all':!![]}];}return db[_0x9052('0x30')][_0x9052('0x46')](_0x1c748a);})[_0x9052('0x27')](function(_0xc1d05a){_0x54d2b5[_0x9052('0x47')]=_0xc1d05a;return _0x54d2b5;})[_0x9052('0x27')](respondWithFilteredResult(_0x4018ea,_0x1c748a))[_0x9052('0x48')](handleError(_0x4018ea,null));};exports[_0x9052('0x49')]=function(_0x2f56a5,_0x3d337d){var _0xc324cf={'raw':![],'where':{'id':_0x2f56a5[_0x9052('0x4a')]['id']}},_0x53b3d7={};_0x53b3d7['model']=_[_0x9052('0x34')](db[_0x9052('0x30')][_0x9052('0x31')]);_0x53b3d7['query']=_[_0x9052('0x34')](_0x2f56a5[_0x9052('0x35')]);_0x53b3d7[_0x9052('0x36')]=_[_0x9052('0x37')](_0x53b3d7['model'],_0x53b3d7[_0x9052('0x35')]);_0xc324cf[_0x9052('0x38')]=_[_0x9052('0x37')](_0x53b3d7[_0x9052('0x33')],qs[_0x9052('0x39')](_0x2f56a5[_0x9052('0x35')][_0x9052('0x39')]));_0xc324cf[_0x9052('0x38')]=_0xc324cf['attributes'][_0x9052('0x3a')]?_0xc324cf['attributes']:_0x53b3d7[_0x9052('0x33')];if(_0x2f56a5['query'][_0x9052('0x4b')]){_0xc324cf[_0x9052('0x45')]=[{'all':!![]}];}_0xc324cf=_[_0x9052('0x41')]({},_0xc324cf,_0x2f56a5[_0x9052('0x43')]);return db['Trigger']['find'](_0xc324cf)[_0x9052('0x27')](handleEntityNotFound(_0x3d337d,null))[_0x9052('0x27')](respondWithResult(_0x3d337d,null))[_0x9052('0x48')](handleError(_0x3d337d,null));};exports[_0x9052('0x4c')]=function(_0x5f2188,_0x10c527){return db[_0x9052('0x30')]['create'](_0x5f2188[_0x9052('0x4d')],{})[_0x9052('0x27')](function(_0x6248be){var _0x3e9457=_0x5f2188['user'][_0x9052('0x28')]({'plain':!![]});if(!_0x3e9457)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9457[_0x9052('0x4e')]===_0x9052('0x4f')){var _0x21472d=_0x6248be[_0x9052('0x28')]({'plain':!![]});var _0x470fd0=_0x9052('0x50');return db[_0x9052('0x51')][_0x9052('0x52')]({'where':{'name':_0x470fd0,'userProfileId':_0x3e9457['userProfileId']},'raw':!![]})[_0x9052('0x27')](function(_0x2a78cd){if(_0x2a78cd&&_0x2a78cd[_0x9052('0x53')]===0x0){return db[_0x9052('0x29')][_0x9052('0x4c')]({'name':_0x21472d[_0x9052('0x2d')],'resourceId':_0x21472d['id'],'type':_0x2a78cd[_0x9052('0x2d')],'sectionId':_0x2a78cd['id']},{})['then'](function(){return _0x6248be;});}else{return _0x6248be;}})['catch'](function(_0x34fc19){logger[_0x9052('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34fc19);throw _0x34fc19;});}return _0x6248be;})[_0x9052('0x27')](respondWithResult(_0x10c527,0xc9))[_0x9052('0x48')](handleError(_0x10c527,null));};exports['update']=function(_0x2590c8,_0x711c6e){if(_0x2590c8['body']['id']){delete _0x2590c8[_0x9052('0x4d')]['id'];}return db[_0x9052('0x30')][_0x9052('0x52')]({'where':{'id':_0x2590c8[_0x9052('0x4a')]['id']}})['then'](handleEntityNotFound(_0x711c6e,null))['then'](saveUpdates(_0x2590c8[_0x9052('0x4d')],null))['then'](respondWithResult(_0x711c6e,null))['catch'](handleError(_0x711c6e,null));};exports[_0x9052('0x54')]=function(_0x500486,_0x4cd167){return db[_0x9052('0x30')][_0x9052('0x52')]({'where':{'id':_0x500486[_0x9052('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4cd167,null))[_0x9052('0x27')](removeEntity(_0x4cd167,null))['catch'](handleError(_0x4cd167,null));};exports[_0x9052('0x55')]=function(_0x215957,_0x13749e,_0x1397c9){if(_0x215957[_0x9052('0x4d')]['id']){delete _0x215957[_0x9052('0x4d')]['id'];}return db['Trigger'][_0x9052('0x52')]({'where':{'id':_0x215957[_0x9052('0x4a')]['id']}})[_0x9052('0x27')](handleEntityNotFound(_0x13749e,null))['then'](function(_0x35fd6f){if(_0x35fd6f){_0x215957['body'][_0x9052('0x56')]=_0x35fd6f['id'];return db[_0x9052('0x57')][_0x9052('0x4c')](_0x215957[_0x9052('0x4d')]);}})[_0x9052('0x27')](respondWithResult(_0x13749e,null))[_0x9052('0x48')](handleError(_0x13749e,null));};exports[_0x9052('0x58')]=function(_0x4c4f93,_0x47bd67,_0xe84b10){if(_0x4c4f93[_0x9052('0x4d')]['id']){delete _0x4c4f93['body']['id'];}return db[_0x9052('0x30')][_0x9052('0x52')]({'where':{'id':_0x4c4f93[_0x9052('0x4a')]['id']}})[_0x9052('0x27')](handleEntityNotFound(_0x47bd67,null))[_0x9052('0x27')](function(_0x579bdf){if(_0x579bdf){_0x4c4f93[_0x9052('0x4d')][_0x9052('0x59')]=_0x579bdf['id'];return db['Condition'][_0x9052('0x4c')](_0x4c4f93[_0x9052('0x4d')]);}})['then'](respondWithResult(_0x47bd67,null))[_0x9052('0x48')](handleError(_0x47bd67,null));};exports['getAllConditions']=function(_0x106d1a,_0xe94495,_0x439469){var _0x547f93={};var _0x29998c={};var _0x55aebd;var _0x7531ed;return db[_0x9052('0x30')][_0x9052('0x5a')]({'where':{'id':_0x106d1a['params']['id']}})[_0x9052('0x27')](handleEntityNotFound(_0xe94495,null))[_0x9052('0x27')](function(_0x5724e0){if(_0x5724e0){_0x55aebd=_0x5724e0;_0x29998c[_0x9052('0x33')]=_[_0x9052('0x34')](db[_0x9052('0x57')][_0x9052('0x31')]);_0x29998c[_0x9052('0x35')]=_[_0x9052('0x34')](_0x106d1a[_0x9052('0x35')]);_0x29998c['filters']=_[_0x9052('0x37')](_0x29998c[_0x9052('0x33')],_0x29998c[_0x9052('0x35')]);_0x547f93[_0x9052('0x38')]=_[_0x9052('0x37')](_0x29998c[_0x9052('0x33')],qs[_0x9052('0x39')](_0x106d1a[_0x9052('0x35')]['fields']));_0x547f93[_0x9052('0x38')]=_0x547f93[_0x9052('0x38')][_0x9052('0x3a')]?_0x547f93[_0x9052('0x38')]:_0x29998c[_0x9052('0x33')];_0x547f93['order']=qs[_0x9052('0x3e')](_0x106d1a[_0x9052('0x35')][_0x9052('0x3e')]);_0x547f93['where']=qs[_0x9052('0x36')](_[_0x9052('0x3f')](_0x106d1a['query'],_0x29998c['filters']));if(_0x106d1a[_0x9052('0x35')][_0x9052('0x40')]){_0x547f93['where']=_[_0x9052('0x41')](_0x547f93[_0x9052('0x44')],{'$or':_[_0x9052('0x2f')](_0x547f93[_0x9052('0x38')],function(_0x30b949){var _0x4bf43f={};_0x4bf43f[_0x30b949]={'$like':'%'+_0x106d1a[_0x9052('0x35')]['filter']+'%'};return _0x4bf43f;})});}_0x547f93=_['merge']({},_0x547f93,_0x106d1a[_0x9052('0x43')]);return _0x55aebd[_0x9052('0x5b')](_0x547f93);}})[_0x9052('0x27')](function(_0x5f357c){if(_0x5f357c){_0x7531ed=_0x5f357c[_0x9052('0x3a')];if(!_0x106d1a[_0x9052('0x35')][_0x9052('0x3b')](_0x9052('0x3c'))){_0x547f93[_0x9052('0x20')]=qs[_0x9052('0x20')](_0x106d1a['query']['limit']);_0x547f93[_0x9052('0x22')]=qs[_0x9052('0x22')](_0x106d1a[_0x9052('0x35')]['offset']);}return _0x55aebd[_0x9052('0x5b')](_0x547f93);}})['then'](function(_0x54baba){if(_0x54baba){return _0x54baba?{'count':_0x7531ed,'rows':_0x54baba}:null;}})[_0x9052('0x27')](respondWithResult(_0xe94495,null))[_0x9052('0x48')](handleError(_0xe94495,null));};exports[_0x9052('0x5c')]=function(_0x4debd6,_0x2ce1c1,_0x5e6f1f){var _0xb22120={};var _0x5e7126={};var _0x277948;var _0x5a9a5f;return db['Trigger'][_0x9052('0x5a')]({'where':{'id':_0x4debd6['params']['id']}})[_0x9052('0x27')](handleEntityNotFound(_0x2ce1c1,null))[_0x9052('0x27')](function(_0x384901){if(_0x384901){_0x277948=_0x384901;_0x5e7126[_0x9052('0x33')]=_[_0x9052('0x34')](db[_0x9052('0x57')]['rawAttributes']);_0x5e7126[_0x9052('0x35')]=_[_0x9052('0x34')](_0x4debd6[_0x9052('0x35')]);_0x5e7126[_0x9052('0x36')]=_['intersection'](_0x5e7126['model'],_0x5e7126[_0x9052('0x35')]);_0xb22120[_0x9052('0x38')]=_[_0x9052('0x37')](_0x5e7126[_0x9052('0x33')],qs[_0x9052('0x39')](_0x4debd6[_0x9052('0x35')][_0x9052('0x39')]));_0xb22120[_0x9052('0x38')]=_0xb22120[_0x9052('0x38')][_0x9052('0x3a')]?_0xb22120[_0x9052('0x38')]:_0x5e7126[_0x9052('0x33')];_0xb22120[_0x9052('0x3d')]=qs['sort'](_0x4debd6[_0x9052('0x35')][_0x9052('0x3e')]);_0xb22120['where']=qs['filters'](_[_0x9052('0x3f')](_0x4debd6[_0x9052('0x35')],_0x5e7126[_0x9052('0x36')]));if(_0x4debd6[_0x9052('0x35')][_0x9052('0x40')]){_0xb22120[_0x9052('0x44')]=_[_0x9052('0x41')](_0xb22120[_0x9052('0x44')],{'$or':_['map'](_0xb22120[_0x9052('0x38')],function(_0x2ca474){var _0x1f1aea={};_0x1f1aea[_0x2ca474]={'$like':'%'+_0x4debd6[_0x9052('0x35')][_0x9052('0x40')]+'%'};return _0x1f1aea;})});}_0xb22120=_['merge']({},_0xb22120,_0x4debd6['options']);return _0x277948['getAnyConditions'](_0xb22120);}})[_0x9052('0x27')](function(_0x19a736){if(_0x19a736){_0x5a9a5f=_0x19a736[_0x9052('0x3a')];if(!_0x4debd6[_0x9052('0x35')][_0x9052('0x3b')](_0x9052('0x3c'))){_0xb22120[_0x9052('0x20')]=qs['limit'](_0x4debd6[_0x9052('0x35')][_0x9052('0x20')]);_0xb22120[_0x9052('0x22')]=qs['offset'](_0x4debd6['query'][_0x9052('0x22')]);}return _0x277948[_0x9052('0x5c')](_0xb22120);}})[_0x9052('0x27')](function(_0x37847e){if(_0x37847e){return _0x37847e?{'count':_0x5a9a5f,'rows':_0x37847e}:null;}})['then'](respondWithResult(_0x2ce1c1,null))[_0x9052('0x48')](handleError(_0x2ce1c1,null));};exports[_0x9052('0x5d')]=function(_0x2f0cec,_0x2150ce,_0x91a01){if(_0x2f0cec[_0x9052('0x4d')]['id']){delete _0x2f0cec[_0x9052('0x4d')]['id'];}return db['Trigger'][_0x9052('0x52')]({'where':{'id':_0x2f0cec[_0x9052('0x4a')]['id']}})[_0x9052('0x27')](handleEntityNotFound(_0x2150ce,null))['then'](function(_0x445ab0){if(_0x445ab0){_0x2f0cec[_0x9052('0x4d')]['TriggerId']=_0x445ab0['id'];return db['Action'][_0x9052('0x4c')](_0x2f0cec[_0x9052('0x4d')]);}})[_0x9052('0x27')](respondWithResult(_0x2150ce,null))['catch'](handleError(_0x2150ce,null));};exports[_0x9052('0x5e')]=function(_0x5bc66b,_0xab46a1,_0x246383){var _0x2d5525={};var _0x586605={};var _0x1a2c46;var _0x2a2181;return db[_0x9052('0x30')][_0x9052('0x5a')]({'where':{'id':_0x5bc66b[_0x9052('0x4a')]['id']}})[_0x9052('0x27')](handleEntityNotFound(_0xab46a1,null))[_0x9052('0x27')](function(_0x10d10a){if(_0x10d10a){_0x1a2c46=_0x10d10a;_0x586605[_0x9052('0x33')]=_[_0x9052('0x34')](db['Action'][_0x9052('0x31')]);_0x586605[_0x9052('0x35')]=_[_0x9052('0x34')](_0x5bc66b[_0x9052('0x35')]);_0x586605[_0x9052('0x36')]=_['intersection'](_0x586605[_0x9052('0x33')],_0x586605['query']);_0x2d5525['attributes']=_[_0x9052('0x37')](_0x586605[_0x9052('0x33')],qs['fields'](_0x5bc66b[_0x9052('0x35')]['fields']));_0x2d5525[_0x9052('0x38')]=_0x2d5525[_0x9052('0x38')][_0x9052('0x3a')]?_0x2d5525[_0x9052('0x38')]:_0x586605[_0x9052('0x33')];_0x2d5525[_0x9052('0x3d')]=qs['sort'](_0x5bc66b[_0x9052('0x35')]['sort']);_0x2d5525[_0x9052('0x44')]=qs[_0x9052('0x36')](_[_0x9052('0x3f')](_0x5bc66b[_0x9052('0x35')],_0x586605[_0x9052('0x36')]));if(_0x5bc66b['query'][_0x9052('0x40')]){_0x2d5525[_0x9052('0x44')]=_['merge'](_0x2d5525[_0x9052('0x44')],{'$or':_['map'](_0x2d5525[_0x9052('0x38')],function(_0x5a1ca8){var _0x4a1c71={};_0x4a1c71[_0x5a1ca8]={'$like':'%'+_0x5bc66b[_0x9052('0x35')][_0x9052('0x40')]+'%'};return _0x4a1c71;})});}_0x2d5525=_[_0x9052('0x41')]({},_0x2d5525,_0x5bc66b[_0x9052('0x43')]);return _0x1a2c46[_0x9052('0x5e')](_0x2d5525);}})['then'](function(_0x4e2b07){if(_0x4e2b07){_0x2a2181=_0x4e2b07[_0x9052('0x3a')];if(!_0x5bc66b['query']['hasOwnProperty']('nolimit')){_0x2d5525[_0x9052('0x20')]=qs[_0x9052('0x20')](_0x5bc66b[_0x9052('0x35')][_0x9052('0x20')]);_0x2d5525['offset']=qs[_0x9052('0x22')](_0x5bc66b[_0x9052('0x35')][_0x9052('0x22')]);}return _0x1a2c46[_0x9052('0x5e')](_0x2d5525);}})['then'](function(_0xb04140){if(_0xb04140){return _0xb04140?{'count':_0x2a2181,'rows':_0xb04140}:null;}})[_0x9052('0x27')](respondWithResult(_0xab46a1,null))[_0x9052('0x48')](handleError(_0xab46a1,null));}; \ No newline at end of file +var _0x988b=['model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','keys','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','length','order','nolimit','getAnyConditions','addAction','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key'];(function(_0x1ed182,_0x13b3c5){var _0x22dde0=function(_0x653387){while(--_0x653387){_0x1ed182['push'](_0x1ed182['shift']());}};_0x22dde0(++_0x13b3c5);}(_0x988b,0xef));var _0xb988=function(_0x45806b,_0x53eeae){_0x45806b=_0x45806b-0x0;var _0x3e228e=_0x988b[_0x45806b];return _0x3e228e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb988('0x0'));var zipdir=require(_0xb988('0x1'));var jsonpatch=require(_0xb988('0x2'));var rp=require(_0xb988('0x3'));var moment=require(_0xb988('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb988('0x5'));var util=require(_0xb988('0x6'));var path=require(_0xb988('0x7'));var sox=require(_0xb988('0x8'));var csv=require(_0xb988('0x9'));var ejs=require(_0xb988('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb988('0xb'));var crypto=require(_0xb988('0xc'));var jsforce=require(_0xb988('0xd'));var deskjs=require(_0xb988('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb988('0xf'));var Papa=require(_0xb988('0x10'));var Redis=require(_0xb988('0x11'));var authService=require(_0xb988('0x12'));var qs=require(_0xb988('0x13'));var as=require(_0xb988('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb988('0x15'))(_0xb988('0x16'));var utils=require(_0xb988('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb988('0x18'));var db=require(_0xb988('0x19'))['db'];function respondWithStatusCode(_0x175328,_0x2307e0){_0x2307e0=_0x2307e0||0xcc;return function(_0x444e03){if(_0x444e03){return _0x175328[_0xb988('0x1a')](_0x2307e0);}return _0x175328['status'](_0x2307e0)['end']();};}function respondWithResult(_0x4e92e9,_0x216866){_0x216866=_0x216866||0xc8;return function(_0x38a46a){if(_0x38a46a){return _0x4e92e9[_0xb988('0x1b')](_0x216866)[_0xb988('0x1c')](_0x38a46a);}};}function respondWithFilteredResult(_0x26687d,_0x42403b){return function(_0x532cf8){if(_0x532cf8){var _0xafa788=typeof _0x42403b[_0xb988('0x1d')]===_0xb988('0x1e')&&typeof _0x42403b['limit']===_0xb988('0x1e');var _0x3cf474=_0x532cf8[_0xb988('0x1f')];var _0x337689=_0xafa788?0x0:_0x42403b[_0xb988('0x1d')];var _0x3541a9=_0xafa788?_0x532cf8[_0xb988('0x1f')]:_0x42403b['offset']+_0x42403b[_0xb988('0x20')];var _0x5363e3;if(_0x3541a9>=_0x3cf474){_0x3541a9=_0x3cf474;_0x5363e3=0xc8;}else{_0x5363e3=0xce;}_0x26687d[_0xb988('0x1b')](_0x5363e3);return _0x26687d['set'](_0xb988('0x21'),_0x337689+'-'+_0x3541a9+'/'+_0x3cf474)[_0xb988('0x1c')](_0x532cf8);}return null;};}function patchUpdates(_0x468eeb){return function(_0x5291b6){try{jsonpatch[_0xb988('0x22')](_0x5291b6,_0x468eeb,!![]);}catch(_0x5231a7){return BPromise[_0xb988('0x23')](_0x5231a7);}return _0x5291b6[_0xb988('0x24')]();};}function saveUpdates(_0x1687b,_0xbd995b){return function(_0x416f7f){if(_0x416f7f){return _0x416f7f[_0xb988('0x25')](_0x1687b)[_0xb988('0x26')](function(_0x3d46a0){return _0x3d46a0;});}return null;};}function removeEntity(_0x14d8cc,_0x2745fb){return function(_0x304ee4){if(_0x304ee4){return _0x304ee4[_0xb988('0x27')]()['then'](function(){var _0x261e37=_0x304ee4['get']({'plain':!![]});var _0x2595de='Triggers';return db[_0xb988('0x28')][_0xb988('0x27')]({'where':{'type':_0x2595de,'resourceId':_0x261e37['id']}})[_0xb988('0x26')](function(){return _0x304ee4;});})['then'](function(){_0x14d8cc[_0xb988('0x1b')](0xcc)[_0xb988('0x29')]();});}};}function handleEntityNotFound(_0x4bfe81,_0x101ba9){return function(_0x25fb49){if(!_0x25fb49){_0x4bfe81[_0xb988('0x1a')](0x194);}return _0x25fb49;};}function handleError(_0x2f0808,_0x3246a4){_0x3246a4=_0x3246a4||0x1f4;return function(_0x1f52be){logger[_0xb988('0x2a')](_0x1f52be[_0xb988('0x2b')]);if(_0x1f52be[_0xb988('0x2c')]){delete _0x1f52be[_0xb988('0x2c')];}_0x2f0808[_0xb988('0x1b')](_0x3246a4)[_0xb988('0x2d')](_0x1f52be);};}exports[_0xb988('0x2e')]=function(_0x2f7979,_0x5c44c5){var _0x2a4ad6={},_0x8c39a3={},_0x45d3e7={'count':0x0,'rows':[]};var _0x2244c6=_[_0xb988('0x2f')](db[_0xb988('0x30')][_0xb988('0x31')],function(_0x4f73a8){return{'name':_0x4f73a8[_0xb988('0x32')],'type':_0x4f73a8['type'][_0xb988('0x33')]};});_0x8c39a3[_0xb988('0x34')]=_['map'](_0x2244c6,_0xb988('0x2c'));_0x8c39a3[_0xb988('0x35')]=_['keys'](_0x2f7979[_0xb988('0x35')]);_0x8c39a3[_0xb988('0x36')]=_[_0xb988('0x37')](_0x8c39a3[_0xb988('0x34')],_0x8c39a3['query']);_0x2a4ad6[_0xb988('0x38')]=_[_0xb988('0x37')](_0x8c39a3[_0xb988('0x34')],qs[_0xb988('0x39')](_0x2f7979[_0xb988('0x35')][_0xb988('0x39')]));_0x2a4ad6[_0xb988('0x38')]=_0x2a4ad6[_0xb988('0x38')]['length']?_0x2a4ad6[_0xb988('0x38')]:_0x8c39a3['model'];if(!_0x2f7979[_0xb988('0x35')][_0xb988('0x3a')]('nolimit')){_0x2a4ad6[_0xb988('0x20')]=qs[_0xb988('0x20')](_0x2f7979['query'][_0xb988('0x20')]);_0x2a4ad6[_0xb988('0x1d')]=qs[_0xb988('0x1d')](_0x2f7979['query'][_0xb988('0x1d')]);}_0x2a4ad6['order']=qs[_0xb988('0x3b')](_0x2f7979[_0xb988('0x35')][_0xb988('0x3b')]);_0x2a4ad6[_0xb988('0x3c')]=qs[_0xb988('0x36')](_[_0xb988('0x3d')](_0x2f7979[_0xb988('0x35')],_0x8c39a3['filters']),_0x2244c6);if(_0x2f7979[_0xb988('0x35')][_0xb988('0x3e')]){_0x2a4ad6[_0xb988('0x3c')]=_[_0xb988('0x3f')](_0x2a4ad6[_0xb988('0x3c')],{'$or':_[_0xb988('0x2f')](_0x2244c6,function(_0x584f92){if(_0x584f92['type']!=='VIRTUAL'){var _0x53737b={};_0x53737b[_0x584f92[_0xb988('0x2c')]]={'$like':'%'+_0x2f7979['query']['filter']+'%'};return _0x53737b;}})});}_0x2a4ad6=_[_0xb988('0x3f')]({},_0x2a4ad6,_0x2f7979['options']);var _0xb51b93={'where':_0x2a4ad6[_0xb988('0x3c')]};return db['Trigger'][_0xb988('0x1f')](_0xb51b93)[_0xb988('0x26')](function(_0x5c7d68){_0x45d3e7[_0xb988('0x1f')]=_0x5c7d68;if(_0x2f7979[_0xb988('0x35')][_0xb988('0x40')]){_0x2a4ad6[_0xb988('0x41')]=[{'all':!![]}];}return db[_0xb988('0x30')][_0xb988('0x42')](_0x2a4ad6);})['then'](function(_0xb8b80e){_0x45d3e7['rows']=_0xb8b80e;return _0x45d3e7;})[_0xb988('0x26')](respondWithFilteredResult(_0x5c44c5,_0x2a4ad6))[_0xb988('0x43')](handleError(_0x5c44c5,null));};exports[_0xb988('0x44')]=function(_0xd21d50,_0x4b8882){var _0x21660a={'raw':![],'where':{'id':_0xd21d50[_0xb988('0x45')]['id']}},_0x37d4df={};_0x37d4df[_0xb988('0x34')]=_['keys'](db[_0xb988('0x30')]['rawAttributes']);_0x37d4df[_0xb988('0x35')]=_[_0xb988('0x46')](_0xd21d50[_0xb988('0x35')]);_0x37d4df['filters']=_[_0xb988('0x37')](_0x37d4df[_0xb988('0x34')],_0x37d4df[_0xb988('0x35')]);_0x21660a['attributes']=_[_0xb988('0x37')](_0x37d4df[_0xb988('0x34')],qs['fields'](_0xd21d50['query'][_0xb988('0x39')]));_0x21660a[_0xb988('0x38')]=_0x21660a[_0xb988('0x38')]['length']?_0x21660a[_0xb988('0x38')]:_0x37d4df['model'];if(_0xd21d50[_0xb988('0x35')]['includeAll']){_0x21660a['include']=[{'all':!![]}];}_0x21660a=_[_0xb988('0x3f')]({},_0x21660a,_0xd21d50[_0xb988('0x47')]);return db[_0xb988('0x30')]['find'](_0x21660a)[_0xb988('0x26')](handleEntityNotFound(_0x4b8882,null))[_0xb988('0x26')](respondWithResult(_0x4b8882,null))[_0xb988('0x43')](handleError(_0x4b8882,null));};exports[_0xb988('0x48')]=function(_0x1cfd1f,_0x4fa07b){return db[_0xb988('0x30')][_0xb988('0x48')](_0x1cfd1f[_0xb988('0x49')],{})['then'](function(_0x5e7fe9){var _0x477c95=_0x1cfd1f[_0xb988('0x4a')][_0xb988('0x4b')]({'plain':!![]});if(!_0x477c95)throw new Error(_0xb988('0x4c'));if(_0x477c95[_0xb988('0x4d')]===_0xb988('0x4a')){var _0x4ab340=_0x5e7fe9[_0xb988('0x4b')]({'plain':!![]});var _0x3c5d31=_0xb988('0x4e');return db[_0xb988('0x4f')][_0xb988('0x50')]({'where':{'name':_0x3c5d31,'userProfileId':_0x477c95['userProfileId']},'raw':!![]})[_0xb988('0x26')](function(_0x5bf883){if(_0x5bf883&&_0x5bf883[_0xb988('0x51')]===0x0){return db[_0xb988('0x28')][_0xb988('0x48')]({'name':_0x4ab340[_0xb988('0x2c')],'resourceId':_0x4ab340['id'],'type':_0x5bf883[_0xb988('0x2c')],'sectionId':_0x5bf883['id']},{})[_0xb988('0x26')](function(){return _0x5e7fe9;});}else{return _0x5e7fe9;}})[_0xb988('0x43')](function(_0x2a5c1c){logger[_0xb988('0x2a')](_0xb988('0x52'),_0x2a5c1c);throw _0x2a5c1c;});}return _0x5e7fe9;})[_0xb988('0x26')](respondWithResult(_0x4fa07b,0xc9))['catch'](handleError(_0x4fa07b,null));};exports[_0xb988('0x25')]=function(_0x58825e,_0x2dcc60){if(_0x58825e[_0xb988('0x49')]['id']){delete _0x58825e[_0xb988('0x49')]['id'];}return db[_0xb988('0x30')][_0xb988('0x50')]({'where':{'id':_0x58825e[_0xb988('0x45')]['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x2dcc60,null))[_0xb988('0x26')](saveUpdates(_0x58825e[_0xb988('0x49')],null))[_0xb988('0x26')](respondWithResult(_0x2dcc60,null))['catch'](handleError(_0x2dcc60,null));};exports[_0xb988('0x27')]=function(_0x30103c,_0x59dce9){return db[_0xb988('0x30')][_0xb988('0x50')]({'where':{'id':_0x30103c[_0xb988('0x45')]['id']}})['then'](handleEntityNotFound(_0x59dce9,null))[_0xb988('0x26')](removeEntity(_0x59dce9,null))[_0xb988('0x43')](handleError(_0x59dce9,null));};exports[_0xb988('0x53')]=function(_0x354f19,_0x333ca3,_0x363bc3){if(_0x354f19['body']['id']){delete _0x354f19[_0xb988('0x49')]['id'];}return db[_0xb988('0x30')][_0xb988('0x50')]({'where':{'id':_0x354f19['params']['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x333ca3,null))['then'](function(_0x2da4cb){if(_0x2da4cb){_0x354f19[_0xb988('0x49')][_0xb988('0x54')]=_0x2da4cb['id'];return db['Condition']['create'](_0x354f19[_0xb988('0x49')]);}})['then'](respondWithResult(_0x333ca3,null))['catch'](handleError(_0x333ca3,null));};exports[_0xb988('0x55')]=function(_0x440c59,_0x582c17,_0x46a8ec){if(_0x440c59[_0xb988('0x49')]['id']){delete _0x440c59[_0xb988('0x49')]['id'];}return db[_0xb988('0x30')][_0xb988('0x50')]({'where':{'id':_0x440c59[_0xb988('0x45')]['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x582c17,null))[_0xb988('0x26')](function(_0x1b280e){if(_0x1b280e){_0x440c59[_0xb988('0x49')][_0xb988('0x56')]=_0x1b280e['id'];return db[_0xb988('0x57')]['create'](_0x440c59[_0xb988('0x49')]);}})[_0xb988('0x26')](respondWithResult(_0x582c17,null))['catch'](handleError(_0x582c17,null));};exports[_0xb988('0x58')]=function(_0x164c4c,_0x34d8ce,_0x261043){var _0x5161d7={};var _0x2e2194={};var _0x51cddb;var _0x2cef7f;return db[_0xb988('0x30')][_0xb988('0x59')]({'where':{'id':_0x164c4c[_0xb988('0x45')]['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x34d8ce,null))[_0xb988('0x26')](function(_0x57d1e6){if(_0x57d1e6){_0x51cddb=_0x57d1e6;_0x2e2194[_0xb988('0x34')]=_[_0xb988('0x46')](db[_0xb988('0x57')][_0xb988('0x31')]);_0x2e2194[_0xb988('0x35')]=_['keys'](_0x164c4c['query']);_0x2e2194['filters']=_[_0xb988('0x37')](_0x2e2194[_0xb988('0x34')],_0x2e2194[_0xb988('0x35')]);_0x5161d7[_0xb988('0x38')]=_['intersection'](_0x2e2194['model'],qs[_0xb988('0x39')](_0x164c4c[_0xb988('0x35')]['fields']));_0x5161d7['attributes']=_0x5161d7[_0xb988('0x38')][_0xb988('0x5a')]?_0x5161d7[_0xb988('0x38')]:_0x2e2194[_0xb988('0x34')];_0x5161d7[_0xb988('0x5b')]=qs[_0xb988('0x3b')](_0x164c4c[_0xb988('0x35')][_0xb988('0x3b')]);_0x5161d7[_0xb988('0x3c')]=qs[_0xb988('0x36')](_['pick'](_0x164c4c[_0xb988('0x35')],_0x2e2194[_0xb988('0x36')]));if(_0x164c4c[_0xb988('0x35')][_0xb988('0x3e')]){_0x5161d7[_0xb988('0x3c')]=_[_0xb988('0x3f')](_0x5161d7['where'],{'$or':_['map'](_0x5161d7[_0xb988('0x38')],function(_0x2cab84){var _0x248cec={};_0x248cec[_0x2cab84]={'$like':'%'+_0x164c4c['query'][_0xb988('0x3e')]+'%'};return _0x248cec;})});}_0x5161d7=_[_0xb988('0x3f')]({},_0x5161d7,_0x164c4c['options']);return _0x51cddb[_0xb988('0x58')](_0x5161d7);}})[_0xb988('0x26')](function(_0x462e37){if(_0x462e37){_0x2cef7f=_0x462e37[_0xb988('0x5a')];if(!_0x164c4c[_0xb988('0x35')][_0xb988('0x3a')](_0xb988('0x5c'))){_0x5161d7[_0xb988('0x20')]=qs[_0xb988('0x20')](_0x164c4c[_0xb988('0x35')][_0xb988('0x20')]);_0x5161d7[_0xb988('0x1d')]=qs[_0xb988('0x1d')](_0x164c4c[_0xb988('0x35')][_0xb988('0x1d')]);}return _0x51cddb['getAllConditions'](_0x5161d7);}})[_0xb988('0x26')](function(_0x13aacc){if(_0x13aacc){return _0x13aacc?{'count':_0x2cef7f,'rows':_0x13aacc}:null;}})[_0xb988('0x26')](respondWithResult(_0x34d8ce,null))[_0xb988('0x43')](handleError(_0x34d8ce,null));};exports['getAnyConditions']=function(_0x32e376,_0x690e61,_0x505352){var _0x2691ad={};var _0x51f169={};var _0x42d1c8;var _0x50a48e;return db[_0xb988('0x30')][_0xb988('0x59')]({'where':{'id':_0x32e376[_0xb988('0x45')]['id']}})['then'](handleEntityNotFound(_0x690e61,null))[_0xb988('0x26')](function(_0x40960e){if(_0x40960e){_0x42d1c8=_0x40960e;_0x51f169[_0xb988('0x34')]=_[_0xb988('0x46')](db[_0xb988('0x57')]['rawAttributes']);_0x51f169[_0xb988('0x35')]=_['keys'](_0x32e376[_0xb988('0x35')]);_0x51f169[_0xb988('0x36')]=_[_0xb988('0x37')](_0x51f169['model'],_0x51f169[_0xb988('0x35')]);_0x2691ad[_0xb988('0x38')]=_[_0xb988('0x37')](_0x51f169[_0xb988('0x34')],qs[_0xb988('0x39')](_0x32e376['query']['fields']));_0x2691ad[_0xb988('0x38')]=_0x2691ad['attributes'][_0xb988('0x5a')]?_0x2691ad[_0xb988('0x38')]:_0x51f169[_0xb988('0x34')];_0x2691ad[_0xb988('0x5b')]=qs[_0xb988('0x3b')](_0x32e376[_0xb988('0x35')][_0xb988('0x3b')]);_0x2691ad[_0xb988('0x3c')]=qs['filters'](_[_0xb988('0x3d')](_0x32e376['query'],_0x51f169[_0xb988('0x36')]));if(_0x32e376[_0xb988('0x35')][_0xb988('0x3e')]){_0x2691ad['where']=_[_0xb988('0x3f')](_0x2691ad['where'],{'$or':_[_0xb988('0x2f')](_0x2691ad[_0xb988('0x38')],function(_0x2f4255){var _0x59bffe={};_0x59bffe[_0x2f4255]={'$like':'%'+_0x32e376[_0xb988('0x35')][_0xb988('0x3e')]+'%'};return _0x59bffe;})});}_0x2691ad=_[_0xb988('0x3f')]({},_0x2691ad,_0x32e376[_0xb988('0x47')]);return _0x42d1c8[_0xb988('0x5d')](_0x2691ad);}})['then'](function(_0x105af0){if(_0x105af0){_0x50a48e=_0x105af0[_0xb988('0x5a')];if(!_0x32e376['query'][_0xb988('0x3a')](_0xb988('0x5c'))){_0x2691ad[_0xb988('0x20')]=qs[_0xb988('0x20')](_0x32e376['query'][_0xb988('0x20')]);_0x2691ad['offset']=qs[_0xb988('0x1d')](_0x32e376[_0xb988('0x35')][_0xb988('0x1d')]);}return _0x42d1c8[_0xb988('0x5d')](_0x2691ad);}})[_0xb988('0x26')](function(_0x18a147){if(_0x18a147){return _0x18a147?{'count':_0x50a48e,'rows':_0x18a147}:null;}})[_0xb988('0x26')](respondWithResult(_0x690e61,null))[_0xb988('0x43')](handleError(_0x690e61,null));};exports[_0xb988('0x5e')]=function(_0x1622a6,_0x2996b1,_0x49946c){if(_0x1622a6['body']['id']){delete _0x1622a6[_0xb988('0x49')]['id'];}return db['Trigger']['find']({'where':{'id':_0x1622a6['params']['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x2996b1,null))['then'](function(_0x4e9ab1){if(_0x4e9ab1){_0x1622a6[_0xb988('0x49')]['TriggerId']=_0x4e9ab1['id'];return db['Action'][_0xb988('0x48')](_0x1622a6['body']);}})[_0xb988('0x26')](respondWithResult(_0x2996b1,null))[_0xb988('0x43')](handleError(_0x2996b1,null));};exports['getActions']=function(_0x27db71,_0x28c605,_0x33ab2a){var _0x5e082f={};var _0x574fe6={};var _0x3e3bf2;var _0x25b0d3;return db['Trigger'][_0xb988('0x59')]({'where':{'id':_0x27db71[_0xb988('0x45')]['id']}})['then'](handleEntityNotFound(_0x28c605,null))[_0xb988('0x26')](function(_0x204780){if(_0x204780){_0x3e3bf2=_0x204780;_0x574fe6[_0xb988('0x34')]=_[_0xb988('0x46')](db[_0xb988('0x5f')]['rawAttributes']);_0x574fe6[_0xb988('0x35')]=_['keys'](_0x27db71[_0xb988('0x35')]);_0x574fe6[_0xb988('0x36')]=_[_0xb988('0x37')](_0x574fe6[_0xb988('0x34')],_0x574fe6[_0xb988('0x35')]);_0x5e082f[_0xb988('0x38')]=_[_0xb988('0x37')](_0x574fe6[_0xb988('0x34')],qs[_0xb988('0x39')](_0x27db71['query'][_0xb988('0x39')]));_0x5e082f[_0xb988('0x38')]=_0x5e082f[_0xb988('0x38')][_0xb988('0x5a')]?_0x5e082f['attributes']:_0x574fe6['model'];_0x5e082f[_0xb988('0x5b')]=qs[_0xb988('0x3b')](_0x27db71[_0xb988('0x35')]['sort']);_0x5e082f['where']=qs[_0xb988('0x36')](_[_0xb988('0x3d')](_0x27db71[_0xb988('0x35')],_0x574fe6['filters']));if(_0x27db71[_0xb988('0x35')][_0xb988('0x3e')]){_0x5e082f[_0xb988('0x3c')]=_[_0xb988('0x3f')](_0x5e082f[_0xb988('0x3c')],{'$or':_['map'](_0x5e082f[_0xb988('0x38')],function(_0x3423eb){var _0x61431a={};_0x61431a[_0x3423eb]={'$like':'%'+_0x27db71[_0xb988('0x35')][_0xb988('0x3e')]+'%'};return _0x61431a;})});}_0x5e082f=_[_0xb988('0x3f')]({},_0x5e082f,_0x27db71[_0xb988('0x47')]);return _0x3e3bf2[_0xb988('0x60')](_0x5e082f);}})[_0xb988('0x26')](function(_0x4e9903){if(_0x4e9903){_0x25b0d3=_0x4e9903[_0xb988('0x5a')];if(!_0x27db71[_0xb988('0x35')]['hasOwnProperty'](_0xb988('0x5c'))){_0x5e082f[_0xb988('0x20')]=qs[_0xb988('0x20')](_0x27db71['query'][_0xb988('0x20')]);_0x5e082f[_0xb988('0x1d')]=qs[_0xb988('0x1d')](_0x27db71[_0xb988('0x35')][_0xb988('0x1d')]);}return _0x3e3bf2['getActions'](_0x5e082f);}})[_0xb988('0x26')](function(_0x4d5cff){if(_0x4d5cff){return _0x4d5cff?{'count':_0x25b0d3,'rows':_0x4d5cff}:null;}})[_0xb988('0x26')](respondWithResult(_0x28c605,null))[_0xb988('0x43')](handleError(_0x28c605,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 1572df9..f752b40 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 _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','lodash'];(function(_0x250a96,_0x1a0a4e){var _0x512c13=function(_0x4e95ce){while(--_0x4e95ce){_0x250a96['push'](_0x250a96['shift']());}};_0x512c13(++_0x1a0a4e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x00bb[_0x24237f];return _0x48298e;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a25=['path','../../config/environment','./trigger.attributes','exports','Trigger','tools_triggers','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x4a25,0x1d4));var _0x54a2=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0x4a25[_0x71e493];return _0x3d40ab;};'use strict';var _=require(_0x54a2('0x0'));var util=require('util');var logger=require(_0x54a2('0x1'))('api');var moment=require(_0x54a2('0x2'));var BPromise=require(_0x54a2('0x3'));var rp=require(_0x54a2('0x4'));var fs=require('fs');var path=require(_0x54a2('0x5'));var rimraf=require('rimraf');var config=require(_0x54a2('0x6'));var attributes=require(_0x54a2('0x7'));module[_0x54a2('0x8')]=function(_0x3ecde5,_0x472eed){return _0x3ecde5['define'](_0x54a2('0x9'),attributes,{'tableName':_0x54a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 061459e..215b24d 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 _0x996d=['raw','where','attributes','limit','include','map','model','debug','catch','Trigger','find','ShowTrigger','stringify','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','code','message','Trigger,\x20%s,\x20%s','result','GetTrigger','findAll','options'];(function(_0x218ea3,_0x36f59c){var _0x49265e=function(_0x2f18e8){while(--_0x2f18e8){_0x218ea3['push'](_0x218ea3['shift']());}};_0x49265e(++_0x36f59c);}(_0x996d,0x199));var _0xd996=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x996d[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd996('0x0'));var BPromise=require('bluebird');var rs=require(_0xd996('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd996('0x2'))['db'];var utils=require(_0xd996('0x3'));var logger=require('../../config/logger')(_0xd996('0x4'));var config=require(_0xd996('0x5'));var jayson=require(_0xd996('0x6'));var client=jayson[_0xd996('0x7')][_0xd996('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59a55d,_0x2c6f20,_0x19b123){return new BPromise(function(_0x578843,_0x5450f4){return client['request'](_0x59a55d,_0x19b123)[_0xd996('0x9')](function(_0x35fce4){logger[_0xd996('0xa')]('Trigger,\x20%s,\x20%s',_0x2c6f20,_0xd996('0xb'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x2c6f20,_0xd996('0xb'),JSON['stringify'](_0x35fce4));if(_0x35fce4[_0xd996('0xc')]){if(_0x35fce4[_0xd996('0xc')][_0xd996('0xd')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x2c6f20,_0x35fce4[_0xd996('0xc')]['message']);return _0x5450f4(_0x35fce4[_0xd996('0xc')][_0xd996('0xe')]);}logger[_0xd996('0xc')]('Trigger,\x20%s,\x20%s',_0x2c6f20,_0x35fce4[_0xd996('0xc')][_0xd996('0xe')]);return _0x578843(_0x35fce4['error'][_0xd996('0xe')]);}else{logger['info'](_0xd996('0xf'),_0x2c6f20,_0xd996('0xb'));_0x578843(_0x35fce4[_0xd996('0x10')][_0xd996('0xe')]);}})['catch'](function(_0x61099c){logger[_0xd996('0xc')](_0xd996('0xf'),_0x2c6f20,_0x61099c);_0x5450f4(_0x61099c);});});}exports[_0xd996('0x11')]=function(_0x4fcade){var _0x3984e5=this;return new Promise(function(_0x205ce0,_0xe72fad){return db['Trigger'][_0xd996('0x12')]({'raw':_0x4fcade[_0xd996('0x13')]?_0x4fcade['options'][_0xd996('0x14')]===undefined?!![]:![]:!![],'where':_0x4fcade[_0xd996('0x13')]?_0x4fcade[_0xd996('0x13')][_0xd996('0x15')]||null:null,'attributes':_0x4fcade[_0xd996('0x13')]?_0x4fcade[_0xd996('0x13')][_0xd996('0x16')]||null:null,'limit':_0x4fcade[_0xd996('0x13')]?_0x4fcade[_0xd996('0x13')][_0xd996('0x17')]||null:null,'include':_0x4fcade[_0xd996('0x13')]?_0x4fcade[_0xd996('0x13')][_0xd996('0x18')]?_['map'](_0x4fcade[_0xd996('0x13')][_0xd996('0x18')],function(_0x39bb56){return{'model':db[_0x39bb56['model']],'as':_0x39bb56['as'],'attributes':_0x39bb56['attributes'],'include':_0x39bb56['include']?_[_0xd996('0x19')](_0x39bb56[_0xd996('0x18')],function(_0xdb4a1a){return{'model':db[_0xdb4a1a['model']],'as':_0xdb4a1a['as'],'attributes':_0xdb4a1a[_0xd996('0x16')],'include':_0xdb4a1a[_0xd996('0x18')]?_['map'](_0xdb4a1a['include'],function(_0x372943){return{'model':db[_0x372943[_0xd996('0x1a')]],'as':_0x372943['as'],'attributes':_0x372943['attributes']};}):[]};}):[]};}):[]:[]})[_0xd996('0x9')](function(_0x150365){logger[_0xd996('0xa')](_0xd996('0x11'),_0x4fcade);logger[_0xd996('0x1b')](_0xd996('0x11'),_0x4fcade,JSON['stringify'](_0x150365));_0x205ce0(_0x150365);})[_0xd996('0x1c')](function(_0x1665e6){logger['error'](_0xd996('0x11'),_0x1665e6[_0xd996('0xe')],_0x4fcade);_0xe72fad(_0x3984e5[_0xd996('0xc')](0x1f4,_0x1665e6[_0xd996('0xe')]));});});};exports['ShowTrigger']=function(_0x487196){var _0x3dcfb9=this;return new Promise(function(_0x52aee8,_0xc95258){return db[_0xd996('0x1d')][_0xd996('0x1e')]({'raw':_0x487196[_0xd996('0x13')]?_0x487196[_0xd996('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x487196['options']?_0x487196[_0xd996('0x13')][_0xd996('0x15')]||null:null,'attributes':_0x487196[_0xd996('0x13')]?_0x487196[_0xd996('0x13')][_0xd996('0x16')]||null:null,'include':_0x487196[_0xd996('0x13')]?_0x487196['options'][_0xd996('0x18')]?_['map'](_0x487196[_0xd996('0x13')][_0xd996('0x18')],function(_0x1bab42){return{'model':db[_0x1bab42['model']],'as':_0x1bab42['as'],'attributes':_0x1bab42['attributes'],'include':_0x1bab42['include']?_[_0xd996('0x19')](_0x1bab42[_0xd996('0x18')],function(_0x58dc1a){return{'model':db[_0x58dc1a['model']],'as':_0x58dc1a['as'],'attributes':_0x58dc1a[_0xd996('0x16')],'include':_0x58dc1a[_0xd996('0x18')]?_['map'](_0x58dc1a['include'],function(_0x3991b0){return{'model':db[_0x3991b0[_0xd996('0x1a')]],'as':_0x3991b0['as'],'attributes':_0x3991b0[_0xd996('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd996('0x9')](function(_0x47d2ee){logger[_0xd996('0xa')](_0xd996('0x1f'),_0x487196);logger[_0xd996('0x1b')](_0xd996('0x1f'),_0x487196,JSON[_0xd996('0x20')](_0x47d2ee));_0x52aee8(_0x47d2ee);})[_0xd996('0x1c')](function(_0x1d1248){logger[_0xd996('0xc')](_0xd996('0x1f'),_0x1d1248[_0xd996('0xe')],_0x487196);_0xc95258(_0x3dcfb9[_0xd996('0xc')](0x1f4,_0x1d1248['message']));});});}; \ No newline at end of file +var _0xf9c2=['http','request','then','info','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','findAll','options','where','attributes','include','model','map','GetTrigger','debug','ShowTrigger','Trigger','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x10aa73,_0xc744f4){var _0x3496d9=function(_0x71c780){while(--_0x71c780){_0x10aa73['push'](_0x10aa73['shift']());}};_0x3496d9(++_0xc744f4);}(_0xf9c2,0xcc));var _0x2f9c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf9c2[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x2f9c('0x0'));var util=require(_0x2f9c('0x1'));var moment=require(_0x2f9c('0x2'));var BPromise=require(_0x2f9c('0x3'));var rs=require(_0x2f9c('0x4'));var fs=require('fs');var Redis=require(_0x2f9c('0x5'));var db=require(_0x2f9c('0x6'))['db'];var utils=require(_0x2f9c('0x7'));var logger=require(_0x2f9c('0x8'))(_0x2f9c('0x9'));var config=require(_0x2f9c('0xa'));var jayson=require(_0x2f9c('0xb'));var client=jayson['client'][_0x2f9c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35b1da,_0x584b0d,_0xa8b904){return new BPromise(function(_0x1c65ce,_0x2fb8f9){return client[_0x2f9c('0xd')](_0x35b1da,_0xa8b904)[_0x2f9c('0xe')](function(_0x308796){logger[_0x2f9c('0xf')]('Trigger,\x20%s,\x20%s',_0x584b0d,_0x2f9c('0x10'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x584b0d,_0x2f9c('0x10'),JSON[_0x2f9c('0x11')](_0x308796));if(_0x308796['error']){if(_0x308796[_0x2f9c('0x12')][_0x2f9c('0x13')]===0x1f4){logger[_0x2f9c('0x12')](_0x2f9c('0x14'),_0x584b0d,_0x308796[_0x2f9c('0x12')]['message']);return _0x2fb8f9(_0x308796[_0x2f9c('0x12')][_0x2f9c('0x15')]);}logger[_0x2f9c('0x12')](_0x2f9c('0x14'),_0x584b0d,_0x308796[_0x2f9c('0x12')]['message']);return _0x1c65ce(_0x308796['error']['message']);}else{logger['info'](_0x2f9c('0x14'),_0x584b0d,_0x2f9c('0x10'));_0x1c65ce(_0x308796[_0x2f9c('0x16')][_0x2f9c('0x15')]);}})[_0x2f9c('0x17')](function(_0x1e2503){logger[_0x2f9c('0x12')](_0x2f9c('0x14'),_0x584b0d,_0x1e2503);_0x2fb8f9(_0x1e2503);});});}exports['GetTrigger']=function(_0x157ef1){var _0x147dbe=this;return new Promise(function(_0x5c2397,_0x9b983b){return db['Trigger'][_0x2f9c('0x18')]({'raw':_0x157ef1['options']?_0x157ef1[_0x2f9c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x157ef1[_0x2f9c('0x19')]?_0x157ef1['options'][_0x2f9c('0x1a')]||null:null,'attributes':_0x157ef1[_0x2f9c('0x19')]?_0x157ef1[_0x2f9c('0x19')][_0x2f9c('0x1b')]||null:null,'limit':_0x157ef1['options']?_0x157ef1['options']['limit']||null:null,'include':_0x157ef1[_0x2f9c('0x19')]?_0x157ef1[_0x2f9c('0x19')][_0x2f9c('0x1c')]?_['map'](_0x157ef1[_0x2f9c('0x19')][_0x2f9c('0x1c')],function(_0x43aae6){return{'model':db[_0x43aae6[_0x2f9c('0x1d')]],'as':_0x43aae6['as'],'attributes':_0x43aae6[_0x2f9c('0x1b')],'include':_0x43aae6[_0x2f9c('0x1c')]?_['map'](_0x43aae6[_0x2f9c('0x1c')],function(_0x507918){return{'model':db[_0x507918[_0x2f9c('0x1d')]],'as':_0x507918['as'],'attributes':_0x507918['attributes'],'include':_0x507918['include']?_[_0x2f9c('0x1e')](_0x507918[_0x2f9c('0x1c')],function(_0x5ab900){return{'model':db[_0x5ab900['model']],'as':_0x5ab900['as'],'attributes':_0x5ab900[_0x2f9c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2f9c('0xe')](function(_0x14bdea){logger['info'](_0x2f9c('0x1f'),_0x157ef1);logger[_0x2f9c('0x20')](_0x2f9c('0x1f'),_0x157ef1,JSON['stringify'](_0x14bdea));_0x5c2397(_0x14bdea);})[_0x2f9c('0x17')](function(_0x42dec8){logger[_0x2f9c('0x12')](_0x2f9c('0x1f'),_0x42dec8[_0x2f9c('0x15')],_0x157ef1);_0x9b983b(_0x147dbe['error'](0x1f4,_0x42dec8[_0x2f9c('0x15')]));});});};exports[_0x2f9c('0x21')]=function(_0x33201c){var _0x58eff6=this;return new Promise(function(_0x1e93a5,_0x3f8b9d){return db[_0x2f9c('0x22')]['find']({'raw':_0x33201c[_0x2f9c('0x19')]?_0x33201c['options'][_0x2f9c('0x23')]===undefined?!![]:![]:!![],'where':_0x33201c['options']?_0x33201c[_0x2f9c('0x19')][_0x2f9c('0x1a')]||null:null,'attributes':_0x33201c[_0x2f9c('0x19')]?_0x33201c[_0x2f9c('0x19')][_0x2f9c('0x1b')]||null:null,'include':_0x33201c[_0x2f9c('0x19')]?_0x33201c[_0x2f9c('0x19')][_0x2f9c('0x1c')]?_[_0x2f9c('0x1e')](_0x33201c[_0x2f9c('0x19')]['include'],function(_0x89f093){return{'model':db[_0x89f093[_0x2f9c('0x1d')]],'as':_0x89f093['as'],'attributes':_0x89f093[_0x2f9c('0x1b')],'include':_0x89f093[_0x2f9c('0x1c')]?_[_0x2f9c('0x1e')](_0x89f093[_0x2f9c('0x1c')],function(_0x30a32f){return{'model':db[_0x30a32f[_0x2f9c('0x1d')]],'as':_0x30a32f['as'],'attributes':_0x30a32f[_0x2f9c('0x1b')],'include':_0x30a32f[_0x2f9c('0x1c')]?_[_0x2f9c('0x1e')](_0x30a32f[_0x2f9c('0x1c')],function(_0x26dd98){return{'model':db[_0x26dd98[_0x2f9c('0x1d')]],'as':_0x26dd98['as'],'attributes':_0x26dd98[_0x2f9c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a01dd){logger[_0x2f9c('0xf')](_0x2f9c('0x21'),_0x33201c);logger[_0x2f9c('0x20')](_0x2f9c('0x21'),_0x33201c,JSON[_0x2f9c('0x11')](_0x3a01dd));_0x1e93a5(_0x3a01dd);})[_0x2f9c('0x17')](function(_0x30c40c){logger[_0x2f9c('0x12')](_0x2f9c('0x21'),_0x30c40c[_0x2f9c('0x15')],_0x33201c);_0x3f8b9d(_0x58eff6[_0x2f9c('0x12')](0x1f4,_0x30c40c['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index c0a478b..eaeeff9 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 _0xe166=['./trunk.controller','get','index','/:id','isAuthenticated','/:id/clone','post','create','put','destroy','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a5648,_0x58054e){var _0x34126d=function(_0x3a6476){while(--_0x3a6476){_0x3a5648['push'](_0x3a5648['shift']());}};_0x34126d(++_0x58054e);}(_0xe166,0x19a));var _0x6e16=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe166[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6e16('0x0'));var util=require('util');var path=require(_0x6e16('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6e16('0x2'));var auth=require(_0x6e16('0x3'));var interaction=require(_0x6e16('0x4'));var config=require(_0x6e16('0x5'));var controller=require(_0x6e16('0x6'));router[_0x6e16('0x7')]('/',auth['isAuthenticated'](),controller[_0x6e16('0x8')]);router['get'](_0x6e16('0x9'),auth[_0x6e16('0xa')](),controller['show']);router['post'](_0x6e16('0xb'),auth[_0x6e16('0xa')](),controller['clone']);router[_0x6e16('0xc')]('/',auth[_0x6e16('0xa')](),controller[_0x6e16('0xd')]);router[_0x6e16('0xe')](_0x6e16('0x9'),auth[_0x6e16('0xa')](),controller['update']);router['delete'](_0x6e16('0x9'),auth[_0x6e16('0xa')](),controller[_0x6e16('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb7ff=['post','/:id/clone','clone','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id'];(function(_0xd35dfe,_0x2f4036){var _0xa3c281=function(_0x18212d){while(--_0x18212d){_0xd35dfe['push'](_0xd35dfe['shift']());}};_0xa3c281(++_0x2f4036);}(_0xb7ff,0x142));var _0xfb7f=function(_0x3d72b3,_0x2a68e7){_0x3d72b3=_0x3d72b3-0x0;var _0x4588d7=_0xb7ff[_0x3d72b3];return _0x4588d7;};'use strict';var multer=require(_0xfb7f('0x0'));var util=require(_0xfb7f('0x1'));var path=require(_0xfb7f('0x2'));var timeout=require(_0xfb7f('0x3'));var express=require(_0xfb7f('0x4'));var router=express[_0xfb7f('0x5')]();var fs_extra=require(_0xfb7f('0x6'));var auth=require(_0xfb7f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfb7f('0x8'));var controller=require(_0xfb7f('0x9'));router[_0xfb7f('0xa')]('/',auth[_0xfb7f('0xb')](),controller[_0xfb7f('0xc')]);router[_0xfb7f('0xa')](_0xfb7f('0xd'),auth[_0xfb7f('0xb')](),controller['show']);router[_0xfb7f('0xe')](_0xfb7f('0xf'),auth[_0xfb7f('0xb')](),controller[_0xfb7f('0x10')]);router['post']('/',auth[_0xfb7f('0xb')](),controller[_0xfb7f('0x11')]);router[_0xfb7f('0x12')]('/:id',auth[_0xfb7f('0xb')](),controller['update']);router['delete'](_0xfb7f('0xd'),auth[_0xfb7f('0xb')](),controller[_0xfb7f('0x13')]);module[_0xfb7f('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3ebfd1b..4b26bc5 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 _0xdc73=['accept','uac','uas','fingerprint','certificate','actpass','dynamic','update,nonat','BOOLEAN','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','STRING','udp','setDataValue','transport','join','getDataValue','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','split','all','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc73,0x111));var _0x3dc7=function(_0x1a2889,_0x20f068){_0x1a2889=_0x1a2889-0x0;var _0x54fca6=_0xdc73[_0x1a2889];return _0x54fca6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x1'),_0x3dc7('0x2'),_0x3dc7('0x3')),'allowNull':![],'defaultValue':_0x3dc7('0x1')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3dc7('0x4')},'callingpres':{'type':Sequelize[_0x3dc7('0x0')]('ALLOWED_NOT_SCREENED',_0x3dc7('0x5'),_0x3dc7('0x6'),_0x3dc7('0x7'),_0x3dc7('0x8'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x3dc7('0x9'))},'deny':{'type':Sequelize[_0x3dc7('0xa')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x3dc7('0xa')]},'md5secret':{'type':Sequelize[_0x3dc7('0xa')]},'remotesecret':{'type':Sequelize[_0x3dc7('0xa')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x3dc7('0xb'),'set':function(_0x2696cd){this[_0x3dc7('0xc')](_0x3dc7('0xd'),_0x2696cd?_0x2696cd[_0x3dc7('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x3dc7('0xd'))?this[_0x3dc7('0xf')](_0x3dc7('0xd'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x3dc7('0x0')]('rfc2833',_0x3dc7('0x10'),_0x3dc7('0x11'),_0x3dc7('0x12'),_0x3dc7('0x13')),'defaultValue':_0x3dc7('0x14')},'directmedia':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no',_0x3dc7('0x16'),_0x3dc7('0x17'),_0x3dc7('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3dc7('0x0')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x3dc7('0xa')],'defaultValue':_0x3dc7('0x19'),'set':function(_0x35e1be){this[_0x3dc7('0xc')](_0x3dc7('0x1a'),_0x35e1be?_0x35e1be[_0x3dc7('0xe')](','):null);},'get':function(){return this[_0x3dc7('0xf')](_0x3dc7('0x1a'))?this[_0x3dc7('0xf')](_0x3dc7('0x1a'))[_0x3dc7('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x3dc7('0xa')]},'namedcallgroup':{'type':Sequelize[_0x3dc7('0xa')]},'pickupgroup':{'type':Sequelize[_0x3dc7('0xa')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3dc7('0xa')],'defaultValue':_0x3dc7('0x1c')},'allow':{'type':Sequelize[_0x3dc7('0xa')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x67ee84){this['setDataValue']('allow',_0x67ee84?_0x67ee84['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x3dc7('0x1d'))?this[_0x3dc7('0xf')](_0x3dc7('0x1d'))[_0x3dc7('0x1b')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no')},'insecure':{'type':Sequelize[_0x3dc7('0xa')],'defaultValue':_0x3dc7('0x1e'),'set':function(_0x2fc6f7){this['setDataValue']('insecure',_0x2fc6f7?_0x2fc6f7[_0x3dc7('0xe')](','):null);},'get':function(){return this[_0x3dc7('0xf')](_0x3dc7('0x1f'))?this[_0x3dc7('0xf')]('insecure')[_0x3dc7('0x1b')](','):null;},'comment':_0x3dc7('0x20')},'trustrpid':{'type':Sequelize['ENUM'](_0x3dc7('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x3dc7('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no','never')},'promiscredir':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no')},'useclientcode':{'type':Sequelize[_0x3dc7('0x0')]('yes','no')},'accountcode':{'type':Sequelize[_0x3dc7('0x21')](0xb)},'setvar':{'type':Sequelize[_0x3dc7('0xa')]},'callerid':{'type':Sequelize[_0x3dc7('0xa')],'defaultValue':_0x3dc7('0x22')},'amaflags':{'type':Sequelize[_0x3dc7('0xa')]},'callcounter':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x3dc7('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x3dc7('0xa')]},'template':{'type':Sequelize[_0x3dc7('0xa')]},'videosupport':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3dc7('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3dc7('0x0')]('yes','no')},'mailbox':{'type':Sequelize[_0x3dc7('0xa')]},'session_timers':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x23'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x3dc7('0x21')](0xb)},'session_minse':{'type':Sequelize[_0x3dc7('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x24'),'uas'),'defaultValue':_0x3dc7('0x25')},'t38pt_usertpsource':{'type':Sequelize[_0x3dc7('0xa')]},'regexten':{'type':Sequelize[_0x3dc7('0xa')]},'fromdomain':{'type':Sequelize[_0x3dc7('0xa')]},'fromuser':{'type':Sequelize[_0x3dc7('0xa')]},'port':{'type':Sequelize[_0x3dc7('0x21')](0x5)},'qualify':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x3dc7('0x21')](0xb)},'defaultip':{'type':Sequelize[_0x3dc7('0xa')]},'defaultuser':{'type':Sequelize[_0x3dc7('0xa')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3dc7('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0x3dc7('0x0')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3dc7('0xa')]},'callbackextension':{'type':Sequelize[_0x3dc7('0xa')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x3dc7('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0x3dc7('0xa')]},'contactdeny':{'type':Sequelize[_0x3dc7('0xa')]},'contactacl':{'type':Sequelize[_0x3dc7('0xa')]},'unsolicited_mailbox':{'type':Sequelize[_0x3dc7('0xa')]},'use_q850_reason':{'type':Sequelize[_0x3dc7('0xa')]},'maxforwards':{'type':Sequelize[_0x3dc7('0x21')](0xb)},'encryption':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x3dc7('0x15'),'no')},'force_avp':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x3dc7('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x3dc7('0x0')]('yes','no',_0x3dc7('0x26'),_0x3dc7('0x27'))},'dtlsrekey':{'type':Sequelize[_0x3dc7('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3dc7('0xa')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x3dc7('0xa')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x3dc7('0xa')]},'dtlssetup':{'type':Sequelize[_0x3dc7('0x0')]('active','passive',_0x3dc7('0x28')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3dc7('0xa')]},'usereqphone':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3dc7('0xa')]},'recordofffeature':{'type':Sequelize[_0x3dc7('0xa')]},'call_limit':{'type':Sequelize[_0x3dc7('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x3dc7('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no')},'vmexten':{'type':Sequelize[_0x3dc7('0xa')]},'mohinterpret':{'type':Sequelize[_0x3dc7('0xa')]},'mohsuggest':{'type':Sequelize[_0x3dc7('0xa')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3dc7('0xa')]},'host':{'type':Sequelize[_0x3dc7('0xa')],'defaultValue':_0x3dc7('0x29')},'canreinvite':{'type':Sequelize[_0x3dc7('0x0')](_0x3dc7('0x15'),'no',_0x3dc7('0x16'),_0x3dc7('0x17'),_0x3dc7('0x2a')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3dc7('0xa')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3dc7('0x2b')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3dc7('0xa')],'defaultValue':'no'}}; \ No newline at end of file +var _0x9c7d=['allow','insecure','never','\x22\x22\x20<>','INTEGER','refuse','originate','uas','fingerprint','certificate','active','actpass','dynamic','update','update,nonat','BOOLEAN','exports','name','ENUM','friend','user','from-voip-provider','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','setDataValue','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','outgoing','yes','force_rport,comedia','getDataValue','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm'];(function(_0x470886,_0x47b767){var _0x13619b=function(_0x141f54){while(--_0x141f54){_0x470886['push'](_0x470886['shift']());}};_0x13619b(++_0x47b767);}(_0x9c7d,0xfb));var _0xd9c7=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0x9c7d[_0x24fa1a];return _0xc5621f;};'use strict';var Sequelize=require('sequelize');module[_0xd9c7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd9c7('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x3'),_0xd9c7('0x4'),'peer'),'allowNull':![],'defaultValue':_0xd9c7('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd9c7('0x5')},'callingpres':{'type':Sequelize[_0xd9c7('0x2')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xd9c7('0x6'),_0xd9c7('0x7'),'PROHIB_PASSED_SCREEN',_0xd9c7('0x8'),_0xd9c7('0x9'))},'deny':{'type':Sequelize[_0xd9c7('0xa')]},'permit':{'type':Sequelize[_0xd9c7('0xa')]},'secret':{'type':Sequelize[_0xd9c7('0xa')]},'md5secret':{'type':Sequelize[_0xd9c7('0xa')]},'remotesecret':{'type':Sequelize[_0xd9c7('0xa')]},'transport':{'type':Sequelize[_0xd9c7('0xa')],'defaultValue':_0xd9c7('0xb'),'set':function(_0xc25ef9){this[_0xd9c7('0xc')](_0xd9c7('0xd'),_0xc25ef9?_0xc25ef9[_0xd9c7('0xe')](','):null);},'get':function(){return this['getDataValue'](_0xd9c7('0xd'))?this['getDataValue'](_0xd9c7('0xd'))['split'](','):null;},'comment':_0xd9c7('0xf')},'dtmfmode':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x10'),_0xd9c7('0x11'),_0xd9c7('0x12'),_0xd9c7('0x13'),_0xd9c7('0x14')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xd9c7('0x2')]('yes','no',_0xd9c7('0x15'),'update',_0xd9c7('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd9c7('0xa')]},'directmediadeny':{'type':Sequelize[_0xd9c7('0xa')]},'nat':{'type':Sequelize[_0xd9c7('0xa')],'defaultValue':_0xd9c7('0x18'),'set':function(_0x2dc55a){this['setDataValue']('nat',_0x2dc55a?_0x2dc55a[_0xd9c7('0xe')](','):null);},'get':function(){return this[_0xd9c7('0x19')](_0xd9c7('0x1a'))?this[_0xd9c7('0x19')](_0xd9c7('0x1a'))[_0xd9c7('0x1b')](','):null;},'comment':_0xd9c7('0x1c')},'callgroup':{'type':Sequelize[_0xd9c7('0xa')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xd9c7('0xa')]},'language':{'type':Sequelize[_0xd9c7('0xa')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xd9c7('0x1d')},'allow':{'type':Sequelize[_0xd9c7('0xa')],'allowNull':![],'defaultValue':_0xd9c7('0x1e'),'set':function(_0x358caa){this[_0xd9c7('0xc')]('allow',_0x358caa?_0x358caa[_0xd9c7('0xe')](';'):_0xd9c7('0x1e'));},'get':function(){return this[_0xd9c7('0x19')](_0xd9c7('0x1f'))?this[_0xd9c7('0x19')](_0xd9c7('0x1f'))[_0xd9c7('0x1b')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x2be692){this[_0xd9c7('0xc')](_0xd9c7('0x20'),_0x2be692?_0x2be692[_0xd9c7('0xe')](','):null);},'get':function(){return this[_0xd9c7('0x19')]('insecure')?this[_0xd9c7('0x19')]('insecure')[_0xd9c7('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd9c7('0x2')]('yes','no',_0xd9c7('0x21'))},'promiscredir':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xd9c7('0x22')},'amaflags':{'type':Sequelize[_0xd9c7('0xa')]},'callcounter':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no'),'defaultValue':_0xd9c7('0x17')},'busylevel':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xd9c7('0xa')]},'template':{'type':Sequelize[_0xd9c7('0xa')]},'videosupport':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'mailbox':{'type':Sequelize[_0xd9c7('0xa')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xd9c7('0x24'),_0xd9c7('0x25'))},'session_expires':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0xd9c7('0x26')),'defaultValue':_0xd9c7('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0xd9c7('0xa')]},'regexten':{'type':Sequelize[_0xd9c7('0xa')]},'fromdomain':{'type':Sequelize[_0xd9c7('0xa')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd9c7('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd9c7('0xa')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'timerb':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xd9c7('0xa')]},'contactdeny':{'type':Sequelize[_0xd9c7('0xa')]},'contactacl':{'type':Sequelize[_0xd9c7('0xa')]},'unsolicited_mailbox':{'type':Sequelize[_0xd9c7('0xa')]},'use_q850_reason':{'type':Sequelize[_0xd9c7('0xa')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'force_avp':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'icesupport':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no',_0xd9c7('0x27'),_0xd9c7('0x28'))},'dtlsrekey':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd9c7('0xa')]},'dtlsprivatekey':{'type':Sequelize[_0xd9c7('0xa')]},'dtlscipher':{'type':Sequelize[_0xd9c7('0xa')]},'dtlscafile':{'type':Sequelize[_0xd9c7('0xa')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x29'),'passive',_0xd9c7('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd9c7('0xa')]},'usereqphone':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xd9c7('0xa')]},'call_limit':{'type':Sequelize[_0xd9c7('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd9c7('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'vmexten':{'type':Sequelize[_0xd9c7('0xa')]},'mohinterpret':{'type':Sequelize[_0xd9c7('0xa')]},'mohsuggest':{'type':Sequelize[_0xd9c7('0xa')]},'parkinglot':{'type':Sequelize[_0xd9c7('0xa')]},'description':{'type':Sequelize[_0xd9c7('0xa')]},'host':{'type':Sequelize[_0xd9c7('0xa')],'defaultValue':_0xd9c7('0x2b')},'canreinvite':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no',_0xd9c7('0x15'),_0xd9c7('0x2c'),_0xd9c7('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd9c7('0xa')]},'otherFields':{'type':Sequelize[_0xd9c7('0xa')]},'active':{'type':Sequelize[_0xd9c7('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 77b514b..0bcf07b 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 _0x84ab=['../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','fields','attributes','length','model','order','sort','where','filters','pick','merge','filter','options','Trunk','count','includeAll','rows','params','include','find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','autoAssociation','root','chan_sip.so','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1afeb1,_0x4ef5e7){var _0x397155=function(_0x1c040b){while(--_0x1c040b){_0x1afeb1['push'](_0x1afeb1['shift']());}};_0x397155(++_0x4ef5e7);}(_0x84ab,0x12f));var _0xb84a=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0x84ab[_0xdbe2de];return _0x2facd7;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x16')][_0xb84a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39a0df,_0x3c161c,_0x44b26b,_0x11dfe9){return new BPromise(function(_0x12ccab,_0x475b){var _0x3113a2=_0x11dfe9||client;return _0x3113a2[_0xb84a('0x18')](_0x39a0df,_0x44b26b)[_0xb84a('0x19')](function(_0x1251ec){logger['info'](_0xb84a('0x1a'),_0x3c161c,_0xb84a('0x1b'));logger[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x3c161c,_0xb84a('0x1b'),JSON[_0xb84a('0x1e')](_0x1251ec));if(_0x1251ec[_0xb84a('0x1f')]){if(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x20')]===0x1f4){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);return _0x475b(_0x1251ec[_0xb84a('0x1f')]['message']);}logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec['error'][_0xb84a('0x21')]);return _0x12ccab(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);}else{logger[_0xb84a('0x22')]('Trunk,\x20%s,\x20%s',_0x3c161c,'request\x20sent');_0x12ccab(_0x1251ec[_0xb84a('0x23')][_0xb84a('0x21')]);}})[_0xb84a('0x24')](function(_0x259f74){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x259f74);_0x475b(_0x259f74);});});}function respondWithStatusCode(_0x8b28cd,_0x21d0d3){_0x21d0d3=_0x21d0d3||0xcc;return function(_0x3aa06f){if(_0x3aa06f){return _0x8b28cd[_0xb84a('0x25')](_0x21d0d3);}return _0x8b28cd[_0xb84a('0x26')](_0x21d0d3)[_0xb84a('0x27')]();};}function respondWithResult(_0x218aef,_0x409df0){_0x409df0=_0x409df0||0xc8;return function(_0x19bdfa){if(_0x19bdfa){return _0x218aef[_0xb84a('0x26')](_0x409df0)[_0xb84a('0x28')](_0x19bdfa);}};}function respondWithFilteredResult(_0x3ff0bc,_0x3b6805){return function(_0xd468c3){if(_0xd468c3){var _0x33bf1d=typeof _0x3b6805[_0xb84a('0x29')]===_0xb84a('0x2a')&&typeof _0x3b6805[_0xb84a('0x2b')]===_0xb84a('0x2a');var _0x97d71b=_0xd468c3['count'];var _0x582954=_0x33bf1d?0x0:_0x3b6805[_0xb84a('0x29')];var _0x2c30b0=_0x33bf1d?_0xd468c3['count']:_0x3b6805[_0xb84a('0x29')]+_0x3b6805[_0xb84a('0x2b')];var _0x52c23c;if(_0x2c30b0>=_0x97d71b){_0x2c30b0=_0x97d71b;_0x52c23c=0xc8;}else{_0x52c23c=0xce;}_0x3ff0bc['status'](_0x52c23c);return _0x3ff0bc[_0xb84a('0x2c')](_0xb84a('0x2d'),_0x582954+'-'+_0x2c30b0+'/'+_0x97d71b)['json'](_0xd468c3);}return null;};}function patchUpdates(_0x251778){return function(_0xba1147){try{jsonpatch[_0xb84a('0x2e')](_0xba1147,_0x251778,!![]);}catch(_0x44a405){return BPromise[_0xb84a('0x2f')](_0x44a405);}return _0xba1147[_0xb84a('0x30')]();};}function saveUpdates(_0x34b212,_0xac214f){return function(_0x54ec50){if(_0x54ec50){return _0x54ec50[_0xb84a('0x31')](_0x34b212)['then'](function(_0x4bca85){return _0x4bca85;});}return null;};}function removeEntity(_0x2eea7e,_0x3b4515){return function(_0x47a5b6){if(_0x47a5b6){return _0x47a5b6['destroy']()[_0xb84a('0x19')](function(){var _0x13c167=_0x47a5b6[_0xb84a('0x32')]({'plain':!![]});var _0x308240=_0xb84a('0x33');return db[_0xb84a('0x34')][_0xb84a('0x35')]({'where':{'type':_0x308240,'resourceId':_0x13c167['id']}})[_0xb84a('0x19')](function(){return _0x47a5b6;});})['then'](function(){_0x2eea7e[_0xb84a('0x26')](0xcc)[_0xb84a('0x27')]();});}};}function handleEntityNotFound(_0x10b944,_0xf894a6){return function(_0x36aa07){if(!_0x36aa07){_0x10b944[_0xb84a('0x25')](0x194);}return _0x36aa07;};}function handleError(_0x2a5130,_0x5aa2ae){_0x5aa2ae=_0x5aa2ae||0x1f4;return function(_0x30d22d){logger['error'](_0x30d22d[_0xb84a('0x36')]);if(_0x30d22d[_0xb84a('0x37')]){delete _0x30d22d[_0xb84a('0x37')];}_0x2a5130['status'](_0x5aa2ae)['send'](_0x30d22d);};}exports[_0xb84a('0x38')]=function(_0x75e6e6,_0x4a3737){var _0x2d3e08={},_0xab76ce={},_0x4cb5d4={'count':0x0,'rows':[]};var _0x19aa4c=_[_0xb84a('0x39')](db['Trunk'][_0xb84a('0x3a')],function(_0xe6f19e){return{'name':_0xe6f19e[_0xb84a('0x3b')],'type':_0xe6f19e[_0xb84a('0x3c')]['key']};});_0xab76ce['model']=_['map'](_0x19aa4c,_0xb84a('0x37'));_0xab76ce[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x75e6e6[_0xb84a('0x3d')]);_0xab76ce['filters']=_[_0xb84a('0x3f')](_0xab76ce['model'],_0xab76ce[_0xb84a('0x3d')]);_0x2d3e08['attributes']=_['intersection'](_0xab76ce['model'],qs[_0xb84a('0x40')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x2d3e08[_0xb84a('0x41')]=_0x2d3e08['attributes'][_0xb84a('0x42')]?_0x2d3e08[_0xb84a('0x41')]:_0xab76ce[_0xb84a('0x43')];if(!_0x75e6e6[_0xb84a('0x3d')]['hasOwnProperty']('nolimit')){_0x2d3e08[_0xb84a('0x2b')]=qs[_0xb84a('0x2b')](_0x75e6e6['query'][_0xb84a('0x2b')]);_0x2d3e08[_0xb84a('0x29')]=qs[_0xb84a('0x29')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x29')]);}_0x2d3e08[_0xb84a('0x44')]=qs[_0xb84a('0x45')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x45')]);_0x2d3e08[_0xb84a('0x46')]=qs[_0xb84a('0x47')](_[_0xb84a('0x48')](_0x75e6e6[_0xb84a('0x3d')],_0xab76ce[_0xb84a('0x47')]),_0x19aa4c);if(_0x75e6e6[_0xb84a('0x3d')]['filter']){_0x2d3e08[_0xb84a('0x46')]=_[_0xb84a('0x49')](_0x2d3e08[_0xb84a('0x46')],{'$or':_[_0xb84a('0x39')](_0x19aa4c,function(_0x37f4fe){if(_0x37f4fe[_0xb84a('0x3c')]!=='VIRTUAL'){var _0xfd2927={};_0xfd2927[_0x37f4fe['name']]={'$like':'%'+_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4a')]+'%'};return _0xfd2927;}})});}_0x2d3e08=_[_0xb84a('0x49')]({},_0x2d3e08,_0x75e6e6[_0xb84a('0x4b')]);var _0x5e7327={'where':_0x2d3e08[_0xb84a('0x46')]};return db[_0xb84a('0x4c')][_0xb84a('0x4d')](_0x5e7327)['then'](function(_0x55f39f){_0x4cb5d4[_0xb84a('0x4d')]=_0x55f39f;if(_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4e')]){_0x2d3e08['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x2d3e08);})[_0xb84a('0x19')](function(_0x384a0d){_0x4cb5d4[_0xb84a('0x4f')]=_0x384a0d;return _0x4cb5d4;})[_0xb84a('0x19')](respondWithFilteredResult(_0x4a3737,_0x2d3e08))[_0xb84a('0x24')](handleError(_0x4a3737,null));};exports['show']=function(_0x4b40fe,_0x5b853a){var _0x53d4d6={'raw':![],'where':{'id':_0x4b40fe[_0xb84a('0x50')]['id']}},_0x421ba0={};_0x421ba0['model']=_[_0xb84a('0x3e')](db[_0xb84a('0x4c')][_0xb84a('0x3a')]);_0x421ba0[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x4b40fe[_0xb84a('0x3d')]);_0x421ba0['filters']=_['intersection'](_0x421ba0[_0xb84a('0x43')],_0x421ba0['query']);_0x53d4d6[_0xb84a('0x41')]=_['intersection'](_0x421ba0['model'],qs['fields'](_0x4b40fe[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x53d4d6[_0xb84a('0x41')]=_0x53d4d6[_0xb84a('0x41')][_0xb84a('0x42')]?_0x53d4d6[_0xb84a('0x41')]:_0x421ba0[_0xb84a('0x43')];if(_0x4b40fe[_0xb84a('0x3d')]['includeAll']){_0x53d4d6['include']=[{'all':!![]}];}_0x53d4d6=_['merge']({},_0x53d4d6,_0x4b40fe[_0xb84a('0x4b')]);return db[_0xb84a('0x4c')]['find'](_0x53d4d6)[_0xb84a('0x19')](handleEntityNotFound(_0x5b853a,null))['then'](respondWithResult(_0x5b853a,null))['catch'](handleError(_0x5b853a,null));};exports['clone']=function(_0x419e27,_0x172076){var _0x49a0e2={'where':{'id':_0x419e27[_0xb84a('0x50')]['id']}},_0x51c415={};_0x51c415[_0xb84a('0x43')]=_[_0xb84a('0x3e')](db['Trunk'][_0xb84a('0x3a')]);_0x49a0e2['attributes']=_['intersection'](_0x51c415[_0xb84a('0x43')],qs['fields'](_0x419e27[_0xb84a('0x3d')]['fields']));_0x49a0e2[_0xb84a('0x41')]=_0x49a0e2[_0xb84a('0x41')][_0xb84a('0x42')]?_0x49a0e2[_0xb84a('0x41')]:_0x51c415['model'];if(_0x419e27['query']['includeAll']){_0x49a0e2[_0xb84a('0x51')]=[{'all':!![]}];}_0x49a0e2=_[_0xb84a('0x49')]({},_0x49a0e2,_0x419e27['options']);return db['Trunk'][_0xb84a('0x52')](_0x49a0e2)[_0xb84a('0x19')](handleEntityNotFound(_0x172076,null))[_0xb84a('0x19')](function(_0x5f415d){if(_0x5f415d){var _0x29f67f=_0x5f415d[_0xb84a('0x32')]({'plain':!![]});_0x29f67f=qs['omit'](_0x29f67f,['id',_0xb84a('0x53'),_0xb84a('0x54')]);_0x419e27[_0xb84a('0x55')]=_[_0xb84a('0x56')](_0x419e27[_0xb84a('0x55')],['id',_0xb84a('0x53'),_0xb84a('0x54')]);return db['Trunk'][_0xb84a('0x57')](_[_0xb84a('0x49')](_0x29f67f,_0x419e27['body']),{'include':_0x419e27[_0xb84a('0x3d')][_0xb84a('0x4e')]?[{'all':!![]}]:undefined})[_0xb84a('0x19')](function(_0x3e16d8){var _0x347998=_0x419e27[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x347998)throw new Error(_0xb84a('0x59'));if(_0x347998[_0xb84a('0x5a')]==='user'){var _0x291008=_0x3e16d8['get']({'plain':!![]});var _0x5a2d44=_0xb84a('0x33');return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0x5a2d44,'userProfileId':_0x347998['userProfileId']},'raw':!![]})[_0xb84a('0x19')](function(_0x44e508){if(_0x44e508&&_0x44e508['autoAssociation']===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x291008[_0xb84a('0x37')],'resourceId':_0x291008['id'],'type':_0x44e508[_0xb84a('0x37')],'sectionId':_0x44e508['id']},{})[_0xb84a('0x19')](function(){return _0x3e16d8;});}else{return _0x3e16d8;}})[_0xb84a('0x24')](function(_0x4514f0){logger['error'](_0xb84a('0x5b'),_0x4514f0);throw _0x4514f0;});}return _0x3e16d8;});}})['then'](respondWithResult(_0x172076,0xc9))['catch'](handleError(_0x172076,null));};exports[_0xb84a('0x57')]=function(_0x2a2dc0,_0x2ee241,_0x32a455){var _0x5612f3;return db['Trunk'][_0xb84a('0x57')](_0x2a2dc0[_0xb84a('0x55')],{'raw':!![]})[_0xb84a('0x19')](function(_0x1a2e1a){_0x5612f3=_0x1a2e1a;return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x1eec1f){var _0x57b784=fs[_0xb84a('0x5d')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0xf936f1=fs[_0xb84a('0x5d')](path[_0xb84a('0x5f')](config['root'],_0xb84a('0x60')),_0xb84a('0x5e'));var _0x33d416=ejs[_0xb84a('0x61')](_0x57b784,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x63'),_0x33d416);if(_0x5612f3[_0xb84a('0x64')]){var _0x542d70=ejs[_0xb84a('0x61')](_0xf936f1,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0x542d70);}})[_0xb84a('0x19')](function(){return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x57'),{'module':'chan_sip.so'});})[_0xb84a('0x19')](function(){var _0x6f8f=_0x2a2dc0[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x6f8f)throw new Error(_0xb84a('0x59'));if(_0x6f8f['role']===_0xb84a('0x58')){var _0x4b0b18=_0x5612f3[_0xb84a('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0xb84a('0x33'),'userProfileId':_0x6f8f[_0xb84a('0x67')]},'raw':!![]})['then'](function(_0x121fda){if(_0x121fda&&_0x121fda[_0xb84a('0x68')]===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x4b0b18[_0xb84a('0x37')],'resourceId':_0x4b0b18['id'],'type':_0x121fda['name'],'sectionId':_0x121fda['id']},{})[_0xb84a('0x19')](function(){return _0x5612f3;});}else{return _0x5612f3;}})[_0xb84a('0x24')](function(_0x287d25){logger['error'](_0xb84a('0x5b'),_0x287d25);throw _0x287d25;});}return _0x5612f3;})['then'](respondWithResult(_0x2ee241,0xc9))['catch'](handleError(_0x2ee241,null));};exports[_0xb84a('0x31')]=function(_0x35cb8b,_0x13c7b7,_0x3b2a2d){var _0x2047f5;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x35cb8b[_0xb84a('0x50')]['id']}})[_0xb84a('0x19')](handleEntityNotFound(_0x13c7b7,null))[_0xb84a('0x19')](saveUpdates(_0x35cb8b[_0xb84a('0x55')],null))[_0xb84a('0x19')](function(_0x3ec1fb){if(_0x3ec1fb){_0x2047f5=_0x3ec1fb;return db[_0xb84a('0x4c')][_0xb84a('0x5c')]({'raw':!![]});}})[_0xb84a('0x19')](function(_0xb18756){if(_0xb18756){var _0x1169d1=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0x576df5=fs[_0xb84a('0x5d')](path['join'](config[_0xb84a('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0xf3f253=ejs[_0xb84a('0x61')](_0x1169d1,{'trunks':_0xb18756||[]});fs['writeFileSync'](_0xb84a('0x63'),_0xf3f253);var _0xcf9bc2=ejs[_0xb84a('0x61')](_0x576df5,{'trunks':_0xb18756||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0xcf9bc2);return respondWithRpcPromise('Reload',_0xb84a('0x31'),{'module':_0xb84a('0x6a')});}return null;})[_0xb84a('0x19')](function(_0x30f7cd){if(_0x30f7cd){return _0x2047f5;}})['then'](respondWithResult(_0x13c7b7,null))[_0xb84a('0x24')](handleError(_0x13c7b7,null));};exports['destroy']=function(_0x14118c,_0x12d796,_0x54ae3e){var _0xf6765a;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x14118c['params']['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0xb84a('0x19')](removeEntity(_0x12d796,null))[_0xb84a('0x19')](function(){return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x166d75){var _0x54161c=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],_0xb84a('0x6b')),_0xb84a('0x5e'));var _0x403a3e=fs['readFileSync'](path['join'](config[_0xb84a('0x69')],_0xb84a('0x60')),'utf8');var _0x305b67=ejs[_0xb84a('0x61')](_0x54161c,{'trunks':_0x166d75});var _0x385a05=ejs[_0xb84a('0x61')](_0x403a3e,{'trunks':_0x166d75});fs['writeFileSync'](_0xb84a('0x63'),_0x305b67);fs['writeFileSync'](_0xb84a('0x65'),_0x385a05);return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x35'),{'module':_0xb84a('0x6a')});})[_0xb84a('0x24')](handleError(_0x12d796,null));}; \ No newline at end of file +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(_0x393d32,_0xc26718){var _0x12fd55=function(_0x3ef5d5){while(--_0x3ef5d5){_0x393d32['push'](_0x393d32['shift']());}};_0x12fd55(++_0xc26718);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x15dd6c,_0x503661){_0x15dd6c=_0x15dd6c-0x0;var _0x1b49ce=_0xd6d6[_0x15dd6c];return _0x1b49ce;};'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 diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 70b34d7..57eb5ef 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 _0x625c=['api','moment','request-promise','path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util'];(function(_0x1945c6,_0x2dd9b8){var _0x447100=function(_0x1d938b){while(--_0x1d938b){_0x1945c6['push'](_0x1945c6['shift']());}};_0x447100(++_0x2dd9b8);}(_0x625c,0xe2));var _0xc625=function(_0x2f942d,_0x34415e){_0x2f942d=_0x2f942d-0x0;var _0x157d88=_0x625c[_0x2f942d];return _0x157d88;};'use strict';var _=require(_0xc625('0x0'));var util=require(_0xc625('0x1'));var logger=require('../../config/logger')(_0xc625('0x2'));var moment=require(_0xc625('0x3'));var BPromise=require('bluebird');var rp=require(_0xc625('0x4'));var fs=require('fs');var path=require(_0xc625('0x5'));var rimraf=require('rimraf');var config=require(_0xc625('0x6'));var attributes=require(_0xc625('0x7'));module[_0xc625('0x8')]=function(_0x10bf8f,_0x3543fa){return _0x10bf8f[_0xc625('0x9')](_0xc625('0xa'),attributes,{'tableName':_0xc625('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8640=['util','api','bluebird','request-promise','path','rimraf','./trunk.attributes','exports','tools_trunks'];(function(_0x3f4070,_0x3ff2a6){var _0x1063be=function(_0x13aa61){while(--_0x13aa61){_0x3f4070['push'](_0x3f4070['shift']());}};_0x1063be(++_0x3ff2a6);}(_0x8640,0x17a));var _0x0864=function(_0x3154bf,_0x5577bb){_0x3154bf=_0x3154bf-0x0;var _0x41e6e5=_0x8640[_0x3154bf];return _0x41e6e5;};'use strict';var _=require('lodash');var util=require(_0x0864('0x0'));var logger=require('../../config/logger')(_0x0864('0x1'));var moment=require('moment');var BPromise=require(_0x0864('0x2'));var rp=require(_0x0864('0x3'));var fs=require('fs');var path=require(_0x0864('0x4'));var rimraf=require(_0x0864('0x5'));var config=require('../../config/environment');var attributes=require(_0x0864('0x6'));module[_0x0864('0x7')]=function(_0x473b3f,_0x16927a){return _0x473b3f['define']('Trunk',attributes,{'tableName':_0x0864('0x8'),'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 bd94c70..68dbacf 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 _0xf966=['include','map','model','GetTrunk','debug','find','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Trunk','findAll','options','raw','where','attributes','limit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf966,0x16f));var _0x6f96=function(_0x259edb,_0x356f8d){_0x259edb=_0x259edb-0x0;var _0x567c90=_0xf966[_0x259edb];return _0x567c90;};'use strict';var _=require(_0x6f96('0x0'));var util=require(_0x6f96('0x1'));var moment=require(_0x6f96('0x2'));var BPromise=require(_0x6f96('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f96('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6f96('0x5'))(_0x6f96('0x6'));var config=require(_0x6f96('0x7'));var jayson=require(_0x6f96('0x8'));var client=jayson[_0x6f96('0x9')][_0x6f96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c0e10,_0x1ad70e,_0x239c3f){return new BPromise(function(_0x1145c7,_0x540cdd){return client[_0x6f96('0xb')](_0x5c0e10,_0x239c3f)[_0x6f96('0xc')](function(_0x6ded80){logger[_0x6f96('0xd')](_0x6f96('0xe'),_0x1ad70e,_0x6f96('0xf'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x1ad70e,'request\x20sent',JSON[_0x6f96('0x10')](_0x6ded80));if(_0x6ded80[_0x6f96('0x11')]){if(_0x6ded80[_0x6f96('0x11')][_0x6f96('0x12')]===0x1f4){logger[_0x6f96('0x11')](_0x6f96('0xe'),_0x1ad70e,_0x6ded80[_0x6f96('0x11')][_0x6f96('0x13')]);return _0x540cdd(_0x6ded80[_0x6f96('0x11')][_0x6f96('0x13')]);}logger[_0x6f96('0x11')](_0x6f96('0xe'),_0x1ad70e,_0x6ded80[_0x6f96('0x11')]['message']);return _0x1145c7(_0x6ded80[_0x6f96('0x11')][_0x6f96('0x13')]);}else{logger[_0x6f96('0xd')](_0x6f96('0xe'),_0x1ad70e,'request\x20sent');_0x1145c7(_0x6ded80[_0x6f96('0x14')][_0x6f96('0x13')]);}})[_0x6f96('0x15')](function(_0x57c802){logger[_0x6f96('0x11')](_0x6f96('0xe'),_0x1ad70e,_0x57c802);_0x540cdd(_0x57c802);});});}exports['GetTrunk']=function(_0x19306b){var _0x5c8fe8=this;return new Promise(function(_0x27a3a2,_0x3cfa3d){return db[_0x6f96('0x16')][_0x6f96('0x17')]({'raw':_0x19306b[_0x6f96('0x18')]?_0x19306b[_0x6f96('0x18')][_0x6f96('0x19')]===undefined?!![]:![]:!![],'where':_0x19306b['options']?_0x19306b['options'][_0x6f96('0x1a')]||null:null,'attributes':_0x19306b[_0x6f96('0x18')]?_0x19306b[_0x6f96('0x18')][_0x6f96('0x1b')]||null:null,'limit':_0x19306b['options']?_0x19306b['options'][_0x6f96('0x1c')]||null:null,'include':_0x19306b['options']?_0x19306b[_0x6f96('0x18')][_0x6f96('0x1d')]?_[_0x6f96('0x1e')](_0x19306b['options'][_0x6f96('0x1d')],function(_0x393b5d){return{'model':db[_0x393b5d[_0x6f96('0x1f')]],'as':_0x393b5d['as'],'attributes':_0x393b5d['attributes'],'include':_0x393b5d['include']?_[_0x6f96('0x1e')](_0x393b5d[_0x6f96('0x1d')],function(_0xe358bc){return{'model':db[_0xe358bc['model']],'as':_0xe358bc['as'],'attributes':_0xe358bc[_0x6f96('0x1b')],'include':_0xe358bc['include']?_['map'](_0xe358bc[_0x6f96('0x1d')],function(_0xca1a86){return{'model':db[_0xca1a86[_0x6f96('0x1f')]],'as':_0xca1a86['as'],'attributes':_0xca1a86['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f96('0xc')](function(_0x2eb956){logger['info'](_0x6f96('0x20'),_0x19306b);logger[_0x6f96('0x21')](_0x6f96('0x20'),_0x19306b,JSON[_0x6f96('0x10')](_0x2eb956));_0x27a3a2(_0x2eb956);})[_0x6f96('0x15')](function(_0x1258a1){logger['error'](_0x6f96('0x20'),_0x1258a1[_0x6f96('0x13')],_0x19306b);_0x3cfa3d(_0x5c8fe8[_0x6f96('0x11')](0x1f4,_0x1258a1[_0x6f96('0x13')]));});});};exports['ShowTrunk']=function(_0x484252){var _0x2c39c0=this;return new Promise(function(_0x3311be,_0x17ff06){return db[_0x6f96('0x16')][_0x6f96('0x22')]({'raw':_0x484252[_0x6f96('0x18')]?_0x484252[_0x6f96('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x484252[_0x6f96('0x18')]?_0x484252[_0x6f96('0x18')][_0x6f96('0x1a')]||null:null,'attributes':_0x484252[_0x6f96('0x18')]?_0x484252[_0x6f96('0x18')][_0x6f96('0x1b')]||null:null,'include':_0x484252[_0x6f96('0x18')]?_0x484252[_0x6f96('0x18')][_0x6f96('0x1d')]?_[_0x6f96('0x1e')](_0x484252[_0x6f96('0x18')][_0x6f96('0x1d')],function(_0x18c932){return{'model':db[_0x18c932[_0x6f96('0x1f')]],'as':_0x18c932['as'],'attributes':_0x18c932[_0x6f96('0x1b')],'include':_0x18c932[_0x6f96('0x1d')]?_[_0x6f96('0x1e')](_0x18c932[_0x6f96('0x1d')],function(_0x5959ff){return{'model':db[_0x5959ff[_0x6f96('0x1f')]],'as':_0x5959ff['as'],'attributes':_0x5959ff[_0x6f96('0x1b')],'include':_0x5959ff[_0x6f96('0x1d')]?_[_0x6f96('0x1e')](_0x5959ff[_0x6f96('0x1d')],function(_0x4139d0){return{'model':db[_0x4139d0[_0x6f96('0x1f')]],'as':_0x4139d0['as'],'attributes':_0x4139d0[_0x6f96('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6f96('0xc')](function(_0x4d44d9){logger[_0x6f96('0xd')](_0x6f96('0x23'),_0x484252);logger[_0x6f96('0x21')](_0x6f96('0x23'),_0x484252,JSON['stringify'](_0x4d44d9));_0x3311be(_0x4d44d9);})[_0x6f96('0x15')](function(_0x485172){logger[_0x6f96('0x11')](_0x6f96('0x23'),_0x485172[_0x6f96('0x13')],_0x484252);_0x17ff06(_0x2c39c0[_0x6f96('0x11')](0x1f4,_0x485172[_0x6f96('0x13')]));});});}; \ No newline at end of file +var _0xf995=['result','GetTrunk','Trunk','options','where','attributes','limit','include','map','model','ShowTrunk','find','raw','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','info'];(function(_0x1ae287,_0x19ad7c){var _0x5ba363=function(_0x222319){while(--_0x222319){_0x1ae287['push'](_0x1ae287['shift']());}};_0x5ba363(++_0x19ad7c);}(_0xf995,0xd4));var _0x5f99=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf995[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5f99('0x0'));var moment=require('moment');var BPromise=require(_0x5f99('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f99('0x2'));var db=require(_0x5f99('0x3'))['db'];var utils=require(_0x5f99('0x4'));var logger=require(_0x5f99('0x5'))('rpc');var config=require(_0x5f99('0x6'));var jayson=require(_0x5f99('0x7'));var client=jayson['client'][_0x5f99('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49d033,_0x55c879,_0x32bfb9){return new BPromise(function(_0x5c1893,_0x1f849d){return client[_0x5f99('0x9')](_0x49d033,_0x32bfb9)[_0x5f99('0xa')](function(_0x482dcd){logger['info']('Trunk,\x20%s,\x20%s',_0x55c879,_0x5f99('0xb'));logger[_0x5f99('0xc')](_0x5f99('0xd'),_0x55c879,_0x5f99('0xb'),JSON[_0x5f99('0xe')](_0x482dcd));if(_0x482dcd[_0x5f99('0xf')]){if(_0x482dcd[_0x5f99('0xf')]['code']===0x1f4){logger['error'](_0x5f99('0x10'),_0x55c879,_0x482dcd[_0x5f99('0xf')][_0x5f99('0x11')]);return _0x1f849d(_0x482dcd[_0x5f99('0xf')][_0x5f99('0x11')]);}logger[_0x5f99('0xf')](_0x5f99('0x10'),_0x55c879,_0x482dcd[_0x5f99('0xf')][_0x5f99('0x11')]);return _0x5c1893(_0x482dcd['error'][_0x5f99('0x11')]);}else{logger[_0x5f99('0x12')](_0x5f99('0x10'),_0x55c879,_0x5f99('0xb'));_0x5c1893(_0x482dcd[_0x5f99('0x13')][_0x5f99('0x11')]);}})['catch'](function(_0x55bd8c){logger['error']('Trunk,\x20%s,\x20%s',_0x55c879,_0x55bd8c);_0x1f849d(_0x55bd8c);});});}exports[_0x5f99('0x14')]=function(_0x2f46cf){var _0x348329=this;return new Promise(function(_0x4c92dd,_0x31d988){return db[_0x5f99('0x15')]['findAll']({'raw':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf[_0x5f99('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf[_0x5f99('0x16')][_0x5f99('0x17')]||null:null,'attributes':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf[_0x5f99('0x16')][_0x5f99('0x18')]||null:null,'limit':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf[_0x5f99('0x16')][_0x5f99('0x19')]||null:null,'include':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf['options'][_0x5f99('0x1a')]?_[_0x5f99('0x1b')](_0x2f46cf['options'][_0x5f99('0x1a')],function(_0x289a42){return{'model':db[_0x289a42[_0x5f99('0x1c')]],'as':_0x289a42['as'],'attributes':_0x289a42[_0x5f99('0x18')],'include':_0x289a42[_0x5f99('0x1a')]?_[_0x5f99('0x1b')](_0x289a42[_0x5f99('0x1a')],function(_0x18feaa){return{'model':db[_0x18feaa[_0x5f99('0x1c')]],'as':_0x18feaa['as'],'attributes':_0x18feaa['attributes'],'include':_0x18feaa[_0x5f99('0x1a')]?_['map'](_0x18feaa[_0x5f99('0x1a')],function(_0x56129b){return{'model':db[_0x56129b[_0x5f99('0x1c')]],'as':_0x56129b['as'],'attributes':_0x56129b[_0x5f99('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5f99('0xa')](function(_0x20c557){logger[_0x5f99('0x12')](_0x5f99('0x14'),_0x2f46cf);logger[_0x5f99('0xc')](_0x5f99('0x14'),_0x2f46cf,JSON[_0x5f99('0xe')](_0x20c557));_0x4c92dd(_0x20c557);})['catch'](function(_0x4f8d04){logger['error']('GetTrunk',_0x4f8d04[_0x5f99('0x11')],_0x2f46cf);_0x31d988(_0x348329[_0x5f99('0xf')](0x1f4,_0x4f8d04[_0x5f99('0x11')]));});});};exports[_0x5f99('0x1d')]=function(_0x466c60){var _0x42b5a0=this;return new Promise(function(_0x36fcd5,_0x30a928){return db[_0x5f99('0x15')][_0x5f99('0x1e')]({'raw':_0x466c60[_0x5f99('0x16')]?_0x466c60[_0x5f99('0x16')][_0x5f99('0x1f')]===undefined?!![]:![]:!![],'where':_0x466c60[_0x5f99('0x16')]?_0x466c60[_0x5f99('0x16')][_0x5f99('0x17')]||null:null,'attributes':_0x466c60[_0x5f99('0x16')]?_0x466c60[_0x5f99('0x16')]['attributes']||null:null,'include':_0x466c60[_0x5f99('0x16')]?_0x466c60[_0x5f99('0x16')]['include']?_[_0x5f99('0x1b')](_0x466c60[_0x5f99('0x16')]['include'],function(_0x2b3f4f){return{'model':db[_0x2b3f4f[_0x5f99('0x1c')]],'as':_0x2b3f4f['as'],'attributes':_0x2b3f4f[_0x5f99('0x18')],'include':_0x2b3f4f['include']?_['map'](_0x2b3f4f['include'],function(_0x26bfda){return{'model':db[_0x26bfda[_0x5f99('0x1c')]],'as':_0x26bfda['as'],'attributes':_0x26bfda['attributes'],'include':_0x26bfda[_0x5f99('0x1a')]?_['map'](_0x26bfda['include'],function(_0x185dea){return{'model':db[_0x185dea[_0x5f99('0x1c')]],'as':_0x185dea['as'],'attributes':_0x185dea[_0x5f99('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5f99('0xa')](function(_0x5d44f6){logger[_0x5f99('0x12')](_0x5f99('0x1d'),_0x466c60);logger[_0x5f99('0xc')]('ShowTrunk',_0x466c60,JSON[_0x5f99('0xe')](_0x5d44f6));_0x36fcd5(_0x5d44f6);})[_0x5f99('0x20')](function(_0x7e9c8c){logger[_0x5f99('0xf')](_0x5f99('0x1d'),_0x7e9c8c[_0x5f99('0x11')],_0x466c60);_0x30a928(_0x42b5a0['error'](0x1f4,_0x7e9c8c['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index c25b33b..fbe609b 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 _0x2c8c=['getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addMailAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','get','/describe','describe','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts'];(function(_0x1e5c7b,_0x5046a4){var _0x3a32d1=function(_0x57fbc0){while(--_0x57fbc0){_0x1e5c7b['push'](_0x1e5c7b['shift']());}};_0x3a32d1(++_0x5046a4);}(_0x2c8c,0x12f));var _0xc2c8=function(_0x196c92,_0x5bdce2){_0x196c92=_0x196c92-0x0;var _0x2c00c7=_0x2c8c[_0x196c92];return _0x2c00c7;};'use strict';var multer=require(_0xc2c8('0x0'));var util=require(_0xc2c8('0x1'));var path=require(_0xc2c8('0x2'));var timeout=require(_0xc2c8('0x3'));var express=require(_0xc2c8('0x4'));var router=express[_0xc2c8('0x5')]();var fs_extra=require(_0xc2c8('0x6'));var auth=require(_0xc2c8('0x7'));var interaction=require(_0xc2c8('0x8'));var config=require('../../config/environment');var controller=require(_0xc2c8('0x9'));router['get']('/',auth[_0xc2c8('0xa')](),controller['index']);router[_0xc2c8('0xb')](_0xc2c8('0xc'),auth['isAuthenticated'](),controller[_0xc2c8('0xd')]);router[_0xc2c8('0xb')]('/whoami',auth['isAuthenticated'](),controller['whoami']);router[_0xc2c8('0xb')]('/presence',auth['isAuthenticated'](),controller['getPresence']);router['get'](_0xc2c8('0xe'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0xf')]);router[_0xc2c8('0xb')]('/:id/avatar',controller[_0xc2c8('0x10')]);router['get'](_0xc2c8('0x11'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x12')]);router['get'](_0xc2c8('0x13'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x14')]);router[_0xc2c8('0xb')]('/:id/queues',auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x15')]);router[_0xc2c8('0xb')](_0xc2c8('0x16'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x17')]);router[_0xc2c8('0xb')](_0xc2c8('0x18'),auth['isAuthenticated'](),controller[_0xc2c8('0x19')]);router[_0xc2c8('0xb')]('/:id/recordings',auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x1a')]);router[_0xc2c8('0xb')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xc2c8('0x1b')]);router[_0xc2c8('0xb')](_0xc2c8('0x1c'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0xc2c8('0xb')](_0xc2c8('0x1d'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x1e')]);router[_0xc2c8('0xb')](_0xc2c8('0x1f'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x20')]);router['get'](_0xc2c8('0x21'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x22')]);router[_0xc2c8('0xb')](_0xc2c8('0x23'),auth['isAuthenticated'](),controller[_0xc2c8('0x24')]);router[_0xc2c8('0xb')](_0xc2c8('0x25'),auth['isAuthenticated'](),controller[_0xc2c8('0x26')]);router[_0xc2c8('0xb')](_0xc2c8('0x27'),auth['isAuthenticated'](),controller['getTeams']);router[_0xc2c8('0xb')](_0xc2c8('0x28'),auth['isAuthenticated'](),controller[_0xc2c8('0x29')]);router[_0xc2c8('0xb')](_0xc2c8('0x2a'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x2b')]);router[_0xc2c8('0xb')]('/:id/prefixes',auth[_0xc2c8('0xa')](),controller['getVoicePrefixes']);router['get'](_0xc2c8('0x2c'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x2d')]);router[_0xc2c8('0xb')](_0xc2c8('0x2e'),auth[_0xc2c8('0xa')](),controller['getMailAccounts']);router[_0xc2c8('0xb')](_0xc2c8('0x2f'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x30')]);router['get']('/:id/sms_accounts',auth[_0xc2c8('0xa')](),controller['getSmsAccounts']);router['get'](_0xc2c8('0x31'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x32')]);router['get'](_0xc2c8('0x33'),auth['isAuthenticated'](),controller[_0xc2c8('0x34')]);router[_0xc2c8('0xb')](_0xc2c8('0x35'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x36')]);router[_0xc2c8('0xb')](_0xc2c8('0x37'),auth[_0xc2c8('0xa')](),controller['getScheduledCalls']);router[_0xc2c8('0xb')](_0xc2c8('0x38'),auth['isAuthenticated'](),controller[_0xc2c8('0x39')]);router[_0xc2c8('0x3a')](_0xc2c8('0x13'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x3b')]);router['post']('/',auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x3c')]);router[_0xc2c8('0x3a')](_0xc2c8('0x3d'),auth['isAuthenticated'](),controller[_0xc2c8('0x3e')]);router[_0xc2c8('0x3a')](_0xc2c8('0x3f'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x40')]);var upload=multer({'storage':multer[_0xc2c8('0x41')]({'destination':function(_0x10eb9c,_0x1eaabc,_0x564a7d){_0x564a7d(null,path['join'](config[_0xc2c8('0x42')],_0xc2c8('0x43')));},'filename':function(_0x276aa6,_0x5d2e13,_0x382a73){_0x382a73(null,util[_0xc2c8('0x44')](_0xc2c8('0x45'),Date[_0xc2c8('0x46')](),_0x5d2e13[_0xc2c8('0x47')]));}})});router[_0xc2c8('0x3a')](_0xc2c8('0x48'),upload[_0xc2c8('0x49')]('file'),controller['addAvatar']);router['post'](_0xc2c8('0x4a'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x4b')]);router[_0xc2c8('0x3a')](_0xc2c8('0x4c'),auth['isAuthenticated'](),controller['logout']);router['post'](_0xc2c8('0x4d'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x4e')]);router[_0xc2c8('0x3a')](_0xc2c8('0x4f'),auth[_0xc2c8('0xa')](),controller['unpause']);router[_0xc2c8('0x3a')](_0xc2c8('0x27'),auth[_0xc2c8('0xa')](),controller['addTeams']);router[_0xc2c8('0x3a')](_0xc2c8('0x50'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x51')]);router[_0xc2c8('0x3a')](_0xc2c8('0x52'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x53')]);router['post'](_0xc2c8('0x54'),auth['isAuthenticated'](),controller[_0xc2c8('0x55')]);router[_0xc2c8('0x3a')](_0xc2c8('0x56'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x57')]);router[_0xc2c8('0x3a')](_0xc2c8('0x58'),auth[_0xc2c8('0xa')](),controller['addOpenchannelInteractions']);router[_0xc2c8('0x3a')](_0xc2c8('0x59'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0xc2c8('0x3a')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0xc2c8('0x3a')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xc2c8('0x5a')]);router['post'](_0xc2c8('0x2f'),auth[_0xc2c8('0xa')](),controller['addOpenchannelAccounts']);router[_0xc2c8('0x3a')](_0xc2c8('0x5b'),auth['isAuthenticated'](),controller[_0xc2c8('0x5c')]);router[_0xc2c8('0x3a')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xc2c8('0x5d')]);router[_0xc2c8('0x3a')](_0xc2c8('0x33'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x5e')]);router[_0xc2c8('0x3a')](_0xc2c8('0x35'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x5f')]);router['post']('/:id/api_key',auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x60')]);router[_0xc2c8('0x61')](_0xc2c8('0xe'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x62')]);router[_0xc2c8('0x61')](_0xc2c8('0x63'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x64')]);router[_0xc2c8('0x65')](_0xc2c8('0x3f'),auth[_0xc2c8('0xa')](),controller['removeQueues']);router[_0xc2c8('0x65')]('/:id/teams',auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x66')]);router[_0xc2c8('0x65')](_0xc2c8('0xe'),auth['isAuthenticated'](),controller[_0xc2c8('0x67')]);router[_0xc2c8('0x65')](_0xc2c8('0x50'),auth['isAuthenticated'](),controller[_0xc2c8('0x68')]);router[_0xc2c8('0x65')](_0xc2c8('0x52'),auth['isAuthenticated'](),controller[_0xc2c8('0x69')]);router[_0xc2c8('0x65')](_0xc2c8('0x54'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xc2c8('0x65')](_0xc2c8('0x56'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x6a')]);router[_0xc2c8('0x65')](_0xc2c8('0x58'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x6b')]);router[_0xc2c8('0x65')](_0xc2c8('0x59'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x6c')]);router[_0xc2c8('0x65')](_0xc2c8('0x2c'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x6d')]);router[_0xc2c8('0x65')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xc2c8('0x6e')]);router[_0xc2c8('0x65')]('/:id/openchannel_accounts',auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x6f')]);router[_0xc2c8('0x65')]('/:id/sms_accounts',auth[_0xc2c8('0xa')](),controller['removeSmsAccounts']);router[_0xc2c8('0x65')](_0xc2c8('0x31'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x70')]);router['delete'](_0xc2c8('0x33'),auth['isAuthenticated'](),controller[_0xc2c8('0x71')]);router[_0xc2c8('0x65')](_0xc2c8('0x35'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x72')]);router['delete'](_0xc2c8('0x38'),auth[_0xc2c8('0xa')](),controller[_0xc2c8('0x73')]);module[_0xc2c8('0x74')]=router; \ No newline at end of file +var _0x2944=['addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/whatsapp_accounts','addSquareProjects','createApiKey','update','/:id/password','changePassword','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions'];(function(_0x330708,_0x13e6fe){var _0x503314=function(_0x674b1){while(--_0x674b1){_0x330708['push'](_0x330708['shift']());}};_0x503314(++_0x13e6fe);}(_0x2944,0x91));var _0x4294=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x2944[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require('multer');var util=require(_0x4294('0x0'));var path=require('path');var timeout=require(_0x4294('0x1'));var express=require(_0x4294('0x2'));var router=express[_0x4294('0x3')]();var fs_extra=require(_0x4294('0x4'));var auth=require(_0x4294('0x5'));var interaction=require(_0x4294('0x6'));var config=require(_0x4294('0x7'));var controller=require('./user.controller');router[_0x4294('0x8')]('/',auth['isAuthenticated'](),controller[_0x4294('0x9')]);router[_0x4294('0x8')]('/describe',auth[_0x4294('0xa')](),controller[_0x4294('0xb')]);router[_0x4294('0x8')]('/whoami',auth[_0x4294('0xa')](),controller[_0x4294('0xc')]);router['get'](_0x4294('0xd'),auth[_0x4294('0xa')](),controller[_0x4294('0xe')]);router[_0x4294('0x8')](_0x4294('0xf'),auth[_0x4294('0xa')](),controller[_0x4294('0x10')]);router[_0x4294('0x8')](_0x4294('0x11'),controller[_0x4294('0x12')]);router['get'](_0x4294('0x13'),auth[_0x4294('0xa')](),controller['getOpenTabs']);router[_0x4294('0x8')](_0x4294('0x14'),auth['isAuthenticated'](),controller['getContacts']);router[_0x4294('0x8')](_0x4294('0x15'),auth[_0x4294('0xa')](),controller[_0x4294('0x16')]);router[_0x4294('0x8')](_0x4294('0x17'),auth[_0x4294('0xa')](),controller[_0x4294('0x18')]);router[_0x4294('0x8')](_0x4294('0x19'),auth['isAuthenticated'](),controller[_0x4294('0x1a')]);router[_0x4294('0x8')](_0x4294('0x1b'),auth[_0x4294('0xa')](),controller[_0x4294('0x1c')]);router[_0x4294('0x8')](_0x4294('0x1d'),auth[_0x4294('0xa')](),controller[_0x4294('0x1e')]);router[_0x4294('0x8')]('/:id/chat/interactions',auth[_0x4294('0xa')](),controller['getChatInteractions']);router[_0x4294('0x8')](_0x4294('0x1f'),auth['isAuthenticated'](),controller[_0x4294('0x20')]);router[_0x4294('0x8')]('/:id/mail/interactions',auth[_0x4294('0xa')](),controller[_0x4294('0x21')]);router['get'](_0x4294('0x22'),auth[_0x4294('0xa')](),controller['getSmsInteractions']);router['get'](_0x4294('0x23'),auth[_0x4294('0xa')](),controller[_0x4294('0x24')]);router[_0x4294('0x8')](_0x4294('0x25'),auth[_0x4294('0xa')](),controller[_0x4294('0x26')]);router[_0x4294('0x8')](_0x4294('0x27'),auth[_0x4294('0xa')](),controller[_0x4294('0x28')]);router[_0x4294('0x8')]('/:id/lists',auth[_0x4294('0xa')](),controller['getLists']);router[_0x4294('0x8')](_0x4294('0x29'),auth[_0x4294('0xa')](),controller['getAgents']);router[_0x4294('0x8')](_0x4294('0x2a'),auth['isAuthenticated'](),controller[_0x4294('0x2b')]);router[_0x4294('0x8')](_0x4294('0x2c'),auth[_0x4294('0xa')](),controller[_0x4294('0x2d')]);router['get'](_0x4294('0x2e'),auth[_0x4294('0xa')](),controller[_0x4294('0x2f')]);router[_0x4294('0x8')](_0x4294('0x30'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0x4294('0x8')](_0x4294('0x31'),auth[_0x4294('0xa')](),controller[_0x4294('0x32')]);router[_0x4294('0x8')](_0x4294('0x33'),auth['isAuthenticated'](),controller[_0x4294('0x34')]);router[_0x4294('0x8')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x4294('0x35')]);router[_0x4294('0x8')](_0x4294('0x36'),auth[_0x4294('0xa')](),controller[_0x4294('0x37')]);router[_0x4294('0x8')](_0x4294('0x38'),auth[_0x4294('0xa')](),controller[_0x4294('0x39')]);router['get'](_0x4294('0x3a'),auth[_0x4294('0xa')](),controller[_0x4294('0x3b')]);router[_0x4294('0x3c')](_0x4294('0x14'),auth[_0x4294('0xa')](),controller['addContacts']);router['post']('/',auth[_0x4294('0xa')](),controller[_0x4294('0x3d')]);router[_0x4294('0x3c')](_0x4294('0x3e'),auth[_0x4294('0xa')](),controller[_0x4294('0x3f')]);router[_0x4294('0x3c')](_0x4294('0x15'),auth[_0x4294('0xa')](),controller[_0x4294('0x40')]);var upload=multer({'storage':multer[_0x4294('0x41')]({'destination':function(_0x40b141,_0x397556,_0x5082f8){_0x5082f8(null,path[_0x4294('0x42')](config[_0x4294('0x43')],_0x4294('0x44')));},'filename':function(_0x54be1b,_0x8092f6,_0x304e66){_0x304e66(null,util[_0x4294('0x45')](_0x4294('0x46'),Date[_0x4294('0x47')](),_0x8092f6[_0x4294('0x48')]));}})});router['post'](_0x4294('0x11'),upload[_0x4294('0x49')](_0x4294('0x4a')),controller[_0x4294('0x4b')]);router[_0x4294('0x3c')](_0x4294('0x4c'),auth[_0x4294('0xa')](),controller[_0x4294('0x4d')]);router[_0x4294('0x3c')](_0x4294('0x4e'),auth[_0x4294('0xa')](),controller[_0x4294('0x4f')]);router['post']('/:id/pause',auth[_0x4294('0xa')](),controller[_0x4294('0x50')]);router['post'](_0x4294('0x51'),auth[_0x4294('0xa')](),controller[_0x4294('0x52')]);router[_0x4294('0x3c')](_0x4294('0x27'),auth[_0x4294('0xa')](),controller[_0x4294('0x53')]);router[_0x4294('0x3c')](_0x4294('0x54'),auth[_0x4294('0xa')](),controller[_0x4294('0x55')]);router['post'](_0x4294('0x56'),auth[_0x4294('0xa')](),controller[_0x4294('0x57')]);router['post'](_0x4294('0x58'),auth[_0x4294('0xa')](),controller[_0x4294('0x59')]);router[_0x4294('0x3c')](_0x4294('0x5a'),auth['isAuthenticated'](),controller[_0x4294('0x5b')]);router[_0x4294('0x3c')](_0x4294('0x5c'),auth[_0x4294('0xa')](),controller[_0x4294('0x5d')]);router[_0x4294('0x3c')]('/:id/whatsapp_interactions',auth[_0x4294('0xa')](),controller[_0x4294('0x5e')]);router[_0x4294('0x3c')](_0x4294('0x2c'),auth[_0x4294('0xa')](),controller[_0x4294('0x5f')]);router[_0x4294('0x3c')](_0x4294('0x2e'),auth['isAuthenticated'](),controller[_0x4294('0x60')]);router[_0x4294('0x3c')](_0x4294('0x30'),auth[_0x4294('0xa')](),controller[_0x4294('0x61')]);router[_0x4294('0x3c')](_0x4294('0x31'),auth[_0x4294('0xa')](),controller[_0x4294('0x62')]);router[_0x4294('0x3c')](_0x4294('0x33'),auth[_0x4294('0xa')](),controller['addChatWebsites']);router[_0x4294('0x3c')](_0x4294('0x63'),auth[_0x4294('0xa')](),controller['addWhatsappAccounts']);router[_0x4294('0x3c')](_0x4294('0x36'),auth['isAuthenticated'](),controller[_0x4294('0x64')]);router[_0x4294('0x3c')]('/:id/api_key',auth[_0x4294('0xa')](),controller[_0x4294('0x65')]);router['put'](_0x4294('0xf'),auth[_0x4294('0xa')](),controller[_0x4294('0x66')]);router['put'](_0x4294('0x67'),auth[_0x4294('0xa')](),controller[_0x4294('0x68')]);router['delete'](_0x4294('0x15'),auth[_0x4294('0xa')](),controller['removeQueues']);router['delete'](_0x4294('0x27'),auth[_0x4294('0xa')](),controller['removeTeams']);router[_0x4294('0x69')](_0x4294('0xf'),auth['isAuthenticated'](),controller[_0x4294('0x6a')]);router[_0x4294('0x69')](_0x4294('0x54'),auth[_0x4294('0xa')](),controller[_0x4294('0x6b')]);router['delete'](_0x4294('0x56'),auth[_0x4294('0xa')](),controller[_0x4294('0x6c')]);router['delete'](_0x4294('0x58'),auth[_0x4294('0xa')](),controller[_0x4294('0x6d')]);router['delete'](_0x4294('0x5a'),auth['isAuthenticated'](),controller[_0x4294('0x6e')]);router[_0x4294('0x69')](_0x4294('0x5c'),auth[_0x4294('0xa')](),controller['removeOpenchannelInteractions']);router[_0x4294('0x69')](_0x4294('0x6f'),auth[_0x4294('0xa')](),controller['removeWhatsappInteractions']);router[_0x4294('0x69')]('/:id/fax_accounts',auth[_0x4294('0xa')](),controller[_0x4294('0x70')]);router[_0x4294('0x69')]('/:id/mail_accounts',auth[_0x4294('0xa')](),controller[_0x4294('0x71')]);router[_0x4294('0x69')](_0x4294('0x30'),auth[_0x4294('0xa')](),controller[_0x4294('0x72')]);router['delete'](_0x4294('0x31'),auth[_0x4294('0xa')](),controller[_0x4294('0x73')]);router[_0x4294('0x69')](_0x4294('0x33'),auth['isAuthenticated'](),controller[_0x4294('0x74')]);router['delete'](_0x4294('0x63'),auth[_0x4294('0xa')](),controller[_0x4294('0x75')]);router[_0x4294('0x69')](_0x4294('0x36'),auth[_0x4294('0xa')](),controller[_0x4294('0x76')]);router[_0x4294('0x69')]('/:id/api_key',auth[_0x4294('0xa')](),controller['removeApiKey']);module[_0x4294('0x77')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 6489098..341b203 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 _0x770d=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','accept','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','isArray','wss','encryption','avpf','icesupport','dtlsverify','rtcp_mux','force_avp','dtlsenable','dtlscertfile','dtlsprivatekey','TEXT','map','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','DATE','BOOLEAN','dynamic','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x770d,0x122));var _0xd770=function(_0x3a3b29,_0x54ec1e){_0x3a3b29=_0x3a3b29-0x0;var _0x34d909=_0x770d[_0x3a3b29];return _0x34d909;};'use strict';var Sequelize=require(_0xd770('0x0'));var moment=require(_0xd770('0x1'));var util=require(_0xd770('0x2'));var _=require(_0xd770('0x3'));module[_0xd770('0x4')]={'name':{'type':Sequelize[_0xd770('0x5')],'allowNull':![],'unique':_0xd770('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5d67cd){this[_0xd770('0x7')](_0xd770('0x6'),_0x5d67cd);this[_0xd770('0x7')](_0xd770('0x8'),_0x5d67cd);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2d73bd){this[_0xd770('0x7')](_0xd770('0x9'),_0x2d73bd);this[_0xd770('0x7')](_0xd770('0xa'),util[_0xd770('0xb')](_0xd770('0xc'),_0x2d73bd,this['getDataValue'](_0xd770('0xd'))));}},'alias':{'type':Sequelize[_0xd770('0x5')]},'email':{'type':Sequelize[_0xd770('0x5')],'allowNull':![],'unique':_0xd770('0xe'),'validate':{'isEmail':!![]},'set':function(_0x32a6cf){if(_0x32a6cf){this['setDataValue'](_0xd770('0xe'),_0x32a6cf[_0xd770('0xf')]());}}},'role':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x11'),_0xd770('0x12'),_0xd770('0x13'),_0xd770('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0xd770('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':![],'unique':_0xd770('0xd'),'set':function(_0x206000){this[_0xd770('0x7')]('internal',_0x206000);this[_0xd770('0x7')](_0xd770('0x16'),_0x206000);this[_0xd770('0x7')](_0xd770('0xa'),util['format'](_0xd770('0xc'),this['getDataValue'](_0xd770('0x9')),_0x206000));}},'salt':{'type':Sequelize[_0xd770('0x5')]},'phone':{'type':Sequelize[_0xd770('0x5')]},'mobile':{'type':Sequelize[_0xd770('0x5')]},'address':{'type':Sequelize[_0xd770('0x5')]},'zipcode':{'type':Sequelize[_0xd770('0x5')]},'userpic':{'type':Sequelize[_0xd770('0x5')]},'city':{'type':Sequelize[_0xd770('0x5')]},'country':{'type':Sequelize[_0xd770('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xd770('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xd770('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xd770('0x17')]},'chatCapacity':{'type':Sequelize[_0xd770('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xd770('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd770('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xd770('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd770('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xd770('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xd770('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xd770('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![],'defaultValue':_0xd770('0x19')},'ipaddr':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0xd770('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xd770('0x10')]('friend','user',_0xd770('0x1a')),'allowNull':!![],'defaultValue':_0xd770('0x1b')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd770('0x1c')},'callingpres':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x1d'),_0xd770('0x1e'),'ALLOWED_FAILED_SCREEN',_0xd770('0x1f'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xd770('0x20'),_0xd770('0x21')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![],'defaultValue':_0xd770('0x22'),'set':function(_0x476e50){this[_0xd770('0x7')]('transport',_0x476e50?_0x476e50[_0xd770('0x23')](','):null);},'get':function(){return this['getDataValue'](_0xd770('0x24'))?this[_0xd770('0x25')](_0xd770('0x24'))[_0xd770('0x26')](','):null;},'comment':_0xd770('0x27')},'dtmfmode':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x28'),_0xd770('0x29'),'shortinfo',_0xd770('0x2a'),'auto'),'allowNull':!![],'defaultValue':_0xd770('0x28')},'directmedia':{'type':Sequelize['ENUM'](_0xd770('0x2b'),'no',_0xd770('0x2c'),_0xd770('0x2d'),_0xd770('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![],'defaultValue':_0xd770('0x2f'),'set':function(_0x195888){this[_0xd770('0x7')]('nat',_0x195888?_0x195888[_0xd770('0x23')](','):null);},'get':function(){return this[_0xd770('0x25')]('nat')?this[_0xd770('0x25')](_0xd770('0x30'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xd770('0x5')]},'namedcallgroup':{'type':Sequelize[_0xd770('0x5')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xd770('0x5')]},'language':{'type':Sequelize[_0xd770('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd770('0x5')]},'disallow':{'type':Sequelize[_0xd770('0x5')],'allowNull':![],'defaultValue':_0xd770('0x31')},'allow':{'type':Sequelize[_0xd770('0x5')],'allowNull':![],'defaultValue':_0xd770('0x32'),'set':function(_0x52bddd){this['setDataValue'](_0xd770('0x33'),_0x52bddd?_0x52bddd[_0xd770('0x23')](';'):_0xd770('0x32'));},'get':function(){return this[_0xd770('0x25')](_0xd770('0x33'))?this[_0xd770('0x25')]('allow')['split'](';'):null;},'comment':_0xd770('0x34')},'autoframing':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![],'set':function(_0x4df549){this[_0xd770('0x7')]('insecure',_0x4df549?_0x4df549[_0xd770('0x23')](','):null);},'get':function(){return this['getDataValue'](_0xd770('0x35'))?this['getDataValue'](_0xd770('0x35'))[_0xd770('0x26')](','):null;},'comment':_0xd770('0x36')},'trustrpid':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xd770('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xd770('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![],'defaultValue':_0xd770('0x2b')},'busylevel':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xd770('0x10')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd770('0x10')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x37'),_0xd770('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x39'),_0xd770('0x3a')),'allowNull':!![],'defaultValue':_0xd770('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd770('0x10')]('yes','no'),'allowNull':!![],'defaultValue':_0xd770('0x2b')},'keepalive':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xd770('0x2b'),'no',_0xd770('0x3b'),_0xd770('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xd770('0x3d'),_0xd770('0x3e'),_0xd770('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xd770('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xd770('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xd770('0x2b'),'no','nonat','update',_0xd770('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xd770('0x17')]},'passwordResetAt':{'type':Sequelize[_0xd770('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xd770('0x15')],'defaultValue':0x0,'set':function(_0x25e559){this[_0xd770('0x7')]('showWebBar',_0x25e559);var _0x2084b6=this['get']({'plain':!![]});switch(_0x25e559){case 0x0:case 0x1:var _0x13df77=_0x2084b6[_0xd770('0x24')]?_[_0xd770('0x41')](_0x2084b6['transport'])?_0x2084b6[_0xd770('0x24')]['join']():_0x2084b6[_0xd770('0x24')]:_0xd770('0x22');if(_0x13df77===_0xd770('0x42')){_0x13df77=_0xd770('0x22');}this[_0xd770('0x7')](_0xd770('0x24'),_0x13df77);this[_0xd770('0x7')](_0xd770('0x43'),'no');this['setDataValue'](_0xd770('0x44'),null);this[_0xd770('0x7')]('force_avp',null);this[_0xd770('0x7')](_0xd770('0x45'),null);this[_0xd770('0x7')]('dtlsenable',null);this['setDataValue'](_0xd770('0x46'),null);this['setDataValue']('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0xd770('0x7')]('dtlsprivatekey',null);this[_0xd770('0x7')](_0xd770('0x47'),'no');break;case 0x2:this['setDataValue'](_0xd770('0x24'),_0xd770('0x42'));this[_0xd770('0x7')](_0xd770('0x43'),_0xd770('0x2b'));this['setDataValue'](_0xd770('0x44'),'yes');this[_0xd770('0x7')](_0xd770('0x48'),_0xd770('0x2b'));this[_0xd770('0x7')](_0xd770('0x45'),_0xd770('0x2b'));this[_0xd770('0x7')](_0xd770('0x49'),_0xd770('0x2b'));this['setDataValue'](_0xd770('0x46'),'no');this[_0xd770('0x7')]('dtlssetup',_0xd770('0x3f'));this[_0xd770('0x7')]('dtlscertfile',_0x2084b6[_0xd770('0x4a')]||'/etc/pki/tls/certs/motion.crt');this[_0xd770('0x7')](_0xd770('0x4b'),_0x2084b6[_0xd770('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0xd770('0x7')](_0xd770('0x47'),_0xd770('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0xd770('0x4c')],'set':function(_0x3ece22){this['setDataValue']('permissions',_0x3ece22?_0x3ece22[_0xd770('0x23')](','):[]);},'get':function(){return this[_0xd770('0x25')]('permissions')?_[_0xd770('0x4d')](this[_0xd770('0x25')](_0xd770('0x4e'))[_0xd770('0x26')](','),function(_0x55f5db){return parseInt(_0x55f5db,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xd770('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xd770('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xd770('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd770('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xd770('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xd770('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xd770('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xd770('0x10')](_0xd770('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xd770('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xd770('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xd770('0x4f')],'get':function(){return this[_0xd770('0x25')](_0xd770('0x50'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'interface':{'type':Sequelize[_0xd770('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xd770('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![],'set':function(_0x4c3d21){if(typeof _0x4c3d21==='string'){var _0xedc912=_0x4c3d21==='1'?!![]:_0x4c3d21==='0'?![]:_0x4c3d21===_0xd770('0x51')?!![]:_0x4c3d21==='false'?![]:![];this['setDataValue'](_0xd770('0x52'),_0xedc912);}else{this['setDataValue'](_0xd770('0x52'),_0x4c3d21);}}},'blocked':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![],'set':function(_0x9255ea){this[_0xd770('0x7')](_0xd770('0x53'),_0x9255ea);if(_0x9255ea===!![]){this[_0xd770('0x7')](_0xd770('0x54'),moment());this['setDataValue'](_0xd770('0x55'),0x0);}else{this[_0xd770('0x7')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xd770('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xd770('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xd770('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd770('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xa6b0=['setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','getDataValue','BOOLEAN','DATE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','map','permissions','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','exports','STRING','name'];(function(_0xd19218,_0x334bb9){var _0x5df03c=function(_0xad15be){while(--_0xad15be){_0xd19218['push'](_0xd19218['shift']());}};_0x5df03c(++_0x334bb9);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x4423b3,_0x552266){_0x4423b3=_0x4423b3-0x0;var _0xd3fc58=_0xa6b0[_0x4423b3];return _0xd3fc58;};'use strict';var Sequelize=require(_0x0a6b('0x0'));var moment=require(_0x0a6b('0x1'));var util=require('util');var _=require('lodash');module[_0x0a6b('0x2')]={'name':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'unique':_0x0a6b('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4c9a84){this[_0x0a6b('0x5')](_0x0a6b('0x4'),_0x4c9a84);this[_0x0a6b('0x5')](_0x0a6b('0x6'),_0x4c9a84);},'comment':_0x0a6b('0x7')},'fullname':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'set':function(_0x1b5fb5){this[_0x0a6b('0x5')](_0x0a6b('0x8'),_0x1b5fb5);this[_0x0a6b('0x5')](_0x0a6b('0x9'),util[_0x0a6b('0xa')]('\x22%s\x22\x20<%s>',_0x1b5fb5,this['getDataValue'](_0x0a6b('0xb'))));}},'alias':{'type':Sequelize[_0x0a6b('0x3')]},'email':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'unique':_0x0a6b('0xc'),'validate':{'isEmail':!![]},'set':function(_0x81a412){if(_0x81a412){this[_0x0a6b('0x5')](_0x0a6b('0xc'),_0x81a412[_0x0a6b('0xd')]());}}},'role':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0xf'),_0x0a6b('0x10'),_0x0a6b('0x11'),_0x0a6b('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':![],'unique':_0x0a6b('0xb'),'set':function(_0x2abc4e){this[_0x0a6b('0x5')](_0x0a6b('0xb'),_0x2abc4e);this[_0x0a6b('0x5')](_0x0a6b('0x14'),_0x2abc4e);this[_0x0a6b('0x5')](_0x0a6b('0x9'),util[_0x0a6b('0xa')]('\x22%s\x22\x20<%s>',this[_0x0a6b('0x15')](_0x0a6b('0x8')),_0x2abc4e));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a6b('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a6b('0x3')]},'zipcode':{'type':Sequelize[_0x0a6b('0x3')]},'userpic':{'type':Sequelize[_0x0a6b('0x3')]},'city':{'type':Sequelize[_0x0a6b('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a6b('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a6b('0x17')]},'chatCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a6b('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x0a6b('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x0a6b('0x19'),_0x0a6b('0x10'),_0x0a6b('0x1a')),'allowNull':!![],'defaultValue':_0x0a6b('0x19')},'context':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0x0a6b('0x1c'),_0x0a6b('0x1d'),'ALLOWED_FAILED_SCREEN',_0x0a6b('0x1e'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x0a6b('0x1f'),_0x0a6b('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x21'),'set':function(_0x235cc3){this[_0x0a6b('0x5')]('transport',_0x235cc3?_0x235cc3[_0x0a6b('0x22')](','):null);},'get':function(){return this[_0x0a6b('0x15')]('transport')?this['getDataValue'](_0x0a6b('0x23'))[_0x0a6b('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x25'),_0x0a6b('0x26'),_0x0a6b('0x27'),_0x0a6b('0x28'),_0x0a6b('0x29')),'allowNull':!![],'defaultValue':_0x0a6b('0x25')},'directmedia':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no',_0x0a6b('0x2b'),_0x0a6b('0x2c'),_0x0a6b('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x2e'),'set':function(_0x206612){this[_0x0a6b('0x5')](_0x0a6b('0x2f'),_0x206612?_0x206612[_0x0a6b('0x22')](','):null);},'get':function(){return this[_0x0a6b('0x15')](_0x0a6b('0x2f'))?this[_0x0a6b('0x15')]('nat')[_0x0a6b('0x24')](','):null;},'comment':_0x0a6b('0x30')},'callgroup':{'type':Sequelize[_0x0a6b('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a6b('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a6b('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a6b('0x3')]},'language':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a6b('0x3')]},'disallow':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'defaultValue':_0x0a6b('0x31'),'set':function(_0x3aa7d5){this[_0x0a6b('0x5')](_0x0a6b('0x32'),_0x3aa7d5?_0x3aa7d5[_0x0a6b('0x22')](';'):_0x0a6b('0x31'));},'get':function(){return this[_0x0a6b('0x15')](_0x0a6b('0x32'))?this['getDataValue'](_0x0a6b('0x32'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x2f1221){this[_0x0a6b('0x5')](_0x0a6b('0x33'),_0x2f1221?_0x2f1221['join'](','):null);},'get':function(){return this[_0x0a6b('0x15')]('insecure')?this['getDataValue'](_0x0a6b('0x33'))['split'](','):null;},'comment':_0x0a6b('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no',_0x0a6b('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x36')},'amaflags':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x0a6b('0x2a')},'busylevel':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no',_0x0a6b('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x38'),_0x0a6b('0x39'),_0x0a6b('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x3b'),'uas'),'allowNull':!![],'defaultValue':_0x0a6b('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x0a6b('0x2a')},'keepalive':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no','fingerprint',_0x0a6b('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x0a6b('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x0a6b('0x2b'),_0x0a6b('0x2c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x0a6b('0x17')]},'passwordResetAt':{'type':Sequelize[_0x0a6b('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a6b('0x3f')]},'showWebBar':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0,'set':function(_0x450a32){this['setDataValue'](_0x0a6b('0x40'),_0x450a32);var _0x34bebd=this[_0x0a6b('0x41')]({'plain':!![]});switch(_0x450a32){case 0x0:case 0x1:var _0x38974c=_0x34bebd['transport']?_[_0x0a6b('0x42')](_0x34bebd[_0x0a6b('0x23')])?_0x34bebd[_0x0a6b('0x23')][_0x0a6b('0x22')]():_0x34bebd[_0x0a6b('0x23')]:'udp';if(_0x38974c===_0x0a6b('0x43')){_0x38974c=_0x0a6b('0x21');}this[_0x0a6b('0x5')](_0x0a6b('0x23'),_0x38974c);this[_0x0a6b('0x5')](_0x0a6b('0x44'),'no');this[_0x0a6b('0x5')](_0x0a6b('0x45'),null);this['setDataValue'](_0x0a6b('0x46'),null);this[_0x0a6b('0x5')](_0x0a6b('0x47'),null);this[_0x0a6b('0x5')]('dtlsenable',null);this[_0x0a6b('0x5')](_0x0a6b('0x48'),null);this[_0x0a6b('0x5')](_0x0a6b('0x49'),null);this[_0x0a6b('0x5')](_0x0a6b('0x4a'),null);this[_0x0a6b('0x5')](_0x0a6b('0x4b'),null);this[_0x0a6b('0x5')](_0x0a6b('0x4c'),'no');break;case 0x2:this[_0x0a6b('0x5')](_0x0a6b('0x23'),_0x0a6b('0x43'));this[_0x0a6b('0x5')](_0x0a6b('0x44'),'yes');this['setDataValue'](_0x0a6b('0x45'),_0x0a6b('0x2a'));this['setDataValue'](_0x0a6b('0x46'),_0x0a6b('0x2a'));this[_0x0a6b('0x5')](_0x0a6b('0x47'),_0x0a6b('0x2a'));this[_0x0a6b('0x5')](_0x0a6b('0x4d'),_0x0a6b('0x2a'));this[_0x0a6b('0x5')](_0x0a6b('0x48'),'no');this[_0x0a6b('0x5')]('dtlssetup',_0x0a6b('0x4e'));this['setDataValue'](_0x0a6b('0x4a'),_0x34bebd[_0x0a6b('0x4a')]||_0x0a6b('0x4f'));this[_0x0a6b('0x5')](_0x0a6b('0x4b'),_0x34bebd[_0x0a6b('0x4b')]||_0x0a6b('0x50'));this['setDataValue'](_0x0a6b('0x4c'),_0x0a6b('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x0a6b('0x3f')],'set':function(_0x356d70){this[_0x0a6b('0x5')]('permissions',_0x356d70?_0x356d70[_0x0a6b('0x22')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x0a6b('0x51')](this[_0x0a6b('0x15')](_0x0a6b('0x52'))[_0x0a6b('0x24')](','),function(_0xec326b){return parseInt(_0xec326b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a6b('0x15')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a6b('0x15')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![],'set':function(_0x239be5){if(typeof _0x239be5===_0x0a6b('0x53')){var _0x571800=_0x239be5==='1'?!![]:_0x239be5==='0'?![]:_0x239be5===_0x0a6b('0x54')?!![]:_0x239be5==='false'?![]:![];this[_0x0a6b('0x5')](_0x0a6b('0x55'),_0x571800);}else{this[_0x0a6b('0x5')](_0x0a6b('0x55'),_0x239be5);}}},'blocked':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![],'set':function(_0x1374c3){this[_0x0a6b('0x5')](_0x0a6b('0x56'),_0x1374c3);if(_0x1374c3===!![]){this['setDataValue'](_0x0a6b('0x57'),moment());this['setDataValue'](_0x0a6b('0x58'),0x0);}else{this[_0x0a6b('0x5')](_0x0a6b('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x0a6b('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x0a6b('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a38c923..17f7bec 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 _0xdc73=['voiceStatus','busy','slice','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/parsers/qs','api','../../config/utils','socket.io-emitter','./user.socket','register','redis','localhost','http','request','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','Users','user','Agents','Telephones','telephone','filter','ignore','map','value','includes','role','find','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','password','getOptions','where','User','attributes','push','findAll','rows','query','openTabs','true','length','chat','sms','dataValues','mail','whatsapp','all','catch','show','params','model','differenceBy','keys','salt','intersection','fields','includeAll','include','merge','options','openchannel','fax','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','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','VoiceMail','fullname','agent','permissions','101','102','103','110','104','105','107','108','100','111','114','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','admin','userProfileId','create','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','UserProfileSection','isEmpty','changePassword','oldPassword','ValidationError','authenticate','Sequelize','Wrong\x20credentials','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','addQueues','loginInPause','voicePause','interface','isValidChannel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','online','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','channel','remove','isArray','Queue:remove','userpic','file','filename','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','filters','order','sort','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Unknown\x20channel','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','mobile','format','intrf','user:%s','user:forcelogout','x-forwarded-for','remoteAddress','connection','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','device','PAUSE','bulkCreate','concat','LOGININPAUSE','isMiddleware','resolve','logout','pause','unpause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','manual','%s%s','Pause','Team','getTeams','setDataValue','Voice','Chat','getMailQueues','Mail','Whatsapp','getFaxQueues','Fax','Openchannel','flatten','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getChatQueues','getSmsQueues','Sms','getWhatsappQueues','getOpenchannelQueues','transaction','getLists','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','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','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$eq','$between','$notBetween','$in','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','CmContact','Contact','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','getAgents','lower','col','toString','asc','desc','substring','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unavailable','ringing'];(function(_0x28607c,_0x7bed4f){var _0x4dfb32=function(_0x630506){while(--_0x630506){_0x28607c['push'](_0x28607c['shift']());}};_0x4dfb32(++_0x7bed4f);}(_0xdc73,0x19c));var _0x3dc7=function(_0x5bd390,_0x12b587){_0x5bd390=_0x5bd390-0x0;var _0x423fec=_0xdc73[_0x5bd390];return _0x423fec;};'use strict';var moment=require('moment');var BPromise=require(_0x3dc7('0x0'));var util=require(_0x3dc7('0x1'));var path=require(_0x3dc7('0x2'));var fs=require('fs');var _=require(_0x3dc7('0x3'));var squel=require(_0x3dc7('0x4'));var jayson=require(_0x3dc7('0x5'));var Redis=require(_0x3dc7('0x6'));var authService=require('../../components/auth/service');var qs=require(_0x3dc7('0x7'));var logger=require('../../config/logger')(_0x3dc7('0x8'));var utils=require(_0x3dc7('0x9'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var socket=require(_0x3dc7('0xa'))(new Redis(config['redis']));require(_0x3dc7('0xb'))[_0x3dc7('0xc')](socket);config[_0x3dc7('0xd')]=_['defaults'](config[_0x3dc7('0xd')],{'host':_0x3dc7('0xe'),'port':0x18eb});var client=jayson['client'][_0x3dc7('0xf')]({'port':0x232a});var values;function respondWithRpcPromise(_0x89f61a,_0x381987,_0x5b332a,_0x50457e){return new BPromise(function(_0x61a1af,_0x13e45d){var _0x4df126=_0x50457e||client;return _0x4df126[_0x3dc7('0x10')](_0x89f61a,_0x5b332a)['then'](function(_0x31b283){logger['info'](_0x3dc7('0x11'),_0x381987,'request\x20sent');logger['debug'](_0x3dc7('0x12'),_0x381987,_0x3dc7('0x13'),JSON[_0x3dc7('0x14')](_0x31b283));if(_0x31b283[_0x3dc7('0x15')]){if(_0x31b283[_0x3dc7('0x15')]['code']===0x1f4){logger[_0x3dc7('0x15')]('User,\x20%s,\x20%s',_0x381987,_0x31b283['error']['message']);return _0x13e45d(_0x31b283[_0x3dc7('0x15')][_0x3dc7('0x16')]);}logger[_0x3dc7('0x15')](_0x3dc7('0x11'),_0x381987,_0x31b283[_0x3dc7('0x15')]['message']);return _0x61a1af(_0x31b283['error']['message']);}else{logger[_0x3dc7('0x17')]('User,\x20%s,\x20%s',_0x381987,_0x3dc7('0x13'));_0x61a1af(_0x31b283['result'][_0x3dc7('0x16')]);}})['catch'](function(_0x599e3e){logger[_0x3dc7('0x15')](_0x3dc7('0x11'),_0x381987,_0x599e3e);_0x13e45d(_0x599e3e);});});}function respondWithStatusCode(_0x510e4d,_0x64166b){_0x64166b=_0x64166b||0xcc;return function(_0x46cad8){if(_0x46cad8){return _0x510e4d[_0x3dc7('0x18')](_0x64166b);}return _0x510e4d[_0x3dc7('0x19')](_0x64166b)[_0x3dc7('0x1a')]();};}function respondWithResult(_0x202062,_0x234ddf){_0x234ddf=_0x234ddf||0xc8;return function(_0x1d846b){if(_0x1d846b){return _0x202062[_0x3dc7('0x19')](_0x234ddf)[_0x3dc7('0x1b')](_0x1d846b);}};}function respondWithFilteredResult(_0x556dd0,_0x4ba74b){return function(_0x15b74c){if(_0x15b74c){var _0x23ccf5=typeof _0x4ba74b[_0x3dc7('0x1c')]===_0x3dc7('0x1d')&&typeof _0x4ba74b[_0x3dc7('0x1e')]==='undefined';var _0x32aef6=_0x15b74c[_0x3dc7('0x1f')];var _0x1eb267=_0x23ccf5?0x0:_0x4ba74b['offset'];var _0x3b7019=_0x23ccf5?_0x15b74c[_0x3dc7('0x1f')]:_0x4ba74b[_0x3dc7('0x1c')]+_0x4ba74b[_0x3dc7('0x1e')];var _0x4c633f;if(_0x3b7019>=_0x32aef6){_0x3b7019=_0x32aef6;_0x4c633f=0xc8;}else{_0x4c633f=0xce;}_0x556dd0[_0x3dc7('0x19')](_0x4c633f);return _0x556dd0[_0x3dc7('0x20')](_0x3dc7('0x21'),_0x1eb267+'-'+_0x3b7019+'/'+_0x32aef6)[_0x3dc7('0x1b')](_0x15b74c);}return null;};}function saveUpdates(_0x4991b4){return function(_0x5a4c56){if(_0x5a4c56){return _0x5a4c56[_0x3dc7('0x22')](_0x4991b4)[_0x3dc7('0x23')](function(_0x4caf9c){return _0x4caf9c;});}return null;};}function removeEntity(_0x11e785){return function(_0x2f033a){if(_0x2f033a){return _0x2f033a[_0x3dc7('0x24')]()[_0x3dc7('0x23')](function(){var _0xfb76f9=_0x2f033a[_0x3dc7('0x25')]({'plain':!![]});if(_0xfb76f9['role']==='admin')return;var _0x5832c2=[{'name':_0x3dc7('0x26'),'value':_0x3dc7('0x27'),'ignore':!![]},{'name':_0x3dc7('0x28'),'value':'agent','ignore':![]},{'name':_0x3dc7('0x29'),'value':_0x3dc7('0x2a'),'ignore':![]}];var _0x1dced8=_(_0x5832c2)[_0x3dc7('0x2b')](_0x3dc7('0x2c'))[_0x3dc7('0x2d')](_0x3dc7('0x2e'))[_0x3dc7('0x2e')]();if(_[_0x3dc7('0x2f')](_0x1dced8,_0xfb76f9[_0x3dc7('0x30')])){return;}var _0x25b187=_[_0x3dc7('0x31')](_0x5832c2,[_0x3dc7('0x2e'),_0xfb76f9[_0x3dc7('0x30')]])['name'];return db[_0x3dc7('0x32')][_0x3dc7('0x24')]({'where':{'type':_0x25b187,'resourceId':_0xfb76f9['id']}})['then'](function(){return _0x2f033a;});})[_0x3dc7('0x23')](function(){_0x11e785[_0x3dc7('0x19')](0xcc)[_0x3dc7('0x1a')]();});}};}function handleEntityNotFound(_0x32badd){return function(_0x2f32e5){if(!_0x2f32e5){_0x32badd[_0x3dc7('0x18')](0x194);}return _0x2f32e5;};}function handleError(_0x1ee81e,_0x18b7fe){_0x18b7fe=_0x18b7fe||0x1f4;return function(_0x41310d){logger[_0x3dc7('0x15')](_0x41310d[_0x3dc7('0x33')]);if(_0x41310d[_0x3dc7('0x34')]){delete _0x41310d[_0x3dc7('0x34')];}_0x1ee81e[_0x3dc7('0x19')](_0x18b7fe)[_0x3dc7('0x35')](_0x41310d);};}exports[_0x3dc7('0x36')]=function(_0x3f14ed,_0x48da75){var _0x12f4a0={},_0x556347={'count':0x0,'rows':[]};var _0x2c4dda=_(db['User'][_0x3dc7('0x37')])[_0x3dc7('0x2d')](function(_0x498a14){return{'name':_0x498a14[_0x3dc7('0x38')],'type':_0x498a14[_0x3dc7('0x39')][_0x3dc7('0x3a')]};})[_0x3dc7('0x2b')](function(_0xabab04){return!_[_0x3dc7('0x2f')]([_0x3dc7('0x3b'),'salt'],_0xabab04[_0x3dc7('0x34')]);})[_0x3dc7('0x2e')]();_0x12f4a0=qs[_0x3dc7('0x3c')](_0x2c4dda,_0x3f14ed);var _0x53b7be={'where':_0x12f4a0[_0x3dc7('0x3d')]};return db[_0x3dc7('0x3e')]['count'](_0x53b7be)[_0x3dc7('0x23')](function(_0x54d49c){_0x556347[_0x3dc7('0x1f')]=_0x54d49c;if(_0x3f14ed['query']['includeAll']){_0x12f4a0['include']=[{'all':!![]}];}if(!_[_0x3dc7('0x2f')](_0x12f4a0[_0x3dc7('0x3f')],'id')){_0x12f4a0[_0x3dc7('0x3f')][_0x3dc7('0x40')]('id');}return db[_0x3dc7('0x3e')][_0x3dc7('0x41')](_0x12f4a0);})[_0x3dc7('0x23')](function(_0x2b2750){_0x556347[_0x3dc7('0x42')]=_0x2b2750;if(_0x3f14ed[_0x3dc7('0x43')][_0x3dc7('0x44')]===_0x3dc7('0x45')){var _0x2ad472=[];for(var _0x55de3e=0x0;_0x55de3e<_0x556347[_0x3dc7('0x42')][_0x3dc7('0x46')];_0x55de3e++){_0x2ad472[_0x3dc7('0x40')](get_open_tabs(_0x3dc7('0x47'),_0x556347[_0x3dc7('0x42')][_0x55de3e]['dataValues']));_0x2ad472[_0x3dc7('0x40')](get_open_tabs(_0x3dc7('0x48'),_0x556347[_0x3dc7('0x42')][_0x55de3e]['dataValues']));_0x2ad472[_0x3dc7('0x40')](get_open_tabs('fax',_0x556347[_0x3dc7('0x42')][_0x55de3e][_0x3dc7('0x49')]));_0x2ad472['push'](get_open_tabs(_0x3dc7('0x4a'),_0x556347[_0x3dc7('0x42')][_0x55de3e][_0x3dc7('0x49')]));_0x2ad472[_0x3dc7('0x40')](get_open_tabs('openchannel',_0x556347['rows'][_0x55de3e][_0x3dc7('0x49')]));_0x2ad472[_0x3dc7('0x40')](get_open_tabs(_0x3dc7('0x4b'),_0x556347[_0x3dc7('0x42')][_0x55de3e]['dataValues']));}return BPromise[_0x3dc7('0x4c')](_0x2ad472)['then'](function(_0x117681){return _0x556347;});}else{return _0x556347;}})[_0x3dc7('0x23')](respondWithFilteredResult(_0x48da75,_0x12f4a0))[_0x3dc7('0x4d')](handleError(_0x48da75,null));};exports[_0x3dc7('0x4e')]=function(_0x1031b8,_0x632910){var _0x5867cd={'raw':![],'where':{'id':_0x1031b8[_0x3dc7('0x4f')]['id']}},_0x3284c4={};_0x3284c4[_0x3dc7('0x50')]=_[_0x3dc7('0x51')](_[_0x3dc7('0x52')](db[_0x3dc7('0x3e')][_0x3dc7('0x37')]),[_0x3dc7('0x3b'),_0x3dc7('0x53')]);_0x3284c4[_0x3dc7('0x43')]=_[_0x3dc7('0x52')](_0x1031b8['query']);_0x3284c4['filters']=_[_0x3dc7('0x54')](_0x3284c4[_0x3dc7('0x50')],_0x3284c4['query']);_0x5867cd[_0x3dc7('0x3f')]=_[_0x3dc7('0x54')](_0x3284c4['model'],qs[_0x3dc7('0x55')](_0x1031b8['query'][_0x3dc7('0x55')]));_0x5867cd[_0x3dc7('0x3f')]=_0x5867cd['attributes'][_0x3dc7('0x46')]?_0x5867cd[_0x3dc7('0x3f')]:_0x3284c4[_0x3dc7('0x50')];if(_0x1031b8[_0x3dc7('0x43')][_0x3dc7('0x56')]){_0x5867cd[_0x3dc7('0x57')]=[{'all':!![]}];}_0x5867cd=_[_0x3dc7('0x58')]({},_0x5867cd,_0x1031b8[_0x3dc7('0x59')]);if(!_[_0x3dc7('0x2f')](_0x5867cd[_0x3dc7('0x3f')],'id')){_0x5867cd[_0x3dc7('0x3f')][_0x3dc7('0x40')]('id');}return db[_0x3dc7('0x3e')][_0x3dc7('0x31')](_0x5867cd)[_0x3dc7('0x23')](handleEntityNotFound(_0x632910,null))[_0x3dc7('0x23')](function(_0x25808d){var _0x2853ad=[];values=_0x25808d;if(_0x1031b8[_0x3dc7('0x43')][_0x3dc7('0x44')]==='true'){_0x2853ad[_0x3dc7('0x40')](get_open_tabs(_0x3dc7('0x47'),_0x25808d[_0x3dc7('0x49')]));_0x2853ad[_0x3dc7('0x40')](get_open_tabs(_0x3dc7('0x48'),_0x25808d['dataValues']));_0x2853ad['push'](get_open_tabs(_0x3dc7('0x5a'),_0x25808d[_0x3dc7('0x49')]));_0x2853ad['push'](get_open_tabs(_0x3dc7('0x4b'),_0x25808d[_0x3dc7('0x49')]));_0x2853ad['push'](get_open_tabs(_0x3dc7('0x5b'),_0x25808d[_0x3dc7('0x49')]));_0x2853ad[_0x3dc7('0x40')](get_open_tabs('mail',_0x25808d['dataValues']));return BPromise[_0x3dc7('0x4c')](_0x2853ad);}else{return values;}})['then'](function(_0x595014){return values;})[_0x3dc7('0x23')](respondWithResult(_0x632910,null))['catch'](handleError(_0x632910,null));};exports[_0x3dc7('0x22')]=function(_0x265b5c,_0x17e7af){if(_0x265b5c[_0x3dc7('0x5c')]['id']){delete _0x265b5c[_0x3dc7('0x5c')]['id'];}delete _0x265b5c[_0x3dc7('0x5c')][_0x3dc7('0x30')];return db[_0x3dc7('0x3e')][_0x3dc7('0x31')]({'where':{'id':_0x265b5c[_0x3dc7('0x4f')]['id']}})[_0x3dc7('0x23')](handleEntityNotFound(_0x17e7af,null))[_0x3dc7('0x23')](saveUpdates(_0x265b5c[_0x3dc7('0x5c')],null))[_0x3dc7('0x23')](respondWithResult(_0x17e7af,null))['catch'](handleError(_0x17e7af,null));};exports[_0x3dc7('0x5d')]=function(_0x3ab3df,_0x584bc3){return db['User']['describe']()['then'](respondWithResult(_0x584bc3,null))[_0x3dc7('0x4d')](handleError(_0x584bc3,null));};exports[_0x3dc7('0x5e')]=function(_0x36177c,_0x35a4fd){return db[_0x3dc7('0x3e')][_0x3dc7('0x31')]({'where':{'id':_0x36177c[_0x3dc7('0x4f')]['id']}})[_0x3dc7('0x23')](handleEntityNotFound(_0x35a4fd,null))[_0x3dc7('0x23')](function(_0x27d59f){if(_0x27d59f){return _0x27d59f[_0x3dc7('0x5e')](_0x36177c[_0x3dc7('0x5c')][_0x3dc7('0x5f')],_[_0x3dc7('0x60')](_0x36177c[_0x3dc7('0x5c')],[_0x3dc7('0x5f'),'id'])||{});}})[_0x3dc7('0x23')](respondWithResult(_0x35a4fd,null))[_0x3dc7('0x4d')](handleError(_0x35a4fd,null));};function validateUser(_0x158ca1){return new BPromise(function(_0x52df17,_0x2dfb80){if(_0x158ca1[_0x3dc7('0x61')])return _0x52df17(_0x158ca1);return db[_0x3dc7('0x62')][_0x3dc7('0x63')](0x1)['then'](function(_0x4228b7){if(_0x4228b7[_0x3dc7('0x64')])authService[_0x3dc7('0x65')](_0x158ca1[_0x3dc7('0x3b')]);db[_0x3dc7('0x3e')]['max']('internal')[_0x3dc7('0x23')](function(_0x18cab6){if(_['isNil'](_0x18cab6)){_0x158ca1[_0x3dc7('0x61')]=_0x4228b7[_0x3dc7('0x66')]||0x1;return;}if(_[_0x3dc7('0x67')](_0x4228b7[_0x3dc7('0x66')])||_0x4228b7[_0x3dc7('0x66')]===_0x18cab6){_0x158ca1[_0x3dc7('0x61')]=_0x18cab6+0x1;return;}if(_0x4228b7[_0x3dc7('0x66')]>_0x18cab6){_0x158ca1[_0x3dc7('0x61')]=_0x4228b7[_0x3dc7('0x66')];return;}return db[_0x3dc7('0x68')]['query'](_0x3dc7('0x69'),{'type':db[_0x3dc7('0x68')][_0x3dc7('0x6a')][_0x3dc7('0x6b')]})[_0x3dc7('0x23')](function(_0xc3fb1f){if(_0xc3fb1f&&_0xc3fb1f[_0x3dc7('0x46')]){for(var _0x234d72=0x0,_0x57d9fb=_0xc3fb1f[_0x3dc7('0x46')];_0x234d72<_0x57d9fb&&_[_0x3dc7('0x67')](_0x158ca1['internal']);_0x234d72++){if(_0x4228b7[_0x3dc7('0x66')]<=_0xc3fb1f[_0x234d72][_0x3dc7('0x6c')]){_0x158ca1['internal']=_0xc3fb1f[_0x234d72][_0x3dc7('0x6c')];}else if(_0x4228b7[_0x3dc7('0x66')]>_0xc3fb1f[_0x234d72][_0x3dc7('0x6c')]&&_0x4228b7['min_internal']<=_0xc3fb1f[_0x234d72]['to']){_0x158ca1['internal']=_0x4228b7['min_internal'];}}}if(_['isNil'](_0x158ca1[_0x3dc7('0x61')])){_0x158ca1[_0x3dc7('0x61')]=_0x18cab6+0x1;}return _0x52df17(_0x158ca1);});});})[_0x3dc7('0x4d')](function(_0xc5cfc6){_0x2dfb80(_0xc5cfc6);});});}function updateUser(_0x246716){return new BPromise(function(_0xf36776,_0x5bec07){try{if(_0x246716['voicemail']){_0x246716[_0x3dc7('0x6d')]=_0x246716[_0x3dc7('0x61')];_0x246716[_0x3dc7('0x6e')]={'mailbox':_0x246716['internal'],'password':_0x246716[_0x3dc7('0x3b')],'fullname':_0x246716[_0x3dc7('0x6f')],'email':_0x246716['email']};}if(_0x246716[_0x3dc7('0x30')]===_0x3dc7('0x70')){if(!_0x246716[_0x3dc7('0x71')])_0x246716[_0x3dc7('0x71')]=[_0x3dc7('0x72'),_0x3dc7('0x73'),_0x3dc7('0x74'),'113',_0x3dc7('0x75'),_0x3dc7('0x76'),_0x3dc7('0x77'),'106',_0x3dc7('0x78'),_0x3dc7('0x79'),'109',_0x3dc7('0x7a'),_0x3dc7('0x7b'),_0x3dc7('0x7c'),_0x3dc7('0x7d')];}_0xf36776(_0x246716);}catch(_0x53cc9d){_0x5bec07(_0x53cc9d);}});}exports['create']=function(_0x115aad,_0x8f9e72){if(_0x115aad[_0x3dc7('0x27')][_0x3dc7('0x30')]==='agent')throw new Error(_0x3dc7('0x7e'));if(_0x115aad[_0x3dc7('0x5c')][_0x3dc7('0x30')]===_0x3dc7('0x27')&&_0x115aad['user'][_0x3dc7('0x30')]!=='admin'){throw new Error(_0x3dc7('0x7f'));}if(_0x115aad[_0x3dc7('0x5c')][_0x3dc7('0x30')]===_0x3dc7('0x80')&&_0x115aad[_0x3dc7('0x27')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x115aad[_0x3dc7('0x5c')]])[_0x3dc7('0x23')](function(){return validateUser(_0x115aad['body']);})['then'](function(_0xf41125){return updateUser(_0xf41125)[_0x3dc7('0x23')](function(_0x3220c7){if(_0x3220c7[_0x3dc7('0x30')]===_0x3dc7('0x80')){_0x3220c7['settingsEnabled']=_0x115aad[_0x3dc7('0x27')]['settingsEnabled'];delete _0x3220c7[_0x3dc7('0x81')];}return _0x3220c7;});})[_0x3dc7('0x23')](function(_0x371abd){return db[_0x3dc7('0x3e')][_0x3dc7('0x82')](_0x371abd,{'include':[{'model':db[_0x3dc7('0x6e')],'as':_0x3dc7('0x6e')}]});})[_0x3dc7('0x23')](function(_0x392121){if(_0x115aad['body']['role']===_0x3dc7('0x27'))return _0x392121;if(_0x115aad[_0x3dc7('0x27')][_0x3dc7('0x30')]!==_0x3dc7('0x27'))return _0x392121;return db['UserProfileSection']['find']({'where':{'name':_0x392121['role']===_0x3dc7('0x70')?'Agents':_0x3dc7('0x29'),'userProfileId':_0x115aad[_0x3dc7('0x27')]['userProfileId']},'raw':!![]})[_0x3dc7('0x23')](function(_0x4c3753){if(!_0x4c3753||_0x4c3753[_0x3dc7('0x83')]!=0x0)return _0x392121;return db[_0x3dc7('0x32')][_0x3dc7('0x82')]({'name':_0x392121[_0x3dc7('0x34')],'resourceId':_0x392121['id'],'type':_0x4c3753[_0x3dc7('0x34')],'sectionId':_0x4c3753['id']},{})[_0x3dc7('0x23')](function(){return _0x392121;});})[_0x3dc7('0x4d')](function(_0x575a80){logger[_0x3dc7('0x15')](_0x3dc7('0x84'),_0x575a80);throw _0x575a80;});})['then'](respondWithResult(_0x8f9e72,0xc9))[_0x3dc7('0x4d')](handleError(_0x8f9e72,null));};exports['bulkCreate']=function(_0x1eeba2,_0x5c215f){var _0x2630f2=_0x1eeba2[_0x3dc7('0x5c')];var _0xdb3a5a=[];if(_0x1eeba2[_0x3dc7('0x27')][_0x3dc7('0x30')]===_0x3dc7('0x70'))throw new Error(_0x3dc7('0x7e'));if(_[_0x3dc7('0x85')](_0x2630f2,[_0x3dc7('0x30'),_0x3dc7('0x27')])&&_0x1eeba2[_0x3dc7('0x27')][_0x3dc7('0x30')]!==_0x3dc7('0x80')){throw new Error(_0x3dc7('0x7f'));}if(_[_0x3dc7('0x85')](_0x2630f2,[_0x3dc7('0x30'),_0x3dc7('0x80')])&&_0x1eeba2[_0x3dc7('0x27')][_0x3dc7('0x30')]!==_0x3dc7('0x80')){throw new Error(_0x3dc7('0x86'));}return licenseUtil[_0x3dc7('0x87')](_0x2630f2)['then'](function(){return validateUser(_0x2630f2[0x0]);})[_0x3dc7('0x23')](function(){for(var _0x109136=0x1;_0x109136<_0x2630f2['length'];_0x109136++){var _0x4b2825=_0x2630f2[_0x109136-0x1][_0x3dc7('0x61')];if(!_0x2630f2[_0x109136][_0x3dc7('0x61')])_0x2630f2[_0x109136][_0x3dc7('0x61')]=_0x4b2825+0x1;_0xdb3a5a[_0x3dc7('0x40')](validateUser(_0x2630f2[_0x109136]));}return BPromise[_0x3dc7('0x4c')](_0xdb3a5a);})[_0x3dc7('0x23')](function(){_0xdb3a5a=[];for(var _0x39de7f=0x0;_0x39de7f<_0x2630f2[_0x3dc7('0x46')];_0x39de7f++){_0xdb3a5a[_0x3dc7('0x40')](updateUser(_0x2630f2[_0x39de7f]));}return BPromise[_0x3dc7('0x4c')](_0xdb3a5a);})['then'](function(){return BPromise[_0x3dc7('0x88')](_0x2630f2,function(_0x14e836){return db[_0x3dc7('0x3e')][_0x3dc7('0x82')](_0x14e836,{'include':[{'model':db[_0x3dc7('0x6e')],'as':_0x3dc7('0x6e')}]})[_0x3dc7('0x23')](function(_0x4e6125){_0x14e836['id']=_0x4e6125['id'];return _0x14e836;});});})[_0x3dc7('0x23')](function(_0x4d2874){if(_0x1eeba2[_0x3dc7('0x5c')]['role']===_0x3dc7('0x27'))return _0x4d2874;if(_0x1eeba2[_0x3dc7('0x27')][_0x3dc7('0x30')]!==_0x3dc7('0x27'))return _0x4d2874;var _0x1f88b6=_[_0x3dc7('0x85')](_0x4d2874,function(_0x5f57e8){return _0x5f57e8[_0x3dc7('0x30')]===_0x3dc7('0x70')||_0x5f57e8['role']==='telephone';});if(!_0x1f88b6)return _0x4d2874;return db[_0x3dc7('0x89')][_0x3dc7('0x41')]({'where':{'name':{'$or':['Agents',_0x3dc7('0x29')]},'userProfileId':_0x1eeba2[_0x3dc7('0x27')][_0x3dc7('0x81')]},'raw':!![]})['then'](function(_0x235244){if(_[_0x3dc7('0x8a')](_0x235244)||!_[_0x3dc7('0x85')](_0x235244,[_0x3dc7('0x83'),0x0]))return _0x4d2874;_0xdb3a5a=[];var _0x567e51=_(_0x235244)[_0x3dc7('0x2d')](function(_0x376876){if(_0x376876[_0x3dc7('0x83')]===0x1)return;return _0x376876[_0x3dc7('0x34')]===_0x3dc7('0x28')?_0x3dc7('0x70'):_0x3dc7('0x2a');})['compact']()[_0x3dc7('0x2e')]();for(var _0xc45579=0x0;_0xc45579<_0x4d2874[_0x3dc7('0x46')];_0xc45579++){if(!_[_0x3dc7('0x2f')](_0x567e51,_0x4d2874[_0xc45579][_0x3dc7('0x30')]))return;var _0x59c69c=_0x4d2874[_0xc45579][_0x3dc7('0x30')]==='agent'?_0x3dc7('0x28'):'Telephones';_0xdb3a5a[_0x3dc7('0x40')](db[_0x3dc7('0x32')][_0x3dc7('0x82')]({'name':_0x4d2874[_0xc45579][_0x3dc7('0x34')],'resourceId':_0x4d2874[_0xc45579]['id'],'type':_0x59c69c,'sectionId':_[_0x3dc7('0x31')](_0x235244,[_0x3dc7('0x34'),_0x59c69c])['id']},{}));}return BPromise[_0x3dc7('0x4c')](_0xdb3a5a);});})[_0x3dc7('0x23')](respondWithResult(_0x5c215f,0xc9))[_0x3dc7('0x4d')](handleError(_0x5c215f,null));};exports[_0x3dc7('0x8b')]=function(_0x372a50,_0x17fc4c){if(_0x372a50[_0x3dc7('0x5c')]['id']){delete _0x372a50[_0x3dc7('0x5c')]['id'];}return db[_0x3dc7('0x3e')]['find']({'where':{'id':_0x372a50[_0x3dc7('0x4f')]['id']}})['then'](function(_0x41e248){if(!_0x41e248)return null;if(_0x41e248['id']===_0x372a50[_0x3dc7('0x27')]['id']){if(!_0x372a50['body'][_0x3dc7('0x8c')]||!_0x372a50[_0x3dc7('0x5c')]['newPassword']){throw new db['Sequelize'][(_0x3dc7('0x8d'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x41e248[_0x3dc7('0x8e')](_0x372a50['body']['oldPassword'])){throw new db[(_0x3dc7('0x8f'))]['ValidationError'](_0x3dc7('0x90'));}if(_0x372a50[_0x3dc7('0x5c')][_0x3dc7('0x8c')]===_0x372a50[_0x3dc7('0x5c')][_0x3dc7('0x91')]){throw new db['Sequelize'][(_0x3dc7('0x8d'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x372a50[_0x3dc7('0x27')][_0x3dc7('0x30')]==='admin'){if(!_0x372a50['body']['newPassword']){throw new db[(_0x3dc7('0x8f'))][(_0x3dc7('0x8d'))](_0x3dc7('0x92'));}}else if(_0x372a50[_0x3dc7('0x27')][_0x3dc7('0x30')]===_0x3dc7('0x27')){if(!_0x372a50[_0x3dc7('0x5c')]['newPassword']){throw new db['Sequelize'][(_0x3dc7('0x8d'))](_0x3dc7('0x92'));}if(_0x41e248[_0x3dc7('0x30')]!==_0x3dc7('0x70')){throw new db[(_0x3dc7('0x8f'))][(_0x3dc7('0x8d'))](_0x3dc7('0x7e'));}}else{throw new db[(_0x3dc7('0x8f'))][(_0x3dc7('0x8d'))](_0x3dc7('0x7e'));}return _0x41e248;})['then'](handleEntityNotFound(_0x17fc4c,null))['then'](function(_0x4a4861){return db[_0x3dc7('0x62')][_0x3dc7('0x93')]({'attributes':['id','securePassword',_0x3dc7('0x94'),_0x3dc7('0x95')]})[_0x3dc7('0x23')](function(_0x5dd185){if(_0x5dd185[_0x3dc7('0x64')])authService[_0x3dc7('0x65')](_0x372a50['body']['newPassword']);if(!_0x5dd185[_0x3dc7('0x94')]||!_0x4a4861['previousPasswords'])return _0x4a4861;authService[_0x3dc7('0x96')](_0x372a50[_0x3dc7('0x5c')]['newPassword'],_0x4a4861[_0x3dc7('0x97')],_0x5dd185['passwordHistoryLimit']);return _0x4a4861;})[_0x3dc7('0x23')](saveUpdates({'password':_0x372a50[_0x3dc7('0x5c')][_0x3dc7('0x91')],'passwordResetAt':_0x372a50[_0x3dc7('0x27')]['id']==_0x372a50[_0x3dc7('0x4f')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x372a50[_0x3dc7('0x5c')]['newPassword'],_0x4a4861[_0x3dc7('0x97')])},null));})['then'](respondWithResult(_0x17fc4c,null))[_0x3dc7('0x4d')](handleError(_0x17fc4c,null));};exports[_0x3dc7('0x98')]=function(_0xf7302d,_0x3e0381){var _0x3bde39=_0xf7302d[_0x3dc7('0x5c')]['channel'];return db['User'][_0x3dc7('0x31')]({'where':{'id':_0xf7302d['params']['id']},'attributes':['id',_0x3dc7('0x34'),_0x3dc7('0x30'),'online',_0x3dc7('0x99'),_0x3dc7('0x9a'),_0x3dc7('0x9b')]})['then'](handleEntityNotFound(_0x3e0381,null))[_0x3dc7('0x23')](function(_0x34aced){if(_0x34aced){if(!utils[_0x3dc7('0x9c')](_0x3bde39)){throw new db[(_0x3dc7('0x8f'))][(_0x3dc7('0x8d'))]('Unknown\x20channel');}return _0x34aced['add'+_[_0x3dc7('0x9d')](_0x3bde39[_0x3dc7('0x9e')]())+_0x3dc7('0x9f')](_0xf7302d[_0x3dc7('0x5c')][_0x3dc7('0x5f')],{'penalty':_0xf7302d[_0x3dc7('0x5c')][_0x3dc7('0xa0')]||0x0})[_0x3dc7('0xa1')](function(_0x237a62){for(var _0x172e48=0x0;_0x172e48<_0xf7302d['body'][_0x3dc7('0x5f')][_0x3dc7('0x46')];_0x172e48+=0x1){var _0xb5dfd1={'UserId':Number(_0xf7302d[_0x3dc7('0x4f')]['id'])};_0xb5dfd1[_['capitalize'](_0x3bde39['toLowerCase']())+_0x3dc7('0xa2')]=Number(_0xf7302d[_0x3dc7('0x5c')][_0x3dc7('0x5f')][_0x172e48]);socket[_0x3dc7('0xa3')]('user'+_['capitalize'](_0x3bde39[_0x3dc7('0x9e')]())+_0x3dc7('0xa4'),_0xb5dfd1);}return _0x237a62;})['then'](function(){if(_0x3bde39===_0x3dc7('0xa5')){return db[_0x3dc7('0xa6')][_0x3dc7('0x41')]({'where':{'id':_0xf7302d[_0x3dc7('0x5c')][_0x3dc7('0x5f')]||[]},'raw':!![],'attributes':['id',_0x3dc7('0x34')]});}})['then'](function(_0xfd4829){var _0xe9f4da=_0x34aced[_0x3dc7('0x25')]({'plain':!![]});var _0x14a545=[];if(_0x3bde39===_0x3dc7('0xa5')&&_0xe9f4da[_0x3dc7('0x30')]===_0x3dc7('0x70')&&_0xe9f4da[_0x3dc7('0xa7')]){for(var _0x560005=0x0;_0x560005<_0xfd4829[_0x3dc7('0x46')];_0x560005+=0x1){_0x14a545[_0x3dc7('0x40')]({'membername':_0xe9f4da[_0x3dc7('0x34')],'UserId':_0xe9f4da['id'],'queue_name':_0xfd4829[_0x560005]['name'],'VoiceQueueId':_0xfd4829[_0x560005]['id'],'interface':_[_0x3dc7('0x67')](_0xe9f4da[_0x3dc7('0x9b')])?util['format'](_0x3dc7('0xa8'),_0xe9f4da[_0x3dc7('0x34')]):_0xe9f4da[_0x3dc7('0x9b')],'paused':_0xe9f4da[_0x3dc7('0x9a')]||![],'penalty':_0xf7302d[_0x3dc7('0x5c')][_0x3dc7('0xa0')]||0x0});}return BPromise[_0x3dc7('0x88')](_0x14a545,function(_0x1dfb09){return db[_0x3dc7('0xa9')][_0x3dc7('0xaa')](_0x1dfb09);});}return _0x34aced;});}})[_0x3dc7('0x23')](respondWithStatusCode(_0x3e0381,null))['catch'](handleError(_0x3e0381,null));};exports[_0x3dc7('0xab')]=function(_0x2d1abe,_0x5d9570){var _0x1a9899;return db[_0x3dc7('0x3e')][_0x3dc7('0x31')]({'where':{'id':_0x2d1abe[_0x3dc7('0x4f')]['id']},'attributes':['id','name','role']})[_0x3dc7('0x23')](handleEntityNotFound(_0x5d9570,null))[_0x3dc7('0x23')](function(_0x28f866){if(_0x28f866){_0x1a9899=_0x28f866;if(!_0x2d1abe[_0x3dc7('0x43')][_0x3dc7('0xac')]||!utils['isValidChannel'](_0x2d1abe[_0x3dc7('0x43')][_0x3dc7('0xac')])){throw new db[(_0x3dc7('0x8f'))][(_0x3dc7('0x8d'))]('Unknown\x20channel');}return _0x28f866[_0x3dc7('0xad')+_['capitalize'](_0x2d1abe[_0x3dc7('0x43')][_0x3dc7('0xac')][_0x3dc7('0x9e')]())+_0x3dc7('0x9f')](_0x2d1abe[_0x3dc7('0x43')]['ids']);}})['then'](function(_0x37596d){if(_[_0x3dc7('0xae')](_0x2d1abe['query'][_0x3dc7('0x5f')])){for(var _0x31a8a2=0x0;_0x31a8a2<_0x2d1abe['query'][_0x3dc7('0x5f')][_0x3dc7('0x46')];_0x31a8a2+=0x1){var _0x2d40fc={'UserId':Number(_0x2d1abe['params']['id'])};_0x2d40fc[_[_0x3dc7('0x9d')](_0x2d1abe['query'][_0x3dc7('0xac')][_0x3dc7('0x9e')]())+_0x3dc7('0xa2')]=Number(_0x2d1abe[_0x3dc7('0x43')][_0x3dc7('0x5f')][_0x31a8a2]);socket['emit'](_0x3dc7('0x27')+_['capitalize'](_0x2d1abe[_0x3dc7('0x43')][_0x3dc7('0xac')]['toLowerCase']())+_0x3dc7('0xaf'),_0x2d40fc);}}else{var _0x2d40fc={'UserId':Number(_0x2d1abe[_0x3dc7('0x4f')]['id'])};_0x2d40fc[_['capitalize'](_0x2d1abe[_0x3dc7('0x43')]['channel']['toLowerCase']())+'QueueId']=Number(_0x2d1abe[_0x3dc7('0x43')][_0x3dc7('0x5f')]);socket[_0x3dc7('0xa3')](_0x3dc7('0x27')+_[_0x3dc7('0x9d')](_0x2d1abe[_0x3dc7('0x43')][_0x3dc7('0xac')][_0x3dc7('0x9e')]())+_0x3dc7('0xaf'),_0x2d40fc);}return _0x37596d;})[_0x3dc7('0x23')](function(){if(_0x2d1abe['query'][_0x3dc7('0xac')]===_0x3dc7('0xa5')){return db[_0x3dc7('0xa9')][_0x3dc7('0x24')]({'where':{'UserId':_0x2d1abe['params']['id'],'VoiceQueueId':_0x2d1abe['query'][_0x3dc7('0x5f')]},'individualHooks':!![]})[_0x3dc7('0x23')](function(){return _0x1a9899;});}return _0x1a9899;})[_0x3dc7('0x23')](respondWithStatusCode(_0x5d9570,null))[_0x3dc7('0x4d')](handleError(_0x5d9570,null));};exports['addAvatar']=function(_0xb60377,_0x110004){_0xb60377[_0x3dc7('0x5c')][_0x3dc7('0xb0')]=_0xb60377[_0x3dc7('0xb1')][_0x3dc7('0xb2')];return db[_0x3dc7('0x3e')]['find']({'where':{'id':_0xb60377[_0x3dc7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x110004,null))[_0x3dc7('0x23')](saveUpdates(_0xb60377[_0x3dc7('0x5c')],null))['then'](respondWithResult(_0x110004,null))[_0x3dc7('0x4d')](handleError(_0x110004,null));};exports['getAvatar']=function(_0x45c7ed,_0x21cea6){var _0x10f66e=path[_0x3dc7('0xb3')](config[_0x3dc7('0xb4')],_0x3dc7('0xb5'));return db[_0x3dc7('0x3e')][_0x3dc7('0x31')]({'where':{'id':_0x45c7ed[_0x3dc7('0x4f')]['id']},'attributes':['id',_0x3dc7('0xb0')],'raw':!![]})[_0x3dc7('0x23')](handleEntityNotFound(_0x21cea6,null))['then'](function(_0x84f946){if(_0x84f946){if(_[_0x3dc7('0x67')](_0x84f946['userpic'])){return _0x21cea6[_0x3dc7('0xb6')](_0x10f66e);}else{if(!fs['existsSync'](path[_0x3dc7('0xb3')](config['root'],_0x3dc7('0xb7'),_0x84f946[_0x3dc7('0xb0')]))){return _0x21cea6[_0x3dc7('0xb6')](_0x10f66e);}return _0x21cea6[_0x3dc7('0xb6')](path['join'](config[_0x3dc7('0xb4')],_0x3dc7('0xb7'),_0x84f946[_0x3dc7('0xb0')]));}}})[_0x3dc7('0x4d')](handleError(_0x21cea6,null));};exports[_0x3dc7('0xb8')]=function(_0x2d47e5,_0x29ec4e){return db[_0x3dc7('0x3e')]['find']({'where':{'id':_0x2d47e5['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x29ec4e,null))[_0x3dc7('0x23')](function(_0x1dae66){var _0x5643e1=[];values=_0x1dae66[_0x3dc7('0x49')];_0x5643e1['push'](get_open_tabs(_0x3dc7('0x47'),_0x1dae66[_0x3dc7('0x49')]));_0x5643e1[_0x3dc7('0x40')](get_open_tabs(_0x3dc7('0x48'),_0x1dae66[_0x3dc7('0x49')]));_0x5643e1[_0x3dc7('0x40')](get_open_tabs(_0x3dc7('0x5a'),_0x1dae66['dataValues']));_0x5643e1[_0x3dc7('0x40')](get_open_tabs(_0x3dc7('0x4b'),_0x1dae66[_0x3dc7('0x49')]));_0x5643e1['push'](get_open_tabs('fax',_0x1dae66['dataValues']));_0x5643e1[_0x3dc7('0x40')](get_open_tabs(_0x3dc7('0x4a'),_0x1dae66['dataValues']));return BPromise[_0x3dc7('0x4c')](_0x5643e1);})[_0x3dc7('0x23')](function(_0x2b9784){var _0x3659cd=[];if(_0x2b9784){for(var _0x42c183=0x0;_0x42c183=_0x51a354){_0x3e82ec=_0x51a354;_0x218d45=0xc8;}else{_0x218d45=0xce;}_0x37e4e6['status'](_0x218d45);return _0x37e4e6[_0xd6fa('0x23')](_0xd6fa('0x24'),_0x4ac15b+'-'+_0x3e82ec+'/'+_0x51a354)[_0xd6fa('0x1f')](_0x7ec231);}return null;};}function saveUpdates(_0x17d36f){return function(_0x1f9575){if(_0x1f9575){return _0x1f9575[_0xd6fa('0x25')](_0x17d36f)[_0xd6fa('0x13')](function(_0x1e7785){return _0x1e7785;});}return null;};}function removeEntity(_0x1b9ca6){return function(_0x3e5f85){if(_0x3e5f85){return _0x3e5f85[_0xd6fa('0x26')]()[_0xd6fa('0x13')](function(){var _0x18f470=_0x3e5f85[_0xd6fa('0x27')]({'plain':!![]});if(_0x18f470[_0xd6fa('0x28')]===_0xd6fa('0x29'))return;var _0x42600c=[{'name':'Users','value':_0xd6fa('0x2a'),'ignore':!![]},{'name':_0xd6fa('0x2b'),'value':_0xd6fa('0x2c'),'ignore':![]},{'name':_0xd6fa('0x2d'),'value':'telephone','ignore':![]}];var _0x4f6540=_(_0x42600c)[_0xd6fa('0x2e')]('ignore')[_0xd6fa('0x2f')]('value')['value']();if(_[_0xd6fa('0x30')](_0x4f6540,_0x18f470[_0xd6fa('0x28')])){return;}var _0x5e35e7=_[_0xd6fa('0x31')](_0x42600c,[_0xd6fa('0x32'),_0x18f470[_0xd6fa('0x28')]])[_0xd6fa('0x33')];return db[_0xd6fa('0x34')][_0xd6fa('0x26')]({'where':{'type':_0x5e35e7,'resourceId':_0x18f470['id']}})[_0xd6fa('0x13')](function(){return _0x3e5f85;});})['then'](function(){_0x1b9ca6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22db87){return function(_0x464ac9){if(!_0x464ac9){_0x22db87[_0xd6fa('0x1c')](0x194);}return _0x464ac9;};}function handleError(_0x5c1405,_0x1dda13){_0x1dda13=_0x1dda13||0x1f4;return function(_0x479b0e){logger[_0xd6fa('0x18')](_0x479b0e['stack']);if(_0x479b0e[_0xd6fa('0x33')]){delete _0x479b0e[_0xd6fa('0x33')];}_0x5c1405[_0xd6fa('0x1e')](_0x1dda13)['send'](_0x479b0e);};}exports['index']=function(_0x142e00,_0x16d3e5){var _0x3022de={},_0x17fa34={'count':0x0,'rows':[]};var _0x239b64=_(db[_0xd6fa('0x35')][_0xd6fa('0x36')])[_0xd6fa('0x2f')](function(_0x19d87c){return{'name':_0x19d87c[_0xd6fa('0x37')],'type':_0x19d87c[_0xd6fa('0x38')][_0xd6fa('0x39')]};})['filter'](function(_0x2ce991){return!_[_0xd6fa('0x30')]([_0xd6fa('0x3a'),'salt'],_0x2ce991['name']);})['value']();_0x3022de=qs[_0xd6fa('0x3b')](_0x239b64,_0x142e00);var _0x351ceb={'where':_0x3022de[_0xd6fa('0x3c')]};return db['User'][_0xd6fa('0x21')](_0x351ceb)[_0xd6fa('0x13')](function(_0x43f43c){_0x17fa34[_0xd6fa('0x21')]=_0x43f43c;if(_0x142e00[_0xd6fa('0x3d')][_0xd6fa('0x3e')]){_0x3022de[_0xd6fa('0x3f')]=[{'all':!![]}];}if(!_[_0xd6fa('0x30')](_0x3022de['attributes'],'id')){_0x3022de[_0xd6fa('0x40')]['push']('id');}return db[_0xd6fa('0x35')][_0xd6fa('0x41')](_0x3022de);})[_0xd6fa('0x13')](function(_0x4ba055){_0x17fa34[_0xd6fa('0x42')]=_0x4ba055;if(_0x142e00[_0xd6fa('0x3d')]['openTabs']===_0xd6fa('0x43')){var _0x124302=[];for(var _0x4f3c41=0x0;_0x4f3c41<_0x17fa34['rows'][_0xd6fa('0x44')];_0x4f3c41++){_0x124302[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x46'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41][_0xd6fa('0x47')]));_0x124302[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x48'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41][_0xd6fa('0x47')]));_0x124302['push'](get_open_tabs(_0xd6fa('0x49'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41]['dataValues']));_0x124302[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4a'),_0x17fa34['rows'][_0x4f3c41][_0xd6fa('0x47')]));_0x124302[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4b'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41]['dataValues']));_0x124302['push'](get_open_tabs(_0xd6fa('0x4c'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41]['dataValues']));}return BPromise[_0xd6fa('0x4d')](_0x124302)[_0xd6fa('0x13')](function(_0x1c4c91){return _0x17fa34;});}else{return _0x17fa34;}})[_0xd6fa('0x13')](respondWithFilteredResult(_0x16d3e5,_0x3022de))[_0xd6fa('0x4e')](handleError(_0x16d3e5,null));};exports[_0xd6fa('0x4f')]=function(_0x28e0b6,_0x5be576){var _0x4bac02={'raw':![],'where':{'id':_0x28e0b6[_0xd6fa('0x50')]['id']}},_0x3f0cd3={};_0x3f0cd3[_0xd6fa('0x51')]=_['differenceBy'](_['keys'](db[_0xd6fa('0x35')][_0xd6fa('0x36')]),[_0xd6fa('0x3a'),'salt']);_0x3f0cd3[_0xd6fa('0x3d')]=_['keys'](_0x28e0b6[_0xd6fa('0x3d')]);_0x3f0cd3[_0xd6fa('0x52')]=_[_0xd6fa('0x53')](_0x3f0cd3[_0xd6fa('0x51')],_0x3f0cd3[_0xd6fa('0x3d')]);_0x4bac02[_0xd6fa('0x40')]=_[_0xd6fa('0x53')](_0x3f0cd3[_0xd6fa('0x51')],qs[_0xd6fa('0x54')](_0x28e0b6[_0xd6fa('0x3d')]['fields']));_0x4bac02[_0xd6fa('0x40')]=_0x4bac02[_0xd6fa('0x40')][_0xd6fa('0x44')]?_0x4bac02[_0xd6fa('0x40')]:_0x3f0cd3[_0xd6fa('0x51')];if(_0x28e0b6[_0xd6fa('0x3d')]['includeAll']){_0x4bac02[_0xd6fa('0x3f')]=[{'all':!![]}];}_0x4bac02=_[_0xd6fa('0x55')]({},_0x4bac02,_0x28e0b6[_0xd6fa('0x56')]);if(!_['includes'](_0x4bac02[_0xd6fa('0x40')],'id')){_0x4bac02[_0xd6fa('0x40')][_0xd6fa('0x45')]('id');}return db['User'][_0xd6fa('0x31')](_0x4bac02)[_0xd6fa('0x13')](handleEntityNotFound(_0x5be576,null))[_0xd6fa('0x13')](function(_0x596d5f){var _0x3f48e6=[];values=_0x596d5f;if(_0x28e0b6[_0xd6fa('0x3d')][_0xd6fa('0x57')]===_0xd6fa('0x43')){_0x3f48e6[_0xd6fa('0x45')](get_open_tabs('chat',_0x596d5f[_0xd6fa('0x47')]));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x48'),_0x596d5f[_0xd6fa('0x47')]));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4b'),_0x596d5f[_0xd6fa('0x47')]));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4c'),_0x596d5f[_0xd6fa('0x47')]));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs('fax',_0x596d5f['dataValues']));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4a'),_0x596d5f[_0xd6fa('0x47')]));return BPromise[_0xd6fa('0x4d')](_0x3f48e6);}else{return values;}})[_0xd6fa('0x13')](function(_0x16f85a){return values;})['then'](respondWithResult(_0x5be576,null))[_0xd6fa('0x4e')](handleError(_0x5be576,null));};exports['update']=function(_0x3f305e,_0x135900){if(_0x3f305e[_0xd6fa('0x58')]['id']){delete _0x3f305e[_0xd6fa('0x58')]['id'];}delete _0x3f305e[_0xd6fa('0x58')]['role'];return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x3f305e[_0xd6fa('0x50')]['id']}})[_0xd6fa('0x13')](handleEntityNotFound(_0x135900,null))[_0xd6fa('0x13')](saveUpdates(_0x3f305e[_0xd6fa('0x58')],null))[_0xd6fa('0x13')](respondWithResult(_0x135900,null))['catch'](handleError(_0x135900,null));};exports[_0xd6fa('0x59')]=function(_0x5f50a0,_0x23e3e5){return db[_0xd6fa('0x35')][_0xd6fa('0x59')]()[_0xd6fa('0x13')](respondWithResult(_0x23e3e5,null))[_0xd6fa('0x4e')](handleError(_0x23e3e5,null));};exports['addContacts']=function(_0x2d2764,_0x495eb4){return db[_0xd6fa('0x35')]['find']({'where':{'id':_0x2d2764[_0xd6fa('0x50')]['id']}})[_0xd6fa('0x13')](handleEntityNotFound(_0x495eb4,null))['then'](function(_0x3be929){if(_0x3be929){return _0x3be929[_0xd6fa('0x5a')](_0x2d2764['body']['ids'],_['omit'](_0x2d2764['body'],['ids','id'])||{});}})[_0xd6fa('0x13')](respondWithResult(_0x495eb4,null))[_0xd6fa('0x4e')](handleError(_0x495eb4,null));};function validateUser(_0x3e766e){return new BPromise(function(_0x137213,_0x495e77){if(_0x3e766e[_0xd6fa('0x5b')])return _0x137213(_0x3e766e);return db['Setting']['findById'](0x1)[_0xd6fa('0x13')](function(_0x6a60e5){if(_0x6a60e5[_0xd6fa('0x5c')])authService['validatePasswordPattern'](_0x3e766e[_0xd6fa('0x3a')]);db[_0xd6fa('0x35')][_0xd6fa('0x5d')](_0xd6fa('0x5b'))['then'](function(_0x1564b0){if(_[_0xd6fa('0x5e')](_0x1564b0)){_0x3e766e[_0xd6fa('0x5b')]=_0x6a60e5[_0xd6fa('0x5f')]||0x1;return;}if(_['isNil'](_0x6a60e5['min_internal'])||_0x6a60e5[_0xd6fa('0x5f')]===_0x1564b0){_0x3e766e[_0xd6fa('0x5b')]=_0x1564b0+0x1;return;}if(_0x6a60e5['min_internal']>_0x1564b0){_0x3e766e[_0xd6fa('0x5b')]=_0x6a60e5['min_internal'];return;}return db[_0xd6fa('0x60')][_0xd6fa('0x3d')](_0xd6fa('0x61'),{'type':db[_0xd6fa('0x60')]['QueryTypes'][_0xd6fa('0x62')]})['then'](function(_0x4d9f51){if(_0x4d9f51&&_0x4d9f51[_0xd6fa('0x44')]){for(var _0x31c4fa=0x0,_0x271498=_0x4d9f51[_0xd6fa('0x44')];_0x31c4fa<_0x271498&&_['isNil'](_0x3e766e[_0xd6fa('0x5b')]);_0x31c4fa++){if(_0x6a60e5[_0xd6fa('0x5f')]<=_0x4d9f51[_0x31c4fa]['from']){_0x3e766e[_0xd6fa('0x5b')]=_0x4d9f51[_0x31c4fa][_0xd6fa('0x63')];}else if(_0x6a60e5[_0xd6fa('0x5f')]>_0x4d9f51[_0x31c4fa][_0xd6fa('0x63')]&&_0x6a60e5[_0xd6fa('0x5f')]<=_0x4d9f51[_0x31c4fa]['to']){_0x3e766e[_0xd6fa('0x5b')]=_0x6a60e5[_0xd6fa('0x5f')];}}}if(_[_0xd6fa('0x5e')](_0x3e766e[_0xd6fa('0x5b')])){_0x3e766e['internal']=_0x1564b0+0x1;}return _0x137213(_0x3e766e);});});})['catch'](function(_0x30a586){_0x495e77(_0x30a586);});});}function updateUser(_0x5a9d1c){return new BPromise(function(_0x403c4c,_0x50e5be){try{if(_0x5a9d1c[_0xd6fa('0x64')]){_0x5a9d1c[_0xd6fa('0x65')]=_0x5a9d1c[_0xd6fa('0x5b')];_0x5a9d1c['VoiceMail']={'mailbox':_0x5a9d1c[_0xd6fa('0x5b')],'password':_0x5a9d1c[_0xd6fa('0x3a')],'fullname':_0x5a9d1c['fullname'],'email':_0x5a9d1c[_0xd6fa('0x66')]};}if(_0x5a9d1c[_0xd6fa('0x28')]===_0xd6fa('0x2c')){if(!_0x5a9d1c[_0xd6fa('0x67')])_0x5a9d1c[_0xd6fa('0x67')]=[_0xd6fa('0x68'),_0xd6fa('0x69'),_0xd6fa('0x6a'),_0xd6fa('0x6b'),_0xd6fa('0x6c'),_0xd6fa('0x6d'),_0xd6fa('0x6e'),_0xd6fa('0x6f'),_0xd6fa('0x70'),_0xd6fa('0x71'),_0xd6fa('0x72'),'100',_0xd6fa('0x73'),'114',_0xd6fa('0x74')];}_0x403c4c(_0x5a9d1c);}catch(_0x1bda28){_0x50e5be(_0x1bda28);}});}exports[_0xd6fa('0x75')]=function(_0x22e28d,_0x1b7699){if(_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x28')]===_0xd6fa('0x2c'))throw new Error('Unauthorized');if(_0x22e28d[_0xd6fa('0x58')][_0xd6fa('0x28')]===_0xd6fa('0x2a')&&_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x28')]!==_0xd6fa('0x29')){throw new Error(_0xd6fa('0x76'));}if(_0x22e28d[_0xd6fa('0x58')][_0xd6fa('0x28')]===_0xd6fa('0x29')&&_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x28')]!==_0xd6fa('0x29')){throw new Error(_0xd6fa('0x77'));}return licenseUtil[_0xd6fa('0x78')]([_0x22e28d[_0xd6fa('0x58')]])[_0xd6fa('0x13')](function(){return validateUser(_0x22e28d[_0xd6fa('0x58')]);})[_0xd6fa('0x13')](function(_0x6c0927){return updateUser(_0x6c0927)[_0xd6fa('0x13')](function(_0x5c5dc7){if(_0x5c5dc7['role']===_0xd6fa('0x29')){_0x5c5dc7[_0xd6fa('0x79')]=_0x22e28d['user'][_0xd6fa('0x79')];delete _0x5c5dc7[_0xd6fa('0x7a')];}return _0x5c5dc7;});})[_0xd6fa('0x13')](function(_0x8961c2){return db['User']['create'](_0x8961c2,{'include':[{'model':db[_0xd6fa('0x7b')],'as':_0xd6fa('0x7b')}]});})['then'](function(_0x560b7a){if(_0x22e28d[_0xd6fa('0x58')][_0xd6fa('0x28')]===_0xd6fa('0x2a'))return _0x560b7a;if(_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x28')]!=='user')return _0x560b7a;return db['UserProfileSection']['find']({'where':{'name':_0x560b7a[_0xd6fa('0x28')]==='agent'?_0xd6fa('0x2b'):_0xd6fa('0x2d'),'userProfileId':_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x7a')]},'raw':!![]})[_0xd6fa('0x13')](function(_0x40b575){if(!_0x40b575||_0x40b575[_0xd6fa('0x7c')]!=0x0)return _0x560b7a;return db[_0xd6fa('0x34')][_0xd6fa('0x75')]({'name':_0x560b7a['name'],'resourceId':_0x560b7a['id'],'type':_0x40b575[_0xd6fa('0x33')],'sectionId':_0x40b575['id']},{})[_0xd6fa('0x13')](function(){return _0x560b7a;});})[_0xd6fa('0x4e')](function(_0x31573e){logger['error'](_0xd6fa('0x7d'),_0x31573e);throw _0x31573e;});})[_0xd6fa('0x13')](respondWithResult(_0x1b7699,0xc9))[_0xd6fa('0x4e')](handleError(_0x1b7699,null));};exports['bulkCreate']=function(_0x2e0e7b,_0x4aca21){var _0x3b7154=_0x2e0e7b[_0xd6fa('0x58')];var _0x209a65=[];if(_0x2e0e7b[_0xd6fa('0x2a')][_0xd6fa('0x28')]==='agent')throw new Error(_0xd6fa('0x7e'));if(_['some'](_0x3b7154,['role',_0xd6fa('0x2a')])&&_0x2e0e7b['user'][_0xd6fa('0x28')]!==_0xd6fa('0x29')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xd6fa('0x7f')](_0x3b7154,[_0xd6fa('0x28'),_0xd6fa('0x29')])&&_0x2e0e7b['user']['role']!==_0xd6fa('0x29')){throw new Error(_0xd6fa('0x80'));}return licenseUtil[_0xd6fa('0x78')](_0x3b7154)[_0xd6fa('0x13')](function(){return validateUser(_0x3b7154[0x0]);})['then'](function(){for(var _0x23d15c=0x1;_0x23d15c<_0x3b7154[_0xd6fa('0x44')];_0x23d15c++){var _0x21df6f=_0x3b7154[_0x23d15c-0x1][_0xd6fa('0x5b')];if(!_0x3b7154[_0x23d15c]['internal'])_0x3b7154[_0x23d15c]['internal']=_0x21df6f+0x1;_0x209a65[_0xd6fa('0x45')](validateUser(_0x3b7154[_0x23d15c]));}return BPromise[_0xd6fa('0x4d')](_0x209a65);})[_0xd6fa('0x13')](function(){_0x209a65=[];for(var _0x2d1833=0x0;_0x2d1833<_0x3b7154[_0xd6fa('0x44')];_0x2d1833++){_0x209a65[_0xd6fa('0x45')](updateUser(_0x3b7154[_0x2d1833]));}return BPromise[_0xd6fa('0x4d')](_0x209a65);})[_0xd6fa('0x13')](function(){return BPromise[_0xd6fa('0x81')](_0x3b7154,function(_0x6feb10){return db['User'][_0xd6fa('0x75')](_0x6feb10,{'include':[{'model':db['VoiceMail'],'as':_0xd6fa('0x7b')}]})[_0xd6fa('0x13')](function(_0x563a05){_0x6feb10['id']=_0x563a05['id'];return _0x6feb10;});});})[_0xd6fa('0x13')](function(_0x58bcfd){if(_0x2e0e7b[_0xd6fa('0x58')][_0xd6fa('0x28')]===_0xd6fa('0x2a'))return _0x58bcfd;if(_0x2e0e7b[_0xd6fa('0x2a')][_0xd6fa('0x28')]!==_0xd6fa('0x2a'))return _0x58bcfd;var _0x10bb9a=_[_0xd6fa('0x7f')](_0x58bcfd,function(_0x3337df){return _0x3337df[_0xd6fa('0x28')]===_0xd6fa('0x2c')||_0x3337df[_0xd6fa('0x28')]===_0xd6fa('0x82');});if(!_0x10bb9a)return _0x58bcfd;return db[_0xd6fa('0x83')]['findAll']({'where':{'name':{'$or':[_0xd6fa('0x2b'),'Telephones']},'userProfileId':_0x2e0e7b[_0xd6fa('0x2a')][_0xd6fa('0x7a')]},'raw':!![]})[_0xd6fa('0x13')](function(_0x556043){if(_['isEmpty'](_0x556043)||!_[_0xd6fa('0x7f')](_0x556043,[_0xd6fa('0x7c'),0x0]))return _0x58bcfd;_0x209a65=[];var _0x911492=_(_0x556043)[_0xd6fa('0x2f')](function(_0x559f29){if(_0x559f29[_0xd6fa('0x7c')]===0x1)return;return _0x559f29[_0xd6fa('0x33')]===_0xd6fa('0x2b')?_0xd6fa('0x2c'):_0xd6fa('0x82');})[_0xd6fa('0x84')]()[_0xd6fa('0x32')]();for(var _0x341d9f=0x0;_0x341d9f<_0x58bcfd[_0xd6fa('0x44')];_0x341d9f++){if(!_[_0xd6fa('0x30')](_0x911492,_0x58bcfd[_0x341d9f]['role']))return;var _0x404005=_0x58bcfd[_0x341d9f][_0xd6fa('0x28')]==='agent'?_0xd6fa('0x2b'):'Telephones';_0x209a65['push'](db[_0xd6fa('0x34')][_0xd6fa('0x75')]({'name':_0x58bcfd[_0x341d9f][_0xd6fa('0x33')],'resourceId':_0x58bcfd[_0x341d9f]['id'],'type':_0x404005,'sectionId':_[_0xd6fa('0x31')](_0x556043,[_0xd6fa('0x33'),_0x404005])['id']},{}));}return BPromise['all'](_0x209a65);});})[_0xd6fa('0x13')](respondWithResult(_0x4aca21,0xc9))[_0xd6fa('0x4e')](handleError(_0x4aca21,null));};exports[_0xd6fa('0x85')]=function(_0x2443b1,_0x550302){if(_0x2443b1['body']['id']){delete _0x2443b1[_0xd6fa('0x58')]['id'];}return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x2443b1['params']['id']}})[_0xd6fa('0x13')](function(_0x37ec61){if(!_0x37ec61)return null;if(_0x37ec61['id']===_0x2443b1[_0xd6fa('0x2a')]['id']){if(!_0x2443b1['body'][_0xd6fa('0x86')]||!_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')]){throw new db[(_0xd6fa('0x88'))]['ValidationError'](_0xd6fa('0x89'));}if(!_0x37ec61['authenticate'](_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x86')])){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))]('Wrong\x20credentials');}if(_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x86')]===_0x2443b1[_0xd6fa('0x58')]['newPassword']){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x8b'));}}else if(_0x2443b1[_0xd6fa('0x2a')][_0xd6fa('0x28')]===_0xd6fa('0x29')){if(!_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')]){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x8c'));}}else if(_0x2443b1[_0xd6fa('0x2a')]['role']===_0xd6fa('0x2a')){if(!_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')]){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x8c'));}if(_0x37ec61[_0xd6fa('0x28')]!==_0xd6fa('0x2c')){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x7e'));}}else{throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x7e'));}return _0x37ec61;})[_0xd6fa('0x13')](handleEntityNotFound(_0x550302,null))[_0xd6fa('0x13')](function(_0x11ef8d){return db[_0xd6fa('0x8d')][_0xd6fa('0x8e')]({'attributes':['id',_0xd6fa('0x5c'),_0xd6fa('0x8f'),_0xd6fa('0x90')]})[_0xd6fa('0x13')](function(_0x43ba34){if(_0x43ba34[_0xd6fa('0x5c')])authService[_0xd6fa('0x91')](_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')]);if(!_0x43ba34[_0xd6fa('0x8f')]||!_0x11ef8d['previousPasswords'])return _0x11ef8d;authService[_0xd6fa('0x92')](_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')],_0x11ef8d['previousPasswords'],_0x43ba34[_0xd6fa('0x90')]);return _0x11ef8d;})[_0xd6fa('0x13')](saveUpdates({'password':_0x2443b1[_0xd6fa('0x58')]['newPassword'],'passwordResetAt':_0x2443b1['user']['id']==_0x2443b1[_0xd6fa('0x50')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')],_0x11ef8d[_0xd6fa('0x93')])},null));})[_0xd6fa('0x13')](respondWithResult(_0x550302,null))[_0xd6fa('0x4e')](handleError(_0x550302,null));};exports[_0xd6fa('0x94')]=function(_0x2a8a7e,_0x3f84a3){var _0x5f4543=_0x2a8a7e[_0xd6fa('0x58')][_0xd6fa('0x95')];return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x2a8a7e[_0xd6fa('0x50')]['id']},'attributes':['id',_0xd6fa('0x33'),_0xd6fa('0x28'),_0xd6fa('0x96'),_0xd6fa('0x97'),_0xd6fa('0x98'),_0xd6fa('0x99')]})[_0xd6fa('0x13')](handleEntityNotFound(_0x3f84a3,null))[_0xd6fa('0x13')](function(_0xbf08ef){if(_0xbf08ef){if(!utils[_0xd6fa('0x9a')](_0x5f4543)){throw new db[(_0xd6fa('0x88'))]['ValidationError'](_0xd6fa('0x9b'));}return _0xbf08ef[_0xd6fa('0x9c')+_[_0xd6fa('0x9d')](_0x5f4543[_0xd6fa('0x9e')]())+'Queues'](_0x2a8a7e[_0xd6fa('0x58')]['ids'],{'penalty':_0x2a8a7e[_0xd6fa('0x58')][_0xd6fa('0x9f')]||0x0})['spread'](function(_0x2995de){for(var _0x302c14=0x0;_0x302c14<_0x2a8a7e['body'][_0xd6fa('0xa0')][_0xd6fa('0x44')];_0x302c14+=0x1){var _0x5864ec={'UserId':Number(_0x2a8a7e[_0xd6fa('0x50')]['id'])};_0x5864ec[_[_0xd6fa('0x9d')](_0x5f4543[_0xd6fa('0x9e')]())+_0xd6fa('0xa1')]=Number(_0x2a8a7e['body'][_0xd6fa('0xa0')][_0x302c14]);socket['emit'](_0xd6fa('0x2a')+_[_0xd6fa('0x9d')](_0x5f4543['toLowerCase']())+_0xd6fa('0xa2'),_0x5864ec);}return _0x2995de;})['then'](function(){if(_0x5f4543===_0xd6fa('0xa3')){return db[_0xd6fa('0xa4')][_0xd6fa('0x41')]({'where':{'id':_0x2a8a7e[_0xd6fa('0x58')][_0xd6fa('0xa0')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x1e8b46){var _0x39740a=_0xbf08ef[_0xd6fa('0x27')]({'plain':!![]});var _0x2470f6=[];if(_0x5f4543===_0xd6fa('0xa3')&&_0x39740a['role']===_0xd6fa('0x2c')&&_0x39740a['online']){for(var _0x5e8ad7=0x0;_0x5e8ad7<_0x1e8b46[_0xd6fa('0x44')];_0x5e8ad7+=0x1){_0x2470f6['push']({'membername':_0x39740a['name'],'UserId':_0x39740a['id'],'queue_name':_0x1e8b46[_0x5e8ad7][_0xd6fa('0x33')],'VoiceQueueId':_0x1e8b46[_0x5e8ad7]['id'],'interface':_[_0xd6fa('0x5e')](_0x39740a[_0xd6fa('0x99')])?util['format'](_0xd6fa('0xa5'),_0x39740a[_0xd6fa('0x33')]):_0x39740a['interface'],'paused':_0x39740a[_0xd6fa('0x98')]||![],'penalty':_0x2a8a7e['body'][_0xd6fa('0x9f')]||0x0});}return BPromise[_0xd6fa('0x81')](_0x2470f6,function(_0x3e29ee){return db[_0xd6fa('0xa6')][_0xd6fa('0xa7')](_0x3e29ee);});}return _0xbf08ef;});}})[_0xd6fa('0x13')](respondWithStatusCode(_0x3f84a3,null))[_0xd6fa('0x4e')](handleError(_0x3f84a3,null));};exports[_0xd6fa('0xa8')]=function(_0x4f72f0,_0x83bcab){var _0xb83875;return db['User'][_0xd6fa('0x31')]({'where':{'id':_0x4f72f0[_0xd6fa('0x50')]['id']},'attributes':['id',_0xd6fa('0x33'),_0xd6fa('0x28')]})[_0xd6fa('0x13')](handleEntityNotFound(_0x83bcab,null))['then'](function(_0x36db2c){if(_0x36db2c){_0xb83875=_0x36db2c;if(!_0x4f72f0['query']['channel']||!utils[_0xd6fa('0x9a')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')])){throw new db[(_0xd6fa('0x88'))]['ValidationError']('Unknown\x20channel');}return _0x36db2c[_0xd6fa('0xa9')+_[_0xd6fa('0x9d')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')][_0xd6fa('0x9e')]())+_0xd6fa('0xaa')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')]);}})[_0xd6fa('0x13')](function(_0x52bd33){if(_[_0xd6fa('0xab')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')])){for(var _0x240cf5=0x0;_0x240cf5<_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')][_0xd6fa('0x44')];_0x240cf5+=0x1){var _0x52f0c1={'UserId':Number(_0x4f72f0[_0xd6fa('0x50')]['id'])};_0x52f0c1[_['capitalize'](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')]['toLowerCase']())+_0xd6fa('0xa1')]=Number(_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')][_0x240cf5]);socket[_0xd6fa('0xac')]('user'+_['capitalize'](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')][_0xd6fa('0x9e')]())+_0xd6fa('0xad'),_0x52f0c1);}}else{var _0x52f0c1={'UserId':Number(_0x4f72f0[_0xd6fa('0x50')]['id'])};_0x52f0c1[_[_0xd6fa('0x9d')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')]['toLowerCase']())+_0xd6fa('0xa1')]=Number(_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')]);socket['emit'](_0xd6fa('0x2a')+_['capitalize'](_0x4f72f0[_0xd6fa('0x3d')]['channel'][_0xd6fa('0x9e')]())+_0xd6fa('0xad'),_0x52f0c1);}return _0x52bd33;})[_0xd6fa('0x13')](function(){if(_0x4f72f0['query'][_0xd6fa('0x95')]===_0xd6fa('0xa3')){return db[_0xd6fa('0xa6')]['destroy']({'where':{'UserId':_0x4f72f0[_0xd6fa('0x50')]['id'],'VoiceQueueId':_0x4f72f0['query'][_0xd6fa('0xa0')]},'individualHooks':!![]})[_0xd6fa('0x13')](function(){return _0xb83875;});}return _0xb83875;})[_0xd6fa('0x13')](respondWithStatusCode(_0x83bcab,null))[_0xd6fa('0x4e')](handleError(_0x83bcab,null));};exports[_0xd6fa('0xae')]=function(_0xce3581,_0xd9ebce){_0xce3581[_0xd6fa('0x58')][_0xd6fa('0xaf')]=_0xce3581[_0xd6fa('0xb0')][_0xd6fa('0xb1')];return db['User'][_0xd6fa('0x31')]({'where':{'id':_0xce3581[_0xd6fa('0x50')]['id']}})[_0xd6fa('0x13')](handleEntityNotFound(_0xd9ebce,null))[_0xd6fa('0x13')](saveUpdates(_0xce3581[_0xd6fa('0x58')],null))['then'](respondWithResult(_0xd9ebce,null))[_0xd6fa('0x4e')](handleError(_0xd9ebce,null));};exports[_0xd6fa('0xb2')]=function(_0x1f6d1c,_0x563516){var _0x422ffd=path[_0xd6fa('0xb3')](config[_0xd6fa('0xb4')],'server/files/images/logos/default_profile.png');return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x1f6d1c['params']['id']},'attributes':['id',_0xd6fa('0xaf')],'raw':!![]})[_0xd6fa('0x13')](handleEntityNotFound(_0x563516,null))[_0xd6fa('0x13')](function(_0x7fe85e){if(_0x7fe85e){if(_[_0xd6fa('0x5e')](_0x7fe85e[_0xd6fa('0xaf')])){return _0x563516[_0xd6fa('0xb5')](_0x422ffd);}else{if(!fs[_0xd6fa('0xb6')](path[_0xd6fa('0xb3')](config[_0xd6fa('0xb4')],_0xd6fa('0xb7'),_0x7fe85e['userpic']))){return _0x563516[_0xd6fa('0xb5')](_0x422ffd);}return _0x563516['download'](path[_0xd6fa('0xb3')](config[_0xd6fa('0xb4')],'server/files/images/',_0x7fe85e[_0xd6fa('0xaf')]));}}})[_0xd6fa('0x4e')](handleError(_0x563516,null));};exports['getOpenTabs']=function(_0x142d90,_0x567d39){return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x142d90[_0xd6fa('0x50')]['id']},'attributes':['id']})[_0xd6fa('0x13')](handleEntityNotFound(_0x567d39,null))['then'](function(_0x281d92){var _0x4fc8c2=[];values=_0x281d92['dataValues'];_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x46'),_0x281d92['dataValues']));_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs('sms',_0x281d92[_0xd6fa('0x47')]));_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4b'),_0x281d92[_0xd6fa('0x47')]));_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4c'),_0x281d92[_0xd6fa('0x47')]));_0x4fc8c2['push'](get_open_tabs(_0xd6fa('0x49'),_0x281d92[_0xd6fa('0x47')]));_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4a'),_0x281d92[_0xd6fa('0x47')]));return BPromise['all'](_0x4fc8c2);})[_0xd6fa('0x13')](function(_0x183274){var _0x36fd68=[];if(_0x183274){for(var _0x33e11c=0x0;_0x33e11c=_0x3122b2[_0x3a6e('0x4f')]){throw new Error(_0x3a6e('0x50'));}})[_0x3a6e('0xe')](function(){if(_0x46b32c){return db[_0x3a6e('0x2a')][_0x3a6e('0x4a')]({'where':{'membername':_0x46b32c['name']},'individualHooks':!![]});}})['then'](function(){if(_0x46b32c){return _0x46b32c['getVoiceQueues']({'raw':!![]});}})[_0x3a6e('0xe')](function(_0x5dc8c9){if(_0x46b32c){if(_0x5dc8c9){var _0x554603=[];_0x4f478c=_0x5dc8c9;if(_0x4f478c[_0x3a6e('0x2e')]){for(var _0x22ff4e=0x0;_0x22ff4e<_0x4f478c[_0x3a6e('0x2e')];_0x22ff4e++){_0x554603[_0x3a6e('0x46')](db['UserVoiceQueueRt']['upsert']({'membername':_0x46b32c[_0x3a6e('0x32')],'UserId':_0x46b32c['id'],'queue_name':_0x4f478c[_0x22ff4e][_0x3a6e('0x32')],'VoiceQueueId':_0x4f478c[_0x22ff4e]['id'],'interface':_0x29459a,'paused':_0x46b32c[_0x3a6e('0x4c')]||![],'penalty':_0x4f478c[_0x22ff4e][_0x3a6e('0x51')]||0x0}));}return BPromise[_0x3a6e('0x47')](_0x554603);}}}})[_0x3a6e('0xe')](function(){if(_0x46b32c){return db[_0x3a6e('0x2c')][_0x3a6e('0x1b')]({'where':{'membername':_0x46b32c[_0x3a6e('0x32')],'exitAt':null}});}})['then'](function(_0x25b90e){if(_0x46b32c){if(_0x25b90e&&_0x25b90e['length']){var _0xa1bd5a=[];_0x25b90e['forEach'](function(_0x313d4f){_0xa1bd5a['push'](_0x313d4f[_0x3a6e('0x2b')]({'exitAt':moment()[_0x3a6e('0x35')](_0x3a6e('0x2f'))}));});return BPromise[_0x3a6e('0x47')](_0xa1bd5a);}}})[_0x3a6e('0xe')](function(_0x299e72){if(_0x46b32c){var _0x1a7a10=[];var _0x5c299b=[];var _0x5bebb1=utils[_0x3a6e('0x30')]();var _0x3ffdd0={'membername':_0x46b32c[_0x3a6e('0x32')],'interface':_0x29459a,'enterAt':moment()[_0x3a6e('0x35')](_0x3a6e('0x2f')),'role':_0x46b32c[_0x3a6e('0x27')],'internal':_0x46b32c[_0x3a6e('0x28')]};_0x5bebb1[_0x3a6e('0x31')](function(_0x7a1c53){_0x1a7a10['push'](_[_0x3a6e('0x52')]({'channel':_0x7a1c53,'type':'LOGIN','data1':'callysquare','data2':_0x29459a},_0x3ffdd0));if(_0x46b32c['loginInPause']){_0x5c299b[_0x3a6e('0x46')](_[_0x3a6e('0x52')]({'channel':_0x7a1c53,'type':_0x3a6e('0x2d'),'data1':_0x3a6e('0x53')},_0x3ffdd0));}});return db['MemberReport'][_0x3a6e('0x54')](_0x1a7a10[_0x3a6e('0x55')](_0x5c299b),{'individualHooks':!![]});}})[_0x3a6e('0xe')](function(){if(_0x46b32c){return _0x46b32c['update']({'online':!![],'lastLoginAt':moment()[_0x3a6e('0x35')](_0x3a6e('0x2f')),'voicePause':_0x46b32c['loginInPause']||![],'mailPause':_0x46b32c[_0x3a6e('0x4c')]||![],'chatPause':_0x46b32c[_0x3a6e('0x4c')]||![],'faxPause':_0x46b32c[_0x3a6e('0x4c')]||![],'smsPause':_0x46b32c[_0x3a6e('0x4c')]||![],'openchannelPause':_0x46b32c[_0x3a6e('0x4c')]||![],'pauseType':_0x46b32c[_0x3a6e('0x4c')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x3a6e('0x35')](_0x3a6e('0x2f')),'interface':_0x29459a});}})[_0x3a6e('0xe')](function(_0x4d1fb7){_0x529caa(_0x4d1fb7);})[_0x3a6e('0x18')](function(_0x402edc){_0x1805c3(_0x1cb347[_0x3a6e('0x15')](0x1f4,_0x402edc[_0x3a6e('0x16')]));});});}; \ No newline at end of file +var _0x1e09=['PauseUser','internal','interface','UserVoiceQueueRt','MemberReport','name','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','role','uniqueid','bulkCreate','update','UnpauseUser','findOne','channel','isValidChannel','find','mail','fax','sms','openchannel','set','%s%s','Pause','system','all','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','User','findAll','options','raw','where','attributes','limit','map','include','model','GetUser','ShowUser','debug'];(function(_0x23951d,_0x525a33){var _0x52f4a7=function(_0x2d7c65){while(--_0x2d7c65){_0x23951d['push'](_0x23951d['shift']());}};_0x52f4a7(++_0x525a33);}(_0x1e09,0xf7));var _0x91e0=function(_0x4ed30b,_0x87c308){_0x4ed30b=_0x4ed30b-0x0;var _0x28671e=_0x1e09[_0x4ed30b];return _0x28671e;};'use strict';var _=require('lodash');var util=require(_0x91e0('0x0'));var moment=require('moment');var BPromise=require(_0x91e0('0x1'));var rs=require(_0x91e0('0x2'));var fs=require('fs');var Redis=require(_0x91e0('0x3'));var db=require(_0x91e0('0x4'))['db'];var utils=require(_0x91e0('0x5'));var logger=require(_0x91e0('0x6'))(_0x91e0('0x7'));var config=require(_0x91e0('0x8'));var jayson=require(_0x91e0('0x9'));var client=jayson[_0x91e0('0xa')][_0x91e0('0xb')]({'port':0x232a});config[_0x91e0('0xc')]=_[_0x91e0('0xd')](config[_0x91e0('0xc')],{'host':_0x91e0('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x91e0('0xc')]));require(_0x91e0('0xf'))[_0x91e0('0x10')](socket);function respondWithRpcPromise(_0x368742,_0x16bbef,_0x334bdb){return new BPromise(function(_0x1a15d3,_0x19b0f1){return client[_0x91e0('0x11')](_0x368742,_0x334bdb)[_0x91e0('0x12')](function(_0x2cd669){logger[_0x91e0('0x13')](_0x91e0('0x14'),_0x16bbef,_0x91e0('0x15'));logger['debug'](_0x91e0('0x16'),_0x16bbef,_0x91e0('0x15'),JSON[_0x91e0('0x17')](_0x2cd669));if(_0x2cd669[_0x91e0('0x18')]){if(_0x2cd669[_0x91e0('0x18')][_0x91e0('0x19')]===0x1f4){logger[_0x91e0('0x18')](_0x91e0('0x14'),_0x16bbef,_0x2cd669['error']['message']);return _0x19b0f1(_0x2cd669['error'][_0x91e0('0x1a')]);}logger[_0x91e0('0x18')](_0x91e0('0x14'),_0x16bbef,_0x2cd669[_0x91e0('0x18')][_0x91e0('0x1a')]);return _0x1a15d3(_0x2cd669[_0x91e0('0x18')][_0x91e0('0x1a')]);}else{logger[_0x91e0('0x13')]('User,\x20%s,\x20%s',_0x16bbef,_0x91e0('0x15'));_0x1a15d3(_0x2cd669['result'][_0x91e0('0x1a')]);}})[_0x91e0('0x1b')](function(_0x38e2ef){logger[_0x91e0('0x18')](_0x91e0('0x14'),_0x16bbef,_0x38e2ef);_0x19b0f1(_0x38e2ef);});});}exports['GetUser']=function(_0x47bf16){var _0x40c551=this;return new Promise(function(_0x1a4b22,_0x3fc403){return db[_0x91e0('0x1c')][_0x91e0('0x1d')]({'raw':_0x47bf16['options']?_0x47bf16[_0x91e0('0x1e')][_0x91e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x47bf16[_0x91e0('0x1e')]?_0x47bf16['options'][_0x91e0('0x20')]||null:null,'attributes':_0x47bf16[_0x91e0('0x1e')]?_0x47bf16[_0x91e0('0x1e')][_0x91e0('0x21')]||null:null,'limit':_0x47bf16[_0x91e0('0x1e')]?_0x47bf16[_0x91e0('0x1e')][_0x91e0('0x22')]||null:null,'include':_0x47bf16['options']?_0x47bf16[_0x91e0('0x1e')]['include']?_[_0x91e0('0x23')](_0x47bf16['options'][_0x91e0('0x24')],function(_0x4705d9){return{'model':db[_0x4705d9[_0x91e0('0x25')]],'as':_0x4705d9['as'],'attributes':_0x4705d9[_0x91e0('0x21')],'include':_0x4705d9['include']?_[_0x91e0('0x23')](_0x4705d9[_0x91e0('0x24')],function(_0x2f0d35){return{'model':db[_0x2f0d35[_0x91e0('0x25')]],'as':_0x2f0d35['as'],'attributes':_0x2f0d35[_0x91e0('0x21')],'include':_0x2f0d35[_0x91e0('0x24')]?_[_0x91e0('0x23')](_0x2f0d35[_0x91e0('0x24')],function(_0x4dfd6c){return{'model':db[_0x4dfd6c[_0x91e0('0x25')]],'as':_0x4dfd6c['as'],'attributes':_0x4dfd6c['attributes']};}):[]};}):[]};}):[]:[]})[_0x91e0('0x12')](function(_0x1f2b60){logger[_0x91e0('0x13')](_0x91e0('0x26'),_0x47bf16);logger['debug'](_0x91e0('0x26'),_0x47bf16,JSON['stringify'](_0x1f2b60));_0x1a4b22(_0x1f2b60);})[_0x91e0('0x1b')](function(_0x1bfaef){logger[_0x91e0('0x18')]('GetUser',_0x1bfaef['message'],_0x47bf16);_0x3fc403(_0x40c551['error'](0x1f4,_0x1bfaef[_0x91e0('0x1a')]));});});};exports[_0x91e0('0x27')]=function(_0xaad472){var _0x119f6c=this;return new Promise(function(_0x2de1fe,_0x5b8cdf){return db['User']['find']({'raw':_0xaad472[_0x91e0('0x1e')]?_0xaad472['options'][_0x91e0('0x1f')]===undefined?!![]:![]:!![],'where':_0xaad472[_0x91e0('0x1e')]?_0xaad472[_0x91e0('0x1e')][_0x91e0('0x20')]||null:null,'attributes':_0xaad472[_0x91e0('0x1e')]?_0xaad472[_0x91e0('0x1e')][_0x91e0('0x21')]||null:null,'include':_0xaad472['options']?_0xaad472[_0x91e0('0x1e')]['include']?_[_0x91e0('0x23')](_0xaad472['options']['include'],function(_0xb1d748){return{'model':db[_0xb1d748[_0x91e0('0x25')]],'as':_0xb1d748['as'],'attributes':_0xb1d748[_0x91e0('0x21')],'include':_0xb1d748['include']?_[_0x91e0('0x23')](_0xb1d748[_0x91e0('0x24')],function(_0xf03121){return{'model':db[_0xf03121[_0x91e0('0x25')]],'as':_0xf03121['as'],'attributes':_0xf03121[_0x91e0('0x21')],'include':_0xf03121[_0x91e0('0x24')]?_[_0x91e0('0x23')](_0xf03121[_0x91e0('0x24')],function(_0x50166d){return{'model':db[_0x50166d[_0x91e0('0x25')]],'as':_0x50166d['as'],'attributes':_0x50166d[_0x91e0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x91e0('0x12')](function(_0x5dd451){logger['info'](_0x91e0('0x27'),_0xaad472);logger[_0x91e0('0x28')](_0x91e0('0x27'),_0xaad472,JSON[_0x91e0('0x17')](_0x5dd451));_0x2de1fe(_0x5dd451);})[_0x91e0('0x1b')](function(_0x2f7d83){logger[_0x91e0('0x18')]('ShowUser',_0x2f7d83['message'],_0xaad472);_0x5b8cdf(_0x119f6c[_0x91e0('0x18')](0x1f4,_0x2f7d83[_0x91e0('0x1a')]));});});};exports[_0x91e0('0x29')]=function(_0xb5e454){var _0x56627d=this;return new Promise(function(_0xeee25f,_0x31894c){var _0x111376;return db['User']['find']({'where':_0xb5e454[_0x91e0('0x1e')][_0x91e0('0x20')]||{},'attributes':['id','name','role',_0x91e0('0x2a'),_0x91e0('0x2b')]})[_0x91e0('0x12')](function(_0x266c3c){if(_0x266c3c){_0x111376=_0x266c3c;return db[_0x91e0('0x2c')]['update']({'paused':0x1},{'where':{'UserId':_0x111376['id']},'individualHooks':!![]});}})['then'](function(){if(_0x111376){return db[_0x91e0('0x2d')]['findAll']({'where':{'membername':_0x111376[_0x91e0('0x2e')],'type':'PAUSE','exitAt':null}});}})[_0x91e0('0x12')](function(_0x27804d){if(_0x111376){if(_0x27804d&&_0x27804d[_0x91e0('0x2f')]){var _0x71e608=moment()[_0x91e0('0x30')](_0x91e0('0x31'));for(var _0x2b197c=0x0,_0x44033f=_0x27804d[_0x91e0('0x2f')];_0x2b197c<_0x44033f;_0x2b197c++){_0x27804d[_0x2b197c][_0x91e0('0x32')]({'exitAt':_0x71e608});}}}})['then'](function(){if(_0x111376){var _0x51ec3e=[];var _0x3d6404=utils[_0x91e0('0x33')]();_0x3d6404[_0x91e0('0x34')](function(_0x29af06){_0x51ec3e[_0x91e0('0x35')]({'channel':_0x29af06,'membername':_0x111376[_0x91e0('0x2e')],'interface':_[_0x91e0('0x36')](_0x111376[_0x91e0('0x2b')])?util['format'](_0x91e0('0x37'),_0x111376[_0x91e0('0x2e')]):_0x111376[_0x91e0('0x2b')],'type':_0x91e0('0x38'),'enterAt':moment()[_0x91e0('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xb5e454[_0x91e0('0x39')][_0x91e0('0x3a')]||_0x91e0('0x3b'),'role':_0x111376[_0x91e0('0x3c')],'internal':_0x111376[_0x91e0('0x2a')],'uniqueid':_0xb5e454[_0x91e0('0x39')][_0x91e0('0x3d')]||null});});return db[_0x91e0('0x2d')][_0x91e0('0x3e')](_0x51ec3e,{'individualHooks':!![]});}})[_0x91e0('0x12')](function(){if(_0x111376){return _0x111376[_0x91e0('0x3f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0xb5e454['body'][_0x91e0('0x3a')]||_0x91e0('0x3b'),'lastPauseAt':moment()[_0x91e0('0x30')](_0x91e0('0x31'))});}})[_0x91e0('0x12')](function(_0x361fd2){_0xeee25f(_0x361fd2);})['catch'](function(_0x3e6088){_0x31894c(_0x56627d[_0x91e0('0x18')](0x1f4,_0x3e6088[_0x91e0('0x1a')]));});});};exports[_0x91e0('0x40')]=function(_0x44bec5){var _0x5720c9=this;return new Promise(function(_0x5c52bf,_0x19c820){var _0x31ea45;return db['User'][_0x91e0('0x41')]({'where':_0x44bec5[_0x91e0('0x1e')][_0x91e0('0x20')]||{},'attributes':['id',_0x91e0('0x2e')]})['then'](function(_0x5f4c07){if(_0x5f4c07){_0x31ea45=_0x5f4c07;if(_0x44bec5['body'][_0x91e0('0x42')]&&!utils[_0x91e0('0x43')](_0x44bec5[_0x91e0('0x39')][_0x91e0('0x42')])){throw new Error('Unknown\x20channel');}switch(_0x44bec5[_0x91e0('0x39')][_0x91e0('0x42')]){case'voice':return db[_0x91e0('0x2c')]['update']({'paused':0x0},{'where':{'UserId':_0x31ea45['id']}})[_0x91e0('0x12')](function(){return db[_0x91e0('0x2d')][_0x91e0('0x44')]({'where':{'channel':_0x44bec5[_0x91e0('0x39')][_0x91e0('0x42')],'membername':_0x31ea45[_0x91e0('0x2e')],'type':'PAUSE','exitAt':null}});})[_0x91e0('0x12')](function(_0x361ebd){if(_0x361ebd){return _0x361ebd[_0x91e0('0x3f')]({'exitAt':moment()[_0x91e0('0x30')](_0x91e0('0x31')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x91e0('0x12')](function(){return _0x31ea45[_0x91e0('0x3f')]({'voicePause':![]});});case _0x91e0('0x45'):case'chat':case _0x91e0('0x46'):case _0x91e0('0x47'):case _0x91e0('0x48'):case'whatsapp':return db[_0x91e0('0x2d')]['find']({'where':{'channel':_0x44bec5[_0x91e0('0x39')]['channel'],'membername':_0x31ea45[_0x91e0('0x2e')],'type':_0x91e0('0x38'),'exitAt':null}})[_0x91e0('0x12')](function(_0x4b3bc6){return _0x4b3bc6[_0x91e0('0x3f')]({'exitAt':moment()['format'](_0x91e0('0x31')),'data2':'system'},{'individualHooks':!![]});})['then'](function(){var _0x32683e={};_[_0x91e0('0x49')](_0x32683e,util[_0x91e0('0x30')](_0x91e0('0x4a'),_0x44bec5['body'][_0x91e0('0x42')],_0x91e0('0x4b')),![]);return _0x31ea45[_0x91e0('0x3f')](_0x32683e);});default:return db[_0x91e0('0x2c')][_0x91e0('0x3f')]({'paused':0x0},{'where':{'UserId':_0x31ea45['id']}})[_0x91e0('0x12')](function(){return db[_0x91e0('0x2d')][_0x91e0('0x1d')]({'where':{'membername':_0x31ea45[_0x91e0('0x2e')],'type':_0x91e0('0x38'),'exitAt':null}});})[_0x91e0('0x12')](function(_0x4e1b17){var _0x472bfa=[];_0x4e1b17[_0x91e0('0x34')](function(_0x236f09){_0x472bfa[_0x91e0('0x35')](_0x236f09[_0x91e0('0x3f')]({'exitAt':moment()[_0x91e0('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x91e0('0x4c')}));});return BPromise[_0x91e0('0x4d')](_0x472bfa);})[_0x91e0('0x12')](function(){return _0x31ea45[_0x91e0('0x3f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x91e0('0x12')](function(_0x276a3e){_0x5c52bf(_0x276a3e);})['catch'](function(_0x45f56d){_0x19c820(_0x5720c9[_0x91e0('0x18')](0x1f4,_0x45f56d['message']));});});};exports['LogoutUser']=function(_0x36f451){var _0x5599bd=this;return new Promise(function(_0x440fa5,_0x41a234){var _0x4874eb;return db[_0x91e0('0x1c')][_0x91e0('0x41')]({'where':_0x36f451[_0x91e0('0x1e')]['where']||{},'attributes':['id',_0x91e0('0x2e')]})['then'](function(_0x1bb3a2){if(_0x1bb3a2){_0x4874eb=_0x1bb3a2;return db[_0x91e0('0x2c')]['destroy']({'where':{'membername':_0x4874eb[_0x91e0('0x2e')]},'individualHooks':!![]});}})[_0x91e0('0x12')](function(){if(_0x4874eb){return db[_0x91e0('0x2d')][_0x91e0('0x1d')]({'where':{'membername':_0x4874eb[_0x91e0('0x2e')],'exitAt':null}});}})['then'](function(_0x12c751){if(_0x4874eb){if(_0x12c751&&_0x12c751[_0x91e0('0x2f')]){var _0x43db65=[];_0x12c751['forEach'](function(_0x43e3e3){_0x43db65[_0x91e0('0x35')](_0x43e3e3[_0x91e0('0x3f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x91e0('0x4d')](_0x43db65);}}})[_0x91e0('0x12')](function(){if(_0x4874eb){return _0x4874eb[_0x91e0('0x3f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x91e0('0x12')](function(_0x4e2c68){_0x440fa5(_0x4e2c68);})[_0x91e0('0x1b')](function(_0x22103d){_0x41a234(_0x5599bd['error'](0x1f4,_0x22103d[_0x91e0('0x1a')]));});});};exports[_0x91e0('0x4e')]=function(_0xeb2eeb){var _0x1842f1=this;return new Promise(function(_0x844fc,_0x5e2093){var _0x101cc9;var _0x317d41;var _0x28dcfb;var _0x20299f;return db[_0x91e0('0x1c')][_0x91e0('0x41')]({'where':_0xeb2eeb[_0x91e0('0x1e')][_0x91e0('0x20')]||{},'attributes':['id',_0x91e0('0x2e'),_0x91e0('0x3c'),_0x91e0('0x4f'),_0x91e0('0x50'),'internal',_0x91e0('0x51'),_0x91e0('0x2b')]})[_0x91e0('0x12')](function(_0x5eb992){if(_0x5eb992){_0x101cc9=_0x5eb992;_0x20299f=_0xeb2eeb['body'][_0x91e0('0x2b')]?_0xeb2eeb[_0x91e0('0x39')][_0x91e0('0x2b')]:util[_0x91e0('0x30')](_0x91e0('0x37'),_0x101cc9[_0x91e0('0x2e')]);return db['User'][_0x91e0('0x52')]({'where':{'role':_0x91e0('0x53'),'online':!![],'id':{'$ne':_0x101cc9['id']}}});}})[_0x91e0('0x12')](function(_0x537f5f){if(_0x537f5f){_0x28dcfb=_0x537f5f;return require(_0x91e0('0x54'))[_0x91e0('0x55')]();}})[_0x91e0('0x12')](function(_0x39c03d){if(_0x39c03d&&_0x39c03d[_0x91e0('0x56')]&&_0x28dcfb>=_0x39c03d['agents']){throw new Error(_0x91e0('0x57'));}})['then'](function(){if(_0x101cc9){return db[_0x91e0('0x2c')][_0x91e0('0x58')]({'where':{'membername':_0x101cc9['name']},'individualHooks':!![]});}})[_0x91e0('0x12')](function(){if(_0x101cc9){return _0x101cc9[_0x91e0('0x59')]({'raw':!![]});}})[_0x91e0('0x12')](function(_0x2f3c69){if(_0x101cc9){if(_0x2f3c69){var _0x2227eb=[];_0x317d41=_0x2f3c69;if(_0x317d41[_0x91e0('0x2f')]){for(var _0x348f74=0x0;_0x348f74<_0x317d41[_0x91e0('0x2f')];_0x348f74++){_0x2227eb['push'](db[_0x91e0('0x2c')][_0x91e0('0x5a')]({'membername':_0x101cc9[_0x91e0('0x2e')],'UserId':_0x101cc9['id'],'queue_name':_0x317d41[_0x348f74]['name'],'VoiceQueueId':_0x317d41[_0x348f74]['id'],'interface':_0x20299f,'paused':_0x101cc9[_0x91e0('0x51')]||![],'penalty':_0x317d41[_0x348f74][_0x91e0('0x5b')]||0x0}));}return BPromise[_0x91e0('0x4d')](_0x2227eb);}}}})[_0x91e0('0x12')](function(){if(_0x101cc9){return db[_0x91e0('0x2d')]['findAll']({'where':{'membername':_0x101cc9[_0x91e0('0x2e')],'exitAt':null}});}})[_0x91e0('0x12')](function(_0x47c717){if(_0x101cc9){if(_0x47c717&&_0x47c717['length']){var _0x15ee1c=[];_0x47c717[_0x91e0('0x34')](function(_0x55e407){_0x15ee1c[_0x91e0('0x35')](_0x55e407[_0x91e0('0x3f')]({'exitAt':moment()[_0x91e0('0x30')](_0x91e0('0x31'))}));});return BPromise[_0x91e0('0x4d')](_0x15ee1c);}}})[_0x91e0('0x12')](function(_0x49346e){if(_0x101cc9){var _0x1674f1=[];var _0x16868a=[];var _0x2d77ad=utils[_0x91e0('0x33')]();var _0x34c79f={'membername':_0x101cc9[_0x91e0('0x2e')],'interface':_0x20299f,'enterAt':moment()[_0x91e0('0x30')](_0x91e0('0x31')),'role':_0x101cc9[_0x91e0('0x3c')],'internal':_0x101cc9['internal']};_0x2d77ad['forEach'](function(_0x407453){_0x1674f1[_0x91e0('0x35')](_[_0x91e0('0x5c')]({'channel':_0x407453,'type':_0x91e0('0x5d'),'data1':_0x91e0('0x5e'),'data2':_0x20299f},_0x34c79f));if(_0x101cc9['loginInPause']){_0x16868a[_0x91e0('0x35')](_[_0x91e0('0x5c')]({'channel':_0x407453,'type':_0x91e0('0x38'),'data1':_0x91e0('0x5f')},_0x34c79f));}});return db[_0x91e0('0x2d')][_0x91e0('0x3e')](_0x1674f1['concat'](_0x16868a),{'individualHooks':!![]});}})[_0x91e0('0x12')](function(){if(_0x101cc9){return _0x101cc9[_0x91e0('0x3f')]({'online':!![],'lastLoginAt':moment()[_0x91e0('0x30')](_0x91e0('0x31')),'voicePause':_0x101cc9[_0x91e0('0x51')]||![],'mailPause':_0x101cc9[_0x91e0('0x51')]||![],'chatPause':_0x101cc9[_0x91e0('0x51')]||![],'faxPause':_0x101cc9[_0x91e0('0x51')]||![],'smsPause':_0x101cc9['loginInPause']||![],'openchannelPause':_0x101cc9[_0x91e0('0x51')]||![],'pauseType':_0x101cc9['loginInPause']?_0x91e0('0x5f'):null,'lastPauseAt':moment()[_0x91e0('0x30')](_0x91e0('0x31')),'interface':_0x20299f});}})[_0x91e0('0x12')](function(_0x2431af){_0x844fc(_0x2431af);})[_0x91e0('0x1b')](function(_0x575d9b){_0x5e2093(_0x1842f1[_0x91e0('0x18')](0x1f4,_0x575d9b[_0x91e0('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index bbb4283..9911c79 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 _0x4a68=['save','update','emit','removeListener','register','length','user:','./user.events'];(function(_0x575925,_0x8f5580){var _0x4f1902=function(_0x4149bc){while(--_0x4149bc){_0x575925['push'](_0x575925['shift']());}};_0x4f1902(++_0x8f5580);}(_0x4a68,0x9f));var _0x84a6=function(_0x10f48c,_0x208282){_0x10f48c=_0x10f48c-0x0;var _0x1234ee=_0x4a68[_0x10f48c];return _0x1234ee;};'use strict';var UserEvents=require(_0x84a6('0x0'));var events=[_0x84a6('0x1'),'remove',_0x84a6('0x2')];function createListener(_0x31d8af,_0x567521){return function(_0x13d128){_0x567521[_0x84a6('0x3')](_0x31d8af,_0x13d128);};}function removeListener(_0x4515ed,_0x38287b){return function(){UserEvents[_0x84a6('0x4')](_0x4515ed,_0x38287b);};}exports[_0x84a6('0x5')]=function(_0x2bf2e1){for(var _0x2218cb=0x0,_0x482324=events[_0x84a6('0x6')];_0x2218cb<_0x482324;_0x2218cb++){var _0x22e620=events[_0x2218cb];var _0x226a64=createListener(_0x84a6('0x7')+_0x22e620,_0x2bf2e1);UserEvents['on'](_0x22e620,_0x226a64);}}; \ No newline at end of file +var _0xa2c1=['length','user:','./user.events','remove','update','emit','register'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xa2c1,0x1b4));var _0x1a2c=function(_0x4099eb,_0x4e6d67){_0x4099eb=_0x4099eb-0x0;var _0x7637ee=_0xa2c1[_0x4099eb];return _0x7637ee;};'use strict';var UserEvents=require(_0x1a2c('0x0'));var events=['save',_0x1a2c('0x1'),_0x1a2c('0x2')];function createListener(_0xef8053,_0x5d6285){return function(_0x3d9b3a){_0x5d6285[_0x1a2c('0x3')](_0xef8053,_0x3d9b3a);};}function removeListener(_0x449e59,_0xc7d7a1){return function(){UserEvents['removeListener'](_0x449e59,_0xc7d7a1);};}exports[_0x1a2c('0x4')]=function(_0x371227){for(var _0x3d9951=0x0,_0x15cc78=events[_0x1a2c('0x5')];_0x3d9951<_0x15cc78;_0x3d9951++){var _0x1a161e=events[_0x3d9951];var _0x47d57a=createListener(_0x1a2c('0x6')+_0x1a161e,_0x371227);UserEvents['on'](_0x1a161e,_0x47d57a);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 6ac690d..a190c60 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4dc59e,_0x18a3bb){var _0x6a2efb=function(_0x81c23c){while(--_0x81c23c){_0x4dc59e['push'](_0x4dc59e['shift']());}};_0x6a2efb(++_0x18a3bb);}(_0x70e0,0x17b));var _0x070e=function(_0x5aa823,_0x49f101){_0x5aa823=_0x5aa823-0x0;var _0x5da949=_0x70e0[_0x5aa823];return _0x5da949;};'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(_0x227ec4,_0x38d0d5){var _0x3ce2d5=function(_0x1d338c){while(--_0x1d338c){_0x227ec4['push'](_0x227ec4['shift']());}};_0x3ce2d5(++_0x38d0d5);}(_0x70e0,0x17b));var _0x070e=function(_0x4b0959,_0xa50ec7){_0x4b0959=_0x4b0959-0x0;var _0x4f8f44=_0x70e0[_0x4b0959];return _0x4f8f44;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index ad63095..e15fe74 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 _0xc94e=['sequelize','INTEGER'];(function(_0x38f57d,_0x556c2e){var _0x538751=function(_0x15afdf){while(--_0x15afdf){_0x38f57d['push'](_0x38f57d['shift']());}};_0x538751(++_0x556c2e);}(_0xc94e,0x76));var _0xec94=function(_0x4cf77b,_0x33a365){_0x4cf77b=_0x4cf77b-0x0;var _0x2dcdd9=_0xc94e[_0x4cf77b];return _0x2dcdd9;};'use strict';var Sequelize=require(_0xec94('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xec94('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1597=['exports','INTEGER'];(function(_0x1f6251,_0x23b4a4){var _0x2ade1c=function(_0xdbbcb6){while(--_0xdbbcb6){_0x1f6251['push'](_0x1f6251['shift']());}};_0x2ade1c(++_0x23b4a4);}(_0x1597,0x192));var _0x7159=function(_0x4f0a3a,_0x14f8d9){_0x4f0a3a=_0x4f0a3a-0x0;var _0x430cca=_0x1597[_0x4f0a3a];return _0x430cca;};'use strict';var Sequelize=require('sequelize');module[_0x7159('0x0')]={'penalty':{'type':Sequelize[_0x7159('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 5e5a86a..91dcc92 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 _0x9d06=['lodash','api','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues'];(function(_0x284d70,_0x4e5330){var _0x5a40f8=function(_0x5507e7){while(--_0x5507e7){_0x284d70['push'](_0x284d70['shift']());}};_0x5a40f8(++_0x4e5330);}(_0x9d06,0x96));var _0x69d0=function(_0x11999a,_0x4b47a5){_0x11999a=_0x11999a-0x0;var _0x3fa4d0=_0x9d06[_0x11999a];return _0x3fa4d0;};'use strict';var _=require(_0x69d0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x69d0('0x1'));var moment=require('moment');var BPromise=require(_0x69d0('0x2'));var rp=require(_0x69d0('0x3'));var fs=require('fs');var path=require(_0x69d0('0x4'));var rimraf=require(_0x69d0('0x5'));var config=require('../../config/environment');var attributes=require(_0x69d0('0x6'));module['exports']=function(_0x196b0d,_0x433023){return _0x196b0d[_0x69d0('0x7')](_0x69d0('0x8'),attributes,{'tableName':_0x69d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82a2=['./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x154459,_0x42dfcc){var _0x4899a5=function(_0x5576de){while(--_0x5576de){_0x154459['push'](_0x154459['shift']());}};_0x4899a5(++_0x42dfcc);}(_0x82a2,0x1ee));var _0x282a=function(_0x49d8b6,_0x77eb60){_0x49d8b6=_0x49d8b6-0x0;var _0x3458bd=_0x82a2[_0x49d8b6];return _0x3458bd;};'use strict';var _=require('lodash');var util=require(_0x282a('0x0'));var logger=require(_0x282a('0x1'))(_0x282a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x282a('0x3'));var fs=require('fs');var path=require(_0x282a('0x4'));var rimraf=require(_0x282a('0x5'));var config=require('../../config/environment');var attributes=require(_0x282a('0x6'));module[_0x282a('0x7')]=function(_0x5e2247,_0x264396){return _0x5e2247['define'](_0x282a('0x8'),attributes,{'tableName':_0x282a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 882f97b..9d584c6 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 _0xe1d4=['UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x57e3e6,_0x3553b8){var _0x4d8126=function(_0x5b3825){while(--_0x5b3825){_0x57e3e6['push'](_0x57e3e6['shift']());}};_0x4d8126(++_0x3553b8);}(_0xe1d4,0x17a));var _0x4e1d=function(_0x1c25ae,_0x2fa6c8){_0x1c25ae=_0x1c25ae-0x0;var _0xfc9667=_0xe1d4[_0x1c25ae];return _0xfc9667;};'use strict';var _=require(_0x4e1d('0x0'));var util=require(_0x4e1d('0x1'));var moment=require(_0x4e1d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e1d('0x3'));var db=require(_0x4e1d('0x4'))['db'];var utils=require(_0x4e1d('0x5'));var logger=require(_0x4e1d('0x6'))(_0x4e1d('0x7'));var config=require(_0x4e1d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4e1d('0x9')][_0x4e1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x115c58,_0x81307d,_0x415274){return new BPromise(function(_0x3e7a6a,_0x4c3384){return client[_0x4e1d('0xb')](_0x115c58,_0x415274)[_0x4e1d('0xc')](function(_0x5d32f5){logger[_0x4e1d('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x81307d,'request\x20sent');logger['debug'](_0x4e1d('0xe'),_0x81307d,_0x4e1d('0xf'),JSON['stringify'](_0x5d32f5));if(_0x5d32f5[_0x4e1d('0x10')]){if(_0x5d32f5['error'][_0x4e1d('0x11')]===0x1f4){logger['error'](_0x4e1d('0x12'),_0x81307d,_0x5d32f5[_0x4e1d('0x10')][_0x4e1d('0x13')]);return _0x4c3384(_0x5d32f5[_0x4e1d('0x10')]['message']);}logger[_0x4e1d('0x10')](_0x4e1d('0x12'),_0x81307d,_0x5d32f5[_0x4e1d('0x10')][_0x4e1d('0x13')]);return _0x3e7a6a(_0x5d32f5[_0x4e1d('0x10')][_0x4e1d('0x13')]);}else{logger[_0x4e1d('0xd')](_0x4e1d('0x12'),_0x81307d,_0x4e1d('0xf'));_0x3e7a6a(_0x5d32f5[_0x4e1d('0x14')][_0x4e1d('0x13')]);}})[_0x4e1d('0x15')](function(_0x1df903){logger[_0x4e1d('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x81307d,_0x1df903);_0x4c3384(_0x1df903);});});} \ No newline at end of file +var _0x29cb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring'];(function(_0x1ef1fd,_0x4f6b60){var _0x5031d4=function(_0x470071){while(--_0x470071){_0x1ef1fd['push'](_0x1ef1fd['shift']());}};_0x5031d4(++_0x4f6b60);}(_0x29cb,0x1d8));var _0xb29c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x29cb[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb29c('0x0'));var BPromise=require(_0xb29c('0x1'));var rs=require(_0xb29c('0x2'));var fs=require('fs');var Redis=require(_0xb29c('0x3'));var db=require(_0xb29c('0x4'))['db'];var utils=require(_0xb29c('0x5'));var logger=require(_0xb29c('0x6'))(_0xb29c('0x7'));var config=require(_0xb29c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb29c('0x9')][_0xb29c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40b4cf,_0xa74856,_0x205307){return new BPromise(function(_0x8fab6d,_0x2d4052){return client['request'](_0x40b4cf,_0x205307)['then'](function(_0x4dbc36){logger['info'](_0xb29c('0xb'),_0xa74856,'request\x20sent');logger['debug'](_0xb29c('0xc'),_0xa74856,_0xb29c('0xd'),JSON[_0xb29c('0xe')](_0x4dbc36));if(_0x4dbc36[_0xb29c('0xf')]){if(_0x4dbc36['error'][_0xb29c('0x10')]===0x1f4){logger[_0xb29c('0xf')]('UserChatQueue,\x20%s,\x20%s',_0xa74856,_0x4dbc36[_0xb29c('0xf')][_0xb29c('0x11')]);return _0x2d4052(_0x4dbc36[_0xb29c('0xf')][_0xb29c('0x11')]);}logger[_0xb29c('0xf')](_0xb29c('0xb'),_0xa74856,_0x4dbc36['error']['message']);return _0x8fab6d(_0x4dbc36['error'][_0xb29c('0x11')]);}else{logger['info'](_0xb29c('0xb'),_0xa74856,'request\x20sent');_0x8fab6d(_0x4dbc36[_0xb29c('0x12')][_0xb29c('0x11')]);}})['catch'](function(_0x5e197b){logger['error'](_0xb29c('0xb'),_0xa74856,_0x5e197b);_0x2d4052(_0x5e197b);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index ddda1fa..0ccd41f 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3eae7f,_0x33064f){var _0x353603=function(_0x127d6b){while(--_0x127d6b){_0x3eae7f['push'](_0x3eae7f['shift']());}};_0x353603(++_0x33064f);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1cf0b3,_0x2637af){var _0x1a516e=function(_0x11ee29){while(--_0x11ee29){_0x1cf0b3['push'](_0x1cf0b3['shift']());}};_0x1a516e(++_0x2637af);}(_0x70e0,0x17b));var _0x070e=function(_0xc1f02a,_0x870e07){_0xc1f02a=_0xc1f02a-0x0;var _0x1fd5db=_0x70e0[_0xc1f02a];return _0x1fd5db;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 319b57b..dc86ba7 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 _0x310f=['INTEGER','sequelize','exports'];(function(_0x278416,_0x3ba397){var _0x25f0f1=function(_0x2bc4bd){while(--_0x2bc4bd){_0x278416['push'](_0x278416['shift']());}};_0x25f0f1(++_0x3ba397);}(_0x310f,0xb8));var _0xf310=function(_0xd51dbc,_0x595f06){_0xd51dbc=_0xd51dbc-0x0;var _0x3c033f=_0x310f[_0xd51dbc];return _0x3c033f;};'use strict';var Sequelize=require(_0xf310('0x0'));module[_0xf310('0x1')]={'penalty':{'type':Sequelize[_0xf310('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf310('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xed89=['STRING','sequelize','INTEGER'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xed89,0x1ae));var _0x9ed8=function(_0x4e1e83,_0x4efcd0){_0x4e1e83=_0x4e1e83-0x0;var _0x2081ca=_0xed89[_0x4e1e83];return _0x2081ca;};'use strict';var Sequelize=require(_0x9ed8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9ed8('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9ed8('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9ed8('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 2af5098..fcd3252 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 _0x1949=['bluebird','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x49279c,_0x56da65){var _0x472c04=function(_0x6b5a3d){while(--_0x6b5a3d){_0x49279c['push'](_0x49279c['shift']());}};_0x472c04(++_0x56da65);}(_0x1949,0x1df));var _0x9194=function(_0x1379c1,_0x1537c7){_0x1379c1=_0x1379c1-0x0;var _0x448c09=_0x1949[_0x1379c1];return _0x448c09;};'use strict';var _=require(_0x9194('0x0'));var util=require(_0x9194('0x1'));var logger=require(_0x9194('0x2'))(_0x9194('0x3'));var moment=require(_0x9194('0x4'));var BPromise=require(_0x9194('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9194('0x6'));var rimraf=require(_0x9194('0x7'));var config=require(_0x9194('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0x9194('0x9')]=function(_0x302762,_0x37381a){return _0x302762[_0x9194('0xa')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e1c=['../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x7d9e6a,_0x9346c4){var _0x56828b=function(_0x2b7990){while(--_0x2b7990){_0x7d9e6a['push'](_0x7d9e6a['shift']());}};_0x56828b(++_0x9346c4);}(_0x1e1c,0x87));var _0xc1e1=function(_0x201262,_0x3e4cb3){_0x201262=_0x201262-0x0;var _0x28c662=_0x1e1c[_0x201262];return _0x28c662;};'use strict';var _=require(_0xc1e1('0x0'));var util=require(_0xc1e1('0x1'));var logger=require(_0xc1e1('0x2'))(_0xc1e1('0x3'));var moment=require(_0xc1e1('0x4'));var BPromise=require(_0xc1e1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1e1('0x6'));var rimraf=require(_0xc1e1('0x7'));var config=require(_0xc1e1('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0xc1e1('0x9')]=function(_0x170b34,_0x1f8c66){return _0x170b34[_0xc1e1('0xa')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 18efe19..7d40d55 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 _0xe048=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x49c9b5,_0x4725f8){var _0x4ccbd7=function(_0x1f5a84){while(--_0x1f5a84){_0x49c9b5['push'](_0x49c9b5['shift']());}};_0x4ccbd7(++_0x4725f8);}(_0xe048,0x9b));var _0x8e04=function(_0x54dc48,_0x2fd890){_0x54dc48=_0x54dc48-0x0;var _0x46a1cb=_0xe048[_0x54dc48];return _0x46a1cb;};'use strict';var _=require(_0x8e04('0x0'));var util=require('util');var moment=require(_0x8e04('0x1'));var BPromise=require(_0x8e04('0x2'));var rs=require(_0x8e04('0x3'));var fs=require('fs');var Redis=require(_0x8e04('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e04('0x5'));var logger=require(_0x8e04('0x6'))(_0x8e04('0x7'));var config=require('../../config/environment');var jayson=require(_0x8e04('0x8'));var client=jayson[_0x8e04('0x9')][_0x8e04('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130eb1,_0x18146e,_0x10eeb5){return new BPromise(function(_0x30b987,_0x150181){return client['request'](_0x130eb1,_0x10eeb5)[_0x8e04('0xb')](function(_0x3e95dd){logger[_0x8e04('0xc')](_0x8e04('0xd'),_0x18146e,_0x8e04('0xe'));logger[_0x8e04('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x18146e,'request\x20sent',JSON['stringify'](_0x3e95dd));if(_0x3e95dd[_0x8e04('0x10')]){if(_0x3e95dd[_0x8e04('0x10')][_0x8e04('0x11')]===0x1f4){logger[_0x8e04('0x10')](_0x8e04('0xd'),_0x18146e,_0x3e95dd[_0x8e04('0x10')][_0x8e04('0x12')]);return _0x150181(_0x3e95dd[_0x8e04('0x10')]['message']);}logger[_0x8e04('0x10')](_0x8e04('0xd'),_0x18146e,_0x3e95dd[_0x8e04('0x10')][_0x8e04('0x12')]);return _0x30b987(_0x3e95dd[_0x8e04('0x10')][_0x8e04('0x12')]);}else{logger[_0x8e04('0xc')](_0x8e04('0xd'),_0x18146e,'request\x20sent');_0x30b987(_0x3e95dd[_0x8e04('0x13')][_0x8e04('0x12')]);}})[_0x8e04('0x14')](function(_0x15658e){logger[_0x8e04('0x10')](_0x8e04('0xd'),_0x18146e,_0x15658e);_0x150181(_0x15658e);});});} \ No newline at end of file +var _0x97b9=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x97b9,0xbb));var _0x997b=function(_0x587858,_0x5663e6){_0x587858=_0x587858-0x0;var _0x2c06b2=_0x97b9[_0x587858];return _0x2c06b2;};'use strict';var _=require(_0x997b('0x0'));var util=require(_0x997b('0x1'));var moment=require('moment');var BPromise=require(_0x997b('0x2'));var rs=require(_0x997b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x997b('0x4'))['db'];var utils=require(_0x997b('0x5'));var logger=require(_0x997b('0x6'))('rpc');var config=require(_0x997b('0x7'));var jayson=require(_0x997b('0x8'));var client=jayson[_0x997b('0x9')][_0x997b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506dcd,_0x4b1e00,_0xaca5c0){return new BPromise(function(_0x266e1b,_0x458280){return client[_0x997b('0xb')](_0x506dcd,_0xaca5c0)[_0x997b('0xc')](function(_0x5055a8){logger['info'](_0x997b('0xd'),_0x4b1e00,_0x997b('0xe'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4b1e00,_0x997b('0xe'),JSON[_0x997b('0xf')](_0x5055a8));if(_0x5055a8[_0x997b('0x10')]){if(_0x5055a8[_0x997b('0x10')]['code']===0x1f4){logger['error'](_0x997b('0xd'),_0x4b1e00,_0x5055a8['error'][_0x997b('0x11')]);return _0x458280(_0x5055a8[_0x997b('0x10')][_0x997b('0x11')]);}logger['error'](_0x997b('0xd'),_0x4b1e00,_0x5055a8[_0x997b('0x10')][_0x997b('0x11')]);return _0x266e1b(_0x5055a8[_0x997b('0x10')][_0x997b('0x11')]);}else{logger['info'](_0x997b('0xd'),_0x4b1e00,'request\x20sent');_0x266e1b(_0x5055a8[_0x997b('0x12')][_0x997b('0x11')]);}})[_0x997b('0x13')](function(_0xb7f4b5){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4b1e00,_0xb7f4b5);_0x458280(_0xb7f4b5);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index a65a5af..d5793bc 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3d990a,_0x44fba7){var _0x257aca=function(_0x184e21){while(--_0x184e21){_0x3d990a['push'](_0x3d990a['shift']());}};_0x257aca(++_0x44fba7);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xff4075,_0x7d6e69){var _0x286922=function(_0x3e6df4){while(--_0x3e6df4){_0xff4075['push'](_0xff4075['shift']());}};_0x286922(++_0x7d6e69);}(_0x70e0,0x17b));var _0x070e=function(_0x137773,_0x23e2ec){_0x137773=_0x137773-0x0;var _0x168cf6=_0x70e0[_0x137773];return _0x168cf6;};'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 ba1eb9f..27eff01 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 _0x8a86=['exports'];(function(_0x8dd628,_0x190bce){var _0x16945e=function(_0x5688ce){while(--_0x5688ce){_0x8dd628['push'](_0x8dd628['shift']());}};_0x16945e(++_0x190bce);}(_0x8a86,0xd6));var _0x68a8=function(_0x1cbc8a,_0x456d41){_0x1cbc8a=_0x1cbc8a-0x0;var _0x36617a=_0x8a86[_0x1cbc8a];return _0x36617a;};'use strict';var Sequelize=require('sequelize');module[_0x68a8('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb2f4=['exports','INTEGER','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb2f4,0x14f));var _0x4b2f=function(_0x276de9,_0x2c2f75){_0x276de9=_0x276de9-0x0;var _0xbac321=_0xb2f4[_0x276de9];return _0xbac321;};'use strict';var Sequelize=require(_0x4b2f('0x0'));module[_0x4b2f('0x1')]={'penalty':{'type':Sequelize[_0x4b2f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 713fa3b..167fcfc 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 _0x1795=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x1795,0x1c6));var _0x5179=function(_0x378e1a,_0x5f3e17){_0x378e1a=_0x378e1a-0x0;var _0x4b93e1=_0x1795[_0x378e1a];return _0x4b93e1;};'use strict';var _=require(_0x5179('0x0'));var util=require(_0x5179('0x1'));var logger=require(_0x5179('0x2'))(_0x5179('0x3'));var moment=require('moment');var BPromise=require(_0x5179('0x4'));var rp=require(_0x5179('0x5'));var fs=require('fs');var path=require(_0x5179('0x6'));var rimraf=require(_0x5179('0x7'));var config=require('../../config/environment');var attributes=require(_0x5179('0x8'));module[_0x5179('0x9')]=function(_0x114164,_0xcc487){return _0x114164[_0x5179('0xa')](_0x5179('0xb'),attributes,{'tableName':_0x5179('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a77=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','UserMailQueue','lodash','../../config/logger'];(function(_0x381677,_0x372171){var _0x33b10a=function(_0x4679e2){while(--_0x4679e2){_0x381677['push'](_0x381677['shift']());}};_0x33b10a(++_0x372171);}(_0x3a77,0x1ed));var _0x73a7=function(_0x3b3750,_0x28f3b8){_0x3b3750=_0x3b3750-0x0;var _0x1b9e8b=_0x3a77[_0x3b3750];return _0x1b9e8b;};'use strict';var _=require(_0x73a7('0x0'));var util=require('util');var logger=require(_0x73a7('0x1'))(_0x73a7('0x2'));var moment=require(_0x73a7('0x3'));var BPromise=require(_0x73a7('0x4'));var rp=require(_0x73a7('0x5'));var fs=require('fs');var path=require(_0x73a7('0x6'));var rimraf=require('rimraf');var config=require(_0x73a7('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x73a7('0x8')]=function(_0x1103a7,_0xeb00f4){return _0x1103a7[_0x73a7('0x9')](_0x73a7('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 94aff93..a76fdbe 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x304d10,_0x2fd51c){var _0x35dcf1=function(_0x357c8a){while(--_0x357c8a){_0x304d10['push'](_0x304d10['shift']());}};_0x35dcf1(++_0x2fd51c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x00bb[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x9a30dc,_0x533531){var _0x1956bf=function(_0x4fa9a1){while(--_0x4fa9a1){_0x9a30dc['push'](_0x9a30dc['shift']());}};_0x1956bf(++_0x533531);}(_0x34e8,0x12c));var _0x834e=function(_0x5a76dc,_0x270dfe){_0x5a76dc=_0x5a76dc-0x0;var _0x76628b=_0x34e8[_0x5a76dc];return _0x76628b;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index d3e95c3..a305fc6 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 _0x7c2e=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification'];(function(_0x301c3f,_0x242747){var _0x2659c3=function(_0x185b4a){while(--_0x185b4a){_0x301c3f['push'](_0x301c3f['shift']());}};_0x2659c3(++_0x242747);}(_0x7c2e,0x161));var _0xe7c2=function(_0x16c5b4,_0x27311d){_0x16c5b4=_0x16c5b4-0x0;var _0x3a4eda=_0x7c2e[_0x16c5b4];return _0x3a4eda;};'use strict';var multer=require(_0xe7c2('0x0'));var util=require(_0xe7c2('0x1'));var path=require('path');var timeout=require(_0xe7c2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe7c2('0x3'));var auth=require(_0xe7c2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe7c2('0x5'));var controller=require(_0xe7c2('0x6'));router[_0xe7c2('0x7')]('/',auth[_0xe7c2('0x8')](),controller[_0xe7c2('0x9')]);module[_0xe7c2('0xa')]=router; \ No newline at end of file +var _0x220b=['../../config/environment','post','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x139405,_0x99fc12){var _0x4c9f3a=function(_0x260567){while(--_0x260567){_0x139405['push'](_0x139405['shift']());}};_0x4c9f3a(++_0x99fc12);}(_0x220b,0x190));var _0xb220=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0x220b[_0x595bd1];return _0xd0344f;};'use strict';var multer=require(_0xb220('0x0'));var util=require(_0xb220('0x1'));var path=require(_0xb220('0x2'));var timeout=require(_0xb220('0x3'));var express=require(_0xb220('0x4'));var router=express[_0xb220('0x5')]();var fs_extra=require(_0xb220('0x6'));var auth=require(_0xb220('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb220('0x8'));var controller=require('./userNotification.controller');router[_0xb220('0x9')]('/',auth['isAuthenticated'](),controller[_0xb220('0xa')]);module[_0xb220('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 73de641..f8af6c0 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 _0x3510=['exports','STRING','TEXT','BOOLEAN','sequelize'];(function(_0x107372,_0x622210){var _0x44329d=function(_0x5e3cf1){while(--_0x5e3cf1){_0x107372['push'](_0x107372['shift']());}};_0x44329d(++_0x622210);}(_0x3510,0x194));var _0x0351=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x3510[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x0351('0x0'));module[_0x0351('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x0351('0x2')]},'recipientsId':{'type':Sequelize[_0x0351('0x3')]},'recipientsDescription':{'type':Sequelize[_0x0351('0x2')]},'beep':{'type':Sequelize[_0x0351('0x4')]}}; \ No newline at end of file +var _0xae41=['TEXT','STRING','sequelize'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0xae41,0x1cd));var _0x1ae4=function(_0x442528,_0x107937){_0x442528=_0x442528-0x0;var _0xc5b336=_0xae41[_0x442528];return _0xc5b336;};'use strict';var Sequelize=require(_0x1ae4('0x0'));module['exports']={'body':{'type':Sequelize[_0x1ae4('0x1')]},'senderName':{'type':Sequelize[_0x1ae4('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x1ae4('0x2')]},'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 cfa58ff..fd197b4 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 _0x6cbf=['voicequeue','user','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','User','union','replace','Queue','ids','push','all','flatten','getAgents','map','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','name','sendUserNotification','hasOwnProperty','text','body','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','error','chatqueue','faxqueue','mailqueue','smsqueue'];(function(_0x43f967,_0xb4b42d){var _0xfd6032=function(_0x37be33){while(--_0x37be33){_0x43f967['push'](_0x43f967['shift']());}};_0xfd6032(++_0xb4b42d);}(_0x6cbf,0x7f));var _0xf6cb=function(_0x2421db,_0x544331){_0x2421db=_0x2421db-0x0;var _0x30c6e2=_0x6cbf[_0x2421db];return _0x30c6e2;};'use strict';var emlformat=require(_0xf6cb('0x0'));var rimraf=require(_0xf6cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf6cb('0x2'));var moment=require(_0xf6cb('0x3'));var BPromise=require(_0xf6cb('0x4'));var Mustache=require(_0xf6cb('0x5'));var util=require('util');var path=require(_0xf6cb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf6cb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6cb('0x8'));var squel=require(_0xf6cb('0x9'));var crypto=require(_0xf6cb('0xa'));var jsforce=require(_0xf6cb('0xb'));var deskjs=require(_0xf6cb('0xc'));var toCsv=require(_0xf6cb('0xd'));var querystring=require('querystring');var Papa=require(_0xf6cb('0xe'));var Redis=require(_0xf6cb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf6cb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6cb('0x11'));var logger=require('../../config/logger')(_0xf6cb('0x12'));var utils=require(_0xf6cb('0x13'));var config=require(_0xf6cb('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf6cb('0x15'))['db'];config['redis']=_[_0xf6cb('0x16')](config['redis'],{'host':_0xf6cb('0x17'),'port':0x18eb});var socket=require(_0xf6cb('0x18'))(new Redis(config[_0xf6cb('0x19')]));require('./userNotification.socket')[_0xf6cb('0x1a')](socket);function respondWithStatusCode(_0x271719,_0x2d95d5){_0x2d95d5=_0x2d95d5||0xcc;return function(_0x33f75f){if(_0x33f75f){return _0x271719[_0xf6cb('0x1b')](_0x2d95d5);}return _0x271719[_0xf6cb('0x1c')](_0x2d95d5)[_0xf6cb('0x1d')]();};}function respondWithResult(_0x2c7582,_0x2c453c){_0x2c453c=_0x2c453c||0xc8;return function(_0x10c180){if(_0x10c180){return _0x2c7582['status'](_0x2c453c)[_0xf6cb('0x1e')](_0x10c180);}};}function respondWithFilteredResult(_0x209237,_0x559f39){return function(_0x551fb6){if(_0x551fb6){var _0x392f0b=typeof _0x559f39['offset']===_0xf6cb('0x1f')&&typeof _0x559f39[_0xf6cb('0x20')]===_0xf6cb('0x1f');var _0x22ff33=_0x551fb6['count'];var _0x1c4c22=_0x392f0b?0x0:_0x559f39[_0xf6cb('0x21')];var _0x286868=_0x392f0b?_0x551fb6[_0xf6cb('0x22')]:_0x559f39[_0xf6cb('0x21')]+_0x559f39['limit'];var _0x5bc55b;if(_0x286868>=_0x22ff33){_0x286868=_0x22ff33;_0x5bc55b=0xc8;}else{_0x5bc55b=0xce;}_0x209237['status'](_0x5bc55b);return _0x209237[_0xf6cb('0x23')](_0xf6cb('0x24'),_0x1c4c22+'-'+_0x286868+'/'+_0x22ff33)[_0xf6cb('0x1e')](_0x551fb6);}return null;};}function patchUpdates(_0x1074a9){return function(_0x475c76){try{jsonpatch[_0xf6cb('0x25')](_0x475c76,_0x1074a9,!![]);}catch(_0x460432){return BPromise['reject'](_0x460432);}return _0x475c76[_0xf6cb('0x26')]();};}function saveUpdates(_0x30803e,_0x15f548){return function(_0x4e72f7){if(_0x4e72f7){return _0x4e72f7[_0xf6cb('0x27')](_0x30803e)[_0xf6cb('0x28')](function(_0x28f55f){return _0x28f55f;});}return null;};}function removeEntity(_0x902354,_0x835428){return function(_0x4b96ae){if(_0x4b96ae){return _0x4b96ae['destroy']()[_0xf6cb('0x28')](function(){_0x902354[_0xf6cb('0x1c')](0xcc)[_0xf6cb('0x1d')]();});}};}function handleEntityNotFound(_0x5daef6,_0x5e5fc){return function(_0x413ca3){if(!_0x413ca3){_0x5daef6[_0xf6cb('0x1b')](0x194);}return _0x413ca3;};}function handleError(_0x6f8398,_0x1da785){_0x1da785=_0x1da785||0x1f4;return function(_0x4cf1ce){logger['error'](_0x4cf1ce['stack']);if(_0x4cf1ce[_0xf6cb('0x29')]){delete _0x4cf1ce['name'];}_0x6f8398[_0xf6cb('0x1c')](_0x1da785)['send'](_0x4cf1ce);};}exports[_0xf6cb('0x2a')]=function(_0x95fd0,_0x3f5025,_0x51ba2c){if(!_0x95fd0['body'][_0xf6cb('0x2b')](_0xf6cb('0x2c'))&&!_0x95fd0[_0xf6cb('0x2d')][_0xf6cb('0x2b')]('TemplateId')){throw new db[(_0xf6cb('0x2e'))][(_0xf6cb('0x2f'))](_0xf6cb('0x30'));}else{if(_0x95fd0['body']['hasOwnProperty']('TemplateId')&&!_0x95fd0[_0xf6cb('0x2d')][_0xf6cb('0x2b')](_0xf6cb('0x31'))){throw new db[(_0xf6cb('0x2e'))][(_0xf6cb('0x2f'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x95fd0[_0xf6cb('0x2d')]['hasOwnProperty'](_0xf6cb('0x32'))){throw new db[(_0xf6cb('0x2e'))][(_0xf6cb('0x2f'))](_0xf6cb('0x33'));}else{try{var _0x1c48db=JSON['parse'](_0x95fd0['body'][_0xf6cb('0x32')]);}catch(_0x57d54f){logger[_0xf6cb('0x34')](_0x57d54f);throw new db[(_0xf6cb('0x2e'))][(_0xf6cb('0x2f'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x2ef85a=[_0xf6cb('0x35'),_0xf6cb('0x36'),_0xf6cb('0x37'),'openchannelqueue',_0xf6cb('0x38'),_0xf6cb('0x39'),'whatsappqueue','team',_0xf6cb('0x3a')];if(_[_0xf6cb('0x3b')](_0x1c48db,function(_0x3944e5){return!_[_0xf6cb('0x3c')](_0x2ef85a,_0x3944e5[_0xf6cb('0x3d')][_0xf6cb('0x3e')]());})){throw new db[(_0xf6cb('0x2e'))][(_0xf6cb('0x2f'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x1faac0={};_0x1faac0[_0xf6cb('0x3f')]=_0x95fd0[_0xf6cb('0x2d')]['hasOwnProperty']('senderName')?_0x95fd0[_0xf6cb('0x2d')][_0xf6cb('0x3f')]:_0x95fd0[_0xf6cb('0x3a')][_0xf6cb('0x40')];_0x1faac0[_0xf6cb('0x41')]=_[_0xf6cb('0x42')](_0x95fd0[_0xf6cb('0x2d')][_0xf6cb('0x41')])?null:_0x95fd0['body'][_0xf6cb('0x41')];_0x1faac0[_0xf6cb('0x43')]=_0x95fd0[_0xf6cb('0x2d')]['beep']||![];_0x1faac0[_0xf6cb('0x44')]=_0x95fd0[_0xf6cb('0x3a')]['id'];return getContent(_0x95fd0['body'])[_0xf6cb('0x28')](function(_0x3d6147){_0x1faac0[_0xf6cb('0x2d')]=_0x3d6147;return getRecipients(_0x1c48db);})['then'](function(_0x2815f4){_0x1faac0[_0xf6cb('0x45')]=_['sortBy'](_0x2815f4)[_0xf6cb('0x46')](',');return db[_0xf6cb('0x47')]['transaction'](function(_0x488a83){return db[_0xf6cb('0x48')][_0xf6cb('0x49')](_0x1faac0,{'raw':!![],'transaction':_0x488a83})['then'](function(_0x2b3244){var _0x1f5016={'sender':_0x1faac0[_0xf6cb('0x3f')],'description':_0x1faac0[_0xf6cb('0x41')],'content':_0x1faac0[_0xf6cb('0x2d')],'beep':_0x1faac0[_0xf6cb('0x43')]};_0x2815f4[_0xf6cb('0x4a')](function(_0x505bb9){_0x1f5016[_0xf6cb('0x4b')]=_0x505bb9;socket[_0xf6cb('0x4c')](_0xf6cb('0x4d'),_0x1f5016);});return _0x2b3244;});});})[_0xf6cb('0x28')](respondWithResult(_0x3f5025,0xc9))[_0xf6cb('0x4e')](handleError(_0x3f5025,null));};function getContent(_0x23cd78){return new BPromise(function(_0x5ef244,_0x5db691){if(_0x23cd78[_0xf6cb('0x2c')]){_0x5ef244(_0x23cd78[_0xf6cb('0x2c')]);return;}return db[_0xf6cb('0x4f')][_0xf6cb('0x50')]({'attributes':[_0xf6cb('0x51')],'where':{'id':_0x23cd78['TemplateId']},'raw':!![]})[_0xf6cb('0x28')](function(_0x5921a1){if(!_0x5921a1)throw new db[(_0xf6cb('0x2e'))][(_0xf6cb('0x2f'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x1a9327=Mustache['render'](_0x5921a1[_0xf6cb('0x51')],_0x23cd78[_0xf6cb('0x31')]);_0x5ef244(_0x1a9327);})[_0xf6cb('0x4e')](function(_0x4cd91f){_0x5db691(_0x4cd91f);});});}function getRecipients(_0x5ab700){return new BPromise(function(_0xdb7e9b,_0x168ad1){var _0x4bea7d=[];var _0x3cd427=[];_0x5ab700[_0xf6cb('0x4a')](function(_0x503e32){var _0x5052d6=_['startCase'](_0x503e32['model'][_0xf6cb('0x3e')]());if(_0x5052d6===_0xf6cb('0x52')){_0x4bea7d=_[_0xf6cb('0x53')](_0x4bea7d,_0x503e32['ids']);}else{if(_['includes'](_0x5052d6,'queue'))_0x5052d6=_0x5052d6[_0xf6cb('0x54')]('queue',_0xf6cb('0x55'));_0x503e32[_0xf6cb('0x56')]['forEach'](function(_0x48aeb0){_0x3cd427[_0xf6cb('0x57')](getAgents(_0x5052d6,_0x48aeb0));});}});return BPromise[_0xf6cb('0x58')](_0x3cd427)[_0xf6cb('0x28')](function(_0x23b95a){_0x4bea7d=_[_0xf6cb('0x53')](_0x4bea7d,_[_0xf6cb('0x59')](_0x23b95a));_0xdb7e9b(_0x4bea7d);})['catch'](function(_0xfcb415){_0x168ad1(_0xfcb415);});});}function getAgents(_0x184c52,_0x571af4){return new BPromise(function(_0x111efa,_0x317043){return db[_0x184c52][_0xf6cb('0x50')]({'where':{'id':_0x571af4}})[_0xf6cb('0x28')](function(_0x503637){return _0x503637[_0xf6cb('0x5a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x17888b){var _0x2dd072=_[_0xf6cb('0x5b')](_0x17888b,'id');_0x111efa(_0x2dd072);});})[_0xf6cb('0x4e')](function(_0x51f02d){_0x317043(_0x51f02d);});});} \ No newline at end of file +var _0xa9f9=['push','all','union','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','smsqueue','voicequeue','whatsappqueue','user','some','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','then','recipientsId','join','sequelize','transaction','create','forEach','recipient','emit','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','html','startCase','model','User','ids','includes','queue','replace'];(function(_0x1e9ae1,_0x10dc5d){var _0xc6bc15=function(_0x1a6a7d){while(--_0x1a6a7d){_0x1e9ae1['push'](_0x1e9ae1['shift']());}};_0xc6bc15(++_0x10dc5d);}(_0xa9f9,0x191));var _0x9a9f=function(_0x54a973,_0x4552f8){_0x54a973=_0x54a973-0x0;var _0x3176e2=_0xa9f9[_0x54a973];return _0x3176e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a9f('0x0'));var zipdir=require(_0x9a9f('0x1'));var jsonpatch=require(_0x9a9f('0x2'));var rp=require(_0x9a9f('0x3'));var moment=require(_0x9a9f('0x4'));var BPromise=require(_0x9a9f('0x5'));var Mustache=require(_0x9a9f('0x6'));var util=require(_0x9a9f('0x7'));var path=require('path');var sox=require(_0x9a9f('0x8'));var csv=require(_0x9a9f('0x9'));var ejs=require(_0x9a9f('0xa'));var fs=require('fs');var fs_extra=require(_0x9a9f('0xb'));var _=require(_0x9a9f('0xc'));var squel=require(_0x9a9f('0xd'));var crypto=require('crypto');var jsforce=require(_0x9a9f('0xe'));var deskjs=require(_0x9a9f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9a9f('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a9f('0x11'));var authService=require(_0x9a9f('0x12'));var qs=require(_0x9a9f('0x13'));var as=require(_0x9a9f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9a9f('0x15'));var config=require(_0x9a9f('0x16'));var licenseUtil=require(_0x9a9f('0x17'));var db=require(_0x9a9f('0x18'))['db'];config[_0x9a9f('0x19')]=_[_0x9a9f('0x1a')](config[_0x9a9f('0x19')],{'host':_0x9a9f('0x1b'),'port':0x18eb});var socket=require(_0x9a9f('0x1c'))(new Redis(config['redis']));require('./userNotification.socket')[_0x9a9f('0x1d')](socket);function respondWithStatusCode(_0x5dcede,_0x5b4bb7){_0x5b4bb7=_0x5b4bb7||0xcc;return function(_0x2d72e3){if(_0x2d72e3){return _0x5dcede[_0x9a9f('0x1e')](_0x5b4bb7);}return _0x5dcede[_0x9a9f('0x1f')](_0x5b4bb7)[_0x9a9f('0x20')]();};}function respondWithResult(_0x46ec2a,_0x341db8){_0x341db8=_0x341db8||0xc8;return function(_0x2ed957){if(_0x2ed957){return _0x46ec2a[_0x9a9f('0x1f')](_0x341db8)[_0x9a9f('0x21')](_0x2ed957);}};}function respondWithFilteredResult(_0x9910c8,_0x3ad831){return function(_0x4dcf58){if(_0x4dcf58){var _0x43d796=typeof _0x3ad831[_0x9a9f('0x22')]==='undefined'&&typeof _0x3ad831['limit']===_0x9a9f('0x23');var _0x711b85=_0x4dcf58['count'];var _0xc14948=_0x43d796?0x0:_0x3ad831[_0x9a9f('0x22')];var _0x70985b=_0x43d796?_0x4dcf58[_0x9a9f('0x24')]:_0x3ad831[_0x9a9f('0x22')]+_0x3ad831[_0x9a9f('0x25')];var _0x23f6b7;if(_0x70985b>=_0x711b85){_0x70985b=_0x711b85;_0x23f6b7=0xc8;}else{_0x23f6b7=0xce;}_0x9910c8['status'](_0x23f6b7);return _0x9910c8[_0x9a9f('0x26')](_0x9a9f('0x27'),_0xc14948+'-'+_0x70985b+'/'+_0x711b85)[_0x9a9f('0x21')](_0x4dcf58);}return null;};}function patchUpdates(_0x3e3f1e){return function(_0x3f7d3b){try{jsonpatch[_0x9a9f('0x28')](_0x3f7d3b,_0x3e3f1e,!![]);}catch(_0x73ddec){return BPromise[_0x9a9f('0x29')](_0x73ddec);}return _0x3f7d3b['save']();};}function saveUpdates(_0x41856d,_0x5a44a6){return function(_0x1f886c){if(_0x1f886c){return _0x1f886c[_0x9a9f('0x2a')](_0x41856d)['then'](function(_0x46ec65){return _0x46ec65;});}return null;};}function removeEntity(_0xca338c,_0x463b40){return function(_0x56fefb){if(_0x56fefb){return _0x56fefb['destroy']()['then'](function(){_0xca338c['status'](0xcc)[_0x9a9f('0x20')]();});}};}function handleEntityNotFound(_0x5c1102,_0x1aad4f){return function(_0x3cd581){if(!_0x3cd581){_0x5c1102[_0x9a9f('0x1e')](0x194);}return _0x3cd581;};}function handleError(_0x1b6685,_0x16b3e2){_0x16b3e2=_0x16b3e2||0x1f4;return function(_0x3c75a8){logger[_0x9a9f('0x2b')](_0x3c75a8[_0x9a9f('0x2c')]);if(_0x3c75a8[_0x9a9f('0x2d')]){delete _0x3c75a8[_0x9a9f('0x2d')];}_0x1b6685[_0x9a9f('0x1f')](_0x16b3e2)[_0x9a9f('0x2e')](_0x3c75a8);};}exports[_0x9a9f('0x2f')]=function(_0x1f6ae9,_0x59ab68,_0xa626cb){if(!_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x31')](_0x9a9f('0x32'))&&!_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x31')](_0x9a9f('0x33'))){throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))](_0x9a9f('0x36'));}else{if(_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x31')]('TemplateId')&&!_0x1f6ae9[_0x9a9f('0x30')]['hasOwnProperty'](_0x9a9f('0x37'))){throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x31')](_0x9a9f('0x38'))){throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x31a1ee=JSON[_0x9a9f('0x39')](_0x1f6ae9[_0x9a9f('0x30')]['recipients']);}catch(_0x5badfe){logger[_0x9a9f('0x2b')](_0x5badfe);throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))](_0x9a9f('0x3a'));}var _0x28b28d=[_0x9a9f('0x3b'),_0x9a9f('0x3c'),'mailqueue','openchannelqueue',_0x9a9f('0x3d'),_0x9a9f('0x3e'),_0x9a9f('0x3f'),'team',_0x9a9f('0x40')];if(_[_0x9a9f('0x41')](_0x31a1ee,function(_0x4d9db8){return!_['includes'](_0x28b28d,_0x4d9db8['model'][_0x9a9f('0x42')]());})){throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))](_0x9a9f('0x43'));}}}var _0x22578a={};_0x22578a[_0x9a9f('0x44')]=_0x1f6ae9['body']['hasOwnProperty']('senderName')?_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x44')]:_0x1f6ae9[_0x9a9f('0x40')]['fullname'];_0x22578a[_0x9a9f('0x45')]=_[_0x9a9f('0x46')](_0x1f6ae9['body'][_0x9a9f('0x45')])?null:_0x1f6ae9[_0x9a9f('0x30')]['recipientsDescription'];_0x22578a[_0x9a9f('0x47')]=_0x1f6ae9[_0x9a9f('0x30')]['beep']||![];_0x22578a[_0x9a9f('0x48')]=_0x1f6ae9[_0x9a9f('0x40')]['id'];return getContent(_0x1f6ae9[_0x9a9f('0x30')])[_0x9a9f('0x49')](function(_0x32db95){_0x22578a[_0x9a9f('0x30')]=_0x32db95;return getRecipients(_0x31a1ee);})['then'](function(_0x1c0a96){_0x22578a[_0x9a9f('0x4a')]=_['sortBy'](_0x1c0a96)[_0x9a9f('0x4b')](',');return db[_0x9a9f('0x4c')][_0x9a9f('0x4d')](function(_0x418e74){return db['UserNotification'][_0x9a9f('0x4e')](_0x22578a,{'raw':!![],'transaction':_0x418e74})[_0x9a9f('0x49')](function(_0x9a42d9){var _0x3db984={'sender':_0x22578a[_0x9a9f('0x44')],'description':_0x22578a[_0x9a9f('0x45')],'content':_0x22578a[_0x9a9f('0x30')],'beep':_0x22578a[_0x9a9f('0x47')]};_0x1c0a96[_0x9a9f('0x4f')](function(_0x3eaccd){_0x3db984[_0x9a9f('0x50')]=_0x3eaccd;socket[_0x9a9f('0x51')]('userNotification:send',_0x3db984);});return _0x9a42d9;});});})['then'](respondWithResult(_0x59ab68,0xc9))[_0x9a9f('0x52')](handleError(_0x59ab68,null));};function getContent(_0x4f8e1c){return new BPromise(function(_0x3e04f6,_0xfb9704){if(_0x4f8e1c[_0x9a9f('0x32')]){_0x3e04f6(_0x4f8e1c[_0x9a9f('0x32')]);return;}return db[_0x9a9f('0x53')][_0x9a9f('0x54')]({'attributes':['html'],'where':{'id':_0x4f8e1c[_0x9a9f('0x33')]},'raw':!![]})['then'](function(_0xb03a8c){if(!_0xb03a8c)throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))](_0x9a9f('0x55'));var _0x51d81f=Mustache['render'](_0xb03a8c[_0x9a9f('0x56')],_0x4f8e1c[_0x9a9f('0x37')]);_0x3e04f6(_0x51d81f);})['catch'](function(_0x3e0300){_0xfb9704(_0x3e0300);});});}function getRecipients(_0x2753d5){return new BPromise(function(_0x3c5cc7,_0x5899bb){var _0x194f3c=[];var _0x3fdda4=[];_0x2753d5[_0x9a9f('0x4f')](function(_0x3d5313){var _0x574c95=_[_0x9a9f('0x57')](_0x3d5313[_0x9a9f('0x58')]['toLowerCase']());if(_0x574c95===_0x9a9f('0x59')){_0x194f3c=_['union'](_0x194f3c,_0x3d5313[_0x9a9f('0x5a')]);}else{if(_[_0x9a9f('0x5b')](_0x574c95,_0x9a9f('0x5c')))_0x574c95=_0x574c95[_0x9a9f('0x5d')]('queue','Queue');_0x3d5313[_0x9a9f('0x5a')][_0x9a9f('0x4f')](function(_0x47311f){_0x3fdda4[_0x9a9f('0x5e')](getAgents(_0x574c95,_0x47311f));});}});return BPromise[_0x9a9f('0x5f')](_0x3fdda4)['then'](function(_0x2d5fd0){_0x194f3c=_[_0x9a9f('0x60')](_0x194f3c,_['flatten'](_0x2d5fd0));_0x3c5cc7(_0x194f3c);})['catch'](function(_0x21f737){_0x5899bb(_0x21f737);});});}function getAgents(_0x278c2a,_0x5df491){return new BPromise(function(_0x98ed70,_0x7570ba){return db[_0x278c2a][_0x9a9f('0x54')]({'where':{'id':_0x5df491}})[_0x9a9f('0x49')](function(_0x5535f7){return _0x5535f7[_0x9a9f('0x61')]({'attributes':['id'],'raw':!![]})[_0x9a9f('0x49')](function(_0x384165){var _0x1863b2=_[_0x9a9f('0x62')](_0x384165,'id');_0x98ed70(_0x1863b2);});})['catch'](function(_0x5bfbd1){_0x7570ba(_0x5bfbd1);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 528d31c..7a8e3c7 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 _0xdf3a=['hook','exports','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x583edd,_0x1d851f){var _0x25fff4=function(_0xe2bb14){while(--_0xe2bb14){_0x583edd['push'](_0x583edd['shift']());}};_0x25fff4(++_0x1d851f);}(_0xdf3a,0xa4));var _0xadf3=function(_0x1cca0b,_0x46c419){_0x1cca0b=_0x1cca0b-0x0;var _0x4c3576=_0xdf3a[_0x1cca0b];return _0x4c3576;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xadf3('0x0'))['db'][_0xadf3('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xadf3('0x2')](0x0);var events={'afterCreate':_0xadf3('0x3'),'afterUpdate':_0xadf3('0x4'),'afterDestroy':_0xadf3('0x5')};function emitEvent(_0x5391a2){return function(_0x377d3c,_0x27b8a1,_0x458ef3){UserNotificationEvents['emit'](_0x5391a2+':'+_0x377d3c['id'],_0x377d3c);UserNotificationEvents['emit'](_0x5391a2,_0x377d3c);_0x458ef3(null);};}for(var e in events){if(events[_0xadf3('0x6')](e)){var event=events[e];UserNotification[_0xadf3('0x7')](e,emitEvent(event));}}module[_0xadf3('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x30b3=['hook','exports','events','../../mysqldb','UserNotification','save','remove','emit','hasOwnProperty'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x30b3,0x1f1));var _0x330b=function(_0x5a2d6e,_0x3d3a47){_0x5a2d6e=_0x5a2d6e-0x0;var _0x30ff59=_0x30b3[_0x5a2d6e];return _0x30ff59;};'use strict';var EventEmitter=require(_0x330b('0x0'));var UserNotification=require(_0x330b('0x1'))['db'][_0x330b('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x330b('0x3'),'afterUpdate':'update','afterDestroy':_0x330b('0x4')};function emitEvent(_0x2f6ef8){return function(_0x1cd7ff,_0x20bf32,_0x53fea2){UserNotificationEvents[_0x330b('0x5')](_0x2f6ef8+':'+_0x1cd7ff['id'],_0x1cd7ff);UserNotificationEvents[_0x330b('0x5')](_0x2f6ef8,_0x1cd7ff);_0x53fea2(null);};}for(var e in events){if(events[_0x330b('0x6')](e)){var event=events[e];UserNotification[_0x330b('0x7')](e,emitEvent(event));}}module[_0x330b('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index a58be76..46e9640 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 _0x52ca=['./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x18b51f,_0xa79fe6){var _0x46b199=function(_0x47173c){while(--_0x47173c){_0x18b51f['push'](_0x18b51f['shift']());}};_0x46b199(++_0xa79fe6);}(_0x52ca,0x124));var _0xa52c=function(_0x1d33b2,_0x2de914){_0x1d33b2=_0x1d33b2-0x0;var _0x38e56c=_0x52ca[_0x1d33b2];return _0x38e56c;};'use strict';var _=require('lodash');var util=require(_0xa52c('0x0'));var logger=require(_0xa52c('0x1'))(_0xa52c('0x2'));var moment=require(_0xa52c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa52c('0x4'));var fs=require('fs');var path=require(_0xa52c('0x5'));var rimraf=require('rimraf');var config=require(_0xa52c('0x6'));var attributes=require(_0xa52c('0x7'));module[_0xa52c('0x8')]=function(_0x58802d,_0x4fb4b7){return _0x58802d['define'](_0xa52c('0x9'),attributes,{'tableName':_0xa52c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa52c('0xb'),'collate':_0xa52c('0xc')});}; \ No newline at end of file +var _0x00b2=['exports','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x41fb84,_0x3770b8){var _0x231304=function(_0x40ce59){while(--_0x40ce59){_0x41fb84['push'](_0x41fb84['shift']());}};_0x231304(++_0x3770b8);}(_0x00b2,0x16a));var _0x200b=function(_0x2397eb,_0x5b855e){_0x2397eb=_0x2397eb-0x0;var _0x2d104e=_0x00b2[_0x2397eb];return _0x2d104e;};'use strict';var _=require(_0x200b('0x0'));var util=require(_0x200b('0x1'));var logger=require('../../config/logger')(_0x200b('0x2'));var moment=require(_0x200b('0x3'));var BPromise=require(_0x200b('0x4'));var rp=require(_0x200b('0x5'));var fs=require('fs');var path=require(_0x200b('0x6'));var rimraf=require(_0x200b('0x7'));var config=require(_0x200b('0x8'));var attributes=require(_0x200b('0x9'));module[_0x200b('0xa')]=function(_0x391cae,_0x14ff75){return _0x391cae['define']('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x200b('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index f50f3be..bb20892 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 _0x6ec0=['http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','UserNotification,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x5cd638,_0x592b4f){var _0x27baa9=function(_0x307218){while(--_0x307218){_0x5cd638['push'](_0x5cd638['shift']());}};_0x27baa9(++_0x592b4f);}(_0x6ec0,0x1db));var _0x06ec=function(_0x4fa912,_0x2b6c4c){_0x4fa912=_0x4fa912-0x0;var _0xfef55c=_0x6ec0[_0x4fa912];return _0xfef55c;};'use strict';var _=require('lodash');var util=require(_0x06ec('0x0'));var moment=require(_0x06ec('0x1'));var BPromise=require(_0x06ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06ec('0x3'));var db=require(_0x06ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x06ec('0x5'))(_0x06ec('0x6'));var config=require(_0x06ec('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x06ec('0x8')]({'port':0x232a});config[_0x06ec('0x9')]=_[_0x06ec('0xa')](config[_0x06ec('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x06ec('0xb'))(new Redis(config[_0x06ec('0x9')]));require('./userNotification.socket')[_0x06ec('0xc')](socket);function respondWithRpcPromise(_0x1fcc6e,_0x4b74ce,_0x39f6df){return new BPromise(function(_0x1d7f6c,_0x3531d9){return client[_0x06ec('0xd')](_0x1fcc6e,_0x39f6df)[_0x06ec('0xe')](function(_0x3e0337){logger[_0x06ec('0xf')]('UserNotification,\x20%s,\x20%s',_0x4b74ce,_0x06ec('0x10'));logger[_0x06ec('0x11')](_0x06ec('0x12'),_0x4b74ce,_0x06ec('0x10'),JSON['stringify'](_0x3e0337));if(_0x3e0337[_0x06ec('0x13')]){if(_0x3e0337[_0x06ec('0x13')]['code']===0x1f4){logger[_0x06ec('0x13')](_0x06ec('0x14'),_0x4b74ce,_0x3e0337['error'][_0x06ec('0x15')]);return _0x3531d9(_0x3e0337[_0x06ec('0x13')][_0x06ec('0x15')]);}logger[_0x06ec('0x13')](_0x06ec('0x14'),_0x4b74ce,_0x3e0337[_0x06ec('0x13')][_0x06ec('0x15')]);return _0x1d7f6c(_0x3e0337[_0x06ec('0x13')][_0x06ec('0x15')]);}else{logger[_0x06ec('0xf')]('UserNotification,\x20%s,\x20%s',_0x4b74ce,_0x06ec('0x10'));_0x1d7f6c(_0x3e0337['result'][_0x06ec('0x15')]);}})[_0x06ec('0x16')](function(_0x26d17a){logger['error']('UserNotification,\x20%s,\x20%s',_0x4b74ce,_0x26d17a);_0x3531d9(_0x26d17a);});});} \ No newline at end of file +var _0xb6d9=['request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then'];(function(_0x4ae0bd,_0x10a367){var _0x917580=function(_0x34b2ee){while(--_0x34b2ee){_0x4ae0bd['push'](_0x4ae0bd['shift']());}};_0x917580(++_0x10a367);}(_0xb6d9,0x19f));var _0x9b6d=function(_0x39010b,_0x17e844){_0x39010b=_0x39010b-0x0;var _0x3d8797=_0xb6d9[_0x39010b];return _0x3d8797;};'use strict';var _=require(_0x9b6d('0x0'));var util=require(_0x9b6d('0x1'));var moment=require('moment');var BPromise=require(_0x9b6d('0x2'));var rs=require(_0x9b6d('0x3'));var fs=require('fs');var Redis=require(_0x9b6d('0x4'));var db=require(_0x9b6d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9b6d('0x6'));var config=require('../../config/environment');var jayson=require(_0x9b6d('0x7'));var client=jayson[_0x9b6d('0x8')][_0x9b6d('0x9')]({'port':0x232a});config[_0x9b6d('0xa')]=_[_0x9b6d('0xb')](config[_0x9b6d('0xa')],{'host':_0x9b6d('0xc'),'port':0x18eb});var socket=require(_0x9b6d('0xd'))(new Redis(config['redis']));require(_0x9b6d('0xe'))['register'](socket);function respondWithRpcPromise(_0x5d4092,_0x378187,_0xb60672){return new BPromise(function(_0x56ec2c,_0x4e0f54){return client[_0x9b6d('0xf')](_0x5d4092,_0xb60672)[_0x9b6d('0x10')](function(_0xad3394){logger['info']('UserNotification,\x20%s,\x20%s',_0x378187,_0x9b6d('0x11'));logger[_0x9b6d('0x12')](_0x9b6d('0x13'),_0x378187,'request\x20sent',JSON[_0x9b6d('0x14')](_0xad3394));if(_0xad3394[_0x9b6d('0x15')]){if(_0xad3394[_0x9b6d('0x15')][_0x9b6d('0x16')]===0x1f4){logger[_0x9b6d('0x15')](_0x9b6d('0x17'),_0x378187,_0xad3394[_0x9b6d('0x15')][_0x9b6d('0x18')]);return _0x4e0f54(_0xad3394['error'][_0x9b6d('0x18')]);}logger['error'](_0x9b6d('0x17'),_0x378187,_0xad3394['error']['message']);return _0x56ec2c(_0xad3394[_0x9b6d('0x15')][_0x9b6d('0x18')]);}else{logger[_0x9b6d('0x19')](_0x9b6d('0x17'),_0x378187,'request\x20sent');_0x56ec2c(_0xad3394['result']['message']);}})[_0x9b6d('0x1a')](function(_0xe2b502){logger[_0x9b6d('0x15')](_0x9b6d('0x17'),_0x378187,_0xe2b502);_0x4e0f54(_0xe2b502);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 11415e0..48a0800 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 _0xa70f=['length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xa70f,0x1d6));var _0xfa70=function(_0x52d9fd,_0x31952b){_0x52d9fd=_0x52d9fd-0x0;var _0x2fdd3b=_0xa70f[_0x52d9fd];return _0x2fdd3b;};'use strict';var UserNotificationEvents=require(_0xfa70('0x0'));var events=[_0xfa70('0x1'),_0xfa70('0x2'),_0xfa70('0x3')];function createListener(_0x2d7777,_0x35350){return function(_0x443179){_0x35350[_0xfa70('0x4')](_0x2d7777,_0x443179);};}function removeListener(_0x1331a5,_0x4842ab){return function(){UserNotificationEvents[_0xfa70('0x5')](_0x1331a5,_0x4842ab);};}exports[_0xfa70('0x6')]=function(_0x102a0d){for(var _0x266243=0x0,_0x1eafd7=events[_0xfa70('0x7')];_0x266243<_0x1eafd7;_0x266243++){var _0x312729=events[_0x266243];var _0x2c8646=createListener(_0xfa70('0x8')+_0x312729,_0x102a0d);UserNotificationEvents['on'](_0x312729,_0x2c8646);}}; \ No newline at end of file +var _0xc058=['./userNotification.events','save','remove','update','emit','removeListener','register','length'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0xc058,0x188));var _0x8c05=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc058[_0x20a584];return _0x4b41a8;};'use strict';var UserNotificationEvents=require(_0x8c05('0x0'));var events=[_0x8c05('0x1'),_0x8c05('0x2'),_0x8c05('0x3')];function createListener(_0x3436fa,_0x5b9a47){return function(_0xc405c5){_0x5b9a47[_0x8c05('0x4')](_0x3436fa,_0xc405c5);};}function removeListener(_0x4a56c1,_0x1a150e){return function(){UserNotificationEvents[_0x8c05('0x5')](_0x4a56c1,_0x1a150e);};}exports[_0x8c05('0x6')]=function(_0x38ed77){for(var _0x269c85=0x0,_0x464738=events[_0x8c05('0x7')];_0x269c85<_0x464738;_0x269c85++){var _0x44a6c3=events[_0x269c85];var _0x354d70=createListener('userNotification:'+_0x44a6c3,_0x38ed77);UserNotificationEvents['on'](_0x44a6c3,_0x354d70);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 5734d8a..8074bde 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x9a7d5b,_0x50327f){var _0xe2a5b3=function(_0x98ad8d){while(--_0x98ad8d){_0x9a7d5b['push'](_0x9a7d5b['shift']());}};_0xe2a5b3(++_0x50327f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x23b36b,_0x150dce){var _0x29308a=function(_0x5d194d){while(--_0x5d194d){_0x23b36b['push'](_0x23b36b['shift']());}};_0x29308a(++_0x150dce);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index a0eca92..3ebb8c1 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 _0x5569=['INTEGER'];(function(_0x14310e,_0x51f4de){var _0x37ce9e=function(_0x480e7b){while(--_0x480e7b){_0x14310e['push'](_0x14310e['shift']());}};_0x37ce9e(++_0x51f4de);}(_0x5569,0x143));var _0x9556=function(_0x1989e2,_0x5a3b47){_0x1989e2=_0x1989e2-0x0;var _0x218d38=_0x5569[_0x1989e2];return _0x218d38;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9556('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2094=['INTEGER','sequelize'];(function(_0x5b2f98,_0x3d4d1f){var _0x468dab=function(_0x407e68){while(--_0x407e68){_0x5b2f98['push'](_0x5b2f98['shift']());}};_0x468dab(++_0x3d4d1f);}(_0x2094,0x10d));var _0x4209=function(_0x3a35f5,_0xebd0fb){_0x3a35f5=_0x3a35f5-0x0;var _0x1c95a6=_0x2094[_0x3a35f5];return _0x1c95a6;};'use strict';var Sequelize=require(_0x4209('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4209('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 4aaa515..cee222d 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 _0xa2d6=['util','api','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa2d6,0x13e));var _0x6a2d=function(_0x366e51,_0x3a0178){_0x366e51=_0x366e51-0x0;var _0x4e23e3=_0xa2d6[_0x366e51];return _0x4e23e3;};'use strict';var _=require(_0x6a2d('0x0'));var util=require(_0x6a2d('0x1'));var logger=require('../../config/logger')(_0x6a2d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a2d('0x3'));var rimraf=require(_0x6a2d('0x4'));var config=require(_0x6a2d('0x5'));var attributes=require(_0x6a2d('0x6'));module[_0x6a2d('0x7')]=function(_0x108a8b,_0x114780){return _0x108a8b[_0x6a2d('0x8')](_0x6a2d('0x9'),attributes,{'tableName':_0x6a2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cd9=['bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','util','api'];(function(_0x27e9b3,_0x1b17af){var _0x553cac=function(_0x5c368e){while(--_0x5c368e){_0x27e9b3['push'](_0x27e9b3['shift']());}};_0x553cac(++_0x1b17af);}(_0x6cd9,0xfa));var _0x96cd=function(_0x44452b,_0x2d41b3){_0x44452b=_0x44452b-0x0;var _0x23f8b4=_0x6cd9[_0x44452b];return _0x23f8b4;};'use strict';var _=require(_0x96cd('0x0'));var util=require(_0x96cd('0x1'));var logger=require('../../config/logger')(_0x96cd('0x2'));var moment=require('moment');var BPromise=require(_0x96cd('0x3'));var rp=require(_0x96cd('0x4'));var fs=require('fs');var path=require(_0x96cd('0x5'));var rimraf=require(_0x96cd('0x6'));var config=require('../../config/environment');var attributes=require(_0x96cd('0x7'));module[_0x96cd('0x8')]=function(_0x4f3204,_0x5123ce){return _0x4f3204[_0x96cd('0x9')](_0x96cd('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index bf2fc40..a232817 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 _0x39ff=['moment','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util'];(function(_0x46bbc3,_0x59d760){var _0x13de8e=function(_0x2db613){while(--_0x2db613){_0x46bbc3['push'](_0x46bbc3['shift']());}};_0x13de8e(++_0x59d760);}(_0x39ff,0x142));var _0xf39f=function(_0x6f6679,_0x5f2af9){_0x6f6679=_0x6f6679-0x0;var _0x2018f7=_0x39ff[_0x6f6679];return _0x2018f7;};'use strict';var _=require(_0xf39f('0x0'));var util=require(_0xf39f('0x1'));var moment=require(_0xf39f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf39f('0x3'));var logger=require(_0xf39f('0x4'))(_0xf39f('0x5'));var config=require(_0xf39f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf39f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cacd,_0x5f0c69,_0x3c6cc7){return new BPromise(function(_0x192524,_0x57cd02){return client[_0xf39f('0x8')](_0x1cacd,_0x3c6cc7)['then'](function(_0x173d45){logger['info'](_0xf39f('0x9'),_0x5f0c69,_0xf39f('0xa'));logger[_0xf39f('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5f0c69,_0xf39f('0xa'),JSON['stringify'](_0x173d45));if(_0x173d45[_0xf39f('0xc')]){if(_0x173d45[_0xf39f('0xc')][_0xf39f('0xd')]===0x1f4){logger[_0xf39f('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5f0c69,_0x173d45[_0xf39f('0xc')][_0xf39f('0xe')]);return _0x57cd02(_0x173d45[_0xf39f('0xc')]['message']);}logger['error'](_0xf39f('0x9'),_0x5f0c69,_0x173d45[_0xf39f('0xc')]['message']);return _0x192524(_0x173d45[_0xf39f('0xc')][_0xf39f('0xe')]);}else{logger[_0xf39f('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5f0c69,_0xf39f('0xa'));_0x192524(_0x173d45[_0xf39f('0x10')][_0xf39f('0xe')]);}})[_0xf39f('0x11')](function(_0x4a169c){logger[_0xf39f('0xc')](_0xf39f('0x9'),_0x5f0c69,_0x4a169c);_0x57cd02(_0x4a169c);});});} \ No newline at end of file +var _0x1957=['info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x1957,0x1a8));var _0x7195=function(_0x3042d5,_0x349534){_0x3042d5=_0x3042d5-0x0;var _0x1acfef=_0x1957[_0x3042d5];return _0x1acfef;};'use strict';var _=require('lodash');var util=require(_0x7195('0x0'));var moment=require(_0x7195('0x1'));var BPromise=require(_0x7195('0x2'));var rs=require(_0x7195('0x3'));var fs=require('fs');var Redis=require(_0x7195('0x4'));var db=require(_0x7195('0x5'))['db'];var utils=require(_0x7195('0x6'));var logger=require(_0x7195('0x7'))(_0x7195('0x8'));var config=require('../../config/environment');var jayson=require(_0x7195('0x9'));var client=jayson['client'][_0x7195('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50a223,_0x5178c7,_0x15b163){return new BPromise(function(_0x98ad90,_0x1d50b1){return client[_0x7195('0xb')](_0x50a223,_0x15b163)[_0x7195('0xc')](function(_0x1aa746){logger[_0x7195('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5178c7,_0x7195('0xe'));logger[_0x7195('0xf')](_0x7195('0x10'),_0x5178c7,_0x7195('0xe'),JSON['stringify'](_0x1aa746));if(_0x1aa746[_0x7195('0x11')]){if(_0x1aa746[_0x7195('0x11')][_0x7195('0x12')]===0x1f4){logger[_0x7195('0x11')](_0x7195('0x13'),_0x5178c7,_0x1aa746[_0x7195('0x11')][_0x7195('0x14')]);return _0x1d50b1(_0x1aa746[_0x7195('0x11')][_0x7195('0x14')]);}logger[_0x7195('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5178c7,_0x1aa746[_0x7195('0x11')]['message']);return _0x98ad90(_0x1aa746['error'][_0x7195('0x14')]);}else{logger[_0x7195('0xd')](_0x7195('0x13'),_0x5178c7,'request\x20sent');_0x98ad90(_0x1aa746[_0x7195('0x15')][_0x7195('0x14')]);}})[_0x7195('0x16')](function(_0x5d488d){logger['error'](_0x7195('0x13'),_0x5178c7,_0x5d488d);_0x1d50b1(_0x5d488d);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 3d179f2..b5d2f56 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 _0x17bb=['index','/describe','describe','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','/:id','update','destroy','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated'];(function(_0x2897d6,_0x337606){var _0x578e17=function(_0x391c85){while(--_0x391c85){_0x2897d6['push'](_0x2897d6['shift']());}};_0x578e17(++_0x337606);}(_0x17bb,0x1c1));var _0xb17b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x17bb[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xb17b('0x0'));var util=require(_0xb17b('0x1'));var path=require(_0xb17b('0x2'));var timeout=require(_0xb17b('0x3'));var express=require(_0xb17b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb17b('0x5'));var interaction=require(_0xb17b('0x6'));var config=require('../../config/environment');var controller=require(_0xb17b('0x7'));router[_0xb17b('0x8')]('/',auth[_0xb17b('0x9')](),controller[_0xb17b('0xa')]);router[_0xb17b('0x8')](_0xb17b('0xb'),auth[_0xb17b('0x9')](),controller[_0xb17b('0xc')]);router['get']('/:id',auth[_0xb17b('0x9')](),controller['show']);router['get'](_0xb17b('0xd'),auth[_0xb17b('0x9')](),controller[_0xb17b('0xe')]);router[_0xb17b('0x8')](_0xb17b('0xf'),auth[_0xb17b('0x9')](),controller[_0xb17b('0x10')]);router[_0xb17b('0x11')]('/',auth[_0xb17b('0x9')](),controller[_0xb17b('0x12')]);router['post'](_0xb17b('0x13'),auth[_0xb17b('0x9')](),controller[_0xb17b('0x14')]);router[_0xb17b('0x11')]('/:id/sections',auth[_0xb17b('0x9')](),controller[_0xb17b('0x15')]);router['post']('/:id/resources',auth[_0xb17b('0x9')](),controller['addResources']);router['put'](_0xb17b('0x16'),auth['isAuthenticated'](),controller[_0xb17b('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb17b('0x18')]);router[_0xb17b('0x19')](_0xb17b('0xd'),auth[_0xb17b('0x9')](),controller['removeSections']);router[_0xb17b('0x19')](_0xb17b('0xf'),auth[_0xb17b('0x9')](),controller['removeResources']);module[_0xb17b('0x1a')]=router; \ No newline at end of file +var _0x849e=['removeSections','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','/:id/sections','getSections','getResources','post','create','clone','/:id/resources','delete','destroy'];(function(_0x87d5c4,_0xfa4a9f){var _0x2dcea4=function(_0x2cedaf){while(--_0x2cedaf){_0x87d5c4['push'](_0x87d5c4['shift']());}};_0x2dcea4(++_0xfa4a9f);}(_0x849e,0x187));var _0xe849=function(_0x2d056d,_0x53f6c3){_0x2d056d=_0x2d056d-0x0;var _0x430fca=_0x849e[_0x2d056d];return _0x430fca;};'use strict';var multer=require(_0xe849('0x0'));var util=require(_0xe849('0x1'));var path=require(_0xe849('0x2'));var timeout=require(_0xe849('0x3'));var express=require(_0xe849('0x4'));var router=express[_0xe849('0x5')]();var fs_extra=require(_0xe849('0x6'));var auth=require(_0xe849('0x7'));var interaction=require(_0xe849('0x8'));var config=require(_0xe849('0x9'));var controller=require(_0xe849('0xa'));router[_0xe849('0xb')]('/',auth[_0xe849('0xc')](),controller['index']);router[_0xe849('0xb')](_0xe849('0xd'),auth[_0xe849('0xc')](),controller[_0xe849('0xe')]);router[_0xe849('0xb')](_0xe849('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xe849('0xb')](_0xe849('0x10'),auth['isAuthenticated'](),controller[_0xe849('0x11')]);router[_0xe849('0xb')]('/:id/resources',auth[_0xe849('0xc')](),controller[_0xe849('0x12')]);router[_0xe849('0x13')]('/',auth[_0xe849('0xc')](),controller[_0xe849('0x14')]);router[_0xe849('0x13')]('/:id/clone',auth[_0xe849('0xc')](),controller[_0xe849('0x15')]);router[_0xe849('0x13')]('/:id/sections',auth['isAuthenticated'](),controller['addSections']);router['post'](_0xe849('0x16'),auth['isAuthenticated'](),controller['addResources']);router['put'](_0xe849('0xf'),auth[_0xe849('0xc')](),controller['update']);router[_0xe849('0x17')](_0xe849('0xf'),auth[_0xe849('0xc')](),controller[_0xe849('0x18')]);router[_0xe849('0x17')](_0xe849('0x10'),auth['isAuthenticated'](),controller[_0xe849('0x19')]);router[_0xe849('0x17')]('/:id/resources',auth[_0xe849('0xc')](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 843f8f8..8b28fb1 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 _0x9ca9=['name','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize','STRING'];(function(_0x5d5c5d,_0x4e0fab){var _0x2f2fbb=function(_0x2d45e8){while(--_0x2d45e8){_0x5d5c5d['push'](_0x5d5c5d['shift']());}};_0x2f2fbb(++_0x4e0fab);}(_0x9ca9,0xa0));var _0x99ca=function(_0x16dacd,_0x4d8722){_0x16dacd=_0x16dacd-0x0;var _0x1f8166=_0x9ca9[_0x16dacd];return _0x1f8166;};'use strict';var Sequelize=require(_0x99ca('0x0'));module['exports']={'name':{'type':Sequelize[_0x99ca('0x1')],'allowNull':![],'unique':_0x99ca('0x2')},'crudPermissions':{'type':Sequelize[_0x99ca('0x1')],'set':function(_0x3d69f1){this[_0x99ca('0x3')]('crudPermissions',_0x3d69f1?_0x3d69f1[_0x99ca('0x4')](''):[]);},'get':function(){return this[_0x99ca('0x5')](_0x99ca('0x6'))?this[_0x99ca('0x5')](_0x99ca('0x6'))[_0x99ca('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x99ca('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x99ca('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x99ca('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x99ca('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x99ca('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x99ca('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x99ca('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0839=['sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x2d6dd4,_0x3abb75){var _0xdd0fea=function(_0x6f27d8){while(--_0x6f27d8){_0x2d6dd4['push'](_0x2d6dd4['shift']());}};_0xdd0fea(++_0x3abb75);}(_0x0839,0xdc));var _0x9083=function(_0x5774a7,_0x10ba6c){_0x5774a7=_0x5774a7-0x0;var _0x94d0ee=_0x0839[_0x5774a7];return _0x94d0ee;};'use strict';var Sequelize=require(_0x9083('0x0'));module[_0x9083('0x1')]={'name':{'type':Sequelize[_0x9083('0x2')],'allowNull':![],'unique':_0x9083('0x3')},'crudPermissions':{'type':Sequelize[_0x9083('0x2')],'set':function(_0x3a4712){this[_0x9083('0x4')](_0x9083('0x5'),_0x3a4712?_0x3a4712[_0x9083('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x9083('0x5'))?this[_0x9083('0x7')](_0x9083('0x5'))[_0x9083('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9083('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9083('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 618d184..fd0b5aa 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 _0xf9ac=['sectionId','Resources','describe','addSections','push','removeSections','getSections','includes','isEmpty','subsections','enabled','findOne','Dashboard','forEach','resourceId','Plugin','addResources','sequelize','userProfileId','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','undefined','count','offset','set','json','reject','save','update','then','destroy','stack','name','index','UserProfile','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','limit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','get','omit','createdAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','updatedAt'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf9ac,0x87));var _0xcf9a=function(_0x21266b,_0x901bab){_0x21266b=_0x21266b-0x0;var _0x3b9a63=_0xf9ac[_0x21266b];return _0x3b9a63;};'use strict';var emlformat=require(_0xcf9a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcf9a('0x1'));var rp=require(_0xcf9a('0x2'));var moment=require('moment');var BPromise=require(_0xcf9a('0x3'));var Mustache=require('mustache');var util=require(_0xcf9a('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xcf9a('0x5'));var ejs=require(_0xcf9a('0x6'));var fs=require('fs');var fs_extra=require(_0xcf9a('0x7'));var _=require(_0xcf9a('0x8'));var squel=require('squel');var crypto=require(_0xcf9a('0x9'));var jsforce=require(_0xcf9a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcf9a('0xb'));var Papa=require('papaparse');var Redis=require(_0xcf9a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xcf9a('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf9a('0xe'));var logger=require(_0xcf9a('0xf'))(_0xcf9a('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcf9a('0x11'))['db'];config[_0xcf9a('0x12')]=_['defaults'](config[_0xcf9a('0x12')],{'host':_0xcf9a('0x13'),'port':0x18eb});var socket=require(_0xcf9a('0x14'))(new Redis(config['redis']));require(_0xcf9a('0x15'))['register'](socket);function respondWithStatusCode(_0x4a685f,_0x58cdd2){_0x58cdd2=_0x58cdd2||0xcc;return function(_0x55c27a){if(_0x55c27a){return _0x4a685f[_0xcf9a('0x16')](_0x58cdd2);}return _0x4a685f[_0xcf9a('0x17')](_0x58cdd2)[_0xcf9a('0x18')]();};}function respondWithResult(_0xaadfd7,_0x16b7d){_0x16b7d=_0x16b7d||0xc8;return function(_0xced14a){if(_0xced14a){return _0xaadfd7[_0xcf9a('0x17')](_0x16b7d)['json'](_0xced14a);}};}function respondWithFilteredResult(_0x8ae212,_0x2a5f92){return function(_0x503390){if(_0x503390){var _0x46b47f=typeof _0x2a5f92['offset']===_0xcf9a('0x19')&&typeof _0x2a5f92['limit']===_0xcf9a('0x19');var _0x141c8d=_0x503390[_0xcf9a('0x1a')];var _0x2a29e0=_0x46b47f?0x0:_0x2a5f92[_0xcf9a('0x1b')];var _0x5e4ac5=_0x46b47f?_0x503390['count']:_0x2a5f92[_0xcf9a('0x1b')]+_0x2a5f92['limit'];var _0x46d8b0;if(_0x5e4ac5>=_0x141c8d){_0x5e4ac5=_0x141c8d;_0x46d8b0=0xc8;}else{_0x46d8b0=0xce;}_0x8ae212[_0xcf9a('0x17')](_0x46d8b0);return _0x8ae212[_0xcf9a('0x1c')]('Content-Range',_0x2a29e0+'-'+_0x5e4ac5+'/'+_0x141c8d)[_0xcf9a('0x1d')](_0x503390);}return null;};}function patchUpdates(_0x2388d1){return function(_0x2f4adb){try{jsonpatch['apply'](_0x2f4adb,_0x2388d1,!![]);}catch(_0x3e70ee){return BPromise[_0xcf9a('0x1e')](_0x3e70ee);}return _0x2f4adb[_0xcf9a('0x1f')]();};}function saveUpdates(_0x5dd19c,_0x4f43b9){return function(_0x5b46e7){if(_0x5b46e7){return _0x5b46e7[_0xcf9a('0x20')](_0x5dd19c)[_0xcf9a('0x21')](function(_0xdb70b9){return _0xdb70b9;});}return null;};}function removeEntity(_0x1d391a,_0x3d2135){return function(_0x4f9b8c){if(_0x4f9b8c){return _0x4f9b8c[_0xcf9a('0x22')]()['then'](function(){_0x1d391a['status'](0xcc)[_0xcf9a('0x18')]();});}};}function handleEntityNotFound(_0x798016,_0x190e2a){return function(_0x465ed0){if(!_0x465ed0){_0x798016[_0xcf9a('0x16')](0x194);}return _0x465ed0;};}function handleError(_0x2a2e47,_0x17386b){_0x17386b=_0x17386b||0x1f4;return function(_0x5b5494){logger['error'](_0x5b5494[_0xcf9a('0x23')]);if(_0x5b5494[_0xcf9a('0x24')]){delete _0x5b5494['name'];}_0x2a2e47['status'](_0x17386b)['send'](_0x5b5494);};}exports[_0xcf9a('0x25')]=function(_0x14d32d,_0x40d7d7){var _0x5664bd={},_0x10c40a={},_0xce0179={'count':0x0,'rows':[]};var _0x449ed6=_['map'](db[_0xcf9a('0x26')][_0xcf9a('0x27')],function(_0x16e6ea){return{'name':_0x16e6ea[_0xcf9a('0x28')],'type':_0x16e6ea[_0xcf9a('0x29')][_0xcf9a('0x2a')]};});_0x10c40a[_0xcf9a('0x2b')]=_[_0xcf9a('0x2c')](_0x449ed6,_0xcf9a('0x24'));_0x10c40a[_0xcf9a('0x2d')]=_[_0xcf9a('0x2e')](_0x14d32d['query']);_0x10c40a[_0xcf9a('0x2f')]=_['intersection'](_0x10c40a['model'],_0x10c40a[_0xcf9a('0x2d')]);_0x5664bd[_0xcf9a('0x30')]=_[_0xcf9a('0x31')](_0x10c40a[_0xcf9a('0x2b')],qs[_0xcf9a('0x32')](_0x14d32d['query']['fields']));_0x5664bd[_0xcf9a('0x30')]=_0x5664bd[_0xcf9a('0x30')][_0xcf9a('0x33')]?_0x5664bd['attributes']:_0x10c40a[_0xcf9a('0x2b')];if(!_0x14d32d[_0xcf9a('0x2d')]['hasOwnProperty']('nolimit')){_0x5664bd[_0xcf9a('0x34')]=qs[_0xcf9a('0x34')](_0x14d32d[_0xcf9a('0x2d')][_0xcf9a('0x34')]);_0x5664bd[_0xcf9a('0x1b')]=qs['offset'](_0x14d32d[_0xcf9a('0x2d')][_0xcf9a('0x1b')]);}_0x5664bd['order']=qs[_0xcf9a('0x35')](_0x14d32d['query'][_0xcf9a('0x35')]);_0x5664bd[_0xcf9a('0x36')]=qs[_0xcf9a('0x2f')](_[_0xcf9a('0x37')](_0x14d32d[_0xcf9a('0x2d')],_0x10c40a[_0xcf9a('0x2f')]),_0x449ed6);if(_0x14d32d[_0xcf9a('0x2d')][_0xcf9a('0x38')]){_0x5664bd['where']=_[_0xcf9a('0x39')](_0x5664bd['where'],{'$or':_[_0xcf9a('0x2c')](_0x449ed6,function(_0x1f6b88){if(_0x1f6b88[_0xcf9a('0x29')]!==_0xcf9a('0x3a')){var _0x5766c5={};_0x5766c5[_0x1f6b88[_0xcf9a('0x24')]]={'$like':'%'+_0x14d32d[_0xcf9a('0x2d')][_0xcf9a('0x38')]+'%'};return _0x5766c5;}})});}_0x5664bd=_[_0xcf9a('0x39')]({},_0x5664bd,_0x14d32d[_0xcf9a('0x3b')]);var _0x49488a={'where':_0x5664bd[_0xcf9a('0x36')]};return db[_0xcf9a('0x26')][_0xcf9a('0x1a')](_0x49488a)[_0xcf9a('0x21')](function(_0x2a9799){_0xce0179[_0xcf9a('0x1a')]=_0x2a9799;if(_0x14d32d['query']['includeAll']){_0x5664bd[_0xcf9a('0x3c')]=[{'all':!![]}];}return db['UserProfile'][_0xcf9a('0x3d')](_0x5664bd);})[_0xcf9a('0x21')](function(_0x46233c){_0xce0179['rows']=_0x46233c;return _0xce0179;})[_0xcf9a('0x21')](respondWithFilteredResult(_0x40d7d7,_0x5664bd))[_0xcf9a('0x3e')](handleError(_0x40d7d7,null));};exports[_0xcf9a('0x3f')]=function(_0x1f2395,_0x4b7c88){var _0x3d7e28={'raw':![],'where':{'id':_0x1f2395[_0xcf9a('0x40')]['id']}},_0x2334db={};_0x2334db[_0xcf9a('0x2b')]=_['keys'](db[_0xcf9a('0x26')][_0xcf9a('0x27')]);_0x2334db[_0xcf9a('0x2d')]=_[_0xcf9a('0x2e')](_0x1f2395[_0xcf9a('0x2d')]);_0x2334db[_0xcf9a('0x2f')]=_['intersection'](_0x2334db['model'],_0x2334db[_0xcf9a('0x2d')]);_0x3d7e28[_0xcf9a('0x30')]=_[_0xcf9a('0x31')](_0x2334db[_0xcf9a('0x2b')],qs[_0xcf9a('0x32')](_0x1f2395[_0xcf9a('0x2d')][_0xcf9a('0x32')]));_0x3d7e28[_0xcf9a('0x30')]=_0x3d7e28[_0xcf9a('0x30')][_0xcf9a('0x33')]?_0x3d7e28[_0xcf9a('0x30')]:_0x2334db[_0xcf9a('0x2b')];if(_0x1f2395[_0xcf9a('0x2d')][_0xcf9a('0x41')]){_0x3d7e28[_0xcf9a('0x3c')]=[{'all':!![]}];}_0x3d7e28=_['merge']({},_0x3d7e28,_0x1f2395[_0xcf9a('0x3b')]);return db[_0xcf9a('0x26')][_0xcf9a('0x42')](_0x3d7e28)[_0xcf9a('0x21')](handleEntityNotFound(_0x4b7c88,null))[_0xcf9a('0x21')](respondWithResult(_0x4b7c88,null))[_0xcf9a('0x3e')](handleError(_0x4b7c88,null));};exports[_0xcf9a('0x43')]=function(_0x45a8bd,_0x113859){return db[_0xcf9a('0x26')]['create'](_0x45a8bd[_0xcf9a('0x44')],{})[_0xcf9a('0x21')](respondWithResult(_0x113859,0xc9))[_0xcf9a('0x3e')](handleError(_0x113859,null));};exports['clone']=function(_0x44a6f1,_0x137733){var _0x2510c4={'where':{'id':_0x44a6f1[_0xcf9a('0x40')]['id']}},_0x20fa72={};_0x20fa72[_0xcf9a('0x2b')]=_['keys'](db['UserProfile'][_0xcf9a('0x27')]);_0x2510c4['attributes']=_[_0xcf9a('0x31')](_0x20fa72[_0xcf9a('0x2b')],qs[_0xcf9a('0x32')](_0x44a6f1[_0xcf9a('0x2d')]['fields']));_0x2510c4[_0xcf9a('0x30')]=_0x2510c4[_0xcf9a('0x30')][_0xcf9a('0x33')]?_0x2510c4['attributes']:_0x20fa72[_0xcf9a('0x2b')];if(_0x44a6f1['query'][_0xcf9a('0x41')]){_0x2510c4[_0xcf9a('0x3c')]=[{'all':!![]}];}_0x2510c4=_[_0xcf9a('0x39')]({},_0x2510c4,_0x44a6f1[_0xcf9a('0x3b')]);return db[_0xcf9a('0x26')][_0xcf9a('0x42')](_0x2510c4)[_0xcf9a('0x21')](handleEntityNotFound(_0x137733,null))[_0xcf9a('0x21')](function(_0x4cbc5f){if(_0x4cbc5f){var _0x135971=_0x4cbc5f[_0xcf9a('0x45')]({'plain':!![]});_0x135971=qs[_0xcf9a('0x46')](_0x135971,['id',_0xcf9a('0x47'),'updatedAt',_0xcf9a('0x48')]);_0x44a6f1[_0xcf9a('0x44')]=_[_0xcf9a('0x46')](_0x44a6f1['body'],['id','createdAt','updatedAt']);return db['sequelize'][_0xcf9a('0x49')](function(_0x386817){return db['UserProfile'][_0xcf9a('0x43')](_[_0xcf9a('0x39')](_0x135971,_0x44a6f1[_0xcf9a('0x44')]),{'include':_0x44a6f1[_0xcf9a('0x2d')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x386817})[_0xcf9a('0x21')](function(_0x3c31e1){var _0x9a90c5=_0x3c31e1[_0xcf9a('0x45')]({'plain':!![]});return db[_0xcf9a('0x4a')][_0xcf9a('0x3d')]({'where':{'userProfileId':_0x44a6f1[_0xcf9a('0x40')]['id']},'raw':!![]})[_0xcf9a('0x21')](function(_0x8ffd3e){if(_0x8ffd3e){return BPromise[_0xcf9a('0x4b')](_0x8ffd3e,function(_0x297a22){return new BPromise(function(_0x23c144,_0x17c8e5){if(_0x297a22[_0xcf9a('0x4c')]===null||_0x297a22[_0xcf9a('0x4c')]===0x1)_0x23c144(null);return db[_0xcf9a('0x4d')][_0xcf9a('0x3d')]({'where':{'sectionId':_0x297a22['id']},'raw':!![]})[_0xcf9a('0x21')](function(_0x15ff9f){var _0x11b3a1=_[_0xcf9a('0x2c')](_0x15ff9f,function(_0x5145d1){return qs['omit'](_0x5145d1,['id',_0xcf9a('0x47'),_0xcf9a('0x4e'),_0xcf9a('0x4f')]);});_0x23c144(_0x11b3a1);})[_0xcf9a('0x3e')](function(_0x48db30){_0x17c8e5(_0x48db30);});})[_0xcf9a('0x21')](function(_0xea3676){var _0x16df57=qs[_0xcf9a('0x46')](_0x297a22,['id','createdAt',_0xcf9a('0x4e')]);_0x16df57['userProfileId']=_0x9a90c5['id'];if(_0xea3676)_0x16df57[_0xcf9a('0x50')]=_0xea3676;return _0x16df57;})[_0xcf9a('0x21')](function(_0x557f31){return db[_0xcf9a('0x4a')]['create'](_0x557f31,{'include':[{'model':db[_0xcf9a('0x4d')],'as':_0xcf9a('0x50')}],'raw':!![],'transaction':_0x386817});});})['then'](function(){return _0x9a90c5;});}});});});}})['then'](respondWithResult(_0x137733,0xc9))[_0xcf9a('0x3e')](handleError(_0x137733,null));};exports[_0xcf9a('0x20')]=function(_0x3f396a,_0x29b465){if(_0x3f396a[_0xcf9a('0x44')]['id']){delete _0x3f396a[_0xcf9a('0x44')]['id'];}return db['UserProfile'][_0xcf9a('0x42')]({'where':{'id':_0x3f396a[_0xcf9a('0x40')]['id']}})[_0xcf9a('0x21')](handleEntityNotFound(_0x29b465,null))['then'](saveUpdates(_0x3f396a[_0xcf9a('0x44')],null))['then'](respondWithResult(_0x29b465,null))[_0xcf9a('0x3e')](handleError(_0x29b465,null));};exports[_0xcf9a('0x22')]=function(_0x595993,_0x33d807){return db['UserProfile'][_0xcf9a('0x42')]({'where':{'id':_0x595993[_0xcf9a('0x40')]['id']}})[_0xcf9a('0x21')](handleEntityNotFound(_0x33d807,null))['then'](removeEntity(_0x33d807,null))[_0xcf9a('0x3e')](handleError(_0x33d807,null));};exports[_0xcf9a('0x51')]=function(_0x56cbd9,_0xf810a){return db[_0xcf9a('0x26')][_0xcf9a('0x51')]()['then'](respondWithResult(_0xf810a,null))[_0xcf9a('0x3e')](handleError(_0xf810a,null));};exports[_0xcf9a('0x52')]=function(_0x434821,_0x1675b1){var _0x53892d=_0x434821[_0xcf9a('0x44')];return db[_0xcf9a('0x26')][_0xcf9a('0x42')]({'where':{'id':_0x434821[_0xcf9a('0x40')]['id']}})['then'](handleEntityNotFound(_0x1675b1,null))[_0xcf9a('0x21')](function(_0x8be96c){if(_0x8be96c){return db['sequelize']['transaction'](function(_0x31d7f5){return db[_0xcf9a('0x4a')][_0xcf9a('0x22')]({'where':{'userProfileId':_0x434821[_0xcf9a('0x40')]['id'],'sectionId':_[_0xcf9a('0x2c')](_0x53892d,function(_0x2a285b){return _0x2a285b[_0xcf9a('0x4f')];})},'transaction':_0x31d7f5})[_0xcf9a('0x21')](function(){var _0x20aa0c=_[_0xcf9a('0x2c')](_0x53892d,function(_0x242f3b){_0x242f3b['userProfileId']=_0x434821[_0xcf9a('0x40')]['id'];return _0x242f3b;});var _0x301f76=[];return BPromise[_0xcf9a('0x4b')](_0x20aa0c,function(_0x78ad9b){return db['UserProfileSection'][_0xcf9a('0x43')](_0x78ad9b,{'include':[{'model':db[_0xcf9a('0x4d')],'as':_0xcf9a('0x50')}],'raw':!![],'transaction':_0x31d7f5})[_0xcf9a('0x21')](function(_0x596843){_0x301f76[_0xcf9a('0x53')](_0x596843[_0xcf9a('0x45')]({'plain':!![]}));});})[_0xcf9a('0x21')](function(){return _0x301f76;});});});}})[_0xcf9a('0x21')](function(_0x4e918d){return _0x4e918d;})[_0xcf9a('0x21')](respondWithResult(_0x1675b1,null))[_0xcf9a('0x3e')](handleError(_0x1675b1,null));};exports[_0xcf9a('0x54')]=function(_0x3ef7f2,_0x43df78){var _0xd78211;return db[_0xcf9a('0x26')]['find']({'where':{'id':_0x3ef7f2['params']['id']},'attributes':['id',_0xcf9a('0x24')]})[_0xcf9a('0x21')](handleEntityNotFound(_0x43df78,null))[_0xcf9a('0x21')](function(_0x52dfc3){if(_0x52dfc3){_0xd78211=_0x52dfc3;return db[_0xcf9a('0x4a')]['destroy']({'where':{'userProfileId':_0x3ef7f2[_0xcf9a('0x40')]['id'],'sectionId':_0x3ef7f2[_0xcf9a('0x2d')]['ids']}});}})[_0xcf9a('0x21')](function(){return _0xd78211;})['then'](respondWithStatusCode(_0x43df78,null))[_0xcf9a('0x3e')](handleError(_0x43df78,null));};exports[_0xcf9a('0x55')]=function(_0x3ad148,_0x145bba){var _0x4cf645=[];var _0x47e4dd=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3ad148[_0xcf9a('0x40')]['id']},'raw':!![]})[_0xcf9a('0x21')](function(_0xe87981){_0x4cf645=_[_0xcf9a('0x38')](_0xe87981,function(_0xa6b8cc){return _0xa6b8cc['enabled']===0x1||_[_0xcf9a('0x56')]([0x3eb,0x709],_0xa6b8cc[_0xcf9a('0x4f')]);});if(!_[_0xcf9a('0x57')](_0x4cf645)){return _[_0xcf9a('0x2c')](_0x4cf645,function(_0xf6fbae){return _0xf6fbae[_0xcf9a('0x4f')];});}else{return;}})[_0xcf9a('0x21')](function(_0x2f98bf){if(_0x2f98bf)_0x47e4dd=_0x2f98bf;if(_[_0xcf9a('0x56')](_0x47e4dd,0x64)){var _0x115e8a=_['find'](_0x4cf645,{'sectionId':0x64});return hasDefaultDashboard(_0x115e8a)[_0xcf9a('0x21')](function(_0x48a4b9){return _[_0xcf9a('0x2c')](_0x4cf645,function(_0x18ac4a){if(_0x18ac4a[_0xcf9a('0x4f')]===0x64){_0x18ac4a[_0xcf9a('0x58')]=_0x48a4b9;}return _0x18ac4a;});});}else{return;}})['then'](function(_0x2cd678){if(_0x2cd678)_0x4cf645=_0x2cd678;if(_[_0xcf9a('0x56')](_0x47e4dd,0x3eb)){var _0x4426ad=_[_0xcf9a('0x42')](_0x4cf645,{'sectionId':0x3eb});return getCustomDashboards(_0x4426ad)[_0xcf9a('0x21')](function(_0x2a14b0){return _['map'](_0x4cf645,function(_0x4d0466){if(_0x4426ad['enabled']){if(_0x4d0466[_0xcf9a('0x4f')]===0x3eb){_0x4d0466['subsections']=_0x2a14b0;}}else{if(_0x4d0466[_0xcf9a('0x4f')]===0x64){_0x4d0466[_0xcf9a('0x58')]=_0x2a14b0;}}return _0x4d0466;});});}else{return;}})[_0xcf9a('0x21')](function(_0x34db23){if(_0x34db23)_0x4cf645=_0x34db23;if(_[_0xcf9a('0x56')](_0x47e4dd,0x709)){var _0x341d2b=_[_0xcf9a('0x42')](_0x4cf645,{'sectionId':0x709});return getPlugins(_0x341d2b)[_0xcf9a('0x21')](function(_0x4f1966){if(_0x341d2b[_0xcf9a('0x59')]){return _['map'](_0x4cf645,function(_0x3c56c0){if(_0x3c56c0[_0xcf9a('0x4f')]===0x709){_0x3c56c0[_0xcf9a('0x58')]=_0x4f1966;}return _0x3c56c0;});}else{var _0x4a3dde={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4f1966};var _0x339f53=_[_0xcf9a('0x2c')](_0x4cf645);_0x339f53[_0xcf9a('0x53')](_0x4a3dde);return _0x339f53;}});}else{return;}})[_0xcf9a('0x21')](function(_0xa94d20){if(_0xa94d20)_0x4cf645=_0xa94d20;return _[_0xcf9a('0x38')](_0x4cf645,['enabled',0x1]);})['then'](respondWithResult(_0x145bba,null))[_0xcf9a('0x3e')](handleError(_0x145bba,null));};function hasDefaultDashboard(_0x390640){var _0x493efc=[0x65];return new BPromise(function(_0x30ec5a,_0x2213ab){try{if(_0x390640[_0xcf9a('0x4c')]){_0x30ec5a(_0x493efc);}else{return db[_0xcf9a('0x4d')][_0xcf9a('0x5a')]({'where':{'sectionId':_0x390640['id']},'raw':!![]})[_0xcf9a('0x21')](function(_0x542ef6){_0x542ef6?_0x30ec5a(_0x493efc):_0x30ec5a();});}}catch(_0x1ac151){_0x2213ab(_0x1ac151);}});}function getCustomDashboards(_0x4def36){var _0x591c60=[];return new BPromise(function(_0x3df84b,_0x19640c){try{if(_0x4def36[_0xcf9a('0x4c')]){return db[_0xcf9a('0x5b')][_0xcf9a('0x3d')]({'raw':!![]})['then'](function(_0x32e5fe){_0x32e5fe[_0xcf9a('0x5c')](function(_0x5cdf54){_0x591c60[_0xcf9a('0x53')](_0x5cdf54['id']+0x1869f);});_0x3df84b(_0x591c60);});}else{return db[_0xcf9a('0x4d')][_0xcf9a('0x3d')]({'where':{'sectionId':_0x4def36['id']},'raw':!![]})[_0xcf9a('0x21')](function(_0x36c1c2){_0x36c1c2[_0xcf9a('0x5c')](function(_0xffa176){_0x591c60[_0xcf9a('0x53')](_0xffa176[_0xcf9a('0x5d')]+0x1869f);});_0x3df84b(_0x591c60);});}}catch(_0x105c32){_0x19640c(_0x105c32);}});}function getPlugins(_0x436f90){var _0x33f4de=[];return new BPromise(function(_0x28d46c,_0x25aca1){try{if(_0x436f90[_0xcf9a('0x4c')]){return db[_0xcf9a('0x5e')][_0xcf9a('0x3d')]({'raw':!![]})['then'](function(_0x1f44bb){_0x1f44bb[_0xcf9a('0x5c')](function(_0x5cf952){_0x33f4de['push'](_0x5cf952['id']+0x15b38);});_0x28d46c(_0x33f4de);});}else{return db[_0xcf9a('0x4d')]['findAll']({'where':{'sectionId':_0x436f90['id']},'raw':!![]})[_0xcf9a('0x21')](function(_0x445da3){_0x445da3[_0xcf9a('0x5c')](function(_0x1e108f){_0x33f4de[_0xcf9a('0x53')](_0x1e108f[_0xcf9a('0x5d')]+0x15b38);});_0x28d46c(_0x33f4de);});}}catch(_0x317f54){_0x25aca1(_0x317f54);}});}exports[_0xcf9a('0x5f')]=function(_0x201a17,_0x55fe83){return db[_0xcf9a('0x26')]['find']({'where':{'id':_0x201a17[_0xcf9a('0x40')]['id']}})[_0xcf9a('0x21')](handleEntityNotFound(_0x55fe83,null))['then'](function(_0x1b2459){if(_0x1b2459){return db[_0xcf9a('0x60')][_0xcf9a('0x49')](function(_0x3c9331){return db[_0xcf9a('0x4a')][_0xcf9a('0x3d')]({'where':{'userProfileId':_0x201a17[_0xcf9a('0x40')]['id']},'attributes':['id'],'raw':!![]})[_0xcf9a('0x21')](function(_0x41f2eb){if(_0x41f2eb){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x201a17[_0xcf9a('0x40')]['id'],'id':_['map'](_0x41f2eb,function(_0x3db8e0){return _0x3db8e0['id'];})},'transaction':_0x3c9331});}})['then'](function(_0x7ef859){var _0x2758ce=_[_0xcf9a('0x2c')](_0x201a17['body'],function(_0x33a5b8){_0x33a5b8[_0xcf9a('0x61')]=_0x201a17[_0xcf9a('0x40')]['id'];return _0x33a5b8;});return db[_0xcf9a('0x4a')][_0xcf9a('0x62')](_0x2758ce,{'raw':!![],'transaction':_0x3c9331});})[_0xcf9a('0x21')](function(_0x4a1f2d){var _0x213ebe=_['filter'](_[_0xcf9a('0x2c')](_0x4a1f2d,function(_0x4ce027){return _0x4ce027[_0xcf9a('0x45')]({'plain':!![]});}),{'includeAll':![]});if(_0x213ebe){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x201a17[_0xcf9a('0x40')]['id'],'sectionId':_[_0xcf9a('0x2c')](_0x213ebe,function(_0x136ed2){return _0x136ed2[_0xcf9a('0x4f')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xcf9a('0x21')](function(_0x3d0ad2){var _0x5aa4a7=_[_0xcf9a('0x2c')](_0x201a17[_0xcf9a('0x44')],function(_0x4dcb3e){_0x4dcb3e[_0xcf9a('0x61')]=_0x201a17['params']['id'];return _0x4dcb3e;});return db[_0xcf9a('0x4d')][_0xcf9a('0x62')](_0x5aa4a7,{'raw':!![],'transaction':_0x3c9331});});}})[_0xcf9a('0x3e')](handleError(_0x55fe83,null));});}})['then'](function(_0x2b07cf){var _0x19cda8=_['map'](_0x2b07cf,function(_0x16d711){return _0x16d711[_0xcf9a('0x45')]({'plain':!![]});});})[_0xcf9a('0x21')](respondWithResult(_0x55fe83,null))['catch'](handleError(_0x55fe83,null));};exports[_0xcf9a('0x63')]=function(_0x3ff9a7,_0xfb7c48,_0x4e88c3){return db[_0xcf9a('0x26')]['find']({'where':{'id':_0x3ff9a7[_0xcf9a('0x40')]['id']}})[_0xcf9a('0x21')](handleEntityNotFound(_0xfb7c48,null))[_0xcf9a('0x21')](function(_0x2405c7){if(_0x2405c7){return _0x2405c7[_0xcf9a('0x63')](_0x3ff9a7['query'][_0xcf9a('0x64')]);}})['then'](respondWithStatusCode(_0xfb7c48,null))['catch'](handleError(_0xfb7c48,null));};exports[_0xcf9a('0x65')]=function(_0x21fb4b,_0x3aaa43){var _0x798239={};if(!_0x21fb4b[_0xcf9a('0x2d')][_0xcf9a('0x66')])throw new Error(_0xcf9a('0x67'));if(!_0x21fb4b[_0xcf9a('0x2d')][_0xcf9a('0x68')](_0xcf9a('0x69'))){_0x798239[_0xcf9a('0x34')]=qs[_0xcf9a('0x34')](_0x21fb4b['query'][_0xcf9a('0x34')]);_0x798239[_0xcf9a('0x1b')]=qs[_0xcf9a('0x1b')](_0x21fb4b[_0xcf9a('0x2d')][_0xcf9a('0x1b')]);}return db[_0xcf9a('0x26')][_0xcf9a('0x42')]({'where':{'id':_0x21fb4b[_0xcf9a('0x40')]['id']}})['then'](function(_0x14c26b){if(!_0x14c26b)throw new Error(_0xcf9a('0x6a')+_0x21fb4b['params']['id']);return db[_0xcf9a('0x26')][_0xcf9a('0x65')](_0x21fb4b);})[_0xcf9a('0x21')](respondWithFilteredResult(_0x3aaa43,_0x798239))[_0xcf9a('0x3e')](handleError(_0x3aaa43,null));}; \ No newline at end of file +var _0x1967=['isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','include','rows','catch','show','params','includeAll','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','Resources','destroy','describe','addSections','transaction','userProfileId','push','ids','getSections','enabled','includes'];(function(_0xc6daaa,_0x1f9d87){var _0x56f9dd=function(_0x49c01a){while(--_0x49c01a){_0xc6daaa['push'](_0xc6daaa['shift']());}};_0x56f9dd(++_0x1f9d87);}(_0x1967,0x173));var _0x7196=function(_0x36c3a3,_0x5bd5e5){_0x36c3a3=_0x36c3a3-0x0;var _0x1fd1d5=_0x1967[_0x36c3a3];return _0x1fd1d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];config[_0x7196('0x1c')]=_[_0x7196('0x1d')](config[_0x7196('0x1c')],{'host':_0x7196('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7196('0x1c')]));require(_0x7196('0x1f'))[_0x7196('0x20')](socket);function respondWithStatusCode(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xcc;return function(_0x31c778){if(_0x31c778){return _0xf098c1['sendStatus'](_0x511aa1);}return _0xf098c1[_0x7196('0x21')](_0x511aa1)[_0x7196('0x22')]();};}function respondWithResult(_0xf7e97,_0x3ed1ad){_0x3ed1ad=_0x3ed1ad||0xc8;return function(_0x12dce7){if(_0x12dce7){return _0xf7e97[_0x7196('0x21')](_0x3ed1ad)[_0x7196('0x23')](_0x12dce7);}};}function respondWithFilteredResult(_0x1ed296,_0x3e4e69){return function(_0x32fe2b){if(_0x32fe2b){var _0x385f2d=typeof _0x3e4e69['offset']==='undefined'&&typeof _0x3e4e69[_0x7196('0x24')]===_0x7196('0x25');var _0x40418d=_0x32fe2b['count'];var _0x39b944=_0x385f2d?0x0:_0x3e4e69['offset'];var _0x5b25f0=_0x385f2d?_0x32fe2b[_0x7196('0x26')]:_0x3e4e69[_0x7196('0x27')]+_0x3e4e69[_0x7196('0x24')];var _0x4ddf78;if(_0x5b25f0>=_0x40418d){_0x5b25f0=_0x40418d;_0x4ddf78=0xc8;}else{_0x4ddf78=0xce;}_0x1ed296['status'](_0x4ddf78);return _0x1ed296[_0x7196('0x28')](_0x7196('0x29'),_0x39b944+'-'+_0x5b25f0+'/'+_0x40418d)['json'](_0x32fe2b);}return null;};}function patchUpdates(_0x18649b){return function(_0x27ff84){try{jsonpatch[_0x7196('0x2a')](_0x27ff84,_0x18649b,!![]);}catch(_0x18d389){return BPromise[_0x7196('0x2b')](_0x18d389);}return _0x27ff84['save']();};}function saveUpdates(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x2c')](_0x3f8178)[_0x7196('0x2d')](function(_0xa69810){return _0xa69810;});}return null;};}function removeEntity(_0x70aa65,_0x43f6a2){return function(_0x530ab5){if(_0x530ab5){return _0x530ab5['destroy']()[_0x7196('0x2d')](function(){_0x70aa65[_0x7196('0x21')](0xcc)[_0x7196('0x22')]();});}};}function handleEntityNotFound(_0x4e878f,_0x5aa538){return function(_0x41cfd2){if(!_0x41cfd2){_0x4e878f[_0x7196('0x2e')](0x194);}return _0x41cfd2;};}function handleError(_0x675e64,_0x4c6006){_0x4c6006=_0x4c6006||0x1f4;return function(_0x35eef9){logger['error'](_0x35eef9[_0x7196('0x2f')]);if(_0x35eef9['name']){delete _0x35eef9[_0x7196('0x30')];}_0x675e64[_0x7196('0x21')](_0x4c6006)[_0x7196('0x31')](_0x35eef9);};}exports['index']=function(_0x35116f,_0x45d567){var _0x2f9583={},_0xf999e9={},_0x50c386={'count':0x0,'rows':[]};var _0x39710d=_[_0x7196('0x32')](db[_0x7196('0x33')][_0x7196('0x34')],function(_0x4780e1){return{'name':_0x4780e1[_0x7196('0x35')],'type':_0x4780e1[_0x7196('0x36')][_0x7196('0x37')]};});_0xf999e9[_0x7196('0x38')]=_[_0x7196('0x32')](_0x39710d,_0x7196('0x30'));_0xf999e9['query']=_[_0x7196('0x39')](_0x35116f['query']);_0xf999e9[_0x7196('0x3a')]=_['intersection'](_0xf999e9[_0x7196('0x38')],_0xf999e9[_0x7196('0x3b')]);_0x2f9583['attributes']=_[_0x7196('0x3c')](_0xf999e9[_0x7196('0x38')],qs[_0x7196('0x3d')](_0x35116f[_0x7196('0x3b')][_0x7196('0x3d')]));_0x2f9583['attributes']=_0x2f9583[_0x7196('0x3e')][_0x7196('0x3f')]?_0x2f9583[_0x7196('0x3e')]:_0xf999e9[_0x7196('0x38')];if(!_0x35116f[_0x7196('0x3b')][_0x7196('0x40')]('nolimit')){_0x2f9583[_0x7196('0x24')]=qs[_0x7196('0x24')](_0x35116f[_0x7196('0x3b')]['limit']);_0x2f9583[_0x7196('0x27')]=qs[_0x7196('0x27')](_0x35116f[_0x7196('0x3b')][_0x7196('0x27')]);}_0x2f9583[_0x7196('0x41')]=qs[_0x7196('0x42')](_0x35116f[_0x7196('0x3b')][_0x7196('0x42')]);_0x2f9583[_0x7196('0x43')]=qs[_0x7196('0x3a')](_['pick'](_0x35116f[_0x7196('0x3b')],_0xf999e9[_0x7196('0x3a')]),_0x39710d);if(_0x35116f['query'][_0x7196('0x44')]){_0x2f9583['where']=_['merge'](_0x2f9583[_0x7196('0x43')],{'$or':_[_0x7196('0x32')](_0x39710d,function(_0x4d03c9){if(_0x4d03c9['type']!==_0x7196('0x45')){var _0x2a62e8={};_0x2a62e8[_0x4d03c9[_0x7196('0x30')]]={'$like':'%'+_0x35116f['query'][_0x7196('0x44')]+'%'};return _0x2a62e8;}})});}_0x2f9583=_[_0x7196('0x46')]({},_0x2f9583,_0x35116f[_0x7196('0x47')]);var _0x29c58d={'where':_0x2f9583[_0x7196('0x43')]};return db[_0x7196('0x33')][_0x7196('0x26')](_0x29c58d)[_0x7196('0x2d')](function(_0x5cd903){_0x50c386[_0x7196('0x26')]=_0x5cd903;if(_0x35116f[_0x7196('0x3b')]['includeAll']){_0x2f9583[_0x7196('0x48')]=[{'all':!![]}];}return db[_0x7196('0x33')]['findAll'](_0x2f9583);})[_0x7196('0x2d')](function(_0x471bb2){_0x50c386[_0x7196('0x49')]=_0x471bb2;return _0x50c386;})['then'](respondWithFilteredResult(_0x45d567,_0x2f9583))[_0x7196('0x4a')](handleError(_0x45d567,null));};exports[_0x7196('0x4b')]=function(_0x54f6fc,_0xcd287c){var _0x1a7052={'raw':![],'where':{'id':_0x54f6fc[_0x7196('0x4c')]['id']}},_0x4f0c6c={};_0x4f0c6c['model']=_['keys'](db['UserProfile']['rawAttributes']);_0x4f0c6c['query']=_[_0x7196('0x39')](_0x54f6fc['query']);_0x4f0c6c[_0x7196('0x3a')]=_[_0x7196('0x3c')](_0x4f0c6c[_0x7196('0x38')],_0x4f0c6c[_0x7196('0x3b')]);_0x1a7052['attributes']=_[_0x7196('0x3c')](_0x4f0c6c['model'],qs[_0x7196('0x3d')](_0x54f6fc[_0x7196('0x3b')][_0x7196('0x3d')]));_0x1a7052['attributes']=_0x1a7052[_0x7196('0x3e')][_0x7196('0x3f')]?_0x1a7052[_0x7196('0x3e')]:_0x4f0c6c['model'];if(_0x54f6fc['query'][_0x7196('0x4d')]){_0x1a7052['include']=[{'all':!![]}];}_0x1a7052=_[_0x7196('0x46')]({},_0x1a7052,_0x54f6fc['options']);return db['UserProfile'][_0x7196('0x4e')](_0x1a7052)['then'](handleEntityNotFound(_0xcd287c,null))['then'](respondWithResult(_0xcd287c,null))['catch'](handleError(_0xcd287c,null));};exports[_0x7196('0x4f')]=function(_0x5052ee,_0x48e3b5){return db[_0x7196('0x33')][_0x7196('0x4f')](_0x5052ee[_0x7196('0x50')],{})[_0x7196('0x2d')](respondWithResult(_0x48e3b5,0xc9))['catch'](handleError(_0x48e3b5,null));};exports[_0x7196('0x51')]=function(_0x564688,_0x36844f){var _0x143c58={'where':{'id':_0x564688[_0x7196('0x4c')]['id']}},_0x513855={};_0x513855[_0x7196('0x38')]=_[_0x7196('0x39')](db['UserProfile'][_0x7196('0x34')]);_0x143c58['attributes']=_[_0x7196('0x3c')](_0x513855[_0x7196('0x38')],qs[_0x7196('0x3d')](_0x564688[_0x7196('0x3b')][_0x7196('0x3d')]));_0x143c58[_0x7196('0x3e')]=_0x143c58[_0x7196('0x3e')][_0x7196('0x3f')]?_0x143c58['attributes']:_0x513855['model'];if(_0x564688[_0x7196('0x3b')][_0x7196('0x4d')]){_0x143c58[_0x7196('0x48')]=[{'all':!![]}];}_0x143c58=_[_0x7196('0x46')]({},_0x143c58,_0x564688['options']);return db[_0x7196('0x33')][_0x7196('0x4e')](_0x143c58)[_0x7196('0x2d')](handleEntityNotFound(_0x36844f,null))[_0x7196('0x2d')](function(_0x9fcfd4){if(_0x9fcfd4){var _0x3177c2=_0x9fcfd4[_0x7196('0x52')]({'plain':!![]});_0x3177c2=qs[_0x7196('0x53')](_0x3177c2,['id',_0x7196('0x54'),_0x7196('0x55'),_0x7196('0x56')]);_0x564688['body']=_[_0x7196('0x53')](_0x564688[_0x7196('0x50')],['id',_0x7196('0x54'),'updatedAt']);return db[_0x7196('0x57')]['transaction'](function(_0x34407d){return db[_0x7196('0x33')][_0x7196('0x4f')](_[_0x7196('0x46')](_0x3177c2,_0x564688[_0x7196('0x50')]),{'include':_0x564688['query'][_0x7196('0x4d')]?[{'all':!![]}]:undefined,'transaction':_0x34407d})['then'](function(_0x4be36d){var _0x5b9824=_0x4be36d[_0x7196('0x52')]({'plain':!![]});return db[_0x7196('0x58')][_0x7196('0x59')]({'where':{'userProfileId':_0x564688[_0x7196('0x4c')]['id']},'raw':!![]})[_0x7196('0x2d')](function(_0x41fa94){if(_0x41fa94){return BPromise[_0x7196('0x5a')](_0x41fa94,function(_0x560ddb){return new BPromise(function(_0x293467,_0x14dc43){if(_0x560ddb[_0x7196('0x5b')]===null||_0x560ddb[_0x7196('0x5b')]===0x1)_0x293467(null);return db[_0x7196('0x5c')]['findAll']({'where':{'sectionId':_0x560ddb['id']},'raw':!![]})['then'](function(_0xa7ecfb){var _0x1c7eb2=_[_0x7196('0x32')](_0xa7ecfb,function(_0x799399){return qs[_0x7196('0x53')](_0x799399,['id',_0x7196('0x54'),_0x7196('0x55'),_0x7196('0x5d')]);});_0x293467(_0x1c7eb2);})[_0x7196('0x4a')](function(_0x2caadd){_0x14dc43(_0x2caadd);});})[_0x7196('0x2d')](function(_0x57d729){var _0x33dee7=qs[_0x7196('0x53')](_0x560ddb,['id',_0x7196('0x54'),_0x7196('0x55')]);_0x33dee7['userProfileId']=_0x5b9824['id'];if(_0x57d729)_0x33dee7[_0x7196('0x5e')]=_0x57d729;return _0x33dee7;})[_0x7196('0x2d')](function(_0x1f3acc){return db[_0x7196('0x58')][_0x7196('0x4f')](_0x1f3acc,{'include':[{'model':db[_0x7196('0x5c')],'as':_0x7196('0x5e')}],'raw':!![],'transaction':_0x34407d});});})['then'](function(){return _0x5b9824;});}});});});}})[_0x7196('0x2d')](respondWithResult(_0x36844f,0xc9))[_0x7196('0x4a')](handleError(_0x36844f,null));};exports[_0x7196('0x2c')]=function(_0x3fb671,_0x52827f){if(_0x3fb671[_0x7196('0x50')]['id']){delete _0x3fb671[_0x7196('0x50')]['id'];}return db[_0x7196('0x33')][_0x7196('0x4e')]({'where':{'id':_0x3fb671[_0x7196('0x4c')]['id']}})[_0x7196('0x2d')](handleEntityNotFound(_0x52827f,null))[_0x7196('0x2d')](saveUpdates(_0x3fb671['body'],null))['then'](respondWithResult(_0x52827f,null))['catch'](handleError(_0x52827f,null));};exports[_0x7196('0x5f')]=function(_0x49183a,_0xd94bd1){return db[_0x7196('0x33')][_0x7196('0x4e')]({'where':{'id':_0x49183a[_0x7196('0x4c')]['id']}})[_0x7196('0x2d')](handleEntityNotFound(_0xd94bd1,null))[_0x7196('0x2d')](removeEntity(_0xd94bd1,null))[_0x7196('0x4a')](handleError(_0xd94bd1,null));};exports[_0x7196('0x60')]=function(_0x3881a5,_0x52ab69){return db['UserProfile'][_0x7196('0x60')]()[_0x7196('0x2d')](respondWithResult(_0x52ab69,null))[_0x7196('0x4a')](handleError(_0x52ab69,null));};exports[_0x7196('0x61')]=function(_0x30ddb6,_0x45e21f){var _0xa55f4b=_0x30ddb6[_0x7196('0x50')];return db['UserProfile']['find']({'where':{'id':_0x30ddb6[_0x7196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x45e21f,null))[_0x7196('0x2d')](function(_0x52f532){if(_0x52f532){return db[_0x7196('0x57')][_0x7196('0x62')](function(_0x74fa58){return db[_0x7196('0x58')]['destroy']({'where':{'userProfileId':_0x30ddb6['params']['id'],'sectionId':_[_0x7196('0x32')](_0xa55f4b,function(_0x5328c5){return _0x5328c5[_0x7196('0x5d')];})},'transaction':_0x74fa58})[_0x7196('0x2d')](function(){var _0x4526e8=_[_0x7196('0x32')](_0xa55f4b,function(_0xd4c784){_0xd4c784[_0x7196('0x63')]=_0x30ddb6['params']['id'];return _0xd4c784;});var _0x3128e6=[];return BPromise[_0x7196('0x5a')](_0x4526e8,function(_0x41208b){return db[_0x7196('0x58')][_0x7196('0x4f')](_0x41208b,{'include':[{'model':db[_0x7196('0x5c')],'as':_0x7196('0x5e')}],'raw':!![],'transaction':_0x74fa58})[_0x7196('0x2d')](function(_0x13cbe2){_0x3128e6[_0x7196('0x64')](_0x13cbe2[_0x7196('0x52')]({'plain':!![]}));});})[_0x7196('0x2d')](function(){return _0x3128e6;});});});}})['then'](function(_0x431415){return _0x431415;})[_0x7196('0x2d')](respondWithResult(_0x45e21f,null))['catch'](handleError(_0x45e21f,null));};exports['removeSections']=function(_0x2a98c6,_0x45363c){var _0x71c062;return db['UserProfile'][_0x7196('0x4e')]({'where':{'id':_0x2a98c6['params']['id']},'attributes':['id',_0x7196('0x30')]})[_0x7196('0x2d')](handleEntityNotFound(_0x45363c,null))['then'](function(_0x1b3d4a){if(_0x1b3d4a){_0x71c062=_0x1b3d4a;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2a98c6[_0x7196('0x4c')]['id'],'sectionId':_0x2a98c6[_0x7196('0x3b')][_0x7196('0x65')]}});}})['then'](function(){return _0x71c062;})[_0x7196('0x2d')](respondWithStatusCode(_0x45363c,null))['catch'](handleError(_0x45363c,null));};exports[_0x7196('0x66')]=function(_0x36b828,_0x422f7f){var _0x27579e=[];var _0x2bb345=[];return db['UserProfileSection'][_0x7196('0x59')]({'where':{'userProfileId':_0x36b828[_0x7196('0x4c')]['id']},'raw':!![]})[_0x7196('0x2d')](function(_0x283eae){_0x27579e=_[_0x7196('0x44')](_0x283eae,function(_0x29bafd){return _0x29bafd[_0x7196('0x67')]===0x1||_[_0x7196('0x68')]([0x3eb,0x709],_0x29bafd['sectionId']);});if(!_[_0x7196('0x69')](_0x27579e)){return _[_0x7196('0x32')](_0x27579e,function(_0x28a29d){return _0x28a29d[_0x7196('0x5d')];});}else{return;}})['then'](function(_0x1364f5){if(_0x1364f5)_0x2bb345=_0x1364f5;if(_[_0x7196('0x68')](_0x2bb345,0x64)){var _0x4fe2cb=_[_0x7196('0x4e')](_0x27579e,{'sectionId':0x64});return hasDefaultDashboard(_0x4fe2cb)['then'](function(_0xd6d8cf){return _['map'](_0x27579e,function(_0x3cf0ca){if(_0x3cf0ca[_0x7196('0x5d')]===0x64){_0x3cf0ca['subsections']=_0xd6d8cf;}return _0x3cf0ca;});});}else{return;}})[_0x7196('0x2d')](function(_0x2b52c0){if(_0x2b52c0)_0x27579e=_0x2b52c0;if(_[_0x7196('0x68')](_0x2bb345,0x3eb)){var _0x4d5ea0=_['find'](_0x27579e,{'sectionId':0x3eb});return getCustomDashboards(_0x4d5ea0)[_0x7196('0x2d')](function(_0x591a34){return _['map'](_0x27579e,function(_0x3d29b6){if(_0x4d5ea0[_0x7196('0x67')]){if(_0x3d29b6[_0x7196('0x5d')]===0x3eb){_0x3d29b6['subsections']=_0x591a34;}}else{if(_0x3d29b6[_0x7196('0x5d')]===0x64){_0x3d29b6[_0x7196('0x6a')]=_0x591a34;}}return _0x3d29b6;});});}else{return;}})[_0x7196('0x2d')](function(_0x175dd8){if(_0x175dd8)_0x27579e=_0x175dd8;if(_[_0x7196('0x68')](_0x2bb345,0x709)){var _0x26048c=_[_0x7196('0x4e')](_0x27579e,{'sectionId':0x709});return getPlugins(_0x26048c)[_0x7196('0x2d')](function(_0x32ba47){if(_0x26048c[_0x7196('0x67')]){return _[_0x7196('0x32')](_0x27579e,function(_0x5eb2b5){if(_0x5eb2b5['sectionId']===0x709){_0x5eb2b5[_0x7196('0x6a')]=_0x32ba47;}return _0x5eb2b5;});}else{var _0x5d52a8={'sectionId':0x76c,'enabled':0x1,'subsections':_0x32ba47};var _0x588da9=_[_0x7196('0x32')](_0x27579e);_0x588da9[_0x7196('0x64')](_0x5d52a8);return _0x588da9;}});}else{return;}})[_0x7196('0x2d')](function(_0x3fe7fd){if(_0x3fe7fd)_0x27579e=_0x3fe7fd;return _['filter'](_0x27579e,['enabled',0x1]);})[_0x7196('0x2d')](respondWithResult(_0x422f7f,null))[_0x7196('0x4a')](handleError(_0x422f7f,null));};function hasDefaultDashboard(_0x1eea71){var _0x247b15=[0x65];return new BPromise(function(_0x4bcaa3,_0x4d8b8e){try{if(_0x1eea71['autoAssociation']){_0x4bcaa3(_0x247b15);}else{return db['UserProfileResource'][_0x7196('0x6b')]({'where':{'sectionId':_0x1eea71['id']},'raw':!![]})[_0x7196('0x2d')](function(_0x1e14da){_0x1e14da?_0x4bcaa3(_0x247b15):_0x4bcaa3();});}}catch(_0x494418){_0x4d8b8e(_0x494418);}});}function getCustomDashboards(_0x400aa5){var _0x40d4c3=[];return new BPromise(function(_0x1824e2,_0x30c54b){try{if(_0x400aa5[_0x7196('0x5b')]){return db[_0x7196('0x6c')][_0x7196('0x59')]({'raw':!![]})[_0x7196('0x2d')](function(_0x5de550){_0x5de550[_0x7196('0x6d')](function(_0x2479b9){_0x40d4c3[_0x7196('0x64')](_0x2479b9['id']+0x1869f);});_0x1824e2(_0x40d4c3);});}else{return db[_0x7196('0x5c')][_0x7196('0x59')]({'where':{'sectionId':_0x400aa5['id']},'raw':!![]})['then'](function(_0x214e8e){_0x214e8e[_0x7196('0x6d')](function(_0x446eb8){_0x40d4c3['push'](_0x446eb8[_0x7196('0x6e')]+0x1869f);});_0x1824e2(_0x40d4c3);});}}catch(_0x4b98de){_0x30c54b(_0x4b98de);}});}function getPlugins(_0x53ae84){var _0x1dcf93=[];return new BPromise(function(_0x25d323,_0x5b85f7){try{if(_0x53ae84[_0x7196('0x5b')]){return db[_0x7196('0x6f')]['findAll']({'raw':!![]})[_0x7196('0x2d')](function(_0xdd5f69){_0xdd5f69[_0x7196('0x6d')](function(_0x28d665){_0x1dcf93[_0x7196('0x64')](_0x28d665['id']+0x15b38);});_0x25d323(_0x1dcf93);});}else{return db[_0x7196('0x5c')]['findAll']({'where':{'sectionId':_0x53ae84['id']},'raw':!![]})[_0x7196('0x2d')](function(_0x460e51){_0x460e51[_0x7196('0x6d')](function(_0x5b09a1){_0x1dcf93['push'](_0x5b09a1['resourceId']+0x15b38);});_0x25d323(_0x1dcf93);});}}catch(_0x1ae7cb){_0x5b85f7(_0x1ae7cb);}});}exports[_0x7196('0x70')]=function(_0x43e84b,_0x5d01e5){return db[_0x7196('0x33')]['find']({'where':{'id':_0x43e84b[_0x7196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5d01e5,null))[_0x7196('0x2d')](function(_0x18bafa){if(_0x18bafa){return db[_0x7196('0x57')][_0x7196('0x62')](function(_0x37290e){return db[_0x7196('0x58')][_0x7196('0x59')]({'where':{'userProfileId':_0x43e84b['params']['id']},'attributes':['id'],'raw':!![]})[_0x7196('0x2d')](function(_0x4a3cd1){if(_0x4a3cd1){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x43e84b['params']['id'],'id':_['map'](_0x4a3cd1,function(_0x3bcddb){return _0x3bcddb['id'];})},'transaction':_0x37290e});}})[_0x7196('0x2d')](function(_0x3fe3f5){var _0x5bab25=_[_0x7196('0x32')](_0x43e84b['body'],function(_0x5080fd){_0x5080fd['userProfileId']=_0x43e84b[_0x7196('0x4c')]['id'];return _0x5080fd;});return db['UserProfileSection'][_0x7196('0x71')](_0x5bab25,{'raw':!![],'transaction':_0x37290e});})[_0x7196('0x2d')](function(_0x27b119){var _0x1b6665=_[_0x7196('0x44')](_[_0x7196('0x32')](_0x27b119,function(_0x237a73){return _0x237a73[_0x7196('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x1b6665){return db['UserProfileSection'][_0x7196('0x59')]({'where':{'userProfileId':_0x43e84b[_0x7196('0x4c')]['id'],'sectionId':_[_0x7196('0x32')](_0x1b6665,function(_0x4ec005){return _0x4ec005[_0x7196('0x5d')];})},'attributes':['id',_0x7196('0x5d')],'raw':!![]})[_0x7196('0x2d')](function(_0x4fa1b5){var _0x6c7aa9=_[_0x7196('0x32')](_0x43e84b[_0x7196('0x50')],function(_0x5ee1e7){_0x5ee1e7[_0x7196('0x63')]=_0x43e84b[_0x7196('0x4c')]['id'];return _0x5ee1e7;});return db['UserProfileResource'][_0x7196('0x71')](_0x6c7aa9,{'raw':!![],'transaction':_0x37290e});});}})['catch'](handleError(_0x5d01e5,null));});}})[_0x7196('0x2d')](function(_0x2c2922){var _0x52dfe6=_[_0x7196('0x32')](_0x2c2922,function(_0x5e20a3){return _0x5e20a3[_0x7196('0x52')]({'plain':!![]});});})[_0x7196('0x2d')](respondWithResult(_0x5d01e5,null))[_0x7196('0x4a')](handleError(_0x5d01e5,null));};exports['removeResources']=function(_0xd9619d,_0x1c5d74,_0x3edca7){return db[_0x7196('0x33')]['find']({'where':{'id':_0xd9619d[_0x7196('0x4c')]['id']}})[_0x7196('0x2d')](handleEntityNotFound(_0x1c5d74,null))[_0x7196('0x2d')](function(_0x58e03a){if(_0x58e03a){return _0x58e03a['removeResources'](_0xd9619d[_0x7196('0x3b')][_0x7196('0x65')]);}})[_0x7196('0x2d')](respondWithStatusCode(_0x1c5d74,null))[_0x7196('0x4a')](handleError(_0x1c5d74,null));};exports['getResources']=function(_0x397b26,_0x47c799){var _0x120360={};if(!_0x397b26['query'][_0x7196('0x72')])throw new Error(_0x7196('0x73'));if(!_0x397b26[_0x7196('0x3b')][_0x7196('0x40')](_0x7196('0x74'))){_0x120360[_0x7196('0x24')]=qs[_0x7196('0x24')](_0x397b26['query'][_0x7196('0x24')]);_0x120360[_0x7196('0x27')]=qs[_0x7196('0x27')](_0x397b26[_0x7196('0x3b')][_0x7196('0x27')]);}return db[_0x7196('0x33')][_0x7196('0x4e')]({'where':{'id':_0x397b26[_0x7196('0x4c')]['id']}})['then'](function(_0x44d705){if(!_0x44d705)throw new Error(_0x7196('0x75')+_0x397b26['params']['id']);return db[_0x7196('0x33')][_0x7196('0x76')](_0x397b26);})['then'](respondWithFilteredResult(_0x47c799,_0x120360))[_0x7196('0x4a')](handleError(_0x47c799,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 5604759..8d7b616 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 _0xd634=['emit','hasOwnProperty','hook','exports','../../mysqldb','UserProfile','update','remove'];(function(_0x36ae11,_0x4c334e){var _0x470b3d=function(_0x285be0){while(--_0x285be0){_0x36ae11['push'](_0x36ae11['shift']());}};_0x470b3d(++_0x4c334e);}(_0xd634,0xf4));var _0x4d63=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0xd634[_0xc0d9bc];return _0x32ff73;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x4d63('0x0'))['db'][_0x4d63('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d63('0x2'),'afterDestroy':_0x4d63('0x3')};function emitEvent(_0x478b56){return function(_0x4f99ac,_0x2b8d62,_0x35ba45){UserProfileEvents[_0x4d63('0x4')](_0x478b56+':'+_0x4f99ac['id'],_0x4f99ac);UserProfileEvents[_0x4d63('0x4')](_0x478b56,_0x4f99ac);_0x35ba45(null);};}for(var e in events){if(events[_0x4d63('0x5')](e)){var event=events[e];UserProfile[_0x4d63('0x6')](e,emitEvent(event));}}module[_0x4d63('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x16ce=['exports','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2b33e8,_0x2e01fe){var _0x1e9cce=function(_0x2d4e95){while(--_0x2d4e95){_0x2b33e8['push'](_0x2b33e8['shift']());}};_0x1e9cce(++_0x2e01fe);}(_0x16ce,0xfb));var _0xe16c=function(_0x45c3ae,_0x413f38){_0x45c3ae=_0x45c3ae-0x0;var _0x2c82f9=_0x16ce[_0x45c3ae];return _0x2c82f9;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xe16c('0x0'))['db'][_0xe16c('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe16c('0x2')](0x0);var events={'afterCreate':_0xe16c('0x3'),'afterUpdate':_0xe16c('0x4'),'afterDestroy':_0xe16c('0x5')};function emitEvent(_0x546ed6){return function(_0x55c37e,_0x4a5fc8,_0x884769){UserProfileEvents['emit'](_0x546ed6+':'+_0x55c37e['id'],_0x55c37e);UserProfileEvents[_0xe16c('0x6')](_0x546ed6,_0x55c37e);_0x884769(null);};}for(var e in events){if(events[_0xe16c('0x7')](e)){var event=events[e];UserProfile[_0xe16c('0x8')](e,emitEvent(event));}}module[_0xe16c('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 35408df..2823839 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 _0xaa3f=['lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','name','catch','resolve','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','type','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','voicequeues','queuecampaigns','QueueCampaigns','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','Disposition','customdashboards','Dashboard','intervals','Interval','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','sequelize','then','OpenTabs','define','user_profiles','query','mergeResources','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','model','rawAttributes','keys','attributes','fields','nolimit','limit','offset','order','sort','where','pick','filters','merge','VIRTUAL','foreignKey','options','include','forEach','default','DefaultReports','custom','CustomReports','rows','count','includeAll','CmContact','color','tag','ThroughTags','openTabs','true','dataValues','sms','fax','mail','openchannel'];(function(_0x1c0615,_0x13c855){var _0x495548=function(_0x21c2f8){while(--_0x21c2f8){_0x1c0615['push'](_0x1c0615['shift']());}};_0x495548(++_0x13c855);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x19c967,_0x4d538e){_0x19c967=_0x19c967-0x0;var _0x386e76=_0xaa3f[_0x19c967];return _0x386e76;};'use strict';var _=require(_0xfaa3('0x0'));var attributes=require(_0xfaa3('0x1'));var qs=require(_0xfaa3('0x2'));var squel=require(_0xfaa3('0x3'));module[_0xfaa3('0x4')]=function(_0x1da39b){var _0x408343=_0x1da39b[_0xfaa3('0x5')];function _0x32f4e1(_0x5123a3,_0x513eea){return new Promise(function(_0x2ac57f,_0x4bac92){if(!_0x513eea)return _0x2ac57f(null);var _0x3d09aa=_0x513eea[_0xfaa3('0x6')]?{[_0x513eea[_0xfaa3('0x6')][_0xfaa3('0x7')]]:_0x513eea[_0xfaa3('0x6')][_0xfaa3('0x8')]}:undefined;return _0x408343[_0x5123a3][_0xfaa3('0x9')]({'where':_0x3d09aa,'raw':!![]})['then'](function(_0x37bcd5){_0x513eea[_0xfaa3('0xa')]=_['map'](_0x37bcd5,'id');_0x2ac57f(_0x513eea);})['catch'](function(_0x44d88e){_0x4bac92(_0x44d88e);});});}function _0xce3b1f(_0x34d3dc,_0x278e6c){return new Promise(function(_0x23e4b6,_0x32866b){var _0x5e1b29=_0x34d3dc[_0xfaa3('0x6')]?{[_0x34d3dc['filter'][_0xfaa3('0x7')]]:_0x34d3dc[_0xfaa3('0x6')][_0xfaa3('0x8')]}:undefined;return _0x408343[_0x34d3dc['model']][_0xfaa3('0x9')]({'where':_0x5e1b29,'raw':!![]})['then'](function(_0xdf7551){_0x278e6c[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0xdf7551,function(_0x3ddb40){return _0x3ddb40[_0xfaa3('0xc')];});_0x23e4b6(_0x278e6c);})[_0xfaa3('0xd')](function(_0x4da250){_0x32866b(_0x4da250);});});}function _0x5f47dd(_0x46e112,_0xe1a082,_0x407384){if(!_0xe1a082)return Promise[_0xfaa3('0xe')](null);return new Promise(function(_0x4e54e4,_0x5dd38c){return _0x408343['UserProfileResource']['findAll']({'where':{'sectionId':_0xe1a082['id']},'raw':!![]})['then'](function(_0x275a07){if(_0x46e112['field']&&_0x46e112[_0xfaa3('0x7')]!=='id'){_0xe1a082[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0x275a07,function(_0x34b276){return _0x34b276[_0x46e112[_0xfaa3('0x7')]];});}else{if(_0x407384===_0xfaa3('0xf')){_0xe1a082[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0x275a07,function(_0x220c9e){return{'id':_0x220c9e[_0xfaa3('0x10')],'type':_0x220c9e['type']};});}else{_0xe1a082[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0x275a07,function(_0x26d9ef){return _0x26d9ef[_0xfaa3('0x10')];});}}_0x4e54e4(_0xe1a082);})['catch'](function(_0x1f7324){_0x5dd38c(_0x1f7324);});});}function _0x2d4087(_0x2f077c,_0x22156a){var _0x16a3e3={'parentSections':[]};switch(_0x2f077c[_0xfaa3('0x11')]()){case _0xfaa3('0x12'):_0x16a3e3[_0xfaa3('0x13')]='SquareProject';break;case _0xfaa3('0x14'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x15');break;case _0xfaa3('0x16'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x17');_0x16a3e3[_0xfaa3('0x18')]=[{'name':_0xfaa3('0x19'),'field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x1a')}];break;case _0xfaa3('0x1b'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x1c');break;case _0xfaa3('0x1d'):_0x16a3e3[_0xfaa3('0x13')]='CmContact';_0x16a3e3[_0xfaa3('0x18')]=[{'name':_0xfaa3('0x1e'),'field':'id','foreignKey':_0xfaa3('0x1f')}];break;case'lists':_0x16a3e3[_0xfaa3('0x13')]='CmList';break;case _0xfaa3('0x20'):_0x16a3e3['childModel']=_0xfaa3('0x21');break;case _0xfaa3('0x22'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x23');break;case _0xfaa3('0x24'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x25');break;case _0xfaa3('0x26'):_0x16a3e3['childModel']=_0xfaa3('0x27');break;case _0xfaa3('0x28'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x29');break;case _0xfaa3('0x2a'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x2b');break;case _0xfaa3('0x2c'):case _0xfaa3('0x2d'):case _0xfaa3('0x2e'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x2f');break;case _0xfaa3('0x30'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x31');break;case _0xfaa3('0x32'):_0x16a3e3['childModel']=_0xfaa3('0x33');break;case _0xfaa3('0x34'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x35');_0x16a3e3[_0xfaa3('0x18')]=[{'name':_0xfaa3('0x36'),'field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x37'),'model':'User','filter':{'field':_0xfaa3('0x38'),'value':[_0xfaa3('0x39')]}},{'name':_0xfaa3('0x3a'),'field':'name','foreignKey':_0xfaa3('0x37'),'model':_0xfaa3('0x3b'),'filter':{'field':'role','value':[_0xfaa3('0x3c')]}},{'name':_0xfaa3('0x3d'),'field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x3e'),'model':_0xfaa3('0x3f'),'filter':{'field':_0xfaa3('0x40'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x3e'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xfaa3('0x41')]}}];break;case'musiconholds':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x42');break;case _0xfaa3('0x43'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x44');break;case _0xfaa3('0x45'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x46');break;case'ivrcampaigns':_0x16a3e3['childModel']='Campaign';break;case'mailqueues':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x47');break;case'mailaccounts':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x48');break;case _0xfaa3('0x49'):_0x16a3e3['childModel']='MailSubstatus';break;case _0xfaa3('0x4a'):_0x16a3e3['childModel']=_0xfaa3('0x4b');break;case'openchannelaccounts':_0x16a3e3['childModel']=_0xfaa3('0x4c');break;case _0xfaa3('0x4d'):_0x16a3e3['childModel']=_0xfaa3('0x4e');break;case'smsaccounts':_0x16a3e3[_0xfaa3('0x13')]='SmsAccount';break;case _0xfaa3('0x4f'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x50');break;case'whatsappaccounts':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x51');break;case'teams':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x52');break;case _0xfaa3('0x53'):case _0xfaa3('0x54'):_0x16a3e3['childModel']=_0xfaa3('0x3f');if(_0x22156a){_0x16a3e3[_0xfaa3('0x18')]=[{'name':'VoiceQueues'},{'name':_0xfaa3('0x55')}];}break;case'users':case _0xfaa3('0x56'):case _0xfaa3('0x57'):_0x16a3e3[_0xfaa3('0x13')]='User';if(_0x22156a){_0x16a3e3[_0xfaa3('0x18')]=[{'name':'Users','filter':{'field':'role','value':[_0xfaa3('0x58'),_0xfaa3('0x59')]},'ignore':!![]},{'name':_0xfaa3('0x36')},{'name':_0xfaa3('0x3a')}];}break;case _0xfaa3('0x5a'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x5b');break;case'salesforceaccounts':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x5c');break;case _0xfaa3('0x5d'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x5e');break;case _0xfaa3('0x5f'):_0x16a3e3[_0xfaa3('0x13')]='SugarcrmAccount';break;case'deskaccounts':_0x16a3e3['childModel']=_0xfaa3('0x60');break;case _0xfaa3('0x61'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x62');break;case'vtigeraccounts':_0x16a3e3[_0xfaa3('0x13')]='User';break;case'cannedanswers':_0x16a3e3['childModel']='CannedAnswer';break;case'dispositions':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x63');break;case _0xfaa3('0x64'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x65');break;case _0xfaa3('0x66'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x67');break;case'pauses':_0x16a3e3[_0xfaa3('0x13')]='Pause';break;case'scheduler':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x68');break;case _0xfaa3('0x69'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x6a');break;case _0xfaa3('0x6b'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x6c');break;case _0xfaa3('0x6d'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x6e');break;case _0xfaa3('0x6f'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x70');break;case _0xfaa3('0x71'):_0x16a3e3['childModel']=_0xfaa3('0x72');break;case'variables':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x73');break;case _0xfaa3('0x74'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x75');break;case _0xfaa3('0x76'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0xf');_0x16a3e3[_0xfaa3('0x18')]=[{'name':'Reports','field':'id','foreignKey':_0xfaa3('0x77')}];break;case _0xfaa3('0x78'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x79');break;}return _0x16a3e3;}function _0x5ccb10(_0x1fd6d7,_0x1cf28e){var _0x172a2c=_0x1fd6d7[_0xfaa3('0x7a')](0x0)[_0xfaa3('0x7b')]()+_0x1fd6d7[_0xfaa3('0x7c')](0x1);var _0x42e7f9={'type':_0x408343['Sequelize'][_0xfaa3('0x7d')][_0xfaa3('0x7e')],'raw':!![]};return new Promise(function(_0x22ce8c,_0x17e10a){var _0x5d8277=squel[_0xfaa3('0x7f')]()[_0xfaa3('0x7')](_0xfaa3('0x80')+_0x172a2c+_0xfaa3('0x81'),'id')[_0xfaa3('0x7')](_0xfaa3('0x82'))[_0xfaa3('0x83')](_0xfaa3('0x84')+_0x1fd6d7+_0xfaa3('0x85'),'ui')['where']('ui.UserId\x20=\x20?',_0x1cf28e['id']);return _0x408343[_0xfaa3('0x86')]['query'](_0x5d8277['toString'](),_0x42e7f9)[_0xfaa3('0x87')](function(_0x8b7c){_0x1cf28e[_0x172a2c+_0xfaa3('0x88')]=_0x8b7c;_0x22ce8c(_0x8b7c);})['catch'](function(_0x142f5b){_0x17e10a(_0x142f5b);});});}return _0x1da39b[_0xfaa3('0x89')]('UserProfile',attributes,{'tableName':_0xfaa3('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2a1dde){var _0x2ef70d={'raw':![],'where':{}};var _0x304af6={};var _0x4a537f={'count':0x0,'rows':[]};var _0x1fd9cf=_0x2a1dde[_0xfaa3('0x8b')]['section'];var _0x345291=_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x8c')]||![];var _0x1df722=_0x2d4087(_0x1fd9cf,_0x345291);if(!_0x1df722[_0xfaa3('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x1fd9cf+'\x27');var _0x17b747=[{'name':_0x1fd9cf}];if(!_[_0xfaa3('0x8d')](_0x1df722['parentSections']))_0x17b747=_0x1df722['parentSections'];var _0x5b3a99=[];for(var _0x4e1069=0x0;_0x4e1069<_0x17b747[_0xfaa3('0x8e')];_0x4e1069++){_0x5b3a99[_0xfaa3('0x8f')](_0x408343[_0xfaa3('0x90')][_0xfaa3('0x91')]({'where':{'userProfileId':_0x2a1dde[_0xfaa3('0x92')]['id'],'name':_0x17b747[_0x4e1069][_0xfaa3('0xc')]},'raw':!![]}));}return Promise[_0xfaa3('0x93')](_0x5b3a99)[_0xfaa3('0x87')](function(_0x1cc322){var _0x19fd0e=_[_0xfaa3('0x6')](_0x1cc322,function(_0x517769){return _0x517769?_0x517769:undefined;});var _0xbbad66=_['filter'](_0x17b747,[_0xfaa3('0x94'),!![]]);var _0x5f02d4=_[_0xfaa3('0x8d')](_0x19fd0e)&&_[_0xfaa3('0x8d')](_0xbbad66)?null:_['union'](_0xbbad66,_0x19fd0e);if(!_0x5f02d4)return null;var _0x5d573e=[];for(var _0x16f059=0x0;_0x16f059<_0x5f02d4[_0xfaa3('0x8e')];_0x16f059++){var _0x2bc04c=_[_0xfaa3('0x91')](_0x17b747,function(_0x60adb2){return _0x5f02d4[_0x16f059]?_0x60adb2[_0xfaa3('0xc')]===_0x5f02d4[_0x16f059][_0xfaa3('0xc')]:null;});if(_0x2bc04c){if(_0x5f02d4[_0x16f059]['ignore']){_0x5d573e[_0xfaa3('0x8f')](_0x32f4e1(_0x1df722[_0xfaa3('0x13')],_0x5f02d4[_0x16f059]));}else{if(!_0x5f02d4[_0x16f059][_0xfaa3('0x95')]){_0x5d573e['push'](_0x5f47dd(_0x2bc04c,_0x5f02d4[_0x16f059],_0x1df722[_0xfaa3('0x13')]));}else{if(_0x2bc04c[_0xfaa3('0x96')]){_0x5d573e[_0xfaa3('0x8f')](_0xce3b1f(_0x2bc04c,_0x5f02d4[_0x16f059]));}}}}}return Promise[_0xfaa3('0x93')](_0x5d573e);})['then'](function(_0x6ea54e){var _0x5a6e29=_0x6ea54e;var _0x5e71bd=null;if(_0x5a6e29){_0x5e71bd=_0x5a6e29[_0xfaa3('0x8e')]===0x1?_0x5a6e29[0x0]:null;}if(!_0x5e71bd&&!_0x5a6e29)return _0x4a537f;var _0x38c1fb=_0x408343[_0x1df722[_0xfaa3('0x13')]][_0xfaa3('0x97')];_0x304af6[_0xfaa3('0x96')]=_[_0xfaa3('0x98')](_0x38c1fb);_0x304af6[_0xfaa3('0x8b')]=_['keys'](_0x2a1dde[_0xfaa3('0x8b')]);_0x304af6['filters']=_['intersection'](_0x304af6[_0xfaa3('0x96')],_0x304af6['query']);_0x2ef70d[_0xfaa3('0x99')]=_['intersection'](_0x304af6['model'],qs[_0xfaa3('0x9a')](_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x9a')]));_0x2ef70d['attributes']=_0x2ef70d[_0xfaa3('0x99')][_0xfaa3('0x8e')]?_0x2ef70d[_0xfaa3('0x99')]:_0x304af6[_0xfaa3('0x96')];if(!_0x2a1dde[_0xfaa3('0x8b')]['hasOwnProperty'](_0xfaa3('0x9b'))){_0x2ef70d[_0xfaa3('0x9c')]=qs['limit'](_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x9c')]);_0x2ef70d[_0xfaa3('0x9d')]=qs[_0xfaa3('0x9d')](_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x9d')]);}_0x2ef70d[_0xfaa3('0x9e')]=qs[_0xfaa3('0x9f')](_0x2a1dde['query'][_0xfaa3('0x9f')]);_0x2ef70d[_0xfaa3('0xa0')]=qs['filters'](_[_0xfaa3('0xa1')](_0x2a1dde[_0xfaa3('0x8b')],_0x304af6[_0xfaa3('0xa2')]));if(_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x6')]){_0x2ef70d['where']=_[_0xfaa3('0xa3')](_0x2ef70d[_0xfaa3('0xa0')],{'$or':_[_0xfaa3('0xb')](_0x38c1fb,function(_0x479203){if(_0x479203[_0xfaa3('0x40')]['key']!==_0xfaa3('0xa4')){var _0x2d8f04={};_0x2d8f04[_0x479203[_0xfaa3('0x7')]]={'$like':'%'+_0x2a1dde['query'][_0xfaa3('0x6')]+'%'};return _0x2d8f04;}})});}var _0x248b55=[];var _0x1f48f4=null;var _0x1d8ff5={};if(_0x5e71bd){_0x1f48f4=_['find'](_0x17b747,['name',_0x5e71bd['name']]);if(_0x1f48f4[_0xfaa3('0x7')]){_0x1d8ff5={};if(_0x1df722[_0xfaa3('0x13')]===_0xfaa3('0xf')){_0x1d8ff5[_0x1f48f4[_0xfaa3('0xa5')]]=_[_0xfaa3('0xb')](_0x5e71bd['associatedResources'],'id');}else{_0x1d8ff5[_0x1f48f4[_0xfaa3('0xa5')]]=_0x5e71bd[_0xfaa3('0xa')];}_0x248b55[_0xfaa3('0x8f')](_0x1d8ff5);}else{_0x2ef70d['where']['id']=_0x5e71bd[_0xfaa3('0xa')];}}else{for(var _0x509231=0x0;_0x509231<_0x5a6e29[_0xfaa3('0x8e')];_0x509231++){_0x1f48f4=_['find'](_0x17b747,[_0xfaa3('0xc'),_0x5a6e29[_0x509231][_0xfaa3('0xc')]]);if(_0x1f48f4[_0xfaa3('0x7')]){_0x1d8ff5={};_0x1d8ff5[_0x1f48f4[_0xfaa3('0xa5')]]=_0x5a6e29[_0x509231]['associatedResources'];_0x248b55[_0xfaa3('0x8f')](_0x1d8ff5);}else{if(!_0x2ef70d[_0xfaa3('0xa0')]['id'])_0x2ef70d[_0xfaa3('0xa0')]['id']=[];_0x5a6e29[_0x509231][_0xfaa3('0xa')]['forEach'](function(_0x3cc53c){_0x2ef70d[_0xfaa3('0xa0')]['id'][_0xfaa3('0x8f')](_0x3cc53c);});}}}if(!_[_0xfaa3('0x8d')](_0x248b55)){_0x2ef70d[_0xfaa3('0xa0')]=_['merge'](_0x2ef70d[_0xfaa3('0xa0')],{'$and':{'$or':_0x248b55}});}_0x2ef70d=_[_0xfaa3('0xa3')]({},_0x2ef70d,_0x2a1dde[_0xfaa3('0xa6')]);if(_0x5e71bd&&!_0x5e71bd['autoAssociation']&&_0x1df722[_0xfaa3('0x13')]===_0xfaa3('0xf')){if(_0x2a1dde[_0xfaa3('0x8b')]['includeAll']){_0x2ef70d[_0xfaa3('0xa7')]=[{'all':!![]}];}return _0x408343[_0x1df722['childModel']][_0xfaa3('0x9')](_0x2ef70d)['then'](function(_0x1956a6){var _0x4f8505=[];_0x1956a6[_0xfaa3('0xa8')](function(_0xa932d5){var _0x4fb738;switch(_0xa932d5['reportType']){case _0xfaa3('0xa9'):_0x4fb738=_[_0xfaa3('0x91')](_0x5e71bd[_0xfaa3('0xa')],function(_0x31f074){return _0x31f074['id']===_0xa932d5[_0xfaa3('0x77')]&&_0x31f074['type']===_0xfaa3('0xaa');});break;case _0xfaa3('0xab'):_0x4fb738=_[_0xfaa3('0x91')](_0x5e71bd[_0xfaa3('0xa')],function(_0x259139){return _0x259139['id']===_0xa932d5[_0xfaa3('0x77')]&&_0x259139[_0xfaa3('0x40')]===_0xfaa3('0xac');});break;}if(_0x4fb738)_0x4f8505[_0xfaa3('0x8f')](_0xa932d5);});_0x4a537f['count']=_0x4f8505['length'];_0x4a537f[_0xfaa3('0xad')]=_0x4f8505;return _0x4a537f;});}else{return _0x408343[_0x1df722[_0xfaa3('0x13')]]['count']({'where':_0x2ef70d[_0xfaa3('0xa0')]})[_0xfaa3('0x87')](function(_0x16dc21){_0x4a537f[_0xfaa3('0xae')]=_0x16dc21;if(_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0xaf')]){if(_0x1df722[_0xfaa3('0x13')]===_0xfaa3('0xb0')){_0x2ef70d[_0xfaa3('0xa7')]=[{'model':_0x408343['Tag'],'as':'Tags','attributes':['id',_0xfaa3('0xc'),_0xfaa3('0xb1')],'required':_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0xb2')]?!![]:![]},{'model':_0x408343[_0xfaa3('0x6c')],'as':_0xfaa3('0xb3'),'attributes':['id',_0xfaa3('0xc'),_0xfaa3('0xb1')],'through':_0x2a1dde['query']['tag']?{'attributes':[],'where':{'TagId':_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0xb2')]||undefined}}:{},'required':_0x2a1dde[_0xfaa3('0x8b')]['tag']?!![]:![]}];}else{_0x2ef70d[_0xfaa3('0xa7')]=[{'all':!![]}];}}return _0x408343[_0x1df722[_0xfaa3('0x13')]][_0xfaa3('0x9')](_0x2ef70d);})[_0xfaa3('0x87')](function(_0x1f458b){_0x4a537f[_0xfaa3('0xad')]=_0x1f458b;if(_0x1fd9cf===_0xfaa3('0x36')&&_0x2a1dde['query'][_0xfaa3('0xb4')]===_0xfaa3('0xb5')){var _0x4d8ce7=[];for(var _0x875fea=0x0;_0x875fea<_0x4a537f[_0xfaa3('0xad')][_0xfaa3('0x8e')];_0x875fea++){_0x4d8ce7[_0xfaa3('0x8f')](_0x5ccb10('chat',_0x4a537f[_0xfaa3('0xad')][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xb7'),_0x4a537f['rows'][_0x875fea]['dataValues']));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xb8'),_0x4a537f['rows'][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xb9'),_0x4a537f['rows'][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xba'),_0x4a537f[_0xfaa3('0xad')][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10('whatsapp',_0x4a537f['rows'][_0x875fea][_0xfaa3('0xb6')]));}return Promise[_0xfaa3('0x93')](_0x4d8ce7)[_0xfaa3('0x87')](function(){return _0x4a537f;});}return _0x4a537f;});}});}}});}; \ No newline at end of file +var _0xaa3f=['lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','name','catch','resolve','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','type','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','voicequeues','queuecampaigns','QueueCampaigns','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','Disposition','customdashboards','Dashboard','intervals','Interval','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','sequelize','then','OpenTabs','define','user_profiles','query','mergeResources','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','model','rawAttributes','keys','attributes','fields','nolimit','limit','offset','order','sort','where','pick','filters','merge','VIRTUAL','foreignKey','options','include','forEach','default','DefaultReports','custom','CustomReports','rows','count','includeAll','CmContact','color','tag','ThroughTags','openTabs','true','dataValues','sms','fax','mail','openchannel'];(function(_0x1d7434,_0x57c6ef){var _0x50c619=function(_0x397393){while(--_0x397393){_0x1d7434['push'](_0x1d7434['shift']());}};_0x50c619(++_0x57c6ef);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x1e3e1e,_0x1fe697){_0x1e3e1e=_0x1e3e1e-0x0;var _0xc9d950=_0xaa3f[_0x1e3e1e];return _0xc9d950;};'use strict';var _=require(_0xfaa3('0x0'));var attributes=require(_0xfaa3('0x1'));var qs=require(_0xfaa3('0x2'));var squel=require(_0xfaa3('0x3'));module[_0xfaa3('0x4')]=function(_0x1da39b){var _0x408343=_0x1da39b[_0xfaa3('0x5')];function _0x32f4e1(_0x5123a3,_0x513eea){return new Promise(function(_0x2ac57f,_0x4bac92){if(!_0x513eea)return _0x2ac57f(null);var _0x3d09aa=_0x513eea[_0xfaa3('0x6')]?{[_0x513eea[_0xfaa3('0x6')][_0xfaa3('0x7')]]:_0x513eea[_0xfaa3('0x6')][_0xfaa3('0x8')]}:undefined;return _0x408343[_0x5123a3][_0xfaa3('0x9')]({'where':_0x3d09aa,'raw':!![]})['then'](function(_0x37bcd5){_0x513eea[_0xfaa3('0xa')]=_['map'](_0x37bcd5,'id');_0x2ac57f(_0x513eea);})['catch'](function(_0x44d88e){_0x4bac92(_0x44d88e);});});}function _0xce3b1f(_0x34d3dc,_0x278e6c){return new Promise(function(_0x23e4b6,_0x32866b){var _0x5e1b29=_0x34d3dc[_0xfaa3('0x6')]?{[_0x34d3dc['filter'][_0xfaa3('0x7')]]:_0x34d3dc[_0xfaa3('0x6')][_0xfaa3('0x8')]}:undefined;return _0x408343[_0x34d3dc['model']][_0xfaa3('0x9')]({'where':_0x5e1b29,'raw':!![]})['then'](function(_0xdf7551){_0x278e6c[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0xdf7551,function(_0x3ddb40){return _0x3ddb40[_0xfaa3('0xc')];});_0x23e4b6(_0x278e6c);})[_0xfaa3('0xd')](function(_0x4da250){_0x32866b(_0x4da250);});});}function _0x5f47dd(_0x46e112,_0xe1a082,_0x407384){if(!_0xe1a082)return Promise[_0xfaa3('0xe')](null);return new Promise(function(_0x4e54e4,_0x5dd38c){return _0x408343['UserProfileResource']['findAll']({'where':{'sectionId':_0xe1a082['id']},'raw':!![]})['then'](function(_0x275a07){if(_0x46e112['field']&&_0x46e112[_0xfaa3('0x7')]!=='id'){_0xe1a082[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0x275a07,function(_0x34b276){return _0x34b276[_0x46e112[_0xfaa3('0x7')]];});}else{if(_0x407384===_0xfaa3('0xf')){_0xe1a082[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0x275a07,function(_0x220c9e){return{'id':_0x220c9e[_0xfaa3('0x10')],'type':_0x220c9e['type']};});}else{_0xe1a082[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0x275a07,function(_0x26d9ef){return _0x26d9ef[_0xfaa3('0x10')];});}}_0x4e54e4(_0xe1a082);})['catch'](function(_0x1f7324){_0x5dd38c(_0x1f7324);});});}function _0x2d4087(_0x2f077c,_0x22156a){var _0x16a3e3={'parentSections':[]};switch(_0x2f077c[_0xfaa3('0x11')]()){case _0xfaa3('0x12'):_0x16a3e3[_0xfaa3('0x13')]='SquareProject';break;case _0xfaa3('0x14'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x15');break;case _0xfaa3('0x16'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x17');_0x16a3e3[_0xfaa3('0x18')]=[{'name':_0xfaa3('0x19'),'field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x1a')}];break;case _0xfaa3('0x1b'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x1c');break;case _0xfaa3('0x1d'):_0x16a3e3[_0xfaa3('0x13')]='CmContact';_0x16a3e3[_0xfaa3('0x18')]=[{'name':_0xfaa3('0x1e'),'field':'id','foreignKey':_0xfaa3('0x1f')}];break;case'lists':_0x16a3e3[_0xfaa3('0x13')]='CmList';break;case _0xfaa3('0x20'):_0x16a3e3['childModel']=_0xfaa3('0x21');break;case _0xfaa3('0x22'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x23');break;case _0xfaa3('0x24'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x25');break;case _0xfaa3('0x26'):_0x16a3e3['childModel']=_0xfaa3('0x27');break;case _0xfaa3('0x28'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x29');break;case _0xfaa3('0x2a'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x2b');break;case _0xfaa3('0x2c'):case _0xfaa3('0x2d'):case _0xfaa3('0x2e'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x2f');break;case _0xfaa3('0x30'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x31');break;case _0xfaa3('0x32'):_0x16a3e3['childModel']=_0xfaa3('0x33');break;case _0xfaa3('0x34'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x35');_0x16a3e3[_0xfaa3('0x18')]=[{'name':_0xfaa3('0x36'),'field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x37'),'model':'User','filter':{'field':_0xfaa3('0x38'),'value':[_0xfaa3('0x39')]}},{'name':_0xfaa3('0x3a'),'field':'name','foreignKey':_0xfaa3('0x37'),'model':_0xfaa3('0x3b'),'filter':{'field':'role','value':[_0xfaa3('0x3c')]}},{'name':_0xfaa3('0x3d'),'field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x3e'),'model':_0xfaa3('0x3f'),'filter':{'field':_0xfaa3('0x40'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x3e'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xfaa3('0x41')]}}];break;case'musiconholds':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x42');break;case _0xfaa3('0x43'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x44');break;case _0xfaa3('0x45'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x46');break;case'ivrcampaigns':_0x16a3e3['childModel']='Campaign';break;case'mailqueues':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x47');break;case'mailaccounts':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x48');break;case _0xfaa3('0x49'):_0x16a3e3['childModel']='MailSubstatus';break;case _0xfaa3('0x4a'):_0x16a3e3['childModel']=_0xfaa3('0x4b');break;case'openchannelaccounts':_0x16a3e3['childModel']=_0xfaa3('0x4c');break;case _0xfaa3('0x4d'):_0x16a3e3['childModel']=_0xfaa3('0x4e');break;case'smsaccounts':_0x16a3e3[_0xfaa3('0x13')]='SmsAccount';break;case _0xfaa3('0x4f'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x50');break;case'whatsappaccounts':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x51');break;case'teams':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x52');break;case _0xfaa3('0x53'):case _0xfaa3('0x54'):_0x16a3e3['childModel']=_0xfaa3('0x3f');if(_0x22156a){_0x16a3e3[_0xfaa3('0x18')]=[{'name':'VoiceQueues'},{'name':_0xfaa3('0x55')}];}break;case'users':case _0xfaa3('0x56'):case _0xfaa3('0x57'):_0x16a3e3[_0xfaa3('0x13')]='User';if(_0x22156a){_0x16a3e3[_0xfaa3('0x18')]=[{'name':'Users','filter':{'field':'role','value':[_0xfaa3('0x58'),_0xfaa3('0x59')]},'ignore':!![]},{'name':_0xfaa3('0x36')},{'name':_0xfaa3('0x3a')}];}break;case _0xfaa3('0x5a'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x5b');break;case'salesforceaccounts':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x5c');break;case _0xfaa3('0x5d'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x5e');break;case _0xfaa3('0x5f'):_0x16a3e3[_0xfaa3('0x13')]='SugarcrmAccount';break;case'deskaccounts':_0x16a3e3['childModel']=_0xfaa3('0x60');break;case _0xfaa3('0x61'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x62');break;case'vtigeraccounts':_0x16a3e3[_0xfaa3('0x13')]='User';break;case'cannedanswers':_0x16a3e3['childModel']='CannedAnswer';break;case'dispositions':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x63');break;case _0xfaa3('0x64'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x65');break;case _0xfaa3('0x66'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x67');break;case'pauses':_0x16a3e3[_0xfaa3('0x13')]='Pause';break;case'scheduler':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x68');break;case _0xfaa3('0x69'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x6a');break;case _0xfaa3('0x6b'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x6c');break;case _0xfaa3('0x6d'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x6e');break;case _0xfaa3('0x6f'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x70');break;case _0xfaa3('0x71'):_0x16a3e3['childModel']=_0xfaa3('0x72');break;case'variables':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x73');break;case _0xfaa3('0x74'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x75');break;case _0xfaa3('0x76'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0xf');_0x16a3e3[_0xfaa3('0x18')]=[{'name':'Reports','field':'id','foreignKey':_0xfaa3('0x77')}];break;case _0xfaa3('0x78'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x79');break;}return _0x16a3e3;}function _0x5ccb10(_0x1fd6d7,_0x1cf28e){var _0x172a2c=_0x1fd6d7[_0xfaa3('0x7a')](0x0)[_0xfaa3('0x7b')]()+_0x1fd6d7[_0xfaa3('0x7c')](0x1);var _0x42e7f9={'type':_0x408343['Sequelize'][_0xfaa3('0x7d')][_0xfaa3('0x7e')],'raw':!![]};return new Promise(function(_0x22ce8c,_0x17e10a){var _0x5d8277=squel[_0xfaa3('0x7f')]()[_0xfaa3('0x7')](_0xfaa3('0x80')+_0x172a2c+_0xfaa3('0x81'),'id')[_0xfaa3('0x7')](_0xfaa3('0x82'))[_0xfaa3('0x83')](_0xfaa3('0x84')+_0x1fd6d7+_0xfaa3('0x85'),'ui')['where']('ui.UserId\x20=\x20?',_0x1cf28e['id']);return _0x408343[_0xfaa3('0x86')]['query'](_0x5d8277['toString'](),_0x42e7f9)[_0xfaa3('0x87')](function(_0x8b7c){_0x1cf28e[_0x172a2c+_0xfaa3('0x88')]=_0x8b7c;_0x22ce8c(_0x8b7c);})['catch'](function(_0x142f5b){_0x17e10a(_0x142f5b);});});}return _0x1da39b[_0xfaa3('0x89')]('UserProfile',attributes,{'tableName':_0xfaa3('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2a1dde){var _0x2ef70d={'raw':![],'where':{}};var _0x304af6={};var _0x4a537f={'count':0x0,'rows':[]};var _0x1fd9cf=_0x2a1dde[_0xfaa3('0x8b')]['section'];var _0x345291=_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x8c')]||![];var _0x1df722=_0x2d4087(_0x1fd9cf,_0x345291);if(!_0x1df722[_0xfaa3('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x1fd9cf+'\x27');var _0x17b747=[{'name':_0x1fd9cf}];if(!_[_0xfaa3('0x8d')](_0x1df722['parentSections']))_0x17b747=_0x1df722['parentSections'];var _0x5b3a99=[];for(var _0x4e1069=0x0;_0x4e1069<_0x17b747[_0xfaa3('0x8e')];_0x4e1069++){_0x5b3a99[_0xfaa3('0x8f')](_0x408343[_0xfaa3('0x90')][_0xfaa3('0x91')]({'where':{'userProfileId':_0x2a1dde[_0xfaa3('0x92')]['id'],'name':_0x17b747[_0x4e1069][_0xfaa3('0xc')]},'raw':!![]}));}return Promise[_0xfaa3('0x93')](_0x5b3a99)[_0xfaa3('0x87')](function(_0x1cc322){var _0x19fd0e=_[_0xfaa3('0x6')](_0x1cc322,function(_0x517769){return _0x517769?_0x517769:undefined;});var _0xbbad66=_['filter'](_0x17b747,[_0xfaa3('0x94'),!![]]);var _0x5f02d4=_[_0xfaa3('0x8d')](_0x19fd0e)&&_[_0xfaa3('0x8d')](_0xbbad66)?null:_['union'](_0xbbad66,_0x19fd0e);if(!_0x5f02d4)return null;var _0x5d573e=[];for(var _0x16f059=0x0;_0x16f059<_0x5f02d4[_0xfaa3('0x8e')];_0x16f059++){var _0x2bc04c=_[_0xfaa3('0x91')](_0x17b747,function(_0x60adb2){return _0x5f02d4[_0x16f059]?_0x60adb2[_0xfaa3('0xc')]===_0x5f02d4[_0x16f059][_0xfaa3('0xc')]:null;});if(_0x2bc04c){if(_0x5f02d4[_0x16f059]['ignore']){_0x5d573e[_0xfaa3('0x8f')](_0x32f4e1(_0x1df722[_0xfaa3('0x13')],_0x5f02d4[_0x16f059]));}else{if(!_0x5f02d4[_0x16f059][_0xfaa3('0x95')]){_0x5d573e['push'](_0x5f47dd(_0x2bc04c,_0x5f02d4[_0x16f059],_0x1df722[_0xfaa3('0x13')]));}else{if(_0x2bc04c[_0xfaa3('0x96')]){_0x5d573e[_0xfaa3('0x8f')](_0xce3b1f(_0x2bc04c,_0x5f02d4[_0x16f059]));}}}}}return Promise[_0xfaa3('0x93')](_0x5d573e);})['then'](function(_0x6ea54e){var _0x5a6e29=_0x6ea54e;var _0x5e71bd=null;if(_0x5a6e29){_0x5e71bd=_0x5a6e29[_0xfaa3('0x8e')]===0x1?_0x5a6e29[0x0]:null;}if(!_0x5e71bd&&!_0x5a6e29)return _0x4a537f;var _0x38c1fb=_0x408343[_0x1df722[_0xfaa3('0x13')]][_0xfaa3('0x97')];_0x304af6[_0xfaa3('0x96')]=_[_0xfaa3('0x98')](_0x38c1fb);_0x304af6[_0xfaa3('0x8b')]=_['keys'](_0x2a1dde[_0xfaa3('0x8b')]);_0x304af6['filters']=_['intersection'](_0x304af6[_0xfaa3('0x96')],_0x304af6['query']);_0x2ef70d[_0xfaa3('0x99')]=_['intersection'](_0x304af6['model'],qs[_0xfaa3('0x9a')](_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x9a')]));_0x2ef70d['attributes']=_0x2ef70d[_0xfaa3('0x99')][_0xfaa3('0x8e')]?_0x2ef70d[_0xfaa3('0x99')]:_0x304af6[_0xfaa3('0x96')];if(!_0x2a1dde[_0xfaa3('0x8b')]['hasOwnProperty'](_0xfaa3('0x9b'))){_0x2ef70d[_0xfaa3('0x9c')]=qs['limit'](_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x9c')]);_0x2ef70d[_0xfaa3('0x9d')]=qs[_0xfaa3('0x9d')](_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x9d')]);}_0x2ef70d[_0xfaa3('0x9e')]=qs[_0xfaa3('0x9f')](_0x2a1dde['query'][_0xfaa3('0x9f')]);_0x2ef70d[_0xfaa3('0xa0')]=qs['filters'](_[_0xfaa3('0xa1')](_0x2a1dde[_0xfaa3('0x8b')],_0x304af6[_0xfaa3('0xa2')]));if(_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x6')]){_0x2ef70d['where']=_[_0xfaa3('0xa3')](_0x2ef70d[_0xfaa3('0xa0')],{'$or':_[_0xfaa3('0xb')](_0x38c1fb,function(_0x479203){if(_0x479203[_0xfaa3('0x40')]['key']!==_0xfaa3('0xa4')){var _0x2d8f04={};_0x2d8f04[_0x479203[_0xfaa3('0x7')]]={'$like':'%'+_0x2a1dde['query'][_0xfaa3('0x6')]+'%'};return _0x2d8f04;}})});}var _0x248b55=[];var _0x1f48f4=null;var _0x1d8ff5={};if(_0x5e71bd){_0x1f48f4=_['find'](_0x17b747,['name',_0x5e71bd['name']]);if(_0x1f48f4[_0xfaa3('0x7')]){_0x1d8ff5={};if(_0x1df722[_0xfaa3('0x13')]===_0xfaa3('0xf')){_0x1d8ff5[_0x1f48f4[_0xfaa3('0xa5')]]=_[_0xfaa3('0xb')](_0x5e71bd['associatedResources'],'id');}else{_0x1d8ff5[_0x1f48f4[_0xfaa3('0xa5')]]=_0x5e71bd[_0xfaa3('0xa')];}_0x248b55[_0xfaa3('0x8f')](_0x1d8ff5);}else{_0x2ef70d['where']['id']=_0x5e71bd[_0xfaa3('0xa')];}}else{for(var _0x509231=0x0;_0x509231<_0x5a6e29[_0xfaa3('0x8e')];_0x509231++){_0x1f48f4=_['find'](_0x17b747,[_0xfaa3('0xc'),_0x5a6e29[_0x509231][_0xfaa3('0xc')]]);if(_0x1f48f4[_0xfaa3('0x7')]){_0x1d8ff5={};_0x1d8ff5[_0x1f48f4[_0xfaa3('0xa5')]]=_0x5a6e29[_0x509231]['associatedResources'];_0x248b55[_0xfaa3('0x8f')](_0x1d8ff5);}else{if(!_0x2ef70d[_0xfaa3('0xa0')]['id'])_0x2ef70d[_0xfaa3('0xa0')]['id']=[];_0x5a6e29[_0x509231][_0xfaa3('0xa')]['forEach'](function(_0x3cc53c){_0x2ef70d[_0xfaa3('0xa0')]['id'][_0xfaa3('0x8f')](_0x3cc53c);});}}}if(!_[_0xfaa3('0x8d')](_0x248b55)){_0x2ef70d[_0xfaa3('0xa0')]=_['merge'](_0x2ef70d[_0xfaa3('0xa0')],{'$and':{'$or':_0x248b55}});}_0x2ef70d=_[_0xfaa3('0xa3')]({},_0x2ef70d,_0x2a1dde[_0xfaa3('0xa6')]);if(_0x5e71bd&&!_0x5e71bd['autoAssociation']&&_0x1df722[_0xfaa3('0x13')]===_0xfaa3('0xf')){if(_0x2a1dde[_0xfaa3('0x8b')]['includeAll']){_0x2ef70d[_0xfaa3('0xa7')]=[{'all':!![]}];}return _0x408343[_0x1df722['childModel']][_0xfaa3('0x9')](_0x2ef70d)['then'](function(_0x1956a6){var _0x4f8505=[];_0x1956a6[_0xfaa3('0xa8')](function(_0xa932d5){var _0x4fb738;switch(_0xa932d5['reportType']){case _0xfaa3('0xa9'):_0x4fb738=_[_0xfaa3('0x91')](_0x5e71bd[_0xfaa3('0xa')],function(_0x31f074){return _0x31f074['id']===_0xa932d5[_0xfaa3('0x77')]&&_0x31f074['type']===_0xfaa3('0xaa');});break;case _0xfaa3('0xab'):_0x4fb738=_[_0xfaa3('0x91')](_0x5e71bd[_0xfaa3('0xa')],function(_0x259139){return _0x259139['id']===_0xa932d5[_0xfaa3('0x77')]&&_0x259139[_0xfaa3('0x40')]===_0xfaa3('0xac');});break;}if(_0x4fb738)_0x4f8505[_0xfaa3('0x8f')](_0xa932d5);});_0x4a537f['count']=_0x4f8505['length'];_0x4a537f[_0xfaa3('0xad')]=_0x4f8505;return _0x4a537f;});}else{return _0x408343[_0x1df722[_0xfaa3('0x13')]]['count']({'where':_0x2ef70d[_0xfaa3('0xa0')]})[_0xfaa3('0x87')](function(_0x16dc21){_0x4a537f[_0xfaa3('0xae')]=_0x16dc21;if(_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0xaf')]){if(_0x1df722[_0xfaa3('0x13')]===_0xfaa3('0xb0')){_0x2ef70d[_0xfaa3('0xa7')]=[{'model':_0x408343['Tag'],'as':'Tags','attributes':['id',_0xfaa3('0xc'),_0xfaa3('0xb1')],'required':_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0xb2')]?!![]:![]},{'model':_0x408343[_0xfaa3('0x6c')],'as':_0xfaa3('0xb3'),'attributes':['id',_0xfaa3('0xc'),_0xfaa3('0xb1')],'through':_0x2a1dde['query']['tag']?{'attributes':[],'where':{'TagId':_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0xb2')]||undefined}}:{},'required':_0x2a1dde[_0xfaa3('0x8b')]['tag']?!![]:![]}];}else{_0x2ef70d[_0xfaa3('0xa7')]=[{'all':!![]}];}}return _0x408343[_0x1df722[_0xfaa3('0x13')]][_0xfaa3('0x9')](_0x2ef70d);})[_0xfaa3('0x87')](function(_0x1f458b){_0x4a537f[_0xfaa3('0xad')]=_0x1f458b;if(_0x1fd9cf===_0xfaa3('0x36')&&_0x2a1dde['query'][_0xfaa3('0xb4')]===_0xfaa3('0xb5')){var _0x4d8ce7=[];for(var _0x875fea=0x0;_0x875fea<_0x4a537f[_0xfaa3('0xad')][_0xfaa3('0x8e')];_0x875fea++){_0x4d8ce7[_0xfaa3('0x8f')](_0x5ccb10('chat',_0x4a537f[_0xfaa3('0xad')][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xb7'),_0x4a537f['rows'][_0x875fea]['dataValues']));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xb8'),_0x4a537f['rows'][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xb9'),_0x4a537f['rows'][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xba'),_0x4a537f[_0xfaa3('0xad')][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10('whatsapp',_0x4a537f['rows'][_0x875fea][_0xfaa3('0xb6')]));}return Promise[_0xfaa3('0x93')](_0x4d8ce7)[_0xfaa3('0x87')](function(){return _0x4a537f;});}return _0x4a537f;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 0261091..6899df4 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 _0x7d37=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','redis','./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2863cd,_0x1e5a02){var _0x43a5ce=function(_0x554052){while(--_0x554052){_0x2863cd['push'](_0x2863cd['shift']());}};_0x43a5ce(++_0x1e5a02);}(_0x7d37,0x1db));var _0x77d3=function(_0x46137c,_0x2725c1){_0x46137c=_0x46137c-0x0;var _0x3cf769=_0x7d37[_0x46137c];return _0x3cf769;};'use strict';var _=require(_0x77d3('0x0'));var util=require(_0x77d3('0x1'));var moment=require(_0x77d3('0x2'));var BPromise=require('bluebird');var rs=require(_0x77d3('0x3'));var fs=require('fs');var Redis=require(_0x77d3('0x4'));var db=require(_0x77d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77d3('0x6'))(_0x77d3('0x7'));var config=require('../../config/environment');var jayson=require(_0x77d3('0x8'));var client=jayson['client'][_0x77d3('0x9')]({'port':0x232a});config['redis']=_[_0x77d3('0xa')](config[_0x77d3('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77d3('0xb')]));require(_0x77d3('0xc'))['register'](socket);function respondWithRpcPromise(_0x238791,_0x5e8c4d,_0x10f92e){return new BPromise(function(_0x57c75c,_0x1afabc){return client['request'](_0x238791,_0x10f92e)[_0x77d3('0xd')](function(_0x295d24){logger[_0x77d3('0xe')](_0x77d3('0xf'),_0x5e8c4d,_0x77d3('0x10'));logger[_0x77d3('0x11')](_0x77d3('0x12'),_0x5e8c4d,_0x77d3('0x10'),JSON[_0x77d3('0x13')](_0x295d24));if(_0x295d24['error']){if(_0x295d24[_0x77d3('0x14')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x5e8c4d,_0x295d24[_0x77d3('0x14')][_0x77d3('0x15')]);return _0x1afabc(_0x295d24[_0x77d3('0x14')][_0x77d3('0x15')]);}logger[_0x77d3('0x14')]('UserProfile,\x20%s,\x20%s',_0x5e8c4d,_0x295d24[_0x77d3('0x14')][_0x77d3('0x15')]);return _0x57c75c(_0x295d24['error']['message']);}else{logger[_0x77d3('0xe')](_0x77d3('0xf'),_0x5e8c4d,_0x77d3('0x10'));_0x57c75c(_0x295d24[_0x77d3('0x16')][_0x77d3('0x15')]);}})[_0x77d3('0x17')](function(_0x12fb05){logger[_0x77d3('0x14')](_0x77d3('0xf'),_0x5e8c4d,_0x12fb05);_0x1afabc(_0x12fb05);});});} \ No newline at end of file +var _0x0619=['client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3a2fe5,_0x4f3adf){var _0x5aacd1=function(_0x329940){while(--_0x329940){_0x3a2fe5['push'](_0x3a2fe5['shift']());}};_0x5aacd1(++_0x4f3adf);}(_0x0619,0x90));var _0x9061=function(_0x30ffa0,_0x889dc2){_0x30ffa0=_0x30ffa0-0x0;var _0x86fa9c=_0x0619[_0x30ffa0];return _0x86fa9c;};'use strict';var _=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var moment=require(_0x9061('0x2'));var BPromise=require(_0x9061('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9061('0x4'));var db=require(_0x9061('0x5'))['db'];var utils=require(_0x9061('0x6'));var logger=require(_0x9061('0x7'))(_0x9061('0x8'));var config=require(_0x9061('0x9'));var jayson=require(_0x9061('0xa'));var client=jayson[_0x9061('0xb')][_0x9061('0xc')]({'port':0x232a});config[_0x9061('0xd')]=_[_0x9061('0xe')](config['redis'],{'host':_0x9061('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9061('0x10'))[_0x9061('0x11')](socket);function respondWithRpcPromise(_0x4cf332,_0x502660,_0x3bc693){return new BPromise(function(_0x2fc757,_0x13d226){return client[_0x9061('0x12')](_0x4cf332,_0x3bc693)[_0x9061('0x13')](function(_0x25ce5d){logger[_0x9061('0x14')](_0x9061('0x15'),_0x502660,_0x9061('0x16'));logger[_0x9061('0x17')](_0x9061('0x18'),_0x502660,_0x9061('0x16'),JSON[_0x9061('0x19')](_0x25ce5d));if(_0x25ce5d['error']){if(_0x25ce5d['error'][_0x9061('0x1a')]===0x1f4){logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x25ce5d[_0x9061('0x1b')][_0x9061('0x1c')]);return _0x13d226(_0x25ce5d['error']['message']);}logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x25ce5d['error'][_0x9061('0x1c')]);return _0x2fc757(_0x25ce5d['error'][_0x9061('0x1c')]);}else{logger['info'](_0x9061('0x15'),_0x502660,'request\x20sent');_0x2fc757(_0x25ce5d[_0x9061('0x1d')][_0x9061('0x1c')]);}})[_0x9061('0x1e')](function(_0x11fc9e){logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x11fc9e);_0x13d226(_0x11fc9e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d3baa02..8feceee 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 _0x8d88=['./userProfile.events','update','emit','removeListener','length','userProfile:'];(function(_0x2c3e8d,_0x3f7739){var _0x430c89=function(_0xeaeb15){while(--_0xeaeb15){_0x2c3e8d['push'](_0x2c3e8d['shift']());}};_0x430c89(++_0x3f7739);}(_0x8d88,0x174));var _0x88d8=function(_0x3ef9a2,_0x3cd67f){_0x3ef9a2=_0x3ef9a2-0x0;var _0x52a458=_0x8d88[_0x3ef9a2];return _0x52a458;};'use strict';var UserProfileEvents=require(_0x88d8('0x0'));var events=['save','remove',_0x88d8('0x1')];function createListener(_0x2ab19b,_0x1e62d4){return function(_0x37d707){_0x1e62d4[_0x88d8('0x2')](_0x2ab19b,_0x37d707);};}function removeListener(_0x57ad09,_0x34aa78){return function(){UserProfileEvents[_0x88d8('0x3')](_0x57ad09,_0x34aa78);};}exports['register']=function(_0x28e743){for(var _0x1c9665=0x0,_0xa45a13=events[_0x88d8('0x4')];_0x1c9665<_0xa45a13;_0x1c9665++){var _0x5b3c9e=events[_0x1c9665];var _0x41e07b=createListener(_0x88d8('0x5')+_0x5b3c9e,_0x28e743);UserProfileEvents['on'](_0x5b3c9e,_0x41e07b);}}; \ No newline at end of file +var _0xf1f1=['save','update','emit','register','length','userProfile:'];(function(_0x5e4052,_0xc57e67){var _0x470a47=function(_0x26c34f){while(--_0x26c34f){_0x5e4052['push'](_0x5e4052['shift']());}};_0x470a47(++_0xc57e67);}(_0xf1f1,0xc6));var _0x1f1f=function(_0x3ad121,_0x266507){_0x3ad121=_0x3ad121-0x0;var _0x464f92=_0xf1f1[_0x3ad121];return _0x464f92;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x1f1f('0x0'),'remove',_0x1f1f('0x1')];function createListener(_0xe60a89,_0x364f53){return function(_0x4e5a80){_0x364f53[_0x1f1f('0x2')](_0xe60a89,_0x4e5a80);};}function removeListener(_0x458e1a,_0x2b52ab){return function(){UserProfileEvents['removeListener'](_0x458e1a,_0x2b52ab);};}exports[_0x1f1f('0x3')]=function(_0x4d5564){for(var _0x412895=0x0,_0x4f1243=events[_0x1f1f('0x4')];_0x412895<_0x4f1243;_0x412895++){var _0x2bfe35=events[_0x412895];var _0x108521=createListener(_0x1f1f('0x5')+_0x2bfe35,_0x4d5564);UserProfileEvents['on'](_0x2bfe35,_0x108521);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index e7abcad..f2fe958 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 _0x22f6=['path','connect-timeout','express','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x20e082,_0x432227){var _0x38d6aa=function(_0x58848e){while(--_0x58848e){_0x20e082['push'](_0x20e082['shift']());}};_0x38d6aa(++_0x432227);}(_0x22f6,0xc6));var _0x622f=function(_0x3e4620,_0x48f07c){_0x3e4620=_0x3e4620-0x0;var _0x4b9896=_0x22f6[_0x3e4620];return _0x4b9896;};'use strict';var multer=require(_0x622f('0x0'));var util=require(_0x622f('0x1'));var path=require(_0x622f('0x2'));var timeout=require(_0x622f('0x3'));var express=require(_0x622f('0x4'));var router=express['Router']();var fs_extra=require(_0x622f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x622f('0x6'));var config=require('../../config/environment');var controller=require(_0x622f('0x7'));router[_0x622f('0x8')]('/',auth[_0x622f('0x9')](),controller[_0x622f('0xa')]);router[_0x622f('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x622f('0xb')]);router[_0x622f('0x8')]('/:id',auth[_0x622f('0x9')](),controller[_0x622f('0xc')]);router[_0x622f('0xd')]('/',auth['isAuthenticated'](),controller[_0x622f('0xe')]);router[_0x622f('0xf')](_0x622f('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x622f('0x11')](_0x622f('0x10'),auth[_0x622f('0x9')](),controller[_0x622f('0x12')]);module[_0x622f('0x13')]=router; \ No newline at end of file +var _0x273b=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','destroy'];(function(_0x58bd7e,_0x30e73e){var _0x3ae06c=function(_0xd63985){while(--_0xd63985){_0x58bd7e['push'](_0x58bd7e['shift']());}};_0x3ae06c(++_0x30e73e);}(_0x273b,0xfc));var _0xb273=function(_0x2cfacf,_0x51ce72){_0x2cfacf=_0x2cfacf-0x0;var _0x449b65=_0x273b[_0x2cfacf];return _0x449b65;};'use strict';var multer=require(_0xb273('0x0'));var util=require('util');var path=require(_0xb273('0x1'));var timeout=require(_0xb273('0x2'));var express=require(_0xb273('0x3'));var router=express[_0xb273('0x4')]();var fs_extra=require(_0xb273('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb273('0x6'));var config=require('../../config/environment');var controller=require(_0xb273('0x7'));router[_0xb273('0x8')]('/',auth[_0xb273('0x9')](),controller['index']);router[_0xb273('0x8')](_0xb273('0xa'),auth[_0xb273('0x9')](),controller[_0xb273('0xb')]);router[_0xb273('0x8')]('/:id',auth[_0xb273('0x9')](),controller[_0xb273('0xc')]);router[_0xb273('0xd')]('/',auth[_0xb273('0x9')](),controller[_0xb273('0xe')]);router[_0xb273('0xf')](_0xb273('0x10'),auth[_0xb273('0x9')](),controller['update']);router['delete']('/:id',auth[_0xb273('0x9')](),controller[_0xb273('0x11')]);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 9630326..5201136 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 _0x9ea3=['exports','INTEGER','STRING','sequelize'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0x9ea3,0xab));var _0x39ea=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x9ea3[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require(_0x39ea('0x0'));module[_0x39ea('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x39ea('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x39ea('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xca1c=['sequelize','STRING','INTEGER'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xca1c,0x1e0));var _0xcca1=function(_0x3bd49e,_0x3e2799){_0x3bd49e=_0x3bd49e-0x0;var _0x16475e=_0xca1c[_0x3bd49e];return _0x16475e;};'use strict';var Sequelize=require(_0xcca1('0x0'));module['exports']={'name':{'type':Sequelize[_0xcca1('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xcca1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcca1('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 68fb163..d13dc2f 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 _0xd943=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfileResource','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto'];(function(_0x1c0098,_0x220df8){var _0x5df5b6=function(_0x4b48ce){while(--_0x4b48ce){_0x1c0098['push'](_0x1c0098['shift']());}};_0x5df5b6(++_0x220df8);}(_0xd943,0x15d));var _0x3d94=function(_0x20c6de,_0xfe6649){_0x20c6de=_0x20c6de-0x0;var _0x48c83d=_0xd943[_0x20c6de];return _0x48c83d;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));};exports[_0x3d94('0x47')]=function(_0x4af4c2,_0x255630){return db['UserProfileResource']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file +var _0x1a85=['describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy'];(function(_0x4ff457,_0x2a3ef4){var _0x1fe23d=function(_0x30fea4){while(--_0x30fea4){_0x4ff457['push'](_0x4ff457['shift']());}};_0x1fe23d(++_0x2a3ef4);}(_0x1a85,0x178));var _0x51a8=function(_0x2741d1,_0x501426){_0x2741d1=_0x2741d1-0x0;var _0x521e37=_0x1a85[_0x2741d1];return _0x521e37;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['UserProfileResource'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};exports['describe']=function(_0x21c4da,_0xc89617){return db[_0x51a8('0x2a')][_0x51a8('0x4a')]()[_0x51a8('0x23')](respondWithResult(_0xc89617,null))[_0x51a8('0x41')](handleError(_0xc89617,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index ecc2335..03aec9e 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 _0x48a4=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','compositeIndex','resourceId','sectionId','lodash'];(function(_0x3e7c69,_0x275366){var _0x251e59=function(_0x30de66){while(--_0x30de66){_0x3e7c69['push'](_0x3e7c69['shift']());}};_0x251e59(++_0x275366);}(_0x48a4,0x141));var _0x448a=function(_0x45ff7f,_0x2a6a36){_0x45ff7f=_0x45ff7f-0x0;var _0x1f9b35=_0x48a4[_0x45ff7f];return _0x1f9b35;};'use strict';var _=require(_0x448a('0x0'));var util=require('util');var logger=require(_0x448a('0x1'))(_0x448a('0x2'));var moment=require(_0x448a('0x3'));var BPromise=require(_0x448a('0x4'));var rp=require(_0x448a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x448a('0x6'));var config=require(_0x448a('0x7'));var attributes=require(_0x448a('0x8'));module[_0x448a('0x9')]=function(_0x42b01d,_0x26bc22){return _0x42b01d[_0x448a('0xa')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x448a('0xb'),'fields':[_0x448a('0xc'),_0x448a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda1c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','../../config/logger','api'];(function(_0x30887f,_0xe13792){var _0x110805=function(_0x2e3b66){while(--_0x2e3b66){_0x30887f['push'](_0x30887f['shift']());}};_0x110805(++_0xe13792);}(_0xda1c,0x8a));var _0xcda1=function(_0x14c392,_0x511799){_0x14c392=_0x14c392-0x0;var _0x3507e9=_0xda1c[_0x14c392];return _0x3507e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcda1('0x0'))(_0xcda1('0x1'));var moment=require(_0xcda1('0x2'));var BPromise=require(_0xcda1('0x3'));var rp=require(_0xcda1('0x4'));var fs=require('fs');var path=require(_0xcda1('0x5'));var rimraf=require(_0xcda1('0x6'));var config=require(_0xcda1('0x7'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x4ee6f7,_0x4bd298){return _0x4ee6f7[_0xcda1('0x8')](_0xcda1('0x9'),attributes,{'tableName':_0xcda1('0xa'),'paranoid':![],'indexes':[{'name':_0xcda1('0xb'),'fields':[_0xcda1('0xc'),_0xcda1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 17eda9c..b871588 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 _0xa0d9=['ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring'];(function(_0x1bb030,_0x27d05f){var _0x28ef4f=function(_0xb1150e){while(--_0xb1150e){_0x1bb030['push'](_0x1bb030['shift']());}};_0x28ef4f(++_0x27d05f);}(_0xa0d9,0x1e0));var _0x9a0d=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0xa0d9[_0x4fc421];return _0x8c6d63;};'use strict';var _=require(_0x9a0d('0x0'));var util=require(_0x9a0d('0x1'));var moment=require('moment');var BPromise=require(_0x9a0d('0x2'));var rs=require(_0x9a0d('0x3'));var fs=require('fs');var Redis=require(_0x9a0d('0x4'));var db=require(_0x9a0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a0d('0x6'))(_0x9a0d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a0d('0x8')][_0x9a0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdc4fb6,_0x119f2c,_0x26aa63){return new BPromise(function(_0x52d52e,_0x23f9a0){return client[_0x9a0d('0xa')](_0xdc4fb6,_0x26aa63)[_0x9a0d('0xb')](function(_0x17cfcc){logger['info'](_0x9a0d('0xc'),_0x119f2c,_0x9a0d('0xd'));logger[_0x9a0d('0xe')](_0x9a0d('0xf'),_0x119f2c,_0x9a0d('0xd'),JSON[_0x9a0d('0x10')](_0x17cfcc));if(_0x17cfcc[_0x9a0d('0x11')]){if(_0x17cfcc[_0x9a0d('0x11')][_0x9a0d('0x12')]===0x1f4){logger[_0x9a0d('0x11')](_0x9a0d('0xc'),_0x119f2c,_0x17cfcc['error'][_0x9a0d('0x13')]);return _0x23f9a0(_0x17cfcc[_0x9a0d('0x11')][_0x9a0d('0x13')]);}logger[_0x9a0d('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x119f2c,_0x17cfcc[_0x9a0d('0x11')][_0x9a0d('0x13')]);return _0x52d52e(_0x17cfcc[_0x9a0d('0x11')][_0x9a0d('0x13')]);}else{logger[_0x9a0d('0x14')](_0x9a0d('0xc'),_0x119f2c,_0x9a0d('0xd'));_0x52d52e(_0x17cfcc['result'][_0x9a0d('0x13')]);}})[_0x9a0d('0x15')](function(_0x27c276){logger[_0x9a0d('0x11')](_0x9a0d('0xc'),_0x119f2c,_0x27c276);_0x23f9a0(_0x27c276);});});} \ No newline at end of file +var _0xb57e=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x38b3cb,_0x4ad7b3){var _0x5a9a84=function(_0x237634){while(--_0x237634){_0x38b3cb['push'](_0x38b3cb['shift']());}};_0x5a9a84(++_0x4ad7b3);}(_0xb57e,0x181));var _0xeb57=function(_0x224f30,_0x4483c7){_0x224f30=_0x224f30-0x0;var _0x2a67ad=_0xb57e[_0x224f30];return _0x2a67ad;};'use strict';var _=require(_0xeb57('0x0'));var util=require(_0xeb57('0x1'));var moment=require('moment');var BPromise=require(_0xeb57('0x2'));var rs=require(_0xeb57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb57('0x4'))['db'];var utils=require(_0xeb57('0x5'));var logger=require(_0xeb57('0x6'))(_0xeb57('0x7'));var config=require(_0xeb57('0x8'));var jayson=require(_0xeb57('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2be16a,_0x371793,_0x26f98d){return new BPromise(function(_0x4304f2,_0x243787){return client[_0xeb57('0xa')](_0x2be16a,_0x26f98d)[_0xeb57('0xb')](function(_0x5cb947){logger[_0xeb57('0xc')](_0xeb57('0xd'),_0x371793,'request\x20sent');logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x371793,_0xeb57('0xe'),JSON[_0xeb57('0xf')](_0x5cb947));if(_0x5cb947['error']){if(_0x5cb947[_0xeb57('0x10')][_0xeb57('0x11')]===0x1f4){logger[_0xeb57('0x10')](_0xeb57('0xd'),_0x371793,_0x5cb947[_0xeb57('0x10')]['message']);return _0x243787(_0x5cb947[_0xeb57('0x10')][_0xeb57('0x12')]);}logger[_0xeb57('0x10')](_0xeb57('0xd'),_0x371793,_0x5cb947[_0xeb57('0x10')][_0xeb57('0x12')]);return _0x4304f2(_0x5cb947[_0xeb57('0x10')][_0xeb57('0x12')]);}else{logger[_0xeb57('0xc')](_0xeb57('0xd'),_0x371793,_0xeb57('0xe'));_0x4304f2(_0x5cb947[_0xeb57('0x13')][_0xeb57('0x12')]);}})[_0xeb57('0x14')](function(_0x353928){logger[_0xeb57('0x10')](_0xeb57('0xd'),_0x371793,_0x353928);_0x243787(_0x353928);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 421ea0b..b89ffc2 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 _0xc750=['fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id','delete','exports','connect-timeout','express'];(function(_0x508b59,_0x42834d){var _0x2ef5f2=function(_0x5d4604){while(--_0x5d4604){_0x508b59['push'](_0x508b59['shift']());}};_0x2ef5f2(++_0x42834d);}(_0xc750,0x11f));var _0x0c75=function(_0xdb26c,_0x4b9278){_0xdb26c=_0xdb26c-0x0;var _0x43cfd1=_0xc750[_0xdb26c];return _0x43cfd1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0c75('0x0'));var express=require(_0x0c75('0x1'));var router=express['Router']();var fs_extra=require(_0x0c75('0x2'));var auth=require(_0x0c75('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0c75('0x4'));var controller=require(_0x0c75('0x5'));router[_0x0c75('0x6')]('/',auth[_0x0c75('0x7')](),controller[_0x0c75('0x8')]);router[_0x0c75('0x6')]('/describe',auth[_0x0c75('0x7')](),controller[_0x0c75('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0c75('0xa')]);router[_0x0c75('0xb')]('/',auth[_0x0c75('0x7')](),controller[_0x0c75('0xc')]);router[_0x0c75('0xd')](_0x0c75('0xe'),auth[_0x0c75('0x7')](),controller['update']);router[_0x0c75('0xf')](_0x0c75('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x0c75('0x10')]=router; \ No newline at end of file +var _0x1ac4=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','post','create','put','destroy'];(function(_0x56af64,_0xf7cc03){var _0x49fca3=function(_0x4419ae){while(--_0x4419ae){_0x56af64['push'](_0x56af64['shift']());}};_0x49fca3(++_0xf7cc03);}(_0x1ac4,0x112));var _0x41ac=function(_0x923e53,_0x2cc867){_0x923e53=_0x923e53-0x0;var _0x4d0120=_0x1ac4[_0x923e53];return _0x4d0120;};'use strict';var multer=require(_0x41ac('0x0'));var util=require(_0x41ac('0x1'));var path=require(_0x41ac('0x2'));var timeout=require(_0x41ac('0x3'));var express=require(_0x41ac('0x4'));var router=express[_0x41ac('0x5')]();var fs_extra=require(_0x41ac('0x6'));var auth=require(_0x41ac('0x7'));var interaction=require(_0x41ac('0x8'));var config=require(_0x41ac('0x9'));var controller=require(_0x41ac('0xa'));router[_0x41ac('0xb')]('/',auth[_0x41ac('0xc')](),controller[_0x41ac('0xd')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x41ac('0xe')]);router[_0x41ac('0xb')](_0x41ac('0xf'),auth[_0x41ac('0xc')](),controller['show']);router[_0x41ac('0x10')]('/',auth['isAuthenticated'](),controller[_0x41ac('0x11')]);router[_0x41ac('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x41ac('0xf'),auth[_0x41ac('0xc')](),controller[_0x41ac('0x13')]);module[_0x41ac('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index be01596..bf562d7 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 _0xbfcc=['split','sequelize','STRING','INTEGER','BOOLEAN','join','getDataValue'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0xbfcc[_0x3f00ee];return _0x18a07e;};'use strict';var Sequelize=require(_0xcbfc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xcbfc('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xcbfc('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xcbfc('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xcbfc('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x59b1de){this['setDataValue']('crudPermissions',_0x59b1de?_0x59b1de[_0xcbfc('0x4')](''):[]);},'get':function(){return this[_0xcbfc('0x5')]('crudPermissions')?this[_0xcbfc('0x5')]('crudPermissions')[_0xcbfc('0x6')](''):[];}}}; \ No newline at end of file +var _0x34b7=['BOOLEAN','crudPermissions','join','getDataValue','STRING','INTEGER'];(function(_0x34fc32,_0x1b372f){var _0x567758=function(_0x54ca0f){while(--_0x54ca0f){_0x34fc32['push'](_0x34fc32['shift']());}};_0x567758(++_0x1b372f);}(_0x34b7,0x196));var _0x734b=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0x34b7[_0x2b0a86];return _0x955940;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x734b('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x734b('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x734b('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x734b('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x734b('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x734b('0x0')],'set':function(_0x5de1ae){this['setDataValue'](_0x734b('0x3'),_0x5de1ae?_0x5de1ae[_0x734b('0x4')](''):[]);},'get':function(){return this[_0x734b('0x5')](_0x734b('0x3'))?this[_0x734b('0x5')](_0x734b('0x3'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index c0f497e..6de261a 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 _0x334a=['where','filters','pick','filter','merge','VIRTUAL','options','UserProfileSection','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x3e6ebb,_0x3020b9){var _0xfe3a7d=function(_0x1b6d9a){while(--_0x1b6d9a){_0x3e6ebb['push'](_0x3e6ebb['shift']());}};_0xfe3a7d(++_0x3020b9);}(_0x334a,0xa8));var _0xa334=function(_0x28850f,_0x2eacbd){_0x28850f=_0x28850f-0x0;var _0x2ab98b=_0x334a[_0x28850f];return _0x2ab98b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa334('0x0'));var zipdir=require(_0xa334('0x1'));var jsonpatch=require(_0xa334('0x2'));var rp=require('request-promise');var moment=require(_0xa334('0x3'));var BPromise=require(_0xa334('0x4'));var Mustache=require(_0xa334('0x5'));var util=require('util');var path=require(_0xa334('0x6'));var sox=require(_0xa334('0x7'));var csv=require(_0xa334('0x8'));var ejs=require(_0xa334('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa334('0xa'));var squel=require('squel');var crypto=require(_0xa334('0xb'));var jsforce=require(_0xa334('0xc'));var deskjs=require(_0xa334('0xd'));var toCsv=require(_0xa334('0x8'));var querystring=require(_0xa334('0xe'));var Papa=require(_0xa334('0xf'));var Redis=require(_0xa334('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa334('0x11'));var hardwareService=require(_0xa334('0x12'));var logger=require(_0xa334('0x13'))(_0xa334('0x14'));var utils=require('../../config/utils');var config=require(_0xa334('0x15'));var licenseUtil=require(_0xa334('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2282af,_0x35ea8c){_0x35ea8c=_0x35ea8c||0xcc;return function(_0x17ff0d){if(_0x17ff0d){return _0x2282af[_0xa334('0x17')](_0x35ea8c);}return _0x2282af[_0xa334('0x18')](_0x35ea8c)[_0xa334('0x19')]();};}function respondWithResult(_0x4e3387,_0x14b991){_0x14b991=_0x14b991||0xc8;return function(_0xca9352){if(_0xca9352){return _0x4e3387[_0xa334('0x18')](_0x14b991)['json'](_0xca9352);}};}function respondWithFilteredResult(_0x5cbadb,_0x79cff1){return function(_0x3f0f9b){if(_0x3f0f9b){var _0x1c132f=typeof _0x79cff1['offset']===_0xa334('0x1a')&&typeof _0x79cff1[_0xa334('0x1b')]===_0xa334('0x1a');var _0x32fb5b=_0x3f0f9b['count'];var _0x36801c=_0x1c132f?0x0:_0x79cff1[_0xa334('0x1c')];var _0x263c2b=_0x1c132f?_0x3f0f9b[_0xa334('0x1d')]:_0x79cff1[_0xa334('0x1c')]+_0x79cff1[_0xa334('0x1b')];var _0x429174;if(_0x263c2b>=_0x32fb5b){_0x263c2b=_0x32fb5b;_0x429174=0xc8;}else{_0x429174=0xce;}_0x5cbadb[_0xa334('0x18')](_0x429174);return _0x5cbadb[_0xa334('0x1e')](_0xa334('0x1f'),_0x36801c+'-'+_0x263c2b+'/'+_0x32fb5b)['json'](_0x3f0f9b);}return null;};}function patchUpdates(_0x3801b0){return function(_0x4a5b14){try{jsonpatch[_0xa334('0x20')](_0x4a5b14,_0x3801b0,!![]);}catch(_0x52afeb){return BPromise[_0xa334('0x21')](_0x52afeb);}return _0x4a5b14['save']();};}function saveUpdates(_0x57afb0,_0x262041){return function(_0x48d50a){if(_0x48d50a){return _0x48d50a[_0xa334('0x22')](_0x57afb0)[_0xa334('0x23')](function(_0x5a28c6){return _0x5a28c6;});}return null;};}function removeEntity(_0x31bd87,_0x1128ab){return function(_0x3f264a){if(_0x3f264a){return _0x3f264a[_0xa334('0x24')]()[_0xa334('0x23')](function(){_0x31bd87[_0xa334('0x18')](0xcc)[_0xa334('0x19')]();});}};}function handleEntityNotFound(_0x3bf088,_0x1da82d){return function(_0x2d6ed5){if(!_0x2d6ed5){_0x3bf088[_0xa334('0x17')](0x194);}return _0x2d6ed5;};}function handleError(_0x3ab8a6,_0x58ed2c){_0x58ed2c=_0x58ed2c||0x1f4;return function(_0x86401c){logger[_0xa334('0x25')](_0x86401c[_0xa334('0x26')]);if(_0x86401c[_0xa334('0x27')]){delete _0x86401c['name'];}_0x3ab8a6['status'](_0x58ed2c)[_0xa334('0x28')](_0x86401c);};}exports[_0xa334('0x29')]=function(_0x49e4ff,_0xed05b0){var _0x2909d={},_0x5947ea={},_0x19a214={'count':0x0,'rows':[]};var _0x29b66f=_[_0xa334('0x2a')](db['UserProfileSection']['rawAttributes'],function(_0x2b2f71){return{'name':_0x2b2f71['fieldName'],'type':_0x2b2f71[_0xa334('0x2b')][_0xa334('0x2c')]};});_0x5947ea[_0xa334('0x2d')]=_[_0xa334('0x2a')](_0x29b66f,_0xa334('0x27'));_0x5947ea[_0xa334('0x2e')]=_['keys'](_0x49e4ff[_0xa334('0x2e')]);_0x5947ea['filters']=_[_0xa334('0x2f')](_0x5947ea[_0xa334('0x2d')],_0x5947ea[_0xa334('0x2e')]);_0x2909d[_0xa334('0x30')]=_[_0xa334('0x2f')](_0x5947ea[_0xa334('0x2d')],qs[_0xa334('0x31')](_0x49e4ff[_0xa334('0x2e')][_0xa334('0x31')]));_0x2909d[_0xa334('0x30')]=_0x2909d[_0xa334('0x30')]['length']?_0x2909d[_0xa334('0x30')]:_0x5947ea['model'];if(!_0x49e4ff[_0xa334('0x2e')][_0xa334('0x32')](_0xa334('0x33'))){_0x2909d['limit']=qs[_0xa334('0x1b')](_0x49e4ff[_0xa334('0x2e')][_0xa334('0x1b')]);_0x2909d[_0xa334('0x1c')]=qs[_0xa334('0x1c')](_0x49e4ff[_0xa334('0x2e')][_0xa334('0x1c')]);}_0x2909d[_0xa334('0x34')]=qs[_0xa334('0x35')](_0x49e4ff['query'][_0xa334('0x35')]);_0x2909d[_0xa334('0x36')]=qs[_0xa334('0x37')](_[_0xa334('0x38')](_0x49e4ff[_0xa334('0x2e')],_0x5947ea['filters']),_0x29b66f);if(_0x49e4ff[_0xa334('0x2e')][_0xa334('0x39')]){_0x2909d['where']=_[_0xa334('0x3a')](_0x2909d['where'],{'$or':_['map'](_0x29b66f,function(_0x18243a){if(_0x18243a['type']!==_0xa334('0x3b')){var _0x1d8853={};_0x1d8853[_0x18243a[_0xa334('0x27')]]={'$like':'%'+_0x49e4ff['query'][_0xa334('0x39')]+'%'};return _0x1d8853;}})});}_0x2909d=_[_0xa334('0x3a')]({},_0x2909d,_0x49e4ff[_0xa334('0x3c')]);var _0x3faf9a={'where':_0x2909d[_0xa334('0x36')]};return db[_0xa334('0x3d')][_0xa334('0x1d')](_0x3faf9a)['then'](function(_0x56a31f){_0x19a214['count']=_0x56a31f;if(_0x49e4ff[_0xa334('0x2e')][_0xa334('0x3e')]){_0x2909d['include']=[{'all':!![]}];}return db[_0xa334('0x3d')][_0xa334('0x3f')](_0x2909d);})[_0xa334('0x23')](function(_0x122fda){_0x19a214[_0xa334('0x40')]=_0x122fda;return _0x19a214;})[_0xa334('0x23')](respondWithFilteredResult(_0xed05b0,_0x2909d))['catch'](handleError(_0xed05b0,null));};exports[_0xa334('0x41')]=function(_0x93dfb8,_0x37e434){var _0x41ac97={'raw':![],'where':{'id':_0x93dfb8[_0xa334('0x42')]['id']}},_0x2b9387={};_0x2b9387['model']=_['keys'](db[_0xa334('0x3d')][_0xa334('0x43')]);_0x2b9387[_0xa334('0x2e')]=_['keys'](_0x93dfb8[_0xa334('0x2e')]);_0x2b9387[_0xa334('0x37')]=_[_0xa334('0x2f')](_0x2b9387[_0xa334('0x2d')],_0x2b9387[_0xa334('0x2e')]);_0x41ac97[_0xa334('0x30')]=_[_0xa334('0x2f')](_0x2b9387['model'],qs['fields'](_0x93dfb8[_0xa334('0x2e')][_0xa334('0x31')]));_0x41ac97[_0xa334('0x30')]=_0x41ac97[_0xa334('0x30')]['length']?_0x41ac97['attributes']:_0x2b9387[_0xa334('0x2d')];if(_0x93dfb8[_0xa334('0x2e')][_0xa334('0x3e')]){_0x41ac97[_0xa334('0x44')]=[{'all':!![]}];}_0x41ac97=_[_0xa334('0x3a')]({},_0x41ac97,_0x93dfb8[_0xa334('0x3c')]);return db[_0xa334('0x3d')][_0xa334('0x45')](_0x41ac97)[_0xa334('0x23')](handleEntityNotFound(_0x37e434,null))[_0xa334('0x23')](respondWithResult(_0x37e434,null))[_0xa334('0x46')](handleError(_0x37e434,null));};exports[_0xa334('0x47')]=function(_0x2f112c,_0xe808c){return db[_0xa334('0x3d')]['create'](_0x2f112c[_0xa334('0x48')],{})['then'](respondWithResult(_0xe808c,0xc9))['catch'](handleError(_0xe808c,null));};exports[_0xa334('0x22')]=function(_0x5d16d9,_0x1be0c1){if(_0x5d16d9[_0xa334('0x48')]['id']){delete _0x5d16d9[_0xa334('0x48')]['id'];}return db[_0xa334('0x3d')]['find']({'where':{'id':_0x5d16d9[_0xa334('0x42')]['id']}})['then'](handleEntityNotFound(_0x1be0c1,null))[_0xa334('0x23')](saveUpdates(_0x5d16d9[_0xa334('0x48')],null))[_0xa334('0x23')](respondWithResult(_0x1be0c1,null))[_0xa334('0x46')](handleError(_0x1be0c1,null));};exports['destroy']=function(_0x2ad6f1,_0x470281){return db[_0xa334('0x3d')][_0xa334('0x45')]({'where':{'id':_0x2ad6f1[_0xa334('0x42')]['id']}})[_0xa334('0x23')](handleEntityNotFound(_0x470281,null))[_0xa334('0x23')](removeEntity(_0x470281,null))[_0xa334('0x46')](handleError(_0x470281,null));};exports[_0xa334('0x49')]=function(_0x1c3992,_0x5c03c1){return db[_0xa334('0x3d')][_0xa334('0x49')]()['then'](respondWithResult(_0x5c03c1,null))[_0xa334('0x46')](handleError(_0x5c03c1,null));}; \ No newline at end of file +var _0x4db0=['findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x3eaa9d,_0x57f561){var _0x3e7a6f=function(_0x54174c){while(--_0x54174c){_0x3eaa9d['push'](_0x3eaa9d['shift']());}};_0x3e7a6f(++_0x57f561);}(_0x4db0,0x1c5));var _0x04db=function(_0x49f67f,_0x4113a4){_0x49f67f=_0x49f67f-0x0;var _0x4779a1=_0x4db0[_0x49f67f];return _0x4779a1;};'use strict';var emlformat=require(_0x04db('0x0'));var rimraf=require(_0x04db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x04db('0x2'));var Mustache=require(_0x04db('0x3'));var util=require(_0x04db('0x4'));var path=require(_0x04db('0x5'));var sox=require('sox');var csv=require(_0x04db('0x6'));var ejs=require(_0x04db('0x7'));var fs=require('fs');var fs_extra=require(_0x04db('0x8'));var _=require('lodash');var squel=require(_0x04db('0x9'));var crypto=require(_0x04db('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x04db('0xb'));var toCsv=require(_0x04db('0x6'));var querystring=require(_0x04db('0xc'));var Papa=require(_0x04db('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04db('0xe'));var logger=require(_0x04db('0xf'))(_0x04db('0x10'));var utils=require(_0x04db('0x11'));var config=require(_0x04db('0x12'));var licenseUtil=require(_0x04db('0x13'));var db=require(_0x04db('0x14'))['db'];function respondWithStatusCode(_0x1fe499,_0x268fd9){_0x268fd9=_0x268fd9||0xcc;return function(_0x4ce9a6){if(_0x4ce9a6){return _0x1fe499[_0x04db('0x15')](_0x268fd9);}return _0x1fe499[_0x04db('0x16')](_0x268fd9)[_0x04db('0x17')]();};}function respondWithResult(_0x327350,_0x547146){_0x547146=_0x547146||0xc8;return function(_0x20fc0e){if(_0x20fc0e){return _0x327350[_0x04db('0x16')](_0x547146)[_0x04db('0x18')](_0x20fc0e);}};}function respondWithFilteredResult(_0x83316b,_0x4011ec){return function(_0xe514e){if(_0xe514e){var _0x91a000=typeof _0x4011ec['offset']===_0x04db('0x19')&&typeof _0x4011ec[_0x04db('0x1a')]===_0x04db('0x19');var _0x529b27=_0xe514e[_0x04db('0x1b')];var _0x327629=_0x91a000?0x0:_0x4011ec[_0x04db('0x1c')];var _0x53c4b6=_0x91a000?_0xe514e[_0x04db('0x1b')]:_0x4011ec[_0x04db('0x1c')]+_0x4011ec[_0x04db('0x1a')];var _0x47961c;if(_0x53c4b6>=_0x529b27){_0x53c4b6=_0x529b27;_0x47961c=0xc8;}else{_0x47961c=0xce;}_0x83316b[_0x04db('0x16')](_0x47961c);return _0x83316b[_0x04db('0x1d')]('Content-Range',_0x327629+'-'+_0x53c4b6+'/'+_0x529b27)[_0x04db('0x18')](_0xe514e);}return null;};}function patchUpdates(_0xa61dd5){return function(_0x47146f){try{jsonpatch['apply'](_0x47146f,_0xa61dd5,!![]);}catch(_0x5bc05b){return BPromise[_0x04db('0x1e')](_0x5bc05b);}return _0x47146f[_0x04db('0x1f')]();};}function saveUpdates(_0x56d513,_0x3cd309){return function(_0x534c63){if(_0x534c63){return _0x534c63[_0x04db('0x20')](_0x56d513)[_0x04db('0x21')](function(_0x49d429){return _0x49d429;});}return null;};}function removeEntity(_0x4846c2,_0x20a49c){return function(_0x47bd04){if(_0x47bd04){return _0x47bd04[_0x04db('0x22')]()[_0x04db('0x21')](function(){_0x4846c2[_0x04db('0x16')](0xcc)[_0x04db('0x17')]();});}};}function handleEntityNotFound(_0x4d9e56,_0x280098){return function(_0x2e5f2f){if(!_0x2e5f2f){_0x4d9e56[_0x04db('0x15')](0x194);}return _0x2e5f2f;};}function handleError(_0x1c22e0,_0x5e090e){_0x5e090e=_0x5e090e||0x1f4;return function(_0x64eed4){logger[_0x04db('0x23')](_0x64eed4[_0x04db('0x24')]);if(_0x64eed4['name']){delete _0x64eed4[_0x04db('0x25')];}_0x1c22e0[_0x04db('0x16')](_0x5e090e)[_0x04db('0x26')](_0x64eed4);};}exports[_0x04db('0x27')]=function(_0x55e0f8,_0x48d68d){var _0x16c537={},_0x451c23={},_0x1847be={'count':0x0,'rows':[]};var _0x18cae6=_[_0x04db('0x28')](db[_0x04db('0x29')][_0x04db('0x2a')],function(_0x2e3542){return{'name':_0x2e3542[_0x04db('0x2b')],'type':_0x2e3542[_0x04db('0x2c')][_0x04db('0x2d')]};});_0x451c23[_0x04db('0x2e')]=_['map'](_0x18cae6,_0x04db('0x25'));_0x451c23['query']=_[_0x04db('0x2f')](_0x55e0f8[_0x04db('0x30')]);_0x451c23[_0x04db('0x31')]=_[_0x04db('0x32')](_0x451c23[_0x04db('0x2e')],_0x451c23[_0x04db('0x30')]);_0x16c537[_0x04db('0x33')]=_['intersection'](_0x451c23[_0x04db('0x2e')],qs[_0x04db('0x34')](_0x55e0f8[_0x04db('0x30')][_0x04db('0x34')]));_0x16c537[_0x04db('0x33')]=_0x16c537[_0x04db('0x33')][_0x04db('0x35')]?_0x16c537[_0x04db('0x33')]:_0x451c23[_0x04db('0x2e')];if(!_0x55e0f8[_0x04db('0x30')][_0x04db('0x36')](_0x04db('0x37'))){_0x16c537[_0x04db('0x1a')]=qs[_0x04db('0x1a')](_0x55e0f8[_0x04db('0x30')][_0x04db('0x1a')]);_0x16c537[_0x04db('0x1c')]=qs['offset'](_0x55e0f8[_0x04db('0x30')][_0x04db('0x1c')]);}_0x16c537[_0x04db('0x38')]=qs['sort'](_0x55e0f8[_0x04db('0x30')]['sort']);_0x16c537[_0x04db('0x39')]=qs[_0x04db('0x31')](_[_0x04db('0x3a')](_0x55e0f8[_0x04db('0x30')],_0x451c23[_0x04db('0x31')]),_0x18cae6);if(_0x55e0f8[_0x04db('0x30')][_0x04db('0x3b')]){_0x16c537[_0x04db('0x39')]=_[_0x04db('0x3c')](_0x16c537[_0x04db('0x39')],{'$or':_[_0x04db('0x28')](_0x18cae6,function(_0x2adacc){if(_0x2adacc[_0x04db('0x2c')]!==_0x04db('0x3d')){var _0x54a573={};_0x54a573[_0x2adacc['name']]={'$like':'%'+_0x55e0f8[_0x04db('0x30')]['filter']+'%'};return _0x54a573;}})});}_0x16c537=_[_0x04db('0x3c')]({},_0x16c537,_0x55e0f8[_0x04db('0x3e')]);var _0xb9130b={'where':_0x16c537[_0x04db('0x39')]};return db[_0x04db('0x29')][_0x04db('0x1b')](_0xb9130b)[_0x04db('0x21')](function(_0xa65022){_0x1847be[_0x04db('0x1b')]=_0xa65022;if(_0x55e0f8[_0x04db('0x30')][_0x04db('0x3f')]){_0x16c537[_0x04db('0x40')]=[{'all':!![]}];}return db[_0x04db('0x29')][_0x04db('0x41')](_0x16c537);})[_0x04db('0x21')](function(_0x577fad){_0x1847be[_0x04db('0x42')]=_0x577fad;return _0x1847be;})['then'](respondWithFilteredResult(_0x48d68d,_0x16c537))[_0x04db('0x43')](handleError(_0x48d68d,null));};exports[_0x04db('0x44')]=function(_0x579ee9,_0x35d50a){var _0x2c8dac={'raw':![],'where':{'id':_0x579ee9[_0x04db('0x45')]['id']}},_0x2556f0={};_0x2556f0[_0x04db('0x2e')]=_[_0x04db('0x2f')](db['UserProfileSection'][_0x04db('0x2a')]);_0x2556f0[_0x04db('0x30')]=_[_0x04db('0x2f')](_0x579ee9[_0x04db('0x30')]);_0x2556f0[_0x04db('0x31')]=_[_0x04db('0x32')](_0x2556f0[_0x04db('0x2e')],_0x2556f0[_0x04db('0x30')]);_0x2c8dac[_0x04db('0x33')]=_[_0x04db('0x32')](_0x2556f0['model'],qs[_0x04db('0x34')](_0x579ee9['query'][_0x04db('0x34')]));_0x2c8dac['attributes']=_0x2c8dac[_0x04db('0x33')][_0x04db('0x35')]?_0x2c8dac[_0x04db('0x33')]:_0x2556f0[_0x04db('0x2e')];if(_0x579ee9['query']['includeAll']){_0x2c8dac[_0x04db('0x40')]=[{'all':!![]}];}_0x2c8dac=_[_0x04db('0x3c')]({},_0x2c8dac,_0x579ee9[_0x04db('0x3e')]);return db['UserProfileSection'][_0x04db('0x46')](_0x2c8dac)[_0x04db('0x21')](handleEntityNotFound(_0x35d50a,null))[_0x04db('0x21')](respondWithResult(_0x35d50a,null))[_0x04db('0x43')](handleError(_0x35d50a,null));};exports[_0x04db('0x47')]=function(_0x4b9d7d,_0x3cf7fc){return db[_0x04db('0x29')][_0x04db('0x47')](_0x4b9d7d[_0x04db('0x48')],{})['then'](respondWithResult(_0x3cf7fc,0xc9))['catch'](handleError(_0x3cf7fc,null));};exports[_0x04db('0x20')]=function(_0x4f48af,_0x32cf48){if(_0x4f48af[_0x04db('0x48')]['id']){delete _0x4f48af[_0x04db('0x48')]['id'];}return db['UserProfileSection'][_0x04db('0x46')]({'where':{'id':_0x4f48af[_0x04db('0x45')]['id']}})[_0x04db('0x21')](handleEntityNotFound(_0x32cf48,null))[_0x04db('0x21')](saveUpdates(_0x4f48af['body'],null))[_0x04db('0x21')](respondWithResult(_0x32cf48,null))[_0x04db('0x43')](handleError(_0x32cf48,null));};exports['destroy']=function(_0x34445c,_0x282427){return db[_0x04db('0x29')][_0x04db('0x46')]({'where':{'id':_0x34445c[_0x04db('0x45')]['id']}})['then'](handleEntityNotFound(_0x282427,null))[_0x04db('0x21')](removeEntity(_0x282427,null))[_0x04db('0x43')](handleError(_0x282427,null));};exports['describe']=function(_0x28a105,_0x464a1d){return db[_0x04db('0x29')][_0x04db('0x49')]()[_0x04db('0x21')](respondWithResult(_0x464a1d,null))['catch'](handleError(_0x464a1d,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 7399beb..6cb6c7d 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 _0x5ca3=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./userProfileSection.attributes','define'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x5ca3,0x10f));var _0x35ca=function(_0x38e6e8,_0x541de0){_0x38e6e8=_0x38e6e8-0x0;var _0x3936d8=_0x5ca3[_0x38e6e8];return _0x3936d8;};'use strict';var _=require(_0x35ca('0x0'));var util=require(_0x35ca('0x1'));var logger=require(_0x35ca('0x2'))('api');var moment=require(_0x35ca('0x3'));var BPromise=require('bluebird');var rp=require(_0x35ca('0x4'));var fs=require('fs');var path=require(_0x35ca('0x5'));var rimraf=require('rimraf');var config=require(_0x35ca('0x6'));var attributes=require(_0x35ca('0x7'));module['exports']=function(_0x3232ce,_0xeb355b){return _0x3232ce[_0x35ca('0x8')](_0x35ca('0x9'),attributes,{'tableName':_0x35ca('0xa'),'paranoid':![],'indexes':[{'name':_0x35ca('0xb'),'fields':[_0x35ca('0xc'),_0x35ca('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x86ab=['sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections'];(function(_0x1eda22,_0x1df6f1){var _0x38f523=function(_0x35c9aa){while(--_0x35c9aa){_0x1eda22['push'](_0x1eda22['shift']());}};_0x38f523(++_0x1df6f1);}(_0x86ab,0xa7));var _0xb86a=function(_0x1cf52a,_0x4e02bc){_0x1cf52a=_0x1cf52a-0x0;var _0x5112ed=_0x86ab[_0x1cf52a];return _0x5112ed;};'use strict';var _=require(_0xb86a('0x0'));var util=require(_0xb86a('0x1'));var logger=require(_0xb86a('0x2'))(_0xb86a('0x3'));var moment=require(_0xb86a('0x4'));var BPromise=require(_0xb86a('0x5'));var rp=require(_0xb86a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb86a('0x7'));var config=require(_0xb86a('0x8'));var attributes=require(_0xb86a('0x9'));module['exports']=function(_0x3080b7,_0x35a8a4){return _0x3080b7[_0xb86a('0xa')](_0xb86a('0xb'),attributes,{'tableName':_0xb86a('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb86a('0xd'),_0xb86a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index d044492..ce3c9f0 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 _0x07ae=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x21bd89,_0x2506aa){var _0x3a031a=function(_0x1c43f5){while(--_0x1c43f5){_0x21bd89['push'](_0x21bd89['shift']());}};_0x3a031a(++_0x2506aa);}(_0x07ae,0x1c8));var _0xe07a=function(_0x16b24e,_0x359abe){_0x16b24e=_0x16b24e-0x0;var _0x8c0185=_0x07ae[_0x16b24e];return _0x8c0185;};'use strict';var _=require(_0xe07a('0x0'));var util=require('util');var moment=require(_0xe07a('0x1'));var BPromise=require(_0xe07a('0x2'));var rs=require(_0xe07a('0x3'));var fs=require('fs');var Redis=require(_0xe07a('0x4'));var db=require(_0xe07a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe07a('0x6'))(_0xe07a('0x7'));var config=require(_0xe07a('0x8'));var jayson=require(_0xe07a('0x9'));var client=jayson[_0xe07a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5afb10,_0x3a635f,_0x696bd3){return new BPromise(function(_0x2ea99b,_0x3d69a2){return client['request'](_0x5afb10,_0x696bd3)[_0xe07a('0xb')](function(_0x40e735){logger[_0xe07a('0xc')](_0xe07a('0xd'),_0x3a635f,_0xe07a('0xe'));logger[_0xe07a('0xf')](_0xe07a('0x10'),_0x3a635f,_0xe07a('0xe'),JSON[_0xe07a('0x11')](_0x40e735));if(_0x40e735[_0xe07a('0x12')]){if(_0x40e735[_0xe07a('0x12')][_0xe07a('0x13')]===0x1f4){logger[_0xe07a('0x12')](_0xe07a('0xd'),_0x3a635f,_0x40e735[_0xe07a('0x12')][_0xe07a('0x14')]);return _0x3d69a2(_0x40e735[_0xe07a('0x12')][_0xe07a('0x14')]);}logger['error'](_0xe07a('0xd'),_0x3a635f,_0x40e735[_0xe07a('0x12')]['message']);return _0x2ea99b(_0x40e735[_0xe07a('0x12')][_0xe07a('0x14')]);}else{logger[_0xe07a('0xc')](_0xe07a('0xd'),_0x3a635f,_0xe07a('0xe'));_0x2ea99b(_0x40e735['result']['message']);}})[_0xe07a('0x15')](function(_0x3f92df){logger[_0xe07a('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x3a635f,_0x3f92df);_0x3d69a2(_0x3f92df);});});} \ No newline at end of file +var _0x1403=['request\x20sent','stringify','error','message','UserProfileSection,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x1403,0x167));var _0x3140=function(_0xf969eb,_0x4c6c2d){_0xf969eb=_0xf969eb-0x0;var _0x2de570=_0x1403[_0xf969eb];return _0x2de570;};'use strict';var _=require(_0x3140('0x0'));var util=require(_0x3140('0x1'));var moment=require(_0x3140('0x2'));var BPromise=require(_0x3140('0x3'));var rs=require(_0x3140('0x4'));var fs=require('fs');var Redis=require(_0x3140('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3140('0x6'));var logger=require(_0x3140('0x7'))(_0x3140('0x8'));var config=require('../../config/environment');var jayson=require(_0x3140('0x9'));var client=jayson[_0x3140('0xa')][_0x3140('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x444f49,_0x2693ae,_0x3b5e21){return new BPromise(function(_0x225494,_0x197ae2){return client[_0x3140('0xc')](_0x444f49,_0x3b5e21)[_0x3140('0xd')](function(_0x503cfc){logger[_0x3140('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x2693ae,_0x3140('0xf'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2693ae,'request\x20sent',JSON[_0x3140('0x10')](_0x503cfc));if(_0x503cfc['error']){if(_0x503cfc['error']['code']===0x1f4){logger[_0x3140('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2693ae,_0x503cfc[_0x3140('0x11')]['message']);return _0x197ae2(_0x503cfc[_0x3140('0x11')][_0x3140('0x12')]);}logger[_0x3140('0x11')](_0x3140('0x13'),_0x2693ae,_0x503cfc[_0x3140('0x11')][_0x3140('0x12')]);return _0x225494(_0x503cfc[_0x3140('0x11')][_0x3140('0x12')]);}else{logger['info'](_0x3140('0x13'),_0x2693ae,_0x3140('0xf'));_0x225494(_0x503cfc[_0x3140('0x14')][_0x3140('0x12')]);}})[_0x3140('0x15')](function(_0x2df24f){logger[_0x3140('0x11')](_0x3140('0x13'),_0x2693ae,_0x2df24f);_0x197ae2(_0x2df24f);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 78238ea..8f8069c 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x13743a,_0x4cb722){var _0x5b4f41=function(_0x48986d){while(--_0x48986d){_0x13743a['push'](_0x13743a['shift']());}};_0x5b4f41(++_0x4cb722);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0xcb91[_0x5cb97e];return _0x1714b4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xdf3a06,_0x42e85b){var _0x5a3f28=function(_0x37e885){while(--_0x37e885){_0xdf3a06['push'](_0xdf3a06['shift']());}};_0x5a3f28(++_0x42e85b);}(_0x70e0,0x17b));var _0x070e=function(_0x3d1d44,_0x720874){_0x3d1d44=_0x3d1d44-0x0;var _0x1fd4c9=_0x70e0[_0x3d1d44];return _0x1fd4c9;};'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 3140d04..64e3b90 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 _0x6ece=['exports','INTEGER','sequelize'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x6ece,0xbf));var _0xe6ec=function(_0x45391e,_0x45a9ea){_0x45391e=_0x45391e-0x0;var _0x54651d=_0x6ece[_0x45391e];return _0x54651d;};'use strict';var Sequelize=require(_0xe6ec('0x0'));module[_0xe6ec('0x1')]={'penalty':{'type':Sequelize[_0xe6ec('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9686=['exports','INTEGER','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9686,0xbc));var _0x6968=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9686[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x6968('0x0'));module[_0x6968('0x1')]={'penalty':{'type':Sequelize[_0x6968('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 51bb067..8155c1e 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 _0x1751=['../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2101c4,_0x4c1dde){var _0x47f823=function(_0x4e503e){while(--_0x4e503e){_0x2101c4['push'](_0x2101c4['shift']());}};_0x47f823(++_0x4c1dde);}(_0x1751,0x76));var _0x1175=function(_0x3019e8,_0x52896a){_0x3019e8=_0x3019e8-0x0;var _0x15a2f1=_0x1751[_0x3019e8];return _0x15a2f1;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc65=['UserSmsQueue','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0x55e836,_0x50b958){var _0x5d1a4b=function(_0x31f212){while(--_0x31f212){_0x55e836['push'](_0x55e836['shift']());}};_0x5d1a4b(++_0x50b958);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x49ebcc,_0xaa4119){_0x49ebcc=_0x49ebcc-0x0;var _0x4df085=_0xfc65[_0x49ebcc];return _0x4df085;};'use strict';var _=require(_0x5fc6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5fc6('0x1'));var moment=require(_0x5fc6('0x2'));var BPromise=require(_0x5fc6('0x3'));var rp=require(_0x5fc6('0x4'));var fs=require('fs');var path=require(_0x5fc6('0x5'));var rimraf=require(_0x5fc6('0x6'));var config=require(_0x5fc6('0x7'));var attributes=require(_0x5fc6('0x8'));module[_0x5fc6('0x9')]=function(_0x441b3e,_0x3100b4){return _0x441b3e[_0x5fc6('0xa')](_0x5fc6('0xb'),attributes,{'tableName':'user_has_sms_queues','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 c2cff42..0f6d189 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 _0x6c16=['http','request','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserSmsQueue,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x156e59,_0x38edbc){var _0x598763=function(_0x38940f){while(--_0x38940f){_0x156e59['push'](_0x156e59['shift']());}};_0x598763(++_0x38edbc);}(_0x6c16,0x113));var _0x66c1=function(_0x1c831a,_0x46b8a9){_0x1c831a=_0x1c831a-0x0;var _0x2401d4=_0x6c16[_0x1c831a];return _0x2401d4;};'use strict';var _=require(_0x66c1('0x0'));var util=require(_0x66c1('0x1'));var moment=require(_0x66c1('0x2'));var BPromise=require(_0x66c1('0x3'));var rs=require(_0x66c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66c1('0x5'))['db'];var utils=require(_0x66c1('0x6'));var logger=require(_0x66c1('0x7'))(_0x66c1('0x8'));var config=require('../../config/environment');var jayson=require(_0x66c1('0x9'));var client=jayson[_0x66c1('0xa')][_0x66c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fcc64,_0x23a3ef,_0x5b8850){return new BPromise(function(_0x55862b,_0x58f6ac){return client[_0x66c1('0xc')](_0x1fcc64,_0x5b8850)['then'](function(_0xf96016){logger[_0x66c1('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x23a3ef,_0x66c1('0xe'));logger[_0x66c1('0xf')](_0x66c1('0x10'),_0x23a3ef,'request\x20sent',JSON[_0x66c1('0x11')](_0xf96016));if(_0xf96016[_0x66c1('0x12')]){if(_0xf96016[_0x66c1('0x12')]['code']===0x1f4){logger[_0x66c1('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x23a3ef,_0xf96016[_0x66c1('0x12')][_0x66c1('0x13')]);return _0x58f6ac(_0xf96016['error']['message']);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x23a3ef,_0xf96016[_0x66c1('0x12')][_0x66c1('0x13')]);return _0x55862b(_0xf96016[_0x66c1('0x12')][_0x66c1('0x13')]);}else{logger[_0x66c1('0xd')](_0x66c1('0x14'),_0x23a3ef,_0x66c1('0xe'));_0x55862b(_0xf96016[_0x66c1('0x15')]['message']);}})['catch'](function(_0x13385d){logger['error'](_0x66c1('0x14'),_0x23a3ef,_0x13385d);_0x58f6ac(_0x13385d);});});} \ No newline at end of file +var _0xd6c9=['../../mysqldb','../../config/utils','../../config/environment','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','ioredis'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xd6c9,0xfc));var _0x9d6c=function(_0x4adfa4,_0x121c5a){_0x4adfa4=_0x4adfa4-0x0;var _0x14cec1=_0xd6c9[_0x4adfa4];return _0x14cec1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d6c('0x0'));var BPromise=require(_0x9d6c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d6c('0x2'));var db=require(_0x9d6c('0x3'))['db'];var utils=require(_0x9d6c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9d6c('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e05db,_0x2d89ae,_0x57a6fb){return new BPromise(function(_0x4090d8,_0x27e5df){return client[_0x9d6c('0x6')](_0x3e05db,_0x57a6fb)[_0x9d6c('0x7')](function(_0x3cb210){logger[_0x9d6c('0x8')](_0x9d6c('0x9'),_0x2d89ae,_0x9d6c('0xa'));logger[_0x9d6c('0xb')](_0x9d6c('0xc'),_0x2d89ae,_0x9d6c('0xa'),JSON['stringify'](_0x3cb210));if(_0x3cb210[_0x9d6c('0xd')]){if(_0x3cb210[_0x9d6c('0xd')][_0x9d6c('0xe')]===0x1f4){logger[_0x9d6c('0xd')](_0x9d6c('0x9'),_0x2d89ae,_0x3cb210['error'][_0x9d6c('0xf')]);return _0x27e5df(_0x3cb210[_0x9d6c('0xd')]['message']);}logger[_0x9d6c('0xd')](_0x9d6c('0x9'),_0x2d89ae,_0x3cb210['error'][_0x9d6c('0xf')]);return _0x4090d8(_0x3cb210['error'][_0x9d6c('0xf')]);}else{logger[_0x9d6c('0x8')]('UserSmsQueue,\x20%s,\x20%s',_0x2d89ae,'request\x20sent');_0x4090d8(_0x3cb210['result'][_0x9d6c('0xf')]);}})[_0x9d6c('0x10')](function(_0x1ffa1b){logger['error'](_0x9d6c('0x9'),_0x2d89ae,_0x1ffa1b);_0x27e5df(_0x1ffa1b);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index a04f469..c4afe85 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 _0x8cc2=['sequelize','exports','INTEGER'];(function(_0x55298d,_0x54f120){var _0x563e14=function(_0x25d210){while(--_0x25d210){_0x55298d['push'](_0x55298d['shift']());}};_0x563e14(++_0x54f120);}(_0x8cc2,0x162));var _0x28cc=function(_0x38dd9b,_0xa92a41){_0x38dd9b=_0x38dd9b-0x0;var _0x519fc6=_0x8cc2[_0x38dd9b];return _0x519fc6;};'use strict';var Sequelize=require(_0x28cc('0x0'));module[_0x28cc('0x1')]={'UserId':{'type':Sequelize[_0x28cc('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x28cc('0x2')]}}; \ No newline at end of file +var _0xe770=['INTEGER','exports'];(function(_0xa8b91a,_0x887c31){var _0x2242c4=function(_0x3255b3){while(--_0x3255b3){_0xa8b91a['push'](_0xa8b91a['shift']());}};_0x2242c4(++_0x887c31);}(_0xe770,0x1dd));var _0x0e77=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe770[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x0e77('0x0')]={'UserId':{'type':Sequelize[_0x0e77('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 4f8391a..63a0845 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(_0x4e5fe1,_0x431974){var _0x3ca1a5=function(_0x2175f2){while(--_0x2175f2){_0x4e5fe1['push'](_0x4e5fe1['shift']());}};_0x3ca1a5(++_0x431974);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x5aaf21,_0x3398d5){var _0x33ef95=function(_0x210763){while(--_0x210763){_0x5aaf21['push'](_0x5aaf21['shift']());}};_0x33ef95(++_0x3398d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 ad6991d..b3d4c4b 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xcff549,_0x48e621){var _0x364e21=function(_0x3310ef){while(--_0x3310ef){_0xcff549['push'](_0xcff549['shift']());}};_0x364e21(++_0x48e621);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0xcb91[_0x30cd7e];return _0x462a02;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4d5e00,_0x4d3c5d){var _0x3fe9b2=function(_0x4f7f85){while(--_0x4f7f85){_0x4d5e00['push'](_0x4d5e00['shift']());}};_0x3fe9b2(++_0x4d3c5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index f76b9d6..a667cbd 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 _0x172d=['exports','sequelize'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0x172d,0x115));var _0xd172=function(_0x47d4fc,_0x51d987){_0x47d4fc=_0x47d4fc-0x0;var _0x3f3027=_0x172d[_0x47d4fc];return _0x3f3027;};'use strict';var Sequelize=require(_0xd172('0x0'));module[_0xd172('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x226a=['sequelize','exports','INTEGER'];(function(_0x435f9c,_0x1bcc2c){var _0x4896f8=function(_0x9ab37a){while(--_0x9ab37a){_0x435f9c['push'](_0x435f9c['shift']());}};_0x4896f8(++_0x1bcc2c);}(_0x226a,0x177));var _0xa226=function(_0x2dbcef,_0x1cfecb){_0x2dbcef=_0x2dbcef-0x0;var _0x5a90ea=_0x226a[_0x2dbcef];return _0x5a90ea;};'use strict';var Sequelize=require(_0xa226('0x0'));module[_0xa226('0x1')]={'penalty':{'type':Sequelize[_0xa226('0x2')],'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 b4bc2e4..8a31e83 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 _0x8bdf=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues'];(function(_0x5d455c,_0x44ab35){var _0x36f86b=function(_0x2d1e6d){while(--_0x2d1e6d){_0x5d455c['push'](_0x5d455c['shift']());}};_0x36f86b(++_0x44ab35);}(_0x8bdf,0x160));var _0xf8bd=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x8bdf[_0x5b561d];return _0x431060;};'use strict';var _=require('lodash');var util=require(_0xf8bd('0x0'));var logger=require(_0xf8bd('0x1'))(_0xf8bd('0x2'));var moment=require(_0xf8bd('0x3'));var BPromise=require(_0xf8bd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8bd('0x5'));var rimraf=require('rimraf');var config=require(_0xf8bd('0x6'));var attributes=require(_0xf8bd('0x7'));module[_0xf8bd('0x8')]=function(_0x27bcb7,_0x113427){return _0x27bcb7['define'](_0xf8bd('0x9'),attributes,{'tableName':_0xf8bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb20f=['rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x22f1f9,_0x8661aa){var _0x444a44=function(_0x38d3b9){while(--_0x38d3b9){_0x22f1f9['push'](_0x22f1f9['shift']());}};_0x444a44(++_0x8661aa);}(_0xb20f,0x7d));var _0xfb20=function(_0x543981,_0x1c047c){_0x543981=_0x543981-0x0;var _0x448129=_0xb20f[_0x543981];return _0x448129;};'use strict';var _=require(_0xfb20('0x0'));var util=require(_0xfb20('0x1'));var logger=require('../../config/logger')(_0xfb20('0x2'));var moment=require(_0xfb20('0x3'));var BPromise=require(_0xfb20('0x4'));var rp=require(_0xfb20('0x5'));var fs=require('fs');var path=require(_0xfb20('0x6'));var rimraf=require(_0xfb20('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb20('0x8'));module['exports']=function(_0x5635a2,_0x3fed77){return _0x5635a2[_0xfb20('0x9')](_0xfb20('0xa'),attributes,{'tableName':_0xfb20('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 4f5dac8..55627f4 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 _0x0ba7=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x1622a0,_0x2b55a9){var _0x2a2308=function(_0x38d05b){while(--_0x38d05b){_0x1622a0['push'](_0x1622a0['shift']());}};_0x2a2308(++_0x2b55a9);}(_0x0ba7,0x10c));var _0x70ba=function(_0xda6db7,_0x4bcc50){_0xda6db7=_0xda6db7-0x0;var _0x35294a=_0x0ba7[_0xda6db7];return _0x35294a;};'use strict';var _=require(_0x70ba('0x0'));var util=require(_0x70ba('0x1'));var moment=require('moment');var BPromise=require(_0x70ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70ba('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x70ba('0x4'));var logger=require(_0x70ba('0x5'))(_0x70ba('0x6'));var config=require(_0x70ba('0x7'));var jayson=require(_0x70ba('0x8'));var client=jayson[_0x70ba('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10ac9b,_0x146436,_0x16e3c9){return new BPromise(function(_0x15a134,_0x5c5a04){return client['request'](_0x10ac9b,_0x16e3c9)['then'](function(_0xff4696){logger[_0x70ba('0xa')](_0x70ba('0xb'),_0x146436,_0x70ba('0xc'));logger[_0x70ba('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x146436,_0x70ba('0xc'),JSON[_0x70ba('0xe')](_0xff4696));if(_0xff4696[_0x70ba('0xf')]){if(_0xff4696[_0x70ba('0xf')][_0x70ba('0x10')]===0x1f4){logger[_0x70ba('0xf')](_0x70ba('0xb'),_0x146436,_0xff4696[_0x70ba('0xf')]['message']);return _0x5c5a04(_0xff4696[_0x70ba('0xf')][_0x70ba('0x11')]);}logger[_0x70ba('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x146436,_0xff4696[_0x70ba('0xf')][_0x70ba('0x11')]);return _0x15a134(_0xff4696[_0x70ba('0xf')][_0x70ba('0x11')]);}else{logger[_0x70ba('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x146436,'request\x20sent');_0x15a134(_0xff4696[_0x70ba('0x12')][_0x70ba('0x11')]);}})[_0x70ba('0x13')](function(_0x29dbdc){logger[_0x70ba('0xf')](_0x70ba('0xb'),_0x146436,_0x29dbdc);_0x5c5a04(_0x29dbdc);});});} \ No newline at end of file +var _0x0413=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring'];(function(_0x5b8899,_0x291160){var _0x4f1e13=function(_0x41af50){while(--_0x41af50){_0x5b8899['push'](_0x5b8899['shift']());}};_0x4f1e13(++_0x291160);}(_0x0413,0x11a));var _0x3041=function(_0x14ff51,_0x14491b){_0x14ff51=_0x14ff51-0x0;var _0x4e0122=_0x0413[_0x14ff51];return _0x4e0122;};'use strict';var _=require(_0x3041('0x0'));var util=require(_0x3041('0x1'));var moment=require('moment');var BPromise=require(_0x3041('0x2'));var rs=require(_0x3041('0x3'));var fs=require('fs');var Redis=require(_0x3041('0x4'));var db=require(_0x3041('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3041('0x6'))(_0x3041('0x7'));var config=require('../../config/environment');var jayson=require(_0x3041('0x8'));var client=jayson[_0x3041('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44be9e,_0x248eb9,_0x3a520b){return new BPromise(function(_0x1b2ad9,_0x1417f7){return client[_0x3041('0xa')](_0x44be9e,_0x3a520b)[_0x3041('0xb')](function(_0x35077c){logger[_0x3041('0xc')](_0x3041('0xd'),_0x248eb9,'request\x20sent');logger[_0x3041('0xe')](_0x3041('0xf'),_0x248eb9,'request\x20sent',JSON[_0x3041('0x10')](_0x35077c));if(_0x35077c[_0x3041('0x11')]){if(_0x35077c[_0x3041('0x11')]['code']===0x1f4){logger[_0x3041('0x11')](_0x3041('0xd'),_0x248eb9,_0x35077c[_0x3041('0x11')][_0x3041('0x12')]);return _0x1417f7(_0x35077c['error'][_0x3041('0x12')]);}logger[_0x3041('0x11')](_0x3041('0xd'),_0x248eb9,_0x35077c[_0x3041('0x11')][_0x3041('0x12')]);return _0x1b2ad9(_0x35077c[_0x3041('0x11')]['message']);}else{logger['info'](_0x3041('0xd'),_0x248eb9,_0x3041('0x13'));_0x1b2ad9(_0x35077c[_0x3041('0x14')][_0x3041('0x12')]);}})[_0x3041('0x15')](function(_0x272996){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x248eb9,_0x272996);_0x1417f7(_0x272996);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 79e0c67..ec56743 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x27704f,_0x586281){var _0xabbda8=function(_0x4024d3){while(--_0x4024d3){_0x27704f['push'](_0x27704f['shift']());}};_0xabbda8(++_0x586281);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x415429,_0x1e15b8){var _0x5f3cc5=function(_0x18e389){while(--_0x18e389){_0x415429['push'](_0x415429['shift']());}};_0x5f3cc5(++_0x1e15b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('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 6111e63..7a9ba00 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 _0x8085=['STRING','INTEGER','queue_interface','sequelize','Required\x20by\x20Asterisk'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x8085,0x71));var _0x5808=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x8085[_0xbf8ebe];return _0x1e25e8;};'use strict';var Sequelize=require(_0x5808('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x5808('0x1')},'membername':{'type':Sequelize[_0x5808('0x2')],'allowNull':![],'comment':_0x5808('0x1')},'UserId':{'type':Sequelize[_0x5808('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x5808('0x1')},'VoiceQueueId':{'type':Sequelize[_0x5808('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5808('0x4'),'comment':_0x5808('0x1')},'penalty':{'type':Sequelize[_0x5808('0x3')](0xb),'defaultValue':0x0,'comment':_0x5808('0x1')},'paused':{'type':Sequelize[_0x5808('0x3')](0xb),'defaultValue':0x0,'comment':_0x5808('0x1')}}; \ No newline at end of file +var _0x9270=['queue_interface','INTEGER','sequelize','Required\x20by\x20Asterisk','STRING'];(function(_0x49dd11,_0xfb0a87){var _0x5b6b02=function(_0x272a24){while(--_0x272a24){_0x49dd11['push'](_0x49dd11['shift']());}};_0x5b6b02(++_0xfb0a87);}(_0x9270,0x1d8));var _0x0927=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x9270[_0x5ecadc];return _0x565037;};'use strict';var Sequelize=require(_0x0927('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0927('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0927('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0927('0x2')],'allowNull':![],'unique':_0x0927('0x3'),'comment':_0x0927('0x1')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x0927('0x2')],'allowNull':![],'unique':_0x0927('0x3'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x0927('0x4')](0xb),'defaultValue':0x0,'comment':_0x0927('0x1')},'paused':{'type':Sequelize[_0x0927('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 23cb9d8..4568bb2 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 _0xf638=['exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x375d03,_0x231f8c){var _0x12bc93=function(_0x324188){while(--_0x324188){_0x375d03['push'](_0x375d03['shift']());}};_0x12bc93(++_0x231f8c);}(_0xf638,0x1b1));var _0x8f63=function(_0x1302db,_0x4a84c){_0x1302db=_0x1302db-0x0;var _0x2d2b16=_0xf638[_0x1302db];return _0x2d2b16;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x8f63('0x0'))['db'][_0x8f63('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8f63('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f63('0x3'),'afterDestroy':_0x8f63('0x4')};function emitEvent(_0x4bfe5b){return function(_0x3e73ae,_0x2d2f95,_0x532fea){UserVoiceQueueRtEvents[_0x8f63('0x5')](_0x4bfe5b+':'+_0x3e73ae['id'],_0x3e73ae);UserVoiceQueueRtEvents[_0x8f63('0x5')](_0x4bfe5b,_0x3e73ae);_0x532fea(null);};}for(var e in events){if(events[_0x8f63('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x8f63('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xdf38=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x505e6b,_0x1defed){var _0x493cb3=function(_0x2cb96c){while(--_0x2cb96c){_0x505e6b['push'](_0x505e6b['shift']());}};_0x493cb3(++_0x1defed);}(_0xdf38,0x1c2));var _0x8df3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xdf38[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x8df3('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8df3('0x1')](0x0);var events={'afterCreate':_0x8df3('0x2'),'afterUpdate':_0x8df3('0x3'),'afterDestroy':_0x8df3('0x4')};function emitEvent(_0x31d72a){return function(_0x589133,_0x5f0a8d,_0xca92e3){UserVoiceQueueRtEvents['emit'](_0x31d72a+':'+_0x589133['id'],_0x589133);UserVoiceQueueRtEvents[_0x8df3('0x5')](_0x31d72a,_0x589133);_0xca92e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x8df3('0x6')](e,emitEvent(event));}}module[_0x8df3('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 72da967..fb149ea 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 _0xa39e=['../../config/logger','api','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x47a95a,_0x564d06){var _0x348e90=function(_0x146c10){while(--_0x146c10){_0x47a95a['push'](_0x47a95a['shift']());}};_0x348e90(++_0x564d06);}(_0xa39e,0x196));var _0xea39=function(_0x1c6551,_0x3fbc2e){_0x1c6551=_0x1c6551-0x0;var _0x3f7434=_0xa39e[_0x1c6551];return _0x3f7434;};'use strict';var _=require(_0xea39('0x0'));var util=require('util');var logger=require(_0xea39('0x1'))(_0xea39('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xea39('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea39('0x4'));var config=require(_0xea39('0x5'));var attributes=require(_0xea39('0x6'));module[_0xea39('0x7')]=function(_0x43c85a,_0x27457a){return _0x43c85a[_0xea39('0x8')](_0xea39('0x9'),attributes,{'tableName':_0xea39('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ccf=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment'];(function(_0x15d085,_0x49986f){var _0x1e89e4=function(_0x252b9f){while(--_0x252b9f){_0x15d085['push'](_0x15d085['shift']());}};_0x1e89e4(++_0x49986f);}(_0x4ccf,0xd8));var _0xf4cc=function(_0x4f7105,_0x40640c){_0x4f7105=_0x4f7105-0x0;var _0x5ed1f0=_0x4ccf[_0x4f7105];return _0x5ed1f0;};'use strict';var _=require(_0xf4cc('0x0'));var util=require(_0xf4cc('0x1'));var logger=require(_0xf4cc('0x2'))('api');var moment=require(_0xf4cc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf4cc('0x4'));var config=require(_0xf4cc('0x5'));var attributes=require(_0xf4cc('0x6'));module[_0xf4cc('0x7')]=function(_0x4a8885,_0x556546){return _0x4a8885[_0xf4cc('0x8')](_0xf4cc('0x9'),attributes,{'tableName':_0xf4cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index cecd1d4..dd367fd 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 _0xbb72=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceQueueRtPauses','findAll','options','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb72,0x16f));var _0x2bb7=function(_0x4b0e44,_0x15f013){_0x4b0e44=_0x4b0e44-0x0;var _0x145d60=_0xbb72[_0x4b0e44];return _0x145d60;};'use strict';var _=require(_0x2bb7('0x0'));var util=require('util');var moment=require(_0x2bb7('0x1'));var BPromise=require(_0x2bb7('0x2'));var rs=require(_0x2bb7('0x3'));var fs=require('fs');var Redis=require(_0x2bb7('0x4'));var db=require(_0x2bb7('0x5'))['db'];var utils=require(_0x2bb7('0x6'));var logger=require(_0x2bb7('0x7'))(_0x2bb7('0x8'));var config=require(_0x2bb7('0x9'));var jayson=require(_0x2bb7('0xa'));var client=jayson['client'][_0x2bb7('0xb')]({'port':0x232a});config[_0x2bb7('0xc')]=_[_0x2bb7('0xd')](config[_0x2bb7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2bb7('0xe'))(new Redis(config[_0x2bb7('0xc')]));require(_0x2bb7('0xf'))[_0x2bb7('0x10')](socket);function respondWithRpcPromise(_0x1d05d5,_0x80c504,_0x2904bb){return new BPromise(function(_0x233690,_0x46e997){return client[_0x2bb7('0x11')](_0x1d05d5,_0x2904bb)[_0x2bb7('0x12')](function(_0x25c7b8){logger[_0x2bb7('0x13')](_0x2bb7('0x14'),_0x80c504,'request\x20sent');logger[_0x2bb7('0x15')](_0x2bb7('0x16'),_0x80c504,_0x2bb7('0x17'),JSON[_0x2bb7('0x18')](_0x25c7b8));if(_0x25c7b8['error']){if(_0x25c7b8[_0x2bb7('0x19')][_0x2bb7('0x1a')]===0x1f4){logger['error'](_0x2bb7('0x14'),_0x80c504,_0x25c7b8[_0x2bb7('0x19')][_0x2bb7('0x1b')]);return _0x46e997(_0x25c7b8[_0x2bb7('0x19')][_0x2bb7('0x1b')]);}logger[_0x2bb7('0x19')](_0x2bb7('0x14'),_0x80c504,_0x25c7b8[_0x2bb7('0x19')]['message']);return _0x233690(_0x25c7b8[_0x2bb7('0x19')][_0x2bb7('0x1b')]);}else{logger[_0x2bb7('0x13')](_0x2bb7('0x14'),_0x80c504,_0x2bb7('0x17'));_0x233690(_0x25c7b8[_0x2bb7('0x1c')][_0x2bb7('0x1b')]);}})['catch'](function(_0x1f530e){logger['error'](_0x2bb7('0x14'),_0x80c504,_0x1f530e);_0x46e997(_0x1f530e);});});}exports[_0x2bb7('0x1d')]=function(_0x161cf6){var _0x8d5c34=this;return new Promise(function(_0x38f705,_0xc1d939){return db['UserVoiceQueueRt'][_0x2bb7('0x1e')]({'raw':_0x161cf6[_0x2bb7('0x1f')]?_0x161cf6[_0x2bb7('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x161cf6[_0x2bb7('0x1f')]?_0x161cf6[_0x2bb7('0x1f')][_0x2bb7('0x20')]||null:null,'attributes':[[db[_0x2bb7('0x21')]['fn'](_0x2bb7('0x22'),db[_0x2bb7('0x21')]['fn']('IF',db[_0x2bb7('0x21')]['literal'](_0x2bb7('0x23')))),_0x2bb7('0x24')]]})[_0x2bb7('0x12')](function(_0x549f22){logger['info'](_0x2bb7('0x1d'),_0x161cf6);logger[_0x2bb7('0x15')](_0x2bb7('0x1d'),_0x161cf6,JSON['stringify'](_0x549f22));_0x38f705(_0x549f22);})['catch'](function(_0x39975b){logger[_0x2bb7('0x19')](_0x2bb7('0x1d'),_0x39975b[_0x2bb7('0x1b')],_0x161cf6);_0xc1d939(_0x8d5c34[_0x2bb7('0x19')](0x1f4,_0x39975b[_0x2bb7('0x1b')]));});});}; \ No newline at end of file +var _0x7328=['raw','options','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt'];(function(_0x2d3755,_0x49abfd){var _0x44a935=function(_0x10e902){while(--_0x10e902){_0x2d3755['push'](_0x2d3755['shift']());}};_0x44a935(++_0x49abfd);}(_0x7328,0xd6));var _0x8732=function(_0x977c4f,_0x22e694){_0x977c4f=_0x977c4f-0x0;var _0x58eb63=_0x7328[_0x977c4f];return _0x58eb63;};'use strict';var _=require(_0x8732('0x0'));var util=require(_0x8732('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8732('0x2'));var fs=require('fs');var Redis=require(_0x8732('0x3'));var db=require(_0x8732('0x4'))['db'];var utils=require(_0x8732('0x5'));var logger=require(_0x8732('0x6'))(_0x8732('0x7'));var config=require(_0x8732('0x8'));var jayson=require(_0x8732('0x9'));var client=jayson[_0x8732('0xa')][_0x8732('0xb')]({'port':0x232a});config[_0x8732('0xc')]=_[_0x8732('0xd')](config[_0x8732('0xc')],{'host':_0x8732('0xe'),'port':0x18eb});var socket=require(_0x8732('0xf'))(new Redis(config[_0x8732('0xc')]));require(_0x8732('0x10'))[_0x8732('0x11')](socket);function respondWithRpcPromise(_0x55d24d,_0x325330,_0x2731aa){return new BPromise(function(_0xc8df0a,_0x349525){return client[_0x8732('0x12')](_0x55d24d,_0x2731aa)['then'](function(_0x35b555){logger[_0x8732('0x13')](_0x8732('0x14'),_0x325330,_0x8732('0x15'));logger[_0x8732('0x16')](_0x8732('0x17'),_0x325330,'request\x20sent',JSON[_0x8732('0x18')](_0x35b555));if(_0x35b555[_0x8732('0x19')]){if(_0x35b555[_0x8732('0x19')][_0x8732('0x1a')]===0x1f4){logger[_0x8732('0x19')](_0x8732('0x14'),_0x325330,_0x35b555[_0x8732('0x19')][_0x8732('0x1b')]);return _0x349525(_0x35b555[_0x8732('0x19')][_0x8732('0x1b')]);}logger['error'](_0x8732('0x14'),_0x325330,_0x35b555[_0x8732('0x19')][_0x8732('0x1b')]);return _0xc8df0a(_0x35b555[_0x8732('0x19')]['message']);}else{logger['info'](_0x8732('0x14'),_0x325330,_0x8732('0x15'));_0xc8df0a(_0x35b555[_0x8732('0x1c')][_0x8732('0x1b')]);}})[_0x8732('0x1d')](function(_0x24caf4){logger['error'](_0x8732('0x14'),_0x325330,_0x24caf4);_0x349525(_0x24caf4);});});}exports[_0x8732('0x1e')]=function(_0x28325f){var _0x2fea26=this;return new Promise(function(_0x4e12a5,_0x5038ad){return db[_0x8732('0x1f')]['findAll']({'raw':_0x28325f['options']?_0x28325f['options'][_0x8732('0x20')]===undefined?!![]:![]:!![],'where':_0x28325f[_0x8732('0x21')]?_0x28325f[_0x8732('0x21')][_0x8732('0x22')]||null:null,'attributes':[[db['sequelize']['fn'](_0x8732('0x23'),db['sequelize']['fn']('IF',db[_0x8732('0x24')][_0x8732('0x25')](_0x8732('0x26')))),_0x8732('0x27')]]})[_0x8732('0x28')](function(_0x10a0b5){logger[_0x8732('0x13')](_0x8732('0x1e'),_0x28325f);logger['debug'](_0x8732('0x1e'),_0x28325f,JSON[_0x8732('0x18')](_0x10a0b5));_0x4e12a5(_0x10a0b5);})[_0x8732('0x1d')](function(_0x357fda){logger[_0x8732('0x19')](_0x8732('0x1e'),_0x357fda[_0x8732('0x1b')],_0x28325f);_0x5038ad(_0x2fea26[_0x8732('0x19')](0x1f4,_0x357fda[_0x8732('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index ae88691..d8dc6da 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 _0x1c9a=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x44f014,_0x3139c6){_0x44f014=_0x44f014-0x0;var _0x2c8f50=_0x1c9a[_0x44f014];return _0x2c8f50;};'use strict';var UserVoiceQueueRtEvents=require(_0xa1c9('0x0'));var events=[_0xa1c9('0x1'),'remove',_0xa1c9('0x2')];function createListener(_0x867bbb,_0x38c48f){return function(_0x408418){_0x38c48f[_0xa1c9('0x3')](_0x867bbb,_0x408418);};}function removeListener(_0x4a0d3d,_0x2f883c){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4a0d3d,_0x2f883c);};}exports[_0xa1c9('0x4')]=function(_0xdd22bf){for(var _0x237862=0x0,_0x2b0c89=events[_0xa1c9('0x5')];_0x237862<_0x2b0c89;_0x237862++){var _0x46b19a=events[_0x237862];var _0x3b1a2c=createListener(_0xa1c9('0x6')+_0x46b19a,_0xdd22bf);UserVoiceQueueRtEvents['on'](_0x46b19a,_0x3b1a2c);}}; \ No newline at end of file +var _0x22da=['length','userVoiceQueueRt:','remove','update','emit','removeListener'];(function(_0x34f31b,_0x41be74){var _0x3e9679=function(_0x1331e8){while(--_0x1331e8){_0x34f31b['push'](_0x34f31b['shift']());}};_0x3e9679(++_0x41be74);}(_0x22da,0x80));var _0xa22d=function(_0xed16f3,_0x4514d7){_0xed16f3=_0xed16f3-0x0;var _0x12c069=_0x22da[_0xed16f3];return _0x12c069;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0xa22d('0x0'),_0xa22d('0x1')];function createListener(_0x3d295f,_0x38c995){return function(_0x5a6dc9){_0x38c995[_0xa22d('0x2')](_0x3d295f,_0x5a6dc9);};}function removeListener(_0x34da8c,_0x3e2232){return function(){UserVoiceQueueRtEvents[_0xa22d('0x3')](_0x34da8c,_0x3e2232);};}exports['register']=function(_0x4007bd){for(var _0x9bc0eb=0x0,_0x4c67ad=events[_0xa22d('0x4')];_0x9bc0eb<_0x4c67ad;_0x9bc0eb++){var _0x44a5c7=events[_0x9bc0eb];var _0x5678bc=createListener(_0xa22d('0x5')+_0x44a5c7,_0x4007bd);UserVoiceQueueRtEvents['on'](_0x44a5c7,_0x5678bc);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 0cf148c..f0eb75c 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(_0x4d3d50,_0x50f156){var _0x175e6d=function(_0x41fc26){while(--_0x41fc26){_0x4d3d50['push'](_0x4d3d50['shift']());}};_0x175e6d(++_0x50f156);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1cd23d,_0xec4ea5){var _0x5e8ad5=function(_0x1603d8){while(--_0x1603d8){_0x1cd23d['push'](_0x1cd23d['shift']());}};_0x5e8ad5(++_0xec4ea5);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 1a1b1ff..6427d7a 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 _0x5f1f=['sequelize','exports'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x5f1f,0x1a0));var _0xf5f1=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x5f1f[_0x5ad771];return _0x5b5dce;};'use strict';var Sequelize=require(_0xf5f1('0x0'));module[_0xf5f1('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9ac8=['INTEGER','sequelize','exports'];(function(_0x4b4a64,_0x212f0f){var _0x3580e3=function(_0x30454c){while(--_0x30454c){_0x4b4a64['push'](_0x4b4a64['shift']());}};_0x3580e3(++_0x212f0f);}(_0x9ac8,0x184));var _0x89ac=function(_0x2b9641,_0x289d0a){_0x2b9641=_0x2b9641-0x0;var _0x15817e=_0x9ac8[_0x2b9641];return _0x15817e;};'use strict';var Sequelize=require(_0x89ac('0x0'));module[_0x89ac('0x1')]={'penalty':{'type':Sequelize[_0x89ac('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index de9273e..da63232 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 _0x8aa9=['rimraf','./userWhatsappQueue.attributes','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8aa9,0xa8));var _0x98aa=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8aa9[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x98aa('0x0'));var util=require(_0x98aa('0x1'));var logger=require(_0x98aa('0x2'))(_0x98aa('0x3'));var moment=require(_0x98aa('0x4'));var BPromise=require(_0x98aa('0x5'));var rp=require(_0x98aa('0x6'));var fs=require('fs');var path=require(_0x98aa('0x7'));var rimraf=require(_0x98aa('0x8'));var config=require('../../config/environment');var attributes=require(_0x98aa('0x9'));module['exports']=function(_0x250be0,_0x2fa47f){return _0x250be0['define']('UserWhatsappQueue',attributes,{'tableName':_0x98aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3362=['../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','../../config/logger','api','moment','request-promise','path'];(function(_0x44f900,_0x1e7aa2){var _0x512f92=function(_0x126b9b){while(--_0x126b9b){_0x44f900['push'](_0x44f900['shift']());}};_0x512f92(++_0x1e7aa2);}(_0x3362,0x13b));var _0x2336=function(_0x3ea953,_0x36ed10){_0x3ea953=_0x3ea953-0x0;var _0xa32c2f=_0x3362[_0x3ea953];return _0xa32c2f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2336('0x0'))(_0x2336('0x1'));var moment=require(_0x2336('0x2'));var BPromise=require('bluebird');var rp=require(_0x2336('0x3'));var fs=require('fs');var path=require(_0x2336('0x4'));var rimraf=require('rimraf');var config=require(_0x2336('0x5'));var attributes=require(_0x2336('0x6'));module[_0x2336('0x7')]=function(_0x1c779b,_0x4cdb90){return _0x1c779b['define'](_0x2336('0x8'),attributes,{'tableName':_0x2336('0x9'),'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 2bafe36..5462fb0 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 _0xed32=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xbb9646,_0x3723e4){var _0xf8ea9b=function(_0x45e095){while(--_0x45e095){_0xbb9646['push'](_0xbb9646['shift']());}};_0xf8ea9b(++_0x3723e4);}(_0xed32,0x18a));var _0x2ed3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xed32[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2ed3('0x0'));var BPromise=require(_0x2ed3('0x1'));var rs=require(_0x2ed3('0x2'));var fs=require('fs');var Redis=require(_0x2ed3('0x3'));var db=require(_0x2ed3('0x4'))['db'];var utils=require(_0x2ed3('0x5'));var logger=require(_0x2ed3('0x6'))(_0x2ed3('0x7'));var config=require(_0x2ed3('0x8'));var jayson=require(_0x2ed3('0x9'));var client=jayson['client'][_0x2ed3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ce10e,_0xd72972,_0x318ee3){return new BPromise(function(_0x455715,_0x552318){return client['request'](_0x2ce10e,_0x318ee3)[_0x2ed3('0xb')](function(_0x1d2bcd){logger[_0x2ed3('0xc')](_0x2ed3('0xd'),_0xd72972,_0x2ed3('0xe'));logger[_0x2ed3('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0xd72972,_0x2ed3('0xe'),JSON[_0x2ed3('0x10')](_0x1d2bcd));if(_0x1d2bcd[_0x2ed3('0x11')]){if(_0x1d2bcd[_0x2ed3('0x11')]['code']===0x1f4){logger['error'](_0x2ed3('0xd'),_0xd72972,_0x1d2bcd['error']['message']);return _0x552318(_0x1d2bcd[_0x2ed3('0x11')]['message']);}logger[_0x2ed3('0x11')](_0x2ed3('0xd'),_0xd72972,_0x1d2bcd[_0x2ed3('0x11')][_0x2ed3('0x12')]);return _0x455715(_0x1d2bcd[_0x2ed3('0x11')][_0x2ed3('0x12')]);}else{logger[_0x2ed3('0xc')](_0x2ed3('0xd'),_0xd72972,_0x2ed3('0xe'));_0x455715(_0x1d2bcd[_0x2ed3('0x13')][_0x2ed3('0x12')]);}})['catch'](function(_0x1434f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0xd72972,_0x1434f4);_0x552318(_0x1434f4);});});} \ No newline at end of file +var _0xb3ef=['UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb3ef,0x1ea));var _0xfb3e=function(_0x153246,_0x4167af){_0x153246=_0x153246-0x0;var _0x4a20ee=_0xb3ef[_0x153246];return _0x4a20ee;};'use strict';var _=require('lodash');var util=require(_0xfb3e('0x0'));var moment=require(_0xfb3e('0x1'));var BPromise=require(_0xfb3e('0x2'));var rs=require(_0xfb3e('0x3'));var fs=require('fs');var Redis=require(_0xfb3e('0x4'));var db=require(_0xfb3e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb3e('0x6'))(_0xfb3e('0x7'));var config=require(_0xfb3e('0x8'));var jayson=require(_0xfb3e('0x9'));var client=jayson[_0xfb3e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2961d1,_0x99b51a,_0x454531){return new BPromise(function(_0x126767,_0x547530){return client[_0xfb3e('0xb')](_0x2961d1,_0x454531)[_0xfb3e('0xc')](function(_0x4a62aa){logger[_0xfb3e('0xd')](_0xfb3e('0xe'),_0x99b51a,'request\x20sent');logger[_0xfb3e('0xf')](_0xfb3e('0x10'),_0x99b51a,_0xfb3e('0x11'),JSON[_0xfb3e('0x12')](_0x4a62aa));if(_0x4a62aa[_0xfb3e('0x13')]){if(_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x14')]===0x1f4){logger[_0xfb3e('0x13')](_0xfb3e('0xe'),_0x99b51a,_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x15')]);return _0x547530(_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x15')]);}logger[_0xfb3e('0x13')](_0xfb3e('0xe'),_0x99b51a,_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x15')]);return _0x126767(_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x15')]);}else{logger['info'](_0xfb3e('0xe'),_0x99b51a,'request\x20sent');_0x126767(_0x4a62aa[_0xfb3e('0x16')][_0xfb3e('0x15')]);}})[_0xfb3e('0x17')](function(_0x2dd0c6){logger[_0xfb3e('0x13')](_0xfb3e('0xe'),_0x99b51a,_0x2dd0c6);_0x547530(_0x2dd0c6);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 0b238ab..9d994bd 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 _0x4986=['delete','destroy','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x1f448a,_0x477d9d){var _0x24c6ac=function(_0x114123){while(--_0x114123){_0x1f448a['push'](_0x1f448a['shift']());}};_0x24c6ac(++_0x477d9d);}(_0x4986,0x6e));var _0x6498=function(_0x334c85,_0x484ab7){_0x334c85=_0x334c85-0x0;var _0x1fed9d=_0x4986[_0x334c85];return _0x1fed9d;};'use strict';var multer=require(_0x6498('0x0'));var util=require(_0x6498('0x1'));var path=require(_0x6498('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6498('0x3')]();var fs_extra=require(_0x6498('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6498('0x5'));var config=require(_0x6498('0x6'));var controller=require(_0x6498('0x7'));router[_0x6498('0x8')]('/',auth[_0x6498('0x9')](),controller[_0x6498('0xa')]);router[_0x6498('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6498('0xb')]);router[_0x6498('0xc')]('/',auth[_0x6498('0x9')](),controller[_0x6498('0xd')]);router[_0x6498('0xe')]('/:id',auth[_0x6498('0x9')](),controller[_0x6498('0xf')]);router[_0x6498('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6498('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf50b=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','post','create','update','delete'];(function(_0x2e6bba,_0x739666){var _0x7d93ff=function(_0x51002d){while(--_0x51002d){_0x2e6bba['push'](_0x2e6bba['shift']());}};_0x7d93ff(++_0x739666);}(_0xf50b,0xc8));var _0xbf50=function(_0x568a32,_0x17c98a){_0x568a32=_0x568a32-0x0;var _0x2a8e4f=_0xf50b[_0x568a32];return _0x2a8e4f;};'use strict';var multer=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var path=require('path');var timeout=require(_0xbf50('0x2'));var express=require(_0xbf50('0x3'));var router=express[_0xbf50('0x4')]();var fs_extra=require(_0xbf50('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf50('0x6'));var config=require('../../config/environment');var controller=require(_0xbf50('0x7'));router[_0xbf50('0x8')]('/',auth[_0xbf50('0x9')](),controller[_0xbf50('0xa')]);router[_0xbf50('0x8')](_0xbf50('0xb'),auth[_0xbf50('0x9')](),controller['show']);router[_0xbf50('0xc')]('/',auth[_0xbf50('0x9')](),controller[_0xbf50('0xd')]);router['put']('/:id',auth[_0xbf50('0x9')](),controller[_0xbf50('0xe')]);router[_0xbf50('0xf')]('/:id',auth[_0xbf50('0x9')](),controller[_0xbf50('0x10')]);module[_0xbf50('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index f458b8c..6cc360b 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 _0xb90d=['exports','STRING','name'];(function(_0xa22817,_0x22ee6b){var _0x28fd9f=function(_0xc74d3e){while(--_0xc74d3e){_0xa22817['push'](_0xa22817['shift']());}};_0x28fd9f(++_0x22ee6b);}(_0xb90d,0x17a));var _0xdb90=function(_0x312634,_0x165c8e){_0x312634=_0x312634-0x0;var _0x34a887=_0xb90d[_0x312634];return _0x34a887;};'use strict';var Sequelize=require('sequelize');module[_0xdb90('0x0')]={'name':{'type':Sequelize[_0xdb90('0x1')],'unique':_0xdb90('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdb90('0x1')]}}; \ No newline at end of file +var _0x0dec=['sequelize','exports','STRING','name'];(function(_0x5df18c,_0x1958a4){var _0x286d6e=function(_0x858d00){while(--_0x858d00){_0x5df18c['push'](_0x5df18c['shift']());}};_0x286d6e(++_0x1958a4);}(_0x0dec,0x11c));var _0xc0de=function(_0x236d97,_0xd27b85){_0x236d97=_0x236d97-0x0;var _0x8314cc=_0x0dec[_0x236d97];return _0x8314cc;};'use strict';var Sequelize=require(_0xc0de('0x0'));module[_0xc0de('0x1')]={'name':{'type':Sequelize[_0xc0de('0x2')],'unique':_0xc0de('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 0fe0cf4..596b128 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 _0x16fd=['VIRTUAL','name','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','send','index','map','Variable','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','model','order','sort','pick','where','merge'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x16fd,0x1a9));var _0xd16f=function(_0x14f458,_0x5dd219){_0x14f458=_0x14f458-0x0;var _0x4ff2da=_0x16fd[_0x14f458];return _0x4ff2da;};'use strict';var emlformat=require(_0xd16f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd16f('0x1'));var jsonpatch=require(_0xd16f('0x2'));var rp=require(_0xd16f('0x3'));var moment=require(_0xd16f('0x4'));var BPromise=require(_0xd16f('0x5'));var Mustache=require(_0xd16f('0x6'));var util=require(_0xd16f('0x7'));var path=require(_0xd16f('0x8'));var sox=require('sox');var csv=require(_0xd16f('0x9'));var ejs=require(_0xd16f('0xa'));var fs=require('fs');var fs_extra=require(_0xd16f('0xb'));var _=require('lodash');var squel=require(_0xd16f('0xc'));var crypto=require(_0xd16f('0xd'));var jsforce=require(_0xd16f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd16f('0x9'));var querystring=require('querystring');var Papa=require(_0xd16f('0xf'));var Redis=require(_0xd16f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd16f('0x11'));var as=require(_0xd16f('0x12'));var hardwareService=require(_0xd16f('0x13'));var logger=require(_0xd16f('0x14'))(_0xd16f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd16f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39ca20,_0x2e4d63){_0x2e4d63=_0x2e4d63||0xcc;return function(_0x54521e){if(_0x54521e){return _0x39ca20[_0xd16f('0x17')](_0x2e4d63);}return _0x39ca20[_0xd16f('0x18')](_0x2e4d63)[_0xd16f('0x19')]();};}function respondWithResult(_0x58af2a,_0x5ca89c){_0x5ca89c=_0x5ca89c||0xc8;return function(_0x4caeae){if(_0x4caeae){return _0x58af2a[_0xd16f('0x18')](_0x5ca89c)['json'](_0x4caeae);}};}function respondWithFilteredResult(_0x8f9261,_0x44e3b4){return function(_0x50f85e){if(_0x50f85e){var _0x4fd489=typeof _0x44e3b4['offset']===_0xd16f('0x1a')&&typeof _0x44e3b4['limit']===_0xd16f('0x1a');var _0xcfdd14=_0x50f85e[_0xd16f('0x1b')];var _0x5a776c=_0x4fd489?0x0:_0x44e3b4[_0xd16f('0x1c')];var _0x45c33c=_0x4fd489?_0x50f85e[_0xd16f('0x1b')]:_0x44e3b4[_0xd16f('0x1c')]+_0x44e3b4['limit'];var _0x30e2d5;if(_0x45c33c>=_0xcfdd14){_0x45c33c=_0xcfdd14;_0x30e2d5=0xc8;}else{_0x30e2d5=0xce;}_0x8f9261[_0xd16f('0x18')](_0x30e2d5);return _0x8f9261[_0xd16f('0x1d')](_0xd16f('0x1e'),_0x5a776c+'-'+_0x45c33c+'/'+_0xcfdd14)[_0xd16f('0x1f')](_0x50f85e);}return null;};}function patchUpdates(_0x3f4e0b){return function(_0x556e32){try{jsonpatch[_0xd16f('0x20')](_0x556e32,_0x3f4e0b,!![]);}catch(_0x13d2dc){return BPromise[_0xd16f('0x21')](_0x13d2dc);}return _0x556e32[_0xd16f('0x22')]();};}function saveUpdates(_0x186d0c,_0x4fab7f){return function(_0x2c65f9){if(_0x2c65f9){return _0x2c65f9[_0xd16f('0x23')](_0x186d0c)[_0xd16f('0x24')](function(_0x5c4b1a){return _0x5c4b1a;});}return null;};}function removeEntity(_0x3f4666,_0x290056){return function(_0x42e41f){if(_0x42e41f){return _0x42e41f[_0xd16f('0x25')]()[_0xd16f('0x24')](function(){var _0xcb4866=_0x42e41f[_0xd16f('0x26')]({'plain':!![]});var _0x711cb1=_0xd16f('0x27');return db[_0xd16f('0x28')][_0xd16f('0x25')]({'where':{'type':_0x711cb1,'resourceId':_0xcb4866['id']}})[_0xd16f('0x24')](function(){return _0x42e41f;});})['then'](function(){_0x3f4666[_0xd16f('0x18')](0xcc)[_0xd16f('0x19')]();});}};}function handleEntityNotFound(_0x40e7bc,_0x55e6c8){return function(_0x45f574){if(!_0x45f574){_0x40e7bc[_0xd16f('0x17')](0x194);}return _0x45f574;};}function handleError(_0x5a5a99,_0x1b90a5){_0x1b90a5=_0x1b90a5||0x1f4;return function(_0x531c98){logger[_0xd16f('0x29')](_0x531c98['stack']);if(_0x531c98['name']){delete _0x531c98['name'];}_0x5a5a99[_0xd16f('0x18')](_0x1b90a5)[_0xd16f('0x2a')](_0x531c98);};}exports[_0xd16f('0x2b')]=function(_0x34d2cb,_0x565780){var _0x290d4f={},_0x27b8a7={},_0x41286f={'count':0x0,'rows':[]};var _0x52e172=_[_0xd16f('0x2c')](db[_0xd16f('0x2d')][_0xd16f('0x2e')],function(_0x1ec529){return{'name':_0x1ec529['fieldName'],'type':_0x1ec529[_0xd16f('0x2f')][_0xd16f('0x30')]};});_0x27b8a7['model']=_[_0xd16f('0x2c')](_0x52e172,'name');_0x27b8a7[_0xd16f('0x31')]=_[_0xd16f('0x32')](_0x34d2cb[_0xd16f('0x31')]);_0x27b8a7[_0xd16f('0x33')]=_[_0xd16f('0x34')](_0x27b8a7['model'],_0x27b8a7[_0xd16f('0x31')]);_0x290d4f[_0xd16f('0x35')]=_[_0xd16f('0x34')](_0x27b8a7['model'],qs[_0xd16f('0x36')](_0x34d2cb[_0xd16f('0x31')][_0xd16f('0x36')]));_0x290d4f[_0xd16f('0x35')]=_0x290d4f['attributes']['length']?_0x290d4f[_0xd16f('0x35')]:_0x27b8a7[_0xd16f('0x37')];if(!_0x34d2cb[_0xd16f('0x31')]['hasOwnProperty']('nolimit')){_0x290d4f['limit']=qs['limit'](_0x34d2cb[_0xd16f('0x31')]['limit']);_0x290d4f[_0xd16f('0x1c')]=qs[_0xd16f('0x1c')](_0x34d2cb[_0xd16f('0x31')][_0xd16f('0x1c')]);}_0x290d4f[_0xd16f('0x38')]=qs[_0xd16f('0x39')](_0x34d2cb[_0xd16f('0x31')][_0xd16f('0x39')]);_0x290d4f['where']=qs['filters'](_[_0xd16f('0x3a')](_0x34d2cb[_0xd16f('0x31')],_0x27b8a7['filters']),_0x52e172);if(_0x34d2cb[_0xd16f('0x31')]['filter']){_0x290d4f[_0xd16f('0x3b')]=_[_0xd16f('0x3c')](_0x290d4f[_0xd16f('0x3b')],{'$or':_[_0xd16f('0x2c')](_0x52e172,function(_0x1f8147){if(_0x1f8147['type']!==_0xd16f('0x3d')){var _0x3b691a={};_0x3b691a[_0x1f8147[_0xd16f('0x3e')]]={'$like':'%'+_0x34d2cb[_0xd16f('0x31')][_0xd16f('0x3f')]+'%'};return _0x3b691a;}})});}_0x290d4f=_[_0xd16f('0x3c')]({},_0x290d4f,_0x34d2cb[_0xd16f('0x40')]);var _0x48c7f8={'where':_0x290d4f[_0xd16f('0x3b')]};return db[_0xd16f('0x2d')][_0xd16f('0x1b')](_0x48c7f8)[_0xd16f('0x24')](function(_0x8524d5){_0x41286f[_0xd16f('0x1b')]=_0x8524d5;if(_0x34d2cb[_0xd16f('0x31')][_0xd16f('0x41')]){_0x290d4f[_0xd16f('0x42')]=[{'all':!![]}];}return db[_0xd16f('0x2d')][_0xd16f('0x43')](_0x290d4f);})[_0xd16f('0x24')](function(_0x1f577e){_0x41286f[_0xd16f('0x44')]=_0x1f577e;return _0x41286f;})['then'](respondWithFilteredResult(_0x565780,_0x290d4f))[_0xd16f('0x45')](handleError(_0x565780,null));};exports[_0xd16f('0x46')]=function(_0x4346f0,_0x1e4f55){var _0x77972b={'raw':!![],'where':{'id':_0x4346f0['params']['id']}},_0x5167ef={};_0x5167ef[_0xd16f('0x37')]=_[_0xd16f('0x32')](db[_0xd16f('0x2d')]['rawAttributes']);_0x5167ef[_0xd16f('0x31')]=_['keys'](_0x4346f0[_0xd16f('0x31')]);_0x5167ef['filters']=_[_0xd16f('0x34')](_0x5167ef['model'],_0x5167ef['query']);_0x77972b[_0xd16f('0x35')]=_[_0xd16f('0x34')](_0x5167ef[_0xd16f('0x37')],qs[_0xd16f('0x36')](_0x4346f0[_0xd16f('0x31')]['fields']));_0x77972b[_0xd16f('0x35')]=_0x77972b[_0xd16f('0x35')]['length']?_0x77972b['attributes']:_0x5167ef[_0xd16f('0x37')];if(_0x4346f0[_0xd16f('0x31')]['includeAll']){_0x77972b[_0xd16f('0x42')]=[{'all':!![]}];}_0x77972b=_['merge']({},_0x77972b,_0x4346f0['options']);return db[_0xd16f('0x2d')][_0xd16f('0x47')](_0x77972b)[_0xd16f('0x24')](handleEntityNotFound(_0x1e4f55,null))[_0xd16f('0x24')](respondWithResult(_0x1e4f55,null))['catch'](handleError(_0x1e4f55,null));};exports[_0xd16f('0x48')]=function(_0x1d717a,_0x4e7a0b){return db['Variable'][_0xd16f('0x48')](_0x1d717a[_0xd16f('0x49')],{})[_0xd16f('0x24')](function(_0x322554){var _0x494009=_0x1d717a[_0xd16f('0x4a')][_0xd16f('0x26')]({'plain':!![]});if(!_0x494009)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x494009[_0xd16f('0x4b')]==='user'){var _0xf51593=_0x322554[_0xd16f('0x26')]({'plain':!![]});var _0x2e2ba5='Variables';return db[_0xd16f('0x4c')]['find']({'where':{'name':_0x2e2ba5,'userProfileId':_0x494009[_0xd16f('0x4d')]},'raw':!![]})[_0xd16f('0x24')](function(_0x2bd609){if(_0x2bd609&&_0x2bd609[_0xd16f('0x4e')]===0x0){return db['UserProfileResource'][_0xd16f('0x48')]({'name':_0xf51593[_0xd16f('0x3e')],'resourceId':_0xf51593['id'],'type':_0x2bd609[_0xd16f('0x3e')],'sectionId':_0x2bd609['id']},{})[_0xd16f('0x24')](function(){return _0x322554;});}else{return _0x322554;}})[_0xd16f('0x45')](function(_0x1a3e0b){logger[_0xd16f('0x29')](_0xd16f('0x4f'),_0x1a3e0b);throw _0x1a3e0b;});}return _0x322554;})[_0xd16f('0x24')](respondWithResult(_0x4e7a0b,0xc9))['catch'](handleError(_0x4e7a0b,null));};exports[_0xd16f('0x23')]=function(_0x27d9ed,_0x3bfd42){if(_0x27d9ed['body']['id']){delete _0x27d9ed[_0xd16f('0x49')]['id'];}return db[_0xd16f('0x2d')][_0xd16f('0x47')]({'where':{'id':_0x27d9ed[_0xd16f('0x50')]['id']}})[_0xd16f('0x24')](handleEntityNotFound(_0x3bfd42,null))['then'](saveUpdates(_0x27d9ed[_0xd16f('0x49')],null))[_0xd16f('0x24')](respondWithResult(_0x3bfd42,null))[_0xd16f('0x45')](handleError(_0x3bfd42,null));};exports[_0xd16f('0x25')]=function(_0x17c779,_0x51fbb3){return db[_0xd16f('0x2d')]['find']({'where':{'id':_0x17c779[_0xd16f('0x50')]['id']}})[_0xd16f('0x24')](handleEntityNotFound(_0x51fbb3,null))[_0xd16f('0x24')](removeEntity(_0x51fbb3,null))['catch'](handleError(_0x51fbb3,null));}; \ No newline at end of file +var _0xef2f=['nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','Variable','findAll','rows','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x4bdfe7,_0x3fc94c){var _0x1860df=function(_0x5ca456){while(--_0x5ca456){_0x4bdfe7['push'](_0x4bdfe7['shift']());}};_0x1860df(++_0x3fc94c);}(_0xef2f,0x1bf));var _0xfef2=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xef2f[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xfef2('0x0'));var rimraf=require(_0xfef2('0x1'));var zipdir=require(_0xfef2('0x2'));var jsonpatch=require(_0xfef2('0x3'));var rp=require(_0xfef2('0x4'));var moment=require(_0xfef2('0x5'));var BPromise=require(_0xfef2('0x6'));var Mustache=require(_0xfef2('0x7'));var util=require(_0xfef2('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfef2('0x9'));var ejs=require(_0xfef2('0xa'));var fs=require('fs');var fs_extra=require(_0xfef2('0xb'));var _=require(_0xfef2('0xc'));var squel=require(_0xfef2('0xd'));var crypto=require('crypto');var jsforce=require(_0xfef2('0xe'));var deskjs=require(_0xfef2('0xf'));var toCsv=require(_0xfef2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfef2('0x10'));var authService=require(_0xfef2('0x11'));var qs=require(_0xfef2('0x12'));var as=require(_0xfef2('0x13'));var hardwareService=require(_0xfef2('0x14'));var logger=require('../../config/logger')(_0xfef2('0x15'));var utils=require('../../config/utils');var config=require(_0xfef2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfef2('0x17'))['db'];function respondWithStatusCode(_0x52420a,_0x543f1b){_0x543f1b=_0x543f1b||0xcc;return function(_0x24cb96){if(_0x24cb96){return _0x52420a[_0xfef2('0x18')](_0x543f1b);}return _0x52420a['status'](_0x543f1b)[_0xfef2('0x19')]();};}function respondWithResult(_0xc7ba06,_0x4a1207){_0x4a1207=_0x4a1207||0xc8;return function(_0x3b4290){if(_0x3b4290){return _0xc7ba06[_0xfef2('0x1a')](_0x4a1207)[_0xfef2('0x1b')](_0x3b4290);}};}function respondWithFilteredResult(_0x4a4420,_0x51220d){return function(_0x2c10fd){if(_0x2c10fd){var _0x41fbdc=typeof _0x51220d['offset']===_0xfef2('0x1c')&&typeof _0x51220d[_0xfef2('0x1d')]===_0xfef2('0x1c');var _0xee8bb7=_0x2c10fd['count'];var _0x183ad8=_0x41fbdc?0x0:_0x51220d[_0xfef2('0x1e')];var _0x158f19=_0x41fbdc?_0x2c10fd[_0xfef2('0x1f')]:_0x51220d['offset']+_0x51220d[_0xfef2('0x1d')];var _0x14188a;if(_0x158f19>=_0xee8bb7){_0x158f19=_0xee8bb7;_0x14188a=0xc8;}else{_0x14188a=0xce;}_0x4a4420['status'](_0x14188a);return _0x4a4420['set'](_0xfef2('0x20'),_0x183ad8+'-'+_0x158f19+'/'+_0xee8bb7)[_0xfef2('0x1b')](_0x2c10fd);}return null;};}function patchUpdates(_0x547dae){return function(_0x2f5aee){try{jsonpatch[_0xfef2('0x21')](_0x2f5aee,_0x547dae,!![]);}catch(_0x585a38){return BPromise[_0xfef2('0x22')](_0x585a38);}return _0x2f5aee[_0xfef2('0x23')]();};}function saveUpdates(_0xcc28ae,_0x4ccacb){return function(_0x1d0211){if(_0x1d0211){return _0x1d0211['update'](_0xcc28ae)[_0xfef2('0x24')](function(_0x40b1b4){return _0x40b1b4;});}return null;};}function removeEntity(_0x185afa,_0x57cbe5){return function(_0x15021b){if(_0x15021b){return _0x15021b[_0xfef2('0x25')]()[_0xfef2('0x24')](function(){var _0x124ec1=_0x15021b[_0xfef2('0x26')]({'plain':!![]});var _0x262a26=_0xfef2('0x27');return db[_0xfef2('0x28')][_0xfef2('0x25')]({'where':{'type':_0x262a26,'resourceId':_0x124ec1['id']}})[_0xfef2('0x24')](function(){return _0x15021b;});})[_0xfef2('0x24')](function(){_0x185afa['status'](0xcc)[_0xfef2('0x19')]();});}};}function handleEntityNotFound(_0x690636,_0x3a38cb){return function(_0x598d7d){if(!_0x598d7d){_0x690636[_0xfef2('0x18')](0x194);}return _0x598d7d;};}function handleError(_0x4f2482,_0x43f0c4){_0x43f0c4=_0x43f0c4||0x1f4;return function(_0x4ecc21){logger[_0xfef2('0x29')](_0x4ecc21[_0xfef2('0x2a')]);if(_0x4ecc21[_0xfef2('0x2b')]){delete _0x4ecc21[_0xfef2('0x2b')];}_0x4f2482[_0xfef2('0x1a')](_0x43f0c4)[_0xfef2('0x2c')](_0x4ecc21);};}exports[_0xfef2('0x2d')]=function(_0x58a494,_0x13de47){var _0x2e9617={},_0x27b498={},_0x3515e6={'count':0x0,'rows':[]};var _0x26c492=_[_0xfef2('0x2e')](db['Variable'][_0xfef2('0x2f')],function(_0x3f1ed0){return{'name':_0x3f1ed0[_0xfef2('0x30')],'type':_0x3f1ed0[_0xfef2('0x31')]['key']};});_0x27b498[_0xfef2('0x32')]=_['map'](_0x26c492,_0xfef2('0x2b'));_0x27b498[_0xfef2('0x33')]=_[_0xfef2('0x34')](_0x58a494['query']);_0x27b498[_0xfef2('0x35')]=_[_0xfef2('0x36')](_0x27b498[_0xfef2('0x32')],_0x27b498[_0xfef2('0x33')]);_0x2e9617['attributes']=_['intersection'](_0x27b498[_0xfef2('0x32')],qs[_0xfef2('0x37')](_0x58a494[_0xfef2('0x33')]['fields']));_0x2e9617[_0xfef2('0x38')]=_0x2e9617[_0xfef2('0x38')]['length']?_0x2e9617[_0xfef2('0x38')]:_0x27b498[_0xfef2('0x32')];if(!_0x58a494[_0xfef2('0x33')]['hasOwnProperty'](_0xfef2('0x39'))){_0x2e9617['limit']=qs[_0xfef2('0x1d')](_0x58a494[_0xfef2('0x33')][_0xfef2('0x1d')]);_0x2e9617[_0xfef2('0x1e')]=qs[_0xfef2('0x1e')](_0x58a494[_0xfef2('0x33')][_0xfef2('0x1e')]);}_0x2e9617[_0xfef2('0x3a')]=qs[_0xfef2('0x3b')](_0x58a494[_0xfef2('0x33')][_0xfef2('0x3b')]);_0x2e9617[_0xfef2('0x3c')]=qs['filters'](_['pick'](_0x58a494[_0xfef2('0x33')],_0x27b498[_0xfef2('0x35')]),_0x26c492);if(_0x58a494['query'][_0xfef2('0x3d')]){_0x2e9617[_0xfef2('0x3c')]=_[_0xfef2('0x3e')](_0x2e9617['where'],{'$or':_['map'](_0x26c492,function(_0x55b485){if(_0x55b485[_0xfef2('0x31')]!==_0xfef2('0x3f')){var _0x544c29={};_0x544c29[_0x55b485[_0xfef2('0x2b')]]={'$like':'%'+_0x58a494[_0xfef2('0x33')][_0xfef2('0x3d')]+'%'};return _0x544c29;}})});}_0x2e9617=_[_0xfef2('0x3e')]({},_0x2e9617,_0x58a494['options']);var _0x8fc9a2={'where':_0x2e9617[_0xfef2('0x3c')]};return db['Variable'][_0xfef2('0x1f')](_0x8fc9a2)[_0xfef2('0x24')](function(_0x58b16a){_0x3515e6[_0xfef2('0x1f')]=_0x58b16a;if(_0x58a494['query'][_0xfef2('0x40')]){_0x2e9617[_0xfef2('0x41')]=[{'all':!![]}];}return db[_0xfef2('0x42')][_0xfef2('0x43')](_0x2e9617);})[_0xfef2('0x24')](function(_0x244ee5){_0x3515e6[_0xfef2('0x44')]=_0x244ee5;return _0x3515e6;})[_0xfef2('0x24')](respondWithFilteredResult(_0x13de47,_0x2e9617))[_0xfef2('0x45')](handleError(_0x13de47,null));};exports[_0xfef2('0x46')]=function(_0x26447b,_0x1b5143){var _0x227b1f={'raw':!![],'where':{'id':_0x26447b[_0xfef2('0x47')]['id']}},_0x1cfc50={};_0x1cfc50[_0xfef2('0x32')]=_[_0xfef2('0x34')](db[_0xfef2('0x42')]['rawAttributes']);_0x1cfc50[_0xfef2('0x33')]=_['keys'](_0x26447b[_0xfef2('0x33')]);_0x1cfc50[_0xfef2('0x35')]=_['intersection'](_0x1cfc50[_0xfef2('0x32')],_0x1cfc50[_0xfef2('0x33')]);_0x227b1f['attributes']=_[_0xfef2('0x36')](_0x1cfc50[_0xfef2('0x32')],qs[_0xfef2('0x37')](_0x26447b[_0xfef2('0x33')][_0xfef2('0x37')]));_0x227b1f[_0xfef2('0x38')]=_0x227b1f['attributes'][_0xfef2('0x48')]?_0x227b1f[_0xfef2('0x38')]:_0x1cfc50['model'];if(_0x26447b[_0xfef2('0x33')][_0xfef2('0x40')]){_0x227b1f[_0xfef2('0x41')]=[{'all':!![]}];}_0x227b1f=_[_0xfef2('0x3e')]({},_0x227b1f,_0x26447b[_0xfef2('0x49')]);return db['Variable'][_0xfef2('0x4a')](_0x227b1f)['then'](handleEntityNotFound(_0x1b5143,null))[_0xfef2('0x24')](respondWithResult(_0x1b5143,null))[_0xfef2('0x45')](handleError(_0x1b5143,null));};exports[_0xfef2('0x4b')]=function(_0x2fe03b,_0x23aca8){return db[_0xfef2('0x42')][_0xfef2('0x4b')](_0x2fe03b['body'],{})[_0xfef2('0x24')](function(_0x376c50){var _0x11250d=_0x2fe03b[_0xfef2('0x4c')]['get']({'plain':!![]});if(!_0x11250d)throw new Error(_0xfef2('0x4d'));if(_0x11250d[_0xfef2('0x4e')]===_0xfef2('0x4c')){var _0x5d20c1=_0x376c50[_0xfef2('0x26')]({'plain':!![]});var _0xefd160=_0xfef2('0x27');return db[_0xfef2('0x4f')][_0xfef2('0x4a')]({'where':{'name':_0xefd160,'userProfileId':_0x11250d['userProfileId']},'raw':!![]})['then'](function(_0x533bf1){if(_0x533bf1&&_0x533bf1[_0xfef2('0x50')]===0x0){return db[_0xfef2('0x28')]['create']({'name':_0x5d20c1[_0xfef2('0x2b')],'resourceId':_0x5d20c1['id'],'type':_0x533bf1['name'],'sectionId':_0x533bf1['id']},{})[_0xfef2('0x24')](function(){return _0x376c50;});}else{return _0x376c50;}})[_0xfef2('0x45')](function(_0x1e4cb6){logger[_0xfef2('0x29')](_0xfef2('0x51'),_0x1e4cb6);throw _0x1e4cb6;});}return _0x376c50;})[_0xfef2('0x24')](respondWithResult(_0x23aca8,0xc9))[_0xfef2('0x45')](handleError(_0x23aca8,null));};exports[_0xfef2('0x52')]=function(_0x20b56f,_0x19d0c4){if(_0x20b56f[_0xfef2('0x53')]['id']){delete _0x20b56f[_0xfef2('0x53')]['id'];}return db[_0xfef2('0x42')][_0xfef2('0x4a')]({'where':{'id':_0x20b56f[_0xfef2('0x47')]['id']}})[_0xfef2('0x24')](handleEntityNotFound(_0x19d0c4,null))[_0xfef2('0x24')](saveUpdates(_0x20b56f[_0xfef2('0x53')],null))[_0xfef2('0x24')](respondWithResult(_0x19d0c4,null))[_0xfef2('0x45')](handleError(_0x19d0c4,null));};exports['destroy']=function(_0x29da76,_0x2391db){return db[_0xfef2('0x42')][_0xfef2('0x4a')]({'where':{'id':_0x29da76[_0xfef2('0x47')]['id']}})[_0xfef2('0x24')](handleEntityNotFound(_0x2391db,null))[_0xfef2('0x24')](removeEntity(_0x2391db,null))[_0xfef2('0x45')](handleError(_0x2391db,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 64df923..ba49a7e 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 _0x5aeb=['define','Variable','tools_variables','util','../../config/logger','api','bluebird','path','../../config/environment','./variable.attributes','exports'];(function(_0x1e78a6,_0x229e42){var _0x54d916=function(_0x372c41){while(--_0x372c41){_0x1e78a6['push'](_0x1e78a6['shift']());}};_0x54d916(++_0x229e42);}(_0x5aeb,0x116));var _0xb5ae=function(_0xeb0692,_0x85938c){_0xeb0692=_0xeb0692-0x0;var _0x5b9f62=_0x5aeb[_0xeb0692];return _0x5b9f62;};'use strict';var _=require('lodash');var util=require(_0xb5ae('0x0'));var logger=require(_0xb5ae('0x1'))(_0xb5ae('0x2'));var moment=require('moment');var BPromise=require(_0xb5ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5ae('0x4'));var rimraf=require('rimraf');var config=require(_0xb5ae('0x5'));var attributes=require(_0xb5ae('0x6'));module[_0xb5ae('0x7')]=function(_0x3374f7,_0x577016){return _0x3374f7[_0xb5ae('0x8')](_0xb5ae('0x9'),attributes,{'tableName':_0xb5ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e25=['moment','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','../../config/logger','api'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7e25,0x1ea));var _0x57e2=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x7e25[_0x5dbb84];return _0x1d6eae;};'use strict';var _=require(_0x57e2('0x0'));var util=require(_0x57e2('0x1'));var logger=require(_0x57e2('0x2'))(_0x57e2('0x3'));var moment=require(_0x57e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x57e2('0x5'));var fs=require('fs');var path=require(_0x57e2('0x6'));var rimraf=require(_0x57e2('0x7'));var config=require(_0x57e2('0x8'));var attributes=require(_0x57e2('0x9'));module[_0x57e2('0xa')]=function(_0x3f25eb,_0x46922f){return _0x3f25eb[_0x57e2('0xb')](_0x57e2('0xc'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index a86ac6c..0a34be0 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 _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x326f,0xd1));var _0xf326=function(_0x25e7b5,_0x314b11){_0x25e7b5=_0x25e7b5-0x0;var _0x9e3ec3=_0x326f[_0x25e7b5];return _0x9e3ec3;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x326f,0xd1));var _0xf326=function(_0x4d8940,_0x34fb97){_0x4d8940=_0x4d8940-0x0;var _0x16c0ee=_0x326f[_0x4d8940];return _0x16c0ee;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 46db7cb..a2deaaa 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 _0x6dff=['fetch','/reset','reset','/pull','pull','/restart','migrations','exports','express','Router','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6dff,0x138));var _0xf6df=function(_0x3c8ec6,_0x1f83c2){_0x3c8ec6=_0x3c8ec6-0x0;var _0x1a189e=_0x6dff[_0x3c8ec6];return _0x1a189e;};'use strict';var express=require(_0xf6df('0x0'));var router=express[_0xf6df('0x1')]();var auth=require(_0xf6df('0x2'));var controller=require('./version.controller');router[_0xf6df('0x3')]('/',controller[_0xf6df('0x4')]);router[_0xf6df('0x3')](_0xf6df('0x5'),auth[_0xf6df('0x6')](),auth[_0xf6df('0x7')](),controller[_0xf6df('0x8')]);router['get'](_0xf6df('0x9'),auth[_0xf6df('0x6')](),auth[_0xf6df('0x7')](),controller[_0xf6df('0xa')]);router[_0xf6df('0x3')](_0xf6df('0xb'),auth[_0xf6df('0x6')](),auth['canUpdate'](),controller[_0xf6df('0xc')]);router[_0xf6df('0x3')](_0xf6df('0xd'),auth[_0xf6df('0x6')](),controller['restart']);router[_0xf6df('0x3')]('/migrations',controller[_0xf6df('0xe')]);module[_0xf6df('0xf')]=router; \ No newline at end of file +var _0x97ba=['exports','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','/restart'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x97ba,0x1ae));var _0xa97b=function(_0x407f1c,_0x163fd1){_0x407f1c=_0x407f1c-0x0;var _0x29d8ce=_0x97ba[_0x407f1c];return _0x29d8ce;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xa97b('0x0'));var controller=require(_0xa97b('0x1'));router[_0xa97b('0x2')]('/',controller[_0xa97b('0x3')]);router['get'](_0xa97b('0x4'),auth[_0xa97b('0x5')](),auth[_0xa97b('0x6')](),controller['fetch']);router['get'](_0xa97b('0x7'),auth['isAuthenticated'](),auth[_0xa97b('0x6')](),controller[_0xa97b('0x8')]);router[_0xa97b('0x2')]('/pull',auth['isAuthenticated'](),auth[_0xa97b('0x6')](),controller['pull']);router[_0xa97b('0x2')](_0xa97b('0x9'),auth[_0xa97b('0x5')](),controller['restart']);router['get']('/migrations',controller['migrations']);module[_0xa97b('0xa')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 94a308d..cdf8ea4 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 _0x98ef=['master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','error','git\x20reset\x20--hard\x20FETCH_HEAD','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','root','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','pkginfo','version','child_process','exec','../../mysqldb','../../config/logger','simple-git','index','exports','query','latest','tags','status','json','origin'];(function(_0x328edb,_0x407914){var _0x35c9a5=function(_0x25e135){while(--_0x25e135){_0x328edb['push'](_0x328edb['shift']());}};_0x35c9a5(++_0x407914);}(_0x98ef,0xb8));var _0xf98e=function(_0x391d23,_0x4adb6b){_0x391d23=_0x391d23-0x0;var _0x50fa4c=_0x98ef[_0x391d23];return _0x50fa4c;};'use strict';var Umzug=require('umzug');var path=require(_0xf98e('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xf98e('0x1'))(module,_0xf98e('0x2'));var compareVersions=require('compare-versions');var exec=require(_0xf98e('0x3'))[_0xf98e('0x4')];var db=require(_0xf98e('0x5'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0xf98e('0x6'))('update');var git=require(_0xf98e('0x7'))(config['root']);exports[_0xf98e('0x8')]=function(_0x35aadb,_0x34c5d0){var _0x2a5868={'current':module[_0xf98e('0x9')][_0xf98e('0x2')],'phonebar':0x2};if(_0x35aadb[_0xf98e('0xa')]&&_0x35aadb[_0xf98e('0xa')][_0xf98e('0xb')]){return git['fetch']()[_0xf98e('0xc')](function(_0x4fe9cf,_0x242a67){_0x2a5868[_0xf98e('0xb')]=(_0x4fe9cf?module[_0xf98e('0x9')][_0xf98e('0x2')]:_0x242a67[_0xf98e('0xb')])||'2.0.0';return _0x34c5d0[_0xf98e('0xd')](0xc8)['json'](_0x2a5868);});}else{return _0x34c5d0[_0xf98e('0xd')](0xc8)[_0xf98e('0xe')](_0x2a5868);}};exports['fetch']=function(_0x5be9bb,_0x11c777){return git['fetch']([_0xf98e('0xf'),_0xf98e('0x10')],function(_0x5d7afa){if(_0x5d7afa){logger['error'](_0x5d7afa);return _0x11c777[_0xf98e('0xd')](0x1f4)[_0xf98e('0xe')](_0x5d7afa);}logger[_0xf98e('0x11')](_0xf98e('0x12'));return _0x11c777[_0xf98e('0xd')](0xc8)[_0xf98e('0xe')]({'output':_0xf98e('0x13')});});};exports[_0xf98e('0x14')]=function(_0x7c965d,_0x41e629){return git[_0xf98e('0x14')]([_0xf98e('0x15'),'FETCH_HEAD'],function(_0x524d5f){if(_0x524d5f){logger[_0xf98e('0x16')](_0x524d5f);return _0x41e629[_0xf98e('0xd')](0x1f4)[_0xf98e('0xe')](_0x524d5f);}logger[_0xf98e('0x11')](_0xf98e('0x17'));return _0x41e629['status'](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0xf98e('0x18')]=function(_0x6d60ca,_0x47f2dc){exec(_0xf98e('0x19'),function(_0x189c4e,_0x308d52,_0x34b3f7){logger[_0xf98e('0x11')](_0x308d52);logger['info'](_0x34b3f7);if(_0x189c4e){logger[_0xf98e('0x16')](_0x189c4e);return _0x47f2dc[_0xf98e('0xd')](0x1f4)[_0xf98e('0xe')](_0x189c4e);}return _0x47f2dc['status'](0xc8)[_0xf98e('0xe')]({'output':_0x308d52});});};exports[_0xf98e('0x1a')]=function(_0x1207fb,_0x380991){return pm2[_0xf98e('0x1a')](_0xf98e('0x1b'))[_0xf98e('0x1c')](function(_0x21b3e5){logger[_0xf98e('0x11')](_0xf98e('0x1d'),_0x21b3e5);return _0x380991[_0xf98e('0xd')](0xc8)[_0xf98e('0xe')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xf98e('0x1e')](function(_0x594f30){logger['error'](_0x594f30);return _0x380991[_0xf98e('0xd')](0x1f4)['json'](_0x594f30);});};exports[_0xf98e('0x1f')]=function(_0x257241,_0x4d53c3){var _0x5e0790=fs[_0xf98e('0x20')](path[_0xf98e('0x21')](config['root'],_0xf98e('0x22'),_0xf98e('0x1f')));var _0x15e5ea=[];for(var _0x56fdf9=0x0;_0x56fdf9<_0x5e0790[_0xf98e('0x23')];_0x56fdf9++){var _0x38619b=_0x5e0790[_0x56fdf9][_0xf98e('0x24')](_0xf98e('0x25'),'');if(compareVersions(module[_0xf98e('0x9')]['version'],_0x38619b)===-0x1){_0x15e5ea['push'](_0x38619b);}}if(_0x15e5ea['length']){var _0x37f5fb=_0x15e5ea[_0xf98e('0x26')](compareVersions);var _0x245ebf=new Umzug({'storage':_0xf98e('0x27'),'storageOptions':{'model':db[_0xf98e('0x28')],'modelName':'Migration','columnName':_0xf98e('0x2')},'migrations':{'params':[db[_0xf98e('0x27')][_0xf98e('0x29')](),db[_0xf98e('0x27')][_0xf98e('0x2a')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xf98e('0x21')](config[_0xf98e('0x2b')],_0xf98e('0x22'),_0xf98e('0x1f')),'pattern':/\.js$/}});_0x245ebf['up']({'migrations':_[_0xf98e('0x2c')](_0x37f5fb,function(_0xb3382){return _0xb3382+'.js';})})[_0xf98e('0x1c')](function(){return _0x4d53c3[_0xf98e('0xd')](0xc8)[_0xf98e('0xe')]({'output':_0xf98e('0x2d')+module['exports']['version']+_0xf98e('0x2e')+_[_0xf98e('0x2f')](_0x37f5fb),'migrations':_['join'](_0x37f5fb)});})[_0xf98e('0x1e')](function(_0x59f20e){if(_0x59f20e instanceof db[_0xf98e('0x27')][_0xf98e('0x30')]){return _0x4d53c3[_0xf98e('0xd')](0xc8)[_0xf98e('0xe')]({'output':_0xf98e('0x31')});}else{return _0x4d53c3[_0xf98e('0xd')](0x1f4)[_0xf98e('0xe')](_0x59f20e);}});}else{return _0x4d53c3[_0xf98e('0xd')](0xc8)[_0xf98e('0xe')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x737b=['../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','query','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','exports','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','then','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process'];(function(_0x5a33e5,_0xf91e32){var _0x3e73dd=function(_0x56660f){while(--_0x56660f){_0x5a33e5['push'](_0x5a33e5['shift']());}};_0x3e73dd(++_0xf91e32);}(_0x737b,0x93));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var Umzug=require(_0xb737('0x0'));var path=require(_0xb737('0x1'));var fs=require('fs');var _=require(_0xb737('0x2'));var pkginfo=require(_0xb737('0x3'))(module,_0xb737('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xb737('0x5'))['exec'];var db=require(_0xb737('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xb737('0x7'));var logger=require(_0xb737('0x8'))(_0xb737('0x9'));var git=require(_0xb737('0xa'))(config[_0xb737('0xb')]);exports[_0xb737('0xc')]=function(_0x3d6dad,_0x47ffce){var _0x1f61e0={'current':module['exports'][_0xb737('0x4')],'phonebar':0x2};if(_0x3d6dad[_0xb737('0xd')]&&_0x3d6dad[_0xb737('0xd')][_0xb737('0xe')]){return git[_0xb737('0xf')]()[_0xb737('0x10')](function(_0x50451e,_0xf6ab81){_0x1f61e0[_0xb737('0xe')]=(_0x50451e?module['exports'][_0xb737('0x4')]:_0xf6ab81[_0xb737('0xe')])||_0xb737('0x11');return _0x47ffce[_0xb737('0x12')](0xc8)['json'](_0x1f61e0);});}else{return _0x47ffce[_0xb737('0x12')](0xc8)[_0xb737('0x13')](_0x1f61e0);}};exports[_0xb737('0xf')]=function(_0x59b593,_0x241ce1){return git[_0xb737('0xf')]([_0xb737('0x14'),'master'],function(_0x4bfe9a){if(_0x4bfe9a){logger[_0xb737('0x15')](_0x4bfe9a);return _0x241ce1['status'](0x1f4)[_0xb737('0x13')](_0x4bfe9a);}logger[_0xb737('0x16')](_0xb737('0x17'));return _0x241ce1[_0xb737('0x12')](0xc8)[_0xb737('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xb737('0x18')]=function(_0x53d9e9,_0x32e6fb){return git['reset']([_0xb737('0x19'),_0xb737('0x1a')],function(_0x100cae){if(_0x100cae){logger[_0xb737('0x15')](_0x100cae);return _0x32e6fb[_0xb737('0x12')](0x1f4)[_0xb737('0x13')](_0x100cae);}logger[_0xb737('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x32e6fb[_0xb737('0x12')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x26999b,_0x49f80f){exec('npm\x20install\x20--production',function(_0x15bc00,_0x15b6a7,_0x47d551){logger[_0xb737('0x16')](_0x15b6a7);logger['info'](_0x47d551);if(_0x15bc00){logger[_0xb737('0x15')](_0x15bc00);return _0x49f80f[_0xb737('0x12')](0x1f4)[_0xb737('0x13')](_0x15bc00);}return _0x49f80f[_0xb737('0x12')](0xc8)[_0xb737('0x13')]({'output':_0x15b6a7});});};exports[_0xb737('0x1b')]=function(_0x56f44b,_0x1e1a5e){return pm2[_0xb737('0x1b')](_0xb737('0x1c'))['then'](function(_0x3718e7){logger[_0xb737('0x16')]('pm2\x20restart\x20motion\x20%s',_0x3718e7);return _0x1e1a5e[_0xb737('0x12')](0xc8)[_0xb737('0x13')]({'output':_0xb737('0x1d')});})[_0xb737('0x1e')](function(_0x49b94c){logger[_0xb737('0x15')](_0x49b94c);return _0x1e1a5e[_0xb737('0x12')](0x1f4)[_0xb737('0x13')](_0x49b94c);});};exports[_0xb737('0x1f')]=function(_0x4b0ed0,_0x45a5f8){var _0x16acd4=fs[_0xb737('0x20')](path[_0xb737('0x21')](config[_0xb737('0xb')],_0xb737('0x22'),_0xb737('0x1f')));var _0x102dda=[];for(var _0x66e2f2=0x0;_0x66e2f2<_0x16acd4[_0xb737('0x23')];_0x66e2f2++){var _0x313040=_0x16acd4[_0x66e2f2][_0xb737('0x24')](_0xb737('0x25'),'');if(compareVersions(module[_0xb737('0x26')][_0xb737('0x4')],_0x313040)===-0x1){_0x102dda['push'](_0x313040);}}if(_0x102dda[_0xb737('0x23')]){var _0x756afd=_0x102dda[_0xb737('0x27')](compareVersions);var _0x15cbe5=new Umzug({'storage':_0xb737('0x28'),'storageOptions':{'model':db['Migration'],'modelName':_0xb737('0x29'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0xb737('0x2a')](),db['sequelize'][_0xb737('0x2b')],function(){throw new Error(_0xb737('0x2c'));}],'path':path[_0xb737('0x21')](config[_0xb737('0xb')],_0xb737('0x22'),_0xb737('0x1f')),'pattern':/\.js$/}});_0x15cbe5['up']({'migrations':_[_0xb737('0x2d')](_0x756afd,function(_0xb49582){return _0xb49582+'.js';})})[_0xb737('0x2e')](function(){return _0x45a5f8['status'](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xb737('0x4')]+_0xb737('0x2f')+_[_0xb737('0x30')](_0x756afd),'migrations':_[_0xb737('0x21')](_0x756afd)});})['catch'](function(_0x339eac){if(_0x339eac instanceof db[_0xb737('0x28')][_0xb737('0x31')]){return _0x45a5f8[_0xb737('0x12')](0xc8)[_0xb737('0x13')]({'output':_0xb737('0x32')});}else{return _0x45a5f8[_0xb737('0x12')](0x1f4)[_0xb737('0x13')](_0x339eac);}});}else{return _0x45a5f8['status'](0xc8)[_0xb737('0x13')]({'output':_0xb737('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 92118e2..6b92580 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 _0xde35=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x412a99,_0x4cc68c){var _0x1a8044=function(_0x2a0213){while(--_0x2a0213){_0x412a99['push'](_0x412a99['shift']());}};_0x1a8044(++_0x4cc68c);}(_0xde35,0x1b6));var _0x5de3=function(_0x452e69,_0x1b7184){_0x452e69=_0x452e69-0x0;var _0xb4664d=_0xde35[_0x452e69];return _0xb4664d;};'use strict';var multer=require(_0x5de3('0x0'));var util=require(_0x5de3('0x1'));var path=require(_0x5de3('0x2'));var timeout=require('connect-timeout');var express=require(_0x5de3('0x3'));var router=express[_0x5de3('0x4')]();var fs_extra=require(_0x5de3('0x5'));var auth=require(_0x5de3('0x6'));var interaction=require(_0x5de3('0x7'));var config=require('../../config/environment');var controller=require(_0x5de3('0x8'));router[_0x5de3('0x9')]('/',auth[_0x5de3('0xa')](),controller[_0x5de3('0xb')]);router[_0x5de3('0x9')](_0x5de3('0xc'),auth[_0x5de3('0xa')](),controller[_0x5de3('0xd')]);router['get'](_0x5de3('0xe'),auth['isAuthenticated'](),controller[_0x5de3('0xf')]);router['post']('/',auth[_0x5de3('0xa')](),controller[_0x5de3('0x10')]);router[_0x5de3('0x11')]('/:id',auth[_0x5de3('0xa')](),controller[_0x5de3('0x12')]);router[_0x5de3('0x13')](_0x5de3('0xe'),auth['isAuthenticated'](),controller[_0x5de3('0x14')]);module[_0x5de3('0x15')]=router; \ No newline at end of file +var _0x1ff0=['create','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','get','describe','/:id','show'];(function(_0x279de4,_0x5d552d){var _0x104a16=function(_0x365e5a){while(--_0x365e5a){_0x279de4['push'](_0x279de4['shift']());}};_0x104a16(++_0x5d552d);}(_0x1ff0,0x16c));var _0x01ff=function(_0x57251b,_0x4efa43){_0x57251b=_0x57251b-0x0;var _0x1371c4=_0x1ff0[_0x57251b];return _0x1371c4;};'use strict';var multer=require(_0x01ff('0x0'));var util=require(_0x01ff('0x1'));var path=require(_0x01ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x01ff('0x3'));var router=express[_0x01ff('0x4')]();var fs_extra=require(_0x01ff('0x5'));var auth=require(_0x01ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x01ff('0x7'));var controller=require(_0x01ff('0x8'));router['get']('/',auth[_0x01ff('0x9')](),controller['index']);router[_0x01ff('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x01ff('0xb')]);router['get'](_0x01ff('0xc'),auth[_0x01ff('0x9')](),controller[_0x01ff('0xd')]);router['post']('/',auth[_0x01ff('0x9')](),controller[_0x01ff('0xe')]);router['put'](_0x01ff('0xc'),auth[_0x01ff('0x9')](),controller['update']);router[_0x01ff('0xf')](_0x01ff('0xc'),auth[_0x01ff('0x9')](),controller[_0x01ff('0x10')]);module[_0x01ff('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 657dfd3..e7eefb0 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 _0xad9f=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x21c84d,_0x344968){var _0x253899=function(_0x3a65dc){while(--_0x3a65dc){_0x21c84d['push'](_0x21c84d['shift']());}};_0x253899(++_0x344968);}(_0xad9f,0x1be));var _0xfad9=function(_0x44e3e5,_0x295b56){_0x44e3e5=_0x44e3e5-0x0;var _0x4e95bd=_0xad9f[_0x44e3e5];return _0x4e95bd;};'use strict';var Sequelize=require(_0xfad9('0x0'));module[_0xfad9('0x1')]={'type':{'type':Sequelize[_0xfad9('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfad9('0x2')]},'calleridname':{'type':Sequelize[_0xfad9('0x2')]},'queue':{'type':Sequelize[_0xfad9('0x2')]},'interface':{'type':Sequelize[_0xfad9('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xfad9('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xfad9('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xfad9('0x3')]},'agentdumpAt':{'type':Sequelize[_0xfad9('0x3')]},'holdtime':{'type':Sequelize[_0xfad9('0x4')]},'agentcomplete':{'type':Sequelize[_0xfad9('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfad9('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xfad9('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xfad9('0x4')]},'reason':{'type':Sequelize[_0xfad9('0x2')]},'lastevent':{'type':Sequelize[_0xfad9('0x2')]},'channel':{'type':Sequelize[_0xfad9('0x2')]},'channelstate':{'type':Sequelize[_0xfad9('0x4')]},'channelstatedesc':{'type':Sequelize[_0xfad9('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfad9('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfad9('0x2')]},'accountcode':{'type':Sequelize[_0xfad9('0x2')]},'context':{'type':Sequelize[_0xfad9('0x2')]},'exten':{'type':Sequelize[_0xfad9('0x2')]},'priority':{'type':Sequelize[_0xfad9('0x2')]},'destchannel':{'type':Sequelize[_0xfad9('0x2')]},'destchannelstate':{'type':Sequelize[_0xfad9('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xfad9('0x2')]},'destcalleridnum':{'type':Sequelize[_0xfad9('0x2')]},'destcalleridname':{'type':Sequelize[_0xfad9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xfad9('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xfad9('0x2')]},'destaccountcode':{'type':Sequelize[_0xfad9('0x2')]},'destcontext':{'type':Sequelize[_0xfad9('0x2')]},'destexten':{'type':Sequelize[_0xfad9('0x2')]},'destpriority':{'type':Sequelize[_0xfad9('0x2')]},'destuniqueid':{'type':Sequelize[_0xfad9('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xfad9('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfad9('0x2')],'comment':_0xfad9('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xfad9('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6215=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5621('0x0'));module[_0x5621('0x1')]={'type':{'type':Sequelize[_0x5621('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5621('0x2')]},'calleridname':{'type':Sequelize[_0x5621('0x2')]},'queue':{'type':Sequelize[_0x5621('0x2')]},'interface':{'type':Sequelize[_0x5621('0x2')]},'membername':{'type':Sequelize[_0x5621('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5621('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x5621('0x4')]},'agentcomplete':{'type':Sequelize[_0x5621('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x5621('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5621('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5621('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5621('0x4')]},'reason':{'type':Sequelize[_0x5621('0x2')]},'lastevent':{'type':Sequelize[_0x5621('0x2')]},'channel':{'type':Sequelize[_0x5621('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x5621('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5621('0x2')]},'connectedlinename':{'type':Sequelize[_0x5621('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5621('0x2')]},'context':{'type':Sequelize[_0x5621('0x2')]},'exten':{'type':Sequelize[_0x5621('0x2')]},'priority':{'type':Sequelize[_0x5621('0x2')]},'destchannel':{'type':Sequelize[_0x5621('0x2')]},'destchannelstate':{'type':Sequelize[_0x5621('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x5621('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5621('0x2')]},'destcalleridname':{'type':Sequelize[_0x5621('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5621('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5621('0x2')]},'destaccountcode':{'type':Sequelize[_0x5621('0x2')]},'destcontext':{'type':Sequelize[_0x5621('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5621('0x2')]},'destuniqueid':{'type':Sequelize[_0x5621('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x5621('0x2')]},'transfer':{'type':Sequelize[_0x5621('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5621('0x2')],'comment':_0x5621('0x6')},'transferexten':{'type':Sequelize[_0x5621('0x2')]},'transferuniqueid':{'type':Sequelize[_0x5621('0x2')]},'agententerreason':{'type':Sequelize[_0x5621('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 5feec81..89af2b1 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(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 a18850c..0c9404f 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 _0x44e8=['../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x332d63,_0x27ad8a){var _0x459335=function(_0x435664){while(--_0x435664){_0x332d63['push'](_0x332d63['shift']());}};_0x459335(++_0x27ad8a);}(_0x44e8,0xd7));var _0x844e=function(_0x4e5cbf,_0x4aa8a4){_0x4e5cbf=_0x4e5cbf-0x0;var _0x499630=_0x44e8[_0x4e5cbf];return _0x499630;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x844e('0x1'));var moment=require(_0x844e('0x2'));var BPromise=require(_0x844e('0x3'));var rp=require(_0x844e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var attributes=require(_0x844e('0x7'));module[_0x844e('0x8')]=function(_0x5c8f67,_0x2f6539){return _0x5c8f67[_0x844e('0x9')](_0x844e('0xa'),attributes,{'tableName':_0x844e('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x844e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b83=['./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x3974dd,_0x3b2c04){var _0x1c4983=function(_0x2a1b26){while(--_0x2a1b26){_0x3974dd['push'](_0x3974dd['shift']());}};_0x1c4983(++_0x3b2c04);}(_0x2b83,0x1d3));var _0x32b8=function(_0x354d04,_0x2b4aa3){_0x354d04=_0x354d04-0x0;var _0x51eb0b=_0x2b83[_0x354d04];return _0x51eb0b;};'use strict';var _=require('lodash');var util=require(_0x32b8('0x0'));var logger=require(_0x32b8('0x1'))('api');var moment=require(_0x32b8('0x2'));var BPromise=require(_0x32b8('0x3'));var rp=require(_0x32b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x32b8('0x5'));var attributes=require(_0x32b8('0x6'));module['exports']=function(_0x6bbc3d,_0x55abd0){return _0x6bbc3d[_0x32b8('0x7')](_0x32b8('0x8'),attributes,{'tableName':_0x32b8('0x9'),'paranoid':![],'indexes':[{'fields':[_0x32b8('0xa'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 690063b..b2085af 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 _0x5d20=['VoiceAgentReport','create','body','options','raw','update','where','attributes','then','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceAgentReport'];(function(_0x49dd7e,_0x48b1e5){var _0x4c4f6e=function(_0x5189f3){while(--_0x5189f3){_0x49dd7e['push'](_0x49dd7e['shift']());}};_0x4c4f6e(++_0x48b1e5);}(_0x5d20,0x112));var _0x05d2=function(_0x51451d,_0x472689){_0x51451d=_0x51451d-0x0;var _0x3522a7=_0x5d20[_0x51451d];return _0x3522a7;};'use strict';var _=require(_0x05d2('0x0'));var util=require(_0x05d2('0x1'));var moment=require(_0x05d2('0x2'));var BPromise=require(_0x05d2('0x3'));var rs=require(_0x05d2('0x4'));var fs=require('fs');var Redis=require(_0x05d2('0x5'));var db=require(_0x05d2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x05d2('0x7'))('rpc');var config=require(_0x05d2('0x8'));var jayson=require(_0x05d2('0x9'));var client=jayson['client'][_0x05d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bec1f,_0x4f8705,_0x234ab4){return new BPromise(function(_0x48c013,_0x499c5f){return client[_0x05d2('0xb')](_0x4bec1f,_0x234ab4)['then'](function(_0x5d99aa){logger[_0x05d2('0xc')](_0x05d2('0xd'),_0x4f8705,'request\x20sent');logger[_0x05d2('0xe')](_0x05d2('0xf'),_0x4f8705,_0x05d2('0x10'),JSON[_0x05d2('0x11')](_0x5d99aa));if(_0x5d99aa['error']){if(_0x5d99aa[_0x05d2('0x12')][_0x05d2('0x13')]===0x1f4){logger['error'](_0x05d2('0xd'),_0x4f8705,_0x5d99aa[_0x05d2('0x12')][_0x05d2('0x14')]);return _0x499c5f(_0x5d99aa[_0x05d2('0x12')][_0x05d2('0x14')]);}logger[_0x05d2('0x12')](_0x05d2('0xd'),_0x4f8705,_0x5d99aa[_0x05d2('0x12')]['message']);return _0x48c013(_0x5d99aa[_0x05d2('0x12')]['message']);}else{logger[_0x05d2('0xc')](_0x05d2('0xd'),_0x4f8705,_0x05d2('0x10'));_0x48c013(_0x5d99aa[_0x05d2('0x15')][_0x05d2('0x14')]);}})['catch'](function(_0x57b252){logger[_0x05d2('0x12')](_0x05d2('0xd'),_0x4f8705,_0x57b252);_0x499c5f(_0x57b252);});});}exports[_0x05d2('0x16')]=function(_0x24a45f){var _0x176e2e=this;return new Promise(function(_0x120d99,_0x3861b3){return db[_0x05d2('0x17')][_0x05d2('0x18')](_0x24a45f[_0x05d2('0x19')],{'raw':_0x24a45f[_0x05d2('0x1a')]?_0x24a45f['options'][_0x05d2('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x59e26d){logger[_0x05d2('0xc')](_0x05d2('0x16'),_0x24a45f);logger[_0x05d2('0xe')]('CreateVoiceAgentReport',_0x24a45f,JSON[_0x05d2('0x11')](_0x59e26d));_0x120d99(_0x59e26d);})['catch'](function(_0x4ecc03){logger[_0x05d2('0x12')](_0x05d2('0x16'),_0x4ecc03[_0x05d2('0x14')],_0x24a45f);_0x3861b3(_0x176e2e[_0x05d2('0x12')](0x1f4,_0x4ecc03[_0x05d2('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x465f6c){var _0x1739a2=this;return new Promise(function(_0x5c9985,_0x3e40f5){return db[_0x05d2('0x17')][_0x05d2('0x1c')](_0x465f6c[_0x05d2('0x19')],{'raw':_0x465f6c[_0x05d2('0x1a')]?_0x465f6c[_0x05d2('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x465f6c['options']?_0x465f6c['options'][_0x05d2('0x1d')]||null:null,'attributes':_0x465f6c['options']?_0x465f6c['options'][_0x05d2('0x1e')]||null:null,'limit':_0x465f6c['options']?_0x465f6c[_0x05d2('0x1a')]['limit']||null:null})[_0x05d2('0x1f')](function(_0x34cf36){logger[_0x05d2('0xc')](_0x05d2('0x20'),_0x465f6c);logger[_0x05d2('0xe')](_0x05d2('0x20'),_0x465f6c,JSON[_0x05d2('0x11')](_0x34cf36));_0x5c9985(_0x34cf36);})['catch'](function(_0x371414){logger[_0x05d2('0x12')](_0x05d2('0x20'),_0x371414[_0x05d2('0x14')],_0x465f6c);_0x3e40f5(_0x1739a2[_0x05d2('0x12')](0x1f4,_0x371414['message']));});});}; \ No newline at end of file +var _0x9256=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','attributes','limit','bluebird','randomstring'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0x9256,0xf1));var _0x6925=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9256[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6925('0x0'));var rs=require(_0x6925('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6925('0x2'))['db'];var utils=require(_0x6925('0x3'));var logger=require(_0x6925('0x4'))('rpc');var config=require(_0x6925('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52f1dc,_0x5c822c,_0x2f8d8a){return new BPromise(function(_0x26de19,_0x345366){return client[_0x6925('0x6')](_0x52f1dc,_0x2f8d8a)[_0x6925('0x7')](function(_0x88407e){logger[_0x6925('0x8')](_0x6925('0x9'),_0x5c822c,_0x6925('0xa'));logger[_0x6925('0xb')](_0x6925('0xc'),_0x5c822c,_0x6925('0xa'),JSON[_0x6925('0xd')](_0x88407e));if(_0x88407e[_0x6925('0xe')]){if(_0x88407e[_0x6925('0xe')]['code']===0x1f4){logger[_0x6925('0xe')](_0x6925('0x9'),_0x5c822c,_0x88407e[_0x6925('0xe')][_0x6925('0xf')]);return _0x345366(_0x88407e[_0x6925('0xe')][_0x6925('0xf')]);}logger[_0x6925('0xe')](_0x6925('0x9'),_0x5c822c,_0x88407e[_0x6925('0xe')][_0x6925('0xf')]);return _0x26de19(_0x88407e[_0x6925('0xe')][_0x6925('0xf')]);}else{logger[_0x6925('0x8')](_0x6925('0x9'),_0x5c822c,_0x6925('0xa'));_0x26de19(_0x88407e[_0x6925('0x10')][_0x6925('0xf')]);}})[_0x6925('0x11')](function(_0x5f2854){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x5c822c,_0x5f2854);_0x345366(_0x5f2854);});});}exports[_0x6925('0x12')]=function(_0x4658c9){var _0x8574c0=this;return new Promise(function(_0xfd57ba,_0x1a595b){return db[_0x6925('0x13')][_0x6925('0x14')](_0x4658c9[_0x6925('0x15')],{'raw':_0x4658c9[_0x6925('0x16')]?_0x4658c9['options'][_0x6925('0x17')]===undefined?!![]:![]:!![]})[_0x6925('0x7')](function(_0x121ce0){logger[_0x6925('0x8')](_0x6925('0x12'),_0x4658c9);logger[_0x6925('0xb')](_0x6925('0x12'),_0x4658c9,JSON[_0x6925('0xd')](_0x121ce0));_0xfd57ba(_0x121ce0);})[_0x6925('0x11')](function(_0x51e125){logger[_0x6925('0xe')](_0x6925('0x12'),_0x51e125[_0x6925('0xf')],_0x4658c9);_0x1a595b(_0x8574c0[_0x6925('0xe')](0x1f4,_0x51e125['message']));});});};exports[_0x6925('0x18')]=function(_0x1655a6){var _0xa7e21a=this;return new Promise(function(_0x44a4df,_0x3a066a){return db['VoiceAgentReport']['update'](_0x1655a6['body'],{'raw':_0x1655a6[_0x6925('0x16')]?_0x1655a6['options'][_0x6925('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1655a6[_0x6925('0x16')]?_0x1655a6['options']['where']||null:null,'attributes':_0x1655a6[_0x6925('0x16')]?_0x1655a6[_0x6925('0x16')][_0x6925('0x19')]||null:null,'limit':_0x1655a6[_0x6925('0x16')]?_0x1655a6[_0x6925('0x16')][_0x6925('0x1a')]||null:null})['then'](function(_0x5c282d){logger[_0x6925('0x8')]('UpdateVoiceAgentReport',_0x1655a6);logger[_0x6925('0xb')](_0x6925('0x18'),_0x1655a6,JSON[_0x6925('0xd')](_0x5c282d));_0x44a4df(_0x5c282d);})[_0x6925('0x11')](function(_0x4fdc27){logger[_0x6925('0xe')](_0x6925('0x18'),_0x4fdc27[_0x6925('0xf')],_0x1655a6);_0x3a066a(_0xa7e21a[_0x6925('0xe')](0x1f4,_0x4fdc27[_0x6925('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index c4a8af9..da87e93 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 _0x826a=['post','create','put','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x52e9ca,_0x7cb2e7){var _0x3fd68c=function(_0x2b4889){while(--_0x2b4889){_0x52e9ca['push'](_0x52e9ca['shift']());}};_0x3fd68c(++_0x7cb2e7);}(_0x826a,0x1aa));var _0xa826=function(_0x558e5f,_0x552932){_0x558e5f=_0x558e5f-0x0;var _0x5a696d=_0x826a[_0x558e5f];return _0x5a696d;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var fs_extra=require(_0xa826('0x3'));var auth=require(_0xa826('0x4'));var interaction=require(_0xa826('0x5'));var config=require('../../config/environment');var controller=require(_0xa826('0x6'));router[_0xa826('0x7')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0x9')]);router[_0xa826('0x7')](_0xa826('0xa'),auth[_0xa826('0x8')](),controller[_0xa826('0xb')]);router[_0xa826('0x7')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0xd')]);router[_0xa826('0xe')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0xf')]);router[_0xa826('0x10')]('/:id',auth[_0xa826('0x8')](),controller['update']);router[_0xa826('0x11')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0x12')]);module[_0xa826('0x13')]=router; \ No newline at end of file +var _0x9a19=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x4741bc,_0x250493){var _0x5c8a1c=function(_0x4b53bc){while(--_0x4b53bc){_0x4741bc['push'](_0x4741bc['shift']());}};_0x5c8a1c(++_0x250493);}(_0x9a19,0x114));var _0x99a1=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x9a19[_0x4c6d6f];return _0x2d4478;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var fs_extra=require(_0x99a1('0x5'));var auth=require(_0x99a1('0x6'));var interaction=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router[_0x99a1('0xa')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xc')]);router[_0x99a1('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x99a1('0xa')](_0x99a1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x99a1('0xe')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x10')](_0x99a1('0xd'),auth['isAuthenticated'](),controller[_0x99a1('0x11')]);router[_0x99a1('0x12')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x13')]);module[_0x99a1('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 549a93d..2186a60 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 _0x4a7b=['inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0x4a7b,0x81));var _0xb4a7=function(_0x38cac4,_0x458c82){_0x38cac4=_0x38cac4-0x0;var _0x1fa570=_0x4a7b[_0x38cac4];return _0x1fa570;};'use strict';var Sequelize=require(_0xb4a7('0x0'));module[_0xb4a7('0x1')]={'uniqueid':{'type':Sequelize[_0xb4a7('0x2')]},'type':{'type':Sequelize['ENUM'](_0xb4a7('0x3'),_0xb4a7('0x4'),_0xb4a7('0x5'),_0xb4a7('0x6'),_0xb4a7('0x7'),_0xb4a7('0x8'))},'tag':{'type':Sequelize[_0xb4a7('0x2')]},'accountcode':{'type':Sequelize[_0xb4a7('0x2')]},'source':{'type':Sequelize[_0xb4a7('0x2')]},'destination':{'type':Sequelize[_0xb4a7('0x2')]},'destinationcontext':{'type':Sequelize[_0xb4a7('0x2')]},'callerid':{'type':Sequelize[_0xb4a7('0x2')]},'channel':{'type':Sequelize[_0xb4a7('0x2')]},'destinationchannel':{'type':Sequelize[_0xb4a7('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xb4a7('0x9')]},'starttime':{'type':Sequelize[_0xb4a7('0xa')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb4a7('0xa')]},'endtime':{'type':Sequelize[_0xb4a7('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xb4a7('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb4a7('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xb4a7('0x2')]},'userDisposition':{'type':Sequelize[_0xb4a7('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xb4a7('0x2')]},'note':{'type':Sequelize[_0xb4a7('0x2')]},'prefix':{'type':Sequelize[_0xb4a7('0x2')]},'routeid':{'type':Sequelize[_0xb4a7('0xb')]},'sipcallid':{'type':Sequelize[_0xb4a7('0x2')]}}; \ No newline at end of file +var _0xab9c=['dialer','TEXT','DATE','INTEGER','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x5caf94,_0x1310ab){var _0x33dc6e=function(_0x1cf75c){while(--_0x1cf75c){_0x5caf94['push'](_0x5caf94['shift']());}};_0x33dc6e(++_0x1310ab);}(_0xab9c,0xd0));var _0xcab9=function(_0xb61a78,_0x4397e2){_0xb61a78=_0xb61a78-0x0;var _0x5946e4=_0xab9c[_0xb61a78];return _0x5946e4;};'use strict';var Sequelize=require('sequelize');module[_0xcab9('0x0')]={'uniqueid':{'type':Sequelize[_0xcab9('0x1')]},'type':{'type':Sequelize[_0xcab9('0x2')](_0xcab9('0x3'),_0xcab9('0x4'),_0xcab9('0x5'),_0xcab9('0x6'),_0xcab9('0x7'),_0xcab9('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcab9('0x1')]},'source':{'type':Sequelize[_0xcab9('0x1')]},'destination':{'type':Sequelize[_0xcab9('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xcab9('0x1')]},'channel':{'type':Sequelize[_0xcab9('0x1')]},'destinationchannel':{'type':Sequelize[_0xcab9('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xcab9('0x9')]},'starttime':{'type':Sequelize[_0xcab9('0xa')]},'systemanswertime':{'type':Sequelize[_0xcab9('0xa')]},'answertime':{'type':Sequelize[_0xcab9('0xa')]},'endtime':{'type':Sequelize[_0xcab9('0xa')]},'duration':{'type':Sequelize[_0xcab9('0xb')]},'billableseconds':{'type':Sequelize[_0xcab9('0xb')]},'mohtime':{'type':Sequelize[_0xcab9('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xcab9('0x1')]},'amaflags':{'type':Sequelize[_0xcab9('0x1')]},'userfield':{'type':Sequelize[_0xcab9('0x1')]},'userDisposition':{'type':Sequelize[_0xcab9('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xcab9('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xcab9('0x1')]},'note':{'type':Sequelize[_0xcab9('0x1')]},'prefix':{'type':Sequelize[_0xcab9('0x1')]},'routeid':{'type':Sequelize[_0xcab9('0xb')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 3eeabf3..16eaf3b 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x1789d9,_0x49ea00){var _0x1c8400=function(_0x37c661){while(--_0x37c661){_0x1789d9['push'](_0x1789d9['shift']());}};_0x1c8400(++_0x49ea00);}(_0xdb28,0x106));var _0x8db2=function(_0x56e67c,_0x35efde){_0x56e67c=_0x56e67c-0x0;var _0x15b330=_0xdb28[_0x56e67c];return _0x15b330;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 302bc48..05bfeac 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 _0x57b7=['moment','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x57b7,0x184));var _0x757b=function(_0x350047,_0x1df790){_0x350047=_0x350047-0x0;var _0x3e33f9=_0x57b7[_0x350047];return _0x3e33f9;};'use strict';var _=require(_0x757b('0x0'));var util=require(_0x757b('0x1'));var logger=require(_0x757b('0x2'))(_0x757b('0x3'));var moment=require(_0x757b('0x4'));var BPromise=require('bluebird');var rp=require(_0x757b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x757b('0x6'));var config=require(_0x757b('0x7'));var attributes=require(_0x757b('0x8'));module[_0x757b('0x9')]=function(_0x40c404,_0x3bb6f6){return _0x40c404[_0x757b('0xa')](_0x757b('0xb'),attributes,{'tableName':_0x757b('0xc'),'paranoid':![],'indexes':[{'fields':[_0x757b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xccb9=['define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x471dcc,_0x28d02e){var _0x578b40=function(_0x59a8a9){while(--_0x59a8a9){_0x471dcc['push'](_0x471dcc['shift']());}};_0x578b40(++_0x28d02e);}(_0xccb9,0x124));var _0x9ccb=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xccb9[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x9ccb('0x0'));var util=require('util');var logger=require(_0x9ccb('0x1'))(_0x9ccb('0x2'));var moment=require(_0x9ccb('0x3'));var BPromise=require(_0x9ccb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ccb('0x5'));var rimraf=require(_0x9ccb('0x6'));var config=require(_0x9ccb('0x7'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x453264,_0x273f4e){return _0x453264[_0x9ccb('0x8')](_0x9ccb('0x9'),attributes,{'tableName':_0x9ccb('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9ccb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 9f158e1..59c6acc 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 _0xacc2=['VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceCallReport','options','raw','where','attributes','include','map','model','GetVoiceCallReport','create','body','then','CreateVoiceCallReport','UpdateVoiceCallReport','update','limit','lodash','util','randomstring','../../mysqldb','rpc','jayson/promise','client','http','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x36237a,_0x18df4a){var _0x40fb5c=function(_0x2dc153){while(--_0x2dc153){_0x36237a['push'](_0x36237a['shift']());}};_0x40fb5c(++_0x18df4a);}(_0xacc2,0x126));var _0x2acc=function(_0x4f0d1a,_0x49fe8f){_0x4f0d1a=_0x4f0d1a-0x0;var _0x3072ef=_0xacc2[_0x4f0d1a];return _0x3072ef;};'use strict';var _=require(_0x2acc('0x0'));var util=require(_0x2acc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2acc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2acc('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2acc('0x4'));var config=require('../../config/environment');var jayson=require(_0x2acc('0x5'));var client=jayson[_0x2acc('0x6')][_0x2acc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16f8f2,_0x36fc6f,_0x4cec40){return new BPromise(function(_0x3c9e7f,_0x4aff24){return client['request'](_0x16f8f2,_0x4cec40)['then'](function(_0x4164f9){logger[_0x2acc('0x8')](_0x2acc('0x9'),_0x36fc6f,_0x2acc('0xa'));logger[_0x2acc('0xb')](_0x2acc('0xc'),_0x36fc6f,_0x2acc('0xa'),JSON[_0x2acc('0xd')](_0x4164f9));if(_0x4164f9[_0x2acc('0xe')]){if(_0x4164f9[_0x2acc('0xe')]['code']===0x1f4){logger[_0x2acc('0xe')](_0x2acc('0x9'),_0x36fc6f,_0x4164f9[_0x2acc('0xe')]['message']);return _0x4aff24(_0x4164f9[_0x2acc('0xe')][_0x2acc('0xf')]);}logger[_0x2acc('0xe')](_0x2acc('0x9'),_0x36fc6f,_0x4164f9['error'][_0x2acc('0xf')]);return _0x3c9e7f(_0x4164f9[_0x2acc('0xe')][_0x2acc('0xf')]);}else{logger[_0x2acc('0x8')](_0x2acc('0x9'),_0x36fc6f,_0x2acc('0xa'));_0x3c9e7f(_0x4164f9[_0x2acc('0x10')][_0x2acc('0xf')]);}})[_0x2acc('0x11')](function(_0x436e48){logger[_0x2acc('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x36fc6f,_0x436e48);_0x4aff24(_0x436e48);});});}exports['GetVoiceCallReport']=function(_0x24b7b4){var _0xbc0de4=this;return new Promise(function(_0x587c5e,_0x49ed62){return db[_0x2acc('0x12')]['findAll']({'raw':_0x24b7b4[_0x2acc('0x13')]?_0x24b7b4[_0x2acc('0x13')][_0x2acc('0x14')]===undefined?!![]:![]:!![],'where':_0x24b7b4[_0x2acc('0x13')]?_0x24b7b4['options'][_0x2acc('0x15')]||null:null,'attributes':_0x24b7b4[_0x2acc('0x13')]?_0x24b7b4['options'][_0x2acc('0x16')]||null:null,'limit':_0x24b7b4[_0x2acc('0x13')]?_0x24b7b4[_0x2acc('0x13')]['limit']||null:null,'include':_0x24b7b4['options']?_0x24b7b4[_0x2acc('0x13')][_0x2acc('0x17')]?_[_0x2acc('0x18')](_0x24b7b4[_0x2acc('0x13')][_0x2acc('0x17')],function(_0x62f699){return{'model':db[_0x62f699[_0x2acc('0x19')]],'as':_0x62f699['as'],'attributes':_0x62f699[_0x2acc('0x16')],'include':_0x62f699[_0x2acc('0x17')]?_['map'](_0x62f699['include'],function(_0x1a03a4){return{'model':db[_0x1a03a4['model']],'as':_0x1a03a4['as'],'attributes':_0x1a03a4['attributes'],'include':_0x1a03a4[_0x2acc('0x17')]?_[_0x2acc('0x18')](_0x1a03a4[_0x2acc('0x17')],function(_0x36b10f){return{'model':db[_0x36b10f[_0x2acc('0x19')]],'as':_0x36b10f['as'],'attributes':_0x36b10f[_0x2acc('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56626f){logger[_0x2acc('0x8')](_0x2acc('0x1a'),_0x24b7b4);logger[_0x2acc('0xb')](_0x2acc('0x1a'),_0x24b7b4,JSON[_0x2acc('0xd')](_0x56626f));_0x587c5e(_0x56626f);})[_0x2acc('0x11')](function(_0x29f91b){logger[_0x2acc('0xe')](_0x2acc('0x1a'),_0x29f91b[_0x2acc('0xf')],_0x24b7b4);_0x49ed62(_0xbc0de4['error'](0x1f4,_0x29f91b[_0x2acc('0xf')]));});});};exports['CreateVoiceCallReport']=function(_0x499bec){var _0x3edd03=this;return new Promise(function(_0x585a6a,_0x52fc25){return db[_0x2acc('0x12')][_0x2acc('0x1b')](_0x499bec[_0x2acc('0x1c')],{'raw':_0x499bec['options']?_0x499bec[_0x2acc('0x13')][_0x2acc('0x14')]===undefined?!![]:![]:!![]})[_0x2acc('0x1d')](function(_0x550ce6){logger[_0x2acc('0x8')](_0x2acc('0x1e'),_0x499bec);logger[_0x2acc('0xb')](_0x2acc('0x1e'),_0x499bec,JSON[_0x2acc('0xd')](_0x550ce6));_0x585a6a(_0x550ce6);})['catch'](function(_0x19d2fd){logger[_0x2acc('0xe')](_0x2acc('0x1e'),_0x19d2fd['message'],_0x499bec);_0x52fc25(_0x3edd03[_0x2acc('0xe')](0x1f4,_0x19d2fd['message']));});});};exports[_0x2acc('0x1f')]=function(_0x212049){var _0x377420=this;return new Promise(function(_0x645333,_0x1a9d45){return db[_0x2acc('0x12')][_0x2acc('0x20')](_0x212049[_0x2acc('0x1c')],{'raw':_0x212049['options']?_0x212049['options'][_0x2acc('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x212049[_0x2acc('0x13')]?_0x212049[_0x2acc('0x13')][_0x2acc('0x15')]||null:null,'attributes':_0x212049[_0x2acc('0x13')]?_0x212049[_0x2acc('0x13')]['attributes']||null:null,'limit':_0x212049['options']?_0x212049[_0x2acc('0x13')][_0x2acc('0x21')]||null:null})['then'](function(_0x1c0c23){logger[_0x2acc('0x8')](_0x2acc('0x1f'),_0x212049);logger['debug'](_0x2acc('0x1f'),_0x212049,JSON[_0x2acc('0xd')](_0x1c0c23));_0x645333(_0x1c0c23);})[_0x2acc('0x11')](function(_0x1e1ae6){logger['error']('UpdateVoiceCallReport',_0x1e1ae6[_0x2acc('0xf')],_0x212049);_0x1a9d45(_0x377420[_0x2acc('0xe')](0x1f4,_0x1e1ae6[_0x2acc('0xf')]));});});}; \ No newline at end of file +var _0xa23b=['catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','model','map','CreateVoiceCallReport','UpdateVoiceCallReport','update','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x38ae97,_0x2a2b73){var _0x503914=function(_0xdbfc93){while(--_0xdbfc93){_0x38ae97['push'](_0x38ae97['shift']());}};_0x503914(++_0x2a2b73);}(_0xa23b,0x18b));var _0xba23=function(_0x24718b,_0x5433aa){_0x24718b=_0x24718b-0x0;var _0x59ecd3=_0xa23b[_0x24718b];return _0x59ecd3;};'use strict';var _=require(_0xba23('0x0'));var util=require(_0xba23('0x1'));var moment=require(_0xba23('0x2'));var BPromise=require('bluebird');var rs=require(_0xba23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba23('0x4'))['db'];var utils=require(_0xba23('0x5'));var logger=require(_0xba23('0x6'))(_0xba23('0x7'));var config=require(_0xba23('0x8'));var jayson=require(_0xba23('0x9'));var client=jayson[_0xba23('0xa')][_0xba23('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x283cae,_0x11c9f1,_0x1903d0){return new BPromise(function(_0x214948,_0x1a5873){return client[_0xba23('0xc')](_0x283cae,_0x1903d0)[_0xba23('0xd')](function(_0xb5274c){logger[_0xba23('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x11c9f1,'request\x20sent');logger[_0xba23('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x11c9f1,'request\x20sent',JSON[_0xba23('0x10')](_0xb5274c));if(_0xb5274c[_0xba23('0x11')]){if(_0xb5274c[_0xba23('0x11')][_0xba23('0x12')]===0x1f4){logger[_0xba23('0x11')](_0xba23('0x13'),_0x11c9f1,_0xb5274c[_0xba23('0x11')][_0xba23('0x14')]);return _0x1a5873(_0xb5274c[_0xba23('0x11')][_0xba23('0x14')]);}logger[_0xba23('0x11')](_0xba23('0x13'),_0x11c9f1,_0xb5274c[_0xba23('0x11')]['message']);return _0x214948(_0xb5274c[_0xba23('0x11')]['message']);}else{logger[_0xba23('0xe')](_0xba23('0x13'),_0x11c9f1,_0xba23('0x15'));_0x214948(_0xb5274c[_0xba23('0x16')][_0xba23('0x14')]);}})[_0xba23('0x17')](function(_0x34225f){logger[_0xba23('0x11')](_0xba23('0x13'),_0x11c9f1,_0x34225f);_0x1a5873(_0x34225f);});});}exports[_0xba23('0x18')]=function(_0x5f3c9f){var _0x446932=this;return new Promise(function(_0x325a11,_0x357349){return db[_0xba23('0x19')][_0xba23('0x1a')]({'raw':_0x5f3c9f['options']?_0x5f3c9f[_0xba23('0x1b')][_0xba23('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f3c9f['options']?_0x5f3c9f[_0xba23('0x1b')][_0xba23('0x1d')]||null:null,'attributes':_0x5f3c9f[_0xba23('0x1b')]?_0x5f3c9f['options'][_0xba23('0x1e')]||null:null,'limit':_0x5f3c9f[_0xba23('0x1b')]?_0x5f3c9f[_0xba23('0x1b')]['limit']||null:null,'include':_0x5f3c9f[_0xba23('0x1b')]?_0x5f3c9f[_0xba23('0x1b')][_0xba23('0x1f')]?_['map'](_0x5f3c9f[_0xba23('0x1b')]['include'],function(_0x516ccc){return{'model':db[_0x516ccc[_0xba23('0x20')]],'as':_0x516ccc['as'],'attributes':_0x516ccc['attributes'],'include':_0x516ccc['include']?_[_0xba23('0x21')](_0x516ccc[_0xba23('0x1f')],function(_0xbd5008){return{'model':db[_0xbd5008[_0xba23('0x20')]],'as':_0xbd5008['as'],'attributes':_0xbd5008[_0xba23('0x1e')],'include':_0xbd5008['include']?_['map'](_0xbd5008[_0xba23('0x1f')],function(_0x21c287){return{'model':db[_0x21c287[_0xba23('0x20')]],'as':_0x21c287['as'],'attributes':_0x21c287[_0xba23('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5746b7){logger[_0xba23('0xe')](_0xba23('0x18'),_0x5f3c9f);logger['debug']('GetVoiceCallReport',_0x5f3c9f,JSON['stringify'](_0x5746b7));_0x325a11(_0x5746b7);})[_0xba23('0x17')](function(_0x4a17c2){logger[_0xba23('0x11')](_0xba23('0x18'),_0x4a17c2[_0xba23('0x14')],_0x5f3c9f);_0x357349(_0x446932['error'](0x1f4,_0x4a17c2['message']));});});};exports[_0xba23('0x22')]=function(_0xa34b6){var _0xcbbc4f=this;return new Promise(function(_0x52a4ff,_0x58004b){return db['VoiceCallReport']['create'](_0xa34b6['body'],{'raw':_0xa34b6[_0xba23('0x1b')]?_0xa34b6[_0xba23('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x423c20){logger[_0xba23('0xe')](_0xba23('0x22'),_0xa34b6);logger[_0xba23('0xf')]('CreateVoiceCallReport',_0xa34b6,JSON[_0xba23('0x10')](_0x423c20));_0x52a4ff(_0x423c20);})[_0xba23('0x17')](function(_0x368984){logger[_0xba23('0x11')]('CreateVoiceCallReport',_0x368984[_0xba23('0x14')],_0xa34b6);_0x58004b(_0xcbbc4f[_0xba23('0x11')](0x1f4,_0x368984[_0xba23('0x14')]));});});};exports[_0xba23('0x23')]=function(_0x1d18e8){var _0x2508a9=this;return new Promise(function(_0x11feae,_0x1e3317){return db[_0xba23('0x19')][_0xba23('0x24')](_0x1d18e8['body'],{'raw':_0x1d18e8[_0xba23('0x1b')]?_0x1d18e8['options'][_0xba23('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d18e8['options']?_0x1d18e8[_0xba23('0x1b')]['where']||null:null,'attributes':_0x1d18e8[_0xba23('0x1b')]?_0x1d18e8[_0xba23('0x1b')][_0xba23('0x1e')]||null:null,'limit':_0x1d18e8[_0xba23('0x1b')]?_0x1d18e8[_0xba23('0x1b')][_0xba23('0x25')]||null:null})['then'](function(_0x4e23f6){logger[_0xba23('0xe')](_0xba23('0x23'),_0x1d18e8);logger[_0xba23('0xf')](_0xba23('0x23'),_0x1d18e8,JSON[_0xba23('0x10')](_0x4e23f6));_0x11feae(_0x4e23f6);})['catch'](function(_0x5410b1){logger['error']('UpdateVoiceCallReport',_0x5410b1[_0xba23('0x14')],_0x1d18e8);_0x1e3317(_0x2508a9[_0xba23('0x11')](0x1f4,_0x5410b1['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index db2defc..9937848 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 _0x5a3c=['update','delete','/:id','destroy','exports','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','index','show','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a3c,0x1ef));var _0xc5a3=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x5a3c[_0x341e0f];return _0x59555a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc5a3('0x0'));var express=require('express');var router=express[_0xc5a3('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc5a3('0x2'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0xc5a3('0x3')]('/',auth[_0xc5a3('0x4')](),controller[_0xc5a3('0x5')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc5a3('0x6')]);router['post']('/',auth[_0xc5a3('0x4')](),controller[_0xc5a3('0x7')]);router[_0xc5a3('0x8')]('/:id',auth[_0xc5a3('0x4')](),controller[_0xc5a3('0x9')]);router[_0xc5a3('0xa')](_0xc5a3('0xb'),auth[_0xc5a3('0x4')](),controller[_0xc5a3('0xc')]);module[_0xc5a3('0xd')]=router; \ No newline at end of file +var _0x7e10=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','index','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x7e10,0x78));var _0x07e1=function(_0x285f10,_0x2e6e7d){_0x285f10=_0x285f10-0x0;var _0x5804d4=_0x7e10[_0x285f10];return _0x5804d4;};'use strict';var multer=require(_0x07e1('0x0'));var util=require(_0x07e1('0x1'));var path=require('path');var timeout=require(_0x07e1('0x2'));var express=require('express');var router=express[_0x07e1('0x3')]();var fs_extra=require(_0x07e1('0x4'));var auth=require(_0x07e1('0x5'));var interaction=require(_0x07e1('0x6'));var config=require(_0x07e1('0x7'));var controller=require(_0x07e1('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x07e1('0x9')]);router[_0x07e1('0xa')]('/:id',auth[_0x07e1('0xb')](),controller[_0x07e1('0xc')]);router[_0x07e1('0xd')]('/',auth['isAuthenticated'](),controller[_0x07e1('0xe')]);router[_0x07e1('0xf')](_0x07e1('0x10'),auth[_0x07e1('0xb')](),controller['update']);router[_0x07e1('0x11')](_0x07e1('0x10'),auth[_0x07e1('0xb')](),controller[_0x07e1('0x12')]);module[_0x07e1('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index fb04343..d8208f3 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 _0x8d75=['options','split','BOOLEAN','sequelize','STRING','name','getDataValue'];(function(_0x5cc383,_0x25b105){var _0x47069e=function(_0x5242b9){while(--_0x5242b9){_0x5cc383['push'](_0x5cc383['shift']());}};_0x47069e(++_0x25b105);}(_0x8d75,0x7a));var _0x58d7=function(_0x524311,_0x385e89){_0x524311=_0x524311-0x0;var _0x29aaf3=_0x8d75[_0x524311];return _0x29aaf3;};'use strict';var Sequelize=require(_0x58d7('0x0'));module['exports']={'name':{'type':Sequelize[_0x58d7('0x1')]},'prefix':{'type':Sequelize[_0x58d7('0x1')],'unique':_0x58d7('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0xde16b4){this['setDataValue']('options',_0xde16b4?_0xde16b4['join'](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x58d7('0x3')](_0x58d7('0x4'))[_0x58d7('0x5')](''):[];}},'auth':{'type':Sequelize[_0x58d7('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x58d7('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x58d7('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x63c8=['setDataValue','options','join','getDataValue','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x5bc777,_0xd25a32){var _0x50ff29=function(_0x37e012){while(--_0x37e012){_0x5bc777['push'](_0x5bc777['shift']());}};_0x50ff29(++_0xd25a32);}(_0x63c8,0x176));var _0x863c=function(_0x198772,_0x2ea3a0){_0x198772=_0x198772-0x0;var _0x3beeeb=_0x63c8[_0x198772];return _0x3beeeb;};'use strict';var Sequelize=require(_0x863c('0x0'));module[_0x863c('0x1')]={'name':{'type':Sequelize[_0x863c('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x863c('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x423e5e){this[_0x863c('0x4')](_0x863c('0x5'),_0x423e5e?_0x423e5e[_0x863c('0x6')](''):[]);},'get':function(){return this[_0x863c('0x7')](_0x863c('0x5'))?this[_0x863c('0x7')](_0x863c('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0x863c('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x863c('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x863c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 4005c20..7bac394 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 _0x7ec2=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','error','stack','name','index','map','VoiceChanSpy','rawAttributes','type','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x23834d,_0x3fc73b){var _0x1cd525=function(_0x3fd45a){while(--_0x3fd45a){_0x23834d['push'](_0x23834d['shift']());}};_0x1cd525(++_0x3fc73b);}(_0x7ec2,0x15c));var _0x27ec=function(_0x4a51cc,_0x147ad5){_0x4a51cc=_0x4a51cc-0x0;var _0x4b73f7=_0x7ec2[_0x4a51cc];return _0x4b73f7;};'use strict';var emlformat=require(_0x27ec('0x0'));var rimraf=require(_0x27ec('0x1'));var zipdir=require(_0x27ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27ec('0x3'));var moment=require(_0x27ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x27ec('0x5'));var util=require(_0x27ec('0x6'));var path=require(_0x27ec('0x7'));var sox=require(_0x27ec('0x8'));var csv=require(_0x27ec('0x9'));var ejs=require(_0x27ec('0xa'));var fs=require('fs');var fs_extra=require(_0x27ec('0xb'));var _=require(_0x27ec('0xc'));var squel=require(_0x27ec('0xd'));var crypto=require(_0x27ec('0xe'));var jsforce=require(_0x27ec('0xf'));var deskjs=require(_0x27ec('0x10'));var toCsv=require(_0x27ec('0x9'));var querystring=require(_0x27ec('0x11'));var Papa=require(_0x27ec('0x12'));var Redis=require(_0x27ec('0x13'));var authService=require(_0x27ec('0x14'));var qs=require(_0x27ec('0x15'));var as=require(_0x27ec('0x16'));var hardwareService=require(_0x27ec('0x17'));var logger=require(_0x27ec('0x18'))('api');var utils=require(_0x27ec('0x19'));var config=require(_0x27ec('0x1a'));var licenseUtil=require(_0x27ec('0x1b'));var db=require(_0x27ec('0x1c'))['db'];function respondWithStatusCode(_0x5b3e08,_0x472020){_0x472020=_0x472020||0xcc;return function(_0x4efa3d){if(_0x4efa3d){return _0x5b3e08[_0x27ec('0x1d')](_0x472020);}return _0x5b3e08[_0x27ec('0x1e')](_0x472020)[_0x27ec('0x1f')]();};}function respondWithResult(_0x317d46,_0x29174c){_0x29174c=_0x29174c||0xc8;return function(_0x14cde9){if(_0x14cde9){return _0x317d46[_0x27ec('0x1e')](_0x29174c)['json'](_0x14cde9);}};}function respondWithFilteredResult(_0x7dbca5,_0x1d75b1){return function(_0x486dae){if(_0x486dae){var _0x56bf7d=typeof _0x1d75b1[_0x27ec('0x20')]==='undefined'&&typeof _0x1d75b1[_0x27ec('0x21')]===_0x27ec('0x22');var _0x4209c9=_0x486dae[_0x27ec('0x23')];var _0x54b2c9=_0x56bf7d?0x0:_0x1d75b1[_0x27ec('0x20')];var _0x389425=_0x56bf7d?_0x486dae[_0x27ec('0x23')]:_0x1d75b1['offset']+_0x1d75b1[_0x27ec('0x21')];var _0x16dc74;if(_0x389425>=_0x4209c9){_0x389425=_0x4209c9;_0x16dc74=0xc8;}else{_0x16dc74=0xce;}_0x7dbca5['status'](_0x16dc74);return _0x7dbca5[_0x27ec('0x24')](_0x27ec('0x25'),_0x54b2c9+'-'+_0x389425+'/'+_0x4209c9)['json'](_0x486dae);}return null;};}function patchUpdates(_0x582cec){return function(_0x2ad3be){try{jsonpatch[_0x27ec('0x26')](_0x2ad3be,_0x582cec,!![]);}catch(_0x24979d){return BPromise[_0x27ec('0x27')](_0x24979d);}return _0x2ad3be[_0x27ec('0x28')]();};}function saveUpdates(_0x4b7f24,_0x19fe3f){return function(_0x1ba9c8){if(_0x1ba9c8){return _0x1ba9c8[_0x27ec('0x29')](_0x4b7f24)[_0x27ec('0x2a')](function(_0x4e4532){return _0x4e4532;});}return null;};}function removeEntity(_0x4eba78,_0x217036){return function(_0x5d5fbe){if(_0x5d5fbe){return _0x5d5fbe[_0x27ec('0x2b')]()[_0x27ec('0x2a')](function(){var _0x4810ed=_0x5d5fbe[_0x27ec('0x2c')]({'plain':!![]});var _0xb958c0=_0x27ec('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0xb958c0,'resourceId':_0x4810ed['id']}})[_0x27ec('0x2a')](function(){return _0x5d5fbe;});})['then'](function(){_0x4eba78['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4911f6,_0x44a2e4){return function(_0xf1ee48){if(!_0xf1ee48){_0x4911f6[_0x27ec('0x1d')](0x194);}return _0xf1ee48;};}function handleError(_0x299ecf,_0x3dfc07){_0x3dfc07=_0x3dfc07||0x1f4;return function(_0x23cfe3){logger[_0x27ec('0x2e')](_0x23cfe3[_0x27ec('0x2f')]);if(_0x23cfe3['name']){delete _0x23cfe3[_0x27ec('0x30')];}_0x299ecf[_0x27ec('0x1e')](_0x3dfc07)['send'](_0x23cfe3);};}exports[_0x27ec('0x31')]=function(_0x389389,_0x45d2df){var _0x34138d={},_0xf8c72={},_0x3a564a={'count':0x0,'rows':[]};var _0x2d879b=_[_0x27ec('0x32')](db[_0x27ec('0x33')][_0x27ec('0x34')],function(_0x1e5494){return{'name':_0x1e5494['fieldName'],'type':_0x1e5494[_0x27ec('0x35')]['key']};});_0xf8c72['model']=_[_0x27ec('0x32')](_0x2d879b,_0x27ec('0x30'));_0xf8c72['query']=_[_0x27ec('0x36')](_0x389389[_0x27ec('0x37')]);_0xf8c72['filters']=_['intersection'](_0xf8c72[_0x27ec('0x38')],_0xf8c72[_0x27ec('0x37')]);_0x34138d['attributes']=_[_0x27ec('0x39')](_0xf8c72['model'],qs[_0x27ec('0x3a')](_0x389389['query'][_0x27ec('0x3a')]));_0x34138d[_0x27ec('0x3b')]=_0x34138d['attributes'][_0x27ec('0x3c')]?_0x34138d['attributes']:_0xf8c72[_0x27ec('0x38')];if(!_0x389389[_0x27ec('0x37')][_0x27ec('0x3d')](_0x27ec('0x3e'))){_0x34138d[_0x27ec('0x21')]=qs[_0x27ec('0x21')](_0x389389[_0x27ec('0x37')]['limit']);_0x34138d[_0x27ec('0x20')]=qs[_0x27ec('0x20')](_0x389389[_0x27ec('0x37')][_0x27ec('0x20')]);}_0x34138d[_0x27ec('0x3f')]=qs[_0x27ec('0x40')](_0x389389[_0x27ec('0x37')][_0x27ec('0x40')]);_0x34138d[_0x27ec('0x41')]=qs[_0x27ec('0x42')](_[_0x27ec('0x43')](_0x389389[_0x27ec('0x37')],_0xf8c72[_0x27ec('0x42')]),_0x2d879b);if(_0x389389[_0x27ec('0x37')][_0x27ec('0x44')]){_0x34138d[_0x27ec('0x41')]=_['merge'](_0x34138d[_0x27ec('0x41')],{'$or':_['map'](_0x2d879b,function(_0x1c9764){if(_0x1c9764[_0x27ec('0x35')]!=='VIRTUAL'){var _0x5794dc={};_0x5794dc[_0x1c9764[_0x27ec('0x30')]]={'$like':'%'+_0x389389[_0x27ec('0x37')]['filter']+'%'};return _0x5794dc;}})});}_0x34138d=_[_0x27ec('0x45')]({},_0x34138d,_0x389389[_0x27ec('0x46')]);var _0x121899={'where':_0x34138d[_0x27ec('0x41')]};return db[_0x27ec('0x33')][_0x27ec('0x23')](_0x121899)[_0x27ec('0x2a')](function(_0x33d820){_0x3a564a[_0x27ec('0x23')]=_0x33d820;if(_0x389389[_0x27ec('0x37')][_0x27ec('0x47')]){_0x34138d[_0x27ec('0x48')]=[{'all':!![]}];}return db[_0x27ec('0x33')][_0x27ec('0x49')](_0x34138d);})['then'](function(_0x4ce322){_0x3a564a[_0x27ec('0x4a')]=_0x4ce322;return _0x3a564a;})['then'](respondWithFilteredResult(_0x45d2df,_0x34138d))[_0x27ec('0x4b')](handleError(_0x45d2df,null));};exports[_0x27ec('0x4c')]=function(_0x16e9a1,_0x1904e5){var _0xacdf99={'raw':![],'where':{'id':_0x16e9a1[_0x27ec('0x4d')]['id']}},_0x1b2869={};_0x1b2869[_0x27ec('0x38')]=_['keys'](db[_0x27ec('0x33')][_0x27ec('0x34')]);_0x1b2869[_0x27ec('0x37')]=_[_0x27ec('0x36')](_0x16e9a1[_0x27ec('0x37')]);_0x1b2869[_0x27ec('0x42')]=_['intersection'](_0x1b2869[_0x27ec('0x38')],_0x1b2869[_0x27ec('0x37')]);_0xacdf99[_0x27ec('0x3b')]=_['intersection'](_0x1b2869[_0x27ec('0x38')],qs[_0x27ec('0x3a')](_0x16e9a1[_0x27ec('0x37')][_0x27ec('0x3a')]));_0xacdf99['attributes']=_0xacdf99[_0x27ec('0x3b')][_0x27ec('0x3c')]?_0xacdf99['attributes']:_0x1b2869[_0x27ec('0x38')];if(_0x16e9a1[_0x27ec('0x37')]['includeAll']){_0xacdf99[_0x27ec('0x48')]=[{'all':!![]}];}_0xacdf99=_[_0x27ec('0x45')]({},_0xacdf99,_0x16e9a1[_0x27ec('0x46')]);return db[_0x27ec('0x33')][_0x27ec('0x4e')](_0xacdf99)[_0x27ec('0x2a')](handleEntityNotFound(_0x1904e5,null))[_0x27ec('0x2a')](respondWithResult(_0x1904e5,null))[_0x27ec('0x4b')](handleError(_0x1904e5,null));};exports[_0x27ec('0x4f')]=function(_0x3d7ab0,_0x59e890){return db[_0x27ec('0x33')][_0x27ec('0x4f')](_0x3d7ab0[_0x27ec('0x50')],{})[_0x27ec('0x2a')](function(_0x4697eb){var _0x414352=_0x3d7ab0[_0x27ec('0x51')][_0x27ec('0x2c')]({'plain':!![]});if(!_0x414352)throw new Error(_0x27ec('0x52'));if(_0x414352[_0x27ec('0x53')]===_0x27ec('0x51')){var _0x2aa0d8=_0x4697eb[_0x27ec('0x2c')]({'plain':!![]});var _0x4890a7=_0x27ec('0x2d');return db[_0x27ec('0x54')][_0x27ec('0x4e')]({'where':{'name':_0x4890a7,'userProfileId':_0x414352[_0x27ec('0x55')]},'raw':!![]})[_0x27ec('0x2a')](function(_0x3d9679){if(_0x3d9679&&_0x3d9679[_0x27ec('0x56')]===0x0){return db[_0x27ec('0x57')]['create']({'name':_0x2aa0d8['name'],'resourceId':_0x2aa0d8['id'],'type':_0x3d9679['name'],'sectionId':_0x3d9679['id']},{})['then'](function(){return _0x4697eb;});}else{return _0x4697eb;}})[_0x27ec('0x4b')](function(_0x4d0205){logger[_0x27ec('0x2e')](_0x27ec('0x58'),_0x4d0205);throw _0x4d0205;});}return _0x4697eb;})[_0x27ec('0x2a')](respondWithResult(_0x59e890,0xc9))[_0x27ec('0x4b')](handleError(_0x59e890,null));};exports[_0x27ec('0x29')]=function(_0x20977d,_0x247535){if(_0x20977d[_0x27ec('0x50')]['id']){delete _0x20977d[_0x27ec('0x50')]['id'];}return db[_0x27ec('0x33')][_0x27ec('0x4e')]({'where':{'id':_0x20977d['params']['id']}})[_0x27ec('0x2a')](handleEntityNotFound(_0x247535,null))[_0x27ec('0x2a')](saveUpdates(_0x20977d[_0x27ec('0x50')],null))[_0x27ec('0x2a')](respondWithResult(_0x247535,null))['catch'](handleError(_0x247535,null));};exports[_0x27ec('0x2b')]=function(_0x1d20c7,_0x4ff093){return db[_0x27ec('0x33')][_0x27ec('0x4e')]({'where':{'id':_0x1d20c7['params']['id']}})[_0x27ec('0x2a')](handleEntityNotFound(_0x4ff093,null))[_0x27ec('0x2a')](removeEntity(_0x4ff093,null))[_0x27ec('0x4b')](handleError(_0x4ff093,null));}; \ No newline at end of file +var _0x01d3=['undefined','limit','count','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x5dea03,_0x5edc15){var _0x18a82d=function(_0x23f170){while(--_0x23f170){_0x5dea03['push'](_0x5dea03['shift']());}};_0x18a82d(++_0x5edc15);}(_0x01d3,0xdb));var _0x301d=function(_0x44e8da,_0x39a103){_0x44e8da=_0x44e8da-0x0;var _0xdda219=_0x01d3[_0x44e8da];return _0xdda219;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x301d('0x0'));var jsonpatch=require(_0x301d('0x1'));var rp=require(_0x301d('0x2'));var moment=require('moment');var BPromise=require(_0x301d('0x3'));var Mustache=require(_0x301d('0x4'));var util=require(_0x301d('0x5'));var path=require(_0x301d('0x6'));var sox=require(_0x301d('0x7'));var csv=require('to-csv');var ejs=require(_0x301d('0x8'));var fs=require('fs');var fs_extra=require(_0x301d('0x9'));var _=require(_0x301d('0xa'));var squel=require(_0x301d('0xb'));var crypto=require(_0x301d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x301d('0xd'));var toCsv=require(_0x301d('0xe'));var querystring=require(_0x301d('0xf'));var Papa=require(_0x301d('0x10'));var Redis=require(_0x301d('0x11'));var authService=require(_0x301d('0x12'));var qs=require(_0x301d('0x13'));var as=require(_0x301d('0x14'));var hardwareService=require(_0x301d('0x15'));var logger=require('../../config/logger')(_0x301d('0x16'));var utils=require(_0x301d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x301d('0x18'));var db=require(_0x301d('0x19'))['db'];function respondWithStatusCode(_0x2eb3af,_0x53bfe2){_0x53bfe2=_0x53bfe2||0xcc;return function(_0x496f0c){if(_0x496f0c){return _0x2eb3af[_0x301d('0x1a')](_0x53bfe2);}return _0x2eb3af[_0x301d('0x1b')](_0x53bfe2)[_0x301d('0x1c')]();};}function respondWithResult(_0x377c7f,_0x11bacf){_0x11bacf=_0x11bacf||0xc8;return function(_0x5bdd8a){if(_0x5bdd8a){return _0x377c7f[_0x301d('0x1b')](_0x11bacf)['json'](_0x5bdd8a);}};}function respondWithFilteredResult(_0x1d4fb4,_0xc35239){return function(_0x4fd833){if(_0x4fd833){var _0x10d277=typeof _0xc35239[_0x301d('0x1d')]===_0x301d('0x1e')&&typeof _0xc35239[_0x301d('0x1f')]===_0x301d('0x1e');var _0x1c409b=_0x4fd833[_0x301d('0x20')];var _0x2c7afb=_0x10d277?0x0:_0xc35239[_0x301d('0x1d')];var _0x3a2ad2=_0x10d277?_0x4fd833[_0x301d('0x20')]:_0xc35239[_0x301d('0x1d')]+_0xc35239[_0x301d('0x1f')];var _0x3d75e5;if(_0x3a2ad2>=_0x1c409b){_0x3a2ad2=_0x1c409b;_0x3d75e5=0xc8;}else{_0x3d75e5=0xce;}_0x1d4fb4[_0x301d('0x1b')](_0x3d75e5);return _0x1d4fb4['set']('Content-Range',_0x2c7afb+'-'+_0x3a2ad2+'/'+_0x1c409b)['json'](_0x4fd833);}return null;};}function patchUpdates(_0x31c94e){return function(_0x17ee2a){try{jsonpatch[_0x301d('0x21')](_0x17ee2a,_0x31c94e,!![]);}catch(_0x4d8006){return BPromise[_0x301d('0x22')](_0x4d8006);}return _0x17ee2a[_0x301d('0x23')]();};}function saveUpdates(_0x5b6631,_0x485f96){return function(_0x292c89){if(_0x292c89){return _0x292c89[_0x301d('0x24')](_0x5b6631)[_0x301d('0x25')](function(_0x3fa47d){return _0x3fa47d;});}return null;};}function removeEntity(_0x549e57,_0x1119da){return function(_0x2491b8){if(_0x2491b8){return _0x2491b8[_0x301d('0x26')]()[_0x301d('0x25')](function(){var _0x290201=_0x2491b8[_0x301d('0x27')]({'plain':!![]});var _0x4fae3d=_0x301d('0x28');return db[_0x301d('0x29')][_0x301d('0x26')]({'where':{'type':_0x4fae3d,'resourceId':_0x290201['id']}})[_0x301d('0x25')](function(){return _0x2491b8;});})[_0x301d('0x25')](function(){_0x549e57[_0x301d('0x1b')](0xcc)[_0x301d('0x1c')]();});}};}function handleEntityNotFound(_0x2dd5b8,_0x5d05db){return function(_0x1c7074){if(!_0x1c7074){_0x2dd5b8['sendStatus'](0x194);}return _0x1c7074;};}function handleError(_0x5d7835,_0x320819){_0x320819=_0x320819||0x1f4;return function(_0x52eb42){logger[_0x301d('0x2a')](_0x52eb42[_0x301d('0x2b')]);if(_0x52eb42[_0x301d('0x2c')]){delete _0x52eb42[_0x301d('0x2c')];}_0x5d7835[_0x301d('0x1b')](_0x320819)['send'](_0x52eb42);};}exports[_0x301d('0x2d')]=function(_0x5f06f2,_0x2385ef){var _0x24b1d5={},_0x4a8356={},_0x5b4930={'count':0x0,'rows':[]};var _0x4d1b99=_['map'](db[_0x301d('0x2e')][_0x301d('0x2f')],function(_0x27c3a1){return{'name':_0x27c3a1[_0x301d('0x30')],'type':_0x27c3a1[_0x301d('0x31')][_0x301d('0x32')]};});_0x4a8356[_0x301d('0x33')]=_[_0x301d('0x34')](_0x4d1b99,_0x301d('0x2c'));_0x4a8356[_0x301d('0x35')]=_['keys'](_0x5f06f2[_0x301d('0x35')]);_0x4a8356[_0x301d('0x36')]=_[_0x301d('0x37')](_0x4a8356[_0x301d('0x33')],_0x4a8356[_0x301d('0x35')]);_0x24b1d5[_0x301d('0x38')]=_[_0x301d('0x37')](_0x4a8356[_0x301d('0x33')],qs[_0x301d('0x39')](_0x5f06f2[_0x301d('0x35')]['fields']));_0x24b1d5['attributes']=_0x24b1d5[_0x301d('0x38')][_0x301d('0x3a')]?_0x24b1d5[_0x301d('0x38')]:_0x4a8356[_0x301d('0x33')];if(!_0x5f06f2[_0x301d('0x35')]['hasOwnProperty'](_0x301d('0x3b'))){_0x24b1d5[_0x301d('0x1f')]=qs[_0x301d('0x1f')](_0x5f06f2['query'][_0x301d('0x1f')]);_0x24b1d5['offset']=qs[_0x301d('0x1d')](_0x5f06f2[_0x301d('0x35')][_0x301d('0x1d')]);}_0x24b1d5[_0x301d('0x3c')]=qs[_0x301d('0x3d')](_0x5f06f2[_0x301d('0x35')][_0x301d('0x3d')]);_0x24b1d5[_0x301d('0x3e')]=qs['filters'](_[_0x301d('0x3f')](_0x5f06f2[_0x301d('0x35')],_0x4a8356[_0x301d('0x36')]),_0x4d1b99);if(_0x5f06f2[_0x301d('0x35')][_0x301d('0x40')]){_0x24b1d5['where']=_['merge'](_0x24b1d5['where'],{'$or':_[_0x301d('0x34')](_0x4d1b99,function(_0x5b3056){if(_0x5b3056[_0x301d('0x31')]!==_0x301d('0x41')){var _0x30bc21={};_0x30bc21[_0x5b3056[_0x301d('0x2c')]]={'$like':'%'+_0x5f06f2[_0x301d('0x35')]['filter']+'%'};return _0x30bc21;}})});}_0x24b1d5=_[_0x301d('0x42')]({},_0x24b1d5,_0x5f06f2['options']);var _0x512fd4={'where':_0x24b1d5[_0x301d('0x3e')]};return db['VoiceChanSpy']['count'](_0x512fd4)[_0x301d('0x25')](function(_0x168211){_0x5b4930[_0x301d('0x20')]=_0x168211;if(_0x5f06f2[_0x301d('0x35')][_0x301d('0x43')]){_0x24b1d5[_0x301d('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x301d('0x45')](_0x24b1d5);})[_0x301d('0x25')](function(_0x3dd5f5){_0x5b4930[_0x301d('0x46')]=_0x3dd5f5;return _0x5b4930;})[_0x301d('0x25')](respondWithFilteredResult(_0x2385ef,_0x24b1d5))[_0x301d('0x47')](handleError(_0x2385ef,null));};exports[_0x301d('0x48')]=function(_0x5085cf,_0x46a3c7){var _0x53d704={'raw':![],'where':{'id':_0x5085cf[_0x301d('0x49')]['id']}},_0x4bfd37={};_0x4bfd37[_0x301d('0x33')]=_['keys'](db[_0x301d('0x2e')][_0x301d('0x2f')]);_0x4bfd37['query']=_['keys'](_0x5085cf[_0x301d('0x35')]);_0x4bfd37[_0x301d('0x36')]=_[_0x301d('0x37')](_0x4bfd37['model'],_0x4bfd37['query']);_0x53d704[_0x301d('0x38')]=_[_0x301d('0x37')](_0x4bfd37[_0x301d('0x33')],qs[_0x301d('0x39')](_0x5085cf[_0x301d('0x35')]['fields']));_0x53d704[_0x301d('0x38')]=_0x53d704[_0x301d('0x38')][_0x301d('0x3a')]?_0x53d704['attributes']:_0x4bfd37[_0x301d('0x33')];if(_0x5085cf[_0x301d('0x35')][_0x301d('0x43')]){_0x53d704[_0x301d('0x44')]=[{'all':!![]}];}_0x53d704=_['merge']({},_0x53d704,_0x5085cf[_0x301d('0x4a')]);return db['VoiceChanSpy'][_0x301d('0x4b')](_0x53d704)['then'](handleEntityNotFound(_0x46a3c7,null))[_0x301d('0x25')](respondWithResult(_0x46a3c7,null))[_0x301d('0x47')](handleError(_0x46a3c7,null));};exports[_0x301d('0x4c')]=function(_0x155912,_0x2ed897){return db[_0x301d('0x2e')][_0x301d('0x4c')](_0x155912[_0x301d('0x4d')],{})[_0x301d('0x25')](function(_0x588c44){var _0xe6648f=_0x155912[_0x301d('0x4e')][_0x301d('0x27')]({'plain':!![]});if(!_0xe6648f)throw new Error(_0x301d('0x4f'));if(_0xe6648f['role']===_0x301d('0x4e')){var _0x5c1d19=_0x588c44['get']({'plain':!![]});var _0x5de307=_0x301d('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x5de307,'userProfileId':_0xe6648f[_0x301d('0x50')]},'raw':!![]})[_0x301d('0x25')](function(_0x291384){if(_0x291384&&_0x291384[_0x301d('0x51')]===0x0){return db[_0x301d('0x29')][_0x301d('0x4c')]({'name':_0x5c1d19[_0x301d('0x2c')],'resourceId':_0x5c1d19['id'],'type':_0x291384[_0x301d('0x2c')],'sectionId':_0x291384['id']},{})[_0x301d('0x25')](function(){return _0x588c44;});}else{return _0x588c44;}})[_0x301d('0x47')](function(_0x367ff8){logger[_0x301d('0x2a')](_0x301d('0x52'),_0x367ff8);throw _0x367ff8;});}return _0x588c44;})[_0x301d('0x25')](respondWithResult(_0x2ed897,0xc9))[_0x301d('0x47')](handleError(_0x2ed897,null));};exports[_0x301d('0x24')]=function(_0xd17e9b,_0x15da05){if(_0xd17e9b['body']['id']){delete _0xd17e9b[_0x301d('0x4d')]['id'];}return db[_0x301d('0x2e')][_0x301d('0x4b')]({'where':{'id':_0xd17e9b[_0x301d('0x49')]['id']}})[_0x301d('0x25')](handleEntityNotFound(_0x15da05,null))[_0x301d('0x25')](saveUpdates(_0xd17e9b[_0x301d('0x4d')],null))['then'](respondWithResult(_0x15da05,null))[_0x301d('0x47')](handleError(_0x15da05,null));};exports[_0x301d('0x26')]=function(_0x5308be,_0x29eafe){return db['VoiceChanSpy']['find']({'where':{'id':_0x5308be['params']['id']}})[_0x301d('0x25')](handleEntityNotFound(_0x29eafe,null))[_0x301d('0x25')](removeEntity(_0x29eafe,null))[_0x301d('0x47')](handleError(_0x29eafe,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 04ccb30..44ddf1f 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 _0xdb57=['recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','format','%s%s','system','Set','CDR(type)=%s','chanspy','record','push','merge','MixMonitor'];(function(_0x1d4d75,_0x48b6b4){var _0x11316d=function(_0xf25f35){while(--_0xf25f35){_0x1d4d75['push'](_0x1d4d75['shift']());}};_0x11316d(++_0x48b6b4);}(_0xdb57,0x1f0));var _0x7db5=function(_0x2ad252,_0x8b35a1){_0x2ad252=_0x2ad252-0x0;var _0x21ce12=_0xdb57[_0x2ad252];return _0x21ce12;};'use strict';var _=require(_0x7db5('0x0'));var util=require(_0x7db5('0x1'));var BPromise=require('bluebird');var attributes=require(_0x7db5('0x2'));var getUserApplications=function(_0x3e7565,_0x287949,_0x6a4385){var _0x320f03=0x1;var _0x48182c=[];var _0x4241d4={'context':_0x287949[_0x7db5('0x3')]||'from-sip','exten':util[_0x7db5('0x4')](_0x7db5('0x5'),_0x3e7565['prefix'],_0x6a4385),'type':_0x7db5('0x6'),'isApp':![],'ChanSpyId':_0x3e7565['id'],'UserId':_0x287949['id']};_0x48182c['push'](_['merge']({'app':_0x7db5('0x7'),'appdata':util[_0x7db5('0x4')](_0x7db5('0x8'),_0x7db5('0x9')),'priority':_0x320f03++},_0x4241d4));if(_0x3e7565[_0x7db5('0xa')]){_0x48182c[_0x7db5('0xb')](_[_0x7db5('0xc')]({'app':_0x7db5('0xd'),'appdata':util[_0x7db5('0x4')]('${UNIQUEID}.%s,a',_0x3e7565[_0x7db5('0xe')]),'priority':_0x320f03++},_0x4241d4));}if(_0x3e7565['auth']){_0x48182c[_0x7db5('0xb')](_[_0x7db5('0xc')]({'app':'Authenticate','appdata':_0x3e7565[_0x7db5('0xf')],'priority':_0x320f03++},_0x4241d4));}_0x48182c[_0x7db5('0xb')](_['merge']({'app':_0x7db5('0x10'),'appdata':util[_0x7db5('0x4')](_0x7db5('0x11'),_0x287949[_0x7db5('0x12')],_0x3e7565[_0x7db5('0x13')]?_0x3e7565[_0x7db5('0x13')]['join'](''):''),'priority':_0x320f03++},_0x4241d4));if(_0x3e7565[_0x7db5('0xa')]){_0x48182c[_0x7db5('0xb')](_['merge']({'app':_0x7db5('0x14'),'priority':_0x320f03++},_0x4241d4));}return _0x48182c;};var getChanSpyApplications=function(_0x39ba23,_0x27f922){var _0x7db3fd=[];for(var _0x14f64c=0x0,_0x46805f=0x1;_0x14f64c<_0x27f922[_0x7db5('0x15')];_0x14f64c++,_0x46805f=0x1){_0x7db3fd=_0x7db3fd[_0x7db5('0x16')](getUserApplications(_0x39ba23,_0x27f922[_0x14f64c],_0x27f922[_0x14f64c][_0x7db5('0x17')]));if(_0x27f922[_0x14f64c][_0x7db5('0x17')]!=_0x27f922[_0x14f64c]['name']){_0x7db3fd=_0x7db3fd[_0x7db5('0x16')](getUserApplications(_0x39ba23,_0x27f922[_0x14f64c],_0x27f922[_0x14f64c][_0x7db5('0x12')]));}}return _0x7db3fd;};var getChanSpyPromise=function(_0x5cfe1b,_0x5de74c){return new BPromise(function(_0x109895,_0xf48b09){return _0x5cfe1b[_0x7db5('0x18')]['findAll']({'attributes':['id',_0x7db5('0x12'),_0x7db5('0x17')],'where':{'role':_0x7db5('0x19'),'chanspy':!![]},'raw':!![]})[_0x7db5('0x1a')](function(_0x425f56){if(_0x425f56){return _0x109895(getChanSpyApplications(_0x5de74c,_0x425f56));}return _0x109895([]);})[_0x7db5('0x1b')](function(_0x2f7d54){_0xf48b09(_0x2f7d54);});});};module[_0x7db5('0x1c')]=function(_0x2d0147,_0xd2f86f){var _0x2ea55c=_0x2d0147['models'];return _0x2d0147[_0x7db5('0x1d')](_0x7db5('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3430a4,_0x29d2d9,_0x7ff72){return getChanSpyPromise(_0x2ea55c,_0x3430a4)[_0x7db5('0x1a')](function(_0x12fa35){if(_0x12fa35&&_0x12fa35[_0x7db5('0x15')]){return _0x2ea55c[_0x7db5('0x1f')][_0x7db5('0x20')](_0x12fa35);}})['then'](function(){_0x7ff72();})[_0x7db5('0x1b')](function(_0x665865){_0x7ff72(_0x665865);});},'afterUpdate':function(_0x3fb2b5,_0x3b5781,_0x3bf0d3){return _0x2ea55c[_0x7db5('0x1f')]['destroy']({'where':{'ChanSpyId':_0x3fb2b5['id']}})[_0x7db5('0x1a')](function(){return getChanSpyPromise(_0x2ea55c,_0x3fb2b5);})[_0x7db5('0x1a')](function(_0x4d2b78){if(_0x4d2b78&&_0x4d2b78[_0x7db5('0x15')]){return _0x2ea55c['VoiceExtension'][_0x7db5('0x20')](_0x4d2b78);}})[_0x7db5('0x1a')](function(){_0x3bf0d3();})[_0x7db5('0x1b')](function(_0x2b6976){_0x3bf0d3(_0x2b6976);});},'afterDestroy':function(_0x17b91d,_0x4b88d6,_0x8fd120){return _0x2ea55c[_0x7db5('0x1f')][_0x7db5('0x21')]({'where':{'ChanSpyId':_0x17b91d['id']}})[_0x7db5('0x1a')](function(){_0x8fd120();})['catch'](function(_0xac0f31){_0x8fd120(_0xac0f31);});}}});}; \ No newline at end of file +var _0x5e96=['join','length','concat','internal','findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','context','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','record','merge','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x5e96,0xa3));var _0x65e9=function(_0x2f630f,_0x2b20ae){_0x2f630f=_0x2f630f-0x0;var _0xfc1fa4=_0x5e96[_0x2f630f];return _0xfc1fa4;};'use strict';var _=require(_0x65e9('0x0'));var util=require(_0x65e9('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x25bd7a,_0x14d15c,_0x1a839e){var _0x1fc770=0x1;var _0x32ec4a=[];var _0x192813={'context':_0x14d15c[_0x65e9('0x2')]||'from-sip','exten':util[_0x65e9('0x3')](_0x65e9('0x4'),_0x25bd7a[_0x65e9('0x5')],_0x1a839e),'type':_0x65e9('0x6'),'isApp':![],'ChanSpyId':_0x25bd7a['id'],'UserId':_0x14d15c['id']};_0x32ec4a[_0x65e9('0x7')](_['merge']({'app':_0x65e9('0x8'),'appdata':util[_0x65e9('0x3')](_0x65e9('0x9'),_0x65e9('0xa')),'priority':_0x1fc770++},_0x192813));if(_0x25bd7a[_0x65e9('0xb')]){_0x32ec4a[_0x65e9('0x7')](_[_0x65e9('0xc')]({'app':'MixMonitor','appdata':util[_0x65e9('0x3')](_0x65e9('0xd'),_0x25bd7a[_0x65e9('0xe')]),'priority':_0x1fc770++},_0x192813));}if(_0x25bd7a[_0x65e9('0xf')]){_0x32ec4a[_0x65e9('0x7')](_['merge']({'app':_0x65e9('0x10'),'appdata':_0x25bd7a[_0x65e9('0x11')],'priority':_0x1fc770++},_0x192813));}_0x32ec4a[_0x65e9('0x7')](_['merge']({'app':_0x65e9('0x12'),'appdata':util[_0x65e9('0x3')](_0x65e9('0x13'),_0x14d15c[_0x65e9('0x14')],_0x25bd7a[_0x65e9('0x15')]?_0x25bd7a[_0x65e9('0x15')][_0x65e9('0x16')](''):''),'priority':_0x1fc770++},_0x192813));if(_0x25bd7a[_0x65e9('0xb')]){_0x32ec4a[_0x65e9('0x7')](_['merge']({'app':'StopMixMonitor','priority':_0x1fc770++},_0x192813));}return _0x32ec4a;};var getChanSpyApplications=function(_0xf14247,_0x16e5c7){var _0x1844f6=[];for(var _0x50b2d6=0x0,_0x1e53af=0x1;_0x50b2d6<_0x16e5c7[_0x65e9('0x17')];_0x50b2d6++,_0x1e53af=0x1){_0x1844f6=_0x1844f6[_0x65e9('0x18')](getUserApplications(_0xf14247,_0x16e5c7[_0x50b2d6],_0x16e5c7[_0x50b2d6][_0x65e9('0x19')]));if(_0x16e5c7[_0x50b2d6][_0x65e9('0x19')]!=_0x16e5c7[_0x50b2d6]['name']){_0x1844f6=_0x1844f6[_0x65e9('0x18')](getUserApplications(_0xf14247,_0x16e5c7[_0x50b2d6],_0x16e5c7[_0x50b2d6]['name']));}}return _0x1844f6;};var getChanSpyPromise=function(_0x1869f4,_0x51ff2b){return new BPromise(function(_0x4e91c4,_0x32070c){return _0x1869f4['User'][_0x65e9('0x1a')]({'attributes':['id',_0x65e9('0x14'),_0x65e9('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x65e9('0x1b')](function(_0x2685e8){if(_0x2685e8){return _0x4e91c4(getChanSpyApplications(_0x51ff2b,_0x2685e8));}return _0x4e91c4([]);})[_0x65e9('0x1c')](function(_0x16b645){_0x32070c(_0x16b645);});});};module[_0x65e9('0x1d')]=function(_0x14c3bb,_0x26c619){var _0x3e4911=_0x14c3bb[_0x65e9('0x1e')];return _0x14c3bb[_0x65e9('0x1f')](_0x65e9('0x20'),attributes,{'tableName':_0x65e9('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4560ff,_0x30e567,_0x2971c1){return getChanSpyPromise(_0x3e4911,_0x4560ff)[_0x65e9('0x1b')](function(_0x32df78){if(_0x32df78&&_0x32df78[_0x65e9('0x17')]){return _0x3e4911[_0x65e9('0x22')][_0x65e9('0x23')](_0x32df78);}})['then'](function(){_0x2971c1();})[_0x65e9('0x1c')](function(_0x2edfce){_0x2971c1(_0x2edfce);});},'afterUpdate':function(_0x3e9923,_0x1f5a24,_0x6f03f3){return _0x3e4911['VoiceExtension'][_0x65e9('0x24')]({'where':{'ChanSpyId':_0x3e9923['id']}})[_0x65e9('0x1b')](function(){return getChanSpyPromise(_0x3e4911,_0x3e9923);})['then'](function(_0x5470f0){if(_0x5470f0&&_0x5470f0[_0x65e9('0x17')]){return _0x3e4911[_0x65e9('0x22')][_0x65e9('0x23')](_0x5470f0);}})[_0x65e9('0x1b')](function(){_0x6f03f3();})['catch'](function(_0x26ee7c){_0x6f03f3(_0x26ee7c);});},'afterDestroy':function(_0x23bced,_0x19050b,_0x1a55f1){return _0x3e4911['VoiceExtension'][_0x65e9('0x24')]({'where':{'ChanSpyId':_0x23bced['id']}})['then'](function(){_0x1a55f1();})[_0x65e9('0x1c')](function(_0x295c30){_0x1a55f1(_0x295c30);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2464c54..6889975 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 _0x6282=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x172298,_0x542449){var _0x44856d=function(_0xa648ba){while(--_0xa648ba){_0x172298['push'](_0x172298['shift']());}};_0x44856d(++_0x542449);}(_0x6282,0x76));var _0x2628=function(_0x382d8e,_0x2a5761){_0x382d8e=_0x382d8e-0x0;var _0x23993d=_0x6282[_0x382d8e];return _0x23993d;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var moment=require(_0x2628('0x2'));var BPromise=require(_0x2628('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2628('0x4'))['db'];var utils=require(_0x2628('0x5'));var logger=require('../../config/logger')(_0x2628('0x6'));var config=require(_0x2628('0x7'));var jayson=require(_0x2628('0x8'));var client=jayson[_0x2628('0x9')][_0x2628('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50412a,_0xb6b945,_0x144ae8){return new BPromise(function(_0x2170a7,_0xbae7c3){return client[_0x2628('0xb')](_0x50412a,_0x144ae8)[_0x2628('0xc')](function(_0x403569){logger[_0x2628('0xd')](_0x2628('0xe'),_0xb6b945,_0x2628('0xf'));logger[_0x2628('0x10')](_0x2628('0x11'),_0xb6b945,_0x2628('0xf'),JSON[_0x2628('0x12')](_0x403569));if(_0x403569[_0x2628('0x13')]){if(_0x403569['error']['code']===0x1f4){logger[_0x2628('0x13')](_0x2628('0xe'),_0xb6b945,_0x403569[_0x2628('0x13')][_0x2628('0x14')]);return _0xbae7c3(_0x403569['error']['message']);}logger[_0x2628('0x13')](_0x2628('0xe'),_0xb6b945,_0x403569[_0x2628('0x13')][_0x2628('0x14')]);return _0x2170a7(_0x403569[_0x2628('0x13')]['message']);}else{logger[_0x2628('0xd')](_0x2628('0xe'),_0xb6b945,_0x2628('0xf'));_0x2170a7(_0x403569['result'][_0x2628('0x14')]);}})[_0x2628('0x15')](function(_0x51df16){logger[_0x2628('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0xb6b945,_0x51df16);_0xbae7c3(_0x51df16);});});} \ No newline at end of file +var _0xac55=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3386fd,_0x8596f4){var _0x19e6f6=function(_0x4bd4ec){while(--_0x4bd4ec){_0x3386fd['push'](_0x3386fd['shift']());}};_0x19e6f6(++_0x8596f4);}(_0xac55,0x1c8));var _0x5ac5=function(_0x232ebb,_0x48e724){_0x232ebb=_0x232ebb-0x0;var _0x12b8d6=_0xac55[_0x232ebb];return _0x12b8d6;};'use strict';var _=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var moment=require(_0x5ac5('0x2'));var BPromise=require(_0x5ac5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ac5('0x4'));var db=require(_0x5ac5('0x5'))['db'];var utils=require(_0x5ac5('0x6'));var logger=require(_0x5ac5('0x7'))(_0x5ac5('0x8'));var config=require(_0x5ac5('0x9'));var jayson=require(_0x5ac5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34093b,_0x247752,_0x2bee03){return new BPromise(function(_0x42551a,_0x455a94){return client[_0x5ac5('0xb')](_0x34093b,_0x2bee03)[_0x5ac5('0xc')](function(_0x5b84a3){logger['info'](_0x5ac5('0xd'),_0x247752,_0x5ac5('0xe'));logger['debug'](_0x5ac5('0xf'),_0x247752,_0x5ac5('0xe'),JSON['stringify'](_0x5b84a3));if(_0x5b84a3[_0x5ac5('0x10')]){if(_0x5b84a3[_0x5ac5('0x10')]['code']===0x1f4){logger[_0x5ac5('0x10')](_0x5ac5('0xd'),_0x247752,_0x5b84a3[_0x5ac5('0x10')][_0x5ac5('0x11')]);return _0x455a94(_0x5b84a3[_0x5ac5('0x10')]['message']);}logger[_0x5ac5('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x247752,_0x5b84a3[_0x5ac5('0x10')][_0x5ac5('0x11')]);return _0x42551a(_0x5b84a3['error'][_0x5ac5('0x11')]);}else{logger['info'](_0x5ac5('0xd'),_0x247752,_0x5ac5('0xe'));_0x42551a(_0x5b84a3[_0x5ac5('0x12')][_0x5ac5('0x11')]);}})[_0x5ac5('0x13')](function(_0x3e35e9){logger[_0x5ac5('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x247752,_0x3e35e9);_0x455a94(_0x3e35e9);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index abc3d2c..4f31197 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 _0x89d1=['delete','destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated','get','show','create','put','/:id','update'];(function(_0x144456,_0x2c3b76){var _0x2e0d87=function(_0x5b3206){while(--_0x5b3206){_0x144456['push'](_0x144456['shift']());}};_0x2e0d87(++_0x2c3b76);}(_0x89d1,0x1f3));var _0x189d=function(_0x4510a8,_0x426f4a){_0x4510a8=_0x4510a8-0x0;var _0x21a905=_0x89d1[_0x4510a8];return _0x21a905;};'use strict';var multer=require('multer');var util=require(_0x189d('0x0'));var path=require('path');var timeout=require(_0x189d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x189d('0x2'));var auth=require(_0x189d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x189d('0x4'));var controller=require(_0x189d('0x5'));router['get']('/',auth[_0x189d('0x6')](),controller['index']);router[_0x189d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x189d('0x8')]);router['post']('/',auth[_0x189d('0x6')](),controller[_0x189d('0x9')]);router[_0x189d('0xa')](_0x189d('0xb'),auth[_0x189d('0x6')](),controller[_0x189d('0xc')]);router[_0x189d('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x189d('0xe')]);module[_0x189d('0xf')]=router; \ No newline at end of file +var _0x39db=['get','isAuthenticated','index','show','post','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x39db,0x88));var _0xb39d=function(_0x5149c7,_0xfd2f67){_0x5149c7=_0x5149c7-0x0;var _0x5010b0=_0x39db[_0x5149c7];return _0x5010b0;};'use strict';var multer=require(_0xb39d('0x0'));var util=require(_0xb39d('0x1'));var path=require('path');var timeout=require(_0xb39d('0x2'));var express=require(_0xb39d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb39d('0x4'));var interaction=require(_0xb39d('0x5'));var config=require(_0xb39d('0x6'));var controller=require(_0xb39d('0x7'));router[_0xb39d('0x8')]('/',auth[_0xb39d('0x9')](),controller[_0xb39d('0xa')]);router[_0xb39d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb39d('0xb')]);router[_0xb39d('0xc')]('/',auth[_0xb39d('0x9')](),controller['create']);router[_0xb39d('0xd')](_0xb39d('0xe'),auth[_0xb39d('0x9')](),controller[_0xb39d('0xf')]);router['delete'](_0xb39d('0xe'),auth[_0xb39d('0x9')](),controller[_0xb39d('0x10')]);module[_0xb39d('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 198c515..7ee88e7 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 _0xd04b=['STRING','name','sequelize','exports'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xd04b,0x1b2));var _0xbd04=function(_0x194f98,_0x5bd270){_0x194f98=_0x194f98-0x0;var _0x19fed1=_0xd04b[_0x194f98];return _0x19fed1;};'use strict';var Sequelize=require(_0xbd04('0x0'));module[_0xbd04('0x1')]={'name':{'type':Sequelize[_0xbd04('0x2')],'unique':_0xbd04('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf109=['exports','STRING','sequelize'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0xf109,0xce));var _0x9f10=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xf109[_0x35da42];return _0x370035;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 497117b..459dc64 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 _0xdc32=['crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','get','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','render','writeFileSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdc32,0x1f4));var _0x2dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc32[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2dc3('0x0'));var rimraf=require(_0x2dc3('0x1'));var zipdir=require(_0x2dc3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2dc3('0x3'));var moment=require('moment');var BPromise=require(_0x2dc3('0x4'));var Mustache=require(_0x2dc3('0x5'));var util=require('util');var path=require(_0x2dc3('0x6'));var sox=require(_0x2dc3('0x7'));var csv=require(_0x2dc3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2dc3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2dc3('0xa'));var jsforce=require(_0x2dc3('0xb'));var deskjs=require(_0x2dc3('0xc'));var toCsv=require(_0x2dc3('0x8'));var querystring=require(_0x2dc3('0xd'));var Papa=require('papaparse');var Redis=require(_0x2dc3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2dc3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2dc3('0x10'));var logger=require(_0x2dc3('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x2dc3('0x12'));var licenseUtil=require(_0x2dc3('0x13'));var db=require(_0x2dc3('0x14'))['db'];var jayson=require(_0x2dc3('0x15'));var client=jayson[_0x2dc3('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x316f1a,_0x1ad01c,_0x37fa6b,_0x53ae18){return new BPromise(function(_0x549521,_0x445c03){var _0x5c7592=_0x53ae18||client;return _0x5c7592[_0x2dc3('0x17')](_0x316f1a,_0x37fa6b)[_0x2dc3('0x18')](function(_0xb1800f){logger[_0x2dc3('0x19')](_0x2dc3('0x1a'),_0x1ad01c,_0x2dc3('0x1b'));logger[_0x2dc3('0x1c')](_0x2dc3('0x1d'),_0x1ad01c,_0x2dc3('0x1b'),JSON[_0x2dc3('0x1e')](_0xb1800f));if(_0xb1800f[_0x2dc3('0x1f')]){if(_0xb1800f['error'][_0x2dc3('0x20')]===0x1f4){logger[_0x2dc3('0x1f')](_0x2dc3('0x1a'),_0x1ad01c,_0xb1800f[_0x2dc3('0x1f')][_0x2dc3('0x21')]);return _0x445c03(_0xb1800f[_0x2dc3('0x1f')]['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x1ad01c,_0xb1800f[_0x2dc3('0x1f')][_0x2dc3('0x21')]);return _0x549521(_0xb1800f[_0x2dc3('0x1f')][_0x2dc3('0x21')]);}else{logger['info'](_0x2dc3('0x1a'),_0x1ad01c,_0x2dc3('0x1b'));_0x549521(_0xb1800f[_0x2dc3('0x22')][_0x2dc3('0x21')]);}})[_0x2dc3('0x23')](function(_0xc0945f){logger[_0x2dc3('0x1f')](_0x2dc3('0x1a'),_0x1ad01c,_0xc0945f);_0x445c03(_0xc0945f);});});}function respondWithStatusCode(_0x530e9e,_0x31e65d){_0x31e65d=_0x31e65d||0xcc;return function(_0x5075fa){if(_0x5075fa){return _0x530e9e[_0x2dc3('0x24')](_0x31e65d);}return _0x530e9e['status'](_0x31e65d)[_0x2dc3('0x25')]();};}function respondWithResult(_0x1a14e0,_0x36c4b9){_0x36c4b9=_0x36c4b9||0xc8;return function(_0x277ccf){if(_0x277ccf){return _0x1a14e0['status'](_0x36c4b9)[_0x2dc3('0x26')](_0x277ccf);}};}function respondWithFilteredResult(_0x189d14,_0x421f10){return function(_0x1e2ece){if(_0x1e2ece){var _0x540a58=typeof _0x421f10[_0x2dc3('0x27')]==='undefined'&&typeof _0x421f10[_0x2dc3('0x28')]===_0x2dc3('0x29');var _0x2d2644=_0x1e2ece[_0x2dc3('0x2a')];var _0x14ca9b=_0x540a58?0x0:_0x421f10[_0x2dc3('0x27')];var _0x37ce84=_0x540a58?_0x1e2ece['count']:_0x421f10['offset']+_0x421f10['limit'];var _0x2a9f56;if(_0x37ce84>=_0x2d2644){_0x37ce84=_0x2d2644;_0x2a9f56=0xc8;}else{_0x2a9f56=0xce;}_0x189d14[_0x2dc3('0x2b')](_0x2a9f56);return _0x189d14[_0x2dc3('0x2c')](_0x2dc3('0x2d'),_0x14ca9b+'-'+_0x37ce84+'/'+_0x2d2644)[_0x2dc3('0x26')](_0x1e2ece);}return null;};}function patchUpdates(_0x1691ed){return function(_0x279f3b){try{jsonpatch[_0x2dc3('0x2e')](_0x279f3b,_0x1691ed,!![]);}catch(_0x495ab4){return BPromise[_0x2dc3('0x2f')](_0x495ab4);}return _0x279f3b[_0x2dc3('0x30')]();};}function saveUpdates(_0x97ac51,_0x2e08aa){return function(_0x4be628){if(_0x4be628){return _0x4be628['update'](_0x97ac51)[_0x2dc3('0x18')](function(_0x2ef591){return _0x2ef591;});}return null;};}function removeEntity(_0x5bed14,_0x3c031f){return function(_0x563b9d){if(_0x563b9d){return _0x563b9d['destroy']()[_0x2dc3('0x18')](function(){var _0x40d9c4=_0x563b9d[_0x2dc3('0x31')]({'plain':!![]});var _0x451583=_0x2dc3('0x32');return db[_0x2dc3('0x33')][_0x2dc3('0x34')]({'where':{'type':_0x451583,'resourceId':_0x40d9c4['id']}})[_0x2dc3('0x18')](function(){return _0x563b9d;});})['then'](function(){_0x5bed14[_0x2dc3('0x2b')](0xcc)[_0x2dc3('0x25')]();});}};}function handleEntityNotFound(_0x56b0d9,_0x57e155){return function(_0x299e8b){if(!_0x299e8b){_0x56b0d9[_0x2dc3('0x24')](0x194);}return _0x299e8b;};}function handleError(_0x3c4926,_0x4ba8d3){_0x4ba8d3=_0x4ba8d3||0x1f4;return function(_0x1aec2){logger[_0x2dc3('0x1f')](_0x1aec2[_0x2dc3('0x35')]);if(_0x1aec2[_0x2dc3('0x36')]){delete _0x1aec2['name'];}_0x3c4926[_0x2dc3('0x2b')](_0x4ba8d3)[_0x2dc3('0x37')](_0x1aec2);};}exports[_0x2dc3('0x38')]=function(_0x4c68a6,_0x44c64f){var _0x28f4b1={},_0x19b38a={},_0x2c4251={'count':0x0,'rows':[]};var _0x27e6bf=_[_0x2dc3('0x39')](db[_0x2dc3('0x3a')]['rawAttributes'],function(_0x64c158){return{'name':_0x64c158['fieldName'],'type':_0x64c158['type'][_0x2dc3('0x3b')]};});_0x19b38a[_0x2dc3('0x3c')]=_[_0x2dc3('0x39')](_0x27e6bf,_0x2dc3('0x36'));_0x19b38a[_0x2dc3('0x3d')]=_[_0x2dc3('0x3e')](_0x4c68a6[_0x2dc3('0x3d')]);_0x19b38a[_0x2dc3('0x3f')]=_[_0x2dc3('0x40')](_0x19b38a[_0x2dc3('0x3c')],_0x19b38a[_0x2dc3('0x3d')]);_0x28f4b1[_0x2dc3('0x41')]=_[_0x2dc3('0x40')](_0x19b38a[_0x2dc3('0x3c')],qs[_0x2dc3('0x42')](_0x4c68a6[_0x2dc3('0x3d')][_0x2dc3('0x42')]));_0x28f4b1['attributes']=_0x28f4b1[_0x2dc3('0x41')][_0x2dc3('0x43')]?_0x28f4b1[_0x2dc3('0x41')]:_0x19b38a['model'];if(!_0x4c68a6[_0x2dc3('0x3d')]['hasOwnProperty']('nolimit')){_0x28f4b1[_0x2dc3('0x28')]=qs['limit'](_0x4c68a6[_0x2dc3('0x3d')]['limit']);_0x28f4b1[_0x2dc3('0x27')]=qs[_0x2dc3('0x27')](_0x4c68a6[_0x2dc3('0x3d')]['offset']);}_0x28f4b1[_0x2dc3('0x44')]=qs['sort'](_0x4c68a6[_0x2dc3('0x3d')][_0x2dc3('0x45')]);_0x28f4b1[_0x2dc3('0x46')]=qs['filters'](_[_0x2dc3('0x47')](_0x4c68a6['query'],_0x19b38a[_0x2dc3('0x3f')]),_0x27e6bf);if(_0x4c68a6[_0x2dc3('0x3d')][_0x2dc3('0x48')]){_0x28f4b1['where']=_['merge'](_0x28f4b1[_0x2dc3('0x46')],{'$or':_[_0x2dc3('0x39')](_0x27e6bf,function(_0x279862){if(_0x279862[_0x2dc3('0x49')]!==_0x2dc3('0x4a')){var _0x10afa3={};_0x10afa3[_0x279862[_0x2dc3('0x36')]]={'$like':'%'+_0x4c68a6[_0x2dc3('0x3d')][_0x2dc3('0x48')]+'%'};return _0x10afa3;}})});}_0x28f4b1=_[_0x2dc3('0x4b')]({},_0x28f4b1,_0x4c68a6[_0x2dc3('0x4c')]);var _0x3b5191={'where':_0x28f4b1[_0x2dc3('0x46')]};return db[_0x2dc3('0x3a')][_0x2dc3('0x2a')](_0x3b5191)['then'](function(_0x553c30){_0x2c4251['count']=_0x553c30;if(_0x4c68a6[_0x2dc3('0x3d')][_0x2dc3('0x4d')]){_0x28f4b1[_0x2dc3('0x4e')]=[{'all':!![]}];}return db[_0x2dc3('0x3a')]['findAll'](_0x28f4b1);})[_0x2dc3('0x18')](function(_0x2b8332){_0x2c4251[_0x2dc3('0x4f')]=_0x2b8332;return _0x2c4251;})[_0x2dc3('0x18')](respondWithFilteredResult(_0x44c64f,_0x28f4b1))[_0x2dc3('0x23')](handleError(_0x44c64f,null));};exports[_0x2dc3('0x50')]=function(_0x472bf5,_0x17fd45){var _0x1ed247={'raw':![],'where':{'id':_0x472bf5[_0x2dc3('0x51')]['id']}},_0x4cd3e6={};_0x4cd3e6[_0x2dc3('0x3c')]=_[_0x2dc3('0x3e')](db[_0x2dc3('0x3a')][_0x2dc3('0x52')]);_0x4cd3e6[_0x2dc3('0x3d')]=_[_0x2dc3('0x3e')](_0x472bf5[_0x2dc3('0x3d')]);_0x4cd3e6['filters']=_[_0x2dc3('0x40')](_0x4cd3e6['model'],_0x4cd3e6['query']);_0x1ed247[_0x2dc3('0x41')]=_[_0x2dc3('0x40')](_0x4cd3e6[_0x2dc3('0x3c')],qs[_0x2dc3('0x42')](_0x472bf5[_0x2dc3('0x3d')][_0x2dc3('0x42')]));_0x1ed247['attributes']=_0x1ed247['attributes'][_0x2dc3('0x43')]?_0x1ed247[_0x2dc3('0x41')]:_0x4cd3e6[_0x2dc3('0x3c')];if(_0x472bf5['query'][_0x2dc3('0x4d')]){_0x1ed247[_0x2dc3('0x4e')]=[{'all':!![]}];}_0x1ed247=_[_0x2dc3('0x4b')]({},_0x1ed247,_0x472bf5[_0x2dc3('0x4c')]);return db[_0x2dc3('0x3a')][_0x2dc3('0x53')](_0x1ed247)[_0x2dc3('0x18')](handleEntityNotFound(_0x17fd45,null))['then'](respondWithResult(_0x17fd45,null))[_0x2dc3('0x23')](handleError(_0x17fd45,null));};exports[_0x2dc3('0x54')]=function(_0x33c145,_0x58996e,_0x4c94de){var _0x5c4abc;return db['VoiceContext'][_0x2dc3('0x54')](_0x33c145[_0x2dc3('0x55')],{'raw':!![]})[_0x2dc3('0x18')](function(_0x474bc6){_0x5c4abc=_0x474bc6;return db[_0x2dc3('0x3a')][_0x2dc3('0x56')]({'raw':!![]});})[_0x2dc3('0x18')](function(_0x163fa8){var _0x2251b0=fs[_0x2dc3('0x57')](path[_0x2dc3('0x58')](config[_0x2dc3('0x59')],_0x2dc3('0x5a')),_0x2dc3('0x5b'));var _0x5c6ba5=ejs['render'](_0x2251b0,{'contexts':_0x163fa8||[]});fs['writeFileSync'](_0x2dc3('0x5c'),_0x5c6ba5);})[_0x2dc3('0x18')](function(){return respondWithRpcPromise(_0x2dc3('0x5d'),'create',{'module':'chan_sip.so'});})['then'](function(){var _0x49f834=_0x33c145[_0x2dc3('0x5e')][_0x2dc3('0x31')]({'plain':!![]});if(!_0x49f834)throw new Error(_0x2dc3('0x5f'));if(_0x49f834[_0x2dc3('0x60')]==='user'){var _0x3e1b5f=_0x5c4abc[_0x2dc3('0x31')]({'plain':!![]});return db[_0x2dc3('0x61')][_0x2dc3('0x53')]({'where':{'name':_0x2dc3('0x32'),'userProfileId':_0x49f834[_0x2dc3('0x62')]},'raw':!![]})['then'](function(_0x1ebbef){if(_0x1ebbef&&_0x1ebbef['autoAssociation']===0x0){return db[_0x2dc3('0x33')]['create']({'name':_0x3e1b5f[_0x2dc3('0x36')],'resourceId':_0x3e1b5f['id'],'type':_0x1ebbef['name'],'sectionId':_0x1ebbef['id']},{})['then'](function(){return _0x5c4abc;});}else{return _0x5c4abc;}})['catch'](function(_0x4b9c0a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b9c0a);throw _0x4b9c0a;});}return _0x5c4abc;})[_0x2dc3('0x18')](respondWithResult(_0x58996e,0xc9))[_0x2dc3('0x23')](handleError(_0x58996e,null));};exports[_0x2dc3('0x63')]=function(_0x467be5,_0x7e0611,_0x568485){var _0x5044d0;return db['VoiceContext'][_0x2dc3('0x53')]({'where':{'id':_0x467be5[_0x2dc3('0x51')]['id']}})[_0x2dc3('0x18')](handleEntityNotFound(_0x7e0611,null))[_0x2dc3('0x18')](saveUpdates(_0x467be5[_0x2dc3('0x55')],null))[_0x2dc3('0x18')](function(_0x4e012b){if(_0x4e012b){_0x5044d0=_0x4e012b;return db[_0x2dc3('0x3a')][_0x2dc3('0x56')]({'raw':!![]});}})['then'](function(_0x214f90){var _0x222493=fs[_0x2dc3('0x57')](path[_0x2dc3('0x58')](config[_0x2dc3('0x59')],_0x2dc3('0x5a')),_0x2dc3('0x5b'));var _0x312962=ejs[_0x2dc3('0x64')](_0x222493,{'contexts':_0x214f90||[]});fs[_0x2dc3('0x65')](_0x2dc3('0x5c'),_0x312962);})[_0x2dc3('0x18')](function(){return respondWithRpcPromise(_0x2dc3('0x5d'),_0x2dc3('0x63'),{'module':'chan_sip.so'});})[_0x2dc3('0x18')](function(){return _0x5044d0;})['then'](respondWithResult(_0x7e0611,null))[_0x2dc3('0x23')](handleError(_0x7e0611,null));};exports[_0x2dc3('0x34')]=function(_0x422e63,_0x2eb843,_0x3d0db8){var _0x3f81fa;return db[_0x2dc3('0x3a')][_0x2dc3('0x53')]({'where':{'id':_0x422e63[_0x2dc3('0x51')]['id']}})[_0x2dc3('0x18')](handleEntityNotFound(_0x2eb843,null))['then'](removeEntity(_0x2eb843,null))[_0x2dc3('0x18')](function(){return db[_0x2dc3('0x3a')]['findAll']({'raw':!![]});})[_0x2dc3('0x18')](function(_0x2ef7a1){var _0x12ac25=fs['readFileSync'](path['join'](config[_0x2dc3('0x59')],_0x2dc3('0x5a')),_0x2dc3('0x5b'));var _0x2f220d=ejs[_0x2dc3('0x64')](_0x12ac25,{'contexts':_0x2ef7a1});fs[_0x2dc3('0x65')](_0x2dc3('0x5c'),_0x2f220d);return respondWithRpcPromise(_0x2dc3('0x5d'),_0x2dc3('0x34'),{'module':'chan_sip.so'});})[_0x2dc3('0x23')](handleError(_0x2eb843,null));}; \ No newline at end of file +var _0x86eb=['Contexts','UserProfileResource','end','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','VoiceContext','include','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','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','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get'];(function(_0x65d13d,_0x49e929){var _0x309bb3=function(_0x2d7f73){while(--_0x2d7f73){_0x65d13d['push'](_0x65d13d['shift']());}};_0x309bb3(++_0x49e929);}(_0x86eb,0x16b));var _0xb86e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x86eb[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb86e('0x0'));var zipdir=require(_0xb86e('0x1'));var jsonpatch=require(_0xb86e('0x2'));var rp=require('request-promise');var moment=require(_0xb86e('0x3'));var BPromise=require(_0xb86e('0x4'));var Mustache=require(_0xb86e('0x5'));var util=require(_0xb86e('0x6'));var path=require(_0xb86e('0x7'));var sox=require(_0xb86e('0x8'));var csv=require('to-csv');var ejs=require(_0xb86e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb86e('0xa'));var jsforce=require(_0xb86e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb86e('0xc'));var querystring=require('querystring');var Papa=require(_0xb86e('0xd'));var Redis=require(_0xb86e('0xe'));var authService=require(_0xb86e('0xf'));var qs=require(_0xb86e('0x10'));var as=require(_0xb86e('0x11'));var hardwareService=require(_0xb86e('0x12'));var logger=require(_0xb86e('0x13'))(_0xb86e('0x14'));var utils=require(_0xb86e('0x15'));var config=require(_0xb86e('0x16'));var licenseUtil=require(_0xb86e('0x17'));var db=require(_0xb86e('0x18'))['db'];var jayson=require(_0xb86e('0x19'));var client=jayson[_0xb86e('0x1a')][_0xb86e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xbf848f,_0x16a842,_0x47772c,_0x486dad){return new BPromise(function(_0x4df60d,_0x4264cb){var _0x346cae=_0x486dad||client;return _0x346cae['request'](_0xbf848f,_0x47772c)[_0xb86e('0x1c')](function(_0x3bc3ba){logger[_0xb86e('0x1d')](_0xb86e('0x1e'),_0x16a842,_0xb86e('0x1f'));logger[_0xb86e('0x20')](_0xb86e('0x21'),_0x16a842,_0xb86e('0x1f'),JSON['stringify'](_0x3bc3ba));if(_0x3bc3ba[_0xb86e('0x22')]){if(_0x3bc3ba[_0xb86e('0x22')][_0xb86e('0x23')]===0x1f4){logger['error'](_0xb86e('0x1e'),_0x16a842,_0x3bc3ba[_0xb86e('0x22')][_0xb86e('0x24')]);return _0x4264cb(_0x3bc3ba[_0xb86e('0x22')][_0xb86e('0x24')]);}logger[_0xb86e('0x22')]('VoiceContext,\x20%s,\x20%s',_0x16a842,_0x3bc3ba[_0xb86e('0x22')]['message']);return _0x4df60d(_0x3bc3ba[_0xb86e('0x22')][_0xb86e('0x24')]);}else{logger[_0xb86e('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x16a842,_0xb86e('0x1f'));_0x4df60d(_0x3bc3ba[_0xb86e('0x25')]['message']);}})[_0xb86e('0x26')](function(_0x1648e2){logger['error']('VoiceContext,\x20%s,\x20%s',_0x16a842,_0x1648e2);_0x4264cb(_0x1648e2);});});}function respondWithStatusCode(_0x49ad01,_0x53de97){_0x53de97=_0x53de97||0xcc;return function(_0x324789){if(_0x324789){return _0x49ad01[_0xb86e('0x27')](_0x53de97);}return _0x49ad01[_0xb86e('0x28')](_0x53de97)['end']();};}function respondWithResult(_0x1ec92f,_0x194286){_0x194286=_0x194286||0xc8;return function(_0x535f2c){if(_0x535f2c){return _0x1ec92f[_0xb86e('0x28')](_0x194286)[_0xb86e('0x29')](_0x535f2c);}};}function respondWithFilteredResult(_0x5bc058,_0x33a389){return function(_0x355c00){if(_0x355c00){var _0x256641=typeof _0x33a389[_0xb86e('0x2a')]===_0xb86e('0x2b')&&typeof _0x33a389[_0xb86e('0x2c')]===_0xb86e('0x2b');var _0xdafcd1=_0x355c00['count'];var _0x19de54=_0x256641?0x0:_0x33a389[_0xb86e('0x2a')];var _0x45835a=_0x256641?_0x355c00[_0xb86e('0x2d')]:_0x33a389[_0xb86e('0x2a')]+_0x33a389[_0xb86e('0x2c')];var _0x326bef;if(_0x45835a>=_0xdafcd1){_0x45835a=_0xdafcd1;_0x326bef=0xc8;}else{_0x326bef=0xce;}_0x5bc058[_0xb86e('0x28')](_0x326bef);return _0x5bc058[_0xb86e('0x2e')](_0xb86e('0x2f'),_0x19de54+'-'+_0x45835a+'/'+_0xdafcd1)['json'](_0x355c00);}return null;};}function patchUpdates(_0x4a32e3){return function(_0xf805cc){try{jsonpatch[_0xb86e('0x30')](_0xf805cc,_0x4a32e3,!![]);}catch(_0x43b742){return BPromise[_0xb86e('0x31')](_0x43b742);}return _0xf805cc['save']();};}function saveUpdates(_0x47446a,_0x1ea3cb){return function(_0x5ec65f){if(_0x5ec65f){return _0x5ec65f[_0xb86e('0x32')](_0x47446a)[_0xb86e('0x1c')](function(_0x7fdae5){return _0x7fdae5;});}return null;};}function removeEntity(_0x110e97,_0x58f97c){return function(_0x447c84){if(_0x447c84){return _0x447c84[_0xb86e('0x33')]()['then'](function(){var _0x1137ea=_0x447c84[_0xb86e('0x34')]({'plain':!![]});var _0x2fd755=_0xb86e('0x35');return db[_0xb86e('0x36')][_0xb86e('0x33')]({'where':{'type':_0x2fd755,'resourceId':_0x1137ea['id']}})[_0xb86e('0x1c')](function(){return _0x447c84;});})[_0xb86e('0x1c')](function(){_0x110e97[_0xb86e('0x28')](0xcc)[_0xb86e('0x37')]();});}};}function handleEntityNotFound(_0x5d672a,_0x8ea709){return function(_0x11e704){if(!_0x11e704){_0x5d672a[_0xb86e('0x27')](0x194);}return _0x11e704;};}function handleError(_0x165f41,_0xd3b071){_0xd3b071=_0xd3b071||0x1f4;return function(_0x638235){logger['error'](_0x638235[_0xb86e('0x38')]);if(_0x638235[_0xb86e('0x39')]){delete _0x638235['name'];}_0x165f41['status'](_0xd3b071)[_0xb86e('0x3a')](_0x638235);};}exports[_0xb86e('0x3b')]=function(_0x3254ab,_0x2f496f){var _0x26e5b2={},_0x56cc5b={},_0x4a70e4={'count':0x0,'rows':[]};var _0x56d6e6=_['map'](db['VoiceContext'][_0xb86e('0x3c')],function(_0x4fe817){return{'name':_0x4fe817[_0xb86e('0x3d')],'type':_0x4fe817[_0xb86e('0x3e')][_0xb86e('0x3f')]};});_0x56cc5b['model']=_[_0xb86e('0x40')](_0x56d6e6,_0xb86e('0x39'));_0x56cc5b[_0xb86e('0x41')]=_[_0xb86e('0x42')](_0x3254ab[_0xb86e('0x41')]);_0x56cc5b[_0xb86e('0x43')]=_[_0xb86e('0x44')](_0x56cc5b['model'],_0x56cc5b[_0xb86e('0x41')]);_0x26e5b2[_0xb86e('0x45')]=_[_0xb86e('0x44')](_0x56cc5b[_0xb86e('0x46')],qs[_0xb86e('0x47')](_0x3254ab[_0xb86e('0x41')][_0xb86e('0x47')]));_0x26e5b2[_0xb86e('0x45')]=_0x26e5b2[_0xb86e('0x45')][_0xb86e('0x48')]?_0x26e5b2[_0xb86e('0x45')]:_0x56cc5b[_0xb86e('0x46')];if(!_0x3254ab[_0xb86e('0x41')]['hasOwnProperty'](_0xb86e('0x49'))){_0x26e5b2['limit']=qs[_0xb86e('0x2c')](_0x3254ab['query'][_0xb86e('0x2c')]);_0x26e5b2['offset']=qs[_0xb86e('0x2a')](_0x3254ab[_0xb86e('0x41')]['offset']);}_0x26e5b2[_0xb86e('0x4a')]=qs[_0xb86e('0x4b')](_0x3254ab[_0xb86e('0x41')]['sort']);_0x26e5b2['where']=qs[_0xb86e('0x43')](_[_0xb86e('0x4c')](_0x3254ab['query'],_0x56cc5b[_0xb86e('0x43')]),_0x56d6e6);if(_0x3254ab[_0xb86e('0x41')][_0xb86e('0x4d')]){_0x26e5b2[_0xb86e('0x4e')]=_[_0xb86e('0x4f')](_0x26e5b2[_0xb86e('0x4e')],{'$or':_[_0xb86e('0x40')](_0x56d6e6,function(_0x3cc08f){if(_0x3cc08f[_0xb86e('0x3e')]!==_0xb86e('0x50')){var _0xb1b135={};_0xb1b135[_0x3cc08f[_0xb86e('0x39')]]={'$like':'%'+_0x3254ab[_0xb86e('0x41')][_0xb86e('0x4d')]+'%'};return _0xb1b135;}})});}_0x26e5b2=_['merge']({},_0x26e5b2,_0x3254ab['options']);var _0x41859c={'where':_0x26e5b2[_0xb86e('0x4e')]};return db['VoiceContext'][_0xb86e('0x2d')](_0x41859c)[_0xb86e('0x1c')](function(_0x57adb7){_0x4a70e4['count']=_0x57adb7;if(_0x3254ab[_0xb86e('0x41')][_0xb86e('0x51')]){_0x26e5b2['include']=[{'all':!![]}];}return db['VoiceContext'][_0xb86e('0x52')](_0x26e5b2);})['then'](function(_0x5eefc6){_0x4a70e4[_0xb86e('0x53')]=_0x5eefc6;return _0x4a70e4;})[_0xb86e('0x1c')](respondWithFilteredResult(_0x2f496f,_0x26e5b2))[_0xb86e('0x26')](handleError(_0x2f496f,null));};exports[_0xb86e('0x54')]=function(_0x46c2a4,_0x160fcf){var _0xb10ba7={'raw':![],'where':{'id':_0x46c2a4[_0xb86e('0x55')]['id']}},_0x370265={};_0x370265[_0xb86e('0x46')]=_[_0xb86e('0x42')](db[_0xb86e('0x56')]['rawAttributes']);_0x370265[_0xb86e('0x41')]=_['keys'](_0x46c2a4['query']);_0x370265[_0xb86e('0x43')]=_['intersection'](_0x370265[_0xb86e('0x46')],_0x370265[_0xb86e('0x41')]);_0xb10ba7['attributes']=_['intersection'](_0x370265['model'],qs[_0xb86e('0x47')](_0x46c2a4[_0xb86e('0x41')]['fields']));_0xb10ba7['attributes']=_0xb10ba7['attributes'][_0xb86e('0x48')]?_0xb10ba7['attributes']:_0x370265[_0xb86e('0x46')];if(_0x46c2a4[_0xb86e('0x41')][_0xb86e('0x51')]){_0xb10ba7[_0xb86e('0x57')]=[{'all':!![]}];}_0xb10ba7=_[_0xb86e('0x4f')]({},_0xb10ba7,_0x46c2a4['options']);return db[_0xb86e('0x56')][_0xb86e('0x58')](_0xb10ba7)[_0xb86e('0x1c')](handleEntityNotFound(_0x160fcf,null))[_0xb86e('0x1c')](respondWithResult(_0x160fcf,null))[_0xb86e('0x26')](handleError(_0x160fcf,null));};exports[_0xb86e('0x59')]=function(_0x1a576e,_0x5275b7,_0x289ae2){var _0x44b1d4;return db[_0xb86e('0x56')][_0xb86e('0x59')](_0x1a576e['body'],{'raw':!![]})[_0xb86e('0x1c')](function(_0xade600){_0x44b1d4=_0xade600;return db[_0xb86e('0x56')][_0xb86e('0x52')]({'raw':!![]});})[_0xb86e('0x1c')](function(_0x4e94d2){var _0x339d81=fs[_0xb86e('0x5a')](path[_0xb86e('0x5b')](config[_0xb86e('0x5c')],_0xb86e('0x5d')),_0xb86e('0x5e'));var _0x2f9986=ejs[_0xb86e('0x5f')](_0x339d81,{'contexts':_0x4e94d2||[]});fs[_0xb86e('0x60')](_0xb86e('0x61'),_0x2f9986);})[_0xb86e('0x1c')](function(){return respondWithRpcPromise(_0xb86e('0x62'),_0xb86e('0x59'),{'module':_0xb86e('0x63')});})[_0xb86e('0x1c')](function(){var _0x5164d9=_0x1a576e[_0xb86e('0x64')][_0xb86e('0x34')]({'plain':!![]});if(!_0x5164d9)throw new Error(_0xb86e('0x65'));if(_0x5164d9['role']==='user'){var _0x5ccee6=_0x44b1d4[_0xb86e('0x34')]({'plain':!![]});return db[_0xb86e('0x66')][_0xb86e('0x58')]({'where':{'name':'Contexts','userProfileId':_0x5164d9['userProfileId']},'raw':!![]})[_0xb86e('0x1c')](function(_0x5820cb){if(_0x5820cb&&_0x5820cb['autoAssociation']===0x0){return db['UserProfileResource'][_0xb86e('0x59')]({'name':_0x5ccee6[_0xb86e('0x39')],'resourceId':_0x5ccee6['id'],'type':_0x5820cb[_0xb86e('0x39')],'sectionId':_0x5820cb['id']},{})[_0xb86e('0x1c')](function(){return _0x44b1d4;});}else{return _0x44b1d4;}})[_0xb86e('0x26')](function(_0x3cc774){logger[_0xb86e('0x22')](_0xb86e('0x67'),_0x3cc774);throw _0x3cc774;});}return _0x44b1d4;})[_0xb86e('0x1c')](respondWithResult(_0x5275b7,0xc9))[_0xb86e('0x26')](handleError(_0x5275b7,null));};exports[_0xb86e('0x32')]=function(_0x5eb3ec,_0x1cf2fe,_0x1ba6f3){var _0x10baca;return db[_0xb86e('0x56')][_0xb86e('0x58')]({'where':{'id':_0x5eb3ec[_0xb86e('0x55')]['id']}})[_0xb86e('0x1c')](handleEntityNotFound(_0x1cf2fe,null))[_0xb86e('0x1c')](saveUpdates(_0x5eb3ec['body'],null))['then'](function(_0x1afe36){if(_0x1afe36){_0x10baca=_0x1afe36;return db[_0xb86e('0x56')][_0xb86e('0x52')]({'raw':!![]});}})[_0xb86e('0x1c')](function(_0x620b1d){var _0x56aebf=fs[_0xb86e('0x5a')](path[_0xb86e('0x5b')](config[_0xb86e('0x5c')],_0xb86e('0x5d')),_0xb86e('0x5e'));var _0x3ef057=ejs[_0xb86e('0x5f')](_0x56aebf,{'contexts':_0x620b1d||[]});fs[_0xb86e('0x60')](_0xb86e('0x61'),_0x3ef057);})[_0xb86e('0x1c')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xb86e('0x63')});})['then'](function(){return _0x10baca;})[_0xb86e('0x1c')](respondWithResult(_0x1cf2fe,null))[_0xb86e('0x26')](handleError(_0x1cf2fe,null));};exports[_0xb86e('0x33')]=function(_0x122974,_0x48031f,_0x4642e9){var _0x5bf97e;return db[_0xb86e('0x56')]['find']({'where':{'id':_0x122974[_0xb86e('0x55')]['id']}})[_0xb86e('0x1c')](handleEntityNotFound(_0x48031f,null))[_0xb86e('0x1c')](removeEntity(_0x48031f,null))[_0xb86e('0x1c')](function(){return db[_0xb86e('0x56')][_0xb86e('0x52')]({'raw':!![]});})[_0xb86e('0x1c')](function(_0x220580){var _0x1de7cb=fs['readFileSync'](path[_0xb86e('0x5b')](config[_0xb86e('0x5c')],_0xb86e('0x5d')),_0xb86e('0x5e'));var _0x29621b=ejs[_0xb86e('0x5f')](_0x1de7cb,{'contexts':_0x220580});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x29621b);return respondWithRpcPromise(_0xb86e('0x62'),_0xb86e('0x33'),{'module':'chan_sip.so'});})[_0xb86e('0x26')](handleError(_0x48031f,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 2ea2e11..38be710 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 _0x5919=['voice_contexts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','VoiceContext'];(function(_0x13e758,_0x317d23){var _0x5b53c3=function(_0x103e80){while(--_0x103e80){_0x13e758['push'](_0x13e758['shift']());}};_0x5b53c3(++_0x317d23);}(_0x5919,0x198));var _0x9591=function(_0x28f5b7,_0x379e62){_0x28f5b7=_0x28f5b7-0x0;var _0x24df9c=_0x5919[_0x28f5b7];return _0x24df9c;};'use strict';var _=require(_0x9591('0x0'));var util=require('util');var logger=require(_0x9591('0x1'))(_0x9591('0x2'));var moment=require(_0x9591('0x3'));var BPromise=require(_0x9591('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9591('0x5'));var rimraf=require(_0x9591('0x6'));var config=require(_0x9591('0x7'));var attributes=require('./voiceContext.attributes');module[_0x9591('0x8')]=function(_0x2483a3,_0x218340){return _0x2483a3['define'](_0x9591('0x9'),attributes,{'tableName':_0x9591('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4700=['voice_contexts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0x4700,0x15d));var _0x0470=function(_0x38bd14,_0x3e77b5){_0x38bd14=_0x38bd14-0x0;var _0x214c08=_0x4700[_0x38bd14];return _0x214c08;};'use strict';var _=require('lodash');var util=require(_0x0470('0x0'));var logger=require(_0x0470('0x1'))('api');var moment=require(_0x0470('0x2'));var BPromise=require(_0x0470('0x3'));var rp=require(_0x0470('0x4'));var fs=require('fs');var path=require(_0x0470('0x5'));var rimraf=require(_0x0470('0x6'));var config=require('../../config/environment');var attributes=require(_0x0470('0x7'));module[_0x0470('0x8')]=function(_0x20bf5e,_0x509f45){return _0x20bf5e[_0x0470('0x9')](_0x0470('0xa'),attributes,{'tableName':_0x0470('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index acdf509..5258890 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 _0xc936=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util'];(function(_0x298455,_0x1ed1bc){var _0x3d234e=function(_0x216aa9){while(--_0x216aa9){_0x298455['push'](_0x298455['shift']());}};_0x3d234e(++_0x1ed1bc);}(_0xc936,0x153));var _0x6c93=function(_0x47d92d,_0x1654a7){_0x47d92d=_0x47d92d-0x0;var _0x4a1954=_0xc936[_0x47d92d];return _0x4a1954;};'use strict';var _=require('lodash');var util=require(_0x6c93('0x0'));var moment=require('moment');var BPromise=require(_0x6c93('0x1'));var rs=require(_0x6c93('0x2'));var fs=require('fs');var Redis=require(_0x6c93('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c93('0x4'));var logger=require(_0x6c93('0x5'))('rpc');var config=require(_0x6c93('0x6'));var jayson=require(_0x6c93('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ae0b5,_0x29be44,_0x246ee1){return new BPromise(function(_0x35d047,_0x3c51f9){return client[_0x6c93('0x8')](_0x1ae0b5,_0x246ee1)[_0x6c93('0x9')](function(_0x535d4a){logger[_0x6c93('0xa')](_0x6c93('0xb'),_0x29be44,'request\x20sent');logger['debug'](_0x6c93('0xc'),_0x29be44,_0x6c93('0xd'),JSON['stringify'](_0x535d4a));if(_0x535d4a[_0x6c93('0xe')]){if(_0x535d4a[_0x6c93('0xe')][_0x6c93('0xf')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x29be44,_0x535d4a[_0x6c93('0xe')][_0x6c93('0x10')]);return _0x3c51f9(_0x535d4a[_0x6c93('0xe')]['message']);}logger[_0x6c93('0xe')]('VoiceContext,\x20%s,\x20%s',_0x29be44,_0x535d4a[_0x6c93('0xe')]['message']);return _0x35d047(_0x535d4a[_0x6c93('0xe')][_0x6c93('0x10')]);}else{logger[_0x6c93('0xa')](_0x6c93('0xb'),_0x29be44,'request\x20sent');_0x35d047(_0x535d4a['result'][_0x6c93('0x10')]);}})['catch'](function(_0x150f36){logger[_0x6c93('0xe')](_0x6c93('0xb'),_0x29be44,_0x150f36);_0x3c51f9(_0x150f36);});});} \ No newline at end of file +var _0xd1f1=['../../config/environment','jayson/promise','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x50f0e9,_0x54378e){var _0x37ccd4=function(_0x50f00a){while(--_0x50f00a){_0x50f0e9['push'](_0x50f0e9['shift']());}};_0x37ccd4(++_0x54378e);}(_0xd1f1,0x84));var _0x1d1f=function(_0x4b60cc,_0x2e5e22){_0x4b60cc=_0x4b60cc-0x0;var _0x116ffe=_0xd1f1[_0x4b60cc];return _0x116ffe;};'use strict';var _=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var moment=require(_0x1d1f('0x2'));var BPromise=require(_0x1d1f('0x3'));var rs=require(_0x1d1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d1f('0x5'))['db'];var utils=require(_0x1d1f('0x6'));var logger=require(_0x1d1f('0x7'))('rpc');var config=require(_0x1d1f('0x8'));var jayson=require(_0x1d1f('0x9'));var client=jayson['client'][_0x1d1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c285a,_0xfe2b9,_0xf6f6ab){return new BPromise(function(_0x44f6c1,_0x20d937){return client['request'](_0x5c285a,_0xf6f6ab)['then'](function(_0x5372be){logger[_0x1d1f('0xb')](_0x1d1f('0xc'),_0xfe2b9,_0x1d1f('0xd'));logger[_0x1d1f('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xfe2b9,_0x1d1f('0xd'),JSON[_0x1d1f('0xf')](_0x5372be));if(_0x5372be[_0x1d1f('0x10')]){if(_0x5372be[_0x1d1f('0x10')][_0x1d1f('0x11')]===0x1f4){logger[_0x1d1f('0x10')]('VoiceContext,\x20%s,\x20%s',_0xfe2b9,_0x5372be['error']['message']);return _0x20d937(_0x5372be[_0x1d1f('0x10')][_0x1d1f('0x12')]);}logger[_0x1d1f('0x10')](_0x1d1f('0xc'),_0xfe2b9,_0x5372be[_0x1d1f('0x10')][_0x1d1f('0x12')]);return _0x44f6c1(_0x5372be[_0x1d1f('0x10')][_0x1d1f('0x12')]);}else{logger[_0x1d1f('0xb')](_0x1d1f('0xc'),_0xfe2b9,_0x1d1f('0xd'));_0x44f6c1(_0x5372be[_0x1d1f('0x13')][_0x1d1f('0x12')]);}})['catch'](function(_0xc11b2e){logger[_0x1d1f('0x10')](_0x1d1f('0xc'),_0xfe2b9,_0xc11b2e);_0x20d937(_0xc11b2e);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index b39c0ea..ebe7096 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 _0x40d4=['show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x40d4,0x16c));var _0x440d=function(_0xd4aa19,_0x2a01ac){_0xd4aa19=_0xd4aa19-0x0;var _0x53cb52=_0x40d4[_0xd4aa19];return _0x53cb52;};'use strict';var multer=require(_0x440d('0x0'));var util=require(_0x440d('0x1'));var path=require(_0x440d('0x2'));var timeout=require(_0x440d('0x3'));var express=require(_0x440d('0x4'));var router=express[_0x440d('0x5')]();var fs_extra=require(_0x440d('0x6'));var auth=require(_0x440d('0x7'));var interaction=require(_0x440d('0x8'));var config=require(_0x440d('0x9'));var controller=require('./voiceDialReport.controller');router[_0x440d('0xa')]('/',auth[_0x440d('0xb')](),controller[_0x440d('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x440d('0xa')](_0x440d('0xd'),auth[_0x440d('0xb')](),controller[_0x440d('0xe')]);router[_0x440d('0xf')]('/',auth[_0x440d('0xb')](),controller[_0x440d('0x10')]);router[_0x440d('0x11')]('/:id',auth[_0x440d('0xb')](),controller[_0x440d('0x12')]);router[_0x440d('0x13')](_0x440d('0xd'),auth[_0x440d('0xb')](),controller['destroy']);module[_0x440d('0x14')]=router; \ No newline at end of file +var _0x264f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x2d3fc9,_0x1ee4e8){var _0x3aa007=function(_0x4b0c72){while(--_0x4b0c72){_0x2d3fc9['push'](_0x2d3fc9['shift']());}};_0x3aa007(++_0x1ee4e8);}(_0x264f,0x19e));var _0xf264=function(_0x1df593,_0x180149){_0x1df593=_0x1df593-0x0;var _0x36111b=_0x264f[_0x1df593];return _0x36111b;};'use strict';var multer=require(_0xf264('0x0'));var util=require(_0xf264('0x1'));var path=require(_0xf264('0x2'));var timeout=require(_0xf264('0x3'));var express=require(_0xf264('0x4'));var router=express[_0xf264('0x5')]();var fs_extra=require(_0xf264('0x6'));var auth=require(_0xf264('0x7'));var interaction=require(_0xf264('0x8'));var config=require(_0xf264('0x9'));var controller=require('./voiceDialReport.controller');router[_0xf264('0xa')]('/',auth[_0xf264('0xb')](),controller[_0xf264('0xc')]);router['get'](_0xf264('0xd'),auth[_0xf264('0xb')](),controller[_0xf264('0xe')]);router['get'](_0xf264('0xf'),auth[_0xf264('0xb')](),controller[_0xf264('0x10')]);router[_0xf264('0x11')]('/',auth['isAuthenticated'](),controller[_0xf264('0x12')]);router[_0xf264('0x13')](_0xf264('0xf'),auth[_0xf264('0xb')](),controller[_0xf264('0x14')]);router['delete'](_0xf264('0xf'),auth['isAuthenticated'](),controller[_0xf264('0x15')]);module[_0xf264('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 8af3f99..cb2baec 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 _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x3fbbd0,_0x269a1f){var _0x135c98=function(_0x19cda4){while(--_0x19cda4){_0x3fbbd0['push'](_0x3fbbd0['shift']());}};_0x135c98(++_0x269a1f);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1b78e4,_0x22fc3f){_0x1b78e4=_0x1b78e4-0x0;var _0x321c55=_0x8d0e[_0x1b78e4];return _0x321c55;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file +var _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x1d5c20,_0x4e6e61){var _0x19ff06=function(_0x2a0de9){while(--_0x2a0de9){_0x1d5c20['push'](_0x1d5c20['shift']());}};_0x19ff06(++_0x4e6e61);}(_0x98a8,0x12c));var _0x898a=function(_0x28097b,_0x115c6e){_0x28097b=_0x28097b-0x0;var _0x451403=_0x98a8[_0x28097b];return _0x451403;};'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 diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index d19e0f2..b1dfe15 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 _0xbc0d=['lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra'];(function(_0x47f46f,_0x28a14d){var _0x31cacf=function(_0x552baa){while(--_0x552baa){_0x47f46f['push'](_0x47f46f['shift']());}};_0x31cacf(++_0x28a14d);}(_0xbc0d,0x8f));var _0xdbc0=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0xbc0d[_0x546aaf];return _0x1cbf6d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdbc0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbc0('0x1'));var moment=require(_0xdbc0('0x2'));var BPromise=require(_0xdbc0('0x3'));var Mustache=require(_0xdbc0('0x4'));var util=require(_0xdbc0('0x5'));var path=require('path');var sox=require(_0xdbc0('0x6'));var csv=require('to-csv');var ejs=require(_0xdbc0('0x7'));var fs=require('fs');var fs_extra=require(_0xdbc0('0x8'));var _=require(_0xdbc0('0x9'));var squel=require(_0xdbc0('0xa'));var crypto=require(_0xdbc0('0xb'));var jsforce=require(_0xdbc0('0xc'));var deskjs=require(_0xdbc0('0xd'));var toCsv=require(_0xdbc0('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdbc0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdbc0('0x10'));var as=require(_0xdbc0('0x11'));var hardwareService=require(_0xdbc0('0x12'));var logger=require(_0xdbc0('0x13'))('api');var utils=require(_0xdbc0('0x14'));var config=require(_0xdbc0('0x15'));var licenseUtil=require(_0xdbc0('0x16'));var db=require(_0xdbc0('0x17'))['db'];function respondWithStatusCode(_0x1bd1f7,_0x341af0){_0x341af0=_0x341af0||0xcc;return function(_0x59927f){if(_0x59927f){return _0x1bd1f7['sendStatus'](_0x341af0);}return _0x1bd1f7[_0xdbc0('0x18')](_0x341af0)[_0xdbc0('0x19')]();};}function respondWithResult(_0x4bb902,_0x49cf5e){_0x49cf5e=_0x49cf5e||0xc8;return function(_0xdfb2f9){if(_0xdfb2f9){return _0x4bb902[_0xdbc0('0x18')](_0x49cf5e)[_0xdbc0('0x1a')](_0xdfb2f9);}};}function respondWithFilteredResult(_0x422687,_0x462822){return function(_0x430a8a){if(_0x430a8a){var _0x535d8c=typeof _0x462822[_0xdbc0('0x1b')]===_0xdbc0('0x1c')&&typeof _0x462822[_0xdbc0('0x1d')]===_0xdbc0('0x1c');var _0x1b378d=_0x430a8a[_0xdbc0('0x1e')];var _0x4a7069=_0x535d8c?0x0:_0x462822[_0xdbc0('0x1b')];var _0x55256a=_0x535d8c?_0x430a8a['count']:_0x462822[_0xdbc0('0x1b')]+_0x462822[_0xdbc0('0x1d')];var _0x1a7bed;if(_0x55256a>=_0x1b378d){_0x55256a=_0x1b378d;_0x1a7bed=0xc8;}else{_0x1a7bed=0xce;}_0x422687[_0xdbc0('0x18')](_0x1a7bed);return _0x422687[_0xdbc0('0x1f')](_0xdbc0('0x20'),_0x4a7069+'-'+_0x55256a+'/'+_0x1b378d)[_0xdbc0('0x1a')](_0x430a8a);}return null;};}function patchUpdates(_0x4b79b4){return function(_0x441ea3){try{jsonpatch[_0xdbc0('0x21')](_0x441ea3,_0x4b79b4,!![]);}catch(_0x503222){return BPromise['reject'](_0x503222);}return _0x441ea3[_0xdbc0('0x22')]();};}function saveUpdates(_0x3e4257,_0x395c51){return function(_0x19b417){if(_0x19b417){return _0x19b417[_0xdbc0('0x23')](_0x3e4257)[_0xdbc0('0x24')](function(_0x26f36f){return _0x26f36f;});}return null;};}function removeEntity(_0x4d5cae,_0x172173){return function(_0x10aef1){if(_0x10aef1){return _0x10aef1[_0xdbc0('0x25')]()[_0xdbc0('0x24')](function(){_0x4d5cae[_0xdbc0('0x18')](0xcc)[_0xdbc0('0x19')]();});}};}function handleEntityNotFound(_0x38bb8b,_0x566900){return function(_0x5e8e4a){if(!_0x5e8e4a){_0x38bb8b[_0xdbc0('0x26')](0x194);}return _0x5e8e4a;};}function handleError(_0xd02fea,_0xe7f23a){_0xe7f23a=_0xe7f23a||0x1f4;return function(_0x26e9f4){logger[_0xdbc0('0x27')](_0x26e9f4[_0xdbc0('0x28')]);if(_0x26e9f4[_0xdbc0('0x29')]){delete _0x26e9f4[_0xdbc0('0x29')];}_0xd02fea['status'](_0xe7f23a)[_0xdbc0('0x2a')](_0x26e9f4);};}exports[_0xdbc0('0x2b')]=function(_0x1ee23f,_0x151928){var _0x28496c={},_0x3aed5b={},_0x4bf83a={'count':0x0,'rows':[]};var _0x6e4705=_[_0xdbc0('0x2c')](db['VoiceDialReport'][_0xdbc0('0x2d')],function(_0x4282d5){return{'name':_0x4282d5['fieldName'],'type':_0x4282d5[_0xdbc0('0x2e')][_0xdbc0('0x2f')]};});_0x3aed5b[_0xdbc0('0x30')]=_[_0xdbc0('0x2c')](_0x6e4705,_0xdbc0('0x29'));_0x3aed5b[_0xdbc0('0x31')]=_[_0xdbc0('0x32')](_0x1ee23f[_0xdbc0('0x31')]);_0x3aed5b[_0xdbc0('0x33')]=_[_0xdbc0('0x34')](_0x3aed5b[_0xdbc0('0x30')],_0x3aed5b['query']);_0x28496c[_0xdbc0('0x35')]=_[_0xdbc0('0x34')](_0x3aed5b[_0xdbc0('0x30')],qs[_0xdbc0('0x36')](_0x1ee23f[_0xdbc0('0x31')][_0xdbc0('0x36')]));_0x28496c[_0xdbc0('0x35')]=_0x28496c[_0xdbc0('0x35')]['length']?_0x28496c['attributes']:_0x3aed5b[_0xdbc0('0x30')];if(!_0x1ee23f[_0xdbc0('0x31')][_0xdbc0('0x37')]('nolimit')){_0x28496c[_0xdbc0('0x1d')]=qs[_0xdbc0('0x1d')](_0x1ee23f[_0xdbc0('0x31')]['limit']);_0x28496c[_0xdbc0('0x1b')]=qs[_0xdbc0('0x1b')](_0x1ee23f[_0xdbc0('0x31')][_0xdbc0('0x1b')]);}_0x28496c[_0xdbc0('0x38')]=qs[_0xdbc0('0x39')](_0x1ee23f[_0xdbc0('0x31')][_0xdbc0('0x39')]);_0x28496c[_0xdbc0('0x3a')]=qs['filters'](_[_0xdbc0('0x3b')](_0x1ee23f[_0xdbc0('0x31')],_0x3aed5b['filters']),_0x6e4705);if(_0x1ee23f[_0xdbc0('0x31')][_0xdbc0('0x3c')]){_0x28496c[_0xdbc0('0x3a')]=_[_0xdbc0('0x3d')](_0x28496c['where'],{'$or':_[_0xdbc0('0x2c')](_0x6e4705,function(_0x27ef6d){if(_0x27ef6d[_0xdbc0('0x2e')]!==_0xdbc0('0x3e')){var _0x4d8aff={};_0x4d8aff[_0x27ef6d['name']]={'$like':'%'+_0x1ee23f[_0xdbc0('0x31')][_0xdbc0('0x3c')]+'%'};return _0x4d8aff;}})});}_0x28496c=_['merge']({},_0x28496c,_0x1ee23f[_0xdbc0('0x3f')]);var _0x42422e={'where':_0x28496c[_0xdbc0('0x3a')]};return db[_0xdbc0('0x40')][_0xdbc0('0x1e')](_0x42422e)[_0xdbc0('0x24')](function(_0x11c94f){_0x4bf83a[_0xdbc0('0x1e')]=_0x11c94f;if(_0x1ee23f[_0xdbc0('0x31')][_0xdbc0('0x41')]){_0x28496c[_0xdbc0('0x42')]=[{'all':!![]}];}return db[_0xdbc0('0x40')][_0xdbc0('0x43')](_0x28496c);})[_0xdbc0('0x24')](function(_0x184153){_0x4bf83a['rows']=_0x184153;return _0x4bf83a;})[_0xdbc0('0x24')](respondWithFilteredResult(_0x151928,_0x28496c))[_0xdbc0('0x44')](handleError(_0x151928,null));};exports[_0xdbc0('0x45')]=function(_0x3ba7ec,_0x11f107){var _0x9637c5={'raw':!![],'where':{'id':_0x3ba7ec[_0xdbc0('0x46')]['id']}},_0x27eb5a={};_0x27eb5a[_0xdbc0('0x30')]=_[_0xdbc0('0x32')](db[_0xdbc0('0x40')]['rawAttributes']);_0x27eb5a[_0xdbc0('0x31')]=_[_0xdbc0('0x32')](_0x3ba7ec[_0xdbc0('0x31')]);_0x27eb5a['filters']=_['intersection'](_0x27eb5a[_0xdbc0('0x30')],_0x27eb5a[_0xdbc0('0x31')]);_0x9637c5[_0xdbc0('0x35')]=_[_0xdbc0('0x34')](_0x27eb5a['model'],qs[_0xdbc0('0x36')](_0x3ba7ec[_0xdbc0('0x31')][_0xdbc0('0x36')]));_0x9637c5[_0xdbc0('0x35')]=_0x9637c5[_0xdbc0('0x35')][_0xdbc0('0x47')]?_0x9637c5[_0xdbc0('0x35')]:_0x27eb5a[_0xdbc0('0x30')];if(_0x3ba7ec[_0xdbc0('0x31')]['includeAll']){_0x9637c5['include']=[{'all':!![]}];}_0x9637c5=_['merge']({},_0x9637c5,_0x3ba7ec[_0xdbc0('0x3f')]);return db['VoiceDialReport'][_0xdbc0('0x48')](_0x9637c5)['then'](handleEntityNotFound(_0x11f107,null))[_0xdbc0('0x24')](respondWithResult(_0x11f107,null))['catch'](handleError(_0x11f107,null));};exports['create']=function(_0x53c3bb,_0x146c33){return db[_0xdbc0('0x40')][_0xdbc0('0x49')](_0x53c3bb[_0xdbc0('0x4a')],{})[_0xdbc0('0x24')](respondWithResult(_0x146c33,0xc9))[_0xdbc0('0x44')](handleError(_0x146c33,null));};exports[_0xdbc0('0x23')]=function(_0x40b5e6,_0x4e6df8){if(_0x40b5e6['body']['id']){delete _0x40b5e6[_0xdbc0('0x4a')]['id'];}return db[_0xdbc0('0x40')][_0xdbc0('0x48')]({'where':{'id':_0x40b5e6[_0xdbc0('0x46')]['id']}})[_0xdbc0('0x24')](handleEntityNotFound(_0x4e6df8,null))[_0xdbc0('0x24')](saveUpdates(_0x40b5e6[_0xdbc0('0x4a')],null))[_0xdbc0('0x24')](respondWithResult(_0x4e6df8,null))[_0xdbc0('0x44')](handleError(_0x4e6df8,null));};exports[_0xdbc0('0x25')]=function(_0x11013a,_0x4216b0){return db[_0xdbc0('0x40')][_0xdbc0('0x48')]({'where':{'id':_0x11013a['params']['id']}})['then'](handleEntityNotFound(_0x4216b0,null))['then'](removeEntity(_0x4216b0,null))['catch'](handleError(_0x4216b0,null));};exports[_0xdbc0('0x4b')]=function(_0xa63e80,_0x4c8821){return db['VoiceDialReport'][_0xdbc0('0x4b')]()[_0xdbc0('0x24')](respondWithResult(_0x4c8821,null))[_0xdbc0('0x44')](handleError(_0x4c8821,null));}; \ No newline at end of file +var _0x08b7=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','catch','params','include','create','find','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x59f6be,_0x472a09){var _0x2aef59=function(_0x4d72d9){while(--_0x4d72d9){_0x59f6be['push'](_0x59f6be['shift']());}};_0x2aef59(++_0x472a09);}(_0x08b7,0x1b0));var _0x708b=function(_0x2d9179,_0x1e95d9){_0x2d9179=_0x2d9179-0x0;var _0x1025a=_0x08b7[_0x2d9179];return _0x1025a;};'use strict';var emlformat=require(_0x708b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x708b('0x1'));var rp=require(_0x708b('0x2'));var moment=require(_0x708b('0x3'));var BPromise=require(_0x708b('0x4'));var Mustache=require(_0x708b('0x5'));var util=require(_0x708b('0x6'));var path=require(_0x708b('0x7'));var sox=require(_0x708b('0x8'));var csv=require(_0x708b('0x9'));var ejs=require(_0x708b('0xa'));var fs=require('fs');var fs_extra=require(_0x708b('0xb'));var _=require(_0x708b('0xc'));var squel=require(_0x708b('0xd'));var crypto=require(_0x708b('0xe'));var jsforce=require(_0x708b('0xf'));var deskjs=require(_0x708b('0x10'));var toCsv=require(_0x708b('0x9'));var querystring=require(_0x708b('0x11'));var Papa=require(_0x708b('0x12'));var Redis=require(_0x708b('0x13'));var authService=require(_0x708b('0x14'));var qs=require(_0x708b('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x708b('0x16'));var logger=require(_0x708b('0x17'))('api');var utils=require(_0x708b('0x18'));var config=require(_0x708b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x708b('0x1a'))['db'];function respondWithStatusCode(_0x549544,_0x199ff4){_0x199ff4=_0x199ff4||0xcc;return function(_0x84cca){if(_0x84cca){return _0x549544[_0x708b('0x1b')](_0x199ff4);}return _0x549544[_0x708b('0x1c')](_0x199ff4)[_0x708b('0x1d')]();};}function respondWithResult(_0x1632c6,_0x5df8fa){_0x5df8fa=_0x5df8fa||0xc8;return function(_0x381326){if(_0x381326){return _0x1632c6[_0x708b('0x1c')](_0x5df8fa)[_0x708b('0x1e')](_0x381326);}};}function respondWithFilteredResult(_0x3ee11b,_0x51cc93){return function(_0x4ef2b5){if(_0x4ef2b5){var _0x121d3=typeof _0x51cc93[_0x708b('0x1f')]===_0x708b('0x20')&&typeof _0x51cc93[_0x708b('0x21')]===_0x708b('0x20');var _0x1e34aa=_0x4ef2b5[_0x708b('0x22')];var _0x635820=_0x121d3?0x0:_0x51cc93[_0x708b('0x1f')];var _0x1018ea=_0x121d3?_0x4ef2b5[_0x708b('0x22')]:_0x51cc93[_0x708b('0x1f')]+_0x51cc93[_0x708b('0x21')];var _0x2a59fd;if(_0x1018ea>=_0x1e34aa){_0x1018ea=_0x1e34aa;_0x2a59fd=0xc8;}else{_0x2a59fd=0xce;}_0x3ee11b['status'](_0x2a59fd);return _0x3ee11b[_0x708b('0x23')](_0x708b('0x24'),_0x635820+'-'+_0x1018ea+'/'+_0x1e34aa)[_0x708b('0x1e')](_0x4ef2b5);}return null;};}function patchUpdates(_0x154f92){return function(_0x4934f){try{jsonpatch[_0x708b('0x25')](_0x4934f,_0x154f92,!![]);}catch(_0x444834){return BPromise[_0x708b('0x26')](_0x444834);}return _0x4934f[_0x708b('0x27')]();};}function saveUpdates(_0x4495b1,_0x53b10b){return function(_0x92bf62){if(_0x92bf62){return _0x92bf62[_0x708b('0x28')](_0x4495b1)[_0x708b('0x29')](function(_0x4d12cd){return _0x4d12cd;});}return null;};}function removeEntity(_0x2d1a16,_0x12ada0){return function(_0x25dc11){if(_0x25dc11){return _0x25dc11[_0x708b('0x2a')]()[_0x708b('0x29')](function(){_0x2d1a16['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3ea1,_0x5208c5){return function(_0x55b75f){if(!_0x55b75f){_0x3b3ea1[_0x708b('0x1b')](0x194);}return _0x55b75f;};}function handleError(_0x360165,_0x1db930){_0x1db930=_0x1db930||0x1f4;return function(_0x51336b){logger['error'](_0x51336b[_0x708b('0x2b')]);if(_0x51336b[_0x708b('0x2c')]){delete _0x51336b[_0x708b('0x2c')];}_0x360165['status'](_0x1db930)[_0x708b('0x2d')](_0x51336b);};}exports[_0x708b('0x2e')]=function(_0x526069,_0x2bf47c){var _0xda0566={},_0x3544c1={},_0x106daf={'count':0x0,'rows':[]};var _0x52d298=_[_0x708b('0x2f')](db[_0x708b('0x30')][_0x708b('0x31')],function(_0x4bb62e){return{'name':_0x4bb62e[_0x708b('0x32')],'type':_0x4bb62e[_0x708b('0x33')][_0x708b('0x34')]};});_0x3544c1[_0x708b('0x35')]=_[_0x708b('0x2f')](_0x52d298,'name');_0x3544c1['query']=_[_0x708b('0x36')](_0x526069['query']);_0x3544c1['filters']=_['intersection'](_0x3544c1[_0x708b('0x35')],_0x3544c1[_0x708b('0x37')]);_0xda0566[_0x708b('0x38')]=_[_0x708b('0x39')](_0x3544c1[_0x708b('0x35')],qs[_0x708b('0x3a')](_0x526069[_0x708b('0x37')]['fields']));_0xda0566[_0x708b('0x38')]=_0xda0566[_0x708b('0x38')][_0x708b('0x3b')]?_0xda0566[_0x708b('0x38')]:_0x3544c1[_0x708b('0x35')];if(!_0x526069[_0x708b('0x37')][_0x708b('0x3c')](_0x708b('0x3d'))){_0xda0566[_0x708b('0x21')]=qs['limit'](_0x526069[_0x708b('0x37')][_0x708b('0x21')]);_0xda0566[_0x708b('0x1f')]=qs[_0x708b('0x1f')](_0x526069['query'][_0x708b('0x1f')]);}_0xda0566[_0x708b('0x3e')]=qs['sort'](_0x526069['query'][_0x708b('0x3f')]);_0xda0566[_0x708b('0x40')]=qs[_0x708b('0x41')](_[_0x708b('0x42')](_0x526069[_0x708b('0x37')],_0x3544c1[_0x708b('0x41')]),_0x52d298);if(_0x526069[_0x708b('0x37')]['filter']){_0xda0566[_0x708b('0x40')]=_[_0x708b('0x43')](_0xda0566[_0x708b('0x40')],{'$or':_[_0x708b('0x2f')](_0x52d298,function(_0x45c049){if(_0x45c049[_0x708b('0x33')]!=='VIRTUAL'){var _0x530208={};_0x530208[_0x45c049['name']]={'$like':'%'+_0x526069[_0x708b('0x37')]['filter']+'%'};return _0x530208;}})});}_0xda0566=_['merge']({},_0xda0566,_0x526069[_0x708b('0x44')]);var _0x46d477={'where':_0xda0566[_0x708b('0x40')]};return db['VoiceDialReport'][_0x708b('0x22')](_0x46d477)[_0x708b('0x29')](function(_0x4502a9){_0x106daf['count']=_0x4502a9;if(_0x526069[_0x708b('0x37')]['includeAll']){_0xda0566['include']=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0xda0566);})['then'](function(_0x5a462a){_0x106daf['rows']=_0x5a462a;return _0x106daf;})['then'](respondWithFilteredResult(_0x2bf47c,_0xda0566))[_0x708b('0x45')](handleError(_0x2bf47c,null));};exports['show']=function(_0x797de2,_0x8dc35c){var _0x54ae7a={'raw':!![],'where':{'id':_0x797de2[_0x708b('0x46')]['id']}},_0x391c40={};_0x391c40[_0x708b('0x35')]=_['keys'](db['VoiceDialReport']['rawAttributes']);_0x391c40[_0x708b('0x37')]=_[_0x708b('0x36')](_0x797de2['query']);_0x391c40[_0x708b('0x41')]=_[_0x708b('0x39')](_0x391c40['model'],_0x391c40[_0x708b('0x37')]);_0x54ae7a[_0x708b('0x38')]=_[_0x708b('0x39')](_0x391c40['model'],qs[_0x708b('0x3a')](_0x797de2[_0x708b('0x37')]['fields']));_0x54ae7a[_0x708b('0x38')]=_0x54ae7a[_0x708b('0x38')][_0x708b('0x3b')]?_0x54ae7a[_0x708b('0x38')]:_0x391c40[_0x708b('0x35')];if(_0x797de2[_0x708b('0x37')]['includeAll']){_0x54ae7a[_0x708b('0x47')]=[{'all':!![]}];}_0x54ae7a=_[_0x708b('0x43')]({},_0x54ae7a,_0x797de2[_0x708b('0x44')]);return db['VoiceDialReport']['find'](_0x54ae7a)[_0x708b('0x29')](handleEntityNotFound(_0x8dc35c,null))[_0x708b('0x29')](respondWithResult(_0x8dc35c,null))[_0x708b('0x45')](handleError(_0x8dc35c,null));};exports[_0x708b('0x48')]=function(_0x5e6884,_0x2af121){return db[_0x708b('0x30')][_0x708b('0x48')](_0x5e6884['body'],{})[_0x708b('0x29')](respondWithResult(_0x2af121,0xc9))[_0x708b('0x45')](handleError(_0x2af121,null));};exports[_0x708b('0x28')]=function(_0x21a766,_0x53357b){if(_0x21a766['body']['id']){delete _0x21a766['body']['id'];}return db[_0x708b('0x30')][_0x708b('0x49')]({'where':{'id':_0x21a766[_0x708b('0x46')]['id']}})[_0x708b('0x29')](handleEntityNotFound(_0x53357b,null))[_0x708b('0x29')](saveUpdates(_0x21a766[_0x708b('0x4a')],null))['then'](respondWithResult(_0x53357b,null))['catch'](handleError(_0x53357b,null));};exports[_0x708b('0x2a')]=function(_0x552a90,_0x352810){return db[_0x708b('0x30')][_0x708b('0x49')]({'where':{'id':_0x552a90[_0x708b('0x46')]['id']}})[_0x708b('0x29')](handleEntityNotFound(_0x352810,null))['then'](removeEntity(_0x352810,null))[_0x708b('0x45')](handleError(_0x352810,null));};exports[_0x708b('0x4b')]=function(_0x4a643e,_0xd4f386){return db[_0x708b('0x30')]['describe']()['then'](respondWithResult(_0xd4f386,null))[_0x708b('0x45')](handleError(_0xd4f386,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 705bb63..08866d9 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 _0xd2c4=['bluebird','request-promise','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','../../config/logger','api','moment'];(function(_0x5b24c2,_0x367fa7){var _0x209ac2=function(_0x5cc82b){while(--_0x5cc82b){_0x5b24c2['push'](_0x5b24c2['shift']());}};_0x209ac2(++_0x367fa7);}(_0xd2c4,0x110));var _0x4d2c=function(_0x3bb43c,_0x5e18f3){_0x3bb43c=_0x3bb43c-0x0;var _0x1c5bf9=_0xd2c4[_0x3bb43c];return _0x1c5bf9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4d2c('0x0'))(_0x4d2c('0x1'));var moment=require(_0x4d2c('0x2'));var BPromise=require(_0x4d2c('0x3'));var rp=require(_0x4d2c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d2c('0x5'));var config=require('../../config/environment');var attributes=require(_0x4d2c('0x6'));module[_0x4d2c('0x7')]=function(_0x134ef0,_0x42dfff){return _0x134ef0[_0x4d2c('0x8')](_0x4d2c('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x4d2c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb1=['path','../../config/environment','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5a9788,_0x1768ef){var _0x2c513b=function(_0x4e18cd){while(--_0x4e18cd){_0x5a9788['push'](_0x5a9788['shift']());}};_0x2c513b(++_0x1768ef);}(_0x2eb1,0xb0));var _0x12eb=function(_0x3a09ea,_0x45b8f4){_0x3a09ea=_0x3a09ea-0x0;var _0x1e2d27=_0x2eb1[_0x3a09ea];return _0x1e2d27;};'use strict';var _=require(_0x12eb('0x0'));var util=require(_0x12eb('0x1'));var logger=require('../../config/logger')(_0x12eb('0x2'));var moment=require(_0x12eb('0x3'));var BPromise=require(_0x12eb('0x4'));var rp=require(_0x12eb('0x5'));var fs=require('fs');var path=require(_0x12eb('0x6'));var rimraf=require('rimraf');var config=require(_0x12eb('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x12eb('0x8')]=function(_0x261315,_0x19cdd2){return _0x261315[_0x12eb('0x9')](_0x12eb('0xa'),attributes,{'tableName':_0x12eb('0xb'),'paranoid':![],'indexes':[{'fields':[_0x12eb('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 5f10a0c..5cadf04 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 _0x288f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateVoiceDialReport','create','options','stringify','catch','UpdateVoiceDialReport','VoiceDialReport','update','body','raw','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x434179,_0x21181f){var _0xac926f=function(_0xc8218){while(--_0xc8218){_0x434179['push'](_0x434179['shift']());}};_0xac926f(++_0x21181f);}(_0x288f,0xcd));var _0xf288=function(_0x12a674,_0x475b5b){_0x12a674=_0x12a674-0x0;var _0x28680a=_0x288f[_0x12a674];return _0x28680a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf288('0x0'));var BPromise=require(_0xf288('0x1'));var rs=require(_0xf288('0x2'));var fs=require('fs');var Redis=require(_0xf288('0x3'));var db=require(_0xf288('0x4'))['db'];var utils=require(_0xf288('0x5'));var logger=require(_0xf288('0x6'))(_0xf288('0x7'));var config=require(_0xf288('0x8'));var jayson=require(_0xf288('0x9'));var client=jayson[_0xf288('0xa')][_0xf288('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fa49a,_0x15815f,_0xf20295){return new BPromise(function(_0xd80205,_0x3fe558){return client['request'](_0x4fa49a,_0xf20295)[_0xf288('0xc')](function(_0x1a407b){logger['info'](_0xf288('0xd'),_0x15815f,_0xf288('0xe'));logger[_0xf288('0xf')](_0xf288('0x10'),_0x15815f,_0xf288('0xe'),JSON['stringify'](_0x1a407b));if(_0x1a407b[_0xf288('0x11')]){if(_0x1a407b['error'][_0xf288('0x12')]===0x1f4){logger[_0xf288('0x11')](_0xf288('0xd'),_0x15815f,_0x1a407b[_0xf288('0x11')][_0xf288('0x13')]);return _0x3fe558(_0x1a407b['error'][_0xf288('0x13')]);}logger[_0xf288('0x11')](_0xf288('0xd'),_0x15815f,_0x1a407b[_0xf288('0x11')][_0xf288('0x13')]);return _0xd80205(_0x1a407b[_0xf288('0x11')][_0xf288('0x13')]);}else{logger[_0xf288('0x14')](_0xf288('0xd'),_0x15815f,_0xf288('0xe'));_0xd80205(_0x1a407b[_0xf288('0x15')]['message']);}})['catch'](function(_0x19416c){logger['error'](_0xf288('0xd'),_0x15815f,_0x19416c);_0x3fe558(_0x19416c);});});}exports[_0xf288('0x16')]=function(_0x507370){var _0x470aaf=this;return new Promise(function(_0x1ecb1a,_0x47431c){return db['VoiceDialReport'][_0xf288('0x17')](_0x507370['body'],{'raw':_0x507370[_0xf288('0x18')]?_0x507370['options']['raw']===undefined?!![]:![]:!![]})[_0xf288('0xc')](function(_0x3e5d14){logger['info'](_0xf288('0x16'),_0x507370);logger[_0xf288('0xf')]('CreateVoiceDialReport',_0x507370,JSON[_0xf288('0x19')](_0x3e5d14));_0x1ecb1a(_0x3e5d14);})[_0xf288('0x1a')](function(_0x51ddfa){logger[_0xf288('0x11')]('CreateVoiceDialReport',_0x51ddfa[_0xf288('0x13')],_0x507370);_0x47431c(_0x470aaf[_0xf288('0x11')](0x1f4,_0x51ddfa[_0xf288('0x13')]));});});};exports[_0xf288('0x1b')]=function(_0x5e0f09){var _0x155bb9=this;return new Promise(function(_0x226582,_0x358403){return db[_0xf288('0x1c')][_0xf288('0x1d')](_0x5e0f09[_0xf288('0x1e')],{'raw':_0x5e0f09[_0xf288('0x18')]?_0x5e0f09[_0xf288('0x18')][_0xf288('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e0f09[_0xf288('0x18')]?_0x5e0f09[_0xf288('0x18')][_0xf288('0x20')]||null:null,'attributes':_0x5e0f09[_0xf288('0x18')]?_0x5e0f09[_0xf288('0x18')][_0xf288('0x21')]||null:null,'limit':_0x5e0f09['options']?_0x5e0f09['options'][_0xf288('0x22')]||null:null})[_0xf288('0xc')](function(_0x41bef8){logger[_0xf288('0x14')](_0xf288('0x1b'),_0x5e0f09);logger['debug']('UpdateVoiceDialReport',_0x5e0f09,JSON[_0xf288('0x19')](_0x41bef8));_0x226582(_0x41bef8);})['catch'](function(_0x52cccc){logger[_0xf288('0x11')](_0xf288('0x1b'),_0x52cccc[_0xf288('0x13')],_0x5e0f09);_0x358403(_0x155bb9[_0xf288('0x11')](0x1f4,_0x52cccc['message']));});});}; \ No newline at end of file +var _0xc181=['limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','result','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','update','where','attributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc181,0x183));var _0x1c18=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0xc181[_0x8fa4bc];return _0x35b6a7;};'use strict';var _=require(_0x1c18('0x0'));var util=require(_0x1c18('0x1'));var moment=require(_0x1c18('0x2'));var BPromise=require(_0x1c18('0x3'));var rs=require(_0x1c18('0x4'));var fs=require('fs');var Redis=require(_0x1c18('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c18('0x6'));var logger=require(_0x1c18('0x7'))(_0x1c18('0x8'));var config=require(_0x1c18('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1c18('0xa')][_0x1c18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cb558,_0x1d4083,_0x6822e8){return new BPromise(function(_0x153bd4,_0x65fb24){return client[_0x1c18('0xc')](_0x3cb558,_0x6822e8)[_0x1c18('0xd')](function(_0x90d2d3){logger[_0x1c18('0xe')](_0x1c18('0xf'),_0x1d4083,_0x1c18('0x10'));logger[_0x1c18('0x11')](_0x1c18('0x12'),_0x1d4083,_0x1c18('0x10'),JSON[_0x1c18('0x13')](_0x90d2d3));if(_0x90d2d3[_0x1c18('0x14')]){if(_0x90d2d3[_0x1c18('0x14')]['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x1d4083,_0x90d2d3[_0x1c18('0x14')]['message']);return _0x65fb24(_0x90d2d3[_0x1c18('0x14')]['message']);}logger[_0x1c18('0x14')](_0x1c18('0xf'),_0x1d4083,_0x90d2d3['error']['message']);return _0x153bd4(_0x90d2d3[_0x1c18('0x14')]['message']);}else{logger[_0x1c18('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x1d4083,_0x1c18('0x10'));_0x153bd4(_0x90d2d3[_0x1c18('0x15')][_0x1c18('0x16')]);}})[_0x1c18('0x17')](function(_0x5eabdd){logger['error'](_0x1c18('0xf'),_0x1d4083,_0x5eabdd);_0x65fb24(_0x5eabdd);});});}exports[_0x1c18('0x18')]=function(_0x33db88){var _0x88aebe=this;return new Promise(function(_0xc1d06f,_0x9bafdc){return db[_0x1c18('0x19')][_0x1c18('0x1a')](_0x33db88[_0x1c18('0x1b')],{'raw':_0x33db88[_0x1c18('0x1c')]?_0x33db88[_0x1c18('0x1c')][_0x1c18('0x1d')]===undefined?!![]:![]:!![]})[_0x1c18('0xd')](function(_0x22549b){logger['info'](_0x1c18('0x18'),_0x33db88);logger[_0x1c18('0x11')](_0x1c18('0x18'),_0x33db88,JSON['stringify'](_0x22549b));_0xc1d06f(_0x22549b);})[_0x1c18('0x17')](function(_0x3d4e77){logger[_0x1c18('0x14')]('CreateVoiceDialReport',_0x3d4e77[_0x1c18('0x16')],_0x33db88);_0x9bafdc(_0x88aebe[_0x1c18('0x14')](0x1f4,_0x3d4e77[_0x1c18('0x16')]));});});};exports['UpdateVoiceDialReport']=function(_0x121ef1){var _0x19b7c5=this;return new Promise(function(_0x5cf141,_0x2fed65){return db[_0x1c18('0x19')][_0x1c18('0x1e')](_0x121ef1[_0x1c18('0x1b')],{'raw':_0x121ef1[_0x1c18('0x1c')]?_0x121ef1['options'][_0x1c18('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x121ef1[_0x1c18('0x1c')]?_0x121ef1['options'][_0x1c18('0x1f')]||null:null,'attributes':_0x121ef1[_0x1c18('0x1c')]?_0x121ef1['options'][_0x1c18('0x20')]||null:null,'limit':_0x121ef1[_0x1c18('0x1c')]?_0x121ef1[_0x1c18('0x1c')][_0x1c18('0x21')]||null:null})[_0x1c18('0xd')](function(_0x1d2ed7){logger[_0x1c18('0xe')](_0x1c18('0x22'),_0x121ef1);logger[_0x1c18('0x11')]('UpdateVoiceDialReport',_0x121ef1,JSON[_0x1c18('0x13')](_0x1d2ed7));_0x5cf141(_0x1d2ed7);})[_0x1c18('0x17')](function(_0x6e276d){logger[_0x1c18('0x14')]('UpdateVoiceDialReport',_0x6e276d[_0x1c18('0x16')],_0x121ef1);_0x2fed65(_0x19b7c5['error'](0x1f4,_0x6e276d[_0x1c18('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 046ed34..250cf5b 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 _0x3d22=['../../config/environment','get','isAuthenticated','index','/:id','show','post','/:id/applications','put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x286efe,_0x355b34){var _0x16bec3=function(_0x27919d){while(--_0x27919d){_0x286efe['push'](_0x286efe['shift']());}};_0x16bec3(++_0x355b34);}(_0x3d22,0x9d));var _0x23d2=function(_0x28c148,_0x865c6a){_0x28c148=_0x28c148-0x0;var _0x411524=_0x3d22[_0x28c148];return _0x411524;};'use strict';var multer=require(_0x23d2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x23d2('0x1')]();var fs_extra=require(_0x23d2('0x2'));var auth=require(_0x23d2('0x3'));var interaction=require(_0x23d2('0x4'));var config=require(_0x23d2('0x5'));var controller=require('./voiceExtension.controller');router[_0x23d2('0x6')]('/',auth[_0x23d2('0x7')](),controller[_0x23d2('0x8')]);router[_0x23d2('0x6')](_0x23d2('0x9'),auth['isAuthenticated'](),controller[_0x23d2('0xa')]);router[_0x23d2('0xb')]('/',auth[_0x23d2('0x7')](),controller['create']);router[_0x23d2('0xb')](_0x23d2('0xc'),auth[_0x23d2('0x7')](),controller['addApplications']);router[_0x23d2('0xd')]('/:id',auth[_0x23d2('0x7')](),controller[_0x23d2('0xe')]);router[_0x23d2('0xf')](_0x23d2('0x9'),auth[_0x23d2('0x7')](),controller[_0x23d2('0x10')]);module[_0x23d2('0x11')]=router; \ No newline at end of file +var _0x2295=['create','/:id/applications','isAuthenticated','addApplications','put','delete','destroy','connect-timeout','express','get','/:id','post'];(function(_0x36a94f,_0x3fcc6c){var _0x4ba69f=function(_0x362371){while(--_0x362371){_0x36a94f['push'](_0x36a94f['shift']());}};_0x4ba69f(++_0x3fcc6c);}(_0x2295,0x1f3));var _0x5229=function(_0x1b3825,_0x30dfab){_0x1b3825=_0x1b3825-0x0;var _0x21c16b=_0x2295[_0x1b3825];return _0x21c16b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5229('0x0'));var express=require(_0x5229('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x5229('0x2')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5229('0x2')](_0x5229('0x3'),auth['isAuthenticated'](),controller['show']);router[_0x5229('0x4')]('/',auth['isAuthenticated'](),controller[_0x5229('0x5')]);router[_0x5229('0x4')](_0x5229('0x6'),auth[_0x5229('0x7')](),controller[_0x5229('0x8')]);router[_0x5229('0x9')](_0x5229('0x3'),auth[_0x5229('0x7')](),controller['update']);router[_0x5229('0xa')](_0x5229('0x3'),auth[_0x5229('0x7')](),controller[_0x5229('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index b3a45c2..cbea2de 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 _0xbe99=['outbound','outbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM'];(function(_0xa90ce1,_0x2659e4){var _0x5d428a=function(_0x3450fc){while(--_0x3450fc){_0xa90ce1['push'](_0xa90ce1['shift']());}};_0x5d428a(++_0x2659e4);}(_0xbe99,0x1bb));var _0x9be9=function(_0x5768b0,_0x4ffb64){_0x5768b0=_0x5768b0-0x0;var _0x44d203=_0xbe99[_0x5768b0];return _0x44d203;};'use strict';var Sequelize=require(_0x9be9('0x0'));module['exports']={'context':{'type':Sequelize[_0x9be9('0x1')],'allowNull':![],'unique':_0x9be9('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x9be9('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x9be9('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x9be9('0x1')],'allowNull':![],'defaultValue':_0x9be9('0x3')},'appdata':{'type':Sequelize[_0x9be9('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x9be9('0x4')]('inbound',_0x9be9('0x5'),'internal','inbound-fax',_0x9be9('0x6'),_0x9be9('0x7'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x9be9('0x1')]},'interval':{'type':Sequelize[_0x9be9('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x9be9('0x8')]},'isApp':{'type':Sequelize[_0x9be9('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x9be9('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x9be9('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x9be9('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x9be9('0xa')},'answer':{'type':Sequelize[_0x9be9('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0x9be9('0xb')],'get':function(_0x49c18c){return this[_0x9be9('0xc')](_0x9be9('0xd'));}},'alias':{'type':Sequelize[_0x9be9('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xdbf0=['BOOLEAN','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','system','any','*,*,*,*','INTEGER'];(function(_0xce35b0,_0x54dc88){var _0x3c7d3a=function(_0x4dd36d){while(--_0x4dd36d){_0xce35b0['push'](_0xce35b0['shift']());}};_0x3c7d3a(++_0x54dc88);}(_0xdbf0,0x162));var _0x0dbf=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdbf0[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x0dbf('0x0'));module[_0x0dbf('0x1')]={'context':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'unique':_0x0dbf('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'unique':_0x0dbf('0x3')},'priority':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'defaultValue':_0x0dbf('0x4')},'appdata':{'type':Sequelize[_0x0dbf('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0dbf('0x5')](_0x0dbf('0x6'),_0x0dbf('0x7'),_0x0dbf('0x8'),_0x0dbf('0x9'),'outbound-fax',_0x0dbf('0xa'),_0x0dbf('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x0dbf('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0dbf('0xc')},'IntervalId':{'type':Sequelize[_0x0dbf('0xd')]},'isApp':{'type':Sequelize[_0x0dbf('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0dbf('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0dbf('0xd')]},'recordingFormat':{'type':Sequelize[_0x0dbf('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x51fab3){return this['getDataValue'](_0x0dbf('0xf'));}},'alias':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index f37a23a..fc32b75 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 _0x0d29=['InternalRoutes','internal','filter','ignore','map','value','type','name','UserProfileResource','sendStatus','error','stack','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','startsWith','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','addApplications','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound'];(function(_0x3c685a,_0x2ef8c8){var _0x54567e=function(_0x12ffba){while(--_0x12ffba){_0x3c685a['push'](_0x3c685a['shift']());}};_0x54567e(++_0x2ef8c8);}(_0x0d29,0xaa));var _0x90d2=function(_0x30c8a2,_0x4e24c1){_0x30c8a2=_0x30c8a2-0x0;var _0x693512=_0x0d29[_0x30c8a2];return _0x693512;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x90d2('0x0'));var jsonpatch=require(_0x90d2('0x1'));var rp=require(_0x90d2('0x2'));var moment=require(_0x90d2('0x3'));var BPromise=require(_0x90d2('0x4'));var Mustache=require('mustache');var util=require(_0x90d2('0x5'));var path=require(_0x90d2('0x6'));var sox=require(_0x90d2('0x7'));var csv=require(_0x90d2('0x8'));var ejs=require(_0x90d2('0x9'));var fs=require('fs');var fs_extra=require(_0x90d2('0xa'));var _=require(_0x90d2('0xb'));var squel=require(_0x90d2('0xc'));var crypto=require(_0x90d2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x90d2('0xe'));var toCsv=require(_0x90d2('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x90d2('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x90d2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90d2('0x11'))(_0x90d2('0x12'));var utils=require(_0x90d2('0x13'));var config=require(_0x90d2('0x14'));var licenseUtil=require(_0x90d2('0x15'));var db=require(_0x90d2('0x16'))['db'];config[_0x90d2('0x17')]=_[_0x90d2('0x18')](config[_0x90d2('0x17')],{'host':_0x90d2('0x19'),'port':0x18eb});var socket=require(_0x90d2('0x1a'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x90d2('0x1b')](socket);function respondWithStatusCode(_0x55c551,_0x4b4c8d){_0x4b4c8d=_0x4b4c8d||0xcc;return function(_0x4ee034){if(_0x4ee034){return _0x55c551['sendStatus'](_0x4b4c8d);}return _0x55c551['status'](_0x4b4c8d)[_0x90d2('0x1c')]();};}function respondWithResult(_0x55c40a,_0x48162a){_0x48162a=_0x48162a||0xc8;return function(_0x545c5a){if(_0x545c5a){return _0x55c40a[_0x90d2('0x1d')](_0x48162a)['json'](_0x545c5a);}};}function respondWithFilteredResult(_0x2ea43d,_0x113df4){return function(_0x1f4e1c){if(_0x1f4e1c){var _0x5ccfca=typeof _0x113df4[_0x90d2('0x1e')]===_0x90d2('0x1f')&&typeof _0x113df4[_0x90d2('0x20')]===_0x90d2('0x1f');var _0x4bea8b=_0x1f4e1c[_0x90d2('0x21')];var _0x9ab03=_0x5ccfca?0x0:_0x113df4[_0x90d2('0x1e')];var _0x1c7e40=_0x5ccfca?_0x1f4e1c[_0x90d2('0x21')]:_0x113df4[_0x90d2('0x1e')]+_0x113df4['limit'];var _0x229be1;if(_0x1c7e40>=_0x4bea8b){_0x1c7e40=_0x4bea8b;_0x229be1=0xc8;}else{_0x229be1=0xce;}_0x2ea43d['status'](_0x229be1);return _0x2ea43d[_0x90d2('0x22')](_0x90d2('0x23'),_0x9ab03+'-'+_0x1c7e40+'/'+_0x4bea8b)['json'](_0x1f4e1c);}return null;};}function patchUpdates(_0x5846af){return function(_0x111412){try{jsonpatch[_0x90d2('0x24')](_0x111412,_0x5846af,!![]);}catch(_0x2c5362){return BPromise['reject'](_0x2c5362);}return _0x111412[_0x90d2('0x25')]();};}function saveUpdates(_0x408ea0,_0x39448c){return function(_0x4bcc19){if(_0x4bcc19){return _0x4bcc19[_0x90d2('0x26')](_0x408ea0)[_0x90d2('0x27')](function(_0x7120bb){return _0x7120bb;});}return null;};}function removeEntity(_0x35defe,_0x2dbdbc){return function(_0x557546){if(_0x557546){return _0x557546[_0x90d2('0x28')]()[_0x90d2('0x27')](function(){var _0x5e924e=_0x557546[_0x90d2('0x29')]({'plain':!![]});var _0x2d3459=[{'name':_0x90d2('0x2a'),'value':_0x90d2('0x2b'),'ignore':![]},{'name':_0x90d2('0x2c'),'value':_0x90d2('0x2d'),'ignore':![]},{'name':_0x90d2('0x2e'),'value':_0x90d2('0x2f'),'ignore':![]}];var _0x3f0adf=_(_0x2d3459)[_0x90d2('0x30')](_0x90d2('0x31'))[_0x90d2('0x32')](_0x90d2('0x33'))[_0x90d2('0x33')]();if(_['includes'](_0x3f0adf,_0x5e924e[_0x90d2('0x34')])){return;}var _0x19e29a=_['find'](_0x2d3459,['value',_0x5e924e[_0x90d2('0x34')]])[_0x90d2('0x35')];return db[_0x90d2('0x36')][_0x90d2('0x28')]({'where':{'type':_0x19e29a,'resourceId':_0x5e924e['id']}})[_0x90d2('0x27')](function(){return _0x557546;});})[_0x90d2('0x27')](function(){_0x35defe[_0x90d2('0x1d')](0xcc)[_0x90d2('0x1c')]();});}};}function handleEntityNotFound(_0x5b7320,_0x440754){return function(_0x3bbf17){if(!_0x3bbf17){_0x5b7320[_0x90d2('0x37')](0x194);}return _0x3bbf17;};}function handleError(_0x30c73a,_0xa38034){_0xa38034=_0xa38034||0x1f4;return function(_0x198039){logger[_0x90d2('0x38')](_0x198039[_0x90d2('0x39')]);if(_0x198039[_0x90d2('0x35')]){delete _0x198039['name'];}_0x30c73a['status'](_0xa38034)['send'](_0x198039);};}exports['index']=function(_0x3d8365,_0xff0a00){var _0x5a1aa0={},_0x3748e2={},_0x4a43cd={'count':0x0,'rows':[]};var _0x47fdca=_[_0x90d2('0x32')](db[_0x90d2('0x3a')][_0x90d2('0x3b')],function(_0xd59157){return{'name':_0xd59157[_0x90d2('0x3c')],'type':_0xd59157[_0x90d2('0x34')][_0x90d2('0x3d')]};});_0x3748e2[_0x90d2('0x3e')]=_[_0x90d2('0x32')](_0x47fdca,_0x90d2('0x35'));_0x3748e2[_0x90d2('0x3f')]=_[_0x90d2('0x40')](_0x3d8365[_0x90d2('0x3f')]);_0x3748e2[_0x90d2('0x41')]=_[_0x90d2('0x42')](_0x3748e2[_0x90d2('0x3e')],_0x3748e2[_0x90d2('0x3f')]);_0x5a1aa0[_0x90d2('0x43')]=_['intersection'](_0x3748e2[_0x90d2('0x3e')],qs[_0x90d2('0x44')](_0x3d8365[_0x90d2('0x3f')]['fields']));_0x5a1aa0[_0x90d2('0x43')]=_0x5a1aa0[_0x90d2('0x43')][_0x90d2('0x45')]?_0x5a1aa0[_0x90d2('0x43')]:_0x3748e2[_0x90d2('0x3e')];if(!_0x3d8365[_0x90d2('0x3f')][_0x90d2('0x46')](_0x90d2('0x47'))){_0x5a1aa0[_0x90d2('0x20')]=qs[_0x90d2('0x20')](_0x3d8365[_0x90d2('0x3f')][_0x90d2('0x20')]);_0x5a1aa0['offset']=qs['offset'](_0x3d8365[_0x90d2('0x3f')]['offset']);}_0x5a1aa0[_0x90d2('0x48')]=qs[_0x90d2('0x49')](_0x3d8365[_0x90d2('0x3f')]['sort']);_0x5a1aa0[_0x90d2('0x4a')]=qs['filters'](_[_0x90d2('0x4b')](_0x3d8365['query'],_0x3748e2[_0x90d2('0x41')]),_0x47fdca);if(_0x3d8365['query'][_0x90d2('0x30')]){_0x5a1aa0[_0x90d2('0x4a')]=_[_0x90d2('0x4c')](_0x5a1aa0[_0x90d2('0x4a')],{'$or':_['map'](_0x47fdca,function(_0x224ff3){if(_0x224ff3[_0x90d2('0x34')]!=='VIRTUAL'){var _0x193fee={};_0x193fee[_0x224ff3[_0x90d2('0x35')]]={'$like':'%'+_0x3d8365[_0x90d2('0x3f')][_0x90d2('0x30')]+'%'};return _0x193fee;}})});}_0x5a1aa0=_[_0x90d2('0x4c')]({},_0x5a1aa0,_0x3d8365[_0x90d2('0x4d')]);var _0x8e9e46={'where':_0x5a1aa0[_0x90d2('0x4a')]};return db[_0x90d2('0x3a')][_0x90d2('0x21')](_0x8e9e46)[_0x90d2('0x27')](function(_0x5aec86){_0x4a43cd[_0x90d2('0x21')]=_0x5aec86;if(_0x3d8365[_0x90d2('0x3f')][_0x90d2('0x4e')]){_0x5a1aa0[_0x90d2('0x4f')]=[{'all':!![]}];}return db[_0x90d2('0x3a')][_0x90d2('0x50')](_0x5a1aa0);})[_0x90d2('0x27')](function(_0x5d94c3){_0x4a43cd[_0x90d2('0x51')]=_0x5d94c3;return _0x4a43cd;})[_0x90d2('0x27')](respondWithFilteredResult(_0xff0a00,_0x5a1aa0))[_0x90d2('0x52')](handleError(_0xff0a00,null));};exports[_0x90d2('0x53')]=function(_0x5ebdfb,_0x5a48da){var _0x538a41={'raw':![],'where':{'id':_0x5ebdfb[_0x90d2('0x54')]['id']}},_0xccab64={};_0xccab64['model']=_['keys'](db[_0x90d2('0x3a')]['rawAttributes']);_0xccab64[_0x90d2('0x3f')]=_[_0x90d2('0x40')](_0x5ebdfb[_0x90d2('0x3f')]);_0xccab64[_0x90d2('0x41')]=_[_0x90d2('0x42')](_0xccab64[_0x90d2('0x3e')],_0xccab64[_0x90d2('0x3f')]);_0x538a41[_0x90d2('0x43')]=_[_0x90d2('0x42')](_0xccab64[_0x90d2('0x3e')],qs[_0x90d2('0x44')](_0x5ebdfb[_0x90d2('0x3f')][_0x90d2('0x44')]));_0x538a41[_0x90d2('0x43')]=_0x538a41[_0x90d2('0x43')][_0x90d2('0x45')]?_0x538a41['attributes']:_0xccab64[_0x90d2('0x3e')];if(_0x5ebdfb[_0x90d2('0x3f')][_0x90d2('0x4e')]){_0x538a41[_0x90d2('0x4f')]=[{'all':!![]}];}_0x538a41=_[_0x90d2('0x4c')]({},_0x538a41,_0x5ebdfb[_0x90d2('0x4d')]);return db['VoiceExtension']['find'](_0x538a41)[_0x90d2('0x27')](handleEntityNotFound(_0x5a48da,null))['then'](respondWithResult(_0x5a48da,null))[_0x90d2('0x52')](handleError(_0x5a48da,null));};exports[_0x90d2('0x28')]=function(_0x2a5515,_0x55aa81){return db[_0x90d2('0x3a')][_0x90d2('0x55')]({'where':{'id':_0x2a5515['params']['id']}})[_0x90d2('0x27')](handleEntityNotFound(_0x55aa81,null))[_0x90d2('0x27')](removeEntity(_0x55aa81,null))[_0x90d2('0x52')](handleError(_0x55aa81,null));};exports[_0x90d2('0x56')]=function(_0x105a41,_0x1d9fac){if(_0x105a41[_0x90d2('0x57')][_0x90d2('0x34')]===_0x90d2('0x2d')&&!_[_0x90d2('0x58')](_0x105a41[_0x90d2('0x57')]['exten'],'_')){_0x105a41['body'][_0x90d2('0x59')]='_'['concat'](_0x105a41[_0x90d2('0x57')][_0x90d2('0x59')]);}return db[_0x90d2('0x3a')][_0x90d2('0x56')](_0x105a41[_0x90d2('0x57')],{'raw':![]})[_0x90d2('0x27')](function(_0x5ecf38){var _0x49a0c0=_0x105a41['user']['get']({'plain':!![]});if(!_0x49a0c0)throw new Error(_0x90d2('0x5a'));if(_0x49a0c0['role']===_0x90d2('0x5b')){var _0x434874=_0x5ecf38['get']({'plain':!![]});var _0xd9853b=[{'name':_0x90d2('0x2a'),'value':_0x90d2('0x2b')},{'name':_0x90d2('0x2c'),'value':_0x90d2('0x2d')},{'name':_0x90d2('0x2e'),'value':_0x90d2('0x2f')}];var _0x3b31f8=_[_0x90d2('0x55')](_0xd9853b,[_0x90d2('0x33'),_0x434874['type']])[_0x90d2('0x35')];return db['UserProfileSection'][_0x90d2('0x55')]({'where':{'name':_0x3b31f8,'userProfileId':_0x49a0c0[_0x90d2('0x5c')]},'raw':!![]})[_0x90d2('0x27')](function(_0x3eb177){if(_0x3eb177&&_0x3eb177[_0x90d2('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x434874['name'],'resourceId':_0x434874['id'],'type':_0x3eb177[_0x90d2('0x35')],'sectionId':_0x3eb177['id']},{})[_0x90d2('0x27')](function(){return _0x5ecf38;});}else{return _0x5ecf38;}})[_0x90d2('0x52')](function(_0xc1c1a0){logger[_0x90d2('0x38')](_0x90d2('0x5e'),_0xc1c1a0);throw _0xc1c1a0;});}return _0x5ecf38;})[_0x90d2('0x27')](respondWithResult(_0x1d9fac,0xc9))[_0x90d2('0x52')](handleError(_0x1d9fac,null));};exports['update']=function(_0x38d6b2,_0x31246f){if(_0x38d6b2[_0x90d2('0x57')]['id']){delete _0x38d6b2[_0x90d2('0x57')]['id'];}return db[_0x90d2('0x3a')][_0x90d2('0x55')]({'where':{'id':_0x38d6b2[_0x90d2('0x54')]['id']}})['then'](handleEntityNotFound(_0x31246f,null))[_0x90d2('0x27')](function(_0x440369){if(_0x440369){return db['VoiceExtension']['update'](_[_0x90d2('0x4b')](_0x38d6b2[_0x90d2('0x57')],[_0x90d2('0x59'),_0x90d2('0x5f'),_0x90d2('0x60'),_0x90d2('0x61'),'cutdigits','mandatoryDisposition','alias']),{'where':{'context':_0x440369[_0x90d2('0x5f')],'exten':_0x440369[_0x90d2('0x59')]},'individualHooks':!![]})[_0x90d2('0x27')](function(_0x5b7d65){return _0x5b7d65;});}return null;})[_0x90d2('0x27')](respondWithStatusCode(_0x31246f,null))[_0x90d2('0x52')](handleError(_0x31246f,null));};exports[_0x90d2('0x62')]=function(_0x256e85,_0xbc7e47){return db[_0x90d2('0x3a')]['findOne']({'where':{'id':_0x256e85[_0x90d2('0x54')]['id']}})[_0x90d2('0x27')](function(_0x1339e1){if(_0x1339e1){return db[_0x90d2('0x63')][_0x90d2('0x64')](function(_0x3e6a55){return db['VoiceExtension'][_0x90d2('0x28')]({'where':{'VoiceExtensionId':_0x256e85[_0x90d2('0x54')]['id']},'transaction':_0x3e6a55})[_0x90d2('0x27')](function(){var _0x1d99ff=_[_0x90d2('0x32')](_0x256e85[_0x90d2('0x57')],function(_0x25cbc3){_0x25cbc3[_0x90d2('0x65')]=_0x256e85['params']['id'];_0x25cbc3[_0x90d2('0x66')]=!![];return _0x25cbc3;});var _0x22aebf=_0x256e85[_0x90d2('0x3f')][_0x90d2('0x67')]&&_0x256e85[_0x90d2('0x3f')]['rewriteDial'][_0x90d2('0x68')]()===_0x90d2('0x69')?!![]:![];return _0x1339e1[_0x90d2('0x6a')](_0x1d99ff,_0x22aebf);})[_0x90d2('0x27')](function(_0x421c76){return db['VoiceExtension'][_0x90d2('0x6b')](_0x421c76,{'transaction':_0x3e6a55});});})[_0x90d2('0x27')](function(){return db[_0x90d2('0x3a')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x256e85[_0x90d2('0x54')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0xbc7e47,null))[_0x90d2('0x52')](handleError(_0xbc7e47,null));}; \ No newline at end of file +var _0x28a5=['findAll','rows','catch','show','params','includeAll','include','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','destroy','then','get','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','stack','send','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','options'];(function(_0x436570,_0xdf34e4){var _0x5936c3=function(_0x25ba64){while(--_0x25ba64){_0x436570['push'](_0x436570['shift']());}};_0x5936c3(++_0xdf34e4);}(_0x28a5,0x175));var _0x528a=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x28a5[_0x5311e8];return _0x582ad8;};'use strict';var emlformat=require(_0x528a('0x0'));var rimraf=require(_0x528a('0x1'));var zipdir=require(_0x528a('0x2'));var jsonpatch=require(_0x528a('0x3'));var rp=require(_0x528a('0x4'));var moment=require(_0x528a('0x5'));var BPromise=require(_0x528a('0x6'));var Mustache=require(_0x528a('0x7'));var util=require(_0x528a('0x8'));var path=require(_0x528a('0x9'));var sox=require(_0x528a('0xa'));var csv=require(_0x528a('0xb'));var ejs=require(_0x528a('0xc'));var fs=require('fs');var fs_extra=require(_0x528a('0xd'));var _=require('lodash');var squel=require(_0x528a('0xe'));var crypto=require(_0x528a('0xf'));var jsforce=require(_0x528a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x528a('0xb'));var querystring=require(_0x528a('0x11'));var Papa=require(_0x528a('0x12'));var Redis=require(_0x528a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x528a('0x14'));var as=require(_0x528a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x528a('0x16'));var utils=require(_0x528a('0x17'));var config=require(_0x528a('0x18'));var licenseUtil=require(_0x528a('0x19'));var db=require(_0x528a('0x1a'))['db'];config[_0x528a('0x1b')]=_[_0x528a('0x1c')](config['redis'],{'host':_0x528a('0x1d'),'port':0x18eb});var socket=require(_0x528a('0x1e'))(new Redis(config[_0x528a('0x1b')]));require('./voiceExtension.socket')[_0x528a('0x1f')](socket);function respondWithStatusCode(_0x3c6257,_0x190a47){_0x190a47=_0x190a47||0xcc;return function(_0x4b9089){if(_0x4b9089){return _0x3c6257[_0x528a('0x20')](_0x190a47);}return _0x3c6257[_0x528a('0x21')](_0x190a47)[_0x528a('0x22')]();};}function respondWithResult(_0x409f0f,_0x48854f){_0x48854f=_0x48854f||0xc8;return function(_0x35125f){if(_0x35125f){return _0x409f0f[_0x528a('0x21')](_0x48854f)[_0x528a('0x23')](_0x35125f);}};}function respondWithFilteredResult(_0x589fd4,_0x4636da){return function(_0x4ce97a){if(_0x4ce97a){var _0x5967a5=typeof _0x4636da[_0x528a('0x24')]===_0x528a('0x25')&&typeof _0x4636da['limit']===_0x528a('0x25');var _0x137105=_0x4ce97a[_0x528a('0x26')];var _0x348ea5=_0x5967a5?0x0:_0x4636da['offset'];var _0x53e5f4=_0x5967a5?_0x4ce97a['count']:_0x4636da[_0x528a('0x24')]+_0x4636da[_0x528a('0x27')];var _0x1cf461;if(_0x53e5f4>=_0x137105){_0x53e5f4=_0x137105;_0x1cf461=0xc8;}else{_0x1cf461=0xce;}_0x589fd4[_0x528a('0x21')](_0x1cf461);return _0x589fd4['set'](_0x528a('0x28'),_0x348ea5+'-'+_0x53e5f4+'/'+_0x137105)[_0x528a('0x23')](_0x4ce97a);}return null;};}function patchUpdates(_0x26d2fd){return function(_0x1603ff){try{jsonpatch['apply'](_0x1603ff,_0x26d2fd,!![]);}catch(_0x31f61f){return BPromise[_0x528a('0x29')](_0x31f61f);}return _0x1603ff['save']();};}function saveUpdates(_0x439b8b,_0x155061){return function(_0x3a211a){if(_0x3a211a){return _0x3a211a['update'](_0x439b8b)['then'](function(_0x8d9e29){return _0x8d9e29;});}return null;};}function removeEntity(_0x561b69,_0x2b51f6){return function(_0x521afa){if(_0x521afa){return _0x521afa[_0x528a('0x2a')]()[_0x528a('0x2b')](function(){var _0x1496a0=_0x521afa[_0x528a('0x2c')]({'plain':!![]});var _0x23a067=[{'name':'InboundRoutes','value':_0x528a('0x2d'),'ignore':![]},{'name':'OutboundRoutes','value':_0x528a('0x2e'),'ignore':![]},{'name':_0x528a('0x2f'),'value':_0x528a('0x30'),'ignore':![]}];var _0x1b3f58=_(_0x23a067)[_0x528a('0x31')](_0x528a('0x32'))[_0x528a('0x33')]('value')[_0x528a('0x34')]();if(_[_0x528a('0x35')](_0x1b3f58,_0x1496a0['type'])){return;}var _0x46bb4f=_[_0x528a('0x36')](_0x23a067,[_0x528a('0x34'),_0x1496a0[_0x528a('0x37')]])[_0x528a('0x38')];return db[_0x528a('0x39')][_0x528a('0x2a')]({'where':{'type':_0x46bb4f,'resourceId':_0x1496a0['id']}})[_0x528a('0x2b')](function(){return _0x521afa;});})[_0x528a('0x2b')](function(){_0x561b69[_0x528a('0x21')](0xcc)[_0x528a('0x22')]();});}};}function handleEntityNotFound(_0x527196,_0x23985d){return function(_0x53f057){if(!_0x53f057){_0x527196[_0x528a('0x20')](0x194);}return _0x53f057;};}function handleError(_0xbefe6e,_0x41c745){_0x41c745=_0x41c745||0x1f4;return function(_0x3a725f){logger[_0x528a('0x3a')](_0x3a725f[_0x528a('0x3b')]);if(_0x3a725f['name']){delete _0x3a725f[_0x528a('0x38')];}_0xbefe6e['status'](_0x41c745)[_0x528a('0x3c')](_0x3a725f);};}exports['index']=function(_0xf9abb5,_0x5cd5e5){var _0x363284={},_0x6d23f4={},_0x3c0744={'count':0x0,'rows':[]};var _0x3d6799=_['map'](db[_0x528a('0x3d')][_0x528a('0x3e')],function(_0x8b86a8){return{'name':_0x8b86a8['fieldName'],'type':_0x8b86a8['type'][_0x528a('0x3f')]};});_0x6d23f4[_0x528a('0x40')]=_[_0x528a('0x33')](_0x3d6799,'name');_0x6d23f4[_0x528a('0x41')]=_[_0x528a('0x42')](_0xf9abb5[_0x528a('0x41')]);_0x6d23f4[_0x528a('0x43')]=_[_0x528a('0x44')](_0x6d23f4[_0x528a('0x40')],_0x6d23f4[_0x528a('0x41')]);_0x363284[_0x528a('0x45')]=_[_0x528a('0x44')](_0x6d23f4['model'],qs['fields'](_0xf9abb5[_0x528a('0x41')][_0x528a('0x46')]));_0x363284[_0x528a('0x45')]=_0x363284[_0x528a('0x45')][_0x528a('0x47')]?_0x363284[_0x528a('0x45')]:_0x6d23f4[_0x528a('0x40')];if(!_0xf9abb5['query'][_0x528a('0x48')]('nolimit')){_0x363284[_0x528a('0x27')]=qs[_0x528a('0x27')](_0xf9abb5[_0x528a('0x41')]['limit']);_0x363284['offset']=qs[_0x528a('0x24')](_0xf9abb5[_0x528a('0x41')]['offset']);}_0x363284[_0x528a('0x49')]=qs[_0x528a('0x4a')](_0xf9abb5[_0x528a('0x41')][_0x528a('0x4a')]);_0x363284['where']=qs[_0x528a('0x43')](_[_0x528a('0x4b')](_0xf9abb5[_0x528a('0x41')],_0x6d23f4[_0x528a('0x43')]),_0x3d6799);if(_0xf9abb5['query'][_0x528a('0x31')]){_0x363284['where']=_[_0x528a('0x4c')](_0x363284[_0x528a('0x4d')],{'$or':_['map'](_0x3d6799,function(_0xa2e0a2){if(_0xa2e0a2[_0x528a('0x37')]!=='VIRTUAL'){var _0x26a618={};_0x26a618[_0xa2e0a2[_0x528a('0x38')]]={'$like':'%'+_0xf9abb5['query']['filter']+'%'};return _0x26a618;}})});}_0x363284=_['merge']({},_0x363284,_0xf9abb5[_0x528a('0x4e')]);var _0x1017da={'where':_0x363284['where']};return db[_0x528a('0x3d')]['count'](_0x1017da)[_0x528a('0x2b')](function(_0x29f53a){_0x3c0744[_0x528a('0x26')]=_0x29f53a;if(_0xf9abb5[_0x528a('0x41')]['includeAll']){_0x363284['include']=[{'all':!![]}];}return db[_0x528a('0x3d')][_0x528a('0x4f')](_0x363284);})[_0x528a('0x2b')](function(_0x35cfdf){_0x3c0744[_0x528a('0x50')]=_0x35cfdf;return _0x3c0744;})[_0x528a('0x2b')](respondWithFilteredResult(_0x5cd5e5,_0x363284))[_0x528a('0x51')](handleError(_0x5cd5e5,null));};exports[_0x528a('0x52')]=function(_0x88da53,_0x286b8a){var _0x136ff8={'raw':![],'where':{'id':_0x88da53[_0x528a('0x53')]['id']}},_0x5a6ee5={};_0x5a6ee5[_0x528a('0x40')]=_[_0x528a('0x42')](db[_0x528a('0x3d')][_0x528a('0x3e')]);_0x5a6ee5[_0x528a('0x41')]=_[_0x528a('0x42')](_0x88da53[_0x528a('0x41')]);_0x5a6ee5[_0x528a('0x43')]=_[_0x528a('0x44')](_0x5a6ee5[_0x528a('0x40')],_0x5a6ee5[_0x528a('0x41')]);_0x136ff8[_0x528a('0x45')]=_[_0x528a('0x44')](_0x5a6ee5[_0x528a('0x40')],qs[_0x528a('0x46')](_0x88da53[_0x528a('0x41')][_0x528a('0x46')]));_0x136ff8['attributes']=_0x136ff8[_0x528a('0x45')][_0x528a('0x47')]?_0x136ff8['attributes']:_0x5a6ee5[_0x528a('0x40')];if(_0x88da53['query'][_0x528a('0x54')]){_0x136ff8[_0x528a('0x55')]=[{'all':!![]}];}_0x136ff8=_[_0x528a('0x4c')]({},_0x136ff8,_0x88da53[_0x528a('0x4e')]);return db['VoiceExtension'][_0x528a('0x36')](_0x136ff8)[_0x528a('0x2b')](handleEntityNotFound(_0x286b8a,null))[_0x528a('0x2b')](respondWithResult(_0x286b8a,null))[_0x528a('0x51')](handleError(_0x286b8a,null));};exports[_0x528a('0x2a')]=function(_0x16e7de,_0x4926c3){return db[_0x528a('0x3d')][_0x528a('0x36')]({'where':{'id':_0x16e7de['params']['id']}})['then'](handleEntityNotFound(_0x4926c3,null))[_0x528a('0x2b')](removeEntity(_0x4926c3,null))[_0x528a('0x51')](handleError(_0x4926c3,null));};exports['create']=function(_0x28331f,_0x3ddc29){if(_0x28331f['body']['type']===_0x528a('0x2e')&&!_['startsWith'](_0x28331f[_0x528a('0x56')][_0x528a('0x57')],'_')){_0x28331f[_0x528a('0x56')]['exten']='_'[_0x528a('0x58')](_0x28331f['body']['exten']);}return db[_0x528a('0x3d')][_0x528a('0x59')](_0x28331f[_0x528a('0x56')],{'raw':![]})['then'](function(_0x4232a0){var _0x5cca05=_0x28331f[_0x528a('0x5a')][_0x528a('0x2c')]({'plain':!![]});if(!_0x5cca05)throw new Error(_0x528a('0x5b'));if(_0x5cca05[_0x528a('0x5c')]===_0x528a('0x5a')){var _0x327a06=_0x4232a0[_0x528a('0x2c')]({'plain':!![]});var _0x4f10bd=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x528a('0x5d'),'value':_0x528a('0x2e')},{'name':_0x528a('0x2f'),'value':_0x528a('0x30')}];var _0x3b771f=_[_0x528a('0x36')](_0x4f10bd,[_0x528a('0x34'),_0x327a06[_0x528a('0x37')]])[_0x528a('0x38')];return db[_0x528a('0x5e')]['find']({'where':{'name':_0x3b771f,'userProfileId':_0x5cca05[_0x528a('0x5f')]},'raw':!![]})[_0x528a('0x2b')](function(_0x2af297){if(_0x2af297&&_0x2af297[_0x528a('0x60')]===0x0){return db[_0x528a('0x39')][_0x528a('0x59')]({'name':_0x327a06['name'],'resourceId':_0x327a06['id'],'type':_0x2af297['name'],'sectionId':_0x2af297['id']},{})['then'](function(){return _0x4232a0;});}else{return _0x4232a0;}})['catch'](function(_0x3e28ad){logger[_0x528a('0x3a')](_0x528a('0x61'),_0x3e28ad);throw _0x3e28ad;});}return _0x4232a0;})['then'](respondWithResult(_0x3ddc29,0xc9))[_0x528a('0x51')](handleError(_0x3ddc29,null));};exports[_0x528a('0x62')]=function(_0x126c01,_0x328ab0){if(_0x126c01[_0x528a('0x56')]['id']){delete _0x126c01[_0x528a('0x56')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x126c01[_0x528a('0x53')]['id']}})[_0x528a('0x2b')](handleEntityNotFound(_0x328ab0,null))['then'](function(_0x24b641){if(_0x24b641){return db['VoiceExtension'][_0x528a('0x62')](_[_0x528a('0x4b')](_0x126c01[_0x528a('0x56')],[_0x528a('0x57'),'context',_0x528a('0x63'),_0x528a('0x64'),_0x528a('0x65'),_0x528a('0x66'),'alias']),{'where':{'context':_0x24b641[_0x528a('0x67')],'exten':_0x24b641[_0x528a('0x57')]},'individualHooks':!![]})[_0x528a('0x2b')](function(_0x386bff){return _0x386bff;});}return null;})['then'](respondWithStatusCode(_0x328ab0,null))[_0x528a('0x51')](handleError(_0x328ab0,null));};exports[_0x528a('0x68')]=function(_0x24f172,_0x487816){return db[_0x528a('0x3d')][_0x528a('0x69')]({'where':{'id':_0x24f172[_0x528a('0x53')]['id']}})[_0x528a('0x2b')](function(_0x1c4160){if(_0x1c4160){return db[_0x528a('0x6a')][_0x528a('0x6b')](function(_0x510a92){return db['VoiceExtension'][_0x528a('0x2a')]({'where':{'VoiceExtensionId':_0x24f172[_0x528a('0x53')]['id']},'transaction':_0x510a92})[_0x528a('0x2b')](function(){var _0x36fc1c=_[_0x528a('0x33')](_0x24f172[_0x528a('0x56')],function(_0x33abb0){_0x33abb0[_0x528a('0x6c')]=_0x24f172[_0x528a('0x53')]['id'];_0x33abb0[_0x528a('0x6d')]=!![];return _0x33abb0;});var _0x2a1880=_0x24f172['query'][_0x528a('0x6e')]&&_0x24f172['query']['rewriteDial'][_0x528a('0x6f')]()==='true'?!![]:![];return _0x1c4160['createRouting'](_0x36fc1c,_0x2a1880);})[_0x528a('0x2b')](function(_0x2db5f3){return db[_0x528a('0x3d')][_0x528a('0x70')](_0x2db5f3,{'transaction':_0x510a92});});})[_0x528a('0x2b')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x24f172['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x528a('0x2b')](respondWithResult(_0x487816,null))['catch'](handleError(_0x487816,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ced522b..126ac5c 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 _0x115c=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceExtension'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x115c,0x96));var _0xc115=function(_0x465255,_0x47fa23){_0x465255=_0x465255-0x0;var _0x330b13=_0x115c[_0x465255];return _0x330b13;};'use strict';var EventEmitter=require(_0xc115('0x0'));var VoiceExtension=require(_0xc115('0x1'))['db'][_0xc115('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc115('0x3')](0x0);var events={'afterCreate':_0xc115('0x4'),'afterUpdate':_0xc115('0x5'),'afterDestroy':'remove'};function emitEvent(_0x287c99){return function(_0x16c9d3,_0x5dfd6c,_0x1b7f87){VoiceExtensionEvents[_0xc115('0x6')](_0x287c99+':'+_0x16c9d3['id'],_0x16c9d3);VoiceExtensionEvents[_0xc115('0x6')](_0x287c99,_0x16c9d3);_0x1b7f87(null);};}for(var e in events){if(events[_0xc115('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xc115('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x2e32=['VoiceExtension','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x5ae022,_0x403c1e){var _0x27f81e=function(_0x91ae24){while(--_0x91ae24){_0x5ae022['push'](_0x5ae022['shift']());}};_0x27f81e(++_0x403c1e);}(_0x2e32,0x73));var _0x22e3=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x2e32[_0x580647];return _0x5f0792;};'use strict';var EventEmitter=require(_0x22e3('0x0'));var VoiceExtension=require(_0x22e3('0x1'))['db'][_0x22e3('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x22e3('0x3')](0x0);var events={'afterCreate':_0x22e3('0x4'),'afterUpdate':_0x22e3('0x5'),'afterDestroy':_0x22e3('0x6')};function emitEvent(_0xb17bd){return function(_0x1fedb9,_0x10a48d,_0x26a5d7){VoiceExtensionEvents[_0x22e3('0x7')](_0xb17bd+':'+_0x1fedb9['id'],_0x1fedb9);VoiceExtensionEvents[_0x22e3('0x7')](_0xb17bd,_0x1fedb9);_0x26a5d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x22e3('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 89986dd..88edb14 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 _0xec6a=['exten','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','options','url','split','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','then','length','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','last','concat','define','VoiceExtension','voice_extensions','Hangup','util','lodash','exports','models','type','Set','CDR(type)=','context','NoOp','CDR(routeAlias)=','alias','No\x20alias\x20set'];(function(_0x5d248a,_0x25ecec){var _0x4e5589=function(_0x64a076){while(--_0x64a076){_0x5d248a['push'](_0x5d248a['shift']());}};_0x4e5589(++_0x25ecec);}(_0xec6a,0x134));var _0xaec6=function(_0x114db3,_0x23509d){_0x114db3=_0x114db3-0x0;var _0xcfd0ac=_0xec6a[_0x114db3];return _0xcfd0ac;};'use strict';var util=require(_0xaec6('0x0'));var _=require(_0xaec6('0x1'));var attributes=require('./voiceExtension.attributes');module[_0xaec6('0x2')]=function(_0x4a3194){var _0x44bbb2=_0x4a3194[_0xaec6('0x3')];function _0x3f5cfc(_0x569af0){var _0x2843aa=0x2;var _0x13c2e0=[{'type':_0x569af0[_0xaec6('0x4')],'app':_0xaec6('0x5'),'appdata':_0xaec6('0x6')+_0x569af0['type'],'context':_0x569af0[_0xaec6('0x7')],'exten':_0x569af0['exten'],'priority':_0x2843aa++,'VoiceExtensionId':_0x569af0['id']},{'type':_0x569af0[_0xaec6('0x4')],'app':_0x569af0['alias']?'Set':_0xaec6('0x8'),'appdata':_0x569af0['alias']?_0xaec6('0x9')+_0x569af0[_0xaec6('0xa')]:_0xaec6('0xb'),'context':_0x569af0['context'],'exten':_0x569af0[_0xaec6('0xc')],'priority':_0x2843aa++,'VoiceExtensionId':_0x569af0['id']}];if(_0x569af0['type']===_0xaec6('0xd')){_0x13c2e0[_0xaec6('0xe')]({'type':'inbound','app':_0xaec6('0x5'),'appdata':'CDR(routeid)='+_0x569af0['id'],'context':_0x569af0[_0xaec6('0x7')],'exten':_0x569af0['exten'],'priority':_0x2843aa++,'VoiceExtensionId':_0x569af0['id']});}_0x13c2e0[_0xaec6('0xe')]({'type':_0x569af0['type'],'app':_0xaec6('0x5'),'appdata':_0xaec6('0xf'),'context':_0x569af0[_0xaec6('0x7')],'exten':_0x569af0[_0xaec6('0xc')],'priority':_0x2843aa++,'VoiceExtensionId':_0x569af0['id']},{'type':_0x569af0[_0xaec6('0x4')],'app':'Set','appdata':_0xaec6('0x10'),'context':_0x569af0[_0xaec6('0x7')],'exten':_0x569af0['exten'],'priority':_0x2843aa++,'VoiceExtensionId':_0x569af0['id']},{'type':_0x569af0[_0xaec6('0x4')],'app':_0xaec6('0x5'),'appdata':_0xaec6('0x11'),'context':_0x569af0[_0xaec6('0x7')],'exten':_0x569af0[_0xaec6('0xc')],'priority':_0x2843aa++,'VoiceExtensionId':_0x569af0['id']});return _0x13c2e0;}function _0x682174(_0x3f020e){var _0x2e2fa1=0x2;var _0x240e8d=[{'type':'outbound','app':_0xaec6('0x5'),'appdata':'CDR(type)=outbound','context':_0x3f020e['context'],'exten':_0x3f020e[_0xaec6('0xc')],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':'outbound','app':_0x3f020e[_0xaec6('0xa')]?_0xaec6('0x5'):_0xaec6('0x8'),'appdata':_0x3f020e[_0xaec6('0xa')]?_0xaec6('0x9')+_0x3f020e[_0xaec6('0xa')]:'No\x20alias\x20set','context':_0x3f020e[_0xaec6('0x7')],'exten':_0x3f020e[_0xaec6('0xc')],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':_0xaec6('0x12'),'app':'Set','appdata':'CDR(destination)='+(_0x3f020e[_0xaec6('0x13')]?_0xaec6('0x14')+_0x3f020e[_0xaec6('0x13')]+'}':_0xaec6('0x15')),'context':_0x3f020e[_0xaec6('0x7')],'exten':_0x3f020e[_0xaec6('0xc')],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':_0xaec6('0x12'),'app':_0xaec6('0x5'),'appdata':'CDR(routeid)='+_0x3f020e['id'],'context':_0x3f020e[_0xaec6('0x7')],'exten':_0x3f020e[_0xaec6('0xc')],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':_0xaec6('0x12'),'app':_0xaec6('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2e2fa1+0x2)+_0xaec6('0x17')+(_0x2e2fa1+0x1)+')','context':_0x3f020e['context'],'exten':_0x3f020e[_0xaec6('0xc')],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':_0xaec6('0x12'),'app':_0xaec6('0x5'),'appdata':_0x3f020e[_0xaec6('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x3f020e[_0xaec6('0x13')]+'}':_0xaec6('0x18'),'context':_0x3f020e[_0xaec6('0x7')],'exten':_0x3f020e[_0xaec6('0xc')],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':'outbound','app':'Set','appdata':_0xaec6('0xf'),'context':_0x3f020e['context'],'exten':_0x3f020e['exten'],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':_0xaec6('0x12'),'app':_0xaec6('0x5'),'appdata':_0xaec6('0x10'),'context':_0x3f020e[_0xaec6('0x7')],'exten':_0x3f020e[_0xaec6('0xc')],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':_0xaec6('0x12'),'app':_0xaec6('0x5'),'appdata':_0xaec6('0x11'),'context':_0x3f020e['context'],'exten':_0x3f020e['exten'],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':_0xaec6('0x12'),'app':'Set','appdata':_0xaec6('0x19')+_0x3f020e['id'],'context':_0x3f020e[_0xaec6('0x7')],'exten':_0x3f020e['exten'],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']}];if(_0x3f020e[_0xaec6('0x1a')](_0xaec6('0x1b'))&&_0x3f020e[_0xaec6('0x1b')]!==_0xaec6('0x1c')){_0x240e8d['push']({'type':_0xaec6('0x12'),'app':'Set','appdata':_0xaec6('0x1d'),'context':_0x3f020e['context'],'exten':_0x3f020e[_0xaec6('0xc')],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']},{'type':_0xaec6('0x12'),'app':_0xaec6('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3f020e[_0xaec6('0x1b')]||_0xaec6('0x1e'),'context':_0x3f020e[_0xaec6('0x7')],'exten':_0x3f020e['exten'],'priority':_0x2e2fa1++,'VoiceExtensionId':_0x3f020e['id']});}return _0x240e8d;}function _0x508591(_0x4bde2a){var _0x5ab686=[{'name':_0xaec6('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xaec6('0x20'),'param':0x2},{'name':_0xaec6('0x21'),'param':0x3}];var _0x1ded0d={};var _0x139723=_0x4bde2a[_0xaec6('0x22')](',');var _0x40ffb5=[];for(var _0x3a814b=0x0;_0x3a814b<_0x5ab686['length'];_0x3a814b++){switch(_0x5ab686[_0x3a814b][_0xaec6('0x23')]){case _0xaec6('0x1f'):_0x1ded0d[_0xaec6('0x1f')]=_0x139723[_0x5ab686[_0x3a814b][_0xaec6('0x24')]][_0xaec6('0x22')]('/')[0x1];_0x1ded0d[_0xaec6('0x25')]=_0x139723[_0x5ab686[_0x3a814b][_0xaec6('0x24')]][_0xaec6('0x22')]('/')[0x2];_0x1ded0d[_0xaec6('0x26')]=_0x1ded0d[_0xaec6('0x25')]?_0x1ded0d[_0xaec6('0x25')][_0xaec6('0x22')]('$')[0x0]:undefined;_0x1ded0d['phone']=route[_0xaec6('0x13')]?(_0x1ded0d[_0xaec6('0x26')]||'')+'${EXTEN:'+route[_0xaec6('0x13')]+'}':(_0x1ded0d['prefix']||'')+_0xaec6('0x15');_0x40ffb5[_0x5ab686[_0x3a814b]['param']]=[_0xaec6('0x27'),_0x1ded0d[_0xaec6('0x1f')],_0x1ded0d[_0xaec6('0x25')]][_0xaec6('0x28')]('/');break;case _0xaec6('0x20'):_0x1ded0d[_0xaec6('0x20')]=_0x139723[_0x5ab686[_0x3a814b][_0xaec6('0x24')]];if(route[_0xaec6('0x1b')]!==_0xaec6('0x1c')){if(_0x1ded0d[_0xaec6('0x20')][_0xaec6('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x1ded0d['options']+=_0xaec6('0x2a');}}else{_0x1ded0d[_0xaec6('0x20')]=_0x1ded0d[_0xaec6('0x20')]['replace'](_0xaec6('0x2a'),'');}_0x40ffb5[_0x5ab686[_0x3a814b][_0xaec6('0x24')]]=_0x1ded0d[_0xaec6('0x20')];break;default:_0x40ffb5[_0x5ab686[_0x3a814b][_0xaec6('0x24')]]=_0x139723[_0x5ab686[_0x3a814b]['param']];}}return _0x40ffb5['join'](',');}function _0xb36e11(_0x4a4a49,_0x4cd919,_0xa5c121,_0x3cfbc7){return new Promise(function(_0x33a587,_0x16a309){var _0x63de10=[];if(_[_0xaec6('0x2b')](_0x4cd919))return _0x33a587(_0x63de10);_0x44bbb2[_0xaec6('0x2c')][_0xaec6('0x2d')]({'attributes':['id',_0xaec6('0x2e'),'IntervalId'],'raw':!![]})[_0xaec6('0x2f')](function(_0x1f8870){for(var _0xf0e90a=0x0,_0x3b0170=0x0;_0xf0e90a<_0x4cd919[_0xaec6('0x30')];_0xf0e90a++,_0x3b0170=0x0){var _0x3ade9c=_0x4cd919[_0xf0e90a];var _0x3c9e90=[];var _0x5cb351=[];if(_0x3ade9c[_0xaec6('0x2e')]!=='*,*,*,*'){_0x3ade9c[_0xaec6('0x31')]=[_0x3ade9c['interval']];}else{_0x3ade9c['intervals']=_0x3ade9c['IntervalId']?_[_0xaec6('0x32')](_[_0xaec6('0x33')](_0x1f8870,{'IntervalId':_0x3ade9c['IntervalId']}),'interval'):[];}_0x3ade9c['context']=_0x4a4a49[_0xaec6('0x7')];_0x3ade9c[_0xaec6('0xc')]=_0x4a4a49[_0xaec6('0xc')];if(_0x3ade9c[_0xaec6('0x4')])_0x3ade9c[_0xaec6('0x4')]=_0x3ade9c['type'][_0xaec6('0x34')]();if(_0x4a4a49[_0xaec6('0x4')]===_0xaec6('0x12')){if(_0x3ade9c['hasOwnProperty'](_0xaec6('0x35'))&&_0x3ade9c[_0xaec6('0x35')]&&_0x3ade9c[_0xaec6('0x35')]!=='--'){_0x3c9e90[_0xaec6('0xe')]({'type':_0x3ade9c[_0xaec6('0x4')][_0xaec6('0x34')](),'app':_0xaec6('0x5'),'appdata':_0xaec6('0x36')+_0x3ade9c[_0xaec6('0x35')],'context':_0x4a4a49[_0xaec6('0x7')],'exten':_0x4a4a49[_0xaec6('0xc')],'priority':_0x3ade9c[_0xaec6('0x31')][_0xaec6('0x30')]+_0xa5c121+_0x3b0170++,'VoiceExtensionId':_0x4a4a49['id']});}_0x3c9e90[_0xaec6('0xe')]({'type':_0x3ade9c[_0xaec6('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0xaec6('0x37')+(_0x3ade9c[_0xaec6('0x38')]?_0xaec6('0x39')+_0x3ade9c[_0xaec6('0x38')]+')':_0xaec6('0x3a')),'context':_0x4a4a49[_0xaec6('0x7')],'exten':_0x4a4a49[_0xaec6('0xc')],'priority':_0x3ade9c[_0xaec6('0x31')][_0xaec6('0x30')]+_0xa5c121+_0x3b0170++,'VoiceExtensionId':_0x4a4a49['id']});}else{if(_0x3ade9c['hasOwnProperty'](_0xaec6('0x3b'))){if([_0xaec6('0x3c'),_0xaec6('0x3d')][_0xaec6('0x3e')](_0x3ade9c[_0xaec6('0x3f')][_0xaec6('0x34')]())&&_0x3ade9c['appType']!==_0xaec6('0x40')){if(_0x3ade9c[_0xaec6('0x3b')]){_0x3c9e90['push']({'type':_0x3ade9c[_0xaec6('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0xaec6('0x41'),'context':_0x4a4a49[_0xaec6('0x7')],'exten':_0x4a4a49[_0xaec6('0xc')],'priority':_0x3ade9c[_0xaec6('0x31')]['length']+_0xa5c121+_0x3b0170++,'VoiceExtensionId':_0x4a4a49['id']});_0x3c9e90['push']({'type':_0x3ade9c[_0xaec6('0x4')][_0xaec6('0x34')](),'app':_0xaec6('0x5'),'appdata':_0xaec6('0x42'),'context':_0x4a4a49[_0xaec6('0x7')],'exten':_0x4a4a49['exten'],'priority':_0x3ade9c[_0xaec6('0x31')]['length']+_0xa5c121+_0x3b0170++,'VoiceExtensionId':_0x4a4a49['id']});}else{_0x3c9e90[_0xaec6('0xe')]({'type':_0x3ade9c['type']['toLowerCase'](),'app':_0xaec6('0x16'),'appdata':_0xaec6('0x43'),'context':_0x4a4a49[_0xaec6('0x7')],'exten':_0x4a4a49[_0xaec6('0xc')],'priority':_0x3ade9c[_0xaec6('0x31')][_0xaec6('0x30')]+_0xa5c121+_0x3b0170++,'VoiceExtensionId':_0x4a4a49['id']});_0x3c9e90[_0xaec6('0xe')]({'type':_0x3ade9c['type'][_0xaec6('0x34')](),'app':_0xaec6('0x5'),'appdata':_0xaec6('0x44'),'context':_0x4a4a49[_0xaec6('0x7')],'exten':_0x4a4a49[_0xaec6('0xc')],'priority':_0x3ade9c[_0xaec6('0x31')][_0xaec6('0x30')]+_0xa5c121+_0x3b0170++,'VoiceExtensionId':_0x4a4a49['id']});}}}}for(var _0x32e566=0x0;_0x32e566<_0x3ade9c['intervals'][_0xaec6('0x30')];_0x32e566++){var _0x5f008b=_0xa5c121+_0x3ade9c[_0xaec6('0x31')]['length'];var _0x3459d3=_0x32e566===_0x3ade9c['intervals']['length']-0x1?_0xa5c121+_0x3c9e90[_0xaec6('0x30')]+_0x5cb351[_0xaec6('0x30')]+0x2:_0xa5c121+_0x32e566+0x1;_0x3c9e90[_0xaec6('0x45')](_0x32e566,0x0,{'type':_0x4a4a49[_0xaec6('0x4')],'app':'GotoIfTime','appdata':_0x3ade9c[_0xaec6('0x31')][_0x32e566]+'?'+_0x4a4a49[_0xaec6('0x7')]+_0xaec6('0x46')+_0x5f008b+':'+_0x4a4a49[_0xaec6('0x7')]+_0xaec6('0x46')+_0x3459d3,'exten':_0x4a4a49['exten'],'context':_0x4a4a49[_0xaec6('0x7')],'priority':_0xa5c121+_0x32e566,'VoiceExtensionId':_0x4a4a49['id']});}if(_0x3cfbc7&&_0x3ade9c['appType']===_0xaec6('0x47'))_0x3ade9c[_0xaec6('0x48')]=_0x508591(_0x3ade9c[_0xaec6('0x48')]);_0x3ade9c[_0xaec6('0x49')]=_0x3c9e90[_0xaec6('0x30')]?_[_0xaec6('0x4a')](_0x3c9e90)[_0xaec6('0x49')]+0x1:_0xa5c121;_0x63de10=_[_0xaec6('0x4b')](_0x63de10,_0x3c9e90,[_0x3ade9c],_0x5cb351);_0xa5c121=_[_0xaec6('0x4a')](_0x63de10)[_0xaec6('0x49')]+0x1;}return _0x33a587(_0x63de10);})['catch'](function(_0x135aa2){_0x16a309(_0x135aa2);});});}return _0x4a3194[_0xaec6('0x4c')](_0xaec6('0x4d'),attributes,{'tableName':_0xaec6('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5820f8,_0x24314f){var _0x4610ae=this;var _0x4e45a8=_0x4610ae[_0xaec6('0x4')]===_0xaec6('0x12')?_0x682174(_0x4610ae):_0x3f5cfc(_0x4610ae);return _0xb36e11(_0x4610ae,_0x5820f8,_['last'](_0x4e45a8)[_0xaec6('0x49')]+0x1,_0x24314f)[_0xaec6('0x2f')](function(_0x227c6c){var _0x4f52a2=_[_0xaec6('0x4b')](_0x4e45a8,_0x227c6c);_0x4f52a2['push']({'type':_0x4610ae['type'],'app':_0xaec6('0x4f'),'exten':_0x4610ae[_0xaec6('0xc')],'context':_0x4610ae['context'],'priority':_[_0xaec6('0x4a')](_0x4f52a2)[_0xaec6('0x49')]+0x1,'VoiceExtensionId':_0x4610ae['id']});return _0x4f52a2;});}}});}; \ No newline at end of file +var _0x829f=[',${EXTEN},','appType','outboundDial','appdata','last','priority','catch','define','voice_extensions','concat','Hangup','util','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','length','name','param','split','phone','prefix','join','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime'];(function(_0x4e480b,_0x5bb729){var _0x39f546=function(_0x22b797){while(--_0x22b797){_0x4e480b['push'](_0x4e480b['shift']());}};_0x39f546(++_0x5bb729);}(_0x829f,0x1f1));var _0xf829=function(_0x36884b,_0x5cb6e3){_0x36884b=_0x36884b-0x0;var _0x557e28=_0x829f[_0x36884b];return _0x557e28;};'use strict';var util=require(_0xf829('0x0'));var _=require(_0xf829('0x1'));var attributes=require(_0xf829('0x2'));module['exports']=function(_0x325833){var _0x3f5d1a=_0x325833[_0xf829('0x3')];function _0x1ec465(_0x22ea6b){var _0x1d0646=0x2;var _0x4906a1=[{'type':_0x22ea6b[_0xf829('0x4')],'app':_0xf829('0x5'),'appdata':_0xf829('0x6')+_0x22ea6b['type'],'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']},{'type':_0x22ea6b[_0xf829('0x4')],'app':_0x22ea6b[_0xf829('0x9')]?'Set':_0xf829('0xa'),'appdata':_0x22ea6b[_0xf829('0x9')]?_0xf829('0xb')+_0x22ea6b[_0xf829('0x9')]:_0xf829('0xc'),'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']}];if(_0x22ea6b['type']==='inbound'){_0x4906a1[_0xf829('0xd')]({'type':'inbound','app':_0xf829('0x5'),'appdata':_0xf829('0xe')+_0x22ea6b['id'],'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']});}_0x4906a1[_0xf829('0xd')]({'type':_0x22ea6b[_0xf829('0x4')],'app':_0xf829('0x5'),'appdata':_0xf829('0xf'),'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b['exten'],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']},{'type':_0x22ea6b[_0xf829('0x4')],'app':_0xf829('0x5'),'appdata':_0xf829('0x10'),'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']},{'type':_0x22ea6b['type'],'app':_0xf829('0x5'),'appdata':_0xf829('0x11'),'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']});return _0x4906a1;}function _0x36b126(_0x43f1b0){var _0x4d7f66=0x2;var _0x5b62ec=[{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0x13'),'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':'outbound','app':_0x43f1b0['alias']?_0xf829('0x5'):_0xf829('0xa'),'appdata':_0x43f1b0['alias']?_0xf829('0xb')+_0x43f1b0[_0xf829('0x9')]:_0xf829('0xc'),'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0x14')+(_0x43f1b0[_0xf829('0x15')]?_0xf829('0x16')+_0x43f1b0[_0xf829('0x15')]+'}':_0xf829('0x17')),'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0['exten'],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':'CDR(routeid)='+_0x43f1b0['id'],'context':_0x43f1b0['context'],'exten':_0x43f1b0['exten'],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x18'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4d7f66+0x2)+_0xf829('0x19')+(_0x4d7f66+0x1)+')','context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0x43f1b0[_0xf829('0x15')]?_0xf829('0x1a')+_0x43f1b0[_0xf829('0x15')]+'}':'CDR(prefix)=noprefix','context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0xf'),'context':_0x43f1b0['context'],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':'Set','appdata':_0xf829('0x10'),'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':'Set','appdata':_0xf829('0x11'),'context':_0x43f1b0['context'],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':'outboundrouteid='+_0x43f1b0['id'],'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']}];if(_0x43f1b0[_0xf829('0x1b')](_0xf829('0x1c'))&&_0x43f1b0[_0xf829('0x1c')]!=='none'){_0x5b62ec[_0xf829('0xd')]({'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0x1d'),'context':_0x43f1b0['context'],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0x1e')+_0x43f1b0[_0xf829('0x1c')]||'wav','context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']});}return _0x5b62ec;}function _0x2f2fa9(_0x3e74bf){var _0x38c23c=[{'name':_0xf829('0x1f'),'param':0x0},{'name':_0xf829('0x20'),'param':0x1},{'name':_0xf829('0x21'),'param':0x2},{'name':_0xf829('0x22'),'param':0x3}];var _0x23242c={};var _0x1bd87d=_0x3e74bf['split'](',');var _0x146361=[];for(var _0x5b93f4=0x0;_0x5b93f4<_0x38c23c[_0xf829('0x23')];_0x5b93f4++){switch(_0x38c23c[_0x5b93f4][_0xf829('0x24')]){case'trunk':_0x23242c['trunk']=_0x1bd87d[_0x38c23c[_0x5b93f4][_0xf829('0x25')]][_0xf829('0x26')]('/')[0x1];_0x23242c[_0xf829('0x27')]=_0x1bd87d[_0x38c23c[_0x5b93f4][_0xf829('0x25')]][_0xf829('0x26')]('/')[0x2];_0x23242c[_0xf829('0x28')]=_0x23242c[_0xf829('0x27')]?_0x23242c[_0xf829('0x27')]['split']('$')[0x0]:undefined;_0x23242c[_0xf829('0x27')]=route[_0xf829('0x15')]?(_0x23242c[_0xf829('0x28')]||'')+'${EXTEN:'+route['cutdigits']+'}':(_0x23242c[_0xf829('0x28')]||'')+_0xf829('0x17');_0x146361[_0x38c23c[_0x5b93f4][_0xf829('0x25')]]=['SIP',_0x23242c['trunk'],_0x23242c[_0xf829('0x27')]][_0xf829('0x29')]('/');break;case _0xf829('0x21'):_0x23242c[_0xf829('0x21')]=_0x1bd87d[_0x38c23c[_0x5b93f4][_0xf829('0x25')]];if(route[_0xf829('0x1c')]!==_0xf829('0x2a')){if(_0x23242c[_0xf829('0x21')][_0xf829('0x2b')](_0xf829('0x2c'))<0x0){_0x23242c[_0xf829('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x23242c[_0xf829('0x21')]=_0x23242c[_0xf829('0x21')]['replace'](_0xf829('0x2c'),'');}_0x146361[_0x38c23c[_0x5b93f4][_0xf829('0x25')]]=_0x23242c[_0xf829('0x21')];break;default:_0x146361[_0x38c23c[_0x5b93f4][_0xf829('0x25')]]=_0x1bd87d[_0x38c23c[_0x5b93f4][_0xf829('0x25')]];}}return _0x146361[_0xf829('0x29')](',');}function _0xef6a70(_0x5431c8,_0x4630f4,_0x34803d,_0x1d34cc){return new Promise(function(_0x2b35b0,_0x5e99e3){var _0xbb704c=[];if(_[_0xf829('0x2d')](_0x4630f4))return _0x2b35b0(_0xbb704c);_0x3f5d1a[_0xf829('0x2e')][_0xf829('0x2f')]({'attributes':['id',_0xf829('0x30'),_0xf829('0x31')],'raw':!![]})[_0xf829('0x32')](function(_0x369ad5){for(var _0x34b22e=0x0,_0x1891b6=0x0;_0x34b22e<_0x4630f4[_0xf829('0x23')];_0x34b22e++,_0x1891b6=0x0){var _0x1f2fea=_0x4630f4[_0x34b22e];var _0x38b016=[];var _0x4e39c2=[];if(_0x1f2fea[_0xf829('0x30')]!==_0xf829('0x33')){_0x1f2fea[_0xf829('0x34')]=[_0x1f2fea[_0xf829('0x30')]];}else{_0x1f2fea[_0xf829('0x34')]=_0x1f2fea[_0xf829('0x31')]?_[_0xf829('0x35')](_[_0xf829('0x36')](_0x369ad5,{'IntervalId':_0x1f2fea[_0xf829('0x31')]}),_0xf829('0x30')):[];}_0x1f2fea[_0xf829('0x7')]=_0x5431c8[_0xf829('0x7')];_0x1f2fea[_0xf829('0x8')]=_0x5431c8['exten'];if(_0x1f2fea[_0xf829('0x4')])_0x1f2fea['type']=_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')]();if(_0x5431c8[_0xf829('0x4')]===_0xf829('0x12')){if(_0x1f2fea[_0xf829('0x1b')]('tag')&&_0x1f2fea[_0xf829('0x38')]&&_0x1f2fea[_0xf829('0x38')]!=='--'){_0x38b016[_0xf829('0xd')]({'type':_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')](),'app':_0xf829('0x5'),'appdata':_0xf829('0x39')+_0x1f2fea['tag'],'context':_0x5431c8['context'],'exten':_0x5431c8[_0xf829('0x8')],'priority':_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});}_0x38b016[_0xf829('0xd')]({'type':_0x1f2fea['type'][_0xf829('0x37')](),'app':'ExecIf','appdata':_0xf829('0x3a')+(_0x1f2fea['callerID']?_0xf829('0x3b')+_0x1f2fea[_0xf829('0x3c')]+')':'NoOp(No\x20number\x20available)'),'context':_0x5431c8[_0xf829('0x7')],'exten':_0x5431c8[_0xf829('0x8')],'priority':_0x1f2fea[_0xf829('0x34')]['length']+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});}else{if(_0x1f2fea[_0xf829('0x1b')]('answer')){if(['queue',_0xf829('0x3d')][_0xf829('0x3e')](_0x1f2fea[_0xf829('0x3f')][_0xf829('0x37')]())&&_0x1f2fea['appType']!==_0xf829('0x40')){if(_0x1f2fea['answer']){_0x38b016['push']({'type':_0x1f2fea['type'][_0xf829('0x37')](),'app':_0xf829('0x18'),'appdata':_0xf829('0x41'),'context':_0x5431c8[_0xf829('0x7')],'exten':_0x5431c8['exten'],'priority':_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});_0x38b016[_0xf829('0xd')]({'type':_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')](),'app':'Set','appdata':_0xf829('0x42'),'context':_0x5431c8[_0xf829('0x7')],'exten':_0x5431c8['exten'],'priority':_0x1f2fea['intervals']['length']+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});}else{_0x38b016['push']({'type':_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')](),'app':_0xf829('0x18'),'appdata':_0xf829('0x43'),'context':_0x5431c8[_0xf829('0x7')],'exten':_0x5431c8[_0xf829('0x8')],'priority':_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});_0x38b016[_0xf829('0xd')]({'type':_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')](),'app':'Set','appdata':_0xf829('0x44'),'context':_0x5431c8['context'],'exten':_0x5431c8['exten'],'priority':_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});}}}}for(var _0x3f1f1b=0x0;_0x3f1f1b<_0x1f2fea[_0xf829('0x34')]['length'];_0x3f1f1b++){var _0x3f5943=_0x34803d+_0x1f2fea[_0xf829('0x34')]['length'];var _0x2180d2=_0x3f1f1b===_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]-0x1?_0x34803d+_0x38b016[_0xf829('0x23')]+_0x4e39c2[_0xf829('0x23')]+0x2:_0x34803d+_0x3f1f1b+0x1;_0x38b016['splice'](_0x3f1f1b,0x0,{'type':_0x5431c8[_0xf829('0x4')],'app':_0xf829('0x45'),'appdata':_0x1f2fea[_0xf829('0x34')][_0x3f1f1b]+'?'+_0x5431c8['context']+_0xf829('0x46')+_0x3f5943+':'+_0x5431c8['context']+',${EXTEN},'+_0x2180d2,'exten':_0x5431c8[_0xf829('0x8')],'context':_0x5431c8[_0xf829('0x7')],'priority':_0x34803d+_0x3f1f1b,'VoiceExtensionId':_0x5431c8['id']});}if(_0x1d34cc&&_0x1f2fea[_0xf829('0x47')]===_0xf829('0x48'))_0x1f2fea['appdata']=_0x2f2fa9(_0x1f2fea[_0xf829('0x49')]);_0x1f2fea['priority']=_0x38b016[_0xf829('0x23')]?_[_0xf829('0x4a')](_0x38b016)[_0xf829('0x4b')]+0x1:_0x34803d;_0xbb704c=_['concat'](_0xbb704c,_0x38b016,[_0x1f2fea],_0x4e39c2);_0x34803d=_[_0xf829('0x4a')](_0xbb704c)[_0xf829('0x4b')]+0x1;}return _0x2b35b0(_0xbb704c);})[_0xf829('0x4c')](function(_0x2b4299){_0x5e99e3(_0x2b4299);});});}return _0x325833[_0xf829('0x4d')]('VoiceExtension',attributes,{'tableName':_0xf829('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xcf5fb7,_0x455c64){var _0x429591=this;var _0xe83416=_0x429591[_0xf829('0x4')]===_0xf829('0x12')?_0x36b126(_0x429591):_0x1ec465(_0x429591);return _0xef6a70(_0x429591,_0xcf5fb7,_[_0xf829('0x4a')](_0xe83416)[_0xf829('0x4b')]+0x1,_0x455c64)[_0xf829('0x32')](function(_0x582ca6){var _0x200cb9=_[_0xf829('0x4f')](_0xe83416,_0x582ca6);_0x200cb9[_0xf829('0xd')]({'type':_0x429591['type'],'app':_0xf829('0x50'),'exten':_0x429591[_0xf829('0x8')],'context':_0x429591[_0xf829('0x7')],'priority':_[_0xf829('0x4a')](_0x200cb9)[_0xf829('0x4b')]+0x1,'VoiceExtensionId':_0x429591['id']});return _0x200cb9;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index a70b4e4..5f103ec 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 _0x84e7=['stringify','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceExtension','findAll','options','raw','where','attributes','map','include','model'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x84e7,0x122));var _0x784e=function(_0x1438ad,_0x8336a4){_0x1438ad=_0x1438ad-0x0;var _0x15d39c=_0x84e7[_0x1438ad];return _0x15d39c;};'use strict';var _=require('lodash');var util=require(_0x784e('0x0'));var moment=require(_0x784e('0x1'));var BPromise=require('bluebird');var rs=require(_0x784e('0x2'));var fs=require('fs');var Redis=require(_0x784e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x784e('0x4'));var logger=require(_0x784e('0x5'))(_0x784e('0x6'));var config=require(_0x784e('0x7'));var jayson=require(_0x784e('0x8'));var client=jayson[_0x784e('0x9')]['http']({'port':0x232a});config[_0x784e('0xa')]=_['defaults'](config[_0x784e('0xa')],{'host':_0x784e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x784e('0xa')]));require(_0x784e('0xc'))[_0x784e('0xd')](socket);function respondWithRpcPromise(_0x3ddd55,_0x4ac061,_0x4ae056){return new BPromise(function(_0x19b153,_0x165990){return client[_0x784e('0xe')](_0x3ddd55,_0x4ae056)[_0x784e('0xf')](function(_0x5389cd){logger[_0x784e('0x10')](_0x784e('0x11'),_0x4ac061,_0x784e('0x12'));logger[_0x784e('0x13')](_0x784e('0x14'),_0x4ac061,_0x784e('0x12'),JSON['stringify'](_0x5389cd));if(_0x5389cd[_0x784e('0x15')]){if(_0x5389cd['error'][_0x784e('0x16')]===0x1f4){logger[_0x784e('0x15')](_0x784e('0x11'),_0x4ac061,_0x5389cd[_0x784e('0x15')][_0x784e('0x17')]);return _0x165990(_0x5389cd[_0x784e('0x15')][_0x784e('0x17')]);}logger[_0x784e('0x15')](_0x784e('0x11'),_0x4ac061,_0x5389cd['error']['message']);return _0x19b153(_0x5389cd[_0x784e('0x15')][_0x784e('0x17')]);}else{logger[_0x784e('0x10')](_0x784e('0x11'),_0x4ac061,_0x784e('0x12'));_0x19b153(_0x5389cd[_0x784e('0x18')][_0x784e('0x17')]);}})['catch'](function(_0x2524d0){logger[_0x784e('0x15')](_0x784e('0x11'),_0x4ac061,_0x2524d0);_0x165990(_0x2524d0);});});}exports[_0x784e('0x19')]=function(_0x440cd6){var _0x42f894=this;return new Promise(function(_0x435066,_0x5e9b46){return db['VoiceExtension'][_0x784e('0x1a')]({'raw':_0x440cd6['options']?_0x440cd6[_0x784e('0x1b')][_0x784e('0x1c')]===undefined?!![]:![]:!![],'where':_0x440cd6['options']?_0x440cd6['options'][_0x784e('0x1d')]||null:null,'attributes':_0x440cd6[_0x784e('0x1b')]?_0x440cd6[_0x784e('0x1b')][_0x784e('0x1e')]||null:null,'limit':_0x440cd6['options']?_0x440cd6['options']['limit']||null:null,'include':_0x440cd6[_0x784e('0x1b')]?_0x440cd6[_0x784e('0x1b')]['include']?_[_0x784e('0x1f')](_0x440cd6['options'][_0x784e('0x20')],function(_0x59f315){return{'model':db[_0x59f315[_0x784e('0x21')]],'as':_0x59f315['as'],'attributes':_0x59f315[_0x784e('0x1e')],'include':_0x59f315[_0x784e('0x20')]?_[_0x784e('0x1f')](_0x59f315['include'],function(_0x3668ed){return{'model':db[_0x3668ed[_0x784e('0x21')]],'as':_0x3668ed['as'],'attributes':_0x3668ed[_0x784e('0x1e')],'include':_0x3668ed[_0x784e('0x20')]?_['map'](_0x3668ed[_0x784e('0x20')],function(_0xa3603f){return{'model':db[_0xa3603f['model']],'as':_0xa3603f['as'],'attributes':_0xa3603f['attributes']};}):[]};}):[]};}):[]:[]})[_0x784e('0xf')](function(_0x40c31b){logger[_0x784e('0x10')](_0x784e('0x19'),_0x440cd6);logger[_0x784e('0x13')](_0x784e('0x19'),_0x440cd6,JSON[_0x784e('0x22')](_0x40c31b));_0x435066(_0x40c31b);})[_0x784e('0x23')](function(_0x42bdfb){logger[_0x784e('0x15')](_0x784e('0x19'),_0x42bdfb[_0x784e('0x17')],_0x440cd6);_0x5e9b46(_0x42f894[_0x784e('0x15')](0x1f4,_0x42bdfb[_0x784e('0x17')]));});});}; \ No newline at end of file +var _0x8458=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceExtension','options','attributes','include','map','model'];(function(_0x1c6941,_0x26af8f){var _0x431d37=function(_0x5812f1){while(--_0x5812f1){_0x1c6941['push'](_0x1c6941['shift']());}};_0x431d37(++_0x26af8f);}(_0x8458,0x1a5));var _0x8845=function(_0x11cc77,_0x17d347){_0x11cc77=_0x11cc77-0x0;var _0x37fb19=_0x8458[_0x11cc77];return _0x37fb19;};'use strict';var _=require(_0x8845('0x0'));var util=require('util');var moment=require(_0x8845('0x1'));var BPromise=require(_0x8845('0x2'));var rs=require(_0x8845('0x3'));var fs=require('fs');var Redis=require(_0x8845('0x4'));var db=require(_0x8845('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8845('0x6'))(_0x8845('0x7'));var config=require(_0x8845('0x8'));var jayson=require(_0x8845('0x9'));var client=jayson[_0x8845('0xa')]['http']({'port':0x232a});config[_0x8845('0xb')]=_['defaults'](config[_0x8845('0xb')],{'host':_0x8845('0xc'),'port':0x18eb});var socket=require(_0x8845('0xd'))(new Redis(config['redis']));require(_0x8845('0xe'))[_0x8845('0xf')](socket);function respondWithRpcPromise(_0x59cd0b,_0x33d23e,_0xd846f1){return new BPromise(function(_0x55703d,_0x3b9c78){return client[_0x8845('0x10')](_0x59cd0b,_0xd846f1)[_0x8845('0x11')](function(_0x1f1027){logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));logger[_0x8845('0x15')](_0x8845('0x16'),_0x33d23e,_0x8845('0x14'),JSON[_0x8845('0x17')](_0x1f1027));if(_0x1f1027[_0x8845('0x18')]){if(_0x1f1027[_0x8845('0x18')][_0x8845('0x19')]===0x1f4){logger['error'](_0x8845('0x13'),_0x33d23e,_0x1f1027[_0x8845('0x18')]['message']);return _0x3b9c78(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}logger[_0x8845('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x33d23e,_0x1f1027['error']['message']);return _0x55703d(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}else{logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));_0x55703d(_0x1f1027[_0x8845('0x1b')][_0x8845('0x1a')]);}})['catch'](function(_0x4e6a6f){logger['error'](_0x8845('0x13'),_0x33d23e,_0x4e6a6f);_0x3b9c78(_0x4e6a6f);});});}exports[_0x8845('0x1c')]=function(_0x122c92){var _0x380010=this;return new Promise(function(_0x49ec66,_0x2e94f5){return db['VoiceExtension']['findAll']({'raw':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')]['where']||null:null,'attributes':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')][_0x8845('0x1e')]||null:null,'limit':_0x122c92[_0x8845('0x1d')]?_0x122c92['options']['limit']||null:null,'include':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')][_0x8845('0x1f')]?_[_0x8845('0x20')](_0x122c92[_0x8845('0x1d')][_0x8845('0x1f')],function(_0x37eea4){return{'model':db[_0x37eea4[_0x8845('0x21')]],'as':_0x37eea4['as'],'attributes':_0x37eea4[_0x8845('0x1e')],'include':_0x37eea4[_0x8845('0x1f')]?_[_0x8845('0x20')](_0x37eea4[_0x8845('0x1f')],function(_0x3d8c5d){return{'model':db[_0x3d8c5d[_0x8845('0x21')]],'as':_0x3d8c5d['as'],'attributes':_0x3d8c5d[_0x8845('0x1e')],'include':_0x3d8c5d[_0x8845('0x1f')]?_[_0x8845('0x20')](_0x3d8c5d['include'],function(_0x47dfff){return{'model':db[_0x47dfff[_0x8845('0x21')]],'as':_0x47dfff['as'],'attributes':_0x47dfff[_0x8845('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8845('0x11')](function(_0x3cc594){logger[_0x8845('0x12')](_0x8845('0x1c'),_0x122c92);logger[_0x8845('0x15')]('GetVoiceExtension',_0x122c92,JSON[_0x8845('0x17')](_0x3cc594));_0x49ec66(_0x3cc594);})[_0x8845('0x22')](function(_0x501362){logger[_0x8845('0x18')](_0x8845('0x1c'),_0x501362[_0x8845('0x1a')],_0x122c92);_0x2e94f5(_0x380010[_0x8845('0x18')](0x1f4,_0x501362[_0x8845('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 8a92f0b..6948ab0 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 _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x4e447b,_0x51a031){var _0x55de3f=function(_0xd9ae68){while(--_0xd9ae68){_0x4e447b['push'](_0x4e447b['shift']());}};_0x55de3f(++_0x51a031);}(_0x1261,0x144));var _0x1126=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x1261[_0x4b2863];return _0x567d67;};'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 +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x382f48,_0x1dcf6c){var _0x17d345=function(_0x31ee10){while(--_0x31ee10){_0x382f48['push'](_0x382f48['shift']());}};_0x17d345(++_0x1dcf6c);}(_0xe14b,0x93));var _0xbe14=function(_0xc2188c,_0x282cd6){_0xc2188c=_0xc2188c-0x0;var _0x2287c4=_0xe14b[_0xc2188c];return _0x2287c4;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index b19b357..52fa695 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 _0x71ab=['getMessages','post','create','update','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x406115,_0x19f7a1){var _0xbbabdb=function(_0x28554d){while(--_0x28554d){_0x406115['push'](_0x406115['shift']());}};_0xbbabdb(++_0x19f7a1);}(_0x71ab,0x64));var _0xb71a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x71ab[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')]('/',auth[_0xb71a('0x9')](),controller[_0xb71a('0xa')]);router[_0xb71a('0x8')](_0xb71a('0xb'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xc')]);router[_0xb71a('0x8')](_0xb71a('0xd'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xe')]);router[_0xb71a('0xf')]('/',auth['isAuthenticated'](),controller[_0xb71a('0x10')]);router['put'](_0xb71a('0xb'),auth[_0xb71a('0x9')](),controller[_0xb71a('0x11')]);router['delete'](_0xb71a('0xb'),auth['isAuthenticated'](),controller[_0xb71a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4325=['get','/:id/messages','getMessages','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','/:id','show'];(function(_0x1115ee,_0x3480c6){var _0x34de4b=function(_0xe229c6){while(--_0xe229c6){_0x1115ee['push'](_0x1115ee['shift']());}};_0x34de4b(++_0x3480c6);}(_0x4325,0x1da));var _0x5432=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4325[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var path=require('path');var timeout=require(_0x5432('0x2'));var express=require(_0x5432('0x3'));var router=express[_0x5432('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var controller=require(_0x5432('0x7'));router['get']('/',auth[_0x5432('0x8')](),controller[_0x5432('0x9')]);router['get'](_0x5432('0xa'),auth['isAuthenticated'](),controller[_0x5432('0xb')]);router[_0x5432('0xc')](_0x5432('0xd'),auth[_0x5432('0x8')](),controller[_0x5432('0xe')]);router['post']('/',auth[_0x5432('0x8')](),controller['create']);router[_0x5432('0xf')](_0x5432('0xa'),auth[_0x5432('0x8')](),controller[_0x5432('0x10')]);router['delete']('/:id',auth[_0x5432('0x8')](),controller[_0x5432('0x11')]);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 3b6cb35..3dbe325 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 _0x8a7b=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x109977,_0x27052b){var _0x50da82=function(_0xd61006){while(--_0xd61006){_0x109977['push'](_0x109977['shift']());}};_0x50da82(++_0x27052b);}(_0x8a7b,0x96));var _0xb8a7=function(_0x5bc0f9,_0x1de7b0){_0x5bc0f9=_0x5bc0f9-0x0;var _0x50c294=_0x8a7b[_0x5bc0f9];return _0x50c294;};'use strict';var Sequelize=require(_0xb8a7('0x0'));module[_0xb8a7('0x1')]={'customer_id':{'type':Sequelize[_0xb8a7('0x2')]},'context':{'type':Sequelize[_0xb8a7('0x2')],'defaultValue':'from-voicemail','unique':_0xb8a7('0x3')},'mailbox':{'type':Sequelize[_0xb8a7('0x2')],'defaultValue':'','allowNull':![],'unique':_0xb8a7('0x3')},'password':{'type':Sequelize[_0xb8a7('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xf8d946){this['setDataValue'](_0xb8a7('0x4'),typeof _0xf8d946===_0xb8a7('0x5')&&_0xf8d946[_0xb8a7('0x6')]()?_0xf8d946[_0xb8a7('0x6')]():null);}},'pager':{'type':Sequelize[_0xb8a7('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xb8a7('0x7')},'attach':{'type':Sequelize[_0xb8a7('0x8')](_0xb8a7('0x9'),'no'),'defaultValue':_0xb8a7('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xb8a7('0x8')](_0xb8a7('0x9'),'no'),'defaultValue':_0xb8a7('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xb8a7('0x2')]},'callback':{'type':Sequelize[_0xb8a7('0x2')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xb8a7('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xb8a7('0x8')](_0xb8a7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xb8a7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xb8a7('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xb8a7('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xb8a7('0x8')](_0xb8a7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xb8a7('0x8')](_0xb8a7('0x9'),'no'),'defaultValue':_0xb8a7('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xb8a7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xb8a7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xb8a7('0x8')](_0xb8a7('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xb8a7('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xb8a7('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xb8a7('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xb8a7('0xd')],'get':function(){return this[_0xb8a7('0xe')](_0xb8a7('0xf'))+_0xb8a7('0x10')+this[_0xb8a7('0xe')](_0xb8a7('0x11'));}}}; \ No newline at end of file +var _0x8815=['VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','INTEGER'];(function(_0x2d9bb4,_0x315ed0){var _0x3d6b43=function(_0x311f5d){while(--_0x311f5d){_0x2d9bb4['push'](_0x2d9bb4['shift']());}};_0x3d6b43(++_0x315ed0);}(_0x8815,0x1e1));var _0x5881=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0x8815[_0x1fa381];return _0x47eefe;};'use strict';var Sequelize=require('sequelize');module[_0x5881('0x0')]={'customer_id':{'type':Sequelize[_0x5881('0x1')]},'context':{'type':Sequelize[_0x5881('0x1')],'defaultValue':_0x5881('0x2'),'unique':_0x5881('0x3')},'mailbox':{'type':Sequelize[_0x5881('0x1')],'defaultValue':'','allowNull':![],'unique':_0x5881('0x3')},'password':{'type':Sequelize[_0x5881('0x1')]},'fullname':{'type':Sequelize[_0x5881('0x1')]},'email':{'type':Sequelize[_0x5881('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4cac80){this[_0x5881('0x4')](_0x5881('0x5'),typeof _0x4cac80===_0x5881('0x6')&&_0x4cac80[_0x5881('0x7')]()?_0x4cac80[_0x5881('0x7')]():null);}},'pager':{'type':Sequelize[_0x5881('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x5881('0x8')},'attach':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':_0x5881('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x5881('0x1')]},'callback':{'type':Sequelize[_0x5881('0x1')]},'review':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5881('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5881('0x9')]('yes','no'),'defaultValue':_0x5881('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5881('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5881('0x9')]('yes','no'),'defaultValue':_0x5881('0xa'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x5881('0x1')]},'emailbody':{'type':Sequelize[_0x5881('0x1')]},'maxsecs':{'type':Sequelize[_0x5881('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5881('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5881('0xc')],'get':function(){return this[_0x5881('0xd')](_0x5881('0xe'))+_0x5881('0xf')+this[_0x5881('0xd')](_0x5881('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 037df94..01be31c 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 _0xa571=['includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','params','VoiceMailMessage','filter','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','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','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','options','include','findAll','rows','catch'];(function(_0x4694a0,_0x35b97f){var _0x38a2dc=function(_0x298039){while(--_0x298039){_0x4694a0['push'](_0x4694a0['shift']());}};_0x38a2dc(++_0x35b97f);}(_0xa571,0x107));var _0x1a57=function(_0x2d6604,_0x5c52a6){_0x2d6604=_0x2d6604-0x0;var _0x27d5ea=_0xa571[_0x2d6604];return _0x27d5ea;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){var _0x26cdd3=_0x35d5dc[_0x1a57('0x23')]({'plain':!![]});var _0x2f9454=_0x1a57('0x24');return db[_0x1a57('0x25')][_0x1a57('0x22')]({'where':{'type':_0x2f9454,'resourceId':_0x26cdd3['id']}})[_0x1a57('0x21')](function(){return _0x35d5dc;});})[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x26')]();});}};}function handleEntityNotFound(_0x5a53c8,_0x530401){return function(_0x139d8c){if(!_0x139d8c){_0x5a53c8[_0x1a57('0x18')](0x194);}return _0x139d8c;};}function handleError(_0x545041,_0x46dac6){_0x46dac6=_0x46dac6||0x1f4;return function(_0x54f6a5){logger[_0x1a57('0x27')](_0x54f6a5[_0x1a57('0x28')]);if(_0x54f6a5['name']){delete _0x54f6a5[_0x1a57('0x29')];}_0x545041[_0x1a57('0x19')](_0x46dac6)[_0x1a57('0x2a')](_0x54f6a5);};}exports[_0x1a57('0x2b')]=function(_0x492b90,_0x366d5f){var _0x396832={},_0x4374f0={},_0x160536={'count':0x0,'rows':[]};var _0x5763ba=_[_0x1a57('0x2c')](db[_0x1a57('0x2d')][_0x1a57('0x2e')],function(_0x32f79f){return{'name':_0x32f79f[_0x1a57('0x2f')],'type':_0x32f79f[_0x1a57('0x30')][_0x1a57('0x31')]};});_0x4374f0[_0x1a57('0x32')]=_[_0x1a57('0x2c')](_0x5763ba,'name');_0x4374f0[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x492b90['query']);_0x4374f0['filters']=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],_0x4374f0[_0x1a57('0x33')]);_0x396832[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x37')]));_0x396832[_0x1a57('0x36')]=_0x396832[_0x1a57('0x36')][_0x1a57('0x38')]?_0x396832[_0x1a57('0x36')]:_0x4374f0[_0x1a57('0x32')];if(!_0x492b90[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x396832[_0x1a57('0x1c')]=qs['limit'](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x396832[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x396832[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x492b90[_0x1a57('0x33')]['sort']);_0x396832['where']=qs['filters'](_['pick'](_0x492b90[_0x1a57('0x33')],_0x4374f0[_0x1a57('0x3d')]),_0x5763ba);if(_0x492b90[_0x1a57('0x33')]['filter']){_0x396832[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0x396832[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5763ba,function(_0x5bf186){if(_0x5bf186[_0x1a57('0x30')]!=='VIRTUAL'){var _0xd39e5a={};_0xd39e5a[_0x5bf186[_0x1a57('0x29')]]={'$like':'%'+_0x492b90[_0x1a57('0x33')]['filter']+'%'};return _0xd39e5a;}})});}_0x396832=_[_0x1a57('0x3f')]({},_0x396832,_0x492b90[_0x1a57('0x40')]);var _0x61e9f6={'where':_0x396832[_0x1a57('0x3e')]};return db[_0x1a57('0x2d')]['count'](_0x61e9f6)[_0x1a57('0x21')](function(_0x47e998){_0x160536['count']=_0x47e998;if(_0x492b90[_0x1a57('0x33')]['includeAll']){_0x396832[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x2d')][_0x1a57('0x42')](_0x396832);})['then'](function(_0x188a50){_0x160536[_0x1a57('0x43')]=_0x188a50;return _0x160536;})[_0x1a57('0x21')](respondWithFilteredResult(_0x366d5f,_0x396832))[_0x1a57('0x44')](handleError(_0x366d5f,null));};exports['show']=function(_0xc7bab4,_0x150fb6){var _0x4fdd29={'raw':!![],'where':{'id':_0xc7bab4['params']['id']}},_0x32d05b={};_0x32d05b['model']=_[_0x1a57('0x34')](db[_0x1a57('0x2d')][_0x1a57('0x2e')]);_0x32d05b[_0x1a57('0x33')]=_['keys'](_0xc7bab4[_0x1a57('0x33')]);_0x32d05b[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],_0x32d05b[_0x1a57('0x33')]);_0x4fdd29['attributes']=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0xc7bab4[_0x1a57('0x33')]['fields']));_0x4fdd29[_0x1a57('0x36')]=_0x4fdd29['attributes'][_0x1a57('0x38')]?_0x4fdd29[_0x1a57('0x36')]:_0x32d05b[_0x1a57('0x32')];if(_0xc7bab4[_0x1a57('0x33')][_0x1a57('0x45')]){_0x4fdd29[_0x1a57('0x41')]=[{'all':!![]}];}_0x4fdd29=_[_0x1a57('0x3f')]({},_0x4fdd29,_0xc7bab4[_0x1a57('0x40')]);return db[_0x1a57('0x2d')][_0x1a57('0x46')](_0x4fdd29)[_0x1a57('0x21')](handleEntityNotFound(_0x150fb6,null))[_0x1a57('0x21')](respondWithResult(_0x150fb6,null))[_0x1a57('0x44')](handleError(_0x150fb6,null));};exports['create']=function(_0xf4d056,_0x480aff){return db[_0x1a57('0x2d')][_0x1a57('0x47')](_0xf4d056[_0x1a57('0x48')],{})[_0x1a57('0x21')](function(_0x323af1){var _0x3cbb9e=_0xf4d056[_0x1a57('0x49')][_0x1a57('0x23')]({'plain':!![]});if(!_0x3cbb9e)throw new Error(_0x1a57('0x4a'));if(_0x3cbb9e['role']===_0x1a57('0x49')){var _0x439a42=_0x323af1['get']({'plain':!![]});var _0x15f1f5=_0x1a57('0x24');return db['UserProfileSection'][_0x1a57('0x46')]({'where':{'name':_0x15f1f5,'userProfileId':_0x3cbb9e[_0x1a57('0x4b')]},'raw':!![]})['then'](function(_0x4d3177){if(_0x4d3177&&_0x4d3177['autoAssociation']===0x0){return db[_0x1a57('0x25')][_0x1a57('0x47')]({'name':_0x439a42['name'],'resourceId':_0x439a42['id'],'type':_0x4d3177[_0x1a57('0x29')],'sectionId':_0x4d3177['id']},{})[_0x1a57('0x21')](function(){return _0x323af1;});}else{return _0x323af1;}})['catch'](function(_0x5e510e){logger['error'](_0x1a57('0x4c'),_0x5e510e);throw _0x5e510e;});}return _0x323af1;})[_0x1a57('0x21')](respondWithResult(_0x480aff,0xc9))[_0x1a57('0x44')](handleError(_0x480aff,null));};exports[_0x1a57('0x20')]=function(_0x28738e,_0x33379c){if(_0x28738e[_0x1a57('0x48')]['id']){delete _0x28738e[_0x1a57('0x48')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x28738e['params']['id']}})['then'](handleEntityNotFound(_0x33379c,null))['then'](saveUpdates(_0x28738e[_0x1a57('0x48')],null))[_0x1a57('0x21')](respondWithResult(_0x33379c,null))[_0x1a57('0x44')](handleError(_0x33379c,null));};exports[_0x1a57('0x22')]=function(_0x26cf80,_0x2f09e7){return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x26cf80['params']['id']}})['then'](handleEntityNotFound(_0x2f09e7,null))['then'](removeEntity(_0x2f09e7,null))[_0x1a57('0x44')](handleError(_0x2f09e7,null));};exports['getMessages']=function(_0x301db9,_0x10c058,_0x408e67){return db[_0x1a57('0x2d')][_0x1a57('0x4d')]({'where':{'id':_0x301db9[_0x1a57('0x4e')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x10c058,null))['then'](function(_0x4e56b5){var _0x4d5b1d;var _0xc936a7={},_0x562775={};_0x562775[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x4f')][_0x1a57('0x2e')]);_0x562775[_0x1a57('0x33')]=_['keys'](_0x301db9['query']);_0x562775[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x562775[_0x1a57('0x32')],_0x562775[_0x1a57('0x33')]);_0xc936a7[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x562775['model'],qs['fields'](_0x301db9[_0x1a57('0x33')][_0x1a57('0x37')]));_0xc936a7['attributes']=_0xc936a7['attributes'][_0x1a57('0x38')]?_0xc936a7[_0x1a57('0x36')]:_0x562775[_0x1a57('0x32')];if(!_0x301db9[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0xc936a7[_0x1a57('0x1c')]=qs['limit'](_0x301db9['query'][_0x1a57('0x1c')]);_0xc936a7[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x301db9[_0x1a57('0x33')]['offset']);}_0xc936a7[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x301db9[_0x1a57('0x33')][_0x1a57('0x3c')]);_0xc936a7[_0x1a57('0x3e')]=qs['filters'](_['pick'](_0x301db9['query'],_0x562775[_0x1a57('0x3d')]));if(_0x301db9[_0x1a57('0x33')][_0x1a57('0x50')]){_0xc936a7[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0xc936a7[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0xc936a7[_0x1a57('0x36')],function(_0x482508){var _0xe8ef76={};_0xe8ef76[_0x482508]={'$like':'%'+_0x301db9[_0x1a57('0x33')]['filter']+'%'};return _0xe8ef76;})});}_0xc936a7['where']=_[_0x1a57('0x3f')](_0xc936a7['where'],{'mailboxuser':_0x4e56b5[_0x1a57('0x51')]});_0xc936a7=_[_0x1a57('0x3f')]({},_0xc936a7,_0x301db9[_0x1a57('0x40')]);return db[_0x1a57('0x4f')][_0x1a57('0x52')](_0xc936a7)[_0x1a57('0x21')](respondWithFilteredResult(_0x10c058,_0xc936a7));})[_0x1a57('0x44')](handleError(_0x10c058,null));}; \ No newline at end of file +var _0xcf66=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1ebeea,_0x2f54f4){var _0x576465=function(_0x47fc77){while(--_0x47fc77){_0x1ebeea['push'](_0x1ebeea['shift']());}};_0x576465(++_0x2f54f4);}(_0xcf66,0x71));var _0x6cf6=function(_0x43c51e,_0x286898){_0x43c51e=_0x43c51e-0x0;var _0x4428db=_0xcf66[_0x43c51e];return _0x4428db;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){var _0x14ae3e=_0x59f838[_0x6cf6('0x23')]({'plain':!![]});var _0x3f9871=_0x6cf6('0x24');return db[_0x6cf6('0x25')]['destroy']({'where':{'type':_0x3f9871,'resourceId':_0x14ae3e['id']}})[_0x6cf6('0x21')](function(){return _0x59f838;});})[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4eec5,_0x2e56ca){return function(_0x2224db){if(!_0x2224db){_0xf4eec5[_0x6cf6('0x14')](0x194);}return _0x2224db;};}function handleError(_0x5c9236,_0x584594){_0x584594=_0x584594||0x1f4;return function(_0x2afe84){logger[_0x6cf6('0x26')](_0x2afe84[_0x6cf6('0x27')]);if(_0x2afe84[_0x6cf6('0x28')]){delete _0x2afe84['name'];}_0x5c9236[_0x6cf6('0x15')](_0x584594)['send'](_0x2afe84);};}exports['index']=function(_0x519a70,_0x10bde5){var _0x65433={},_0x33d308={},_0x42f488={'count':0x0,'rows':[]};var _0x11c848=_['map'](db[_0x6cf6('0x29')][_0x6cf6('0x2a')],function(_0x356340){return{'name':_0x356340['fieldName'],'type':_0x356340[_0x6cf6('0x2b')][_0x6cf6('0x2c')]};});_0x33d308[_0x6cf6('0x2d')]=_[_0x6cf6('0x2e')](_0x11c848,_0x6cf6('0x28'));_0x33d308[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x519a70[_0x6cf6('0x2f')]);_0x33d308[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],_0x33d308[_0x6cf6('0x2f')]);_0x65433[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],qs[_0x6cf6('0x34')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0x65433['attributes']=_0x65433[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x65433[_0x6cf6('0x33')]:_0x33d308[_0x6cf6('0x2d')];if(!_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x36')](_0x6cf6('0x37'))){_0x65433[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x65433['offset']=qs[_0x6cf6('0x18')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x18')]);}_0x65433[_0x6cf6('0x38')]=qs[_0x6cf6('0x39')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x39')]);_0x65433[_0x6cf6('0x3a')]=qs[_0x6cf6('0x31')](_['pick'](_0x519a70[_0x6cf6('0x2f')],_0x33d308[_0x6cf6('0x31')]),_0x11c848);if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x65433[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x65433[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x11c848,function(_0x3a7c3b){if(_0x3a7c3b['type']!==_0x6cf6('0x3d')){var _0x5a9727={};_0x5a9727[_0x3a7c3b[_0x6cf6('0x28')]]={'$like':'%'+_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]+'%'};return _0x5a9727;}})});}_0x65433=_[_0x6cf6('0x3c')]({},_0x65433,_0x519a70[_0x6cf6('0x3e')]);var _0x29541e={'where':_0x65433[_0x6cf6('0x3a')]};return db[_0x6cf6('0x29')]['count'](_0x29541e)[_0x6cf6('0x21')](function(_0x335dce){_0x42f488['count']=_0x335dce;if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0x65433[_0x6cf6('0x40')]=[{'all':!![]}];}return db['VoiceMail'][_0x6cf6('0x41')](_0x65433);})[_0x6cf6('0x21')](function(_0x51d915){_0x42f488[_0x6cf6('0x42')]=_0x51d915;return _0x42f488;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x10bde5,_0x65433))[_0x6cf6('0x43')](handleError(_0x10bde5,null));};exports[_0x6cf6('0x44')]=function(_0x41195e,_0x20dacd){var _0xbcb6a7={'raw':!![],'where':{'id':_0x41195e[_0x6cf6('0x45')]['id']}},_0x5a2ef8={};_0x5a2ef8['model']=_[_0x6cf6('0x30')](db[_0x6cf6('0x29')]['rawAttributes']);_0x5a2ef8[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x41195e[_0x6cf6('0x2f')]);_0x5a2ef8[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],_0x5a2ef8[_0x6cf6('0x2f')]);_0xbcb6a7[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],qs[_0x6cf6('0x34')](_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0xbcb6a7['attributes']=_0xbcb6a7[_0x6cf6('0x33')]['length']?_0xbcb6a7['attributes']:_0x5a2ef8[_0x6cf6('0x2d')];if(_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0xbcb6a7[_0x6cf6('0x40')]=[{'all':!![]}];}_0xbcb6a7=_[_0x6cf6('0x3c')]({},_0xbcb6a7,_0x41195e[_0x6cf6('0x3e')]);return db[_0x6cf6('0x29')][_0x6cf6('0x46')](_0xbcb6a7)[_0x6cf6('0x21')](handleEntityNotFound(_0x20dacd,null))[_0x6cf6('0x21')](respondWithResult(_0x20dacd,null))[_0x6cf6('0x43')](handleError(_0x20dacd,null));};exports[_0x6cf6('0x47')]=function(_0x3786d1,_0x4c8ada){return db[_0x6cf6('0x29')][_0x6cf6('0x47')](_0x3786d1['body'],{})['then'](function(_0x10047a){var _0x17dd6e=_0x3786d1[_0x6cf6('0x48')][_0x6cf6('0x23')]({'plain':!![]});if(!_0x17dd6e)throw new Error(_0x6cf6('0x49'));if(_0x17dd6e[_0x6cf6('0x4a')]==='user'){var _0x115b9b=_0x10047a[_0x6cf6('0x23')]({'plain':!![]});var _0x2503dc='Voicemails';return db['UserProfileSection'][_0x6cf6('0x46')]({'where':{'name':_0x2503dc,'userProfileId':_0x17dd6e[_0x6cf6('0x4b')]},'raw':!![]})[_0x6cf6('0x21')](function(_0x255e88){if(_0x255e88&&_0x255e88[_0x6cf6('0x4c')]===0x0){return db[_0x6cf6('0x25')][_0x6cf6('0x47')]({'name':_0x115b9b[_0x6cf6('0x28')],'resourceId':_0x115b9b['id'],'type':_0x255e88[_0x6cf6('0x28')],'sectionId':_0x255e88['id']},{})[_0x6cf6('0x21')](function(){return _0x10047a;});}else{return _0x10047a;}})['catch'](function(_0x217072){logger[_0x6cf6('0x26')](_0x6cf6('0x4d'),_0x217072);throw _0x217072;});}return _0x10047a;})[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,0xc9))[_0x6cf6('0x43')](handleError(_0x4c8ada,null));};exports[_0x6cf6('0x20')]=function(_0x2e1ee7,_0xce361){if(_0x2e1ee7[_0x6cf6('0x4e')]['id']){delete _0x2e1ee7[_0x6cf6('0x4e')]['id'];}return db[_0x6cf6('0x29')]['find']({'where':{'id':_0x2e1ee7[_0x6cf6('0x45')]['id']}})['then'](handleEntityNotFound(_0xce361,null))[_0x6cf6('0x21')](saveUpdates(_0x2e1ee7[_0x6cf6('0x4e')],null))['then'](respondWithResult(_0xce361,null))[_0x6cf6('0x43')](handleError(_0xce361,null));};exports[_0x6cf6('0x22')]=function(_0x4699d5,_0x1bdbc1){return db[_0x6cf6('0x29')][_0x6cf6('0x46')]({'where':{'id':_0x4699d5['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x1bdbc1,null))[_0x6cf6('0x21')](removeEntity(_0x1bdbc1,null))[_0x6cf6('0x43')](handleError(_0x1bdbc1,null));};exports['getMessages']=function(_0x4f1de3,_0x2c8736,_0x140ed2){return db['VoiceMail'][_0x6cf6('0x4f')]({'where':{'id':_0x4f1de3[_0x6cf6('0x45')]['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x2c8736,null))[_0x6cf6('0x21')](function(_0x2e460a){var _0x58ec7e;var _0x3e7e5b={},_0x40b31f={};_0x40b31f['model']=_['keys'](db[_0x6cf6('0x50')][_0x6cf6('0x2a')]);_0x40b31f[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x4f1de3[_0x6cf6('0x2f')]);_0x40b31f['filters']=_['intersection'](_0x40b31f[_0x6cf6('0x2d')],_0x40b31f[_0x6cf6('0x2f')]);_0x3e7e5b[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x40b31f[_0x6cf6('0x2d')],qs['fields'](_0x4f1de3['query']['fields']));_0x3e7e5b[_0x6cf6('0x33')]=_0x3e7e5b[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x3e7e5b[_0x6cf6('0x33')]:_0x40b31f['model'];if(!_0x4f1de3[_0x6cf6('0x2f')]['hasOwnProperty'](_0x6cf6('0x37'))){_0x3e7e5b['limit']=qs[_0x6cf6('0x1a')](_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x3e7e5b[_0x6cf6('0x18')]=qs[_0x6cf6('0x18')](_0x4f1de3['query'][_0x6cf6('0x18')]);}_0x3e7e5b['order']=qs[_0x6cf6('0x39')](_0x4f1de3['query'][_0x6cf6('0x39')]);_0x3e7e5b['where']=qs[_0x6cf6('0x31')](_[_0x6cf6('0x51')](_0x4f1de3['query'],_0x40b31f[_0x6cf6('0x31')]));if(_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x3e7e5b[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x3e7e5b[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x3e7e5b['attributes'],function(_0x4ff62b){var _0x2df3ea={};_0x2df3ea[_0x4ff62b]={'$like':'%'+_0x4f1de3[_0x6cf6('0x2f')]['filter']+'%'};return _0x2df3ea;})});}_0x3e7e5b[_0x6cf6('0x3a')]=_['merge'](_0x3e7e5b['where'],{'mailboxuser':_0x2e460a[_0x6cf6('0x52')]});_0x3e7e5b=_['merge']({},_0x3e7e5b,_0x4f1de3['options']);return db[_0x6cf6('0x50')][_0x6cf6('0x53')](_0x3e7e5b)[_0x6cf6('0x21')](respondWithFilteredResult(_0x2c8736,_0x3e7e5b));})['catch'](handleError(_0x2c8736,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 2256715..fffaec4 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 _0x7477=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','util'];(function(_0x11c69f,_0x116175){var _0xba70ab=function(_0x187fe2){while(--_0x187fe2){_0x11c69f['push'](_0x11c69f['shift']());}};_0xba70ab(++_0x116175);}(_0x7477,0x179));var _0x7747=function(_0x834bb6,_0x1c5e35){_0x834bb6=_0x834bb6-0x0;var _0xa35d00=_0x7477[_0x834bb6];return _0xa35d00;};'use strict';var _=require('lodash');var util=require(_0x7747('0x0'));var logger=require(_0x7747('0x1'))('api');var moment=require(_0x7747('0x2'));var BPromise=require(_0x7747('0x3'));var rp=require(_0x7747('0x4'));var fs=require('fs');var path=require(_0x7747('0x5'));var rimraf=require(_0x7747('0x6'));var config=require(_0x7747('0x7'));var attributes=require('./voiceMail.attributes');module[_0x7747('0x8')]=function(_0x3442d9,_0x5cd628){return _0x3442d9['define'](_0x7747('0x9'),attributes,{'tableName':_0x7747('0xa'),'paranoid':![],'indexes':[{'name':_0x7747('0xb'),'fields':[_0x7747('0xc'),_0x7747('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f78=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x0f78,0x68));var _0x80f7=function(_0x184609,_0x2ec389){_0x184609=_0x184609-0x0;var _0x5ac0ab=_0x0f78[_0x184609];return _0x5ac0ab;};'use strict';var _=require(_0x80f7('0x0'));var util=require(_0x80f7('0x1'));var logger=require(_0x80f7('0x2'))(_0x80f7('0x3'));var moment=require(_0x80f7('0x4'));var BPromise=require(_0x80f7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80f7('0x6'));var rimraf=require(_0x80f7('0x7'));var config=require(_0x80f7('0x8'));var attributes=require(_0x80f7('0x9'));module[_0x80f7('0xa')]=function(_0x32873c,_0x3cf19a){return _0x32873c[_0x80f7('0xb')](_0x80f7('0xc'),attributes,{'tableName':_0x80f7('0xd'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x80f7('0xe'),_0x80f7('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index a54c91a..6fe409b 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 _0x0792=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x0792,0x9c));var _0x2079=function(_0x1bffc9,_0x505bf0){_0x1bffc9=_0x1bffc9-0x0;var _0x26177e=_0x0792[_0x1bffc9];return _0x26177e;};'use strict';var _=require(_0x2079('0x0'));var util=require(_0x2079('0x1'));var moment=require(_0x2079('0x2'));var BPromise=require(_0x2079('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2079('0x4'));var db=require(_0x2079('0x5'))['db'];var utils=require(_0x2079('0x6'));var logger=require(_0x2079('0x7'))(_0x2079('0x8'));var config=require(_0x2079('0x9'));var jayson=require(_0x2079('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28ba32,_0x143552,_0xcf1071){return new BPromise(function(_0x567d2b,_0x52a367){return client[_0x2079('0xb')](_0x28ba32,_0xcf1071)[_0x2079('0xc')](function(_0x2d35e2){logger['info'](_0x2079('0xd'),_0x143552,_0x2079('0xe'));logger[_0x2079('0xf')](_0x2079('0x10'),_0x143552,_0x2079('0xe'),JSON[_0x2079('0x11')](_0x2d35e2));if(_0x2d35e2['error']){if(_0x2d35e2[_0x2079('0x12')]['code']===0x1f4){logger[_0x2079('0x12')](_0x2079('0xd'),_0x143552,_0x2d35e2[_0x2079('0x12')]['message']);return _0x52a367(_0x2d35e2[_0x2079('0x12')][_0x2079('0x13')]);}logger[_0x2079('0x12')]('VoiceMail,\x20%s,\x20%s',_0x143552,_0x2d35e2[_0x2079('0x12')][_0x2079('0x13')]);return _0x567d2b(_0x2d35e2[_0x2079('0x12')][_0x2079('0x13')]);}else{logger['info'](_0x2079('0xd'),_0x143552,'request\x20sent');_0x567d2b(_0x2d35e2[_0x2079('0x14')][_0x2079('0x13')]);}})[_0x2079('0x15')](function(_0x1dcbd3){logger[_0x2079('0x12')](_0x2079('0xd'),_0x143552,_0x1dcbd3);_0x52a367(_0x1dcbd3);});});} \ No newline at end of file +var _0x4a05=['request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VoiceMail,\x20%s,\x20%s'];(function(_0x585199,_0x10d223){var _0x4f5eaf=function(_0x19f4cf){while(--_0x19f4cf){_0x585199['push'](_0x585199['shift']());}};_0x4f5eaf(++_0x10d223);}(_0x4a05,0x1ad));var _0x54a0=function(_0x398437,_0x382e5f){_0x398437=_0x398437-0x0;var _0x539597=_0x4a05[_0x398437];return _0x539597;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x54a0('0x0'));var BPromise=require(_0x54a0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54a0('0x2'));var db=require(_0x54a0('0x3'))['db'];var utils=require(_0x54a0('0x4'));var logger=require(_0x54a0('0x5'))(_0x54a0('0x6'));var config=require(_0x54a0('0x7'));var jayson=require(_0x54a0('0x8'));var client=jayson[_0x54a0('0x9')][_0x54a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c757d,_0x1080ef,_0x26bf39){return new BPromise(function(_0x4e9344,_0x275ab0){return client['request'](_0x4c757d,_0x26bf39)['then'](function(_0x269d45){logger['info'](_0x54a0('0xb'),_0x1080ef,_0x54a0('0xc'));logger[_0x54a0('0xd')](_0x54a0('0xe'),_0x1080ef,_0x54a0('0xc'),JSON['stringify'](_0x269d45));if(_0x269d45[_0x54a0('0xf')]){if(_0x269d45[_0x54a0('0xf')][_0x54a0('0x10')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x1080ef,_0x269d45[_0x54a0('0xf')][_0x54a0('0x11')]);return _0x275ab0(_0x269d45[_0x54a0('0xf')][_0x54a0('0x11')]);}logger[_0x54a0('0xf')](_0x54a0('0xb'),_0x1080ef,_0x269d45['error'][_0x54a0('0x11')]);return _0x4e9344(_0x269d45[_0x54a0('0xf')]['message']);}else{logger[_0x54a0('0x12')](_0x54a0('0xb'),_0x1080ef,_0x54a0('0xc'));_0x4e9344(_0x269d45[_0x54a0('0x13')][_0x54a0('0x11')]);}})[_0x54a0('0x14')](function(_0x1e2323){logger['error'](_0x54a0('0xb'),_0x1080ef,_0x1e2323);_0x275ab0(_0x1e2323);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 20a8ebd..ada3b57 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 _0x591f=['multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','update','delete'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x591f,0x144));var _0xf591=function(_0x5d8e11,_0x1b2574){_0x5d8e11=_0x5d8e11-0x0;var _0x25fa53=_0x591f[_0x5d8e11];return _0x25fa53;};'use strict';var multer=require(_0xf591('0x0'));var util=require('util');var path=require(_0xf591('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf591('0x2')]();var fs_extra=require(_0xf591('0x3'));var auth=require(_0xf591('0x4'));var interaction=require(_0xf591('0x5'));var config=require('../../config/environment');var controller=require(_0xf591('0x6'));router[_0xf591('0x7')]('/',auth[_0xf591('0x8')](),controller[_0xf591('0x9')]);router[_0xf591('0x7')](_0xf591('0xa'),auth[_0xf591('0x8')](),controller[_0xf591('0xb')]);router['get'](_0xf591('0xc'),auth[_0xf591('0x8')](),controller[_0xf591('0xd')]);router['post']('/',auth[_0xf591('0x8')](),controller[_0xf591('0xe')]);router[_0xf591('0xf')](_0xf591('0xa'),auth[_0xf591('0x8')](),controller[_0xf591('0x10')]);router[_0xf591('0x11')](_0xf591('0xa'),auth[_0xf591('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x82fa=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','post','put','update','delete','destroy'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x82fa,0xac));var _0xa82f=function(_0x1d2379,_0x229877){_0x1d2379=_0x1d2379-0x0;var _0x369e37=_0x82fa[_0x1d2379];return _0x369e37;};'use strict';var multer=require(_0xa82f('0x0'));var util=require('util');var path=require(_0xa82f('0x1'));var timeout=require('connect-timeout');var express=require(_0xa82f('0x2'));var router=express['Router']();var fs_extra=require(_0xa82f('0x3'));var auth=require(_0xa82f('0x4'));var interaction=require(_0xa82f('0x5'));var config=require(_0xa82f('0x6'));var controller=require(_0xa82f('0x7'));router[_0xa82f('0x8')]('/',auth[_0xa82f('0x9')](),controller[_0xa82f('0xa')]);router[_0xa82f('0x8')](_0xa82f('0xb'),auth[_0xa82f('0x9')](),controller['show']);router[_0xa82f('0x8')](_0xa82f('0xc'),auth[_0xa82f('0x9')](),controller['download']);router[_0xa82f('0xd')]('/',auth[_0xa82f('0x9')](),controller['create']);router[_0xa82f('0xe')]('/:id',auth[_0xa82f('0x9')](),controller[_0xa82f('0xf')]);router[_0xa82f('0x10')]('/:id',auth[_0xa82f('0x9')](),controller[_0xa82f('0x11')]);module[_0xa82f('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 62ed63d..627971c 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 _0xbf2c=['TIMESTAMP','literal','sequelize','VIRTUAL','getDataValue','STRING','BLOB'];(function(_0x329af8,_0x3ed5a7){var _0x4db0da=function(_0x2a178d){while(--_0x2a178d){_0x329af8['push'](_0x329af8['shift']());}};_0x4db0da(++_0x3ed5a7);}(_0xbf2c,0x128));var _0xcbf2=function(_0x943762,_0x14e5bb){_0x943762=_0x943762-0x0;var _0x108fec=_0xbf2c[_0x943762];return _0x108fec;};'use strict';var Sequelize=require(_0xcbf2('0x0'));module['exports']={'name':{'type':Sequelize[_0xcbf2('0x1')],'get':function(_0x170ad3){return this[_0xcbf2('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xcbf2('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xcbf2('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xcbf2('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xcbf2('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xcbf2('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xcbf2('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xcbf2('0x3')],'defaultValue':''},'stamp':{'type':_0xcbf2('0x5'),'defaultValue':Sequelize[_0xcbf2('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x9fd5=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x375521,_0x413159){var _0x1fb976=function(_0x2eddfc){while(--_0x2eddfc){_0x375521['push'](_0x375521['shift']());}};_0x1fb976(++_0x413159);}(_0x9fd5,0x143));var _0x59fd=function(_0x373389,_0x39c241){_0x373389=_0x373389-0x0;var _0x34d38b=_0x9fd5[_0x373389];return _0x34d38b;};'use strict';var Sequelize=require('sequelize');module[_0x59fd('0x0')]={'name':{'type':Sequelize[_0x59fd('0x1')],'get':function(_0x50fa72){return this[_0x59fd('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x59fd('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x59fd('0x5')](_0x59fd('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x59fd('0x7'),'defaultValue':Sequelize[_0x59fd('0x8')](_0x59fd('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 8a11818..ab3a024 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 _0x968d=['recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','VoiceMailMessage','include','findAll','rows','catch','show','params','create','update','body','find','destroy','download'];(function(_0xb8a1d3,_0x3dce20){var _0x45495a=function(_0x2865db){while(--_0x2865db){_0xb8a1d3['push'](_0xb8a1d3['shift']());}};_0x45495a(++_0x3dce20);}(_0x968d,0x1a1));var _0xd968=function(_0x3d0abf,_0x4779d5){_0x3d0abf=_0x3d0abf-0x0;var _0x2bf259=_0x968d[_0x3d0abf];return _0x2bf259;};'use strict';var emlformat=require(_0xd968('0x0'));var rimraf=require(_0xd968('0x1'));var zipdir=require(_0xd968('0x2'));var jsonpatch=require(_0xd968('0x3'));var rp=require(_0xd968('0x4'));var moment=require(_0xd968('0x5'));var BPromise=require(_0xd968('0x6'));var Mustache=require(_0xd968('0x7'));var util=require('util');var path=require(_0xd968('0x8'));var sox=require(_0xd968('0x9'));var csv=require('to-csv');var ejs=require(_0xd968('0xa'));var fs=require('fs');var fs_extra=require(_0xd968('0xb'));var _=require(_0xd968('0xc'));var squel=require('squel');var crypto=require(_0xd968('0xd'));var jsforce=require(_0xd968('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd968('0xf'));var querystring=require(_0xd968('0x10'));var Papa=require(_0xd968('0x11'));var Redis=require(_0xd968('0x12'));var authService=require(_0xd968('0x13'));var qs=require(_0xd968('0x14'));var as=require(_0xd968('0x15'));var hardwareService=require(_0xd968('0x16'));var logger=require('../../config/logger')(_0xd968('0x17'));var utils=require('../../config/utils');var config=require(_0xd968('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd968('0x19'))['db'];function respondWithStatusCode(_0x35f2f3,_0x341b9e){_0x341b9e=_0x341b9e||0xcc;return function(_0x1745c1){if(_0x1745c1){return _0x35f2f3[_0xd968('0x1a')](_0x341b9e);}return _0x35f2f3[_0xd968('0x1b')](_0x341b9e)[_0xd968('0x1c')]();};}function respondWithResult(_0x3944f8,_0x4d9afb){_0x4d9afb=_0x4d9afb||0xc8;return function(_0xa3d7cd){if(_0xa3d7cd){return _0x3944f8['status'](_0x4d9afb)[_0xd968('0x1d')](_0xa3d7cd);}};}function respondWithFilteredResult(_0x3d6928,_0x5a5932){return function(_0xc1eb08){if(_0xc1eb08){var _0x3b5a61=typeof _0x5a5932['offset']===_0xd968('0x1e')&&typeof _0x5a5932[_0xd968('0x1f')]===_0xd968('0x1e');var _0x3b7eaa=_0xc1eb08[_0xd968('0x20')];var _0x423564=_0x3b5a61?0x0:_0x5a5932[_0xd968('0x21')];var _0x2df333=_0x3b5a61?_0xc1eb08[_0xd968('0x20')]:_0x5a5932['offset']+_0x5a5932[_0xd968('0x1f')];var _0x3ef730;if(_0x2df333>=_0x3b7eaa){_0x2df333=_0x3b7eaa;_0x3ef730=0xc8;}else{_0x3ef730=0xce;}_0x3d6928['status'](_0x3ef730);return _0x3d6928[_0xd968('0x22')](_0xd968('0x23'),_0x423564+'-'+_0x2df333+'/'+_0x3b7eaa)[_0xd968('0x1d')](_0xc1eb08);}return null;};}function patchUpdates(_0x4b60ac){return function(_0x29712c){try{jsonpatch[_0xd968('0x24')](_0x29712c,_0x4b60ac,!![]);}catch(_0x44fcdc){return BPromise[_0xd968('0x25')](_0x44fcdc);}return _0x29712c['save']();};}function saveUpdates(_0x4d97aa,_0x1280e1){return function(_0x5a6c45){if(_0x5a6c45){return _0x5a6c45['update'](_0x4d97aa)['then'](function(_0x215139){return _0x215139;});}return null;};}function removeEntity(_0x33bc44,_0x4ed867){return function(_0x2cfddf){if(_0x2cfddf){return _0x2cfddf['destroy']()[_0xd968('0x26')](function(){_0x33bc44[_0xd968('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30d669,_0x196d12){return function(_0x2a177d){if(!_0x2a177d){_0x30d669[_0xd968('0x1a')](0x194);}return _0x2a177d;};}function handleError(_0x6f92bf,_0x94dca0){_0x94dca0=_0x94dca0||0x1f4;return function(_0x1758b2){logger['error'](_0x1758b2[_0xd968('0x27')]);if(_0x1758b2[_0xd968('0x28')]){delete _0x1758b2['name'];}_0x6f92bf[_0xd968('0x1b')](_0x94dca0)[_0xd968('0x29')](_0x1758b2);};}exports['index']=function(_0x486248,_0x47a30d){var _0x44f26b={},_0x5e7e37={},_0x1c882c={'count':0x0,'rows':[]};var _0x30bc7d=_[_0xd968('0x2a')](db['VoiceMailMessage'][_0xd968('0x2b')],function(_0x11e583){return{'name':_0x11e583[_0xd968('0x2c')],'type':_0x11e583[_0xd968('0x2d')][_0xd968('0x2e')]};});_0x5e7e37[_0xd968('0x2f')]=_['differenceBy'](_[_0xd968('0x2a')](_0x30bc7d,_0xd968('0x28')),[_0xd968('0x28')]);_0x5e7e37['query']=_[_0xd968('0x30')](_0x486248[_0xd968('0x31')]);_0x5e7e37[_0xd968('0x32')]=_[_0xd968('0x33')](_0x5e7e37['model'],_0x5e7e37['query']);_0x44f26b[_0xd968('0x34')]=_['intersection'](_0x5e7e37[_0xd968('0x2f')],qs[_0xd968('0x35')](_0x486248[_0xd968('0x31')][_0xd968('0x35')]));_0x44f26b['attributes']=_0x44f26b[_0xd968('0x34')][_0xd968('0x36')]?_0x44f26b['attributes']:_0x5e7e37['model'];if(!_0x486248['query']['hasOwnProperty']('nolimit')){_0x44f26b[_0xd968('0x1f')]=qs[_0xd968('0x1f')](_0x486248['query'][_0xd968('0x1f')]);_0x44f26b[_0xd968('0x21')]=qs[_0xd968('0x21')](_0x486248[_0xd968('0x31')][_0xd968('0x21')]);}_0x44f26b[_0xd968('0x37')]=qs[_0xd968('0x38')](_0x486248[_0xd968('0x31')][_0xd968('0x38')]);_0x44f26b[_0xd968('0x39')]=qs[_0xd968('0x32')](_['pick'](_0x486248[_0xd968('0x31')],_0x5e7e37[_0xd968('0x32')]),_0x30bc7d);if(_0x486248['query'][_0xd968('0x3a')]){_0x44f26b[_0xd968('0x39')]=_[_0xd968('0x3b')](_0x44f26b[_0xd968('0x39')],{'$or':_[_0xd968('0x2a')](_0x30bc7d,function(_0x3c3cac){if(_0x3c3cac[_0xd968('0x2d')]!==_0xd968('0x3c')){var _0x5a4e3b={};_0x5a4e3b[_0x3c3cac[_0xd968('0x28')]]={'$like':'%'+_0x486248[_0xd968('0x31')][_0xd968('0x3a')]+'%'};return _0x5a4e3b;}})});}_0x44f26b=_[_0xd968('0x3b')]({},_0x44f26b,_0x486248[_0xd968('0x3d')]);var _0x345f38={'where':_0x44f26b['where']};return db[_0xd968('0x3e')][_0xd968('0x20')](_0x345f38)[_0xd968('0x26')](function(_0x3e3d55){_0x1c882c[_0xd968('0x20')]=_0x3e3d55;if(_0x486248[_0xd968('0x31')]['includeAll']){_0x44f26b[_0xd968('0x3f')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xd968('0x40')](_0x44f26b);})['then'](function(_0x510e73){_0x1c882c[_0xd968('0x41')]=_0x510e73;return _0x1c882c;})['then'](respondWithFilteredResult(_0x47a30d,_0x44f26b))[_0xd968('0x42')](handleError(_0x47a30d,null));};exports[_0xd968('0x43')]=function(_0x59a1b4,_0x73f008){var _0x3c388f={'raw':!![],'where':{'id':_0x59a1b4[_0xd968('0x44')]['id']}},_0x3bed19={};_0x3bed19[_0xd968('0x2f')]=_['keys'](db[_0xd968('0x3e')][_0xd968('0x2b')]);_0x3bed19[_0xd968('0x31')]=_[_0xd968('0x30')](_0x59a1b4['query']);_0x3bed19[_0xd968('0x32')]=_['intersection'](_0x3bed19[_0xd968('0x2f')],_0x3bed19[_0xd968('0x31')]);_0x3c388f[_0xd968('0x34')]=_[_0xd968('0x33')](_0x3bed19[_0xd968('0x2f')],qs[_0xd968('0x35')](_0x59a1b4['query'][_0xd968('0x35')]));_0x3c388f[_0xd968('0x34')]=_0x3c388f['attributes'][_0xd968('0x36')]?_0x3c388f[_0xd968('0x34')]:_0x3bed19['model'];if(_0x59a1b4[_0xd968('0x31')]['includeAll']){_0x3c388f[_0xd968('0x3f')]=[{'all':!![]}];}_0x3c388f=_[_0xd968('0x3b')]({},_0x3c388f,_0x59a1b4[_0xd968('0x3d')]);return db[_0xd968('0x3e')]['find'](_0x3c388f)[_0xd968('0x26')](handleEntityNotFound(_0x73f008,null))[_0xd968('0x26')](respondWithResult(_0x73f008,null))['catch'](handleError(_0x73f008,null));};exports['create']=function(_0x8bce02,_0x52e659){return db['VoiceMailMessage'][_0xd968('0x45')](_0x8bce02['body'],{})['then'](respondWithResult(_0x52e659,0xc9))[_0xd968('0x42')](handleError(_0x52e659,null));};exports[_0xd968('0x46')]=function(_0x23420e,_0x3d6d52){if(_0x23420e[_0xd968('0x47')]['id']){delete _0x23420e[_0xd968('0x47')]['id'];}return db[_0xd968('0x3e')][_0xd968('0x48')]({'where':{'id':_0x23420e[_0xd968('0x44')]['id']}})[_0xd968('0x26')](handleEntityNotFound(_0x3d6d52,null))['then'](saveUpdates(_0x23420e[_0xd968('0x47')],null))['then'](respondWithResult(_0x3d6d52,null))[_0xd968('0x42')](handleError(_0x3d6d52,null));};exports[_0xd968('0x49')]=function(_0x4b3628,_0x373412){return db[_0xd968('0x3e')]['find']({'where':{'id':_0x4b3628[_0xd968('0x44')]['id']}})[_0xd968('0x26')](handleEntityNotFound(_0x373412,null))[_0xd968('0x26')](removeEntity(_0x373412,null))[_0xd968('0x42')](handleError(_0x373412,null));};exports[_0xd968('0x4a')]=function(_0x39bc85,_0x547c08,_0x179dbc){return db[_0xd968('0x3e')][_0xd968('0x48')]({'where':{'id':_0x39bc85[_0xd968('0x44')]['id']},'attributes':['id',_0xd968('0x4b'),_0xd968('0x4c')]})[_0xd968('0x26')](handleEntityNotFound(_0x547c08,null))['then'](function(_0x2860aa){if(_0x2860aa){if(!_0x2860aa[_0xd968('0x4b')]){throw new db[(_0xd968('0x4d'))]['ValidationError'](_0xd968('0x4e'));}var _0x36e4f6={'Content-Type':_0xd968('0x4f'),'Content-Disposition':'attachment'};if(_0x2860aa[_0xd968('0x4c')]){_0x36e4f6[_0xd968('0x50')]=_0xd968('0x51')+_0x2860aa[_0xd968('0x4c')]+'.wav\x22';}_0x547c08[_0xd968('0x22')](_0x36e4f6);return _0x547c08[_0xd968('0x29')](new Buffer(_0x2860aa['recording']));}})['catch'](handleError(_0x547c08,null));}; \ No newline at end of file +var _0xf368=['key','model','differenceBy','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','VoiceMailMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','options','find','create','body','download','recording','msg_id','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','fieldName','type'];(function(_0x4f595b,_0x21875e){var _0xc9597c=function(_0x4d6235){while(--_0x4d6235){_0x4f595b['push'](_0x4f595b['shift']());}};_0xc9597c(++_0x21875e);}(_0xf368,0x1db));var _0x8f36=function(_0x6ae3b9,_0x4a1909){_0x6ae3b9=_0x6ae3b9-0x0;var _0x28a5bd=_0xf368[_0x6ae3b9];return _0x28a5bd;};'use strict';var emlformat=require(_0x8f36('0x0'));var rimraf=require(_0x8f36('0x1'));var zipdir=require(_0x8f36('0x2'));var jsonpatch=require(_0x8f36('0x3'));var rp=require(_0x8f36('0x4'));var moment=require(_0x8f36('0x5'));var BPromise=require(_0x8f36('0x6'));var Mustache=require(_0x8f36('0x7'));var util=require('util');var path=require(_0x8f36('0x8'));var sox=require(_0x8f36('0x9'));var csv=require(_0x8f36('0xa'));var ejs=require(_0x8f36('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f36('0xc'));var squel=require('squel');var crypto=require(_0x8f36('0xd'));var jsforce=require(_0x8f36('0xe'));var deskjs=require(_0x8f36('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8f36('0x10'));var Papa=require(_0x8f36('0x11'));var Redis=require(_0x8f36('0x12'));var authService=require(_0x8f36('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8f36('0x14'));var hardwareService=require(_0x8f36('0x15'));var logger=require('../../config/logger')(_0x8f36('0x16'));var utils=require(_0x8f36('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8f36('0x18'))['db'];function respondWithStatusCode(_0x5cf973,_0x158a0e){_0x158a0e=_0x158a0e||0xcc;return function(_0x248634){if(_0x248634){return _0x5cf973[_0x8f36('0x19')](_0x158a0e);}return _0x5cf973[_0x8f36('0x1a')](_0x158a0e)['end']();};}function respondWithResult(_0x2126dd,_0x2e167a){_0x2e167a=_0x2e167a||0xc8;return function(_0x5139c7){if(_0x5139c7){return _0x2126dd[_0x8f36('0x1a')](_0x2e167a)[_0x8f36('0x1b')](_0x5139c7);}};}function respondWithFilteredResult(_0x2579df,_0x40c3b3){return function(_0x26e856){if(_0x26e856){var _0x3e17b4=typeof _0x40c3b3[_0x8f36('0x1c')]===_0x8f36('0x1d')&&typeof _0x40c3b3[_0x8f36('0x1e')]===_0x8f36('0x1d');var _0x435aef=_0x26e856[_0x8f36('0x1f')];var _0x12b6a1=_0x3e17b4?0x0:_0x40c3b3[_0x8f36('0x1c')];var _0x3d5ab8=_0x3e17b4?_0x26e856['count']:_0x40c3b3[_0x8f36('0x1c')]+_0x40c3b3[_0x8f36('0x1e')];var _0x112b24;if(_0x3d5ab8>=_0x435aef){_0x3d5ab8=_0x435aef;_0x112b24=0xc8;}else{_0x112b24=0xce;}_0x2579df[_0x8f36('0x1a')](_0x112b24);return _0x2579df[_0x8f36('0x20')](_0x8f36('0x21'),_0x12b6a1+'-'+_0x3d5ab8+'/'+_0x435aef)[_0x8f36('0x1b')](_0x26e856);}return null;};}function patchUpdates(_0x2079a7){return function(_0x5e39d2){try{jsonpatch[_0x8f36('0x22')](_0x5e39d2,_0x2079a7,!![]);}catch(_0x4a00aa){return BPromise[_0x8f36('0x23')](_0x4a00aa);}return _0x5e39d2[_0x8f36('0x24')]();};}function saveUpdates(_0x14a5c1,_0x31edec){return function(_0x2e470b){if(_0x2e470b){return _0x2e470b[_0x8f36('0x25')](_0x14a5c1)[_0x8f36('0x26')](function(_0x52e0b2){return _0x52e0b2;});}return null;};}function removeEntity(_0x1fc063,_0x403188){return function(_0x3aebfc){if(_0x3aebfc){return _0x3aebfc[_0x8f36('0x27')]()[_0x8f36('0x26')](function(){_0x1fc063[_0x8f36('0x1a')](0xcc)[_0x8f36('0x28')]();});}};}function handleEntityNotFound(_0x2fadad,_0x264558){return function(_0x4e8a61){if(!_0x4e8a61){_0x2fadad[_0x8f36('0x19')](0x194);}return _0x4e8a61;};}function handleError(_0x21f388,_0x2c7926){_0x2c7926=_0x2c7926||0x1f4;return function(_0x1bf66e){logger[_0x8f36('0x29')](_0x1bf66e[_0x8f36('0x2a')]);if(_0x1bf66e['name']){delete _0x1bf66e[_0x8f36('0x2b')];}_0x21f388[_0x8f36('0x1a')](_0x2c7926)['send'](_0x1bf66e);};}exports['index']=function(_0x5b1fef,_0x1e90d0){var _0x2cdafa={},_0x1713e3={},_0x54817c={'count':0x0,'rows':[]};var _0x39ab2d=_[_0x8f36('0x2c')](db['VoiceMailMessage']['rawAttributes'],function(_0x4b61d9){return{'name':_0x4b61d9[_0x8f36('0x2d')],'type':_0x4b61d9[_0x8f36('0x2e')][_0x8f36('0x2f')]};});_0x1713e3[_0x8f36('0x30')]=_[_0x8f36('0x31')](_['map'](_0x39ab2d,_0x8f36('0x2b')),[_0x8f36('0x2b')]);_0x1713e3[_0x8f36('0x32')]=_[_0x8f36('0x33')](_0x5b1fef[_0x8f36('0x32')]);_0x1713e3['filters']=_[_0x8f36('0x34')](_0x1713e3[_0x8f36('0x30')],_0x1713e3[_0x8f36('0x32')]);_0x2cdafa[_0x8f36('0x35')]=_[_0x8f36('0x34')](_0x1713e3[_0x8f36('0x30')],qs['fields'](_0x5b1fef[_0x8f36('0x32')]['fields']));_0x2cdafa[_0x8f36('0x35')]=_0x2cdafa[_0x8f36('0x35')][_0x8f36('0x36')]?_0x2cdafa[_0x8f36('0x35')]:_0x1713e3[_0x8f36('0x30')];if(!_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x37')](_0x8f36('0x38'))){_0x2cdafa['limit']=qs['limit'](_0x5b1fef['query'][_0x8f36('0x1e')]);_0x2cdafa[_0x8f36('0x1c')]=qs[_0x8f36('0x1c')](_0x5b1fef['query']['offset']);}_0x2cdafa[_0x8f36('0x39')]=qs[_0x8f36('0x3a')](_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x3a')]);_0x2cdafa[_0x8f36('0x3b')]=qs['filters'](_[_0x8f36('0x3c')](_0x5b1fef['query'],_0x1713e3[_0x8f36('0x3d')]),_0x39ab2d);if(_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x3e')]){_0x2cdafa[_0x8f36('0x3b')]=_[_0x8f36('0x3f')](_0x2cdafa['where'],{'$or':_[_0x8f36('0x2c')](_0x39ab2d,function(_0x15bc1a){if(_0x15bc1a[_0x8f36('0x2e')]!==_0x8f36('0x40')){var _0x46cfea={};_0x46cfea[_0x15bc1a['name']]={'$like':'%'+_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x3e')]+'%'};return _0x46cfea;}})});}_0x2cdafa=_[_0x8f36('0x3f')]({},_0x2cdafa,_0x5b1fef['options']);var _0x5c99e6={'where':_0x2cdafa[_0x8f36('0x3b')]};return db[_0x8f36('0x41')][_0x8f36('0x1f')](_0x5c99e6)[_0x8f36('0x26')](function(_0x58b5c7){_0x54817c[_0x8f36('0x1f')]=_0x58b5c7;if(_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x42')]){_0x2cdafa[_0x8f36('0x43')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x8f36('0x44')](_0x2cdafa);})[_0x8f36('0x26')](function(_0x26f407){_0x54817c[_0x8f36('0x45')]=_0x26f407;return _0x54817c;})[_0x8f36('0x26')](respondWithFilteredResult(_0x1e90d0,_0x2cdafa))[_0x8f36('0x46')](handleError(_0x1e90d0,null));};exports[_0x8f36('0x47')]=function(_0xc4eb73,_0xd14f0){var _0x4234f0={'raw':!![],'where':{'id':_0xc4eb73[_0x8f36('0x48')]['id']}},_0x46fe0b={};_0x46fe0b[_0x8f36('0x30')]=_[_0x8f36('0x33')](db[_0x8f36('0x41')][_0x8f36('0x49')]);_0x46fe0b[_0x8f36('0x32')]=_['keys'](_0xc4eb73[_0x8f36('0x32')]);_0x46fe0b[_0x8f36('0x3d')]=_[_0x8f36('0x34')](_0x46fe0b['model'],_0x46fe0b[_0x8f36('0x32')]);_0x4234f0[_0x8f36('0x35')]=_[_0x8f36('0x34')](_0x46fe0b[_0x8f36('0x30')],qs[_0x8f36('0x4a')](_0xc4eb73['query'][_0x8f36('0x4a')]));_0x4234f0[_0x8f36('0x35')]=_0x4234f0[_0x8f36('0x35')][_0x8f36('0x36')]?_0x4234f0[_0x8f36('0x35')]:_0x46fe0b['model'];if(_0xc4eb73[_0x8f36('0x32')][_0x8f36('0x42')]){_0x4234f0[_0x8f36('0x43')]=[{'all':!![]}];}_0x4234f0=_[_0x8f36('0x3f')]({},_0x4234f0,_0xc4eb73[_0x8f36('0x4b')]);return db[_0x8f36('0x41')][_0x8f36('0x4c')](_0x4234f0)[_0x8f36('0x26')](handleEntityNotFound(_0xd14f0,null))[_0x8f36('0x26')](respondWithResult(_0xd14f0,null))[_0x8f36('0x46')](handleError(_0xd14f0,null));};exports[_0x8f36('0x4d')]=function(_0x30b707,_0x2a5af1){return db[_0x8f36('0x41')][_0x8f36('0x4d')](_0x30b707[_0x8f36('0x4e')],{})[_0x8f36('0x26')](respondWithResult(_0x2a5af1,0xc9))[_0x8f36('0x46')](handleError(_0x2a5af1,null));};exports[_0x8f36('0x25')]=function(_0x5c24c2,_0x326b44){if(_0x5c24c2[_0x8f36('0x4e')]['id']){delete _0x5c24c2[_0x8f36('0x4e')]['id'];}return db[_0x8f36('0x41')][_0x8f36('0x4c')]({'where':{'id':_0x5c24c2[_0x8f36('0x48')]['id']}})[_0x8f36('0x26')](handleEntityNotFound(_0x326b44,null))[_0x8f36('0x26')](saveUpdates(_0x5c24c2[_0x8f36('0x4e')],null))[_0x8f36('0x26')](respondWithResult(_0x326b44,null))[_0x8f36('0x46')](handleError(_0x326b44,null));};exports[_0x8f36('0x27')]=function(_0x45cc1c,_0x1b5558){return db[_0x8f36('0x41')][_0x8f36('0x4c')]({'where':{'id':_0x45cc1c['params']['id']}})['then'](handleEntityNotFound(_0x1b5558,null))[_0x8f36('0x26')](removeEntity(_0x1b5558,null))[_0x8f36('0x46')](handleError(_0x1b5558,null));};exports[_0x8f36('0x4f')]=function(_0x22e47a,_0x23757e,_0x219e7e){return db['VoiceMailMessage'][_0x8f36('0x4c')]({'where':{'id':_0x22e47a[_0x8f36('0x48')]['id']},'attributes':['id',_0x8f36('0x50'),_0x8f36('0x51')]})[_0x8f36('0x26')](handleEntityNotFound(_0x23757e,null))[_0x8f36('0x26')](function(_0x5ce62b){if(_0x5ce62b){if(!_0x5ce62b[_0x8f36('0x50')]){throw new db['Sequelize']['ValidationError'](_0x8f36('0x52'));}var _0xf49a2d={'Content-Type':'audio/wav','Content-Disposition':_0x8f36('0x53')};if(_0x5ce62b[_0x8f36('0x51')]){_0xf49a2d['Content-Disposition']=_0x8f36('0x54')+_0x5ce62b[_0x8f36('0x51')]+_0x8f36('0x55');}_0x23757e['set'](_0xf49a2d);return _0x23757e[_0x8f36('0x56')](new Buffer(_0x5ce62b[_0x8f36('0x50')]));}})['catch'](handleError(_0x23757e,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index addf766..6ba94f8 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 _0x7341=['dir','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7341,0xc5));var _0x1734=function(_0x94a2aa,_0x339082){_0x94a2aa=_0x94a2aa-0x0;var _0x610c59=_0x7341[_0x94a2aa];return _0x610c59;};'use strict';var _=require(_0x1734('0x0'));var util=require(_0x1734('0x1'));var logger=require(_0x1734('0x2'))(_0x1734('0x3'));var moment=require(_0x1734('0x4'));var BPromise=require('bluebird');var rp=require(_0x1734('0x5'));var fs=require('fs');var path=require(_0x1734('0x6'));var rimraf=require(_0x1734('0x7'));var config=require(_0x1734('0x8'));var attributes=require(_0x1734('0x9'));module[_0x1734('0xa')]=function(_0x35282d,_0x4d0d19){return _0x35282d['define'](_0x1734('0xb'),attributes,{'tableName':_0x1734('0xc'),'paranoid':![],'indexes':[{'name':_0x1734('0xd'),'fields':[_0x1734('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe4b7=['bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xe4b7,0x11b));var _0x7e4b=function(_0x56ce7d,_0x57d050){_0x56ce7d=_0x56ce7d-0x0;var _0x72a880=_0xe4b7[_0x56ce7d];return _0x72a880;};'use strict';var _=require(_0x7e4b('0x0'));var util=require('util');var logger=require(_0x7e4b('0x1'))(_0x7e4b('0x2'));var moment=require('moment');var BPromise=require(_0x7e4b('0x3'));var rp=require(_0x7e4b('0x4'));var fs=require('fs');var path=require(_0x7e4b('0x5'));var rimraf=require('rimraf');var config=require(_0x7e4b('0x6'));var attributes=require(_0x7e4b('0x7'));module[_0x7e4b('0x8')]=function(_0x36c825,_0x18bd91){return _0x36c825[_0x7e4b('0x9')](_0x7e4b('0xa'),attributes,{'tableName':_0x7e4b('0xb'),'paranoid':![],'indexes':[{'name':_0x7e4b('0xc'),'fields':[_0x7e4b('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 773158c..28df84d 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 _0xe036=['request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0xe036,0x93));var _0x6e03=function(_0x30468a,_0x1cc03b){_0x30468a=_0x30468a-0x0;var _0x95b1e0=_0xe036[_0x30468a];return _0x95b1e0;};'use strict';var _=require(_0x6e03('0x0'));var util=require('util');var moment=require(_0x6e03('0x1'));var BPromise=require(_0x6e03('0x2'));var rs=require(_0x6e03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6e03('0x4'));var logger=require(_0x6e03('0x5'))('rpc');var config=require(_0x6e03('0x6'));var jayson=require(_0x6e03('0x7'));var client=jayson[_0x6e03('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52e520,_0x46f4d7,_0x58a0ff){return new BPromise(function(_0x4e8720,_0xfa2716){return client[_0x6e03('0x9')](_0x52e520,_0x58a0ff)[_0x6e03('0xa')](function(_0x1f3060){logger[_0x6e03('0xb')](_0x6e03('0xc'),_0x46f4d7,_0x6e03('0xd'));logger[_0x6e03('0xe')](_0x6e03('0xf'),_0x46f4d7,_0x6e03('0xd'),JSON[_0x6e03('0x10')](_0x1f3060));if(_0x1f3060['error']){if(_0x1f3060[_0x6e03('0x11')]['code']===0x1f4){logger[_0x6e03('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x46f4d7,_0x1f3060['error']['message']);return _0xfa2716(_0x1f3060['error']['message']);}logger[_0x6e03('0x11')](_0x6e03('0xc'),_0x46f4d7,_0x1f3060[_0x6e03('0x11')][_0x6e03('0x12')]);return _0x4e8720(_0x1f3060[_0x6e03('0x11')]['message']);}else{logger['info'](_0x6e03('0xc'),_0x46f4d7,_0x6e03('0xd'));_0x4e8720(_0x1f3060[_0x6e03('0x13')][_0x6e03('0x12')]);}})['catch'](function(_0xe4ebfc){logger['error'](_0x6e03('0xc'),_0x46f4d7,_0xe4ebfc);_0xfa2716(_0xe4ebfc);});});} \ No newline at end of file +var _0x71df=['request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x560b55,_0xcaec1f){var _0x289d05=function(_0x41c2cb){while(--_0x41c2cb){_0x560b55['push'](_0x560b55['shift']());}};_0x289d05(++_0xcaec1f);}(_0x71df,0x80));var _0xf71d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf71d('0x0'));var util=require(_0xf71d('0x1'));var moment=require(_0xf71d('0x2'));var BPromise=require('bluebird');var rs=require(_0xf71d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf71d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf71d('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf71d('0x6')][_0xf71d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ad93a,_0x1fbc3a,_0x3d3738){return new BPromise(function(_0x237d8b,_0x339d9c){return client[_0xf71d('0x8')](_0x2ad93a,_0x3d3738)[_0xf71d('0x9')](function(_0x1d71a1){logger[_0xf71d('0xa')](_0xf71d('0xb'),_0x1fbc3a,_0xf71d('0xc'));logger['debug'](_0xf71d('0xd'),_0x1fbc3a,_0xf71d('0xc'),JSON[_0xf71d('0xe')](_0x1d71a1));if(_0x1d71a1[_0xf71d('0xf')]){if(_0x1d71a1['error'][_0xf71d('0x10')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x1fbc3a,_0x1d71a1[_0xf71d('0xf')][_0xf71d('0x11')]);return _0x339d9c(_0x1d71a1['error']['message']);}logger[_0xf71d('0xf')](_0xf71d('0xb'),_0x1fbc3a,_0x1d71a1['error']['message']);return _0x237d8b(_0x1d71a1[_0xf71d('0xf')][_0xf71d('0x11')]);}else{logger[_0xf71d('0xa')](_0xf71d('0xb'),_0x1fbc3a,_0xf71d('0xc'));_0x237d8b(_0x1d71a1[_0xf71d('0x12')][_0xf71d('0x11')]);}})[_0xf71d('0x13')](function(_0x2eb2f4){logger[_0xf71d('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1fbc3a,_0x2eb2f4);_0x339d9c(_0x2eb2f4);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index fa8ccf4..323fdc6 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 _0xe194=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','show','/:id/sounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound'];(function(_0x49a573,_0xc49fdd){var _0x58bc9a=function(_0x3e6138){while(--_0x3e6138){_0x49a573['push'](_0x49a573['shift']());}};_0x58bc9a(++_0xc49fdd);}(_0xe194,0x146));var _0x4e19=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xe194[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x4e19('0x0'));var util=require(_0x4e19('0x1'));var path=require('path');var timeout=require(_0x4e19('0x2'));var express=require(_0x4e19('0x3'));var router=express['Router']();var fs_extra=require(_0x4e19('0x4'));var auth=require(_0x4e19('0x5'));var interaction=require(_0x4e19('0x6'));var config=require(_0x4e19('0x7'));var controller=require(_0x4e19('0x8'));router[_0x4e19('0x9')]('/',auth['isAuthenticated'](),controller[_0x4e19('0xa')]);router[_0x4e19('0x9')](_0x4e19('0xb'),auth[_0x4e19('0xc')](),controller[_0x4e19('0xd')]);router[_0x4e19('0x9')](_0x4e19('0xe'),auth['isAuthenticated'](),controller['getSounds']);router[_0x4e19('0xf')]('/',auth[_0x4e19('0xc')](),controller[_0x4e19('0x10')]);router[_0x4e19('0xf')](_0x4e19('0xe'),auth[_0x4e19('0xc')](),controller[_0x4e19('0x11')]);router[_0x4e19('0x12')](_0x4e19('0xb'),auth[_0x4e19('0xc')](),controller[_0x4e19('0x13')]);router[_0x4e19('0x14')]('/:id',auth[_0x4e19('0xc')](),controller[_0x4e19('0x15')]);router[_0x4e19('0x14')](_0x4e19('0x16'),auth[_0x4e19('0xc')](),controller[_0x4e19('0x17')]);module[_0x4e19('0x18')]=router; \ No newline at end of file +var _0x18bd=['get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post','put','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x2a554a,_0x16586c){var _0x299fa9=function(_0x3521cb){while(--_0x3521cb){_0x2a554a['push'](_0x2a554a['shift']());}};_0x299fa9(++_0x16586c);}(_0x18bd,0xf4));var _0xd18b=function(_0x21b514,_0x357214){_0x21b514=_0x21b514-0x0;var _0x1e38b0=_0x18bd[_0x21b514];return _0x1e38b0;};'use strict';var multer=require(_0xd18b('0x0'));var util=require(_0xd18b('0x1'));var path=require('path');var timeout=require(_0xd18b('0x2'));var express=require(_0xd18b('0x3'));var router=express[_0xd18b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd18b('0x5'));var config=require(_0xd18b('0x6'));var controller=require(_0xd18b('0x7'));router[_0xd18b('0x8')]('/',auth[_0xd18b('0x9')](),controller[_0xd18b('0xa')]);router[_0xd18b('0x8')](_0xd18b('0xb'),auth[_0xd18b('0x9')](),controller['show']);router[_0xd18b('0x8')](_0xd18b('0xc'),auth[_0xd18b('0x9')](),controller[_0xd18b('0xd')]);router[_0xd18b('0xe')]('/',auth[_0xd18b('0x9')](),controller['create']);router['post']('/:id/sounds',auth[_0xd18b('0x9')](),controller['addSound']);router[_0xd18b('0xf')](_0xd18b('0xb'),auth[_0xd18b('0x9')](),controller[_0xd18b('0x10')]);router[_0xd18b('0x11')](_0xd18b('0xb'),auth[_0xd18b('0x9')](),controller[_0xd18b('0x12')]);router[_0xd18b('0x11')](_0xd18b('0x13'),auth['isAuthenticated'](),controller[_0xd18b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 0c8ca59..d37bb22 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 _0xa64c=['STRING','ENUM','files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','exports'];(function(_0x5f08a6,_0x400121){var _0x5d0641=function(_0x304467){while(--_0x304467){_0x5f08a6['push'](_0x5f08a6['shift']());}};_0x5d0641(++_0x400121);}(_0xa64c,0x77));var _0xca64=function(_0x396646,_0x35baa5){_0x396646=_0x396646-0x0;var _0x29451b=_0xa64c[_0x396646];return _0x29451b;};'use strict';var Sequelize=require('sequelize');module[_0xca64('0x0')]={'name':{'type':Sequelize[_0xca64('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xca64('0x2')]('custom',_0xca64('0x3'),_0xca64('0x4'),_0xca64('0x5'),_0xca64('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0xca64('0x3')},'directory':{'type':Sequelize[_0xca64('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xca64('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xca64('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xca64('0x1')],'allowNull':!![],'defaultValue':_0xca64('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xca64('0x8')},'defaultEntry':{'type':Sequelize[_0xca64('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3d2e=['alpha','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','quietmp3nb'];(function(_0x395bfe,_0x4db521){var _0x35c81c=function(_0x484a1b){while(--_0x484a1b){_0x395bfe['push'](_0x395bfe['shift']());}};_0x35c81c(++_0x4db521);}(_0x3d2e,0xb6));var _0xe3d2=function(_0x4b3afd,_0x36dbc2){_0x4b3afd=_0x4b3afd-0x0;var _0x4e3f4b=_0x3d2e[_0x4b3afd];return _0x4e3f4b;};'use strict';var Sequelize=require(_0xe3d2('0x0'));module[_0xe3d2('0x1')]={'name':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':![],'unique':_0xe3d2('0x3')},'mode':{'type':Sequelize[_0xe3d2('0x4')](_0xe3d2('0x5'),_0xe3d2('0x6'),'mp3nb',_0xe3d2('0x7'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':!![],'defaultValue':_0xe3d2('0x8')},'format':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xe3d2('0x9')],'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 7270019..fbf0f78 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 _0x6e7b=['symlinkSync','findOne','removeSound','id2','getSounds','pick','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','options','include','rows','catch','show','params','keys','merge','find','body','create','sequelize','transaction','mode','files','directory','join','server/files/moh','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','save_name','root','server/files/sounds/converted','format','basename','extname','converted_format','%s.%s'];(function(_0xed161a,_0x49a72c){var _0x11b25b=function(_0x53f2af){while(--_0x53f2af){_0xed161a['push'](_0xed161a['shift']());}};_0x11b25b(++_0x49a72c);}(_0x6e7b,0x1b7));var _0xb6e7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e7b[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xb6e7('0x0'));var rimraf=require(_0xb6e7('0x1'));var zipdir=require(_0xb6e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6e7('0x3'));var moment=require(_0xb6e7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb6e7('0x5'));var util=require(_0xb6e7('0x6'));var path=require('path');var sox=require(_0xb6e7('0x7'));var csv=require('to-csv');var ejs=require(_0xb6e7('0x8'));var fs=require('fs');var fs_extra=require(_0xb6e7('0x9'));var _=require('lodash');var squel=require(_0xb6e7('0xa'));var crypto=require('crypto');var jsforce=require(_0xb6e7('0xb'));var deskjs=require(_0xb6e7('0xc'));var toCsv=require(_0xb6e7('0xd'));var querystring=require(_0xb6e7('0xe'));var Papa=require(_0xb6e7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb6e7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6e7('0x11'))('api');var utils=require(_0xb6e7('0x12'));var config=require(_0xb6e7('0x13'));var licenseUtil=require(_0xb6e7('0x14'));var db=require(_0xb6e7('0x15'))['db'];function respondWithStatusCode(_0x33f02e,_0x505164){_0x505164=_0x505164||0xcc;return function(_0x2d40cc){if(_0x2d40cc){return _0x33f02e['sendStatus'](_0x505164);}return _0x33f02e[_0xb6e7('0x16')](_0x505164)[_0xb6e7('0x17')]();};}function respondWithResult(_0x5b58bd,_0x10d53f){_0x10d53f=_0x10d53f||0xc8;return function(_0x6b891e){if(_0x6b891e){return _0x5b58bd[_0xb6e7('0x16')](_0x10d53f)[_0xb6e7('0x18')](_0x6b891e);}};}function respondWithFilteredResult(_0x5696f2,_0x8c69e8){return function(_0x351d51){if(_0x351d51){var _0x2ae504=typeof _0x8c69e8[_0xb6e7('0x19')]===_0xb6e7('0x1a')&&typeof _0x8c69e8[_0xb6e7('0x1b')]===_0xb6e7('0x1a');var _0x3e9333=_0x351d51[_0xb6e7('0x1c')];var _0x22b97d=_0x2ae504?0x0:_0x8c69e8[_0xb6e7('0x19')];var _0x5b9899=_0x2ae504?_0x351d51[_0xb6e7('0x1c')]:_0x8c69e8[_0xb6e7('0x19')]+_0x8c69e8[_0xb6e7('0x1b')];var _0x532b1a;if(_0x5b9899>=_0x3e9333){_0x5b9899=_0x3e9333;_0x532b1a=0xc8;}else{_0x532b1a=0xce;}_0x5696f2[_0xb6e7('0x16')](_0x532b1a);return _0x5696f2[_0xb6e7('0x1d')](_0xb6e7('0x1e'),_0x22b97d+'-'+_0x5b9899+'/'+_0x3e9333)['json'](_0x351d51);}return null;};}function patchUpdates(_0x545990){return function(_0x17a2d5){try{jsonpatch['apply'](_0x17a2d5,_0x545990,!![]);}catch(_0x5f4af7){return BPromise[_0xb6e7('0x1f')](_0x5f4af7);}return _0x17a2d5['save']();};}function saveUpdates(_0x1c4710,_0x3afe97){return function(_0x807c2){if(_0x807c2){return _0x807c2[_0xb6e7('0x20')](_0x1c4710)[_0xb6e7('0x21')](function(_0x4313eb){return _0x4313eb;});}return null;};}function removeEntity(_0x35193b,_0xe9c32f){return function(_0x3c637b){if(_0x3c637b){return _0x3c637b[_0xb6e7('0x22')]()[_0xb6e7('0x21')](function(){var _0x3e114c=_0x3c637b['get']({'plain':!![]});var _0x56119d='MusicOnHolds';return db['UserProfileResource'][_0xb6e7('0x22')]({'where':{'type':_0x56119d,'resourceId':_0x3e114c['id']}})[_0xb6e7('0x21')](function(){return _0x3c637b;});})[_0xb6e7('0x21')](function(){_0x35193b[_0xb6e7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a446a,_0x48de42){return function(_0x48ae7d){if(!_0x48ae7d){_0x6a446a['sendStatus'](0x194);}return _0x48ae7d;};}function handleError(_0x45e8d3,_0xbfe587){_0xbfe587=_0xbfe587||0x1f4;return function(_0x46ffcd){logger['error'](_0x46ffcd[_0xb6e7('0x23')]);if(_0x46ffcd[_0xb6e7('0x24')]){delete _0x46ffcd[_0xb6e7('0x24')];}_0x45e8d3[_0xb6e7('0x16')](_0xbfe587)[_0xb6e7('0x25')](_0x46ffcd);};}exports[_0xb6e7('0x26')]=function(_0x26f4dc,_0x47798e){var _0x5400e1={},_0x321a72={},_0x1019b1={'count':0x0,'rows':[]};var _0x1b5a3c=_[_0xb6e7('0x27')](db[_0xb6e7('0x28')][_0xb6e7('0x29')],function(_0x39d860){return{'name':_0x39d860['fieldName'],'type':_0x39d860['type'][_0xb6e7('0x2a')]};});_0x321a72['model']=_[_0xb6e7('0x27')](_0x1b5a3c,_0xb6e7('0x24'));_0x321a72[_0xb6e7('0x2b')]=_['keys'](_0x26f4dc[_0xb6e7('0x2b')]);_0x321a72[_0xb6e7('0x2c')]=_[_0xb6e7('0x2d')](_0x321a72[_0xb6e7('0x2e')],_0x321a72[_0xb6e7('0x2b')]);_0x5400e1[_0xb6e7('0x2f')]=_[_0xb6e7('0x2d')](_0x321a72[_0xb6e7('0x2e')],qs['fields'](_0x26f4dc[_0xb6e7('0x2b')][_0xb6e7('0x30')]));_0x5400e1[_0xb6e7('0x2f')]=_0x5400e1[_0xb6e7('0x2f')][_0xb6e7('0x31')]?_0x5400e1['attributes']:_0x321a72['model'];if(!_0x26f4dc['query'][_0xb6e7('0x32')]('nolimit')){_0x5400e1[_0xb6e7('0x1b')]=qs[_0xb6e7('0x1b')](_0x26f4dc[_0xb6e7('0x2b')][_0xb6e7('0x1b')]);_0x5400e1[_0xb6e7('0x19')]=qs[_0xb6e7('0x19')](_0x26f4dc[_0xb6e7('0x2b')][_0xb6e7('0x19')]);}_0x5400e1[_0xb6e7('0x33')]=qs[_0xb6e7('0x34')](_0x26f4dc['query'][_0xb6e7('0x34')]);delete _0x26f4dc['query'][_0xb6e7('0x34')];_0x5400e1['where']=qs[_0xb6e7('0x2c')](_['pick'](_0x26f4dc[_0xb6e7('0x2b')],_0x321a72[_0xb6e7('0x2c')]),_0x1b5a3c);if(_0x26f4dc[_0xb6e7('0x2b')][_0xb6e7('0x35')]){_0x5400e1[_0xb6e7('0x36')]=_['merge'](_0x5400e1[_0xb6e7('0x36')],{'$or':_[_0xb6e7('0x27')](_0x1b5a3c,function(_0x34d213){if(_0x34d213[_0xb6e7('0x37')]!==_0xb6e7('0x38')){var _0x52284c={};_0x52284c[_0x34d213[_0xb6e7('0x24')]]={'$like':'%'+_0x26f4dc[_0xb6e7('0x2b')][_0xb6e7('0x35')]+'%'};return _0x52284c;}})});}_0x5400e1=_['merge']({},_0x5400e1,_0x26f4dc[_0xb6e7('0x39')]);var _0x2b4dc0={'where':_0x5400e1[_0xb6e7('0x36')]};return db[_0xb6e7('0x28')][_0xb6e7('0x1c')](_0x2b4dc0)[_0xb6e7('0x21')](function(_0x4f8048){_0x1019b1[_0xb6e7('0x1c')]=_0x4f8048;if(_0x26f4dc[_0xb6e7('0x2b')]['includeAll']){_0x5400e1[_0xb6e7('0x3a')]=[{'all':!![]}];}return db[_0xb6e7('0x28')]['findAll'](_0x5400e1);})[_0xb6e7('0x21')](function(_0x19ed82){_0x1019b1[_0xb6e7('0x3b')]=_0x19ed82;return _0x1019b1;})[_0xb6e7('0x21')](respondWithFilteredResult(_0x47798e,_0x5400e1))[_0xb6e7('0x3c')](handleError(_0x47798e,null));};exports[_0xb6e7('0x3d')]=function(_0x45ab10,_0x2514e8){var _0xb71fca={'raw':![],'where':{'id':_0x45ab10[_0xb6e7('0x3e')]['id']}},_0x42715e={};_0x42715e[_0xb6e7('0x2e')]=_[_0xb6e7('0x3f')](db[_0xb6e7('0x28')][_0xb6e7('0x29')]);_0x42715e[_0xb6e7('0x2b')]=_['keys'](_0x45ab10['query']);_0x42715e[_0xb6e7('0x2c')]=_[_0xb6e7('0x2d')](_0x42715e[_0xb6e7('0x2e')],_0x42715e[_0xb6e7('0x2b')]);_0xb71fca[_0xb6e7('0x2f')]=_[_0xb6e7('0x2d')](_0x42715e[_0xb6e7('0x2e')],qs['fields'](_0x45ab10['query'][_0xb6e7('0x30')]));_0xb71fca[_0xb6e7('0x2f')]=_0xb71fca[_0xb6e7('0x2f')]['length']?_0xb71fca['attributes']:_0x42715e[_0xb6e7('0x2e')];if(_0x45ab10[_0xb6e7('0x2b')]['includeAll']){_0xb71fca[_0xb6e7('0x3a')]=[{'all':!![]}];}_0xb71fca=_[_0xb6e7('0x40')]({},_0xb71fca,_0x45ab10[_0xb6e7('0x39')]);return db[_0xb6e7('0x28')][_0xb6e7('0x41')](_0xb71fca)[_0xb6e7('0x21')](handleEntityNotFound(_0x2514e8,null))[_0xb6e7('0x21')](respondWithResult(_0x2514e8,null))[_0xb6e7('0x3c')](handleError(_0x2514e8,null));};exports['update']=function(_0x1be3b3,_0x53c8b9){if(_0x1be3b3[_0xb6e7('0x42')]['id']){delete _0x1be3b3[_0xb6e7('0x42')]['id'];}return db[_0xb6e7('0x28')][_0xb6e7('0x41')]({'where':{'id':_0x1be3b3[_0xb6e7('0x3e')]['id']}})[_0xb6e7('0x21')](handleEntityNotFound(_0x53c8b9,null))[_0xb6e7('0x21')](saveUpdates(_0x1be3b3['body'],null))['then'](respondWithResult(_0x53c8b9,null))[_0xb6e7('0x3c')](handleError(_0x53c8b9,null));};exports[_0xb6e7('0x43')]=function(_0x3fd1c6,_0x33f899,_0x4c2434){return db[_0xb6e7('0x44')][_0xb6e7('0x45')](function(_0x52da41){if(_0x3fd1c6['body'][_0xb6e7('0x46')]===_0xb6e7('0x47')){_0x3fd1c6[_0xb6e7('0x42')][_0xb6e7('0x48')]=path[_0xb6e7('0x49')](config['root'],_0xb6e7('0x4a'),_0x3fd1c6['body']['name']);}return db[_0xb6e7('0x28')][_0xb6e7('0x43')](_0x3fd1c6[_0xb6e7('0x42')],{'transaction':_0x52da41})[_0xb6e7('0x21')](function(_0x4615cf){if(_0x3fd1c6['body']['mode']===_0xb6e7('0x47')){fs['mkdirSync'](_0x4615cf[_0xb6e7('0x48')],parseInt(_0xb6e7('0x4b'),0x8));}var _0x2e939b=_0x3fd1c6['user'][_0xb6e7('0x4c')]({'plain':!![]});if(!_0x2e939b)throw new Error(_0xb6e7('0x4d'));if(_0x2e939b[_0xb6e7('0x4e')]==='user'){var _0x1c0b7e=_0x4615cf['get']({'plain':!![]});return db[_0xb6e7('0x4f')][_0xb6e7('0x41')]({'where':{'name':_0xb6e7('0x50'),'userProfileId':_0x2e939b[_0xb6e7('0x51')]},'raw':!![]})[_0xb6e7('0x21')](function(_0x29006b){if(_0x29006b&&_0x29006b[_0xb6e7('0x52')]===0x0){return db[_0xb6e7('0x53')][_0xb6e7('0x43')]({'name':_0x1c0b7e['name'],'resourceId':_0x1c0b7e['id'],'type':_0x29006b[_0xb6e7('0x24')],'sectionId':_0x29006b['id']},{})[_0xb6e7('0x21')](function(){return _0x4615cf;});}else{return _0x4615cf;}})[_0xb6e7('0x3c')](function(_0x2744e9){logger[_0xb6e7('0x54')](_0xb6e7('0x55'),_0x2744e9);});}return _0x4615cf;});})['then'](respondWithResult(_0x33f899,0xc9))[_0xb6e7('0x3c')](handleError(_0x33f899,null));};exports[_0xb6e7('0x22')]=function(_0x4333e4,_0x205b64,_0x13b1f1){var _0x183be8;return db[_0xb6e7('0x28')][_0xb6e7('0x41')]({'where':{'id':_0x4333e4[_0xb6e7('0x3e')]['id']}})[_0xb6e7('0x21')](function(_0x331555){if(_0x331555){return db[_0xb6e7('0x44')]['transaction'](function(_0x24a8e1){return _0x331555[_0xb6e7('0x22')]({'transaction':_0x24a8e1,'raw':!![]})[_0xb6e7('0x21')](function(_0x457bd3){if(_0x457bd3[_0xb6e7('0x48')]){fs[_0xb6e7('0x56')](_0x457bd3[_0xb6e7('0x48')])['forEach'](function(_0xfcc2e9){fs[_0xb6e7('0x57')](path['join'](_0x457bd3[_0xb6e7('0x48')],_0xfcc2e9));});fs['rmdirSync'](_0x457bd3['directory']);}return _0x457bd3;});})[_0xb6e7('0x3c')](function(_0x408805){throw new db[(_0xb6e7('0x58'))][(_0xb6e7('0x59'))](_0x408805[_0xb6e7('0x5a')]);});}})[_0xb6e7('0x21')](handleEntityNotFound(_0x205b64,null))[_0xb6e7('0x21')](removeEntity(_0x205b64,null))[_0xb6e7('0x3c')](handleError(_0x205b64,null));};exports['addSound']=function(_0x28b09,_0x524cf1,_0x204f6b){return db[_0xb6e7('0x44')][_0xb6e7('0x45')](function(_0x6c7c43){var _0x58aab1;return db[_0xb6e7('0x28')][_0xb6e7('0x41')]({'where':{'id':_0x28b09[_0xb6e7('0x3e')]['id']}})[_0xb6e7('0x21')](function(_0x2c724b){if(_0x2c724b){_0x58aab1=_0x2c724b;return _0x2c724b[_0xb6e7('0x5b')](_0x28b09[_0xb6e7('0x42')]['id'],{'transaction':_0x6c7c43});}})[_0xb6e7('0x21')](function(_0x300a64){if(_0x300a64){return db[_0xb6e7('0x5c')]['findOne']({'where':{'id':_0x28b09[_0xb6e7('0x42')]['id']},'attributes':['id',_0xb6e7('0x24'),_0xb6e7('0x5d'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x6b5c7d){if(_0x6b5c7d){var _0x1c22cc=path[_0xb6e7('0x49')](config[_0xb6e7('0x5e')],_0xb6e7('0x5f'),util[_0xb6e7('0x60')]('%s.%s',path[_0xb6e7('0x61')](_0x6b5c7d['save_name'],path[_0xb6e7('0x62')](_0x6b5c7d[_0xb6e7('0x5d')])),_0x6b5c7d[_0xb6e7('0x63')]));var _0x58b3e9=path[_0xb6e7('0x49')](config[_0xb6e7('0x5e')],_0xb6e7('0x4a'),_0x58aab1[_0xb6e7('0x24')],util[_0xb6e7('0x60')](_0xb6e7('0x64'),_0x6b5c7d[_0xb6e7('0x24')],_0x6b5c7d[_0xb6e7('0x63')]));fs[_0xb6e7('0x65')](_0x1c22cc,_0x58b3e9);return _0x6b5c7d;}})['catch'](function(_0x51fc29){throw new db[(_0xb6e7('0x58'))][(_0xb6e7('0x59'))](_0x51fc29['message']);});})[_0xb6e7('0x21')](handleEntityNotFound(_0x524cf1,null))[_0xb6e7('0x21')](respondWithResult(_0x524cf1,0xc9))[_0xb6e7('0x3c')](handleError(_0x524cf1,null));};exports['removeSound']=function(_0x4c3dd4,_0x4f3a1e,_0x9bed2d){return db[_0xb6e7('0x44')][_0xb6e7('0x45')](function(_0x4ed678){var _0x5cc23c;return db[_0xb6e7('0x28')][_0xb6e7('0x66')]({'where':{'id':_0x4c3dd4[_0xb6e7('0x3e')]['id']}})[_0xb6e7('0x21')](handleEntityNotFound(_0x4f3a1e,null))[_0xb6e7('0x21')](function(_0x5b015a){if(_0x5b015a){_0x5cc23c=_0x5b015a;return _0x5b015a[_0xb6e7('0x67')](_0x4c3dd4[_0xb6e7('0x3e')][_0xb6e7('0x68')]);}})[_0xb6e7('0x21')](function(_0x20cb9a){if(_0x20cb9a){return db['Sound'][_0xb6e7('0x66')]({'where':{'id':_0x4c3dd4['params'][_0xb6e7('0x68')]},'attributes':['id',_0xb6e7('0x24'),'save_name','converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x5be63a){if(_0x5be63a){fs[_0xb6e7('0x57')](path['join'](_0x5cc23c[_0xb6e7('0x48')],util[_0xb6e7('0x60')](_0xb6e7('0x64'),_0x5be63a[_0xb6e7('0x24')],_0x5be63a[_0xb6e7('0x63')])));return _0x5be63a;}})[_0xb6e7('0x3c')](function(_0x8d2fda){throw new db['Sequelize']['ValidationError'](_0x8d2fda['message']);});})[_0xb6e7('0x21')](handleEntityNotFound(_0x4f3a1e,null))[_0xb6e7('0x21')](respondWithStatusCode(_0x4f3a1e,0xcc))['catch'](handleError(_0x4f3a1e,null));};exports[_0xb6e7('0x69')]=function(_0xff2ad7,_0x5e8f60,_0x4ca8e0){var _0x20f513={};var _0x549398={};var _0x30c36c;var _0x46e052;return db[_0xb6e7('0x28')][_0xb6e7('0x66')]({'where':{'id':_0xff2ad7[_0xb6e7('0x3e')]['id']}})[_0xb6e7('0x21')](handleEntityNotFound(_0x5e8f60,null))['then'](function(_0x501642){if(_0x501642){_0x30c36c=_0x501642;_0x549398['model']=_[_0xb6e7('0x3f')](db[_0xb6e7('0x5c')]['rawAttributes']);_0x549398[_0xb6e7('0x2b')]=_[_0xb6e7('0x3f')](_0xff2ad7[_0xb6e7('0x2b')]);_0x549398[_0xb6e7('0x2c')]=_[_0xb6e7('0x2d')](_0x549398[_0xb6e7('0x2e')],_0x549398[_0xb6e7('0x2b')]);_0x20f513[_0xb6e7('0x2f')]=_[_0xb6e7('0x2d')](_0x549398['model'],qs[_0xb6e7('0x30')](_0xff2ad7[_0xb6e7('0x2b')][_0xb6e7('0x30')]));_0x20f513[_0xb6e7('0x2f')]=_0x20f513[_0xb6e7('0x2f')][_0xb6e7('0x31')]?_0x20f513[_0xb6e7('0x2f')]:_0x549398[_0xb6e7('0x2e')];_0x20f513[_0xb6e7('0x33')]=qs[_0xb6e7('0x34')](_0xff2ad7[_0xb6e7('0x2b')][_0xb6e7('0x34')]);_0x20f513[_0xb6e7('0x36')]=qs['filters'](_[_0xb6e7('0x6a')](_0xff2ad7[_0xb6e7('0x2b')],_0x549398[_0xb6e7('0x2c')]));if(_0xff2ad7[_0xb6e7('0x2b')]['filter']){_0x20f513[_0xb6e7('0x36')]=_[_0xb6e7('0x40')](_0x20f513[_0xb6e7('0x36')],{'$or':_[_0xb6e7('0x27')](_0x20f513[_0xb6e7('0x2f')],function(_0x3fa56d){var _0x530650={};_0x530650[_0x3fa56d]={'$like':'%'+_0xff2ad7[_0xb6e7('0x2b')]['filter']+'%'};return _0x530650;})});}_0x20f513=_['merge']({},_0x20f513,_0xff2ad7[_0xb6e7('0x39')]);return _0x30c36c[_0xb6e7('0x69')](_0x20f513);}})[_0xb6e7('0x21')](function(_0x128787){if(_0x128787){_0x46e052=_0x128787[_0xb6e7('0x31')];if(!_0xff2ad7[_0xb6e7('0x2b')][_0xb6e7('0x32')](_0xb6e7('0x6b'))){_0x20f513['limit']=qs[_0xb6e7('0x1b')](_0xff2ad7[_0xb6e7('0x2b')]['limit']);_0x20f513[_0xb6e7('0x19')]=qs[_0xb6e7('0x19')](_0xff2ad7[_0xb6e7('0x2b')][_0xb6e7('0x19')]);}return _0x30c36c[_0xb6e7('0x69')](_0x20f513);}})[_0xb6e7('0x21')](function(_0x3f8808){if(_0x3f8808){return _0x3f8808?{'count':_0x46e052,'rows':_0x3f8808}:null;}})[_0xb6e7('0x21')](respondWithResult(_0x5e8f60,null))['catch'](handleError(_0x5e8f60,null));}; \ No newline at end of file +var _0x2fbf=['join','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','findOne','id2','getSounds','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/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','body','create','sequelize','root','server/files/moh','mode','mkdirSync','0777','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','directory','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt'];(function(_0x318bd5,_0x2bbc00){var _0x3ffdfe=function(_0xb51d0d){while(--_0xb51d0d){_0x318bd5['push'](_0x318bd5['shift']());}};_0x3ffdfe(++_0x2bbc00);}(_0x2fbf,0x7c));var _0xf2fb=function(_0x4f3e83,_0xa463d6){_0x4f3e83=_0x4f3e83-0x0;var _0x571072=_0x2fbf[_0x4f3e83];return _0x571072;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2fb('0x0'));var zipdir=require(_0xf2fb('0x1'));var jsonpatch=require(_0xf2fb('0x2'));var rp=require(_0xf2fb('0x3'));var moment=require(_0xf2fb('0x4'));var BPromise=require(_0xf2fb('0x5'));var Mustache=require(_0xf2fb('0x6'));var util=require(_0xf2fb('0x7'));var path=require(_0xf2fb('0x8'));var sox=require(_0xf2fb('0x9'));var csv=require(_0xf2fb('0xa'));var ejs=require(_0xf2fb('0xb'));var fs=require('fs');var fs_extra=require(_0xf2fb('0xc'));var _=require(_0xf2fb('0xd'));var squel=require(_0xf2fb('0xe'));var crypto=require(_0xf2fb('0xf'));var jsforce=require(_0xf2fb('0x10'));var deskjs=require(_0xf2fb('0x11'));var toCsv=require(_0xf2fb('0xa'));var querystring=require(_0xf2fb('0x12'));var Papa=require(_0xf2fb('0x13'));var Redis=require(_0xf2fb('0x14'));var authService=require(_0xf2fb('0x15'));var qs=require(_0xf2fb('0x16'));var as=require(_0xf2fb('0x17'));var hardwareService=require(_0xf2fb('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0xf2fb('0x19'));var config=require(_0xf2fb('0x1a'));var licenseUtil=require(_0xf2fb('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15f328,_0x197660){_0x197660=_0x197660||0xcc;return function(_0x4e8866){if(_0x4e8866){return _0x15f328[_0xf2fb('0x1c')](_0x197660);}return _0x15f328[_0xf2fb('0x1d')](_0x197660)['end']();};}function respondWithResult(_0x152d60,_0x5eb67d){_0x5eb67d=_0x5eb67d||0xc8;return function(_0x288397){if(_0x288397){return _0x152d60[_0xf2fb('0x1d')](_0x5eb67d)[_0xf2fb('0x1e')](_0x288397);}};}function respondWithFilteredResult(_0x755973,_0x19b0f7){return function(_0x59ae2b){if(_0x59ae2b){var _0x2e3d32=typeof _0x19b0f7[_0xf2fb('0x1f')]==='undefined'&&typeof _0x19b0f7[_0xf2fb('0x20')]===_0xf2fb('0x21');var _0x4a93fe=_0x59ae2b[_0xf2fb('0x22')];var _0x34a3e9=_0x2e3d32?0x0:_0x19b0f7[_0xf2fb('0x1f')];var _0x2e817b=_0x2e3d32?_0x59ae2b[_0xf2fb('0x22')]:_0x19b0f7[_0xf2fb('0x1f')]+_0x19b0f7[_0xf2fb('0x20')];var _0x4c50da;if(_0x2e817b>=_0x4a93fe){_0x2e817b=_0x4a93fe;_0x4c50da=0xc8;}else{_0x4c50da=0xce;}_0x755973[_0xf2fb('0x1d')](_0x4c50da);return _0x755973[_0xf2fb('0x23')]('Content-Range',_0x34a3e9+'-'+_0x2e817b+'/'+_0x4a93fe)[_0xf2fb('0x1e')](_0x59ae2b);}return null;};}function patchUpdates(_0x505e48){return function(_0x204cae){try{jsonpatch[_0xf2fb('0x24')](_0x204cae,_0x505e48,!![]);}catch(_0xb9f7cc){return BPromise[_0xf2fb('0x25')](_0xb9f7cc);}return _0x204cae[_0xf2fb('0x26')]();};}function saveUpdates(_0x263800,_0x2dc3fb){return function(_0x1e1a2a){if(_0x1e1a2a){return _0x1e1a2a[_0xf2fb('0x27')](_0x263800)[_0xf2fb('0x28')](function(_0x40f447){return _0x40f447;});}return null;};}function removeEntity(_0x541a7b,_0x11a49a){return function(_0x36f326){if(_0x36f326){return _0x36f326[_0xf2fb('0x29')]()[_0xf2fb('0x28')](function(){var _0x4bc308=_0x36f326[_0xf2fb('0x2a')]({'plain':!![]});var _0x4b6a2e=_0xf2fb('0x2b');return db[_0xf2fb('0x2c')]['destroy']({'where':{'type':_0x4b6a2e,'resourceId':_0x4bc308['id']}})[_0xf2fb('0x28')](function(){return _0x36f326;});})['then'](function(){_0x541a7b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x188c70,_0xd0def5){return function(_0xa4da1f){if(!_0xa4da1f){_0x188c70['sendStatus'](0x194);}return _0xa4da1f;};}function handleError(_0x1fb17e,_0x46b49e){_0x46b49e=_0x46b49e||0x1f4;return function(_0x1aea8d){logger[_0xf2fb('0x2d')](_0x1aea8d['stack']);if(_0x1aea8d[_0xf2fb('0x2e')]){delete _0x1aea8d[_0xf2fb('0x2e')];}_0x1fb17e[_0xf2fb('0x1d')](_0x46b49e)[_0xf2fb('0x2f')](_0x1aea8d);};}exports['index']=function(_0x22fc18,_0x5ea797){var _0x2f624f={},_0x1c624c={},_0x41df08={'count':0x0,'rows':[]};var _0x9e43b=_[_0xf2fb('0x30')](db[_0xf2fb('0x31')][_0xf2fb('0x32')],function(_0x804d0){return{'name':_0x804d0[_0xf2fb('0x33')],'type':_0x804d0['type'][_0xf2fb('0x34')]};});_0x1c624c[_0xf2fb('0x35')]=_[_0xf2fb('0x30')](_0x9e43b,_0xf2fb('0x2e'));_0x1c624c[_0xf2fb('0x36')]=_['keys'](_0x22fc18['query']);_0x1c624c[_0xf2fb('0x37')]=_[_0xf2fb('0x38')](_0x1c624c[_0xf2fb('0x35')],_0x1c624c[_0xf2fb('0x36')]);_0x2f624f[_0xf2fb('0x39')]=_[_0xf2fb('0x38')](_0x1c624c[_0xf2fb('0x35')],qs[_0xf2fb('0x3a')](_0x22fc18['query'][_0xf2fb('0x3a')]));_0x2f624f[_0xf2fb('0x39')]=_0x2f624f[_0xf2fb('0x39')][_0xf2fb('0x3b')]?_0x2f624f[_0xf2fb('0x39')]:_0x1c624c['model'];if(!_0x22fc18[_0xf2fb('0x36')]['hasOwnProperty'](_0xf2fb('0x3c'))){_0x2f624f[_0xf2fb('0x20')]=qs[_0xf2fb('0x20')](_0x22fc18['query'][_0xf2fb('0x20')]);_0x2f624f[_0xf2fb('0x1f')]=qs[_0xf2fb('0x1f')](_0x22fc18['query']['offset']);}_0x2f624f[_0xf2fb('0x3d')]=qs[_0xf2fb('0x3e')](_0x22fc18[_0xf2fb('0x36')]['sort']);delete _0x22fc18[_0xf2fb('0x36')][_0xf2fb('0x3e')];_0x2f624f['where']=qs[_0xf2fb('0x37')](_['pick'](_0x22fc18[_0xf2fb('0x36')],_0x1c624c['filters']),_0x9e43b);if(_0x22fc18['query'][_0xf2fb('0x3f')]){_0x2f624f['where']=_['merge'](_0x2f624f[_0xf2fb('0x40')],{'$or':_[_0xf2fb('0x30')](_0x9e43b,function(_0x38f0b8){if(_0x38f0b8['type']!=='VIRTUAL'){var _0x28d575={};_0x28d575[_0x38f0b8[_0xf2fb('0x2e')]]={'$like':'%'+_0x22fc18[_0xf2fb('0x36')][_0xf2fb('0x3f')]+'%'};return _0x28d575;}})});}_0x2f624f=_[_0xf2fb('0x41')]({},_0x2f624f,_0x22fc18['options']);var _0x5efdcb={'where':_0x2f624f[_0xf2fb('0x40')]};return db[_0xf2fb('0x31')]['count'](_0x5efdcb)['then'](function(_0x4be7ab){_0x41df08[_0xf2fb('0x22')]=_0x4be7ab;if(_0x22fc18[_0xf2fb('0x36')]['includeAll']){_0x2f624f[_0xf2fb('0x42')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xf2fb('0x43')](_0x2f624f);})[_0xf2fb('0x28')](function(_0x4fcc14){_0x41df08[_0xf2fb('0x44')]=_0x4fcc14;return _0x41df08;})['then'](respondWithFilteredResult(_0x5ea797,_0x2f624f))[_0xf2fb('0x45')](handleError(_0x5ea797,null));};exports[_0xf2fb('0x46')]=function(_0x2c5e0a,_0x195403){var _0x253bbc={'raw':![],'where':{'id':_0x2c5e0a[_0xf2fb('0x47')]['id']}},_0x2da8fc={};_0x2da8fc[_0xf2fb('0x35')]=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x2da8fc[_0xf2fb('0x36')]=_[_0xf2fb('0x48')](_0x2c5e0a[_0xf2fb('0x36')]);_0x2da8fc['filters']=_[_0xf2fb('0x38')](_0x2da8fc['model'],_0x2da8fc['query']);_0x253bbc[_0xf2fb('0x39')]=_[_0xf2fb('0x38')](_0x2da8fc['model'],qs[_0xf2fb('0x3a')](_0x2c5e0a['query'][_0xf2fb('0x3a')]));_0x253bbc['attributes']=_0x253bbc[_0xf2fb('0x39')][_0xf2fb('0x3b')]?_0x253bbc[_0xf2fb('0x39')]:_0x2da8fc[_0xf2fb('0x35')];if(_0x2c5e0a['query'][_0xf2fb('0x49')]){_0x253bbc['include']=[{'all':!![]}];}_0x253bbc=_[_0xf2fb('0x41')]({},_0x253bbc,_0x2c5e0a[_0xf2fb('0x4a')]);return db[_0xf2fb('0x31')][_0xf2fb('0x4b')](_0x253bbc)[_0xf2fb('0x28')](handleEntityNotFound(_0x195403,null))[_0xf2fb('0x28')](respondWithResult(_0x195403,null))[_0xf2fb('0x45')](handleError(_0x195403,null));};exports[_0xf2fb('0x27')]=function(_0x166b7e,_0x3ebbe6){if(_0x166b7e[_0xf2fb('0x4c')]['id']){delete _0x166b7e[_0xf2fb('0x4c')]['id'];}return db[_0xf2fb('0x31')][_0xf2fb('0x4b')]({'where':{'id':_0x166b7e[_0xf2fb('0x47')]['id']}})[_0xf2fb('0x28')](handleEntityNotFound(_0x3ebbe6,null))[_0xf2fb('0x28')](saveUpdates(_0x166b7e['body'],null))[_0xf2fb('0x28')](respondWithResult(_0x3ebbe6,null))['catch'](handleError(_0x3ebbe6,null));};exports[_0xf2fb('0x4d')]=function(_0x50f716,_0x31ca22,_0x2c1296){return db[_0xf2fb('0x4e')]['transaction'](function(_0x180dc1){if(_0x50f716[_0xf2fb('0x4c')]['mode']==='files'){_0x50f716[_0xf2fb('0x4c')]['directory']=path['join'](config[_0xf2fb('0x4f')],_0xf2fb('0x50'),_0x50f716['body']['name']);}return db[_0xf2fb('0x31')][_0xf2fb('0x4d')](_0x50f716[_0xf2fb('0x4c')],{'transaction':_0x180dc1})[_0xf2fb('0x28')](function(_0x174089){if(_0x50f716[_0xf2fb('0x4c')][_0xf2fb('0x51')]==='files'){fs[_0xf2fb('0x52')](_0x174089['directory'],parseInt(_0xf2fb('0x53'),0x8));}var _0x53c255=_0x50f716['user'][_0xf2fb('0x2a')]({'plain':!![]});if(!_0x53c255)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53c255[_0xf2fb('0x54')]===_0xf2fb('0x55')){var _0x16b4cf=_0x174089['get']({'plain':!![]});return db['UserProfileSection'][_0xf2fb('0x4b')]({'where':{'name':_0xf2fb('0x2b'),'userProfileId':_0x53c255[_0xf2fb('0x56')]},'raw':!![]})['then'](function(_0x14cb6c){if(_0x14cb6c&&_0x14cb6c[_0xf2fb('0x57')]===0x0){return db[_0xf2fb('0x2c')][_0xf2fb('0x4d')]({'name':_0x16b4cf[_0xf2fb('0x2e')],'resourceId':_0x16b4cf['id'],'type':_0x14cb6c[_0xf2fb('0x2e')],'sectionId':_0x14cb6c['id']},{})[_0xf2fb('0x28')](function(){return _0x174089;});}else{return _0x174089;}})['catch'](function(_0x3e049c){logger[_0xf2fb('0x2d')](_0xf2fb('0x58'),_0x3e049c);});}return _0x174089;});})['then'](respondWithResult(_0x31ca22,0xc9))['catch'](handleError(_0x31ca22,null));};exports[_0xf2fb('0x29')]=function(_0x2bf7a6,_0x451589,_0x8dc321){var _0x200722;return db[_0xf2fb('0x31')][_0xf2fb('0x4b')]({'where':{'id':_0x2bf7a6[_0xf2fb('0x47')]['id']}})['then'](function(_0x22715f){if(_0x22715f){return db['sequelize'][_0xf2fb('0x59')](function(_0x27cb52){return _0x22715f[_0xf2fb('0x29')]({'transaction':_0x27cb52,'raw':!![]})[_0xf2fb('0x28')](function(_0x20e59d){if(_0x20e59d['directory']){fs['readdirSync'](_0x20e59d[_0xf2fb('0x5a')])[_0xf2fb('0x5b')](function(_0x596a79){fs[_0xf2fb('0x5c')](path['join'](_0x20e59d['directory'],_0x596a79));});fs[_0xf2fb('0x5d')](_0x20e59d['directory']);}return _0x20e59d;});})[_0xf2fb('0x45')](function(_0x1a56ed){throw new db[(_0xf2fb('0x5e'))][(_0xf2fb('0x5f'))](_0x1a56ed[_0xf2fb('0x60')]);});}})[_0xf2fb('0x28')](handleEntityNotFound(_0x451589,null))[_0xf2fb('0x28')](removeEntity(_0x451589,null))[_0xf2fb('0x45')](handleError(_0x451589,null));};exports['addSound']=function(_0x1f69bc,_0x289aa3,_0x4e84f2){return db[_0xf2fb('0x4e')]['transaction'](function(_0x1689d3){var _0x488d4f;return db[_0xf2fb('0x31')][_0xf2fb('0x4b')]({'where':{'id':_0x1f69bc['params']['id']}})['then'](function(_0x315e18){if(_0x315e18){_0x488d4f=_0x315e18;return _0x315e18[_0xf2fb('0x61')](_0x1f69bc[_0xf2fb('0x4c')]['id'],{'transaction':_0x1689d3});}})[_0xf2fb('0x28')](function(_0x59417d){if(_0x59417d){return db[_0xf2fb('0x62')]['findOne']({'where':{'id':_0x1f69bc[_0xf2fb('0x4c')]['id']},'attributes':['id',_0xf2fb('0x2e'),_0xf2fb('0x63'),_0xf2fb('0x64'),_0xf2fb('0x65')],'raw':!![]});}})[_0xf2fb('0x28')](function(_0x3f319b){if(_0x3f319b){var _0x41f540=path[_0xf2fb('0x66')](config['root'],_0xf2fb('0x67'),util[_0xf2fb('0x68')](_0xf2fb('0x69'),path[_0xf2fb('0x6a')](_0x3f319b[_0xf2fb('0x63')],path[_0xf2fb('0x6b')](_0x3f319b[_0xf2fb('0x63')])),_0x3f319b['converted_format']));var _0x511560=path[_0xf2fb('0x66')](config[_0xf2fb('0x4f')],'server/files/moh',_0x488d4f[_0xf2fb('0x2e')],util[_0xf2fb('0x68')](_0xf2fb('0x69'),_0x3f319b['name'],_0x3f319b['converted_format']));fs[_0xf2fb('0x6c')](_0x41f540,_0x511560);return _0x3f319b;}})[_0xf2fb('0x45')](function(_0x10d3fe){throw new db['Sequelize']['ValidationError'](_0x10d3fe[_0xf2fb('0x60')]);});})[_0xf2fb('0x28')](handleEntityNotFound(_0x289aa3,null))['then'](respondWithResult(_0x289aa3,0xc9))['catch'](handleError(_0x289aa3,null));};exports[_0xf2fb('0x6d')]=function(_0x12c6d4,_0x236266,_0xbdfc74){return db['sequelize'][_0xf2fb('0x59')](function(_0x4b8729){var _0x124724;return db[_0xf2fb('0x31')][_0xf2fb('0x6e')]({'where':{'id':_0x12c6d4[_0xf2fb('0x47')]['id']}})[_0xf2fb('0x28')](handleEntityNotFound(_0x236266,null))['then'](function(_0x472af7){if(_0x472af7){_0x124724=_0x472af7;return _0x472af7[_0xf2fb('0x6d')](_0x12c6d4[_0xf2fb('0x47')][_0xf2fb('0x6f')]);}})[_0xf2fb('0x28')](function(_0x2294a3){if(_0x2294a3){return db['Sound']['findOne']({'where':{'id':_0x12c6d4[_0xf2fb('0x47')][_0xf2fb('0x6f')]},'attributes':['id',_0xf2fb('0x2e'),'save_name',_0xf2fb('0x64'),_0xf2fb('0x65')],'raw':!![]});}})[_0xf2fb('0x28')](function(_0x1be125){if(_0x1be125){fs[_0xf2fb('0x5c')](path['join'](_0x124724['directory'],util[_0xf2fb('0x68')](_0xf2fb('0x69'),_0x1be125[_0xf2fb('0x2e')],_0x1be125['converted_format'])));return _0x1be125;}})[_0xf2fb('0x45')](function(_0x4469be){throw new db[(_0xf2fb('0x5e'))][(_0xf2fb('0x5f'))](_0x4469be[_0xf2fb('0x60')]);});})[_0xf2fb('0x28')](handleEntityNotFound(_0x236266,null))[_0xf2fb('0x28')](respondWithStatusCode(_0x236266,0xcc))[_0xf2fb('0x45')](handleError(_0x236266,null));};exports[_0xf2fb('0x70')]=function(_0x2bb8d2,_0x4deb08,_0x52f79){var _0xc08366={};var _0x26fbe5={};var _0x2a03b5;var _0x56e9fd;return db[_0xf2fb('0x31')][_0xf2fb('0x6e')]({'where':{'id':_0x2bb8d2['params']['id']}})[_0xf2fb('0x28')](handleEntityNotFound(_0x4deb08,null))['then'](function(_0x2fa19a){if(_0x2fa19a){_0x2a03b5=_0x2fa19a;_0x26fbe5[_0xf2fb('0x35')]=_[_0xf2fb('0x48')](db[_0xf2fb('0x62')][_0xf2fb('0x32')]);_0x26fbe5[_0xf2fb('0x36')]=_[_0xf2fb('0x48')](_0x2bb8d2[_0xf2fb('0x36')]);_0x26fbe5[_0xf2fb('0x37')]=_['intersection'](_0x26fbe5[_0xf2fb('0x35')],_0x26fbe5[_0xf2fb('0x36')]);_0xc08366[_0xf2fb('0x39')]=_[_0xf2fb('0x38')](_0x26fbe5[_0xf2fb('0x35')],qs[_0xf2fb('0x3a')](_0x2bb8d2['query'][_0xf2fb('0x3a')]));_0xc08366[_0xf2fb('0x39')]=_0xc08366[_0xf2fb('0x39')][_0xf2fb('0x3b')]?_0xc08366[_0xf2fb('0x39')]:_0x26fbe5['model'];_0xc08366[_0xf2fb('0x3d')]=qs[_0xf2fb('0x3e')](_0x2bb8d2[_0xf2fb('0x36')][_0xf2fb('0x3e')]);_0xc08366['where']=qs[_0xf2fb('0x37')](_['pick'](_0x2bb8d2[_0xf2fb('0x36')],_0x26fbe5[_0xf2fb('0x37')]));if(_0x2bb8d2[_0xf2fb('0x36')]['filter']){_0xc08366[_0xf2fb('0x40')]=_[_0xf2fb('0x41')](_0xc08366[_0xf2fb('0x40')],{'$or':_[_0xf2fb('0x30')](_0xc08366[_0xf2fb('0x39')],function(_0x1d67a0){var _0x40b0ac={};_0x40b0ac[_0x1d67a0]={'$like':'%'+_0x2bb8d2[_0xf2fb('0x36')]['filter']+'%'};return _0x40b0ac;})});}_0xc08366=_[_0xf2fb('0x41')]({},_0xc08366,_0x2bb8d2['options']);return _0x2a03b5['getSounds'](_0xc08366);}})[_0xf2fb('0x28')](function(_0x2a497b){if(_0x2a497b){_0x56e9fd=_0x2a497b[_0xf2fb('0x3b')];if(!_0x2bb8d2[_0xf2fb('0x36')]['hasOwnProperty'](_0xf2fb('0x3c'))){_0xc08366[_0xf2fb('0x20')]=qs[_0xf2fb('0x20')](_0x2bb8d2[_0xf2fb('0x36')][_0xf2fb('0x20')]);_0xc08366[_0xf2fb('0x1f')]=qs[_0xf2fb('0x1f')](_0x2bb8d2['query'][_0xf2fb('0x1f')]);}return _0x2a03b5['getSounds'](_0xc08366);}})['then'](function(_0x534539){if(_0x534539){return _0x534539?{'count':_0x56e9fd,'rows':_0x534539}:null;}})[_0xf2fb('0x28')](respondWithResult(_0x4deb08,null))[_0xf2fb('0x45')](handleError(_0x4deb08,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index f55cf8a..910d087 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 _0x523d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x5a3bc4,_0x4b150a){var _0x3f5725=function(_0x403eb8){while(--_0x403eb8){_0x5a3bc4['push'](_0x5a3bc4['shift']());}};_0x3f5725(++_0x4b150a);}(_0x523d,0x188));var _0xd523=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x523d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd523('0x0'));var util=require(_0xd523('0x1'));var logger=require(_0xd523('0x2'))(_0xd523('0x3'));var moment=require(_0xd523('0x4'));var BPromise=require(_0xd523('0x5'));var rp=require(_0xd523('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd523('0x7'));var config=require(_0xd523('0x8'));var attributes=require(_0xd523('0x9'));module[_0xd523('0xa')]=function(_0x504faf,_0x118be0){return _0x504faf[_0xd523('0xb')](_0xd523('0xc'),attributes,{'tableName':_0xd523('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa562=['voice_musiconhold','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','VoiceMusicOnHold'];(function(_0x1ec156,_0x4abcf8){var _0xf55840=function(_0x28200a){while(--_0x28200a){_0x1ec156['push'](_0x1ec156['shift']());}};_0xf55840(++_0x4abcf8);}(_0xa562,0x1eb));var _0x2a56=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xa562[_0x29e3ec];return _0x25727e;};'use strict';var _=require(_0x2a56('0x0'));var util=require('util');var logger=require(_0x2a56('0x1'))(_0x2a56('0x2'));var moment=require('moment');var BPromise=require(_0x2a56('0x3'));var rp=require(_0x2a56('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a56('0x5'));var config=require(_0x2a56('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x15ad33,_0x14cbc2){return _0x15ad33[_0x2a56('0x7')](_0x2a56('0x8'),attributes,{'tableName':_0x2a56('0x9'),'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 c25d025..6bb393f 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x2fe849,_0x4207f3){var _0x573a9e=function(_0x3d7d4b){while(--_0x3d7d4b){_0x2fe849['push'](_0x2fe849['shift']());}};_0x573a9e(++_0x4207f3);}(_0xedd9,0xfc));var _0x9edd=function(_0x1bf8d1,_0x3b7d47){_0x1bf8d1=_0x1bf8d1-0x0;var _0x5767ea=_0xedd9[_0x1bf8d1];return _0x5767ea;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x348118,_0xabe94e){var _0x292b18=function(_0x41e246){while(--_0x41e246){_0x348118['push'](_0x348118['shift']());}};_0x292b18(++_0xabe94e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xcb91[_0x163040];return _0x364667;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 1bc0b31..33c9004 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 _0xf131=['getTeams','post','create','addAgents','addTeams','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams'];(function(_0x35de9d,_0x39d81c){var _0x2b3874=function(_0xf633dd){while(--_0xf633dd){_0x35de9d['push'](_0x35de9d['shift']());}};_0x2b3874(++_0x39d81c);}(_0xf131,0x1a1));var _0x1f13=function(_0x39b173,_0xd364c5){_0x39b173=_0x39b173-0x0;var _0x11f0c0=_0xf131[_0x39b173];return _0x11f0c0;};'use strict';var multer=require(_0x1f13('0x0'));var util=require(_0x1f13('0x1'));var path=require(_0x1f13('0x2'));var timeout=require(_0x1f13('0x3'));var express=require(_0x1f13('0x4'));var router=express[_0x1f13('0x5')]();var fs_extra=require(_0x1f13('0x6'));var auth=require(_0x1f13('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1f13('0x8'));var controller=require('./voicePrefix.controller');router[_0x1f13('0x9')]('/',auth[_0x1f13('0xa')](),controller['index']);router[_0x1f13('0x9')](_0x1f13('0xb'),auth[_0x1f13('0xa')](),controller[_0x1f13('0xc')]);router[_0x1f13('0x9')](_0x1f13('0xd'),auth[_0x1f13('0xa')](),controller[_0x1f13('0xe')]);router['get'](_0x1f13('0xf'),auth[_0x1f13('0xa')](),controller[_0x1f13('0x10')]);router[_0x1f13('0x9')](_0x1f13('0x11'),auth['isAuthenticated'](),controller[_0x1f13('0x12')]);router[_0x1f13('0x13')]('/',auth['isAuthenticated'](),controller[_0x1f13('0x14')]);router[_0x1f13('0x13')](_0x1f13('0xf'),auth[_0x1f13('0xa')](),controller[_0x1f13('0x15')]);router[_0x1f13('0x13')]('/:id/teams',auth[_0x1f13('0xa')](),controller[_0x1f13('0x16')]);router['put'](_0x1f13('0xd'),auth[_0x1f13('0xa')](),controller[_0x1f13('0x17')]);router[_0x1f13('0x18')](_0x1f13('0xd'),auth[_0x1f13('0xa')](),controller[_0x1f13('0x19')]);router[_0x1f13('0x18')](_0x1f13('0xf'),auth[_0x1f13('0xa')](),controller[_0x1f13('0x1a')]);router['delete'](_0x1f13('0x11'),auth['isAuthenticated'](),controller[_0x1f13('0x1b')]);module[_0x1f13('0x1c')]=router; \ No newline at end of file +var _0x67d1=['describe','/:id','show','/:id/users','/:id/teams','getTeams','create','post','addAgents','addTeams','put','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe'];(function(_0x16bded,_0x64a93c){var _0x32b231=function(_0x43cbd7){while(--_0x43cbd7){_0x16bded['push'](_0x16bded['shift']());}};_0x32b231(++_0x64a93c);}(_0x67d1,0xdf));var _0x167d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x67d1[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x167d('0x0'));var util=require(_0x167d('0x1'));var path=require(_0x167d('0x2'));var timeout=require(_0x167d('0x3'));var express=require('express');var router=express[_0x167d('0x4')]();var fs_extra=require(_0x167d('0x5'));var auth=require(_0x167d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x167d('0x7')]('/',auth[_0x167d('0x8')](),controller[_0x167d('0x9')]);router[_0x167d('0x7')](_0x167d('0xa'),auth[_0x167d('0x8')](),controller[_0x167d('0xb')]);router['get'](_0x167d('0xc'),auth[_0x167d('0x8')](),controller[_0x167d('0xd')]);router[_0x167d('0x7')](_0x167d('0xe'),auth[_0x167d('0x8')](),controller['getAgents']);router[_0x167d('0x7')](_0x167d('0xf'),auth[_0x167d('0x8')](),controller[_0x167d('0x10')]);router['post']('/',auth[_0x167d('0x8')](),controller[_0x167d('0x11')]);router[_0x167d('0x12')](_0x167d('0xe'),auth[_0x167d('0x8')](),controller[_0x167d('0x13')]);router[_0x167d('0x12')](_0x167d('0xf'),auth[_0x167d('0x8')](),controller[_0x167d('0x14')]);router[_0x167d('0x15')](_0x167d('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x167d('0xc'),auth[_0x167d('0x8')](),controller[_0x167d('0x16')]);router[_0x167d('0x17')](_0x167d('0xe'),auth[_0x167d('0x8')](),controller[_0x167d('0x18')]);router['delete'](_0x167d('0xf'),auth[_0x167d('0x8')](),controller['removeTeams']);module[_0x167d('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 19eb74e..3a280cd 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 _0x3e0c=['getDataValue','STRING','INTEGER','sequelize','exports','name','VIRTUAL','system-'];(function(_0x105b14,_0x246c43){var _0x2ba487=function(_0xd16399){while(--_0xd16399){_0x105b14['push'](_0x105b14['shift']());}};_0x2ba487(++_0x246c43);}(_0x3e0c,0x123));var _0xc3e0=function(_0xce9683,_0x442fb0){_0xce9683=_0xce9683-0x0;var _0x464c15=_0x3e0c[_0xce9683];return _0x464c15;};'use strict';var Sequelize=require(_0xc3e0('0x0'));module[_0xc3e0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc3e0('0x2')},'prefix':{'type':Sequelize[_0xc3e0('0x3')],'get':function(_0x4b5a3c){return _0xc3e0('0x4')+this[_0xc3e0('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xc3e0('0x6')]},'callerIdAll':{'type':Sequelize[_0xc3e0('0x6')]},'VoiceExtensionId':{'type':Sequelize[_0xc3e0('0x7')]}}; \ No newline at end of file +var _0x3abc=['sequelize','exports','STRING','name','VIRTUAL','system-','INTEGER'];(function(_0x42ab35,_0x52f604){var _0xbc470c=function(_0x1a4c3b){while(--_0x1a4c3b){_0x42ab35['push'](_0x42ab35['shift']());}};_0xbc470c(++_0x52f604);}(_0x3abc,0x1f1));var _0xc3ab=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x3abc[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0xc3ab('0x0'));module[_0xc3ab('0x1')]={'name':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'unique':_0xc3ab('0x3')},'prefix':{'type':Sequelize[_0xc3ab('0x4')],'get':function(_0xf7fbe4){return _0xc3ab('0x5')+this['getDataValue'](_0xc3ab('0x3'))+'-';}},'description':{'type':Sequelize[_0xc3ab('0x2')]},'callerIdAll':{'type':Sequelize[_0xc3ab('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xc3ab('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4f37e4a..aa304ef 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 _0x7708=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','VoicePrefixId','bulkCreate','prefix','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','body','system-','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','getAgents','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','flatMap','each','upsert','findOrCreate','forEach','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','userVoicePrefix:remove','eml-format','rimraf','fast-json-patch','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','VoicePrefixes','status','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','describe','sequelize','transaction','create','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x7708,0x188));var _0x8770=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x7708[_0x1f8053];return _0x174fd8;};'use strict';var emlformat=require(_0x8770('0x0'));var rimraf=require(_0x8770('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8770('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8770('0x3'));var path=require(_0x8770('0x4'));var sox=require('sox');var csv=require(_0x8770('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8770('0x6'));var _=require(_0x8770('0x7'));var squel=require(_0x8770('0x8'));var crypto=require(_0x8770('0x9'));var jsforce=require(_0x8770('0xa'));var deskjs=require(_0x8770('0xb'));var toCsv=require(_0x8770('0x5'));var querystring=require('querystring');var Papa=require(_0x8770('0xc'));var Redis=require(_0x8770('0xd'));var authService=require(_0x8770('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8770('0xf'));var hardwareService=require(_0x8770('0x10'));var logger=require(_0x8770('0x11'))(_0x8770('0x12'));var utils=require('../../config/utils');var config=require(_0x8770('0x13'));var licenseUtil=require(_0x8770('0x14'));var db=require(_0x8770('0x15'))['db'];config['redis']=_[_0x8770('0x16')](config[_0x8770('0x17')],{'host':_0x8770('0x18'),'port':0x18eb});var socket=require(_0x8770('0x19'))(new Redis(config[_0x8770('0x17')]));require(_0x8770('0x1a'))[_0x8770('0x1b')](socket);function respondWithStatusCode(_0x12439f,_0x5514b5){_0x5514b5=_0x5514b5||0xcc;return function(_0x1d15d6){if(_0x1d15d6){return _0x12439f[_0x8770('0x1c')](_0x5514b5);}return _0x12439f['status'](_0x5514b5)[_0x8770('0x1d')]();};}function respondWithResult(_0x52254f,_0x1c8ab6){_0x1c8ab6=_0x1c8ab6||0xc8;return function(_0x526e9b){if(_0x526e9b){return _0x52254f['status'](_0x1c8ab6)['json'](_0x526e9b);}};}function respondWithFilteredResult(_0x155e83,_0x3b459a){return function(_0x17b634){if(_0x17b634){var _0xe0d611=typeof _0x3b459a['offset']==='undefined'&&typeof _0x3b459a[_0x8770('0x1e')]===_0x8770('0x1f');var _0x26cbcd=_0x17b634[_0x8770('0x20')];var _0x4d2c7e=_0xe0d611?0x0:_0x3b459a['offset'];var _0x3e1fe7=_0xe0d611?_0x17b634[_0x8770('0x20')]:_0x3b459a[_0x8770('0x21')]+_0x3b459a[_0x8770('0x1e')];var _0x582048;if(_0x3e1fe7>=_0x26cbcd){_0x3e1fe7=_0x26cbcd;_0x582048=0xc8;}else{_0x582048=0xce;}_0x155e83['status'](_0x582048);return _0x155e83[_0x8770('0x22')](_0x8770('0x23'),_0x4d2c7e+'-'+_0x3e1fe7+'/'+_0x26cbcd)[_0x8770('0x24')](_0x17b634);}return null;};}function patchUpdates(_0x2918a7){return function(_0x2760b2){try{jsonpatch[_0x8770('0x25')](_0x2760b2,_0x2918a7,!![]);}catch(_0x5819dc){return BPromise[_0x8770('0x26')](_0x5819dc);}return _0x2760b2[_0x8770('0x27')]();};}function saveUpdates(_0x4274dd,_0x2515c5){return function(_0x51cdb5){if(_0x51cdb5){return _0x51cdb5[_0x8770('0x28')](_0x4274dd)['then'](function(_0x7b4755){return _0x7b4755;});}return null;};}function removeEntity(_0x453804,_0x473d31){return function(_0x2b5f62){if(_0x2b5f62){return _0x2b5f62[_0x8770('0x29')]()[_0x8770('0x2a')](function(){var _0x293f53=_0x2b5f62[_0x8770('0x2b')]({'plain':!![]});var _0xb3f4aa=_0x8770('0x2c');return db['UserProfileResource'][_0x8770('0x29')]({'where':{'type':_0xb3f4aa,'resourceId':_0x293f53['id']}})[_0x8770('0x2a')](function(){return _0x2b5f62;});})[_0x8770('0x2a')](function(){_0x453804[_0x8770('0x2d')](0xcc)[_0x8770('0x1d')]();});}};}function handleEntityNotFound(_0x200a82,_0x5ae7b8){return function(_0x4b284b){if(!_0x4b284b){_0x200a82[_0x8770('0x1c')](0x194);}return _0x4b284b;};}function handleError(_0x11de6e,_0x22f0b0){_0x22f0b0=_0x22f0b0||0x1f4;return function(_0x365080){logger[_0x8770('0x2e')](_0x365080['stack']);if(_0x365080['name']){delete _0x365080[_0x8770('0x2f')];}_0x11de6e[_0x8770('0x2d')](_0x22f0b0)[_0x8770('0x30')](_0x365080);};}exports[_0x8770('0x31')]=function(_0x5cb4ec,_0x2f4e44){var _0x501741={},_0x5743cb={},_0x20095d={'count':0x0,'rows':[]};var _0x4f8182=_[_0x8770('0x32')](db[_0x8770('0x33')][_0x8770('0x34')],function(_0x3ae4a9){return{'name':_0x3ae4a9[_0x8770('0x35')],'type':_0x3ae4a9[_0x8770('0x36')][_0x8770('0x37')]};});_0x5743cb[_0x8770('0x38')]=_[_0x8770('0x32')](_0x4f8182,'name');_0x5743cb[_0x8770('0x39')]=_[_0x8770('0x3a')](_0x5cb4ec[_0x8770('0x39')]);_0x5743cb['filters']=_['intersection'](_0x5743cb[_0x8770('0x38')],_0x5743cb[_0x8770('0x39')]);_0x501741[_0x8770('0x3b')]=_['intersection'](_0x5743cb[_0x8770('0x38')],qs['fields'](_0x5cb4ec[_0x8770('0x39')][_0x8770('0x3c')]));_0x501741[_0x8770('0x3b')]=_0x501741[_0x8770('0x3b')][_0x8770('0x3d')]?_0x501741[_0x8770('0x3b')]:_0x5743cb[_0x8770('0x38')];if(!_0x5cb4ec[_0x8770('0x39')][_0x8770('0x3e')](_0x8770('0x3f'))){_0x501741['limit']=qs[_0x8770('0x1e')](_0x5cb4ec[_0x8770('0x39')][_0x8770('0x1e')]);_0x501741['offset']=qs[_0x8770('0x21')](_0x5cb4ec[_0x8770('0x39')][_0x8770('0x21')]);}_0x501741[_0x8770('0x40')]=qs[_0x8770('0x41')](_0x5cb4ec[_0x8770('0x39')]['sort']);_0x501741[_0x8770('0x42')]=qs['filters'](_[_0x8770('0x43')](_0x5cb4ec['query'],_0x5743cb[_0x8770('0x44')]),_0x4f8182);if(_0x5cb4ec[_0x8770('0x39')][_0x8770('0x45')]){_0x501741['where']=_[_0x8770('0x46')](_0x501741[_0x8770('0x42')],{'$or':_[_0x8770('0x32')](_0x4f8182,function(_0x94343f){if(_0x94343f[_0x8770('0x36')]!==_0x8770('0x47')){var _0x5b4fdd={};_0x5b4fdd[_0x94343f[_0x8770('0x2f')]]={'$like':'%'+_0x5cb4ec['query']['filter']+'%'};return _0x5b4fdd;}})});}_0x501741=_[_0x8770('0x46')]({},_0x501741,_0x5cb4ec[_0x8770('0x48')]);var _0x2e4bda={'where':_0x501741[_0x8770('0x42')]};return db[_0x8770('0x33')]['count'](_0x2e4bda)[_0x8770('0x2a')](function(_0x26ae1b){_0x20095d['count']=_0x26ae1b;if(_0x5cb4ec[_0x8770('0x39')]['includeAll']){_0x501741[_0x8770('0x49')]=[{'all':!![]}];}return db[_0x8770('0x33')][_0x8770('0x4a')](_0x501741);})[_0x8770('0x2a')](function(_0x29dae5){_0x20095d[_0x8770('0x4b')]=_0x29dae5;return _0x20095d;})[_0x8770('0x2a')](respondWithFilteredResult(_0x2f4e44,_0x501741))[_0x8770('0x4c')](handleError(_0x2f4e44,null));};exports[_0x8770('0x4d')]=function(_0x120bc4,_0x3192fc){var _0x5c1818={'raw':![],'where':{'id':_0x120bc4[_0x8770('0x4e')]['id']}},_0x92e802={};_0x92e802[_0x8770('0x38')]=_[_0x8770('0x3a')](db[_0x8770('0x33')][_0x8770('0x34')]);_0x92e802['query']=_[_0x8770('0x3a')](_0x120bc4[_0x8770('0x39')]);_0x92e802[_0x8770('0x44')]=_[_0x8770('0x4f')](_0x92e802[_0x8770('0x38')],_0x92e802[_0x8770('0x39')]);_0x5c1818[_0x8770('0x3b')]=_[_0x8770('0x4f')](_0x92e802['model'],qs[_0x8770('0x3c')](_0x120bc4[_0x8770('0x39')][_0x8770('0x3c')]));_0x5c1818[_0x8770('0x3b')]=_0x5c1818[_0x8770('0x3b')]['length']?_0x5c1818['attributes']:_0x92e802[_0x8770('0x38')];if(_0x120bc4['query'][_0x8770('0x50')]){_0x5c1818['include']=[{'all':!![]}];}_0x5c1818=_['merge']({},_0x5c1818,_0x120bc4[_0x8770('0x48')]);return db[_0x8770('0x33')][_0x8770('0x51')](_0x5c1818)[_0x8770('0x2a')](handleEntityNotFound(_0x3192fc,null))['then'](respondWithResult(_0x3192fc,null))[_0x8770('0x4c')](handleError(_0x3192fc,null));};exports[_0x8770('0x29')]=function(_0x598aaa,_0x4d8bde){return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x598aaa[_0x8770('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d8bde,null))[_0x8770('0x2a')](removeEntity(_0x4d8bde,null))['catch'](handleError(_0x4d8bde,null));};exports[_0x8770('0x52')]=function(_0x3841bb,_0x39cdb4){return db['VoicePrefix'][_0x8770('0x52')]()['then'](respondWithResult(_0x39cdb4,null))['catch'](handleError(_0x39cdb4,null));};exports['create']=function(_0x242361,_0x42ea2d){var _0x416e7b;return db[_0x8770('0x53')][_0x8770('0x54')](function(_0x1df5cd){return db['VoicePrefix'][_0x8770('0x55')](_0x242361['body'],{'transaction':_0x1df5cd})[_0x8770('0x2a')](function(_0x3bcccc){_0x416e7b=_0x3bcccc[_0x8770('0x2b')]({'plain':!![]});return db[_0x8770('0x56')]['find']({'where':{'id':_0x416e7b[_0x8770('0x57')]},'raw':!![]})[_0x8770('0x2a')](function(_0x4c0a3f){return createVoicePrefixExtensions(_0x416e7b,_0x4c0a3f,_0x1df5cd);});});})['then'](function(){var _0x552cab=_0x242361['user'][_0x8770('0x2b')]({'plain':!![]});if(!_0x552cab)throw new Error(_0x8770('0x58'));if(_0x552cab['role']===_0x8770('0x59')){var _0x38b68f=_0x416e7b;return db[_0x8770('0x5a')][_0x8770('0x51')]({'where':{'name':_0x8770('0x2c'),'userProfileId':_0x552cab[_0x8770('0x5b')]},'raw':!![]})[_0x8770('0x2a')](function(_0xc2f9d9){if(_0xc2f9d9&&_0xc2f9d9[_0x8770('0x5c')]===0x0){return db[_0x8770('0x5d')][_0x8770('0x55')]({'name':_0x38b68f['name'],'resourceId':_0x38b68f['id'],'type':_0xc2f9d9[_0x8770('0x2f')],'sectionId':_0xc2f9d9['id']},{})[_0x8770('0x2a')](function(){return _0x416e7b;});}else{return _0x416e7b;}})[_0x8770('0x4c')](function(_0x593b06){logger[_0x8770('0x2e')](_0x8770('0x5e'),_0x593b06);throw _0x593b06;});}return _0x416e7b;})[_0x8770('0x2a')](respondWithResult(_0x42ea2d,null))['catch'](handleError(_0x42ea2d,null));};function Extension(_0x2aecc0,_0xbe9c4c,_0x5b1548,_0x3a2070){this['context']=_0x8770('0x5f');this[_0x8770('0x60')]=_0x2aecc0;this['app']=_0x5b1548;this[_0x8770('0x36')]=_0x8770('0x61');this[_0x8770('0x62')]=_0x8770('0x63');this[_0x8770('0x64')]=_0xbe9c4c;this[_0x8770('0x65')]=_0x3a2070;}function createVoicePrefixExtensions(_0x36606f,_0x39c69b,_0x535041){return new BPromise(function(_0x1a67b5,_0x18a31d){var _0x5cd7a1=new Extension(formatPrefixName(_0x36606f['prefix']),0x1,_0x8770('0x66'),'Voice\x20Prefix');_0x5cd7a1[_0x8770('0x67')]=_0x36606f['id'];return db[_0x8770('0x56')]['create'](_0x5cd7a1,{'transaction':_0x535041})[_0x8770('0x2a')](function(_0x339d70){var _0x4419cb=_0x339d70[_0x8770('0x2b')]({'plain':!![]});var _0x2c6044=_[_0x8770('0x32')](addVoicePrefixExtensions(_0x36606f,_0x39c69b),function(_0x28f71b){_0x28f71b[_0x8770('0x57')]=_0x4419cb['id'];_0x28f71b[_0x8770('0x67')]=_0x36606f['id'];return _0x28f71b;});return db[_0x8770('0x56')][_0x8770('0x68')](_0x2c6044,{'transaction':_0x535041})[_0x8770('0x2a')](function(_0x1dcb75){if(!_0x1dcb75){return _0x18a31d('Extensions\x20creation\x20failed');}else{return _0x1a67b5(_0x1dcb75);}})[_0x8770('0x4c')](function(_0x1a3cae){return _0x18a31d(_0x1a3cae);});});;});};function addVoicePrefixExtensions(_0x31c098,_0x219473){var _0x45d1cb=[];var _0x6c24f7=formatPrefixName(_0x31c098[_0x8770('0x69')]);_0x45d1cb[_0x8770('0x6a')](new Extension(_0x6c24f7,0x2,_0x8770('0x6b'),'CDR(prefix)='+_0x31c098[_0x8770('0x2f')]));if(_0x31c098[_0x8770('0x6c')]){_0x45d1cb[_0x8770('0x6a')](new Extension(_0x6c24f7,0x3,'Set',_0x8770('0x6d')+_0x31c098[_0x8770('0x6c')]));}else{_0x45d1cb['push'](new Extension(_0x6c24f7,0x3,_0x8770('0x66'),_0x8770('0x6e')));}_0x45d1cb[_0x8770('0x6a')](new Extension(_0x6c24f7,0x4,_0x8770('0x6f'),_0x219473[_0x8770('0x70')]+','+'${EXTEN:'+(0x8+_0x31c098[_0x8770('0x2f')]['length'])+'}'+','+0x1));return _0x45d1cb;}function formatPrefixName(_0x2a45c8){var _0x43a87c='_';for(var _0x272862=0x0;_0x272862<_0x2a45c8[_0x8770('0x3d')];_0x272862++){if(_0x2a45c8[_0x8770('0x71')](_0x272862)=='-'){_0x43a87c+=_0x2a45c8[_0x8770('0x71')](_0x272862);}else{_0x43a87c+='['+_0x2a45c8[_0x8770('0x71')](_0x272862)+']';}}_0x43a87c+='.';return _0x43a87c;}exports[_0x8770('0x28')]=function(_0x896947,_0x54c34c,_0x15b77c){var _0x3fca1c=_0x896947[_0x8770('0x72')];_0x3fca1c[_0x8770('0x69')]=_0x8770('0x73')+_0x3fca1c[_0x8770('0x2f')]+'-';return db[_0x8770('0x53')][_0x8770('0x54')](function(_0x3ad340){return db['VoicePrefix']['update'](_0x3fca1c,{'where':{'id':_0x3fca1c['id']},'transaction':_0x3ad340})[_0x8770('0x2a')](function(){return db['VoiceExtension'][_0x8770('0x29')]({'where':{'VoicePrefixId':_0x3fca1c['id']},'transaction':_0x3ad340})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x3fca1c[_0x8770('0x57')]},'raw':!![]})[_0x8770('0x2a')](function(_0x405272){return createVoicePrefixExtensions(_0x3fca1c,_0x405272,_0x3ad340);});});});})[_0x8770('0x2a')](function(){return db[_0x8770('0x33')][_0x8770('0x74')](_0x3fca1c['id']);})[_0x8770('0x2a')](respondWithResult(_0x54c34c,null))[_0x8770('0x4c')](handleError(_0x54c34c,null));};exports[_0x8770('0x75')]=function(_0x2eebb9,_0x1bbd08,_0x1ef47a){return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x2eebb9[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0x1bbd08,null))['then'](function(_0x304539){if(_0x304539){return _0x304539[_0x8770('0x75')](_0x2eebb9[_0x8770('0x72')][_0x8770('0x76')],_[_0x8770('0x77')](_0x2eebb9[_0x8770('0x72')],[_0x8770('0x76'),'id'])||{})[_0x8770('0x78')](function(_0x2ab10c){for(var _0x2669df=0x0;_0x2669df<_0x2eebb9[_0x8770('0x72')][_0x8770('0x76')][_0x8770('0x3d')];_0x2669df+=0x1){socket['emit'](_0x8770('0x79'),{'UserId':Number(_0x2eebb9['body'][_0x8770('0x76')][_0x2669df]),'VoicePrefixId':Number(_0x2eebb9[_0x8770('0x4e')]['id'])});}return _0x2ab10c;});}})['then'](respondWithResult(_0x1bbd08,null))[_0x8770('0x4c')](handleError(_0x1bbd08,null));};exports[_0x8770('0x7a')]=function(_0x3ebea6,_0x3b1a55,_0x1b3b5d){return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x3ebea6['params']['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0x3b1a55,null))[_0x8770('0x2a')](function(_0xf5ef52){if(_0xf5ef52){return _0xf5ef52['removeAgents'](_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')])[_0x8770('0x2a')](function(){if(_[_0x8770('0x7b')](_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')])){for(var _0x45c5be=0x0;_0x45c5be<_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')][_0x8770('0x3d')];_0x45c5be+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')][_0x45c5be]),'VoicePrefixId':Number(_0x3ebea6[_0x8770('0x4e')]['id'])});}}else{socket[_0x8770('0x7c')]('userVoicePrefix:remove',{'UserId':Number(_0x3ebea6['query'][_0x8770('0x76')]),'VoicePrefixId':Number(_0x3ebea6['params']['id'])});}});}})[_0x8770('0x2a')](respondWithStatusCode(_0x3b1a55,null))['catch'](handleError(_0x3b1a55,null));};exports[_0x8770('0x7d')]=function(_0xb6193a,_0x41344a,_0x54dfea){var _0x16bef8={};var _0x4925f8={};var _0x5b2f00;var _0x15abe5;return db[_0x8770('0x33')]['findOne']({'where':{'id':_0xb6193a[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0x41344a,null))['then'](function(_0x344a1c){if(_0x344a1c){_0x5b2f00=_0x344a1c;_0x4925f8['model']=_[_0x8770('0x3a')](db['User']['rawAttributes']);_0x4925f8[_0x8770('0x39')]=_[_0x8770('0x3a')](_0xb6193a['query']);_0x4925f8['filters']=_[_0x8770('0x4f')](_0x4925f8[_0x8770('0x38')],_0x4925f8[_0x8770('0x39')]);_0x16bef8[_0x8770('0x3b')]=_['intersection'](_0x4925f8[_0x8770('0x38')],qs[_0x8770('0x3c')](_0xb6193a['query'][_0x8770('0x3c')]));_0x16bef8[_0x8770('0x3b')]=_0x16bef8[_0x8770('0x3b')]['length']?_0x16bef8[_0x8770('0x3b')]:_0x4925f8['model'];_0x16bef8[_0x8770('0x40')]=qs['sort'](_0xb6193a[_0x8770('0x39')][_0x8770('0x41')]);_0x16bef8[_0x8770('0x42')]=qs['filters'](_[_0x8770('0x43')](_0xb6193a['query'],_0x4925f8[_0x8770('0x44')]));if(_0xb6193a['query'][_0x8770('0x45')]){_0x16bef8[_0x8770('0x42')]=_[_0x8770('0x46')](_0x16bef8[_0x8770('0x42')],{'$or':_['map'](_0x16bef8[_0x8770('0x3b')],function(_0x4a699b){var _0x4478d0={};_0x4478d0[_0x4a699b]={'$like':'%'+_0xb6193a[_0x8770('0x39')][_0x8770('0x45')]+'%'};return _0x4478d0;})});}_0x16bef8=_[_0x8770('0x46')]({},_0x16bef8,_0xb6193a[_0x8770('0x48')]);return _0x5b2f00['getAgents'](_0x16bef8);}})[_0x8770('0x2a')](function(_0x5dcc26){if(_0x5dcc26){_0x15abe5=_0x5dcc26[_0x8770('0x3d')];if(!_0xb6193a[_0x8770('0x39')][_0x8770('0x3e')]('nolimit')){_0x16bef8['limit']=qs['limit'](_0xb6193a[_0x8770('0x39')][_0x8770('0x1e')]);_0x16bef8['offset']=qs[_0x8770('0x21')](_0xb6193a[_0x8770('0x39')][_0x8770('0x21')]);}return _0x5b2f00[_0x8770('0x7d')](_0x16bef8);}})[_0x8770('0x2a')](function(_0x541502){if(_0x541502){return _0x541502?{'count':_0x15abe5,'rows':_0x541502}:null;}})[_0x8770('0x2a')](respondWithResult(_0x41344a,null))['catch'](handleError(_0x41344a,null));};exports[_0x8770('0x7e')]=function(_0x1e2964,_0xb0bc70,_0x97f28){var _0x225353={};var _0x459715={};var _0x2c0dc3;var _0x47ee22;return db['VoicePrefix'][_0x8770('0x7f')]({'where':{'id':_0x1e2964[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0xb0bc70,null))[_0x8770('0x2a')](function(_0x5b9da7){if(_0x5b9da7){_0x2c0dc3=_0x5b9da7;_0x459715[_0x8770('0x38')]=_[_0x8770('0x3a')](db[_0x8770('0x80')]['rawAttributes']);_0x459715[_0x8770('0x39')]=_[_0x8770('0x3a')](_0x1e2964[_0x8770('0x39')]);_0x459715[_0x8770('0x44')]=_[_0x8770('0x4f')](_0x459715[_0x8770('0x38')],_0x459715[_0x8770('0x39')]);_0x225353['attributes']=_[_0x8770('0x4f')](_0x459715[_0x8770('0x38')],qs[_0x8770('0x3c')](_0x1e2964[_0x8770('0x39')][_0x8770('0x3c')]));_0x225353[_0x8770('0x3b')]=_0x225353[_0x8770('0x3b')][_0x8770('0x3d')]?_0x225353[_0x8770('0x3b')]:_0x459715[_0x8770('0x38')];_0x225353['order']=qs[_0x8770('0x41')](_0x1e2964[_0x8770('0x39')][_0x8770('0x41')]);_0x225353['where']=qs['filters'](_[_0x8770('0x43')](_0x1e2964[_0x8770('0x39')],_0x459715[_0x8770('0x44')]));if(_0x1e2964[_0x8770('0x39')][_0x8770('0x45')]){_0x225353[_0x8770('0x42')]=_[_0x8770('0x46')](_0x225353[_0x8770('0x42')],{'$or':_[_0x8770('0x32')](_0x225353[_0x8770('0x3b')],function(_0x1e8091){var _0x19f98a={};_0x19f98a[_0x1e8091]={'$like':'%'+_0x1e2964[_0x8770('0x39')]['filter']+'%'};return _0x19f98a;})});}_0x225353=_[_0x8770('0x46')]({},_0x225353,_0x1e2964[_0x8770('0x48')]);return _0x2c0dc3[_0x8770('0x7e')](_0x225353);}})[_0x8770('0x2a')](function(_0x1703b8){if(_0x1703b8){_0x47ee22=_0x1703b8['length'];if(!_0x1e2964[_0x8770('0x39')]['hasOwnProperty'](_0x8770('0x3f'))){_0x225353[_0x8770('0x1e')]=qs[_0x8770('0x1e')](_0x1e2964[_0x8770('0x39')][_0x8770('0x1e')]);_0x225353[_0x8770('0x21')]=qs[_0x8770('0x21')](_0x1e2964[_0x8770('0x39')]['offset']);}return _0x2c0dc3['getTeams'](_0x225353);}})['then'](function(_0x1e16f5){if(_0x1e16f5){return _0x1e16f5?{'count':_0x47ee22,'rows':_0x1e16f5}:null;}})[_0x8770('0x2a')](respondWithResult(_0xb0bc70,null))[_0x8770('0x4c')](handleError(_0xb0bc70,null));};exports[_0x8770('0x81')]=function(_0x58e7d1,_0x2696c9,_0x1a6fef){var _0x16056d=_0x58e7d1[_0x8770('0x72')][_0x8770('0x76')];var _0x3d7f89;return db[_0x8770('0x80')][_0x8770('0x4a')]({'where':{'id':_0x16056d},'attributes':['id'],'include':[{'model':db[_0x8770('0x82')],'as':_0x8770('0x83'),'attributes':['id','name',_0x8770('0x84'),_0x8770('0x85'),'interface'],'raw':!![]}]})[_0x8770('0x2a')](function(_0x3f6b63){if(_0x3f6b63){_0x3d7f89=_0x3f6b63;var _0x503fa9=_[_0x8770('0x86')](_0x3f6b63,function(_0x1a1496){var _0x56b6cb=_0x1a1496[_0x8770('0x2b')]({'plain':!![]});return _0x56b6cb[_0x8770('0x83')];});return db[_0x8770('0x33')]['find']({'where':{'id':_0x58e7d1[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](function(_0x3272d9){return db[_0x8770('0x53')]['transaction'](function(_0x1b9673){return _0x3272d9[_0x8770('0x81')](_0x16056d,{'transaction':_0x1b9673})['then'](function(){return BPromise[_0x8770('0x87')](_0x3d7f89,function(_0x3b4c87){return db['TeamVoicePrefix'][_0x8770('0x88')]({'TeamId':_0x3b4c87['id'],'VoicePrefixId':_0x58e7d1[_0x8770('0x4e')]['id']},{'transaction':_0x1b9673});});})[_0x8770('0x2a')](function(){return BPromise[_0x8770('0x87')](_0x503fa9,function(_0x21b355){return db['UserVoicePrefix'][_0x8770('0x89')]({'where':{'UserId':_0x21b355['id'],'VoicePrefixId':_0x58e7d1['params']['id']},'transaction':_0x1b9673});});})['then'](function(){_0x503fa9[_0x8770('0x8a')](function(_0x355360){socket[_0x8770('0x7c')](_0x8770('0x79'),{'UserId':_0x355360['id'],'VoicePrefixId':_0x3272d9['id']});});});});});}})['then'](respondWithStatusCode(_0x2696c9,null))[_0x8770('0x4c')](handleError(_0x2696c9,null));};exports['removeTeams']=function(_0x4a723c,_0x479d58,_0x59cc6e){return db[_0x8770('0x80')]['findAll']({'where':{'id':_0x4a723c[_0x8770('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8770('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x479d58,null))[_0x8770('0x2a')](function(_0x11891f){var _0x445dee=_['map'](_0x11891f,'id');var _0x568b87=[];var _0x458762=[];var _0x3bd770=squel[_0x8770('0x8b')]();_0x3bd770[_0x8770('0x8c')](_0x8770('0x8d'))['from'](_0x8770('0x8e'),'tq')[_0x8770('0x8f')](_0x8770('0x90'),'ut',_0x8770('0x91'))[_0x8770('0x42')](_0x8770('0x92'),_0x4a723c[_0x8770('0x4e')]['id']);for(var _0x38238a=0x0;_0x38238a<_0x11891f[_0x8770('0x3d')];_0x38238a+=0x1){let _0x6de941=_0x11891f[_0x38238a];for(var _0x592fef=0x0;_0x592fef<_0x6de941[_0x8770('0x83')][_0x8770('0x3d')];_0x592fef+=0x1){let _0x49c415=_0x6de941[_0x8770('0x83')][_0x592fef];var _0x3bb644=_0x3bd770[_0x8770('0x93')]();_0x3bb644['where'](_0x8770('0x94'),_0x49c415['id']);_0x458762['push'](db[_0x8770('0x53')][_0x8770('0x39')](_0x3bb644[_0x8770('0x95')](),{'type':db['sequelize'][_0x8770('0x96')][_0x8770('0x97')]})[_0x8770('0x2a')](function(_0x5ded0a){if(_0x5ded0a['length']===0x1){return _0x49c415['id'];}else{var _0x36f842=_[_0x8770('0x98')](_[_0x8770('0x32')](_0x5ded0a,_0x8770('0x99')),function(_0x30b589){return _[_0x8770('0x9a')](_0x445dee,_0x30b589);});if(_0x36f842){return _0x49c415['id'];}}}));}}return BPromise[_0x8770('0x9b')](_0x458762)[_0x8770('0x2a')](function(_0x377cfb){_0x568b87=_(_0x568b87)[_0x8770('0x9c')](_0x377cfb)[_0x8770('0x9d')]()[_0x8770('0x9e')]();return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x4a723c[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](function(_0x4cadd5){return db[_0x8770('0x53')][_0x8770('0x54')](function(_0x1ac69f){return _0x4cadd5[_0x8770('0x9f')](_0x4a723c['query'][_0x8770('0x76')],{'transaction':_0x1ac69f})['then'](function(){if(!_[_0x8770('0xa0')](_0x568b87)){return _0x4cadd5[_0x8770('0x7a')](_0x568b87,{'transaction':_0x1ac69f});}})['then'](function(){_0x568b87['forEach'](function(_0x4203d2){socket[_0x8770('0x7c')](_0x8770('0xa1'),{'UserId':_0x4203d2,'VoicePrefixId':_0x4cadd5['id']});});});});});});})['then'](respondWithStatusCode(_0x479d58,null))[_0x8770('0x4c')](handleError(_0x479d58,null));}; \ No newline at end of file +var _0x4b17=['status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','name','send','map','VoicePrefix','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','catch','params','rawAttributes','includeAll','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','context','from-sip','exten','app','type','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','Agents','voicePause','flatMap','each','upsert','findOrCreate','forEach','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','isEmpty','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4b17,0x10f));var _0x74b1=function(_0x364b32,_0x4dec35){_0x364b32=_0x364b32-0x0;var _0x3f3ea0=_0x4b17[_0x364b32];return _0x3f3ea0;};'use strict';var emlformat=require(_0x74b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b1('0x2'));var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x74b1('0x5'));var csv=require(_0x74b1('0x6'));var ejs=require(_0x74b1('0x7'));var fs=require('fs');var fs_extra=require(_0x74b1('0x8'));var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x6'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b1('0x16'))['db'];config['redis']=_['defaults'](config[_0x74b1('0x17')],{'host':_0x74b1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')[_0x74b1('0x19')](socket);function respondWithStatusCode(_0x5c12eb,_0x4e289b){_0x4e289b=_0x4e289b||0xcc;return function(_0x2ccba6){if(_0x2ccba6){return _0x5c12eb[_0x74b1('0x1a')](_0x4e289b);}return _0x5c12eb[_0x74b1('0x1b')](_0x4e289b)[_0x74b1('0x1c')]();};}function respondWithResult(_0x16b147,_0x10138e){_0x10138e=_0x10138e||0xc8;return function(_0x528e8c){if(_0x528e8c){return _0x16b147[_0x74b1('0x1b')](_0x10138e)[_0x74b1('0x1d')](_0x528e8c);}};}function respondWithFilteredResult(_0x1a0851,_0x2cfcc3){return function(_0xde2736){if(_0xde2736){var _0x8c9510=typeof _0x2cfcc3[_0x74b1('0x1e')]==='undefined'&&typeof _0x2cfcc3[_0x74b1('0x1f')]===_0x74b1('0x20');var _0x524ece=_0xde2736[_0x74b1('0x21')];var _0x38d932=_0x8c9510?0x0:_0x2cfcc3[_0x74b1('0x1e')];var _0x25704e=_0x8c9510?_0xde2736[_0x74b1('0x21')]:_0x2cfcc3[_0x74b1('0x1e')]+_0x2cfcc3[_0x74b1('0x1f')];var _0xaac5f7;if(_0x25704e>=_0x524ece){_0x25704e=_0x524ece;_0xaac5f7=0xc8;}else{_0xaac5f7=0xce;}_0x1a0851['status'](_0xaac5f7);return _0x1a0851[_0x74b1('0x22')]('Content-Range',_0x38d932+'-'+_0x25704e+'/'+_0x524ece)['json'](_0xde2736);}return null;};}function patchUpdates(_0x481bf2){return function(_0x27fd1a){try{jsonpatch[_0x74b1('0x23')](_0x27fd1a,_0x481bf2,!![]);}catch(_0x405a22){return BPromise[_0x74b1('0x24')](_0x405a22);}return _0x27fd1a[_0x74b1('0x25')]();};}function saveUpdates(_0x4ee88b,_0x3c78e5){return function(_0x4eca36){if(_0x4eca36){return _0x4eca36[_0x74b1('0x26')](_0x4ee88b)[_0x74b1('0x27')](function(_0xb5af0){return _0xb5af0;});}return null;};}function removeEntity(_0x14a651,_0x3239d8){return function(_0x322de5){if(_0x322de5){return _0x322de5[_0x74b1('0x28')]()[_0x74b1('0x27')](function(){var _0x4c7f05=_0x322de5[_0x74b1('0x29')]({'plain':!![]});var _0x42b69d=_0x74b1('0x2a');return db['UserProfileResource'][_0x74b1('0x28')]({'where':{'type':_0x42b69d,'resourceId':_0x4c7f05['id']}})[_0x74b1('0x27')](function(){return _0x322de5;});})[_0x74b1('0x27')](function(){_0x14a651[_0x74b1('0x1b')](0xcc)[_0x74b1('0x1c')]();});}};}function handleEntityNotFound(_0x273ff1,_0x436eda){return function(_0x3ce043){if(!_0x3ce043){_0x273ff1['sendStatus'](0x194);}return _0x3ce043;};}function handleError(_0xe74c82,_0x40b32a){_0x40b32a=_0x40b32a||0x1f4;return function(_0x51ce6d){logger[_0x74b1('0x2b')](_0x51ce6d[_0x74b1('0x2c')]);if(_0x51ce6d[_0x74b1('0x2d')]){delete _0x51ce6d['name'];}_0xe74c82[_0x74b1('0x1b')](_0x40b32a)[_0x74b1('0x2e')](_0x51ce6d);};}exports['index']=function(_0x3dbf18,_0x33ec7c){var _0x2211b2={},_0x31c321={},_0x68a3bd={'count':0x0,'rows':[]};var _0x32a8d6=_[_0x74b1('0x2f')](db[_0x74b1('0x30')]['rawAttributes'],function(_0x3d5fc0){return{'name':_0x3d5fc0['fieldName'],'type':_0x3d5fc0['type'][_0x74b1('0x31')]};});_0x31c321['model']=_['map'](_0x32a8d6,_0x74b1('0x2d'));_0x31c321[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x3dbf18[_0x74b1('0x32')]);_0x31c321[_0x74b1('0x34')]=_[_0x74b1('0x35')](_0x31c321[_0x74b1('0x36')],_0x31c321[_0x74b1('0x32')]);_0x2211b2['attributes']=_['intersection'](_0x31c321['model'],qs[_0x74b1('0x37')](_0x3dbf18['query']['fields']));_0x2211b2[_0x74b1('0x38')]=_0x2211b2[_0x74b1('0x38')][_0x74b1('0x39')]?_0x2211b2['attributes']:_0x31c321[_0x74b1('0x36')];if(!_0x3dbf18['query'][_0x74b1('0x3a')](_0x74b1('0x3b'))){_0x2211b2['limit']=qs['limit'](_0x3dbf18[_0x74b1('0x32')][_0x74b1('0x1f')]);_0x2211b2['offset']=qs['offset'](_0x3dbf18[_0x74b1('0x32')]['offset']);}_0x2211b2[_0x74b1('0x3c')]=qs[_0x74b1('0x3d')](_0x3dbf18[_0x74b1('0x32')][_0x74b1('0x3d')]);_0x2211b2[_0x74b1('0x3e')]=qs['filters'](_[_0x74b1('0x3f')](_0x3dbf18['query'],_0x31c321[_0x74b1('0x34')]),_0x32a8d6);if(_0x3dbf18['query'][_0x74b1('0x40')]){_0x2211b2['where']=_['merge'](_0x2211b2[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x32a8d6,function(_0x2725fd){if(_0x2725fd['type']!==_0x74b1('0x41')){var _0x327334={};_0x327334[_0x2725fd[_0x74b1('0x2d')]]={'$like':'%'+_0x3dbf18['query'][_0x74b1('0x40')]+'%'};return _0x327334;}})});}_0x2211b2=_[_0x74b1('0x42')]({},_0x2211b2,_0x3dbf18['options']);var _0x48ac05={'where':_0x2211b2[_0x74b1('0x3e')]};return db[_0x74b1('0x30')][_0x74b1('0x21')](_0x48ac05)[_0x74b1('0x27')](function(_0x1d9f5b){_0x68a3bd[_0x74b1('0x21')]=_0x1d9f5b;if(_0x3dbf18[_0x74b1('0x32')]['includeAll']){_0x2211b2[_0x74b1('0x43')]=[{'all':!![]}];}return db[_0x74b1('0x30')][_0x74b1('0x44')](_0x2211b2);})[_0x74b1('0x27')](function(_0x17a44f){_0x68a3bd['rows']=_0x17a44f;return _0x68a3bd;})[_0x74b1('0x27')](respondWithFilteredResult(_0x33ec7c,_0x2211b2))[_0x74b1('0x45')](handleError(_0x33ec7c,null));};exports['show']=function(_0x50d9de,_0x1b7a58){var _0x3c3c3c={'raw':![],'where':{'id':_0x50d9de[_0x74b1('0x46')]['id']}},_0x54c94b={};_0x54c94b[_0x74b1('0x36')]=_[_0x74b1('0x33')](db[_0x74b1('0x30')][_0x74b1('0x47')]);_0x54c94b[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x50d9de['query']);_0x54c94b['filters']=_['intersection'](_0x54c94b[_0x74b1('0x36')],_0x54c94b[_0x74b1('0x32')]);_0x3c3c3c[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x54c94b[_0x74b1('0x36')],qs['fields'](_0x50d9de[_0x74b1('0x32')][_0x74b1('0x37')]));_0x3c3c3c[_0x74b1('0x38')]=_0x3c3c3c[_0x74b1('0x38')][_0x74b1('0x39')]?_0x3c3c3c[_0x74b1('0x38')]:_0x54c94b[_0x74b1('0x36')];if(_0x50d9de[_0x74b1('0x32')][_0x74b1('0x48')]){_0x3c3c3c[_0x74b1('0x43')]=[{'all':!![]}];}_0x3c3c3c=_[_0x74b1('0x42')]({},_0x3c3c3c,_0x50d9de[_0x74b1('0x49')]);return db['VoicePrefix'][_0x74b1('0x4a')](_0x3c3c3c)[_0x74b1('0x27')](handleEntityNotFound(_0x1b7a58,null))['then'](respondWithResult(_0x1b7a58,null))[_0x74b1('0x45')](handleError(_0x1b7a58,null));};exports['destroy']=function(_0x4b1add,_0x2073eb){return db['VoicePrefix'][_0x74b1('0x4a')]({'where':{'id':_0x4b1add[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x2073eb,null))['then'](removeEntity(_0x2073eb,null))[_0x74b1('0x45')](handleError(_0x2073eb,null));};exports[_0x74b1('0x4b')]=function(_0x1b2d51,_0x3d199b){return db[_0x74b1('0x30')]['describe']()[_0x74b1('0x27')](respondWithResult(_0x3d199b,null))['catch'](handleError(_0x3d199b,null));};exports[_0x74b1('0x4c')]=function(_0x4085b8,_0x5e458c){var _0x1be639;return db[_0x74b1('0x4d')][_0x74b1('0x4e')](function(_0x54a221){return db[_0x74b1('0x30')][_0x74b1('0x4c')](_0x4085b8['body'],{'transaction':_0x54a221})[_0x74b1('0x27')](function(_0x4fdd6b){_0x1be639=_0x4fdd6b['get']({'plain':!![]});return db[_0x74b1('0x4f')][_0x74b1('0x4a')]({'where':{'id':_0x1be639[_0x74b1('0x50')]},'raw':!![]})[_0x74b1('0x27')](function(_0x41b45f){return createVoicePrefixExtensions(_0x1be639,_0x41b45f,_0x54a221);});});})['then'](function(){var _0x145ce3=_0x4085b8[_0x74b1('0x51')]['get']({'plain':!![]});if(!_0x145ce3)throw new Error(_0x74b1('0x52'));if(_0x145ce3[_0x74b1('0x53')]===_0x74b1('0x51')){var _0x5634d1=_0x1be639;return db[_0x74b1('0x54')][_0x74b1('0x4a')]({'where':{'name':_0x74b1('0x2a'),'userProfileId':_0x145ce3['userProfileId']},'raw':!![]})[_0x74b1('0x27')](function(_0x3b4338){if(_0x3b4338&&_0x3b4338[_0x74b1('0x55')]===0x0){return db[_0x74b1('0x56')][_0x74b1('0x4c')]({'name':_0x5634d1[_0x74b1('0x2d')],'resourceId':_0x5634d1['id'],'type':_0x3b4338['name'],'sectionId':_0x3b4338['id']},{})[_0x74b1('0x27')](function(){return _0x1be639;});}else{return _0x1be639;}})['catch'](function(_0x5343c4){logger[_0x74b1('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5343c4);throw _0x5343c4;});}return _0x1be639;})['then'](respondWithResult(_0x5e458c,null))[_0x74b1('0x45')](handleError(_0x5e458c,null));};function Extension(_0x29ab63,_0x16db5c,_0x515a8e,_0x204b7d){this[_0x74b1('0x57')]=_0x74b1('0x58');this[_0x74b1('0x59')]=_0x29ab63;this[_0x74b1('0x5a')]=_0x515a8e;this[_0x74b1('0x5b')]=_0x74b1('0x5c');this[_0x74b1('0x5d')]=_0x74b1('0x5e');this[_0x74b1('0x5f')]=_0x16db5c;this[_0x74b1('0x60')]=_0x204b7d;}function createVoicePrefixExtensions(_0x112721,_0x516e44,_0x598daa){return new BPromise(function(_0x2a46ca,_0x553615){var _0x15eb38=new Extension(formatPrefixName(_0x112721[_0x74b1('0x61')]),0x1,'NoOp','Voice\x20Prefix');_0x15eb38[_0x74b1('0x62')]=_0x112721['id'];return db[_0x74b1('0x4f')][_0x74b1('0x4c')](_0x15eb38,{'transaction':_0x598daa})[_0x74b1('0x27')](function(_0x3dd0c3){var _0x1f879f=_0x3dd0c3[_0x74b1('0x29')]({'plain':!![]});var _0x1fb137=_[_0x74b1('0x2f')](addVoicePrefixExtensions(_0x112721,_0x516e44),function(_0x128a7e){_0x128a7e[_0x74b1('0x50')]=_0x1f879f['id'];_0x128a7e[_0x74b1('0x62')]=_0x112721['id'];return _0x128a7e;});return db['VoiceExtension'][_0x74b1('0x63')](_0x1fb137,{'transaction':_0x598daa})[_0x74b1('0x27')](function(_0x378f63){if(!_0x378f63){return _0x553615(_0x74b1('0x64'));}else{return _0x2a46ca(_0x378f63);}})['catch'](function(_0x308b98){return _0x553615(_0x308b98);});});;});};function addVoicePrefixExtensions(_0x1709d9,_0x5ada76){var _0x425f9f=[];var _0x4d2fcb=formatPrefixName(_0x1709d9[_0x74b1('0x61')]);_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x2,'Set',_0x74b1('0x66')+_0x1709d9[_0x74b1('0x2d')]));if(_0x1709d9[_0x74b1('0x67')]){_0x425f9f['push'](new Extension(_0x4d2fcb,0x3,_0x74b1('0x68'),'PREFIX-CALLERIDALL='+_0x1709d9[_0x74b1('0x67')]));}else{_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x3,_0x74b1('0x69'),_0x74b1('0x6a')));}_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x4,_0x74b1('0x6b'),_0x5ada76[_0x74b1('0x57')]+','+_0x74b1('0x6c')+(0x8+_0x1709d9[_0x74b1('0x2d')][_0x74b1('0x39')])+'}'+','+0x1));return _0x425f9f;}function formatPrefixName(_0x8b4902){var _0x44563d='_';for(var _0x2a33c9=0x0;_0x2a33c9<_0x8b4902['length'];_0x2a33c9++){if(_0x8b4902[_0x74b1('0x6d')](_0x2a33c9)=='-'){_0x44563d+=_0x8b4902[_0x74b1('0x6d')](_0x2a33c9);}else{_0x44563d+='['+_0x8b4902[_0x74b1('0x6d')](_0x2a33c9)+']';}}_0x44563d+='.';return _0x44563d;}exports[_0x74b1('0x26')]=function(_0x30692c,_0x228f8f,_0x2e94d6){var _0x7e2bcc=_0x30692c[_0x74b1('0x6e')];_0x7e2bcc['prefix']=_0x74b1('0x6f')+_0x7e2bcc['name']+'-';return db[_0x74b1('0x4d')]['transaction'](function(_0x5886d1){return db[_0x74b1('0x30')][_0x74b1('0x26')](_0x7e2bcc,{'where':{'id':_0x7e2bcc['id']},'transaction':_0x5886d1})[_0x74b1('0x27')](function(){return db['VoiceExtension'][_0x74b1('0x28')]({'where':{'VoicePrefixId':_0x7e2bcc['id']},'transaction':_0x5886d1})[_0x74b1('0x27')](function(){return db['VoiceExtension'][_0x74b1('0x4a')]({'where':{'id':_0x7e2bcc[_0x74b1('0x50')]},'raw':!![]})[_0x74b1('0x27')](function(_0x21e767){return createVoicePrefixExtensions(_0x7e2bcc,_0x21e767,_0x5886d1);});});});})[_0x74b1('0x27')](function(){return db[_0x74b1('0x30')][_0x74b1('0x70')](_0x7e2bcc['id']);})[_0x74b1('0x27')](respondWithResult(_0x228f8f,null))[_0x74b1('0x45')](handleError(_0x228f8f,null));};exports[_0x74b1('0x71')]=function(_0x542ee7,_0x2b1119,_0x3267ef){return db[_0x74b1('0x30')]['find']({'where':{'id':_0x542ee7[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x2b1119,null))[_0x74b1('0x27')](function(_0x1a6a70){if(_0x1a6a70){return _0x1a6a70[_0x74b1('0x71')](_0x542ee7['body'][_0x74b1('0x72')],_[_0x74b1('0x73')](_0x542ee7[_0x74b1('0x6e')],[_0x74b1('0x72'),'id'])||{})[_0x74b1('0x74')](function(_0x36733f){for(var _0x359e05=0x0;_0x359e05<_0x542ee7[_0x74b1('0x6e')]['ids'][_0x74b1('0x39')];_0x359e05+=0x1){socket[_0x74b1('0x75')](_0x74b1('0x76'),{'UserId':Number(_0x542ee7['body']['ids'][_0x359e05]),'VoicePrefixId':Number(_0x542ee7[_0x74b1('0x46')]['id'])});}return _0x36733f;});}})[_0x74b1('0x27')](respondWithResult(_0x2b1119,null))[_0x74b1('0x45')](handleError(_0x2b1119,null));};exports[_0x74b1('0x77')]=function(_0x2de935,_0x5d8729,_0x42a630){return db['VoicePrefix']['find']({'where':{'id':_0x2de935[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x5d8729,null))[_0x74b1('0x27')](function(_0x2da0f2){if(_0x2da0f2){return _0x2da0f2[_0x74b1('0x77')](_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')])[_0x74b1('0x27')](function(){if(_['isArray'](_0x2de935['query']['ids'])){for(var _0x7ec28f=0x0;_0x7ec28f<_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')][_0x74b1('0x39')];_0x7ec28f+=0x1){socket[_0x74b1('0x75')](_0x74b1('0x78'),{'UserId':Number(_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')][_0x7ec28f]),'VoicePrefixId':Number(_0x2de935[_0x74b1('0x46')]['id'])});}}else{socket[_0x74b1('0x75')](_0x74b1('0x78'),{'UserId':Number(_0x2de935[_0x74b1('0x32')]['ids']),'VoicePrefixId':Number(_0x2de935[_0x74b1('0x46')]['id'])});}});}})[_0x74b1('0x27')](respondWithStatusCode(_0x5d8729,null))[_0x74b1('0x45')](handleError(_0x5d8729,null));};exports[_0x74b1('0x79')]=function(_0x25f929,_0x138f79,_0x5a07a6){var _0x2567d7={};var _0x32eb2d={};var _0x21c54f;var _0x4b025c;return db[_0x74b1('0x30')][_0x74b1('0x7a')]({'where':{'id':_0x25f929[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x138f79,null))['then'](function(_0x7d3f08){if(_0x7d3f08){_0x21c54f=_0x7d3f08;_0x32eb2d[_0x74b1('0x36')]=_[_0x74b1('0x33')](db[_0x74b1('0x7b')][_0x74b1('0x47')]);_0x32eb2d['query']=_[_0x74b1('0x33')](_0x25f929[_0x74b1('0x32')]);_0x32eb2d['filters']=_[_0x74b1('0x35')](_0x32eb2d[_0x74b1('0x36')],_0x32eb2d['query']);_0x2567d7[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x32eb2d[_0x74b1('0x36')],qs[_0x74b1('0x37')](_0x25f929['query']['fields']));_0x2567d7[_0x74b1('0x38')]=_0x2567d7[_0x74b1('0x38')][_0x74b1('0x39')]?_0x2567d7['attributes']:_0x32eb2d[_0x74b1('0x36')];_0x2567d7[_0x74b1('0x3c')]=qs['sort'](_0x25f929['query'][_0x74b1('0x3d')]);_0x2567d7[_0x74b1('0x3e')]=qs[_0x74b1('0x34')](_['pick'](_0x25f929[_0x74b1('0x32')],_0x32eb2d[_0x74b1('0x34')]));if(_0x25f929[_0x74b1('0x32')][_0x74b1('0x40')]){_0x2567d7['where']=_['merge'](_0x2567d7[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x2567d7['attributes'],function(_0x1bf4a4){var _0x258b8f={};_0x258b8f[_0x1bf4a4]={'$like':'%'+_0x25f929[_0x74b1('0x32')][_0x74b1('0x40')]+'%'};return _0x258b8f;})});}_0x2567d7=_[_0x74b1('0x42')]({},_0x2567d7,_0x25f929[_0x74b1('0x49')]);return _0x21c54f[_0x74b1('0x79')](_0x2567d7);}})[_0x74b1('0x27')](function(_0x21453e){if(_0x21453e){_0x4b025c=_0x21453e[_0x74b1('0x39')];if(!_0x25f929['query'][_0x74b1('0x3a')](_0x74b1('0x3b'))){_0x2567d7[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x25f929[_0x74b1('0x32')][_0x74b1('0x1f')]);_0x2567d7['offset']=qs[_0x74b1('0x1e')](_0x25f929['query'][_0x74b1('0x1e')]);}return _0x21c54f[_0x74b1('0x79')](_0x2567d7);}})[_0x74b1('0x27')](function(_0x4fcd9a){if(_0x4fcd9a){return _0x4fcd9a?{'count':_0x4b025c,'rows':_0x4fcd9a}:null;}})[_0x74b1('0x27')](respondWithResult(_0x138f79,null))[_0x74b1('0x45')](handleError(_0x138f79,null));};exports['getTeams']=function(_0x4a9ec5,_0x5c02fc,_0x1cbfde){var _0x6ac5ae={};var _0x1a223d={};var _0x25624b;var _0xb24035;return db[_0x74b1('0x30')][_0x74b1('0x7a')]({'where':{'id':_0x4a9ec5[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x5c02fc,null))[_0x74b1('0x27')](function(_0x220cbf){if(_0x220cbf){_0x25624b=_0x220cbf;_0x1a223d[_0x74b1('0x36')]=_['keys'](db[_0x74b1('0x7c')][_0x74b1('0x47')]);_0x1a223d[_0x74b1('0x32')]=_['keys'](_0x4a9ec5[_0x74b1('0x32')]);_0x1a223d[_0x74b1('0x34')]=_[_0x74b1('0x35')](_0x1a223d['model'],_0x1a223d[_0x74b1('0x32')]);_0x6ac5ae[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x1a223d['model'],qs[_0x74b1('0x37')](_0x4a9ec5[_0x74b1('0x32')][_0x74b1('0x37')]));_0x6ac5ae[_0x74b1('0x38')]=_0x6ac5ae[_0x74b1('0x38')][_0x74b1('0x39')]?_0x6ac5ae[_0x74b1('0x38')]:_0x1a223d[_0x74b1('0x36')];_0x6ac5ae[_0x74b1('0x3c')]=qs[_0x74b1('0x3d')](_0x4a9ec5[_0x74b1('0x32')][_0x74b1('0x3d')]);_0x6ac5ae[_0x74b1('0x3e')]=qs[_0x74b1('0x34')](_[_0x74b1('0x3f')](_0x4a9ec5[_0x74b1('0x32')],_0x1a223d[_0x74b1('0x34')]));if(_0x4a9ec5['query'][_0x74b1('0x40')]){_0x6ac5ae[_0x74b1('0x3e')]=_['merge'](_0x6ac5ae[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x6ac5ae[_0x74b1('0x38')],function(_0x3e3dfb){var _0x1a5c1e={};_0x1a5c1e[_0x3e3dfb]={'$like':'%'+_0x4a9ec5[_0x74b1('0x32')]['filter']+'%'};return _0x1a5c1e;})});}_0x6ac5ae=_['merge']({},_0x6ac5ae,_0x4a9ec5[_0x74b1('0x49')]);return _0x25624b[_0x74b1('0x7d')](_0x6ac5ae);}})[_0x74b1('0x27')](function(_0x401599){if(_0x401599){_0xb24035=_0x401599[_0x74b1('0x39')];if(!_0x4a9ec5[_0x74b1('0x32')]['hasOwnProperty'](_0x74b1('0x3b'))){_0x6ac5ae[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x4a9ec5[_0x74b1('0x32')]['limit']);_0x6ac5ae[_0x74b1('0x1e')]=qs[_0x74b1('0x1e')](_0x4a9ec5['query'][_0x74b1('0x1e')]);}return _0x25624b[_0x74b1('0x7d')](_0x6ac5ae);}})[_0x74b1('0x27')](function(_0x29de45){if(_0x29de45){return _0x29de45?{'count':_0xb24035,'rows':_0x29de45}:null;}})[_0x74b1('0x27')](respondWithResult(_0x5c02fc,null))[_0x74b1('0x45')](handleError(_0x5c02fc,null));};exports[_0x74b1('0x7e')]=function(_0x33b136,_0x4f9b6a,_0x8366b){var _0x2d356c=_0x33b136['body'][_0x74b1('0x72')];var _0x3719d7;return db[_0x74b1('0x7c')][_0x74b1('0x44')]({'where':{'id':_0x2d356c},'attributes':['id'],'include':[{'model':db[_0x74b1('0x7b')],'as':_0x74b1('0x7f'),'attributes':['id',_0x74b1('0x2d'),'online',_0x74b1('0x80'),'interface'],'raw':!![]}]})[_0x74b1('0x27')](function(_0x3bd788){if(_0x3bd788){_0x3719d7=_0x3bd788;var _0x5b4ecf=_[_0x74b1('0x81')](_0x3bd788,function(_0x5dbc1f){var _0x4aa62a=_0x5dbc1f[_0x74b1('0x29')]({'plain':!![]});return _0x4aa62a['Agents'];});return db[_0x74b1('0x30')]['find']({'where':{'id':_0x33b136[_0x74b1('0x46')]['id']}})['then'](function(_0x5b8ba6){return db[_0x74b1('0x4d')]['transaction'](function(_0x2ea97c){return _0x5b8ba6[_0x74b1('0x7e')](_0x2d356c,{'transaction':_0x2ea97c})[_0x74b1('0x27')](function(){return BPromise[_0x74b1('0x82')](_0x3719d7,function(_0x433293){return db['TeamVoicePrefix'][_0x74b1('0x83')]({'TeamId':_0x433293['id'],'VoicePrefixId':_0x33b136['params']['id']},{'transaction':_0x2ea97c});});})[_0x74b1('0x27')](function(){return BPromise[_0x74b1('0x82')](_0x5b4ecf,function(_0x110bb6){return db['UserVoicePrefix'][_0x74b1('0x84')]({'where':{'UserId':_0x110bb6['id'],'VoicePrefixId':_0x33b136[_0x74b1('0x46')]['id']},'transaction':_0x2ea97c});});})['then'](function(){_0x5b4ecf[_0x74b1('0x85')](function(_0xbaf7f4){socket[_0x74b1('0x75')](_0x74b1('0x76'),{'UserId':_0xbaf7f4['id'],'VoicePrefixId':_0x5b8ba6['id']});});});});});}})['then'](respondWithStatusCode(_0x4f9b6a,null))[_0x74b1('0x45')](handleError(_0x4f9b6a,null));};exports[_0x74b1('0x86')]=function(_0x1f2add,_0x1ab4ea,_0x5b3ae9){return db[_0x74b1('0x7c')][_0x74b1('0x44')]({'where':{'id':_0x1f2add['query'][_0x74b1('0x72')]},'attributes':['id'],'include':[{'model':db[_0x74b1('0x7b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x74b1('0x27')](handleEntityNotFound(_0x1ab4ea,null))[_0x74b1('0x27')](function(_0x39354d){var _0x484368=_['map'](_0x39354d,'id');var _0xfcd9b=[];var _0x1b3847=[];var _0x4880f6=squel['select']();_0x4880f6[_0x74b1('0x87')](_0x74b1('0x88'))['from'](_0x74b1('0x89'),'tq')[_0x74b1('0x8a')](_0x74b1('0x8b'),'ut',_0x74b1('0x8c'))[_0x74b1('0x3e')](_0x74b1('0x8d'),_0x1f2add[_0x74b1('0x46')]['id']);for(var _0x523ec1=0x0;_0x523ec1<_0x39354d[_0x74b1('0x39')];_0x523ec1+=0x1){let _0x304756=_0x39354d[_0x523ec1];for(var _0x3039d7=0x0;_0x3039d7<_0x304756[_0x74b1('0x7f')][_0x74b1('0x39')];_0x3039d7+=0x1){let _0x367373=_0x304756[_0x74b1('0x7f')][_0x3039d7];var _0x2ee3a7=_0x4880f6[_0x74b1('0x8e')]();_0x2ee3a7[_0x74b1('0x3e')]('ut.UserId\x20=\x20?',_0x367373['id']);_0x1b3847['push'](db['sequelize'][_0x74b1('0x32')](_0x2ee3a7[_0x74b1('0x8f')](),{'type':db['sequelize'][_0x74b1('0x90')][_0x74b1('0x91')]})[_0x74b1('0x27')](function(_0x399c7c){if(_0x399c7c['length']===0x1){return _0x367373['id'];}else{var _0xe421dc=_[_0x74b1('0x92')](_[_0x74b1('0x2f')](_0x399c7c,_0x74b1('0x93')),function(_0x58896f){return _['includes'](_0x484368,_0x58896f);});if(_0xe421dc){return _0x367373['id'];}}}));}}return BPromise['all'](_0x1b3847)[_0x74b1('0x27')](function(_0x20f41b){_0xfcd9b=_(_0xfcd9b)['union'](_0x20f41b)['compact']()['value']();return db[_0x74b1('0x30')]['find']({'where':{'id':_0x1f2add[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](function(_0x1326b3){return db['sequelize'][_0x74b1('0x4e')](function(_0x155534){return _0x1326b3['removeTeams'](_0x1f2add[_0x74b1('0x32')][_0x74b1('0x72')],{'transaction':_0x155534})[_0x74b1('0x27')](function(){if(!_[_0x74b1('0x94')](_0xfcd9b)){return _0x1326b3['removeAgents'](_0xfcd9b,{'transaction':_0x155534});}})[_0x74b1('0x27')](function(){_0xfcd9b[_0x74b1('0x85')](function(_0x4a9046){socket[_0x74b1('0x75')]('userVoicePrefix:remove',{'UserId':_0x4a9046,'VoicePrefixId':_0x1326b3['id']});});});});});});})[_0x74b1('0x27')](respondWithStatusCode(_0x1ab4ea,null))[_0x74b1('0x45')](handleError(_0x1ab4ea,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 0548b0e..974191d 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 _0xae5d=['remove','emit','hook','exports','events','setMaxListeners','update'];(function(_0x2c569e,_0x221ac0){var _0x41db9f=function(_0x4fd0e7){while(--_0x4fd0e7){_0x2c569e['push'](_0x2c569e['shift']());}};_0x41db9f(++_0x221ac0);}(_0xae5d,0x169));var _0xdae5=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0xae5d[_0x13f980];return _0x27153c;};'use strict';var EventEmitter=require(_0xdae5('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xdae5('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdae5('0x2'),'afterDestroy':_0xdae5('0x3')};function emitEvent(_0x3b3881){return function(_0x47f9c7,_0x4c8be6,_0x1488d4){VoicePrefixEvents[_0xdae5('0x4')](_0x3b3881+':'+_0x47f9c7['id'],_0x47f9c7);VoicePrefixEvents[_0xdae5('0x4')](_0x3b3881,_0x47f9c7);_0x1488d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xdae5('0x5')](e,emitEvent(event));}}module[_0xdae5('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x5992=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','VoicePrefix'];(function(_0x413240,_0x2f8f26){var _0x4fd588=function(_0xc4773a){while(--_0xc4773a){_0x413240['push'](_0x413240['shift']());}};_0x4fd588(++_0x2f8f26);}(_0x5992,0x1ec));var _0x2599=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5992[_0x13b02f];return _0x12e9a6;};'use strict';var EventEmitter=require(_0x2599('0x0'));var VoicePrefix=require(_0x2599('0x1'))['db'][_0x2599('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2599('0x3')](0x0);var events={'afterCreate':_0x2599('0x4'),'afterUpdate':_0x2599('0x5'),'afterDestroy':_0x2599('0x6')};function emitEvent(_0x507990){return function(_0x46d3cf,_0x46d795,_0x2bfcaf){VoicePrefixEvents[_0x2599('0x7')](_0x507990+':'+_0x46d3cf['id'],_0x46d3cf);VoicePrefixEvents[_0x2599('0x7')](_0x507990,_0x46d3cf);_0x2bfcaf(null);};}for(var e in events){if(events[_0x2599('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 22a622c..10e9835 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 _0x32b0=['exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x57d2b9,_0xe46556){var _0x5e1339=function(_0x3c0133){while(--_0x3c0133){_0x57d2b9['push'](_0x57d2b9['shift']());}};_0x5e1339(++_0xe46556);}(_0x32b0,0xb5));var _0x032b=function(_0x3fc311,_0x35ce20){_0x3fc311=_0x3fc311-0x0;var _0x338281=_0x32b0[_0x3fc311];return _0x338281;};'use strict';var _=require(_0x032b('0x0'));var util=require(_0x032b('0x1'));var logger=require(_0x032b('0x2'))(_0x032b('0x3'));var moment=require(_0x032b('0x4'));var BPromise=require(_0x032b('0x5'));var rp=require(_0x032b('0x6'));var fs=require('fs');var path=require(_0x032b('0x7'));var rimraf=require(_0x032b('0x8'));var config=require(_0x032b('0x9'));var attributes=require(_0x032b('0xa'));module[_0x032b('0xb')]=function(_0x1a9fe4,_0x51906d){return _0x1a9fe4['define']('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e15=['./voicePrefix.attributes','exports','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x319050,_0x4ea414){var _0x4c0907=function(_0x1a644f){while(--_0x1a644f){_0x319050['push'](_0x319050['shift']());}};_0x4c0907(++_0x4ea414);}(_0x9e15,0x142));var _0x59e1=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x9e15[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x59e1('0x0'));var util=require(_0x59e1('0x1'));var logger=require('../../config/logger')(_0x59e1('0x2'));var moment=require(_0x59e1('0x3'));var BPromise=require(_0x59e1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59e1('0x5'));var rimraf=require(_0x59e1('0x6'));var config=require(_0x59e1('0x7'));var attributes=require(_0x59e1('0x8'));module[_0x59e1('0x9')]=function(_0x2eec34,_0x7a25ec){return _0x2eec34['define']('VoicePrefix',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 20cc6e3..917f8e2 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 _0x39e6=['message','result','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x585bc9,_0x35c5f0){var _0x449bbd=function(_0x3c07ee){while(--_0x3c07ee){_0x585bc9['push'](_0x585bc9['shift']());}};_0x449bbd(++_0x35c5f0);}(_0x39e6,0x9e));var _0x639e=function(_0x3028d9,_0x20d790){_0x3028d9=_0x3028d9-0x0;var _0xf5dcf0=_0x39e6[_0x3028d9];return _0xf5dcf0;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var moment=require(_0x639e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x639e('0x2'));var db=require(_0x639e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x639e('0x4'))(_0x639e('0x5'));var config=require(_0x639e('0x6'));var jayson=require(_0x639e('0x7'));var client=jayson[_0x639e('0x8')][_0x639e('0x9')]({'port':0x232a});config[_0x639e('0xa')]=_[_0x639e('0xb')](config[_0x639e('0xa')],{'host':_0x639e('0xc'),'port':0x18eb});var socket=require(_0x639e('0xd'))(new Redis(config[_0x639e('0xa')]));require(_0x639e('0xe'))[_0x639e('0xf')](socket);function respondWithRpcPromise(_0x15a8a6,_0x3dcb82,_0x46cfb6){return new BPromise(function(_0x3834a6,_0x5cf5c9){return client['request'](_0x15a8a6,_0x46cfb6)[_0x639e('0x10')](function(_0x42ea7f){logger[_0x639e('0x11')](_0x639e('0x12'),_0x3dcb82,_0x639e('0x13'));logger[_0x639e('0x14')](_0x639e('0x15'),_0x3dcb82,'request\x20sent',JSON['stringify'](_0x42ea7f));if(_0x42ea7f[_0x639e('0x16')]){if(_0x42ea7f[_0x639e('0x16')][_0x639e('0x17')]===0x1f4){logger[_0x639e('0x16')](_0x639e('0x12'),_0x3dcb82,_0x42ea7f[_0x639e('0x16')]['message']);return _0x5cf5c9(_0x42ea7f[_0x639e('0x16')][_0x639e('0x18')]);}logger[_0x639e('0x16')](_0x639e('0x12'),_0x3dcb82,_0x42ea7f['error'][_0x639e('0x18')]);return _0x3834a6(_0x42ea7f['error'][_0x639e('0x18')]);}else{logger[_0x639e('0x11')](_0x639e('0x12'),_0x3dcb82,_0x639e('0x13'));_0x3834a6(_0x42ea7f[_0x639e('0x19')][_0x639e('0x18')]);}})['catch'](function(_0x1e8310){logger[_0x639e('0x16')](_0x639e('0x12'),_0x3dcb82,_0x1e8310);_0x5cf5c9(_0x1e8310);});});} \ No newline at end of file +var _0xd3c8=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0xd3c8,0x161));var _0x8d3c=function(_0xeefca4,_0x5834fe){_0xeefca4=_0xeefca4-0x0;var _0x2927fb=_0xd3c8[_0xeefca4];return _0x2927fb;};'use strict';var _=require(_0x8d3c('0x0'));var util=require(_0x8d3c('0x1'));var moment=require(_0x8d3c('0x2'));var BPromise=require(_0x8d3c('0x3'));var rs=require(_0x8d3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d3c('0x5'))['db'];var utils=require(_0x8d3c('0x6'));var logger=require(_0x8d3c('0x7'))(_0x8d3c('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d3c('0x9'));var client=jayson[_0x8d3c('0xa')][_0x8d3c('0xb')]({'port':0x232a});config[_0x8d3c('0xc')]=_[_0x8d3c('0xd')](config[_0x8d3c('0xc')],{'host':_0x8d3c('0xe'),'port':0x18eb});var socket=require(_0x8d3c('0xf'))(new Redis(config[_0x8d3c('0xc')]));require(_0x8d3c('0x10'))['register'](socket);function respondWithRpcPromise(_0x566c3c,_0x5dff75,_0x4500ba){return new BPromise(function(_0x1c47ef,_0xf8e143){return client[_0x8d3c('0x11')](_0x566c3c,_0x4500ba)[_0x8d3c('0x12')](function(_0x6446fb){logger[_0x8d3c('0x13')](_0x8d3c('0x14'),_0x5dff75,_0x8d3c('0x15'));logger[_0x8d3c('0x16')](_0x8d3c('0x17'),_0x5dff75,_0x8d3c('0x15'),JSON[_0x8d3c('0x18')](_0x6446fb));if(_0x6446fb[_0x8d3c('0x19')]){if(_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1a')]===0x1f4){logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);return _0xf8e143(_0x6446fb['error'][_0x8d3c('0x1b')]);}logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);return _0x1c47ef(_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);}else{logger[_0x8d3c('0x13')](_0x8d3c('0x14'),_0x5dff75,_0x8d3c('0x15'));_0x1c47ef(_0x6446fb[_0x8d3c('0x1c')][_0x8d3c('0x1b')]);}})['catch'](function(_0x5cf870){logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x5cf870);_0xf8e143(_0x5cf870);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 5caa231..1fc14b9 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 _0x4065=['update','emit','removeListener','length'];(function(_0x45518f,_0x475a6b){var _0x198175=function(_0x40d333){while(--_0x40d333){_0x45518f['push'](_0x45518f['shift']());}};_0x198175(++_0x475a6b);}(_0x4065,0xdc));var _0x5406=function(_0x11fb9a,_0x568cde){_0x11fb9a=_0x11fb9a-0x0;var _0x1b836a=_0x4065[_0x11fb9a];return _0x1b836a;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save','remove',_0x5406('0x0')];function createListener(_0x582af0,_0x43096a){return function(_0x46186c){_0x43096a[_0x5406('0x1')](_0x582af0,_0x46186c);};}function removeListener(_0x5dde3e,_0xc5c0b5){return function(){VoicePrefixEvents[_0x5406('0x2')](_0x5dde3e,_0xc5c0b5);};}exports['register']=function(_0x1d2a1c){for(var _0x3bf3db=0x0,_0x2a6577=events[_0x5406('0x3')];_0x3bf3db<_0x2a6577;_0x3bf3db++){var _0x44f868=events[_0x3bf3db];var _0x3acd44=createListener('voicePrefix:'+_0x44f868,_0x1d2a1c);VoicePrefixEvents['on'](_0x44f868,_0x3acd44);}}; \ No newline at end of file +var _0x6d2e=['voicePrefix:','save','remove','update','register','length'];(function(_0x7e36d0,_0x332b85){var _0x4a5ea3=function(_0x1c0575){while(--_0x1c0575){_0x7e36d0['push'](_0x7e36d0['shift']());}};_0x4a5ea3(++_0x332b85);}(_0x6d2e,0x97));var _0xe6d2=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x6d2e[_0x59eefb];return _0x1a49e8;};'use strict';var VoicePrefixEvents=require('./voicePrefix.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(){VoicePrefixEvents['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);VoicePrefixEvents['on'](_0x53906e,_0x2e227e);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 0596f25..2afc772 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 _0x593e=['/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','addTeams','addLists','addBlackLists','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueue.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0x593e,0x1b1));var _0xe593=function(_0x42b7b7,_0x50c678){_0x42b7b7=_0x42b7b7-0x0;var _0x343124=_0x593e[_0x42b7b7];return _0x343124;};'use strict';var multer=require(_0xe593('0x0'));var util=require('util');var path=require(_0xe593('0x1'));var timeout=require(_0xe593('0x2'));var express=require(_0xe593('0x3'));var router=express[_0xe593('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe593('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe593('0x6'));var controller=require(_0xe593('0x7'));router['get']('/',auth[_0xe593('0x8')](),controller[_0xe593('0x9')]);router[_0xe593('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe593('0xb')]);router[_0xe593('0xa')](_0xe593('0xc'),auth[_0xe593('0x8')](),controller[_0xe593('0xd')]);router[_0xe593('0xa')]('/:id/hopper_histories',auth[_0xe593('0x8')](),controller[_0xe593('0xe')]);router['get'](_0xe593('0xf'),auth[_0xe593('0x8')](),controller[_0xe593('0x10')]);router[_0xe593('0xa')]('/:id/hopper_black',auth[_0xe593('0x8')](),controller[_0xe593('0x11')]);router[_0xe593('0xa')](_0xe593('0x12'),auth[_0xe593('0x8')](),controller[_0xe593('0x13')]);router[_0xe593('0xa')](_0xe593('0x14'),auth['isAuthenticated'](),controller[_0xe593('0x15')]);router[_0xe593('0xa')](_0xe593('0x16'),auth['isAuthenticated'](),controller[_0xe593('0x17')]);router[_0xe593('0xa')](_0xe593('0x18'),auth[_0xe593('0x8')](),controller[_0xe593('0x19')]);router[_0xe593('0xa')](_0xe593('0x1a'),auth[_0xe593('0x8')](),controller[_0xe593('0x1b')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe593('0x1c')]);router[_0xe593('0x1d')]('/:id/clone',auth[_0xe593('0x8')](),controller['clone']);router[_0xe593('0x1d')](_0xe593('0x12'),auth[_0xe593('0x8')](),controller[_0xe593('0x1e')]);router[_0xe593('0x1d')](_0xe593('0x14'),auth[_0xe593('0x8')](),controller['addAgents']);router[_0xe593('0x1d')](_0xe593('0x18'),auth[_0xe593('0x8')](),controller[_0xe593('0x1f')]);router[_0xe593('0x1d')](_0xe593('0x1a'),auth[_0xe593('0x8')](),controller[_0xe593('0x20')]);router['put'](_0xe593('0x21'),auth[_0xe593('0x8')](),controller[_0xe593('0x22')]);router[_0xe593('0x23')](_0xe593('0x21'),auth[_0xe593('0x8')](),controller['destroy']);router[_0xe593('0x23')](_0xe593('0x12'),auth[_0xe593('0x8')](),controller[_0xe593('0x24')]);router[_0xe593('0x23')](_0xe593('0x14'),auth[_0xe593('0x8')](),controller[_0xe593('0x25')]);router[_0xe593('0x23')](_0xe593('0x18'),auth[_0xe593('0x8')](),controller[_0xe593('0x26')]);router[_0xe593('0x23')](_0xe593('0x1a'),auth[_0xe593('0x8')](),controller[_0xe593('0x27')]);module[_0xe593('0x28')]=router; \ No newline at end of file +var _0x1db7=['/:id/blacklists','addBlackLists','put','/:id','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/users','getAgents','/:id/members','getMembers','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addAgents','/:id/lists'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x1db7,0x131));var _0x71db=function(_0x11d8e4,_0x33e1bd){_0x11d8e4=_0x11d8e4-0x0;var _0x28b1ca=_0x1db7[_0x11d8e4];return _0x28b1ca;};'use strict';var multer=require(_0x71db('0x0'));var util=require('util');var path=require(_0x71db('0x1'));var timeout=require(_0x71db('0x2'));var express=require(_0x71db('0x3'));var router=express[_0x71db('0x4')]();var fs_extra=require(_0x71db('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x71db('0x6'));var controller=require(_0x71db('0x7'));router[_0x71db('0x8')]('/',auth['isAuthenticated'](),controller[_0x71db('0x9')]);router[_0x71db('0x8')]('/:id',auth[_0x71db('0xa')](),controller['show']);router[_0x71db('0x8')](_0x71db('0xb'),auth[_0x71db('0xa')](),controller[_0x71db('0xc')]);router[_0x71db('0x8')]('/:id/hopper_histories',auth[_0x71db('0xa')](),controller[_0x71db('0xd')]);router[_0x71db('0x8')](_0x71db('0xe'),auth[_0x71db('0xa')](),controller[_0x71db('0xf')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x71db('0x10')]);router[_0x71db('0x8')]('/:id/teams',auth[_0x71db('0xa')](),controller['getTeams']);router[_0x71db('0x8')](_0x71db('0x11'),auth[_0x71db('0xa')](),controller[_0x71db('0x12')]);router['get'](_0x71db('0x13'),auth[_0x71db('0xa')](),controller[_0x71db('0x14')]);router[_0x71db('0x8')]('/:id/lists',auth[_0x71db('0xa')](),controller[_0x71db('0x15')]);router[_0x71db('0x8')]('/:id/blacklists',auth[_0x71db('0xa')](),controller[_0x71db('0x16')]);router[_0x71db('0x17')]('/',auth[_0x71db('0xa')](),controller[_0x71db('0x18')]);router[_0x71db('0x17')](_0x71db('0x19'),auth[_0x71db('0xa')](),controller[_0x71db('0x1a')]);router[_0x71db('0x17')](_0x71db('0x1b'),auth['isAuthenticated'](),controller[_0x71db('0x1c')]);router[_0x71db('0x17')](_0x71db('0x11'),auth[_0x71db('0xa')](),controller[_0x71db('0x1d')]);router[_0x71db('0x17')](_0x71db('0x1e'),auth['isAuthenticated'](),controller['addLists']);router[_0x71db('0x17')](_0x71db('0x1f'),auth[_0x71db('0xa')](),controller[_0x71db('0x20')]);router[_0x71db('0x21')](_0x71db('0x22'),auth[_0x71db('0xa')](),controller['update']);router[_0x71db('0x23')](_0x71db('0x22'),auth[_0x71db('0xa')](),controller[_0x71db('0x24')]);router['delete'](_0x71db('0x1b'),auth['isAuthenticated'](),controller[_0x71db('0x25')]);router['delete'](_0x71db('0x11'),auth[_0x71db('0xa')](),controller[_0x71db('0x26')]);router[_0x71db('0x23')]('/:id/lists',auth[_0x71db('0xa')](),controller[_0x71db('0x27')]);router[_0x71db('0x23')](_0x71db('0x1f'),auth[_0x71db('0xa')](),controller[_0x71db('0x28')]);module[_0x71db('0x29')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index e8ecc4d..f325d6a 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 _0x0683=['dialMethod','booked','progressive','power','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','Active/Disactive\x20Campaign','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','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','exports','name','ENUM','outbound','inbound','STRING','default','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0683,0xe1));var _0x3068=function(_0x40eec0,_0x3a728c){_0x40eec0=_0x40eec0-0x0;var _0x2de215=_0x0683[_0x40eec0];return _0x2de215;};'use strict';var Sequelize=require('sequelize');module[_0x3068('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3068('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3068('0x2')]('inbound',_0x3068('0x3')),'allowNull':![],'defaultValue':_0x3068('0x4')},'musiconhold':{'type':Sequelize[_0x3068('0x5')],'defaultValue':_0x3068('0x6')},'announce':{'type':Sequelize[_0x3068('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3068('0x2')]('rr','ringall',_0x3068('0x7'),_0x3068('0x8'),'random',_0x3068('0x9'),_0x3068('0xa'),_0x3068('0xb'),_0x3068('0xc')),'allowNull':![],'defaultValue':_0x3068('0xd'),'set':function(_0x2a5f00){this[_0x3068('0xe')](_0x3068('0xf'),_0x2a5f00?_0x2a5f00:'rrmemory');},'get':function(){var _0x1324ec=this[_0x3068('0x10')](_0x3068('0x11'));var _0x31271a=this[_0x3068('0x10')](_0x3068('0x12'));var _0x22098b=this['getDataValue'](_0x3068('0xf'));if(_0x1324ec===_0x3068('0x4')){return _0x22098b;}if(_0x31271a===_0x3068('0x13')&&_0x22098b===_0x3068('0x9')||_0x31271a===_0x3068('0x13')&&_0x22098b==='roundrobin'){return _0x22098b;}if(_0x31271a===_0x3068('0x14')||_0x31271a==='predictive'||_0x31271a===_0x3068('0x15')){return _0x22098b;}return null;}},'servicelevel':{'type':Sequelize[_0x3068('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3068('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x3068('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3068('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x3068('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3068('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x3068('0x17'),'no'),'defaultValue':_0x3068('0x17')},'autopause':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x3068('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3068('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3068('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3068('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3068('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x3068('0x17'),'no'),'defaultValue':_0x3068('0x17')},'announce_holdtime':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x17'),'no',_0x3068('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3068('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3068('0x2')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x3068('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3068('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3068('0x5')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3068('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3068('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3068('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3068('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3068('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3068('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3068('0x5')]},'queue_quantity1':{'type':Sequelize[_0x3068('0x5')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x3068('0x19')],'set':function(_0x3c9dfa){this[_0x3068('0xe')](_0x3068('0x1a'),_0x3c9dfa?_0x3c9dfa[_0x3068('0x1b')](','):[]);},'get':function(){return this[_0x3068('0x10')](_0x3068('0x1a'))?this[_0x3068('0x10')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x3068('0x5')],'defaultValue':_0x3068('0x17'),'set':function(_0x42f5e8){this[_0x3068('0xe')](_0x3068('0x1c'),_0x42f5e8?_0x42f5e8['join'](','):undefined);},'get':function(){return this[_0x3068('0x10')](_0x3068('0x1c'))?this['getDataValue'](_0x3068('0x1c'))[_0x3068('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4ab2a2){this['setDataValue'](_0x3068('0x1e'),_0x4ab2a2?_0x4ab2a2[_0x3068('0x1b')](','):undefined);},'get':function(){return this[_0x3068('0x10')]('leavewhenempty')?this['getDataValue'](_0x3068('0x1e'))[_0x3068('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x3068('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3068('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x3068('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3068('0x5')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x3068('0x1f')],'defaultValue':0x0,'set':function(_0x4c6004){this['setDataValue'](_0x3068('0x20'),_0x4c6004);if(_0x4c6004){if(this[_0x3068('0x10')]('wrapuptime')<0x2){this[_0x3068('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3068('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3068('0x1f')],'defaultValue':0x0,'comment':_0x3068('0x21')},'dialMethod':{'type':Sequelize[_0x3068('0x2')]('preview',_0x3068('0x14'),_0x3068('0x15'),_0x3068('0x22'),_0x3068('0x13')),'defaultValue':_0x3068('0x14'),'comment':_0x3068('0x23')},'dialLimitChannel':{'type':Sequelize[_0x3068('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3068('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x3068('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3068('0x26')},'dialPowerLevel':{'type':Sequelize[_0x3068('0x27')](0x2)[_0x3068('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3068('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x29'),_0x3068('0x2a')),'defaultValue':_0x3068('0x2a'),'comment':_0x3068('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x3068('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3068('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3068('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3068('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3068('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x3068('0x16')](0x3)[_0x3068('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3068('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x3068('0x5')],'defaultValue':_0x3068('0x2f'),'comment':_0x3068('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x3068('0x16')](0x3)[_0x3068('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x3068('0x5')],'comment':_0x3068('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3068('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3068('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3068('0x16')](0x5)[_0x3068('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3068('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x3068('0x16')](0x3)[_0x3068('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3068('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3068('0x16')](0x5)[_0x3068('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3068('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3068('0x16')](0x3)[_0x3068('0x25')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3068('0x16')](0x5)[_0x3068('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3068('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3068('0x16')](0x3)[_0x3068('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3068('0x37')},'dialTimezone':{'type':Sequelize[_0x3068('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x3068('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x38'),'never',_0x3068('0x39')),'defaultValue':_0x3068('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3068('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x3068('0x16')](0x9)[_0x3068('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x3068('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3068('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3068('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3068('0x16')](0x9)[_0x3068('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3068('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3068('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3068('0x16')](0x9)[_0x3068('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3068('0x16')](0x9)[_0x3068('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x3068('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3068('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x3068('0x16')](0x5)[_0x3068('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3068('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x3068('0x1f')],'defaultValue':0x0,'comment':_0x3068('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3068('0x2')](_0x3068('0x41'),_0x3068('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x3068('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3068('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3068('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3068('0x16')](0x3)[_0x3068('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x3068('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3068('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3068('0x16')](0x3)[_0x3068('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3068('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3068('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3068('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3068('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x3068('0x16')](0x5)[_0x3068('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3068('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3068('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3068('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3068('0x16')](0x5)[_0x3068('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3068('0x48')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3068('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3068('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3068('0x16')](0x5)[_0x3068('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3068('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3068('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3068('0x16')](0x5)[_0x3068('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3068('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3068('0x16')],'allowNull':!![],'comment':_0x3068('0x4d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3068('0x4e'),'set':function(_0x2325c0){if(!_0x2325c0)this['setDataValue'](_0x3068('0x4f'),null);this[_0x3068('0xe')](_0x3068('0x50'),_0x2325c0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3068('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x4d61=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','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)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\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)'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4d61,0x147));var _0x14d6=function(_0x55d91,_0x351fae){_0x55d91=_0x55d91-0x0;var _0x46d0b3=_0x4d61[_0x55d91];return _0x46d0b3;};'use strict';var Sequelize=require(_0x14d6('0x0'));module[_0x14d6('0x1')]={'name':{'type':Sequelize[_0x14d6('0x2')],'allowNull':![],'unique':_0x14d6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x5'),_0x14d6('0x6')),'allowNull':![],'defaultValue':_0x14d6('0x5')},'musiconhold':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x14d6('0x4')]('rr',_0x14d6('0x7'),_0x14d6('0x8'),_0x14d6('0x9'),_0x14d6('0xa'),_0x14d6('0xb'),'linear',_0x14d6('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0x14d6('0x7'),'set':function(_0x590979){this[_0x14d6('0xd')](_0x14d6('0xe'),_0x590979?_0x590979:'rrmemory');},'get':function(){var _0x16db02=this[_0x14d6('0xf')](_0x14d6('0x10'));var _0x1c2baf=this[_0x14d6('0xf')](_0x14d6('0x11'));var _0x36a070=this[_0x14d6('0xf')](_0x14d6('0xe'));if(_0x16db02===_0x14d6('0x5')){return _0x36a070;}if(_0x1c2baf===_0x14d6('0x12')&&_0x36a070==='rrmemory'||_0x1c2baf===_0x14d6('0x12')&&_0x36a070===_0x14d6('0x13')){return _0x36a070;}if(_0x1c2baf===_0x14d6('0x14')||_0x1c2baf===_0x14d6('0x15')||_0x1c2baf===_0x14d6('0x16')){return _0x36a070;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x14d6('0x17')](0xb)},'timeout':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x14d6('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x14d6('0x4')]('yes','no'),'defaultValue':_0x14d6('0x18')},'autopause':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no',_0x14d6('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x14d6('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x14d6('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x14d6('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':_0x14d6('0x18')},'announce_holdtime':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x14d6('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x14d6('0x2')]},'queue_youarenext':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x14d6('0x2')]},'queue_quantity1':{'type':Sequelize[_0x14d6('0x2')]},'queue_quantity2':{'type':Sequelize[_0x14d6('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x14d6('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x15d098){this[_0x14d6('0xd')](_0x14d6('0x1a'),_0x15d098?_0x15d098[_0x14d6('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x14d6('0x1a'))?this[_0x14d6('0xf')](_0x14d6('0x1a'))[_0x14d6('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'yes','set':function(_0xde044d){this['setDataValue'](_0x14d6('0x1d'),_0xde044d?_0xde044d[_0x14d6('0x1b')](','):undefined);},'get':function(){return this[_0x14d6('0xf')](_0x14d6('0x1d'))?this[_0x14d6('0xf')](_0x14d6('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'no','set':function(_0x1e4a29){this[_0x14d6('0xd')](_0x14d6('0x1e'),_0x1e4a29?_0x1e4a29[_0x14d6('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x14d6('0x1e'))?this[_0x14d6('0xf')](_0x14d6('0x1e'))[_0x14d6('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x14d6('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'set':function(_0xd31054){this['setDataValue']('acw',_0xd31054);if(_0xd31054){if(this[_0x14d6('0xf')]('wrapuptime')<0x2){this[_0x14d6('0xd')](_0x14d6('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x21'),_0x14d6('0x14'),_0x14d6('0x16'),'predictive',_0x14d6('0x12')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x14d6('0x17')](0x4)[_0x14d6('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14d6('0x23')},'dialLimitQueue':{'type':Sequelize[_0x14d6('0x17')](0x4)[_0x14d6('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14d6('0x24')},'dialPowerLevel':{'type':Sequelize[_0x14d6('0x25')](0x2)[_0x14d6('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x14d6('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x27'),_0x14d6('0x28')),'defaultValue':_0x14d6('0x28'),'comment':_0x14d6('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x14d6('0x25')](0x2)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x14d6('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x14d6('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x14d6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x14d6('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':_0x14d6('0x2d'),'comment':_0x14d6('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x2f')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x14d6('0x34')},'dialTimezone':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x14d6('0x35')},'dialPrefix':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x36'),'never',_0x14d6('0x37')),'defaultValue':_0x14d6('0x36')},'dialAMDActive':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'comment':_0x14d6('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x14d6('0x17')](0x9)[_0x14d6('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x14d6('0x39')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x14d6('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x14d6('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x14d6('0x17')](0x9)[_0x14d6('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x14d6('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x14d6('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14d6('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x14d6('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x14d6('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x14d6('0x17')](0x9)[_0x14d6('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x14d6('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x14d6('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14d6('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x14d6('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'comment':_0x14d6('0x41')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x14d6('0x42'),'ASC'),'defaultValue':_0x14d6('0x42')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14d6('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x14d6('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14d6('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x46')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x14d6('0x17')],'allowNull':!![],'comment':_0x14d6('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':![],'comment':_0x14d6('0x4f'),'set':function(_0x43bcf3){if(!_0x43bcf3)this[_0x14d6('0xd')](_0x14d6('0x50'),null);this[_0x14d6('0xd')]('mandatoryDisposition',_0x43bcf3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x14d6('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x14d6('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 0576a28..a73d817 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 _0xfe70=['error','stack','send','index','VoiceQueue','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','user','outbound','getHoppers','findOne','CmHopper','pick','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','CmHopperBlack','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','each','UserVoiceQueueRt','format','userVoiceQueue:save','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','ids','emit','userVoiceQueue:remove','addAgents','spread','isEmpty','isNil','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','into','cm_contacts','removeLists','getBlackLists','addBlackLists','insert','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','QueueCampaigns','filter','ignore','map','value','find','name'];(function(_0x524662,_0x283658){var _0x4f1391=function(_0x147e23){while(--_0x147e23){_0x524662['push'](_0x524662['shift']());}};_0x4f1391(++_0x283658);}(_0xfe70,0x139));var _0x0fe7=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0xfe70[_0x5dee2a];return _0x31e98e;};'use strict';var emlformat=require(_0x0fe7('0x0'));var rimraf=require(_0x0fe7('0x1'));var zipdir=require(_0x0fe7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fe7('0x3'));var moment=require(_0x0fe7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0fe7('0x5'));var util=require('util');var path=require(_0x0fe7('0x6'));var sox=require(_0x0fe7('0x7'));var csv=require(_0x0fe7('0x8'));var ejs=require(_0x0fe7('0x9'));var fs=require('fs');var fs_extra=require(_0x0fe7('0xa'));var _=require(_0x0fe7('0xb'));var squel=require(_0x0fe7('0xc'));var crypto=require(_0x0fe7('0xd'));var jsforce=require(_0x0fe7('0xe'));var deskjs=require(_0x0fe7('0xf'));var toCsv=require(_0x0fe7('0x8'));var querystring=require(_0x0fe7('0x10'));var Papa=require('papaparse');var Redis=require(_0x0fe7('0x11'));var authService=require(_0x0fe7('0x12'));var qs=require(_0x0fe7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fe7('0x14'));var logger=require(_0x0fe7('0x15'))('api');var utils=require(_0x0fe7('0x16'));var config=require(_0x0fe7('0x17'));var licenseUtil=require(_0x0fe7('0x18'));var db=require(_0x0fe7('0x19'))['db'];config[_0x0fe7('0x1a')]=_[_0x0fe7('0x1b')](config[_0x0fe7('0x1a')],{'host':_0x0fe7('0x1c'),'port':0x18eb});var socket=require(_0x0fe7('0x1d'))(new Redis(config['redis']));require(_0x0fe7('0x1e'))['register'](socket);function respondWithStatusCode(_0x757146,_0x18bd19){_0x18bd19=_0x18bd19||0xcc;return function(_0x2e400c){if(_0x2e400c){return _0x757146['sendStatus'](_0x18bd19);}return _0x757146[_0x0fe7('0x1f')](_0x18bd19)[_0x0fe7('0x20')]();};}function respondWithResult(_0x165c37,_0x53f721){_0x53f721=_0x53f721||0xc8;return function(_0x140723){if(_0x140723){return _0x165c37[_0x0fe7('0x1f')](_0x53f721)[_0x0fe7('0x21')](_0x140723);}};}function respondWithFilteredResult(_0x5e2223,_0x48a08e){return function(_0x7bd321){if(_0x7bd321){var _0x214f74=typeof _0x48a08e['offset']===_0x0fe7('0x22')&&typeof _0x48a08e[_0x0fe7('0x23')]===_0x0fe7('0x22');var _0xf45486=_0x7bd321[_0x0fe7('0x24')];var _0x11fb4e=_0x214f74?0x0:_0x48a08e['offset'];var _0x3ceff1=_0x214f74?_0x7bd321['count']:_0x48a08e['offset']+_0x48a08e[_0x0fe7('0x23')];var _0x3ebad1;if(_0x3ceff1>=_0xf45486){_0x3ceff1=_0xf45486;_0x3ebad1=0xc8;}else{_0x3ebad1=0xce;}_0x5e2223[_0x0fe7('0x1f')](_0x3ebad1);return _0x5e2223[_0x0fe7('0x25')](_0x0fe7('0x26'),_0x11fb4e+'-'+_0x3ceff1+'/'+_0xf45486)['json'](_0x7bd321);}return null;};}function patchUpdates(_0x395252){return function(_0x340c13){try{jsonpatch[_0x0fe7('0x27')](_0x340c13,_0x395252,!![]);}catch(_0x552d53){return BPromise[_0x0fe7('0x28')](_0x552d53);}return _0x340c13[_0x0fe7('0x29')]();};}function saveUpdates(_0x5a1d72,_0x30dcd8){return function(_0x3bb625){if(_0x3bb625){return _0x3bb625[_0x0fe7('0x2a')](_0x5a1d72)[_0x0fe7('0x2b')](function(_0x2a7788){return _0x2a7788;});}return null;};}function removeEntity(_0x1995bf,_0x4e3753){return function(_0x38c4c1){if(_0x38c4c1){return _0x38c4c1[_0x0fe7('0x2c')]()[_0x0fe7('0x2b')](function(){var _0x393ada=_0x38c4c1['get']({'plain':!![]});var _0x49be29=[{'name':_0x0fe7('0x2d'),'value':'inbound','ignore':![]},{'name':_0x0fe7('0x2e'),'value':'outbound','ignore':![]}];var _0x2dd9a9=_(_0x49be29)[_0x0fe7('0x2f')](_0x0fe7('0x30'))[_0x0fe7('0x31')]('value')[_0x0fe7('0x32')]();if(_['includes'](_0x2dd9a9,_0x393ada['type'])){return;}var _0x1d110d=_[_0x0fe7('0x33')](_0x49be29,[_0x0fe7('0x32'),_0x393ada['type']])[_0x0fe7('0x34')];return db['UserProfileResource']['destroy']({'where':{'type':_0x1d110d,'resourceId':_0x393ada['id']}})['then'](function(){return _0x38c4c1;});})[_0x0fe7('0x2b')](function(){_0x1995bf[_0x0fe7('0x1f')](0xcc)[_0x0fe7('0x20')]();});}};}function handleEntityNotFound(_0x54acbf,_0x429661){return function(_0x20babd){if(!_0x20babd){_0x54acbf['sendStatus'](0x194);}return _0x20babd;};}function handleError(_0x143ac2,_0x320c29){_0x320c29=_0x320c29||0x1f4;return function(_0x28831f){logger[_0x0fe7('0x35')](_0x28831f[_0x0fe7('0x36')]);if(_0x28831f[_0x0fe7('0x34')]){delete _0x28831f[_0x0fe7('0x34')];}_0x143ac2[_0x0fe7('0x1f')](_0x320c29)[_0x0fe7('0x37')](_0x28831f);};}exports[_0x0fe7('0x38')]=function(_0x154925,_0x4d4c67){var _0xc4eaa={},_0x1a15e2={},_0x4010a0={'count':0x0,'rows':[]};var _0x42c622=_['map'](db[_0x0fe7('0x39')][_0x0fe7('0x3a')],function(_0x5dde3d){return{'name':_0x5dde3d[_0x0fe7('0x3b')],'type':_0x5dde3d[_0x0fe7('0x3c')][_0x0fe7('0x3d')]};});_0x1a15e2['model']=_['map'](_0x42c622,_0x0fe7('0x34'));_0x1a15e2[_0x0fe7('0x3e')]=_[_0x0fe7('0x3f')](_0x154925[_0x0fe7('0x3e')]);_0x1a15e2['filters']=_[_0x0fe7('0x40')](_0x1a15e2[_0x0fe7('0x41')],_0x1a15e2[_0x0fe7('0x3e')]);_0xc4eaa['attributes']=_[_0x0fe7('0x40')](_0x1a15e2[_0x0fe7('0x41')],qs[_0x0fe7('0x42')](_0x154925[_0x0fe7('0x3e')][_0x0fe7('0x42')]));_0xc4eaa[_0x0fe7('0x43')]=_0xc4eaa[_0x0fe7('0x43')][_0x0fe7('0x44')]?_0xc4eaa[_0x0fe7('0x43')]:_0x1a15e2[_0x0fe7('0x41')];if(!_0x154925['query'][_0x0fe7('0x45')](_0x0fe7('0x46'))){_0xc4eaa[_0x0fe7('0x23')]=qs[_0x0fe7('0x23')](_0x154925[_0x0fe7('0x3e')][_0x0fe7('0x23')]);_0xc4eaa['offset']=qs[_0x0fe7('0x47')](_0x154925[_0x0fe7('0x3e')][_0x0fe7('0x47')]);}_0xc4eaa[_0x0fe7('0x48')]=qs['sort'](_0x154925[_0x0fe7('0x3e')][_0x0fe7('0x49')]);_0xc4eaa[_0x0fe7('0x4a')]=qs[_0x0fe7('0x4b')](_['pick'](_0x154925['query'],_0x1a15e2[_0x0fe7('0x4b')]),_0x42c622);if(_0x154925[_0x0fe7('0x3e')][_0x0fe7('0x2f')]){_0xc4eaa[_0x0fe7('0x4a')]=_['merge'](_0xc4eaa[_0x0fe7('0x4a')],{'$or':_['map'](_0x42c622,function(_0x5dde47){if(_0x5dde47[_0x0fe7('0x3c')]!==_0x0fe7('0x4c')){var _0x2ff6cc={};_0x2ff6cc[_0x5dde47[_0x0fe7('0x34')]]={'$like':'%'+_0x154925[_0x0fe7('0x3e')]['filter']+'%'};return _0x2ff6cc;}})});}_0xc4eaa=_[_0x0fe7('0x4d')]({},_0xc4eaa,_0x154925[_0x0fe7('0x4e')]);var _0xd92a93={'where':_0xc4eaa[_0x0fe7('0x4a')]};return db['VoiceQueue'][_0x0fe7('0x24')](_0xd92a93)['then'](function(_0x4b31d4){_0x4010a0[_0x0fe7('0x24')]=_0x4b31d4;if(_0x154925['query'][_0x0fe7('0x4f')]){_0xc4eaa['include']=[{'all':!![]}];}return db[_0x0fe7('0x39')]['findAll'](_0xc4eaa);})[_0x0fe7('0x2b')](function(_0x36691c){_0x4010a0[_0x0fe7('0x50')]=_0x36691c;return _0x4010a0;})[_0x0fe7('0x2b')](respondWithFilteredResult(_0x4d4c67,_0xc4eaa))[_0x0fe7('0x51')](handleError(_0x4d4c67,null));};exports[_0x0fe7('0x52')]=function(_0x5d5d17,_0x55e672){var _0x4ddf37={'raw':![],'where':{'id':_0x5d5d17[_0x0fe7('0x53')]['id']}},_0x66ce56={};_0x66ce56[_0x0fe7('0x41')]=_['keys'](db[_0x0fe7('0x39')]['rawAttributes']);_0x66ce56[_0x0fe7('0x3e')]=_[_0x0fe7('0x3f')](_0x5d5d17[_0x0fe7('0x3e')]);_0x66ce56[_0x0fe7('0x4b')]=_['intersection'](_0x66ce56[_0x0fe7('0x41')],_0x66ce56[_0x0fe7('0x3e')]);_0x4ddf37[_0x0fe7('0x43')]=_[_0x0fe7('0x40')](_0x66ce56[_0x0fe7('0x41')],qs[_0x0fe7('0x42')](_0x5d5d17['query'][_0x0fe7('0x42')]));_0x4ddf37[_0x0fe7('0x43')]=_0x4ddf37['attributes'][_0x0fe7('0x44')]?_0x4ddf37[_0x0fe7('0x43')]:_0x66ce56[_0x0fe7('0x41')];if(_0x5d5d17[_0x0fe7('0x3e')]['includeAll']){_0x4ddf37[_0x0fe7('0x54')]=[{'all':!![]}];}_0x4ddf37=_[_0x0fe7('0x4d')]({},_0x4ddf37,_0x5d5d17[_0x0fe7('0x4e')]);return db[_0x0fe7('0x39')][_0x0fe7('0x33')](_0x4ddf37)[_0x0fe7('0x2b')](handleEntityNotFound(_0x55e672,null))['then'](respondWithResult(_0x55e672,null))[_0x0fe7('0x51')](handleError(_0x55e672,null));};exports[_0x0fe7('0x55')]=function(_0x3d67b5,_0x281e77){return db['VoiceQueue'][_0x0fe7('0x55')](_0x3d67b5[_0x0fe7('0x56')],{})[_0x0fe7('0x2b')](function(_0x545f5e){var _0x5632e2=_0x3d67b5['user']['get']({'plain':!![]});if(!_0x5632e2)throw new Error(_0x0fe7('0x57'));if(_0x5632e2[_0x0fe7('0x58')]==='user'){var _0x3c5e73=_0x545f5e[_0x0fe7('0x59')]({'plain':!![]});var _0xea8e13=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x0fe7('0x2e'),'value':'outbound'}];var _0x4b4533=_[_0x0fe7('0x33')](_0xea8e13,['value',_0x3c5e73['type']])[_0x0fe7('0x34')];return db[_0x0fe7('0x5a')][_0x0fe7('0x33')]({'where':{'name':_0x4b4533,'userProfileId':_0x5632e2[_0x0fe7('0x5b')]},'raw':!![]})[_0x0fe7('0x2b')](function(_0x4ecaae){if(_0x4ecaae&&_0x4ecaae[_0x0fe7('0x5c')]===0x0){return db[_0x0fe7('0x5d')][_0x0fe7('0x55')]({'name':_0x3c5e73['name'],'resourceId':_0x3c5e73['id'],'type':_0x4ecaae[_0x0fe7('0x34')],'sectionId':_0x4ecaae['id']},{})[_0x0fe7('0x2b')](function(){return _0x545f5e;});}else{return _0x545f5e;}})['catch'](function(_0x568815){logger[_0x0fe7('0x35')](_0x0fe7('0x5e'),_0x568815);throw _0x568815;});}return _0x545f5e;})[_0x0fe7('0x2b')](respondWithResult(_0x281e77,0xc9))[_0x0fe7('0x51')](handleError(_0x281e77,null));};exports[_0x0fe7('0x5f')]=function(_0x458b14,_0x4bdeec){var _0x3efb37={'where':{'id':_0x458b14[_0x0fe7('0x53')]['id']}},_0xfee92f={};_0xfee92f[_0x0fe7('0x41')]=_[_0x0fe7('0x3f')](db[_0x0fe7('0x39')][_0x0fe7('0x3a')]);_0x3efb37['attributes']=_[_0x0fe7('0x40')](_0xfee92f[_0x0fe7('0x41')],qs['fields'](_0x458b14['query']['fields']));_0x3efb37[_0x0fe7('0x43')]=_0x3efb37[_0x0fe7('0x43')][_0x0fe7('0x44')]?_0x3efb37[_0x0fe7('0x43')]:_0xfee92f[_0x0fe7('0x41')];if(_0x458b14[_0x0fe7('0x3e')][_0x0fe7('0x4f')]){_0x3efb37[_0x0fe7('0x54')]=[{'all':!![]}];}_0x3efb37=_['merge']({},_0x3efb37,_0x458b14[_0x0fe7('0x4e')]);return db[_0x0fe7('0x39')]['find'](_0x3efb37)['then'](handleEntityNotFound(_0x4bdeec,null))[_0x0fe7('0x2b')](function(_0x3231f0){if(_0x3231f0){var _0x59e856=_0x3231f0['get']({'plain':!![]});_0x59e856=qs['omit'](_0x59e856,['id','createdAt',_0x0fe7('0x60')]);_0x458b14[_0x0fe7('0x56')]=_[_0x0fe7('0x61')](_0x458b14[_0x0fe7('0x56')],['id',_0x0fe7('0x62'),_0x0fe7('0x60')]);return db[_0x0fe7('0x39')]['create'](_[_0x0fe7('0x4d')](_0x59e856,_0x458b14[_0x0fe7('0x56')]),{'include':_0x458b14[_0x0fe7('0x3e')][_0x0fe7('0x4f')]?[{'all':!![]}]:undefined})[_0x0fe7('0x2b')](function(_0x52b460){var _0x31f469=_0x458b14['user'][_0x0fe7('0x59')]({'plain':!![]});if(!_0x31f469)throw new Error(_0x0fe7('0x57'));if(_0x31f469[_0x0fe7('0x58')]===_0x0fe7('0x63')){var _0x4748ee=_0x52b460[_0x0fe7('0x59')]({'plain':!![]});var _0x2fbe35=[{'name':_0x0fe7('0x2d'),'value':'inbound'},{'name':_0x0fe7('0x2e'),'value':_0x0fe7('0x64')}];var _0x5816fe=_[_0x0fe7('0x33')](_0x2fbe35,[_0x0fe7('0x32'),_0x4748ee[_0x0fe7('0x3c')]])['name'];return db[_0x0fe7('0x5a')]['find']({'where':{'name':_0x5816fe,'userProfileId':_0x31f469['userProfileId']},'raw':!![]})[_0x0fe7('0x2b')](function(_0x5cc1bb){if(_0x5cc1bb&&_0x5cc1bb[_0x0fe7('0x5c')]===0x0){return db[_0x0fe7('0x5d')][_0x0fe7('0x55')]({'name':_0x4748ee[_0x0fe7('0x34')],'resourceId':_0x4748ee['id'],'type':_0x5cc1bb[_0x0fe7('0x34')],'sectionId':_0x5cc1bb['id']},{})[_0x0fe7('0x2b')](function(){return _0x52b460;});}else{return _0x52b460;}})[_0x0fe7('0x51')](function(_0x45e14e){logger[_0x0fe7('0x35')](_0x0fe7('0x5e'),_0x45e14e);throw _0x45e14e;});}return _0x52b460;});}})['then'](respondWithResult(_0x4bdeec,0xc9))['catch'](handleError(_0x4bdeec,null));};exports[_0x0fe7('0x2a')]=function(_0x46429e,_0x193aff){if(_0x46429e[_0x0fe7('0x56')]['id']){delete _0x46429e[_0x0fe7('0x56')]['id'];}return db[_0x0fe7('0x39')][_0x0fe7('0x33')]({'where':{'id':_0x46429e[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x193aff,null))[_0x0fe7('0x2b')](saveUpdates(_0x46429e[_0x0fe7('0x56')],null))['then'](respondWithResult(_0x193aff,null))['catch'](handleError(_0x193aff,null));};exports[_0x0fe7('0x2c')]=function(_0x4d5ee7,_0x4fa8d2){return db[_0x0fe7('0x39')]['find']({'where':{'id':_0x4d5ee7['params']['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x4fa8d2,null))['then'](removeEntity(_0x4fa8d2,null))[_0x0fe7('0x51')](handleError(_0x4fa8d2,null));};exports[_0x0fe7('0x65')]=function(_0x21375c,_0x1917ea,_0x830111){var _0x50f4b9={'raw':![],'where':{}};var _0x4128ae={};var _0x351f5b={'count':0x0,'rows':[]};return db[_0x0fe7('0x39')][_0x0fe7('0x66')]({'where':{'id':_0x21375c[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x1917ea,null))['then'](function(_0x37071d){if(_0x37071d){_0x4128ae[_0x0fe7('0x41')]=_['keys'](db[_0x0fe7('0x67')][_0x0fe7('0x3a')]);_0x4128ae[_0x0fe7('0x3e')]=_['keys'](_0x21375c[_0x0fe7('0x3e')]);_0x4128ae[_0x0fe7('0x4b')]=_[_0x0fe7('0x40')](_0x4128ae[_0x0fe7('0x41')],_0x4128ae[_0x0fe7('0x3e')]);_0x50f4b9[_0x0fe7('0x43')]=_[_0x0fe7('0x40')](_0x4128ae['model'],qs[_0x0fe7('0x42')](_0x21375c[_0x0fe7('0x3e')][_0x0fe7('0x42')]));_0x50f4b9[_0x0fe7('0x43')]=_0x50f4b9['attributes'][_0x0fe7('0x44')]?_0x50f4b9['attributes']:_0x4128ae[_0x0fe7('0x41')];if(!_0x21375c[_0x0fe7('0x3e')]['hasOwnProperty'](_0x0fe7('0x46'))){_0x50f4b9[_0x0fe7('0x23')]=qs[_0x0fe7('0x23')](_0x21375c[_0x0fe7('0x3e')][_0x0fe7('0x23')]);_0x50f4b9[_0x0fe7('0x47')]=qs[_0x0fe7('0x47')](_0x21375c[_0x0fe7('0x3e')]['offset']);}_0x50f4b9[_0x0fe7('0x48')]=qs['sort'](_0x21375c[_0x0fe7('0x3e')][_0x0fe7('0x49')]);_0x50f4b9[_0x0fe7('0x4a')]=qs[_0x0fe7('0x4b')](_[_0x0fe7('0x68')](_0x21375c[_0x0fe7('0x3e')],_0x4128ae[_0x0fe7('0x4b')]));_0x50f4b9[_0x0fe7('0x4a')][_0x0fe7('0x69')]=_0x37071d['id'];if(_0x21375c[_0x0fe7('0x3e')][_0x0fe7('0x2f')]){_0x50f4b9[_0x0fe7('0x4a')]=_['merge'](_0x50f4b9[_0x0fe7('0x4a')],{'$or':_['map'](_0x50f4b9[_0x0fe7('0x43')],function(_0x5b3f68){var _0x539c98={};_0x539c98[_0x5b3f68]={'$like':'%'+_0x21375c[_0x0fe7('0x3e')][_0x0fe7('0x2f')]+'%'};return _0x539c98;})});}_0x50f4b9=_['merge']({},_0x50f4b9,_0x21375c[_0x0fe7('0x4e')]);return db[_0x0fe7('0x67')][_0x0fe7('0x24')]({'where':_0x50f4b9['where']})[_0x0fe7('0x2b')](function(_0x12de2c){_0x351f5b[_0x0fe7('0x24')]=_0x12de2c;if(_0x21375c[_0x0fe7('0x3e')][_0x0fe7('0x4f')]){_0x50f4b9[_0x0fe7('0x54')]=[{'all':!![]}];}return db[_0x0fe7('0x67')][_0x0fe7('0x6a')](_0x50f4b9);})[_0x0fe7('0x2b')](function(_0x643e1b){_0x351f5b[_0x0fe7('0x50')]=_0x643e1b;return _0x351f5b;});}})[_0x0fe7('0x2b')](respondWithFilteredResult(_0x1917ea,_0x50f4b9))[_0x0fe7('0x51')](handleError(_0x1917ea,null));};exports[_0x0fe7('0x6b')]=function(_0x2e99e0,_0x441fdd,_0x5cde4b){var _0x54f5e0={'raw':!![],'where':{}};var _0x25adce={};var _0x4a5e0e={'count':0x0,'rows':[]};return db[_0x0fe7('0x39')][_0x0fe7('0x66')]({'where':{'id':_0x2e99e0['params']['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x441fdd,null))[_0x0fe7('0x2b')](function(_0xad893b){if(_0xad893b){_0x25adce[_0x0fe7('0x41')]=_[_0x0fe7('0x3f')](db['CmHopperHistory']['rawAttributes']);_0x25adce['query']=_['keys'](_0x2e99e0[_0x0fe7('0x3e')]);_0x25adce[_0x0fe7('0x4b')]=_[_0x0fe7('0x40')](_0x25adce[_0x0fe7('0x41')],_0x25adce[_0x0fe7('0x3e')]);_0x54f5e0[_0x0fe7('0x43')]=_[_0x0fe7('0x40')](_0x25adce[_0x0fe7('0x41')],qs[_0x0fe7('0x42')](_0x2e99e0[_0x0fe7('0x3e')][_0x0fe7('0x42')]));_0x54f5e0[_0x0fe7('0x43')]=_0x54f5e0['attributes']['length']?_0x54f5e0[_0x0fe7('0x43')]:_0x25adce[_0x0fe7('0x41')];if(!_0x2e99e0[_0x0fe7('0x3e')][_0x0fe7('0x45')](_0x0fe7('0x46'))){_0x54f5e0['limit']=qs[_0x0fe7('0x23')](_0x2e99e0[_0x0fe7('0x3e')][_0x0fe7('0x23')]);_0x54f5e0['offset']=qs[_0x0fe7('0x47')](_0x2e99e0['query']['offset']);}_0x54f5e0[_0x0fe7('0x48')]=qs[_0x0fe7('0x49')](_0x2e99e0[_0x0fe7('0x3e')]['sort']);_0x54f5e0['where']=qs[_0x0fe7('0x4b')](_[_0x0fe7('0x68')](_0x2e99e0[_0x0fe7('0x3e')],_0x25adce[_0x0fe7('0x4b')]));_0x54f5e0['where'][_0x0fe7('0x69')]=_0xad893b['id'];if(_0x2e99e0[_0x0fe7('0x3e')]['filter']){_0x54f5e0[_0x0fe7('0x4a')]=_[_0x0fe7('0x4d')](_0x54f5e0[_0x0fe7('0x4a')],{'$or':_[_0x0fe7('0x31')](_0x54f5e0['attributes'],function(_0x153f2a){var _0x12e705={};_0x12e705[_0x153f2a]={'$like':'%'+_0x2e99e0[_0x0fe7('0x3e')][_0x0fe7('0x2f')]+'%'};return _0x12e705;})});}_0x54f5e0=_[_0x0fe7('0x4d')]({},_0x54f5e0,_0x2e99e0['options']);return db[_0x0fe7('0x6c')][_0x0fe7('0x24')]({'where':_0x54f5e0[_0x0fe7('0x4a')]})[_0x0fe7('0x2b')](function(_0x176712){_0x4a5e0e[_0x0fe7('0x24')]=_0x176712;if(_0x2e99e0[_0x0fe7('0x3e')][_0x0fe7('0x4f')]){_0x54f5e0[_0x0fe7('0x54')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0fe7('0x6a')](_0x54f5e0);})[_0x0fe7('0x2b')](function(_0x519f8d){_0x4a5e0e[_0x0fe7('0x50')]=_0x519f8d;return _0x4a5e0e;});}})[_0x0fe7('0x2b')](respondWithFilteredResult(_0x441fdd,_0x54f5e0))[_0x0fe7('0x51')](handleError(_0x441fdd,null));};exports['getHopperFinals']=function(_0x31c11b,_0xf76de3,_0x48f406){var _0x4df5fa={'raw':!![],'where':{}};var _0x4ab182={};var _0x751d1c={'count':0x0,'rows':[]};return db[_0x0fe7('0x39')][_0x0fe7('0x66')]({'where':{'id':_0x31c11b[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0xf76de3,null))[_0x0fe7('0x2b')](function(_0x1299ba){if(_0x1299ba){_0x4ab182[_0x0fe7('0x41')]=_[_0x0fe7('0x3f')](db['CmHopperFinal'][_0x0fe7('0x3a')]);_0x4ab182[_0x0fe7('0x3e')]=_[_0x0fe7('0x3f')](_0x31c11b[_0x0fe7('0x3e')]);_0x4ab182['filters']=_['intersection'](_0x4ab182['model'],_0x4ab182[_0x0fe7('0x3e')]);_0x4df5fa['attributes']=_[_0x0fe7('0x40')](_0x4ab182[_0x0fe7('0x41')],qs[_0x0fe7('0x42')](_0x31c11b[_0x0fe7('0x3e')][_0x0fe7('0x42')]));_0x4df5fa['attributes']=_0x4df5fa[_0x0fe7('0x43')]['length']?_0x4df5fa[_0x0fe7('0x43')]:_0x4ab182[_0x0fe7('0x41')];if(!_0x31c11b['query'][_0x0fe7('0x45')]('nolimit')){_0x4df5fa['limit']=qs[_0x0fe7('0x23')](_0x31c11b[_0x0fe7('0x3e')][_0x0fe7('0x23')]);_0x4df5fa[_0x0fe7('0x47')]=qs[_0x0fe7('0x47')](_0x31c11b[_0x0fe7('0x3e')][_0x0fe7('0x47')]);}_0x4df5fa[_0x0fe7('0x48')]=qs[_0x0fe7('0x49')](_0x31c11b[_0x0fe7('0x3e')][_0x0fe7('0x49')]);_0x4df5fa['where']=qs[_0x0fe7('0x4b')](_[_0x0fe7('0x68')](_0x31c11b[_0x0fe7('0x3e')],_0x4ab182[_0x0fe7('0x4b')]));_0x4df5fa[_0x0fe7('0x4a')]['VoiceQueueId']=_0x1299ba['id'];if(_0x31c11b[_0x0fe7('0x3e')][_0x0fe7('0x2f')]){_0x4df5fa['where']=_['merge'](_0x4df5fa['where'],{'$or':_['map'](_0x4df5fa[_0x0fe7('0x43')],function(_0x5142ef){var _0x337cea={};_0x337cea[_0x5142ef]={'$like':'%'+_0x31c11b[_0x0fe7('0x3e')]['filter']+'%'};return _0x337cea;})});}_0x4df5fa=_[_0x0fe7('0x4d')]({},_0x4df5fa,_0x31c11b['options']);return db['CmHopperFinal'][_0x0fe7('0x24')]({'where':_0x4df5fa[_0x0fe7('0x4a')]})[_0x0fe7('0x2b')](function(_0x194916){_0x751d1c['count']=_0x194916;if(_0x31c11b[_0x0fe7('0x3e')]['includeAll']){_0x4df5fa[_0x0fe7('0x54')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x4df5fa);})[_0x0fe7('0x2b')](function(_0x521100){_0x751d1c[_0x0fe7('0x50')]=_0x521100;return _0x751d1c;});}})[_0x0fe7('0x2b')](respondWithFilteredResult(_0xf76de3,_0x4df5fa))[_0x0fe7('0x51')](handleError(_0xf76de3,null));};exports['getHopperBlacks']=function(_0x1d0e6d,_0x5e6a04,_0x3d7931){var _0x23f486={'raw':!![],'where':{}};var _0x157f01={};var _0x19f8a1={'count':0x0,'rows':[]};return db[_0x0fe7('0x39')][_0x0fe7('0x66')]({'where':{'id':_0x1d0e6d[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x5e6a04,null))[_0x0fe7('0x2b')](function(_0x405a19){if(_0x405a19){_0x157f01[_0x0fe7('0x41')]=_[_0x0fe7('0x3f')](db[_0x0fe7('0x6d')][_0x0fe7('0x3a')]);_0x157f01[_0x0fe7('0x3e')]=_[_0x0fe7('0x3f')](_0x1d0e6d[_0x0fe7('0x3e')]);_0x157f01[_0x0fe7('0x4b')]=_[_0x0fe7('0x40')](_0x157f01[_0x0fe7('0x41')],_0x157f01[_0x0fe7('0x3e')]);_0x23f486[_0x0fe7('0x43')]=_['intersection'](_0x157f01[_0x0fe7('0x41')],qs[_0x0fe7('0x42')](_0x1d0e6d[_0x0fe7('0x3e')][_0x0fe7('0x42')]));_0x23f486[_0x0fe7('0x43')]=_0x23f486[_0x0fe7('0x43')][_0x0fe7('0x44')]?_0x23f486['attributes']:_0x157f01[_0x0fe7('0x41')];if(!_0x1d0e6d[_0x0fe7('0x3e')][_0x0fe7('0x45')](_0x0fe7('0x46'))){_0x23f486[_0x0fe7('0x23')]=qs[_0x0fe7('0x23')](_0x1d0e6d[_0x0fe7('0x3e')]['limit']);_0x23f486[_0x0fe7('0x47')]=qs[_0x0fe7('0x47')](_0x1d0e6d['query'][_0x0fe7('0x47')]);}_0x23f486[_0x0fe7('0x48')]=qs[_0x0fe7('0x49')](_0x1d0e6d[_0x0fe7('0x3e')][_0x0fe7('0x49')]);_0x23f486[_0x0fe7('0x4a')]=qs['filters'](_[_0x0fe7('0x68')](_0x1d0e6d['query'],_0x157f01[_0x0fe7('0x4b')]));_0x23f486[_0x0fe7('0x4a')][_0x0fe7('0x69')]=_0x405a19['id'];if(_0x1d0e6d[_0x0fe7('0x3e')][_0x0fe7('0x2f')]){_0x23f486[_0x0fe7('0x4a')]=_[_0x0fe7('0x4d')](_0x23f486['where'],{'$or':_[_0x0fe7('0x31')](_0x23f486['attributes'],function(_0x409022){var _0x4b578e={};_0x4b578e[_0x409022]={'$like':'%'+_0x1d0e6d[_0x0fe7('0x3e')][_0x0fe7('0x2f')]+'%'};return _0x4b578e;})});}_0x23f486=_['merge']({},_0x23f486,_0x1d0e6d[_0x0fe7('0x4e')]);return db['CmHopperBlack'][_0x0fe7('0x24')]({'where':_0x23f486[_0x0fe7('0x4a')]})[_0x0fe7('0x2b')](function(_0x7c6f58){_0x19f8a1[_0x0fe7('0x24')]=_0x7c6f58;if(_0x1d0e6d['query'][_0x0fe7('0x4f')]){_0x23f486[_0x0fe7('0x54')]=[{'all':!![]}];}return db[_0x0fe7('0x6d')][_0x0fe7('0x6a')](_0x23f486);})['then'](function(_0x1768da){_0x19f8a1[_0x0fe7('0x50')]=_0x1768da;return _0x19f8a1;});}})[_0x0fe7('0x2b')](respondWithFilteredResult(_0x5e6a04,_0x23f486))[_0x0fe7('0x51')](handleError(_0x5e6a04,null));};exports[_0x0fe7('0x6e')]=function(_0xb792da,_0x31d88b,_0x537c81){var _0xef9904={};var _0x5875e8={};var _0x104bd4;var _0x58ffed;return db['VoiceQueue'][_0x0fe7('0x66')]({'where':{'id':_0xb792da[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x31d88b,null))[_0x0fe7('0x2b')](function(_0x32ca92){if(_0x32ca92){_0x104bd4=_0x32ca92;_0x5875e8['model']=_[_0x0fe7('0x3f')](db[_0x0fe7('0x6f')][_0x0fe7('0x3a')]);_0x5875e8[_0x0fe7('0x3e')]=_[_0x0fe7('0x3f')](_0xb792da[_0x0fe7('0x3e')]);_0x5875e8['filters']=_[_0x0fe7('0x40')](_0x5875e8[_0x0fe7('0x41')],_0x5875e8[_0x0fe7('0x3e')]);_0xef9904[_0x0fe7('0x43')]=_[_0x0fe7('0x40')](_0x5875e8[_0x0fe7('0x41')],qs['fields'](_0xb792da[_0x0fe7('0x3e')][_0x0fe7('0x42')]));_0xef9904[_0x0fe7('0x43')]=_0xef9904[_0x0fe7('0x43')]['length']?_0xef9904[_0x0fe7('0x43')]:_0x5875e8['model'];_0xef9904[_0x0fe7('0x48')]=qs[_0x0fe7('0x49')](_0xb792da[_0x0fe7('0x3e')][_0x0fe7('0x49')]);_0xef9904[_0x0fe7('0x4a')]=qs[_0x0fe7('0x4b')](_[_0x0fe7('0x68')](_0xb792da[_0x0fe7('0x3e')],_0x5875e8[_0x0fe7('0x4b')]));if(_0xb792da[_0x0fe7('0x3e')][_0x0fe7('0x2f')]){_0xef9904[_0x0fe7('0x4a')]=_['merge'](_0xef9904[_0x0fe7('0x4a')],{'$or':_['map'](_0xef9904[_0x0fe7('0x43')],function(_0x53ba8e){var _0x5257f8={};_0x5257f8[_0x53ba8e]={'$like':'%'+_0xb792da['query'][_0x0fe7('0x2f')]+'%'};return _0x5257f8;})});}_0xef9904=_[_0x0fe7('0x4d')]({},_0xef9904,_0xb792da[_0x0fe7('0x4e')]);return _0x104bd4[_0x0fe7('0x6e')](_0xef9904);}})[_0x0fe7('0x2b')](function(_0xb39869){if(_0xb39869){_0x58ffed=_0xb39869['length'];if(!_0xb792da['query'][_0x0fe7('0x45')](_0x0fe7('0x46'))){_0xef9904[_0x0fe7('0x23')]=qs[_0x0fe7('0x23')](_0xb792da[_0x0fe7('0x3e')]['limit']);_0xef9904[_0x0fe7('0x47')]=qs[_0x0fe7('0x47')](_0xb792da[_0x0fe7('0x3e')][_0x0fe7('0x47')]);}return _0x104bd4[_0x0fe7('0x6e')](_0xef9904);}})[_0x0fe7('0x2b')](function(_0x505509){if(_0x505509){return _0x505509?{'count':_0x58ffed,'rows':_0x505509}:null;}})[_0x0fe7('0x2b')](respondWithResult(_0x31d88b,null))[_0x0fe7('0x51')](handleError(_0x31d88b,null));};exports[_0x0fe7('0x70')]=function(_0x25f215,_0x5e37b5,_0x2afb3b){var _0x20a41a=_0x25f215[_0x0fe7('0x56')]['teams'];var _0x195b70=_['map'](_0x20a41a,'id');return db['Team'][_0x0fe7('0x6a')]({'where':{'id':_0x195b70},'attributes':['id'],'include':[{'model':db[_0x0fe7('0x71')],'as':_0x0fe7('0x72'),'attributes':['id',_0x0fe7('0x34'),_0x0fe7('0x73'),_0x0fe7('0x74'),_0x0fe7('0x75')],'raw':!![]}]})[_0x0fe7('0x2b')](function(_0x83d593){if(_0x83d593){var _0x1fa299=_['flatMap'](_0x83d593,function(_0x2c08a9){var _0x19ccfa=_0x2c08a9['get']({'plain':!![]});_0x19ccfa[_0x0fe7('0x72')][_0x0fe7('0x76')](function(_0x61c475){_0x61c475[_0x0fe7('0x77')]=_['find'](_0x20a41a,{'id':_0x19ccfa['id']})['penalty'];});return _0x19ccfa[_0x0fe7('0x72')];});return db[_0x0fe7('0x39')][_0x0fe7('0x33')]({'where':{'id':_0x25f215[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](function(_0x1db689){return db[_0x0fe7('0x78')][_0x0fe7('0x79')](function(_0x2de572){return _0x1db689['addTeams'](_0x195b70,{'transaction':_0x2de572})[_0x0fe7('0x2b')](function(){return BPromise['each'](_0x20a41a,function(_0x568c7c){return db[_0x0fe7('0x7a')][_0x0fe7('0x7b')]({'TeamId':_0x568c7c['id'],'VoiceQueueId':_0x25f215[_0x0fe7('0x53')]['id'],'penalty':_0x568c7c[_0x0fe7('0x77')]},{'transaction':_0x2de572});});})['then'](function(){return BPromise['each'](_0x1fa299,function(_0x5df00a){return db[_0x0fe7('0x7c')][_0x0fe7('0x7d')]({'where':{'UserId':_0x5df00a['id'],'VoiceQueueId':_0x25f215[_0x0fe7('0x53')]['id']},'defaults':{'penalty':_0x5df00a['penalty']},'transaction':_0x2de572});});})[_0x0fe7('0x2b')](function(){return BPromise[_0x0fe7('0x7e')](_['filter'](_0x1fa299,{'online':!![]}),function(_0x4c5a3e){return db[_0x0fe7('0x7f')][_0x0fe7('0x7b')]({'membername':_0x4c5a3e[_0x0fe7('0x34')],'UserId':_0x4c5a3e['id'],'queue_name':_0x1db689[_0x0fe7('0x34')],'VoiceQueueId':_0x1db689['id'],'interface':_['isNil'](_0x4c5a3e[_0x0fe7('0x75')])?util[_0x0fe7('0x80')]('SIP/%s',_0x4c5a3e[_0x0fe7('0x34')]):_0x4c5a3e[_0x0fe7('0x75')],'paused':_0x4c5a3e['voicePause']||![],'penalty':_0x4c5a3e[_0x0fe7('0x77')]},{'transaction':_0x2de572});});})[_0x0fe7('0x2b')](function(){_0x1fa299['forEach'](function(_0x51690b){socket['emit'](_0x0fe7('0x81'),{'UserId':_0x51690b['id'],'VoiceQueueId':_0x1db689['id']});});});});});}})['then'](respondWithStatusCode(_0x5e37b5,null))[_0x0fe7('0x51')](handleError(_0x5e37b5,null));};exports['removeTeams']=function(_0x5a9f88,_0xd82e25,_0x3ee6e4){return db['Team']['findAll']({'where':{'id':_0x5a9f88[_0x0fe7('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0fe7('0x71')],'as':_0x0fe7('0x72'),'attributes':['id'],'raw':!![]}]})[_0x0fe7('0x2b')](handleEntityNotFound(_0xd82e25,null))[_0x0fe7('0x2b')](function(_0x5c4a20){var _0x134e4e=_[_0x0fe7('0x31')](_0x5c4a20,'id');var _0x19badd=[];var _0x362eb0=[];var _0x3b0819=squel[_0x0fe7('0x82')]();_0x3b0819[_0x0fe7('0x83')](_0x0fe7('0x84'))[_0x0fe7('0x85')](_0x0fe7('0x86'),'tq')[_0x0fe7('0x87')](_0x0fe7('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0fe7('0x4a')](_0x0fe7('0x89'),_0x5a9f88[_0x0fe7('0x53')]['id']);for(var _0x4de899=0x0;_0x4de899<_0x5c4a20['length'];_0x4de899+=0x1){let _0x40c516=_0x5c4a20[_0x4de899];for(var _0x5dbab3=0x0;_0x5dbab3<_0x40c516[_0x0fe7('0x72')][_0x0fe7('0x44')];_0x5dbab3+=0x1){let _0x4c1c86=_0x40c516[_0x0fe7('0x72')][_0x5dbab3];var _0x4a1d37=_0x3b0819[_0x0fe7('0x5f')]();_0x4a1d37['where'](_0x0fe7('0x8a'),_0x4c1c86['id']);_0x362eb0[_0x0fe7('0x8b')](db['sequelize']['query'](_0x4a1d37[_0x0fe7('0x8c')](),{'type':db[_0x0fe7('0x78')][_0x0fe7('0x8d')][_0x0fe7('0x8e')]})['then'](function(_0x53acb3){if(_0x53acb3[_0x0fe7('0x44')]===0x1){return _0x4c1c86['id'];}else{var _0x1e1923=_[_0x0fe7('0x8f')](_['map'](_0x53acb3,_0x0fe7('0x90')),function(_0x5918a2){return _['includes'](_0x134e4e,_0x5918a2);});if(_0x1e1923){return _0x4c1c86['id'];}}}));}}return BPromise[_0x0fe7('0x91')](_0x362eb0)[_0x0fe7('0x2b')](function(_0x4b8c8d){_0x19badd=_(_0x19badd)['union'](_0x4b8c8d)['compact']()[_0x0fe7('0x32')]();return db[_0x0fe7('0x39')][_0x0fe7('0x33')]({'where':{'id':_0x5a9f88[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](function(_0x28f388){return db[_0x0fe7('0x78')]['transaction'](function(_0x486ee2){return _0x28f388['removeTeams'](_0x5a9f88[_0x0fe7('0x3e')][_0x0fe7('0x92')],{'transaction':_0x486ee2})[_0x0fe7('0x2b')](function(){if(!_['isEmpty'](_0x19badd)){return _0x28f388['removeAgents'](_0x19badd,{'transaction':_0x486ee2})[_0x0fe7('0x2b')](function(){return db[_0x0fe7('0x7f')][_0x0fe7('0x2c')]({'where':{'VoiceQueueId':_0x5a9f88['params']['id'],'UserId':_0x19badd},'transaction':_0x486ee2});});}})[_0x0fe7('0x2b')](function(){_0x19badd[_0x0fe7('0x76')](function(_0x263cf5){socket[_0x0fe7('0x93')](_0x0fe7('0x94'),{'UserId':_0x263cf5,'VoiceQueueId':_0x28f388['id']});});});});});});})[_0x0fe7('0x2b')](respondWithStatusCode(_0xd82e25,null))[_0x0fe7('0x51')](handleError(_0xd82e25,null));};exports[_0x0fe7('0x95')]=function(_0x1754d7,_0x1ce337,_0xfe435e){var _0x2520d4,_0x436e8d;return db[_0x0fe7('0x39')][_0x0fe7('0x33')]({'where':{'id':_0x1754d7[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x1ce337,null))[_0x0fe7('0x2b')](function(_0x1b6eab){if(_0x1b6eab){_0x436e8d=_0x1b6eab;return _0x1b6eab[_0x0fe7('0x95')](_0x1754d7[_0x0fe7('0x56')]['ids'],_[_0x0fe7('0x61')](_0x1754d7[_0x0fe7('0x56')],[_0x0fe7('0x92'),'id'])||{})[_0x0fe7('0x96')](function(_0xc01868){for(var _0x3ac078=0x0;_0x3ac078<_0x1754d7[_0x0fe7('0x56')]['ids'][_0x0fe7('0x44')];_0x3ac078+=0x1){socket[_0x0fe7('0x93')]('userVoiceQueue:save',{'UserId':Number(_0x1754d7[_0x0fe7('0x56')][_0x0fe7('0x92')][_0x3ac078]),'VoiceQueueId':Number(_0x1754d7[_0x0fe7('0x53')]['id'])});}return _0xc01868;});}})[_0x0fe7('0x2b')](function(_0x33d4d8){_0x2520d4=_0x33d4d8||[];if(_0x436e8d){return db[_0x0fe7('0x71')][_0x0fe7('0x6a')]({'where':{'id':_0x1754d7[_0x0fe7('0x56')][_0x0fe7('0x92')]},'attributes':['id',_0x0fe7('0x34'),_0x0fe7('0x73'),'voicePause',_0x0fe7('0x75')],'raw':!![]});}})[_0x0fe7('0x2b')](function(_0xba2359){if(!_[_0x0fe7('0x97')](_0xba2359)){var _0x549b02=[];for(var _0x516e8d=0x0;_0x516e8d<_0xba2359[_0x0fe7('0x44')];_0x516e8d++){if(_0xba2359[_0x516e8d]['online']){_0x549b02['push'](db['UserVoiceQueueRt'][_0x0fe7('0x7b')]({'membername':_0xba2359[_0x516e8d][_0x0fe7('0x34')],'UserId':_0xba2359[_0x516e8d]['id'],'queue_name':_0x436e8d[_0x0fe7('0x34')],'VoiceQueueId':_0x436e8d['id'],'interface':_[_0x0fe7('0x98')](_0xba2359[_0x516e8d][_0x0fe7('0x75')])?util[_0x0fe7('0x80')]('SIP/%s',_0xba2359[_0x516e8d][_0x0fe7('0x34')]):_0xba2359[_0x516e8d][_0x0fe7('0x75')],'paused':_0xba2359[_0x516e8d]['voicePause']||![],'penalty':_0x1754d7[_0x0fe7('0x56')][_0x0fe7('0x77')]||0x0}));}}return BPromise[_0x0fe7('0x91')](_0x549b02);}})[_0x0fe7('0x2b')](function(){return _0x2520d4;})[_0x0fe7('0x2b')](respondWithResult(_0x1ce337,null))[_0x0fe7('0x51')](handleError(_0x1ce337,null));};exports[_0x0fe7('0x99')]=function(_0x3b0195,_0x33b415,_0x127373){return db[_0x0fe7('0x39')][_0x0fe7('0x33')]({'where':{'id':_0x3b0195['params']['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x33b415,null))['then'](function(_0x230e5b){if(_0x230e5b){return _0x230e5b[_0x0fe7('0x99')](_0x3b0195[_0x0fe7('0x3e')][_0x0fe7('0x92')])['then'](function(){if(_[_0x0fe7('0x9a')](_0x3b0195['query'][_0x0fe7('0x92')])){for(var _0x7ff285=0x0;_0x7ff285<_0x3b0195['query'][_0x0fe7('0x92')][_0x0fe7('0x44')];_0x7ff285+=0x1){socket[_0x0fe7('0x93')]('userVoiceQueue:remove',{'UserId':Number(_0x3b0195[_0x0fe7('0x3e')]['ids'][_0x7ff285]),'VoiceQueueId':Number(_0x3b0195[_0x0fe7('0x53')]['id'])});}}else{socket[_0x0fe7('0x93')](_0x0fe7('0x94'),{'UserId':Number(_0x3b0195['query'][_0x0fe7('0x92')]),'VoiceQueueId':Number(_0x3b0195[_0x0fe7('0x53')]['id'])});}});}})[_0x0fe7('0x2b')](function(_0x22ab20){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3b0195[_0x0fe7('0x53')]['id'],'UserId':_0x3b0195[_0x0fe7('0x3e')][_0x0fe7('0x92')]}})[_0x0fe7('0x2b')](function(){return _0x22ab20;});})['then'](respondWithStatusCode(_0x33b415,null))[_0x0fe7('0x51')](handleError(_0x33b415,null));};exports['getAgents']=function(_0x4f467b,_0x41686d,_0x3ba8d0){var _0xbb5521={};var _0x369d7b={};var _0xc7c1d2;var _0x3e93a2;return db[_0x0fe7('0x39')][_0x0fe7('0x66')]({'where':{'id':_0x4f467b[_0x0fe7('0x53')]['id']}})['then'](handleEntityNotFound(_0x41686d,null))[_0x0fe7('0x2b')](function(_0x226477){if(_0x226477){_0xc7c1d2=_0x226477;_0x369d7b['model']=_[_0x0fe7('0x3f')](db[_0x0fe7('0x71')][_0x0fe7('0x3a')]);_0x369d7b[_0x0fe7('0x3e')]=_['keys'](_0x4f467b[_0x0fe7('0x3e')]);_0x369d7b[_0x0fe7('0x4b')]=_[_0x0fe7('0x40')](_0x369d7b[_0x0fe7('0x41')],_0x369d7b[_0x0fe7('0x3e')]);_0xbb5521[_0x0fe7('0x43')]=_['intersection'](_0x369d7b[_0x0fe7('0x41')],qs[_0x0fe7('0x42')](_0x4f467b[_0x0fe7('0x3e')][_0x0fe7('0x42')]));_0xbb5521[_0x0fe7('0x43')]=_0xbb5521['attributes']['length']?_0xbb5521[_0x0fe7('0x43')]:_0x369d7b['model'];_0xbb5521[_0x0fe7('0x48')]=qs[_0x0fe7('0x49')](_0x4f467b[_0x0fe7('0x3e')]['sort']);_0xbb5521[_0x0fe7('0x4a')]=qs[_0x0fe7('0x4b')](_['pick'](_0x4f467b[_0x0fe7('0x3e')],_0x369d7b[_0x0fe7('0x4b')]));if(_0x4f467b[_0x0fe7('0x3e')][_0x0fe7('0x2f')]){_0xbb5521['where']=_['merge'](_0xbb5521['where'],{'$or':_['map'](_0xbb5521[_0x0fe7('0x43')],function(_0xb4943d){var _0x1865e5={};_0x1865e5[_0xb4943d]={'$like':'%'+_0x4f467b[_0x0fe7('0x3e')][_0x0fe7('0x2f')]+'%'};return _0x1865e5;})});}_0xbb5521=_[_0x0fe7('0x4d')]({},_0xbb5521,_0x4f467b[_0x0fe7('0x4e')]);return _0xc7c1d2['getAgents'](_0xbb5521);}})[_0x0fe7('0x2b')](function(_0x3a2f31){if(_0x3a2f31){_0x3e93a2=_0x3a2f31[_0x0fe7('0x44')];if(!_0x4f467b[_0x0fe7('0x3e')]['hasOwnProperty'](_0x0fe7('0x46'))){_0xbb5521[_0x0fe7('0x23')]=qs[_0x0fe7('0x23')](_0x4f467b['query']['limit']);_0xbb5521[_0x0fe7('0x47')]=qs['offset'](_0x4f467b['query'][_0x0fe7('0x47')]);}return _0xc7c1d2[_0x0fe7('0x9b')](_0xbb5521);}})['then'](function(_0x12593c){if(_0x12593c){return _0x12593c?{'count':_0x3e93a2,'rows':_0x12593c}:null;}})[_0x0fe7('0x2b')](respondWithResult(_0x41686d,null))[_0x0fe7('0x51')](handleError(_0x41686d,null));};exports[_0x0fe7('0x9c')]=function(_0x4c7b6e,_0x410a20,_0x4c0fb7){var _0x1ceb8a={};var _0x4627fd={};var _0xb47f93;var _0x6bf52f;return db[_0x0fe7('0x39')][_0x0fe7('0x66')]({'where':{'id':_0x4c7b6e[_0x0fe7('0x53')]['id']}})['then'](handleEntityNotFound(_0x410a20,null))[_0x0fe7('0x2b')](function(_0x3a2cbb){if(_0x3a2cbb){_0xb47f93=_0x3a2cbb;_0x4627fd[_0x0fe7('0x41')]=_[_0x0fe7('0x3f')](db[_0x0fe7('0x7f')]['rawAttributes']);_0x4627fd[_0x0fe7('0x3e')]=_[_0x0fe7('0x3f')](_0x4c7b6e['query']);_0x4627fd[_0x0fe7('0x4b')]=_[_0x0fe7('0x40')](_0x4627fd[_0x0fe7('0x41')],_0x4627fd['query']);_0x1ceb8a[_0x0fe7('0x43')]=_['intersection'](_0x4627fd[_0x0fe7('0x41')],qs['fields'](_0x4c7b6e[_0x0fe7('0x3e')][_0x0fe7('0x42')]));_0x1ceb8a[_0x0fe7('0x43')]=_0x1ceb8a[_0x0fe7('0x43')]['length']?_0x1ceb8a['attributes']:_0x4627fd['model'];_0x1ceb8a[_0x0fe7('0x48')]=qs['sort'](_0x4c7b6e[_0x0fe7('0x3e')][_0x0fe7('0x49')]);_0x1ceb8a['where']=qs[_0x0fe7('0x4b')](_['pick'](_0x4c7b6e[_0x0fe7('0x3e')],_0x4627fd[_0x0fe7('0x4b')]));if(_0x4c7b6e[_0x0fe7('0x3e')][_0x0fe7('0x2f')]){_0x1ceb8a[_0x0fe7('0x4a')]=_[_0x0fe7('0x4d')](_0x1ceb8a[_0x0fe7('0x4a')],{'$or':_[_0x0fe7('0x31')](_0x1ceb8a['attributes'],function(_0x2c5570){var _0x56959d={};_0x56959d[_0x2c5570]={'$like':'%'+_0x4c7b6e[_0x0fe7('0x3e')]['filter']+'%'};return _0x56959d;})});}_0x1ceb8a=_[_0x0fe7('0x4d')]({},_0x1ceb8a,_0x4c7b6e[_0x0fe7('0x4e')]);return _0xb47f93['getMembers'](_0x1ceb8a);}})[_0x0fe7('0x2b')](function(_0x5ac75e){if(_0x5ac75e){_0x6bf52f=_0x5ac75e[_0x0fe7('0x44')];if(!_0x4c7b6e[_0x0fe7('0x3e')][_0x0fe7('0x45')](_0x0fe7('0x46'))){_0x1ceb8a['limit']=qs[_0x0fe7('0x23')](_0x4c7b6e[_0x0fe7('0x3e')]['limit']);_0x1ceb8a[_0x0fe7('0x47')]=qs[_0x0fe7('0x47')](_0x4c7b6e[_0x0fe7('0x3e')][_0x0fe7('0x47')]);}return _0xb47f93[_0x0fe7('0x9c')](_0x1ceb8a);}})[_0x0fe7('0x2b')](function(_0x4e68fd){return _0x4e68fd?{'count':_0x6bf52f,'rows':_0x4e68fd}:null;})[_0x0fe7('0x2b')](respondWithResult(_0x410a20,null))['catch'](handleError(_0x410a20,null));};exports['getLists']=function(_0x195419,_0x5bba2f,_0x2e5788){var _0x33e911={};var _0x501e68={};var _0x5dd04f;var _0x441e83;return db['VoiceQueue'][_0x0fe7('0x66')]({'where':{'id':_0x195419[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x5bba2f,null))[_0x0fe7('0x2b')](function(_0x293147){if(_0x293147){_0x5dd04f=_0x293147;_0x501e68['model']=_[_0x0fe7('0x3f')](db[_0x0fe7('0x9d')][_0x0fe7('0x3a')]);_0x501e68['query']=_[_0x0fe7('0x3f')](_0x195419[_0x0fe7('0x3e')]);_0x501e68[_0x0fe7('0x4b')]=_[_0x0fe7('0x40')](_0x501e68[_0x0fe7('0x41')],_0x501e68[_0x0fe7('0x3e')]);_0x33e911['attributes']=_[_0x0fe7('0x40')](_0x501e68[_0x0fe7('0x41')],qs['fields'](_0x195419[_0x0fe7('0x3e')][_0x0fe7('0x42')]));_0x33e911[_0x0fe7('0x43')]=_0x33e911['attributes']['length']?_0x33e911[_0x0fe7('0x43')]:_0x501e68[_0x0fe7('0x41')];_0x33e911[_0x0fe7('0x48')]=qs['sort'](_0x195419[_0x0fe7('0x3e')][_0x0fe7('0x49')]);_0x33e911[_0x0fe7('0x4a')]=qs['filters'](_[_0x0fe7('0x68')](_0x195419[_0x0fe7('0x3e')],_0x501e68[_0x0fe7('0x4b')]));if(_0x195419['query'][_0x0fe7('0x2f')]){_0x33e911['where']=_[_0x0fe7('0x4d')](_0x33e911['where'],{'$or':_[_0x0fe7('0x31')](_0x33e911['attributes'],function(_0x1d03ea){var _0x93a9bd={};_0x93a9bd[_0x1d03ea]={'$like':'%'+_0x195419[_0x0fe7('0x3e')][_0x0fe7('0x2f')]+'%'};return _0x93a9bd;})});}_0x33e911=_[_0x0fe7('0x4d')]({},_0x33e911,_0x195419['options']);return _0x5dd04f[_0x0fe7('0x9e')](_0x33e911);}})[_0x0fe7('0x2b')](function(_0x3f52be){if(_0x3f52be){_0x441e83=_0x3f52be[_0x0fe7('0x44')];if(!_0x195419['query'][_0x0fe7('0x45')]('nolimit')){_0x33e911[_0x0fe7('0x23')]=qs['limit'](_0x195419[_0x0fe7('0x3e')]['limit']);_0x33e911[_0x0fe7('0x47')]=qs['offset'](_0x195419[_0x0fe7('0x3e')][_0x0fe7('0x47')]);}return _0x5dd04f[_0x0fe7('0x9e')](_0x33e911);}})[_0x0fe7('0x2b')](function(_0x46d07a){if(_0x46d07a){return _0x46d07a?{'count':_0x441e83,'rows':_0x46d07a}:null;}})[_0x0fe7('0x2b')](respondWithResult(_0x5bba2f,null))[_0x0fe7('0x51')](handleError(_0x5bba2f,null));};exports[_0x0fe7('0x9f')]=function(_0x4996d9,_0xdf510b,_0x4f8537){var _0xc2541d,_0x3a156d;return db[_0x0fe7('0x39')][_0x0fe7('0x33')]({'where':{'id':_0x4996d9[_0x0fe7('0x53')]['id']}})['then'](handleEntityNotFound(_0xdf510b,null))['then'](function(_0x3b82bc){if(_0x3b82bc){_0x3a156d=_0x3b82bc;return _0x3b82bc[_0x0fe7('0x9f')](_0x4996d9[_0x0fe7('0x56')]['ids'],_[_0x0fe7('0x61')](_0x4996d9[_0x0fe7('0x56')],[_0x0fe7('0x92'),'id'])||{});}return null;})[_0x0fe7('0x96')](function(_0x13da67){var _0x38d76a;_0xc2541d=_0x13da67||[];var _0x28580e=[];if(_0x13da67){for(var _0x434837=0x0;_0x434837<_0x13da67[_0x0fe7('0x44')];_0x434837+=0x1){var _0x3aafa4=_0x13da67[_0x434837][_0x0fe7('0x59')]({'plain':!![]});_0x3a156d[_0x0fe7('0xa0')]=_0x4996d9[_0x0fe7('0x56')][_0x0fe7('0xa0')]?_0x4996d9[_0x0fe7('0x56')][_0x0fe7('0xa0')]:_0x3a156d['dialCheckDuplicateType'];switch(_0x3a156d['dialCheckDuplicateType']){case'always':_0x38d76a=squel['insert']()['into'](_0x0fe7('0xa1'))[_0x0fe7('0xa2')]([_0x0fe7('0xa3'),_0x0fe7('0xa4'),_0x0fe7('0xa5'),_0x0fe7('0xa6'),_0x0fe7('0x69'),_0x0fe7('0x62'),_0x0fe7('0x60')],squel[_0x0fe7('0x82')]()[_0x0fe7('0x83')]('phone',_0x0fe7('0xa3'))[_0x0fe7('0x83')](_0x0fe7('0xa7'),_0x0fe7('0xa4'))['field']('id',_0x0fe7('0xa5'))['field'](_0x3aafa4[_0x0fe7('0xa8')][_0x0fe7('0x8c')](),_0x0fe7('0xa6'))['field'](_0x4996d9[_0x0fe7('0x53')]['id'][_0x0fe7('0x8c')](),_0x0fe7('0x69'))[_0x0fe7('0x83')]('NOW()',_0x0fe7('0x62'))['field'](_0x0fe7('0xa7'),_0x0fe7('0x60'))[_0x0fe7('0x85')]('cm_contacts')[_0x0fe7('0x4a')](_0x0fe7('0xa9'))[_0x0fe7('0x4a')](_0x0fe7('0xaa'),_0x3aafa4[_0x0fe7('0xa8')][_0x0fe7('0x8c')]())[_0x0fe7('0x4a')]('phone\x20IS\x20NOT\x20NULL')[_0x0fe7('0x4a')](_0x0fe7('0xab'),squel['select']()[_0x0fe7('0x83')](_0x0fe7('0xac'))[_0x0fe7('0x85')](_0x0fe7('0xad'))['where'](_0x0fe7('0x89'),_0x4996d9['params']['id']['toString']()))[_0x0fe7('0x4a')](_0x0fe7('0xab'),squel[_0x0fe7('0x82')]()[_0x0fe7('0x83')](_0x0fe7('0xae'))[_0x0fe7('0x85')]('cm_hopper')[_0x0fe7('0x4a')](_0x0fe7('0x89'),_0x4996d9['params']['id'][_0x0fe7('0x8c')]())))['toString']();break;case'onlyIfOpen':_0x38d76a=squel['insert']()[_0x0fe7('0xaf')](_0x0fe7('0xa1'))[_0x0fe7('0xa2')]([_0x0fe7('0xa3'),'scheduledAt',_0x0fe7('0xa5'),'ListId','VoiceQueueId',_0x0fe7('0x62'),_0x0fe7('0x60')],squel[_0x0fe7('0x82')]()[_0x0fe7('0x83')](_0x0fe7('0xa3'),_0x0fe7('0xa3'))['field'](_0x0fe7('0xa7'),'scheduledAt')['field']('id','ContactId')['field'](_0x3aafa4[_0x0fe7('0xa8')][_0x0fe7('0x8c')](),'ListId')[_0x0fe7('0x83')](_0x4996d9[_0x0fe7('0x53')]['id'][_0x0fe7('0x8c')](),_0x0fe7('0x69'))['field'](_0x0fe7('0xa7'),_0x0fe7('0x62'))[_0x0fe7('0x83')]('NOW()',_0x0fe7('0x60'))[_0x0fe7('0x85')](_0x0fe7('0xb0'))['where'](_0x0fe7('0xa9'))[_0x0fe7('0x4a')](_0x0fe7('0xaa'),_0x3aafa4[_0x0fe7('0xa8')][_0x0fe7('0x8c')]())[_0x0fe7('0x4a')]('phone\x20IS\x20NOT\x20NULL')[_0x0fe7('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0fe7('0x83')]('COALESCE(phone,\x27\x27)')[_0x0fe7('0x85')]('cm_hopper')[_0x0fe7('0x4a')](_0x0fe7('0x89'),_0x4996d9[_0x0fe7('0x53')]['id'][_0x0fe7('0x8c')]())))[_0x0fe7('0x8c')]();break;default:_0x38d76a=squel['insert']()[_0x0fe7('0xaf')](_0x0fe7('0xa1'))[_0x0fe7('0xa2')]([_0x0fe7('0xa3'),_0x0fe7('0xa4'),_0x0fe7('0xa5'),_0x0fe7('0xa6'),_0x0fe7('0x69'),'createdAt',_0x0fe7('0x60')],squel[_0x0fe7('0x82')]()[_0x0fe7('0x83')]('phone','phone')['field'](_0x0fe7('0xa7'),'scheduledAt')[_0x0fe7('0x83')]('id',_0x0fe7('0xa5'))[_0x0fe7('0x83')](_0x3aafa4[_0x0fe7('0xa8')][_0x0fe7('0x8c')](),_0x0fe7('0xa6'))[_0x0fe7('0x83')](_0x4996d9[_0x0fe7('0x53')]['id'][_0x0fe7('0x8c')](),_0x0fe7('0x69'))[_0x0fe7('0x83')]('NOW()',_0x0fe7('0x62'))[_0x0fe7('0x83')]('NOW()',_0x0fe7('0x60'))['from'](_0x0fe7('0xb0'))[_0x0fe7('0x4a')](_0x0fe7('0xa9'))['where']('ListId\x20=\x20?',_0x3aafa4[_0x0fe7('0xa8')]['toString']())[_0x0fe7('0x4a')]('phone\x20IS\x20NOT\x20NULL'))[_0x0fe7('0x8c')]();}_0x28580e[_0x0fe7('0x8b')](db['sequelize'][_0x0fe7('0x3e')](_0x38d76a));}return BPromise[_0x0fe7('0x91')](_0x28580e);}})[_0x0fe7('0x2b')](function(){return _0xc2541d;})[_0x0fe7('0x2b')](respondWithResult(_0xdf510b,null))[_0x0fe7('0x51')](handleError(_0xdf510b,null));};exports[_0x0fe7('0xb1')]=function(_0x5506c4,_0x3d0951,_0x4e6d2c){return db['VoiceQueue'][_0x0fe7('0x33')]({'where':{'id':_0x5506c4[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x3d0951,null))[_0x0fe7('0x2b')](function(_0x200147){if(_0x200147){return _0x200147[_0x0fe7('0xb1')](_0x5506c4[_0x0fe7('0x3e')][_0x0fe7('0x92')]);}})[_0x0fe7('0x2b')](function(_0xaa69cb){if(_0xaa69cb){return db[_0x0fe7('0x67')][_0x0fe7('0x2c')]({'where':{'ListId':_0x5506c4[_0x0fe7('0x3e')][_0x0fe7('0x92')],'VoiceQueueId':_0x5506c4[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](function(){return _0xaa69cb;});}})['then'](respondWithStatusCode(_0x3d0951,null))[_0x0fe7('0x51')](handleError(_0x3d0951,null));};exports[_0x0fe7('0xb2')]=function(_0x568549,_0x1124e2,_0x45aea8){var _0x383d8d={};var _0x476577={};var _0x42c967;var _0x149dc4;return db[_0x0fe7('0x39')][_0x0fe7('0x66')]({'where':{'id':_0x568549['params']['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x1124e2,null))[_0x0fe7('0x2b')](function(_0x1d258a){if(_0x1d258a){_0x42c967=_0x1d258a;_0x476577[_0x0fe7('0x41')]=_[_0x0fe7('0x3f')](db['CmList'][_0x0fe7('0x3a')]);_0x476577[_0x0fe7('0x3e')]=_[_0x0fe7('0x3f')](_0x568549[_0x0fe7('0x3e')]);_0x476577['filters']=_[_0x0fe7('0x40')](_0x476577[_0x0fe7('0x41')],_0x476577[_0x0fe7('0x3e')]);_0x383d8d[_0x0fe7('0x43')]=_[_0x0fe7('0x40')](_0x476577[_0x0fe7('0x41')],qs[_0x0fe7('0x42')](_0x568549['query']['fields']));_0x383d8d[_0x0fe7('0x43')]=_0x383d8d[_0x0fe7('0x43')][_0x0fe7('0x44')]?_0x383d8d[_0x0fe7('0x43')]:_0x476577[_0x0fe7('0x41')];_0x383d8d['order']=qs[_0x0fe7('0x49')](_0x568549['query'][_0x0fe7('0x49')]);_0x383d8d['where']=qs[_0x0fe7('0x4b')](_[_0x0fe7('0x68')](_0x568549[_0x0fe7('0x3e')],_0x476577['filters']));if(_0x568549[_0x0fe7('0x3e')][_0x0fe7('0x2f')]){_0x383d8d[_0x0fe7('0x4a')]=_['merge'](_0x383d8d['where'],{'$or':_[_0x0fe7('0x31')](_0x383d8d[_0x0fe7('0x43')],function(_0x3019ef){var _0x523454={};_0x523454[_0x3019ef]={'$like':'%'+_0x568549[_0x0fe7('0x3e')][_0x0fe7('0x2f')]+'%'};return _0x523454;})});}_0x383d8d=_[_0x0fe7('0x4d')]({},_0x383d8d,_0x568549[_0x0fe7('0x4e')]);return _0x42c967[_0x0fe7('0xb2')](_0x383d8d);}})[_0x0fe7('0x2b')](function(_0x36be90){if(_0x36be90){_0x149dc4=_0x36be90[_0x0fe7('0x44')];if(!_0x568549['query'][_0x0fe7('0x45')](_0x0fe7('0x46'))){_0x383d8d[_0x0fe7('0x23')]=qs[_0x0fe7('0x23')](_0x568549[_0x0fe7('0x3e')][_0x0fe7('0x23')]);_0x383d8d[_0x0fe7('0x47')]=qs['offset'](_0x568549[_0x0fe7('0x3e')][_0x0fe7('0x47')]);}return _0x42c967['getBlackLists'](_0x383d8d);}})[_0x0fe7('0x2b')](function(_0x32d7d6){if(_0x32d7d6){return _0x32d7d6?{'count':_0x149dc4,'rows':_0x32d7d6}:null;}})[_0x0fe7('0x2b')](respondWithResult(_0x1124e2,null))['catch'](handleError(_0x1124e2,null));};exports[_0x0fe7('0xb3')]=function(_0x25880d,_0x462964,_0x30515d){var _0x2aabe9,_0x4bff6f;return db[_0x0fe7('0x39')]['find']({'where':{'id':_0x25880d[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x462964,null))[_0x0fe7('0x2b')](function(_0x1a3925){if(_0x1a3925){_0x4bff6f=_0x1a3925;return _0x1a3925[_0x0fe7('0xb3')](_0x25880d[_0x0fe7('0x56')]['ids'],_[_0x0fe7('0x61')](_0x25880d[_0x0fe7('0x56')],[_0x0fe7('0x92'),'id'])||{});}return null;})[_0x0fe7('0x96')](function(_0x3b69cf){var _0xf73e76;_0x2aabe9=_0x3b69cf||[];var _0x58ba61=[];if(_0x3b69cf){for(var _0x415c68=0x0;_0x415c68<_0x3b69cf['length'];_0x415c68+=0x1){var _0x3c5000=_0x3b69cf[_0x415c68][_0x0fe7('0x59')]({'plain':!![]});_0xf73e76=squel[_0x0fe7('0xb4')]()[_0x0fe7('0xaf')](_0x0fe7('0xb5'))['fromQuery']([_0x0fe7('0xa3'),_0x0fe7('0xa5'),_0x0fe7('0xa6'),_0x0fe7('0x69'),_0x0fe7('0x62'),_0x0fe7('0x60')],squel[_0x0fe7('0x82')]()[_0x0fe7('0x83')](_0x0fe7('0xa3'),_0x0fe7('0xa3'))[_0x0fe7('0x83')]('id',_0x0fe7('0xa5'))[_0x0fe7('0x83')](_0x3c5000[_0x0fe7('0xa8')][_0x0fe7('0x8c')](),_0x0fe7('0xa6'))[_0x0fe7('0x83')](_0x25880d[_0x0fe7('0x53')]['id'][_0x0fe7('0x8c')](),'VoiceQueueId')[_0x0fe7('0x83')](_0x0fe7('0xa7'),_0x0fe7('0x62'))[_0x0fe7('0x83')](_0x0fe7('0xa7'),_0x0fe7('0x60'))[_0x0fe7('0x85')](_0x0fe7('0xb0'))[_0x0fe7('0x4a')]('deletedAt\x20IS\x20NULL')['where'](_0x0fe7('0xaa'),_0x3c5000[_0x0fe7('0xa8')][_0x0fe7('0x8c')]())[_0x0fe7('0x4a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x58ba61['push'](db[_0x0fe7('0x78')]['query'](_0xf73e76));}return BPromise['all'](_0x58ba61);}})[_0x0fe7('0x2b')](function(){return _0x2aabe9;})[_0x0fe7('0x2b')](respondWithResult(_0x462964,null))[_0x0fe7('0x51')](handleError(_0x462964,null));};exports[_0x0fe7('0xb6')]=function(_0x221cee,_0x2aa7ae,_0x2536cd){return db[_0x0fe7('0x39')][_0x0fe7('0x33')]({'where':{'id':_0x221cee[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](handleEntityNotFound(_0x2aa7ae,null))[_0x0fe7('0x2b')](function(_0x1b3641){if(_0x1b3641){return _0x1b3641[_0x0fe7('0xb6')](_0x221cee[_0x0fe7('0x3e')]['ids']);}})[_0x0fe7('0x2b')](function(_0x14b19a){if(_0x14b19a){return db[_0x0fe7('0x6d')][_0x0fe7('0x2c')]({'where':{'ListId':_0x221cee['query'][_0x0fe7('0x92')],'VoiceQueueId':_0x221cee[_0x0fe7('0x53')]['id']}})[_0x0fe7('0x2b')](function(){return _0x14b19a;});}})[_0x0fe7('0x2b')](respondWithStatusCode(_0x2aa7ae,null))[_0x0fe7('0x51')](handleError(_0x2aa7ae,null));}; \ No newline at end of file +var _0x90c9=['findOne','VoiceQueueId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','online','voicePause','interface','flatMap','Agents','penalty','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','format','SIP/%s','forEach','userVoiceQueue:save','removeTeams','ids','User','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','sequelize','every','TeamId','union','removeAgents','emit','addAgents','omit','spread','isEmpty','UserVoiceQueueRt','isNil','all','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','toString','cm_contacts','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','inbound','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','stack','VoiceQueue','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','QueueCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','body','getHoppers'];(function(_0x1c83c9,_0x2a0efc){var _0x49c840=function(_0x2945e2){while(--_0x2945e2){_0x1c83c9['push'](_0x1c83c9['shift']());}};_0x49c840(++_0x2a0efc);}(_0x90c9,0x1c6));var _0x990c=function(_0x4c2d60,_0x92e137){_0x4c2d60=_0x4c2d60-0x0;var _0x29664f=_0x90c9[_0x4c2d60];return _0x29664f;};'use strict';var emlformat=require(_0x990c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x990c('0x1'));var rp=require('request-promise');var moment=require(_0x990c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x990c('0x3'));var util=require(_0x990c('0x4'));var path=require('path');var sox=require(_0x990c('0x5'));var csv=require(_0x990c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x990c('0x7'));var _=require(_0x990c('0x8'));var squel=require(_0x990c('0x9'));var crypto=require(_0x990c('0xa'));var jsforce=require(_0x990c('0xb'));var deskjs=require(_0x990c('0xc'));var toCsv=require(_0x990c('0x6'));var querystring=require(_0x990c('0xd'));var Papa=require(_0x990c('0xe'));var Redis=require('ioredis');var authService=require(_0x990c('0xf'));var qs=require(_0x990c('0x10'));var as=require(_0x990c('0x11'));var hardwareService=require(_0x990c('0x12'));var logger=require(_0x990c('0x13'))(_0x990c('0x14'));var utils=require(_0x990c('0x15'));var config=require(_0x990c('0x16'));var licenseUtil=require(_0x990c('0x17'));var db=require(_0x990c('0x18'))['db'];config[_0x990c('0x19')]=_[_0x990c('0x1a')](config[_0x990c('0x19')],{'host':_0x990c('0x1b'),'port':0x18eb});var socket=require(_0x990c('0x1c'))(new Redis(config['redis']));require(_0x990c('0x1d'))['register'](socket);function respondWithStatusCode(_0x46437e,_0x53b2f8){_0x53b2f8=_0x53b2f8||0xcc;return function(_0x57bfb9){if(_0x57bfb9){return _0x46437e[_0x990c('0x1e')](_0x53b2f8);}return _0x46437e[_0x990c('0x1f')](_0x53b2f8)['end']();};}function respondWithResult(_0x347703,_0x5aa0b7){_0x5aa0b7=_0x5aa0b7||0xc8;return function(_0x2c46fc){if(_0x2c46fc){return _0x347703[_0x990c('0x1f')](_0x5aa0b7)[_0x990c('0x20')](_0x2c46fc);}};}function respondWithFilteredResult(_0x27cd7f,_0x58c5a3){return function(_0x10e03a){if(_0x10e03a){var _0x6f436d=typeof _0x58c5a3[_0x990c('0x21')]===_0x990c('0x22')&&typeof _0x58c5a3[_0x990c('0x23')]===_0x990c('0x22');var _0x46e382=_0x10e03a[_0x990c('0x24')];var _0x356501=_0x6f436d?0x0:_0x58c5a3[_0x990c('0x21')];var _0x58fb3a=_0x6f436d?_0x10e03a['count']:_0x58c5a3['offset']+_0x58c5a3[_0x990c('0x23')];var _0x4ea7f2;if(_0x58fb3a>=_0x46e382){_0x58fb3a=_0x46e382;_0x4ea7f2=0xc8;}else{_0x4ea7f2=0xce;}_0x27cd7f[_0x990c('0x1f')](_0x4ea7f2);return _0x27cd7f[_0x990c('0x25')](_0x990c('0x26'),_0x356501+'-'+_0x58fb3a+'/'+_0x46e382)[_0x990c('0x20')](_0x10e03a);}return null;};}function patchUpdates(_0x972fa6){return function(_0xa52c62){try{jsonpatch[_0x990c('0x27')](_0xa52c62,_0x972fa6,!![]);}catch(_0x264fd8){return BPromise[_0x990c('0x28')](_0x264fd8);}return _0xa52c62[_0x990c('0x29')]();};}function saveUpdates(_0x126ddf,_0x7bdbc7){return function(_0x881097){if(_0x881097){return _0x881097[_0x990c('0x2a')](_0x126ddf)[_0x990c('0x2b')](function(_0x50e54b){return _0x50e54b;});}return null;};}function removeEntity(_0x114558,_0x333165){return function(_0x564290){if(_0x564290){return _0x564290[_0x990c('0x2c')]()[_0x990c('0x2b')](function(){var _0x110cc5=_0x564290['get']({'plain':!![]});var _0x59c3a9=[{'name':_0x990c('0x2d'),'value':_0x990c('0x2e'),'ignore':![]},{'name':'QueueCampaigns','value':_0x990c('0x2f'),'ignore':![]}];var _0x38c21f=_(_0x59c3a9)[_0x990c('0x30')](_0x990c('0x31'))[_0x990c('0x32')](_0x990c('0x33'))[_0x990c('0x33')]();if(_[_0x990c('0x34')](_0x38c21f,_0x110cc5[_0x990c('0x35')])){return;}var _0x4a0a6f=_[_0x990c('0x36')](_0x59c3a9,['value',_0x110cc5[_0x990c('0x35')]])[_0x990c('0x37')];return db[_0x990c('0x38')]['destroy']({'where':{'type':_0x4a0a6f,'resourceId':_0x110cc5['id']}})['then'](function(){return _0x564290;});})[_0x990c('0x2b')](function(){_0x114558['status'](0xcc)[_0x990c('0x39')]();});}};}function handleEntityNotFound(_0x1dcaa2,_0x2f4df6){return function(_0x592b1f){if(!_0x592b1f){_0x1dcaa2[_0x990c('0x1e')](0x194);}return _0x592b1f;};}function handleError(_0x5c1b3c,_0x172518){_0x172518=_0x172518||0x1f4;return function(_0x12f290){logger[_0x990c('0x3a')](_0x12f290[_0x990c('0x3b')]);if(_0x12f290[_0x990c('0x37')]){delete _0x12f290[_0x990c('0x37')];}_0x5c1b3c[_0x990c('0x1f')](_0x172518)['send'](_0x12f290);};}exports['index']=function(_0x4a194f,_0x4e6729){var _0x45842e={},_0x165936={},_0x855c83={'count':0x0,'rows':[]};var _0x5d39d6=_[_0x990c('0x32')](db[_0x990c('0x3c')]['rawAttributes'],function(_0x4e3f58){return{'name':_0x4e3f58[_0x990c('0x3d')],'type':_0x4e3f58[_0x990c('0x35')][_0x990c('0x3e')]};});_0x165936[_0x990c('0x3f')]=_[_0x990c('0x32')](_0x5d39d6,_0x990c('0x37'));_0x165936['query']=_[_0x990c('0x40')](_0x4a194f[_0x990c('0x41')]);_0x165936[_0x990c('0x42')]=_[_0x990c('0x43')](_0x165936[_0x990c('0x3f')],_0x165936['query']);_0x45842e[_0x990c('0x44')]=_[_0x990c('0x43')](_0x165936['model'],qs[_0x990c('0x45')](_0x4a194f['query'][_0x990c('0x45')]));_0x45842e[_0x990c('0x44')]=_0x45842e['attributes'][_0x990c('0x46')]?_0x45842e[_0x990c('0x44')]:_0x165936['model'];if(!_0x4a194f[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x45842e[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x4a194f[_0x990c('0x41')][_0x990c('0x23')]);_0x45842e[_0x990c('0x21')]=qs['offset'](_0x4a194f[_0x990c('0x41')][_0x990c('0x21')]);}_0x45842e[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x4a194f['query']['sort']);_0x45842e[_0x990c('0x4b')]=qs[_0x990c('0x42')](_[_0x990c('0x4c')](_0x4a194f[_0x990c('0x41')],_0x165936['filters']),_0x5d39d6);if(_0x4a194f[_0x990c('0x41')]['filter']){_0x45842e[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x45842e[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x5d39d6,function(_0x124d15){if(_0x124d15[_0x990c('0x35')]!==_0x990c('0x4e')){var _0x595a7b={};_0x595a7b[_0x124d15[_0x990c('0x37')]]={'$like':'%'+_0x4a194f[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x595a7b;}})});}_0x45842e=_[_0x990c('0x4d')]({},_0x45842e,_0x4a194f[_0x990c('0x4f')]);var _0x2a3d01={'where':_0x45842e[_0x990c('0x4b')]};return db['VoiceQueue']['count'](_0x2a3d01)[_0x990c('0x2b')](function(_0x2f73bc){_0x855c83[_0x990c('0x24')]=_0x2f73bc;if(_0x4a194f[_0x990c('0x41')]['includeAll']){_0x45842e[_0x990c('0x50')]=[{'all':!![]}];}return db['VoiceQueue'][_0x990c('0x51')](_0x45842e);})[_0x990c('0x2b')](function(_0x2bf419){_0x855c83[_0x990c('0x52')]=_0x2bf419;return _0x855c83;})[_0x990c('0x2b')](respondWithFilteredResult(_0x4e6729,_0x45842e))[_0x990c('0x53')](handleError(_0x4e6729,null));};exports[_0x990c('0x54')]=function(_0x4b03c9,_0x26cd12){var _0x2d842c={'raw':![],'where':{'id':_0x4b03c9[_0x990c('0x55')]['id']}},_0x48a885={};_0x48a885['model']=_[_0x990c('0x40')](db[_0x990c('0x3c')][_0x990c('0x56')]);_0x48a885[_0x990c('0x41')]=_[_0x990c('0x40')](_0x4b03c9[_0x990c('0x41')]);_0x48a885[_0x990c('0x42')]=_['intersection'](_0x48a885[_0x990c('0x3f')],_0x48a885['query']);_0x2d842c[_0x990c('0x44')]=_[_0x990c('0x43')](_0x48a885[_0x990c('0x3f')],qs['fields'](_0x4b03c9[_0x990c('0x41')][_0x990c('0x45')]));_0x2d842c['attributes']=_0x2d842c[_0x990c('0x44')]['length']?_0x2d842c['attributes']:_0x48a885[_0x990c('0x3f')];if(_0x4b03c9['query'][_0x990c('0x57')]){_0x2d842c['include']=[{'all':!![]}];}_0x2d842c=_['merge']({},_0x2d842c,_0x4b03c9[_0x990c('0x4f')]);return db['VoiceQueue'][_0x990c('0x36')](_0x2d842c)[_0x990c('0x2b')](handleEntityNotFound(_0x26cd12,null))['then'](respondWithResult(_0x26cd12,null))[_0x990c('0x53')](handleError(_0x26cd12,null));};exports[_0x990c('0x58')]=function(_0x193d7e,_0xebe95){return db[_0x990c('0x3c')][_0x990c('0x58')](_0x193d7e['body'],{})[_0x990c('0x2b')](function(_0x21cf9f){var _0x40f014=_0x193d7e['user'][_0x990c('0x59')]({'plain':!![]});if(!_0x40f014)throw new Error(_0x990c('0x5a'));if(_0x40f014[_0x990c('0x5b')]===_0x990c('0x5c')){var _0x383d97=_0x21cf9f[_0x990c('0x59')]({'plain':!![]});var _0x44bd01=[{'name':_0x990c('0x2d'),'value':_0x990c('0x2e')},{'name':_0x990c('0x5d'),'value':'outbound'}];var _0x26c49d=_[_0x990c('0x36')](_0x44bd01,[_0x990c('0x33'),_0x383d97['type']])[_0x990c('0x37')];return db['UserProfileSection'][_0x990c('0x36')]({'where':{'name':_0x26c49d,'userProfileId':_0x40f014[_0x990c('0x5e')]},'raw':!![]})[_0x990c('0x2b')](function(_0x295869){if(_0x295869&&_0x295869[_0x990c('0x5f')]===0x0){return db[_0x990c('0x38')][_0x990c('0x58')]({'name':_0x383d97[_0x990c('0x37')],'resourceId':_0x383d97['id'],'type':_0x295869['name'],'sectionId':_0x295869['id']},{})[_0x990c('0x2b')](function(){return _0x21cf9f;});}else{return _0x21cf9f;}})['catch'](function(_0x3a76fd){logger['error'](_0x990c('0x60'),_0x3a76fd);throw _0x3a76fd;});}return _0x21cf9f;})[_0x990c('0x2b')](respondWithResult(_0xebe95,0xc9))['catch'](handleError(_0xebe95,null));};exports['clone']=function(_0x808a84,_0x402634){var _0x15bd31={'where':{'id':_0x808a84[_0x990c('0x55')]['id']}},_0x4cee6a={};_0x4cee6a[_0x990c('0x3f')]=_[_0x990c('0x40')](db['VoiceQueue'][_0x990c('0x56')]);_0x15bd31[_0x990c('0x44')]=_[_0x990c('0x43')](_0x4cee6a['model'],qs[_0x990c('0x45')](_0x808a84[_0x990c('0x41')][_0x990c('0x45')]));_0x15bd31[_0x990c('0x44')]=_0x15bd31[_0x990c('0x44')]['length']?_0x15bd31['attributes']:_0x4cee6a['model'];if(_0x808a84['query']['includeAll']){_0x15bd31['include']=[{'all':!![]}];}_0x15bd31=_[_0x990c('0x4d')]({},_0x15bd31,_0x808a84['options']);return db[_0x990c('0x3c')][_0x990c('0x36')](_0x15bd31)['then'](handleEntityNotFound(_0x402634,null))[_0x990c('0x2b')](function(_0xba9fe){if(_0xba9fe){var _0x377cd4=_0xba9fe[_0x990c('0x59')]({'plain':!![]});_0x377cd4=qs['omit'](_0x377cd4,['id',_0x990c('0x61'),_0x990c('0x62')]);_0x808a84[_0x990c('0x63')]=_['omit'](_0x808a84[_0x990c('0x63')],['id',_0x990c('0x61'),'updatedAt']);return db[_0x990c('0x3c')][_0x990c('0x58')](_['merge'](_0x377cd4,_0x808a84[_0x990c('0x63')]),{'include':_0x808a84[_0x990c('0x41')][_0x990c('0x57')]?[{'all':!![]}]:undefined})[_0x990c('0x2b')](function(_0x129b9b){var _0x4c789b=_0x808a84['user']['get']({'plain':!![]});if(!_0x4c789b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c789b['role']===_0x990c('0x5c')){var _0xe58f4e=_0x129b9b['get']({'plain':!![]});var _0x3e9383=[{'name':_0x990c('0x2d'),'value':_0x990c('0x2e')},{'name':_0x990c('0x5d'),'value':_0x990c('0x2f')}];var _0x4d18cc=_['find'](_0x3e9383,[_0x990c('0x33'),_0xe58f4e['type']])[_0x990c('0x37')];return db['UserProfileSection'][_0x990c('0x36')]({'where':{'name':_0x4d18cc,'userProfileId':_0x4c789b[_0x990c('0x5e')]},'raw':!![]})[_0x990c('0x2b')](function(_0x1c6693){if(_0x1c6693&&_0x1c6693[_0x990c('0x5f')]===0x0){return db[_0x990c('0x38')]['create']({'name':_0xe58f4e[_0x990c('0x37')],'resourceId':_0xe58f4e['id'],'type':_0x1c6693[_0x990c('0x37')],'sectionId':_0x1c6693['id']},{})[_0x990c('0x2b')](function(){return _0x129b9b;});}else{return _0x129b9b;}})[_0x990c('0x53')](function(_0x58de72){logger[_0x990c('0x3a')](_0x990c('0x60'),_0x58de72);throw _0x58de72;});}return _0x129b9b;});}})[_0x990c('0x2b')](respondWithResult(_0x402634,0xc9))[_0x990c('0x53')](handleError(_0x402634,null));};exports[_0x990c('0x2a')]=function(_0x17827a,_0x29b6a7){if(_0x17827a['body']['id']){delete _0x17827a[_0x990c('0x63')]['id'];}return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x17827a['params']['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x29b6a7,null))[_0x990c('0x2b')](saveUpdates(_0x17827a[_0x990c('0x63')],null))[_0x990c('0x2b')](respondWithResult(_0x29b6a7,null))[_0x990c('0x53')](handleError(_0x29b6a7,null));};exports[_0x990c('0x2c')]=function(_0x45eab3,_0x33afc4){return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x45eab3['params']['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x33afc4,null))[_0x990c('0x2b')](removeEntity(_0x33afc4,null))[_0x990c('0x53')](handleError(_0x33afc4,null));};exports[_0x990c('0x64')]=function(_0x13f3ab,_0x2762e8,_0x2f71b8){var _0xa3d830={'raw':![],'where':{}};var _0x1a00ec={};var _0x487a81={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x990c('0x65')]({'where':{'id':_0x13f3ab[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x2762e8,null))[_0x990c('0x2b')](function(_0x2fc5ce){if(_0x2fc5ce){_0x1a00ec[_0x990c('0x3f')]=_['keys'](db['CmHopper'][_0x990c('0x56')]);_0x1a00ec[_0x990c('0x41')]=_['keys'](_0x13f3ab[_0x990c('0x41')]);_0x1a00ec['filters']=_['intersection'](_0x1a00ec[_0x990c('0x3f')],_0x1a00ec[_0x990c('0x41')]);_0xa3d830[_0x990c('0x44')]=_['intersection'](_0x1a00ec[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x13f3ab['query'][_0x990c('0x45')]));_0xa3d830[_0x990c('0x44')]=_0xa3d830[_0x990c('0x44')]['length']?_0xa3d830['attributes']:_0x1a00ec['model'];if(!_0x13f3ab['query'][_0x990c('0x47')]('nolimit')){_0xa3d830[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x13f3ab['query'][_0x990c('0x23')]);_0xa3d830[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x13f3ab[_0x990c('0x41')][_0x990c('0x21')]);}_0xa3d830[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x13f3ab[_0x990c('0x41')][_0x990c('0x4a')]);_0xa3d830['where']=qs[_0x990c('0x42')](_['pick'](_0x13f3ab['query'],_0x1a00ec[_0x990c('0x42')]));_0xa3d830[_0x990c('0x4b')][_0x990c('0x66')]=_0x2fc5ce['id'];if(_0x13f3ab[_0x990c('0x41')][_0x990c('0x30')]){_0xa3d830[_0x990c('0x4b')]=_['merge'](_0xa3d830[_0x990c('0x4b')],{'$or':_['map'](_0xa3d830[_0x990c('0x44')],function(_0x4b3d9c){var _0x2bccf4={};_0x2bccf4[_0x4b3d9c]={'$like':'%'+_0x13f3ab[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x2bccf4;})});}_0xa3d830=_[_0x990c('0x4d')]({},_0xa3d830,_0x13f3ab['options']);return db[_0x990c('0x67')]['count']({'where':_0xa3d830[_0x990c('0x4b')]})[_0x990c('0x2b')](function(_0x47466d){_0x487a81['count']=_0x47466d;if(_0x13f3ab[_0x990c('0x41')][_0x990c('0x57')]){_0xa3d830[_0x990c('0x50')]=[{'all':!![]}];}return db[_0x990c('0x67')][_0x990c('0x51')](_0xa3d830);})[_0x990c('0x2b')](function(_0x2e8d5f){_0x487a81[_0x990c('0x52')]=_0x2e8d5f;return _0x487a81;});}})[_0x990c('0x2b')](respondWithFilteredResult(_0x2762e8,_0xa3d830))[_0x990c('0x53')](handleError(_0x2762e8,null));};exports['getHopperHistories']=function(_0x28eae8,_0x3850c5,_0x4cb850){var _0x2bfac2={'raw':!![],'where':{}};var _0x2694a3={};var _0x2d9efd={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x990c('0x65')]({'where':{'id':_0x28eae8['params']['id']}})['then'](handleEntityNotFound(_0x3850c5,null))['then'](function(_0x453f74){if(_0x453f74){_0x2694a3['model']=_[_0x990c('0x40')](db[_0x990c('0x68')][_0x990c('0x56')]);_0x2694a3[_0x990c('0x41')]=_[_0x990c('0x40')](_0x28eae8['query']);_0x2694a3[_0x990c('0x42')]=_[_0x990c('0x43')](_0x2694a3[_0x990c('0x3f')],_0x2694a3[_0x990c('0x41')]);_0x2bfac2['attributes']=_['intersection'](_0x2694a3[_0x990c('0x3f')],qs['fields'](_0x28eae8[_0x990c('0x41')][_0x990c('0x45')]));_0x2bfac2[_0x990c('0x44')]=_0x2bfac2[_0x990c('0x44')][_0x990c('0x46')]?_0x2bfac2[_0x990c('0x44')]:_0x2694a3[_0x990c('0x3f')];if(!_0x28eae8[_0x990c('0x41')]['hasOwnProperty'](_0x990c('0x48'))){_0x2bfac2[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x28eae8['query'][_0x990c('0x23')]);_0x2bfac2[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x28eae8[_0x990c('0x41')][_0x990c('0x21')]);}_0x2bfac2[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x28eae8['query'][_0x990c('0x4a')]);_0x2bfac2[_0x990c('0x4b')]=qs[_0x990c('0x42')](_[_0x990c('0x4c')](_0x28eae8['query'],_0x2694a3[_0x990c('0x42')]));_0x2bfac2[_0x990c('0x4b')][_0x990c('0x66')]=_0x453f74['id'];if(_0x28eae8['query'][_0x990c('0x30')]){_0x2bfac2[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x2bfac2[_0x990c('0x4b')],{'$or':_['map'](_0x2bfac2['attributes'],function(_0x3d1a2e){var _0x5c1592={};_0x5c1592[_0x3d1a2e]={'$like':'%'+_0x28eae8[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x5c1592;})});}_0x2bfac2=_[_0x990c('0x4d')]({},_0x2bfac2,_0x28eae8[_0x990c('0x4f')]);return db[_0x990c('0x68')]['count']({'where':_0x2bfac2[_0x990c('0x4b')]})[_0x990c('0x2b')](function(_0x302ad8){_0x2d9efd[_0x990c('0x24')]=_0x302ad8;if(_0x28eae8['query'][_0x990c('0x57')]){_0x2bfac2[_0x990c('0x50')]=[{'all':!![]}];}return db[_0x990c('0x68')]['findAll'](_0x2bfac2);})[_0x990c('0x2b')](function(_0x41133f){_0x2d9efd[_0x990c('0x52')]=_0x41133f;return _0x2d9efd;});}})['then'](respondWithFilteredResult(_0x3850c5,_0x2bfac2))['catch'](handleError(_0x3850c5,null));};exports[_0x990c('0x69')]=function(_0x4b8571,_0x258fa9,_0xc9964f){var _0x2692c0={'raw':!![],'where':{}};var _0xd30a65={};var _0x53b143={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x990c('0x65')]({'where':{'id':_0x4b8571[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x258fa9,null))[_0x990c('0x2b')](function(_0x531f5a){if(_0x531f5a){_0xd30a65[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x6a')]['rawAttributes']);_0xd30a65[_0x990c('0x41')]=_[_0x990c('0x40')](_0x4b8571[_0x990c('0x41')]);_0xd30a65['filters']=_['intersection'](_0xd30a65['model'],_0xd30a65[_0x990c('0x41')]);_0x2692c0[_0x990c('0x44')]=_[_0x990c('0x43')](_0xd30a65[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x4b8571[_0x990c('0x41')][_0x990c('0x45')]));_0x2692c0[_0x990c('0x44')]=_0x2692c0[_0x990c('0x44')][_0x990c('0x46')]?_0x2692c0['attributes']:_0xd30a65['model'];if(!_0x4b8571[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x2692c0[_0x990c('0x23')]=qs['limit'](_0x4b8571[_0x990c('0x41')][_0x990c('0x23')]);_0x2692c0[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x4b8571['query'][_0x990c('0x21')]);}_0x2692c0[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x4b8571[_0x990c('0x41')]['sort']);_0x2692c0['where']=qs['filters'](_[_0x990c('0x4c')](_0x4b8571[_0x990c('0x41')],_0xd30a65[_0x990c('0x42')]));_0x2692c0[_0x990c('0x4b')][_0x990c('0x66')]=_0x531f5a['id'];if(_0x4b8571[_0x990c('0x41')]['filter']){_0x2692c0[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x2692c0[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x2692c0[_0x990c('0x44')],function(_0x4b8f11){var _0x5c6e72={};_0x5c6e72[_0x4b8f11]={'$like':'%'+_0x4b8571[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x5c6e72;})});}_0x2692c0=_[_0x990c('0x4d')]({},_0x2692c0,_0x4b8571['options']);return db[_0x990c('0x6a')][_0x990c('0x24')]({'where':_0x2692c0[_0x990c('0x4b')]})[_0x990c('0x2b')](function(_0x3b536d){_0x53b143[_0x990c('0x24')]=_0x3b536d;if(_0x4b8571[_0x990c('0x41')][_0x990c('0x57')]){_0x2692c0[_0x990c('0x50')]=[{'all':!![]}];}return db[_0x990c('0x6a')]['findAll'](_0x2692c0);})[_0x990c('0x2b')](function(_0x2bfdc6){_0x53b143[_0x990c('0x52')]=_0x2bfdc6;return _0x53b143;});}})[_0x990c('0x2b')](respondWithFilteredResult(_0x258fa9,_0x2692c0))[_0x990c('0x53')](handleError(_0x258fa9,null));};exports[_0x990c('0x6b')]=function(_0x1024df,_0x2376ea,_0x537527){var _0x379441={'raw':!![],'where':{}};var _0xbc75ba={};var _0x2ed21c={'count':0x0,'rows':[]};return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x1024df[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x2376ea,null))[_0x990c('0x2b')](function(_0x2be0ad){if(_0x2be0ad){_0xbc75ba[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x6c')][_0x990c('0x56')]);_0xbc75ba[_0x990c('0x41')]=_[_0x990c('0x40')](_0x1024df[_0x990c('0x41')]);_0xbc75ba[_0x990c('0x42')]=_[_0x990c('0x43')](_0xbc75ba[_0x990c('0x3f')],_0xbc75ba[_0x990c('0x41')]);_0x379441[_0x990c('0x44')]=_['intersection'](_0xbc75ba['model'],qs[_0x990c('0x45')](_0x1024df['query'][_0x990c('0x45')]));_0x379441[_0x990c('0x44')]=_0x379441[_0x990c('0x44')][_0x990c('0x46')]?_0x379441[_0x990c('0x44')]:_0xbc75ba[_0x990c('0x3f')];if(!_0x1024df[_0x990c('0x41')]['hasOwnProperty']('nolimit')){_0x379441[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x1024df[_0x990c('0x41')]['limit']);_0x379441[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x1024df[_0x990c('0x41')]['offset']);}_0x379441[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x1024df[_0x990c('0x41')][_0x990c('0x4a')]);_0x379441['where']=qs[_0x990c('0x42')](_['pick'](_0x1024df[_0x990c('0x41')],_0xbc75ba[_0x990c('0x42')]));_0x379441[_0x990c('0x4b')]['VoiceQueueId']=_0x2be0ad['id'];if(_0x1024df['query'][_0x990c('0x30')]){_0x379441[_0x990c('0x4b')]=_['merge'](_0x379441[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x379441[_0x990c('0x44')],function(_0x1bfd1b){var _0x176804={};_0x176804[_0x1bfd1b]={'$like':'%'+_0x1024df[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x176804;})});}_0x379441=_[_0x990c('0x4d')]({},_0x379441,_0x1024df[_0x990c('0x4f')]);return db[_0x990c('0x6c')][_0x990c('0x24')]({'where':_0x379441[_0x990c('0x4b')]})['then'](function(_0x142e70){_0x2ed21c[_0x990c('0x24')]=_0x142e70;if(_0x1024df[_0x990c('0x41')][_0x990c('0x57')]){_0x379441[_0x990c('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x990c('0x51')](_0x379441);})[_0x990c('0x2b')](function(_0x150c11){_0x2ed21c['rows']=_0x150c11;return _0x2ed21c;});}})[_0x990c('0x2b')](respondWithFilteredResult(_0x2376ea,_0x379441))[_0x990c('0x53')](handleError(_0x2376ea,null));};exports[_0x990c('0x6d')]=function(_0x16ed48,_0x2aac56,_0x4d4d94){var _0x5f071a={};var _0x10461e={};var _0x5d1c1a;var _0x1855b3;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x16ed48[_0x990c('0x55')]['id']}})['then'](handleEntityNotFound(_0x2aac56,null))['then'](function(_0x18a128){if(_0x18a128){_0x5d1c1a=_0x18a128;_0x10461e[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x6e')][_0x990c('0x56')]);_0x10461e[_0x990c('0x41')]=_[_0x990c('0x40')](_0x16ed48[_0x990c('0x41')]);_0x10461e['filters']=_[_0x990c('0x43')](_0x10461e[_0x990c('0x3f')],_0x10461e[_0x990c('0x41')]);_0x5f071a[_0x990c('0x44')]=_[_0x990c('0x43')](_0x10461e[_0x990c('0x3f')],qs['fields'](_0x16ed48[_0x990c('0x41')][_0x990c('0x45')]));_0x5f071a[_0x990c('0x44')]=_0x5f071a['attributes'][_0x990c('0x46')]?_0x5f071a[_0x990c('0x44')]:_0x10461e[_0x990c('0x3f')];_0x5f071a[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x16ed48[_0x990c('0x41')][_0x990c('0x4a')]);_0x5f071a[_0x990c('0x4b')]=qs['filters'](_['pick'](_0x16ed48[_0x990c('0x41')],_0x10461e[_0x990c('0x42')]));if(_0x16ed48[_0x990c('0x41')][_0x990c('0x30')]){_0x5f071a[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x5f071a['where'],{'$or':_[_0x990c('0x32')](_0x5f071a[_0x990c('0x44')],function(_0x2ab228){var _0x376054={};_0x376054[_0x2ab228]={'$like':'%'+_0x16ed48[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x376054;})});}_0x5f071a=_[_0x990c('0x4d')]({},_0x5f071a,_0x16ed48[_0x990c('0x4f')]);return _0x5d1c1a[_0x990c('0x6d')](_0x5f071a);}})[_0x990c('0x2b')](function(_0x47923b){if(_0x47923b){_0x1855b3=_0x47923b[_0x990c('0x46')];if(!_0x16ed48[_0x990c('0x41')][_0x990c('0x47')]('nolimit')){_0x5f071a[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x16ed48[_0x990c('0x41')][_0x990c('0x23')]);_0x5f071a[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x16ed48['query'][_0x990c('0x21')]);}return _0x5d1c1a['getTeams'](_0x5f071a);}})[_0x990c('0x2b')](function(_0x29d2dc){if(_0x29d2dc){return _0x29d2dc?{'count':_0x1855b3,'rows':_0x29d2dc}:null;}})[_0x990c('0x2b')](respondWithResult(_0x2aac56,null))[_0x990c('0x53')](handleError(_0x2aac56,null));};exports[_0x990c('0x6f')]=function(_0x443441,_0x549ed,_0x1d0ddd){var _0x4c6cb5=_0x443441['body'][_0x990c('0x70')];var _0x22d406=_[_0x990c('0x32')](_0x4c6cb5,'id');return db[_0x990c('0x6e')][_0x990c('0x51')]({'where':{'id':_0x22d406},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x990c('0x37'),_0x990c('0x71'),_0x990c('0x72'),_0x990c('0x73')],'raw':!![]}]})[_0x990c('0x2b')](function(_0x2817a2){if(_0x2817a2){var _0x57449a=_[_0x990c('0x74')](_0x2817a2,function(_0x1fff00){var _0x482c48=_0x1fff00[_0x990c('0x59')]({'plain':!![]});_0x482c48[_0x990c('0x75')]['forEach'](function(_0x2e8652){_0x2e8652[_0x990c('0x76')]=_[_0x990c('0x36')](_0x4c6cb5,{'id':_0x482c48['id']})[_0x990c('0x76')];});return _0x482c48['Agents'];});return db[_0x990c('0x3c')]['find']({'where':{'id':_0x443441[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](function(_0x138d61){return db['sequelize']['transaction'](function(_0xbcdf3e){return _0x138d61[_0x990c('0x6f')](_0x22d406,{'transaction':_0xbcdf3e})[_0x990c('0x2b')](function(){return BPromise['each'](_0x4c6cb5,function(_0x42c333){return db[_0x990c('0x77')][_0x990c('0x78')]({'TeamId':_0x42c333['id'],'VoiceQueueId':_0x443441['params']['id'],'penalty':_0x42c333[_0x990c('0x76')]},{'transaction':_0xbcdf3e});});})[_0x990c('0x2b')](function(){return BPromise[_0x990c('0x79')](_0x57449a,function(_0x16d146){return db[_0x990c('0x7a')][_0x990c('0x7b')]({'where':{'UserId':_0x16d146['id'],'VoiceQueueId':_0x443441[_0x990c('0x55')]['id']},'defaults':{'penalty':_0x16d146[_0x990c('0x76')]},'transaction':_0xbcdf3e});});})[_0x990c('0x2b')](function(){return BPromise[_0x990c('0x79')](_[_0x990c('0x30')](_0x57449a,{'online':!![]}),function(_0x21304e){return db['UserVoiceQueueRt'][_0x990c('0x78')]({'membername':_0x21304e['name'],'UserId':_0x21304e['id'],'queue_name':_0x138d61[_0x990c('0x37')],'VoiceQueueId':_0x138d61['id'],'interface':_['isNil'](_0x21304e[_0x990c('0x73')])?util[_0x990c('0x7c')](_0x990c('0x7d'),_0x21304e[_0x990c('0x37')]):_0x21304e['interface'],'paused':_0x21304e['voicePause']||![],'penalty':_0x21304e[_0x990c('0x76')]},{'transaction':_0xbcdf3e});});})[_0x990c('0x2b')](function(){_0x57449a[_0x990c('0x7e')](function(_0x18b512){socket['emit'](_0x990c('0x7f'),{'UserId':_0x18b512['id'],'VoiceQueueId':_0x138d61['id']});});});});});}})['then'](respondWithStatusCode(_0x549ed,null))['catch'](handleError(_0x549ed,null));};exports[_0x990c('0x80')]=function(_0x5182f3,_0x3a9d2c,_0x15b877){return db[_0x990c('0x6e')][_0x990c('0x51')]({'where':{'id':_0x5182f3[_0x990c('0x41')][_0x990c('0x81')]},'attributes':['id'],'include':[{'model':db[_0x990c('0x82')],'as':_0x990c('0x75'),'attributes':['id'],'raw':!![]}]})[_0x990c('0x2b')](handleEntityNotFound(_0x3a9d2c,null))[_0x990c('0x2b')](function(_0x3db190){var _0x4ed33b=_[_0x990c('0x32')](_0x3db190,'id');var _0x324f1f=[];var _0x99e936=[];var _0x59f0df=squel[_0x990c('0x83')]();_0x59f0df[_0x990c('0x84')]('tq.TeamId')[_0x990c('0x85')]('team_has_voice_queues','tq')[_0x990c('0x86')](_0x990c('0x87'),'ut',_0x990c('0x88'))[_0x990c('0x4b')](_0x990c('0x89'),_0x5182f3[_0x990c('0x55')]['id']);for(var _0x30cf1b=0x0;_0x30cf1b<_0x3db190[_0x990c('0x46')];_0x30cf1b+=0x1){let _0x379495=_0x3db190[_0x30cf1b];for(var _0x3513f8=0x0;_0x3513f8<_0x379495[_0x990c('0x75')][_0x990c('0x46')];_0x3513f8+=0x1){let _0x3a758b=_0x379495['Agents'][_0x3513f8];var _0x41bd1c=_0x59f0df['clone']();_0x41bd1c[_0x990c('0x4b')]('ut.UserId\x20=\x20?',_0x3a758b['id']);_0x99e936[_0x990c('0x8a')](db[_0x990c('0x8b')][_0x990c('0x41')](_0x41bd1c['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x990c('0x2b')](function(_0x32d695){if(_0x32d695['length']===0x1){return _0x3a758b['id'];}else{var _0x39a89a=_[_0x990c('0x8c')](_[_0x990c('0x32')](_0x32d695,_0x990c('0x8d')),function(_0x5ddab5){return _[_0x990c('0x34')](_0x4ed33b,_0x5ddab5);});if(_0x39a89a){return _0x3a758b['id'];}}}));}}return BPromise['all'](_0x99e936)['then'](function(_0x163e70){_0x324f1f=_(_0x324f1f)[_0x990c('0x8e')](_0x163e70)['compact']()[_0x990c('0x33')]();return db[_0x990c('0x3c')]['find']({'where':{'id':_0x5182f3[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](function(_0x1308e0){return db[_0x990c('0x8b')]['transaction'](function(_0x59141a){return _0x1308e0[_0x990c('0x80')](_0x5182f3['query'][_0x990c('0x81')],{'transaction':_0x59141a})['then'](function(){if(!_['isEmpty'](_0x324f1f)){return _0x1308e0[_0x990c('0x8f')](_0x324f1f,{'transaction':_0x59141a})[_0x990c('0x2b')](function(){return db['UserVoiceQueueRt'][_0x990c('0x2c')]({'where':{'VoiceQueueId':_0x5182f3[_0x990c('0x55')]['id'],'UserId':_0x324f1f},'transaction':_0x59141a});});}})[_0x990c('0x2b')](function(){_0x324f1f[_0x990c('0x7e')](function(_0x4a33d6){socket[_0x990c('0x90')]('userVoiceQueue:remove',{'UserId':_0x4a33d6,'VoiceQueueId':_0x1308e0['id']});});});});});});})['then'](respondWithStatusCode(_0x3a9d2c,null))['catch'](handleError(_0x3a9d2c,null));};exports[_0x990c('0x91')]=function(_0x1244a7,_0x82e15d,_0xaec708){var _0x4e69f8,_0x514da1;return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x1244a7[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x82e15d,null))[_0x990c('0x2b')](function(_0x45ad9c){if(_0x45ad9c){_0x514da1=_0x45ad9c;return _0x45ad9c[_0x990c('0x91')](_0x1244a7[_0x990c('0x63')][_0x990c('0x81')],_[_0x990c('0x92')](_0x1244a7[_0x990c('0x63')],[_0x990c('0x81'),'id'])||{})[_0x990c('0x93')](function(_0x2db566){for(var _0x201890=0x0;_0x201890<_0x1244a7['body']['ids'][_0x990c('0x46')];_0x201890+=0x1){socket[_0x990c('0x90')](_0x990c('0x7f'),{'UserId':Number(_0x1244a7[_0x990c('0x63')]['ids'][_0x201890]),'VoiceQueueId':Number(_0x1244a7[_0x990c('0x55')]['id'])});}return _0x2db566;});}})[_0x990c('0x2b')](function(_0x337ece){_0x4e69f8=_0x337ece||[];if(_0x514da1){return db[_0x990c('0x82')][_0x990c('0x51')]({'where':{'id':_0x1244a7[_0x990c('0x63')][_0x990c('0x81')]},'attributes':['id',_0x990c('0x37'),_0x990c('0x71'),_0x990c('0x72'),'interface'],'raw':!![]});}})['then'](function(_0x4aa92b){if(!_[_0x990c('0x94')](_0x4aa92b)){var _0x9b41fa=[];for(var _0x80c1b9=0x0;_0x80c1b9<_0x4aa92b['length'];_0x80c1b9++){if(_0x4aa92b[_0x80c1b9]['online']){_0x9b41fa[_0x990c('0x8a')](db[_0x990c('0x95')][_0x990c('0x78')]({'membername':_0x4aa92b[_0x80c1b9]['name'],'UserId':_0x4aa92b[_0x80c1b9]['id'],'queue_name':_0x514da1[_0x990c('0x37')],'VoiceQueueId':_0x514da1['id'],'interface':_[_0x990c('0x96')](_0x4aa92b[_0x80c1b9][_0x990c('0x73')])?util[_0x990c('0x7c')]('SIP/%s',_0x4aa92b[_0x80c1b9][_0x990c('0x37')]):_0x4aa92b[_0x80c1b9]['interface'],'paused':_0x4aa92b[_0x80c1b9][_0x990c('0x72')]||![],'penalty':_0x1244a7[_0x990c('0x63')]['penalty']||0x0}));}}return BPromise[_0x990c('0x97')](_0x9b41fa);}})[_0x990c('0x2b')](function(){return _0x4e69f8;})[_0x990c('0x2b')](respondWithResult(_0x82e15d,null))['catch'](handleError(_0x82e15d,null));};exports[_0x990c('0x8f')]=function(_0x3017c1,_0x240ff5,_0x13ef8d){return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x3017c1[_0x990c('0x55')]['id']}})['then'](handleEntityNotFound(_0x240ff5,null))[_0x990c('0x2b')](function(_0x1f421d){if(_0x1f421d){return _0x1f421d['removeAgents'](_0x3017c1[_0x990c('0x41')][_0x990c('0x81')])[_0x990c('0x2b')](function(){if(_['isArray'](_0x3017c1[_0x990c('0x41')][_0x990c('0x81')])){for(var _0x1d10ae=0x0;_0x1d10ae<_0x3017c1[_0x990c('0x41')][_0x990c('0x81')][_0x990c('0x46')];_0x1d10ae+=0x1){socket['emit'](_0x990c('0x98'),{'UserId':Number(_0x3017c1[_0x990c('0x41')]['ids'][_0x1d10ae]),'VoiceQueueId':Number(_0x3017c1[_0x990c('0x55')]['id'])});}}else{socket[_0x990c('0x90')](_0x990c('0x98'),{'UserId':Number(_0x3017c1[_0x990c('0x41')][_0x990c('0x81')]),'VoiceQueueId':Number(_0x3017c1['params']['id'])});}});}})[_0x990c('0x2b')](function(_0x3b3d88){return db[_0x990c('0x95')][_0x990c('0x2c')]({'where':{'VoiceQueueId':_0x3017c1['params']['id'],'UserId':_0x3017c1[_0x990c('0x41')]['ids']}})['then'](function(){return _0x3b3d88;});})[_0x990c('0x2b')](respondWithStatusCode(_0x240ff5,null))[_0x990c('0x53')](handleError(_0x240ff5,null));};exports[_0x990c('0x99')]=function(_0x615337,_0x544bb4,_0x475c1a){var _0x437306={};var _0x2d7024={};var _0xb6570a;var _0x4e77c2;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x615337['params']['id']}})['then'](handleEntityNotFound(_0x544bb4,null))[_0x990c('0x2b')](function(_0x4c4b93){if(_0x4c4b93){_0xb6570a=_0x4c4b93;_0x2d7024[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x82')]['rawAttributes']);_0x2d7024['query']=_[_0x990c('0x40')](_0x615337[_0x990c('0x41')]);_0x2d7024[_0x990c('0x42')]=_[_0x990c('0x43')](_0x2d7024[_0x990c('0x3f')],_0x2d7024[_0x990c('0x41')]);_0x437306['attributes']=_[_0x990c('0x43')](_0x2d7024[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x615337['query'][_0x990c('0x45')]));_0x437306[_0x990c('0x44')]=_0x437306[_0x990c('0x44')][_0x990c('0x46')]?_0x437306[_0x990c('0x44')]:_0x2d7024['model'];_0x437306[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x615337['query'][_0x990c('0x4a')]);_0x437306['where']=qs['filters'](_[_0x990c('0x4c')](_0x615337['query'],_0x2d7024['filters']));if(_0x615337[_0x990c('0x41')][_0x990c('0x30')]){_0x437306[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x437306[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x437306[_0x990c('0x44')],function(_0x2f3075){var _0x95b2c2={};_0x95b2c2[_0x2f3075]={'$like':'%'+_0x615337[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x95b2c2;})});}_0x437306=_[_0x990c('0x4d')]({},_0x437306,_0x615337[_0x990c('0x4f')]);return _0xb6570a['getAgents'](_0x437306);}})[_0x990c('0x2b')](function(_0x1baac4){if(_0x1baac4){_0x4e77c2=_0x1baac4[_0x990c('0x46')];if(!_0x615337[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x437306[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x615337[_0x990c('0x41')]['limit']);_0x437306[_0x990c('0x21')]=qs['offset'](_0x615337[_0x990c('0x41')][_0x990c('0x21')]);}return _0xb6570a['getAgents'](_0x437306);}})[_0x990c('0x2b')](function(_0x261ab3){if(_0x261ab3){return _0x261ab3?{'count':_0x4e77c2,'rows':_0x261ab3}:null;}})[_0x990c('0x2b')](respondWithResult(_0x544bb4,null))[_0x990c('0x53')](handleError(_0x544bb4,null));};exports[_0x990c('0x9a')]=function(_0x1ee77f,_0x295a07,_0xc0f5f4){var _0x393156={};var _0x436247={};var _0x212785;var _0x48ceb2;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x1ee77f[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x295a07,null))['then'](function(_0x1a3852){if(_0x1a3852){_0x212785=_0x1a3852;_0x436247[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x95')][_0x990c('0x56')]);_0x436247[_0x990c('0x41')]=_['keys'](_0x1ee77f['query']);_0x436247[_0x990c('0x42')]=_['intersection'](_0x436247[_0x990c('0x3f')],_0x436247[_0x990c('0x41')]);_0x393156[_0x990c('0x44')]=_[_0x990c('0x43')](_0x436247[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x1ee77f[_0x990c('0x41')][_0x990c('0x45')]));_0x393156[_0x990c('0x44')]=_0x393156['attributes']['length']?_0x393156[_0x990c('0x44')]:_0x436247[_0x990c('0x3f')];_0x393156[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x1ee77f[_0x990c('0x41')]['sort']);_0x393156[_0x990c('0x4b')]=qs[_0x990c('0x42')](_['pick'](_0x1ee77f[_0x990c('0x41')],_0x436247[_0x990c('0x42')]));if(_0x1ee77f[_0x990c('0x41')][_0x990c('0x30')]){_0x393156[_0x990c('0x4b')]=_['merge'](_0x393156[_0x990c('0x4b')],{'$or':_['map'](_0x393156['attributes'],function(_0x5ed087){var _0x37e75a={};_0x37e75a[_0x5ed087]={'$like':'%'+_0x1ee77f[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x37e75a;})});}_0x393156=_['merge']({},_0x393156,_0x1ee77f['options']);return _0x212785['getMembers'](_0x393156);}})[_0x990c('0x2b')](function(_0x38c0e6){if(_0x38c0e6){_0x48ceb2=_0x38c0e6['length'];if(!_0x1ee77f[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x393156[_0x990c('0x23')]=qs['limit'](_0x1ee77f['query'][_0x990c('0x23')]);_0x393156[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x1ee77f[_0x990c('0x41')][_0x990c('0x21')]);}return _0x212785[_0x990c('0x9a')](_0x393156);}})[_0x990c('0x2b')](function(_0xeceab8){return _0xeceab8?{'count':_0x48ceb2,'rows':_0xeceab8}:null;})[_0x990c('0x2b')](respondWithResult(_0x295a07,null))['catch'](handleError(_0x295a07,null));};exports[_0x990c('0x9b')]=function(_0x1e5ccd,_0x15006a,_0x3c9326){var _0x31683a={};var _0x31144c={};var _0x379428;var _0xd3aa39;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x1e5ccd[_0x990c('0x55')]['id']}})['then'](handleEntityNotFound(_0x15006a,null))[_0x990c('0x2b')](function(_0x489358){if(_0x489358){_0x379428=_0x489358;_0x31144c['model']=_[_0x990c('0x40')](db['CmList'][_0x990c('0x56')]);_0x31144c[_0x990c('0x41')]=_[_0x990c('0x40')](_0x1e5ccd[_0x990c('0x41')]);_0x31144c[_0x990c('0x42')]=_[_0x990c('0x43')](_0x31144c[_0x990c('0x3f')],_0x31144c[_0x990c('0x41')]);_0x31683a[_0x990c('0x44')]=_[_0x990c('0x43')](_0x31144c[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x1e5ccd[_0x990c('0x41')][_0x990c('0x45')]));_0x31683a['attributes']=_0x31683a['attributes'][_0x990c('0x46')]?_0x31683a[_0x990c('0x44')]:_0x31144c[_0x990c('0x3f')];_0x31683a[_0x990c('0x49')]=qs['sort'](_0x1e5ccd['query'][_0x990c('0x4a')]);_0x31683a[_0x990c('0x4b')]=qs[_0x990c('0x42')](_[_0x990c('0x4c')](_0x1e5ccd['query'],_0x31144c['filters']));if(_0x1e5ccd['query'][_0x990c('0x30')]){_0x31683a[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x31683a[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x31683a[_0x990c('0x44')],function(_0x525736){var _0x1fa533={};_0x1fa533[_0x525736]={'$like':'%'+_0x1e5ccd[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x1fa533;})});}_0x31683a=_[_0x990c('0x4d')]({},_0x31683a,_0x1e5ccd[_0x990c('0x4f')]);return _0x379428['getLists'](_0x31683a);}})['then'](function(_0x487d77){if(_0x487d77){_0xd3aa39=_0x487d77['length'];if(!_0x1e5ccd[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x31683a[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x1e5ccd[_0x990c('0x41')][_0x990c('0x23')]);_0x31683a[_0x990c('0x21')]=qs['offset'](_0x1e5ccd[_0x990c('0x41')][_0x990c('0x21')]);}return _0x379428[_0x990c('0x9b')](_0x31683a);}})['then'](function(_0x55906c){if(_0x55906c){return _0x55906c?{'count':_0xd3aa39,'rows':_0x55906c}:null;}})[_0x990c('0x2b')](respondWithResult(_0x15006a,null))[_0x990c('0x53')](handleError(_0x15006a,null));};exports[_0x990c('0x9c')]=function(_0x47f240,_0x4b6ea9,_0x3f2422){var _0x48a3e1,_0x2c589c;return db['VoiceQueue']['find']({'where':{'id':_0x47f240[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x4b6ea9,null))[_0x990c('0x2b')](function(_0x286c0c){if(_0x286c0c){_0x2c589c=_0x286c0c;return _0x286c0c[_0x990c('0x9c')](_0x47f240[_0x990c('0x63')]['ids'],_[_0x990c('0x92')](_0x47f240['body'],[_0x990c('0x81'),'id'])||{});}return null;})[_0x990c('0x93')](function(_0xd1a5c9){var _0x58211c;_0x48a3e1=_0xd1a5c9||[];var _0x57f596=[];if(_0xd1a5c9){for(var _0x50484d=0x0;_0x50484d<_0xd1a5c9[_0x990c('0x46')];_0x50484d+=0x1){var _0x1fea5e=_0xd1a5c9[_0x50484d][_0x990c('0x59')]({'plain':!![]});_0x2c589c[_0x990c('0x9d')]=_0x47f240[_0x990c('0x63')]['dialCheckDuplicateType']?_0x47f240[_0x990c('0x63')]['dialCheckDuplicateType']:_0x2c589c[_0x990c('0x9d')];switch(_0x2c589c[_0x990c('0x9d')]){case _0x990c('0x9e'):_0x58211c=squel[_0x990c('0x9f')]()[_0x990c('0xa0')](_0x990c('0xa1'))[_0x990c('0xa2')](['phone',_0x990c('0xa3'),_0x990c('0xa4'),_0x990c('0xa5'),_0x990c('0x66'),'createdAt',_0x990c('0x62')],squel[_0x990c('0x83')]()[_0x990c('0x84')](_0x990c('0xa6'),'phone')[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0xa3'))['field']('id',_0x990c('0xa4'))['field'](_0x1fea5e[_0x990c('0xa8')][_0x990c('0xa9')](),_0x990c('0xa5'))[_0x990c('0x84')](_0x47f240[_0x990c('0x55')]['id'][_0x990c('0xa9')](),_0x990c('0x66'))[_0x990c('0x84')](_0x990c('0xa7'),'createdAt')['field'](_0x990c('0xa7'),'updatedAt')[_0x990c('0x85')](_0x990c('0xaa'))[_0x990c('0x4b')]('deletedAt\x20IS\x20NULL')[_0x990c('0x4b')]('ListId\x20=\x20?',_0x1fea5e[_0x990c('0xa8')]['toString']())[_0x990c('0x4b')](_0x990c('0xab'))[_0x990c('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x990c('0x83')]()['field'](_0x990c('0xac'))['from'](_0x990c('0xad'))['where'](_0x990c('0x89'),_0x47f240[_0x990c('0x55')]['id'][_0x990c('0xa9')]()))[_0x990c('0x4b')](_0x990c('0xae'),squel[_0x990c('0x83')]()['field'](_0x990c('0xaf'))[_0x990c('0x85')](_0x990c('0xa1'))[_0x990c('0x4b')](_0x990c('0x89'),_0x47f240[_0x990c('0x55')]['id'][_0x990c('0xa9')]())))[_0x990c('0xa9')]();break;case _0x990c('0xb0'):_0x58211c=squel[_0x990c('0x9f')]()[_0x990c('0xa0')](_0x990c('0xa1'))[_0x990c('0xa2')]([_0x990c('0xa6'),'scheduledAt',_0x990c('0xa4'),_0x990c('0xa5'),_0x990c('0x66'),'createdAt','updatedAt'],squel['select']()[_0x990c('0x84')](_0x990c('0xa6'),_0x990c('0xa6'))['field'](_0x990c('0xa7'),_0x990c('0xa3'))[_0x990c('0x84')]('id',_0x990c('0xa4'))[_0x990c('0x84')](_0x1fea5e['CmListId']['toString'](),_0x990c('0xa5'))[_0x990c('0x84')](_0x47f240['params']['id'][_0x990c('0xa9')](),_0x990c('0x66'))[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0x61'))[_0x990c('0x84')](_0x990c('0xa7'),'updatedAt')[_0x990c('0x85')](_0x990c('0xaa'))[_0x990c('0x4b')](_0x990c('0xb1'))[_0x990c('0x4b')]('ListId\x20=\x20?',_0x1fea5e[_0x990c('0xa8')][_0x990c('0xa9')]())[_0x990c('0x4b')](_0x990c('0xab'))['where'](_0x990c('0xae'),squel[_0x990c('0x83')]()['field'](_0x990c('0xaf'))['from'](_0x990c('0xa1'))['where'](_0x990c('0x89'),_0x47f240[_0x990c('0x55')]['id'][_0x990c('0xa9')]())))[_0x990c('0xa9')]();break;default:_0x58211c=squel[_0x990c('0x9f')]()['into'](_0x990c('0xa1'))['fromQuery'](['phone',_0x990c('0xa3'),_0x990c('0xa4'),_0x990c('0xa5'),_0x990c('0x66'),_0x990c('0x61'),_0x990c('0x62')],squel[_0x990c('0x83')]()[_0x990c('0x84')](_0x990c('0xa6'),_0x990c('0xa6'))[_0x990c('0x84')]('NOW()',_0x990c('0xa3'))[_0x990c('0x84')]('id',_0x990c('0xa4'))['field'](_0x1fea5e[_0x990c('0xa8')][_0x990c('0xa9')](),'ListId')[_0x990c('0x84')](_0x47f240[_0x990c('0x55')]['id']['toString'](),'VoiceQueueId')[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0x61'))[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0x62'))['from']('cm_contacts')[_0x990c('0x4b')](_0x990c('0xb1'))[_0x990c('0x4b')](_0x990c('0xb2'),_0x1fea5e[_0x990c('0xa8')]['toString']())[_0x990c('0x4b')](_0x990c('0xab')))[_0x990c('0xa9')]();}_0x57f596['push'](db[_0x990c('0x8b')]['query'](_0x58211c));}return BPromise[_0x990c('0x97')](_0x57f596);}})['then'](function(){return _0x48a3e1;})[_0x990c('0x2b')](respondWithResult(_0x4b6ea9,null))[_0x990c('0x53')](handleError(_0x4b6ea9,null));};exports[_0x990c('0xb3')]=function(_0x161a3e,_0x41c142,_0x401534){return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x161a3e[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x41c142,null))[_0x990c('0x2b')](function(_0x5243d2){if(_0x5243d2){return _0x5243d2[_0x990c('0xb3')](_0x161a3e['query'][_0x990c('0x81')]);}})[_0x990c('0x2b')](function(_0x4774b5){if(_0x4774b5){return db[_0x990c('0x67')][_0x990c('0x2c')]({'where':{'ListId':_0x161a3e['query'][_0x990c('0x81')],'VoiceQueueId':_0x161a3e[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](function(){return _0x4774b5;});}})['then'](respondWithStatusCode(_0x41c142,null))['catch'](handleError(_0x41c142,null));};exports[_0x990c('0xb4')]=function(_0x3cea89,_0x4a3772,_0x18b0bf){var _0xd703cb={};var _0x2ffc11={};var _0x2e84b7;var _0x48e196;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x3cea89['params']['id']}})['then'](handleEntityNotFound(_0x4a3772,null))[_0x990c('0x2b')](function(_0x37e1cc){if(_0x37e1cc){_0x2e84b7=_0x37e1cc;_0x2ffc11['model']=_[_0x990c('0x40')](db[_0x990c('0xb5')]['rawAttributes']);_0x2ffc11[_0x990c('0x41')]=_[_0x990c('0x40')](_0x3cea89['query']);_0x2ffc11['filters']=_['intersection'](_0x2ffc11[_0x990c('0x3f')],_0x2ffc11[_0x990c('0x41')]);_0xd703cb['attributes']=_[_0x990c('0x43')](_0x2ffc11[_0x990c('0x3f')],qs['fields'](_0x3cea89[_0x990c('0x41')]['fields']));_0xd703cb['attributes']=_0xd703cb[_0x990c('0x44')][_0x990c('0x46')]?_0xd703cb[_0x990c('0x44')]:_0x2ffc11['model'];_0xd703cb['order']=qs[_0x990c('0x4a')](_0x3cea89[_0x990c('0x41')][_0x990c('0x4a')]);_0xd703cb[_0x990c('0x4b')]=qs['filters'](_[_0x990c('0x4c')](_0x3cea89[_0x990c('0x41')],_0x2ffc11[_0x990c('0x42')]));if(_0x3cea89[_0x990c('0x41')]['filter']){_0xd703cb[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0xd703cb[_0x990c('0x4b')],{'$or':_['map'](_0xd703cb['attributes'],function(_0x22cfea){var _0x3c1af5={};_0x3c1af5[_0x22cfea]={'$like':'%'+_0x3cea89[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x3c1af5;})});}_0xd703cb=_[_0x990c('0x4d')]({},_0xd703cb,_0x3cea89[_0x990c('0x4f')]);return _0x2e84b7['getBlackLists'](_0xd703cb);}})[_0x990c('0x2b')](function(_0x34407d){if(_0x34407d){_0x48e196=_0x34407d[_0x990c('0x46')];if(!_0x3cea89['query'][_0x990c('0x47')]('nolimit')){_0xd703cb[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x3cea89[_0x990c('0x41')]['limit']);_0xd703cb[_0x990c('0x21')]=qs['offset'](_0x3cea89['query']['offset']);}return _0x2e84b7[_0x990c('0xb4')](_0xd703cb);}})[_0x990c('0x2b')](function(_0x31f41e){if(_0x31f41e){return _0x31f41e?{'count':_0x48e196,'rows':_0x31f41e}:null;}})[_0x990c('0x2b')](respondWithResult(_0x4a3772,null))[_0x990c('0x53')](handleError(_0x4a3772,null));};exports[_0x990c('0xb6')]=function(_0x41cead,_0xf769b6,_0x2655f7){var _0x4cb1a6,_0x269ce5;return db['VoiceQueue'][_0x990c('0x36')]({'where':{'id':_0x41cead['params']['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0xf769b6,null))['then'](function(_0x1ea565){if(_0x1ea565){_0x269ce5=_0x1ea565;return _0x1ea565[_0x990c('0xb6')](_0x41cead[_0x990c('0x63')][_0x990c('0x81')],_['omit'](_0x41cead['body'],[_0x990c('0x81'),'id'])||{});}return null;})[_0x990c('0x93')](function(_0x4d917e){var _0x2e9db4;_0x4cb1a6=_0x4d917e||[];var _0xd31b09=[];if(_0x4d917e){for(var _0x2df855=0x0;_0x2df855<_0x4d917e[_0x990c('0x46')];_0x2df855+=0x1){var _0x358f66=_0x4d917e[_0x2df855][_0x990c('0x59')]({'plain':!![]});_0x2e9db4=squel[_0x990c('0x9f')]()[_0x990c('0xa0')](_0x990c('0xb7'))[_0x990c('0xa2')]([_0x990c('0xa6'),_0x990c('0xa4'),_0x990c('0xa5'),_0x990c('0x66'),_0x990c('0x61'),_0x990c('0x62')],squel[_0x990c('0x83')]()[_0x990c('0x84')](_0x990c('0xa6'),_0x990c('0xa6'))[_0x990c('0x84')]('id',_0x990c('0xa4'))[_0x990c('0x84')](_0x358f66[_0x990c('0xa8')][_0x990c('0xa9')](),_0x990c('0xa5'))['field'](_0x41cead[_0x990c('0x55')]['id'][_0x990c('0xa9')](),_0x990c('0x66'))[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0x61'))['field'](_0x990c('0xa7'),_0x990c('0x62'))[_0x990c('0x85')](_0x990c('0xaa'))[_0x990c('0x4b')](_0x990c('0xb1'))[_0x990c('0x4b')](_0x990c('0xb2'),_0x358f66[_0x990c('0xa8')][_0x990c('0xa9')]())[_0x990c('0x4b')](_0x990c('0xab')))[_0x990c('0xa9')]();_0xd31b09[_0x990c('0x8a')](db[_0x990c('0x8b')][_0x990c('0x41')](_0x2e9db4));}return BPromise[_0x990c('0x97')](_0xd31b09);}})['then'](function(){return _0x4cb1a6;})[_0x990c('0x2b')](respondWithResult(_0xf769b6,null))[_0x990c('0x53')](handleError(_0xf769b6,null));};exports[_0x990c('0xb8')]=function(_0x11f973,_0x3f0906,_0x1c68e8){return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x11f973[_0x990c('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f0906,null))[_0x990c('0x2b')](function(_0x461ab3){if(_0x461ab3){return _0x461ab3[_0x990c('0xb8')](_0x11f973[_0x990c('0x41')][_0x990c('0x81')]);}})[_0x990c('0x2b')](function(_0x483db0){if(_0x483db0){return db[_0x990c('0x6c')][_0x990c('0x2c')]({'where':{'ListId':_0x11f973['query'][_0x990c('0x81')],'VoiceQueueId':_0x11f973[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](function(){return _0x483db0;});}})[_0x990c('0x2b')](respondWithStatusCode(_0x3f0906,null))['catch'](handleError(_0x3f0906,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index c813a65..03bfc6e 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 _0x0dc8=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0dc8,0x115));var _0x80dc=function(_0x2ee974,_0x1cceb5){_0x2ee974=_0x2ee974-0x0;var _0x20c5fb=_0x0dc8[_0x2ee974];return _0x20c5fb;};'use strict';var EventEmitter=require(_0x80dc('0x0'));var VoiceQueue=require(_0x80dc('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x80dc('0x2')](0x0);var events={'afterCreate':_0x80dc('0x3'),'afterUpdate':_0x80dc('0x4'),'afterDestroy':_0x80dc('0x5')};function emitEvent(_0x33ba53){return function(_0xcf52af,_0x359a5a,_0x58db53){VoiceQueueEvents[_0x80dc('0x6')](_0x33ba53+':'+_0xcf52af['id'],_0xcf52af);VoiceQueueEvents[_0x80dc('0x6')](_0x33ba53,_0xcf52af);_0x58db53(null);};}for(var e in events){if(events[_0x80dc('0x7')](e)){var event=events[e];VoiceQueue[_0x80dc('0x8')](e,emitEvent(event));}}module[_0x80dc('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x2691=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x9e7f3a,_0x37105f){var _0x5ab145=function(_0x5b3bad){while(--_0x5b3bad){_0x9e7f3a['push'](_0x9e7f3a['shift']());}};_0x5ab145(++_0x37105f);}(_0x2691,0x1c3));var _0x1269=function(_0x4a1d58,_0x230fe9){_0x4a1d58=_0x4a1d58-0x0;var _0x18fcc3=_0x2691[_0x4a1d58];return _0x18fcc3;};'use strict';var EventEmitter=require(_0x1269('0x0'));var VoiceQueue=require(_0x1269('0x1'))['db'][_0x1269('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1269('0x3')](0x0);var events={'afterCreate':_0x1269('0x4'),'afterUpdate':_0x1269('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1779dc){return function(_0x263585,_0x3ae947,_0x2b1250){VoiceQueueEvents[_0x1269('0x6')](_0x1779dc+':'+_0x263585['id'],_0x263585);VoiceQueueEvents[_0x1269('0x6')](_0x1779dc,_0x263585);_0x2b1250(null);};}for(var e in events){if(events[_0x1269('0x7')](e)){var event=events[e];VoiceQueue[_0x1269('0x8')](e,emitEvent(event));}}module[_0x1269('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d5bd899..940a79b 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(_0xb08792,_0x298252){var _0x2d9992=function(_0x92b936){while(--_0x92b936){_0xb08792['push'](_0xb08792['shift']());}};_0x2d9992(++_0x298252);}(_0x008c,0x188));var _0xc008=function(_0x128056,_0x4f314b){_0x128056=_0x128056-0x0;var _0x47da14=_0x008c[_0x128056];return _0x47da14;};'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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x1877e2,_0x2b76d4){var _0x44e96a=function(_0x8760bf){while(--_0x8760bf){_0x1877e2['push'](_0x1877e2['shift']());}};_0x44e96a(++_0x2b76d4);}(_0x008c,0x188));var _0xc008=function(_0xa72e3a,_0x4d3bd1){_0xa72e3a=_0xa72e3a-0x0;var _0x41cff3=_0x008c[_0xa72e3a];return _0x41cff3;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index a22d8a5..b61a53b 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 _0x9e6e=['GetVoiceQueue','debug','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueue','findAll','raw','options','where','attributes','limit','include','map','model'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x9e6e,0x7f));var _0xe9e6=function(_0x1256b8,_0x1bba73){_0x1256b8=_0x1256b8-0x0;var _0x52bc82=_0x9e6e[_0x1256b8];return _0x52bc82;};'use strict';var _=require(_0xe9e6('0x0'));var util=require(_0xe9e6('0x1'));var moment=require(_0xe9e6('0x2'));var BPromise=require(_0xe9e6('0x3'));var rs=require(_0xe9e6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe9e6('0x6'));var config=require(_0xe9e6('0x7'));var jayson=require(_0xe9e6('0x8'));var client=jayson[_0xe9e6('0x9')][_0xe9e6('0xa')]({'port':0x232a});config['redis']=_[_0xe9e6('0xb')](config[_0xe9e6('0xc')],{'host':_0xe9e6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9e6('0xc')]));require('./voiceQueue.socket')[_0xe9e6('0xe')](socket);function respondWithRpcPromise(_0x51373e,_0x5223ba,_0x383306){return new BPromise(function(_0x25b5cf,_0x1380f1){return client[_0xe9e6('0xf')](_0x51373e,_0x383306)[_0xe9e6('0x10')](function(_0xd63bab){logger[_0xe9e6('0x11')](_0xe9e6('0x12'),_0x5223ba,_0xe9e6('0x13'));logger['debug'](_0xe9e6('0x14'),_0x5223ba,_0xe9e6('0x13'),JSON[_0xe9e6('0x15')](_0xd63bab));if(_0xd63bab[_0xe9e6('0x16')]){if(_0xd63bab[_0xe9e6('0x16')][_0xe9e6('0x17')]===0x1f4){logger[_0xe9e6('0x16')](_0xe9e6('0x12'),_0x5223ba,_0xd63bab[_0xe9e6('0x16')]['message']);return _0x1380f1(_0xd63bab[_0xe9e6('0x16')][_0xe9e6('0x18')]);}logger[_0xe9e6('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x5223ba,_0xd63bab['error'][_0xe9e6('0x18')]);return _0x25b5cf(_0xd63bab['error']['message']);}else{logger['info'](_0xe9e6('0x12'),_0x5223ba,_0xe9e6('0x13'));_0x25b5cf(_0xd63bab[_0xe9e6('0x19')][_0xe9e6('0x18')]);}})[_0xe9e6('0x1a')](function(_0x5c65db){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x5223ba,_0x5c65db);_0x1380f1(_0x5c65db);});});}exports['GetVoiceQueue']=function(_0x350bbd){var _0xc0fde3=this;return new Promise(function(_0x5cf952,_0x216c94){return db[_0xe9e6('0x1b')][_0xe9e6('0x1c')]({'raw':_0x350bbd['options']?_0x350bbd['options'][_0xe9e6('0x1d')]===undefined?!![]:![]:!![],'where':_0x350bbd[_0xe9e6('0x1e')]?_0x350bbd[_0xe9e6('0x1e')][_0xe9e6('0x1f')]||null:null,'attributes':_0x350bbd[_0xe9e6('0x1e')]?_0x350bbd[_0xe9e6('0x1e')][_0xe9e6('0x20')]||null:null,'limit':_0x350bbd[_0xe9e6('0x1e')]?_0x350bbd[_0xe9e6('0x1e')][_0xe9e6('0x21')]||null:null,'include':_0x350bbd[_0xe9e6('0x1e')]?_0x350bbd[_0xe9e6('0x1e')][_0xe9e6('0x22')]?_[_0xe9e6('0x23')](_0x350bbd[_0xe9e6('0x1e')]['include'],function(_0x3d5168){return{'model':db[_0x3d5168[_0xe9e6('0x24')]],'as':_0x3d5168['as'],'attributes':_0x3d5168[_0xe9e6('0x20')],'include':_0x3d5168[_0xe9e6('0x22')]?_[_0xe9e6('0x23')](_0x3d5168[_0xe9e6('0x22')],function(_0x133811){return{'model':db[_0x133811[_0xe9e6('0x24')]],'as':_0x133811['as'],'attributes':_0x133811[_0xe9e6('0x20')],'include':_0x133811[_0xe9e6('0x22')]?_[_0xe9e6('0x23')](_0x133811['include'],function(_0x5368e9){return{'model':db[_0x5368e9[_0xe9e6('0x24')]],'as':_0x5368e9['as'],'attributes':_0x5368e9[_0xe9e6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe9e6('0x10')](function(_0x19df3a){logger[_0xe9e6('0x11')](_0xe9e6('0x25'),_0x350bbd);logger[_0xe9e6('0x26')](_0xe9e6('0x25'),_0x350bbd,JSON[_0xe9e6('0x15')](_0x19df3a));_0x5cf952(_0x19df3a);})[_0xe9e6('0x1a')](function(_0x3fbb81){logger[_0xe9e6('0x16')]('GetVoiceQueue',_0x3fbb81[_0xe9e6('0x18')],_0x350bbd);_0x216c94(_0xc0fde3['error'](0x1f4,_0x3fbb81['message']));});});};exports[_0xe9e6('0x27')]=function(_0x11d358){var _0x43d253=this;return new Promise(function(_0x39e69e,_0x5c2d53){return db[_0xe9e6('0x1b')][_0xe9e6('0x28')]({'raw':_0x11d358[_0xe9e6('0x1e')]?_0x11d358[_0xe9e6('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x11d358['options']?_0x11d358['options'][_0xe9e6('0x1f')]||null:null,'attributes':_0x11d358[_0xe9e6('0x1e')]?_0x11d358[_0xe9e6('0x1e')][_0xe9e6('0x20')]||null:null,'include':_0x11d358['options']?_0x11d358[_0xe9e6('0x1e')]['include']?_[_0xe9e6('0x23')](_0x11d358['options']['include'],function(_0x5d0f13){return{'model':db[_0x5d0f13[_0xe9e6('0x24')]],'as':_0x5d0f13['as'],'attributes':_0x5d0f13[_0xe9e6('0x20')],'include':_0x5d0f13[_0xe9e6('0x22')]?_[_0xe9e6('0x23')](_0x5d0f13[_0xe9e6('0x22')],function(_0x13baa6){return{'model':db[_0x13baa6['model']],'as':_0x13baa6['as'],'attributes':_0x13baa6[_0xe9e6('0x20')],'include':_0x13baa6[_0xe9e6('0x22')]?_['map'](_0x13baa6[_0xe9e6('0x22')],function(_0x56da41){return{'model':db[_0x56da41[_0xe9e6('0x24')]],'as':_0x56da41['as'],'attributes':_0x56da41[_0xe9e6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe9e6('0x10')](function(_0x1571fa){logger[_0xe9e6('0x11')](_0xe9e6('0x27'),_0x11d358);logger[_0xe9e6('0x26')](_0xe9e6('0x27'),_0x11d358,JSON[_0xe9e6('0x15')](_0x1571fa));_0x39e69e(_0x1571fa);})['catch'](function(_0x223355){logger['error']('ShowVoiceQueue',_0x223355['message'],_0x11d358);_0x5c2d53(_0x43d253[_0xe9e6('0x16')](0x1f4,_0x223355[_0xe9e6('0x18')]));});});}; \ No newline at end of file +var _0xaeea=['defaults','localhost','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueue','findAll','options','where','include','map','attributes','model','VoiceQueue','find','raw','ShowVoiceQueue','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x21a01c,_0x22a078){var _0x12c123=function(_0x40b1f8){while(--_0x40b1f8){_0x21a01c['push'](_0x21a01c['shift']());}};_0x12c123(++_0x22a078);}(_0xaeea,0x8a));var _0xaaee=function(_0x121ab0,_0x56fcd3){_0x121ab0=_0x121ab0-0x0;var _0x4d94f0=_0xaeea[_0x121ab0];return _0x4d94f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaaee('0x0'));var db=require(_0xaaee('0x1'))['db'];var utils=require(_0xaaee('0x2'));var logger=require(_0xaaee('0x3'))(_0xaaee('0x4'));var config=require(_0xaaee('0x5'));var jayson=require(_0xaaee('0x6'));var client=jayson[_0xaaee('0x7')][_0xaaee('0x8')]({'port':0x232a});config[_0xaaee('0x9')]=_[_0xaaee('0xa')](config[_0xaaee('0x9')],{'host':_0xaaee('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaaee('0x9')]));require(_0xaaee('0xc'))[_0xaaee('0xd')](socket);function respondWithRpcPromise(_0x1932f9,_0x28db60,_0x4d2c06){return new BPromise(function(_0x5541b8,_0x37165d){return client['request'](_0x1932f9,_0x4d2c06)[_0xaaee('0xe')](function(_0x2914a8){logger[_0xaaee('0xf')](_0xaaee('0x10'),_0x28db60,_0xaaee('0x11'));logger[_0xaaee('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x28db60,_0xaaee('0x11'),JSON[_0xaaee('0x13')](_0x2914a8));if(_0x2914a8[_0xaaee('0x14')]){if(_0x2914a8['error'][_0xaaee('0x15')]===0x1f4){logger[_0xaaee('0x14')](_0xaaee('0x10'),_0x28db60,_0x2914a8['error'][_0xaaee('0x16')]);return _0x37165d(_0x2914a8[_0xaaee('0x14')][_0xaaee('0x16')]);}logger[_0xaaee('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x28db60,_0x2914a8['error'][_0xaaee('0x16')]);return _0x5541b8(_0x2914a8[_0xaaee('0x14')][_0xaaee('0x16')]);}else{logger[_0xaaee('0xf')](_0xaaee('0x10'),_0x28db60,'request\x20sent');_0x5541b8(_0x2914a8[_0xaaee('0x17')][_0xaaee('0x16')]);}})[_0xaaee('0x18')](function(_0x2b67f0){logger['error'](_0xaaee('0x10'),_0x28db60,_0x2b67f0);_0x37165d(_0x2b67f0);});});}exports[_0xaaee('0x19')]=function(_0x46dd1a){var _0x47e4d9=this;return new Promise(function(_0x33c63d,_0x3728e8){return db['VoiceQueue'][_0xaaee('0x1a')]({'raw':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a[_0xaaee('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a[_0xaaee('0x1b')][_0xaaee('0x1c')]||null:null,'attributes':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a[_0xaaee('0x1b')]['attributes']||null:null,'limit':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a['options']['limit']||null:null,'include':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a['options'][_0xaaee('0x1d')]?_[_0xaaee('0x1e')](_0x46dd1a['options'][_0xaaee('0x1d')],function(_0x2adb26){return{'model':db[_0x2adb26['model']],'as':_0x2adb26['as'],'attributes':_0x2adb26[_0xaaee('0x1f')],'include':_0x2adb26[_0xaaee('0x1d')]?_['map'](_0x2adb26[_0xaaee('0x1d')],function(_0x2a2f58){return{'model':db[_0x2a2f58['model']],'as':_0x2a2f58['as'],'attributes':_0x2a2f58[_0xaaee('0x1f')],'include':_0x2a2f58['include']?_['map'](_0x2a2f58[_0xaaee('0x1d')],function(_0x529d84){return{'model':db[_0x529d84[_0xaaee('0x20')]],'as':_0x529d84['as'],'attributes':_0x529d84[_0xaaee('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaaee('0xe')](function(_0x438243){logger[_0xaaee('0xf')](_0xaaee('0x19'),_0x46dd1a);logger[_0xaaee('0x12')](_0xaaee('0x19'),_0x46dd1a,JSON[_0xaaee('0x13')](_0x438243));_0x33c63d(_0x438243);})[_0xaaee('0x18')](function(_0x3ca61e){logger[_0xaaee('0x14')](_0xaaee('0x19'),_0x3ca61e[_0xaaee('0x16')],_0x46dd1a);_0x3728e8(_0x47e4d9[_0xaaee('0x14')](0x1f4,_0x3ca61e[_0xaaee('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x65dfea){var _0x55febc=this;return new Promise(function(_0x407d0c,_0x1ab17e){return db[_0xaaee('0x21')][_0xaaee('0x22')]({'raw':_0x65dfea[_0xaaee('0x1b')]?_0x65dfea[_0xaaee('0x1b')][_0xaaee('0x23')]===undefined?!![]:![]:!![],'where':_0x65dfea[_0xaaee('0x1b')]?_0x65dfea[_0xaaee('0x1b')][_0xaaee('0x1c')]||null:null,'attributes':_0x65dfea['options']?_0x65dfea[_0xaaee('0x1b')][_0xaaee('0x1f')]||null:null,'include':_0x65dfea[_0xaaee('0x1b')]?_0x65dfea[_0xaaee('0x1b')][_0xaaee('0x1d')]?_[_0xaaee('0x1e')](_0x65dfea[_0xaaee('0x1b')]['include'],function(_0x18e2f4){return{'model':db[_0x18e2f4[_0xaaee('0x20')]],'as':_0x18e2f4['as'],'attributes':_0x18e2f4[_0xaaee('0x1f')],'include':_0x18e2f4[_0xaaee('0x1d')]?_[_0xaaee('0x1e')](_0x18e2f4[_0xaaee('0x1d')],function(_0x1be841){return{'model':db[_0x1be841['model']],'as':_0x1be841['as'],'attributes':_0x1be841[_0xaaee('0x1f')],'include':_0x1be841[_0xaaee('0x1d')]?_[_0xaaee('0x1e')](_0x1be841['include'],function(_0xb0c49d){return{'model':db[_0xb0c49d[_0xaaee('0x20')]],'as':_0xb0c49d['as'],'attributes':_0xb0c49d[_0xaaee('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f56f3){logger[_0xaaee('0xf')]('ShowVoiceQueue',_0x65dfea);logger[_0xaaee('0x12')](_0xaaee('0x24'),_0x65dfea,JSON[_0xaaee('0x13')](_0x1f56f3));_0x407d0c(_0x1f56f3);})['catch'](function(_0x5bd328){logger['error'](_0xaaee('0x24'),_0x5bd328[_0xaaee('0x16')],_0x65dfea);_0x1ab17e(_0x55febc[_0xaaee('0x14')](0x1f4,_0x5bd328[_0xaaee('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index eb073ca..9008ec3 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 _0x67cf=['register','length','./voiceQueue.events','save','remove','emit','removeListener'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0x67cf,0x1a6));var _0xf67c=function(_0x264e7f,_0x4b8f91){_0x264e7f=_0x264e7f-0x0;var _0x173e6e=_0x67cf[_0x264e7f];return _0x173e6e;};'use strict';var VoiceQueueEvents=require(_0xf67c('0x0'));var events=[_0xf67c('0x1'),_0xf67c('0x2'),'update'];function createListener(_0x20a223,_0x53c55d){return function(_0x4b0b00){_0x53c55d[_0xf67c('0x3')](_0x20a223,_0x4b0b00);};}function removeListener(_0x3b2a40,_0x202a8b){return function(){VoiceQueueEvents[_0xf67c('0x4')](_0x3b2a40,_0x202a8b);};}exports[_0xf67c('0x5')]=function(_0x567fb1){for(var _0x95133f=0x0,_0x500ec9=events[_0xf67c('0x6')];_0x95133f<_0x500ec9;_0x95133f++){var _0x1a9daa=events[_0x95133f];var _0x13cf5b=createListener('voiceQueue:'+_0x1a9daa,_0x567fb1);VoiceQueueEvents['on'](_0x1a9daa,_0x13cf5b);}}; \ No newline at end of file +var _0x07d8=['removeListener','register','length','voiceQueue:','save','remove','update'];(function(_0x4fe95c,_0x5c291e){var _0xfd71b7=function(_0x943ead){while(--_0x943ead){_0x4fe95c['push'](_0x4fe95c['shift']());}};_0xfd71b7(++_0x5c291e);}(_0x07d8,0x169));var _0x807d=function(_0x279f0d,_0x1538c5){_0x279f0d=_0x279f0d-0x0;var _0x3d5289=_0x07d8[_0x279f0d];return _0x3d5289;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x807d('0x0'),_0x807d('0x1'),_0x807d('0x2')];function createListener(_0x1cedea,_0x5612f9){return function(_0x1d4792){_0x5612f9['emit'](_0x1cedea,_0x1d4792);};}function removeListener(_0x1e951d,_0x5a85a1){return function(){VoiceQueueEvents[_0x807d('0x3')](_0x1e951d,_0x5a85a1);};}exports[_0x807d('0x4')]=function(_0x341c24){for(var _0x37dadf=0x0,_0x2bc6e3=events[_0x807d('0x5')];_0x37dadf<_0x2bc6e3;_0x37dadf++){var _0x123633=events[_0x37dadf];var _0x2f7530=createListener(_0x807d('0x6')+_0x123633,_0x341c24);VoiceQueueEvents['on'](_0x123633,_0x2f7530);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 55b16c5..4ea5b86 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 _0xfb1b=['connect-timeout','Router','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','getVoiceQueuesReport','show','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x52d764,_0xa45348){var _0x55f629=function(_0x4d202a){while(--_0x4d202a){_0x52d764['push'](_0x52d764['shift']());}};_0x55f629(++_0xa45348);}(_0xfb1b,0x6a));var _0xbfb1=function(_0x132084,_0x5c5a51){_0x132084=_0x132084-0x0;var _0x2e043b=_0xfb1b[_0x132084];return _0x2e043b;};'use strict';var multer=require(_0xbfb1('0x0'));var util=require(_0xbfb1('0x1'));var path=require('path');var timeout=require(_0xbfb1('0x2'));var express=require('express');var router=express[_0xbfb1('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(_0xbfb1('0x4'));router[_0xbfb1('0x5')]('/',auth[_0xbfb1('0x6')](),controller[_0xbfb1('0x7')]);router[_0xbfb1('0x5')](_0xbfb1('0x8'),auth[_0xbfb1('0x6')](),controller['describe']);router[_0xbfb1('0x5')]('/index',auth['isAuthenticated'](),controller[_0xbfb1('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbfb1('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbfb1('0xb')]);router[_0xbfb1('0xc')]('/:id',auth[_0xbfb1('0x6')](),controller[_0xbfb1('0xd')]);router[_0xbfb1('0xe')](_0xbfb1('0xf'),auth[_0xbfb1('0x6')](),controller[_0xbfb1('0x10')]);module[_0xbfb1('0x11')]=router; \ No newline at end of file +var _0x7f25=['get','/index','getVoiceQueuesReport','show','create','put','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','/describe'];(function(_0x572ef4,_0x952e77){var _0x872eff=function(_0x4d1dc8){while(--_0x4d1dc8){_0x572ef4['push'](_0x572ef4['shift']());}};_0x872eff(++_0x952e77);}(_0x7f25,0x138));var _0x57f2=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0x7f25[_0xfb0281];return _0x408dd3;};'use strict';var multer=require('multer');var util=require(_0x57f2('0x0'));var path=require(_0x57f2('0x1'));var timeout=require('connect-timeout');var express=require(_0x57f2('0x2'));var router=express[_0x57f2('0x3')]();var fs_extra=require(_0x57f2('0x4'));var auth=require(_0x57f2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x57f2('0x6'));var controller=require(_0x57f2('0x7'));router['get']('/',auth[_0x57f2('0x8')](),controller[_0x57f2('0x9')]);router['get'](_0x57f2('0xa'),auth[_0x57f2('0x8')](),controller['describe']);router[_0x57f2('0xb')](_0x57f2('0xc'),auth[_0x57f2('0x8')](),controller[_0x57f2('0xd')]);router[_0x57f2('0xb')]('/:id',auth[_0x57f2('0x8')](),controller[_0x57f2('0xe')]);router['post']('/',auth[_0x57f2('0x8')](),controller[_0x57f2('0xf')]);router[_0x57f2('0x10')](_0x57f2('0x11'),auth[_0x57f2('0x8')](),controller['update']);router['delete'](_0x57f2('0x11'),auth[_0x57f2('0x8')](),controller['destroy']);module[_0x57f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ea82f49..ba297cc 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 _0xff8a=['seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','DATE','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','format','diff'];(function(_0x2692a1,_0x24046c){var _0x4469d2=function(_0x582df7){while(--_0x582df7){_0x2692a1['push'](_0x2692a1['shift']());}};_0x4469d2(++_0x24046c);}(_0xff8a,0x7d));var _0xaff8=function(_0x197b77,_0x41bcae){_0x197b77=_0x197b77-0x0;var _0x2f56af=_0xff8a[_0x197b77];return _0x2f56af;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaff8('0x0'));module[_0xaff8('0x1')]={'type':{'type':Sequelize[_0xaff8('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaff8('0x2')]},'queue':{'type':Sequelize[_0xaff8('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x14802e){var _0x1b326f=moment(_0x14802e);var _0x24492b=moment(this['getDataValue']('queuecallerjoinAt'))[_0xaff8('0x3')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3ef36a=_0x1b326f[_0xaff8('0x4')](_0x24492b,_0xaff8('0x5'));this[_0xaff8('0x6')](_0xaff8('0x7'),_0x14802e);this['setDataValue'](_0xaff8('0x8'),_0x3ef36a||null);}},'position':{'type':Sequelize[_0xaff8('0x9')]},'count':{'type':Sequelize[_0xaff8('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xaff8('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xaff8('0xb')]},'queuecallercomplete':{'type':Sequelize[_0xaff8('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xaff8('0xb')]},'queuecallerexit':{'type':Sequelize[_0xaff8('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xaff8('0xb')]},'queuecallerexitreason':{'type':Sequelize[_0xaff8('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xaff8('0x9')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xaff8('0x2')]},'connectedlinename':{'type':Sequelize[_0xaff8('0x2')]},'accountcode':{'type':Sequelize[_0xaff8('0x2')]},'context':{'type':Sequelize[_0xaff8('0x2')]},'exten':{'type':Sequelize[_0xaff8('0x2')]},'priority':{'type':Sequelize[_0xaff8('0x2')]},'holdtime':{'type':Sequelize[_0xaff8('0x9')]},'mohtime':{'type':Sequelize[_0xaff8('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xaff8('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xaff8('0x2')]},'transfer':{'type':Sequelize[_0xaff8('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaff8('0x2')],'comment':_0xaff8('0xc')},'transferexten':{'type':Sequelize[_0xaff8('0x2')]},'transferuniqueid':{'type':Sequelize[_0xaff8('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xaff8('0x2')]},'thirdDisposition':{'type':Sequelize[_0xaff8('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xaff8('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1538=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','format','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER'];(function(_0x19ff2a,_0x2775e6){var _0x1ac4b6=function(_0x2e22bd){while(--_0x2e22bd){_0x19ff2a['push'](_0x19ff2a['shift']());}};_0x1ac4b6(++_0x2775e6);}(_0x1538,0x16a));var _0x8153=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0x1538[_0x4b12ae];return _0x16957b;};'use strict';var Sequelize=require(_0x8153('0x0'));var moment=require(_0x8153('0x1'));module[_0x8153('0x2')]={'type':{'type':Sequelize[_0x8153('0x3')]},'uniqueid':{'type':Sequelize[_0x8153('0x3')]},'calleridnum':{'type':Sequelize[_0x8153('0x3')]},'calleridname':{'type':Sequelize[_0x8153('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x8153('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x8153('0x4')],'set':function(_0x462154){var _0xf01a85=moment(_0x462154);var _0x4b9223=moment(this[_0x8153('0x5')]('queuecallerjoinAt'))[_0x8153('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x27ee1c=_0xf01a85[_0x8153('0x7')](_0x4b9223,_0x8153('0x8'));this['setDataValue'](_0x8153('0x9'),_0x462154);this[_0x8153('0xa')](_0x8153('0xb'),_0x27ee1c||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x8153('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x8153('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8153('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x8153('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8153('0x4')]},'queuecallerexit':{'type':Sequelize[_0x8153('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8153('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x8153('0xc')]},'channel':{'type':Sequelize[_0x8153('0x3')]},'connectedlinenum':{'type':Sequelize[_0x8153('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8153('0x3')]},'context':{'type':Sequelize[_0x8153('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8153('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8153('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8153('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8153('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8153('0x3')],'comment':_0x8153('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x8153('0x3')]},'disposition':{'type':Sequelize[_0x8153('0x3')]},'secondDisposition':{'type':Sequelize[_0x8153('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'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 07b01c1..7a24d1d 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 _0x0c0f=['then','end','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy'];(function(_0x2671ce,_0xa2109b){var _0x5957c0=function(_0x472599){while(--_0x472599){_0x2671ce['push'](_0x2671ce['shift']());}};_0x5957c0(++_0xa2109b);}(_0x0c0f,0x1be));var _0xf0c0=function(_0x5bcb5d,_0x1686a9){_0x5bcb5d=_0x5bcb5d-0x0;var _0xe069f5=_0x0c0f[_0x5bcb5d];return _0xe069f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0c0('0x0'));var zipdir=require(_0xf0c0('0x1'));var jsonpatch=require(_0xf0c0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0c0('0x3'));var Mustache=require('mustache');var util=require(_0xf0c0('0x4'));var path=require('path');var sox=require(_0xf0c0('0x5'));var csv=require(_0xf0c0('0x6'));var ejs=require(_0xf0c0('0x7'));var fs=require('fs');var fs_extra=require(_0xf0c0('0x8'));var _=require(_0xf0c0('0x9'));var squel=require(_0xf0c0('0xa'));var crypto=require(_0xf0c0('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf0c0('0x6'));var querystring=require(_0xf0c0('0xc'));var Papa=require(_0xf0c0('0xd'));var Redis=require(_0xf0c0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf0c0('0xf'));var as=require(_0xf0c0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0c0('0x11'))(_0xf0c0('0x12'));var utils=require(_0xf0c0('0x13'));var config=require(_0xf0c0('0x14'));var licenseUtil=require(_0xf0c0('0x15'));var db=require(_0xf0c0('0x16'))['db'];config[_0xf0c0('0x17')]=_[_0xf0c0('0x18')](config['redis'],{'host':_0xf0c0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf0c0('0x17')]));require(_0xf0c0('0x1a'))[_0xf0c0('0x1b')](socket);function respondWithStatusCode(_0x487821,_0x56d610){_0x56d610=_0x56d610||0xcc;return function(_0x51dbb5){if(_0x51dbb5){return _0x487821['sendStatus'](_0x56d610);}return _0x487821['status'](_0x56d610)['end']();};}function respondWithResult(_0x1adcf3,_0x571aeb){_0x571aeb=_0x571aeb||0xc8;return function(_0x3aebf1){if(_0x3aebf1){return _0x1adcf3[_0xf0c0('0x1c')](_0x571aeb)[_0xf0c0('0x1d')](_0x3aebf1);}};}function respondWithFilteredResult(_0x5f37f0,_0x39114c){return function(_0x2a826d){if(_0x2a826d){var _0x35aa74=typeof _0x39114c[_0xf0c0('0x1e')]===_0xf0c0('0x1f')&&typeof _0x39114c['limit']===_0xf0c0('0x1f');var _0x5eff93=_0x2a826d[_0xf0c0('0x20')];var _0x34564a=_0x35aa74?0x0:_0x39114c['offset'];var _0x3962d1=_0x35aa74?_0x2a826d[_0xf0c0('0x20')]:_0x39114c['offset']+_0x39114c[_0xf0c0('0x21')];var _0x3f7fff;if(_0x3962d1>=_0x5eff93){_0x3962d1=_0x5eff93;_0x3f7fff=0xc8;}else{_0x3f7fff=0xce;}_0x5f37f0[_0xf0c0('0x1c')](_0x3f7fff);return _0x5f37f0['set'](_0xf0c0('0x22'),_0x34564a+'-'+_0x3962d1+'/'+_0x5eff93)[_0xf0c0('0x1d')](_0x2a826d);}return null;};}function patchUpdates(_0x1be397){return function(_0x5293e0){try{jsonpatch[_0xf0c0('0x23')](_0x5293e0,_0x1be397,!![]);}catch(_0x1206c6){return BPromise[_0xf0c0('0x24')](_0x1206c6);}return _0x5293e0[_0xf0c0('0x25')]();};}function saveUpdates(_0x209f4a,_0x14ecbc){return function(_0x218a6c){if(_0x218a6c){return _0x218a6c[_0xf0c0('0x26')](_0x209f4a)['then'](function(_0x4acb85){return _0x4acb85;});}return null;};}function removeEntity(_0x26cc69,_0x4d895f){return function(_0x48dd5d){if(_0x48dd5d){return _0x48dd5d[_0xf0c0('0x27')]()[_0xf0c0('0x28')](function(){_0x26cc69['status'](0xcc)[_0xf0c0('0x29')]();});}};}function handleEntityNotFound(_0x43a61c,_0x325f09){return function(_0x5bff38){if(!_0x5bff38){_0x43a61c['sendStatus'](0x194);}return _0x5bff38;};}function handleError(_0x1bd3e6,_0x2b5117){_0x2b5117=_0x2b5117||0x1f4;return function(_0x45dc1a){logger['error'](_0x45dc1a[_0xf0c0('0x2a')]);if(_0x45dc1a[_0xf0c0('0x2b')]){delete _0x45dc1a['name'];}_0x1bd3e6['status'](_0x2b5117)[_0xf0c0('0x2c')](_0x45dc1a);};}exports[_0xf0c0('0x2d')]=function(_0x202aab,_0x25f14e){var _0x4a95a4={},_0x236981={},_0x1f99d9={'count':0x0,'rows':[]};var _0x8d6b41=_[_0xf0c0('0x2e')](db[_0xf0c0('0x2f')][_0xf0c0('0x30')],function(_0x480fcd){return{'name':_0x480fcd[_0xf0c0('0x31')],'type':_0x480fcd[_0xf0c0('0x32')][_0xf0c0('0x33')]};});_0x236981[_0xf0c0('0x34')]=_[_0xf0c0('0x2e')](_0x8d6b41,_0xf0c0('0x2b'));_0x236981[_0xf0c0('0x35')]=_['keys'](_0x202aab[_0xf0c0('0x35')]);_0x236981[_0xf0c0('0x36')]=_[_0xf0c0('0x37')](_0x236981['model'],_0x236981['query']);_0x4a95a4[_0xf0c0('0x38')]=_['intersection'](_0x236981[_0xf0c0('0x34')],qs[_0xf0c0('0x39')](_0x202aab[_0xf0c0('0x35')][_0xf0c0('0x39')]));_0x4a95a4[_0xf0c0('0x38')]=_0x4a95a4[_0xf0c0('0x38')][_0xf0c0('0x3a')]?_0x4a95a4[_0xf0c0('0x38')]:_0x236981[_0xf0c0('0x34')];if(!_0x202aab['query'][_0xf0c0('0x3b')]('nolimit')){_0x4a95a4['limit']=qs[_0xf0c0('0x21')](_0x202aab['query']['limit']);_0x4a95a4[_0xf0c0('0x1e')]=qs[_0xf0c0('0x1e')](_0x202aab['query'][_0xf0c0('0x1e')]);}_0x4a95a4[_0xf0c0('0x3c')]=qs[_0xf0c0('0x3d')](_0x202aab[_0xf0c0('0x35')][_0xf0c0('0x3d')]);_0x4a95a4[_0xf0c0('0x3e')]=qs[_0xf0c0('0x36')](_[_0xf0c0('0x3f')](_0x202aab[_0xf0c0('0x35')],_0x236981[_0xf0c0('0x36')]),_0x8d6b41);if(_0x202aab[_0xf0c0('0x35')][_0xf0c0('0x40')]){_0x4a95a4[_0xf0c0('0x3e')]=_['merge'](_0x4a95a4['where'],{'$or':_[_0xf0c0('0x2e')](_0x8d6b41,function(_0x34a62f){if(_0x34a62f[_0xf0c0('0x32')]!==_0xf0c0('0x41')){var _0x1b8215={};_0x1b8215[_0x34a62f[_0xf0c0('0x2b')]]={'$like':'%'+_0x202aab['query'][_0xf0c0('0x40')]+'%'};return _0x1b8215;}})});}_0x4a95a4=_[_0xf0c0('0x42')]({},_0x4a95a4,_0x202aab[_0xf0c0('0x43')]);var _0x3c491e={'where':_0x4a95a4[_0xf0c0('0x3e')]};return db[_0xf0c0('0x2f')]['count'](_0x3c491e)['then'](function(_0x155e8b){_0x1f99d9[_0xf0c0('0x20')]=_0x155e8b;if(_0x202aab[_0xf0c0('0x35')][_0xf0c0('0x44')]){_0x4a95a4[_0xf0c0('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xf0c0('0x46')](_0x4a95a4);})[_0xf0c0('0x28')](function(_0x237510){_0x1f99d9[_0xf0c0('0x47')]=_0x237510;return _0x1f99d9;})[_0xf0c0('0x28')](respondWithFilteredResult(_0x25f14e,_0x4a95a4))[_0xf0c0('0x48')](handleError(_0x25f14e,null));};exports[_0xf0c0('0x49')]=function(_0xd327e4,_0x2d88b6){var _0x329ef1={'raw':![],'where':{'id':_0xd327e4[_0xf0c0('0x4a')]['id']}},_0x1df430={};_0x1df430[_0xf0c0('0x34')]=_[_0xf0c0('0x4b')](db[_0xf0c0('0x2f')][_0xf0c0('0x30')]);_0x1df430[_0xf0c0('0x35')]=_[_0xf0c0('0x4b')](_0xd327e4[_0xf0c0('0x35')]);_0x1df430[_0xf0c0('0x36')]=_[_0xf0c0('0x37')](_0x1df430['model'],_0x1df430[_0xf0c0('0x35')]);_0x329ef1['attributes']=_[_0xf0c0('0x37')](_0x1df430[_0xf0c0('0x34')],qs['fields'](_0xd327e4[_0xf0c0('0x35')]['fields']));_0x329ef1[_0xf0c0('0x38')]=_0x329ef1['attributes'][_0xf0c0('0x3a')]?_0x329ef1[_0xf0c0('0x38')]:_0x1df430[_0xf0c0('0x34')];if(_0xd327e4['query'][_0xf0c0('0x44')]){_0x329ef1[_0xf0c0('0x45')]=[{'all':!![]}];}_0x329ef1=_[_0xf0c0('0x42')]({},_0x329ef1,_0xd327e4['options']);return db[_0xf0c0('0x2f')][_0xf0c0('0x4c')](_0x329ef1)[_0xf0c0('0x28')](handleEntityNotFound(_0x2d88b6,null))[_0xf0c0('0x28')](respondWithResult(_0x2d88b6,null))['catch'](handleError(_0x2d88b6,null));};exports[_0xf0c0('0x4d')]=function(_0x26ca85,_0x4ec29c){return db['VoiceQueueReport'][_0xf0c0('0x4d')](_0x26ca85['body'],{})[_0xf0c0('0x28')](respondWithResult(_0x4ec29c,0xc9))[_0xf0c0('0x48')](handleError(_0x4ec29c,null));};exports[_0xf0c0('0x26')]=function(_0x55847a,_0xaa2489){if(_0x55847a['body']['id']){delete _0x55847a[_0xf0c0('0x4e')]['id'];}return db['VoiceQueueReport'][_0xf0c0('0x4c')]({'where':{'id':_0x55847a[_0xf0c0('0x4a')]['id']}})[_0xf0c0('0x28')](handleEntityNotFound(_0xaa2489,null))[_0xf0c0('0x28')](saveUpdates(_0x55847a[_0xf0c0('0x4e')],null))[_0xf0c0('0x28')](respondWithResult(_0xaa2489,null))[_0xf0c0('0x48')](handleError(_0xaa2489,null));};exports[_0xf0c0('0x27')]=function(_0x53185f,_0x443648){return db[_0xf0c0('0x2f')]['find']({'where':{'id':_0x53185f['params']['id']}})[_0xf0c0('0x28')](handleEntityNotFound(_0x443648,null))[_0xf0c0('0x28')](removeEntity(_0x443648,null))[_0xf0c0('0x48')](handleError(_0x443648,null));};exports[_0xf0c0('0x4f')]=function(_0x4d50dc,_0x43c374){return db['VoiceQueueReport']['describe']()[_0xf0c0('0x28')](respondWithResult(_0x43c374,null))[_0xf0c0('0x48')](handleError(_0x43c374,null));};exports[_0xf0c0('0x50')]=function(_0x2e916d,_0x43ada7){var _0x14aa1a={},_0x16d1a8={},_0x4180bd={'count':0x0,'rows':[]};_0x16d1a8[_0xf0c0('0x34')]=_['keys'](db[_0xf0c0('0x2f')][_0xf0c0('0x30')]);_0x16d1a8['query']=_[_0xf0c0('0x4b')](_0x2e916d['query']);_0x16d1a8['filters']=_[_0xf0c0('0x37')](_0x16d1a8[_0xf0c0('0x34')],_0x16d1a8[_0xf0c0('0x35')]);_0x14aa1a['attributes']=_[_0xf0c0('0x37')](_0x16d1a8['model'],qs['fields'](_0x2e916d[_0xf0c0('0x35')]['fields']));_0x14aa1a['attributes']=_0x14aa1a[_0xf0c0('0x38')][_0xf0c0('0x3a')]?_0x14aa1a[_0xf0c0('0x38')]:_0x16d1a8[_0xf0c0('0x34')];if(!_0x2e916d[_0xf0c0('0x35')]['hasOwnProperty']('nolimit')){_0x14aa1a[_0xf0c0('0x21')]=qs[_0xf0c0('0x21')](_0x2e916d[_0xf0c0('0x35')][_0xf0c0('0x21')]);_0x14aa1a[_0xf0c0('0x1e')]=qs[_0xf0c0('0x1e')](_0x2e916d[_0xf0c0('0x35')][_0xf0c0('0x1e')]);}_0x14aa1a['order']=qs[_0xf0c0('0x3d')](_0x2e916d[_0xf0c0('0x35')][_0xf0c0('0x3d')]);_0x14aa1a['where']=qs['filters'](_[_0xf0c0('0x3f')](_0x2e916d[_0xf0c0('0x35')],_0x16d1a8['filters']));if(_0x2e916d[_0xf0c0('0x35')][_0xf0c0('0x40')]){_0x14aa1a['where']=_[_0xf0c0('0x42')](_0x14aa1a[_0xf0c0('0x3e')],{'$or':_[_0xf0c0('0x2e')](_0x14aa1a[_0xf0c0('0x38')],function(_0x331245){var _0x168d2c={};_0x168d2c[_0x331245]={'$like':'%'+_0x2e916d['query'][_0xf0c0('0x40')]+'%'};return _0x168d2c;})});}_0x14aa1a=_[_0xf0c0('0x42')]({},_0x14aa1a,_0x2e916d[_0xf0c0('0x43')]);var _0x101c44={'where':_0x14aa1a[_0xf0c0('0x3e')]};return db['VoiceQueueReport'][_0xf0c0('0x20')](_0x101c44)['then'](function(_0x13fc52){_0x4180bd[_0xf0c0('0x20')]=_0x13fc52;if(_0x2e916d[_0xf0c0('0x35')][_0xf0c0('0x44')]){_0x14aa1a[_0xf0c0('0x45')]=[{'all':!![]}];}return db[_0xf0c0('0x2f')][_0xf0c0('0x46')](_0x14aa1a);})[_0xf0c0('0x28')](function(_0x24d776){_0x4180bd[_0xf0c0('0x47')]=_0x24d776;return _0x4180bd;})['then'](respondWithFilteredResult(_0x43ada7,_0x14aa1a,_0xf0c0('0x50')))[_0xf0c0('0x48')](handleError(_0x43ada7,null,_0xf0c0('0x50')));}; \ No newline at end of file +var _0x4135=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','end','status','json','undefined','limit','count','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','where','merge','type','VIRTUAL','filter','options','VoiceQueueReport','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','update','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x1ca4fc,_0x292296){var _0x159709=function(_0x508a24){while(--_0x508a24){_0x1ca4fc['push'](_0x1ca4fc['shift']());}};_0x159709(++_0x292296);}(_0x4135,0x14d));var _0x5413=function(_0x27b72,_0xd89c92){_0x27b72=_0x27b72-0x0;var _0xeeb64a=_0x4135[_0x27b72];return _0xeeb64a;};'use strict';var emlformat=require(_0x5413('0x0'));var rimraf=require(_0x5413('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5413('0x2'));var rp=require(_0x5413('0x3'));var moment=require(_0x5413('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5413('0x5'));var util=require(_0x5413('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5413('0x7'));var fs=require('fs');var fs_extra=require(_0x5413('0x8'));var _=require(_0x5413('0x9'));var squel=require(_0x5413('0xa'));var crypto=require(_0x5413('0xb'));var jsforce=require(_0x5413('0xc'));var deskjs=require(_0x5413('0xd'));var toCsv=require(_0x5413('0xe'));var querystring=require(_0x5413('0xf'));var Papa=require(_0x5413('0x10'));var Redis=require(_0x5413('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5413('0x12'));var as=require(_0x5413('0x13'));var hardwareService=require(_0x5413('0x14'));var logger=require('../../config/logger')(_0x5413('0x15'));var utils=require(_0x5413('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5413('0x17'))['db'];config[_0x5413('0x18')]=_[_0x5413('0x19')](config[_0x5413('0x18')],{'host':_0x5413('0x1a'),'port':0x18eb});var socket=require(_0x5413('0x1b'))(new Redis(config[_0x5413('0x18')]));require(_0x5413('0x1c'))[_0x5413('0x1d')](socket);function respondWithStatusCode(_0x2c9081,_0x40d3d2){_0x40d3d2=_0x40d3d2||0xcc;return function(_0xa1880){if(_0xa1880){return _0x2c9081['sendStatus'](_0x40d3d2);}return _0x2c9081['status'](_0x40d3d2)[_0x5413('0x1e')]();};}function respondWithResult(_0x15fef1,_0x36c6ba){_0x36c6ba=_0x36c6ba||0xc8;return function(_0x24ca96){if(_0x24ca96){return _0x15fef1[_0x5413('0x1f')](_0x36c6ba)[_0x5413('0x20')](_0x24ca96);}};}function respondWithFilteredResult(_0x53d310,_0x1cd974){return function(_0x1a1f2c){if(_0x1a1f2c){var _0x19e32c=typeof _0x1cd974['offset']===_0x5413('0x21')&&typeof _0x1cd974[_0x5413('0x22')]===_0x5413('0x21');var _0x2de765=_0x1a1f2c[_0x5413('0x23')];var _0x213806=_0x19e32c?0x0:_0x1cd974['offset'];var _0x1de0fb=_0x19e32c?_0x1a1f2c[_0x5413('0x23')]:_0x1cd974['offset']+_0x1cd974['limit'];var _0x5af9a4;if(_0x1de0fb>=_0x2de765){_0x1de0fb=_0x2de765;_0x5af9a4=0xc8;}else{_0x5af9a4=0xce;}_0x53d310[_0x5413('0x1f')](_0x5af9a4);return _0x53d310[_0x5413('0x24')](_0x5413('0x25'),_0x213806+'-'+_0x1de0fb+'/'+_0x2de765)[_0x5413('0x20')](_0x1a1f2c);}return null;};}function patchUpdates(_0x50cd87){return function(_0x45c7f6){try{jsonpatch[_0x5413('0x26')](_0x45c7f6,_0x50cd87,!![]);}catch(_0x504e1c){return BPromise['reject'](_0x504e1c);}return _0x45c7f6[_0x5413('0x27')]();};}function saveUpdates(_0x377e74,_0x4b20e1){return function(_0x39c58b){if(_0x39c58b){return _0x39c58b['update'](_0x377e74)['then'](function(_0x2bb07f){return _0x2bb07f;});}return null;};}function removeEntity(_0x49e991,_0x6bcc93){return function(_0x3cfb78){if(_0x3cfb78){return _0x3cfb78[_0x5413('0x28')]()[_0x5413('0x29')](function(){_0x49e991[_0x5413('0x1f')](0xcc)[_0x5413('0x1e')]();});}};}function handleEntityNotFound(_0x3e6a89,_0xaa8ec9){return function(_0x18ca1e){if(!_0x18ca1e){_0x3e6a89[_0x5413('0x2a')](0x194);}return _0x18ca1e;};}function handleError(_0x586e8b,_0xed8968){_0xed8968=_0xed8968||0x1f4;return function(_0x7b0796){logger[_0x5413('0x2b')](_0x7b0796[_0x5413('0x2c')]);if(_0x7b0796[_0x5413('0x2d')]){delete _0x7b0796[_0x5413('0x2d')];}_0x586e8b[_0x5413('0x1f')](_0xed8968)[_0x5413('0x2e')](_0x7b0796);};}exports[_0x5413('0x2f')]=function(_0x29ddd7,_0x460e03){var _0x58e192={},_0x5dcaf5={},_0x400991={'count':0x0,'rows':[]};var _0x54c8b8=_['map'](db['VoiceQueueReport'][_0x5413('0x30')],function(_0x38a62b){return{'name':_0x38a62b[_0x5413('0x31')],'type':_0x38a62b['type']['key']};});_0x5dcaf5[_0x5413('0x32')]=_[_0x5413('0x33')](_0x54c8b8,_0x5413('0x2d'));_0x5dcaf5['query']=_[_0x5413('0x34')](_0x29ddd7[_0x5413('0x35')]);_0x5dcaf5[_0x5413('0x36')]=_[_0x5413('0x37')](_0x5dcaf5[_0x5413('0x32')],_0x5dcaf5['query']);_0x58e192[_0x5413('0x38')]=_[_0x5413('0x37')](_0x5dcaf5['model'],qs['fields'](_0x29ddd7[_0x5413('0x35')]['fields']));_0x58e192[_0x5413('0x38')]=_0x58e192[_0x5413('0x38')][_0x5413('0x39')]?_0x58e192[_0x5413('0x38')]:_0x5dcaf5[_0x5413('0x32')];if(!_0x29ddd7[_0x5413('0x35')][_0x5413('0x3a')](_0x5413('0x3b'))){_0x58e192[_0x5413('0x22')]=qs[_0x5413('0x22')](_0x29ddd7[_0x5413('0x35')][_0x5413('0x22')]);_0x58e192[_0x5413('0x3c')]=qs[_0x5413('0x3c')](_0x29ddd7[_0x5413('0x35')][_0x5413('0x3c')]);}_0x58e192[_0x5413('0x3d')]=qs[_0x5413('0x3e')](_0x29ddd7[_0x5413('0x35')][_0x5413('0x3e')]);_0x58e192['where']=qs[_0x5413('0x36')](_[_0x5413('0x3f')](_0x29ddd7[_0x5413('0x35')],_0x5dcaf5[_0x5413('0x36')]),_0x54c8b8);if(_0x29ddd7[_0x5413('0x35')]['filter']){_0x58e192[_0x5413('0x40')]=_[_0x5413('0x41')](_0x58e192[_0x5413('0x40')],{'$or':_['map'](_0x54c8b8,function(_0x4104fa){if(_0x4104fa[_0x5413('0x42')]!==_0x5413('0x43')){var _0xad3eed={};_0xad3eed[_0x4104fa[_0x5413('0x2d')]]={'$like':'%'+_0x29ddd7[_0x5413('0x35')][_0x5413('0x44')]+'%'};return _0xad3eed;}})});}_0x58e192=_[_0x5413('0x41')]({},_0x58e192,_0x29ddd7[_0x5413('0x45')]);var _0x261244={'where':_0x58e192['where']};return db[_0x5413('0x46')][_0x5413('0x23')](_0x261244)[_0x5413('0x29')](function(_0x579834){_0x400991['count']=_0x579834;if(_0x29ddd7[_0x5413('0x35')]['includeAll']){_0x58e192[_0x5413('0x47')]=[{'all':!![]}];}return db[_0x5413('0x46')][_0x5413('0x48')](_0x58e192);})['then'](function(_0x449174){_0x400991[_0x5413('0x49')]=_0x449174;return _0x400991;})[_0x5413('0x29')](respondWithFilteredResult(_0x460e03,_0x58e192))[_0x5413('0x4a')](handleError(_0x460e03,null));};exports[_0x5413('0x4b')]=function(_0x14df5a,_0x4e807d){var _0x16afee={'raw':![],'where':{'id':_0x14df5a[_0x5413('0x4c')]['id']}},_0x189b63={};_0x189b63[_0x5413('0x32')]=_['keys'](db[_0x5413('0x46')][_0x5413('0x30')]);_0x189b63['query']=_[_0x5413('0x34')](_0x14df5a['query']);_0x189b63['filters']=_[_0x5413('0x37')](_0x189b63[_0x5413('0x32')],_0x189b63[_0x5413('0x35')]);_0x16afee[_0x5413('0x38')]=_[_0x5413('0x37')](_0x189b63[_0x5413('0x32')],qs['fields'](_0x14df5a[_0x5413('0x35')][_0x5413('0x4d')]));_0x16afee['attributes']=_0x16afee['attributes'][_0x5413('0x39')]?_0x16afee[_0x5413('0x38')]:_0x189b63[_0x5413('0x32')];if(_0x14df5a[_0x5413('0x35')][_0x5413('0x4e')]){_0x16afee[_0x5413('0x47')]=[{'all':!![]}];}_0x16afee=_[_0x5413('0x41')]({},_0x16afee,_0x14df5a['options']);return db[_0x5413('0x46')][_0x5413('0x4f')](_0x16afee)[_0x5413('0x29')](handleEntityNotFound(_0x4e807d,null))[_0x5413('0x29')](respondWithResult(_0x4e807d,null))[_0x5413('0x4a')](handleError(_0x4e807d,null));};exports['create']=function(_0x349834,_0x70e765){return db[_0x5413('0x46')][_0x5413('0x50')](_0x349834[_0x5413('0x51')],{})[_0x5413('0x29')](respondWithResult(_0x70e765,0xc9))[_0x5413('0x4a')](handleError(_0x70e765,null));};exports[_0x5413('0x52')]=function(_0x5894eb,_0x5babc6){if(_0x5894eb[_0x5413('0x51')]['id']){delete _0x5894eb['body']['id'];}return db[_0x5413('0x46')][_0x5413('0x4f')]({'where':{'id':_0x5894eb[_0x5413('0x4c')]['id']}})[_0x5413('0x29')](handleEntityNotFound(_0x5babc6,null))[_0x5413('0x29')](saveUpdates(_0x5894eb[_0x5413('0x51')],null))[_0x5413('0x29')](respondWithResult(_0x5babc6,null))[_0x5413('0x4a')](handleError(_0x5babc6,null));};exports[_0x5413('0x28')]=function(_0x1817de,_0x43c6cc){return db[_0x5413('0x46')][_0x5413('0x4f')]({'where':{'id':_0x1817de[_0x5413('0x4c')]['id']}})[_0x5413('0x29')](handleEntityNotFound(_0x43c6cc,null))[_0x5413('0x29')](removeEntity(_0x43c6cc,null))[_0x5413('0x4a')](handleError(_0x43c6cc,null));};exports[_0x5413('0x53')]=function(_0x3ecd23,_0xa1d1ac){return db['VoiceQueueReport'][_0x5413('0x53')]()[_0x5413('0x29')](respondWithResult(_0xa1d1ac,null))[_0x5413('0x4a')](handleError(_0xa1d1ac,null));};exports[_0x5413('0x54')]=function(_0x3d6d9a,_0x4e2556){var _0x337747={},_0x5f2e24={},_0x4b9c1f={'count':0x0,'rows':[]};_0x5f2e24[_0x5413('0x32')]=_[_0x5413('0x34')](db[_0x5413('0x46')][_0x5413('0x30')]);_0x5f2e24[_0x5413('0x35')]=_[_0x5413('0x34')](_0x3d6d9a[_0x5413('0x35')]);_0x5f2e24[_0x5413('0x36')]=_[_0x5413('0x37')](_0x5f2e24[_0x5413('0x32')],_0x5f2e24[_0x5413('0x35')]);_0x337747[_0x5413('0x38')]=_[_0x5413('0x37')](_0x5f2e24['model'],qs['fields'](_0x3d6d9a[_0x5413('0x35')][_0x5413('0x4d')]));_0x337747[_0x5413('0x38')]=_0x337747[_0x5413('0x38')][_0x5413('0x39')]?_0x337747[_0x5413('0x38')]:_0x5f2e24[_0x5413('0x32')];if(!_0x3d6d9a[_0x5413('0x35')]['hasOwnProperty'](_0x5413('0x3b'))){_0x337747[_0x5413('0x22')]=qs[_0x5413('0x22')](_0x3d6d9a[_0x5413('0x35')][_0x5413('0x22')]);_0x337747[_0x5413('0x3c')]=qs[_0x5413('0x3c')](_0x3d6d9a[_0x5413('0x35')][_0x5413('0x3c')]);}_0x337747[_0x5413('0x3d')]=qs[_0x5413('0x3e')](_0x3d6d9a['query'][_0x5413('0x3e')]);_0x337747[_0x5413('0x40')]=qs[_0x5413('0x36')](_[_0x5413('0x3f')](_0x3d6d9a[_0x5413('0x35')],_0x5f2e24[_0x5413('0x36')]));if(_0x3d6d9a[_0x5413('0x35')]['filter']){_0x337747[_0x5413('0x40')]=_[_0x5413('0x41')](_0x337747[_0x5413('0x40')],{'$or':_[_0x5413('0x33')](_0x337747['attributes'],function(_0x4fa268){var _0x48b79f={};_0x48b79f[_0x4fa268]={'$like':'%'+_0x3d6d9a[_0x5413('0x35')][_0x5413('0x44')]+'%'};return _0x48b79f;})});}_0x337747=_[_0x5413('0x41')]({},_0x337747,_0x3d6d9a[_0x5413('0x45')]);var _0x5e6564={'where':_0x337747[_0x5413('0x40')]};return db[_0x5413('0x46')]['count'](_0x5e6564)[_0x5413('0x29')](function(_0x29d37a){_0x4b9c1f[_0x5413('0x23')]=_0x29d37a;if(_0x3d6d9a[_0x5413('0x35')][_0x5413('0x4e')]){_0x337747[_0x5413('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5413('0x48')](_0x337747);})[_0x5413('0x29')](function(_0x162c49){_0x4b9c1f['rows']=_0x162c49;return _0x4b9c1f;})['then'](respondWithFilteredResult(_0x4e2556,_0x337747,_0x5413('0x54')))['catch'](handleError(_0x4e2556,null,_0x5413('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 0878e54..df5208b 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 _0x2711=['hook','exports','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x490800,_0x2df9be){var _0x219291=function(_0xaf2bde){while(--_0xaf2bde){_0x490800['push'](_0x490800['shift']());}};_0x219291(++_0x2df9be);}(_0x2711,0x134));var _0x1271=function(_0x306072,_0x391539){_0x306072=_0x306072-0x0;var _0x4d9397=_0x2711[_0x306072];return _0x4d9397;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x1271('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1271('0x1')](0x0);var events={'afterCreate':_0x1271('0x2'),'afterUpdate':_0x1271('0x3'),'afterDestroy':_0x1271('0x4')};function emitEvent(_0x1a21bf){return function(_0x9c2e1c,_0xc51b9c,_0x4cd7e2){VoiceQueueReportEvents[_0x1271('0x5')](_0x1a21bf+':'+_0x9c2e1c['id'],_0x9c2e1c);VoiceQueueReportEvents['emit'](_0x1a21bf,_0x9c2e1c);_0x4cd7e2(null);};}for(var e in events){if(events[_0x1271('0x6')](e)){var event=events[e];VoiceQueueReport[_0x1271('0x7')](e,emitEvent(event));}}module[_0x1271('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xe299=['exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x1e4cc4,_0x4014a9){var _0x34276b=function(_0x233e33){while(--_0x233e33){_0x1e4cc4['push'](_0x1e4cc4['shift']());}};_0x34276b(++_0x4014a9);}(_0xe299,0x79));var _0x9e29=function(_0x4fd8a8,_0x46e5b1){_0x4fd8a8=_0x4fd8a8-0x0;var _0x3f3d2b=_0xe299[_0x4fd8a8];return _0x3f3d2b;};'use strict';var EventEmitter=require(_0x9e29('0x0'));var VoiceQueueReport=require(_0x9e29('0x1'))['db'][_0x9e29('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9e29('0x3')](0x0);var events={'afterCreate':_0x9e29('0x4'),'afterUpdate':_0x9e29('0x5'),'afterDestroy':'remove'};function emitEvent(_0xddee41){return function(_0x22c305,_0x4b18ce,_0x35cec5){VoiceQueueReportEvents[_0x9e29('0x6')](_0xddee41+':'+_0x22c305['id'],_0x22c305);VoiceQueueReportEvents[_0x9e29('0x6')](_0xddee41,_0x22c305);_0x35cec5(null);};}for(var e in events){if(events[_0x9e29('0x7')](e)){var event=events[e];VoiceQueueReport[_0x9e29('0x8')](e,emitEvent(event));}}module[_0x9e29('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 523e116..e5765a1 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 _0x14d9=['rimraf','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x14d9,0x85));var _0x914d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x914d('0x0'));var util=require(_0x914d('0x1'));var logger=require(_0x914d('0x2'))(_0x914d('0x3'));var moment=require('moment');var BPromise=require(_0x914d('0x4'));var rp=require(_0x914d('0x5'));var fs=require('fs');var path=require(_0x914d('0x6'));var rimraf=require(_0x914d('0x7'));var config=require('../../config/environment');var attributes=require(_0x914d('0x8'));module[_0x914d('0x9')]=function(_0x25d343,_0x88c0d8){return _0x25d343[_0x914d('0xa')]('VoiceQueueReport',attributes,{'tableName':_0x914d('0xb'),'paranoid':![],'indexes':[{'fields':[_0x914d('0xc')]},{'fields':[_0x914d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a57=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x4e304e,_0x1f9804){var _0x50a4a8=function(_0xc42293){while(--_0xc42293){_0x4e304e['push'](_0x4e304e['shift']());}};_0x50a4a8(++_0x1f9804);}(_0x9a57,0x1e9));var _0x79a5=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x9a57[_0x1ab180];return _0xfb2c2d;};'use strict';var _=require(_0x79a5('0x0'));var util=require(_0x79a5('0x1'));var logger=require(_0x79a5('0x2'))('api');var moment=require(_0x79a5('0x3'));var BPromise=require(_0x79a5('0x4'));var rp=require(_0x79a5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79a5('0x6'));var config=require(_0x79a5('0x7'));var attributes=require(_0x79a5('0x8'));module['exports']=function(_0x19d849,_0x1a7c4c){return _0x19d849[_0x79a5('0x9')](_0x79a5('0xa'),attributes,{'tableName':_0x79a5('0xb'),'paranoid':![],'indexes':[{'fields':[_0x79a5('0xc')]},{'fields':[_0x79a5('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 de90a44..dd8070b 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 _0xe69c=['attributes','limit','include','model','map','CreateVoiceQueueReport','VoiceQueueReport','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','options','raw'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe69c,0x1e3));var _0xce69=function(_0xfed64e,_0x303041){_0xfed64e=_0xfed64e-0x0;var _0x5795b6=_0xe69c[_0xfed64e];return _0x5795b6;};'use strict';var _=require(_0xce69('0x0'));var util=require(_0xce69('0x1'));var moment=require(_0xce69('0x2'));var BPromise=require(_0xce69('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce69('0x4'));var db=require(_0xce69('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xce69('0x6'))(_0xce69('0x7'));var config=require(_0xce69('0x8'));var jayson=require(_0xce69('0x9'));var client=jayson[_0xce69('0xa')][_0xce69('0xb')]({'port':0x232a});config[_0xce69('0xc')]=_[_0xce69('0xd')](config[_0xce69('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xce69('0xe'))(new Redis(config[_0xce69('0xc')]));require(_0xce69('0xf'))[_0xce69('0x10')](socket);function respondWithRpcPromise(_0x5809f4,_0x30dfcf,_0x4161bb){return new BPromise(function(_0x1ad0b3,_0x4da338){return client[_0xce69('0x11')](_0x5809f4,_0x4161bb)[_0xce69('0x12')](function(_0x5c5562){logger[_0xce69('0x13')](_0xce69('0x14'),_0x30dfcf,_0xce69('0x15'));logger[_0xce69('0x16')](_0xce69('0x17'),_0x30dfcf,'request\x20sent',JSON[_0xce69('0x18')](_0x5c5562));if(_0x5c5562['error']){if(_0x5c5562[_0xce69('0x19')][_0xce69('0x1a')]===0x1f4){logger[_0xce69('0x19')](_0xce69('0x14'),_0x30dfcf,_0x5c5562[_0xce69('0x19')][_0xce69('0x1b')]);return _0x4da338(_0x5c5562[_0xce69('0x19')]['message']);}logger['error'](_0xce69('0x14'),_0x30dfcf,_0x5c5562[_0xce69('0x19')][_0xce69('0x1b')]);return _0x1ad0b3(_0x5c5562['error'][_0xce69('0x1b')]);}else{logger[_0xce69('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x30dfcf,_0xce69('0x15'));_0x1ad0b3(_0x5c5562[_0xce69('0x1c')]['message']);}})[_0xce69('0x1d')](function(_0x386442){logger[_0xce69('0x19')](_0xce69('0x14'),_0x30dfcf,_0x386442);_0x4da338(_0x386442);});});}exports[_0xce69('0x1e')]=function(_0x428a2b){var _0xadfeda=this;return new Promise(function(_0x5a7030,_0x3ae845){return db['VoiceQueueReport']['findAll']({'raw':_0x428a2b[_0xce69('0x1f')]?_0x428a2b[_0xce69('0x1f')][_0xce69('0x20')]===undefined?!![]:![]:!![],'where':_0x428a2b[_0xce69('0x1f')]?_0x428a2b[_0xce69('0x1f')]['where']||null:null,'attributes':_0x428a2b[_0xce69('0x1f')]?_0x428a2b[_0xce69('0x1f')][_0xce69('0x21')]||null:null,'limit':_0x428a2b[_0xce69('0x1f')]?_0x428a2b[_0xce69('0x1f')][_0xce69('0x22')]||null:null,'include':_0x428a2b[_0xce69('0x1f')]?_0x428a2b[_0xce69('0x1f')][_0xce69('0x23')]?_['map'](_0x428a2b['options'][_0xce69('0x23')],function(_0x3d135c){return{'model':db[_0x3d135c[_0xce69('0x24')]],'as':_0x3d135c['as'],'attributes':_0x3d135c['attributes'],'include':_0x3d135c[_0xce69('0x23')]?_[_0xce69('0x25')](_0x3d135c[_0xce69('0x23')],function(_0x408a67){return{'model':db[_0x408a67[_0xce69('0x24')]],'as':_0x408a67['as'],'attributes':_0x408a67[_0xce69('0x21')],'include':_0x408a67[_0xce69('0x23')]?_[_0xce69('0x25')](_0x408a67[_0xce69('0x23')],function(_0x3aafd1){return{'model':db[_0x3aafd1['model']],'as':_0x3aafd1['as'],'attributes':_0x3aafd1[_0xce69('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46a293){logger[_0xce69('0x13')](_0xce69('0x1e'),_0x428a2b);logger['debug']('GetVoiceQueueReport',_0x428a2b,JSON['stringify'](_0x46a293));_0x5a7030(_0x46a293);})[_0xce69('0x1d')](function(_0x1d6f42){logger[_0xce69('0x19')](_0xce69('0x1e'),_0x1d6f42['message'],_0x428a2b);_0x3ae845(_0xadfeda[_0xce69('0x19')](0x1f4,_0x1d6f42[_0xce69('0x1b')]));});});};exports[_0xce69('0x26')]=function(_0x1b6999){var _0x496e11=this;return new Promise(function(_0x49901e,_0x7cf1d6){return db[_0xce69('0x27')]['create'](_0x1b6999[_0xce69('0x28')],{'raw':_0x1b6999[_0xce69('0x1f')]?_0x1b6999['options'][_0xce69('0x20')]===undefined?!![]:![]:!![]})[_0xce69('0x12')](function(_0x4155dd){logger[_0xce69('0x13')](_0xce69('0x26'),_0x1b6999);logger[_0xce69('0x16')](_0xce69('0x26'),_0x1b6999,JSON['stringify'](_0x4155dd));_0x49901e(_0x4155dd);})[_0xce69('0x1d')](function(_0x393b02){logger[_0xce69('0x19')](_0xce69('0x26'),_0x393b02['message'],_0x1b6999);_0x7cf1d6(_0x496e11[_0xce69('0x19')](0x1f4,_0x393b02[_0xce69('0x1b')]));});});};exports[_0xce69('0x29')]=function(_0x1ec7e5){var _0x2ada91=this;return new Promise(function(_0x36dc02,_0x292357){return db[_0xce69('0x27')][_0xce69('0x2a')](_0x1ec7e5[_0xce69('0x28')],{'raw':_0x1ec7e5[_0xce69('0x1f')]?_0x1ec7e5[_0xce69('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ec7e5['options']?_0x1ec7e5[_0xce69('0x1f')]['where']||null:null,'attributes':_0x1ec7e5[_0xce69('0x1f')]?_0x1ec7e5['options'][_0xce69('0x21')]||null:null,'limit':_0x1ec7e5['options']?_0x1ec7e5[_0xce69('0x1f')][_0xce69('0x22')]||null:null})[_0xce69('0x12')](function(_0x45521e){logger[_0xce69('0x13')](_0xce69('0x29'),_0x1ec7e5);logger['debug'](_0xce69('0x29'),_0x1ec7e5,JSON[_0xce69('0x18')](_0x45521e));_0x36dc02(_0x45521e);})[_0xce69('0x1d')](function(_0x2a7c53){logger[_0xce69('0x19')](_0xce69('0x29'),_0x2a7c53[_0xce69('0x1b')],_0x1ec7e5);_0x292357(_0x2ada91['error'](0x1f4,_0x2a7c53[_0xce69('0x1b')]));});});}; \ No newline at end of file +var _0x3e63=['defaults','localhost','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','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis'];(function(_0x2e2138,_0x35dad0){var _0xf445e8=function(_0x3b2084){while(--_0x3b2084){_0x2e2138['push'](_0x2e2138['shift']());}};_0xf445e8(++_0x35dad0);}(_0x3e63,0xc3));var _0x33e6=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x3e63[_0x2cd1fb];return _0x48fd2b;};'use strict';var _=require('lodash');var util=require(_0x33e6('0x0'));var moment=require('moment');var BPromise=require(_0x33e6('0x1'));var rs=require(_0x33e6('0x2'));var fs=require('fs');var Redis=require(_0x33e6('0x3'));var db=require(_0x33e6('0x4'))['db'];var utils=require(_0x33e6('0x5'));var logger=require(_0x33e6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x33e6('0x7'));var client=jayson['client'][_0x33e6('0x8')]({'port':0x232a});config[_0x33e6('0x9')]=_[_0x33e6('0xa')](config['redis'],{'host':_0x33e6('0xb'),'port':0x18eb});var socket=require(_0x33e6('0xc'))(new Redis(config['redis']));require(_0x33e6('0xd'))[_0x33e6('0xe')](socket);function respondWithRpcPromise(_0x11396c,_0x36e31c,_0x479733){return new BPromise(function(_0x47670e,_0x2da9dd){return client[_0x33e6('0xf')](_0x11396c,_0x479733)[_0x33e6('0x10')](function(_0x4964e4){logger[_0x33e6('0x11')](_0x33e6('0x12'),_0x36e31c,'request\x20sent');logger[_0x33e6('0x13')](_0x33e6('0x14'),_0x36e31c,_0x33e6('0x15'),JSON[_0x33e6('0x16')](_0x4964e4));if(_0x4964e4[_0x33e6('0x17')]){if(_0x4964e4[_0x33e6('0x17')][_0x33e6('0x18')]===0x1f4){logger[_0x33e6('0x17')](_0x33e6('0x12'),_0x36e31c,_0x4964e4[_0x33e6('0x17')][_0x33e6('0x19')]);return _0x2da9dd(_0x4964e4[_0x33e6('0x17')]['message']);}logger[_0x33e6('0x17')](_0x33e6('0x12'),_0x36e31c,_0x4964e4[_0x33e6('0x17')][_0x33e6('0x19')]);return _0x47670e(_0x4964e4[_0x33e6('0x17')][_0x33e6('0x19')]);}else{logger[_0x33e6('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x36e31c,_0x33e6('0x15'));_0x47670e(_0x4964e4[_0x33e6('0x1a')][_0x33e6('0x19')]);}})[_0x33e6('0x1b')](function(_0xd42d37){logger[_0x33e6('0x17')](_0x33e6('0x12'),_0x36e31c,_0xd42d37);_0x2da9dd(_0xd42d37);});});}exports[_0x33e6('0x1c')]=function(_0x1e54b7){var _0x2228f7=this;return new Promise(function(_0x34863c,_0x1e677f){return db[_0x33e6('0x1d')][_0x33e6('0x1e')]({'raw':_0x1e54b7[_0x33e6('0x1f')]?_0x1e54b7[_0x33e6('0x1f')][_0x33e6('0x20')]===undefined?!![]:![]:!![],'where':_0x1e54b7[_0x33e6('0x1f')]?_0x1e54b7[_0x33e6('0x1f')][_0x33e6('0x21')]||null:null,'attributes':_0x1e54b7['options']?_0x1e54b7[_0x33e6('0x1f')][_0x33e6('0x22')]||null:null,'limit':_0x1e54b7['options']?_0x1e54b7[_0x33e6('0x1f')]['limit']||null:null,'include':_0x1e54b7[_0x33e6('0x1f')]?_0x1e54b7[_0x33e6('0x1f')][_0x33e6('0x23')]?_[_0x33e6('0x24')](_0x1e54b7['options']['include'],function(_0x213c80){return{'model':db[_0x213c80[_0x33e6('0x25')]],'as':_0x213c80['as'],'attributes':_0x213c80[_0x33e6('0x22')],'include':_0x213c80[_0x33e6('0x23')]?_[_0x33e6('0x24')](_0x213c80[_0x33e6('0x23')],function(_0x228d5c){return{'model':db[_0x228d5c[_0x33e6('0x25')]],'as':_0x228d5c['as'],'attributes':_0x228d5c['attributes'],'include':_0x228d5c[_0x33e6('0x23')]?_['map'](_0x228d5c['include'],function(_0x444dc5){return{'model':db[_0x444dc5[_0x33e6('0x25')]],'as':_0x444dc5['as'],'attributes':_0x444dc5['attributes']};}):[]};}):[]};}):[]:[]})[_0x33e6('0x10')](function(_0x476fd0){logger[_0x33e6('0x11')](_0x33e6('0x1c'),_0x1e54b7);logger['debug']('GetVoiceQueueReport',_0x1e54b7,JSON[_0x33e6('0x16')](_0x476fd0));_0x34863c(_0x476fd0);})['catch'](function(_0x57e85f){logger[_0x33e6('0x17')]('GetVoiceQueueReport',_0x57e85f[_0x33e6('0x19')],_0x1e54b7);_0x1e677f(_0x2228f7[_0x33e6('0x17')](0x1f4,_0x57e85f['message']));});});};exports[_0x33e6('0x26')]=function(_0x5c0cc2){var _0x1f7bfc=this;return new Promise(function(_0x3e863b,_0x271f78){return db[_0x33e6('0x1d')]['create'](_0x5c0cc2[_0x33e6('0x27')],{'raw':_0x5c0cc2[_0x33e6('0x1f')]?_0x5c0cc2[_0x33e6('0x1f')][_0x33e6('0x20')]===undefined?!![]:![]:!![]})[_0x33e6('0x10')](function(_0x28872a){logger[_0x33e6('0x11')]('CreateVoiceQueueReport',_0x5c0cc2);logger['debug'](_0x33e6('0x26'),_0x5c0cc2,JSON[_0x33e6('0x16')](_0x28872a));_0x3e863b(_0x28872a);})[_0x33e6('0x1b')](function(_0x3f4b81){logger['error'](_0x33e6('0x26'),_0x3f4b81[_0x33e6('0x19')],_0x5c0cc2);_0x271f78(_0x1f7bfc['error'](0x1f4,_0x3f4b81[_0x33e6('0x19')]));});});};exports[_0x33e6('0x28')]=function(_0x263514){var _0x1ef3c7=this;return new Promise(function(_0x5ab1ee,_0x178963){return db[_0x33e6('0x1d')]['update'](_0x263514[_0x33e6('0x27')],{'raw':_0x263514['options']?_0x263514['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x263514['options']?_0x263514['options'][_0x33e6('0x21')]||null:null,'attributes':_0x263514[_0x33e6('0x1f')]?_0x263514[_0x33e6('0x1f')][_0x33e6('0x22')]||null:null,'limit':_0x263514[_0x33e6('0x1f')]?_0x263514[_0x33e6('0x1f')]['limit']||null:null})[_0x33e6('0x10')](function(_0x2f1807){logger[_0x33e6('0x11')](_0x33e6('0x28'),_0x263514);logger[_0x33e6('0x13')](_0x33e6('0x28'),_0x263514,JSON['stringify'](_0x2f1807));_0x5ab1ee(_0x2f1807);})[_0x33e6('0x1b')](function(_0x43e9dd){logger['error'](_0x33e6('0x28'),_0x43e9dd[_0x33e6('0x19')],_0x263514);_0x178963(_0x1ef3c7[_0x33e6('0x17')](0x1f4,_0x43e9dd[_0x33e6('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 24022b7..734ae7b 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 _0x289c=['save','remove','update','removeListener','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x2df3ba,_0x439e64){var _0x556108=function(_0x458143){while(--_0x458143){_0x2df3ba['push'](_0x2df3ba['shift']());}};_0x556108(++_0x439e64);}(_0x289c,0x110));var _0xc289=function(_0x5781a1,_0x35a326){_0x5781a1=_0x5781a1-0x0;var _0x37f9c8=_0x289c[_0x5781a1];return _0x37f9c8;};'use strict';var VoiceQueueReportEvents=require(_0xc289('0x0'));var events=[_0xc289('0x1'),_0xc289('0x2'),_0xc289('0x3')];function createListener(_0x550b7b,_0x46a6a3){return function(_0x401de3){_0x46a6a3['emit'](_0x550b7b,_0x401de3);};}function removeListener(_0x10c62c,_0xf802f0){return function(){VoiceQueueReportEvents[_0xc289('0x4')](_0x10c62c,_0xf802f0);};}exports['register']=function(_0x17573e){for(var _0x15145c=0x0,_0x207eca=events[_0xc289('0x5')];_0x15145c<_0x207eca;_0x15145c++){var _0x116c7b=events[_0x15145c];var _0x420e9c=createListener(_0xc289('0x6')+_0x116c7b,_0x17573e);VoiceQueueReportEvents['on'](_0x116c7b,_0x420e9c);}}; \ No newline at end of file +var _0x938a=['register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x938a,0x1f2));var _0xa938=function(_0x2762fc,_0x4d21a6){_0x2762fc=_0x2762fc-0x0;var _0x1ae50b=_0x938a[_0x2762fc];return _0x1ae50b;};'use strict';var VoiceQueueReportEvents=require(_0xa938('0x0'));var events=[_0xa938('0x1'),_0xa938('0x2'),_0xa938('0x3')];function createListener(_0x530fb4,_0x4a6fd8){return function(_0x110fcc){_0x4a6fd8[_0xa938('0x4')](_0x530fb4,_0x110fcc);};}function removeListener(_0x42c636,_0x5625ce){return function(){VoiceQueueReportEvents[_0xa938('0x5')](_0x42c636,_0x5625ce);};}exports[_0xa938('0x6')]=function(_0x4ac3a2){for(var _0x27efe9=0x0,_0x22b3bc=events['length'];_0x27efe9<_0x22b3bc;_0x27efe9++){var _0x56ad1d=events[_0x27efe9];var _0x570280=createListener(_0xa938('0x7')+_0x56ad1d,_0x4ac3a2);VoiceQueueReportEvents['on'](_0x56ad1d,_0x570280);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index d312675..605ff50 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 _0xa994=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x13c366,_0x1198ef){var _0x29a650=function(_0x15182d){while(--_0x15182d){_0x13c366['push'](_0x13c366['shift']());}};_0x29a650(++_0x1198ef);}(_0xa994,0x108));var _0x4a99=function(_0x4dedec,_0x466f9c){_0x4dedec=_0x4dedec-0x0;var _0x14467c=_0xa994[_0x4dedec];return _0x14467c;};'use strict';var multer=require(_0x4a99('0x0'));var util=require(_0x4a99('0x1'));var path=require(_0x4a99('0x2'));var timeout=require(_0x4a99('0x3'));var express=require(_0x4a99('0x4'));var router=express[_0x4a99('0x5')]();var fs_extra=require(_0x4a99('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4a99('0x7'));var config=require(_0x4a99('0x8'));var controller=require('./voiceQueuesLog.controller');router[_0x4a99('0x9')]('/',auth['isAuthenticated'](),controller[_0x4a99('0xa')]);router[_0x4a99('0x9')](_0x4a99('0xb'),auth[_0x4a99('0xc')](),controller[_0x4a99('0xd')]);router[_0x4a99('0xe')]('/',auth[_0x4a99('0xc')](),controller[_0x4a99('0xf')]);router[_0x4a99('0x10')](_0x4a99('0xb'),auth[_0x4a99('0xc')](),controller[_0x4a99('0x11')]);router[_0x4a99('0x12')]('/:id',auth[_0x4a99('0xc')](),controller[_0x4a99('0x13')]);module[_0x4a99('0x14')]=router; \ No newline at end of file +var _0x0447=['create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','/:id','show'];(function(_0x2c3fef,_0x49a276){var _0x297f9b=function(_0x3a50a6){while(--_0x3a50a6){_0x2c3fef['push'](_0x2c3fef['shift']());}};_0x297f9b(++_0x49a276);}(_0x0447,0x1f0));var _0x7044=function(_0x38aafa,_0x6453a7){_0x38aafa=_0x38aafa-0x0;var _0x31beb2=_0x0447[_0x38aafa];return _0x31beb2;};'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[_0x7044('0x5')]();var fs_extra=require(_0x7044('0x6'));var auth=require(_0x7044('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7044('0x8'));var controller=require(_0x7044('0x9'));router['get']('/',auth[_0x7044('0xa')](),controller[_0x7044('0xb')]);router['get'](_0x7044('0xc'),auth[_0x7044('0xa')](),controller[_0x7044('0xd')]);router['post']('/',auth[_0x7044('0xa')](),controller[_0x7044('0xe')]);router['put']('/:id',auth[_0x7044('0xa')](),controller['update']);router[_0x7044('0xf')](_0x7044('0xc'),auth[_0x7044('0xa')](),controller[_0x7044('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 0a9f90a..86a7d5d 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 _0x5dd2=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x2e21e7,_0x157c94){var _0x27260a=function(_0x31f9ea){while(--_0x31f9ea){_0x2e21e7['push'](_0x2e21e7['shift']());}};_0x27260a(++_0x157c94);}(_0x5dd2,0x19e));var _0x25dd=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x5dd2[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x25dd('0x0'));module[_0x25dd('0x1')]={'time':{'type':Sequelize[_0x25dd('0x2')]},'callid':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x25dd('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x25dd('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x25dd('0x4'))}}; \ No newline at end of file +var _0xf88f=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x5b7e6d,_0x432a98){var _0xd8f106=function(_0x5b2058){while(--_0x5b2058){_0x5b7e6d['push'](_0x5b7e6d['shift']());}};_0xd8f106(++_0x432a98);}(_0xf88f,0x1bb));var _0xff88=function(_0x5b1903,_0x5c77fd){_0x5b1903=_0x5b1903-0x0;var _0x551e14=_0xf88f[_0x5b1903];return _0x551e14;};'use strict';var Sequelize=require(_0xff88('0x0'));var moment=require(_0xff88('0x1'));module[_0xff88('0x2')]={'time':{'type':Sequelize[_0xff88('0x3')]},'callid':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xff88('0x4')],'allowNull':![],'defaultValue':moment()[_0xff88('0x5')](_0xff88('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a419614..14225ac 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 _0xc8a5=['order','sort','where','pick','filter','merge','VIRTUAL','VoiceQueuesLog','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','destroy','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc8a5,0x1dd));var _0x5c8a=function(_0x2724da,_0x48681a){_0x2724da=_0x2724da-0x0;var _0xfc4aa3=_0xc8a5[_0x2724da];return _0xfc4aa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c8a('0x0'));var zipdir=require(_0x5c8a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c8a('0x2'));var moment=require('moment');var BPromise=require(_0x5c8a('0x3'));var Mustache=require(_0x5c8a('0x4'));var util=require(_0x5c8a('0x5'));var path=require(_0x5c8a('0x6'));var sox=require(_0x5c8a('0x7'));var csv=require(_0x5c8a('0x8'));var ejs=require(_0x5c8a('0x9'));var fs=require('fs');var fs_extra=require(_0x5c8a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c8a('0xb'));var jsforce=require(_0x5c8a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5c8a('0x8'));var querystring=require(_0x5c8a('0xd'));var Papa=require('papaparse');var Redis=require(_0x5c8a('0xe'));var authService=require(_0x5c8a('0xf'));var qs=require(_0x5c8a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c8a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5c8a('0x12'));var config=require(_0x5c8a('0x13'));var licenseUtil=require(_0x5c8a('0x14'));var db=require(_0x5c8a('0x15'))['db'];function respondWithStatusCode(_0x3a4ab8,_0x5e1089){_0x5e1089=_0x5e1089||0xcc;return function(_0x208e07){if(_0x208e07){return _0x3a4ab8['sendStatus'](_0x5e1089);}return _0x3a4ab8[_0x5c8a('0x16')](_0x5e1089)[_0x5c8a('0x17')]();};}function respondWithResult(_0x1280b5,_0x18c6ef){_0x18c6ef=_0x18c6ef||0xc8;return function(_0x106af1){if(_0x106af1){return _0x1280b5[_0x5c8a('0x16')](_0x18c6ef)[_0x5c8a('0x18')](_0x106af1);}};}function respondWithFilteredResult(_0x5d743e,_0x4ddd25){return function(_0x5dfaa2){if(_0x5dfaa2){var _0x4ec40e=typeof _0x4ddd25[_0x5c8a('0x19')]==='undefined'&&typeof _0x4ddd25['limit']===_0x5c8a('0x1a');var _0x432aa0=_0x5dfaa2[_0x5c8a('0x1b')];var _0x3bc30d=_0x4ec40e?0x0:_0x4ddd25[_0x5c8a('0x19')];var _0x3d239c=_0x4ec40e?_0x5dfaa2['count']:_0x4ddd25['offset']+_0x4ddd25['limit'];var _0x1bd7e2;if(_0x3d239c>=_0x432aa0){_0x3d239c=_0x432aa0;_0x1bd7e2=0xc8;}else{_0x1bd7e2=0xce;}_0x5d743e[_0x5c8a('0x16')](_0x1bd7e2);return _0x5d743e['set'](_0x5c8a('0x1c'),_0x3bc30d+'-'+_0x3d239c+'/'+_0x432aa0)['json'](_0x5dfaa2);}return null;};}function patchUpdates(_0x2c6873){return function(_0x4849c4){try{jsonpatch[_0x5c8a('0x1d')](_0x4849c4,_0x2c6873,!![]);}catch(_0x9b5b4c){return BPromise[_0x5c8a('0x1e')](_0x9b5b4c);}return _0x4849c4[_0x5c8a('0x1f')]();};}function saveUpdates(_0x587c7a,_0x59e0a0){return function(_0x462c87){if(_0x462c87){return _0x462c87[_0x5c8a('0x20')](_0x587c7a)[_0x5c8a('0x21')](function(_0x405ca8){return _0x405ca8;});}return null;};}function removeEntity(_0x1f6f81,_0x28f056){return function(_0x2712d1){if(_0x2712d1){return _0x2712d1['destroy']()['then'](function(){_0x1f6f81[_0x5c8a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x136b80,_0x1f3c94){return function(_0x1c9f34){if(!_0x1c9f34){_0x136b80[_0x5c8a('0x22')](0x194);}return _0x1c9f34;};}function handleError(_0x214f4b,_0x4f2b5f){_0x4f2b5f=_0x4f2b5f||0x1f4;return function(_0x3346f2){logger[_0x5c8a('0x23')](_0x3346f2[_0x5c8a('0x24')]);if(_0x3346f2[_0x5c8a('0x25')]){delete _0x3346f2[_0x5c8a('0x25')];}_0x214f4b[_0x5c8a('0x16')](_0x4f2b5f)[_0x5c8a('0x26')](_0x3346f2);};}exports[_0x5c8a('0x27')]=function(_0xa7050e,_0x248170){var _0x504379={},_0x4687e9={},_0x31ae3a={'count':0x0,'rows':[]};var _0x8b73f5=_[_0x5c8a('0x28')](db['VoiceQueuesLog'][_0x5c8a('0x29')],function(_0x47ea41){return{'name':_0x47ea41[_0x5c8a('0x2a')],'type':_0x47ea41[_0x5c8a('0x2b')][_0x5c8a('0x2c')]};});_0x4687e9[_0x5c8a('0x2d')]=_[_0x5c8a('0x28')](_0x8b73f5,_0x5c8a('0x25'));_0x4687e9[_0x5c8a('0x2e')]=_['keys'](_0xa7050e[_0x5c8a('0x2e')]);_0x4687e9[_0x5c8a('0x2f')]=_['intersection'](_0x4687e9['model'],_0x4687e9[_0x5c8a('0x2e')]);_0x504379[_0x5c8a('0x30')]=_[_0x5c8a('0x31')](_0x4687e9[_0x5c8a('0x2d')],qs[_0x5c8a('0x32')](_0xa7050e[_0x5c8a('0x2e')][_0x5c8a('0x32')]));_0x504379[_0x5c8a('0x30')]=_0x504379['attributes'][_0x5c8a('0x33')]?_0x504379['attributes']:_0x4687e9[_0x5c8a('0x2d')];if(!_0xa7050e[_0x5c8a('0x2e')][_0x5c8a('0x34')](_0x5c8a('0x35'))){_0x504379[_0x5c8a('0x36')]=qs[_0x5c8a('0x36')](_0xa7050e[_0x5c8a('0x2e')][_0x5c8a('0x36')]);_0x504379[_0x5c8a('0x19')]=qs[_0x5c8a('0x19')](_0xa7050e[_0x5c8a('0x2e')][_0x5c8a('0x19')]);}_0x504379[_0x5c8a('0x37')]=qs[_0x5c8a('0x38')](_0xa7050e[_0x5c8a('0x2e')][_0x5c8a('0x38')]);_0x504379[_0x5c8a('0x39')]=qs['filters'](_[_0x5c8a('0x3a')](_0xa7050e[_0x5c8a('0x2e')],_0x4687e9[_0x5c8a('0x2f')]),_0x8b73f5);if(_0xa7050e[_0x5c8a('0x2e')][_0x5c8a('0x3b')]){_0x504379[_0x5c8a('0x39')]=_[_0x5c8a('0x3c')](_0x504379[_0x5c8a('0x39')],{'$or':_[_0x5c8a('0x28')](_0x8b73f5,function(_0x56a484){if(_0x56a484[_0x5c8a('0x2b')]!==_0x5c8a('0x3d')){var _0x1dc349={};_0x1dc349[_0x56a484[_0x5c8a('0x25')]]={'$like':'%'+_0xa7050e[_0x5c8a('0x2e')][_0x5c8a('0x3b')]+'%'};return _0x1dc349;}})});}_0x504379=_['merge']({},_0x504379,_0xa7050e['options']);var _0x404bc4={'where':_0x504379[_0x5c8a('0x39')]};return db[_0x5c8a('0x3e')][_0x5c8a('0x1b')](_0x404bc4)[_0x5c8a('0x21')](function(_0x207123){_0x31ae3a[_0x5c8a('0x1b')]=_0x207123;if(_0xa7050e['query']['includeAll']){_0x504379[_0x5c8a('0x3f')]=[{'all':!![]}];}return db[_0x5c8a('0x3e')][_0x5c8a('0x40')](_0x504379);})[_0x5c8a('0x21')](function(_0x1d176c){_0x31ae3a[_0x5c8a('0x41')]=_0x1d176c;return _0x31ae3a;})[_0x5c8a('0x21')](respondWithFilteredResult(_0x248170,_0x504379))[_0x5c8a('0x42')](handleError(_0x248170,null));};exports[_0x5c8a('0x43')]=function(_0x379562,_0x30fb9e){var _0x4a8bca={'raw':!![],'where':{'id':_0x379562[_0x5c8a('0x44')]['id']}},_0x419b65={};_0x419b65[_0x5c8a('0x2d')]=_['keys'](db[_0x5c8a('0x3e')][_0x5c8a('0x29')]);_0x419b65['query']=_[_0x5c8a('0x45')](_0x379562['query']);_0x419b65[_0x5c8a('0x2f')]=_[_0x5c8a('0x31')](_0x419b65[_0x5c8a('0x2d')],_0x419b65['query']);_0x4a8bca[_0x5c8a('0x30')]=_[_0x5c8a('0x31')](_0x419b65[_0x5c8a('0x2d')],qs['fields'](_0x379562[_0x5c8a('0x2e')]['fields']));_0x4a8bca['attributes']=_0x4a8bca[_0x5c8a('0x30')][_0x5c8a('0x33')]?_0x4a8bca['attributes']:_0x419b65[_0x5c8a('0x2d')];if(_0x379562[_0x5c8a('0x2e')][_0x5c8a('0x46')]){_0x4a8bca['include']=[{'all':!![]}];}_0x4a8bca=_[_0x5c8a('0x3c')]({},_0x4a8bca,_0x379562[_0x5c8a('0x47')]);return db[_0x5c8a('0x3e')][_0x5c8a('0x48')](_0x4a8bca)[_0x5c8a('0x21')](handleEntityNotFound(_0x30fb9e,null))['then'](respondWithResult(_0x30fb9e,null))[_0x5c8a('0x42')](handleError(_0x30fb9e,null));};exports[_0x5c8a('0x49')]=function(_0x562acc,_0xa943a5){return db[_0x5c8a('0x3e')][_0x5c8a('0x49')](_0x562acc[_0x5c8a('0x4a')],{})[_0x5c8a('0x21')](respondWithResult(_0xa943a5,0xc9))['catch'](handleError(_0xa943a5,null));};exports[_0x5c8a('0x20')]=function(_0x11945f,_0x490b1b){if(_0x11945f['body']['id']){delete _0x11945f[_0x5c8a('0x4a')]['id'];}return db['VoiceQueuesLog'][_0x5c8a('0x48')]({'where':{'id':_0x11945f[_0x5c8a('0x44')]['id']}})['then'](handleEntityNotFound(_0x490b1b,null))[_0x5c8a('0x21')](saveUpdates(_0x11945f[_0x5c8a('0x4a')],null))[_0x5c8a('0x21')](respondWithResult(_0x490b1b,null))[_0x5c8a('0x42')](handleError(_0x490b1b,null));};exports[_0x5c8a('0x4b')]=function(_0x3e1d7e,_0xda6254){return db[_0x5c8a('0x3e')][_0x5c8a('0x48')]({'where':{'id':_0x3e1d7e[_0x5c8a('0x44')]['id']}})[_0x5c8a('0x21')](handleEntityNotFound(_0xda6254,null))[_0x5c8a('0x21')](removeEntity(_0xda6254,null))[_0x5c8a('0x42')](handleError(_0xda6254,null));}; \ No newline at end of file +var _0x3f8f=['find','create','update','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','apply','reject','then','sendStatus','name','send','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','catch','params','rawAttributes','includeAll'];(function(_0x38c3c4,_0x22fa29){var _0x2cf445=function(_0x31a6cd){while(--_0x31a6cd){_0x38c3c4['push'](_0x38c3c4['shift']());}};_0x2cf445(++_0x22fa29);}(_0x3f8f,0x91));var _0xf3f8=function(_0x1a4f72,_0x235e0a){_0x1a4f72=_0x1a4f72-0x0;var _0x2b5a22=_0x3f8f[_0x1a4f72];return _0x2b5a22;};'use strict';var emlformat=require(_0xf3f8('0x0'));var rimraf=require(_0xf3f8('0x1'));var zipdir=require(_0xf3f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3f8('0x3'));var moment=require(_0xf3f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf3f8('0x5'));var util=require(_0xf3f8('0x6'));var path=require('path');var sox=require(_0xf3f8('0x7'));var csv=require('to-csv');var ejs=require(_0xf3f8('0x8'));var fs=require('fs');var fs_extra=require(_0xf3f8('0x9'));var _=require(_0xf3f8('0xa'));var squel=require(_0xf3f8('0xb'));var crypto=require('crypto');var jsforce=require(_0xf3f8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf3f8('0xd'));var querystring=require(_0xf3f8('0xe'));var Papa=require(_0xf3f8('0xf'));var Redis=require(_0xf3f8('0x10'));var authService=require(_0xf3f8('0x11'));var qs=require(_0xf3f8('0x12'));var as=require(_0xf3f8('0x13'));var hardwareService=require(_0xf3f8('0x14'));var logger=require(_0xf3f8('0x15'))(_0xf3f8('0x16'));var utils=require(_0xf3f8('0x17'));var config=require(_0xf3f8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3f8('0x19'))['db'];function respondWithStatusCode(_0x2fc557,_0x2efaea){_0x2efaea=_0x2efaea||0xcc;return function(_0x7a01f1){if(_0x7a01f1){return _0x2fc557['sendStatus'](_0x2efaea);}return _0x2fc557[_0xf3f8('0x1a')](_0x2efaea)[_0xf3f8('0x1b')]();};}function respondWithResult(_0x771cdc,_0x482adb){_0x482adb=_0x482adb||0xc8;return function(_0x1036ab){if(_0x1036ab){return _0x771cdc['status'](_0x482adb)['json'](_0x1036ab);}};}function respondWithFilteredResult(_0xe03620,_0x39db24){return function(_0x396a87){if(_0x396a87){var _0x41324c=typeof _0x39db24[_0xf3f8('0x1c')]===_0xf3f8('0x1d')&&typeof _0x39db24['limit']===_0xf3f8('0x1d');var _0x55d935=_0x396a87[_0xf3f8('0x1e')];var _0x554cc6=_0x41324c?0x0:_0x39db24['offset'];var _0x57402b=_0x41324c?_0x396a87[_0xf3f8('0x1e')]:_0x39db24[_0xf3f8('0x1c')]+_0x39db24[_0xf3f8('0x1f')];var _0x451557;if(_0x57402b>=_0x55d935){_0x57402b=_0x55d935;_0x451557=0xc8;}else{_0x451557=0xce;}_0xe03620[_0xf3f8('0x1a')](_0x451557);return _0xe03620[_0xf3f8('0x20')]('Content-Range',_0x554cc6+'-'+_0x57402b+'/'+_0x55d935)['json'](_0x396a87);}return null;};}function patchUpdates(_0x552fd7){return function(_0x48aba4){try{jsonpatch[_0xf3f8('0x21')](_0x48aba4,_0x552fd7,!![]);}catch(_0x47b53a){return BPromise[_0xf3f8('0x22')](_0x47b53a);}return _0x48aba4['save']();};}function saveUpdates(_0x4dc38a,_0x4e45c2){return function(_0x42caba){if(_0x42caba){return _0x42caba['update'](_0x4dc38a)['then'](function(_0x4417de){return _0x4417de;});}return null;};}function removeEntity(_0x6d899f,_0x19126b){return function(_0x251cab){if(_0x251cab){return _0x251cab['destroy']()[_0xf3f8('0x23')](function(){_0x6d899f[_0xf3f8('0x1a')](0xcc)[_0xf3f8('0x1b')]();});}};}function handleEntityNotFound(_0x1e0783,_0x4cf922){return function(_0x32c79c){if(!_0x32c79c){_0x1e0783[_0xf3f8('0x24')](0x194);}return _0x32c79c;};}function handleError(_0x38d6eb,_0x1ca236){_0x1ca236=_0x1ca236||0x1f4;return function(_0x3430b3){logger['error'](_0x3430b3['stack']);if(_0x3430b3[_0xf3f8('0x25')]){delete _0x3430b3[_0xf3f8('0x25')];}_0x38d6eb['status'](_0x1ca236)[_0xf3f8('0x26')](_0x3430b3);};}exports['index']=function(_0x22f8c9,_0x45ccfc){var _0x4855f2={},_0x18f656={},_0x2363ce={'count':0x0,'rows':[]};var _0x25c6c1=_[_0xf3f8('0x27')](db[_0xf3f8('0x28')]['rawAttributes'],function(_0x37ef9c){return{'name':_0x37ef9c[_0xf3f8('0x29')],'type':_0x37ef9c[_0xf3f8('0x2a')][_0xf3f8('0x2b')]};});_0x18f656[_0xf3f8('0x2c')]=_['map'](_0x25c6c1,'name');_0x18f656[_0xf3f8('0x2d')]=_[_0xf3f8('0x2e')](_0x22f8c9[_0xf3f8('0x2d')]);_0x18f656[_0xf3f8('0x2f')]=_[_0xf3f8('0x30')](_0x18f656[_0xf3f8('0x2c')],_0x18f656['query']);_0x4855f2[_0xf3f8('0x31')]=_[_0xf3f8('0x30')](_0x18f656[_0xf3f8('0x2c')],qs[_0xf3f8('0x32')](_0x22f8c9['query'][_0xf3f8('0x32')]));_0x4855f2[_0xf3f8('0x31')]=_0x4855f2[_0xf3f8('0x31')][_0xf3f8('0x33')]?_0x4855f2[_0xf3f8('0x31')]:_0x18f656[_0xf3f8('0x2c')];if(!_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x34')](_0xf3f8('0x35'))){_0x4855f2[_0xf3f8('0x1f')]=qs[_0xf3f8('0x1f')](_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x1f')]);_0x4855f2['offset']=qs[_0xf3f8('0x1c')](_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x1c')]);}_0x4855f2[_0xf3f8('0x36')]=qs[_0xf3f8('0x37')](_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x37')]);_0x4855f2[_0xf3f8('0x38')]=qs[_0xf3f8('0x2f')](_['pick'](_0x22f8c9[_0xf3f8('0x2d')],_0x18f656[_0xf3f8('0x2f')]),_0x25c6c1);if(_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x39')]){_0x4855f2['where']=_['merge'](_0x4855f2['where'],{'$or':_[_0xf3f8('0x27')](_0x25c6c1,function(_0x36777e){if(_0x36777e['type']!=='VIRTUAL'){var _0x55be11={};_0x55be11[_0x36777e[_0xf3f8('0x25')]]={'$like':'%'+_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x39')]+'%'};return _0x55be11;}})});}_0x4855f2=_[_0xf3f8('0x3a')]({},_0x4855f2,_0x22f8c9[_0xf3f8('0x3b')]);var _0x4c2042={'where':_0x4855f2[_0xf3f8('0x38')]};return db[_0xf3f8('0x28')]['count'](_0x4c2042)['then'](function(_0x32ece4){_0x2363ce['count']=_0x32ece4;if(_0x22f8c9[_0xf3f8('0x2d')]['includeAll']){_0x4855f2['include']=[{'all':!![]}];}return db[_0xf3f8('0x28')][_0xf3f8('0x3c')](_0x4855f2);})['then'](function(_0x2757dd){_0x2363ce['rows']=_0x2757dd;return _0x2363ce;})[_0xf3f8('0x23')](respondWithFilteredResult(_0x45ccfc,_0x4855f2))[_0xf3f8('0x3d')](handleError(_0x45ccfc,null));};exports['show']=function(_0x25f7cb,_0x55d01d){var _0xca667a={'raw':!![],'where':{'id':_0x25f7cb[_0xf3f8('0x3e')]['id']}},_0x38cbe5={};_0x38cbe5[_0xf3f8('0x2c')]=_[_0xf3f8('0x2e')](db['VoiceQueuesLog'][_0xf3f8('0x3f')]);_0x38cbe5[_0xf3f8('0x2d')]=_[_0xf3f8('0x2e')](_0x25f7cb[_0xf3f8('0x2d')]);_0x38cbe5['filters']=_[_0xf3f8('0x30')](_0x38cbe5[_0xf3f8('0x2c')],_0x38cbe5[_0xf3f8('0x2d')]);_0xca667a['attributes']=_['intersection'](_0x38cbe5['model'],qs[_0xf3f8('0x32')](_0x25f7cb['query'][_0xf3f8('0x32')]));_0xca667a[_0xf3f8('0x31')]=_0xca667a[_0xf3f8('0x31')]['length']?_0xca667a[_0xf3f8('0x31')]:_0x38cbe5[_0xf3f8('0x2c')];if(_0x25f7cb[_0xf3f8('0x2d')][_0xf3f8('0x40')]){_0xca667a['include']=[{'all':!![]}];}_0xca667a=_[_0xf3f8('0x3a')]({},_0xca667a,_0x25f7cb[_0xf3f8('0x3b')]);return db[_0xf3f8('0x28')][_0xf3f8('0x41')](_0xca667a)['then'](handleEntityNotFound(_0x55d01d,null))[_0xf3f8('0x23')](respondWithResult(_0x55d01d,null))[_0xf3f8('0x3d')](handleError(_0x55d01d,null));};exports[_0xf3f8('0x42')]=function(_0xbd182d,_0x3eba62){return db[_0xf3f8('0x28')][_0xf3f8('0x42')](_0xbd182d['body'],{})[_0xf3f8('0x23')](respondWithResult(_0x3eba62,0xc9))[_0xf3f8('0x3d')](handleError(_0x3eba62,null));};exports[_0xf3f8('0x43')]=function(_0x254ba6,_0x529d6f){if(_0x254ba6[_0xf3f8('0x44')]['id']){delete _0x254ba6['body']['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x254ba6['params']['id']}})[_0xf3f8('0x23')](handleEntityNotFound(_0x529d6f,null))[_0xf3f8('0x23')](saveUpdates(_0x254ba6[_0xf3f8('0x44')],null))['then'](respondWithResult(_0x529d6f,null))[_0xf3f8('0x3d')](handleError(_0x529d6f,null));};exports[_0xf3f8('0x45')]=function(_0x484607,_0x2b22a9){return db[_0xf3f8('0x28')][_0xf3f8('0x41')]({'where':{'id':_0x484607['params']['id']}})[_0xf3f8('0x23')](handleEntityNotFound(_0x2b22a9,null))[_0xf3f8('0x23')](removeEntity(_0x2b22a9,null))[_0xf3f8('0x3d')](handleError(_0x2b22a9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index ad92dac..e348567 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 _0x1b6d=['voice_queues_log','dtm','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog'];(function(_0x1193cf,_0x396c29){var _0x3148ab=function(_0x225a85){while(--_0x225a85){_0x1193cf['push'](_0x1193cf['shift']());}};_0x3148ab(++_0x396c29);}(_0x1b6d,0x1e6));var _0xd1b6=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1b6d[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xd1b6('0x0'));var util=require('util');var logger=require(_0xd1b6('0x1'))('api');var moment=require(_0xd1b6('0x2'));var BPromise=require(_0xd1b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd1b6('0x4'));var rimraf=require(_0xd1b6('0x5'));var config=require(_0xd1b6('0x6'));var attributes=require(_0xd1b6('0x7'));module['exports']=function(_0x206666,_0x4c053c){return _0x206666['define'](_0xd1b6('0x8'),attributes,{'tableName':_0xd1b6('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0xd1b6('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xbdeb=['dtm','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdeb,0x1ef));var _0xbbde=function(_0x2e5a33,_0x2e768c){_0x2e5a33=_0x2e5a33-0x0;var _0x1f5221=_0xbdeb[_0x2e5a33];return _0x1f5221;};'use strict';var _=require(_0xbbde('0x0'));var util=require('util');var logger=require(_0xbbde('0x1'))(_0xbbde('0x2'));var moment=require(_0xbbde('0x3'));var BPromise=require(_0xbbde('0x4'));var rp=require(_0xbbde('0x5'));var fs=require('fs');var path=require(_0xbbde('0x6'));var rimraf=require('rimraf');var config=require(_0xbbde('0x7'));var attributes=require(_0xbbde('0x8'));module['exports']=function(_0x49a834,_0x459cdd){return _0x49a834[_0xbbde('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xbbde('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xbbde('0xb'),_0xbbde('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index eb0be70..481de91 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 _0xd1a6=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','info','catch'];(function(_0xb11807,_0x3ad4d8){var _0x4e0025=function(_0xd04f36){while(--_0xd04f36){_0xb11807['push'](_0xb11807['shift']());}};_0x4e0025(++_0x3ad4d8);}(_0xd1a6,0x176));var _0x6d1a=function(_0x4cd685,_0x472697){_0x4cd685=_0x4cd685-0x0;var _0x37743e=_0xd1a6[_0x4cd685];return _0x37743e;};'use strict';var _=require('lodash');var util=require(_0x6d1a('0x0'));var moment=require(_0x6d1a('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d1a('0x2'));var fs=require('fs');var Redis=require(_0x6d1a('0x3'));var db=require(_0x6d1a('0x4'))['db'];var utils=require(_0x6d1a('0x5'));var logger=require(_0x6d1a('0x6'))(_0x6d1a('0x7'));var config=require(_0x6d1a('0x8'));var jayson=require(_0x6d1a('0x9'));var client=jayson[_0x6d1a('0xa')][_0x6d1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a0c3d,_0x108d18,_0x2ee44c){return new BPromise(function(_0xf58310,_0x7edb45){return client[_0x6d1a('0xc')](_0x2a0c3d,_0x2ee44c)[_0x6d1a('0xd')](function(_0x398142){logger['info'](_0x6d1a('0xe'),_0x108d18,_0x6d1a('0xf'));logger['debug'](_0x6d1a('0x10'),_0x108d18,_0x6d1a('0xf'),JSON['stringify'](_0x398142));if(_0x398142[_0x6d1a('0x11')]){if(_0x398142['error'][_0x6d1a('0x12')]===0x1f4){logger[_0x6d1a('0x11')](_0x6d1a('0xe'),_0x108d18,_0x398142['error'][_0x6d1a('0x13')]);return _0x7edb45(_0x398142[_0x6d1a('0x11')][_0x6d1a('0x13')]);}logger['error'](_0x6d1a('0xe'),_0x108d18,_0x398142[_0x6d1a('0x11')]['message']);return _0xf58310(_0x398142['error']['message']);}else{logger[_0x6d1a('0x14')](_0x6d1a('0xe'),_0x108d18,_0x6d1a('0xf'));_0xf58310(_0x398142['result'][_0x6d1a('0x13')]);}})[_0x6d1a('0x15')](function(_0x122795){logger['error'](_0x6d1a('0xe'),_0x108d18,_0x122795);_0x7edb45(_0x122795);});});} \ No newline at end of file +var _0x0b3e=['debug','stringify','error','message','info','VoiceQueuesLog,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','request\x20sent'];(function(_0x2c071b,_0x2b57ba){var _0x25749b=function(_0x2d475c){while(--_0x2d475c){_0x2c071b['push'](_0x2c071b['shift']());}};_0x25749b(++_0x2b57ba);}(_0x0b3e,0xfe));var _0xe0b3=function(_0x445bf2,_0x3c9a29){_0x445bf2=_0x445bf2-0x0;var _0x4add18=_0x0b3e[_0x445bf2];return _0x4add18;};'use strict';var _=require('lodash');var util=require(_0xe0b3('0x0'));var moment=require(_0xe0b3('0x1'));var BPromise=require(_0xe0b3('0x2'));var rs=require(_0xe0b3('0x3'));var fs=require('fs');var Redis=require(_0xe0b3('0x4'));var db=require(_0xe0b3('0x5'))['db'];var utils=require(_0xe0b3('0x6'));var logger=require('../../config/logger')(_0xe0b3('0x7'));var config=require(_0xe0b3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe0b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c465f,_0x206ba2,_0x42d537){return new BPromise(function(_0x4ceb89,_0x4b62f2){return client['request'](_0x2c465f,_0x42d537)[_0xe0b3('0xa')](function(_0x4c841b){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x206ba2,_0xe0b3('0xb'));logger[_0xe0b3('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x206ba2,'request\x20sent',JSON[_0xe0b3('0xd')](_0x4c841b));if(_0x4c841b[_0xe0b3('0xe')]){if(_0x4c841b[_0xe0b3('0xe')]['code']===0x1f4){logger[_0xe0b3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x206ba2,_0x4c841b[_0xe0b3('0xe')]['message']);return _0x4b62f2(_0x4c841b[_0xe0b3('0xe')]['message']);}logger[_0xe0b3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x206ba2,_0x4c841b[_0xe0b3('0xe')][_0xe0b3('0xf')]);return _0x4ceb89(_0x4c841b[_0xe0b3('0xe')][_0xe0b3('0xf')]);}else{logger[_0xe0b3('0x10')](_0xe0b3('0x11'),_0x206ba2,_0xe0b3('0xb'));_0x4ceb89(_0x4c841b[_0xe0b3('0x12')][_0xe0b3('0xf')]);}})['catch'](function(_0x4eeced){logger['error'](_0xe0b3('0x11'),_0x206ba2,_0x4eeced);_0x4b62f2(_0x4eeced);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 7810fbd..c627af9 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 _0x6e5a=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/:id','/:id/download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','destroy','exports','multer'];(function(_0x209b33,_0x50da6b){var _0x18e925=function(_0x1f8f84){while(--_0x1f8f84){_0x209b33['push'](_0x209b33['shift']());}};_0x18e925(++_0x50da6b);}(_0x6e5a,0xf9));var _0xa6e5=function(_0xef5c49,_0x4103d3){_0xef5c49=_0xef5c49-0x0;var _0x25d161=_0x6e5a[_0xef5c49];return _0x25d161;};'use strict';var multer=require(_0xa6e5('0x0'));var util=require(_0xa6e5('0x1'));var path=require(_0xa6e5('0x2'));var timeout=require(_0xa6e5('0x3'));var express=require(_0xa6e5('0x4'));var router=express[_0xa6e5('0x5')]();var fs_extra=require(_0xa6e5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa6e5('0x7'));var config=require('../../config/environment');var controller=require(_0xa6e5('0x8'));router[_0xa6e5('0x9')]('/',auth[_0xa6e5('0xa')](),controller[_0xa6e5('0xb')]);router[_0xa6e5('0x9')]('/describe',auth[_0xa6e5('0xa')](),controller['describe']);router['get'](_0xa6e5('0xc'),auth[_0xa6e5('0xa')](),controller['show']);router[_0xa6e5('0x9')](_0xa6e5('0xd'),auth[_0xa6e5('0xa')](),controller['download']);router[_0xa6e5('0x9')](_0xa6e5('0xe'),controller['downloads']);router[_0xa6e5('0x9')]('/:id/transcribe',auth[_0xa6e5('0xa')](),controller[_0xa6e5('0xf')]);router[_0xa6e5('0x10')]('/',auth[_0xa6e5('0xa')](),controller[_0xa6e5('0x11')]);router['post'](_0xa6e5('0x12'),auth[_0xa6e5('0xa')](),controller[_0xa6e5('0x13')]);router[_0xa6e5('0x14')](_0xa6e5('0xc'),auth[_0xa6e5('0xa')](),controller[_0xa6e5('0x15')]);router[_0xa6e5('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xa6e5('0x17')]);module[_0xa6e5('0x18')]=router; \ No newline at end of file +var _0xacbe=['post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceRecording.controller','get','index','/describe','isAuthenticated','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe'];(function(_0x571a56,_0x36a8fe){var _0x25fd65=function(_0x329c41){while(--_0x329c41){_0x571a56['push'](_0x571a56['shift']());}};_0x25fd65(++_0x36a8fe);}(_0xacbe,0xe8));var _0xeacb=function(_0x2d9d5f,_0x3591bd){_0x2d9d5f=_0x2d9d5f-0x0;var _0x11174b=_0xacbe[_0x2d9d5f];return _0x11174b;};'use strict';var multer=require(_0xeacb('0x0'));var util=require(_0xeacb('0x1'));var path=require(_0xeacb('0x2'));var timeout=require(_0xeacb('0x3'));var express=require(_0xeacb('0x4'));var router=express[_0xeacb('0x5')]();var fs_extra=require(_0xeacb('0x6'));var auth=require(_0xeacb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeacb('0x8'));router[_0xeacb('0x9')]('/',auth['isAuthenticated'](),controller[_0xeacb('0xa')]);router[_0xeacb('0x9')](_0xeacb('0xb'),auth[_0xeacb('0xc')](),controller['describe']);router[_0xeacb('0x9')]('/:id',auth[_0xeacb('0xc')](),controller['show']);router[_0xeacb('0x9')](_0xeacb('0xd'),auth['isAuthenticated'](),controller[_0xeacb('0xe')]);router['get']('/:id/downloads',controller[_0xeacb('0xf')]);router[_0xeacb('0x9')](_0xeacb('0x10'),auth[_0xeacb('0xc')](),controller[_0xeacb('0x11')]);router[_0xeacb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xeacb('0x10'),auth[_0xeacb('0xc')](),controller['runTranscribe']);router[_0xeacb('0x13')](_0xeacb('0x14'),auth[_0xeacb('0xc')](),controller[_0xeacb('0x15')]);router[_0xeacb('0x16')](_0xeacb('0x14'),auth[_0xeacb('0xc')](),controller[_0xeacb('0x17')]);module[_0xeacb('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 7f942dd..511e725 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 e920793..1ec5f31 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 _0xc3ae=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','format','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','VoiceRecording','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','options','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','filename','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Setting','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','sentiment','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','transcribeRegion','Buckets','Name','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2ad723,_0x295246){var _0x5e32d9=function(_0x130567){while(--_0x130567){_0x2ad723['push'](_0x2ad723['shift']());}};_0x5e32d9(++_0x295246);}(_0xc3ae,0x85));var _0xec3a=function(_0x10843d,_0x2f96d3){_0x10843d=_0x10843d-0x0;var _0x59905f=_0xc3ae[_0x10843d];return _0x59905f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec3a('0x0'));var zipdir=require(_0xec3a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec3a('0x2'));var moment=require(_0xec3a('0x3'));var BPromise=require(_0xec3a('0x4'));var Mustache=require(_0xec3a('0x5'));var util=require('util');var path=require(_0xec3a('0x6'));var sox=require(_0xec3a('0x7'));var csv=require(_0xec3a('0x8'));var ejs=require(_0xec3a('0x9'));var fs=require('fs');var fs_extra=require(_0xec3a('0xa'));var _=require(_0xec3a('0xb'));var squel=require('squel');var crypto=require(_0xec3a('0xc'));var jsforce=require(_0xec3a('0xd'));var deskjs=require(_0xec3a('0xe'));var toCsv=require(_0xec3a('0x8'));var querystring=require(_0xec3a('0xf'));var Papa=require(_0xec3a('0x10'));var AWS=require(_0xec3a('0x11'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xec3a('0x12'));var qs=require(_0xec3a('0x13'));var as=require(_0xec3a('0x14'));var hardwareService=require(_0xec3a('0x15'));var logger=require(_0xec3a('0x16'))(_0xec3a('0x17'));var utils=require(_0xec3a('0x18'));var config=require(_0xec3a('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x586800,_0x18f119){_0x18f119=_0x18f119||0xcc;return function(_0x2f8740){if(_0x2f8740){return _0x586800[_0xec3a('0x1a')](_0x18f119);}return _0x586800[_0xec3a('0x1b')](_0x18f119)[_0xec3a('0x1c')]();};}function respondWithResult(_0x114094,_0x1f17b9){_0x1f17b9=_0x1f17b9||0xc8;return function(_0x588010){if(_0x588010){return _0x114094['status'](_0x1f17b9)['json'](_0x588010);}};}function respondWithFilteredResult(_0x179f7f,_0x206c9b){return function(_0x23ab0f){if(_0x23ab0f){var _0x5826ee=typeof _0x206c9b[_0xec3a('0x1d')]==='undefined'&&typeof _0x206c9b[_0xec3a('0x1e')]===_0xec3a('0x1f');var _0x74fefa=_0x23ab0f[_0xec3a('0x20')];var _0x423537=_0x5826ee?0x0:_0x206c9b['offset'];var _0x41b5ec=_0x5826ee?_0x23ab0f[_0xec3a('0x20')]:_0x206c9b[_0xec3a('0x1d')]+_0x206c9b[_0xec3a('0x1e')];var _0x5ca4ce;if(_0x41b5ec>=_0x74fefa){_0x41b5ec=_0x74fefa;_0x5ca4ce=0xc8;}else{_0x5ca4ce=0xce;}_0x179f7f[_0xec3a('0x1b')](_0x5ca4ce);return _0x179f7f['set'](_0xec3a('0x21'),_0x423537+'-'+_0x41b5ec+'/'+_0x74fefa)['json'](_0x23ab0f);}return null;};}function patchUpdates(_0x1bf18d){return function(_0x2d2d42){try{jsonpatch[_0xec3a('0x22')](_0x2d2d42,_0x1bf18d,!![]);}catch(_0x594219){return BPromise[_0xec3a('0x23')](_0x594219);}return _0x2d2d42[_0xec3a('0x24')]();};}function saveUpdates(_0x5435a0,_0x5aca2c){return function(_0xa11c4d){if(_0xa11c4d){return _0xa11c4d[_0xec3a('0x25')](_0x5435a0)[_0xec3a('0x26')](function(_0x1f0826){return _0x1f0826;});}return null;};}function removeEntity(_0x5bbc1a,_0x4bf9f2){return function(_0x53383b){if(_0x53383b){return _0x53383b[_0xec3a('0x27')]()[_0xec3a('0x26')](function(){_0x5bbc1a[_0xec3a('0x1b')](0xcc)[_0xec3a('0x1c')]();});}};}function handleEntityNotFound(_0x3d4881,_0x28f8f5){return function(_0x271a81){if(!_0x271a81){_0x3d4881[_0xec3a('0x1a')](0x194);}return _0x271a81;};}function handleError(_0x456fb4,_0x35989f){_0x35989f=_0x35989f||0x1f4;return function(_0x2c260f){logger[_0xec3a('0x28')](_0x2c260f[_0xec3a('0x29')]);if(_0x2c260f[_0xec3a('0x2a')]){delete _0x2c260f[_0xec3a('0x2a')];}_0x456fb4[_0xec3a('0x1b')](_0x35989f)['send'](_0x2c260f);};}exports[_0xec3a('0x2b')]=function(_0xba3283,_0x36f685){var _0x15cab3={},_0x599643={},_0x15852b={'count':0x0,'rows':[]};var _0x135734=_[_0xec3a('0x2c')](db['VoiceRecording']['rawAttributes'],function(_0x229cd7){return{'name':_0x229cd7[_0xec3a('0x2d')],'type':_0x229cd7[_0xec3a('0x2e')][_0xec3a('0x2f')]};});_0x599643[_0xec3a('0x30')]=_['differenceBy'](_['map'](_0x135734,_0xec3a('0x2a')),[_0xec3a('0x31')]);_0x599643['query']=_['keys'](_0xba3283[_0xec3a('0x32')]);_0x599643[_0xec3a('0x33')]=_[_0xec3a('0x34')](_0x599643['model'],_0x599643['query']);_0x15cab3[_0xec3a('0x35')]=_[_0xec3a('0x34')](_0x599643[_0xec3a('0x30')],qs[_0xec3a('0x36')](_0xba3283[_0xec3a('0x32')][_0xec3a('0x36')]));_0x15cab3['attributes']=_0x15cab3[_0xec3a('0x35')]['length']?_0x15cab3[_0xec3a('0x35')]:_0x599643['model'];if(!_0xba3283['query'][_0xec3a('0x37')](_0xec3a('0x38'))){_0x15cab3[_0xec3a('0x1e')]=qs[_0xec3a('0x1e')](_0xba3283[_0xec3a('0x32')][_0xec3a('0x1e')]);_0x15cab3[_0xec3a('0x1d')]=qs[_0xec3a('0x1d')](_0xba3283['query'][_0xec3a('0x1d')]);}_0x15cab3[_0xec3a('0x39')]=qs[_0xec3a('0x3a')](_0xba3283[_0xec3a('0x32')][_0xec3a('0x3a')]);_0x15cab3['where']=qs[_0xec3a('0x33')](_[_0xec3a('0x3b')](_0xba3283[_0xec3a('0x32')],_0x599643['filters']),_0x135734);if(_0xba3283['query'][_0xec3a('0x3c')]){_0x15cab3[_0xec3a('0x3d')]=_[_0xec3a('0x3e')](_0x15cab3['where'],{'$or':_[_0xec3a('0x2c')](_0x135734,function(_0x5d06b7){if(_0x5d06b7['type']!==_0xec3a('0x3f')){var _0x527532={};_0x527532[_0x5d06b7[_0xec3a('0x2a')]]={'$like':'%'+_0xba3283[_0xec3a('0x32')][_0xec3a('0x3c')]+'%'};return _0x527532;}})});}_0x15cab3=_[_0xec3a('0x3e')]({},_0x15cab3,_0xba3283['options']);var _0x23f963={'where':_0x15cab3[_0xec3a('0x3d')]};return db[_0xec3a('0x40')][_0xec3a('0x20')](_0x23f963)['then'](function(_0x4b0f63){_0x15852b[_0xec3a('0x20')]=_0x4b0f63;if(_0xba3283[_0xec3a('0x32')][_0xec3a('0x41')]){_0x15cab3[_0xec3a('0x42')]=[{'all':!![]}];}return db[_0xec3a('0x40')][_0xec3a('0x43')](_0x15cab3);})[_0xec3a('0x26')](function(_0x38d7e5){_0x15852b['rows']=_0x38d7e5;return _0x15852b;})[_0xec3a('0x26')](respondWithFilteredResult(_0x36f685,_0x15cab3))[_0xec3a('0x44')](handleError(_0x36f685,null));};exports[_0xec3a('0x45')]=function(_0x8318,_0x37721f){var _0x455e24={'raw':![],'where':{'id':_0x8318[_0xec3a('0x46')]['id']}},_0x391968={};_0x391968[_0xec3a('0x30')]=_[_0xec3a('0x47')](db[_0xec3a('0x40')][_0xec3a('0x48')]);_0x391968[_0xec3a('0x32')]=_[_0xec3a('0x47')](_0x8318[_0xec3a('0x32')]);_0x391968[_0xec3a('0x33')]=_['intersection'](_0x391968[_0xec3a('0x30')],_0x391968[_0xec3a('0x32')]);_0x455e24['attributes']=_[_0xec3a('0x34')](_0x391968['model'],qs[_0xec3a('0x36')](_0x8318[_0xec3a('0x32')][_0xec3a('0x36')]));_0x455e24[_0xec3a('0x35')]=_0x455e24[_0xec3a('0x35')][_0xec3a('0x49')]?_0x455e24['attributes']:_0x391968[_0xec3a('0x30')];if(_0x8318[_0xec3a('0x32')][_0xec3a('0x41')]){_0x455e24[_0xec3a('0x42')]=[{'all':!![]}];}_0x455e24=_[_0xec3a('0x3e')]({},_0x455e24,_0x8318[_0xec3a('0x4a')]);return db['VoiceRecording'][_0xec3a('0x4b')](_0x455e24)[_0xec3a('0x26')](handleEntityNotFound(_0x37721f,null))['then'](respondWithResult(_0x37721f,null))[_0xec3a('0x44')](handleError(_0x37721f,null));};exports[_0xec3a('0x4c')]=function(_0x42da24,_0x99d6b){return db[_0xec3a('0x40')][_0xec3a('0x4c')](_0x42da24['body'],{})[_0xec3a('0x26')](respondWithResult(_0x99d6b,0xc9))['catch'](handleError(_0x99d6b,null));};exports[_0xec3a('0x25')]=function(_0x23e061,_0x272d22){if(_0x23e061[_0xec3a('0x4d')]['id']){delete _0x23e061[_0xec3a('0x4d')]['id'];}return db[_0xec3a('0x40')][_0xec3a('0x4b')]({'where':{'id':_0x23e061[_0xec3a('0x46')]['id']}})[_0xec3a('0x26')](handleEntityNotFound(_0x272d22,null))[_0xec3a('0x26')](saveUpdates(_0x23e061[_0xec3a('0x4d')],null))[_0xec3a('0x26')](respondWithResult(_0x272d22,null))['catch'](handleError(_0x272d22,null));};exports[_0xec3a('0x4e')]=function(_0x14a289,_0x342da2){return db[_0xec3a('0x40')][_0xec3a('0x4e')]()[_0xec3a('0x26')](respondWithResult(_0x342da2,null))[_0xec3a('0x44')](handleError(_0x342da2,null));};exports[_0xec3a('0x4f')]=function(_0x570dff,_0x14c0ac,_0xe3838f){var _0xa9d91e=require(_0xec3a('0x50'));var _0x58d7c1=![];var _0x1b65d1={};if(_0x570dff['query']['type']&&_0x570dff[_0xec3a('0x32')][_0xec3a('0x2e')]==='uniqueid'){_0x1b65d1[_0xec3a('0x51')]=_0x570dff[_0xec3a('0x46')]['id'];}else{_0x1b65d1['id']=_0x570dff['params']['id'];}return db['VoiceRecording'][_0xec3a('0x4b')]({'where':_0x1b65d1,'attributes':['id',_0xec3a('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x14c0ac,null))[_0xec3a('0x26')](function(_0x1080bc){if(_0x1080bc){var _0xd8ff1c=_0x1080bc[_0xec3a('0x52')];var _0x3a4563=util[_0xec3a('0x31')](_0xec3a('0x53'),_0xd8ff1c);if(fs[_0xec3a('0x54')](_0x3a4563)){_0x58d7c1=!![];return _0xa9d91e[_0xec3a('0x55')](_0x3a4563,_0xd8ff1c,config[_0xec3a('0x56')][_0xec3a('0x57')])[_0xec3a('0x26')](function(){return _0x1080bc;});}return _0x1080bc;}})[_0xec3a('0x26')](function(_0x3c5654){if(_0x3c5654){var _0x2daf6b=_0x3c5654[_0xec3a('0x52')];if(!fs[_0xec3a('0x54')](_0x2daf6b)){throw new db[(_0xec3a('0x58'))][(_0xec3a('0x59'))](_0xec3a('0x5a'));}if(_0x3c5654['filename']){return _0x14c0ac['download'](_0x2daf6b,_0x3c5654['filename']+path[_0xec3a('0x5b')](_0x2daf6b),function(){if(_0x58d7c1){fs[_0xec3a('0x5c')](_0x2daf6b);}});}else{return _0x14c0ac[_0xec3a('0x4f')](_0x2daf6b,function(_0x2a9d2d){if(_0x58d7c1){fs[_0xec3a('0x5c')](_0x2daf6b);}});}}})[_0xec3a('0x44')](function(_0x29f10a){if(_0x29f10a[_0xec3a('0x5d')]==='VoiceRecording\x20not\x20found'){_0x14c0ac[_0xec3a('0x1b')](0x194)[_0xec3a('0x5e')](_0xec3a('0x5f'));}else{return handleError(_0x14c0ac,null);}});};exports[_0xec3a('0x60')]=function(_0x2b837e,_0x3687fd,_0x40af48){var _0x592b47=require(_0xec3a('0x50'));var _0x2dd57c=![];var _0x40aead={'$and':[db[_0xec3a('0x61')][_0xec3a('0x3d')](db['sequelize']['fn'](_0xec3a('0x62'),db[_0xec3a('0x61')][_0xec3a('0x63')]('uniqueid')),_0x2b837e[_0xec3a('0x32')][_0xec3a('0x64')])]};if(_0x2b837e[_0xec3a('0x32')]['type']&&_0x2b837e['query'][_0xec3a('0x2e')]==='uniqueid'){_0x40aead['$and']['push']({'uniqueid':_0x2b837e['params']['id']});}else{_0x40aead[_0xec3a('0x65')][_0xec3a('0x66')]({'id':_0x2b837e[_0xec3a('0x46')]['id']});}return db['VoiceRecording']['find']({'where':_0x40aead,'attributes':['id',_0xec3a('0x52')],'raw':!![]})[_0xec3a('0x26')](handleEntityNotFound(_0x3687fd,null))[_0xec3a('0x26')](function(_0x2f93de){if(_0x2f93de){var _0x36dd43=util[_0xec3a('0x31')](_0xec3a('0x53'),_0x2f93de[_0xec3a('0x52')]);if(fs[_0xec3a('0x54')](_0x36dd43)){_0x2dd57c=!![];return _0x592b47['decryptFile'](_0x36dd43,_0x2f93de[_0xec3a('0x52')],config[_0xec3a('0x56')][_0xec3a('0x57')])[_0xec3a('0x26')](function(){return _0x2f93de;});}return _0x2f93de;}})[_0xec3a('0x26')](function(_0x2d0345){if(_0x2d0345){if(!fs[_0xec3a('0x54')](_0x2d0345[_0xec3a('0x52')])){throw new db[(_0xec3a('0x58'))][(_0xec3a('0x59'))]('VoiceRecording\x20not\x20found');}if(_0x2d0345['filename']){return _0x3687fd[_0xec3a('0x4f')](_0x2d0345[_0xec3a('0x52')],_0x2d0345[_0xec3a('0x67')]+path[_0xec3a('0x5b')](_0x2d0345['value']),function(){if(_0x2dd57c){fs['unlink'](_0x2d0345[_0xec3a('0x52')]);}});}else{return _0x3687fd[_0xec3a('0x4f')](_0x2d0345[_0xec3a('0x52')],function(_0x512f27){if(_0x2dd57c){fs[_0xec3a('0x5c')](_0x2d0345[_0xec3a('0x52')]);}});}}})[_0xec3a('0x44')](handleError(_0x3687fd,null));};exports['destroy']=function(_0x945a93,_0x13b478){return db[_0xec3a('0x40')][_0xec3a('0x4b')]({'where':{'id':_0x945a93['params']['id']}})[_0xec3a('0x26')](function(_0x472b2a){if(_[_0xec3a('0x68')](_0x472b2a)){throw new ReferenceError('Entity\x20not\x20found');}return _0x472b2a;})[_0xec3a('0x26')](function(_0x509346){var _0x585d47=_0x509346['value'];logger[_0xec3a('0x69')](_0xec3a('0x6a'),_0x585d47);if(!_[_0xec3a('0x68')](_0x509346['value'])&&fs[_0xec3a('0x54')](_0x585d47)){logger[_0xec3a('0x69')]('File:\x20\x22'+_0x585d47+_0xec3a('0x6b'));fs[_0xec3a('0x6c')](_0x585d47);}_0x585d47=_0x585d47+_0xec3a('0x6d');if(!_[_0xec3a('0x68')](_0x509346['value'])&&fs['existsSync'](_0x585d47)){logger[_0xec3a('0x69')](_0xec3a('0x6e')+_0x585d47+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xec3a('0x6c')](_0x585d47);}return _0x509346;})[_0xec3a('0x26')](function(_0x348e60){if(!_0x348e60)throw new InternalError();return _0x348e60[_0xec3a('0x27')]();})['then'](function(){_0x13b478[_0xec3a('0x1b')](0xcc)[_0xec3a('0x1c')]();})[_0xec3a('0x44')](handleError(_0x13b478,null));};function getBucketslist(_0x4932f5,_0x5d75dc,_0x22575c){return new Promise(function(_0x22166d,_0x4283a9){var _0x65bbf9=new AWS['S3']({'accessKeyId':_0x5d75dc,'secretAccessKey':_0x4932f5,'region':_0x22575c});_0x65bbf9[_0xec3a('0x6f')]({},function(_0x13e0ce,_0x1ef779){if(_0x13e0ce){return _0x4283a9(_0x13e0ce);}else{return _0x22166d(_0x1ef779);}});});}function createBucket(_0x3caaa5,_0x44c18b,_0x474087,_0x4339af){return new Promise(function(_0x40e921,_0x1e0413){var _0x214d94=new AWS['S3']({'accessKeyId':_0x44c18b,'secretAccessKey':_0x3caaa5,'region':_0x474087});_0x214d94[_0xec3a('0x70')]({'Bucket':_0x4339af},function(_0xec830e,_0xcd6734){if(_0xec830e){return _0x1e0413(_0xec830e);}else{return _0x40e921(_0xcd6734);}});});}function uploadFile(_0x497246,_0x363d17,_0x33918f,_0x3f7655,_0x2aaa5c,_0x196493){return new Promise(function(_0x51268a,_0x4474ae){var _0x20aae=new AWS['S3']({'accessKeyId':_0x363d17,'secretAccessKey':_0x497246,'region':_0x33918f});_0x20aae[_0xec3a('0x71')]({'Bucket':_0x3f7655,'Key':_0x2aaa5c,'Body':_0x196493},function(_0x4c81a2,_0x12ec3d){if(_0x4c81a2){return _0x4474ae(_0x4c81a2);}else{return _0x51268a(_0x12ec3d);}});});}function startTranscribe(_0x4ff612,_0x506a19,_0x28630f,_0x523538,_0x3789d4,_0x1fa913){return new Promise(function(_0x17cda5,_0x21c437){var _0x18664e=new AWS[(_0xec3a('0x72'))]({'accessKeyId':_0x506a19,'secretAccessKey':_0x4ff612,'region':_0x28630f});_0x18664e[_0xec3a('0x73')]({'TranscriptionJobName':_0x523538,'LanguageCode':_0x3789d4,'Media':{'MediaFileUri':_0x1fa913}},function(_0x328a74,_0x94fd59){if(_0x328a74){return _0x21c437(_0x328a74);}else{return _0x17cda5(_0x94fd59);}});});}function transcribe(_0x38594f,_0x142509,_0x140f7c,_0x593870,_0x525f1a,_0x299967,_0x456bda){return new Promise(function(_0x18475f,_0x2415f6){var _0x4f6e69={};logger['info'](util[_0xec3a('0x31')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x38594f,_0x525f1a));return uploadFile(_0x142509,_0x140f7c,_0x593870,_0x525f1a,path[_0xec3a('0x74')](_0x299967),fs[_0xec3a('0x75')](_0x299967))[_0xec3a('0x26')](function(_0x355c3e){logger[_0xec3a('0x69')](util[_0xec3a('0x31')](_0xec3a('0x76'),_0x38594f,_0x525f1a,_0x355c3e[_0xec3a('0x77')]));_0x4f6e69[_0xec3a('0x78')]=_0x355c3e['Bucket'];_0x4f6e69['location']=_0x355c3e[_0xec3a('0x77')];logger['info'](util[_0xec3a('0x31')](_0xec3a('0x79'),_0x38594f));return startTranscribe(_0x142509,_0x140f7c,_0x593870,uuidv4(),_0x456bda,_0x355c3e[_0xec3a('0x77')]);})[_0xec3a('0x26')](function(_0x2965dd){logger['info'](util[_0xec3a('0x31')](_0xec3a('0x7a'),_0x38594f,_0x2965dd[_0xec3a('0x7b')]['TranscriptionJobName']));_0x4f6e69[_0xec3a('0x7c')]=_0x2965dd['TranscriptionJob'][_0xec3a('0x7d')];_0x4f6e69[_0xec3a('0x7e')]=_0x2965dd['TranscriptionJob'][_0xec3a('0x7f')];return _0x18475f(_0x4f6e69);})['catch'](function(_0x178af6){return _0x2415f6(_0x178af6);});});}exports[_0xec3a('0x80')]=function(_0x26c517,_0x23715d,_0x43f4f3){var _0x1637a6;var _0x4c7d0d;var _0x17484c;var _0x1eabcf=require(_0xec3a('0x50'));return db[_0xec3a('0x40')]['findOne']({'where':{'id':_0x26c517[_0xec3a('0x46')]['id']}})[_0xec3a('0x26')](function(_0x265641){if(_0x265641){var _0x2de732=util[_0xec3a('0x31')](_0xec3a('0x53'),_0x265641[_0xec3a('0x52')]);if(fs[_0xec3a('0x54')](_0x2de732)){cypher=!![];return _0x1eabcf[_0xec3a('0x55')](_0x2de732,_0x265641[_0xec3a('0x52')],config[_0xec3a('0x56')][_0xec3a('0x57')])['then'](function(){return _0x265641;});}return _0x265641;}})[_0xec3a('0x26')](function(_0x36c1e8){if(!_0x36c1e8){throw new db[(_0xec3a('0x58'))][(_0xec3a('0x59'))]('Voice\x20Recording\x20not\x20found');}_0x4c7d0d=_0x36c1e8;return db[_0xec3a('0x81')][_0xec3a('0x82')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x23715d,null))['then'](function(_0xff555){if(_0xff555){_0x1637a6=_0xff555;if(!_0x1637a6[_0xec3a('0x83')]||!_0x1637a6[_0xec3a('0x84')]||!_0x1637a6['transcribeRegion']||!_0x1637a6[_0xec3a('0x85')]||!_0x1637a6[_0xec3a('0x78')]){throw new db['Sequelize'][(_0xec3a('0x59'))](_0xec3a('0x86'));}if(_0x26c517['body']['runSentiment']&&(!_0x1637a6[_0xec3a('0x87')]||!_0x1637a6['sentimentAccountId']||!_0x1637a6['sentimentRegion']||!_0x1637a6['language']||!_0x1637a6['bucket'])){throw new db[(_0xec3a('0x58'))][(_0xec3a('0x59'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xec3a('0x88')][_0xec3a('0x82')]({'where':{'id':_0x1637a6['transcribeAccountId']}});}})['then'](function(_0x85d807){if(!_0x85d807){throw new db[(_0xec3a('0x58'))][(_0xec3a('0x59'))](_0xec3a('0x89'));}if(!_0x85d807[_0xec3a('0x8a')]||!_0x85d807['data2']){throw new db[(_0xec3a('0x58'))][(_0xec3a('0x59'))](_0xec3a('0x8b'));}_0x17484c=_0x85d807;return getBucketslist(_0x17484c['data1'],_0x17484c[_0xec3a('0x8c')],_0x1637a6[_0xec3a('0x8d')]);})[_0xec3a('0x26')](function(_0x369288){if(_0x369288&&_0x369288['Buckets']){var _0x55430b=_['find'](_0x369288[_0xec3a('0x8e')],function(_0x369334){return _0x369334[_0xec3a('0x8f')]===_0x1637a6[_0xec3a('0x78')];});if(!_0x55430b){logger['info'](util[_0xec3a('0x31')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x26c517[_0xec3a('0x46')]['id'],_0x1637a6[_0xec3a('0x78')]));return createBucket(_0x17484c[_0xec3a('0x8a')],_0x17484c[_0xec3a('0x8c')],_0x1637a6[_0xec3a('0x8d')],_0x1637a6[_0xec3a('0x78')]);}logger[_0xec3a('0x69')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x26c517['params']['id'],_0x1637a6['bucket']));return;}})[_0xec3a('0x26')](function(_0x51cdd0){if(_0x4c7d0d[_0xec3a('0x7e')]===_0xec3a('0x90')){return transcribe(_0x26c517[_0xec3a('0x46')]['id'],_0x17484c[_0xec3a('0x8a')],_0x17484c['data2'],_0x1637a6[_0xec3a('0x8d')],_0x1637a6[_0xec3a('0x78')],_0x4c7d0d['value'],_0x1637a6[_0xec3a('0x85')]);}else{logger[_0xec3a('0x69')](util['format'](_0xec3a('0x91'),_0x26c517[_0xec3a('0x46')]['id']));return{'transcribeStatus':_0xec3a('0x92')};}})[_0xec3a('0x26')](function(_0x57e1d1){if(_0x57e1d1){_0x57e1d1[_0xec3a('0x93')]=_0x26c517[_0xec3a('0x4d')][_0xec3a('0x94')];return _0x4c7d0d[_0xec3a('0x95')](_0x57e1d1);}})[_0xec3a('0x26')](respondWithResult(_0x23715d,null))['catch'](handleError(_0x23715d,null));};function writeFile(_0x5ca299,_0x182b33){return new Promise(function(_0x254d47,_0x1d0d57){fs[_0xec3a('0x96')](_0x182b33,_0x5ca299,function(_0x320b4c,_0x32c7df){if(_0x320b4c){return _0x1d0d57(_0x320b4c);}else{return _0x254d47(_0x32c7df);}});});}exports[_0xec3a('0x97')]=function(_0x4a555f,_0x1ed457,_0x476af6){return db[_0xec3a('0x40')][_0xec3a('0x82')]({'where':{'id':_0x4a555f['params']['id']}})[_0xec3a('0x26')](handleEntityNotFound(_0x1ed457))[_0xec3a('0x26')](function(_0x12b0e4){if(_0x12b0e4&&_0x12b0e4['fileText']){var _0xee0248=_0x12b0e4[_0xec3a('0x98')];var _0x28746c=config[_0xec3a('0x99')]+'/server/files/transcribes/transcribe_'+_0x12b0e4['id']+_0xec3a('0x9a');if(fs[_0xec3a('0x54')](_0x28746c)){return _0x28746c;}return writeFile(_0xee0248,_0x28746c)[_0xec3a('0x26')](function(){return _0x28746c;});}else{throw new db[(_0xec3a('0x58'))]['ValidationError']('Transcript\x20not\x20available');}})['then'](function(_0x2abaea){return _0x1ed457[_0xec3a('0x4f')](_0x2abaea);})[_0xec3a('0x44')](handleError(_0x1ed457));}; \ No newline at end of file +var _0xf010=['Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','catch','show','params','create','body','find','describe','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','%s.cypher','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','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','transcribeRegion','runSentiment','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','downloadTranscribe','fileText','root'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf010,0x96));var _0x0f01=function(_0x2bd380,_0xbda074){_0x2bd380=_0x2bd380-0x0;var _0x8716fc=_0xf010[_0x2bd380];return _0x8716fc;};'use strict';var emlformat=require(_0x0f01('0x0'));var rimraf=require(_0x0f01('0x1'));var zipdir=require(_0x0f01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f01('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0f01('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0f01('0x5'));var ejs=require(_0x0f01('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f01('0x7'));var squel=require(_0x0f01('0x8'));var crypto=require(_0x0f01('0x9'));var jsforce=require(_0x0f01('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0f01('0x5'));var querystring=require('querystring');var Papa=require(_0x0f01('0xb'));var AWS=require(_0x0f01('0xc'));var uuidv4=require(_0x0f01('0xd'));var Redis=require('ioredis');var authService=require(_0x0f01('0xe'));var qs=require(_0x0f01('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f01('0x10'))('api');var utils=require(_0x0f01('0x11'));var config=require(_0x0f01('0x12'));var licenseUtil=require(_0x0f01('0x13'));var db=require(_0x0f01('0x14'))['db'];function respondWithStatusCode(_0x36f1e6,_0x3ea7a9){_0x3ea7a9=_0x3ea7a9||0xcc;return function(_0x260584){if(_0x260584){return _0x36f1e6[_0x0f01('0x15')](_0x3ea7a9);}return _0x36f1e6[_0x0f01('0x16')](_0x3ea7a9)[_0x0f01('0x17')]();};}function respondWithResult(_0x106d50,_0x32439b){_0x32439b=_0x32439b||0xc8;return function(_0x208862){if(_0x208862){return _0x106d50[_0x0f01('0x16')](_0x32439b)[_0x0f01('0x18')](_0x208862);}};}function respondWithFilteredResult(_0x40256f,_0x2f6813){return function(_0x2bcc3a){if(_0x2bcc3a){var _0x551dcd=typeof _0x2f6813[_0x0f01('0x19')]===_0x0f01('0x1a')&&typeof _0x2f6813[_0x0f01('0x1b')]==='undefined';var _0x2821d8=_0x2bcc3a['count'];var _0x2793e5=_0x551dcd?0x0:_0x2f6813['offset'];var _0x23ab01=_0x551dcd?_0x2bcc3a[_0x0f01('0x1c')]:_0x2f6813['offset']+_0x2f6813[_0x0f01('0x1b')];var _0x254288;if(_0x23ab01>=_0x2821d8){_0x23ab01=_0x2821d8;_0x254288=0xc8;}else{_0x254288=0xce;}_0x40256f[_0x0f01('0x16')](_0x254288);return _0x40256f[_0x0f01('0x1d')](_0x0f01('0x1e'),_0x2793e5+'-'+_0x23ab01+'/'+_0x2821d8)[_0x0f01('0x18')](_0x2bcc3a);}return null;};}function patchUpdates(_0x26ff78){return function(_0x50e053){try{jsonpatch['apply'](_0x50e053,_0x26ff78,!![]);}catch(_0x581a7d){return BPromise[_0x0f01('0x1f')](_0x581a7d);}return _0x50e053['save']();};}function saveUpdates(_0x32a1b7,_0x501159){return function(_0x51e46c){if(_0x51e46c){return _0x51e46c[_0x0f01('0x20')](_0x32a1b7)['then'](function(_0x57ae86){return _0x57ae86;});}return null;};}function removeEntity(_0x467c94,_0x3acd78){return function(_0x36cd0f){if(_0x36cd0f){return _0x36cd0f[_0x0f01('0x21')]()[_0x0f01('0x22')](function(){_0x467c94[_0x0f01('0x16')](0xcc)[_0x0f01('0x17')]();});}};}function handleEntityNotFound(_0x860c76,_0x2618ed){return function(_0x492a87){if(!_0x492a87){_0x860c76[_0x0f01('0x15')](0x194);}return _0x492a87;};}function handleError(_0x2f95ac,_0x32001e){_0x32001e=_0x32001e||0x1f4;return function(_0x39e964){logger[_0x0f01('0x23')](_0x39e964['stack']);if(_0x39e964[_0x0f01('0x24')]){delete _0x39e964['name'];}_0x2f95ac['status'](_0x32001e)[_0x0f01('0x25')](_0x39e964);};}exports[_0x0f01('0x26')]=function(_0x1f451d,_0x8e762a){var _0x493938={},_0x386d5c={},_0x3754a0={'count':0x0,'rows':[]};var _0xa5bd4e=_['map'](db[_0x0f01('0x27')][_0x0f01('0x28')],function(_0x4b7b18){return{'name':_0x4b7b18[_0x0f01('0x29')],'type':_0x4b7b18[_0x0f01('0x2a')][_0x0f01('0x2b')]};});_0x386d5c[_0x0f01('0x2c')]=_[_0x0f01('0x2d')](_['map'](_0xa5bd4e,_0x0f01('0x24')),[_0x0f01('0x2e')]);_0x386d5c[_0x0f01('0x2f')]=_[_0x0f01('0x30')](_0x1f451d[_0x0f01('0x2f')]);_0x386d5c['filters']=_[_0x0f01('0x31')](_0x386d5c['model'],_0x386d5c[_0x0f01('0x2f')]);_0x493938[_0x0f01('0x32')]=_[_0x0f01('0x31')](_0x386d5c[_0x0f01('0x2c')],qs[_0x0f01('0x33')](_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x33')]));_0x493938['attributes']=_0x493938[_0x0f01('0x32')][_0x0f01('0x34')]?_0x493938[_0x0f01('0x32')]:_0x386d5c['model'];if(!_0x1f451d['query']['hasOwnProperty']('nolimit')){_0x493938[_0x0f01('0x1b')]=qs[_0x0f01('0x1b')](_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x1b')]);_0x493938[_0x0f01('0x19')]=qs[_0x0f01('0x19')](_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x19')]);}_0x493938[_0x0f01('0x35')]=qs['sort'](_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x36')]);_0x493938[_0x0f01('0x37')]=qs[_0x0f01('0x38')](_['pick'](_0x1f451d[_0x0f01('0x2f')],_0x386d5c[_0x0f01('0x38')]),_0xa5bd4e);if(_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x39')]){_0x493938[_0x0f01('0x37')]=_[_0x0f01('0x3a')](_0x493938['where'],{'$or':_[_0x0f01('0x3b')](_0xa5bd4e,function(_0x2ace8a){if(_0x2ace8a['type']!==_0x0f01('0x3c')){var _0x66a7ab={};_0x66a7ab[_0x2ace8a[_0x0f01('0x24')]]={'$like':'%'+_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x39')]+'%'};return _0x66a7ab;}})});}_0x493938=_['merge']({},_0x493938,_0x1f451d[_0x0f01('0x3d')]);var _0x4cd91b={'where':_0x493938[_0x0f01('0x37')]};return db[_0x0f01('0x27')]['count'](_0x4cd91b)['then'](function(_0x492358){_0x3754a0[_0x0f01('0x1c')]=_0x492358;if(_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x3e')]){_0x493938[_0x0f01('0x3f')]=[{'all':!![]}];}return db[_0x0f01('0x27')]['findAll'](_0x493938);})[_0x0f01('0x22')](function(_0x822545){_0x3754a0['rows']=_0x822545;return _0x3754a0;})[_0x0f01('0x22')](respondWithFilteredResult(_0x8e762a,_0x493938))[_0x0f01('0x40')](handleError(_0x8e762a,null));};exports[_0x0f01('0x41')]=function(_0xa64819,_0x56b9c6){var _0x1f902c={'raw':![],'where':{'id':_0xa64819[_0x0f01('0x42')]['id']}},_0x596476={};_0x596476[_0x0f01('0x2c')]=_[_0x0f01('0x30')](db[_0x0f01('0x27')][_0x0f01('0x28')]);_0x596476['query']=_[_0x0f01('0x30')](_0xa64819[_0x0f01('0x2f')]);_0x596476[_0x0f01('0x38')]=_['intersection'](_0x596476['model'],_0x596476['query']);_0x1f902c[_0x0f01('0x32')]=_[_0x0f01('0x31')](_0x596476[_0x0f01('0x2c')],qs[_0x0f01('0x33')](_0xa64819[_0x0f01('0x2f')][_0x0f01('0x33')]));_0x1f902c[_0x0f01('0x32')]=_0x1f902c[_0x0f01('0x32')]['length']?_0x1f902c[_0x0f01('0x32')]:_0x596476[_0x0f01('0x2c')];if(_0xa64819[_0x0f01('0x2f')][_0x0f01('0x3e')]){_0x1f902c[_0x0f01('0x3f')]=[{'all':!![]}];}_0x1f902c=_[_0x0f01('0x3a')]({},_0x1f902c,_0xa64819['options']);return db[_0x0f01('0x27')]['find'](_0x1f902c)[_0x0f01('0x22')](handleEntityNotFound(_0x56b9c6,null))[_0x0f01('0x22')](respondWithResult(_0x56b9c6,null))['catch'](handleError(_0x56b9c6,null));};exports[_0x0f01('0x43')]=function(_0x28a16e,_0x5a3ac8){return db[_0x0f01('0x27')][_0x0f01('0x43')](_0x28a16e[_0x0f01('0x44')],{})[_0x0f01('0x22')](respondWithResult(_0x5a3ac8,0xc9))[_0x0f01('0x40')](handleError(_0x5a3ac8,null));};exports[_0x0f01('0x20')]=function(_0x4e2db6,_0x33cbb6){if(_0x4e2db6[_0x0f01('0x44')]['id']){delete _0x4e2db6['body']['id'];}return db[_0x0f01('0x27')][_0x0f01('0x45')]({'where':{'id':_0x4e2db6[_0x0f01('0x42')]['id']}})['then'](handleEntityNotFound(_0x33cbb6,null))['then'](saveUpdates(_0x4e2db6['body'],null))[_0x0f01('0x22')](respondWithResult(_0x33cbb6,null))[_0x0f01('0x40')](handleError(_0x33cbb6,null));};exports[_0x0f01('0x46')]=function(_0x1784a5,_0x39706f){return db[_0x0f01('0x27')][_0x0f01('0x46')]()[_0x0f01('0x22')](respondWithResult(_0x39706f,null))[_0x0f01('0x40')](handleError(_0x39706f,null));};exports['download']=function(_0x46322b,_0x4607cd,_0x36a6b6){var _0x6981b8=require(_0x0f01('0x47'));var _0x27a70c=![];var _0x5c4ba5={};if(_0x46322b['query'][_0x0f01('0x2a')]&&_0x46322b['query'][_0x0f01('0x2a')]===_0x0f01('0x48')){_0x5c4ba5[_0x0f01('0x48')]=_0x46322b[_0x0f01('0x42')]['id'];}else{_0x5c4ba5['id']=_0x46322b[_0x0f01('0x42')]['id'];}return db['VoiceRecording'][_0x0f01('0x45')]({'where':_0x5c4ba5,'attributes':['id',_0x0f01('0x49')],'raw':!![]})[_0x0f01('0x22')](handleEntityNotFound(_0x4607cd,null))[_0x0f01('0x22')](function(_0x2a4ee4){if(_0x2a4ee4){var _0x4a6dd0=_0x2a4ee4[_0x0f01('0x49')];var _0x8f7a43=util[_0x0f01('0x2e')]('%s.cypher',_0x4a6dd0);if(fs[_0x0f01('0x4a')](_0x8f7a43)){_0x27a70c=!![];return _0x6981b8[_0x0f01('0x4b')](_0x8f7a43,_0x4a6dd0,config[_0x0f01('0x4c')][_0x0f01('0x4d')])['then'](function(){return _0x2a4ee4;});}return _0x2a4ee4;}})[_0x0f01('0x22')](function(_0x1ba005){if(_0x1ba005){var _0xb9bedd=_0x1ba005[_0x0f01('0x49')];if(!fs[_0x0f01('0x4a')](_0xb9bedd)){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x50'));}if(_0x1ba005[_0x0f01('0x51')]){return _0x4607cd[_0x0f01('0x52')](_0xb9bedd,_0x1ba005[_0x0f01('0x51')]+path[_0x0f01('0x53')](_0xb9bedd),function(){if(_0x27a70c){fs[_0x0f01('0x54')](_0xb9bedd);}});}else{return _0x4607cd[_0x0f01('0x52')](_0xb9bedd,function(_0x5b2585){if(_0x27a70c){fs['unlink'](_0xb9bedd);}});}}})[_0x0f01('0x40')](function(_0x4d57d6){if(_0x4d57d6[_0x0f01('0x55')]==='VoiceRecording\x20not\x20found'){_0x4607cd[_0x0f01('0x16')](0x194)[_0x0f01('0x25')](_0x0f01('0x56'));}else{return handleError(_0x4607cd,null);}});};exports[_0x0f01('0x57')]=function(_0x4cee0b,_0xcab2e3,_0x174df2){var _0x35cd2b=require('../../components/encryptor');var _0x10a1e1=![];var _0x94ff99={'$and':[db[_0x0f01('0x58')]['where'](db[_0x0f01('0x58')]['fn'](_0x0f01('0x59'),db[_0x0f01('0x58')][_0x0f01('0x5a')](_0x0f01('0x48'))),_0x4cee0b[_0x0f01('0x2f')]['token'])]};if(_0x4cee0b[_0x0f01('0x2f')][_0x0f01('0x2a')]&&_0x4cee0b['query']['type']===_0x0f01('0x48')){_0x94ff99[_0x0f01('0x5b')][_0x0f01('0x5c')]({'uniqueid':_0x4cee0b[_0x0f01('0x42')]['id']});}else{_0x94ff99[_0x0f01('0x5b')][_0x0f01('0x5c')]({'id':_0x4cee0b[_0x0f01('0x42')]['id']});}return db[_0x0f01('0x27')][_0x0f01('0x45')]({'where':_0x94ff99,'attributes':['id',_0x0f01('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0xcab2e3,null))[_0x0f01('0x22')](function(_0x3bb3e7){if(_0x3bb3e7){var _0x8f1f61=util[_0x0f01('0x2e')](_0x0f01('0x5d'),_0x3bb3e7['value']);if(fs[_0x0f01('0x4a')](_0x8f1f61)){_0x10a1e1=!![];return _0x35cd2b[_0x0f01('0x4b')](_0x8f1f61,_0x3bb3e7[_0x0f01('0x49')],config[_0x0f01('0x4c')][_0x0f01('0x4d')])[_0x0f01('0x22')](function(){return _0x3bb3e7;});}return _0x3bb3e7;}})[_0x0f01('0x22')](function(_0x2e7841){if(_0x2e7841){if(!fs['existsSync'](_0x2e7841['value'])){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))]('VoiceRecording\x20not\x20found');}if(_0x2e7841[_0x0f01('0x51')]){return _0xcab2e3[_0x0f01('0x52')](_0x2e7841[_0x0f01('0x49')],_0x2e7841[_0x0f01('0x51')]+path[_0x0f01('0x53')](_0x2e7841[_0x0f01('0x49')]),function(){if(_0x10a1e1){fs[_0x0f01('0x54')](_0x2e7841[_0x0f01('0x49')]);}});}else{return _0xcab2e3[_0x0f01('0x52')](_0x2e7841[_0x0f01('0x49')],function(_0x1dee09){if(_0x10a1e1){fs[_0x0f01('0x54')](_0x2e7841['value']);}});}}})[_0x0f01('0x40')](handleError(_0xcab2e3,null));};exports['destroy']=function(_0x30a0de,_0x5cd958){return db[_0x0f01('0x27')][_0x0f01('0x45')]({'where':{'id':_0x30a0de[_0x0f01('0x42')]['id']}})[_0x0f01('0x22')](function(_0x619b43){if(_[_0x0f01('0x5e')](_0x619b43)){throw new ReferenceError(_0x0f01('0x5f'));}return _0x619b43;})[_0x0f01('0x22')](function(_0x4561fb){var _0x8c682e=_0x4561fb[_0x0f01('0x49')];logger[_0x0f01('0x60')](_0x0f01('0x61'),_0x8c682e);if(!_['isNil'](_0x4561fb[_0x0f01('0x49')])&&fs[_0x0f01('0x4a')](_0x8c682e)){logger[_0x0f01('0x60')](_0x0f01('0x62')+_0x8c682e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0f01('0x63')](_0x8c682e);}_0x8c682e=_0x8c682e+_0x0f01('0x64');if(!_[_0x0f01('0x5e')](_0x4561fb[_0x0f01('0x49')])&&fs[_0x0f01('0x4a')](_0x8c682e)){logger[_0x0f01('0x60')](_0x0f01('0x62')+_0x8c682e+_0x0f01('0x65'));fs['unlinkSync'](_0x8c682e);}return _0x4561fb;})[_0x0f01('0x22')](function(_0x252094){if(!_0x252094)throw new InternalError();return _0x252094['destroy']();})[_0x0f01('0x22')](function(){_0x5cd958[_0x0f01('0x16')](0xcc)[_0x0f01('0x17')]();})[_0x0f01('0x40')](handleError(_0x5cd958,null));};function getBucketslist(_0x39e0ab,_0x402a49,_0x4f340e){return new Promise(function(_0x2c21b7,_0x346e05){var _0x52e5b2=new AWS['S3']({'accessKeyId':_0x402a49,'secretAccessKey':_0x39e0ab,'region':_0x4f340e});_0x52e5b2[_0x0f01('0x66')]({},function(_0xfd2d3e,_0x23f23a){if(_0xfd2d3e){return _0x346e05(_0xfd2d3e);}else{return _0x2c21b7(_0x23f23a);}});});}function createBucket(_0x1f577b,_0x452501,_0x2ab2bf,_0x31c20d){return new Promise(function(_0x22097e,_0x4c7903){var _0x5c0e85=new AWS['S3']({'accessKeyId':_0x452501,'secretAccessKey':_0x1f577b,'region':_0x2ab2bf});_0x5c0e85[_0x0f01('0x67')]({'Bucket':_0x31c20d},function(_0x51cd35,_0x237aad){if(_0x51cd35){return _0x4c7903(_0x51cd35);}else{return _0x22097e(_0x237aad);}});});}function uploadFile(_0x5daed8,_0x50db66,_0x478645,_0x223836,_0x340145,_0x379642){return new Promise(function(_0x1cfef0,_0x2d7abc){var _0x125fb5=new AWS['S3']({'accessKeyId':_0x50db66,'secretAccessKey':_0x5daed8,'region':_0x478645});_0x125fb5[_0x0f01('0x68')]({'Bucket':_0x223836,'Key':_0x340145,'Body':_0x379642},function(_0x2c992f,_0x1d34b3){if(_0x2c992f){return _0x2d7abc(_0x2c992f);}else{return _0x1cfef0(_0x1d34b3);}});});}function startTranscribe(_0x560d24,_0x2ee5f2,_0x262f44,_0x342418,_0x3c6cd5,_0x3fc543){return new Promise(function(_0x1a05ed,_0x25f05b){var _0x50caf5=new AWS[(_0x0f01('0x69'))]({'accessKeyId':_0x2ee5f2,'secretAccessKey':_0x560d24,'region':_0x262f44});_0x50caf5[_0x0f01('0x6a')]({'TranscriptionJobName':_0x342418,'LanguageCode':_0x3c6cd5,'Media':{'MediaFileUri':_0x3fc543}},function(_0x598900,_0x3fef69){if(_0x598900){return _0x25f05b(_0x598900);}else{return _0x1a05ed(_0x3fef69);}});});}function transcribe(_0x5d7937,_0x1fab71,_0x1f97fc,_0x2c9a43,_0x2c6866,_0x2e5c3d,_0x4ab035){return new Promise(function(_0x2b0f40,_0x1a50d4){var _0x1733e2={};logger[_0x0f01('0x60')](util[_0x0f01('0x2e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x5d7937,_0x2c6866));return uploadFile(_0x1fab71,_0x1f97fc,_0x2c9a43,_0x2c6866,path[_0x0f01('0x6b')](_0x2e5c3d),fs[_0x0f01('0x6c')](_0x2e5c3d))['then'](function(_0x2d8df3){logger[_0x0f01('0x60')](util[_0x0f01('0x2e')](_0x0f01('0x6d'),_0x5d7937,_0x2c6866,_0x2d8df3[_0x0f01('0x6e')]));_0x1733e2['bucket']=_0x2d8df3[_0x0f01('0x6f')];_0x1733e2[_0x0f01('0x70')]=_0x2d8df3['Location'];logger[_0x0f01('0x60')](util[_0x0f01('0x2e')](_0x0f01('0x71'),_0x5d7937));return startTranscribe(_0x1fab71,_0x1f97fc,_0x2c9a43,uuidv4(),_0x4ab035,_0x2d8df3[_0x0f01('0x6e')]);})[_0x0f01('0x22')](function(_0x4ec10c){logger['info'](util[_0x0f01('0x2e')](_0x0f01('0x72'),_0x5d7937,_0x4ec10c[_0x0f01('0x73')][_0x0f01('0x74')]));_0x1733e2[_0x0f01('0x75')]=_0x4ec10c[_0x0f01('0x73')][_0x0f01('0x74')];_0x1733e2[_0x0f01('0x76')]=_0x4ec10c[_0x0f01('0x73')][_0x0f01('0x77')];return _0x2b0f40(_0x1733e2);})[_0x0f01('0x40')](function(_0x3515a8){return _0x1a50d4(_0x3515a8);});});}exports[_0x0f01('0x78')]=function(_0x26164a,_0x293f47,_0x15b91e){var _0x476710;var _0x1b4e29;var _0xf244ea;var _0x527455=require(_0x0f01('0x47'));return db[_0x0f01('0x27')][_0x0f01('0x79')]({'where':{'id':_0x26164a[_0x0f01('0x42')]['id']}})[_0x0f01('0x22')](function(_0x2eaf6b){if(_0x2eaf6b){var _0x94e132=util[_0x0f01('0x2e')](_0x0f01('0x5d'),_0x2eaf6b['value']);if(fs[_0x0f01('0x4a')](_0x94e132)){cypher=!![];return _0x527455[_0x0f01('0x4b')](_0x94e132,_0x2eaf6b[_0x0f01('0x49')],config[_0x0f01('0x4c')][_0x0f01('0x4d')])[_0x0f01('0x22')](function(){return _0x2eaf6b;});}return _0x2eaf6b;}})[_0x0f01('0x22')](function(_0x111d09){if(!_0x111d09){throw new db['Sequelize'][(_0x0f01('0x4f'))](_0x0f01('0x7a'));}_0x1b4e29=_0x111d09;return db[_0x0f01('0x7b')][_0x0f01('0x79')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x293f47,null))[_0x0f01('0x22')](function(_0x168be5){if(_0x168be5){_0x476710=_0x168be5;if(!_0x476710[_0x0f01('0x7c')]||!_0x476710['transcribeAccountId']||!_0x476710[_0x0f01('0x7d')]||!_0x476710['language']||!_0x476710['bucket']){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))]('Transcribe\x20not\x20configured');}if(_0x26164a[_0x0f01('0x44')][_0x0f01('0x7e')]&&(!_0x476710[_0x0f01('0x7f')]||!_0x476710[_0x0f01('0x80')]||!_0x476710['sentimentRegion']||!_0x476710[_0x0f01('0x81')]||!_0x476710[_0x0f01('0x82')])){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x83'));}return db[_0x0f01('0x84')][_0x0f01('0x79')]({'where':{'id':_0x476710[_0x0f01('0x85')]}});}})[_0x0f01('0x22')](function(_0x63be9){if(!_0x63be9){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x86'));}if(!_0x63be9[_0x0f01('0x87')]||!_0x63be9[_0x0f01('0x88')]){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x89'));}_0xf244ea=_0x63be9;return getBucketslist(_0xf244ea[_0x0f01('0x87')],_0xf244ea[_0x0f01('0x88')],_0x476710[_0x0f01('0x7d')]);})[_0x0f01('0x22')](function(_0x719587){if(_0x719587&&_0x719587['Buckets']){var _0x6add66=_[_0x0f01('0x45')](_0x719587[_0x0f01('0x8a')],function(_0xdb5d1e){return _0xdb5d1e['Name']===_0x476710[_0x0f01('0x82')];});if(!_0x6add66){logger[_0x0f01('0x60')](util[_0x0f01('0x2e')](_0x0f01('0x8b'),_0x26164a[_0x0f01('0x42')]['id'],_0x476710[_0x0f01('0x82')]));return createBucket(_0xf244ea[_0x0f01('0x87')],_0xf244ea[_0x0f01('0x88')],_0x476710[_0x0f01('0x7d')],_0x476710[_0x0f01('0x82')]);}logger['info'](util[_0x0f01('0x2e')](_0x0f01('0x8c'),_0x26164a[_0x0f01('0x42')]['id'],_0x476710['bucket']));return;}})[_0x0f01('0x22')](function(_0x3453f7){if(_0x1b4e29[_0x0f01('0x76')]===_0x0f01('0x8d')){return transcribe(_0x26164a[_0x0f01('0x42')]['id'],_0xf244ea[_0x0f01('0x87')],_0xf244ea[_0x0f01('0x88')],_0x476710[_0x0f01('0x7d')],_0x476710[_0x0f01('0x82')],_0x1b4e29[_0x0f01('0x49')],_0x476710['language']);}else{logger[_0x0f01('0x60')](util[_0x0f01('0x2e')](_0x0f01('0x8e'),_0x26164a['params']['id']));return{'transcribeStatus':_0x0f01('0x8f')};}})['then'](function(_0xef4f53){if(_0xef4f53){_0xef4f53[_0x0f01('0x90')]=_0x26164a[_0x0f01('0x44')]['runSentiment'];return _0x1b4e29['updateAttributes'](_0xef4f53);}})[_0x0f01('0x22')](respondWithResult(_0x293f47,null))[_0x0f01('0x40')](handleError(_0x293f47,null));};function writeFile(_0x51f31e,_0xa9e832){return new Promise(function(_0x10fb7a,_0xaa04a1){fs['writeFile'](_0xa9e832,_0x51f31e,function(_0x2192d6,_0x7f83b0){if(_0x2192d6){return _0xaa04a1(_0x2192d6);}else{return _0x10fb7a(_0x7f83b0);}});});}exports[_0x0f01('0x91')]=function(_0x36149d,_0x36cbc1,_0x5f00ac){return db[_0x0f01('0x27')][_0x0f01('0x79')]({'where':{'id':_0x36149d['params']['id']}})['then'](handleEntityNotFound(_0x36cbc1))['then'](function(_0x2b2d58){if(_0x2b2d58&&_0x2b2d58[_0x0f01('0x92')]){var _0x450d77=_0x2b2d58['fileText'];var _0x1dd897=config[_0x0f01('0x93')]+'/server/files/transcribes/transcribe_'+_0x2b2d58['id']+'.txt';if(fs[_0x0f01('0x4a')](_0x1dd897)){return _0x1dd897;}return writeFile(_0x450d77,_0x1dd897)[_0x0f01('0x22')](function(){return _0x1dd897;});}else{throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x94'));}})[_0x0f01('0x22')](function(_0x49e163){return _0x36cbc1[_0x0f01('0x52')](_0x49e163);})[_0x0f01('0x40')](handleError(_0x36cbc1));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 39fc0d7..0868e5d 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 _0x245b=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','uniqueid'];(function(_0x1541c6,_0x170408){var _0x41901b=function(_0x517db0){while(--_0x517db0){_0x1541c6['push'](_0x1541c6['shift']());}};_0x41901b(++_0x170408);}(_0x245b,0xa8));var _0xb245=function(_0x1f2fc5,_0x201ba2){_0x1f2fc5=_0x1f2fc5-0x0;var _0x1bd0ea=_0x245b[_0x1f2fc5];return _0x1bd0ea;};'use strict';var _=require(_0xb245('0x0'));var util=require(_0xb245('0x1'));var logger=require('../../config/logger')(_0xb245('0x2'));var moment=require(_0xb245('0x3'));var BPromise=require(_0xb245('0x4'));var rp=require(_0xb245('0x5'));var fs=require('fs');var path=require(_0xb245('0x6'));var rimraf=require('rimraf');var config=require(_0xb245('0x7'));var attributes=require(_0xb245('0x8'));module['exports']=function(_0x3ab098,_0x3817ec){return _0x3ab098[_0xb245('0x9')](_0xb245('0xa'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xb245('0xb'),'fields':[_0xb245('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4429=['define','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x45a909,_0x4a2484){var _0xc24293=function(_0x4ca294){while(--_0x4ca294){_0x45a909['push'](_0x45a909['shift']());}};_0xc24293(++_0x4a2484);}(_0x4429,0x1ce));var _0x9442=function(_0x481e80,_0x58f101){_0x481e80=_0x481e80-0x0;var _0x3e0008=_0x4429[_0x481e80];return _0x3e0008;};'use strict';var _=require('lodash');var util=require(_0x9442('0x0'));var logger=require(_0x9442('0x1'))(_0x9442('0x2'));var moment=require(_0x9442('0x3'));var BPromise=require('bluebird');var rp=require(_0x9442('0x4'));var fs=require('fs');var path=require(_0x9442('0x5'));var rimraf=require(_0x9442('0x6'));var config=require(_0x9442('0x7'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x4bee35,_0x1a5aa7){return _0x4bee35[_0x9442('0x8')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x9442('0x9'),'fields':[_0x9442('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 8f33157..29ed620 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 _0x8ace=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','body','callRecordingEncryption','value','format','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x4d3d50,_0x50f156){_0x4d3d50=_0x4d3d50-0x0;var _0x175e6d=_0x8ace[_0x4d3d50];return _0x175e6d;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});}exports[_0xe8ac('0x19')]=function(_0x36759c){var _0x4892d0=this;return new Promise(function(_0x59df3d,_0x5f3433){return db[_0xe8ac('0x1a')][_0xe8ac('0x1b')](_0x36759c['body'],{'raw':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1e')]||null:null,'attributes':_0x36759c[_0xe8ac('0x1c')]?_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1f')]||null:null,'limit':_0x36759c['options']?_0x36759c[_0xe8ac('0x1c')]['limit']||null:null})[_0xe8ac('0x20')](function(_0x3933d2){logger[_0xe8ac('0xf')](_0xe8ac('0x19'),_0x36759c);logger[_0xe8ac('0x12')](_0xe8ac('0x19'),_0x36759c,JSON[_0xe8ac('0x14')](_0x3933d2));_0x59df3d(_0x3933d2);})['catch'](function(_0x1c3ea4){logger[_0xe8ac('0x15')](_0xe8ac('0x19'),_0x1c3ea4[_0xe8ac('0x16')],_0x36759c);_0x5f3433(_0x4892d0[_0xe8ac('0x15')](0x1f4,_0x1c3ea4[_0xe8ac('0x16')]));});});};exports[_0xe8ac('0x21')]=function(_0x3e3fc2){var _0x44b07c=this;return new Promise(function(_0x562e44,_0x5a1b69){var _0x346dcb=require(_0xe8ac('0x22'));var _0x59512c;return db[_0xe8ac('0x23')][_0xe8ac('0x24')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1f1e44){_0x59512c=_0x1f1e44;return db[_0xe8ac('0x1a')][_0xe8ac('0x25')](_0x3e3fc2[_0xe8ac('0x26')]);})[_0xe8ac('0x20')](function(_0x41ffe8){if(_0x59512c[_0xe8ac('0x27')]&&fs['existsSync'](_0x41ffe8[_0xe8ac('0x28')])){var _0x5459e5=util[_0xe8ac('0x29')]('%s.cypher',_0x41ffe8['value']);return _0x346dcb['encryptFile'](_0x41ffe8['value'],_0x5459e5,config[_0xe8ac('0x2a')][_0xe8ac('0x2b')])[_0xe8ac('0x20')](function(){fs[_0xe8ac('0x2c')](_0x41ffe8[_0xe8ac('0x28')]);logger[_0xe8ac('0xf')](_0xe8ac('0x2d'));return _0x41ffe8;});}return _0x41ffe8;})['then'](function(_0x1cacb0){logger['info']('CreateVoiceRecording',_0x3e3fc2);logger['debug'](_0xe8ac('0x21'),_0x3e3fc2,JSON[_0xe8ac('0x14')](_0x1cacb0));_0x562e44(_0x1cacb0);})[_0xe8ac('0x18')](function(_0x56feff){logger['error'](_0xe8ac('0x21'),_0x56feff[_0xe8ac('0x16')],_0x3e3fc2);_0x5a1b69(_0x44b07c[_0xe8ac('0x15')](0x1f4,_0x56feff[_0xe8ac('0x16')]));});});}; \ No newline at end of file +var _0x9582=['UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','VoiceRecording','body','options','where','attributes','limit','then'];(function(_0xa1cd92,_0x46dce6){var _0x243732=function(_0x2af4ff){while(--_0x2af4ff){_0xa1cd92['push'](_0xa1cd92['shift']());}};_0x243732(++_0x46dce6);}(_0x9582,0x95));var _0x2958=function(_0x73199d,_0x3c5647){_0x73199d=_0x73199d-0x0;var _0x403f00=_0x9582[_0x73199d];return _0x403f00;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});}exports['UpdateVoiceRecording']=function(_0x28a92c){var _0x160949=this;return new Promise(function(_0x310d07,_0x42bb99){return db[_0x2958('0x18')]['update'](_0x28a92c[_0x2958('0x19')],{'raw':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a92c[_0x2958('0x1a')]?_0x28a92c['options'][_0x2958('0x1b')]||null:null,'attributes':_0x28a92c['options']?_0x28a92c['options'][_0x2958('0x1c')]||null:null,'limit':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')][_0x2958('0x1d')]||null:null})[_0x2958('0x1e')](function(_0x412e42){logger[_0x2958('0x16')](_0x2958('0x1f'),_0x28a92c);logger[_0x2958('0xf')](_0x2958('0x1f'),_0x28a92c,JSON[_0x2958('0x12')](_0x412e42));_0x310d07(_0x412e42);})[_0x2958('0x20')](function(_0x119242){logger[_0x2958('0x13')](_0x2958('0x1f'),_0x119242['message'],_0x28a92c);_0x42bb99(_0x160949['error'](0x1f4,_0x119242[_0x2958('0x15')]));});});};exports[_0x2958('0x21')]=function(_0x28c1f5){var _0x43cf73=this;return new Promise(function(_0x52bd32,_0x2bd1ac){var _0x57ae96=require(_0x2958('0x22'));var _0x40adce;return db[_0x2958('0x23')][_0x2958('0x24')]({'attributes':['id',_0x2958('0x25')],'where':{'id':0x1},'raw':!![]})[_0x2958('0x1e')](function(_0x153958){_0x40adce=_0x153958;return db['VoiceRecording'][_0x2958('0x26')](_0x28c1f5['body']);})['then'](function(_0x28ee09){if(_0x40adce[_0x2958('0x25')]&&fs[_0x2958('0x27')](_0x28ee09[_0x2958('0x28')])){var _0x584179=util[_0x2958('0x29')](_0x2958('0x2a'),_0x28ee09[_0x2958('0x28')]);return _0x57ae96['encryptFile'](_0x28ee09[_0x2958('0x28')],_0x584179,config[_0x2958('0x2b')]['recording'])[_0x2958('0x1e')](function(){fs['unlink'](_0x28ee09[_0x2958('0x28')]);logger['info'](_0x2958('0x2c'));return _0x28ee09;});}return _0x28ee09;})['then'](function(_0x4477b5){logger[_0x2958('0x16')](_0x2958('0x21'),_0x28c1f5);logger[_0x2958('0xf')](_0x2958('0x21'),_0x28c1f5,JSON[_0x2958('0x12')](_0x4477b5));_0x52bd32(_0x4477b5);})[_0x2958('0x20')](function(_0x58f9b4){logger[_0x2958('0x13')]('CreateVoiceRecording',_0x58f9b4[_0x2958('0x15')],_0x28c1f5);_0x2bd1ac(_0x43cf73['error'](0x1f4,_0x58f9b4[_0x2958('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 7030472..247c899 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 _0xaf4e=['/:id','show','create','put','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x383ec1,_0x2c9450){var _0x2ecb8d=function(_0x1f2eeb){while(--_0x1f2eeb){_0x383ec1['push'](_0x383ec1['shift']());}};_0x2ecb8d(++_0x2c9450);}(_0xaf4e,0xc5));var _0xeaf4=function(_0x4a687a,_0x4b7cdb){_0x4a687a=_0x4a687a-0x0;var _0xa54988=_0xaf4e[_0x4a687a];return _0xa54988;};'use strict';var multer=require(_0xeaf4('0x0'));var util=require('util');var path=require(_0xeaf4('0x1'));var timeout=require('connect-timeout');var express=require(_0xeaf4('0x2'));var router=express['Router']();var fs_extra=require(_0xeaf4('0x3'));var auth=require(_0xeaf4('0x4'));var interaction=require(_0xeaf4('0x5'));var config=require(_0xeaf4('0x6'));var controller=require(_0xeaf4('0x7'));router[_0xeaf4('0x8')]('/',auth[_0xeaf4('0x9')](),controller['index']);router[_0xeaf4('0x8')](_0xeaf4('0xa'),auth['isAuthenticated'](),controller[_0xeaf4('0xb')]);router[_0xeaf4('0x8')](_0xeaf4('0xc'),auth[_0xeaf4('0x9')](),controller[_0xeaf4('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xeaf4('0xe')]);router[_0xeaf4('0xf')](_0xeaf4('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xeaf4('0x10')](_0xeaf4('0xc'),auth[_0xeaf4('0x9')](),controller[_0xeaf4('0x11')]);module[_0xeaf4('0x12')]=router; \ No newline at end of file +var _0x7d68=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x25c9de,_0x5045e9){var _0x1f8845=function(_0x4cb8c7){while(--_0x4cb8c7){_0x25c9de['push'](_0x25c9de['shift']());}};_0x1f8845(++_0x5045e9);}(_0x7d68,0x171));var _0x87d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d68[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x87d6('0x0'));var util=require(_0x87d6('0x1'));var path=require(_0x87d6('0x2'));var timeout=require(_0x87d6('0x3'));var express=require('express');var router=express[_0x87d6('0x4')]();var fs_extra=require(_0x87d6('0x5'));var auth=require(_0x87d6('0x6'));var interaction=require(_0x87d6('0x7'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0x87d6('0x8')]('/',auth[_0x87d6('0x9')](),controller[_0x87d6('0xa')]);router[_0x87d6('0x8')](_0x87d6('0xb'),auth[_0x87d6('0x9')](),controller[_0x87d6('0xc')]);router[_0x87d6('0x8')](_0x87d6('0xd'),auth[_0x87d6('0x9')](),controller[_0x87d6('0xe')]);router[_0x87d6('0xf')]('/',auth[_0x87d6('0x9')](),controller[_0x87d6('0x10')]);router[_0x87d6('0x11')](_0x87d6('0xd'),auth[_0x87d6('0x9')](),controller[_0x87d6('0x12')]);router[_0x87d6('0x13')]('/:id',auth[_0x87d6('0x9')](),controller[_0x87d6('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 5202c75..2e6b1f5 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 _0x6f79=['moment','exports','ENUM','attended','STRING','Yes','sequelize'];(function(_0x38f39e,_0x3bc25a){var _0x257a59=function(_0x1f496c){while(--_0x1f496c){_0x38f39e['push'](_0x38f39e['shift']());}};_0x257a59(++_0x3bc25a);}(_0x6f79,0x148));var _0x96f7=function(_0x81c8cb,_0x25395a){_0x81c8cb=_0x81c8cb-0x0;var _0x230559=_0x6f79[_0x81c8cb];return _0x230559;};'use strict';var Sequelize=require(_0x96f7('0x0'));var moment=require(_0x96f7('0x1'));module[_0x96f7('0x2')]={'type':{'type':Sequelize[_0x96f7('0x3')]('blind',_0x96f7('0x4'))},'result':{'type':Sequelize[_0x96f7('0x5')]},'transfererchannel':{'type':Sequelize[_0x96f7('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x96f7('0x5')]},'transferercalleridname':{'type':Sequelize[_0x96f7('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x96f7('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x96f7('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x96f7('0x5')]},'transferercontext':{'type':Sequelize[_0x96f7('0x5')]},'transfererexten':{'type':Sequelize[_0x96f7('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x96f7('0x5')]},'transfereechannel':{'type':Sequelize[_0x96f7('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x96f7('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x96f7('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x96f7('0x5')]},'transfereecontext':{'type':Sequelize[_0x96f7('0x5')]},'transfereeexten':{'type':Sequelize[_0x96f7('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x96f7('0x5')]},'isexternal':{'type':Sequelize[_0x96f7('0x3')](_0x96f7('0x6'),'No')},'context':{'type':Sequelize[_0x96f7('0x5')]},'extension':{'type':Sequelize[_0x96f7('0x5')]}}; \ No newline at end of file +var _0x6b12=['STRING','Yes','sequelize','exports','ENUM','blind','attended'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b12,0x1ad));var _0x26b1=function(_0x40fd3f,_0x3f411d){_0x40fd3f=_0x40fd3f-0x0;var _0x3fef6f=_0x6b12[_0x40fd3f];return _0x3fef6f;};'use strict';var Sequelize=require(_0x26b1('0x0'));var moment=require('moment');module[_0x26b1('0x1')]={'type':{'type':Sequelize[_0x26b1('0x2')](_0x26b1('0x3'),_0x26b1('0x4'))},'result':{'type':Sequelize[_0x26b1('0x5')]},'transfererchannel':{'type':Sequelize[_0x26b1('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x26b1('0x5')]},'transferercalleridname':{'type':Sequelize[_0x26b1('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x26b1('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x26b1('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x26b1('0x5')]},'transfereechannel':{'type':Sequelize[_0x26b1('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x26b1('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x26b1('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x26b1('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x26b1('0x6'),'No')},'context':{'type':Sequelize[_0x26b1('0x5')]},'extension':{'type':Sequelize[_0x26b1('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 8bfee1f..e30a4c3 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 _0x7bbc=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','VoiceTransferReport','findAll','rows','catch','show','length','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x7bbc,0x85));var _0xc7bb=function(_0x5cec1a,_0x465521){_0x5cec1a=_0x5cec1a-0x0;var _0x59cadb=_0x7bbc[_0x5cec1a];return _0x59cadb;};'use strict';var emlformat=require(_0xc7bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc7bb('0x1'));var jsonpatch=require(_0xc7bb('0x2'));var rp=require(_0xc7bb('0x3'));var moment=require(_0xc7bb('0x4'));var BPromise=require(_0xc7bb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc7bb('0x6'));var csv=require(_0xc7bb('0x7'));var ejs=require(_0xc7bb('0x8'));var fs=require('fs');var fs_extra=require(_0xc7bb('0x9'));var _=require(_0xc7bb('0xa'));var squel=require(_0xc7bb('0xb'));var crypto=require(_0xc7bb('0xc'));var jsforce=require(_0xc7bb('0xd'));var deskjs=require(_0xc7bb('0xe'));var toCsv=require(_0xc7bb('0x7'));var querystring=require(_0xc7bb('0xf'));var Papa=require('papaparse');var Redis=require(_0xc7bb('0x10'));var authService=require(_0xc7bb('0x11'));var qs=require(_0xc7bb('0x12'));var as=require(_0xc7bb('0x13'));var hardwareService=require(_0xc7bb('0x14'));var logger=require(_0xc7bb('0x15'))(_0xc7bb('0x16'));var utils=require('../../config/utils');var config=require(_0xc7bb('0x17'));var licenseUtil=require(_0xc7bb('0x18'));var db=require(_0xc7bb('0x19'))['db'];function respondWithStatusCode(_0x1e5576,_0x2829c5){_0x2829c5=_0x2829c5||0xcc;return function(_0xc5cfec){if(_0xc5cfec){return _0x1e5576[_0xc7bb('0x1a')](_0x2829c5);}return _0x1e5576[_0xc7bb('0x1b')](_0x2829c5)[_0xc7bb('0x1c')]();};}function respondWithResult(_0x371624,_0x1f6d60){_0x1f6d60=_0x1f6d60||0xc8;return function(_0x5ee524){if(_0x5ee524){return _0x371624['status'](_0x1f6d60)[_0xc7bb('0x1d')](_0x5ee524);}};}function respondWithFilteredResult(_0x12d6d6,_0x5ab2c1){return function(_0x1cc876){if(_0x1cc876){var _0x3e36c0=typeof _0x5ab2c1[_0xc7bb('0x1e')]===_0xc7bb('0x1f')&&typeof _0x5ab2c1['limit']==='undefined';var _0x326dd9=_0x1cc876['count'];var _0x3b253a=_0x3e36c0?0x0:_0x5ab2c1[_0xc7bb('0x1e')];var _0x379df3=_0x3e36c0?_0x1cc876[_0xc7bb('0x20')]:_0x5ab2c1[_0xc7bb('0x1e')]+_0x5ab2c1[_0xc7bb('0x21')];var _0x2a2357;if(_0x379df3>=_0x326dd9){_0x379df3=_0x326dd9;_0x2a2357=0xc8;}else{_0x2a2357=0xce;}_0x12d6d6[_0xc7bb('0x1b')](_0x2a2357);return _0x12d6d6[_0xc7bb('0x22')](_0xc7bb('0x23'),_0x3b253a+'-'+_0x379df3+'/'+_0x326dd9)[_0xc7bb('0x1d')](_0x1cc876);}return null;};}function patchUpdates(_0x37bc81){return function(_0x2ca6d8){try{jsonpatch[_0xc7bb('0x24')](_0x2ca6d8,_0x37bc81,!![]);}catch(_0x2d2ff4){return BPromise[_0xc7bb('0x25')](_0x2d2ff4);}return _0x2ca6d8[_0xc7bb('0x26')]();};}function saveUpdates(_0x5cebe0,_0x42860c){return function(_0x502554){if(_0x502554){return _0x502554[_0xc7bb('0x27')](_0x5cebe0)[_0xc7bb('0x28')](function(_0x107ce2){return _0x107ce2;});}return null;};}function removeEntity(_0xdcdb59,_0x5a3338){return function(_0x35b4c2){if(_0x35b4c2){return _0x35b4c2[_0xc7bb('0x29')]()[_0xc7bb('0x28')](function(){_0xdcdb59[_0xc7bb('0x1b')](0xcc)[_0xc7bb('0x1c')]();});}};}function handleEntityNotFound(_0x43280e,_0x39b5eb){return function(_0x1299b4){if(!_0x1299b4){_0x43280e[_0xc7bb('0x1a')](0x194);}return _0x1299b4;};}function handleError(_0x3b5a4d,_0x430963){_0x430963=_0x430963||0x1f4;return function(_0x3ff099){logger[_0xc7bb('0x2a')](_0x3ff099[_0xc7bb('0x2b')]);if(_0x3ff099[_0xc7bb('0x2c')]){delete _0x3ff099[_0xc7bb('0x2c')];}_0x3b5a4d[_0xc7bb('0x1b')](_0x430963)[_0xc7bb('0x2d')](_0x3ff099);};}exports[_0xc7bb('0x2e')]=function(_0x37d7e9,_0x5b6b1b){var _0xfb8b33={},_0x143ffe={},_0x317581={'count':0x0,'rows':[]};var _0x3824d3=_[_0xc7bb('0x2f')](db['VoiceTransferReport'][_0xc7bb('0x30')],function(_0x57400c){return{'name':_0x57400c[_0xc7bb('0x31')],'type':_0x57400c[_0xc7bb('0x32')]['key']};});_0x143ffe[_0xc7bb('0x33')]=_[_0xc7bb('0x2f')](_0x3824d3,_0xc7bb('0x2c'));_0x143ffe[_0xc7bb('0x34')]=_[_0xc7bb('0x35')](_0x37d7e9[_0xc7bb('0x34')]);_0x143ffe['filters']=_[_0xc7bb('0x36')](_0x143ffe[_0xc7bb('0x33')],_0x143ffe['query']);_0xfb8b33['attributes']=_['intersection'](_0x143ffe['model'],qs[_0xc7bb('0x37')](_0x37d7e9[_0xc7bb('0x34')][_0xc7bb('0x37')]));_0xfb8b33[_0xc7bb('0x38')]=_0xfb8b33[_0xc7bb('0x38')]['length']?_0xfb8b33[_0xc7bb('0x38')]:_0x143ffe[_0xc7bb('0x33')];if(!_0x37d7e9[_0xc7bb('0x34')]['hasOwnProperty'](_0xc7bb('0x39'))){_0xfb8b33['limit']=qs['limit'](_0x37d7e9[_0xc7bb('0x34')][_0xc7bb('0x21')]);_0xfb8b33['offset']=qs[_0xc7bb('0x1e')](_0x37d7e9[_0xc7bb('0x34')][_0xc7bb('0x1e')]);}_0xfb8b33[_0xc7bb('0x3a')]=qs[_0xc7bb('0x3b')](_0x37d7e9['query'][_0xc7bb('0x3b')]);_0xfb8b33[_0xc7bb('0x3c')]=qs[_0xc7bb('0x3d')](_[_0xc7bb('0x3e')](_0x37d7e9['query'],_0x143ffe[_0xc7bb('0x3d')]),_0x3824d3);if(_0x37d7e9[_0xc7bb('0x34')][_0xc7bb('0x3f')]){_0xfb8b33['where']=_['merge'](_0xfb8b33[_0xc7bb('0x3c')],{'$or':_[_0xc7bb('0x2f')](_0x3824d3,function(_0x4cc9cd){if(_0x4cc9cd['type']!==_0xc7bb('0x40')){var _0x2607c2={};_0x2607c2[_0x4cc9cd[_0xc7bb('0x2c')]]={'$like':'%'+_0x37d7e9[_0xc7bb('0x34')][_0xc7bb('0x3f')]+'%'};return _0x2607c2;}})});}_0xfb8b33=_[_0xc7bb('0x41')]({},_0xfb8b33,_0x37d7e9[_0xc7bb('0x42')]);var _0x5916d2={'where':_0xfb8b33[_0xc7bb('0x3c')]};return db['VoiceTransferReport'][_0xc7bb('0x20')](_0x5916d2)[_0xc7bb('0x28')](function(_0x5c5c8d){_0x317581['count']=_0x5c5c8d;if(_0x37d7e9['query'][_0xc7bb('0x43')]){_0xfb8b33[_0xc7bb('0x44')]=[{'all':!![]}];}return db[_0xc7bb('0x45')][_0xc7bb('0x46')](_0xfb8b33);})[_0xc7bb('0x28')](function(_0x434f43){_0x317581[_0xc7bb('0x47')]=_0x434f43;return _0x317581;})[_0xc7bb('0x28')](respondWithFilteredResult(_0x5b6b1b,_0xfb8b33))[_0xc7bb('0x48')](handleError(_0x5b6b1b,null));};exports[_0xc7bb('0x49')]=function(_0x2a5a56,_0x1b3a5d){var _0x10b859={'raw':!![],'where':{'id':_0x2a5a56['params']['id']}},_0x28afc7={};_0x28afc7[_0xc7bb('0x33')]=_[_0xc7bb('0x35')](db[_0xc7bb('0x45')][_0xc7bb('0x30')]);_0x28afc7[_0xc7bb('0x34')]=_[_0xc7bb('0x35')](_0x2a5a56[_0xc7bb('0x34')]);_0x28afc7[_0xc7bb('0x3d')]=_[_0xc7bb('0x36')](_0x28afc7[_0xc7bb('0x33')],_0x28afc7[_0xc7bb('0x34')]);_0x10b859['attributes']=_[_0xc7bb('0x36')](_0x28afc7[_0xc7bb('0x33')],qs['fields'](_0x2a5a56[_0xc7bb('0x34')][_0xc7bb('0x37')]));_0x10b859[_0xc7bb('0x38')]=_0x10b859[_0xc7bb('0x38')][_0xc7bb('0x4a')]?_0x10b859[_0xc7bb('0x38')]:_0x28afc7[_0xc7bb('0x33')];if(_0x2a5a56[_0xc7bb('0x34')][_0xc7bb('0x43')]){_0x10b859[_0xc7bb('0x44')]=[{'all':!![]}];}_0x10b859=_[_0xc7bb('0x41')]({},_0x10b859,_0x2a5a56[_0xc7bb('0x42')]);return db[_0xc7bb('0x45')]['find'](_0x10b859)[_0xc7bb('0x28')](handleEntityNotFound(_0x1b3a5d,null))['then'](respondWithResult(_0x1b3a5d,null))[_0xc7bb('0x48')](handleError(_0x1b3a5d,null));};exports['create']=function(_0xe7e48f,_0x145a62){return db[_0xc7bb('0x45')][_0xc7bb('0x4b')](_0xe7e48f['body'],{})[_0xc7bb('0x28')](respondWithResult(_0x145a62,0xc9))[_0xc7bb('0x48')](handleError(_0x145a62,null));};exports[_0xc7bb('0x27')]=function(_0x30900f,_0x5b4230){if(_0x30900f[_0xc7bb('0x4c')]['id']){delete _0x30900f[_0xc7bb('0x4c')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x30900f['params']['id']}})['then'](handleEntityNotFound(_0x5b4230,null))[_0xc7bb('0x28')](saveUpdates(_0x30900f[_0xc7bb('0x4c')],null))[_0xc7bb('0x28')](respondWithResult(_0x5b4230,null))[_0xc7bb('0x48')](handleError(_0x5b4230,null));};exports[_0xc7bb('0x29')]=function(_0x4e0b9c,_0xc15078){return db[_0xc7bb('0x45')][_0xc7bb('0x4d')]({'where':{'id':_0x4e0b9c['params']['id']}})['then'](handleEntityNotFound(_0xc15078,null))[_0xc7bb('0x28')](removeEntity(_0xc15078,null))[_0xc7bb('0x48')](handleError(_0xc15078,null));};exports[_0xc7bb('0x4e')]=function(_0x3d4789,_0x221320){return db[_0xc7bb('0x45')][_0xc7bb('0x4e')]()[_0xc7bb('0x28')](respondWithResult(_0x221320,null))[_0xc7bb('0x48')](handleError(_0x221320,null));}; \ No newline at end of file +var _0x3845=['length','hasOwnProperty','nolimit','offset','sort','where','merge','type','VIRTUAL','filter','options','VoiceTransferReport','includeAll','include','findAll','rows','catch','params','create','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','set','apply','reject','save','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x3845,0x1eb));var _0x5384=function(_0x412a1e,_0x21fa5c){_0x412a1e=_0x412a1e-0x0;var _0x3f7c1a=_0x3845[_0x412a1e];return _0x3f7c1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5384('0x0'));var zipdir=require(_0x5384('0x1'));var jsonpatch=require(_0x5384('0x2'));var rp=require(_0x5384('0x3'));var moment=require(_0x5384('0x4'));var BPromise=require(_0x5384('0x5'));var Mustache=require(_0x5384('0x6'));var util=require(_0x5384('0x7'));var path=require(_0x5384('0x8'));var sox=require(_0x5384('0x9'));var csv=require(_0x5384('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5384('0xb'));var _=require('lodash');var squel=require(_0x5384('0xc'));var crypto=require(_0x5384('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5384('0xe'));var toCsv=require(_0x5384('0xa'));var querystring=require(_0x5384('0xf'));var Papa=require(_0x5384('0x10'));var Redis=require(_0x5384('0x11'));var authService=require(_0x5384('0x12'));var qs=require(_0x5384('0x13'));var as=require(_0x5384('0x14'));var hardwareService=require(_0x5384('0x15'));var logger=require(_0x5384('0x16'))(_0x5384('0x17'));var utils=require(_0x5384('0x18'));var config=require(_0x5384('0x19'));var licenseUtil=require(_0x5384('0x1a'));var db=require(_0x5384('0x1b'))['db'];function respondWithStatusCode(_0x394575,_0x3bbdea){_0x3bbdea=_0x3bbdea||0xcc;return function(_0x17b575){if(_0x17b575){return _0x394575[_0x5384('0x1c')](_0x3bbdea);}return _0x394575[_0x5384('0x1d')](_0x3bbdea)[_0x5384('0x1e')]();};}function respondWithResult(_0x527f96,_0x303395){_0x303395=_0x303395||0xc8;return function(_0x44d2c9){if(_0x44d2c9){return _0x527f96[_0x5384('0x1d')](_0x303395)['json'](_0x44d2c9);}};}function respondWithFilteredResult(_0x4ec800,_0x2fb260){return function(_0x8b644b){if(_0x8b644b){var _0x893fef=typeof _0x2fb260['offset']===_0x5384('0x1f')&&typeof _0x2fb260[_0x5384('0x20')]===_0x5384('0x1f');var _0x1f7b8d=_0x8b644b['count'];var _0x39eec2=_0x893fef?0x0:_0x2fb260['offset'];var _0x25546f=_0x893fef?_0x8b644b[_0x5384('0x21')]:_0x2fb260['offset']+_0x2fb260['limit'];var _0x197b2b;if(_0x25546f>=_0x1f7b8d){_0x25546f=_0x1f7b8d;_0x197b2b=0xc8;}else{_0x197b2b=0xce;}_0x4ec800[_0x5384('0x1d')](_0x197b2b);return _0x4ec800[_0x5384('0x22')]('Content-Range',_0x39eec2+'-'+_0x25546f+'/'+_0x1f7b8d)['json'](_0x8b644b);}return null;};}function patchUpdates(_0x16f9c5){return function(_0x46c2da){try{jsonpatch[_0x5384('0x23')](_0x46c2da,_0x16f9c5,!![]);}catch(_0x1d707d){return BPromise[_0x5384('0x24')](_0x1d707d);}return _0x46c2da[_0x5384('0x25')]();};}function saveUpdates(_0x17d7d8,_0x5a3798){return function(_0x40a015){if(_0x40a015){return _0x40a015['update'](_0x17d7d8)['then'](function(_0x426243){return _0x426243;});}return null;};}function removeEntity(_0x244b30,_0x120e4c){return function(_0x546583){if(_0x546583){return _0x546583[_0x5384('0x26')]()[_0x5384('0x27')](function(){_0x244b30['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ec02,_0x31ee23){return function(_0x587da2){if(!_0x587da2){_0x45ec02[_0x5384('0x1c')](0x194);}return _0x587da2;};}function handleError(_0x165530,_0x2d35d2){_0x2d35d2=_0x2d35d2||0x1f4;return function(_0x32438c){logger[_0x5384('0x28')](_0x32438c[_0x5384('0x29')]);if(_0x32438c[_0x5384('0x2a')]){delete _0x32438c[_0x5384('0x2a')];}_0x165530['status'](_0x2d35d2)[_0x5384('0x2b')](_0x32438c);};}exports['index']=function(_0x34daf7,_0xa7c870){var _0x53a345={},_0x246220={},_0x55fdc8={'count':0x0,'rows':[]};var _0x5607c1=_[_0x5384('0x2c')](db['VoiceTransferReport'][_0x5384('0x2d')],function(_0x2a9988){return{'name':_0x2a9988[_0x5384('0x2e')],'type':_0x2a9988['type'][_0x5384('0x2f')]};});_0x246220[_0x5384('0x30')]=_[_0x5384('0x2c')](_0x5607c1,'name');_0x246220[_0x5384('0x31')]=_[_0x5384('0x32')](_0x34daf7['query']);_0x246220[_0x5384('0x33')]=_[_0x5384('0x34')](_0x246220['model'],_0x246220[_0x5384('0x31')]);_0x53a345[_0x5384('0x35')]=_['intersection'](_0x246220[_0x5384('0x30')],qs[_0x5384('0x36')](_0x34daf7[_0x5384('0x31')][_0x5384('0x36')]));_0x53a345[_0x5384('0x35')]=_0x53a345[_0x5384('0x35')][_0x5384('0x37')]?_0x53a345[_0x5384('0x35')]:_0x246220[_0x5384('0x30')];if(!_0x34daf7[_0x5384('0x31')][_0x5384('0x38')](_0x5384('0x39'))){_0x53a345[_0x5384('0x20')]=qs[_0x5384('0x20')](_0x34daf7[_0x5384('0x31')][_0x5384('0x20')]);_0x53a345[_0x5384('0x3a')]=qs[_0x5384('0x3a')](_0x34daf7['query']['offset']);}_0x53a345['order']=qs['sort'](_0x34daf7[_0x5384('0x31')][_0x5384('0x3b')]);_0x53a345['where']=qs[_0x5384('0x33')](_['pick'](_0x34daf7['query'],_0x246220[_0x5384('0x33')]),_0x5607c1);if(_0x34daf7[_0x5384('0x31')]['filter']){_0x53a345[_0x5384('0x3c')]=_[_0x5384('0x3d')](_0x53a345['where'],{'$or':_[_0x5384('0x2c')](_0x5607c1,function(_0x29431d){if(_0x29431d[_0x5384('0x3e')]!==_0x5384('0x3f')){var _0x84035e={};_0x84035e[_0x29431d[_0x5384('0x2a')]]={'$like':'%'+_0x34daf7['query'][_0x5384('0x40')]+'%'};return _0x84035e;}})});}_0x53a345=_[_0x5384('0x3d')]({},_0x53a345,_0x34daf7[_0x5384('0x41')]);var _0x4e3ae4={'where':_0x53a345[_0x5384('0x3c')]};return db[_0x5384('0x42')]['count'](_0x4e3ae4)['then'](function(_0x5a35af){_0x55fdc8[_0x5384('0x21')]=_0x5a35af;if(_0x34daf7[_0x5384('0x31')][_0x5384('0x43')]){_0x53a345[_0x5384('0x44')]=[{'all':!![]}];}return db[_0x5384('0x42')][_0x5384('0x45')](_0x53a345);})['then'](function(_0x5094f2){_0x55fdc8[_0x5384('0x46')]=_0x5094f2;return _0x55fdc8;})['then'](respondWithFilteredResult(_0xa7c870,_0x53a345))[_0x5384('0x47')](handleError(_0xa7c870,null));};exports['show']=function(_0x3803e1,_0x410c80){var _0x11540c={'raw':!![],'where':{'id':_0x3803e1[_0x5384('0x48')]['id']}},_0x3c217d={};_0x3c217d['model']=_[_0x5384('0x32')](db[_0x5384('0x42')][_0x5384('0x2d')]);_0x3c217d['query']=_[_0x5384('0x32')](_0x3803e1[_0x5384('0x31')]);_0x3c217d[_0x5384('0x33')]=_[_0x5384('0x34')](_0x3c217d['model'],_0x3c217d['query']);_0x11540c[_0x5384('0x35')]=_['intersection'](_0x3c217d[_0x5384('0x30')],qs[_0x5384('0x36')](_0x3803e1[_0x5384('0x31')][_0x5384('0x36')]));_0x11540c['attributes']=_0x11540c['attributes'][_0x5384('0x37')]?_0x11540c['attributes']:_0x3c217d[_0x5384('0x30')];if(_0x3803e1[_0x5384('0x31')][_0x5384('0x43')]){_0x11540c[_0x5384('0x44')]=[{'all':!![]}];}_0x11540c=_['merge']({},_0x11540c,_0x3803e1[_0x5384('0x41')]);return db[_0x5384('0x42')]['find'](_0x11540c)[_0x5384('0x27')](handleEntityNotFound(_0x410c80,null))[_0x5384('0x27')](respondWithResult(_0x410c80,null))[_0x5384('0x47')](handleError(_0x410c80,null));};exports[_0x5384('0x49')]=function(_0x3e7128,_0x3d7bcd){return db['VoiceTransferReport']['create'](_0x3e7128['body'],{})['then'](respondWithResult(_0x3d7bcd,0xc9))[_0x5384('0x47')](handleError(_0x3d7bcd,null));};exports[_0x5384('0x4a')]=function(_0x19511f,_0x14a9e4){if(_0x19511f[_0x5384('0x4b')]['id']){delete _0x19511f[_0x5384('0x4b')]['id'];}return db[_0x5384('0x42')][_0x5384('0x4c')]({'where':{'id':_0x19511f[_0x5384('0x48')]['id']}})['then'](handleEntityNotFound(_0x14a9e4,null))[_0x5384('0x27')](saveUpdates(_0x19511f[_0x5384('0x4b')],null))[_0x5384('0x27')](respondWithResult(_0x14a9e4,null))[_0x5384('0x47')](handleError(_0x14a9e4,null));};exports[_0x5384('0x26')]=function(_0x4930fe,_0x145f40){return db['VoiceTransferReport']['find']({'where':{'id':_0x4930fe[_0x5384('0x48')]['id']}})[_0x5384('0x27')](handleEntityNotFound(_0x145f40,null))[_0x5384('0x27')](removeEntity(_0x145f40,null))['catch'](handleError(_0x145f40,null));};exports[_0x5384('0x4d')]=function(_0x17b248,_0x4506b0){return db[_0x5384('0x42')][_0x5384('0x4d')]()[_0x5384('0x27')](respondWithResult(_0x4506b0,null))[_0x5384('0x47')](handleError(_0x4506b0,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 72cdc5b..3d6f1fc 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 _0x5ef7=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','report_call_transfer','lodash','util','../../config/logger'];(function(_0x300bb7,_0x46c468){var _0x53b315=function(_0x3730f0){while(--_0x3730f0){_0x300bb7['push'](_0x300bb7['shift']());}};_0x53b315(++_0x46c468);}(_0x5ef7,0xb1));var _0x75ef=function(_0x2161e,_0x30f769){_0x2161e=_0x2161e-0x0;var _0x377e75=_0x5ef7[_0x2161e];return _0x377e75;};'use strict';var _=require(_0x75ef('0x0'));var util=require(_0x75ef('0x1'));var logger=require(_0x75ef('0x2'))(_0x75ef('0x3'));var moment=require(_0x75ef('0x4'));var BPromise=require(_0x75ef('0x5'));var rp=require(_0x75ef('0x6'));var fs=require('fs');var path=require(_0x75ef('0x7'));var rimraf=require('rimraf');var config=require(_0x75ef('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x75ef('0x9')]=function(_0xbb50a1,_0x1698cf){return _0xbb50a1[_0x75ef('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x75ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa77a=['../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','moment','bluebird','rimraf'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0xa77a,0x18c));var _0xaa77=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0xa77a[_0x3e961c];return _0x474f9c;};'use strict';var _=require(_0xaa77('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xaa77('0x1'));var BPromise=require(_0xaa77('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa77('0x3'));var config=require(_0xaa77('0x4'));var attributes=require(_0xaa77('0x5'));module[_0xaa77('0x6')]=function(_0x539101,_0x533bed){return _0x539101[_0xaa77('0x7')](_0xaa77('0x8'),attributes,{'tableName':_0xaa77('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 4d5d108..200a562 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 _0x15d7=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x4ededc,_0x58fae6){var _0x4b4035=function(_0xa047d7){while(--_0xa047d7){_0x4ededc['push'](_0x4ededc['shift']());}};_0x4b4035(++_0x58fae6);}(_0x15d7,0xd4));var _0x715d=function(_0x3be64f,_0x4dc241){_0x3be64f=_0x3be64f-0x0;var _0x343a36=_0x15d7[_0x3be64f];return _0x343a36;};'use strict';var _=require(_0x715d('0x0'));var util=require(_0x715d('0x1'));var moment=require(_0x715d('0x2'));var BPromise=require(_0x715d('0x3'));var rs=require(_0x715d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x715d('0x5'))['db'];var utils=require(_0x715d('0x6'));var logger=require(_0x715d('0x7'))('rpc');var config=require(_0x715d('0x8'));var jayson=require(_0x715d('0x9'));var client=jayson[_0x715d('0xa')][_0x715d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2659e4,_0x541654,_0x58237e){return new BPromise(function(_0x16301c,_0x41c6a6){return client[_0x715d('0xc')](_0x2659e4,_0x58237e)[_0x715d('0xd')](function(_0x4b6d7c){logger[_0x715d('0xe')](_0x715d('0xf'),_0x541654,_0x715d('0x10'));logger[_0x715d('0x11')](_0x715d('0x12'),_0x541654,'request\x20sent',JSON[_0x715d('0x13')](_0x4b6d7c));if(_0x4b6d7c[_0x715d('0x14')]){if(_0x4b6d7c[_0x715d('0x14')][_0x715d('0x15')]===0x1f4){logger['error'](_0x715d('0xf'),_0x541654,_0x4b6d7c[_0x715d('0x14')][_0x715d('0x16')]);return _0x41c6a6(_0x4b6d7c[_0x715d('0x14')][_0x715d('0x16')]);}logger[_0x715d('0x14')](_0x715d('0xf'),_0x541654,_0x4b6d7c[_0x715d('0x14')][_0x715d('0x16')]);return _0x16301c(_0x4b6d7c[_0x715d('0x14')]['message']);}else{logger[_0x715d('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x541654,_0x715d('0x10'));_0x16301c(_0x4b6d7c[_0x715d('0x17')]['message']);}})[_0x715d('0x18')](function(_0x1a6fb1){logger[_0x715d('0x14')](_0x715d('0xf'),_0x541654,_0x1a6fb1);_0x41c6a6(_0x1a6fb1);});});}exports[_0x715d('0x19')]=function(_0x1649d9){var _0x1dfb06=this;return new Promise(function(_0x244b7c,_0x41cf9a){return db[_0x715d('0x1a')][_0x715d('0x1b')](_0x1649d9[_0x715d('0x1c')],{'raw':_0x1649d9[_0x715d('0x1d')]?_0x1649d9[_0x715d('0x1d')][_0x715d('0x1e')]===undefined?!![]:![]:!![]})[_0x715d('0xd')](function(_0x582f67){logger[_0x715d('0xe')]('CreateVoiceTransferReport',_0x1649d9);logger[_0x715d('0x11')](_0x715d('0x19'),_0x1649d9,JSON['stringify'](_0x582f67));_0x244b7c(_0x582f67);})['catch'](function(_0x3a4d91){logger[_0x715d('0x14')]('CreateVoiceTransferReport',_0x3a4d91[_0x715d('0x16')],_0x1649d9);_0x41cf9a(_0x1dfb06[_0x715d('0x14')](0x1f4,_0x3a4d91[_0x715d('0x16')]));});});}; \ No newline at end of file +var _0xd1b4=['VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x288d33,_0x58ee36){var _0x1033bd=function(_0x2e22f1){while(--_0x2e22f1){_0x288d33['push'](_0x288d33['shift']());}};_0x1033bd(++_0x58ee36);}(_0xd1b4,0x98));var _0x4d1b=function(_0x30568e,_0x2e4a0f){_0x30568e=_0x30568e-0x0;var _0x1510cd=_0xd1b4[_0x30568e];return _0x1510cd;};'use strict';var _=require(_0x4d1b('0x0'));var util=require(_0x4d1b('0x1'));var moment=require(_0x4d1b('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d1b('0x3'));var fs=require('fs');var Redis=require(_0x4d1b('0x4'));var db=require(_0x4d1b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d1b('0x6'))(_0x4d1b('0x7'));var config=require(_0x4d1b('0x8'));var jayson=require(_0x4d1b('0x9'));var client=jayson['client'][_0x4d1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cb31d,_0x669cda,_0x22616f){return new BPromise(function(_0xa1b8c8,_0x3a5d13){return client[_0x4d1b('0xb')](_0x2cb31d,_0x22616f)[_0x4d1b('0xc')](function(_0x58b72c){logger[_0x4d1b('0xd')](_0x4d1b('0xe'),_0x669cda,_0x4d1b('0xf'));logger[_0x4d1b('0x10')](_0x4d1b('0x11'),_0x669cda,_0x4d1b('0xf'),JSON['stringify'](_0x58b72c));if(_0x58b72c[_0x4d1b('0x12')]){if(_0x58b72c[_0x4d1b('0x12')]['code']===0x1f4){logger[_0x4d1b('0x12')](_0x4d1b('0xe'),_0x669cda,_0x58b72c['error'][_0x4d1b('0x13')]);return _0x3a5d13(_0x58b72c[_0x4d1b('0x12')][_0x4d1b('0x13')]);}logger[_0x4d1b('0x12')](_0x4d1b('0xe'),_0x669cda,_0x58b72c['error'][_0x4d1b('0x13')]);return _0xa1b8c8(_0x58b72c['error']['message']);}else{logger[_0x4d1b('0xd')](_0x4d1b('0xe'),_0x669cda,'request\x20sent');_0xa1b8c8(_0x58b72c[_0x4d1b('0x14')][_0x4d1b('0x13')]);}})[_0x4d1b('0x15')](function(_0x34a8e4){logger[_0x4d1b('0x12')](_0x4d1b('0xe'),_0x669cda,_0x34a8e4);_0x3a5d13(_0x34a8e4);});});}exports['CreateVoiceTransferReport']=function(_0x2f08bc){var _0x104aca=this;return new Promise(function(_0x5b0837,_0x52e419){return db[_0x4d1b('0x16')][_0x4d1b('0x17')](_0x2f08bc[_0x4d1b('0x18')],{'raw':_0x2f08bc[_0x4d1b('0x19')]?_0x2f08bc[_0x4d1b('0x19')][_0x4d1b('0x1a')]===undefined?!![]:![]:!![]})[_0x4d1b('0xc')](function(_0x47eb36){logger['info'](_0x4d1b('0x1b'),_0x2f08bc);logger['debug'](_0x4d1b('0x1b'),_0x2f08bc,JSON[_0x4d1b('0x1c')](_0x47eb36));_0x5b0837(_0x47eb36);})[_0x4d1b('0x15')](function(_0x269fff){logger['error'](_0x4d1b('0x1b'),_0x269fff[_0x4d1b('0x13')],_0x2f08bc);_0x52e419(_0x104aca[_0x4d1b('0x12')](0x1f4,_0x269fff[_0x4d1b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 31ebc60..2588539 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 _0x1483=['Router','../../components/auth/service','post','isAuthenticated','originate','/hangup','canUpdate','/answer','answer','/hold','hold','calls','/transfer','exports','express'];(function(_0x6e5211,_0x3f8e5e){var _0x554d35=function(_0x1ba314){while(--_0x1ba314){_0x6e5211['push'](_0x6e5211['shift']());}};_0x554d35(++_0x3f8e5e);}(_0x1483,0x185));var _0x3148=function(_0x5d6270,_0x83b57a){_0x5d6270=_0x5d6270-0x0;var _0x168f26=_0x1483[_0x5d6270];return _0x168f26;};'use strict';var express=require(_0x3148('0x0'));var router=express[_0x3148('0x1')]();var auth=require(_0x3148('0x2'));var controller=require('./webbar.controller');router[_0x3148('0x3')]('/originate',auth[_0x3148('0x4')](),auth['canUpdate'](),controller[_0x3148('0x5')]);router[_0x3148('0x3')](_0x3148('0x6'),auth[_0x3148('0x4')](),auth[_0x3148('0x7')](),controller['hangup']);router['post'](_0x3148('0x8'),auth['isAuthenticated'](),auth[_0x3148('0x7')](),controller[_0x3148('0x9')]);router[_0x3148('0x3')](_0x3148('0xa'),auth[_0x3148('0x4')](),auth['canUpdate'](),controller[_0x3148('0xb')]);router[_0x3148('0x3')]('/unhold',auth[_0x3148('0x4')](),auth[_0x3148('0x7')](),controller['unhold']);router[_0x3148('0x3')]('/calls',auth['isAuthenticated'](),auth[_0x3148('0x7')](),controller[_0x3148('0xc')]);router[_0x3148('0x3')](_0x3148('0xd'),auth[_0x3148('0x4')](),auth[_0x3148('0x7')](),controller['transfer']);module[_0x3148('0xe')]=router; \ No newline at end of file +var _0x1373=['hangup','/answer','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','exports','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x1373,0x77));var _0x3137=function(_0x43a4b5,_0xa3e9bc){_0x43a4b5=_0x43a4b5-0x0;var _0x54ab5e=_0x1373[_0x43a4b5];return _0x54ab5e;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x3137('0x0'));router[_0x3137('0x1')](_0x3137('0x2'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0x5')]);router[_0x3137('0x1')](_0x3137('0x6'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0x7')]);router[_0x3137('0x1')](_0x3137('0x8'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0x9')]);router['post'](_0x3137('0xa'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0xb')]);router[_0x3137('0x1')](_0x3137('0xc'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0xd')]);router[_0x3137('0x1')](_0x3137('0xe'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0xf')]);router[_0x3137('0x1')](_0x3137('0x10'),auth[_0x3137('0x3')](),auth['canUpdate'](),controller['transfer']);module[_0x3137('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 6058434..59b9eb1 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 _0x6737=['answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','UserId','conference\x20fired:','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','redis','defaults','validate','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','error','stack','status','send','name','NotFound','request','then','code','message','catch','User','VoiceChannels','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','webbar:hangup','answer\x20fired:','webbar:answer'];(function(_0x1b250c,_0x4c59f3){var _0x5c681a=function(_0x398072){while(--_0x398072){_0x1b250c['push'](_0x1b250c['shift']());}};_0x5c681a(++_0x4c59f3);}(_0x6737,0xe2));var _0x7673=function(_0x5cf696,_0x29e5b0){_0x5cf696=_0x5cf696-0x0;var _0x4fb703=_0x6737[_0x5cf696];return _0x4fb703;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x7673('0x0'));var db=require(_0x7673('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var jayson=require(_0x7673('0x4'));var amiClient=jayson[_0x7673('0x5')]['http']({'port':0x232a});var logger=require(_0x7673('0x6'))(_0x7673('0x7'));var Redis=require('ioredis');config[_0x7673('0x8')]=_[_0x7673('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x7673('0xa'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'callNumber':{'type':_0x7673('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x7673('0xc')},'callbackUrl':{'type':_0x7673('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xe')]},'transferNumber':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});function emit(_0x2a2840,_0x4a8ea0,_0x5ed354){logger[_0x7673('0x10')](_0x2a2840,_0x4a8ea0,JSON[_0x7673('0x11')](_0x5ed354));io['to'](_0x2a2840)['emit'](_0x4a8ea0,_0x5ed354);}function handleError(_0x3afbb3){return function(_0x17699a){console['log'](_0x7673('0x12'),_0x17699a,_0x17699a instanceof RangeError);logger[_0x7673('0x13')](_0x17699a[_0x7673('0x14')]);if(_0x17699a instanceof RangeError){if(_0x17699a['name']){delete _0x17699a['name'];}_0x3afbb3[_0x7673('0x15')](0x194)[_0x7673('0x16')](_0x17699a);}else{if(_0x17699a['name']){delete _0x17699a[_0x7673('0x17')];}_0x3afbb3[_0x7673('0x15')](0x1f4)[_0x7673('0x16')](_0x17699a);}};}function checkError(){return function(_0x33eb47){if(!_0x33eb47){throw new RangeError(_0x7673('0x18'));}return _0x33eb47;};}function respondWithRpcPromise(_0x3e28ca,_0x59879a){return new BPromise(function(_0x557161,_0xea9b37){var _0x21774f=amiClient;return _0x21774f[_0x7673('0x19')](_0x3e28ca,_0x59879a)[_0x7673('0x1a')](function(_0x16bb16){if(_0x16bb16['error']){if(_0x16bb16[_0x7673('0x13')][_0x7673('0x1b')]===0x1f4){return _0xea9b37(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}return _0x557161(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}else{_0x557161(_0x16bb16['result']);}})[_0x7673('0x1d')](function(_0xaca974){_0xea9b37(_0xaca974);});});}function getAgent(_0x425897){return db[_0x7673('0x1e')]['findOne']({'where':{'id':_0x425897,'role':'agent'}})[_0x7673('0x1a')](checkError());}function getAgentCheckSession(_0x11b42b,_0x291d10){return new BPromise(function(_0x9d9eab,_0x119a21){var _0x45a045=respondWithRpcPromise(_0x7673('0x1f'));var _0x5a59f9=getAgent(_0x11b42b);Promise['all']([_0x45a045,_0x5a59f9])[_0x7673('0x1a')](function(_0x2d4c0a){var _0x1dd436=_0x2d4c0a[0x0];var _0x335743=_0x2d4c0a[0x1];var _0x12ac6b=_[_0x7673('0x20')](_0x1dd436[_0x7673('0x21')],function(_0x4f12b9){return _0x4f12b9['UserId']==_0x335743['id']&&_0x4f12b9[_0x7673('0x22')]==_0x291d10;});if(_0x12ac6b[_0x7673('0x23')]==0x1){_0x9d9eab(_0x335743);}else{_0x119a21(new RangeError(_0x7673('0x24')+_0x291d10+_0x7673('0x25')));}});});}exports['originate']=function(_0x3aa249,_0x497760){logger[_0x7673('0x10')](_0x7673('0x26'),_0x3aa249[_0x7673('0x27')]);var _0x1b924f=originateValidation[_0x7673('0xa')](_0x3aa249[_0x7673('0x27')]);if(_0x1b924f[_0x7673('0x23')]>0x0){return _0x497760[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1b924f);}var _0x1b6061=_0x3aa249[_0x7673('0x27')][_0x7673('0x29')];var _0x26cccd=_0x3aa249['body'][_0x7673('0x2a')];var _0x42f658=_0x3aa249[_0x7673('0x27')][_0x7673('0x2b')];var _0x30ddec=_0x3aa249[_0x7673('0x27')][_0x7673('0x2c')];return getAgent(_0x1b6061)['then'](function(_0x563e2d){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x563e2d[_0x7673('0x17')]);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x563e2d[_0x7673('0x17')]),_0x7673('0x30'),{'callNumber':_0x26cccd,'callerId':_0x42f658,'callbackUrl':_0x30ddec});return _0x497760['status'](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x31')});})['catch'](handleError(_0x497760));};exports[_0x7673('0x32')]=function(_0x400f3c,_0x287eee){logger[_0x7673('0x10')]('hangup\x20fired:',_0x400f3c[_0x7673('0x27')]);var _0x1f77c0=hangupValidation['validate'](_0x400f3c[_0x7673('0x27')]);if(_0x1f77c0[_0x7673('0x23')]>0x0){return _0x287eee[_0x7673('0x15')](0x190)['json'](_0x1f77c0);}var _0xe50aa5=_0x400f3c[_0x7673('0x27')][_0x7673('0x29')];var _0x5dfb9a=_0x400f3c['body'][_0x7673('0x22')];return getAgent(_0xe50aa5)['then'](function(_0x4ba2b4){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4ba2b4['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4ba2b4[_0x7673('0x17')]),_0x7673('0x33'),{'sessionId':_0x5dfb9a});return _0x287eee[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'hangup\x20executed!'});})[_0x7673('0x1d')](handleError(_0x287eee));};exports['answer']=function(_0xf43bb7,_0x52f803){logger[_0x7673('0x10')](_0x7673('0x34'),_0xf43bb7['body']);var _0x5b2e69=answerValidation[_0x7673('0xa')](_0xf43bb7['body']);if(_0x5b2e69[_0x7673('0x23')]>0x0){return _0x52f803[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x5b2e69);}var _0x3b6223=_0xf43bb7[_0x7673('0x27')]['userId'];var _0x4ea8b3=_0xf43bb7[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x3b6223)['then'](function(_0x4005ee){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4005ee['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4005ee[_0x7673('0x17')]),_0x7673('0x35'),{'sessionId':_0x4ea8b3});return _0x52f803[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x36')});})[_0x7673('0x1d')](handleError(_0x52f803));};exports[_0x7673('0x37')]=function(_0x4ed31d,_0x126981){logger[_0x7673('0x10')](_0x7673('0x38'),_0x4ed31d[_0x7673('0x27')]);var _0x332b5a=holdValidation[_0x7673('0xa')](_0x4ed31d[_0x7673('0x27')]);if(_0x332b5a['length']>0x0){return _0x126981[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x332b5a);}var _0x461ac3=_0x4ed31d[_0x7673('0x27')][_0x7673('0x29')];var _0x4b844d=_0x4ed31d[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x461ac3)[_0x7673('0x1a')](function(_0x2397fb){logger[_0x7673('0x10')]('entityFound:',_0x2397fb['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x2397fb['name']),_0x7673('0x39'),{'sessionId':_0x4b844d});return _0x126981[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3a')});})[_0x7673('0x1d')](handleError(_0x126981));};exports['unhold']=function(_0x23789d,_0x3afffa){logger[_0x7673('0x10')](_0x7673('0x3b'),_0x23789d['body']);var _0x1691a5=unholdValidation[_0x7673('0xa')](_0x23789d[_0x7673('0x27')]);if(_0x1691a5[_0x7673('0x23')]>0x0){return _0x3afffa[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1691a5);}var _0x115eef=_0x23789d[_0x7673('0x27')][_0x7673('0x29')];var _0x362409=_0x23789d[_0x7673('0x27')]['sessionId'];return getAgent(_0x115eef)[_0x7673('0x1a')](function(_0x4a0d99){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4a0d99[_0x7673('0x17')]);emit(util['format'](_0x7673('0x2f'),_0x4a0d99[_0x7673('0x17')]),_0x7673('0x3c'),{'sessionId':_0x362409});return _0x3afffa[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3d')});})[_0x7673('0x1d')](handleError(_0x3afffa));};exports[_0x7673('0x3e')]=function(_0x375bca,_0x1064d5){logger[_0x7673('0x10')](_0x7673('0x3f'),_0x1064d5[_0x7673('0x27')]);var _0xb3c9e9=callsValidation['validate'](_0x375bca[_0x7673('0x27')]);if(_0xb3c9e9['length']>0x0){return _0x1064d5[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xb3c9e9);}var _0x1d424a=_0x375bca['body'][_0x7673('0x29')];var _0x5d71b7=respondWithRpcPromise('VoiceChannels');var _0x1804a4=getAgent(_0x1d424a);return Promise['all']([_0x5d71b7,_0x1804a4])['then'](function(_0x1dd141){var _0x3f6ef3=_0x1dd141[0x0];var _0x215a32=_0x1dd141[0x1];var _0xeaa731=_[_0x7673('0x20')](_0x3f6ef3[_0x7673('0x21')],function(_0x151276){return _0x151276[_0x7673('0x40')]==_0x215a32['id'];});return _0x1064d5[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'count':_0xeaa731[_0x7673('0x23')],'rows':_0xeaa731});})['catch'](handleError(_0x1064d5));};exports['conference']=function(_0x2aa032,_0x297744){logger[_0x7673('0x10')](_0x7673('0x41'),_0x2aa032[_0x7673('0x27')]);var _0x48e51c=conferenceValidation['validate'](_0x2aa032[_0x7673('0x27')]);if(_0x48e51c[_0x7673('0x23')]>0x0){return _0x297744[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x48e51c);}var _0x51c617=_0x2aa032['body'][_0x7673('0x29')];return getAgent(_0x51c617)[_0x7673('0x1a')](function(_0x1cf039){logger['info'](_0x7673('0x2d'),_0x1cf039['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x1cf039[_0x7673('0x17')]),'webbar:conference');return _0x297744[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x297744));};exports['transfer']=function(_0x32dcfc,_0x2dd367){logger[_0x7673('0x10')](_0x7673('0x42'),_0x32dcfc['body']);var _0xed9040=transferValidation['validate'](_0x32dcfc[_0x7673('0x27')]);if(_0xed9040[_0x7673('0x23')]>0x0){return _0x2dd367[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xed9040);}var _0x5abb12=_0x32dcfc[_0x7673('0x27')][_0x7673('0x29')];var _0x308a9e=_0x32dcfc['body']['sessionId'];var _0x2d21f2=_0x32dcfc[_0x7673('0x27')][_0x7673('0x43')];return getAgent(_0x5abb12)[_0x7673('0x1a')](function(_0x20e9bd){logger['info'](_0x7673('0x2d'),_0x20e9bd[_0x7673('0x17')]);emit(util['format']('user:%s',_0x20e9bd['name']),_0x7673('0x44'),{'sessionId':_0x308a9e,'transferNumber':_0x2d21f2});return _0x2dd367[_0x7673('0x15')](0xc8)['json']({'error':![],'message':_0x7673('0x45')});})['catch'](handleError(_0x2dd367));}; \ No newline at end of file +var _0x6308=['userId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','error','stack','name','send','NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','status','json','callNumber','callerId','callbackUrl','info','entityFound:','format','user:%s','hangup','hangup\x20fired:','userId','sessionId','webbar:hangup','catch','answer\x20fired:','webbar:answer','hold','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','bluebird','jayson/promise','client','http','../../config/logger','redis','localhost','socket.io-emitter','validate','number','string'];(function(_0x38855d,_0x11ab20){var _0x4f2a29=function(_0x4db53d){while(--_0x4db53d){_0x38855d['push'](_0x38855d['shift']());}};_0x4f2a29(++_0x11ab20);}(_0x6308,0x1f2));var _0x8630=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x6308[_0x474bc0];return _0x4b24cf;};'use strict';var path=require(_0x8630('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x8630('0x1'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x8630('0x2'));var jayson=require(_0x8630('0x3'));var amiClient=jayson[_0x8630('0x4')][_0x8630('0x5')]({'port':0x232a});var logger=require(_0x8630('0x6'))('webbarapi');var Redis=require('ioredis');config[_0x8630('0x7')]=_['defaults'](config[_0x8630('0x7')],{'host':_0x8630('0x8'),'port':0x18eb});var io=require(_0x8630('0x9'))(new Redis(config[_0x8630('0x7')]));var Schema=require(_0x8630('0xa'));var originateValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x8630('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x8630('0xc')},'callbackUrl':{'type':_0x8630('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8630('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],_0x8630('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],_0x8630('0xd')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x8630('0xc'),'required':[!![],_0x8630('0xe')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8630('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8630('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],_0x8630('0xd')]}});function emit(_0x49fce1,_0x5c0ba0,_0x3ea754){logger['info'](_0x49fce1,_0x5c0ba0,JSON[_0x8630('0xf')](_0x3ea754));io['to'](_0x49fce1)[_0x8630('0x10')](_0x5c0ba0,_0x3ea754);}function handleError(_0x2c360d){return function(_0x20f462){console[_0x8630('0x11')](_0x8630('0x12'),_0x20f462,_0x20f462 instanceof RangeError);logger[_0x8630('0x13')](_0x20f462[_0x8630('0x14')]);if(_0x20f462 instanceof RangeError){if(_0x20f462[_0x8630('0x15')]){delete _0x20f462['name'];}_0x2c360d['status'](0x194)[_0x8630('0x16')](_0x20f462);}else{if(_0x20f462[_0x8630('0x15')]){delete _0x20f462['name'];}_0x2c360d['status'](0x1f4)[_0x8630('0x16')](_0x20f462);}};}function checkError(){return function(_0x441918){if(!_0x441918){throw new RangeError(_0x8630('0x17'));}return _0x441918;};}function respondWithRpcPromise(_0x491c65,_0x5ce487){return new BPromise(function(_0xcc7454,_0x58c0b5){var _0x30fb4d=amiClient;return _0x30fb4d[_0x8630('0x18')](_0x491c65,_0x5ce487)[_0x8630('0x19')](function(_0x469de3){if(_0x469de3['error']){if(_0x469de3[_0x8630('0x13')][_0x8630('0x1a')]===0x1f4){return _0x58c0b5(_0x469de3[_0x8630('0x13')][_0x8630('0x1b')]);}return _0xcc7454(_0x469de3[_0x8630('0x13')][_0x8630('0x1b')]);}else{_0xcc7454(_0x469de3[_0x8630('0x1c')]);}})['catch'](function(_0x5b2823){_0x58c0b5(_0x5b2823);});});}function getAgent(_0x18fd53){return db[_0x8630('0x1d')][_0x8630('0x1e')]({'where':{'id':_0x18fd53,'role':_0x8630('0x1f')}})[_0x8630('0x19')](checkError());}function getAgentCheckSession(_0x1c012d,_0x149a8e){return new BPromise(function(_0x349c4d,_0x306ca2){var _0x357c15=respondWithRpcPromise(_0x8630('0x20'));var _0x41f74c=getAgent(_0x1c012d);Promise[_0x8630('0x21')]([_0x357c15,_0x41f74c])[_0x8630('0x19')](function(_0xbb1a58){var _0x190216=_0xbb1a58[0x0];var _0x2d3f0b=_0xbb1a58[0x1];var _0x4d42c6=_[_0x8630('0x22')](_0x190216[_0x8630('0x23')],function(_0x24d85d){return _0x24d85d[_0x8630('0x24')]==_0x2d3f0b['id']&&_0x24d85d['sessionId']==_0x149a8e;});if(_0x4d42c6[_0x8630('0x25')]==0x1){_0x349c4d(_0x2d3f0b);}else{_0x306ca2(new RangeError(_0x8630('0x26')+_0x149a8e+_0x8630('0x27')));}});});}exports[_0x8630('0x28')]=function(_0x35b7b2,_0x32f4fd){logger['info'](_0x8630('0x29'),_0x35b7b2[_0x8630('0x2a')]);var _0x24e6af=originateValidation['validate'](_0x35b7b2[_0x8630('0x2a')]);if(_0x24e6af[_0x8630('0x25')]>0x0){return _0x32f4fd[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x24e6af);}var _0x2e0352=_0x35b7b2[_0x8630('0x2a')]['userId'];var _0x7deb1e=_0x35b7b2[_0x8630('0x2a')][_0x8630('0x2d')];var _0x16370e=_0x35b7b2[_0x8630('0x2a')][_0x8630('0x2e')];var _0x2843a6=_0x35b7b2[_0x8630('0x2a')][_0x8630('0x2f')];return getAgent(_0x2e0352)[_0x8630('0x19')](function(_0x396b2c){logger[_0x8630('0x30')](_0x8630('0x31'),_0x396b2c[_0x8630('0x15')]);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x396b2c[_0x8630('0x15')]),'webbar:originate',{'callNumber':_0x7deb1e,'callerId':_0x16370e,'callbackUrl':_0x2843a6});return _0x32f4fd[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x32f4fd));};exports[_0x8630('0x34')]=function(_0x1c2281,_0x28f75d){logger[_0x8630('0x30')](_0x8630('0x35'),_0x1c2281['body']);var _0x21e879=hangupValidation[_0x8630('0xa')](_0x1c2281[_0x8630('0x2a')]);if(_0x21e879[_0x8630('0x25')]>0x0){return _0x28f75d['status'](0x190)[_0x8630('0x2c')](_0x21e879);}var _0x437fde=_0x1c2281[_0x8630('0x2a')][_0x8630('0x36')];var _0x411a5c=_0x1c2281[_0x8630('0x2a')][_0x8630('0x37')];return getAgent(_0x437fde)['then'](function(_0x1076f4){logger[_0x8630('0x30')](_0x8630('0x31'),_0x1076f4[_0x8630('0x15')]);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x1076f4[_0x8630('0x15')]),_0x8630('0x38'),{'sessionId':_0x411a5c});return _0x28f75d[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':'hangup\x20executed!'});})[_0x8630('0x39')](handleError(_0x28f75d));};exports['answer']=function(_0x8b40e1,_0x475bb4){logger[_0x8630('0x30')](_0x8630('0x3a'),_0x8b40e1[_0x8630('0x2a')]);var _0x2f1fec=answerValidation['validate'](_0x8b40e1[_0x8630('0x2a')]);if(_0x2f1fec[_0x8630('0x25')]>0x0){return _0x475bb4[_0x8630('0x2b')](0x190)['json'](_0x2f1fec);}var _0x79385=_0x8b40e1[_0x8630('0x2a')][_0x8630('0x36')];var _0x327466=_0x8b40e1[_0x8630('0x2a')][_0x8630('0x37')];return getAgent(_0x79385)['then'](function(_0x348bb3){logger[_0x8630('0x30')](_0x8630('0x31'),_0x348bb3['name']);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x348bb3['name']),_0x8630('0x3b'),{'sessionId':_0x327466});return _0x475bb4[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x475bb4));};exports[_0x8630('0x3c')]=function(_0x4ab99a,_0x4f33bf){logger[_0x8630('0x30')]('hold\x20fired:',_0x4ab99a[_0x8630('0x2a')]);var _0x35a3c8=holdValidation['validate'](_0x4ab99a[_0x8630('0x2a')]);if(_0x35a3c8[_0x8630('0x25')]>0x0){return _0x4f33bf[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x35a3c8);}var _0x121e83=_0x4ab99a['body'][_0x8630('0x36')];var _0x231289=_0x4ab99a['body'][_0x8630('0x37')];return getAgent(_0x121e83)[_0x8630('0x19')](function(_0x3ff20b){logger['info'](_0x8630('0x31'),_0x3ff20b[_0x8630('0x15')]);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x3ff20b[_0x8630('0x15')]),_0x8630('0x3d'),{'sessionId':_0x231289});return _0x4f33bf[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x3e')});})['catch'](handleError(_0x4f33bf));};exports['unhold']=function(_0x1b8328,_0x13326d){logger[_0x8630('0x30')](_0x8630('0x3f'),_0x1b8328[_0x8630('0x2a')]);var _0x24a363=unholdValidation[_0x8630('0xa')](_0x1b8328['body']);if(_0x24a363[_0x8630('0x25')]>0x0){return _0x13326d[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x24a363);}var _0x16c286=_0x1b8328[_0x8630('0x2a')]['userId'];var _0x398ea7=_0x1b8328[_0x8630('0x2a')][_0x8630('0x37')];return getAgent(_0x16c286)[_0x8630('0x19')](function(_0x503f2b){logger[_0x8630('0x30')](_0x8630('0x31'),_0x503f2b['name']);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x503f2b[_0x8630('0x15')]),_0x8630('0x40'),{'sessionId':_0x398ea7});return _0x13326d['status'](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x41')});})['catch'](handleError(_0x13326d));};exports['calls']=function(_0x438a56,_0x9fef86){logger['info'](_0x8630('0x42'),_0x9fef86['body']);var _0x2e49c8=callsValidation[_0x8630('0xa')](_0x438a56[_0x8630('0x2a')]);if(_0x2e49c8['length']>0x0){return _0x9fef86[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x2e49c8);}var _0x7615f5=_0x438a56[_0x8630('0x2a')][_0x8630('0x36')];var _0x1c28dc=respondWithRpcPromise(_0x8630('0x20'));var _0x49c2bc=getAgent(_0x7615f5);return Promise[_0x8630('0x21')]([_0x1c28dc,_0x49c2bc])[_0x8630('0x19')](function(_0x2c3e6e){var _0x50ce41=_0x2c3e6e[0x0];var _0x535add=_0x2c3e6e[0x1];var _0x388e1f=_['filter'](_0x50ce41[_0x8630('0x23')],function(_0x83b818){return _0x83b818['UserId']==_0x535add['id'];});return _0x9fef86[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'count':_0x388e1f[_0x8630('0x25')],'rows':_0x388e1f});})[_0x8630('0x39')](handleError(_0x9fef86));};exports['conference']=function(_0x19af58,_0x1b33c3){logger[_0x8630('0x30')]('conference\x20fired:',_0x19af58['body']);var _0x4d32ac=conferenceValidation[_0x8630('0xa')](_0x19af58[_0x8630('0x2a')]);if(_0x4d32ac[_0x8630('0x25')]>0x0){return _0x1b33c3[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x4d32ac);}var _0x59f0d3=_0x19af58[_0x8630('0x2a')][_0x8630('0x36')];return getAgent(_0x59f0d3)[_0x8630('0x19')](function(_0x4f352b){logger['info'](_0x8630('0x31'),_0x4f352b[_0x8630('0x15')]);emit(util['format'](_0x8630('0x33'),_0x4f352b['name']),_0x8630('0x43'));return _0x1b33c3[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x44')});})[_0x8630('0x39')](handleError(_0x1b33c3));};exports['transfer']=function(_0x5f02ac,_0x5b9d39){logger[_0x8630('0x30')](_0x8630('0x45'),_0x5f02ac[_0x8630('0x2a')]);var _0x3da5cb=transferValidation[_0x8630('0xa')](_0x5f02ac[_0x8630('0x2a')]);if(_0x3da5cb[_0x8630('0x25')]>0x0){return _0x5b9d39[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x3da5cb);}var _0x36a55b=_0x5f02ac[_0x8630('0x2a')][_0x8630('0x36')];var _0x4bccab=_0x5f02ac[_0x8630('0x2a')]['sessionId'];var _0x427d94=_0x5f02ac[_0x8630('0x2a')][_0x8630('0x46')];return getAgent(_0x36a55b)[_0x8630('0x19')](function(_0x4beca1){logger['info'](_0x8630('0x31'),_0x4beca1[_0x8630('0x15')]);emit(util[_0x8630('0x32')]('user:%s',_0x4beca1[_0x8630('0x15')]),_0x8630('0x47'),{'sessionId':_0x4bccab,'transferNumber':_0x427d94});return _0x5b9d39['status'](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x48')});})[_0x8630('0x39')](handleError(_0x5b9d39));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 366acbb..0396148 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 _0xc6ac=['index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','create','post','addDisposition','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated'];(function(_0x14acd5,_0x361989){var _0x593ebd=function(_0x1f5f7f){while(--_0x1f5f7f){_0x14acd5['push'](_0x14acd5['shift']());}};_0x593ebd(++_0x361989);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x401f93,_0x4bec89){_0x401f93=_0x401f93-0x0;var _0x137c7e=_0xc6ac[_0x401f93];return _0x137c7e;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0xb')](_0xcc6a('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xcc6a('0xb')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller['getApplications']);router['post']('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x18')]);router[_0xcc6a('0x19')](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1a')]);router[_0xcc6a('0x19')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x19')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1c')]);router[_0xcc6a('0x19')](_0xcc6a('0x1d'),controller[_0xcc6a('0x1e')]);router[_0xcc6a('0x19')]('/:id/send',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1f')]);router[_0xcc6a('0x20')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x21')]);router[_0xcc6a('0x22')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x23')]);router[_0xcc6a('0x22')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x24')]);router[_0xcc6a('0x22')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x25')]);router[_0xcc6a('0x22')](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x26')]);module[_0xcc6a('0x27')]=router; \ No newline at end of file +var _0xfcf0=['/:id/applications','getApplications','post','addAnswer','/:id/users','addAgents','addApplications','notify','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents'];(function(_0xc6b50b,_0x42f55a){var _0x45c9f4=function(_0x20a584){while(--_0x20a584){_0xc6b50b['push'](_0xc6b50b['shift']());}};_0x45c9f4(++_0x42f55a);}(_0xfcf0,0x138));var _0x0fcf=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xfcf0[_0x5beda8];return _0x2aa042;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x9')](_0x0fcf('0x10'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['get'](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x13')]);router['get']('/:id/users',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x14')]);router['get'](_0x0fcf('0x15'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x16')]);router[_0x0fcf('0x17')]('/',auth[_0x0fcf('0xa')](),controller['create']);router[_0x0fcf('0x17')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller['addDisposition']);router[_0x0fcf('0x17')](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x18')]);router['post'](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x1a')]);router[_0x0fcf('0x17')](_0x0fcf('0x15'),auth['isAuthenticated'](),controller[_0x0fcf('0x1b')]);router[_0x0fcf('0x17')]('/:id/notify',controller[_0x0fcf('0x1c')]);router[_0x0fcf('0x17')]('/:id/send',auth[_0x0fcf('0xa')](),controller['send']);router[_0x0fcf('0x1d')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x1e')]);router[_0x0fcf('0x1f')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x20')]);router[_0x0fcf('0x1f')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x21')]);router[_0x0fcf('0x1f')]('/:id/canned_answers',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x22')]);router[_0x0fcf('0x1f')](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x23')]);module[_0x0fcf('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 7ca32ab..7569437 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 _0xf1da=['randomstring','exports','name','STRING','generate','ENUM','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x41b9ac,_0x4c3bc2){var _0x1406bb=function(_0x345f7b){while(--_0x345f7b){_0x41b9ac['push'](_0x41b9ac['shift']());}};_0x1406bb(++_0x4c3bc2);}(_0xf1da,0x187));var _0xaf1d=function(_0x143148,_0x1af3d7){_0x143148=_0x143148-0x0;var _0x17164f=_0xf1da[_0x143148];return _0x17164f;};'use strict';var Sequelize=require(_0xaf1d('0x0'));var rs=require(_0xaf1d('0x1'));module[_0xaf1d('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xaf1d('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xaf1d('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xaf1d('0x5')]();}},'phone':{'type':Sequelize[_0xaf1d('0x4')]},'type':{'type':Sequelize[_0xaf1d('0x6')](_0xaf1d('0x7'))},'accountSid':{'type':Sequelize[_0xaf1d('0x4')]},'authToken':{'type':Sequelize[_0xaf1d('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xaf1d('0x8');}},'notificationSound':{'type':Sequelize[_0xaf1d('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xaf1d('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaf1d('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaf1d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaf1d('0xa')],'comment':_0xaf1d('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xaf1d('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x312eed){if(!_0x312eed){this[_0xaf1d('0xc')](_0xaf1d('0xd'),null);}this[_0xaf1d('0xc')]('mandatoryDisposition',_0x312eed);}},'description':{'type':Sequelize[_0xaf1d('0x4')]}}; \ No newline at end of file +var _0x40cd=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x5898d2,_0x2a3dcd){var _0x4934d1=function(_0x5fb6cf){while(--_0x5fb6cf){_0x5898d2['push'](_0x5898d2['shift']());}};_0x4934d1(++_0x2a3dcd);}(_0x40cd,0x154));var _0xd40c=function(_0x293068,_0x383540){_0x293068=_0x293068-0x0;var _0x4542ae=_0x40cd[_0x293068];return _0x4542ae;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xd40c('0x0')]={'name':{'type':Sequelize[_0xd40c('0x1')],'unique':_0xd40c('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd40c('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd40c('0x3')]();}},'phone':{'type':Sequelize[_0xd40c('0x1')]},'type':{'type':Sequelize[_0xd40c('0x4')](_0xd40c('0x5'))},'accountSid':{'type':Sequelize[_0xd40c('0x1')]},'authToken':{'type':Sequelize[_0xd40c('0x1')]},'notificationTemplate':{'type':Sequelize[_0xd40c('0x6')],'defaultValue':function(){return _0xd40c('0x7');}},'notificationSound':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd40c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd40c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd40c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd40c('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![],'comment':_0xd40c('0xa'),'set':function(_0x3f8d3a){if(!_0x3f8d3a){this[_0xd40c('0xb')](_0xd40c('0xc'),null);}this[_0xd40c('0xb')](_0xd40c('0xd'),_0x3f8d3a);}},'description':{'type':Sequelize[_0xd40c('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 29af82f..a7eb31f 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 _0xd7d5=['key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','WhatsappAccountId','Disposition','removeDispositions','ids','getAnswers','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','send','List','defaults','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./whatsappAccount.socket','register','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type'];(function(_0x38652b,_0x2405f5){var _0x53fd65=function(_0x4b6ec8){while(--_0x4b6ec8){_0x38652b['push'](_0x38652b['shift']());}};_0x53fd65(++_0x2405f5);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x170609,_0x4cf148){_0x170609=_0x170609-0x0;var _0x480386=_0xd7d5[_0x170609];return _0x480386;};'use strict';var emlformat=require(_0x5d7d('0x0'));var rimraf=require(_0x5d7d('0x1'));var zipdir=require(_0x5d7d('0x2'));var jsonpatch=require(_0x5d7d('0x3'));var rp=require(_0x5d7d('0x4'));var moment=require(_0x5d7d('0x5'));var BPromise=require(_0x5d7d('0x6'));var Mustache=require('mustache');var util=require(_0x5d7d('0x7'));var path=require('path');var sox=require(_0x5d7d('0x8'));var csv=require(_0x5d7d('0x9'));var ejs=require(_0x5d7d('0xa'));var fs=require('fs');var fs_extra=require(_0x5d7d('0xb'));var _=require(_0x5d7d('0xc'));var squel=require(_0x5d7d('0xd'));var crypto=require(_0x5d7d('0xe'));var jsforce=require(_0x5d7d('0xf'));var deskjs=require(_0x5d7d('0x10'));var toCsv=require(_0x5d7d('0x9'));var querystring=require('querystring');var Papa=require(_0x5d7d('0x11'));var Redis=require(_0x5d7d('0x12'));var authService=require(_0x5d7d('0x13'));var qs=require(_0x5d7d('0x14'));var as=require(_0x5d7d('0x15'));var hardwareService=require(_0x5d7d('0x16'));var logger=require(_0x5d7d('0x17'))(_0x5d7d('0x18'));var utils=require(_0x5d7d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5d7d('0x1a'));var db=require(_0x5d7d('0x1b'))['db'];config[_0x5d7d('0x1c')]=_['defaults'](config[_0x5d7d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5d7d('0x1d'))[_0x5d7d('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5d7d('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2e33a4,_0x267f94,_0x159c5a,_0x3d687b){return new BPromise(function(_0x5d8d8c,_0x4a07d2){var _0x4dc832=_0x3d687b||client;return _0x4dc832[_0x5d7d('0x20')](_0x2e33a4,_0x159c5a)[_0x5d7d('0x21')](function(_0x45280a){logger[_0x5d7d('0x22')](_0x5d7d('0x23'),_0x267f94,_0x5d7d('0x24'));logger[_0x5d7d('0x25')](_0x5d7d('0x26'),_0x267f94,_0x5d7d('0x24'),JSON[_0x5d7d('0x27')](_0x45280a));if(_0x45280a[_0x5d7d('0x28')]){if(_0x45280a['error'][_0x5d7d('0x29')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x267f94,_0x45280a[_0x5d7d('0x28')][_0x5d7d('0x2a')]);return _0x4a07d2(_0x45280a[_0x5d7d('0x28')][_0x5d7d('0x2a')]);}logger[_0x5d7d('0x28')](_0x5d7d('0x23'),_0x267f94,_0x45280a[_0x5d7d('0x28')][_0x5d7d('0x2a')]);return _0x5d8d8c(_0x45280a[_0x5d7d('0x28')][_0x5d7d('0x2a')]);}else{logger[_0x5d7d('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x267f94,_0x5d7d('0x24'));_0x5d8d8c(_0x45280a[_0x5d7d('0x2b')][_0x5d7d('0x2a')]);}})[_0x5d7d('0x2c')](function(_0x5b96b6){logger['error'](_0x5d7d('0x23'),_0x267f94,_0x5b96b6);_0x4a07d2(_0x5b96b6);});});}function respondWithStatusCode(_0x1f5913,_0x317dc1){_0x317dc1=_0x317dc1||0xcc;return function(_0x5b855e){if(_0x5b855e){return _0x1f5913[_0x5d7d('0x2d')](_0x317dc1);}return _0x1f5913['status'](_0x317dc1)[_0x5d7d('0x2e')]();};}function respondWithResult(_0x8dac81,_0x41b67f){_0x41b67f=_0x41b67f||0xc8;return function(_0x5a224a){if(_0x5a224a){return _0x8dac81[_0x5d7d('0x2f')](_0x41b67f)[_0x5d7d('0x30')](_0x5a224a);}};}function respondWithFilteredResult(_0x41079a,_0x4e8a59){return function(_0x187030){if(_0x187030){var _0x4ed00c=typeof _0x4e8a59[_0x5d7d('0x31')]===_0x5d7d('0x32')&&typeof _0x4e8a59[_0x5d7d('0x33')]===_0x5d7d('0x32');var _0x27c803=_0x187030['count'];var _0x211166=_0x4ed00c?0x0:_0x4e8a59[_0x5d7d('0x31')];var _0x1ff099=_0x4ed00c?_0x187030[_0x5d7d('0x34')]:_0x4e8a59['offset']+_0x4e8a59[_0x5d7d('0x33')];var _0x291c2a;if(_0x1ff099>=_0x27c803){_0x1ff099=_0x27c803;_0x291c2a=0xc8;}else{_0x291c2a=0xce;}_0x41079a[_0x5d7d('0x2f')](_0x291c2a);return _0x41079a[_0x5d7d('0x35')]('Content-Range',_0x211166+'-'+_0x1ff099+'/'+_0x27c803)[_0x5d7d('0x30')](_0x187030);}return null;};}function patchUpdates(_0x195fac){return function(_0xdb8d1f){try{jsonpatch['apply'](_0xdb8d1f,_0x195fac,!![]);}catch(_0x48afcb){return BPromise[_0x5d7d('0x36')](_0x48afcb);}return _0xdb8d1f[_0x5d7d('0x37')]();};}function saveUpdates(_0x58c5da,_0x224d36){return function(_0xee91b6){if(_0xee91b6){return _0xee91b6[_0x5d7d('0x38')](_0x58c5da)[_0x5d7d('0x21')](function(_0xe8d814){return _0xe8d814;});}return null;};}function removeEntity(_0x3bfc52,_0x290c79){return function(_0x5ced5b){if(_0x5ced5b){return _0x5ced5b[_0x5d7d('0x39')]()[_0x5d7d('0x21')](function(){var _0x21d796=_0x5ced5b[_0x5d7d('0x3a')]({'plain':!![]});var _0x53a683=_0x5d7d('0x3b');return db[_0x5d7d('0x3c')][_0x5d7d('0x39')]({'where':{'type':_0x53a683,'resourceId':_0x21d796['id']}})['then'](function(){return _0x5ced5b;});})[_0x5d7d('0x21')](function(){_0x3bfc52[_0x5d7d('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28c437,_0x1e6f25){return function(_0x2cb923){if(!_0x2cb923){_0x28c437['sendStatus'](0x194);}return _0x2cb923;};}function handleError(_0x514d2a,_0x3d0c91){_0x3d0c91=_0x3d0c91||0x1f4;return function(_0x5e02dc){logger['error'](_0x5e02dc[_0x5d7d('0x3d')]);if(_0x5e02dc[_0x5d7d('0x3e')]){delete _0x5e02dc['name'];}_0x514d2a[_0x5d7d('0x2f')](_0x3d0c91)['send'](_0x5e02dc);};}exports[_0x5d7d('0x3f')]=function(_0x12ff29,_0x5d85b4){var _0x1e4556={'include':[{'model':db[_0x5d7d('0x40')],'as':_0x5d7d('0x41')}]},_0x548aa3={},_0x5449d0={'count':0x0,'rows':[]};var _0x534130=_[_0x5d7d('0x42')](db[_0x5d7d('0x43')][_0x5d7d('0x44')],function(_0x31382c){return{'name':_0x31382c[_0x5d7d('0x45')],'type':_0x31382c[_0x5d7d('0x46')][_0x5d7d('0x47')]};});_0x548aa3[_0x5d7d('0x48')]=_[_0x5d7d('0x42')](_0x534130,_0x5d7d('0x3e'));_0x548aa3[_0x5d7d('0x49')]=_[_0x5d7d('0x4a')](_0x12ff29[_0x5d7d('0x49')]);_0x548aa3[_0x5d7d('0x4b')]=_['intersection'](_0x548aa3[_0x5d7d('0x48')],_0x548aa3['query']);_0x1e4556[_0x5d7d('0x4c')]=_[_0x5d7d('0x4d')](_0x548aa3[_0x5d7d('0x48')],qs['fields'](_0x12ff29[_0x5d7d('0x49')][_0x5d7d('0x4e')]));_0x1e4556[_0x5d7d('0x4c')]=_0x1e4556[_0x5d7d('0x4c')][_0x5d7d('0x4f')]?_0x1e4556[_0x5d7d('0x4c')]:_0x548aa3['model'];if(!_0x12ff29[_0x5d7d('0x49')][_0x5d7d('0x50')](_0x5d7d('0x51'))){_0x1e4556[_0x5d7d('0x33')]=qs[_0x5d7d('0x33')](_0x12ff29['query'][_0x5d7d('0x33')]);_0x1e4556[_0x5d7d('0x31')]=qs[_0x5d7d('0x31')](_0x12ff29[_0x5d7d('0x49')][_0x5d7d('0x31')]);}_0x1e4556[_0x5d7d('0x52')]=qs['sort'](_0x12ff29[_0x5d7d('0x49')][_0x5d7d('0x53')]);_0x1e4556['where']=qs[_0x5d7d('0x4b')](_[_0x5d7d('0x54')](_0x12ff29['query'],_0x548aa3[_0x5d7d('0x4b')]),_0x534130);if(_0x12ff29['query'][_0x5d7d('0x55')]){_0x1e4556[_0x5d7d('0x56')]=_[_0x5d7d('0x57')](_0x1e4556[_0x5d7d('0x56')],{'$or':_[_0x5d7d('0x42')](_0x534130,function(_0x275505){if(_0x275505[_0x5d7d('0x46')]!==_0x5d7d('0x58')){var _0x5f2cee={};_0x5f2cee[_0x275505['name']]={'$like':'%'+_0x12ff29[_0x5d7d('0x49')][_0x5d7d('0x55')]+'%'};return _0x5f2cee;}})});}_0x1e4556=_['merge']({},_0x1e4556,_0x12ff29[_0x5d7d('0x59')]);var _0x278d7d={'where':_0x1e4556[_0x5d7d('0x56')]};return db[_0x5d7d('0x43')]['count'](_0x278d7d)[_0x5d7d('0x21')](function(_0x29512f){_0x5449d0['count']=_0x29512f;if(_0x12ff29[_0x5d7d('0x49')][_0x5d7d('0x5a')]){_0x1e4556['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x5d7d('0x5b')](_0x1e4556);})['then'](function(_0x4f4c96){_0x5449d0[_0x5d7d('0x5c')]=_0x4f4c96;return _0x5449d0;})[_0x5d7d('0x21')](respondWithFilteredResult(_0x5d85b4,_0x1e4556))[_0x5d7d('0x2c')](handleError(_0x5d85b4,null));};exports[_0x5d7d('0x5d')]=function(_0x44ee45,_0x47afb5){var _0x1b346b={'raw':![],'where':{'id':_0x44ee45['params']['id']},'include':[{'model':db['Pause'],'as':_0x5d7d('0x41')}]},_0x54d2c6={};_0x54d2c6['model']=_[_0x5d7d('0x4a')](db[_0x5d7d('0x43')]['rawAttributes']);_0x54d2c6[_0x5d7d('0x49')]=_['keys'](_0x44ee45[_0x5d7d('0x49')]);_0x54d2c6[_0x5d7d('0x4b')]=_[_0x5d7d('0x4d')](_0x54d2c6[_0x5d7d('0x48')],_0x54d2c6[_0x5d7d('0x49')]);_0x1b346b[_0x5d7d('0x4c')]=_[_0x5d7d('0x4d')](_0x54d2c6['model'],qs['fields'](_0x44ee45[_0x5d7d('0x49')][_0x5d7d('0x4e')]));_0x1b346b[_0x5d7d('0x4c')]=_0x1b346b[_0x5d7d('0x4c')]['length']?_0x1b346b['attributes']:_0x54d2c6['model'];if(_0x44ee45[_0x5d7d('0x49')][_0x5d7d('0x5a')]){_0x1b346b[_0x5d7d('0x5e')]=[{'all':!![]}];}_0x1b346b=_[_0x5d7d('0x57')]({},_0x1b346b,_0x44ee45[_0x5d7d('0x59')]);return db[_0x5d7d('0x43')][_0x5d7d('0x5f')](_0x1b346b)['then'](handleEntityNotFound(_0x47afb5,null))['then'](respondWithResult(_0x47afb5,null))['catch'](handleError(_0x47afb5,null));};exports[_0x5d7d('0x60')]=function(_0x118b47,_0x8d8206){return db[_0x5d7d('0x43')][_0x5d7d('0x60')](_0x118b47['body'],{})['then'](function(_0x3f974c){var _0x4811ff=_0x118b47[_0x5d7d('0x61')][_0x5d7d('0x3a')]({'plain':!![]});if(!_0x4811ff)throw new Error(_0x5d7d('0x62'));if(_0x4811ff[_0x5d7d('0x63')]==='user'){var _0x1dda26=_0x3f974c[_0x5d7d('0x3a')]({'plain':!![]});var _0x48b125=_0x5d7d('0x3b');return db['UserProfileSection'][_0x5d7d('0x5f')]({'where':{'name':_0x48b125,'userProfileId':_0x4811ff[_0x5d7d('0x64')]},'raw':!![]})[_0x5d7d('0x21')](function(_0x569214){if(_0x569214&&_0x569214['autoAssociation']===0x0){return db[_0x5d7d('0x3c')][_0x5d7d('0x60')]({'name':_0x1dda26[_0x5d7d('0x3e')],'resourceId':_0x1dda26['id'],'type':_0x569214[_0x5d7d('0x3e')],'sectionId':_0x569214['id']},{})[_0x5d7d('0x21')](function(){return _0x3f974c;});}else{return _0x3f974c;}})[_0x5d7d('0x2c')](function(_0x1981de){logger['error'](_0x5d7d('0x65'),_0x1981de);throw _0x1981de;});}return _0x3f974c;})[_0x5d7d('0x21')](respondWithResult(_0x8d8206,0xc9))[_0x5d7d('0x2c')](handleError(_0x8d8206,null));};exports[_0x5d7d('0x38')]=function(_0x1eac32,_0x1cfd42){if(_0x1eac32['body']['id']){delete _0x1eac32[_0x5d7d('0x66')]['id'];}return db['WhatsappAccount'][_0x5d7d('0x5f')]({'where':{'id':_0x1eac32[_0x5d7d('0x67')]['id']},'include':[{'model':db[_0x5d7d('0x40')],'as':_0x5d7d('0x41')}]})[_0x5d7d('0x21')](handleEntityNotFound(_0x1cfd42,null))[_0x5d7d('0x21')](saveUpdates(_0x1eac32['body'],null))[_0x5d7d('0x21')](respondWithResult(_0x1cfd42,null))[_0x5d7d('0x2c')](handleError(_0x1cfd42,null));};exports[_0x5d7d('0x39')]=function(_0x2fedbd,_0x21e481){return db[_0x5d7d('0x43')][_0x5d7d('0x5f')]({'where':{'id':_0x2fedbd[_0x5d7d('0x67')]['id']}})[_0x5d7d('0x21')](handleEntityNotFound(_0x21e481,null))[_0x5d7d('0x21')](removeEntity(_0x21e481,null))[_0x5d7d('0x2c')](handleError(_0x21e481,null));};exports['describe']=function(_0x505dbe,_0x1378a4){return db[_0x5d7d('0x43')]['describe']()['then'](respondWithResult(_0x1378a4,null))['catch'](handleError(_0x1378a4,null));};exports['addDisposition']=function(_0x43e830,_0x4b9b05,_0x409946){if(_0x43e830[_0x5d7d('0x66')]['id']){delete _0x43e830[_0x5d7d('0x66')]['id'];}return db['WhatsappAccount'][_0x5d7d('0x5f')]({'where':{'id':_0x43e830[_0x5d7d('0x67')]['id']}})[_0x5d7d('0x21')](handleEntityNotFound(_0x4b9b05,null))['then'](function(_0x152a79){if(_0x152a79){_0x43e830[_0x5d7d('0x66')][_0x5d7d('0x68')]=_0x152a79['id'];return db[_0x5d7d('0x69')]['create'](_0x43e830[_0x5d7d('0x66')]);}})[_0x5d7d('0x21')](respondWithResult(_0x4b9b05,null))['catch'](handleError(_0x4b9b05,null));};exports['getDispositions']=function(_0x533f89,_0x1c475d,_0x52d9cd){var _0x5a149a={'raw':![],'where':{}};var _0x297cbb={};var _0x3a6b75={'count':0x0,'rows':[]};return db[_0x5d7d('0x43')]['findOne']({'where':{'id':_0x533f89[_0x5d7d('0x67')]['id']}})['then'](handleEntityNotFound(_0x1c475d,null))[_0x5d7d('0x21')](function(_0x54ebe){if(_0x54ebe){_0x297cbb[_0x5d7d('0x48')]=_[_0x5d7d('0x4a')](db[_0x5d7d('0x69')][_0x5d7d('0x44')]);_0x297cbb[_0x5d7d('0x49')]=_[_0x5d7d('0x4a')](_0x533f89['query']);_0x297cbb[_0x5d7d('0x4b')]=_['intersection'](_0x297cbb[_0x5d7d('0x48')],_0x297cbb[_0x5d7d('0x49')]);_0x5a149a[_0x5d7d('0x4c')]=_['intersection'](_0x297cbb[_0x5d7d('0x48')],qs[_0x5d7d('0x4e')](_0x533f89[_0x5d7d('0x49')][_0x5d7d('0x4e')]));_0x5a149a[_0x5d7d('0x4c')]=_0x5a149a[_0x5d7d('0x4c')][_0x5d7d('0x4f')]?_0x5a149a[_0x5d7d('0x4c')]:_0x297cbb[_0x5d7d('0x48')];if(!_0x533f89[_0x5d7d('0x49')][_0x5d7d('0x50')](_0x5d7d('0x51'))){_0x5a149a['limit']=qs[_0x5d7d('0x33')](_0x533f89[_0x5d7d('0x49')][_0x5d7d('0x33')]);_0x5a149a[_0x5d7d('0x31')]=qs[_0x5d7d('0x31')](_0x533f89[_0x5d7d('0x49')][_0x5d7d('0x31')]);}_0x5a149a['order']=qs['sort'](_0x533f89['query'][_0x5d7d('0x53')]);_0x5a149a['where']=qs[_0x5d7d('0x4b')](_[_0x5d7d('0x54')](_0x533f89[_0x5d7d('0x49')],_0x297cbb['filters']));_0x5a149a['where'][_0x5d7d('0x68')]=_0x54ebe['id'];if(_0x533f89[_0x5d7d('0x49')][_0x5d7d('0x55')]){_0x5a149a[_0x5d7d('0x56')]=_[_0x5d7d('0x57')](_0x5a149a['where'],{'$or':_['map'](_0x5a149a[_0x5d7d('0x4c')],function(_0x13dd26){var _0x1e5d54={};_0x1e5d54[_0x13dd26]={'$like':'%'+_0x533f89[_0x5d7d('0x49')][_0x5d7d('0x55')]+'%'};return _0x1e5d54;})});}_0x5a149a=_[_0x5d7d('0x57')]({},_0x5a149a,_0x533f89[_0x5d7d('0x59')]);return db[_0x5d7d('0x69')][_0x5d7d('0x34')]({'where':_0x5a149a[_0x5d7d('0x56')]})[_0x5d7d('0x21')](function(_0x3e8d3f){_0x3a6b75['count']=_0x3e8d3f;if(_0x533f89[_0x5d7d('0x49')][_0x5d7d('0x5a')]){_0x5a149a[_0x5d7d('0x5e')]=[{'all':!![]}];}return db[_0x5d7d('0x69')][_0x5d7d('0x5b')](_0x5a149a);})[_0x5d7d('0x21')](function(_0x6dca6c){_0x3a6b75['rows']=_0x6dca6c;return _0x3a6b75;});}})['then'](respondWithFilteredResult(_0x1c475d,_0x5a149a))[_0x5d7d('0x2c')](handleError(_0x1c475d,null));};exports[_0x5d7d('0x6a')]=function(_0x1d252d,_0x41440f,_0x4c67ad){return db[_0x5d7d('0x43')][_0x5d7d('0x5f')]({'where':{'id':_0x1d252d[_0x5d7d('0x67')]['id']}})['then'](handleEntityNotFound(_0x41440f,null))[_0x5d7d('0x21')](function(_0x24e191){if(_0x24e191){return _0x24e191[_0x5d7d('0x6a')](_0x1d252d[_0x5d7d('0x49')][_0x5d7d('0x6b')]);}})['then'](respondWithStatusCode(_0x41440f,null))[_0x5d7d('0x2c')](handleError(_0x41440f,null));};exports['addAnswer']=function(_0x88430d,_0x5217fd,_0x3f1fc2){if(_0x88430d['body']['id']){delete _0x88430d['body']['id'];}return db[_0x5d7d('0x43')]['find']({'where':{'id':_0x88430d[_0x5d7d('0x67')]['id']}})['then'](handleEntityNotFound(_0x5217fd,null))[_0x5d7d('0x21')](function(_0xb601c9){if(_0xb601c9){_0x88430d['body']['WhatsappAccountId']=_0xb601c9['id'];return db['CannedAnswer'][_0x5d7d('0x60')](_0x88430d[_0x5d7d('0x66')]);}})[_0x5d7d('0x21')](respondWithResult(_0x5217fd,null))['catch'](handleError(_0x5217fd,null));};exports[_0x5d7d('0x6c')]=function(_0x564cb0,_0x118e18,_0x341bb4){var _0x5c3b69={'raw':![],'where':{}};var _0x4866ea={};var _0x3da7a7={'count':0x0,'rows':[]};return db[_0x5d7d('0x43')][_0x5d7d('0x6d')]({'where':{'id':_0x564cb0[_0x5d7d('0x67')]['id']}})[_0x5d7d('0x21')](handleEntityNotFound(_0x118e18,null))[_0x5d7d('0x21')](function(_0x33a4f1){if(_0x33a4f1){_0x4866ea['model']=_[_0x5d7d('0x4a')](db[_0x5d7d('0x6e')][_0x5d7d('0x44')]);_0x4866ea[_0x5d7d('0x49')]=_[_0x5d7d('0x4a')](_0x564cb0[_0x5d7d('0x49')]);_0x4866ea[_0x5d7d('0x4b')]=_[_0x5d7d('0x4d')](_0x4866ea['model'],_0x4866ea[_0x5d7d('0x49')]);_0x5c3b69[_0x5d7d('0x4c')]=_[_0x5d7d('0x4d')](_0x4866ea['model'],qs[_0x5d7d('0x4e')](_0x564cb0[_0x5d7d('0x49')][_0x5d7d('0x4e')]));_0x5c3b69['attributes']=_0x5c3b69[_0x5d7d('0x4c')][_0x5d7d('0x4f')]?_0x5c3b69[_0x5d7d('0x4c')]:_0x4866ea[_0x5d7d('0x48')];if(!_0x564cb0[_0x5d7d('0x49')][_0x5d7d('0x50')]('nolimit')){_0x5c3b69[_0x5d7d('0x33')]=qs[_0x5d7d('0x33')](_0x564cb0['query'][_0x5d7d('0x33')]);_0x5c3b69[_0x5d7d('0x31')]=qs[_0x5d7d('0x31')](_0x564cb0[_0x5d7d('0x49')]['offset']);}_0x5c3b69[_0x5d7d('0x52')]=qs['sort'](_0x564cb0[_0x5d7d('0x49')][_0x5d7d('0x53')]);_0x5c3b69[_0x5d7d('0x56')]=qs[_0x5d7d('0x4b')](_[_0x5d7d('0x54')](_0x564cb0[_0x5d7d('0x49')],_0x4866ea[_0x5d7d('0x4b')]));_0x5c3b69[_0x5d7d('0x56')][_0x5d7d('0x68')]=_0x33a4f1['id'];if(_0x564cb0[_0x5d7d('0x49')][_0x5d7d('0x55')]){_0x5c3b69[_0x5d7d('0x56')]=_['merge'](_0x5c3b69[_0x5d7d('0x56')],{'$or':_[_0x5d7d('0x42')](_0x5c3b69['attributes'],function(_0x51f16d){var _0x3c0129={};_0x3c0129[_0x51f16d]={'$like':'%'+_0x564cb0[_0x5d7d('0x49')]['filter']+'%'};return _0x3c0129;})});}_0x5c3b69=_['merge']({},_0x5c3b69,_0x564cb0['options']);return db['CannedAnswer'][_0x5d7d('0x34')]({'where':_0x5c3b69['where']})[_0x5d7d('0x21')](function(_0x43086f){_0x3da7a7[_0x5d7d('0x34')]=_0x43086f;if(_0x564cb0['query'][_0x5d7d('0x5a')]){_0x5c3b69['include']=[{'all':!![]}];}return db[_0x5d7d('0x6e')][_0x5d7d('0x5b')](_0x5c3b69);})['then'](function(_0x41cdc6){_0x3da7a7[_0x5d7d('0x5c')]=_0x41cdc6;return _0x3da7a7;});}})[_0x5d7d('0x21')](respondWithFilteredResult(_0x118e18,_0x5c3b69))[_0x5d7d('0x2c')](handleError(_0x118e18,null));};exports['removeAnswers']=function(_0x55476f,_0xcba146,_0x1457e6){return db[_0x5d7d('0x43')]['find']({'where':{'id':_0x55476f[_0x5d7d('0x67')]['id']}})[_0x5d7d('0x21')](handleEntityNotFound(_0xcba146,null))[_0x5d7d('0x21')](function(_0x3739f4){if(_0x3739f4){return _0x3739f4[_0x5d7d('0x6f')](_0x55476f['query'][_0x5d7d('0x6b')]);}})[_0x5d7d('0x21')](respondWithStatusCode(_0xcba146,null))['catch'](handleError(_0xcba146,null));};exports[_0x5d7d('0x70')]=function(_0x292f70,_0x59cd49,_0x1d444a){return db[_0x5d7d('0x43')][_0x5d7d('0x5f')]({'where':{'id':_0x292f70['params']['id']}})[_0x5d7d('0x21')](handleEntityNotFound(_0x59cd49,null))[_0x5d7d('0x21')](function(_0x5a00b7){if(_0x5a00b7){return _0x5a00b7[_0x5d7d('0x70')](_0x292f70['body']['ids'],_[_0x5d7d('0x71')](_0x292f70['body'],[_0x5d7d('0x6b'),'id'])||{})[_0x5d7d('0x72')](function(_0x33f36c){for(var _0x2b9156=0x0;_0x2b9156<_0x292f70['body'][_0x5d7d('0x6b')]['length'];_0x2b9156+=0x1){socket[_0x5d7d('0x73')]('userWhatsappAccount:save',{'UserId':Number(_0x292f70['body'][_0x5d7d('0x6b')][_0x2b9156]),'WhatsappAccountId':Number(_0x292f70['params']['id'])});}return _0x33f36c;});}})['then'](respondWithResult(_0x59cd49,null))[_0x5d7d('0x2c')](handleError(_0x59cd49,null));};exports[_0x5d7d('0x74')]=function(_0x1e6e9c,_0x46da61,_0x14057b){return db['WhatsappAccount'][_0x5d7d('0x5f')]({'where':{'id':_0x1e6e9c['params']['id']}})[_0x5d7d('0x21')](handleEntityNotFound(_0x46da61,null))[_0x5d7d('0x21')](function(_0x212760){if(_0x212760){return _0x212760[_0x5d7d('0x74')](_0x1e6e9c[_0x5d7d('0x49')][_0x5d7d('0x6b')])[_0x5d7d('0x21')](function(){if(_['isArray'](_0x1e6e9c[_0x5d7d('0x49')][_0x5d7d('0x6b')])){for(var _0x438159=0x0;_0x438159<_0x1e6e9c[_0x5d7d('0x49')]['ids'][_0x5d7d('0x4f')];_0x438159+=0x1){socket[_0x5d7d('0x73')](_0x5d7d('0x75'),{'UserId':Number(_0x1e6e9c['query'][_0x5d7d('0x6b')][_0x438159]),'WhatsappAccountId':Number(_0x1e6e9c[_0x5d7d('0x67')]['id'])});}}else{socket[_0x5d7d('0x73')](_0x5d7d('0x75'),{'UserId':Number(_0x1e6e9c[_0x5d7d('0x49')][_0x5d7d('0x6b')]),'WhatsappAccountId':Number(_0x1e6e9c[_0x5d7d('0x67')]['id'])});}});}})['then'](respondWithStatusCode(_0x46da61,null))[_0x5d7d('0x2c')](handleError(_0x46da61,null));};exports[_0x5d7d('0x76')]=function(_0x1f5c9c,_0x445e42,_0x477bfd){var _0xcce19d={};var _0x3c78b3={};var _0x469abc;var _0x1887cf;return db[_0x5d7d('0x43')][_0x5d7d('0x6d')]({'where':{'id':_0x1f5c9c[_0x5d7d('0x67')]['id']}})['then'](handleEntityNotFound(_0x445e42,null))[_0x5d7d('0x21')](function(_0x217105){if(_0x217105){_0x469abc=_0x217105;_0x3c78b3['model']=_['keys'](db[_0x5d7d('0x77')][_0x5d7d('0x44')]);_0x3c78b3[_0x5d7d('0x49')]=_[_0x5d7d('0x4a')](_0x1f5c9c['query']);_0x3c78b3[_0x5d7d('0x4b')]=_[_0x5d7d('0x4d')](_0x3c78b3[_0x5d7d('0x48')],_0x3c78b3[_0x5d7d('0x49')]);_0xcce19d['attributes']=_[_0x5d7d('0x4d')](_0x3c78b3['model'],qs['fields'](_0x1f5c9c['query'][_0x5d7d('0x4e')]));_0xcce19d[_0x5d7d('0x4c')]=_0xcce19d[_0x5d7d('0x4c')][_0x5d7d('0x4f')]?_0xcce19d[_0x5d7d('0x4c')]:_0x3c78b3[_0x5d7d('0x48')];_0xcce19d['order']=qs['sort'](_0x1f5c9c[_0x5d7d('0x49')][_0x5d7d('0x53')]);_0xcce19d[_0x5d7d('0x56')]=qs['filters'](_[_0x5d7d('0x54')](_0x1f5c9c[_0x5d7d('0x49')],_0x3c78b3[_0x5d7d('0x4b')]));if(_0x1f5c9c[_0x5d7d('0x49')][_0x5d7d('0x55')]){_0xcce19d['where']=_[_0x5d7d('0x57')](_0xcce19d[_0x5d7d('0x56')],{'$or':_[_0x5d7d('0x42')](_0xcce19d[_0x5d7d('0x4c')],function(_0x21eec2){var _0x380a34={};_0x380a34[_0x21eec2]={'$like':'%'+_0x1f5c9c[_0x5d7d('0x49')][_0x5d7d('0x55')]+'%'};return _0x380a34;})});}_0xcce19d=_[_0x5d7d('0x57')]({},_0xcce19d,_0x1f5c9c[_0x5d7d('0x59')]);return _0x469abc[_0x5d7d('0x76')](_0xcce19d);}})[_0x5d7d('0x21')](function(_0x10596a){if(_0x10596a){_0x1887cf=_0x10596a['length'];if(!_0x1f5c9c[_0x5d7d('0x49')][_0x5d7d('0x50')]('nolimit')){_0xcce19d[_0x5d7d('0x33')]=qs[_0x5d7d('0x33')](_0x1f5c9c[_0x5d7d('0x49')][_0x5d7d('0x33')]);_0xcce19d[_0x5d7d('0x31')]=qs[_0x5d7d('0x31')](_0x1f5c9c['query'][_0x5d7d('0x31')]);}return _0x469abc[_0x5d7d('0x76')](_0xcce19d);}})['then'](function(_0xc45c9a){if(_0xc45c9a){return _0xc45c9a?{'count':_0x1887cf,'rows':_0xc45c9a}:null;}})[_0x5d7d('0x21')](respondWithResult(_0x445e42,null))[_0x5d7d('0x2c')](handleError(_0x445e42,null));};exports['addApplications']=function(_0x204349,_0x54a4c8,_0x1368b0){return db[_0x5d7d('0x43')]['findOne']({'where':{'id':_0x204349[_0x5d7d('0x67')]['id']}})['then'](handleEntityNotFound(_0x54a4c8,null))[_0x5d7d('0x21')](function(_0x1cd781){if(_0x1cd781){return db[_0x5d7d('0x78')][_0x5d7d('0x79')](function(_0x1145e0){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x204349['params']['id']},'transaction':_0x1145e0})[_0x5d7d('0x21')](function(_0x143ae1){var _0x58cf85=_[_0x5d7d('0x42')](_0x204349['body'],function(_0x2c0cac){_0x2c0cac[_0x5d7d('0x68')]=_0x204349[_0x5d7d('0x67')]['id'];return _0x2c0cac;});return db[_0x5d7d('0x7a')][_0x5d7d('0x7b')](_0x58cf85,{'transaction':_0x1145e0});});})[_0x5d7d('0x21')](function(){return db[_0x5d7d('0x7a')][_0x5d7d('0x7c')]({'where':{'WhatsappAccountId':_0x204349[_0x5d7d('0x67')]['id']},'order':_0x5d7d('0x7d')});});}})['then'](respondWithResult(_0x54a4c8,null))['catch'](handleError(_0x54a4c8,null));};exports[_0x5d7d('0x7e')]=function(_0x30f52c,_0x53ffb6,_0x105055){var _0x22d777={};var _0x118f33={};var _0x40edaa;var _0x2fccda;return db[_0x5d7d('0x43')][_0x5d7d('0x6d')]({'where':{'id':_0x30f52c[_0x5d7d('0x67')]['id']}})[_0x5d7d('0x21')](handleEntityNotFound(_0x53ffb6,null))[_0x5d7d('0x21')](function(_0x454abf){if(_0x454abf){_0x40edaa=_0x454abf;_0x118f33['model']=_[_0x5d7d('0x4a')](db['WhatsappApplication'][_0x5d7d('0x44')]);_0x118f33[_0x5d7d('0x49')]=_[_0x5d7d('0x4a')](_0x30f52c[_0x5d7d('0x49')]);_0x118f33[_0x5d7d('0x4b')]=_[_0x5d7d('0x4d')](_0x118f33[_0x5d7d('0x48')],_0x118f33['query']);_0x22d777[_0x5d7d('0x4c')]=_[_0x5d7d('0x4d')](_0x118f33[_0x5d7d('0x48')],qs[_0x5d7d('0x4e')](_0x30f52c[_0x5d7d('0x49')][_0x5d7d('0x4e')]));_0x22d777['attributes']=_0x22d777[_0x5d7d('0x4c')]['length']?_0x22d777[_0x5d7d('0x4c')]:_0x118f33['model'];_0x22d777[_0x5d7d('0x52')]=qs[_0x5d7d('0x53')](_0x30f52c[_0x5d7d('0x49')]['sort']);_0x22d777[_0x5d7d('0x56')]=qs['filters'](_[_0x5d7d('0x54')](_0x30f52c[_0x5d7d('0x49')],_0x118f33[_0x5d7d('0x4b')]));if(_0x30f52c[_0x5d7d('0x49')][_0x5d7d('0x55')]){_0x22d777[_0x5d7d('0x56')]=_[_0x5d7d('0x57')](_0x22d777[_0x5d7d('0x56')],{'$or':_[_0x5d7d('0x42')](_0x22d777[_0x5d7d('0x4c')],function(_0x17960e){var _0x53bb46={};_0x53bb46[_0x17960e]={'$like':'%'+_0x30f52c[_0x5d7d('0x49')]['filter']+'%'};return _0x53bb46;})});}_0x22d777=_[_0x5d7d('0x57')]({},_0x22d777,_0x30f52c[_0x5d7d('0x59')]);return _0x40edaa[_0x5d7d('0x7e')](_0x22d777);}})[_0x5d7d('0x21')](function(_0x28812e){if(_0x28812e){_0x2fccda=_0x28812e['length'];if(!_0x30f52c[_0x5d7d('0x49')]['hasOwnProperty']('nolimit')){_0x22d777['limit']=qs[_0x5d7d('0x33')](_0x30f52c['query'][_0x5d7d('0x33')]);_0x22d777[_0x5d7d('0x31')]=qs['offset'](_0x30f52c[_0x5d7d('0x49')][_0x5d7d('0x31')]);}return _0x40edaa[_0x5d7d('0x7e')](_0x22d777);}})[_0x5d7d('0x21')](function(_0x2532fe){if(_0x2532fe){return _0x2532fe?{'count':_0x2fccda,'rows':_0x2532fe}:null;}})['then'](respondWithResult(_0x53ffb6,null))[_0x5d7d('0x2c')](handleError(_0x53ffb6,null));};exports[_0x5d7d('0x7f')]=function(_0x267e6b,_0x365d65,_0x297495){var _0x1a3e29={'channel':'whatsapp'};var _0x3592e8=[];var _0x260fb2=[];var _0x4a14f7={};return db['WhatsappAccount'][_0x5d7d('0x5f')]({'where':{'id':_0x267e6b[_0x5d7d('0x67')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x5d7d('0x80')}]})['then'](handleEntityNotFound(_0x365d65,null))[_0x5d7d('0x21')](function(_0x5208da){_0x1a3e29[_0x5d7d('0x81')]=_0x5208da;_0x1a3e29[_0x5d7d('0x82')]=_[_0x5d7d('0x83')](_0x5208da[_0x5d7d('0x80')],[_0x5d7d('0x7d')],[_0x5d7d('0x84')]);if(_0x1a3e29[_0x5d7d('0x81')][_0x5d7d('0x80')]){delete _0x1a3e29[_0x5d7d('0x81')]['Applications'];}return db[_0x5d7d('0x85')]['describe']();})[_0x5d7d('0x21')](function(_0xdbfa78){if(!_0xdbfa78){throw new db[(_0x5d7d('0x86'))][(_0x5d7d('0x87'))]('no\x20available\x20attributes');}_0x3592e8=_[_0x5d7d('0x88')](_[_0x5d7d('0x4a')](_0xdbfa78),[_0x5d7d('0x89'),_0x5d7d('0x8a')]);_0x260fb2=_[_0x5d7d('0x88')](_[_0x5d7d('0x4a')](_0xdbfa78),['createdAt',_0x5d7d('0x8a'),_0x5d7d('0x8b'),_0x5d7d('0x8c')]);_0x1a3e29[_0x5d7d('0x66')]={'mapKey':_0x5d7d('0x8d')};if(_0x1a3e29[_0x5d7d('0x81')][_0x5d7d('0x46')]&&_0x1a3e29[_0x5d7d('0x81')]['type']===_0x5d7d('0x8e')){_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x8f')]=_0x267e6b[_0x5d7d('0x66')][_0x5d7d('0x90')][_0x5d7d('0x91')]('whatsapp:','');_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x66')]=_0x267e6b[_0x5d7d('0x66')][_0x5d7d('0x92')];_0x1a3e29['body'][_0x5d7d('0x93')]=_0x267e6b[_0x5d7d('0x66')][_0x5d7d('0x94')];}if(_0x1a3e29[_0x5d7d('0x66')]['id']){delete _0x1a3e29['body']['id'];}if(_[_0x5d7d('0x95')](_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x8f')])){throw new db[(_0x5d7d('0x86'))][(_0x5d7d('0x87'))](_0x5d7d('0x96'));}if(_[_0x5d7d('0x95')](_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x66')])||_0x1a3e29['body']['body']===''){throw new db[(_0x5d7d('0x86'))][(_0x5d7d('0x87'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x97')])){throw new db[(_0x5d7d('0x86'))]['ValidationError'](_0x5d7d('0x98')+_0x260fb2);}if(!_[_0x5d7d('0x99')](_0x260fb2,_0x1a3e29['body'][_0x5d7d('0x97')])){throw new db[(_0x5d7d('0x86'))][(_0x5d7d('0x87'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x260fb2);}_0x4a14f7[_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x97')]]=_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x8f')];return db[_0x5d7d('0x9a')][_0x5d7d('0x5f')]({'where':{'id':_0x1a3e29[_0x5d7d('0x81')]['ListId']},'include':[{'model':db[_0x5d7d('0x85')],'as':'Contacts','where':_0x4a14f7,'limit':0x1,'order':[[_0x5d7d('0x8a'),_0x5d7d('0x9b')]]}]});})[_0x5d7d('0x21')](handleEntityNotFound(_0x365d65,null))[_0x5d7d('0x21')](function(_0x38795e){if(_0x38795e){_0x1a3e29[_0x5d7d('0x9c')]=_['omit'](_0x38795e,[_0x5d7d('0x9d')]);if(_0x38795e[_0x5d7d('0x9d')][_0x5d7d('0x4f')]){return _0x38795e[_0x5d7d('0x9d')][0x0];}var _0x239072=_['defaults'](_0x1a3e29[_0x5d7d('0x66')],{'firstName':_0x1a3e29['body'][_0x5d7d('0x8f')],'ListId':_0x38795e['id']});_0x239072[_0x1a3e29[_0x5d7d('0x66')]['mapKey']]=_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x8f')];return db['CmContact'][_0x5d7d('0x60')](_0x239072,{'fields':_0x3592e8,'raw':!![]});}})[_0x5d7d('0x21')](handleEntityNotFound(_0x365d65,null))['then'](function(_0x54c01c){if(_0x54c01c){_0x1a3e29[_0x5d7d('0x9e')]=_0x54c01c;var _0x2bf2c5={'ContactId':_0x54c01c['id'],'phone':_0x1a3e29['body'][_0x5d7d('0x8f')],'WhatsappAccountId':_0x267e6b[_0x5d7d('0x67')]['id']};var _0x3be0bf={'ContactId':_0x54c01c['id'],'WhatsappAccountId':_0x267e6b[_0x5d7d('0x67')]['id'],'closed':![]};return db[_0x5d7d('0x9f')]['find']({'where':_0x3be0bf})[_0x5d7d('0x21')](function(_0xc016b){if(_0xc016b){return[_0xc016b,![]];}return db['WhatsappInteraction'][_0x5d7d('0x60')](_0x2bf2c5)['then'](function(_0x58011c){return[_0x58011c,!![]];});});}})[_0x5d7d('0x72')](function(_0x3b5142,_0x22dd8d){_0x1a3e29[_0x5d7d('0xa0')]=_0x3b5142[_0x5d7d('0x3a')]({'plain':!![]});_0x1a3e29[_0x5d7d('0xa0')][_0x5d7d('0xa1')]=![];if(_0x22dd8d){if(_0x1a3e29['account'][_0x5d7d('0xa2')]){_0x1a3e29['applications'][_0x5d7d('0xa3')]({'id':0x0,'priority':_0x1a3e29[_0x5d7d('0x82')][_0x5d7d('0x4f')]+0x1,'app':_0x5d7d('0xa4'),'appdata':_0x5d7d('0xa5'),'interval':_0x5d7d('0xa6')});}_0x1a3e29[_0x5d7d('0xa0')][_0x5d7d('0xa1')]=!![];}return db[_0x5d7d('0xa7')][_0x5d7d('0x60')]({'phone':_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x8f')],'messageId':_0x1a3e29['body'][_0x5d7d('0x93')],'body':_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0x66')],'WhatsappAccountId':_0x267e6b[_0x5d7d('0x67')]['id'],'WhatsappInteractionId':_0x3b5142['id'],'direction':'in','ContactId':_0x3b5142[_0x5d7d('0xa8')],'AttachmentId':_0x1a3e29[_0x5d7d('0x66')][_0x5d7d('0xa9')]});})[_0x5d7d('0x21')](function(_0x5e2a7f){_0x1a3e29[_0x5d7d('0x2a')]=_0x5e2a7f;if(_0x1a3e29['interaction']['UserId']){return db[_0x5d7d('0x77')][_0x5d7d('0x5f')]({'attributes':['id','name'],'where':{'id':_0x1a3e29[_0x5d7d('0xa0')]['UserId']}})[_0x5d7d('0x21')](function(_0x92ffa8){if(_0x92ffa8){_0x1a3e29[_0x5d7d('0x82')][_0x5d7d('0xaa')]({'id':0x0,'priority':0x0,'app':_0x5d7d('0xab'),'appdata':_0x92ffa8['name']+','+(_0x1a3e29[_0x5d7d('0x81')][_0x5d7d('0xac')]||0xa),'interval':_0x5d7d('0xa6')});}return respondWithRpcPromise('Start',_0x5d7d('0xad'),_0x1a3e29);});}return respondWithRpcPromise(_0x5d7d('0xae'),_0x5d7d('0xad'),_0x1a3e29);})[_0x5d7d('0x21')](function(_0x5989ed){if(_0x5989ed){var _0x2585fd=0xc8;var _0xea286f=_0x5d7d('0xaf');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xea286f,_0x2585fd,_0x5d7d('0xb0'));logger[_0x5d7d('0x25')](_0x5d7d('0xb1'),_0xea286f,_0x2585fd,_0x5d7d('0xb0'),JSON[_0x5d7d('0x27')](_0x5989ed));if(_0x1a3e29[_0x5d7d('0x81')]['type']===_0x5d7d('0x8e')){return _0x365d65[_0x5d7d('0x2f')](_0x2585fd)[_0x5d7d('0x35')](_0x5d7d('0xb2'),_0x5d7d('0xb3'))['send'](_0x5d7d('0xb4'));}else{return _0x365d65[_0x5d7d('0x2f')](_0x2585fd)[_0x5d7d('0x30')](_0x5989ed);}}})[_0x5d7d('0x2c')](handleError(_0x365d65,null));};exports[_0x5d7d('0xb5')]=function(_0x4465b6,_0x37af2d,_0x1cece9){var _0x3fcab3,_0x67c05d,_0x4f41cf;if(_['isNil'](_0x4465b6[_0x5d7d('0x66')][_0x5d7d('0x66')])||_0x4465b6[_0x5d7d('0x66')][_0x5d7d('0x66')]===''){throw new db[(_0x5d7d('0x86'))][(_0x5d7d('0x87'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4465b6[_0x5d7d('0x66')]['to'])){throw new db[(_0x5d7d('0x86'))]['ValidationError']('to\x20is\x20mandatory');}_0x3fcab3=_0x4465b6[_0x5d7d('0x66')]['to'];return db[_0x5d7d('0x43')][_0x5d7d('0x5f')]({'where':{'id':_0x4465b6[_0x5d7d('0x67')]['id']},'include':[{'model':db[_0x5d7d('0x9a')],'as':_0x5d7d('0xb6'),'include':[{'model':db[_0x5d7d('0x85')],'as':'Contacts','where':{'mobile':_0x3fcab3},'limit':0x1,'order':[['updatedAt',_0x5d7d('0x9b')]]}]}]})[_0x5d7d('0x21')](handleEntityNotFound(_0x37af2d,null))[_0x5d7d('0x21')](function(_0x2a526f){if(_0x2a526f&&_0x2a526f['List']){_0x67c05d=_0x2a526f[_0x5d7d('0x3a')]({'plain':!![]});if(_0x67c05d[_0x5d7d('0xb6')]&&_0x67c05d[_0x5d7d('0xb6')][_0x5d7d('0x9d')]['length']){return _0x67c05d[_0x5d7d('0xb6')][_0x5d7d('0x9d')][0x0];}return db[_0x5d7d('0x85')][_0x5d7d('0x60')](_[_0x5d7d('0xb7')](_0x4465b6['body'],{'firstName':_0x3fcab3,'mobile':_0x3fcab3,'phone':_0x3fcab3,'ListId':_0x67c05d[_0x5d7d('0x8c')]}));}})['then'](handleEntityNotFound(_0x37af2d,null))[_0x5d7d('0x21')](function(_0x28428e){if(_0x28428e){_0x4f41cf=_0x28428e;return db[_0x5d7d('0x9f')]['find']({'where':{'ContactId':_0x4f41cf['id'],'closed':![],'WhatsappAccountId':_0x67c05d['id']}})[_0x5d7d('0x21')](function(_0x1ba591){if(_0x1ba591){return[_0x1ba591,![]];}return db['WhatsappInteraction'][_0x5d7d('0x60')]({'UserId':_0x4465b6[_0x5d7d('0x61')]['id'],'ContactId':_0x4f41cf['id'],'WhatsappAccountId':_0x67c05d['id'],'phone':_0x3fcab3,'firstMsgDirection':_0x5d7d('0xb8'),'Messages':[_[_0x5d7d('0x57')](_0x4465b6['body'],{'read':![],'body':_0x4465b6[_0x5d7d('0x66')][_0x5d7d('0x66')],'phone':_0x3fcab3,'WhatsappAccountId':_0x67c05d['id'],'UserId':_0x4465b6[_0x5d7d('0x61')]['id'],'ContactId':_0x4f41cf['id']})]},{'include':[{'model':db[_0x5d7d('0xa7')],'as':_0x5d7d('0xb9')}]})['then'](function(_0x2b7bfb){return[_0x2b7bfb,!![]];});});}})[_0x5d7d('0x72')](function(_0x257320,_0x5e76dc){if(_0x5e76dc){return _0x257320;}return db[_0x5d7d('0xa7')]['create'](_[_0x5d7d('0x57')](_0x4465b6['body'],{'read':![],'body':_0x4465b6[_0x5d7d('0x66')][_0x5d7d('0x66')],'phone':_0x3fcab3,'WhatsappAccountId':_0x67c05d['id'],'WhatsappInteractionId':_0x257320['id'],'UserId':_0x4465b6[_0x5d7d('0x61')]['id'],'ContactId':_0x4f41cf['id']}))[_0x5d7d('0x21')](function(_0xa2abb7){_0x257320['dataValues'][_0x5d7d('0xb9')]=[];_0x257320[_0x5d7d('0xba')]['Messages']['push'](_0xa2abb7[_0x5d7d('0xba')]);return _0x257320;});})[_0x5d7d('0x21')](respondWithResult(_0x37af2d,null))['catch'](handleError(_0x37af2d,null));}; \ No newline at end of file +var _0xb39c=['name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','VIRTUAL','filter','options','where','WhatsappAccount','includeAll','include','findAll','show','params','Pause','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','Disposition','getDispositions','findOne','WhatsappAccountId','rows','removeDispositions','ids','addAnswer','getAnswers','nolimit','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','WhatsappApplication','priority','getApplications','notify','Applications','account','orderBy','asc','CmContact','Sequelize','ValidationError','createdAt','difference','updatedAt','CompanyId','ListId','twilio','from','From','whatsapp:','messageId','MessageSid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','list','WhatsappInteraction','interaction','created','autoclose','applications','push','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','receiveMessage','entity\x20found','debug','text/xml','\x0a','to\x20is\x20mandatory','List','defaults','out','dataValues','Messages','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','WhatsappAccounts','stack'];(function(_0x24594d,_0x18cfaa){var _0x215d28=function(_0x2b4c83){while(--_0x2b4c83){_0x24594d['push'](_0x24594d['shift']());}};_0x215d28(++_0x18cfaa);}(_0xb39c,0x136));var _0xcb39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb39c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xcb39('0x0'));var rimraf=require(_0xcb39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb39('0x2'));var rp=require(_0xcb39('0x3'));var moment=require(_0xcb39('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcb39('0x5'));var path=require(_0xcb39('0x6'));var sox=require(_0xcb39('0x7'));var csv=require(_0xcb39('0x8'));var ejs=require(_0xcb39('0x9'));var fs=require('fs');var fs_extra=require(_0xcb39('0xa'));var _=require('lodash');var squel=require(_0xcb39('0xb'));var crypto=require('crypto');var jsforce=require(_0xcb39('0xc'));var deskjs=require(_0xcb39('0xd'));var toCsv=require(_0xcb39('0x8'));var querystring=require(_0xcb39('0xe'));var Papa=require(_0xcb39('0xf'));var Redis=require(_0xcb39('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcb39('0x11'));var as=require(_0xcb39('0x12'));var hardwareService=require(_0xcb39('0x13'));var logger=require('../../config/logger')(_0xcb39('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcb39('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xcb39('0x16')],{'host':_0xcb39('0x17'),'port':0x18eb});var socket=require(_0xcb39('0x18'))(new Redis(config['redis']));require(_0xcb39('0x19'))['register'](socket);var jayson=require(_0xcb39('0x1a'));var client=jayson[_0xcb39('0x1b')][_0xcb39('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x21ccf3,_0x59bd62,_0x476a9b,_0x33aa93){return new BPromise(function(_0x33b116,_0x42c261){var _0x5c8f20=_0x33aa93||client;return _0x5c8f20[_0xcb39('0x1d')](_0x21ccf3,_0x476a9b)['then'](function(_0xba33eb){logger[_0xcb39('0x1e')](_0xcb39('0x1f'),_0x59bd62,_0xcb39('0x20'));logger['debug'](_0xcb39('0x21'),_0x59bd62,_0xcb39('0x20'),JSON[_0xcb39('0x22')](_0xba33eb));if(_0xba33eb[_0xcb39('0x23')]){if(_0xba33eb[_0xcb39('0x23')][_0xcb39('0x24')]===0x1f4){logger[_0xcb39('0x23')](_0xcb39('0x1f'),_0x59bd62,_0xba33eb[_0xcb39('0x23')][_0xcb39('0x25')]);return _0x42c261(_0xba33eb['error'][_0xcb39('0x25')]);}logger[_0xcb39('0x23')](_0xcb39('0x1f'),_0x59bd62,_0xba33eb['error'][_0xcb39('0x25')]);return _0x33b116(_0xba33eb['error'][_0xcb39('0x25')]);}else{logger[_0xcb39('0x1e')](_0xcb39('0x1f'),_0x59bd62,_0xcb39('0x20'));_0x33b116(_0xba33eb[_0xcb39('0x26')][_0xcb39('0x25')]);}})[_0xcb39('0x27')](function(_0x4abef5){logger[_0xcb39('0x23')](_0xcb39('0x1f'),_0x59bd62,_0x4abef5);_0x42c261(_0x4abef5);});});}function respondWithStatusCode(_0x5d44cd,_0x79874){_0x79874=_0x79874||0xcc;return function(_0x16a436){if(_0x16a436){return _0x5d44cd[_0xcb39('0x28')](_0x79874);}return _0x5d44cd['status'](_0x79874)[_0xcb39('0x29')]();};}function respondWithResult(_0x478897,_0xcb6899){_0xcb6899=_0xcb6899||0xc8;return function(_0x3e7eed){if(_0x3e7eed){return _0x478897[_0xcb39('0x2a')](_0xcb6899)[_0xcb39('0x2b')](_0x3e7eed);}};}function respondWithFilteredResult(_0x3e7f7f,_0x11c70a){return function(_0x3807b4){if(_0x3807b4){var _0x22fb20=typeof _0x11c70a[_0xcb39('0x2c')]===_0xcb39('0x2d')&&typeof _0x11c70a[_0xcb39('0x2e')]===_0xcb39('0x2d');var _0x12560f=_0x3807b4[_0xcb39('0x2f')];var _0x5c7421=_0x22fb20?0x0:_0x11c70a['offset'];var _0x25487c=_0x22fb20?_0x3807b4[_0xcb39('0x2f')]:_0x11c70a[_0xcb39('0x2c')]+_0x11c70a[_0xcb39('0x2e')];var _0x57f21f;if(_0x25487c>=_0x12560f){_0x25487c=_0x12560f;_0x57f21f=0xc8;}else{_0x57f21f=0xce;}_0x3e7f7f[_0xcb39('0x2a')](_0x57f21f);return _0x3e7f7f[_0xcb39('0x30')](_0xcb39('0x31'),_0x5c7421+'-'+_0x25487c+'/'+_0x12560f)[_0xcb39('0x2b')](_0x3807b4);}return null;};}function patchUpdates(_0x3186c7){return function(_0x16134a){try{jsonpatch[_0xcb39('0x32')](_0x16134a,_0x3186c7,!![]);}catch(_0x3ad07e){return BPromise['reject'](_0x3ad07e);}return _0x16134a['save']();};}function saveUpdates(_0x183604,_0x1f8718){return function(_0x43d725){if(_0x43d725){return _0x43d725[_0xcb39('0x33')](_0x183604)[_0xcb39('0x34')](function(_0x54ca96){return _0x54ca96;});}return null;};}function removeEntity(_0x6a163d,_0x2f7deb){return function(_0x48e2e4){if(_0x48e2e4){return _0x48e2e4['destroy']()[_0xcb39('0x34')](function(){var _0xf910e7=_0x48e2e4[_0xcb39('0x35')]({'plain':!![]});var _0x12aa0e=_0xcb39('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x12aa0e,'resourceId':_0xf910e7['id']}})[_0xcb39('0x34')](function(){return _0x48e2e4;});})[_0xcb39('0x34')](function(){_0x6a163d[_0xcb39('0x2a')](0xcc)[_0xcb39('0x29')]();});}};}function handleEntityNotFound(_0x1b472e,_0x16f50e){return function(_0x56cc3c){if(!_0x56cc3c){_0x1b472e[_0xcb39('0x28')](0x194);}return _0x56cc3c;};}function handleError(_0x492bb5,_0x56d6ad){_0x56d6ad=_0x56d6ad||0x1f4;return function(_0x4d254a){logger[_0xcb39('0x23')](_0x4d254a[_0xcb39('0x37')]);if(_0x4d254a[_0xcb39('0x38')]){delete _0x4d254a['name'];}_0x492bb5['status'](_0x56d6ad)[_0xcb39('0x39')](_0x4d254a);};}exports[_0xcb39('0x3a')]=function(_0x2cef33,_0x11fd6b){var _0x2c281c={'include':[{'model':db['Pause'],'as':_0xcb39('0x3b')}]},_0x2ba7ab={},_0x4e7e22={'count':0x0,'rows':[]};var _0x5402b7=_[_0xcb39('0x3c')](db['WhatsappAccount'][_0xcb39('0x3d')],function(_0x6d0137){return{'name':_0x6d0137[_0xcb39('0x3e')],'type':_0x6d0137[_0xcb39('0x3f')][_0xcb39('0x40')]};});_0x2ba7ab[_0xcb39('0x41')]=_[_0xcb39('0x3c')](_0x5402b7,_0xcb39('0x38'));_0x2ba7ab[_0xcb39('0x42')]=_[_0xcb39('0x43')](_0x2cef33[_0xcb39('0x42')]);_0x2ba7ab['filters']=_['intersection'](_0x2ba7ab[_0xcb39('0x41')],_0x2ba7ab[_0xcb39('0x42')]);_0x2c281c[_0xcb39('0x44')]=_[_0xcb39('0x45')](_0x2ba7ab['model'],qs[_0xcb39('0x46')](_0x2cef33[_0xcb39('0x42')]['fields']));_0x2c281c[_0xcb39('0x44')]=_0x2c281c['attributes'][_0xcb39('0x47')]?_0x2c281c[_0xcb39('0x44')]:_0x2ba7ab[_0xcb39('0x41')];if(!_0x2cef33[_0xcb39('0x42')][_0xcb39('0x48')]('nolimit')){_0x2c281c[_0xcb39('0x2e')]=qs[_0xcb39('0x2e')](_0x2cef33[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x2c281c[_0xcb39('0x2c')]=qs['offset'](_0x2cef33[_0xcb39('0x42')][_0xcb39('0x2c')]);}_0x2c281c[_0xcb39('0x49')]=qs[_0xcb39('0x4a')](_0x2cef33[_0xcb39('0x42')][_0xcb39('0x4a')]);_0x2c281c['where']=qs[_0xcb39('0x4b')](_[_0xcb39('0x4c')](_0x2cef33[_0xcb39('0x42')],_0x2ba7ab[_0xcb39('0x4b')]),_0x5402b7);if(_0x2cef33[_0xcb39('0x42')]['filter']){_0x2c281c['where']=_['merge'](_0x2c281c['where'],{'$or':_['map'](_0x5402b7,function(_0x17279a){if(_0x17279a[_0xcb39('0x3f')]!==_0xcb39('0x4d')){var _0x2f1423={};_0x2f1423[_0x17279a[_0xcb39('0x38')]]={'$like':'%'+_0x2cef33[_0xcb39('0x42')][_0xcb39('0x4e')]+'%'};return _0x2f1423;}})});}_0x2c281c=_['merge']({},_0x2c281c,_0x2cef33[_0xcb39('0x4f')]);var _0x3b5dae={'where':_0x2c281c[_0xcb39('0x50')]};return db[_0xcb39('0x51')][_0xcb39('0x2f')](_0x3b5dae)[_0xcb39('0x34')](function(_0x14ed07){_0x4e7e22[_0xcb39('0x2f')]=_0x14ed07;if(_0x2cef33[_0xcb39('0x42')][_0xcb39('0x52')]){_0x2c281c[_0xcb39('0x53')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xcb39('0x54')](_0x2c281c);})['then'](function(_0x3b3daf){_0x4e7e22['rows']=_0x3b3daf;return _0x4e7e22;})['then'](respondWithFilteredResult(_0x11fd6b,_0x2c281c))[_0xcb39('0x27')](handleError(_0x11fd6b,null));};exports[_0xcb39('0x55')]=function(_0x2d13b5,_0x1e5aaf){var _0x198e27={'raw':![],'where':{'id':_0x2d13b5[_0xcb39('0x56')]['id']},'include':[{'model':db[_0xcb39('0x57')],'as':'mandatoryDispositionPause'}]},_0x33d0cc={};_0x33d0cc['model']=_[_0xcb39('0x43')](db['WhatsappAccount']['rawAttributes']);_0x33d0cc[_0xcb39('0x42')]=_['keys'](_0x2d13b5['query']);_0x33d0cc[_0xcb39('0x4b')]=_['intersection'](_0x33d0cc[_0xcb39('0x41')],_0x33d0cc[_0xcb39('0x42')]);_0x198e27[_0xcb39('0x44')]=_[_0xcb39('0x45')](_0x33d0cc[_0xcb39('0x41')],qs[_0xcb39('0x46')](_0x2d13b5[_0xcb39('0x42')][_0xcb39('0x46')]));_0x198e27['attributes']=_0x198e27['attributes'][_0xcb39('0x47')]?_0x198e27[_0xcb39('0x44')]:_0x33d0cc[_0xcb39('0x41')];if(_0x2d13b5[_0xcb39('0x42')][_0xcb39('0x52')]){_0x198e27[_0xcb39('0x53')]=[{'all':!![]}];}_0x198e27=_[_0xcb39('0x58')]({},_0x198e27,_0x2d13b5[_0xcb39('0x4f')]);return db[_0xcb39('0x51')]['find'](_0x198e27)[_0xcb39('0x34')](handleEntityNotFound(_0x1e5aaf,null))[_0xcb39('0x34')](respondWithResult(_0x1e5aaf,null))['catch'](handleError(_0x1e5aaf,null));};exports[_0xcb39('0x59')]=function(_0x51fbf7,_0x304aac){return db[_0xcb39('0x51')]['create'](_0x51fbf7[_0xcb39('0x5a')],{})['then'](function(_0x2a33fb){var _0x4bf8a5=_0x51fbf7[_0xcb39('0x5b')][_0xcb39('0x35')]({'plain':!![]});if(!_0x4bf8a5)throw new Error(_0xcb39('0x5c'));if(_0x4bf8a5[_0xcb39('0x5d')]===_0xcb39('0x5b')){var _0x5e6ca7=_0x2a33fb[_0xcb39('0x35')]({'plain':!![]});var _0x3a4872=_0xcb39('0x36');return db[_0xcb39('0x5e')][_0xcb39('0x5f')]({'where':{'name':_0x3a4872,'userProfileId':_0x4bf8a5[_0xcb39('0x60')]},'raw':!![]})[_0xcb39('0x34')](function(_0xbf0512){if(_0xbf0512&&_0xbf0512[_0xcb39('0x61')]===0x0){return db[_0xcb39('0x62')][_0xcb39('0x59')]({'name':_0x5e6ca7[_0xcb39('0x38')],'resourceId':_0x5e6ca7['id'],'type':_0xbf0512['name'],'sectionId':_0xbf0512['id']},{})[_0xcb39('0x34')](function(){return _0x2a33fb;});}else{return _0x2a33fb;}})[_0xcb39('0x27')](function(_0x57aa15){logger[_0xcb39('0x23')](_0xcb39('0x63'),_0x57aa15);throw _0x57aa15;});}return _0x2a33fb;})[_0xcb39('0x34')](respondWithResult(_0x304aac,0xc9))['catch'](handleError(_0x304aac,null));};exports[_0xcb39('0x33')]=function(_0x3a06c2,_0x193e21){if(_0x3a06c2['body']['id']){delete _0x3a06c2['body']['id'];}return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x3a06c2['params']['id']},'include':[{'model':db['Pause'],'as':_0xcb39('0x3b')}]})[_0xcb39('0x34')](handleEntityNotFound(_0x193e21,null))[_0xcb39('0x34')](saveUpdates(_0x3a06c2[_0xcb39('0x5a')],null))[_0xcb39('0x34')](respondWithResult(_0x193e21,null))[_0xcb39('0x27')](handleError(_0x193e21,null));};exports[_0xcb39('0x64')]=function(_0x236cd3,_0x306969){return db['WhatsappAccount'][_0xcb39('0x5f')]({'where':{'id':_0x236cd3[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x306969,null))['then'](removeEntity(_0x306969,null))[_0xcb39('0x27')](handleError(_0x306969,null));};exports[_0xcb39('0x65')]=function(_0x135177,_0x510930){return db['WhatsappAccount']['describe']()[_0xcb39('0x34')](respondWithResult(_0x510930,null))[_0xcb39('0x27')](handleError(_0x510930,null));};exports[_0xcb39('0x66')]=function(_0x2bcf45,_0x2a93fa,_0x4cfeff){if(_0x2bcf45[_0xcb39('0x5a')]['id']){delete _0x2bcf45['body']['id'];}return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x2bcf45[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x2a93fa,null))['then'](function(_0x4fa4de){if(_0x4fa4de){_0x2bcf45[_0xcb39('0x5a')]['WhatsappAccountId']=_0x4fa4de['id'];return db[_0xcb39('0x67')][_0xcb39('0x59')](_0x2bcf45[_0xcb39('0x5a')]);}})[_0xcb39('0x34')](respondWithResult(_0x2a93fa,null))['catch'](handleError(_0x2a93fa,null));};exports[_0xcb39('0x68')]=function(_0x2d1046,_0x534f82,_0x3d74b3){var _0x2db830={'raw':![],'where':{}};var _0x2bb023={};var _0x4c41e6={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcb39('0x69')]({'where':{'id':_0x2d1046['params']['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x534f82,null))['then'](function(_0x59047c){if(_0x59047c){_0x2bb023[_0xcb39('0x41')]=_[_0xcb39('0x43')](db[_0xcb39('0x67')]['rawAttributes']);_0x2bb023[_0xcb39('0x42')]=_['keys'](_0x2d1046[_0xcb39('0x42')]);_0x2bb023[_0xcb39('0x4b')]=_[_0xcb39('0x45')](_0x2bb023[_0xcb39('0x41')],_0x2bb023[_0xcb39('0x42')]);_0x2db830[_0xcb39('0x44')]=_['intersection'](_0x2bb023[_0xcb39('0x41')],qs[_0xcb39('0x46')](_0x2d1046[_0xcb39('0x42')][_0xcb39('0x46')]));_0x2db830['attributes']=_0x2db830['attributes']['length']?_0x2db830['attributes']:_0x2bb023[_0xcb39('0x41')];if(!_0x2d1046[_0xcb39('0x42')]['hasOwnProperty']('nolimit')){_0x2db830['limit']=qs[_0xcb39('0x2e')](_0x2d1046[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x2db830[_0xcb39('0x2c')]=qs[_0xcb39('0x2c')](_0x2d1046[_0xcb39('0x42')][_0xcb39('0x2c')]);}_0x2db830[_0xcb39('0x49')]=qs[_0xcb39('0x4a')](_0x2d1046[_0xcb39('0x42')][_0xcb39('0x4a')]);_0x2db830[_0xcb39('0x50')]=qs[_0xcb39('0x4b')](_['pick'](_0x2d1046[_0xcb39('0x42')],_0x2bb023[_0xcb39('0x4b')]));_0x2db830[_0xcb39('0x50')][_0xcb39('0x6a')]=_0x59047c['id'];if(_0x2d1046['query']['filter']){_0x2db830['where']=_[_0xcb39('0x58')](_0x2db830[_0xcb39('0x50')],{'$or':_[_0xcb39('0x3c')](_0x2db830[_0xcb39('0x44')],function(_0x4f966c){var _0x4078fa={};_0x4078fa[_0x4f966c]={'$like':'%'+_0x2d1046[_0xcb39('0x42')][_0xcb39('0x4e')]+'%'};return _0x4078fa;})});}_0x2db830=_['merge']({},_0x2db830,_0x2d1046[_0xcb39('0x4f')]);return db[_0xcb39('0x67')][_0xcb39('0x2f')]({'where':_0x2db830[_0xcb39('0x50')]})[_0xcb39('0x34')](function(_0xeff42b){_0x4c41e6[_0xcb39('0x2f')]=_0xeff42b;if(_0x2d1046['query']['includeAll']){_0x2db830[_0xcb39('0x53')]=[{'all':!![]}];}return db[_0xcb39('0x67')][_0xcb39('0x54')](_0x2db830);})[_0xcb39('0x34')](function(_0x440b50){_0x4c41e6[_0xcb39('0x6b')]=_0x440b50;return _0x4c41e6;});}})[_0xcb39('0x34')](respondWithFilteredResult(_0x534f82,_0x2db830))[_0xcb39('0x27')](handleError(_0x534f82,null));};exports[_0xcb39('0x6c')]=function(_0x8f4380,_0xdd9b29,_0x1dc394){return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x8f4380[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0xdd9b29,null))['then'](function(_0x57b5a4){if(_0x57b5a4){return _0x57b5a4[_0xcb39('0x6c')](_0x8f4380['query'][_0xcb39('0x6d')]);}})[_0xcb39('0x34')](respondWithStatusCode(_0xdd9b29,null))[_0xcb39('0x27')](handleError(_0xdd9b29,null));};exports[_0xcb39('0x6e')]=function(_0x322840,_0x5822d0,_0x31c810){if(_0x322840[_0xcb39('0x5a')]['id']){delete _0x322840[_0xcb39('0x5a')]['id'];}return db[_0xcb39('0x51')]['find']({'where':{'id':_0x322840[_0xcb39('0x56')]['id']}})['then'](handleEntityNotFound(_0x5822d0,null))['then'](function(_0x210586){if(_0x210586){_0x322840[_0xcb39('0x5a')]['WhatsappAccountId']=_0x210586['id'];return db['CannedAnswer']['create'](_0x322840[_0xcb39('0x5a')]);}})[_0xcb39('0x34')](respondWithResult(_0x5822d0,null))[_0xcb39('0x27')](handleError(_0x5822d0,null));};exports[_0xcb39('0x6f')]=function(_0x3c87b1,_0x2f3a39,_0x522dba){var _0x14ae87={'raw':![],'where':{}};var _0x17e110={};var _0x49f569={'count':0x0,'rows':[]};return db[_0xcb39('0x51')][_0xcb39('0x69')]({'where':{'id':_0x3c87b1[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x2f3a39,null))[_0xcb39('0x34')](function(_0x1dea57){if(_0x1dea57){_0x17e110[_0xcb39('0x41')]=_[_0xcb39('0x43')](db['CannedAnswer']['rawAttributes']);_0x17e110[_0xcb39('0x42')]=_[_0xcb39('0x43')](_0x3c87b1['query']);_0x17e110[_0xcb39('0x4b')]=_[_0xcb39('0x45')](_0x17e110[_0xcb39('0x41')],_0x17e110[_0xcb39('0x42')]);_0x14ae87['attributes']=_[_0xcb39('0x45')](_0x17e110['model'],qs[_0xcb39('0x46')](_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x46')]));_0x14ae87['attributes']=_0x14ae87[_0xcb39('0x44')]['length']?_0x14ae87['attributes']:_0x17e110['model'];if(!_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x48')](_0xcb39('0x70'))){_0x14ae87[_0xcb39('0x2e')]=qs[_0xcb39('0x2e')](_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x14ae87['offset']=qs['offset'](_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x2c')]);}_0x14ae87[_0xcb39('0x49')]=qs[_0xcb39('0x4a')](_0x3c87b1[_0xcb39('0x42')]['sort']);_0x14ae87['where']=qs[_0xcb39('0x4b')](_['pick'](_0x3c87b1['query'],_0x17e110[_0xcb39('0x4b')]));_0x14ae87[_0xcb39('0x50')]['WhatsappAccountId']=_0x1dea57['id'];if(_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x4e')]){_0x14ae87['where']=_[_0xcb39('0x58')](_0x14ae87[_0xcb39('0x50')],{'$or':_[_0xcb39('0x3c')](_0x14ae87[_0xcb39('0x44')],function(_0x142a89){var _0x4bc7a0={};_0x4bc7a0[_0x142a89]={'$like':'%'+_0x3c87b1['query'][_0xcb39('0x4e')]+'%'};return _0x4bc7a0;})});}_0x14ae87=_['merge']({},_0x14ae87,_0x3c87b1['options']);return db[_0xcb39('0x71')][_0xcb39('0x2f')]({'where':_0x14ae87[_0xcb39('0x50')]})[_0xcb39('0x34')](function(_0x4d22cd){_0x49f569[_0xcb39('0x2f')]=_0x4d22cd;if(_0x3c87b1[_0xcb39('0x42')]['includeAll']){_0x14ae87[_0xcb39('0x53')]=[{'all':!![]}];}return db[_0xcb39('0x71')]['findAll'](_0x14ae87);})[_0xcb39('0x34')](function(_0x2cf326){_0x49f569[_0xcb39('0x6b')]=_0x2cf326;return _0x49f569;});}})['then'](respondWithFilteredResult(_0x2f3a39,_0x14ae87))[_0xcb39('0x27')](handleError(_0x2f3a39,null));};exports[_0xcb39('0x72')]=function(_0x26174b,_0x2bf4f2,_0x38d113){return db['WhatsappAccount'][_0xcb39('0x5f')]({'where':{'id':_0x26174b[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x2bf4f2,null))[_0xcb39('0x34')](function(_0x2034e5){if(_0x2034e5){return _0x2034e5['removeAnswers'](_0x26174b['query'][_0xcb39('0x6d')]);}})['then'](respondWithStatusCode(_0x2bf4f2,null))[_0xcb39('0x27')](handleError(_0x2bf4f2,null));};exports[_0xcb39('0x73')]=function(_0x5ee3ce,_0x1545cb,_0x115db7){return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x5ee3ce[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x1545cb,null))['then'](function(_0x2d1380){if(_0x2d1380){return _0x2d1380['addAgents'](_0x5ee3ce[_0xcb39('0x5a')][_0xcb39('0x6d')],_[_0xcb39('0x74')](_0x5ee3ce[_0xcb39('0x5a')],[_0xcb39('0x6d'),'id'])||{})[_0xcb39('0x75')](function(_0x374873){for(var _0x1813de=0x0;_0x1813de<_0x5ee3ce['body'][_0xcb39('0x6d')]['length'];_0x1813de+=0x1){socket[_0xcb39('0x76')](_0xcb39('0x77'),{'UserId':Number(_0x5ee3ce['body'][_0xcb39('0x6d')][_0x1813de]),'WhatsappAccountId':Number(_0x5ee3ce[_0xcb39('0x56')]['id'])});}return _0x374873;});}})[_0xcb39('0x34')](respondWithResult(_0x1545cb,null))[_0xcb39('0x27')](handleError(_0x1545cb,null));};exports['removeAgents']=function(_0x440019,_0x48e695,_0x11a7f2){return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x440019[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x48e695,null))[_0xcb39('0x34')](function(_0x22cdab){if(_0x22cdab){return _0x22cdab['removeAgents'](_0x440019['query'][_0xcb39('0x6d')])[_0xcb39('0x34')](function(){if(_['isArray'](_0x440019[_0xcb39('0x42')][_0xcb39('0x6d')])){for(var _0x2c3f20=0x0;_0x2c3f20<_0x440019['query'][_0xcb39('0x6d')]['length'];_0x2c3f20+=0x1){socket[_0xcb39('0x76')](_0xcb39('0x78'),{'UserId':Number(_0x440019[_0xcb39('0x42')]['ids'][_0x2c3f20]),'WhatsappAccountId':Number(_0x440019['params']['id'])});}}else{socket[_0xcb39('0x76')](_0xcb39('0x78'),{'UserId':Number(_0x440019['query'][_0xcb39('0x6d')]),'WhatsappAccountId':Number(_0x440019['params']['id'])});}});}})[_0xcb39('0x34')](respondWithStatusCode(_0x48e695,null))[_0xcb39('0x27')](handleError(_0x48e695,null));};exports[_0xcb39('0x79')]=function(_0x1d5e52,_0xc97c0e,_0x2d4a77){var _0x4297ab={};var _0x11a00f={};var _0x51b414;var _0xc8d057;return db[_0xcb39('0x51')][_0xcb39('0x69')]({'where':{'id':_0x1d5e52['params']['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0xc97c0e,null))[_0xcb39('0x34')](function(_0x6ac93d){if(_0x6ac93d){_0x51b414=_0x6ac93d;_0x11a00f[_0xcb39('0x41')]=_[_0xcb39('0x43')](db[_0xcb39('0x7a')][_0xcb39('0x3d')]);_0x11a00f[_0xcb39('0x42')]=_[_0xcb39('0x43')](_0x1d5e52[_0xcb39('0x42')]);_0x11a00f[_0xcb39('0x4b')]=_[_0xcb39('0x45')](_0x11a00f[_0xcb39('0x41')],_0x11a00f[_0xcb39('0x42')]);_0x4297ab['attributes']=_[_0xcb39('0x45')](_0x11a00f[_0xcb39('0x41')],qs[_0xcb39('0x46')](_0x1d5e52['query'][_0xcb39('0x46')]));_0x4297ab[_0xcb39('0x44')]=_0x4297ab[_0xcb39('0x44')][_0xcb39('0x47')]?_0x4297ab[_0xcb39('0x44')]:_0x11a00f['model'];_0x4297ab[_0xcb39('0x49')]=qs[_0xcb39('0x4a')](_0x1d5e52[_0xcb39('0x42')][_0xcb39('0x4a')]);_0x4297ab[_0xcb39('0x50')]=qs[_0xcb39('0x4b')](_['pick'](_0x1d5e52[_0xcb39('0x42')],_0x11a00f[_0xcb39('0x4b')]));if(_0x1d5e52[_0xcb39('0x42')]['filter']){_0x4297ab[_0xcb39('0x50')]=_[_0xcb39('0x58')](_0x4297ab[_0xcb39('0x50')],{'$or':_['map'](_0x4297ab[_0xcb39('0x44')],function(_0x4e4cba){var _0x39218c={};_0x39218c[_0x4e4cba]={'$like':'%'+_0x1d5e52[_0xcb39('0x42')][_0xcb39('0x4e')]+'%'};return _0x39218c;})});}_0x4297ab=_[_0xcb39('0x58')]({},_0x4297ab,_0x1d5e52[_0xcb39('0x4f')]);return _0x51b414[_0xcb39('0x79')](_0x4297ab);}})[_0xcb39('0x34')](function(_0x3ca77d){if(_0x3ca77d){_0xc8d057=_0x3ca77d[_0xcb39('0x47')];if(!_0x1d5e52['query'][_0xcb39('0x48')]('nolimit')){_0x4297ab[_0xcb39('0x2e')]=qs['limit'](_0x1d5e52[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x4297ab['offset']=qs[_0xcb39('0x2c')](_0x1d5e52[_0xcb39('0x42')][_0xcb39('0x2c')]);}return _0x51b414[_0xcb39('0x79')](_0x4297ab);}})[_0xcb39('0x34')](function(_0x349dc1){if(_0x349dc1){return _0x349dc1?{'count':_0xc8d057,'rows':_0x349dc1}:null;}})[_0xcb39('0x34')](respondWithResult(_0xc97c0e,null))[_0xcb39('0x27')](handleError(_0xc97c0e,null));};exports['addApplications']=function(_0x22c204,_0x17300d,_0x4c47a9){return db[_0xcb39('0x51')][_0xcb39('0x69')]({'where':{'id':_0x22c204[_0xcb39('0x56')]['id']}})['then'](handleEntityNotFound(_0x17300d,null))['then'](function(_0x5b30a0){if(_0x5b30a0){return db[_0xcb39('0x7b')][_0xcb39('0x7c')](function(_0x26d12f){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x22c204[_0xcb39('0x56')]['id']},'transaction':_0x26d12f})['then'](function(_0x25b4e2){var _0x38d184=_[_0xcb39('0x3c')](_0x22c204[_0xcb39('0x5a')],function(_0x408b04){_0x408b04[_0xcb39('0x6a')]=_0x22c204['params']['id'];return _0x408b04;});return db['WhatsappApplication']['bulkCreate'](_0x38d184,{'transaction':_0x26d12f});});})[_0xcb39('0x34')](function(){return db[_0xcb39('0x7d')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x22c204[_0xcb39('0x56')]['id']},'order':_0xcb39('0x7e')});});}})[_0xcb39('0x34')](respondWithResult(_0x17300d,null))[_0xcb39('0x27')](handleError(_0x17300d,null));};exports['getApplications']=function(_0x2c53ee,_0x7e1b26,_0x815649){var _0x34e8cb={};var _0x1c7116={};var _0x5bbbff;var _0x361946;return db[_0xcb39('0x51')][_0xcb39('0x69')]({'where':{'id':_0x2c53ee['params']['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x7e1b26,null))[_0xcb39('0x34')](function(_0x1f0569){if(_0x1f0569){_0x5bbbff=_0x1f0569;_0x1c7116['model']=_[_0xcb39('0x43')](db[_0xcb39('0x7d')][_0xcb39('0x3d')]);_0x1c7116['query']=_[_0xcb39('0x43')](_0x2c53ee[_0xcb39('0x42')]);_0x1c7116['filters']=_['intersection'](_0x1c7116[_0xcb39('0x41')],_0x1c7116[_0xcb39('0x42')]);_0x34e8cb['attributes']=_['intersection'](_0x1c7116['model'],qs[_0xcb39('0x46')](_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x46')]));_0x34e8cb[_0xcb39('0x44')]=_0x34e8cb[_0xcb39('0x44')][_0xcb39('0x47')]?_0x34e8cb[_0xcb39('0x44')]:_0x1c7116[_0xcb39('0x41')];_0x34e8cb['order']=qs[_0xcb39('0x4a')](_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x4a')]);_0x34e8cb['where']=qs[_0xcb39('0x4b')](_[_0xcb39('0x4c')](_0x2c53ee[_0xcb39('0x42')],_0x1c7116[_0xcb39('0x4b')]));if(_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x4e')]){_0x34e8cb[_0xcb39('0x50')]=_['merge'](_0x34e8cb[_0xcb39('0x50')],{'$or':_[_0xcb39('0x3c')](_0x34e8cb[_0xcb39('0x44')],function(_0x509556){var _0x4639af={};_0x4639af[_0x509556]={'$like':'%'+_0x2c53ee['query'][_0xcb39('0x4e')]+'%'};return _0x4639af;})});}_0x34e8cb=_['merge']({},_0x34e8cb,_0x2c53ee[_0xcb39('0x4f')]);return _0x5bbbff[_0xcb39('0x7f')](_0x34e8cb);}})['then'](function(_0x103502){if(_0x103502){_0x361946=_0x103502[_0xcb39('0x47')];if(!_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x48')](_0xcb39('0x70'))){_0x34e8cb['limit']=qs[_0xcb39('0x2e')](_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x34e8cb[_0xcb39('0x2c')]=qs[_0xcb39('0x2c')](_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x2c')]);}return _0x5bbbff[_0xcb39('0x7f')](_0x34e8cb);}})[_0xcb39('0x34')](function(_0x372b35){if(_0x372b35){return _0x372b35?{'count':_0x361946,'rows':_0x372b35}:null;}})['then'](respondWithResult(_0x7e1b26,null))['catch'](handleError(_0x7e1b26,null));};exports[_0xcb39('0x80')]=function(_0x13b22a,_0x58fb25,_0x55a3e2){var _0x99194d={'channel':'whatsapp'};var _0x363ab1=[];var _0x4997be=[];var _0x26e093={};return db[_0xcb39('0x51')]['find']({'where':{'id':_0x13b22a[_0xcb39('0x56')]['id']},'include':[{'model':db[_0xcb39('0x7d')],'as':_0xcb39('0x81')}]})[_0xcb39('0x34')](handleEntityNotFound(_0x58fb25,null))['then'](function(_0x3920a2){_0x99194d[_0xcb39('0x82')]=_0x3920a2;_0x99194d['applications']=_[_0xcb39('0x83')](_0x3920a2[_0xcb39('0x81')],[_0xcb39('0x7e')],[_0xcb39('0x84')]);if(_0x99194d[_0xcb39('0x82')][_0xcb39('0x81')]){delete _0x99194d['account'][_0xcb39('0x81')];}return db[_0xcb39('0x85')][_0xcb39('0x65')]();})[_0xcb39('0x34')](function(_0x229c9e){if(!_0x229c9e){throw new db[(_0xcb39('0x86'))][(_0xcb39('0x87'))]('no\x20available\x20attributes');}_0x363ab1=_['difference'](_['keys'](_0x229c9e),[_0xcb39('0x88'),'updatedAt']);_0x4997be=_[_0xcb39('0x89')](_[_0xcb39('0x43')](_0x229c9e),[_0xcb39('0x88'),_0xcb39('0x8a'),_0xcb39('0x8b'),_0xcb39('0x8c')]);_0x99194d[_0xcb39('0x5a')]={'mapKey':'mobile'};if(_0x99194d[_0xcb39('0x82')][_0xcb39('0x3f')]&&_0x99194d[_0xcb39('0x82')][_0xcb39('0x3f')]===_0xcb39('0x8d')){_0x99194d['body'][_0xcb39('0x8e')]=_0x13b22a[_0xcb39('0x5a')][_0xcb39('0x8f')]['replace'](_0xcb39('0x90'),'');_0x99194d['body'][_0xcb39('0x5a')]=_0x13b22a[_0xcb39('0x5a')]['Body'];_0x99194d[_0xcb39('0x5a')][_0xcb39('0x91')]=_0x13b22a[_0xcb39('0x5a')][_0xcb39('0x92')];}if(_0x99194d[_0xcb39('0x5a')]['id']){delete _0x99194d[_0xcb39('0x5a')]['id'];}if(_['isNil'](_0x99194d[_0xcb39('0x5a')][_0xcb39('0x8e')])){throw new db[(_0xcb39('0x86'))][(_0xcb39('0x87'))](_0xcb39('0x93'));}if(_[_0xcb39('0x94')](_0x99194d[_0xcb39('0x5a')][_0xcb39('0x5a')])||_0x99194d['body']['body']===''){throw new db['Sequelize'][(_0xcb39('0x87'))](_0xcb39('0x95'));}if(_[_0xcb39('0x94')](_0x99194d['body']['mapKey'])){throw new db['Sequelize'][(_0xcb39('0x87'))](_0xcb39('0x96')+_0x4997be);}if(!_['includes'](_0x4997be,_0x99194d[_0xcb39('0x5a')][_0xcb39('0x97')])){throw new db['Sequelize'][(_0xcb39('0x87'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4997be);}_0x26e093[_0x99194d[_0xcb39('0x5a')][_0xcb39('0x97')]]=_0x99194d['body'][_0xcb39('0x8e')];return db[_0xcb39('0x98')][_0xcb39('0x5f')]({'where':{'id':_0x99194d['account']['ListId']},'include':[{'model':db[_0xcb39('0x85')],'as':_0xcb39('0x99'),'where':_0x26e093,'limit':0x1,'order':[[_0xcb39('0x8a'),_0xcb39('0x9a')]]}]});})[_0xcb39('0x34')](handleEntityNotFound(_0x58fb25,null))[_0xcb39('0x34')](function(_0x39fc72){if(_0x39fc72){_0x99194d[_0xcb39('0x9b')]=_[_0xcb39('0x74')](_0x39fc72,['Contacts']);if(_0x39fc72[_0xcb39('0x99')][_0xcb39('0x47')]){return _0x39fc72['Contacts'][0x0];}var _0x37fc7f=_['defaults'](_0x99194d[_0xcb39('0x5a')],{'firstName':_0x99194d[_0xcb39('0x5a')][_0xcb39('0x8e')],'ListId':_0x39fc72['id']});_0x37fc7f[_0x99194d[_0xcb39('0x5a')][_0xcb39('0x97')]]=_0x99194d['body'][_0xcb39('0x8e')];return db[_0xcb39('0x85')][_0xcb39('0x59')](_0x37fc7f,{'fields':_0x363ab1,'raw':!![]});}})['then'](handleEntityNotFound(_0x58fb25,null))[_0xcb39('0x34')](function(_0x5353c5){if(_0x5353c5){_0x99194d['contact']=_0x5353c5;var _0x56800d={'ContactId':_0x5353c5['id'],'phone':_0x99194d[_0xcb39('0x5a')]['from'],'WhatsappAccountId':_0x13b22a[_0xcb39('0x56')]['id']};var _0x34488e={'ContactId':_0x5353c5['id'],'WhatsappAccountId':_0x13b22a[_0xcb39('0x56')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xcb39('0x5f')]({'where':_0x34488e})['then'](function(_0x1584c7){if(_0x1584c7){return[_0x1584c7,![]];}return db[_0xcb39('0x9c')][_0xcb39('0x59')](_0x56800d)[_0xcb39('0x34')](function(_0x40e842){return[_0x40e842,!![]];});});}})[_0xcb39('0x75')](function(_0x252b5b,_0x139b2c){_0x99194d[_0xcb39('0x9d')]=_0x252b5b[_0xcb39('0x35')]({'plain':!![]});_0x99194d['interaction'][_0xcb39('0x9e')]=![];if(_0x139b2c){if(_0x99194d[_0xcb39('0x82')][_0xcb39('0x9f')]){_0x99194d[_0xcb39('0xa0')][_0xcb39('0xa1')]({'id':0x0,'priority':_0x99194d[_0xcb39('0xa0')]['length']+0x1,'app':'close','appdata':_0xcb39('0xa2'),'interval':'*,*,*,*'});}_0x99194d['interaction'][_0xcb39('0x9e')]=!![];}return db[_0xcb39('0xa3')][_0xcb39('0x59')]({'phone':_0x99194d[_0xcb39('0x5a')][_0xcb39('0x8e')],'messageId':_0x99194d[_0xcb39('0x5a')]['messageId'],'body':_0x99194d[_0xcb39('0x5a')]['body'],'WhatsappAccountId':_0x13b22a[_0xcb39('0x56')]['id'],'WhatsappInteractionId':_0x252b5b['id'],'direction':'in','ContactId':_0x252b5b[_0xcb39('0xa4')],'AttachmentId':_0x99194d['body'][_0xcb39('0xa5')]});})[_0xcb39('0x34')](function(_0x18b38b){_0x99194d[_0xcb39('0x25')]=_0x18b38b;if(_0x99194d[_0xcb39('0x9d')][_0xcb39('0xa6')]){return db[_0xcb39('0x7a')]['find']({'attributes':['id',_0xcb39('0x38')],'where':{'id':_0x99194d[_0xcb39('0x9d')]['UserId']}})['then'](function(_0x252535){if(_0x252535){_0x99194d[_0xcb39('0xa0')][_0xcb39('0xa7')]({'id':0x0,'priority':0x0,'app':_0xcb39('0xa8'),'appdata':_0x252535[_0xcb39('0x38')]+','+(_0x99194d[_0xcb39('0x82')][_0xcb39('0xa9')]||0xa),'interval':_0xcb39('0xaa')});}return respondWithRpcPromise('Start',_0xcb39('0xab'),_0x99194d);});}return respondWithRpcPromise('Start',_0xcb39('0xab'),_0x99194d);})['then'](function(_0x22cd88){if(_0x22cd88){var _0x2097fc=0xc8;var _0x4517c6=_0xcb39('0xac');logger['info'](_0xcb39('0x21'),_0x4517c6,_0x2097fc,_0xcb39('0xad'));logger[_0xcb39('0xae')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4517c6,_0x2097fc,_0xcb39('0xad'),JSON[_0xcb39('0x22')](_0x22cd88));if(_0x99194d[_0xcb39('0x82')][_0xcb39('0x3f')]===_0xcb39('0x8d')){return _0x58fb25[_0xcb39('0x2a')](_0x2097fc)[_0xcb39('0x30')]('Content-Type',_0xcb39('0xaf'))[_0xcb39('0x39')](_0xcb39('0xb0'));}else{return _0x58fb25[_0xcb39('0x2a')](_0x2097fc)[_0xcb39('0x2b')](_0x22cd88);}}})['catch'](handleError(_0x58fb25,null));};exports[_0xcb39('0x39')]=function(_0x1dd64b,_0x20f6e4,_0x56f1b0){var _0xdf155,_0x14c649,_0x4e110b;if(_[_0xcb39('0x94')](_0x1dd64b['body'][_0xcb39('0x5a')])||_0x1dd64b[_0xcb39('0x5a')][_0xcb39('0x5a')]===''){throw new db[(_0xcb39('0x86'))]['ValidationError'](_0xcb39('0x95'));}if(_[_0xcb39('0x94')](_0x1dd64b[_0xcb39('0x5a')]['to'])){throw new db[(_0xcb39('0x86'))][(_0xcb39('0x87'))](_0xcb39('0xb1'));}_0xdf155=_0x1dd64b[_0xcb39('0x5a')]['to'];return db['WhatsappAccount'][_0xcb39('0x5f')]({'where':{'id':_0x1dd64b[_0xcb39('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xcb39('0xb2'),'include':[{'model':db['CmContact'],'as':_0xcb39('0x99'),'where':{'mobile':_0xdf155},'limit':0x1,'order':[[_0xcb39('0x8a'),_0xcb39('0x9a')]]}]}]})[_0xcb39('0x34')](handleEntityNotFound(_0x20f6e4,null))[_0xcb39('0x34')](function(_0x2f9f80){if(_0x2f9f80&&_0x2f9f80[_0xcb39('0xb2')]){_0x14c649=_0x2f9f80[_0xcb39('0x35')]({'plain':!![]});if(_0x14c649[_0xcb39('0xb2')]&&_0x14c649['List']['Contacts'][_0xcb39('0x47')]){return _0x14c649['List']['Contacts'][0x0];}return db[_0xcb39('0x85')]['create'](_[_0xcb39('0xb3')](_0x1dd64b[_0xcb39('0x5a')],{'firstName':_0xdf155,'mobile':_0xdf155,'phone':_0xdf155,'ListId':_0x14c649[_0xcb39('0x8c')]}));}})['then'](handleEntityNotFound(_0x20f6e4,null))['then'](function(_0xd14169){if(_0xd14169){_0x4e110b=_0xd14169;return db[_0xcb39('0x9c')][_0xcb39('0x5f')]({'where':{'ContactId':_0x4e110b['id'],'closed':![],'WhatsappAccountId':_0x14c649['id']}})[_0xcb39('0x34')](function(_0x4bcfa1){if(_0x4bcfa1){return[_0x4bcfa1,![]];}return db[_0xcb39('0x9c')][_0xcb39('0x59')]({'UserId':_0x1dd64b[_0xcb39('0x5b')]['id'],'ContactId':_0x4e110b['id'],'WhatsappAccountId':_0x14c649['id'],'phone':_0xdf155,'firstMsgDirection':_0xcb39('0xb4'),'Messages':[_[_0xcb39('0x58')](_0x1dd64b[_0xcb39('0x5a')],{'read':![],'body':_0x1dd64b[_0xcb39('0x5a')][_0xcb39('0x5a')],'phone':_0xdf155,'WhatsappAccountId':_0x14c649['id'],'UserId':_0x1dd64b[_0xcb39('0x5b')]['id'],'ContactId':_0x4e110b['id']})]},{'include':[{'model':db[_0xcb39('0xa3')],'as':'Messages'}]})[_0xcb39('0x34')](function(_0x1b9883){return[_0x1b9883,!![]];});});}})[_0xcb39('0x75')](function(_0x12217b,_0x52d77){if(_0x52d77){return _0x12217b;}return db['WhatsappMessage'][_0xcb39('0x59')](_[_0xcb39('0x58')](_0x1dd64b[_0xcb39('0x5a')],{'read':![],'body':_0x1dd64b[_0xcb39('0x5a')][_0xcb39('0x5a')],'phone':_0xdf155,'WhatsappAccountId':_0x14c649['id'],'WhatsappInteractionId':_0x12217b['id'],'UserId':_0x1dd64b[_0xcb39('0x5b')]['id'],'ContactId':_0x4e110b['id']}))[_0xcb39('0x34')](function(_0x1acaa9){_0x12217b[_0xcb39('0xb5')][_0xcb39('0xb6')]=[];_0x12217b[_0xcb39('0xb5')][_0xcb39('0xb6')]['push'](_0x1acaa9['dataValues']);return _0x12217b;});})[_0xcb39('0x34')](respondWithResult(_0x20f6e4,null))[_0xcb39('0x27')](handleError(_0x20f6e4,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 63e1e0d..495efad 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 _0x7980=['WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7980,0x1af));var _0x0798=function(_0x21453e,_0x28aa12){_0x21453e=_0x21453e-0x0;var _0x8f69ff=_0x7980[_0x21453e];return _0x8f69ff;};'use strict';var EventEmitter=require(_0x0798('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x0798('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0798('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0798('0x3'),'afterDestroy':_0x0798('0x4')};function emitEvent(_0x70da99){return function(_0x1d77ec,_0x9d9b7f,_0x317207){WhatsappAccountEvents['emit'](_0x70da99+':'+_0x1d77ec['id'],_0x1d77ec);WhatsappAccountEvents[_0x0798('0x5')](_0x70da99,_0x1d77ec);_0x317207(null);};}for(var e in events){if(events[_0x0798('0x6')](e)){var event=events[e];WhatsappAccount[_0x0798('0x7')](e,emitEvent(event));}}module[_0x0798('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x3b97=['emit','hook','exports','events','../../mysqldb','WhatsappAccount','remove'];(function(_0x407883,_0xb548f){var _0x183ca2=function(_0x48f454){while(--_0x48f454){_0x407883['push'](_0x407883['shift']());}};_0x183ca2(++_0xb548f);}(_0x3b97,0xa4));var _0x73b9=function(_0x20932f,_0x3b9548){_0x20932f=_0x20932f-0x0;var _0x329ced=_0x3b97[_0x20932f];return _0x329ced;};'use strict';var EventEmitter=require(_0x73b9('0x0'));var WhatsappAccount=require(_0x73b9('0x1'))['db'][_0x73b9('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x73b9('0x3')};function emitEvent(_0x967ace){return function(_0x17465d,_0x2a6bdb,_0x22392c){WhatsappAccountEvents[_0x73b9('0x4')](_0x967ace+':'+_0x17465d['id'],_0x17465d);WhatsappAccountEvents[_0x73b9('0x4')](_0x967ace,_0x17465d);_0x22392c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x73b9('0x5')](e,emitEvent(event));}}module[_0x73b9('0x6')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 02452b6..6a3a227 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 _0x59c7=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','lodash','util'];(function(_0x2b6580,_0x577ff5){var _0x225ecc=function(_0x10358b){while(--_0x10358b){_0x2b6580['push'](_0x2b6580['shift']());}};_0x225ecc(++_0x577ff5);}(_0x59c7,0xf8));var _0x759c=function(_0x54ed48,_0x5f532a){_0x54ed48=_0x54ed48-0x0;var _0x133923=_0x59c7[_0x54ed48];return _0x133923;};'use strict';var _=require(_0x759c('0x0'));var util=require(_0x759c('0x1'));var logger=require(_0x759c('0x2'))(_0x759c('0x3'));var moment=require(_0x759c('0x4'));var BPromise=require(_0x759c('0x5'));var rp=require(_0x759c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x759c('0x7'));var config=require(_0x759c('0x8'));var attributes=require(_0x759c('0x9'));module['exports']=function(_0xeca173,_0x30bb90){return _0xeca173['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3c4=['rimraf','define','whatsapp_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0xa3c4,0xa3));var _0x4a3c=function(_0x2986b8,_0x4b0089){_0x2986b8=_0x2986b8-0x0;var _0x516c00=_0xa3c4[_0x2986b8];return _0x516c00;};'use strict';var _=require('lodash');var util=require(_0x4a3c('0x0'));var logger=require(_0x4a3c('0x1'))(_0x4a3c('0x2'));var moment=require(_0x4a3c('0x3'));var BPromise=require(_0x4a3c('0x4'));var rp=require(_0x4a3c('0x5'));var fs=require('fs');var path=require(_0x4a3c('0x6'));var rimraf=require(_0x4a3c('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x5ebf19,_0x4a60b5){return _0x5ebf19[_0x4a3c('0x8')]('WhatsappAccount',attributes,{'tableName':_0x4a3c('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 630da2c..37777c5 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 _0x0d3d=['WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','raw','options','where','attributes','include','map','model','info','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then'];(function(_0x1b1148,_0x1b395d){var _0x3ac899=function(_0x23d046){while(--_0x23d046){_0x1b1148['push'](_0x1b1148['shift']());}};_0x3ac899(++_0x1b395d);}(_0x0d3d,0x1ab));var _0xd0d3=function(_0x267b5e,_0x24abda){_0x267b5e=_0x267b5e-0x0;var _0x2e92c6=_0x0d3d[_0x267b5e];return _0x2e92c6;};'use strict';var _=require(_0xd0d3('0x0'));var util=require(_0xd0d3('0x1'));var moment=require(_0xd0d3('0x2'));var BPromise=require(_0xd0d3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0d3('0x4'))['db'];var utils=require(_0xd0d3('0x5'));var logger=require(_0xd0d3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd0d3('0x7'));var client=jayson[_0xd0d3('0x8')][_0xd0d3('0x9')]({'port':0x232a});config[_0xd0d3('0xa')]=_['defaults'](config[_0xd0d3('0xa')],{'host':_0xd0d3('0xb'),'port':0x18eb});var socket=require(_0xd0d3('0xc'))(new Redis(config['redis']));require(_0xd0d3('0xd'))[_0xd0d3('0xe')](socket);function respondWithRpcPromise(_0x3dc41b,_0x34a91a,_0x44a830){return new BPromise(function(_0x29987e,_0x38396f){return client[_0xd0d3('0xf')](_0x3dc41b,_0x44a830)[_0xd0d3('0x10')](function(_0x45a0ac){logger['info'](_0xd0d3('0x11'),_0x34a91a,_0xd0d3('0x12'));logger[_0xd0d3('0x13')](_0xd0d3('0x14'),_0x34a91a,_0xd0d3('0x12'),JSON[_0xd0d3('0x15')](_0x45a0ac));if(_0x45a0ac[_0xd0d3('0x16')]){if(_0x45a0ac[_0xd0d3('0x16')][_0xd0d3('0x17')]===0x1f4){logger[_0xd0d3('0x16')](_0xd0d3('0x11'),_0x34a91a,_0x45a0ac[_0xd0d3('0x16')][_0xd0d3('0x18')]);return _0x38396f(_0x45a0ac[_0xd0d3('0x16')]['message']);}logger['error'](_0xd0d3('0x11'),_0x34a91a,_0x45a0ac['error'][_0xd0d3('0x18')]);return _0x29987e(_0x45a0ac['error'][_0xd0d3('0x18')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x34a91a,_0xd0d3('0x12'));_0x29987e(_0x45a0ac[_0xd0d3('0x19')][_0xd0d3('0x18')]);}})[_0xd0d3('0x1a')](function(_0x3cce60){logger[_0xd0d3('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x34a91a,_0x3cce60);_0x38396f(_0x3cce60);});});}exports[_0xd0d3('0x1b')]=function(_0x2cedd7){var _0x58bd65=this;return new Promise(function(_0x406772,_0x9f8633){return db[_0xd0d3('0x1c')]['find']({'raw':_0x2cedd7['options']?_0x2cedd7['options'][_0xd0d3('0x1d')]===undefined?!![]:![]:!![],'where':_0x2cedd7[_0xd0d3('0x1e')]?_0x2cedd7[_0xd0d3('0x1e')][_0xd0d3('0x1f')]||null:null,'attributes':_0x2cedd7[_0xd0d3('0x1e')]?_0x2cedd7[_0xd0d3('0x1e')][_0xd0d3('0x20')]||null:null,'include':_0x2cedd7['options']?_0x2cedd7[_0xd0d3('0x1e')][_0xd0d3('0x21')]?_[_0xd0d3('0x22')](_0x2cedd7[_0xd0d3('0x1e')][_0xd0d3('0x21')],function(_0x3f93d9){return{'model':db[_0x3f93d9[_0xd0d3('0x23')]],'as':_0x3f93d9['as'],'attributes':_0x3f93d9[_0xd0d3('0x20')],'include':_0x3f93d9[_0xd0d3('0x21')]?_[_0xd0d3('0x22')](_0x3f93d9[_0xd0d3('0x21')],function(_0x224c22){return{'model':db[_0x224c22[_0xd0d3('0x23')]],'as':_0x224c22['as'],'attributes':_0x224c22[_0xd0d3('0x20')],'include':_0x224c22['include']?_[_0xd0d3('0x22')](_0x224c22[_0xd0d3('0x21')],function(_0x79357e){return{'model':db[_0x79357e[_0xd0d3('0x23')]],'as':_0x79357e['as'],'attributes':_0x79357e['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0d3('0x10')](function(_0x5ef5e5){logger[_0xd0d3('0x24')](_0xd0d3('0x1b'),_0x2cedd7);logger[_0xd0d3('0x13')]('ShowWhatsappAccount',_0x2cedd7,JSON[_0xd0d3('0x15')](_0x5ef5e5));_0x406772(_0x5ef5e5);})['catch'](function(_0x455cf1){logger[_0xd0d3('0x16')](_0xd0d3('0x1b'),_0x455cf1[_0xd0d3('0x18')],_0x2cedd7);_0x9f8633(_0x58bd65['error'](0x1f4,_0x455cf1[_0xd0d3('0x18')]));});});}; \ No newline at end of file +var _0x2813=['include','model','then','info','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2813,0x6e));var _0x3281=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2813[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3281('0x0'));var moment=require(_0x3281('0x1'));var BPromise=require(_0x3281('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3281('0x3'));var db=require(_0x3281('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3281('0x5'))(_0x3281('0x6'));var config=require(_0x3281('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3281('0x8')][_0x3281('0x9')]({'port':0x232a});config[_0x3281('0xa')]=_[_0x3281('0xb')](config[_0x3281('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3281('0xc'))(new Redis(config[_0x3281('0xa')]));require(_0x3281('0xd'))[_0x3281('0xe')](socket);function respondWithRpcPromise(_0x538d01,_0x5e1ffe,_0x10fb59){return new BPromise(function(_0x3f5d1a,_0x5bb4af){return client['request'](_0x538d01,_0x10fb59)['then'](function(_0x12a56a){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x5e1ffe,_0x3281('0xf'));logger['debug'](_0x3281('0x10'),_0x5e1ffe,'request\x20sent',JSON['stringify'](_0x12a56a));if(_0x12a56a['error']){if(_0x12a56a[_0x3281('0x11')]['code']===0x1f4){logger[_0x3281('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x5e1ffe,_0x12a56a[_0x3281('0x11')][_0x3281('0x12')]);return _0x5bb4af(_0x12a56a[_0x3281('0x11')][_0x3281('0x12')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5e1ffe,_0x12a56a[_0x3281('0x11')][_0x3281('0x12')]);return _0x3f5d1a(_0x12a56a[_0x3281('0x11')][_0x3281('0x12')]);}else{logger['info'](_0x3281('0x13'),_0x5e1ffe,'request\x20sent');_0x3f5d1a(_0x12a56a[_0x3281('0x14')]['message']);}})[_0x3281('0x15')](function(_0x300ef9){logger[_0x3281('0x11')](_0x3281('0x13'),_0x5e1ffe,_0x300ef9);_0x5bb4af(_0x300ef9);});});}exports[_0x3281('0x16')]=function(_0x1f8bff){var _0x3bfd4c=this;return new Promise(function(_0x216d7b,_0x264c7c){return db[_0x3281('0x17')][_0x3281('0x18')]({'raw':_0x1f8bff[_0x3281('0x19')]?_0x1f8bff[_0x3281('0x19')][_0x3281('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f8bff['options']?_0x1f8bff[_0x3281('0x19')][_0x3281('0x1b')]||null:null,'attributes':_0x1f8bff[_0x3281('0x19')]?_0x1f8bff[_0x3281('0x19')][_0x3281('0x1c')]||null:null,'include':_0x1f8bff[_0x3281('0x19')]?_0x1f8bff[_0x3281('0x19')]['include']?_[_0x3281('0x1d')](_0x1f8bff[_0x3281('0x19')][_0x3281('0x1e')],function(_0x2fbdbe){return{'model':db[_0x2fbdbe['model']],'as':_0x2fbdbe['as'],'attributes':_0x2fbdbe[_0x3281('0x1c')],'include':_0x2fbdbe[_0x3281('0x1e')]?_[_0x3281('0x1d')](_0x2fbdbe[_0x3281('0x1e')],function(_0x779a3a){return{'model':db[_0x779a3a[_0x3281('0x1f')]],'as':_0x779a3a['as'],'attributes':_0x779a3a[_0x3281('0x1c')],'include':_0x779a3a['include']?_[_0x3281('0x1d')](_0x779a3a[_0x3281('0x1e')],function(_0x480721){return{'model':db[_0x480721[_0x3281('0x1f')]],'as':_0x480721['as'],'attributes':_0x480721[_0x3281('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3281('0x20')](function(_0x10b87f){logger[_0x3281('0x21')]('ShowWhatsappAccount',_0x1f8bff);logger['debug'](_0x3281('0x16'),_0x1f8bff,JSON[_0x3281('0x22')](_0x10b87f));_0x216d7b(_0x10b87f);})[_0x3281('0x15')](function(_0x27c455){logger[_0x3281('0x11')]('ShowWhatsappAccount',_0x27c455['message'],_0x1f8bff);_0x264c7c(_0x3bfd4c[_0x3281('0x11')](0x1f4,_0x27c455[_0x3281('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index decf595..985f72e 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 _0x54b3=['./whatsappAccount.events','save','emit','register','length'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x54b3,0xaa));var _0x354b=function(_0x237309,_0x444d18){_0x237309=_0x237309-0x0;var _0x3e0df3=_0x54b3[_0x237309];return _0x3e0df3;};'use strict';var WhatsappAccountEvents=require(_0x354b('0x0'));var events=[_0x354b('0x1'),'remove','update'];function createListener(_0x27d9a1,_0x1f3647){return function(_0x187985){_0x1f3647[_0x354b('0x2')](_0x27d9a1,_0x187985);};}function removeListener(_0x4e1fd1,_0xc13d25){return function(){WhatsappAccountEvents['removeListener'](_0x4e1fd1,_0xc13d25);};}exports[_0x354b('0x3')]=function(_0x2c2527){for(var _0x4a2912=0x0,_0x3637f9=events[_0x354b('0x4')];_0x4a2912<_0x3637f9;_0x4a2912++){var _0x1232b1=events[_0x4a2912];var _0x2fe33b=createListener('whatsappAccount:'+_0x1232b1,_0x2c2527);WhatsappAccountEvents['on'](_0x1232b1,_0x2fe33b);}}; \ No newline at end of file +var _0x9917=['register','length','whatsappAccount:','./whatsappAccount.events','emit'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x9917,0x157));var _0x7991=function(_0x5e03a1,_0x5239a8){_0x5e03a1=_0x5e03a1-0x0;var _0x5308c9=_0x9917[_0x5e03a1];return _0x5308c9;};'use strict';var WhatsappAccountEvents=require(_0x7991('0x0'));var events=['save','remove','update'];function createListener(_0x53ce84,_0x14666b){return function(_0x408402){_0x14666b[_0x7991('0x1')](_0x53ce84,_0x408402);};}function removeListener(_0x44a598,_0x351998){return function(){WhatsappAccountEvents['removeListener'](_0x44a598,_0x351998);};}exports[_0x7991('0x2')]=function(_0x2d04b2){for(var _0x1d493d=0x0,_0x1c7446=events[_0x7991('0x3')];_0x1d493d<_0x1c7446;_0x1d493d++){var _0x5b7e78=events[_0x1d493d];var _0x49c310=createListener(_0x7991('0x4')+_0x5b7e78,_0x2d04b2);WhatsappAccountEvents['on'](_0x5b7e78,_0x49c310);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index b2fe21a..5ac6381 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 _0x2cbb=['get','index','/:id','show','isAuthenticated','create','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5adac7,_0x3d41c7){var _0x32041c=function(_0x245879){while(--_0x245879){_0x5adac7['push'](_0x5adac7['shift']());}};_0x32041c(++_0x3d41c7);}(_0x2cbb,0x1d9));var _0xb2cb=function(_0x5473da,_0x49396c){_0x5473da=_0x5473da-0x0;var _0x3b0928=_0x2cbb[_0x5473da];return _0x3b0928;};'use strict';var multer=require(_0xb2cb('0x0'));var util=require(_0xb2cb('0x1'));var path=require('path');var timeout=require(_0xb2cb('0x2'));var express=require(_0xb2cb('0x3'));var router=express['Router']();var fs_extra=require(_0xb2cb('0x4'));var auth=require(_0xb2cb('0x5'));var interaction=require(_0xb2cb('0x6'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router[_0xb2cb('0x7')]('/',auth['isAuthenticated'](),controller[_0xb2cb('0x8')]);router[_0xb2cb('0x7')](_0xb2cb('0x9'),auth['isAuthenticated'](),controller[_0xb2cb('0xa')]);router['post']('/',auth[_0xb2cb('0xb')](),controller[_0xb2cb('0xc')]);router['put'](_0xb2cb('0x9'),auth[_0xb2cb('0xb')](),controller[_0xb2cb('0xd')]);router[_0xb2cb('0xe')](_0xb2cb('0x9'),auth[_0xb2cb('0xb')](),controller[_0xb2cb('0xf')]);module['exports']=router; \ No newline at end of file +var _0x77dd=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','show','post','isAuthenticated','create'];(function(_0x2e2a60,_0xfd3c54){var _0x3a401e=function(_0x11a7b6){while(--_0x11a7b6){_0x2e2a60['push'](_0x2e2a60['shift']());}};_0x3a401e(++_0xfd3c54);}(_0x77dd,0xa6));var _0xd77d=function(_0x7cb10c,_0x2fcc3a){_0x7cb10c=_0x7cb10c-0x0;var _0x11df59=_0x77dd[_0x7cb10c];return _0x11df59;};'use strict';var multer=require(_0xd77d('0x0'));var util=require(_0xd77d('0x1'));var path=require(_0xd77d('0x2'));var timeout=require(_0xd77d('0x3'));var express=require(_0xd77d('0x4'));var router=express[_0xd77d('0x5')]();var fs_extra=require(_0xd77d('0x6'));var auth=require(_0xd77d('0x7'));var interaction=require(_0xd77d('0x8'));var config=require(_0xd77d('0x9'));var controller=require(_0xd77d('0xa'));router[_0xd77d('0xb')]('/',auth['isAuthenticated'](),controller[_0xd77d('0xc')]);router['get'](_0xd77d('0xd'),auth['isAuthenticated'](),controller[_0xd77d('0xe')]);router[_0xd77d('0xf')]('/',auth[_0xd77d('0x10')](),controller[_0xd77d('0x11')]);router[_0xd77d('0x12')](_0xd77d('0xd'),auth[_0xd77d('0x10')](),controller[_0xd77d('0x13')]);router[_0xd77d('0x14')]('/:id',auth[_0xd77d('0x10')](),controller[_0xd77d('0x15')]);module[_0xd77d('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index bf4610c..f850863 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 _0xb8fb=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xb8fb,0xe1));var _0xbb8f=function(_0x49e7ed,_0x1eeb00){_0x49e7ed=_0x49e7ed-0x0;var _0x489535=_0xb8fb[_0x49e7ed];return _0x489535;};'use strict';var Sequelize=require('sequelize');module[_0xbb8f('0x0')]={'priority':{'type':Sequelize[_0xbb8f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbb8f('0x2')],'allowNull':![],'defaultValue':_0xbb8f('0x3')},'appdata':{'type':Sequelize[_0xbb8f('0x4')]()},'description':{'type':Sequelize[_0xbb8f('0x2')]},'interval':{'type':Sequelize[_0xbb8f('0x2')],'defaultValue':_0xbb8f('0x5')}}; \ No newline at end of file +var _0x12bd=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x5c48c1,_0x588152){var _0x1a5618=function(_0x250537){while(--_0x250537){_0x5c48c1['push'](_0x5c48c1['shift']());}};_0x1a5618(++_0x588152);}(_0x12bd,0x19f));var _0xd12b=function(_0x4498ac,_0x30e301){_0x4498ac=_0x4498ac-0x0;var _0x4bf1b6=_0x12bd[_0x4498ac];return _0x4bf1b6;};'use strict';var Sequelize=require(_0xd12b('0x0'));module[_0xd12b('0x1')]={'priority':{'type':Sequelize[_0xd12b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd12b('0x3')],'allowNull':![],'defaultValue':_0xd12b('0x4')},'appdata':{'type':Sequelize[_0xd12b('0x5')]()},'description':{'type':Sequelize[_0xd12b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd12b('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index fb55cc6..7f5513d 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 _0x3d04=['undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','rows','catch','show','params','rawAttributes','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x43d0('0x0'));var rimraf=require(_0x43d0('0x1'));var zipdir=require(_0x43d0('0x2'));var jsonpatch=require(_0x43d0('0x3'));var rp=require(_0x43d0('0x4'));var moment=require(_0x43d0('0x5'));var BPromise=require(_0x43d0('0x6'));var Mustache=require(_0x43d0('0x7'));var util=require('util');var path=require(_0x43d0('0x8'));var sox=require(_0x43d0('0x9'));var csv=require(_0x43d0('0xa'));var ejs=require(_0x43d0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xa'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d0('0x11'))(_0x43d0('0x12'));var utils=require(_0x43d0('0x13'));var config=require(_0x43d0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d0('0x15'))['db'];function respondWithStatusCode(_0x23daaa,_0x546b23){_0x546b23=_0x546b23||0xcc;return function(_0x29773b){if(_0x29773b){return _0x23daaa[_0x43d0('0x16')](_0x546b23);}return _0x23daaa[_0x43d0('0x17')](_0x546b23)['end']();};}function respondWithResult(_0xd262a8,_0x2454fa){_0x2454fa=_0x2454fa||0xc8;return function(_0x436130){if(_0x436130){return _0xd262a8['status'](_0x2454fa)[_0x43d0('0x18')](_0x436130);}};}function respondWithFilteredResult(_0x357f87,_0x44e6ec){return function(_0x1218b5){if(_0x1218b5){var _0x91b4a1=typeof _0x44e6ec['offset']==='undefined'&&typeof _0x44e6ec[_0x43d0('0x19')]===_0x43d0('0x1a');var _0x35decf=_0x1218b5['count'];var _0x2c641e=_0x91b4a1?0x0:_0x44e6ec['offset'];var _0x2c9d06=_0x91b4a1?_0x1218b5[_0x43d0('0x1b')]:_0x44e6ec[_0x43d0('0x1c')]+_0x44e6ec['limit'];var _0x3d7dcc;if(_0x2c9d06>=_0x35decf){_0x2c9d06=_0x35decf;_0x3d7dcc=0xc8;}else{_0x3d7dcc=0xce;}_0x357f87[_0x43d0('0x17')](_0x3d7dcc);return _0x357f87['set'](_0x43d0('0x1d'),_0x2c641e+'-'+_0x2c9d06+'/'+_0x35decf)[_0x43d0('0x18')](_0x1218b5);}return null;};}function patchUpdates(_0x348429){return function(_0x248622){try{jsonpatch[_0x43d0('0x1e')](_0x248622,_0x348429,!![]);}catch(_0x28381b){return BPromise[_0x43d0('0x1f')](_0x28381b);}return _0x248622[_0x43d0('0x20')]();};}function saveUpdates(_0x30febc,_0xc8a644){return function(_0xec5f07){if(_0xec5f07){return _0xec5f07[_0x43d0('0x21')](_0x30febc)[_0x43d0('0x22')](function(_0xbc72e6){return _0xbc72e6;});}return null;};}function removeEntity(_0x2efd77,_0x48aa18){return function(_0x2c7b24){if(_0x2c7b24){return _0x2c7b24[_0x43d0('0x23')]()['then'](function(){_0x2efd77[_0x43d0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29c111,_0x44497b){return function(_0x5dd310){if(!_0x5dd310){_0x29c111[_0x43d0('0x16')](0x194);}return _0x5dd310;};}function handleError(_0x238c64,_0x5ac4c0){_0x5ac4c0=_0x5ac4c0||0x1f4;return function(_0x12df30){logger[_0x43d0('0x24')](_0x12df30[_0x43d0('0x25')]);if(_0x12df30['name']){delete _0x12df30[_0x43d0('0x26')];}_0x238c64[_0x43d0('0x17')](_0x5ac4c0)[_0x43d0('0x27')](_0x12df30);};}exports[_0x43d0('0x28')]=function(_0x37d78f,_0x440ecb){var _0x31a057={},_0x4a3cd4={},_0x2b0784={'count':0x0,'rows':[]};var _0x2f5bc5=_[_0x43d0('0x29')](db['WhatsappApplication']['rawAttributes'],function(_0x52c37b){return{'name':_0x52c37b[_0x43d0('0x2a')],'type':_0x52c37b[_0x43d0('0x2b')][_0x43d0('0x2c')]};});_0x4a3cd4[_0x43d0('0x2d')]=_[_0x43d0('0x29')](_0x2f5bc5,_0x43d0('0x26'));_0x4a3cd4['query']=_[_0x43d0('0x2e')](_0x37d78f[_0x43d0('0x2f')]);_0x4a3cd4[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],_0x4a3cd4[_0x43d0('0x2f')]);_0x31a057[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x37d78f[_0x43d0('0x2f')]['fields']));_0x31a057[_0x43d0('0x32')]=_0x31a057[_0x43d0('0x32')][_0x43d0('0x34')]?_0x31a057[_0x43d0('0x32')]:_0x4a3cd4['model'];if(!_0x37d78f[_0x43d0('0x2f')]['hasOwnProperty'](_0x43d0('0x35'))){_0x31a057[_0x43d0('0x19')]=qs['limit'](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x19')]);_0x31a057[_0x43d0('0x1c')]=qs[_0x43d0('0x1c')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x1c')]);}_0x31a057[_0x43d0('0x36')]=qs[_0x43d0('0x37')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x37')]);_0x31a057[_0x43d0('0x38')]=qs['filters'](_[_0x43d0('0x39')](_0x37d78f[_0x43d0('0x2f')],_0x4a3cd4[_0x43d0('0x30')]),_0x2f5bc5);if(_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x3a')]){_0x31a057[_0x43d0('0x38')]=_[_0x43d0('0x3b')](_0x31a057[_0x43d0('0x38')],{'$or':_[_0x43d0('0x29')](_0x2f5bc5,function(_0x43bcc5){if(_0x43bcc5[_0x43d0('0x2b')]!==_0x43d0('0x3c')){var _0x19843c={};_0x19843c[_0x43bcc5[_0x43d0('0x26')]]={'$like':'%'+_0x37d78f['query'][_0x43d0('0x3a')]+'%'};return _0x19843c;}})});}_0x31a057=_[_0x43d0('0x3b')]({},_0x31a057,_0x37d78f[_0x43d0('0x3d')]);var _0xc3f9c7={'where':_0x31a057[_0x43d0('0x38')]};return db[_0x43d0('0x3e')][_0x43d0('0x1b')](_0xc3f9c7)[_0x43d0('0x22')](function(_0x4ae965){_0x2b0784['count']=_0x4ae965;if(_0x37d78f[_0x43d0('0x2f')]['includeAll']){_0x31a057['include']=[{'all':!![]}];}return db[_0x43d0('0x3e')]['findAll'](_0x31a057);})[_0x43d0('0x22')](function(_0x5027d0){_0x2b0784[_0x43d0('0x3f')]=_0x5027d0;return _0x2b0784;})['then'](respondWithFilteredResult(_0x440ecb,_0x31a057))[_0x43d0('0x40')](handleError(_0x440ecb,null));};exports[_0x43d0('0x41')]=function(_0x468b32,_0x4e817e){var _0x3eb2e9={'raw':!![],'where':{'id':_0x468b32[_0x43d0('0x42')]['id']}},_0x520406={};_0x520406['model']=_['keys'](db[_0x43d0('0x3e')][_0x43d0('0x43')]);_0x520406['query']=_[_0x43d0('0x2e')](_0x468b32[_0x43d0('0x2f')]);_0x520406[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],_0x520406['query']);_0x3eb2e9[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x468b32['query'][_0x43d0('0x33')]));_0x3eb2e9[_0x43d0('0x32')]=_0x3eb2e9[_0x43d0('0x32')][_0x43d0('0x34')]?_0x3eb2e9[_0x43d0('0x32')]:_0x520406['model'];if(_0x468b32[_0x43d0('0x2f')][_0x43d0('0x44')]){_0x3eb2e9['include']=[{'all':!![]}];}_0x3eb2e9=_[_0x43d0('0x3b')]({},_0x3eb2e9,_0x468b32[_0x43d0('0x3d')]);return db[_0x43d0('0x3e')]['find'](_0x3eb2e9)[_0x43d0('0x22')](handleEntityNotFound(_0x4e817e,null))['then'](respondWithResult(_0x4e817e,null))[_0x43d0('0x40')](handleError(_0x4e817e,null));};exports['create']=function(_0x1f55e9,_0x269d99){return db[_0x43d0('0x3e')][_0x43d0('0x45')](_0x1f55e9[_0x43d0('0x46')],{})['then'](respondWithResult(_0x269d99,0xc9))[_0x43d0('0x40')](handleError(_0x269d99,null));};exports['update']=function(_0x5a6364,_0x3e7392){if(_0x5a6364[_0x43d0('0x46')]['id']){delete _0x5a6364[_0x43d0('0x46')]['id'];}return db[_0x43d0('0x3e')][_0x43d0('0x47')]({'where':{'id':_0x5a6364[_0x43d0('0x42')]['id']}})[_0x43d0('0x22')](handleEntityNotFound(_0x3e7392,null))[_0x43d0('0x22')](saveUpdates(_0x5a6364[_0x43d0('0x46')],null))[_0x43d0('0x22')](respondWithResult(_0x3e7392,null))[_0x43d0('0x40')](handleError(_0x3e7392,null));};exports['destroy']=function(_0x338203,_0xd78af1){return db[_0x43d0('0x3e')]['find']({'where':{'id':_0x338203[_0x43d0('0x42')]['id']}})['then'](handleEntityNotFound(_0xd78af1,null))['then'](removeEntity(_0xd78af1,null))[_0x43d0('0x40')](handleError(_0xd78af1,null));}; \ No newline at end of file +var _0x80c4=['order','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','eml-format','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','WhatsappApplication','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x56f6ea,_0x47374e){var _0x5053db=function(_0x53cb4f){while(--_0x53cb4f){_0x56f6ea['push'](_0x56f6ea['shift']());}};_0x5053db(++_0x47374e);}(_0x80c4,0xa3));var _0x480c=function(_0x1dc1bc,_0x13522c){_0x1dc1bc=_0x1dc1bc-0x0;var _0xe8656e=_0x80c4[_0x1dc1bc];return _0xe8656e;};'use strict';var emlformat=require(_0x480c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x480c('0x1'));var jsonpatch=require(_0x480c('0x2'));var rp=require(_0x480c('0x3'));var moment=require(_0x480c('0x4'));var BPromise=require(_0x480c('0x5'));var Mustache=require(_0x480c('0x6'));var util=require('util');var path=require(_0x480c('0x7'));var sox=require(_0x480c('0x8'));var csv=require(_0x480c('0x9'));var ejs=require(_0x480c('0xa'));var fs=require('fs');var fs_extra=require(_0x480c('0xb'));var _=require(_0x480c('0xc'));var squel=require(_0x480c('0xd'));var crypto=require(_0x480c('0xe'));var jsforce=require(_0x480c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x480c('0x9'));var querystring=require(_0x480c('0x10'));var Papa=require(_0x480c('0x11'));var Redis=require(_0x480c('0x12'));var authService=require(_0x480c('0x13'));var qs=require(_0x480c('0x14'));var as=require(_0x480c('0x15'));var hardwareService=require(_0x480c('0x16'));var logger=require(_0x480c('0x17'))(_0x480c('0x18'));var utils=require(_0x480c('0x19'));var config=require(_0x480c('0x1a'));var licenseUtil=require(_0x480c('0x1b'));var db=require(_0x480c('0x1c'))['db'];function respondWithStatusCode(_0x428d08,_0x3f5438){_0x3f5438=_0x3f5438||0xcc;return function(_0x376da3){if(_0x376da3){return _0x428d08[_0x480c('0x1d')](_0x3f5438);}return _0x428d08['status'](_0x3f5438)[_0x480c('0x1e')]();};}function respondWithResult(_0x29613b,_0x5efdbb){_0x5efdbb=_0x5efdbb||0xc8;return function(_0x3b48b6){if(_0x3b48b6){return _0x29613b[_0x480c('0x1f')](_0x5efdbb)[_0x480c('0x20')](_0x3b48b6);}};}function respondWithFilteredResult(_0x513f2d,_0x5ea02c){return function(_0x445635){if(_0x445635){var _0x164428=typeof _0x5ea02c[_0x480c('0x21')]===_0x480c('0x22')&&typeof _0x5ea02c[_0x480c('0x23')]==='undefined';var _0x5b5ea3=_0x445635['count'];var _0xfc8a9f=_0x164428?0x0:_0x5ea02c[_0x480c('0x21')];var _0x54750c=_0x164428?_0x445635[_0x480c('0x24')]:_0x5ea02c['offset']+_0x5ea02c[_0x480c('0x23')];var _0x1507d1;if(_0x54750c>=_0x5b5ea3){_0x54750c=_0x5b5ea3;_0x1507d1=0xc8;}else{_0x1507d1=0xce;}_0x513f2d[_0x480c('0x1f')](_0x1507d1);return _0x513f2d['set'](_0x480c('0x25'),_0xfc8a9f+'-'+_0x54750c+'/'+_0x5b5ea3)[_0x480c('0x20')](_0x445635);}return null;};}function patchUpdates(_0x9e5a12){return function(_0x5840be){try{jsonpatch[_0x480c('0x26')](_0x5840be,_0x9e5a12,!![]);}catch(_0x50bb63){return BPromise[_0x480c('0x27')](_0x50bb63);}return _0x5840be[_0x480c('0x28')]();};}function saveUpdates(_0x5b5a51,_0x3b5bca){return function(_0x3cca31){if(_0x3cca31){return _0x3cca31[_0x480c('0x29')](_0x5b5a51)[_0x480c('0x2a')](function(_0x5dbf8f){return _0x5dbf8f;});}return null;};}function removeEntity(_0x1bc75c,_0x241901){return function(_0x5288f5){if(_0x5288f5){return _0x5288f5[_0x480c('0x2b')]()[_0x480c('0x2a')](function(){_0x1bc75c[_0x480c('0x1f')](0xcc)[_0x480c('0x1e')]();});}};}function handleEntityNotFound(_0x12445d,_0x7f067f){return function(_0x4008ff){if(!_0x4008ff){_0x12445d[_0x480c('0x1d')](0x194);}return _0x4008ff;};}function handleError(_0x72e37b,_0x40def3){_0x40def3=_0x40def3||0x1f4;return function(_0x1363ef){logger['error'](_0x1363ef['stack']);if(_0x1363ef[_0x480c('0x2c')]){delete _0x1363ef['name'];}_0x72e37b['status'](_0x40def3)['send'](_0x1363ef);};}exports['index']=function(_0x4451fe,_0x6019aa){var _0x337816={},_0x377e5c={},_0x592c2b={'count':0x0,'rows':[]};var _0x4a54b2=_['map'](db[_0x480c('0x2d')][_0x480c('0x2e')],function(_0x5c56e5){return{'name':_0x5c56e5[_0x480c('0x2f')],'type':_0x5c56e5['type']['key']};});_0x377e5c[_0x480c('0x30')]=_[_0x480c('0x31')](_0x4a54b2,_0x480c('0x2c'));_0x377e5c[_0x480c('0x32')]=_[_0x480c('0x33')](_0x4451fe[_0x480c('0x32')]);_0x377e5c[_0x480c('0x34')]=_[_0x480c('0x35')](_0x377e5c['model'],_0x377e5c['query']);_0x337816[_0x480c('0x36')]=_[_0x480c('0x35')](_0x377e5c['model'],qs[_0x480c('0x37')](_0x4451fe[_0x480c('0x32')][_0x480c('0x37')]));_0x337816[_0x480c('0x36')]=_0x337816[_0x480c('0x36')][_0x480c('0x38')]?_0x337816[_0x480c('0x36')]:_0x377e5c[_0x480c('0x30')];if(!_0x4451fe[_0x480c('0x32')][_0x480c('0x39')](_0x480c('0x3a'))){_0x337816[_0x480c('0x23')]=qs[_0x480c('0x23')](_0x4451fe[_0x480c('0x32')][_0x480c('0x23')]);_0x337816['offset']=qs[_0x480c('0x21')](_0x4451fe[_0x480c('0x32')][_0x480c('0x21')]);}_0x337816[_0x480c('0x3b')]=qs['sort'](_0x4451fe[_0x480c('0x32')][_0x480c('0x3c')]);_0x337816['where']=qs[_0x480c('0x34')](_['pick'](_0x4451fe[_0x480c('0x32')],_0x377e5c[_0x480c('0x34')]),_0x4a54b2);if(_0x4451fe[_0x480c('0x32')]['filter']){_0x337816[_0x480c('0x3d')]=_[_0x480c('0x3e')](_0x337816[_0x480c('0x3d')],{'$or':_[_0x480c('0x31')](_0x4a54b2,function(_0x588669){if(_0x588669[_0x480c('0x3f')]!==_0x480c('0x40')){var _0x21877b={};_0x21877b[_0x588669[_0x480c('0x2c')]]={'$like':'%'+_0x4451fe[_0x480c('0x32')]['filter']+'%'};return _0x21877b;}})});}_0x337816=_['merge']({},_0x337816,_0x4451fe[_0x480c('0x41')]);var _0x2b5003={'where':_0x337816[_0x480c('0x3d')]};return db[_0x480c('0x2d')]['count'](_0x2b5003)[_0x480c('0x2a')](function(_0x30d983){_0x592c2b[_0x480c('0x24')]=_0x30d983;if(_0x4451fe[_0x480c('0x32')][_0x480c('0x42')]){_0x337816[_0x480c('0x43')]=[{'all':!![]}];}return db[_0x480c('0x2d')]['findAll'](_0x337816);})[_0x480c('0x2a')](function(_0x4ca83c){_0x592c2b[_0x480c('0x44')]=_0x4ca83c;return _0x592c2b;})[_0x480c('0x2a')](respondWithFilteredResult(_0x6019aa,_0x337816))['catch'](handleError(_0x6019aa,null));};exports[_0x480c('0x45')]=function(_0x2aad21,_0x4bee28){var _0xa5e32d={'raw':!![],'where':{'id':_0x2aad21[_0x480c('0x46')]['id']}},_0x4d62fb={};_0x4d62fb[_0x480c('0x30')]=_[_0x480c('0x33')](db['WhatsappApplication'][_0x480c('0x2e')]);_0x4d62fb[_0x480c('0x32')]=_[_0x480c('0x33')](_0x2aad21[_0x480c('0x32')]);_0x4d62fb[_0x480c('0x34')]=_[_0x480c('0x35')](_0x4d62fb[_0x480c('0x30')],_0x4d62fb[_0x480c('0x32')]);_0xa5e32d[_0x480c('0x36')]=_[_0x480c('0x35')](_0x4d62fb[_0x480c('0x30')],qs['fields'](_0x2aad21[_0x480c('0x32')]['fields']));_0xa5e32d[_0x480c('0x36')]=_0xa5e32d['attributes'][_0x480c('0x38')]?_0xa5e32d[_0x480c('0x36')]:_0x4d62fb[_0x480c('0x30')];if(_0x2aad21[_0x480c('0x32')][_0x480c('0x42')]){_0xa5e32d['include']=[{'all':!![]}];}_0xa5e32d=_[_0x480c('0x3e')]({},_0xa5e32d,_0x2aad21['options']);return db[_0x480c('0x2d')][_0x480c('0x47')](_0xa5e32d)['then'](handleEntityNotFound(_0x4bee28,null))['then'](respondWithResult(_0x4bee28,null))[_0x480c('0x48')](handleError(_0x4bee28,null));};exports['create']=function(_0x2649e0,_0x2c1ca6){return db[_0x480c('0x2d')]['create'](_0x2649e0['body'],{})['then'](respondWithResult(_0x2c1ca6,0xc9))[_0x480c('0x48')](handleError(_0x2c1ca6,null));};exports['update']=function(_0x3d7b08,_0x1ec5a2){if(_0x3d7b08[_0x480c('0x49')]['id']){delete _0x3d7b08[_0x480c('0x49')]['id'];}return db['WhatsappApplication'][_0x480c('0x47')]({'where':{'id':_0x3d7b08[_0x480c('0x46')]['id']}})[_0x480c('0x2a')](handleEntityNotFound(_0x1ec5a2,null))[_0x480c('0x2a')](saveUpdates(_0x3d7b08[_0x480c('0x49')],null))[_0x480c('0x2a')](respondWithResult(_0x1ec5a2,null))[_0x480c('0x48')](handleError(_0x1ec5a2,null));};exports[_0x480c('0x2b')]=function(_0x5d5668,_0x41c2d3){return db[_0x480c('0x2d')]['find']({'where':{'id':_0x5d5668['params']['id']}})[_0x480c('0x2a')](handleEntityNotFound(_0x41c2d3,null))['then'](removeEntity(_0x41c2d3,null))['catch'](handleError(_0x41c2d3,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index f93a2fa..4f97fa6 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 _0x64f5=['path','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise'];(function(_0x59b48b,_0x584733){var _0x4c3f79=function(_0x3f2e94){while(--_0x3f2e94){_0x59b48b['push'](_0x59b48b['shift']());}};_0x4c3f79(++_0x584733);}(_0x64f5,0x17e));var _0x564f=function(_0x1a7de0,_0x2517f0){_0x1a7de0=_0x1a7de0-0x0;var _0x12838d=_0x64f5[_0x1a7de0];return _0x12838d;};'use strict';var _=require(_0x564f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x564f('0x1'));var BPromise=require('bluebird');var rp=require(_0x564f('0x2'));var fs=require('fs');var path=require(_0x564f('0x3'));var rimraf=require('rimraf');var config=require(_0x564f('0x4'));var attributes=require(_0x564f('0x5'));module[_0x564f('0x6')]=function(_0x72b009,_0x4bbedf){return _0x72b009['define'](_0x564f('0x7'),attributes,{'tableName':_0x564f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x564f('0x9'),'collate':_0x564f('0xa')});}; \ No newline at end of file +var _0x19da=['exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x220ed6,_0x58fd75){var _0x38ee49=function(_0x222c27){while(--_0x222c27){_0x220ed6['push'](_0x220ed6['shift']());}};_0x38ee49(++_0x58fd75);}(_0x19da,0x9f));var _0xa19d=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x19da[_0x1778e1];return _0x2bc4c6;};'use strict';var _=require('lodash');var util=require(_0xa19d('0x0'));var logger=require('../../config/logger')(_0xa19d('0x1'));var moment=require('moment');var BPromise=require(_0xa19d('0x2'));var rp=require(_0xa19d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa19d('0x4'));var config=require(_0xa19d('0x5'));var attributes=require('./whatsappApplication.attributes');module[_0xa19d('0x6')]=function(_0x330adb,_0x1f6e10){return _0x330adb[_0xa19d('0x7')](_0xa19d('0x8'),attributes,{'tableName':_0xa19d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa19d('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index ad9574a..c7c66f2 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 _0xd2ea=['../../config/environment','jayson/promise','client','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4562cf,_0x1948e5){var _0xddbbad=function(_0x35ab74){while(--_0x35ab74){_0x4562cf['push'](_0x4562cf['shift']());}};_0xddbbad(++_0x1948e5);}(_0xd2ea,0x15f));var _0xad2e=function(_0x3d06ec,_0x54ca45){_0x3d06ec=_0x3d06ec-0x0;var _0x17700e=_0xd2ea[_0x3d06ec];return _0x17700e;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5170,_0x3e3d1f,_0x2ff7b2){return new BPromise(function(_0x5710ac,_0x1e0e9e){return client[_0xad2e('0xc')](_0x3b5170,_0x2ff7b2)['then'](function(_0x1eed2f){logger['info'](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));logger[_0xad2e('0xf')](_0xad2e('0x10'),_0x3e3d1f,'request\x20sent',JSON[_0xad2e('0x11')](_0x1eed2f));if(_0x1eed2f['error']){if(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x13')]===0x1f4){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0x1eed2f['error'][_0xad2e('0x14')]);return _0x1e0e9e(_0x1eed2f['error'][_0xad2e('0x14')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x3e3d1f,_0x1eed2f['error']['message']);return _0x5710ac(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x14')]);}else{logger[_0xad2e('0x15')](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));_0x5710ac(_0x1eed2f[_0xad2e('0x16')][_0xad2e('0x14')]);}})[_0xad2e('0x17')](function(_0xd40b31){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0xd40b31);_0x1e0e9e(_0xd40b31);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x399290,_0x1c758b){var _0x2163d0=function(_0xa3a4fd){while(--_0xa3a4fd){_0x399290['push'](_0x399290['shift']());}};_0x2163d0(++_0x1c758b);}(_0x55ca,0x126));var _0xa55c=function(_0x16cb4b,_0x481b00){_0x16cb4b=_0x16cb4b-0x0;var _0x2e1bd8=_0x55ca[_0x16cb4b];return _0x2e1bd8;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\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/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 046e3c3..b127cf7 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 _0x41fe=['addMessage','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','getMessages','download','post','create','/:id/messages'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x41fe,0xd1));var _0xe41f=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x41fe[_0x29db36];return _0x234e87;};'use strict';var multer=require(_0xe41f('0x0'));var util=require(_0xe41f('0x1'));var path=require(_0xe41f('0x2'));var timeout=require(_0xe41f('0x3'));var express=require(_0xe41f('0x4'));var router=express[_0xe41f('0x5')]();var fs_extra=require(_0xe41f('0x6'));var auth=require(_0xe41f('0x7'));var interaction=require(_0xe41f('0x8'));var config=require(_0xe41f('0x9'));var controller=require(_0xe41f('0xa'));router[_0xe41f('0xb')]('/',auth[_0xe41f('0xc')](),controller[_0xe41f('0xd')]);router[_0xe41f('0xb')](_0xe41f('0xe'),auth[_0xe41f('0xc')](),controller['describe']);router[_0xe41f('0xb')](_0xe41f('0xf'),auth['isAuthenticated'](),controller[_0xe41f('0x10')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xe41f('0x11')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xe41f('0x12')]);router[_0xe41f('0x13')]('/',auth[_0xe41f('0xc')](),controller[_0xe41f('0x14')]);router[_0xe41f('0x13')](_0xe41f('0x15'),auth[_0xe41f('0xc')](),controller[_0xe41f('0x16')]);router[_0xe41f('0x13')](_0xe41f('0x17'),auth['isAuthenticated'](),interaction[_0xe41f('0x18')](_0xe41f('0x19'),'whatsappinteraction:addtags'),controller[_0xe41f('0x1a')]);router[_0xe41f('0x1b')](_0xe41f('0xf'),auth[_0xe41f('0xc')](),interaction[_0xe41f('0x18')](_0xe41f('0x19'),_0xe41f('0x1c')),controller['update']);router['delete'](_0xe41f('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0xe41f('0x19'),_0xe41f('0x1d')),controller[_0xe41f('0x1e')]);router[_0xe41f('0x1f')](_0xe41f('0x17'),auth['isAuthenticated'](),controller[_0xe41f('0x20')]);module['exports']=router; \ No newline at end of file +var _0x199c=['tracked','whatsapp','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','/:id/tags'];(function(_0x367195,_0x2a7d8d){var _0x2be48f=function(_0xb2a17a){while(--_0xb2a17a){_0x367195['push'](_0x367195['shift']());}};_0x2be48f(++_0x2a7d8d);}(_0x199c,0x1d8));var _0xc199=function(_0x232a6c,_0x22572e){_0x232a6c=_0x232a6c-0x0;var _0x17cf55=_0x199c[_0x232a6c];return _0x17cf55;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc199('0x0'));var timeout=require(_0xc199('0x1'));var express=require(_0xc199('0x2'));var router=express[_0xc199('0x3')]();var fs_extra=require(_0xc199('0x4'));var auth=require(_0xc199('0x5'));var interaction=require(_0xc199('0x6'));var config=require(_0xc199('0x7'));var controller=require('./whatsappInteraction.controller');router[_0xc199('0x8')]('/',auth[_0xc199('0x9')](),controller['index']);router['get'](_0xc199('0xa'),auth[_0xc199('0x9')](),controller[_0xc199('0xb')]);router[_0xc199('0x8')](_0xc199('0xc'),auth[_0xc199('0x9')](),controller[_0xc199('0xd')]);router[_0xc199('0x8')]('/:id/messages',auth[_0xc199('0x9')](),controller[_0xc199('0xe')]);router[_0xc199('0x8')](_0xc199('0xf'),auth[_0xc199('0x9')](),controller[_0xc199('0x10')]);router['post']('/',auth[_0xc199('0x9')](),controller[_0xc199('0x11')]);router[_0xc199('0x12')](_0xc199('0x13'),auth[_0xc199('0x9')](),controller['addMessage']);router[_0xc199('0x12')](_0xc199('0x14'),auth[_0xc199('0x9')](),interaction[_0xc199('0x15')](_0xc199('0x16'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xc199('0x17')]('/:id',auth[_0xc199('0x9')](),interaction[_0xc199('0x15')]('whatsapp',_0xc199('0x18')),controller['update']);router[_0xc199('0x19')](_0xc199('0xc'),auth[_0xc199('0x9')](),interaction[_0xc199('0x15')](_0xc199('0x16'),_0xc199('0x1a')),controller[_0xc199('0x1b')]);router[_0xc199('0x19')](_0xc199('0x14'),auth[_0xc199('0x9')](),controller[_0xc199('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 60ba657..5ab1803 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 _0x95f4=['DATE','ENUM','out','sequelize','moment','exports','STRING'];(function(_0x2c969e,_0x2192c8){var _0x4c0c97=function(_0x479d27){while(--_0x479d27){_0x2c969e['push'](_0x2c969e['shift']());}};_0x4c0c97(++_0x2192c8);}(_0x95f4,0xf1));var _0x495f=function(_0x304ca2,_0x5bbb93){_0x304ca2=_0x304ca2-0x0;var _0x245f5a=_0x95f4[_0x304ca2];return _0x245f5a;};'use strict';var Sequelize=require(_0x495f('0x0'));var moment=require(_0x495f('0x1'));module[_0x495f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x495f('0x3')]},'secondDisposition':{'type':Sequelize[_0x495f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x495f('0x3')]},'read1stAt':{'type':Sequelize[_0x495f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x495f('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x495f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x495f('0x5')]('in',_0x495f('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc21c=['out','sequelize','moment','BOOLEAN','DATE','STRING','ENUM'];(function(_0x104ed4,_0x4580d4){var _0x139c0d=function(_0x5e8e6b){while(--_0x5e8e6b){_0x104ed4['push'](_0x104ed4['shift']());}};_0x139c0d(++_0x4580d4);}(_0xc21c,0x166));var _0xcc21=function(_0x269065,_0x48e752){_0x269065=_0x269065-0x0;var _0x5908d3=_0xc21c[_0x269065];return _0x5908d3;};'use strict';var Sequelize=require(_0xcc21('0x0'));var moment=require(_0xcc21('0x1'));module['exports']={'closed':{'type':Sequelize[_0xcc21('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc21('0x3')]},'disposition':{'type':Sequelize[_0xcc21('0x4')]},'secondDisposition':{'type':Sequelize[_0xcc21('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcc21('0x4')]},'phone':{'type':Sequelize[_0xcc21('0x4')]},'read1stAt':{'type':Sequelize[_0xcc21('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcc21('0x5')]('in',_0xcc21('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcc21('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcc21('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcc21('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 9fd8a3c..cd604d7 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 _0xff98=['field','from','select','u.id','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','isEmpty','WhatsappAccountId','concat','createdAt','$gte','parse','$lte','null','\x20IS\x20NULL','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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','rows','show','params','includeAll','include','options','create','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','merge','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','color','emit','whatsappInteractionTags:save','removeTags','download','unix','server','tmp','join','root','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','direction','secret','WhatsappAccount','Account','mkdirSync','Whatsapp','Owner','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','update','destroy','then','error','name','send','map','fullname','TagIds','split','forEach','Tags','push','catch','index','WhatsappInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x46f4a3,_0x95aaa2){var _0x331372=function(_0x28d257){while(--_0x28d257){_0x46f4a3['push'](_0x46f4a3['shift']());}};_0x331372(++_0x95aaa2);}(_0xff98,0x9c));var _0x8ff9=function(_0x4ce341,_0x233020){_0x4ce341=_0x4ce341-0x0;var _0x49a3f1=_0xff98[_0x4ce341];return _0x49a3f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ff9('0x0'));var zipdir=require(_0x8ff9('0x1'));var jsonpatch=require(_0x8ff9('0x2'));var rp=require(_0x8ff9('0x3'));var moment=require('moment');var BPromise=require(_0x8ff9('0x4'));var Mustache=require('mustache');var util=require(_0x8ff9('0x5'));var path=require('path');var sox=require(_0x8ff9('0x6'));var csv=require('to-csv');var ejs=require(_0x8ff9('0x7'));var fs=require('fs');var fs_extra=require(_0x8ff9('0x8'));var _=require(_0x8ff9('0x9'));var squel=require(_0x8ff9('0xa'));var crypto=require(_0x8ff9('0xb'));var jsforce=require(_0x8ff9('0xc'));var deskjs=require(_0x8ff9('0xd'));var toCsv=require(_0x8ff9('0xe'));var querystring=require('querystring');var Papa=require(_0x8ff9('0xf'));var Redis=require(_0x8ff9('0x10'));var authService=require(_0x8ff9('0x11'));var qs=require(_0x8ff9('0x12'));var as=require(_0x8ff9('0x13'));var pdf=require(_0x8ff9('0x14'));var hardwareService=require(_0x8ff9('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8ff9('0x16'));var licenseUtil=require(_0x8ff9('0x17'));var db=require(_0x8ff9('0x18'))['db'];config['redis']=_[_0x8ff9('0x19')](config[_0x8ff9('0x1a')],{'host':_0x8ff9('0x1b'),'port':0x18eb});var socket=require(_0x8ff9('0x1c'))(new Redis(config[_0x8ff9('0x1a')]));require(_0x8ff9('0x1d'))[_0x8ff9('0x1e')](socket);function respondWithStatusCode(_0x4d2d7b,_0x882a5c){_0x882a5c=_0x882a5c||0xcc;return function(_0x25ca31){if(_0x25ca31){return _0x4d2d7b[_0x8ff9('0x1f')](_0x882a5c);}return _0x4d2d7b['status'](_0x882a5c)[_0x8ff9('0x20')]();};}function respondWithResult(_0x52ff51,_0x3e62ef){_0x3e62ef=_0x3e62ef||0xc8;return function(_0x578fe3){if(_0x578fe3){return _0x52ff51['status'](_0x3e62ef)['json'](_0x578fe3);}};}function respondWithFilteredResult(_0x5745ff,_0x20d149){return function(_0x2dedbc){if(_0x2dedbc){var _0xad903b=typeof _0x20d149[_0x8ff9('0x21')]===_0x8ff9('0x22')&&typeof _0x20d149[_0x8ff9('0x23')]===_0x8ff9('0x22');var _0x4fca7b=_0x2dedbc[_0x8ff9('0x24')];var _0x16e436=_0xad903b?0x0:_0x20d149[_0x8ff9('0x21')];var _0x47eb4d=_0xad903b?_0x2dedbc[_0x8ff9('0x24')]:_0x20d149[_0x8ff9('0x21')]+_0x20d149[_0x8ff9('0x23')];var _0x27c965;if(_0x47eb4d>=_0x4fca7b){_0x47eb4d=_0x4fca7b;_0x27c965=0xc8;}else{_0x27c965=0xce;}_0x5745ff[_0x8ff9('0x25')](_0x27c965);return _0x5745ff[_0x8ff9('0x26')](_0x8ff9('0x27'),_0x16e436+'-'+_0x47eb4d+'/'+_0x4fca7b)[_0x8ff9('0x28')](_0x2dedbc);}return null;};}function patchUpdates(_0x26018c){return function(_0x2eb92d){try{jsonpatch[_0x8ff9('0x29')](_0x2eb92d,_0x26018c,!![]);}catch(_0x2979b0){return BPromise[_0x8ff9('0x2a')](_0x2979b0);}return _0x2eb92d['save']();};}function saveUpdates(_0x4de8b5,_0x343eb1){return function(_0x5f188a){if(_0x5f188a){return _0x5f188a[_0x8ff9('0x2b')](_0x4de8b5)['then'](function(_0x27f154){return _0x27f154;});}return null;};}function removeEntity(_0x469786,_0x279240){return function(_0x2bf341){if(_0x2bf341){return _0x2bf341[_0x8ff9('0x2c')]()[_0x8ff9('0x2d')](function(){_0x469786[_0x8ff9('0x25')](0xcc)[_0x8ff9('0x20')]();});}};}function handleEntityNotFound(_0x40df52,_0x1207b2){return function(_0x4ccd5e){if(!_0x4ccd5e){_0x40df52[_0x8ff9('0x1f')](0x194);}return _0x4ccd5e;};}function handleError(_0x1228e2,_0x3b89ec){_0x3b89ec=_0x3b89ec||0x1f4;return function(_0x1a921a){logger[_0x8ff9('0x2e')](_0x1a921a['stack']);if(_0x1a921a[_0x8ff9('0x2f')]){delete _0x1a921a['name'];}_0x1228e2[_0x8ff9('0x25')](_0x3b89ec)[_0x8ff9('0x30')](_0x1a921a);};}function getInteractionUsers(_0x1c6676,_0x2d9cf4){return new BPromise(function(_0x26ec22,_0x12e0da){try{if(_0x2d9cf4[_0x1c6676['id']]){_0x1c6676['Users']=_[_0x8ff9('0x31')](_0x2d9cf4[_0x1c6676['id']],function(_0x2e034a){return{'id':_0x2e034a['id'],'fullname':_0x2e034a[_0x8ff9('0x32')]};});}}catch(_0xff972b){_0x12e0da(_0xff972b);}_0x26ec22(_0x1c6676);});}function getInteractionTags(_0x33a10d,_0x216a84){return new BPromise(function(_0x4b4782,_0x4f1f13){try{if(_0x33a10d[_0x8ff9('0x33')]){_0x33a10d['Tags']=[];_0x33a10d[_0x8ff9('0x33')][_0x8ff9('0x34')](',')[_0x8ff9('0x35')](function(_0x15b099){_0x33a10d[_0x8ff9('0x36')][_0x8ff9('0x37')](_0x216a84[_0x15b099]);});}delete _0x33a10d['TagIds'];}catch(_0x3e9168){_0x4f1f13(_0x3e9168);}_0x4b4782(_0x33a10d);});}function updateWhatsappInteraction(_0x4407a7,_0x1a88cc,_0x4236e2){return new BPromise(function(_0x52d3e6,_0x25bd1f){return getInteractionUsers(_0x4407a7,_0x4236e2)[_0x8ff9('0x2d')](function(_0x1dc393){return getInteractionTags(_0x1dc393,_0x1a88cc);})[_0x8ff9('0x2d')](function(_0x3d4f55){_0x52d3e6(_0x3d4f55);})[_0x8ff9('0x38')](function(_0x2a761){_0x25bd1f(_0x2a761);});});}exports[_0x8ff9('0x39')]=function(_0x5ac4b1,_0x2a7443){var _0x28f118={},_0x51e677={},_0x5227ee={'count':0x0,'rows':[]};var _0x3f7fee=_[_0x8ff9('0x31')](db[_0x8ff9('0x3a')][_0x8ff9('0x3b')],function(_0x41c069){return{'name':_0x41c069['fieldName'],'type':_0x41c069[_0x8ff9('0x3c')][_0x8ff9('0x3d')]};});_0x51e677[_0x8ff9('0x3e')]=_[_0x8ff9('0x31')](_0x3f7fee,_0x8ff9('0x2f'));_0x51e677[_0x8ff9('0x3f')]=_[_0x8ff9('0x40')](_0x5ac4b1[_0x8ff9('0x3f')]);_0x51e677[_0x8ff9('0x41')]=_[_0x8ff9('0x42')](_0x51e677[_0x8ff9('0x3e')],_0x51e677[_0x8ff9('0x3f')]);_0x28f118[_0x8ff9('0x43')]=_[_0x8ff9('0x42')](_0x51e677[_0x8ff9('0x3e')],qs[_0x8ff9('0x44')](_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x44')]));_0x28f118[_0x8ff9('0x43')]=_0x28f118['attributes']['length']?_0x28f118[_0x8ff9('0x43')]:_0x51e677[_0x8ff9('0x3e')];if(!_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x45')](_0x8ff9('0x46'))){_0x28f118[_0x8ff9('0x23')]=qs[_0x8ff9('0x23')](_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x23')]);_0x28f118[_0x8ff9('0x21')]=qs[_0x8ff9('0x21')](_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x21')]);}_0x28f118[_0x8ff9('0x47')]=qs[_0x8ff9('0x48')](_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x48')]);_0x28f118[_0x8ff9('0x49')]=qs['filters'](_[_0x8ff9('0x4a')](_0x5ac4b1[_0x8ff9('0x3f')],_0x51e677[_0x8ff9('0x41')]),_0x3f7fee);var _0x4d0f50=[];var _0x3d58f3=squel['select']()[_0x8ff9('0x4b')]('id')['field']('name')[_0x8ff9('0x4b')]('color')[_0x8ff9('0x4c')]('tools_tags');var _0x38c1cd=squel[_0x8ff9('0x4d')]()[_0x8ff9('0x4b')](_0x8ff9('0x4e'))[_0x8ff9('0x4b')]('u.fullname')['field'](_0x8ff9('0x4f'))['from']('user_has_whatsapp_interactions','ui')['left_join'](_0x8ff9('0x50'),'u',_0x8ff9('0x51'));var _0x3a464d=squel[_0x8ff9('0x4d')]()['from'](_0x8ff9('0x52'),'i')[_0x8ff9('0x53')](_0x8ff9('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8ff9('0x53')]('users','o',_0x8ff9('0x55'))[_0x8ff9('0x53')](_0x8ff9('0x56'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x8ff9('0x53')](_0x8ff9('0x57'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x8ff9('0x53')]('whatsapp_interaction_has_tags','it',_0x8ff9('0x58'))[_0x8ff9('0x53')](_0x8ff9('0x59'),'t','t.id\x20=\x20it.TagId');var _0x4c4f24=squel[_0x8ff9('0x5a')]();var _0xa0a61b=[];var _0x5d66a6=squel[_0x8ff9('0x5a')]();var _0x138dce;if(_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x5b')]){_0x138dce=as['parseSearch'](_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x5b')]);var _0x45cf02=_0x138dce[_0x8ff9('0x5c')];for(var _0x16608d=0x0;_0x16608d<_0x138dce[_0x8ff9('0x5d')]['length'];_0x16608d++){var _0x11918a=_0x138dce[_0x8ff9('0x5d')][_0x16608d];var _0x32e844='i';var _0x287e76=_['find'](_0x3f7fee,[_0x8ff9('0x2f'),_0x11918a[_0x8ff9('0x4b')]]);if(!_0x287e76){switch(_0x11918a['field']){case'unreadMessages':if(_0x11918a['value']==0x1){_0x3a464d[_0x8ff9('0x5e')]('`'+_0x11918a[_0x8ff9('0x4b')]+_0x8ff9('0x5f'));}else{_0x3a464d[_0x8ff9('0x5e')]('`'+_0x11918a[_0x8ff9('0x4b')]+_0x8ff9('0x60'));}break;case _0x8ff9('0x61'):if(_0x11918a[_0x8ff9('0x62')]===_0x8ff9('0x63')){if(_0x11918a['value'][_0x8ff9('0x34')]('\x20')[_0x8ff9('0x64')]>0x1){_0x4c4f24[_0x45cf02]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8ff9('0x65')](_0x11918a[_0x8ff9('0x66')]),null);}else{var _0x3835c6='%'+_0x11918a[_0x8ff9('0x66')]+'%';_0x4c4f24[_0x45cf02](_0x8ff9('0x67'),_0x3835c6,_0x3835c6,_0x3835c6);}}else{_0x287e76=_[_0x8ff9('0x68')](_0x3f7fee,[_0x8ff9('0x2f'),_0x8ff9('0x69')]);_0x11918a[_0x8ff9('0x4b')]=_0x8ff9('0x69');_0x265b94=as[_0x8ff9('0x6a')](_0x32e844,_0x287e76[_0x8ff9('0x3c')],_0x11918a);_0x4c4f24[_0x45cf02](_0x265b94[_0x8ff9('0x6b')],_0x265b94[_0x8ff9('0x66')][_0x8ff9('0x6c')],_0x265b94[_0x8ff9('0x66')][_0x8ff9('0x20')]);}break;case _0x8ff9('0x6d'):var _0x4b6b45=_0x11918a[_0x8ff9('0x66')][_0x8ff9('0x34')](',')[_0x8ff9('0x31')](function(_0x441562){return Number(_0x441562);});_0x4b6b45['forEach'](function(_0x30d91e){_0x5d66a6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x30d91e+',%');});_0xa0a61b=_[_0x8ff9('0x6e')](_0xa0a61b,_0x4b6b45);break;case _0x8ff9('0x6f'):if(_0x11918a['operator']==='$substring'){_0x4c4f24[_0x45cf02](_0x8ff9('0x70'),'%'+_0x11918a['value']+'%',null);}else{_0x287e76=_[_0x8ff9('0x68')](_0x3f7fee,[_0x8ff9('0x2f'),_0x8ff9('0x71')]);_0x11918a['field']='UserId';_0x265b94=as[_0x8ff9('0x6a')](_0x32e844,_0x287e76[_0x8ff9('0x3c')],_0x11918a);_0x4c4f24[_0x45cf02](_0x265b94[_0x8ff9('0x6b')],_0x265b94[_0x8ff9('0x66')][_0x8ff9('0x6c')],_0x265b94[_0x8ff9('0x66')][_0x8ff9('0x20')]);}break;case'body':_0x265b94=as[_0x8ff9('0x6a')]('me',null,_0x11918a);_0x4c4f24[_0x45cf02](_0x265b94[_0x8ff9('0x6b')],_0x265b94[_0x8ff9('0x66')][_0x8ff9('0x6c')],_0x265b94['value'][_0x8ff9('0x20')]);break;}}else{var _0x265b94=as[_0x8ff9('0x6a')](_0x32e844,_0x287e76[_0x8ff9('0x3c')],_0x11918a);_0x4c4f24[_0x45cf02](_0x265b94[_0x8ff9('0x6b')],_0x265b94[_0x8ff9('0x66')][_0x8ff9('0x6c')],_0x265b94[_0x8ff9('0x66')][_0x8ff9('0x20')]);}}}else{var _0x1ea344=_(_0x5ac4b1[_0x8ff9('0x3f')])[_0x8ff9('0x40')]()['map'](function(_0x58f02c){return _['some'](_0x3f7fee,[_0x8ff9('0x2f'),_0x58f02c])?_0x58f02c:undefined;})[_0x8ff9('0x72')]()[_0x8ff9('0x66')]();if(!_[_0x8ff9('0x73')](_0x1ea344)){_0x1ea344['forEach'](function(_0x20582a){if(_0x20582a===_0x8ff9('0x74')){_0x3a464d['where']('i.WhatsappAccountId\x20IN\x20?',[][_0x8ff9('0x75')](_0x5ac4b1[_0x8ff9('0x3f')][_0x20582a]));}else if(_0x20582a===_0x8ff9('0x76')){var _0x27cbfb=JSON['parse'](_0x5ac4b1[_0x8ff9('0x3f')][_0x20582a])[_0x8ff9('0x77')];var _0x3ad002=JSON[_0x8ff9('0x78')](_0x5ac4b1[_0x8ff9('0x3f')][_0x20582a])[_0x8ff9('0x79')];_0x3a464d[_0x8ff9('0x49')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x27cbfb,_0x3ad002);}else{if(_0x5ac4b1[_0x8ff9('0x3f')][_0x20582a]===_0x8ff9('0x7a')){_0x3a464d[_0x8ff9('0x49')]('i.'+_0x20582a+_0x8ff9('0x7b'));}else{_0x3a464d['where']('i.'+_0x20582a+'\x20=\x20?',_0x5ac4b1[_0x8ff9('0x3f')][_0x20582a]);}}});}if(_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x7c')]){if(_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x7c')]==0x1){_0x3a464d[_0x8ff9('0x5e')](_0x8ff9('0x7d'));}else{_0x3a464d[_0x8ff9('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x7e')]){_0xa0a61b=_[_0x8ff9('0x7f')](_0x5ac4b1[_0x8ff9('0x3f')]['tag'])?_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x7e')]:new Array(_0x5ac4b1['query'][_0x8ff9('0x7e')]);_0xa0a61b[_0x8ff9('0x35')](function(_0x2bbf86){_0x5d66a6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2bbf86+',%');});}if(_0x5ac4b1['query'][_0x8ff9('0x80')]){var _0x51c4cd=_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x80')]['replace']('\x5c','\x5c\x5c')[_0x8ff9('0x81')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x51c4cd)){_0x4c4f24['or'](_0x8ff9('0x82'),_0x51c4cd+'%')['or'](_0x8ff9('0x83'),_0x51c4cd+'%');}else{_0x4c4f24['or'](_0x8ff9('0x84'),qs[_0x8ff9('0x65')](_0x51c4cd))['or'](_0x8ff9('0x85'),_0x51c4cd+'%');}}}_0x3a464d['where'](_0x4c4f24);_0x3a464d['group'](_0x8ff9('0x86'));var _0x34aca1={'type':db[_0x8ff9('0x87')]['QueryTypes'][_0x8ff9('0x88')],'raw':!![]};var _0x3d2510=_0x3a464d[_0x8ff9('0x89')]();_0x3d2510[_0x8ff9('0x4b')](_0x8ff9('0x86'));_0x3d2510[_0x8ff9('0x4b')](_0x8ff9('0x8a'),_0x8ff9('0x8b'));if(_0x28f118['order']){_0x28f118['order'][_0x8ff9('0x35')](function(_0x842165){var _0x280952=_0x842165[0x0]===_0x8ff9('0x8c')?_0x842165[0x0]:'i.'+_0x842165[0x0];_0x3a464d[_0x8ff9('0x47')](_0x280952,_0x842165[0x1]===_0x8ff9('0x8d')?![]:!![]);});}if(!_[_0x8ff9('0x73')](_0xa0a61b)){_0x3a464d[_0x8ff9('0x5e')](_0x5d66a6);_0x3d2510[_0x8ff9('0x49')]('t.id\x20IN\x20?',_0xa0a61b);}BPromise[_0x8ff9('0x8e')]()['then'](function(){if(!_0x138dce){if(_0x5ac4b1[_0x8ff9('0x3f')]['WhatsappAccountId'])return;_0x3d2510[_0x8ff9('0x49')](_0x8ff9('0x8f'));_0x3a464d['where'](_0x8ff9('0x8f'));return;}if(_0x5ac4b1[_0x8ff9('0x90')][_0x8ff9('0x91')]!==_0x8ff9('0x92'))return;return _0x5ac4b1[_0x8ff9('0x90')][_0x8ff9('0x93')]({'attributes':['id'],'raw':!![]})['then'](function(_0x57fa8c){if(_[_0x8ff9('0x73')](_0x57fa8c)){_0x3d2510['where'](_0x8ff9('0x94'));_0x3a464d[_0x8ff9('0x49')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3d2510[_0x8ff9('0x49')]('i.WhatsappAccountId\x20IN\x20?',_[_0x8ff9('0x31')](_0x57fa8c,'id'));_0x3a464d[_0x8ff9('0x49')]('i.WhatsappAccountId\x20IN\x20?',_[_0x8ff9('0x31')](_0x57fa8c,'id'));}});})['then'](function(){if(_0x5ac4b1['user'][_0x8ff9('0x91')]===_0x8ff9('0x92')&&!_0x138dce&&!_0x5ac4b1[_0x8ff9('0x3f')][_0x8ff9('0x74')])return[];return db[_0x8ff9('0x95')][_0x8ff9('0x3f')](_0x3d2510[_0x8ff9('0x96')](),_0x34aca1);})[_0x8ff9('0x2d')](function(_0xa8b80c){_0x5227ee[_0x8ff9('0x24')]=_0xa8b80c[_0x8ff9('0x64')];if(_0x5227ee[_0x8ff9('0x24')]===0x0)return[];return db[_0x8ff9('0x95')][_0x8ff9('0x3f')](_0x3d58f3['toString'](),_0x34aca1)[_0x8ff9('0x2d')](function(_0x3d9216){_0x4d0f50=_[_0x8ff9('0x97')](_0x3d9216,'id');_0x34aca1=_['merge'](_0x34aca1,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ac4b1['query']['fields']){_0x28f118[_0x8ff9('0x43')]['forEach'](function(_0x10d513){_0x3a464d[_0x8ff9('0x4b')]('i.'+_0x10d513);});}else{_0x3a464d[_0x8ff9('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3a464d['field'](_0x8ff9('0x98'),_0x8ff9('0x99'));_0x3a464d[_0x8ff9('0x4b')]('a.mandatoryDisposition',_0x8ff9('0x9a'));_0x3a464d['field'](_0x8ff9('0x9b'),_0x8ff9('0x8c'));_0x3a464d[_0x8ff9('0x4b')](_0x8ff9('0x9c'));_0x3a464d[_0x8ff9('0x4b')]('c.firstName',_0x8ff9('0x9d'));_0x3a464d[_0x8ff9('0x4b')](_0x8ff9('0x9e'),'Contact.lastName');_0x3a464d[_0x8ff9('0x4b')]('c.email',_0x8ff9('0x9f'));_0x3a464d[_0x8ff9('0x4b')]('c.phone',_0x8ff9('0xa0'));_0x3a464d[_0x8ff9('0x4b')](_0x8ff9('0xa1'),_0x8ff9('0xa2'));_0x3a464d[_0x8ff9('0x4b')](_0x8ff9('0xa3'),_0x8ff9('0xa4'));_0x3a464d[_0x8ff9('0x4b')](_0x8ff9('0xa5'),_0x8ff9('0xa6'));_0x3a464d[_0x8ff9('0x4b')](_0x8ff9('0xa7'),_0x8ff9('0xa8'));_0x3a464d[_0x8ff9('0x4b')](_0x8ff9('0xa9'),_0x8ff9('0x33'));}if(_0x28f118[_0x8ff9('0x23')])_0x3a464d[_0x8ff9('0x23')](_0x28f118[_0x8ff9('0x23')]);if(_0x28f118[_0x8ff9('0x21')])_0x3a464d[_0x8ff9('0x21')](_0x28f118['offset']);return db[_0x8ff9('0x95')][_0x8ff9('0x3f')](_0x3a464d[_0x8ff9('0x96')](),_0x34aca1);})[_0x8ff9('0x2d')](function(_0xc98ba2){if(_0xc98ba2[_0x8ff9('0x64')]>0x0)_0x38c1cd['where'](_0x8ff9('0xaa'),_[_0x8ff9('0x31')](_0xc98ba2,'id'));return db['sequelize'][_0x8ff9('0x3f')](_0x38c1cd['toString'](),_0x34aca1)[_0x8ff9('0x2d')](function(_0x116195){var _0x265125=_[_0x8ff9('0xab')](_0x116195,_0x8ff9('0xac'));var _0x79e9d3=[];_0xc98ba2[_0x8ff9('0x35')](function(_0x1d3836){_0x79e9d3['push'](updateWhatsappInteraction(_0x1d3836,_0x4d0f50,_0x265125));});return BPromise['all'](_0x79e9d3);});});})[_0x8ff9('0x2d')](function(_0x20c99c){_0x5227ee[_0x8ff9('0xad')]=_0x20c99c;return _0x5227ee;})[_0x8ff9('0x2d')](respondWithFilteredResult(_0x2a7443,_0x28f118))[_0x8ff9('0x38')](handleError(_0x2a7443,null));};exports[_0x8ff9('0xae')]=function(_0x29aacd,_0x1a1200){var _0x322a5c={'raw':![],'where':{'id':_0x29aacd[_0x8ff9('0xaf')]['id']}},_0x124feb={};_0x124feb[_0x8ff9('0x3e')]=_[_0x8ff9('0x40')](db[_0x8ff9('0x3a')]['rawAttributes']);_0x124feb[_0x8ff9('0x3f')]=_[_0x8ff9('0x40')](_0x29aacd['query']);_0x124feb['filters']=_[_0x8ff9('0x42')](_0x124feb[_0x8ff9('0x3e')],_0x124feb[_0x8ff9('0x3f')]);_0x322a5c[_0x8ff9('0x43')]=_[_0x8ff9('0x42')](_0x124feb['model'],qs[_0x8ff9('0x44')](_0x29aacd[_0x8ff9('0x3f')][_0x8ff9('0x44')]));_0x322a5c[_0x8ff9('0x43')]=_0x322a5c['attributes'][_0x8ff9('0x64')]?_0x322a5c[_0x8ff9('0x43')]:_0x124feb['model'];if(_0x29aacd['query'][_0x8ff9('0xb0')]){_0x322a5c[_0x8ff9('0xb1')]=[{'all':!![]}];}_0x322a5c=_['merge']({},_0x322a5c,_0x29aacd[_0x8ff9('0xb2')]);return db[_0x8ff9('0x3a')]['find'](_0x322a5c)[_0x8ff9('0x2d')](handleEntityNotFound(_0x1a1200,null))[_0x8ff9('0x2d')](respondWithResult(_0x1a1200,null))['catch'](handleError(_0x1a1200,null));};exports[_0x8ff9('0xb3')]=function(_0x23effd,_0x53e6f8){return db[_0x8ff9('0x3a')][_0x8ff9('0xb3')](_0x23effd[_0x8ff9('0xb4')],{})[_0x8ff9('0x2d')](respondWithResult(_0x53e6f8,0xc9))[_0x8ff9('0x38')](handleError(_0x53e6f8,null));};exports[_0x8ff9('0x2b')]=function(_0x1e3e62,_0x4e4ec8){if(_0x1e3e62[_0x8ff9('0xb4')]['id']){delete _0x1e3e62[_0x8ff9('0xb4')]['id'];}return db[_0x8ff9('0x3a')][_0x8ff9('0x68')]({'where':{'id':_0x1e3e62[_0x8ff9('0xaf')]['id']}})[_0x8ff9('0x2d')](handleEntityNotFound(_0x4e4ec8,null))[_0x8ff9('0x2d')](saveUpdates(_0x1e3e62['body'],null))[_0x8ff9('0x2d')](respondWithResult(_0x4e4ec8,null))[_0x8ff9('0x38')](handleError(_0x4e4ec8,null));};exports[_0x8ff9('0x2c')]=function(_0x5706a2,_0x145948){return db[_0x8ff9('0x3a')][_0x8ff9('0x68')]({'where':{'id':_0x5706a2[_0x8ff9('0xaf')]['id']}})[_0x8ff9('0x2d')](handleEntityNotFound(_0x145948,null))['then'](removeEntity(_0x145948,null))['catch'](handleError(_0x145948,null));};exports[_0x8ff9('0xb5')]=function(_0x5abd36,_0xce3f8d){return db[_0x8ff9('0x3a')]['describe']()['then'](respondWithResult(_0xce3f8d,null))['catch'](handleError(_0xce3f8d,null));};exports[_0x8ff9('0xb6')]=function(_0x1309bd,_0x35a931,_0x3f9add){return db[_0x8ff9('0xb7')][_0x8ff9('0x68')]({'where':{'id':_0x1309bd[_0x8ff9('0xaf')]['id']}})[_0x8ff9('0x2d')](handleEntityNotFound(_0x35a931,null))[_0x8ff9('0x2d')](function(_0x47c2d5){if(_0x47c2d5){return _0x47c2d5[_0x8ff9('0xb6')](_0x1309bd[_0x8ff9('0xb4')][_0x8ff9('0xb8')],_[_0x8ff9('0xb9')](_0x1309bd[_0x8ff9('0xb4')],[_0x8ff9('0xb8'),'id'])||{});}})[_0x8ff9('0x2d')](respondWithResult(_0x35a931,null))[_0x8ff9('0x38')](handleError(_0x35a931,null));};exports[_0x8ff9('0xba')]=function(_0x1b3d88,_0x1d9581,_0x8bdb8d){var _0x1e73df={'raw':![],'where':{}};var _0xd921e8={};var _0x11ef0f={'count':0x0,'rows':[]};return db[_0x8ff9('0x3a')][_0x8ff9('0xbb')]({'where':{'id':_0x1b3d88[_0x8ff9('0xaf')]['id']}})[_0x8ff9('0x2d')](handleEntityNotFound(_0x1d9581,null))[_0x8ff9('0x2d')](function(_0x547e28){if(_0x547e28){_0xd921e8[_0x8ff9('0x3e')]=_[_0x8ff9('0x40')](db[_0x8ff9('0xb7')][_0x8ff9('0x3b')]);_0xd921e8[_0x8ff9('0x3f')]=_['keys'](_0x1b3d88['query']);_0xd921e8[_0x8ff9('0x41')]=_[_0x8ff9('0x42')](_0xd921e8[_0x8ff9('0x3e')],_0xd921e8[_0x8ff9('0x3f')]);_0x1e73df[_0x8ff9('0x43')]=_[_0x8ff9('0x42')](_0xd921e8[_0x8ff9('0x3e')],qs['fields'](_0x1b3d88[_0x8ff9('0x3f')][_0x8ff9('0x44')]));_0x1e73df[_0x8ff9('0x43')]=_0x1e73df['attributes']['length']?_0x1e73df[_0x8ff9('0x43')]:_0xd921e8[_0x8ff9('0x3e')];if(!_0x1b3d88[_0x8ff9('0x3f')]['hasOwnProperty'](_0x8ff9('0x46'))){_0x1e73df['limit']=qs['limit'](_0x1b3d88[_0x8ff9('0x3f')][_0x8ff9('0x23')]);_0x1e73df['offset']=qs['offset'](_0x1b3d88[_0x8ff9('0x3f')][_0x8ff9('0x21')]);}_0x1e73df[_0x8ff9('0x47')]=qs[_0x8ff9('0x48')](_0x1b3d88['query']['sort']);_0x1e73df[_0x8ff9('0x49')]=qs['filters'](_[_0x8ff9('0x4a')](_0x1b3d88[_0x8ff9('0x3f')],_0xd921e8[_0x8ff9('0x41')]));_0x1e73df[_0x8ff9('0x49')][_0x8ff9('0xac')]=_0x547e28['id'];if(_0x1b3d88[_0x8ff9('0x3f')][_0x8ff9('0x80')]){_0x1e73df['where']=_[_0x8ff9('0xbc')](_0x1e73df[_0x8ff9('0x49')],{'$or':_['map'](_0x1e73df[_0x8ff9('0x43')],function(_0x3917bb){var _0x3cb32b={};_0x3cb32b[_0x3917bb]={'$like':'%'+_0x1b3d88[_0x8ff9('0x3f')][_0x8ff9('0x80')]+'%'};return _0x3cb32b;})});}if(_0x1b3d88[_0x8ff9('0x3f')][_0x8ff9('0x77')]){var _0x20128f=_0x1b3d88[_0x8ff9('0x3f')]['$gte'][_0x8ff9('0x34')](',');var _0x2f3acc={};_0x2f3acc[_0x20128f[0x0]]={'$gte':moment(_0x20128f[0x1])[_0x8ff9('0xbd')](_0x8ff9('0xbe'))};_0x1e73df[_0x8ff9('0x49')]=_[_0x8ff9('0xbc')](_0x1e73df['where'],_0x2f3acc);}_0x1e73df=_[_0x8ff9('0xbc')]({},_0x1e73df,_0x1b3d88[_0x8ff9('0xb2')]);return db[_0x8ff9('0xb7')][_0x8ff9('0x24')]({'where':_0x1e73df[_0x8ff9('0x49')]})[_0x8ff9('0x2d')](function(_0x3cc6ab){_0x11ef0f['count']=_0x3cc6ab;if(_0x1b3d88[_0x8ff9('0x3f')]['includeAll']){_0x1e73df[_0x8ff9('0xb1')]=[{'all':!![]}];}return db[_0x8ff9('0xb7')][_0x8ff9('0xbf')](_0x1e73df);})[_0x8ff9('0x2d')](function(_0x394539){_0x11ef0f[_0x8ff9('0xad')]=_0x394539;return _0x11ef0f;});}})['then'](respondWithFilteredResult(_0x1d9581,_0x1e73df))['catch'](handleError(_0x1d9581,null));};exports[_0x8ff9('0xc0')]=function(_0x278ba9,_0x50debf,_0x159fb5){return db[_0x8ff9('0x3a')][_0x8ff9('0x68')]({'where':{'id':_0x278ba9[_0x8ff9('0xaf')]['id']}})[_0x8ff9('0x2d')](handleEntityNotFound(_0x50debf,null))['then'](function(_0x28c7b6){if(_0x28c7b6){return _0x28c7b6['setTags'](_0x278ba9[_0x8ff9('0xb4')][_0x8ff9('0xb8')],_[_0x8ff9('0xb9')](_0x278ba9[_0x8ff9('0xb4')],['ids','id'])||{})['spread'](function(){return db[_0x8ff9('0x6d')][_0x8ff9('0xbf')]({'attributes':['id',_0x8ff9('0x2f'),_0x8ff9('0xc1')],'where':{'id':_0x278ba9['body'][_0x8ff9('0xb8')]}});})[_0x8ff9('0x2d')](function(_0x242f48){socket[_0x8ff9('0xc2')](_0x8ff9('0xc3'),{'id':Number(_0x278ba9['params']['id']),'tags':_0x242f48||[]});return{'id':Number(_0x278ba9[_0x8ff9('0xaf')]['id']),'tags':_0x242f48||[]};});}})[_0x8ff9('0x2d')](respondWithResult(_0x50debf,null))['catch'](handleError(_0x50debf,null));};exports['removeTags']=function(_0x3c8cd3,_0x35559c,_0x84b65f){return db[_0x8ff9('0x3a')]['find']({'where':{'id':_0x3c8cd3[_0x8ff9('0xaf')]['id']}})[_0x8ff9('0x2d')](handleEntityNotFound(_0x35559c,null))['then'](function(_0x2252bc){if(_0x2252bc){return _0x2252bc[_0x8ff9('0xc4')](_0x3c8cd3[_0x8ff9('0x3f')][_0x8ff9('0xb8')]);}})[_0x8ff9('0x2d')](respondWithStatusCode(_0x35559c,null))[_0x8ff9('0x38')](handleError(_0x35559c,null));};exports[_0x8ff9('0xc5')]=function(_0x3ef640,_0x185f84){var _0x37a669=moment()[_0x8ff9('0xc6')]()[_0x8ff9('0x96')]();var _0x15da77=path['join'](config['root'],_0x8ff9('0xc7'),'files',_0x8ff9('0xc8'));var _0x285825=path[_0x8ff9('0xc9')](config[_0x8ff9('0xca')],'server','files',_0x8ff9('0xcb'));var _0x1636d4=path[_0x8ff9('0xc9')](_0x15da77,_0x37a669);var _0x1988ff=util['format'](_0x8ff9('0xcc'),_0x3ef640[_0x8ff9('0xaf')]['id'],_0x37a669);var _0x51e047=path['join'](_0x15da77,_0x1988ff);var _0x28eaeb=[];_0x28eaeb[_0x8ff9('0x37')]({'model':db['User'],'as':'User','attributes':['id',_0x8ff9('0x32')],'raw':!![]});_0x28eaeb[_0x8ff9('0x37')]({'model':db['CmContact'],'as':_0x8ff9('0x61'),'attributes':['id',_0x8ff9('0xcd'),_0x8ff9('0xce')],'raw':!![]});if(_0x3ef640[_0x8ff9('0x3f')][_0x8ff9('0xcb')]){_0x28eaeb[_0x8ff9('0x37')]({'model':db[_0x8ff9('0xcf')],'as':'Attachment','raw':!![]});}var _0x541960=[{'model':db[_0x8ff9('0xb7')],'as':'Messages','attributes':['id',_0x8ff9('0xb4'),_0x8ff9('0x76'),_0x8ff9('0xd0'),_0x8ff9('0xd1'),'read'],'include':_0x28eaeb}];_0x541960[_0x8ff9('0x37')]({'model':db[_0x8ff9('0xd2')],'as':_0x8ff9('0xd3'),'attributes':['id',_0x8ff9('0x2f')]});_0x541960[_0x8ff9('0x37')]({'model':db[_0x8ff9('0x6f')],'as':'Owner','attributes':['id',_0x8ff9('0x32')]});return db[_0x8ff9('0x3a')]['find']({'where':{'id':_0x3ef640[_0x8ff9('0xaf')]['id']},'include':_0x541960})[_0x8ff9('0x2d')](handleEntityNotFound(_0x185f84,null))[_0x8ff9('0x2d')](function(_0x154ad){if(_0x154ad){var _0x12f6f4=_0x154ad['get']({'plain':!![]});fs[_0x8ff9('0xd4')](_0x1636d4);var _0x1ce8db={'channel':_0x8ff9('0xd5'),'account':_0x12f6f4[_0x8ff9('0xd3')]['name'],'agent':_0x12f6f4[_0x8ff9('0xd6')]?_0x12f6f4[_0x8ff9('0xd6')]['fullname']:'N.A.','createdAt':moment(_0x12f6f4['createdAt'])[_0x8ff9('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x12f6f4['closed']?moment(_0x12f6f4[_0x8ff9('0xd7')])[_0x8ff9('0xbd')](_0x8ff9('0xbe'))[_0x8ff9('0x96')]():'','disposition':_0x12f6f4[_0x8ff9('0xd8')],'messages':_(_0x12f6f4[_0x8ff9('0xd9')])['filter']({'secret':![]})[_0x8ff9('0x31')](function(_0x4dc0de){if(_0x4dc0de[_0x8ff9('0xcf')]){var _0x27d3dc=path[_0x8ff9('0xc9')](_0x285825,_0x4dc0de[_0x8ff9('0xcf')][_0x8ff9('0xda')]);if(fs[_0x8ff9('0xdb')](_0x27d3dc)){fs[_0x8ff9('0xdc')](_0x27d3dc)[_0x8ff9('0xdd')](fs[_0x8ff9('0xde')](path[_0x8ff9('0xc9')](_0x1636d4,_0x4dc0de[_0x8ff9('0xcf')][_0x8ff9('0xda')])));}}return{'date':moment(_0x4dc0de[_0x8ff9('0x76')])[_0x8ff9('0xbd')](_0x8ff9('0xbe'))['toString'](),'sender':_0x4dc0de[_0x8ff9('0xd0')]===_0x8ff9('0xdf')?_0x4dc0de['User']?_0x4dc0de[_0x8ff9('0x6f')][_0x8ff9('0x32')]:_0x8ff9('0xe0'):_0x4dc0de[_0x8ff9('0x61')][_0x8ff9('0xcd')]+(_0x4dc0de[_0x8ff9('0x61')][_0x8ff9('0xce')]?'\x20'+_0x4dc0de[_0x8ff9('0x61')][_0x8ff9('0xce')]:''),'body':_0x4dc0de[_0x8ff9('0xcf')]?_0x4dc0de[_0x8ff9('0xcf')][_0x8ff9('0xda')]:_0x4dc0de[_0x8ff9('0xb4')],'direction':_0x4dc0de[_0x8ff9('0xd0')]==='out'?'A':'C','secret':_0x4dc0de[_0x8ff9('0xd1')],'read':_0x4dc0de[_0x8ff9('0x7c')],'attachment':_0x4dc0de[_0x8ff9('0xcf')]};})[_0x8ff9('0x66')]()};return ejs[_0x8ff9('0xe1')](path['join'](config['root'],_0x8ff9('0xc7'),_0x8ff9('0xe2'),'downloadInteraction.ejs'),{'interaction':_0x1ce8db})[_0x8ff9('0x2d')](function(_0x22037a){var _0x1faff0=path[_0x8ff9('0xc9')](_0x1636d4,'transcript-'+_0x12f6f4['id']+'-'+_0x37a669+_0x8ff9('0xe3'));var _0xf4c23e={'path':_0x1faff0,'channel':'Whatsapp','interactionId':_0x12f6f4['id']};return pdf[_0x8ff9('0xe4')](_0x22037a,_0xf4c23e);})[_0x8ff9('0x2d')](function(){return new BPromise(function(_0x55f91e,_0x43d7a7){zipdir(_0x1636d4,{'saveTo':_0x51e047},function(_0x292485,_0x340c0c){if(_0x292485)return _0x43d7a7(_0x292485);return _0x55f91e(_0x340c0c);});})[_0x8ff9('0x2d')](function(){return new BPromise(function(_0x47f270,_0x4c2e76){rimraf(_0x1636d4,function(_0x500d86){if(_0x500d86)_0x4c2e76(_0x500d86);return _0x47f270();});});})[_0x8ff9('0x2d')](function(){return _0x185f84[_0x8ff9('0xc5')](_0x51e047,_0x1988ff,function(_0x2f4250){if(_0x2f4250){console['log'](_0x8ff9('0xe5'),_0x2f4250);}else{fs[_0x8ff9('0xe6')](_0x51e047);}});});});}else{return _0x185f84['sendStatus'](0xc8);}})['catch'](handleError(_0x185f84,null));}; \ No newline at end of file +var _0x40ca=['send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','filters','select','field','from','tools_tags','ui.WhatsappInteractionId','user_has_whatsapp_interactions','u.id\x20=\x20ui.UserId','left_join','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','text','some','compact','isEmpty','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','having','`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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.mobile','Contact.fax','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','params','includeAll','include','options','create','destroy','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','sort','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','findAll','color','whatsappInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','CmContact','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','disposition','basename','existsSync','createWriteStream','out','System','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','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','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name'];(function(_0x6ed519,_0xc1749e){var _0x38f998=function(_0x17db17){while(--_0x17db17){_0x6ed519['push'](_0x6ed519['shift']());}};_0x38f998(++_0xc1749e);}(_0x40ca,0x1a1));var _0xa40c=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x40ca[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0xa40c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa40c('0x1'));var rp=require(_0xa40c('0x2'));var moment=require(_0xa40c('0x3'));var BPromise=require(_0xa40c('0x4'));var Mustache=require('mustache');var util=require(_0xa40c('0x5'));var path=require('path');var sox=require(_0xa40c('0x6'));var csv=require('to-csv');var ejs=require(_0xa40c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa40c('0x8'));var squel=require(_0xa40c('0x9'));var crypto=require(_0xa40c('0xa'));var jsforce=require(_0xa40c('0xb'));var deskjs=require(_0xa40c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa40c('0xd'));var Papa=require(_0xa40c('0xe'));var Redis=require(_0xa40c('0xf'));var authService=require(_0xa40c('0x10'));var qs=require(_0xa40c('0x11'));var as=require(_0xa40c('0x12'));var pdf=require(_0xa40c('0x13'));var hardwareService=require(_0xa40c('0x14'));var logger=require(_0xa40c('0x15'))(_0xa40c('0x16'));var utils=require('../../config/utils');var config=require(_0xa40c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa40c('0x18'))['db'];config[_0xa40c('0x19')]=_[_0xa40c('0x1a')](config[_0xa40c('0x19')],{'host':_0xa40c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa40c('0x19')]));require(_0xa40c('0x1c'))['register'](socket);function respondWithStatusCode(_0x298242,_0x52460c){_0x52460c=_0x52460c||0xcc;return function(_0x39e072){if(_0x39e072){return _0x298242[_0xa40c('0x1d')](_0x52460c);}return _0x298242[_0xa40c('0x1e')](_0x52460c)['end']();};}function respondWithResult(_0x55ff88,_0xbeacab){_0xbeacab=_0xbeacab||0xc8;return function(_0x13c73a){if(_0x13c73a){return _0x55ff88[_0xa40c('0x1e')](_0xbeacab)[_0xa40c('0x1f')](_0x13c73a);}};}function respondWithFilteredResult(_0xa2f9bb,_0x1cd357){return function(_0x224e78){if(_0x224e78){var _0x2b6df4=typeof _0x1cd357[_0xa40c('0x20')]===_0xa40c('0x21')&&typeof _0x1cd357[_0xa40c('0x22')]===_0xa40c('0x21');var _0x4fed31=_0x224e78[_0xa40c('0x23')];var _0x1b82c8=_0x2b6df4?0x0:_0x1cd357['offset'];var _0x508ee7=_0x2b6df4?_0x224e78[_0xa40c('0x23')]:_0x1cd357[_0xa40c('0x20')]+_0x1cd357['limit'];var _0x5c3133;if(_0x508ee7>=_0x4fed31){_0x508ee7=_0x4fed31;_0x5c3133=0xc8;}else{_0x5c3133=0xce;}_0xa2f9bb[_0xa40c('0x1e')](_0x5c3133);return _0xa2f9bb[_0xa40c('0x24')](_0xa40c('0x25'),_0x1b82c8+'-'+_0x508ee7+'/'+_0x4fed31)[_0xa40c('0x1f')](_0x224e78);}return null;};}function patchUpdates(_0xa93761){return function(_0x12d7f8){try{jsonpatch[_0xa40c('0x26')](_0x12d7f8,_0xa93761,!![]);}catch(_0x12324b){return BPromise[_0xa40c('0x27')](_0x12324b);}return _0x12d7f8[_0xa40c('0x28')]();};}function saveUpdates(_0x5bba37,_0x50158d){return function(_0x19d6f3){if(_0x19d6f3){return _0x19d6f3[_0xa40c('0x29')](_0x5bba37)['then'](function(_0xfb5deb){return _0xfb5deb;});}return null;};}function removeEntity(_0xe117f8,_0x990dc1){return function(_0x47dd18){if(_0x47dd18){return _0x47dd18['destroy']()[_0xa40c('0x2a')](function(){_0xe117f8[_0xa40c('0x1e')](0xcc)[_0xa40c('0x2b')]();});}};}function handleEntityNotFound(_0x382e63,_0x4dd589){return function(_0xb9f0c5){if(!_0xb9f0c5){_0x382e63[_0xa40c('0x1d')](0x194);}return _0xb9f0c5;};}function handleError(_0x487145,_0x387951){_0x387951=_0x387951||0x1f4;return function(_0x154389){logger[_0xa40c('0x2c')](_0x154389[_0xa40c('0x2d')]);if(_0x154389[_0xa40c('0x2e')]){delete _0x154389[_0xa40c('0x2e')];}_0x487145['status'](_0x387951)[_0xa40c('0x2f')](_0x154389);};}function getInteractionUsers(_0x39d197,_0x213ba9){return new BPromise(function(_0x36d1b4,_0x3a47a3){try{if(_0x213ba9[_0x39d197['id']]){_0x39d197[_0xa40c('0x30')]=_[_0xa40c('0x31')](_0x213ba9[_0x39d197['id']],function(_0x5551f2){return{'id':_0x5551f2['id'],'fullname':_0x5551f2[_0xa40c('0x32')]};});}}catch(_0xd036ee){_0x3a47a3(_0xd036ee);}_0x36d1b4(_0x39d197);});}function getInteractionTags(_0x483801,_0x431f8c){return new BPromise(function(_0x20bba3,_0x197798){try{if(_0x483801[_0xa40c('0x33')]){_0x483801[_0xa40c('0x34')]=[];_0x483801[_0xa40c('0x33')][_0xa40c('0x35')](',')[_0xa40c('0x36')](function(_0x45c442){_0x483801[_0xa40c('0x34')][_0xa40c('0x37')](_0x431f8c[_0x45c442]);});}delete _0x483801['TagIds'];}catch(_0x5629f7){_0x197798(_0x5629f7);}_0x20bba3(_0x483801);});}function updateWhatsappInteraction(_0x457981,_0x19977d,_0xbfad74){return new BPromise(function(_0x1b981d,_0x3206f5){return getInteractionUsers(_0x457981,_0xbfad74)[_0xa40c('0x2a')](function(_0x42f86c){return getInteractionTags(_0x42f86c,_0x19977d);})['then'](function(_0x42a735){_0x1b981d(_0x42a735);})[_0xa40c('0x38')](function(_0x2f4323){_0x3206f5(_0x2f4323);});});}exports[_0xa40c('0x39')]=function(_0x82f744,_0x24b389){var _0x24008c={},_0x47522f={},_0x160c1a={'count':0x0,'rows':[]};var _0x2e3098=_['map'](db[_0xa40c('0x3a')][_0xa40c('0x3b')],function(_0x13bfe7){return{'name':_0x13bfe7[_0xa40c('0x3c')],'type':_0x13bfe7['type'][_0xa40c('0x3d')]};});_0x47522f['model']=_[_0xa40c('0x31')](_0x2e3098,'name');_0x47522f[_0xa40c('0x3e')]=_[_0xa40c('0x3f')](_0x82f744[_0xa40c('0x3e')]);_0x47522f['filters']=_['intersection'](_0x47522f[_0xa40c('0x40')],_0x47522f[_0xa40c('0x3e')]);_0x24008c[_0xa40c('0x41')]=_[_0xa40c('0x42')](_0x47522f[_0xa40c('0x40')],qs[_0xa40c('0x43')](_0x82f744['query'][_0xa40c('0x43')]));_0x24008c[_0xa40c('0x41')]=_0x24008c[_0xa40c('0x41')][_0xa40c('0x44')]?_0x24008c[_0xa40c('0x41')]:_0x47522f['model'];if(!_0x82f744['query'][_0xa40c('0x45')](_0xa40c('0x46'))){_0x24008c[_0xa40c('0x22')]=qs[_0xa40c('0x22')](_0x82f744[_0xa40c('0x3e')][_0xa40c('0x22')]);_0x24008c[_0xa40c('0x20')]=qs['offset'](_0x82f744['query'][_0xa40c('0x20')]);}_0x24008c['order']=qs['sort'](_0x82f744[_0xa40c('0x3e')]['sort']);_0x24008c['where']=qs['filters'](_[_0xa40c('0x47')](_0x82f744[_0xa40c('0x3e')],_0x47522f[_0xa40c('0x48')]),_0x2e3098);var _0x35badf=[];var _0x4796bf=squel[_0xa40c('0x49')]()[_0xa40c('0x4a')]('id')[_0xa40c('0x4a')](_0xa40c('0x2e'))[_0xa40c('0x4a')]('color')[_0xa40c('0x4b')](_0xa40c('0x4c'));var _0x51d403=squel['select']()[_0xa40c('0x4a')]('u.id')['field']('u.fullname')[_0xa40c('0x4a')](_0xa40c('0x4d'))[_0xa40c('0x4b')](_0xa40c('0x4e'),'ui')['left_join']('users','u',_0xa40c('0x4f'));var _0x404a28=squel['select']()[_0xa40c('0x4b')]('whatsapp_interactions','i')[_0xa40c('0x50')](_0xa40c('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xa40c('0x52'))[_0xa40c('0x50')](_0xa40c('0x53'),'a',_0xa40c('0x54'))['left_join'](_0xa40c('0x55'),'me',_0xa40c('0x56'))[_0xa40c('0x50')](_0xa40c('0x57'),'it',_0xa40c('0x58'))[_0xa40c('0x50')](_0xa40c('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x4ba3af=squel[_0xa40c('0x59')]();var _0x52b267=[];var _0x81432c=squel[_0xa40c('0x59')]();var _0x7cde92;if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x5a')]){_0x7cde92=as[_0xa40c('0x5b')](_0x82f744['query']['search']);var _0x59ea8e=_0x7cde92['sqlOperator'];for(var _0xf1c757=0x0;_0xf1c757<_0x7cde92[_0xa40c('0x5c')][_0xa40c('0x44')];_0xf1c757++){var _0x26439b=_0x7cde92[_0xa40c('0x5c')][_0xf1c757];var _0x2b85d8='i';var _0x46781c=_[_0xa40c('0x5d')](_0x2e3098,[_0xa40c('0x2e'),_0x26439b[_0xa40c('0x4a')]]);if(!_0x46781c){switch(_0x26439b[_0xa40c('0x4a')]){case _0xa40c('0x5e'):if(_0x26439b[_0xa40c('0x5f')]==0x1){_0x404a28['having']('`'+_0x26439b[_0xa40c('0x4a')]+_0xa40c('0x60'));}else{_0x404a28['having']('`'+_0x26439b['field']+_0xa40c('0x61'));}break;case _0xa40c('0x62'):if(_0x26439b[_0xa40c('0x63')]===_0xa40c('0x64')){if(_0x26439b[_0xa40c('0x5f')][_0xa40c('0x35')]('\x20')[_0xa40c('0x44')]>0x1){_0x4ba3af[_0x59ea8e](_0xa40c('0x65'),qs[_0xa40c('0x66')](_0x26439b['value']),null);}else{var _0x717047='%'+_0x26439b['value']+'%';_0x4ba3af[_0x59ea8e](_0xa40c('0x67'),_0x717047,_0x717047,_0x717047);}}else{_0x46781c=_['find'](_0x2e3098,[_0xa40c('0x2e'),_0xa40c('0x68')]);_0x26439b['field']=_0xa40c('0x68');_0x170c67=as['buildExpression'](_0x2b85d8,_0x46781c[_0xa40c('0x69')],_0x26439b);_0x4ba3af[_0x59ea8e](_0x170c67['text'],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x6a')],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x2b')]);}break;case _0xa40c('0x6b'):var _0x37eeae=_0x26439b['value'][_0xa40c('0x35')](',')[_0xa40c('0x31')](function(_0x314c47){return Number(_0x314c47);});_0x37eeae['forEach'](function(_0x4100c9){_0x81432c['or'](_0xa40c('0x6c'),'%,'+_0x4100c9+',%');});_0x52b267=_[_0xa40c('0x6d')](_0x52b267,_0x37eeae);break;case _0xa40c('0x6e'):if(_0x26439b[_0xa40c('0x63')]===_0xa40c('0x64')){_0x4ba3af[_0x59ea8e](_0xa40c('0x6f'),'%'+_0x26439b[_0xa40c('0x5f')]+'%',null);}else{_0x46781c=_[_0xa40c('0x5d')](_0x2e3098,['name',_0xa40c('0x70')]);_0x26439b[_0xa40c('0x4a')]=_0xa40c('0x70');_0x170c67=as[_0xa40c('0x71')](_0x2b85d8,_0x46781c['type'],_0x26439b);_0x4ba3af[_0x59ea8e](_0x170c67['text'],_0x170c67['value'][_0xa40c('0x6a')],_0x170c67['value']['end']);}break;case _0xa40c('0x72'):_0x170c67=as[_0xa40c('0x71')]('me',null,_0x26439b);_0x4ba3af[_0x59ea8e](_0x170c67['text'],_0x170c67[_0xa40c('0x5f')]['start'],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x2b')]);break;}}else{var _0x170c67=as['buildExpression'](_0x2b85d8,_0x46781c[_0xa40c('0x69')],_0x26439b);_0x4ba3af[_0x59ea8e](_0x170c67[_0xa40c('0x73')],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x6a')],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x2b')]);}}}else{var _0x4d3f16=_(_0x82f744['query'])[_0xa40c('0x3f')]()['map'](function(_0x331029){return _[_0xa40c('0x74')](_0x2e3098,[_0xa40c('0x2e'),_0x331029])?_0x331029:undefined;})[_0xa40c('0x75')]()[_0xa40c('0x5f')]();if(!_[_0xa40c('0x76')](_0x4d3f16)){_0x4d3f16[_0xa40c('0x36')](function(_0x57cf8a){if(_0x57cf8a==='WhatsappAccountId'){_0x404a28[_0xa40c('0x77')](_0xa40c('0x78'),[][_0xa40c('0x79')](_0x82f744[_0xa40c('0x3e')][_0x57cf8a]));}else if(_0x57cf8a===_0xa40c('0x7a')){var _0x355860=JSON[_0xa40c('0x7b')](_0x82f744[_0xa40c('0x3e')][_0x57cf8a])['$gte'];var _0x717383=JSON[_0xa40c('0x7b')](_0x82f744[_0xa40c('0x3e')][_0x57cf8a])[_0xa40c('0x7c')];_0x404a28[_0xa40c('0x77')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x355860,_0x717383);}else{if(_0x82f744[_0xa40c('0x3e')][_0x57cf8a]===_0xa40c('0x7d')){_0x404a28[_0xa40c('0x77')]('i.'+_0x57cf8a+_0xa40c('0x7e'));}else{_0x404a28[_0xa40c('0x77')]('i.'+_0x57cf8a+_0xa40c('0x7f'),_0x82f744[_0xa40c('0x3e')][_0x57cf8a]);}}});}if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x80')]){if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x80')]==0x1){_0x404a28[_0xa40c('0x81')](_0xa40c('0x82'));}else{_0x404a28[_0xa40c('0x81')]('`unreadMessages`\x20>\x200');}}if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x83')]){_0x52b267=_[_0xa40c('0x84')](_0x82f744[_0xa40c('0x3e')][_0xa40c('0x83')])?_0x82f744['query'][_0xa40c('0x83')]:new Array(_0x82f744[_0xa40c('0x3e')]['tag']);_0x52b267[_0xa40c('0x36')](function(_0x46851b){_0x81432c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46851b+',%');});}if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x85')]){var _0x4d755c=_0x82f744['query']['filter'][_0xa40c('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa40c('0x87')](_0x4d755c)){_0x4ba3af['or'](_0xa40c('0x88'),_0x4d755c+'%')['or'](_0xa40c('0x89'),_0x4d755c+'%');}else{_0x4ba3af['or'](_0xa40c('0x8a'),qs[_0xa40c('0x66')](_0x4d755c))['or'](_0xa40c('0x8b'),_0x4d755c+'%');}}}_0x404a28[_0xa40c('0x77')](_0x4ba3af);_0x404a28[_0xa40c('0x8c')](_0xa40c('0x8d'));var _0x5473b4={'type':db[_0xa40c('0x8e')][_0xa40c('0x8f')]['SELECT'],'raw':!![]};var _0x4bb293=_0x404a28['clone']();_0x4bb293[_0xa40c('0x4a')](_0xa40c('0x8d'));_0x4bb293[_0xa40c('0x4a')](_0xa40c('0x90'),'unreadMessages');if(_0x24008c[_0xa40c('0x91')]){_0x24008c[_0xa40c('0x91')]['forEach'](function(_0x4f6756){var _0x4ad5c4=_0x4f6756[0x0]===_0xa40c('0x92')?_0x4f6756[0x0]:'i.'+_0x4f6756[0x0];_0x404a28[_0xa40c('0x91')](_0x4ad5c4,_0x4f6756[0x1]===_0xa40c('0x93')?![]:!![]);});}if(!_[_0xa40c('0x76')](_0x52b267)){_0x404a28[_0xa40c('0x81')](_0x81432c);_0x4bb293[_0xa40c('0x77')](_0xa40c('0x94'),_0x52b267);}BPromise[_0xa40c('0x95')]()[_0xa40c('0x2a')](function(){if(!_0x7cde92){if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x96')])return;_0x4bb293['where'](_0xa40c('0x97'));_0x404a28[_0xa40c('0x77')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x82f744[_0xa40c('0x98')]['role']!=='agent')return;return _0x82f744[_0xa40c('0x98')][_0xa40c('0x99')]({'attributes':['id'],'raw':!![]})[_0xa40c('0x2a')](function(_0x10ce74){if(_['isEmpty'](_0x10ce74)){_0x4bb293[_0xa40c('0x77')](_0xa40c('0x9a'));_0x404a28[_0xa40c('0x77')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x4bb293['where'](_0xa40c('0x78'),_[_0xa40c('0x31')](_0x10ce74,'id'));_0x404a28[_0xa40c('0x77')](_0xa40c('0x78'),_[_0xa40c('0x31')](_0x10ce74,'id'));}});})['then'](function(){if(_0x82f744[_0xa40c('0x98')]['role']==='agent'&&!_0x7cde92&&!_0x82f744[_0xa40c('0x3e')][_0xa40c('0x96')])return[];return db['sequelize']['query'](_0x4bb293['toString'](),_0x5473b4);})[_0xa40c('0x2a')](function(_0x173c10){_0x160c1a[_0xa40c('0x23')]=_0x173c10['length'];if(_0x160c1a[_0xa40c('0x23')]===0x0)return[];return db[_0xa40c('0x9b')][_0xa40c('0x3e')](_0x4796bf[_0xa40c('0x9c')](),_0x5473b4)[_0xa40c('0x2a')](function(_0x2b5e7c){_0x35badf=_[_0xa40c('0x9d')](_0x2b5e7c,'id');_0x5473b4=_[_0xa40c('0x9e')](_0x5473b4,{'model':db[_0xa40c('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x43')]){_0x24008c[_0xa40c('0x41')][_0xa40c('0x36')](function(_0x55ec82){_0x404a28['field']('i.'+_0x55ec82);});}else{_0x404a28[_0xa40c('0x4a')](_0xa40c('0x90'),_0xa40c('0x5e'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0x9f'),_0xa40c('0xa0'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0xa1'),_0xa40c('0xa2'));_0x404a28['field'](_0xa40c('0xa3'),_0xa40c('0x92'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0xa4'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0xa5'),_0xa40c('0xa6'));_0x404a28['field'](_0xa40c('0xa7'),_0xa40c('0xa8'));_0x404a28[_0xa40c('0x4a')]('c.email',_0xa40c('0xa9'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0xaa'),'Contact.phone');_0x404a28['field']('c.mobile',_0xa40c('0xab'));_0x404a28['field']('c.fax',_0xa40c('0xac'));_0x404a28[_0xa40c('0x4a')]('o.fullname','Owner.fullname');_0x404a28['field']('o.internal',_0xa40c('0xad'));_0x404a28['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa40c('0x33'));}if(_0x24008c[_0xa40c('0x22')])_0x404a28[_0xa40c('0x22')](_0x24008c[_0xa40c('0x22')]);if(_0x24008c['offset'])_0x404a28['offset'](_0x24008c[_0xa40c('0x20')]);return db[_0xa40c('0x9b')]['query'](_0x404a28[_0xa40c('0x9c')](),_0x5473b4);})[_0xa40c('0x2a')](function(_0x36aa7c){if(_0x36aa7c[_0xa40c('0x44')]>0x0)_0x51d403['where'](_0xa40c('0xae'),_['map'](_0x36aa7c,'id'));return db[_0xa40c('0x9b')][_0xa40c('0x3e')](_0x51d403[_0xa40c('0x9c')](),_0x5473b4)[_0xa40c('0x2a')](function(_0x11e97c){var _0x371798=_[_0xa40c('0xaf')](_0x11e97c,_0xa40c('0xb0'));var _0x350337=[];_0x36aa7c[_0xa40c('0x36')](function(_0x27e199){_0x350337['push'](updateWhatsappInteraction(_0x27e199,_0x35badf,_0x371798));});return BPromise[_0xa40c('0xb1')](_0x350337);});});})['then'](function(_0x442209){_0x160c1a[_0xa40c('0xb2')]=_0x442209;return _0x160c1a;})[_0xa40c('0x2a')](respondWithFilteredResult(_0x24b389,_0x24008c))['catch'](handleError(_0x24b389,null));};exports['show']=function(_0x1f98f5,_0x529f0e){var _0x5ab9af={'raw':![],'where':{'id':_0x1f98f5[_0xa40c('0xb3')]['id']}},_0x14853d={};_0x14853d['model']=_[_0xa40c('0x3f')](db[_0xa40c('0x3a')]['rawAttributes']);_0x14853d[_0xa40c('0x3e')]=_[_0xa40c('0x3f')](_0x1f98f5[_0xa40c('0x3e')]);_0x14853d[_0xa40c('0x48')]=_['intersection'](_0x14853d[_0xa40c('0x40')],_0x14853d[_0xa40c('0x3e')]);_0x5ab9af['attributes']=_['intersection'](_0x14853d['model'],qs[_0xa40c('0x43')](_0x1f98f5[_0xa40c('0x3e')][_0xa40c('0x43')]));_0x5ab9af[_0xa40c('0x41')]=_0x5ab9af[_0xa40c('0x41')][_0xa40c('0x44')]?_0x5ab9af[_0xa40c('0x41')]:_0x14853d['model'];if(_0x1f98f5[_0xa40c('0x3e')][_0xa40c('0xb4')]){_0x5ab9af[_0xa40c('0xb5')]=[{'all':!![]}];}_0x5ab9af=_[_0xa40c('0x9e')]({},_0x5ab9af,_0x1f98f5[_0xa40c('0xb6')]);return db[_0xa40c('0x3a')][_0xa40c('0x5d')](_0x5ab9af)[_0xa40c('0x2a')](handleEntityNotFound(_0x529f0e,null))[_0xa40c('0x2a')](respondWithResult(_0x529f0e,null))[_0xa40c('0x38')](handleError(_0x529f0e,null));};exports[_0xa40c('0xb7')]=function(_0x3b3ad9,_0x48bf26){return db[_0xa40c('0x3a')]['create'](_0x3b3ad9['body'],{})[_0xa40c('0x2a')](respondWithResult(_0x48bf26,0xc9))['catch'](handleError(_0x48bf26,null));};exports[_0xa40c('0x29')]=function(_0x49fa54,_0x1d62e0){if(_0x49fa54[_0xa40c('0x72')]['id']){delete _0x49fa54[_0xa40c('0x72')]['id'];}return db[_0xa40c('0x3a')]['find']({'where':{'id':_0x49fa54[_0xa40c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x1d62e0,null))[_0xa40c('0x2a')](saveUpdates(_0x49fa54['body'],null))[_0xa40c('0x2a')](respondWithResult(_0x1d62e0,null))[_0xa40c('0x38')](handleError(_0x1d62e0,null));};exports[_0xa40c('0xb8')]=function(_0x7bdc41,_0x21a969){return db[_0xa40c('0x3a')][_0xa40c('0x5d')]({'where':{'id':_0x7bdc41[_0xa40c('0xb3')]['id']}})[_0xa40c('0x2a')](handleEntityNotFound(_0x21a969,null))[_0xa40c('0x2a')](removeEntity(_0x21a969,null))[_0xa40c('0x38')](handleError(_0x21a969,null));};exports[_0xa40c('0xb9')]=function(_0x45832c,_0x1c6847){return db[_0xa40c('0x3a')]['describe']()[_0xa40c('0x2a')](respondWithResult(_0x1c6847,null))[_0xa40c('0x38')](handleError(_0x1c6847,null));};exports[_0xa40c('0xba')]=function(_0x18ad80,_0x42b964,_0x511674){return db['WhatsappMessage'][_0xa40c('0x5d')]({'where':{'id':_0x18ad80[_0xa40c('0xb3')]['id']}})[_0xa40c('0x2a')](handleEntityNotFound(_0x42b964,null))[_0xa40c('0x2a')](function(_0x5b41aa){if(_0x5b41aa){return _0x5b41aa['addMessage'](_0x18ad80[_0xa40c('0x72')][_0xa40c('0xbb')],_[_0xa40c('0xbc')](_0x18ad80[_0xa40c('0x72')],[_0xa40c('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x42b964,null))[_0xa40c('0x38')](handleError(_0x42b964,null));};exports[_0xa40c('0xbd')]=function(_0x328f9c,_0x48cce9,_0x169684){var _0x538ee6={'raw':![],'where':{}};var _0x4f055b={};var _0x108a8a={'count':0x0,'rows':[]};return db[_0xa40c('0x3a')][_0xa40c('0xbe')]({'where':{'id':_0x328f9c['params']['id']}})[_0xa40c('0x2a')](handleEntityNotFound(_0x48cce9,null))[_0xa40c('0x2a')](function(_0x1b84f5){if(_0x1b84f5){_0x4f055b[_0xa40c('0x40')]=_['keys'](db[_0xa40c('0xbf')][_0xa40c('0x3b')]);_0x4f055b[_0xa40c('0x3e')]=_['keys'](_0x328f9c['query']);_0x4f055b[_0xa40c('0x48')]=_[_0xa40c('0x42')](_0x4f055b['model'],_0x4f055b[_0xa40c('0x3e')]);_0x538ee6[_0xa40c('0x41')]=_[_0xa40c('0x42')](_0x4f055b[_0xa40c('0x40')],qs[_0xa40c('0x43')](_0x328f9c[_0xa40c('0x3e')][_0xa40c('0x43')]));_0x538ee6[_0xa40c('0x41')]=_0x538ee6[_0xa40c('0x41')][_0xa40c('0x44')]?_0x538ee6[_0xa40c('0x41')]:_0x4f055b['model'];if(!_0x328f9c[_0xa40c('0x3e')][_0xa40c('0x45')](_0xa40c('0x46'))){_0x538ee6['limit']=qs[_0xa40c('0x22')](_0x328f9c['query'][_0xa40c('0x22')]);_0x538ee6['offset']=qs[_0xa40c('0x20')](_0x328f9c[_0xa40c('0x3e')][_0xa40c('0x20')]);}_0x538ee6[_0xa40c('0x91')]=qs[_0xa40c('0xc0')](_0x328f9c[_0xa40c('0x3e')][_0xa40c('0xc0')]);_0x538ee6[_0xa40c('0x77')]=qs[_0xa40c('0x48')](_[_0xa40c('0x47')](_0x328f9c[_0xa40c('0x3e')],_0x4f055b[_0xa40c('0x48')]));_0x538ee6[_0xa40c('0x77')]['WhatsappInteractionId']=_0x1b84f5['id'];if(_0x328f9c[_0xa40c('0x3e')][_0xa40c('0x85')]){_0x538ee6[_0xa40c('0x77')]=_['merge'](_0x538ee6[_0xa40c('0x77')],{'$or':_['map'](_0x538ee6[_0xa40c('0x41')],function(_0x245b86){var _0x51e2ee={};_0x51e2ee[_0x245b86]={'$like':'%'+_0x328f9c['query'][_0xa40c('0x85')]+'%'};return _0x51e2ee;})});}if(_0x328f9c[_0xa40c('0x3e')]['$gte']){var _0x5b8731=_0x328f9c[_0xa40c('0x3e')][_0xa40c('0xc1')][_0xa40c('0x35')](',');var _0x2fca69={};_0x2fca69[_0x5b8731[0x0]]={'$gte':moment(_0x5b8731[0x1])[_0xa40c('0xc2')](_0xa40c('0xc3'))};_0x538ee6[_0xa40c('0x77')]=_[_0xa40c('0x9e')](_0x538ee6[_0xa40c('0x77')],_0x2fca69);}_0x538ee6=_[_0xa40c('0x9e')]({},_0x538ee6,_0x328f9c[_0xa40c('0xb6')]);return db[_0xa40c('0xbf')]['count']({'where':_0x538ee6['where']})[_0xa40c('0x2a')](function(_0x5ec2ad){_0x108a8a[_0xa40c('0x23')]=_0x5ec2ad;if(_0x328f9c[_0xa40c('0x3e')][_0xa40c('0xb4')]){_0x538ee6[_0xa40c('0xb5')]=[{'all':!![]}];}return db[_0xa40c('0xbf')]['findAll'](_0x538ee6);})[_0xa40c('0x2a')](function(_0x41e0f0){_0x108a8a['rows']=_0x41e0f0;return _0x108a8a;});}})[_0xa40c('0x2a')](respondWithFilteredResult(_0x48cce9,_0x538ee6))[_0xa40c('0x38')](handleError(_0x48cce9,null));};exports[_0xa40c('0xc4')]=function(_0x1a358d,_0x2ef2d7,_0x7e0087){return db[_0xa40c('0x3a')]['find']({'where':{'id':_0x1a358d[_0xa40c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2ef2d7,null))['then'](function(_0x5c2845){if(_0x5c2845){return _0x5c2845['setTags'](_0x1a358d[_0xa40c('0x72')][_0xa40c('0xbb')],_[_0xa40c('0xbc')](_0x1a358d[_0xa40c('0x72')],[_0xa40c('0xbb'),'id'])||{})[_0xa40c('0xc5')](function(){return db[_0xa40c('0x6b')][_0xa40c('0xc6')]({'attributes':['id','name',_0xa40c('0xc7')],'where':{'id':_0x1a358d[_0xa40c('0x72')][_0xa40c('0xbb')]}});})[_0xa40c('0x2a')](function(_0x3ce844){socket['emit'](_0xa40c('0xc8'),{'id':Number(_0x1a358d[_0xa40c('0xb3')]['id']),'tags':_0x3ce844||[]});return{'id':Number(_0x1a358d[_0xa40c('0xb3')]['id']),'tags':_0x3ce844||[]};});}})[_0xa40c('0x2a')](respondWithResult(_0x2ef2d7,null))[_0xa40c('0x38')](handleError(_0x2ef2d7,null));};exports[_0xa40c('0xc9')]=function(_0x5de20d,_0x12414a,_0x2b334d){return db['WhatsappInteraction'][_0xa40c('0x5d')]({'where':{'id':_0x5de20d[_0xa40c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x12414a,null))[_0xa40c('0x2a')](function(_0x89827d){if(_0x89827d){return _0x89827d[_0xa40c('0xc9')](_0x5de20d[_0xa40c('0x3e')][_0xa40c('0xbb')]);}})[_0xa40c('0x2a')](respondWithStatusCode(_0x12414a,null))[_0xa40c('0x38')](handleError(_0x12414a,null));};exports[_0xa40c('0xca')]=function(_0x15a68c,_0x51657e){var _0x2bf813=moment()['unix']()[_0xa40c('0x9c')]();var _0x2defee=path['join'](config[_0xa40c('0xcb')],_0xa40c('0xcc'),_0xa40c('0xcd'),_0xa40c('0xce'));var _0x17dbc3=path[_0xa40c('0xcf')](config[_0xa40c('0xcb')],_0xa40c('0xcc'),_0xa40c('0xcd'),_0xa40c('0xd0'));var _0x51d071=path[_0xa40c('0xcf')](_0x2defee,_0x2bf813);var _0x9284f0=util['format']('transcript-%d-%s.zip',_0x15a68c[_0xa40c('0xb3')]['id'],_0x2bf813);var _0x34ee1d=path[_0xa40c('0xcf')](_0x2defee,_0x9284f0);var _0x1bed75=[];_0x1bed75[_0xa40c('0x37')]({'model':db[_0xa40c('0x6e')],'as':_0xa40c('0x6e'),'attributes':['id',_0xa40c('0x32')],'raw':!![]});_0x1bed75[_0xa40c('0x37')]({'model':db[_0xa40c('0xd1')],'as':'Contact','attributes':['id','firstName',_0xa40c('0xd2')],'raw':!![]});if(_0x15a68c[_0xa40c('0x3e')][_0xa40c('0xd0')]){_0x1bed75[_0xa40c('0x37')]({'model':db[_0xa40c('0xd3')],'as':_0xa40c('0xd3'),'raw':!![]});}var _0x5b074e=[{'model':db[_0xa40c('0xbf')],'as':'Messages','attributes':['id','body',_0xa40c('0x7a'),_0xa40c('0xd4'),_0xa40c('0xd5'),_0xa40c('0x80')],'include':_0x1bed75}];_0x5b074e[_0xa40c('0x37')]({'model':db[_0xa40c('0xd6')],'as':_0xa40c('0xd7'),'attributes':['id',_0xa40c('0x2e')]});_0x5b074e[_0xa40c('0x37')]({'model':db[_0xa40c('0x6e')],'as':_0xa40c('0xd8'),'attributes':['id',_0xa40c('0x32')]});return db[_0xa40c('0x3a')][_0xa40c('0x5d')]({'where':{'id':_0x15a68c[_0xa40c('0xb3')]['id']},'include':_0x5b074e})['then'](handleEntityNotFound(_0x51657e,null))[_0xa40c('0x2a')](function(_0x463ec3){if(_0x463ec3){var _0x2c1c58=_0x463ec3[_0xa40c('0xd9')]({'plain':!![]});fs[_0xa40c('0xda')](_0x51d071);var _0x12ae3f={'channel':_0xa40c('0xdb'),'account':_0x2c1c58[_0xa40c('0xd7')]['name'],'agent':_0x2c1c58[_0xa40c('0xd8')]?_0x2c1c58[_0xa40c('0xd8')]['fullname']:'N.A.','createdAt':moment(_0x2c1c58[_0xa40c('0x7a')])['format'](_0xa40c('0xc3'))[_0xa40c('0x9c')](),'closedAt':_0x2c1c58['closed']?moment(_0x2c1c58['closedAt'])[_0xa40c('0xc2')](_0xa40c('0xc3'))[_0xa40c('0x9c')]():'','disposition':_0x2c1c58[_0xa40c('0xdc')],'messages':_(_0x2c1c58['Messages'])[_0xa40c('0x85')]({'secret':![]})[_0xa40c('0x31')](function(_0x2f8d27){if(_0x2f8d27[_0xa40c('0xd3')]){var _0x4c7728=path['join'](_0x17dbc3,_0x2f8d27['Attachment'][_0xa40c('0xdd')]);if(fs[_0xa40c('0xde')](_0x4c7728)){fs['createReadStream'](_0x4c7728)['pipe'](fs[_0xa40c('0xdf')](path[_0xa40c('0xcf')](_0x51d071,_0x2f8d27[_0xa40c('0xd3')][_0xa40c('0xdd')])));}}return{'date':moment(_0x2f8d27[_0xa40c('0x7a')])[_0xa40c('0xc2')](_0xa40c('0xc3'))[_0xa40c('0x9c')](),'sender':_0x2f8d27[_0xa40c('0xd4')]===_0xa40c('0xe0')?_0x2f8d27[_0xa40c('0x6e')]?_0x2f8d27['User']['fullname']:_0xa40c('0xe1'):_0x2f8d27['Contact']['firstName']+(_0x2f8d27[_0xa40c('0x62')][_0xa40c('0xd2')]?'\x20'+_0x2f8d27['Contact'][_0xa40c('0xd2')]:''),'body':_0x2f8d27[_0xa40c('0xd3')]?_0x2f8d27['Attachment'][_0xa40c('0xdd')]:_0x2f8d27['body'],'direction':_0x2f8d27[_0xa40c('0xd4')]===_0xa40c('0xe0')?'A':'C','secret':_0x2f8d27['secret'],'read':_0x2f8d27['read'],'attachment':_0x2f8d27[_0xa40c('0xd3')]};})[_0xa40c('0x5f')]()};return ejs['renderFile'](path['join'](config[_0xa40c('0xcb')],_0xa40c('0xcc'),_0xa40c('0xe2'),_0xa40c('0xe3')),{'interaction':_0x12ae3f})[_0xa40c('0x2a')](function(_0x12da4e){var _0x346b73=path['join'](_0x51d071,_0xa40c('0xe4')+_0x2c1c58['id']+'-'+_0x2bf813+'.pdf');var _0x596fdd={'path':_0x346b73,'channel':_0xa40c('0xdb'),'interactionId':_0x2c1c58['id']};return pdf[_0xa40c('0xe5')](_0x12da4e,_0x596fdd);})[_0xa40c('0x2a')](function(){return new BPromise(function(_0x7724b8,_0x35fbd6){zipdir(_0x51d071,{'saveTo':_0x34ee1d},function(_0x4c71d3,_0x2b5cc5){if(_0x4c71d3)return _0x35fbd6(_0x4c71d3);return _0x7724b8(_0x2b5cc5);});})['then'](function(){return new BPromise(function(_0x19c471,_0x34dfc8){rimraf(_0x51d071,function(_0x5446f8){if(_0x5446f8)_0x34dfc8(_0x5446f8);return _0x19c471();});});})['then'](function(){return _0x51657e[_0xa40c('0xca')](_0x34ee1d,_0x9284f0,function(_0xbe007){if(_0xbe007){console[_0xa40c('0xe6')](_0xa40c('0xe7'),_0xbe007);}else{fs['unlinkSync'](_0x34ee1d);}});});});}else{return _0x51657e[_0xa40c('0x1d')](0xc8);}})[_0xa40c('0x38')](handleError(_0x51657e,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index aec7da1..1e9f690 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 _0x6308=['hasOwnProperty','exports','events','WhatsappInteraction','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0x21dbcc,_0x9ac11f){var _0x57b0ad=function(_0x2007c6){while(--_0x2007c6){_0x21dbcc['push'](_0x21dbcc['shift']());}};_0x57b0ad(++_0x9ac11f);}(_0x6308,0x1f2));var _0x8630=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x6308[_0x3511d3];return _0x5d6321;};'use strict';var EventEmitter=require(_0x8630('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x8630('0x1')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x8630('0x2')](0x0);var events={'afterCreate':_0x8630('0x3'),'afterUpdate':_0x8630('0x4'),'afterDestroy':_0x8630('0x5')};function emitEvent(_0xd3ae17){return function(_0x5ce74a,_0x4b2cfb,_0x1d62c8){_0x5ce74a['getUsers']({'attributes':['id'],'raw':!![]})[_0x8630('0x6')](function(_0x3d5a10){_0x5ce74a[_0x8630('0x7')](_0x8630('0x8'),_0x3d5a10[_0x8630('0x9')](function(_0x1830b3){return{'id':_0x1830b3['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x5ce74a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8630('0x6')](function(_0x5726fd){_0x5ce74a[_0x8630('0x7')](_0x8630('0xa'),_0x5726fd[_0x8630('0xb')]);WhatsappInteractionEvents['emit'](_0xd3ae17+':'+_0x5ce74a['id'],_0x5ce74a);WhatsappInteractionEvents[_0x8630('0xc')](_0xd3ae17,_0x5ce74a);_0x1d62c8(null);})[_0x8630('0xd')](_0x1d62c8(null));};}for(var e in events){if(events[_0x8630('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x8630('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x3140=['../../mysqldb','WhatsappInteraction','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x151c71,_0x111af7){var _0x1cdf04=function(_0x268e2b){while(--_0x268e2b){_0x151c71['push'](_0x151c71['shift']());}};_0x1cdf04(++_0x111af7);}(_0x3140,0xaf));var _0x0314=function(_0xe07094,_0x1cd13b){_0xe07094=_0xe07094-0x0;var _0x2d447b=_0x3140[_0xe07094];return _0x2d447b;};'use strict';var EventEmitter=require(_0x0314('0x0'));var WhatsappInteraction=require(_0x0314('0x1'))['db'][_0x0314('0x2')];var WhatsappMessage=require(_0x0314('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0314('0x3'),'afterUpdate':_0x0314('0x4'),'afterDestroy':_0x0314('0x5')};function emitEvent(_0x3e4284){return function(_0x254566,_0x46c395,_0x9e308d){_0x254566[_0x0314('0x6')]({'attributes':['id'],'raw':!![]})[_0x0314('0x7')](function(_0x44762d){_0x254566[_0x0314('0x8')]('Users',_0x44762d[_0x0314('0x9')](function(_0x2d87d2){return{'id':_0x2d87d2['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x254566['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xf2561e){_0x254566['setDataValue'](_0x0314('0xa'),_0xf2561e[_0x0314('0xb')]);WhatsappInteractionEvents[_0x0314('0xc')](_0x3e4284+':'+_0x254566['id'],_0x254566);WhatsappInteractionEvents[_0x0314('0xc')](_0x3e4284,_0x254566);_0x9e308d(null);})[_0x0314('0xd')](_0x9e308d(null));};}for(var e in events){if(events[_0x0314('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x0314('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 0bcafaf..f3adcef 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 _0xb249=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','whatsapp_interactions','closed','closedAt'];(function(_0x18073b,_0x429241){var _0x17506d=function(_0x1b9e7b){while(--_0x1b9e7b){_0x18073b['push'](_0x18073b['shift']());}};_0x17506d(++_0x429241);}(_0xb249,0x98));var _0x9b24=function(_0x118845,_0x193961){_0x118845=_0x118845-0x0;var _0x36d40d=_0xb249[_0x118845];return _0x36d40d;};'use strict';var _=require(_0x9b24('0x0'));var util=require('util');var logger=require(_0x9b24('0x1'))(_0x9b24('0x2'));var moment=require(_0x9b24('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b24('0x4'));var fs=require('fs');var path=require(_0x9b24('0x5'));var rimraf=require(_0x9b24('0x6'));var config=require(_0x9b24('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0x9b24('0x8')]=function(_0x3fb4a2,_0x5ad450){return _0x3fb4a2[_0x9b24('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x9b24('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12aff7,_0x12f8d5,_0x37db47){if(_0x12aff7['changed'](_0x9b24('0xb'))){_0x12aff7[_0x9b24('0xc')]=moment()[_0x9b24('0xd')](_0x9b24('0xe'));}_0x37db47(null,_0x12aff7);}}});}; \ No newline at end of file +var _0x6e67=['./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','path','rimraf'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0x6e67,0x136));var _0x76e6=function(_0x4d0d85,_0x1d2bdb){_0x4d0d85=_0x4d0d85-0x0;var _0xf8b08e=_0x6e67[_0x4d0d85];return _0xf8b08e;};'use strict';var _=require(_0x76e6('0x0'));var util=require(_0x76e6('0x1'));var logger=require('../../config/logger')(_0x76e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x76e6('0x3'));var rimraf=require(_0x76e6('0x4'));var config=require('../../config/environment');var attributes=require(_0x76e6('0x5'));module[_0x76e6('0x6')]=function(_0xc94e72,_0x4f9761){return _0xc94e72[_0x76e6('0x7')](_0x76e6('0x8'),attributes,{'tableName':_0x76e6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2401ba,_0x13e5da,_0x35292a){if(_0x2401ba[_0x76e6('0xa')](_0x76e6('0xb'))){_0x2401ba[_0x76e6('0xc')]=moment()[_0x76e6('0xd')](_0x76e6('0xe'));}_0x35292a(null,_0x2401ba);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index a807eee..0e0de7d 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 _0x4e1c=['WhatsappInteraction','update','options','raw','where','attributes','AddTagsToWhatsappInteraction','find','addTags','ids','body','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction'];(function(_0x425d5e,_0x3b9040){var _0x3cc67b=function(_0x121446){while(--_0x121446){_0x425d5e['push'](_0x425d5e['shift']());}};_0x3cc67b(++_0x3b9040);}(_0x4e1c,0x1d0));var _0xc4e1=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x4e1c[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xc4e1('0x0'));var util=require(_0xc4e1('0x1'));var moment=require(_0xc4e1('0x2'));var BPromise=require('bluebird');var rs=require(_0xc4e1('0x3'));var fs=require('fs');var Redis=require(_0xc4e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4e1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc4e1('0x6'));var jayson=require(_0xc4e1('0x7'));var client=jayson['client'][_0xc4e1('0x8')]({'port':0x232a});config[_0xc4e1('0x9')]=_[_0xc4e1('0xa')](config[_0xc4e1('0x9')],{'host':_0xc4e1('0xb'),'port':0x18eb});var socket=require(_0xc4e1('0xc'))(new Redis(config['redis']));require(_0xc4e1('0xd'))[_0xc4e1('0xe')](socket);function respondWithRpcPromise(_0x4c1658,_0x24f8e5,_0x33d240){return new BPromise(function(_0x38c117,_0x21c6f2){return client[_0xc4e1('0xf')](_0x4c1658,_0x33d240)[_0xc4e1('0x10')](function(_0x1e9871){logger[_0xc4e1('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x24f8e5,_0xc4e1('0x12'));logger[_0xc4e1('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x24f8e5,'request\x20sent',JSON[_0xc4e1('0x14')](_0x1e9871));if(_0x1e9871[_0xc4e1('0x15')]){if(_0x1e9871[_0xc4e1('0x15')][_0xc4e1('0x16')]===0x1f4){logger[_0xc4e1('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x24f8e5,_0x1e9871['error'][_0xc4e1('0x17')]);return _0x21c6f2(_0x1e9871[_0xc4e1('0x15')][_0xc4e1('0x17')]);}logger[_0xc4e1('0x15')](_0xc4e1('0x18'),_0x24f8e5,_0x1e9871[_0xc4e1('0x15')]['message']);return _0x38c117(_0x1e9871[_0xc4e1('0x15')][_0xc4e1('0x17')]);}else{logger[_0xc4e1('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x24f8e5,_0xc4e1('0x12'));_0x38c117(_0x1e9871[_0xc4e1('0x19')][_0xc4e1('0x17')]);}})[_0xc4e1('0x1a')](function(_0x2026ad){logger[_0xc4e1('0x15')](_0xc4e1('0x18'),_0x24f8e5,_0x2026ad);_0x21c6f2(_0x2026ad);});});}exports[_0xc4e1('0x1b')]=function(_0x4ab1d6){var _0x341323=this;return new Promise(function(_0x5d903c,_0x306d09){return db[_0xc4e1('0x1c')][_0xc4e1('0x1d')](_0x4ab1d6['body'],{'raw':_0x4ab1d6[_0xc4e1('0x1e')]?_0x4ab1d6[_0xc4e1('0x1e')][_0xc4e1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ab1d6[_0xc4e1('0x1e')]?_0x4ab1d6[_0xc4e1('0x1e')][_0xc4e1('0x20')]||null:null,'attributes':_0x4ab1d6['options']?_0x4ab1d6[_0xc4e1('0x1e')][_0xc4e1('0x21')]||null:null,'limit':_0x4ab1d6[_0xc4e1('0x1e')]?_0x4ab1d6['options']['limit']||null:null})[_0xc4e1('0x10')](function(_0x77927b){logger[_0xc4e1('0x11')](_0xc4e1('0x1b'),_0x4ab1d6);logger[_0xc4e1('0x13')]('UpdateWhatsappInteraction',_0x4ab1d6,JSON['stringify'](_0x77927b));_0x5d903c(_0x77927b);})[_0xc4e1('0x1a')](function(_0xd695a4){logger[_0xc4e1('0x15')]('UpdateWhatsappInteraction',_0xd695a4['message'],_0x4ab1d6);_0x306d09(_0x341323[_0xc4e1('0x15')](0x1f4,_0xd695a4[_0xc4e1('0x17')]));});});};exports[_0xc4e1('0x22')]=function(_0x2593cf){return new Promise(function(_0x2f090f,_0x1e4f92){return db[_0xc4e1('0x1c')][_0xc4e1('0x23')]({'where':_0x2593cf[_0xc4e1('0x1e')]?_0x2593cf[_0xc4e1('0x1e')][_0xc4e1('0x20')]||null:null})[_0xc4e1('0x10')](function(_0x456817){if(_0x456817){return _0x456817[_0xc4e1('0x24')](_0x2593cf['body'][_0xc4e1('0x25')],_['omit'](_0x2593cf[_0xc4e1('0x26')],['ids','id'])||{});}})[_0xc4e1('0x27')](function(_0x38e8f8){logger['info'](_0xc4e1('0x28'),_0x2593cf);logger[_0xc4e1('0x13')](_0xc4e1('0x28'),_0x2593cf,JSON[_0xc4e1('0x14')](_0x38e8f8));_0x2f090f(_0x38e8f8);})['catch'](function(_0x480944){logger[_0xc4e1('0x15')](_0xc4e1('0x28'),_0x480944[_0xc4e1('0x17')],_0x2593cf);_0x1e4f92(_this[_0xc4e1('0x15')](0x1f4,_0x480944[_0xc4e1('0x17')]));});});}; \ No newline at end of file +var _0x3c3d=['result','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','where','attributes','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','then','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message'];(function(_0x2ddd4d,_0x54441c){var _0x3dd14d=function(_0x51f12d){while(--_0x51f12d){_0x2ddd4d['push'](_0x2ddd4d['shift']());}};_0x3dd14d(++_0x54441c);}(_0x3c3d,0xb4));var _0xd3c3=function(_0x320f0b,_0x53fadd){_0x320f0b=_0x320f0b-0x0;var _0x42ee31=_0x3c3d[_0x320f0b];return _0x42ee31;};'use strict';var _=require('lodash');var util=require(_0xd3c3('0x0'));var moment=require(_0xd3c3('0x1'));var BPromise=require(_0xd3c3('0x2'));var rs=require(_0xd3c3('0x3'));var fs=require('fs');var Redis=require(_0xd3c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3c3('0x5'));var logger=require(_0xd3c3('0x6'))('rpc');var config=require(_0xd3c3('0x7'));var jayson=require(_0xd3c3('0x8'));var client=jayson[_0xd3c3('0x9')]['http']({'port':0x232a});config[_0xd3c3('0xa')]=_[_0xd3c3('0xb')](config['redis'],{'host':_0xd3c3('0xc'),'port':0x18eb});var socket=require(_0xd3c3('0xd'))(new Redis(config[_0xd3c3('0xa')]));require(_0xd3c3('0xe'))['register'](socket);function respondWithRpcPromise(_0xd3998,_0x56e2f7,_0x212981){return new BPromise(function(_0x2a6b49,_0xde191b){return client['request'](_0xd3998,_0x212981)[_0xd3c3('0xf')](function(_0x40f400){logger[_0xd3c3('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x56e2f7,'request\x20sent');logger[_0xd3c3('0x11')](_0xd3c3('0x12'),_0x56e2f7,_0xd3c3('0x13'),JSON[_0xd3c3('0x14')](_0x40f400));if(_0x40f400[_0xd3c3('0x15')]){if(_0x40f400[_0xd3c3('0x15')][_0xd3c3('0x16')]===0x1f4){logger[_0xd3c3('0x15')](_0xd3c3('0x17'),_0x56e2f7,_0x40f400['error'][_0xd3c3('0x18')]);return _0xde191b(_0x40f400['error'][_0xd3c3('0x18')]);}logger[_0xd3c3('0x15')](_0xd3c3('0x17'),_0x56e2f7,_0x40f400[_0xd3c3('0x15')][_0xd3c3('0x18')]);return _0x2a6b49(_0x40f400[_0xd3c3('0x15')][_0xd3c3('0x18')]);}else{logger['info'](_0xd3c3('0x17'),_0x56e2f7,_0xd3c3('0x13'));_0x2a6b49(_0x40f400[_0xd3c3('0x19')][_0xd3c3('0x18')]);}})[_0xd3c3('0x1a')](function(_0x43f162){logger['error'](_0xd3c3('0x17'),_0x56e2f7,_0x43f162);_0xde191b(_0x43f162);});});}exports[_0xd3c3('0x1b')]=function(_0x279f5d){var _0x855cd6=this;return new Promise(function(_0x3f961f,_0x59369e){return db[_0xd3c3('0x1c')]['update'](_0x279f5d['body'],{'raw':_0x279f5d[_0xd3c3('0x1d')]?_0x279f5d[_0xd3c3('0x1d')][_0xd3c3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x279f5d['options']?_0x279f5d[_0xd3c3('0x1d')][_0xd3c3('0x1f')]||null:null,'attributes':_0x279f5d[_0xd3c3('0x1d')]?_0x279f5d['options'][_0xd3c3('0x20')]||null:null,'limit':_0x279f5d[_0xd3c3('0x1d')]?_0x279f5d[_0xd3c3('0x1d')]['limit']||null:null})[_0xd3c3('0xf')](function(_0x14802a){logger[_0xd3c3('0x10')](_0xd3c3('0x1b'),_0x279f5d);logger['debug'](_0xd3c3('0x1b'),_0x279f5d,JSON[_0xd3c3('0x14')](_0x14802a));_0x3f961f(_0x14802a);})[_0xd3c3('0x1a')](function(_0x219f08){logger[_0xd3c3('0x15')](_0xd3c3('0x1b'),_0x219f08[_0xd3c3('0x18')],_0x279f5d);_0x59369e(_0x855cd6[_0xd3c3('0x15')](0x1f4,_0x219f08[_0xd3c3('0x18')]));});});};exports[_0xd3c3('0x21')]=function(_0x1e0b1b){return new Promise(function(_0x3b64a5,_0x4845be){return db[_0xd3c3('0x1c')][_0xd3c3('0x22')]({'where':_0x1e0b1b['options']?_0x1e0b1b['options'][_0xd3c3('0x1f')]||null:null})[_0xd3c3('0xf')](function(_0x290dc3){if(_0x290dc3){return _0x290dc3[_0xd3c3('0x23')](_0x1e0b1b[_0xd3c3('0x24')][_0xd3c3('0x25')],_[_0xd3c3('0x26')](_0x1e0b1b[_0xd3c3('0x24')],[_0xd3c3('0x25'),'id'])||{});}})[_0xd3c3('0x27')](function(_0x176bc5){logger[_0xd3c3('0x10')](_0xd3c3('0x28'),_0x1e0b1b);logger[_0xd3c3('0x11')](_0xd3c3('0x28'),_0x1e0b1b,JSON['stringify'](_0x176bc5));_0x3b64a5(_0x176bc5);})[_0xd3c3('0x1a')](function(_0x50c98a){logger[_0xd3c3('0x15')]('AddTags',_0x50c98a[_0xd3c3('0x18')],_0x1e0b1b);_0x4845be(_this[_0xd3c3('0x15')](0x1f4,_0x50c98a[_0xd3c3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 71d91e6..a3721db 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 _0xdebb=['emit','removeListener','register','./whatsappInteraction.events','remove'];(function(_0x481f54,_0x3d47d9){var _0x288091=function(_0x53dab5){while(--_0x53dab5){_0x481f54['push'](_0x481f54['shift']());}};_0x288091(++_0x3d47d9);}(_0xdebb,0x17f));var _0xbdeb=function(_0x5dd12d,_0x2689a7){_0x5dd12d=_0x5dd12d-0x0;var _0x1b3136=_0xdebb[_0x5dd12d];return _0x1b3136;};'use strict';var WhatsappInteractionEvents=require(_0xbdeb('0x0'));var events=['save',_0xbdeb('0x1'),'update'];function createListener(_0x5284a4,_0x1a63d1){return function(_0x374724){_0x1a63d1[_0xbdeb('0x2')](_0x5284a4,_0x374724);};}function removeListener(_0x2a7ed1,_0x1b9cd9){return function(){WhatsappInteractionEvents[_0xbdeb('0x3')](_0x2a7ed1,_0x1b9cd9);};}exports[_0xbdeb('0x4')]=function(_0x47b4ec){for(var _0x1ba015=0x0,_0x4aa22f=events['length'];_0x1ba015<_0x4aa22f;_0x1ba015++){var _0x4745e7=events[_0x1ba015];var _0x18acdd=createListener('whatsappInteraction:'+_0x4745e7,_0x47b4ec);WhatsappInteractionEvents['on'](_0x4745e7,_0x18acdd);}}; \ No newline at end of file +var _0x5585=['whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','removeListener','register'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0x5585,0x1eb));var _0x5558=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5585[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappInteractionEvents=require(_0x5558('0x0'));var events=['save',_0x5558('0x1'),_0x5558('0x2')];function createListener(_0x3d93f5,_0x12de68){return function(_0x3b6db6){_0x12de68[_0x5558('0x3')](_0x3d93f5,_0x3b6db6);};}function removeListener(_0x5159e3,_0x4c91ca){return function(){WhatsappInteractionEvents[_0x5558('0x4')](_0x5159e3,_0x4c91ca);};}exports[_0x5558('0x5')]=function(_0x429f2d){for(var _0x2621cf=0x0,_0x31b3b2=events['length'];_0x2621cf<_0x31b3b2;_0x2621cf++){var _0x28c4ce=events[_0x2621cf];var _0x29e55c=createListener(_0x5558('0x6')+_0x28c4ce,_0x429f2d);WhatsappInteractionEvents['on'](_0x28c4ce,_0x29e55c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index c894055..c41ffbd 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 _0x412e=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','get','/describe','describe','/:id','post','tracked','whatsapp','create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x412e,0xda));var _0xe412=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0x412e[_0x54381d];return _0x5308a7;};'use strict';var multer=require(_0xe412('0x0'));var util=require(_0xe412('0x1'));var path=require('path');var timeout=require(_0xe412('0x2'));var express=require(_0xe412('0x3'));var router=express[_0xe412('0x4')]();var fs_extra=require(_0xe412('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe412('0x6'));var config=require('../../config/environment');var controller=require(_0xe412('0x7'));router['get']('/',auth[_0xe412('0x8')](),controller['index']);router[_0xe412('0x9')](_0xe412('0xa'),auth[_0xe412('0x8')](),controller[_0xe412('0xb')]);router[_0xe412('0x9')](_0xe412('0xc'),auth[_0xe412('0x8')](),controller['show']);router[_0xe412('0xd')]('/',auth[_0xe412('0x8')](),interaction[_0xe412('0xe')](_0xe412('0xf'),'whatsappmessage:create'),controller[_0xe412('0x10')]);router[_0xe412('0xd')](_0xe412('0x11'),controller['status']);router[_0xe412('0x12')]('/:id',auth[_0xe412('0x8')](),controller[_0xe412('0x13')]);router[_0xe412('0x12')](_0xe412('0x14'),auth['isAuthenticated'](),controller[_0xe412('0x15')]);router[_0xe412('0x12')](_0xe412('0x16'),auth[_0xe412('0x8')](),controller[_0xe412('0x17')]);router[_0xe412('0x18')](_0xe412('0xc'),auth[_0xe412('0x8')](),controller[_0xe412('0x19')]);module[_0xe412('0x1a')]=router; \ No newline at end of file +var _0x0077=['/:id','update','/:id/accept','accept','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put'];(function(_0x18fb4c,_0x578f22){var _0x4a75b3=function(_0x27d762){while(--_0x27d762){_0x18fb4c['push'](_0x18fb4c['shift']());}};_0x4a75b3(++_0x578f22);}(_0x0077,0xfe));var _0x7007=function(_0x5a5083,_0x3358b0){_0x5a5083=_0x5a5083-0x0;var _0x1f9930=_0x0077[_0x5a5083];return _0x1f9930;};'use strict';var multer=require(_0x7007('0x0'));var util=require('util');var path=require(_0x7007('0x1'));var timeout=require(_0x7007('0x2'));var express=require(_0x7007('0x3'));var router=express[_0x7007('0x4')]();var fs_extra=require(_0x7007('0x5'));var auth=require(_0x7007('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7007('0x7'));var controller=require('./whatsappMessage.controller');router[_0x7007('0x8')]('/',auth[_0x7007('0x9')](),controller['index']);router[_0x7007('0x8')](_0x7007('0xa'),auth[_0x7007('0x9')](),controller[_0x7007('0xb')]);router[_0x7007('0x8')]('/:id',auth[_0x7007('0x9')](),controller[_0x7007('0xc')]);router[_0x7007('0xd')]('/',auth[_0x7007('0x9')](),interaction[_0x7007('0xe')](_0x7007('0xf'),_0x7007('0x10')),controller[_0x7007('0x11')]);router[_0x7007('0xd')](_0x7007('0x12'),controller[_0x7007('0x13')]);router[_0x7007('0x14')](_0x7007('0x15'),auth[_0x7007('0x9')](),controller[_0x7007('0x16')]);router[_0x7007('0x14')](_0x7007('0x17'),auth['isAuthenticated'](),controller[_0x7007('0x18')]);router['put']('/:id/reject',auth[_0x7007('0x9')](),controller['reject']);router['delete'](_0x7007('0x15'),auth[_0x7007('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 890decd..32c0cfe 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 _0x0fa0=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x3585d0,_0x1b92fe){var _0x48233a=function(_0x687ca2){while(--_0x687ca2){_0x3585d0['push'](_0x3585d0['shift']());}};_0x48233a(++_0x1b92fe);}(_0x0fa0,0xbc));var _0x00fa=function(_0x3b41f9,_0x512043){_0x3b41f9=_0x3b41f9-0x0;var _0x48fe2e=_0x0fa0[_0x3b41f9];return _0x48fe2e;};'use strict';var Sequelize=require(_0x00fa('0x0'));module['exports']={'body':{'type':Sequelize[_0x00fa('0x1')](_0x00fa('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x00fa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x00fa('0x4')]('in',_0x00fa('0x5')),'defaultValue':_0x00fa('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x00fa('0x6')](0xbe)},'phone':{'type':Sequelize[_0x00fa('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x00fa('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x00fa('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb077=['DATE','exports','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x1a464,_0x28d9a1){var _0x34c526=function(_0x490a87){while(--_0x490a87){_0x1a464['push'](_0x1a464['shift']());}};_0x34c526(++_0x28d9a1);}(_0xb077,0x7f));var _0x7b07=function(_0x1a6be0,_0x317f11){_0x1a6be0=_0x1a6be0-0x0;var _0x1a0e62=_0xb077[_0x1a6be0];return _0x1a0e62;};'use strict';var Sequelize=require('sequelize');module[_0x7b07('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7b07('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7b07('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7b07('0x3')]('in','out'),'defaultValue':_0x7b07('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7b07('0x5')](0xbe)},'phone':{'type':Sequelize[_0x7b07('0x5')]},'readAt':{'type':Sequelize[_0x7b07('0x6')]},'secret':{'type':Sequelize[_0x7b07('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7b07('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index f2708c2..d31abba 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 _0xe07d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','name','send','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','includeAll','include','findAll','rows','params','WhatsappMessage','options','find','create','body','describe','accept','read','readAt','format','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','rejectmessage','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x45c856,_0x5e6a1e){var _0x4961aa=function(_0x29f14d){while(--_0x29f14d){_0x45c856['push'](_0x45c856['shift']());}};_0x4961aa(++_0x5e6a1e);}(_0xe07d,0x179));var _0xde07=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0xe07d[_0xb7a459];return _0x104ab5;};'use strict';var emlformat=require(_0xde07('0x0'));var rimraf=require(_0xde07('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde07('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xde07('0x3'));var util=require(_0xde07('0x4'));var path=require(_0xde07('0x5'));var sox=require(_0xde07('0x6'));var csv=require(_0xde07('0x7'));var ejs=require(_0xde07('0x8'));var fs=require('fs');var fs_extra=require(_0xde07('0x9'));var _=require(_0xde07('0xa'));var squel=require('squel');var crypto=require(_0xde07('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xde07('0xc'));var toCsv=require(_0xde07('0x7'));var querystring=require('querystring');var Papa=require(_0xde07('0xd'));var Redis=require(_0xde07('0xe'));var authService=require(_0xde07('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xde07('0x10'));var hardwareService=require(_0xde07('0x11'));var logger=require(_0xde07('0x12'))('api');var utils=require(_0xde07('0x13'));var config=require(_0xde07('0x14'));var licenseUtil=require(_0xde07('0x15'));var db=require(_0xde07('0x16'))['db'];config['redis']=_[_0xde07('0x17')](config[_0xde07('0x18')],{'host':_0xde07('0x19'),'port':0x18eb});var socket=require(_0xde07('0x1a'))(new Redis(config[_0xde07('0x18')]));require(_0xde07('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xde07('0x1c')][_0xde07('0x1d')]({'port':0x232c});var client9002=jayson[_0xde07('0x1c')][_0xde07('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x26c410,_0x28afd6,_0xd92309,_0x186f2c){return new BPromise(function(_0x1d2102,_0x41c797){var _0x368ada=_0x186f2c||client;return _0x368ada['request'](_0x26c410,_0xd92309)[_0xde07('0x1e')](function(_0x55134e){logger[_0xde07('0x1f')](_0xde07('0x20'),_0x28afd6,'request\x20sent');logger[_0xde07('0x21')](_0xde07('0x22'),_0x28afd6,_0xde07('0x23'),JSON[_0xde07('0x24')](_0x55134e));if(_0x55134e[_0xde07('0x25')]){if(_0x55134e[_0xde07('0x25')][_0xde07('0x26')]===0x1f4){logger[_0xde07('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x28afd6,_0x55134e[_0xde07('0x25')][_0xde07('0x27')]);return _0x41c797(_0x55134e[_0xde07('0x25')]['message']);}logger[_0xde07('0x25')](_0xde07('0x20'),_0x28afd6,_0x55134e[_0xde07('0x25')][_0xde07('0x27')]);return _0x1d2102(_0x55134e[_0xde07('0x25')][_0xde07('0x27')]);}else{logger[_0xde07('0x1f')](_0xde07('0x20'),_0x28afd6,_0xde07('0x23'));_0x1d2102(_0x55134e[_0xde07('0x28')]['message']);}})[_0xde07('0x29')](function(_0x2f79b0){logger[_0xde07('0x25')](_0xde07('0x20'),_0x28afd6,_0x2f79b0);_0x41c797(_0x2f79b0);});});}function respondWithStatusCode(_0x1e05dc,_0x250b70){_0x250b70=_0x250b70||0xcc;return function(_0x3f9751){if(_0x3f9751){return _0x1e05dc['sendStatus'](_0x250b70);}return _0x1e05dc[_0xde07('0x2a')](_0x250b70)[_0xde07('0x2b')]();};}function respondWithResult(_0x4a067d,_0x5d21fd){_0x5d21fd=_0x5d21fd||0xc8;return function(_0x100584){if(_0x100584){return _0x4a067d[_0xde07('0x2a')](_0x5d21fd)[_0xde07('0x2c')](_0x100584);}};}function respondWithFilteredResult(_0x5a10f2,_0xc6add0){return function(_0x366fd6){if(_0x366fd6){var _0x2600db=typeof _0xc6add0[_0xde07('0x2d')]===_0xde07('0x2e')&&typeof _0xc6add0[_0xde07('0x2f')]==='undefined';var _0x542163=_0x366fd6['count'];var _0x421074=_0x2600db?0x0:_0xc6add0[_0xde07('0x2d')];var _0x27e3e0=_0x2600db?_0x366fd6[_0xde07('0x30')]:_0xc6add0[_0xde07('0x2d')]+_0xc6add0[_0xde07('0x2f')];var _0x2b2c94;if(_0x27e3e0>=_0x542163){_0x27e3e0=_0x542163;_0x2b2c94=0xc8;}else{_0x2b2c94=0xce;}_0x5a10f2[_0xde07('0x2a')](_0x2b2c94);return _0x5a10f2[_0xde07('0x31')](_0xde07('0x32'),_0x421074+'-'+_0x27e3e0+'/'+_0x542163)['json'](_0x366fd6);}return null;};}function patchUpdates(_0x1d8eee){return function(_0x402f59){try{jsonpatch['apply'](_0x402f59,_0x1d8eee,!![]);}catch(_0x52e39b){return BPromise[_0xde07('0x33')](_0x52e39b);}return _0x402f59['save']();};}function saveUpdates(_0xc2e8bf,_0x118afa){return function(_0xe53132){if(_0xe53132){return _0xe53132[_0xde07('0x34')](_0xc2e8bf)[_0xde07('0x1e')](function(_0x59dd84){return _0x59dd84;});}return null;};}function removeEntity(_0x365a47,_0x1f56e1){return function(_0x25213a){if(_0x25213a){return _0x25213a[_0xde07('0x35')]()[_0xde07('0x1e')](function(){_0x365a47[_0xde07('0x2a')](0xcc)[_0xde07('0x2b')]();});}};}function handleEntityNotFound(_0x1d96e4,_0xa1aaee){return function(_0x5c2fec){if(!_0x5c2fec){_0x1d96e4['sendStatus'](0x194);}return _0x5c2fec;};}function handleError(_0x5d078a,_0x170980){_0x170980=_0x170980||0x1f4;return function(_0x20fe5f){logger['error'](_0x20fe5f['stack']);if(_0x20fe5f[_0xde07('0x36')]){delete _0x20fe5f[_0xde07('0x36')];}_0x5d078a['status'](_0x170980)[_0xde07('0x37')](_0x20fe5f);};}exports[_0xde07('0x38')]=function(_0x5d4fba,_0x22cd52){var _0x1ab8a6={},_0x9eed5c={},_0x5b0151={'count':0x0,'rows':[]};var _0x26d8f3=_[_0xde07('0x39')](db['WhatsappMessage'][_0xde07('0x3a')],function(_0x50868a){return{'name':_0x50868a[_0xde07('0x3b')],'type':_0x50868a['type'][_0xde07('0x3c')]};});_0x9eed5c[_0xde07('0x3d')]=_[_0xde07('0x39')](_0x26d8f3,_0xde07('0x36'));_0x9eed5c['query']=_[_0xde07('0x3e')](_0x5d4fba['query']);_0x9eed5c[_0xde07('0x3f')]=_[_0xde07('0x40')](_0x9eed5c[_0xde07('0x3d')],_0x9eed5c[_0xde07('0x41')]);_0x1ab8a6[_0xde07('0x42')]=_[_0xde07('0x40')](_0x9eed5c[_0xde07('0x3d')],qs[_0xde07('0x43')](_0x5d4fba['query'][_0xde07('0x43')]));_0x1ab8a6[_0xde07('0x42')]=_0x1ab8a6[_0xde07('0x42')][_0xde07('0x44')]?_0x1ab8a6[_0xde07('0x42')]:_0x9eed5c[_0xde07('0x3d')];if(!_0x5d4fba[_0xde07('0x41')][_0xde07('0x45')](_0xde07('0x46'))){_0x1ab8a6[_0xde07('0x2f')]=qs[_0xde07('0x2f')](_0x5d4fba[_0xde07('0x41')][_0xde07('0x2f')]);_0x1ab8a6['offset']=qs[_0xde07('0x2d')](_0x5d4fba['query'][_0xde07('0x2d')]);}_0x1ab8a6[_0xde07('0x47')]=qs['sort'](_0x5d4fba[_0xde07('0x41')][_0xde07('0x48')]);_0x1ab8a6[_0xde07('0x49')]=qs[_0xde07('0x3f')](_['pick'](_0x5d4fba[_0xde07('0x41')],_0x9eed5c[_0xde07('0x3f')]),_0x26d8f3);if(_0x5d4fba['query']['filter']){_0x1ab8a6['where']=_[_0xde07('0x4a')](_0x1ab8a6[_0xde07('0x49')],{'$or':_[_0xde07('0x39')](_0x26d8f3,function(_0x5dd7bb){if(_0x5dd7bb[_0xde07('0x4b')]!=='VIRTUAL'){var _0x457be5={};_0x457be5[_0x5dd7bb[_0xde07('0x36')]]={'$like':'%'+_0x5d4fba[_0xde07('0x41')][_0xde07('0x4c')]+'%'};return _0x457be5;}})});}_0x1ab8a6=_[_0xde07('0x4a')]({},_0x1ab8a6,_0x5d4fba['options']);var _0x5bfb6a={'where':_0x1ab8a6[_0xde07('0x49')]};return db['WhatsappMessage'][_0xde07('0x30')](_0x5bfb6a)[_0xde07('0x1e')](function(_0x22cbc9){_0x5b0151['count']=_0x22cbc9;if(_0x5d4fba['query'][_0xde07('0x4d')]){_0x1ab8a6[_0xde07('0x4e')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xde07('0x4f')](_0x1ab8a6);})['then'](function(_0x428ef6){_0x5b0151[_0xde07('0x50')]=_0x428ef6;return _0x5b0151;})[_0xde07('0x1e')](respondWithFilteredResult(_0x22cd52,_0x1ab8a6))[_0xde07('0x29')](handleError(_0x22cd52,null));};exports['show']=function(_0x2a00ff,_0x343c0d){var _0xe19670={'raw':!![],'where':{'id':_0x2a00ff[_0xde07('0x51')]['id']}},_0x4ac89b={};_0x4ac89b[_0xde07('0x3d')]=_[_0xde07('0x3e')](db[_0xde07('0x52')][_0xde07('0x3a')]);_0x4ac89b['query']=_[_0xde07('0x3e')](_0x2a00ff['query']);_0x4ac89b[_0xde07('0x3f')]=_[_0xde07('0x40')](_0x4ac89b[_0xde07('0x3d')],_0x4ac89b[_0xde07('0x41')]);_0xe19670[_0xde07('0x42')]=_[_0xde07('0x40')](_0x4ac89b[_0xde07('0x3d')],qs['fields'](_0x2a00ff[_0xde07('0x41')][_0xde07('0x43')]));_0xe19670['attributes']=_0xe19670[_0xde07('0x42')]['length']?_0xe19670[_0xde07('0x42')]:_0x4ac89b['model'];if(_0x2a00ff[_0xde07('0x41')]['includeAll']){_0xe19670[_0xde07('0x4e')]=[{'all':!![]}];}_0xe19670=_[_0xde07('0x4a')]({},_0xe19670,_0x2a00ff[_0xde07('0x53')]);return db[_0xde07('0x52')][_0xde07('0x54')](_0xe19670)[_0xde07('0x1e')](handleEntityNotFound(_0x343c0d,null))[_0xde07('0x1e')](respondWithResult(_0x343c0d,null))[_0xde07('0x29')](handleError(_0x343c0d,null));};exports[_0xde07('0x55')]=function(_0x1d59ab,_0x5de2d2){return db[_0xde07('0x52')][_0xde07('0x55')](_0x1d59ab[_0xde07('0x56')],{})[_0xde07('0x1e')](respondWithResult(_0x5de2d2,0xc9))[_0xde07('0x29')](handleError(_0x5de2d2,null));};exports[_0xde07('0x34')]=function(_0x1208af,_0x3fd459){if(_0x1208af[_0xde07('0x56')]['id']){delete _0x1208af['body']['id'];}return db['WhatsappMessage'][_0xde07('0x54')]({'where':{'id':_0x1208af['params']['id']}})['then'](handleEntityNotFound(_0x3fd459,null))[_0xde07('0x1e')](saveUpdates(_0x1208af[_0xde07('0x56')],null))['then'](respondWithResult(_0x3fd459,null))['catch'](handleError(_0x3fd459,null));};exports[_0xde07('0x35')]=function(_0x4742e1,_0x4a80eb){return db[_0xde07('0x52')][_0xde07('0x54')]({'where':{'id':_0x4742e1[_0xde07('0x51')]['id']}})['then'](handleEntityNotFound(_0x4a80eb,null))['then'](removeEntity(_0x4a80eb,null))['catch'](handleError(_0x4a80eb,null));};exports[_0xde07('0x57')]=function(_0x47360d,_0x11b2ef){return db[_0xde07('0x52')]['describe']()[_0xde07('0x1e')](respondWithResult(_0x11b2ef,null))['catch'](handleError(_0x11b2ef,null));};var interaction_log=require(_0xde07('0x12'))('whatsapp-interactions');exports[_0xde07('0x58')]=function(_0x56920b,_0x37188e,_0x570356){var _0x42c51d={'agent':{},'channel':'whatsapp'};if(_0x56920b[_0xde07('0x56')]['id']){delete _0x56920b[_0xde07('0x56')]['id'];}_0x56920b[_0xde07('0x56')][_0xde07('0x59')]=!![];_0x56920b[_0xde07('0x56')][_0xde07('0x5a')]=moment()[_0xde07('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x56920b['body'][_0xde07('0x5c')]=_0x56920b[_0xde07('0x56')]['UserId']||_0x56920b['user']['id'];_0x42c51d[_0xde07('0x5d')]['id']=_0x56920b[_0xde07('0x56')][_0xde07('0x5c')];return db[_0xde07('0x52')][_0xde07('0x54')]({'where':{'id':_0x56920b[_0xde07('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x37188e,null))[_0xde07('0x1e')](saveUpdates(_0x56920b['body'],null))[_0xde07('0x1e')](function(_0x37d7d1){if(_0x37d7d1){_0x42c51d[_0xde07('0x27')]=_0x37d7d1[_0xde07('0x5e')]({'plain':!![]});return db[_0xde07('0x5f')][_0xde07('0x54')]({'where':{'id':_0x37d7d1[_0xde07('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x37188e,null))[_0xde07('0x1e')](function(_0x2289f3){if(_0x2289f3){return _0x2289f3[_0xde07('0x34')]({'UserId':_0x56920b[_0xde07('0x56')][_0xde07('0x5c')],'read1stAt':_[_0xde07('0x61')](_0x2289f3[_0xde07('0x62')])?moment()[_0xde07('0x5b')](_0xde07('0x63')):undefined});}return null;})['then'](function(_0x2b8cc3){if(_0x2b8cc3){_0x42c51d['interaction']=_0x2b8cc3['get']({'plain':!![]});interaction_log[_0xde07('0x1f')](_0xde07('0x64'),_0x56920b[_0xde07('0x65')]['id'],_0x56920b[_0xde07('0x65')]['name'],_0x56920b[_0xde07('0x65')]['role'],_0x42c51d[_0xde07('0x66')]['id'],_0x56920b[_0xde07('0x56')]?JSON[_0xde07('0x24')](_0x56920b[_0xde07('0x56')]):_0xde07('0x67'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x42c51d);}return null;})[_0xde07('0x1e')](function(_0x3a4a94){var _0x23fb76=_0xde07('0x68')+_0x3a4a94[_0xde07('0x27')][_0xde07('0x69')];return db[_0xde07('0x6a')][_0xde07('0x41')](_0x23fb76,{'type':db[_0xde07('0x6b')][_0xde07('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x17a8d4){return _0x17a8d4;});})[_0xde07('0x1e')](function(_0x272bb9){if(_0x272bb9){_0x42c51d['message'][_0xde07('0x6d')]=_0x272bb9[0x0];if(!_0x56920b[_0xde07('0x56')]['UserId'])return;return db[_0xde07('0x6e')][_0xde07('0x54')]({'where':{'id':_0x56920b[_0xde07('0x56')][_0xde07('0x5c')],'role':'agent'},'attributes':['id','name',_0xde07('0x6f'),_0xde07('0x70'),_0xde07('0x71')],'raw':!![]});}return null;})[_0xde07('0x1e')](function(_0x417b8d){if(!_0x417b8d)return null;_0x42c51d['message'][_0xde07('0x5d')]=_0x417b8d;return _0x42c51d;})[_0xde07('0x1e')](function(_0x39b36b){if(_0x39b36b){if(_0x56920b[_0xde07('0x56')][_0xde07('0x72')]){_0x42c51d[_0xde07('0x27')]['interface']=util[_0xde07('0x5b')]('SIP/%s',_0x56920b[_0xde07('0x65')][_0xde07('0x36')]);_0x42c51d[_0xde07('0x27')][_0xde07('0x73')]=_0x42c51d[_0xde07('0x73')];_0x42c51d[_0xde07('0x27')][_0xde07('0x74')]=_0x42c51d[_0xde07('0x73')];_0x42c51d[_0xde07('0x27')][_0xde07('0x75')]=_0xde07('0x58');return respondWithRpcPromise(_0xde07('0x76'),'EventManager',{'event':_0xde07('0x77'),'message':_0x42c51d[_0xde07('0x27')]},client9002)[_0xde07('0x1e')](function(){return _0x42c51d;});}return _0x42c51d;}return null;})[_0xde07('0x1e')](respondWithResult(_0x37188e,null))['catch'](handleError(_0x37188e,null));};var interaction_log=require('../../config/logger')(_0xde07('0x78'));exports[_0xde07('0x33')]=function(_0x5f4042,_0x1d156e,_0x2a0b28){var _0x114cea={'agent':{},'channel':'whatsapp'};if(_0x5f4042[_0xde07('0x56')]['id']){delete _0x5f4042['body']['id'];}_0x5f4042[_0xde07('0x56')][_0xde07('0x5c')]=_0x5f4042[_0xde07('0x56')][_0xde07('0x5c')]||_0x5f4042[_0xde07('0x65')]['id'];_0x114cea['agent']['id']=_0x5f4042[_0xde07('0x56')]['UserId'];return db[_0xde07('0x52')][_0xde07('0x54')]({'where':{'id':_0x5f4042['params']['id'],'UserId':null}})[_0xde07('0x1e')](handleEntityNotFound(_0x1d156e,null))[_0xde07('0x1e')](function(_0xfa0b4c){if(_0xfa0b4c){_0x114cea[_0xde07('0x27')]=_0xfa0b4c['get']({'plain':!![]});return db[_0xde07('0x5f')][_0xde07('0x54')]({'where':{'id':_0xfa0b4c[_0xde07('0x60')]}});}return null;})[_0xde07('0x1e')](handleEntityNotFound(_0x1d156e,null))[_0xde07('0x1e')](function(_0x3b6345){if(_0x3b6345){_0x114cea[_0xde07('0x66')]=_0x3b6345['get']({'plain':!![]});interaction_log[_0xde07('0x1f')](_0xde07('0x79'),_0x5f4042[_0xde07('0x65')]['id'],_0x5f4042[_0xde07('0x65')][_0xde07('0x36')],_0x5f4042[_0xde07('0x65')][_0xde07('0x7a')],_0x114cea[_0xde07('0x66')]['id'],_0x5f4042['body']?JSON[_0xde07('0x24')](_0x5f4042[_0xde07('0x56')]):_0xde07('0x67'));return respondWithRpcPromise(_0xde07('0x7b'),_0xde07('0x7c'),_0x114cea);}return null;})[_0xde07('0x1e')](function(_0x1a1b2d){var _0x157930=_0xde07('0x68')+_0x1a1b2d[_0xde07('0x27')][_0xde07('0x69')];return db['sequelize']['query'](_0x157930,{'type':db[_0xde07('0x6b')][_0xde07('0x6c')][_0xde07('0x7d')],'raw':!![]})[_0xde07('0x1e')](function(_0x4223f2){return _0x4223f2;});})[_0xde07('0x1e')](function(_0x2e27cb){if(_0x2e27cb){_0x114cea[_0xde07('0x27')][_0xde07('0x6d')]=_0x2e27cb[0x0];if(!_0x5f4042[_0xde07('0x56')]['UserId'])return;return db['User'][_0xde07('0x54')]({'where':{'id':_0x5f4042['body'][_0xde07('0x5c')],'role':_0xde07('0x5d')},'attributes':['id','name',_0xde07('0x6f'),'email',_0xde07('0x71')],'raw':!![]});}return null;})['then'](function(_0x4b00c0){if(!_0x4b00c0)return null;_0x114cea[_0xde07('0x27')]['agent']=_0x4b00c0;return _0x114cea;})[_0xde07('0x1e')](function(_0x274112){if(_0x274112){_0x274112[_0xde07('0x27')]['interface']=util[_0xde07('0x5b')]('SIP/%s',_0x5f4042['user'][_0xde07('0x36')]);_0x274112[_0xde07('0x27')]['channel']=_0x114cea[_0xde07('0x73')];_0x274112['message']['motionChannel']=_0x114cea[_0xde07('0x73')];_0x274112['message'][_0xde07('0x75')]='reject';respondWithRpcPromise('EventManager',_0xde07('0x76'),{'event':_0xde07('0x7e'),'message':_0x274112[_0xde07('0x27')]},client9002);return _0x114cea;}return null;})[_0xde07('0x1e')](respondWithResult(_0x1d156e,null))['catch'](handleError(_0x1d156e,null));};exports['status']=function(_0x4bf59e,_0x401086,_0x4d99f6){if(_0x4bf59e['body']['id']){delete _0x4bf59e['body']['id'];}var _0x3c59b8;return db[_0xde07('0x52')][_0xde07('0x54')]({'where':{'id':_0x4bf59e[_0xde07('0x51')]['id']}})[_0xde07('0x1e')](handleEntityNotFound(_0x401086,null))[_0xde07('0x1e')](function(_0x178091){if(_0x178091){_0x3c59b8=_0x178091;return db['WhatsappAccount'][_0xde07('0x54')]({'where':{'id':_0x178091['WhatsappAccountId']}});}})[_0xde07('0x1e')](handleEntityNotFound(_0x401086,null))['then'](function(_0x13f669){if(_0x13f669){logger[_0xde07('0x21')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xde07('0x2a'),_0xde07('0x7f'),_0x13f669[_0xde07('0x4b')],util[_0xde07('0x80')](_0x4bf59e[_0xde07('0x56')],{'showHidden':![],'depth':null}));switch(_0x13f669[_0xde07('0x4b')]){case'twilio':if(_0x4bf59e['body'][_0xde07('0x81')]&&_0x4bf59e['body']['MessageSid']===_0x3c59b8[_0xde07('0x82')]&&_0x4bf59e[_0xde07('0x56')]['MessageStatus']&&_0x4bf59e[_0xde07('0x56')]['MessageStatus']===_0xde07('0x59')){return _0x3c59b8[_0xde07('0x34')]({'read':!![]});}else{logger[_0xde07('0x25')](_0xde07('0x83'),_0xde07('0x2a'),'twilio',util[_0xde07('0x80')](_0x4bf59e[_0xde07('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x3c59b8;}})[_0xde07('0x1e')](respondWithResult(_0x401086,null))[_0xde07('0x29')](handleError(_0x401086,null));}; \ No newline at end of file +var _0xe9ff=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','WhatsappMessage,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','WhatsappMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','options','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','User','agent','fullname','manual','channel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','contact','email','internal','SIP/%s','rejectmessage','WhatsppMessage,\x20%s,\x20%s,\x20%s','type','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format'];(function(_0x48817d,_0x12a7cf){var _0x3ffdae=function(_0x9d0313){while(--_0x9d0313){_0x48817d['push'](_0x48817d['shift']());}};_0x3ffdae(++_0x12a7cf);}(_0xe9ff,0x19a));var _0xfe9f=function(_0x19285b,_0x5b7229){_0x19285b=_0x19285b-0x0;var _0x507e95=_0xe9ff[_0x19285b];return _0x507e95;};'use strict';var emlformat=require(_0xfe9f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe9f('0x1'));var jsonpatch=require(_0xfe9f('0x2'));var rp=require(_0xfe9f('0x3'));var moment=require(_0xfe9f('0x4'));var BPromise=require(_0xfe9f('0x5'));var Mustache=require('mustache');var util=require(_0xfe9f('0x6'));var path=require(_0xfe9f('0x7'));var sox=require(_0xfe9f('0x8'));var csv=require(_0xfe9f('0x9'));var ejs=require(_0xfe9f('0xa'));var fs=require('fs');var fs_extra=require(_0xfe9f('0xb'));var _=require(_0xfe9f('0xc'));var squel=require(_0xfe9f('0xd'));var crypto=require('crypto');var jsforce=require(_0xfe9f('0xe'));var deskjs=require(_0xfe9f('0xf'));var toCsv=require(_0xfe9f('0x9'));var querystring=require(_0xfe9f('0x10'));var Papa=require('papaparse');var Redis=require(_0xfe9f('0x11'));var authService=require(_0xfe9f('0x12'));var qs=require(_0xfe9f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfe9f('0x14'));var utils=require('../../config/utils');var config=require(_0xfe9f('0x15'));var licenseUtil=require(_0xfe9f('0x16'));var db=require('../../mysqldb')['db'];config[_0xfe9f('0x17')]=_[_0xfe9f('0x18')](config[_0xfe9f('0x17')],{'host':_0xfe9f('0x19'),'port':0x18eb});var socket=require(_0xfe9f('0x1a'))(new Redis(config[_0xfe9f('0x17')]));require(_0xfe9f('0x1b'))[_0xfe9f('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfe9f('0x1d')][_0xfe9f('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xfe9f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x186726,_0x2a072c,_0xe52b42,_0x3601dd){return new BPromise(function(_0x46d8b3,_0x52bc84){var _0x1fafc6=_0x3601dd||client;return _0x1fafc6['request'](_0x186726,_0xe52b42)[_0xfe9f('0x1f')](function(_0x510754){logger[_0xfe9f('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x2a072c,_0xfe9f('0x21'));logger['debug'](_0xfe9f('0x22'),_0x2a072c,_0xfe9f('0x21'),JSON[_0xfe9f('0x23')](_0x510754));if(_0x510754['error']){if(_0x510754['error'][_0xfe9f('0x24')]===0x1f4){logger[_0xfe9f('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x2a072c,_0x510754[_0xfe9f('0x25')][_0xfe9f('0x26')]);return _0x52bc84(_0x510754['error'][_0xfe9f('0x26')]);}logger[_0xfe9f('0x25')](_0xfe9f('0x27'),_0x2a072c,_0x510754[_0xfe9f('0x25')][_0xfe9f('0x26')]);return _0x46d8b3(_0x510754[_0xfe9f('0x25')]['message']);}else{logger[_0xfe9f('0x20')](_0xfe9f('0x27'),_0x2a072c,_0xfe9f('0x21'));_0x46d8b3(_0x510754['result']['message']);}})[_0xfe9f('0x28')](function(_0x440fe1){logger[_0xfe9f('0x25')](_0xfe9f('0x27'),_0x2a072c,_0x440fe1);_0x52bc84(_0x440fe1);});});}function respondWithStatusCode(_0x8609da,_0x47c786){_0x47c786=_0x47c786||0xcc;return function(_0x3881cb){if(_0x3881cb){return _0x8609da[_0xfe9f('0x29')](_0x47c786);}return _0x8609da[_0xfe9f('0x2a')](_0x47c786)[_0xfe9f('0x2b')]();};}function respondWithResult(_0x56603d,_0x2e9311){_0x2e9311=_0x2e9311||0xc8;return function(_0x4551f0){if(_0x4551f0){return _0x56603d[_0xfe9f('0x2a')](_0x2e9311)[_0xfe9f('0x2c')](_0x4551f0);}};}function respondWithFilteredResult(_0x5a8af5,_0x5f1cbf){return function(_0x5bbb7f){if(_0x5bbb7f){var _0x26d37c=typeof _0x5f1cbf[_0xfe9f('0x2d')]==='undefined'&&typeof _0x5f1cbf['limit']==='undefined';var _0x30474c=_0x5bbb7f[_0xfe9f('0x2e')];var _0x1b5ca2=_0x26d37c?0x0:_0x5f1cbf[_0xfe9f('0x2d')];var _0x3fa98e=_0x26d37c?_0x5bbb7f['count']:_0x5f1cbf['offset']+_0x5f1cbf[_0xfe9f('0x2f')];var _0x3aaa4c;if(_0x3fa98e>=_0x30474c){_0x3fa98e=_0x30474c;_0x3aaa4c=0xc8;}else{_0x3aaa4c=0xce;}_0x5a8af5[_0xfe9f('0x2a')](_0x3aaa4c);return _0x5a8af5['set'](_0xfe9f('0x30'),_0x1b5ca2+'-'+_0x3fa98e+'/'+_0x30474c)['json'](_0x5bbb7f);}return null;};}function patchUpdates(_0x2e73aa){return function(_0x44ab8e){try{jsonpatch[_0xfe9f('0x31')](_0x44ab8e,_0x2e73aa,!![]);}catch(_0x1c2a3a){return BPromise[_0xfe9f('0x32')](_0x1c2a3a);}return _0x44ab8e[_0xfe9f('0x33')]();};}function saveUpdates(_0x5ced8c,_0x5ea3fd){return function(_0xba882c){if(_0xba882c){return _0xba882c[_0xfe9f('0x34')](_0x5ced8c)[_0xfe9f('0x1f')](function(_0x48f2f9){return _0x48f2f9;});}return null;};}function removeEntity(_0x5e2dad,_0x418d8c){return function(_0x145350){if(_0x145350){return _0x145350[_0xfe9f('0x35')]()['then'](function(){_0x5e2dad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x164916,_0x32df92){return function(_0x3d1fe4){if(!_0x3d1fe4){_0x164916[_0xfe9f('0x29')](0x194);}return _0x3d1fe4;};}function handleError(_0x554bd5,_0x3553f5){_0x3553f5=_0x3553f5||0x1f4;return function(_0x4059c3){logger[_0xfe9f('0x25')](_0x4059c3[_0xfe9f('0x36')]);if(_0x4059c3[_0xfe9f('0x37')]){delete _0x4059c3[_0xfe9f('0x37')];}_0x554bd5[_0xfe9f('0x2a')](_0x3553f5)[_0xfe9f('0x38')](_0x4059c3);};}exports[_0xfe9f('0x39')]=function(_0x250a09,_0x519b5a){var _0x32e169={},_0x5f2119={},_0x3ca11c={'count':0x0,'rows':[]};var _0x183658=_[_0xfe9f('0x3a')](db['WhatsappMessage']['rawAttributes'],function(_0x225fd8){return{'name':_0x225fd8['fieldName'],'type':_0x225fd8['type'][_0xfe9f('0x3b')]};});_0x5f2119[_0xfe9f('0x3c')]=_[_0xfe9f('0x3a')](_0x183658,_0xfe9f('0x37'));_0x5f2119[_0xfe9f('0x3d')]=_['keys'](_0x250a09[_0xfe9f('0x3d')]);_0x5f2119['filters']=_[_0xfe9f('0x3e')](_0x5f2119['model'],_0x5f2119[_0xfe9f('0x3d')]);_0x32e169[_0xfe9f('0x3f')]=_[_0xfe9f('0x3e')](_0x5f2119[_0xfe9f('0x3c')],qs['fields'](_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x40')]));_0x32e169[_0xfe9f('0x3f')]=_0x32e169[_0xfe9f('0x3f')]['length']?_0x32e169['attributes']:_0x5f2119[_0xfe9f('0x3c')];if(!_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x41')](_0xfe9f('0x42'))){_0x32e169[_0xfe9f('0x2f')]=qs[_0xfe9f('0x2f')](_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x2f')]);_0x32e169['offset']=qs[_0xfe9f('0x2d')](_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x2d')]);}_0x32e169[_0xfe9f('0x43')]=qs[_0xfe9f('0x44')](_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x44')]);_0x32e169[_0xfe9f('0x45')]=qs[_0xfe9f('0x46')](_['pick'](_0x250a09[_0xfe9f('0x3d')],_0x5f2119[_0xfe9f('0x46')]),_0x183658);if(_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x47')]){_0x32e169[_0xfe9f('0x45')]=_['merge'](_0x32e169[_0xfe9f('0x45')],{'$or':_[_0xfe9f('0x3a')](_0x183658,function(_0x3135f8){if(_0x3135f8['type']!=='VIRTUAL'){var _0x45e03c={};_0x45e03c[_0x3135f8['name']]={'$like':'%'+_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x47')]+'%'};return _0x45e03c;}})});}_0x32e169=_[_0xfe9f('0x48')]({},_0x32e169,_0x250a09['options']);var _0x1736f9={'where':_0x32e169[_0xfe9f('0x45')]};return db[_0xfe9f('0x49')]['count'](_0x1736f9)[_0xfe9f('0x1f')](function(_0x2b81e7){_0x3ca11c[_0xfe9f('0x2e')]=_0x2b81e7;if(_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x4a')]){_0x32e169[_0xfe9f('0x4b')]=[{'all':!![]}];}return db[_0xfe9f('0x49')][_0xfe9f('0x4c')](_0x32e169);})['then'](function(_0x28eee5){_0x3ca11c[_0xfe9f('0x4d')]=_0x28eee5;return _0x3ca11c;})[_0xfe9f('0x1f')](respondWithFilteredResult(_0x519b5a,_0x32e169))[_0xfe9f('0x28')](handleError(_0x519b5a,null));};exports[_0xfe9f('0x4e')]=function(_0x1e6805,_0x252df9){var _0x154314={'raw':!![],'where':{'id':_0x1e6805[_0xfe9f('0x4f')]['id']}},_0x3666ef={};_0x3666ef[_0xfe9f('0x3c')]=_[_0xfe9f('0x50')](db['WhatsappMessage'][_0xfe9f('0x51')]);_0x3666ef['query']=_[_0xfe9f('0x50')](_0x1e6805[_0xfe9f('0x3d')]);_0x3666ef['filters']=_[_0xfe9f('0x3e')](_0x3666ef['model'],_0x3666ef[_0xfe9f('0x3d')]);_0x154314['attributes']=_['intersection'](_0x3666ef[_0xfe9f('0x3c')],qs['fields'](_0x1e6805[_0xfe9f('0x3d')][_0xfe9f('0x40')]));_0x154314[_0xfe9f('0x3f')]=_0x154314['attributes'][_0xfe9f('0x52')]?_0x154314['attributes']:_0x3666ef[_0xfe9f('0x3c')];if(_0x1e6805[_0xfe9f('0x3d')]['includeAll']){_0x154314[_0xfe9f('0x4b')]=[{'all':!![]}];}_0x154314=_[_0xfe9f('0x48')]({},_0x154314,_0x1e6805[_0xfe9f('0x53')]);return db['WhatsappMessage'][_0xfe9f('0x54')](_0x154314)[_0xfe9f('0x1f')](handleEntityNotFound(_0x252df9,null))[_0xfe9f('0x1f')](respondWithResult(_0x252df9,null))['catch'](handleError(_0x252df9,null));};exports[_0xfe9f('0x55')]=function(_0x214008,_0x47d2de){return db[_0xfe9f('0x49')][_0xfe9f('0x55')](_0x214008[_0xfe9f('0x56')],{})['then'](respondWithResult(_0x47d2de,0xc9))[_0xfe9f('0x28')](handleError(_0x47d2de,null));};exports['update']=function(_0x1d0885,_0x2cc783){if(_0x1d0885['body']['id']){delete _0x1d0885['body']['id'];}return db[_0xfe9f('0x49')][_0xfe9f('0x54')]({'where':{'id':_0x1d0885[_0xfe9f('0x4f')]['id']}})[_0xfe9f('0x1f')](handleEntityNotFound(_0x2cc783,null))[_0xfe9f('0x1f')](saveUpdates(_0x1d0885[_0xfe9f('0x56')],null))[_0xfe9f('0x1f')](respondWithResult(_0x2cc783,null))[_0xfe9f('0x28')](handleError(_0x2cc783,null));};exports[_0xfe9f('0x35')]=function(_0xca53ac,_0x5c3560){return db[_0xfe9f('0x49')][_0xfe9f('0x54')]({'where':{'id':_0xca53ac[_0xfe9f('0x4f')]['id']}})[_0xfe9f('0x1f')](handleEntityNotFound(_0x5c3560,null))[_0xfe9f('0x1f')](removeEntity(_0x5c3560,null))[_0xfe9f('0x28')](handleError(_0x5c3560,null));};exports[_0xfe9f('0x57')]=function(_0xed68b0,_0x318c4e){return db['WhatsappMessage']['describe']()[_0xfe9f('0x1f')](respondWithResult(_0x318c4e,null))[_0xfe9f('0x28')](handleError(_0x318c4e,null));};var interaction_log=require(_0xfe9f('0x58'))(_0xfe9f('0x59'));exports[_0xfe9f('0x5a')]=function(_0x346d72,_0x4e80b2,_0x11e1a6){var _0x4ed8d7={'agent':{},'channel':_0xfe9f('0x5b')};if(_0x346d72[_0xfe9f('0x56')]['id']){delete _0x346d72[_0xfe9f('0x56')]['id'];}_0x346d72['body'][_0xfe9f('0x5c')]=!![];_0x346d72['body'][_0xfe9f('0x5d')]=moment()[_0xfe9f('0x5e')](_0xfe9f('0x5f'));_0x346d72['body'][_0xfe9f('0x60')]=_0x346d72['body']['UserId']||_0x346d72[_0xfe9f('0x61')]['id'];_0x4ed8d7['agent']['id']=_0x346d72[_0xfe9f('0x56')][_0xfe9f('0x60')];return db[_0xfe9f('0x49')][_0xfe9f('0x54')]({'where':{'id':_0x346d72[_0xfe9f('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e80b2,null))[_0xfe9f('0x1f')](saveUpdates(_0x346d72[_0xfe9f('0x56')],null))[_0xfe9f('0x1f')](function(_0x3631db){if(_0x3631db){_0x4ed8d7[_0xfe9f('0x26')]=_0x3631db['get']({'plain':!![]});return db[_0xfe9f('0x62')][_0xfe9f('0x54')]({'where':{'id':_0x3631db[_0xfe9f('0x63')]}});}return null;})[_0xfe9f('0x1f')](handleEntityNotFound(_0x4e80b2,null))[_0xfe9f('0x1f')](function(_0x22d847){if(_0x22d847){return _0x22d847[_0xfe9f('0x34')]({'UserId':_0x346d72[_0xfe9f('0x56')][_0xfe9f('0x60')],'read1stAt':_['isNil'](_0x22d847[_0xfe9f('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xfe9f('0x1f')](function(_0x1934d7){if(_0x1934d7){_0x4ed8d7[_0xfe9f('0x65')]=_0x1934d7[_0xfe9f('0x66')]({'plain':!![]});interaction_log[_0xfe9f('0x20')](_0xfe9f('0x67'),_0x346d72[_0xfe9f('0x61')]['id'],_0x346d72[_0xfe9f('0x61')][_0xfe9f('0x37')],_0x346d72[_0xfe9f('0x61')]['role'],_0x4ed8d7['interaction']['id'],_0x346d72[_0xfe9f('0x56')]?JSON[_0xfe9f('0x23')](_0x346d72[_0xfe9f('0x56')]):_0xfe9f('0x68'));return respondWithRpcPromise(_0xfe9f('0x69'),_0xfe9f('0x6a'),_0x4ed8d7);}return null;})['then'](function(_0x29abe1){var _0x3f9356=_0xfe9f('0x6b')+_0x29abe1['message'][_0xfe9f('0x6c')];return db[_0xfe9f('0x6d')][_0xfe9f('0x3d')](_0x3f9356,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xfe9f('0x1f')](function(_0x5b9243){return _0x5b9243;});})[_0xfe9f('0x1f')](function(_0x268213){if(_0x268213){_0x4ed8d7[_0xfe9f('0x26')]['contact']=_0x268213[0x0];if(!_0x346d72[_0xfe9f('0x56')][_0xfe9f('0x60')])return;return db[_0xfe9f('0x6e')][_0xfe9f('0x54')]({'where':{'id':_0x346d72[_0xfe9f('0x56')]['UserId'],'role':_0xfe9f('0x6f')},'attributes':['id',_0xfe9f('0x37'),_0xfe9f('0x70'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x25b133){if(!_0x25b133)return null;_0x4ed8d7[_0xfe9f('0x26')][_0xfe9f('0x6f')]=_0x25b133;return _0x4ed8d7;})[_0xfe9f('0x1f')](function(_0x48ee2e){if(_0x48ee2e){if(_0x346d72[_0xfe9f('0x56')][_0xfe9f('0x71')]){_0x4ed8d7[_0xfe9f('0x26')]['interface']=util[_0xfe9f('0x5e')]('SIP/%s',_0x346d72['user']['name']);_0x4ed8d7[_0xfe9f('0x26')][_0xfe9f('0x72')]=_0x4ed8d7[_0xfe9f('0x72')];_0x4ed8d7[_0xfe9f('0x26')]['motionChannel']=_0x4ed8d7['channel'];_0x4ed8d7[_0xfe9f('0x26')][_0xfe9f('0x73')]=_0xfe9f('0x5a');return respondWithRpcPromise(_0xfe9f('0x74'),_0xfe9f('0x74'),{'event':_0xfe9f('0x75'),'message':_0x4ed8d7[_0xfe9f('0x26')]},client9002)[_0xfe9f('0x1f')](function(){return _0x4ed8d7;});}return _0x4ed8d7;}return null;})[_0xfe9f('0x1f')](respondWithResult(_0x4e80b2,null))[_0xfe9f('0x28')](handleError(_0x4e80b2,null));};var interaction_log=require(_0xfe9f('0x58'))(_0xfe9f('0x59'));exports['reject']=function(_0x1a694f,_0x2ab0f3,_0xa8c581){var _0x1be961={'agent':{},'channel':_0xfe9f('0x5b')};if(_0x1a694f[_0xfe9f('0x56')]['id']){delete _0x1a694f[_0xfe9f('0x56')]['id'];}_0x1a694f[_0xfe9f('0x56')][_0xfe9f('0x60')]=_0x1a694f[_0xfe9f('0x56')][_0xfe9f('0x60')]||_0x1a694f[_0xfe9f('0x61')]['id'];_0x1be961[_0xfe9f('0x6f')]['id']=_0x1a694f[_0xfe9f('0x56')][_0xfe9f('0x60')];return db['WhatsappMessage'][_0xfe9f('0x54')]({'where':{'id':_0x1a694f['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ab0f3,null))['then'](function(_0x189d19){if(_0x189d19){_0x1be961[_0xfe9f('0x26')]=_0x189d19[_0xfe9f('0x66')]({'plain':!![]});return db[_0xfe9f('0x62')]['find']({'where':{'id':_0x189d19['WhatsappInteractionId']}});}return null;})[_0xfe9f('0x1f')](handleEntityNotFound(_0x2ab0f3,null))['then'](function(_0x1d8fd2){if(_0x1d8fd2){_0x1be961[_0xfe9f('0x65')]=_0x1d8fd2[_0xfe9f('0x66')]({'plain':!![]});interaction_log[_0xfe9f('0x20')](_0xfe9f('0x76'),_0x1a694f[_0xfe9f('0x61')]['id'],_0x1a694f['user'][_0xfe9f('0x37')],_0x1a694f[_0xfe9f('0x61')][_0xfe9f('0x77')],_0x1be961[_0xfe9f('0x65')]['id'],_0x1a694f[_0xfe9f('0x56')]?JSON[_0xfe9f('0x23')](_0x1a694f['body']):_0xfe9f('0x68'));return respondWithRpcPromise(_0xfe9f('0x78'),_0xfe9f('0x79'),_0x1be961);}return null;})['then'](function(_0x138d7d){var _0x503de7=_0xfe9f('0x6b')+_0x138d7d[_0xfe9f('0x26')][_0xfe9f('0x6c')];return db[_0xfe9f('0x6d')][_0xfe9f('0x3d')](_0x503de7,{'type':db[_0xfe9f('0x7a')][_0xfe9f('0x7b')][_0xfe9f('0x7c')],'raw':!![]})['then'](function(_0x4f4307){return _0x4f4307;});})[_0xfe9f('0x1f')](function(_0x2c9bfe){if(_0x2c9bfe){_0x1be961[_0xfe9f('0x26')][_0xfe9f('0x7d')]=_0x2c9bfe[0x0];if(!_0x1a694f['body'][_0xfe9f('0x60')])return;return db[_0xfe9f('0x6e')]['find']({'where':{'id':_0x1a694f[_0xfe9f('0x56')][_0xfe9f('0x60')],'role':_0xfe9f('0x6f')},'attributes':['id',_0xfe9f('0x37'),'fullname',_0xfe9f('0x7e'),_0xfe9f('0x7f')],'raw':!![]});}return null;})[_0xfe9f('0x1f')](function(_0x15e039){if(!_0x15e039)return null;_0x1be961[_0xfe9f('0x26')][_0xfe9f('0x6f')]=_0x15e039;return _0x1be961;})['then'](function(_0x5bdb40){if(_0x5bdb40){_0x5bdb40[_0xfe9f('0x26')]['interface']=util[_0xfe9f('0x5e')](_0xfe9f('0x80'),_0x1a694f[_0xfe9f('0x61')][_0xfe9f('0x37')]);_0x5bdb40[_0xfe9f('0x26')][_0xfe9f('0x72')]=_0x1be961[_0xfe9f('0x72')];_0x5bdb40[_0xfe9f('0x26')]['motionChannel']=_0x1be961[_0xfe9f('0x72')];_0x5bdb40[_0xfe9f('0x26')][_0xfe9f('0x73')]=_0xfe9f('0x32');respondWithRpcPromise('EventManager',_0xfe9f('0x74'),{'event':_0xfe9f('0x81'),'message':_0x5bdb40[_0xfe9f('0x26')]},client9002);return _0x1be961;}return null;})['then'](respondWithResult(_0x2ab0f3,null))[_0xfe9f('0x28')](handleError(_0x2ab0f3,null));};exports[_0xfe9f('0x2a')]=function(_0xec64c1,_0x535243,_0x5ad91f){if(_0xec64c1[_0xfe9f('0x56')]['id']){delete _0xec64c1[_0xfe9f('0x56')]['id'];}var _0x3f0444;return db[_0xfe9f('0x49')]['find']({'where':{'id':_0xec64c1[_0xfe9f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x535243,null))[_0xfe9f('0x1f')](function(_0x4fc77c){if(_0x4fc77c){_0x3f0444=_0x4fc77c;return db['WhatsappAccount'][_0xfe9f('0x54')]({'where':{'id':_0x4fc77c['WhatsappAccountId']}});}})[_0xfe9f('0x1f')](handleEntityNotFound(_0x535243,null))[_0xfe9f('0x1f')](function(_0x86230f){if(_0x86230f){logger['debug'](_0xfe9f('0x82'),'status','received\x20delivery\x20report\x20from',_0x86230f[_0xfe9f('0x83')],util[_0xfe9f('0x84')](_0xec64c1[_0xfe9f('0x56')],{'showHidden':![],'depth':null}));switch(_0x86230f[_0xfe9f('0x83')]){case _0xfe9f('0x85'):if(_0xec64c1[_0xfe9f('0x56')][_0xfe9f('0x86')]&&_0xec64c1['body'][_0xfe9f('0x86')]===_0x3f0444['messageId']&&_0xec64c1['body']['MessageStatus']&&_0xec64c1['body'][_0xfe9f('0x87')]===_0xfe9f('0x5c')){return _0x3f0444[_0xfe9f('0x34')]({'read':!![]});}else{logger[_0xfe9f('0x25')](_0xfe9f('0x88'),'status',_0xfe9f('0x85'),util[_0xfe9f('0x84')](_0xec64c1['body'],{'showHidden':![],'depth':null}));}break;}return _0x3f0444;}})[_0xfe9f('0x1f')](respondWithResult(_0x535243,null))[_0xfe9f('0x28')](handleError(_0x535243,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 7399c3e..47e4eac 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 _0x7794=['save','remove','hasOwnProperty','hook','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0x7794,0x7b));var _0x4779=function(_0x21a86b,_0x5eb066){_0x21a86b=_0x21a86b-0x0;var _0x48b679=_0x7794[_0x21a86b];return _0x48b679;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x4779('0x0'))['db'][_0x4779('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4779('0x2')](0x0);var events={'afterCreate':_0x4779('0x3'),'afterUpdate':'update','afterDestroy':_0x4779('0x4')};function emitEvent(_0x1e9fdc){return function(_0x4d3b05,_0x40e5f9,_0x54dc7f){WhatsappMessageEvents['emit'](_0x1e9fdc+':'+_0x4d3b05['id'],_0x4d3b05);WhatsappMessageEvents['emit'](_0x1e9fdc,_0x4d3b05);_0x54dc7f(null);};}for(var e in events){if(events[_0x4779('0x5')](e)){var event=events[e];WhatsappMessage[_0x4779('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x98e5=['setMaxListeners','save','remove','emit','hook','exports'];(function(_0x1d2058,_0x56ca50){var _0x29cf87=function(_0x5c3525){while(--_0x5c3525){_0x1d2058['push'](_0x1d2058['shift']());}};_0x29cf87(++_0x56ca50);}(_0x98e5,0x8a));var _0x598e=function(_0x1ef480,_0x3f78f8){_0x1ef480=_0x1ef480-0x0;var _0x36902f=_0x98e5[_0x1ef480];return _0x36902f;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x598e('0x0')](0x0);var events={'afterCreate':_0x598e('0x1'),'afterUpdate':'update','afterDestroy':_0x598e('0x2')};function emitEvent(_0xc090ec){return function(_0x5cc274,_0x3af01f,_0x5a876c){WhatsappMessageEvents['emit'](_0xc090ec+':'+_0x5cc274['id'],_0x5cc274);WhatsappMessageEvents[_0x598e('0x3')](_0xc090ec,_0x5cc274);_0x5a876c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x598e('0x4')](e,emitEvent(event));}}module[_0x598e('0x5')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 79389c2..264db42 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 _0xf281=['api','bluebird','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','createdAt','catch','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','update','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xf281,0xba));var _0x1f28=function(_0x959333,_0x437d99){_0x959333=_0x959333-0x0;var _0x1f0d42=_0xf281[_0x959333];return _0x1f0d42;};'use strict';var _=require('lodash');var util=require(_0x1f28('0x0'));var logger=require(_0x1f28('0x1'))(_0x1f28('0x2'));var moment=require('moment');var BPromise=require(_0x1f28('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1f28('0x4'));var config=require(_0x1f28('0x5'));var attributes=require(_0x1f28('0x6'));module[_0x1f28('0x7')]=function(_0x42a3da,_0x1e5eb9){return _0x42a3da[_0x1f28('0x8')](_0x1f28('0x9'),attributes,{'tableName':_0x1f28('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x1f28('0xb')]},{'name':'fti_whatsapp_messages','fields':[_0x1f28('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13168d,_0x3e16cc,_0x24c01f){var _0x55ed8a=_0x42a3da[_0x1f28('0xd')];var _0x197b53=_0x13168d[_0x1f28('0xe')]({'plain':!![]});if(_0x197b53[_0x1f28('0xf')][_0x1f28('0x10')]()==='in'||_0x197b53['direction'][_0x1f28('0x10')]()===_0x1f28('0x11')&&!_0x197b53[_0x1f28('0x12')]&&!_[_0x1f28('0x13')](_0x197b53[_0x1f28('0x14')])){_0x55ed8a['WhatsappInteraction'][_0x1f28('0x15')]({'where':{'id':_0x197b53[_0x1f28('0x16')]}})[_0x1f28('0x17')](function(_0x229b7f){if(_0x229b7f){_0x229b7f['update']({'lastMsgAt':_0x197b53[_0x1f28('0x18')],'lastMsgDirection':_0x197b53[_0x1f28('0xf')]['toLowerCase']()});}})[_0x1f28('0x19')](function(_0x86a93a){console['error'](_0x86a93a);});}if(_0x197b53[_0x1f28('0xf')]===_0x1f28('0x11')&&!_0x197b53[_0x1f28('0x12')]){var _0x1d2e99;_0x55ed8a['WhatsappAccount'][_0x1f28('0x1a')]({'where':{'id':_0x197b53[_0x1f28('0x1b')]},'raw':!![]})['then'](function(_0x5c89dd){_0x1d2e99=_0x5c89dd;if(_0x1d2e99&&_0x1d2e99[_0x1f28('0x1c')]){switch(_0x1d2e99[_0x1f28('0x1c')]){case _0x1f28('0x1d'):var _0x4d748b=require(_0x1f28('0x1d'));if(_0x1d2e99[_0x1f28('0x1e')]&&_0x1d2e99[_0x1f28('0x1f')]&&_0x1d2e99['phone']){var _0x3ae041=new _0x4d748b(_0x1d2e99['accountSid'],_0x1d2e99[_0x1f28('0x1f')]);_0x3ae041[_0x1f28('0x20')]['create']({'body':_0x197b53[_0x1f28('0xc')],'to':_0x1f28('0x21')+_0x197b53[_0x1f28('0x22')],'from':'whatsapp:'+_0x1d2e99[_0x1f28('0x22')],'statusCallback':_0x1d2e99['remote']+_0x1f28('0x23')+_0x197b53['id']+_0x1f28('0x24')+_0x1d2e99[_0x1f28('0x25')]})[_0x1f28('0x17')](function(_0x424471){if(_0x424471['sid']){return _0x13168d[_0x1f28('0x26')]({'messageId':_0x424471[_0x1f28('0x27')]});}})[_0x1f28('0x19')](function(_0x4409d6){logger[_0x1f28('0x28')](_0x1f28('0x29'),_0x1f28('0x2a'),_0x1f28('0x1d'),util[_0x1f28('0x2b')](_0x4409d6,{'showHidden':![],'depth':null}));});}else{logger[_0x1f28('0x28')](_0x1f28('0x29'),_0x1f28('0x2a'),'twilio',_0x1f28('0x2c'));}break;}}})[_0x1f28('0x2d')](function(){_0x24c01f();});}else{_0x24c01f();}}},'charset':'utf8mb4','collate':_0x1f28('0x2e')});}; \ No newline at end of file +var _0x6623=['/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','find','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6623,0x189));var _0x3662=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6623[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x3662('0x0'));var logger=require(_0x3662('0x1'))(_0x3662('0x2'));var moment=require(_0x3662('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3662('0x4'));var rimraf=require(_0x3662('0x5'));var config=require(_0x3662('0x6'));var attributes=require(_0x3662('0x7'));module[_0x3662('0x8')]=function(_0xb2999d,_0x597421){return _0xb2999d[_0x3662('0x9')](_0x3662('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x3662('0xb'),'fields':[_0x3662('0xb')]},{'name':_0x3662('0xc'),'fields':[_0x3662('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cc373,_0x173701,_0x2350cc){var _0x27c807=_0xb2999d['models'];var _0x269554=_0x1cc373[_0x3662('0xe')]({'plain':!![]});if(_0x269554[_0x3662('0xf')][_0x3662('0x10')]()==='in'||_0x269554[_0x3662('0xf')]['toLowerCase']()===_0x3662('0x11')&&!_0x269554[_0x3662('0x12')]&&!_[_0x3662('0x13')](_0x269554[_0x3662('0x14')])){_0x27c807[_0x3662('0x15')][_0x3662('0x16')]({'where':{'id':_0x269554[_0x3662('0x17')]}})[_0x3662('0x18')](function(_0x371002){if(_0x371002){_0x371002[_0x3662('0x19')]({'lastMsgAt':_0x269554[_0x3662('0x1a')],'lastMsgDirection':_0x269554['direction']['toLowerCase']()});}})[_0x3662('0x1b')](function(_0x550f90){console[_0x3662('0x1c')](_0x550f90);});}if(_0x269554[_0x3662('0xf')]===_0x3662('0x11')&&!_0x269554['secret']){var _0x315176;_0x27c807['WhatsappAccount'][_0x3662('0x1d')]({'where':{'id':_0x269554['WhatsappAccountId']},'raw':!![]})[_0x3662('0x18')](function(_0x235eb9){_0x315176=_0x235eb9;if(_0x315176&&_0x315176[_0x3662('0x1e')]){switch(_0x315176[_0x3662('0x1e')]){case _0x3662('0x1f'):var _0x30c936=require('twilio');if(_0x315176[_0x3662('0x20')]&&_0x315176[_0x3662('0x21')]&&_0x315176[_0x3662('0x22')]){var _0x4e9daf=new _0x30c936(_0x315176['accountSid'],_0x315176[_0x3662('0x21')]);_0x4e9daf[_0x3662('0x23')][_0x3662('0x24')]({'body':_0x269554[_0x3662('0xd')],'to':'whatsapp:'+_0x269554[_0x3662('0x22')],'from':_0x3662('0x25')+_0x315176[_0x3662('0x22')],'statusCallback':_0x315176[_0x3662('0x26')]+_0x3662('0x27')+_0x269554['id']+'/status?token='+_0x315176[_0x3662('0x28')]})['then'](function(_0x2786d8){if(_0x2786d8['sid']){return _0x1cc373[_0x3662('0x19')]({'messageId':_0x2786d8[_0x3662('0x29')]});}})[_0x3662('0x1b')](function(_0x470729){logger['error'](_0x3662('0x2a'),_0x3662('0x2b'),_0x3662('0x1f'),util[_0x3662('0x2c')](_0x470729,{'showHidden':![],'depth':null}));});}else{logger[_0x3662('0x1c')](_0x3662('0x2a'),_0x3662('0x2b'),_0x3662('0x1f'),_0x3662('0x2d'));}break;}}})[_0x3662('0x2e')](function(){_0x2350cc();});}else{_0x2350cc();}}},'charset':'utf8mb4','collate':_0x3662('0x2f')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 93f5ed2..b6df3f0 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 _0x3824=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','create','body','options','CreateWhatsappMessage','catch','lodash','util','randomstring','../../mysqldb'];(function(_0x31b711,_0x49781e){var _0x244a0a=function(_0x355e7c){while(--_0x355e7c){_0x31b711['push'](_0x31b711['shift']());}};_0x244a0a(++_0x49781e);}(_0x3824,0x74));var _0x4382=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x3824[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0x4382('0x0'));var util=require(_0x4382('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4382('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4382('0x3'))['db'];var utils=require(_0x4382('0x4'));var logger=require(_0x4382('0x5'))(_0x4382('0x6'));var config=require(_0x4382('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4382('0x8')][_0x4382('0x9')]({'port':0x232a});config[_0x4382('0xa')]=_[_0x4382('0xb')](config[_0x4382('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4382('0xc'))(new Redis(config[_0x4382('0xa')]));require(_0x4382('0xd'))[_0x4382('0xe')](socket);function respondWithRpcPromise(_0x19d0b4,_0x4cf68d,_0x359f6d){return new BPromise(function(_0x186384,_0x1e63c9){return client[_0x4382('0xf')](_0x19d0b4,_0x359f6d)[_0x4382('0x10')](function(_0x2a5672){logger[_0x4382('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x4cf68d,_0x4382('0x12'));logger[_0x4382('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4cf68d,_0x4382('0x12'),JSON['stringify'](_0x2a5672));if(_0x2a5672[_0x4382('0x14')]){if(_0x2a5672[_0x4382('0x14')][_0x4382('0x15')]===0x1f4){logger[_0x4382('0x14')](_0x4382('0x16'),_0x4cf68d,_0x2a5672[_0x4382('0x14')]['message']);return _0x1e63c9(_0x2a5672[_0x4382('0x14')]['message']);}logger[_0x4382('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x4cf68d,_0x2a5672[_0x4382('0x14')][_0x4382('0x17')]);return _0x186384(_0x2a5672['error'][_0x4382('0x17')]);}else{logger[_0x4382('0x11')](_0x4382('0x16'),_0x4cf68d,'request\x20sent');_0x186384(_0x2a5672[_0x4382('0x18')][_0x4382('0x17')]);}})['catch'](function(_0x3a5d53){logger[_0x4382('0x14')](_0x4382('0x16'),_0x4cf68d,_0x3a5d53);_0x1e63c9(_0x3a5d53);});});}exports['CreateWhatsappMessage']=function(_0x44c0be){var _0x40c25c=this;return new Promise(function(_0x35487f,_0x356430){return db['WhatsappMessage'][_0x4382('0x19')](_0x44c0be[_0x4382('0x1a')],{'raw':_0x44c0be[_0x4382('0x1b')]?_0x44c0be[_0x4382('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3a26f9){logger[_0x4382('0x11')](_0x4382('0x1c'),_0x44c0be);logger['debug']('CreateWhatsappMessage',_0x44c0be,JSON['stringify'](_0x3a26f9));_0x35487f(_0x3a26f9);})[_0x4382('0x1d')](function(_0x55d591){logger[_0x4382('0x14')](_0x4382('0x1c'),_0x55d591[_0x4382('0x17')],_0x44c0be);_0x356430(_0x40c25c[_0x4382('0x14')](0x1f4,_0x55d591[_0x4382('0x17')]));});});}; \ No newline at end of file +var _0x21c6=['http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x21c6,0xf5));var _0x621c=function(_0x4a098c,_0x520905){_0x4a098c=_0x4a098c-0x0;var _0x51e318=_0x21c6[_0x4a098c];return _0x51e318;};'use strict';var _=require(_0x621c('0x0'));var util=require(_0x621c('0x1'));var moment=require(_0x621c('0x2'));var BPromise=require(_0x621c('0x3'));var rs=require(_0x621c('0x4'));var fs=require('fs');var Redis=require(_0x621c('0x5'));var db=require(_0x621c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x621c('0x7'))(_0x621c('0x8'));var config=require('../../config/environment');var jayson=require(_0x621c('0x9'));var client=jayson[_0x621c('0xa')][_0x621c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x621c('0xc')],{'host':_0x621c('0xd'),'port':0x18eb});var socket=require(_0x621c('0xe'))(new Redis(config[_0x621c('0xc')]));require(_0x621c('0xf'))['register'](socket);function respondWithRpcPromise(_0x304159,_0x67db5c,_0x161d8a){return new BPromise(function(_0x134052,_0x2c81c5){return client['request'](_0x304159,_0x161d8a)[_0x621c('0x10')](function(_0x42256e){logger['info'](_0x621c('0x11'),_0x67db5c,_0x621c('0x12'));logger['debug'](_0x621c('0x13'),_0x67db5c,_0x621c('0x12'),JSON[_0x621c('0x14')](_0x42256e));if(_0x42256e[_0x621c('0x15')]){if(_0x42256e[_0x621c('0x15')]['code']===0x1f4){logger[_0x621c('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x67db5c,_0x42256e[_0x621c('0x15')][_0x621c('0x16')]);return _0x2c81c5(_0x42256e[_0x621c('0x15')]['message']);}logger[_0x621c('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x67db5c,_0x42256e[_0x621c('0x15')][_0x621c('0x16')]);return _0x134052(_0x42256e['error']['message']);}else{logger[_0x621c('0x17')](_0x621c('0x11'),_0x67db5c,_0x621c('0x12'));_0x134052(_0x42256e[_0x621c('0x18')][_0x621c('0x16')]);}})[_0x621c('0x19')](function(_0x5b28ef){logger['error'](_0x621c('0x11'),_0x67db5c,_0x5b28ef);_0x2c81c5(_0x5b28ef);});});}exports[_0x621c('0x1a')]=function(_0x3b43aa){var _0x2ad9cb=this;return new Promise(function(_0x42088d,_0x4366c9){return db[_0x621c('0x1b')][_0x621c('0x1c')](_0x3b43aa['body'],{'raw':_0x3b43aa[_0x621c('0x1d')]?_0x3b43aa[_0x621c('0x1d')][_0x621c('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x865858){logger[_0x621c('0x17')]('CreateWhatsappMessage',_0x3b43aa);logger[_0x621c('0x1f')](_0x621c('0x1a'),_0x3b43aa,JSON[_0x621c('0x14')](_0x865858));_0x42088d(_0x865858);})[_0x621c('0x19')](function(_0x5dc142){logger[_0x621c('0x15')](_0x621c('0x1a'),_0x5dc142[_0x621c('0x16')],_0x3b43aa);_0x4366c9(_0x2ad9cb[_0x621c('0x15')](0x1f4,_0x5dc142[_0x621c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index f48169a..67d3e54 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 _0x6005=['./whatsappMessage.events','remove','update','removeListener','length'];(function(_0x50887c,_0x43cc4f){var _0x2ac1ea=function(_0x14dcf1){while(--_0x14dcf1){_0x50887c['push'](_0x50887c['shift']());}};_0x2ac1ea(++_0x43cc4f);}(_0x6005,0x145));var _0x5600=function(_0x506335,_0x23bdb9){_0x506335=_0x506335-0x0;var _0x3eec1d=_0x6005[_0x506335];return _0x3eec1d;};'use strict';var WhatsappMessageEvents=require(_0x5600('0x0'));var events=['save',_0x5600('0x1'),_0x5600('0x2')];function createListener(_0xb30f7,_0x9da4b7){return function(_0x254cec){_0x9da4b7['emit'](_0xb30f7,_0x254cec);};}function removeListener(_0x1ab3c0,_0x47e9fc){return function(){WhatsappMessageEvents[_0x5600('0x3')](_0x1ab3c0,_0x47e9fc);};}exports['register']=function(_0x4f5bc6){for(var _0x43a074=0x0,_0x40c8e6=events[_0x5600('0x4')];_0x43a074<_0x40c8e6;_0x43a074++){var _0x5929b5=events[_0x43a074];var _0x382f66=createListener('whatsappMessage:'+_0x5929b5,_0x4f5bc6);WhatsappMessageEvents['on'](_0x5929b5,_0x382f66);}}; \ No newline at end of file +var _0x34e5=['emit','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x34e5,0x11e));var _0x534e=function(_0x16837b,_0xe27933){_0x16837b=_0x16837b-0x0;var _0x2fed12=_0x34e5[_0x16837b];return _0x2fed12;};'use strict';var WhatsappMessageEvents=require(_0x534e('0x0'));var events=[_0x534e('0x1'),'remove','update'];function createListener(_0x39d691,_0x24d1d7){return function(_0x574c75){_0x24d1d7[_0x534e('0x2')](_0x39d691,_0x574c75);};}function removeListener(_0x509d21,_0x3cf17b){return function(){WhatsappMessageEvents['removeListener'](_0x509d21,_0x3cf17b);};}exports[_0x534e('0x3')]=function(_0x3b898e){for(var _0x82798b=0x0,_0x298168=events[_0x534e('0x4')];_0x82798b<_0x298168;_0x82798b++){var _0x325fae=events[_0x82798b];var _0x4b3144=createListener(_0x534e('0x5')+_0x325fae,_0x3b898e);WhatsappMessageEvents['on'](_0x325fae,_0x4b3144);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 97ff4fe..057f7eb 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 _0x964c=['/:id','show','/:id/members','getMembers','getTeams','getAgents','create','/:id/teams','/:id/users','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','Router','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','/describe','describe'];(function(_0x365eeb,_0xf1ff53){var _0x47f6b9=function(_0x1b9b81){while(--_0x1b9b81){_0x365eeb['push'](_0x365eeb['shift']());}};_0x47f6b9(++_0xf1ff53);}(_0x964c,0x162));var _0xc964=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x964c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc964('0x0'));var util=require(_0xc964('0x1'));var path=require(_0xc964('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc964('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc964('0x4'));var config=require('../../config/environment');var controller=require(_0xc964('0x5'));router[_0xc964('0x6')]('/',auth[_0xc964('0x7')](),controller['index']);router[_0xc964('0x6')](_0xc964('0x8'),auth[_0xc964('0x7')](),controller[_0xc964('0x9')]);router['get'](_0xc964('0xa'),auth[_0xc964('0x7')](),controller[_0xc964('0xb')]);router[_0xc964('0x6')](_0xc964('0xc'),auth['isAuthenticated'](),controller[_0xc964('0xd')]);router[_0xc964('0x6')]('/:id/teams',auth[_0xc964('0x7')](),controller[_0xc964('0xe')]);router[_0xc964('0x6')]('/:id/users',auth[_0xc964('0x7')](),controller[_0xc964('0xf')]);router['post']('/',auth[_0xc964('0x7')](),controller[_0xc964('0x10')]);router['post'](_0xc964('0x11'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xc964('0x12'),auth[_0xc964('0x7')](),controller[_0xc964('0x13')]);router['put'](_0xc964('0xa'),auth[_0xc964('0x7')](),controller[_0xc964('0x14')]);router[_0xc964('0x15')](_0xc964('0xa'),auth[_0xc964('0x7')](),controller[_0xc964('0x16')]);router[_0xc964('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc964('0x17')]);router[_0xc964('0x15')](_0xc964('0x12'),auth[_0xc964('0x7')](),controller[_0xc964('0x18')]);module[_0xc964('0x19')]=router; \ No newline at end of file +var _0x793c=['put','delete','destroy','removeTeams','removeAgents','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x4a11f3,_0x5e1a55){var _0x4cc2d0=function(_0x3034c3){while(--_0x3034c3){_0x4a11f3['push'](_0x4a11f3['shift']());}};_0x4cc2d0(++_0x5e1a55);}(_0x793c,0x8f));var _0xc793=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x793c[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require('multer');var util=require(_0xc793('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc793('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc793('0x2'));var interaction=require(_0xc793('0x3'));var config=require(_0xc793('0x4'));var controller=require(_0xc793('0x5'));router[_0xc793('0x6')]('/',auth[_0xc793('0x7')](),controller[_0xc793('0x8')]);router[_0xc793('0x6')](_0xc793('0x9'),auth[_0xc793('0x7')](),controller[_0xc793('0xa')]);router[_0xc793('0x6')](_0xc793('0xb'),auth[_0xc793('0x7')](),controller[_0xc793('0xc')]);router[_0xc793('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0xc793('0xd')]);router[_0xc793('0x6')](_0xc793('0xe'),auth[_0xc793('0x7')](),controller[_0xc793('0xf')]);router[_0xc793('0x6')](_0xc793('0x10'),auth[_0xc793('0x7')](),controller['getAgents']);router[_0xc793('0x11')]('/',auth[_0xc793('0x7')](),controller['create']);router[_0xc793('0x11')]('/:id/teams',auth[_0xc793('0x7')](),controller['addTeams']);router[_0xc793('0x11')](_0xc793('0x10'),auth[_0xc793('0x7')](),controller['addAgents']);router[_0xc793('0x12')](_0xc793('0xb'),auth[_0xc793('0x7')](),controller['update']);router[_0xc793('0x13')](_0xc793('0xb'),auth[_0xc793('0x7')](),controller[_0xc793('0x14')]);router[_0xc793('0x13')](_0xc793('0xe'),auth[_0xc793('0x7')](),controller[_0xc793('0x15')]);router[_0xc793('0x13')](_0xc793('0x10'),auth[_0xc793('0x7')](),controller[_0xc793('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 02e8a4b..c4b58a8 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 _0xb75c=['sequelize','exports','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x34a215,_0x2085b7){var _0x2cf955=function(_0x2a7a09){while(--_0x2a7a09){_0x34a215['push'](_0x34a215['shift']());}};_0x2cf955(++_0x2085b7);}(_0xb75c,0x1ce));var _0xcb75=function(_0x12c440,_0x2be7d6){_0x12c440=_0x12c440-0x0;var _0x41d6a0=_0xb75c[_0x12c440];return _0x41d6a0;};'use strict';var Sequelize=require(_0xcb75('0x0'));module[_0xcb75('0x1')]={'name':{'type':Sequelize[_0xcb75('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcb75('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xcb75('0x4'),_0xcb75('0x5'),_0xcb75('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xad53=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x340258,_0x5d1e45){var _0x43a183=function(_0x3d88d0){while(--_0x3d88d0){_0x340258['push'](_0x340258['shift']());}};_0x43a183(++_0x5d1e45);}(_0xad53,0x1ea));var _0x3ad5=function(_0x55935b,_0xcaf7ba){_0x55935b=_0x55935b-0x0;var _0x18b1b6=_0xad53[_0x55935b];return _0x18b1b6;};'use strict';var Sequelize=require(_0x3ad5('0x0'));module[_0x3ad5('0x1')]={'name':{'type':Sequelize[_0x3ad5('0x2')],'unique':_0x3ad5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x3ad5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3ad5('0x5')](_0x3ad5('0x6'),_0x3ad5('0x7'),'roundrobin')},'description':{'type':Sequelize[_0x3ad5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 1451749..67c2158 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 _0xb5ef=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','WhatsappQueue','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','nolimit','pick','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','format','SIP','Team','addTeams','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','ids','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x4a5af4,_0x57f0de){var _0x52c2aa=function(_0x5df3e5){while(--_0x5df3e5){_0x4a5af4['push'](_0x4a5af4['shift']());}};_0x52c2aa(++_0x57f0de);}(_0xb5ef,0x113));var _0xfb5e=function(_0x5c5a4a,_0x3ba6b7){_0x5c5a4a=_0x5c5a4a-0x0;var _0xa57694=_0xb5ef[_0x5c5a4a];return _0xa57694;};'use strict';var emlformat=require(_0xfb5e('0x0'));var rimraf=require(_0xfb5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb5e('0x2'));var rp=require('request-promise');var moment=require(_0xfb5e('0x3'));var BPromise=require(_0xfb5e('0x4'));var Mustache=require(_0xfb5e('0x5'));var util=require(_0xfb5e('0x6'));var path=require(_0xfb5e('0x7'));var sox=require(_0xfb5e('0x8'));var csv=require('to-csv');var ejs=require(_0xfb5e('0x9'));var fs=require('fs');var fs_extra=require(_0xfb5e('0xa'));var _=require(_0xfb5e('0xb'));var squel=require(_0xfb5e('0xc'));var crypto=require(_0xfb5e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfb5e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfb5e('0xf'));var Papa=require(_0xfb5e('0x10'));var Redis=require(_0xfb5e('0x11'));var authService=require(_0xfb5e('0x12'));var qs=require(_0xfb5e('0x13'));var as=require(_0xfb5e('0x14'));var hardwareService=require(_0xfb5e('0x15'));var logger=require(_0xfb5e('0x16'))(_0xfb5e('0x17'));var utils=require(_0xfb5e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfb5e('0x19'));var db=require(_0xfb5e('0x1a'))['db'];config[_0xfb5e('0x1b')]=_[_0xfb5e('0x1c')](config[_0xfb5e('0x1b')],{'host':_0xfb5e('0x1d'),'port':0x18eb});var socket=require(_0xfb5e('0x1e'))(new Redis(config[_0xfb5e('0x1b')]));require('./whatsappQueue.socket')[_0xfb5e('0x1f')](socket);function respondWithStatusCode(_0x527884,_0x3e024d){_0x3e024d=_0x3e024d||0xcc;return function(_0x338b44){if(_0x338b44){return _0x527884[_0xfb5e('0x20')](_0x3e024d);}return _0x527884['status'](_0x3e024d)[_0xfb5e('0x21')]();};}function respondWithResult(_0x3164db,_0x112c45){_0x112c45=_0x112c45||0xc8;return function(_0x246787){if(_0x246787){return _0x3164db[_0xfb5e('0x22')](_0x112c45)[_0xfb5e('0x23')](_0x246787);}};}function respondWithFilteredResult(_0x56a0b0,_0xb5d3d3){return function(_0x1dab94){if(_0x1dab94){var _0x4793a5=typeof _0xb5d3d3[_0xfb5e('0x24')]===_0xfb5e('0x25')&&typeof _0xb5d3d3[_0xfb5e('0x26')]===_0xfb5e('0x25');var _0x52831d=_0x1dab94[_0xfb5e('0x27')];var _0x538779=_0x4793a5?0x0:_0xb5d3d3[_0xfb5e('0x24')];var _0x2ec912=_0x4793a5?_0x1dab94[_0xfb5e('0x27')]:_0xb5d3d3[_0xfb5e('0x24')]+_0xb5d3d3[_0xfb5e('0x26')];var _0x3d8f47;if(_0x2ec912>=_0x52831d){_0x2ec912=_0x52831d;_0x3d8f47=0xc8;}else{_0x3d8f47=0xce;}_0x56a0b0[_0xfb5e('0x22')](_0x3d8f47);return _0x56a0b0['set'](_0xfb5e('0x28'),_0x538779+'-'+_0x2ec912+'/'+_0x52831d)[_0xfb5e('0x23')](_0x1dab94);}return null;};}function patchUpdates(_0x4b36cd){return function(_0x459cd3){try{jsonpatch[_0xfb5e('0x29')](_0x459cd3,_0x4b36cd,!![]);}catch(_0x30c098){return BPromise[_0xfb5e('0x2a')](_0x30c098);}return _0x459cd3[_0xfb5e('0x2b')]();};}function saveUpdates(_0xc673c9,_0x51476f){return function(_0x9c5915){if(_0x9c5915){return _0x9c5915[_0xfb5e('0x2c')](_0xc673c9)[_0xfb5e('0x2d')](function(_0x3f137f){return _0x3f137f;});}return null;};}function removeEntity(_0x19c086,_0x51f58a){return function(_0x382cad){if(_0x382cad){return _0x382cad[_0xfb5e('0x2e')]()[_0xfb5e('0x2d')](function(){var _0x36978c=_0x382cad[_0xfb5e('0x2f')]({'plain':!![]});var _0x1ee93e=_0xfb5e('0x30');return db[_0xfb5e('0x31')]['destroy']({'where':{'type':_0x1ee93e,'resourceId':_0x36978c['id']}})[_0xfb5e('0x2d')](function(){return _0x382cad;});})[_0xfb5e('0x2d')](function(){_0x19c086[_0xfb5e('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e439,_0x37fda8){return function(_0xfb6ac9){if(!_0xfb6ac9){_0x48e439['sendStatus'](0x194);}return _0xfb6ac9;};}function handleError(_0x9ae0de,_0x4310f4){_0x4310f4=_0x4310f4||0x1f4;return function(_0x192ef1){logger[_0xfb5e('0x32')](_0x192ef1[_0xfb5e('0x33')]);if(_0x192ef1[_0xfb5e('0x34')]){delete _0x192ef1[_0xfb5e('0x34')];}_0x9ae0de[_0xfb5e('0x22')](_0x4310f4)[_0xfb5e('0x35')](_0x192ef1);};}exports['index']=function(_0xbedb5,_0xf2d1ff){var _0x29f75e={},_0xc42892={},_0x1a8d45={'count':0x0,'rows':[]};var _0x514544=_['map'](db['WhatsappQueue']['rawAttributes'],function(_0x28c5db){return{'name':_0x28c5db[_0xfb5e('0x36')],'type':_0x28c5db[_0xfb5e('0x37')][_0xfb5e('0x38')]};});_0xc42892[_0xfb5e('0x39')]=_[_0xfb5e('0x3a')](_0x514544,_0xfb5e('0x34'));_0xc42892['query']=_[_0xfb5e('0x3b')](_0xbedb5[_0xfb5e('0x3c')]);_0xc42892[_0xfb5e('0x3d')]=_['intersection'](_0xc42892[_0xfb5e('0x39')],_0xc42892[_0xfb5e('0x3c')]);_0x29f75e[_0xfb5e('0x3e')]=_[_0xfb5e('0x3f')](_0xc42892[_0xfb5e('0x39')],qs[_0xfb5e('0x40')](_0xbedb5[_0xfb5e('0x3c')][_0xfb5e('0x40')]));_0x29f75e['attributes']=_0x29f75e[_0xfb5e('0x3e')][_0xfb5e('0x41')]?_0x29f75e[_0xfb5e('0x3e')]:_0xc42892[_0xfb5e('0x39')];if(!_0xbedb5[_0xfb5e('0x3c')][_0xfb5e('0x42')]('nolimit')){_0x29f75e['limit']=qs[_0xfb5e('0x26')](_0xbedb5['query']['limit']);_0x29f75e[_0xfb5e('0x24')]=qs[_0xfb5e('0x24')](_0xbedb5[_0xfb5e('0x3c')][_0xfb5e('0x24')]);}_0x29f75e[_0xfb5e('0x43')]=qs['sort'](_0xbedb5[_0xfb5e('0x3c')][_0xfb5e('0x44')]);_0x29f75e[_0xfb5e('0x45')]=qs[_0xfb5e('0x3d')](_['pick'](_0xbedb5[_0xfb5e('0x3c')],_0xc42892[_0xfb5e('0x3d')]),_0x514544);if(_0xbedb5['query'][_0xfb5e('0x46')]){_0x29f75e['where']=_['merge'](_0x29f75e[_0xfb5e('0x45')],{'$or':_[_0xfb5e('0x3a')](_0x514544,function(_0x8ff2d3){if(_0x8ff2d3[_0xfb5e('0x37')]!==_0xfb5e('0x47')){var _0x468e0d={};_0x468e0d[_0x8ff2d3['name']]={'$like':'%'+_0xbedb5[_0xfb5e('0x3c')][_0xfb5e('0x46')]+'%'};return _0x468e0d;}})});}_0x29f75e=_[_0xfb5e('0x48')]({},_0x29f75e,_0xbedb5[_0xfb5e('0x49')]);var _0xb7925e={'where':_0x29f75e[_0xfb5e('0x45')]};return db[_0xfb5e('0x4a')][_0xfb5e('0x27')](_0xb7925e)['then'](function(_0x252c64){_0x1a8d45[_0xfb5e('0x27')]=_0x252c64;if(_0xbedb5[_0xfb5e('0x3c')]['includeAll']){_0x29f75e[_0xfb5e('0x4b')]=[{'all':!![]}];}return db[_0xfb5e('0x4a')][_0xfb5e('0x4c')](_0x29f75e);})[_0xfb5e('0x2d')](function(_0xf341ae){_0x1a8d45[_0xfb5e('0x4d')]=_0xf341ae;return _0x1a8d45;})['then'](respondWithFilteredResult(_0xf2d1ff,_0x29f75e))[_0xfb5e('0x4e')](handleError(_0xf2d1ff,null));};exports[_0xfb5e('0x4f')]=function(_0x433f34,_0x105a31){var _0x2784e2={'raw':!![],'where':{'id':_0x433f34['params']['id']}},_0x4f452f={};_0x4f452f[_0xfb5e('0x39')]=_[_0xfb5e('0x3b')](db[_0xfb5e('0x4a')][_0xfb5e('0x50')]);_0x4f452f['query']=_[_0xfb5e('0x3b')](_0x433f34['query']);_0x4f452f[_0xfb5e('0x3d')]=_[_0xfb5e('0x3f')](_0x4f452f['model'],_0x4f452f[_0xfb5e('0x3c')]);_0x2784e2[_0xfb5e('0x3e')]=_[_0xfb5e('0x3f')](_0x4f452f[_0xfb5e('0x39')],qs[_0xfb5e('0x40')](_0x433f34[_0xfb5e('0x3c')][_0xfb5e('0x40')]));_0x2784e2[_0xfb5e('0x3e')]=_0x2784e2[_0xfb5e('0x3e')]['length']?_0x2784e2['attributes']:_0x4f452f[_0xfb5e('0x39')];if(_0x433f34['query'][_0xfb5e('0x51')]){_0x2784e2['include']=[{'all':!![]}];}_0x2784e2=_['merge']({},_0x2784e2,_0x433f34['options']);return db[_0xfb5e('0x4a')][_0xfb5e('0x52')](_0x2784e2)[_0xfb5e('0x2d')](handleEntityNotFound(_0x105a31,null))[_0xfb5e('0x2d')](respondWithResult(_0x105a31,null))[_0xfb5e('0x4e')](handleError(_0x105a31,null));};exports['create']=function(_0x3841a3,_0x1f7c6e){return db[_0xfb5e('0x4a')][_0xfb5e('0x53')](_0x3841a3[_0xfb5e('0x54')],{})[_0xfb5e('0x2d')](function(_0x4cc5a5){var _0x2829b5=_0x3841a3[_0xfb5e('0x55')][_0xfb5e('0x2f')]({'plain':!![]});if(!_0x2829b5)throw new Error(_0xfb5e('0x56'));if(_0x2829b5[_0xfb5e('0x57')]===_0xfb5e('0x55')){var _0xdc51e1=_0x4cc5a5[_0xfb5e('0x2f')]({'plain':!![]});var _0x47d3e0=_0xfb5e('0x30');return db['UserProfileSection']['find']({'where':{'name':_0x47d3e0,'userProfileId':_0x2829b5[_0xfb5e('0x58')]},'raw':!![]})[_0xfb5e('0x2d')](function(_0x437e26){if(_0x437e26&&_0x437e26[_0xfb5e('0x59')]===0x0){return db[_0xfb5e('0x31')][_0xfb5e('0x53')]({'name':_0xdc51e1['name'],'resourceId':_0xdc51e1['id'],'type':_0x437e26[_0xfb5e('0x34')],'sectionId':_0x437e26['id']},{})[_0xfb5e('0x2d')](function(){return _0x4cc5a5;});}else{return _0x4cc5a5;}})['catch'](function(_0x4ddacc){logger['error'](_0xfb5e('0x5a'),_0x4ddacc);throw _0x4ddacc;});}return _0x4cc5a5;})[_0xfb5e('0x2d')](respondWithResult(_0x1f7c6e,0xc9))[_0xfb5e('0x4e')](handleError(_0x1f7c6e,null));};exports[_0xfb5e('0x2c')]=function(_0x24b15d,_0x465bfe){if(_0x24b15d[_0xfb5e('0x54')]['id']){delete _0x24b15d[_0xfb5e('0x54')]['id'];}return db[_0xfb5e('0x4a')][_0xfb5e('0x52')]({'where':{'id':_0x24b15d[_0xfb5e('0x5b')]['id']}})['then'](handleEntityNotFound(_0x465bfe,null))[_0xfb5e('0x2d')](saveUpdates(_0x24b15d[_0xfb5e('0x54')],null))[_0xfb5e('0x2d')](respondWithResult(_0x465bfe,null))['catch'](handleError(_0x465bfe,null));};exports[_0xfb5e('0x2e')]=function(_0x59033c,_0x4fabc0){return db['WhatsappQueue']['find']({'where':{'id':_0x59033c[_0xfb5e('0x5b')]['id']}})[_0xfb5e('0x2d')](handleEntityNotFound(_0x4fabc0,null))[_0xfb5e('0x2d')](removeEntity(_0x4fabc0,null))[_0xfb5e('0x4e')](handleError(_0x4fabc0,null));};exports[_0xfb5e('0x5c')]=function(_0x4e4dec,_0x440815){return db[_0xfb5e('0x4a')][_0xfb5e('0x5c')]()[_0xfb5e('0x2d')](respondWithResult(_0x440815,null))[_0xfb5e('0x4e')](handleError(_0x440815,null));};exports[_0xfb5e('0x5d')]=function(_0x1b37a5,_0x293d20,_0x5e46d3){var _0x4228fb={'raw':!![],'where':{}},_0x1c08df={},_0x30b71b;return db[_0xfb5e('0x4a')][_0xfb5e('0x5e')]({'where':{'id':_0x1b37a5[_0xfb5e('0x5b')]['id']}})[_0xfb5e('0x2d')](handleEntityNotFound(_0x293d20,null))[_0xfb5e('0x2d')](function(_0x45f660){if(_0x45f660){_0x30b71b=_0x45f660['get']({'plain':!![]});_0x1c08df[_0xfb5e('0x39')]=_[_0xfb5e('0x3b')](db['UserWhatsappQueue'][_0xfb5e('0x50')]);_0x1c08df[_0xfb5e('0x3c')]=_[_0xfb5e('0x3b')](_0x1b37a5[_0xfb5e('0x3c')]);_0x1c08df[_0xfb5e('0x3d')]=_['intersection'](_0x1c08df[_0xfb5e('0x39')],_0x1c08df[_0xfb5e('0x3c')]);_0x4228fb['attributes']=_['intersection'](_0x1c08df[_0xfb5e('0x39')],qs[_0xfb5e('0x40')](_0x1b37a5[_0xfb5e('0x3c')]['fields']));_0x4228fb[_0xfb5e('0x3e')]=_0x4228fb['attributes']['length']?_0x4228fb[_0xfb5e('0x3e')]:_0x1c08df[_0xfb5e('0x39')];if(!_0x1b37a5[_0xfb5e('0x3c')][_0xfb5e('0x42')](_0xfb5e('0x5f'))){_0x4228fb[_0xfb5e('0x26')]=qs[_0xfb5e('0x26')](_0x1b37a5[_0xfb5e('0x3c')][_0xfb5e('0x26')]);_0x4228fb[_0xfb5e('0x24')]=qs['offset'](_0x1b37a5[_0xfb5e('0x3c')][_0xfb5e('0x24')]);}_0x4228fb[_0xfb5e('0x43')]=qs[_0xfb5e('0x44')](_0x1b37a5[_0xfb5e('0x3c')][_0xfb5e('0x44')]);_0x4228fb[_0xfb5e('0x45')]=qs[_0xfb5e('0x3d')](_[_0xfb5e('0x60')](_0x1b37a5[_0xfb5e('0x3c')],_0x1c08df[_0xfb5e('0x3d')]));_0x4228fb[_0xfb5e('0x45')][_0xfb5e('0x61')]=_0x45f660['id'];if(_0x1b37a5[_0xfb5e('0x3c')][_0xfb5e('0x46')]){_0x4228fb[_0xfb5e('0x45')]=_[_0xfb5e('0x48')](_0x4228fb[_0xfb5e('0x45')],{'$or':_[_0xfb5e('0x3a')](_0x4228fb['attributes'],function(_0x3dd27b){var _0x2704fc={};_0x2704fc[_0x3dd27b]={'$like':'%'+_0x1b37a5[_0xfb5e('0x3c')]['filter']+'%'};return _0x2704fc;})});}_0x4228fb=_[_0xfb5e('0x48')]({},_0x4228fb,_0x1b37a5[_0xfb5e('0x49')]);return db['UserWhatsappQueue'][_0xfb5e('0x4c')](_0x4228fb);}})[_0xfb5e('0x2d')](function(_0xc41b4){if(_0xc41b4){return db[_0xfb5e('0x62')][_0xfb5e('0x63')]({'where':{'id':_['map'](_0xc41b4,_0xfb5e('0x64')),'role':'agent'},'attributes':['id',_0xfb5e('0x34'),_0xfb5e('0x65'),_0xfb5e('0x66'),_0xfb5e('0x67')]});}})['then'](function(_0x4737f9){if(_0x4737f9){return{'count':_0x4737f9[_0xfb5e('0x27')],'rows':_[_0xfb5e('0x3a')](_0x4737f9[_0xfb5e('0x4d')],function(_0x55174c){return{'membername':_0x55174c[_0xfb5e('0x34')],'UserId':_0x55174c['id'],'queue_name':_0x30b71b[_0xfb5e('0x34')],'WhatsappQueueId':_0x30b71b['id'],'interface':util[_0xfb5e('0x68')]('%s/%s',_0xfb5e('0x69'),_0x55174c[_0xfb5e('0x34')]),'penalty':0x0,'paused':_0x55174c[_0xfb5e('0x65')],'createdAt':_0x55174c[_0xfb5e('0x67')],'updatedAt':_0x55174c[_0xfb5e('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfb5e('0x2d')](respondWithFilteredResult(_0x293d20,_0x4228fb))[_0xfb5e('0x4e')](handleError(_0x293d20,null));};exports['getTeams']=function(_0x412a07,_0x116ca4,_0x564747){var _0x32b48d={};var _0x3078e0={};var _0x1cfda;var _0x30d20b;return db[_0xfb5e('0x4a')][_0xfb5e('0x5e')]({'where':{'id':_0x412a07[_0xfb5e('0x5b')]['id']}})['then'](handleEntityNotFound(_0x116ca4,null))[_0xfb5e('0x2d')](function(_0x185d5d){if(_0x185d5d){_0x1cfda=_0x185d5d;_0x3078e0['model']=_[_0xfb5e('0x3b')](db[_0xfb5e('0x6a')]['rawAttributes']);_0x3078e0[_0xfb5e('0x3c')]=_[_0xfb5e('0x3b')](_0x412a07['query']);_0x3078e0[_0xfb5e('0x3d')]=_['intersection'](_0x3078e0['model'],_0x3078e0['query']);_0x32b48d[_0xfb5e('0x3e')]=_[_0xfb5e('0x3f')](_0x3078e0[_0xfb5e('0x39')],qs[_0xfb5e('0x40')](_0x412a07['query'][_0xfb5e('0x40')]));_0x32b48d[_0xfb5e('0x3e')]=_0x32b48d[_0xfb5e('0x3e')]['length']?_0x32b48d[_0xfb5e('0x3e')]:_0x3078e0[_0xfb5e('0x39')];_0x32b48d['order']=qs[_0xfb5e('0x44')](_0x412a07[_0xfb5e('0x3c')][_0xfb5e('0x44')]);_0x32b48d['where']=qs[_0xfb5e('0x3d')](_[_0xfb5e('0x60')](_0x412a07[_0xfb5e('0x3c')],_0x3078e0[_0xfb5e('0x3d')]));if(_0x412a07[_0xfb5e('0x3c')][_0xfb5e('0x46')]){_0x32b48d[_0xfb5e('0x45')]=_['merge'](_0x32b48d[_0xfb5e('0x45')],{'$or':_[_0xfb5e('0x3a')](_0x32b48d[_0xfb5e('0x3e')],function(_0x21bc6a){var _0x43b491={};_0x43b491[_0x21bc6a]={'$like':'%'+_0x412a07['query'][_0xfb5e('0x46')]+'%'};return _0x43b491;})});}_0x32b48d=_['merge']({},_0x32b48d,_0x412a07[_0xfb5e('0x49')]);return _0x1cfda['getTeams'](_0x32b48d);}})[_0xfb5e('0x2d')](function(_0x566a6f){if(_0x566a6f){_0x30d20b=_0x566a6f[_0xfb5e('0x41')];if(!_0x412a07['query'][_0xfb5e('0x42')](_0xfb5e('0x5f'))){_0x32b48d[_0xfb5e('0x26')]=qs[_0xfb5e('0x26')](_0x412a07[_0xfb5e('0x3c')][_0xfb5e('0x26')]);_0x32b48d[_0xfb5e('0x24')]=qs[_0xfb5e('0x24')](_0x412a07[_0xfb5e('0x3c')][_0xfb5e('0x24')]);}return _0x1cfda['getTeams'](_0x32b48d);}})[_0xfb5e('0x2d')](function(_0x5ac6ef){if(_0x5ac6ef){return _0x5ac6ef?{'count':_0x30d20b,'rows':_0x5ac6ef}:null;}})[_0xfb5e('0x2d')](respondWithResult(_0x116ca4,null))[_0xfb5e('0x4e')](handleError(_0x116ca4,null));};exports[_0xfb5e('0x6b')]=function(_0x2dfec8,_0x4acf52,_0x4deddc){var _0x3d9571=_0x2dfec8['body']['ids'];return db[_0xfb5e('0x6a')][_0xfb5e('0x4c')]({'where':{'id':_0x3d9571},'attributes':['id'],'include':[{'model':db[_0xfb5e('0x62')],'as':'Agents','attributes':['id',_0xfb5e('0x34'),_0xfb5e('0x6c'),_0xfb5e('0x6d'),_0xfb5e('0x6e')],'raw':!![]}]})[_0xfb5e('0x2d')](function(_0x5a98bd){if(_0x5a98bd){var _0x580008=_[_0xfb5e('0x6f')](_0x5a98bd,function(_0x5159f8){var _0x172f85=_0x5159f8['get']({'plain':!![]});return _0x172f85[_0xfb5e('0x70')];});return db[_0xfb5e('0x4a')][_0xfb5e('0x52')]({'where':{'id':_0x2dfec8['params']['id']}})[_0xfb5e('0x2d')](function(_0x55ec95){return db['sequelize'][_0xfb5e('0x71')](function(_0x3c41c4){return _0x55ec95[_0xfb5e('0x6b')](_0x3d9571,{'transaction':_0x3c41c4})[_0xfb5e('0x2d')](function(){return BPromise[_0xfb5e('0x72')](_0x580008,function(_0x1e6403){return db['UserWhatsappQueue'][_0xfb5e('0x73')]({'where':{'UserId':_0x1e6403['id'],'WhatsappQueueId':_0x2dfec8[_0xfb5e('0x5b')]['id']},'transaction':_0x3c41c4});});})['then'](function(){_0x580008[_0xfb5e('0x74')](function(_0x11b123){socket[_0xfb5e('0x75')](_0xfb5e('0x76'),{'UserId':_0x11b123['id'],'WhatsappQueueId':_0x55ec95['id']});});});});});}})[_0xfb5e('0x2d')](respondWithStatusCode(_0x4acf52,null))[_0xfb5e('0x4e')](handleError(_0x4acf52,null));};exports['removeTeams']=function(_0x234b50,_0x1c10e3,_0x303e24){return db[_0xfb5e('0x6a')][_0xfb5e('0x4c')]({'where':{'id':_0x234b50[_0xfb5e('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfb5e('0x62')],'as':_0xfb5e('0x70'),'attributes':['id'],'raw':!![]}]})[_0xfb5e('0x2d')](handleEntityNotFound(_0x1c10e3,null))['then'](function(_0x3ec4e3){var _0x322747=_[_0xfb5e('0x3a')](_0x3ec4e3,'id');var _0xf2bee4=[];var _0xea1db9=[];var _0x38aa51=squel[_0xfb5e('0x77')]();_0x38aa51[_0xfb5e('0x78')]('tq.TeamId')[_0xfb5e('0x79')](_0xfb5e('0x7a'),'tq')[_0xfb5e('0x7b')]('user_has_teams','ut',_0xfb5e('0x7c'))['where']('WhatsappQueueId\x20=\x20?',_0x234b50[_0xfb5e('0x5b')]['id']);for(var _0x16158d=0x0;_0x16158d<_0x3ec4e3[_0xfb5e('0x41')];_0x16158d+=0x1){let _0xb8e5f=_0x3ec4e3[_0x16158d];for(var _0x5ed4e7=0x0;_0x5ed4e7<_0xb8e5f[_0xfb5e('0x70')][_0xfb5e('0x41')];_0x5ed4e7+=0x1){let _0x5071ab=_0xb8e5f[_0xfb5e('0x70')][_0x5ed4e7];var _0x2f8989=_0x38aa51['clone']();_0x2f8989['where'](_0xfb5e('0x7d'),_0x5071ab['id']);_0xea1db9[_0xfb5e('0x7e')](db[_0xfb5e('0x7f')]['query'](_0x2f8989['toString'](),{'type':db[_0xfb5e('0x7f')][_0xfb5e('0x80')][_0xfb5e('0x81')]})[_0xfb5e('0x2d')](function(_0x279a4b){if(_0x279a4b[_0xfb5e('0x41')]===0x1){return _0x5071ab['id'];}else{var _0x42ac51=_[_0xfb5e('0x82')](_[_0xfb5e('0x3a')](_0x279a4b,_0xfb5e('0x83')),function(_0x2b1027){return _[_0xfb5e('0x84')](_0x322747,_0x2b1027);});if(_0x42ac51){return _0x5071ab['id'];}}}));}}return BPromise[_0xfb5e('0x85')](_0xea1db9)['then'](function(_0x308b8d){_0xf2bee4=_(_0xf2bee4)['union'](_0x308b8d)[_0xfb5e('0x86')]()[_0xfb5e('0x87')]();return db[_0xfb5e('0x4a')][_0xfb5e('0x52')]({'where':{'id':_0x234b50['params']['id']}})['then'](function(_0x33da7f){return db[_0xfb5e('0x7f')][_0xfb5e('0x71')](function(_0x162f35){return _0x33da7f[_0xfb5e('0x88')](_0x234b50[_0xfb5e('0x3c')][_0xfb5e('0x89')],{'transaction':_0x162f35})[_0xfb5e('0x2d')](function(){if(!_[_0xfb5e('0x8a')](_0xf2bee4)){return _0x33da7f[_0xfb5e('0x8b')](_0xf2bee4,{'transaction':_0x162f35});}})[_0xfb5e('0x2d')](function(){_0xf2bee4['forEach'](function(_0xe73be){socket[_0xfb5e('0x75')](_0xfb5e('0x8c'),{'UserId':_0xe73be,'WhatsappQueueId':_0x33da7f['id']});});});});});});})[_0xfb5e('0x2d')](respondWithStatusCode(_0x1c10e3,null))[_0xfb5e('0x4e')](handleError(_0x1c10e3,null));};exports[_0xfb5e('0x8d')]=function(_0x45992b,_0x1bb375,_0x14169c){return db['WhatsappQueue'][_0xfb5e('0x52')]({'where':{'id':_0x45992b['params']['id']}})[_0xfb5e('0x2d')](handleEntityNotFound(_0x1bb375,null))[_0xfb5e('0x2d')](function(_0x5ed529){if(_0x5ed529){return _0x5ed529['addAgents'](_0x45992b[_0xfb5e('0x54')][_0xfb5e('0x89')],_[_0xfb5e('0x8e')](_0x45992b[_0xfb5e('0x54')],['ids','id'])||{})['spread'](function(_0x2b8423){for(var _0x1e2d4b=0x0;_0x1e2d4b<_0x45992b[_0xfb5e('0x54')][_0xfb5e('0x89')][_0xfb5e('0x41')];_0x1e2d4b+=0x1){socket[_0xfb5e('0x75')]('userWhatsappQueue:save',{'UserId':Number(_0x45992b[_0xfb5e('0x54')][_0xfb5e('0x89')][_0x1e2d4b]),'WhatsappQueueId':Number(_0x45992b[_0xfb5e('0x5b')]['id'])});}return _0x2b8423;});}})[_0xfb5e('0x2d')](respondWithResult(_0x1bb375,null))['catch'](handleError(_0x1bb375,null));};exports['removeAgents']=function(_0x12f738,_0x50e09b,_0x1e097){return db[_0xfb5e('0x4a')][_0xfb5e('0x52')]({'where':{'id':_0x12f738['params']['id']}})[_0xfb5e('0x2d')](handleEntityNotFound(_0x50e09b,null))[_0xfb5e('0x2d')](function(_0x4a5cc9){if(_0x4a5cc9){return _0x4a5cc9[_0xfb5e('0x8b')](_0x12f738[_0xfb5e('0x3c')]['ids'])[_0xfb5e('0x2d')](function(){if(_[_0xfb5e('0x8f')](_0x12f738[_0xfb5e('0x3c')][_0xfb5e('0x89')])){for(var _0x1328e4=0x0;_0x1328e4<_0x12f738['query']['ids'][_0xfb5e('0x41')];_0x1328e4+=0x1){socket[_0xfb5e('0x75')](_0xfb5e('0x8c'),{'UserId':Number(_0x12f738[_0xfb5e('0x3c')][_0xfb5e('0x89')][_0x1328e4]),'WhatsappQueueId':Number(_0x12f738[_0xfb5e('0x5b')]['id'])});}}else{socket[_0xfb5e('0x75')](_0xfb5e('0x8c'),{'UserId':Number(_0x12f738[_0xfb5e('0x3c')][_0xfb5e('0x89')]),'WhatsappQueueId':Number(_0x12f738[_0xfb5e('0x5b')]['id'])});}});}})[_0xfb5e('0x2d')](respondWithStatusCode(_0x50e09b,null))[_0xfb5e('0x4e')](handleError(_0x50e09b,null));};exports[_0xfb5e('0x90')]=function(_0x51bed5,_0x46d2b8,_0x53644d){var _0x32d27f={};var _0x32771d={};var _0x44726f;var _0x4f461a;return db['WhatsappQueue'][_0xfb5e('0x5e')]({'where':{'id':_0x51bed5[_0xfb5e('0x5b')]['id']}})[_0xfb5e('0x2d')](handleEntityNotFound(_0x46d2b8,null))[_0xfb5e('0x2d')](function(_0x10150d){if(_0x10150d){_0x44726f=_0x10150d;_0x32771d[_0xfb5e('0x39')]=_['keys'](db['User'][_0xfb5e('0x50')]);_0x32771d[_0xfb5e('0x3c')]=_[_0xfb5e('0x3b')](_0x51bed5[_0xfb5e('0x3c')]);_0x32771d[_0xfb5e('0x3d')]=_[_0xfb5e('0x3f')](_0x32771d[_0xfb5e('0x39')],_0x32771d['query']);_0x32d27f[_0xfb5e('0x3e')]=_[_0xfb5e('0x3f')](_0x32771d[_0xfb5e('0x39')],qs[_0xfb5e('0x40')](_0x51bed5[_0xfb5e('0x3c')][_0xfb5e('0x40')]));_0x32d27f[_0xfb5e('0x3e')]=_0x32d27f[_0xfb5e('0x3e')]['length']?_0x32d27f[_0xfb5e('0x3e')]:_0x32771d[_0xfb5e('0x39')];_0x32d27f[_0xfb5e('0x43')]=qs[_0xfb5e('0x44')](_0x51bed5[_0xfb5e('0x3c')][_0xfb5e('0x44')]);_0x32d27f[_0xfb5e('0x45')]=qs[_0xfb5e('0x3d')](_[_0xfb5e('0x60')](_0x51bed5[_0xfb5e('0x3c')],_0x32771d[_0xfb5e('0x3d')]));if(_0x51bed5[_0xfb5e('0x3c')]['filter']){_0x32d27f[_0xfb5e('0x45')]=_[_0xfb5e('0x48')](_0x32d27f[_0xfb5e('0x45')],{'$or':_[_0xfb5e('0x3a')](_0x32d27f['attributes'],function(_0x44d750){var _0x209666={};_0x209666[_0x44d750]={'$like':'%'+_0x51bed5[_0xfb5e('0x3c')][_0xfb5e('0x46')]+'%'};return _0x209666;})});}_0x32d27f=_[_0xfb5e('0x48')]({},_0x32d27f,_0x51bed5[_0xfb5e('0x49')]);return _0x44726f['getAgents'](_0x32d27f);}})[_0xfb5e('0x2d')](function(_0x26e05d){if(_0x26e05d){_0x4f461a=_0x26e05d[_0xfb5e('0x41')];if(!_0x51bed5[_0xfb5e('0x3c')][_0xfb5e('0x42')]('nolimit')){_0x32d27f[_0xfb5e('0x26')]=qs[_0xfb5e('0x26')](_0x51bed5['query']['limit']);_0x32d27f[_0xfb5e('0x24')]=qs['offset'](_0x51bed5['query'][_0xfb5e('0x24')]);}return _0x44726f[_0xfb5e('0x90')](_0x32d27f);}})[_0xfb5e('0x2d')](function(_0x55720e){if(_0x55720e){return _0x55720e?{'count':_0x4f461a,'rows':_0x55720e}:null;}})[_0xfb5e('0x2d')](respondWithResult(_0x46d2b8,null))[_0xfb5e('0x4e')](handleError(_0x46d2b8,null));}; \ No newline at end of file +var _0x935a=['getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','merge','type','options','includeAll','findAll','catch','show','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','order','WhatsappQueueId','filter','UserWhatsappQueue','User','findAndCountAll','agent','updatedAt','createdAt','rows','format','SIP','getTeams','Team','addTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','clone','push','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray'];(function(_0x5f14ea,_0x375bfd){var _0x33887c=function(_0x263ec2){while(--_0x263ec2){_0x5f14ea['push'](_0x5f14ea['shift']());}};_0x33887c(++_0x375bfd);}(_0x935a,0x8c));var _0xa935=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x935a[_0x24061a];return _0x82054e;};'use strict';var emlformat=require(_0xa935('0x0'));var rimraf=require(_0xa935('0x1'));var zipdir=require(_0xa935('0x2'));var jsonpatch=require(_0xa935('0x3'));var rp=require(_0xa935('0x4'));var moment=require(_0xa935('0x5'));var BPromise=require(_0xa935('0x6'));var Mustache=require(_0xa935('0x7'));var util=require(_0xa935('0x8'));var path=require(_0xa935('0x9'));var sox=require('sox');var csv=require(_0xa935('0xa'));var ejs=require(_0xa935('0xb'));var fs=require('fs');var fs_extra=require(_0xa935('0xc'));var _=require('lodash');var squel=require(_0xa935('0xd'));var crypto=require(_0xa935('0xe'));var jsforce=require(_0xa935('0xf'));var deskjs=require(_0xa935('0x10'));var toCsv=require(_0xa935('0xa'));var querystring=require(_0xa935('0x11'));var Papa=require('papaparse');var Redis=require(_0xa935('0x12'));var authService=require(_0xa935('0x13'));var qs=require(_0xa935('0x14'));var as=require(_0xa935('0x15'));var hardwareService=require(_0xa935('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa935('0x17'));var licenseUtil=require(_0xa935('0x18'));var db=require(_0xa935('0x19'))['db'];config['redis']=_['defaults'](config[_0xa935('0x1a')],{'host':_0xa935('0x1b'),'port':0x18eb});var socket=require(_0xa935('0x1c'))(new Redis(config['redis']));require(_0xa935('0x1d'))[_0xa935('0x1e')](socket);function respondWithStatusCode(_0x388061,_0x522938){_0x522938=_0x522938||0xcc;return function(_0x2d5950){if(_0x2d5950){return _0x388061[_0xa935('0x1f')](_0x522938);}return _0x388061[_0xa935('0x20')](_0x522938)['end']();};}function respondWithResult(_0x5a5ec0,_0x108211){_0x108211=_0x108211||0xc8;return function(_0x4d5910){if(_0x4d5910){return _0x5a5ec0[_0xa935('0x20')](_0x108211)[_0xa935('0x21')](_0x4d5910);}};}function respondWithFilteredResult(_0x42d520,_0x2b321e){return function(_0x5e70ad){if(_0x5e70ad){var _0x197093=typeof _0x2b321e[_0xa935('0x22')]===_0xa935('0x23')&&typeof _0x2b321e[_0xa935('0x24')]===_0xa935('0x23');var _0x4f351b=_0x5e70ad[_0xa935('0x25')];var _0x3b867a=_0x197093?0x0:_0x2b321e[_0xa935('0x22')];var _0x198e49=_0x197093?_0x5e70ad[_0xa935('0x25')]:_0x2b321e[_0xa935('0x22')]+_0x2b321e[_0xa935('0x24')];var _0x36fa40;if(_0x198e49>=_0x4f351b){_0x198e49=_0x4f351b;_0x36fa40=0xc8;}else{_0x36fa40=0xce;}_0x42d520[_0xa935('0x20')](_0x36fa40);return _0x42d520['set'](_0xa935('0x26'),_0x3b867a+'-'+_0x198e49+'/'+_0x4f351b)[_0xa935('0x21')](_0x5e70ad);}return null;};}function patchUpdates(_0x499347){return function(_0x589762){try{jsonpatch[_0xa935('0x27')](_0x589762,_0x499347,!![]);}catch(_0x57fbb4){return BPromise['reject'](_0x57fbb4);}return _0x589762[_0xa935('0x28')]();};}function saveUpdates(_0x431686,_0x3c6c9b){return function(_0x3ac65c){if(_0x3ac65c){return _0x3ac65c[_0xa935('0x29')](_0x431686)[_0xa935('0x2a')](function(_0x5c282d){return _0x5c282d;});}return null;};}function removeEntity(_0x37626b,_0xde272c){return function(_0xb0a913){if(_0xb0a913){return _0xb0a913[_0xa935('0x2b')]()[_0xa935('0x2a')](function(){var _0x2ab6fc=_0xb0a913[_0xa935('0x2c')]({'plain':!![]});var _0xef81a3='WhatsappQueues';return db[_0xa935('0x2d')]['destroy']({'where':{'type':_0xef81a3,'resourceId':_0x2ab6fc['id']}})['then'](function(){return _0xb0a913;});})['then'](function(){_0x37626b[_0xa935('0x20')](0xcc)[_0xa935('0x2e')]();});}};}function handleEntityNotFound(_0x5179b4,_0x469bd9){return function(_0x1c4462){if(!_0x1c4462){_0x5179b4[_0xa935('0x1f')](0x194);}return _0x1c4462;};}function handleError(_0x48d46b,_0x1daedc){_0x1daedc=_0x1daedc||0x1f4;return function(_0x1637cf){logger[_0xa935('0x2f')](_0x1637cf[_0xa935('0x30')]);if(_0x1637cf[_0xa935('0x31')]){delete _0x1637cf[_0xa935('0x31')];}_0x48d46b['status'](_0x1daedc)[_0xa935('0x32')](_0x1637cf);};}exports[_0xa935('0x33')]=function(_0x96d01,_0x2c4116){var _0x48a52b={},_0x2e6627={},_0x4866cf={'count':0x0,'rows':[]};var _0x5befb2=_[_0xa935('0x34')](db[_0xa935('0x35')][_0xa935('0x36')],function(_0x5b964d){return{'name':_0x5b964d[_0xa935('0x37')],'type':_0x5b964d['type']['key']};});_0x2e6627[_0xa935('0x38')]=_[_0xa935('0x34')](_0x5befb2,_0xa935('0x31'));_0x2e6627[_0xa935('0x39')]=_[_0xa935('0x3a')](_0x96d01['query']);_0x2e6627[_0xa935('0x3b')]=_['intersection'](_0x2e6627[_0xa935('0x38')],_0x2e6627[_0xa935('0x39')]);_0x48a52b[_0xa935('0x3c')]=_['intersection'](_0x2e6627[_0xa935('0x38')],qs[_0xa935('0x3d')](_0x96d01[_0xa935('0x39')]['fields']));_0x48a52b['attributes']=_0x48a52b['attributes'][_0xa935('0x3e')]?_0x48a52b[_0xa935('0x3c')]:_0x2e6627[_0xa935('0x38')];if(!_0x96d01['query']['hasOwnProperty'](_0xa935('0x3f'))){_0x48a52b[_0xa935('0x24')]=qs[_0xa935('0x24')](_0x96d01['query'][_0xa935('0x24')]);_0x48a52b['offset']=qs[_0xa935('0x22')](_0x96d01[_0xa935('0x39')][_0xa935('0x22')]);}_0x48a52b['order']=qs['sort'](_0x96d01[_0xa935('0x39')][_0xa935('0x40')]);_0x48a52b[_0xa935('0x41')]=qs[_0xa935('0x3b')](_[_0xa935('0x42')](_0x96d01[_0xa935('0x39')],_0x2e6627['filters']),_0x5befb2);if(_0x96d01[_0xa935('0x39')]['filter']){_0x48a52b[_0xa935('0x41')]=_[_0xa935('0x43')](_0x48a52b[_0xa935('0x41')],{'$or':_['map'](_0x5befb2,function(_0x2a8767){if(_0x2a8767[_0xa935('0x44')]!=='VIRTUAL'){var _0x3b6a5e={};_0x3b6a5e[_0x2a8767[_0xa935('0x31')]]={'$like':'%'+_0x96d01['query']['filter']+'%'};return _0x3b6a5e;}})});}_0x48a52b=_[_0xa935('0x43')]({},_0x48a52b,_0x96d01[_0xa935('0x45')]);var _0x16400e={'where':_0x48a52b['where']};return db[_0xa935('0x35')][_0xa935('0x25')](_0x16400e)[_0xa935('0x2a')](function(_0x3f9f9b){_0x4866cf[_0xa935('0x25')]=_0x3f9f9b;if(_0x96d01['query'][_0xa935('0x46')]){_0x48a52b['include']=[{'all':!![]}];}return db[_0xa935('0x35')][_0xa935('0x47')](_0x48a52b);})[_0xa935('0x2a')](function(_0x154e8d){_0x4866cf['rows']=_0x154e8d;return _0x4866cf;})[_0xa935('0x2a')](respondWithFilteredResult(_0x2c4116,_0x48a52b))[_0xa935('0x48')](handleError(_0x2c4116,null));};exports[_0xa935('0x49')]=function(_0xcf6d40,_0x52e7e2){var _0x3ae4e7={'raw':!![],'where':{'id':_0xcf6d40[_0xa935('0x4a')]['id']}},_0x2b6727={};_0x2b6727[_0xa935('0x38')]=_[_0xa935('0x3a')](db[_0xa935('0x35')]['rawAttributes']);_0x2b6727[_0xa935('0x39')]=_[_0xa935('0x3a')](_0xcf6d40[_0xa935('0x39')]);_0x2b6727[_0xa935('0x3b')]=_['intersection'](_0x2b6727[_0xa935('0x38')],_0x2b6727[_0xa935('0x39')]);_0x3ae4e7[_0xa935('0x3c')]=_[_0xa935('0x4b')](_0x2b6727[_0xa935('0x38')],qs[_0xa935('0x3d')](_0xcf6d40[_0xa935('0x39')][_0xa935('0x3d')]));_0x3ae4e7[_0xa935('0x3c')]=_0x3ae4e7[_0xa935('0x3c')][_0xa935('0x3e')]?_0x3ae4e7[_0xa935('0x3c')]:_0x2b6727[_0xa935('0x38')];if(_0xcf6d40[_0xa935('0x39')]['includeAll']){_0x3ae4e7[_0xa935('0x4c')]=[{'all':!![]}];}_0x3ae4e7=_[_0xa935('0x43')]({},_0x3ae4e7,_0xcf6d40[_0xa935('0x45')]);return db[_0xa935('0x35')][_0xa935('0x4d')](_0x3ae4e7)[_0xa935('0x2a')](handleEntityNotFound(_0x52e7e2,null))[_0xa935('0x2a')](respondWithResult(_0x52e7e2,null))[_0xa935('0x48')](handleError(_0x52e7e2,null));};exports[_0xa935('0x4e')]=function(_0x1b4b05,_0x53e48d){return db[_0xa935('0x35')][_0xa935('0x4e')](_0x1b4b05[_0xa935('0x4f')],{})[_0xa935('0x2a')](function(_0x23cb24){var _0x16d3bb=_0x1b4b05[_0xa935('0x50')][_0xa935('0x2c')]({'plain':!![]});if(!_0x16d3bb)throw new Error(_0xa935('0x51'));if(_0x16d3bb['role']===_0xa935('0x50')){var _0x5210d3=_0x23cb24[_0xa935('0x2c')]({'plain':!![]});var _0x2beea3=_0xa935('0x52');return db['UserProfileSection'][_0xa935('0x4d')]({'where':{'name':_0x2beea3,'userProfileId':_0x16d3bb[_0xa935('0x53')]},'raw':!![]})['then'](function(_0x4f1693){if(_0x4f1693&&_0x4f1693[_0xa935('0x54')]===0x0){return db[_0xa935('0x2d')][_0xa935('0x4e')]({'name':_0x5210d3[_0xa935('0x31')],'resourceId':_0x5210d3['id'],'type':_0x4f1693[_0xa935('0x31')],'sectionId':_0x4f1693['id']},{})[_0xa935('0x2a')](function(){return _0x23cb24;});}else{return _0x23cb24;}})[_0xa935('0x48')](function(_0x4402ce){logger[_0xa935('0x2f')](_0xa935('0x55'),_0x4402ce);throw _0x4402ce;});}return _0x23cb24;})[_0xa935('0x2a')](respondWithResult(_0x53e48d,0xc9))['catch'](handleError(_0x53e48d,null));};exports['update']=function(_0x4a25f4,_0x165797){if(_0x4a25f4[_0xa935('0x4f')]['id']){delete _0x4a25f4[_0xa935('0x4f')]['id'];}return db[_0xa935('0x35')][_0xa935('0x4d')]({'where':{'id':_0x4a25f4['params']['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x165797,null))[_0xa935('0x2a')](saveUpdates(_0x4a25f4['body'],null))['then'](respondWithResult(_0x165797,null))[_0xa935('0x48')](handleError(_0x165797,null));};exports[_0xa935('0x2b')]=function(_0x539f10,_0x226e60){return db[_0xa935('0x35')][_0xa935('0x4d')]({'where':{'id':_0x539f10[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x226e60,null))['then'](removeEntity(_0x226e60,null))[_0xa935('0x48')](handleError(_0x226e60,null));};exports[_0xa935('0x56')]=function(_0x2cb553,_0x1abe9d){return db[_0xa935('0x35')][_0xa935('0x56')]()[_0xa935('0x2a')](respondWithResult(_0x1abe9d,null))[_0xa935('0x48')](handleError(_0x1abe9d,null));};exports[_0xa935('0x57')]=function(_0x23e2c1,_0x35c909,_0x12e9f8){var _0x229225={'raw':!![],'where':{}},_0x5dabdd={},_0x55cf12;return db[_0xa935('0x35')][_0xa935('0x58')]({'where':{'id':_0x23e2c1[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x35c909,null))[_0xa935('0x2a')](function(_0x448b82){if(_0x448b82){_0x55cf12=_0x448b82[_0xa935('0x2c')]({'plain':!![]});_0x5dabdd[_0xa935('0x38')]=_[_0xa935('0x3a')](db['UserWhatsappQueue'][_0xa935('0x36')]);_0x5dabdd[_0xa935('0x39')]=_[_0xa935('0x3a')](_0x23e2c1[_0xa935('0x39')]);_0x5dabdd[_0xa935('0x3b')]=_[_0xa935('0x4b')](_0x5dabdd[_0xa935('0x38')],_0x5dabdd[_0xa935('0x39')]);_0x229225['attributes']=_['intersection'](_0x5dabdd[_0xa935('0x38')],qs[_0xa935('0x3d')](_0x23e2c1[_0xa935('0x39')]['fields']));_0x229225['attributes']=_0x229225['attributes'][_0xa935('0x3e')]?_0x229225[_0xa935('0x3c')]:_0x5dabdd['model'];if(!_0x23e2c1[_0xa935('0x39')][_0xa935('0x59')](_0xa935('0x3f'))){_0x229225[_0xa935('0x24')]=qs[_0xa935('0x24')](_0x23e2c1[_0xa935('0x39')][_0xa935('0x24')]);_0x229225[_0xa935('0x22')]=qs[_0xa935('0x22')](_0x23e2c1[_0xa935('0x39')][_0xa935('0x22')]);}_0x229225[_0xa935('0x5a')]=qs[_0xa935('0x40')](_0x23e2c1[_0xa935('0x39')][_0xa935('0x40')]);_0x229225[_0xa935('0x41')]=qs['filters'](_[_0xa935('0x42')](_0x23e2c1[_0xa935('0x39')],_0x5dabdd['filters']));_0x229225[_0xa935('0x41')][_0xa935('0x5b')]=_0x448b82['id'];if(_0x23e2c1['query'][_0xa935('0x5c')]){_0x229225[_0xa935('0x41')]=_[_0xa935('0x43')](_0x229225['where'],{'$or':_[_0xa935('0x34')](_0x229225[_0xa935('0x3c')],function(_0x332642){var _0x1bafba={};_0x1bafba[_0x332642]={'$like':'%'+_0x23e2c1['query'][_0xa935('0x5c')]+'%'};return _0x1bafba;})});}_0x229225=_[_0xa935('0x43')]({},_0x229225,_0x23e2c1[_0xa935('0x45')]);return db[_0xa935('0x5d')][_0xa935('0x47')](_0x229225);}})[_0xa935('0x2a')](function(_0x3792ab){if(_0x3792ab){return db[_0xa935('0x5e')][_0xa935('0x5f')]({'where':{'id':_[_0xa935('0x34')](_0x3792ab,'UserId'),'role':_0xa935('0x60')},'attributes':['id','name','whatsappPause',_0xa935('0x61'),_0xa935('0x62')]});}})[_0xa935('0x2a')](function(_0x5c96fe){if(_0x5c96fe){return{'count':_0x5c96fe['count'],'rows':_['map'](_0x5c96fe[_0xa935('0x63')],function(_0x35ee25){return{'membername':_0x35ee25['name'],'UserId':_0x35ee25['id'],'queue_name':_0x55cf12[_0xa935('0x31')],'WhatsappQueueId':_0x55cf12['id'],'interface':util[_0xa935('0x64')]('%s/%s',_0xa935('0x65'),_0x35ee25[_0xa935('0x31')]),'penalty':0x0,'paused':_0x35ee25['whatsappPause'],'createdAt':_0x35ee25[_0xa935('0x62')],'updatedAt':_0x35ee25[_0xa935('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x35c909,_0x229225))[_0xa935('0x48')](handleError(_0x35c909,null));};exports[_0xa935('0x66')]=function(_0xa65659,_0x6f9be3,_0x1ce753){var _0x593a32={};var _0x1ba665={};var _0x3e33ef;var _0x1e827c;return db[_0xa935('0x35')][_0xa935('0x58')]({'where':{'id':_0xa65659[_0xa935('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6f9be3,null))[_0xa935('0x2a')](function(_0x22b24a){if(_0x22b24a){_0x3e33ef=_0x22b24a;_0x1ba665[_0xa935('0x38')]=_[_0xa935('0x3a')](db[_0xa935('0x67')]['rawAttributes']);_0x1ba665[_0xa935('0x39')]=_[_0xa935('0x3a')](_0xa65659[_0xa935('0x39')]);_0x1ba665['filters']=_[_0xa935('0x4b')](_0x1ba665['model'],_0x1ba665[_0xa935('0x39')]);_0x593a32[_0xa935('0x3c')]=_[_0xa935('0x4b')](_0x1ba665[_0xa935('0x38')],qs[_0xa935('0x3d')](_0xa65659[_0xa935('0x39')][_0xa935('0x3d')]));_0x593a32[_0xa935('0x3c')]=_0x593a32[_0xa935('0x3c')][_0xa935('0x3e')]?_0x593a32['attributes']:_0x1ba665[_0xa935('0x38')];_0x593a32[_0xa935('0x5a')]=qs['sort'](_0xa65659['query'][_0xa935('0x40')]);_0x593a32[_0xa935('0x41')]=qs[_0xa935('0x3b')](_[_0xa935('0x42')](_0xa65659[_0xa935('0x39')],_0x1ba665[_0xa935('0x3b')]));if(_0xa65659[_0xa935('0x39')][_0xa935('0x5c')]){_0x593a32[_0xa935('0x41')]=_['merge'](_0x593a32[_0xa935('0x41')],{'$or':_['map'](_0x593a32[_0xa935('0x3c')],function(_0x3898a4){var _0x2d07ea={};_0x2d07ea[_0x3898a4]={'$like':'%'+_0xa65659[_0xa935('0x39')][_0xa935('0x5c')]+'%'};return _0x2d07ea;})});}_0x593a32=_[_0xa935('0x43')]({},_0x593a32,_0xa65659['options']);return _0x3e33ef['getTeams'](_0x593a32);}})[_0xa935('0x2a')](function(_0x298e55){if(_0x298e55){_0x1e827c=_0x298e55['length'];if(!_0xa65659[_0xa935('0x39')]['hasOwnProperty'](_0xa935('0x3f'))){_0x593a32[_0xa935('0x24')]=qs['limit'](_0xa65659[_0xa935('0x39')][_0xa935('0x24')]);_0x593a32['offset']=qs['offset'](_0xa65659['query'][_0xa935('0x22')]);}return _0x3e33ef[_0xa935('0x66')](_0x593a32);}})[_0xa935('0x2a')](function(_0x561b77){if(_0x561b77){return _0x561b77?{'count':_0x1e827c,'rows':_0x561b77}:null;}})[_0xa935('0x2a')](respondWithResult(_0x6f9be3,null))[_0xa935('0x48')](handleError(_0x6f9be3,null));};exports[_0xa935('0x68')]=function(_0x1ab8db,_0x184d5c,_0x5e02c1){var _0x45747f=_0x1ab8db[_0xa935('0x4f')][_0xa935('0x69')];return db[_0xa935('0x67')][_0xa935('0x47')]({'where':{'id':_0x45747f},'attributes':['id'],'include':[{'model':db[_0xa935('0x5e')],'as':'Agents','attributes':['id','name',_0xa935('0x6a'),'voicePause',_0xa935('0x6b')],'raw':!![]}]})['then'](function(_0x25f062){if(_0x25f062){var _0x57dc7b=_[_0xa935('0x6c')](_0x25f062,function(_0xe7edd7){var _0x309100=_0xe7edd7[_0xa935('0x2c')]({'plain':!![]});return _0x309100[_0xa935('0x6d')];});return db[_0xa935('0x35')][_0xa935('0x4d')]({'where':{'id':_0x1ab8db[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](function(_0x23ecff){return db[_0xa935('0x6e')][_0xa935('0x6f')](function(_0x54fda8){return _0x23ecff[_0xa935('0x68')](_0x45747f,{'transaction':_0x54fda8})['then'](function(){return BPromise[_0xa935('0x70')](_0x57dc7b,function(_0x540fa5){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x540fa5['id'],'WhatsappQueueId':_0x1ab8db['params']['id']},'transaction':_0x54fda8});});})[_0xa935('0x2a')](function(){_0x57dc7b[_0xa935('0x71')](function(_0xb27174){socket[_0xa935('0x72')](_0xa935('0x73'),{'UserId':_0xb27174['id'],'WhatsappQueueId':_0x23ecff['id']});});});});});}})[_0xa935('0x2a')](respondWithStatusCode(_0x184d5c,null))[_0xa935('0x48')](handleError(_0x184d5c,null));};exports[_0xa935('0x74')]=function(_0x4bdf44,_0x167e54,_0x3714db){return db[_0xa935('0x67')][_0xa935('0x47')]({'where':{'id':_0x4bdf44[_0xa935('0x39')][_0xa935('0x69')]},'attributes':['id'],'include':[{'model':db[_0xa935('0x5e')],'as':_0xa935('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xa935('0x2a')](handleEntityNotFound(_0x167e54,null))[_0xa935('0x2a')](function(_0x4f1522){var _0x14e154=_['map'](_0x4f1522,'id');var _0x2811cd=[];var _0x323fd=[];var _0x4bafe0=squel['select']();_0x4bafe0[_0xa935('0x75')](_0xa935('0x76'))[_0xa935('0x77')](_0xa935('0x78'),'tq')[_0xa935('0x79')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa935('0x41')](_0xa935('0x7a'),_0x4bdf44[_0xa935('0x4a')]['id']);for(var _0x4c3315=0x0;_0x4c3315<_0x4f1522['length'];_0x4c3315+=0x1){let _0x4b9463=_0x4f1522[_0x4c3315];for(var _0x11dbca=0x0;_0x11dbca<_0x4b9463[_0xa935('0x6d')][_0xa935('0x3e')];_0x11dbca+=0x1){let _0x225f1c=_0x4b9463[_0xa935('0x6d')][_0x11dbca];var _0x3ce10e=_0x4bafe0[_0xa935('0x7b')]();_0x3ce10e[_0xa935('0x41')]('ut.UserId\x20=\x20?',_0x225f1c['id']);_0x323fd[_0xa935('0x7c')](db[_0xa935('0x6e')][_0xa935('0x39')](_0x3ce10e['toString'](),{'type':db[_0xa935('0x6e')]['QueryTypes'][_0xa935('0x7d')]})['then'](function(_0xb68234){if(_0xb68234['length']===0x1){return _0x225f1c['id'];}else{var _0x352348=_[_0xa935('0x7e')](_[_0xa935('0x34')](_0xb68234,_0xa935('0x7f')),function(_0x13593b){return _[_0xa935('0x80')](_0x14e154,_0x13593b);});if(_0x352348){return _0x225f1c['id'];}}}));}}return BPromise[_0xa935('0x81')](_0x323fd)[_0xa935('0x2a')](function(_0x1562db){_0x2811cd=_(_0x2811cd)[_0xa935('0x82')](_0x1562db)[_0xa935('0x83')]()['value']();return db['WhatsappQueue'][_0xa935('0x4d')]({'where':{'id':_0x4bdf44[_0xa935('0x4a')]['id']}})['then'](function(_0x43239e){return db[_0xa935('0x6e')][_0xa935('0x6f')](function(_0x34f078){return _0x43239e['removeTeams'](_0x4bdf44[_0xa935('0x39')]['ids'],{'transaction':_0x34f078})[_0xa935('0x2a')](function(){if(!_[_0xa935('0x84')](_0x2811cd)){return _0x43239e[_0xa935('0x85')](_0x2811cd,{'transaction':_0x34f078});}})[_0xa935('0x2a')](function(){_0x2811cd['forEach'](function(_0xeede4e){socket[_0xa935('0x72')](_0xa935('0x86'),{'UserId':_0xeede4e,'WhatsappQueueId':_0x43239e['id']});});});});});});})['then'](respondWithStatusCode(_0x167e54,null))['catch'](handleError(_0x167e54,null));};exports[_0xa935('0x87')]=function(_0x5071a0,_0xb03259,_0x57760b){return db[_0xa935('0x35')][_0xa935('0x4d')]({'where':{'id':_0x5071a0[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0xb03259,null))[_0xa935('0x2a')](function(_0x303319){if(_0x303319){return _0x303319[_0xa935('0x87')](_0x5071a0[_0xa935('0x4f')]['ids'],_['omit'](_0x5071a0[_0xa935('0x4f')],[_0xa935('0x69'),'id'])||{})[_0xa935('0x88')](function(_0x2eaabf){for(var _0x52ec89=0x0;_0x52ec89<_0x5071a0[_0xa935('0x4f')][_0xa935('0x69')]['length'];_0x52ec89+=0x1){socket[_0xa935('0x72')](_0xa935('0x73'),{'UserId':Number(_0x5071a0[_0xa935('0x4f')][_0xa935('0x69')][_0x52ec89]),'WhatsappQueueId':Number(_0x5071a0[_0xa935('0x4a')]['id'])});}return _0x2eaabf;});}})[_0xa935('0x2a')](respondWithResult(_0xb03259,null))[_0xa935('0x48')](handleError(_0xb03259,null));};exports[_0xa935('0x85')]=function(_0x16e92a,_0x465baf,_0x3dd47f){return db['WhatsappQueue'][_0xa935('0x4d')]({'where':{'id':_0x16e92a['params']['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x465baf,null))[_0xa935('0x2a')](function(_0xef7afe){if(_0xef7afe){return _0xef7afe['removeAgents'](_0x16e92a['query'][_0xa935('0x69')])[_0xa935('0x2a')](function(){if(_[_0xa935('0x89')](_0x16e92a[_0xa935('0x39')][_0xa935('0x69')])){for(var _0x270f7d=0x0;_0x270f7d<_0x16e92a[_0xa935('0x39')][_0xa935('0x69')][_0xa935('0x3e')];_0x270f7d+=0x1){socket[_0xa935('0x72')](_0xa935('0x86'),{'UserId':Number(_0x16e92a['query'][_0xa935('0x69')][_0x270f7d]),'WhatsappQueueId':Number(_0x16e92a[_0xa935('0x4a')]['id'])});}}else{socket[_0xa935('0x72')](_0xa935('0x86'),{'UserId':Number(_0x16e92a[_0xa935('0x39')]['ids']),'WhatsappQueueId':Number(_0x16e92a[_0xa935('0x4a')]['id'])});}});}})[_0xa935('0x2a')](respondWithStatusCode(_0x465baf,null))[_0xa935('0x48')](handleError(_0x465baf,null));};exports[_0xa935('0x8a')]=function(_0x4949c0,_0x27aac8,_0x59df9b){var _0x4593b1={};var _0x3a48a9={};var _0x59e0a3;var _0x501fcb;return db[_0xa935('0x35')][_0xa935('0x58')]({'where':{'id':_0x4949c0[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x27aac8,null))['then'](function(_0x248b8b){if(_0x248b8b){_0x59e0a3=_0x248b8b;_0x3a48a9[_0xa935('0x38')]=_['keys'](db[_0xa935('0x5e')][_0xa935('0x36')]);_0x3a48a9['query']=_[_0xa935('0x3a')](_0x4949c0[_0xa935('0x39')]);_0x3a48a9['filters']=_[_0xa935('0x4b')](_0x3a48a9[_0xa935('0x38')],_0x3a48a9[_0xa935('0x39')]);_0x4593b1[_0xa935('0x3c')]=_['intersection'](_0x3a48a9['model'],qs[_0xa935('0x3d')](_0x4949c0[_0xa935('0x39')]['fields']));_0x4593b1[_0xa935('0x3c')]=_0x4593b1[_0xa935('0x3c')][_0xa935('0x3e')]?_0x4593b1[_0xa935('0x3c')]:_0x3a48a9[_0xa935('0x38')];_0x4593b1[_0xa935('0x5a')]=qs['sort'](_0x4949c0[_0xa935('0x39')][_0xa935('0x40')]);_0x4593b1[_0xa935('0x41')]=qs[_0xa935('0x3b')](_['pick'](_0x4949c0[_0xa935('0x39')],_0x3a48a9[_0xa935('0x3b')]));if(_0x4949c0[_0xa935('0x39')][_0xa935('0x5c')]){_0x4593b1[_0xa935('0x41')]=_[_0xa935('0x43')](_0x4593b1[_0xa935('0x41')],{'$or':_['map'](_0x4593b1[_0xa935('0x3c')],function(_0x5203fe){var _0x5a63a0={};_0x5a63a0[_0x5203fe]={'$like':'%'+_0x4949c0[_0xa935('0x39')][_0xa935('0x5c')]+'%'};return _0x5a63a0;})});}_0x4593b1=_[_0xa935('0x43')]({},_0x4593b1,_0x4949c0[_0xa935('0x45')]);return _0x59e0a3['getAgents'](_0x4593b1);}})['then'](function(_0x915a48){if(_0x915a48){_0x501fcb=_0x915a48[_0xa935('0x3e')];if(!_0x4949c0['query'][_0xa935('0x59')](_0xa935('0x3f'))){_0x4593b1[_0xa935('0x24')]=qs[_0xa935('0x24')](_0x4949c0['query'][_0xa935('0x24')]);_0x4593b1[_0xa935('0x22')]=qs[_0xa935('0x22')](_0x4949c0[_0xa935('0x39')][_0xa935('0x22')]);}return _0x59e0a3['getAgents'](_0x4593b1);}})[_0xa935('0x2a')](function(_0x1bb4d1){if(_0x1bb4d1){return _0x1bb4d1?{'count':_0x501fcb,'rows':_0x1bb4d1}:null;}})[_0xa935('0x2a')](respondWithResult(_0x27aac8,null))[_0xa935('0x48')](handleError(_0x27aac8,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 0ea91e4..9c7a9eb 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 _0x3346=['remove','hasOwnProperty','exports','../../mysqldb','WhatsappQueue','save','update'];(function(_0x20bfdb,_0x5a8b4c){var _0x13d33f=function(_0x436179){while(--_0x436179){_0x20bfdb['push'](_0x20bfdb['shift']());}};_0x13d33f(++_0x5a8b4c);}(_0x3346,0x153));var _0x6334=function(_0x1f8cee,_0x478001){_0x1f8cee=_0x1f8cee-0x0;var _0x3e431b=_0x3346[_0x1f8cee];return _0x3e431b;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x6334('0x0'))['db'][_0x6334('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6334('0x2'),'afterUpdate':_0x6334('0x3'),'afterDestroy':_0x6334('0x4')};function emitEvent(_0x4cc45e){return function(_0x5f4b8c,_0x52c293,_0x58786a){WhatsappQueueEvents['emit'](_0x4cc45e+':'+_0x5f4b8c['id'],_0x5f4b8c);WhatsappQueueEvents['emit'](_0x4cc45e,_0x5f4b8c);_0x58786a(null);};}for(var e in events){if(events[_0x6334('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x6334('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0x4351=['events','../../mysqldb','WhatsappQueue','setMaxListeners','remove','emit','hook'];(function(_0x219bed,_0x594f65){var _0x5ad0b8=function(_0x34b384){while(--_0x34b384){_0x219bed['push'](_0x219bed['shift']());}};_0x5ad0b8(++_0x594f65);}(_0x4351,0x12d));var _0x1435=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x4351[_0x47b58b];return _0x46bebe;};'use strict';var EventEmitter=require(_0x1435('0x0'));var WhatsappQueue=require(_0x1435('0x1'))['db'][_0x1435('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1435('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1435('0x4')};function emitEvent(_0x2fb799){return function(_0xbd8f6f,_0x286e05,_0x25cee3){WhatsappQueueEvents[_0x1435('0x5')](_0x2fb799+':'+_0xbd8f6f['id'],_0xbd8f6f);WhatsappQueueEvents[_0x1435('0x5')](_0x2fb799,_0xbd8f6f);_0x25cee3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x1435('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index b9cee95..a26efe4 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 _0x886f=['./whatsappQueue.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x4df85c,_0x248dfb){var _0x4e2a61=function(_0x4e2c8e){while(--_0x4e2c8e){_0x4df85c['push'](_0x4df85c['shift']());}};_0x4e2a61(++_0x248dfb);}(_0x886f,0xd5));var _0xf886=function(_0x29fa54,_0x335dfd){_0x29fa54=_0x29fa54-0x0;var _0x234514=_0x886f[_0x29fa54];return _0x234514;};'use strict';var _=require(_0xf886('0x0'));var util=require(_0xf886('0x1'));var logger=require(_0xf886('0x2'))(_0xf886('0x3'));var moment=require('moment');var BPromise=require(_0xf886('0x4'));var rp=require(_0xf886('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf886('0x6'));var config=require('../../config/environment');var attributes=require(_0xf886('0x7'));module[_0xf886('0x8')]=function(_0xadaf53,_0x330f15){return _0xadaf53[_0xf886('0x9')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bfb=['bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','util','../../config/logger','api'];(function(_0x15461b,_0x4d0707){var _0x139e59=function(_0x3238d4){while(--_0x3238d4){_0x15461b['push'](_0x15461b['shift']());}};_0x139e59(++_0x4d0707);}(_0x9bfb,0xe3));var _0xb9bf=function(_0x5332b1,_0x192941){_0x5332b1=_0x5332b1-0x0;var _0x129b49=_0x9bfb[_0x5332b1];return _0x129b49;};'use strict';var _=require('lodash');var util=require(_0xb9bf('0x0'));var logger=require(_0xb9bf('0x1'))(_0xb9bf('0x2'));var moment=require('moment');var BPromise=require(_0xb9bf('0x3'));var rp=require(_0xb9bf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9bf('0x5'));var config=require(_0xb9bf('0x6'));var attributes=require(_0xb9bf('0x7'));module[_0xb9bf('0x8')]=function(_0x156647,_0xf170bf){return _0x156647[_0xb9bf('0x9')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index a6bee6a..4c0360c 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 _0x2c22=['WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','WhatsappQueue','findAll','options','where','limit','include','map','model','attributes','info','GetWhatsappQueue','ShowWhatsappQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x5af5b9,_0x4bf606){var _0x587458=function(_0x5685bc){while(--_0x5685bc){_0x5af5b9['push'](_0x5af5b9['shift']());}};_0x587458(++_0x4bf606);}(_0x2c22,0x137));var _0x22c2=function(_0x1bbf6d,_0x163955){_0x1bbf6d=_0x1bbf6d-0x0;var _0x3fd381=_0x2c22[_0x1bbf6d];return _0x3fd381;};'use strict';var _=require(_0x22c2('0x0'));var util=require(_0x22c2('0x1'));var moment=require(_0x22c2('0x2'));var BPromise=require(_0x22c2('0x3'));var rs=require(_0x22c2('0x4'));var fs=require('fs');var Redis=require(_0x22c2('0x5'));var db=require(_0x22c2('0x6'))['db'];var utils=require(_0x22c2('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x22c2('0x8'));var client=jayson[_0x22c2('0x9')]['http']({'port':0x232a});config['redis']=_[_0x22c2('0xa')](config[_0x22c2('0xb')],{'host':_0x22c2('0xc'),'port':0x18eb});var socket=require(_0x22c2('0xd'))(new Redis(config[_0x22c2('0xb')]));require('./whatsappQueue.socket')[_0x22c2('0xe')](socket);function respondWithRpcPromise(_0xb0c600,_0x4c65df,_0x142ec5){return new BPromise(function(_0x1bea8f,_0x53ccea){return client[_0x22c2('0xf')](_0xb0c600,_0x142ec5)[_0x22c2('0x10')](function(_0x275ff3){logger['info'](_0x22c2('0x11'),_0x4c65df,'request\x20sent');logger[_0x22c2('0x12')](_0x22c2('0x13'),_0x4c65df,_0x22c2('0x14'),JSON[_0x22c2('0x15')](_0x275ff3));if(_0x275ff3['error']){if(_0x275ff3[_0x22c2('0x16')][_0x22c2('0x17')]===0x1f4){logger[_0x22c2('0x16')](_0x22c2('0x11'),_0x4c65df,_0x275ff3[_0x22c2('0x16')][_0x22c2('0x18')]);return _0x53ccea(_0x275ff3[_0x22c2('0x16')]['message']);}logger[_0x22c2('0x16')](_0x22c2('0x11'),_0x4c65df,_0x275ff3[_0x22c2('0x16')][_0x22c2('0x18')]);return _0x1bea8f(_0x275ff3[_0x22c2('0x16')][_0x22c2('0x18')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x4c65df,_0x22c2('0x14'));_0x1bea8f(_0x275ff3[_0x22c2('0x19')][_0x22c2('0x18')]);}})[_0x22c2('0x1a')](function(_0x35c32e){logger[_0x22c2('0x16')](_0x22c2('0x11'),_0x4c65df,_0x35c32e);_0x53ccea(_0x35c32e);});});}exports['GetWhatsappQueue']=function(_0x3e97b4){var _0x2d9177=this;return new Promise(function(_0x1e908d,_0x1e714a){return db[_0x22c2('0x1b')][_0x22c2('0x1c')]({'raw':_0x3e97b4[_0x22c2('0x1d')]?_0x3e97b4[_0x22c2('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3e97b4[_0x22c2('0x1d')]?_0x3e97b4[_0x22c2('0x1d')][_0x22c2('0x1e')]||null:null,'attributes':_0x3e97b4[_0x22c2('0x1d')]?_0x3e97b4[_0x22c2('0x1d')]['attributes']||null:null,'limit':_0x3e97b4[_0x22c2('0x1d')]?_0x3e97b4[_0x22c2('0x1d')][_0x22c2('0x1f')]||null:null,'include':_0x3e97b4[_0x22c2('0x1d')]?_0x3e97b4[_0x22c2('0x1d')]['include']?_['map'](_0x3e97b4[_0x22c2('0x1d')][_0x22c2('0x20')],function(_0x53017a){return{'model':db[_0x53017a['model']],'as':_0x53017a['as'],'attributes':_0x53017a['attributes'],'include':_0x53017a[_0x22c2('0x20')]?_[_0x22c2('0x21')](_0x53017a[_0x22c2('0x20')],function(_0x1b01d1){return{'model':db[_0x1b01d1[_0x22c2('0x22')]],'as':_0x1b01d1['as'],'attributes':_0x1b01d1[_0x22c2('0x23')],'include':_0x1b01d1[_0x22c2('0x20')]?_['map'](_0x1b01d1[_0x22c2('0x20')],function(_0x35cf37){return{'model':db[_0x35cf37[_0x22c2('0x22')]],'as':_0x35cf37['as'],'attributes':_0x35cf37[_0x22c2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x22c2('0x10')](function(_0x1bdd74){logger[_0x22c2('0x24')]('GetWhatsappQueue',_0x3e97b4);logger['debug'](_0x22c2('0x25'),_0x3e97b4,JSON[_0x22c2('0x15')](_0x1bdd74));_0x1e908d(_0x1bdd74);})[_0x22c2('0x1a')](function(_0x6d175c){logger[_0x22c2('0x16')]('GetWhatsappQueue',_0x6d175c[_0x22c2('0x18')],_0x3e97b4);_0x1e714a(_0x2d9177['error'](0x1f4,_0x6d175c['message']));});});};exports[_0x22c2('0x26')]=function(_0x599256){var _0x3ac833=this;return new Promise(function(_0xd6b37a,_0x1f3c91){return db[_0x22c2('0x1b')][_0x22c2('0x27')]({'raw':_0x599256['options']?_0x599256[_0x22c2('0x1d')][_0x22c2('0x28')]===undefined?!![]:![]:!![],'where':_0x599256[_0x22c2('0x1d')]?_0x599256[_0x22c2('0x1d')][_0x22c2('0x1e')]||null:null,'attributes':_0x599256[_0x22c2('0x1d')]?_0x599256[_0x22c2('0x1d')]['attributes']||null:null,'include':_0x599256['options']?_0x599256[_0x22c2('0x1d')][_0x22c2('0x20')]?_['map'](_0x599256['options']['include'],function(_0x4f452c){return{'model':db[_0x4f452c['model']],'as':_0x4f452c['as'],'attributes':_0x4f452c['attributes'],'include':_0x4f452c[_0x22c2('0x20')]?_[_0x22c2('0x21')](_0x4f452c[_0x22c2('0x20')],function(_0x3a09af){return{'model':db[_0x3a09af[_0x22c2('0x22')]],'as':_0x3a09af['as'],'attributes':_0x3a09af[_0x22c2('0x23')],'include':_0x3a09af['include']?_[_0x22c2('0x21')](_0x3a09af[_0x22c2('0x20')],function(_0x1e7f96){return{'model':db[_0x1e7f96['model']],'as':_0x1e7f96['as'],'attributes':_0x1e7f96[_0x22c2('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf6d594){logger[_0x22c2('0x24')](_0x22c2('0x26'),_0x599256);logger['debug'](_0x22c2('0x26'),_0x599256,JSON['stringify'](_0xf6d594));_0xd6b37a(_0xf6d594);})[_0x22c2('0x1a')](function(_0x219473){logger[_0x22c2('0x16')](_0x22c2('0x26'),_0x219473[_0x22c2('0x18')],_0x599256);_0x1f3c91(_0x3ac833[_0x22c2('0x16')](0x1f4,_0x219473[_0x22c2('0x18')]));});});}; \ No newline at end of file +var _0xf811=['map','then','GetWhatsappQueue','find','raw','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','register','request','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','WhatsappQueue','options','attributes','include','model'];(function(_0xf00f73,_0x147a86){var _0x38e363=function(_0x5af1d2){while(--_0x5af1d2){_0xf00f73['push'](_0xf00f73['shift']());}};_0x38e363(++_0x147a86);}(_0xf811,0x19d));var _0x1f81=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xf811[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var moment=require(_0x1f81('0x2'));var BPromise=require(_0x1f81('0x3'));var rs=require(_0x1f81('0x4'));var fs=require('fs');var Redis=require(_0x1f81('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f81('0x6'));var logger=require(_0x1f81('0x7'))('rpc');var config=require(_0x1f81('0x8'));var jayson=require(_0x1f81('0x9'));var client=jayson['client'][_0x1f81('0xa')]({'port':0x232a});config['redis']=_[_0x1f81('0xb')](config[_0x1f81('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f81('0xc')]));require('./whatsappQueue.socket')[_0x1f81('0xd')](socket);function respondWithRpcPromise(_0x483f73,_0x5feb5f,_0x448d3a){return new BPromise(function(_0x4613b9,_0x59cb37){return client[_0x1f81('0xe')](_0x483f73,_0x448d3a)['then'](function(_0x16e0e0){logger['info'](_0x1f81('0xf'),_0x5feb5f,'request\x20sent');logger[_0x1f81('0x10')](_0x1f81('0x11'),_0x5feb5f,_0x1f81('0x12'),JSON[_0x1f81('0x13')](_0x16e0e0));if(_0x16e0e0[_0x1f81('0x14')]){if(_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x15')]===0x1f4){logger[_0x1f81('0x14')](_0x1f81('0xf'),_0x5feb5f,_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x16')]);return _0x59cb37(_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x16')]);}logger[_0x1f81('0x14')](_0x1f81('0xf'),_0x5feb5f,_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x16')]);return _0x4613b9(_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x16')]);}else{logger[_0x1f81('0x17')](_0x1f81('0xf'),_0x5feb5f,'request\x20sent');_0x4613b9(_0x16e0e0[_0x1f81('0x18')][_0x1f81('0x16')]);}})[_0x1f81('0x19')](function(_0x5b6a3b){logger[_0x1f81('0x14')](_0x1f81('0xf'),_0x5feb5f,_0x5b6a3b);_0x59cb37(_0x5b6a3b);});});}exports['GetWhatsappQueue']=function(_0x2ade74){var _0xab4582=this;return new Promise(function(_0x3181ea,_0x42306a){return db[_0x1f81('0x1a')]['findAll']({'raw':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')]['where']||null:null,'attributes':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')][_0x1f81('0x1c')]||null:null,'limit':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')]['limit']||null:null,'include':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')][_0x1f81('0x1d')]?_['map'](_0x2ade74[_0x1f81('0x1b')][_0x1f81('0x1d')],function(_0x2010f5){return{'model':db[_0x2010f5[_0x1f81('0x1e')]],'as':_0x2010f5['as'],'attributes':_0x2010f5[_0x1f81('0x1c')],'include':_0x2010f5[_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x2010f5['include'],function(_0x259c59){return{'model':db[_0x259c59[_0x1f81('0x1e')]],'as':_0x259c59['as'],'attributes':_0x259c59[_0x1f81('0x1c')],'include':_0x259c59[_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x259c59[_0x1f81('0x1d')],function(_0x58ce77){return{'model':db[_0x58ce77['model']],'as':_0x58ce77['as'],'attributes':_0x58ce77['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f81('0x20')](function(_0x291d08){logger[_0x1f81('0x17')](_0x1f81('0x21'),_0x2ade74);logger['debug'](_0x1f81('0x21'),_0x2ade74,JSON['stringify'](_0x291d08));_0x3181ea(_0x291d08);})['catch'](function(_0x863d51){logger[_0x1f81('0x14')]('GetWhatsappQueue',_0x863d51[_0x1f81('0x16')],_0x2ade74);_0x42306a(_0xab4582[_0x1f81('0x14')](0x1f4,_0x863d51['message']));});});};exports['ShowWhatsappQueue']=function(_0x18d05b){var _0x2479a6=this;return new Promise(function(_0x479518,_0x3e4bc7){return db[_0x1f81('0x1a')][_0x1f81('0x22')]({'raw':_0x18d05b[_0x1f81('0x1b')]?_0x18d05b['options'][_0x1f81('0x23')]===undefined?!![]:![]:!![],'where':_0x18d05b[_0x1f81('0x1b')]?_0x18d05b['options']['where']||null:null,'attributes':_0x18d05b[_0x1f81('0x1b')]?_0x18d05b['options'][_0x1f81('0x1c')]||null:null,'include':_0x18d05b[_0x1f81('0x1b')]?_0x18d05b['options'][_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x18d05b[_0x1f81('0x1b')][_0x1f81('0x1d')],function(_0x2bcf3b){return{'model':db[_0x2bcf3b[_0x1f81('0x1e')]],'as':_0x2bcf3b['as'],'attributes':_0x2bcf3b[_0x1f81('0x1c')],'include':_0x2bcf3b[_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x2bcf3b[_0x1f81('0x1d')],function(_0x15ac03){return{'model':db[_0x15ac03[_0x1f81('0x1e')]],'as':_0x15ac03['as'],'attributes':_0x15ac03['attributes'],'include':_0x15ac03[_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x15ac03[_0x1f81('0x1d')],function(_0x2f8194){return{'model':db[_0x2f8194[_0x1f81('0x1e')]],'as':_0x2f8194['as'],'attributes':_0x2f8194[_0x1f81('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3213d6){logger[_0x1f81('0x17')](_0x1f81('0x24'),_0x18d05b);logger[_0x1f81('0x10')]('ShowWhatsappQueue',_0x18d05b,JSON[_0x1f81('0x13')](_0x3213d6));_0x479518(_0x3213d6);})[_0x1f81('0x19')](function(_0x353e50){logger[_0x1f81('0x14')](_0x1f81('0x24'),_0x353e50[_0x1f81('0x16')],_0x18d05b);_0x3e4bc7(_0x2479a6[_0x1f81('0x14')](0x1f4,_0x353e50[_0x1f81('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index f3b8706..0d59bed 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 _0x08f0=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x1243d5,_0x62be0a){var _0x165dcb=function(_0x2ee645){while(--_0x2ee645){_0x1243d5['push'](_0x1243d5['shift']());}};_0x165dcb(++_0x62be0a);}(_0x08f0,0xe7));var _0x008f=function(_0x5f4bcf,_0x2524d9){_0x5f4bcf=_0x5f4bcf-0x0;var _0x1a37f1=_0x08f0[_0x5f4bcf];return _0x1a37f1;};'use strict';var WhatsappQueueEvents=require(_0x008f('0x0'));var events=[_0x008f('0x1'),_0x008f('0x2'),_0x008f('0x3')];function createListener(_0x21d8e5,_0x3026ef){return function(_0x4efe2b){_0x3026ef[_0x008f('0x4')](_0x21d8e5,_0x4efe2b);};}function removeListener(_0x58ff4e,_0x4d7fc4){return function(){WhatsappQueueEvents[_0x008f('0x5')](_0x58ff4e,_0x4d7fc4);};}exports[_0x008f('0x6')]=function(_0x1750f7){for(var _0x29df71=0x0,_0x13cbde=events[_0x008f('0x7')];_0x29df71<_0x13cbde;_0x29df71++){var _0x1379f1=events[_0x29df71];var _0x8ebd00=createListener(_0x008f('0x8')+_0x1379f1,_0x1750f7);WhatsappQueueEvents['on'](_0x1379f1,_0x8ebd00);}}; \ No newline at end of file +var _0x3d78=['whatsappQueue:','remove','update','register','length'];(function(_0x10f8c5,_0x3bc148){var _0x16392c=function(_0x56f982){while(--_0x56f982){_0x10f8c5['push'](_0x10f8c5['shift']());}};_0x16392c(++_0x3bc148);}(_0x3d78,0x13c));var _0x83d7=function(_0x13f507,_0x48a562){_0x13f507=_0x13f507-0x0;var _0x176e2f=_0x3d78[_0x13f507];return _0x176e2f;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x83d7('0x0'),_0x83d7('0x1')];function createListener(_0x571ee8,_0x1f08f2){return function(_0x4ea032){_0x1f08f2['emit'](_0x571ee8,_0x4ea032);};}function removeListener(_0x2ee906,_0x1741f2){return function(){WhatsappQueueEvents['removeListener'](_0x2ee906,_0x1741f2);};}exports[_0x83d7('0x2')]=function(_0x42a668){for(var _0x1a2c39=0x0,_0x56d11a=events[_0x83d7('0x3')];_0x1a2c39<_0x56d11a;_0x1a2c39++){var _0x39ec94=events[_0x1a2c39];var _0x468a39=createListener(_0x83d7('0x4')+_0x39ec94,_0x42a668);WhatsappQueueEvents['on'](_0x39ec94,_0x468a39);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 37083d5..5d14d8a 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 _0xb64f=['post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4325a7,_0x214113){var _0x441486=function(_0x5765e8){while(--_0x5765e8){_0x4325a7['push'](_0x4325a7['shift']());}};_0x441486(++_0x214113);}(_0xb64f,0x192));var _0xfb64=function(_0x469393,_0x247969){_0x469393=_0x469393-0x0;var _0x5f720d=_0xb64f[_0x469393];return _0x5f720d;};'use strict';var multer=require('multer');var util=require(_0xfb64('0x0'));var path=require(_0xfb64('0x1'));var timeout=require(_0xfb64('0x2'));var express=require(_0xfb64('0x3'));var router=express[_0xfb64('0x4')]();var fs_extra=require(_0xfb64('0x5'));var auth=require(_0xfb64('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfb64('0x7'));var controller=require(_0xfb64('0x8'));router[_0xfb64('0x9')]('/',auth[_0xfb64('0xa')](),controller[_0xfb64('0xb')]);router[_0xfb64('0x9')](_0xfb64('0xc'),auth[_0xfb64('0xa')](),controller[_0xfb64('0xd')]);router[_0xfb64('0x9')](_0xfb64('0xe'),auth[_0xfb64('0xa')](),controller[_0xfb64('0xf')]);router[_0xfb64('0x10')]('/',auth[_0xfb64('0xa')](),controller[_0xfb64('0x11')]);router[_0xfb64('0x12')](_0xfb64('0xe'),auth['isAuthenticated'](),controller[_0xfb64('0x13')]);router[_0xfb64('0x14')](_0xfb64('0xe'),auth[_0xfb64('0xa')](),controller[_0xfb64('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1ab1=['show','post','create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x360c26,_0x3592c3){var _0x257503=function(_0x19d02f){while(--_0x19d02f){_0x360c26['push'](_0x360c26['shift']());}};_0x257503(++_0x3592c3);}(_0x1ab1,0x93));var _0x11ab=function(_0x1b046b,_0x24ae3f){_0x1b046b=_0x1b046b-0x0;var _0x464c72=_0x1ab1[_0x1b046b];return _0x464c72;};'use strict';var multer=require('multer');var util=require(_0x11ab('0x0'));var path=require(_0x11ab('0x1'));var timeout=require('connect-timeout');var express=require(_0x11ab('0x2'));var router=express[_0x11ab('0x3')]();var fs_extra=require(_0x11ab('0x4'));var auth=require(_0x11ab('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x11ab('0x6'));var controller=require(_0x11ab('0x7'));router[_0x11ab('0x8')]('/',auth[_0x11ab('0x9')](),controller['index']);router[_0x11ab('0x8')](_0x11ab('0xa'),auth[_0x11ab('0x9')](),controller[_0x11ab('0xb')]);router[_0x11ab('0x8')](_0x11ab('0xc'),auth[_0x11ab('0x9')](),controller[_0x11ab('0xd')]);router[_0x11ab('0xe')]('/',auth['isAuthenticated'](),controller[_0x11ab('0xf')]);router[_0x11ab('0x10')](_0x11ab('0xc'),auth[_0x11ab('0x9')](),controller['update']);router[_0x11ab('0x11')]('/:id',auth[_0x11ab('0x9')](),controller[_0x11ab('0x12')]);module[_0x11ab('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 04cb9c2..5ca7d58 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(_0x1bcb53,_0x1fce79){var _0x168b51=function(_0x372a80){while(--_0x372a80){_0x1bcb53['push'](_0x1bcb53['shift']());}};_0x168b51(++_0x1fce79);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x573826,_0x2528ff){var _0x52e64e=function(_0x55d151){while(--_0x55d151){_0x573826['push'](_0x573826['shift']());}};_0x52e64e(++_0x2528ff);}(_0x7a54,0x106));var _0x47a5=function(_0x38750b,_0x12ab3b){_0x38750b=_0x38750b-0x0;var _0x28a0ef=_0x7a54[_0x38750b];return _0x28a0ef;};'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 8f54ef0..3de4baf 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 _0x4213=['limit','count','offset','set','json','reject','save','update','then','error','stack','name','send','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','WhatsappQueueReport','findAll','rows','catch','show','params','length','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined'];(function(_0x926f85,_0x5a0ea0){var _0x48c1ce=function(_0x5ae77d){while(--_0x5ae77d){_0x926f85['push'](_0x926f85['shift']());}};_0x48c1ce(++_0x5a0ea0);}(_0x4213,0x77));var _0x3421=function(_0x5603b0,_0x18a222){_0x5603b0=_0x5603b0-0x0;var _0x6f7a66=_0x4213[_0x5603b0];return _0x6f7a66;};'use strict';var emlformat=require(_0x3421('0x0'));var rimraf=require(_0x3421('0x1'));var zipdir=require(_0x3421('0x2'));var jsonpatch=require(_0x3421('0x3'));var rp=require(_0x3421('0x4'));var moment=require(_0x3421('0x5'));var BPromise=require(_0x3421('0x6'));var Mustache=require('mustache');var util=require(_0x3421('0x7'));var path=require('path');var sox=require(_0x3421('0x8'));var csv=require(_0x3421('0x9'));var ejs=require(_0x3421('0xa'));var fs=require('fs');var fs_extra=require(_0x3421('0xb'));var _=require('lodash');var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require(_0x3421('0x9'));var querystring=require('querystring');var Papa=require(_0x3421('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3421('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3421('0x12'));var logger=require(_0x3421('0x13'))(_0x3421('0x14'));var utils=require(_0x3421('0x15'));var config=require(_0x3421('0x16'));var licenseUtil=require(_0x3421('0x17'));var db=require(_0x3421('0x18'))['db'];function respondWithStatusCode(_0x59eaf1,_0x26d459){_0x26d459=_0x26d459||0xcc;return function(_0x3e2ecd){if(_0x3e2ecd){return _0x59eaf1[_0x3421('0x19')](_0x26d459);}return _0x59eaf1[_0x3421('0x1a')](_0x26d459)[_0x3421('0x1b')]();};}function respondWithResult(_0x3f4672,_0x25ffd4){_0x25ffd4=_0x25ffd4||0xc8;return function(_0x59ea4a){if(_0x59ea4a){return _0x3f4672[_0x3421('0x1a')](_0x25ffd4)['json'](_0x59ea4a);}};}function respondWithFilteredResult(_0x372d21,_0x5257ad){return function(_0x59ae45){if(_0x59ae45){var _0x1e33ab=typeof _0x5257ad['offset']===_0x3421('0x1c')&&typeof _0x5257ad[_0x3421('0x1d')]==='undefined';var _0x3584d6=_0x59ae45[_0x3421('0x1e')];var _0x130d3c=_0x1e33ab?0x0:_0x5257ad[_0x3421('0x1f')];var _0x18acc1=_0x1e33ab?_0x59ae45[_0x3421('0x1e')]:_0x5257ad[_0x3421('0x1f')]+_0x5257ad[_0x3421('0x1d')];var _0x197b83;if(_0x18acc1>=_0x3584d6){_0x18acc1=_0x3584d6;_0x197b83=0xc8;}else{_0x197b83=0xce;}_0x372d21[_0x3421('0x1a')](_0x197b83);return _0x372d21[_0x3421('0x20')]('Content-Range',_0x130d3c+'-'+_0x18acc1+'/'+_0x3584d6)[_0x3421('0x21')](_0x59ae45);}return null;};}function patchUpdates(_0x4b59a5){return function(_0x5820f6){try{jsonpatch['apply'](_0x5820f6,_0x4b59a5,!![]);}catch(_0x33155b){return BPromise[_0x3421('0x22')](_0x33155b);}return _0x5820f6[_0x3421('0x23')]();};}function saveUpdates(_0x256cc5,_0x132e8e){return function(_0x39bed4){if(_0x39bed4){return _0x39bed4[_0x3421('0x24')](_0x256cc5)[_0x3421('0x25')](function(_0xb9af5f){return _0xb9af5f;});}return null;};}function removeEntity(_0x34389e,_0x48fb3d){return function(_0x57a4af){if(_0x57a4af){return _0x57a4af['destroy']()[_0x3421('0x25')](function(){_0x34389e[_0x3421('0x1a')](0xcc)[_0x3421('0x1b')]();});}};}function handleEntityNotFound(_0x5bc28a,_0x506af4){return function(_0x1b65d0){if(!_0x1b65d0){_0x5bc28a['sendStatus'](0x194);}return _0x1b65d0;};}function handleError(_0x2bf001,_0x487944){_0x487944=_0x487944||0x1f4;return function(_0x15e73c){logger[_0x3421('0x26')](_0x15e73c[_0x3421('0x27')]);if(_0x15e73c[_0x3421('0x28')]){delete _0x15e73c[_0x3421('0x28')];}_0x2bf001['status'](_0x487944)[_0x3421('0x29')](_0x15e73c);};}exports['index']=function(_0x5efe73,_0x17f501){var _0x5aa96b={},_0x5074a2={},_0xb4eaf4={'count':0x0,'rows':[]};var _0x4ee4aa=_[_0x3421('0x2a')](db['WhatsappQueueReport'][_0x3421('0x2b')],function(_0xbe9f09){return{'name':_0xbe9f09['fieldName'],'type':_0xbe9f09[_0x3421('0x2c')][_0x3421('0x2d')]};});_0x5074a2[_0x3421('0x2e')]=_['map'](_0x4ee4aa,_0x3421('0x28'));_0x5074a2['query']=_[_0x3421('0x2f')](_0x5efe73[_0x3421('0x30')]);_0x5074a2[_0x3421('0x31')]=_[_0x3421('0x32')](_0x5074a2[_0x3421('0x2e')],_0x5074a2[_0x3421('0x30')]);_0x5aa96b[_0x3421('0x33')]=_[_0x3421('0x32')](_0x5074a2[_0x3421('0x2e')],qs[_0x3421('0x34')](_0x5efe73['query']['fields']));_0x5aa96b[_0x3421('0x33')]=_0x5aa96b[_0x3421('0x33')]['length']?_0x5aa96b[_0x3421('0x33')]:_0x5074a2[_0x3421('0x2e')];if(!_0x5efe73[_0x3421('0x30')][_0x3421('0x35')](_0x3421('0x36'))){_0x5aa96b['limit']=qs[_0x3421('0x1d')](_0x5efe73[_0x3421('0x30')][_0x3421('0x1d')]);_0x5aa96b['offset']=qs[_0x3421('0x1f')](_0x5efe73['query'][_0x3421('0x1f')]);}_0x5aa96b[_0x3421('0x37')]=qs[_0x3421('0x38')](_0x5efe73[_0x3421('0x30')][_0x3421('0x38')]);_0x5aa96b[_0x3421('0x39')]=qs[_0x3421('0x31')](_['pick'](_0x5efe73['query'],_0x5074a2['filters']),_0x4ee4aa);if(_0x5efe73[_0x3421('0x30')]['filter']){_0x5aa96b['where']=_[_0x3421('0x3a')](_0x5aa96b['where'],{'$or':_[_0x3421('0x2a')](_0x4ee4aa,function(_0x9b983f){if(_0x9b983f['type']!==_0x3421('0x3b')){var _0x3121aa={};_0x3121aa[_0x9b983f[_0x3421('0x28')]]={'$like':'%'+_0x5efe73[_0x3421('0x30')]['filter']+'%'};return _0x3121aa;}})});}_0x5aa96b=_[_0x3421('0x3a')]({},_0x5aa96b,_0x5efe73[_0x3421('0x3c')]);var _0x267e0b={'where':_0x5aa96b[_0x3421('0x39')]};return db[_0x3421('0x3d')]['count'](_0x267e0b)[_0x3421('0x25')](function(_0x454859){_0xb4eaf4['count']=_0x454859;if(_0x5efe73[_0x3421('0x30')]['includeAll']){_0x5aa96b['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x3421('0x3e')](_0x5aa96b);})[_0x3421('0x25')](function(_0x41bdb7){_0xb4eaf4[_0x3421('0x3f')]=_0x41bdb7;return _0xb4eaf4;})[_0x3421('0x25')](respondWithFilteredResult(_0x17f501,_0x5aa96b))[_0x3421('0x40')](handleError(_0x17f501,null));};exports[_0x3421('0x41')]=function(_0x4e3f1e,_0x33198f){var _0x14e30c={'raw':!![],'where':{'id':_0x4e3f1e[_0x3421('0x42')]['id']}},_0x3b9d15={};_0x3b9d15[_0x3421('0x2e')]=_[_0x3421('0x2f')](db['WhatsappQueueReport'][_0x3421('0x2b')]);_0x3b9d15[_0x3421('0x30')]=_[_0x3421('0x2f')](_0x4e3f1e[_0x3421('0x30')]);_0x3b9d15['filters']=_[_0x3421('0x32')](_0x3b9d15['model'],_0x3b9d15[_0x3421('0x30')]);_0x14e30c[_0x3421('0x33')]=_[_0x3421('0x32')](_0x3b9d15[_0x3421('0x2e')],qs[_0x3421('0x34')](_0x4e3f1e[_0x3421('0x30')][_0x3421('0x34')]));_0x14e30c[_0x3421('0x33')]=_0x14e30c[_0x3421('0x33')][_0x3421('0x43')]?_0x14e30c[_0x3421('0x33')]:_0x3b9d15[_0x3421('0x2e')];if(_0x4e3f1e[_0x3421('0x30')]['includeAll']){_0x14e30c[_0x3421('0x44')]=[{'all':!![]}];}_0x14e30c=_['merge']({},_0x14e30c,_0x4e3f1e[_0x3421('0x3c')]);return db[_0x3421('0x3d')][_0x3421('0x45')](_0x14e30c)[_0x3421('0x25')](handleEntityNotFound(_0x33198f,null))[_0x3421('0x25')](respondWithResult(_0x33198f,null))[_0x3421('0x40')](handleError(_0x33198f,null));};exports[_0x3421('0x46')]=function(_0x44bf06,_0x406ea9){return db[_0x3421('0x3d')]['create'](_0x44bf06[_0x3421('0x47')],{})[_0x3421('0x25')](respondWithResult(_0x406ea9,0xc9))[_0x3421('0x40')](handleError(_0x406ea9,null));};exports['update']=function(_0x566f95,_0x43a94f){if(_0x566f95[_0x3421('0x47')]['id']){delete _0x566f95[_0x3421('0x47')]['id'];}return db['WhatsappQueueReport'][_0x3421('0x45')]({'where':{'id':_0x566f95[_0x3421('0x42')]['id']}})[_0x3421('0x25')](handleEntityNotFound(_0x43a94f,null))[_0x3421('0x25')](saveUpdates(_0x566f95['body'],null))[_0x3421('0x25')](respondWithResult(_0x43a94f,null))[_0x3421('0x40')](handleError(_0x43a94f,null));};exports[_0x3421('0x48')]=function(_0x51a21f,_0x496000){return db['WhatsappQueueReport'][_0x3421('0x45')]({'where':{'id':_0x51a21f[_0x3421('0x42')]['id']}})['then'](handleEntityNotFound(_0x496000,null))['then'](removeEntity(_0x496000,null))[_0x3421('0x40')](handleError(_0x496000,null));};exports[_0x3421('0x49')]=function(_0x46b7b7,_0x25b0d8){return db[_0x3421('0x3d')]['describe']()[_0x3421('0x25')](respondWithResult(_0x25b0d8,null))[_0x3421('0x40')](handleError(_0x25b0d8,null));}; \ No newline at end of file +var _0xf7b4=['../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','WhatsappQueueReport','rows','catch','show','params','find','create','body','destroy','describe','eml-format','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/license/hardware','../../config/logger','api'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xf7b4,0x152));var _0x4f7b=function(_0x48c4b0,_0x6dfcba){_0x48c4b0=_0x48c4b0-0x0;var _0x1bfc9e=_0xf7b4[_0x48c4b0];return _0x1bfc9e;};'use strict';var emlformat=require(_0x4f7b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f7b('0x1'));var rp=require(_0x4f7b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f7b('0x3'));var util=require(_0x4f7b('0x4'));var path=require(_0x4f7b('0x5'));var sox=require(_0x4f7b('0x6'));var csv=require(_0x4f7b('0x7'));var ejs=require(_0x4f7b('0x8'));var fs=require('fs');var fs_extra=require(_0x4f7b('0x9'));var _=require(_0x4f7b('0xa'));var squel=require(_0x4f7b('0xb'));var crypto=require(_0x4f7b('0xc'));var jsforce=require(_0x4f7b('0xd'));var deskjs=require(_0x4f7b('0xe'));var toCsv=require(_0x4f7b('0x7'));var querystring=require('querystring');var Papa=require(_0x4f7b('0xf'));var Redis=require(_0x4f7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f7b('0x11'));var as=require(_0x4f7b('0x12'));var hardwareService=require(_0x4f7b('0x13'));var logger=require(_0x4f7b('0x14'))(_0x4f7b('0x15'));var utils=require('../../config/utils');var config=require(_0x4f7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd9b349,_0x2e8dd9){_0x2e8dd9=_0x2e8dd9||0xcc;return function(_0x3c55e1){if(_0x3c55e1){return _0xd9b349[_0x4f7b('0x17')](_0x2e8dd9);}return _0xd9b349['status'](_0x2e8dd9)[_0x4f7b('0x18')]();};}function respondWithResult(_0x368091,_0x407cee){_0x407cee=_0x407cee||0xc8;return function(_0x43a51a){if(_0x43a51a){return _0x368091[_0x4f7b('0x19')](_0x407cee)[_0x4f7b('0x1a')](_0x43a51a);}};}function respondWithFilteredResult(_0x40ecb0,_0x2437cc){return function(_0x260667){if(_0x260667){var _0x29fdd5=typeof _0x2437cc[_0x4f7b('0x1b')]===_0x4f7b('0x1c')&&typeof _0x2437cc['limit']===_0x4f7b('0x1c');var _0x496322=_0x260667['count'];var _0x24e5cf=_0x29fdd5?0x0:_0x2437cc[_0x4f7b('0x1b')];var _0x519d90=_0x29fdd5?_0x260667[_0x4f7b('0x1d')]:_0x2437cc[_0x4f7b('0x1b')]+_0x2437cc[_0x4f7b('0x1e')];var _0xf2311f;if(_0x519d90>=_0x496322){_0x519d90=_0x496322;_0xf2311f=0xc8;}else{_0xf2311f=0xce;}_0x40ecb0['status'](_0xf2311f);return _0x40ecb0[_0x4f7b('0x1f')]('Content-Range',_0x24e5cf+'-'+_0x519d90+'/'+_0x496322)[_0x4f7b('0x1a')](_0x260667);}return null;};}function patchUpdates(_0x12374b){return function(_0xa2f54e){try{jsonpatch[_0x4f7b('0x20')](_0xa2f54e,_0x12374b,!![]);}catch(_0x27127b){return BPromise[_0x4f7b('0x21')](_0x27127b);}return _0xa2f54e[_0x4f7b('0x22')]();};}function saveUpdates(_0x1f545e,_0x2a8b50){return function(_0x5508bd){if(_0x5508bd){return _0x5508bd[_0x4f7b('0x23')](_0x1f545e)[_0x4f7b('0x24')](function(_0x2c9ea6){return _0x2c9ea6;});}return null;};}function removeEntity(_0x5bd43f,_0x150f57){return function(_0x4610a4){if(_0x4610a4){return _0x4610a4['destroy']()[_0x4f7b('0x24')](function(){_0x5bd43f['status'](0xcc)[_0x4f7b('0x18')]();});}};}function handleEntityNotFound(_0x2429be,_0x23c820){return function(_0x278c41){if(!_0x278c41){_0x2429be[_0x4f7b('0x17')](0x194);}return _0x278c41;};}function handleError(_0x94478b,_0x181e13){_0x181e13=_0x181e13||0x1f4;return function(_0x3ad769){logger['error'](_0x3ad769[_0x4f7b('0x25')]);if(_0x3ad769[_0x4f7b('0x26')]){delete _0x3ad769[_0x4f7b('0x26')];}_0x94478b['status'](_0x181e13)[_0x4f7b('0x27')](_0x3ad769);};}exports[_0x4f7b('0x28')]=function(_0x1db684,_0x3a56ff){var _0x1ccce0={},_0x4ebffa={},_0xac1f93={'count':0x0,'rows':[]};var _0x3331b2=_[_0x4f7b('0x29')](db['WhatsappQueueReport'][_0x4f7b('0x2a')],function(_0x5d13a1){return{'name':_0x5d13a1['fieldName'],'type':_0x5d13a1[_0x4f7b('0x2b')]['key']};});_0x4ebffa[_0x4f7b('0x2c')]=_[_0x4f7b('0x29')](_0x3331b2,_0x4f7b('0x26'));_0x4ebffa[_0x4f7b('0x2d')]=_[_0x4f7b('0x2e')](_0x1db684[_0x4f7b('0x2d')]);_0x4ebffa[_0x4f7b('0x2f')]=_[_0x4f7b('0x30')](_0x4ebffa[_0x4f7b('0x2c')],_0x4ebffa[_0x4f7b('0x2d')]);_0x1ccce0[_0x4f7b('0x31')]=_[_0x4f7b('0x30')](_0x4ebffa[_0x4f7b('0x2c')],qs[_0x4f7b('0x32')](_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x32')]));_0x1ccce0[_0x4f7b('0x31')]=_0x1ccce0[_0x4f7b('0x31')][_0x4f7b('0x33')]?_0x1ccce0[_0x4f7b('0x31')]:_0x4ebffa[_0x4f7b('0x2c')];if(!_0x1db684[_0x4f7b('0x2d')]['hasOwnProperty'](_0x4f7b('0x34'))){_0x1ccce0['limit']=qs[_0x4f7b('0x1e')](_0x1db684[_0x4f7b('0x2d')]['limit']);_0x1ccce0[_0x4f7b('0x1b')]=qs[_0x4f7b('0x1b')](_0x1db684[_0x4f7b('0x2d')]['offset']);}_0x1ccce0[_0x4f7b('0x35')]=qs[_0x4f7b('0x36')](_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x36')]);_0x1ccce0[_0x4f7b('0x37')]=qs[_0x4f7b('0x2f')](_[_0x4f7b('0x38')](_0x1db684['query'],_0x4ebffa[_0x4f7b('0x2f')]),_0x3331b2);if(_0x1db684['query'][_0x4f7b('0x39')]){_0x1ccce0[_0x4f7b('0x37')]=_[_0x4f7b('0x3a')](_0x1ccce0['where'],{'$or':_[_0x4f7b('0x29')](_0x3331b2,function(_0x53da14){if(_0x53da14[_0x4f7b('0x2b')]!==_0x4f7b('0x3b')){var _0x49644e={};_0x49644e[_0x53da14['name']]={'$like':'%'+_0x1db684[_0x4f7b('0x2d')]['filter']+'%'};return _0x49644e;}})});}_0x1ccce0=_[_0x4f7b('0x3a')]({},_0x1ccce0,_0x1db684[_0x4f7b('0x3c')]);var _0x54f9e8={'where':_0x1ccce0[_0x4f7b('0x37')]};return db['WhatsappQueueReport']['count'](_0x54f9e8)['then'](function(_0x1e4421){_0xac1f93[_0x4f7b('0x1d')]=_0x1e4421;if(_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x3d')]){_0x1ccce0['include']=[{'all':!![]}];}return db[_0x4f7b('0x3e')]['findAll'](_0x1ccce0);})[_0x4f7b('0x24')](function(_0x586406){_0xac1f93[_0x4f7b('0x3f')]=_0x586406;return _0xac1f93;})['then'](respondWithFilteredResult(_0x3a56ff,_0x1ccce0))[_0x4f7b('0x40')](handleError(_0x3a56ff,null));};exports[_0x4f7b('0x41')]=function(_0x302163,_0x3ab08f){var _0x2986cd={'raw':!![],'where':{'id':_0x302163[_0x4f7b('0x42')]['id']}},_0x325cd6={};_0x325cd6[_0x4f7b('0x2c')]=_[_0x4f7b('0x2e')](db[_0x4f7b('0x3e')][_0x4f7b('0x2a')]);_0x325cd6[_0x4f7b('0x2d')]=_[_0x4f7b('0x2e')](_0x302163[_0x4f7b('0x2d')]);_0x325cd6[_0x4f7b('0x2f')]=_[_0x4f7b('0x30')](_0x325cd6[_0x4f7b('0x2c')],_0x325cd6[_0x4f7b('0x2d')]);_0x2986cd['attributes']=_['intersection'](_0x325cd6[_0x4f7b('0x2c')],qs[_0x4f7b('0x32')](_0x302163[_0x4f7b('0x2d')][_0x4f7b('0x32')]));_0x2986cd['attributes']=_0x2986cd['attributes'][_0x4f7b('0x33')]?_0x2986cd[_0x4f7b('0x31')]:_0x325cd6[_0x4f7b('0x2c')];if(_0x302163[_0x4f7b('0x2d')]['includeAll']){_0x2986cd['include']=[{'all':!![]}];}_0x2986cd=_[_0x4f7b('0x3a')]({},_0x2986cd,_0x302163[_0x4f7b('0x3c')]);return db[_0x4f7b('0x3e')][_0x4f7b('0x43')](_0x2986cd)[_0x4f7b('0x24')](handleEntityNotFound(_0x3ab08f,null))['then'](respondWithResult(_0x3ab08f,null))[_0x4f7b('0x40')](handleError(_0x3ab08f,null));};exports[_0x4f7b('0x44')]=function(_0x35c0ea,_0x5df68e){return db[_0x4f7b('0x3e')][_0x4f7b('0x44')](_0x35c0ea[_0x4f7b('0x45')],{})[_0x4f7b('0x24')](respondWithResult(_0x5df68e,0xc9))[_0x4f7b('0x40')](handleError(_0x5df68e,null));};exports[_0x4f7b('0x23')]=function(_0xee485,_0x2e563f){if(_0xee485[_0x4f7b('0x45')]['id']){delete _0xee485[_0x4f7b('0x45')]['id'];}return db['WhatsappQueueReport'][_0x4f7b('0x43')]({'where':{'id':_0xee485[_0x4f7b('0x42')]['id']}})[_0x4f7b('0x24')](handleEntityNotFound(_0x2e563f,null))['then'](saveUpdates(_0xee485[_0x4f7b('0x45')],null))[_0x4f7b('0x24')](respondWithResult(_0x2e563f,null))[_0x4f7b('0x40')](handleError(_0x2e563f,null));};exports[_0x4f7b('0x46')]=function(_0x145dd7,_0x7e624){return db[_0x4f7b('0x3e')][_0x4f7b('0x43')]({'where':{'id':_0x145dd7[_0x4f7b('0x42')]['id']}})[_0x4f7b('0x24')](handleEntityNotFound(_0x7e624,null))['then'](removeEntity(_0x7e624,null))[_0x4f7b('0x40')](handleError(_0x7e624,null));};exports[_0x4f7b('0x47')]=function(_0x12b6a6,_0x4d1ac9){return db[_0x4f7b('0x3e')][_0x4f7b('0x47')]()[_0x4f7b('0x24')](respondWithResult(_0x4d1ac9,null))[_0x4f7b('0x40')](handleError(_0x4d1ac9,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 100d70f..f5a4f74 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 _0x928b=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','api','request-promise','rimraf','exports','define'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x928b,0xed));var _0xb928=function(_0x49ad26,_0x3a2f40){_0x49ad26=_0x49ad26-0x0;var _0x3ac8eb=_0x928b[_0x49ad26];return _0x3ac8eb;};'use strict';var _=require(_0xb928('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb928('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb928('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb928('0x3'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0xb928('0x4')]=function(_0x9d20a2,_0x521e52){return _0x9d20a2[_0xb928('0x5')](_0xb928('0x6'),attributes,{'tableName':_0xb928('0x7'),'paranoid':![],'indexes':[{'name':_0xb928('0x8'),'fields':[_0xb928('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x368d=['request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0xfcd380,_0x14b3b2){var _0x3971f0=function(_0x181bc9){while(--_0x181bc9){_0xfcd380['push'](_0xfcd380['shift']());}};_0x3971f0(++_0x14b3b2);}(_0x368d,0xbf));var _0xd368=function(_0x2085e8,_0x17d6e1){_0x2085e8=_0x2085e8-0x0;var _0x524253=_0x368d[_0x2085e8];return _0x524253;};'use strict';var _=require(_0xd368('0x0'));var util=require(_0xd368('0x1'));var logger=require(_0xd368('0x2'))(_0xd368('0x3'));var moment=require('moment');var BPromise=require(_0xd368('0x4'));var rp=require(_0xd368('0x5'));var fs=require('fs');var path=require(_0xd368('0x6'));var rimraf=require(_0xd368('0x7'));var config=require(_0xd368('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0xd368('0x9')]=function(_0x1a7026,_0x687399){return _0x1a7026[_0xd368('0xa')](_0xd368('0xb'),attributes,{'tableName':_0xd368('0xc'),'paranoid':![],'indexes':[{'name':_0xd368('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 0284195..36fa7ad 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 _0x51dd=['client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0x51dd,0x1d5));var _0xd51d=function(_0x3a2225,_0xb6600){_0x3a2225=_0x3a2225-0x0;var _0x5c8040=_0x51dd[_0x3a2225];return _0x5c8040;};'use strict';var _=require(_0xd51d('0x0'));var util=require(_0xd51d('0x1'));var moment=require(_0xd51d('0x2'));var BPromise=require(_0xd51d('0x3'));var rs=require(_0xd51d('0x4'));var fs=require('fs');var Redis=require(_0xd51d('0x5'));var db=require(_0xd51d('0x6'))['db'];var utils=require(_0xd51d('0x7'));var logger=require('../../config/logger')(_0xd51d('0x8'));var config=require(_0xd51d('0x9'));var jayson=require(_0xd51d('0xa'));var client=jayson[_0xd51d('0xb')][_0xd51d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32e63b,_0x3e3a01,_0xf498dc){return new BPromise(function(_0x5bf2bb,_0x4eb12c){return client[_0xd51d('0xd')](_0x32e63b,_0xf498dc)[_0xd51d('0xe')](function(_0xa5623d){logger[_0xd51d('0xf')](_0xd51d('0x10'),_0x3e3a01,_0xd51d('0x11'));logger['debug'](_0xd51d('0x12'),_0x3e3a01,'request\x20sent',JSON[_0xd51d('0x13')](_0xa5623d));if(_0xa5623d[_0xd51d('0x14')]){if(_0xa5623d[_0xd51d('0x14')]['code']===0x1f4){logger[_0xd51d('0x14')](_0xd51d('0x10'),_0x3e3a01,_0xa5623d[_0xd51d('0x14')]['message']);return _0x4eb12c(_0xa5623d['error'][_0xd51d('0x15')]);}logger[_0xd51d('0x14')](_0xd51d('0x10'),_0x3e3a01,_0xa5623d[_0xd51d('0x14')]['message']);return _0x5bf2bb(_0xa5623d[_0xd51d('0x14')]['message']);}else{logger[_0xd51d('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3e3a01,_0xd51d('0x11'));_0x5bf2bb(_0xa5623d['result'][_0xd51d('0x15')]);}})[_0xd51d('0x16')](function(_0x1a34d9){logger[_0xd51d('0x14')](_0xd51d('0x10'),_0x3e3a01,_0x1a34d9);_0x4eb12c(_0x1a34d9);});});}exports['CreateWhatsappQueueReport']=function(_0x405e6d){var _0x2b6706=this;return new Promise(function(_0x2fd031,_0x30d87c){return db[_0xd51d('0x17')]['create'](_0x405e6d[_0xd51d('0x18')],{'raw':_0x405e6d[_0xd51d('0x19')]?_0x405e6d[_0xd51d('0x19')][_0xd51d('0x1a')]===undefined?!![]:![]:!![]})[_0xd51d('0xe')](function(_0x2e5955){logger[_0xd51d('0xf')](_0xd51d('0x1b'),_0x405e6d);logger['debug']('CreateWhatsappQueueReport',_0x405e6d,JSON[_0xd51d('0x13')](_0x2e5955));_0x2fd031(_0x2e5955);})['catch'](function(_0x5dff0d){logger[_0xd51d('0x14')]('CreateWhatsappQueueReport',_0x5dff0d[_0xd51d('0x15')],_0x405e6d);_0x30d87c(_0x2b6706['error'](0x1f4,_0x5dff0d[_0xd51d('0x15')]));});});};exports[_0xd51d('0x1c')]=function(_0x385a98){var _0x5cb125=this;return new Promise(function(_0xd57dac,_0x2835f5){return db[_0xd51d('0x17')][_0xd51d('0x1d')](_0x385a98[_0xd51d('0x18')],{'raw':_0x385a98[_0xd51d('0x19')]?_0x385a98['options'][_0xd51d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x385a98[_0xd51d('0x19')]?_0x385a98['options']['where']||null:null,'attributes':_0x385a98[_0xd51d('0x19')]?_0x385a98[_0xd51d('0x19')]['attributes']||null:null,'limit':_0x385a98[_0xd51d('0x19')]?_0x385a98[_0xd51d('0x19')][_0xd51d('0x1e')]||null:null})[_0xd51d('0xe')](function(_0x368357){logger[_0xd51d('0xf')]('UpdateWhatsappQueueReport',_0x385a98);logger[_0xd51d('0x1f')](_0xd51d('0x1c'),_0x385a98,JSON[_0xd51d('0x13')](_0x368357));_0xd57dac(_0x368357);})[_0xd51d('0x16')](function(_0x472a77){logger[_0xd51d('0x14')]('UpdateWhatsappQueueReport',_0x472a77[_0xd51d('0x15')],_0x385a98);_0x2835f5(_0x5cb125[_0xd51d('0x14')](0x1f4,_0x472a77[_0xd51d('0x15')]));});});}; \ No newline at end of file +var _0x7a7b=['create','body','options','UpdateWhatsappQueueReport','WhatsappQueueReport','update','raw','where','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateWhatsappQueueReport'];(function(_0xe27393,_0x1bed7f){var _0x42636e=function(_0x24ea2a){while(--_0x24ea2a){_0xe27393['push'](_0xe27393['shift']());}};_0x42636e(++_0x1bed7f);}(_0x7a7b,0x101));var _0xb7a7=function(_0xee6752,_0x667b44){_0xee6752=_0xee6752-0x0;var _0xb4dcea=_0x7a7b[_0xee6752];return _0xb4dcea;};'use strict';var _=require(_0xb7a7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb7a7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7a7('0x2'));var db=require(_0xb7a7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7a7('0x4'))(_0xb7a7('0x5'));var config=require('../../config/environment');var jayson=require(_0xb7a7('0x6'));var client=jayson['client'][_0xb7a7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x42a4f2,_0x4abea3,_0x2c0a61){return new BPromise(function(_0x50b3c0,_0x393cc9){return client[_0xb7a7('0x8')](_0x42a4f2,_0x2c0a61)[_0xb7a7('0x9')](function(_0x340118){logger[_0xb7a7('0xa')](_0xb7a7('0xb'),_0x4abea3,_0xb7a7('0xc'));logger[_0xb7a7('0xd')](_0xb7a7('0xe'),_0x4abea3,_0xb7a7('0xc'),JSON[_0xb7a7('0xf')](_0x340118));if(_0x340118['error']){if(_0x340118['error'][_0xb7a7('0x10')]===0x1f4){logger['error'](_0xb7a7('0xb'),_0x4abea3,_0x340118['error']['message']);return _0x393cc9(_0x340118[_0xb7a7('0x11')][_0xb7a7('0x12')]);}logger[_0xb7a7('0x11')](_0xb7a7('0xb'),_0x4abea3,_0x340118['error'][_0xb7a7('0x12')]);return _0x50b3c0(_0x340118['error'][_0xb7a7('0x12')]);}else{logger[_0xb7a7('0xa')](_0xb7a7('0xb'),_0x4abea3,_0xb7a7('0xc'));_0x50b3c0(_0x340118[_0xb7a7('0x13')]['message']);}})[_0xb7a7('0x14')](function(_0x5c77e8){logger['error'](_0xb7a7('0xb'),_0x4abea3,_0x5c77e8);_0x393cc9(_0x5c77e8);});});}exports[_0xb7a7('0x15')]=function(_0x5eb7ba){var _0x155ed5=this;return new Promise(function(_0x569e5f,_0x49d811){return db['WhatsappQueueReport'][_0xb7a7('0x16')](_0x5eb7ba[_0xb7a7('0x17')],{'raw':_0x5eb7ba[_0xb7a7('0x18')]?_0x5eb7ba[_0xb7a7('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xb7a7('0x9')](function(_0x1198ca){logger[_0xb7a7('0xa')](_0xb7a7('0x15'),_0x5eb7ba);logger[_0xb7a7('0xd')](_0xb7a7('0x15'),_0x5eb7ba,JSON[_0xb7a7('0xf')](_0x1198ca));_0x569e5f(_0x1198ca);})[_0xb7a7('0x14')](function(_0x5907db){logger[_0xb7a7('0x11')](_0xb7a7('0x15'),_0x5907db[_0xb7a7('0x12')],_0x5eb7ba);_0x49d811(_0x155ed5['error'](0x1f4,_0x5907db[_0xb7a7('0x12')]));});});};exports[_0xb7a7('0x19')]=function(_0x18cc12){var _0x3508c7=this;return new Promise(function(_0x5d4caa,_0x2b776f){return db[_0xb7a7('0x1a')][_0xb7a7('0x1b')](_0x18cc12[_0xb7a7('0x17')],{'raw':_0x18cc12[_0xb7a7('0x18')]?_0x18cc12[_0xb7a7('0x18')][_0xb7a7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18cc12[_0xb7a7('0x18')]?_0x18cc12[_0xb7a7('0x18')][_0xb7a7('0x1d')]||null:null,'attributes':_0x18cc12[_0xb7a7('0x18')]?_0x18cc12['options']['attributes']||null:null,'limit':_0x18cc12[_0xb7a7('0x18')]?_0x18cc12[_0xb7a7('0x18')][_0xb7a7('0x1e')]||null:null})['then'](function(_0x4ba1de){logger['info'](_0xb7a7('0x19'),_0x18cc12);logger[_0xb7a7('0xd')]('UpdateWhatsappQueueReport',_0x18cc12,JSON[_0xb7a7('0xf')](_0x4ba1de));_0x5d4caa(_0x4ba1de);})[_0xb7a7('0x14')](function(_0x372f3d){logger[_0xb7a7('0x11')]('UpdateWhatsappQueueReport',_0x372f3d[_0xb7a7('0x12')],_0x18cc12);_0x2b776f(_0x3508c7[_0xb7a7('0x11')](0x1f4,_0x372f3d[_0xb7a7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 861469a..500fc54 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 _0xed4d=['show','post','create','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x237b07,_0x49ebca){var _0x4ad90b=function(_0x1e457f){while(--_0x1e457f){_0x237b07['push'](_0x237b07['shift']());}};_0x4ad90b(++_0x49ebca);}(_0xed4d,0x1cf));var _0xded4=function(_0x5de2a6,_0x35df95){_0x5de2a6=_0x5de2a6-0x0;var _0x1c2edf=_0xed4d[_0x5de2a6];return _0x1c2edf;};'use strict';var multer=require(_0xded4('0x0'));var util=require(_0xded4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xded4('0x2'));var router=express[_0xded4('0x3')]();var fs_extra=require(_0xded4('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xded4('0x5'));var controller=require(_0xded4('0x6'));router[_0xded4('0x7')]('/',auth[_0xded4('0x8')](),controller[_0xded4('0x9')]);router[_0xded4('0x7')]('/describe',auth[_0xded4('0x8')](),controller[_0xded4('0xa')]);router['get'](_0xded4('0xb'),auth['isAuthenticated'](),controller[_0xded4('0xc')]);router[_0xded4('0xd')]('/',auth[_0xded4('0x8')](),controller[_0xded4('0xe')]);router[_0xded4('0xf')](_0xded4('0xb'),auth[_0xded4('0x8')](),controller[_0xded4('0x10')]);router['delete'](_0xded4('0xb'),auth[_0xded4('0x8')](),controller[_0xded4('0x11')]);module[_0xded4('0x12')]=router; \ No newline at end of file +var _0xb289=['index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xb289,0x170));var _0x9b28=function(_0x53c1d9,_0x3fbdd5){_0x53c1d9=_0x53c1d9-0x0;var _0x3487e0=_0xb289[_0x53c1d9];return _0x3487e0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9b28('0x0'));var timeout=require(_0x9b28('0x1'));var express=require(_0x9b28('0x2'));var router=express[_0x9b28('0x3')]();var fs_extra=require(_0x9b28('0x4'));var auth=require(_0x9b28('0x5'));var interaction=require(_0x9b28('0x6'));var config=require(_0x9b28('0x7'));var controller=require(_0x9b28('0x8'));router[_0x9b28('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b28('0xa')]);router[_0x9b28('0x9')](_0x9b28('0xb'),auth[_0x9b28('0xc')](),controller[_0x9b28('0xd')]);router[_0x9b28('0x9')](_0x9b28('0xe'),auth['isAuthenticated'](),controller[_0x9b28('0xf')]);router[_0x9b28('0x10')]('/',auth[_0x9b28('0xc')](),controller[_0x9b28('0x11')]);router[_0x9b28('0x12')]('/:id',auth[_0x9b28('0xc')](),controller['update']);router[_0x9b28('0x13')]('/:id',auth[_0x9b28('0xc')](),controller['destroy']);module[_0x9b28('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 976b116..d005cce 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 _0x5800=['account','queue','DATE','exports','STRING','ENUM'];(function(_0x30c819,_0x5d5856){var _0x13babf=function(_0x4b603e){while(--_0x4b603e){_0x30c819['push'](_0x30c819['shift']());}};_0x13babf(++_0x5d5856);}(_0x5800,0x1b9));var _0x0580=function(_0x3dbdee,_0x1b78c9){_0x3dbdee=_0x3dbdee-0x0;var _0x4ea3ca=_0x5800[_0x3dbdee];return _0x4ea3ca;};'use strict';var Sequelize=require('sequelize');module[_0x0580('0x0')]={'uniqueid':{'type':Sequelize[_0x0580('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0580('0x2')](_0x0580('0x3'),'agent',_0x0580('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0580('0x5')]}}; \ No newline at end of file +var _0xc04a=['agent','queue','sequelize','STRING','account'];(function(_0x40c258,_0x5bc9af){var _0x6ce65a=function(_0x53a0bf){while(--_0x53a0bf){_0x40c258['push'](_0x40c258['shift']());}};_0x6ce65a(++_0x5bc9af);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac04('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xac04('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xac04('0x2'),_0xac04('0x3'),_0xac04('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index cb6b066..98f580d 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 _0x844d=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x12b4e9,_0x158cab){var _0x369e4b=function(_0xfd31f6){while(--_0xfd31f6){_0x12b4e9['push'](_0x12b4e9['shift']());}};_0x369e4b(++_0x158cab);}(_0x844d,0xec));var _0xd844=function(_0x4da690,_0x12d136){_0x4da690=_0x4da690-0x0;var _0x263c53=_0x844d[_0x4da690];return _0x263c53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd844('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd844('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd844('0x2'));var Mustache=require(_0xd844('0x3'));var util=require(_0xd844('0x4'));var path=require(_0xd844('0x5'));var sox=require(_0xd844('0x6'));var csv=require(_0xd844('0x7'));var ejs=require(_0xd844('0x8'));var fs=require('fs');var fs_extra=require(_0xd844('0x9'));var _=require(_0xd844('0xa'));var squel=require(_0xd844('0xb'));var crypto=require(_0xd844('0xc'));var jsforce=require(_0xd844('0xd'));var deskjs=require(_0xd844('0xe'));var toCsv=require(_0xd844('0x7'));var querystring=require(_0xd844('0xf'));var Papa=require(_0xd844('0x10'));var Redis=require(_0xd844('0x11'));var authService=require(_0xd844('0x12'));var qs=require(_0xd844('0x13'));var as=require(_0xd844('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd844('0x15'))(_0xd844('0x16'));var utils=require(_0xd844('0x17'));var config=require(_0xd844('0x18'));var licenseUtil=require(_0xd844('0x19'));var db=require(_0xd844('0x1a'))['db'];function respondWithStatusCode(_0x5833e2,_0x152ced){_0x152ced=_0x152ced||0xcc;return function(_0x1d5075){if(_0x1d5075){return _0x5833e2[_0xd844('0x1b')](_0x152ced);}return _0x5833e2['status'](_0x152ced)[_0xd844('0x1c')]();};}function respondWithResult(_0x5b858e,_0x2ef20e){_0x2ef20e=_0x2ef20e||0xc8;return function(_0x120db7){if(_0x120db7){return _0x5b858e[_0xd844('0x1d')](_0x2ef20e)[_0xd844('0x1e')](_0x120db7);}};}function respondWithFilteredResult(_0x546458,_0x35f363){return function(_0x442c84){if(_0x442c84){var _0x2d51fd=typeof _0x35f363['offset']==='undefined'&&typeof _0x35f363[_0xd844('0x1f')]===_0xd844('0x20');var _0x37cebb=_0x442c84[_0xd844('0x21')];var _0x85fa53=_0x2d51fd?0x0:_0x35f363[_0xd844('0x22')];var _0x12aaa5=_0x2d51fd?_0x442c84[_0xd844('0x21')]:_0x35f363[_0xd844('0x22')]+_0x35f363[_0xd844('0x1f')];var _0x3298cc;if(_0x12aaa5>=_0x37cebb){_0x12aaa5=_0x37cebb;_0x3298cc=0xc8;}else{_0x3298cc=0xce;}_0x546458[_0xd844('0x1d')](_0x3298cc);return _0x546458[_0xd844('0x23')]('Content-Range',_0x85fa53+'-'+_0x12aaa5+'/'+_0x37cebb)[_0xd844('0x1e')](_0x442c84);}return null;};}function patchUpdates(_0x341963){return function(_0x45c2e4){try{jsonpatch[_0xd844('0x24')](_0x45c2e4,_0x341963,!![]);}catch(_0x2964d2){return BPromise[_0xd844('0x25')](_0x2964d2);}return _0x45c2e4[_0xd844('0x26')]();};}function saveUpdates(_0x46acb9,_0x507024){return function(_0x5c0164){if(_0x5c0164){return _0x5c0164[_0xd844('0x27')](_0x46acb9)[_0xd844('0x28')](function(_0x5398fe){return _0x5398fe;});}return null;};}function removeEntity(_0x3f9c20,_0x522758){return function(_0x357491){if(_0x357491){return _0x357491[_0xd844('0x29')]()[_0xd844('0x28')](function(){_0x3f9c20[_0xd844('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20bac4,_0x420cd9){return function(_0x3eb4b7){if(!_0x3eb4b7){_0x20bac4[_0xd844('0x1b')](0x194);}return _0x3eb4b7;};}function handleError(_0x1f02a4,_0x5846f4){_0x5846f4=_0x5846f4||0x1f4;return function(_0x579470){logger[_0xd844('0x2a')](_0x579470['stack']);if(_0x579470[_0xd844('0x2b')]){delete _0x579470[_0xd844('0x2b')];}_0x1f02a4[_0xd844('0x1d')](_0x5846f4)[_0xd844('0x2c')](_0x579470);};}exports[_0xd844('0x2d')]=function(_0x430ea9,_0x3c30ee){var _0x2ce79d={},_0x1cd166={},_0x6d5ab5={'count':0x0,'rows':[]};var _0x5db4a3=_[_0xd844('0x2e')](db[_0xd844('0x2f')][_0xd844('0x30')],function(_0xad8bb8){return{'name':_0xad8bb8[_0xd844('0x31')],'type':_0xad8bb8[_0xd844('0x32')][_0xd844('0x33')]};});_0x1cd166[_0xd844('0x34')]=_[_0xd844('0x2e')](_0x5db4a3,_0xd844('0x2b'));_0x1cd166[_0xd844('0x35')]=_[_0xd844('0x36')](_0x430ea9[_0xd844('0x35')]);_0x1cd166[_0xd844('0x37')]=_[_0xd844('0x38')](_0x1cd166[_0xd844('0x34')],_0x1cd166[_0xd844('0x35')]);_0x2ce79d[_0xd844('0x39')]=_['intersection'](_0x1cd166[_0xd844('0x34')],qs['fields'](_0x430ea9[_0xd844('0x35')][_0xd844('0x3a')]));_0x2ce79d[_0xd844('0x39')]=_0x2ce79d['attributes'][_0xd844('0x3b')]?_0x2ce79d[_0xd844('0x39')]:_0x1cd166[_0xd844('0x34')];if(!_0x430ea9[_0xd844('0x35')][_0xd844('0x3c')](_0xd844('0x3d'))){_0x2ce79d[_0xd844('0x1f')]=qs[_0xd844('0x1f')](_0x430ea9[_0xd844('0x35')][_0xd844('0x1f')]);_0x2ce79d['offset']=qs[_0xd844('0x22')](_0x430ea9[_0xd844('0x35')][_0xd844('0x22')]);}_0x2ce79d[_0xd844('0x3e')]=qs[_0xd844('0x3f')](_0x430ea9[_0xd844('0x35')][_0xd844('0x3f')]);_0x2ce79d['where']=qs[_0xd844('0x37')](_[_0xd844('0x40')](_0x430ea9[_0xd844('0x35')],_0x1cd166[_0xd844('0x37')]),_0x5db4a3);if(_0x430ea9[_0xd844('0x35')][_0xd844('0x41')]){_0x2ce79d[_0xd844('0x42')]=_[_0xd844('0x43')](_0x2ce79d[_0xd844('0x42')],{'$or':_[_0xd844('0x2e')](_0x5db4a3,function(_0x4f0483){if(_0x4f0483['type']!==_0xd844('0x44')){var _0x1cdd34={};_0x1cdd34[_0x4f0483['name']]={'$like':'%'+_0x430ea9[_0xd844('0x35')][_0xd844('0x41')]+'%'};return _0x1cdd34;}})});}_0x2ce79d=_[_0xd844('0x43')]({},_0x2ce79d,_0x430ea9[_0xd844('0x45')]);var _0x4e8a39={'where':_0x2ce79d['where']};return db[_0xd844('0x2f')][_0xd844('0x21')](_0x4e8a39)['then'](function(_0x2c14ef){_0x6d5ab5[_0xd844('0x21')]=_0x2c14ef;if(_0x430ea9['query'][_0xd844('0x46')]){_0x2ce79d['include']=[{'all':!![]}];}return db[_0xd844('0x2f')][_0xd844('0x47')](_0x2ce79d);})[_0xd844('0x28')](function(_0x54bf8d){_0x6d5ab5[_0xd844('0x48')]=_0x54bf8d;return _0x6d5ab5;})[_0xd844('0x28')](respondWithFilteredResult(_0x3c30ee,_0x2ce79d))[_0xd844('0x49')](handleError(_0x3c30ee,null));};exports[_0xd844('0x4a')]=function(_0x373b84,_0x65d4c9){var _0x17b093={'raw':!![],'where':{'id':_0x373b84[_0xd844('0x4b')]['id']}},_0xb4005d={};_0xb4005d['model']=_['keys'](db[_0xd844('0x2f')][_0xd844('0x30')]);_0xb4005d[_0xd844('0x35')]=_[_0xd844('0x36')](_0x373b84[_0xd844('0x35')]);_0xb4005d[_0xd844('0x37')]=_[_0xd844('0x38')](_0xb4005d[_0xd844('0x34')],_0xb4005d[_0xd844('0x35')]);_0x17b093[_0xd844('0x39')]=_[_0xd844('0x38')](_0xb4005d['model'],qs[_0xd844('0x3a')](_0x373b84['query'][_0xd844('0x3a')]));_0x17b093[_0xd844('0x39')]=_0x17b093['attributes'][_0xd844('0x3b')]?_0x17b093[_0xd844('0x39')]:_0xb4005d[_0xd844('0x34')];if(_0x373b84[_0xd844('0x35')][_0xd844('0x46')]){_0x17b093[_0xd844('0x4c')]=[{'all':!![]}];}_0x17b093=_['merge']({},_0x17b093,_0x373b84[_0xd844('0x45')]);return db[_0xd844('0x2f')][_0xd844('0x4d')](_0x17b093)[_0xd844('0x28')](handleEntityNotFound(_0x65d4c9,null))[_0xd844('0x28')](respondWithResult(_0x65d4c9,null))[_0xd844('0x49')](handleError(_0x65d4c9,null));};exports[_0xd844('0x4e')]=function(_0x1ac7a5,_0x56321a){return db[_0xd844('0x2f')][_0xd844('0x4e')](_0x1ac7a5['body'],{})['then'](respondWithResult(_0x56321a,0xc9))[_0xd844('0x49')](handleError(_0x56321a,null));};exports[_0xd844('0x27')]=function(_0x3a7aa2,_0x321461){if(_0x3a7aa2[_0xd844('0x4f')]['id']){delete _0x3a7aa2['body']['id'];}return db[_0xd844('0x2f')][_0xd844('0x4d')]({'where':{'id':_0x3a7aa2['params']['id']}})[_0xd844('0x28')](handleEntityNotFound(_0x321461,null))[_0xd844('0x28')](saveUpdates(_0x3a7aa2[_0xd844('0x4f')],null))[_0xd844('0x28')](respondWithResult(_0x321461,null))[_0xd844('0x49')](handleError(_0x321461,null));};exports[_0xd844('0x29')]=function(_0x3ba517,_0x1119f8){return db[_0xd844('0x2f')][_0xd844('0x4d')]({'where':{'id':_0x3ba517['params']['id']}})[_0xd844('0x28')](handleEntityNotFound(_0x1119f8,null))[_0xd844('0x28')](removeEntity(_0x1119f8,null))[_0xd844('0x49')](handleError(_0x1119f8,null));};exports[_0xd844('0x50')]=function(_0x1a587e,_0x1cb101){return db[_0xd844('0x2f')][_0xd844('0x50')]()[_0xd844('0x28')](respondWithResult(_0x1cb101,null))[_0xd844('0x49')](handleError(_0x1cb101,null));}; \ No newline at end of file +var _0x4e63=['create','body','find','rimraf','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','order','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','WhatsappTransferReport','findAll','catch','params','keys'];(function(_0x4a14f6,_0x14a0c9){var _0xa3e047=function(_0x104b9f){while(--_0x104b9f){_0x4a14f6['push'](_0x4a14f6['shift']());}};_0xa3e047(++_0x14a0c9);}(_0x4e63,0x1ad));var _0x34e6=function(_0x1414fb,_0xde9db9){_0x1414fb=_0x1414fb-0x0;var _0xa98ed=_0x4e63[_0x1414fb];return _0xa98ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x34e6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x34e6('0x2'));var util=require(_0x34e6('0x3'));var path=require('path');var sox=require(_0x34e6('0x4'));var csv=require(_0x34e6('0x5'));var ejs=require(_0x34e6('0x6'));var fs=require('fs');var fs_extra=require(_0x34e6('0x7'));var _=require(_0x34e6('0x8'));var squel=require('squel');var crypto=require(_0x34e6('0x9'));var jsforce=require(_0x34e6('0xa'));var deskjs=require(_0x34e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0x34e6('0xc'));var Papa=require(_0x34e6('0xd'));var Redis=require('ioredis');var authService=require(_0x34e6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x34e6('0xf'));var hardwareService=require(_0x34e6('0x10'));var logger=require(_0x34e6('0x11'))(_0x34e6('0x12'));var utils=require(_0x34e6('0x13'));var config=require(_0x34e6('0x14'));var licenseUtil=require(_0x34e6('0x15'));var db=require(_0x34e6('0x16'))['db'];function respondWithStatusCode(_0x1f862b,_0x24650b){_0x24650b=_0x24650b||0xcc;return function(_0x26a73e){if(_0x26a73e){return _0x1f862b['sendStatus'](_0x24650b);}return _0x1f862b[_0x34e6('0x17')](_0x24650b)[_0x34e6('0x18')]();};}function respondWithResult(_0x32212f,_0x390135){_0x390135=_0x390135||0xc8;return function(_0x262757){if(_0x262757){return _0x32212f[_0x34e6('0x17')](_0x390135)[_0x34e6('0x19')](_0x262757);}};}function respondWithFilteredResult(_0x23d99f,_0x4fe881){return function(_0x51413a){if(_0x51413a){var _0x1a5204=typeof _0x4fe881[_0x34e6('0x1a')]==='undefined'&&typeof _0x4fe881[_0x34e6('0x1b')]===_0x34e6('0x1c');var _0xf8528e=_0x51413a['count'];var _0x19e888=_0x1a5204?0x0:_0x4fe881[_0x34e6('0x1a')];var _0x1f2dfe=_0x1a5204?_0x51413a['count']:_0x4fe881['offset']+_0x4fe881['limit'];var _0x17a136;if(_0x1f2dfe>=_0xf8528e){_0x1f2dfe=_0xf8528e;_0x17a136=0xc8;}else{_0x17a136=0xce;}_0x23d99f['status'](_0x17a136);return _0x23d99f[_0x34e6('0x1d')]('Content-Range',_0x19e888+'-'+_0x1f2dfe+'/'+_0xf8528e)[_0x34e6('0x19')](_0x51413a);}return null;};}function patchUpdates(_0x451468){return function(_0xc5734a){try{jsonpatch[_0x34e6('0x1e')](_0xc5734a,_0x451468,!![]);}catch(_0x209b0e){return BPromise[_0x34e6('0x1f')](_0x209b0e);}return _0xc5734a[_0x34e6('0x20')]();};}function saveUpdates(_0x397a3c,_0x3131b7){return function(_0x6d82ed){if(_0x6d82ed){return _0x6d82ed[_0x34e6('0x21')](_0x397a3c)[_0x34e6('0x22')](function(_0x1738dc){return _0x1738dc;});}return null;};}function removeEntity(_0x433e9d,_0x353e15){return function(_0x2bbd27){if(_0x2bbd27){return _0x2bbd27[_0x34e6('0x23')]()['then'](function(){_0x433e9d[_0x34e6('0x17')](0xcc)[_0x34e6('0x18')]();});}};}function handleEntityNotFound(_0xf992b5,_0x58c836){return function(_0x1ff986){if(!_0x1ff986){_0xf992b5[_0x34e6('0x24')](0x194);}return _0x1ff986;};}function handleError(_0x391fee,_0x45691a){_0x45691a=_0x45691a||0x1f4;return function(_0x4b5b21){logger[_0x34e6('0x25')](_0x4b5b21[_0x34e6('0x26')]);if(_0x4b5b21['name']){delete _0x4b5b21[_0x34e6('0x27')];}_0x391fee[_0x34e6('0x17')](_0x45691a)[_0x34e6('0x28')](_0x4b5b21);};}exports[_0x34e6('0x29')]=function(_0x465814,_0x2c5642){var _0x3bfe18={},_0x2e071f={},_0x468327={'count':0x0,'rows':[]};var _0x1f0e9e=_[_0x34e6('0x2a')](db['WhatsappTransferReport'][_0x34e6('0x2b')],function(_0x38da71){return{'name':_0x38da71[_0x34e6('0x2c')],'type':_0x38da71[_0x34e6('0x2d')]['key']};});_0x2e071f[_0x34e6('0x2e')]=_[_0x34e6('0x2a')](_0x1f0e9e,_0x34e6('0x27'));_0x2e071f['query']=_['keys'](_0x465814[_0x34e6('0x2f')]);_0x2e071f[_0x34e6('0x30')]=_[_0x34e6('0x31')](_0x2e071f[_0x34e6('0x2e')],_0x2e071f[_0x34e6('0x2f')]);_0x3bfe18['attributes']=_[_0x34e6('0x31')](_0x2e071f[_0x34e6('0x2e')],qs['fields'](_0x465814['query'][_0x34e6('0x32')]));_0x3bfe18['attributes']=_0x3bfe18[_0x34e6('0x33')][_0x34e6('0x34')]?_0x3bfe18[_0x34e6('0x33')]:_0x2e071f[_0x34e6('0x2e')];if(!_0x465814[_0x34e6('0x2f')]['hasOwnProperty']('nolimit')){_0x3bfe18[_0x34e6('0x1b')]=qs['limit'](_0x465814['query'][_0x34e6('0x1b')]);_0x3bfe18[_0x34e6('0x1a')]=qs[_0x34e6('0x1a')](_0x465814[_0x34e6('0x2f')][_0x34e6('0x1a')]);}_0x3bfe18[_0x34e6('0x35')]=qs['sort'](_0x465814[_0x34e6('0x2f')]['sort']);_0x3bfe18['where']=qs[_0x34e6('0x30')](_[_0x34e6('0x36')](_0x465814[_0x34e6('0x2f')],_0x2e071f[_0x34e6('0x30')]),_0x1f0e9e);if(_0x465814[_0x34e6('0x2f')][_0x34e6('0x37')]){_0x3bfe18[_0x34e6('0x38')]=_[_0x34e6('0x39')](_0x3bfe18['where'],{'$or':_[_0x34e6('0x2a')](_0x1f0e9e,function(_0x1c5a6f){if(_0x1c5a6f['type']!==_0x34e6('0x3a')){var _0x304adb={};_0x304adb[_0x1c5a6f[_0x34e6('0x27')]]={'$like':'%'+_0x465814[_0x34e6('0x2f')][_0x34e6('0x37')]+'%'};return _0x304adb;}})});}_0x3bfe18=_[_0x34e6('0x39')]({},_0x3bfe18,_0x465814[_0x34e6('0x3b')]);var _0x1dae90={'where':_0x3bfe18['where']};return db['WhatsappTransferReport'][_0x34e6('0x3c')](_0x1dae90)[_0x34e6('0x22')](function(_0x58e455){_0x468327[_0x34e6('0x3c')]=_0x58e455;if(_0x465814[_0x34e6('0x2f')][_0x34e6('0x3d')]){_0x3bfe18[_0x34e6('0x3e')]=[{'all':!![]}];}return db[_0x34e6('0x3f')][_0x34e6('0x40')](_0x3bfe18);})[_0x34e6('0x22')](function(_0xbe096d){_0x468327['rows']=_0xbe096d;return _0x468327;})[_0x34e6('0x22')](respondWithFilteredResult(_0x2c5642,_0x3bfe18))[_0x34e6('0x41')](handleError(_0x2c5642,null));};exports['show']=function(_0xa9cd66,_0x37d070){var _0x9c23e5={'raw':!![],'where':{'id':_0xa9cd66[_0x34e6('0x42')]['id']}},_0x12359e={};_0x12359e[_0x34e6('0x2e')]=_[_0x34e6('0x43')](db['WhatsappTransferReport'][_0x34e6('0x2b')]);_0x12359e[_0x34e6('0x2f')]=_['keys'](_0xa9cd66[_0x34e6('0x2f')]);_0x12359e[_0x34e6('0x30')]=_[_0x34e6('0x31')](_0x12359e['model'],_0x12359e[_0x34e6('0x2f')]);_0x9c23e5['attributes']=_[_0x34e6('0x31')](_0x12359e['model'],qs['fields'](_0xa9cd66[_0x34e6('0x2f')][_0x34e6('0x32')]));_0x9c23e5[_0x34e6('0x33')]=_0x9c23e5[_0x34e6('0x33')][_0x34e6('0x34')]?_0x9c23e5[_0x34e6('0x33')]:_0x12359e[_0x34e6('0x2e')];if(_0xa9cd66[_0x34e6('0x2f')]['includeAll']){_0x9c23e5['include']=[{'all':!![]}];}_0x9c23e5=_['merge']({},_0x9c23e5,_0xa9cd66[_0x34e6('0x3b')]);return db[_0x34e6('0x3f')]['find'](_0x9c23e5)[_0x34e6('0x22')](handleEntityNotFound(_0x37d070,null))[_0x34e6('0x22')](respondWithResult(_0x37d070,null))[_0x34e6('0x41')](handleError(_0x37d070,null));};exports[_0x34e6('0x44')]=function(_0x48be34,_0x1f2b4e){return db[_0x34e6('0x3f')][_0x34e6('0x44')](_0x48be34[_0x34e6('0x45')],{})[_0x34e6('0x22')](respondWithResult(_0x1f2b4e,0xc9))[_0x34e6('0x41')](handleError(_0x1f2b4e,null));};exports[_0x34e6('0x21')]=function(_0x2d212e,_0x4f9079){if(_0x2d212e[_0x34e6('0x45')]['id']){delete _0x2d212e[_0x34e6('0x45')]['id'];}return db[_0x34e6('0x3f')][_0x34e6('0x46')]({'where':{'id':_0x2d212e[_0x34e6('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f9079,null))['then'](saveUpdates(_0x2d212e['body'],null))[_0x34e6('0x22')](respondWithResult(_0x4f9079,null))[_0x34e6('0x41')](handleError(_0x4f9079,null));};exports[_0x34e6('0x23')]=function(_0x1443aa,_0x5e43cd){return db[_0x34e6('0x3f')][_0x34e6('0x46')]({'where':{'id':_0x1443aa[_0x34e6('0x42')]['id']}})[_0x34e6('0x22')](handleEntityNotFound(_0x5e43cd,null))[_0x34e6('0x22')](removeEntity(_0x5e43cd,null))[_0x34e6('0x41')](handleError(_0x5e43cd,null));};exports['describe']=function(_0xf17d3,_0x1068ab){return db['WhatsappTransferReport']['describe']()[_0x34e6('0x22')](respondWithResult(_0x1068ab,null))['catch'](handleError(_0x1068ab,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 7d9a2e8..40d58ab 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 _0x370d=['api','moment','bluebird','request-promise','path','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0x370d,0xfa));var _0xd370=function(_0x233203,_0x464887){_0x233203=_0x233203-0x0;var _0x307511=_0x370d[_0x233203];return _0x307511;};'use strict';var _=require('lodash');var util=require(_0xd370('0x0'));var logger=require(_0xd370('0x1'))(_0xd370('0x2'));var moment=require(_0xd370('0x3'));var BPromise=require(_0xd370('0x4'));var rp=require(_0xd370('0x5'));var fs=require('fs');var path=require(_0xd370('0x6'));var rimraf=require('rimraf');var config=require(_0xd370('0x7'));var attributes=require(_0xd370('0x8'));module[_0xd370('0x9')]=function(_0x127859,_0x1ebf51){return _0x127859[_0xd370('0xa')](_0xd370('0xb'),attributes,{'tableName':_0xd370('0xc'),'paranoid':![],'indexes':[{'name':_0xd370('0xd'),'fields':[_0xd370('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3660=['rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5db30e,_0x5ec82e){var _0x1e7d52=function(_0x442663){while(--_0x442663){_0x5db30e['push'](_0x5db30e['shift']());}};_0x1e7d52(++_0x5ec82e);}(_0x3660,0x151));var _0x0366=function(_0x30fee7,_0x57d732){_0x30fee7=_0x30fee7-0x0;var _0x628d03=_0x3660[_0x30fee7];return _0x628d03;};'use strict';var _=require(_0x0366('0x0'));var util=require(_0x0366('0x1'));var logger=require(_0x0366('0x2'))(_0x0366('0x3'));var moment=require(_0x0366('0x4'));var BPromise=require(_0x0366('0x5'));var rp=require(_0x0366('0x6'));var fs=require('fs');var path=require(_0x0366('0x7'));var rimraf=require(_0x0366('0x8'));var config=require(_0x0366('0x9'));var attributes=require('./whatsappTransferReport.attributes');module[_0x0366('0xa')]=function(_0x3eec32,_0xcb22f9){return _0x3eec32[_0x0366('0xb')](_0x0366('0xc'),attributes,{'tableName':_0x0366('0xd'),'paranoid':![],'indexes':[{'name':_0x0366('0xe'),'fields':[_0x0366('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 031506c..b994ab4 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 _0x15c5=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x9f855e,_0x8c843){var _0x22cfca=function(_0x41fbb2){while(--_0x41fbb2){_0x9f855e['push'](_0x9f855e['shift']());}};_0x22cfca(++_0x8c843);}(_0x15c5,0x69));var _0x515c=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0x15c5[_0x1c470d];return _0x12141b;};'use strict';var _=require(_0x515c('0x0'));var util=require(_0x515c('0x1'));var moment=require(_0x515c('0x2'));var BPromise=require(_0x515c('0x3'));var rs=require(_0x515c('0x4'));var fs=require('fs');var Redis=require(_0x515c('0x5'));var db=require(_0x515c('0x6'))['db'];var utils=require(_0x515c('0x7'));var logger=require(_0x515c('0x8'))('rpc');var config=require(_0x515c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x515c('0xa')][_0x515c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x442b9e,_0x3e5ec0,_0xdb31ac){return new BPromise(function(_0x17da68,_0x174d34){return client[_0x515c('0xc')](_0x442b9e,_0xdb31ac)[_0x515c('0xd')](function(_0x25fcc2){logger[_0x515c('0xe')](_0x515c('0xf'),_0x3e5ec0,'request\x20sent');logger['debug'](_0x515c('0x10'),_0x3e5ec0,_0x515c('0x11'),JSON[_0x515c('0x12')](_0x25fcc2));if(_0x25fcc2[_0x515c('0x13')]){if(_0x25fcc2[_0x515c('0x13')]['code']===0x1f4){logger[_0x515c('0x13')](_0x515c('0xf'),_0x3e5ec0,_0x25fcc2['error']['message']);return _0x174d34(_0x25fcc2[_0x515c('0x13')][_0x515c('0x14')]);}logger[_0x515c('0x13')](_0x515c('0xf'),_0x3e5ec0,_0x25fcc2[_0x515c('0x13')][_0x515c('0x14')]);return _0x17da68(_0x25fcc2[_0x515c('0x13')][_0x515c('0x14')]);}else{logger[_0x515c('0xe')](_0x515c('0xf'),_0x3e5ec0,_0x515c('0x11'));_0x17da68(_0x25fcc2['result'][_0x515c('0x14')]);}})['catch'](function(_0x92dfaf){logger[_0x515c('0x13')](_0x515c('0xf'),_0x3e5ec0,_0x92dfaf);_0x174d34(_0x92dfaf);});});} \ No newline at end of file +var _0xccd5=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x302793,_0x2f9ef4){var _0x55cad0=function(_0x492ff2){while(--_0x492ff2){_0x302793['push'](_0x302793['shift']());}};_0x55cad0(++_0x2f9ef4);}(_0xccd5,0xbe));var _0x5ccd=function(_0xea3649,_0x557e6a){_0xea3649=_0xea3649-0x0;var _0x5e7d67=_0xccd5[_0xea3649];return _0x5e7d67;};'use strict';var _=require(_0x5ccd('0x0'));var util=require('util');var moment=require(_0x5ccd('0x1'));var BPromise=require(_0x5ccd('0x2'));var rs=require(_0x5ccd('0x3'));var fs=require('fs');var Redis=require(_0x5ccd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ccd('0x5'));var logger=require(_0x5ccd('0x6'))('rpc');var config=require(_0x5ccd('0x7'));var jayson=require(_0x5ccd('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4431,_0x355ee0,_0x41e183){return new BPromise(function(_0x3b2c9a,_0x3f8a66){return client['request'](_0x3c4431,_0x41e183)['then'](function(_0x2325b1){logger[_0x5ccd('0x9')](_0x5ccd('0xa'),_0x355ee0,_0x5ccd('0xb'));logger[_0x5ccd('0xc')](_0x5ccd('0xd'),_0x355ee0,_0x5ccd('0xb'),JSON[_0x5ccd('0xe')](_0x2325b1));if(_0x2325b1[_0x5ccd('0xf')]){if(_0x2325b1['error'][_0x5ccd('0x10')]===0x1f4){logger[_0x5ccd('0xf')](_0x5ccd('0xa'),_0x355ee0,_0x2325b1[_0x5ccd('0xf')][_0x5ccd('0x11')]);return _0x3f8a66(_0x2325b1[_0x5ccd('0xf')][_0x5ccd('0x11')]);}logger[_0x5ccd('0xf')](_0x5ccd('0xa'),_0x355ee0,_0x2325b1[_0x5ccd('0xf')][_0x5ccd('0x11')]);return _0x3b2c9a(_0x2325b1['error'][_0x5ccd('0x11')]);}else{logger[_0x5ccd('0x9')](_0x5ccd('0xa'),_0x355ee0,'request\x20sent');_0x3b2c9a(_0x2325b1['result'][_0x5ccd('0x11')]);}})[_0x5ccd('0x12')](function(_0x261d60){logger[_0x5ccd('0xf')](_0x5ccd('0xa'),_0x355ee0,_0x261d60);_0x3f8a66(_0x261d60);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 88b1889..2859ef2 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x555d=['Online\x20apps:','map','filter','online','name','join','status','None','seedDB','./config/seedDB','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','listen','then','info','start'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x555d,0x75));var _0xd555=function(_0x1fac7f,_0x3e5a9a){_0x1fac7f=_0x1fac7f-0x0;var _0x1f48c5=_0x555d[_0x1fac7f];return _0x1f48c5;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0xd555('0x0'));var config=require(_0xd555('0x1'));var logger=require(_0xd555('0x2'))(_0xd555('0x3'));var pm2=require(_0xd555('0x4'));var pm2Config=require(_0xd555('0x5'));var schedule=require(_0xd555('0x6'));var chat=require(_0xd555('0x7'));var whatsapp=require(_0xd555('0x8'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db']['sequelize']['sync']()['then'](function(){return rpc[_0xd555('0x9')]();})[_0xd555('0xa')](function(_0x150f55){logger[_0xd555('0xb')](_0x150f55);return chat[_0xd555('0xc')]();})[_0xd555('0xa')](function(){return whatsapp[_0xd555('0xc')]();})[_0xd555('0xa')](function(){return schedule[_0xd555('0xc')]();})[_0xd555('0xa')](function(){return transcribe[_0xd555('0xc')]();})[_0xd555('0xa')](function(_0x222cec){logger[_0xd555('0xb')](_0x222cec);return pm2['start'](pm2Config);})[_0xd555('0xa')](function(_0x51bd58){logger[_0xd555('0xb')](_0xd555('0xd'),_[_0xd555('0xe')](_[_0xd555('0xf')](_0x51bd58,{'status':_0xd555('0x10')}),_0xd555('0x11'))[_0xd555('0x12')]());logger['info']('Offline\x20apps:',_[_0xd555('0xe')](_['filter'](_0x51bd58,function(_0x1e92be){return _0x1e92be[_0xd555('0x13')]!==_0xd555('0x10');}),_0xd555('0x11'))['join']()||_0xd555('0x14'));config[_0xd555('0x15')]&&require(_0xd555('0x16'))['default']();require('./config/license')['default']();})[_0xd555('0x17')](function(_0x2888fb){logger[_0xd555('0x18')](_0xd555('0x19'),_0x2888fb);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xff94=['Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','./config/license','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','then','listen','info','start'];(function(_0x137bb0,_0x28d3f2){var _0x19a27e=function(_0x337961){while(--_0x337961){_0x137bb0['push'](_0x137bb0['shift']());}};_0x19a27e(++_0x28d3f2);}(_0xff94,0x1ef));var _0x4ff9=function(_0x24d771,_0x4e07bf){_0x24d771=_0x24d771-0x0;var _0x4ed567=_0xff94[_0x24d771];return _0x4ed567;};'use strict';var _=require(_0x4ff9('0x0'));var mysqldb=require(_0x4ff9('0x1'));var rpc=require(_0x4ff9('0x2'));var config=require(_0x4ff9('0x3'));var logger=require(_0x4ff9('0x4'))(_0x4ff9('0x5'));var pm2=require(_0x4ff9('0x6'));var pm2Config=require(_0x4ff9('0x7'));var schedule=require(_0x4ff9('0x8'));var chat=require(_0x4ff9('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x4ff9('0xa'));function main(){return mysqldb['db']['sequelize']['sync']()[_0x4ff9('0xb')](function(){return rpc[_0x4ff9('0xc')]();})['then'](function(_0x302c73){logger[_0x4ff9('0xd')](_0x302c73);return chat['start']();})[_0x4ff9('0xb')](function(){return whatsapp[_0x4ff9('0xe')]();})[_0x4ff9('0xb')](function(){return schedule[_0x4ff9('0xe')]();})[_0x4ff9('0xb')](function(){return transcribe['start']();})['then'](function(_0x16c99d){logger[_0x4ff9('0xd')](_0x16c99d);return pm2['start'](pm2Config);})[_0x4ff9('0xb')](function(_0x42ac74){logger['info'](_0x4ff9('0xf'),_[_0x4ff9('0x10')](_[_0x4ff9('0x11')](_0x42ac74,{'status':_0x4ff9('0x12')}),'name')[_0x4ff9('0x13')]());logger[_0x4ff9('0xd')](_0x4ff9('0x14'),_['map'](_[_0x4ff9('0x11')](_0x42ac74,function(_0x45c6c9){return _0x45c6c9[_0x4ff9('0x15')]!==_0x4ff9('0x12');}),'name')[_0x4ff9('0x13')]()||_0x4ff9('0x16'));config[_0x4ff9('0x17')]&&require(_0x4ff9('0x18'))['default']();require(_0x4ff9('0x19'))[_0x4ff9('0x1a')]();})[_0x4ff9('0x1b')](function(_0x5a4efc){logger['error'](_0x4ff9('0x1c'),_0x5a4efc);process[_0x4ff9('0x1d')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index e08bc4d..6486bad 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 _0x461a=['add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','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.','updatePasswordsHistory','decryptString','length','splice','unshift','join','sign','secret','payload','options','promisify','verify','randomBytes','now','toString','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','util','moment','secrets','session','role','name','internal','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','hotdesk','interface','userProfileId','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','then','unmanaged','disposition','Unmanaged.','Forbidden.','authorization','startsWith','headers','Basic','find','authenticate','pass','status','json','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt'];(function(_0x2304ce,_0x5e2bb0){var _0x503964=function(_0x13e9f2){while(--_0x13e9f2){_0x2304ce['push'](_0x2304ce['shift']());}};_0x503964(++_0x5e2bb0);}(_0x461a,0x129));var _0xa461=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x461a[_0x3dd15e];return _0x231fd0;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xa461('0x0'));var hardwareConf=require(_0xa461('0x1'));var licenseUtil=require(_0xa461('0x2'));var encryptor=require(_0xa461('0x3'));var _=require(_0xa461('0x4'));var jwt=require(_0xa461('0x5'));var expressJwt=require(_0xa461('0x6'));var compose=require(_0xa461('0x7'));var basicAuth=require('basic-auth');var crypto=require(_0xa461('0x8'));var BPromise=require('bluebird');var util=require(_0xa461('0x9'));var moment=require(_0xa461('0xa'));var validateJwt=expressJwt({'secret':config[_0xa461('0xb')][_0xa461('0xc')]});var userAttributes=['id',_0xa461('0xd'),'fullname',_0xa461('0xe'),_0xa461('0xf'),'email',_0xa461('0x10'),_0xa461('0x11'),'md5secret',_0xa461('0x12'),_0xa461('0x13'),_0xa461('0x14'),_0xa461('0x15'),_0xa461('0x16'),_0xa461('0x17'),_0xa461('0x18'),_0xa461('0x19'),_0xa461('0x1a'),'lastPauseAt','crudPermissions',_0xa461('0x1b'),_0xa461('0x1c'),_0xa461('0x1d'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd',_0xa461('0x1e'),_0xa461('0x1f'),_0xa461('0x20'),_0xa461('0x21'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0xa461('0x22'),_0xa461('0x23'),_0xa461('0x24'),'privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings',_0xa461('0x25'),_0xa461('0x26')];exports[_0xa461('0x27')]=function(){return this[_0xa461('0x28')](!![])[_0xa461('0x29')](function(_0x12ffa0,_0x36d000,_0x30c256){if(_0x12ffa0[_0xa461('0x2a')]){_0x30c256();}else{return db['ChatInteraction'][_0xa461('0x2b')]({'where':{'id':_0x12ffa0[_0xa461('0x2c')]['id']},'attributes':['id',_0xa461('0x2d'),'disposition'],'raw':!![]})[_0xa461('0x2e')](function(_0xa35ce9){if(_0xa35ce9&&_0xa35ce9[_0xa461('0x2d')]){return _0x36d000['status'](_0xa35ce9['disposition']===_0xa461('0x2f')?0x195:0x193)['json']({'message':_0xa35ce9[_0xa461('0x30')]==='unmanaged'?_0xa461('0x31'):_0xa461('0x32')});}else{_0x30c256();}})['catch'](function(_0xc5d055){_0x30c256(_0xc5d055);});}});};exports[_0xa461('0x28')]=function isAuthenticated(_0x16caa4){return compose()[_0xa461('0x29')](function(_0x573186,_0x394a11,_0x2436a4){var _0x3357ab;if(_0x573186['headers'][_0xa461('0x33')]){if(_[_0xa461('0x34')](_0x573186[_0xa461('0x35')][_0xa461('0x33')],_0xa461('0x36'))){var _0x481f83=basicAuth(_0x573186);db['User'][_0xa461('0x37')]({'where':{'name':_0x481f83[_0xa461('0xe')]}})[_0xa461('0x2e')](function(_0x3ca832){if(!_0x3ca832||!_0x3ca832[_0xa461('0x38')](_0x481f83[_0xa461('0x39')])){return _0x394a11[_0xa461('0x3a')](0x191)[_0xa461('0x3b')]({'message':_0xa461('0x3c')});}_0x573186[_0xa461('0x2a')]={'id':_0x3ca832['id']};_0x2436a4();})[_0xa461('0x3d')](function(_0x54df6f){_0x2436a4(_0x54df6f);});}else if(_[_0xa461('0x34')](_0x573186[_0xa461('0x35')][_0xa461('0x33')],_0xa461('0x3e'))){validateJwt(_0x573186,_0x394a11,_0x2436a4);}else{if(_0x16caa4){_0x2436a4();}else{return _0x394a11[_0xa461('0x3a')](0x193)[_0xa461('0x3b')]({'message':_0xa461('0x3f')});}}}else if(_0x573186[_0xa461('0x40')][_0xa461('0x41')]){try{var _0x3fad61={'audience':hardwareConf[_0xa461('0x42')](),'issuer':hardwareConf[_0xa461('0x42')]()};verifyJwt(_0x573186[_0xa461('0x40')][_0xa461('0x41')],_0x3fad61)[_0xa461('0x2e')](function(_0x3ba54f){return db[_0xa461('0x43')][_0xa461('0x37')]({'where':{'id':_0x3ba54f[_0xa461('0x44')]}})['then'](function(_0x31351c){_0x3357ab=_0x31351c;return db[_0xa461('0x45')]['findOne']({'where':{'id':0x1},'attributes':[_0xa461('0x46'),_0xa461('0x47')],'raw':!![]});})[_0xa461('0x2e')](function(_0x1f3143){if(!_0x3357ab||!_[_0xa461('0x48')](_0x3357ab[_0xa461('0x49')],_0x3ba54f['nonce'])){return _0x394a11[_0xa461('0x3a')](0x191)['json']({'message':_0xa461('0x4a')});}if(_0x3357ab[_0xa461('0x4b')]){return _0x394a11[_0xa461('0x3a')](0x191)[_0xa461('0x3b')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3357ab[_0xa461('0x4c')]){if(_0x1f3143[_0xa461('0x47')]>0x0){if(moment(_0x3357ab[_0xa461('0x4d')])[_0xa461('0x4e')](_0x1f3143[_0xa461('0x47')],_0xa461('0x4f'))>moment()){return _0x394a11['status'](0x191)[_0xa461('0x3b')]({'message':_0xa461('0x50')});}}else{return _0x394a11[_0xa461('0x3a')](0x191)['json']({'message':_0xa461('0x50')});}}_0x573186['user']={'id':_0x3357ab['id']};_0x2436a4();});})[_0xa461('0x3d')](function(){return _0x394a11[_0xa461('0x3a')](0x191)[_0xa461('0x3b')]({'message':_0xa461('0x50')});});}catch(_0x19aef7){_0x2436a4(_0x19aef7);}}else if(_0x16caa4){_0x2436a4();}else{return _0x394a11[_0xa461('0x3a')](0x193)['json']({'message':_0xa461('0x3f')});}})[_0xa461('0x29')](function(_0x56e41f,_0x56b6ec,_0x33816a){if(_0x56e41f[_0xa461('0x2a')]){db[_0xa461('0x43')][_0xa461('0x37')]({'where':{'id':_0x56e41f[_0xa461('0x2a')]['id']},'attributes':userAttributes})[_0xa461('0x2e')](function(_0x22fcf4){if(!_0x22fcf4){return _0x56b6ec[_0xa461('0x3a')](0x194)[_0xa461('0x3b')]({'message':_0xa461('0x51')});}_0x56e41f['user']=_0x22fcf4;_0x33816a();})[_0xa461('0x3d')](function(_0x269cbc){_0x33816a(_0x269cbc);});}else if(_0x16caa4){_0x33816a();}else{return _0x56b6ec[_0xa461('0x3a')](0x194)['json']({'message':_0xa461('0x52')});}});};exports[_0xa461('0x53')]=function canUpdate(){return compose()[_0xa461('0x29')](function(_0x31d3d9,_0x27ee8f,_0x4f8bec){return licenseUtil[_0xa461('0x54')]()[_0xa461('0x2e')](function(_0x4fa1eb){if(_0x4fa1eb[_0xa461('0x55')]){_0x4f8bec();}else{return _0x27ee8f[_0xa461('0x3a')](0x193)[_0xa461('0x3b')]({'message':_0xa461('0x56')});}})[_0xa461('0x3d')](function(_0x366744){_0x4f8bec(_0x366744);});});};exports[_0xa461('0x57')]=function(_0x431fba,_0x18f344,_0x2a49de){_0x431fba['isMiddleware']=!![];return _0x2a49de();};exports[_0xa461('0x58')]=function signToken(_0x32cae2){return signJwt(_0x32cae2);};exports[_0xa461('0x59')]=function(_0x4b2208,_0x2acc3c){if(!_0x4b2208['user']){return _0x2acc3c['status'](0x194)[_0xa461('0x3b')]({'message':_0xa461('0x5a')});}var _0x4cab9={'payload':{'id':_0x4b2208[_0xa461('0x2a')]['id'],'role':_0x4b2208[_0xa461('0x2a')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4cab9)['then'](function(_0xff0294){_0x2acc3c[_0xa461('0x5b')](_0xa461('0x5c'),_0xff0294);_0x2acc3c[_0xa461('0x5d')]('/dashboards/general');})[_0xa461('0x3d')](function(_0x4e63cc){return _0x2acc3c[_0xa461('0x3a')](0x1f4)['send'](_0x4e63cc);});};exports[_0xa461('0x5e')]=function(_0x38c149){if(_[_0xa461('0x5f')](_0x38c149[_0xa461('0x49')])||_['isNil'](_0x38c149['apiKeyIat'])){return null;}else{return createJwt(_0x38c149);}};exports[_0xa461('0x60')]=function(_0x50e15e){_0x50e15e[_0xa461('0x49')]=generateNonce();_0x50e15e[_0xa461('0x61')]=generateIssuedAt();return createJwt(_0x50e15e);};exports[_0xa461('0x62')]=function(_0x1363bc,_0x352763){var _0x8a5cb5=_0x1363bc[_0xa461('0x40')][_0xa461('0x41')];if(_0x8a5cb5){var _0x10a9e8={'nonce':_0x352763[_0xa461('0x49')],'iat':_0x352763['apiKeyIat'],'audience':hardwareConf[_0xa461('0x42')](),'issuer':hardwareConf[_0xa461('0x42')]()};return verifyJwt(_0x8a5cb5,_0x10a9e8)['then'](function(){return generateApiKey(_0x352763);});}else{throw{'message':_0xa461('0x63')};}};exports[_0xa461('0x64')]=function(_0x51a025){var _0x1949f5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1949f5['test'](_0x51a025))throw new db[(_0xa461('0x65'))][(_0xa461('0x66'))](_0xa461('0x67'));return;};exports[_0xa461('0x68')]=function(_0x5e6588,_0x374c7f,_0x2a72b6){var _0x6a8577=encryptor['decryptString'](_0x374c7f)[_0xa461('0x69')](',');for(var _0xeebb07=0x0;_0xeebb07<_0x2a72b6;_0xeebb07++){if(!_0x6a8577[_0xeebb07])break;if(_0x5e6588[_0xa461('0x6a')]()===_0x6a8577[_0xeebb07][_0xa461('0x6a')]()){var _0x369fd8=util['format'](_0xa461('0x6b'),_0x2a72b6);if(_0x2a72b6===0x1){_0x369fd8=_0xa461('0x6c');}throw new db[(_0xa461('0x65'))]['ValidationError'](_0x369fd8);}}return;};exports[_0xa461('0x6d')]=function(_0xcd27e9,_0x361114){var _0x4e9767=_0x361114?encryptor[_0xa461('0x6e')](_0x361114)['split'](','):[];if(_0x4e9767[_0xa461('0x6f')]===0x5){_0x4e9767[_0xa461('0x70')](-0x1,0x1);}_0x4e9767[_0xa461('0x71')](_0xcd27e9);return encryptor['encryptString'](_0x4e9767[_0xa461('0x72')](','));};function signJwt(_0x4fdb7d){var _0x50b64b=BPromise['promisify'](jwt[_0xa461('0x73')],{'context':jwt});var _0x383c0d=_0x4fdb7d[_0xa461('0x74')]||config[_0xa461('0xb')]['session'];return new BPromise(function(_0x53fb1b,_0x5f21b4){_0x50b64b(_0x4fdb7d[_0xa461('0x75')],_0x383c0d,_0x4fdb7d[_0xa461('0x76')])[_0xa461('0x2e')](function(_0x55a854){_0x53fb1b(_0x55a854);})[_0xa461('0x3d')](function(_0x168d53){_0x5f21b4(_0x168d53);});});}function verifyJwt(_0x57c87b,_0x370d11,_0x4c7e6d){var _0x5b3d46=BPromise[_0xa461('0x77')](jwt[_0xa461('0x78')],{'context':jwt});var _0xf6aab0=_0x4c7e6d||config[_0xa461('0xb')]['session'];return new BPromise(function(_0x57a58c,_0x51b8ac){_0x5b3d46(_0x57c87b,_0xf6aab0,_0x370d11)[_0xa461('0x2e')](function(_0x2d60ae){_0x57a58c(_0x2d60ae);})['catch'](function(_0x3ab89f){_0x51b8ac(_0x3ab89f);});});}function generateNonce(){return crypto[_0xa461('0x79')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xa461('0x7a')]()/0x3e8)[_0xa461('0x7b')]();}function createJwt(_0x3a0d2b){var _0x55298f={'payload':{'iat':_0x3a0d2b[_0xa461('0x61')],'nonce':_0x3a0d2b[_0xa461('0x49')]},'options':{'algorithm':_0xa461('0x7c'),'subject':_0x3a0d2b['id'][_0xa461('0x7b')](),'issuer':hardwareConf[_0xa461('0x42')](),'audience':hardwareConf[_0xa461('0x42')]()}};return signJwt(_0x55298f)[_0xa461('0x2e')](function(_0x2cad9f){return{'iat':_0x3a0d2b[_0xa461('0x61')],'nonce':_0x3a0d2b['apiKeyNonce'],'token':_0x2cad9f};});} \ No newline at end of file +var _0x6cdb=['User\x20not\x20found.','canUpdate','getLicense','Forbidden','signToken','setTokenCookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','util','secrets','session','role','internal','email','permissions','voicePause','mailPause','faxPause','smsPause','openchannelPause','lastPauseAt','crudPermissions','alias','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','closed','then','disposition','unmanaged','Forbidden.','catch','headers','authorization','Basic','User','find','name','authenticate','pass','status','json','user','startsWith','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','Setting','findOne','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes'];(function(_0x57a6d4,_0x9f970){var _0x3a1373=function(_0x757a4f){while(--_0x757a4f){_0x57a6d4['push'](_0x57a6d4['shift']());}};_0x3a1373(++_0x9f970);}(_0x6cdb,0x176));var _0xb6cd=function(_0x3f9bc8,_0x2a8872){_0x3f9bc8=_0x3f9bc8-0x0;var _0x2e843b=_0x6cdb[_0x3f9bc8];return _0x2e843b;};'use strict';var db=require(_0xb6cd('0x0'))['db'];var config=require(_0xb6cd('0x1'));var hardwareConf=require(_0xb6cd('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xb6cd('0x3'));var jwt=require(_0xb6cd('0x4'));var expressJwt=require('express-jwt');var compose=require(_0xb6cd('0x5'));var basicAuth=require(_0xb6cd('0x6'));var crypto=require(_0xb6cd('0x7'));var BPromise=require('bluebird');var util=require(_0xb6cd('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb6cd('0x9')][_0xb6cd('0xa')]});var userAttributes=['id',_0xb6cd('0xb'),'fullname','name',_0xb6cd('0xc'),_0xb6cd('0xd'),'userpic',_0xb6cd('0xe'),'md5secret',_0xb6cd('0xf'),'chatPause',_0xb6cd('0x10'),_0xb6cd('0x11'),_0xb6cd('0x12'),_0xb6cd('0x13'),'pauseType','showWebBar','lastLoginAt',_0xb6cd('0x14'),_0xb6cd('0x15'),'allowmessenger','passwordResetAt',_0xb6cd('0x16'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0xb6cd('0x17'),'phoneBarEnableRecording',_0xb6cd('0x18'),'phoneBarEnableSettings',_0xb6cd('0x19'),_0xb6cd('0x1a'),_0xb6cd('0x1b'),_0xb6cd('0x1c'),_0xb6cd('0x1d'),_0xb6cd('0x1e'),_0xb6cd('0x1f'),_0xb6cd('0x20'),'settingsEnabled',_0xb6cd('0x21'),_0xb6cd('0x22'),_0xb6cd('0x23'),'downloadAttachments'];exports[_0xb6cd('0x24')]=function(){return this[_0xb6cd('0x25')](!![])[_0xb6cd('0x26')](function(_0x4b9ed3,_0x19c278,_0x188952){if(_0x4b9ed3['user']){_0x188952();}else{return db[_0xb6cd('0x27')]['findOne']({'where':{'id':_0x4b9ed3['params']['id']},'attributes':['id',_0xb6cd('0x28'),'disposition'],'raw':!![]})[_0xb6cd('0x29')](function(_0x4e212b){if(_0x4e212b&&_0x4e212b['closed']){return _0x19c278['status'](_0x4e212b[_0xb6cd('0x2a')]==='unmanaged'?0x195:0x193)['json']({'message':_0x4e212b[_0xb6cd('0x2a')]===_0xb6cd('0x2b')?'Unmanaged.':_0xb6cd('0x2c')});}else{_0x188952();}})[_0xb6cd('0x2d')](function(_0x1ae609){_0x188952(_0x1ae609);});}});};exports['isAuthenticated']=function isAuthenticated(_0x3bdb32){return compose()[_0xb6cd('0x26')](function(_0xa959bf,_0x41e7b3,_0x53a501){var _0xf984bb;if(_0xa959bf[_0xb6cd('0x2e')][_0xb6cd('0x2f')]){if(_['startsWith'](_0xa959bf['headers'][_0xb6cd('0x2f')],_0xb6cd('0x30'))){var _0x97b8df=basicAuth(_0xa959bf);db[_0xb6cd('0x31')][_0xb6cd('0x32')]({'where':{'name':_0x97b8df[_0xb6cd('0x33')]}})['then'](function(_0x61b525){if(!_0x61b525||!_0x61b525[_0xb6cd('0x34')](_0x97b8df[_0xb6cd('0x35')])){return _0x41e7b3[_0xb6cd('0x36')](0x191)[_0xb6cd('0x37')]({'message':'Wrong\x20credentials.'});}_0xa959bf[_0xb6cd('0x38')]={'id':_0x61b525['id']};_0x53a501();})[_0xb6cd('0x2d')](function(_0x17d4c5){_0x53a501(_0x17d4c5);});}else if(_[_0xb6cd('0x39')](_0xa959bf[_0xb6cd('0x2e')][_0xb6cd('0x2f')],_0xb6cd('0x3a'))){validateJwt(_0xa959bf,_0x41e7b3,_0x53a501);}else{if(_0x3bdb32){_0x53a501();}else{return _0x41e7b3[_0xb6cd('0x36')](0x193)[_0xb6cd('0x37')]({'message':_0xb6cd('0x3b')});}}}else if(_0xa959bf['query'][_0xb6cd('0x3c')]){try{var _0x4bc15b={'audience':hardwareConf[_0xb6cd('0x3d')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0xa959bf[_0xb6cd('0x3e')][_0xb6cd('0x3c')],_0x4bc15b)[_0xb6cd('0x29')](function(_0x4da2fd){return db[_0xb6cd('0x31')][_0xb6cd('0x32')]({'where':{'id':_0x4da2fd['sub']}})[_0xb6cd('0x29')](function(_0x501f74){_0xf984bb=_0x501f74;return db[_0xb6cd('0x3f')][_0xb6cd('0x40')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb6cd('0x41')],'raw':!![]});})[_0xb6cd('0x29')](function(_0x2a8110){if(!_0xf984bb||!_[_0xb6cd('0x42')](_0xf984bb['apiKeyNonce'],_0x4da2fd['nonce'])){return _0x41e7b3[_0xb6cd('0x36')](0x191)[_0xb6cd('0x37')]({'message':_0xb6cd('0x43')});}if(_0xf984bb[_0xb6cd('0x44')]){return _0x41e7b3['status'](0x191)[_0xb6cd('0x37')]({'message':_0xb6cd('0x45')});}if(_0xf984bb[_0xb6cd('0x46')]){if(_0x2a8110[_0xb6cd('0x41')]>0x0){if(moment(_0xf984bb[_0xb6cd('0x47')])[_0xb6cd('0x48')](_0x2a8110[_0xb6cd('0x41')],_0xb6cd('0x49'))>moment()){return _0x41e7b3[_0xb6cd('0x36')](0x191)['json']({'message':_0xb6cd('0x45')});}}else{return _0x41e7b3['status'](0x191)[_0xb6cd('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}}_0xa959bf[_0xb6cd('0x38')]={'id':_0xf984bb['id']};_0x53a501();});})[_0xb6cd('0x2d')](function(){return _0x41e7b3[_0xb6cd('0x36')](0x191)[_0xb6cd('0x37')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x29a19a){_0x53a501(_0x29a19a);}}else if(_0x3bdb32){_0x53a501();}else{return _0x41e7b3[_0xb6cd('0x36')](0x193)[_0xb6cd('0x37')]({'message':'Unknown\x20authorization\x20format'});}})[_0xb6cd('0x26')](function(_0x446411,_0x5b968d,_0x166776){if(_0x446411[_0xb6cd('0x38')]){db['User'][_0xb6cd('0x32')]({'where':{'id':_0x446411['user']['id']},'attributes':userAttributes})['then'](function(_0x4c846a){if(!_0x4c846a){return _0x5b968d[_0xb6cd('0x36')](0x194)[_0xb6cd('0x37')]({'message':_0xb6cd('0x4a')});}_0x446411[_0xb6cd('0x38')]=_0x4c846a;_0x166776();})[_0xb6cd('0x2d')](function(_0x1ea1df){_0x166776(_0x1ea1df);});}else if(_0x3bdb32){_0x166776();}else{return _0x5b968d[_0xb6cd('0x36')](0x194)[_0xb6cd('0x37')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xb6cd('0x4b')]=function canUpdate(){return compose()[_0xb6cd('0x26')](function(_0xd6c59d,_0x267060,_0x1166a1){return licenseUtil[_0xb6cd('0x4c')]()[_0xb6cd('0x29')](function(_0x9aa015){if(_0x9aa015['update']){_0x1166a1();}else{return _0x267060[_0xb6cd('0x36')](0x193)[_0xb6cd('0x37')]({'message':_0xb6cd('0x4d')});}})['catch'](function(_0x1cd6e3){_0x1166a1(_0x1cd6e3);});});};exports['isMiddleware']=function(_0x3c7da4,_0x48e61a,_0x4c9e15){_0x3c7da4['isMiddleware']=!![];return _0x4c9e15();};exports[_0xb6cd('0x4e')]=function signToken(_0x4e5489){return signJwt(_0x4e5489);};exports[_0xb6cd('0x4f')]=function(_0x447830,_0x3225f8){if(!_0x447830[_0xb6cd('0x38')]){return _0x3225f8[_0xb6cd('0x36')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4f6031={'payload':{'id':_0x447830[_0xb6cd('0x38')]['id'],'role':_0x447830[_0xb6cd('0x38')][_0xb6cd('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4f6031)[_0xb6cd('0x29')](function(_0x29a751){_0x3225f8['cookie']('motion.token',_0x29a751);_0x3225f8['redirect'](_0xb6cd('0x50'));})['catch'](function(_0x5cdc97){return _0x3225f8[_0xb6cd('0x36')](0x1f4)[_0xb6cd('0x51')](_0x5cdc97);});};exports[_0xb6cd('0x52')]=function(_0x102a22){if(_[_0xb6cd('0x53')](_0x102a22[_0xb6cd('0x54')])||_['isNil'](_0x102a22[_0xb6cd('0x55')])){return null;}else{return createJwt(_0x102a22);}};exports[_0xb6cd('0x56')]=function(_0x32da4c){_0x32da4c[_0xb6cd('0x54')]=generateNonce();_0x32da4c['apiKeyIat']=generateIssuedAt();return createJwt(_0x32da4c);};exports[_0xb6cd('0x57')]=function(_0x132982,_0x1e3e57){var _0x3bae86=_0x132982[_0xb6cd('0x3e')]['apikey'];if(_0x3bae86){var _0x5a4765={'nonce':_0x1e3e57[_0xb6cd('0x54')],'iat':_0x1e3e57[_0xb6cd('0x55')],'audience':hardwareConf[_0xb6cd('0x3d')](),'issuer':hardwareConf[_0xb6cd('0x3d')]()};return verifyJwt(_0x3bae86,_0x5a4765)[_0xb6cd('0x29')](function(){return generateApiKey(_0x1e3e57);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x3adad8){var _0x2b1bb6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2b1bb6[_0xb6cd('0x58')](_0x3adad8))throw new db[(_0xb6cd('0x59'))][(_0xb6cd('0x5a'))](_0xb6cd('0x5b'));return;};exports['validatePasswordHistory']=function(_0x19a1ee,_0x2ebab9,_0x1ddb86){var _0x3676da=encryptor[_0xb6cd('0x5c')](_0x2ebab9)[_0xb6cd('0x5d')](',');for(var _0x50aa71=0x0;_0x50aa71<_0x1ddb86;_0x50aa71++){if(!_0x3676da[_0x50aa71])break;if(_0x19a1ee['toLowerCase']()===_0x3676da[_0x50aa71][_0xb6cd('0x5e')]()){var _0x5f2b50=util[_0xb6cd('0x5f')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x1ddb86);if(_0x1ddb86===0x1){_0x5f2b50=_0xb6cd('0x60');}throw new db[(_0xb6cd('0x59'))][(_0xb6cd('0x5a'))](_0x5f2b50);}}return;};exports[_0xb6cd('0x61')]=function(_0x44ed4a,_0x30c8d2){var _0x46de0a=_0x30c8d2?encryptor[_0xb6cd('0x5c')](_0x30c8d2)[_0xb6cd('0x5d')](','):[];if(_0x46de0a[_0xb6cd('0x62')]===0x5){_0x46de0a['splice'](-0x1,0x1);}_0x46de0a['unshift'](_0x44ed4a);return encryptor[_0xb6cd('0x63')](_0x46de0a[_0xb6cd('0x64')](','));};function signJwt(_0x31023a){var _0x43cf4b=BPromise[_0xb6cd('0x65')](jwt[_0xb6cd('0x66')],{'context':jwt});var _0x1a970c=_0x31023a[_0xb6cd('0x67')]||config[_0xb6cd('0x9')][_0xb6cd('0xa')];return new BPromise(function(_0x1e6f6a,_0x1e747d){_0x43cf4b(_0x31023a[_0xb6cd('0x68')],_0x1a970c,_0x31023a[_0xb6cd('0x69')])[_0xb6cd('0x29')](function(_0x3b7b86){_0x1e6f6a(_0x3b7b86);})['catch'](function(_0x1e093e){_0x1e747d(_0x1e093e);});});}function verifyJwt(_0x176dc4,_0x1d8e21,_0x357290){var _0x522b16=BPromise['promisify'](jwt[_0xb6cd('0x6a')],{'context':jwt});var _0x8a37e7=_0x357290||config[_0xb6cd('0x9')][_0xb6cd('0xa')];return new BPromise(function(_0x273b69,_0x1b49b1){_0x522b16(_0x176dc4,_0x8a37e7,_0x1d8e21)[_0xb6cd('0x29')](function(_0x10d266){_0x273b69(_0x10d266);})['catch'](function(_0x23681a){_0x1b49b1(_0x23681a);});});}function generateNonce(){return crypto[_0xb6cd('0x6b')](0x10)[_0xb6cd('0x6c')](_0xb6cd('0x6d'));}function generateIssuedAt(){return Math[_0xb6cd('0x6e')](Date[_0xb6cd('0x6f')]()/0x3e8)['toString']();}function createJwt(_0x3db74b){var _0x218738={'payload':{'iat':_0x3db74b['apiKeyIat'],'nonce':_0x3db74b[_0xb6cd('0x54')]},'options':{'algorithm':'HS512','subject':_0x3db74b['id'][_0xb6cd('0x6c')](),'issuer':hardwareConf[_0xb6cd('0x3d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x218738)[_0xb6cd('0x29')](function(_0x43a434){return{'iat':_0x3db74b[_0xb6cd('0x55')],'nonce':_0x3db74b[_0xb6cd('0x54')],'token':_0x43a434};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index f190598..aac40b9 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 _0xa264=['createReadStream','data','update','binary','end','final','write','close','unlink','encryptString','secret','base64','decryptString','createDecipher','utf8','crypto','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile'];(function(_0x23af24,_0x165f47){var _0x406dc4=function(_0x57b205){while(--_0x57b205){_0x23af24['push'](_0x23af24['shift']());}};_0x406dc4(++_0x165f47);}(_0xa264,0x8b));var _0x4a26=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0xa264[_0x45d1fd];return _0xd0e542;};'use strict';var crypto=require(_0x4a26('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x4a26('0x1'));var logger=require(_0x4a26('0x2'))(_0x4a26('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x4a26('0x4')],'algorithm':_0x4a26('0x5')};const fileOptions={'algorithm':_0x4a26('0x6')};if(config[_0x4a26('0x7')]&&config[_0x4a26('0x7')][_0x4a26('0x8')]){var isSupported=isAlgorithmSupported(config[_0x4a26('0x7')][_0x4a26('0x8')]);if(isSupported){fileOptions[_0x4a26('0x8')]=config[_0x4a26('0x7')][_0x4a26('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x4a26('0x9')](config[_0x4a26('0x7')][_0x4a26('0x8')],_0x4a26('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x217f05){return AES_SUPPORTED_RX[_0x4a26('0xb')](_0x217f05);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x4a26('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x178629){return getSupportedCiphers()[_0x4a26('0xd')](_0x178629)>-0x1;}function combineOptions(_0x41e3eb){var _0x5cd086={};for(var _0x1afdd6 in fileOptions){if(fileOptions[_0x4a26('0xe')](_0x1afdd6)){_0x5cd086[_0x1afdd6]=fileOptions[_0x1afdd6];}}if(_0x41e3eb){for(var _0x5552d2 in _0x41e3eb){if(_0x41e3eb['hasOwnProperty'](_0x5552d2)){_0x5cd086[_0x5552d2]=_0x41e3eb[_0x5552d2];}}}return _0x5cd086;}exports[_0x4a26('0xf')]=function(_0x4e01c4,_0x4a7290,_0x4bdeaf,_0x46e9fe){return new BPromise(function(_0x4af9aa,_0x575f64){_0x46e9fe=combineOptions(_0x46e9fe);var _0x4858cb=new Buffer(_0x4bdeaf);var _0x183c3c=fs[_0x4a26('0x10')](_0x4e01c4);var _0x51c7d2=fs['createWriteStream'](_0x4a7290);var _0x37a386=crypto['createCipher'](_0x46e9fe[_0x4a26('0x8')],_0x4858cb);_0x183c3c['on'](_0x4a26('0x11'),function(_0x11ccbf){var _0x3b8e02=new Buffer(_0x37a386[_0x4a26('0x12')](_0x11ccbf),_0x4a26('0x13'));_0x51c7d2['write'](_0x3b8e02);});_0x183c3c['on'](_0x4a26('0x14'),function(){try{var _0x11e39d=new Buffer(_0x37a386[_0x4a26('0x15')](_0x4a26('0x13')),'binary');_0x51c7d2[_0x4a26('0x16')](_0x11e39d);_0x51c7d2[_0x4a26('0x14')]();_0x51c7d2['on'](_0x4a26('0x17'),function(){return _0x4af9aa(_0x4a7290);});}catch(_0x2c18ad){fs[_0x4a26('0x18')](_0x4a7290);return _0x575f64(_0x2c18ad);}});});};exports['decryptFile']=function(_0x69a189,_0x2e4cc8,_0x225e04,_0x1e3bd2){return new BPromise(function(_0x1ef972,_0xf71447){_0x1e3bd2=combineOptions(_0x1e3bd2);var _0x391bf4=new Buffer(_0x225e04);var _0xc9fa81=fs[_0x4a26('0x10')](_0x69a189);var _0x58ae86=fs['createWriteStream'](_0x2e4cc8);var _0x417ccf=crypto['createDecipher'](_0x1e3bd2[_0x4a26('0x8')],_0x391bf4);_0xc9fa81['on'](_0x4a26('0x11'),function(_0xa7ade2){var _0x50dcaf=new Buffer(_0x417ccf[_0x4a26('0x12')](_0xa7ade2),_0x4a26('0x13'));_0x58ae86[_0x4a26('0x16')](_0x50dcaf);});_0xc9fa81['on'](_0x4a26('0x14'),function(){try{var _0x423608=new Buffer(_0x417ccf[_0x4a26('0x15')]('binary'),_0x4a26('0x13'));_0x58ae86[_0x4a26('0x16')](_0x423608);_0x58ae86[_0x4a26('0x14')]();_0x58ae86['on'](_0x4a26('0x17'),function(){return _0x1ef972(_0x2e4cc8);});}catch(_0x116d1f){fs['unlink'](_0x2e4cc8);return _0xf71447(_0x116d1f);}});});};exports[_0x4a26('0x19')]=function(_0x2d490f,_0x5b0776,_0x76577f){var _0x3dcb92=_0x76577f||stringOptions[_0x4a26('0x8')];var _0x3b8037=_0x5b0776||stringOptions[_0x4a26('0x1a')];var _0xc80e90=crypto['createCipher'](_0x3dcb92,_0x3b8037);var _0x5427d3=_0xc80e90['update'](_0x2d490f,'utf8','base64');_0x5427d3+=_0xc80e90[_0x4a26('0x15')](_0x4a26('0x1b'));return _0x5427d3;};exports[_0x4a26('0x1c')]=function(_0x37da9b,_0x11b90e,_0x5a4923){var _0x4c3d67=_0x5a4923||stringOptions['algorithm'];var _0x3d2c8d=_0x11b90e||stringOptions[_0x4a26('0x1a')];var _0x559bb5=crypto[_0x4a26('0x1d')](_0x4c3d67,_0x3d2c8d);var _0x1e4e70=_0x559bb5[_0x4a26('0x12')](_0x37da9b,'base64',_0x4a26('0x1e'));_0x1e4e70+=_0x559bb5[_0x4a26('0x15')](_0x4a26('0x1e'));return _0x1e4e70;}; \ No newline at end of file +var _0xc35a=['final','unlink','encryptString','secret','base64','decryptString','utf8','crypto','lodash','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','createWriteStream','createCipher','data','binary','write','end','close','decryptFile','createReadStream','createDecipher','update'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xc35a,0x151));var _0xac35=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc35a[_0x3b380d];return _0x54502b;};'use strict';var crypto=require(_0xac35('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xac35('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xac35('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xac35('0x3')][_0xac35('0x4')],'algorithm':_0xac35('0x5')};const fileOptions={'algorithm':_0xac35('0x6')};if(config[_0xac35('0x7')]&&config[_0xac35('0x7')][_0xac35('0x8')]){var isSupported=isAlgorithmSupported(config[_0xac35('0x7')][_0xac35('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0xac35('0x7')][_0xac35('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xac35('0x9')](config[_0xac35('0x7')][_0xac35('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x25ec43){return AES_SUPPORTED_RX[_0xac35('0xa')](_0x25ec43);}function getSupportedCiphers(){return crypto[_0xac35('0xb')]()[_0xac35('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x4619b1){return getSupportedCiphers()[_0xac35('0xd')](_0x4619b1)>-0x1;}function combineOptions(_0x37c879){var _0x138105={};for(var _0x4444ab in fileOptions){if(fileOptions[_0xac35('0xe')](_0x4444ab)){_0x138105[_0x4444ab]=fileOptions[_0x4444ab];}}if(_0x37c879){for(var _0x154943 in _0x37c879){if(_0x37c879[_0xac35('0xe')](_0x154943)){_0x138105[_0x154943]=_0x37c879[_0x154943];}}}return _0x138105;}exports['encryptFile']=function(_0x21abe3,_0x8df1bf,_0x132f62,_0x454fbc){return new BPromise(function(_0x257bf9,_0x87d63e){_0x454fbc=combineOptions(_0x454fbc);var _0x2cad23=new Buffer(_0x132f62);var _0x5c4a93=fs['createReadStream'](_0x21abe3);var _0x133b80=fs[_0xac35('0xf')](_0x8df1bf);var _0x14de41=crypto[_0xac35('0x10')](_0x454fbc[_0xac35('0x8')],_0x2cad23);_0x5c4a93['on'](_0xac35('0x11'),function(_0x2a0e95){var _0x5484f5=new Buffer(_0x14de41['update'](_0x2a0e95),_0xac35('0x12'));_0x133b80[_0xac35('0x13')](_0x5484f5);});_0x5c4a93['on'](_0xac35('0x14'),function(){try{var _0x4c4a14=new Buffer(_0x14de41['final'](_0xac35('0x12')),_0xac35('0x12'));_0x133b80['write'](_0x4c4a14);_0x133b80[_0xac35('0x14')]();_0x133b80['on'](_0xac35('0x15'),function(){return _0x257bf9(_0x8df1bf);});}catch(_0x44731e){fs['unlink'](_0x8df1bf);return _0x87d63e(_0x44731e);}});});};exports[_0xac35('0x16')]=function(_0x156b53,_0x553a9e,_0x47092c,_0x76b77d){return new BPromise(function(_0x198f31,_0x4cb290){_0x76b77d=combineOptions(_0x76b77d);var _0x301f2d=new Buffer(_0x47092c);var _0x3cfdbb=fs[_0xac35('0x17')](_0x156b53);var _0x1cbae3=fs[_0xac35('0xf')](_0x553a9e);var _0x5f3d6d=crypto[_0xac35('0x18')](_0x76b77d[_0xac35('0x8')],_0x301f2d);_0x3cfdbb['on'](_0xac35('0x11'),function(_0x3d6474){var _0x2869c8=new Buffer(_0x5f3d6d[_0xac35('0x19')](_0x3d6474),_0xac35('0x12'));_0x1cbae3[_0xac35('0x13')](_0x2869c8);});_0x3cfdbb['on'](_0xac35('0x14'),function(){try{var _0x373f01=new Buffer(_0x5f3d6d[_0xac35('0x1a')](_0xac35('0x12')),_0xac35('0x12'));_0x1cbae3[_0xac35('0x13')](_0x373f01);_0x1cbae3[_0xac35('0x14')]();_0x1cbae3['on']('close',function(){return _0x198f31(_0x553a9e);});}catch(_0x3b82d1){fs[_0xac35('0x1b')](_0x553a9e);return _0x4cb290(_0x3b82d1);}});});};exports[_0xac35('0x1c')]=function(_0xba9491,_0x491076,_0x4f5a4a){var _0x1e14c2=_0x4f5a4a||stringOptions[_0xac35('0x8')];var _0x550fad=_0x491076||stringOptions[_0xac35('0x1d')];var _0x43dec6=crypto[_0xac35('0x10')](_0x1e14c2,_0x550fad);var _0x1325ed=_0x43dec6[_0xac35('0x19')](_0xba9491,'utf8',_0xac35('0x1e'));_0x1325ed+=_0x43dec6[_0xac35('0x1a')](_0xac35('0x1e'));return _0x1325ed;};exports[_0xac35('0x1f')]=function(_0x79e854,_0x2da52a,_0x46129c){var _0x7df208=_0x46129c||stringOptions['algorithm'];var _0x25ba7f=_0x2da52a||stringOptions[_0xac35('0x1d')];var _0x28ebaf=crypto['createDecipher'](_0x7df208,_0x25ba7f);var _0x3bec5d=_0x28ebaf[_0xac35('0x19')](_0x79e854,_0xac35('0x1e'),_0xac35('0x20'));_0x3bec5d+=_0x28ebaf[_0xac35('0x1a')]('utf8');return _0x3bec5d;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index fd254e2..71699a9 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 _0xcac6=['%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Failed','finally','exit','path','lodash','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','csv'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xcac6,0x93));var _0x6cac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcac6[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var path=require(_0x6cac('0x0'));var _=require(_0x6cac('0x1'));var csv=require(_0x6cac('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x6cac('0x3'));var db=require(_0x6cac('0x4'))['db'];var dbH=require(_0x6cac('0x4'))[_0x6cac('0x5')];var logger=require(_0x6cac('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6cac('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x6cac('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x370e45,_0x4f3a4f){var _0x54b55d={'status':_0x370e45};var _0x239563={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4f3a4f){_0x54b55d['savename']=_0x4f3a4f;}return db[_0x6cac('0x8')][_0x6cac('0x9')](_0x54b55d,_0x239563);}function main(){var _0x4fec5e=0x1388;var _0x7b266;logger[_0x6cac('0xa')](util[_0x6cac('0xb')](_0x6cac('0xc'),EXTRACTED_REPORT_ID,_0x6cac('0xd')));return db[_0x6cac('0xe')][_0x6cac('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x6cac('0x10')](function(_0x148af7){if(_0x148af7){_0x7b266=_0x148af7;_0x4fec5e=_0x7b266[_0x6cac('0x11')]||0x1388;}})[_0x6cac('0x10')](function(){return dbH[_0x6cac('0x12')][_0x6cac('0x13')](util['format'](_0x6cac('0x14'),QUERY),{'type':dbH[_0x6cac('0x12')][_0x6cac('0x15')][_0x6cac('0x16')]});})[_0x6cac('0x10')](function(_0xe5ff71){if(!_0xe5ff71[0x0][_0x6cac('0x17')]){return analyticExtractedReport(_0x6cac('0x18'));}var _0x4f8808=[];var _0x9d7a1c=0x0;if(_0x7b266[_0x6cac('0x19')]){if(_0xe5ff71&&_0xe5ff71[_0x6cac('0x1a')]){var _0x3519f1=_['range'](_0xe5ff71[0x0][_0x6cac('0x17')]/_0x4fec5e);var _0x339bc2=Number['isInteger'](_0xe5ff71[0x0]['num']/_0x4fec5e)?_0xe5ff71[0x0]['num']%_0x4fec5e:0x0;_0x3519f1['forEach'](function(_0x388085){if(_0x388085>0x0){_0x9d7a1c+=_0x4fec5e;}_0x4f8808[_0x6cac('0x1b')](dbH[_0x6cac('0x12')][_0x6cac('0x13')](util['format'](_0x6cac('0x1c'),QUERY,_0x4fec5e,_0x9d7a1c),{'type':dbH[_0x6cac('0x12')][_0x6cac('0x15')][_0x6cac('0x16')]}));});if(_0x339bc2>0x0){_0x9d7a1c+=_0x4fec5e;_0x4f8808['push'](dbH[_0x6cac('0x12')][_0x6cac('0x13')](util[_0x6cac('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x339bc2,_0x9d7a1c),{'type':dbH[_0x6cac('0x12')][_0x6cac('0x15')][_0x6cac('0x16')]}));}}}else{_0x4f8808['push'](dbH[_0x6cac('0x12')][_0x6cac('0x13')](QUERY,{'type':dbH[_0x6cac('0x12')][_0x6cac('0x15')]['SELECT']}));}var _0x216de9=path[_0x6cac('0x1d')](PATH);var _0x464233=path[_0x6cac('0x1e')](PATH,'.csv');var _0x3f1796=_0x7b266['split']&&_0x4f8808[_0x6cac('0x1a')]>0x1;var _0x2516b3=[];if(!fs[_0x6cac('0x1f')](path[_0x6cac('0x20')](_0x216de9,_0x464233))&&_0x3f1796){fs[_0x6cac('0x21')](path[_0x6cac('0x20')](_0x216de9,_0x464233));}return BPromise[_0x6cac('0x22')](_0x4f8808,function(_0x3d57ce){_0x2516b3['push'](_0x3d57ce);})[_0x6cac('0x10')](function(){for(var _0x5c2745=0x0;_0x5c2745<_0x2516b3['length'];_0x5c2745+=0x1){var _0x1f83e6;var _0x12a19a=_0x2516b3[_0x5c2745];if(_0x3f1796){_0x1f83e6=path[_0x6cac('0x20')](_0x216de9,_0x464233,util[_0x6cac('0xb')](_0x6cac('0x23'),_0x464233,_0x5c2745,'csv'));}else{_0x1f83e6=path[_0x6cac('0x20')](_0x216de9,util[_0x6cac('0xb')]('%s.%s',_0x464233,_0x6cac('0x24')));}fs['writeFileSync'](_0x1f83e6,csv(_0x12a19a));}})[_0x6cac('0x10')](function(){if(_0x3f1796){return new Promise(function(_0x8b4482){zipdir(path[_0x6cac('0x20')](_0x216de9,_0x464233),{'saveTo':path[_0x6cac('0x20')](_0x216de9,util[_0x6cac('0xb')](_0x6cac('0x25'),_0x464233,_0x6cac('0x26')))},function(_0x554ffb,_0x3beac6){rimraf(path[_0x6cac('0x20')](_0x216de9,_0x464233),function(){});_0x8b4482(_0x6cac('0x27'));});});}})[_0x6cac('0x10')](function(){logger[_0x6cac('0xa')](util[_0x6cac('0xb')](_0x6cac('0x28'),EXTRACTED_REPORT_ID,_0x6cac('0xd')));return analyticExtractedReport(_0x6cac('0x29'),_0x3f1796?util[_0x6cac('0xb')](_0x6cac('0x25'),_0x464233,_0x3f1796?_0x6cac('0x26'):_0x6cac('0x24')):null);});})[_0x6cac('0x2a')](function(_0x4ebf43){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6cac('0xd')),util['inspect'](_0x4ebf43,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6cac('0x2b'));})[_0x6cac('0x2c')](function(){process[_0x6cac('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xdcbd=['QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x46d21b,_0x21c486){var _0x2756c6=function(_0x5a9654){while(--_0x5a9654){_0x46d21b['push'](_0x46d21b['shift']());}};_0x2756c6(++_0x21c486);}(_0xdcbd,0xc5));var _0xddcb=function(_0x17ab73,_0x49bf68){_0x17ab73=_0x17ab73-0x0;var _0x1cbf0a=_0xdcbd[_0x17ab73];return _0x1cbf0a;};'use strict';var util=require(_0xddcb('0x0'));var path=require(_0xddcb('0x1'));var _=require(_0xddcb('0x2'));var csv=require(_0xddcb('0x3'));var fs=require('fs');var BPromise=require(_0xddcb('0x4'));var zipdir=require(_0xddcb('0x5'));var rimraf=require(_0xddcb('0x6'));var db=require(_0xddcb('0x7'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xddcb('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xddcb('0x9')][0x3];var PATH=process[_0xddcb('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5d4de4,_0x21ca50){var _0x9b367a={'status':_0x5d4de4};var _0xb1505a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21ca50){_0x9b367a[_0xddcb('0xa')]=_0x21ca50;}return db[_0xddcb('0xb')][_0xddcb('0xc')](_0x9b367a,_0xb1505a);}function main(){var _0x555b27=0x1388;var _0x23bb56;logger[_0xddcb('0xd')](util[_0xddcb('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xddcb('0xf')));return db[_0xddcb('0x10')][_0xddcb('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xddcb('0x12'),'splitSizeCsv']})[_0xddcb('0x13')](function(_0x112aa3){if(_0x112aa3){_0x23bb56=_0x112aa3;_0x555b27=_0x23bb56[_0xddcb('0x14')]||0x1388;}})[_0xddcb('0x13')](function(){return dbH[_0xddcb('0x15')]['query'](util['format'](_0xddcb('0x16'),QUERY),{'type':dbH['sequelize'][_0xddcb('0x17')][_0xddcb('0x18')]});})['then'](function(_0x4bf20d){if(!_0x4bf20d[0x0][_0xddcb('0x19')]){return analyticExtractedReport(_0xddcb('0x1a'));}var _0x37b737=[];var _0x17c287=0x0;if(_0x23bb56['split']){if(_0x4bf20d&&_0x4bf20d[_0xddcb('0x1b')]){var _0xf8634f=_[_0xddcb('0x1c')](_0x4bf20d[0x0][_0xddcb('0x19')]/_0x555b27);var _0x190c13=Number[_0xddcb('0x1d')](_0x4bf20d[0x0][_0xddcb('0x19')]/_0x555b27)?_0x4bf20d[0x0]['num']%_0x555b27:0x0;_0xf8634f[_0xddcb('0x1e')](function(_0x240ce5){if(_0x240ce5>0x0){_0x17c287+=_0x555b27;}_0x37b737[_0xddcb('0x1f')](dbH[_0xddcb('0x15')][_0xddcb('0x20')](util[_0xddcb('0xe')](_0xddcb('0x21'),QUERY,_0x555b27,_0x17c287),{'type':dbH[_0xddcb('0x15')]['QueryTypes'][_0xddcb('0x18')]}));});if(_0x190c13>0x0){_0x17c287+=_0x555b27;_0x37b737[_0xddcb('0x1f')](dbH['sequelize']['query'](util[_0xddcb('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x190c13,_0x17c287),{'type':dbH['sequelize']['QueryTypes'][_0xddcb('0x18')]}));}}}else{_0x37b737['push'](dbH[_0xddcb('0x15')][_0xddcb('0x20')](QUERY,{'type':dbH[_0xddcb('0x15')][_0xddcb('0x17')]['SELECT']}));}var _0x23d80b=path[_0xddcb('0x22')](PATH);var _0x242de2=path[_0xddcb('0x23')](PATH,_0xddcb('0x24'));var _0x56c654=_0x23bb56[_0xddcb('0x12')]&&_0x37b737[_0xddcb('0x1b')]>0x1;var _0x136ef7=[];if(!fs[_0xddcb('0x25')](path[_0xddcb('0x26')](_0x23d80b,_0x242de2))&&_0x56c654){fs[_0xddcb('0x27')](path[_0xddcb('0x26')](_0x23d80b,_0x242de2));}return BPromise[_0xddcb('0x28')](_0x37b737,function(_0x4d38a0){_0x136ef7[_0xddcb('0x1f')](_0x4d38a0);})[_0xddcb('0x13')](function(){for(var _0x63b718=0x0;_0x63b718<_0x136ef7['length'];_0x63b718+=0x1){var _0x415b3d;var _0x283ab1=_0x136ef7[_0x63b718];if(_0x56c654){_0x415b3d=path[_0xddcb('0x26')](_0x23d80b,_0x242de2,util[_0xddcb('0xe')](_0xddcb('0x29'),_0x242de2,_0x63b718,'csv'));}else{_0x415b3d=path[_0xddcb('0x26')](_0x23d80b,util['format'](_0xddcb('0x2a'),_0x242de2,_0xddcb('0x2b')));}fs[_0xddcb('0x2c')](_0x415b3d,csv(_0x283ab1));}})['then'](function(){if(_0x56c654){return new Promise(function(_0x58dfb7){zipdir(path[_0xddcb('0x26')](_0x23d80b,_0x242de2),{'saveTo':path[_0xddcb('0x26')](_0x23d80b,util['format']('%s.%s',_0x242de2,_0xddcb('0x2d')))},function(_0x248c73,_0x2cad90){rimraf(path[_0xddcb('0x26')](_0x23d80b,_0x242de2),function(){});_0x58dfb7(_0xddcb('0x2e'));});});}})[_0xddcb('0x13')](function(){logger[_0xddcb('0xd')](util['format'](_0xddcb('0x2f'),EXTRACTED_REPORT_ID,_0xddcb('0xf')));return analyticExtractedReport(_0xddcb('0x30'),_0x56c654?util[_0xddcb('0xe')]('%s.%s',_0x242de2,_0x56c654?_0xddcb('0x2d'):_0xddcb('0x2b')):null);});})[_0xddcb('0x31')](function(_0xeebb5f){logger[_0xddcb('0xd')](util[_0xddcb('0xe')](_0xddcb('0x32'),EXTRACTED_REPORT_ID,'CSV'),util[_0xddcb('0x33')](_0xeebb5f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xddcb('0x34'));})[_0xddcb('0x35')](function(){process[_0xddcb('0x36')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0b43b57..b570506 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 _0xf60c=['savename','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','format','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','black','right','num','Empty','Setting','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','PDF','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a'];(function(_0x2e2865,_0x3d6e55){var _0x4f8bbb=function(_0x5937dd){while(--_0x5937dd){_0x2e2865['push'](_0x2e2865['shift']());}};_0x4f8bbb(++_0x3d6e55);}(_0xf60c,0x15e));var _0xcf60=function(_0x15b583,_0x4611eb){_0x15b583=_0x15b583-0x0;var _0x4eb6c7=_0xf60c[_0x15b583];return _0x4eb6c7;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0xcf60('0x0'));var moment=require(_0xcf60('0x1'));var htmlToPdfmake=require(_0xcf60('0x2'));var PdfPrinter=require(_0xcf60('0x3'));var zipdir=require(_0xcf60('0x4'));var rimraf=require(_0xcf60('0x5'));var JSDOM=require(_0xcf60('0x6'))['JSDOM'];var window=new JSDOM('')[_0xcf60('0x7')];var BPromise=require(_0xcf60('0x8'));var db=require(_0xcf60('0x9'))['db'];var dbH=require(_0xcf60('0x9'))[_0xcf60('0xa')];var logger=require('../../config/logger')(_0xcf60('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xcf60('0xc')][0x2]);var QUERY=process[_0xcf60('0xc')][0x3];var PATH=process[_0xcf60('0xc')][0x4];var NAME=process[_0xcf60('0xc')][0x5];var FORMAT=_0xcf60('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e84dc,_0x38fa9b){var _0x2c5a49={'status':_0x2e84dc};var _0x4d9945={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38fa9b){_0x2c5a49[_0xcf60('0xe')]=_0x38fa9b;}return db['AnalyticExtractedReport']['update'](_0x2c5a49,_0x4d9945);}function getHeaders(_0x1f505a){return _[_0xcf60('0xf')](_0x1f505a,function(_0x37c5f8){return{'text':_0x37c5f8,'style':_0xcf60('0x10')};});}function getRows(_0x1bd228,_0x7f0df4){return _[_0xcf60('0xf')](_0x7f0df4,function(_0x3bd39b){return _(_0x3bd39b)[_0xcf60('0x11')](_0x1bd228)[_0xcf60('0xf')](function(_0x5bcdf9){return _0x5bcdf9?_[_0xcf60('0x12')](_0x5bcdf9):'';})[_0xcf60('0x13')]();});}function createTable(_0x490887,_0x5769ca){var _0x33d839={'widths':_[_0xcf60('0x14')](Array(_0x490887[_0xcf60('0x15')]),0x91),'heights':function(_0x3b9351){return _0x3b9351===0x0?_0xcf60('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5b6056=getHeaders(_0x490887);_0x33d839[_0xcf60('0x17')][_0xcf60('0x18')](_0x5b6056);var _0x5004ab=getRows(_0x490887,_0x5769ca);_0x33d839['body']=_0x33d839[_0xcf60('0x17')][_0xcf60('0x19')](_0x5004ab);return _0x33d839;}function createTables(_0x5dfcaf){var _0x545584=[];var _0x1b4170=_[_0xcf60('0x1a')](Object[_0xcf60('0x1b')](_0x5dfcaf[0x0]),0x5);_0x1b4170[_0xcf60('0x1c')](function(_0x91a83a){_0x545584[_0xcf60('0x18')](createTable(_0x91a83a,_0x5dfcaf));});return _0x545584;}function getPDFDocDefinition(_0xa8e522){var _0x5aa4f8=util['format'](_0xcf60('0x1d'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xcf60('0x1e')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xcf60('0x1f')])[_0xcf60('0x20')](FORMAT));var _0x468de1=[];for(var _0x17fd58=0x0;_0x17fd58<_0xa8e522['length'];_0x17fd58++){var _0x237384=[];if(_0x17fd58===0x0){_0x237384[_0xcf60('0x18')]({'text':_0x5aa4f8,'style':_0xcf60('0x21')});}var _0x379b5d={'table':_0xa8e522[_0x17fd58]};if(_0x17fd58>0x0){_0x379b5d[_0xcf60('0x22')]=_0xcf60('0x23');_0x379b5d[_0xcf60('0x24')]=[0x0,0x46,0x0,0x0];}_0x237384[_0xcf60('0x18')](_0x379b5d);_0x468de1[_0xcf60('0x18')](_0x237384);}return{'pageSize':'A4','pageOrientation':_0xcf60('0x25'),'content':_0x468de1,'footer':function(_0x91c672,_0x2b8bf2){return{'text':_0x91c672[_0xcf60('0x12')]()+_0xcf60('0x26')+_0x2b8bf2,'style':'footer'};},'defaultStyle':{'font':_0xcf60('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xcf60('0x28')},'footer':{'alignment':_0xcf60('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4f8b5e){var _0x373edd=0x1388;var _0x4fc067;if(!_0x4f8b5e[0x0][_0xcf60('0x2a')]){return analyticExtractedReport(_0xcf60('0x2b'));}return db[_0xcf60('0x2c')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcf60('0x2d'),_0xcf60('0x2e')]})[_0xcf60('0x2f')](function(_0x10780d){if(_0x10780d){_0x4fc067=_0x10780d;_0x373edd=_0x4fc067[_0xcf60('0x2e')]||0x3e8;}})[_0xcf60('0x2f')](function(){var _0x1e5d59=[];var _0x145dd7=0x0;if(_0x4fc067[_0xcf60('0x2d')]){if(_0x4f8b5e&&_0x4f8b5e['length']){var _0xe586fe=_[_0xcf60('0x30')](_0x4f8b5e[0x0]['num']/_0x373edd);var _0x2dff47=Number[_0xcf60('0x31')](_0x4f8b5e[0x0][_0xcf60('0x2a')]/_0x373edd)?_0x4f8b5e[0x0][_0xcf60('0x2a')]%_0x373edd:0x0;_0xe586fe['forEach'](function(_0x4d6a){if(_0x4d6a>0x0){_0x145dd7+=_0x373edd;}_0x1e5d59[_0xcf60('0x18')](dbH[_0xcf60('0x32')][_0xcf60('0x33')](util[_0xcf60('0x20')](_0xcf60('0x34'),QUERY,_0x373edd,_0x145dd7),{'type':dbH[_0xcf60('0x32')]['QueryTypes'][_0xcf60('0x35')]}));});if(_0x2dff47>0x0){_0x145dd7+=_0x373edd;_0x1e5d59[_0xcf60('0x18')](dbH[_0xcf60('0x32')]['query'](util[_0xcf60('0x20')](_0xcf60('0x34'),QUERY,_0x2dff47,_0x145dd7),{'type':dbH[_0xcf60('0x32')][_0xcf60('0x36')][_0xcf60('0x35')]}));}}}else{_0x1e5d59[_0xcf60('0x18')](dbH[_0xcf60('0x32')][_0xcf60('0x33')](QUERY,{'type':dbH[_0xcf60('0x32')][_0xcf60('0x36')][_0xcf60('0x35')]}));}var _0x31f2ea=path[_0xcf60('0x37')](PATH);var _0x650e79=path[_0xcf60('0x38')](PATH,_0xcf60('0x39'));var _0xbdae5c=_0x4fc067[_0xcf60('0x2d')]&&_0x1e5d59[_0xcf60('0x15')]>0x1;var _0x1108d1=[];if(!fs['existsSync'](path[_0xcf60('0x3a')](_0x31f2ea,_0x650e79))&&_0xbdae5c){fs[_0xcf60('0x3b')](path[_0xcf60('0x3a')](_0x31f2ea,_0x650e79));}return BPromise[_0xcf60('0x3c')](_0x1e5d59,function(_0x3a69d4){_0x1108d1[_0xcf60('0x18')](_0x3a69d4);})[_0xcf60('0x2f')](function(){var _0x4dfa08=[];for(var _0x475390=0x0;_0x475390<_0x1108d1['length'];_0x475390+=0x1){var _0x2d41dd=_0x1108d1[_0x475390];var _0x1c794f=createTables(_[_0xcf60('0x3d')](_0x2d41dd));var _0x156f52;var _0x17597d=getPDFDocDefinition(_0x1c794f);var _0x5971b4=getPDFPrinter();var _0x15141b=_0x5971b4[_0xcf60('0x3e')](_0x17597d);if(_0xbdae5c){_0x156f52=path['join'](_0x31f2ea,_0x650e79,util['format'](_0xcf60('0x3f'),_0x650e79,_0x475390,_0xcf60('0x40')));}else{_0x156f52=path[_0xcf60('0x3a')](_0x31f2ea,util[_0xcf60('0x20')](_0xcf60('0x41'),_0x650e79,_0xcf60('0x40')));}_0x4dfa08['push'](writePDFDocument(_0x15141b,_0x156f52));}return Promise[_0xcf60('0x42')](_0x4dfa08);})['then'](function(){if(_0xbdae5c){return new Promise(function(_0x4a2074){zipdir(path[_0xcf60('0x3a')](_0x31f2ea,_0x650e79),{'saveTo':path[_0xcf60('0x3a')](_0x31f2ea,util['format'](_0xcf60('0x41'),_0x650e79,'zip'))},function(){rimraf(path[_0xcf60('0x3a')](_0x31f2ea,_0x650e79),function(){});_0x4a2074(_0xcf60('0x43'));});});}})[_0xcf60('0x2f')](function(){if(!_0xbdae5c)return;rimraf(path['join'](_0x31f2ea,_0x650e79),function(){});})['then'](function(){logger[_0xcf60('0x44')](util[_0xcf60('0x20')](_0xcf60('0x45'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xcf60('0x46'),_0xbdae5c?util[_0xcf60('0x20')](_0xcf60('0x41'),_0x650e79,_0xbdae5c?_0xcf60('0x47'):_0xcf60('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xcf60('0x44')](util[_0xcf60('0x20')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcf60('0x48')));return db[_0xcf60('0x49')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0xa1439){EXTRACTED_REPORT=_0xa1439;return dbH[_0xcf60('0x32')]['query'](util[_0xcf60('0x20')](_0xcf60('0x4a'),QUERY),{'type':dbH[_0xcf60('0x32')]['QueryTypes'][_0xcf60('0x35')]});})[_0xcf60('0x2f')](extractReport)[_0xcf60('0x4b')](function(_0xa184b2){logger[_0xcf60('0x44')](util[_0xcf60('0x20')](_0xcf60('0x4c'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0xa184b2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcf60('0x4d'));})[_0xcf60('0x4e')](function(){process[_0xcf60('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1cb829=new PdfPrinter({'Arial':{'normal':__dirname+_0xcf60('0x50'),'bold':__dirname+_0xcf60('0x51'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x1cb829;}function getPDFDocDefinitionFromHTML(_0x303121,_0x1378e0){var _0x4c51c8=util[_0xcf60('0x20')](_0xcf60('0x52'),_0x1378e0['channel'],_0x1378e0[_0xcf60('0x53')]);var _0x16059a=moment()['format'](_0xcf60('0x54'))[_0xcf60('0x12')]();var _0x2141b9=htmlToPdfmake(_0x303121,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2141b9],'defaultStyle':{'font':_0xcf60('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcf60('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xcf60('0x55'),'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':_0xcf60('0x21')}];},'footer':function(_0x2cab6e,_0x5d6db4){return[{'text':util['format'](_0xcf60('0x56'),_0x4c51c8,_0x2cab6e,_0x5d6db4,_0x16059a),'style':'footer'}];}};}function writePDFDocument(_0x33d970,_0xf07489){return new Promise(function(_0x903141,_0x14513b){var _0xb5443=_0x33d970[_0xcf60('0x57')](fs[_0xcf60('0x58')](_0xf07489));_0xb5443['on'](_0xcf60('0x59'),function(){_0x903141(_0xcf60('0x59'));});_0xb5443['on'](_0xcf60('0x5a'),function(_0x20e4ad){_0x14513b(_0x20e4ad);});_0x33d970['end']();});}exports['createPdfFromHTML']=function(_0x162846,_0x1e6f8f){var _0x510385=getPDFPrinter();var _0x5cd46b=getPDFDocDefinitionFromHTML(_0x162846,_0x1e6f8f);var _0x1fd8e9=_0x510385['createPdfKitDocument'](_0x5cd46b);return writePDFDocument(_0x1fd8e9,_0x1e6f8f[_0xcf60('0x0')])['catch'](function(_0x45f3c1){throw _0x45f3c1;});}; \ No newline at end of file +var _0x8cb2=['zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfKitDocument','path','lodash','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','toString','value','length','auto','body','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','margin','landscape','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','%s%d.%s','pdf','%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed'];(function(_0x389b61,_0x295144){var _0x2a0da8=function(_0x5f3f39){while(--_0x5f3f39){_0x389b61['push'](_0x389b61['shift']());}};_0x2a0da8(++_0x295144);}(_0x8cb2,0x16b));var _0x28cb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8cb2[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x28cb('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x28cb('0x1'));var zipdir=require(_0x28cb('0x2'));var rimraf=require(_0x28cb('0x3'));var JSDOM=require(_0x28cb('0x4'))[_0x28cb('0x5')];var window=new JSDOM('')[_0x28cb('0x6')];var BPromise=require('bluebird');var db=require(_0x28cb('0x7'))['db'];var dbH=require(_0x28cb('0x7'))[_0x28cb('0x8')];var logger=require('../../config/logger')(_0x28cb('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x28cb('0xa')][0x2]);var QUERY=process[_0x28cb('0xa')][0x3];var PATH=process[_0x28cb('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x28cb('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x569631,_0x2c7816){var _0x3c68c9={'status':_0x569631};var _0x4b3490={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c7816){_0x3c68c9[_0x28cb('0xc')]=_0x2c7816;}return db[_0x28cb('0xd')]['update'](_0x3c68c9,_0x4b3490);}function getHeaders(_0x3a5321){return _[_0x28cb('0xe')](_0x3a5321,function(_0x442d97){return{'text':_0x442d97,'style':_0x28cb('0xf')};});}function getRows(_0x321a7a,_0x369133){return _['map'](_0x369133,function(_0x835c04){return _(_0x835c04)['pick'](_0x321a7a)[_0x28cb('0xe')](function(_0x593b67){return _0x593b67?_[_0x28cb('0x10')](_0x593b67):'';})[_0x28cb('0x11')]();});}function createTable(_0x1fb2f6,_0xb12e46){var _0x4e2341={'widths':_['fill'](Array(_0x1fb2f6[_0x28cb('0x12')]),0x91),'heights':function(_0x5b6c10){return _0x5b6c10===0x0?_0x28cb('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x164f24=getHeaders(_0x1fb2f6);_0x4e2341[_0x28cb('0x14')]['push'](_0x164f24);var _0xd6cbc3=getRows(_0x1fb2f6,_0xb12e46);_0x4e2341['body']=_0x4e2341['body']['concat'](_0xd6cbc3);return _0x4e2341;}function createTables(_0x27c570){var _0x234574=[];var _0x366dab=_['chunk'](Object[_0x28cb('0x15')](_0x27c570[0x0]),0x5);_0x366dab[_0x28cb('0x16')](function(_0x28ec39){_0x234574[_0x28cb('0x17')](createTable(_0x28ec39,_0x27c570));});return _0x234574;}function getPDFDocDefinition(_0x352e8a){var _0x59b802=util[_0x28cb('0x18')](_0x28cb('0x19'),NAME,EXTRACTED_REPORT[_0x28cb('0x1a')],moment(EXTRACTED_REPORT['startDate'])[_0x28cb('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x28cb('0x1b')])['format'](FORMAT));var _0x58508b=[];for(var _0x2be2bf=0x0;_0x2be2bf<_0x352e8a[_0x28cb('0x12')];_0x2be2bf++){var _0x50dd01=[];if(_0x2be2bf===0x0){_0x50dd01[_0x28cb('0x17')]({'text':_0x59b802,'style':_0x28cb('0x1c')});}var _0x2d5a9a={'table':_0x352e8a[_0x2be2bf]};if(_0x2be2bf>0x0){_0x2d5a9a[_0x28cb('0x1d')]='before';_0x2d5a9a[_0x28cb('0x1e')]=[0x0,0x46,0x0,0x0];}_0x50dd01[_0x28cb('0x17')](_0x2d5a9a);_0x58508b[_0x28cb('0x17')](_0x50dd01);}return{'pageSize':'A4','pageOrientation':_0x28cb('0x1f'),'content':_0x58508b,'footer':function(_0x446b6d,_0x44a849){return{'text':_0x446b6d['toString']()+'\x20/\x20'+_0x44a849,'style':'footer'};},'defaultStyle':{'font':_0x28cb('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x28cb('0x21')},'footer':{'alignment':_0x28cb('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2694ae){var _0xd18d22=0x1388;var _0x59866d;if(!_0x2694ae[0x0][_0x28cb('0x23')]){return analyticExtractedReport(_0x28cb('0x24'));}return db[_0x28cb('0x25')][_0x28cb('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x28cb('0x27'),_0x28cb('0x28')]})[_0x28cb('0x29')](function(_0xa299d7){if(_0xa299d7){_0x59866d=_0xa299d7;_0xd18d22=_0x59866d[_0x28cb('0x28')]||0x3e8;}})[_0x28cb('0x29')](function(){var _0x4b5f25=[];var _0xd9c352=0x0;if(_0x59866d['split']){if(_0x2694ae&&_0x2694ae[_0x28cb('0x12')]){var _0x3598b8=_[_0x28cb('0x2a')](_0x2694ae[0x0][_0x28cb('0x23')]/_0xd18d22);var _0x2130f6=Number[_0x28cb('0x2b')](_0x2694ae[0x0][_0x28cb('0x23')]/_0xd18d22)?_0x2694ae[0x0][_0x28cb('0x23')]%_0xd18d22:0x0;_0x3598b8[_0x28cb('0x16')](function(_0x41d34c){if(_0x41d34c>0x0){_0xd9c352+=_0xd18d22;}_0x4b5f25[_0x28cb('0x17')](dbH[_0x28cb('0x2c')]['query'](util[_0x28cb('0x18')](_0x28cb('0x2d'),QUERY,_0xd18d22,_0xd9c352),{'type':dbH[_0x28cb('0x2c')][_0x28cb('0x2e')][_0x28cb('0x2f')]}));});if(_0x2130f6>0x0){_0xd9c352+=_0xd18d22;_0x4b5f25[_0x28cb('0x17')](dbH[_0x28cb('0x2c')]['query'](util[_0x28cb('0x18')](_0x28cb('0x2d'),QUERY,_0x2130f6,_0xd9c352),{'type':dbH[_0x28cb('0x2c')][_0x28cb('0x2e')][_0x28cb('0x2f')]}));}}}else{_0x4b5f25[_0x28cb('0x17')](dbH[_0x28cb('0x2c')][_0x28cb('0x30')](QUERY,{'type':dbH[_0x28cb('0x2c')]['QueryTypes'][_0x28cb('0x2f')]}));}var _0x43eb1d=path[_0x28cb('0x31')](PATH);var _0x4e347f=path[_0x28cb('0x32')](PATH,_0x28cb('0x33'));var _0x33826a=_0x59866d[_0x28cb('0x27')]&&_0x4b5f25[_0x28cb('0x12')]>0x1;var _0xca1aad=[];if(!fs[_0x28cb('0x34')](path[_0x28cb('0x35')](_0x43eb1d,_0x4e347f))&&_0x33826a){fs[_0x28cb('0x36')](path[_0x28cb('0x35')](_0x43eb1d,_0x4e347f));}return BPromise['each'](_0x4b5f25,function(_0x546855){_0xca1aad[_0x28cb('0x17')](_0x546855);})[_0x28cb('0x29')](function(){var _0x47e386=[];for(var _0x456953=0x0;_0x456953<_0xca1aad[_0x28cb('0x12')];_0x456953+=0x1){var _0x2bdf46=_0xca1aad[_0x456953];var _0x42d4fe=createTables(_['flatten'](_0x2bdf46));var _0x577bf2;var _0x18849d=getPDFDocDefinition(_0x42d4fe);var _0x5e15dd=getPDFPrinter();var _0x5c2b66=_0x5e15dd['createPdfKitDocument'](_0x18849d);if(_0x33826a){_0x577bf2=path[_0x28cb('0x35')](_0x43eb1d,_0x4e347f,util[_0x28cb('0x18')](_0x28cb('0x37'),_0x4e347f,_0x456953,_0x28cb('0x38')));}else{_0x577bf2=path[_0x28cb('0x35')](_0x43eb1d,util['format'](_0x28cb('0x39'),_0x4e347f,_0x28cb('0x38')));}_0x47e386[_0x28cb('0x17')](writePDFDocument(_0x5c2b66,_0x577bf2));}return Promise['all'](_0x47e386);})[_0x28cb('0x29')](function(){if(_0x33826a){return new Promise(function(_0x2af1e2){zipdir(path[_0x28cb('0x35')](_0x43eb1d,_0x4e347f),{'saveTo':path[_0x28cb('0x35')](_0x43eb1d,util[_0x28cb('0x18')]('%s.%s',_0x4e347f,'zip'))},function(){rimraf(path['join'](_0x43eb1d,_0x4e347f),function(){});_0x2af1e2('zip\x20finished');});});}})['then'](function(){if(!_0x33826a)return;rimraf(path['join'](_0x43eb1d,_0x4e347f),function(){});})[_0x28cb('0x29')](function(){logger[_0x28cb('0x3a')](util[_0x28cb('0x18')](_0x28cb('0x3b'),EXTRACTED_REPORT_ID,_0x28cb('0x3c')));return analyticExtractedReport(_0x28cb('0x3d'),_0x33826a?util[_0x28cb('0x18')]('%s.%s',_0x4e347f,_0x33826a?_0x28cb('0x3e'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x28cb('0x3a')](util[_0x28cb('0x18')](_0x28cb('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x28cb('0x29')](function(_0x219b7c){EXTRACTED_REPORT=_0x219b7c;return dbH[_0x28cb('0x2c')][_0x28cb('0x30')](util[_0x28cb('0x18')](_0x28cb('0x40'),QUERY),{'type':dbH[_0x28cb('0x2c')]['QueryTypes'][_0x28cb('0x2f')]});})[_0x28cb('0x29')](extractReport)[_0x28cb('0x41')](function(_0x22873e){logger[_0x28cb('0x3a')](util['format'](_0x28cb('0x42'),EXTRACTED_REPORT_ID,'PDF'),util[_0x28cb('0x43')](_0x22873e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x28cb('0x44')](function(){process[_0x28cb('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x61efb=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x28cb('0x46'),'italics':__dirname+_0x28cb('0x47'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x61efb;}function getPDFDocDefinitionFromHTML(_0x5593e7,_0x73c2fe){var _0x3c4cd6=util[_0x28cb('0x18')](_0x28cb('0x48'),_0x73c2fe[_0x28cb('0x49')],_0x73c2fe[_0x28cb('0x4a')]);var _0x11dcf5=moment()[_0x28cb('0x18')](_0x28cb('0x4b'))[_0x28cb('0x10')]();var _0x3609b2=htmlToPdfmake(_0x5593e7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3609b2],'defaultStyle':{'font':_0x28cb('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x28cb('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x28cb('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x28cb('0x4c')}},'header':function(){return[{'text':_0x28cb('0x4d'),'style':_0x28cb('0x1c')}];},'footer':function(_0x1c8353,_0x506800){return[{'text':util[_0x28cb('0x18')](_0x28cb('0x4e'),_0x3c4cd6,_0x1c8353,_0x506800,_0x11dcf5),'style':'footer'}];}};}function writePDFDocument(_0x16bbe9,_0x4f4fb5){return new Promise(function(_0x16d57e,_0x3f92a1){var _0x3cb8bb=_0x16bbe9['pipe'](fs[_0x28cb('0x4f')](_0x4f4fb5));_0x3cb8bb['on'](_0x28cb('0x50'),function(){_0x16d57e(_0x28cb('0x50'));});_0x3cb8bb['on'](_0x28cb('0x51'),function(_0x116893){_0x3f92a1(_0x116893);});_0x16bbe9[_0x28cb('0x52')]();});}exports['createPdfFromHTML']=function(_0x5c11f1,_0x3630be){var _0xbeb908=getPDFPrinter();var _0x88216c=getPDFDocDefinitionFromHTML(_0x5c11f1,_0x3630be);var _0xed6656=_0xbeb908[_0x28cb('0x53')](_0x88216c);return writePDFDocument(_0xed6656,_0x3630be[_0x28cb('0x54')])[_0x28cb('0x41')](function(_0x3b8f8e){throw _0x3b8f8e;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 3510763..594e4fd 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 _0xcc9b=['writeFileSync','zip','zip\x20finished','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename','.xlsx','join','each','%s%d.%s','xlsx','%s.%s'];(function(_0x3e7862,_0x226a36){var _0x423de3=function(_0x5f49a5){while(--_0x5f49a5){_0x3e7862['push'](_0x3e7862['shift']());}};_0x423de3(++_0x226a36);}(_0xcc9b,0x12e));var _0xbcc9=function(_0xa13f82,_0x873474){_0xa13f82=_0xa13f82-0x0;var _0x4be387=_0xcc9b[_0xa13f82];return _0x4be387;};'use strict';var util=require('util');var path=require(_0xbcc9('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xbcc9('0x1'));var BPromise=require(_0xbcc9('0x2'));var zipdir=require(_0xbcc9('0x3'));var rimraf=require(_0xbcc9('0x4'));var db=require(_0xbcc9('0x5'))['db'];var dbH=require(_0xbcc9('0x5'))[_0xbcc9('0x6')];var logger=require(_0xbcc9('0x7'))(_0xbcc9('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xbcc9('0x9')][0x2]);var QUERY=process[_0xbcc9('0x9')][0x3];var PATH=process[_0xbcc9('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x30c12e,_0x36a15c){var _0x1b38ae={'status':_0x30c12e};var _0x20a235={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x36a15c){_0x1b38ae[_0xbcc9('0xa')]=_0x36a15c;}return db[_0xbcc9('0xb')][_0xbcc9('0xc')](_0x1b38ae,_0x20a235);}function main(){var _0x53ba52=0x1388;var _0x2bd3d7;logger[_0xbcc9('0xd')](util[_0xbcc9('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbcc9('0xf')));return db[_0xbcc9('0x10')][_0xbcc9('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbcc9('0x12'),'splitSizeXlsx']})[_0xbcc9('0x13')](function(_0x25c7fb){if(_0x25c7fb){_0x2bd3d7=_0x25c7fb;_0x53ba52=_0x2bd3d7[_0xbcc9('0x14')]||0x1388;}})[_0xbcc9('0x13')](function(){return dbH[_0xbcc9('0x15')][_0xbcc9('0x16')](util[_0xbcc9('0xe')](_0xbcc9('0x17'),QUERY),{'type':dbH[_0xbcc9('0x15')]['QueryTypes'][_0xbcc9('0x18')]});})[_0xbcc9('0x13')](function(_0x1e52bf){if(!_0x1e52bf[0x0][_0xbcc9('0x19')]){return analyticExtractedReport(_0xbcc9('0x1a'));}var _0x2bfc3b=[];var _0x1f9449=0x0;if(_0x2bd3d7[_0xbcc9('0x12')]){if(_0x1e52bf&&_0x1e52bf[_0xbcc9('0x1b')]){var _0x393434=_[_0xbcc9('0x1c')](_0x1e52bf[0x0][_0xbcc9('0x19')]/_0x53ba52);var _0x1e5326=Number[_0xbcc9('0x1d')](_0x1e52bf[0x0][_0xbcc9('0x19')]/_0x53ba52)?_0x1e52bf[0x0][_0xbcc9('0x19')]%_0x53ba52:0x0;_0x393434['forEach'](function(_0x5d93df){if(_0x5d93df>0x0){_0x1f9449+=_0x53ba52;}_0x2bfc3b['push'](dbH[_0xbcc9('0x15')][_0xbcc9('0x16')](util[_0xbcc9('0xe')](_0xbcc9('0x1e'),QUERY,_0x53ba52,_0x1f9449),{'type':dbH[_0xbcc9('0x15')][_0xbcc9('0x1f')]['SELECT']}));});if(_0x1e5326>0x0){_0x1f9449+=_0x53ba52;_0x2bfc3b[_0xbcc9('0x20')](dbH[_0xbcc9('0x15')][_0xbcc9('0x16')](util[_0xbcc9('0xe')](_0xbcc9('0x1e'),QUERY,_0x1e5326,_0x1f9449),{'type':dbH[_0xbcc9('0x15')][_0xbcc9('0x1f')][_0xbcc9('0x18')]}));}}}else{_0x2bfc3b[_0xbcc9('0x20')](dbH['sequelize'][_0xbcc9('0x16')](QUERY,{'type':dbH[_0xbcc9('0x15')][_0xbcc9('0x1f')][_0xbcc9('0x18')]}));}var _0x567762=path[_0xbcc9('0x21')](PATH);var _0x3586b4=path[_0xbcc9('0x22')](PATH,_0xbcc9('0x23'));var _0x48361d=_0x2bd3d7[_0xbcc9('0x12')]&&_0x2bfc3b[_0xbcc9('0x1b')]>0x1;var _0xfdaef3=[];if(!fs['existsSync'](path[_0xbcc9('0x24')](_0x567762,_0x3586b4))&&_0x48361d){fs['mkdirSync'](path[_0xbcc9('0x24')](_0x567762,_0x3586b4));}return BPromise[_0xbcc9('0x25')](_0x2bfc3b,function(_0x3c115b){_0xfdaef3[_0xbcc9('0x20')](_0x3c115b);})[_0xbcc9('0x13')](function(){for(var _0x431986=0x0;_0x431986<_0xfdaef3[_0xbcc9('0x1b')];_0x431986+=0x1){var _0x1e9298;var _0x2f8596=_0xfdaef3[_0x431986];if(_0x48361d){_0x1e9298=path[_0xbcc9('0x24')](_0x567762,_0x3586b4,util[_0xbcc9('0xe')](_0xbcc9('0x26'),_0x3586b4,_0x431986,_0xbcc9('0x27')));}else{_0x1e9298=path[_0xbcc9('0x24')](_0x567762,util[_0xbcc9('0xe')](_0xbcc9('0x28'),_0x3586b4,_0xbcc9('0x27')));}fs[_0xbcc9('0x29')](_0x1e9298,json2xls(_0x2f8596),'binary');}})[_0xbcc9('0x13')](function(){if(_0x48361d){return new Promise(function(_0x4756f1){zipdir(path['join'](_0x567762,_0x3586b4),{'saveTo':path[_0xbcc9('0x24')](_0x567762,util[_0xbcc9('0xe')](_0xbcc9('0x28'),_0x3586b4,_0xbcc9('0x2a')))},function(_0x950b24,_0x87b09c){rimraf(path[_0xbcc9('0x24')](_0x567762,_0x3586b4),function(){});_0x4756f1(_0xbcc9('0x2b'));});});}})[_0xbcc9('0x13')](function(){logger[_0xbcc9('0xd')](util[_0xbcc9('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xbcc9('0xf')));return analyticExtractedReport('Completed',_0x48361d?util['format'](_0xbcc9('0x28'),_0x3586b4,_0x48361d?_0xbcc9('0x2a'):_0xbcc9('0x27')):null);});})[_0xbcc9('0x2c')](function(_0x4d378f){logger['info'](util[_0xbcc9('0xe')](_0xbcc9('0x2d'),EXTRACTED_REPORT_ID,_0xbcc9('0xf')),util[_0xbcc9('0x2e')](_0x4d378f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbcc9('0x2f'));})[_0xbcc9('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xff6e=['lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','info','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','path'];(function(_0x58ae9e,_0x39ba10){var _0x2a9eee=function(_0x174314){while(--_0x174314){_0x58ae9e['push'](_0x58ae9e['shift']());}};_0x2a9eee(++_0x39ba10);}(_0xff6e,0x131));var _0xeff6=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xff6e[_0xfedc72];return _0x2c7c78;};'use strict';var util=require('util');var path=require(_0xeff6('0x0'));var _=require(_0xeff6('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xeff6('0x2'));var zipdir=require(_0xeff6('0x3'));var rimraf=require(_0xeff6('0x4'));var db=require(_0xeff6('0x5'))['db'];var dbH=require(_0xeff6('0x5'))[_0xeff6('0x6')];var logger=require(_0xeff6('0x7'))(_0xeff6('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xeff6('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x240d36,_0x3e2a78){var _0x652051={'status':_0x240d36};var _0x1152b0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3e2a78){_0x652051[_0xeff6('0xa')]=_0x3e2a78;}return db['AnalyticExtractedReport'][_0xeff6('0xb')](_0x652051,_0x1152b0);}function main(){var _0x1b7ac3=0x1388;var _0x3e6a50;logger['info'](util[_0xeff6('0xc')](_0xeff6('0xd'),EXTRACTED_REPORT_ID,_0xeff6('0xe')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xeff6('0xf'),_0xeff6('0x10')]})['then'](function(_0x56b710){if(_0x56b710){_0x3e6a50=_0x56b710;_0x1b7ac3=_0x3e6a50[_0xeff6('0x10')]||0x1388;}})[_0xeff6('0x11')](function(){return dbH[_0xeff6('0x12')][_0xeff6('0x13')](util[_0xeff6('0xc')](_0xeff6('0x14'),QUERY),{'type':dbH[_0xeff6('0x12')][_0xeff6('0x15')][_0xeff6('0x16')]});})[_0xeff6('0x11')](function(_0x17e4b7){if(!_0x17e4b7[0x0][_0xeff6('0x17')]){return analyticExtractedReport(_0xeff6('0x18'));}var _0x7848c2=[];var _0x4fdd00=0x0;if(_0x3e6a50['split']){if(_0x17e4b7&&_0x17e4b7[_0xeff6('0x19')]){var _0x86c59=_[_0xeff6('0x1a')](_0x17e4b7[0x0][_0xeff6('0x17')]/_0x1b7ac3);var _0x48c548=Number[_0xeff6('0x1b')](_0x17e4b7[0x0][_0xeff6('0x17')]/_0x1b7ac3)?_0x17e4b7[0x0][_0xeff6('0x17')]%_0x1b7ac3:0x0;_0x86c59[_0xeff6('0x1c')](function(_0x492b81){if(_0x492b81>0x0){_0x4fdd00+=_0x1b7ac3;}_0x7848c2[_0xeff6('0x1d')](dbH[_0xeff6('0x12')][_0xeff6('0x13')](util[_0xeff6('0xc')](_0xeff6('0x1e'),QUERY,_0x1b7ac3,_0x4fdd00),{'type':dbH[_0xeff6('0x12')][_0xeff6('0x15')][_0xeff6('0x16')]}));});if(_0x48c548>0x0){_0x4fdd00+=_0x1b7ac3;_0x7848c2[_0xeff6('0x1d')](dbH[_0xeff6('0x12')][_0xeff6('0x13')](util[_0xeff6('0xc')](_0xeff6('0x1e'),QUERY,_0x48c548,_0x4fdd00),{'type':dbH[_0xeff6('0x12')][_0xeff6('0x15')][_0xeff6('0x16')]}));}}}else{_0x7848c2[_0xeff6('0x1d')](dbH[_0xeff6('0x12')][_0xeff6('0x13')](QUERY,{'type':dbH[_0xeff6('0x12')][_0xeff6('0x15')][_0xeff6('0x16')]}));}var _0xb0d40c=path[_0xeff6('0x1f')](PATH);var _0x246a6a=path[_0xeff6('0x20')](PATH,_0xeff6('0x21'));var _0x2caa96=_0x3e6a50['split']&&_0x7848c2[_0xeff6('0x19')]>0x1;var _0xdc49a5=[];if(!fs[_0xeff6('0x22')](path[_0xeff6('0x23')](_0xb0d40c,_0x246a6a))&&_0x2caa96){fs[_0xeff6('0x24')](path[_0xeff6('0x23')](_0xb0d40c,_0x246a6a));}return BPromise[_0xeff6('0x25')](_0x7848c2,function(_0x4a76ac){_0xdc49a5[_0xeff6('0x1d')](_0x4a76ac);})[_0xeff6('0x11')](function(){for(var _0x7ca055=0x0;_0x7ca055<_0xdc49a5[_0xeff6('0x19')];_0x7ca055+=0x1){var _0x46788a;var _0x507451=_0xdc49a5[_0x7ca055];if(_0x2caa96){_0x46788a=path['join'](_0xb0d40c,_0x246a6a,util['format'](_0xeff6('0x26'),_0x246a6a,_0x7ca055,_0xeff6('0x27')));}else{_0x46788a=path[_0xeff6('0x23')](_0xb0d40c,util[_0xeff6('0xc')](_0xeff6('0x28'),_0x246a6a,_0xeff6('0x27')));}fs[_0xeff6('0x29')](_0x46788a,json2xls(_0x507451),_0xeff6('0x2a'));}})['then'](function(){if(_0x2caa96){return new Promise(function(_0x4d8660){zipdir(path[_0xeff6('0x23')](_0xb0d40c,_0x246a6a),{'saveTo':path[_0xeff6('0x23')](_0xb0d40c,util[_0xeff6('0xc')](_0xeff6('0x28'),_0x246a6a,_0xeff6('0x2b')))},function(_0x181c3c,_0x195367){rimraf(path[_0xeff6('0x23')](_0xb0d40c,_0x246a6a),function(){});_0x4d8660(_0xeff6('0x2c'));});});}})[_0xeff6('0x11')](function(){logger[_0xeff6('0x2d')](util[_0xeff6('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xeff6('0x2e'),_0x2caa96?util[_0xeff6('0xc')](_0xeff6('0x28'),_0x246a6a,_0x2caa96?_0xeff6('0x2b'):_0xeff6('0x27')):null);});})[_0xeff6('0x2f')](function(_0x177ed2){logger[_0xeff6('0x2d')](util[_0xeff6('0xc')](_0xeff6('0x30'),EXTRACTED_REPORT_ID,_0xeff6('0xe')),util['inspect'](_0x177ed2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xeff6('0x31'));})[_0xeff6('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index c6b7a6b..6e395a2 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 _0x6c05=['Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','push','outbound','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','catch','error','rewrite','models','Interval','intervals','VoiceExtension','findAll','IntervalId','map','then','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','exten','type'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x6c05,0xc6));var _0x56c0=function(_0x241a5f,_0x33fac7){_0x241a5f=_0x241a5f-0x0;var _0x2970fc=_0x6c05[_0x241a5f];return _0x2970fc;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x3a235d,_0xd18dbf){var _0x22d661=this;return _0x3a235d[_0x56c0('0x0')][_0x56c0('0x1')]['findAll']({'raw':!![]})['then'](function(_0x143eef){_0x22d661[_0x56c0('0x2')]=_0x143eef;return _0x3a235d['models'][_0x56c0('0x3')][_0x56c0('0x4')]({'where':{'IntervalId':_0xd18dbf[_0x56c0('0x5')]},'raw':!![]});})['then'](function(_0x142034){return _0x3a235d[_0x56c0('0x0')][_0x56c0('0x3')][_0x56c0('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x56c0('0x6')](_0x142034,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x56c0('0x7')](function(_0x32c3ea){var _0x3e8603=_[_0x56c0('0x8')](_0x32c3ea,{'priority':'1'});var _0x2d5b94=_[_0x56c0('0x8')](_0x32c3ea,{'isApp':0x1});var _0x4190fe=_[_0x56c0('0x9')](_0x2d5b94,'exten');var _0x41baa5=['queue',_0x56c0('0xa')];var _0x1af06e=[];var _0x26ce65=[];for(var _0x2d0d1f in _0x4190fe){if(_0x4190fe[_0x56c0('0xb')](_0x2d0d1f)){_0x22d661[_0x56c0('0xc')]=0x2;_0x22d661[_0x56c0('0xd')]=[];_0x22d661[_0x56c0('0xe')]=_[_0x56c0('0xf')](_0x3e8603,{'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')]});_0x22d661[_0x56c0('0xd')]['push']({'type':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')],'app':_0x56c0('0x12'),'appdata':util[_0x56c0('0x13')](_0x56c0('0x14'),_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')]),'context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')],'priority':_0x22d661[_0x56c0('0xc')]++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});if(_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')]===_0x56c0('0x17')){_0x22d661[_0x56c0('0xd')][_0x56c0('0x18')]({'type':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')],'app':_0x56c0('0x12'),'appdata':'CDR(routeid)='+_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')],'context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'exten':_0x4190fe[_0x2d0d1f][0x0]['exten'],'priority':_0x22d661[_0x56c0('0xc')]++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});}else if(_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')]===_0x56c0('0x19')){if(_0x22d661[_0x56c0('0xe')]){_0x22d661['extensions'][_0x56c0('0x18')]({'type':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')],'app':_0x56c0('0x12'),'appdata':_0x56c0('0x1a')+(_0x22d661['extension'][_0x56c0('0x1b')]?'${EXTEN:'+_0x22d661[_0x56c0('0xe')][_0x56c0('0x1b')]+'}':_0x56c0('0x1c')),'context':_0x4190fe[_0x2d0d1f][0x0]['context'],'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')],'priority':_0x22d661['priority']++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});}_0x22d661[_0x56c0('0xd')][_0x56c0('0x18')]({'type':_0x4190fe[_0x2d0d1f][0x0]['type'],'app':_0x56c0('0x12'),'appdata':_0x56c0('0x1d')+_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')],'context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'exten':_0x4190fe[_0x2d0d1f][0x0]['exten'],'priority':_0x22d661[_0x56c0('0xc')]++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});var _0x44deab=_0x22d661[_0x56c0('0xc')]++;_0x22d661[_0x56c0('0xd')]['push']({'type':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')],'app':_0x56c0('0x1e'),'appdata':_0x56c0('0x1f')+(_0x44deab+0x2)+_0x56c0('0x20')+(_0x44deab+0x1)+')','context':_0x4190fe[_0x2d0d1f][0x0]['context'],'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')],'priority':_0x44deab,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});if(_0x22d661['extension']){_0x22d661[_0x56c0('0xd')]['push']({'type':_0x4190fe[_0x2d0d1f][0x0]['type'],'app':_0x56c0('0x12'),'appdata':_0x22d661[_0x56c0('0xe')][_0x56c0('0x1b')]?_0x56c0('0x21')+_0x22d661[_0x56c0('0xe')][_0x56c0('0x1b')]+'}':_0x56c0('0x22'),'context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')],'priority':_0x22d661[_0x56c0('0xc')]++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});}_0x22d661[_0x56c0('0xd')][_0x56c0('0x18')]({'type':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')],'app':'Set','appdata':_0x56c0('0x23')+_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')],'context':_0x4190fe[_0x2d0d1f][0x0]['context'],'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')],'priority':_0x22d661[_0x56c0('0xc')]++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});if(_0x22d661['extension']&&_0x22d661[_0x56c0('0xe')][_0x56c0('0xb')](_0x56c0('0x24'))&&_0x22d661['extension'][_0x56c0('0x24')]!==_0x56c0('0x25')){_0x22d661[_0x56c0('0xd')]['push']({'type':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')],'app':_0x56c0('0x12'),'appdata':_0x56c0('0x26'),'context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'exten':_0x4190fe[_0x2d0d1f][0x0]['exten'],'priority':_0x22d661['priority']++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0]['VoiceExtensionId']});_0x22d661[_0x56c0('0xd')][_0x56c0('0x18')]({'type':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')],'app':'Set','appdata':_0x56c0('0x27')+_0x22d661[_0x56c0('0xe')][_0x56c0('0x24')]||_0x56c0('0x28'),'context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')],'priority':_0x22d661[_0x56c0('0xc')]++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});}}_0x22d661[_0x56c0('0xd')]['push']({'type':_0x4190fe[_0x2d0d1f][0x0]['type'],'app':_0x56c0('0x12'),'appdata':_0x56c0('0x29'),'context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')],'priority':_0x22d661[_0x56c0('0xc')]++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});_0x22d661[_0x56c0('0xd')][_0x56c0('0x18')]({'type':_0x4190fe[_0x2d0d1f][0x0]['type'],'app':_0x56c0('0x12'),'appdata':_0x56c0('0x2a'),'context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')],'priority':_0x22d661[_0x56c0('0xc')]++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});_0x22d661[_0x56c0('0xd')][_0x56c0('0x18')]({'type':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')],'app':_0x56c0('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'exten':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x10')],'priority':_0x22d661['priority']++,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});for(var _0x28ff1c=0x0,_0x4186b6=0x0;_0x28ff1c<_0x4190fe[_0x2d0d1f][_0x56c0('0x2b')];_0x28ff1c+=0x1,_0x4186b6=0x0){var _0xe16ec0=_0x4190fe[_0x2d0d1f][_0x28ff1c];if(_0xe16ec0['type']){_0xe16ec0[_0x56c0('0x11')]=_0xe16ec0[_0x56c0('0x11')][_0x56c0('0x2c')]();}var _0x2f3c8d=[];var _0x51e801=[];delete _0xe16ec0['id'];delete _0xe16ec0[_0x56c0('0x2d')];delete _0xe16ec0[_0x56c0('0x2e')];var _0x2f8e7b=_0xe16ec0[_0x56c0('0x2f')]!==_0x56c0('0x30')?[_0xe16ec0[_0x56c0('0x2f')]]:_0xe16ec0['IntervalId']?_['map'](_[_0x56c0('0x8')](_0x22d661[_0x56c0('0x2')],{'IntervalId':_0xe16ec0[_0x56c0('0x5')]}),'interval'):[];if(_0xe16ec0[_0x56c0('0xb')]('tag')){if(_0xe16ec0[_0x56c0('0x31')]&&_0xe16ec0[_0x56c0('0x31')]!=='--'){_0x2f3c8d[_0x56c0('0x18')]({'type':_0xe16ec0[_0x56c0('0x11')],'app':_0x56c0('0x12'),'appdata':_0x56c0('0x32')+_0xe16ec0[_0x56c0('0x31')],'context':_0xe16ec0['context'],'exten':_0xe16ec0[_0x56c0('0x10')],'priority':_0x2f8e7b['length']+_0x22d661[_0x56c0('0xc')]+_0x4186b6++,'VoiceExtensionId':_0xe16ec0['VoiceExtensionId']});}}if(_0xe16ec0[_0x56c0('0x11')]===_0x56c0('0x19')&&_0xe16ec0[_0x56c0('0xb')](_0x56c0('0x33'))){if(_0xe16ec0[_0x56c0('0x33')]){_0x2f3c8d[_0x56c0('0x18')]({'type':_0xe16ec0['type'],'app':_0x56c0('0x1e'),'appdata':_0x56c0('0x34')+_0xe16ec0[_0x56c0('0x33')]+')','context':_0xe16ec0[_0x56c0('0x15')],'exten':_0xe16ec0['exten'],'priority':_0x2f8e7b[_0x56c0('0x2b')]+_0x22d661[_0x56c0('0xc')]+_0x4186b6++,'VoiceExtensionId':_0xe16ec0['VoiceExtensionId']});}else{_0x2f3c8d[_0x56c0('0x18')]({'type':_0xe16ec0['type'],'app':_0x56c0('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0xe16ec0[_0x56c0('0x15')],'exten':_0xe16ec0[_0x56c0('0x10')],'priority':_0x2f8e7b['length']+_0x22d661[_0x56c0('0xc')]+_0x4186b6++,'VoiceExtensionId':_0xe16ec0[_0x56c0('0x16')]});}}if(_0xe16ec0[_0x56c0('0xb')](_0x56c0('0x35'))){if(_0x41baa5[_0x56c0('0x36')](_0xe16ec0['app'][_0x56c0('0x2c')]())>=0x0&&_0xe16ec0[_0x56c0('0x37')]!==_0x56c0('0x38')){if(_0xe16ec0['answer']){_0x2f3c8d['push']({'type':_0xe16ec0[_0x56c0('0x11')],'app':_0x56c0('0x1e'),'appdata':_0x56c0('0x39'),'context':_0xe16ec0[_0x56c0('0x15')],'exten':_0xe16ec0[_0x56c0('0x10')],'priority':_0x2f8e7b[_0x56c0('0x2b')]+_0x22d661[_0x56c0('0xc')]+_0x4186b6++,'VoiceExtensionId':_0xe16ec0['VoiceExtensionId']});_0x2f3c8d['push']({'type':_0xe16ec0['type'],'app':_0x56c0('0x12'),'appdata':_0x56c0('0x3a'),'context':_0xe16ec0[_0x56c0('0x15')],'exten':_0xe16ec0[_0x56c0('0x10')],'priority':_0x2f8e7b[_0x56c0('0x2b')]+_0x22d661[_0x56c0('0xc')]+_0x4186b6++,'VoiceExtensionId':_0xe16ec0[_0x56c0('0x16')]});}else{_0x2f3c8d[_0x56c0('0x18')]({'type':_0xe16ec0[_0x56c0('0x11')],'app':_0x56c0('0x1e'),'appdata':_0x56c0('0x3b'),'context':_0xe16ec0['context'],'exten':_0xe16ec0[_0x56c0('0x10')],'priority':_0x2f8e7b['length']+_0x22d661['priority']+_0x4186b6++,'VoiceExtensionId':_0xe16ec0['VoiceExtensionId']});_0x2f3c8d[_0x56c0('0x18')]({'type':_0xe16ec0[_0x56c0('0x11')],'app':_0x56c0('0x12'),'appdata':_0x56c0('0x3c'),'context':_0xe16ec0[_0x56c0('0x15')],'exten':_0xe16ec0[_0x56c0('0x10')],'priority':_0x2f8e7b['length']+_0x22d661[_0x56c0('0xc')]+_0x4186b6++,'VoiceExtensionId':_0xe16ec0['VoiceExtensionId']});}}}for(var _0x59d192=0x0;_0x59d192<_0x2f8e7b[_0x56c0('0x2b')];_0x59d192+=0x1){var _0x433144=_0x22d661[_0x56c0('0xc')]+_0x2f8e7b[_0x56c0('0x2b')];var _0x441cfd=_0x59d192===_0x2f8e7b[_0x56c0('0x2b')]-0x1?_0x22d661[_0x56c0('0xc')]+_0x2f3c8d[_0x56c0('0x2b')]+_0x51e801[_0x56c0('0x2b')]+0x2:_0x22d661[_0x56c0('0xc')]+_0x59d192+0x1;_0x2f3c8d[_0x56c0('0x3d')](_0x59d192,0x0,{'type':_0xe16ec0[_0x56c0('0x11')],'app':_0x56c0('0x3e'),'appdata':_0x2f8e7b[_0x59d192]+'?'+_0xe16ec0[_0x56c0('0x15')]+_0x56c0('0x3f')+_0x433144+':'+_0xe16ec0[_0x56c0('0x15')]+_0x56c0('0x3f')+_0x441cfd,'exten':_0xe16ec0[_0x56c0('0x10')],'context':_0xe16ec0['context'],'priority':_0x22d661[_0x56c0('0xc')]+_0x59d192,'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});}_0xe16ec0[_0x56c0('0xc')]=_0x2f3c8d['length']?_[_0x56c0('0x40')](_0x2f3c8d)['priority']+0x1:_0x22d661[_0x56c0('0xc')];_0x22d661[_0x56c0('0xc')]=(_0x51e801[_0x56c0('0x2b')]?_[_0x56c0('0x40')](_0x51e801)['priority']:_0xe16ec0[_0x56c0('0xc')])+0x1;_0x22d661['extensions']=_[_0x56c0('0x41')](_0x22d661[_0x56c0('0xd')],_0x2f3c8d,[_0xe16ec0],_0x51e801);}_0x22d661[_0x56c0('0xd')][_0x56c0('0x18')]({'type':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x11')],'app':_0x56c0('0x42'),'exten':_0x4190fe[_0x2d0d1f][0x0]['exten'],'context':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x15')],'priority':_0x22d661[_0x56c0('0xc')],'VoiceExtensionId':_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]});_0x1af06e['push'](_0x4190fe[_0x2d0d1f][0x0][_0x56c0('0x16')]);_0x26ce65=_['concat'](_0x26ce65,_0x22d661['extensions']);}}return _0x3a235d[_0x56c0('0x43')](function(_0x39dd95){return _0x3a235d['models']['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x1af06e}},'transaction':_0x39dd95})[_0x56c0('0x7')](function(_0x110b5f){return _0x3a235d['models']['VoiceExtension'][_0x56c0('0x44')](_['sortBy'](_0x26ce65,_0x56c0('0xc')),{'transaction':_0x39dd95});});});})[_0x56c0('0x45')](function(_0x99664){console[_0x56c0('0x46')](_0x99664);});}exports[_0x56c0('0x47')]=rewrite; \ No newline at end of file +var _0xdd7a=['outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','map','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','lodash','util','models','findAll','then','intervals','IntervalId','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','CDR(routeid)='];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0xdd7a,0xbd));var _0xadd7=function(_0x418800,_0x24503e){_0x418800=_0x418800-0x0;var _0x568bd9=_0xdd7a[_0x418800];return _0x568bd9;};'use strict';var _=require(_0xadd7('0x0'));var util=require(_0xadd7('0x1'));function rewrite(_0x59f072,_0x135679){var _0x29c526=this;return _0x59f072[_0xadd7('0x2')]['Interval'][_0xadd7('0x3')]({'raw':!![]})[_0xadd7('0x4')](function(_0x336662){_0x29c526[_0xadd7('0x5')]=_0x336662;return _0x59f072[_0xadd7('0x2')]['VoiceExtension'][_0xadd7('0x3')]({'where':{'IntervalId':_0x135679[_0xadd7('0x6')]},'raw':!![]});})['then'](function(_0x17aba0){return _0x59f072[_0xadd7('0x2')][_0xadd7('0x7')][_0xadd7('0x3')]({'where':{'exten':{'$in':_[_0xadd7('0x8')](_['map'](_0x17aba0,_0xadd7('0x9')))}},'order':[{'raw':_0xadd7('0xa')}],'raw':!![]});})[_0xadd7('0x4')](function(_0x155fe3){var _0x3d5acc=_['filter'](_0x155fe3,{'priority':'1'});var _0x593923=_[_0xadd7('0xb')](_0x155fe3,{'isApp':0x1});var _0x4936d2=_[_0xadd7('0xc')](_0x593923,_0xadd7('0x9'));var _0x428eda=['queue',_0xadd7('0xd')];var _0x411ad3=[];var _0x46f2c6=[];for(var _0x305062 in _0x4936d2){if(_0x4936d2['hasOwnProperty'](_0x305062)){_0x29c526['priority']=0x2;_0x29c526[_0xadd7('0xe')]=[];_0x29c526[_0xadd7('0xf')]=_[_0xadd7('0x10')](_0x3d5acc,{'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')]});_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':util[_0xadd7('0x14')](_0xadd7('0x15'),_0x4936d2[_0x305062][0x0]['type']),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0]['exten'],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});if(_0x4936d2[_0x305062][0x0][_0xadd7('0x12')]===_0xadd7('0x19')){_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x1a')+_0x4936d2[_0x305062][0x0][_0xadd7('0x18')],'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});}else if(_0x4936d2[_0x305062][0x0]['type']===_0xadd7('0x1b')){if(_0x29c526['extension']){_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0]['type'],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x1c')+(_0x29c526[_0xadd7('0xf')][_0xadd7('0x1d')]?_0xadd7('0x1e')+_0x29c526[_0xadd7('0xf')][_0xadd7('0x1d')]+'}':_0xadd7('0x1f')),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});}_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':'Set','appdata':_0xadd7('0x1a')+_0x4936d2[_0x305062][0x0][_0xadd7('0x18')],'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526['priority']++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});var _0x4a5ee1=_0x29c526[_0xadd7('0x17')]++;_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0]['type'],'app':_0xadd7('0x20'),'appdata':_0xadd7('0x21')+(_0x4a5ee1+0x2)+_0xadd7('0x22')+(_0x4a5ee1+0x1)+')','context':_0x4936d2[_0x305062][0x0]['context'],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x4a5ee1,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});if(_0x29c526[_0xadd7('0xf')]){_0x29c526['extensions'][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0]['type'],'app':_0xadd7('0x13'),'appdata':_0x29c526[_0xadd7('0xf')][_0xadd7('0x1d')]?_0xadd7('0x23')+_0x29c526['extension'][_0xadd7('0x1d')]+'}':_0xadd7('0x24'),'context':_0x4936d2[_0x305062][0x0]['context'],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0]['VoiceExtensionId']});}_0x29c526['extensions']['push']({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':'outboundrouteid='+_0x4936d2[_0x305062][0x0][_0xadd7('0x18')],'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0]['VoiceExtensionId']});if(_0x29c526[_0xadd7('0xf')]&&_0x29c526['extension'][_0xadd7('0x25')]('recordingFormat')&&_0x29c526[_0xadd7('0xf')][_0xadd7('0x26')]!==_0xadd7('0x27')){_0x29c526[_0xadd7('0xe')]['push']({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x28'),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526['priority']++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0]['type'],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x29')+_0x29c526[_0xadd7('0xf')][_0xadd7('0x26')]||_0xadd7('0x2a'),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0]['VoiceExtensionId']});}}_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x2b'),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});_0x29c526[_0xadd7('0xe')]['push']({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':'Set','appdata':_0xadd7('0x2c'),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x2d'),'context':_0x4936d2[_0x305062][0x0]['context'],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});for(var _0x55f49b=0x0,_0x2606e0=0x0;_0x55f49b<_0x4936d2[_0x305062]['length'];_0x55f49b+=0x1,_0x2606e0=0x0){var _0x5e5942=_0x4936d2[_0x305062][_0x55f49b];if(_0x5e5942[_0xadd7('0x12')]){_0x5e5942['type']=_0x5e5942[_0xadd7('0x12')][_0xadd7('0x2e')]();}var _0x26ffe1=[];var _0x56abf8=[];delete _0x5e5942['id'];delete _0x5e5942[_0xadd7('0x2f')];delete _0x5e5942[_0xadd7('0x30')];var _0x517284=_0x5e5942[_0xadd7('0x31')]!=='*,*,*,*'?[_0x5e5942[_0xadd7('0x31')]]:_0x5e5942[_0xadd7('0x6')]?_[_0xadd7('0x32')](_[_0xadd7('0xb')](_0x29c526[_0xadd7('0x5')],{'IntervalId':_0x5e5942[_0xadd7('0x6')]}),_0xadd7('0x31')):[];if(_0x5e5942[_0xadd7('0x25')]('tag')){if(_0x5e5942[_0xadd7('0x33')]&&_0x5e5942[_0xadd7('0x33')]!=='--'){_0x26ffe1['push']({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':'CDR(tag)='+_0x5e5942[_0xadd7('0x33')],'context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});}}if(_0x5e5942[_0xadd7('0x12')]===_0xadd7('0x1b')&&_0x5e5942[_0xadd7('0x25')](_0xadd7('0x35'))){if(_0x5e5942['callerID']){_0x26ffe1['push']({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x20'),'appdata':_0xadd7('0x36')+_0x5e5942[_0xadd7('0x35')]+')','context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942['VoiceExtensionId']});}else{_0x26ffe1[_0xadd7('0x11')]({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5e5942['context'],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});}}if(_0x5e5942[_0xadd7('0x25')](_0xadd7('0x37'))){if(_0x428eda[_0xadd7('0x38')](_0x5e5942[_0xadd7('0x39')][_0xadd7('0x2e')]())>=0x0&&_0x5e5942[_0xadd7('0x3a')]!=='custom'){if(_0x5e5942[_0xadd7('0x37')]){_0x26ffe1['push']({'type':_0x5e5942['type'],'app':_0xadd7('0x20'),'appdata':_0xadd7('0x3b'),'context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526['priority']+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});_0x26ffe1['push']({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284['length']+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942['VoiceExtensionId']});}else{_0x26ffe1[_0xadd7('0x11')]({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284['length']+_0x29c526['priority']+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});_0x26ffe1['push']({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x3c'),'context':_0x5e5942['context'],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});}}}for(var _0x1a7d64=0x0;_0x1a7d64<_0x517284[_0xadd7('0x34')];_0x1a7d64+=0x1){var _0x11df37=_0x29c526[_0xadd7('0x17')]+_0x517284[_0xadd7('0x34')];var _0x4e51c3=_0x1a7d64===_0x517284[_0xadd7('0x34')]-0x1?_0x29c526[_0xadd7('0x17')]+_0x26ffe1[_0xadd7('0x34')]+_0x56abf8[_0xadd7('0x34')]+0x2:_0x29c526[_0xadd7('0x17')]+_0x1a7d64+0x1;_0x26ffe1[_0xadd7('0x3d')](_0x1a7d64,0x0,{'type':_0x5e5942['type'],'app':_0xadd7('0x3e'),'appdata':_0x517284[_0x1a7d64]+'?'+_0x5e5942[_0xadd7('0x16')]+_0xadd7('0x3f')+_0x11df37+':'+_0x5e5942[_0xadd7('0x16')]+_0xadd7('0x3f')+_0x4e51c3,'exten':_0x5e5942[_0xadd7('0x9')],'context':_0x5e5942[_0xadd7('0x16')],'priority':_0x29c526[_0xadd7('0x17')]+_0x1a7d64,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});}_0x5e5942[_0xadd7('0x17')]=_0x26ffe1['length']?_[_0xadd7('0x40')](_0x26ffe1)['priority']+0x1:_0x29c526[_0xadd7('0x17')];_0x29c526['priority']=(_0x56abf8[_0xadd7('0x34')]?_['last'](_0x56abf8)[_0xadd7('0x17')]:_0x5e5942['priority'])+0x1;_0x29c526[_0xadd7('0xe')]=_[_0xadd7('0x41')](_0x29c526[_0xadd7('0xe')],_0x26ffe1,[_0x5e5942],_0x56abf8);}_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':'Hangup','exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'priority':_0x29c526['priority'],'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});_0x411ad3[_0xadd7('0x11')](_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]);_0x46f2c6=_[_0xadd7('0x41')](_0x46f2c6,_0x29c526[_0xadd7('0xe')]);}}return _0x59f072[_0xadd7('0x42')](function(_0x15a246){return _0x59f072['models'][_0xadd7('0x7')][_0xadd7('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x411ad3}},'transaction':_0x15a246})['then'](function(_0xfb345){return _0x59f072[_0xadd7('0x2')][_0xadd7('0x7')][_0xadd7('0x44')](_[_0xadd7('0x45')](_0x46f2c6,_0xadd7('0x17')),{'transaction':_0x15a246});});});})[_0xadd7('0x46')](function(_0x2ccab9){console[_0xadd7('0x47')](_0x2ccab9);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 8f776eb..c052904 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 _0x4513=['createReadStream','parse','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','error','errors','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','CompanyId','length','find','duplicate','CmContact','then','push','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','checkHopper','inspect','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','field','NOW()','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','select','\x20=\x20?','insert','into','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','VoiceQueue','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','get','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!'];(function(_0x2ec69e,_0x5d54b4){var _0x134936=function(_0x10bb3a){while(--_0x10bb3a){_0x2ec69e['push'](_0x2ec69e['shift']());}};_0x134936(++_0x5d54b4);}(_0x4513,0x13c));var _0x3451=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4513[_0x465a0c];return _0x1e202e;};'use strict';var BPromise=require('bluebird');var util=require(_0x3451('0x0'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x3451('0x1'));var Redis=require(_0x3451('0x2'));var db=require(_0x3451('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x3451('0x4'))(_0x3451('0x5'));config[_0x3451('0x6')]=_[_0x3451('0x7')](config[_0x3451('0x6')],{'host':_0x3451('0x8'),'port':0x18eb});var socket=require(_0x3451('0x9'))(new Redis(config['redis']));require(_0x3451('0xa'))[_0x3451('0xb')](socket);try{if(!process[_0x3451('0xc')][0x2]||process[_0x3451('0xc')][0x2]===_0x3451('0xd')||process['argv'][0x2]===_0x3451('0xe')){throw new Error(_0x3451('0xf'));}var FILEPATH=process[_0x3451('0xc')][0x2];if(!process[_0x3451('0xc')][0x3]||process['argv'][0x3]===_0x3451('0xd')||process['argv'][0x3]===_0x3451('0xe')||!process[_0x3451('0xc')][0x4]||process[_0x3451('0xc')][0x4]===_0x3451('0xd')||process[_0x3451('0xc')][0x4]===_0x3451('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x3451('0x10')](process['argv'][0x3][_0x3451('0x11')](','),process['argv'][0x4][_0x3451('0x11')](','));if(!process[_0x3451('0xc')][0x5]||process[_0x3451('0xc')][0x5]==='undefined'||process[_0x3451('0xc')][0x5]===_0x3451('0xe')){throw new Error(_0x3451('0x12'));}var LISTID=process[_0x3451('0xc')][0x5];var COMPANYID=process[_0x3451('0xc')][0x6]&&process[_0x3451('0xc')][0x6]!==_0x3451('0xd')&&process[_0x3451('0xc')][0x6]!==_0x3451('0xe')?process[_0x3451('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x3451('0xc')][0x7]!==_0x3451('0xd')&&process[_0x3451('0xc')][0x7]!==_0x3451('0xe')?process[_0x3451('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0x3451('0xc')][0x8]===_0x3451('0xd')||process['argv'][0x8]===_0x3451('0xe')){throw new Error(_0x3451('0x13'));}var SOCKET_TIMESTAMP=process[_0x3451('0xc')][0x8];}catch(_0x5037db){logger['error'](_0x5037db);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(_0x191c8d,_0x57fef2,_0x487848,_0x16e2e3){var _0x296e60={'message':_0x57fef2};_0x296e60[_0x191c8d]=!![];if(_0x487848){_0x296e60[_0x3451('0x14')]=_0x487848;}if(_0x16e2e3){_0x296e60[_0x3451('0x15')]=_0x16e2e3;}return _0x296e60;}function isEmail(_0x511ce2){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))*$/[_0x3451('0x16')](_0x511ce2);}function checkRow(_0x41fdec,_0x52b4d1,_0x4667a1){return new BPromise(function(_0x378cf8,_0xdebd7e){if(_['isNil'](_0x41fdec)){return _0xdebd7e(handleCheckRowError(_0x3451('0x17'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4667a1));}if(_0x41fdec[_0x3451('0x18')]&&_0x41fdec[_0x3451('0x18')]['length']){var _0x48fd34=_['map'](_0x41fdec[_0x3451('0x18')],'message')[_0x3451('0x19')](';');return _0xdebd7e(handleCheckRowError(_0x3451('0x17'),_0x48fd34,null,_0x4667a1));}var _0x2fadee={};for(var _0x2eaa38 in FIELDS){if(FIELDS[_0x3451('0x1a')](_0x2eaa38)&&FIELDS[_0x2eaa38]){_0x2fadee[_0x2eaa38]=_0x41fdec['data'][0x0][FIELDS[_0x2eaa38]]||_0x41fdec[_0x3451('0x1b')][0x0]['\ufeff'+FIELDS[_0x2eaa38]];}}if(!_0x2fadee[_0x3451('0x1c')]){return _0xdebd7e(handleCheckRowError(_0x3451('0x17'),_0x3451('0x1d'),null,_0x4667a1));}if(!_0x2fadee['phone']){return _0xdebd7e(handleCheckRowError(_0x3451('0x17'),'phone\x20not\x20specified!',null,_0x4667a1));}if(_0x2fadee[_0x3451('0x1e')]){var _0x5e8469=moment(_0x2fadee[_0x3451('0x1e')],'YYYY-MM-DD');if(!_0x5e8469['isValid']()){return _0xdebd7e(handleCheckRowError('error',_0x3451('0x1f'),null,_0x4667a1));}}if(_0x2fadee['email']){if(!isEmail(_0x2fadee['email'])){return _0xdebd7e(handleCheckRowError(_0x3451('0x17'),'email\x20format\x20is\x20not\x20valid!',null,_0x4667a1));}}_0x2fadee['ListId']=LISTID;_0x2fadee[_0x3451('0x20')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3451('0x21')]&&_0x52b4d1){var _0x453cd9={};for(var _0x261f62=0x0,_0x3c5859=DUPLICATES[_0x3451('0x21')];_0x261f62<_0x3c5859;_0x261f62+=0x1){_0x453cd9[DUPLICATES[_0x261f62]]=_0x2fadee[DUPLICATES[_0x261f62]];}var _0x1b4a11=_[_0x3451('0x22')](_0x52b4d1,_0x453cd9);if(_0x1b4a11){return _0xdebd7e(handleCheckRowError(_0x3451('0x23'),'Duplicate\x20Contact',_0x1b4a11,_0x4667a1));}}return db[_0x3451('0x24')]['create'](_0x2fadee,{'raw':!![],'hooks':![],'fields':_['keys'](_0x2fadee)})[_0x3451('0x25')](function(_0x5868ee){if(DUPLICATES&&DUPLICATES[_0x3451('0x21')]&&_0x52b4d1){_0x52b4d1[_0x3451('0x26')](_[_0x3451('0x27')](_0x2fadee,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5868ee['id'];return _0x378cf8();})['catch'](function(_0x2b056d){return _0xdebd7e(handleCheckRowError(_0x3451('0x17'),_0x3451('0x28')+(_0x2b056d[_0x3451('0x29')]||JSON[_0x3451('0x2a')](_0x2b056d)),null,_0x4667a1));});});}function checkHopper(){function _0xc5fb21(){return function(_0x22b45c){logger[_0x3451('0x17')]('cmContact',_0x3451('0x2b'),util[_0x3451('0x2c')](_0x22b45c,{'showHidden':![],'depth':null}));};}var _0x4a83c8=function(_0xd6eee6,_0x2046e0){var _0x3cc808=squel['insert']()['into'](_0x3451('0x2d'))[_0x3451('0x2e')]([_0x3451('0x2f'),_0x3451('0x30'),_0x3451('0x31'),_0x3451('0x32'),_0x2046e0,_0x3451('0x33'),'updatedAt'],squel['select']()['field'](_0x3451('0x2f'),_0x3451('0x2f'))[_0x3451('0x34')](_0x3451('0x35'),_0x3451('0x30'))['field']('id','ContactId')[_0x3451('0x34')](LISTID[_0x3451('0x36')](),_0x3451('0x32'))[_0x3451('0x34')](_0xd6eee6['id'][_0x3451('0x36')](),_0x2046e0)[_0x3451('0x34')](_0x3451('0x35'),_0x3451('0x33'))[_0x3451('0x34')]('NOW()',_0x3451('0x37'))[_0x3451('0x38')](_0x3451('0x39'))[_0x3451('0x3a')](_0x3451('0x3b'))[_0x3451('0x3a')](_0x3451('0x3c'),LISTID[_0x3451('0x36')]())[_0x3451('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0x3451('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3451('0x3d')]()[_0x3451('0x34')](_0x3451('0x2f'))['from'](_0x3451('0x2d'))[_0x3451('0x3a')](_0x2046e0+_0x3451('0x3e'),_0xd6eee6['id'][_0x3451('0x36')]())))[_0x3451('0x36')]();return _0x3cc808;};var _0x10b254=function(_0xc39ccf,_0x27f02a){var _0x13c97b=squel[_0x3451('0x3f')]()[_0x3451('0x40')](_0x3451('0x2d'))[_0x3451('0x2e')]([_0x3451('0x2f'),_0x3451('0x30'),_0x3451('0x31'),'ListId',_0x27f02a,_0x3451('0x33'),_0x3451('0x37')],squel[_0x3451('0x3d')]()[_0x3451('0x34')](_0x3451('0x2f'),_0x3451('0x2f'))[_0x3451('0x34')](_0x3451('0x35'),'scheduledAt')[_0x3451('0x34')]('id',_0x3451('0x31'))[_0x3451('0x34')](LISTID['toString'](),_0x3451('0x32'))[_0x3451('0x34')](_0xc39ccf['id'][_0x3451('0x36')](),_0x27f02a)['field'](_0x3451('0x35'),'createdAt')['field'](_0x3451('0x35'),_0x3451('0x37'))['from'](_0x3451('0x39'))[_0x3451('0x3a')](_0x3451('0x3b'))['where']('ListId\x20=\x20?',LISTID[_0x3451('0x36')]())[_0x3451('0x3a')](_0x3451('0x41'),squel[_0x3451('0x42')](hopperContacts))[_0x3451('0x3a')](_0x3451('0x43'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3451('0x3d')]()[_0x3451('0x34')](_0x3451('0x44'))[_0x3451('0x38')](_0x3451('0x45'))[_0x3451('0x3a')](_0x27f02a+_0x3451('0x3e'),_0xc39ccf['id'][_0x3451('0x36')]()))['where'](_0x3451('0x46'),squel[_0x3451('0x3d')]()[_0x3451('0x34')](_0x3451('0x2f'))[_0x3451('0x38')](_0x3451('0x2d'))[_0x3451('0x3a')](_0x27f02a+'\x20=\x20?',_0xc39ccf['id'][_0x3451('0x36')]())))[_0x3451('0x36')]();return _0x13c97b;};function _0x27a54d(_0x397a4b,_0x2fdd01){var _0x293e58=squel[_0x3451('0x3f')]()[_0x3451('0x40')]('cm_hopper')[_0x3451('0x2e')]([_0x3451('0x2f'),_0x3451('0x30'),'ContactId','ListId',_0x2fdd01,'createdAt','updatedAt'],squel[_0x3451('0x3d')]()[_0x3451('0x34')](_0x3451('0x2f'),_0x3451('0x2f'))[_0x3451('0x34')](_0x3451('0x35'),_0x3451('0x30'))[_0x3451('0x34')]('id',_0x3451('0x31'))[_0x3451('0x34')](LISTID['toString'](),_0x3451('0x32'))[_0x3451('0x34')](_0x397a4b['id'][_0x3451('0x36')](),_0x2fdd01)[_0x3451('0x34')]('NOW()',_0x3451('0x33'))[_0x3451('0x34')](_0x3451('0x35'),_0x3451('0x37'))[_0x3451('0x38')](_0x3451('0x39'))[_0x3451('0x3a')](_0x3451('0x3b'))['where'](_0x3451('0x3c'),LISTID[_0x3451('0x36')]())[_0x3451('0x3a')](_0x3451('0x41'),squel[_0x3451('0x42')](hopperContacts))[_0x3451('0x3a')](_0x3451('0x43')))[_0x3451('0x36')]();return _0x293e58;}function _0x2667da(_0x3b3ed7,_0x155d10){var _0x38425d=squel['insert']()['into'](_0x3451('0x47'))[_0x3451('0x2e')]([_0x3451('0x2f'),_0x3451('0x31'),_0x3451('0x32'),_0x155d10,'createdAt','updatedAt'],squel['select']()[_0x3451('0x34')](_0x3451('0x2f'),_0x3451('0x2f'))[_0x3451('0x34')]('id','ContactId')[_0x3451('0x34')](LISTID[_0x3451('0x36')](),_0x3451('0x32'))[_0x3451('0x34')](_0x3b3ed7['id'][_0x3451('0x36')](),_0x155d10)['field'](_0x3451('0x35'),'createdAt')[_0x3451('0x34')](_0x3451('0x35'),_0x3451('0x37'))['from'](_0x3451('0x39'))['where'](_0x3451('0x3b'))[_0x3451('0x3a')](_0x3451('0x3c'),LISTID[_0x3451('0x36')]())[_0x3451('0x3a')](_0x3451('0x41'),squel[_0x3451('0x42')](hopperContacts))[_0x3451('0x3a')](_0x3451('0x43')))['toString']();return _0x38425d;}return db[_0x3451('0x48')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x3451('0x49')],'include':[{'model':db[_0x3451('0x4a')],'as':_0x3451('0x4b'),'where':{'id':LISTID}}]})[_0x3451('0x25')](function(_0x4d9df1){var _0x3d572a=[];if(_0x4d9df1){var _0x38b297;for(var _0x16614b=0x0,_0x27fdeb;_0x16614b<_0x4d9df1[_0x3451('0x21')];_0x16614b+=0x1){_0x27fdeb=_0x4d9df1[_0x16614b]['get']({'plain':!![]});switch(_0x27fdeb['dialCheckDuplicateType']){case _0x3451('0x4c'):_0x3d572a[_0x3451('0x26')](db[_0x3451('0x4d')][_0x3451('0x4e')](_0x10b254(_0x27fdeb,_0x3451('0x4f')))['then'](function(){})['catch'](_0xc5fb21()));break;case _0x3451('0x50'):_0x3d572a[_0x3451('0x26')](db[_0x3451('0x4d')][_0x3451('0x4e')](_0x4a83c8(_0x27fdeb,_0x3451('0x4f')))[_0x3451('0x25')](function(){})[_0x3451('0x51')](_0xc5fb21()));break;default:_0x3d572a[_0x3451('0x26')](db[_0x3451('0x4d')][_0x3451('0x4e')](_0x27a54d(_0x27fdeb,_0x3451('0x4f')))['then'](function(){})['catch'](_0xc5fb21()));}}}return _0x3d572a;})[_0x3451('0x52')]()['then'](function(){return db[_0x3451('0x48')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x3451('0x4a')],'as':_0x3451('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x54eb45){var _0x3e4cc4=[];if(_0x54eb45){var _0x5cc076;for(var _0x551eba=0x0,_0x481da5;_0x551eba<_0x54eb45[_0x3451('0x21')];_0x551eba+=0x1){_0x481da5=_0x54eb45[_0x551eba][_0x3451('0x54')]({'plain':!![]});_0x3e4cc4[_0x3451('0x26')](db[_0x3451('0x4d')][_0x3451('0x4e')](_0x2667da(_0x481da5,_0x3451('0x4f')))[_0x3451('0x25')](function(){})[_0x3451('0x51')](_0xc5fb21()));}}return _0x3e4cc4;})[_0x3451('0x52')]();})[_0x3451('0x25')](function(){return db[_0x3451('0x55')][_0x3451('0x56')]({'attributes':['id',_0x3451('0x49')],'include':[{'model':db[_0x3451('0x4a')],'as':_0x3451('0x4b'),'where':{'id':LISTID}}]})[_0x3451('0x25')](function(_0x3a9a98){var _0x5b5b20=[];if(_0x3a9a98){for(var _0x19330f=0x0,_0x76a6f4;_0x19330f<_0x3a9a98[_0x3451('0x21')];_0x19330f+=0x1){_0x76a6f4=_0x3a9a98[_0x19330f][_0x3451('0x54')]({'plain':!![]});switch(_0x76a6f4['dialCheckDuplicateType']){case _0x3451('0x4c'):_0x5b5b20['push'](db[_0x3451('0x4d')][_0x3451('0x4e')](_0x10b254(_0x76a6f4,'CampaignId'))[_0x3451('0x25')](function(){})[_0x3451('0x51')](_0xc5fb21()));break;case _0x3451('0x50'):_0x5b5b20[_0x3451('0x26')](db[_0x3451('0x4d')]['query'](_0x4a83c8(_0x76a6f4,_0x3451('0x57')))['then'](function(){})[_0x3451('0x51')](_0xc5fb21()));break;default:_0x5b5b20['push'](db[_0x3451('0x4d')][_0x3451('0x4e')](_0x27a54d(_0x76a6f4,_0x3451('0x57')))[_0x3451('0x25')](function(){})['catch'](_0xc5fb21()));}}}return _0x5b5b20;})[_0x3451('0x52')]();})[_0x3451('0x25')](function(){return db[_0x3451('0x55')][_0x3451('0x56')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x3451('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x2e6fec){var _0x307d72=[];if(_0x2e6fec){for(var _0x12d8d8=0x0,_0x39a3f4;_0x12d8d8<_0x2e6fec[_0x3451('0x21')];_0x12d8d8+=0x1){_0x39a3f4=_0x2e6fec[_0x12d8d8][_0x3451('0x54')]({'plain':!![]});_0x307d72[_0x3451('0x26')](db['sequelize'][_0x3451('0x4e')](_0x2667da(_0x39a3f4,_0x3451('0x57')))[_0x3451('0x25')](function(){})['catch'](_0xc5fb21()));}}return _0x307d72;})[_0x3451('0x52')]();})['catch'](function(_0x322a80){logger[_0x3451('0x17')](_0x3451('0x58'),_0x3451('0x59'),_0x322a80[_0x3451('0x29')]);});}var processPromises=function(_0x460d88){return BPromise['all'](promises)[_0x3451('0x25')](function(_0x8479e2){})[_0x3451('0x51')](function(_0x6df496){logger[_0x3451('0x17')](_0x3451('0x5a'),JSON[_0x3451('0x2a')](_0x6df496));})[_0x3451('0x5b')](function(){socket[_0x3451('0x5c')](_0x3451('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x460d88){return _0x460d88['resume']();}});};var endCsv=function(){return BPromise[_0x3451('0x5e')]()[_0x3451('0x25')](function(){if(hopperContacts){return checkHopper();}})[_0x3451('0x25')](function(){socket[_0x3451('0x5c')](_0x3451('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x59acd2){logger[_0x3451('0x17')](_0x3451('0x5f'),JSON[_0x3451('0x2a')](_0x59acd2));}finally{process[_0x3451('0x60')](0x0);}});};process['on'](_0x3451('0x61'),function(){logger[_0x3451('0x62')](_0x3451('0x63'));endCsv();});function main(){return BPromise[_0x3451('0x5e')]()[_0x3451('0x25')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3451('0x11')](',');return db[_0x3451('0x24')][_0x3451('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3451('0x25')](function(_0x126d24){var _0x475fa9=fs[_0x3451('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3451('0x65')](_0x475fa9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x19a723,_0x37a323){total+=0x1;var _0xb6831a=total;promises['push'](checkRow(_0x19a723,_0x126d24,_0xb6831a)[_0x3451('0x25')](function(){success+=0x1;})[_0x3451('0x51')](function(_0x3ddffa){if(_0x3ddffa[_0x3451('0x17')]){errors+=0x1;delete _0x3ddffa[_0x3451('0x17')];}else if(_0x3ddffa[_0x3451('0x23')]){duplicates+=0x1;delete _0x3ddffa[_0x3451('0x23')];}rows[_0x3451('0x26')](_0x3ddffa);}));if(total%0xc8===0x0){_0x37a323['pause']();return processPromises(_0x37a323);}},'complete':function(){return processPromises()[_0x3451('0x25')](function(){logger[_0x3451('0x62')](_0x3451('0x66'));endCsv();});},'error':function(_0x5dc7ce,_0x1e7a1a){logger[_0x3451('0x62')]('CSV\x20parse\x20error',JSON[_0x3451('0x2a')](_0x5dc7ce));endCsv();}});})[_0x3451('0x51')](function(_0x198635){logger['error'](_0x3451('0x67'),JSON[_0x3451('0x2a')](_0x198635));});}main(); \ No newline at end of file +var _0xf964=['findAll','BlackLists','Lists','get','onlyIfOpen','CampaignId','Campaign','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','finally','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','resolve','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','cmContact','checkHopper','inspect','insert','into','cm_hopper','scheduledAt','ContactId','updatedAt','field','phone','toString','createdAt','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','from','\x20=\x20?','fromQuery','calleridnum','cm_hopper_final','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','str','outbound','dialCheckDuplicateType','CmList','always','push','sequelize','query','VoiceQueueId','all','VoiceQueue'];(function(_0x5c5d3b,_0x582f0c){var _0x54218b=function(_0xb2bf65){while(--_0xb2bf65){_0x5c5d3b['push'](_0x5c5d3b['shift']());}};_0x54218b(++_0x582f0c);}(_0xf964,0x1ec));var _0x4f96=function(_0x4a28b4,_0x5059d2){_0x4a28b4=_0x4a28b4-0x0;var _0x379aa5=_0xf964[_0x4a28b4];return _0x379aa5;};'use strict';var BPromise=require(_0x4f96('0x0'));var util=require(_0x4f96('0x1'));var _=require(_0x4f96('0x2'));var fs=require('fs');var squel=require(_0x4f96('0x3'));var Papa=require(_0x4f96('0x4'));var Redis=require('ioredis');var db=require(_0x4f96('0x5'))['db'];var config=require(_0x4f96('0x6'));var logger=require(_0x4f96('0x7'))('api');config[_0x4f96('0x8')]=_[_0x4f96('0x9')](config[_0x4f96('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f96('0xa'))(new Redis(config['redis']));require(_0x4f96('0xb'))[_0x4f96('0xc')](socket);try{if(!process['argv'][0x2]||process[_0x4f96('0xd')][0x2]===_0x4f96('0xe')||process[_0x4f96('0xd')][0x2]===_0x4f96('0xf')){throw new Error(_0x4f96('0x10'));}var FILEPATH=process['argv'][0x2];if(!process[_0x4f96('0xd')][0x3]||process[_0x4f96('0xd')][0x3]===_0x4f96('0xe')||process['argv'][0x3]===_0x4f96('0xf')||!process[_0x4f96('0xd')][0x4]||process[_0x4f96('0xd')][0x4]===_0x4f96('0xe')||process[_0x4f96('0xd')][0x4]===_0x4f96('0xf')){throw new Error(_0x4f96('0x11'));}var FIELDS=_[_0x4f96('0x12')](process['argv'][0x3]['split'](','),process[_0x4f96('0xd')][0x4][_0x4f96('0x13')](','));if(!process[_0x4f96('0xd')][0x5]||process[_0x4f96('0xd')][0x5]===_0x4f96('0xe')||process[_0x4f96('0xd')][0x5]===_0x4f96('0xf')){throw new Error(_0x4f96('0x14'));}var LISTID=process[_0x4f96('0xd')][0x5];var COMPANYID=process[_0x4f96('0xd')][0x6]&&process[_0x4f96('0xd')][0x6]!=='undefined'&&process[_0x4f96('0xd')][0x6]!=='null'?process[_0x4f96('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x4f96('0xe')&&process[_0x4f96('0xd')][0x7]!==_0x4f96('0xf')?process[_0x4f96('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0x4f96('0xd')][0x8]===_0x4f96('0xe')||process[_0x4f96('0xd')][0x8]===_0x4f96('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x47a8fe){logger[_0x4f96('0x15')](_0x47a8fe);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(_0xce9b62,_0x2b1f17,_0x1238bd,_0x512711){var _0x4ab745={'message':_0x2b1f17};_0x4ab745[_0xce9b62]=!![];if(_0x1238bd){_0x4ab745[_0x4f96('0x16')]=_0x1238bd;}if(_0x512711){_0x4ab745[_0x4f96('0x17')]=_0x512711;}return _0x4ab745;}function isEmail(_0x3da103){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))*$/[_0x4f96('0x18')](_0x3da103);}function checkRow(_0x218931,_0x298413,_0x7c04dd){return new BPromise(function(_0x38433b,_0xd6d95f){if(_[_0x4f96('0x19')](_0x218931)){return _0xd6d95f(handleCheckRowError('error',_0x4f96('0x1a'),null,_0x7c04dd));}if(_0x218931[_0x4f96('0x1b')]&&_0x218931['errors'][_0x4f96('0x1c')]){var _0x214c01=_[_0x4f96('0x1d')](_0x218931['errors'],_0x4f96('0x1e'))[_0x4f96('0x1f')](';');return _0xd6d95f(handleCheckRowError('error',_0x214c01,null,_0x7c04dd));}var _0x4fc57e={};for(var _0x2b6a62 in FIELDS){if(FIELDS[_0x4f96('0x20')](_0x2b6a62)&&FIELDS[_0x2b6a62]){_0x4fc57e[_0x2b6a62]=_0x218931[_0x4f96('0x21')][0x0][FIELDS[_0x2b6a62]]||_0x218931[_0x4f96('0x21')][0x0]['\ufeff'+FIELDS[_0x2b6a62]];}}if(!_0x4fc57e[_0x4f96('0x22')]){return _0xd6d95f(handleCheckRowError(_0x4f96('0x15'),_0x4f96('0x23'),null,_0x7c04dd));}if(!_0x4fc57e['phone']){return _0xd6d95f(handleCheckRowError(_0x4f96('0x15'),_0x4f96('0x24'),null,_0x7c04dd));}if(_0x4fc57e[_0x4f96('0x25')]){var _0x4a4d76=moment(_0x4fc57e[_0x4f96('0x25')],_0x4f96('0x26'));if(!_0x4a4d76[_0x4f96('0x27')]()){return _0xd6d95f(handleCheckRowError('error',_0x4f96('0x28'),null,_0x7c04dd));}}if(_0x4fc57e[_0x4f96('0x29')]){if(!isEmail(_0x4fc57e[_0x4f96('0x29')])){return _0xd6d95f(handleCheckRowError('error',_0x4f96('0x2a'),null,_0x7c04dd));}}_0x4fc57e[_0x4f96('0x2b')]=LISTID;_0x4fc57e[_0x4f96('0x2c')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4f96('0x1c')]&&_0x298413){var _0x4c71ea={};for(var _0x33d408=0x0,_0xce38aa=DUPLICATES[_0x4f96('0x1c')];_0x33d408<_0xce38aa;_0x33d408+=0x1){_0x4c71ea[DUPLICATES[_0x33d408]]=_0x4fc57e[DUPLICATES[_0x33d408]];}var _0x3b26b0=_[_0x4f96('0x2d')](_0x298413,_0x4c71ea);if(_0x3b26b0){return _0xd6d95f(handleCheckRowError(_0x4f96('0x2e'),_0x4f96('0x2f'),_0x3b26b0,_0x7c04dd));}}return db[_0x4f96('0x30')][_0x4f96('0x31')](_0x4fc57e,{'raw':!![],'hooks':![],'fields':_[_0x4f96('0x32')](_0x4fc57e)})[_0x4f96('0x33')](function(_0x47e0eb){if(DUPLICATES&&DUPLICATES['length']&&_0x298413){_0x298413['push'](_[_0x4f96('0x34')](_0x4fc57e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x47e0eb['id'];return _0x38433b();})[_0x4f96('0x35')](function(_0xfadcb0){return _0xd6d95f(handleCheckRowError(_0x4f96('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0xfadcb0['message']||JSON['stringify'](_0xfadcb0)),null,_0x7c04dd));});});}function checkHopper(){function _0x226bed(){return function(_0x4f8267){logger[_0x4f96('0x15')](_0x4f96('0x36'),_0x4f96('0x37'),util[_0x4f96('0x38')](_0x4f8267,{'showHidden':![],'depth':null}));};}var _0x30f7ce=function(_0x45e41c,_0x49fdec){var _0x19651d=squel[_0x4f96('0x39')]()[_0x4f96('0x3a')](_0x4f96('0x3b'))['fromQuery'](['phone',_0x4f96('0x3c'),_0x4f96('0x3d'),'ListId',_0x49fdec,'createdAt',_0x4f96('0x3e')],squel['select']()[_0x4f96('0x3f')](_0x4f96('0x40'),_0x4f96('0x40'))[_0x4f96('0x3f')]('NOW()',_0x4f96('0x3c'))[_0x4f96('0x3f')]('id',_0x4f96('0x3d'))[_0x4f96('0x3f')](LISTID['toString'](),_0x4f96('0x2b'))[_0x4f96('0x3f')](_0x45e41c['id'][_0x4f96('0x41')](),_0x49fdec)[_0x4f96('0x3f')]('NOW()',_0x4f96('0x42'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3e'))['from'](_0x4f96('0x44'))[_0x4f96('0x45')](_0x4f96('0x46'))[_0x4f96('0x45')](_0x4f96('0x47'),LISTID['toString']())[_0x4f96('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x4f96('0x45')](_0x4f96('0x48'),squel[_0x4f96('0x49')]()[_0x4f96('0x3f')](_0x4f96('0x40'))[_0x4f96('0x4a')](_0x4f96('0x3b'))['where'](_0x49fdec+_0x4f96('0x4b'),_0x45e41c['id'][_0x4f96('0x41')]())))[_0x4f96('0x41')]();return _0x19651d;};var _0x44d1da=function(_0x38b9e3,_0x56aba7){var _0x459b15=squel[_0x4f96('0x39')]()[_0x4f96('0x3a')]('cm_hopper')[_0x4f96('0x4c')]([_0x4f96('0x40'),_0x4f96('0x3c'),'ContactId',_0x4f96('0x2b'),_0x56aba7,_0x4f96('0x42'),_0x4f96('0x3e')],squel[_0x4f96('0x49')]()[_0x4f96('0x3f')](_0x4f96('0x40'),_0x4f96('0x40'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3c'))[_0x4f96('0x3f')]('id','ContactId')[_0x4f96('0x3f')](LISTID[_0x4f96('0x41')](),'ListId')[_0x4f96('0x3f')](_0x38b9e3['id'][_0x4f96('0x41')](),_0x56aba7)['field'](_0x4f96('0x43'),'createdAt')[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3e'))['from'](_0x4f96('0x44'))['where'](_0x4f96('0x46'))[_0x4f96('0x45')]('ListId\x20=\x20?',LISTID[_0x4f96('0x41')]())[_0x4f96('0x45')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x4f96('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x4f96('0x45')](_0x4f96('0x48'),squel[_0x4f96('0x49')]()[_0x4f96('0x3f')](_0x4f96('0x4d'))[_0x4f96('0x4a')](_0x4f96('0x4e'))[_0x4f96('0x45')](_0x56aba7+'\x20=\x20?',_0x38b9e3['id'][_0x4f96('0x41')]()))[_0x4f96('0x45')](_0x4f96('0x48'),squel[_0x4f96('0x49')]()['field'](_0x4f96('0x40'))[_0x4f96('0x4a')](_0x4f96('0x3b'))['where'](_0x56aba7+'\x20=\x20?',_0x38b9e3['id']['toString']())))[_0x4f96('0x41')]();return _0x459b15;};function _0x3cb5a6(_0x118467,_0x5f0300){var _0x27feee=squel[_0x4f96('0x39')]()['into'](_0x4f96('0x3b'))['fromQuery'](['phone',_0x4f96('0x3c'),_0x4f96('0x3d'),_0x4f96('0x2b'),_0x5f0300,_0x4f96('0x42'),_0x4f96('0x3e')],squel[_0x4f96('0x49')]()[_0x4f96('0x3f')]('phone',_0x4f96('0x40'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3c'))[_0x4f96('0x3f')]('id',_0x4f96('0x3d'))[_0x4f96('0x3f')](LISTID[_0x4f96('0x41')](),_0x4f96('0x2b'))[_0x4f96('0x3f')](_0x118467['id'][_0x4f96('0x41')](),_0x5f0300)[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x42'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3e'))[_0x4f96('0x4a')](_0x4f96('0x44'))[_0x4f96('0x45')](_0x4f96('0x46'))[_0x4f96('0x45')](_0x4f96('0x47'),LISTID[_0x4f96('0x41')]())[_0x4f96('0x45')](_0x4f96('0x4f'),squel['str'](hopperContacts))['where'](_0x4f96('0x50')))[_0x4f96('0x41')]();return _0x27feee;}function _0x6a3017(_0x28e424,_0x24ba3e){var _0x51334f=squel[_0x4f96('0x39')]()[_0x4f96('0x3a')](_0x4f96('0x51'))['fromQuery'](['phone',_0x4f96('0x3d'),_0x4f96('0x2b'),_0x24ba3e,_0x4f96('0x42'),'updatedAt'],squel[_0x4f96('0x49')]()[_0x4f96('0x3f')]('phone',_0x4f96('0x40'))['field']('id',_0x4f96('0x3d'))['field'](LISTID[_0x4f96('0x41')](),_0x4f96('0x2b'))['field'](_0x28e424['id']['toString'](),_0x24ba3e)['field'](_0x4f96('0x43'),_0x4f96('0x42'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3e'))[_0x4f96('0x4a')](_0x4f96('0x44'))[_0x4f96('0x45')](_0x4f96('0x46'))[_0x4f96('0x45')]('ListId\x20=\x20?',LISTID[_0x4f96('0x41')]())[_0x4f96('0x45')](_0x4f96('0x4f'),squel[_0x4f96('0x52')](hopperContacts))['where'](_0x4f96('0x50')))[_0x4f96('0x41')]();return _0x51334f;}return db['VoiceQueue']['findAll']({'where':{'type':_0x4f96('0x53')},'attributes':['id',_0x4f96('0x54')],'include':[{'model':db[_0x4f96('0x55')],'as':'Lists','where':{'id':LISTID}}]})[_0x4f96('0x33')](function(_0x22f6e1){var _0x1b8051=[];if(_0x22f6e1){var _0x4c0096;for(var _0x568577=0x0,_0x2a0491;_0x568577<_0x22f6e1[_0x4f96('0x1c')];_0x568577+=0x1){_0x2a0491=_0x22f6e1[_0x568577]['get']({'plain':!![]});switch(_0x2a0491[_0x4f96('0x54')]){case _0x4f96('0x56'):_0x1b8051[_0x4f96('0x57')](db[_0x4f96('0x58')][_0x4f96('0x59')](_0x44d1da(_0x2a0491,_0x4f96('0x5a')))[_0x4f96('0x33')](function(){})[_0x4f96('0x35')](_0x226bed()));break;case'onlyIfOpen':_0x1b8051['push'](db['sequelize'][_0x4f96('0x59')](_0x30f7ce(_0x2a0491,'VoiceQueueId'))[_0x4f96('0x33')](function(){})[_0x4f96('0x35')](_0x226bed()));break;default:_0x1b8051['push'](db['sequelize'][_0x4f96('0x59')](_0x3cb5a6(_0x2a0491,_0x4f96('0x5a')))['then'](function(){})[_0x4f96('0x35')](_0x226bed()));}}}return _0x1b8051;})[_0x4f96('0x5b')]()[_0x4f96('0x33')](function(){return db[_0x4f96('0x5c')][_0x4f96('0x5d')]({'where':{'type':_0x4f96('0x53')},'attributes':['id'],'include':[{'model':db[_0x4f96('0x55')],'as':_0x4f96('0x5e'),'where':{'id':LISTID}}]})[_0x4f96('0x33')](function(_0x4a44df){var _0x48b0b0=[];if(_0x4a44df){var _0x5ac6be;for(var _0x14d60b=0x0,_0x9290f;_0x14d60b<_0x4a44df[_0x4f96('0x1c')];_0x14d60b+=0x1){_0x9290f=_0x4a44df[_0x14d60b]['get']({'plain':!![]});_0x48b0b0[_0x4f96('0x57')](db[_0x4f96('0x58')][_0x4f96('0x59')](_0x6a3017(_0x9290f,_0x4f96('0x5a')))[_0x4f96('0x33')](function(){})[_0x4f96('0x35')](_0x226bed()));}}return _0x48b0b0;})['all']();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x4f96('0x55')],'as':_0x4f96('0x5f'),'where':{'id':LISTID}}]})[_0x4f96('0x33')](function(_0x6ba83c){var _0x175e33=[];if(_0x6ba83c){for(var _0x33aabf=0x0,_0x153352;_0x33aabf<_0x6ba83c['length'];_0x33aabf+=0x1){_0x153352=_0x6ba83c[_0x33aabf][_0x4f96('0x60')]({'plain':!![]});switch(_0x153352['dialCheckDuplicateType']){case _0x4f96('0x56'):_0x175e33[_0x4f96('0x57')](db[_0x4f96('0x58')]['query'](_0x44d1da(_0x153352,'CampaignId'))[_0x4f96('0x33')](function(){})[_0x4f96('0x35')](_0x226bed()));break;case _0x4f96('0x61'):_0x175e33['push'](db[_0x4f96('0x58')][_0x4f96('0x59')](_0x30f7ce(_0x153352,_0x4f96('0x62')))['then'](function(){})[_0x4f96('0x35')](_0x226bed()));break;default:_0x175e33['push'](db['sequelize'][_0x4f96('0x59')](_0x3cb5a6(_0x153352,_0x4f96('0x62')))['then'](function(){})[_0x4f96('0x35')](_0x226bed()));}}}return _0x175e33;})[_0x4f96('0x5b')]();})[_0x4f96('0x33')](function(){return db[_0x4f96('0x63')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x4f96('0x5e'),'where':{'id':LISTID}}]})[_0x4f96('0x33')](function(_0x1437f8){var _0x3a08a6=[];if(_0x1437f8){for(var _0x2972c4=0x0,_0x3339f9;_0x2972c4<_0x1437f8[_0x4f96('0x1c')];_0x2972c4+=0x1){_0x3339f9=_0x1437f8[_0x2972c4]['get']({'plain':!![]});_0x3a08a6['push'](db[_0x4f96('0x58')][_0x4f96('0x59')](_0x6a3017(_0x3339f9,_0x4f96('0x62')))['then'](function(){})[_0x4f96('0x35')](_0x226bed()));}}return _0x3a08a6;})[_0x4f96('0x5b')]();})[_0x4f96('0x35')](function(_0x308f4b){logger['error'](_0x4f96('0x64'),'generalCheckHopper',_0x308f4b[_0x4f96('0x1e')]);});}var processPromises=function(_0x5350d0){return BPromise['all'](promises)[_0x4f96('0x33')](function(_0x3728b4){})['catch'](function(_0x3d1fe6){logger['error'](_0x4f96('0x65'),JSON[_0x4f96('0x66')](_0x3d1fe6));})[_0x4f96('0x67')](function(){socket['emit'](_0x4f96('0x68')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5350d0){return _0x5350d0[_0x4f96('0x69')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x4f96('0x6a')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4f96('0x6b')](FILEPATH);}catch(_0x388563){logger[_0x4f96('0x15')](_0x4f96('0x6c'),JSON['stringify'](_0x388563));}finally{process[_0x4f96('0x6d')](0x0);}});};process['on'](_0x4f96('0x6e'),function(){logger[_0x4f96('0x6f')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x4f96('0x70')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4f96('0x13')](',');return db[_0x4f96('0x30')][_0x4f96('0x5d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x4f96('0x33')](function(_0x41090b){var _0x3a9471=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4f96('0x71')](_0x3a9471,{'header':!![],'skipEmptyLines':!![],'step':function(_0x41b57b,_0x3a3424){total+=0x1;var _0x4dac33=total;promises[_0x4f96('0x57')](checkRow(_0x41b57b,_0x41090b,_0x4dac33)[_0x4f96('0x33')](function(){success+=0x1;})[_0x4f96('0x35')](function(_0x4805b3){if(_0x4805b3[_0x4f96('0x15')]){errors+=0x1;delete _0x4805b3[_0x4f96('0x15')];}else if(_0x4805b3['duplicate']){duplicates+=0x1;delete _0x4805b3[_0x4f96('0x2e')];}rows['push'](_0x4805b3);}));if(total%0xc8===0x0){_0x3a3424['pause']();return processPromises(_0x3a3424);}},'complete':function(){return processPromises()[_0x4f96('0x33')](function(){logger['info'](_0x4f96('0x72'));endCsv();});},'error':function(_0x83c0da,_0x1d723f){logger[_0x4f96('0x6f')](_0x4f96('0x73'),JSON[_0x4f96('0x66')](_0x83c0da));endCsv();}});})[_0x4f96('0x35')](function(_0x207679){logger[_0x4f96('0x15')](_0x4f96('0x74'),JSON[_0x4f96('0x66')](_0x207679));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 818e116..9a1d451 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 _0xa2b0=['push','code','sequelize','query','spread','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','length','rows','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','data','appendFileSync','emit','contact:import:','Abort\x20parser','abort','error','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',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','unlink','exit','complete','argv','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','scheduledat','ListId','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.createdAt','into','cm_hopper_black','ContactId','createdAt','cm_contacts','field','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','message','errors'];(function(_0x235769,_0x8d4dd3){var _0x4190e2=function(_0x27ae80){while(--_0x27ae80){_0x235769['push'](_0x235769['shift']());}};_0x4190e2(++_0x8d4dd3);}(_0xa2b0,0xc4));var _0x0a2b=function(_0x34638c,_0x42ddce){_0x34638c=_0x34638c-0x0;var _0xb9b730=_0xa2b0[_0x34638c];return _0xb9b730;};'use strict';var fs=require('fs');var path=require(_0x0a2b('0x0'));var _=require(_0x0a2b('0x1'));var Papa=require(_0x0a2b('0x2'));var util=require(_0x0a2b('0x3'));var BPromise=require('bluebird');var moment=require(_0x0a2b('0x4'));var squel=require(_0x0a2b('0x5'));var Redis=require('ioredis');var db=require(_0x0a2b('0x6'))['db'];var config=require(_0x0a2b('0x7'));var logger=require(_0x0a2b('0x8'))(_0x0a2b('0x9'));config['redis']=_[_0x0a2b('0xa')](config[_0x0a2b('0xb')],{'host':_0x0a2b('0xc'),'port':0x18eb});var socket=require(_0x0a2b('0xd'))(new Redis(config[_0x0a2b('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x0a2b('0xe')](_0x0a2b('0xf'));function isEmail(_0x176dc3){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))*$/[_0x0a2b('0x10')](_0x176dc3);}function selectNotIn(_0x3ae115,_0x3c0e3a,_0x3163b4,_0x5c762a,_0x413748){return squel[_0x0a2b('0x11')]()['field'](_0x0a2b('0x12'))[_0x0a2b('0x13')](_0x5c762a)[_0x0a2b('0x14')](_0x3c0e3a,null,_0x3c0e3a+_0x0a2b('0x15')+_0x5c762a+'.'+_0x3163b4)['where'](_0x5c762a+'.'+_0x3163b4+_0x0a2b('0x16')+_0x3ae115+'.'+_0x3163b4)['where'](_0x3c0e3a+_0x0a2b('0x17')+_0x413748[_0x0a2b('0x14')]()+')');}function insertCmHopper(_0x164b26,_0x398678,_0x285057,_0x24bc10,_0x3c70b8){var _0x3c5872=[_0x0a2b('0x18'),_0x0a2b('0x19'),'cm_contacts.id','cm_contacts.ListId',_0x398678+'.'+_0x24bc10,'cm_contacts.createdAt',_0x0a2b('0x1a'),_0x0a2b('0x1b'),_0x0a2b('0x1c'),'\x22'+_0x3c70b8+'\x22'];return squel[_0x0a2b('0x1d')]()['into']('cm_hopper')[_0x0a2b('0x1e')](['phone',_0x0a2b('0x1f'),'ContactId',_0x0a2b('0x20'),_0x24bc10,'createdAt',_0x0a2b('0x21'),_0x0a2b('0x22'),_0x0a2b('0x23'),_0x0a2b('0x24')],squel[_0x0a2b('0x11')]()[_0x0a2b('0x25')](_0x3c5872)[_0x0a2b('0x13')](_0x398678)[_0x0a2b('0x14')]('cm_contacts',null,_0x0a2b('0x26')+_0x398678+_0x0a2b('0x27'))[_0x0a2b('0x14')](_0x285057,null,_0x285057+_0x0a2b('0x15')+_0x398678+'.'+_0x24bc10)[_0x0a2b('0x28')](_0x398678+_0x0a2b('0x29'),_0x164b26)[_0x0a2b('0x28')](_0x0a2b('0x2a'),NOW)[_0x0a2b('0x28')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x398678,_0x285057,_0x24bc10,_0x0a2b('0x2b'),['\x22always\x22',_0x0a2b('0x2c')]))[_0x0a2b('0x28')](_0x0a2b('0x2d'),selectNotIn(_0x398678,_0x285057,_0x24bc10,'cm_hopper',[_0x0a2b('0x2e')])))[_0x0a2b('0x2f')]();}function insertCmHopperBlack(_0x3cdd75,_0x1ada33,_0x314c09,_0x35fa59){var _0x5452e5=[_0x0a2b('0x18'),'cm_contacts.id','cm_contacts.ListId',_0x1ada33+'.'+_0x35fa59,_0x0a2b('0x30'),_0x0a2b('0x1a')];return squel[_0x0a2b('0x1d')]()[_0x0a2b('0x31')](_0x0a2b('0x32'))['fromQuery']([_0x0a2b('0x12'),_0x0a2b('0x33'),'ListId',_0x35fa59,_0x0a2b('0x34'),_0x0a2b('0x21')],squel[_0x0a2b('0x11')]()[_0x0a2b('0x25')](_0x5452e5)['from'](_0x1ada33)[_0x0a2b('0x14')](_0x0a2b('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x1ada33+_0x0a2b('0x27'))[_0x0a2b('0x14')](_0x314c09,null,_0x314c09+_0x0a2b('0x15')+_0x1ada33+'.'+_0x35fa59)[_0x0a2b('0x28')](_0x1ada33+'.CmListId\x20=\x20?',_0x3cdd75)[_0x0a2b('0x28')](_0x0a2b('0x2a'),NOW)['where'](_0x0a2b('0x2d'),squel['select']()[_0x0a2b('0x36')](_0x0a2b('0x12'))[_0x0a2b('0x13')](_0x0a2b('0x32'))[_0x0a2b('0x28')]('ListId\x20=\x20?',_0x3cdd75)[_0x0a2b('0x28')](_0x35fa59+_0x0a2b('0x37'),_0x1ada33+'.'+_0x35fa59)))['toString']();}function insertCmContact(_0x4fcf89,_0x5afd11,_0x39ffb9,_0x594284){var _0x44422d=_['concat'](_[_0x0a2b('0x38')](_0x594284),['ListId',_0x0a2b('0x39'),_0x0a2b('0x34'),_0x0a2b('0x21')]);return squel[_0x0a2b('0x1d')]()['into']('cm_contacts')['fromQuery'](_0x44422d,squel[_0x0a2b('0x11')]()['fields'](_0x44422d)[_0x0a2b('0x13')](_0x5afd11)[_0x0a2b('0x28')]('('+_0x39ffb9['join'](',')+_0x0a2b('0x3a'),squel[_0x0a2b('0x11')]()[_0x0a2b('0x25')](_0x39ffb9)[_0x0a2b('0x13')]('cm_contacts')[_0x0a2b('0x28')](_0x0a2b('0x3b'),_0x4fcf89)['where'](_0x0a2b('0x3c')))[_0x0a2b('0x28')](_0x0a2b('0x3d'),squel[_0x0a2b('0x11')]()['field']('MIN(id)',_0x0a2b('0x3e'))[_0x0a2b('0x13')](_0x5afd11)[_0x0a2b('0x3f')](_0x39ffb9[_0x0a2b('0x14')](','))))[_0x0a2b('0x2f')]();}function handleStop(){logger[_0x0a2b('0x40')](_0x0a2b('0x41'));stopped=!![];}function handleUncaughtException(_0x386635){logger['error'](_0x386635[_0x0a2b('0x42')]);process['exit'](0x1);}function handleError(_0x419ad9,_0x2ffe2f){stats[_0x0a2b('0x43')][_0x0a2b('0x44')]({'name':_0x2ffe2f[_0x0a2b('0x45')],'message':_0x2ffe2f[_0x0a2b('0x42')],'row':_0x419ad9});}function handleQuery(_0x12decd){logger['info'](_0x12decd);return db[_0x0a2b('0x46')][_0x0a2b('0x47')](_0x12decd)[_0x0a2b('0x48')](function(_0x4da070){results['push'](_0x4da070);})[_0x0a2b('0x49')](function(_0x2ddfaf){logger['error'](_0x2ddfaf[_0x0a2b('0x42')]);});}function main(_0x4d8020,_0x247e8e,_0x277bdc,_0x2d43ed){logger[_0x0a2b('0x40')](_0x0a2b('0x4a'),_0x4d8020,JSON[_0x0a2b('0x4b')](_0x247e8e));process[_0x0a2b('0x4c')]('start');var _0x5b1e8a=_0x247e8e[_0x0a2b('0x4d')];var _0x11f06e=_0x247e8e[_0x0a2b('0x4e')];var _0x331a69=path['join'](config[_0x0a2b('0x4f')],_0x0a2b('0x50'),_0x11f06e+'.csv');var _0x4a7d2f=_[_0x0a2b('0x38')](_0x5b1e8a)[_0x0a2b('0x14')]();logger['info'](_0x0a2b('0x51'),_0x4a7d2f);fs[_0x0a2b('0x52')](_0x331a69,_0x4a7d2f+'\x0a');Papa[_0x0a2b('0x53')](fs[_0x0a2b('0x54')](_0x4d8020),{'header':!![],'skipEmptyLines':!![],'step':function(_0x46a6ac,_0x229658){try{for(var _0x2d6757=0x0,_0x2a4905=[];_0x2d6757<_0x46a6ac['data'][_0x0a2b('0x55')];_0x2d6757++){stats[_0x0a2b('0x56')]+=0x1;if(_0x46a6ac['errors'][_0x2d6757]){handleError(_0x46a6ac['data'][_0x2d6757],_0x46a6ac[_0x0a2b('0x43')][_0x2d6757]);}else{var _0x4f6d06=[];for(var _0x3be73c in _0x5b1e8a){if(_0x5b1e8a[_0x0a2b('0x57')](_0x3be73c)){if(_0x46a6ac['data'][_0x2d6757][_0x5b1e8a[_0x3be73c]]){var _0x3c5ea6=_['trim'](_0x46a6ac['data'][_0x2d6757][_0x5b1e8a[_0x3be73c]][_0x0a2b('0x58')](/"/g,'\x27'));switch(_0x3be73c){case _0x0a2b('0x1f'):var _0x216b13=moment(_0x3c5ea6,_0x0a2b('0xf'),!![]);if(_0x216b13[_0x0a2b('0x59')]()){_0x2a4905['push']('\x22'+_0x3c5ea6+'\x22');}else{_0x4f6d06[_0x0a2b('0x44')](_0x0a2b('0x5a'));}break;case'priority':var _0x31d81f=parseInt(_0x3c5ea6);_0x3c5ea6=_[_0x0a2b('0x5b')](_0x31d81f)||_0x31d81f<0x0||_0x31d81f>0x4?_0x2d43ed?0x3:0x2:_0x31d81f;_0x2a4905['push']('\x22'+_0x3c5ea6+'\x22');break;case'UserId':var _0x5099cf=parseInt(_0x3c5ea6);if(_['isNumber'](_0x5099cf)&&_[_0x0a2b('0x5c')](_0x277bdc,_0x5099cf)){_0x2a4905[_0x0a2b('0x44')]('\x22'+_0x5099cf+'\x22');}else{_0x4f6d06['push']('agent\x20not\x20exists');}break;case _0x0a2b('0x5d'):if(isEmail(_0x3c5ea6)){_0x2a4905['push']('\x22'+_0x3c5ea6+'\x22');}else{_0x4f6d06[_0x0a2b('0x44')](_0x0a2b('0x5e'));}break;case _0x0a2b('0x5f'):var _0x447fe2=moment(_0x3c5ea6,'YYYY-MM-DD',!![]);if(_0x447fe2[_0x0a2b('0x59')]()){_0x2a4905[_0x0a2b('0x44')]('\x22'+_0x3c5ea6+'\x22');}else{_0x4f6d06[_0x0a2b('0x44')](_0x0a2b('0x60'));}break;default:_0x2a4905[_0x0a2b('0x44')]('\x22'+_0x3c5ea6+'\x22');}}else{switch(_0x3be73c){case _0x0a2b('0x61'):case'phone':_0x4f6d06['push'](_0x3be73c+_0x0a2b('0x62'));break;default:_0x2a4905['push']('\x22\x22');}}}}if(_0x4f6d06['length']){handleError(_0x46a6ac[_0x0a2b('0x63')][_0x2d6757],{'code':'SystemRow','message':_0x4f6d06['join']()});}else{fs[_0x0a2b('0x64')](_0x331a69,_0x2a4905[_0x0a2b('0x14')]()+'\x0a');}_0x2a4905=[];}if(!(stats['rows']%0xc8)){socket[_0x0a2b('0x65')](_0x0a2b('0x66')+_0x11f06e,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x0a2b('0x67'));_0x229658[_0x0a2b('0x68')]();}}catch(_0x328bf5){handleError(_0x46a6ac[_0x0a2b('0x63')][_0x2d6757],{'code':'SystemError','message':_0x328bf5[_0x0a2b('0x42')]});logger[_0x0a2b('0x69')]('step',_0x328bf5[_0x0a2b('0x42')]);}},'complete':function(){try{var _0x3fb4eb=[];var _0x18437a='cm_contacts';if(_0x247e8e[_0x0a2b('0x6a')]&&_0x247e8e[_0x0a2b('0x6a')][_0x0a2b('0x55')]){_0x18437a='cm_contacts_'+_0x11f06e;_0x3fb4eb[_0x0a2b('0x44')](_0x0a2b('0x6b')+_0x18437a+_0x0a2b('0x6c'));}var _0x40f265=util[_0x0a2b('0xe')](_0x0a2b('0x6d'),_0x331a69,_0x18437a,_0x4a7d2f,_0x247e8e[_0x0a2b('0x20')],_0x247e8e[_0x0a2b('0x39')]||null,NOW,NOW);if(_['isNil'](_0x5b1e8a[_0x0a2b('0x1f')])){_0x40f265+=_0x0a2b('0x6e');}_0x3fb4eb['push'](_0x40f265);if(_0x247e8e[_0x0a2b('0x6a')]&&_0x247e8e[_0x0a2b('0x6a')][_0x0a2b('0x55')]){_0x3fb4eb['push'](insertCmContact(_0x247e8e[_0x0a2b('0x20')],_0x18437a,_0x247e8e[_0x0a2b('0x6a')],_0x5b1e8a));_0x3fb4eb[_0x0a2b('0x44')](_0x0a2b('0x6f')+_0x18437a+';');}_0x3fb4eb['push'](insertCmHopper(_0x247e8e[_0x0a2b('0x20')],'voice_queues_has_cm_lists',_0x0a2b('0x70'),'VoiceQueueId',_0x2d43ed));_0x3fb4eb[_0x0a2b('0x44')](insertCmHopperBlack(_0x247e8e[_0x0a2b('0x20')],_0x0a2b('0x71'),'voice_queues','VoiceQueueId'));_0x3fb4eb[_0x0a2b('0x44')](insertCmHopper(_0x247e8e[_0x0a2b('0x20')],'campaigns_has_cm_lists',_0x0a2b('0x72'),'CampaignId',_0x2d43ed));_0x3fb4eb[_0x0a2b('0x44')](insertCmHopperBlack(_0x247e8e[_0x0a2b('0x20')],_0x0a2b('0x73'),_0x0a2b('0x72'),_0x0a2b('0x74')));BPromise[_0x0a2b('0x75')](_0x3fb4eb,handleQuery)[_0x0a2b('0x76')](function(_0x5e66ca){stats[_0x0a2b('0x77')]=!![];stats[_0x0a2b('0x78')]=_0x247e8e['duplicates']&&_0x247e8e[_0x0a2b('0x6a')][_0x0a2b('0x55')]?results[0x2][_0x0a2b('0x78')]:results[0x0][_0x0a2b('0x78')];socket[_0x0a2b('0x65')](_0x0a2b('0x66')+_0x11f06e,stats);fs[_0x0a2b('0x79')](_0x4d8020);fs[_0x0a2b('0x79')](_0x331a69);process[_0x0a2b('0x7a')](0x0);})[_0x0a2b('0x49')](function(_0x203641){logger[_0x0a2b('0x69')](_0x203641[_0x0a2b('0x42')]);process[_0x0a2b('0x7a')](0x1);});}catch(_0x7deb15){logger[_0x0a2b('0x69')](_0x0a2b('0x7b'),_0x7deb15[_0x0a2b('0x42')]);process[_0x0a2b('0x7a')](0x1);}},'error':function(_0x3e271a,_0x1b89ac,_0x3fd3c8,_0x43d5d3){throw new Error(_0x43d5d3);}});}function validate(){if(process[_0x0a2b('0x7c')]&&process[_0x0a2b('0x7c')][_0x0a2b('0x55')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x2ab061=path[_0x0a2b('0x14')](config[_0x0a2b('0x4f')],'server/files/tmp',process[_0x0a2b('0x7c')][0x2]);if(!fs[_0x0a2b('0x7d')](_0x2ab061)){throw new Error(_0x0a2b('0x7e'));}var _0x45acbb={};try{_0x45acbb=JSON[_0x0a2b('0x53')](process['argv'][0x3]);if(!_0x45acbb[_0x0a2b('0x4d')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x45acbb['binding']['phone']){throw new Error(_0x0a2b('0x7f'));}if(!_0x45acbb['binding'][_0x0a2b('0x61')]){throw new Error(_0x0a2b('0x80'));}var _0x325c25=0x0;if(_0x45acbb['binding'][_0x0a2b('0x23')]){_0x325c25=0x1;}if(!_0x45acbb[_0x0a2b('0x20')]){throw new Error(_0x0a2b('0x81'));}}catch(_0x204b3b){throw new Error('body\x20id\x20mandatory');}var _0x30e141=[];try{_0x30e141=_['map'](JSON[_0x0a2b('0x53')](process[_0x0a2b('0x7c')][0x4]),'id');}catch(_0x5cc5a2){logger[_0x0a2b('0x40')]('No\x20agent\x20available');}main(_0x2ab061,_0x45acbb,_0x30e141,_0x325c25);}validate();process['on'](_0x0a2b('0x82'),handleStop);process['on'](_0x0a2b('0x83'),handleUncaughtException); \ No newline at end of file +var _0x00f5=['contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','then','affectedRows','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','priority','recallme','select','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_hopper_black','fromQuery','updatedAt','fields','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','group','error','message','exit','errors','push','code','info','query','spread','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','rows','data','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x00f5,0x1a8));var _0x500f=function(_0x25fcfe,_0x5280f9){_0x25fcfe=_0x25fcfe-0x0;var _0x51a103=_0x00f5[_0x25fcfe];return _0x51a103;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x500f('0x0'));var Papa=require(_0x500f('0x1'));var util=require(_0x500f('0x2'));var BPromise=require(_0x500f('0x3'));var moment=require(_0x500f('0x4'));var squel=require(_0x500f('0x5'));var Redis=require(_0x500f('0x6'));var db=require(_0x500f('0x7'))['db'];var config=require(_0x500f('0x8'));var logger=require('../../../config/logger')(_0x500f('0x9'));config[_0x500f('0xa')]=_[_0x500f('0xb')](config[_0x500f('0xa')],{'host':_0x500f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x500f('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x500f('0xd'));function isEmail(_0x25f566){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))*$/[_0x500f('0xe')](_0x25f566);}function selectNotIn(_0x5afe20,_0x4a95cc,_0x3ba0a7,_0x1500a5,_0x38281d){return squel['select']()[_0x500f('0xf')](_0x500f('0x10'))['from'](_0x1500a5)['join'](_0x4a95cc,null,_0x4a95cc+_0x500f('0x11')+_0x1500a5+'.'+_0x3ba0a7)[_0x500f('0x12')](_0x1500a5+'.'+_0x3ba0a7+'\x20=\x20'+_0x5afe20+'.'+_0x3ba0a7)[_0x500f('0x12')](_0x4a95cc+_0x500f('0x13')+_0x38281d[_0x500f('0x14')]()+')');}function insertCmHopper(_0x136b52,_0x939f3b,_0x52afca,_0x132842,_0x1bb6b5){var _0xd9100e=[_0x500f('0x15'),'cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x939f3b+'.'+_0x132842,_0x500f('0x16'),_0x500f('0x17'),_0x500f('0x18'),'cm_contacts.UserId','\x22'+_0x1bb6b5+'\x22'];return squel[_0x500f('0x19')]()[_0x500f('0x1a')](_0x500f('0x1b'))['fromQuery']([_0x500f('0x10'),_0x500f('0x1c'),_0x500f('0x1d'),_0x500f('0x1e'),_0x132842,_0x500f('0x1f'),'updatedAt',_0x500f('0x20'),'UserId',_0x500f('0x21')],squel[_0x500f('0x22')]()['fields'](_0xd9100e)[_0x500f('0x23')](_0x939f3b)[_0x500f('0x14')](_0x500f('0x24'),null,_0x500f('0x25')+_0x939f3b+_0x500f('0x26'))[_0x500f('0x14')](_0x52afca,null,_0x52afca+_0x500f('0x11')+_0x939f3b+'.'+_0x132842)[_0x500f('0x12')](_0x939f3b+'.CmListId\x20=\x20?',_0x136b52)['where'](_0x500f('0x27'),NOW)[_0x500f('0x12')](_0x500f('0x28'),selectNotIn(_0x939f3b,_0x52afca,_0x132842,_0x500f('0x1b'),[_0x500f('0x29'),'\x22onlyIfOpen\x22']))[_0x500f('0x12')](_0x500f('0x28'),selectNotIn(_0x939f3b,_0x52afca,_0x132842,_0x500f('0x1b'),[_0x500f('0x29')])))[_0x500f('0x2a')]();}function insertCmHopperBlack(_0x1ff78d,_0x2608ee,_0x624b33,_0x223000){var _0x4e694a=[_0x500f('0x15'),_0x500f('0x2b'),_0x500f('0x2c'),_0x2608ee+'.'+_0x223000,_0x500f('0x16'),_0x500f('0x17')];return squel[_0x500f('0x19')]()['into'](_0x500f('0x2d'))[_0x500f('0x2e')]([_0x500f('0x10'),_0x500f('0x1d'),_0x500f('0x1e'),_0x223000,_0x500f('0x1f'),_0x500f('0x2f')],squel['select']()[_0x500f('0x30')](_0x4e694a)[_0x500f('0x23')](_0x2608ee)[_0x500f('0x14')](_0x500f('0x24'),null,_0x500f('0x25')+_0x2608ee+'.CmListId')[_0x500f('0x14')](_0x624b33,null,_0x624b33+_0x500f('0x11')+_0x2608ee+'.'+_0x223000)[_0x500f('0x12')](_0x2608ee+'.CmListId\x20=\x20?',_0x1ff78d)[_0x500f('0x12')](_0x500f('0x27'),NOW)[_0x500f('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x500f('0x22')]()[_0x500f('0xf')](_0x500f('0x10'))[_0x500f('0x23')](_0x500f('0x2d'))[_0x500f('0x12')]('ListId\x20=\x20?',_0x1ff78d)['where'](_0x223000+'\x20=\x20?',_0x2608ee+'.'+_0x223000)))[_0x500f('0x2a')]();}function insertCmContact(_0x38c9b4,_0xb84c7f,_0x108722,_0x15049f){var _0x443cf5=_[_0x500f('0x31')](_[_0x500f('0x32')](_0x15049f),[_0x500f('0x1e'),_0x500f('0x33'),_0x500f('0x1f'),_0x500f('0x2f')]);return squel['insert']()[_0x500f('0x1a')](_0x500f('0x24'))[_0x500f('0x2e')](_0x443cf5,squel[_0x500f('0x22')]()[_0x500f('0x30')](_0x443cf5)['from'](_0xb84c7f)[_0x500f('0x12')]('('+_0x108722['join'](',')+_0x500f('0x34'),squel['select']()[_0x500f('0x30')](_0x108722)['from'](_0x500f('0x24'))[_0x500f('0x12')](_0x500f('0x35'),_0x38c9b4)['where']('deletedAt\x20IS\x20NULL'))['where'](_0x500f('0x36'),squel[_0x500f('0x22')]()[_0x500f('0xf')]('MIN(id)','min_id')[_0x500f('0x23')](_0xb84c7f)[_0x500f('0x37')](_0x108722[_0x500f('0x14')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2ddc1d){logger[_0x500f('0x38')](_0x2ddc1d[_0x500f('0x39')]);process[_0x500f('0x3a')](0x1);}function handleError(_0x3e4c2c,_0x6aab09){stats[_0x500f('0x3b')][_0x500f('0x3c')]({'name':_0x6aab09[_0x500f('0x3d')],'message':_0x6aab09[_0x500f('0x39')],'row':_0x3e4c2c});}function handleQuery(_0x1a8cef){logger[_0x500f('0x3e')](_0x1a8cef);return db['sequelize'][_0x500f('0x3f')](_0x1a8cef)[_0x500f('0x40')](function(_0x64df5e){results[_0x500f('0x3c')](_0x64df5e);})[_0x500f('0x41')](function(_0x57b404){logger[_0x500f('0x38')](_0x57b404[_0x500f('0x39')]);});}function main(_0x5c7025,_0xa449da,_0xfa7e97,_0x3ccf85){logger[_0x500f('0x3e')](_0x500f('0x42'),_0x5c7025,JSON[_0x500f('0x43')](_0xa449da));process[_0x500f('0x44')]('start');var _0x537c81=_0xa449da[_0x500f('0x45')];var _0x5b62e8=_0xa449da[_0x500f('0x46')];var _0x112831=path[_0x500f('0x14')](config[_0x500f('0x47')],_0x500f('0x48'),_0x5b62e8+_0x500f('0x49'));var _0x5cc6c3=_['keys'](_0x537c81)[_0x500f('0x14')]();logger[_0x500f('0x3e')](_0x500f('0x4a'),_0x5cc6c3);fs[_0x500f('0x4b')](_0x112831,_0x5cc6c3+'\x0a');Papa[_0x500f('0x4c')](fs[_0x500f('0x4d')](_0x5c7025),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5394dd,_0x53b564){try{for(var _0x5f48e7=0x0,_0x4ea5fe=[];_0x5f48e7<_0x5394dd['data'][_0x500f('0x4e')];_0x5f48e7++){stats[_0x500f('0x4f')]+=0x1;if(_0x5394dd[_0x500f('0x3b')][_0x5f48e7]){handleError(_0x5394dd[_0x500f('0x50')][_0x5f48e7],_0x5394dd['errors'][_0x5f48e7]);}else{var _0x187d90=[];for(var _0x590f04 in _0x537c81){if(_0x537c81[_0x500f('0x51')](_0x590f04)){if(_0x5394dd[_0x500f('0x50')][_0x5f48e7][_0x537c81[_0x590f04]]){var _0xeb7c66=_[_0x500f('0x52')](_0x5394dd[_0x500f('0x50')][_0x5f48e7][_0x537c81[_0x590f04]]['replace'](/"/g,'\x27'));switch(_0x590f04){case _0x500f('0x1c'):var _0xa0ccbd=moment(_0xeb7c66,_0x500f('0xd'),!![]);if(_0xa0ccbd[_0x500f('0x53')]()){_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');}else{_0x187d90[_0x500f('0x3c')](_0x500f('0x54'));}break;case _0x500f('0x20'):var _0x1ad776=parseInt(_0xeb7c66);_0xeb7c66=_[_0x500f('0x55')](_0x1ad776)||_0x1ad776<0x0||_0x1ad776>0x4?_0x3ccf85?0x3:0x2:_0x1ad776;_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');break;case _0x500f('0x56'):var _0x4c5117=parseInt(_0xeb7c66);if(_['isNumber'](_0x4c5117)&&_[_0x500f('0x57')](_0xfa7e97,_0x4c5117)){_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0x4c5117+'\x22');}else{_0x187d90[_0x500f('0x3c')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0xeb7c66)){_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');}else{_0x187d90[_0x500f('0x3c')](_0x500f('0x58'));}break;case _0x500f('0x59'):var _0x2c8fc0=moment(_0xeb7c66,_0x500f('0x5a'),!![]);if(_0x2c8fc0[_0x500f('0x53')]()){_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');}else{_0x187d90['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');}}else{switch(_0x590f04){case _0x500f('0x5b'):case _0x500f('0x10'):_0x187d90['push'](_0x590f04+_0x500f('0x5c'));break;default:_0x4ea5fe[_0x500f('0x3c')]('\x22\x22');}}}}if(_0x187d90[_0x500f('0x4e')]){handleError(_0x5394dd['data'][_0x5f48e7],{'code':_0x500f('0x5d'),'message':_0x187d90[_0x500f('0x14')]()});}else{fs[_0x500f('0x5e')](_0x112831,_0x4ea5fe[_0x500f('0x14')]()+'\x0a');}_0x4ea5fe=[];}if(!(stats[_0x500f('0x4f')]%0xc8)){socket[_0x500f('0x5f')](_0x500f('0x60')+_0x5b62e8,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x53b564[_0x500f('0x61')]();}}catch(_0x3feec8){handleError(_0x5394dd[_0x500f('0x50')][_0x5f48e7],{'code':_0x500f('0x62'),'message':_0x3feec8[_0x500f('0x39')]});logger[_0x500f('0x38')](_0x500f('0x63'),_0x3feec8[_0x500f('0x39')]);}},'complete':function(){try{var _0x1fc552=[];var _0x1605ee=_0x500f('0x24');if(_0xa449da[_0x500f('0x64')]&&_0xa449da['duplicates'][_0x500f('0x4e')]){_0x1605ee=_0x500f('0x65')+_0x5b62e8;_0x1fc552['push'](_0x500f('0x66')+_0x1605ee+_0x500f('0x67'));}var _0x4c4d15=util[_0x500f('0x68')](_0x500f('0x69'),_0x112831,_0x1605ee,_0x5cc6c3,_0xa449da[_0x500f('0x1e')],_0xa449da[_0x500f('0x33')]||null,NOW,NOW);if(_[_0x500f('0x6a')](_0x537c81['scheduledat'])){_0x4c4d15+=',\x20scheduledAt\x20=\x20NOW()';}_0x1fc552['push'](_0x4c4d15);if(_0xa449da[_0x500f('0x64')]&&_0xa449da[_0x500f('0x64')]['length']){_0x1fc552[_0x500f('0x3c')](insertCmContact(_0xa449da['ListId'],_0x1605ee,_0xa449da[_0x500f('0x64')],_0x537c81));_0x1fc552['push'](_0x500f('0x6b')+_0x1605ee+';');}_0x1fc552[_0x500f('0x3c')](insertCmHopper(_0xa449da['ListId'],_0x500f('0x6c'),_0x500f('0x6d'),_0x500f('0x6e'),_0x3ccf85));_0x1fc552[_0x500f('0x3c')](insertCmHopperBlack(_0xa449da[_0x500f('0x1e')],_0x500f('0x6f'),_0x500f('0x6d'),_0x500f('0x6e')));_0x1fc552['push'](insertCmHopper(_0xa449da[_0x500f('0x1e')],_0x500f('0x70'),'campaigns','CampaignId',_0x3ccf85));_0x1fc552[_0x500f('0x3c')](insertCmHopperBlack(_0xa449da['ListId'],'campaigns_has_cm_blacklists',_0x500f('0x71'),_0x500f('0x72')));BPromise['each'](_0x1fc552,handleQuery)[_0x500f('0x73')](function(_0x50edc8){stats['finish']=!![];stats['affectedRows']=_0xa449da[_0x500f('0x64')]&&_0xa449da[_0x500f('0x64')]['length']?results[0x2]['affectedRows']:results[0x0][_0x500f('0x74')];socket[_0x500f('0x5f')](_0x500f('0x60')+_0x5b62e8,stats);fs[_0x500f('0x75')](_0x5c7025);fs['unlink'](_0x112831);process[_0x500f('0x3a')](0x0);})[_0x500f('0x41')](function(_0x655eba){logger[_0x500f('0x38')](_0x655eba[_0x500f('0x39')]);process[_0x500f('0x3a')](0x1);});}catch(_0x2bcd1c){logger[_0x500f('0x38')]('complete',_0x2bcd1c[_0x500f('0x39')]);process[_0x500f('0x3a')](0x1);}},'error':function(_0x53aaf2,_0x59ade8,_0x318eb0,_0x28ec79){throw new Error(_0x28ec79);}});}function validate(){if(process[_0x500f('0x76')]&&process[_0x500f('0x76')][_0x500f('0x4e')]<0x4){throw new Error(_0x500f('0x77'));}var _0x13936f=path[_0x500f('0x14')](config['root'],_0x500f('0x48'),process[_0x500f('0x76')][0x2]);if(!fs['existsSync'](_0x13936f)){throw new Error(_0x500f('0x78'));}var _0x352402={};try{_0x352402=JSON[_0x500f('0x4c')](process[_0x500f('0x76')][0x3]);if(!_0x352402[_0x500f('0x45')]){throw new Error(_0x500f('0x79'));}if(!_0x352402[_0x500f('0x45')]['phone']){throw new Error(_0x500f('0x7a'));}if(!_0x352402[_0x500f('0x45')][_0x500f('0x5b')]){throw new Error(_0x500f('0x7b'));}var _0x1f5a6f=0x0;if(_0x352402[_0x500f('0x45')][_0x500f('0x56')]){_0x1f5a6f=0x1;}if(!_0x352402['ListId']){throw new Error(_0x500f('0x7c'));}}catch(_0x1998a3){throw new Error(_0x500f('0x7d'));}var _0x17912e=[];try{_0x17912e=_[_0x500f('0x7e')](JSON[_0x500f('0x4c')](process[_0x500f('0x76')][0x4]),'id');}catch(_0x2fa928){logger[_0x500f('0x3e')](_0x500f('0x7f'));}main(_0x13936f,_0x352402,_0x17912e,_0x1f5a6f);}validate();process['on'](_0x500f('0x80'),handleStop);process['on'](_0x500f('0x81'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 697b972..1a298dd 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 _0x5e94=['string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','calleridnum','outbound','getDescriptions','***\x20Call\x20Info\x20***','variable','keyValue','Caller\x20Name','calleridname','Call\x20To','Queue','UniqueId','uniqueid','agentcalledAt','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Date','starttime','answertime','Complete\x20Time','endtime','Billable\x20Time','billableseconds','getSubjects'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x5e94,0x14f));var _0x45e9=function(_0x19b4aa,_0x3353be){_0x19b4aa=_0x19b4aa-0x0;var _0x40479e=_0x5e94[_0x19b4aa];return _0x40479e;};'use strict';exports[_0x45e9('0x0')]=function(_0x5adfdb,_0x161f43){var _0x3edbd1=[{'type':_0x45e9('0x1'),'content':_0x45e9('0x2'),'variableName':null}];switch(_0x5adfdb[_0x45e9('0x3')]()){case _0x45e9('0x4'):switch(_0x161f43['toLowerCase']()){case _0x45e9('0x5'):_0x3edbd1[_0x45e9('0x6')]({'type':'variable','content':'','variableName':_0x45e9('0x7')});_0x3edbd1[_0x45e9('0x6')]({'type':'variable','content':'','variableName':_0x45e9('0x8')});break;case _0x45e9('0x9'):_0x3edbd1[_0x45e9('0x6')]({'type':_0x45e9('0x1'),'content':'Outbound\x20Call','variableName':null});_0x3edbd1[_0x45e9('0x6')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x3edbd1;};exports[_0x45e9('0xa')]=function(_0x1eacb1,_0x318efb){var _0x1fe3c1=[];switch(_0x1eacb1[_0x45e9('0x3')]()){case _0x45e9('0x4'):switch(_0x318efb['toLowerCase']()){case _0x45e9('0x5'):_0x1fe3c1=[{'type':'string','content':_0x45e9('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0x45e9('0xc'),'variableName':'calleridnum'},{'type':_0x45e9('0xd'),'content':'','key':_0x45e9('0xe'),'keyType':_0x45e9('0xc'),'variableName':_0x45e9('0xf')},{'type':_0x45e9('0xd'),'content':'','key':_0x45e9('0x10'),'keyType':'variable','variableName':'destexten'},{'type':'keyValue','content':'','key':_0x45e9('0x11'),'keyType':_0x45e9('0xc'),'variableName':_0x45e9('0x7')},{'type':'keyValue','content':'','key':_0x45e9('0x12'),'keyType':'variable','variableName':_0x45e9('0x13')},{'type':_0x45e9('0xd'),'content':'','key':'Date','keyType':_0x45e9('0xc'),'variableName':_0x45e9('0x14')},{'type':_0x45e9('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x45e9('0x15'),'keyType':'variable','variableName':_0x45e9('0x16')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0x45e9('0xc'),'variableName':'destcalleridnum'},{'type':_0x45e9('0x1'),'content':_0x45e9('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x45e9('0xd'),'content':'','key':_0x45e9('0x18'),'keyType':_0x45e9('0xc'),'variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x45e9('0x19')},{'type':_0x45e9('0xd'),'content':'','key':_0x45e9('0x1a'),'keyType':_0x45e9('0xc'),'variableName':_0x45e9('0x1b')},{'type':_0x45e9('0xd'),'content':'','key':_0x45e9('0x1c'),'keyType':'variable','variableName':_0x45e9('0x1d')},{'type':_0x45e9('0xd'),'content':'','key':_0x45e9('0x1e'),'keyType':_0x45e9('0xc'),'variableName':_0x45e9('0x1f')}];break;case'outbound':_0x1fe3c1=[{'type':_0x45e9('0x1'),'content':_0x45e9('0xb'),'variableName':null},{'type':'keyValue','content':'','key':_0x45e9('0x20'),'keyType':_0x45e9('0xc'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x45e9('0xd'),'content':'','key':_0x45e9('0x21'),'keyType':_0x45e9('0xc'),'keyContent':'','variableName':_0x45e9('0x22')},{'type':_0x45e9('0xd'),'content':'','key':'UniqueId','keyType':_0x45e9('0xc'),'keyContent':'','variableName':'uniqueid'},{'type':_0x45e9('0xd'),'content':'','key':_0x45e9('0x23'),'keyType':_0x45e9('0xc'),'keyContent':'','variableName':_0x45e9('0x24')},{'type':_0x45e9('0x1'),'content':_0x45e9('0x17')},{'type':_0x45e9('0xd'),'content':'','key':'Answer\x20Time','keyType':_0x45e9('0xc'),'keyContent':'','variableName':_0x45e9('0x25')},{'type':'keyValue','content':'','key':_0x45e9('0x26'),'keyType':_0x45e9('0xc'),'keyContent':'','variableName':_0x45e9('0x27')},{'type':_0x45e9('0xd'),'content':'','key':'Duration','keyType':_0x45e9('0xc'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0x45e9('0x28'),'keyType':_0x45e9('0xc'),'keyContent':'','variableName':_0x45e9('0x29')}];break;}}return _0x1fe3c1;}; \ No newline at end of file +var _0xfacb=['Call\x20To','destexten','Queue','UniqueId','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Member\x20Name','membername','starttime','Answer\x20Time','Complete\x20Time','endtime','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','Outbound\x20Call','inbound','Caller\x20Number','Caller\x20Name','calleridname','keyValue'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0xfacb,0x6f));var _0xbfac=function(_0xbf271,_0x304f2f){_0xbf271=_0xbf271-0x0;var _0x4a27f8=_0xfacb[_0xbf271];return _0x4a27f8;};'use strict';exports[_0xbfac('0x0')]=function(_0x4b0e5f,_0x54f449){var _0x52de30=[{'type':_0xbfac('0x1'),'content':_0xbfac('0x2'),'variableName':null}];switch(_0x4b0e5f[_0xbfac('0x3')]()){case _0xbfac('0x4'):switch(_0x54f449[_0xbfac('0x3')]()){case'inbound':_0x52de30[_0xbfac('0x5')]({'type':_0xbfac('0x6'),'content':'','variableName':_0xbfac('0x7')});_0x52de30['push']({'type':_0xbfac('0x6'),'content':'','variableName':_0xbfac('0x8')});break;case'outbound':_0x52de30[_0xbfac('0x5')]({'type':'string','content':_0xbfac('0x9'),'variableName':null});_0x52de30['push']({'type':_0xbfac('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x52de30;};exports['getDescriptions']=function(_0x54033c,_0x4f6a9a){var _0x1e2955=[];switch(_0x54033c[_0xbfac('0x3')]()){case _0xbfac('0x4'):switch(_0x4f6a9a[_0xbfac('0x3')]()){case _0xbfac('0xa'):_0x1e2955=[{'type':_0xbfac('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xbfac('0xb'),'keyType':_0xbfac('0x6'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0xbfac('0xc'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0xd')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0xf'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x10')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x11'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x7')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x12'),'keyType':'variable','variableName':'uniqueid'},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x13'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x14')},{'type':_0xbfac('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x15'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x16')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x17'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x18')},{'type':_0xbfac('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x19'),'keyType':_0xbfac('0x6'),'variableName':'agentcalledAt'},{'type':_0xbfac('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x1a')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x1b'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x1c')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x1d'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x1e')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x1f'),'keyType':'variable','variableName':_0xbfac('0x20')}];break;case'outbound':_0x1e2955=[{'type':_0xbfac('0x1'),'content':_0xbfac('0x21'),'variableName':null},{'type':_0xbfac('0xe'),'content':'','key':'Called\x20Number','keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x18')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x22'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x23')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x12'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x13'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x24')},{'type':_0xbfac('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x25'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x26'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x27')},{'type':_0xbfac('0xe'),'content':'','key':'Duration','keyType':_0xbfac('0x6'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0xbfac('0x28'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x29')}];break;}}return _0x1e2955;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index a800c1a..466eef2 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 _0x2acc=['error','tracked','user','clone','body','omit','html','phone','mobile','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','toLowerCase','toUpperCase','name','role','stringify','null','findOne','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2acc,0x1a9));var _0xc2ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2acc[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc2ac('0x0'));var db=require(_0xc2ac('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xc2ac('0x2')),'mail':require(_0xc2ac('0x3'))(_0xc2ac('0x4')),'fax':require('../../config/logger')(_0xc2ac('0x5')),'sms':require(_0xc2ac('0x3'))(_0xc2ac('0x6')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0xc2ac('0x3'))('whatsapp-interactions')};function getInteractionId(_0x214f00,_0x5198eb,_0x31a9c3){if(_0x214f00&&_0x214f00[_[_0xc2ac('0x7')](_0x31a9c3)+_0xc2ac('0x8')]){return _0x214f00[_[_0xc2ac('0x7')](_0x31a9c3)+_0xc2ac('0x8')];}else if(_0x214f00&&_0x214f00['id']){return _0x214f00['id'];}else if(_0x5198eb&&_0x5198eb['id']){return _0x5198eb['id'];}else{return'unknown';}}function log(_0x52cb19,_0x5f4bde,_0x43e383,_0x3eed6b,_0x35123d,_0x5bf0c2){loggers[_0x35123d[_0xc2ac('0x9')]()][_0x52cb19]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5bf0c2[_0xc2ac('0xa')](),_0x5f4bde?_0x5f4bde['id']:null,_0x5f4bde?_0x5f4bde[_0xc2ac('0xb')]:null,_0x5f4bde?_0x5f4bde[_0xc2ac('0xc')]:null,getInteractionId(_0x43e383,_0x3eed6b,_0x35123d),_0x43e383?JSON[_0xc2ac('0xd')](_0x43e383):_0xc2ac('0xe'));}function updateUser(_0x454471,_0x521c54,_0x1b5a6f,_0x5355ea,_0x248a91){db[_[_0xc2ac('0x7')](_0x5355ea)+'Interaction'][_0xc2ac('0xf')]({'where':{'id':getInteractionId(_0x521c54,_0x1b5a6f,_0x5355ea)}})['then'](function(_0x116742){if(_0x116742){return _0x116742[_0xc2ac('0x10')]({'UserId':_0x454471?_0x454471['id']:null});}})['then'](function(_0x13dcd4){if(_0x13dcd4){log('info',_0x454471,_0x521c54,_0x1b5a6f,_0x5355ea,_0x248a91);}})['catch'](function(){log(_0xc2ac('0x11'),_0x454471,_0x521c54,_0x1b5a6f,_0x5355ea,_0x248a91);});}exports[_0xc2ac('0x12')]=function(_0x47dfed,_0x45b711){return function(_0x5b4996,_0x29e36d,_0x121d2c){var _0x3a586b=_0x5b4996[_0xc2ac('0x13')];var _0x1d575f={};var _0x3b74dd=_0x5b4996['query'];if(_0x1d575f){_0x1d575f=_[_0xc2ac('0x14')](_0x5b4996[_0xc2ac('0x15')]);_0x1d575f=_[_0xc2ac('0x16')](_0x1d575f,[_0xc2ac('0x15'),_0xc2ac('0x17'),_0xc2ac('0x18'),'fax',_0xc2ac('0x19')]);}updateUser(_0x3a586b,_0x1d575f,_0x3b74dd,_0x47dfed,_0x45b711);_0x121d2c(null);};}; \ No newline at end of file +var _0x5a01=['sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','tracked','user','clone','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','mail-interactions'];(function(_0x3cc762,_0x2babfc){var _0x4dd5a1=function(_0x1fd50b){while(--_0x1fd50b){_0x3cc762['push'](_0x3cc762['shift']());}};_0x4dd5a1(++_0x2babfc);}(_0x5a01,0x1af));var _0x15a0=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0x5a01[_0x40b2ed];return _0x18397d;};'use strict';var _=require(_0x15a0('0x0'));var db=require(_0x15a0('0x1'))['db'];var loggers={'openchannel':require(_0x15a0('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x15a0('0x3')),'fax':require(_0x15a0('0x2'))('fax-interactions'),'sms':require(_0x15a0('0x2'))(_0x15a0('0x4')),'chat':require(_0x15a0('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0x15a0('0x5'))};function getInteractionId(_0x52ab0,_0x40fd51,_0x502248){if(_0x52ab0&&_0x52ab0[_[_0x15a0('0x6')](_0x502248)+_0x15a0('0x7')]){return _0x52ab0[_[_0x15a0('0x6')](_0x502248)+_0x15a0('0x7')];}else if(_0x52ab0&&_0x52ab0['id']){return _0x52ab0['id'];}else if(_0x40fd51&&_0x40fd51['id']){return _0x40fd51['id'];}else{return _0x15a0('0x8');}}function log(_0x5d6fb5,_0x4be840,_0x339f74,_0x4541a0,_0x104f09,_0x24497a){loggers[_0x104f09[_0x15a0('0x9')]()][_0x5d6fb5](_0x15a0('0xa'),_0x24497a[_0x15a0('0xb')](),_0x4be840?_0x4be840['id']:null,_0x4be840?_0x4be840[_0x15a0('0xc')]:null,_0x4be840?_0x4be840[_0x15a0('0xd')]:null,getInteractionId(_0x339f74,_0x4541a0,_0x104f09),_0x339f74?JSON[_0x15a0('0xe')](_0x339f74):_0x15a0('0xf'));}function updateUser(_0x418907,_0x58c549,_0x520a82,_0x3d80e9,_0x1bacb4){db[_[_0x15a0('0x6')](_0x3d80e9)+_0x15a0('0x10')][_0x15a0('0x11')]({'where':{'id':getInteractionId(_0x58c549,_0x520a82,_0x3d80e9)}})[_0x15a0('0x12')](function(_0x2595c1){if(_0x2595c1){return _0x2595c1[_0x15a0('0x13')]({'UserId':_0x418907?_0x418907['id']:null});}})[_0x15a0('0x12')](function(_0x547d10){if(_0x547d10){log(_0x15a0('0x14'),_0x418907,_0x58c549,_0x520a82,_0x3d80e9,_0x1bacb4);}})['catch'](function(){log('error',_0x418907,_0x58c549,_0x520a82,_0x3d80e9,_0x1bacb4);});}exports[_0x15a0('0x15')]=function(_0x2896bb,_0x45cf59){return function(_0x29383c,_0x5d4373,_0x5e7b01){var _0x5044c0=_0x29383c[_0x15a0('0x16')];var _0x56a2be={};var _0x1a71b6=_0x29383c['query'];if(_0x56a2be){_0x56a2be=_[_0x15a0('0x17')](_0x29383c[_0x15a0('0x18')]);_0x56a2be=_[_0x15a0('0x19')](_0x56a2be,[_0x15a0('0x18'),_0x15a0('0x1a'),_0x15a0('0x1b'),_0x15a0('0x1c'),'mobile']);}updateUser(_0x5044c0,_0x56a2be,_0x1a71b6,_0x2896bb,_0x45cf59);_0x5e7b01(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 18420e2..1f312cb 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 _0xe7c8=['catch','users','User','admin','crypto','util','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update','utf8','parse','use','License','then','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x1ee7e4,_0x4ba132){var _0x4a99aa=function(_0x115d2d){while(--_0x115d2d){_0x1ee7e4['push'](_0x1ee7e4['shift']());}};_0x4a99aa(++_0x4ba132);}(_0xe7c8,0x8e));var _0x8e7c=function(_0x56f3d4,_0xfc65dd){_0x56f3d4=_0x56f3d4-0x0;var _0x2c7ef0=_0xe7c8[_0x56f3d4];return _0x2c7ef0;};'use strict';var crypto=require(_0x8e7c('0x0'));var util=require(_0x8e7c('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x8e7c('0x2'));function getValueFromLicense(_0x4b5154,_0x478c9f){if(_0x4b5154&&_0x478c9f){if(_0x478c9f[_0x8e7c('0x3')]&&_0x478c9f[_0x8e7c('0x4')]){var _0x434434=_0x478c9f[_0x8e7c('0x3')];var _0x1e86a5=_0x478c9f[_0x8e7c('0x4')];var _0x2bedfc=_0x434434[_0x8e7c('0x5')]('-')[0x4];var _0x18074b=_0x434434[_0x8e7c('0x5')]('-')[0x0];var _0x3e8fd2=crypto[_0x8e7c('0x6')](_0x8e7c('0x7'),util['format'](_0x8e7c('0x8'),_0x2bedfc,_0x434434,_0x18074b));var _0x43dadf=_0x3e8fd2[_0x8e7c('0x9')](_0x1e86a5,'base64',_0x8e7c('0xa'));_0x43dadf+=_0x3e8fd2['final'](_0x8e7c('0xa'));var _0x8597f7=JSON[_0x8e7c('0xb')](_0x43dadf);return _0x8597f7['hasOwnProperty'](_0x4b5154)?_0x8597f7[_0x4b5154]:null;}}return null;}function isLimit(_0x1e2796,_0x264837,_0x4ca431,_0x3ae907){var _0x52e569=_0x264837;return compose()[_0x8e7c('0xc')](function(_0x96e099,_0x249361,_0x42c0db){return db[_0x8e7c('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x8e7c('0xe')](function(_0x5e491c){var _0x90828f=getValueFromLicense(_0x1e2796,_0x5e491c);return _0x90828f?_0x90828f:_0x52e569;})[_0x8e7c('0xe')](function(_0x2b478a){_0x52e569=_0x2b478a;return _0x4ca431['count'](_0x3ae907);})['then'](function(_0x2f3352){if(_0x2f3352>=_0x52e569){return _0x249361[_0x8e7c('0xf')](0x193)[_0x8e7c('0x10')]({'message':util[_0x8e7c('0x11')](_0x8e7c('0x12'),_0x1e2796)});}_0x42c0db();})[_0x8e7c('0x13')](function(_0x49123c){_0x42c0db(_0x49123c);});});}function isUserLimit(){return isLimit(_0x8e7c('0x14'),0x1,db[_0x8e7c('0x15')],{'where':{'$or':[{'role':_0x8e7c('0x16')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xc9bf=['json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','../../mysqldb','../../config/environment','data1','license','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status'];(function(_0xc61ea8,_0x56e451){var _0x22c845=function(_0x143785){while(--_0x143785){_0xc61ea8['push'](_0xc61ea8['shift']());}};_0x22c845(++_0x56e451);}(_0xc9bf,0x130));var _0xfc9b=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xc9bf[_0x8a969d];return _0x1d8dc7;};'use strict';var crypto=require(_0xfc9b('0x0'));var util=require(_0xfc9b('0x1'));var compose=require('composable-middleware');var db=require(_0xfc9b('0x2'))['db'];var config=require(_0xfc9b('0x3'));function getValueFromLicense(_0x5c1d90,_0x525179){if(_0x5c1d90&&_0x525179){if(_0x525179[_0xfc9b('0x4')]&&_0x525179['license']){var _0x3f2632=_0x525179[_0xfc9b('0x4')];var _0x32c3aa=_0x525179[_0xfc9b('0x5')];var _0x5ac23b=_0x3f2632['split']('-')[0x4];var _0x4b9787=_0x3f2632['split']('-')[0x0];var _0x4835de=crypto['createDecipher'](_0xfc9b('0x6'),util[_0xfc9b('0x7')](_0xfc9b('0x8'),_0x5ac23b,_0x3f2632,_0x4b9787));var _0x2674c1=_0x4835de['update'](_0x32c3aa,_0xfc9b('0x9'),_0xfc9b('0xa'));_0x2674c1+=_0x4835de[_0xfc9b('0xb')](_0xfc9b('0xa'));var _0x1d3c1d=JSON[_0xfc9b('0xc')](_0x2674c1);return _0x1d3c1d[_0xfc9b('0xd')](_0x5c1d90)?_0x1d3c1d[_0x5c1d90]:null;}}return null;}function isLimit(_0x30b076,_0x5b4222,_0x3b96dd,_0x430d5e){var _0xe6765b=_0x5b4222;return compose()[_0xfc9b('0xe')](function(_0x383303,_0x620661,_0x31b1fe){return db[_0xfc9b('0xf')][_0xfc9b('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xfc9b('0x11')](function(_0x7a4448){var _0x3e4f3a=getValueFromLicense(_0x30b076,_0x7a4448);return _0x3e4f3a?_0x3e4f3a:_0xe6765b;})['then'](function(_0x5e6181){_0xe6765b=_0x5e6181;return _0x3b96dd[_0xfc9b('0x12')](_0x430d5e);})['then'](function(_0x463c44){if(_0x463c44>=_0xe6765b){return _0x620661[_0xfc9b('0x13')](0x193)[_0xfc9b('0x14')]({'message':util['format'](_0xfc9b('0x15'),_0x30b076)});}_0x31b1fe();})[_0xfc9b('0x16')](function(_0x3fd362){_0x31b1fe(_0x3fd362);});});}function isUserLimit(){return isLimit(_0xfc9b('0x17'),0x1,db[_0xfc9b('0x18')],{'where':{'$or':[{'role':_0xfc9b('0x19')},{'role':_0xfc9b('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 6658798..f2d6e3b 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 _0x6953=['$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','start','pop','utcOffset','hours','seconds','lodash','moment','startsWith','[$or]','replace','[$and]','split','length','slice','shift','forEach','map','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','CAST(','text','field','$ne','$notIn','\x20OR\x20'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x6953,0x131));var _0x3695=function(_0x511434,_0x7b3803){_0x511434=_0x511434-0x0;var _0x174359=_0x6953[_0x511434];return _0x174359;};'use strict';var _=require(_0x3695('0x0'));var moment=require(_0x3695('0x1'));exports['parseSearch']=function(_0x1c1033){var _0x302288={'conditions':[]};_0x302288['sqlOperator']=_[_0x3695('0x2')](_0x1c1033,_0x3695('0x3'))?'or':'and';var _0x1da4ff=_0x1c1033[_0x3695('0x4')](_0x3695('0x5'),'')[_0x3695('0x4')](_0x3695('0x3'),'')[_0x3695('0x6')]('||');for(var _0x2d095a=0x0;_0x2d095a<_0x1da4ff[_0x3695('0x7')];_0x2d095a++){var _0x1b43a7=_0x1da4ff[_0x2d095a][_0x3695('0x6')](':=');var _0x271521=_0x1b43a7[0x0];var _0x94daef=_0x1b43a7[_0x3695('0x8')](0x1);_0x94daef['forEach'](function(_0x4736db){var _0x29c45d=_0x4736db[_0x3695('0x6')]('[')[_0x3695('0x9')]();var _0x31dab9=_0x4736db['match'](/\[(.*?)\]/g);_0x31dab9[_0x3695('0xa')](function(_0x5a79f3){var _0xa87a74=_0x5a79f3[_0x3695('0x6')]('[')['filter'](function(_0x5329c1){return _0x5329c1['indexOf'](']')>-0x1;})[_0x3695('0xb')](function(_0x86f851){return _0x86f851[_0x3695('0x6')](']')[0x0];})[0x0];_0x302288['conditions']['push']({'field':_0x271521,'operator':_0x29c45d,'value':_0xa87a74});});});}return _0x302288;};exports['buildExpression']=function(_0x339dab,_0x369183,_0x1a5914){var _0x3debaa={};if(_0x369183===_0x3695('0xc')){if(_0x1a5914[_0x3695('0xd')]===_0x3695('0xe')){_0x1a5914['operator']=_0x3695('0xf');_0x1a5914[_0x3695('0x10')]+=','+_0x1a5914['value'];}else if(_[_0x3695('0x11')]([_0x3695('0x12'),_0x3695('0x13')],_0x1a5914[_0x3695('0xd')])){_0x1a5914['value']=moment(_0x1a5914[_0x3695('0x10')])[_0x3695('0x14')](0x1,_0x3695('0x15'))[_0x3695('0x16')](_0x3695('0x17'));}}if(_0x1a5914[_0x3695('0x18')]){_0x369183=_0x1a5914[_0x3695('0x18')];_0x3debaa['text']=_0x3695('0x19')+_0x339dab+'.'+_0x1a5914['field']+'\x20AS\x20'+_0x1a5914[_0x3695('0x18')]+')\x20'+parseOperator(_0x1a5914[_0x3695('0xd')]);}else{_0x3debaa[_0x3695('0x1a')]=_0x339dab+'.'+_0x1a5914[_0x3695('0x1b')]+'\x20'+parseOperator(_0x1a5914[_0x3695('0xd')]);}if(_[_0x3695('0x11')]([_0x3695('0x1c'),_0x3695('0x1d')],_0x1a5914[_0x3695('0xd')]))_0x3debaa[_0x3695('0x1a')]='('+_0x3debaa[_0x3695('0x1a')]+_0x3695('0x1e')+_0x339dab+'.'+_0x1a5914[_0x3695('0x1b')]+'\x20IS\x20NULL)';_0x3debaa['value']=parseValue(_0x369183,_0x1a5914[_0x3695('0xd')],_0x1a5914[_0x3695('0x10')]);return _0x3debaa;};function parseOperator(_0x2a1e23){var _0x1551a1;switch(_0x2a1e23){case _0x3695('0x1f'):_0x1551a1=_0x3695('0x20');break;case _0x3695('0x1d'):_0x1551a1=_0x3695('0x21');break;case _0x3695('0xe'):_0x1551a1=_0x3695('0x22');break;case'$ne':_0x1551a1=_0x3695('0x23');break;case'$substring':case _0x3695('0x24'):case _0x3695('0x25'):_0x1551a1=_0x3695('0x26');break;case _0x3695('0x27'):_0x1551a1=_0x3695('0x28');break;case _0x3695('0x12'):_0x1551a1='>\x20?';break;case _0x3695('0x13'):_0x1551a1=_0x3695('0x29');break;case _0x3695('0x2a'):_0x1551a1='>=\x20?';break;case _0x3695('0xf'):_0x1551a1='BETWEEN\x20?\x20AND\x20?';break;}return _0x1551a1;}function parseValue(_0xe06024,_0x290134,_0x4e3c84){var _0x4aa116={'start':undefined,'end':undefined};switch(_0x290134){case'$in':case'$notIn':_0x4aa116[_0x3695('0x2b')]=_0x4e3c84[_0x3695('0x6')](',');break;case'$substring':_0x4aa116[_0x3695('0x2b')]='%'+_0x4e3c84+'%';break;case _0x3695('0x24'):_0x4aa116[_0x3695('0x2b')]=_0x4e3c84+'%';break;case _0x3695('0x25'):_0x4aa116[_0x3695('0x2b')]='%'+_0x4e3c84;break;case _0x3695('0xf'):var _0x36dd1c=_0x4e3c84[_0x3695('0x6')](',');var _0x4e3c84=_0x36dd1c[_0x3695('0x9')]();var _0x21824b=_0x36dd1c[_0x3695('0x2c')]();if(_0xe06024===_0x3695('0xc')){_0x4e3c84=moment(_0x4e3c84)[_0x3695('0x2d')](0x0,!![])[_0x3695('0x16')]();_0x21824b=moment(_0x21824b)[_0x3695('0x2d')](0x0,!![])[_0x3695('0x14')](0x17,_0x3695('0x2e'))[_0x3695('0x14')](0x3b,'minutes')[_0x3695('0x14')](0x3b,_0x3695('0x2f'))[_0x3695('0x16')]();}_0x4aa116={'start':_0x4e3c84,'end':_0x21824b};break;default:_0x4aa116[_0x3695('0x2b')]=_0x4e3c84;break;}return _0x4aa116;} \ No newline at end of file +var _0xd548=['format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','$lt','<\x20?','>\x20?','$lte','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn','start','$startsWith','pop','DATE','utcOffset','hours','seconds','moment','sqlOperator','[$or]','and','[$and]','replace','split','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','operator','$between','value','includes','$gt','add'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd548,0x133));var _0x8d54=function(_0x57e1fb,_0x80bc3d){_0x57e1fb=_0x57e1fb-0x0;var _0x320c25=_0xd548[_0x57e1fb];return _0x320c25;};'use strict';var _=require('lodash');var moment=require(_0x8d54('0x0'));exports['parseSearch']=function(_0x4b6417){var _0x135b43={'conditions':[]};_0x135b43[_0x8d54('0x1')]=_['startsWith'](_0x4b6417,_0x8d54('0x2'))?'or':_0x8d54('0x3');var _0x153044=_0x4b6417['replace'](_0x8d54('0x4'),'')[_0x8d54('0x5')]('[$or]','')[_0x8d54('0x6')]('||');for(var _0x115e12=0x0;_0x115e12<_0x153044['length'];_0x115e12++){var _0xdbb12c=_0x153044[_0x115e12]['split'](':=');var _0x4f9395=_0xdbb12c[0x0];var _0x48a5dc=_0xdbb12c[_0x8d54('0x7')](0x1);_0x48a5dc[_0x8d54('0x8')](function(_0x3dbb69){var _0x522eb0=_0x3dbb69[_0x8d54('0x6')]('[')[_0x8d54('0x9')]();var _0x69a94=_0x3dbb69[_0x8d54('0xa')](/\[(.*?)\]/g);_0x69a94[_0x8d54('0x8')](function(_0x488dc7){var _0x5a0f64=_0x488dc7[_0x8d54('0x6')]('[')[_0x8d54('0xb')](function(_0x593fbc){return _0x593fbc[_0x8d54('0xc')](']')>-0x1;})[_0x8d54('0xd')](function(_0x4fe042){return _0x4fe042[_0x8d54('0x6')](']')[0x0];})[0x0];_0x135b43[_0x8d54('0xe')][_0x8d54('0xf')]({'field':_0x4f9395,'operator':_0x522eb0,'value':_0x5a0f64});});});}return _0x135b43;};exports[_0x8d54('0x10')]=function(_0x2a92c5,_0x43caba,_0x1d9408){var _0x3c35c4={};if(_0x43caba==='DATE'){if(_0x1d9408[_0x8d54('0x11')]==='$eq'){_0x1d9408[_0x8d54('0x11')]=_0x8d54('0x12');_0x1d9408['value']+=','+_0x1d9408[_0x8d54('0x13')];}else if(_[_0x8d54('0x14')]([_0x8d54('0x15'),'$lte'],_0x1d9408[_0x8d54('0x11')])){_0x1d9408[_0x8d54('0x13')]=moment(_0x1d9408[_0x8d54('0x13')])[_0x8d54('0x16')](0x1,'days')[_0x8d54('0x17')](_0x8d54('0x18'));}}if(_0x1d9408[_0x8d54('0x19')]){_0x43caba=_0x1d9408[_0x8d54('0x19')];_0x3c35c4[_0x8d54('0x1a')]=_0x8d54('0x1b')+_0x2a92c5+'.'+_0x1d9408[_0x8d54('0x1c')]+_0x8d54('0x1d')+_0x1d9408[_0x8d54('0x19')]+')\x20'+parseOperator(_0x1d9408[_0x8d54('0x11')]);}else{_0x3c35c4[_0x8d54('0x1a')]=_0x2a92c5+'.'+_0x1d9408[_0x8d54('0x1c')]+'\x20'+parseOperator(_0x1d9408['operator']);}if(_[_0x8d54('0x14')]([_0x8d54('0x1e'),'$notIn'],_0x1d9408[_0x8d54('0x11')]))_0x3c35c4[_0x8d54('0x1a')]='('+_0x3c35c4['text']+_0x8d54('0x1f')+_0x2a92c5+'.'+_0x1d9408['field']+_0x8d54('0x20');_0x3c35c4['value']=parseValue(_0x43caba,_0x1d9408[_0x8d54('0x11')],_0x1d9408[_0x8d54('0x13')]);return _0x3c35c4;};function parseOperator(_0x13a4f9){var _0x44864b;switch(_0x13a4f9){case _0x8d54('0x21'):_0x44864b=_0x8d54('0x22');break;case'$notIn':_0x44864b='NOT\x20IN\x20?';break;case _0x8d54('0x23'):_0x44864b=_0x8d54('0x24');break;case _0x8d54('0x1e'):_0x44864b=_0x8d54('0x25');break;case _0x8d54('0x26'):case'$startsWith':case _0x8d54('0x27'):_0x44864b='LIKE\x20?';break;case _0x8d54('0x28'):_0x44864b=_0x8d54('0x29');break;case'$gt':_0x44864b=_0x8d54('0x2a');break;case _0x8d54('0x2b'):_0x44864b=_0x8d54('0x2c');break;case'$gte':_0x44864b=_0x8d54('0x2d');break;case'$between':_0x44864b=_0x8d54('0x2e');break;}return _0x44864b;}function parseValue(_0x20ff11,_0x35e7aa,_0x20f7a4){var _0xffc1c4={'start':undefined,'end':undefined};switch(_0x35e7aa){case _0x8d54('0x21'):case _0x8d54('0x2f'):_0xffc1c4[_0x8d54('0x30')]=_0x20f7a4[_0x8d54('0x6')](',');break;case _0x8d54('0x26'):_0xffc1c4[_0x8d54('0x30')]='%'+_0x20f7a4+'%';break;case _0x8d54('0x31'):_0xffc1c4[_0x8d54('0x30')]=_0x20f7a4+'%';break;case _0x8d54('0x27'):_0xffc1c4[_0x8d54('0x30')]='%'+_0x20f7a4;break;case _0x8d54('0x12'):var _0x5278b9=_0x20f7a4[_0x8d54('0x6')](',');var _0x20f7a4=_0x5278b9[_0x8d54('0x9')]();var _0x3283f9=_0x5278b9[_0x8d54('0x32')]();if(_0x20ff11===_0x8d54('0x33')){_0x20f7a4=moment(_0x20f7a4)[_0x8d54('0x34')](0x0,!![])[_0x8d54('0x17')]();_0x3283f9=moment(_0x3283f9)[_0x8d54('0x34')](0x0,!![])[_0x8d54('0x16')](0x17,_0x8d54('0x35'))[_0x8d54('0x16')](0x3b,'minutes')[_0x8d54('0x16')](0x3b,_0x8d54('0x36'))[_0x8d54('0x17')]();}_0xffc1c4={'start':_0x20f7a4,'end':_0x3283f9};break;default:_0xffc1c4['start']=_0x20f7a4;break;}return _0xffc1c4;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index dd1af2d..3d05543 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 _0x3488=['push','join','query','$id','model','fields','attributes','sort','pick','filter','where','merge','type','lower','options','lodash','moment','parse','keys','includes','split','filters','isEmpty','forOwn','DATE','isPlainObject','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','limit','offset','map','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isString','unset','hasOwnProperty','isNumeric','match','getFullTextValue','replace'];(function(_0x5b9fa1,_0x4dd147){var _0x4caa03=function(_0x2c0bf9){while(--_0x2c0bf9){_0x5b9fa1['push'](_0x5b9fa1['shift']());}};_0x4caa03(++_0x4dd147);}(_0x3488,0xe3));var _0x8348=function(_0x3ceab8,_0x30486f){_0x3ceab8=_0x3ceab8-0x0;var _0x3e9fe3=_0x3488[_0x3ceab8];return _0x3e9fe3;};'use strict';var _=require(_0x8348('0x0'));var sequelize=require('sequelize');var moment=require(_0x8348('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x17df52){var _0x3577c1=['ne'];try{var _0xedab9e=JSON[_0x8348('0x2')](_0x17df52);var _0x3ed8d8=Object[_0x8348('0x3')](_0xedab9e)[0x0];return _0x3577c1[_0x8348('0x4')](_0x3ed8d8);}catch(_0x4a21a8){return![];}}function getOperatorValue(_0x442325){var _0x5bb709=JSON['parse'](_0x442325);var _0x1da0e9=Object[_0x8348('0x3')](_0x5bb709)[0x0];var _0x21acc1=_0x5bb709[_0x1da0e9];return{['$'+_0x1da0e9]:_0x21acc1};}exports['fields']=function(_0x2f45bc){var _0x374549=null;if(_0x2f45bc){_0x374549=_0x2f45bc[_0x8348('0x5')](',');}return _0x374549;};exports[_0x8348('0x6')]=function(_0x4cbf57,_0x44b758){var _0x2cce07={};if(!_[_0x8348('0x7')](_0x4cbf57)){_[_0x8348('0x8')](_0x4cbf57,function(_0xe48a61,_0x3396e7){try{if(_0x44b758){var _0x2d276c=_['find'](_0x44b758,{'name':_0x3396e7})||{};if(hasSequelizeOperator(_0xe48a61)){_0x2cce07[_0x3396e7]=getOperatorValue(_0xe48a61);}else if(_0x2d276c['type']===_0x8348('0x9')&&_[_0x8348('0xa')](_0xe48a61)){var _0xdf1b5c=JSON[_0x8348('0x2')](_0xe48a61);var _0x599bf7={'$gte':moment(moment(_0xdf1b5c['$gte'])['format'](_0x8348('0xb')))[_0x8348('0xc')]()[_0x8348('0xd')](),'$lte':moment(moment(_0xdf1b5c[_0x8348('0xe')])[_0x8348('0xd')](_0x8348('0xb')))['utc']()[_0x8348('0xf')](0x1,'s')[_0x8348('0xd')]()};_0x2cce07[_0x3396e7]=_0x599bf7;}else if(_0x2d276c[_0x8348('0x10')]===_0x8348('0x11')){_0x2cce07[_0x3396e7]=_0xe48a61;}else{_0x2cce07[_0x3396e7]=_[_0x8348('0x12')](_0xe48a61)?_0xe48a61:JSON[_0x8348('0x2')](_0xe48a61);}}else{_0x2cce07[_0x3396e7]=_[_0x8348('0x12')](_0xe48a61)?_0xe48a61:JSON['parse'](_0xe48a61);}}catch(_0xf69be6){_0x2cce07[_0x3396e7]=_0xe48a61['split'](',');}});}return _0x2cce07;};exports[_0x8348('0x13')]=function(_0x17b92b){_0x17b92b=parseInt(_0x17b92b,0xa);if(!_0x17b92b||_0x17b92b<0x0){_0x17b92b=LIMIT_VALUE;}return _0x17b92b;};exports[_0x8348('0x14')]=function(_0x12ce5d){_0x12ce5d=parseInt(_0x12ce5d,0xa);if(!_0x12ce5d||_0x12ce5d<0x0){_0x12ce5d=0x0;}return _0x12ce5d;};exports['sort']=function(_0x3db2d1){var _0x44804a,_0x133d61=null;if(_0x3db2d1){_0x44804a=_0x3db2d1[_0x8348('0x5')](',');_0x133d61=_[_0x8348('0x15')](_0x44804a,function(_0x19d455){if(_0x19d455[_0x8348('0x16')]('-')===0x0){return[_0x19d455===_0x8348('0x17')?sequelize[_0x8348('0x18')](sequelize[_0x8348('0x19')](_0x8348('0x17')),_0x8348('0x1a')):_0x19d455['substr'](0x1),_0x8348('0x1b')];}else{return[_0x19d455==='priority'?sequelize['cast'](sequelize['col'](_0x8348('0x17')),'unsigned'):_0x19d455,_0x8348('0x1c')];}});}return _0x133d61;};exports[_0x8348('0x1d')]=function(_0x50de04,_0x156c94){if(_[_0x8348('0x7')](_0x50de04)){return _0x50de04;}if(_['isArray'](_0x50de04)){for(var _0x5e87c6=0x0;_0x5e87c6<_0x50de04[_0x8348('0x1e')];_0x5e87c6+=0x1){_0x50de04[_0x5e87c6]=this[_0x8348('0x1d')](_0x50de04[_0x5e87c6],_0x156c94);}return _0x50de04;}if(!_['isObject'](_0x50de04)){return _0x50de04;}if(_[_0x8348('0x1f')](_0x156c94)){_0x156c94=[_0x156c94];}if(!_[_0x8348('0x12')](_0x156c94)){return _0x50de04;}for(var _0x4b9d01=0x0;_0x4b9d01<_0x156c94[_0x8348('0x1e')];_0x4b9d01+=0x1){_[_0x8348('0x20')](_0x50de04,_0x156c94[_0x4b9d01]);}for(var _0x28c53f in _0x50de04){if(_0x50de04[_0x8348('0x21')](_0x28c53f)){_0x50de04[_0x28c53f]=this['omit'](_0x50de04[_0x28c53f],_0x156c94);}}return _0x50de04;};exports[_0x8348('0x22')]=function(_0x3fb988){return _0x3fb988[_0x8348('0x23')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x4aadfc){return _0x4aadfc[_0x8348('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x8348('0x24')]=function(_0x4b4b4e){var _0x314ca0=[];_0x4b4b4e[_0x8348('0x5')](/[ ,]+/)['forEach'](function(_0x4ef49f){_0x4ef49f=_0x4ef49f[_0x8348('0x25')](/([^:]")"+/g,'$1');_0x4ef49f='+'+_0x4ef49f+'*';if(_0x4ef49f[_0x8348('0x4')]('@'))_0x4ef49f='\x22'+_0x4ef49f+'\x22';_0x314ca0[_0x8348('0x26')](_0x4ef49f);});return _0x314ca0[_0x8348('0x27')]('\x20');};exports['getOptions']=function(_0x35128f,_0x2e3147,_0x46861a){var _0x39d07b={},_0x1ba469={};if(_0x2e3147[_0x8348('0x28')][_0x8348('0x29')]){_0x2e3147['query']['id']=_0x2e3147['query']['$id'];delete _0x2e3147[_0x8348('0x28')][_0x8348('0x29')];}_0x39d07b['model']=_[_0x8348('0x15')](_0x35128f,_0x8348('0x10'));_0x39d07b['query']=_[_0x8348('0x3')](_0x2e3147[_0x8348('0x28')]);_0x39d07b[_0x8348('0x6')]=_['intersection'](_0x39d07b[_0x8348('0x2a')],_0x39d07b['query']);_0x1ba469['attributes']=_['intersection'](_0x39d07b['model'],this['fields'](_0x2e3147[_0x8348('0x28')][_0x8348('0x2b')]));_0x1ba469['attributes']=_0x1ba469[_0x8348('0x2c')][_0x8348('0x1e')]?_0x1ba469[_0x8348('0x2c')]:_0x39d07b[_0x8348('0x2a')];if(!_0x2e3147[_0x8348('0x28')][_0x8348('0x21')]('nolimit')){_0x1ba469[_0x8348('0x13')]=this[_0x8348('0x13')](_0x2e3147[_0x8348('0x28')]['limit']);_0x1ba469[_0x8348('0x14')]=this[_0x8348('0x14')](_0x2e3147[_0x8348('0x28')]['offset']);}_0x1ba469['order']=this[_0x8348('0x2d')](_0x2e3147[_0x8348('0x28')][_0x8348('0x2d')]);_0x1ba469['where']=this[_0x8348('0x6')](_[_0x8348('0x2e')](_0x2e3147[_0x8348('0x28')],_0x39d07b[_0x8348('0x6')]),_0x35128f);if(_0x2e3147[_0x8348('0x28')][_0x8348('0x2f')]){_0x1ba469[_0x8348('0x30')]=_[_0x8348('0x31')](_0x1ba469[_0x8348('0x30')],{'$or':_[_0x8348('0x15')](_0x35128f,function(_0x406961){if(_0x406961[_0x8348('0x32')]!=='VIRTUAL'){if(_0x46861a){return sequelize['where'](sequelize['fn'](_0x8348('0x33'),sequelize['col'](_0x406961[_0x8348('0x10')])),{'$like':sequelize['fn'](_0x8348('0x33'),'%'+_0x2e3147[_0x8348('0x28')][_0x8348('0x2f')]+'%')});}else{var _0x200e16={};_0x200e16[_0x406961[_0x8348('0x10')]]={'$like':'%'+_0x2e3147['query'][_0x8348('0x2f')]+'%'};return _0x200e16;}}})});}_0x1ba469=_[_0x8348('0x31')]({},_0x1ba469,_0x2e3147[_0x8348('0x34')]);return _0x1ba469;}; \ No newline at end of file +var _0x9f1a=['match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','attributes','intersection','nolimit','limit','pick','filter','merge','where','VIRTUAL','lower','options','lodash','sequelize','parse','includes','keys','fields','split','filters','isEmpty','find','type','DATE','isPlainObject','format','YYYY-MM-DD','$lte','utc','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','col','substr','cast','unsigned','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric'];(function(_0x444050,_0x273b8b){var _0x20a7d0=function(_0x292db3){while(--_0x292db3){_0x444050['push'](_0x444050['shift']());}};_0x20a7d0(++_0x273b8b);}(_0x9f1a,0x178));var _0xa9f1=function(_0x55ce91,_0x17698b){_0x55ce91=_0x55ce91-0x0;var _0x1fbc39=_0x9f1a[_0x55ce91];return _0x1fbc39;};'use strict';var _=require(_0xa9f1('0x0'));var sequelize=require(_0xa9f1('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1d91ee){var _0x362ae7=['ne'];try{var _0x325f29=JSON[_0xa9f1('0x2')](_0x1d91ee);var _0x2c50b6=Object['keys'](_0x325f29)[0x0];return _0x362ae7[_0xa9f1('0x3')](_0x2c50b6);}catch(_0x4568b4){return![];}}function getOperatorValue(_0x44ff6d){var _0x5c2400=JSON[_0xa9f1('0x2')](_0x44ff6d);var _0x171d39=Object[_0xa9f1('0x4')](_0x5c2400)[0x0];var _0x5949d8=_0x5c2400[_0x171d39];return{['$'+_0x171d39]:_0x5949d8};}exports[_0xa9f1('0x5')]=function(_0x8212ee){var _0x22e57d=null;if(_0x8212ee){_0x22e57d=_0x8212ee[_0xa9f1('0x6')](',');}return _0x22e57d;};exports[_0xa9f1('0x7')]=function(_0x833036,_0x1b9577){var _0x5db618={};if(!_[_0xa9f1('0x8')](_0x833036)){_['forOwn'](_0x833036,function(_0x35a06b,_0x2b9236){try{if(_0x1b9577){var _0x285df6=_[_0xa9f1('0x9')](_0x1b9577,{'name':_0x2b9236})||{};if(hasSequelizeOperator(_0x35a06b)){_0x5db618[_0x2b9236]=getOperatorValue(_0x35a06b);}else if(_0x285df6[_0xa9f1('0xa')]===_0xa9f1('0xb')&&_[_0xa9f1('0xc')](_0x35a06b)){var _0x565979=JSON[_0xa9f1('0x2')](_0x35a06b);var _0x1c4bc3={'$gte':moment(moment(_0x565979['$gte'])[_0xa9f1('0xd')](_0xa9f1('0xe')))['utc']()[_0xa9f1('0xd')](),'$lte':moment(moment(_0x565979[_0xa9f1('0xf')])[_0xa9f1('0xd')](_0xa9f1('0xe')))[_0xa9f1('0x10')]()[_0xa9f1('0x11')](0x1,'s')[_0xa9f1('0xd')]()};_0x5db618[_0x2b9236]=_0x1c4bc3;}else if(_0x285df6[_0xa9f1('0x12')]===_0xa9f1('0x13')){_0x5db618[_0x2b9236]=_0x35a06b;}else{_0x5db618[_0x2b9236]=_[_0xa9f1('0x14')](_0x35a06b)?_0x35a06b:JSON[_0xa9f1('0x2')](_0x35a06b);}}else{_0x5db618[_0x2b9236]=_[_0xa9f1('0x14')](_0x35a06b)?_0x35a06b:JSON['parse'](_0x35a06b);}}catch(_0x1fa5ea){_0x5db618[_0x2b9236]=_0x35a06b['split'](',');}});}return _0x5db618;};exports['limit']=function(_0x584c36){_0x584c36=parseInt(_0x584c36,0xa);if(!_0x584c36||_0x584c36<0x0){_0x584c36=LIMIT_VALUE;}return _0x584c36;};exports[_0xa9f1('0x15')]=function(_0x2d63d1){_0x2d63d1=parseInt(_0x2d63d1,0xa);if(!_0x2d63d1||_0x2d63d1<0x0){_0x2d63d1=0x0;}return _0x2d63d1;};exports[_0xa9f1('0x16')]=function(_0x64436a){var _0x551fb8,_0xfcadd=null;if(_0x64436a){_0x551fb8=_0x64436a[_0xa9f1('0x6')](',');_0xfcadd=_[_0xa9f1('0x17')](_0x551fb8,function(_0x4732d5){if(_0x4732d5[_0xa9f1('0x18')]('-')===0x0){return[_0x4732d5===_0xa9f1('0x19')?sequelize['cast'](sequelize[_0xa9f1('0x1a')]('priority'),'unsigned'):_0x4732d5[_0xa9f1('0x1b')](0x1),'DESC'];}else{return[_0x4732d5==='priority'?sequelize[_0xa9f1('0x1c')](sequelize[_0xa9f1('0x1a')](_0xa9f1('0x19')),_0xa9f1('0x1d')):_0x4732d5,_0xa9f1('0x1e')];}});}return _0xfcadd;};exports[_0xa9f1('0x1f')]=function(_0x1b39a0,_0x576354){if(_['isEmpty'](_0x1b39a0)){return _0x1b39a0;}if(_[_0xa9f1('0x14')](_0x1b39a0)){for(var _0x554d70=0x0;_0x554d70<_0x1b39a0[_0xa9f1('0x20')];_0x554d70+=0x1){_0x1b39a0[_0x554d70]=this[_0xa9f1('0x1f')](_0x1b39a0[_0x554d70],_0x576354);}return _0x1b39a0;}if(!_[_0xa9f1('0x21')](_0x1b39a0)){return _0x1b39a0;}if(_['isString'](_0x576354)){_0x576354=[_0x576354];}if(!_[_0xa9f1('0x14')](_0x576354)){return _0x1b39a0;}for(var _0x5c0493=0x0;_0x5c0493<_0x576354[_0xa9f1('0x20')];_0x5c0493+=0x1){_[_0xa9f1('0x22')](_0x1b39a0,_0x576354[_0x5c0493]);}for(var _0x55f867 in _0x1b39a0){if(_0x1b39a0[_0xa9f1('0x23')](_0x55f867)){_0x1b39a0[_0x55f867]=this[_0xa9f1('0x1f')](_0x1b39a0[_0x55f867],_0x576354);}}return _0x1b39a0;};exports[_0xa9f1('0x24')]=function(_0x554fe8){return _0x554fe8[_0xa9f1('0x25')](RegExp(_0xa9f1('0x26')))?!![]:![];};exports[_0xa9f1('0x27')]=function(_0x24a519){return _0x24a519['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xa9f1('0x28')]=function(_0x4a31d3){var _0x5bb000=[];_0x4a31d3[_0xa9f1('0x6')](/[ ,]+/)[_0xa9f1('0x29')](function(_0x29b974){_0x29b974=_0x29b974[_0xa9f1('0x2a')](/([^:]")"+/g,'$1');_0x29b974='+'+_0x29b974+'*';if(_0x29b974['includes']('@'))_0x29b974='\x22'+_0x29b974+'\x22';_0x5bb000[_0xa9f1('0x2b')](_0x29b974);});return _0x5bb000['join']('\x20');};exports[_0xa9f1('0x2c')]=function(_0x2d6610,_0x48d33f,_0x35323f){var _0x25aa18={},_0x145287={};if(_0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x2e')]){_0x48d33f[_0xa9f1('0x2d')]['id']=_0x48d33f['query'][_0xa9f1('0x2e')];delete _0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x2e')];}_0x25aa18[_0xa9f1('0x2f')]=_[_0xa9f1('0x17')](_0x2d6610,_0xa9f1('0x12'));_0x25aa18[_0xa9f1('0x2d')]=_[_0xa9f1('0x4')](_0x48d33f[_0xa9f1('0x2d')]);_0x25aa18[_0xa9f1('0x7')]=_['intersection'](_0x25aa18[_0xa9f1('0x2f')],_0x25aa18[_0xa9f1('0x2d')]);_0x145287[_0xa9f1('0x30')]=_[_0xa9f1('0x31')](_0x25aa18[_0xa9f1('0x2f')],this[_0xa9f1('0x5')](_0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x5')]));_0x145287[_0xa9f1('0x30')]=_0x145287[_0xa9f1('0x30')][_0xa9f1('0x20')]?_0x145287['attributes']:_0x25aa18[_0xa9f1('0x2f')];if(!_0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x23')](_0xa9f1('0x32'))){_0x145287[_0xa9f1('0x33')]=this[_0xa9f1('0x33')](_0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x33')]);_0x145287['offset']=this['offset'](_0x48d33f['query']['offset']);}_0x145287['order']=this[_0xa9f1('0x16')](_0x48d33f['query'][_0xa9f1('0x16')]);_0x145287['where']=this['filters'](_[_0xa9f1('0x34')](_0x48d33f[_0xa9f1('0x2d')],_0x25aa18[_0xa9f1('0x7')]),_0x2d6610);if(_0x48d33f['query'][_0xa9f1('0x35')]){_0x145287['where']=_[_0xa9f1('0x36')](_0x145287[_0xa9f1('0x37')],{'$or':_['map'](_0x2d6610,function(_0x3878fa){if(_0x3878fa[_0xa9f1('0xa')]!==_0xa9f1('0x38')){if(_0x35323f){return sequelize['where'](sequelize['fn'](_0xa9f1('0x39'),sequelize[_0xa9f1('0x1a')](_0x3878fa[_0xa9f1('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x48d33f[_0xa9f1('0x2d')]['filter']+'%')});}else{var _0x31c531={};_0x31c531[_0x3878fa[_0xa9f1('0x12')]]={'$like':'%'+_0x48d33f['query'][_0xa9f1('0x35')]+'%'};return _0x31c531;}}})});}_0x145287=_[_0xa9f1('0x36')]({},_0x145287,_0x48d33f[_0xa9f1('0x3a')]);return _0x145287;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c580826..8553803 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0db=['use','json\x20replacer','toISOString','split','views','html','ejs','50mb','initialize','serve-favicon','body-parser','method-override','errorhandler','moment','./environment','../mysqldb','default','get','production','set','appPath','public','test','join','root','client'];(function(_0xd73d53,_0x598443){var _0x560148=function(_0x3c8918){while(--_0x3c8918){_0xd73d53['push'](_0xd73d53['shift']());}};_0x560148(++_0x598443);}(_0xd0db,0x1dd));var _0xbd0d=function(_0x43bce5,_0x35e04c){_0x43bce5=_0x43bce5-0x0;var _0x38bf6e=_0xd0db[_0x43bce5];return _0x38bf6e;};'use strict';var express=require('express');var favicon=require(_0xbd0d('0x0'));var bodyParser=require(_0xbd0d('0x1'));var methodOverride=require(_0xbd0d('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xbd0d('0x3'));var path=require('path');var passport=require('passport');var cors=require('cors');var moment=require(_0xbd0d('0x4'));var config=require(_0xbd0d('0x5'));var db=require(_0xbd0d('0x6'))['db'];exports[_0xbd0d('0x7')]=function(_0x423ef6){var _0x4ad55b=_0x423ef6[_0xbd0d('0x8')]('env');if(_0x4ad55b===_0xbd0d('0x9')){_0x423ef6[_0xbd0d('0xa')](_0xbd0d('0xb'),path['join'](config['root'],_0xbd0d('0xc')));}if(_0x4ad55b==='development'||_0x4ad55b===_0xbd0d('0xd')){_0x423ef6[_0xbd0d('0xa')](_0xbd0d('0xb'),path[_0xbd0d('0xe')](config[_0xbd0d('0xf')],_0xbd0d('0x10')));_0x423ef6[_0xbd0d('0x11')](errorHandler());}_0x423ef6['set'](_0xbd0d('0x12'),function(_0x1d1210,_0x5b4551){if(this[_0x1d1210]instanceof Date){_0x5b4551=this[_0x1d1210][_0xbd0d('0x13')]()[_0xbd0d('0x14')]('.')[0x0]+'Z';}return _0x5b4551;});_0x423ef6['use'](express['static'](_0x423ef6[_0xbd0d('0x8')](_0xbd0d('0xb'))));_0x423ef6[_0xbd0d('0xa')](_0xbd0d('0x15'),config['root']+'/server/views');_0x423ef6['engine'](_0xbd0d('0x16'),require(_0xbd0d('0x17'))['renderFile']);_0x423ef6[_0xbd0d('0xa')]('view\x20engine',_0xbd0d('0x16'));_0x423ef6[_0xbd0d('0x11')](bodyParser['urlencoded']({'limit':_0xbd0d('0x18'),'extended':!![]}));_0x423ef6[_0xbd0d('0x11')](bodyParser['json']({'limit':_0xbd0d('0x18')}));_0x423ef6[_0xbd0d('0x11')](cors());_0x423ef6[_0xbd0d('0x11')](methodOverride());_0x423ef6[_0xbd0d('0x11')](cookieParser());_0x423ef6[_0xbd0d('0x11')](passport[_0xbd0d('0x19')]());}; \ No newline at end of file +var _0xba4d=['use','set','toISOString','split','static','views','/server/views','engine','html','ejs','renderFile','urlencoded','json','50mb','initialize','express','serve-favicon','body-parser','method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','join','root','public','development','appPath','client'];(function(_0x2673d7,_0x2761d3){var _0x10d4ea=function(_0x3777a7){while(--_0x3777a7){_0x2673d7['push'](_0x2673d7['shift']());}};_0x10d4ea(++_0x2761d3);}(_0xba4d,0xc3));var _0xdba4=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0xba4d[_0x38c699];return _0x3b1ded;};'use strict';var express=require(_0xdba4('0x0'));var favicon=require(_0xdba4('0x1'));var bodyParser=require(_0xdba4('0x2'));var methodOverride=require(_0xdba4('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xdba4('0x4'));var path=require(_0xdba4('0x5'));var passport=require(_0xdba4('0x6'));var cors=require(_0xdba4('0x7'));var moment=require(_0xdba4('0x8'));var config=require(_0xdba4('0x9'));var db=require(_0xdba4('0xa'))['db'];exports[_0xdba4('0xb')]=function(_0x3dc1d1){var _0x54532d=_0x3dc1d1[_0xdba4('0xc')](_0xdba4('0xd'));if(_0x54532d===_0xdba4('0xe')){_0x3dc1d1['set']('appPath',path[_0xdba4('0xf')](config[_0xdba4('0x10')],_0xdba4('0x11')));}if(_0x54532d===_0xdba4('0x12')||_0x54532d==='test'){_0x3dc1d1['set'](_0xdba4('0x13'),path[_0xdba4('0xf')](config['root'],_0xdba4('0x14')));_0x3dc1d1[_0xdba4('0x15')](errorHandler());}_0x3dc1d1[_0xdba4('0x16')]('json\x20replacer',function(_0x591db4,_0x402d99){if(this[_0x591db4]instanceof Date){_0x402d99=this[_0x591db4][_0xdba4('0x17')]()[_0xdba4('0x18')]('.')[0x0]+'Z';}return _0x402d99;});_0x3dc1d1[_0xdba4('0x15')](express[_0xdba4('0x19')](_0x3dc1d1[_0xdba4('0xc')]('appPath')));_0x3dc1d1['set'](_0xdba4('0x1a'),config[_0xdba4('0x10')]+_0xdba4('0x1b'));_0x3dc1d1[_0xdba4('0x1c')](_0xdba4('0x1d'),require(_0xdba4('0x1e'))[_0xdba4('0x1f')]);_0x3dc1d1['set']('view\x20engine','html');_0x3dc1d1['use'](bodyParser[_0xdba4('0x20')]({'limit':'50mb','extended':!![]}));_0x3dc1d1['use'](bodyParser[_0xdba4('0x21')]({'limit':_0xdba4('0x22')}));_0x3dc1d1[_0xdba4('0x15')](cors());_0x3dc1d1[_0xdba4('0x15')](methodOverride());_0x3dc1d1[_0xdba4('0x15')](cookieParser());_0x3dc1d1['use'](passport[_0xdba4('0x23')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 623cacb..6a49b77 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 _0x4a5c=['internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','md5','update','substring','lodash','child_process','networkInterfaces','orderBy','keys','length','filter','family'];(function(_0x2c4347,_0x10692d){var _0x116317=function(_0x196735){while(--_0x196735){_0x2c4347['push'](_0x2c4347['shift']());}};_0x116317(++_0x10692d);}(_0x4a5c,0x1bf));var _0xc4a5=function(_0x1ea6eb,_0x33d3d4){_0x1ea6eb=_0x1ea6eb-0x0;var _0x127200=_0x4a5c[_0x1ea6eb];return _0x127200;};'use strict';var _=require(_0xc4a5('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0xc4a5('0x1'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x6e23ae=[];var _0x49e0fb=os[_0xc4a5('0x2')]();var _0xe8b19c=_[_0xc4a5('0x3')](_[_0xc4a5('0x4')](_0x49e0fb));for(var _0x4460f5=0x0;_0x4460f5<_0xe8b19c[_0xc4a5('0x5')];_0x4460f5++){var _0x115913=_0x49e0fb[_0xe8b19c[_0x4460f5]][_0xc4a5('0x6')](function(_0x5578ef){return _0x5578ef[_0xc4a5('0x7')]==='IPv4'&&_0x5578ef[_0xc4a5('0x8')]===![];});_0x6e23ae=_0x6e23ae[_0xc4a5('0x9')](_0x115913);}return _0x6e23ae;}function getFirstInterface(){var _0x3c2d2e=_[_0xc4a5('0xa')](getInterfaces());return{'macAddress':_0x3c2d2e&&_0x3c2d2e[_0xc4a5('0xb')]?_0x3c2d2e['mac']:_0xc4a5('0xc'),'ipAddress':_0x3c2d2e&&_0x3c2d2e[_0xc4a5('0xd')]?_0x3c2d2e[_0xc4a5('0xd')]:_0xc4a5('0xe')};}exports[_0xc4a5('0xf')]=getFirstInterface;function getCPUhash(){var _0x1b715e=_[_0xc4a5('0x3')](os[_0xc4a5('0x10')]()['map'](function(_0x1851e){return _0x1851e[_0xc4a5('0x11')];}))[_0xc4a5('0x12')](':');return crypto[_0xc4a5('0x13')]('md5')['update'](_0x1b715e)[_0xc4a5('0x14')](_0xc4a5('0x15'));}exports[_0xc4a5('0x16')]=function(){var _0x2c0324=os[_0xc4a5('0x17')]();var _0x2ae32f=/[0-9a-f-]{36}/;if(config[_0xc4a5('0x18')]&&_0x2ae32f['test'](config[_0xc4a5('0x18')])){return config[_0xc4a5('0x18')];}else if(_0x2c0324===_0xc4a5('0x19')){return exec(_0xc4a5('0x1a'),{'encoding':_0xc4a5('0x1b')})[_0xc4a5('0x1c')]('\x0d\x0a','');}else{var _0x3cc048=getFirstInterface();var _0xa0dc40=getCPUhash();var _0x1e7560=_0xa0dc40+'|'+os[_0xc4a5('0x1d')]()+'|'+_0x3cc048[_0xc4a5('0x1e')]+'|'+_0x3cc048[_0xc4a5('0x1f')];var _0x1001ab=crypto[_0xc4a5('0x13')](_0xc4a5('0x20'))[_0xc4a5('0x21')](_0x1e7560)['digest'](_0xc4a5('0x15'));return _0x1001ab[_0xc4a5('0x22')](0x0,0x8)+'-'+_0x1001ab[_0xc4a5('0x22')](0x8,0xc)+'-'+_0x1001ab[_0xc4a5('0x22')](0xc,0x10)+'-'+_0x1001ab['substring'](0x10,0x14)+'-'+_0x1001ab['substring'](0x14);}}; \ No newline at end of file +var _0xf4ce=['address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','update','digest','hex','licenseToken','test','win32','replace','hostname','macAddress','ipAddress','md5','substring','lodash','crypto','child_process','execSync','../environment','orderBy','keys','length','filter','family','IPv4','internal','head','mac','00:00:00:00:00:00'];(function(_0x5902f9,_0x5a92f5){var _0x54a315=function(_0x3dc614){while(--_0x3dc614){_0x5902f9['push'](_0x5902f9['shift']());}};_0x54a315(++_0x5a92f5);}(_0xf4ce,0x189));var _0xef4c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf4ce[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xef4c('0x0'));var os=require('os');var crypto=require(_0xef4c('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xef4c('0x2'))[_0xef4c('0x3')];var config=require(_0xef4c('0x4'));function getInterfaces(){var _0x430fcd=[];var _0x280858=os['networkInterfaces']();var _0x2840ac=_[_0xef4c('0x5')](_[_0xef4c('0x6')](_0x280858));for(var _0x26780d=0x0;_0x26780d<_0x2840ac[_0xef4c('0x7')];_0x26780d++){var _0x312f16=_0x280858[_0x2840ac[_0x26780d]][_0xef4c('0x8')](function(_0x85eef7){return _0x85eef7[_0xef4c('0x9')]===_0xef4c('0xa')&&_0x85eef7[_0xef4c('0xb')]===![];});_0x430fcd=_0x430fcd['concat'](_0x312f16);}return _0x430fcd;}function getFirstInterface(){var _0x157c11=_[_0xef4c('0xc')](getInterfaces());return{'macAddress':_0x157c11&&_0x157c11[_0xef4c('0xd')]?_0x157c11['mac']:_0xef4c('0xe'),'ipAddress':_0x157c11&&_0x157c11[_0xef4c('0xf')]?_0x157c11['address']:_0xef4c('0x10')};}exports[_0xef4c('0x11')]=getFirstInterface;function getCPUhash(){var _0x51e220=_[_0xef4c('0x5')](os[_0xef4c('0x12')]()[_0xef4c('0x13')](function(_0x9cb111){return _0x9cb111['model'];}))[_0xef4c('0x14')](':');return crypto[_0xef4c('0x15')]('md5')[_0xef4c('0x16')](_0x51e220)[_0xef4c('0x17')](_0xef4c('0x18'));}exports['getUuid']=function(){var _0x47ff15=os['platform']();var _0x426a1d=/[0-9a-f-]{36}/;if(config[_0xef4c('0x19')]&&_0x426a1d[_0xef4c('0x1a')](config[_0xef4c('0x19')])){return config[_0xef4c('0x19')];}else if(_0x47ff15===_0xef4c('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xef4c('0x1c')]('\x0d\x0a','');}else{var _0x1899c3=getFirstInterface();var _0x446904=getCPUhash();var _0x1a23ce=_0x446904+'|'+os[_0xef4c('0x1d')]()+'|'+_0x1899c3[_0xef4c('0x1e')]+'|'+_0x1899c3[_0xef4c('0x1f')];var _0x3b95c9=crypto[_0xef4c('0x15')](_0xef4c('0x20'))[_0xef4c('0x16')](_0x1a23ce)['digest']('hex');return _0x3b95c9['substring'](0x0,0x8)+'-'+_0x3b95c9[_0xef4c('0x21')](0x8,0xc)+'-'+_0x3b95c9[_0xef4c('0x21')](0xc,0x10)+'-'+_0x3b95c9['substring'](0x10,0x14)+'-'+_0x3b95c9[_0xef4c('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 3245905..1eedc48 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 _0x61a5=['exports','GET','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','default','util','moment','bluebird','version','../../mysqldb','./hardware','https://www.xcallymotion.com','format'];(function(_0x42ce88,_0x179ffd){var _0xb84f20=function(_0x8e8661){while(--_0x8e8661){_0x42ce88['push'](_0x42ce88['shift']());}};_0xb84f20(++_0x179ffd);}(_0x61a5,0xac));var _0x561a=function(_0x40001a,_0x57f2ae){_0x40001a=_0x40001a-0x0;var _0x4cec45=_0x61a5[_0x40001a];return _0x4cec45;};'use strict';var util=require(_0x561a('0x0'));var moment=require(_0x561a('0x1'));var rp=require('request-promise');var BPromise=require(_0x561a('0x2'));var pkginfo=require('pkginfo')(module,_0x561a('0x3'));var db=require(_0x561a('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x561a('0x5'));var logger=require('../logger')('license');var HOST=_0x561a('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2c4a41){return new BPromise(function(_0x2fa82b,_0x3dd8e5){var _0x4e7b5b=util[_0x561a('0x7')]('%s/api/servers/%s/check?version=%s',HOST,_0x2c4a41,module[_0x561a('0x8')][_0x561a('0x3')]);if(oldToken){_0x4e7b5b=util[_0x561a('0x7')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2c4a41,module[_0x561a('0x8')][_0x561a('0x3')],oldToken);}var _0x152304={'uri':_0x4e7b5b,'method':_0x561a('0x9'),'timeout':0xea60,'json':!![]};return rp(_0x152304)[_0x561a('0xa')](function(_0x14cffe){_0x2fa82b(_0x14cffe);})[_0x561a('0xb')](function(_0x2d26a7){_0x3dd8e5(_0x2d26a7);});});}function manageLicense(_0x3b2be6,_0x727945){var _0xc855e4=_0x727945[_0x561a('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0xc855e4[_0x561a('0xd')]!==_0x3b2be6&&!_0xc855e4[_0x561a('0xe')]){oldToken=_0xc855e4[_0x561a('0xd')];}httpRequest(_0x3b2be6)[_0x561a('0xa')](function(_0x3d7eb2){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3d7eb2[_0x561a('0xf')]){isOldTokenSent=![];if(!_0xc855e4[_0x561a('0x10')]&&_0xc855e4['license']!=_0x3d7eb2[_0x561a('0x10')]||_0xc855e4[_0x561a('0x10')]&&_0xc855e4[_0x561a('0xe')]){logger[_0x561a('0x11')](_0x561a('0x12'));}if(_0xc855e4[_0x561a('0x10')]&&!_0xc855e4[_0x561a('0xe')]&&_0xc855e4[_0x561a('0x10')]!=_0x3d7eb2[_0x561a('0x10')]){logger[_0x561a('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0xc855e4[_0x561a('0x10')]&&!_0xc855e4[_0x561a('0xe')]&&_0xc855e4[_0x561a('0x10')]==_0x3d7eb2[_0x561a('0x10')]){return _0x727945;}return _0x727945[_0x561a('0x13')]({'data1':_0x3b2be6,'data2':null,'license':_0x3d7eb2[_0x561a('0x10')]});}else{if(_0x3d7eb2['license']||_0xc855e4[_0x561a('0x10')]){if(!_0xc855e4[_0x561a('0xe')]){if(_0xc855e4[_0x561a('0xd')]==_0x3b2be6){GRAY_PERIOD_REASON=_0x561a('0x14');logger['info'](_0x561a('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x561a('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xc855e4[_0x561a('0xd')],_0x3b2be6);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x561a('0x16')](),moment()[_0x561a('0x7')](_0x561a('0x17')));return _0x727945['update']({'data2':encryptor[_0x561a('0x18')](moment()[_0x561a('0x7')](_0x561a('0x17')))});}else{if(moment()[_0x561a('0x19')](encryptor['decryptString'](_0xc855e4[_0x561a('0xe')]),_0x561a('0x1a'))>DAYS){logger[_0x561a('0x11')](_0x561a('0x1b'),moment()[_0x561a('0x7')](_0x561a('0x17')));isOldTokenSent=![];return _0x727945[_0x561a('0x13')]({'data1':_0x3b2be6,'data2':null,'license':null});}}}else{if(_0xc855e4['data1']!=_0x3b2be6){logger[_0x561a('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xc855e4[_0x561a('0xd')],_0x3b2be6);return _0x727945[_0x561a('0x13')]({'data1':_0x3b2be6,'data2':null,'license':null});}}}return _0x727945;})[_0x561a('0xa')](function(_0x2b3cd9){_0x727945=_0x2b3cd9;})['catch'](function(_0x3158b4){logger[_0x561a('0x1c')](_0x3158b4[_0x561a('0x1d')]);})[_0x561a('0x1e')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x727945);},TIME);});}function defaultLicense(){var _0x157c9c=hardware[_0x561a('0x1f')]();if(_0x157c9c){return db[_0x561a('0x20')][_0x561a('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x157c9c}})[_0x561a('0x22')](function(_0xc63115,_0x533fc4){logger[_0x561a('0x11')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x157c9c);manageLicense(_0x157c9c,_0xc63115);})[_0x561a('0xb')](function(_0x4396f){logger[_0x561a('0x1c')](_0x4396f[_0x561a('0x1d')]);});}}exports[_0x561a('0x23')]=defaultLicense; \ No newline at end of file +var _0xe988=['GET','then','catch','get','data2','data1','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports'];(function(_0x4478eb,_0x4267e6){var _0x376270=function(_0x3450d8){while(--_0x3450d8){_0x4478eb['push'](_0x4478eb['shift']());}};_0x376270(++_0x4267e6);}(_0xe988,0xe5));var _0x8e98=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xe988[_0x5447fd];return _0x15b28a;};'use strict';var util=require(_0x8e98('0x0'));var moment=require('moment');var rp=require(_0x8e98('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0x8e98('0x2'))(module,_0x8e98('0x3'));var db=require(_0x8e98('0x4'))['db'];var encryptor=require(_0x8e98('0x5'));var hardware=require(_0x8e98('0x6'));var logger=require('../logger')('license');var HOST=_0x8e98('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1cb707){return new BPromise(function(_0x3c4d39,_0x51efb4){var _0x576ddf=util[_0x8e98('0x8')](_0x8e98('0x9'),HOST,_0x1cb707,module['exports'][_0x8e98('0x3')]);if(oldToken){_0x576ddf=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x1cb707,module[_0x8e98('0xa')]['version'],oldToken);}var _0x155b7d={'uri':_0x576ddf,'method':_0x8e98('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x155b7d)[_0x8e98('0xc')](function(_0x1d9629){_0x3c4d39(_0x1d9629);})[_0x8e98('0xd')](function(_0x8ef98d){_0x51efb4(_0x8ef98d);});});}function manageLicense(_0x4b9aa3,_0x33db79){var _0x5b8459=_0x33db79[_0x8e98('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x5b8459['data1']!==_0x4b9aa3&&!_0x5b8459[_0x8e98('0xf')]){oldToken=_0x5b8459[_0x8e98('0x10')];}httpRequest(_0x4b9aa3)[_0x8e98('0xc')](function(_0x45d196){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x45d196['active']){isOldTokenSent=![];if(!_0x5b8459['license']&&_0x5b8459[_0x8e98('0x11')]!=_0x45d196['license']||_0x5b8459['license']&&_0x5b8459[_0x8e98('0xf')]){logger[_0x8e98('0x12')](_0x8e98('0x13'));}if(_0x5b8459[_0x8e98('0x11')]&&!_0x5b8459[_0x8e98('0xf')]&&_0x5b8459['license']!=_0x45d196[_0x8e98('0x11')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x5b8459[_0x8e98('0x11')]&&!_0x5b8459[_0x8e98('0xf')]&&_0x5b8459[_0x8e98('0x11')]==_0x45d196[_0x8e98('0x11')]){return _0x33db79;}return _0x33db79[_0x8e98('0x14')]({'data1':_0x4b9aa3,'data2':null,'license':_0x45d196['license']});}else{if(_0x45d196[_0x8e98('0x11')]||_0x5b8459[_0x8e98('0x11')]){if(!_0x5b8459[_0x8e98('0xf')]){if(_0x5b8459['data1']==_0x4b9aa3){GRAY_PERIOD_REASON=_0x8e98('0x15');logger[_0x8e98('0x12')](_0x8e98('0x16'));}else{GRAY_PERIOD_REASON=_0x8e98('0x17');logger[_0x8e98('0x12')](_0x8e98('0x18'),_0x5b8459[_0x8e98('0x10')],_0x4b9aa3);}logger[_0x8e98('0x12')](_0x8e98('0x19'),GRAY_PERIOD_REASON[_0x8e98('0x1a')](),moment()[_0x8e98('0x8')](_0x8e98('0x1b')));return _0x33db79[_0x8e98('0x14')]({'data2':encryptor['encryptString'](moment()[_0x8e98('0x8')](_0x8e98('0x1b')))});}else{if(moment()[_0x8e98('0x1c')](encryptor[_0x8e98('0x1d')](_0x5b8459[_0x8e98('0xf')]),_0x8e98('0x1e'))>DAYS){logger['info'](_0x8e98('0x1f'),moment()['format'](_0x8e98('0x1b')));isOldTokenSent=![];return _0x33db79[_0x8e98('0x14')]({'data1':_0x4b9aa3,'data2':null,'license':null});}}}else{if(_0x5b8459[_0x8e98('0x10')]!=_0x4b9aa3){logger[_0x8e98('0x12')](_0x8e98('0x18'),_0x5b8459['data1'],_0x4b9aa3);return _0x33db79[_0x8e98('0x14')]({'data1':_0x4b9aa3,'data2':null,'license':null});}}}return _0x33db79;})['then'](function(_0x21aba9){_0x33db79=_0x21aba9;})['catch'](function(_0x599df0){logger['error'](_0x599df0[_0x8e98('0x20')]);})[_0x8e98('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x8e98('0x22')](),_0x33db79);},TIME);});}function defaultLicense(){var _0x179f87=hardware[_0x8e98('0x22')]();if(_0x179f87){return db[_0x8e98('0x23')][_0x8e98('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x179f87}})['spread'](function(_0x3fd406,_0x59cdc3){logger['info'](_0x8e98('0x25'),_0x179f87);manageLicense(_0x179f87,_0x3fd406);})[_0x8e98('0xd')](function(_0x1050ad){logger[_0x8e98('0x26')](_0x1050ad['message']);});}}exports[_0x8e98('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 5d01fe9..3d6941c 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 _0xd624=['./hardware','../../components/encryptor','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','add','grayReason','changed','disabled','message','User','findAll','role','sequelize','count','admin','user','telephone','telephones','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird'];(function(_0x47f556,_0x1ea997){var _0x30d73c=function(_0xd05ba6){while(--_0xd05ba6){_0x47f556['push'](_0x47f556['shift']());}};_0x30d73c(++_0x1ea997);}(_0xd624,0xfe));var _0x4d62=function(_0x506436,_0x22a9a8){_0x506436=_0x506436-0x0;var _0x2f7b9c=_0xd624[_0x506436];return _0x2f7b9c;};'use strict';var util=require(_0x4d62('0x0'));var _=require(_0x4d62('0x1'));var moment=require(_0x4d62('0x2'));var BPromise=require(_0x4d62('0x3'));var hardware=require(_0x4d62('0x4'));var encryptor=require(_0x4d62('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4d62('0x6'),'machineUuid':hardware[_0x4d62('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':_0x4d62('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xb3de7d){return new BPromise(function(_0x59d65e,_0x437026){return db[_0x4d62('0x9')]['find'](_[_0x4d62('0xa')](_0xb3de7d,{'raw':!![],'where':{'id':0x1}}))[_0x4d62('0xb')](function(_0x1c8c3a){return checkLicense(_0x1c8c3a,null);})[_0x4d62('0xb')](function(_0x31552c){_0x59d65e(_0x31552c);return;})[_0x4d62('0xc')](function(_0x21ec7d){_0x437026(_0x21ec7d);});});}function checkLicense(_0x1521dc,_0x3b601d){if(!_0x1521dc){demoLicense[_0x4d62('0xd')]=_0x1521dc[_0x4d62('0xe')];return demoLicense;}try{var _0x5d67d1=_0x3b601d||_0x1521dc['license'];if(_[_0x4d62('0xf')](_0x5d67d1)){throw new Error(_0x4d62('0x10'));}var _0xdccf4d=_0x1521dc[_0x4d62('0xe')];var _0xc96e6b=_0x1521dc[_0x4d62('0x11')];var _0xbddcb6=_0xdccf4d[_0x4d62('0x12')]('-')[0x4];var _0x3ae234=_0xdccf4d[_0x4d62('0x12')]('-')[0x0];var _0x3cbd21=encryptor[_0x4d62('0x13')](_0x5d67d1,util[_0x4d62('0x14')](_0x4d62('0x15'),_0xbddcb6,_0xdccf4d,_0x3ae234));var _0xbfc63e=JSON[_0x4d62('0x16')](_0x3cbd21);_0xbfc63e[_0x4d62('0x17')]=![];_0xbfc63e[_0x4d62('0xd')]=_0xdccf4d;_0xbfc63e[_0x4d62('0x18')]=hardware['getUuid']();if(_0xc96e6b){var _0x1bb3c4=encryptor[_0x4d62('0x13')](_0xc96e6b);_0xbfc63e['gray']=_0x1bb3c4;_0xbfc63e[_0x4d62('0x19')]=moment(_0x1bb3c4)[_0x4d62('0x1a')](0x7,'days')[_0x4d62('0x14')]();_0xbfc63e[_0x4d62('0x1b')]=_0xbfc63e[_0x4d62('0xd')]!=_0xbfc63e[_0x4d62('0x18')]?_0x4d62('0x1c'):_0x4d62('0x1d');}return _0xbfc63e;}catch(_0x190f94){breakingLicense[_0x4d62('0xd')]=_0x1521dc[_0x4d62('0xe')];breakingLicense[_0x4d62('0x1e')]=_0x190f94[_0x4d62('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x357f24,_0x3ce2d3){getLicense()['then'](function(_0x24962f){return db[_0x4d62('0x1f')][_0x4d62('0x20')]({'attributes':[_0x4d62('0x21'),[db[_0x4d62('0x22')]['fn']('COUNT',db[_0x4d62('0x22')]['col'](_0x4d62('0x21'))),_0x4d62('0x23')]],'group':'role','where':{'role':{'$or':[_0x4d62('0x24'),_0x4d62('0x25'),_0x4d62('0x26')]}},'raw':!![]})['then'](function(_0x4b3458){var _0x1619df={'user':_0x24962f['users']||0x0,'telephone':_0x24962f[_0x4d62('0x27')]||0x0};_0x4b3458['forEach'](function(_0x1aa040){var _0x19cef1=_0x1aa040[_0x4d62('0x21')]===_0x4d62('0x24')?_0x4d62('0x25'):_0x1aa040[_0x4d62('0x21')];_0x1619df[_0x19cef1]-=_0x1aa040[_0x4d62('0x23')];if(_0x1619df[_0x19cef1]<0x0)_0x1619df[_0x19cef1]=0x0;});_0x357f24(_0x1619df);return;});})[_0x4d62('0xc')](function(_0x217ca8){_0x3ce2d3(_0x217ca8);});});}function checkUserLimits(_0x218621){return new BPromise(function(_0x1bcd40,_0x23c5f3){getLimits()[_0x4d62('0xb')](function(_0x4cd970){var _0x49e161=_['pick'](_[_0x4d62('0x28')](_0x218621,_0x4d62('0x21')),[_0x4d62('0x24'),_0x4d62('0x25'),'telephone']);var _0x491881=(_0x49e161[_0x4d62('0x24')]||0x0)+(_0x49e161[_0x4d62('0x25')]||0x0);var _0x2ad898=_0x49e161['telephone']||0x0;if(_0x491881>_0x4cd970[_0x4d62('0x25')])return _0x23c5f3(_0x4d62('0x29'));if(_0x2ad898>_0x4cd970[_0x4d62('0x26')])return _0x23c5f3(_0x4d62('0x2a'));return _0x1bcd40();})['catch'](function(_0x18390b){_0x23c5f3(_0x18390b);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xaad3=['Breaking\x20license','License','find','defaults','then','catch','uuid','data1','isEmpty','split','decryptString','format','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message','User','findAll','sequelize','COUNT','role','count','admin','user','telephone','users','telephones','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid'];(function(_0x31f8dc,_0x11ff65){var _0x2f31e7=function(_0x6db1db){while(--_0x6db1db){_0x31f8dc['push'](_0x31f8dc['shift']());}};_0x2f31e7(++_0x11ff65);}(_0xaad3,0x1a6));var _0x3aad=function(_0x52e67b,_0x2c74e6){_0x52e67b=_0x52e67b-0x0;var _0x3be730=_0xaad3[_0x52e67b];return _0x3be730;};'use strict';var util=require(_0x3aad('0x0'));var _=require(_0x3aad('0x1'));var moment=require(_0x3aad('0x2'));var BPromise=require(_0x3aad('0x3'));var hardware=require(_0x3aad('0x4'));var encryptor=require(_0x3aad('0x5'));var db=require(_0x3aad('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3aad('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3aad('0x8'),'machineUuid':hardware[_0x3aad('0x9')](),'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':_0x3aad('0xa'),'machineUuid':hardware[_0x3aad('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x317ee9){return new BPromise(function(_0x373d66,_0x213b1f){return db[_0x3aad('0xb')][_0x3aad('0xc')](_[_0x3aad('0xd')](_0x317ee9,{'raw':!![],'where':{'id':0x1}}))[_0x3aad('0xe')](function(_0x919f14){return checkLicense(_0x919f14,null);})['then'](function(_0x9ad65a){_0x373d66(_0x9ad65a);return;})[_0x3aad('0xf')](function(_0x43e692){_0x213b1f(_0x43e692);});});}function checkLicense(_0x51530e,_0x2a433b){if(!_0x51530e){demoLicense[_0x3aad('0x10')]=_0x51530e[_0x3aad('0x11')];return demoLicense;}try{var _0x14fe29=_0x2a433b||_0x51530e['license'];if(_[_0x3aad('0x12')](_0x14fe29)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0xdb7c41=_0x51530e['data1'];var _0x1fa708=_0x51530e['data2'];var _0x413d5e=_0xdb7c41[_0x3aad('0x13')]('-')[0x4];var _0x3a37be=_0xdb7c41[_0x3aad('0x13')]('-')[0x0];var _0x4e1830=encryptor[_0x3aad('0x14')](_0x14fe29,util[_0x3aad('0x15')]('%s:%s:%s',_0x413d5e,_0xdb7c41,_0x3a37be));var _0x436905=JSON['parse'](_0x4e1830);_0x436905[_0x3aad('0x16')]=![];_0x436905['uuid']=_0xdb7c41;_0x436905[_0x3aad('0x17')]=hardware['getUuid']();if(_0x1fa708){var _0x2bb341=encryptor[_0x3aad('0x14')](_0x1fa708);_0x436905[_0x3aad('0x18')]=_0x2bb341;_0x436905[_0x3aad('0x19')]=moment(_0x2bb341)[_0x3aad('0x1a')](0x7,_0x3aad('0x1b'))['format']();_0x436905[_0x3aad('0x1c')]=_0x436905[_0x3aad('0x10')]!=_0x436905['machineUuid']?_0x3aad('0x1d'):_0x3aad('0x1e');}return _0x436905;}catch(_0x26b7ec){breakingLicense[_0x3aad('0x10')]=_0x51530e[_0x3aad('0x11')];breakingLicense[_0x3aad('0x1f')]=_0x26b7ec[_0x3aad('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x10c905,_0xf9685b){getLicense()['then'](function(_0x3d0bbd){return db[_0x3aad('0x20')][_0x3aad('0x21')]({'attributes':['role',[db[_0x3aad('0x22')]['fn'](_0x3aad('0x23'),db[_0x3aad('0x22')]['col'](_0x3aad('0x24'))),_0x3aad('0x25')]],'group':_0x3aad('0x24'),'where':{'role':{'$or':[_0x3aad('0x26'),_0x3aad('0x27'),_0x3aad('0x28')]}},'raw':!![]})[_0x3aad('0xe')](function(_0xd95e70){var _0x4b3323={'user':_0x3d0bbd[_0x3aad('0x29')]||0x0,'telephone':_0x3d0bbd[_0x3aad('0x2a')]||0x0};_0xd95e70[_0x3aad('0x2b')](function(_0x150e50){var _0x3e4177=_0x150e50[_0x3aad('0x24')]==='admin'?_0x3aad('0x27'):_0x150e50[_0x3aad('0x24')];_0x4b3323[_0x3e4177]-=_0x150e50[_0x3aad('0x25')];if(_0x4b3323[_0x3e4177]<0x0)_0x4b3323[_0x3e4177]=0x0;});_0x10c905(_0x4b3323);return;});})['catch'](function(_0xe4abeb){_0xf9685b(_0xe4abeb);});});}function checkUserLimits(_0x2fd6bc){return new BPromise(function(_0x539161,_0xd1fca5){getLimits()['then'](function(_0x152b0d){var _0x352e50=_['pick'](_[_0x3aad('0x2c')](_0x2fd6bc,'role'),['admin','user',_0x3aad('0x28')]);var _0x500df9=(_0x352e50[_0x3aad('0x26')]||0x0)+(_0x352e50[_0x3aad('0x27')]||0x0);var _0x35ec3e=_0x352e50['telephone']||0x0;if(_0x500df9>_0x152b0d['user'])return _0xd1fca5(_0x3aad('0x2d'));if(_0x35ec3e>_0x152b0d[_0x3aad('0x28')])return _0xd1fca5(_0x3aad('0x2e'));return _0x539161();})[_0x3aad('0xf')](function(_0x3ba6b8){_0xd1fca5(_0x3ba6b8);});});}module[_0x3aad('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 b04bad6..a0818a3 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 _0xf4f4=['http://localhost:9000','app-id','secret','exports'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x4a6692,_0x10d6be){_0x4a6692=_0x4a6692-0x0;var _0x535695=_0xf4f4[_0x4a6692];return _0x535695;};'use strict';module[_0x4f4f('0x0')]={'DOMAIN':_0x4f4f('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4f4f('0x2'),'GOOGLE_SECRET':_0x4f4f('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x4024=['secret','exports','http://localhost:9000','app-id'];(function(_0x22372c,_0x204b6c){var _0x535d27=function(_0x2ecef9){while(--_0x2ecef9){_0x22372c['push'](_0x22372c['shift']());}};_0x535d27(++_0x204b6c);}(_0x4024,0x89));var _0x4402=function(_0x1a2f11,_0x325f17){_0x1a2f11=_0x1a2f11-0x0;var _0x22dd87=_0x4024[_0x1a2f11];return _0x22dd87;};'use strict';module[_0x4402('0x0')]={'DOMAIN':_0x4402('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4402('0x2'),'GOOGLE_SECRET':_0x4402('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c6b28f8..57c2303 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc578=['log','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','transports','error','File','%s-%s','info','env','moment','winston','util','path','INFO','join','/var'];(function(_0x3278a2,_0x23e518){var _0x506700=function(_0x8be0bc){while(--_0x8be0bc){_0x3278a2['push'](_0x3278a2['shift']());}};_0x506700(++_0x23e518);}(_0xc578,0xda));var _0x8c57=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xc578[_0x4b2863];return _0x567d67;};'use strict';var moment=require(_0x8c57('0x0'));var winston=require(_0x8c57('0x1'));var util=require(_0x8c57('0x2'));var path=require(_0x8c57('0x3'));var debugLevel=_0x8c57('0x4');function filename(_0xeefb82,_0x13bed0){return path[_0x8c57('0x5')](_0x8c57('0x6'),_0x8c57('0x7'),'xcally',util[_0x8c57('0x8')](_0x8c57('0x9'),_0xeefb82,_0x13bed0));}function formatter(_0x1d7120,_0x1840ba){_0x1840ba['message']=_0x1840ba[_0x8c57('0xa')][_0x8c57('0xb')](/@@{/g,_0x8c57('0xc'))['replace'](/}@@/g,_0x8c57('0xd'))[_0x8c57('0xb')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x8c57('0x8')](_0x8c57('0xe'),moment()[_0x8c57('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),_0x1840ba[_0x8c57('0xf')][_0x8c57('0x10')](),_0x1d7120,_0x1840ba[_0x8c57('0xa')]);}module[_0x8c57('0x11')]=function(_0x323850){return new winston[(_0x8c57('0x12'))]({'transports':[new winston[(_0x8c57('0x13'))]['File']({'name':util[_0x8c57('0x8')]('%s-%s',_0x323850,_0x8c57('0x14')),'filename':filename(_0x323850,_0x8c57('0x14')),'level':_0x8c57('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3cb7c3){return formatter(_0x323850,_0x3cb7c3);}}),new winston[(_0x8c57('0x13'))][(_0x8c57('0x15'))]({'name':util['format'](_0x8c57('0x16'),_0x323850,_0x8c57('0x17')),'filename':filename(_0x323850,_0x8c57('0x17')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x528707){return formatter(_0x323850,_0x528707);}}),new winston[(_0x8c57('0x13'))]['Console']({'level':process[_0x8c57('0x18')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x552331){return formatter(_0x323850,_0x552331);}})]});}; \ No newline at end of file +var _0x0fd1=['moment','winston','util','INFO','join','/var','log','xcally','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','File','%s-%s','error','transports','info','Console','debugLevel'];(function(_0x345c86,_0x2b12e0){var _0x41e895=function(_0x2af8c3){while(--_0x2af8c3){_0x345c86['push'](_0x345c86['shift']());}};_0x41e895(++_0x2b12e0);}(_0x0fd1,0x12b));var _0x10fd=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x0fd1[_0x9cd4c3];return _0x4c9025;};'use strict';var moment=require(_0x10fd('0x0'));var winston=require(_0x10fd('0x1'));var util=require(_0x10fd('0x2'));var path=require('path');var debugLevel=_0x10fd('0x3');function filename(_0x462192,_0x463e65){return path[_0x10fd('0x4')](_0x10fd('0x5'),_0x10fd('0x6'),_0x10fd('0x7'),util[_0x10fd('0x8')]('%s-%s.log',_0x462192,_0x463e65));}function formatter(_0x35a74b,_0x1d8be4){_0x1d8be4[_0x10fd('0x9')]=_0x1d8be4[_0x10fd('0x9')][_0x10fd('0xa')](/@@{/g,'{{{')['replace'](/}@@/g,_0x10fd('0xb'))[_0x10fd('0xa')](/@{/g,'{{')[_0x10fd('0xa')](/}@/g,'}}');return util[_0x10fd('0x8')](_0x10fd('0xc'),moment()['format'](_0x10fd('0xd')),_0x1d8be4[_0x10fd('0xe')][_0x10fd('0xf')](),_0x35a74b,_0x1d8be4[_0x10fd('0x9')]);}module['exports']=function(_0x541a5a){return new winston['Logger']({'transports':[new winston['transports'][(_0x10fd('0x10'))]({'name':util[_0x10fd('0x8')](_0x10fd('0x11'),_0x541a5a,_0x10fd('0x12')),'filename':filename(_0x541a5a,_0x10fd('0x12')),'level':_0x10fd('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x903fb9){return formatter(_0x541a5a,_0x903fb9);}}),new winston[(_0x10fd('0x13'))][(_0x10fd('0x10'))]({'name':util['format'](_0x10fd('0x11'),_0x541a5a,'info'),'filename':filename(_0x541a5a,_0x10fd('0x14')),'level':_0x10fd('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x133bac){return formatter(_0x541a5a,_0x133bac);}}),new winston[(_0x10fd('0x13'))][(_0x10fd('0x15'))]({'level':process['env'][_0x10fd('0x16')]||debugLevel,'json':![],'formatter':function(_0x1232e7){return formatter(_0x541a5a,_0x1232e7);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index a3f4e00..9412ce9 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 _0xad7d=['path','express','join','../../services/express/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0xad7d,0x108));var _0xdad7=function(_0x3303a6,_0x265336){_0x3303a6=_0x3303a6-0x0;var _0x28c629=_0xad7d[_0x3303a6];return _0x28c629;};'use strict';var path=require(_0xdad7('0x0'));var os=require('os');var config={'apps':[{'name':_0xdad7('0x1'),'script':path[_0xdad7('0x2')](__dirname,_0xdad7('0x3'))},{'name':'ami','script':path[_0xdad7('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0xdad7('0x4'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0xdad7('0x5'),'script':path[_0xdad7('0x2')](__dirname,_0xdad7('0x6'))},{'name':_0xdad7('0x7'),'script':path[_0xdad7('0x2')](__dirname,_0xdad7('0x8'))},{'name':_0xdad7('0x9'),'script':path[_0xdad7('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xdad7('0xa')]=config; \ No newline at end of file +var _0xadb8=['agi','../../services/agi/index.js','routing','xdr','../../services/xdr/index.js','exports','path','join','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0x3fdcee,_0x17dbfe){var _0x4a5788=function(_0x2030aa){while(--_0x2030aa){_0x3fdcee['push'](_0x3fdcee['shift']());}};_0x4a5788(++_0x17dbfe);}(_0xadb8,0x119));var _0x8adb=function(_0x14b767,_0x577e84){_0x14b767=_0x14b767-0x0;var _0x22267a=_0xadb8[_0x14b767];return _0x22267a;};'use strict';var path=require(_0x8adb('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x8adb('0x1')](__dirname,_0x8adb('0x2'))},{'name':_0x8adb('0x3'),'script':path[_0x8adb('0x1')](__dirname,_0x8adb('0x4'))},{'name':_0x8adb('0x5'),'script':path['join'](__dirname,_0x8adb('0x6'))},{'name':'email','script':path[_0x8adb('0x1')](__dirname,'../../services/email/index.js')},{'name':_0x8adb('0x7'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0x8adb('0x8'),'script':path[_0x8adb('0x1')](__dirname,_0x8adb('0x9'))}]};module[_0x8adb('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 3abe6b5..50d8367 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 _0x38ea=['then','start','disconnect','stop','restart','list','describe','delete','dump','saved','bluebird','./config','connect','connected'];(function(_0x1fd44a,_0x3de040){var _0x564afd=function(_0x50295c){while(--_0x50295c){_0x1fd44a['push'](_0x1fd44a['shift']());}};_0x564afd(++_0x3de040);}(_0x38ea,0xa4));var _0xa38e=function(_0x1974f7,_0x592d28){_0x1974f7=_0x1974f7-0x0;var _0x4f82ea=_0x38ea[_0x1974f7];return _0x4f82ea;};'use strict';var pm2=require('pm2');var BPromise=require(_0xa38e('0x0'));var config=require(_0xa38e('0x1'));function connect(){return new BPromise(function(_0x32e410,_0x19b2df){return pm2[_0xa38e('0x2')](function(_0x23b316){if(_0x23b316){return _0x19b2df(_0x23b316);}return _0x32e410(_0xa38e('0x3'));});});};exports['start']=function(_0xa0945d){return connect()[_0xa38e('0x4')](function(){return new BPromise(function(_0x2c0030,_0x3f3b83){return pm2[_0xa38e('0x5')](_0xa0945d,function(_0x2740fd,_0x29ed42){if(_0x2740fd){return _0x3f3b83(_0x2740fd);}pm2[_0xa38e('0x6')]();return _0x2c0030(_0x29ed42);});});});};exports[_0xa38e('0x7')]=function(_0x313576){return connect()[_0xa38e('0x4')](function(){return new BPromise(function(_0x46b5ca,_0x52d9a6){return pm2[_0xa38e('0x7')](_0x313576,function(_0x58fb91,_0xf37469){if(_0x58fb91){return _0x52d9a6(_0x58fb91);}pm2[_0xa38e('0x6')]();return _0x46b5ca(_0xf37469);});});});};exports['restart']=function(_0x219960){return connect()[_0xa38e('0x4')](function(){return new BPromise(function(_0x40a2e0,_0x28d0b1){return pm2[_0xa38e('0x8')](_0x219960,function(_0x1e3671,_0x20ddd7){if(_0x1e3671){return _0x28d0b1(_0x1e3671);}pm2[_0xa38e('0x6')]();return _0x40a2e0(_0x20ddd7);});});});};exports['list']=function(){return connect()[_0xa38e('0x4')](function(){return new BPromise(function(_0x269104,_0x562a81){return pm2[_0xa38e('0x9')](function(_0x256279,_0x425af0){if(_0x256279){return _0x562a81(_0x256279);}pm2['disconnect']();return _0x269104(_0x425af0);});});});};exports['describe']=function(_0x47dc8b){return connect()[_0xa38e('0x4')](function(){return new BPromise(function(_0x4aae6d,_0x25d298){return pm2[_0xa38e('0xa')](_0x47dc8b,function(_0xf7ebd,_0x5bd21b){if(_0xf7ebd){return _0x25d298(_0xf7ebd);}pm2[_0xa38e('0x6')]();return _0x4aae6d(_0x5bd21b);});});});};exports[_0xa38e('0xb')]=function(_0x384d28){return connect()[_0xa38e('0x4')](function(){return new BPromise(function(_0x1c1980,_0x4f2e){return pm2[_0xa38e('0xb')](_0x384d28,function(_0x26eb38,_0x4b59c6){if(_0x26eb38){return _0x4f2e(_0x26eb38);}pm2[_0xa38e('0x6')]();return _0x1c1980(_0x4b59c6);});});});};exports[_0xa38e('0xc')]=function(){return connect()[_0xa38e('0x4')](function(){return new BPromise(function(_0xf3d28,_0x3e63d0){return pm2[_0xa38e('0xc')](function(_0x64c6f0){if(_0x64c6f0){return _0x3e63d0(_0x64c6f0);}return _0xf3d28(_0xa38e('0xd'));});});});}; \ No newline at end of file +var _0xf3db=['stop','restart','list','describe','delete','dump','pm2','bluebird','./config','connect','connected','start','then','disconnect'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xf3db,0x1c6));var _0xbf3d=function(_0x276053,_0x1d8c41){_0x276053=_0x276053-0x0;var _0x3f15e5=_0xf3db[_0x276053];return _0x3f15e5;};'use strict';var pm2=require(_0xbf3d('0x0'));var BPromise=require(_0xbf3d('0x1'));var config=require(_0xbf3d('0x2'));function connect(){return new BPromise(function(_0xc381b0,_0x2ef5bc){return pm2[_0xbf3d('0x3')](function(_0x56a925){if(_0x56a925){return _0x2ef5bc(_0x56a925);}return _0xc381b0(_0xbf3d('0x4'));});});};exports[_0xbf3d('0x5')]=function(_0x1609d8){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x4b1e43,_0x900c06){return pm2[_0xbf3d('0x5')](_0x1609d8,function(_0x254c27,_0x507e74){if(_0x254c27){return _0x900c06(_0x254c27);}pm2[_0xbf3d('0x7')]();return _0x4b1e43(_0x507e74);});});});};exports[_0xbf3d('0x8')]=function(_0x508625){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x8f2be8,_0x49ae10){return pm2[_0xbf3d('0x8')](_0x508625,function(_0x24f861,_0x3faa34){if(_0x24f861){return _0x49ae10(_0x24f861);}pm2['disconnect']();return _0x8f2be8(_0x3faa34);});});});};exports[_0xbf3d('0x9')]=function(_0xbb2d66){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x1b16cd,_0x3227b6){return pm2[_0xbf3d('0x9')](_0xbb2d66,function(_0x39d71b,_0x3f8bb8){if(_0x39d71b){return _0x3227b6(_0x39d71b);}pm2[_0xbf3d('0x7')]();return _0x1b16cd(_0x3f8bb8);});});});};exports[_0xbf3d('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1e8a97,_0x389b13){return pm2[_0xbf3d('0xa')](function(_0x2ee70a,_0x238a23){if(_0x2ee70a){return _0x389b13(_0x2ee70a);}pm2['disconnect']();return _0x1e8a97(_0x238a23);});});});};exports[_0xbf3d('0xb')]=function(_0x172098){return connect()['then'](function(){return new BPromise(function(_0xafbdc8,_0x19ee45){return pm2[_0xbf3d('0xb')](_0x172098,function(_0x207e8a,_0x2b1b6c){if(_0x207e8a){return _0x19ee45(_0x207e8a);}pm2['disconnect']();return _0xafbdc8(_0x2b1b6c);});});});};exports['delete']=function(_0x463844){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x76b4b3,_0xe48b7a){return pm2[_0xbf3d('0xc')](_0x463844,function(_0x403d1a,_0x202bbe){if(_0x403d1a){return _0xe48b7a(_0x403d1a);}pm2[_0xbf3d('0x7')]();return _0x76b4b3(_0x202bbe);});});});};exports['dump']=function(){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x108c8c,_0x45bcc9){return pm2[_0xbf3d('0xd')](function(_0x4e8d2a){if(_0x4e8d2a){return _0x45bcc9(_0x4e8d2a);}return _0x108c8c('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 1545bc5..a3ea30b 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 _0x0fd3=['chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit'];(function(_0x17d9ba,_0x4d980c){var _0x46185d=function(_0x1dce47){while(--_0x1dce47){_0x17d9ba['push'](_0x17d9ba['shift']());}};_0x46185d(++_0x4d980c);}(_0x0fd3,0x9b));var _0x30fd=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x0fd3[_0x42bc91];return _0x3f5507;};'use strict';var _=require('lodash');var moment=require(_0x30fd('0x0'));var Redis=require(_0x30fd('0x1'));var util=require(_0x30fd('0x2'));var config=require('../../config/environment');var db=require(_0x30fd('0x3'))['db'];var logger=require(_0x30fd('0x4'))(_0x30fd('0x5'));config[_0x30fd('0x6')]=_[_0x30fd('0x7')](config[_0x30fd('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x30fd('0x8'))(new Redis(config[_0x30fd('0x6')]));function closeInteractions(){var _0x56afd6=0x0;var _0x49e8cb=[];return db['Setting'][_0x30fd('0x9')]({'raw':!![],'attributes':['id',_0x30fd('0xa')],'where':{'id':0x1}})[_0x30fd('0xb')](function(_0x49d370){_0x56afd6=_0x49d370[_0x30fd('0xa')];if(_0x56afd6){return db[_0x30fd('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x30fd('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x30fd('0xe')](_0x49d370[_0x30fd('0xa')],_0x30fd('0xf'))}}});}else{return[];}})['then'](function(_0x5c66a5){if(_0x5c66a5&&_0x5c66a5[_0x30fd('0x10')]){_0x49e8cb=_['map'](_0x5c66a5||[],'id');logger[_0x30fd('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x49e8cb[_0x30fd('0x12')]());return db[_0x30fd('0xc')][_0x30fd('0x13')]({'closeReason':_0x30fd('0x14'),'disposition':_0x30fd('0x15'),'closed':!![],'closedAt':moment()[_0x30fd('0x16')](_0x30fd('0x17'))},{'where':{'id':_0x49e8cb}});}})[_0x30fd('0xb')](function(){if(_0x49e8cb&&_0x49e8cb[_0x30fd('0x10')]){logger[_0x30fd('0x11')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x49e8cb[_0x30fd('0x12')]());for(var _0x36d64b=0x0;_0x36d64b<_0x49e8cb[_0x30fd('0x10')];_0x36d64b++){io[_0x30fd('0x18')](_0x30fd('0x19'),{'id':_0x49e8cb[_0x36d64b],'closed':!![]});}}})[_0x30fd('0x1a')](function(_0x552c7f){logger[_0x30fd('0x1b')](_0x30fd('0x1c'),_0x552c7f?util[_0x30fd('0x1d')](_0x552c7f,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5024=['util','../../config/environment','../../mysqldb','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','lastMsgAt','subtract','minutes','then','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','ioredis'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5024,0x115));var _0x4502=function(_0x32e238,_0xf171e8){_0x32e238=_0x32e238-0x0;var _0x1d6a4f=_0x5024[_0x32e238];return _0x1d6a4f;};'use strict';var _=require(_0x4502('0x0'));var moment=require('moment');var Redis=require(_0x4502('0x1'));var util=require(_0x4502('0x2'));var config=require(_0x4502('0x3'));var db=require(_0x4502('0x4'))['db'];var logger=require('../logger')(_0x4502('0x5'));config[_0x4502('0x6')]=_[_0x4502('0x7')](config[_0x4502('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x4502('0x8'))(new Redis(config[_0x4502('0x6')]));function closeInteractions(){var _0x5e3785=0x0;var _0x5dd749=[];return db[_0x4502('0x9')][_0x4502('0xa')]({'raw':!![],'attributes':['id',_0x4502('0xb')],'where':{'id':0x1}})['then'](function(_0x54c839){_0x5e3785=_0x54c839[_0x4502('0xb')];if(_0x5e3785){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x4502('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4502('0xd')](_0x54c839[_0x4502('0xb')],_0x4502('0xe'))}}});}else{return[];}})[_0x4502('0xf')](function(_0x32075a){if(_0x32075a&&_0x32075a[_0x4502('0x10')]){_0x5dd749=_[_0x4502('0x11')](_0x32075a||[],'id');logger[_0x4502('0x12')](_0x4502('0x13'),_0x5dd749[_0x4502('0x14')]());return db[_0x4502('0x15')][_0x4502('0x16')]({'closeReason':_0x4502('0x17'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x4502('0x18')](_0x4502('0x19'))},{'where':{'id':_0x5dd749}});}})['then'](function(){if(_0x5dd749&&_0x5dd749[_0x4502('0x10')]){logger[_0x4502('0x12')](_0x4502('0x1a'),_0x5dd749[_0x4502('0x14')]());for(var _0x100a93=0x0;_0x100a93<_0x5dd749[_0x4502('0x10')];_0x100a93++){io['emit']('chatInteraction:update',{'id':_0x5dd749[_0x100a93],'closed':!![]});}}})[_0x4502('0x1b')](function(_0x15494a){logger[_0x4502('0x1c')](_0x4502('0x1d'),_0x15494a?util[_0x4502('0x1e')](_0x15494a,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 69354f2..53712f2 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 _0x7ff6=['authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','savename','%s.%s','basename','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','SendMail','error\x20mail','stringify','info','email\x20sent','catch','error','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','then','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','keyBy','intersection','difference','length','exists','stop','delete\x20cron','toRun','index','resolve','run\x20job','cron','startAt','add','start','add\x20cron','deleteJob','stop\x20cron','active','isBetween','endAt','update\x20cron','run','cron-job-manager','bluebird','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure'];(function(_0x200a54,_0x1f1d50){var _0x564df2=function(_0x2ff0d1){while(--_0x2ff0d1){_0x200a54['push'](_0x200a54['shift']());}};_0x564df2(++_0x1f1d50);}(_0x7ff6,0xf1));var _0x67ff=function(_0x5ef8bb,_0x27f244){_0x5ef8bb=_0x5ef8bb-0x0;var _0x3aea63=_0x7ff6[_0x5ef8bb];return _0x3aea63;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0x67ff('0x0'));var jayson=require('jayson/promise');var BPromise=require(_0x67ff('0x1'));var logger=require('../logger')(_0x67ff('0x2'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x67ff('0x3'));var analyticDefaultReportController=require(_0x67ff('0x4'));var client=jayson['client'][_0x67ff('0x5')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3665a4,_0x5e8772){return function(){logger['info'](_0x67ff('0x6'),_0x3665a4[_0x67ff('0x7')]);var _0x28d729=!![];var _0x3cfb6b={'tls':{'rejectUnauthorized':![]}};if(_0x3665a4[_0x67ff('0x8')][_0x67ff('0x9')][_0x67ff('0xa')]){_0x3cfb6b[_0x67ff('0xa')]=_0x3665a4[_0x67ff('0x8')]['Smtp']['service'];}else{_0x3cfb6b[_0x67ff('0xb')]=_0x3665a4[_0x67ff('0x8')][_0x67ff('0x9')][_0x67ff('0xb')];_0x3cfb6b[_0x67ff('0xc')]=_0x3665a4[_0x67ff('0x8')][_0x67ff('0x9')][_0x67ff('0xc')];_0x3cfb6b[_0x67ff('0xd')]=_0x3665a4[_0x67ff('0x8')][_0x67ff('0x9')]['secure'];}if(_0x3665a4['MailAccount'][_0x67ff('0x9')][_0x67ff('0xe')]){_0x3cfb6b[_0x67ff('0xf')]={'user':_0x3665a4[_0x67ff('0x8')][_0x67ff('0x9')][_0x67ff('0x10')],'pass':_0x3665a4[_0x67ff('0x8')]['Smtp'][_0x67ff('0x11')]};}var _0x53c564={'account':_0x3cfb6b,'message':{'from':util[_0x67ff('0x12')](_0x67ff('0x13'),_0x3665a4[_0x67ff('0x8')]['name'],_0x3665a4[_0x67ff('0x8')][_0x67ff('0x7')]||_0x3665a4[_0x67ff('0x8')][_0x67ff('0x9')][_0x67ff('0x10')]),'to':_0x3665a4['email'],'cc':_0x3665a4['cc'],'bcc':_0x3665a4[_0x67ff('0x14')],'subject':util[_0x67ff('0x12')](_0x67ff('0x15'),_0x5e8772[_0x67ff('0x16')],_0x3665a4[_0x67ff('0x17')],_0x3665a4[_0x67ff('0x18')])}};var _0x3f4804=path[_0x67ff('0x19')](__dirname,'../../files/reports');var _0x5db03c=_0x5e8772[_0x67ff('0x1a')];var _0x3c7d94=util[_0x67ff('0x12')](_0x67ff('0x1b'),path[_0x67ff('0x1c')](_0x5e8772[_0x67ff('0x1a')],path['extname'](_0x5e8772[_0x67ff('0x1a')])),_0x67ff('0x1d'));var _0x2a82d1=path[_0x67ff('0x19')](_0x3f4804,_0x5db03c);var _0x28b68c=path[_0x67ff('0x19')](_0x3f4804,_0x3c7d94);if(fs[_0x67ff('0x1e')](_0x2a82d1)){_0x5e8772[_0x67ff('0x1f')]=_0x67ff('0x20');_0x53c564[_0x67ff('0x21')][_0x67ff('0x22')]=[{'filename':_0x5db03c,'path':_0x2a82d1}];_0x53c564[_0x67ff('0x21')][_0x67ff('0x23')]=util[_0x67ff('0x12')](_0x67ff('0x24'),JSON['stringify'](_0x5e8772,null,0x2));}else if(fs[_0x67ff('0x1e')](_0x28b68c)){_0x5e8772[_0x67ff('0x1f')]='Sent';_0x53c564[_0x67ff('0x21')][_0x67ff('0x22')]=[{'filename':_0x3c7d94,'path':_0x28b68c}];}else{_0x53c564[_0x67ff('0x21')][_0x67ff('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x3665a4['sendIfEmpty']){_0x28d729=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x28d729){return client['request'](_0x67ff('0x25'),_0x53c564)['then'](function(_0x40dccf){if(_0x40dccf['error']){return logger['error'](_0x67ff('0x26'),JSON[_0x67ff('0x27')](_0x40dccf));}return logger[_0x67ff('0x28')](_0x67ff('0x29'));})[_0x67ff('0x2a')](function(_0x48409e){return logger[_0x67ff('0x2b')](_0x67ff('0x26'),JSON[_0x67ff('0x27')](_0x48409e));});}};}function handleError(){return function(_0x5f3399){return logger[_0x67ff('0x2b')](JSON['stringify'](_0x5f3399));};}function handleResult(_0xe2afa7){return function(_0x37e04a){logger[_0x67ff('0x28')]('data',JSON[_0x67ff('0x27')](_0x37e04a));if(_0xe2afa7[_0x67ff('0x8')]&&_0xe2afa7[_0x67ff('0x8')][_0x67ff('0x9')]&&!_[_0x67ff('0x2c')](_0xe2afa7[_0x67ff('0x7')])){setTimeout(handleSendEmail(_0xe2afa7,_0x37e04a),0x3c*0x3e8);}};}function handleJob(_0x492f65){return function(){try{if(_[_0x67ff('0x2c')](_0x492f65['subtractNumber'])){return logger[_0x67ff('0x28')](_0x67ff('0x2d'));}if(_[_0x67ff('0x2c')](_0x492f65[_0x67ff('0x18')])){return logger[_0x67ff('0x28')](_0x67ff('0x2e'));}var _0x4cf424={'startDate':moment()['subtract'](_0x492f65[_0x67ff('0x17')],_0x492f65['subtractUnit'])[_0x67ff('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x67ff('0x12')](_0x67ff('0x2f')),'type':_0x67ff('0x30'),'output':_0x492f65[_0x67ff('0x31')],'name':_0x492f65[_0x67ff('0x16')]};if(!_[_0x67ff('0x2c')](_0x492f65[_0x67ff('0x32')])){logger[_0x67ff('0x28')](_0x67ff('0x33'),_0x492f65[_0x67ff('0x32')]);return analyticDefaultReportController[_0x67ff('0x34')]({'id':_0x492f65[_0x67ff('0x32')]},_0x4cf424)['then'](handleResult(_0x492f65))[_0x67ff('0x2a')](handleError());}if(!_[_0x67ff('0x2c')](_0x492f65['CustomReportId'])){logger[_0x67ff('0x28')]('exec\x20custom\x20report\x20id:%s',_0x492f65[_0x67ff('0x35')]);return analyticCustomReportController[_0x67ff('0x34')]({'id':_0x492f65['CustomReportId']},_0x4cf424)[_0x67ff('0x36')](handleResult(_0x492f65))['catch'](handleError());}}catch(_0x1b7d93){logger['error'](JSON[_0x67ff('0x27')](_0x1b7d93));}return logger[_0x67ff('0x28')](_0x67ff('0x37'));};}function getJobs(_0x1a33ff){var _0x356d8c={};if(_0x1a33ff){_0x356d8c['id']=_0x1a33ff;}return db[_0x67ff('0x38')][_0x67ff('0x39')]({'where':_0x356d8c,'include':[{'model':db[_0x67ff('0x8')],'attributes':['id','name',_0x67ff('0x7')],'include':[{'model':db[_0x67ff('0x3a')],'as':_0x67ff('0x9')}]}]})[_0x67ff('0x36')](function(_0x210e2f){var _0x29375b=_['keys'](manager[_0x67ff('0x3b')]);var _0x3fdd08=_[_0x67ff('0x3c')](_0x210e2f,function(_0x52a65a){return _0x52a65a['id'][_0x67ff('0x3d')]();});var _0x2cfc5d=_[_0x67ff('0x3e')](_0x210e2f,function(_0x2161f1){return _0x2161f1['id']['toString']();});var _0x7df786=_0x1a33ff?_0x3fdd08:_['difference'](_0x3fdd08,_0x29375b);var _0x1769ec=_[_0x67ff('0x3f')](_0x3fdd08,_0x29375b);var _0x4da835=_[_0x67ff('0x40')](_0x29375b,_0x3fdd08);var _0x22544e;var _0x21f6ac;for(_0x22544e=0x0;_0x22544e<_0x4da835[_0x67ff('0x41')]&&!_0x1a33ff;_0x22544e+=0x1){_0x21f6ac=_0x4da835[_0x22544e][_0x67ff('0x3d')]();if(manager[_0x67ff('0x42')](_0x21f6ac)){manager[_0x67ff('0x43')](_0x21f6ac);manager['deleteJob'](_0x21f6ac);logger['info'](_0x67ff('0x44'),_0x21f6ac);}}logger[_0x67ff('0x28')](_0x67ff('0x45'),JSON[_0x67ff('0x27')](_0x7df786));for(_0x22544e=0x0;_0x22544e<_0x7df786['length'];_0x22544e+=0x1){_0x21f6ac=_0x7df786[_0x22544e][_0x67ff('0x3d')]();logger[_0x67ff('0x28')](_0x67ff('0x46'),_0x21f6ac);if(_0x1a33ff){logger[_0x67ff('0x28')]('my\x20id',_0x1a33ff);logger['info'](JSON[_0x67ff('0x27')](_0x2cfc5d[_0x21f6ac]));BPromise[_0x67ff('0x47')]()[_0x67ff('0x36')](handleJob(_0x2cfc5d[_0x21f6ac]));logger[_0x67ff('0x28')](_0x67ff('0x48'),_0x2cfc5d[_0x21f6ac]['name'],_0x2cfc5d[_0x21f6ac][_0x67ff('0x49')]);}else if(_0x2cfc5d[_0x21f6ac][_0x67ff('0x49')]&&_0x2cfc5d[_0x21f6ac]['active']&&moment()['isBetween'](_0x2cfc5d[_0x21f6ac][_0x67ff('0x4a')],_0x2cfc5d[_0x21f6ac]['endAt'])){manager[_0x67ff('0x4b')](_0x21f6ac,_0x2cfc5d[_0x21f6ac][_0x67ff('0x49')],handleJob(_0x2cfc5d[_0x21f6ac]));manager[_0x67ff('0x4c')](_0x21f6ac);logger['info'](_0x67ff('0x4d'),_0x2cfc5d[_0x21f6ac][_0x67ff('0x16')],_0x2cfc5d[_0x21f6ac][_0x67ff('0x49')]);}else if(manager[_0x67ff('0x42')](_0x21f6ac)){manager[_0x67ff('0x43')](_0x21f6ac);manager[_0x67ff('0x4e')](_0x21f6ac);logger[_0x67ff('0x28')](_0x67ff('0x4f'),_0x2cfc5d[_0x21f6ac][_0x67ff('0x16')],_0x2cfc5d[_0x21f6ac][_0x67ff('0x49')]);}}for(_0x22544e=0x0,_0x21f6ac;_0x22544e<_0x1769ec['length']&&!_0x1a33ff;_0x22544e+=0x1){_0x21f6ac=_0x1769ec[_0x22544e][_0x67ff('0x3d')]();if(manager[_0x67ff('0x42')](_0x21f6ac)){if(_0x2cfc5d[_0x21f6ac][_0x67ff('0x49')]&&_0x2cfc5d[_0x21f6ac][_0x67ff('0x50')]&&moment()[_0x67ff('0x51')](_0x2cfc5d[_0x21f6ac][_0x67ff('0x4a')],_0x2cfc5d[_0x21f6ac][_0x67ff('0x52')])){manager['update'](_0x21f6ac,_0x2cfc5d[_0x21f6ac]['cron'],handleJob(_0x2cfc5d[_0x21f6ac]));logger[_0x67ff('0x28')](_0x67ff('0x53'),_0x2cfc5d[_0x21f6ac][_0x67ff('0x16')],_0x2cfc5d[_0x21f6ac]['cron']);}else{manager[_0x67ff('0x43')](_0x21f6ac);manager[_0x67ff('0x4e')](_0x21f6ac);logger[_0x67ff('0x28')](_0x67ff('0x4f'),_0x2cfc5d[_0x21f6ac][_0x67ff('0x16')],_0x2cfc5d[_0x21f6ac]['cron']);}}}})[_0x67ff('0x2a')](function(_0x57c45c){logger['error'](JSON[_0x67ff('0x27')](_0x57c45c));});}exports[_0x67ff('0x54')]=function(_0x2ae43e){return getJobs(_0x2ae43e);};exports[_0x67ff('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x8d2a=['Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','keyBy','toString','difference','length','stop','deleteJob','delete\x20cron','toRun','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','exists','update','update\x20cron','stop\x20cron','start','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','name','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8d2a,0x8a));var _0xa8d2=function(_0x52eea8,_0x3e6e1c){_0x52eea8=_0x52eea8-0x0;var _0xcd712e=_0x8d2a[_0x52eea8];return _0xcd712e;};'use strict';var fs=require('fs');var util=require(_0xa8d2('0x0'));var path=require(_0xa8d2('0x1'));var _=require(_0xa8d2('0x2'));var moment=require(_0xa8d2('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xa8d2('0x4'));var BPromise=require(_0xa8d2('0x5'));var logger=require(_0xa8d2('0x6'))(_0xa8d2('0x7'));var db=require(_0xa8d2('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xa8d2('0x9'));var client=jayson[_0xa8d2('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3b199b,_0x38cbd0){return function(){logger['info'](_0xa8d2('0xb'),_0x3b199b[_0xa8d2('0xc')]);var _0x50f614=!![];var _0x35f433={'tls':{'rejectUnauthorized':![]}};if(_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0xe')][_0xa8d2('0xf')]){_0x35f433['service']=_0x3b199b['MailAccount'][_0xa8d2('0xe')][_0xa8d2('0xf')];}else{_0x35f433[_0xa8d2('0x10')]=_0x3b199b[_0xa8d2('0xd')]['Smtp'][_0xa8d2('0x10')];_0x35f433[_0xa8d2('0x11')]=_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0xe')][_0xa8d2('0x11')];_0x35f433[_0xa8d2('0x12')]=_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0xe')]['secure'];}if(_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0xe')][_0xa8d2('0x13')]){_0x35f433[_0xa8d2('0x14')]={'user':_0x3b199b['MailAccount'][_0xa8d2('0xe')]['user'],'pass':_0x3b199b[_0xa8d2('0xd')]['Smtp'][_0xa8d2('0x15')]};}var _0x4c6cba={'account':_0x35f433,'message':{'from':util['format'](_0xa8d2('0x16'),_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0x17')],_0x3b199b[_0xa8d2('0xd')]['email']||_0x3b199b[_0xa8d2('0xd')]['Smtp'][_0xa8d2('0x18')]),'to':_0x3b199b['email'],'cc':_0x3b199b['cc'],'bcc':_0x3b199b[_0xa8d2('0x19')],'subject':util[_0xa8d2('0x1a')](_0xa8d2('0x1b'),_0x38cbd0[_0xa8d2('0x17')],_0x3b199b[_0xa8d2('0x1c')],_0x3b199b[_0xa8d2('0x1d')])}};var _0x434122=path[_0xa8d2('0x1e')](__dirname,_0xa8d2('0x1f'));var _0x41673f=_0x38cbd0['savename'];var _0x5cbdf9=util[_0xa8d2('0x1a')]('%s.%s',path[_0xa8d2('0x20')](_0x38cbd0[_0xa8d2('0x21')],path[_0xa8d2('0x22')](_0x38cbd0[_0xa8d2('0x21')])),_0xa8d2('0x23'));var _0x78e727=path[_0xa8d2('0x1e')](_0x434122,_0x41673f);var _0x5ef378=path[_0xa8d2('0x1e')](_0x434122,_0x5cbdf9);if(fs[_0xa8d2('0x24')](_0x78e727)){_0x38cbd0[_0xa8d2('0x25')]=_0xa8d2('0x26');_0x4c6cba[_0xa8d2('0x27')][_0xa8d2('0x28')]=[{'filename':_0x41673f,'path':_0x78e727}];_0x4c6cba[_0xa8d2('0x27')][_0xa8d2('0x29')]=util[_0xa8d2('0x1a')](_0xa8d2('0x2a'),JSON[_0xa8d2('0x2b')](_0x38cbd0,null,0x2));}else if(fs[_0xa8d2('0x24')](_0x5ef378)){_0x38cbd0[_0xa8d2('0x25')]='Sent';_0x4c6cba['message'][_0xa8d2('0x28')]=[{'filename':_0x5cbdf9,'path':_0x5ef378}];}else{_0x4c6cba[_0xa8d2('0x27')]['text']=_0xa8d2('0x2c');if(!_0x3b199b['sendIfEmpty']){_0x50f614=![];logger[_0xa8d2('0x2d')](_0xa8d2('0x2e'));}}if(_0x50f614){return client['request'](_0xa8d2('0x2f'),_0x4c6cba)[_0xa8d2('0x30')](function(_0x575737){if(_0x575737[_0xa8d2('0x31')]){return logger[_0xa8d2('0x31')]('error\x20mail',JSON['stringify'](_0x575737));}return logger[_0xa8d2('0x2d')]('email\x20sent');})[_0xa8d2('0x32')](function(_0x501a46){return logger['error'](_0xa8d2('0x33'),JSON[_0xa8d2('0x2b')](_0x501a46));});}};}function handleError(){return function(_0x508c51){return logger[_0xa8d2('0x31')](JSON[_0xa8d2('0x2b')](_0x508c51));};}function handleResult(_0x405012){return function(_0xb52f46){logger[_0xa8d2('0x2d')](_0xa8d2('0x34'),JSON[_0xa8d2('0x2b')](_0xb52f46));if(_0x405012[_0xa8d2('0xd')]&&_0x405012['MailAccount'][_0xa8d2('0xe')]&&!_[_0xa8d2('0x35')](_0x405012[_0xa8d2('0xc')])){setTimeout(handleSendEmail(_0x405012,_0xb52f46),0x3c*0x3e8);}};}function handleJob(_0x56e2f6){return function(){try{if(_[_0xa8d2('0x35')](_0x56e2f6[_0xa8d2('0x1c')])){return logger[_0xa8d2('0x2d')](_0xa8d2('0x36'));}if(_[_0xa8d2('0x35')](_0x56e2f6[_0xa8d2('0x1d')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x3e1758={'startDate':moment()[_0xa8d2('0x37')](_0x56e2f6[_0xa8d2('0x1c')],_0x56e2f6[_0xa8d2('0x1d')])[_0xa8d2('0x1a')](_0xa8d2('0x38')),'endDate':moment()[_0xa8d2('0x1a')](_0xa8d2('0x38')),'type':_0xa8d2('0x39'),'output':_0x56e2f6[_0xa8d2('0x3a')],'name':_0x56e2f6[_0xa8d2('0x17')]};if(!_[_0xa8d2('0x35')](_0x56e2f6[_0xa8d2('0x3b')])){logger['info'](_0xa8d2('0x3c'),_0x56e2f6[_0xa8d2('0x3b')]);return analyticDefaultReportController[_0xa8d2('0x3d')]({'id':_0x56e2f6[_0xa8d2('0x3b')]},_0x3e1758)[_0xa8d2('0x30')](handleResult(_0x56e2f6))[_0xa8d2('0x32')](handleError());}if(!_[_0xa8d2('0x35')](_0x56e2f6[_0xa8d2('0x3e')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x56e2f6[_0xa8d2('0x3e')]);return analyticCustomReportController['runReport']({'id':_0x56e2f6[_0xa8d2('0x3e')]},_0x3e1758)['then'](handleResult(_0x56e2f6))['catch'](handleError());}}catch(_0x3aba82){logger[_0xa8d2('0x31')](JSON['stringify'](_0x3aba82));}return logger[_0xa8d2('0x2d')](_0xa8d2('0x3f'));};}function getJobs(_0x2b973e){var _0x2b793e={};if(_0x2b973e){_0x2b793e['id']=_0x2b973e;}return db[_0xa8d2('0x40')][_0xa8d2('0x41')]({'where':_0x2b793e,'include':[{'model':db[_0xa8d2('0xd')],'attributes':['id','name',_0xa8d2('0xc')],'include':[{'model':db[_0xa8d2('0x42')],'as':'Smtp'}]}]})[_0xa8d2('0x30')](function(_0x325935){var _0x4d1c34=_[_0xa8d2('0x43')](manager[_0xa8d2('0x44')]);var _0x2019eb=_['map'](_0x325935,function(_0x3eb9cd){return _0x3eb9cd['id']['toString']();});var _0x28453c=_[_0xa8d2('0x45')](_0x325935,function(_0x5b1966){return _0x5b1966['id'][_0xa8d2('0x46')]();});var _0x29c8dd=_0x2b973e?_0x2019eb:_[_0xa8d2('0x47')](_0x2019eb,_0x4d1c34);var _0x505d55=_['intersection'](_0x2019eb,_0x4d1c34);var _0x487629=_[_0xa8d2('0x47')](_0x4d1c34,_0x2019eb);var _0x4e55b5;var _0x3db09c;for(_0x4e55b5=0x0;_0x4e55b5<_0x487629[_0xa8d2('0x48')]&&!_0x2b973e;_0x4e55b5+=0x1){_0x3db09c=_0x487629[_0x4e55b5][_0xa8d2('0x46')]();if(manager['exists'](_0x3db09c)){manager[_0xa8d2('0x49')](_0x3db09c);manager[_0xa8d2('0x4a')](_0x3db09c);logger[_0xa8d2('0x2d')](_0xa8d2('0x4b'),_0x3db09c);}}logger[_0xa8d2('0x2d')](_0xa8d2('0x4c'),JSON[_0xa8d2('0x2b')](_0x29c8dd));for(_0x4e55b5=0x0;_0x4e55b5<_0x29c8dd['length'];_0x4e55b5+=0x1){_0x3db09c=_0x29c8dd[_0x4e55b5]['toString']();logger[_0xa8d2('0x2d')]('index',_0x3db09c);if(_0x2b973e){logger[_0xa8d2('0x2d')]('my\x20id',_0x2b973e);logger[_0xa8d2('0x2d')](JSON[_0xa8d2('0x2b')](_0x28453c[_0x3db09c]));BPromise[_0xa8d2('0x4d')]()[_0xa8d2('0x30')](handleJob(_0x28453c[_0x3db09c]));logger[_0xa8d2('0x2d')](_0xa8d2('0x4e'),_0x28453c[_0x3db09c]['name'],_0x28453c[_0x3db09c][_0xa8d2('0x4f')]);}else if(_0x28453c[_0x3db09c]['cron']&&_0x28453c[_0x3db09c][_0xa8d2('0x50')]&&moment()[_0xa8d2('0x51')](_0x28453c[_0x3db09c][_0xa8d2('0x52')],_0x28453c[_0x3db09c][_0xa8d2('0x53')])){manager[_0xa8d2('0x54')](_0x3db09c,_0x28453c[_0x3db09c][_0xa8d2('0x4f')],handleJob(_0x28453c[_0x3db09c]));manager['start'](_0x3db09c);logger['info'](_0xa8d2('0x55'),_0x28453c[_0x3db09c][_0xa8d2('0x17')],_0x28453c[_0x3db09c]['cron']);}else if(manager[_0xa8d2('0x56')](_0x3db09c)){manager[_0xa8d2('0x49')](_0x3db09c);manager['deleteJob'](_0x3db09c);logger[_0xa8d2('0x2d')]('stop\x20cron',_0x28453c[_0x3db09c][_0xa8d2('0x17')],_0x28453c[_0x3db09c][_0xa8d2('0x4f')]);}}for(_0x4e55b5=0x0,_0x3db09c;_0x4e55b5<_0x505d55[_0xa8d2('0x48')]&&!_0x2b973e;_0x4e55b5+=0x1){_0x3db09c=_0x505d55[_0x4e55b5]['toString']();if(manager[_0xa8d2('0x56')](_0x3db09c)){if(_0x28453c[_0x3db09c][_0xa8d2('0x4f')]&&_0x28453c[_0x3db09c][_0xa8d2('0x50')]&&moment()['isBetween'](_0x28453c[_0x3db09c][_0xa8d2('0x52')],_0x28453c[_0x3db09c][_0xa8d2('0x53')])){manager[_0xa8d2('0x57')](_0x3db09c,_0x28453c[_0x3db09c]['cron'],handleJob(_0x28453c[_0x3db09c]));logger[_0xa8d2('0x2d')](_0xa8d2('0x58'),_0x28453c[_0x3db09c][_0xa8d2('0x17')],_0x28453c[_0x3db09c]['cron']);}else{manager['stop'](_0x3db09c);manager[_0xa8d2('0x4a')](_0x3db09c);logger[_0xa8d2('0x2d')](_0xa8d2('0x59'),_0x28453c[_0x3db09c]['name'],_0x28453c[_0x3db09c][_0xa8d2('0x4f')]);}}}})[_0xa8d2('0x32')](function(_0x57d876){logger[_0xa8d2('0x31')](JSON[_0xa8d2('0x2b')](_0x57d876));});}exports['run']=function(_0x29cfb2){return getJobs(_0x29cfb2);};exports[_0xa8d2('0x5a')]=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 b04bc19..ee96f05 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 _0x10b8=['info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','fileText','transcripts','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','sentiment','sentimentAccountId','sentimentRegion','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','update','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','findOne','language','Neutral','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','transcribeAccountId','forEach','push','all','catch','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring'];(function(_0x1afa85,_0x30ce0a){var _0x566f7f=function(_0xf74755){while(--_0xf74755){_0x1afa85['push'](_0x1afa85['shift']());}};_0x566f7f(++_0x30ce0a);}(_0x10b8,0x166));var _0x810b=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x10b8[_0x346737];return _0x1ade2e;};var _=require(_0x810b('0x0'));var AWS=require(_0x810b('0x1'));var rp=require(_0x810b('0x2'));var util=require(_0x810b('0x3'));var BPromise=require(_0x810b('0x4'));var db=require(_0x810b('0x5'))['db'];var logger=require('../../config/logger')(_0x810b('0x6'));function getTranscriptionJob(_0x30dac0,_0x2cef3f,_0x55b8cf,_0x1fde02){return new Promise(function(_0x3166f9,_0x3d3a15){var _0x33b73f=new AWS[(_0x810b('0x7'))]({'accessKeyId':_0x2cef3f,'secretAccessKey':_0x30dac0,'region':_0x55b8cf});_0x33b73f[_0x810b('0x8')]({'TranscriptionJobName':_0x1fde02},function(_0x43e6ed,_0x567a99){if(_0x43e6ed){return _0x3d3a15(_0x43e6ed);}else{return _0x3166f9(_0x567a99);}});});}function sentiment(_0x27e616,_0x5143bb,_0x2afe3e,_0x3cf5cc,_0x2882aa){return new Promise(function(_0x6260ea,_0x28be6f){var _0x48101e=new AWS[(_0x810b('0x9'))]({'accessKeyId':_0x5143bb,'secretAccessKey':_0x27e616,'region':_0x2afe3e});_0x48101e[_0x810b('0xa')]({'Text':_0x3cf5cc,'LanguageCode':_0x2882aa[_0x810b('0xb')](0x0,0x2)},function(_0x322a38,_0x498607){if(_0x322a38){return _0x28be6f(_0x322a38);}else{return _0x6260ea(_0x498607);}});});}function checkTranscribeJob(_0x37d408,_0x1cc57d,_0x24bb1d){var _0x2069a9;return new BPromise(function(_0x16f727,_0x35a166){logger[_0x810b('0xc')](util[_0x810b('0xd')](_0x810b('0xe'),_0x37d408['id'],_0x37d408[_0x810b('0xf')]));return getTranscriptionJob(_0x24bb1d['data1'],_0x24bb1d['data2'],_0x1cc57d[_0x810b('0x10')],_0x37d408[_0x810b('0xf')])[_0x810b('0x11')](function(_0xea1d2a){logger[_0x810b('0xc')](util[_0x810b('0xd')](_0x810b('0x12'),_0x37d408['id'],_0x37d408[_0x810b('0xf')],_0xea1d2a[_0x810b('0x13')][_0x810b('0x14')]));if(!_0x37d408['fileText']){switch(_0xea1d2a[_0x810b('0x13')]['TranscriptionJobStatus']){case _0x810b('0x15'):var _0x22e695={'transcribeStatus':_0xea1d2a[_0x810b('0x13')]['TranscriptionJobStatus'],'fileUri':_0xea1d2a[_0x810b('0x13')]['Transcript'][_0x810b('0x16')]};logger['info'](util[_0x810b('0xd')]('[RECORDING:%d]\x20Get\x20transcript',_0x37d408['id']));return rp({'uri':_0xea1d2a[_0x810b('0x13')][_0x810b('0x17')][_0x810b('0x16')],'json':!![]})['then'](function(_0x1e3642){logger['info'](util[_0x810b('0xd')](_0x810b('0x18'),_0x37d408['id']));if(_0x1e3642&&_0x1e3642[_0x810b('0x19')]&&_0x1e3642[_0x810b('0x19')]['transcripts']&&_0x1e3642[_0x810b('0x19')]['transcripts'][_0x810b('0x1a')]){_0x22e695[_0x810b('0x1b')]='';for(var _0x37bed2=0x0;_0x37bed2<_0x1e3642[_0x810b('0x19')]['transcripts'][_0x810b('0x1a')];_0x37bed2++){_0x22e695['fileText']+=_0x1e3642[_0x810b('0x19')][_0x810b('0x1c')][_0x37bed2][_0x810b('0x1d')]+'';}}return _0x37d408['update'](_0x22e695);})[_0x810b('0x11')](function(){logger[_0x810b('0xc')](util[_0x810b('0xd')](_0x810b('0x1e'),_0x37d408['id']));if(!_0x37d408[_0x810b('0x1f')]){throw new db[(_0x810b('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1cc57d[_0x810b('0x21')]||!_0x1cc57d[_0x810b('0x22')]||!_0x1cc57d[_0x810b('0x23')]||!_0x1cc57d['language']||!_0x1cc57d[_0x810b('0x24')]){throw new db['Sequelize'][(_0x810b('0x25'))](_0x810b('0x26'));}if(!_0x22e695[_0x810b('0x1b')]){throw new Error(_0x810b('0x27'));}if(_0x1cc57d[_0x810b('0x22')]===_0x24bb1d['id']){return _0x24bb1d;}else{return db[_0x810b('0x28')]['findOne']({'where':{'id':_settings[_0x810b('0x22')]}});}})['then'](function(_0xd00df){if(!_0xd00df){throw new db[(_0x810b('0x20'))][(_0x810b('0x25'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xd00df[_0x810b('0x29')]||!_0xd00df[_0x810b('0x2a')]){throw new db['Sequelize'][(_0x810b('0x25'))](_0x810b('0x2b'));}_0x2069a9=_0xd00df;logger[_0x810b('0xc')](util['format'](_0x810b('0x2c'),_0x37d408['id']));return sentiment(_0x2069a9[_0x810b('0x29')],_0x2069a9[_0x810b('0x2a')],_0x1cc57d['sentimentRegion'],_0x22e695[_0x810b('0x1b')],_0x1cc57d['language']);})[_0x810b('0x11')](function(_0x5c30cd){logger[_0x810b('0xc')](util[_0x810b('0xd')](_0x810b('0x2d'),_0x37d408['id']));return _0x37d408['update']({'sentiment':_0x5c30cd[_0x810b('0x2e')],'sPositive':_0x5c30cd[_0x810b('0x2f')][_0x810b('0x30')],'sNegative':_0x5c30cd[_0x810b('0x2f')][_0x810b('0x31')],'sMixed':_0x5c30cd[_0x810b('0x2f')][_0x810b('0x32')],'sNeutral':_0x5c30cd[_0x810b('0x2f')]['Neutral']});})[_0x810b('0x11')](function(){logger[_0x810b('0xc')](util[_0x810b('0xd')](_0x810b('0x1e'),_0x37d408['id']));_0x16f727();});case'FAILED':return _0x37d408[_0x810b('0x33')]({'transcribeStatus':_0x810b('0x34'),'failureReason':_0xea1d2a[_0x810b('0x13')][_0x810b('0x35')]})[_0x810b('0x11')](function(){logger[_0x810b('0xc')](util['format'](_0x810b('0x1e'),_0x37d408['id']));_0x16f727();});default:logger[_0x810b('0xc')](util[_0x810b('0xd')](_0x810b('0x36'),_0x37d408['id']));break;}}else{return BPromise[_0x810b('0x37')]()['then'](function(){if(!_0x37d408['tempSentiment']){throw new db[(_0x810b('0x20'))]['ValidationError'](_0x810b('0x38'));}if(!_0x1cc57d[_0x810b('0x21')]||!_0x1cc57d[_0x810b('0x22')]||!_0x1cc57d[_0x810b('0x23')]||!_0x1cc57d['language']||!_0x1cc57d[_0x810b('0x24')]){throw new db['Sequelize'][(_0x810b('0x25'))](_0x810b('0x26'));}if(!_0x37d408[_0x810b('0x1b')]){throw new Error(_0x810b('0x27'));}if(_0x1cc57d[_0x810b('0x22')]===_0x24bb1d['id']){return _0x24bb1d;}else{return db[_0x810b('0x28')][_0x810b('0x39')]({'where':{'id':_settings[_0x810b('0x22')]}});}})['then'](function(_0x4c6e4d){if(!_0x4c6e4d){throw new db[(_0x810b('0x20'))][(_0x810b('0x25'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4c6e4d[_0x810b('0x29')]||!_0x4c6e4d[_0x810b('0x2a')]){throw new db['Sequelize'][(_0x810b('0x25'))]('Cloud\x20Provider\x20not\x20configured');}_0x2069a9=_0x4c6e4d;logger[_0x810b('0xc')](util[_0x810b('0xd')](_0x810b('0x2c'),_0x37d408['id']));return sentiment(_0x2069a9[_0x810b('0x29')],_0x2069a9[_0x810b('0x2a')],_0x1cc57d[_0x810b('0x23')],_0x37d408[_0x810b('0x1b')],_0x1cc57d[_0x810b('0x3a')]);})[_0x810b('0x11')](function(_0x204841){logger[_0x810b('0xc')](util[_0x810b('0xd')](_0x810b('0x2d'),_0x37d408['id']));return _0x37d408['update']({'sentiment':_0x204841[_0x810b('0x2e')],'sPositive':_0x204841['SentimentScore'][_0x810b('0x30')],'sNegative':_0x204841[_0x810b('0x2f')]['Negative'],'sMixed':_0x204841[_0x810b('0x2f')][_0x810b('0x32')],'sNeutral':_0x204841[_0x810b('0x2f')][_0x810b('0x3b')],'transcribeStatus':_0x810b('0x15')});})[_0x810b('0x11')](function(){logger[_0x810b('0xc')](util[_0x810b('0xd')](_0x810b('0x1e'),_0x37d408['id']));_0x16f727();});}})['catch'](function(_0x39c9b3){if(_0x39c9b3){if(!_0x39c9b3[_0x810b('0x3c')]||_0x39c9b3['name']!==_0x810b('0x3d')){logger[_0x810b('0x3e')](util[_0x810b('0xd')](_0x810b('0x3f'),_0x37d408['id']),util[_0x810b('0x40')](_0x39c9b3,{'showHidden':![],'depth':null}));}}_0x16f727();});});}function checkTranscribe(){var _0x2b9590;var _0x2ed181;var _0x427d91;return db[_0x810b('0x41')][_0x810b('0x42')]({'where':{'transcribeStatus':_0x810b('0x43')}})['then'](function(_0x533a6e){if(!_0x533a6e||!_0x533a6e[_0x810b('0x1a')]){throw new db['Sequelize']['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x2b9590=_0x533a6e;return db[_0x810b('0x44')][_0x810b('0x39')]({'where':{'id':0x1}});})[_0x810b('0x11')](function(_0xae2e2a){if(!_0xae2e2a){throw new db[(_0x810b('0x20'))][(_0x810b('0x25'))]('Settings\x20not\x20available');}_0x2ed181=_0xae2e2a;if(!_0x2ed181[_0x810b('0x6')]||!_0x2ed181[_0x810b('0x45')]||!_0x2ed181[_0x810b('0x10')]||!_0x2ed181[_0x810b('0x3a')]||!_0x2ed181[_0x810b('0x24')]){throw new db[(_0x810b('0x20'))][(_0x810b('0x25'))]('Transcribe\x20not\x20configured');}return db[_0x810b('0x28')][_0x810b('0x39')]({'where':{'id':_0x2ed181[_0x810b('0x45')]}});})[_0x810b('0x11')](function(_0x4903ac){if(!_0x4903ac){throw new db['Sequelize'][(_0x810b('0x25'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4903ac[_0x810b('0x29')]||!_0x4903ac[_0x810b('0x2a')]){throw new db[(_0x810b('0x20'))][(_0x810b('0x25'))](_0x810b('0x2b'));}_0x427d91=_0x4903ac;var _0x160d33=[];_0x2b9590[_0x810b('0x46')](function(_0x2d5b01){_0x160d33[_0x810b('0x47')](checkTranscribeJob(_0x2d5b01,_0x2ed181,_0x427d91));});return BPromise[_0x810b('0x48')](_0x160d33);})[_0x810b('0x49')](function(_0x41f244){if(_0x41f244){if(!_0x41f244[_0x810b('0x3c')]||_0x41f244[_0x810b('0x3c')]!==_0x810b('0x3d')){logger[_0x810b('0x3e')](util[_0x810b('0x40')](_0x41f244,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x81fa=['Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','substring','info','[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','Transcript','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','fileText','transcript','update','Sequelize','ValidationError','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','bucket','Sentiment','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting'];(function(_0x3a6eee,_0xb6077c){var _0x268e2c=function(_0x5d1ec0){while(--_0x5d1ec0){_0x3a6eee['push'](_0x3a6eee['shift']());}};_0x268e2c(++_0xb6077c);}(_0x81fa,0xdd));var _0xa81f=function(_0x17d0ee,_0x410179){_0x17d0ee=_0x17d0ee-0x0;var _0x429bc4=_0x81fa[_0x17d0ee];return _0x429bc4;};var _=require(_0xa81f('0x0'));var AWS=require(_0xa81f('0x1'));var rp=require('request-promise');var util=require(_0xa81f('0x2'));var BPromise=require(_0xa81f('0x3'));var db=require(_0xa81f('0x4'))['db'];var logger=require(_0xa81f('0x5'))('transcribe');function getTranscriptionJob(_0x1c7d2f,_0x202dbf,_0x466875,_0x3a5438){return new Promise(function(_0x1dc233,_0x158719){var _0x3ceca1=new AWS[(_0xa81f('0x6'))]({'accessKeyId':_0x202dbf,'secretAccessKey':_0x1c7d2f,'region':_0x466875});_0x3ceca1[_0xa81f('0x7')]({'TranscriptionJobName':_0x3a5438},function(_0x3447bb,_0x38e313){if(_0x3447bb){return _0x158719(_0x3447bb);}else{return _0x1dc233(_0x38e313);}});});}function sentiment(_0x442db2,_0x49ea5c,_0x4cbd21,_0x28b82f,_0x182ae7){return new Promise(function(_0x57db85,_0x47e978){var _0x5b8b3c=new AWS[(_0xa81f('0x8'))]({'accessKeyId':_0x49ea5c,'secretAccessKey':_0x442db2,'region':_0x4cbd21});_0x5b8b3c['detectSentiment']({'Text':_0x28b82f,'LanguageCode':_0x182ae7[_0xa81f('0x9')](0x0,0x2)},function(_0x5b71ae,_0x3e178b){if(_0x5b71ae){return _0x47e978(_0x5b71ae);}else{return _0x57db85(_0x3e178b);}});});}function checkTranscribeJob(_0x4e7eb8,_0x1aeead,_0x47df65){var _0x3487df;return new BPromise(function(_0x47419e,_0x315558){logger[_0xa81f('0xa')](util['format'](_0xa81f('0xb'),_0x4e7eb8['id'],_0x4e7eb8[_0xa81f('0xc')]));return getTranscriptionJob(_0x47df65[_0xa81f('0xd')],_0x47df65[_0xa81f('0xe')],_0x1aeead[_0xa81f('0xf')],_0x4e7eb8[_0xa81f('0xc')])[_0xa81f('0x10')](function(_0x4e41ba){logger[_0xa81f('0xa')](util['format'](_0xa81f('0x11'),_0x4e7eb8['id'],_0x4e7eb8[_0xa81f('0xc')],_0x4e41ba[_0xa81f('0x12')][_0xa81f('0x13')]));if(!_0x4e7eb8['fileText']){switch(_0x4e41ba[_0xa81f('0x12')][_0xa81f('0x13')]){case'COMPLETED':var _0x588d80={'transcribeStatus':_0x4e41ba['TranscriptionJob'][_0xa81f('0x13')],'fileUri':_0x4e41ba['TranscriptionJob'][_0xa81f('0x14')][_0xa81f('0x15')]};logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x17'),_0x4e7eb8['id']));return rp({'uri':_0x4e41ba[_0xa81f('0x12')][_0xa81f('0x14')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x4fa8ad){logger[_0xa81f('0xa')](util[_0xa81f('0x16')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4e7eb8['id']));if(_0x4fa8ad&&_0x4fa8ad[_0xa81f('0x18')]&&_0x4fa8ad[_0xa81f('0x18')]['transcripts']&&_0x4fa8ad['results'][_0xa81f('0x19')][_0xa81f('0x1a')]){_0x588d80[_0xa81f('0x1b')]='';for(var _0x45ccd6=0x0;_0x45ccd6<_0x4fa8ad[_0xa81f('0x18')]['transcripts'][_0xa81f('0x1a')];_0x45ccd6++){_0x588d80[_0xa81f('0x1b')]+=_0x4fa8ad[_0xa81f('0x18')][_0xa81f('0x19')][_0x45ccd6][_0xa81f('0x1c')]+'';}}return _0x4e7eb8[_0xa81f('0x1d')](_0x588d80);})[_0xa81f('0x10')](function(){logger[_0xa81f('0xa')](util[_0xa81f('0x16')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4e7eb8['id']));if(!_0x4e7eb8['tempSentiment']){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1aeead['sentiment']||!_0x1aeead[_0xa81f('0x20')]||!_0x1aeead[_0xa81f('0x21')]||!_0x1aeead[_0xa81f('0x22')]||!_0x1aeead['bucket']){throw new db['Sequelize']['ValidationError'](_0xa81f('0x23'));}if(!_0x588d80['fileText']){throw new Error(_0xa81f('0x24'));}if(_0x1aeead[_0xa81f('0x20')]===_0x47df65['id']){return _0x47df65;}else{return db[_0xa81f('0x25')][_0xa81f('0x26')]({'where':{'id':_settings[_0xa81f('0x20')]}});}})[_0xa81f('0x10')](function(_0x514450){if(!_0x514450){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x27'));}if(!_0x514450['data1']||!_0x514450[_0xa81f('0xe')]){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x28'));}_0x3487df=_0x514450;logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x29'),_0x4e7eb8['id']));return sentiment(_0x3487df[_0xa81f('0xd')],_0x3487df[_0xa81f('0xe')],_0x1aeead[_0xa81f('0x21')],_0x588d80[_0xa81f('0x1b')],_0x1aeead[_0xa81f('0x22')]);})['then'](function(_0x432bff){logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x2a'),_0x4e7eb8['id']));return _0x4e7eb8[_0xa81f('0x1d')]({'sentiment':_0x432bff['Sentiment'],'sPositive':_0x432bff[_0xa81f('0x2b')][_0xa81f('0x2c')],'sNegative':_0x432bff[_0xa81f('0x2b')][_0xa81f('0x2d')],'sMixed':_0x432bff['SentimentScore'][_0xa81f('0x2e')],'sNeutral':_0x432bff[_0xa81f('0x2b')][_0xa81f('0x2f')]});})[_0xa81f('0x10')](function(){logger['info'](util[_0xa81f('0x16')](_0xa81f('0x30'),_0x4e7eb8['id']));_0x47419e();});case _0xa81f('0x31'):return _0x4e7eb8[_0xa81f('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x4e41ba[_0xa81f('0x12')]['FailureReason']})[_0xa81f('0x10')](function(){logger['info'](util[_0xa81f('0x16')](_0xa81f('0x30'),_0x4e7eb8['id']));_0x47419e();});default:logger[_0xa81f('0xa')](util['format'](_0xa81f('0x32'),_0x4e7eb8['id']));break;}}else{return BPromise['resolve']()[_0xa81f('0x10')](function(){if(!_0x4e7eb8[_0xa81f('0x33')]){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x34'));}if(!_0x1aeead[_0xa81f('0x35')]||!_0x1aeead[_0xa81f('0x20')]||!_0x1aeead[_0xa81f('0x21')]||!_0x1aeead[_0xa81f('0x22')]||!_0x1aeead[_0xa81f('0x36')]){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))](_0xa81f('0x23'));}if(!_0x4e7eb8[_0xa81f('0x1b')]){throw new Error(_0xa81f('0x24'));}if(_0x1aeead[_0xa81f('0x20')]===_0x47df65['id']){return _0x47df65;}else{return db['CloudProvider'][_0xa81f('0x26')]({'where':{'id':_settings[_0xa81f('0x20')]}});}})[_0xa81f('0x10')](function(_0x2450d9){if(!_0x2450d9){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x27'));}if(!_0x2450d9[_0xa81f('0xd')]||!_0x2450d9[_0xa81f('0xe')]){throw new db[(_0xa81f('0x1e'))]['ValidationError'](_0xa81f('0x28'));}_0x3487df=_0x2450d9;logger['info'](util[_0xa81f('0x16')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4e7eb8['id']));return sentiment(_0x3487df['data1'],_0x3487df[_0xa81f('0xe')],_0x1aeead['sentimentRegion'],_0x4e7eb8[_0xa81f('0x1b')],_0x1aeead[_0xa81f('0x22')]);})[_0xa81f('0x10')](function(_0x430364){logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x2a'),_0x4e7eb8['id']));return _0x4e7eb8[_0xa81f('0x1d')]({'sentiment':_0x430364[_0xa81f('0x37')],'sPositive':_0x430364['SentimentScore'][_0xa81f('0x2c')],'sNegative':_0x430364[_0xa81f('0x2b')][_0xa81f('0x2d')],'sMixed':_0x430364['SentimentScore'][_0xa81f('0x2e')],'sNeutral':_0x430364[_0xa81f('0x2b')][_0xa81f('0x2f')],'transcribeStatus':_0xa81f('0x38')});})[_0xa81f('0x10')](function(){logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x30'),_0x4e7eb8['id']));_0x47419e();});}})[_0xa81f('0x39')](function(_0x3aae75){if(_0x3aae75){if(!_0x3aae75[_0xa81f('0x3a')]||_0x3aae75[_0xa81f('0x3a')]!==_0xa81f('0x3b')){logger[_0xa81f('0x3c')](util[_0xa81f('0x16')](_0xa81f('0x3d'),_0x4e7eb8['id']),util[_0xa81f('0x3e')](_0x3aae75,{'showHidden':![],'depth':null}));}}_0x47419e();});});}function checkTranscribe(){var _0x28dda4;var _0x2143d7;var _0x3f9182;return db['VoiceRecording'][_0xa81f('0x3f')]({'where':{'transcribeStatus':_0xa81f('0x40')}})['then'](function(_0x4f88ad){if(!_0x4f88ad||!_0x4f88ad[_0xa81f('0x1a')]){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))](_0xa81f('0x41'));}_0x28dda4=_0x4f88ad;return db[_0xa81f('0x42')][_0xa81f('0x26')]({'where':{'id':0x1}});})[_0xa81f('0x10')](function(_0x32ee66){if(!_0x32ee66){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x43'));}_0x2143d7=_0x32ee66;if(!_0x2143d7['transcribe']||!_0x2143d7[_0xa81f('0x44')]||!_0x2143d7['transcribeRegion']||!_0x2143d7[_0xa81f('0x22')]||!_0x2143d7[_0xa81f('0x36')]){throw new db[(_0xa81f('0x1e'))]['ValidationError'](_0xa81f('0x45'));}return db[_0xa81f('0x25')]['findOne']({'where':{'id':_0x2143d7[_0xa81f('0x44')]}});})[_0xa81f('0x10')](function(_0x111272){if(!_0x111272){throw new db[(_0xa81f('0x1e'))]['ValidationError'](_0xa81f('0x27'));}if(!_0x111272[_0xa81f('0xd')]||!_0x111272[_0xa81f('0xe')]){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))](_0xa81f('0x28'));}_0x3f9182=_0x111272;var _0x325be2=[];_0x28dda4[_0xa81f('0x46')](function(_0x21716b){_0x325be2[_0xa81f('0x47')](checkTranscribeJob(_0x21716b,_0x2143d7,_0x3f9182));});return BPromise['all'](_0x325be2);})[_0xa81f('0x39')](function(_0x234a35){if(_0x234a35){if(!_0x234a35[_0xa81f('0x3a')]||_0x234a35[_0xa81f('0x3a')]!=='SequelizeValidationError'){logger[_0xa81f('0x3c')](util[_0xa81f('0x3e')](_0x234a35,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 7bb1266..1dab8c1 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 _0x8968=['system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../mysqldb','../logger','redis','defaults','WhatsappInteraction','findAll','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x8968,0x75));var _0x8896=function(_0x5da398,_0x13a526){_0x5da398=_0x5da398-0x0;var _0x4db43a=_0x8968[_0x5da398];return _0x4db43a;};'use strict';var _=require(_0x8896('0x0'));var moment=require(_0x8896('0x1'));var Redis=require(_0x8896('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x8896('0x3'))['db'];var logger=require(_0x8896('0x4'))('schedule');config[_0x8896('0x5')]=_[_0x8896('0x6')](config[_0x8896('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8896('0x5')]));function closeInteractions(){var _0xae8553=[];return db[_0x8896('0x7')][_0x8896('0x8')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})[_0x8896('0x9')](function(_0x36b536){if(_0x36b536&&_0x36b536[_0x8896('0xa')]){_0xae8553=_[_0x8896('0xb')](_0x36b536||[],'id');logger[_0x8896('0xc')](_0x8896('0xd'),_0xae8553[_0x8896('0xe')]());return db[_0x8896('0x7')]['update']({'closeReason':_0x8896('0xf'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x8896('0x10')](_0x8896('0x11'))},{'where':{'id':_0xae8553}});}})[_0x8896('0x9')](function(){if(_0xae8553&&_0xae8553['length']){logger['info'](_0x8896('0x12'),_0xae8553[_0x8896('0xe')]());for(var _0x52d7cd=0x0;_0x52d7cd<_0xae8553['length'];_0x52d7cd++){io['emit']('whatsappInteraction:update',{'id':_0xae8553[_0x52d7cd],'closed':!![]});}}})['catch'](function(_0x351761){logger['error'](_0x8896('0x13'),_0x351761?util[_0x8896('0x14')](_0x351761,{'showHidden':![],'depth':null}):'');});}exports[_0x8896('0x15')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb838=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll','subtract','length','map','info'];(function(_0x2bf04b,_0x54cda4){var _0x55ca59=function(_0x323dff){while(--_0x323dff){_0x2bf04b['push'](_0x2bf04b['shift']());}};_0x55ca59(++_0x54cda4);}(_0xb838,0x14b));var _0x8b83=function(_0x19825b,_0x15a4f3){_0x19825b=_0x19825b-0x0;var _0xd79ee=_0xb838[_0x19825b];return _0xd79ee;};'use strict';var _=require(_0x8b83('0x0'));var moment=require(_0x8b83('0x1'));var Redis=require(_0x8b83('0x2'));var util=require(_0x8b83('0x3'));var config=require(_0x8b83('0x4'));var db=require(_0x8b83('0x5'))['db'];var logger=require(_0x8b83('0x6'))(_0x8b83('0x7'));config[_0x8b83('0x8')]=_[_0x8b83('0x9')](config[_0x8b83('0x8')],{'host':_0x8b83('0xa'),'port':0x18eb});var io=require(_0x8b83('0xb'))(new Redis(config['redis']));function closeInteractions(){var _0x72764b=[];return db['WhatsappInteraction'][_0x8b83('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8b83('0xd')](0x18,'hours')}}})['then'](function(_0x191d3f){if(_0x191d3f&&_0x191d3f[_0x8b83('0xe')]){_0x72764b=_[_0x8b83('0xf')](_0x191d3f||[],'id');logger[_0x8b83('0x10')](_0x8b83('0x11'),_0x72764b[_0x8b83('0x12')]());return db['WhatsappInteraction'][_0x8b83('0x13')]({'closeReason':_0x8b83('0x14'),'disposition':_0x8b83('0x15'),'closed':!![],'closedAt':moment()[_0x8b83('0x16')](_0x8b83('0x17'))},{'where':{'id':_0x72764b}});}})[_0x8b83('0x18')](function(){if(_0x72764b&&_0x72764b[_0x8b83('0xe')]){logger[_0x8b83('0x10')](_0x8b83('0x19'),_0x72764b[_0x8b83('0x12')]());for(var _0x4502d0=0x0;_0x4502d0<_0x72764b[_0x8b83('0xe')];_0x4502d0++){io[_0x8b83('0x1a')]('whatsappInteraction:update',{'id':_0x72764b[_0x4502d0],'closed':!![]});}}})[_0x8b83('0x1b')](function(_0x406517){logger['error'](_0x8b83('0x1c'),_0x406517?util['inspect'](_0x406517,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 97a0b65..59853c4 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb564=['then','bulkCreate','log','finished\x20populating','CmHopper','hopper1','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy'];(function(_0x4c373e,_0x2dde1f){var _0x147766=function(_0x1180ac){while(--_0x1180ac){_0x4c373e['push'](_0x4c373e['shift']());}};_0x147766(++_0x2dde1f);}(_0xb564,0x1b8));var _0x4b56=function(_0x205c4c,_0x1c7c35){_0x205c4c=_0x205c4c-0x0;var _0x426211=_0xb564[_0x205c4c];return _0x426211;};'use strict';var util=require(_0x4b56('0x0'));var db=require(_0x4b56('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x4b56('0x2')]({'id':i,'firstName':_0x4b56('0x3')+i,'lastName':_0x4b56('0x4')+i,'phone':0xf879fb460+i,'email':_0x4b56('0x5')+i+_0x4b56('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x4b56('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x4b56('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4b56('0x7')](),'updatedAt':Date[_0x4b56('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x4b56('0x2')]({'id':i,'firstName':_0x4b56('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x4b56('0x5')+i+_0x4b56('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x4b56('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x4b56('0x7')]()});}db[_0x4b56('0x8')][_0x4b56('0x9')]({'where':{}})[_0x4b56('0xa')](function(){return db[_0x4b56('0x8')][_0x4b56('0xb')](contacts);})[_0x4b56('0xa')](function(){console[_0x4b56('0xc')](_0x4b56('0xd'),'contacts1');return db[_0x4b56('0xe')]['destroy']({'where':{}});})[_0x4b56('0xa')](function(){return db[_0x4b56('0xe')]['bulkCreate'](hopper);})[_0x4b56('0xa')](function(){console[_0x4b56('0xc')](_0x4b56('0xd'),_0x4b56('0xf'));return db[_0x4b56('0x8')]['bulkCreate'](contacts2);})['then'](function(){console[_0x4b56('0xc')](_0x4b56('0xd'),_0x4b56('0x10'));return db[_0x4b56('0xe')]['bulkCreate'](hopper2);})[_0x4b56('0xa')](function(){console['log']('finished\x20populating','hopper2');})[_0x4b56('0x11')](function(_0x1b3aa0){console[_0x4b56('0xc')](_0x1b3aa0);}); \ No newline at end of file +var _0x3c48=['CmContact','destroy','bulkCreate','log','finished\x20populating','contacts1','CmHopper','then','hopper1','contacts2','hopper2','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo'];(function(_0x5ee367,_0x5aff0b){var _0x145dde=function(_0x1a23d0){while(--_0x1a23d0){_0x5ee367['push'](_0x5ee367['shift']());}};_0x145dde(++_0x5aff0b);}(_0x3c48,0xb6));var _0x83c4=function(_0xd9856,_0x197cdc){_0xd9856=_0xd9856-0x0;var _0x21f785=_0x3c48[_0xd9856];return _0x21f785;};'use strict';var util=require(_0x83c4('0x0'));var db=require(_0x83c4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x83c4('0x2')]({'id':i,'firstName':_0x83c4('0x3')+i,'lastName':_0x83c4('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x83c4('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x83c4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x83c4('0x6')](),'updatedAt':Date[_0x83c4('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x83c4('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x83c4('0x7')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x83c4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x83c4('0x6')]()});}db[_0x83c4('0x8')][_0x83c4('0x9')]({'where':{}})['then'](function(){return db[_0x83c4('0x8')][_0x83c4('0xa')](contacts);})['then'](function(){console[_0x83c4('0xb')](_0x83c4('0xc'),_0x83c4('0xd'));return db[_0x83c4('0xe')][_0x83c4('0x9')]({'where':{}});})[_0x83c4('0xf')](function(){return db['CmHopper'][_0x83c4('0xa')](hopper);})['then'](function(){console['log'](_0x83c4('0xc'),_0x83c4('0x10'));return db['CmContact'][_0x83c4('0xa')](contacts2);})[_0x83c4('0xf')](function(){console[_0x83c4('0xb')]('finished\x20populating',_0x83c4('0x11'));return db['CmHopper'][_0x83c4('0xa')](hopper2);})[_0x83c4('0xf')](function(){console[_0x83c4('0xb')](_0x83c4('0xc'),_0x83c4('0x12'));})['catch'](function(_0x2dcd41){console['log'](_0x2dcd41);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 13335b5..2e50054 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce48=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','all','ulaw','yes'];(function(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0xce48,0xe5));var _0x8ce4=function(_0x47bb19,_0x17a096){_0x47bb19=_0x47bb19-0x0;var _0x4ef57a=_0xce48[_0x47bb19];return _0x4ef57a;};'use strict';var util=require('util');var db=require(_0x8ce4('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x8ce4('0x1')](_0x8ce4('0x2'),_0x8ce4('0x3'),i),'fullname':util[_0x8ce4('0x1')](_0x8ce4('0x2'),_0x8ce4('0x3'),i),'email':util[_0x8ce4('0x1')](_0x8ce4('0x4'),_0x8ce4('0x3'),i),'role':_0x8ce4('0x3'),'password':_0x8ce4('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x8ce4('0x6'),'ws',_0x8ce4('0x7')],'disallow':[_0x8ce4('0x8')],'allow':[_0x8ce4('0x9')],'defaultuser':util[_0x8ce4('0x1')]('%s%s',_0x8ce4('0x3'),i),'encryption':'yes','avpf':_0x8ce4('0xa'),'force_avp':'yes','icesupport':_0x8ce4('0xa'),'dtlsenable':_0x8ce4('0xa'),'dtlsverify':'no','dtlscertfile':_0x8ce4('0xb'),'dtlsprivatekey':_0x8ce4('0xc'),'dtlssetup':_0x8ce4('0xd'),'callerid':util[_0x8ce4('0x1')]('\x22%s\x22\x20<%s>',util[_0x8ce4('0x1')](_0x8ce4('0x2'),_0x8ce4('0x3'),i),0xfa0+i)});}db[_0x8ce4('0xe')][_0x8ce4('0xf')](users)[_0x8ce4('0x10')](function(){console[_0x8ce4('0x11')](_0x8ce4('0x12'));})[_0x8ce4('0x13')](function(_0x54c5f3){console[_0x8ce4('0x11')](_0x54c5f3);}); \ No newline at end of file +var _0x8a9c=['udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','push','format','%s%s','agent','password','friend'];(function(_0x15748f,_0x269098){var _0x223188=function(_0x5b388f){while(--_0x5b388f){_0x15748f['push'](_0x15748f['shift']());}};_0x223188(++_0x269098);}(_0x8a9c,0x66));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc8a9('0x0')]({'name':util[_0xc8a9('0x1')](_0xc8a9('0x2'),_0xc8a9('0x3'),i),'fullname':util[_0xc8a9('0x1')](_0xc8a9('0x2'),'agent',i),'email':util['format']('%s%s@xcally.com',_0xc8a9('0x3'),i),'role':'agent','password':_0xc8a9('0x4'),'internal':0xfa0+i,'type':_0xc8a9('0x5'),'transport':[_0xc8a9('0x6'),'ws',_0xc8a9('0x7')],'disallow':['all'],'allow':[_0xc8a9('0x8')],'defaultuser':util[_0xc8a9('0x1')](_0xc8a9('0x2'),_0xc8a9('0x3'),i),'encryption':_0xc8a9('0x9'),'avpf':_0xc8a9('0x9'),'force_avp':_0xc8a9('0x9'),'icesupport':_0xc8a9('0x9'),'dtlsenable':_0xc8a9('0x9'),'dtlsverify':'no','dtlscertfile':_0xc8a9('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xc8a9('0xb'),'callerid':util['format'](_0xc8a9('0xc'),util[_0xc8a9('0x1')]('%s%s','agent',i),0xfa0+i)});}db[_0xc8a9('0xd')][_0xc8a9('0xe')](users)[_0xc8a9('0xf')](function(){console[_0xc8a9('0x10')](_0xc8a9('0x11'));})['catch'](function(_0x1b27cb){console['log'](_0x1b27cb);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 359d55c..3427983 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa848=['userProfileId','MailInteractions','FaxInteraction','SmsInteraction','user:%s','admin','voice:outbound','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','FaxQueue','Telephones','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','voice','fax','sms','mail','openchannel','trunk:%s','campaign:%s:%s','removeChatInteractions','removeMailInteractions','emit','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','leave','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','request','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','UserProfileResource','map','resourceId','where','Campaign','ivr','format','%s:queue:%s','length','handshake','query','find'];(function(_0x4e8b32,_0x2324f6){var _0x3fc6af=function(_0x2f5fa0){while(--_0x2f5fa0){_0x4e8b32['push'](_0x4e8b32['shift']());}};_0x3fc6af(++_0x2324f6);}(_0xa848,0x99));var _0x8a84=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa848[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x8a84('0x0'));var util=require(_0x8a84('0x1'));var BPromise=require(_0x8a84('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x8a84('0x3'));var queryQueues={'attributes':['id',_0x8a84('0x4')],'include':[{'as':_0x8a84('0x5'),'model':db[_0x8a84('0x6')],'attributes':['id',_0x8a84('0x4'),_0x8a84('0x7')],'raw':!![],'where':{'role':_0x8a84('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8a84('0x4')],'where':{'role':_0x8a84('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x8a84('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x8a84('0x4')],'where':{'role':_0x8a84('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8a84('0x4'),_0x8a84('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x325599,_0x423b07,_0x2294c8){return db['UserProfileSection'][_0x8a84('0xb')]({'where':{'name':_0x325599,'userProfileId':_0x423b07},'raw':!![]})[_0x8a84('0xc')](function(_0x398075){if(_0x398075){if(_0x398075[_0x8a84('0xd')]){switch(_0x325599){case _0x8a84('0xe'):case _0x8a84('0xf'):case _0x8a84('0x10'):case _0x8a84('0x11'):case _0x8a84('0x12'):case _0x8a84('0x13'):case _0x8a84('0x14'):return db[_0x2294c8][_0x8a84('0x15')](queryQueues);case'Telephones':return db[_0x2294c8][_0x8a84('0x15')](queryTelephones);case _0x8a84('0x16'):return db[_0x2294c8][_0x8a84('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x2294c8][_0x8a84('0x15')](queryCampaigns);}}else{return db[_0x8a84('0x17')][_0x8a84('0x15')]({'attributes':['resourceId'],'where':{'sectionId':_0x398075['id']},'raw':!![]})[_0x8a84('0xc')](function(_0x2558d9){if(_0x2558d9){var _0x50a338={'where':{'id':_[_0x8a84('0x18')](_0x2558d9,_0x8a84('0x19'))},'raw':!![]};switch(_0x2294c8){case _0x8a84('0x6'):_0x50a338[_0x8a84('0x1a')]['role']=_0x8a84('0x9');break;case _0x8a84('0x1b'):_0x50a338[_0x8a84('0x1a')][_0x8a84('0xa')]=_0x8a84('0x1c');break;}return db[_0x2294c8][_0x8a84('0x15')](_0x50a338);}else{return[];}});}}else{return[];}})['then'](function(_0x15a03b){return _0x15a03b;});}function joinOrLeaveQueues(_0x51d369,_0x17de64,_0x5aad2a,_0x1f7c17){_0x51d369[_0x17de64](util[_0x8a84('0x1d')](_0x8a84('0x1e'),_0x5aad2a,_0x1f7c17['name']));if(_0x1f7c17[_0x8a84('0x5')]){for(var _0x3c4a98=0x0;_0x3c4a98<_0x1f7c17[_0x8a84('0x5')][_0x8a84('0x1f')];_0x3c4a98+=0x1){_0x51d369[_0x17de64](util[_0x8a84('0x1d')]('user:%s',_0x1f7c17[_0x8a84('0x5')][_0x3c4a98][_0x8a84('0x4')]));}}}function joinOrLeave(_0x22f494,_0x370454,_0x1f01da){var _0x4bef10;if(_0x22f494[_0x8a84('0x20')][_0x8a84('0x21')]['id']){db[_0x8a84('0x6')][_0x8a84('0x22')]({'attributes':['id','name',_0x8a84('0x7'),_0x8a84('0x23')],'where':{'id':_0x22f494[_0x8a84('0x20')][_0x8a84('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x8a84('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x8a84('0x25')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8a84('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x8a84('0xc')](function(_0x3083c0){if(_0x3083c0){_0x4bef10=_0x3083c0;_0x22f494[_0x370454](util[_0x8a84('0x1d')](_0x8a84('0x27'),_0x3083c0[_0x8a84('0x4')]));var _0x5032a1=[];switch(_0x3083c0[_0x8a84('0x7')]){case _0x8a84('0x28'):_0x22f494[_0x370454]('voice:inbound');_0x22f494[_0x370454](_0x8a84('0x29'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x8a84('0x2a')];}_0x5032a1[_0x8a84('0x2b')](db[_0x8a84('0x2c')][_0x8a84('0x15')](queryQueues));_0x5032a1[_0x8a84('0x2b')](db[_0x8a84('0x2d')][_0x8a84('0x15')](queryQueues));_0x5032a1['push'](db['FaxQueue'][_0x8a84('0x15')](queryQueues));_0x5032a1['push'](db[_0x8a84('0x2e')][_0x8a84('0x15')](queryQueues));_0x5032a1[_0x8a84('0x2b')](db[_0x8a84('0x2f')]['findAll'](queryQueues));_0x5032a1[_0x8a84('0x2b')](db[_0x8a84('0x30')][_0x8a84('0x15')](queryQueues));_0x5032a1['push'](db[_0x8a84('0x31')][_0x8a84('0x15')](queryQueues));_0x5032a1[_0x8a84('0x2b')](db['User'][_0x8a84('0x15')](queryTelephones));_0x5032a1[_0x8a84('0x2b')](db[_0x8a84('0x32')][_0x8a84('0x15')](queryTrunks));_0x5032a1[_0x8a84('0x2b')](db[_0x8a84('0x1b')][_0x8a84('0x15')](queryCampaigns));_0x5032a1[_0x8a84('0x2b')](db[_0x8a84('0x6')][_0x8a84('0x15')](queryAgents));break;case _0x8a84('0x33'):_0x22f494[_0x370454](_0x8a84('0x34'));_0x22f494[_0x370454](_0x8a84('0x29'));_0x5032a1[_0x8a84('0x2b')](getAssociatedResources('VoiceQueues',_0x3083c0['userProfileId'],_0x8a84('0x2c')));_0x5032a1[_0x8a84('0x2b')](getAssociatedResources(_0x8a84('0xf'),_0x3083c0[_0x8a84('0x23')],_0x8a84('0x2d')));_0x5032a1['push'](getAssociatedResources(_0x8a84('0x10'),_0x3083c0[_0x8a84('0x23')],_0x8a84('0x35')));_0x5032a1[_0x8a84('0x2b')](getAssociatedResources(_0x8a84('0x11'),_0x3083c0[_0x8a84('0x23')],_0x8a84('0x2e')));_0x5032a1[_0x8a84('0x2b')](getAssociatedResources('MailQueues',_0x3083c0['userProfileId'],'MailQueue'));_0x5032a1[_0x8a84('0x2b')](getAssociatedResources(_0x8a84('0x13'),_0x3083c0['userProfileId'],_0x8a84('0x30')));_0x5032a1[_0x8a84('0x2b')](getAssociatedResources('WhatsappQueues',_0x3083c0[_0x8a84('0x23')],_0x8a84('0x31')));_0x5032a1[_0x8a84('0x2b')](getAssociatedResources(_0x8a84('0x36'),_0x3083c0[_0x8a84('0x23')],_0x8a84('0x6')));_0x5032a1[_0x8a84('0x2b')](getAssociatedResources('Trunks',_0x3083c0[_0x8a84('0x23')],'Trunk'));_0x5032a1[_0x8a84('0x2b')](getAssociatedResources('IvrCampaigns',_0x3083c0['userProfileId'],_0x8a84('0x1b')));_0x5032a1[_0x8a84('0x2b')](db[_0x8a84('0x6')]['findAll'](queryAgents));break;case _0x8a84('0x8'):_0x22f494[_0x370454](_0x8a84('0x34'));_0x22f494[_0x370454](_0x8a84('0x29'));_0x5032a1[_0x8a84('0x2b')](_0x3083c0['getVoiceQueues']({'attributes':['id',_0x8a84('0x4')]}));_0x5032a1[_0x8a84('0x2b')](_0x3083c0[_0x8a84('0x37')]({'attributes':['id',_0x8a84('0x4')]}));_0x5032a1[_0x8a84('0x2b')](_0x3083c0[_0x8a84('0x38')]({'attributes':['id',_0x8a84('0x4')]}));_0x5032a1[_0x8a84('0x2b')](_0x3083c0[_0x8a84('0x39')]({'attributes':['id','name']}));_0x5032a1['push'](_0x3083c0['getMailQueues']({'attributes':['id',_0x8a84('0x4')]}));_0x5032a1[_0x8a84('0x2b')](_0x3083c0[_0x8a84('0x3a')]({'attributes':['id','name']}));_0x5032a1[_0x8a84('0x2b')](_0x3083c0['getWhatsappQueues']({'attributes':['id',_0x8a84('0x4')]}));break;}return BPromise[_0x8a84('0x3b')](_0x5032a1);}})['then'](function(_0x1216c3){if(_0x1216c3&&_0x1216c3[_0x8a84('0x1f')]){for(var _0x5b75db=0x0;_0x5b75db<_0x1216c3[_0x8a84('0x1f')];_0x5b75db+=0x1){for(var _0x2e3e89=0x0;_0x2e3e89<_0x1216c3[_0x5b75db][_0x8a84('0x1f')];_0x2e3e89+=0x1){switch(_0x5b75db){case 0x0:joinOrLeaveQueues(_0x22f494,_0x370454,_0x8a84('0x3c'),_0x1216c3[_0x5b75db][_0x2e3e89]);break;case 0x1:joinOrLeaveQueues(_0x22f494,_0x370454,'chat',_0x1216c3[_0x5b75db][_0x2e3e89]);break;case 0x2:joinOrLeaveQueues(_0x22f494,_0x370454,_0x8a84('0x3d'),_0x1216c3[_0x5b75db][_0x2e3e89]);break;case 0x3:joinOrLeaveQueues(_0x22f494,_0x370454,_0x8a84('0x3e'),_0x1216c3[_0x5b75db][_0x2e3e89]);break;case 0x4:joinOrLeaveQueues(_0x22f494,_0x370454,_0x8a84('0x3f'),_0x1216c3[_0x5b75db][_0x2e3e89]);break;case 0x5:joinOrLeaveQueues(_0x22f494,_0x370454,_0x8a84('0x40'),_0x1216c3[_0x5b75db][_0x2e3e89]);break;case 0x6:joinOrLeaveQueues(_0x22f494,_0x370454,'whatsapp',_0x1216c3[_0x5b75db][_0x2e3e89]);break;case 0x7:if(_0x4bef10['role']!=='agent')_0x22f494[_0x370454](util['format']('telephone:%s',_0x1216c3[_0x5b75db][_0x2e3e89][_0x8a84('0x4')]));break;case 0x8:if(_0x4bef10[_0x8a84('0x7')]!==_0x8a84('0x8'))_0x22f494[_0x370454](util[_0x8a84('0x1d')](_0x8a84('0x41'),_0x1216c3[_0x5b75db][_0x2e3e89]['name']));break;case 0x9:if(_0x4bef10[_0x8a84('0x7')]!=='agent')_0x22f494[_0x370454](util[_0x8a84('0x1d')](_0x8a84('0x42'),_0x1216c3[_0x5b75db][_0x2e3e89][_0x8a84('0xa')],_0x1216c3[_0x5b75db][_0x2e3e89]['name']));break;case 0xa:_0x22f494[_0x370454](util[_0x8a84('0x1d')](_0x8a84('0x27'),_0x1216c3[_0x5b75db][_0x2e3e89][_0x8a84('0x4')]));break;}}}}})[_0x8a84('0xc')](function(){if(_0x370454==='leave'){var _0x957707=_['map'](_0x4bef10['ChatInteractions'],'id');return _0x4bef10[_0x8a84('0x43')](_0x957707)['then'](function(){for(var _0x2ccae1=0x0;_0x2ccae1<_0x957707[_0x8a84('0x1f')];_0x2ccae1+=0x1){_0x1f01da['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x957707[_0x2ccae1]),'UserId':Number(_0x4bef10['id'])});}});}})['then'](function(){if(_0x370454==='leave'){var _0x1d426c=_['map'](_0x4bef10[_0x8a84('0x24')],'id');return _0x4bef10[_0x8a84('0x44')](_0x1d426c)[_0x8a84('0xc')](function(){for(var _0x22675e=0x0;_0x22675e<_0x1d426c[_0x8a84('0x1f')];_0x22675e+=0x1){_0x1f01da[_0x8a84('0x45')](_0x8a84('0x46'),{'MailInteractionId':Number(_0x1d426c[_0x22675e]),'UserId':Number(_0x4bef10['id'])});}});}})[_0x8a84('0xc')](function(){if(_0x370454==='leave'){var _0x364671=_['map'](_0x4bef10[_0x8a84('0x47')],'id');return _0x4bef10[_0x8a84('0x48')](_0x364671)['then'](function(){for(var _0x330057=0x0;_0x330057<_0x364671[_0x8a84('0x1f')];_0x330057+=0x1){_0x1f01da['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x364671[_0x330057]),'UserId':Number(_0x4bef10['id'])});}});}})[_0x8a84('0xc')](function(){if(_0x370454===_0x8a84('0x49')){var _0xdaf79c=_['map'](_0x4bef10[_0x8a84('0x4a')],'id');return _0x4bef10[_0x8a84('0x4b')](_0xdaf79c)[_0x8a84('0xc')](function(){for(var _0x27a2e5=0x0;_0x27a2e5<_0xdaf79c[_0x8a84('0x1f')];_0x27a2e5+=0x1){_0x1f01da[_0x8a84('0x45')](_0x8a84('0x4c'),{'SmsInteractionId':Number(_0xdaf79c[_0x27a2e5]),'UserId':Number(_0x4bef10['id'])});}});}})[_0x8a84('0xc')](function(){if(_0x370454===_0x8a84('0x49')){var _0x42d17c=_[_0x8a84('0x18')](_0x4bef10['OpenchannelInteractions'],'id');return _0x4bef10[_0x8a84('0x4d')](_0x42d17c)[_0x8a84('0xc')](function(){for(var _0x17fdff=0x0;_0x17fdff<_0x42d17c[_0x8a84('0x1f')];_0x17fdff+=0x1){_0x1f01da[_0x8a84('0x45')](_0x8a84('0x4e'),{'OpenchannelInteractionId':Number(_0x42d17c[_0x17fdff]),'UserId':Number(_0x4bef10['id'])});}});}})['then'](function(){if(_0x370454===_0x8a84('0x49')){var _0x26269a=_[_0x8a84('0x18')](_0x4bef10[_0x8a84('0x4f')],'id');return _0x4bef10[_0x8a84('0x50')](_0x26269a)[_0x8a84('0xc')](function(){for(var _0x305377=0x0;_0x305377<_0x26269a[_0x8a84('0x1f')];_0x305377+=0x1){_0x1f01da[_0x8a84('0x45')](_0x8a84('0x51'),{'WhatsappInteractionId':Number(_0x26269a[_0x305377]),'UserId':Number(_0x4bef10['id'])});}});}})[_0x8a84('0x52')](function(_0x3a9cdd){_0x22f494[_0x8a84('0x53')](_0x3a9cdd);});}}function onDisconnect(_0x54080d,_0x2f10d5){joinOrLeave(_0x54080d,'leave',_0x2f10d5);}function onConnect(_0x40134c){joinOrLeave(_0x40134c,_0x8a84('0x54'));}exports['default']=function(_0x1c022c){_0x1c022c['on'](_0x8a84('0x55'),function(_0x55a8d8){_0x55a8d8[_0x8a84('0x56')](0x0);_0x55a8d8['address']=_0x55a8d8[_0x8a84('0x57')]['connection'][_0x8a84('0x58')]+':'+_0x55a8d8[_0x8a84('0x57')][_0x8a84('0x55')][_0x8a84('0x59')];_0x55a8d8['connectedAt']=new Date();_0x55a8d8[_0x8a84('0x53')]=function(_0x4a3bcc){console[_0x8a84('0x53')](_0x8a84('0x5a')+_0x55a8d8[_0x8a84('0x5b')][_0x8a84('0x4')]+'['+_0x55a8d8['address']+']',_0x4a3bcc);};_0x55a8d8['on'](_0x8a84('0x5c'),function(){onDisconnect(_0x55a8d8,_0x1c022c);_0x55a8d8[_0x8a84('0x53')](_0x8a84('0x5d'));});onConnect(_0x55a8d8);_0x55a8d8[_0x8a84('0x53')]('CONNECTED');});}; \ No newline at end of file +var _0x6dc0=['User','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','findAll','UserProfileResource','then','map','where','Campaign','%s:queue:%s','length','format','user:%s','handshake','ChatInteractions','MailInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','userProfileId','FaxQueues','FaxQueue','MailQueue','OpenchannelQueues','WhatsappQueues','Telephones','Trunks','IvrCampaigns','voice:inbound','voice:outbound','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','mail','openchannel','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','address','request','remoteAddress','remotePort','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','./environment','name','Agents'];(function(_0x5012a0,_0x25c11b){var _0x37839d=function(_0x3a9f65){while(--_0x3a9f65){_0x5012a0['push'](_0x5012a0['shift']());}};_0x37839d(++_0x25c11b);}(_0x6dc0,0xb6));var _0x06dc=function(_0x1e6f85,_0x535624){_0x1e6f85=_0x1e6f85-0x0;var _0x54bb18=_0x6dc0[_0x1e6f85];return _0x54bb18;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var BPromise=require(_0x06dc('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x06dc('0x3'));var queryQueues={'attributes':['id',_0x06dc('0x4')],'include':[{'as':_0x06dc('0x5'),'model':db[_0x06dc('0x6')],'attributes':['id','name',_0x06dc('0x7')],'raw':!![],'where':{'role':_0x06dc('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x06dc('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x06dc('0x4')],'where':{'role':_0x06dc('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x06dc('0x4'),_0x06dc('0xa')],'where':{'type':_0x06dc('0xb')}};function getAssociatedResources(_0x4dcdce,_0x57cde3,_0x480f30){return db[_0x06dc('0xc')][_0x06dc('0xd')]({'where':{'name':_0x4dcdce,'userProfileId':_0x57cde3},'raw':!![]})['then'](function(_0x45693d){if(_0x45693d){if(_0x45693d[_0x06dc('0xe')]){switch(_0x4dcdce){case _0x06dc('0xf'):case _0x06dc('0x10'):case'FaxQueues':case _0x06dc('0x11'):case _0x06dc('0x12'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x480f30]['findAll'](queryQueues);case'Telephones':return db[_0x480f30][_0x06dc('0x13')](queryTelephones);case'Trunks':return db[_0x480f30]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x480f30][_0x06dc('0x13')](queryCampaigns);}}else{return db[_0x06dc('0x14')][_0x06dc('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x45693d['id']},'raw':!![]})[_0x06dc('0x15')](function(_0x1d92c2){if(_0x1d92c2){var _0x145a07={'where':{'id':_[_0x06dc('0x16')](_0x1d92c2,'resourceId')},'raw':!![]};switch(_0x480f30){case _0x06dc('0x6'):_0x145a07[_0x06dc('0x17')][_0x06dc('0x7')]=_0x06dc('0x9');break;case _0x06dc('0x18'):_0x145a07['where'][_0x06dc('0xa')]=_0x06dc('0xb');break;}return db[_0x480f30][_0x06dc('0x13')](_0x145a07);}else{return[];}});}}else{return[];}})[_0x06dc('0x15')](function(_0x29dcd9){return _0x29dcd9;});}function joinOrLeaveQueues(_0x152ed2,_0x598b72,_0x55c932,_0x227623){_0x152ed2[_0x598b72](util['format'](_0x06dc('0x19'),_0x55c932,_0x227623['name']));if(_0x227623[_0x06dc('0x5')]){for(var _0x369c60=0x0;_0x369c60<_0x227623[_0x06dc('0x5')][_0x06dc('0x1a')];_0x369c60+=0x1){_0x152ed2[_0x598b72](util[_0x06dc('0x1b')](_0x06dc('0x1c'),_0x227623['Agents'][_0x369c60]['name']));}}}function joinOrLeave(_0x755ae2,_0x426260,_0x56c345){var _0x95dab2;if(_0x755ae2['handshake']['query']['id']){db['User']['find']({'attributes':['id','name',_0x06dc('0x7'),'userProfileId'],'where':{'id':_0x755ae2[_0x06dc('0x1d')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x06dc('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0x06dc('0x1f')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x06dc('0x20'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x06dc('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x06dc('0x22')],'as':_0x06dc('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x06dc('0x24')],'as':_0x06dc('0x25'),'attributes':['id'],'raw':!![]}]})[_0x06dc('0x15')](function(_0x164554){if(_0x164554){_0x95dab2=_0x164554;_0x755ae2[_0x426260](util[_0x06dc('0x1b')](_0x06dc('0x1c'),_0x164554[_0x06dc('0x4')]));var _0xad5ae9=[];switch(_0x164554[_0x06dc('0x7')]){case _0x06dc('0x26'):_0x755ae2[_0x426260]('voice:inbound');_0x755ae2[_0x426260]('voice:outbound');if(queryQueues[_0x06dc('0x27')](_0x06dc('0x28'))){delete queryQueues[_0x06dc('0x28')];}_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2a')][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2b')][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db['FaxQueue'][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2c')][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db['MailQueue'][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2d')]['findAll'](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2e')]['findAll'](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x6')]['findAll'](queryTelephones));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2f')][_0x06dc('0x13')](queryTrunks));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x18')][_0x06dc('0x13')](queryCampaigns));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x6')][_0x06dc('0x13')](queryAgents));break;case _0x06dc('0x30'):_0x755ae2[_0x426260]('voice:inbound');_0x755ae2[_0x426260]('voice:outbound');_0xad5ae9['push'](getAssociatedResources(_0x06dc('0xf'),_0x164554[_0x06dc('0x31')],_0x06dc('0x2a')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources('ChatQueues',_0x164554['userProfileId'],_0x06dc('0x2b')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x32'),_0x164554[_0x06dc('0x31')],_0x06dc('0x33')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x11'),_0x164554[_0x06dc('0x31')],_0x06dc('0x2c')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x12'),_0x164554[_0x06dc('0x31')],_0x06dc('0x34')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x35'),_0x164554[_0x06dc('0x31')],_0x06dc('0x2d')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x36'),_0x164554[_0x06dc('0x31')],'WhatsappQueue'));_0xad5ae9['push'](getAssociatedResources(_0x06dc('0x37'),_0x164554[_0x06dc('0x31')],_0x06dc('0x6')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x38'),_0x164554['userProfileId'],_0x06dc('0x2f')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x39'),_0x164554['userProfileId'],_0x06dc('0x18')));_0xad5ae9[_0x06dc('0x29')](db['User'][_0x06dc('0x13')](queryAgents));break;case _0x06dc('0x8'):_0x755ae2[_0x426260](_0x06dc('0x3a'));_0x755ae2[_0x426260](_0x06dc('0x3b'));_0xad5ae9['push'](_0x164554['getVoiceQueues']({'attributes':['id',_0x06dc('0x4')]}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x3c')]({'attributes':['id','name']}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x3d')]({'attributes':['id',_0x06dc('0x4')]}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x3e')]({'attributes':['id','name']}));_0xad5ae9[_0x06dc('0x29')](_0x164554['getMailQueues']({'attributes':['id','name']}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x3f')]({'attributes':['id',_0x06dc('0x4')]}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0x06dc('0x41')](_0xad5ae9);}})[_0x06dc('0x15')](function(_0x247199){if(_0x247199&&_0x247199[_0x06dc('0x1a')]){for(var _0x19d512=0x0;_0x19d512<_0x247199[_0x06dc('0x1a')];_0x19d512+=0x1){for(var _0x10fad6=0x0;_0x10fad6<_0x247199[_0x19d512][_0x06dc('0x1a')];_0x10fad6+=0x1){switch(_0x19d512){case 0x0:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x42'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x1:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x43'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x2:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x44'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x3:joinOrLeaveQueues(_0x755ae2,_0x426260,'sms',_0x247199[_0x19d512][_0x10fad6]);break;case 0x4:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x45'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x5:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x46'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x6:joinOrLeaveQueues(_0x755ae2,_0x426260,'whatsapp',_0x247199[_0x19d512][_0x10fad6]);break;case 0x7:if(_0x95dab2[_0x06dc('0x7')]!==_0x06dc('0x8'))_0x755ae2[_0x426260](util[_0x06dc('0x1b')]('telephone:%s',_0x247199[_0x19d512][_0x10fad6][_0x06dc('0x4')]));break;case 0x8:if(_0x95dab2[_0x06dc('0x7')]!=='agent')_0x755ae2[_0x426260](util['format']('trunk:%s',_0x247199[_0x19d512][_0x10fad6][_0x06dc('0x4')]));break;case 0x9:if(_0x95dab2[_0x06dc('0x7')]!==_0x06dc('0x8'))_0x755ae2[_0x426260](util['format']('campaign:%s:%s',_0x247199[_0x19d512][_0x10fad6][_0x06dc('0xa')],_0x247199[_0x19d512][_0x10fad6][_0x06dc('0x4')]));break;case 0xa:_0x755ae2[_0x426260](util[_0x06dc('0x1b')](_0x06dc('0x1c'),_0x247199[_0x19d512][_0x10fad6][_0x06dc('0x4')]));break;}}}}})['then'](function(){if(_0x426260===_0x06dc('0x47')){var _0x1a2048=_[_0x06dc('0x16')](_0x95dab2['ChatInteractions'],'id');return _0x95dab2[_0x06dc('0x48')](_0x1a2048)[_0x06dc('0x15')](function(){for(var _0x3ab522=0x0;_0x3ab522<_0x1a2048[_0x06dc('0x1a')];_0x3ab522+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x4a'),{'ChatInteractionId':Number(_0x1a2048[_0x3ab522]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260===_0x06dc('0x47')){var _0x53fee6=_[_0x06dc('0x16')](_0x95dab2['MailInteractions'],'id');return _0x95dab2[_0x06dc('0x4b')](_0x53fee6)['then'](function(){for(var _0x2f0bd4=0x0;_0x2f0bd4<_0x53fee6['length'];_0x2f0bd4+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x4c'),{'MailInteractionId':Number(_0x53fee6[_0x2f0bd4]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260===_0x06dc('0x47')){var _0x1b1e33=_[_0x06dc('0x16')](_0x95dab2[_0x06dc('0x20')],'id');return _0x95dab2['removeFaxInteractions'](_0x1b1e33)[_0x06dc('0x15')](function(){for(var _0x21ae2f=0x0;_0x21ae2f<_0x1b1e33[_0x06dc('0x1a')];_0x21ae2f+=0x1){_0x56c345['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1b1e33[_0x21ae2f]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260===_0x06dc('0x47')){var _0x42fcbf=_['map'](_0x95dab2[_0x06dc('0x21')],'id');return _0x95dab2[_0x06dc('0x4d')](_0x42fcbf)[_0x06dc('0x15')](function(){for(var _0x227758=0x0;_0x227758<_0x42fcbf['length'];_0x227758+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x4e'),{'SmsInteractionId':Number(_0x42fcbf[_0x227758]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260===_0x06dc('0x47')){var _0x304042=_[_0x06dc('0x16')](_0x95dab2[_0x06dc('0x23')],'id');return _0x95dab2[_0x06dc('0x4f')](_0x304042)[_0x06dc('0x15')](function(){for(var _0x416e3d=0x0;_0x416e3d<_0x304042['length'];_0x416e3d+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x50'),{'OpenchannelInteractionId':Number(_0x304042[_0x416e3d]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260==='leave'){var _0x5336d2=_[_0x06dc('0x16')](_0x95dab2[_0x06dc('0x25')],'id');return _0x95dab2[_0x06dc('0x51')](_0x5336d2)[_0x06dc('0x15')](function(){for(var _0x122aa3=0x0;_0x122aa3<_0x5336d2[_0x06dc('0x1a')];_0x122aa3+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x52'),{'WhatsappInteractionId':Number(_0x5336d2[_0x122aa3]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x53')](function(_0x45cf22){_0x755ae2[_0x06dc('0x54')](_0x45cf22);});}}function onDisconnect(_0x2fddb8,_0x43a71d){joinOrLeave(_0x2fddb8,'leave',_0x43a71d);}function onConnect(_0x4c1aff){joinOrLeave(_0x4c1aff,_0x06dc('0x55'));}exports['default']=function(_0x282751){_0x282751['on'](_0x06dc('0x56'),function(_0x44fe6d){_0x44fe6d['setMaxListeners'](0x0);_0x44fe6d[_0x06dc('0x57')]=_0x44fe6d[_0x06dc('0x58')][_0x06dc('0x56')][_0x06dc('0x59')]+':'+_0x44fe6d[_0x06dc('0x58')][_0x06dc('0x56')][_0x06dc('0x5a')];_0x44fe6d['connectedAt']=new Date();_0x44fe6d[_0x06dc('0x54')]=function(_0x5bf0e6){console[_0x06dc('0x54')]('SocketIO\x20'+_0x44fe6d[_0x06dc('0x5b')][_0x06dc('0x4')]+'['+_0x44fe6d['address']+']',_0x5bf0e6);};_0x44fe6d['on'](_0x06dc('0x5c'),function(){onDisconnect(_0x44fe6d,_0x282751);_0x44fe6d['log'](_0x06dc('0x5d'));});onConnect(_0x44fe6d);_0x44fe6d['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index b7f994d..da5f13a 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 _0x1c05=['hasOwnProperty','model','hook','callback','util','jayson/promise','../logger','triggers','lodash','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','substatus','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','error','code','Trigger,\x20%s','catch','channel','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','find','UserId','name','fullname','email','incomingmessage','outgoingmessage','get','motionChannel','query','then','contact','changed','closed','event','interface','format','default','length'];(function(_0x366526,_0x5b9e12){var _0x574b02=function(_0x3a9e26){while(--_0x3a9e26){_0x366526['push'](_0x366526['shift']());}};_0x574b02(++_0x5b9e12);}(_0x1c05,0xcd));var _0x51c0=function(_0x54872d,_0x179814){_0x54872d=_0x54872d-0x0;var _0x44ed03=_0x1c05[_0x54872d];return _0x44ed03;};'use strict';var util=require(_0x51c0('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x51c0('0x1'));var logger=require(_0x51c0('0x2'))(_0x51c0('0x3'));var _=require(_0x51c0('0x4'));var client=jayson[_0x51c0('0x5')][_0x51c0('0x6')]({'port':0x232a});var triggers=[{'channel':_0x51c0('0x7'),'model':_0x51c0('0x8'),'event':_0x51c0('0x9'),'condition':_0x51c0('0xa'),'callback':afterCreate},{'channel':_0x51c0('0x7'),'model':'ChatInteraction','event':_0x51c0('0xb'),'condition':_0x51c0('0xc'),'callback':afterUpdate},{'channel':_0x51c0('0x7'),'model':_0x51c0('0xd'),'event':_0x51c0('0x9'),'condition':_0x51c0('0xe'),'callback':afterCreateMessage},{'channel':_0x51c0('0xf'),'model':_0x51c0('0x10'),'event':_0x51c0('0x9'),'condition':_0x51c0('0xa'),'callback':afterCreate},{'channel':_0x51c0('0xf'),'model':_0x51c0('0x10'),'event':_0x51c0('0xb'),'condition':_0x51c0('0xc'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0x51c0('0x9'),'condition':_0x51c0('0xe'),'callback':afterCreateMessage},{'channel':_0x51c0('0x11'),'model':_0x51c0('0x12'),'event':'afterCreate','condition':_0x51c0('0xa'),'callback':afterCreate},{'channel':_0x51c0('0x11'),'model':_0x51c0('0x12'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x51c0('0x11'),'model':_0x51c0('0x13'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':'afterCreate','condition':_0x51c0('0xa'),'callback':afterCreate},{'channel':_0x51c0('0x14'),'model':_0x51c0('0x15'),'event':_0x51c0('0xb'),'condition':_0x51c0('0xc'),'callback':afterUpdate},{'channel':_0x51c0('0x14'),'model':_0x51c0('0x16'),'event':_0x51c0('0x9'),'condition':_0x51c0('0xe'),'callback':afterCreateMessage},{'channel':_0x51c0('0x17'),'model':'MailInteraction','event':_0x51c0('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x51c0('0x17'),'model':'MailInteraction','event':'afterUpdate','condition':_0x51c0('0xc'),'callback':afterUpdate},{'channel':_0x51c0('0x17'),'model':_0x51c0('0x18'),'event':_0x51c0('0x19'),'condition':_0x51c0('0x19'),'callback':afterUpdate},{'channel':_0x51c0('0x17'),'model':_0x51c0('0x1a'),'event':_0x51c0('0x9'),'condition':_0x51c0('0xe'),'callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0x51c0('0x9'),'condition':_0x51c0('0xa'),'callback':afterCreate},{'channel':_0x51c0('0x1b'),'model':_0x51c0('0x1c'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x51c0('0x1b'),'model':_0x51c0('0x1d'),'event':_0x51c0('0x9'),'condition':_0x51c0('0xe'),'callback':afterCreateMessage}];function request(_0x34c5ad){return client[_0x51c0('0x1e')](_0x51c0('0x1f'),_0x34c5ad)['then'](function(_0x216c3b){logger['info']('Trigger,\x20%s',_0x51c0('0x1f'),_0x216c3b);if(_0x216c3b[_0x51c0('0x20')]){if(_0x216c3b['error'][_0x51c0('0x21')]===0x1f4){logger[_0x51c0('0x20')](_0x51c0('0x22'),_0x51c0('0x1f'),_0x216c3b[_0x51c0('0x20')]);}}})[_0x51c0('0x23')](function(_0x4e6398){logger['error'](_0x51c0('0x22'),_0x51c0('0x1f'),_0x4e6398);});}function afterCreateMessage(_0x1864a2,_0x3b15ec){return function(_0x13d80f,_0x54e286){_0x13d80f=_0x13d80f['get']({'plain':!![]});_0x13d80f[_0x51c0('0x24')]=_0x1864a2;_0x13d80f['motionChannel']=_0x1864a2;_0x13d80f['event']=_0x13d80f['direction'];var _0x2b7e95=_0x51c0('0x25')+_0x13d80f[_0x51c0('0x26')];return db[_0x51c0('0x27')]['query'](_0x2b7e95,{'type':db[_0x51c0('0x28')][_0x51c0('0x29')][_0x51c0('0x2a')],'raw':!![]})['then'](function(_0x427579){return _0x427579;})['then'](function(_0x25e888){if(_0x25e888){_0x13d80f['contact']=_0x25e888[0x0];}if(_0x13d80f['UserId']){return db[_0x51c0('0x2b')][_0x51c0('0x2c')]({'where':{'id':_0x13d80f[_0x51c0('0x2d')]},'attributes':['id',_0x51c0('0x2e'),_0x51c0('0x2f'),_0x51c0('0x30'),'internal'],'raw':!![]})['then'](function(_0x27f494){_0x13d80f['interface']=util['format']('SIP/%s',_0x27f494[_0x51c0('0x2e')]);_0x13d80f[_0x51c0('0x24')]=_0x1864a2;_0x13d80f['agent']=_0x27f494;return request({'event':_0x51c0('0x31'),'message':_0x13d80f});})[_0x51c0('0x23')](function(_0x1524d8){console[_0x51c0('0x20')](_0x1524d8);});}else{return request({'event':_0x51c0('0x32'),'message':_0x13d80f});}});};}function afterCreate(_0x18e3b3,_0x206991){return function(_0x25e22f,_0x1943f1){_0x25e22f=_0x25e22f[_0x51c0('0x33')]({'plain':!![]});_0x25e22f[_0x51c0('0x24')]=_0x18e3b3;_0x25e22f[_0x51c0('0x34')]=_0x18e3b3;_0x25e22f['event']='opened';var _0x3b5e72=_0x51c0('0x25')+_0x25e22f[_0x51c0('0x26')];return db[_0x51c0('0x27')][_0x51c0('0x35')](_0x3b5e72,{'type':db[_0x51c0('0x28')]['QueryTypes'][_0x51c0('0x2a')],'raw':!![]})[_0x51c0('0x36')](function(_0x3c672b){return _0x3c672b;})[_0x51c0('0x36')](function(_0x540998){if(_0x540998){_0x25e22f[_0x51c0('0x37')]=_0x540998[0x0];}return request({'event':_0x206991,'message':_0x25e22f});});};}function afterUpdate(_0x5a6fc6,_0x1f26e3){return function(_0x181d81,_0x40c81f){if(_0x181d81[_0x51c0('0x38')](_0x51c0('0x39'))&&_0x181d81[_0x51c0('0x39')]){_0x181d81=_0x181d81['get']({'plain':!![]});_0x181d81[_0x51c0('0x24')]=_0x5a6fc6;_0x181d81[_0x51c0('0x34')]=_0x5a6fc6;_0x181d81[_0x51c0('0x3a')]='closed';var _0x542730=_0x51c0('0x25')+_0x181d81[_0x51c0('0x26')];return db[_0x51c0('0x27')][_0x51c0('0x35')](_0x542730,{'type':db['Sequelize'][_0x51c0('0x29')][_0x51c0('0x2a')],'raw':!![]})[_0x51c0('0x36')](function(_0x1a32cd){return _0x1a32cd;})['then'](function(_0xf48bd5){if(_0xf48bd5){_0x181d81[_0x51c0('0x37')]=_0xf48bd5[0x0];}if(_0x181d81[_0x51c0('0x2d')]){return db['User'][_0x51c0('0x2c')]({'where':{'id':_0x181d81[_0x51c0('0x2d')]},'attributes':['id',_0x51c0('0x2e'),_0x51c0('0x2f'),_0x51c0('0x30'),'internal'],'raw':!![]})[_0x51c0('0x36')](function(_0x3138d8){_0x181d81[_0x51c0('0x3b')]=util['format']('SIP/%s',_0x3138d8['name']);_0x181d81['agent']=_0x3138d8;return request({'event':_0x1f26e3,'message':_0x181d81});})['catch'](function(_0x5a36f1){console[_0x51c0('0x20')](_0x5a36f1);});}else{return request({'event':_0x1f26e3,'message':_0x181d81});}});}else if(_0x181d81[_0x51c0('0x38')](_0x51c0('0x19'))){_0x181d81=_0x181d81[_0x51c0('0x33')]({'plain':!![]});_0x181d81['channel']=_0x5a6fc6;_0x181d81[_0x51c0('0x3a')]=_0x51c0('0x19');var _0x542730='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x181d81[_0x51c0('0x26')];return db[_0x51c0('0x27')][_0x51c0('0x35')](_0x542730,{'type':db['Sequelize'][_0x51c0('0x29')][_0x51c0('0x2a')],'raw':!![]})[_0x51c0('0x36')](function(_0x3d8ee6){return _0x3d8ee6;})[_0x51c0('0x36')](function(_0x51a074){if(_0x51a074){_0x181d81[_0x51c0('0x37')]=_0x51a074[0x0];}if(_0x181d81['UserId']){return db[_0x51c0('0x2b')][_0x51c0('0x2c')]({'where':{'id':_0x181d81[_0x51c0('0x2d')]},'attributes':['id',_0x51c0('0x2e'),_0x51c0('0x2f'),_0x51c0('0x30'),'internal'],'raw':!![]})[_0x51c0('0x36')](function(_0x6744ed){_0x181d81['interface']=util[_0x51c0('0x3c')]('SIP/%s',_0x6744ed[_0x51c0('0x2e')]);_0x181d81['agent']=_0x6744ed;return request({'event':_0x1f26e3,'message':_0x181d81});})[_0x51c0('0x23')](function(_0x455162){console[_0x51c0('0x20')](_0x455162);});}else{return request({'event':_0x1f26e3,'message':_0x181d81});}});}};}exports[_0x51c0('0x3d')]=function(){for(var _0x2461b7=0x0;_0x2461b7=_0x3a3b4d['agents']){throw Error(_0x8599('0x16'));}_0x23c02a(_0x42a4ea);})[_0x8599('0x17')](function(_0x5dd8c4){_0x2e7116(_0x5dd8c4);});});}; \ No newline at end of file +var _0x502b=['lodash','bluebird','../mysqldb','./license/util','voice','mail','fax','sms','whatsapp','isValidChannel','includes','isUndefined','updateAttributes','getLicense','User','then','agents'];(function(_0x57810d,_0x2a62bd){var _0x1b61b4=function(_0x33ce6f){while(--_0x33ce6f){_0x57810d['push'](_0x57810d['shift']());}};_0x1b61b4(++_0x2a62bd);}(_0x502b,0x165));var _0xb502=function(_0x4b6847,_0x50c4d6){_0x4b6847=_0x4b6847-0x0;var _0x562863=_0x502b[_0x4b6847];return _0x562863;};'use strict';var _=require(_0xb502('0x0'));var BPromise=require(_0xb502('0x1'));var db=require(_0xb502('0x2'))['db'];var util=require(_0xb502('0x3'));var channels=[_0xb502('0x4'),_0xb502('0x5'),'chat',_0xb502('0x6'),_0xb502('0x7'),_0xb502('0x8'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0xb502('0x9')]=function(_0x1c6fb4){_0x1c6fb4=_0x1c6fb4['toLowerCase']();return _[_0xb502('0xa')](channels,_0x1c6fb4);};exports['clearBlockUser']=function(_0x544958,_0x4bfd4a,_0x53be39,_0x51bee8){var _0x56f23d={'loginAttempts':_0x4bfd4a,'blocked':_0x53be39};if(!_[_0xb502('0xb')](_0x51bee8)){_0x56f23d['blockedAt']=_0x51bee8;}return _0x544958[_0xb502('0xc')](_0x56f23d);};exports[_0xb502('0xd')]=function(_0x2225d1){return new BPromise(function(_0x2c7134,_0x2356d1){var _0x3f9907=0x0;if(_0x2225d1['role']!=='agent'){_0x2c7134(_0x2225d1);}db[_0xb502('0xe')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x2225d1['id']}}})[_0xb502('0xf')](function(_0x162694){_0x3f9907=_0x162694;return util[_0xb502('0xd')]();})[_0xb502('0xf')](function(_0x10589b){if(_0x10589b&&_0x10589b[_0xb502('0x10')]&&_0x3f9907>=_0x10589b[_0xb502('0x10')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x2c7134(_0x2225d1);})['catch'](function(_0x2cc4f9){_0x2356d1(_0x2cc4f9);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 15f7d19..fd68cdf 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x233d=['send','exports','404','status','json'];(function(_0x34ca5a,_0x2f14b1){var _0x38c2be=function(_0x239f61){while(--_0x239f61){_0x34ca5a['push'](_0x34ca5a['shift']());}};_0x38c2be(++_0x2f14b1);}(_0x233d,0xbf));var _0xd233=function(_0x41ed37,_0xbcd1d4){_0x41ed37=_0x41ed37-0x0;var _0x13f7ea=_0x233d[_0x41ed37];return _0x13f7ea;};'use strict';module[_0xd233('0x0')][0x194]=function pageNotFound(_0x4221c1,_0x314ea2){var _0x4e6b29=_0xd233('0x1');var _0x1e1082=0x194;var _0x49af52={'status':_0x1e1082};_0x314ea2['status'](_0x49af52[_0xd233('0x2')]);_0x314ea2['render'](_0x4e6b29,{},function(_0x1557af,_0x229956){if(_0x1557af){return _0x314ea2[_0xd233('0x2')](_0x49af52[_0xd233('0x2')])[_0xd233('0x3')](_0x49af52);}_0x314ea2[_0xd233('0x4')](_0x229956);});}; \ No newline at end of file +var _0x57ff=['exports','404','status','render','send'];(function(_0x903984,_0x30357f){var _0x3238ee=function(_0x427fc9){while(--_0x427fc9){_0x903984['push'](_0x903984['shift']());}};_0x3238ee(++_0x30357f);}(_0x57ff,0x127));var _0xf57f=function(_0x4bca5f,_0x558bb3){_0x4bca5f=_0x4bca5f-0x0;var _0xfae0b8=_0x57ff[_0x4bca5f];return _0xfae0b8;};'use strict';module[_0xf57f('0x0')][0x194]=function pageNotFound(_0x39e3b6,_0x5b9c76){var _0x45ee0f=_0xf57f('0x1');var _0x3f6b1f=0x194;var _0x4c5923={'status':_0x3f6b1f};_0x5b9c76[_0xf57f('0x2')](_0x4c5923['status']);_0x5b9c76[_0xf57f('0x3')](_0x45ee0f,{},function(_0x541dde,_0x33d8ac){if(_0x541dde){return _0x5b9c76[_0xf57f('0x2')](_0x4c5923[_0xf57f('0x2')])['json'](_0x4c5923);}_0x5b9c76[_0xf57f('0x4')](_0x33d8ac);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index fcb36d6..8a18ef2 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00a9=['Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','hasMany','Recordings','UserId','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','UserProfile','belongsToMany','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_mail_interactions','ChatInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccount','SmsAccounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','cascade','Applications','VoiceMusicOnHold','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','CmHopperBlack','HopperBlacks','TrunkId','mandatoryDispositionPause','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailServerOut','Imap','Smtp','Disposition','MailAccountId','Answers','Interactions','ListId','TemplateId','mandatoryDispositionPauseId','Agents','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','Tag','mail_interaction_has_tags','ThroughTags','Users','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','IntervalId','Items','Dispositions','FaxAccountId','Exntensions','List','TagId','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','Attachment','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','user_has_sms_accounts','SmsInteractionId','Tags','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','UserOpenchannelQueue','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','CmCompany','CompanyId','FaxInteractions','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','CustomReportId','Mohs','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerId','AnalyticFieldReport','Fields','DefaultReportId','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','SugarcrmConfiguration','SugarcrmAccount','Description','int_desk_configuration_has_tags','ZohoAccount','ZendeskField','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','FreshsalesAccount','FromId','ToId','SessionId','ProjectId','user_has_teams','team_has_openchannel_queues','team_has_whatsapp_queues','VoicePrefixes','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','TeamVoicePrefix','UserProfileSections','userProfileId','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappApplication','whatsapp_interaction_has_tags','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','utf8_general_ci','sequelizeHistory','name','utf8','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','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','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model'];(function(_0x389899,_0x1a735f){var _0x5260e4=function(_0x3e2693){while(--_0x3e2693){_0x389899['push'](_0x389899['shift']());}};_0x5260e4(++_0x1a735f);}(_0x00a9,0x165));var _0x900a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x00a9[_0x19950b];return _0x3c6b41;};'use strict';var config=require(_0x900a('0x0'));var Sequelize=require(_0x900a('0x1'));var _=require(_0x900a('0x2'));var jstz=require(_0x900a('0x3'));var timezone=jstz[_0x900a('0x4')]();config['sequelize']=_[_0x900a('0x5')](config['sequelize'],{'database':_0x900a('0x6'),'username':_0x900a('0x7'),'password':_0x900a('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x900a('0x9'),'dialectOptions':{'charset':_0x900a('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x900a('0xb')}}});config[_0x900a('0xc')]=_[_0x900a('0x5')](config[_0x900a('0xc')],{'database':_0x900a('0x6'),'username':_0x900a('0x7'),'password':_0x900a('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x900a('0x9'),'dialectOptions':{'charset':_0x900a('0xa')},'logging':![],'timezone':timezone[_0x900a('0xd')](),'define':{'charset':_0x900a('0xe'),'collate':_0x900a('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x900a('0x1')]['database'],config[_0x900a('0x1')][_0x900a('0xf')],config[_0x900a('0x1')][_0x900a('0x10')],config[_0x900a('0x1')][_0x900a('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config['sequelizeHistory']['username'],config[_0x900a('0xc')]['password'],config[_0x900a('0xc')][_0x900a('0x11')])};db[_0x900a('0x12')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x14'));db['VoiceChanSpy']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x15'));db[_0x900a('0x16')]=db['sequelize']['import']('../api/voiceContext/voiceContext.model');db[_0x900a('0x17')]=db[_0x900a('0x1')]['import'](_0x900a('0x18'));db['VoiceMusicOnHold']=db['sequelize'][_0x900a('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x900a('0x1')][_0x900a('0x13')]('../api/voiceQueue/voiceQueue.model');db[_0x900a('0x19')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x1a'));db['ScreenRecording']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x1b'));db[_0x900a('0x1c')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0x900a('0x1')][_0x900a('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x900a('0x1d')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x1e'));db[_0x900a('0x1f')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x20'));db[_0x900a('0x21')]=db[_0x900a('0x1')]['import'](_0x900a('0x22'));db[_0x900a('0x23')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x24'));db[_0x900a('0x25')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/memberReport/memberReport.model');db[_0x900a('0x26')]=db['sequelize'][_0x900a('0x13')]('../api/trunk/trunk.model');db[_0x900a('0x27')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x28'));db[_0x900a('0x29')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x900a('0x2a')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x2b'));db[_0x900a('0x2c')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x2d'));db['UserMailQueue']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x2e'));db[_0x900a('0x2f')]=db['sequelize'][_0x900a('0x13')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db['sequelize'][_0x900a('0x13')](_0x900a('0x30'));db['UserOpenchannelQueue']=db[_0x900a('0x1')]['import'](_0x900a('0x31'));db[_0x900a('0x32')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x33'));db[_0x900a('0x34')]=db[_0x900a('0x1')]['import'](_0x900a('0x35'));db['MailServerOut']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x36'));db[_0x900a('0x37')]=db[_0x900a('0x1')]['import'](_0x900a('0x38'));db[_0x900a('0x39')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/mailQueue/mailQueue.model');db[_0x900a('0x3a')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x3b'));db[_0x900a('0x3c')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x3d'));db[_0x900a('0x3e')]=db[_0x900a('0x1')]['import'](_0x900a('0x3f'));db[_0x900a('0x40')]=db[_0x900a('0x1')]['import']('../api/mailApplication/mailApplication.model');db[_0x900a('0x41')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x42'));db[_0x900a('0x43')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x44'));db[_0x900a('0x45')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x46'));db['FaxAccount']=db['sequelize'][_0x900a('0x13')](_0x900a('0x47'));db[_0x900a('0x48')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x49'));db[_0x900a('0x4a')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x900a('0x4b')]=db[_0x900a('0x1')]['import'](_0x900a('0x4c'));db[_0x900a('0x4d')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x4e'));db[_0x900a('0x4f')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x50'));db['SmsAccount']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x51'));db[_0x900a('0x52')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x53'));db[_0x900a('0x54')]=db[_0x900a('0x1')]['import'](_0x900a('0x55'));db['SmsMessage']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x56'));db[_0x900a('0x57')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x58'));db[_0x900a('0x59')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x5a'));db['OpenchannelApplication']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x5b'));db['OpenchannelInteraction']=db[_0x900a('0x1')]['import'](_0x900a('0x5c'));db[_0x900a('0x5d')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x5e'));db[_0x900a('0x5f')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x900a('0x60')]=db[_0x900a('0x1')]['import'](_0x900a('0x61'));db[_0x900a('0x62')]=db[_0x900a('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x900a('0x63')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x64'));db[_0x900a('0x65')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x66'));db[_0x900a('0x67')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x68'));db[_0x900a('0x69')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x900a('0x6a')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x6b'));db[_0x900a('0x6c')]=db['sequelize'][_0x900a('0x13')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x900a('0x1')]['import'](_0x900a('0x6d'));db['CmCompany']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x6e'));db[_0x900a('0x6f')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x70'));db[_0x900a('0x71')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x72'));db['CmHopperBlack']=db[_0x900a('0x1')][_0x900a('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x900a('0x73')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x900a('0x74')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x75'));db[_0x900a('0x76')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x77'));db[_0x900a('0x78')]=db[_0x900a('0x1')]['import'](_0x900a('0x79'));db[_0x900a('0x7a')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x7b'));db[_0x900a('0x7c')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x7d'));db[_0x900a('0x7e')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x7f'));db['Disposition']=db['sequelize'][_0x900a('0x13')]('../api/disposition/disposition.model');db[_0x900a('0x80')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x81'));db[_0x900a('0x82')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/interval/interval.model');db[_0x900a('0x83')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x84'));db[_0x900a('0x85')]=db['sequelize']['import']('../api/cdr/cdr.model');db[_0x900a('0x86')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x87'));db[_0x900a('0x88')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x89'));db[_0x900a('0x8a')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x8b'));db['Tag']=db[_0x900a('0x1')]['import'](_0x900a('0x8c'));db[_0x900a('0x8d')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x8e'));db[_0x900a('0x8f')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/trigger/trigger.model');db[_0x900a('0x90')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x91'));db[_0x900a('0x92')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x93'));db[_0x900a('0x94')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x95'));db[_0x900a('0x96')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x97'));db[_0x900a('0x98')]=db['sequelize'][_0x900a('0x13')](_0x900a('0x99'));db[_0x900a('0x9a')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x9b'));db[_0x900a('0x9c')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x9d'));db['AnalyticFieldReport']=db[_0x900a('0x1')][_0x900a('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x900a('0x9e')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x9f'));db['SalesforceAccount']=db['sequelize']['import'](_0x900a('0xa0'));db[_0x900a('0xa1')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xa2'));db['SugarcrmAccount']=db['sequelize'][_0x900a('0x13')](_0x900a('0xa3'));db['SugarcrmConfiguration']=db[_0x900a('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x900a('0xa4')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xa5'));db[_0x900a('0xa6')]=db[_0x900a('0x1')]['import'](_0x900a('0xa7'));db[_0x900a('0xa8')]=db[_0x900a('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x900a('0xa9')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xaa'));db['ZohoAccount']=db['sequelize'][_0x900a('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x900a('0xab')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x900a('0xac')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xad'));db['ZendeskAccount']=db['sequelize'][_0x900a('0x13')](_0x900a('0xae'));db[_0x900a('0xaf')]=db['sequelize'][_0x900a('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x900a('0x1')]['import']('../api/intZendeskField/intZendeskField.model');db[_0x900a('0xb0')]=db['sequelize']['import'](_0x900a('0xb1'));db[_0x900a('0xb2')]=db[_0x900a('0x1')]['import'](_0x900a('0xb3'));db['FreshdeskField']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xb4'));db[_0x900a('0xb5')]=db[_0x900a('0x1')]['import'](_0x900a('0xb6'));db[_0x900a('0xb7')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xb8'));db[_0x900a('0xb9')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xba'));db[_0x900a('0xbb')]=db['sequelize'][_0x900a('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x900a('0xbc')]=db['sequelize'][_0x900a('0x13')](_0x900a('0xbd'));db[_0x900a('0xbe')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/intServicenowField/intServicenowField.model');db[_0x900a('0xbf')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xc0'));db[_0x900a('0xc1')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x900a('0xc2')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xc3'));db['FreshsalesAccount']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xc4'));db[_0x900a('0xc5')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xc6'));db[_0x900a('0xc7')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x900a('0x92')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x93'));db['Network']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xc8'));db[_0x900a('0xc9')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xca'));db[_0x900a('0xcb')]=db[_0x900a('0x1')]['import'](_0x900a('0xcc'));db[_0x900a('0xcd')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xce'));db[_0x900a('0xcf')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xd0'));db[_0x900a('0xd1')]=db['sequelize'][_0x900a('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x900a('0xd2')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xd3'));db['SquareReport']=db[_0x900a('0x1')][_0x900a('0x13')]('../api/squareReport/squareReport.model');db[_0x900a('0xd4')]=db['sequelize'][_0x900a('0x13')](_0x900a('0xd5'));db[_0x900a('0xd6')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xd7'));db[_0x900a('0xd8')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xd9'));db[_0x900a('0xda')]=db['sequelize'][_0x900a('0x13')](_0x900a('0xdb'));db[_0x900a('0xdc')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/squareProject/squareProject.model');db[_0x900a('0xdd')]=db[_0x900a('0x1')]['import'](_0x900a('0xde'));db[_0x900a('0xdf')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xe0'));db[_0x900a('0xe1')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xe2'));db['License']=db[_0x900a('0x1')][_0x900a('0x13')]('../api/license/license.model');db[_0x900a('0xe3')]=db['sequelize']['import'](_0x900a('0xe4'));db['Migration']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xe5'));db['Attachment']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xe6'));db[_0x900a('0xe7')]=db['sequelize'][_0x900a('0x13')]('../api/plugin/plugin.model');db[_0x900a('0xe8')]=db['sequelize'][_0x900a('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x900a('0xe9')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0x900a('0xea')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xeb'));db[_0x900a('0xec')]=db['sequelize'][_0x900a('0x13')](_0x900a('0xed'));db[_0x900a('0xee')]=db['sequelize'][_0x900a('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0x900a('0xef')]=db['sequelize'][_0x900a('0x13')](_0x900a('0xf0'));db[_0x900a('0xf1')]=db['sequelize'][_0x900a('0x13')](_0x900a('0xf2'));db['UserProfile']=db['sequelize'][_0x900a('0x13')]('../api/userProfile/userProfile.model');db[_0x900a('0xf3')]=db[_0x900a('0x1')][_0x900a('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0x900a('0xf4')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xf5'));db[_0x900a('0xf6')]=db[_0x900a('0x1')]['import'](_0x900a('0xf7'));db['WhatsappAccount']=db['sequelize'][_0x900a('0x13')](_0x900a('0xf8'));db['WhatsappApplication']=db[_0x900a('0x1')][_0x900a('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x900a('0xf9')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xfa'));db['WhatsappMessage']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xfb'));db[_0x900a('0xfc')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xfd'));db[_0x900a('0xfe')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0xff'));db['WhatsappQueue']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x100'));db[_0x900a('0x101')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x102'));db[_0x900a('0x103')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x104'));db['TeamVoicePrefix']=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x105'));db[_0x900a('0x106')]=db[_0x900a('0x1')][_0x900a('0x13')](_0x900a('0x107'));db['User'][_0x900a('0x108')](db[_0x900a('0x1c')],{'as':_0x900a('0x1c'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x900a('0x12')][_0x900a('0x109')](db['VoiceRecording'],{'as':_0x900a('0x10a'),'foreignKey':_0x900a('0x10b')});db[_0x900a('0x12')][_0x900a('0x109')](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':_0x900a('0x10b')});db[_0x900a('0x12')][_0x900a('0x109')](db['VoiceExtension'],{'as':_0x900a('0x10c'),'onDelete':'cascade','hooks':!![]});db[_0x900a('0x12')][_0x900a('0x109')](db[_0x900a('0x73')],{'as':_0x900a('0x10d'),'foreignKey':'UserId'});db[_0x900a('0x12')][_0x900a('0x109')](db['CmHopperHistory'],{'as':_0x900a('0x10e'),'foreignKey':_0x900a('0x10b')});db[_0x900a('0x12')][_0x900a('0x109')](db[_0x900a('0x76')],{'as':_0x900a('0x76'),'foreignKey':_0x900a('0x10b')});db[_0x900a('0x12')][_0x900a('0x109')](db[_0x900a('0x10f')],{'as':_0x900a('0x110'),'foreignKey':_0x900a('0x10b')});db[_0x900a('0x12')][_0x900a('0x109')](db[_0x900a('0x65')],{'as':'ChatInteractions','foreignKey':_0x900a('0x10b')});db[_0x900a('0x12')][_0x900a('0x109')](db[_0x900a('0x54')],{'as':_0x900a('0x111'),'foreignKey':'UserId'});db[_0x900a('0x12')][_0x900a('0x109')](db[_0x900a('0x4a')],{'as':'FaxInteractions','foreignKey':_0x900a('0x10b')});db['User'][_0x900a('0x109')](db[_0x900a('0x3c')],{'as':_0x900a('0x112'),'foreignKey':_0x900a('0x10b')});db[_0x900a('0x12')][_0x900a('0x109')](db[_0x900a('0xf9')],{'as':_0x900a('0x113'),'foreignKey':_0x900a('0x10b')});db[_0x900a('0x12')][_0x900a('0x109')](db[_0x900a('0xf6')],{'as':_0x900a('0x114'),'foreignKey':_0x900a('0x115')});db[_0x900a('0x12')][_0x900a('0x116')](db[_0x900a('0x117')],{'as':_0x900a('0x117'),'foreignKey':'userProfileId'});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0x6c')],{'as':'Groups','through':_0x900a('0x119')});db[_0x900a('0x12')]['belongsToMany'](db['CmContact'],{'as':_0x900a('0x11a'),'through':'cm_user_has_contacts'});db[_0x900a('0x12')][_0x900a('0x118')](db['CmList'],{'as':_0x900a('0x11b'),'through':_0x900a('0x11c')});db[_0x900a('0x12')]['belongsToMany'](db[_0x900a('0xe1')],{'through':'user_has_teams'});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0x3c')],{'as':'MailInteractions','through':_0x900a('0x11d')});db[_0x900a('0x12')]['belongsToMany'](db[_0x900a('0x65')],{'as':_0x900a('0x11e'),'through':'user_has_chat_interactions'});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0x4a')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x900a('0x12')]['belongsToMany'](db['SmsInteraction'],{'as':_0x900a('0x111'),'through':_0x900a('0x11f')});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0x10f')],{'as':_0x900a('0x110'),'through':'user_has_openchannel_interactions'});db[_0x900a('0x12')]['belongsToMany'](db[_0x900a('0xf9')],{'as':'WhatsappInteractions','through':_0x900a('0x120')});db[_0x900a('0x12')]['belongsToMany'](db[_0x900a('0x121')],{'as':_0x900a('0x122'),'through':_0x900a('0x2a'),'required':![]});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0xf1')],{'as':'VoicePrefixes','through':_0x900a('0x106'),'required':![]});db['User'][_0x900a('0x118')](db['MailQueue'],{'as':_0x900a('0x123'),'through':'UserMailQueue','required':![]});db[_0x900a('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0x900a('0x124'),'through':_0x900a('0x2c'),'required':![],'hooks':!![]});db[_0x900a('0x12')]['belongsToMany'](db[_0x900a('0x4d')],{'as':_0x900a('0x125'),'through':_0x900a('0x2f'),'required':![]});db['User']['belongsToMany'](db[_0x900a('0x57')],{'as':_0x900a('0x126'),'through':_0x900a('0x127'),'required':![]});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0x5f')],{'as':_0x900a('0x128'),'through':'UserOpenchannelQueue','required':![]});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0x129')],{'as':_0x900a('0x12a'),'through':_0x900a('0x32'),'required':![]});db['User'][_0x900a('0x118')](db[_0x900a('0xef')],{'through':_0x900a('0x11c')});db['User'][_0x900a('0x118')](db['ChatWebsite'],{'as':_0x900a('0x12b'),'through':_0x900a('0x12c')});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0x12d')],{'as':_0x900a('0x12e'),'through':_0x900a('0x12f')});db['User'][_0x900a('0x118')](db[_0x900a('0x37')],{'as':_0x900a('0x130'),'through':_0x900a('0x131')});db[_0x900a('0x12')][_0x900a('0x118')](db['OpenchannelAccount'],{'as':_0x900a('0x132'),'through':'user_has_openchannel_accounts'});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0x133')],{'as':_0x900a('0x134'),'through':'user_has_sms_accounts'});db[_0x900a('0x12')]['belongsToMany'](db[_0x900a('0x135')],{'as':_0x900a('0x136'),'through':_0x900a('0x137')});db[_0x900a('0x12')][_0x900a('0x118')](db[_0x900a('0xdc')],{'as':_0x900a('0x138'),'through':_0x900a('0x139')});db['VoiceChanSpy'][_0x900a('0x109')](db[_0x900a('0x17')],{'as':_0x900a('0x13a'),'onDelete':_0x900a('0x13b'),'foreignKey':'ChanSpyId'});db[_0x900a('0x16')][_0x900a('0x109')](db[_0x900a('0x17')],{'onDelete':_0x900a('0x13b')});db[_0x900a('0x17')][_0x900a('0x109')](db[_0x900a('0x17')],{'as':_0x900a('0x13c'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x13d')][_0x900a('0x118')](db[_0x900a('0x8a')],{'as':'Sounds','through':_0x900a('0x13e')});db[_0x900a('0x121')][_0x900a('0x109')](db[_0x900a('0x29')],{'as':_0x900a('0x13f'),'foreignKey':'VoiceQueueId'});db[_0x900a('0x121')]['hasMany'](db[_0x900a('0x71')],{'as':_0x900a('0x140'),'foreignKey':_0x900a('0x141')});db[_0x900a('0x121')]['hasMany'](db[_0x900a('0x73')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x900a('0x121')]['hasMany'](db['CmHopperHistory'],{'as':_0x900a('0x142'),'foreignKey':_0x900a('0x141')});db[_0x900a('0x121')][_0x900a('0x109')](db['ReportAgentPreview'],{'as':_0x900a('0x76'),'foreignKey':_0x900a('0x141')});db[_0x900a('0x121')]['hasMany'](db[_0x900a('0x143')],{'as':_0x900a('0x144'),'foreignKey':_0x900a('0x141')});db[_0x900a('0x121')]['hasMany'](db[_0x900a('0xd1')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x900a('0x116')](db[_0x900a('0x26')],{'as':_0x900a('0x26'),'foreignKey':_0x900a('0x145')});db['VoiceQueue'][_0x900a('0x116')](db[_0x900a('0x26')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db['VoiceQueue']['belongsTo'](db[_0x900a('0x82')],{'as':_0x900a('0x82'),'foreignKey':'IntervalId'});db[_0x900a('0x121')]['belongsTo'](db['Pause'],{'as':_0x900a('0x146'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x900a('0x118')](db[_0x900a('0xef')],{'as':_0x900a('0x11b'),'through':_0x900a('0x147')});db['VoiceQueue'][_0x900a('0x118')](db['User'],{'as':'Agents','through':'UserVoiceQueue'});db[_0x900a('0x121')][_0x900a('0x118')](db[_0x900a('0xe1')],{'as':_0x900a('0x148'),'through':_0x900a('0x103')});db[_0x900a('0x121')]['belongsToMany'](db[_0x900a('0xef')],{'as':_0x900a('0x149'),'through':_0x900a('0x14a')});db[_0x900a('0x19')][_0x900a('0x116')](db[_0x900a('0x12')],{'as':_0x900a('0x12'),'foreignKey':'UserId'});db[_0x900a('0x14b')][_0x900a('0x116')](db['User'],{'as':_0x900a('0x12'),'foreignKey':_0x900a('0x10b')});db['VoiceMail'][_0x900a('0x109')](db['VoiceMailMessage'],{'as':_0x900a('0x14c'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x14d'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0x900a('0x116')](db[_0x900a('0x1c')],{'foreignKey':_0x900a('0x14d'),'targetKey':_0x900a('0x14e')});db[_0x900a('0x1d')][_0x900a('0x109')](db['VoiceQueueReport'],{'as':_0x900a('0x14f'),'foreignKey':_0x900a('0x150'),'constraints':![]});db['VoiceCallReport'][_0x900a('0x109')](db[_0x900a('0x21')],{'as':_0x900a('0x151'),'foreignKey':_0x900a('0x150'),'constraints':![]});db[_0x900a('0x1d')]['belongsTo'](db['User'],{'as':_0x900a('0x12'),'foreignKey':_0x900a('0x10b')});db['VoiceCallReport'][_0x900a('0x116')](db[_0x900a('0x6f')],{'as':'Contact','foreignKey':_0x900a('0x152')});db[_0x900a('0x34')]['belongsTo'](db[_0x900a('0x37')],{'as':_0x900a('0x37'),'foreignKey':'MailAccountId'});db[_0x900a('0x153')][_0x900a('0x116')](db[_0x900a('0x37')],{'as':_0x900a('0x37'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x900a('0x108')](db[_0x900a('0x34')],{'as':_0x900a('0x154'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x37')][_0x900a('0x108')](db[_0x900a('0x153')],{'as':_0x900a('0x155'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x37')][_0x900a('0x109')](db[_0x900a('0x156')],{'as':'Dispositions','foreignKey':_0x900a('0x157'),'onDelete':'cascade'});db[_0x900a('0x37')][_0x900a('0x109')](db[_0x900a('0x7e')],{'as':_0x900a('0x158'),'foreignKey':'MailAccountId'});db[_0x900a('0x37')]['hasMany'](db[_0x900a('0x3e')],{'as':_0x900a('0x14c'),'foreignKey':_0x900a('0x157')});db[_0x900a('0x37')][_0x900a('0x109')](db[_0x900a('0x3c')],{'as':_0x900a('0x159')});db[_0x900a('0x37')][_0x900a('0x109')](db['MailApplication'],{'as':'Applications'});db[_0x900a('0x37')]['belongsTo'](db[_0x900a('0xef')],{'as':'List','foreignKey':_0x900a('0x15a')});db['MailAccount'][_0x900a('0x116')](db[_0x900a('0x8d')],{'as':'Template','foreignKey':_0x900a('0x15b')});db['MailAccount']['belongsTo'](db[_0x900a('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x900a('0x15c')});db['MailAccount'][_0x900a('0x118')](db[_0x900a('0x12')],{'as':_0x900a('0x15d'),'through':_0x900a('0x131')});db[_0x900a('0x39')]['belongsToMany'](db[_0x900a('0x12')],{'as':_0x900a('0x15d'),'through':'UserMailQueue'});db[_0x900a('0x39')][_0x900a('0x118')](db[_0x900a('0xe1')],{'through':_0x900a('0x15e'),'as':_0x900a('0x148')});db[_0x900a('0x3c')][_0x900a('0x109')](db['MailMessage'],{'as':_0x900a('0x14c'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x15f')});db[_0x900a('0x3c')]['belongsTo'](db['MailAccount'],{'as':_0x900a('0x160'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0x900a('0x116')](db[_0x900a('0x6f')],{'as':_0x900a('0x161'),'foreignKey':_0x900a('0x152')});db[_0x900a('0x3c')][_0x900a('0x116')](db[_0x900a('0x12')],{'as':_0x900a('0x162'),'foreignKey':'UserId'});db[_0x900a('0x3c')]['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0x900a('0x3c')][_0x900a('0x118')](db[_0x900a('0x163')],{'through':_0x900a('0x164'),'as':_0x900a('0x165')});db[_0x900a('0x3c')][_0x900a('0x118')](db[_0x900a('0x12')],{'as':_0x900a('0x166'),'through':_0x900a('0x11d'),'foreignKey':_0x900a('0x15f')});db[_0x900a('0x3e')][_0x900a('0x109')](db['Attachment'],{'as':'Attachments','onDelete':_0x900a('0x13b')});db[_0x900a('0x3e')][_0x900a('0x116')](db['User'],{'as':_0x900a('0x12')});db[_0x900a('0x3e')]['belongsTo'](db['CmContact'],{'onDelete':_0x900a('0x13b'),'as':'Contact'});db[_0x900a('0x3e')]['belongsTo'](db[_0x900a('0x3c')],{'as':_0x900a('0x167'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x900a('0x116')](db[_0x900a('0x37')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x900a('0x3e')][_0x900a('0x116')](db[_0x900a('0x60')],{'as':'ChatWebsite','foreignKey':_0x900a('0x168')});db[_0x900a('0x3e')][_0x900a('0x116')](db[_0x900a('0x69')],{'as':_0x900a('0x69'),'foreignKey':_0x900a('0x169')});db[_0x900a('0x40')][_0x900a('0x116')](db[_0x900a('0x12')],{'onDelete':_0x900a('0x16a')});db['MailApplication'][_0x900a('0x116')](db[_0x900a('0x39')],{'onDelete':_0x900a('0x16a')});db[_0x900a('0x40')]['belongsTo'](db['MailAccount'],{'onDelete':'restrict'});db[_0x900a('0x40')][_0x900a('0x116')](db[_0x900a('0x82')],{'onDelete':_0x900a('0x16a'),'foreignKey':_0x900a('0x16b')});db[_0x900a('0x40')]['belongsTo'](db['Tag'],{'onDelete':_0x900a('0x16a'),'foreignKey':'TagId'});db[_0x900a('0x41')][_0x900a('0x116')](db[_0x900a('0x37')],{});db[_0x900a('0x41')][_0x900a('0x116')](db[_0x900a('0xef')],{'as':'List','foreignKey':_0x900a('0x15a')});db[_0x900a('0x41')][_0x900a('0x116')](db['CmContact'],{'as':_0x900a('0x161'),'foreignKey':_0x900a('0x152')});db[_0x900a('0x41')][_0x900a('0x116')](db[_0x900a('0x3c')],{});db[_0x900a('0x41')][_0x900a('0x116')](db[_0x900a('0x3e')],{});db['MailQueueReport'][_0x900a('0x116')](db[_0x900a('0x12')],{});db[_0x900a('0x41')][_0x900a('0x116')](db['MailQueue'],{});db[_0x900a('0x43')][_0x900a('0x109')](db[_0x900a('0x45')],{'as':_0x900a('0x16c'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x12d')][_0x900a('0x109')](db[_0x900a('0x156')],{'as':_0x900a('0x16d'),'foreignKey':_0x900a('0x16e'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x12d')][_0x900a('0x109')](db[_0x900a('0x7e')],{'as':_0x900a('0x158'),'foreignKey':'FaxAccountId'});db[_0x900a('0x12d')][_0x900a('0x109')](db[_0x900a('0x4a')],{'as':_0x900a('0x159')});db[_0x900a('0x12d')][_0x900a('0x109')](db['FaxApplication'],{'as':_0x900a('0x13c')});db['FaxAccount'][_0x900a('0x109')](db[_0x900a('0x17')],{'as':_0x900a('0x16f'),'onDelete':'cascade'});db[_0x900a('0x12d')]['hasMany'](db[_0x900a('0x4b')],{'as':_0x900a('0x14c')});db['FaxAccount'][_0x900a('0x116')](db[_0x900a('0x26')],{'as':_0x900a('0x26')});db[_0x900a('0x12d')][_0x900a('0x116')](db[_0x900a('0xef')],{'as':_0x900a('0x170'),'foreignKey':_0x900a('0x15a')});db[_0x900a('0x12d')]['belongsTo'](db[_0x900a('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x900a('0x15c')});db[_0x900a('0x12d')][_0x900a('0x118')](db[_0x900a('0x12')],{'as':_0x900a('0x15d'),'through':'user_has_fax_accounts'});db[_0x900a('0x48')][_0x900a('0x116')](db['User'],{'onDelete':_0x900a('0x16a')});db[_0x900a('0x48')][_0x900a('0x116')](db[_0x900a('0x4d')],{'onDelete':_0x900a('0x16a')});db['FaxApplication'][_0x900a('0x116')](db[_0x900a('0x12d')],{'onDelete':_0x900a('0x16a')});db['FaxApplication'][_0x900a('0x116')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x900a('0x171')});db[_0x900a('0x4a')][_0x900a('0x109')](db[_0x900a('0x4b')],{'as':_0x900a('0x14c'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x172')});db[_0x900a('0x4a')][_0x900a('0x116')](db[_0x900a('0x12d')],{'as':'Account','foreignKey':_0x900a('0x16e')});db[_0x900a('0x4a')][_0x900a('0x116')](db[_0x900a('0x6f')],{'as':'Contact','foreignKey':_0x900a('0x152')});db[_0x900a('0x4a')]['belongsTo'](db[_0x900a('0x12')],{'as':_0x900a('0x162'),'foreignKey':_0x900a('0x10b')});db[_0x900a('0x4a')]['belongsToMany'](db[_0x900a('0x163')],{'through':_0x900a('0x173'),'as':'Tags'});db['FaxInteraction'][_0x900a('0x118')](db[_0x900a('0x163')],{'through':_0x900a('0x173'),'as':_0x900a('0x165')});db['FaxInteraction']['belongsToMany'](db['User'],{'as':_0x900a('0x166'),'through':_0x900a('0x174'),'foreignKey':_0x900a('0x172')});db[_0x900a('0x4b')][_0x900a('0x116')](db[_0x900a('0x12')],{'onDelete':_0x900a('0x13b'),'as':'User'});db[_0x900a('0x4b')]['belongsTo'](db[_0x900a('0x4a')],{'as':_0x900a('0x167'),'foreignKey':_0x900a('0x172')});db[_0x900a('0x4b')][_0x900a('0x116')](db[_0x900a('0x6f')],{'onDelete':'cascade','as':_0x900a('0x161')});db[_0x900a('0x4b')][_0x900a('0x116')](db[_0x900a('0x175')],{'as':_0x900a('0x175'),'foreignKey':_0x900a('0x176')});db['FaxMessage'][_0x900a('0x116')](db[_0x900a('0x12d')],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x16e')});db['FaxQueue'][_0x900a('0x118')](db['User'],{'as':_0x900a('0x15d'),'through':_0x900a('0x2f')});db['FaxQueue'][_0x900a('0x118')](db['Team'],{'through':_0x900a('0x177'),'as':'Teams'});db[_0x900a('0x4f')][_0x900a('0x116')](db[_0x900a('0x12d')],{});db[_0x900a('0x4f')][_0x900a('0x116')](db[_0x900a('0xef')],{'as':_0x900a('0x170'),'foreignKey':_0x900a('0x15a')});db[_0x900a('0x4f')][_0x900a('0x116')](db[_0x900a('0x6f')],{'as':_0x900a('0x161'),'foreignKey':_0x900a('0x152')});db[_0x900a('0x4f')][_0x900a('0x116')](db[_0x900a('0x4a')],{});db['FaxQueueReport']['belongsTo'](db[_0x900a('0x4b')],{});db[_0x900a('0x4f')][_0x900a('0x116')](db[_0x900a('0x12')],{});db[_0x900a('0x4f')]['belongsTo'](db[_0x900a('0x4d')],{});db['SmsAccount'][_0x900a('0x109')](db[_0x900a('0x156')],{'as':_0x900a('0x16d'),'foreignKey':_0x900a('0x178'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x133')][_0x900a('0x109')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x900a('0x178')});db[_0x900a('0x133')][_0x900a('0x109')](db[_0x900a('0x179')],{'as':_0x900a('0x14c'),'foreignKey':_0x900a('0x178')});db[_0x900a('0x133')][_0x900a('0x109')](db[_0x900a('0x54')],{'as':_0x900a('0x159')});db['SmsAccount']['hasMany'](db['SmsApplication'],{'as':_0x900a('0x13c')});db['SmsAccount'][_0x900a('0x116')](db[_0x900a('0xef')],{'as':_0x900a('0x170'),'foreignKey':'ListId'});db[_0x900a('0x133')][_0x900a('0x116')](db[_0x900a('0x83')],{'as':_0x900a('0x146'),'foreignKey':_0x900a('0x15c')});db[_0x900a('0x133')][_0x900a('0x118')](db['User'],{'as':'Agents','through':_0x900a('0x17a')});db[_0x900a('0x52')][_0x900a('0x116')](db[_0x900a('0x12')],{'onDelete':_0x900a('0x16a')});db['SmsApplication'][_0x900a('0x116')](db[_0x900a('0x57')],{'onDelete':'restrict'});db[_0x900a('0x52')][_0x900a('0x116')](db[_0x900a('0x133')],{'onDelete':'restrict'});db[_0x900a('0x52')][_0x900a('0x116')](db[_0x900a('0x82')],{'onDelete':_0x900a('0x16a'),'foreignKey':'IntervalId'});db['SmsApplication']['belongsTo'](db['Tag'],{'onDelete':_0x900a('0x16a'),'foreignKey':_0x900a('0x171')});db['SmsInteraction'][_0x900a('0x109')](db[_0x900a('0x179')],{'as':_0x900a('0x14c'),'onDelete':'cascade','foreignKey':_0x900a('0x17b')});db[_0x900a('0x54')][_0x900a('0x116')](db[_0x900a('0x133')],{'as':'Account','foreignKey':_0x900a('0x178')});db[_0x900a('0x54')]['belongsTo'](db[_0x900a('0x6f')],{'as':'Contact','foreignKey':_0x900a('0x152')});db[_0x900a('0x54')]['belongsTo'](db[_0x900a('0x12')],{'as':_0x900a('0x162'),'foreignKey':_0x900a('0x10b')});db['SmsInteraction'][_0x900a('0x118')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x900a('0x17c')});db[_0x900a('0x54')][_0x900a('0x118')](db['Tag'],{'through':_0x900a('0x17d'),'as':_0x900a('0x165')});db[_0x900a('0x54')][_0x900a('0x118')](db['User'],{'as':_0x900a('0x166'),'through':_0x900a('0x11f'),'foreignKey':_0x900a('0x17b')});db[_0x900a('0x179')][_0x900a('0x116')](db[_0x900a('0x12')],{'as':_0x900a('0x12')});db['SmsMessage'][_0x900a('0x116')](db[_0x900a('0x6f')],{'onDelete':_0x900a('0x13b'),'as':_0x900a('0x161')});db['SmsMessage']['belongsTo'](db[_0x900a('0x54')],{'onDelete':_0x900a('0x13b'),'as':_0x900a('0x167'),'foreignKey':'SmsInteractionId'});db[_0x900a('0x179')][_0x900a('0x116')](db[_0x900a('0x133')],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x178')});db[_0x900a('0x57')][_0x900a('0x118')](db[_0x900a('0x12')],{'as':'Agents','through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x900a('0x57')][_0x900a('0x118')](db[_0x900a('0xe1')],{'through':_0x900a('0x17e'),'as':_0x900a('0x148')});db['OpenchannelAccount'][_0x900a('0x109')](db[_0x900a('0x156')],{'as':_0x900a('0x16d'),'foreignKey':_0x900a('0x17f'),'onDelete':_0x900a('0x13b')});db['OpenchannelAccount']['hasMany'](db[_0x900a('0x7e')],{'as':'Answers','foreignKey':_0x900a('0x17f')});db[_0x900a('0x59')][_0x900a('0x109')](db[_0x900a('0x10f')],{'as':'Interactions','foreignKey':_0x900a('0x17f')});db[_0x900a('0x59')][_0x900a('0x109')](db[_0x900a('0x5d')],{'as':_0x900a('0x14c'),'foreignKey':_0x900a('0x17f')});db[_0x900a('0x59')][_0x900a('0x109')](db[_0x900a('0x180')],{'as':'Applications','foreignKey':_0x900a('0x17f')});db[_0x900a('0x59')][_0x900a('0x116')](db['CmList'],{'as':_0x900a('0x170'),'foreignKey':_0x900a('0x15a')});db[_0x900a('0x59')][_0x900a('0x116')](db['Pause'],{'as':_0x900a('0x146'),'foreignKey':_0x900a('0x15c')});db[_0x900a('0x59')]['belongsToMany'](db[_0x900a('0x12')],{'as':_0x900a('0x15d'),'through':_0x900a('0x181')});db[_0x900a('0x180')][_0x900a('0x116')](db[_0x900a('0x12')],{'onDelete':_0x900a('0x16a')});db[_0x900a('0x180')][_0x900a('0x116')](db['OpenchannelQueue'],{'onDelete':_0x900a('0x16a'),'foreignKey':_0x900a('0x182')});db['OpenchannelApplication'][_0x900a('0x116')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x900a('0x17f')});db[_0x900a('0x180')]['belongsTo'](db[_0x900a('0x82')],{'onDelete':_0x900a('0x16a'),'foreignKey':_0x900a('0x16b')});db['OpenchannelApplication']['belongsTo'](db[_0x900a('0x163')],{'onDelete':_0x900a('0x16a'),'foreignKey':_0x900a('0x171')});db[_0x900a('0x10f')]['hasMany'](db[_0x900a('0x5d')],{'as':_0x900a('0x14c'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x183')});db[_0x900a('0x10f')][_0x900a('0x116')](db['OpenchannelAccount'],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x17f')});db['OpenchannelInteraction']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x900a('0x152')});db['OpenchannelInteraction'][_0x900a('0x116')](db['User'],{'as':_0x900a('0x162'),'foreignKey':_0x900a('0x10b')});db[_0x900a('0x10f')]['belongsToMany'](db['Tag'],{'through':_0x900a('0x184'),'as':_0x900a('0x17c')});db[_0x900a('0x10f')][_0x900a('0x118')](db['Tag'],{'through':_0x900a('0x184'),'as':_0x900a('0x165')});db[_0x900a('0x10f')][_0x900a('0x118')](db[_0x900a('0x12')],{'as':'Users','through':_0x900a('0x185'),'foreignKey':'OpenchannelInteractionId'});db[_0x900a('0x5d')][_0x900a('0x116')](db[_0x900a('0x12')],{'onDelete':'cascade','as':'User'});db['OpenchannelMessage'][_0x900a('0x116')](db[_0x900a('0x6f')],{'onDelete':_0x900a('0x13b'),'as':_0x900a('0x161')});db[_0x900a('0x5d')][_0x900a('0x116')](db[_0x900a('0x10f')],{'onDelete':_0x900a('0x13b'),'as':'Interaction','foreignKey':_0x900a('0x183')});db[_0x900a('0x5d')][_0x900a('0x116')](db[_0x900a('0x175')],{'as':_0x900a('0x175'),'foreignKey':_0x900a('0x176')});db[_0x900a('0x5d')][_0x900a('0x116')](db['OpenchannelAccount'],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x17f')});db['OpenchannelQueue'][_0x900a('0x118')](db[_0x900a('0x12')],{'as':'Agents','through':_0x900a('0x186'),'foreignKey':_0x900a('0x182')});db[_0x900a('0x5f')][_0x900a('0x118')](db[_0x900a('0xe1')],{'through':'team_has_openchannel_queues','as':_0x900a('0x148')});db[_0x900a('0x60')][_0x900a('0x109')](db[_0x900a('0x156')],{'as':_0x900a('0x16d'),'foreignKey':_0x900a('0x168'),'onDelete':_0x900a('0x13b')});db['ChatWebsite']['hasMany'](db[_0x900a('0x7e')],{'as':_0x900a('0x158'),'foreignKey':_0x900a('0x168')});db[_0x900a('0x60')][_0x900a('0x109')](db[_0x900a('0x187')],{'as':_0x900a('0x188')});db[_0x900a('0x60')][_0x900a('0x109')](db['ChatInteraction'],{'as':_0x900a('0x159')});db[_0x900a('0x60')][_0x900a('0x109')](db[_0x900a('0x63')],{'as':'Applications'});db['ChatWebsite']['hasMany'](db[_0x900a('0x67')],{'as':_0x900a('0x14c')});db[_0x900a('0x60')][_0x900a('0x116')](db[_0x900a('0xef')],{'as':_0x900a('0x170'),'foreignKey':_0x900a('0x15a')});db[_0x900a('0x60')][_0x900a('0x116')](db[_0x900a('0x82')],{'as':'Interval','foreignKey':_0x900a('0x16b')});db[_0x900a('0x60')]['belongsTo'](db[_0x900a('0x37')],{'as':_0x900a('0x37'),'foreignKey':_0x900a('0x157')});db[_0x900a('0x60')]['belongsTo'](db['Pause'],{'as':_0x900a('0x146'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x900a('0x60')]['belongsToMany'](db[_0x900a('0x12')],{'as':_0x900a('0x15d'),'through':_0x900a('0x12c')});db[_0x900a('0x62')][_0x900a('0x116')](db[_0x900a('0x59')],{});db['OpenchannelQueueReport']['belongsTo'](db['CmList'],{'as':_0x900a('0x170'),'foreignKey':_0x900a('0x15a')});db[_0x900a('0x62')][_0x900a('0x116')](db[_0x900a('0x6f')],{'as':_0x900a('0x161'),'foreignKey':_0x900a('0x152')});db['OpenchannelQueueReport'][_0x900a('0x116')](db[_0x900a('0x10f')],{});db[_0x900a('0x62')][_0x900a('0x116')](db[_0x900a('0x5d')],{});db[_0x900a('0x62')]['belongsTo'](db[_0x900a('0x12')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x900a('0x5f')],{});db[_0x900a('0x63')][_0x900a('0x116')](db[_0x900a('0x12')],{'as':_0x900a('0x189'),'foreignKey':_0x900a('0x10b'),'onDelete':_0x900a('0x16a')});db[_0x900a('0x63')][_0x900a('0x116')](db[_0x900a('0x6a')],{'as':_0x900a('0x18a'),'foreignKey':_0x900a('0x18b'),'onDelete':_0x900a('0x16a')});db[_0x900a('0x63')][_0x900a('0x116')](db[_0x900a('0x60')],{'as':_0x900a('0x18c'),'foreignKey':_0x900a('0x168'),'onDelete':'restrict'});db[_0x900a('0x63')][_0x900a('0x116')](db[_0x900a('0x163')],{'onDelete':_0x900a('0x16a'),'foreignKey':_0x900a('0x171')});db['ChatInteraction'][_0x900a('0x109')](db[_0x900a('0x67')],{'as':_0x900a('0x14c'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x18d')});db[_0x900a('0x65')][_0x900a('0x116')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x900a('0x168')});db[_0x900a('0x65')]['belongsTo'](db[_0x900a('0x6f')],{'as':_0x900a('0x161'),'foreignKey':_0x900a('0x152')});db['ChatInteraction'][_0x900a('0x116')](db['User'],{'as':_0x900a('0x162'),'foreignKey':_0x900a('0x10b')});db['ChatInteraction']['belongsToMany'](db[_0x900a('0x163')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0x900a('0x65')][_0x900a('0x118')](db[_0x900a('0x163')],{'through':_0x900a('0x18e'),'as':'ThroughTags'});db[_0x900a('0x65')][_0x900a('0x118')](db[_0x900a('0x12')],{'as':_0x900a('0x166'),'through':_0x900a('0x18f'),'foreignKey':_0x900a('0x18d')});db[_0x900a('0x67')]['belongsTo'](db[_0x900a('0x12')],{'onDelete':_0x900a('0x13b'),'as':_0x900a('0x12')});db['ChatMessage']['belongsTo'](db[_0x900a('0x6f')],{'onDelete':_0x900a('0x13b'),'as':_0x900a('0x161'),'foreignKey':_0x900a('0x152')});db[_0x900a('0x67')]['belongsTo'](db[_0x900a('0x65')],{'onDelete':_0x900a('0x13b'),'as':_0x900a('0x167'),'foreignKey':_0x900a('0x18d')});db[_0x900a('0x67')][_0x900a('0x116')](db['Attachment'],{'as':_0x900a('0x175'),'foreignKey':_0x900a('0x176')});db[_0x900a('0x67')]['belongsTo'](db[_0x900a('0x60')],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x168')});db[_0x900a('0x69')][_0x900a('0x109')](db[_0x900a('0x175')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x900a('0x13b'),'hooks':!![]});db[_0x900a('0x69')][_0x900a('0x116')](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':_0x900a('0x152')});db[_0x900a('0x69')][_0x900a('0x116')](db[_0x900a('0x60')],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x168')});db[_0x900a('0x6a')][_0x900a('0x118')](db['User'],{'as':_0x900a('0x15d'),'through':'UserChatQueue','hooks':!![]});db[_0x900a('0x6a')][_0x900a('0x118')](db[_0x900a('0xe1')],{'through':_0x900a('0x190'),'as':_0x900a('0x148')});db[_0x900a('0x6c')][_0x900a('0x109')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0x900a('0x13b')});db[_0x900a('0x6c')][_0x900a('0x118')](db[_0x900a('0x12')],{'as':_0x900a('0x13f'),'through':_0x900a('0x119')});db[_0x900a('0x187')][_0x900a('0x116')](db['ChatWebsite'],{'as':_0x900a('0x18c'),'foreignKey':_0x900a('0x168')});db[_0x900a('0x191')]['hasMany'](db['CmContact'],{'as':_0x900a('0x11a'),'foreignKey':_0x900a('0x192')});db[_0x900a('0x6f')][_0x900a('0x109')](db['CmHopper'],{'as':_0x900a('0x140'),'foreignKey':_0x900a('0x152')});db[_0x900a('0x6f')][_0x900a('0x109')](db[_0x900a('0x73')],{'as':_0x900a('0x10d'),'foreignKey':_0x900a('0x152')});db['CmContact']['hasMany'](db[_0x900a('0x74')],{'as':_0x900a('0x142'),'foreignKey':'ContactId'});db[_0x900a('0x6f')][_0x900a('0x109')](db[_0x900a('0x76')],{'as':_0x900a('0x76'),'foreignKey':'ContactId'});db[_0x900a('0x6f')][_0x900a('0x109')](db[_0x900a('0xd1')],{'as':'JscriptySessions','foreignKey':_0x900a('0x152')});db[_0x900a('0x6f')][_0x900a('0x109')](db[_0x900a('0x10f')],{'as':_0x900a('0x110'),'foreignKey':'ContactId','onDelete':_0x900a('0x16a')});db[_0x900a('0x6f')]['hasMany'](db[_0x900a('0x65')],{'as':_0x900a('0x11e'),'foreignKey':_0x900a('0x152'),'onDelete':_0x900a('0x16a')});db[_0x900a('0x6f')][_0x900a('0x109')](db[_0x900a('0x54')],{'as':_0x900a('0x111'),'foreignKey':_0x900a('0x152'),'onDelete':_0x900a('0x16a')});db[_0x900a('0x6f')]['hasMany'](db[_0x900a('0x4a')],{'as':_0x900a('0x193'),'foreignKey':'ContactId','onDelete':_0x900a('0x16a')});db[_0x900a('0x6f')][_0x900a('0x109')](db[_0x900a('0x3c')],{'as':'MailInteractions','foreignKey':_0x900a('0x152'),'onDelete':_0x900a('0x16a')});db[_0x900a('0x6f')][_0x900a('0x116')](db[_0x900a('0x191')],{'as':_0x900a('0x194'),'foreignKey':_0x900a('0x192')});db[_0x900a('0x6f')][_0x900a('0x116')](db[_0x900a('0xef')],{'as':_0x900a('0x170'),'foreignKey':'ListId','onDelete':_0x900a('0x13b')});db[_0x900a('0x6f')][_0x900a('0x118')](db['User'],{'as':_0x900a('0x166'),'through':_0x900a('0x195')});db[_0x900a('0x6f')][_0x900a('0x118')](db['Tag'],{'as':'Tags','through':_0x900a('0x196')});db[_0x900a('0x6f')]['belongsToMany'](db[_0x900a('0x163')],{'through':_0x900a('0x196'),'as':'ThroughTags'});db[_0x900a('0x71')][_0x900a('0x116')](db['CmContact'],{'as':_0x900a('0x161'),'foreignKey':'ContactId','onDelete':_0x900a('0x13b')});db['CmHopper'][_0x900a('0x116')](db[_0x900a('0xef')],{'as':_0x900a('0x170'),'foreignKey':'ListId','onDelete':_0x900a('0x13b')});db[_0x900a('0x71')][_0x900a('0x116')](db[_0x900a('0x12')],{'as':_0x900a('0x189'),'foreignKey':_0x900a('0x10b')});db[_0x900a('0x71')][_0x900a('0x116')](db['VoiceQueue'],{'as':_0x900a('0x18a'),'foreignKey':_0x900a('0x141'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x71')][_0x900a('0x116')](db[_0x900a('0xe3')],{'as':'Campaign','foreignKey':_0x900a('0x197'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x71')]['belongsTo'](db[_0x900a('0x12')],{'as':_0x900a('0x162'),'foreignKey':_0x900a('0x198')});db[_0x900a('0x143')][_0x900a('0x116')](db[_0x900a('0x6f')],{'as':_0x900a('0x161'),'foreignKey':_0x900a('0x152'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x143')][_0x900a('0x116')](db['CmList'],{'as':_0x900a('0x170'),'foreignKey':_0x900a('0x15a'),'onDelete':'cascade'});db[_0x900a('0x143')][_0x900a('0x116')](db['VoiceQueue'],{'as':_0x900a('0x18a'),'foreignKey':_0x900a('0x141'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x143')][_0x900a('0x116')](db[_0x900a('0xe3')],{'as':_0x900a('0xe3'),'foreignKey':_0x900a('0x197'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x7c')][_0x900a('0x109')](db[_0x900a('0x80')],{'as':{'plural':'All','singular':_0x900a('0x199')},'foreignKey':_0x900a('0x19a'),'onDelete':'cascade','hooks':!![]});db[_0x900a('0x7c')][_0x900a('0x109')](db[_0x900a('0x80')],{'as':{'plural':_0x900a('0x19b'),'singular':_0x900a('0x19c')},'foreignKey':_0x900a('0x19d'),'onDelete':_0x900a('0x13b'),'hooks':!![]});db[_0x900a('0x7c')][_0x900a('0x109')](db[_0x900a('0x7a')],{'as':_0x900a('0x19e'),'foreignKey':_0x900a('0x19f'),'onDelete':_0x900a('0x13b'),'hooks':!![]});db[_0x900a('0x156')]['hasMany'](db['Disposition'],{'as':_0x900a('0x16d'),'foreignKey':_0x900a('0x1a0'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x82')]['hasMany'](db[_0x900a('0x82')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x900a('0x13b'),'hooks':!![],'required':![]});db[_0x900a('0x82')][_0x900a('0x109')](db[_0x900a('0x17')],{'as':'Extensions','foreignKey':_0x900a('0x16b'),'onDelete':_0x900a('0x16a')});db[_0x900a('0x82')][_0x900a('0x109')](db[_0x900a('0x40')],{'as':_0x900a('0x1a1'),'foreignKey':_0x900a('0x16b')});db[_0x900a('0x82')]['hasMany'](db[_0x900a('0x63')],{'as':_0x900a('0x1a2'),'foreignKey':_0x900a('0x16b')});db[_0x900a('0x82')]['hasMany'](db['FaxApplication'],{'as':_0x900a('0x1a3'),'foreignKey':_0x900a('0x16b')});db['Interval'][_0x900a('0x109')](db[_0x900a('0x52')],{'as':'SmsApplications','foreignKey':_0x900a('0x16b')});db[_0x900a('0x88')][_0x900a('0x116')](db[_0x900a('0x37')],{});db[_0x900a('0x88')]['belongsTo'](db[_0x900a('0x98')],{'foreignKey':'DefaultReportId'});db[_0x900a('0x88')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x900a('0x1a4')});db[_0x900a('0x8a')][_0x900a('0x118')](db[_0x900a('0x13d')],{'as':_0x900a('0x1a5'),'through':'moh_has_sounds','onDelete':_0x900a('0x16a')});db['Tag'][_0x900a('0x118')](db[_0x900a('0x6f')],{'through':_0x900a('0x196')});db[_0x900a('0x163')][_0x900a('0x118')](db[_0x900a('0x65')],{'through':'chat_interaction_has_tags'});db[_0x900a('0x163')]['belongsToMany'](db[_0x900a('0x3c')],{'through':_0x900a('0x164')});db[_0x900a('0x163')][_0x900a('0x118')](db['SmsInteraction'],{'through':_0x900a('0x17d')});db[_0x900a('0x163')]['belongsToMany'](db[_0x900a('0x4a')],{'through':_0x900a('0x173')});db[_0x900a('0x163')]['belongsToMany'](db[_0x900a('0x10f')],{'through':'openchannel_interaction_has_tags'});db[_0x900a('0x163')]['belongsToMany'](db[_0x900a('0xf9')],{'through':'whatsapp_interaction_has_tags'});db[_0x900a('0x8f')][_0x900a('0x109')](db[_0x900a('0x80')],{'as':{'plural':_0x900a('0x1a6'),'singular':'AllCondition'},'foreignKey':_0x900a('0x1a7'),'onDelete':_0x900a('0x13b'),'hooks':!![]});db[_0x900a('0x8f')][_0x900a('0x109')](db[_0x900a('0x80')],{'as':{'plural':_0x900a('0x1a8'),'singular':_0x900a('0x1a9')},'foreignKey':'TriggerAnyId','onDelete':_0x900a('0x13b'),'hooks':!![]});db[_0x900a('0x8f')][_0x900a('0x109')](db[_0x900a('0x7a')],{'as':_0x900a('0x19e'),'foreignKey':_0x900a('0x1aa'),'onDelete':'cascade','hooks':!![]});db[_0x900a('0x96')][_0x900a('0x109')](db[_0x900a('0x1ab')],{'as':_0x900a('0x1ac'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1a4'),'hooks':!![]});db['AnalyticDefaultReport'][_0x900a('0x109')](db[_0x900a('0x1ab')],{'as':_0x900a('0x1ac'),'onDelete':'cascade','foreignKey':_0x900a('0x1ad')});db['AnalyticMetric'][_0x900a('0x109')](db[_0x900a('0x1ab')],{'as':'Fields','onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1ae')});db[_0x900a('0x1ab')][_0x900a('0x116')](db['AnalyticMetric'],{'foreignKey':_0x900a('0x1ae')});db[_0x900a('0x1af')][_0x900a('0x109')](db[_0x900a('0xa1')],{'as':_0x900a('0x1b0'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b1')});db['SalesforceConfiguration']['hasMany'](db[_0x900a('0x1b2')],{'as':_0x900a('0x1b3'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b4')});db['SalesforceConfiguration']['hasMany'](db[_0x900a('0x1b2')],{'as':_0x900a('0x1b5'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b6')});db[_0x900a('0xa1')][_0x900a('0x109')](db[_0x900a('0x1b2')],{'as':_0x900a('0x1ac'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b7')});db['SalesforceConfiguration'][_0x900a('0x116')](db[_0x900a('0x1af')],{'as':'Account','foreignKey':'AccountId'});db[_0x900a('0x1b2')][_0x900a('0x109')](db[_0x900a('0x1b2')],{'as':_0x900a('0x1b8'),'foreignKey':_0x900a('0x1b4')});db[_0x900a('0x1b2')][_0x900a('0x109')](db[_0x900a('0x1b2')],{'as':'Description','foreignKey':_0x900a('0x1b6')});db['SalesforceField'][_0x900a('0x109')](db[_0x900a('0x1b2')],{'as':_0x900a('0x1b9'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0x1b2')][_0x900a('0x116')](db[_0x900a('0x90')],{'as':_0x900a('0x90'),'foreignKey':_0x900a('0x1ba')});db['SugarcrmAccount'][_0x900a('0x109')](db[_0x900a('0x1bb')],{'as':_0x900a('0x1b0'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0x1bb')]['hasMany'](db[_0x900a('0xa4')],{'as':_0x900a('0x1b3'),'onDelete':'cascade','foreignKey':_0x900a('0x1b4')});db[_0x900a('0x1bb')][_0x900a('0x109')](db['SugarcrmField'],{'as':_0x900a('0x1b5'),'onDelete':_0x900a('0x13b'),'foreignKey':'DescriptionId'});db[_0x900a('0x1bb')][_0x900a('0x109')](db[_0x900a('0xa4')],{'as':_0x900a('0x1ac'),'onDelete':_0x900a('0x13b'),'foreignKey':'FieldId'});db[_0x900a('0x1bb')][_0x900a('0x116')](db[_0x900a('0x1bc')],{'as':_0x900a('0x160'),'foreignKey':'AccountId'});db[_0x900a('0xa4')][_0x900a('0x109')](db[_0x900a('0xa4')],{'as':_0x900a('0x1b8'),'foreignKey':_0x900a('0x1b4')});db['SugarcrmField']['hasMany'](db[_0x900a('0xa4')],{'as':_0x900a('0x1bd'),'foreignKey':'DescriptionId'});db[_0x900a('0xa4')]['hasMany'](db[_0x900a('0xa4')],{'as':_0x900a('0x1b9'),'foreignKey':'FieldId'});db[_0x900a('0xa4')][_0x900a('0x116')](db[_0x900a('0x90')],{'as':_0x900a('0x90'),'foreignKey':_0x900a('0x1ba')});db['DeskAccount']['hasMany'](db[_0x900a('0xa8')],{'as':_0x900a('0x1b0'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0xa8')]['hasMany'](db[_0x900a('0xa9')],{'as':_0x900a('0x1b3'),'onDelete':'cascade','foreignKey':_0x900a('0x1b4')});db[_0x900a('0xa8')]['hasMany'](db['DeskField'],{'as':_0x900a('0x1b5'),'onDelete':'cascade','foreignKey':_0x900a('0x1b6')});db[_0x900a('0xa8')]['hasMany'](db[_0x900a('0xa9')],{'as':_0x900a('0x1ac'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xa8')][_0x900a('0x116')](db['DeskAccount'],{'as':_0x900a('0x160'),'foreignKey':'AccountId'});db[_0x900a('0xa8')][_0x900a('0x118')](db[_0x900a('0x163')],{'through':_0x900a('0x1be')});db['DeskField']['hasMany'](db[_0x900a('0xa9')],{'as':'Subject','foreignKey':_0x900a('0x1b4')});db[_0x900a('0xa9')][_0x900a('0x109')](db[_0x900a('0xa9')],{'as':_0x900a('0x1bd'),'foreignKey':_0x900a('0x1b6')});db[_0x900a('0xa9')][_0x900a('0x109')](db[_0x900a('0xa9')],{'as':_0x900a('0x1b9'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xa9')][_0x900a('0x116')](db[_0x900a('0x90')],{'as':'Variable','foreignKey':_0x900a('0x1ba')});db['ZohoAccount'][_0x900a('0x109')](db[_0x900a('0xab')],{'as':_0x900a('0x1b0'),'onDelete':'cascade','foreignKey':_0x900a('0x1b1')});db['ZohoConfiguration'][_0x900a('0x109')](db[_0x900a('0xac')],{'as':_0x900a('0x1b3'),'onDelete':'cascade','foreignKey':_0x900a('0x1b4')});db[_0x900a('0xab')]['hasMany'](db[_0x900a('0xac')],{'as':_0x900a('0x1b5'),'onDelete':'cascade','foreignKey':_0x900a('0x1b6')});db[_0x900a('0xab')][_0x900a('0x109')](db[_0x900a('0xac')],{'as':_0x900a('0x1ac'),'onDelete':_0x900a('0x13b'),'foreignKey':'FieldId'});db[_0x900a('0xab')]['belongsTo'](db[_0x900a('0x1bf')],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0xac')][_0x900a('0x109')](db[_0x900a('0xac')],{'as':_0x900a('0x1b8'),'foreignKey':_0x900a('0x1b4')});db[_0x900a('0xac')][_0x900a('0x109')](db[_0x900a('0xac')],{'as':_0x900a('0x1bd'),'foreignKey':_0x900a('0x1b6')});db['ZohoField'][_0x900a('0x109')](db[_0x900a('0xac')],{'as':_0x900a('0x1b9'),'foreignKey':_0x900a('0x1b7')});db['ZohoField']['belongsTo'](db[_0x900a('0x90')],{'as':_0x900a('0x90'),'foreignKey':_0x900a('0x1ba')});db['ZendeskAccount'][_0x900a('0x109')](db[_0x900a('0xaf')],{'as':_0x900a('0x1b0'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b1')});db['ZendeskConfiguration']['hasMany'](db[_0x900a('0x1c0')],{'as':_0x900a('0x1b3'),'foreignKey':_0x900a('0x1b4')});db[_0x900a('0xaf')][_0x900a('0x109')](db[_0x900a('0x1c0')],{'as':_0x900a('0x1b5'),'foreignKey':_0x900a('0x1b6')});db[_0x900a('0xaf')][_0x900a('0x109')](db[_0x900a('0x1c0')],{'as':_0x900a('0x1ac'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xaf')]['belongsTo'](db[_0x900a('0x1c1')],{'as':_0x900a('0x160'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db[_0x900a('0x163')],{'through':_0x900a('0x1c2')});db['ZendeskField'][_0x900a('0x109')](db['ZendeskField'],{'as':_0x900a('0x1b8'),'foreignKey':_0x900a('0x1b4')});db[_0x900a('0x1c0')][_0x900a('0x109')](db[_0x900a('0x1c0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x900a('0x1c0')][_0x900a('0x109')](db['ZendeskField'],{'as':_0x900a('0x1b9'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0x1c0')][_0x900a('0x116')](db[_0x900a('0x90')],{'as':_0x900a('0x90'),'foreignKey':_0x900a('0x1ba')});db['FreshdeskAccount'][_0x900a('0x109')](db[_0x900a('0xb2')],{'as':_0x900a('0x1b0'),'onDelete':'cascade','foreignKey':_0x900a('0x1b1')});db[_0x900a('0xb2')]['hasMany'](db[_0x900a('0x1c3')],{'as':_0x900a('0x1b3'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b4')});db[_0x900a('0xb2')]['hasMany'](db['FreshdeskField'],{'as':_0x900a('0x1b5'),'onDelete':'cascade','foreignKey':_0x900a('0x1b6')});db[_0x900a('0xb2')][_0x900a('0x109')](db['FreshdeskField'],{'as':_0x900a('0x1ac'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xb2')][_0x900a('0x116')](db['FreshdeskAccount'],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0xb2')][_0x900a('0x118')](db[_0x900a('0x163')],{'through':_0x900a('0x1c4')});db[_0x900a('0x1c3')][_0x900a('0x109')](db[_0x900a('0x1c3')],{'as':_0x900a('0x1b8'),'foreignKey':_0x900a('0x1b4')});db['FreshdeskField'][_0x900a('0x109')](db[_0x900a('0x1c3')],{'as':_0x900a('0x1bd'),'foreignKey':_0x900a('0x1b6')});db[_0x900a('0x1c3')]['hasMany'](db[_0x900a('0x1c3')],{'as':_0x900a('0x1b9'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0x1c3')][_0x900a('0x116')](db['Variable'],{'as':'Variable','foreignKey':_0x900a('0x1ba')});db[_0x900a('0xb5')][_0x900a('0x109')](db[_0x900a('0xb7')],{'as':_0x900a('0x1b0'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0xb7')]['hasMany'](db[_0x900a('0xb9')],{'as':_0x900a('0x1b3'),'foreignKey':_0x900a('0x1b4')});db[_0x900a('0xb7')][_0x900a('0x109')](db[_0x900a('0xb9')],{'as':_0x900a('0x1b5'),'foreignKey':_0x900a('0x1b6')});db[_0x900a('0xb7')][_0x900a('0x109')](db[_0x900a('0xb9')],{'as':_0x900a('0x1ac'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xb7')][_0x900a('0x116')](db[_0x900a('0xb5')],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0xb9')][_0x900a('0x109')](db['VtigerField'],{'as':_0x900a('0x1b8'),'foreignKey':'SubjectId'});db[_0x900a('0xb9')]['hasMany'](db[_0x900a('0xb9')],{'as':_0x900a('0x1bd'),'foreignKey':'DescriptionId'});db[_0x900a('0xb9')][_0x900a('0x109')](db[_0x900a('0xb9')],{'as':_0x900a('0x1b9'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xb9')]['belongsTo'](db[_0x900a('0x90')],{'as':'Variable','foreignKey':'VariableId'});db[_0x900a('0xbb')][_0x900a('0x109')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0xbc')]['hasMany'](db[_0x900a('0xbe')],{'as':'Subjects','foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0x900a('0x109')](db[_0x900a('0xbe')],{'as':'Descriptions','foreignKey':_0x900a('0x1b6')});db['ServicenowConfiguration'][_0x900a('0x109')](db[_0x900a('0xbe')],{'as':_0x900a('0x1ac'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xbc')]['belongsTo'](db[_0x900a('0xbb')],{'as':'Account','foreignKey':_0x900a('0x1b1')});db[_0x900a('0xbe')]['hasMany'](db[_0x900a('0xbe')],{'as':_0x900a('0x1b8'),'foreignKey':_0x900a('0x1b4')});db['ServicenowField'][_0x900a('0x109')](db[_0x900a('0xbe')],{'as':_0x900a('0x1bd'),'foreignKey':'DescriptionId'});db[_0x900a('0xbe')][_0x900a('0x109')](db[_0x900a('0xbe')],{'as':_0x900a('0x1b9'),'foreignKey':_0x900a('0x1b7')});db['ServicenowField']['belongsTo'](db[_0x900a('0x90')],{'as':_0x900a('0x90'),'foreignKey':_0x900a('0x1ba')});db['Dynamics365Account'][_0x900a('0x109')](db[_0x900a('0xc1')],{'as':_0x900a('0x1b0'),'onDelete':'cascade','foreignKey':_0x900a('0x1b1')});db['Dynamics365Configuration'][_0x900a('0x109')](db[_0x900a('0xc2')],{'as':_0x900a('0x1b3'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b4')});db[_0x900a('0xc1')][_0x900a('0x109')](db[_0x900a('0xc2')],{'as':_0x900a('0x1b5'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b6')});db[_0x900a('0xc1')][_0x900a('0x109')](db[_0x900a('0xc2')],{'as':'Fields','onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xc1')][_0x900a('0x116')](db[_0x900a('0xbf')],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0xc2')][_0x900a('0x109')](db[_0x900a('0xc2')],{'as':'Subject','foreignKey':_0x900a('0x1b4')});db[_0x900a('0xc2')][_0x900a('0x109')](db[_0x900a('0xc2')],{'as':'Description','foreignKey':_0x900a('0x1b6')});db['Dynamics365Field'][_0x900a('0x109')](db[_0x900a('0xc2')],{'as':'Field','foreignKey':_0x900a('0x1b7')});db[_0x900a('0xc2')][_0x900a('0x116')](db[_0x900a('0x90')],{'as':_0x900a('0x90'),'foreignKey':_0x900a('0x1ba')});db[_0x900a('0x1c5')][_0x900a('0x109')](db[_0x900a('0xc5')],{'as':_0x900a('0x1b0'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0xc5')][_0x900a('0x109')](db['FreshsalesField'],{'as':_0x900a('0x1b3'),'foreignKey':_0x900a('0x1b4')});db[_0x900a('0xc5')]['hasMany'](db[_0x900a('0xc7')],{'as':_0x900a('0x1b5'),'foreignKey':_0x900a('0x1b6')});db[_0x900a('0xc5')][_0x900a('0x109')](db[_0x900a('0xc7')],{'as':_0x900a('0x1ac'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xc5')]['belongsTo'](db[_0x900a('0x1c5')],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x1b1')});db[_0x900a('0xc7')]['hasMany'](db[_0x900a('0xc7')],{'as':_0x900a('0x1b8'),'foreignKey':'SubjectId'});db[_0x900a('0xc7')][_0x900a('0x109')](db[_0x900a('0xc7')],{'as':_0x900a('0x1bd'),'foreignKey':'DescriptionId'});db[_0x900a('0xc7')][_0x900a('0x109')](db[_0x900a('0xc7')],{'as':_0x900a('0x1b9'),'foreignKey':_0x900a('0x1b7')});db[_0x900a('0xc7')][_0x900a('0x116')](db[_0x900a('0x90')],{'as':'Variable','foreignKey':_0x900a('0x1ba')});db['ChatQueueReport'][_0x900a('0x116')](db['ChatWebsite'],{});db[_0x900a('0xc9')][_0x900a('0x116')](db[_0x900a('0xef')],{'as':_0x900a('0x170'),'foreignKey':_0x900a('0x15a')});db['ChatQueueReport'][_0x900a('0x116')](db[_0x900a('0x6f')],{'as':_0x900a('0x161'),'foreignKey':'ContactId'});db[_0x900a('0xc9')][_0x900a('0x116')](db[_0x900a('0x65')],{});db['ChatQueueReport']['belongsTo'](db[_0x900a('0x67')],{});db[_0x900a('0xc9')][_0x900a('0x116')](db[_0x900a('0x12')],{});db['ChatQueueReport'][_0x900a('0x116')](db['ChatQueue'],{});db[_0x900a('0xcb')][_0x900a('0x116')](db[_0x900a('0x12')],{'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1c6')});db['ChatInternalMessage'][_0x900a('0x116')](db[_0x900a('0x12')],{'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x1c7')});db[_0x900a('0xd1')][_0x900a('0x109')](db[_0x900a('0xcf')],{'foreignKey':_0x900a('0x1c8'),'onDelete':'cascade'});db[_0x900a('0xd1')][_0x900a('0x109')](db[_0x900a('0xcd')],{'foreignKey':_0x900a('0x1c8'),'onDelete':_0x900a('0x13b')});db[_0x900a('0xd2')][_0x900a('0x116')](db[_0x900a('0x133')],{});db[_0x900a('0xd2')][_0x900a('0x116')](db[_0x900a('0xef')],{'as':_0x900a('0x170'),'foreignKey':_0x900a('0x15a')});db['SmsQueueReport'][_0x900a('0x116')](db['CmContact'],{'as':'Contact','foreignKey':_0x900a('0x152')});db['SmsQueueReport']['belongsTo'](db[_0x900a('0x54')],{});db['SmsQueueReport'][_0x900a('0x116')](db[_0x900a('0x179')],{});db[_0x900a('0xd2')][_0x900a('0x116')](db[_0x900a('0x12')],{});db[_0x900a('0xd2')][_0x900a('0x116')](db[_0x900a('0x57')],{});db[_0x900a('0xd6')][_0x900a('0x109')](db[_0x900a('0xd1')],{'foreignKey':_0x900a('0x1c9')});db['JscriptyProject']['hasMany'](db[_0x900a('0xcf')],{'foreignKey':_0x900a('0x1c9')});db[_0x900a('0xd6')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x900a('0x1c9')});db['SquareProject']['belongsToMany'](db[_0x900a('0x12')],{'as':_0x900a('0x166'),'through':_0x900a('0x139')});db['Team'][_0x900a('0x118')](db[_0x900a('0x12')],{'as':_0x900a('0x15d'),'through':_0x900a('0x1ca')});db[_0x900a('0xe1')][_0x900a('0x118')](db[_0x900a('0x121')],{'through':_0x900a('0x103'),'as':_0x900a('0x122')});db['Team']['belongsToMany'](db[_0x900a('0x39')],{'through':'team_has_mail_queues','as':_0x900a('0x123')});db['Team'][_0x900a('0x118')](db[_0x900a('0x6a')],{'through':_0x900a('0x190'),'as':_0x900a('0x124')});db[_0x900a('0xe1')][_0x900a('0x118')](db[_0x900a('0x4d')],{'through':_0x900a('0x177'),'as':_0x900a('0x125')});db[_0x900a('0xe1')][_0x900a('0x118')](db['SmsQueue'],{'through':_0x900a('0x17e'),'as':_0x900a('0x126')});db[_0x900a('0xe1')][_0x900a('0x118')](db['OpenchannelQueue'],{'through':_0x900a('0x1cb'),'as':'OpenchannelQueues'});db[_0x900a('0xe1')][_0x900a('0x118')](db[_0x900a('0x129')],{'through':_0x900a('0x1cc'),'as':_0x900a('0x12a')});db[_0x900a('0xe1')][_0x900a('0x118')](db[_0x900a('0xf1')],{'through':'TeamVoicePrefix','as':_0x900a('0x1cd')});db[_0x900a('0xe3')][_0x900a('0x109')](db['CmHopper'],{'as':_0x900a('0x140'),'foreignKey':_0x900a('0x197')});db[_0x900a('0xe3')]['hasMany'](db[_0x900a('0x73')],{'as':_0x900a('0x10d'),'foreignKey':_0x900a('0x197')});db[_0x900a('0xe3')][_0x900a('0x109')](db[_0x900a('0x74')],{'as':_0x900a('0x142'),'foreignKey':'CampaignId'});db['Campaign'][_0x900a('0x109')](db[_0x900a('0x143')],{'as':_0x900a('0x144'),'foreignKey':_0x900a('0x197')});db['Campaign'][_0x900a('0x116')](db[_0x900a('0x26')],{'as':_0x900a('0x26'),'foreignKey':_0x900a('0x145')});db[_0x900a('0xe3')][_0x900a('0x116')](db[_0x900a('0x26')],{'as':_0x900a('0x1ce'),'foreignKey':_0x900a('0x1cf')});db[_0x900a('0xe3')][_0x900a('0x116')](db[_0x900a('0x82')],{'as':_0x900a('0x82'),'foreignKey':_0x900a('0x16b')});db[_0x900a('0xe3')][_0x900a('0x116')](db[_0x900a('0xdc')],{'as':_0x900a('0xdc'),'foreignKey':_0x900a('0x1d0')});db[_0x900a('0xe3')]['belongsToMany'](db['CmList'],{'as':_0x900a('0x11b'),'through':'campaigns_has_cm_lists'});db['Campaign']['belongsToMany'](db[_0x900a('0xef')],{'as':_0x900a('0x149'),'through':_0x900a('0x1d1')});db[_0x900a('0x175')]['belongsTo'](db[_0x900a('0x69')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db['MailTransferReport']['belongsTo'](db[_0x900a('0x3e')],{});db['MailTransferReport'][_0x900a('0x116')](db[_0x900a('0x3c')],{});db[_0x900a('0xe8')]['belongsTo'](db[_0x900a('0x37')],{'foreignKey':'FromMailAccountId','as':_0x900a('0x1d2')});db[_0x900a('0xe8')]['belongsTo'](db[_0x900a('0x12')],{'foreignKey':_0x900a('0x1d3'),'as':_0x900a('0x1d4')});db[_0x900a('0xe8')][_0x900a('0x116')](db[_0x900a('0x12')],{'foreignKey':_0x900a('0x1d5'),'as':'ToAgent'});db[_0x900a('0xe8')][_0x900a('0x116')](db[_0x900a('0x39')],{'foreignKey':_0x900a('0x1d6'),'as':_0x900a('0x1d7')});db[_0x900a('0xe8')][_0x900a('0x116')](db[_0x900a('0x37')],{'foreignKey':'ToMailAccountId','as':_0x900a('0x1d8')});db[_0x900a('0xe9')][_0x900a('0x116')](db[_0x900a('0x67')],{});db['ChatTransferReport'][_0x900a('0x116')](db[_0x900a('0x65')],{});db['ChatTransferReport'][_0x900a('0x116')](db['ChatWebsite'],{'foreignKey':_0x900a('0x1d9'),'as':_0x900a('0x1d2')});db['ChatTransferReport'][_0x900a('0x116')](db[_0x900a('0x12')],{'foreignKey':'FromUserId','as':_0x900a('0x1d4')});db['ChatTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x900a('0x1d5'),'as':_0x900a('0x1da')});db[_0x900a('0xe9')][_0x900a('0x116')](db[_0x900a('0x6a')],{'foreignKey':_0x900a('0x1db'),'as':'ToQueue'});db[_0x900a('0xe9')][_0x900a('0x116')](db[_0x900a('0x60')],{'foreignKey':'ToChatWebsiteId','as':_0x900a('0x1d8')});db[_0x900a('0xea')][_0x900a('0x116')](db['FaxMessage'],{});db['FaxTransferReport'][_0x900a('0x116')](db[_0x900a('0x4a')],{});db['FaxTransferReport'][_0x900a('0x116')](db[_0x900a('0x12d')],{'foreignKey':'FromFaxAccountId','as':_0x900a('0x1d2')});db['FaxTransferReport'][_0x900a('0x116')](db[_0x900a('0x12')],{'foreignKey':_0x900a('0x1d3'),'as':_0x900a('0x1d4')});db[_0x900a('0xea')][_0x900a('0x116')](db['User'],{'foreignKey':'ToUserId','as':_0x900a('0x1da')});db[_0x900a('0xea')][_0x900a('0x116')](db[_0x900a('0x4d')],{'foreignKey':_0x900a('0x1dc'),'as':'ToQueue'});db['FaxTransferReport'][_0x900a('0x116')](db[_0x900a('0x12d')],{'foreignKey':_0x900a('0x1dd'),'as':_0x900a('0x1d8')});db[_0x900a('0xec')][_0x900a('0x116')](db[_0x900a('0x5d')],{});db['OpenchannelTransferReport'][_0x900a('0x116')](db['OpenchannelInteraction'],{});db[_0x900a('0xec')]['belongsTo'](db[_0x900a('0x59')],{'foreignKey':'FromOpenchannelAccountId','as':_0x900a('0x1d2')});db['OpenchannelTransferReport'][_0x900a('0x116')](db[_0x900a('0x12')],{'foreignKey':_0x900a('0x1d3'),'as':_0x900a('0x1d4')});db[_0x900a('0xec')][_0x900a('0x116')](db['User'],{'foreignKey':_0x900a('0x1d5'),'as':_0x900a('0x1da')});db[_0x900a('0xec')][_0x900a('0x116')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db['OpenchannelTransferReport']['belongsTo'](db[_0x900a('0x59')],{'foreignKey':_0x900a('0x1de'),'as':_0x900a('0x1d8')});db['SmsTransferReport'][_0x900a('0x116')](db[_0x900a('0x179')],{});db[_0x900a('0xee')][_0x900a('0x116')](db[_0x900a('0x54')],{});db[_0x900a('0xee')][_0x900a('0x116')](db[_0x900a('0x133')],{'foreignKey':_0x900a('0x1df'),'as':_0x900a('0x1d2')});db[_0x900a('0xee')]['belongsTo'](db[_0x900a('0x12')],{'foreignKey':'FromUserId','as':_0x900a('0x1d4')});db[_0x900a('0xee')][_0x900a('0x116')](db[_0x900a('0x12')],{'foreignKey':_0x900a('0x1d5'),'as':_0x900a('0x1da')});db['SmsTransferReport'][_0x900a('0x116')](db[_0x900a('0x57')],{'foreignKey':_0x900a('0x1e0'),'as':_0x900a('0x1d7')});db[_0x900a('0xee')][_0x900a('0x116')](db[_0x900a('0x133')],{'foreignKey':_0x900a('0x1e1'),'as':'ToAccount'});db[_0x900a('0xef')]['hasMany'](db['Disposition'],{'as':_0x900a('0x16d'),'foreignKey':_0x900a('0x15a'),'onDelete':'cascade'});db[_0x900a('0xef')]['hasMany'](db[_0x900a('0x78')],{'as':'CustomFields','foreignKey':_0x900a('0x15a')});db[_0x900a('0xef')]['hasMany'](db[_0x900a('0x6f')],{'as':_0x900a('0x11a'),'onDelete':_0x900a('0x13b'),'foreignKey':_0x900a('0x15a')});db[_0x900a('0xef')][_0x900a('0x109')](db[_0x900a('0x73')],{'as':_0x900a('0x10d'),'foreignKey':_0x900a('0x15a')});db[_0x900a('0xef')][_0x900a('0x109')](db[_0x900a('0x74')],{'as':_0x900a('0x10e'),'foreignKey':_0x900a('0x15a')});db[_0x900a('0xef')][_0x900a('0x109')](db[_0x900a('0x76')],{'as':_0x900a('0x76'),'foreignKey':_0x900a('0x15a')});db[_0x900a('0xef')][_0x900a('0x118')](db['VoiceQueue'],{'as':_0x900a('0x1e2'),'through':_0x900a('0x147')});db['CmList'][_0x900a('0x118')](db[_0x900a('0x12')],{'as':_0x900a('0x15d'),'through':_0x900a('0x11c')});db['VoicePrefix'][_0x900a('0x109')](db['VoiceExtension'],{'as':'Extensions','onDelete':'cascade'});db[_0x900a('0xf1')][_0x900a('0x118')](db[_0x900a('0x12')],{'as':'Agents','through':_0x900a('0x106')});db[_0x900a('0xf1')][_0x900a('0x118')](db[_0x900a('0xe1')],{'through':_0x900a('0x1e3'),'as':_0x900a('0x148')});db[_0x900a('0x117')][_0x900a('0x109')](db['User'],{'as':'Users','foreignKey':'userProfileId'});db[_0x900a('0x117')][_0x900a('0x109')](db[_0x900a('0xf3')],{'as':_0x900a('0x1e4'),'foreignKey':_0x900a('0x1e5'),'onDelete':_0x900a('0x13b')});db[_0x900a('0xf3')][_0x900a('0x109')](db[_0x900a('0xf4')],{'as':_0x900a('0x1e6'),'foreignKey':_0x900a('0x1e7'),'onDelete':_0x900a('0x13b')});db[_0x900a('0x135')]['hasMany'](db['Disposition'],{'as':_0x900a('0x16d'),'foreignKey':_0x900a('0x1e8'),'onDelete':_0x900a('0x13b')});db['WhatsappAccount'][_0x900a('0x109')](db[_0x900a('0x7e')],{'as':_0x900a('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x900a('0x135')]['hasMany'](db[_0x900a('0x1e9')],{'as':_0x900a('0x14c'),'foreignKey':_0x900a('0x1e8')});db['WhatsappAccount']['hasMany'](db[_0x900a('0xf9')],{'as':'Interactions'});db[_0x900a('0x135')]['hasMany'](db[_0x900a('0x1ea')],{'as':_0x900a('0x13c')});db[_0x900a('0x135')][_0x900a('0x116')](db['CmList'],{'as':_0x900a('0x170'),'foreignKey':'ListId'});db[_0x900a('0x135')]['belongsTo'](db['Pause'],{'as':_0x900a('0x146'),'foreignKey':_0x900a('0x15c')});db['WhatsappAccount'][_0x900a('0x118')](db[_0x900a('0x12')],{'as':_0x900a('0x15d'),'through':_0x900a('0x137')});db[_0x900a('0x1ea')][_0x900a('0x116')](db[_0x900a('0x12')],{'onDelete':'restrict'});db[_0x900a('0x1ea')]['belongsTo'](db[_0x900a('0x129')],{'onDelete':_0x900a('0x16a')});db[_0x900a('0x1ea')]['belongsTo'](db[_0x900a('0x135')],{'onDelete':_0x900a('0x16a')});db[_0x900a('0x1ea')]['belongsTo'](db['Interval'],{'onDelete':_0x900a('0x16a'),'foreignKey':_0x900a('0x16b')});db[_0x900a('0x1ea')][_0x900a('0x116')](db[_0x900a('0x163')],{'onDelete':_0x900a('0x16a'),'foreignKey':'TagId'});db['WhatsappInteraction']['hasMany'](db['WhatsappMessage'],{'as':_0x900a('0x14c'),'onDelete':_0x900a('0x13b'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x900a('0x116')](db[_0x900a('0x135')],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x1e8')});db[_0x900a('0xf9')][_0x900a('0x116')](db[_0x900a('0x6f')],{'as':_0x900a('0x161'),'foreignKey':_0x900a('0x152')});db[_0x900a('0xf9')][_0x900a('0x116')](db[_0x900a('0x12')],{'as':'Owner','foreignKey':_0x900a('0x10b')});db[_0x900a('0xf9')][_0x900a('0x118')](db[_0x900a('0x163')],{'through':'whatsapp_interaction_has_tags','as':_0x900a('0x17c')});db[_0x900a('0xf9')][_0x900a('0x118')](db[_0x900a('0x163')],{'through':_0x900a('0x1eb'),'as':_0x900a('0x165')});db[_0x900a('0xf9')]['belongsToMany'](db[_0x900a('0x12')],{'as':_0x900a('0x166'),'through':_0x900a('0x120'),'foreignKey':_0x900a('0x1ec')});db[_0x900a('0x1e9')][_0x900a('0x116')](db['User'],{'as':'User'});db['WhatsappMessage'][_0x900a('0x116')](db[_0x900a('0x6f')],{'onDelete':_0x900a('0x13b'),'as':_0x900a('0x161')});db[_0x900a('0x1e9')][_0x900a('0x116')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x900a('0x167'),'foreignKey':_0x900a('0x1ec')});db[_0x900a('0x1e9')]['belongsTo'](db['WhatsappAccount'],{'as':_0x900a('0x160'),'foreignKey':_0x900a('0x1e8')});db[_0x900a('0xfc')][_0x900a('0x116')](db[_0x900a('0x135')],{});db[_0x900a('0xfc')][_0x900a('0x116')](db[_0x900a('0xef')],{'as':_0x900a('0x170'),'foreignKey':'ListId'});db[_0x900a('0xfc')][_0x900a('0x116')](db[_0x900a('0x6f')],{'as':_0x900a('0x161'),'foreignKey':_0x900a('0x152')});db[_0x900a('0xfc')][_0x900a('0x116')](db[_0x900a('0xf9')],{});db['WhatsappQueueReport'][_0x900a('0x116')](db[_0x900a('0x129')],{});db['WhatsappQueueReport'][_0x900a('0x116')](db[_0x900a('0x1e9')],{});db[_0x900a('0xfc')][_0x900a('0x116')](db['User'],{});db[_0x900a('0xfe')][_0x900a('0x116')](db[_0x900a('0x1e9')],{});db[_0x900a('0xfe')][_0x900a('0x116')](db['WhatsappInteraction'],{});db[_0x900a('0xfe')][_0x900a('0x116')](db[_0x900a('0x135')],{'foreignKey':_0x900a('0x1ed'),'as':'FromAccount'});db['WhatsappTransferReport']['belongsTo'](db[_0x900a('0x135')],{'foreignKey':_0x900a('0x1ee'),'as':_0x900a('0x1d8')});db[_0x900a('0xfe')][_0x900a('0x116')](db[_0x900a('0x129')],{'foreignKey':_0x900a('0x1ef'),'as':_0x900a('0x1d7')});db[_0x900a('0xfe')]['belongsTo'](db['User'],{'foreignKey':_0x900a('0x1d3'),'as':_0x900a('0x1d4')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x900a('0x1d5'),'as':'ToAgent'});db[_0x900a('0x129')][_0x900a('0x118')](db[_0x900a('0x12')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0x900a('0x1f0')});db[_0x900a('0x129')][_0x900a('0x118')](db['Team'],{'through':_0x900a('0x1cc'),'as':_0x900a('0x148')});module[_0x900a('0x1f1')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb8d8=['Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','Trunk','belongsTo','TrunkBackup','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','UserVoiceQueue','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceCallReport','AgentReports','Contact','ContactId','MailAccountId','hasOne','Smtp','Dispositions','Messages','Interactions','List','ListId','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','MailQueueReport','Items','FaxAccountId','Answers','Exntensions','fax_interaction_has_tags','Users','user_has_fax_interactions','FaxInteractionId','Interaction','AttachmentId','SmsAccountId','SmsMessage','TagId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ChatMessage','ChatQueue','ChatQueueId','Website','ChatInteractionId','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CompanyId','SmsInteractions','Company','cm_contact_has_tags','Agent','Queue','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmField','DeskAccount','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowAccount','ServicenowField','FreshsalesField','FromId','ToId','SessionId','ProjectId','team_has_sms_queues','TrunkId','TrunkBackupId','SquareProjectId','Lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','UserProfileResource','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','lodash','determine','sequelize','motion2','xcall','xC@LL1234','utf8mb4','name','utf8','sequelizeHistory','defaultsDeep','mysql','utf8_general_ci','username','password','options','database','User','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','import','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','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','VoiceQueuesLog','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','cascade','UserId','hasMany','Recordings','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','MailInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','Contacts','cm_user_has_contacts','user_has_teams','user_has_mail_interactions','ChatInteractions','FaxInteractions','WhatsappInteractions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','FaxQueue','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','ChanSpyId','Applications','Sounds','moh_has_sounds'];(function(_0x144f41,_0x4a57b7){var _0x25dae4=function(_0x18c458){while(--_0x18c458){_0x144f41['push'](_0x144f41['shift']());}};_0x25dae4(++_0x4a57b7);}(_0xb8d8,0xbd));var _0x8b8d=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0xb8d8[_0x37a79c];return _0x561d89;};'use strict';var config=require(_0x8b8d('0x0'));var Sequelize=require('sequelize');var _=require(_0x8b8d('0x1'));var jstz=require('jstz');var timezone=jstz[_0x8b8d('0x2')]();config[_0x8b8d('0x3')]=_['defaultsDeep'](config[_0x8b8d('0x3')],{'database':_0x8b8d('0x4'),'username':_0x8b8d('0x5'),'password':_0x8b8d('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x8b8d('0x7')},'logging':![],'timezone':timezone[_0x8b8d('0x8')](),'define':{'charset':_0x8b8d('0x9'),'collate':'utf8_general_ci'}}});config[_0x8b8d('0xa')]=_[_0x8b8d('0xb')](config[_0x8b8d('0xa')],{'database':_0x8b8d('0x4'),'username':_0x8b8d('0x5'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8b8d('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8b8d('0x9'),'collate':_0x8b8d('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8b8d('0x3')]['database'],config[_0x8b8d('0x3')][_0x8b8d('0xe')],config[_0x8b8d('0x3')][_0x8b8d('0xf')],config[_0x8b8d('0x3')][_0x8b8d('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x8b8d('0x11')],config[_0x8b8d('0xa')][_0x8b8d('0xe')],config[_0x8b8d('0xa')][_0x8b8d('0xf')],config[_0x8b8d('0xa')][_0x8b8d('0x10')])};db[_0x8b8d('0x12')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x13'));db[_0x8b8d('0x14')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x15'));db[_0x8b8d('0x16')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/voiceContext/voiceContext.model');db[_0x8b8d('0x18')]=db['sequelize']['import'](_0x8b8d('0x19'));db[_0x8b8d('0x1a')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x1b'));db[_0x8b8d('0x1c')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x1d'));db[_0x8b8d('0x1e')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x1f'));db[_0x8b8d('0x20')]=db['sequelize']['import'](_0x8b8d('0x21'));db[_0x8b8d('0x22')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x23'));db['VoiceMailMessage']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x24'));db[_0x8b8d('0x25')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x26'));db['VoiceAgentReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x27'));db[_0x8b8d('0x28')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x29'));db[_0x8b8d('0x2a')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x2b'));db['Trunk']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x2c'));db['VoiceTransferReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x2d'));db[_0x8b8d('0x2e')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x2f'));db['UserVoiceQueue']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x30'));db[_0x8b8d('0x31')]=db['sequelize'][_0x8b8d('0x17')]('../api/userChatQueue/userChatQueue.model');db[_0x8b8d('0x32')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x33'));db['UserFaxQueue']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x34'));db[_0x8b8d('0x35')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x36'));db[_0x8b8d('0x37')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x8b8d('0x38')]=db['sequelize'][_0x8b8d('0x17')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x8b8d('0x39')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x3a'));db[_0x8b8d('0x3b')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x3c'));db['MailAccount']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x3d'));db[_0x8b8d('0x3e')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x3f'));db['MailSubstatus']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x40'));db[_0x8b8d('0x41')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x42'));db[_0x8b8d('0x43')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x44'));db[_0x8b8d('0x45')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x46'));db['MailQueueReport']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x47'));db[_0x8b8d('0x48')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x49'));db[_0x8b8d('0x4a')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x4b'));db[_0x8b8d('0x4c')]=db[_0x8b8d('0x3')]['import']('../api/faxAccount/faxAccount.model');db[_0x8b8d('0x4d')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x4e'));db[_0x8b8d('0x4f')]=db['sequelize']['import'](_0x8b8d('0x50'));db[_0x8b8d('0x51')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x52'));db['FaxQueue']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x53'));db[_0x8b8d('0x54')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x55'));db[_0x8b8d('0x56')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x57'));db[_0x8b8d('0x58')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x59'));db[_0x8b8d('0x5a')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x5b'));db['SmsMessage']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/smsMessage/smsMessage.model');db[_0x8b8d('0x5c')]=db['sequelize'][_0x8b8d('0x17')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x5d'));db[_0x8b8d('0x5e')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x5f'));db[_0x8b8d('0x60')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x61'));db['OpenchannelMessage']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x62'));db[_0x8b8d('0x63')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/openchannelQueue/openchannelQueue.model');db[_0x8b8d('0x64')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x65'));db[_0x8b8d('0x66')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x67'));db[_0x8b8d('0x68')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/chatApplication/chatApplication.model');db[_0x8b8d('0x69')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x6a'));db['ChatMessage']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/chatMessage/chatMessage.model');db[_0x8b8d('0x6b')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x6c'));db['ChatQueue']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x6d'));db[_0x8b8d('0x6e')]=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x6f'));db[_0x8b8d('0x70')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x71'));db[_0x8b8d('0x72')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x73'));db['CmHopper']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x74'));db[_0x8b8d('0x75')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x76'));db[_0x8b8d('0x77')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x78'));db[_0x8b8d('0x79')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x7a'));db['ReportAgentPreview']=db['sequelize'][_0x8b8d('0x17')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x8b8d('0x7b')]=db[_0x8b8d('0x3')]['import']('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/action/action.model');db[_0x8b8d('0x7c')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x7d'));db[_0x8b8d('0x7e')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x7f'));db[_0x8b8d('0x80')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x81'));db[_0x8b8d('0x82')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x83'));db[_0x8b8d('0x84')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x85'));db[_0x8b8d('0x86')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x87'));db[_0x8b8d('0x88')]=db[_0x8b8d('0x3')]['import']('../api/cdr/cdr.model');db[_0x8b8d('0x89')]=db['sequelize'][_0x8b8d('0x17')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/schedule/schedule.model');db[_0x8b8d('0x8a')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x8b'));db[_0x8b8d('0x8c')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x8d'));db[_0x8b8d('0x8e')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x8f'));db[_0x8b8d('0x90')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x91'));db[_0x8b8d('0x92')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x93'));db[_0x8b8d('0x94')]=db['sequelize'][_0x8b8d('0x17')]('../api/integration/integration.model');db[_0x8b8d('0x95')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x96'));db[_0x8b8d('0x97')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x98'));db['AnalyticDefaultReport']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x99'));db[_0x8b8d('0x9a')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x9b'));db[_0x8b8d('0x9c')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x9d'));db['AnalyticFieldReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x9e'));db['AnalyticTreeReport']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x9f'));db[_0x8b8d('0xa0')]=db[_0x8b8d('0x3')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0x8b8d('0x3')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xa1'));db[_0x8b8d('0xa2')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x8b8d('0xa3')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xa4'));db['SugarcrmField']=db['sequelize']['import']('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xa5'));db[_0x8b8d('0xa6')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xa7'));db[_0x8b8d('0xa8')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xa9'));db[_0x8b8d('0xaa')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xab'));db['ZohoConfiguration']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xac'));db[_0x8b8d('0xad')]=db['sequelize']['import'](_0x8b8d('0xae'));db['ZendeskAccount']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xaf'));db[_0x8b8d('0xb0')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xb1'));db[_0x8b8d('0xb2')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xb3'));db[_0x8b8d('0xb4')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xb5'));db[_0x8b8d('0xb6')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xb7'));db[_0x8b8d('0xb8')]=db['sequelize'][_0x8b8d('0x17')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x8b8d('0xb9')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xba'));db[_0x8b8d('0xbb')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xbc'));db['ServicenowAccount']=db['sequelize'][_0x8b8d('0x17')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x8b8d('0xbd')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xbe'));db['ServicenowField']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/intServicenowField/intServicenowField.model');db[_0x8b8d('0xbf')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xc0'));db[_0x8b8d('0xc1')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xc2'));db[_0x8b8d('0xc3')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xc4'));db[_0x8b8d('0xc5')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xc6'));db[_0x8b8d('0xc7')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xc8'));db['FreshsalesField']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x8b8d('0x94')]=db[_0x8b8d('0x3')]['import']('../api/integration/integration.model');db['Network']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xc9'));db[_0x8b8d('0xca')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xcb'));db[_0x8b8d('0xcc')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xcd'));db[_0x8b8d('0xce')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x8b8d('0xcf')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd0'));db['JscriptySessionReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd1'));db[_0x8b8d('0xd2')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xd3'));db['SquareReport']=db[_0x8b8d('0x3')]['import']('../api/squareReport/squareReport.model');db[_0x8b8d('0xd4')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd5'));db[_0x8b8d('0xd6')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd7'));db[_0x8b8d('0xd8')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd9'));db[_0x8b8d('0xda')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xdb'));db[_0x8b8d('0xdc')]=db['sequelize']['import'](_0x8b8d('0xdd'));db['SquareRecording']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/squareRecording/squareRecording.model');db[_0x8b8d('0xde')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xdf'));db[_0x8b8d('0xe0')]=db['sequelize']['import'](_0x8b8d('0xe1'));db[_0x8b8d('0xe2')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/license/license.model');db[_0x8b8d('0xe3')]=db['sequelize']['import'](_0x8b8d('0xe4'));db[_0x8b8d('0xe5')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xe6'));db[_0x8b8d('0xe7')]=db['sequelize']['import'](_0x8b8d('0xe8'));db[_0x8b8d('0xe9')]=db[_0x8b8d('0x3')]['import']('../api/plugin/plugin.model');db[_0x8b8d('0xea')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xeb'));db[_0x8b8d('0xec')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xed'));db[_0x8b8d('0xee')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xef'));db[_0x8b8d('0xf0')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xf1'));db[_0x8b8d('0xf2')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/cmList/cmList.model');db['VoicePrefix']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xf3'));db[_0x8b8d('0xf4')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xf5'));db[_0x8b8d('0xf6')]=db['sequelize']['import'](_0x8b8d('0xf7'));db['UserProfileResource']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xf8'));db[_0x8b8d('0xf9')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xfa'));db[_0x8b8d('0xfb')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xfc'));db['WhatsappApplication']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/whatsappApplication/whatsappApplication.model');db[_0x8b8d('0xfd')]=db[_0x8b8d('0x3')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0x8b8d('0xfe')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xff'));db[_0x8b8d('0x100')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x101'));db[_0x8b8d('0x102')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x103'));db[_0x8b8d('0x104')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x105'));db[_0x8b8d('0x106')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x107'));db[_0x8b8d('0x108')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x109'));db[_0x8b8d('0x10a')]=db['sequelize']['import'](_0x8b8d('0x10b'));db[_0x8b8d('0x10c')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x10d'));db[_0x8b8d('0x12')]['hasOne'](db[_0x8b8d('0x22')],{'as':_0x8b8d('0x22'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['VoiceRecording'],{'as':_0x8b8d('0x111'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')]['hasMany'](db[_0x8b8d('0x2e')],{'as':'VoiceQueuesRt','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db[_0x8b8d('0x18')],{'as':_0x8b8d('0x112'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['CmHopperFinal'],{'as':_0x8b8d('0x113'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')]['hasMany'](db[_0x8b8d('0x79')],{'as':_0x8b8d('0x114'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['ReportAgentPreview'],{'as':_0x8b8d('0x115'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')]['hasMany'](db[_0x8b8d('0x60')],{'as':_0x8b8d('0x116'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db[_0x8b8d('0x5a')],{'as':'SmsInteractions','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x8b8d('0x10f')});db['User'][_0x8b8d('0x110')](db[_0x8b8d('0x41')],{'as':_0x8b8d('0x117'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db[_0x8b8d('0xfd')],{'as':'WhatsappInteractions','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['UserNotification'],{'as':_0x8b8d('0x118'),'foreignKey':_0x8b8d('0x119')});db[_0x8b8d('0x12')]['belongsTo'](db[_0x8b8d('0xf4')],{'as':_0x8b8d('0xf4'),'foreignKey':_0x8b8d('0x11a')});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['ChatGroup'],{'as':'Groups','through':'chat_group_has_users'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x11c'),'through':_0x8b8d('0x11d')});db[_0x8b8d('0x12')]['belongsToMany'](db['CmList'],{'as':'Lists','through':'cm_user_has_lists'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x11e')});db['User'][_0x8b8d('0x11b')](db['MailInteraction'],{'as':_0x8b8d('0x117'),'through':_0x8b8d('0x11f')});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x69')],{'as':_0x8b8d('0x120'),'through':'user_has_chat_interactions'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x4f')],{'as':_0x8b8d('0x121'),'through':'user_has_fax_interactions'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x5a')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['OpenchannelInteraction'],{'as':_0x8b8d('0x116'),'through':'user_has_openchannel_interactions'});db[_0x8b8d('0x12')]['belongsToMany'](db['WhatsappInteraction'],{'as':_0x8b8d('0x122'),'through':'user_has_whatsapp_interactions'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x1c')],{'as':_0x8b8d('0x123'),'through':'UserVoiceQueue','required':![]});db[_0x8b8d('0x12')]['belongsToMany'](db[_0x8b8d('0x124')],{'as':_0x8b8d('0x125'),'through':_0x8b8d('0x10c'),'required':![]});db[_0x8b8d('0x12')]['belongsToMany'](db[_0x8b8d('0x3e')],{'as':_0x8b8d('0x126'),'through':'UserMailQueue','required':![]});db[_0x8b8d('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0x8b8d('0x127'),'through':_0x8b8d('0x31'),'required':![],'hooks':!![]});db[_0x8b8d('0x12')]['belongsToMany'](db[_0x8b8d('0x128')],{'as':_0x8b8d('0x129'),'through':_0x8b8d('0x12a'),'required':![]});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x5c')],{'as':_0x8b8d('0x12b'),'through':_0x8b8d('0x35'),'required':![]});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x63')],{'as':_0x8b8d('0x12c'),'through':_0x8b8d('0x37'),'required':![]});db['User'][_0x8b8d('0x11b')](db[_0x8b8d('0x104')],{'as':_0x8b8d('0x12d'),'through':_0x8b8d('0x38'),'required':![]});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['CmList'],{'through':_0x8b8d('0x12e')});db['User']['belongsToMany'](db['ChatWebsite'],{'as':_0x8b8d('0x12f'),'through':_0x8b8d('0x130')});db['User'][_0x8b8d('0x11b')](db[_0x8b8d('0x4c')],{'as':_0x8b8d('0x131'),'through':_0x8b8d('0x132')});db['User'][_0x8b8d('0x11b')](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x134'),'through':'user_has_mail_accounts'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x135')],{'as':'OpenchannelAccounts','through':_0x8b8d('0x136')});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['SmsAccount'],{'as':_0x8b8d('0x137'),'through':_0x8b8d('0x138')});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['WhatsappAccount'],{'as':_0x8b8d('0x139'),'through':_0x8b8d('0x13a')});db[_0x8b8d('0x12')]['belongsToMany'](db[_0x8b8d('0xdc')],{'as':'SquareProjects','through':_0x8b8d('0x13b')});db[_0x8b8d('0x14')]['hasMany'](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x13c')});db[_0x8b8d('0x16')][_0x8b8d('0x110')](db[_0x8b8d('0x18')],{'onDelete':'cascade'});db[_0x8b8d('0x18')][_0x8b8d('0x110')](db[_0x8b8d('0x18')],{'as':_0x8b8d('0x13d'),'onDelete':_0x8b8d('0x10e')});db['VoiceMusicOnHold'][_0x8b8d('0x11b')](db[_0x8b8d('0x8a')],{'as':_0x8b8d('0x13e'),'through':_0x8b8d('0x13f')});db[_0x8b8d('0x1c')][_0x8b8d('0x110')](db['UserVoiceQueueRt'],{'as':_0x8b8d('0x140'),'foreignKey':_0x8b8d('0x141')});db[_0x8b8d('0x1c')]['hasMany'](db[_0x8b8d('0x142')],{'as':_0x8b8d('0x143'),'foreignKey':_0x8b8d('0x141')});db[_0x8b8d('0x1c')][_0x8b8d('0x110')](db[_0x8b8d('0x77')],{'as':_0x8b8d('0x113'),'foreignKey':'VoiceQueueId'});db[_0x8b8d('0x1c')]['hasMany'](db[_0x8b8d('0x79')],{'as':_0x8b8d('0x144'),'foreignKey':_0x8b8d('0x141')});db[_0x8b8d('0x1c')]['hasMany'](db[_0x8b8d('0x115')],{'as':_0x8b8d('0x115'),'foreignKey':'VoiceQueueId'});db[_0x8b8d('0x1c')][_0x8b8d('0x110')](db['CmHopperBlack'],{'as':_0x8b8d('0x145'),'foreignKey':_0x8b8d('0x141')});db[_0x8b8d('0x1c')][_0x8b8d('0x110')](db[_0x8b8d('0x146')],{'as':_0x8b8d('0x147'),'foreignKey':_0x8b8d('0x141')});db['VoiceQueue']['belongsTo'](db[_0x8b8d('0x148')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x8b8d('0x1c')][_0x8b8d('0x149')](db['Trunk'],{'as':_0x8b8d('0x14a'),'foreignKey':'TrunkBackupId'});db[_0x8b8d('0x1c')][_0x8b8d('0x149')](db[_0x8b8d('0x84')],{'as':'Interval','foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x1c')][_0x8b8d('0x149')](db['Pause'],{'as':_0x8b8d('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8b8d('0x1c')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0x8b8d('0x14d')});db[_0x8b8d('0x1c')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x14f')});db[_0x8b8d('0x1c')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'as':_0x8b8d('0x150'),'through':'TeamVoiceQueue'});db[_0x8b8d('0x1c')][_0x8b8d('0x11b')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x151'),'through':_0x8b8d('0x152')});db[_0x8b8d('0x1e')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x12'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x20')][_0x8b8d('0x149')](db['User'],{'as':'User','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x22')][_0x8b8d('0x110')](db[_0x8b8d('0x153')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x8b8d('0x154'),'sourceKey':_0x8b8d('0x155')});db[_0x8b8d('0x153')][_0x8b8d('0x149')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x8b8d('0x155')});db['VoiceCallReport'][_0x8b8d('0x110')](db[_0x8b8d('0x28')],{'as':_0x8b8d('0x156'),'foreignKey':_0x8b8d('0x157'),'constraints':![]});db[_0x8b8d('0x158')][_0x8b8d('0x110')](db['VoiceAgentReport'],{'as':_0x8b8d('0x159'),'foreignKey':_0x8b8d('0x157'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x12'),'foreignKey':_0x8b8d('0x10f')});db['VoiceCallReport'][_0x8b8d('0x149')](db['CmContact'],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db['MailServerIn'][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x133'),'foreignKey':_0x8b8d('0x15c')});db['MailServerOut']['belongsTo'](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x133'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x8b8d('0x15d')](db[_0x8b8d('0x39')],{'as':'Imap','onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x133')][_0x8b8d('0x15d')](db[_0x8b8d('0x3b')],{'as':_0x8b8d('0x15e'),'onDelete':_0x8b8d('0x10e')});db['MailAccount'][_0x8b8d('0x110')](db[_0x8b8d('0x80')],{'as':_0x8b8d('0x15f'),'foreignKey':'MailAccountId','onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x133')][_0x8b8d('0x110')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8b8d('0x15c')});db['MailAccount'][_0x8b8d('0x110')](db[_0x8b8d('0x43')],{'as':_0x8b8d('0x160'),'foreignKey':_0x8b8d('0x15c')});db['MailAccount'][_0x8b8d('0x110')](db[_0x8b8d('0x41')],{'as':_0x8b8d('0x161')});db[_0x8b8d('0x133')][_0x8b8d('0x110')](db[_0x8b8d('0x45')],{'as':_0x8b8d('0x13d')});db[_0x8b8d('0x133')]['belongsTo'](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x133')][_0x8b8d('0x149')](db['Template'],{'as':_0x8b8d('0x8e'),'foreignKey':'TemplateId'});db[_0x8b8d('0x133')][_0x8b8d('0x149')](db['Pause'],{'as':_0x8b8d('0x14c'),'foreignKey':_0x8b8d('0x164')});db[_0x8b8d('0x133')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':_0x8b8d('0x165')});db[_0x8b8d('0x3e')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x32')});db[_0x8b8d('0x3e')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x166'),'as':_0x8b8d('0x150')});db[_0x8b8d('0x41')][_0x8b8d('0x110')](db['MailMessage'],{'as':'Messages','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x167')});db['MailInteraction'][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x15c')});db[_0x8b8d('0x41')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x41')]['belongsTo'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x169'),'foreignKey':_0x8b8d('0x10f')});db['MailInteraction']['belongsToMany'](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x16a'),'as':_0x8b8d('0x16b')});db[_0x8b8d('0x41')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x16a'),'as':_0x8b8d('0x16c')});db[_0x8b8d('0x41')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0x8b8d('0x167')});db[_0x8b8d('0x43')]['hasMany'](db['Attachment'],{'as':_0x8b8d('0x16d'),'onDelete':_0x8b8d('0x10e')});db['MailMessage']['belongsTo'](db['User'],{'as':_0x8b8d('0x12')});db[_0x8b8d('0x43')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x15a')});db['MailMessage']['belongsTo'](db[_0x8b8d('0x41')],{'as':'Interaction','foreignKey':_0x8b8d('0x167')});db[_0x8b8d('0x43')][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x15c')});db[_0x8b8d('0x43')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':'ChatWebsite','foreignKey':_0x8b8d('0x16e')});db['MailMessage'][_0x8b8d('0x149')](db[_0x8b8d('0x6b')],{'as':_0x8b8d('0x6b'),'foreignKey':_0x8b8d('0x16f')});db[_0x8b8d('0x45')]['belongsTo'](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x170')});db['MailApplication'][_0x8b8d('0x149')](db['MailQueue'],{'onDelete':_0x8b8d('0x170')});db['MailApplication'][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x45')][_0x8b8d('0x149')](db[_0x8b8d('0x84')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x14b')});db['MailApplication'][_0x8b8d('0x149')](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':'TagId'});db[_0x8b8d('0x171')][_0x8b8d('0x149')](db['MailAccount'],{});db[_0x8b8d('0x171')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db['MailQueueReport'][_0x8b8d('0x149')](db['CmContact'],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x171')][_0x8b8d('0x149')](db[_0x8b8d('0x41')],{});db[_0x8b8d('0x171')]['belongsTo'](db[_0x8b8d('0x43')],{});db[_0x8b8d('0x171')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db['MailQueueReport'][_0x8b8d('0x149')](db[_0x8b8d('0x3e')],{});db[_0x8b8d('0x48')][_0x8b8d('0x110')](db[_0x8b8d('0x4a')],{'as':_0x8b8d('0x172'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db['Disposition'],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x173'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db['CannedAnswer'],{'as':_0x8b8d('0x174'),'foreignKey':'FaxAccountId'});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db[_0x8b8d('0x4f')],{'as':_0x8b8d('0x161')});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db[_0x8b8d('0x4d')],{'as':'Applications'});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db[_0x8b8d('0x18')],{'as':_0x8b8d('0x175'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db[_0x8b8d('0x51')],{'as':'Messages'});db[_0x8b8d('0x4c')][_0x8b8d('0x149')](db[_0x8b8d('0x148')],{'as':_0x8b8d('0x148')});db[_0x8b8d('0x4c')]['belongsTo'](db['CmList'],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x4c')]['belongsTo'](db[_0x8b8d('0x86')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8b8d('0x4c')][_0x8b8d('0x11b')](db['User'],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x132')});db[_0x8b8d('0x4d')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x4d')][_0x8b8d('0x149')](db[_0x8b8d('0x128')],{'onDelete':'restrict'});db[_0x8b8d('0x4d')][_0x8b8d('0x149')](db['FaxAccount'],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x4d')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x8b8d('0x4f')][_0x8b8d('0x110')](db[_0x8b8d('0x51')],{'as':_0x8b8d('0x160'),'onDelete':_0x8b8d('0x10e'),'foreignKey':'FaxInteractionId'});db[_0x8b8d('0x4f')][_0x8b8d('0x149')](db[_0x8b8d('0x4c')],{'as':'Account','foreignKey':_0x8b8d('0x173')});db[_0x8b8d('0x4f')][_0x8b8d('0x149')](db['CmContact'],{'as':'Contact','foreignKey':_0x8b8d('0x15b')});db['FaxInteraction']['belongsTo'](db['User'],{'as':_0x8b8d('0x169'),'foreignKey':_0x8b8d('0x10f')});db['FaxInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x176'),'as':_0x8b8d('0x16b')});db[_0x8b8d('0x4f')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':'fax_interaction_has_tags','as':_0x8b8d('0x16c')});db[_0x8b8d('0x4f')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x178'),'foreignKey':_0x8b8d('0x179')});db[_0x8b8d('0x51')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':'cascade','as':_0x8b8d('0x12')});db[_0x8b8d('0x51')][_0x8b8d('0x149')](db[_0x8b8d('0x4f')],{'as':_0x8b8d('0x17a'),'foreignKey':_0x8b8d('0x179')});db[_0x8b8d('0x51')][_0x8b8d('0x149')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x8b8d('0x51')][_0x8b8d('0x149')](db[_0x8b8d('0xe7')],{'as':_0x8b8d('0xe7'),'foreignKey':_0x8b8d('0x17b')});db['FaxMessage'][_0x8b8d('0x149')](db[_0x8b8d('0x4c')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x173')});db[_0x8b8d('0x128')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':'UserFaxQueue'});db[_0x8b8d('0x128')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':'team_has_fax_queues','as':_0x8b8d('0x150')});db[_0x8b8d('0x54')][_0x8b8d('0x149')](db[_0x8b8d('0x4c')],{});db[_0x8b8d('0x54')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db['FaxQueueReport']['belongsTo'](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db['FaxQueueReport'][_0x8b8d('0x149')](db['FaxInteraction'],{});db[_0x8b8d('0x54')][_0x8b8d('0x149')](db[_0x8b8d('0x51')],{});db['FaxQueueReport'][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0x54')]['belongsTo'](db[_0x8b8d('0x128')],{});db[_0x8b8d('0x56')][_0x8b8d('0x110')](db['Disposition'],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x17c'),'onDelete':'cascade'});db[_0x8b8d('0x56')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8b8d('0x17c')});db[_0x8b8d('0x56')]['hasMany'](db[_0x8b8d('0x17d')],{'as':_0x8b8d('0x160'),'foreignKey':_0x8b8d('0x17c')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x8b8d('0x161')});db['SmsAccount']['hasMany'](db[_0x8b8d('0x58')],{'as':_0x8b8d('0x13d')});db[_0x8b8d('0x56')]['belongsTo'](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x56')][_0x8b8d('0x149')](db[_0x8b8d('0x86')],{'as':_0x8b8d('0x14c'),'foreignKey':_0x8b8d('0x164')});db[_0x8b8d('0x56')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x138')});db[_0x8b8d('0x58')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x170')});db['SmsApplication']['belongsTo'](db[_0x8b8d('0x5c')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x58')][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x58')]['belongsTo'](db[_0x8b8d('0x84')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x8b8d('0x58')]['belongsTo'](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x17e')});db[_0x8b8d('0x5a')]['hasMany'](db[_0x8b8d('0x17d')],{'as':_0x8b8d('0x160'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x17f')});db['SmsInteraction'][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x8b8d('0x5a')]['belongsTo'](db['CmContact'],{'as':_0x8b8d('0x15a'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x8b8d('0x10f')});db['SmsInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x180'),'as':_0x8b8d('0x16b')});db[_0x8b8d('0x5a')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x180'),'as':_0x8b8d('0x16c')});db[_0x8b8d('0x5a')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x181'),'foreignKey':_0x8b8d('0x17f')});db[_0x8b8d('0x17d')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'User'});db[_0x8b8d('0x17d')][_0x8b8d('0x149')](db['CmContact'],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x15a')});db[_0x8b8d('0x17d')][_0x8b8d('0x149')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x8b8d('0x17a'),'foreignKey':_0x8b8d('0x17f')});db[_0x8b8d('0x17d')][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{'as':'Account','foreignKey':_0x8b8d('0x17c')});db[_0x8b8d('0x5c')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':'UserSmsQueue','foreignKey':_0x8b8d('0x182')});db['SmsQueue'][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x8b8d('0x135')][_0x8b8d('0x110')](db[_0x8b8d('0x80')],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x183'),'onDelete':_0x8b8d('0x10e')});db['OpenchannelAccount'][_0x8b8d('0x110')](db['CannedAnswer'],{'as':_0x8b8d('0x174'),'foreignKey':'OpenchannelAccountId'});db[_0x8b8d('0x135')][_0x8b8d('0x110')](db[_0x8b8d('0x60')],{'as':_0x8b8d('0x161'),'foreignKey':_0x8b8d('0x183')});db[_0x8b8d('0x135')][_0x8b8d('0x110')](db[_0x8b8d('0x184')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x8b8d('0x135')][_0x8b8d('0x110')](db[_0x8b8d('0x5e')],{'as':_0x8b8d('0x13d'),'foreignKey':'OpenchannelAccountId'});db[_0x8b8d('0x135')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x135')]['belongsTo'](db[_0x8b8d('0x86')],{'as':_0x8b8d('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8b8d('0x135')]['belongsToMany'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x8b8d('0x149')](db['User'],{'onDelete':_0x8b8d('0x170')});db['OpenchannelApplication'][_0x8b8d('0x149')](db[_0x8b8d('0x63')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x185')});db[_0x8b8d('0x5e')][_0x8b8d('0x149')](db['OpenchannelAccount'],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x183')});db[_0x8b8d('0x5e')][_0x8b8d('0x149')](db[_0x8b8d('0x84')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x5e')]['belongsTo'](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x17e')});db['OpenchannelInteraction'][_0x8b8d('0x110')](db[_0x8b8d('0x184')],{'as':'Messages','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x186')});db[_0x8b8d('0x60')][_0x8b8d('0x149')](db[_0x8b8d('0x135')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x183')});db[_0x8b8d('0x60')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x60')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x169'),'foreignKey':_0x8b8d('0x10f')});db['OpenchannelInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':'openchannel_interaction_has_tags','as':_0x8b8d('0x16b')});db[_0x8b8d('0x60')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x187'),'as':_0x8b8d('0x16c')});db[_0x8b8d('0x60')][_0x8b8d('0x11b')](db['User'],{'as':_0x8b8d('0x177'),'through':'user_has_openchannel_interactions','foreignKey':_0x8b8d('0x186')});db['OpenchannelMessage'][_0x8b8d('0x149')](db['User'],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x12')});db[_0x8b8d('0x184')][_0x8b8d('0x149')](db['CmContact'],{'onDelete':'cascade','as':_0x8b8d('0x15a')});db[_0x8b8d('0x184')][_0x8b8d('0x149')](db[_0x8b8d('0x60')],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x17a'),'foreignKey':_0x8b8d('0x186')});db[_0x8b8d('0x184')][_0x8b8d('0x149')](db[_0x8b8d('0xe7')],{'as':_0x8b8d('0xe7'),'foreignKey':_0x8b8d('0x17b')});db[_0x8b8d('0x184')]['belongsTo'](db[_0x8b8d('0x135')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x183')});db['OpenchannelQueue']['belongsToMany'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x37'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x188'),'as':'Teams'});db[_0x8b8d('0x64')][_0x8b8d('0x110')](db[_0x8b8d('0x80')],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x16e'),'onDelete':_0x8b8d('0x10e')});db['ChatWebsite'][_0x8b8d('0x110')](db[_0x8b8d('0x7e')],{'as':_0x8b8d('0x174'),'foreignKey':_0x8b8d('0x16e')});db[_0x8b8d('0x64')][_0x8b8d('0x110')](db[_0x8b8d('0x189')],{'as':'ProactiveActions'});db[_0x8b8d('0x64')][_0x8b8d('0x110')](db['ChatInteraction'],{'as':_0x8b8d('0x161')});db[_0x8b8d('0x64')]['hasMany'](db[_0x8b8d('0x68')],{'as':_0x8b8d('0x13d')});db[_0x8b8d('0x64')]['hasMany'](db[_0x8b8d('0x18a')],{'as':_0x8b8d('0x160')});db[_0x8b8d('0x64')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db['ChatWebsite'][_0x8b8d('0x149')](db['Interval'],{'as':_0x8b8d('0x84'),'foreignKey':'IntervalId'});db[_0x8b8d('0x64')][_0x8b8d('0x149')](db['MailAccount'],{'as':_0x8b8d('0x133'),'foreignKey':_0x8b8d('0x15c')});db['ChatWebsite']['belongsTo'](db[_0x8b8d('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0x8b8d('0x164')});db[_0x8b8d('0x64')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':'user_has_chat_websites'});db[_0x8b8d('0x66')]['belongsTo'](db[_0x8b8d('0x135')],{});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x66')]['belongsTo'](db[_0x8b8d('0x72')],{'as':'Contact','foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0x60')],{});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0x184')],{});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0x63')],{});db[_0x8b8d('0x68')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'Agent','foreignKey':_0x8b8d('0x10f'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x68')]['belongsTo'](db[_0x8b8d('0x18b')],{'as':'Queue','foreignKey':_0x8b8d('0x18c'),'onDelete':'restrict'});db[_0x8b8d('0x68')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':_0x8b8d('0x18d'),'foreignKey':_0x8b8d('0x16e'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x68')][_0x8b8d('0x149')](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x17e')});db[_0x8b8d('0x69')]['hasMany'](db[_0x8b8d('0x18a')],{'as':_0x8b8d('0x160'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x18e')});db[_0x8b8d('0x69')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':'Account','foreignKey':_0x8b8d('0x16e')});db[_0x8b8d('0x69')]['belongsTo'](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x69')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'Owner','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x69')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0x8b8d('0x69')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':'chat_interaction_has_tags','as':_0x8b8d('0x16c')});db[_0x8b8d('0x69')][_0x8b8d('0x11b')](db['User'],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x18f'),'foreignKey':_0x8b8d('0x18e')});db['ChatMessage'][_0x8b8d('0x149')](db['User'],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x12')});db['ChatMessage']['belongsTo'](db[_0x8b8d('0x72')],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x15a'),'foreignKey':'ContactId'});db[_0x8b8d('0x18a')][_0x8b8d('0x149')](db['ChatInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x8b8d('0x18e')});db[_0x8b8d('0x18a')][_0x8b8d('0x149')](db[_0x8b8d('0xe7')],{'as':_0x8b8d('0xe7'),'foreignKey':'AttachmentId'});db[_0x8b8d('0x18a')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':'Account','foreignKey':_0x8b8d('0x16e')});db['ChatOfflineMessage']['hasMany'](db['Attachment'],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x8b8d('0x10e'),'hooks':!![]});db['ChatOfflineMessage'][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'onDelete':'cascade','as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x6b')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x16e')});db[_0x8b8d('0x18b')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':_0x8b8d('0x31'),'hooks':!![]});db[_0x8b8d('0x18b')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x190'),'as':_0x8b8d('0x150')});db[_0x8b8d('0x6e')][_0x8b8d('0x110')](db[_0x8b8d('0xcc')],{'as':_0x8b8d('0x160'),'foreignKey':_0x8b8d('0x191'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x6e')]['belongsToMany'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x140'),'through':'chat_group_has_users'});db[_0x8b8d('0x189')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x8b8d('0x16e')});db[_0x8b8d('0x70')][_0x8b8d('0x110')](db[_0x8b8d('0x72')],{'as':'Contacts','foreignKey':_0x8b8d('0x192')});db['CmContact'][_0x8b8d('0x110')](db[_0x8b8d('0x142')],{'as':_0x8b8d('0x143'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x77')],{'as':_0x8b8d('0x113'),'foreignKey':'ContactId'});db[_0x8b8d('0x72')]['hasMany'](db['CmHopperHistory'],{'as':_0x8b8d('0x144'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x72')]['hasMany'](db[_0x8b8d('0x115')],{'as':_0x8b8d('0x115'),'foreignKey':'ContactId'});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x8b8d('0x15b')});db['CmContact'][_0x8b8d('0x110')](db[_0x8b8d('0x60')],{'as':'OpenchannelInteractions','foreignKey':_0x8b8d('0x15b'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x69')],{'as':_0x8b8d('0x120'),'foreignKey':_0x8b8d('0x15b'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x5a')],{'as':_0x8b8d('0x193'),'foreignKey':_0x8b8d('0x15b'),'onDelete':'restrict'});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x4f')],{'as':_0x8b8d('0x121'),'foreignKey':_0x8b8d('0x15b'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x41')],{'as':_0x8b8d('0x117'),'foreignKey':'ContactId','onDelete':_0x8b8d('0x170')});db['CmContact'][_0x8b8d('0x149')](db['CmCompany'],{'as':_0x8b8d('0x194'),'foreignKey':'CompanyId'});db[_0x8b8d('0x72')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163'),'onDelete':'cascade'});db['CmContact']['belongsToMany'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x11d')});db[_0x8b8d('0x72')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'as':_0x8b8d('0x16b'),'through':'cm_contact_has_tags'});db[_0x8b8d('0x72')]['belongsToMany'](db['Tag'],{'through':_0x8b8d('0x195'),'as':'ThroughTags'});db[_0x8b8d('0x142')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db['CmHopper']['belongsTo'](db['CmList'],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x196'),'foreignKey':'UserId'});db['CmHopper']['belongsTo'](db['VoiceQueue'],{'as':_0x8b8d('0x197'),'foreignKey':_0x8b8d('0x141'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x142')]['belongsTo'](db[_0x8b8d('0xe3')],{'as':_0x8b8d('0xe3'),'foreignKey':_0x8b8d('0x198'),'onDelete':_0x8b8d('0x10e')});db['CmHopper'][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x8b8d('0x75')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b'),'onDelete':'cascade'});db['CmHopperBlack'][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163'),'onDelete':'cascade'});db[_0x8b8d('0x75')]['belongsTo'](db[_0x8b8d('0x1c')],{'as':_0x8b8d('0x197'),'foreignKey':_0x8b8d('0x141'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x75')][_0x8b8d('0x149')](db[_0x8b8d('0xe3')],{'as':_0x8b8d('0xe3'),'foreignKey':_0x8b8d('0x198'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x7c')][_0x8b8d('0x110')](db['Condition'],{'as':{'plural':_0x8b8d('0x199'),'singular':_0x8b8d('0x19a')},'foreignKey':_0x8b8d('0x19b'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x7c')][_0x8b8d('0x110')](db[_0x8b8d('0x82')],{'as':{'plural':_0x8b8d('0x19c'),'singular':_0x8b8d('0x19d')},'foreignKey':_0x8b8d('0x19e'),'onDelete':'cascade','hooks':!![]});db[_0x8b8d('0x7c')]['hasMany'](db[_0x8b8d('0x19f')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x80')][_0x8b8d('0x110')](db['Disposition'],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x1a0'),'onDelete':'cascade'});db[_0x8b8d('0x84')]['hasMany'](db[_0x8b8d('0x84')],{'as':_0x8b8d('0x1a1'),'foreignKey':_0x8b8d('0x14b'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x8b8d('0x84')][_0x8b8d('0x110')](db['VoiceExtension'],{'as':_0x8b8d('0x112'),'foreignKey':_0x8b8d('0x14b'),'onDelete':'restrict'});db['Interval'][_0x8b8d('0x110')](db[_0x8b8d('0x45')],{'as':_0x8b8d('0x1a2'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x84')]['hasMany'](db[_0x8b8d('0x68')],{'as':_0x8b8d('0x1a3'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x84')]['hasMany'](db[_0x8b8d('0x4d')],{'as':_0x8b8d('0x1a4'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x84')][_0x8b8d('0x110')](db[_0x8b8d('0x58')],{'as':_0x8b8d('0x1a5'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x1a6')][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{});db[_0x8b8d('0x1a6')][_0x8b8d('0x149')](db[_0x8b8d('0x1a7')],{'foreignKey':_0x8b8d('0x1a8')});db['Schedule'][_0x8b8d('0x149')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x8b8d('0x8a')][_0x8b8d('0x11b')](db['VoiceMusicOnHold'],{'as':_0x8b8d('0x1a9'),'through':_0x8b8d('0x13f'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0x72')],{'through':'cm_contact_has_tags'});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db['ChatInteraction'],{'through':_0x8b8d('0x1aa')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db['MailInteraction'],{'through':_0x8b8d('0x16a')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0x5a')],{'through':_0x8b8d('0x180')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0x4f')],{'through':_0x8b8d('0x176')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0x60')],{'through':_0x8b8d('0x187')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0xfd')],{'through':_0x8b8d('0x1ab')});db[_0x8b8d('0x90')]['hasMany'](db[_0x8b8d('0x82')],{'as':{'plural':_0x8b8d('0x1ac'),'singular':_0x8b8d('0x1ad')},'foreignKey':_0x8b8d('0x1ae'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x90')][_0x8b8d('0x110')](db[_0x8b8d('0x82')],{'as':{'plural':_0x8b8d('0x1af'),'singular':_0x8b8d('0x1b0')},'foreignKey':_0x8b8d('0x1b1'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x90')][_0x8b8d('0x110')](db['Action'],{'as':_0x8b8d('0x1b2'),'foreignKey':_0x8b8d('0x1b3'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x97')][_0x8b8d('0x110')](db[_0x8b8d('0x1b4')],{'as':_0x8b8d('0x1b5'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x8b8d('0x1a7')][_0x8b8d('0x110')](db['AnalyticFieldReport'],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1a8')});db[_0x8b8d('0x9c')][_0x8b8d('0x110')](db['AnalyticFieldReport'],{'as':_0x8b8d('0x1b5'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x8b8d('0x1b4')][_0x8b8d('0x149')](db[_0x8b8d('0x9c')],{'foreignKey':_0x8b8d('0x1b6')});db[_0x8b8d('0xa0')][_0x8b8d('0x110')](db[_0x8b8d('0x1b7')],{'as':_0x8b8d('0x1b8'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1b9')});db['SalesforceConfiguration']['hasMany'](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1bb'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1bc')});db['SalesforceConfiguration'][_0x8b8d('0x110')](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1bd'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0x1b7')][_0x8b8d('0x110')](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1b7')][_0x8b8d('0x149')](db[_0x8b8d('0xa0')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0x8b8d('0x110')](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1c0'),'foreignKey':'SubjectId'});db[_0x8b8d('0x1ba')]['hasMany'](db['SalesforceField'],{'as':_0x8b8d('0x1c1'),'foreignKey':'DescriptionId'});db['SalesforceField']['hasMany'](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1ba')][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':_0x8b8d('0x92'),'foreignKey':_0x8b8d('0x1c3')});db[_0x8b8d('0xa2')][_0x8b8d('0x110')](db[_0x8b8d('0xa3')],{'as':_0x8b8d('0x1b8'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1b9')});db['SugarcrmConfiguration'][_0x8b8d('0x110')](db[_0x8b8d('0x1c4')],{'as':_0x8b8d('0x1bb'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xa3')]['hasMany'](db[_0x8b8d('0x1c4')],{'as':'Descriptions','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xa3')][_0x8b8d('0x110')](db['SugarcrmField'],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xa3')][_0x8b8d('0x149')](db[_0x8b8d('0xa2')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0x1c4')][_0x8b8d('0x110')](db['SugarcrmField'],{'as':_0x8b8d('0x1c0'),'foreignKey':_0x8b8d('0x1bc')});db['SugarcrmField']['hasMany'](db[_0x8b8d('0x1c4')],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0x1c4')][_0x8b8d('0x110')](db['SugarcrmField'],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db['SugarcrmField'][_0x8b8d('0x149')](db['Variable'],{'as':_0x8b8d('0x92'),'foreignKey':_0x8b8d('0x1c3')});db[_0x8b8d('0x1c5')]['hasMany'](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xa6')][_0x8b8d('0x110')](db[_0x8b8d('0xa8')],{'as':_0x8b8d('0x1bb'),'onDelete':_0x8b8d('0x10e'),'foreignKey':'SubjectId'});db[_0x8b8d('0xa6')]['hasMany'](db['DeskField'],{'as':_0x8b8d('0x1bd'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xa6')][_0x8b8d('0x110')](db['DeskField'],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xa6')][_0x8b8d('0x149')](db[_0x8b8d('0x1c5')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xa6')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x1c6')});db[_0x8b8d('0xa8')][_0x8b8d('0x110')](db[_0x8b8d('0xa8')],{'as':_0x8b8d('0x1c0'),'foreignKey':'SubjectId'});db[_0x8b8d('0xa8')][_0x8b8d('0x110')](db[_0x8b8d('0xa8')],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xa8')]['hasMany'](db['DeskField'],{'as':'Field','foreignKey':_0x8b8d('0x1bf')});db['DeskField'][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':_0x8b8d('0x92'),'foreignKey':'VariableId'});db[_0x8b8d('0xaa')][_0x8b8d('0x110')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0x1c7')]['hasMany'](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1bb'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1bc')});db['ZohoConfiguration']['hasMany'](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1bd'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x8b8d('0x1c7')][_0x8b8d('0x110')](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1c7')][_0x8b8d('0x149')](db[_0x8b8d('0xaa')],{'as':'Account','foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xad')]['hasMany'](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1c0'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xad')]['hasMany'](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xad')][_0x8b8d('0x110')](db['ZohoField'],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xad')]['belongsTo'](db['Variable'],{'as':_0x8b8d('0x92'),'foreignKey':_0x8b8d('0x1c3')});db['ZendeskAccount']['hasMany'](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xb0')][_0x8b8d('0x110')](db[_0x8b8d('0xb2')],{'as':'Subjects','foreignKey':_0x8b8d('0x1bc')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xb0')][_0x8b8d('0x110')](db[_0x8b8d('0xb2')],{'as':_0x8b8d('0x1b5'),'foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x8b8d('0x149')](db[_0x8b8d('0x1c8')],{'as':'Account','foreignKey':'AccountId'});db[_0x8b8d('0xb0')]['belongsToMany'](db[_0x8b8d('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db[_0x8b8d('0xb2')][_0x8b8d('0x110')](db[_0x8b8d('0xb2')],{'as':_0x8b8d('0x1c0'),'foreignKey':'SubjectId'});db['ZendeskField'][_0x8b8d('0x110')](db['ZendeskField'],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xb2')][_0x8b8d('0x110')](db['ZendeskField'],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xb2')][_0x8b8d('0x149')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x8b8d('0x1c9')][_0x8b8d('0x110')](db[_0x8b8d('0xb4')],{'as':_0x8b8d('0x1b8'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1b9')});db['FreshdeskConfiguration'][_0x8b8d('0x110')](db[_0x8b8d('0xb6')],{'as':_0x8b8d('0x1bb'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xb4')][_0x8b8d('0x110')](db['FreshdeskField'],{'as':_0x8b8d('0x1bd'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xb4')][_0x8b8d('0x110')](db['FreshdeskField'],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0x8b8d('0x149')](db[_0x8b8d('0x1c9')],{'as':_0x8b8d('0x168'),'foreignKey':'AccountId'});db[_0x8b8d('0xb4')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x1ca')});db['FreshdeskField'][_0x8b8d('0x110')](db[_0x8b8d('0xb6')],{'as':'Subject','foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xb6')]['hasMany'](db[_0x8b8d('0xb6')],{'as':'Description','foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xb6')][_0x8b8d('0x110')](db['FreshdeskField'],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xb6')][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8b8d('0xb8')]['hasMany'](db[_0x8b8d('0xb9')],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':'AccountId'});db[_0x8b8d('0xb9')][_0x8b8d('0x110')](db[_0x8b8d('0xbb')],{'as':_0x8b8d('0x1bb'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xb9')][_0x8b8d('0x110')](db[_0x8b8d('0xbb')],{'as':_0x8b8d('0x1bd'),'foreignKey':'DescriptionId'});db[_0x8b8d('0xb9')]['hasMany'](db[_0x8b8d('0xbb')],{'as':_0x8b8d('0x1b5'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xb9')][_0x8b8d('0x149')](db[_0x8b8d('0xb8')],{'as':_0x8b8d('0x168'),'foreignKey':'AccountId'});db[_0x8b8d('0xbb')]['hasMany'](db['VtigerField'],{'as':_0x8b8d('0x1c0'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xbb')][_0x8b8d('0x110')](db[_0x8b8d('0xbb')],{'as':'Description','foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xbb')][_0x8b8d('0x110')](db[_0x8b8d('0xbb')],{'as':'Field','foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xbb')][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':_0x8b8d('0x92'),'foreignKey':'VariableId'});db[_0x8b8d('0x1cb')][_0x8b8d('0x110')](db[_0x8b8d('0xbd')],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db['ServicenowConfiguration'][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1bb'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xbd')][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1bd'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xbd')]['hasMany'](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1b5'),'foreignKey':_0x8b8d('0x1bf')});db['ServicenowConfiguration'][_0x8b8d('0x149')](db[_0x8b8d('0x1cb')],{'as':'Account','foreignKey':_0x8b8d('0x1b9')});db['ServicenowField'][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8b8d('0x1cc')][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1c1'),'foreignKey':'DescriptionId'});db[_0x8b8d('0x1cc')][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1cc')][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':_0x8b8d('0x92'),'foreignKey':_0x8b8d('0x1c3')});db[_0x8b8d('0xbf')][_0x8b8d('0x110')](db[_0x8b8d('0xc1')],{'as':_0x8b8d('0x1b8'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db['Dynamics365Configuration']['hasMany'](db[_0x8b8d('0xc3')],{'as':_0x8b8d('0x1bb'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xc1')][_0x8b8d('0x110')](db['Dynamics365Field'],{'as':_0x8b8d('0x1bd'),'onDelete':_0x8b8d('0x10e'),'foreignKey':'DescriptionId'});db[_0x8b8d('0xc1')]['hasMany'](db[_0x8b8d('0xc3')],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db['Dynamics365Configuration'][_0x8b8d('0x149')](db['Dynamics365Account'],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xc3')][_0x8b8d('0x110')](db['Dynamics365Field'],{'as':_0x8b8d('0x1c0'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xc3')][_0x8b8d('0x110')](db['Dynamics365Field'],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db['Dynamics365Field'][_0x8b8d('0x110')](db[_0x8b8d('0xc3')],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db['Dynamics365Field'][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':'Variable','foreignKey':_0x8b8d('0x1c3')});db[_0x8b8d('0xc5')][_0x8b8d('0x110')](db[_0x8b8d('0xc7')],{'as':_0x8b8d('0x1b8'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xc7')][_0x8b8d('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x8b8d('0xc7')][_0x8b8d('0x110')](db[_0x8b8d('0x1cd')],{'as':_0x8b8d('0x1bd'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xc7')][_0x8b8d('0x110')](db[_0x8b8d('0x1cd')],{'as':_0x8b8d('0x1b5'),'foreignKey':'FieldId'});db[_0x8b8d('0xc7')][_0x8b8d('0x149')](db[_0x8b8d('0xc5')],{'as':'Account','foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0x1cd')][_0x8b8d('0x110')](db[_0x8b8d('0x1cd')],{'as':'Subject','foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0x1cd')]['hasMany'](db[_0x8b8d('0x1cd')],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0x1cd')][_0x8b8d('0x110')](db[_0x8b8d('0x1cd')],{'as':'Field','foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1cd')][_0x8b8d('0x149')](db['Variable'],{'as':_0x8b8d('0x92'),'foreignKey':'VariableId'});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{});db['ChatQueueReport'][_0x8b8d('0x149')](db['CmList'],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db['ChatQueueReport']['belongsTo'](db[_0x8b8d('0x69')],{});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db[_0x8b8d('0x18a')],{});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db['ChatQueue'],{});db[_0x8b8d('0xcc')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1ce')});db['ChatInternalMessage']['belongsTo'](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1cf')});db['JscriptySessionReport']['hasMany'](db[_0x8b8d('0xcf')],{'foreignKey':_0x8b8d('0x1d0'),'onDelete':'cascade'});db['JscriptySessionReport'][_0x8b8d('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db['CmContact'],{'as':'Contact','foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0xd2')]['belongsTo'](db[_0x8b8d('0x5a')],{});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db[_0x8b8d('0x17d')],{});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0xd2')]['belongsTo'](db[_0x8b8d('0x5c')],{});db[_0x8b8d('0xd6')][_0x8b8d('0x110')](db[_0x8b8d('0x146')],{'foreignKey':_0x8b8d('0x1d1')});db[_0x8b8d('0xd6')][_0x8b8d('0x110')](db[_0x8b8d('0xcf')],{'foreignKey':_0x8b8d('0x1d1')});db['JscriptyProject'][_0x8b8d('0x110')](db[_0x8b8d('0xce')],{'foreignKey':_0x8b8d('0x1d1')});db[_0x8b8d('0xdc')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x13b')});db['Team'][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':_0x8b8d('0x11e')});db[_0x8b8d('0xe0')][_0x8b8d('0x11b')](db[_0x8b8d('0x1c')],{'through':'TeamVoiceQueue','as':_0x8b8d('0x123')});db['Team']['belongsToMany'](db['MailQueue'],{'through':_0x8b8d('0x166'),'as':_0x8b8d('0x126')});db[_0x8b8d('0xe0')]['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0x8b8d('0x127')});db['Team'][_0x8b8d('0x11b')](db[_0x8b8d('0x128')],{'through':'team_has_fax_queues','as':_0x8b8d('0x129')});db['Team']['belongsToMany'](db['SmsQueue'],{'through':_0x8b8d('0x1d2'),'as':_0x8b8d('0x12b')});db[_0x8b8d('0xe0')]['belongsToMany'](db['OpenchannelQueue'],{'through':_0x8b8d('0x188'),'as':_0x8b8d('0x12c')});db['Team'][_0x8b8d('0x11b')](db[_0x8b8d('0x104')],{'through':'team_has_whatsapp_queues','as':_0x8b8d('0x12d')});db['Team']['belongsToMany'](db[_0x8b8d('0x124')],{'through':_0x8b8d('0x10a'),'as':_0x8b8d('0x125')});db[_0x8b8d('0xe3')]['hasMany'](db[_0x8b8d('0x142')],{'as':_0x8b8d('0x143'),'foreignKey':'CampaignId'});db['Campaign'][_0x8b8d('0x110')](db[_0x8b8d('0x77')],{'as':_0x8b8d('0x113'),'foreignKey':_0x8b8d('0x198')});db[_0x8b8d('0xe3')]['hasMany'](db[_0x8b8d('0x79')],{'as':'HopperHistories','foreignKey':_0x8b8d('0x198')});db[_0x8b8d('0xe3')][_0x8b8d('0x110')](db[_0x8b8d('0x75')],{'as':'HopperBlacks','foreignKey':_0x8b8d('0x198')});db[_0x8b8d('0xe3')][_0x8b8d('0x149')](db[_0x8b8d('0x148')],{'as':_0x8b8d('0x148'),'foreignKey':_0x8b8d('0x1d3')});db[_0x8b8d('0xe3')][_0x8b8d('0x149')](db[_0x8b8d('0x148')],{'as':'TrunkBackup','foreignKey':_0x8b8d('0x1d4')});db['Campaign']['belongsTo'](db[_0x8b8d('0x84')],{'as':'Interval','foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0xe3')][_0x8b8d('0x149')](db[_0x8b8d('0xdc')],{'as':_0x8b8d('0xdc'),'foreignKey':_0x8b8d('0x1d5')});db[_0x8b8d('0xe3')][_0x8b8d('0x11b')](db['CmList'],{'as':_0x8b8d('0x1d6'),'through':'campaigns_has_cm_lists'});db[_0x8b8d('0xe3')][_0x8b8d('0x11b')](db[_0x8b8d('0xf2')],{'as':'BlackLists','through':_0x8b8d('0x1d7')});db['Attachment'][_0x8b8d('0x149')](db[_0x8b8d('0x6b')],{'as':_0x8b8d('0x6b'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0x8b8d('0x149')](db['MailMessage'],{});db['MailTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x41')],{});db[_0x8b8d('0xea')][_0x8b8d('0x149')](db['MailAccount'],{'foreignKey':_0x8b8d('0x1d8'),'as':_0x8b8d('0x1d9')});db[_0x8b8d('0xea')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1da'),'as':_0x8b8d('0x1db')});db[_0x8b8d('0xea')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':'ToUserId','as':_0x8b8d('0x1dc')});db['MailTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x3e')],{'foreignKey':_0x8b8d('0x1dd'),'as':_0x8b8d('0x1de')});db[_0x8b8d('0xea')][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'foreignKey':_0x8b8d('0x1df'),'as':_0x8b8d('0x1e0')});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0x8b8d('0xec')]['belongsTo'](db[_0x8b8d('0x69')],{});db['ChatTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'foreignKey':_0x8b8d('0x1e1'),'as':'FromAccount'});db[_0x8b8d('0xec')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1da'),'as':'FromAgent'});db['ChatTransferReport']['belongsTo'](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1e2'),'as':_0x8b8d('0x1dc')});db[_0x8b8d('0xec')][_0x8b8d('0x149')](db['ChatQueue'],{'foreignKey':_0x8b8d('0x1e3'),'as':'ToQueue'});db[_0x8b8d('0xec')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'foreignKey':_0x8b8d('0x1e4'),'as':_0x8b8d('0x1e0')});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db['FaxMessage'],{});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db[_0x8b8d('0x4f')],{});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db['FaxAccount'],{'foreignKey':_0x8b8d('0x1e5'),'as':'FromAccount'});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1da'),'as':_0x8b8d('0x1db')});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db['User'],{'foreignKey':_0x8b8d('0x1e2'),'as':_0x8b8d('0x1dc')});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db['FaxQueue'],{'foreignKey':_0x8b8d('0x1e6'),'as':'ToQueue'});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db[_0x8b8d('0x4c')],{'foreignKey':_0x8b8d('0x1e7'),'as':_0x8b8d('0x1e0')});db[_0x8b8d('0xf0')]['belongsTo'](db[_0x8b8d('0x184')],{});db[_0x8b8d('0xf0')]['belongsTo'](db[_0x8b8d('0x60')],{});db[_0x8b8d('0xf0')][_0x8b8d('0x149')](db[_0x8b8d('0x135')],{'foreignKey':_0x8b8d('0x1e8'),'as':_0x8b8d('0x1d9')});db[_0x8b8d('0xf0')][_0x8b8d('0x149')](db['User'],{'foreignKey':_0x8b8d('0x1da'),'as':_0x8b8d('0x1db')});db[_0x8b8d('0xf0')]['belongsTo'](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1e2'),'as':_0x8b8d('0x1dc')});db['OpenchannelTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x63')],{'foreignKey':_0x8b8d('0x1e9'),'as':_0x8b8d('0x1de')});db[_0x8b8d('0xf0')][_0x8b8d('0x149')](db['OpenchannelAccount'],{'foreignKey':_0x8b8d('0x1ea'),'as':_0x8b8d('0x1e0')});db[_0x8b8d('0x1eb')]['belongsTo'](db[_0x8b8d('0x17d')],{});db[_0x8b8d('0x1eb')]['belongsTo'](db[_0x8b8d('0x5a')],{});db[_0x8b8d('0x1eb')]['belongsTo'](db[_0x8b8d('0x56')],{'foreignKey':_0x8b8d('0x1ec'),'as':_0x8b8d('0x1d9')});db[_0x8b8d('0x1eb')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':'FromUserId','as':_0x8b8d('0x1db')});db[_0x8b8d('0x1eb')]['belongsTo'](db['User'],{'foreignKey':_0x8b8d('0x1e2'),'as':_0x8b8d('0x1dc')});db[_0x8b8d('0x1eb')][_0x8b8d('0x149')](db[_0x8b8d('0x5c')],{'foreignKey':_0x8b8d('0x1ed'),'as':'ToQueue'});db[_0x8b8d('0x1eb')][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{'foreignKey':_0x8b8d('0x1ee'),'as':_0x8b8d('0x1e0')});db[_0x8b8d('0xf2')][_0x8b8d('0x110')](db['Disposition'],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x163'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0xf2')]['hasMany'](db['CmCustomField'],{'as':_0x8b8d('0x1ef'),'foreignKey':'ListId'});db[_0x8b8d('0xf2')][_0x8b8d('0x110')](db[_0x8b8d('0x72')],{'as':'Contacts','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0xf2')][_0x8b8d('0x110')](db[_0x8b8d('0x77')],{'as':_0x8b8d('0x113'),'foreignKey':'ListId'});db[_0x8b8d('0xf2')]['hasMany'](db[_0x8b8d('0x79')],{'as':_0x8b8d('0x114'),'foreignKey':_0x8b8d('0x163')});db['CmList'][_0x8b8d('0x110')](db[_0x8b8d('0x115')],{'as':_0x8b8d('0x115'),'foreignKey':'ListId'});db[_0x8b8d('0xf2')]['belongsToMany'](db['VoiceQueue'],{'as':_0x8b8d('0x1f0'),'through':_0x8b8d('0x14d')});db[_0x8b8d('0xf2')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x12e')});db[_0x8b8d('0x124')][_0x8b8d('0x110')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x124')]['belongsToMany'](db['User'],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x10c')});db[_0x8b8d('0x124')]['belongsToMany'](db[_0x8b8d('0xe0')],{'through':'TeamVoicePrefix','as':_0x8b8d('0x150')});db['UserProfile'][_0x8b8d('0x110')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'foreignKey':_0x8b8d('0x11a')});db[_0x8b8d('0xf4')][_0x8b8d('0x110')](db[_0x8b8d('0xf6')],{'as':_0x8b8d('0x1f1'),'foreignKey':_0x8b8d('0x11a'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0xf6')]['hasMany'](db[_0x8b8d('0x1f2')],{'as':'Resources','foreignKey':_0x8b8d('0x1f3'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0xfb')][_0x8b8d('0x110')](db[_0x8b8d('0x80')],{'as':_0x8b8d('0x15f'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0x8b8d('0xfb')][_0x8b8d('0x110')](db['CannedAnswer'],{'as':_0x8b8d('0x174'),'foreignKey':'WhatsappAccountId'});db[_0x8b8d('0xfb')][_0x8b8d('0x110')](db['WhatsappMessage'],{'as':_0x8b8d('0x160'),'foreignKey':_0x8b8d('0x1f4')});db[_0x8b8d('0xfb')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db['WhatsappAccount'][_0x8b8d('0x110')](db['WhatsappApplication'],{'as':_0x8b8d('0x13d')});db[_0x8b8d('0xfb')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db['WhatsappAccount'][_0x8b8d('0x149')](db[_0x8b8d('0x86')],{'as':_0x8b8d('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8b8d('0xfb')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':_0x8b8d('0x13a')});db[_0x8b8d('0x1f5')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x1f5')][_0x8b8d('0x149')](db['WhatsappQueue'],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x1f5')][_0x8b8d('0x149')](db[_0x8b8d('0xfb')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x1f5')]['belongsTo'](db[_0x8b8d('0x84')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x1f5')][_0x8b8d('0x149')](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x17e')});db[_0x8b8d('0xfd')][_0x8b8d('0x110')](db[_0x8b8d('0xfe')],{'as':_0x8b8d('0x160'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1f6')});db[_0x8b8d('0xfd')]['belongsTo'](db[_0x8b8d('0xfb')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x8b8d('0xfd')]['belongsTo'](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0xfd')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'Owner','foreignKey':_0x8b8d('0x10f')});db['WhatsappInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x1ab'),'as':_0x8b8d('0x16b')});db[_0x8b8d('0xfd')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x1ab'),'as':_0x8b8d('0x16c')});db['WhatsappInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x1f7'),'foreignKey':'WhatsappInteractionId'});db[_0x8b8d('0xfe')][_0x8b8d('0x149')](db['User'],{'as':'User'});db[_0x8b8d('0xfe')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'onDelete':_0x8b8d('0x10e'),'as':'Contact'});db['WhatsappMessage'][_0x8b8d('0x149')](db[_0x8b8d('0xfd')],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x17a'),'foreignKey':_0x8b8d('0x1f6')});db[_0x8b8d('0xfe')][_0x8b8d('0x149')](db['WhatsappAccount'],{'as':_0x8b8d('0x168'),'foreignKey':'WhatsappAccountId'});db[_0x8b8d('0x100')][_0x8b8d('0x149')](db[_0x8b8d('0xfb')],{});db[_0x8b8d('0x100')]['belongsTo'](db[_0x8b8d('0xf2')],{'as':'List','foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x100')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x100')]['belongsTo'](db[_0x8b8d('0xfd')],{});db['WhatsappQueueReport'][_0x8b8d('0x149')](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0x8b8d('0x149')](db[_0x8b8d('0xfe')],{});db[_0x8b8d('0x100')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0xfe')],{});db[_0x8b8d('0x102')]['belongsTo'](db[_0x8b8d('0xfd')],{});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0xfb')],{'foreignKey':_0x8b8d('0x1f8'),'as':_0x8b8d('0x1d9')});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0xfb')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0x104')],{'foreignKey':_0x8b8d('0x1f9'),'as':'ToQueue'});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1da'),'as':'FromAgent'});db['WhatsappTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1e2'),'as':'ToAgent'});db[_0x8b8d('0x104')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':'UserWhatsappQueue','foreignKey':_0x8b8d('0x1fa')});db[_0x8b8d('0x104')]['belongsToMany'](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x1fb'),'as':_0x8b8d('0x150')});module[_0x8b8d('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 4875c13..6fc830b 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8bd=['/demo','/snippet','3.0.0','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','localstationid','dsn','secret','registry','isPlainObject','isArray','length','replace','@@{','}@@','lodash','path','express','util','./errors','./config/environment','./config/logger','default','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','responseTime','user','role','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','statusCode','other','agent_id','agent_name','test','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/tag','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','./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/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerField','./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/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','./api/team','/api/license','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/realtime','/api/auth/local','/api/auth/google','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','root','/www','join'];(function(_0x4f4cd0,_0x5204b8){var _0x333daf=function(_0x32528b){while(--_0x32528b){_0x4f4cd0['push'](_0x4f4cd0['shift']());}};_0x333daf(++_0x5204b8);}(_0xe8bd,0x168));var _0xde8b=function(_0x58eddb,_0x135bfc){_0x58eddb=_0x58eddb-0x0;var _0x5b584a=_0xe8bd[_0x58eddb];return _0x5b584a;};'use strict';var _=require(_0xde8b('0x0'));var path=require(_0xde8b('0x1'));var express=require(_0xde8b('0x2'));var ewinston=require('express-winston');var util=require(_0xde8b('0x3'));var errors=require(_0xde8b('0x4'));var config=require(_0xde8b('0x5'));var logger=require('./config/logger')('api');var authLogger=require(_0xde8b('0x6'))('auth');exports[_0xde8b('0x7')]=function(_0x2d7dc4){_0x2d7dc4['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x13bbf0,_0x188f59){var _0x64675=_0xde8b('0x8');if(!_[_0xde8b('0x9')](_0x13bbf0['body'])){_0x64675+=_0xde8b('0xa');var _0x304d65=_0x13bbf0[_0xde8b('0xb')];maskSensitiveData(_0x304d65);}return util[_0xde8b('0xc')](_0x64675,_0x13bbf0[_0xde8b('0xd')],_0x13bbf0[_0xde8b('0xe')][_0xde8b('0xf')]?_0x13bbf0[_0xde8b('0xe')][_0xde8b('0xf')]:_0x13bbf0[_0xde8b('0x10')][_0xde8b('0x11')]||_0x13bbf0['ip'],_0x13bbf0['url'],_0x188f59['statusCode'],_0x188f59[_0xde8b('0x12')],_0x13bbf0[_0xde8b('0x13')]?_0x13bbf0[_0xde8b('0x13')]['id']:null,_0x13bbf0['user']?_0x13bbf0[_0xde8b('0x13')]['name']:null,_0x13bbf0['user']?_0x13bbf0['user'][_0xde8b('0x14')]:null,_0x304d65?util[_0xde8b('0x15')](_0x304d65,![],null):'');}}));_0x2d7dc4['use'](ewinston[_0xde8b('0x16')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3e1b55,_0x384981){var _0x348ae0=_0xde8b('0x17');if(_0x3e1b55['body']&&_0x3e1b55[_0xde8b('0xb')][_0xde8b('0x18')]&&_0x3e1b55[_0xde8b('0xb')]['agent_id']){_0x348ae0=_0xde8b('0x19');}return util[_0xde8b('0xc')](_0x348ae0,_0x3e1b55[_0xde8b('0xd')],_0x3e1b55['headers'][_0xde8b('0xf')]?_0x3e1b55[_0xde8b('0xe')][_0xde8b('0xf')]:_0x3e1b55[_0xde8b('0x10')]['remoteAddress']||_0x3e1b55['ip'],_0x3e1b55[_0xde8b('0x1a')],_0x384981[_0xde8b('0x1b')],_0x384981[_0xde8b('0x12')],_0x3e1b55['user']?_0x3e1b55[_0xde8b('0x13')]['id']:null,_0x3e1b55[_0xde8b('0x13')]?_0x3e1b55[_0xde8b('0x13')]['name']:null,_0x3e1b55[_0xde8b('0x13')]?_0x3e1b55[_0xde8b('0x13')][_0xde8b('0x14')]:null,_0x3e1b55[_0xde8b('0xb')]&&_0x3e1b55[_0xde8b('0xb')][_0xde8b('0x18')]?_0x3e1b55[_0xde8b('0xb')]['device']:_0xde8b('0x1c'),_0x3e1b55[_0xde8b('0xb')]&&_0x3e1b55[_0xde8b('0xb')]['agent_id']?_0x3e1b55[_0xde8b('0xb')][_0xde8b('0x1d')]:'',_0x3e1b55[_0xde8b('0xb')]&&_0x3e1b55[_0xde8b('0xb')][_0xde8b('0x1e')]?_0x3e1b55[_0xde8b('0xb')]['agent_name']:'');},'ignoreRoute':function(_0x2a69fd){var _0x3570bd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3570bd[_0xde8b('0x1f')](_0x2a69fd[_0xde8b('0x1a')]);}}));_0x2d7dc4[_0xde8b('0x20')]('/api/users',require(_0xde8b('0x21')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x22'),require(_0xde8b('0x23')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x24'),require(_0xde8b('0x25')));_0x2d7dc4['use']('/api/voice/extensions',require(_0xde8b('0x26')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x27'),require(_0xde8b('0x28')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x29'),require('./api/voiceQueue'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x2a'),require('./api/voiceRecording'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x2b'),require(_0xde8b('0x2c')));_0x2d7dc4['use'](_0xde8b('0x2d'),require('./api/voiceMail'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x2e'),require('./api/voiceMailMessage'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x2f'),require(_0xde8b('0x30')));_0x2d7dc4[_0xde8b('0x20')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x31'),require(_0xde8b('0x32')));_0x2d7dc4['use'](_0xde8b('0x33'),require('./api/voiceQueueReport'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x34'),require(_0xde8b('0x35')));_0x2d7dc4[_0xde8b('0x20')]('/api/trunks',require('./api/trunk'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x36'),require(_0xde8b('0x37')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x38'),require(_0xde8b('0x39')));_0x2d7dc4[_0xde8b('0x20')]('/api/mail/accounts',require(_0xde8b('0x3a')));_0x2d7dc4[_0xde8b('0x20')]('/api/mail/queues',require('./api/mailQueue'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x3b'),require(_0xde8b('0x3c')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x3d'),require(_0xde8b('0x3e')));_0x2d7dc4[_0xde8b('0x20')]('/api/mail/messages',require(_0xde8b('0x3f')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x40'),require(_0xde8b('0x41')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x42'),require(_0xde8b('0x43')));_0x2d7dc4[_0xde8b('0x20')]('/api/dashboards',require(_0xde8b('0x44')));_0x2d7dc4['use'](_0xde8b('0x45'),require('./api/dashboardItem'));_0x2d7dc4[_0xde8b('0x20')]('/api/fax/accounts',require(_0xde8b('0x46')));_0x2d7dc4['use'](_0xde8b('0x47'),require(_0xde8b('0x48')));_0x2d7dc4['use'](_0xde8b('0x49'),require(_0xde8b('0x4a')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x4b'),require(_0xde8b('0x4c')));_0x2d7dc4[_0xde8b('0x20')]('/api/fax/queues',require(_0xde8b('0x4d')));_0x2d7dc4[_0xde8b('0x20')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x2d7dc4[_0xde8b('0x20')]('/api/sms/accounts',require(_0xde8b('0x4e')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x4f'),require(_0xde8b('0x50')));_0x2d7dc4[_0xde8b('0x20')]('/api/sms/interactions',require(_0xde8b('0x51')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x52'),require('./api/smsMessage'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x53'),require(_0xde8b('0x54')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x55'),require('./api/openchannelAccount'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x56'),require('./api/openchannelApplication'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x57'),require(_0xde8b('0x58')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x59'),require(_0xde8b('0x5a')));_0x2d7dc4['use'](_0xde8b('0x5b'),require(_0xde8b('0x5c')));_0x2d7dc4[_0xde8b('0x20')]('/api/chat/websites',require(_0xde8b('0x5d')));_0x2d7dc4[_0xde8b('0x20')]('/api/openchannel/reports/queue',require(_0xde8b('0x5e')));_0x2d7dc4['use'](_0xde8b('0x5f'),require(_0xde8b('0x60')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x61'),require('./api/chatInteraction'));_0x2d7dc4[_0xde8b('0x20')]('/api/chat/messages',require(_0xde8b('0x62')));_0x2d7dc4['use'](_0xde8b('0x63'),require(_0xde8b('0x64')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x65'),require(_0xde8b('0x66')));_0x2d7dc4[_0xde8b('0x20')]('/api/chat/groups',require(_0xde8b('0x67')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x68'),require(_0xde8b('0x69')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x6a'),require(_0xde8b('0x6b')));_0x2d7dc4['use'](_0xde8b('0x6c'),require(_0xde8b('0x6d')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x6e'),require(_0xde8b('0x6f')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x70'),require(_0xde8b('0x71')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x72'),require('./api/cmHopperFinal'));_0x2d7dc4['use'](_0xde8b('0x73'),require(_0xde8b('0x74')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x75'),require(_0xde8b('0x76')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x77'),require(_0xde8b('0x78')));_0x2d7dc4[_0xde8b('0x20')]('/api/automations',require(_0xde8b('0x79')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x7a'),require(_0xde8b('0x7b')));_0x2d7dc4['use']('/api/dispositions',require(_0xde8b('0x7c')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x7d'),require('./api/condition'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x7e'),require(_0xde8b('0x7f')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x80'),require(_0xde8b('0x81')));_0x2d7dc4[_0xde8b('0x20')]('/api/cdr',require('./api/cdr'));_0x2d7dc4['use'](_0xde8b('0x82'),require(_0xde8b('0x83')));_0x2d7dc4['use']('/api/schedules',require(_0xde8b('0x84')));_0x2d7dc4['use'](_0xde8b('0x85'),require('./api/sound'));_0x2d7dc4['use']('/api/tags',require(_0xde8b('0x86')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x87'),require(_0xde8b('0x88')));_0x2d7dc4[_0xde8b('0x20')]('/api/triggers',require(_0xde8b('0x89')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x8a'),require(_0xde8b('0x8b')));_0x2d7dc4['use']('/api/integrations',require(_0xde8b('0x8c')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x8d'),require(_0xde8b('0x8e')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x8f'),require('./api/analyticCustomReport'));_0x2d7dc4[_0xde8b('0x20')]('/api/analytics/default_reports',require(_0xde8b('0x90')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x91'),require('./api/analyticExtractedReport'));_0x2d7dc4[_0xde8b('0x20')]('/api/analytics/metrics',require(_0xde8b('0x92')));_0x2d7dc4[_0xde8b('0x20')]('/api/analytics/field_reports',require(_0xde8b('0x93')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x94'),require(_0xde8b('0x95')));_0x2d7dc4['use'](_0xde8b('0x96'),require('./api/intSalesforceAccount'));_0x2d7dc4['use'](_0xde8b('0x97'),require(_0xde8b('0x98')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x99'),require(_0xde8b('0x9a')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x9b'),require(_0xde8b('0x9c')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x9d'),require(_0xde8b('0x9e')));_0x2d7dc4['use'](_0xde8b('0x9f'),require(_0xde8b('0xa0')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xa1'),require(_0xde8b('0xa2')));_0x2d7dc4['use']('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x2d7dc4['use']('/api/integrations/desk/fields',require(_0xde8b('0xa3')));_0x2d7dc4[_0xde8b('0x20')]('/api/integrations/zoho/accounts',require(_0xde8b('0xa4')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xa5'),require(_0xde8b('0xa6')));_0x2d7dc4['use'](_0xde8b('0xa7'),require(_0xde8b('0xa8')));_0x2d7dc4['use'](_0xde8b('0xa9'),require(_0xde8b('0xaa')));_0x2d7dc4[_0xde8b('0x20')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xab'),require(_0xde8b('0xac')));_0x2d7dc4['use'](_0xde8b('0xad'),require(_0xde8b('0xae')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xaf'),require(_0xde8b('0xb0')));_0x2d7dc4[_0xde8b('0x20')]('/api/integrations/freshdesk/fields',require(_0xde8b('0xb1')));_0x2d7dc4['use'](_0xde8b('0xb2'),require('./api/intVtigerAccount'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xb3'),require('./api/intVtigerConfiguration'));_0x2d7dc4[_0xde8b('0x20')]('/api/integrations/vtiger/fields',require(_0xde8b('0xb4')));_0x2d7dc4[_0xde8b('0x20')]('/api/integrations/servicenow/accounts',require(_0xde8b('0xb5')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xb6'),require(_0xde8b('0xb7')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xb8'),require(_0xde8b('0xb9')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xba'),require(_0xde8b('0xbb')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xbc'),require('./api/intDynamics365Configuration'));_0x2d7dc4['use']('/api/integrations/dynamics365/fields',require(_0xde8b('0xbd')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xbe'),require('./api/intFreshsalesAccount'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xbf'),require(_0xde8b('0xc0')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xc1'),require('./api/intFreshsalesField'));_0x2d7dc4[_0xde8b('0x20')]('/api/networks',require(_0xde8b('0xc2')));_0x2d7dc4['use'](_0xde8b('0xc3'),require('./api/chatQueueReport'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xc4'),require(_0xde8b('0xc5')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xc6'),require(_0xde8b('0xc7')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xc8'),require(_0xde8b('0xc9')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xca'),require('./api/jscriptySessionReport'));_0x2d7dc4['use']('/api/sms/reports/queue',require(_0xde8b('0xcb')));_0x2d7dc4['use']('/api/square/reports',require(_0xde8b('0xcc')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xcd'),require(_0xde8b('0xce')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xcf'),require('./api/jscriptyProject'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xd0'),require(_0xde8b('0xd1')));_0x2d7dc4['use']('/api/square/odbc',require(_0xde8b('0xd2')));_0x2d7dc4['use']('/api/square/projects',require(_0xde8b('0xd3')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xd4'),require(_0xde8b('0xd5')));_0x2d7dc4[_0xde8b('0x20')]('/api/square/messages',require(_0xde8b('0xd6')));_0x2d7dc4[_0xde8b('0x20')]('/api/teams',require(_0xde8b('0xd7')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xd8'),require('./api/license'));_0x2d7dc4[_0xde8b('0x20')]('/api/campaigns',require(_0xde8b('0xd9')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xda'),require('./api/migration'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xdb'),require('./api/attachment'));_0x2d7dc4['use'](_0xde8b('0xdc'),require(_0xde8b('0xdd')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xde'),require(_0xde8b('0xdf')));_0x2d7dc4['use'](_0xde8b('0xe0'),require(_0xde8b('0xe1')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xe2'),require('./api/faxTransferReport'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xe3'),require(_0xde8b('0xe4')));_0x2d7dc4['use'](_0xde8b('0xe5'),require(_0xde8b('0xe6')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xe7'),require(_0xde8b('0xe8')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xe9'),require(_0xde8b('0xea')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xeb'),require(_0xde8b('0xec')));_0x2d7dc4['use'](_0xde8b('0xed'),require(_0xde8b('0xee')));_0x2d7dc4[_0xde8b('0x20')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xef'),require('./api/userNotification'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xf0'),require(_0xde8b('0xf1')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xf2'),require('./api/whatsappApplication'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xf3'),require(_0xde8b('0xf4')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xf5'),require(_0xde8b('0xf6')));_0x2d7dc4[_0xde8b('0x20')]('/api/whatsapp/reports/queue',require(_0xde8b('0xf7')));_0x2d7dc4['use'](_0xde8b('0xf8'),require('./api/whatsappTransferReport'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xf9'),require('./api/whatsappQueue'));_0x2d7dc4[_0xde8b('0x20')]('/api/cloudProviders',require('./api/cloudProvider'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xfa'),require('./api/realtime'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xfb'),require('./api/authLocal'));_0x2d7dc4['use'](_0xde8b('0xfc'),require('./api/authGoogle'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xfd'),require(_0xde8b('0xfe')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0xff'),require('./api/rpc'));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x100'),require(_0xde8b('0x101')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x102'),require(_0xde8b('0x103')));_0x2d7dc4[_0xde8b('0x20')]('/api/pm2',require(_0xde8b('0x104')));_0x2d7dc4['use'](_0xde8b('0x105'),require(_0xde8b('0x106')));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x107'),express[_0xde8b('0x108')](path['join'](config[_0xde8b('0x109')],_0xde8b('0x107'))));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x10a'),express[_0xde8b('0x108')](path[_0xde8b('0x10b')](config['root'],_0xde8b('0x10a'))));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x10c'),express['static'](path['join'](config[_0xde8b('0x109')],_0xde8b('0x10c'))));_0x2d7dc4[_0xde8b('0x20')](_0xde8b('0x10d'),express[_0xde8b('0x108')](path[_0xde8b('0x10b')](config[_0xde8b('0x109')],'snippet',_0xde8b('0x10e'))));_0x2d7dc4['use']('/plugins',express['static'](path['join'](config[_0xde8b('0x109')],'/server/files/plugins')));_0x2d7dc4['route'](_0xde8b('0x10f'))[_0xde8b('0x110')](errors[0x194]);_0x2d7dc4['route']('/*')[_0xde8b('0x110')](function(_0x5efb17,_0x23356b){_0x23356b[_0xde8b('0x111')](path[_0xde8b('0x112')](_0x2d7dc4[_0xde8b('0x110')](_0xde8b('0x113'))+_0xde8b('0x114')));});};var sensitiveFields=[_0xde8b('0x115'),_0xde8b('0x116'),'newPassword',_0xde8b('0x117'),_0xde8b('0x118'),_0xde8b('0x119'),_0xde8b('0x11a'),_0xde8b('0x11b'),_0xde8b('0x11c'),_0xde8b('0x11d'),'email',_0xde8b('0x11e'),_0xde8b('0x11f'),_0xde8b('0x120'),_0xde8b('0x121'),_0xde8b('0x122'),_0xde8b('0x123'),_0xde8b('0x124'),'channelSecret','accessToken',_0xde8b('0x125'),_0xde8b('0x126'),_0xde8b('0x127'),'consumerSecret','membername',_0xde8b('0x128'),_0xde8b('0x129'),'exten',_0xde8b('0x12a'),_0xde8b('0x12b'),_0xde8b('0x12c'),_0xde8b('0x12d'),_0xde8b('0x12e'),_0xde8b('0x12f'),_0xde8b('0x13'),'pass','accountSid',_0xde8b('0x130'),_0xde8b('0x131'),_0xde8b('0x132'),_0xde8b('0x133'),'oldPassword'];function maskSensitiveData(_0x21a987){var _0x378275=/(?!^)[\s\S](?!$)/g;if(!_[_0xde8b('0x134')](_0x21a987))return;for(var _0x45e1db in _0x21a987){if(_[_0xde8b('0x135')](_0x21a987[_0x45e1db])){for(var _0x5d158b=0x0;_0x5d158b<_0x21a987[_0x45e1db][_0xde8b('0x136')];_0x5d158b++){maskSensitiveData(_0x21a987[_0x45e1db][_0x5d158b]);}}else if(_[_0xde8b('0x134')](_0x21a987[_0x45e1db])){maskSensitiveData(_0x21a987[_0x45e1db]);}else if(_['isString'](_0x21a987[_0x45e1db])){_0x21a987[_0x45e1db]=_0x21a987[_0x45e1db][_0xde8b('0x137')](/{{{/g,_0xde8b('0x138'))['replace'](/}}}/g,_0xde8b('0x139'))[_0xde8b('0x137')](/{{/g,'@{')[_0xde8b('0x137')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x45e1db)){_0x21a987[_0x45e1db]=_0x21a987[_0x45e1db][_0xde8b('0x137')](_0x378275,'*');}}}} \ No newline at end of file +var _0x64f2=['./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','./api/rpc','/api/version','/api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','/index.html','password','newPassword','apiKey','firstName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','key','accountSid','localstationid','dsn','registry','oldPassword','isPlainObject','isArray','length','replace','includes','lodash','express','util','./config/logger','api','auth','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','connection','remoteAddress','url','statusCode','responseTime','user','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','/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/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x64f2,0x105));var _0x264f=function(_0x360fc0,_0x131d38){_0x360fc0=_0x360fc0-0x0;var _0x23e8a1=_0x64f2[_0x360fc0];return _0x23e8a1;};'use strict';var _=require(_0x264f('0x0'));var path=require('path');var express=require(_0x264f('0x1'));var ewinston=require('express-winston');var util=require(_0x264f('0x2'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x264f('0x3'))(_0x264f('0x4'));var authLogger=require(_0x264f('0x3'))(_0x264f('0x5'));exports['default']=function(_0x26ad9b){_0x26ad9b[_0x264f('0x6')](ewinston[_0x264f('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x510f9d,_0x323d6e){var _0x399e9b=_0x264f('0x8');if(!_[_0x264f('0x9')](_0x510f9d[_0x264f('0xa')])){_0x399e9b+=_0x264f('0xb');var _0x363fef=_0x510f9d['body'];maskSensitiveData(_0x363fef);}return util[_0x264f('0xc')](_0x399e9b,_0x510f9d[_0x264f('0xd')],_0x510f9d['headers'][_0x264f('0xe')]?_0x510f9d[_0x264f('0xf')][_0x264f('0xe')]:_0x510f9d[_0x264f('0x10')][_0x264f('0x11')]||_0x510f9d['ip'],_0x510f9d[_0x264f('0x12')],_0x323d6e[_0x264f('0x13')],_0x323d6e[_0x264f('0x14')],_0x510f9d[_0x264f('0x15')]?_0x510f9d[_0x264f('0x15')]['id']:null,_0x510f9d[_0x264f('0x15')]?_0x510f9d[_0x264f('0x15')]['name']:null,_0x510f9d[_0x264f('0x15')]?_0x510f9d[_0x264f('0x15')][_0x264f('0x16')]:null,_0x363fef?util[_0x264f('0x17')](_0x363fef,![],null):'');}}));_0x26ad9b[_0x264f('0x6')](ewinston[_0x264f('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x285c6c,_0x3a7adb){var _0x4234a5=_0x264f('0x18');if(_0x285c6c[_0x264f('0xa')]&&_0x285c6c[_0x264f('0xa')][_0x264f('0x19')]&&_0x285c6c[_0x264f('0xa')][_0x264f('0x1a')]){_0x4234a5=_0x264f('0x1b');}return util[_0x264f('0xc')](_0x4234a5,_0x285c6c[_0x264f('0xd')],_0x285c6c[_0x264f('0xf')][_0x264f('0xe')]?_0x285c6c[_0x264f('0xf')]['x-forwarded-for']:_0x285c6c[_0x264f('0x10')]['remoteAddress']||_0x285c6c['ip'],_0x285c6c[_0x264f('0x12')],_0x3a7adb[_0x264f('0x13')],_0x3a7adb[_0x264f('0x14')],_0x285c6c[_0x264f('0x15')]?_0x285c6c['user']['id']:null,_0x285c6c[_0x264f('0x15')]?_0x285c6c['user']['name']:null,_0x285c6c[_0x264f('0x15')]?_0x285c6c['user'][_0x264f('0x16')]:null,_0x285c6c[_0x264f('0xa')]&&_0x285c6c[_0x264f('0xa')][_0x264f('0x19')]?_0x285c6c[_0x264f('0xa')]['device']:'other',_0x285c6c[_0x264f('0xa')]&&_0x285c6c['body']['agent_id']?_0x285c6c[_0x264f('0xa')]['agent_id']:'',_0x285c6c[_0x264f('0xa')]&&_0x285c6c[_0x264f('0xa')][_0x264f('0x1c')]?_0x285c6c[_0x264f('0xa')][_0x264f('0x1c')]:'');},'ignoreRoute':function(_0x1d5d23){var _0x14e20a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x14e20a[_0x264f('0x1d')](_0x1d5d23[_0x264f('0x12')]);}}));_0x26ad9b[_0x264f('0x6')](_0x264f('0x1e'),require(_0x264f('0x1f')));_0x26ad9b[_0x264f('0x6')]('/api/voice/chanspy',require(_0x264f('0x20')));_0x26ad9b['use'](_0x264f('0x21'),require('./api/voiceContext'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x22'),require('./api/voiceExtension'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x23'),require(_0x264f('0x24')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x25'),require(_0x264f('0x26')));_0x26ad9b['use'](_0x264f('0x27'),require(_0x264f('0x28')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x29'),require(_0x264f('0x2a')));_0x26ad9b['use'](_0x264f('0x2b'),require(_0x264f('0x2c')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x2d'),require(_0x264f('0x2e')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x2f'),require('./api/voiceCallReport'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x30'),require(_0x264f('0x31')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x32'),require(_0x264f('0x33')));_0x26ad9b[_0x264f('0x6')]('/api/voice/queues/reports',require(_0x264f('0x34')));_0x26ad9b['use'](_0x264f('0x35'),require(_0x264f('0x36')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x37'),require(_0x264f('0x38')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x39'),require(_0x264f('0x3a')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x3b'),require(_0x264f('0x3c')));_0x26ad9b[_0x264f('0x6')]('/api/mail/accounts',require(_0x264f('0x3d')));_0x26ad9b[_0x264f('0x6')]('/api/mail/queues',require(_0x264f('0x3e')));_0x26ad9b[_0x264f('0x6')]('/api/mail/substatuses',require(_0x264f('0x3f')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x40'),require(_0x264f('0x41')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x42'),require(_0x264f('0x43')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x44'),require(_0x264f('0x45')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x46'),require(_0x264f('0x47')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x48'),require(_0x264f('0x49')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x4a'),require(_0x264f('0x4b')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x4c'),require('./api/faxAccount'));_0x26ad9b[_0x264f('0x6')]('/api/fax/applications',require(_0x264f('0x4d')));_0x26ad9b['use'](_0x264f('0x4e'),require('./api/faxInteraction'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x4f'),require(_0x264f('0x50')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x51'),require(_0x264f('0x52')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x53'),require(_0x264f('0x54')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x55'),require(_0x264f('0x56')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x57'),require(_0x264f('0x58')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x59'),require(_0x264f('0x5a')));_0x26ad9b['use']('/api/sms/messages',require(_0x264f('0x5b')));_0x26ad9b[_0x264f('0x6')]('/api/sms/queues',require(_0x264f('0x5c')));_0x26ad9b['use']('/api/openchannel/accounts',require(_0x264f('0x5d')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x5e'),require(_0x264f('0x5f')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x60'),require(_0x264f('0x61')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x62'),require(_0x264f('0x63')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x64'),require(_0x264f('0x65')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x66'),require(_0x264f('0x67')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x68'),require(_0x264f('0x69')));_0x26ad9b['use'](_0x264f('0x6a'),require('./api/chatApplication'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x6b'),require(_0x264f('0x6c')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x6d'),require(_0x264f('0x6e')));_0x26ad9b['use'](_0x264f('0x6f'),require(_0x264f('0x70')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x71'),require('./api/chatQueue'));_0x26ad9b['use'](_0x264f('0x72'),require('./api/chatGroup'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x73'),require(_0x264f('0x74')));_0x26ad9b[_0x264f('0x6')]('/api/cm/companies',require('./api/cmCompany'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x75'),require('./api/cmContact'));_0x26ad9b['use'](_0x264f('0x76'),require('./api/cmHopper'));_0x26ad9b[_0x264f('0x6')]('/api/cm/hopper_black',require(_0x264f('0x77')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x78'),require(_0x264f('0x79')));_0x26ad9b['use'](_0x264f('0x7a'),require(_0x264f('0x7b')));_0x26ad9b[_0x264f('0x6')]('/api/cm/custom_fields',require(_0x264f('0x7c')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x7d'),require(_0x264f('0x7e')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x7f'),require(_0x264f('0x80')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x81'),require(_0x264f('0x82')));_0x26ad9b[_0x264f('0x6')]('/api/dispositions',require(_0x264f('0x83')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x84'),require(_0x264f('0x85')));_0x26ad9b[_0x264f('0x6')]('/api/intervals',require('./api/interval'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x86'),require('./api/pause'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x87'),require(_0x264f('0x88')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x89'),require('./api/voiceQueuesLog'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x8a'),require(_0x264f('0x8b')));_0x26ad9b['use'](_0x264f('0x8c'),require(_0x264f('0x8d')));_0x26ad9b['use']('/api/tags',require(_0x264f('0x8e')));_0x26ad9b['use'](_0x264f('0x8f'),require(_0x264f('0x90')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x91'),require(_0x264f('0x92')));_0x26ad9b['use'](_0x264f('0x93'),require('./api/variable'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x94'),require(_0x264f('0x95')));_0x26ad9b['use']('/api/integrations/reports',require(_0x264f('0x96')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x97'),require(_0x264f('0x98')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x99'),require('./api/analyticDefaultReport'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x9a'),require(_0x264f('0x9b')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x9c'),require('./api/analyticMetric'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x9d'),require(_0x264f('0x9e')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x9f'),require(_0x264f('0xa0')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xa1'),require(_0x264f('0xa2')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xa3'),require(_0x264f('0xa4')));_0x26ad9b['use']('/api/integrations/salesforce/fields',require(_0x264f('0xa5')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x26ad9b['use'](_0x264f('0xa6'),require('./api/intSugarcrmConfiguration'));_0x26ad9b[_0x264f('0x6')]('/api/integrations/sugarcrm/fields',require(_0x264f('0xa7')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xa8'),require('./api/intDeskAccount'));_0x26ad9b['use'](_0x264f('0xa9'),require(_0x264f('0xaa')));_0x26ad9b['use'](_0x264f('0xab'),require('./api/intDeskField'));_0x26ad9b['use'](_0x264f('0xac'),require(_0x264f('0xad')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xae'),require(_0x264f('0xaf')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/zendesk/accounts',require(_0x264f('0xb0')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xb1'),require(_0x264f('0xb2')));_0x26ad9b['use'](_0x264f('0xb3'),require(_0x264f('0xb4')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/freshdesk/accounts',require(_0x264f('0xb5')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xb6'),require('./api/intFreshdeskConfiguration'));_0x26ad9b['use']('/api/integrations/freshdesk/fields',require(_0x264f('0xb7')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/vtiger/accounts',require(_0x264f('0xb8')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xb9'),require(_0x264f('0xba')));_0x26ad9b['use'](_0x264f('0xbb'),require(_0x264f('0xbc')));_0x26ad9b['use'](_0x264f('0xbd'),require('./api/intServicenowAccount'));_0x26ad9b['use'](_0x264f('0xbe'),require('./api/intServicenowConfiguration'));_0x26ad9b[_0x264f('0x6')]('/api/integrations/servicenow/fields',require(_0x264f('0xbf')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc0'),require(_0x264f('0xc1')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/dynamics365/configurations',require(_0x264f('0xc2')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc3'),require('./api/intDynamics365Field'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc4'),require('./api/intFreshsalesAccount'));_0x26ad9b['use']('/api/integrations/freshsales/configurations',require(_0x264f('0xc5')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc6'),require(_0x264f('0xc7')));_0x26ad9b[_0x264f('0x6')]('/api/networks',require(_0x264f('0xc8')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc9'),require(_0x264f('0xca')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xcb'),require(_0x264f('0xcc')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xcd'),require(_0x264f('0xce')));_0x26ad9b['use']('/api/jscripty/questions/reports',require(_0x264f('0xcf')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xd0'),require(_0x264f('0xd1')));_0x26ad9b[_0x264f('0x6')]('/api/sms/reports/queue',require(_0x264f('0xd2')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xd3'),require(_0x264f('0xd4')));_0x26ad9b[_0x264f('0x6')]('/api/square/details/reports',require(_0x264f('0xd5')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xd6'),require(_0x264f('0xd7')));_0x26ad9b['use'](_0x264f('0xd8'),require(_0x264f('0xd9')));_0x26ad9b['use'](_0x264f('0xda'),require(_0x264f('0xdb')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xdc'),require(_0x264f('0xdd')));_0x26ad9b['use']('/api/square/recordings',require(_0x264f('0xde')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xdf'),require('./api/squareMessage'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe0'),require(_0x264f('0xe1')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe2'),require('./api/license'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe3'),require('./api/campaign'));_0x26ad9b['use'](_0x264f('0xe4'),require(_0x264f('0xe5')));_0x26ad9b[_0x264f('0x6')]('/api/attachments',require('./api/attachment'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe6'),require(_0x264f('0xe7')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe8'),require(_0x264f('0xe9')));_0x26ad9b[_0x264f('0x6')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x26ad9b[_0x264f('0x6')]('/api/fax/reports/transfer',require(_0x264f('0xea')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xeb'),require(_0x264f('0xec')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xed'),require(_0x264f('0xee')));_0x26ad9b['use'](_0x264f('0xef'),require(_0x264f('0xf0')));_0x26ad9b[_0x264f('0x6')]('/api/voice/prefixes',require(_0x264f('0xf1')));_0x26ad9b['use'](_0x264f('0xf2'),require('./api/userProfile'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xf3'),require(_0x264f('0xf4')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xf5'),require(_0x264f('0xf6')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xf7'),require(_0x264f('0xf8')));_0x26ad9b[_0x264f('0x6')]('/api/whatsapp/accounts',require(_0x264f('0xf9')));_0x26ad9b['use'](_0x264f('0xfa'),require(_0x264f('0xfb')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xfc'),require(_0x264f('0xfd')));_0x26ad9b[_0x264f('0x6')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x26ad9b[_0x264f('0x6')]('/api/whatsapp/reports/queue',require(_0x264f('0xfe')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xff'),require(_0x264f('0x100')));_0x26ad9b['use'](_0x264f('0x101'),require(_0x264f('0x102')));_0x26ad9b[_0x264f('0x6')]('/api/cloudProviders',require(_0x264f('0x103')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x104'),require(_0x264f('0x105')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x106'),require(_0x264f('0x107')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x108'),require(_0x264f('0x109')));_0x26ad9b[_0x264f('0x6')]('/api/jira',require('./api/jira'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x10a'),require(_0x264f('0x10b')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x10c'),require('./api/version'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x10d'),require('./api/system'));_0x26ad9b[_0x264f('0x6')]('/api/pm2',require(_0x264f('0x10e')));_0x26ad9b['use'](_0x264f('0x10f'),require(_0x264f('0x110')));_0x26ad9b['use'](_0x264f('0x111'),express[_0x264f('0x112')](path[_0x264f('0x113')](config[_0x264f('0x114')],_0x264f('0x111'))));_0x26ad9b[_0x264f('0x6')]('/www',express[_0x264f('0x112')](path[_0x264f('0x113')](config['root'],_0x264f('0x115'))));_0x26ad9b['use'](_0x264f('0x116'),express[_0x264f('0x112')](path[_0x264f('0x113')](config[_0x264f('0x114')],_0x264f('0x116'))));_0x26ad9b[_0x264f('0x6')](_0x264f('0x117'),express['static'](path[_0x264f('0x113')](config[_0x264f('0x114')],'snippet',_0x264f('0x118'))));_0x26ad9b[_0x264f('0x6')]('/plugins',express[_0x264f('0x112')](path[_0x264f('0x113')](config[_0x264f('0x114')],_0x264f('0x119'))));_0x26ad9b['route'](_0x264f('0x11a'))[_0x264f('0x11b')](errors[0x194]);_0x26ad9b[_0x264f('0x11c')]('/*')[_0x264f('0x11b')](function(_0x44a8b2,_0x405ed7){_0x405ed7[_0x264f('0x11d')](path[_0x264f('0x11e')](_0x26ad9b['get']('appPath')+_0x264f('0x11f')));});};var sensitiveFields=['username',_0x264f('0x120'),_0x264f('0x121'),_0x264f('0x122'),_0x264f('0x123'),'lastName',_0x264f('0x124'),_0x264f('0x125'),_0x264f('0x126'),_0x264f('0x127'),_0x264f('0x128'),_0x264f('0x129'),_0x264f('0x12a'),_0x264f('0x12b'),_0x264f('0x12c'),_0x264f('0x12d'),_0x264f('0x12e'),'token','channelSecret','accessToken','accessTokenSecret',_0x264f('0x12f'),_0x264f('0x130'),'consumerSecret','membername',_0x264f('0x131'),_0x264f('0x132'),_0x264f('0x133'),_0x264f('0x134'),_0x264f('0x135'),_0x264f('0x136'),_0x264f('0x137'),'secretaccesskey',_0x264f('0x138'),'user','pass',_0x264f('0x139'),_0x264f('0x13a'),_0x264f('0x13b'),'secret',_0x264f('0x13c'),_0x264f('0x13d')];function maskSensitiveData(_0x49089a){var _0x18e34c=/(?!^)[\s\S](?!$)/g;if(!_[_0x264f('0x13e')](_0x49089a))return;for(var _0x5884f1 in _0x49089a){if(_[_0x264f('0x13f')](_0x49089a[_0x5884f1])){for(var _0x3d46fb=0x0;_0x3d46fb<_0x49089a[_0x5884f1][_0x264f('0x140')];_0x3d46fb++){maskSensitiveData(_0x49089a[_0x5884f1][_0x3d46fb]);}}else if(_[_0x264f('0x13e')](_0x49089a[_0x5884f1])){maskSensitiveData(_0x49089a[_0x5884f1]);}else if(_['isString'](_0x49089a[_0x5884f1])){_0x49089a[_0x5884f1]=_0x49089a[_0x5884f1][_0x264f('0x141')](/{{{/g,'@@{')[_0x264f('0x141')](/}}}/g,'}@@')[_0x264f('0x141')](/{{/g,'@{')[_0x264f('0x141')](/}}/g,'}@');if(_[_0x264f('0x142')](sensitiveFields,_0x5884f1)){_0x49089a[_0x5884f1]=_0x49089a[_0x5884f1][_0x264f('0x141')](_0x18e34c,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 631f362..c0d2d98 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75d1=['../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/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x75d1,0x1a9));var _0x175d=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x75d1[_0x1035c1];return _0x308d67;};'use strict';var jayson=require(_0x175d('0x0'));var BPromise=require(_0x175d('0x1'));var _=require(_0x175d('0x2'));var config=require(_0x175d('0x3'));exports[_0x175d('0x4')]=function(){return new BPromise(function(_0x81881,_0x5dead2){var _0x24b747={};_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x6')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x7')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/voiceQueue/voiceQueue.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x8')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x9')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0xa')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0xb')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0xc')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/memberReport/memberReport.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0xd')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0xe')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0xf')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x10')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/mailAccount/mailAccount.rpc'));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x11')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/mailInteraction/mailInteraction.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x12')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/mailApplication/mailApplication.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x13')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x14')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x15')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x16')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x17')));_0x24b747=_['merge'](_0x24b747,require('../api/faxQueue/faxQueue.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x18')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x19')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x1a')));_0x24b747=_['merge'](_0x24b747,require('../api/smsMessage/smsMessage.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x1b')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x1c')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x1d')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x1e')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x1f')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x20')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/chatInteraction/chatInteraction.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x21')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x22')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x23')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x24')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x25')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x26')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x27')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x28')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x29')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x2a')));_0x24b747=_['merge'](_0x24b747,require('../api/sound/sound.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x2b')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x2c')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x2d')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x2e')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x2f')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x30')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x31')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x32')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x33')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x34')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x35')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x36')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x37')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x38')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x39')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x3a')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x3b')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x3c')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/squareProject/squareProject.rpc'));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x3d')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/squareMessage/squareMessage.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x3e')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x3f')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x40')));_0x24b747=_[_0x175d('0x5')](_0x24b747,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x24b747=_[_0x175d('0x5')](_0x24b747,require(_0x175d('0x41')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x42')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x43')));_0x24b747=_['merge'](_0x24b747,require(_0x175d('0x44')));var _0x402528=jayson[_0x175d('0x45')](_0x24b747)[_0x175d('0x46')]();var _0x370f8a=config[_0x175d('0x47')][_0x175d('0x48')]||config[_0x175d('0x48')]+0x1;var _0x590406=config['rpc']['ip']||_0x175d('0x49');_0x402528['on'](_0x175d('0x4a'),function(_0x37cc66){return _0x5dead2(_0x37cc66);});_0x402528[_0x175d('0x4')](_0x370f8a,_0x590406,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x590406,_0x370f8a);require('../config/triggers')[_0x175d('0x4b')]();return _0x81881(_0x175d('0x4c')+_0x590406+':'+_0x370f8a);});});}; \ No newline at end of file +var _0x6223=['RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.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/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/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.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','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6223,0x193));var _0x3622=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x6223[_0x28407a];return _0x8bd6ef;};'use strict';var jayson=require(_0x3622('0x0'));var BPromise=require(_0x3622('0x1'));var _=require(_0x3622('0x2'));var config=require(_0x3622('0x3'));exports['listen']=function(){return new BPromise(function(_0x4644ee,_0x1e6bf7){var _0x4ded58={};_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x4')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x5')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/voiceQueue/voiceQueue.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x7')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x8')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x9')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/memberReport/memberReport.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xa')));_0x4ded58=_['merge'](_0x4ded58,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x4ded58=_['merge'](_0x4ded58,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xb')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xc')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xd')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/mailInteraction/mailInteraction.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xe')));_0x4ded58=_['merge'](_0x4ded58,require('../api/mailApplication/mailApplication.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xf')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x10')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x11')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x12')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x13')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x14')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x15')));_0x4ded58=_['merge'](_0x4ded58,require('../api/smsAccount/smsAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x16')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/smsMessage/smsMessage.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x17')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x18')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x19')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x1a')));_0x4ded58=_['merge'](_0x4ded58,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1b')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1c')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1d')));_0x4ded58=_['merge'](_0x4ded58,require('../api/cmContact/cmContact.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1e')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1f')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x20')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x21')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x22')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x23')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x24')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x25')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/trigger/trigger.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x26')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x27')));_0x4ded58=_['merge'](_0x4ded58,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x28')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x29')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x2a')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x2b')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x2c')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x2d')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x2e')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x2f')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x30')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/squareOdbc/squareOdbc.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x31')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/squareRecording/squareRecording.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x32')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x33')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x34')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x35')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x36')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x37')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x38')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x39')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x3a')));var _0x1eb4fa=jayson[_0x3622('0x3b')](_0x4ded58)['http']();var _0xe18f8f=config[_0x3622('0x3c')]['port']||config[_0x3622('0x3d')]+0x1;var _0x5deab3=config['rpc']['ip']||'localhost';_0x1eb4fa['on']('error',function(_0x549c00){return _0x1e6bf7(_0x549c00);});_0x1eb4fa[_0x3622('0x3e')](_0xe18f8f,_0x5deab3,function(){console[_0x3622('0x3f')](_0x3622('0x40'),_0x5deab3,_0xe18f8f);require('../config/triggers')[_0x3622('0x41')]();return _0x4644ee(_0x3622('0x42')+_0x5deab3+':'+_0xe18f8f);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 472e0f6..0508660 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 _0x3441=['SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','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','AGI','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','emit','line','hangup','520-Invalid','search','520\x20End\x20of\x20proper','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','prototype','sync','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','sendRequest','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic'];(function(_0x50989f,_0x1e84fe){var _0x3e2bf6=function(_0x35ff76){while(--_0x35ff76){_0x50989f['push'](_0x50989f['shift']());}};_0x3e2bf6(++_0x1e84fe);}(_0x3441,0xf9));var _0x1344=function(_0x5b7584,_0x5bedb3){_0x5b7584=_0x5b7584-0x0;var _0x19397c=_0x3441[_0x5b7584];return _0x19397c;};'use strict';var util=require(_0x1344('0x0'));var _=require('lodash');var EventEmitter=require(_0x1344('0x1'))[_0x1344('0x2')];var AGIReply=require(_0x1344('0x3'));var AGIError=require(_0x1344('0x4'));function AGIChannel(_0x213a25){var _0x7e60fe=this,_0x204cce=new AGIReply(),_0x18e42f=![],_0x1373c9={};EventEmitter[_0x1344('0x5')](_0x7e60fe);_0x213a25[_0x1344('0x6')](_0x1344('0x7'));_0x213a25['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x204cce[_0x1344('0x6')]('utf8');_0x204cce['on']('headers',function(_0x3036a7){for(var _0x2cd767 in _0x3036a7){_0x7e60fe[_0x2cd767]=_0x3036a7[_0x2cd767];}_0x7e60fe[_0x1344('0x8')]('ready');});_0x204cce['on'](_0x1344('0x9'),function(_0x5d6c56){if(_0x5d6c56['toLowerCase']()=='hangup'){_0x7e60fe[_0x1344('0x8')](_0x1344('0xa'));return;}if(_0x5d6c56['substring'](0x0,0xb)==_0x1344('0xb')){_0x18e42f=!![];}if(_0x18e42f){_0x1373c9['rx']+=_0x5d6c56+'\x0a';if(_0x5d6c56[_0x1344('0xc')](_0x1344('0xd'))!=-0x1){_0x18e42f=![];}}else{_0x1373c9['rx']=_0x5d6c56;}if(_0x18e42f){return;}if(typeof _0x1373c9['cb']=='function'){var _0x21b57e=_0x1373c9['rx'][_0x1344('0xe')](0x0,0x3),_0x293a47=null,_0x51310d=null;_0x21b57e=parseInt(_0x21b57e);if(isNaN(_0x21b57e)){_0x1373c9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1344('0xf')});return;}if(_0x21b57e!=0xc8){_0x1373c9['cb'](null,{'code':_0x21b57e,'result':-0x1,'extra':'KO'});return;}_0x293a47=_0x1373c9['rx'][_0x1344('0xe')](0x4)[_0x1344('0x10')](_0x1344('0x11'),'');if(_0x293a47[_0x1344('0x12')]('\x20')!=-0x1){_0x293a47=_0x293a47[_0x1344('0x13')](0x0,_0x293a47[_0x1344('0x12')]('\x20'));}if(_[_0x1344('0x14')](_0x293a47,'-1')){_0x293a47=parseInt(_0x293a47);}_0x51310d=_0x1373c9['rx'][_0x1344('0x15')]('\x20');if(_0x51310d[_0x1344('0x16')]==0x3){_0x51310d=_0x51310d[0x2][_0x1344('0xe')](0x1,_0x51310d[0x2]['length']-0x1);}else if(_0x51310d[_0x1344('0x16')]>0x3){var _0x36832c=/\((.+)\)/;var _0x87dba1=_0x1373c9['rx']['match'](_0x36832c);if(_0x87dba1){_0x51310d=_0x87dba1[0x1];}else{_0x51310d=null;}}else{_0x51310d=null;}_0x1373c9['cb'](null,{'code':_0x21b57e,'result':_0x293a47,'extra':_0x51310d});}});_0x213a25['on']('error',function(_0x1ef36f){_0x7e60fe['emit'](_0x1344('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x1ef36f[_0x1344('0x18')]));});_0x213a25['on'](_0x1344('0x19'),function(){_0x7e60fe[_0x1344('0x8')](_0x1344('0x19'),new AGIError(_0x1344('0x1a')));});_0x213a25['on'](_0x1344('0x1b'),function(){_0x7e60fe['emit'](_0x1344('0x1b'),new AGIError(_0x1344('0x1c')));_0x213a25[_0x1344('0x1d')]();});_0x213a25[_0x1344('0x1e')](_0x204cce);this[_0x1344('0x1f')]=function(_0xbc90fb,_0x2e86b6){var _0xbc90fb=_0xbc90fb||'',_0x2e86b6=typeof _0x2e86b6==_0x1344('0x20')?_0x2e86b6:new Function();_0x1373c9={'tx':_0xbc90fb,'rx':'','cb':_0x2e86b6};_0x213a25[_0x1344('0x21')](_0xbc90fb+'\x0a');},this['close']=function(){_0x213a25[_0x1344('0x1d')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x1344('0x22')]['sendRequest']=function(_0x3ca967){return this['command'][_0x1344('0x23')](this,_0x3ca967);};AGIChannel['prototype']['answer']=function(){return this['sendRequest'](_0x1344('0x24'));};AGIChannel[_0x1344('0x22')][_0x1344('0x25')]=function(_0x27d89a,_0x3c5fe0,_0x3d73cf){_0x27d89a=_0x27d89a===undefined?_0x1344('0x26'):_0x27d89a;_0x3c5fe0=_0x3c5fe0===undefined?'5':_0x3c5fe0;_0x3d73cf=_0x3d73cf===undefined?'1':_0x3d73cf;return this['sendRequest'](util['format'](_0x1344('0x27'),_0x27d89a,_0x3c5fe0*0x3e8,_0x3d73cf));};AGIChannel['prototype']['noop']=function(_0xdd253b){_0xdd253b=_0xdd253b||_0x1344('0x28');return this[_0x1344('0x29')](util[_0x1344('0x2a')](_0x1344('0x2b'),_0xdd253b));};AGIChannel[_0x1344('0x22')][_0x1344('0x2c')]=function(_0x152dd4,_0x53916c){if(_[_0x1344('0x2d')](_0x53916c)){return this['sendRequest'](util[_0x1344('0x2a')](_0x1344('0x2e'),_0x152dd4,_0x53916c[_0x1344('0x2f')](',')));}return this['sendRequest'](util[_0x1344('0x2a')](_0x1344('0x2e'),_0x152dd4,_0x53916c));};AGIChannel['prototype'][_0x1344('0x30')]=function(_0x587e11){return this[_0x1344('0x29')](util[_0x1344('0x2a')](_0x1344('0x31'),_0x587e11));};AGIChannel[_0x1344('0x22')][_0x1344('0x32')]=function(_0x4a91e7){return this[_0x1344('0x29')](util[_0x1344('0x2a')](_0x1344('0x33'),_0x4a91e7));};AGIChannel[_0x1344('0x22')][_0x1344('0x34')]=function(_0x7514d5){return this[_0x1344('0x29')](util[_0x1344('0x2a')](_0x1344('0x35'),_0x7514d5));};AGIChannel['prototype'][_0x1344('0xa')]=function(){return this[_0x1344('0x29')](_0x1344('0x36'));};AGIChannel[_0x1344('0x22')][_0x1344('0x37')]=function(_0x46bb21,_0x3ea4ff){var _0x460edc=_['isBoolean'](_0x3ea4ff)||_[_0x1344('0x38')](_0x3ea4ff)?_0x3ea4ff[_0x1344('0x39')]():_0x3ea4ff;return this[_0x1344('0x29')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x46bb21,_0x460edc?_0x460edc['toString']()[_0x1344('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1344('0x22')][_0x1344('0x3a')]=function(_0x383542,_0x4d46f4){return this[_0x1344('0x29')](util[_0x1344('0x2a')](_0x1344('0x3b'),_0x383542,_0x4d46f4));};AGIChannel[_0x1344('0x22')][_0x1344('0x3c')]=function(_0x1a369e,_0x2045f3){return this[_0x1344('0x29')](util['format'](_0x1344('0x3d'),_0x1a369e,_0x2045f3));};AGIChannel[_0x1344('0x22')][_0x1344('0x3e')]=function(_0x2b417e,_0xabc6cc){return this[_0x1344('0x29')](util[_0x1344('0x2a')](_0x1344('0x3f'),_0x2b417e,_0xabc6cc));};AGIChannel[_0x1344('0x22')][_0x1344('0x40')]=function(_0x4ae7e3,_0x432a64,_0x2d4332){_0x432a64=_0x432a64||this[_0x1344('0x41')];_0x2d4332=_0x2d4332||0x1;this[_0x1344('0x30')](_0x4ae7e3);this[_0x1344('0x32')](_0x432a64);this[_0x1344('0x34')](_0x2d4332);return this[_0x1344('0x42')](util[_0x1344('0x2a')](_0x1344('0x43'),_0x4ae7e3,_0x432a64,_0x2d4332));};AGIChannel[_0x1344('0x22')]['getVariable']=function(_0x8018b7){return this[_0x1344('0x29')](util[_0x1344('0x2a')]('GET\x20VARIABLE\x20\x22%s\x22',_0x8018b7));};AGIChannel[_0x1344('0x22')][_0x1344('0x44')]=function(_0x4a57f7,_0x3eaa29,_0x1eaa55,_0xe36009,_0x4bafd1,_0x4afaa2){_0x3eaa29=_0x3eaa29||_0x1344('0x45');_0x1eaa55=_0x1eaa55||'';_0xe36009=_0xe36009===undefined?-0x1:_0xe36009==='-1'?-0x1:_0xe36009*0x3e8;_0x4bafd1=_0x4bafd1===undefined?'':'s='+_0x4bafd1;_0x4afaa2=_0x4afaa2?_0x1344('0x46'):'';return this[_0x1344('0x29')](util[_0x1344('0x2a')](_0x1344('0x47'),_0x4a57f7,_0x3eaa29,_0x1eaa55,_0xe36009,_0x4afaa2,_0x4bafd1));};AGIChannel[_0x1344('0x22')][_0x1344('0x48')]=function(_0xaae1f,_0x55e12c){_0x55e12c=_0x55e12c||'';return this[_0x1344('0x29')](util[_0x1344('0x2a')](_0x1344('0x49'),_0xaae1f,_0x55e12c));};AGIChannel[_0x1344('0x22')][_0x1344('0x4a')]=function(_0x4d7bfc){return this[_0x1344('0x2c')](_0x1344('0x4b'),_0x4d7bfc);};AGIChannel[_0x1344('0x22')]['wait']=function(_0x3d4ca7){return this[_0x1344('0x2c')]('WAIT',_0x3d4ca7);};AGIChannel[_0x1344('0x22')]['error']=function(_0x56c2d5,_0x212640){this[_0x1344('0x42')](util[_0x1344('0x2a')](_0x1344('0x4c'),_0x56c2d5['id'],_0x56c2d5[_0x1344('0x4d')],_0x212640));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x9cb4=['hangup','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','continueAt','extension','setExtension','noop','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','substring','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','split','length','match','error','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','ANSWER','getData','beep','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x9cb4,0x12d));var _0x49cb=function(_0x1ffeae,_0x1fb5fb){_0x1ffeae=_0x1ffeae-0x0;var _0x103b9f=_0x9cb4[_0x1ffeae];return _0x103b9f;};'use strict';var util=require(_0x49cb('0x0'));var _=require(_0x49cb('0x1'));var EventEmitter=require(_0x49cb('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x4c5975){var _0x206f9c=this,_0x16a194=new AGIReply(),_0x7bb002=![],_0x55f663={};EventEmitter[_0x49cb('0x3')](_0x206f9c);_0x4c5975[_0x49cb('0x4')](_0x49cb('0x5'));_0x4c5975[_0x49cb('0x6')](0x8*0x3c*0x3c*0x3e8);_0x16a194['setEncoding']('utf8');_0x16a194['on'](_0x49cb('0x7'),function(_0x4770c6){for(var _0x11017a in _0x4770c6){_0x206f9c[_0x11017a]=_0x4770c6[_0x11017a];}_0x206f9c[_0x49cb('0x8')](_0x49cb('0x9'));});_0x16a194['on'](_0x49cb('0xa'),function(_0x1c3c76){if(_0x1c3c76[_0x49cb('0xb')]()=='hangup'){_0x206f9c[_0x49cb('0x8')]('hangup');return;}if(_0x1c3c76[_0x49cb('0xc')](0x0,0xb)=='520-Invalid'){_0x7bb002=!![];}if(_0x7bb002){_0x55f663['rx']+=_0x1c3c76+'\x0a';if(_0x1c3c76['search'](_0x49cb('0xd'))!=-0x1){_0x7bb002=![];}}else{_0x55f663['rx']=_0x1c3c76;}if(_0x7bb002){return;}if(typeof _0x55f663['cb']=='function'){var _0x29058d=_0x55f663['rx']['substring'](0x0,0x3),_0x5288b4=null,_0xded295=null;_0x29058d=parseInt(_0x29058d);if(isNaN(_0x29058d)){_0x55f663['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x49cb('0xe')});return;}if(_0x29058d!=0xc8){_0x55f663['cb'](null,{'code':_0x29058d,'result':-0x1,'extra':'KO'});return;}_0x5288b4=_0x55f663['rx'][_0x49cb('0xc')](0x4)[_0x49cb('0xf')]('result=','');if(_0x5288b4[_0x49cb('0x10')]('\x20')!=-0x1){_0x5288b4=_0x5288b4[_0x49cb('0x11')](0x0,_0x5288b4['indexOf']('\x20'));}if(_['startsWith'](_0x5288b4,'-1')){_0x5288b4=parseInt(_0x5288b4);}_0xded295=_0x55f663['rx'][_0x49cb('0x12')]('\x20');if(_0xded295[_0x49cb('0x13')]==0x3){_0xded295=_0xded295[0x2][_0x49cb('0xc')](0x1,_0xded295[0x2][_0x49cb('0x13')]-0x1);}else if(_0xded295[_0x49cb('0x13')]>0x3){var _0x3d058e=/\((.+)\)/;var _0x1038ef=_0x55f663['rx'][_0x49cb('0x14')](_0x3d058e);if(_0x1038ef){_0xded295=_0x1038ef[0x1];}else{_0xded295=null;}}else{_0xded295=null;}_0x55f663['cb'](null,{'code':_0x29058d,'result':_0x5288b4,'extra':_0xded295});}});_0x4c5975['on']('error',function(_0x5eec57){_0x206f9c[_0x49cb('0x8')](_0x49cb('0x15'),new AGIError('E_AGI_SOCKET_ERROR',_0x5eec57['code']));});_0x4c5975['on']('close',function(){_0x206f9c[_0x49cb('0x8')](_0x49cb('0x16'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4c5975['on']('timeout',function(){_0x206f9c[_0x49cb('0x8')](_0x49cb('0x17'),new AGIError(_0x49cb('0x18')));_0x4c5975[_0x49cb('0x19')]();});_0x4c5975[_0x49cb('0x1a')](_0x16a194);this[_0x49cb('0x1b')]=function(_0x41e862,_0x505674){var _0x41e862=_0x41e862||'',_0x505674=typeof _0x505674==_0x49cb('0x1c')?_0x505674:new Function();_0x55f663={'tx':_0x41e862,'rx':'','cb':_0x505674};_0x4c5975[_0x49cb('0x1d')](_0x41e862+'\x0a');},this['close']=function(){_0x4c5975[_0x49cb('0x19')]();};}util[_0x49cb('0x1e')](AGIChannel,EventEmitter);AGIChannel[_0x49cb('0x1f')][_0x49cb('0x20')]=function(_0x2ae9d9){return this[_0x49cb('0x1b')][_0x49cb('0x21')](this,_0x2ae9d9);};AGIChannel['prototype']['answer']=function(){return this['sendRequest'](_0x49cb('0x22'));};AGIChannel['prototype'][_0x49cb('0x23')]=function(_0x2d4d16,_0x3b68e6,_0x29ce33){_0x2d4d16=_0x2d4d16===undefined?_0x49cb('0x24'):_0x2d4d16;_0x3b68e6=_0x3b68e6===undefined?'5':_0x3b68e6;_0x29ce33=_0x29ce33===undefined?'1':_0x29ce33;return this['sendRequest'](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2d4d16,_0x3b68e6*0x3e8,_0x29ce33));};AGIChannel[_0x49cb('0x1f')]['noop']=function(_0x3c4fee){_0x3c4fee=_0x3c4fee||_0x49cb('0x25');return this[_0x49cb('0x20')](util[_0x49cb('0x26')](_0x49cb('0x27'),_0x3c4fee));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x28')]=function(_0x1ca58c,_0x5ec899){if(_[_0x49cb('0x29')](_0x5ec899)){return this[_0x49cb('0x20')](util['format'](_0x49cb('0x2a'),_0x1ca58c,_0x5ec899[_0x49cb('0x2b')](',')));}return this[_0x49cb('0x20')](util[_0x49cb('0x26')]('EXEC\x20%s\x20%s',_0x1ca58c,_0x5ec899));};AGIChannel['prototype'][_0x49cb('0x2c')]=function(_0x383e7b){return this[_0x49cb('0x20')](util[_0x49cb('0x26')](_0x49cb('0x2d'),_0x383e7b));};AGIChannel[_0x49cb('0x1f')]['setExtension']=function(_0x33bf63){return this[_0x49cb('0x20')](util[_0x49cb('0x26')](_0x49cb('0x2e'),_0x33bf63));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x2f')]=function(_0x3f2bee){return this['sendRequest'](util[_0x49cb('0x26')](_0x49cb('0x30'),_0x3f2bee));};AGIChannel['prototype'][_0x49cb('0x31')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x32')]=function(_0x409c46,_0xc1c4d5){var _0x41bdce=_['isBoolean'](_0xc1c4d5)||_[_0x49cb('0x33')](_0xc1c4d5)?_0xc1c4d5['toString']():_0xc1c4d5;return this[_0x49cb('0x20')](util[_0x49cb('0x26')](_0x49cb('0x34'),_0x409c46,_0x41bdce?_0x41bdce[_0x49cb('0x35')]()[_0x49cb('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x49cb('0x36')]=function(_0x448dd0,_0x498381){return this['sendRequest'](util['format'](_0x49cb('0x37'),_0x448dd0,_0x498381));};AGIChannel['prototype'][_0x49cb('0x38')]=function(_0x355419,_0x5aac90){return this[_0x49cb('0x20')](util[_0x49cb('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x355419,_0x5aac90));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x39')]=function(_0x247705,_0xe3dfd4){return this[_0x49cb('0x20')](util[_0x49cb('0x26')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x247705,_0xe3dfd4));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x3a')]=function(_0x9ea72d,_0x37567a,_0x31f28f){_0x37567a=_0x37567a||this[_0x49cb('0x3b')];_0x31f28f=_0x31f28f||0x1;this[_0x49cb('0x2c')](_0x9ea72d);this[_0x49cb('0x3c')](_0x37567a);this[_0x49cb('0x2f')](_0x31f28f);return this[_0x49cb('0x3d')](util[_0x49cb('0x26')]('GOTO\x20%s\x20%s\x20%s',_0x9ea72d,_0x37567a,_0x31f28f));};AGIChannel[_0x49cb('0x1f')]['getVariable']=function(_0x44854c){return this[_0x49cb('0x20')](util[_0x49cb('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x44854c));};AGIChannel['prototype'][_0x49cb('0x3e')]=function(_0x3da09b,_0x54d525,_0x251fd0,_0x2cd8e3,_0x2e1b61,_0x42e0a5){_0x54d525=_0x54d525||_0x49cb('0x3f');_0x251fd0=_0x251fd0||'';_0x2cd8e3=_0x2cd8e3===undefined?-0x1:_0x2cd8e3==='-1'?-0x1:_0x2cd8e3*0x3e8;_0x2e1b61=_0x2e1b61===undefined?'':'s='+_0x2e1b61;_0x42e0a5=_0x42e0a5?_0x49cb('0x40'):'';return this[_0x49cb('0x20')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3da09b,_0x54d525,_0x251fd0,_0x2cd8e3,_0x42e0a5,_0x2e1b61));};AGIChannel['prototype'][_0x49cb('0x41')]=function(_0x59c7fa,_0x4a49eb){_0x4a49eb=_0x4a49eb||'';return this['sendRequest'](util[_0x49cb('0x26')](_0x49cb('0x42'),_0x59c7fa,_0x4a49eb));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x43')]=function(_0x24f750){return this['exec']('AGI',_0x24f750);};AGIChannel[_0x49cb('0x1f')]['wait']=function(_0x4b5d35){return this[_0x49cb('0x28')]('WAIT',_0x4b5d35);};AGIChannel['prototype'][_0x49cb('0x15')]=function(_0x51f70f,_0x380756){this[_0x49cb('0x3d')](util[_0x49cb('0x26')](_0x49cb('0x44'),_0x51f70f['id'],_0x51f70f['label'],_0x380756));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x49cb('0x45')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 7af2443..6f84b6b 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 _0x82ae=['Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','exports','util','Undefined\x20error.','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.'];(function(_0x44624d,_0x2a1c58){var _0x6339a3=function(_0x330366){while(--_0x330366){_0x44624d['push'](_0x44624d['shift']());}};_0x6339a3(++_0x2a1c58);}(_0x82ae,0x86));var _0xe82a=function(_0x466fc3,_0x390219){_0x466fc3=_0x466fc3-0x0;var _0x110202=_0x82ae[_0x466fc3];return _0x110202;};'use strict';var util=require(_0xe82a('0x0'));var error={'E_AGI_UNDEFINED':_0xe82a('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xe82a('0x2'),'E_AGI_SERVER_CLOSE':_0xe82a('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xe82a('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xe82a('0x5'),'E_AGI_SOCKET_ERROR':_0xe82a('0x6'),'E_AGI_SOCKET_CLOSE':_0xe82a('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xe82a('0x8'),'E_AGI_COMMAND_EMPTY':_0xe82a('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xe82a('0xa'),'E_AGI_IVR_ENTRY':_0xe82a('0xb')};function AGIError(_0x1810a4){var _0x1810a4=_0x1810a4||null,_0x3833bb=_0x3833bb||[],_0x1fbf3d=0x1,_0x53d91b='';if(!error[_0x1810a4]){_0x1810a4='E_AGI_UNDEFINED';}_0x3833bb[_0xe82a('0xc')](error[_0x1810a4]);while(arguments[_0x1fbf3d]){_0x3833bb[_0xe82a('0xc')](arguments[_0x1fbf3d]);_0x1fbf3d++;}_0x53d91b=util[_0xe82a('0xd')][_0xe82a('0xe')](util,_0x3833bb);this[_0xe82a('0xf')]=_0x53d91b;this[_0xe82a('0x10')]=_0x1810a4;}module[_0xe82a('0x11')]=AGIError; \ No newline at end of file +var _0x7db8=['push','format','apply','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED'];(function(_0x5b6d0c,_0x4467cb){var _0x292fa1=function(_0x3abdc3){while(--_0x3abdc3){_0x5b6d0c['push'](_0x5b6d0c['shift']());}};_0x292fa1(++_0x4467cb);}(_0x7db8,0xac));var _0x87db=function(_0x37f28a,_0x384771){_0x37f28a=_0x37f28a-0x0;var _0x13c8da=_0x7db8[_0x37f28a];return _0x13c8da;};'use strict';var util=require(_0x87db('0x0'));var error={'E_AGI_UNDEFINED':_0x87db('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x87db('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x87db('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x87db('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x87db('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x87db('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x4c2395){var _0x4c2395=_0x4c2395||null,_0x52618c=_0x52618c||[],_0x3c8515=0x1,_0x386338='';if(!error[_0x4c2395]){_0x4c2395=_0x87db('0x7');}_0x52618c[_0x87db('0x8')](error[_0x4c2395]);while(arguments[_0x3c8515]){_0x52618c['push'](arguments[_0x3c8515]);_0x3c8515++;}_0x386338=util[_0x87db('0x9')][_0x87db('0xa')](util,_0x52618c);this['message']=_0x386338;this[_0x87db('0xb')]=_0x4c2395;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index e295977..ce5455c 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 _0xb00a=['agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','menu','getdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition'];(function(_0x4a1c,_0x4a002b){var _0x3095a3=function(_0xbf85df){while(--_0xbf85df){_0x4a1c['push'](_0x4a1c['shift']());}};_0x3095a3(++_0x4a002b);}(_0xb00a,0x9f));var _0xab00=function(_0x283698,_0x235fce){_0x283698=_0x283698-0x0;var _0x5cb02b=_0xb00a[_0x283698];return _0x5cb02b;};'use strict';var _=require(_0xab00('0x0'));var logger=require(_0xab00('0x1'))('agi');var verticesWithRetry=[_0xab00('0x2'),_0xab00('0x3'),'getsecretdigits'];var Graph=function(){this[_0xab00('0x4')]={};this[_0xab00('0x5')]={};this[_0xab00('0x6')]=0x0;};Graph[_0xab00('0x7')][_0xab00('0x8')]=function(_0x16e5a9){this[_0xab00('0x4')][_0x16e5a9['id']]=_0x16e5a9;this['edges'][_0x16e5a9['id']]=[];};Graph[_0xab00('0x7')][_0xab00('0x9')]=function(_0x5df961,_0x5e55b4,_0x25fc13){this[_0xab00('0x5')][_0x5df961][_0xab00('0xa')]({'target':_0x5e55b4,'condition':_0x25fc13});this[_0xab00('0x6')]+=0x1;};Graph['prototype'][_0xab00('0xb')]=function(){return _[_0xab00('0xb')](this['vertices']);};Graph['prototype'][_0xab00('0xc')]=function(){return this[_0xab00('0x6')];};Graph[_0xab00('0x7')][_0xab00('0xd')]=function(_0x29a3ba){return this[_0xab00('0x4')][_0x29a3ba];};Graph['prototype'][_0xab00('0xe')]=function(_0x10dece,_0x292daa){if(!this[_0xab00('0x4')][_0x10dece]){return logger['info'](_0xab00('0xf'));}var _0xae37fd=_0x292daa(this['vertices'][_0x10dece]);if(!_0xae37fd){return logger[_0xab00('0x10')](_0xab00('0x11'));}if(this[_0xab00('0x5')][_0x10dece][_0xab00('0x12')]===0x0){return logger[_0xab00('0x10')](_0xab00('0x13'));}for(var _0x7e974b=0x0,_0x1fdd80=[],_0x21852e=![];_0x7e974b\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','[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]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','finally','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','agi','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','message','format','[%s]\x20%s','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','source','addEdge','target','getSquareProject','catch','createSquareReport','then','substring','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','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority'];(function(_0x53fc13,_0x5e225d){var _0x5e5a5e=function(_0x4410bf){while(--_0x4410bf){_0x53fc13['push'](_0x53fc13['shift']());}};_0x5e5a5e(++_0x5e225d);}(_0xa656,0x1ed));var _0x6a65=function(_0x3866ad,_0x7bdee5){_0x3866ad=_0x3866ad-0x0;var _0x169411=_0xa656[_0x3866ad];return _0x169411;};'use strict';var parser=require(_0x6a65('0x0'));var _=require(_0x6a65('0x1'));var syncho=require(_0x6a65('0x2'));var util=require(_0x6a65('0x3'));var moment=require(_0x6a65('0x4'));var config=require(_0x6a65('0x5'));var logger=require('../../config/logger')(_0x6a65('0x6'));var utilLicense=require('../../config/license/util');var rpc=require(_0x6a65('0x7'));var mailRpc=require(_0x6a65('0x8'));var Graph=require('./graph');var Vertices=require(_0x6a65('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x6a65('0x6')]=_[_0x6a65('0xa')](config['agi'],{'ip':_0x6a65('0xb'),'port':0x11dd});function connectionHandler(_0x3b8f36){process[_0x6a65('0xc')](function(){syncho(function(){try{setChannelVariables(_0x3b8f36);agiHandler(_0x3b8f36);}catch(_0x2a4a89){logger[_0x6a65('0xd')](_0x2a4a89[_0x6a65('0xe')]);}});});}function listeningHandler(){console['log'](_0x6a65('0xf'),config[_0x6a65('0x6')]['port']);logger[_0x6a65('0x10')](util['format'](_0x6a65('0x11'),config['agi']['ip'],config[_0x6a65('0x6')][_0x6a65('0x12')]));}function errorHandler(_0x19e08c){if(_0x19e08c&&_0x19e08c['name']&&_0x19e08c[_0x6a65('0x13')]){logger['error'](util[_0x6a65('0x14')](_0x6a65('0x15'),_0x19e08c[_0x6a65('0x16')],_0x19e08c['message']));}else{logger[_0x6a65('0xd')](util['format'](_0x6a65('0x17'),_0x19e08c[_0x6a65('0xe')]));}}function closeHandler(){logger['info'](util[_0x6a65('0x14')](_0x6a65('0x18'),this['arg_1'],this[_0x6a65('0x19')],this['callerid'],this[_0x6a65('0x1a')],this[_0x6a65('0x1b')]));try{createSquareReport(this);}catch(_0x3290b4){logger[_0x6a65('0xd')](_0x3290b4[_0x6a65('0xe')]);}}function timeoutHandler(){logger[_0x6a65('0x10')](util[_0x6a65('0x14')](_0x6a65('0x1c'),this['arg_1'],this[_0x6a65('0x19')],this[_0x6a65('0x1d')],this[_0x6a65('0x1a')],this[_0x6a65('0x1b')]));}function hangupHandler(){logger[_0x6a65('0x10')](util[_0x6a65('0x14')](_0x6a65('0x1e'),this[_0x6a65('0x1f')],this[_0x6a65('0x19')],this['callerid'],this[_0x6a65('0x1a')],this[_0x6a65('0x1b')]));this[_0x6a65('0x20')]=!![];}function getRoot(_0x167389){return parser[_0x6a65('0x21')](_0x167389,{'object':!![]})[_0x6a65('0x22')][_0x6a65('0x23')];}function addVertex(_0x137ceb,_0x290356,_0x2fc361){_0x290356['agicommand']=_0x2fc361;if(_0x290356[_0x6a65('0x24')]('retry')){_0x290356[_0x6a65('0x25')]=parseInt(_0x290356[_0x6a65('0x26')],0xa);}_0x137ceb[_0x6a65('0x27')](_[_0x6a65('0x28')](_0x290356,_0x6a65('0x29')));}function initGraph(_0x572bf9,_0x28c939){var _0x2f2405=new Graph();for(var _0x89454e in _0x572bf9){if(_0x572bf9[_0x6a65('0x24')](_0x89454e)){if(_[_0x6a65('0x2a')](_0x572bf9[_0x89454e])){for(var _0x4c17bc=0x0;_0x4c17bc<_0x572bf9[_0x89454e]['length'];_0x4c17bc+=0x1){addVertex(_0x2f2405,_0x572bf9[_0x89454e][_0x4c17bc],_0x89454e);}}else{addVertex(_0x2f2405,_0x572bf9[_0x89454e],_0x89454e);}}}for(var _0x4ac9d6=0x0;_0x4ac9d6<_0x28c939['length'];_0x4ac9d6+=0x1){if(_0x28c939[_0x4ac9d6][_0x6a65('0x2b')]&&_0x28c939[_0x4ac9d6]['target']){_0x2f2405[_0x6a65('0x2c')](_0x28c939[_0x4ac9d6]['source'],_0x28c939[_0x4ac9d6][_0x6a65('0x2d')],_0x28c939[_0x4ac9d6]['value']);}}return _0x2f2405;}function getSquareProject(_0x26ed4c,_0x641f7){rpc[_0x6a65('0x2e')](_0x26ed4c)['then'](function(_0x2784af){_0x641f7(null,_0x2784af);})[_0x6a65('0x2f')](function(_0xe94797){_0x641f7(null,_0xe94797);});}function createSquareReport(_0x9bac07,_0x57b5a9){rpc[_0x6a65('0x30')](_0x9bac07)[_0x6a65('0x31')](function(_0x36fbfd){if(_0x57b5a9){_0x57b5a9(null,_0x36fbfd);}})[_0x6a65('0x2f')](function(_0x5f4968){if(_0x57b5a9){_0x57b5a9(null,_0x5f4968);}});}function setChannelVariables(_0x11bf1c){for(var _0x2950a5 in _0x11bf1c){if(_0x11bf1c[_0x6a65('0x24')](_0x2950a5)){if(_0x2950a5['indexOf']('agi_')===0x0){_0x11bf1c[_0x2950a5[_0x6a65('0x32')](0x4)]=_0x11bf1c[_0x2950a5];delete _0x11bf1c[_0x2950a5];}}}}function getLogFromObject(_0x5b555b){return util['inspect'](_0x5b555b,{'showHidden':![],'depth':null});}function agiHandler(_0x2ff6ae){var _0x452ee9,_0x59eecd,_0x2cf839,_0x325b95,_0x3aeb7c;logger[_0x6a65('0x33')](_0x6a65('0x34'),JSON[_0x6a65('0x35')](_0x2ff6ae,null,0x2));logger[_0x6a65('0x10')](util[_0x6a65('0x14')](_0x6a65('0x36'),_0x2ff6ae[_0x6a65('0x1f')],_0x2ff6ae[_0x6a65('0x19')],_0x2ff6ae[_0x6a65('0x1d')],_0x2ff6ae[_0x6a65('0x1a')],_0x2ff6ae[_0x6a65('0x1b')]));_0x2ff6ae['on'](_0x6a65('0xd'),errorHandler);_0x2ff6ae['on'](_0x6a65('0x37'),closeHandler);_0x2ff6ae['on'](_0x6a65('0x38'),timeoutHandler);_0x2ff6ae[_0x6a65('0x20')]=![];_0x2ff6ae['on'](_0x6a65('0x39'),hangupHandler);var _0x1cf665=getSquareProject[_0x6a65('0x3a')](null,_0x2ff6ae[_0x6a65('0x1f')]);if(_0x1cf665){if(_0x1cf665['production']){_0x452ee9=getRoot(_0x1cf665[_0x6a65('0x3b')]);if(_0x452ee9&&_0x452ee9[_0x6a65('0x3c')]){logger['debug']('root',JSON[_0x6a65('0x35')](_0x452ee9,null,0x2));_0x2ff6ae[_0x6a65('0x3d')]=moment()[_0x6a65('0x14')](_0x6a65('0x3e'));_0x59eecd=initGraph(_[_0x6a65('0x28')](_0x452ee9,_0x6a65('0x29')),_0x452ee9[_0x6a65('0x29')]);_0x2cf839=new Vertices(_0x2ff6ae,rpc,mailRpc);logger[_0x6a65('0x10')](util[_0x6a65('0x14')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2ff6ae[_0x6a65('0x1f')],_0x2ff6ae[_0x6a65('0x19')],_0x2ff6ae['callerid'],_0x2ff6ae[_0x6a65('0x1a')],_0x2ff6ae[_0x6a65('0x1b')]));_0x59eecd[_0x6a65('0x3f')](_0x452ee9[_0x6a65('0x3c')]['id'],function(_0x2234c9){try{_0x2234c9=_0x2cf839[_0x6a65('0x40')](_0x2234c9);logger['debug']('vertex',JSON['stringify'](_0x2234c9,null,0x2));if(_0x2234c9[_0x6a65('0x41')]===_0x6a65('0x42')){logger['info'](_0x6a65('0x43'));_0x2ff6ae['context']=_0x2234c9[_0x6a65('0x44')]||_0x2ff6ae[_0x6a65('0x44')];_0x2ff6ae[_0x6a65('0x45')]=_0x2234c9[_0x6a65('0x45')];_0x2ff6ae[_0x6a65('0x46')]=_0x2234c9[_0x6a65('0x46')]?_0x2234c9['priority']-0x1:0x1;return null;}else if(_0x2234c9&&_0x2cf839[_0x2234c9[_0x6a65('0x41')]]){_0x3aeb7c=_0x2cf839[_0x2234c9[_0x6a65('0x41')]](_0x2234c9);logger[_0x6a65('0x10')](_0x6a65('0x47'),JSON[_0x6a65('0x35')](_0x3aeb7c,null,0x2));if(_0x3aeb7c&&_0x3aeb7c[_0x6a65('0x48')]===AGI_CODE_SUCCESS&&_0x3aeb7c[_0x6a65('0x49')]!==AGI_RESULT_ERROR&&!_0x2ff6ae['evtHangup']){logger[_0x6a65('0x33')](_0x6a65('0x47'),getLogFromObject(_0x3aeb7c));return _[_0x6a65('0x4a')](_0x3aeb7c[_0x6a65('0x49')])?null:_0x3aeb7c[_0x6a65('0x49')][_0x6a65('0x4b')]();}else{logger[_0x6a65('0xd')](_0x6a65('0x47'),getLogFromObject(_0x3aeb7c));return null;}}else{logger[_0x6a65('0xd')](_0x6a65('0x4c'));return null;}}catch(_0x2a7faf){logger['error'](_0x2a7faf['stack']);return null;}});if(_0x452ee9['finally']){logger[_0x6a65('0x10')](util[_0x6a65('0x14')](_0x6a65('0x4d'),_0x2ff6ae[_0x6a65('0x1f')],_0x2ff6ae['calleridname'],_0x2ff6ae[_0x6a65('0x1d')],_0x2ff6ae[_0x6a65('0x1a')],_0x2ff6ae[_0x6a65('0x1b')]));_0x59eecd[_0x6a65('0x3f')](_0x452ee9['finally']['id'],function(_0x4840f4){try{_0x4840f4=_0x2cf839[_0x6a65('0x40')](_0x4840f4);logger[_0x6a65('0x33')](_0x6a65('0x4e'),JSON[_0x6a65('0x35')](_0x4840f4,null,0x2));if(_0x4840f4&&_0x2cf839[_0x4840f4[_0x6a65('0x41')]]){_0x3aeb7c=_0x2cf839[_0x4840f4[_0x6a65('0x41')]](_0x4840f4);if(_0x3aeb7c){logger['debug'](_0x6a65('0x47'),getLogFromObject(_0x3aeb7c));return _[_0x6a65('0x4a')](_0x3aeb7c[_0x6a65('0x49')])?null:_0x3aeb7c[_0x6a65('0x49')][_0x6a65('0x4b')]();}else{logger[_0x6a65('0xd')](_0x6a65('0x47'),getLogFromObject(_0x3aeb7c));return null;}}else{logger[_0x6a65('0xd')](_0x6a65('0x4c'));return null;}}catch(_0x30dc54){logger[_0x6a65('0xd')](_0x30dc54[_0x6a65('0xe')]);return null;}});}logger['info'](util[_0x6a65('0x14')](_0x6a65('0x4f'),_0x2ff6ae[_0x6a65('0x1f')],_0x2ff6ae[_0x6a65('0x19')],_0x2ff6ae['callerid'],_0x2ff6ae[_0x6a65('0x1a')],_0x2ff6ae[_0x6a65('0x1b')]));logger[_0x6a65('0x10')](util[_0x6a65('0x14')](_0x6a65('0x50'),_0x2ff6ae[_0x6a65('0x44')],_0x2ff6ae[_0x6a65('0x45')],parseInt(_0x2ff6ae['priority'],0xa)+0x1));_0x2ff6ae[_0x6a65('0x51')](_0x2ff6ae[_0x6a65('0x44')],_0x2ff6ae[_0x6a65('0x45')],parseInt(_0x2ff6ae[_0x6a65('0x46')],0xa)+0x1);_0x2ff6ae[_0x6a65('0x37')]();}}else{logger['error'](util[_0x6a65('0x14')](_0x6a65('0x52'),_0x2ff6ae[_0x6a65('0x1f')]));_0x2ff6ae[_0x6a65('0x51')](_0x2ff6ae['context'],_0x2ff6ae[_0x6a65('0x45')],parseInt(_0x2ff6ae[_0x6a65('0x46')],0xa)+0x1);_0x2ff6ae[_0x6a65('0x37')]();}}else{logger[_0x6a65('0xd')](util['format'](_0x6a65('0x53'),_0x2ff6ae['arg_1']));_0x2ff6ae[_0x6a65('0x51')](_0x2ff6ae[_0x6a65('0x44')],_0x2ff6ae[_0x6a65('0x45')],parseInt(_0x2ff6ae[_0x6a65('0x46')],0xa)+0x1);_0x2ff6ae[_0x6a65('0x37')]();}}function main(){var _0x333f52;return utilLicense[_0x6a65('0x54')]()[_0x6a65('0x31')](function(_0x5f34b7){if(_0x5f34b7){if(_0x5f34b7[_0x6a65('0x55')]){if(_0x5f34b7[_0x6a65('0x56')]&&_0x5f34b7[_0x6a65('0x56')]>0x0){logger['info'](util[_0x6a65('0x14')](_0x6a65('0x57'),_0x5f34b7['callysquare']));_0x333f52=_0x5f34b7[_0x6a65('0x56')];}else{logger['info'](_0x6a65('0x58'));}}else{logger[_0x6a65('0x10')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x333f52=-0x1;}}})[_0x6a65('0x2f')](function(_0x53fdc8){logger[_0x6a65('0xd')](_0x6a65('0x59'),_0x53fdc8[_0x6a65('0xe')]);})[_0x6a65('0x5a')](function(){var _0x19229e=require(_0x6a65('0x5b'))(config[_0x6a65('0x6')][_0x6a65('0x12')],config[_0x6a65('0x6')]['ip'],_0x333f52);_0x19229e['on']('error',errorHandler);_0x19229e['on'](_0x6a65('0x5c'),listeningHandler);_0x19229e['on'](_0x6a65('0x5d'),connectionHandler);_0x19229e['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x6940=['./server','listening','connection','util','moment','agi','../../config/license/util','./rpc','./graph','./vertices','defaults','127.0.0.1','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','error','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','evtHangup','toJson','mxGraphModel','hasOwnProperty','retry','maxRetry','addVertex','omit','length','source','target','addEdge','value','then','catch','createSquareReport','indexOf','agi_','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','debug','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]'];(function(_0x5bc7b9,_0xb0772f){var _0x5e52fe=function(_0x343e0a){while(--_0x343e0a){_0x5bc7b9['push'](_0x5bc7b9['shift']());}};_0x5e52fe(++_0xb0772f);}(_0x6940,0x1c0));var _0x0694=function(_0x53daaa,_0x4e55f0){_0x53daaa=_0x53daaa-0x0;var _0x39f6a2=_0x6940[_0x53daaa];return _0x39f6a2;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require('syncho');var util=require(_0x0694('0x0'));var moment=require(_0x0694('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x0694('0x2'));var utilLicense=require(_0x0694('0x3'));var rpc=require(_0x0694('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0x0694('0x5'));var Vertices=require(_0x0694('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x0694('0x2')]=_[_0x0694('0x7')](config['agi'],{'ip':_0x0694('0x8'),'port':0x11dd});function connectionHandler(_0x4ddddd){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4ddddd);agiHandler(_0x4ddddd);}catch(_0x3cee22){logger['error'](_0x3cee22[_0x0694('0x9')]);}});});}function listeningHandler(){console[_0x0694('0xa')](_0x0694('0xb'),config[_0x0694('0x2')]['port']);logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0xe'),config[_0x0694('0x2')]['ip'],config[_0x0694('0x2')][_0x0694('0xf')]));}function errorHandler(_0xc938ef){if(_0xc938ef&&_0xc938ef[_0x0694('0x10')]&&_0xc938ef['message']){logger[_0x0694('0x11')](util[_0x0694('0xd')](_0x0694('0x12'),_0xc938ef['name'],_0xc938ef['message']));}else{logger[_0x0694('0x11')](util[_0x0694('0xd')](_0x0694('0x13'),_0xc938ef[_0x0694('0x9')]));}}function closeHandler(){logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x14'),this[_0x0694('0x15')],this[_0x0694('0x16')],this['callerid'],this['dnid'],this[_0x0694('0x17')]));try{createSquareReport(this);}catch(_0x5ecc8f){logger['error'](_0x5ecc8f[_0x0694('0x9')]);}}function timeoutHandler(){logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x18'),this[_0x0694('0x15')],this['calleridname'],this['callerid'],this[_0x0694('0x19')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x0694('0xd')](_0x0694('0x1a'),this[_0x0694('0x15')],this[_0x0694('0x16')],this[_0x0694('0x1b')],this[_0x0694('0x19')],this[_0x0694('0x17')]));this[_0x0694('0x1c')]=!![];}function getRoot(_0x2a5caf){return parser[_0x0694('0x1d')](_0x2a5caf,{'object':!![]})[_0x0694('0x1e')]['root'];}function addVertex(_0x146627,_0x483142,_0x3b3321){_0x483142['agicommand']=_0x3b3321;if(_0x483142[_0x0694('0x1f')](_0x0694('0x20'))){_0x483142[_0x0694('0x21')]=parseInt(_0x483142['retry'],0xa);}_0x146627[_0x0694('0x22')](_[_0x0694('0x23')](_0x483142,'mxCell'));}function initGraph(_0x1f7df1,_0x297b55){var _0x46ae4a=new Graph();for(var _0x4a0648 in _0x1f7df1){if(_0x1f7df1[_0x0694('0x1f')](_0x4a0648)){if(_['isArray'](_0x1f7df1[_0x4a0648])){for(var _0x166efc=0x0;_0x166efc<_0x1f7df1[_0x4a0648][_0x0694('0x24')];_0x166efc+=0x1){addVertex(_0x46ae4a,_0x1f7df1[_0x4a0648][_0x166efc],_0x4a0648);}}else{addVertex(_0x46ae4a,_0x1f7df1[_0x4a0648],_0x4a0648);}}}for(var _0x9f732e=0x0;_0x9f732e<_0x297b55['length'];_0x9f732e+=0x1){if(_0x297b55[_0x9f732e][_0x0694('0x25')]&&_0x297b55[_0x9f732e][_0x0694('0x26')]){_0x46ae4a[_0x0694('0x27')](_0x297b55[_0x9f732e][_0x0694('0x25')],_0x297b55[_0x9f732e]['target'],_0x297b55[_0x9f732e][_0x0694('0x28')]);}}return _0x46ae4a;}function getSquareProject(_0x2bdb21,_0x1541d9){rpc['getSquareProject'](_0x2bdb21)[_0x0694('0x29')](function(_0x1f89a8){_0x1541d9(null,_0x1f89a8);})[_0x0694('0x2a')](function(_0x5df18c){_0x1541d9(null,_0x5df18c);});}function createSquareReport(_0x33d950,_0x198e46){rpc[_0x0694('0x2b')](_0x33d950)[_0x0694('0x29')](function(_0x389ae3){if(_0x198e46){_0x198e46(null,_0x389ae3);}})[_0x0694('0x2a')](function(_0xdcf0ae){if(_0x198e46){_0x198e46(null,_0xdcf0ae);}});}function setChannelVariables(_0x4721fc){for(var _0xe86b3a in _0x4721fc){if(_0x4721fc[_0x0694('0x1f')](_0xe86b3a)){if(_0xe86b3a[_0x0694('0x2c')](_0x0694('0x2d'))===0x0){_0x4721fc[_0xe86b3a['substring'](0x4)]=_0x4721fc[_0xe86b3a];delete _0x4721fc[_0xe86b3a];}}}}function getLogFromObject(_0x453e2d){return util[_0x0694('0x2e')](_0x453e2d,{'showHidden':![],'depth':null});}function agiHandler(_0x22cabf){var _0x73eada,_0x5ed4a8,_0x5ddbbb,_0x3e6173,_0x260402;logger['debug'](_0x0694('0x2f'),JSON[_0x0694('0x30')](_0x22cabf,null,0x2));logger[_0x0694('0xc')](util['format'](_0x0694('0x31'),_0x22cabf['arg_1'],_0x22cabf[_0x0694('0x16')],_0x22cabf[_0x0694('0x1b')],_0x22cabf[_0x0694('0x19')],_0x22cabf['uniqueid']));_0x22cabf['on'](_0x0694('0x11'),errorHandler);_0x22cabf['on']('close',closeHandler);_0x22cabf['on'](_0x0694('0x32'),timeoutHandler);_0x22cabf['evtHangup']=![];_0x22cabf['on']('hangup',hangupHandler);var _0x153baf=getSquareProject['sync'](null,_0x22cabf[_0x0694('0x15')]);if(_0x153baf){if(_0x153baf[_0x0694('0x33')]){_0x73eada=getRoot(_0x153baf[_0x0694('0x33')]);if(_0x73eada&&_0x73eada[_0x0694('0x34')]){logger['debug']('root',JSON[_0x0694('0x30')](_0x73eada,null,0x2));_0x22cabf[_0x0694('0x35')]=moment()['format'](_0x0694('0x36'));_0x5ed4a8=initGraph(_[_0x0694('0x23')](_0x73eada,'mxCell'),_0x73eada[_0x0694('0x37')]);_0x5ddbbb=new Vertices(_0x22cabf,rpc,mailRpc);logger['info'](util[_0x0694('0xd')](_0x0694('0x38'),_0x22cabf['arg_1'],_0x22cabf[_0x0694('0x16')],_0x22cabf['callerid'],_0x22cabf[_0x0694('0x19')],_0x22cabf[_0x0694('0x17')]));_0x5ed4a8[_0x0694('0x39')](_0x73eada[_0x0694('0x34')]['id'],function(_0x34ec3c){try{_0x34ec3c=_0x5ddbbb[_0x0694('0x3a')](_0x34ec3c);logger[_0x0694('0x3b')](_0x0694('0x3c'),JSON['stringify'](_0x34ec3c,null,0x2));if(_0x34ec3c[_0x0694('0x3d')]===_0x0694('0x3e')){logger[_0x0694('0xc')](_0x0694('0x3f'));_0x22cabf[_0x0694('0x40')]=_0x34ec3c[_0x0694('0x40')]||_0x22cabf['context'];_0x22cabf[_0x0694('0x41')]=_0x34ec3c['extension'];_0x22cabf['priority']=_0x34ec3c[_0x0694('0x42')]?_0x34ec3c[_0x0694('0x42')]-0x1:0x1;return null;}else if(_0x34ec3c&&_0x5ddbbb[_0x34ec3c[_0x0694('0x3d')]]){_0x260402=_0x5ddbbb[_0x34ec3c[_0x0694('0x3d')]](_0x34ec3c);logger[_0x0694('0xc')](_0x0694('0x43'),JSON[_0x0694('0x30')](_0x260402,null,0x2));if(_0x260402&&_0x260402[_0x0694('0x44')]===AGI_CODE_SUCCESS&&_0x260402['result']!==AGI_RESULT_ERROR&&!_0x22cabf[_0x0694('0x1c')]){logger[_0x0694('0x3b')](_0x0694('0x43'),getLogFromObject(_0x260402));return _['isUndefined'](_0x260402['result'])?null:_0x260402[_0x0694('0x45')]['toString']();}else{logger[_0x0694('0x11')](_0x0694('0x43'),getLogFromObject(_0x260402));return null;}}else{logger['error'](_0x0694('0x46'));return null;}}catch(_0x4281bd){logger['error'](_0x4281bd[_0x0694('0x9')]);return null;}});if(_0x73eada[_0x0694('0x47')]){logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x48'),_0x22cabf['arg_1'],_0x22cabf[_0x0694('0x16')],_0x22cabf[_0x0694('0x1b')],_0x22cabf[_0x0694('0x19')],_0x22cabf[_0x0694('0x17')]));_0x5ed4a8[_0x0694('0x39')](_0x73eada[_0x0694('0x47')]['id'],function(_0x3ba77c){try{_0x3ba77c=_0x5ddbbb[_0x0694('0x3a')](_0x3ba77c);logger['debug'](_0x0694('0x3c'),JSON[_0x0694('0x30')](_0x3ba77c,null,0x2));if(_0x3ba77c&&_0x5ddbbb[_0x3ba77c[_0x0694('0x3d')]]){_0x260402=_0x5ddbbb[_0x3ba77c['agicommand']](_0x3ba77c);if(_0x260402){logger[_0x0694('0x3b')](_0x0694('0x43'),getLogFromObject(_0x260402));return _[_0x0694('0x49')](_0x260402[_0x0694('0x45')])?null:_0x260402[_0x0694('0x45')][_0x0694('0x4a')]();}else{logger[_0x0694('0x11')](_0x0694('0x43'),getLogFromObject(_0x260402));return null;}}else{logger[_0x0694('0x11')](_0x0694('0x46'));return null;}}catch(_0x48961c){logger[_0x0694('0x11')](_0x48961c['stack']);return null;}});}logger['info'](util['format'](_0x0694('0x4b'),_0x22cabf['arg_1'],_0x22cabf[_0x0694('0x16')],_0x22cabf[_0x0694('0x1b')],_0x22cabf[_0x0694('0x19')],_0x22cabf[_0x0694('0x17')]));logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x4c'),_0x22cabf['context'],_0x22cabf[_0x0694('0x41')],parseInt(_0x22cabf['priority'],0xa)+0x1));_0x22cabf[_0x0694('0x4d')](_0x22cabf[_0x0694('0x40')],_0x22cabf['extension'],parseInt(_0x22cabf['priority'],0xa)+0x1);_0x22cabf['close']();}}else{logger[_0x0694('0x11')](util['format']('Project\x20%s\x20not\x20published',_0x22cabf[_0x0694('0x15')]));_0x22cabf[_0x0694('0x4d')](_0x22cabf[_0x0694('0x40')],_0x22cabf[_0x0694('0x41')],parseInt(_0x22cabf[_0x0694('0x42')],0xa)+0x1);_0x22cabf[_0x0694('0x4e')]();}}else{logger['error'](util[_0x0694('0xd')](_0x0694('0x4f'),_0x22cabf['arg_1']));_0x22cabf[_0x0694('0x4d')](_0x22cabf['context'],_0x22cabf['extension'],parseInt(_0x22cabf['priority'],0xa)+0x1);_0x22cabf[_0x0694('0x4e')]();}}function main(){var _0x28f442;return utilLicense[_0x0694('0x50')]()[_0x0694('0x29')](function(_0x34b594){if(_0x34b594){if(_0x34b594[_0x0694('0x51')]){if(_0x34b594['callysquare']&&_0x34b594[_0x0694('0x52')]>0x0){logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x53'),_0x34b594['callysquare']));_0x28f442=_0x34b594[_0x0694('0x52')];}else{logger['info'](_0x0694('0x54'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x28f442=-0x1;}}})[_0x0694('0x2a')](function(_0x431a6f){logger['error'](_0x0694('0x55'),_0x431a6f[_0x0694('0x9')]);})[_0x0694('0x47')](function(){var _0x5c7e91=require(_0x0694('0x56'))(config[_0x0694('0x2')]['port'],config['agi']['ip'],_0x28f442);_0x5c7e91['on'](_0x0694('0x11'),errorHandler);_0x5c7e91['on'](_0x0694('0x57'),listeningHandler);_0x5c7e91['on'](_0x0694('0x58'),connectionHandler);_0x5c7e91['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 31fce38..8f24e65 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 _0x472f=['message','result','catch','sendMailMessage','SendMail','jayson/promise','request','then','error'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x472f,0x101));var _0xf472=function(_0x4b1830,_0x2ce3b6){_0x4b1830=_0x4b1830-0x0;var _0x236cf0=_0x472f[_0x4b1830];return _0x236cf0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xf472('0x0'));var client=jayson['client']['http']({'port':0x232b});function request(_0x56e45c,_0x4b392d){return new BPromise(function(_0x319096,_0x3be6a4){return client[_0xf472('0x1')](_0x56e45c,_0x4b392d)[_0xf472('0x2')](function(_0x176a59){if(_0x176a59[_0xf472('0x3')]){return _0x3be6a4(_0x176a59[_0xf472('0x3')][_0xf472('0x4')]);}else{return _0x319096(_0x176a59[_0xf472('0x5')]);}})[_0xf472('0x6')](function(_0x499351){return _0x3be6a4(_0x499351);});});}exports[_0xf472('0x7')]=function(_0x3827bc,_0x14e429){return request(_0xf472('0x8'),{'account':_0x3827bc,'message':_0x14e429});}; \ No newline at end of file +var _0xe2af=['error','message','catch','SendMail','bluebird','client','http','request','then'];(function(_0x2ff8ae,_0x459670){var _0x52d112=function(_0x1388eb){while(--_0x1388eb){_0x2ff8ae['push'](_0x2ff8ae['shift']());}};_0x52d112(++_0x459670);}(_0xe2af,0x124));var _0xfe2a=function(_0x335bf8,_0x483d57){_0x335bf8=_0x335bf8-0x0;var _0x3c2c4a=_0xe2af[_0x335bf8];return _0x3c2c4a;};'use strict';var BPromise=require(_0xfe2a('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xfe2a('0x1')][_0xfe2a('0x2')]({'port':0x232b});function request(_0x3a875d,_0x4a7197){return new BPromise(function(_0x274d01,_0x192ee3){return client[_0xfe2a('0x3')](_0x3a875d,_0x4a7197)[_0xfe2a('0x4')](function(_0x3a5d14){if(_0x3a5d14[_0xfe2a('0x5')]){return _0x192ee3(_0x3a5d14[_0xfe2a('0x5')][_0xfe2a('0x6')]);}else{return _0x274d01(_0x3a5d14['result']);}})[_0xfe2a('0x7')](function(_0x222f23){return _0x192ee3(_0x222f23);});});}exports['sendMailMessage']=function(_0x36386a,_0x1994b6){return request(_0xfe2a('0x8'),{'account':_0x36386a,'message':_0x1994b6});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index debae7f..b873965 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 _0x233d=['indexOf','substring','length','split','trim','slice','emit','headers','_inBody','line','exports','util','stream','Transform','call','_localBuffer','prototype','\x0d\x0a\x0d\x0a'];(function(_0x229bd3,_0x210f83){var _0x26f5d3=function(_0x18590f){while(--_0x18590f){_0x229bd3['push'](_0x229bd3['shift']());}};_0x26f5d3(++_0x210f83);}(_0x233d,0xbf));var _0xd233=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0x233d[_0x1db831];return _0x39ba56;};'use strict';var util=require(_0xd233('0x0'));var Transform=require(_0xd233('0x1'))[_0xd233('0x2')];function AGIReply(_0x4e6b29){Transform[_0xd233('0x3')](this,_0x4e6b29);this[_0xd233('0x4')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xd233('0x5')]['_transform']=function(_0x1557af,_0x229956,_0x1df121){var _0x33ba20='\x0a',_0x155ce2=['\x0a\x0a',_0xd233('0x6')],_0x1cfb21=-0x1,_0x2cc335=-0x1,_0x41ec8a='',_0x2c64b4=0x0,_0x4d925a='',_0x22ea1c='';this[_0xd233('0x4')]+=_0x1557af['toString']();_0x4d925a=this[_0xd233('0x4')];if(!this['_inBody']){_0x2c64b4=0x0;while(_0x155ce2[_0x2c64b4]){while((_0x2cc335=_0x4d925a[_0xd233('0x7')](_0x155ce2[_0x2c64b4]))!=-0x1){_0x41ec8a=_0x155ce2[_0x2c64b4];_0x22ea1c=_0x4d925a['substring'](0x0,_0x2cc335);_0x4d925a=_0x4d925a[_0xd233('0x8')](_0x2cc335+_0x41ec8a[_0xd233('0x9')]);var _0x3bef07=_0x22ea1c[_0xd233('0xa')](_0x33ba20),_0xe4d9d2=0x0,_0x56c884={},_0x2fed6f='',_0x2ac0db='',_0x198247=-0x1;while(_0x3bef07[_0xe4d9d2]){_0x198247=_0x3bef07[_0xe4d9d2]['indexOf'](':');if(_0x198247!=-0x1){_0x2fed6f=_0x3bef07[_0xe4d9d2]['slice'](0x0,_0x198247)[_0xd233('0xb')]();_0x2ac0db=_0x3bef07[_0xe4d9d2][_0xd233('0xc')](_0x198247+0x1)[_0xd233('0xb')]();if(_0x2fed6f[_0xd233('0x9')]>0x0){_0x56c884[_0x2fed6f]=_0x2ac0db;}}else{}_0xe4d9d2++;}this[_0xd233('0xd')](_0xd233('0xe'),_0x56c884);this[_0xd233('0xf')]=!![];}_0x2c64b4++;}this[_0xd233('0x4')]=_0x4d925a;}else{while((_0x1cfb21=_0x4d925a[_0xd233('0x7')](_0x33ba20))!=-0x1){_0x22ea1c=_0x4d925a[_0xd233('0x8')](0x0,_0x1cfb21);this['emit'](_0xd233('0x10'),_0x22ea1c);_0x4d925a=_0x4d925a[_0xd233('0x8')](_0x1cfb21+_0x33ba20['length']);}this[_0xd233('0x4')]=_0x4d925a;}_0x1df121();};module[_0xd233('0x11')]=AGIReply; \ No newline at end of file +var _0x9b8c=['length','split','slice','trim','emit','headers','line','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','toString','indexOf','substring'];(function(_0x20b4fd,_0x30c883){var _0x411180=function(_0x38fd5b){while(--_0x38fd5b){_0x20b4fd['push'](_0x20b4fd['shift']());}};_0x411180(++_0x30c883);}(_0x9b8c,0x1ed));var _0xc9b8=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x9b8c[_0x555b2f];return _0x81c0a6;};'use strict';var util=require(_0xc9b8('0x0'));var Transform=require(_0xc9b8('0x1'))[_0xc9b8('0x2')];function AGIReply(_0x282332){Transform[_0xc9b8('0x3')](this,_0x282332);this[_0xc9b8('0x4')]='';this[_0xc9b8('0x5')]=![];}util[_0xc9b8('0x6')](AGIReply,Transform);AGIReply[_0xc9b8('0x7')]['_transform']=function(_0x39c320,_0x56d7cd,_0x14d0e0){var _0x50ec93='\x0a',_0x396b52=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x3425f1=-0x1,_0x2450ea=-0x1,_0x5d0afa='',_0xe696cd=0x0,_0xd26828='',_0x3c6517='';this[_0xc9b8('0x4')]+=_0x39c320[_0xc9b8('0x8')]();_0xd26828=this[_0xc9b8('0x4')];if(!this['_inBody']){_0xe696cd=0x0;while(_0x396b52[_0xe696cd]){while((_0x2450ea=_0xd26828[_0xc9b8('0x9')](_0x396b52[_0xe696cd]))!=-0x1){_0x5d0afa=_0x396b52[_0xe696cd];_0x3c6517=_0xd26828['substring'](0x0,_0x2450ea);_0xd26828=_0xd26828[_0xc9b8('0xa')](_0x2450ea+_0x5d0afa[_0xc9b8('0xb')]);var _0x1df582=_0x3c6517[_0xc9b8('0xc')](_0x50ec93),_0x1b278b=0x0,_0x46a668={},_0x101545='',_0x3114bd='',_0x202e17=-0x1;while(_0x1df582[_0x1b278b]){_0x202e17=_0x1df582[_0x1b278b][_0xc9b8('0x9')](':');if(_0x202e17!=-0x1){_0x101545=_0x1df582[_0x1b278b][_0xc9b8('0xd')](0x0,_0x202e17)['trim']();_0x3114bd=_0x1df582[_0x1b278b][_0xc9b8('0xd')](_0x202e17+0x1)[_0xc9b8('0xe')]();if(_0x101545[_0xc9b8('0xb')]>0x0){_0x46a668[_0x101545]=_0x3114bd;}}else{}_0x1b278b++;}this[_0xc9b8('0xf')](_0xc9b8('0x10'),_0x46a668);this[_0xc9b8('0x5')]=!![];}_0xe696cd++;}this[_0xc9b8('0x4')]=_0xd26828;}else{while((_0x3425f1=_0xd26828[_0xc9b8('0x9')](_0x50ec93))!=-0x1){_0x3c6517=_0xd26828[_0xc9b8('0xa')](0x0,_0x3425f1);this[_0xc9b8('0xf')](_0xc9b8('0x11'),_0x3c6517);_0xd26828=_0xd26828[_0xc9b8('0xa')](_0x3425f1+_0x50ec93['length']);}this['_localBuffer']=_0xd26828;}_0x14d0e0();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 91792d9..01e7a20 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 _0x8f0d=['arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','lodash','util','jayson/promise','client','request','error','message','result','getSquareProject','ShowSquareProject','production','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','save_name','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x8f0d,0x82));var _0xd8f0=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8f0d[_0x56482c];return _0x5aae7a;};'use strict';var BPromise=require(_0xd8f0('0x0'));var moment=require('moment');var _=require(_0xd8f0('0x1'));var util=require(_0xd8f0('0x2'));var jayson=require(_0xd8f0('0x3'));var client=jayson[_0xd8f0('0x4')]['http']({'port':0x2329});function request(_0x18519c,_0x38713c){return new BPromise(function(_0x221a9b,_0x29cfde){return client[_0xd8f0('0x5')](_0x18519c,_0x38713c)['then'](function(_0x47f56c){if(_0x47f56c[_0xd8f0('0x6')]){return _0x29cfde(_0x47f56c[_0xd8f0('0x6')][_0xd8f0('0x7')]);}else{return _0x221a9b(_0x47f56c[_0xd8f0('0x8')]);}})['catch'](function(_0x51cc66){return _0x29cfde(_0x51cc66);});});}exports[_0xd8f0('0x9')]=function(_0xd41b66){return request(_0xd8f0('0xa'),{'options':{'raw':![],'where':{'name':_0xd41b66},'attributes':[_0xd8f0('0xb')]}});};exports['getMailAccountById']=function(_0x1255cf){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x1255cf},'include':[{'model':'MailServerOut','as':_0xd8f0('0xc')}],'attributes':['id',_0xd8f0('0xd'),_0xd8f0('0xe')]}});};exports[_0xd8f0('0xf')]=function(_0x49a42d){return request(_0xd8f0('0xa'),{'options':{'where':{'id':_0x49a42d},'attributes':[_0xd8f0('0xd')]}});};exports['getVoiceQueueById']=function(_0x2a208d){return request(_0xd8f0('0x10'),{'options':{'where':{'id':_0x2a208d},'attributes':[_0xd8f0('0xd')]}});};exports['getVariableById']=function(_0x7bb1c6){return request('ShowVariable',{'options':{'where':{'id':_0x7bb1c6},'attributes':[_0xd8f0('0xd')]}});};exports['getSquareOdbcById']=function(_0x57abfe){return request(_0xd8f0('0x11'),{'options':{'where':{'id':_0x57abfe},'attributes':[_0xd8f0('0x12')]}});};exports[_0xd8f0('0x13')]=function(_0x5dea3a){return request(_0xd8f0('0x14'),{'options':{'where':{'id':_0x5dea3a},'attributes':[_0xd8f0('0xd')]}});};exports[_0xd8f0('0x15')]=function(_0x2fdd5a){return request(_0xd8f0('0x16'),{'options':{'where':{'id':_0x2fdd5a},'attributes':[_0xd8f0('0xd')]}});};exports[_0xd8f0('0x17')]=function(_0x476218){return request('ShowSound',{'options':{'where':{'id':_0x476218},'attributes':[_0xd8f0('0x18')]}});};exports['getIntervalById']=function(_0x12679b){return request(_0xd8f0('0x19'),{'options':{'raw':![],'where':{'id':_0x12679b},'include':[{'model':_0xd8f0('0x1a'),'as':_0xd8f0('0x1b')}]}});};exports['getSmsAccountById']=function(_0x3906db){return request(_0xd8f0('0x1c'),{'options':{'where':{'id':_0x3906db},'attributes':['id',_0xd8f0('0xd')]}});};exports[_0xd8f0('0x1d')]=function(_0xb4a885){return request(_0xd8f0('0x1e'),{'body':_0xb4a885});};exports[_0xd8f0('0x1f')]=function(_0x100e4e){return request(_0xd8f0('0x20'),{'body':_0x100e4e});};exports[_0xd8f0('0x21')]=function(_0x4a210e){return request(_0xd8f0('0x22'),{'body':_['merge'](_0x4a210e,{'project_name':_0x4a210e[_0xd8f0('0x23')],'prev_project_name':_0x4a210e['arg_2']||'','is_subproject':_0x4a210e[_0xd8f0('0x24')]?!![]:![],'leaveAt':moment()[_0xd8f0('0x25')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xd8f0('0x26')]=function(_0x4db9fd){return request(_0xd8f0('0x27'),{'body':_0x4db9fd});};exports[_0xd8f0('0x28')]=function(_0x3c9e1f){return request(_0xd8f0('0x29'),{'body':_0x3c9e1f});};exports[_0xd8f0('0x2a')]=function(_0x50ebcd){return request(_0xd8f0('0x2b'),{'options':{'raw':![],'where':{'phone':_0x50ebcd['phone'],'ListId':_0x50ebcd['ListId']}}})[_0xd8f0('0x2c')](function(_0x56afb7){if(_0x56afb7){return _0x56afb7;}return request(_0xd8f0('0x2d'),{'body':_0x50ebcd});});};exports[_0xd8f0('0x2e')]=function(_0x213e81){return request(_0xd8f0('0x2f'),{'options':{'where':{'id':_0x213e81},'attributes':[_0xd8f0('0xd')]}});};exports[_0xd8f0('0x30')]=function(_0xa84368,_0x626682){return request(_0xd8f0('0x31'),{'body':{'interface':_0x626682},'options':{'where':_0xa84368}});};exports[_0xd8f0('0x32')]=function(_0x154586,_0x47f46e,_0x1b9e36){return request(_0xd8f0('0x33'),{'body':{'type':_0x47f46e,'uniqueid':_0x1b9e36},'options':{'where':_0x154586}});};exports[_0xd8f0('0x34')]=function(_0x15c948){return request(_0xd8f0('0x35'),{'body':{},'options':{'where':_0x15c948}});};exports['agentLogout']=function(_0x538e9d){return request(_0xd8f0('0x36'),{'body':{},'options':{'where':_0x538e9d}});}; \ No newline at end of file +var _0x9d62=['getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','getUserById','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','jayson/promise','client','request','then','error','message','result','catch','getSquareProject','production'];(function(_0x454b0f,_0x4826a4){var _0x12513e=function(_0x32bcdd){while(--_0x32bcdd){_0x454b0f['push'](_0x454b0f['shift']());}};_0x12513e(++_0x4826a4);}(_0x9d62,0x176));var _0x29d6=function(_0x126a4c,_0x1904a6){_0x126a4c=_0x126a4c-0x0;var _0x39f8ec=_0x9d62[_0x126a4c];return _0x39f8ec;};'use strict';var BPromise=require(_0x29d6('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var jayson=require(_0x29d6('0x1'));var client=jayson[_0x29d6('0x2')]['http']({'port':0x2329});function request(_0x3c73a4,_0x2f075c){return new BPromise(function(_0x10b150,_0x119e81){return client[_0x29d6('0x3')](_0x3c73a4,_0x2f075c)[_0x29d6('0x4')](function(_0x230e44){if(_0x230e44[_0x29d6('0x5')]){return _0x119e81(_0x230e44['error'][_0x29d6('0x6')]);}else{return _0x10b150(_0x230e44[_0x29d6('0x7')]);}})[_0x29d6('0x8')](function(_0x3f683b){return _0x119e81(_0x3f683b);});});}exports[_0x29d6('0x9')]=function(_0x29a1f2){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x29a1f2},'attributes':[_0x29d6('0xa')]}});};exports[_0x29d6('0xb')]=function(_0x373d22){return request(_0x29d6('0xc'),{'options':{'raw':![],'where':{'id':_0x373d22},'include':[{'model':_0x29d6('0xd'),'as':_0x29d6('0xe')}],'attributes':['id',_0x29d6('0xf'),'email']}});};exports['getSquareProjectById']=function(_0x116409){return request('ShowSquareProject',{'options':{'where':{'id':_0x116409},'attributes':['name']}});};exports[_0x29d6('0x10')]=function(_0x1d5ab8){return request(_0x29d6('0x11'),{'options':{'where':{'id':_0x1d5ab8},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x12')]=function(_0x2db422){return request(_0x29d6('0x13'),{'options':{'where':{'id':_0x2db422},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x14')]=function(_0x2c8b21){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2c8b21},'attributes':['dsn']}});};exports[_0x29d6('0x15')]=function(_0x88db4){return request('ShowUser',{'options':{'where':{'id':_0x88db4},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x16')]=function(_0x48820c){return request(_0x29d6('0x17'),{'options':{'where':{'id':_0x48820c},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x18')]=function(_0x1b1cff){return request(_0x29d6('0x19'),{'options':{'where':{'id':_0x1b1cff},'attributes':[_0x29d6('0x1a')]}});};exports['getIntervalById']=function(_0x469051){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x469051},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0x29d6('0x1b')]=function(_0x340056){return request(_0x29d6('0x1c'),{'options':{'where':{'id':_0x340056},'attributes':['id',_0x29d6('0xf')]}});};exports[_0x29d6('0x1d')]=function(_0x16a3f0){return request(_0x29d6('0x1e'),{'body':_0x16a3f0});};exports[_0x29d6('0x1f')]=function(_0x58d017){return request(_0x29d6('0x20'),{'body':_0x58d017});};exports['createSquareReport']=function(_0x5861e0){return request(_0x29d6('0x21'),{'body':_[_0x29d6('0x22')](_0x5861e0,{'project_name':_0x5861e0[_0x29d6('0x23')],'prev_project_name':_0x5861e0['arg_2']||'','is_subproject':_0x5861e0[_0x29d6('0x24')]?!![]:![],'leaveAt':moment()[_0x29d6('0x25')](_0x29d6('0x26'))})});};exports[_0x29d6('0x27')]=function(_0x2a7934){return request('CreateSquareRecording',{'body':_0x2a7934});};exports[_0x29d6('0x28')]=function(_0x2ffa7a){return request('CreateSquareMessage',{'body':_0x2ffa7a});};exports[_0x29d6('0x29')]=function(_0x57df16){return request(_0x29d6('0x2a'),{'options':{'raw':![],'where':{'phone':_0x57df16['phone'],'ListId':_0x57df16[_0x29d6('0x2b')]}}})['then'](function(_0x37a6d1){if(_0x37a6d1){return _0x37a6d1;}return request(_0x29d6('0x2c'),{'body':_0x57df16});});};exports[_0x29d6('0x2d')]=function(_0x264e26){return request(_0x29d6('0x2e'),{'options':{'where':{'id':_0x264e26},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x2f')]=function(_0x52657b,_0x534933){return request(_0x29d6('0x30'),{'body':{'interface':_0x534933},'options':{'where':_0x52657b}});};exports[_0x29d6('0x31')]=function(_0xbf2903,_0x28c8f2,_0x10d945){return request(_0x29d6('0x32'),{'body':{'type':_0x28c8f2,'uniqueid':_0x10d945},'options':{'where':_0xbf2903}});};exports[_0x29d6('0x33')]=function(_0x59dfd0){return request(_0x29d6('0x34'),{'body':{},'options':{'where':_0x59dfd0}});};exports[_0x29d6('0x35')]=function(_0xde3fd9){return request(_0x29d6('0x36'),{'body':{},'options':{'where':_0xde3fd9}});}; \ 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 778d9c6..7c6e338 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 _0x3641=['./lex'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x3641,0x173));var _0x1364=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3641[_0x3dd15e];return _0x231fd0;};var polly=require('./polly');var lex=require(_0x1364('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x8be8=['./polly','./lex','exports'];(function(_0x27c71c,_0x1b27cf){var _0x34c8f9=function(_0x3955e2){while(--_0x3955e2){_0x27c71c['push'](_0x27c71c['shift']());}};_0x34c8f9(++_0x1b27cf);}(_0x8be8,0xf6));var _0x88be=function(_0x313916,_0x2b721b){_0x313916=_0x313916-0x0;var _0x2c2d44=_0x8be8[_0x313916];return _0x2c2d44;};var polly=require(_0x88be('0x0'));var lex=require(_0x88be('0x1'));module[_0x88be('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 0a4ebc0..c011d46 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 _0xd8b0=['exports','./lib/api'];(function(_0x1ed5b2,_0x4bd5d5){var _0x3896d2=function(_0x2fec66){while(--_0x2fec66){_0x1ed5b2['push'](_0x1ed5b2['shift']());}};_0x3896d2(++_0x4bd5d5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ No newline at end of file +var _0x5b02=['exports','./lib/api'];(function(_0x3089f6,_0x4af0ad){var _0x453f5a=function(_0x5ecddc){while(--_0x5ecddc){_0x3089f6['push'](_0x3089f6['shift']());}};_0x453f5a(++_0x4af0ad);}(_0x5b02,0xe9));var _0x25b0=function(_0x14b003,_0xe10564){_0x14b003=_0x14b003-0x0;var _0x4ac540=_0x5b02[_0x14b003];return _0x4ac540;};'use strict';var lex=require(_0x25b0('0x0'));module[_0x25b0('0x1')]=function(_0x428458,_0x1c3295,_0x4ef71c,_0x4cb227,_0x2b5f2d,_0x53493e){return lex(_0x428458,_0x1c3295,_0x4ef71c,_0x4cb227,_0x2b5f2d,_0x53493e);}; \ 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 1cd9643..15c5491 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(_0x14c38c,_0x4de3c7){var _0x437786=function(_0x451f49){while(--_0x451f49){_0x14c38c['push'](_0x14c38c['shift']());}};_0x437786(++_0x4de3c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0xcde77c,_0x367818){var _0x3e939b=function(_0x203dbc){while(--_0x203dbc){_0xcde77c['push'](_0xcde77c['shift']());}};_0x3e939b(++_0x367818);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 37ff0f1..3ed7701 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 _0x24b9=['./lib/api'];(function(_0x47eed3,_0x488c49){var _0x5a9504=function(_0x2f5b1a){while(--_0x2f5b1a){_0x47eed3['push'](_0x47eed3['shift']());}};_0x5a9504(++_0x488c49);}(_0x24b9,0xd2));var _0x924b=function(_0x3a403b,_0x16fe08){_0x3a403b=_0x3a403b-0x0;var _0x272923=_0x24b9[_0x3a403b];return _0x272923;};'use strict';var polly=require(_0x924b('0x0'));module['exports']=function(_0x4200d1,_0x477106,_0x19942b,_0x53fc58,_0x1a67d4,_0x5e32ac,_0x13c389){return polly(_0x4200d1,_0x477106,_0x19942b,_0x53fc58,_0x1a67d4,_0x5e32ac,_0x13c389);}; \ No newline at end of file +var _0x126f=['exports','./lib/api'];(function(_0x5ad07b,_0x3c4d15){var _0x466b81=function(_0x72448a){while(--_0x72448a){_0x5ad07b['push'](_0x5ad07b['shift']());}};_0x466b81(++_0x3c4d15);}(_0x126f,0x125));var _0xf126=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x126f[_0x26da89];return _0xc95b7b;};'use strict';var polly=require(_0xf126('0x0'));module[_0xf126('0x1')]=function(_0x5e3ce8,_0xf736dc,_0x1be4b0,_0xd937cf,_0x55005c,_0x24c30e,_0x16e0cb){return polly(_0x5e3ce8,_0xf736dc,_0x1be4b0,_0xd937cf,_0x55005c,_0x24c30e,_0x16e0cb);}; \ 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 ed8a020..a16abb0 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 _0xd61e=['writeFile','exports','Polly','text','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x418ddf,_0x2a5748){var _0x10f50b=function(_0x2e71f3){while(--_0x2e71f3){_0x418ddf['push'](_0x418ddf['shift']());}};_0x10f50b(++_0x2a5748);}(_0xd61e,0xe1));var _0xed61=function(_0x45b037,_0x2a4719){_0x45b037=_0x45b037-0x0;var _0x1d4514=_0xd61e[_0x45b037];return _0x1d4514;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xed61('0x0'));var rs=require(_0xed61('0x1'));var AWS=require(_0xed61('0x2'));function pollyResult(_0x55b417,_0xe78d8a,_0x200d47){return new BPromise(function(_0x44d9f3,_0x1430b7){_0x55b417[_0xed61('0x3')](_0xe78d8a,function(_0x9342bd,_0x535e85){if(_0x9342bd){_0x1430b7(_0x9342bd);}else if(_0x535e85){if(_0x535e85[_0xed61('0x4')]instanceof Buffer){fs[_0xed61('0x5')](_0x200d47,_0x535e85[_0xed61('0x4')],function(_0x437ee3){if(_0x437ee3){_0x1430b7(_0x437ee3);}else{_0x44d9f3();}});}else{_0x1430b7(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x1430b7(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xed61('0x6')]=function(_0x21ee89,_0x2b725e,_0x154222,_0x5f46d1,_0x10db9a,_0x34a289,_0x313759){var _0x281a02=new AWS[(_0xed61('0x7'))]({'accessKeyId':_0x21ee89,'secretAccessKey':_0x2b725e,'region':_0x154222});var _0x40f662={'Text':_0x10db9a,'TextType':_0x34a289||_0xed61('0x8'),'OutputFormat':_0xed61('0x9'),'VoiceId':_0x5f46d1};return pollyResult(_0x281a02,_0x40f662,_0x313759);}; \ No newline at end of file +var _0xa523=['aws-sdk','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','path','bluebird','randomstring'];(function(_0x574641,_0x11f894){var _0x53b350=function(_0x334fbb){while(--_0x334fbb){_0x574641['push'](_0x574641['shift']());}};_0x53b350(++_0x11f894);}(_0xa523,0x10b));var _0x3a52=function(_0x5eaf12,_0x8a62e2){_0x5eaf12=_0x5eaf12-0x0;var _0x54dbb3=_0xa523[_0x5eaf12];return _0x54dbb3;};'use strict';var fs=require('fs');var path=require(_0x3a52('0x0'));var BPromise=require(_0x3a52('0x1'));var rs=require(_0x3a52('0x2'));var AWS=require(_0x3a52('0x3'));function pollyResult(_0x28f577,_0x2e7b88,_0x281095){return new BPromise(function(_0x2ab0a0,_0x54dc82){_0x28f577['synthesizeSpeech'](_0x2e7b88,function(_0x46a202,_0x98be95){if(_0x46a202){_0x54dc82(_0x46a202);}else if(_0x98be95){if(_0x98be95['AudioStream']instanceof Buffer){fs[_0x3a52('0x4')](_0x281095,_0x98be95[_0x3a52('0x5')],function(_0x3dde73){if(_0x3dde73){_0x54dc82(_0x3dde73);}else{_0x2ab0a0();}});}else{_0x54dc82(new Error(_0x3a52('0x6')));}}else{_0x54dc82(new Error(_0x3a52('0x7')));}});});}module['exports']=function(_0x1b3e3c,_0x183411,_0x53854c,_0x5e5554,_0x209510,_0x118c08,_0x244bfb){var _0x195a92=new AWS['Polly']({'accessKeyId':_0x1b3e3c,'secretAccessKey':_0x183411,'region':_0x53854c});var _0x376761={'Text':_0x209510,'TextType':_0x118c08||_0x3a52('0x8'),'OutputFormat':_0x3a52('0x9'),'VoiceId':_0x5e5554};return pollyResult(_0x195a92,_0x376761,_0x244bfb);}; \ 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 4740d6a..0454793 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 _0x15ee=['./lib/api','exports'];(function(_0x31d4c3,_0x5d218b){var _0x28a508=function(_0x39b56c){while(--_0x39b56c){_0x31d4c3['push'](_0x31d4c3['shift']());}};_0x28a508(++_0x5d218b);}(_0x15ee,0xb8));var _0xe15e=function(_0x448ae2,_0x1676f5){_0x448ae2=_0x448ae2-0x0;var _0x4fdd34=_0x15ee[_0x448ae2];return _0x4fdd34;};'use strict';var asr=require(_0xe15e('0x0'));module[_0xe15e('0x1')]=function(_0x462ea7,_0x33d3bd,_0xba6ac6,_0x19f324){return asr(_0x462ea7,_0x33d3bd,_0xba6ac6);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x41b5b8,_0x31d51f,_0x42141d,_0x19db89){return asr(_0x41b5b8,_0x31d51f,_0x42141d);}; \ 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 8bc225b..3b1f8d7 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 _0x2f68=['exports','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x2f68,0x9a));var _0x82f6=function(_0x1d5332,_0x2bbdd8){_0x1d5332=_0x1d5332-0x0;var _0x2ec82f=_0x2f68[_0x1d5332];return _0x2ec82f;};'use strict';var url=require('url');var BPromise=require(_0x82f6('0x0'));var fs=require('fs');var host=_0x82f6('0x1');module[_0x82f6('0x2')]=function(_0x3a9c8f,_0x4be334,_0x43dc65){return new BPromise(function(_0x488d61,_0x2a06dc){var _0x2ab73d;if(typeof _0x3a9c8f!=='string'||_0x3a9c8f[_0x82f6('0x3')]===0x0){return _0x2a06dc(_0x82f6('0x4'));}if(typeof _0x4be334!=='string'||_0x4be334['length']===0x0){return _0x2a06dc(_0x82f6('0x5'));}if(typeof _0x43dc65!=='undefined'&&(typeof _0x43dc65!=='string'||_0x43dc65[_0x82f6('0x3')]===0x0)){return _0x2a06dc(_0x82f6('0x6'));}try{_0x2ab73d=fs[_0x82f6('0x7')](_0x3a9c8f)['toString'](_0x82f6('0x8'));}catch(_0x432289){return _0x2a06dc(_0x432289);}return _0x488d61({'method':'POST','uri':host+_0x82f6('0x9')+_0x4be334,'body':{'config':{'encoding':_0x82f6('0xa'),'sampleRateHertz':_0x82f6('0xb'),'languageCode':_0x43dc65},'audio':{'content':_0x2ab73d}},'json':!![]});});}; \ No newline at end of file +var _0x303a=['url','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','LINEAR16','8000'];(function(_0x2fcc06,_0x5390d3){var _0x54dfb2=function(_0x472c30){while(--_0x472c30){_0x2fcc06['push'](_0x2fcc06['shift']());}};_0x54dfb2(++_0x5390d3);}(_0x303a,0x1a0));var _0xa303=function(_0x2f1089,_0x42d03d){_0x2f1089=_0x2f1089-0x0;var _0x1af573=_0x303a[_0x2f1089];return _0x1af573;};'use strict';var url=require(_0xa303('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xa303('0x1');module[_0xa303('0x2')]=function(_0x36e548,_0x19d27a,_0x594b49){return new BPromise(function(_0x46c56b,_0x26b47c){var _0x38a354;if(typeof _0x36e548!==_0xa303('0x3')||_0x36e548[_0xa303('0x4')]===0x0){return _0x26b47c(_0xa303('0x5'));}if(typeof _0x19d27a!==_0xa303('0x3')||_0x19d27a[_0xa303('0x4')]===0x0){return _0x26b47c(_0xa303('0x6'));}if(typeof _0x594b49!=='undefined'&&(typeof _0x594b49!=='string'||_0x594b49['length']===0x0)){return _0x26b47c(_0xa303('0x7'));}try{_0x38a354=fs[_0xa303('0x8')](_0x36e548)['toString'](_0xa303('0x9'));}catch(_0x51acca){return _0x26b47c(_0x51acca);}return _0x46c56b({'method':_0xa303('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x19d27a,'body':{'config':{'encoding':_0xa303('0xb'),'sampleRateHertz':_0xa303('0xc'),'languageCode':_0x594b49},'audio':{'content':_0x38a354}},'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 ed50a6a..3baf76a 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 _0x15f9=['exports','./asr'];(function(_0x15cb79,_0x4492d2){var _0x98504d=function(_0x317682){while(--_0x317682){_0x15cb79['push'](_0x15cb79['shift']());}};_0x98504d(++_0x4492d2);}(_0x15f9,0x1c1));var _0x915f=function(_0x1b5208,_0x1c4a4d){_0x1b5208=_0x1b5208-0x0;var _0x5836f1=_0x15f9[_0x1b5208];return _0x5836f1;};var asr=require(_0x915f('0x0'));module[_0x915f('0x1')]={'asr':asr}; \ No newline at end of file +var _0x4ac0=['./asr','exports'];(function(_0x520762,_0x32edd0){var _0xf916d4=function(_0x3ac125){while(--_0x3ac125){_0x520762['push'](_0x520762['shift']());}};_0xf916d4(++_0x32edd0);}(_0x4ac0,0x9c));var _0x04ac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ac0[_0x14add3];return _0x4a174f;};var asr=require(_0x04ac('0x0'));module[_0x04ac('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 3712a24..5598869 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 _0xb5c8=['dialogflow','http','https','md5','path','querystring','request-promise','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','statusCode','error','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','finish','info','finish\x20download\x20file','close','unlink','pipe','end','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','777','split','toString','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','.mp3','from','audioContent','writeFile','chmodSync','tmp','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','name','message','googleDialogflow','result','source','action','actionIncomplete','fulfillment','speech','score','status','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','AudioFromTts','Data','audiofile','apiai-promise','bluebird'];(function(_0xf91bb5,_0x2d3a80){var _0x544bf0=function(_0x19362c){while(--_0x19362c){_0xf91bb5['push'](_0xf91bb5['shift']());}};_0x544bf0(++_0x2d3a80);}(_0xb5c8,0x11a));var _0x8b5c=function(_0x481ffc,_0x4acb82){_0x481ffc=_0x481ffc-0x0;var _0x51d09a=_0xb5c8[_0x481ffc];return _0x51d09a;};'use strict';var apiai=require(_0x8b5c('0x0'));var BPromise=require(_0x8b5c('0x1'));var dialogflow=require(_0x8b5c('0x2'));var fs=require('fs');var http=require(_0x8b5c('0x3'));var https=require(_0x8b5c('0x4'));var md5=require(_0x8b5c('0x5'));var path=require(_0x8b5c('0x6'));var querystring=require(_0x8b5c('0x7'));var rp=require(_0x8b5c('0x8'));var rs=require('randomstring');var sox=require(_0x8b5c('0x9'));var tts=require(_0x8b5c('0xa'));var urlParse=require(_0x8b5c('0xb'))[_0x8b5c('0xc')];var util=require(_0x8b5c('0xd'));var aws=require(_0x8b5c('0xe'));var google=require(_0x8b5c('0xf'));var sestek=require(_0x8b5c('0x10'));var tilde=require(_0x8b5c('0x11'));var logger=require(_0x8b5c('0x12'))(_0x8b5c('0x13'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x545c57,_0x3b0e71){return new BPromise(function(_0x4c8959,_0x505e3c){var _0x1134a4=urlParse(_0x545c57);var _0x1f881a=_0x1134a4[_0x8b5c('0x14')]===_0x8b5c('0x15')?https:http;var _0xffdc2e={'host':_0x1134a4[_0x8b5c('0x16')],'path':_0x1134a4[_0x8b5c('0x6')],'headers':{'user-agent':_0x8b5c('0x17')}};_0x1f881a[_0x8b5c('0x18')](_0xffdc2e,function(_0x38988c){if(_0x38988c[_0x8b5c('0x19')]!==0xc8){logger[_0x8b5c('0x1a')]('request\x20to\x20'+_0x545c57+'\x20failed,\x20status\x20code\x20=\x20'+_0x38988c[_0x8b5c('0x19')]+'\x20('+_0x38988c[_0x8b5c('0x1b')]+')');_0x505e3c(new Error(_0x8b5c('0x1c')+_0x545c57+_0x8b5c('0x1d')+_0x38988c[_0x8b5c('0x19')]+'\x20('+_0x38988c['statusMessage']+')'));return;}var _0x47b16c=fs['createWriteStream'](_0x3b0e71);_0x47b16c['on'](_0x8b5c('0x1e'),function(){logger[_0x8b5c('0x1f')](_0x8b5c('0x20'));_0x47b16c[_0x8b5c('0x21')](_0x4c8959);});_0x47b16c['on']('error',function(_0x1e7140){fs[_0x8b5c('0x22')](_0x3b0e71);logger[_0x8b5c('0x1a')]('download\x20error',_0x1e7140);_0x505e3c(_0x1e7140);});_0x38988c[_0x8b5c('0x23')](_0x47b16c);})['on'](_0x8b5c('0x1a'),function(_0x314ffa){logger[_0x8b5c('0x1a')](_0x314ffa);_0x505e3c(_0x314ffa);})[_0x8b5c('0x24')]();});}function uploadFile(_0x347e4f){return new BPromise(function(_0x2c59f7,_0x4e9dd0){var _0x201c45=urlParse(_0x347e4f);var _0x5606ec=_0x201c45[_0x8b5c('0x14')]==='https:'?https:http;var _0x14a8d1={'host':_0x201c45[_0x8b5c('0x16')],'path':_0x201c45[_0x8b5c('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x5606ec[_0x8b5c('0x18')](_0x14a8d1,function(_0x4de330){if(_0x4de330[_0x8b5c('0x19')]!==0xc8){_0x4e9dd0(new Error('request\x20to\x20'+_0x347e4f+_0x8b5c('0x1d')+_0x4de330[_0x8b5c('0x19')]+'\x20('+_0x4de330[_0x8b5c('0x1b')]+')'));return;}var _0x109fb2='';_0x4de330['on'](_0x8b5c('0x25'),function(_0x362473){_0x109fb2+=_0x362473;});_0x4de330['on']('end',function(){_0x2c59f7(_0x109fb2);});})['on'](_0x8b5c('0x1a'),function(_0x1d5d5d){_0x4e9dd0(_0x1d5d5d);})['end']();});}function convertFile(_0x2d6995,_0x2cd0f7){return new BPromise(function(_0x3edd40,_0x1c03ae){var _0x2a3d8a=sox[_0x8b5c('0x26')](_0x2d6995,_0x2cd0f7,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2a3d8a['on']('error',function(_0x2d4409){logger[_0x8b5c('0x1a')](_0x8b5c('0x27'),_0x2d4409);_0x1c03ae(_0x2d4409);});_0x2a3d8a['on'](_0x8b5c('0x24'),function(){logger[_0x8b5c('0x1f')](_0x8b5c('0x28'));_0x3edd40();});_0x2a3d8a[_0x8b5c('0x29')]();});}function base64Decode(_0x1c3458,_0x5aab87){var _0x40f726=path[_0x8b5c('0x2a')](__dirname,'tmp',rs[_0x8b5c('0x2b')](0x4)+'.wav');fs[_0x8b5c('0x2c')](_0x40f726,_0x1c3458,_0x8b5c('0x2d'));return convertFile(_0x40f726,_0x5aab87)['then'](function(){try{fs[_0x8b5c('0x22')](_0x40f726);fs['chmodSync'](_0x5aab87,_0x8b5c('0x2e'));}catch(_0x16c077){logger[_0x8b5c('0x1a')](_0x16c077);}return _0x5aab87[_0x8b5c('0x2f')]('.')[0x0];});}function base64Encode(_0x2d4c96){var _0x4c4a3d=fs['readFileSync'](_0x2d4c96);return new Buffer(_0x4c4a3d)[_0x8b5c('0x30')](_0x8b5c('0x2d'));}exports['googleCloudTTS']=function(_0x52a1eb,_0x4f3d79,_0x46d881,_0x21166c,_0xfd44bc,_0x1c9310){var _0xe8f514,_0x30dfe4;var _0xb0a6e='https://texttospeech.googleapis.com/v1/';var _0x2d8892='?key='+_0x52a1eb;var _0x326874={};if(_0x4f3d79===_0x8b5c('0x31')){_0x326874['input']={'ssml':_0x46d881};}else{_0x326874[_0x8b5c('0x32')]={'text':_0x46d881};};_0x326874[_0x8b5c('0x33')]={'languageCode':_0x21166c,'ssmlGender':_0xfd44bc};_0x326874[_0x8b5c('0x34')]={'audioEncoding':_0x8b5c('0x35'),'sampleRateHertz':0x1f40};var _0x214c94={'url':_0xb0a6e+_0x8b5c('0x36')+_0x2d8892,'method':_0x8b5c('0x37'),'json':!![],'body':_0x326874};return rp(_0x214c94)[_0x8b5c('0x38')](function(_0x375cff){return new BPromise(function(_0x1f33b6,_0x32a671){_0xe8f514=path[_0x8b5c('0x2a')](__dirname,'tmp',rs[_0x8b5c('0x2b')](0x4)+_0x8b5c('0x39'));var _0x55122f=Buffer[_0x8b5c('0x3a')](_0x375cff[_0x8b5c('0x3b')],_0x8b5c('0x2d'));return fs[_0x8b5c('0x3c')](_0xe8f514,_0x55122f,function(_0x1f9a09){_0x32a671(_0x1f9a09);},function(_0x534342){fs[_0x8b5c('0x3d')](_0xe8f514,'777');_0x1f33b6(_0x534342);});});})[_0x8b5c('0x38')](function(_0x46ad65){_0x30dfe4=path[_0x8b5c('0x2a')](__dirname,_0x8b5c('0x3e'),rs[_0x8b5c('0x2b')](0x4)+_0x8b5c('0x3f'));return convertFile(_0xe8f514,_0x30dfe4);})['then'](function(){try{fs['unlink'](_0xe8f514);fs[_0x8b5c('0x3d')](_0x30dfe4,_0x8b5c('0x2e'));}catch(_0x4d4fda){logger[_0x8b5c('0x1a')](_0x4d4fda);}logger[_0x8b5c('0x1f')](_0x8b5c('0x40'),_0x30dfe4[_0x8b5c('0x2f')]('.')[0x0]);return _0x30dfe4[_0x8b5c('0x2f')]('.')[0x0];});};exports[_0x8b5c('0x41')]=function(_0x135abb,_0x1190f2){var _0x414825=_0x8b5c('0x42');var _0x3d17d2,_0x57d119;var _0x5b732e;var _0x6654f9={'encoding':_0x8b5c('0x43'),'method':'POST','timeout':0x2710,'url':_0x414825,'headers':{'Content-Type':_0x8b5c('0x44')},'body':_0x8b5c('0x45')+encodeURIComponent(JSON['stringify']([[[_0x8b5c('0x46'),JSON[_0x8b5c('0x47')]([_0x135abb,_0x1190f2||'en',![],_0x8b5c('0x48')]),null,'generic']]]))};return rp(_0x6654f9)[_0x8b5c('0x38')](function(_0xe86a84){try{_0x5b732e=eval(_0xe86a84[_0x8b5c('0x49')](0x5))[0x0][0x2];}catch(_0x37d855){throw new Error(_0x8b5c('0x4a')+_0xe86a84[_0x8b5c('0x25')]);}if(!_0x5b732e){if(_0x135abb['length']>0xc8){throw new Error(_0x8b5c('0x4b'));}else{throw new Error(_0x8b5c('0x4c')+_0x1190f2+_0x8b5c('0x4d'));}}try{_0x5b732e=eval(_0x5b732e)[0x0];}catch(_0x5812e7){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x6dec64=_0x5b732e;_0x3d17d2=path['resolve'](__dirname,_0x8b5c('0x3e'),rs[_0x8b5c('0x2b')](0x4)+_0x8b5c('0x39'));fs[_0x8b5c('0x2c')](_0x3d17d2,_0x5b732e,{'encoding':_0x8b5c('0x2d')});_0x57d119=path['resolve'](__dirname,'tmp',rs[_0x8b5c('0x2b')](0x4)+_0x8b5c('0x3f'));return convertFile(_0x3d17d2,_0x57d119);})[_0x8b5c('0x38')](function(){try{fs[_0x8b5c('0x22')](_0x3d17d2);fs[_0x8b5c('0x3d')](_0x57d119,'777');}catch(_0x3085bf){logger[_0x8b5c('0x1a')](_0x3085bf);}logger['info'](_0x8b5c('0x4e'),_0x57d119[_0x8b5c('0x2f')]('.')[0x0]);return _0x57d119['split']('.')[0x0];});};exports[_0x8b5c('0x4f')]=function(_0x514b8d,_0x50662a,_0x2f52ad){return google[_0x8b5c('0x50')](_0x514b8d,_0x50662a,_0x2f52ad)[_0x8b5c('0x38')](function(_0x519f9c){logger['info'](_0x519f9c[_0x8b5c('0x51')]);return rp(_0x519f9c);})['then'](function(_0xcb16ee){var _0x55ada4='';var _0x2bc196=0x0;try{fs['unlink'](_0x514b8d);}catch(_0x593076){logger[_0x8b5c('0x1a')](_0x593076);}if(_0xcb16ee&&_0xcb16ee['results']){_0x55ada4=_0xcb16ee[_0x8b5c('0x52')][_0x8b5c('0x53')](function(_0x4c63a3){return _0x4c63a3&&_0x4c63a3[_0x8b5c('0x54')][0x0]&&_0x4c63a3[_0x8b5c('0x54')][0x0][_0x8b5c('0x55')]?_0x4c63a3[_0x8b5c('0x54')][0x0][_0x8b5c('0x55')]:'';})[_0x8b5c('0x56')]('\x0a');_0x2bc196=_0xcb16ee[_0x8b5c('0x52')][_0x8b5c('0x53')](function(_0x38d2ed){return _0x38d2ed&&_0x38d2ed['alternatives'][0x0]&&_0x38d2ed[_0x8b5c('0x54')][0x0][_0x8b5c('0x57')]?_0x38d2ed[_0x8b5c('0x54')][0x0][_0x8b5c('0x57')]:0x0;})[_0x8b5c('0x56')]('\x0a');}logger[_0x8b5c('0x1f')]('googleASR\x20transcription',_0x55ada4);logger[_0x8b5c('0x1f')](_0x8b5c('0x58'),_0x2bc196);return{'transcript':_0x55ada4,'confidence':_0x2bc196};})[_0x8b5c('0x59')](function(_0x1b2174){logger[_0x8b5c('0x1a')]('[%s]\x20%s:%s',_0x1b2174[_0x8b5c('0x19')],_0x1b2174[_0x8b5c('0x5a')],_0x1b2174[_0x8b5c('0x5b')]);});};exports[_0x8b5c('0x5c')]=function(_0x21356b,_0x5ddc13,_0x44ac78,_0x3ede2c){var _0x1b8b0b=apiai(_0x5ddc13,{'language':_0x3ede2c||'en'});return _0x1b8b0b['textRequest'](_0x44ac78,{'sessionId':md5(_0x21356b)})[_0x8b5c('0x38')](function(_0x57136f){logger[_0x8b5c('0x1f')](JSON[_0x8b5c('0x47')](_0x57136f));return{'source':_0x57136f[_0x8b5c('0x5d')][_0x8b5c('0x5e')],'resolvedQuery':_0x57136f[_0x8b5c('0x5d')]['resolvedQuery'],'action':_0x57136f['result'][_0x8b5c('0x5f')],'actionIncomplete':_0x57136f[_0x8b5c('0x5d')][_0x8b5c('0x60')],'speech':_0x57136f[_0x8b5c('0x5d')][_0x8b5c('0x61')][_0x8b5c('0x62')],'score':_0x57136f['result'][_0x8b5c('0x63')],'statusCode':_0x57136f[_0x8b5c('0x64')][_0x8b5c('0x65')],'endConversation':_0x57136f['result']['metadata'][_0x8b5c('0x66')]||![],'isFallbackIntent':_0x57136f['result'][_0x8b5c('0x67')][_0x8b5c('0x68')]};});};exports[_0x8b5c('0x69')]=function(_0xc188ab,_0x468e84,_0x3a4cdc,_0x26d1a4,_0x31bbd0,_0x5c7db7){var _0x2d946d=_0x26d1a4[_0x8b5c('0x6a')](/\\n/g,'\x0a');var _0x1c3f1a={'credentials':{'private_key':_0x2d946d,'client_email':_0x3a4cdc}};var _0x3312cd=new dialogflow[(_0x8b5c('0x6b'))](_0x1c3f1a);var _0x288771=_0x3312cd[_0x8b5c('0x6c')](_0x468e84,md5(_0xc188ab));var _0xbdcbe6={'session':_0x288771,'queryInput':{'text':{'text':_0x31bbd0,'languageCode':_0x5c7db7}}};return _0x3312cd['detectIntent'](_0xbdcbe6)['then'](function(_0x393933){if(_0x393933&&_0x393933[_0x8b5c('0x6d')]){logger[_0x8b5c('0x1f')](_0x8b5c('0x6e'),JSON[_0x8b5c('0x47')](_0x393933));var _0x3ff33c=_0x393933[0x0];if(_0x3ff33c){var _0x3fb246={'action':_0x3ff33c[_0x8b5c('0x6f')][_0x8b5c('0x5f')],'allRequiredParamsPresent':_0x3ff33c[_0x8b5c('0x6f')][_0x8b5c('0x70')],'endConversation':_0x3ff33c[_0x8b5c('0x6f')][_0x8b5c('0x71')]&&_0x3ff33c['queryResult'][_0x8b5c('0x71')][_0x8b5c('0x72')]?_0x3ff33c['queryResult'][_0x8b5c('0x71')]['fields']['end_conversation'][_0x8b5c('0x73')]:![],'fulfillmentText':_0x3ff33c[_0x8b5c('0x6f')][_0x8b5c('0x74')],'intentName':_0x3ff33c[_0x8b5c('0x6f')][_0x8b5c('0x75')][_0x8b5c('0x5a')],'intentDisplayName':_0x3ff33c[_0x8b5c('0x6f')][_0x8b5c('0x75')][_0x8b5c('0x76')],'isFallbackIntent':_0x3ff33c[_0x8b5c('0x6f')]['intent'][_0x8b5c('0x77')],'languageCode':_0x3ff33c[_0x8b5c('0x6f')]['languageCode'],'queryText':_0x3ff33c[_0x8b5c('0x6f')][_0x8b5c('0x78')],'responseId':_0x3ff33c[_0x8b5c('0x79')],'score':_0x3ff33c['queryResult'][_0x8b5c('0x7a')],'speech':_0x3ff33c[_0x8b5c('0x6f')]['fulfillmentText'],'providerResponse':JSON[_0x8b5c('0x47')](_0x393933)};return _0x3fb246;}}});};exports[_0x8b5c('0x7b')]=function(_0x1e3f5d,_0x4e6252,_0x130821,_0x55164f){return tilde[_0x8b5c('0x50')](_0x1e3f5d,_0x4e6252,_0x130821,_0x55164f)[_0x8b5c('0x38')](function(_0x988098){try{fs['unlink'](_0x1e3f5d);}catch(_0x3044d1){logger[_0x8b5c('0x1a')](_0x3044d1);}logger[_0x8b5c('0x1f')]('Tilde\x20ASR\x20transcription',_0x988098['transcript']);logger[_0x8b5c('0x1f')](_0x8b5c('0x7c'),_0x988098[_0x8b5c('0x57')]);return _0x988098;});};exports[_0x8b5c('0x7d')]=function(_0x17e69f,_0x4e5470,_0xd9fef6,_0x2719b7,_0x10330b,_0x280c44){var _0xccd009=path['resolve'](__dirname,_0x8b5c('0x3e'),rs[_0x8b5c('0x2b')](0x4)+_0x8b5c('0x39'));var _0x5caa15;return aws[_0x8b5c('0x7e')](_0x17e69f,_0x4e5470,_0xd9fef6,_0x2719b7,_0x10330b,_0x280c44,_0xccd009)[_0x8b5c('0x38')](function(){_0x5caa15=path[_0x8b5c('0x2a')](__dirname,_0x8b5c('0x3e'),rs[_0x8b5c('0x2b')](0x4)+_0x8b5c('0x3f'));return convertFile(_0xccd009,_0x5caa15);})[_0x8b5c('0x38')](function(){try{fs['unlink'](_0xccd009);fs[_0x8b5c('0x3d')](_0x5caa15,_0x8b5c('0x2e'));}catch(_0xe50e51){logger['error'](_0xe50e51);}return _0x5caa15[_0x8b5c('0x2f')]('.')[0x0];});};exports[_0x8b5c('0x7f')]=function(_0x598e0e,_0x47fc9a,_0x311539,_0x4685c1,_0x4f6b11,_0x2c5b2e){return aws[_0x8b5c('0x80')](_0x598e0e,_0x47fc9a,_0x311539,_0x4685c1,_0x4f6b11,_0x2c5b2e)['then'](function(_0x1dfde0){logger[_0x8b5c('0x1f')](JSON[_0x8b5c('0x47')](_0x1dfde0));return _0x1dfde0;});};exports[_0x8b5c('0x81')]=function(_0x4592b0,_0x63385,_0xa54cb4,_0x3be115){var _0x471a2e=util[_0x8b5c('0x82')](_0x8b5c('0x83'),ISPEECH_API,_0x4592b0,encodeURIComponent(_0x63385),_0xa54cb4,_0x3be115);var _0x3a9dd2=path[_0x8b5c('0x2a')](__dirname,_0x8b5c('0x3e'),rs['generate'](0x4)+_0x8b5c('0x39'));var _0xd976cc;return downloadFile(_0x471a2e,_0x3a9dd2)[_0x8b5c('0x38')](function(){_0xd976cc=path['resolve'](__dirname,_0x8b5c('0x3e'),rs['generate'](0x4)+_0x8b5c('0x3f'));return convertFile(_0x3a9dd2,_0xd976cc);})[_0x8b5c('0x38')](function(){try{fs[_0x8b5c('0x22')](_0x3a9dd2);fs[_0x8b5c('0x3d')](_0xd976cc,_0x8b5c('0x2e'));}catch(_0x39e64c){logger[_0x8b5c('0x1a')](_0x39e64c);}return _0xd976cc[_0x8b5c('0x2f')]('.')[0x0];});};exports[_0x8b5c('0x84')]=function(_0x16889b,_0xc836b6,_0x320de1,_0x5557f9){var _0x4eb894=util[_0x8b5c('0x82')](_0x8b5c('0x85'),ISPEECH_API,_0xc836b6,_0x320de1,base64Encode(_0x16889b),_0x5557f9?util[_0x8b5c('0x82')](_0x8b5c('0x86'),encodeURIComponent(_0x5557f9)):_0x8b5c('0x87'));return uploadFile(_0x4eb894)[_0x8b5c('0x38')](function(_0xb40902){return querystring[_0x8b5c('0xc')](_0xb40902);});};exports[_0x8b5c('0x88')]=function(_0xacd203,_0x740719){return sestek['nda'](_0xacd203,_0x740719)[_0x8b5c('0x38')](function(_0x376828){logger[_0x8b5c('0x1f')](JSON[_0x8b5c('0x47')](_0x376828));var _0x9b0805={'speech':_0x376828[_0x8b5c('0x89')],'action':_0x376828[_0x8b5c('0x8a')]?_0x376828[_0x8b5c('0x8a')]['CustomAction']:undefined,'actiondata':_0x376828['channelData']?_0x376828['channelData']['CustomActionData']:undefined};if(_0x376828[_0x8b5c('0x8a')]&&_0x376828[_0x8b5c('0x8a')]['AudioFromTts']){return base64Decode(_0x376828[_0x8b5c('0x8a')][_0x8b5c('0x8b')][_0x8b5c('0x8c')],path[_0x8b5c('0x2a')](__dirname,_0x8b5c('0x3e'),rs[_0x8b5c('0x2b')](0x4)+'.wav'))['then'](function(_0x5c2cb1){_0x9b0805[_0x8b5c('0x8d')]=_0x5c2cb1;return _0x9b0805;});}return _0x9b0805;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xd780=['\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','http','md5','path','querystring','randomstring','sox','url','parse','./sestek','agi','https://api.ispeech.org/api/rest','host','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','WHAT_EVER','data','transcode','wav','error\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','input','voice','MP3','from','audioContent','writeFile','.wav','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22'];(function(_0x24e364,_0x22c22c){var _0x3921b0=function(_0x4f15d9){while(--_0x4f15d9){_0x24e364['push'](_0x24e364['shift']());}};_0x3921b0(++_0x22c22c);}(_0xd780,0x1db));var _0x0d78=function(_0x5e60fe,_0x4eca65){_0x5e60fe=_0x5e60fe-0x0;var _0x5b1f7f=_0xd780[_0x5e60fe];return _0x5b1f7f;};'use strict';var apiai=require(_0x0d78('0x0'));var BPromise=require(_0x0d78('0x1'));var dialogflow=require(_0x0d78('0x2'));var fs=require('fs');var http=require(_0x0d78('0x3'));var https=require('https');var md5=require(_0x0d78('0x4'));var path=require(_0x0d78('0x5'));var querystring=require(_0x0d78('0x6'));var rp=require('request-promise');var rs=require(_0x0d78('0x7'));var sox=require(_0x0d78('0x8'));var tts=require('google-tts-api');var urlParse=require(_0x0d78('0x9'))[_0x0d78('0xa')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require(_0x0d78('0xb'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x0d78('0xc'));var ISPEECH_API=_0x0d78('0xd');function downloadFile(_0x1e2fde,_0x5db526){return new BPromise(function(_0x11e67b,_0x107996){var _0x1d5920=urlParse(_0x1e2fde);var _0x4c36a6=_0x1d5920['protocol']==='https:'?https:http;var _0x3c5c6e={'host':_0x1d5920[_0x0d78('0xe')],'path':_0x1d5920['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4c36a6[_0x0d78('0xf')](_0x3c5c6e,function(_0x6d2414){if(_0x6d2414['statusCode']!==0xc8){logger[_0x0d78('0x10')](_0x0d78('0x11')+_0x1e2fde+_0x0d78('0x12')+_0x6d2414[_0x0d78('0x13')]+'\x20('+_0x6d2414[_0x0d78('0x14')]+')');_0x107996(new Error(_0x0d78('0x11')+_0x1e2fde+'\x20failed,\x20status\x20code\x20=\x20'+_0x6d2414[_0x0d78('0x13')]+'\x20('+_0x6d2414[_0x0d78('0x14')]+')'));return;}var _0x1617ca=fs[_0x0d78('0x15')](_0x5db526);_0x1617ca['on'](_0x0d78('0x16'),function(){logger[_0x0d78('0x17')](_0x0d78('0x18'));_0x1617ca[_0x0d78('0x19')](_0x11e67b);});_0x1617ca['on'](_0x0d78('0x10'),function(_0x1ae7f9){fs[_0x0d78('0x1a')](_0x5db526);logger[_0x0d78('0x10')](_0x0d78('0x1b'),_0x1ae7f9);_0x107996(_0x1ae7f9);});_0x6d2414[_0x0d78('0x1c')](_0x1617ca);})['on'](_0x0d78('0x10'),function(_0x36ab5f){logger['error'](_0x36ab5f);_0x107996(_0x36ab5f);})[_0x0d78('0x1d')]();});}function uploadFile(_0x1b98b2){return new BPromise(function(_0x3d0465,_0x9e7b6c){var _0x2c3b4a=urlParse(_0x1b98b2);var _0x16ea9e=_0x2c3b4a['protocol']===_0x0d78('0x1e')?https:http;var _0x1f6adf={'host':_0x2c3b4a[_0x0d78('0xe')],'path':_0x2c3b4a[_0x0d78('0x5')],'headers':{'user-agent':_0x0d78('0x1f')}};_0x16ea9e[_0x0d78('0xf')](_0x1f6adf,function(_0x58d010){if(_0x58d010[_0x0d78('0x13')]!==0xc8){_0x9e7b6c(new Error(_0x0d78('0x11')+_0x1b98b2+_0x0d78('0x12')+_0x58d010[_0x0d78('0x13')]+'\x20('+_0x58d010[_0x0d78('0x14')]+')'));return;}var _0x16854e='';_0x58d010['on'](_0x0d78('0x20'),function(_0x2b70bf){_0x16854e+=_0x2b70bf;});_0x58d010['on']('end',function(){_0x3d0465(_0x16854e);});})['on'](_0x0d78('0x10'),function(_0x4d50f0){_0x9e7b6c(_0x4d50f0);})[_0x0d78('0x1d')]();});}function convertFile(_0x41f96e,_0xc23e65){return new BPromise(function(_0x5c438a,_0xd08531){var _0x585418=sox[_0x0d78('0x21')](_0x41f96e,_0xc23e65,{'sampleRate':0x1f40,'format':_0x0d78('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x585418['on'](_0x0d78('0x10'),function(_0x119190){logger[_0x0d78('0x10')](_0x0d78('0x23'),_0x119190);_0xd08531(_0x119190);});_0x585418['on'](_0x0d78('0x1d'),function(){logger[_0x0d78('0x17')]('finish\x20to\x20convert');_0x5c438a();});_0x585418[_0x0d78('0x24')]();});}function base64Decode(_0x21e650,_0x2bb6ac){var _0x1375a5=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+'.wav');fs[_0x0d78('0x28')](_0x1375a5,_0x21e650,_0x0d78('0x29'));return convertFile(_0x1375a5,_0x2bb6ac)[_0x0d78('0x2a')](function(){try{fs[_0x0d78('0x1a')](_0x1375a5);fs[_0x0d78('0x2b')](_0x2bb6ac,_0x0d78('0x2c'));}catch(_0x583afc){logger[_0x0d78('0x10')](_0x583afc);}return _0x2bb6ac[_0x0d78('0x2d')]('.')[0x0];});}function base64Encode(_0x72b83d){var _0x1dcde9=fs[_0x0d78('0x2e')](_0x72b83d);return new Buffer(_0x1dcde9)[_0x0d78('0x2f')](_0x0d78('0x29'));}exports[_0x0d78('0x30')]=function(_0x468cc3,_0x3d9938,_0x2dbed8,_0xe70129,_0x44c630,_0x3b0199){var _0x41d6ed,_0x355469;var _0x2786ff='https://texttospeech.googleapis.com/v1/';var _0x1d0b40=_0x0d78('0x31')+_0x468cc3;var _0x4e708c={};if(_0x3d9938==='ssml'){_0x4e708c[_0x0d78('0x32')]={'ssml':_0x2dbed8};}else{_0x4e708c[_0x0d78('0x32')]={'text':_0x2dbed8};};_0x4e708c[_0x0d78('0x33')]={'languageCode':_0xe70129,'ssmlGender':_0x44c630};_0x4e708c['audioConfig']={'audioEncoding':_0x0d78('0x34'),'sampleRateHertz':0x1f40};var _0x6e50bf={'url':_0x2786ff+'text:synthesize'+_0x1d0b40,'method':'POST','json':!![],'body':_0x4e708c};return rp(_0x6e50bf)[_0x0d78('0x2a')](function(_0x345558){return new BPromise(function(_0xb65d2,_0x3a8765){_0x41d6ed=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs['generate'](0x4)+'.mp3');var _0x430671=Buffer[_0x0d78('0x35')](_0x345558[_0x0d78('0x36')],'base64');return fs[_0x0d78('0x37')](_0x41d6ed,_0x430671,function(_0x5ee5f7){_0x3a8765(_0x5ee5f7);},function(_0x104fab){fs[_0x0d78('0x2b')](_0x41d6ed,'777');_0xb65d2(_0x104fab);});});})[_0x0d78('0x2a')](function(_0x2ccb54){_0x355469=path['resolve'](__dirname,'tmp',rs[_0x0d78('0x27')](0x4)+_0x0d78('0x38'));return convertFile(_0x41d6ed,_0x355469);})[_0x0d78('0x2a')](function(){try{fs[_0x0d78('0x1a')](_0x41d6ed);fs[_0x0d78('0x2b')](_0x355469,_0x0d78('0x2c'));}catch(_0x2177d3){logger[_0x0d78('0x10')](_0x2177d3);}logger[_0x0d78('0x17')]('googleCloudTTS\x20path',_0x355469[_0x0d78('0x2d')]('.')[0x0]);return _0x355469[_0x0d78('0x2d')]('.')[0x0];});};exports[_0x0d78('0x39')]=function(_0x3bbeea,_0x470469){var _0x595013=_0x0d78('0x3a');var _0x39aa9b,_0x3a1cf2;var _0x5b0c50;var _0x3c56e2={'encoding':_0x0d78('0x3b'),'method':'POST','timeout':0x2710,'url':_0x595013,'headers':{'Content-Type':_0x0d78('0x3c')},'body':_0x0d78('0x3d')+encodeURIComponent(JSON[_0x0d78('0x3e')]([[['jQ1olc',JSON['stringify']([_0x3bbeea,_0x470469||'en',![],'null']),null,_0x0d78('0x3f')]]]))};return rp(_0x3c56e2)[_0x0d78('0x2a')](function(_0x326975){try{_0x5b0c50=eval(_0x326975[_0x0d78('0x40')](0x5))[0x0][0x2];}catch(_0x329bc3){throw new Error(_0x0d78('0x41')+_0x326975[_0x0d78('0x20')]);}if(!_0x5b0c50){if(_0x3bbeea[_0x0d78('0x42')]>0xc8){throw new Error(_0x0d78('0x43'));}else{throw new Error(_0x0d78('0x44')+_0x470469+_0x0d78('0x45'));}}try{_0x5b0c50=eval(_0x5b0c50)[0x0];}catch(_0x5d5959){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x0d78('0x20')]);}const _0xa9a9a5=_0x5b0c50;_0x39aa9b=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x46'));fs[_0x0d78('0x28')](_0x39aa9b,_0x5b0c50,{'encoding':_0x0d78('0x29')});_0x3a1cf2=path['resolve'](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x38'));return convertFile(_0x39aa9b,_0x3a1cf2);})['then'](function(){try{fs[_0x0d78('0x1a')](_0x39aa9b);fs[_0x0d78('0x2b')](_0x3a1cf2,_0x0d78('0x2c'));}catch(_0x55a889){logger[_0x0d78('0x10')](_0x55a889);}logger[_0x0d78('0x17')](_0x0d78('0x47'),_0x3a1cf2['split']('.')[0x0]);return _0x3a1cf2[_0x0d78('0x2d')]('.')[0x0];});};exports[_0x0d78('0x48')]=function(_0x2f1fc7,_0x42e4ea,_0x4225cf){return google[_0x0d78('0x49')](_0x2f1fc7,_0x42e4ea,_0x4225cf)[_0x0d78('0x2a')](function(_0xf968c0){logger['info'](_0xf968c0[_0x0d78('0x4a')]);return rp(_0xf968c0);})[_0x0d78('0x2a')](function(_0xfedb8f){var _0xf09d40='';var _0x453f9d=0x0;try{fs[_0x0d78('0x1a')](_0x2f1fc7);}catch(_0xbf1e91){logger[_0x0d78('0x10')](_0xbf1e91);}if(_0xfedb8f&&_0xfedb8f[_0x0d78('0x4b')]){_0xf09d40=_0xfedb8f[_0x0d78('0x4b')]['map'](function(_0x278c7){return _0x278c7&&_0x278c7['alternatives'][0x0]&&_0x278c7[_0x0d78('0x4c')][0x0][_0x0d78('0x4d')]?_0x278c7[_0x0d78('0x4c')][0x0][_0x0d78('0x4d')]:'';})[_0x0d78('0x4e')]('\x0a');_0x453f9d=_0xfedb8f['results'][_0x0d78('0x4f')](function(_0x22d7fc){return _0x22d7fc&&_0x22d7fc['alternatives'][0x0]&&_0x22d7fc[_0x0d78('0x4c')][0x0][_0x0d78('0x50')]?_0x22d7fc[_0x0d78('0x4c')][0x0][_0x0d78('0x50')]:0x0;})['join']('\x0a');}logger[_0x0d78('0x17')](_0x0d78('0x51'),_0xf09d40);logger[_0x0d78('0x17')](_0x0d78('0x52'),_0x453f9d);return{'transcript':_0xf09d40,'confidence':_0x453f9d};})[_0x0d78('0x53')](function(_0x4714b2){logger[_0x0d78('0x10')](_0x0d78('0x54'),_0x4714b2[_0x0d78('0x13')],_0x4714b2[_0x0d78('0x55')],_0x4714b2[_0x0d78('0x56')]);});};exports[_0x0d78('0x57')]=function(_0x1ddf47,_0x116d10,_0x1b3584,_0x566f27){var _0x1f3e29=apiai(_0x116d10,{'language':_0x566f27||'en'});return _0x1f3e29[_0x0d78('0x58')](_0x1b3584,{'sessionId':md5(_0x1ddf47)})[_0x0d78('0x2a')](function(_0x20cc6c){logger['info'](JSON['stringify'](_0x20cc6c));return{'source':_0x20cc6c['result'][_0x0d78('0x59')],'resolvedQuery':_0x20cc6c[_0x0d78('0x5a')][_0x0d78('0x5b')],'action':_0x20cc6c['result'][_0x0d78('0x5c')],'actionIncomplete':_0x20cc6c['result'][_0x0d78('0x5d')],'speech':_0x20cc6c[_0x0d78('0x5a')][_0x0d78('0x5e')][_0x0d78('0x5f')],'score':_0x20cc6c[_0x0d78('0x5a')]['score'],'statusCode':_0x20cc6c['status'][_0x0d78('0x60')],'endConversation':_0x20cc6c[_0x0d78('0x5a')]['metadata'][_0x0d78('0x61')]||![],'isFallbackIntent':_0x20cc6c[_0x0d78('0x5a')][_0x0d78('0x62')][_0x0d78('0x63')]};});};exports[_0x0d78('0x64')]=function(_0x11a688,_0x115793,_0x58742f,_0x529cf3,_0x4ad378,_0xacd12f){var _0x47ed75=_0x529cf3[_0x0d78('0x65')](/\\n/g,'\x0a');var _0x242988={'credentials':{'private_key':_0x47ed75,'client_email':_0x58742f}};var _0x25af05=new dialogflow[(_0x0d78('0x66'))](_0x242988);var _0x1469d0=_0x25af05[_0x0d78('0x67')](_0x115793,md5(_0x11a688));var _0x2ee2cd={'session':_0x1469d0,'queryInput':{'text':{'text':_0x4ad378,'languageCode':_0xacd12f}}};return _0x25af05[_0x0d78('0x68')](_0x2ee2cd)[_0x0d78('0x2a')](function(_0x212c87){if(_0x212c87&&_0x212c87['length']){logger[_0x0d78('0x17')](_0x0d78('0x69'),JSON[_0x0d78('0x3e')](_0x212c87));var _0x3fd5d1=_0x212c87[0x0];if(_0x3fd5d1){var _0x2b1e14={'action':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x5c')],'allRequiredParamsPresent':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x6b')],'endConversation':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x6c')]&&_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x6c')][_0x0d78('0x6d')]?_0x3fd5d1['queryResult']['diagnosticInfo'][_0x0d78('0x6d')][_0x0d78('0x6e')][_0x0d78('0x6f')]:![],'fulfillmentText':_0x3fd5d1['queryResult'][_0x0d78('0x70')],'intentName':_0x3fd5d1['queryResult']['intent'][_0x0d78('0x55')],'intentDisplayName':_0x3fd5d1['queryResult'][_0x0d78('0x71')][_0x0d78('0x72')],'isFallbackIntent':_0x3fd5d1['queryResult']['intent']['isFallback'],'languageCode':_0x3fd5d1['queryResult'][_0x0d78('0x73')],'queryText':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x74')],'responseId':_0x3fd5d1['responseId'],'score':_0x3fd5d1['queryResult']['intentDetectionConfidence'],'speech':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x70')],'providerResponse':JSON['stringify'](_0x212c87)};return _0x2b1e14;}}});};exports[_0x0d78('0x75')]=function(_0x454aae,_0x13446e,_0x2e09e5,_0x549543){return tilde[_0x0d78('0x49')](_0x454aae,_0x13446e,_0x2e09e5,_0x549543)[_0x0d78('0x2a')](function(_0x43ac84){try{fs[_0x0d78('0x1a')](_0x454aae);}catch(_0x10cf67){logger['error'](_0x10cf67);}logger[_0x0d78('0x17')](_0x0d78('0x76'),_0x43ac84[_0x0d78('0x4d')]);logger['info'](_0x0d78('0x77'),_0x43ac84[_0x0d78('0x50')]);return _0x43ac84;});};exports['awsPolly']=function(_0x3aba92,_0x5ca55c,_0x584ed5,_0xfd89b1,_0x4a597f,_0x38c0d0){var _0x702a57=path['resolve'](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x46'));var _0x2f2a2b;return aws[_0x0d78('0x78')](_0x3aba92,_0x5ca55c,_0x584ed5,_0xfd89b1,_0x4a597f,_0x38c0d0,_0x702a57)['then'](function(){_0x2f2a2b=path[_0x0d78('0x25')](__dirname,'tmp',rs[_0x0d78('0x27')](0x4)+'.wav');return convertFile(_0x702a57,_0x2f2a2b);})['then'](function(){try{fs[_0x0d78('0x1a')](_0x702a57);fs[_0x0d78('0x2b')](_0x2f2a2b,_0x0d78('0x2c'));}catch(_0x29558f){logger[_0x0d78('0x10')](_0x29558f);}return _0x2f2a2b['split']('.')[0x0];});};exports[_0x0d78('0x79')]=function(_0x3474e2,_0x44d516,_0xdb38e6,_0x2e017a,_0x5141d9,_0x4eb9ba){return aws[_0x0d78('0x7a')](_0x3474e2,_0x44d516,_0xdb38e6,_0x2e017a,_0x5141d9,_0x4eb9ba)[_0x0d78('0x2a')](function(_0x339930){logger[_0x0d78('0x17')](JSON['stringify'](_0x339930));return _0x339930;});};exports['ispeechTTS']=function(_0x11724d,_0x568049,_0x4cbd76,_0x285569){var _0x47ca2d=util[_0x0d78('0x7b')](_0x0d78('0x7c'),ISPEECH_API,_0x11724d,encodeURIComponent(_0x568049),_0x4cbd76,_0x285569);var _0x3ccc6e=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs['generate'](0x4)+_0x0d78('0x46'));var _0x12e5d;return downloadFile(_0x47ca2d,_0x3ccc6e)['then'](function(){_0x12e5d=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x38'));return convertFile(_0x3ccc6e,_0x12e5d);})[_0x0d78('0x2a')](function(){try{fs[_0x0d78('0x1a')](_0x3ccc6e);fs['chmodSync'](_0x12e5d,'777');}catch(_0x16b066){logger[_0x0d78('0x10')](_0x16b066);}return _0x12e5d[_0x0d78('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x42cd07,_0x3e6e9e,_0x4e5f24,_0x24336f){var _0x4390fa=util[_0x0d78('0x7b')](_0x0d78('0x7d'),ISPEECH_API,_0x3e6e9e,_0x4e5f24,base64Encode(_0x42cd07),_0x24336f?util[_0x0d78('0x7b')](_0x0d78('0x7e'),encodeURIComponent(_0x24336f)):_0x0d78('0x7f'));return uploadFile(_0x4390fa)['then'](function(_0x1db960){return querystring[_0x0d78('0xa')](_0x1db960);});};exports[_0x0d78('0x80')]=function(_0x1ef6c2,_0x205447){return sestek[_0x0d78('0x81')](_0x1ef6c2,_0x205447)[_0x0d78('0x2a')](function(_0x5208c6){logger['info'](JSON[_0x0d78('0x3e')](_0x5208c6));var _0x3b39c3={'speech':_0x5208c6['text'],'action':_0x5208c6[_0x0d78('0x82')]?_0x5208c6[_0x0d78('0x82')][_0x0d78('0x83')]:undefined,'actiondata':_0x5208c6[_0x0d78('0x82')]?_0x5208c6[_0x0d78('0x82')][_0x0d78('0x84')]:undefined};if(_0x5208c6[_0x0d78('0x82')]&&_0x5208c6[_0x0d78('0x82')][_0x0d78('0x85')]){return base64Decode(_0x5208c6[_0x0d78('0x82')][_0x0d78('0x85')][_0x0d78('0x86')],path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x38')))['then'](function(_0x562b09){_0x3b39c3[_0x0d78('0x87')]=_0x562b09;return _0x3b39c3;});}return _0x3b39c3;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index a7120f3..fc1e71b 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 _0xbaa9=['./nda','exports'];(function(_0x1605ec,_0x3119a9){var _0x30048b=function(_0x22cf2b){while(--_0x22cf2b){_0x1605ec['push'](_0x1605ec['shift']());}};_0x30048b(++_0x3119a9);}(_0xbaa9,0x17a));var _0x9baa=function(_0x23f765,_0x4b3cb5){_0x23f765=_0x23f765-0x0;var _0x3a6b46=_0xbaa9[_0x23f765];return _0x3a6b46;};var nda=require(_0x9baa('0x0'));module[_0x9baa('0x1')]={'nda':nda}; \ No newline at end of file +var _0x061e=['./nda','exports'];(function(_0x540102,_0x455509){var _0x310d5b=function(_0x39491b){while(--_0x39491b){_0x540102['push'](_0x540102['shift']());}};_0x310d5b(++_0x455509);}(_0x061e,0xbe));var _0xe061=function(_0x3832fa,_0x49d83e){_0x3832fa=_0x3832fa-0x0;var _0x5c94ab=_0x061e[_0x3832fa];return _0x5c94ab;};var nda=require(_0xe061('0x0'));module[_0xe061('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 cfec6a4..132384b 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 _0x593e=['url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise'];(function(_0x1530c5,_0x2f67a3){var _0x1534d7=function(_0x4f7fe6){while(--_0x4f7fe6){_0x1530c5['push'](_0x1530c5['shift']());}};_0x1534d7(++_0x2f67a3);}(_0x593e,0xcb));var _0xe593=function(_0xdeeeeb,_0x3a7666){_0xdeeeeb=_0xdeeeeb-0x0;var _0x377cde=_0x593e[_0xdeeeeb];return _0x377cde;};'use strict';var rp=require(_0xe593('0x0'));var url=require(_0xe593('0x1'));var logger=require(_0xe593('0x2'))(_0xe593('0x3'));module[_0xe593('0x4')]=function(_0x184a6b,_0x2c7c48){var _0x2fa3a7={'method':'POST','uri':url[_0xe593('0x5')](_0x2c7c48[_0xe593('0x6')],_0xe593('0x7')),'form':{'grant_type':_0xe593('0x8'),'username':_0x2c7c48[_0xe593('0x9')],'password':_0x2c7c48[_0xe593('0x8')]},'json':!![]};return rp(_0x2fa3a7)[_0xe593('0xa')](function(_0x307dad){var _0x169c08={'method':_0xe593('0xb'),'uri':url['resolve'](_0x2c7c48[_0xe593('0xc')],_0xe593('0xd')),'body':{'type':_0x2c7c48[_0xe593('0xe')]||'message','channelId':'Nda','conversation':{'id':_0x184a6b[_0xe593('0xf')]},'from':{'id':_0x184a6b[_0xe593('0x10')],'name':_0x184a6b[_0xe593('0x11')]},'recipient':{'id':_0x184a6b['dnid'],'name':_0x184a6b[_0xe593('0x12')]},'text':_0x2c7c48[_0xe593('0x13')],'channelData':{}},'headers':{'Authorization':_0xe593('0x14')+_0x307dad[_0xe593('0x15')]},'json':!![]};if(_0x2c7c48[_0xe593('0x16')]){_0x169c08[_0xe593('0x17')][_0xe593('0x18')][_0xe593('0x19')]=_0x2c7c48[_0xe593('0x16')];}if(_0x2c7c48[_0xe593('0x1a')]=='1'){_0x169c08['body'][_0xe593('0x18')][_0xe593('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x2c7c48[_0xe593('0x1c')]){_0x169c08[_0xe593('0x17')]['channelData'][_0xe593('0x1d')]=_0x2c7c48[_0xe593('0x1c')];if(_0x2c7c48[_0xe593('0x1e')]){_0x169c08[_0xe593('0x17')][_0xe593('0x18')][_0xe593('0x1f')]=_0x2c7c48['custom_action_data'];}}logger[_0xe593('0x20')](JSON[_0xe593('0x21')](_0x169c08));return rp(_0x169c08);});}; \ No newline at end of file +var _0x122a=['/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','callerid','dnid','extension','Bearer\x20','body','channelData','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','ndassistant_url'];(function(_0x5c3526,_0x2a1e90){var _0xec27a2=function(_0x5ac4e1){while(--_0x5ac4e1){_0x5c3526['push'](_0x5c3526['shift']());}};_0xec27a2(++_0x2a1e90);}(_0x122a,0xba));var _0xa122=function(_0xd0e04b,_0x2a86d9){_0xd0e04b=_0xd0e04b-0x0;var _0x430ba4=_0x122a[_0xd0e04b];return _0x430ba4;};'use strict';var rp=require(_0xa122('0x0'));var url=require(_0xa122('0x1'));var logger=require(_0xa122('0x2'))(_0xa122('0x3'));module[_0xa122('0x4')]=function(_0x4db0d3,_0x5cbed0){var _0x15374d={'method':'POST','uri':url[_0xa122('0x5')](_0x5cbed0[_0xa122('0x6')],_0xa122('0x7')),'form':{'grant_type':_0xa122('0x8'),'username':_0x5cbed0['username'],'password':_0x5cbed0['password']},'json':!![]};return rp(_0x15374d)['then'](function(_0x23e139){var _0x190f74={'method':'POST','uri':url[_0xa122('0x5')](_0x5cbed0[_0xa122('0x9')],_0xa122('0xa')),'body':{'type':_0x5cbed0[_0xa122('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x4db0d3['uniqueid']},'from':{'id':_0x4db0d3[_0xa122('0xc')],'name':_0x4db0d3['calleridname']},'recipient':{'id':_0x4db0d3[_0xa122('0xd')],'name':_0x4db0d3[_0xa122('0xe')]},'text':_0x5cbed0['text'],'channelData':{}},'headers':{'Authorization':_0xa122('0xf')+_0x23e139['access_token']},'json':!![]};if(_0x5cbed0['project']){_0x190f74[_0xa122('0x10')][_0xa122('0x11')]['ProjectName']=_0x5cbed0[_0xa122('0x12')];}if(_0x5cbed0[_0xa122('0x13')]=='1'){_0x190f74[_0xa122('0x10')]['channelData'][_0xa122('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xa122('0x15')};}if(_0x5cbed0[_0xa122('0x16')]){_0x190f74[_0xa122('0x10')][_0xa122('0x11')][_0xa122('0x17')]=_0x5cbed0['custom_action'];if(_0x5cbed0[_0xa122('0x18')]){_0x190f74[_0xa122('0x10')][_0xa122('0x11')][_0xa122('0x19')]=_0x5cbed0[_0xa122('0x18')];}}logger[_0xa122('0x1a')](JSON[_0xa122('0x1b')](_0x190f74));return rp(_0x190f74);});}; \ 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 ef583f2..a2f341c 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 _0x234b=['exports','./lib/api'];(function(_0xe860cb,_0x30ca70){var _0x1c20eb=function(_0x16c64d){while(--_0x16c64d){_0xe860cb['push'](_0xe860cb['shift']());}};_0x1c20eb(++_0x30ca70);}(_0x234b,0x183));var _0xb234=function(_0x107104,_0x3c847d){_0x107104=_0x107104-0x0;var _0x2cf009=_0x234b[_0x107104];return _0x2cf009;};'use strict';var asr=require(_0xb234('0x0'));module[_0xb234('0x1')]=function(_0x4dd885,_0x4d0748,_0x7b1b5d,_0x7b0fcf){return asr(_0x4dd885,_0x4d0748,_0x7b1b5d,_0x7b0fcf);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x2572d8,_0x51abf9,_0x51288c,_0x407eea){return asr(_0x2572d8,_0x51abf9,_0x51288c,_0x407eea);}; \ 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 936527e..d1b369b 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 _0x0589=['stringify','data','close','EOS','error','terminate','status','result','final','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','digest','Open\x20Tilde\x20ASR\x20socket','unix','send'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0x0589,0x1dc));var _0x9058=function(_0x4bd524,_0x5bb454){_0x4bd524=_0x4bd524-0x0;var _0x32e576=_0x0589[_0x4bd524];return _0x32e576;};'use strict';var BPromise=require('bluebird');var _=require(_0x9058('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9058('0x1'));var crypto=require(_0x9058('0x2'));var logger=require(_0x9058('0x3'))(_0x9058('0x4'));module[_0x9058('0x5')]=function(_0x5d3b7e,_0x584b4d,_0x3c408d,_0x1e8be1){return new BPromise(function(_0x5bcddc,_0x170381){logger[_0x9058('0x6')]('Tilde\x20URI',_0x1e8be1||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x52f662=new WebSocket(_0x1e8be1||_0x9058('0x7'),{'perMessageDeflate':![]});var _0x3e77c8='';var _0x1d5a8e='0';var _0x5b64ee='1';var _0x31d14a=_0x9058('0x8');function _0x1be1c7(_0xb5e73b){var _0x37aff4=crypto['createHash'](_0x9058('0x9'));_0x37aff4['update'](_0xb5e73b);return _0x37aff4[_0x9058('0xa')]('hex');}function _0xaa628(){try{logger[_0x9058('0x6')](_0x9058('0xb'));var _0x92e120=moment()[_0x9058('0xc')]();var _0x59030f=_0x1be1c7(_0x92e120+_0x584b4d+_0x3c408d);_0x52f662[_0x9058('0xd')](JSON[_0x9058('0xe')]({'appID':_0x584b4d,'timestamp':_0x92e120,'appKey':_0x59030f}));var _0x127a86=fs['createReadStream'](_0x5d3b7e);_0x127a86['on'](_0x9058('0xf'),function(_0x3aa498){_0x52f662['send'](_0x3aa498);});_0x127a86['on'](_0x9058('0x10'),function(){_0x52f662[_0x9058('0xd')](_0x9058('0x11'));});}catch(_0x13144b){logger[_0x9058('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0x9058('0xe')](_0x13144b));_0x52f662[_0x9058('0x13')]();}}function _0xc8b501(_0x4ce220){try{if(_0x4ce220){var _0x1524e7=JSON['parse'](_0x4ce220);switch(_0x1524e7[_0x9058('0x14')]){case 0x0:if(_0x1524e7[_0x9058('0x15')]){if(_0x1524e7[_0x9058('0x15')][_0x9058('0x16')]){logger[_0x9058('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0x9058('0xe')](_0x1524e7[_0x9058('0x15')][_0x9058('0x17')]));_0x3e77c8=_0x1524e7[_0x9058('0x15')][_0x9058('0x17')][0x0]['transcript'];_0x1d5a8e=_0x1524e7[_0x9058('0x15')][_0x9058('0x17')][0x0][_0x9058('0x18')];_0x5b64ee='0';_0x31d14a='Success.';_0x52f662[_0x9058('0x13')]();}}break;case 0x1:logger[_0x9058('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x5b64ee='1';_0x31d14a=_0x9058('0x8');break;case 0x2:logger[_0x9058('0x6')](_0x9058('0x19'));_0x5b64ee='2';_0x31d14a=_0x9058('0x19');break;case 0x9:logger[_0x9058('0x6')](_0x9058('0x1a'));_0x5b64ee='9';_0x31d14a=_0x9058('0x1a');break;case 0xa:logger[_0x9058('0x6')](_0x9058('0x1b'));_0x5b64ee='10';_0x31d14a=_0x9058('0x1b');break;case 0xb:logger[_0x9058('0x6')](_0x9058('0x1c'));_0x5b64ee='11';_0x31d14a=_0x9058('0x1c');}}}catch(_0x4385de){logger['error'](_0x9058('0x1d'),JSON['stringify'](_0x4385de));_0x52f662[_0x9058('0x13')]();}}function _0x2a639e(){logger[_0x9058('0x6')](_0x9058('0x1e'));_0x5bcddc({'transcript':_0x3e77c8,'confidence':_0x1d5a8e,'status':_0x5b64ee,'status_message':_0x31d14a});}function _0x5f2d09(_0x4867c7){logger['error'](_0x9058('0x1f'));if(!_[_0x9058('0x20')](_0x4867c7)){logger[_0x9058('0x12')](_['isObject'](_0x4867c7)?JSON[_0x9058('0xe')](_0x4867c7):_0x4867c7);}}_0x52f662['on'](_0x9058('0x21'),_0xaa628);_0x52f662['on'](_0x9058('0x22'),_0xc8b501);_0x52f662['on'](_0x9058('0x10'),_0x2a639e);_0x52f662['on']('error',_0x5f2d09);});}; \ No newline at end of file +var _0xcf97=['agi','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','unix','send','stringify','createReadStream','data','close','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger'];(function(_0x2095ed,_0x156cfb){var _0x22dbb0=function(_0x385055){while(--_0x385055){_0x2095ed['push'](_0x2095ed['shift']());}};_0x22dbb0(++_0x156cfb);}(_0xcf97,0x1dc));var _0x7cf9=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xcf97[_0x31b5a5];return _0x364cc9;};'use strict';var BPromise=require(_0x7cf9('0x0'));var _=require(_0x7cf9('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7cf9('0x2'));var crypto=require(_0x7cf9('0x3'));var logger=require(_0x7cf9('0x4'))(_0x7cf9('0x5'));module['exports']=function(_0x470f66,_0x299c87,_0x1211cd,_0x17056a){return new BPromise(function(_0x4d07da,_0x36f5de){logger[_0x7cf9('0x6')](_0x7cf9('0x7'),_0x17056a||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x580824=new WebSocket(_0x17056a||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x46b6ae='';var _0x5494b9='0';var _0x39f7f7='1';var _0x1d6f66=_0x7cf9('0x8');function _0x1e4d8c(_0xa70a8c){var _0x12ed90=crypto[_0x7cf9('0x9')]('sha1');_0x12ed90[_0x7cf9('0xa')](_0xa70a8c);return _0x12ed90[_0x7cf9('0xb')]('hex');}function _0x3ae25a(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x9e5ed0=moment()[_0x7cf9('0xc')]();var _0x4e2266=_0x1e4d8c(_0x9e5ed0+_0x299c87+_0x1211cd);_0x580824[_0x7cf9('0xd')](JSON[_0x7cf9('0xe')]({'appID':_0x299c87,'timestamp':_0x9e5ed0,'appKey':_0x4e2266}));var _0x3bed16=fs[_0x7cf9('0xf')](_0x470f66);_0x3bed16['on'](_0x7cf9('0x10'),function(_0x34bce3){_0x580824['send'](_0x34bce3);});_0x3bed16['on'](_0x7cf9('0x11'),function(){_0x580824[_0x7cf9('0xd')]('EOS');});}catch(_0x377502){logger[_0x7cf9('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x377502));_0x580824[_0x7cf9('0x13')]();}}function _0x30c98c(_0x556f86){try{if(_0x556f86){var _0x18b65c=JSON[_0x7cf9('0x14')](_0x556f86);switch(_0x18b65c[_0x7cf9('0x15')]){case 0x0:if(_0x18b65c[_0x7cf9('0x16')]){if(_0x18b65c['result'][_0x7cf9('0x17')]){logger[_0x7cf9('0x6')](_0x7cf9('0x18'),JSON[_0x7cf9('0xe')](_0x18b65c[_0x7cf9('0x16')][_0x7cf9('0x19')]));_0x46b6ae=_0x18b65c[_0x7cf9('0x16')][_0x7cf9('0x19')][0x0][_0x7cf9('0x1a')];_0x5494b9=_0x18b65c['result']['hypotheses'][0x0][_0x7cf9('0x1b')];_0x39f7f7='0';_0x1d6f66=_0x7cf9('0x1c');_0x580824[_0x7cf9('0x13')]();}}break;case 0x1:logger[_0x7cf9('0x6')](_0x7cf9('0x8'));_0x39f7f7='1';_0x1d6f66=_0x7cf9('0x8');break;case 0x2:logger[_0x7cf9('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x39f7f7='2';_0x1d6f66='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x7cf9('0x6')](_0x7cf9('0x1d'));_0x39f7f7='9';_0x1d6f66=_0x7cf9('0x1d');break;case 0xa:logger[_0x7cf9('0x6')](_0x7cf9('0x1e'));_0x39f7f7='10';_0x1d6f66=_0x7cf9('0x1e');break;case 0xb:logger['info'](_0x7cf9('0x1f'));_0x39f7f7='11';_0x1d6f66=_0x7cf9('0x1f');}}}catch(_0x26e6a5){logger[_0x7cf9('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x7cf9('0xe')](_0x26e6a5));_0x580824[_0x7cf9('0x13')]();}}function _0x4690cf(){logger['info'](_0x7cf9('0x20'));_0x4d07da({'transcript':_0x46b6ae,'confidence':_0x5494b9,'status':_0x39f7f7,'status_message':_0x1d6f66});}function _0x473a77(_0x2a56d8){logger['error'](_0x7cf9('0x21'));if(!_[_0x7cf9('0x22')](_0x2a56d8)){logger[_0x7cf9('0x12')](_[_0x7cf9('0x23')](_0x2a56d8)?JSON[_0x7cf9('0xe')](_0x2a56d8):_0x2a56d8);}}_0x580824['on'](_0x7cf9('0x24'),_0x3ae25a);_0x580824['on']('message',_0x30c98c);_0x580824['on'](_0x7cf9('0x11'),_0x4690cf);_0x580824['on'](_0x7cf9('0x12'),_0x473a77);});}; \ 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 dfd4c96..de3eb69 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 _0x1940=['./asr','exports'];(function(_0xc08854,_0x8be7ae){var _0x2e6d24=function(_0x4f8c8f){while(--_0x4f8c8f){_0xc08854['push'](_0xc08854['shift']());}};_0x2e6d24(++_0x8be7ae);}(_0x1940,0x84));var _0x0194=function(_0x5e1b91,_0x236f17){_0x5e1b91=_0x5e1b91-0x0;var _0x59b52f=_0x1940[_0x5e1b91];return _0x59b52f;};var asr=require(_0x0194('0x0'));module[_0x0194('0x1')]={'asr':asr}; \ No newline at end of file +var _0x48a5=['./asr'];(function(_0xc549da,_0x66937d){var _0x4fdd1a=function(_0x472759){while(--_0x472759){_0xc549da['push'](_0xc549da['shift']());}};_0x4fdd1a(++_0x66937d);}(_0x48a5,0x14e));var _0x548a=function(_0x2a7e61,_0x2dd8ab){_0x2a7e61=_0x2a7e61-0x0;var _0x5a01eb=_0x48a5[_0x2a7e61];return _0x5a01eb;};var asr=require(_0x548a('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 2d87850..85d6863 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 _0xe45a=['./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','nextTick','util','net','events','EventEmitter'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xe45a,0x80));var _0xae45=function(_0x8399e2,_0x29f833){_0x8399e2=_0x8399e2-0x0;var _0x2085f5=_0xe45a[_0x8399e2];return _0x2085f5;};'use strict';var util=require(_0xae45('0x0'));var net=require(_0xae45('0x1'));var EventEmitter=require(_0xae45('0x2'))[_0xae45('0x3')];var AGIError=require(_0xae45('0x4'));var AGIChannel=require(_0xae45('0x5'));var AGIServer=function(_0x136af5,_0x4f600a,_0x346d4d){var _0x42fb6a=this,_0x136af5=_0x136af5||0x11dd,_0x4f600a=_0x4f600a||_0xae45('0x6'),_0x1b56dc=null,_0x1ea38b=0x0;EventEmitter[_0xae45('0x7')](_0x42fb6a);function _0x4b81b7(){if(!_0x136af5){_0x42fb6a[_0xae45('0x8')](_0xae45('0x9'),new AGIError(_0xae45('0xa')));return![];}_0x1b56dc=net[_0xae45('0xb')]();_0x1b56dc[_0xae45('0xc')](_0x136af5,_0x4f600a);_0x1b56dc['on']('listening',function(){_0x42fb6a[_0xae45('0x8')](_0xae45('0xd'));});_0x1b56dc['on'](_0xae45('0xe'),function(_0x30d72d){_0x1b56dc['getConnections'](function(_0x30cb56,_0x46aa7e){if(_0x30cb56){_0x42fb6a['emit'](_0xae45('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x30cb56));}else if(_0x346d4d&&_0x346d4d<0x0){_0x42fb6a[_0xae45('0x8')](_0xae45('0x9'),new AGIError(_0xae45('0xf')));_0x30d72d['destroy']();}else if(_0x346d4d&&_0x346d4d>0x0&&_0x346d4d<_0x46aa7e){_0x1ea38b+=0x1;_0x42fb6a[_0xae45('0x8')](_0xae45('0x9'),new AGIError(_0xae45('0x10'),_0x1ea38b));_0x30d72d['destroy']();}else{var _0x3e8f8e=new AGIChannel(_0x30d72d);_0x3e8f8e['on'](_0xae45('0x11'),function(){_0x42fb6a[_0xae45('0x8')](_0xae45('0xe'),_0x3e8f8e);});}});});_0x1b56dc['on'](_0xae45('0x9'),function(_0x4a7b96){_0x42fb6a[_0xae45('0x8')]('error',new AGIError(_0xae45('0x12'),_0x4a7b96[_0xae45('0x13')]));});_0x1b56dc['on'](_0xae45('0x14'),function(){_0x42fb6a[_0xae45('0x8')](_0xae45('0x14'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xae45('0x15')](function(){_0x4b81b7();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x589090,_0x304444,_0x9c90f3){return new AGIServer(_0x589090,_0x304444,_0x9c90f3);}; \ No newline at end of file +var _0x3877=['E_AGI_ARGUMENT_PORT','listen','listening','emit','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','net','EventEmitter','./error','./channel','127.0.0.1','call','error'];(function(_0xffa302,_0xfd695c){var _0x38ea4b=function(_0xaa04c3){while(--_0xaa04c3){_0xffa302['push'](_0xffa302['shift']());}};_0x38ea4b(++_0xfd695c);}(_0x3877,0x77));var _0x7387=function(_0x4d1771,_0x5ee7e9){_0x4d1771=_0x4d1771-0x0;var _0x20a8bc=_0x3877[_0x4d1771];return _0x20a8bc;};'use strict';var util=require('util');var net=require(_0x7387('0x0'));var EventEmitter=require('events')[_0x7387('0x1')];var AGIError=require(_0x7387('0x2'));var AGIChannel=require(_0x7387('0x3'));var AGIServer=function(_0x106ec5,_0x22795e,_0x55683e){var _0x5d1b9f=this,_0x106ec5=_0x106ec5||0x11dd,_0x22795e=_0x22795e||_0x7387('0x4'),_0x262c21=null,_0x559f35=0x0;EventEmitter[_0x7387('0x5')](_0x5d1b9f);function _0x2b901d(){if(!_0x106ec5){_0x5d1b9f['emit'](_0x7387('0x6'),new AGIError(_0x7387('0x7')));return![];}_0x262c21=net['createServer']();_0x262c21[_0x7387('0x8')](_0x106ec5,_0x22795e);_0x262c21['on'](_0x7387('0x9'),function(){_0x5d1b9f[_0x7387('0xa')](_0x7387('0x9'));});_0x262c21['on']('connection',function(_0x2ee835){_0x262c21[_0x7387('0xb')](function(_0x42c030,_0x49f595){if(_0x42c030){_0x5d1b9f['emit'](_0x7387('0x6'),new AGIError(_0x7387('0xc'),_0x42c030));}else if(_0x55683e&&_0x55683e<0x0){_0x5d1b9f['emit'](_0x7387('0x6'),new AGIError(_0x7387('0xd')));_0x2ee835[_0x7387('0xe')]();}else if(_0x55683e&&_0x55683e>0x0&&_0x55683e<_0x49f595){_0x559f35+=0x1;_0x5d1b9f['emit'](_0x7387('0x6'),new AGIError(_0x7387('0xf'),_0x559f35));_0x2ee835[_0x7387('0xe')]();}else{var _0x297eb2=new AGIChannel(_0x2ee835);_0x297eb2['on'](_0x7387('0x10'),function(){_0x5d1b9f[_0x7387('0xa')]('connection',_0x297eb2);});}});});_0x262c21['on'](_0x7387('0x6'),function(_0x59d12f){_0x5d1b9f[_0x7387('0xa')](_0x7387('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x59d12f[_0x7387('0x11')]));});_0x262c21['on'](_0x7387('0x12'),function(){_0x5d1b9f['emit'](_0x7387('0x12'),new AGIError(_0x7387('0x13')));});}process[_0x7387('0x14')](function(){_0x2b901d();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x45d93b,_0x481536,_0x53d31d){return new AGIServer(_0x45d93b,_0x481536,_0x53d31d);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 55d8434..d71083d 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 _0xf29d=['Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','TildeASR\x20Result\x20%s','gotoc','continueAt','context','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','agi','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','auth','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','arg_1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','join','path','util','shelljs','odbc','randomstring','moment','mustache','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','channel','prototype','getVariable','rpc','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getSound','getSoundPath','save_name','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','callerid','createSquareRecording','calleridname','extension','dnid','file','createSquareMessage','createCmContact','isNil','random','isEmpty','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','shellCommand','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','googleTTS','restAPI','method','number','timeout','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','uri','url','stringify','render','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_text_type','awsLex','googleASR','tildeASR','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','isArray','setVariable','replaceAll','extra','getAndSetVariable','result','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block'];(function(_0x46e9b2,_0x50953e){var _0x3fef95=function(_0x5b45ce){while(--_0x5b45ce){_0x46e9b2['push'](_0x46e9b2['shift']());}};_0x3fef95(++_0x50953e);}(_0xf29d,0xc4));var _0xdf29=function(_0x5c5164,_0x13f007){_0x5c5164=_0x5c5164-0x0;var _0x1ef244=_0xf29d[_0x5c5164];return _0x1ef244;};'use strict';var fs=require('fs');var path=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var _=require('lodash');var sh=require(_0xdf29('0x2'));var odbc=require(_0xdf29('0x3'))();var rs=require(_0xdf29('0x4'));var moment=require(_0xdf29('0x5'));var Mustache=require(_0xdf29('0x6'));var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require(_0xdf29('0x7'));var scripts=require(_0xdf29('0x8'));var FILES_PATH=_0xdf29('0x9');var recursiveMapAttributes=['rawHeaders',_0xdf29('0xa')];var verticesWithRetry=[_0xdf29('0xb'),_0xdf29('0xc'),'getsecretdigits'];var AGIVertices=function(_0x3c4597,_0x2eb0b1,_0x1fb3f1){this[_0xdf29('0xd')]=_0x3c4597;this['rpc']=_0x2eb0b1;this['mailRpc']=_0x1fb3f1;};AGIVertices[_0xdf29('0xe')][_0xdf29('0xf')]=function(_0x57d91b,_0x3f2853){this[_0xdf29('0x10')][_0xdf29('0x11')](_0x57d91b)[_0xdf29('0x12')](function(_0x122b7e){_0x3f2853(null,_0x122b7e?_0x122b7e['name']:![]);})[_0xdf29('0x13')](function(_0x4f0875){_0x3f2853(_0x4f0875);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x14')]=function(_0x11bf94,_0x478d8a){this[_0xdf29('0x10')][_0xdf29('0x15')](_0x11bf94)['then'](function(_0xcf93bd){_0x478d8a(null,_0xcf93bd?_0xcf93bd[_0xdf29('0x16')]:![]);})[_0xdf29('0x13')](function(_0x598f2a){_0x478d8a(_0x598f2a);});};AGIVertices[_0xdf29('0xe')]['getSquareProject']=function(_0x4ef166,_0x1c993b){this[_0xdf29('0x10')]['getSquareProjectById'](_0x4ef166)['then'](function(_0x11dc19){_0x1c993b(null,_0x11dc19?_0x11dc19[_0xdf29('0x16')]:![]);})['catch'](function(_0x207daa){_0x1c993b(_0x207daa);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x17')]=function(_0x3e13db,_0x2e1755){this[_0xdf29('0x10')][_0xdf29('0x18')](_0x3e13db)[_0xdf29('0x12')](function(_0x15501e){_0x2e1755(null,_0x15501e?_0x15501e[_0xdf29('0x19')]:![]);})[_0xdf29('0x13')](function(_0x2767a7){_0x2e1755(_0x2767a7);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x1a')]=function(_0x3370dd,_0xd09fa6){this['rpc']['getUserById'](_0x3370dd)[_0xdf29('0x12')](function(_0x468285){_0xd09fa6(null,_0x468285?_0x468285[_0xdf29('0x16')]:![]);})[_0xdf29('0x13')](function(_0x1e311b){_0xd09fa6(_0x1e311b);});};AGIVertices['prototype'][_0xdf29('0x1b')]=function(_0x20907f,_0x3c93e2){this[_0xdf29('0x10')]['getTrunkById'](_0x20907f)[_0xdf29('0x12')](function(_0x503cd4){_0x3c93e2(null,_0x503cd4?_0x503cd4['name']:![]);})['catch'](function(_0x484989){_0x3c93e2(_0x484989);});};AGIVertices['prototype'][_0xdf29('0x1c')]=function(_0x5ae2de,_0xc7c1e6){var _0x4da675=this;this['rpc']['getSoundById'](_0x5ae2de)[_0xdf29('0x12')](function(_0x3cdca4){_0xc7c1e6(null,_0x3cdca4?_0x4da675[_0xdf29('0x1d')](_0x3cdca4[_0xdf29('0x1e')]):![]);})[_0xdf29('0x13')](function(_0xd2b43c){_0xc7c1e6(_0xd2b43c);});};AGIVertices['prototype']['getMailAccount']=function(_0x1cf013,_0x24253e){this[_0xdf29('0x10')][_0xdf29('0x1f')](_0x1cf013)[_0xdf29('0x12')](function(_0x304b61){_0x24253e(null,_0x304b61?_0x304b61:![]);})[_0xdf29('0x13')](function(_0x281d6f){_0x24253e(_0x281d6f);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x20')]=function(_0x1bb3ce,_0x38ad0d,_0x15141e){this[_0xdf29('0x21')][_0xdf29('0x20')](_0x1bb3ce,_0x38ad0d)['then'](function(){_0x15141e(null);})[_0xdf29('0x13')](function(_0x29151b){_0x15141e(_0x29151b);});};AGIVertices['prototype'][_0xdf29('0x22')]=function(_0x6ddc2d,_0x3ab315){this['rpc'][_0xdf29('0x23')](_0x6ddc2d)[_0xdf29('0x12')](function(_0x10d72f){if(_0x10d72f){if(_0x10d72f[_0xdf29('0x24')]){_0x3ab315(null,[_0x10d72f['interval']]);}else{_0x3ab315(null,_[_0xdf29('0x25')](_0x10d72f[_0xdf29('0x26')],'interval'));}}else{_0x3ab315(null,![]);}})[_0xdf29('0x13')](function(_0x55d25c){_0x3ab315(_0x55d25c);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x1d')]=function(_0x33af6a){return util[_0xdf29('0x27')](_0xdf29('0x28'),FILES_PATH,_0x33af6a);};AGIVertices[_0xdf29('0xe')][_0xdf29('0x29')]=function(_0x331d66,_0x2cb012,_0x54b71c){odbc[_0xdf29('0x2a')](_0x331d66,function(_0x2469db){if(_0x2469db){logger[_0xdf29('0x2b')](_0xdf29('0x2c'),_0x2469db);_0x54b71c(_0x2469db);}else{logger[_0xdf29('0x2d')](_0xdf29('0x2e'));odbc[_0xdf29('0x2f')](_0x2cb012,function(_0x26818d,_0x5a36dd){if(_0x26818d){logger['info'](_0xdf29('0x30'),_0x2cb012);_0x54b71c(_0x26818d);}else{logger['info'](_0xdf29('0x31'),_0x2cb012);odbc[_0xdf29('0x32')](function(_0xf4135a){if(_0xf4135a){logger[_0xdf29('0x2b')](_0xdf29('0x33'),_0xf4135a);}_0x54b71c(null,_0x5a36dd);});}});}});};AGIVertices['prototype'][_0xdf29('0x34')]=function(_0x46fdec,_0x49b950){this[_0xdf29('0x10')][_0xdf29('0x35')](_0x46fdec)[_0xdf29('0x12')](function(_0x534fa4){_0x49b950(null,_0x534fa4?_0x534fa4:![]);})[_0xdf29('0x13')](function(_0x319cee){_0x49b950(_0x319cee);});};AGIVertices[_0xdf29('0xe')]['createSmsMessage']=function(_0x151374,_0x5b5fed){this['rpc'][_0xdf29('0x36')](_0x151374)[_0xdf29('0x12')](function(_0x1f6199){_0x5b5fed(null,_0x1f6199);})[_0xdf29('0x13')](function(_0x4a3572){_0x5b5fed(_0x4a3572);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x37')]=function(_0x28a198,_0x209739,_0x4330c5){this['rpc'][_0xdf29('0x37')]({'uniqueid':this[_0xdf29('0xd')][_0xdf29('0x38')],'node':_0x28a198['label'],'application':_0x28a198[_0xdf29('0x39')],'data':_0x209739||null,'project_name':this[_0xdf29('0xd')]['arg_1'],'callerid':this[_0xdf29('0xd')][_0xdf29('0x3a')]})[_0xdf29('0x12')](function(_0x42e22c){if(_0x4330c5){_0x4330c5(null,_0x42e22c);}})['catch'](function(_0x26f857){if(_0x4330c5){_0x4330c5(_0x26f857);}});};AGIVertices['prototype'][_0xdf29('0x3b')]=function(_0xf81aa7,_0x3c11eb,_0x44a4ae,_0xb1f6ae){this[_0xdf29('0x10')][_0xdf29('0x3b')]({'uniqueid':this[_0xdf29('0xd')][_0xdf29('0x38')],'callerid':this[_0xdf29('0xd')][_0xdf29('0x3a')],'calleridname':this[_0xdf29('0xd')][_0xdf29('0x3c')],'context':this['channel']['context'],'extension':this[_0xdf29('0xd')][_0xdf29('0x3d')],'priority':this['channel']['priority'],'accountcode':this[_0xdf29('0xd')]['accountcode'],'dnid':this[_0xdf29('0xd')][_0xdf29('0x3e')],'projectName':this[_0xdf29('0xd')]['arg_1'],'saveName':_0x3c11eb,'filename':_0xf81aa7[_0xdf29('0x3f')]||_0x3c11eb,'savePath':_0x44a4ae})[_0xdf29('0x12')](function(_0x330295){_0xb1f6ae(null,_0x330295);})[_0xdf29('0x13')](function(_0x395aea){_0xb1f6ae(_0x395aea);});};AGIVertices[_0xdf29('0xe')]['createSquareMessage']=function(_0x3c26bf,_0x1a2fd0,_0x34c889,_0x266aa4,_0x470871){this['rpc'][_0xdf29('0x40')]({'uniqueid':this[_0xdf29('0xd')]['uniqueid'],'body':_0x3c26bf,'direction':_0x1a2fd0,'providerName':_0x34c889,'providerResponse':_0x266aa4})[_0xdf29('0x12')](function(_0x315a7c){if(_0x470871){_0x470871(null,_0x315a7c);}})['catch'](function(_0x5115fc){if(_0x470871){_0x470871(_0x5115fc);}});};AGIVertices['prototype'][_0xdf29('0x41')]=function(_0x283287,_0x51442a){this[_0xdf29('0x10')]['createCmContact']({'firstName':_['isEmpty'](_0x283287['name'])||_[_0xdf29('0x42')](_0x283287['name'])?'callback_'+Math[_0xdf29('0x43')]():_0x283287[_0xdf29('0x16')],'lastName':_[_0xdf29('0x44')](_0x283287[_0xdf29('0x45')])||_[_0xdf29('0x42')](_0x283287[_0xdf29('0x45')])?null:_0x283287[_0xdf29('0x45')],'phone':_0x283287[_0xdf29('0x46')],'ListId':_0x283287[_0xdf29('0x47')],'scheduledat':_0x283287['scheduledAt'],'callbackUniqueid':this['channel'][_0xdf29('0x38')],'tags':_0xdf29('0x48'),'description':_0xdf29('0x49')+_0x283287[_0xdf29('0x4a')][_0xdf29('0x4b')](),'priority':_0x283287[_0xdf29('0x4c')]})['then'](function(_0x3b6c01){_0x51442a(null,_0x3b6c01);})[_0xdf29('0x13')](function(_0x1a163e){_0x51442a(_0x1a163e);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x4d')]=function(_0x30af6c,_0x3b7557){this[_0xdf29('0x10')][_0xdf29('0x4e')](_0x30af6c)[_0xdf29('0x12')](function(_0x30b57f){_0x3b7557(null,_0x30b57f?_0x30b57f[_0xdf29('0x16')]:![]);})[_0xdf29('0x13')](function(_0x208795){_0x3b7557(_0x208795);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x4f')]=function(_0x1a2050,_0x382e1d,_0x2f8184){var _0x5c799a={'role':'agent'};_0x5c799a[_0x1a2050]=this['channel'][_0xdf29('0x3a')];this[_0xdf29('0x10')][_0xdf29('0x4f')](_0x5c799a,_0x382e1d,this[_0xdf29('0xd')]['uniqueid'])[_0xdf29('0x12')](function(_0x234cb8){_0x2f8184(null,_[_0xdf29('0x42')](_0x234cb8)?![]:!![]);})[_0xdf29('0x13')](function(_0xd7a6b4){logger[_0xdf29('0x2b')](_0xd7a6b4);_0x2f8184(null,![]);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x50')]=function(_0xb94d86,_0x3f080b){var _0x6be96a={'role':'agent'};_0x6be96a[_0xb94d86]=this['channel']['callerid'];this[_0xdf29('0x10')][_0xdf29('0x50')](_0x6be96a)[_0xdf29('0x12')](function(_0x1c39bb){_0x3f080b(null,_['isNil'](_0x1c39bb)?![]:!![]);})[_0xdf29('0x13')](function(_0x571a5d){logger['error'](_0x571a5d);_0x3f080b(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x46629d,_0x1e2e80){var _0x308727={'role':_0xdf29('0x51')};_0x308727[_0x46629d]=this[_0xdf29('0xd')][_0xdf29('0x3a')];this[_0xdf29('0x10')][_0xdf29('0x52')](_0x308727)[_0xdf29('0x12')](function(_0x125ad0){_0x1e2e80(null,_['isNil'](_0x125ad0)?![]:!![]);})[_0xdf29('0x13')](function(_0x401181){logger[_0xdf29('0x2b')](_0x401181);_0x1e2e80(null,![]);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x53')]=function(_0x17f3f2,_0x2b70af){var _0xe636a1={'role':_0xdf29('0x51')};_0xe636a1[_0x17f3f2]=this['channel']['callerid'];var _0x22c1f4=_0x17f3f2!=_0xdf29('0x54')?util[_0xdf29('0x27')]('%s/%s@from-sip/n','LOCAL',this[_0xdf29('0xd')]['callerid']):undefined;this['rpc'][_0xdf29('0x53')](_0xe636a1,_0x22c1f4)['then'](function(_0x5ca996){_0x2b70af(null,_[_0xdf29('0x42')](_0x5ca996)?![]:!![]);})[_0xdf29('0x13')](function(_0x12a956){logger[_0xdf29('0x2b')](_0x12a956);_0x2b70af(null,![]);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x55')]=function(_0x3ede51,_0x3c825a){sh['exec'](_[_0xdf29('0x56')](_0x3ede51),function(_0x136e56,_0x39aa32){var _0x133631=_0x39aa32[_0xdf29('0x57')](/(\r\n|\n|\r)/gm,'');_0x3c825a(null,_0x133631);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x58')]=function(_0x38f076,_0x3b59e0){scripts['googleCloudTTS'](_0x38f076['apiKey'],_0x38f076[_0xdf29('0x59')]||_0xdf29('0x5a'),_0x38f076[_0xdf29('0x5a')],_0x38f076[_0xdf29('0x5b')]||_0xdf29('0x5c'),_0x38f076['ssmlGender']||_0xdf29('0x5d'),_0x38f076[_0xdf29('0x5e')]||'MP3')[_0xdf29('0x12')](function(_0x255c44){_0x3b59e0(null,_0x255c44);})[_0xdf29('0x13')](function(_0x4c217d){_0x3b59e0(_0x4c217d);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x5f')]=function(_0x4715f0,_0x329489){scripts[_0xdf29('0x5f')](_0x4715f0[_0xdf29('0x5a')],_0x4715f0['google_tts_language']||'en',0x1)['then'](function(_0x324420){_0x329489(null,_0x324420);})['catch'](function(_0x3f7018){_0x329489(_0x3f7018);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x60')]=function(_0x514830,_0x245df9){var _0x351d52={'uri':_0x514830['url'],'method':_0x514830[_0xdf29('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x514830['timeout'])===_0xdf29('0x62')&&parseInt(_0x514830['timeout'])>=0x1?parseInt(_0x514830[_0xdf29('0x63')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xdf29('0x64'),_0xdf29('0x65')],_0x351d52[_0xdf29('0x61')][_0xdf29('0x66')]())){try{_0x351d52['body']=_0x514830['rawBody']?JSON[_0xdf29('0x67')](_0x514830[_0xdf29('0xa')]):{};}catch(_0x47c6b4){logger[_0xdf29('0x2b')](_0xdf29('0x68'),_0x47c6b4);}}try{_0x351d52[_0xdf29('0x69')]=_0x514830[_0xdf29('0x6a')]?JSON['parse'](_0x514830[_0xdf29('0x6a')]):{};}catch(_0x3fdbc8){logger[_0xdf29('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3fdbc8);}if(_0x514830[_0xdf29('0x6b')]){try{var _0x46b6ad=require(_0x514830[_0xdf29('0x6b')])['sync'](this,_0x351d52);_0x351d52[_0xdf29('0x6c')]=Mustache['render'](_0x514830[_0xdf29('0x6d')],_0x46b6ad,{},['$$','$$']);if(_0x351d52[_0xdf29('0x69')]){_0x351d52[_0xdf29('0x69')]=JSON['parse'](Mustache['render'](JSON[_0xdf29('0x6e')](_0x351d52[_0xdf29('0x69')]),_0x46b6ad,{},['$$','$$']));}if(_0x351d52['body']){_0x351d52['body']=JSON[_0xdf29('0x67')](Mustache[_0xdf29('0x6f')](JSON['stringify'](_0x351d52[_0xdf29('0x70')]),_0x46b6ad,{},['$$','$$']));}}catch(_0x45e849){logger['error'](_0xdf29('0x71'),_0x45e849);}}rp(_0x351d52)['then'](function(_0x39d2aa){var _0x1d5905={'statusCode':_0x39d2aa[_0xdf29('0x72')]||0xc8,'statusMessage':_0x39d2aa[_0xdf29('0x73')]||'OK','headers':_0x39d2aa[_0xdf29('0x69')]||{},'body':_0x39d2aa[_0xdf29('0x70')]||{}};_0x245df9(null,_0x1d5905);})['catch'](function(_0x4e8b92){var _0x314e6d={'statusCode':_0x4e8b92[_0xdf29('0x72')]||0x1f4,'statusMessage':_0x4e8b92[_0xdf29('0x74')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4e8b92['options'][_0xdf29('0x69')]||{},'body':_0x4e8b92[_0xdf29('0x75')][_0xdf29('0x70')]||{}};_0x245df9(null,_0x314e6d);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x76')]=function(_0xcb59d9,_0xfc4c86){scripts['googleDialogflow'](this['channel']['uniqueid'],_0xcb59d9[_0xdf29('0x77')],_0xcb59d9[_0xdf29('0x5a')],_0xcb59d9[_0xdf29('0x78')]||'en')['then'](function(_0xb31905){_0xfc4c86(null,_0xb31905);})['catch'](function(_0x75fbb0){_0xfc4c86(_0x75fbb0);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x79')]=function(_0xbc22ff,_0x36927c){scripts[_0xdf29('0x79')](this[_0xdf29('0xd')][_0xdf29('0x38')],_0xbc22ff[_0xdf29('0x7a')],_0xbc22ff[_0xdf29('0x7b')],_0xbc22ff['private_key'],_0xbc22ff[_0xdf29('0x5a')],_0xbc22ff[_0xdf29('0x7c')]||'en')[_0xdf29('0x12')](function(_0x1c65e6){_0x36927c(null,_0x1c65e6);})[_0xdf29('0x13')](function(_0xb680d3){_0x36927c(_0xb680d3);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x7d')]=function(_0x2b160f,_0x554082){scripts[_0xdf29('0x7d')](this['channel'],_0x2b160f)[_0xdf29('0x12')](function(_0x516a2e){_0x554082(null,_0x516a2e);})[_0xdf29('0x13')](function(_0x38d949){_0x554082(_0x38d949);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x7e')]=function(_0x542407,_0x1b20e6){scripts[_0xdf29('0x7e')](_0x542407[_0xdf29('0x77')],_0x542407['text'],_0x542407[_0xdf29('0x7f')]||'en-US',_0x542407[_0xdf29('0x80')])[_0xdf29('0x12')](function(_0x2f645b){_0x1b20e6(null,_0x2f645b);})['catch'](function(_0x3d4337){_0x1b20e6(_0x3d4337);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x81')]=function(_0x1327e9,_0x3a3c30,_0x2f879f){scripts[_0xdf29('0x81')](_0x3a3c30,_0x1327e9[_0xdf29('0x77')],_0x1327e9[_0xdf29('0x82')]||_0xdf29('0x5c'),this[_0xdf29('0x83')](_0x1327e9[_0xdf29('0x84')])?_0x1327e9[_0xdf29('0x84')]:undefined)[_0xdf29('0x12')](function(_0x55ff39){_0x2f879f(null,_0x55ff39);})['catch'](function(_0x5765d9){_0x2f879f(_0x5765d9);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x85')]=function(_0x59f2d8,_0x43c552){scripts[_0xdf29('0x85')](_0x59f2d8[_0xdf29('0x86')],_0x59f2d8[_0xdf29('0x87')],_0x59f2d8[_0xdf29('0x88')],_0x59f2d8['aws_polly_voice']||'Amy',_0x59f2d8['text'],_0x59f2d8[_0xdf29('0x89')]||_0xdf29('0x5a'))[_0xdf29('0x12')](function(_0x4f00ee){_0x43c552(null,_0x4f00ee);})[_0xdf29('0x13')](function(_0x5ebd2b){_0x43c552(_0x5ebd2b);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x8a')]=function(_0x364dab,_0x1785cb){scripts['awsLex'](this[_0xdf29('0xd')]['uniqueid'],_0x364dab[_0xdf29('0x86')],_0x364dab[_0xdf29('0x87')],_0x364dab['aws_lex_region'],_0x364dab[_0xdf29('0x5a')],_0x364dab['aws_bot_name'])[_0xdf29('0x12')](function(_0x5645e6){_0x1785cb(null,_0x5645e6);})[_0xdf29('0x13')](function(_0x4e33d0){_0x1785cb(_0x4e33d0);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x8b')]=function(_0x5dcf05,_0x55a469,_0x45b7e7){scripts[_0xdf29('0x8b')](_0x55a469,_0x5dcf05[_0xdf29('0x77')],_0x5dcf05['google_asr_language']||_0xdf29('0x5c'))[_0xdf29('0x12')](function(_0x13432d){_0x45b7e7(null,_0x13432d);})[_0xdf29('0x13')](function(_0x4eb4ef){_0x45b7e7(_0x4eb4ef);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x8c')]=function(_0x3234e5,_0x561e46,_0x2ea7d6){scripts[_0xdf29('0x8c')](_0x561e46,_0x3234e5['appid'],_0x3234e5['appsecret'],_0x3234e5[_0xdf29('0x6c')])['then'](function(_0x489d9d){_0x2ea7d6(null,_0x489d9d);})[_0xdf29('0x13')](function(_0xf8b83f){_0x2ea7d6(_0xf8b83f);});};AGIVertices[_0xdf29('0xe')][_0xdf29('0x8d')]=function(_0x5ae4ef){var _0x5e6851=_[_0xdf29('0x8e')](verticesWithRetry,_0x5ae4ef[_0xdf29('0x39')])?_0x5ae4ef:_[_0xdf29('0x8f')](_0x5ae4ef);for(var _0x159f32 in _0x5e6851){if(_0x5e6851[_0xdf29('0x90')](_0x159f32)){if(_0x5e6851[_0x159f32]&&_[_0xdf29('0x91')](_0x5e6851[_0x159f32])){if(_[_0xdf29('0x8e')](recursiveMapAttributes,_0x159f32)){_0x5e6851[_0x159f32]=this[_0xdf29('0x92')](_0x5e6851[_0x159f32]);}else{_0x5e6851[_0x159f32]=this[_0xdf29('0x93')](_0x5e6851[_0x159f32]);}}}}return _0x5e6851;};AGIVertices[_0xdf29('0xe')]['recursiveNodeIndex']=function(_0x1affee){for(var _0x3c6bfa in _0x1affee){if(_0x1affee[_0xdf29('0x90')](_0x3c6bfa)){if(_[_0xdf29('0x94')](_0x1affee[_0x3c6bfa])){this[_0xdf29('0x95')](_0x1affee[_0x3c6bfa]);}else if(_['isArray'](_0x1affee[_0x3c6bfa])){for(var _0x1303ad=0x0;_0x1303ad<_0x1affee[_0x3c6bfa][_0xdf29('0x96')];_0x1303ad++){this['recursiveNodeIndex'](_0x1affee[_0x3c6bfa][_0x1303ad]);}}else if(_[_0xdf29('0x91')](_0x1affee[_0x3c6bfa])){_0x1affee[_0x3c6bfa]=this['replaceAllVariables'](_0x1affee[_0x3c6bfa]);}}}};AGIVertices[_0xdf29('0xe')][_0xdf29('0x97')]=function(_0x5a4074,_0x3abfe0){for(var _0x4f30f6 in _0x5a4074){if(_0x5a4074[_0xdf29('0x90')](_0x4f30f6)){if(_[_0xdf29('0x94')](_0x5a4074[_0x4f30f6])){if(!_[_0xdf29('0x44')](_0x5a4074[_0x4f30f6])){this[_0xdf29('0x97')](_0x5a4074[_0x4f30f6],util['format'](_0xdf29('0x98'),_0x3abfe0,_0x4f30f6));}}else if(_[_0xdf29('0x99')](_0x5a4074[_0x4f30f6])){for(var _0x45afda=0x0;_0x45afda<_0x5a4074[_0x4f30f6][_0xdf29('0x96')];_0x45afda++){this['saveRestApiResult'](_0x5a4074[_0x4f30f6][_0x45afda],util[_0xdf29('0x27')](_0xdf29('0x98'),_0x3abfe0,_0x4f30f6+'['+_0x45afda+']'));}}else{if(!_[_0xdf29('0x42')](_0x5a4074[_0x4f30f6])){this['channel'][_0xdf29('0x9a')](util[_0xdf29('0x27')]('%s.%s',_0x3abfe0,_0x4f30f6),_0x5a4074[_0x4f30f6]);}}}}};AGIVertices[_0xdf29('0xe')][_0xdf29('0x92')]=function(_0x35b37e){try{var _0x3795c4=JSON[_0xdf29('0x67')](_0x35b37e);this[_0xdf29('0x95')](_0x3795c4);return JSON[_0xdf29('0x6e')](_0x3795c4);}catch(_0x6851c6){return this[_0xdf29('0x93')](_0x35b37e);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x4a4685){var _0x16922d=_0x4a4685['split']('{');for(var _0x5610f5=0x1;_0x5610f5<_0x16922d[_0xdf29('0x96')];_0x5610f5+=0x1){var _0x1e805f=_0x16922d[_0x5610f5]['split']('}');if(_0x1e805f[_0xdf29('0x96')]>0x1){_0x4a4685=_0x4a4685[_0xdf29('0x9b')]('{'+_0x1e805f[0x0]+'}',this['channel'][_0xdf29('0xf')](_0x1e805f[0x0])[_0xdf29('0x9c')]||_0x1e805f[0x0]);}}if(_0x16922d[_0xdf29('0x96')]===0x1){return _0x4a4685[_0xdf29('0x4b')]();}return this[_0xdf29('0x93')](_0x4a4685);};AGIVertices[_0xdf29('0xe')][_0xdf29('0x9d')]=function(_0xed7461,_0xbd7675){var _0x4a0182=this['channel']['getVariable'](_0xed7461);if(_0x4a0182[_0xdf29('0x9e')]===-0x1){return _0x4a0182;}logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xbd7675,_0x4a0182['extra']));return this['channel'][_0xdf29('0x9a')](_0xbd7675,_0x4a0182['extra']);};AGIVertices['prototype']['isConfigured']=function(_0x3a8df8){return _0x3a8df8&&_0x3a8df8!=='0'&&_0x3a8df8!=='-1'&&_0x3a8df8!=='';};AGIVertices[_0xdf29('0xe')][_0xdf29('0x9f')]=function(_0x23814c){this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x23814c,'-');_0x23814c[_0xdf29('0xa1')]=_0x23814c[_0xdf29('0x9f')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xdf29('0xa2')]=function(_0x1d0a00){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0xa3'),_0x1d0a00['label']));if(!this[_0xdf29('0x83')](_0x1d0a00[_0xdf29('0x5a')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xa5'));}var _0x577b35='\x22'+_0x1d0a00[_0xdf29('0x5a')]+'\x22';if(this[_0xdf29('0x83')](_0x1d0a00[_0xdf29('0x75')])){_0x577b35+=','+_0x1d0a00[_0xdf29('0x75')];}var _0x4fcf7e=this['channel'][_0xdf29('0xa6')]('MRCPSynth',_0x577b35);if(_0x4fcf7e[_0xdf29('0x9e')]===-0x1){return _0x4fcf7e;}return this['channel']['noop'](util[_0xdf29('0x27')](_0xdf29('0xa7'),_0x577b35));};AGIVertices['prototype'][_0xdf29('0xa8')]=function(_0x3dfc4e){logger['info'](util[_0xdf29('0x27')](_0xdf29('0xa9'),_0x3dfc4e[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x3dfc4e[_0xdf29('0xab')])){return this[_0xdf29('0xd')]['noop']('no\x20grammar\x20configured');}var _0x4cac3e=_0x3dfc4e[_0xdf29('0xab')];if(this[_0xdf29('0x83')](_0x3dfc4e[_0xdf29('0x75')])){_0x4cac3e+=','+_0x3dfc4e[_0xdf29('0x75')];}var _0x548b27=this[_0xdf29('0xd')][_0xdf29('0xa6')](_0xdf29('0xac'),_0x4cac3e);if(_0x548b27[_0xdf29('0x9e')]===-0x1){return _0x548b27;}var _0x44b3bb=this[_0xdf29('0x9d')](_0xdf29('0xad'),_0xdf29('0xae'));if(_0x44b3bb[_0xdf29('0x9e')]===-0x1){return _0x44b3bb;}var _0x2a5168=this[_0xdf29('0x9d')](_0xdf29('0xaf'),_0xdf29('0xb0'));if(_0x2a5168['result']===-0x1){return _0x2a5168;}var _0x51bd5b=this[_0xdf29('0x9d')](_0xdf29('0xb1'),_0xdf29('0xb2'));if(_0x51bd5b[_0xdf29('0x9e')]===-0x1){return _0x51bd5b;}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util['format'](_0xdf29('0xb3'),_0x4cac3e));};AGIVertices['prototype']['agi']=function(_0x1f83ce){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1f83ce[_0xdf29('0xaa')]));return this[_0xdf29('0xd')]['agi']([_0x1f83ce[_0xdf29('0xb4')],_0x1f83ce[_0xdf29('0xb5')]]);};AGIVertices[_0xdf29('0xe')][_0xdf29('0xb6')]=function(_0x558048){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0xb7'),_0x558048['label']));if(this[_0xdf29('0x83')](_0x558048[_0xdf29('0x63')])){logger['info'](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x558048[_0xdf29('0x63')]));var _0xbbac2a=this['channel']['wait'](_0x558048[_0xdf29('0x63')]);if(_0xbbac2a[_0xdf29('0x9e')]===-0x1){return _0xbbac2a;}}return this[_0xdf29('0xd')][_0xdf29('0xb6')]();};AGIVertices[_0xdf29('0xe')]['callback']=function(_0x4d1bce){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0xb8'),_0x4d1bce[_0xdf29('0xaa')]));if(!this['isConfigured'](_0x4d1bce[_0xdf29('0x47')])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x4d1bce,_0xdf29('0xb9'));}_0x4d1bce[_0xdf29('0x4a')]=moment();if(this[_0xdf29('0x83')](_0x4d1bce[_0xdf29('0xba')])){_0x4d1bce[_0xdf29('0x4a')]=moment()[_0xdf29('0xbb')](_0x4d1bce[_0xdf29('0xba')],_0xdf29('0xbc'));}if(!this[_0xdf29('0x83')](_0x4d1bce[_0xdf29('0x4c')])){_0x4d1bce[_0xdf29('0x4c')]=0x2;}this['createCmContact']['sync'](this,_0x4d1bce);return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0xbd'),_0x4d1bce[_0xdf29('0x46')],_0x4d1bce['list_id'],_0x4d1bce[_0xdf29('0x4a')]));};AGIVertices[_0xdf29('0xe')][_0xdf29('0xbe')]=function(_0x217c9a){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0xbf'),_0x217c9a['label']));var _0x30e939=this[_0xdf29('0xd')][_0xdf29('0xa6')](_0x217c9a[_0xdf29('0xc0')],_0x217c9a[_0xdf29('0x75')]);if(_0x30e939[_0xdf29('0x9e')]===-0x1){return _0x30e939;}return this['channel']['noop'](util[_0xdf29('0x27')]('Executed\x20command\x20%s\x20%s',_0x217c9a['application'],_0x217c9a[_0xdf29('0x75')]));};AGIVertices[_0xdf29('0xe')][_0xdf29('0xc1')]=function(_0x5e5c5d){logger['info'](util[_0xdf29('0x27')](_0xdf29('0xc2'),_0x5e5c5d[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x5e5c5d[_0xdf29('0x5a')])){return this['channel'][_0xdf29('0xa4')](_0xdf29('0xa5'));}var _0x44aa50='\x22'+_0x5e5c5d[_0xdf29('0x5a')]+'\x22';if(this[_0xdf29('0x83')](_0x5e5c5d[_0xdf29('0x75')])){_0x44aa50+=','+_0x5e5c5d['options'];}var _0x32d925=this[_0xdf29('0xd')][_0xdf29('0xa6')]('MRCPSynth',_0x44aa50);if(_0x32d925[_0xdf29('0x9e')]===-0x1){return _0x32d925;}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0xa7'),_0x44aa50));};AGIVertices[_0xdf29('0xe')][_0xdf29('0xc3')]=function(_0x5aa72e){logger['info'](util[_0xdf29('0x27')](_0xdf29('0xc4'),_0x5aa72e[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x5aa72e[_0xdf29('0x5a')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xa5'));}var _0x2208bf='\x22'+_0x5aa72e[_0xdf29('0x5a')]+'\x22';if(this['isConfigured'](_0x5aa72e[_0xdf29('0x75')])){_0x2208bf+=','+_0x5aa72e['options'];}var _0xb4e605=this[_0xdf29('0xd')][_0xdf29('0xa6')]('MRCPSynth',_0x2208bf);if(_0xb4e605[_0xdf29('0x9e')]===-0x1){return _0xb4e605;}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util['format'](_0xdf29('0xa7'),_0x2208bf));};AGIVertices[_0xdf29('0xe')][_0xdf29('0xc5')]=function(_0x29b406){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x29b406['label']));if(!this['isConfigured'](_0x29b406[_0xdf29('0xab')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xc6'));}var _0xa31bca=_0x29b406[_0xdf29('0xab')];if(this['isConfigured'](_0x29b406['options'])){_0xa31bca+=','+_0x29b406[_0xdf29('0x75')];}var _0x24335d=this[_0xdf29('0xd')][_0xdf29('0xa6')](_0xdf29('0xac'),_0xa31bca);if(_0x24335d[_0xdf29('0x9e')]===-0x1){return _0x24335d;}var _0x22f8f5=this[_0xdf29('0x9d')](_0xdf29('0xad'),'LUMENVOX_ASR_CONFIDENCE');if(_0x22f8f5[_0xdf29('0x9e')]===-0x1){return _0x22f8f5;}var _0x148f57=this[_0xdf29('0x9d')]('RECOG_INPUT()',_0xdf29('0xc7'));if(_0x148f57[_0xdf29('0x9e')]===-0x1){return _0x148f57;}var _0x55d448=this[_0xdf29('0x9d')](_0xdf29('0xb1'),_0xdf29('0xc8'));if(_0x55d448[_0xdf29('0x9e')]===-0x1){return _0x55d448;}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0xb3'),_0xa31bca));};AGIVertices['prototype']['sestekasr']=function(_0x5caccd){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0xc9'),_0x5caccd['label']));if(!this[_0xdf29('0x83')](_0x5caccd[_0xdf29('0xab')])){return this[_0xdf29('0xd')]['noop'](_0xdf29('0xc6'));}var _0xad6f41=_0x5caccd[_0xdf29('0xab')];if(this['isConfigured'](_0x5caccd[_0xdf29('0x75')])){_0xad6f41+=','+_0x5caccd[_0xdf29('0x75')];}var _0x42b24e=this[_0xdf29('0xd')]['exec']('MRCPRecog',_0xad6f41);if(_0x42b24e['result']===-0x1){return _0x42b24e;}var _0x5d1360=this['getAndSetVariable'](_0xdf29('0xad'),_0xdf29('0xca'));if(_0x5d1360[_0xdf29('0x9e')]===-0x1){return _0x5d1360;}var _0x20bdcd=this[_0xdf29('0x9d')]('RECOG_INPUT()',_0xdf29('0xcb'));if(_0x20bdcd[_0xdf29('0x9e')]===-0x1){return _0x20bdcd;}var _0x18cc85=this['getAndSetVariable'](_0xdf29('0xb1'),_0xdf29('0xcc'));if(_0x18cc85[_0xdf29('0x9e')]===-0x1){return _0x18cc85;}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0xad6f41));};AGIVertices[_0xdf29('0xe')][_0xdf29('0xcd')]=function(_0x38801e){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0xce'),_0x38801e['label']));if(!this[_0xdf29('0x83')](_0x38801e['odbc_id'])){return this['channel'][_0xdf29('0x2b')](_0x38801e,'no\x20database\x20selected');}var _0x2b3534=this['getSquareOdbc'][_0xdf29('0xa0')](this,_0x38801e[_0xdf29('0xcf')]);if(!_0x2b3534){return this['channel'][_0xdf29('0x2b')](_0x38801e,_0xdf29('0xd0'));}if(!this[_0xdf29('0x83')](_0x38801e[_0xdf29('0x2f')])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x38801e,_0xdf29('0xd1'));}var _0x506218=_0x38801e['query'][_0xdf29('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0xdf29('0xd')]['noop'](util[_0xdf29('0x27')]('query:\x20%s',_0x506218));var _0x5d17fb=this['getQueryOdbc'][_0xdf29('0xa0')](this,_0x2b3534,_0x506218);this[_0xdf29('0x37')]['sync'](this,_0x38801e,_0x506218);if(!this['isConfigured'](_0x38801e['variable_id'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xd2'));}var _0x5c0529=this[_0xdf29('0xf')][_0xdf29('0xa0')](this,_0x38801e[_0xdf29('0xd3')]);if(!_0x5c0529){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x38801e,'no\x20variable\x20found');}var _0x1b048c=this;_0x5d17fb['forEach'](function(_0x37e797,_0x13e409){Object[_0xdf29('0xd4')](_0x37e797)[_0xdf29('0xd5')](function(_0x5f55e6){_0x1b048c[_0xdf29('0xd')]['setVariable'](util[_0xdf29('0x27')](_0xdf29('0xd6'),_0x5c0529,_0x13e409,_0x5f55e6),_0x37e797[_0x5f55e6]);});});this['channel'][_0xdf29('0x9a')](util[_0xdf29('0x27')](_0xdf29('0xd7'),_0x5c0529),_0x5d17fb[_0xdf29('0x96')]);return this['channel']['noop'](util['format'](_0xdf29('0xd8'),_0x5c0529));};AGIVertices[_0xdf29('0xe')][_0xdf29('0xd9')]=function(_0x50006d){logger[_0xdf29('0xda')](util[_0xdf29('0x27')](_0xdf29('0xdb'),_0x50006d[_0xdf29('0xaa')]));if(!this['isConfigured'](_0x50006d[_0xdf29('0xdc')])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x50006d,'no\x20user\x20selected');}var _0x150de5=this[_0xdf29('0x1a')][_0xdf29('0xa0')](this,_0x50006d[_0xdf29('0xdc')]);if(!_0x150de5){return this['channel'][_0xdf29('0x2b')](_0x50006d,_0xdf29('0xdd'));}var _0x40b6c2=this[_0xdf29('0xd')][_0xdf29('0xa6')](_0xdf29('0xde'),[util[_0xdf29('0x27')]('SIP/%s',_0x150de5),_0x50006d['timeout'],_0x50006d['opts'],_0x50006d[_0xdf29('0x6d')]]);if(_0x40b6c2[_0xdf29('0x9e')]===-0x1){return _0x40b6c2;}return this['channel'][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0xdf'),_0xdf29('0xde')));};AGIVertices[_0xdf29('0xe')][_0xdf29('0xe0')]=function(_0x2c89d8){logger['info'](util[_0xdf29('0x27')](_0xdf29('0xe1'),_0x2c89d8[_0xdf29('0xaa')]));if(!this['isConfigured'](_0x2c89d8['key'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')]('no\x20key\x20configured');}if(!this[_0xdf29('0x83')](_0x2c89d8[_0xdf29('0x5a')])){return this[_0xdf29('0xd')]['noop'](_0xdf29('0xa5'));}this[_0xdf29('0xd')][_0xdf29('0xe2')]=!![];this[_0xdf29('0x37')](_0x2c89d8);this['createSquareMessage'](_0x2c89d8[_0xdf29('0x5a')],'in','','');this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0xe3'),_0x2c89d8[_0xdf29('0x5a')]));var _0x2e3a6c=this[_0xdf29('0x76')]['sync'](this,_0x2c89d8);if(_0x2e3a6c){for(var _0x1a2311 in _0x2e3a6c){if(_0x2e3a6c[_0xdf29('0x90')](_0x1a2311)){this['channel'][_0xdf29('0x9a')](util['format']('DIALOGFLOW_%s',_0x1a2311[_0xdf29('0x66')]()),_0x2e3a6c[_0x1a2311]);}}this[_0xdf29('0x40')](_0x2e3a6c[_0xdf29('0xe4')],_0xdf29('0xe5'),_0xdf29('0xe0'),'');return this['channel'][_0xdf29('0xa4')](util[_0xdf29('0x27')]('Dialogflow\x20Result\x20%s',_0x2e3a6c[_0xdf29('0xe4')]));}return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x2c89d8,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0xdf29('0xe6')]=function(_0x5a00ce){logger['info'](util['format'](_0xdf29('0xe7'),_0x5a00ce['label']));if(!this[_0xdf29('0x83')](_0x5a00ce[_0xdf29('0x7a')])){return this['channel'][_0xdf29('0xa4')]('no\x20project_id\x20configured');}if(!this[_0xdf29('0x83')](_0x5a00ce[_0xdf29('0x7b')])){return this['channel']['noop'](_0xdf29('0xe8'));}if(!this[_0xdf29('0x83')](_0x5a00ce['private_key'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xe9'));}if(!this['isConfigured'](_0x5a00ce['dialogflowV2_language'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')]('no\x20anguage\x20configured');}if(!this[_0xdf29('0x83')](_0x5a00ce['text'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')]('no\x20text\x20configured');}this[_0xdf29('0xd')][_0xdf29('0xe2')]=!![];this[_0xdf29('0x37')](_0x5a00ce);this[_0xdf29('0x40')](_0x5a00ce[_0xdf29('0x5a')],'in','','');this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0xea'),_0x5a00ce[_0xdf29('0x5a')]));var _0x2e900b=this[_0xdf29('0x79')][_0xdf29('0xa0')](this,_0x5a00ce);if(_0x2e900b){for(var _0x242e77 in _0x2e900b){if(_0x2e900b[_0xdf29('0x90')](_0x242e77)){if(_0x242e77!=='providerResponse'){this[_0xdf29('0xd')]['setVariable'](util[_0xdf29('0x27')]('DIALOGFLOW_%s',_0x242e77[_0xdf29('0x66')]()),_0x2e900b[_0x242e77]);}}}this[_0xdf29('0x40')](_0x2e900b[_0xdf29('0xe4')],_0xdf29('0xe5'),_0xdf29('0xe6'),_0x2e900b[_0xdf29('0xeb')]);return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0xec'),_0x2e900b[_0xdf29('0xe4')]));}return this['channel'][_0xdf29('0x2b')](_0x5a00ce,_0xdf29('0xed'));};AGIVertices[_0xdf29('0xe')][_0xdf29('0xee')]=function(_0x484d58){logger[_0xdf29('0x2d')](util['format'](_0xdf29('0xef'),_0x484d58[_0xdf29('0xaa')]));if(!this['isConfigured'](_0x484d58[_0xdf29('0xf0')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xf1'));}if(!this[_0xdf29('0x83')](_0x484d58[_0xdf29('0xf2')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xf3'));}if(!this[_0xdf29('0x83')](_0x484d58[_0xdf29('0xf4')])){return this['channel'][_0xdf29('0xa4')](_0xdf29('0xf5'));}if(!this[_0xdf29('0x83')](_0x484d58[_0xdf29('0xf6')])){return this[_0xdf29('0xd')]['noop']('no\x20text\x20configured');}this[_0xdf29('0xd')]['bot']=!![];this[_0xdf29('0x37')](_0x484d58);this[_0xdf29('0x40')](_0x484d58['text'],'in','','');this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0xf7'),_0x484d58[_0xdf29('0x5a')]));var _0x272a51=this[_0xdf29('0x7d')][_0xdf29('0xa0')](this,_0x484d58);if(_0x272a51){for(var _0x23f056 in _0x272a51){if(_0x272a51[_0xdf29('0x90')](_0x23f056)){this[_0xdf29('0xd')][_0xdf29('0x9a')](util[_0xdf29('0x27')]('SESTEK_NDA_%s',_0x23f056[_0xdf29('0x66')]()),_0x272a51[_0x23f056]);}}this[_0xdf29('0x40')](_0x272a51[_0xdf29('0xe4')],_0xdf29('0xe5'),_0xdf29('0xee'),'');if(_0x272a51[_0xdf29('0xf8')]){this['channel']['noop'](util[_0xdf29('0x27')](_0xdf29('0xf9'),_0x272a51[_0xdf29('0xf8')]));var _0x3cdbcf=this[_0xdf29('0xd')]['streamFile'](_0x272a51['audiofile']);try{fs[_0xdf29('0xfa')](_0x272a51[_0xdf29('0xf8')]+'.wav');}catch(_0x48e03d){logger[_0xdf29('0x2b')](_0x48e03d);}return _0x3cdbcf;}else{return this[_0xdf29('0xd')]['noop'](util['format'](_0xdf29('0xfb'),_0x272a51[_0xdf29('0xe4')]));}}return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x484d58,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xdf29('0xe')][_0xdf29('0xfc')]=function(_0x3042ef){logger[_0xdf29('0x2d')](util['format'](_0xdf29('0xfd'),_0x3042ef[_0xdf29('0xaa')]));return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xfc'));};AGIVertices[_0xdf29('0xe')]['ext_dial']=function(_0x5f361e){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0xfe'),_0x5f361e[_0xdf29('0xaa')]));var _0x525c99='';if(_0x5f361e[_0xdf29('0xff')]){if(!this[_0xdf29('0x83')](_0x5f361e[_0xdf29('0xff')])){return this['channel'][_0xdf29('0x2b')](_0x5f361e,'no\x20trunk\x20selected');}else{var _0x4e5af1=parseInt(_0x5f361e[_0xdf29('0xff')],0xa);if(isNaN(_0x4e5af1)){_0x525c99=_0x5f361e[_0xdf29('0xff')];}else{_0x525c99=this['getTrunk'][_0xdf29('0xa0')](this,_0x5f361e[_0xdf29('0xff')]);if(!_0x525c99){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x5f361e,_0xdf29('0x100'));}}}}else if(_0x5f361e[_0xdf29('0x101')]){_0x525c99=_0x5f361e['trunk_name'];}else{return this['channel']['error'](_0x5f361e,_0xdf29('0x102'));}var _0x494a0d=this['channel'][_0xdf29('0xa6')](_0xdf29('0xde'),[util['format']('SIP/%s/%s',_0x525c99,_0x5f361e[_0xdf29('0x46')]),_0x5f361e['timeout'],_0x5f361e['opts'],_0x5f361e['url']]);if(_0x494a0d[_0xdf29('0x9e')]===-0x1){return _0x494a0d;}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util['format'](_0xdf29('0xdf'),_0xdf29('0xde')));};AGIVertices[_0xdf29('0xe')][_0xdf29('0x103')]=function(_0x11730b){logger[_0xdf29('0x2d')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x11730b[_0xdf29('0xaa')]));return this['channel']['noop'](_0xdf29('0x103'));};AGIVertices['prototype'][_0xdf29('0xc')]=function(_0x525148){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x104'),_0x525148[_0xdf29('0xaa')]));if(_0x525148['retry']===0x0){return this[_0xdf29('0x9f')](_0x525148);}_0x525148[_0xdf29('0xa1')]-=0x1;if(!this['isConfigured'](_0x525148[_0xdf29('0x105')])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x525148,_0xdf29('0x106'));}var _0x4796a2=this[_0xdf29('0x1c')][_0xdf29('0xa0')](this,_0x525148[_0xdf29('0x105')]);if(!_0x4796a2){return this[_0xdf29('0xd')]['error'](_0x525148,_0xdf29('0x107'));}if(!this[_0xdf29('0x83')](_0x525148[_0xdf29('0xd3')])){return this['channel'][_0xdf29('0x2b')](_0xdf29('0xd2'));}var _0x38718e=this[_0xdf29('0xd')][_0xdf29('0x108')](_0x4796a2,_0x525148[_0xdf29('0x109')],_0x525148['maxdigit']);var _0x18a5a7=_0x38718e[_0xdf29('0x9e')]?_0x38718e[_0xdf29('0x9e')][_0xdf29('0x4b')]():'';logger[_0xdf29('0x2d')](_0xdf29('0x10a'),JSON[_0xdf29('0x6e')](_0x38718e));if(_0x38718e['result']===-0x1){this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x525148,_0x18a5a7);return _0x38718e;}else if(_0x38718e[_0xdf29('0x9c')]===_0xdf29('0x63')){_0x38718e['result']=_0x18a5a7[_0xdf29('0x96')]>=parseInt(_0x525148['mindigit'])?'x':'i';}else{_0x38718e['result']=_0x18a5a7[_0xdf29('0x96')]>=parseInt(_0x525148[_0xdf29('0x10b')])&&_0x18a5a7[_0xdf29('0x96')]<=parseInt(_0x525148[_0xdf29('0x10c')])?'x':'i';}var _0x26203f=this[_0xdf29('0xf')][_0xdf29('0xa0')](this,_0x525148[_0xdf29('0xd3')]);if(!_0x26203f){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x525148,_0xdf29('0x10d'));}this['channel'][_0xdf29('0x9a')](_0x26203f,_0x18a5a7);if(this[_0xdf29('0x83')](_0x525148['hiddendigitsnum'])){var _0x5d398f=parseInt(_0x525148[_0xdf29('0x10e')],0xa);var _0x2c6fc1=rs[_0xdf29('0x10f')]({'charset':'*','length':_0x5d398f});var _0x327ca8=_0x18a5a7[_0xdf29('0x96')];if(_0x327ca8>0x0){if(_0x327ca8>_0x5d398f){this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x525148,_0x525148[_0xdf29('0x110')]==='first'?_0x2c6fc1+_0x18a5a7[_0xdf29('0x111')](_0x5d398f):_0x18a5a7['substr'](0x0,_0x327ca8-_0x5d398f)+_0x2c6fc1);}else{this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x525148,rs[_0xdf29('0x10f')]({'charset':'*','length':_0x327ca8}));}}else{this['createSquareDetailsReport'][_0xdf29('0xa0')](this,_0x525148,'');}}else{this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x525148,_0x18a5a7);}return _0x38718e;};AGIVertices['prototype'][_0xdf29('0x112')]=function(_0x31c1ad){logger['info'](util['format'](_0xdf29('0x113'),_0x31c1ad[_0xdf29('0xaa')]));return this['getdigits'](_0x31c1ad);};AGIVertices[_0xdf29('0xe')]['goal']=function(_0x1977b1){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x114'),_0x1977b1[_0xdf29('0xaa')]));this['createSquareDetailsReport'][_0xdf29('0xa0')](this,_0x1977b1,_0x1977b1[_0xdf29('0x115')]);return this[_0xdf29('0xd')]['noop'](util[_0xdf29('0x27')](_0xdf29('0x116'),_0x1977b1['goalname']));};AGIVertices['prototype'][_0xdf29('0x117')]=function(_0x465f48){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x465f48[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x465f48['aws_access_key_id'])||!this[_0xdf29('0x83')](_0x465f48[_0xdf29('0x87')])){return this[_0xdf29('0xd')]['noop'](_0xdf29('0x118'));}if(!this[_0xdf29('0x83')](_0x465f48['text'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xa5'));}this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x119'),_0x465f48[_0xdf29('0x5a')]));var _0x3ff611=this[_0xdf29('0x85')][_0xdf29('0xa0')](this,_0x465f48);if(_0x3ff611){this[_0xdf29('0xd')][_0xdf29('0xa4')](util['format'](_0xdf29('0x11a'),_0x3ff611));var _0xe399e7=this[_0xdf29('0xd')][_0xdf29('0x11b')](_0x3ff611);try{fs['unlink'](_0x3ff611+_0xdf29('0x11c'));}catch(_0x1f4798){logger[_0xdf29('0x2b')](_0x1f4798);}return _0xe399e7;}return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x465f48,_0xdf29('0x11d'));};AGIVertices[_0xdf29('0xe')][_0xdf29('0x11e')]=function(_0xbddcea){logger[_0xdf29('0x2d')](util['format'](_0xdf29('0x11f'),_0xbddcea[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0xbddcea['aws_access_key_id'])||!this[_0xdf29('0x83')](_0xbddcea[_0xdf29('0x87')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x118'));}if(!this[_0xdf29('0x83')](_0xbddcea[_0xdf29('0x120')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x121'));}if(!this[_0xdf29('0x83')](_0xbddcea['text'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xa5'));}this[_0xdf29('0xd')][_0xdf29('0xe2')]=!![];this[_0xdf29('0x37')](_0xbddcea);this['createSquareMessage'](_0xbddcea[_0xdf29('0x5a')],'in','','');this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x122'),_0xbddcea[_0xdf29('0x5a')]));var _0x1c5c54=this['awsLex']['sync'](this,_0xbddcea);if(_0x1c5c54){for(var _0x1b872a in _0x1c5c54){if(_0x1c5c54[_0xdf29('0x90')](_0x1b872a)&&_['isString'](_0x1c5c54[_0x1b872a])){this['channel'][_0xdf29('0x9a')](util[_0xdf29('0x27')](_0xdf29('0x123'),_0x1b872a[_0xdf29('0x66')]()),_0x1c5c54[_0x1b872a]);}}if(_[_0xdf29('0x42')](_0x1c5c54[_0xdf29('0x74')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x124'));}else{this[_0xdf29('0x40')](_0x1c5c54[_0xdf29('0x74')],_0xdf29('0xe5'),'amazonlex','');return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x125'),_0x1c5c54[_0xdf29('0x74')]));}}return this['channel']['error'](_0xbddcea,_0xdf29('0x126'));};AGIVertices[_0xdf29('0xe')][_0xdf29('0x127')]=function(_0x2a5847){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x128'),_0x2a5847['label'],_0x2a5847[_0xdf29('0x63')]));if(!this[_0xdf29('0x83')](_0x2a5847[_0xdf29('0x77')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x129'));}var _0x3728b7=_0xdf29('0x12a');var _0x94b5c3=util[_0xdf29('0x27')](_0xdf29('0x12b'),FILES_PATH,rs[_0xdf29('0x10f')](0x4));var _0x279ec3=util[_0xdf29('0x27')](_0xdf29('0x98'),_0x94b5c3,_0x3728b7);var _0x1a5517=!![];if(_0x2a5847[_0xdf29('0x12c')]==='NOBEEP'){_0x1a5517=![];}var _0x1b9fe4=this[_0xdf29('0xd')][_0xdf29('0x12d')](_0x94b5c3,_0x3728b7,_0x2a5847[_0xdf29('0x12e')],_0x2a5847['timeout'],undefined,_0x1a5517);if(_0x1b9fe4[_0xdf29('0x9e')]!==-0x1){this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x12f'),_0x279ec3));var _0x362862=this['googleASR'][_0xdf29('0xa0')](this,_0x2a5847,_0x279ec3);if(_0x362862){for(var _0xcc0eb8 in _0x362862){if(_0x362862[_0xdf29('0x90')](_0xcc0eb8)){this[_0xdf29('0xd')]['setVariable'](util['format'](_0xdf29('0x130'),_0xcc0eb8[_0xdf29('0x66')]()),_0x362862[_0xcc0eb8]);}}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x131'),JSON[_0xdf29('0x6e')](_0x362862)));}}return _0x1b9fe4;};AGIVertices[_0xdf29('0xe')][_0xdf29('0x132')]=function(_0xcd67b6){logger['info'](util[_0xdf29('0x27')](_0xdf29('0x133'),_0xcd67b6[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0xcd67b6['appid'])){return this[_0xdf29('0xd')]['noop'](_0xdf29('0x134'));}if(!this[_0xdf29('0x83')](_0xcd67b6['appsecret'])){return this['channel']['noop'](_0xdf29('0x135'));}var _0x45dc54=_0xdf29('0x12a');var _0x22ec48=util['format'](_0xdf29('0x12b'),FILES_PATH,rs[_0xdf29('0x10f')](0x4));var _0x38f6a3=util[_0xdf29('0x27')](_0xdf29('0x98'),_0x22ec48,_0x45dc54);var _0x560488=!![];if(_0xcd67b6[_0xdf29('0x12c')]===_0xdf29('0x136')){_0x560488=![];}var _0x4a0972=this[_0xdf29('0xd')][_0xdf29('0x12d')](_0x22ec48,_0x45dc54,_0xcd67b6[_0xdf29('0x12e')],_0xcd67b6[_0xdf29('0x63')],undefined,_0x560488);if(_0x4a0972['result']!==-0x1){this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')]('tilde\x20%s\x20file\x20created',_0x38f6a3));var _0x4d734e=this[_0xdf29('0x8c')][_0xdf29('0xa0')](this,_0xcd67b6,_0x38f6a3);if(_0x4d734e){for(var _0x5ad7b8 in _0x4d734e){if(_0x4d734e['hasOwnProperty'](_0x5ad7b8)){this[_0xdf29('0xd')][_0xdf29('0x9a')](util[_0xdf29('0x27')]('TILDE_ASR_%s',_0x5ad7b8[_0xdf29('0x66')]()),_0x4d734e[_0x5ad7b8]);}}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x137'),JSON[_0xdf29('0x6e')](_0x4d734e)));}}return _0x4a0972;};AGIVertices[_0xdf29('0xe')][_0xdf29('0x138')]=function(_0x43b638){logger[_0xdf29('0x2d')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x43b638[_0xdf29('0xaa')]));return this[_0xdf29('0xd')][_0xdf29('0x139')](_0x43b638[_0xdf29('0x13a')],_0x43b638[_0xdf29('0x3d')],_0x43b638[_0xdf29('0x13b')]);};AGIVertices[_0xdf29('0xe')]['gotoif']=function(_0x298a7d){logger['info'](util[_0xdf29('0x27')](_0xdf29('0x13c'),_0x298a7d[_0xdf29('0xaa')]));if(!this['isConfigured'](_0x298a7d[_0xdf29('0x13d')])){return this['channel'][_0xdf29('0x2b')](_0x298a7d,'no\x20condition\x20configured');}try{var _0x546d1c=eval(_0x298a7d[_0xdf29('0x13d')])?_0xdf29('0x13e'):_0xdf29('0x13f');this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')]('EVAL\x20CONDITION\x20%s\x20%s',_0x298a7d['condition'],_0x546d1c));return{'code':0xc8,'result':_0x546d1c};}catch(_0x565526){return{'code':0xc8,'result':_0xdf29('0x13f')};}};AGIVertices[_0xdf29('0xe')][_0xdf29('0x140')]=function(_0x7e825e){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x141'),_0x7e825e[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x7e825e['interval_id'])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x7e825e,_0xdf29('0x142'));}var _0x20da78=this[_0xdf29('0x22')][_0xdf29('0xa0')](this,_0x7e825e[_0xdf29('0x143')]);if(!_0x20da78){return this[_0xdf29('0xd')]['error'](_0x7e825e,_0xdf29('0x144'));}for(var _0x45c54b=0x0;_0x45c54b<_0x20da78[_0xdf29('0x96')];_0x45c54b+=0x1){var _0xf5f9dd=this[_0xdf29('0xd')][_0xdf29('0xf')](util[_0xdf29('0x27')](_0xdf29('0x145'),_0x20da78[_0x45c54b]));if(_0xf5f9dd['result']===-0x1){return _0xf5f9dd;}logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x146'),_0x20da78[_0x45c54b],_0xf5f9dd['extra']));if(_0xf5f9dd['extra']===_0xdf29('0x13e')){logger['info'](util[_0xdf29('0x27')]('IFTIME\x20%s\x20%s',_0x20da78[_0x45c54b],_0xdf29('0x13e')));this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')]('IFTIME\x20%s\x20%s',_0x20da78[_0x45c54b],_0xdf29('0x13e')));return{'code':0xc8,'result':_0xdf29('0x13e')};}else{logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x146'),_0x20da78[_0x45c54b],_0xdf29('0x13f')));this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x146'),_0x20da78[_0x45c54b],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xdf29('0xe')][_0xdf29('0x147')]=function(_0x3d5ce0){logger['info'](util[_0xdf29('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3d5ce0['label']));return this[_0xdf29('0xd')][_0xdf29('0x147')]();};AGIVertices[_0xdf29('0xe')][_0xdf29('0x148')]=function(_0x27511a){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x149'),_0x27511a[_0xdf29('0xaa')]));if(!this['isConfigured'](_0x27511a['key'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x129'));}var _0x70143=_0xdf29('0x12a');var _0x246aec=util[_0xdf29('0x27')](_0xdf29('0x12b'),FILES_PATH,rs[_0xdf29('0x10f')](0x4));var _0x552a09=util[_0xdf29('0x27')](_0xdf29('0x98'),_0x246aec,_0x70143);var _0x882cfb=!![];if(_0x27511a[_0xdf29('0x12c')]===_0xdf29('0x136')){_0x882cfb=![];}var _0x311618=this[_0xdf29('0xd')]['recordFile'](_0x246aec,_0x70143,_0x27511a[_0xdf29('0x12e')],_0x27511a[_0xdf29('0x63')],undefined,_0x882cfb);if(_0x311618[_0xdf29('0x9e')]!==-0x1){this[_0xdf29('0xd')]['noop'](util[_0xdf29('0x27')]('ispeech\x20%s\x20file\x20created',_0x552a09));var _0x204236=this[_0xdf29('0x81')][_0xdf29('0xa0')](this,_0x27511a,_0x552a09);if(_0x204236){for(var _0x2018dd in _0x204236){if(_0x204236[_0xdf29('0x90')](_0x2018dd)){this[_0xdf29('0xd')]['setVariable'](util[_0xdf29('0x27')](_0xdf29('0x14a'),_0x2018dd[_0xdf29('0x66')]()),_0x204236[_0x2018dd]);}}return this[_0xdf29('0xd')]['noop'](util[_0xdf29('0x27')]('IspeechASR\x20Result\x20%s',JSON[_0xdf29('0x6e')](_0x204236)));}}return _0x311618;};AGIVertices[_0xdf29('0xe')]['ispeechtts']=function(_0x534e1e){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x14b'),_0x534e1e['label']));if(!this[_0xdf29('0x83')](_0x534e1e[_0xdf29('0x77')])){return this['channel'][_0xdf29('0xa4')](_0xdf29('0x129'));}if(!this[_0xdf29('0x83')](_0x534e1e[_0xdf29('0x5a')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')]('no\x20text\x20configured');}this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x14c'),_0x534e1e[_0xdf29('0x5a')]));var _0x496321=this[_0xdf29('0x7e')][_0xdf29('0xa0')](this,_0x534e1e);if(_0x496321){this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')]('ispeech\x20%s\x20file\x20created',_0x496321));var _0x4c8961=this[_0xdf29('0xd')][_0xdf29('0x11b')](_0x496321,_0x534e1e[_0xdf29('0x12e')]);try{fs[_0xdf29('0xfa')](_0x496321+_0xdf29('0x11c'));}catch(_0x540838){logger[_0xdf29('0x2b')](_0x540838);}return _0x4c8961;}return this[_0xdf29('0xd')]['error'](_0x534e1e,_0xdf29('0x14d'));};AGIVertices[_0xdf29('0xe')][_0xdf29('0x14e')]=function(_0x34ee1b){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x14f'),_0x34ee1b[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x34ee1b[_0xdf29('0x150')])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x34ee1b,_0xdf29('0x151'));}logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xdf29('0x3a')],_0x34ee1b[_0xdf29('0x150')]));var _0x59962f=this[_0xdf29('0x53')][_0xdf29('0xa0')](this,_0x34ee1b[_0xdf29('0x150')]);if(_0x59962f){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x152'),this['channel'][_0xdf29('0x3a')],_0x34ee1b['findBy']));this[_0xdf29('0xd')][_0xdf29('0xa4')](util['format'](_0xdf29('0x152'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x34ee1b['findBy']));return{'code':0xc8,'result':_0xdf29('0x153')};}else{logger['info'](util['format'](_0xdf29('0x154'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x34ee1b[_0xdf29('0x150')]));this['channel'][_0xdf29('0xa4')](util[_0xdf29('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x34ee1b[_0xdf29('0x150')]));return{'code':0xc8,'result':_0xdf29('0x155')};}};AGIVertices[_0xdf29('0xe')][_0xdf29('0x156')]=function(_0x4be024){logger['info'](util[_0xdf29('0x27')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4be024[_0xdf29('0xaa')]));if(!this['isConfigured'](_0x4be024['findBy'])){return this['channel'][_0xdf29('0x2b')](_0x4be024,_0xdf29('0x151'));}logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x157'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x4be024[_0xdf29('0x150')]));var _0x4dd885=this[_0xdf29('0x52')][_0xdf29('0xa0')](this,_0x4be024[_0xdf29('0x150')]);if(_0x4dd885){logger['info'](util[_0xdf29('0x27')](_0xdf29('0x152'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x4be024[_0xdf29('0x150')]));this[_0xdf29('0xd')]['noop'](util[_0xdf29('0x27')](_0xdf29('0x152'),this['channel'][_0xdf29('0x3a')],_0x4be024[_0xdf29('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xdf29('0x2d')](util['format'](_0xdf29('0x154'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x4be024[_0xdf29('0x150')]));this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x154'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x4be024['findBy']));return{'code':0xc8,'result':_0xdf29('0x155')};}};AGIVertices[_0xdf29('0xe')][_0xdf29('0x158')]=function(_0x2b078a){logger['info'](util[_0xdf29('0x27')](_0xdf29('0x159'),_0x2b078a['label']));if(!this[_0xdf29('0x83')](_0x2b078a[_0xdf29('0x15a')])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x2b078a,_0xdf29('0x15b'));}this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')]('math\x20%s',_0x2b078a['operation']));var _0xf96d19=eval(_0x2b078a[_0xdf29('0x15a')]);if(!this[_0xdf29('0x83')](_0x2b078a[_0xdf29('0xd3')])){return this[_0xdf29('0xd')]['noop'](_0xdf29('0xd2'));}var _0x21707d=this[_0xdf29('0xf')][_0xdf29('0xa0')](this,_0x2b078a[_0xdf29('0xd3')]);if(!_0x21707d){return this['channel'][_0xdf29('0x2b')](_0x2b078a,_0xdf29('0x10d'));}if(_[_0xdf29('0x99')](_0xf96d19)){var _0x363fbc=this;_0xf96d19[_0xdf29('0xd5')](function(_0x7e5061,_0x2ee8dc){_0x363fbc['channel'][_0xdf29('0x9a')](util[_0xdf29('0x27')](_0xdf29('0x15c'),_0x21707d,_0x2ee8dc),_0x7e5061);});return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x15d'),_0x21707d));}else{return this[_0xdf29('0xd')][_0xdf29('0x9a')](_0x21707d,_0xf96d19);}};AGIVertices[_0xdf29('0xe')]['menu']=function(_0x4ec52d){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x4ec52d[_0xdf29('0xaa')]));if(_0x4ec52d['retry']===0x0){return this[_0xdf29('0x9f')](_0x4ec52d);}_0x4ec52d[_0xdf29('0xa1')]-=0x1;if(!this[_0xdf29('0x83')](_0x4ec52d[_0xdf29('0x105')])){return this[_0xdf29('0xd')]['error'](_0x4ec52d,_0xdf29('0x106'));}var _0x551b49=this[_0xdf29('0x1c')][_0xdf29('0xa0')](this,_0x4ec52d[_0xdf29('0x105')]);if(!_0x551b49){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x4ec52d,'no\x20file\x20audio\x20found');}var _0x1247b3=this['channel'][_0xdf29('0x108')](_0x551b49,_0x4ec52d['response'],_0x4ec52d[_0xdf29('0x15e')]);var _0xe8258b=_0x1247b3[_0xdf29('0x9e')];if(_0x1247b3[_0xdf29('0x9e')]===-0x1){this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x4ec52d,'-1');return _0x1247b3;}else if(_0x1247b3[_0xdf29('0x9c')]===_0xdf29('0x63')){_0x1247b3[_0xdf29('0x9e')]=_0x1247b3[_0xdf29('0x9e')][_0xdf29('0x96')]>0x0?_0x1247b3['result']:'t';}else if(_[_0xdf29('0x44')](_0x1247b3[_0xdf29('0x9e')])){_0x1247b3[_0xdf29('0x9e')]='#';_0xe8258b='#';}if(!this[_0xdf29('0x83')](_0x4ec52d[_0xdf29('0xd3')])){this['channel'][_0xdf29('0xa4')](_0xdf29('0xd2'));}else{var _0x40b15d=this[_0xdf29('0xf')][_0xdf29('0xa0')](this,_0x4ec52d[_0xdf29('0xd3')]);if(!_0x40b15d){return this[_0xdf29('0xd')]['error'](_0x4ec52d,_0xdf29('0x10d'));}this[_0xdf29('0xd')][_0xdf29('0x9a')](_0x40b15d,_0xe8258b);}this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x4ec52d,_0xe8258b);return _0x1247b3;};AGIVertices[_0xdf29('0xe')][_0xdf29('0xa4')]=function(_0x5c8dc8){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x15f'),_0x5c8dc8[_0xdf29('0xaa')]));return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0x5c8dc8[_0xdf29('0x160')]||_0x5c8dc8['label']);};AGIVertices[_0xdf29('0xe')]['pause']=function(_0x2acac3){logger['info'](util[_0xdf29('0x27')](_0xdf29('0x161'),_0x2acac3[_0xdf29('0xaa')]));if(!this['isConfigured'](_0x2acac3['findBy'])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x2acac3,_0xdf29('0x151'));}logger['info'](util[_0xdf29('0x27')](_0xdf29('0x157'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x2acac3['findBy']));var _0x1f5fb6=this[_0xdf29('0x4d')][_0xdf29('0xa0')](this,_0x2acac3[_0xdf29('0x162')]);var _0x563e1a=this[_0xdf29('0x4f')][_0xdf29('0xa0')](this,_0x2acac3['findBy'],_0x1f5fb6);if(_0x563e1a){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x152'),this['channel'][_0xdf29('0x3a')],_0x2acac3['findBy']));this['channel'][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x152'),this['channel'][_0xdf29('0x3a')],_0x2acac3[_0xdf29('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x154'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x2acac3[_0xdf29('0x150')]));this['channel']['noop'](util['format'](_0xdf29('0x152'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0x2acac3['findBy']));return{'code':0xc8,'result':_0xdf29('0x155')};}};AGIVertices[_0xdf29('0xe')][_0xdf29('0x163')]=function(_0x2a182c){logger['info'](util[_0xdf29('0x27')](_0xdf29('0x164'),_0x2a182c[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x2a182c['file_id'])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x2a182c,_0xdf29('0x106'));}var _0x30bb37=this[_0xdf29('0x1c')]['sync'](this,_0x2a182c[_0xdf29('0x105')]);if(!_0x30bb37){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x2a182c,_0xdf29('0x107'));}var _0x245c60=this[_0xdf29('0xd')][_0xdf29('0xa6')](_0xdf29('0x165'),[_0x30bb37,_0x2a182c[_0xdf29('0x166')]]);if(_0x245c60[_0xdf29('0x9e')]===-0x1){return _0x245c60;}return this['channel']['noop'](util[_0xdf29('0x27')](_0xdf29('0x167'),_0xdf29('0x165'),_0x30bb37));};AGIVertices[_0xdf29('0xe')][_0xdf29('0x168')]=function(_0x16b8e8){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x16b8e8[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x16b8e8[_0xdf29('0x169')])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x16b8e8,_0xdf29('0x16a'));}var _0x11aedc='';var _0xecb460=parseInt(_0x16b8e8['queue_id'],0xa);if(isNaN(_0xecb460)){_0x11aedc=_0x16b8e8[_0xdf29('0x169')];}else{_0x11aedc=this[_0xdf29('0x14')]['sync'](this,_0x16b8e8[_0xdf29('0x169')]);if(!_0x11aedc){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x16b8e8,_0xdf29('0x16b'));}}var _0x23b7e3='';if(this[_0xdf29('0x83')](_0x16b8e8[_0xdf29('0x105')])){var _0x1fef7c=this[_0xdf29('0x1c')][_0xdf29('0xa0')](this,_0x16b8e8['file_id']);if(_0x1fef7c){_0x23b7e3=_0x1fef7c;}}this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x16b8e8,_0x11aedc);if(_0x16b8e8['opts'][_0xdf29('0x16c')]('x')<0x0){_0x16b8e8[_0xdf29('0x166')]+='x';}if(_0x16b8e8['opts'][_0xdf29('0x16c')]('X')<0x0){_0x16b8e8[_0xdf29('0x166')]+='X';}this['channel'][_0xdf29('0x9a')]('XMCS-QUEUE',_0x11aedc?_0x11aedc[_0xdf29('0x16d')]():'');var _0x42876a=this[_0xdf29('0xd')][_0xdf29('0xa6')](_0xdf29('0x16e'),[_0x11aedc,_0x16b8e8[_0xdf29('0x166')],_0x16b8e8['url'],_0x23b7e3,_0x16b8e8['timeout'],_0x16b8e8[_0xdf29('0x16f')],_0x16b8e8['macro'],_0x16b8e8[_0xdf29('0x170')],'',_0x16b8e8[_0xdf29('0x171')]]);if(_0x42876a[_0xdf29('0x9e')]===-0x1){return _0x42876a;}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x167'),_0xdf29('0x16e'),_0x11aedc));};AGIVertices[_0xdf29('0xe')][_0xdf29('0x172')]=function(_0x39c33c){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x173'),_0x39c33c[_0xdf29('0xaa')]));var _0x4ded13=_0x39c33c[_0xdf29('0x174')]||_0xdf29('0x12a');var _0x771d18=util['format'](_0xdf29('0x175'),this[_0xdf29('0xd')][_0xdf29('0x38')],rs[_0xdf29('0x10f')](0x5));var _0x282de3=util['format'](_0xdf29('0x176'),FILES_PATH,_0x771d18,_0x4ded13);var _0x4f711=util[_0xdf29('0x27')]('%s/recordings/%s',FILES_PATH,_0x771d18);this[_0xdf29('0x3b')][_0xdf29('0xa0')](this,_0x39c33c,_0x771d18,_0x282de3);this[_0xdf29('0xd')][_0xdf29('0x9a')]('RECORDING_SAVENAME',_0x771d18);logger[_0xdf29('0x2d')](_0xdf29('0x177'),_0x4f711,_0x4ded13,_0x39c33c[_0xdf29('0x178')],_0x39c33c['timeout']);return this[_0xdf29('0xd')]['recordFile'](_0x4f711,_0x4ded13,_0x39c33c['escape_digits'],_0x39c33c[_0xdf29('0x63')],undefined,!![]);};AGIVertices[_0xdf29('0xe')][_0xdf29('0x179')]=function(_0x46ac28){logger[_0xdf29('0x2d')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x46ac28[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x46ac28['url'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x17a'));}var _0x19013c=this[_0xdf29('0x60')][_0xdf29('0xa0')](this,_0x46ac28);logger['info'](util['format'](_0xdf29('0x17b'),util['inspect'](_0x19013c,{'showHidden':![],'depth':null})));if(!this[_0xdf29('0x83')](_0x46ac28[_0xdf29('0xd3')])){return this[_0xdf29('0xd')]['noop'](_0xdf29('0x17c'));}var _0x34fa98=this['getVariable'][_0xdf29('0xa0')](this,_0x46ac28['variable_id']);if(!_0x34fa98){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x46ac28,'no\x20variable\x20found');}this[_0xdf29('0xd')][_0xdf29('0x9a')](util[_0xdf29('0x27')](_0xdf29('0x17d'),_0x34fa98),_0x19013c[_0xdf29('0x72')]?_0x19013c[_0xdf29('0x72')]:'200');this[_0xdf29('0xd')][_0xdf29('0x9a')](util[_0xdf29('0x27')](_0xdf29('0x17e'),_0x34fa98),_0x19013c[_0xdf29('0x73')]?_0x19013c[_0xdf29('0x73')]:'OK');if(_0x19013c[_0xdf29('0x70')]){try{this[_0xdf29('0x97')](_0x19013c['body'],_0x34fa98);}catch(_0x1d9f33){logger[_0xdf29('0x2b')](util[_0xdf29('0x27')](_0xdf29('0x17f'),_0x34fa98));}}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')]('variable\x20%s\x20set',_0x34fa98));};AGIVertices[_0xdf29('0xe')][_0xdf29('0x180')]=function(_0x521108){logger[_0xdf29('0x2d')](util['format'](_0xdf29('0x181'),_0x521108[_0xdf29('0xaa')]));return this[_0xdf29('0xd')][_0xdf29('0x182')](_0x521108[_0xdf29('0x183')]['replace'](/\s+/g,''),_0x521108[_0xdf29('0x178')]);};AGIVertices[_0xdf29('0xe')]['saynumber']=function(_0x390280){logger['info'](util[_0xdf29('0x27')](_0xdf29('0x184'),_0x390280['label']));return this[_0xdf29('0xd')]['sayNumber'](_0x390280[_0xdf29('0x62')][_0xdf29('0x57')](/\s+/g,''),_0x390280[_0xdf29('0x178')]);};AGIVertices[_0xdf29('0xe')][_0xdf29('0x185')]=function(_0x4138c8){logger[_0xdf29('0x2d')](util['format'](_0xdf29('0x186'),_0x4138c8[_0xdf29('0xaa')]));return this[_0xdf29('0xd')][_0xdf29('0x187')](_0x4138c8[_0xdf29('0x5a')],_0x4138c8['escape_digits']);};AGIVertices['prototype'][_0xdf29('0x188')]=function(_0x5c7dce){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x189'),_0x5c7dce[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x5c7dce[_0xdf29('0x18a')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')]('no\x20mail\x20account\x20configured');}var _0x4a58b3=this[_0xdf29('0x18b')][_0xdf29('0xa0')](this,_0x5c7dce[_0xdf29('0x18a')]);if(!_0x4a58b3||!_0x4a58b3[_0xdf29('0x18c')]){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x5c7dce,_0xdf29('0x18d'));}var _0x5f2b68={'from':util[_0xdf29('0x27')](_0xdf29('0x18e'),_0x4a58b3[_0xdf29('0x16')],_0x4a58b3[_0xdf29('0x18f')]||_0x4a58b3[_0xdf29('0x18c')][_0xdf29('0x190')]),'to':_0x5c7dce['to']||'','cc':_0x5c7dce['cc']||'','bcc':_0x5c7dce[_0xdf29('0x191')]||'','subject':_0x5c7dce['subject'],'html':_0x5c7dce[_0xdf29('0x5a')],'text':_0x5c7dce[_0xdf29('0x5a')]};var _0x38d768={'tls':{'rejectUnauthorized':![]}};if(_0x4a58b3[_0xdf29('0x18c')][_0xdf29('0x192')]){_0x38d768[_0xdf29('0x192')]=_0x4a58b3[_0xdf29('0x18c')]['service'];}else{_0x38d768[_0xdf29('0x193')]=_0x4a58b3[_0xdf29('0x18c')][_0xdf29('0x193')];_0x38d768['port']=_0x4a58b3[_0xdf29('0x18c')][_0xdf29('0x194')];_0x38d768[_0xdf29('0x195')]=_0x4a58b3['Smtp'][_0xdf29('0x195')];}if(_0x4a58b3[_0xdf29('0x18c')]['authentication']){_0x38d768[_0xdf29('0x196')]={'user':_0x4a58b3[_0xdf29('0x18c')][_0xdf29('0x190')],'pass':_0x4a58b3['Smtp']['pass']};}if(this[_0xdf29('0x83')](_0x5c7dce['template_id'])){}logger[_0xdf29('0xda')]('sendMail\x20message',JSON[_0xdf29('0x6e')](_0x5f2b68));this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x5c7dce,_0x5c7dce['account_id']);this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x4a58b3['name']));this['sendMailMessage'][_0xdf29('0xa0')](this,_0x38d768,_0x5f2b68);return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x197'));};AGIVertices[_0xdf29('0xe')]['sendFax']=function(_0x342b0a){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x198'),_0x342b0a[_0xdf29('0xaa')]));return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x199'));};AGIVertices['prototype'][_0xdf29('0x19a')]=function(_0x1608ef){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x1608ef[_0xdf29('0xaa')]));if(!this['isConfigured'](_0x1608ef[_0xdf29('0x19b')])){return this[_0xdf29('0xd')]['noop'](_0xdf29('0x19c'));}var _0x5ba89a=this[_0xdf29('0x34')][_0xdf29('0xa0')](this,_0x1608ef['sms_account_id']);if(!_0x5ba89a){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x1608ef,_0xdf29('0x19d'));}var _0x1dc547={'body':_0x1608ef['sms_text'],'phone':_0x1608ef['to']||'','SmsAccountId':_0x5ba89a['id']};logger['debug'](_0xdf29('0x19e'),JSON[_0xdf29('0x6e')](_0x1dc547));this['createSquareDetailsReport'][_0xdf29('0xa0')](this,_0x1608ef,_0x1608ef[_0xdf29('0x19b')]);this['channel']['noop'](util[_0xdf29('0x27')](_0xdf29('0x19f'),_0x5ba89a[_0xdf29('0x16')]));this[_0xdf29('0x36')][_0xdf29('0xa0')](this,_0x1dc547);return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x1a0'));};AGIVertices[_0xdf29('0xe')]['set']=function(_0x150799){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x150799[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x150799[_0xdf29('0xd3')])){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x150799,_0xdf29('0x1a1'));}var _0x48cec1=this['getVariable'][_0xdf29('0xa0')](this,_0x150799['variable_id']);if(!_0x48cec1){return this['channel'][_0xdf29('0x2b')](_0x150799,_0xdf29('0x10d'));}return this[_0xdf29('0xd')][_0xdf29('0x9a')](_0x48cec1,_0x150799[_0xdf29('0x1a2')]);};AGIVertices[_0xdf29('0xe')][_0xdf29('0x1a3')]=function(_0xf27c53){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x1a4'),_0xf27c53[_0xdf29('0xaa')]));this['channel']['noop']('START\x20CALLY\x20SQUARE');if(_0xf27c53[_0xdf29('0xb6')]==='yes'){this['channel']['noop'](_0xdf29('0x1a5'));return this[_0xdf29('0xd')]['answer']();}return this['channel'][_0xdf29('0xa4')]('Skipped\x20Answer');};AGIVertices[_0xdf29('0xe')][_0xdf29('0x1a6')]=function(_0x5ae497){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x1a7'),_0x5ae497['label']));if(!this['isConfigured'](_0x5ae497[_0xdf29('0x1a8')])){return this['channel']['error'](_0x5ae497,_0xdf29('0x1a9'));}var _0x245910=this[_0xdf29('0x1aa')][_0xdf29('0xa0')](this,_0x5ae497[_0xdf29('0x1a8')]);if(!this[_0xdf29('0x83')](_0x245910)){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x5ae497,util[_0xdf29('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5ae497[_0xdf29('0x1a8')]));}if(_0x245910===this['channel']['arg_1']){return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x5ae497,_0xdf29('0x1ab'));}this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x5ae497,_0x245910);var _0x39ae8c=this[_0xdf29('0xd')][_0xdf29('0xa6')]('AGI',util[_0xdf29('0x27')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi']['host']||'127.0.0.1',_0x245910,this[_0xdf29('0xd')][_0xdf29('0x1ac')]));if(_0x39ae8c[_0xdf29('0x9e')]===-0x1){return _0x39ae8c;}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util['format'](_0xdf29('0x167'),_0xdf29('0x1ad'),_0x245910));};AGIVertices['prototype'][_0xdf29('0x1ae')]=function(_0x2e8308){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x1af'),_0x2e8308[_0xdf29('0xaa')]));var _0x4fcdb1=this[_0xdf29('0x55')]['sync'](this,_0x2e8308[_0xdf29('0xb4')]);this[_0xdf29('0x37')][_0xdf29('0xa0')](this,_0x2e8308,_0x2e8308['command']);if(this[_0xdf29('0x83')](_0x2e8308[_0xdf29('0xd3')])){var _0x22a762=this['getVariable'][_0xdf29('0xa0')](this,_0x2e8308[_0xdf29('0xd3')]);if(_0x22a762){this[_0xdf29('0xd')]['setVariable'](_0x22a762,_0x4fcdb1);return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x1b0'),_0x2e8308[_0xdf29('0xb4')],_0x22a762));}}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x1b1'),_0x2e8308[_0xdf29('0xb4')]));};AGIVertices[_0xdf29('0xe')][_0xdf29('0x1b2')]=function(_0x40a9aa){logger[_0xdf29('0x2d')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x40a9aa['label']));_0x40a9aa[_0xdf29('0x5a')]=_0x40a9aa['text'][_0xdf29('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xdf29('0x83')](_0x40a9aa[_0xdf29('0x1b3')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0x1b4'));}if(!this[_0xdf29('0x83')](_0x40a9aa['text'])){return this[_0xdf29('0xd')][_0xdf29('0xa4')]('no\x20text\x20configured');}this['channel']['noop'](util[_0xdf29('0x27')](_0xdf29('0x1b5'),_0x40a9aa[_0xdf29('0x5a')]));var _0x3e9696=this[_0xdf29('0x58')][_0xdf29('0xa0')](this,_0x40a9aa);if(_0x3e9696){this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3e9696));var _0x353a98=this[_0xdf29('0xd')][_0xdf29('0x11b')](_0x3e9696);try{fs[_0xdf29('0xfa')](_0x3e9696+_0xdf29('0x11c'));}catch(_0x453512){logger[_0xdf29('0x2b')](_0x453512);}return _0x353a98;}return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x40a9aa,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xdf29('0xe')][_0xdf29('0x1b6')]=function(_0x249820){logger['info'](util[_0xdf29('0x27')](_0xdf29('0x1b7'),_0x249820[_0xdf29('0xaa')]));_0x249820[_0xdf29('0x5a')]=_0x249820[_0xdf29('0x5a')][_0xdf29('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xdf29('0x83')](_0x249820[_0xdf29('0x5a')])){return this[_0xdf29('0xd')][_0xdf29('0xa4')](_0xdf29('0xa5'));}this[_0xdf29('0xd')]['noop'](util[_0xdf29('0x27')](_0xdf29('0x1b8'),_0x249820[_0xdf29('0x5a')]));var _0x43b9d5=this[_0xdf29('0x5f')][_0xdf29('0xa0')](this,_0x249820);if(_0x43b9d5){this[_0xdf29('0xd')][_0xdf29('0xa4')](util['format'](_0xdf29('0x1b9'),_0x43b9d5));var _0x1e1cf4=this[_0xdf29('0xd')][_0xdf29('0x11b')](_0x43b9d5);try{fs[_0xdf29('0xfa')](_0x43b9d5+_0xdf29('0x11c'));}catch(_0x9def61){logger['error'](_0x9def61);}return _0x1e1cf4;}return this[_0xdf29('0xd')][_0xdf29('0x2b')](_0x249820,_0xdf29('0x1ba'));};AGIVertices[_0xdf29('0xe')][_0xdf29('0x1bb')]=function(_0xffd508){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x1bc'),_0xffd508[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0xffd508[_0xdf29('0x150')])){return this[_0xdf29('0xd')]['error'](_0xffd508,_0xdf29('0x151'));}logger['info'](util[_0xdf29('0x27')](_0xdf29('0x157'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0xffd508[_0xdf29('0x150')]));var _0x42b12a=this['agentUnpause']['sync'](this,_0xffd508['findBy']);if(_0x42b12a){logger[_0xdf29('0x2d')](util['format'](_0xdf29('0x152'),this[_0xdf29('0xd')]['callerid'],_0xffd508[_0xdf29('0x150')]));this['channel'][_0xdf29('0xa4')](util[_0xdf29('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xdf29('0xd')]['callerid'],_0xffd508['findBy']));return{'code':0xc8,'result':_0xdf29('0x153')};}else{logger['info'](util[_0xdf29('0x27')](_0xdf29('0x154'),this[_0xdf29('0xd')][_0xdf29('0x3a')],_0xffd508[_0xdf29('0x150')]));this['channel'][_0xdf29('0xa4')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdf29('0xd')][_0xdf29('0x3a')],_0xffd508[_0xdf29('0x150')]));return{'code':0xc8,'result':_0xdf29('0x155')};}};AGIVertices[_0xdf29('0xe')][_0xdf29('0x1bd')]=function(_0x251bfa){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')](_0xdf29('0x1be'),_0x251bfa[_0xdf29('0xaa')]));var _0x16fdd0=this['channel'][_0xdf29('0xa6')]('VOICEMAIL',[_0x251bfa['mailbox'],_0x251bfa[_0xdf29('0x75')]]);if(_0x16fdd0[_0xdf29('0x9e')]===-0x1){return _0x16fdd0;}return this[_0xdf29('0xd')][_0xdf29('0xa4')](util[_0xdf29('0x27')](_0xdf29('0x167'),_0xdf29('0x1bf'),_0x251bfa[_0xdf29('0x1c0')]));};AGIVertices[_0xdf29('0xe')]['vswitch']=function(_0x190f95){logger[_0xdf29('0x2d')](util[_0xdf29('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x190f95[_0xdf29('0xaa')]));if(!this[_0xdf29('0x83')](_0x190f95[_0xdf29('0xd3')])){return this['channel'][_0xdf29('0x2b')](_0x190f95,_0xdf29('0x1a1'));}var _0x12a840=this['getVariable']['sync'](this,_0x190f95['variable_id']);if(!_0x12a840){return this['channel'][_0xdf29('0x2b')](_0x190f95,_0xdf29('0x10d'));}var _0x49613c=this[_0xdf29('0xd')][_0xdf29('0xf')](_0x12a840);return{'code':0xc8,'result':_0x49613c[_0xdf29('0x9c')]?_0x49613c[_0xdf29('0x9c')]:'-'};};String[_0xdf29('0xe')][_0xdf29('0x9b')]=function(_0x3df4df,_0x3d57d9){return this['split'](_0x3df4df)[_0xdf29('0x1c1')](_0x3d57d9);};module['exports']=AGIVertices; \ No newline at end of file +var _0xbc5e=['IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','escape_digits','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','subject','service','host','port','secure','authentication','auth','user','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','start','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','getsecretdigits','channel','mailRpc','prototype','rpc','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','then','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','name','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','toUpperCase','body','parse','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','agicommand','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','getVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','noop','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','callback','delay','add','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','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_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','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]','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','private_key','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','speech','DialogflowV2\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','getIntervals','interval_id','no\x20intervals\x20found'];(function(_0x26b8c1,_0x5baf8a){var _0x5a9b56=function(_0xf448cc){while(--_0xf448cc){_0x26b8c1['push'](_0x26b8c1['shift']());}};_0x5a9b56(++_0x5baf8a);}(_0xbc5e,0x7d));var _0xebc5=function(_0x273f92,_0x5e6ea2){_0x273f92=_0x273f92-0x0;var _0x38b53c=_0xbc5e[_0x273f92];return _0x38b53c;};'use strict';var fs=require('fs');var path=require(_0xebc5('0x0'));var util=require(_0xebc5('0x1'));var _=require(_0xebc5('0x2'));var sh=require(_0xebc5('0x3'));var odbc=require(_0xebc5('0x4'))();var rs=require(_0xebc5('0x5'));var moment=require(_0xebc5('0x6'));var Mustache=require(_0xebc5('0x7'));var rp=require(_0xebc5('0x8'));var logger=require('../../config/logger')(_0xebc5('0x9'));var config=require(_0xebc5('0xa'));var scripts=require(_0xebc5('0xb'));var FILES_PATH=_0xebc5('0xc');var recursiveMapAttributes=[_0xebc5('0xd'),'rawBody'];var verticesWithRetry=['menu',_0xebc5('0xe'),_0xebc5('0xf')];var AGIVertices=function(_0x27cfa4,_0x441389,_0x5a336e){this[_0xebc5('0x10')]=_0x27cfa4;this['rpc']=_0x441389;this[_0xebc5('0x11')]=_0x5a336e;};AGIVertices[_0xebc5('0x12')]['getVariable']=function(_0x27d5a8,_0x14d80b){this[_0xebc5('0x13')]['getVariableById'](_0x27d5a8)['then'](function(_0x57dae6){_0x14d80b(null,_0x57dae6?_0x57dae6['name']:![]);})[_0xebc5('0x14')](function(_0x30e6f4){_0x14d80b(_0x30e6f4);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x15')]=function(_0x3dc2a4,_0x23805a){this['rpc'][_0xebc5('0x16')](_0x3dc2a4)['then'](function(_0x2621be){_0x23805a(null,_0x2621be?_0x2621be['name']:![]);})['catch'](function(_0x3e903f){_0x23805a(_0x3e903f);});};AGIVertices['prototype']['getSquareProject']=function(_0x3e11d4,_0x16a784){this[_0xebc5('0x13')][_0xebc5('0x17')](_0x3e11d4)[_0xebc5('0x18')](function(_0x38d629){_0x16a784(null,_0x38d629?_0x38d629['name']:![]);})[_0xebc5('0x14')](function(_0x359f16){_0x16a784(_0x359f16);});};AGIVertices['prototype'][_0xebc5('0x19')]=function(_0x1b1584,_0x53fa7b){this[_0xebc5('0x13')][_0xebc5('0x1a')](_0x1b1584)[_0xebc5('0x18')](function(_0x2170b6){_0x53fa7b(null,_0x2170b6?_0x2170b6[_0xebc5('0x1b')]:![]);})['catch'](function(_0x4f0a7f){_0x53fa7b(_0x4f0a7f);});};AGIVertices['prototype'][_0xebc5('0x1c')]=function(_0x4af3d1,_0x257754){this[_0xebc5('0x13')]['getUserById'](_0x4af3d1)[_0xebc5('0x18')](function(_0x1b247f){_0x257754(null,_0x1b247f?_0x1b247f['name']:![]);})[_0xebc5('0x14')](function(_0x3ce69b){_0x257754(_0x3ce69b);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1d')]=function(_0x46394c,_0x11ab2e){this[_0xebc5('0x13')]['getTrunkById'](_0x46394c)[_0xebc5('0x18')](function(_0x4feb68){_0x11ab2e(null,_0x4feb68?_0x4feb68[_0xebc5('0x1e')]:![]);})[_0xebc5('0x14')](function(_0x2f227d){_0x11ab2e(_0x2f227d);});};AGIVertices[_0xebc5('0x12')]['getSound']=function(_0x193cfe,_0x5dfe9f){var _0x39cac5=this;this[_0xebc5('0x13')][_0xebc5('0x1f')](_0x193cfe)[_0xebc5('0x18')](function(_0x242793){_0x5dfe9f(null,_0x242793?_0x39cac5[_0xebc5('0x20')](_0x242793[_0xebc5('0x21')]):![]);})[_0xebc5('0x14')](function(_0xcfa24b){_0x5dfe9f(_0xcfa24b);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x22')]=function(_0x3e53d0,_0x2acf91){this[_0xebc5('0x13')]['getMailAccountById'](_0x3e53d0)[_0xebc5('0x18')](function(_0x55579d){_0x2acf91(null,_0x55579d?_0x55579d:![]);})[_0xebc5('0x14')](function(_0x3416fe){_0x2acf91(_0x3416fe);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x23')]=function(_0x19042f,_0x341c93,_0x2faf69){this[_0xebc5('0x11')][_0xebc5('0x23')](_0x19042f,_0x341c93)['then'](function(){_0x2faf69(null);})['catch'](function(_0x4d0055){_0x2faf69(_0x4d0055);});};AGIVertices[_0xebc5('0x12')]['getIntervals']=function(_0x38fa7c,_0x257fbb){this['rpc']['getIntervalById'](_0x38fa7c)['then'](function(_0x45539b){if(_0x45539b){if(_0x45539b[_0xebc5('0x24')]){_0x257fbb(null,[_0x45539b[_0xebc5('0x25')]]);}else{_0x257fbb(null,_[_0xebc5('0x26')](_0x45539b['Intervals'],_0xebc5('0x25')));}}else{_0x257fbb(null,![]);}})['catch'](function(_0x3251f4){_0x257fbb(_0x3251f4);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x20')]=function(_0x418a6f){return util[_0xebc5('0x27')](_0xebc5('0x28'),FILES_PATH,_0x418a6f);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x29')]=function(_0x4aa003,_0x2ffbe4,_0x413f14){odbc[_0xebc5('0x2a')](_0x4aa003,function(_0x1e4921){if(_0x1e4921){logger[_0xebc5('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1e4921);_0x413f14(_0x1e4921);}else{logger[_0xebc5('0x2c')](_0xebc5('0x2d'));odbc[_0xebc5('0x2e')](_0x2ffbe4,function(_0x1f9b39,_0x24987e){if(_0x1f9b39){logger[_0xebc5('0x2c')](_0xebc5('0x2f'),_0x2ffbe4);_0x413f14(_0x1f9b39);}else{logger[_0xebc5('0x2c')](_0xebc5('0x30'),_0x2ffbe4);odbc['close'](function(_0x4b719f){if(_0x4b719f){logger[_0xebc5('0x2b')](_0xebc5('0x31'),_0x4b719f);}_0x413f14(null,_0x24987e);});}});}});};AGIVertices[_0xebc5('0x12')]['getSmsAccount']=function(_0x5048cd,_0x509adc){this['rpc'][_0xebc5('0x32')](_0x5048cd)['then'](function(_0x4a603e){_0x509adc(null,_0x4a603e?_0x4a603e:![]);})[_0xebc5('0x14')](function(_0x25201a){_0x509adc(_0x25201a);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x33')]=function(_0x3b324a,_0x57803a){this['rpc']['createSmsMessage'](_0x3b324a)[_0xebc5('0x18')](function(_0x18dca5){_0x57803a(null,_0x18dca5);})['catch'](function(_0x34a167){_0x57803a(_0x34a167);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x34')]=function(_0x1135b9,_0x1d796c,_0x4d61b7){this[_0xebc5('0x13')][_0xebc5('0x34')]({'uniqueid':this[_0xebc5('0x10')][_0xebc5('0x35')],'node':_0x1135b9[_0xebc5('0x36')],'application':_0x1135b9['agicommand'],'data':_0x1d796c||null,'project_name':this[_0xebc5('0x10')][_0xebc5('0x37')],'callerid':this[_0xebc5('0x10')][_0xebc5('0x38')]})[_0xebc5('0x18')](function(_0x14188f){if(_0x4d61b7){_0x4d61b7(null,_0x14188f);}})[_0xebc5('0x14')](function(_0x282d7b){if(_0x4d61b7){_0x4d61b7(_0x282d7b);}});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x39')]=function(_0x44ce5e,_0xa8cc4,_0xc6bfa,_0x555177){this[_0xebc5('0x13')][_0xebc5('0x39')]({'uniqueid':this['channel'][_0xebc5('0x35')],'callerid':this[_0xebc5('0x10')][_0xebc5('0x38')],'calleridname':this['channel']['calleridname'],'context':this['channel'][_0xebc5('0x3a')],'extension':this[_0xebc5('0x10')]['extension'],'priority':this['channel'][_0xebc5('0x3b')],'accountcode':this['channel'][_0xebc5('0x3c')],'dnid':this[_0xebc5('0x10')][_0xebc5('0x3d')],'projectName':this[_0xebc5('0x10')][_0xebc5('0x37')],'saveName':_0xa8cc4,'filename':_0x44ce5e[_0xebc5('0x3e')]||_0xa8cc4,'savePath':_0xc6bfa})['then'](function(_0x15b26c){_0x555177(null,_0x15b26c);})[_0xebc5('0x14')](function(_0x31e4c2){_0x555177(_0x31e4c2);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x3f')]=function(_0x3f9054,_0x3aaf7a,_0x23bebe,_0x13bf4d,_0x3caaaf){this[_0xebc5('0x13')]['createSquareMessage']({'uniqueid':this[_0xebc5('0x10')][_0xebc5('0x35')],'body':_0x3f9054,'direction':_0x3aaf7a,'providerName':_0x23bebe,'providerResponse':_0x13bf4d})[_0xebc5('0x18')](function(_0x37bd2f){if(_0x3caaaf){_0x3caaaf(null,_0x37bd2f);}})[_0xebc5('0x14')](function(_0x15f9a2){if(_0x3caaaf){_0x3caaaf(_0x15f9a2);}});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x40')]=function(_0xeb3d48,_0x49e368){this[_0xebc5('0x13')]['createCmContact']({'firstName':_['isEmpty'](_0xeb3d48[_0xebc5('0x1e')])||_[_0xebc5('0x41')](_0xeb3d48[_0xebc5('0x1e')])?_0xebc5('0x42')+Math[_0xebc5('0x43')]():_0xeb3d48[_0xebc5('0x1e')],'lastName':_[_0xebc5('0x44')](_0xeb3d48[_0xebc5('0x45')])||_[_0xebc5('0x41')](_0xeb3d48[_0xebc5('0x45')])?null:_0xeb3d48[_0xebc5('0x45')],'phone':_0xeb3d48[_0xebc5('0x46')],'ListId':_0xeb3d48[_0xebc5('0x47')],'scheduledat':_0xeb3d48[_0xebc5('0x48')],'callbackUniqueid':this[_0xebc5('0x10')][_0xebc5('0x35')],'tags':'callback','description':_0xebc5('0x49')+_0xeb3d48[_0xebc5('0x48')][_0xebc5('0x4a')](),'priority':_0xeb3d48[_0xebc5('0x4b')]})[_0xebc5('0x18')](function(_0x10007a){_0x49e368(null,_0x10007a);})[_0xebc5('0x14')](function(_0x209d1e){_0x49e368(_0x209d1e);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x4c')]=function(_0x3ff397,_0x25bb52){this[_0xebc5('0x13')][_0xebc5('0x4d')](_0x3ff397)[_0xebc5('0x18')](function(_0x3fd193){_0x25bb52(null,_0x3fd193?_0x3fd193[_0xebc5('0x1e')]:![]);})[_0xebc5('0x14')](function(_0x2329b0){_0x25bb52(_0x2329b0);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x4e')]=function(_0x1c49e2,_0x23d77d,_0x4934e1){var _0x557cb0={'role':_0xebc5('0x4f')};_0x557cb0[_0x1c49e2]=this[_0xebc5('0x10')][_0xebc5('0x38')];this['rpc'][_0xebc5('0x4e')](_0x557cb0,_0x23d77d,this[_0xebc5('0x10')][_0xebc5('0x35')])[_0xebc5('0x18')](function(_0x2993ff){_0x4934e1(null,_[_0xebc5('0x41')](_0x2993ff)?![]:!![]);})[_0xebc5('0x14')](function(_0x2fd71d){logger[_0xebc5('0x2b')](_0x2fd71d);_0x4934e1(null,![]);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x50')]=function(_0x46a9,_0x1667ad){var _0x118ada={'role':_0xebc5('0x4f')};_0x118ada[_0x46a9]=this['channel'][_0xebc5('0x38')];this[_0xebc5('0x13')][_0xebc5('0x50')](_0x118ada)[_0xebc5('0x18')](function(_0x2c6c04){_0x1667ad(null,_[_0xebc5('0x41')](_0x2c6c04)?![]:!![]);})[_0xebc5('0x14')](function(_0x2d1da3){logger[_0xebc5('0x2b')](_0x2d1da3);_0x1667ad(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x453b25,_0x28d6ff){var _0x343226={'role':_0xebc5('0x4f')};_0x343226[_0x453b25]=this[_0xebc5('0x10')][_0xebc5('0x38')];this[_0xebc5('0x13')]['agentLogout'](_0x343226)[_0xebc5('0x18')](function(_0x5b4696){_0x28d6ff(null,_[_0xebc5('0x41')](_0x5b4696)?![]:!![]);})['catch'](function(_0x455776){logger[_0xebc5('0x2b')](_0x455776);_0x28d6ff(null,![]);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x51')]=function(_0x328094,_0x12f07c){var _0x410e4d={'role':'agent'};_0x410e4d[_0x328094]=this[_0xebc5('0x10')]['callerid'];var _0x56816f=_0x328094!=_0xebc5('0x52')?util[_0xebc5('0x27')](_0xebc5('0x53'),_0xebc5('0x54'),this['channel'][_0xebc5('0x38')]):undefined;this['rpc'][_0xebc5('0x51')](_0x410e4d,_0x56816f)[_0xebc5('0x18')](function(_0x26a31d){_0x12f07c(null,_[_0xebc5('0x41')](_0x26a31d)?![]:!![]);})[_0xebc5('0x14')](function(_0x24b593){logger['error'](_0x24b593);_0x12f07c(null,![]);});};AGIVertices['prototype'][_0xebc5('0x55')]=function(_0x2bcdb8,_0x47e775){sh[_0xebc5('0x56')](_[_0xebc5('0x57')](_0x2bcdb8),function(_0x39f5be,_0x539777){var _0x2c64f9=_0x539777[_0xebc5('0x58')](/(\r\n|\n|\r)/gm,'');_0x47e775(null,_0x2c64f9);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x59')]=function(_0x4d806a,_0x7c325a){scripts[_0xebc5('0x59')](_0x4d806a[_0xebc5('0x5a')],_0x4d806a[_0xebc5('0x5b')]||'text',_0x4d806a[_0xebc5('0x5c')],_0x4d806a[_0xebc5('0x5d')]||_0xebc5('0x5e'),_0x4d806a[_0xebc5('0x5f')]||_0xebc5('0x60'),_0x4d806a['audioEncoding']||'MP3')[_0xebc5('0x18')](function(_0x1e5111){_0x7c325a(null,_0x1e5111);})[_0xebc5('0x14')](function(_0x5ebd12){_0x7c325a(_0x5ebd12);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x61')]=function(_0x470949,_0x104d98){scripts[_0xebc5('0x61')](_0x470949[_0xebc5('0x5c')],_0x470949[_0xebc5('0x62')]||'en',0x1)[_0xebc5('0x18')](function(_0x1888ae){_0x104d98(null,_0x1888ae);})[_0xebc5('0x14')](function(_0x3dfb46){_0x104d98(_0x3dfb46);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x63')]=function(_0x395302,_0x20d859){var _0xc33ef6={'uri':_0x395302[_0xebc5('0x64')],'method':_0x395302[_0xebc5('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x395302[_0xebc5('0x66')])===_0xebc5('0x67')&&parseInt(_0x395302['timeout'])>=0x1?parseInt(_0x395302[_0xebc5('0x66')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xebc5('0x68'),'PUT'],_0xc33ef6[_0xebc5('0x65')][_0xebc5('0x69')]())){try{_0xc33ef6[_0xebc5('0x6a')]=_0x395302['rawBody']?JSON[_0xebc5('0x6b')](_0x395302[_0xebc5('0x6c')]):{};}catch(_0xd9d7cd){logger[_0xebc5('0x2b')](_0xebc5('0x6d'),_0xd9d7cd);}}try{_0xc33ef6[_0xebc5('0x6e')]=_0x395302[_0xebc5('0xd')]?JSON[_0xebc5('0x6b')](_0x395302['rawHeaders']):{};}catch(_0x5463f6){logger[_0xebc5('0x2b')](_0xebc5('0x6f'),_0x5463f6);}if(_0x395302[_0xebc5('0x70')]){try{var _0x97e153=require(_0x395302[_0xebc5('0x70')])[_0xebc5('0x71')](this,_0xc33ef6);_0xc33ef6['uri']=Mustache[_0xebc5('0x72')](_0x395302['url'],_0x97e153,{},['$$','$$']);if(_0xc33ef6[_0xebc5('0x6e')]){_0xc33ef6['headers']=JSON[_0xebc5('0x6b')](Mustache[_0xebc5('0x72')](JSON[_0xebc5('0x73')](_0xc33ef6['headers']),_0x97e153,{},['$$','$$']));}if(_0xc33ef6[_0xebc5('0x6a')]){_0xc33ef6[_0xebc5('0x6a')]=JSON[_0xebc5('0x6b')](Mustache[_0xebc5('0x72')](JSON[_0xebc5('0x73')](_0xc33ef6[_0xebc5('0x6a')]),_0x97e153,{},['$$','$$']));}}catch(_0x17e48f){logger[_0xebc5('0x2b')](_0xebc5('0x74'),_0x17e48f);}}rp(_0xc33ef6)['then'](function(_0x340692){var _0x15ca03={'statusCode':_0x340692[_0xebc5('0x75')]||0xc8,'statusMessage':_0x340692[_0xebc5('0x76')]||'OK','headers':_0x340692[_0xebc5('0x6e')]||{},'body':_0x340692['body']||{}};_0x20d859(null,_0x15ca03);})[_0xebc5('0x14')](function(_0x43e060){var _0x122122={'statusCode':_0x43e060[_0xebc5('0x75')]||0x1f4,'statusMessage':_0x43e060[_0xebc5('0x77')]||_0xebc5('0x78'),'headers':_0x43e060[_0xebc5('0x79')][_0xebc5('0x6e')]||{},'body':_0x43e060[_0xebc5('0x79')][_0xebc5('0x6a')]||{}};_0x20d859(null,_0x122122);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x7a')]=function(_0x21ce04,_0x5031e9){scripts['googleDialogflow'](this[_0xebc5('0x10')]['uniqueid'],_0x21ce04['key'],_0x21ce04[_0xebc5('0x5c')],_0x21ce04[_0xebc5('0x7b')]||'en')[_0xebc5('0x18')](function(_0x4ee173){_0x5031e9(null,_0x4ee173);})[_0xebc5('0x14')](function(_0x4300e2){_0x5031e9(_0x4300e2);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x7c')]=function(_0x234d59,_0x46bde6){scripts[_0xebc5('0x7c')](this[_0xebc5('0x10')]['uniqueid'],_0x234d59[_0xebc5('0x7d')],_0x234d59[_0xebc5('0x7e')],_0x234d59['private_key'],_0x234d59[_0xebc5('0x5c')],_0x234d59['dialogflowV2_language']||'en')[_0xebc5('0x18')](function(_0x39d76b){_0x46bde6(null,_0x39d76b);})[_0xebc5('0x14')](function(_0x5f2c14){_0x46bde6(_0x5f2c14);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x7f')]=function(_0x212756,_0x2a39dc){scripts[_0xebc5('0x7f')](this[_0xebc5('0x10')],_0x212756)[_0xebc5('0x18')](function(_0x125536){_0x2a39dc(null,_0x125536);})[_0xebc5('0x14')](function(_0xe28cda){_0x2a39dc(_0xe28cda);});};AGIVertices[_0xebc5('0x12')]['ispeechTTS']=function(_0x557a64,_0x35ad3f){scripts[_0xebc5('0x80')](_0x557a64[_0xebc5('0x81')],_0x557a64[_0xebc5('0x5c')],_0x557a64[_0xebc5('0x82')]||'en-US',_0x557a64[_0xebc5('0x83')])['then'](function(_0x1980a6){_0x35ad3f(null,_0x1980a6);})['catch'](function(_0x5069e2){_0x35ad3f(_0x5069e2);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x84')]=function(_0x2dc4eb,_0x8f07ee,_0x6d153b){scripts['ispeechASR'](_0x8f07ee,_0x2dc4eb['key'],_0x2dc4eb[_0xebc5('0x85')]||_0xebc5('0x5e'),this[_0xebc5('0x86')](_0x2dc4eb[_0xebc5('0x87')])?_0x2dc4eb['model']:undefined)['then'](function(_0xd84a7f){_0x6d153b(null,_0xd84a7f);})[_0xebc5('0x14')](function(_0x3a1942){_0x6d153b(_0x3a1942);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x88')]=function(_0x3d34eb,_0x1bac41){scripts[_0xebc5('0x88')](_0x3d34eb['aws_access_key_id'],_0x3d34eb[_0xebc5('0x89')],_0x3d34eb[_0xebc5('0x8a')],_0x3d34eb[_0xebc5('0x8b')]||'Amy',_0x3d34eb[_0xebc5('0x5c')],_0x3d34eb[_0xebc5('0x8c')]||_0xebc5('0x5c'))['then'](function(_0x3ffbe3){_0x1bac41(null,_0x3ffbe3);})[_0xebc5('0x14')](function(_0x3f7d97){_0x1bac41(_0x3f7d97);});};AGIVertices['prototype'][_0xebc5('0x8d')]=function(_0x1bf603,_0x1dcc6d){scripts[_0xebc5('0x8d')](this['channel'][_0xebc5('0x35')],_0x1bf603[_0xebc5('0x8e')],_0x1bf603[_0xebc5('0x89')],_0x1bf603[_0xebc5('0x8f')],_0x1bf603[_0xebc5('0x5c')],_0x1bf603[_0xebc5('0x90')])[_0xebc5('0x18')](function(_0x412d08){_0x1dcc6d(null,_0x412d08);})['catch'](function(_0x131a2f){_0x1dcc6d(_0x131a2f);});};AGIVertices['prototype']['googleASR']=function(_0x16200e,_0x152314,_0x52280d){scripts[_0xebc5('0x91')](_0x152314,_0x16200e[_0xebc5('0x81')],_0x16200e[_0xebc5('0x92')]||_0xebc5('0x5e'))[_0xebc5('0x18')](function(_0x3e8d85){_0x52280d(null,_0x3e8d85);})[_0xebc5('0x14')](function(_0x5c0a46){_0x52280d(_0x5c0a46);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x93')]=function(_0x54770d,_0xa70303,_0x579cf4){scripts[_0xebc5('0x93')](_0xa70303,_0x54770d[_0xebc5('0x94')],_0x54770d[_0xebc5('0x95')],_0x54770d[_0xebc5('0x96')])[_0xebc5('0x18')](function(_0x48699f){_0x579cf4(null,_0x48699f);})[_0xebc5('0x14')](function(_0x5c095e){_0x579cf4(_0x5c095e);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x97')]=function(_0x2f1eb7){var _0x124749=_[_0xebc5('0x98')](verticesWithRetry,_0x2f1eb7[_0xebc5('0x99')])?_0x2f1eb7:_[_0xebc5('0x9a')](_0x2f1eb7);for(var _0x38c407 in _0x124749){if(_0x124749[_0xebc5('0x9b')](_0x38c407)){if(_0x124749[_0x38c407]&&_[_0xebc5('0x9c')](_0x124749[_0x38c407])){if(_[_0xebc5('0x98')](recursiveMapAttributes,_0x38c407)){_0x124749[_0x38c407]=this['replaceObjectAllVariables'](_0x124749[_0x38c407]);}else{_0x124749[_0x38c407]=this[_0xebc5('0x9d')](_0x124749[_0x38c407]);}}}}return _0x124749;};AGIVertices[_0xebc5('0x12')][_0xebc5('0x9e')]=function(_0x18d9cf){for(var _0xb158c5 in _0x18d9cf){if(_0x18d9cf[_0xebc5('0x9b')](_0xb158c5)){if(_[_0xebc5('0x9f')](_0x18d9cf[_0xb158c5])){this['recursiveNodeIndex'](_0x18d9cf[_0xb158c5]);}else if(_[_0xebc5('0xa0')](_0x18d9cf[_0xb158c5])){for(var _0x404401=0x0;_0x404401<_0x18d9cf[_0xb158c5][_0xebc5('0xa1')];_0x404401++){this[_0xebc5('0x9e')](_0x18d9cf[_0xb158c5][_0x404401]);}}else if(_[_0xebc5('0x9c')](_0x18d9cf[_0xb158c5])){_0x18d9cf[_0xb158c5]=this[_0xebc5('0x9d')](_0x18d9cf[_0xb158c5]);}}}};AGIVertices['prototype'][_0xebc5('0xa2')]=function(_0x1470e9,_0x319b9e){for(var _0x915a79 in _0x1470e9){if(_0x1470e9[_0xebc5('0x9b')](_0x915a79)){if(_['isPlainObject'](_0x1470e9[_0x915a79])){if(!_[_0xebc5('0x44')](_0x1470e9[_0x915a79])){this['saveRestApiResult'](_0x1470e9[_0x915a79],util[_0xebc5('0x27')]('%s.%s',_0x319b9e,_0x915a79));}}else if(_[_0xebc5('0xa0')](_0x1470e9[_0x915a79])){for(var _0xa887ec=0x0;_0xa887ec<_0x1470e9[_0x915a79][_0xebc5('0xa1')];_0xa887ec++){this[_0xebc5('0xa2')](_0x1470e9[_0x915a79][_0xa887ec],util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x319b9e,_0x915a79+'['+_0xa887ec+']'));}}else{if(!_['isNil'](_0x1470e9[_0x915a79])){this[_0xebc5('0x10')][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x319b9e,_0x915a79),_0x1470e9[_0x915a79]);}}}}};AGIVertices['prototype'][_0xebc5('0xa5')]=function(_0x45766d){try{var _0x2c19e3=JSON[_0xebc5('0x6b')](_0x45766d);this[_0xebc5('0x9e')](_0x2c19e3);return JSON[_0xebc5('0x73')](_0x2c19e3);}catch(_0x5cb951){return this[_0xebc5('0x9d')](_0x45766d);}};AGIVertices[_0xebc5('0x12')][_0xebc5('0x9d')]=function(_0x8ba507){var _0x448cc4=_0x8ba507['split']('{');for(var _0x390baf=0x1;_0x390baf<_0x448cc4[_0xebc5('0xa1')];_0x390baf+=0x1){var _0x22cd8b=_0x448cc4[_0x390baf][_0xebc5('0xa6')]('}');if(_0x22cd8b[_0xebc5('0xa1')]>0x1){_0x8ba507=_0x8ba507[_0xebc5('0xa7')]('{'+_0x22cd8b[0x0]+'}',this[_0xebc5('0x10')][_0xebc5('0xa8')](_0x22cd8b[0x0])['extra']||_0x22cd8b[0x0]);}}if(_0x448cc4[_0xebc5('0xa1')]===0x1){return _0x8ba507[_0xebc5('0x4a')]();}return this[_0xebc5('0x9d')](_0x8ba507);};AGIVertices[_0xebc5('0x12')]['getAndSetVariable']=function(_0xea8ddf,_0x4bdfc1){var _0x248e43=this[_0xebc5('0x10')][_0xebc5('0xa8')](_0xea8ddf);if(_0x248e43[_0xebc5('0xa9')]===-0x1){return _0x248e43;}logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xaa'),_0x4bdfc1,_0x248e43[_0xebc5('0xab')]));return this[_0xebc5('0x10')][_0xebc5('0xa4')](_0x4bdfc1,_0x248e43[_0xebc5('0xab')]);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x86')]=function(_0x4e5115){return _0x4e5115&&_0x4e5115!=='0'&&_0x4e5115!=='-1'&&_0x4e5115!=='';};AGIVertices[_0xebc5('0x12')][_0xebc5('0xac')]=function(_0x3ba6c4){this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0x3ba6c4,'-');_0x3ba6c4[_0xebc5('0xad')]=_0x3ba6c4[_0xebc5('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xebc5('0x12')][_0xebc5('0xae')]=function(_0x756f29){logger['info'](util[_0xebc5('0x27')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x756f29[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x756f29[_0xebc5('0x5c')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xaf'));}var _0x3b15b1='\x22'+_0x756f29[_0xebc5('0x5c')]+'\x22';if(this[_0xebc5('0x86')](_0x756f29[_0xebc5('0x79')])){_0x3b15b1+=','+_0x756f29[_0xebc5('0x79')];}var _0x10061b=this['channel'][_0xebc5('0x56')](_0xebc5('0xb0'),_0x3b15b1);if(_0x10061b['result']===-0x1){return _0x10061b;}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3b15b1));};AGIVertices[_0xebc5('0x12')]['mrcprecog']=function(_0x16a89a){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0xb1'),_0x16a89a[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x16a89a[_0xebc5('0xb2')])){return this['channel']['noop'](_0xebc5('0xb3'));}var _0x2cb8b2=_0x16a89a[_0xebc5('0xb2')];if(this['isConfigured'](_0x16a89a[_0xebc5('0x79')])){_0x2cb8b2+=','+_0x16a89a[_0xebc5('0x79')];}var _0x4f56fe=this[_0xebc5('0x10')]['exec'](_0xebc5('0xb4'),_0x2cb8b2);if(_0x4f56fe[_0xebc5('0xa9')]===-0x1){return _0x4f56fe;}var _0x189131=this[_0xebc5('0xb5')](_0xebc5('0xb6'),_0xebc5('0xb7'));if(_0x189131[_0xebc5('0xa9')]===-0x1){return _0x189131;}var _0x1200e8=this[_0xebc5('0xb5')](_0xebc5('0xb8'),_0xebc5('0xb9'));if(_0x1200e8['result']===-0x1){return _0x1200e8;}var _0x3fcedc=this['getAndSetVariable'](_0xebc5('0xba'),'MRCP_RECOG_INSTANCE');if(_0x3fcedc['result']===-0x1){return _0x3fcedc;}return this['channel'][_0xebc5('0xbb')](util['format'](_0xebc5('0xbc'),_0x2cb8b2));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x9')]=function(_0x35b14a){logger[_0xebc5('0x2c')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x35b14a[_0xebc5('0x36')]));return this['channel']['agi']([_0x35b14a[_0xebc5('0xbd')],_0x35b14a[_0xebc5('0xbe')]]);};AGIVertices[_0xebc5('0x12')][_0xebc5('0xbf')]=function(_0x3353e0){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xc0'),_0x3353e0[_0xebc5('0x36')]));if(this[_0xebc5('0x86')](_0x3353e0[_0xebc5('0x66')])){logger[_0xebc5('0x2c')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x3353e0[_0xebc5('0x66')]));var _0x3347f1=this[_0xebc5('0x10')]['wait'](_0x3353e0['timeout']);if(_0x3347f1['result']===-0x1){return _0x3347f1;}}return this[_0xebc5('0x10')][_0xebc5('0xbf')]();};AGIVertices[_0xebc5('0x12')][_0xebc5('0xc1')]=function(_0x57e5a2){logger[_0xebc5('0x2c')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x57e5a2['label']));if(!this[_0xebc5('0x86')](_0x57e5a2[_0xebc5('0x47')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x57e5a2,'no\x20list\x20selected');}_0x57e5a2['scheduledAt']=moment();if(this[_0xebc5('0x86')](_0x57e5a2[_0xebc5('0xc2')])){_0x57e5a2[_0xebc5('0x48')]=moment()[_0xebc5('0xc3')](_0x57e5a2['delay'],'minutes');}if(!this[_0xebc5('0x86')](_0x57e5a2['callback_priority'])){_0x57e5a2['callback_priority']=0x2;}this[_0xebc5('0x40')][_0xebc5('0x71')](this,_0x57e5a2);return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x57e5a2[_0xebc5('0x46')],_0x57e5a2['list_id'],_0x57e5a2[_0xebc5('0x48')]));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xc4')]=function(_0x559ff5){logger[_0xebc5('0x2c')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x559ff5['label']));var _0x3ca6fb=this[_0xebc5('0x10')][_0xebc5('0x56')](_0x559ff5[_0xebc5('0xc5')],_0x559ff5[_0xebc5('0x79')]);if(_0x3ca6fb[_0xebc5('0xa9')]===-0x1){return _0x3ca6fb;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xc6'),_0x559ff5[_0xebc5('0xc5')],_0x559ff5[_0xebc5('0x79')]));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xc7')]=function(_0x10e69c){logger['info'](util[_0xebc5('0x27')](_0xebc5('0xc8'),_0x10e69c[_0xebc5('0x36')]));if(!this['isConfigured'](_0x10e69c[_0xebc5('0x5c')])){return this['channel']['noop'](_0xebc5('0xaf'));}var _0xc3f23c='\x22'+_0x10e69c[_0xebc5('0x5c')]+'\x22';if(this['isConfigured'](_0x10e69c[_0xebc5('0x79')])){_0xc3f23c+=','+_0x10e69c['options'];}var _0x41a550=this[_0xebc5('0x10')][_0xebc5('0x56')](_0xebc5('0xb0'),_0xc3f23c);if(_0x41a550[_0xebc5('0xa9')]===-0x1){return _0x41a550;}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0xc3f23c));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xc9')]=function(_0x3a8bdc){logger['info'](util['format'](_0xebc5('0xca'),_0x3a8bdc['label']));if(!this[_0xebc5('0x86')](_0x3a8bdc[_0xebc5('0x5c')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xaf'));}var _0xaa6baa='\x22'+_0x3a8bdc['text']+'\x22';if(this[_0xebc5('0x86')](_0x3a8bdc[_0xebc5('0x79')])){_0xaa6baa+=','+_0x3a8bdc[_0xebc5('0x79')];}var _0x4c8982=this[_0xebc5('0x10')][_0xebc5('0x56')]('MRCPSynth',_0xaa6baa);if(_0x4c8982[_0xebc5('0xa9')]===-0x1){return _0x4c8982;}return this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0xaa6baa));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xcb')]=function(_0x2ec31e){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xcc'),_0x2ec31e[_0xebc5('0x36')]));if(!this['isConfigured'](_0x2ec31e[_0xebc5('0xb2')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xb3'));}var _0x24e9eb=_0x2ec31e[_0xebc5('0xb2')];if(this[_0xebc5('0x86')](_0x2ec31e[_0xebc5('0x79')])){_0x24e9eb+=','+_0x2ec31e[_0xebc5('0x79')];}var _0x1dff2c=this['channel'][_0xebc5('0x56')](_0xebc5('0xb4'),_0x24e9eb);if(_0x1dff2c[_0xebc5('0xa9')]===-0x1){return _0x1dff2c;}var _0xe302d5=this['getAndSetVariable'](_0xebc5('0xb6'),_0xebc5('0xcd'));if(_0xe302d5[_0xebc5('0xa9')]===-0x1){return _0xe302d5;}var _0x3e1521=this[_0xebc5('0xb5')](_0xebc5('0xb8'),_0xebc5('0xce'));if(_0x3e1521['result']===-0x1){return _0x3e1521;}var _0xae49c=this[_0xebc5('0xb5')]('RECOG_INSTANCE()',_0xebc5('0xcf'));if(_0xae49c['result']===-0x1){return _0xae49c;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xbc'),_0x24e9eb));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xd0')]=function(_0x1367eb){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xd1'),_0x1367eb[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x1367eb[_0xebc5('0xb2')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xb3'));}var _0x36b00d=_0x1367eb[_0xebc5('0xb2')];if(this['isConfigured'](_0x1367eb[_0xebc5('0x79')])){_0x36b00d+=','+_0x1367eb['options'];}var _0x4df859=this[_0xebc5('0x10')]['exec']('MRCPRecog',_0x36b00d);if(_0x4df859['result']===-0x1){return _0x4df859;}var _0x3be268=this[_0xebc5('0xb5')](_0xebc5('0xb6'),'SESTEK_ASR_CONFIDENCE');if(_0x3be268[_0xebc5('0xa9')]===-0x1){return _0x3be268;}var _0x597af6=this['getAndSetVariable'](_0xebc5('0xb8'),'SESTEK_ASR_TRANSCRIPT');if(_0x597af6[_0xebc5('0xa9')]===-0x1){return _0x597af6;}var _0x499081=this[_0xebc5('0xb5')](_0xebc5('0xba'),_0xebc5('0xd2'));if(_0x499081[_0xebc5('0xa9')]===-0x1){return _0x499081;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x36b00d));};AGIVertices['prototype'][_0xebc5('0xd3')]=function(_0x38ad43){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0xd4'),_0x38ad43[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x38ad43['odbc_id'])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x38ad43,_0xebc5('0xd5'));}var _0x390c4d=this['getSquareOdbc'][_0xebc5('0x71')](this,_0x38ad43[_0xebc5('0xd6')]);if(!_0x390c4d){return this['channel'][_0xebc5('0x2b')](_0x38ad43,_0xebc5('0xd7'));}if(!this[_0xebc5('0x86')](_0x38ad43['query'])){return this[_0xebc5('0x10')]['error'](_0x38ad43,_0xebc5('0xd8'));}var _0x3fd880=_0x38ad43['query'][_0xebc5('0x58')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xd9'),_0x3fd880));var _0x29010c=this[_0xebc5('0x29')][_0xebc5('0x71')](this,_0x390c4d,_0x3fd880);this['createSquareDetailsReport'][_0xebc5('0x71')](this,_0x38ad43,_0x3fd880);if(!this[_0xebc5('0x86')](_0x38ad43[_0xebc5('0xda')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xdb'));}var _0x2cf480=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0x38ad43[_0xebc5('0xda')]);if(!_0x2cf480){return this[_0xebc5('0x10')]['error'](_0x38ad43,_0xebc5('0xdc'));}var _0x2dae0b=this;_0x29010c[_0xebc5('0xdd')](function(_0x571e7e,_0x1402cc){Object[_0xebc5('0xde')](_0x571e7e)[_0xebc5('0xdd')](function(_0x1f3f4e){_0x2dae0b[_0xebc5('0x10')]['setVariable'](util[_0xebc5('0x27')](_0xebc5('0xdf'),_0x2cf480,_0x1402cc,_0x1f3f4e),_0x571e7e[_0x1f3f4e]);});});this[_0xebc5('0x10')]['setVariable'](util[_0xebc5('0x27')]('%s_ROWS_COUNT',_0x2cf480),_0x29010c['length']);return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('variable\x20%s\x20set',_0x2cf480));};AGIVertices['prototype'][_0xebc5('0xe0')]=function(_0x89e045){logger[_0xebc5('0xe1')](util[_0xebc5('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x89e045['label']));if(!this['isConfigured'](_0x89e045[_0xebc5('0xe2')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x89e045,_0xebc5('0xe3'));}var _0x10d8a4=this[_0xebc5('0x1c')][_0xebc5('0x71')](this,_0x89e045[_0xebc5('0xe2')]);if(!_0x10d8a4){return this['channel'][_0xebc5('0x2b')](_0x89e045,_0xebc5('0xe4'));}var _0xa4c9d4=this[_0xebc5('0x10')][_0xebc5('0x56')](_0xebc5('0xe5'),[util[_0xebc5('0x27')]('SIP/%s',_0x10d8a4),_0x89e045['timeout'],_0x89e045[_0xebc5('0xe6')],_0x89e045[_0xebc5('0x64')]]);if(_0xa4c9d4['result']===-0x1){return _0xa4c9d4;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xe7'),_0xebc5('0xe5')));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xe8')]=function(_0x3f4133){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xe9'),_0x3f4133[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x3f4133[_0xebc5('0x81')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xea'));}if(!this[_0xebc5('0x86')](_0x3f4133[_0xebc5('0x5c')])){return this['channel']['noop'](_0xebc5('0xaf'));}this['channel'][_0xebc5('0xeb')]=!![];this[_0xebc5('0x34')](_0x3f4133);this[_0xebc5('0x3f')](_0x3f4133[_0xebc5('0x5c')],'in','','');this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Trying\x20Dialogflow:\x20%s',_0x3f4133[_0xebc5('0x5c')]));var _0x279afe=this[_0xebc5('0x7a')][_0xebc5('0x71')](this,_0x3f4133);if(_0x279afe){for(var _0x48e024 in _0x279afe){if(_0x279afe[_0xebc5('0x9b')](_0x48e024)){this['channel'][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0xec'),_0x48e024[_0xebc5('0x69')]()),_0x279afe[_0x48e024]);}}this[_0xebc5('0x3f')](_0x279afe['speech'],'out',_0xebc5('0xe8'),'');return this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0xed'),_0x279afe['speech']));}return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x3f4133,_0xebc5('0xee'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xef')]=function(_0x25c593){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x25c593[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x25c593[_0xebc5('0x7d')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')]('no\x20project_id\x20configured');}if(!this[_0xebc5('0x86')](_0x25c593[_0xebc5('0x7e')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xf0'));}if(!this[_0xebc5('0x86')](_0x25c593[_0xebc5('0xf1')])){return this[_0xebc5('0x10')]['noop']('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x25c593[_0xebc5('0xf2')])){return this['channel'][_0xebc5('0xbb')](_0xebc5('0xf3'));}if(!this[_0xebc5('0x86')](_0x25c593[_0xebc5('0x5c')])){return this['channel'][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')]['bot']=!![];this[_0xebc5('0x34')](_0x25c593);this['createSquareMessage'](_0x25c593[_0xebc5('0x5c')],'in','','');this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')](_0xebc5('0xf4'),_0x25c593[_0xebc5('0x5c')]));var _0x55bd2d=this[_0xebc5('0x7c')][_0xebc5('0x71')](this,_0x25c593);if(_0x55bd2d){for(var _0x9c5f25 in _0x55bd2d){if(_0x55bd2d[_0xebc5('0x9b')](_0x9c5f25)){if(_0x9c5f25!==_0xebc5('0xf5')){this['channel'][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0xec'),_0x9c5f25[_0xebc5('0x69')]()),_0x55bd2d[_0x9c5f25]);}}}this[_0xebc5('0x3f')](_0x55bd2d[_0xebc5('0xf6')],'out',_0xebc5('0xef'),_0x55bd2d[_0xebc5('0xf5')]);return this['channel'][_0xebc5('0xbb')](util['format'](_0xebc5('0xf7'),_0x55bd2d['speech']));}return this['channel'][_0xebc5('0x2b')](_0x25c593,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype']['sesteknda']=function(_0x46dced){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xf8'),_0x46dced['label']));if(!this[_0xebc5('0x86')](_0x46dced[_0xebc5('0xf9')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xfa'));}if(!this[_0xebc5('0x86')](_0x46dced[_0xebc5('0xfb')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xfc'));}if(!this['isConfigured'](_0x46dced['password'])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xfd'));}if(!this[_0xebc5('0x86')](_0x46dced[_0xebc5('0xfe')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')][_0xebc5('0xeb')]=!![];this[_0xebc5('0x34')](_0x46dced);this[_0xebc5('0x3f')](_0x46dced[_0xebc5('0x5c')],'in','','');this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xff'),_0x46dced[_0xebc5('0x5c')]));var _0x2978a4=this[_0xebc5('0x7f')][_0xebc5('0x71')](this,_0x46dced);if(_0x2978a4){for(var _0x47d522 in _0x2978a4){if(_0x2978a4['hasOwnProperty'](_0x47d522)){this[_0xebc5('0x10')]['setVariable'](util['format'](_0xebc5('0x100'),_0x47d522[_0xebc5('0x69')]()),_0x2978a4[_0x47d522]);}}this[_0xebc5('0x3f')](_0x2978a4[_0xebc5('0xf6')],_0xebc5('0x101'),_0xebc5('0x102'),'');if(_0x2978a4['audiofile']){this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x103'),_0x2978a4[_0xebc5('0x104')]));var _0x30139e=this[_0xebc5('0x10')]['streamFile'](_0x2978a4[_0xebc5('0x104')]);try{fs['unlink'](_0x2978a4[_0xebc5('0x104')]+'.wav');}catch(_0x515975){logger[_0xebc5('0x2b')](_0x515975);}return _0x30139e;}else{return this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x105'),_0x2978a4[_0xebc5('0xf6')]));}}return this['channel']['error'](_0x46dced,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0xebc5('0x106')]=function(_0x3e1990){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x107'),_0x3e1990[_0xebc5('0x36')]));return this[_0xebc5('0x10')]['noop'](_0xebc5('0x106'));};AGIVertices[_0xebc5('0x12')]['ext_dial']=function(_0x4b8562){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x108'),_0x4b8562['label']));var _0x45137a='';if(_0x4b8562[_0xebc5('0x109')]){if(!this['isConfigured'](_0x4b8562[_0xebc5('0x109')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x4b8562,_0xebc5('0x10a'));}else{var _0x2b103d=parseInt(_0x4b8562[_0xebc5('0x109')],0xa);if(isNaN(_0x2b103d)){_0x45137a=_0x4b8562[_0xebc5('0x109')];}else{_0x45137a=this['getTrunk'][_0xebc5('0x71')](this,_0x4b8562['trunk_id']);if(!_0x45137a){return this['channel']['error'](_0x4b8562,_0xebc5('0x10b'));}}}}else if(_0x4b8562[_0xebc5('0x10c')]){_0x45137a=_0x4b8562[_0xebc5('0x10c')];}else{return this['channel'][_0xebc5('0x2b')](_0x4b8562,_0xebc5('0x10a'));}var _0x284a05=this['channel']['exec'](_0xebc5('0xe5'),[util[_0xebc5('0x27')](_0xebc5('0x10d'),_0x45137a,_0x4b8562[_0xebc5('0x46')]),_0x4b8562['timeout'],_0x4b8562[_0xebc5('0xe6')],_0x4b8562[_0xebc5('0x64')]]);if(_0x284a05['result']===-0x1){return _0x284a05;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xe7'),_0xebc5('0xe5')));};AGIVertices['prototype'][_0xebc5('0x10e')]=function(_0x301797){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x10f'),_0x301797[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x10e'));};AGIVertices[_0xebc5('0x12')]['getdigits']=function(_0xd08c81){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x110'),_0xd08c81[_0xebc5('0x36')]));if(_0xd08c81[_0xebc5('0xad')]===0x0){return this[_0xebc5('0xac')](_0xd08c81);}_0xd08c81[_0xebc5('0xad')]-=0x1;if(!this[_0xebc5('0x86')](_0xd08c81[_0xebc5('0x111')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xd08c81,'no\x20file\x20audio\x20selected');}var _0x3b70cb=this[_0xebc5('0x112')][_0xebc5('0x71')](this,_0xd08c81[_0xebc5('0x111')]);if(!_0x3b70cb){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xd08c81,_0xebc5('0x113'));}if(!this[_0xebc5('0x86')](_0xd08c81[_0xebc5('0xda')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xebc5('0xdb'));}var _0x50d802=this[_0xebc5('0x10')][_0xebc5('0x114')](_0x3b70cb,_0xd08c81['response'],_0xd08c81[_0xebc5('0x115')]);var _0x38593d=_0x50d802[_0xebc5('0xa9')]?_0x50d802[_0xebc5('0xa9')][_0xebc5('0x4a')]():'';logger[_0xebc5('0x2c')](_0xebc5('0x116'),JSON[_0xebc5('0x73')](_0x50d802));if(_0x50d802[_0xebc5('0xa9')]===-0x1){this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xd08c81,_0x38593d);return _0x50d802;}else if(_0x50d802[_0xebc5('0xab')]==='timeout'){_0x50d802['result']=_0x38593d[_0xebc5('0xa1')]>=parseInt(_0xd08c81['mindigit'])?'x':'i';}else{_0x50d802[_0xebc5('0xa9')]=_0x38593d['length']>=parseInt(_0xd08c81[_0xebc5('0x117')])&&_0x38593d['length']<=parseInt(_0xd08c81[_0xebc5('0x115')])?'x':'i';}var _0x163811=this['getVariable'][_0xebc5('0x71')](this,_0xd08c81[_0xebc5('0xda')]);if(!_0x163811){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xd08c81,_0xebc5('0xdc'));}this[_0xebc5('0x10')][_0xebc5('0xa4')](_0x163811,_0x38593d);if(this['isConfigured'](_0xd08c81['hiddendigitsnum'])){var _0x846fd6=parseInt(_0xd08c81[_0xebc5('0x118')],0xa);var _0x504508=rs[_0xebc5('0x119')]({'charset':'*','length':_0x846fd6});var _0x513a45=_0x38593d[_0xebc5('0xa1')];if(_0x513a45>0x0){if(_0x513a45>_0x846fd6){this[_0xebc5('0x34')]['sync'](this,_0xd08c81,_0xd08c81['hiddendigitspos']===_0xebc5('0x11a')?_0x504508+_0x38593d[_0xebc5('0x11b')](_0x846fd6):_0x38593d[_0xebc5('0x11b')](0x0,_0x513a45-_0x846fd6)+_0x504508);}else{this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xd08c81,rs['generate']({'charset':'*','length':_0x513a45}));}}else{this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xd08c81,'');}}else{this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xd08c81,_0x38593d);}return _0x50d802;};AGIVertices[_0xebc5('0x12')][_0xebc5('0xf')]=function(_0x5e0b66){logger['info'](util[_0xebc5('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5e0b66[_0xebc5('0x36')]));return this[_0xebc5('0xe')](_0x5e0b66);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x11c')]=function(_0xa01e31){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xa01e31[_0xebc5('0x36')]));this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xa01e31,_0xa01e31[_0xebc5('0x11d')]);return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x11e'),_0xa01e31['goalname']));};AGIVertices['prototype'][_0xebc5('0x11f')]=function(_0x187833){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x120'),_0x187833[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x187833[_0xebc5('0x8e')])||!this[_0xebc5('0x86')](_0x187833[_0xebc5('0x89')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x121'));}if(!this[_0xebc5('0x86')](_0x187833[_0xebc5('0x5c')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x187833[_0xebc5('0x5c')]));var _0x18a81d=this['awsPolly'][_0xebc5('0x71')](this,_0x187833);if(_0x18a81d){this['channel']['noop'](util['format'](_0xebc5('0x122'),_0x18a81d));var _0x577d9f=this[_0xebc5('0x10')]['streamFile'](_0x18a81d);try{fs[_0xebc5('0x123')](_0x18a81d+_0xebc5('0x124'));}catch(_0x265882){logger[_0xebc5('0x2b')](_0x265882);}return _0x577d9f;}return this['channel'][_0xebc5('0x2b')](_0x187833,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype']['awslex']=function(_0x459235){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x125'),_0x459235[_0xebc5('0x36')]));if(!this['isConfigured'](_0x459235[_0xebc5('0x8e')])||!this[_0xebc5('0x86')](_0x459235[_0xebc5('0x89')])){return this['channel']['noop'](_0xebc5('0x121'));}if(!this[_0xebc5('0x86')](_0x459235[_0xebc5('0x90')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')]('no\x20bot\x20name\x20configured');}if(!this[_0xebc5('0x86')](_0x459235['text'])){return this[_0xebc5('0x10')][_0xebc5('0xbb')]('no\x20text\x20configured');}this[_0xebc5('0x10')][_0xebc5('0xeb')]=!![];this[_0xebc5('0x34')](_0x459235);this['createSquareMessage'](_0x459235['text'],'in','','');this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x126'),_0x459235[_0xebc5('0x5c')]));var _0x5ae490=this[_0xebc5('0x8d')][_0xebc5('0x71')](this,_0x459235);if(_0x5ae490){for(var _0x563f63 in _0x5ae490){if(_0x5ae490[_0xebc5('0x9b')](_0x563f63)&&_[_0xebc5('0x9c')](_0x5ae490[_0x563f63])){this[_0xebc5('0x10')][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0x127'),_0x563f63[_0xebc5('0x69')]()),_0x5ae490[_0x563f63]);}}if(_['isNil'](_0x5ae490[_0xebc5('0x77')])){return this['channel'][_0xebc5('0xbb')](_0xebc5('0x128'));}else{this[_0xebc5('0x3f')](_0x5ae490[_0xebc5('0x77')],_0xebc5('0x101'),'amazonlex','');return this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x5ae490[_0xebc5('0x77')]));}}return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x459235,_0xebc5('0x129'));};AGIVertices['prototype'][_0xebc5('0x12a')]=function(_0x2555c7){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x12b'),_0x2555c7[_0xebc5('0x36')],_0x2555c7[_0xebc5('0x66')]));if(!this[_0xebc5('0x86')](_0x2555c7[_0xebc5('0x81')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xea'));}var _0x1e173e=_0xebc5('0x12c');var _0x8310fe=util[_0xebc5('0x27')](_0xebc5('0x12d'),FILES_PATH,rs['generate'](0x4));var _0x37cc50=util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x8310fe,_0x1e173e);var _0x12ccef=!![];if(_0x2555c7[_0xebc5('0x12e')]===_0xebc5('0x12f')){_0x12ccef=![];}var _0xa0e770=this[_0xebc5('0x10')][_0xebc5('0x130')](_0x8310fe,_0x1e173e,_0x2555c7[_0xebc5('0x131')],_0x2555c7['timeout'],undefined,_0x12ccef);if(_0xa0e770[_0xebc5('0xa9')]!==-0x1){this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x132'),_0x37cc50));var _0x5f1c27=this[_0xebc5('0x91')][_0xebc5('0x71')](this,_0x2555c7,_0x37cc50);if(_0x5f1c27){for(var _0x51c150 in _0x5f1c27){if(_0x5f1c27['hasOwnProperty'](_0x51c150)){this[_0xebc5('0x10')][_0xebc5('0xa4')](util['format'](_0xebc5('0x133'),_0x51c150[_0xebc5('0x69')]()),_0x5f1c27[_0x51c150]);}}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x134'),JSON['stringify'](_0x5f1c27)));}}return _0xa0e770;};AGIVertices[_0xebc5('0x12')]['tildeasr']=function(_0x19b57a){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x135'),_0x19b57a[_0xebc5('0x36')]));if(!this['isConfigured'](_0x19b57a[_0xebc5('0x94')])){return this['channel']['noop'](_0xebc5('0x136'));}if(!this[_0xebc5('0x86')](_0x19b57a[_0xebc5('0x95')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x137'));}var _0x10ac66=_0xebc5('0x12c');var _0x2d7c39=util[_0xebc5('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0xebc5('0x119')](0x4));var _0x2c41e0=util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x2d7c39,_0x10ac66);var _0x5cde7c=!![];if(_0x19b57a['beep']==='NOBEEP'){_0x5cde7c=![];}var _0x33a095=this[_0xebc5('0x10')][_0xebc5('0x130')](_0x2d7c39,_0x10ac66,_0x19b57a[_0xebc5('0x131')],_0x19b57a[_0xebc5('0x66')],undefined,_0x5cde7c);if(_0x33a095[_0xebc5('0xa9')]!==-0x1){this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x138'),_0x2c41e0));var _0x53822b=this[_0xebc5('0x93')][_0xebc5('0x71')](this,_0x19b57a,_0x2c41e0);if(_0x53822b){for(var _0x1f6217 in _0x53822b){if(_0x53822b[_0xebc5('0x9b')](_0x1f6217)){this[_0xebc5('0x10')][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0x139'),_0x1f6217['toUpperCase']()),_0x53822b[_0x1f6217]);}}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('TildeASR\x20Result\x20%s',JSON[_0xebc5('0x73')](_0x53822b)));}}return _0x33a095;};AGIVertices[_0xebc5('0x12')][_0xebc5('0x13a')]=function(_0x24136d){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x13b'),_0x24136d['label']));return this[_0xebc5('0x10')][_0xebc5('0x13c')](_0x24136d[_0xebc5('0x3a')],_0x24136d[_0xebc5('0x13d')],_0x24136d[_0xebc5('0x3b')]);};AGIVertices['prototype']['gotoif']=function(_0xa5cd0a){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x13e'),_0xa5cd0a[_0xebc5('0x36')]));if(!this['isConfigured'](_0xa5cd0a[_0xebc5('0x13f')])){return this['channel']['error'](_0xa5cd0a,_0xebc5('0x140'));}try{var _0x51a02c=eval(_0xa5cd0a[_0xebc5('0x13f')])?_0xebc5('0x141'):'false';this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x142'),_0xa5cd0a['condition'],_0x51a02c));return{'code':0xc8,'result':_0x51a02c};}catch(_0x2ef7b5){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xebc5('0x12')][_0xebc5('0x143')]=function(_0x25eaa5){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x144'),_0x25eaa5[_0xebc5('0x36')]));if(!this['isConfigured'](_0x25eaa5['interval_id'])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x25eaa5,'no\x20interval\x20configured');}var _0x2dd054=this[_0xebc5('0x145')][_0xebc5('0x71')](this,_0x25eaa5[_0xebc5('0x146')]);if(!_0x2dd054){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x25eaa5,_0xebc5('0x147'));}for(var _0x543da0=0x0;_0x543da0<_0x2dd054[_0xebc5('0xa1')];_0x543da0+=0x1){var _0x4efa66=this[_0xebc5('0x10')]['getVariable'](util[_0xebc5('0x27')](_0xebc5('0x148'),_0x2dd054[_0x543da0]));if(_0x4efa66[_0xebc5('0xa9')]===-0x1){return _0x4efa66;}logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('IFTIME\x20%s\x20%s',_0x2dd054[_0x543da0],_0x4efa66['extra']));if(_0x4efa66['extra']===_0xebc5('0x141')){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x149'),_0x2dd054[_0x543da0],'true'));this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x149'),_0x2dd054[_0x543da0],'true'));return{'code':0xc8,'result':_0xebc5('0x141')};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x149'),_0x2dd054[_0x543da0],'false'));this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('IFTIME\x20%s\x20%s',_0x2dd054[_0x543da0],_0xebc5('0x14a')));}}return{'code':0xc8,'result':_0xebc5('0x14a')};};AGIVertices[_0xebc5('0x12')][_0xebc5('0x14b')]=function(_0x212a08){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x14c'),_0x212a08[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0x14b')]();};AGIVertices[_0xebc5('0x12')][_0xebc5('0x14d')]=function(_0x19c546){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x14e'),_0x19c546[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x19c546['key'])){return this['channel'][_0xebc5('0xbb')]('no\x20key\x20configured');}var _0x4820f7='wav';var _0x4c0f54=util[_0xebc5('0x27')](_0xebc5('0x12d'),FILES_PATH,rs[_0xebc5('0x119')](0x4));var _0x7526f8=util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x4c0f54,_0x4820f7);var _0x532788=!![];if(_0x19c546[_0xebc5('0x12e')]==='NOBEEP'){_0x532788=![];}var _0x444ebd=this['channel']['recordFile'](_0x4c0f54,_0x4820f7,_0x19c546[_0xebc5('0x131')],_0x19c546['timeout'],undefined,_0x532788);if(_0x444ebd[_0xebc5('0xa9')]!==-0x1){this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x14f'),_0x7526f8));var _0xd310d9=this[_0xebc5('0x84')]['sync'](this,_0x19c546,_0x7526f8);if(_0xd310d9){for(var _0x299b2a in _0xd310d9){if(_0xd310d9['hasOwnProperty'](_0x299b2a)){this[_0xebc5('0x10')][_0xebc5('0xa4')](util['format']('ISPEECH_ASR_%s',_0x299b2a[_0xebc5('0x69')]()),_0xd310d9[_0x299b2a]);}}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')](_0xebc5('0x150'),JSON['stringify'](_0xd310d9)));}}return _0x444ebd;};AGIVertices[_0xebc5('0x12')][_0xebc5('0x151')]=function(_0x27a7dd){logger[_0xebc5('0x2c')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x27a7dd['label']));if(!this[_0xebc5('0x86')](_0x27a7dd[_0xebc5('0x81')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xea'));}if(!this['isConfigured'](_0x27a7dd[_0xebc5('0x5c')])){return this['channel'][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Trying\x20ispeech\x20TTS\x20%s',_0x27a7dd['text']));var _0x552286=this[_0xebc5('0x80')][_0xebc5('0x71')](this,_0x27a7dd);if(_0x552286){this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x14f'),_0x552286));var _0x2bc68a=this['channel'][_0xebc5('0x152')](_0x552286,_0x27a7dd[_0xebc5('0x131')]);try{fs['unlink'](_0x552286+_0xebc5('0x124'));}catch(_0x5e197c){logger[_0xebc5('0x2b')](_0x5e197c);}return _0x2bc68a;}return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x27a7dd,_0xebc5('0x153'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x154')]=function(_0xcdcd73){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x155'),_0xcdcd73['label']));if(!this[_0xebc5('0x86')](_0xcdcd73['findBy'])){return this['channel'][_0xebc5('0x2b')](_0xcdcd73,_0xebc5('0x156'));}logger['info'](util[_0xebc5('0x27')](_0xebc5('0x157'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xcdcd73[_0xebc5('0x158')]));var _0xc645cf=this[_0xebc5('0x51')]['sync'](this,_0xcdcd73[_0xebc5('0x158')]);if(_0xc645cf){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xcdcd73[_0xebc5('0x158')]));this[_0xebc5('0x10')]['noop'](util['format'](_0xebc5('0x159'),this['channel']['callerid'],_0xcdcd73['findBy']));return{'code':0xc8,'result':_0xebc5('0x15a')};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xcdcd73['findBy']));this['channel'][_0xebc5('0xbb')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xebc5('0x10')][_0xebc5('0x38')],_0xcdcd73[_0xebc5('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xebc5('0x12')]['logout']=function(_0xaee84c){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x15c'),_0xaee84c[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0xaee84c['findBy'])){return this[_0xebc5('0x10')]['error'](_0xaee84c,_0xebc5('0x156'));}logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x157'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xaee84c[_0xebc5('0x158')]));var _0x2e8aba=this[_0xebc5('0x15d')][_0xebc5('0x71')](this,_0xaee84c['findBy']);if(_0x2e8aba){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')]['callerid'],_0xaee84c[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xaee84c['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this['channel'][_0xebc5('0x38')],_0xaee84c[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this[_0xebc5('0x10')]['callerid'],_0xaee84c[_0xebc5('0x158')]));return{'code':0xc8,'result':_0xebc5('0x15e')};}};AGIVertices['prototype']['math']=function(_0x4e5800){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15f'),_0x4e5800[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x4e5800[_0xebc5('0x160')])){return this[_0xebc5('0x10')]['error'](_0x4e5800,_0xebc5('0x161'));}this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format']('math\x20%s',_0x4e5800[_0xebc5('0x160')]));var _0x4931eb=eval(_0x4e5800[_0xebc5('0x160')]);if(!this[_0xebc5('0x86')](_0x4e5800[_0xebc5('0xda')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xdb'));}var _0x29b9a9=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0x4e5800['variable_id']);if(!_0x29b9a9){return this['channel'][_0xebc5('0x2b')](_0x4e5800,'no\x20variable\x20found');}if(_[_0xebc5('0xa0')](_0x4931eb)){var _0x433b6f=this;_0x4931eb[_0xebc5('0xdd')](function(_0x5b6cec,_0x54d6bf){_0x433b6f[_0xebc5('0x10')][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0x162'),_0x29b9a9,_0x54d6bf),_0x5b6cec);});return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('variable\x20%s[key]\x20set',_0x29b9a9));}else{return this[_0xebc5('0x10')]['setVariable'](_0x29b9a9,_0x4931eb);}};AGIVertices[_0xebc5('0x12')]['menu']=function(_0x547e8f){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x163'),_0x547e8f[_0xebc5('0x36')]));if(_0x547e8f['retry']===0x0){return this[_0xebc5('0xac')](_0x547e8f);}_0x547e8f[_0xebc5('0xad')]-=0x1;if(!this[_0xebc5('0x86')](_0x547e8f['file_id'])){return this[_0xebc5('0x10')]['error'](_0x547e8f,_0xebc5('0x164'));}var _0x2bfd0e=this[_0xebc5('0x112')][_0xebc5('0x71')](this,_0x547e8f[_0xebc5('0x111')]);if(!_0x2bfd0e){return this['channel']['error'](_0x547e8f,_0xebc5('0x113'));}var _0x5c3442=this[_0xebc5('0x10')][_0xebc5('0x114')](_0x2bfd0e,_0x547e8f[_0xebc5('0x165')],_0x547e8f['digit']);var _0x521018=_0x5c3442[_0xebc5('0xa9')];if(_0x5c3442[_0xebc5('0xa9')]===-0x1){this[_0xebc5('0x34')]['sync'](this,_0x547e8f,'-1');return _0x5c3442;}else if(_0x5c3442[_0xebc5('0xab')]===_0xebc5('0x66')){_0x5c3442[_0xebc5('0xa9')]=_0x5c3442[_0xebc5('0xa9')][_0xebc5('0xa1')]>0x0?_0x5c3442[_0xebc5('0xa9')]:'t';}else if(_[_0xebc5('0x44')](_0x5c3442[_0xebc5('0xa9')])){_0x5c3442[_0xebc5('0xa9')]='#';_0x521018='#';}if(!this[_0xebc5('0x86')](_0x547e8f[_0xebc5('0xda')])){this['channel'][_0xebc5('0xbb')](_0xebc5('0xdb'));}else{var _0x4f1f4f=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0x547e8f[_0xebc5('0xda')]);if(!_0x4f1f4f){return this['channel'][_0xebc5('0x2b')](_0x547e8f,_0xebc5('0xdc'));}this[_0xebc5('0x10')]['setVariable'](_0x4f1f4f,_0x521018);}this[_0xebc5('0x34')]['sync'](this,_0x547e8f,_0x521018);return _0x5c3442;};AGIVertices[_0xebc5('0x12')][_0xebc5('0xbb')]=function(_0x5d9a43){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x166'),_0x5d9a43['label']));return this['channel'][_0xebc5('0xbb')](_0x5d9a43[_0xebc5('0x167')]||_0x5d9a43['label']);};AGIVertices[_0xebc5('0x12')]['pause']=function(_0x439c6a){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x168'),_0x439c6a[_0xebc5('0x36')]));if(!this['isConfigured'](_0x439c6a[_0xebc5('0x158')])){return this['channel'][_0xebc5('0x2b')](_0x439c6a,_0xebc5('0x156'));}logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x157'),this['channel']['callerid'],_0x439c6a[_0xebc5('0x158')]));var _0x415298=this[_0xebc5('0x4c')][_0xebc5('0x71')](this,_0x439c6a[_0xebc5('0x169')]);var _0x2423fa=this[_0xebc5('0x4e')][_0xebc5('0x71')](this,_0x439c6a['findBy'],_0x415298);if(_0x2423fa){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0x439c6a[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x159'),this['channel'][_0xebc5('0x38')],_0x439c6a[_0xebc5('0x158')]));return{'code':0xc8,'result':_0xebc5('0x15a')};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0x439c6a['findBy']));this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0x439c6a[_0xebc5('0x158')]));return{'code':0xc8,'result':_0xebc5('0x15e')};}};AGIVertices[_0xebc5('0x12')]['playback']=function(_0x58b49e){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x16a'),_0x58b49e[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x58b49e[_0xebc5('0x111')])){return this['channel'][_0xebc5('0x2b')](_0x58b49e,'no\x20file\x20audio\x20selected');}var _0x286e0d=this[_0xebc5('0x112')][_0xebc5('0x71')](this,_0x58b49e[_0xebc5('0x111')]);if(!_0x286e0d){return this[_0xebc5('0x10')]['error'](_0x58b49e,'no\x20file\x20audio\x20found');}var _0x35a5d9=this[_0xebc5('0x10')][_0xebc5('0x56')](_0xebc5('0x16b'),[_0x286e0d,_0x58b49e[_0xebc5('0xe6')]]);if(_0x35a5d9[_0xebc5('0xa9')]===-0x1){return _0x35a5d9;}return this[_0xebc5('0x10')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xebc5('0x16b'),_0x286e0d));};AGIVertices['prototype'][_0xebc5('0x16c')]=function(_0x51e164){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x16d'),_0x51e164['label']));if(!this[_0xebc5('0x86')](_0x51e164['queue_id'])){return this[_0xebc5('0x10')]['error'](_0x51e164,_0xebc5('0x16e'));}var _0x1e9bdc='';var _0x51be39=parseInt(_0x51e164[_0xebc5('0x16f')],0xa);if(isNaN(_0x51be39)){_0x1e9bdc=_0x51e164['queue_id'];}else{_0x1e9bdc=this[_0xebc5('0x15')][_0xebc5('0x71')](this,_0x51e164[_0xebc5('0x16f')]);if(!_0x1e9bdc){return this['channel'][_0xebc5('0x2b')](_0x51e164,'no\x20queue\x20found');}}var _0x116ff8='';if(this[_0xebc5('0x86')](_0x51e164[_0xebc5('0x111')])){var _0xa7800e=this['getSound'][_0xebc5('0x71')](this,_0x51e164['file_id']);if(_0xa7800e){_0x116ff8=_0xa7800e;}}this['createSquareDetailsReport']['sync'](this,_0x51e164,_0x1e9bdc);if(_0x51e164['opts'][_0xebc5('0x170')]('x')<0x0){_0x51e164['opts']+='x';}if(_0x51e164[_0xebc5('0xe6')][_0xebc5('0x170')]('X')<0x0){_0x51e164['opts']+='X';}this[_0xebc5('0x10')][_0xebc5('0xa4')]('XMCS-QUEUE',_0x1e9bdc?_0x1e9bdc[_0xebc5('0x171')]():'');var _0x58fdb6=this['channel'][_0xebc5('0x56')](_0xebc5('0x172'),[_0x1e9bdc,_0x51e164[_0xebc5('0xe6')],_0x51e164[_0xebc5('0x64')],_0x116ff8,_0x51e164[_0xebc5('0x66')],_0x51e164['agi'],_0x51e164[_0xebc5('0x173')],_0x51e164[_0xebc5('0x174')],'',_0x51e164[_0xebc5('0x175')]]);if(_0x58fdb6[_0xebc5('0xa9')]===-0x1){return _0x58fdb6;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xc6'),_0xebc5('0x172'),_0x1e9bdc));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x176')]=function(_0x537795){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x177'),_0x537795[_0xebc5('0x36')]));var _0x581bed=_0x537795['recordingFormat']||_0xebc5('0x12c');var _0x5935e4=util['format']('%s_%s',this['channel'][_0xebc5('0x35')],rs['generate'](0x5));var _0x54301f=util[_0xebc5('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x5935e4,_0x581bed);var _0x1e10f4=util[_0xebc5('0x27')](_0xebc5('0x12d'),FILES_PATH,_0x5935e4);this[_0xebc5('0x39')][_0xebc5('0x71')](this,_0x537795,_0x5935e4,_0x54301f);this[_0xebc5('0x10')][_0xebc5('0xa4')](_0xebc5('0x178'),_0x5935e4);logger[_0xebc5('0x2c')](_0xebc5('0x179'),_0x1e10f4,_0x581bed,_0x537795['escape_digits'],_0x537795[_0xebc5('0x66')]);return this[_0xebc5('0x10')][_0xebc5('0x130')](_0x1e10f4,_0x581bed,_0x537795['escape_digits'],_0x537795[_0xebc5('0x66')],undefined,!![]);};AGIVertices[_0xebc5('0x12')]['restapi']=function(_0xdac664){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0xdac664['label']));if(!this['isConfigured'](_0xdac664['url'])){return this[_0xebc5('0x10')]['noop']('no\x20url\x20configured');}var _0x18cfea=this['restAPI'][_0xebc5('0x71')](this,_0xdac664);logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x17a'),util[_0xebc5('0x17b')](_0x18cfea,{'showHidden':![],'depth':null})));if(!this[_0xebc5('0x86')](_0xdac664['variable_id'])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x17c'));}var _0x307dee=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0xdac664[_0xebc5('0xda')]);if(!_0x307dee){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xdac664,'no\x20variable\x20found');}this[_0xebc5('0x10')][_0xebc5('0xa4')](util['format'](_0xebc5('0x17d'),_0x307dee),_0x18cfea[_0xebc5('0x75')]?_0x18cfea[_0xebc5('0x75')]:'200');this[_0xebc5('0x10')]['setVariable'](util[_0xebc5('0x27')](_0xebc5('0x17e'),_0x307dee),_0x18cfea['statusMessage']?_0x18cfea[_0xebc5('0x76')]:'OK');if(_0x18cfea[_0xebc5('0x6a')]){try{this['saveRestApiResult'](_0x18cfea[_0xebc5('0x6a')],_0x307dee);}catch(_0x3f9e28){logger[_0xebc5('0x2b')](util[_0xebc5('0x27')](_0xebc5('0x17f'),_0x307dee));}}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')](_0xebc5('0x180'),_0x307dee));};AGIVertices[_0xebc5('0x12')]['saydigits']=function(_0x1cef87){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x181'),_0x1cef87[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0x182')](_0x1cef87[_0xebc5('0x183')][_0xebc5('0x58')](/\s+/g,''),_0x1cef87['escape_digits']);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x184')]=function(_0x2826c9){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2826c9[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0x185')](_0x2826c9['number'][_0xebc5('0x58')](/\s+/g,''),_0x2826c9[_0xebc5('0x186')]);};AGIVertices['prototype']['sayphonetic']=function(_0x23c9ab){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x187'),_0x23c9ab['label']));return this[_0xebc5('0x10')][_0xebc5('0x188')](_0x23c9ab[_0xebc5('0x5c')],_0x23c9ab[_0xebc5('0x186')]);};AGIVertices['prototype']['sendMail']=function(_0x538757){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x189'),_0x538757[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x538757['account_id'])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0x18a'));}var _0x4e147c=this[_0xebc5('0x22')]['sync'](this,_0x538757[_0xebc5('0x18b')]);if(!_0x4e147c||!_0x4e147c[_0xebc5('0x18c')]){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x538757,_0xebc5('0x18d'));}var _0x52d69a={'from':util[_0xebc5('0x27')](_0xebc5('0x18e'),_0x4e147c['name'],_0x4e147c[_0xebc5('0x18f')]||_0x4e147c['Smtp']['user']),'to':_0x538757['to']||'','cc':_0x538757['cc']||'','bcc':_0x538757['bcc']||'','subject':_0x538757[_0xebc5('0x190')],'html':_0x538757[_0xebc5('0x5c')],'text':_0x538757[_0xebc5('0x5c')]};var _0x546e9b={'tls':{'rejectUnauthorized':![]}};if(_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x191')]){_0x546e9b[_0xebc5('0x191')]=_0x4e147c['Smtp'][_0xebc5('0x191')];}else{_0x546e9b[_0xebc5('0x192')]=_0x4e147c['Smtp']['host'];_0x546e9b[_0xebc5('0x193')]=_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x193')];_0x546e9b[_0xebc5('0x194')]=_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x194')];}if(_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x195')]){_0x546e9b[_0xebc5('0x196')]={'user':_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x197')],'pass':_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x198')]};}if(this[_0xebc5('0x86')](_0x538757[_0xebc5('0x199')])){}logger['debug'](_0xebc5('0x19a'),JSON[_0xebc5('0x73')](_0x52d69a));this['createSquareDetailsReport']['sync'](this,_0x538757,_0x538757['account_id']);this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x19b'),_0x4e147c[_0xebc5('0x1e')]));this['sendMailMessage']['sync'](this,_0x546e9b,_0x52d69a);return this[_0xebc5('0x10')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xebc5('0x19c')]=function(_0x21c71d){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x19d'),_0x21c71d[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x19e'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x19f')]=function(_0x196dbd){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x196dbd['label']));if(!this[_0xebc5('0x86')](_0x196dbd[_0xebc5('0x1a0')])){return this['channel'][_0xebc5('0xbb')]('no\x20sms\x20account\x20configured');}var _0x18fac6=this[_0xebc5('0x1a1')]['sync'](this,_0x196dbd[_0xebc5('0x1a0')]);if(!_0x18fac6){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x196dbd,_0xebc5('0x1a2'));}var _0x3f1305={'body':_0x196dbd['sms_text'],'phone':_0x196dbd['to']||'','SmsAccountId':_0x18fac6['id']};logger['debug'](_0xebc5('0x1a3'),JSON[_0xebc5('0x73')](_0x3f1305));this[_0xebc5('0x34')]['sync'](this,_0x196dbd,_0x196dbd[_0xebc5('0x1a0')]);this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x18fac6[_0xebc5('0x1e')]));this[_0xebc5('0x33')]['sync'](this,_0x3f1305);return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x1a4'));};AGIVertices[_0xebc5('0x12')]['set']=function(_0x37c0cf){logger['info'](util[_0xebc5('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x37c0cf[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x37c0cf[_0xebc5('0xda')])){return this['channel'][_0xebc5('0x2b')](_0x37c0cf,_0xebc5('0x1a5'));}var _0x4c0c45=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0x37c0cf['variable_id']);if(!_0x4c0c45){return this['channel'][_0xebc5('0x2b')](_0x37c0cf,_0xebc5('0xdc'));}return this[_0xebc5('0x10')][_0xebc5('0xa4')](_0x4c0c45,_0x37c0cf['variable_value']);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1a6')]=function(_0x3534c5){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3534c5['label']));this[_0xebc5('0x10')][_0xebc5('0xbb')]('START\x20CALLY\x20SQUARE');if(_0x3534c5['answer']===_0xebc5('0x1a7')){this[_0xebc5('0x10')][_0xebc5('0xbb')]('Answer');return this['channel']['answer']();}return this['channel'][_0xebc5('0xbb')](_0xebc5('0x1a8'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1a9')]=function(_0x2feeb5){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x1aa'),_0x2feeb5['label']));if(!this[_0xebc5('0x86')](_0x2feeb5[_0xebc5('0x1ab')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x2feeb5,_0xebc5('0x1ac'));}var _0x26268f=this[_0xebc5('0x1ad')][_0xebc5('0x71')](this,_0x2feeb5[_0xebc5('0x1ab')]);if(!this[_0xebc5('0x86')](_0x26268f)){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x2feeb5,util[_0xebc5('0x27')](_0xebc5('0x1ae'),_0x2feeb5[_0xebc5('0x1ab')]));}if(_0x26268f===this['channel']['arg_1']){return this['channel']['error'](_0x2feeb5,_0xebc5('0x1af'));}this['createSquareDetailsReport'][_0xebc5('0x71')](this,_0x2feeb5,_0x26268f);var _0x36ad65=this[_0xebc5('0x10')]['exec']('AGI',util[_0xebc5('0x27')](_0xebc5('0x1b0'),config[_0xebc5('0x9')][_0xebc5('0x192')]||_0xebc5('0x1b1'),_0x26268f,this[_0xebc5('0x10')][_0xebc5('0x37')]));if(_0x36ad65['result']===-0x1){return _0x36ad65;}return this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xc6'),_0xebc5('0x1b2'),_0x26268f));};AGIVertices['prototype'][_0xebc5('0x1b3')]=function(_0x55d0be){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x55d0be['label']));var _0x51da07=this[_0xebc5('0x55')]['sync'](this,_0x55d0be['command']);this['createSquareDetailsReport'][_0xebc5('0x71')](this,_0x55d0be,_0x55d0be[_0xebc5('0xbd')]);if(this[_0xebc5('0x86')](_0x55d0be[_0xebc5('0xda')])){var _0x4a5501=this[_0xebc5('0xa8')]['sync'](this,_0x55d0be['variable_id']);if(_0x4a5501){this[_0xebc5('0x10')][_0xebc5('0xa4')](_0x4a5501,_0x51da07);return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x55d0be[_0xebc5('0xbd')],_0x4a5501));}}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x1b4'),_0x55d0be[_0xebc5('0xbd')]));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1b5')]=function(_0x380667){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x1b6'),_0x380667['label']));_0x380667[_0xebc5('0x5c')]=_0x380667['text'][_0xebc5('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xebc5('0x86')](_0x380667[_0xebc5('0x5a')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x1b7'));}if(!this[_0xebc5('0x86')](_0x380667[_0xebc5('0x5c')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x380667['text']));var _0x2d1929=this['googleCloudTTS'][_0xebc5('0x71')](this,_0x380667);if(_0x2d1929){this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2d1929));var _0x17578d=this[_0xebc5('0x10')]['streamFile'](_0x2d1929);try{fs[_0xebc5('0x123')](_0x2d1929+'.wav');}catch(_0xfd39b1){logger[_0xebc5('0x2b')](_0xfd39b1);}return _0x17578d;}return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x380667,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1b8')]=function(_0x2fd3db){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x1b9'),_0x2fd3db[_0xebc5('0x36')]));_0x2fd3db[_0xebc5('0x5c')]=_0x2fd3db['text'][_0xebc5('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xebc5('0x86')](_0x2fd3db[_0xebc5('0x5c')])){return this[_0xebc5('0x10')]['noop']('no\x20text\x20configured');}this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x1ba'),_0x2fd3db[_0xebc5('0x5c')]));var _0x103ee5=this[_0xebc5('0x61')][_0xebc5('0x71')](this,_0x2fd3db);if(_0x103ee5){this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x1bb'),_0x103ee5));var _0x28a871=this['channel'][_0xebc5('0x152')](_0x103ee5);try{fs['unlink'](_0x103ee5+_0xebc5('0x124'));}catch(_0x37aacb){logger[_0xebc5('0x2b')](_0x37aacb);}return _0x28a871;}return this[_0xebc5('0x10')]['error'](_0x2fd3db,_0xebc5('0x1bc'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1bd')]=function(_0x365324){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x1be'),_0x365324[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x365324[_0xebc5('0x158')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x365324,_0xebc5('0x156'));}logger[_0xebc5('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xebc5('0x10')][_0xebc5('0x38')],_0x365324[_0xebc5('0x158')]));var _0x1b6531=this[_0xebc5('0x50')][_0xebc5('0x71')](this,_0x365324[_0xebc5('0x158')]);if(_0x1b6531){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xebc5('0x10')][_0xebc5('0x38')],_0x365324[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0x365324['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this['channel']['callerid'],_0x365324[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x15b'),this['channel']['callerid'],_0x365324[_0xebc5('0x158')]));return{'code':0xc8,'result':_0xebc5('0x15e')};}};AGIVertices['prototype'][_0xebc5('0x1bf')]=function(_0x59bb6d){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x1c0'),_0x59bb6d[_0xebc5('0x36')]));var _0x208d17=this[_0xebc5('0x10')][_0xebc5('0x56')](_0xebc5('0x1c1'),[_0x59bb6d[_0xebc5('0x1c2')],_0x59bb6d[_0xebc5('0x79')]]);if(_0x208d17['result']===-0x1){return _0x208d17;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xc6'),_0xebc5('0x1c1'),_0x59bb6d[_0xebc5('0x1c2')]));};AGIVertices['prototype']['vswitch']=function(_0x5b384d){logger['info'](util[_0xebc5('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x5b384d[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x5b384d[_0xebc5('0xda')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x5b384d,'no\x20variable\x20selected');}var _0x229249=this[_0xebc5('0xa8')]['sync'](this,_0x5b384d[_0xebc5('0xda')]);if(!_0x229249){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x5b384d,'no\x20variable\x20found');}var _0x4b3df8=this['channel'][_0xebc5('0xa8')](_0x229249);return{'code':0xc8,'result':_0x4b3df8[_0xebc5('0xab')]?_0x4b3df8[_0xebc5('0xab')]:'-'};};String[_0xebc5('0x12')][_0xebc5('0xa7')]=function(_0x44b329,_0x4ecd7d){return this[_0xebc5('0xa6')](_0x44b329)[_0xebc5('0x1c3')](_0x4ecd7d);};module[_0xebc5('0x1c4')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 392fa93..0cc3ed4 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 _0x7fc1=['all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','then','catch','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','attended','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s'];(function(_0x2be4d1,_0x48eb39){var _0x41b3d5=function(_0x413bc7){while(--_0x413bc7){_0x2be4d1['push'](_0x2be4d1['shift']());}};_0x41b3d5(++_0x48eb39);}(_0x7fc1,0xaa));var _0x17fc=function(_0x2023de,_0x17e1e6){_0x2023de=_0x2023de-0x0;var _0x2b82bc=_0x7fc1[_0x2023de];return _0x2b82bc;};'use strict';var util=require('util');var _=require(_0x17fc('0x0'));var moment=require(_0x17fc('0x1'));var ami=require(_0x17fc('0x2'));var logger=require(_0x17fc('0x3'))(_0x17fc('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x17fc('0x5'));function Acw(_0x39866b){this[_0x17fc('0x6')]=_0x39866b[_0x17fc('0x6')];this[_0x17fc('0x7')]=_0x39866b[_0x17fc('0x7')];this[_0x17fc('0x8')]=_0x39866b[_0x17fc('0x8')];this[_0x17fc('0x9')]={};ami['on'](_0x17fc('0xa'),this[_0x17fc('0xb')]['bind'](this));ami['on'](_0x17fc('0xc'),this['syncHangupRequest'][_0x17fc('0xd')](this));ami['on']('hangup',this[_0x17fc('0xe')][_0x17fc('0xd')](this));ami['on'](_0x17fc('0xf'),this[_0x17fc('0x10')][_0x17fc('0xd')](this));ami['on'](_0x17fc('0x11'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x17fc('0x12'),this['syncBlindTransfer'][_0x17fc('0xd')](this));ami['on'](_0x17fc('0x13'),this[_0x17fc('0x14')][_0x17fc('0xd')](this));}function getDiff(_0x5e2c97){var _0x44117f=moment()[_0x17fc('0x15')](0x0);var _0x208240=moment(_0x5e2c97)['milliseconds'](0x0);return _0x44117f[_0x17fc('0x16')](_0x208240,'seconds');}Acw[_0x17fc('0x17')]['startAcw']=function(_0x34a1f6){try{var _0x1c614a=this;var _0x28f769=this['channels'][_0x34a1f6][_0x17fc('0x18')];var _0x56b77a=this[_0x17fc('0x9')][_0x34a1f6][_0x17fc('0x19')];var _0x56a720=this[_0x17fc('0x6')][_0x56b77a];var _0x4c04a4=![];var _0x4f8dac=_0x17fc('0x1a');if(_0x56a720[_0x17fc('0x1b')]){if(_0x56a720['mandatoryDispositionPause'][_0x17fc('0x1c')]){_0x4c04a4=!![];_0x4f8dac=_0x56a720[_0x17fc('0x1d')][_0x17fc('0x1c')];}}ami[_0x17fc('0x1e')]({'action':_0x17fc('0x1f'),'interface':_0x28f769,'paused':!![],'reason':_0x4f8dac})['then'](function(_0x566216){if(_0x1c614a[_0x17fc('0x7')][_0x28f769]){return RpcUser[_0x17fc('0x20')](_0x1c614a[_0x17fc('0x7')][_0x28f769]['id'])['then'](function(_0x56c8ac){if(_0x56c8ac&&!_0x56c8ac['voicePause']){logger[_0x17fc('0x21')](_0x17fc('0x22'),_0x34a1f6,_0x28f769,_0x56b77a);var _0xdba6f1=_0x1c614a['channels'][_0x34a1f6]['attended']&&_0x1c614a[_0x17fc('0x9')][_0x34a1f6][_0x17fc('0x23')]?_0x1c614a[_0x17fc('0x9')][_0x34a1f6][_0x17fc('0x23')]:_0x34a1f6;return RpcUser[_0x17fc('0x24')](_0x1c614a[_0x17fc('0x7')][_0x28f769],_0x4f8dac,_0xdba6f1)['then'](function(_0x818e1){if(!_0x4c04a4){_0x1c614a['timers'][_0x28f769]={};logger['info'](_0x17fc('0x25'),_0x34a1f6,_0x1c614a[_0x17fc('0x6')][_0x56b77a][_0x17fc('0x26')],_0x28f769,_0x56b77a);_0x1c614a[_0x17fc('0x8')][_0x28f769][_0x17fc('0x27')]=setTimeout(_0x1c614a[_0x17fc('0x28')][_0x17fc('0xd')](_0x1c614a,_0x28f769),_0x1c614a[_0x17fc('0x6')][_0x56b77a][_0x17fc('0x26')]*0x3e8);_0x1c614a['timers'][_0x28f769][_0x17fc('0x29')]=moment()[_0x17fc('0x2a')](_0x17fc('0x2b'));_0x1c614a[_0x17fc('0x8')][_0x28f769][_0x17fc('0x2c')]=_0x34a1f6;_0x1c614a[_0x17fc('0x8')][_0x28f769]['queue']=_0x56b77a;_0x1c614a[_0x17fc('0x8')][_0x28f769]['updateAcw']=function(){var _0x492318=getDiff(_0x1c614a['timers'][_0x28f769]['lastPauseAt']);clearTimeout(_0x1c614a[_0x17fc('0x8')][_0x28f769][_0x17fc('0x27')]);_0x1c614a['timers'][_0x28f769][_0x17fc('0x27')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x492318},_0x1c614a['timers'][_0x28f769]['uniqueid'],_0x28f769)['then'](function(_0xa1c022){logger[_0x17fc('0x21')](_0x17fc('0x2d'),_0x34a1f6,_0x492318,_0xa1c022);})['catch'](function(_0x17550c){logger['error'](_0x17fc('0x2e'),_0x34a1f6,_0x17550c);});delete _0x1c614a[_0x17fc('0x8')][_0x28f769];};}});}else{logger[_0x17fc('0x21')](_0x17fc('0x2f'),_0x34a1f6,_0x28f769,_0x56b77a);}});}})['catch'](function(_0x36bd2f){logger[_0x17fc('0x30')](_0x17fc('0x25'),_0x34a1f6,_0x1c614a['voiceQueues'][_0x56b77a][_0x17fc('0x26')],_0x28f769,_0x56b77a);})[_0x17fc('0x31')](function(){delete _0x1c614a[_0x17fc('0x9')][_0x34a1f6];});}catch(_0x2781fa){logger[_0x17fc('0x30')](_0x17fc('0x32'),_0x2781fa[_0x17fc('0x33')]);}};Acw['prototype'][_0x17fc('0x28')]=function(_0x497a7d){try{var _0x1e329e=this;if(_0x1e329e[_0x17fc('0x8')][_0x497a7d]){_0x1e329e[_0x17fc('0x8')][_0x497a7d][_0x17fc('0x27')]=![];var _0x277229=_0x1e329e['timers'][_0x497a7d]['uniqueid'];var _0x574ff0=_0x1e329e[_0x17fc('0x8')][_0x497a7d][_0x17fc('0x19')];var _0x4f7e3e=_0x1e329e[_0x17fc('0x6')][_0x574ff0][_0x17fc('0x26')];logger[_0x17fc('0x21')](_0x17fc('0x34'),_0x277229,_0x497a7d);RpcUser[_0x17fc('0x35')](this[_0x17fc('0x7')][_0x497a7d]);RpcVoiceAgentReport['update']({'acwtime':_0x4f7e3e,'agentacw':!![]},_0x277229,_0x497a7d)[_0x17fc('0x36')](function(_0x8429e2){logger[_0x17fc('0x21')](_0x17fc('0x2d'),_0x277229,_0x4f7e3e,_0x8429e2);})[_0x17fc('0x37')](function(_0xf92c81){logger[_0x17fc('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x277229,_0xf92c81);});}else{logger[_0x17fc('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x497a7d);if(_0x1e329e['timers']){logger[_0x17fc('0x21')](_0x17fc('0x38'),JSON[_0x17fc('0x39')](_0x1e329e[_0x17fc('0x8')]));}}}catch(_0x5aff95){logger[_0x17fc('0x30')](_0x17fc('0x3a'),_0x5aff95[_0x17fc('0x33')]);}};Acw[_0x17fc('0x17')][_0x17fc('0xb')]=function(_0x251ce5){try{if(this['voiceQueues'][_0x251ce5['queue']]&&(this[_0x17fc('0x6')][_0x251ce5[_0x17fc('0x19')]][_0x17fc('0x4')]||this['voiceQueues'][_0x251ce5[_0x17fc('0x19')]][_0x17fc('0x1b')])){if(this['agents'][_0x251ce5[_0x17fc('0x18')]]){this['channels'][_0x251ce5[_0x17fc('0x2c')]]={'queue':_0x251ce5['queue'],'interface':_0x251ce5[_0x17fc('0x18')],'destlinkedid':_0x251ce5[_0x17fc('0x23')]};}}}catch(_0x58bd30){logger[_0x17fc('0x30')](_0x17fc('0x3b'),_0x58bd30['message']);}};Acw[_0x17fc('0x17')][_0x17fc('0x14')]=function(_0xdaeae4){try{if(this[_0x17fc('0x6')][_0xdaeae4[_0x17fc('0x19')]]&&(this[_0x17fc('0x6')][_0xdaeae4[_0x17fc('0x19')]][_0x17fc('0x4')]||this[_0x17fc('0x6')][_0xdaeae4[_0x17fc('0x19')]][_0x17fc('0x1b')])){if(this[_0x17fc('0x7')][_0xdaeae4[_0x17fc('0x18')]]){this[_0x17fc('0x9')][_0xdaeae4[_0x17fc('0x2c')]]={'queue':_0xdaeae4['queue'],'interface':_0xdaeae4[_0x17fc('0x18')]};}}}catch(_0x345994){logger[_0x17fc('0x30')](_0x17fc('0x3c'),_0x345994[_0x17fc('0x33')]);}};Acw['prototype'][_0x17fc('0x3d')]=function(_0x51154c){try{if(this[_0x17fc('0x9')][_0x51154c['uniqueid']]&&_[_0x17fc('0x3e')](this[_0x17fc('0x9')][_0x51154c[_0x17fc('0x2c')]][_0x17fc('0x3f')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x51154c['uniqueid']);this[_0x17fc('0x40')](_0x51154c[_0x17fc('0x2c')]);}else if(this[_0x17fc('0x9')][_0x51154c[_0x17fc('0x41')]]&&_[_0x17fc('0x3e')](this[_0x17fc('0x9')][_0x51154c[_0x17fc('0x41')]][_0x17fc('0x3f')])){logger['info'](_0x17fc('0x42'),_0x51154c[_0x17fc('0x41')]);this['startAcw'](_0x51154c['linkedid']);}}catch(_0x472e5c){logger[_0x17fc('0x30')]('[ACW][syncHangupRequest]\x20%s',_0x472e5c[_0x17fc('0x33')]);}};Acw['prototype']['syncHangup']=function(_0x4fa3d2){try{if(this[_0x17fc('0x9')][_0x4fa3d2[_0x17fc('0x2c')]]&&this['channels'][_0x4fa3d2[_0x17fc('0x2c')]][_0x17fc('0x3f')]){logger['info'](_0x17fc('0x43'),_0x4fa3d2[_0x17fc('0x2c')]);this[_0x17fc('0x40')](_0x4fa3d2[_0x17fc('0x2c')]);}else if(this[_0x17fc('0x9')][_0x4fa3d2[_0x17fc('0x41')]]&&this[_0x17fc('0x9')][_0x4fa3d2[_0x17fc('0x41')]][_0x17fc('0x3f')]){logger[_0x17fc('0x21')](_0x17fc('0x44'),_0x4fa3d2[_0x17fc('0x41')]);this[_0x17fc('0x40')](_0x4fa3d2[_0x17fc('0x41')]);}}catch(_0x8098d6){logger['error']('[ACW][syncHangup]\x20%s',_0x8098d6[_0x17fc('0x33')]);}};Acw[_0x17fc('0x17')][_0x17fc('0x45')]=function(_0x53abf7){try{if(!_[_0x17fc('0x46')](this[_0x17fc('0x9')][_0x53abf7[_0x17fc('0x47')]])){this[_0x17fc('0x40')](_0x53abf7[_0x17fc('0x47')]);if(this[_0x17fc('0x9')][_0x53abf7[_0x17fc('0x48')]]){this[_0x17fc('0x9')][_0x53abf7[_0x17fc('0x48')]]['attended']=!![];this['channels'][_0x53abf7[_0x17fc('0x49')]]=this['channels'][_0x53abf7[_0x17fc('0x48')]];delete this[_0x17fc('0x9')][_0x53abf7['secondtransfereruniqueid']];}}else if(!_[_0x17fc('0x46')](this['channels'][_0x53abf7[_0x17fc('0x49')]])){this[_0x17fc('0x40')](_0x53abf7[_0x17fc('0x49')]);if(this[_0x17fc('0x9')][_0x53abf7[_0x17fc('0x4a')]]){this[_0x17fc('0x9')][_0x53abf7[_0x17fc('0x4a')]]['attended']=!![];this[_0x17fc('0x9')][_0x53abf7[_0x17fc('0x47')]]=this['channels'][_0x53abf7[_0x17fc('0x4a')]];delete this['channels'][_0x53abf7[_0x17fc('0x4a')]];}}}catch(_0x5a8ed4){logger[_0x17fc('0x30')]('[ACW][syncAttendedTransfer]\x20%s',_0x5a8ed4['message']);}};Acw[_0x17fc('0x17')][_0x17fc('0x4b')]=function(_0x24c227){try{if(this[_0x17fc('0x9')][_0x24c227['transfereruniqueid']]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x17fc('0x39')](_0x24c227[_0x17fc('0x4c')]));this[_0x17fc('0x40')](_0x24c227[_0x17fc('0x4c')]);}else if(this[_0x17fc('0x9')][_0x24c227[_0x17fc('0x4d')]]){logger[_0x17fc('0x21')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x17fc('0x39')](_0x24c227['transfererlinkedid']));this[_0x17fc('0x40')](_0x24c227[_0x17fc('0x4d')]);}}catch(_0x4ff196){logger[_0x17fc('0x30')](_0x17fc('0x4e'),_0x4ff196['message']);}};Acw[_0x17fc('0x17')]['syncAgentRingNoAnswer']=function(_0x138ca7){try{if(this[_0x17fc('0x6')][_0x138ca7[_0x17fc('0x19')]]&&this[_0x17fc('0x6')][_0x138ca7[_0x17fc('0x19')]]['autopause']===_0x17fc('0x4f')){if(this['agents'][_0x138ca7[_0x17fc('0x18')]]){logger[_0x17fc('0x21')](_0x17fc('0x50'),_0x138ca7[_0x17fc('0x2c')],_0x138ca7[_0x17fc('0x18')],_0x138ca7[_0x17fc('0x19')]);return RpcUser[_0x17fc('0x24')](this[_0x17fc('0x7')][_0x138ca7[_0x17fc('0x18')]],_0x17fc('0x51'),_0x138ca7[_0x17fc('0x2c')]);}}}catch(_0x44d036){logger[_0x17fc('0x30')](_0x17fc('0x52'),_0x44d036[_0x17fc('0x33')]);}};module['exports']=Acw; \ No newline at end of file +var _0x8d77=['name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','[ACW][syncAgentConnect]\x20%s','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','util','lodash','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause'];(function(_0x7c5a9f,_0x364139){var _0x237862=function(_0x574cd8){while(--_0x574cd8){_0x7c5a9f['push'](_0x7c5a9f['shift']());}};_0x237862(++_0x364139);}(_0x8d77,0x12e));var _0x78d7=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x8d77[_0x5783f4];return _0x28e380;};'use strict';var util=require(_0x78d7('0x0'));var _=require(_0x78d7('0x1'));var moment=require(_0x78d7('0x2'));var ami=require(_0x78d7('0x3'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x78d7('0x4'));var RpcVoiceAgentReport=require(_0x78d7('0x5'));function Acw(_0x163edc){this[_0x78d7('0x6')]=_0x163edc[_0x78d7('0x6')];this[_0x78d7('0x7')]=_0x163edc['agents'];this[_0x78d7('0x8')]=_0x163edc[_0x78d7('0x8')];this[_0x78d7('0x9')]={};ami['on'](_0x78d7('0xa'),this['syncAgentConnect'][_0x78d7('0xb')](this));ami['on'](_0x78d7('0xc'),this[_0x78d7('0xd')][_0x78d7('0xb')](this));ami['on'](_0x78d7('0xe'),this[_0x78d7('0xf')][_0x78d7('0xb')](this));ami['on'](_0x78d7('0x10'),this[_0x78d7('0x11')][_0x78d7('0xb')](this));ami['on'](_0x78d7('0x12'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x78d7('0x13'),this[_0x78d7('0x14')][_0x78d7('0xb')](this));ami['on'](_0x78d7('0x15'),this['syncAgentConnectPreview'][_0x78d7('0xb')](this));}function getDiff(_0x12785e){var _0x22a79a=moment()['milliseconds'](0x0);var _0x31df3b=moment(_0x12785e)[_0x78d7('0x16')](0x0);return _0x22a79a[_0x78d7('0x17')](_0x31df3b,'seconds');}Acw[_0x78d7('0x18')]['startAcw']=function(_0x479ca1){try{var _0x169c0b=this;var _0x14e7de=this[_0x78d7('0x9')][_0x479ca1][_0x78d7('0x19')];var _0x56bcb3=this['channels'][_0x479ca1][_0x78d7('0x1a')];var _0x51576a=this['voiceQueues'][_0x56bcb3];var _0x1b4742=![];var _0x3bf66e=_0x78d7('0x1b');if(_0x51576a[_0x78d7('0x1c')]){if(_0x51576a[_0x78d7('0x1d')][_0x78d7('0x1e')]){_0x1b4742=!![];_0x3bf66e=_0x51576a[_0x78d7('0x1d')][_0x78d7('0x1e')];}}ami['Action']({'action':_0x78d7('0x1f'),'interface':_0x14e7de,'paused':!![],'reason':_0x3bf66e})[_0x78d7('0x20')](function(_0x2c9852){if(_0x169c0b[_0x78d7('0x7')][_0x14e7de]){return RpcUser[_0x78d7('0x21')](_0x169c0b['agents'][_0x14e7de]['id'])[_0x78d7('0x20')](function(_0x15c0c9){if(_0x15c0c9&&!_0x15c0c9[_0x78d7('0x22')]){logger[_0x78d7('0x23')](_0x78d7('0x24'),_0x479ca1,_0x14e7de,_0x56bcb3);var _0x508397=_0x169c0b[_0x78d7('0x9')][_0x479ca1]['attended']&&_0x169c0b['channels'][_0x479ca1][_0x78d7('0x25')]?_0x169c0b[_0x78d7('0x9')][_0x479ca1]['destlinkedid']:_0x479ca1;return RpcUser[_0x78d7('0x26')](_0x169c0b[_0x78d7('0x7')][_0x14e7de],_0x3bf66e,_0x508397)[_0x78d7('0x20')](function(_0xf3bdd1){if(!_0x1b4742){_0x169c0b[_0x78d7('0x8')][_0x14e7de]={};logger['info'](_0x78d7('0x27'),_0x479ca1,_0x169c0b['voiceQueues'][_0x56bcb3][_0x78d7('0x28')],_0x14e7de,_0x56bcb3);_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x29')]=setTimeout(_0x169c0b[_0x78d7('0x2a')][_0x78d7('0xb')](_0x169c0b,_0x14e7de),_0x169c0b['voiceQueues'][_0x56bcb3][_0x78d7('0x28')]*0x3e8);_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2b')]=moment()[_0x78d7('0x2c')](_0x78d7('0x2d'));_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2e')]=_0x479ca1;_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x1a')]=_0x56bcb3;_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2f')]=function(){var _0x5948c6=getDiff(_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2b')]);clearTimeout(_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x29')]);_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x29')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x5948c6},_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2e')],_0x14e7de)['then'](function(_0x51a1be){logger[_0x78d7('0x23')](_0x78d7('0x30'),_0x479ca1,_0x5948c6,_0x51a1be);})[_0x78d7('0x31')](function(_0x11e9ef){logger[_0x78d7('0x32')](_0x78d7('0x33'),_0x479ca1,_0x11e9ef);});delete _0x169c0b[_0x78d7('0x8')][_0x14e7de];};}});}else{logger[_0x78d7('0x23')](_0x78d7('0x34'),_0x479ca1,_0x14e7de,_0x56bcb3);}});}})[_0x78d7('0x31')](function(_0x3fbaae){logger['error'](_0x78d7('0x27'),_0x479ca1,_0x169c0b['voiceQueues'][_0x56bcb3][_0x78d7('0x28')],_0x14e7de,_0x56bcb3);})['finally'](function(){delete _0x169c0b[_0x78d7('0x9')][_0x479ca1];});}catch(_0x172223){logger[_0x78d7('0x32')](_0x78d7('0x35'),_0x172223[_0x78d7('0x36')]);}};Acw[_0x78d7('0x18')]['stopAcw']=function(_0xcf29c){try{var _0x511281=this;if(_0x511281[_0x78d7('0x8')][_0xcf29c]){_0x511281[_0x78d7('0x8')][_0xcf29c][_0x78d7('0x29')]=![];var _0x570fc5=_0x511281[_0x78d7('0x8')][_0xcf29c][_0x78d7('0x2e')];var _0x1992b9=_0x511281['timers'][_0xcf29c][_0x78d7('0x1a')];var _0x16ab1d=_0x511281[_0x78d7('0x6')][_0x1992b9][_0x78d7('0x28')];logger[_0x78d7('0x23')](_0x78d7('0x37'),_0x570fc5,_0xcf29c);RpcUser[_0x78d7('0x38')](this['agents'][_0xcf29c]);RpcVoiceAgentReport['update']({'acwtime':_0x16ab1d,'agentacw':!![]},_0x570fc5,_0xcf29c)[_0x78d7('0x20')](function(_0x454c16){logger[_0x78d7('0x23')](_0x78d7('0x30'),_0x570fc5,_0x16ab1d,_0x454c16);})[_0x78d7('0x31')](function(_0x30e27a){logger['error'](_0x78d7('0x33'),_0x570fc5,_0x30e27a);});}else{logger[_0x78d7('0x32')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0xcf29c);if(_0x511281['timers']){logger[_0x78d7('0x23')](_0x78d7('0x39'),JSON[_0x78d7('0x3a')](_0x511281[_0x78d7('0x8')]));}}}catch(_0x54ca54){logger[_0x78d7('0x32')](_0x78d7('0x3b'),_0x54ca54[_0x78d7('0x36')]);}};Acw['prototype'][_0x78d7('0x3c')]=function(_0x17c961){try{if(this[_0x78d7('0x6')][_0x17c961[_0x78d7('0x1a')]]&&(this[_0x78d7('0x6')][_0x17c961[_0x78d7('0x1a')]][_0x78d7('0x3d')]||this[_0x78d7('0x6')][_0x17c961['queue']][_0x78d7('0x1c')])){if(this[_0x78d7('0x7')][_0x17c961['interface']]){this[_0x78d7('0x9')][_0x17c961['uniqueid']]={'queue':_0x17c961[_0x78d7('0x1a')],'interface':_0x17c961[_0x78d7('0x19')],'destlinkedid':_0x17c961[_0x78d7('0x25')]};}}}catch(_0x572c7f){logger[_0x78d7('0x32')](_0x78d7('0x3e'),_0x572c7f['message']);}};Acw[_0x78d7('0x18')]['syncAgentConnectPreview']=function(_0x21514f){try{if(this[_0x78d7('0x6')][_0x21514f[_0x78d7('0x1a')]]&&(this['voiceQueues'][_0x21514f['queue']]['acw']||this[_0x78d7('0x6')][_0x21514f[_0x78d7('0x1a')]][_0x78d7('0x1c')])){if(this['agents'][_0x21514f[_0x78d7('0x19')]]){this['channels'][_0x21514f[_0x78d7('0x2e')]]={'queue':_0x21514f[_0x78d7('0x1a')],'interface':_0x21514f['interface']};}}}catch(_0x199819){logger[_0x78d7('0x32')]('[ACW][syncAgentConnectPreview]\x20%s',_0x199819[_0x78d7('0x36')]);}};Acw[_0x78d7('0x18')][_0x78d7('0xd')]=function(_0x1e1b3e){try{if(this[_0x78d7('0x9')][_0x1e1b3e[_0x78d7('0x2e')]]&&_['isUndefined'](this[_0x78d7('0x9')][_0x1e1b3e[_0x78d7('0x2e')]][_0x78d7('0x3f')])){logger['info'](_0x78d7('0x40'),_0x1e1b3e['uniqueid']);this['startAcw'](_0x1e1b3e[_0x78d7('0x2e')]);}else if(this['channels'][_0x1e1b3e['linkedid']]&&_['isUndefined'](this[_0x78d7('0x9')][_0x1e1b3e[_0x78d7('0x41')]][_0x78d7('0x3f')])){logger[_0x78d7('0x23')]('[%s][HANGUP:LINKEDID]',_0x1e1b3e[_0x78d7('0x41')]);this['startAcw'](_0x1e1b3e[_0x78d7('0x41')]);}}catch(_0x4c1523){logger[_0x78d7('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x4c1523[_0x78d7('0x36')]);}};Acw['prototype'][_0x78d7('0xf')]=function(_0x2bea54){try{if(this[_0x78d7('0x9')][_0x2bea54['uniqueid']]&&this[_0x78d7('0x9')][_0x2bea54[_0x78d7('0x2e')]][_0x78d7('0x3f')]){logger['info'](_0x78d7('0x42'),_0x2bea54[_0x78d7('0x2e')]);this[_0x78d7('0x43')](_0x2bea54[_0x78d7('0x2e')]);}else if(this[_0x78d7('0x9')][_0x2bea54[_0x78d7('0x41')]]&&this[_0x78d7('0x9')][_0x2bea54[_0x78d7('0x41')]][_0x78d7('0x3f')]){logger['info'](_0x78d7('0x44'),_0x2bea54[_0x78d7('0x41')]);this[_0x78d7('0x43')](_0x2bea54['linkedid']);}}catch(_0x57ac3d){logger['error'](_0x78d7('0x45'),_0x57ac3d['message']);}};Acw['prototype']['syncAttendedTransfer']=function(_0xea7fc7){try{if(!_['isNil'](this['channels'][_0xea7fc7[_0x78d7('0x46')]])){this[_0x78d7('0x43')](_0xea7fc7[_0x78d7('0x46')]);if(this[_0x78d7('0x9')][_0xea7fc7['secondtransfereruniqueid']]){this['channels'][_0xea7fc7[_0x78d7('0x47')]][_0x78d7('0x3f')]=!![];this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x48')]]=this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x47')]];delete this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x47')]];}}else if(!_[_0x78d7('0x49')](this['channels'][_0xea7fc7[_0x78d7('0x48')]])){this[_0x78d7('0x43')](_0xea7fc7[_0x78d7('0x48')]);if(this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x4a')]]){this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x4a')]][_0x78d7('0x3f')]=!![];this[_0x78d7('0x9')][_0xea7fc7['transfereeuniqueid']]=this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x4a')]];delete this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x4a')]];}}}catch(_0x47d467){logger[_0x78d7('0x32')](_0x78d7('0x4b'),_0x47d467[_0x78d7('0x36')]);}};Acw['prototype'][_0x78d7('0x14')]=function(_0x15748d){try{if(this[_0x78d7('0x9')][_0x15748d[_0x78d7('0x4c')]]){logger['info'](_0x78d7('0x4d'),JSON['stringify'](_0x15748d['transfereruniqueid']));this['startAcw'](_0x15748d['transfereruniqueid']);}else if(this[_0x78d7('0x9')][_0x15748d[_0x78d7('0x4e')]]){logger[_0x78d7('0x23')](_0x78d7('0x4f'),JSON['stringify'](_0x15748d[_0x78d7('0x4e')]));this['startAcw'](_0x15748d[_0x78d7('0x4e')]);}}catch(_0x3aab7c){logger[_0x78d7('0x32')](_0x78d7('0x50'),_0x3aab7c[_0x78d7('0x36')]);}};Acw[_0x78d7('0x18')][_0x78d7('0x11')]=function(_0x4f2571){try{if(this[_0x78d7('0x6')][_0x4f2571[_0x78d7('0x1a')]]&&this[_0x78d7('0x6')][_0x4f2571[_0x78d7('0x1a')]]['autopause']===_0x78d7('0x51')){if(this[_0x78d7('0x7')][_0x4f2571[_0x78d7('0x19')]]){logger[_0x78d7('0x23')](_0x78d7('0x52'),_0x4f2571[_0x78d7('0x2e')],_0x4f2571[_0x78d7('0x19')],_0x4f2571[_0x78d7('0x1a')]);return RpcUser[_0x78d7('0x26')](this['agents'][_0x4f2571[_0x78d7('0x19')]],'Auto-Pause',_0x4f2571[_0x78d7('0x2e')]);}}}catch(_0x26360c){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x26360c[_0x78d7('0x36')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 9627144..80edce7 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 _0x9e30=['close','shutdown','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','log','exports','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once'];(function(_0x30d3c1,_0xa3da89){var _0x571ee9=function(_0xcbe38d){while(--_0xcbe38d){_0x30d3c1['push'](_0x30d3c1['shift']());}};_0x571ee9(++_0xa3da89);}(_0x9e30,0x12f));var _0x09e3=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x9e30[_0x96f74c];return _0x379222;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0x09e3('0x0'));var util=require(_0x09e3('0x1'));var _=require(_0x09e3('0x2'));var logger=require(_0x09e3('0x3'))(_0x09e3('0x4'));var config=require(_0x09e3('0x5'));var ami=new Manager(config['asterisk']['port'],config[_0x09e3('0x6')]['ip'],config['asterisk'][_0x09e3('0x7')],config[_0x09e3('0x6')][_0x09e3('0x8')],!![]);ami[_0x09e3('0x9')]();ami[_0x09e3('0xa')]=BPromise[_0x09e3('0xb')](ami[_0x09e3('0xc')]);function error(_0x227f76){logger[_0x09e3('0xd')](util[_0x09e3('0xe')](_0x09e3('0xf'),config[_0x09e3('0x6')][_0x09e3('0x7')],config[_0x09e3('0x6')]['ip'],config[_0x09e3('0x6')][_0x09e3('0x10')],util[_0x09e3('0x11')](_0x227f76,![],null)));}function close(){logger[_0x09e3('0xd')](util['format'](_0x09e3('0x12'),config[_0x09e3('0x6')]['username'],config[_0x09e3('0x6')]['ip'],config[_0x09e3('0x6')][_0x09e3('0x10')]));}ami[_0x09e3('0x13')]=function(){return function(){return ami['Action']({'action':_0x09e3('0x14')});};};ami[_0x09e3('0x15')]=function(){return function(){return ami[_0x09e3('0xa')]({'action':_0x09e3('0x16')});};};ami[_0x09e3('0x17')]=function(){return function(){return ami[_0x09e3('0xa')]({'action':'sippeerstatus'});};};ami[_0x09e3('0x18')]=function(){return function(){return ami[_0x09e3('0xa')]({'action':_0x09e3('0x19')});};};ami[_0x09e3('0x1a')]=function(){return function(){return ami[_0x09e3('0xa')]({'action':'coreshowchannels'});};};function connect(_0x78d050){logger[_0x09e3('0x1b')](util[_0x09e3('0xe')](_0x09e3('0x1c'),config['asterisk']['username'],config[_0x09e3('0x6')]['ip'],config[_0x09e3('0x6')][_0x09e3('0x10')]));ami[_0x09e3('0x1d')](_0x09e3('0xd'),error);ami[_0x09e3('0x1d')](_0x09e3('0x1e'),close);}ami['on']('connect',connect);ami['on'](_0x09e3('0x1f'),function(_0x35e37f){logger['info'](util[_0x09e3('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x09e3('0x6')][_0x09e3('0x7')],config[_0x09e3('0x6')]['ip'],config[_0x09e3('0x6')][_0x09e3('0x10')],util[_0x09e3('0x11')](_0x35e37f,![],null)));});ami['on']('fullybooted',function(_0x5eed50){logger['info'](util['format'](_0x09e3('0x20'),config[_0x09e3('0x6')][_0x09e3('0x7')],config[_0x09e3('0x6')]['ip'],config['asterisk']['port']));return BPromise[_0x09e3('0x21')]()[_0x09e3('0x22')](ami[_0x09e3('0x13')]())[_0x09e3('0x22')](ami[_0x09e3('0x15')]())[_0x09e3('0x22')](ami[_0x09e3('0x17')]())[_0x09e3('0x22')](ami[_0x09e3('0x18')]())[_0x09e3('0x22')](ami[_0x09e3('0x1a')]())['catch'](function(_0x284cf8){console[_0x09e3('0x23')](_0x284cf8);});});ami[_0x09e3('0x1d')](_0x09e3('0xd'),error);ami[_0x09e3('0x1d')](_0x09e3('0x1e'),close);module[_0x09e3('0x24')]=ami; \ No newline at end of file +var _0x3679=['username','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','fullybooted','resolve','then','catch','log','exports','asterisk-manager','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x3679,0x174));var _0x9367=function(_0x22cb94,_0x150f16){_0x22cb94=_0x22cb94-0x0;var _0x231ed5=_0x3679[_0x22cb94];return _0x231ed5;};'use strict';var Manager=require(_0x9367('0x0'));var BPromise=require('bluebird');var moment=require(_0x9367('0x1'));var util=require(_0x9367('0x2'));var _=require(_0x9367('0x3'));var logger=require(_0x9367('0x4'))(_0x9367('0x5'));var config=require(_0x9367('0x6'));var ami=new Manager(config[_0x9367('0x7')]['port'],config['asterisk']['ip'],config['asterisk'][_0x9367('0x8')],config[_0x9367('0x7')][_0x9367('0x9')],!![]);ami['keepConnected']();ami[_0x9367('0xa')]=BPromise[_0x9367('0xb')](ami[_0x9367('0xc')]);function error(_0x269ecd){logger[_0x9367('0xd')](util[_0x9367('0xe')](_0x9367('0xf'),config[_0x9367('0x7')][_0x9367('0x8')],config['asterisk']['ip'],config[_0x9367('0x7')][_0x9367('0x10')],util[_0x9367('0x11')](_0x269ecd,![],null)));}function close(){logger[_0x9367('0xd')](util['format'](_0x9367('0x12'),config[_0x9367('0x7')][_0x9367('0x8')],config[_0x9367('0x7')]['ip'],config['asterisk']['port']));}ami[_0x9367('0x13')]=function(){return function(){return ami[_0x9367('0xa')]({'action':'sipshowregistry'});};};ami[_0x9367('0x14')]=function(){return function(){return ami[_0x9367('0xa')]({'action':_0x9367('0x15')});};};ami[_0x9367('0x16')]=function(){return function(){return ami[_0x9367('0xa')]({'action':'sippeerstatus'});};};ami[_0x9367('0x17')]=function(){return function(){return ami[_0x9367('0xa')]({'action':_0x9367('0x18')});};};ami[_0x9367('0x19')]=function(){return function(){return ami[_0x9367('0xa')]({'action':'coreshowchannels'});};};function connect(_0x19abac){logger['info'](util[_0x9367('0xe')](_0x9367('0x1a'),config['asterisk']['username'],config[_0x9367('0x7')]['ip'],config[_0x9367('0x7')]['port']));ami[_0x9367('0x1b')](_0x9367('0xd'),error);ami['once'](_0x9367('0x1c'),close);}ami['on'](_0x9367('0x1d'),connect);ami['on'](_0x9367('0x1e'),function(_0xc20d0a){logger[_0x9367('0x1f')](util[_0x9367('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x9367('0x7')]['username'],config['asterisk']['ip'],config[_0x9367('0x7')][_0x9367('0x10')],util['inspect'](_0xc20d0a,![],null)));});ami['on'](_0x9367('0x20'),function(_0x2c7296){logger['info'](util[_0x9367('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x9367('0x7')][_0x9367('0x8')],config[_0x9367('0x7')]['ip'],config[_0x9367('0x7')]['port']));return BPromise[_0x9367('0x21')]()['then'](ami[_0x9367('0x13')]())[_0x9367('0x22')](ami[_0x9367('0x14')]())[_0x9367('0x22')](ami[_0x9367('0x16')]())['then'](ami[_0x9367('0x17')]())[_0x9367('0x22')](ami[_0x9367('0x19')]())[_0x9367('0x23')](function(_0x2115dc){console[_0x9367('0x24')](_0x2115dc);});});ami[_0x9367('0x1b')](_0x9367('0xd'),error);ami[_0x9367('0x1b')](_0x9367('0x1c'),close);module[_0x9367('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 0dc9444..1bac4e6 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 _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x19a562,_0x4b669f){var _0x3bd3f3=function(_0x482255){while(--_0x482255){_0x19a562['push'](_0x19a562['shift']());}};_0x3bd3f3(++_0x4b669f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1fe263,_0xd067a3){_0x1fe263=_0x1fe263-0x0;var _0x41d66f=_0xb43b[_0x1fe263];return _0x41d66f;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x1f2975,_0x4b7320){var _0x150c9b=function(_0x4dbcdf){while(--_0x4dbcdf){_0x1f2975['push'](_0x1f2975['shift']());}};_0x150c9b(++_0x4b7320);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x539709,_0x2c9edd){_0x539709=_0x539709-0x0;var _0x73cc7e=_0xbdb7[_0x539709];return _0x73cc7e;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index f3f64e2..74b2174 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 _0x9218=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','exports','util','lodash','moment','isNil','string','uniqueid','phone','Contact','firstName','lastName','number','queue','name','active','type','dialQueueTimeout'];(function(_0x1703f1,_0x532eab){var _0x1f853f=function(_0x5d5865){while(--_0x5d5865){_0x1703f1['push'](_0x1703f1['shift']());}};_0x1f853f(++_0x532eab);}(_0x9218,0xa4));var _0x8921=function(_0x3b4060,_0x594530){_0x3b4060=_0x3b4060-0x0;var _0x5e55c0=_0x9218[_0x3b4060];return _0x5e55c0;};'use strict';var util=require(_0x8921('0x0'));var _=require(_0x8921('0x1'));var moment=require(_0x8921('0x2'));function checkNameSurname(_0x4ea707,_0x32b851,_0x6fe60){var _0x2da29e='';if(!_[_0x8921('0x3')](_0x32b851)&&_0x8921('0x4')===typeof _0x32b851){_0x2da29e+=_0x32b851;}if(!_[_0x8921('0x3')](_0x6fe60)&&_0x8921('0x4')===typeof _0x6fe60){_0x2da29e+='\x20'+_0x6fe60;}if(_0x2da29e!==''){return _0x2da29e;}return _0x4ea707;}function Action(_0x55d28f,_0x432b74,_0x358d7f){this['voiceQueue']=_0x55d28f;this[_0x8921('0x5')]=_0x358d7f||undefined;this['name']=checkNameSurname(_0x432b74['Contact'][_0x8921('0x6')],_0x432b74[_0x8921('0x7')][_0x8921('0x8')],_0x432b74['Contact'][_0x8921('0x9')]);this[_0x8921('0xa')]=_0x432b74[_0x8921('0x7')]['phone'];this[_0x8921('0xb')]=_0x55d28f[_0x8921('0xc')];this[_0x8921('0xd')]=_0x432b74['active']||![];this[_0x8921('0xe')]=_0x55d28f['type'];this[_0x8921('0xf')]=_0x55d28f['dialQueueTimeout']||0x3;this[_0x8921('0x10')]=_0x432b74[_0x8921('0x10')];this[_0x8921('0x11')]=_0x432b74[_0x8921('0x11')];this[_0x8921('0x12')]=_0x432b74[_0x8921('0x12')];this[_0x8921('0x13')]=_0x432b74[_0x8921('0x13')];this[_0x8921('0x14')]=_0x432b74['countnosuchnumberretry'];this[_0x8921('0x15')]=_0x432b74[_0x8921('0x15')];this[_0x8921('0x16')]=_0x432b74[_0x8921('0x16')];this['countmachineretry']=_0x432b74[_0x8921('0x17')];this[_0x8921('0x18')]=_0x432b74[_0x8921('0x18')];this['ContactId']=_0x432b74[_0x8921('0x19')];this[_0x8921('0x1a')]=_0x432b74[_0x8921('0x1a')];this['UserId']=_0x432b74[_0x8921('0x1b')];this[_0x8921('0x1c')]=_0x432b74[_0x8921('0x1c')];this[_0x8921('0x1d')]=_0x432b74[_0x8921('0x1d')];this['idHopper']=_0x432b74['id'];this[_0x8921('0x1e')]=_0x432b74['Contact']['firstName']||'';this['starttime']=moment()['format'](_0x8921('0x1f'));this[_0x8921('0x20')]=_0x432b74[_0x8921('0x20')];this[_0x8921('0x21')]=_0x432b74[_0x8921('0x21')];this['callbackat']=_0x432b74[_0x8921('0x22')];this[_0x8921('0x23')]=_0x432b74['recallme'];this[_0x8921('0x24')]='';this['originatecalleridname']='';}Action[_0x8921('0x25')][_0x8921('0x26')]=function(){return util[_0x8921('0x27')](_0x8921('0x28'),this[_0x8921('0xc')],this[_0x8921('0x29')][_0x8921('0x2a')]>0x0?this[_0x8921('0xa')][_0x8921('0x2b')](this[_0x8921('0x29')][_0x8921('0x2a')]):this[_0x8921('0xa')]);};Action[_0x8921('0x25')]['getQueue']=function(){return this['queue'];};module[_0x8921('0x2c')]=Action; \ No newline at end of file +var _0x7a06=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','number','getQueue','queue','exports','util','lodash','moment','isNil','string','name','Contact','phone','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry'];(function(_0x762a11,_0x2867b3){var _0x4f6ca1=function(_0x5241f8){while(--_0x5241f8){_0x762a11['push'](_0x762a11['shift']());}};_0x4f6ca1(++_0x2867b3);}(_0x7a06,0x1df));var _0x67a0=function(_0x1e8b65,_0xc0f46e){_0x1e8b65=_0x1e8b65-0x0;var _0x496e5b=_0x7a06[_0x1e8b65];return _0x496e5b;};'use strict';var util=require(_0x67a0('0x0'));var _=require(_0x67a0('0x1'));var moment=require(_0x67a0('0x2'));function checkNameSurname(_0x1a0986,_0x53d5ca,_0x4c87e2){var _0x49e5bb='';if(!_[_0x67a0('0x3')](_0x53d5ca)&&_0x67a0('0x4')===typeof _0x53d5ca){_0x49e5bb+=_0x53d5ca;}if(!_[_0x67a0('0x3')](_0x4c87e2)&&_0x67a0('0x4')===typeof _0x4c87e2){_0x49e5bb+='\x20'+_0x4c87e2;}if(_0x49e5bb!==''){return _0x49e5bb;}return _0x1a0986;}function Action(_0x17f840,_0x17f8e7,_0xaac035){this['voiceQueue']=_0x17f840;this['uniqueid']=_0xaac035||undefined;this[_0x67a0('0x5')]=checkNameSurname(_0x17f8e7[_0x67a0('0x6')][_0x67a0('0x7')],_0x17f8e7[_0x67a0('0x6')][_0x67a0('0x8')],_0x17f8e7[_0x67a0('0x6')][_0x67a0('0x9')]);this['number']=_0x17f8e7[_0x67a0('0x6')][_0x67a0('0x7')];this['queue']=_0x17f840['name'];this['active']=_0x17f8e7[_0x67a0('0xa')]||![];this[_0x67a0('0xb')]=_0x17f840[_0x67a0('0xb')];this[_0x67a0('0xc')]=_0x17f840[_0x67a0('0xc')]||0x3;this[_0x67a0('0xd')]=_0x17f8e7[_0x67a0('0xd')];this[_0x67a0('0xe')]=_0x17f8e7[_0x67a0('0xe')];this[_0x67a0('0xf')]=_0x17f8e7[_0x67a0('0xf')];this[_0x67a0('0x10')]=_0x17f8e7['countnoanswerretry'];this[_0x67a0('0x11')]=_0x17f8e7[_0x67a0('0x11')];this[_0x67a0('0x12')]=_0x17f8e7['countdropretry'];this[_0x67a0('0x13')]=_0x17f8e7[_0x67a0('0x13')];this[_0x67a0('0x14')]=_0x17f8e7[_0x67a0('0x14')];this['countagentrejectretry']=_0x17f8e7[_0x67a0('0x15')];this[_0x67a0('0x16')]=_0x17f8e7[_0x67a0('0x16')];this['ListId']=_0x17f8e7['ListId'];this[_0x67a0('0x17')]=_0x17f8e7[_0x67a0('0x17')];this[_0x67a0('0x18')]=_0x17f8e7[_0x67a0('0x18')];this[_0x67a0('0x19')]=_0x17f8e7[_0x67a0('0x19')];this[_0x67a0('0x1a')]=_0x17f8e7['id'];this[_0x67a0('0x1b')]=_0x17f8e7['Contact'][_0x67a0('0x8')]||'';this[_0x67a0('0x1c')]=moment()[_0x67a0('0x1d')](_0x67a0('0x1e'));this[_0x67a0('0x1f')]=_0x17f8e7['callback'];this[_0x67a0('0x20')]=_0x17f8e7['callbackuniqueid'];this[_0x67a0('0x21')]=_0x17f8e7['callbackat'];this['recallme']=_0x17f8e7[_0x67a0('0x22')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x67a0('0x23')][_0x67a0('0x24')]=function(){return util[_0x67a0('0x1d')](_0x67a0('0x25'),this[_0x67a0('0x5')],this[_0x67a0('0x26')][_0x67a0('0x27')]>0x0?this['number'][_0x67a0('0x28')](this[_0x67a0('0x26')][_0x67a0('0x27')]):this[_0x67a0('0x29')]);};Action[_0x67a0('0x23')][_0x67a0('0x2a')]=function(){return this[_0x67a0('0x2b')];};module[_0x67a0('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index f861152..e648347 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 _0x4d4e=['util','moment','milliseconds','diff','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x3ee679,_0xacf3be){var _0x4abbb8=function(_0x5b815a){while(--_0x5b815a){_0x3ee679['push'](_0x3ee679['shift']());}};_0x4abbb8(++_0xacf3be);}(_0x4d4e,0xa4));var _0xe4d4=function(_0x486eea,_0x2f72ef){_0x486eea=_0x486eea-0x0;var _0x58b148=_0x4d4e[_0x486eea];return _0x58b148;};'use strict';var util=require(_0xe4d4('0x0'));var _=require('lodash');var moment=require(_0xe4d4('0x1'));function getSeconds(_0x3550ca,_0x5a9c2c){var _0x1359db=moment(_0x3550ca)[_0xe4d4('0x2')](0x0);var _0x1fc0de=moment(_0x5a9c2c)[_0xe4d4('0x2')](0x0);return _0x1359db[_0xe4d4('0x3')](_0x1fc0de,'seconds');}function AgentComplete(_0x57550c,_0x33959d){this['state']=0x4;this['statedesc']='Answer';this[_0xe4d4('0x4')]=_0x57550c[_0xe4d4('0x4')];this[_0xe4d4('0x5')]=_0x57550c[_0xe4d4('0x5')];this[_0xe4d4('0x6')]=_0x57550c['type']==='outbound'?_0xe4d4('0x7'):_0x57550c[_0xe4d4('0x5')];this[_0xe4d4('0x8')]=_0x57550c[_0xe4d4('0x8')];this[_0xe4d4('0x9')]=_0x57550c[_0xe4d4('0x9')];this[_0xe4d4('0xa')]=_0x57550c[_0xe4d4('0xa')];this['countglobal']=_0x57550c[_0xe4d4('0x8')]+_0x57550c[_0xe4d4('0x9')]+_0x57550c[_0xe4d4('0xa')]+_0x57550c['countnosuchnumberretry']+_0x57550c[_0xe4d4('0xb')]+_0x57550c[_0xe4d4('0xc')]+_0x57550c[_0xe4d4('0xd')]+_0x57550c[_0xe4d4('0xe')];this['countnosuchnumberretry']=_0x57550c['countnosuchnumberretry'];this[_0xe4d4('0xb')]=_0x57550c['countdropretry'];this[_0xe4d4('0xc')]=_0x57550c[_0xe4d4('0xc')];this['countmachineretry']=_0x57550c[_0xe4d4('0xd')];this[_0xe4d4('0xe')]=_0x57550c[_0xe4d4('0xe')];this[_0xe4d4('0xf')]=_0x33959d[_0xe4d4('0xf')];this[_0xe4d4('0x10')]=_0x57550c[_0xe4d4('0x11')];this[_0xe4d4('0x12')]=_0x57550c[_0xe4d4('0x13')];this[_0xe4d4('0x14')]=_0x57550c['starttime'];this[_0xe4d4('0x15')]=_0x57550c[_0xe4d4('0x15')];this[_0xe4d4('0x16')]=_0x57550c[_0xe4d4('0x16')];this[_0xe4d4('0x17')]=moment()[_0xe4d4('0x18')](_0xe4d4('0x19'));this[_0xe4d4('0x1a')]=getSeconds(_0x57550c[_0xe4d4('0x15')],_0x57550c[_0xe4d4('0x14')]);this[_0xe4d4('0x1b')]=getSeconds(_0x57550c[_0xe4d4('0x16')],_0x57550c[_0xe4d4('0x15')]);this[_0xe4d4('0x1c')]=getSeconds(this[_0xe4d4('0x17')],_0x57550c['answertime']);this[_0xe4d4('0x7')]=_0x33959d['queue'];this['membername']=_0x33959d['membername'];this[_0xe4d4('0x1d')]=_0x33959d[_0xe4d4('0x1d')];this['callback']=_0x57550c[_0xe4d4('0x1e')];this['callbackuniqueid']=_0x57550c[_0xe4d4('0x1f')];this['callbackat']=_0x57550c[_0xe4d4('0x20')];this['recallme']=_0x57550c[_0xe4d4('0x21')];this[_0xe4d4('0x22')]=_0x57550c['ContactId'];this[_0xe4d4('0x23')]=_0x57550c[_0xe4d4('0x23')];this[_0xe4d4('0x24')]=_0x57550c['UserId'];this[_0xe4d4('0x25')]=_0x57550c[_0xe4d4('0x25')];this['CampaignId']=_0x57550c[_0xe4d4('0x26')];this['originatecalleridnum']=_0x57550c[_0xe4d4('0x27')]||'';this['originatecalleridname']=_0x57550c[_0xe4d4('0x28')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xf500=['answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','state','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x10bcc4,_0x4400e2){var _0x2da988=function(_0x2ee849){while(--_0x2ee849){_0x10bcc4['push'](_0x10bcc4['shift']());}};_0x2da988(++_0x4400e2);}(_0xf500,0x9a));var _0x0f50=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0xf500[_0x50e593];return _0x3821d0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0f50('0x0'));function getSeconds(_0xcb7afc,_0x3ef919){var _0x27ce55=moment(_0xcb7afc)[_0x0f50('0x1')](0x0);var _0x335478=moment(_0x3ef919)['milliseconds'](0x0);return _0x27ce55[_0x0f50('0x2')](_0x335478,_0x0f50('0x3'));}function AgentComplete(_0x397c0b,_0x3ce2f2){this[_0x0f50('0x4')]=0x4;this['statedesc']=_0x0f50('0x5');this['scheduledat']=_0x397c0b['scheduledat'];this[_0x0f50('0x6')]=_0x397c0b[_0x0f50('0x6')];this[_0x0f50('0x7')]=_0x397c0b['type']===_0x0f50('0x8')?_0x0f50('0x9'):_0x397c0b[_0x0f50('0x6')];this[_0x0f50('0xa')]=_0x397c0b[_0x0f50('0xa')];this['countcongestionretry']=_0x397c0b[_0x0f50('0xb')];this[_0x0f50('0xc')]=_0x397c0b[_0x0f50('0xc')];this[_0x0f50('0xd')]=_0x397c0b[_0x0f50('0xa')]+_0x397c0b[_0x0f50('0xb')]+_0x397c0b[_0x0f50('0xc')]+_0x397c0b[_0x0f50('0xe')]+_0x397c0b[_0x0f50('0xf')]+_0x397c0b[_0x0f50('0x10')]+_0x397c0b['countmachineretry']+_0x397c0b[_0x0f50('0x11')];this['countnosuchnumberretry']=_0x397c0b['countnosuchnumberretry'];this[_0x0f50('0xf')]=_0x397c0b[_0x0f50('0xf')];this[_0x0f50('0x10')]=_0x397c0b[_0x0f50('0x10')];this['countmachineretry']=_0x397c0b[_0x0f50('0x12')];this['countagentrejectretry']=_0x397c0b['countagentrejectretry'];this[_0x0f50('0x13')]=_0x3ce2f2[_0x0f50('0x13')];this[_0x0f50('0x14')]=_0x397c0b[_0x0f50('0x15')];this[_0x0f50('0x16')]=_0x397c0b[_0x0f50('0x17')];this[_0x0f50('0x18')]=_0x397c0b[_0x0f50('0x18')];this[_0x0f50('0x19')]=_0x397c0b[_0x0f50('0x19')];this[_0x0f50('0x1a')]=_0x397c0b[_0x0f50('0x1a')];this['endtime']=moment()[_0x0f50('0x1b')](_0x0f50('0x1c'));this[_0x0f50('0x1d')]=getSeconds(_0x397c0b[_0x0f50('0x19')],_0x397c0b[_0x0f50('0x18')]);this[_0x0f50('0x1e')]=getSeconds(_0x397c0b['answertime'],_0x397c0b[_0x0f50('0x19')]);this[_0x0f50('0x1f')]=getSeconds(this[_0x0f50('0x20')],_0x397c0b[_0x0f50('0x1a')]);this['queue']=_0x3ce2f2['queue'];this['membername']=_0x3ce2f2[_0x0f50('0x21')];this[_0x0f50('0x22')]=_0x3ce2f2['reason'];this[_0x0f50('0x23')]=_0x397c0b['callback'];this[_0x0f50('0x24')]=_0x397c0b['callbackuniqueid'];this[_0x0f50('0x25')]=_0x397c0b['callbackat'];this[_0x0f50('0x26')]=_0x397c0b['recallme'];this[_0x0f50('0x27')]=_0x397c0b[_0x0f50('0x27')];this['ListId']=_0x397c0b['ListId'];this['UserId']=_0x397c0b[_0x0f50('0x28')];this['VoiceQueueId']=_0x397c0b[_0x0f50('0x29')];this[_0x0f50('0x2a')]=_0x397c0b[_0x0f50('0x2a')];this[_0x0f50('0x2b')]=_0x397c0b[_0x0f50('0x2b')]||'';this[_0x0f50('0x2c')]=_0x397c0b[_0x0f50('0x2c')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 8c27c02..c861006 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 _0x31f0=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime'];(function(_0x3a3fba,_0x3ab050){var _0x48fa0f=function(_0x1e63f2){while(--_0x1e63f2){_0x3a3fba['push'](_0x3a3fba['shift']());}};_0x48fa0f(++_0x3ab050);}(_0x31f0,0xb7));var _0x031f=function(_0x4c45b3,_0x39f33b){_0x4c45b3=_0x4c45b3-0x0;var _0x4ba3ea=_0x31f0[_0x4c45b3];return _0x4ba3ea;};'use strict';var util=require(_0x031f('0x0'));var _=require('lodash');var moment=require(_0x031f('0x1'));function getSeconds(_0x50a1ab,_0x3747a5){var _0x2021ea=moment(_0x50a1ab)[_0x031f('0x2')](0x0);var _0xf20620=moment(_0x3747a5)['milliseconds'](0x0);return _0x2021ea[_0x031f('0x3')](_0xf20620,_0x031f('0x4'));}function Final(_0x4f6059){this['uniqueid']=_0x4f6059['uniqueid'];this[_0x031f('0x5')]=_0x4f6059['scheduledat'];this[_0x031f('0x6')]=_0x4f6059[_0x031f('0x6')];this[_0x031f('0x7')]=_0x4f6059[_0x031f('0x6')]==='outbound'?_0x031f('0x8'):_0x4f6059[_0x031f('0x6')];this[_0x031f('0x9')]=_0x4f6059[_0x031f('0x9')];this[_0x031f('0xa')]=_0x4f6059[_0x031f('0xa')];this[_0x031f('0xb')]=_0x4f6059[_0x031f('0xb')];this['countglobal']=_0x4f6059[_0x031f('0x9')]+_0x4f6059[_0x031f('0xa')]+_0x4f6059[_0x031f('0xb')]+_0x4f6059[_0x031f('0xc')]+_0x4f6059[_0x031f('0xd')]+_0x4f6059[_0x031f('0xe')]+_0x4f6059[_0x031f('0xf')]+_0x4f6059['countagentrejectretry'];this[_0x031f('0xc')]=_0x4f6059[_0x031f('0xc')];this[_0x031f('0xd')]=_0x4f6059[_0x031f('0xd')];this[_0x031f('0xe')]=_0x4f6059['countabandonedretry'];this['countmachineretry']=_0x4f6059[_0x031f('0xf')];this[_0x031f('0x10')]=_0x4f6059[_0x031f('0x10')];this[_0x031f('0x8')]=_0x4f6059['queue'];this[_0x031f('0x11')]=_0x4f6059[_0x031f('0x11')];this['calleridnum']=_0x4f6059[_0x031f('0x12')];this['starttime']=_0x4f6059[_0x031f('0x13')];this[_0x031f('0x14')]=_0x4f6059[_0x031f('0x14')];this[_0x031f('0x15')]=_0x4f6059[_0x031f('0x14')];this[_0x031f('0x16')]=_0x4f6059[_0x031f('0x16')]||0x0;this[_0x031f('0x17')]=_0x4f6059[_0x031f('0x17')]||0x0;this[_0x031f('0x18')]=_0x4f6059[_0x031f('0x18')]||0x0;this['callback']=_0x4f6059[_0x031f('0x19')];this[_0x031f('0x1a')]=_0x4f6059[_0x031f('0x1a')];this['callbackat']=_0x4f6059['callbackat'];this[_0x031f('0x1b')]=_0x4f6059['recallme'];this[_0x031f('0x1c')]=_0x4f6059['ContactId'];this['ListId']=_0x4f6059['ListId'];this[_0x031f('0x1d')]=_0x4f6059[_0x031f('0x1d')];this[_0x031f('0x1e')]=_0x4f6059[_0x031f('0x1e')];this['CampaignId']=_0x4f6059[_0x031f('0x1f')];this['originatecalleridnum']=_0x4f6059[_0x031f('0x20')]||'';this[_0x031f('0x21')]=_0x4f6059[_0x031f('0x21')]||'';}module['exports']=Final; \ No newline at end of file +var _0xbd50=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xbd50,0x196));var _0x0bd5=function(_0x2a64cd,_0x351e77){_0x2a64cd=_0x2a64cd-0x0;var _0x1ff227=_0xbd50[_0x2a64cd];return _0x1ff227;};'use strict';var util=require(_0x0bd5('0x0'));var _=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));function getSeconds(_0x4acbd6,_0x44fcb9){var _0x167372=moment(_0x4acbd6)[_0x0bd5('0x3')](0x0);var _0x1e9877=moment(_0x44fcb9)[_0x0bd5('0x3')](0x0);return _0x167372['diff'](_0x1e9877,'seconds');}function Final(_0x560cf1){this[_0x0bd5('0x4')]=_0x560cf1[_0x0bd5('0x4')];this[_0x0bd5('0x5')]=_0x560cf1[_0x0bd5('0x5')];this[_0x0bd5('0x6')]=_0x560cf1['type'];this['campaigntype']=_0x560cf1[_0x0bd5('0x6')]===_0x0bd5('0x7')?_0x0bd5('0x8'):_0x560cf1['type'];this[_0x0bd5('0x9')]=_0x560cf1[_0x0bd5('0x9')];this['countcongestionretry']=_0x560cf1[_0x0bd5('0xa')];this[_0x0bd5('0xb')]=_0x560cf1['countnoanswerretry'];this[_0x0bd5('0xc')]=_0x560cf1[_0x0bd5('0x9')]+_0x560cf1[_0x0bd5('0xa')]+_0x560cf1['countnoanswerretry']+_0x560cf1[_0x0bd5('0xd')]+_0x560cf1[_0x0bd5('0xe')]+_0x560cf1[_0x0bd5('0xf')]+_0x560cf1[_0x0bd5('0x10')]+_0x560cf1[_0x0bd5('0x11')];this[_0x0bd5('0xd')]=_0x560cf1[_0x0bd5('0xd')];this[_0x0bd5('0xe')]=_0x560cf1['countdropretry'];this[_0x0bd5('0xf')]=_0x560cf1[_0x0bd5('0xf')];this['countmachineretry']=_0x560cf1[_0x0bd5('0x10')];this[_0x0bd5('0x11')]=_0x560cf1[_0x0bd5('0x11')];this[_0x0bd5('0x8')]=_0x560cf1['queue'];this[_0x0bd5('0x12')]=_0x560cf1[_0x0bd5('0x12')];this[_0x0bd5('0x13')]=_0x560cf1[_0x0bd5('0x13')];this[_0x0bd5('0x14')]=_0x560cf1[_0x0bd5('0x14')];this[_0x0bd5('0x15')]=_0x560cf1[_0x0bd5('0x15')];this[_0x0bd5('0x16')]=_0x560cf1[_0x0bd5('0x15')];this[_0x0bd5('0x17')]=_0x560cf1[_0x0bd5('0x17')]||0x0;this[_0x0bd5('0x18')]=_0x560cf1[_0x0bd5('0x18')]||0x0;this['talktime']=_0x560cf1['talktime']||0x0;this['callback']=_0x560cf1['callback'];this['callbackuniqueid']=_0x560cf1[_0x0bd5('0x19')];this[_0x0bd5('0x1a')]=_0x560cf1[_0x0bd5('0x1a')];this[_0x0bd5('0x1b')]=_0x560cf1[_0x0bd5('0x1b')];this['ContactId']=_0x560cf1[_0x0bd5('0x1c')];this[_0x0bd5('0x1d')]=_0x560cf1[_0x0bd5('0x1d')];this['UserId']=_0x560cf1[_0x0bd5('0x1e')];this['VoiceQueueId']=_0x560cf1['VoiceQueueId'];this[_0x0bd5('0x1f')]=_0x560cf1[_0x0bd5('0x1f')];this[_0x0bd5('0x20')]=_0x560cf1['originatecalleridnum']||'';this[_0x0bd5('0x21')]=_0x560cf1['originatecalleridname']||'';}module[_0x0bd5('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 9e0efb0..63bdc1f 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 _0xe531=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','endtime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype'];(function(_0xf120e1,_0x485e65){var _0x4273b2=function(_0x390185){while(--_0x390185){_0xf120e1['push'](_0xf120e1['shift']());}};_0x4273b2(++_0x485e65);}(_0xe531,0x1da));var _0x1e53=function(_0x227bfa,_0x51bedc){_0x227bfa=_0x227bfa-0x0;var _0x331aba=_0xe531[_0x227bfa];return _0x331aba;};'use strict';var util=require(_0x1e53('0x0'));var _=require(_0x1e53('0x1'));var moment=require('moment');function getSeconds(_0xf0939f,_0x3c5d98){var _0x496db7=moment(_0xf0939f)[_0x1e53('0x2')](0x0);var _0x489342=moment(_0x3c5d98)[_0x1e53('0x2')](0x0);return _0x496db7['diff'](_0x489342,_0x1e53('0x3'));}function Hangup(_0x396757,_0x3d6e5a){this[_0x1e53('0x4')]=0x4;this[_0x1e53('0x5')]=_0x1e53('0x6');this[_0x1e53('0x7')]=_0x396757[_0x1e53('0x7')];this[_0x1e53('0x8')]=_0x396757[_0x1e53('0x8')];this[_0x1e53('0x9')]=_0x396757[_0x1e53('0x8')]==='outbound'?_0x1e53('0xa'):_0x396757[_0x1e53('0x8')];this['countbusyretry']=_0x396757[_0x1e53('0xb')];this[_0x1e53('0xc')]=_0x396757[_0x1e53('0xc')];this['countnoanswerretry']=_0x396757[_0x1e53('0xd')];this[_0x1e53('0xe')]=_0x396757[_0x1e53('0xb')]+_0x396757[_0x1e53('0xc')]+_0x396757[_0x1e53('0xd')]+_0x396757[_0x1e53('0xf')]+_0x396757[_0x1e53('0x10')]+_0x396757[_0x1e53('0x11')]+_0x396757[_0x1e53('0x12')]+_0x396757[_0x1e53('0x13')];this[_0x1e53('0xf')]=_0x396757['countnosuchnumberretry'];this[_0x1e53('0x10')]=_0x396757[_0x1e53('0x10')];this['countabandonedretry']=_0x396757[_0x1e53('0x11')];this[_0x1e53('0x12')]=_0x396757['countmachineretry'];this['countagentrejectretry']=_0x396757[_0x1e53('0x13')];this[_0x1e53('0x14')]=_0x3d6e5a[_0x1e53('0x14')];this[_0x1e53('0x15')]=_0x396757['name'];this[_0x1e53('0x16')]=_0x396757[_0x1e53('0x17')];this[_0x1e53('0x18')]=_0x396757[_0x1e53('0x18')];this[_0x1e53('0x19')]=_0x396757[_0x1e53('0x19')];this['endtime']=moment()[_0x1e53('0x1a')](_0x1e53('0x1b'));this['ringtime']=getSeconds(_0x396757[_0x1e53('0x19')],_0x396757['starttime']);this[_0x1e53('0x1c')]=0x0;this[_0x1e53('0x1d')]=getSeconds(this[_0x1e53('0x1e')],_0x396757['responsetime']);this['queue']=_0x396757[_0x1e53('0xa')];this['membername']=_0x1e53('0x1f');this[_0x1e53('0x20')]=_0x3d6e5a[_0x1e53('0x21')];this[_0x1e53('0x22')]=_0x396757['callback'];this[_0x1e53('0x23')]=_0x396757[_0x1e53('0x23')];this[_0x1e53('0x24')]=_0x396757[_0x1e53('0x24')];this[_0x1e53('0x25')]=_0x396757[_0x1e53('0x25')];this[_0x1e53('0x26')]=_0x396757[_0x1e53('0x26')];this[_0x1e53('0x27')]=_0x396757['ListId'];this[_0x1e53('0x28')]=_0x396757[_0x1e53('0x28')];this[_0x1e53('0x29')]=_0x396757['VoiceQueueId'];this[_0x1e53('0x2a')]=_0x396757[_0x1e53('0x2a')];}module[_0x1e53('0x2b')]=Hangup; \ No newline at end of file +var _0xf34d=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','moment','milliseconds','seconds'];(function(_0x1d5e59,_0x25e29){var _0x2a0113=function(_0x1ddf2f){while(--_0x1ddf2f){_0x1d5e59['push'](_0x1d5e59['shift']());}};_0x2a0113(++_0x25e29);}(_0xf34d,0x7d));var _0xdf34=function(_0x3ad1eb,_0x10183d){_0x3ad1eb=_0x3ad1eb-0x0;var _0xd99147=_0xf34d[_0x3ad1eb];return _0xd99147;};'use strict';var util=require(_0xdf34('0x0'));var _=require('lodash');var moment=require(_0xdf34('0x1'));function getSeconds(_0x43d02c,_0x555156){var _0x3cb15b=moment(_0x43d02c)[_0xdf34('0x2')](0x0);var _0x513193=moment(_0x555156)[_0xdf34('0x2')](0x0);return _0x3cb15b['diff'](_0x513193,_0xdf34('0x3'));}function Hangup(_0x1c42c8,_0x5d627c){this[_0xdf34('0x4')]=0x4;this[_0xdf34('0x5')]=_0xdf34('0x6');this[_0xdf34('0x7')]=_0x1c42c8[_0xdf34('0x7')];this['type']=_0x1c42c8[_0xdf34('0x8')];this[_0xdf34('0x9')]=_0x1c42c8[_0xdf34('0x8')]===_0xdf34('0xa')?_0xdf34('0xb'):_0x1c42c8['type'];this[_0xdf34('0xc')]=_0x1c42c8[_0xdf34('0xc')];this[_0xdf34('0xd')]=_0x1c42c8[_0xdf34('0xd')];this[_0xdf34('0xe')]=_0x1c42c8[_0xdf34('0xe')];this[_0xdf34('0xf')]=_0x1c42c8[_0xdf34('0xc')]+_0x1c42c8[_0xdf34('0xd')]+_0x1c42c8[_0xdf34('0xe')]+_0x1c42c8[_0xdf34('0x10')]+_0x1c42c8['countdropretry']+_0x1c42c8[_0xdf34('0x11')]+_0x1c42c8[_0xdf34('0x12')]+_0x1c42c8[_0xdf34('0x13')];this[_0xdf34('0x10')]=_0x1c42c8['countnosuchnumberretry'];this[_0xdf34('0x14')]=_0x1c42c8['countdropretry'];this[_0xdf34('0x11')]=_0x1c42c8[_0xdf34('0x11')];this[_0xdf34('0x12')]=_0x1c42c8[_0xdf34('0x12')];this[_0xdf34('0x13')]=_0x1c42c8[_0xdf34('0x13')];this[_0xdf34('0x15')]=_0x5d627c[_0xdf34('0x15')];this['calleridname']=_0x1c42c8['name'];this[_0xdf34('0x16')]=_0x1c42c8[_0xdf34('0x17')];this[_0xdf34('0x18')]=_0x1c42c8[_0xdf34('0x18')];this[_0xdf34('0x19')]=_0x1c42c8['responsetime'];this['endtime']=moment()[_0xdf34('0x1a')](_0xdf34('0x1b'));this[_0xdf34('0x1c')]=getSeconds(_0x1c42c8[_0xdf34('0x19')],_0x1c42c8[_0xdf34('0x18')]);this[_0xdf34('0x1d')]=0x0;this[_0xdf34('0x1e')]=getSeconds(this[_0xdf34('0x1f')],_0x1c42c8[_0xdf34('0x19')]);this[_0xdf34('0xb')]=_0x1c42c8[_0xdf34('0xb')];this[_0xdf34('0x20')]='IVR';this['reason']=_0x5d627c[_0xdf34('0x21')];this[_0xdf34('0x22')]=_0x1c42c8[_0xdf34('0x22')];this[_0xdf34('0x23')]=_0x1c42c8[_0xdf34('0x23')];this[_0xdf34('0x24')]=_0x1c42c8['callbackat'];this[_0xdf34('0x25')]=_0x1c42c8[_0xdf34('0x25')];this[_0xdf34('0x26')]=_0x1c42c8[_0xdf34('0x26')];this[_0xdf34('0x27')]=_0x1c42c8['ListId'];this[_0xdf34('0x28')]=_0x1c42c8['UserId'];this[_0xdf34('0x29')]=_0x1c42c8['VoiceQueueId'];this[_0xdf34('0x2a')]=_0x1c42c8[_0xdf34('0x2a')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 5d7df0a..895bafd 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 _0x47d5=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback'];(function(_0x188dda,_0x410b37){var _0x5cb327=function(_0x28f070){while(--_0x28f070){_0x188dda['push'](_0x188dda['shift']());}};_0x5cb327(++_0x410b37);}(_0x47d5,0x1eb));var _0x547d=function(_0x416f4e,_0x46a4b1){_0x416f4e=_0x416f4e-0x0;var _0x230028=_0x47d5[_0x416f4e];return _0x230028;};'use strict';var util=require('util');var _=require(_0x547d('0x0'));var moment=require(_0x547d('0x1'));function getSeconds(_0x48efe9,_0x44bf41){var _0x503c76=moment(_0x48efe9)['milliseconds'](0x0);var _0x24dd78=moment(_0x44bf41)[_0x547d('0x2')](0x0);return _0x503c76[_0x547d('0x3')](_0x24dd78,_0x547d('0x4'));}function History(_0xc8ba71){this[_0x547d('0x5')]=_0xc8ba71[_0x547d('0x5')];this['scheduledat']=_0xc8ba71[_0x547d('0x6')]||undefined;this['type']=_0xc8ba71[_0x547d('0x7')];this[_0x547d('0x8')]=_0xc8ba71[_0x547d('0x7')]===_0x547d('0x9')?_0x547d('0xa'):_0xc8ba71[_0x547d('0x7')];this['countbusyretry']=_0xc8ba71[_0x547d('0xb')];this['countcongestionretry']=_0xc8ba71[_0x547d('0xc')];this[_0x547d('0xd')]=_0xc8ba71[_0x547d('0xd')];this[_0x547d('0xe')]=_0xc8ba71[_0x547d('0xb')]+_0xc8ba71[_0x547d('0xc')]+_0xc8ba71[_0x547d('0xd')]+_0xc8ba71[_0x547d('0xf')]+_0xc8ba71[_0x547d('0x10')]+_0xc8ba71[_0x547d('0x11')]+_0xc8ba71[_0x547d('0x12')]+_0xc8ba71[_0x547d('0x13')];this['countnosuchnumberretry']=_0xc8ba71[_0x547d('0xf')];this['countdropretry']=_0xc8ba71[_0x547d('0x10')];this[_0x547d('0x11')]=_0xc8ba71[_0x547d('0x11')];this['countmachineretry']=_0xc8ba71[_0x547d('0x12')];this[_0x547d('0x13')]=_0xc8ba71[_0x547d('0x13')];this[_0x547d('0xa')]=_0xc8ba71[_0x547d('0xa')];this['calleridname']=_0xc8ba71[_0x547d('0x14')];this[_0x547d('0x15')]=_0xc8ba71[_0x547d('0x16')];this[_0x547d('0x17')]=_0xc8ba71['starttime'];this[_0x547d('0x18')]=_0xc8ba71['responsetime'];this[_0x547d('0x19')]=_0xc8ba71['responsetime'];this['ringtime']=getSeconds(_0xc8ba71[_0x547d('0x18')],_0xc8ba71[_0x547d('0x17')]);this[_0x547d('0x1a')]=0x0;this[_0x547d('0x1b')]=0x0;this['callback']=_0xc8ba71[_0x547d('0x1c')];this[_0x547d('0x1d')]=_0xc8ba71['callbackuniqueid'];this[_0x547d('0x1e')]=_0xc8ba71[_0x547d('0x1e')];this[_0x547d('0x1f')]=_0xc8ba71['recallme'];this[_0x547d('0x20')]=_0xc8ba71[_0x547d('0x20')];this[_0x547d('0x21')]=_0xc8ba71['ListId'];this[_0x547d('0x22')]=_0xc8ba71[_0x547d('0x22')];this[_0x547d('0x23')]=_0xc8ba71[_0x547d('0x23')];this[_0x547d('0x24')]=_0xc8ba71[_0x547d('0x24')];this['originatecalleridnum']=_0xc8ba71[_0x547d('0x25')]||'';this[_0x547d('0x26')]=_0xc8ba71[_0x547d('0x26')]||'';}module[_0x547d('0x27')]=History; \ No newline at end of file +var _0x6e91=['countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x499cc3,_0x3ba407){var _0xb05cdc=function(_0x384244){while(--_0x384244){_0x499cc3['push'](_0x499cc3['shift']());}};_0xb05cdc(++_0x3ba407);}(_0x6e91,0x15e));var _0x16e9=function(_0x2635dd,_0x30fe09){_0x2635dd=_0x2635dd-0x0;var _0x42da48=_0x6e91[_0x2635dd];return _0x42da48;};'use strict';var util=require(_0x16e9('0x0'));var _=require(_0x16e9('0x1'));var moment=require(_0x16e9('0x2'));function getSeconds(_0xce3671,_0x593a18){var _0x5b9172=moment(_0xce3671)[_0x16e9('0x3')](0x0);var _0x429ff8=moment(_0x593a18)[_0x16e9('0x3')](0x0);return _0x5b9172[_0x16e9('0x4')](_0x429ff8,'seconds');}function History(_0x6cff2a){this['uniqueid']=_0x6cff2a[_0x16e9('0x5')];this[_0x16e9('0x6')]=_0x6cff2a[_0x16e9('0x6')]||undefined;this[_0x16e9('0x7')]=_0x6cff2a[_0x16e9('0x7')];this[_0x16e9('0x8')]=_0x6cff2a['type']===_0x16e9('0x9')?_0x16e9('0xa'):_0x6cff2a[_0x16e9('0x7')];this['countbusyretry']=_0x6cff2a['countbusyretry'];this[_0x16e9('0xb')]=_0x6cff2a[_0x16e9('0xb')];this[_0x16e9('0xc')]=_0x6cff2a[_0x16e9('0xc')];this[_0x16e9('0xd')]=_0x6cff2a[_0x16e9('0xe')]+_0x6cff2a['countcongestionretry']+_0x6cff2a['countnoanswerretry']+_0x6cff2a[_0x16e9('0xf')]+_0x6cff2a[_0x16e9('0x10')]+_0x6cff2a[_0x16e9('0x11')]+_0x6cff2a[_0x16e9('0x12')]+_0x6cff2a[_0x16e9('0x13')];this[_0x16e9('0xf')]=_0x6cff2a['countnosuchnumberretry'];this[_0x16e9('0x10')]=_0x6cff2a[_0x16e9('0x10')];this[_0x16e9('0x11')]=_0x6cff2a[_0x16e9('0x11')];this['countmachineretry']=_0x6cff2a[_0x16e9('0x12')];this['countagentrejectretry']=_0x6cff2a[_0x16e9('0x13')];this[_0x16e9('0xa')]=_0x6cff2a[_0x16e9('0xa')];this[_0x16e9('0x14')]=_0x6cff2a[_0x16e9('0x15')];this['calleridnum']=_0x6cff2a[_0x16e9('0x16')];this[_0x16e9('0x17')]=_0x6cff2a['starttime'];this[_0x16e9('0x18')]=_0x6cff2a['responsetime'];this[_0x16e9('0x19')]=_0x6cff2a[_0x16e9('0x18')];this[_0x16e9('0x1a')]=getSeconds(_0x6cff2a[_0x16e9('0x18')],_0x6cff2a[_0x16e9('0x17')]);this[_0x16e9('0x1b')]=0x0;this[_0x16e9('0x1c')]=0x0;this[_0x16e9('0x1d')]=_0x6cff2a[_0x16e9('0x1d')];this[_0x16e9('0x1e')]=_0x6cff2a[_0x16e9('0x1e')];this[_0x16e9('0x1f')]=_0x6cff2a[_0x16e9('0x1f')];this[_0x16e9('0x20')]=_0x6cff2a[_0x16e9('0x20')];this[_0x16e9('0x21')]=_0x6cff2a[_0x16e9('0x21')];this[_0x16e9('0x22')]=_0x6cff2a['ListId'];this[_0x16e9('0x23')]=_0x6cff2a[_0x16e9('0x23')];this[_0x16e9('0x24')]=_0x6cff2a[_0x16e9('0x24')];this[_0x16e9('0x25')]=_0x6cff2a[_0x16e9('0x25')];this[_0x16e9('0x26')]=_0x6cff2a[_0x16e9('0x26')]||'';this[_0x16e9('0x27')]=_0x6cff2a[_0x16e9('0x27')]||'';}module[_0x16e9('0x28')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 1cfde6b..e56d2e4 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 _0xbec5=['unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','true','content','indexOf','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','booked','Queue','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','replace','random','match','object','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','substring','trim','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate','originate\x20action\x20Error','syncOriginateResponse','responsetime','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','agentreject','reason\x2020\x20agentreject','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','abandonmentRate','[CatchErlangB]','outboundQueuePauses','busyFactor','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','reachable','Contact.phone','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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','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','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','bind','queuecallerabandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','newexten','syncNewExten','syncVarSet','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','INTERVAL_IS_NULL','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','diff','seconds','emit','type','outbound','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','milliseconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','actions','[actions]','Action','channel','catch','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','status','unmonitored','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','campaigns','HANGUP','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countabandonedretry','countagentrejectretry','dialMachineRetryFrequency','[rescheduleContact][Machine]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','actionid','strategy','paused','stateinterface','locked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr'];(function(_0x464c82,_0x3ab54a){var _0x1697f4=function(_0x46c0cc){while(--_0x46c0cc){_0x464c82['push'](_0x464c82['shift']());}};_0x1697f4(++_0x3ab54a);}(_0xbec5,0xe5));var _0x5bec=function(_0x5e1e25,_0xdc1421){_0x5e1e25=_0x5e1e25-0x0;var _0x548e5f=_0xbec5[_0x5e1e25];return _0x548e5f;};'use strict';var util=require(_0x5bec('0x0'));var _=require(_0x5bec('0x1'));var BPromise=require('bluebird');var uuid=require(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var rr=require('rr');var md5=require(_0x5bec('0x4'));var Redis=require(_0x5bec('0x5'));var ut=require(_0x5bec('0x6'));var config=require('../../../config/environment/');var logger=require(_0x5bec('0x7'))(_0x5bec('0x8'));var loggerBooked=require(_0x5bec('0x7'))('booked');var loggerPredictive=require(_0x5bec('0x7'))(_0x5bec('0x9'));var loggerPredictiveCalls=require(_0x5bec('0x7'))(_0x5bec('0xa'));var loggerSyncQueueSummary=require(_0x5bec('0x7'))(_0x5bec('0xb'));var ami=require(_0x5bec('0xc'));config[_0x5bec('0xd')]=_['defaults'](config[_0x5bec('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x5bec('0xe'))(new Redis(config[_0x5bec('0xd')]));var cmHopper=require(_0x5bec('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x5bec('0x10'));var voiceQueueRt=require(_0x5bec('0x11'));var Action=require(_0x5bec('0x12'));var History=require('./history');var Final=require(_0x5bec('0x13'));var AgentComplete=require(_0x5bec('0x14'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x5bec('0x15'));var ipAgi=process[_0x5bec('0x16')][_0x5bec('0x17')]||_0x5bec('0x18');var strategy={'rrmemory':_0x5bec('0x19'),'roundrobin':_0x5bec('0x1a')};var Sequence=function(){};Sequence[_0x5bec('0x1b')][_0x5bec('0x1c')]=function(_0x259588){this[_0x5bec('0x1d')]=this[_0x5bec('0x1d')]?this[_0x5bec('0x1d')][_0x5bec('0x1e')](_0x259588):_0x259588();};function Dialer(_0x506639,_0x4ab821){this[_0x5bec('0x1f')]=new Sequence();this[_0x5bec('0x20')]=_0x4ab821;this[_0x5bec('0x21')]=_0x506639[_0x5bec('0x21')];this['campaigns']=_0x506639['campaigns'];this[_0x5bec('0x22')]=_0x506639[_0x5bec('0x22')];this['trunks']=_0x506639[_0x5bec('0x23')];this[_0x5bec('0x24')]=config[_0x5bec('0x24')]||0x2;this[_0x5bec('0x25')]={};this['actions']={};this[_0x5bec('0x26')]={};this['uniqueId']={};this[_0x5bec('0x27')]={};this[_0x5bec('0x28')]={};this[_0x5bec('0x29')]={};this[_0x5bec('0x2a')]={};this[_0x5bec('0x2b')]={};this['queueBookedRR']={};ami['on'](_0x5bec('0x2c'),this['syncAgentConnect'][_0x5bec('0x2d')](this));ami['on'](_0x5bec('0x2e'),this['syncQueueCallerAbandon'][_0x5bec('0x2d')](this));ami['on'](_0x5bec('0x2f'),this['syncOriginateResponse'][_0x5bec('0x2d')](this));ami['on'](_0x5bec('0x30'),this[_0x5bec('0x31')][_0x5bec('0x2d')](this));ami['on'](_0x5bec('0x32'),this[_0x5bec('0xb')][_0x5bec('0x2d')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x5bec('0x33'),this[_0x5bec('0x34')][_0x5bec('0x2d')](this));ami['on']('varset',this[_0x5bec('0x35')][_0x5bec('0x2d')](this));ami['on']('queuemember',this[_0x5bec('0x36')][_0x5bec('0x2d')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x5bec('0x2d')](this));this[_0x5bec('0x37')]();this[_0x5bec('0x38')]();}function isNotNull(_0x2c7a7b){return _0x2c7a7b!==null&&!_[_0x5bec('0x39')](_0x2c7a7b);}function checkIsLoggedIn(_0x3f224c,_0x5d6621){return function(){if(_0x5d6621<=0x0){_0x3f224c[_0x5bec('0x3a')]='AGENTS_NOT_LOGGED';throw _0x3f224c[_0x5bec('0x3b')]+_0x5bec('0x3c');}};}function isActive(_0x3034c9){return _0x3034c9;}function checkIsActive(_0x110bd4,_0x5128c0){return function(){if(!isActive(_0x5128c0)){_0x110bd4[_0x5bec('0x3a')]=_0x5bec('0x3d');throw _0x110bd4[_0x5bec('0x3b')]+'\x20NOT\x20Active';}};}function checkInterval(_0xf6ae6b){return function(){if(!isNotNull(_0xf6ae6b['Interval'])){_0xf6ae6b[_0x5bec('0x3a')]=_0x5bec('0x3e');throw _0xf6ae6b[_0x5bec('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xf6ae6b[_0x5bec('0x3f')][_0x5bec('0x40')])){_0xf6ae6b['message']=_0x5bec('0x3e');throw _0xf6ae6b[_0x5bec('0x3b')]+_0x5bec('0x41');}if(!isNotNull(_[_0x5bec('0x42')](_0xf6ae6b[_0x5bec('0x3f')]['Intervals']))){_0xf6ae6b[_0x5bec('0x3a')]='INTERVAL_IS_NULL';throw _0xf6ae6b[_0x5bec('0x3b')]+_0x5bec('0x41');}};}function msgResponse(_0x182b86,_0x7598ab,_0x2e421e){return{'action':_0x182b86,'response':_0x7598ab,'message':_0x2e421e,'stack':_0x2e421e};}function myreject(_0x1923fc){return function(_0x49c8ef){return _0x1923fc(msgResponse(_0x5bec('0x43'),_0x5bec('0x44'),JSON[_0x5bec('0x45')](_0x49c8ef)));};}function getSeconds(_0x5de683,_0x40db29){var _0x355707=moment(_0x5de683)['milliseconds'](0x0);var _0xdb0430=moment(_0x40db29)['milliseconds'](0x0);return _0x355707[_0x5bec('0x46')](_0xdb0430,_0x5bec('0x47'));}function emit(_0x402e5d,_0x49cdfa,_0xd7b727){io['to'](_0x402e5d)[_0x5bec('0x48')](_0x49cdfa,_0xd7b727);}function emitVoiceQueueSummary(_0x43d4e9){if(_0x43d4e9[_0x5bec('0x49')]===_0x5bec('0x4a')){var _0x1be7a7={'id':_0x43d4e9['id'],'name':_0x43d4e9[_0x5bec('0x3b')],'strategy':_0x43d4e9['strategy'],'answered':_0x43d4e9[_0x5bec('0x4b')],'available':_0x43d4e9[_0x5bec('0x4c')],'loggedIn':_0x43d4e9[_0x5bec('0x4d')],'pTalking':_0x43d4e9[_0x5bec('0x4e')],'sumBillable':_0x43d4e9['sumBillable'],'sumDuration':_0x43d4e9[_0x5bec('0x4f')],'sumHoldTime':_0x43d4e9[_0x5bec('0x50')]||0x0,'talking':_0x43d4e9[_0x5bec('0x51')],'total':_0x43d4e9['total'],'type':_0x43d4e9['type'],'unmanaged':_0x43d4e9[_0x5bec('0x52')],'abandoned':_0x43d4e9[_0x5bec('0x53')],'waiting':_0x43d4e9[_0x5bec('0x54')],'loggedInDb':_0x43d4e9[_0x5bec('0x55')],'dialActive':_0x43d4e9[_0x5bec('0x56')],'dialMethod':_0x43d4e9['dialMethod'],'dialOriginateCallerIdName':_0x43d4e9['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x43d4e9[_0x5bec('0x57')],'dialOriginateTimeout':_0x43d4e9['dialOriginateTimeout'],'dialPrefix':_0x43d4e9[_0x5bec('0x58')],'outboundAnswerAgiCallsDay':_0x43d4e9[_0x5bec('0x59')],'outboundAnswerCallsDay':_0x43d4e9[_0x5bec('0x5a')],'outboundBlacklistCallsDay':_0x43d4e9['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x43d4e9[_0x5bec('0x5b')],'outboundCongestionCallsDay':_0x43d4e9[_0x5bec('0x5c')],'outboundDropCallsDayACS':_0x43d4e9['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x43d4e9[_0x5bec('0x5d')],'outboundDropCallsDayTimeout':_0x43d4e9[_0x5bec('0x5e')],'outboundNoAnswerCallsDay':_0x43d4e9[_0x5bec('0x5f')],'outboundNoSuchCallsDay':_0x43d4e9[_0x5bec('0x60')],'outboundOriginateFailureCallsDay':_0x43d4e9[_0x5bec('0x61')],'outboundReCallsDay':_0x43d4e9[_0x5bec('0x62')],'outboundRejectCallsDay':_0x43d4e9[_0x5bec('0x63')],'outboundUnknownCallsDay':_0x43d4e9['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x43d4e9['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x43d4e9[_0x5bec('0x64')],'predictiveIntervalAvgTalktime':_0x43d4e9['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x43d4e9['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x43d4e9[_0x5bec('0x65')],'predictiveIntervalErlangCalls':_0x43d4e9['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x43d4e9['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x43d4e9['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x43d4e9[_0x5bec('0x66')],'predictiveIntervalPauses':_0x43d4e9[_0x5bec('0x67')],'predictiveIntervalAvailable':_0x43d4e9[_0x5bec('0x68')],'predictiveIntervalTotalCalls':_0x43d4e9[_0x5bec('0x69')],'message':_0x43d4e9['message'],'originated':_0x43d4e9[_0x5bec('0x6a')],'erlangCalls':_0x43d4e9[_0x5bec('0x6b')],'erlangCallToSecond':_0x43d4e9[_0x5bec('0x6c')],'erlangAbandonmentRate':_0x43d4e9[_0x5bec('0x6d')],'erlangBusyFactor':_0x43d4e9['erlangBusyFactor'],'startPredictive':_0x43d4e9[_0x5bec('0x28')],'startProgressive':_0x43d4e9[_0x5bec('0x29')]};if(_0x43d4e9[_0x5bec('0x6e')]){_0x1be7a7['Trunk']={'id':_0x43d4e9[_0x5bec('0x6e')]['id'],'name':_0x43d4e9['Trunk'][_0x5bec('0x3b')],'active':_0x43d4e9[_0x5bec('0x6e')][_0x5bec('0x6f')],'callerid':_0x43d4e9[_0x5bec('0x6e')]['callerid']};}if(_0x43d4e9[_0x5bec('0x3f')]){_0x1be7a7[_0x5bec('0x3f')]={'id':_0x43d4e9[_0x5bec('0x3f')]['id'],'name':_0x43d4e9[_0x5bec('0x3f')][_0x5bec('0x3b')]};}var _0x123758=md5(JSON[_0x5bec('0x45')](_0x1be7a7));if(_0x43d4e9['md5']!==_0x123758){_0x43d4e9[_0x5bec('0x4')]=_0x123758;emit(util[_0x5bec('0x70')]('voice:queue:%s',_0x1be7a7[_0x5bec('0x3b')]),_0x5bec('0x71'),_0x1be7a7);}}}function emitCampaignSummary(_0x34ee24){if(_0x34ee24[_0x5bec('0x49')]===_0x5bec('0x72')){emit(util[_0x5bec('0x70')](_0x5bec('0x73'),_0x34ee24['name']),_0x5bec('0x74'),_0x34ee24);}}function checkGetDataPredictive(_0x579cd2){if(isNotNull(_0x579cd2)&&!_[_0x5bec('0x42')](_0x579cd2)){loggerPredictive[_0x5bec('0x75')](_0x5bec('0x76'));loggerPredictive[_0x5bec('0x75')](_0x5bec('0x77'),_0x579cd2[_0x5bec('0x69')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x78'),_0x579cd2[_0x5bec('0x79')]);loggerPredictive[_0x5bec('0x75')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x579cd2[_0x5bec('0x65')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x579cd2[_0x5bec('0x7a')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x579cd2[_0x5bec('0x64')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7b'),_0x579cd2['predictiveIntervalAvgTalktime']);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7c'));if(_0x579cd2[_0x5bec('0x69')]>0x0){if(!_[_0x5bec('0x39')](_0x579cd2['predictiveIntervalAvgTalktime'])&&_0x579cd2[_0x5bec('0x7d')]>0x0){return!![];}loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7e'));if(!_[_0x5bec('0x39')](_0x579cd2[_0x5bec('0x64')])&&_0x579cd2[_0x5bec('0x64')]>0x0){return!![];}loggerPredictive[_0x5bec('0x75')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x5bec('0x7f'));}}else{loggerPredictive['info'](_0x5bec('0x80'));}return![];}function mergeDataErlangB(_0x7ad053){return function(_0x4bba85){loggerPredictive[_0x5bec('0x75')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x5bec('0x75')](_0x5bec('0x81'),_0x4bba85[_0x5bec('0x6b')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x82'),_0x4bba85[_0x5bec('0x6c')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x83'),_0x4bba85[_0x5bec('0x6d')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x84'),_0x4bba85[_0x5bec('0x85')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x83'),_0x4bba85['erlangAbandonmentRate']);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7c'));_[_0x5bec('0x86')](_0x7ad053,_0x4bba85);};}function getDiff(_0x56a539){var _0x3801e3=moment()[_0x5bec('0x87')](0x0);var _0xfc5d80=moment(_0x56a539)[_0x5bec('0x87')](0x0);return _0x3801e3[_0x5bec('0x46')](_0xfc5d80,'seconds');}function ifInterval(_0x3e3108,_0x11b30c){if(_[_0x5bec('0x39')](_0x11b30c)){return![];}return getDiff(_0x11b30c)<_0x3e3108*0x3c;}function freeVariablesPredictive(_0x2abc02){if(isNotNull(_0x2abc02)){if(!_['isUndefined'](_0x2abc02[_0x5bec('0x29')])){_0x2abc02['startProgressive']=undefined;loggerPredictive[_0x5bec('0x75')](_0x2abc02[_0x5bec('0x3b')],_0x5bec('0x88'));}if(!_[_0x5bec('0x39')](_0x2abc02['startPredictive'])){_0x2abc02[_0x5bec('0x28')]=undefined;loggerPredictive[_0x5bec('0x75')](_0x2abc02[_0x5bec('0x3b')],_0x5bec('0x89'));}if(!_[_0x5bec('0x39')](_0x2abc02[_0x5bec('0x8a')])){clearInterval(_0x2abc02[_0x5bec('0x8a')]);_0x2abc02[_0x5bec('0x8a')]=undefined;loggerPredictive[_0x5bec('0x75')](_0x2abc02[_0x5bec('0x3b')],_0x5bec('0x8b'));}}}function erlangb(_0x42d4e4,_0x65a9e2){if(_0x65a9e2===0x0){return 0x0;}var _0x5d3092=0x1;for(var _0x1e98ee=0x1;_0x1e98ee<=_0x65a9e2;_0x1e98ee+=0x1){_0x5d3092=0x1+_0x5d3092*_0x1e98ee/_0x42d4e4;}return 0x1/_0x5d3092;}function isVoiceQueueOutbound(_0x490d4b){return _0x490d4b===_0x5bec('0x4a');}function isNotPreview(_0x27c160){return _0x27c160!=='preview';}function isCampaignIvr(_0xa7a394){return _0xa7a394==='ivr';}function getCallerId(_0x1a5cb0,_0x1061d3,_0x540e96){if(!_['isUndefined'](_0x540e96)&&typeof _0x540e96===_0x5bec('0x8c')&&!_[_0x5bec('0x42')](_0x540e96)){if(!_[_0x5bec('0x39')](_0x1061d3)&&typeof _0x1061d3===_0x5bec('0x8c')&&!_[_0x5bec('0x42')](_0x1061d3)){return util['format'](_0x5bec('0x8d'),_0x1061d3,_0x540e96);}return util[_0x5bec('0x70')]('\x22%s\x22\x20<%s>',_0x540e96,_0x540e96);}if(!_[_0x5bec('0x39')](_0x1a5cb0)&&typeof _0x1a5cb0===_0x5bec('0x8c')&&!_[_0x5bec('0x42')](_0x1a5cb0)){return _0x1a5cb0;}return _0x5bec('0x8e');}function loggerCatchQueueSummary(_0x572dc5,_0x681503){return function(_0x5e4aae){freeVariablesPredictive(_0x681503);emitVoiceQueueSummary(_0x681503);emitCampaignSummary(_0x681503);loggerSyncQueueSummary[_0x5bec('0x8f')](_0x572dc5,util[_0x5bec('0x90')](_0x5e4aae,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3ede1d,_0x34e172){return function(_0x31b2c6){loggerPredictive[_0x5bec('0x8f')](_0x34e172[_0x5bec('0x3b')],_0x3ede1d);loggerPredictive[_0x5bec('0x8f')](_0x31b2c6[_0x5bec('0x91')]);freeVariablesPredictive(_0x34e172);};}function loggerCatch(_0x4483a0){return function(_0x36d6f6){logger['error'](_0x4483a0,util['inspect'](_0x36d6f6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3c305e){return _0x3c305e&&!_[_0x5bec('0x39')](_0x3c305e)&&_0x3c305e[_0x5bec('0x92')]>0x0;}function decremetOriginate(_0x41bf69){if(!_[_0x5bec('0x39')](_0x41bf69)&&_0x41bf69!==null){if(typeof _0x41bf69[_0x5bec('0x6a')]!==_0x5bec('0x93')){if(_0x41bf69['originated']>0x0){_0x41bf69['originated']-=0x1;}else{logger[_0x5bec('0x8f')](_0x5bec('0x94'));}}}else{logger[_0x5bec('0x8f')](_0x5bec('0x95'));}}function checkContactLowerLimitOriginate(_0x215f9b,_0x2c3baf,_0x17cd00){if(_0x2c3baf>_0x17cd00){for(var _0x31f45b=0x0;_0x31f45b<_0x2c3baf-_0x17cd00;_0x31f45b+=0x1){decremetOriginate(_0x215f9b);}}}function loggerGetContactDialer(_0x132c57,_0x29b7ae,_0x10550a){return function(_0x14b071){checkContactLowerLimitOriginate(_0x29b7ae,_0x10550a,0x0);logger[_0x5bec('0x8f')](_0x132c57,util[_0x5bec('0x90')](_0x14b071,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x282c3b){return function(_0x40a6f3){if(isNotNull(_0x40a6f3)&&isNotNull(_0x40a6f3[0x0])){if(_0x40a6f3[0x0][_0x5bec('0x96')]>0x0){_0x282c3b[_0x5bec('0x3a')]=_0x5bec('0x97');logger[_0x5bec('0x75')]('[getContactDialer2][ReScheduled]'+_0x282c3b[_0x5bec('0x3b')],_0x40a6f3[0x0]['contactsRescheduled'],'contacts');}else{_0x282c3b[_0x5bec('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x5bec('0x75')]('[getContactDialer2][Empty]'+_0x282c3b['name']);}}};}function notSendMessagesQueue(_0x2e849b){if(_0x2e849b[_0x5bec('0x98')]){freeVariablesPredictive(_0x2e849b);if(_0x2e849b['originated']===0x0&&_0x2e849b[_0x5bec('0x51')]===0x0&&_0x2e849b[_0x5bec('0x54')]===0x0&&(_0x2e849b[_0x5bec('0x4e')]||0x0)===0x0){_0x2e849b[_0x5bec('0x98')]=![];_0x2e849b[_0x5bec('0x4c')]=0x0;_0x2e849b[_0x5bec('0x3a')]=_0x5bec('0x3d');loggerSyncQueueSummary[_0x5bec('0x8f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2e849b['name'],_0x5bec('0x99'));}else{_0x2e849b[_0x5bec('0x3a')]=_0x5bec('0x9a');loggerSyncQueueSummary[_0x5bec('0x8f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2e849b[_0x5bec('0x3b')],'is\x20disactive');}emitVoiceQueueSummary(_0x2e849b);}}function notSendMessagesCampaign(_0x44ceec){if(_0x44ceec[_0x5bec('0x98')]){if(_0x44ceec[_0x5bec('0x6a')]===0x0){_0x44ceec[_0x5bec('0x98')]=![];_0x44ceec[_0x5bec('0x3a')]=_0x5bec('0x3d');loggerSyncQueueSummary[_0x5bec('0x8f')](_0x5bec('0x9b'),_0x44ceec['name'],_0x5bec('0x99'));}else{_0x44ceec[_0x5bec('0x3a')]=_0x5bec('0x9a');loggerSyncQueueSummary[_0x5bec('0x8f')](_0x5bec('0x9b'),_0x44ceec['name'],_0x5bec('0x9c'));}emitCampaignSummary(_0x44ceec);}}function createObjHistory(_0x3d5e9d,_0x5c124d,_0x195c12,_0x56fa9d,_0xd93c70){_0x3d5e9d[_0x5bec('0x3a')]=_0x195c12;var _0x4646a3=new Action(_0x3d5e9d,_0x5c124d);var _0x313e1c=new History(_0x4646a3);_0x313e1c[_0x5bec('0x9d')]=_0x56fa9d;_0x313e1c[_0x5bec('0x9e')]=_0xd93c70;_0x313e1c[_0x5bec('0x9f')]=_0x4646a3[_0x5bec('0xa0')];return _0x313e1c;}Dialer[_0x5bec('0x1b')][_0x5bec('0x38')]=function(){var _0x1c44f5=this;setInterval(function(){_0x1c44f5[_0x5bec('0xa1')](_0x1c44f5[_0x5bec('0xa2')],_0x5bec('0xa3'));_0x1c44f5[_0x5bec('0xa1')](_0x1c44f5[_0x5bec('0xa4')],_0x5bec('0xa5'));},0x32c8);};Dialer[_0x5bec('0x1b')]['clearZombieChannels']=function(_0x1aa391,_0x4d178b){var _0x3c8ab9=this;for(var _0xfcef92 in _0x1aa391){if(typeof _0x1aa391[_0xfcef92]!=='undefined'){this['sequence'][_0x5bec('0x1c')](function(){if(!_['isNil'](_0x1aa391[_0xfcef92])){return ami[_0x5bec('0xa6')]({'action':'status','channel':_0x1aa391[_0xfcef92][_0x5bec('0xa7')]})[_0x5bec('0xa8')](function(_0x5c26b9){if(_0x5c26b9[_0x5bec('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1aa391[_0xfcef92]&&_0x1aa391[_0xfcef92][_0x5bec('0x49')]!=='ivr'){_0x3c8ab9[_0x5bec('0xa9')](_0x3c8ab9[_0x5bec('0x21')][_0x1aa391[_0xfcef92]['queue']]);logger[_0x5bec('0x8f')](_0x5bec('0xaa'),_0x4d178b,_0xfcef92,_0x1aa391[_0xfcef92][_0x5bec('0xab')]);delete _0x1aa391[_0xfcef92];}if(_0x1aa391[_0xfcef92]&&_0x1aa391[_0xfcef92][_0x5bec('0x49')]===_0x5bec('0x72')){_0x3c8ab9[_0x5bec('0xa9')](_0x3c8ab9['campaigns'][_0x1aa391[_0xfcef92][_0x5bec('0xab')]]);logger['error'](_0x5bec('0xac'),_0x4d178b,_0xfcef92,_0x1aa391[_0xfcef92]['queue']);delete _0x1aa391[_0xfcef92];}},0x2328);}});}});}}};Dialer['prototype'][_0x5bec('0xad')]=function(_0xf82ec2){return BPromise[_0x5bec('0xae')]()['then'](cmHopper[_0x5bec('0xad')](_0xf82ec2))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xaf')));};Dialer[_0x5bec('0x1b')]['checkIsBlackList']=function(_0x2c7ffa){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopperBlack[_0x5bec('0xb1')](_0x2c7ffa))['catch'](loggerCatch(_0x5bec('0xb2')));};Dialer[_0x5bec('0x1b')][_0x5bec('0xb3')]=function(_0x268680){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopperBlack[_0x5bec('0xb3')](_0x268680))[_0x5bec('0xa8')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x5bec('0x1b')][_0x5bec('0xb4')]=function(_0x38815d){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopperHistory['avgHandleTime'](_0x38815d))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xb5')));};Dialer['prototype'][_0x5bec('0xb6')]=function(_0x528102){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopper[_0x5bec('0xb6')](_0x528102))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xb7')));};Dialer['prototype'][_0x5bec('0xb8')]=function(_0x2db4fe,_0x3cee19,_0x98b146){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopper[_0x5bec('0xb8')](_0x2db4fe,_0x3cee19,_0x98b146))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xb9')));};Dialer['prototype'][_0x5bec('0xba')]=function(_0x160d40,_0x187416,_0x52b869,_0x56af8f,_0x1b7573){return BPromise[_0x5bec('0xae')]()['then'](cmHopper[_0x5bec('0xba')](_0x160d40,_0x187416,_0x52b869,_0x56af8f))['catch'](function(_0x862da3){_0x1b7573['temp']-=_0x52b869;_0x1b7573[_0x5bec('0xbb')]=_0x1b7573['temp']>0x0?_0x1b7573[_0x5bec('0xbb')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x862da3);});};Dialer[_0x5bec('0x1b')]['getContactDialerIvr']=function(_0x209f2d,_0x271067,_0x4c149f,_0x2b8227){return BPromise[_0x5bec('0xae')]()['then'](cmHopper[_0x5bec('0xbc')](_0x209f2d,_0x271067,_0x4c149f))[_0x5bec('0xa8')](function(_0x384aea){_0x2b8227[_0x5bec('0xbb')]-=_0x271067;_0x2b8227[_0x5bec('0xbb')]=_0x2b8227[_0x5bec('0xbb')]>0x0?_0x2b8227[_0x5bec('0xbb')]:0x0;loggerCatch(_0x5bec('0xbd'))(_0x384aea);});};Dialer[_0x5bec('0x1b')]['getVoiceQueueRtPauses']=function(_0x4e46ed){return BPromise['resolve']()['then'](voiceQueueRt[_0x5bec('0xbe')](_0x4e46ed))['catch'](loggerCatch(_0x5bec('0xbf')));};Dialer['prototype'][_0x5bec('0xc0')]=function(_0x36faae){return BPromise[_0x5bec('0xae')]()['then'](cmHopper[_0x5bec('0xc0')](_0x36faae))['catch'](loggerCatch(_0x5bec('0xc1')));};Dialer[_0x5bec('0x1b')][_0x5bec('0xc2')]=function(_0x4082c2){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopperHistory[_0x5bec('0xc2')](_0x4082c2))['catch'](loggerCatch(_0x5bec('0xc3')));};Dialer[_0x5bec('0x1b')][_0x5bec('0xa9')]=function(_0xadaafb){if(!_['isUndefined'](_0xadaafb)&&_0xadaafb!==null){if(typeof _0xadaafb[_0x5bec('0x6a')]!==_0x5bec('0x93')){if(_0xadaafb[_0x5bec('0x6a')]>0x0){_0xadaafb[_0x5bec('0x6a')]-=0x1;}else{logger[_0x5bec('0x8f')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype']['loggerHandler']=function(_0xd8e688,_0x4c9a52){var _0x3cbca3=this;return function(_0x1e7eec){_0x3cbca3['updateOriginated'](_0x4c9a52);logger[_0x5bec('0x8f')](_0xd8e688,util[_0x5bec('0x90')](_0x1e7eec,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x5bec('0xc4')]=function(_0x34931a,_0x4568fd,_0x1fe43c){var _0xc7c50a={'state':0x19,'statedesc':_0x5bec('0xc5')};this[_0x5bec('0xa9')](_0x4568fd);this[_0x5bec('0xc6')](_['merge'](_0xc7c50a,_[_0x5bec('0xc7')](_0x1fe43c,[_0x5bec('0xc8'),_0x5bec('0xc9'),_0x5bec('0xca'),_0x5bec('0xcb'),'CampaignId'])),'[emptyContact][createHistory]',_0x5bec('0xcc'));logger[_0x5bec('0x8f')](_0x34931a);};Dialer[_0x5bec('0x1b')][_0x5bec('0xcd')]=function(_0x3f40b8){return _0x3f40b8==='Success';};Dialer[_0x5bec('0x1b')][_0x5bec('0xce')]=function(_0x502346){return!_[_0x5bec('0x39')](_0x502346)&&_0x502346&&!_[_0x5bec('0x39')](_0x502346['name'])&&!_[_0x5bec('0x39')](_0x502346[_0x5bec('0x6f')])&&_0x502346[_0x5bec('0x6f')]&&(this[_0x5bec('0x23')][util[_0x5bec('0x70')]('SIP/%s',_0x502346['name'])]['status']==='reachable'||this[_0x5bec('0x23')][util[_0x5bec('0x70')](_0x5bec('0xcf'),_0x502346[_0x5bec('0x3b')])][_0x5bec('0xd0')]===_0x5bec('0xd1'));};Dialer['prototype']['saveInDb']=function(_0x3da745,_0x8d8363,_0x4b4142){this['createHistory'](_0x3da745)[_0x5bec('0xa8')](loggerCatch(_0x8d8363));this[_0x5bec('0xc0')](_0x3da745)['catch'](loggerCatch(_0x4b4142));};Dialer[_0x5bec('0x1b')][_0x5bec('0x35')]=function(_0x17214f){var _0xa8d9c3=this[_0x5bec('0xa2')][_0x17214f[_0x5bec('0xd2')]];var _0x113d2d;if(!_['isNil'](_0x17214f)&&!_[_0x5bec('0xd3')](_0x17214f['variable'])&&!_['isNil'](_0x17214f[_0x5bec('0xd4')][_0x5bec('0xd5')])&&_0x17214f[_0x5bec('0xd6')]==='xcally-motion-dialer'&&_0xa8d9c3){if(_0xa8d9c3['type']!==_0x5bec('0x72')&&this[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0xd7')]&&_0x17214f[_0x5bec('0xd8')]==='HANGUP'){delete this[_0x5bec('0xa2')][_0x17214f[_0x5bec('0xd2')]];this[_0x5bec('0xa9')](this['voiceQueues'][_0xa8d9c3[_0x5bec('0xab')]]);this[_0x5bec('0x21')][_0xa8d9c3['queue']][_0x5bec('0x5a')]+=0x1;this[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0x59')]+=0x1;_0x113d2d=new Hangup(_0xa8d9c3,_0x17214f);_0x113d2d[_0x5bec('0x9d')]=0x12;_0x113d2d[_0x5bec('0x9e')]=_0x5bec('0xd9');_0x113d2d[_0x5bec('0xda')]=_0x5bec('0xdb');ami[_0x5bec('0x48')]('custom:amd',ut[_0x5bec('0xdc')](_0x113d2d,_0x5bec('0xdd')));this[_0x5bec('0xc6')](_0x113d2d,_0x5bec('0xde'),_0x5bec('0xdf'));}if(_0xa8d9c3['type']!==_0x5bec('0x72')&&this[_0x5bec('0x21')][_0xa8d9c3['queue']][_0x5bec('0xd7')]&&_0x17214f[_0x5bec('0xd8')]==='MACHINE'){var _0xd008ba=this;return new BPromise(function(_0x45e155,_0x2b6322){delete _0xd008ba['uniqueId'][_0x17214f[_0x5bec('0xd2')]];_0xd008ba[_0x5bec('0xa9')](_0xd008ba[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]]);_0xd008ba['voiceQueues'][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0x5a')]+=0x1;_0xd008ba[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x44bf6d=_0xd008ba[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]];var _0x352c13=new Hangup(_0xa8d9c3,_0x17214f);_0x352c13[_0x5bec('0x9d')]=0x13;_0x352c13[_0x5bec('0x9e')]=_0x5bec('0xe0');_0x352c13[_0x5bec('0xda')]=_0x5bec('0xdb');_0x352c13[_0x5bec('0xe1')]+=0x1;_0x352c13[_0x5bec('0xe2')]+=0x1;_0x352c13[_0x5bec('0xdd')]=!![];ami[_0x5bec('0x48')]('custom:amd',ut['buildObj'](_0x352c13,_0x5bec('0xdd')));_0xd008ba['createHistory'](_0x352c13)['catch'](loggerCatch(_0x5bec('0xe3')));if(_0x352c13[_0x5bec('0xe4')]+_0x352c13[_0x5bec('0xe5')]+_0x352c13[_0x5bec('0xe6')]+_0x352c13[_0x5bec('0xe7')]+_0x352c13[_0x5bec('0xe8')]+_0x352c13['countabandonedretry']+_0x352c13[_0x5bec('0xe1')]+_0x352c13['countagentrejectretry']>=_0x44bf6d[_0x5bec('0xe9')]){_0xd008ba[_0x5bec('0xea')](_0x352c13,_0x45e155,_0x2b6322,_0x5bec('0xeb'));}else{if(_0x352c13['countmachineretry']>=_0x44bf6d[_0x5bec('0xec')]){_0xd008ba[_0x5bec('0xed')](_0x352c13,_0x45e155,_0x2b6322,_0x5bec('0xee'));}else{_0xd008ba['rescheduleContact']({'active':![],'countmachineretry':_0x352c13[_0x5bec('0xe1')],'scheduledat':moment()[_0x5bec('0xef')](_0x44bf6d['dialMachineRetryFrequency'],_0x5bec('0xf0'))['format'](_0x5bec('0xf1')),'ContactId':_0x352c13[_0x5bec('0xc8')],'ListId':_0x352c13['ListId'],'VoiceQueueId':_0x352c13[_0x5bec('0xcb')]||undefined,'CampaignId':_0x352c13[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch('[rescheduleContact][Machine]'));_0x45e155({'reschedule':0x1});}}});}if(_0xa8d9c3[_0x5bec('0x49')]===_0x5bec('0x72')&&this[_0x5bec('0xf3')][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0xd7')]&&_0x17214f[_0x5bec('0xd8')]===_0x5bec('0xf4')){delete this[_0x5bec('0xa2')][_0x17214f[_0x5bec('0xd2')]];this[_0x5bec('0xa9')](this[_0x5bec('0xf3')][_0xa8d9c3['queue']]);_0x113d2d=new Hangup(_0xa8d9c3,_0x17214f);_0x113d2d['state']=0x12;_0x113d2d[_0x5bec('0x9e')]=_0x5bec('0xd9');_0x113d2d['membername']='AMD';ami[_0x5bec('0x48')](_0x5bec('0xf5'),ut[_0x5bec('0xdc')](_0x113d2d,_0x5bec('0xdd')));this[_0x5bec('0xc6')](_0x113d2d,_0x5bec('0xf6'),_0x5bec('0xf7'));}if(_0xa8d9c3['type']===_0x5bec('0x72')&&this['campaigns'][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0xd7')]&&_0x17214f[_0x5bec('0xd8')]===_0x5bec('0xf8')){var _0xd008ba=this;return new BPromise(function(_0x3d89df,_0x3889a7){delete _0xd008ba['uniqueId'][_0x17214f[_0x5bec('0xd2')]];_0xd008ba['updateOriginated'](_0xd008ba[_0x5bec('0xf3')][_0xa8d9c3[_0x5bec('0xab')]]);_0xd008ba['campaigns'][_0xa8d9c3['queue']]['outboundAnswerCallsDay']+=0x1;_0xd008ba[_0x5bec('0xf3')][_0xa8d9c3['queue']][_0x5bec('0x59')]+=0x1;var _0x1c6d9c=_0xd008ba[_0x5bec('0xf3')][_0xa8d9c3[_0x5bec('0xab')]];var _0x5e70f7=new Hangup(_0xa8d9c3,_0x17214f);_0x5e70f7[_0x5bec('0x9d')]=0x13;_0x5e70f7[_0x5bec('0x9e')]='Machine';_0x5e70f7[_0x5bec('0xda')]=_0x5bec('0xdb');_0x5e70f7['countmachineretry']+=0x1;_0x5e70f7['countglobal']+=0x1;_0x5e70f7[_0x5bec('0xdd')]=!![];ami[_0x5bec('0x48')](_0x5bec('0xf5'),ut['buildObj'](_0x5e70f7,_0x5bec('0xdd')));_0xd008ba['createHistory'](_0x5e70f7)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5e70f7[_0x5bec('0xe4')]+_0x5e70f7['countcongestionretry']+_0x5e70f7['countnoanswerretry']+_0x5e70f7[_0x5bec('0xe7')]+_0x5e70f7['countdropretry']+_0x5e70f7[_0x5bec('0xf9')]+_0x5e70f7['countmachineretry']+_0x5e70f7[_0x5bec('0xfa')]>=_0x1c6d9c[_0x5bec('0xe9')]){_0xd008ba[_0x5bec('0xea')](_0x5e70f7,_0x3d89df,_0x3889a7,_0x5bec('0xeb'));}else{if(_0x5e70f7[_0x5bec('0xe1')]>=_0x1c6d9c[_0x5bec('0xec')]){_0xd008ba['createStateFinal'](_0x5e70f7,_0x3d89df,_0x3889a7,_0x5bec('0xee'));}else{_0xd008ba['rescheduleContact']({'active':![],'countmachineretry':_0x5e70f7[_0x5bec('0xe1')],'scheduledat':moment()[_0x5bec('0xef')](_0x1c6d9c[_0x5bec('0xfb')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x5e70f7[_0x5bec('0xc8')],'ListId':_0x5e70f7[_0x5bec('0xc9')],'VoiceQueueId':_0x5e70f7[_0x5bec('0xcb')]||undefined,'CampaignId':_0x5e70f7[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xfc')));_0x3d89df({'reschedule':0x1});}}});}}};Dialer[_0x5bec('0x1b')][_0x5bec('0xfd')]=function(_0x1ed888){var _0x3ee1e6=this[_0x5bec('0xa2')][_0x1ed888[_0x5bec('0xd2')]];var _0x32b146=this;var _0x36c5ba;if(_0x3ee1e6&&_0x3ee1e6[_0x5bec('0x49')]==='ivr'){delete this[_0x5bec('0xa2')][_0x1ed888['uniqueid']];this[_0x5bec('0xa9')](this[_0x5bec('0xf3')][_0x3ee1e6[_0x5bec('0xab')]]);this['campaigns'][_0x3ee1e6['queue']][_0x5bec('0xfe')]+=0x1;_0x36c5ba=new Hangup(_0x3ee1e6,_0x1ed888);this['createHistory'](_0x36c5ba)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xff')));this['moveContactManagedDialer'](_0x36c5ba)[_0x5bec('0xa8')](loggerCatch('[syncHangupIvr]'));}if(_0x3ee1e6&&_0x3ee1e6[_0x5bec('0x49')]!==_0x5bec('0x72')&&isNotNull(this['voiceQueues'][_0x3ee1e6[_0x5bec('0xab')]]['dialQueueProject'])){delete this[_0x5bec('0xa2')][_0x1ed888['uniqueid']];this[_0x5bec('0xa9')](this[_0x5bec('0x21')][_0x3ee1e6[_0x5bec('0xab')]]);this[_0x5bec('0x21')][_0x3ee1e6[_0x5bec('0xab')]]['outboundAnswerCallsDay']+=0x1;this[_0x5bec('0x21')][_0x3ee1e6[_0x5bec('0xab')]][_0x5bec('0x59')]+=0x1;_0x36c5ba=new Hangup(_0x3ee1e6,_0x1ed888);_0x36c5ba['state']=0x10;_0x36c5ba[_0x5bec('0x9e')]='AnswerAGI';_0x36c5ba[_0x5bec('0xda')]='AGI';this[_0x5bec('0xc2')](_0x36c5ba)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xff')));this['moveContactManagedDialer'](_0x36c5ba)['catch'](loggerCatch(_0x5bec('0x100')));}if(_0x3ee1e6&&_0x3ee1e6[_0x5bec('0x49')]!==_0x5bec('0x72')&&!isNotNull(this['voiceQueues'][_0x3ee1e6['queue']][_0x5bec('0x101')])){delete this[_0x5bec('0xa2')][_0x1ed888['uniqueid']];this[_0x5bec('0xa9')](this[_0x5bec('0x21')][_0x3ee1e6[_0x5bec('0xab')]]);this[_0x5bec('0x21')][_0x3ee1e6['queue']][_0x5bec('0x102')]+=0x1;_0x36c5ba=new Hangup(_0x3ee1e6,_0x1ed888);_0x36c5ba['state']=0xc;_0x36c5ba['statedesc']=_0x1ed888[_0x5bec('0x103')];_0x36c5ba[_0x5bec('0xda')]='Unknow';this[_0x5bec('0xc2')](_0x36c5ba)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xff')));this['moveContactManagedDialer'](_0x36c5ba)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x5bec('0x1b')][_0x5bec('0x31')]=function(_0x41b127){var _0x2839ad=this['uniqueId'][_0x41b127[_0x5bec('0xd2')]];var _0x5d8a40=this;if(this[_0x5bec('0x21')][_0x41b127[_0x5bec('0xab')]]){if(_0x2839ad&&_0x2839ad[_0x5bec('0x49')]!==_0x5bec('0x72')){delete this['uniqueId'][_0x41b127[_0x5bec('0xd2')]];this[_0x5bec('0x21')][_0x41b127[_0x5bec('0xab')]]['outboundAnswerCallsDay']+=0x1;var _0x2ab5f3=new AgentComplete(_0x2839ad,_0x41b127);if(_0x41b127[_0x5bec('0x104')]===_0x5bec('0x105')){_0x2ab5f3[_0x5bec('0x106')]=this[_0x5bec('0x21')][_0x41b127[_0x5bec('0xab')]][_0x5bec('0x107')]&&this[_0x5bec('0x21')][_0x41b127[_0x5bec('0xab')]][_0x5bec('0x108')]?moment()[_0x5bec('0x70')](_0x5bec('0xf1')):undefined;}this['createHistory'](_0x2ab5f3)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x109')));this[_0x5bec('0xc0')](_0x2ab5f3)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x10a')));}}};Dialer[_0x5bec('0x1b')][_0x5bec('0x10b')]=function(_0x40a94d){if(this[_0x5bec('0x21')][_0x40a94d['queue']]){if(this[_0x5bec('0xa2')][_0x40a94d[_0x5bec('0xd2')]]&&this[_0x5bec('0xa2')][_0x40a94d['uniqueid']]['type']!==_0x5bec('0x72')){this[_0x5bec('0xa9')](this['voiceQueues'][_0x40a94d[_0x5bec('0xab')]]);this[_0x5bec('0xa2')][_0x40a94d[_0x5bec('0xd2')]][_0x5bec('0x10c')]=moment()[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x5bec('0x1b')][_0x5bec('0x10d')]=function(_0x435f1f){this['createHistory'](_0x435f1f)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x5bec('0xc0')](_0x435f1f)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x10e')));};Dialer[_0x5bec('0x1b')]['syncQueueCallerAbandon']=function(_0x4e6f3e){var _0xa30c49=this[_0x5bec('0xa2')][_0x4e6f3e[_0x5bec('0xd2')]];var _0x41bb0c=this;if(this[_0x5bec('0x21')][_0x4e6f3e['queue']]){if(_0xa30c49&&_0xa30c49[_0x5bec('0x49')]!==_0x5bec('0x72')){delete this[_0x5bec('0xa2')][_0x4e6f3e[_0x5bec('0xd2')]];this['updateOriginated'](this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]]);_0xa30c49[_0x5bec('0x10f')]=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));var _0x3f02bb=new QueueCallerAbandon(_0xa30c49,_0x4e6f3e);if(getSeconds(_0xa30c49[_0x5bec('0x10f')],_0xa30c49['responsetime'])>=_0xa30c49[_0x5bec('0x110')]){this['voiceQueues'][_0x4e6f3e['queue']][_0x5bec('0x65')]+=0x1;this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x5e')]+=0x1;this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x111')]+=0x1;_0x3f02bb[_0x5bec('0x9d')]=0xa;_0x3f02bb['statedesc']=_0x5bec('0x112');_0x3f02bb[_0x5bec('0x113')]='TIMEOUT';_0x3f02bb[_0x5bec('0x106')]=this['voiceQueues'][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x107')]?moment()[_0x5bec('0x70')](_0x5bec('0xf1')):undefined;_0x3f02bb[_0x5bec('0xe8')]+=0x1;_0x3f02bb['countglobal']+=0x1;if(_0x3f02bb[_0x5bec('0xe8')]>=this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x114')]){this[_0x5bec('0x10d')](_0x3f02bb);}else{this[_0x5bec('0xb6')]({'active':![],'countdropretry':_0x3f02bb[_0x5bec('0xe8')],'scheduledat':moment()[_0x5bec('0xef')](this['voiceQueues'][_0x4e6f3e[_0x5bec('0xab')]]['dialDropRetryFrequency'],_0x5bec('0xf0'))[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa30c49['ContactId'],'ListId':_0xa30c49[_0x5bec('0xc9')],'VoiceQueueId':_0xa30c49[_0x5bec('0xcb')]||undefined,'CampaignId':_0xa30c49[_0x5bec('0xf2')]||undefined})['catch'](loggerCatch(_0x5bec('0x115')));var _0x5221a8=new History(_0x3f02bb);_0x5221a8[_0x5bec('0x9d')]=0xa;_0x5221a8[_0x5bec('0x9e')]=_0x5bec('0x112');_0x5221a8[_0x5bec('0xa0')]=moment()['format'](_0x5bec('0xf1'));_0x5221a8[_0x5bec('0x9f')]=_0x5221a8[_0x5bec('0xa0')];_0x5221a8[_0x5bec('0x116')]=_0x3f02bb['calleridname'];_0x5221a8[_0x5bec('0x117')]=_0x3f02bb[_0x5bec('0x117')];this[_0x5bec('0xc2')](_0x5221a8)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x118')));}}else{this['voiceQueues'][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x7a')]+=0x1;this['voiceQueues'][_0x4e6f3e[_0x5bec('0xab')]]['outboundDropCallsDayCallersExit']+=0x1;_0x3f02bb[_0x5bec('0x9d')]=0xb;_0x3f02bb[_0x5bec('0x9e')]=_0x5bec('0x119');_0x3f02bb[_0x5bec('0x113')]=_0x5bec('0x11a');_0x3f02bb[_0x5bec('0xf9')]+=0x1;_0x3f02bb[_0x5bec('0xe2')]+=0x1;if(_0x3f02bb[_0x5bec('0xf9')]>=this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x11b')]){this[_0x5bec('0x10d')](_0x3f02bb);}else{this[_0x5bec('0xb6')]({'active':![],'countabandonedretry':_0x3f02bb[_0x5bec('0xf9')],'scheduledat':moment()[_0x5bec('0xef')](this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x11c')],'minutes')[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0xa30c49['ContactId'],'ListId':_0xa30c49['ListId'],'VoiceQueueId':_0xa30c49[_0x5bec('0xcb')]||undefined,'CampaignId':_0xa30c49[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x11d')));var _0x5221a8=new History(_0x3f02bb);_0x5221a8[_0x5bec('0x9d')]=0xb;_0x5221a8[_0x5bec('0x9e')]='Abandoned';_0x5221a8[_0x5bec('0xa0')]=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));_0x5221a8[_0x5bec('0x9f')]=_0x5221a8[_0x5bec('0xa0')];_0x5221a8[_0x5bec('0x116')]=_0x3f02bb[_0x5bec('0x116')];_0x5221a8['calleridnum']=_0x3f02bb['calleridnum'];this[_0x5bec('0xc2')](_0x5221a8)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x5bec('0x1b')][_0x5bec('0x34')]=function(_0x568a42){if(this[_0x5bec('0xa4')][_0x568a42[_0x5bec('0xd2')]]){this[_0x5bec('0xa4')][_0x568a42['uniqueid']]['channel']=_0x568a42['channel'];}if(this[_0x5bec('0xa2')][_0x568a42[_0x5bec('0xd2')]]){this['uniqueId'][_0x568a42[_0x5bec('0xd2')]]['channel']=_0x568a42[_0x5bec('0xa7')];}};Dialer[_0x5bec('0x1b')][_0x5bec('0x36')]=function(_0x27fb59){if(strategy[this['voiceQueues'][this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x11f')]]===_0x5bec('0x1a')){if(this['actions'][_0x27fb59[_0x5bec('0x11e')]]&&_['isNil'](this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]]['locked'])&&_0x27fb59[_0x5bec('0xd0')]==='1'&&_0x27fb59[_0x5bec('0x120')]==='0'){if(this[_0x5bec('0x22')][_0x27fb59['stateinterface']]){if(!this[_0x5bec('0x22')][_0x27fb59[_0x5bec('0x121')]]['locked']){this[_0x5bec('0x22')][_0x27fb59[_0x5bec('0x121')]][_0x5bec('0x122')]=!![];this[_0x5bec('0xa4')][_0x27fb59['actionid']][_0x5bec('0x122')]=!![];this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0x121')]=_0x27fb59['stateinterface'];}}}}else if((strategy[this[_0x5bec('0x21')][this['actions'][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0xab')]]['strategy']]||_0x5bec('0x19'))===_0x5bec('0x19')){if(this[_0x5bec('0xa4')][_0x27fb59['actionid']]){if(this[_0x5bec('0x22')][_0x27fb59['stateinterface']]){this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]]['stateinterface']=_0x27fb59[_0x5bec('0x121')];if(_[_0x5bec('0xd3')](this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x27fb59['actionid']][_0x5bec('0xab')]])){this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0xab')]]=[];}this[_0x5bec('0x2b')][this['actions'][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x123')](_[_0x5bec('0x86')](_[_0x5bec('0xc7')](this[_0x5bec('0xa4')][_0x27fb59['actionid']],[_0x5bec('0x124'),_0x5bec('0x121')]),{'status':_0x27fb59['status'],'paused':_0x27fb59[_0x5bec('0x120')]}));}}}};function unlockQueueStatus(_0x5caeb7,_0x5e6281){setTimeout(function(){if(_[_0x5bec('0x39')](_0x5caeb7[_0x5bec('0x125')])){loggerBooked['error'](_0x5bec('0x126'),_0x5e6281);}_0x5caeb7['queueStatusComplete']=!![];loggerBooked[_0x5bec('0x75')](_0x5bec('0x127'),_0x5e6281,JSON[_0x5bec('0x45')](_[_0x5bec('0xc7')](_0x5caeb7,['name',_0x5bec('0x125')])));},0x1f3);}Dialer['prototype'][_0x5bec('0x128')]=function(_0x38fa44){var _0x5e632f=this;var _0x19d3cc=_0x5e632f[_0x5bec('0x21')][_0x5e632f['actions'][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]];if(strategy[this['voiceQueues'][this['actions'][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x11f')]]===_0x5bec('0x1a')){if(this['actions'][_0x38fa44[_0x5bec('0x11e')]]&&this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0x121')]){this[_0x5bec('0x20')][_0x5bec('0x129')](this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0x124')],this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0x121')])[_0x5bec('0xa8')](function(_0x52a7fd){logger[_0x5bec('0x8f')](_0x5bec('0x12a'),util[_0x5bec('0x90')](_0x52a7fd,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5e632f['updateOriginated'](_0x5e632f['voiceQueues'][_0x5e632f[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['queue']]);_0x5e632f['agents'][_0x5e632f[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['stateinterface']][_0x5bec('0x122')]=![];delete _0x5e632f[_0x5bec('0xa4')][_0x38fa44['actionid']];unlockQueueStatus(_0x19d3cc);});}else{this[_0x5bec('0xa9')](this[_0x5bec('0x21')][this['actions'][_0x38fa44['actionid']][_0x5bec('0xab')]]);this[_0x5bec('0xb6')]({'active':![],'ContactId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xc8')],'ListId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xc9')],'VoiceQueueId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xcb')]||undefined,'CampaignId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x5bec('0x12b')));delete this['actions'][_0x38fa44['actionid']];unlockQueueStatus(_0x19d3cc);}}else if((strategy[this[_0x5bec('0x21')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['queue']][_0x5bec('0x11f')]]||_0x5bec('0x19'))===_0x5bec('0x19')){var _0x2d73fb;if(this['actions'][_0x38fa44[_0x5bec('0x11e')]]&&!_[_0x5bec('0x42')](this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]])){if(this['queueBookedRR'][_0x5e632f['actions'][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]){this[_0x5bec('0x12c')][_0x5e632f[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]=this[_0x5bec('0x12c')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['queue']]?this[_0x5bec('0x12c')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]:this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]?this[_0x5bec('0x2b')][this['actions'][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x12d')]||0x0:0x0;}this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x12d')]=this['queueBookedRR'][this['actions'][_0x38fa44['actionid']][_0x5bec('0xab')]];for(var _0x44306d=0x0;_0x44306d=0x0;})['catch'](myreject(_0x3bcd32)));}}else{_0x402bcf[_0x5bec('0x123')](ami['Action']({'action':_0x5bec('0x144'),'command':util[_0x5bec('0x70')](_0x5bec('0x145'),_0x11ea81,!_['isUndefined'](config['timezones'][_0x1bcfd3])?_0x1bcfd3:'')})['then'](function(_0x30bbf7){return _0x30bbf7[_0x5bec('0x148')][_0x5bec('0x149')](_0x5bec('0x147'))>=0x0;})[_0x5bec('0xa8')](myreject(_0x3bcd32)));}BPromise['all'](_0x402bcf)[_0x5bec('0xb0')](function(_0x47262c){var _0x215bbd=_['some'](_0x47262c);if(_0x215bbd){return _0xe98363(_0x215bbd);}else{_0x47dbd0['message']=_0x5a0a86?_0x5bec('0x14a'):_0x5bec('0x14b');return _0x3bcd32(msgResponse(_0x5bec('0x14c'),_0x5bec('0x13d'),_0x5bec('0x14d')+_0x5a0a86+'\x20'+_0x5a9874+_0x5bec('0x14e')+util[_0x5bec('0x90')](_0x11ea81,{'showHidden':![],'depth':null})+_0x5bec('0x14f')+_0x1bcfd3));}})[_0x5bec('0xa8')](function(_0x2ba43e){return _0x3bcd32(msgResponse('ifTime',_0x5bec('0x13d'),JSON[_0x5bec('0x45')](_0x2ba43e)));});});};Dialer[_0x5bec('0x1b')][_0x5bec('0x150')]=function(_0xd31995){var _0x2b3181=this;return function(){switch(_0xd31995[_0x5bec('0x151')]){case _0x5bec('0x152'):freeVariablesPredictive(_0xd31995);_0x2b3181[_0x5bec('0x153')](_0xd31995,0x1);break;case _0x5bec('0x154'):freeVariablesPredictive(_0xd31995);_0x2b3181[_0x5bec('0x153')](_0xd31995,_0xd31995['dialPowerLevel']);break;case _0x5bec('0x9'):_0x2b3181['predictive'](_0xd31995);break;case _0x5bec('0x155'):freeVariablesPredictive(_0xd31995);_0x2b3181['handlePower'](_0xd31995,0x1);break;default:freeVariablesPredictive(_0xd31995);logger[_0x5bec('0x8f')](_0x5bec('0x156'),_0xd31995[_0x5bec('0x3b')],'method\x20not\x20recognized');}};};Dialer[_0x5bec('0x1b')][_0x5bec('0x157')]=function(_0x3281d5){var _0x30125d=this;return function(){_0x30125d[_0x5bec('0x158')](_0x3281d5);};};Dialer['prototype'][_0x5bec('0xb')]=function(_0x40d8e7){var _0x52cda2=this;if(isNotPreview(_0x40d8e7[_0x5bec('0x151')])){if(isVoiceQueueOutbound(_0x40d8e7[_0x5bec('0x49')])&&isActive(_0x40d8e7['dialActive'])){_0x40d8e7[_0x5bec('0x98')]=!![];BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](checkIsLoggedIn(_0x40d8e7,_0x40d8e7[_0x5bec('0x4d')]))['then'](checkIsActive(_0x40d8e7,_0x40d8e7[_0x5bec('0x56')]))['then'](checkInterval(_0x40d8e7))[_0x5bec('0xb0')](_0x52cda2['checkIsTrunkReachable'](_0x40d8e7))[_0x5bec('0xb0')](_0x52cda2[_0x5bec('0x13b')](_0x40d8e7[_0x5bec('0x159')],_0x40d8e7[_0x5bec('0x15a')],_0x40d8e7[_0x5bec('0x3b')],_0x40d8e7))['then'](_0x52cda2['checkIfTimeIntervals'](_0x40d8e7[_0x5bec('0x3f')],_0x40d8e7[_0x5bec('0x15a')],_0x40d8e7['name'],_0x40d8e7))[_0x5bec('0xb0')](_0x52cda2[_0x5bec('0x150')](_0x40d8e7))[_0x5bec('0xa8')](loggerCatchQueueSummary(_0x5bec('0x15b'),_0x40d8e7));}else{notSendMessagesQueue(_0x40d8e7);}}else{freeVariablesPredictive(_0x40d8e7);}};Dialer[_0x5bec('0x1b')][_0x5bec('0x136')]=function(){var _0x3dd7ab=this;var _0x1da1e6;for(var _0x140748 in this[_0x5bec('0xf3')]){if(typeof this[_0x5bec('0xf3')][_0x140748]!==_0x5bec('0x93')){_0x1da1e6=this['campaigns'][_0x140748];if(isCampaignIvr(_0x1da1e6[_0x5bec('0x49')])&&isActive(_0x1da1e6['active'])){_0x1da1e6['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x5bec('0xb0')](checkIsActive(_0x1da1e6,_0x1da1e6[_0x5bec('0x6f')]))[_0x5bec('0xb0')](checkInterval(_0x1da1e6))[_0x5bec('0xb0')](_0x3dd7ab['checkIsTrunkReachable'](_0x1da1e6))[_0x5bec('0xb0')](_0x3dd7ab[_0x5bec('0x13b')](_0x1da1e6[_0x5bec('0x159')],_0x1da1e6[_0x5bec('0x15a')],_0x1da1e6[_0x5bec('0x3b')],_0x1da1e6))[_0x5bec('0xb0')](_0x3dd7ab['checkIfTimeIntervals'](_0x1da1e6['Interval'],_0x1da1e6[_0x5bec('0x15a')],_0x1da1e6[_0x5bec('0x3b')],_0x1da1e6))[_0x5bec('0xb0')](_0x3dd7ab[_0x5bec('0x157')](_0x1da1e6))[_0x5bec('0xa8')](loggerCatchQueueSummary(_0x5bec('0x15c'),_0x1da1e6));}else{notSendMessagesCampaign(_0x1da1e6);}}}};function getCallerIdRandom(_0x3feee3,_0x486f98){var _0x28b63f;var _0xaefcd0;var _0xacf9dc;if(_0x486f98<=0x0){_0x486f98=0x1;}_0x28b63f=new RegExp('\x5cw{0,'+_0x486f98+'}$');_0xaefcd0=Math['pow'](0xa,_0x486f98-0x1);_0xacf9dc=Math['pow'](0xa,_0x486f98)-0x1;return util[_0x5bec('0x70')]('%s',_[_0x5bec('0x15d')](_0x3feee3,_0x28b63f,_[_0x5bec('0x15e')](_0xaefcd0,_0xacf9dc)));}function extractCalleridName(_0x4d7923){var _0x3e529c=_0x4d7923[_0x5bec('0x15f')](/"(.*?)"/);return _0x3e529c?_0x3e529c[0x1]:_0x4d7923;}function extractCalleridNumber(_0x27085f){var _0x323057=_0x27085f[_0x5bec('0x15f')](/<(.*?)>/);return _0x323057?_0x323057[0x1]:_0x27085f;}Dialer['prototype']['actionOriginate']=function(_0x244733,_0x179bfc){var _0x73f273=this;var _0x86dd64=uuid['v4']();this[_0x5bec('0xa4')][_0x86dd64]=new Action(_0x244733,_0x179bfc,_0x86dd64);return new BPromise(function(_0x1d34a5,_0x44480d){if(_[_0x5bec('0x39')](_0x244733)&&typeof _0x244733!==_0x5bec('0x160')){return _0x44480d(msgResponse('originate',_0x5bec('0x13d'),_0x5bec('0x161')));}if(_['isUndefined'](_0x179bfc['Contact'][_0x5bec('0x162')])||_0x179bfc[_0x5bec('0x163')][_0x5bec('0x162')]===null){return _0x44480d(msgResponse('originate',_0x5bec('0x13d'),_0x5bec('0x164')));}var _0x128778={'XMD-CALLERID':_0x73f273[_0x5bec('0xa4')][_0x86dd64]['getCaller'](),'XMD-AGI':_0x244733[_0x5bec('0x101')]?util['format'](_0x5bec('0x165'),ipAgi,_0x244733['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x244733[_0x5bec('0x107')]?util[_0x5bec('0x70')]('\x22agi://%s/square,%s\x22',ipAgi,_0x244733[_0x5bec('0x107')]):_0x5bec('0x166'),'XMD-QUEUE':_0x244733[_0x5bec('0x49')]===_0x5bec('0x4a')?util[_0x5bec('0x70')](_0x5bec('0x167'),_0x244733['name'],_0x244733[_0x5bec('0x168')]||'',_0x244733['dialAgiAfterHangupAgent']?'c':'',_0x244733[_0x5bec('0x110')]||0x3):_0x5bec('0x166'),'XMD-CONTACTID':_0x179bfc['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x73f273[_0x5bec('0xa4')][_0x86dd64][_0x5bec('0x169')](),'XMD-AMD':_0x244733[_0x5bec('0xd7')]?_0x5bec('0x16a'):_0x5bec('0x166'),'XMD-DESTINATION':_0x5bec('0x16b')};if(_0x244733[_0x5bec('0xd7')]){_0x128778[_0x5bec('0x16c')]=_0x244733[_0x5bec('0x16d')]||0x9c4;_0x128778['XMD-AMDGREETING']=_0x244733[_0x5bec('0x16e')]||0x5dc;_0x128778[_0x5bec('0x16f')]=_0x244733[_0x5bec('0x170')]||0x320;_0x128778[_0x5bec('0x171')]=_0x244733['dialAMDTotalAnalysisTime']||0x1388;_0x128778[_0x5bec('0x172')]=_0x244733[_0x5bec('0x173')]||0x64;_0x128778['XMD-AMDBETWEENWORDSSILENCE']=_0x244733['dialAMDBetweenWordsSilence']||0x32;_0x128778['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x244733[_0x5bec('0x174')]||0x3;_0x128778[_0x5bec('0x175')]=_0x244733[_0x5bec('0x176')]||0x100;_0x128778[_0x5bec('0x177')]=_0x244733['dialAMDMaximumWordLength']||0x1388;}if(_0x244733[_0x5bec('0x49')]===_0x5bec('0x4a')){_0x128778[_0x5bec('0x178')]=_0x179bfc['VoiceQueueId'];}else{_0x128778['XMD-CAMPAIGNID']=_0x179bfc[_0x5bec('0xf2')];}for(var _0x2342fd in _0x179bfc['Contact']){if(typeof _0x179bfc[_0x5bec('0x163')][_0x2342fd]!==_0x5bec('0x93')){if(isNotNull(_0x179bfc[_0x5bec('0x163')][_0x2342fd])&&_0x2342fd!=='id'&&_0x2342fd!==_0x5bec('0x179')&&_0x2342fd!==_0x5bec('0x17a')&&_0x2342fd!==_0x5bec('0x17b')){_0x128778[util[_0x5bec('0x70')](_0x5bec('0x17c'),_0x5bec('0x17d'),_['toUpper'](_0x2342fd))]=_0x179bfc[_0x5bec('0x163')][_0x2342fd];}}}var _0x2c7d0a=_0x73f273[_0x5bec('0xce')](_0x244733[_0x5bec('0x6e')])?getCallerId(_0x244733[_0x5bec('0x6e')][_0x5bec('0x17e')],_0x244733['dialOriginateCallerIdName'],_0x244733[_0x5bec('0x17f')]>0x0?getCallerIdRandom(_0x244733[_0x5bec('0x57')],_0x244733[_0x5bec('0x17f')]):_0x244733['dialOriginateCallerIdNumber']):getCallerId(_[_0x5bec('0xd3')](_0x244733[_0x5bec('0x138')])?_0x244733[_0x5bec('0x6e')][_0x5bec('0x17e')]:_0x244733['TrunkBackup']['callerid'],_0x244733[_0x5bec('0x180')],_0x244733[_0x5bec('0x17f')]>0x0?getCallerIdRandom(_0x244733[_0x5bec('0x57')],_0x244733[_0x5bec('0x17f')]):_0x244733['dialOriginateCallerIdNumber']);if(_0x2c7d0a){_0x128778[_0x5bec('0x181')]=_0x73f273[_0x5bec('0xa4')][_0x86dd64][_0x5bec('0x182')]=extractCalleridName(_0x2c7d0a);_0x128778[_0x5bec('0x183')]=_0x73f273[_0x5bec('0xa4')][_0x86dd64]['originatecalleridnum']=extractCalleridNumber(_0x2c7d0a);}return ami[_0x5bec('0xa6')]({'actionid':_0x86dd64,'action':'originate','channel':_0x73f273['isTrunkReachable'](_0x244733[_0x5bec('0x6e')])?util[_0x5bec('0x70')](_0x5bec('0x184'),_0x244733['Trunk']['name'],isNotNull(_0x244733[_0x5bec('0x58')])?_0x244733['dialPrefix']['trim']()||'':'',_0x244733[_0x5bec('0x185')]>0x0?_0x179bfc[_0x5bec('0x163')][_0x5bec('0x162')][_0x5bec('0x186')](_0x244733[_0x5bec('0x185')]):_0x179bfc[_0x5bec('0x163')][_0x5bec('0x162')]):util[_0x5bec('0x70')](_0x5bec('0x184'),_['isNil'](_0x244733[_0x5bec('0x138')])?_0x244733[_0x5bec('0x6e')][_0x5bec('0x3b')]:_0x244733[_0x5bec('0x138')][_0x5bec('0x3b')],isNotNull(_0x244733[_0x5bec('0x58')])?_0x244733['dialPrefix'][_0x5bec('0x187')]()||'':'',_0x244733['dialCutDigit']>0x0?_0x179bfc[_0x5bec('0x163')][_0x5bec('0x162')][_0x5bec('0x186')](_0x244733[_0x5bec('0x185')]):_0x179bfc['Contact'][_0x5bec('0x162')]),'callerid':_0x2c7d0a,'Exten':_0x5bec('0x16b'),'Context':'from-sip','Priority':'1','variable':_0x128778,'timeout':(_0x244733[_0x5bec('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x86dd64})[_0x5bec('0xb0')](function(_0x1ccbb4){return _0x1d34a5(_0x1ccbb4);})[_0x5bec('0xa8')](function(_0x4200cb){_0x244733[_0x5bec('0x61')]+=0x1;var _0x5e43d1=new History(_0x73f273['actions'][_0x86dd64]);logger[_0x5bec('0x8f')](util[_0x5bec('0x70')](_0x5bec('0x189'),JSON['stringify'](_0x4200cb)));_0x5e43d1[_0x5bec('0x9d')]=0xe;_0x5e43d1['statedesc']=_0x5bec('0x18a');_0x5e43d1[_0x5bec('0xa0')]=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));_0x5e43d1[_0x5bec('0x9f')]=_0x5e43d1[_0x5bec('0xa0')];_0x73f273[_0x5bec('0xc2')](_0x5e43d1)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x18b')));_0x73f273[_0x5bec('0xc0')](_0x5e43d1)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x18b')))[_0x5bec('0x1e')](function(){delete _0x73f273[_0x5bec('0xa4')][_0x86dd64];return _0x44480d(msgResponse(_0x5bec('0x18c'),'Error',_0x5bec('0x18d')));});});});};Dialer[_0x5bec('0x1b')][_0x5bec('0x18e')]=function(_0x31ee25){var _0x364569=this[_0x5bec('0xa4')][_0x31ee25['actionid']];if(_0x364569){delete this[_0x5bec('0xa4')][_0x31ee25[_0x5bec('0x11e')]];_0x364569[_0x5bec('0x18f')]=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));var _0x365b78=_0x364569[_0x5bec('0x49')]==='ivr'?this[_0x5bec('0xf3')][_0x364569[_0x5bec('0xab')]]:this['voiceQueues'][_0x364569['getQueue']()];if(!this[_0x5bec('0xcd')](_0x31ee25[_0x5bec('0x190')])){this[_0x5bec('0xa9')](_0x365b78);return this[_0x5bec('0x191')](_0x364569,_0x365b78,_0x31ee25)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x192')));}this[_0x5bec('0xa2')][_0x31ee25['uniqueid']]=_0x364569;}};Dialer[_0x5bec('0x1b')][_0x5bec('0x193')]=function(_0x51d625,_0xf4debc,_0xd23c8){var _0x17ed5f=new History(_0xf4debc);if(_0x17ed5f[_0x5bec('0xe4')]+_0x17ed5f['countcongestionretry']+_0x17ed5f[_0x5bec('0xe6')]+_0x17ed5f['countnosuchnumberretry']+_0x17ed5f[_0x5bec('0xe8')]+_0x17ed5f[_0x5bec('0xf9')]+_0x17ed5f[_0x5bec('0xe1')]+_0x17ed5f[_0x5bec('0xfa')]>=_0xd23c8[_0x5bec('0xe9')]-0x1){return!![];}switch(_0x51d625){case 0x3:if(_0x17ed5f[_0x5bec('0xe6')]>=_0xd23c8[_0x5bec('0x194')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x17ed5f[_0x5bec('0xe6')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0x195')],_0x5bec('0xf0'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x196')));break;case 0x5:if(_0x17ed5f[_0x5bec('0xe4')]>=_0xd23c8['dialBusyMaxRetry']-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countbusyretry':_0x17ed5f[_0x5bec('0xe4')]+=0x1,'scheduledat':moment()['add'](_0xd23c8[_0x5bec('0x197')],'minutes')[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x198')));break;case 0x8:if(_0x17ed5f[_0x5bec('0xe5')]>=_0xd23c8[_0x5bec('0x199')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countcongestionretry':_0x17ed5f[_0x5bec('0xe5')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0x19a')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f['ContactId'],'ListId':_0x17ed5f['ListId'],'VoiceQueueId':_0x17ed5f['VoiceQueueId']||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x19b')));break;case 0x0:if(_0x17ed5f['countnosuchnumberretry']>=_0xd23c8[_0x5bec('0x19c')]-0x1){return!![];}else{this[_0x5bec('0xb6')]({'active':![],'countnosuchnumberretry':_0x17ed5f[_0x5bec('0xe7')]+=0x1,'scheduledat':moment()['add'](_0xd23c8[_0x5bec('0x19d')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f['ContactId'],'ListId':_0x17ed5f['ListId'],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x19e')));}break;case 0xa:if(_0x17ed5f[_0x5bec('0xe8')]>=_0xd23c8[_0x5bec('0x114')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countdropretry':_0x17ed5f[_0x5bec('0xe8')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8['dialDropRetryFrequency'],_0x5bec('0xf0'))[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f['VoiceQueueId']||undefined,'CampaignId':_0x17ed5f[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x115')));break;case 0xb:if(_0x17ed5f['countabandonedretry']>=_0xd23c8[_0x5bec('0x11b')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countabandonedretry':_0x17ed5f[_0x5bec('0xf9')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0x11c')],_0x5bec('0xf0'))[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17ed5f['ContactId'],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x11d')));break;case 0x13:if(_0x17ed5f[_0x5bec('0xe1')]>=_0xd23c8[_0x5bec('0xec')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countmachineretry':_0x17ed5f[_0x5bec('0xe1')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0xfb')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xfc')));break;case 0x14:if(_0x17ed5f[_0x5bec('0xfa')]>=_0xd23c8[_0x5bec('0x19f')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countagentrejectretry':_0x17ed5f['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0x1a0')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x5bec('0x1b')]['callProgressDetecting']=function(_0x560e1a,_0x35e7bc,_0x476ae9){var _0x55bfda=this;var _0xef2d8d=new History(_0x560e1a);return new BPromise(function(_0x2c9ab3,_0x5b2a52){if(_[_0x5bec('0x39')](_0x35e7bc)&&typeof _0x35e7bc!==_0x5bec('0x160')){return _0x5b2a52(msgResponse(_0x5bec('0x1a1'),_0x5bec('0x13d'),'entity\x20is\x20undefine'));}if(_[_0x5bec('0x39')](_0x476ae9)&&typeof _0x476ae9!==_0x5bec('0x160')){return _0x5b2a52(msgResponse(_0x5bec('0x1a1'),_0x5bec('0x13d'),_0x5bec('0x1a2')));}switch(_0x476ae9['reason']){case'0':_0x35e7bc[_0x5bec('0x60')]+=0x1;_0xef2d8d['state']=0x0;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x1a3');_0xef2d8d['countnosuchnumberretry']+=0x1;_0xef2d8d['countglobal']+=0x1;ami['emit'](_0x5bec('0x1a4'),ut['buildObj'](_0x560e1a,_0x5bec('0x1a5')));_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x55bfda[_0x5bec('0x193')](0x0,_0x560e1a,_0x35e7bc)){if(_0xef2d8d[_0x5bec('0xe7')]>=_0x35e7bc[_0x5bec('0x19c')]){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,'reason\x200\x20no\x20such\x20number....');}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1a6'));}}break;case'3':_0x35e7bc[_0x5bec('0x5f')]+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0x3;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x1a7');_0xef2d8d[_0x5bec('0xe6')]+=0x1;_0xef2d8d[_0x5bec('0xe2')]+=0x1;ami[_0x5bec('0x48')]('custom:agentnoanswer',ut[_0x5bec('0xdc')](_0x560e1a,_0x5bec('0x1a8')));_0x55bfda['createHistory'](_0xef2d8d)['catch'](loggerCatch(_0x5bec('0x1a9')));if(_0x55bfda[_0x5bec('0x193')](0x3,_0x560e1a,_0x35e7bc)){if(_0xef2d8d[_0x5bec('0xe6')]>=_0x35e7bc[_0x5bec('0x194')]){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1aa'));}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1aa'));}}break;case'5':_0x35e7bc[_0x5bec('0x5b')]+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0x5;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x1ab');_0xef2d8d[_0x5bec('0xe4')]+=0x1;_0xef2d8d[_0x5bec('0xe2')]+=0x1;ami[_0x5bec('0x48')](_0x5bec('0x1ac'),ut[_0x5bec('0xdc')](_0x560e1a,'busy'));_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x1ad')));if(_0x55bfda[_0x5bec('0x193')](0x5,_0x560e1a,_0x35e7bc)){if(_0xef2d8d['countbusyretry']>=_0x35e7bc[_0x5bec('0x1ae')]){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1af'));}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1af'));}}break;case'8':_0x35e7bc['outboundCongestionCallsDay']+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0x8;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x1b0');_0xef2d8d[_0x5bec('0xe5')]+=0x1;_0xef2d8d[_0x5bec('0xe2')]+=0x1;ami[_0x5bec('0x48')]('custom:agentcongestion',ut[_0x5bec('0xdc')](_0x560e1a,_0x5bec('0x1b1')));_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x55bfda[_0x5bec('0x193')](0x8,_0x560e1a,_0x35e7bc)){if(_0xef2d8d[_0x5bec('0xe5')]>=_0x35e7bc[_0x5bec('0x199')]){_0x55bfda['createStateFinal'](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b2'));}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,'reason\x208\x20congestion');}}break;case'11':_0x35e7bc[_0x5bec('0x1b3')]+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0xb;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x119');_0xef2d8d['countabandonedretry']+=0x1;_0xef2d8d['countglobal']+=0x1;_0x55bfda['createHistory'](_0xef2d8d)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x1b4')));if(_0x55bfda[_0x5bec('0x193')](0xb,_0x560e1a,_0x35e7bc)){if(_0xef2d8d['countabandonedretry']>=_0x35e7bc['dialAbandonedMaxRetry']){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b5'));}else{_0x55bfda['stateGlobal'](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b5'));}}break;case'20':_0x35e7bc[_0x5bec('0x63')]+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0x14;_0xef2d8d[_0x5bec('0x9e')]='AgentReject';_0xef2d8d[_0x5bec('0xfa')]+=0x1;_0xef2d8d['countglobal']+=0x1;ami[_0x5bec('0x48')]('custom:agentreject',ut['buildObj'](_0x560e1a,_0x5bec('0x1b6')));_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x55bfda['checkRetriveMax'](0x14,_0x560e1a,_0x35e7bc)){if(_0xef2d8d['countagentrejectretry']>=_0x35e7bc['dialAgentRejectMaxRetry']){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b7'));}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b7'));}}break;default:_0x35e7bc['outboundUnknownCallsDay']+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0xc;_0xef2d8d['statedesc']=_0x476ae9[_0x5bec('0x104')];_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x55bfda['checkRetriveMax'](_0x476ae9[_0x5bec('0x104')],_0x560e1a,_0x35e7bc)){if(_0xef2d8d[_0x5bec('0xe4')]+_0xef2d8d[_0x5bec('0xe5')]+_0xef2d8d['countnoanswerretry']+_0xef2d8d[_0x5bec('0xe7')]+_0xef2d8d[_0x5bec('0xe8')]+_0xef2d8d[_0x5bec('0xf9')]+_0xef2d8d[_0x5bec('0xe1')]+_0xef2d8d[_0x5bec('0xfa')]>=_0x35e7bc[_0x5bec('0xe9')]){_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x476ae9[_0x5bec('0x104')]);}else{_0x55bfda['createStateFinal'](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x476ae9[_0x5bec('0x104')]);}}}});};Dialer[_0x5bec('0x1b')][_0x5bec('0xea')]=function(_0x1d955c,_0x3421fa,_0x5847f5,_0x11d2af){var _0x10796f=new Final(_0x1d955c);_0x10796f[_0x5bec('0x9d')]=0xf;_0x10796f[_0x5bec('0x9e')]='Global';this['createStateFinal'](_0x10796f,_0x3421fa,_0x5847f5,_0x11d2af);};Dialer[_0x5bec('0x1b')][_0x5bec('0xed')]=function(_0x29e66e,_0x1fab21,_0x526705,_0x21f7a6){this[_0x5bec('0xc0')](_0x29e66e)['then'](function(){return _0x1fab21(msgResponse(_0x5bec('0x1a1'),_0x5bec('0x1b8'),_0x21f7a6));})[_0x5bec('0xa8')](function(){return _0x526705(msgResponse('[moveContactManagedDialer][0]','Failure',_0x5bec('0x1b9')));});};Dialer[_0x5bec('0x1b')]['predictive']=function(_0x277f5b){var _0x30fe46=_0x277f5b[_0x5bec('0x1ba')]/0x64;var _0x1cec75=_0x277f5b[_0x5bec('0x5e')]/(_0x277f5b[_0x5bec('0x5e')]+_0x277f5b[_0x5bec('0x5a')]);var _0x1c09ed=Math[_0x5bec('0x1bb')](_0x277f5b[_0x5bec('0x68')]*(_0x277f5b[_0x5bec('0x1bc')]/0x64));var _0x2bf530=Math[_0x5bec('0x1bb')](_0x277f5b['predictiveIntervalAvailable']*(_0x277f5b['predictiveIntervalMinThreshold']/0x64));var _0x263c4b=_0x277f5b[_0x5bec('0x4c')]+_0x277f5b[_0x5bec('0x51')];var _0x192d39=Math[_0x5bec('0x1bd')](_0x277f5b[_0x5bec('0x6b')]*_0x277f5b['erlangAbandonmentRate']*_0x277f5b[_0x5bec('0x1be')]*_0x277f5b[_0x5bec('0x66')]);if(_[_0x5bec('0x39')](_0x277f5b[_0x5bec('0x29')])){if(!_['isUndefined'](_0x277f5b[_0x5bec('0x28')])){_0x277f5b[_0x5bec('0x28')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x5bec('0x1bf'));}if(!_[_0x5bec('0x39')](_0x277f5b[_0x5bec('0x8a')])){loggerPredictive['error'](_0x5bec('0x1c0'),_0x5bec('0x1c1'));clearInterval(_0x277f5b[_0x5bec('0x8a')]);_0x277f5b[_0x5bec('0x8a')]=undefined;}_0x277f5b[_0x5bec('0x29')]=moment()['format'](_0x5bec('0xf1'));loggerPredictive['info'](_0x277f5b[_0x5bec('0x3b')],_0x5bec('0x1c2'),_0x277f5b[_0x5bec('0x29')]);this['handlePower'](_0x277f5b,0x1);}else if(ifInterval(_0x277f5b[_0x5bec('0x1c3')],_0x277f5b[_0x5bec('0x29')])){this[_0x5bec('0x153')](_0x277f5b,0x1);loggerPredictiveCalls[_0x5bec('0x75')]('[startMethodPredictive][StartProgressive][Loop]',_0x277f5b[_0x5bec('0x29')],_0x277f5b[_0x5bec('0x3b')]);_0x277f5b[_0x5bec('0x6b')]=0x0;_0x277f5b[_0x5bec('0x111')]=0x0;}else if(_0x30fe46<_0x1cec75&&_0x277f5b[_0x5bec('0x1c4')]===_0x5bec('0x1c5')){freeVariablesPredictive(_0x277f5b);loggerPredictive['info'](_0x5bec('0x1c6'),_0x5bec('0x1c7'),_0x1cec75,_0x5bec('0x29'),_0x277f5b[_0x5bec('0x3b')]);}else if(_0x192d39<_0x277f5b[_0x5bec('0x111')]&&_0x277f5b[_0x5bec('0x1c4')]===_0x5bec('0x1c5')){freeVariablesPredictive(_0x277f5b);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x1c8'),_0x5bec('0x1c9'),_0x192d39,_0x5bec('0x1ca'),_0x277f5b[_0x5bec('0x111')],_0x5bec('0x29'),_0x277f5b[_0x5bec('0x3b')]);}else if(!ifInterval(_0x277f5b[_0x5bec('0x1c3')],_0x277f5b['startProgressive'])&&_[_0x5bec('0x39')](_0x277f5b['startPredictive'])&&!_[_0x5bec('0x39')](_0x277f5b[_0x5bec('0x29')])){_0x277f5b['startPredictive']=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));loggerPredictive[_0x5bec('0x75')](_0x277f5b[_0x5bec('0x3b')],_0x5bec('0x1cb'),_0x277f5b['startPredictive']);this[_0x5bec('0xb4')](_0x277f5b[_0x5bec('0x1c3')])[_0x5bec('0xb0')](this[_0x5bec('0x1cc')](_0x277f5b))[_0x5bec('0xb0')](mergeDataErlangB(_0x277f5b))[_0x5bec('0xb0')](this[_0x5bec('0x1cd')](_0x277f5b))[_0x5bec('0xa8')](loggerCatchPredictive(_0x5bec('0x1ce'),_0x277f5b));}else if(!ifInterval(_0x277f5b[_0x5bec('0x1c3')],_0x277f5b[_0x5bec('0x28')])){_0x277f5b[_0x5bec('0x111')]=0x0;_0x277f5b[_0x5bec('0x28')]=moment()[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x5bec('0x75')](_0x277f5b['name'],_0x5bec('0x1cf'),_0x277f5b[_0x5bec('0x28')]);clearInterval(_0x277f5b[_0x5bec('0x8a')]);_0x277f5b[_0x5bec('0x8a')]=undefined;this[_0x5bec('0xb4')](_0x277f5b[_0x5bec('0x1c3')])[_0x5bec('0xb0')](this[_0x5bec('0x1cc')](_0x277f5b))['then'](mergeDataErlangB(_0x277f5b))[_0x5bec('0xb0')](this[_0x5bec('0x1cd')](_0x277f5b))[_0x5bec('0xa8')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x277f5b));}else if(_0x277f5b['predictiveIntervalAvailable']&&_0x263c4b<_0x277f5b['predictiveIntervalAvailable']-_0x2bf530){freeVariablesPredictive(_0x277f5b);loggerPredictive[_0x5bec('0x75')](_0x277f5b[_0x5bec('0x3b')],_0x5bec('0x1d0'),_0x263c4b,_0x5bec('0x1d1'),_0x277f5b['predictiveIntervalAvailable'],'-',_0x2bf530,'=',_0x277f5b['predictiveIntervalAvailable']-_0x2bf530,')');}else if(_0x277f5b[_0x5bec('0x68')]&&_0x263c4b>_0x277f5b[_0x5bec('0x68')]+_0x1c09ed){freeVariablesPredictive(_0x277f5b);loggerPredictive['info'](_0x277f5b[_0x5bec('0x3b')],_0x5bec('0x1d0'),_0x263c4b,')\x20are\x20more\x20than\x20threshold\x20(',_0x277f5b[_0x5bec('0x68')],'+',_0x1c09ed,'=',_0x277f5b[_0x5bec('0x68')]+_0x1c09ed,')');}};Dialer[_0x5bec('0x1b')][_0x5bec('0x1cc')]=function(_0x3b7ccd){var _0x4f23a6=this;return function(_0x10e12c){return new BPromise(function(_0x1a2e85,_0x540cad){_[_0x5bec('0x86')](_0x3b7ccd,_0x10e12c[0x0]);if(checkGetDataPredictive(_0x10e12c[0x0])){var _0x150484=_0x3b7ccd[_0x5bec('0x68')]=_0x3b7ccd['talking']+_0x3b7ccd[_0x5bec('0x4c')];var _0x47133c=_0x3b7ccd[_0x5bec('0x1c3')]*0x3c;var _0x1a422d=_0x10e12c[0x0][_0x5bec('0x7d')]+_0x10e12c[0x0][_0x5bec('0x64')];var _0x44d261=(_0x10e12c[0x0]['predictiveIntervalAnsweredCalls']+_0x10e12c[0x0][_0x5bec('0x65')]+_0x10e12c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x10e12c[0x0][_0x5bec('0x69')];_0x3b7ccd['predictiveIntervalHitRate']=_0x44d261>0x0?_0x44d261:0x1;switch(_0x3b7ccd[_0x5bec('0x1c4')]){case _0x5bec('0x1c5'):var _0x55d14d=_0x3b7ccd['dialPredictiveOptimizationPercentage']/0x64;return _0x4f23a6['abandonmentRate'](_0x150484,_0x47133c,_0x1a422d,_0x44d261,_0x55d14d)['then'](function(_0x677d7f){return _0x1a2e85(_0x677d7f);});case _0x5bec('0x1d2'):var _0x2cc447=_0x3b7ccd['dialPredictiveOptimizationPercentage']/0x64;return _0x4f23a6['busyFactor'](_0x150484,_0x47133c,_0x1a422d,_0x44d261,_0x2cc447)['then'](function(_0x29fef7){return _0x1a2e85(_0x29fef7);});default:return _0x540cad(msgResponse(_0x5bec('0x1d3'),_0x5bec('0x13d'),_0x5bec('0x1d4')));}}else{return _0x540cad(msgResponse(_0x5bec('0x1d3'),_0x5bec('0x13d'),'check\x20failure'));}});};};Dialer['prototype'][_0x5bec('0x1d5')]=function(_0x1326f7){var _0xef8b54=this;return function(_0x6aa51c){return new BPromise(function(_0x219d15,_0x495a92){_['merge'](_0x1326f7,_0x6aa51c[0x0]);if(checkGetDataPredictive(_0x6aa51c[0x0])){loggerPredictive['info'](JSON[_0x5bec('0x45')](_0x6aa51c[0x0]));if(_0x1326f7[_0x5bec('0x1c4')]===_0x5bec('0x1c5')){return _0xef8b54[_0x5bec('0xbe')](_0x1326f7['id'])['then'](function(_0x439461){var _0x4fec9e=_0x1326f7['loggedIn']-_0x439461[0x0]['outboundQueuePauses'];var _0x591b1f=_0x1326f7[_0x5bec('0x1c3')]*0x3c;var _0x287ade=_0x6aa51c[0x0]['predictiveIntervalAvgTalktime']+_0x6aa51c[0x0][_0x5bec('0x64')];var _0x58fcd3=(_0x6aa51c[0x0][_0x5bec('0x79')]+_0x6aa51c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x6aa51c[0x0][_0x5bec('0x7a')])/_0x6aa51c[0x0][_0x5bec('0x69')];var _0x50a5ed=_0x1326f7[_0x5bec('0x1ba')]/0x64;_0x1326f7['predictiveIntervalPauses']=_0x439461[0x0]['outboundQueuePauses']||0x0;_0x1326f7['predictiveIntervalHitRate']=_0x58fcd3>0x0?_0x58fcd3:0x1;return _0xef8b54[_0x5bec('0x1d6')](_0x4fec9e,_0x591b1f,_0x287ade,_0x58fcd3,_0x50a5ed);})[_0x5bec('0xb0')](function(_0x1800db){return _0x219d15(_0x1800db);})[_0x5bec('0xa8')](function(_0x1acabe){return _0x495a92(msgResponse(_0x5bec('0x1d7'),_0x5bec('0x13d'),JSON[_0x5bec('0x45')](_0x1acabe)));});}if(_0x1326f7[_0x5bec('0x1c4')]==='agentBusyFactor'){return _0xef8b54[_0x5bec('0xbe')](_0x1326f7['id'])[_0x5bec('0xb0')](function(_0x555279){var _0x149e84=_0x1326f7[_0x5bec('0x4d')]-_0x555279[0x0][_0x5bec('0x1d8')];var _0x1b5889=_0x1326f7[_0x5bec('0x1c3')]*0x3c;var _0x3b27c0=_0x6aa51c[0x0]['predictiveIntervalAvgTalktime']+_0x6aa51c[0x0][_0x5bec('0x64')];var _0x67f9b9=(_0x6aa51c[0x0][_0x5bec('0x79')]+_0x6aa51c[0x0][_0x5bec('0x65')]+_0x6aa51c[0x0][_0x5bec('0x7a')])/_0x6aa51c[0x0][_0x5bec('0x69')];var _0x20c73a=_0x1326f7[_0x5bec('0x1ba')]/0x64;_0x1326f7[_0x5bec('0x67')]=_0x555279[0x0][_0x5bec('0x1d8')]||0x0;_0x1326f7[_0x5bec('0x1be')]=_0x67f9b9>0x0?_0x67f9b9:0x1;return _0xef8b54[_0x5bec('0x1d9')](_0x149e84,_0x1b5889,_0x3b27c0,_0x67f9b9,_0x20c73a);})[_0x5bec('0xb0')](function(_0x287a9d){return _0x219d15(_0x287a9d);})['catch'](function(_0x43b31e){return _0x495a92(msgResponse(_0x5bec('0x1d7'),'Failure',JSON[_0x5bec('0x45')](_0x43b31e)));});}}else{return _0x495a92(msgResponse(_0x5bec('0x1d3'),'Failure',_0x5bec('0x1da')));}});};};Dialer[_0x5bec('0x1b')][_0x5bec('0x1cd')]=function(_0x3cb589){var _0x596a2b=this;return function(){var _0xb0bd99=0x0;var _0x207604=Math[_0x5bec('0x1bd')](_0x3cb589[_0x5bec('0x6c')]*0x3e8);if(_0x207604>0x0){_0x207604=_0x207604<0x64?0x64:_0x207604;loggerPredictive[_0x5bec('0x75')](_0x3cb589['name'],_0x5bec('0x1db'),_0x207604,_0x5bec('0x87'));_0x3cb589[_0x5bec('0x8a')]=setInterval(function(){_0x596a2b['handlePredictive'](_0x3cb589);loggerPredictiveCalls['info'](_0x5bec('0x1dc'),_0xb0bd99+=0x1);},_0x207604);}else{loggerPredictive[_0x5bec('0x75')](_0x3cb589[_0x5bec('0x3b')],_0x5bec('0x1dd'));}};};Dialer[_0x5bec('0x1b')][_0x5bec('0x1de')]=function(_0x3cdb72,_0x4b6990){var _0x5167fa=this;return function(_0x8df993){if(_[_0x5bec('0x42')](_0x8df993)){if(_[_0x5bec('0xd3')](_0x4b6990['UserId'])||!_0x4b6990[_0x5bec('0x1df')]){if(_0x3cdb72[_0x5bec('0x151')]===_0x5bec('0x155')){_0x3cdb72['queueStatusComplete']=_[_0x5bec('0x39')](_0x3cdb72[_0x5bec('0x125')])?!![]:_0x3cdb72['queueStatusComplete'];var _0x25ded3=uuid['v4']();_0x5167fa[_0x5bec('0xa4')][_0x25ded3]=new Action(_0x3cdb72,_0x4b6990,_0x25ded3);loggerBooked['info'](_0x5bec('0x1e0'),_0x25ded3,_0x5bec('0x1e1'),JSON[_0x5bec('0x45')](_0x3cdb72[_0x5bec('0x125')]),_0x5bec('0x1e2'),_0x3cdb72['name']);if(_0x3cdb72['queueStatusComplete']){_0x3cdb72['queueStatusComplete']=![];_0x5167fa['queueBooked'][_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xab')]]=[];ami[_0x5bec('0xa6')]({'actionid':_0x25ded3,'action':_0x5bec('0x1e3'),'queue':_0x3cdb72[_0x5bec('0x3b')]})[_0x5bec('0xa8')](function(){_0x5167fa[_0x5bec('0xa9')](_0x3cdb72);_0x5167fa[_0x5bec('0xb6')]({'active':![],'ContactId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xc8')],'ListId':_0x5167fa['actions'][_0x25ded3][_0x5bec('0xc9')],'VoiceQueueId':_0x5167fa['actions'][_0x25ded3][_0x5bec('0xcb')]||undefined,'CampaignId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5167fa[_0x5bec('0xa4')][_0x25ded3];});}else{loggerBooked['info'](_0x5bec('0x1e4'),JSON[_0x5bec('0x45')](_0x3cdb72[_0x5bec('0x125')]),_0x5bec('0x1e2'),_0x3cdb72[_0x5bec('0x3b')]);_0x5167fa['updateOriginated'](_0x3cdb72);_0x5167fa['rescheduleContact']({'active':![],'ContactId':_0x5167fa['actions'][_0x25ded3][_0x5bec('0xc8')],'ListId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xc9')],'VoiceQueueId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xcb')]||undefined,'CampaignId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xf2')]||undefined})['catch'](loggerCatch(_0x5bec('0x1e5')));delete _0x5167fa[_0x5bec('0xa4')][_0x25ded3];}}else{return _0x5167fa[_0x5bec('0x1e6')](_0x3cdb72,_0x4b6990);}}else{if(getDiff(_0x4b6990[_0x5bec('0x1e7')])<_0x3cdb72[_0x5bec('0x1e8')]*0x3c){if(_0x4b6990['Agent']&&!_0x4b6990['Agent'][_0x5bec('0x1e9')]){_0x5167fa[_0x5bec('0x20')][_0x5bec('0x129')](_0x4b6990['id'])['finally'](function(){_0x5167fa['updateOriginated'](_0x3cdb72);});}else{_0x5167fa['unlockContact']({'active':![]},_0x4b6990['id'],0x1)['finally'](function(){_0x5167fa[_0x5bec('0xa9')](_0x3cdb72);});}}else{_0x3cdb72[_0x5bec('0x62')]+=0x1;_0x5167fa[_0x5bec('0xa9')](_0x3cdb72);if(_0x3cdb72[_0x5bec('0x1ea')]){_0x5167fa[_0x5bec('0xb6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4b6990[_0x5bec('0xc8')],'ListId':_0x4b6990['ListId'],'VoiceQueueId':_0x4b6990[_0x5bec('0xcb')]||undefined,'CampaignId':_0x4b6990['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5167fa['createHistory'](createObjHistory(_0x3cdb72,_0x4b6990,'RECALLINQUEUE',0x17,_0x5bec('0x1eb')))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x1ec')));}else{_0x5167fa[_0x5bec('0xc6')](createObjHistory(_0x3cdb72,_0x4b6990,'RECALLFAILEDTIMEOUT',0x16,_0x5bec('0x1ed')),'[Originate][HistoryRecallClose][historyCatch]',_0x5bec('0x1ee'));}}}}else{_0x3cdb72[_0x5bec('0x1ef')]+=0x1;_0x5167fa['saveInDb'](createObjHistory(_0x3cdb72,_0x4b6990,_0x5bec('0x1f0'),0xd,'Blacklist'),_0x5bec('0x1f1'),'[Originate][MoveBlacklist]');throw _0x5bec('0x1f2');}};};Dialer[_0x5bec('0x1b')][_0x5bec('0x158')]=function(_0x28efa6){var _0x8a57bc=this;var _0x2e8a65=_0x28efa6[_0x5bec('0x1f3')]-_0x28efa6[_0x5bec('0x6a')]-_0x28efa6[_0x5bec('0xbb')];emitCampaignSummary(_0x28efa6);if(_0x2e8a65>0x0){if(_0x2e8a65>this[_0x5bec('0x24')]){_0x2e8a65=this[_0x5bec('0x24')];}_0x28efa6[_0x5bec('0xbb')]+=_0x2e8a65;this[_0x5bec('0xbc')](_0x28efa6['id'],_0x2e8a65,_0x28efa6[_0x5bec('0x1f4')],_0x28efa6)['then'](function(_0x3c062b){_0x28efa6[_0x5bec('0xbb')]-=_0x2e8a65;_0x28efa6[_0x5bec('0xbb')]=_0x28efa6[_0x5bec('0xbb')]>0x0?_0x28efa6['temp']:0x0;if(!checkContactEmpty(_0x3c062b)){_0x28efa6[_0x5bec('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x5bec('0x75')](_0x5bec('0x1f5')+_0x28efa6[_0x5bec('0x3b')]);}else{_0x28efa6[_0x5bec('0x6a')]+=_0x3c062b[_0x5bec('0x92')];_0x28efa6['message']=_0x5bec('0x1f6');for(var _0x5a4a21=0x0;_0x5a4a21<_0x3c062b['length'];_0x5a4a21+=0x1){_0x28efa6[_0x5bec('0x1f7')]+=0x1;if(_['isNil'](_0x3c062b[_0x5a4a21])||_[_0x5bec('0xd3')](_0x3c062b[_0x5a4a21]['Contact'])||_[_0x5bec('0xd3')](_0x3c062b[_0x5a4a21]['Contact']['phone'])){_0x8a57bc['emptyContact'](_0x5bec('0x1f8'),_0x28efa6,_0x3c062b[_0x5a4a21]);}else{_0x8a57bc['checkIsBlackListIvr'](_['pick'](_0x3c062b[_0x5a4a21],[_0x5bec('0xf2'),'Contact.phone']))[_0x5bec('0xb0')](_0x8a57bc[_0x5bec('0x1de')](_0x28efa6,_0x3c062b[_0x5a4a21]))['catch'](_0x8a57bc[_0x5bec('0x1f9')](_0x5bec('0x1fa'),_0x28efa6));}}}})[_0x5bec('0xa8')](loggerGetContactDialer('[getContactCampaign2]',_0x28efa6,_0x2e8a65));}};Dialer[_0x5bec('0x1b')][_0x5bec('0x153')]=function(_0x4b7e38,_0x3ca674){var _0x266f70=this;var _0x27eeab=[];var _0xa8547=_0x3ca674>=0x1?_0x3ca674:0x1;if(_0x4b7e38[_0x5bec('0x151')]===_0x5bec('0x155')){_0xa8547=0x1;}var _0x315ab6=Math['floor'](_0x4b7e38[_0x5bec('0x4c')]*_0xa8547)-_0x4b7e38[_0x5bec('0x6a')]-_0x4b7e38[_0x5bec('0xbb')];emitVoiceQueueSummary(_0x4b7e38);if(_0x4b7e38[_0x5bec('0x1fb')]>0x0){var _0x427e95=_0x4b7e38[_0x5bec('0x1fb')]-_0x4b7e38['originated']-_0x4b7e38['talking']-_0x4b7e38[_0x5bec('0xbb')]-_0x4b7e38['pTalking'];if(_0x315ab6>_0x427e95){_0x315ab6=_0x427e95;}}if(_0x315ab6>0x0){if(_0x4b7e38[_0x5bec('0x151')]===_0x5bec('0x155')){_0x315ab6=0x1;}if(_0x315ab6>this[_0x5bec('0x24')]){_0x315ab6=this[_0x5bec('0x24')];}_0x4b7e38['temp']+=_0x315ab6;for(var _0x48abf4 in this[_0x5bec('0x22')]){if(typeof this['agents'][_0x48abf4]!==_0x5bec('0x93')){if(this[_0x5bec('0x22')][_0x48abf4][_0x5bec('0x9d')]===_0x5bec('0x1fc')&&this[_0x5bec('0x22')][_0x48abf4][_0x5bec('0xd0')]===_0x5bec('0x1fd')){_0x27eeab[_0x5bec('0x123')](this['agents'][_0x48abf4]['id']);}}}this[_0x5bec('0xba')](_0x4b7e38['id'],_0x27eeab,_0x315ab6,_0x4b7e38[_0x5bec('0x1f4')],_0x4b7e38)[_0x5bec('0xb0')](function(_0x81f8b2){_0x4b7e38['temp']-=_0x315ab6;_0x4b7e38[_0x5bec('0xbb')]=_0x4b7e38['temp']>0x0?_0x4b7e38[_0x5bec('0xbb')]:0x0;if(!checkContactEmpty(_0x81f8b2)){_0x266f70['countReScheduled'](_0x4b7e38)['then'](sendMessageReschedule(_0x4b7e38))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xaf')));}else{_0x4b7e38['originated']+=_0x81f8b2[_0x5bec('0x92')];_0x4b7e38[_0x5bec('0x3a')]=_0x4b7e38[_0x5bec('0x151')]===_0x5bec('0x155')?_0x5bec('0x16a'):_0x5bec('0x1f6');for(var _0xa04e62=0x0;_0xa04e62<_0x81f8b2[_0x5bec('0x92')];_0xa04e62+=0x1){if(_['isNil'](_0x81f8b2[_0xa04e62])||_[_0x5bec('0xd3')](_0x81f8b2[_0xa04e62][_0x5bec('0x163')])||_[_0x5bec('0xd3')](_0x81f8b2[_0xa04e62][_0x5bec('0x163')][_0x5bec('0x162')])){_0x266f70[_0x5bec('0xc4')](_0x5bec('0x1f8'),_0x4b7e38,_0x81f8b2[_0xa04e62]);}else{_0x266f70[_0x5bec('0xb1')](_['pick'](_0x81f8b2[_0xa04e62],[_0x5bec('0xcb'),_0x5bec('0x1fe')]))[_0x5bec('0xb0')](_0x266f70[_0x5bec('0x1de')](_0x4b7e38,_0x81f8b2[_0xa04e62]))[_0x5bec('0xa8')](_0x266f70[_0x5bec('0x1f9')]('[actionOriginate]\x20',_0x4b7e38));}}}})[_0x5bec('0xa8')](loggerGetContactDialer('[getContactDialer2]',_0x4b7e38,_0x315ab6));}};Dialer['prototype'][_0x5bec('0x8a')]=function(_0x41d849){if(_0x41d849['dialLimitQueue']>0x0){var _0x2941ad=_0x41d849[_0x5bec('0x1fb')]-_0x41d849[_0x5bec('0x6a')]-_0x41d849[_0x5bec('0x51')];if(_0x2941ad>0x0){this[_0x5bec('0x1ff')](_0x41d849);}else{loggerPredictiveCalls[_0x5bec('0x75')](_0x5bec('0x200'));}}else{this[_0x5bec('0x1ff')](_0x41d849);}};Dialer['prototype'][_0x5bec('0x1ff')]=function(_0x57219a){var _0xa529d0=this;var _0x5cf78e=[];_0x57219a[_0x5bec('0x6a')]+=0x1;for(var _0x2b6120 in this[_0x5bec('0x22')]){if(typeof this['agents'][_0x2b6120]!==_0x5bec('0x93')){if(this['agents'][_0x2b6120][_0x5bec('0x9d')]==='not_inuse'&&this[_0x5bec('0x22')][_0x2b6120]['status']===_0x5bec('0x1fd')){_0x5cf78e[_0x5bec('0x123')](this[_0x5bec('0x22')][_0x2b6120]['id']);}}}this[_0x5bec('0xba')](_0x57219a['id'],_0x5cf78e,0x1,_0x57219a[_0x5bec('0x1f4')],_0x57219a)[_0x5bec('0xb0')](function(_0x25e200){if(!checkContactEmpty(_0x25e200)){checkContactLowerLimitOriginate(_0x57219a,0x1,0x0);_0xa529d0[_0x5bec('0xad')](_0x57219a)['then'](sendMessageReschedule(_0x57219a))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x57219a['message']='RUNNING';if(_[_0x5bec('0xd3')](_0x25e200[0x0])||_[_0x5bec('0xd3')](_0x25e200[0x0][_0x5bec('0x163')])||_[_0x5bec('0xd3')](_0x25e200[0x0][_0x5bec('0x163')][_0x5bec('0x162')])){_0xa529d0[_0x5bec('0xc4')](_0x5bec('0x1f8'),_0x57219a,_0x25e200[0x0]);}else{_0xa529d0[_0x5bec('0xb1')](_[_0x5bec('0xc7')](_0x25e200[0x0],[_0x5bec('0xcb'),_0x5bec('0x1fe')]))[_0x5bec('0xb0')](_0xa529d0[_0x5bec('0x1de')](_0x57219a,_0x25e200[0x0]))[_0x5bec('0xa8')](_0xa529d0['loggerHandler'](_0x5bec('0x201'),_0x57219a));}}})['catch'](loggerGetContactDialer(_0x5bec('0x202'),_0x57219a,0x1));emitVoiceQueueSummary(_0x57219a);};Dialer['prototype']['abandonmentRate']=function(_0x54358e,_0x420607,_0x3c11c0,_0x45acf3,_0x37f6fc,_0x34ca0d){loggerPredictive[_0x5bec('0x75')](_0x5bec('0x203'));loggerPredictive[_0x5bec('0x75')](_0x5bec('0x204'),_0x54358e);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x205'),_0x420607);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x206'),_0x3c11c0);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x207'),_0x45acf3);loggerPredictive[_0x5bec('0x75')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37f6fc);loggerPredictive['info'](_0x5bec('0x7c'));return new BPromise(function(_0x4d054d,_0x44e2fd){if(_0x54358e<=0x0||isNaN(_0x54358e)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),'Error','m\x20=\x20'+_0x54358e));}if(_0x3c11c0<=0x0||isNaN(_0x3c11c0)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),'Error',_0x5bec('0x209')+_0x3c11c0));}if(_0x45acf3<=0x0||isNaN(_0x45acf3)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),_0x5bec('0x44'),_0x5bec('0x20a')+_0x45acf3));}if(_0x420607<=0x0||isNaN(_0x420607)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),_0x5bec('0x44'),_0x5bec('0x20b')+_0x420607));}if(_0x37f6fc<=0x0||isNaN(_0x37f6fc)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),'Error',_0x5bec('0x20c')+_0x37f6fc));}_0x34ca0d=_0x34ca0d||0x0;var _0xe37c48=0x1/_0x3c11c0;var _0x26f7df=0x0;var _0x4b91b8=0x0;var _0x50a527=0x0;var _0x287c61=0x0;for(var _0x45b5a4=0x0;_0x50a527<_0x37f6fc;_0x45b5a4+=0x1){_0x4b91b8=_0x45b5a4/_0x420607;_0x26f7df=(_0x45acf3*_0x4b91b8+_0x34ca0d)/_0xe37c48;_0x50a527=erlangb(_0x26f7df,_0x54358e);_0x287c61=_0x26f7df/_0x54358e*(0x1-erlangb(_0x26f7df,_0x54358e));}return _0x4d054d({'erlangCalls':_0x45b5a4,'erlangCallToSecond':_0x420607/_0x45b5a4,'erlangAbandonmentRate':_0x50a527,'erlangBusyFactor':_0x287c61});});};Dialer[_0x5bec('0x1b')][_0x5bec('0x1d9')]=function(_0x36d8bd,_0x1a652d,_0x2d19c2,_0x4942a0,_0x2a6194,_0x527e20){loggerPredictive[_0x5bec('0x75')](_0x5bec('0x20d'));loggerPredictive[_0x5bec('0x75')](_0x5bec('0x204'),_0x36d8bd);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x205'),_0x1a652d);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x206'),_0x2d19c2);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x207'),_0x4942a0);loggerPredictive['info'](_0x5bec('0x20e'),_0x2a6194);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7c'));return new BPromise(function(_0x1fcc94,_0x5f5218){if(_0x36d8bd<=0x0||isNaN(_0x36d8bd)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),_0x5bec('0x44'),_0x5bec('0x210')+_0x36d8bd));}if(_0x2d19c2<=0x0||isNaN(_0x2d19c2)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),_0x5bec('0x44'),_0x5bec('0x209')+_0x2d19c2));}if(_0x4942a0<=0x0||isNaN(_0x4942a0)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),_0x5bec('0x44'),'p\x20=\x20'+_0x4942a0));}if(_0x1a652d<=0x0||isNaN(_0x1a652d)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),_0x5bec('0x44'),'interval\x20=\x20'+_0x1a652d));}if(_0x2a6194<=0x0||isNaN(_0x2a6194)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),'Error',_0x5bec('0x211')+_0x2a6194));}_0x527e20=_0x527e20||0x0;var _0x11fe93=0x1/_0x2d19c2;var _0x53f333=0x0;var _0x517daa=0x0;var _0x216c03=0x0;var _0x1e7d60=0x0;for(var _0x711204=0x0;_0x1e7d60<_0x2a6194;_0x711204+=0x1){_0x517daa=_0x711204/_0x1a652d;_0x53f333=(_0x4942a0*_0x517daa+_0x527e20)/_0x11fe93;_0x216c03=erlangb(_0x53f333,_0x36d8bd);_0x1e7d60=_0x53f333/_0x36d8bd*(0x1-erlangb(_0x53f333,_0x36d8bd));}return _0x1fcc94({'erlangCalls':_0x711204,'erlangCallToSecond':_0x1a652d/_0x711204,'erlangAbandonmentRate':_0x216c03,'erlangBusyFactor':_0x1e7d60});});};module[_0x5bec('0x212')]=Dialer; \ No newline at end of file +var _0x3ce4=['command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','Action','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','getCaller','xcally-motion-dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','originatecalleridname','originatecalleridnum','dialPrefix','SIP/%s/%s%s','substring','dialCutDigit','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','busyFactor','startMethodPredictive','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','Agent','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','util','bluebird','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','newexten','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','startProgressive','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','stack','error','length','originated','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','[uniqueid]','clearZombieChannels','actions','[actions]','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','syncVarSet','uniqueid','variable','amdstatus','exten','value','HANGUP','state','HangupInAMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','Machine','membername','AMD','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countcongestionretry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','syncAgentComplete','reason','agent','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray'];(function(_0xdc90aa,_0xff8075){var _0x3bae4d=function(_0x3547b7){while(--_0x3547b7){_0xdc90aa['push'](_0xdc90aa['shift']());}};_0x3bae4d(++_0xff8075);}(_0x3ce4,0xcb));var _0x43ce=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x3ce4[_0x1da527];return _0x40fc7c;};'use strict';var util=require(_0x43ce('0x0'));var _=require('lodash');var BPromise=require(_0x43ce('0x1'));var uuid=require('uuid');var moment=require(_0x43ce('0x2'));var rr=require('rr');var md5=require(_0x43ce('0x3'));var Redis=require(_0x43ce('0x4'));var ut=require(_0x43ce('0x5'));var config=require(_0x43ce('0x6'));var logger=require('../../../config/logger')(_0x43ce('0x7'));var loggerBooked=require(_0x43ce('0x8'))('booked');var loggerPredictive=require(_0x43ce('0x8'))('predictive');var loggerPredictiveCalls=require(_0x43ce('0x8'))(_0x43ce('0x9'));var loggerSyncQueueSummary=require(_0x43ce('0x8'))(_0x43ce('0xa'));var ami=require('../ami');config[_0x43ce('0xb')]=_[_0x43ce('0xc')](config[_0x43ce('0xb')],{'host':_0x43ce('0xd'),'port':0x18eb});var io=require(_0x43ce('0xe'))(new Redis(config[_0x43ce('0xb')]));var cmHopper=require(_0x43ce('0xf'));var cmHopperHistory=require(_0x43ce('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x43ce('0x11'));var Action=require('./action');var History=require(_0x43ce('0x12'));var Final=require(_0x43ce('0x13'));var AgentComplete=require(_0x43ce('0x14'));var QueueCallerAbandon=require(_0x43ce('0x15'));var Hangup=require(_0x43ce('0x16'));var ipAgi=process[_0x43ce('0x17')][_0x43ce('0x18')]||'127.0.0.1';var strategy={'rrmemory':_0x43ce('0x19'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x43ce('0x1a')][_0x43ce('0x1b')]=function(_0x179886){this['tail']=this[_0x43ce('0x1c')]?this[_0x43ce('0x1c')][_0x43ce('0x1d')](_0x179886):_0x179886();};function Dialer(_0x437d0a,_0x3812a6){this[_0x43ce('0x1e')]=new Sequence();this[_0x43ce('0x1f')]=_0x3812a6;this[_0x43ce('0x20')]=_0x437d0a[_0x43ce('0x20')];this[_0x43ce('0x21')]=_0x437d0a[_0x43ce('0x21')];this[_0x43ce('0x22')]=_0x437d0a[_0x43ce('0x22')];this[_0x43ce('0x23')]=_0x437d0a[_0x43ce('0x23')];this[_0x43ce('0x24')]=config[_0x43ce('0x24')]||0x2;this['channels']={};this['actions']={};this[_0x43ce('0x25')]={};this[_0x43ce('0x26')]={};this[_0x43ce('0x27')]={};this['startPredictive']={};this['startProgressive']={};this[_0x43ce('0x28')]={};this[_0x43ce('0x29')]={};this[_0x43ce('0x2a')]={};ami['on'](_0x43ce('0x2b'),this['syncAgentConnect']['bind'](this));ami['on'](_0x43ce('0x2c'),this['syncQueueCallerAbandon'][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x2e'),this[_0x43ce('0x2f')][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x30'),this['syncAgentComplete']['bind'](this));ami['on'](_0x43ce('0x31'),this[_0x43ce('0xa')][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x32'),this['syncHangup'][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x33'),this['syncNewExten'][_0x43ce('0x2d')](this));ami['on']('varset',this['syncVarSet'][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x34'),this[_0x43ce('0x35')][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x36'),this['syncQueueStatusComplete'][_0x43ce('0x2d')](this));this[_0x43ce('0x37')]();this[_0x43ce('0x38')]();}function isNotNull(_0x2fdfd9){return _0x2fdfd9!==null&&!_['isUndefined'](_0x2fdfd9);}function checkIsLoggedIn(_0x382c71,_0x102fbe){return function(){if(_0x102fbe<=0x0){_0x382c71[_0x43ce('0x39')]=_0x43ce('0x3a');throw _0x382c71[_0x43ce('0x3b')]+_0x43ce('0x3c');}};}function isActive(_0x3f0b60){return _0x3f0b60;}function checkIsActive(_0x4c44cb,_0x1b86cf){return function(){if(!isActive(_0x1b86cf)){_0x4c44cb['message']=_0x43ce('0x3d');throw _0x4c44cb[_0x43ce('0x3b')]+_0x43ce('0x3e');}};}function checkInterval(_0x42e262){return function(){if(!isNotNull(_0x42e262[_0x43ce('0x3f')])){_0x42e262[_0x43ce('0x39')]=_0x43ce('0x40');throw _0x42e262['name']+_0x43ce('0x41');}if(!isNotNull(_0x42e262[_0x43ce('0x3f')][_0x43ce('0x42')])){_0x42e262[_0x43ce('0x39')]=_0x43ce('0x40');throw _0x42e262[_0x43ce('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x43ce('0x43')](_0x42e262['Interval'][_0x43ce('0x42')]))){_0x42e262[_0x43ce('0x39')]='INTERVAL_IS_NULL';throw _0x42e262[_0x43ce('0x3b')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5317e8,_0x2c5185,_0x41ff8e){return{'action':_0x5317e8,'response':_0x2c5185,'message':_0x41ff8e,'stack':_0x41ff8e};}function myreject(_0x9bf462){return function(_0x377c1d){return _0x9bf462(msgResponse(_0x43ce('0x44'),_0x43ce('0x45'),JSON[_0x43ce('0x46')](_0x377c1d)));};}function getSeconds(_0x4269a5,_0x5b2275){var _0x5065fe=moment(_0x4269a5)[_0x43ce('0x47')](0x0);var _0x1f8f9d=moment(_0x5b2275)[_0x43ce('0x47')](0x0);return _0x5065fe[_0x43ce('0x48')](_0x1f8f9d,'seconds');}function emit(_0x2b8d06,_0x1ea683,_0x50556c){io['to'](_0x2b8d06)[_0x43ce('0x49')](_0x1ea683,_0x50556c);}function emitVoiceQueueSummary(_0x4fc856){if(_0x4fc856[_0x43ce('0x4a')]===_0x43ce('0x4b')){var _0x256f9a={'id':_0x4fc856['id'],'name':_0x4fc856[_0x43ce('0x3b')],'strategy':_0x4fc856[_0x43ce('0x4c')],'answered':_0x4fc856[_0x43ce('0x4d')],'available':_0x4fc856[_0x43ce('0x4e')],'loggedIn':_0x4fc856['loggedIn'],'pTalking':_0x4fc856['pTalking'],'sumBillable':_0x4fc856[_0x43ce('0x4f')],'sumDuration':_0x4fc856[_0x43ce('0x50')],'sumHoldTime':_0x4fc856[_0x43ce('0x51')]||0x0,'talking':_0x4fc856[_0x43ce('0x52')],'total':_0x4fc856['total'],'type':_0x4fc856[_0x43ce('0x4a')],'unmanaged':_0x4fc856[_0x43ce('0x53')],'abandoned':_0x4fc856[_0x43ce('0x54')],'waiting':_0x4fc856[_0x43ce('0x55')],'loggedInDb':_0x4fc856[_0x43ce('0x56')],'dialActive':_0x4fc856[_0x43ce('0x57')],'dialMethod':_0x4fc856[_0x43ce('0x58')],'dialOriginateCallerIdName':_0x4fc856[_0x43ce('0x59')],'dialOriginateCallerIdNumber':_0x4fc856['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4fc856['dialOriginateTimeout'],'dialPrefix':_0x4fc856['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4fc856[_0x43ce('0x5a')],'outboundAnswerCallsDay':_0x4fc856[_0x43ce('0x5b')],'outboundBlacklistCallsDay':_0x4fc856['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x4fc856[_0x43ce('0x5c')],'outboundCongestionCallsDay':_0x4fc856[_0x43ce('0x5d')],'outboundDropCallsDayACS':_0x4fc856[_0x43ce('0x5e')],'outboundDropCallsDayCallersExit':_0x4fc856[_0x43ce('0x5f')],'outboundDropCallsDayTimeout':_0x4fc856[_0x43ce('0x60')],'outboundNoAnswerCallsDay':_0x4fc856[_0x43ce('0x61')],'outboundNoSuchCallsDay':_0x4fc856[_0x43ce('0x62')],'outboundOriginateFailureCallsDay':_0x4fc856[_0x43ce('0x63')],'outboundReCallsDay':_0x4fc856[_0x43ce('0x64')],'outboundRejectCallsDay':_0x4fc856['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4fc856['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x4fc856[_0x43ce('0x65')],'predictiveIntervalAvgHoldtime':_0x4fc856['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4fc856[_0x43ce('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x4fc856[_0x43ce('0x67')],'predictiveIntervalDroppedCallsTimeout':_0x4fc856[_0x43ce('0x68')],'predictiveIntervalErlangCalls':_0x4fc856['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x4fc856[_0x43ce('0x69')],'predictiveIntervalHitRate':_0x4fc856[_0x43ce('0x6a')],'predictiveIntervalMultiplicativeFactor':_0x4fc856['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4fc856[_0x43ce('0x6b')],'predictiveIntervalAvailable':_0x4fc856[_0x43ce('0x6c')],'predictiveIntervalTotalCalls':_0x4fc856[_0x43ce('0x6d')],'message':_0x4fc856['message'],'originated':_0x4fc856['originated'],'erlangCalls':_0x4fc856[_0x43ce('0x6e')],'erlangCallToSecond':_0x4fc856['erlangCallToSecond'],'erlangAbandonmentRate':_0x4fc856[_0x43ce('0x6f')],'erlangBusyFactor':_0x4fc856[_0x43ce('0x70')],'startPredictive':_0x4fc856[_0x43ce('0x71')],'startProgressive':_0x4fc856['startProgressive']};if(_0x4fc856['Trunk']){_0x256f9a[_0x43ce('0x72')]={'id':_0x4fc856[_0x43ce('0x72')]['id'],'name':_0x4fc856[_0x43ce('0x72')][_0x43ce('0x3b')],'active':_0x4fc856[_0x43ce('0x72')]['active'],'callerid':_0x4fc856[_0x43ce('0x72')]['callerid']};}if(_0x4fc856[_0x43ce('0x3f')]){_0x256f9a[_0x43ce('0x3f')]={'id':_0x4fc856[_0x43ce('0x3f')]['id'],'name':_0x4fc856[_0x43ce('0x3f')][_0x43ce('0x3b')]};}var _0x282040=md5(JSON[_0x43ce('0x46')](_0x256f9a));if(_0x4fc856[_0x43ce('0x3')]!==_0x282040){_0x4fc856[_0x43ce('0x3')]=_0x282040;emit(util[_0x43ce('0x73')]('voice:queue:%s',_0x256f9a[_0x43ce('0x3b')]),_0x43ce('0x74'),_0x256f9a);}}}function emitCampaignSummary(_0x654e7c){if(_0x654e7c[_0x43ce('0x4a')]===_0x43ce('0x75')){emit(util[_0x43ce('0x73')](_0x43ce('0x76'),_0x654e7c[_0x43ce('0x3b')]),_0x43ce('0x77'),_0x654e7c);}}function checkGetDataPredictive(_0x3656fc){if(isNotNull(_0x3656fc)&&!_[_0x43ce('0x43')](_0x3656fc)){loggerPredictive[_0x43ce('0x78')](_0x43ce('0x79'));loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7a'),_0x3656fc[_0x43ce('0x6d')]);loggerPredictive[_0x43ce('0x78')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3656fc['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x43ce('0x7b'),_0x3656fc[_0x43ce('0x68')]);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7c'),_0x3656fc['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x43ce('0x78')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3656fc[_0x43ce('0x7d')]);loggerPredictive[_0x43ce('0x78')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3656fc[_0x43ce('0x66')]);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7e'));if(_0x3656fc[_0x43ce('0x6d')]>0x0){if(!_[_0x43ce('0x7f')](_0x3656fc[_0x43ce('0x66')])&&_0x3656fc[_0x43ce('0x66')]>0x0){return!![];}loggerPredictive[_0x43ce('0x78')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x43ce('0x7f')](_0x3656fc[_0x43ce('0x7d')])&&_0x3656fc[_0x43ce('0x7d')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x43ce('0x78')](_0x43ce('0x80'));}}else{loggerPredictive['info'](_0x43ce('0x81'));}return![];}function mergeDataErlangB(_0x46065c){return function(_0x11a19a){loggerPredictive['info'](_0x43ce('0x82'));loggerPredictive[_0x43ce('0x78')](_0x43ce('0x83'),_0x11a19a[_0x43ce('0x6e')]);loggerPredictive[_0x43ce('0x78')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11a19a[_0x43ce('0x84')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11a19a[_0x43ce('0x6f')]);loggerPredictive[_0x43ce('0x78')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11a19a[_0x43ce('0x70')]);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x85'),_0x11a19a[_0x43ce('0x6f')]);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7e'));_['merge'](_0x46065c,_0x11a19a);};}function getDiff(_0x3f9e89){var _0xe3c982=moment()[_0x43ce('0x47')](0x0);var _0xf3c4fa=moment(_0x3f9e89)[_0x43ce('0x47')](0x0);return _0xe3c982[_0x43ce('0x48')](_0xf3c4fa,'seconds');}function ifInterval(_0x468c19,_0x52350d){if(_[_0x43ce('0x7f')](_0x52350d)){return![];}return getDiff(_0x52350d)<_0x468c19*0x3c;}function freeVariablesPredictive(_0x39edbf){if(isNotNull(_0x39edbf)){if(!_['isUndefined'](_0x39edbf[_0x43ce('0x86')])){_0x39edbf['startProgressive']=undefined;loggerPredictive[_0x43ce('0x78')](_0x39edbf[_0x43ce('0x3b')],_0x43ce('0x87'));}if(!_[_0x43ce('0x7f')](_0x39edbf[_0x43ce('0x71')])){_0x39edbf[_0x43ce('0x71')]=undefined;loggerPredictive[_0x43ce('0x78')](_0x39edbf[_0x43ce('0x3b')],_0x43ce('0x88'));}if(!_[_0x43ce('0x7f')](_0x39edbf['handlePredictive'])){clearInterval(_0x39edbf[_0x43ce('0x89')]);_0x39edbf[_0x43ce('0x89')]=undefined;loggerPredictive[_0x43ce('0x78')](_0x39edbf[_0x43ce('0x3b')],_0x43ce('0x8a'));}}}function erlangb(_0x51c25a,_0x5de69e){if(_0x5de69e===0x0){return 0x0;}var _0x56d32f=0x1;for(var _0x100fd9=0x1;_0x100fd9<=_0x5de69e;_0x100fd9+=0x1){_0x56d32f=0x1+_0x56d32f*_0x100fd9/_0x51c25a;}return 0x1/_0x56d32f;}function isVoiceQueueOutbound(_0x1fb449){return _0x1fb449===_0x43ce('0x4b');}function isNotPreview(_0x27d25a){return _0x27d25a!==_0x43ce('0x1f');}function isCampaignIvr(_0x157d76){return _0x157d76===_0x43ce('0x75');}function getCallerId(_0x1d5da6,_0x3fd082,_0x25f477){if(!_['isUndefined'](_0x25f477)&&typeof _0x25f477===_0x43ce('0x8b')&&!_[_0x43ce('0x43')](_0x25f477)){if(!_[_0x43ce('0x7f')](_0x3fd082)&&typeof _0x3fd082===_0x43ce('0x8b')&&!_[_0x43ce('0x43')](_0x3fd082)){return util['format'](_0x43ce('0x8c'),_0x3fd082,_0x25f477);}return util[_0x43ce('0x73')](_0x43ce('0x8c'),_0x25f477,_0x25f477);}if(!_[_0x43ce('0x7f')](_0x1d5da6)&&typeof _0x1d5da6===_0x43ce('0x8b')&&!_[_0x43ce('0x43')](_0x1d5da6)){return _0x1d5da6;}return _0x43ce('0x8d');}function loggerCatchQueueSummary(_0x44e750,_0x835ee1){return function(_0xbb0df5){freeVariablesPredictive(_0x835ee1);emitVoiceQueueSummary(_0x835ee1);emitCampaignSummary(_0x835ee1);loggerSyncQueueSummary['error'](_0x44e750,util[_0x43ce('0x8e')](_0xbb0df5,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2a6a2e,_0x1883dd){return function(_0x4c11cc){loggerPredictive['error'](_0x1883dd['name'],_0x2a6a2e);loggerPredictive['error'](_0x4c11cc[_0x43ce('0x8f')]);freeVariablesPredictive(_0x1883dd);};}function loggerCatch(_0x533fc7){return function(_0xf456aa){logger[_0x43ce('0x90')](_0x533fc7,util[_0x43ce('0x8e')](_0xf456aa,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5c1fd2){return _0x5c1fd2&&!_[_0x43ce('0x7f')](_0x5c1fd2)&&_0x5c1fd2[_0x43ce('0x91')]>0x0;}function decremetOriginate(_0x47c622){if(!_['isUndefined'](_0x47c622)&&_0x47c622!==null){if(typeof _0x47c622[_0x43ce('0x92')]!==_0x43ce('0x93')){if(_0x47c622[_0x43ce('0x92')]>0x0){_0x47c622[_0x43ce('0x92')]-=0x1;}else{logger[_0x43ce('0x90')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x43ce('0x90')](_0x43ce('0x94'));}}function checkContactLowerLimitOriginate(_0x2433a7,_0x3e8c56,_0x35befa){if(_0x3e8c56>_0x35befa){for(var _0x229cc4=0x0;_0x229cc4<_0x3e8c56-_0x35befa;_0x229cc4+=0x1){decremetOriginate(_0x2433a7);}}}function loggerGetContactDialer(_0x278a5a,_0x49410c,_0x347026){return function(_0x586280){checkContactLowerLimitOriginate(_0x49410c,_0x347026,0x0);logger[_0x43ce('0x90')](_0x278a5a,util[_0x43ce('0x8e')](_0x586280,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4662c4){return function(_0x7450a1){if(isNotNull(_0x7450a1)&&isNotNull(_0x7450a1[0x0])){if(_0x7450a1[0x0][_0x43ce('0x95')]>0x0){_0x4662c4['message']=_0x43ce('0x96');logger[_0x43ce('0x78')]('[getContactDialer2][ReScheduled]'+_0x4662c4['name'],_0x7450a1[0x0][_0x43ce('0x95')],_0x43ce('0x97'));}else{_0x4662c4[_0x43ce('0x39')]=_0x43ce('0x98');logger[_0x43ce('0x78')]('[getContactDialer2][Empty]'+_0x4662c4[_0x43ce('0x3b')]);}}};}function notSendMessagesQueue(_0x2330b6){if(_0x2330b6[_0x43ce('0x99')]){freeVariablesPredictive(_0x2330b6);if(_0x2330b6[_0x43ce('0x92')]===0x0&&_0x2330b6[_0x43ce('0x52')]===0x0&&_0x2330b6[_0x43ce('0x55')]===0x0&&(_0x2330b6['pTalking']||0x0)===0x0){_0x2330b6[_0x43ce('0x99')]=![];_0x2330b6['available']=0x0;_0x2330b6['message']=_0x43ce('0x3d');loggerSyncQueueSummary['error'](_0x43ce('0x9a'),_0x2330b6[_0x43ce('0x3b')],'is\x20not\x20active');}else{_0x2330b6[_0x43ce('0x39')]=_0x43ce('0x9b');loggerSyncQueueSummary[_0x43ce('0x90')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2330b6[_0x43ce('0x3b')],_0x43ce('0x9c'));}emitVoiceQueueSummary(_0x2330b6);}}function notSendMessagesCampaign(_0x35d017){if(_0x35d017[_0x43ce('0x99')]){if(_0x35d017[_0x43ce('0x92')]===0x0){_0x35d017['sendMessageOneNotActive']=![];_0x35d017[_0x43ce('0x39')]=_0x43ce('0x3d');loggerSyncQueueSummary[_0x43ce('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x35d017[_0x43ce('0x3b')],'is\x20not\x20active');}else{_0x35d017[_0x43ce('0x39')]=_0x43ce('0x9b');loggerSyncQueueSummary[_0x43ce('0x90')](_0x43ce('0x9d'),_0x35d017[_0x43ce('0x3b')],_0x43ce('0x9c'));}emitCampaignSummary(_0x35d017);}}function createObjHistory(_0x715b50,_0x262003,_0x153c8c,_0xac028f,_0x5d4bd0){_0x715b50[_0x43ce('0x39')]=_0x153c8c;var _0x7ae8d0=new Action(_0x715b50,_0x262003);var _0x287810=new History(_0x7ae8d0);_0x287810['state']=_0xac028f;_0x287810[_0x43ce('0x9e')]=_0x5d4bd0;_0x287810[_0x43ce('0x9f')]=_0x7ae8d0['starttime'];return _0x287810;}Dialer[_0x43ce('0x1a')][_0x43ce('0x38')]=function(){var _0x107443=this;setInterval(function(){_0x107443['clearZombieChannels'](_0x107443[_0x43ce('0x26')],_0x43ce('0xa0'));_0x107443[_0x43ce('0xa1')](_0x107443[_0x43ce('0xa2')],_0x43ce('0xa3'));},0x32c8);};Dialer['prototype'][_0x43ce('0xa1')]=function(_0x423765,_0x3e4253){var _0x3c0acf=this;for(var _0x4e46ab in _0x423765){if(typeof _0x423765[_0x4e46ab]!==_0x43ce('0x93')){this[_0x43ce('0x1e')][_0x43ce('0x1b')](function(){if(!_[_0x43ce('0xa4')](_0x423765[_0x4e46ab])){return ami['Action']({'action':_0x43ce('0xa5'),'channel':_0x423765[_0x4e46ab][_0x43ce('0xa6')]})[_0x43ce('0xa7')](function(_0x1a0706){if(_0x1a0706['message']===_0x43ce('0xa8')){setTimeout(function(){if(_0x423765[_0x4e46ab]&&_0x423765[_0x4e46ab][_0x43ce('0x4a')]!==_0x43ce('0x75')){_0x3c0acf[_0x43ce('0xa9')](_0x3c0acf[_0x43ce('0x20')][_0x423765[_0x4e46ab]['queue']]);logger[_0x43ce('0x90')](_0x43ce('0xaa'),_0x3e4253,_0x4e46ab,_0x423765[_0x4e46ab][_0x43ce('0xab')]);delete _0x423765[_0x4e46ab];}if(_0x423765[_0x4e46ab]&&_0x423765[_0x4e46ab]['type']==='ivr'){_0x3c0acf[_0x43ce('0xa9')](_0x3c0acf[_0x43ce('0x21')][_0x423765[_0x4e46ab][_0x43ce('0xab')]]);logger[_0x43ce('0x90')](_0x43ce('0xac'),_0x3e4253,_0x4e46ab,_0x423765[_0x4e46ab][_0x43ce('0xab')]);delete _0x423765[_0x4e46ab];}},0x2328);}});}});}}};Dialer[_0x43ce('0x1a')][_0x43ce('0xad')]=function(_0x561eb9){return BPromise[_0x43ce('0xae')]()['then'](cmHopper[_0x43ce('0xad')](_0x561eb9))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xaf')));};Dialer['prototype']['checkIsBlackList']=function(_0x193cef){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopperBlack[_0x43ce('0xb1')](_0x193cef))['catch'](loggerCatch(_0x43ce('0xb2')));};Dialer['prototype'][_0x43ce('0xb3')]=function(_0x6d146d){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopperBlack['checkIsBlackListIvr'](_0x6d146d))['catch'](loggerCatch(_0x43ce('0xb4')));};Dialer['prototype'][_0x43ce('0xb5')]=function(_0x19c8dc){return BPromise['resolve']()[_0x43ce('0xb0')](cmHopperHistory[_0x43ce('0xb6')](_0x19c8dc))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xb7')));};Dialer[_0x43ce('0x1a')][_0x43ce('0xb8')]=function(_0x42abab){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopper[_0x43ce('0xb8')](_0x42abab))[_0x43ce('0xa7')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x43ce('0x1a')]['unlockContact']=function(_0x37bf08,_0x40023b,_0x5addef){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopper[_0x43ce('0xb9')](_0x37bf08,_0x40023b,_0x5addef))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xba')));};Dialer[_0x43ce('0x1a')][_0x43ce('0xbb')]=function(_0x6d2cca,_0x39ef31,_0x312ff0,_0x5aa484,_0x5abe05){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopper[_0x43ce('0xbb')](_0x6d2cca,_0x39ef31,_0x312ff0,_0x5aa484))['catch'](function(_0x3f5443){_0x5abe05['temp']-=_0x312ff0;_0x5abe05[_0x43ce('0xbc')]=_0x5abe05[_0x43ce('0xbc')]>0x0?_0x5abe05[_0x43ce('0xbc')]:0x0;loggerCatch(_0x43ce('0xbd'))(_0x3f5443);});};Dialer[_0x43ce('0x1a')]['getContactDialerIvr']=function(_0x23114e,_0x1f66ee,_0x56ccf8,_0x1f3898){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopper['getContactDialerIvr'](_0x23114e,_0x1f66ee,_0x56ccf8))[_0x43ce('0xa7')](function(_0x51f569){_0x1f3898['temp']-=_0x1f66ee;_0x1f3898[_0x43ce('0xbc')]=_0x1f3898[_0x43ce('0xbc')]>0x0?_0x1f3898['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x51f569);});};Dialer['prototype'][_0x43ce('0xbe')]=function(_0x164556){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](voiceQueueRt[_0x43ce('0xbe')](_0x164556))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x43ce('0x1a')]['moveContactManagedDialer']=function(_0x231b7b){return BPromise[_0x43ce('0xae')]()['then'](cmHopper[_0x43ce('0xbf')](_0x231b7b))['catch'](loggerCatch(_0x43ce('0xc0')));};Dialer[_0x43ce('0x1a')][_0x43ce('0xc1')]=function(_0x266b42){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopperHistory[_0x43ce('0xc1')](_0x266b42))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xc2')));};Dialer[_0x43ce('0x1a')][_0x43ce('0xa9')]=function(_0x4fd118){if(!_[_0x43ce('0x7f')](_0x4fd118)&&_0x4fd118!==null){if(typeof _0x4fd118[_0x43ce('0x92')]!=='undefined'){if(_0x4fd118[_0x43ce('0x92')]>0x0){_0x4fd118[_0x43ce('0x92')]-=0x1;}else{logger[_0x43ce('0x90')](_0x43ce('0xc3'));}}}else{logger[_0x43ce('0x90')](_0x43ce('0xc4'));}};Dialer[_0x43ce('0x1a')][_0x43ce('0xc5')]=function(_0x4e71a2,_0x424fe6){var _0x414f4f=this;return function(_0x37d3ad){_0x414f4f[_0x43ce('0xa9')](_0x424fe6);logger[_0x43ce('0x90')](_0x4e71a2,util['inspect'](_0x37d3ad,{'showHidden':![],'depth':null}));};};Dialer[_0x43ce('0x1a')][_0x43ce('0xc6')]=function(_0x40c224,_0x59e181,_0x26834a){var _0x4d8ca0={'state':0x19,'statedesc':_0x43ce('0xc7')};this[_0x43ce('0xa9')](_0x59e181);this['saveInDb'](_[_0x43ce('0xc8')](_0x4d8ca0,_[_0x43ce('0xc9')](_0x26834a,[_0x43ce('0xca'),_0x43ce('0xcb'),_0x43ce('0xcc'),_0x43ce('0xcd'),_0x43ce('0xce')])),_0x43ce('0xcf'),_0x43ce('0xd0'));logger[_0x43ce('0x90')](_0x40c224);};Dialer[_0x43ce('0x1a')][_0x43ce('0xd1')]=function(_0x9d65d8){return _0x9d65d8===_0x43ce('0xd2');};Dialer[_0x43ce('0x1a')][_0x43ce('0xd3')]=function(_0x5cdb65){return!_[_0x43ce('0x7f')](_0x5cdb65)&&_0x5cdb65&&!_['isUndefined'](_0x5cdb65['name'])&&!_['isUndefined'](_0x5cdb65[_0x43ce('0xd4')])&&_0x5cdb65[_0x43ce('0xd4')]&&(this[_0x43ce('0x23')][util['format'](_0x43ce('0xd5'),_0x5cdb65[_0x43ce('0x3b')])][_0x43ce('0xa5')]===_0x43ce('0xd6')||this[_0x43ce('0x23')][util[_0x43ce('0x73')](_0x43ce('0xd5'),_0x5cdb65[_0x43ce('0x3b')])][_0x43ce('0xa5')]==='unmonitored');};Dialer[_0x43ce('0x1a')]['saveInDb']=function(_0x4f7d7f,_0x194a09,_0xd6a503){this[_0x43ce('0xc1')](_0x4f7d7f)[_0x43ce('0xa7')](loggerCatch(_0x194a09));this[_0x43ce('0xbf')](_0x4f7d7f)[_0x43ce('0xa7')](loggerCatch(_0xd6a503));};Dialer['prototype'][_0x43ce('0xd7')]=function(_0x106af3){var _0xcd7f01=this[_0x43ce('0x26')][_0x106af3[_0x43ce('0xd8')]];var _0x56ab64;if(!_[_0x43ce('0xa4')](_0x106af3)&&!_[_0x43ce('0xa4')](_0x106af3[_0x43ce('0xd9')])&&!_[_0x43ce('0xa4')](_0x106af3[_0x43ce('0xd9')][_0x43ce('0xda')])&&_0x106af3[_0x43ce('0xdb')]==='xcally-motion-dialer'&&_0xcd7f01){if(_0xcd7f01['type']!==_0x43ce('0x75')&&this[_0x43ce('0x20')][_0xcd7f01['queue']]['dialAMDActive']&&_0x106af3[_0x43ce('0xdc')]===_0x43ce('0xdd')){delete this[_0x43ce('0x26')][_0x106af3['uniqueid']];this[_0x43ce('0xa9')](this[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]]);this[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5b')]+=0x1;this[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5a')]+=0x1;_0x56ab64=new Hangup(_0xcd7f01,_0x106af3);_0x56ab64[_0x43ce('0xde')]=0x12;_0x56ab64['statedesc']=_0x43ce('0xdf');_0x56ab64['membername']='AMD';ami[_0x43ce('0x49')](_0x43ce('0xe0'),ut[_0x43ce('0xe1')](_0x56ab64,_0x43ce('0xe2')));this['saveInDb'](_0x56ab64,_0x43ce('0xe3'),_0x43ce('0xe4'));}if(_0xcd7f01[_0x43ce('0x4a')]!==_0x43ce('0x75')&&this['voiceQueues'][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0xe5')]&&_0x106af3[_0x43ce('0xdc')]==='MACHINE'){var _0x318176=this;return new BPromise(function(_0x13aa5a,_0x44658e){delete _0x318176[_0x43ce('0x26')][_0x106af3[_0x43ce('0xd8')]];_0x318176['updateOriginated'](_0x318176[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]]);_0x318176['voiceQueues'][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5b')]+=0x1;_0x318176[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5a')]+=0x1;var _0x3fc947=_0x318176[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]];var _0x2428bb=new Hangup(_0xcd7f01,_0x106af3);_0x2428bb['state']=0x13;_0x2428bb[_0x43ce('0x9e')]=_0x43ce('0xe6');_0x2428bb[_0x43ce('0xe7')]=_0x43ce('0xe8');_0x2428bb[_0x43ce('0xe9')]+=0x1;_0x2428bb[_0x43ce('0xea')]+=0x1;_0x2428bb[_0x43ce('0xe2')]=!![];ami[_0x43ce('0x49')](_0x43ce('0xe0'),ut[_0x43ce('0xe1')](_0x2428bb,_0x43ce('0xe2')));_0x318176['createHistory'](_0x2428bb)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xeb')));if(_0x2428bb[_0x43ce('0xec')]+_0x2428bb['countcongestionretry']+_0x2428bb[_0x43ce('0xed')]+_0x2428bb[_0x43ce('0xee')]+_0x2428bb[_0x43ce('0xef')]+_0x2428bb[_0x43ce('0xf0')]+_0x2428bb[_0x43ce('0xe9')]+_0x2428bb[_0x43ce('0xf1')]>=_0x3fc947[_0x43ce('0xf2')]){_0x318176[_0x43ce('0xf3')](_0x2428bb,_0x13aa5a,_0x44658e,_0x43ce('0xf4'));}else{if(_0x2428bb[_0x43ce('0xe9')]>=_0x3fc947[_0x43ce('0xf5')]){_0x318176[_0x43ce('0xf6')](_0x2428bb,_0x13aa5a,_0x44658e,_0x43ce('0xf7'));}else{_0x318176[_0x43ce('0xb8')]({'active':![],'countmachineretry':_0x2428bb['countmachineretry'],'scheduledat':moment()[_0x43ce('0xf8')](_0x3fc947['dialMachineRetryFrequency'],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x2428bb[_0x43ce('0xca')],'ListId':_0x2428bb[_0x43ce('0xcb')],'VoiceQueueId':_0x2428bb['VoiceQueueId']||undefined,'CampaignId':_0x2428bb[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xfb')));_0x13aa5a({'reschedule':0x1});}}});}if(_0xcd7f01[_0x43ce('0x4a')]==='ivr'&&this[_0x43ce('0x21')][_0xcd7f01[_0x43ce('0xab')]]['dialAMDActive']&&_0x106af3[_0x43ce('0xdc')]==='HANGUP'){delete this['uniqueId'][_0x106af3['uniqueid']];this[_0x43ce('0xa9')](this['campaigns'][_0xcd7f01[_0x43ce('0xab')]]);_0x56ab64=new Hangup(_0xcd7f01,_0x106af3);_0x56ab64['state']=0x12;_0x56ab64[_0x43ce('0x9e')]='HangupInAMD';_0x56ab64['membername']=_0x43ce('0xe8');ami['emit'](_0x43ce('0xe0'),ut[_0x43ce('0xe1')](_0x56ab64,'amd'));this[_0x43ce('0xfc')](_0x56ab64,_0x43ce('0xfd'),_0x43ce('0xfe'));}if(_0xcd7f01[_0x43ce('0x4a')]===_0x43ce('0x75')&&this['campaigns'][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0xe5')]&&_0x106af3[_0x43ce('0xdc')]===_0x43ce('0xff')){var _0x318176=this;return new BPromise(function(_0x3d662d,_0x55a32a){delete _0x318176[_0x43ce('0x26')][_0x106af3['uniqueid']];_0x318176[_0x43ce('0xa9')](_0x318176[_0x43ce('0x21')][_0xcd7f01['queue']]);_0x318176['campaigns'][_0xcd7f01['queue']][_0x43ce('0x5b')]+=0x1;_0x318176['campaigns'][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5a')]+=0x1;var _0x150a59=_0x318176[_0x43ce('0x21')][_0xcd7f01[_0x43ce('0xab')]];var _0x282e1f=new Hangup(_0xcd7f01,_0x106af3);_0x282e1f[_0x43ce('0xde')]=0x13;_0x282e1f['statedesc']=_0x43ce('0xe6');_0x282e1f[_0x43ce('0xe7')]=_0x43ce('0xe8');_0x282e1f[_0x43ce('0xe9')]+=0x1;_0x282e1f[_0x43ce('0xea')]+=0x1;_0x282e1f[_0x43ce('0xe2')]=!![];ami[_0x43ce('0x49')](_0x43ce('0xe0'),ut[_0x43ce('0xe1')](_0x282e1f,_0x43ce('0xe2')));_0x318176[_0x43ce('0xc1')](_0x282e1f)[_0x43ce('0xa7')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x282e1f[_0x43ce('0xec')]+_0x282e1f[_0x43ce('0x100')]+_0x282e1f[_0x43ce('0xed')]+_0x282e1f['countnosuchnumberretry']+_0x282e1f[_0x43ce('0xef')]+_0x282e1f['countabandonedretry']+_0x282e1f[_0x43ce('0xe9')]+_0x282e1f['countagentrejectretry']>=_0x150a59['dialGlobalMaxRetry']){_0x318176['stateGlobal'](_0x282e1f,_0x3d662d,_0x55a32a,_0x43ce('0xf4'));}else{if(_0x282e1f['countmachineretry']>=_0x150a59[_0x43ce('0xf5')]){_0x318176['createStateFinal'](_0x282e1f,_0x3d662d,_0x55a32a,_0x43ce('0xf7'));}else{_0x318176[_0x43ce('0xb8')]({'active':![],'countmachineretry':_0x282e1f[_0x43ce('0xe9')],'scheduledat':moment()[_0x43ce('0xf8')](_0x150a59[_0x43ce('0x101')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x282e1f['ContactId'],'ListId':_0x282e1f[_0x43ce('0xcb')],'VoiceQueueId':_0x282e1f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x282e1f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xfb')));_0x3d662d({'reschedule':0x1});}}});}}};Dialer[_0x43ce('0x1a')]['syncHangup']=function(_0x49d4c4){var _0x5cb9a4=this[_0x43ce('0x26')][_0x49d4c4[_0x43ce('0xd8')]];var _0xc1f22e=this;var _0x3ed975;if(_0x5cb9a4&&_0x5cb9a4[_0x43ce('0x4a')]===_0x43ce('0x75')){delete this[_0x43ce('0x26')][_0x49d4c4[_0x43ce('0xd8')]];this[_0x43ce('0xa9')](this[_0x43ce('0x21')][_0x5cb9a4[_0x43ce('0xab')]]);this[_0x43ce('0x21')][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x102')]+=0x1;_0x3ed975=new Hangup(_0x5cb9a4,_0x49d4c4);this[_0x43ce('0xc1')](_0x3ed975)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x103')));this[_0x43ce('0xbf')](_0x3ed975)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x104')));}if(_0x5cb9a4&&_0x5cb9a4[_0x43ce('0x4a')]!==_0x43ce('0x75')&&isNotNull(this['voiceQueues'][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x105')])){delete this[_0x43ce('0x26')][_0x49d4c4[_0x43ce('0xd8')]];this[_0x43ce('0xa9')](this[_0x43ce('0x20')][_0x5cb9a4['queue']]);this['voiceQueues'][_0x5cb9a4[_0x43ce('0xab')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x5a')]+=0x1;_0x3ed975=new Hangup(_0x5cb9a4,_0x49d4c4);_0x3ed975['state']=0x10;_0x3ed975[_0x43ce('0x9e')]=_0x43ce('0x106');_0x3ed975[_0x43ce('0xe7')]=_0x43ce('0x107');this[_0x43ce('0xc1')](_0x3ed975)['catch'](loggerCatch(_0x43ce('0x103')));this['moveContactManagedDialer'](_0x3ed975)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x104')));}if(_0x5cb9a4&&_0x5cb9a4[_0x43ce('0x4a')]!==_0x43ce('0x75')&&!isNotNull(this[_0x43ce('0x20')][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x105')])){delete this[_0x43ce('0x26')][_0x49d4c4[_0x43ce('0xd8')]];this[_0x43ce('0xa9')](this[_0x43ce('0x20')][_0x5cb9a4[_0x43ce('0xab')]]);this[_0x43ce('0x20')][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x108')]+=0x1;_0x3ed975=new Hangup(_0x5cb9a4,_0x49d4c4);_0x3ed975[_0x43ce('0xde')]=0xc;_0x3ed975[_0x43ce('0x9e')]=_0x49d4c4['cause-txt'];_0x3ed975[_0x43ce('0xe7')]='Unknow';this['createHistory'](_0x3ed975)[_0x43ce('0xa7')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x43ce('0xbf')](_0x3ed975)[_0x43ce('0xa7')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x43ce('0x1a')][_0x43ce('0x109')]=function(_0x26a0ef){var _0x1b7827=this[_0x43ce('0x26')][_0x26a0ef[_0x43ce('0xd8')]];var _0x182ade=this;if(this['voiceQueues'][_0x26a0ef[_0x43ce('0xab')]]){if(_0x1b7827&&_0x1b7827[_0x43ce('0x4a')]!==_0x43ce('0x75')){delete this[_0x43ce('0x26')][_0x26a0ef[_0x43ce('0xd8')]];this[_0x43ce('0x20')][_0x26a0ef[_0x43ce('0xab')]][_0x43ce('0x5b')]+=0x1;var _0x44542b=new AgentComplete(_0x1b7827,_0x26a0ef);if(_0x26a0ef[_0x43ce('0x10a')]===_0x43ce('0x10b')){_0x44542b['agiafterat']=this[_0x43ce('0x20')][_0x26a0ef[_0x43ce('0xab')]]['dialQueueProject2']&&this[_0x43ce('0x20')][_0x26a0ef[_0x43ce('0xab')]][_0x43ce('0x10c')]?moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x43ce('0xc1')](_0x44542b)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x10d')));this[_0x43ce('0xbf')](_0x44542b)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x10e')));}}};Dialer[_0x43ce('0x1a')][_0x43ce('0x10f')]=function(_0x45f91f){if(this[_0x43ce('0x20')][_0x45f91f[_0x43ce('0xab')]]){if(this['uniqueId'][_0x45f91f[_0x43ce('0xd8')]]&&this['uniqueId'][_0x45f91f[_0x43ce('0xd8')]][_0x43ce('0x4a')]!==_0x43ce('0x75')){this[_0x43ce('0xa9')](this[_0x43ce('0x20')][_0x45f91f['queue']]);this[_0x43ce('0x26')][_0x45f91f[_0x43ce('0xd8')]][_0x43ce('0x110')]=moment()[_0x43ce('0x73')](_0x43ce('0xfa'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x5eea45){this['createHistory'](_0x5eea45)['catch'](loggerCatch(_0x43ce('0x10d')));this[_0x43ce('0xbf')](_0x5eea45)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x111')));};Dialer[_0x43ce('0x1a')]['syncQueueCallerAbandon']=function(_0x21cec9){var _0x50564a=this[_0x43ce('0x26')][_0x21cec9['uniqueid']];var _0xe08d6d=this;if(this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]]){if(_0x50564a&&_0x50564a[_0x43ce('0x4a')]!==_0x43ce('0x75')){delete this[_0x43ce('0x26')][_0x21cec9[_0x43ce('0xd8')]];this[_0x43ce('0xa9')](this['voiceQueues'][_0x21cec9[_0x43ce('0xab')]]);_0x50564a['droptime']=moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0x32c987=new QueueCallerAbandon(_0x50564a,_0x21cec9);if(getSeconds(_0x50564a[_0x43ce('0x112')],_0x50564a['responsetime'])>=_0x50564a['dialQueueTimeout']){this['voiceQueues'][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x68')]+=0x1;this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x43ce('0x20')][_0x21cec9['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x32c987['state']=0xa;_0x32c987['statedesc']=_0x43ce('0x113');_0x32c987[_0x43ce('0x114')]=_0x43ce('0x115');_0x32c987['agiafterat']=this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x116')]?moment()[_0x43ce('0x73')](_0x43ce('0xfa')):undefined;_0x32c987[_0x43ce('0xef')]+=0x1;_0x32c987[_0x43ce('0xea')]+=0x1;if(_0x32c987[_0x43ce('0xef')]>=this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x117')]){this[_0x43ce('0x118')](_0x32c987);}else{this[_0x43ce('0xb8')]({'active':![],'countdropretry':_0x32c987[_0x43ce('0xef')],'scheduledat':moment()['add'](this[_0x43ce('0x20')][_0x21cec9['queue']][_0x43ce('0x119')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x50564a[_0x43ce('0xca')],'ListId':_0x50564a[_0x43ce('0xcb')],'VoiceQueueId':_0x50564a['VoiceQueueId']||undefined,'CampaignId':_0x50564a[_0x43ce('0xce')]||undefined})['catch'](loggerCatch(_0x43ce('0x11a')));var _0x4419b3=new History(_0x32c987);_0x4419b3[_0x43ce('0xde')]=0xa;_0x4419b3[_0x43ce('0x9e')]='Drop';_0x4419b3['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4419b3[_0x43ce('0x9f')]=_0x4419b3[_0x43ce('0x11b')];_0x4419b3[_0x43ce('0x11c')]=_0x32c987['calleridname'];_0x4419b3['calleridnum']=_0x32c987[_0x43ce('0x11d')];this[_0x43ce('0xc1')](_0x4419b3)['catch'](loggerCatch(_0x43ce('0x11e')));}}else{this[_0x43ce('0x20')][_0x21cec9['queue']][_0x43ce('0x67')]+=0x1;this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x5f')]+=0x1;_0x32c987[_0x43ce('0xde')]=0xb;_0x32c987[_0x43ce('0x9e')]=_0x43ce('0x11f');_0x32c987['dropreason']=_0x43ce('0x120');_0x32c987[_0x43ce('0xf0')]+=0x1;_0x32c987[_0x43ce('0xea')]+=0x1;if(_0x32c987[_0x43ce('0xf0')]>=this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]]['dialAbandonedMaxRetry']){this[_0x43ce('0x118')](_0x32c987);}else{this[_0x43ce('0xb8')]({'active':![],'countabandonedretry':_0x32c987[_0x43ce('0xf0')],'scheduledat':moment()[_0x43ce('0xf8')](this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x121')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x50564a[_0x43ce('0xca')],'ListId':_0x50564a['ListId'],'VoiceQueueId':_0x50564a['VoiceQueueId']||undefined,'CampaignId':_0x50564a[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x122')));var _0x4419b3=new History(_0x32c987);_0x4419b3['state']=0xb;_0x4419b3[_0x43ce('0x9e')]=_0x43ce('0x11f');_0x4419b3['starttime']=moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x4419b3[_0x43ce('0x9f')]=_0x4419b3[_0x43ce('0x11b')];_0x4419b3['calleridname']=_0x32c987[_0x43ce('0x11c')];_0x4419b3[_0x43ce('0x11d')]=_0x32c987[_0x43ce('0x11d')];this[_0x43ce('0xc1')](_0x4419b3)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x123')));}}}}};Dialer[_0x43ce('0x1a')][_0x43ce('0x124')]=function(_0x5db190){if(this['actions'][_0x5db190[_0x43ce('0xd8')]]){this[_0x43ce('0xa2')][_0x5db190[_0x43ce('0xd8')]]['channel']=_0x5db190[_0x43ce('0xa6')];}if(this[_0x43ce('0x26')][_0x5db190[_0x43ce('0xd8')]]){this[_0x43ce('0x26')][_0x5db190[_0x43ce('0xd8')]][_0x43ce('0xa6')]=_0x5db190[_0x43ce('0xa6')];}};Dialer[_0x43ce('0x1a')][_0x43ce('0x35')]=function(_0x262b57){if(strategy[this[_0x43ce('0x20')][this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]]['queue']]['strategy']]==='roundrobin'){if(this['actions'][_0x262b57[_0x43ce('0x125')]]&&_[_0x43ce('0xa4')](this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]][_0x43ce('0x126')])&&_0x262b57[_0x43ce('0xa5')]==='1'&&_0x262b57[_0x43ce('0x127')]==='0'){if(this[_0x43ce('0x22')][_0x262b57[_0x43ce('0x128')]]){if(!this[_0x43ce('0x22')][_0x262b57[_0x43ce('0x128')]][_0x43ce('0x126')]){this[_0x43ce('0x22')][_0x262b57[_0x43ce('0x128')]][_0x43ce('0x126')]=!![];this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]][_0x43ce('0x126')]=!![];this['actions'][_0x262b57[_0x43ce('0x125')]][_0x43ce('0x128')]=_0x262b57[_0x43ce('0x128')];}}}}else if((strategy[this[_0x43ce('0x20')][this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]][_0x43ce('0xab')]][_0x43ce('0x4c')]]||_0x43ce('0x19'))===_0x43ce('0x19')){if(this['actions'][_0x262b57['actionid']]){if(this[_0x43ce('0x22')][_0x262b57[_0x43ce('0x128')]]){this[_0x43ce('0xa2')][_0x262b57['actionid']]['stateinterface']=_0x262b57[_0x43ce('0x128')];if(_['isNil'](this[_0x43ce('0x29')][this['actions'][_0x262b57['actionid']][_0x43ce('0xab')]])){this['queueBooked'][this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]]['queue']]=[];}this[_0x43ce('0x29')][this[_0x43ce('0xa2')][_0x262b57['actionid']]['queue']][_0x43ce('0x129')](_[_0x43ce('0xc8')](_[_0x43ce('0xc9')](this[_0x43ce('0xa2')][_0x262b57['actionid']],[_0x43ce('0x12a'),_0x43ce('0x128')]),{'status':_0x262b57[_0x43ce('0xa5')],'paused':_0x262b57['paused']}));}}}};function unlockQueueStatus(_0x41f821,_0x22aadc){setTimeout(function(){if(_[_0x43ce('0x7f')](_0x41f821[_0x43ce('0x12b')])){loggerBooked[_0x43ce('0x90')](_0x43ce('0x12c'),_0x22aadc);}_0x41f821['queueStatusComplete']=!![];loggerBooked[_0x43ce('0x78')]('[booked][unlockQueueStatus]',_0x22aadc,JSON[_0x43ce('0x46')](_['pick'](_0x41f821,[_0x43ce('0x3b'),_0x43ce('0x12b')])));},0x1f3);}Dialer[_0x43ce('0x1a')][_0x43ce('0x12d')]=function(_0x437e68){var _0x8d2e80=this;var _0x26814c=_0x8d2e80[_0x43ce('0x20')][_0x8d2e80['actions'][_0x437e68['actionid']][_0x43ce('0xab')]];if(strategy[this[_0x43ce('0x20')][this[_0x43ce('0xa2')][_0x437e68['actionid']][_0x43ce('0xab')]][_0x43ce('0x4c')]]===_0x43ce('0x12e')){if(this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]]&&this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0x128')]){this['preview'][_0x43ce('0x12f')](this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0x12a')],this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0x128')])[_0x43ce('0xa7')](function(_0x5aa218){logger[_0x43ce('0x90')](_0x43ce('0x130'),util[_0x43ce('0x8e')](_0x5aa218,{'showHidden':![],'depth':null}));})[_0x43ce('0x1d')](function(){_0x8d2e80[_0x43ce('0xa9')](_0x8d2e80['voiceQueues'][_0x8d2e80['actions'][_0x437e68['actionid']]['queue']]);_0x8d2e80['agents'][_0x8d2e80[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0x128')]][_0x43ce('0x126')]=![];delete _0x8d2e80[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]];unlockQueueStatus(_0x26814c);});}else{this['updateOriginated'](this['voiceQueues'][this['actions'][_0x437e68['actionid']]['queue']]);this[_0x43ce('0xb8')]({'active':![],'ContactId':this[_0x43ce('0xa2')][_0x437e68['actionid']]['ContactId'],'ListId':this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xcb')],'VoiceQueueId':this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xcd')]||undefined,'CampaignId':this['actions'][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xce')]||undefined})['catch'](loggerCatch(_0x43ce('0x131')));delete this['actions'][_0x437e68[_0x43ce('0x125')]];unlockQueueStatus(_0x26814c);}}else if((strategy[this[_0x43ce('0x20')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]][_0x43ce('0x4c')]]||_0x43ce('0x19'))===_0x43ce('0x19')){var _0x35ea12;if(this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]]&&!_[_0x43ce('0x43')](this[_0x43ce('0x29')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]])){if(this[_0x43ce('0x2a')][_0x8d2e80[_0x43ce('0xa2')][_0x437e68['actionid']]['queue']]){this[_0x43ce('0x2a')][_0x8d2e80[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]]=this[_0x43ce('0x2a')][this[_0x43ce('0xa2')][_0x437e68['actionid']]['queue']]?this[_0x43ce('0x2a')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]]:this[_0x43ce('0x29')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]]?this['queueBooked'][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]][_0x43ce('0x132')]||0x0:0x0;}this[_0x43ce('0x29')][this['actions'][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]][_0x43ce('0x132')]=this[_0x43ce('0x2a')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]];for(var _0x29b74b=0x0;_0x29b74b=0x0;})[_0x43ce('0xa7')](myreject(_0x553a60)));}}else{_0x33fc86[_0x43ce('0x129')](ami[_0x43ce('0x14e')]({'action':_0x43ce('0x147'),'command':util[_0x43ce('0x73')](_0x43ce('0x148'),_0x4ffd61,!_[_0x43ce('0x7f')](config[_0x43ce('0x14a')][_0x24d66d])?_0x24d66d:'')})[_0x43ce('0xb0')](function(_0x16a67e){return _0x16a67e[_0x43ce('0x14b')]['indexOf'](_0x43ce('0x14d'))>=0x0;})[_0x43ce('0xa7')](myreject(_0x553a60)));}BPromise[_0x43ce('0x14f')](_0x33fc86)['then'](function(_0x52b81f){var _0x4b10f4=_['some'](_0x52b81f);if(_0x4b10f4){return _0x2a519b(_0x4b10f4);}else{_0x47f747['message']=_0x57de35?_0x43ce('0x150'):_0x43ce('0x151');return _0x553a60(msgResponse(_0x43ce('0x152'),'Failure','Global:\x20'+_0x57de35+'\x20'+_0x4ebf9f+_0x43ce('0x153')+util['inspect'](_0x4ffd61,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x24d66d));}})[_0x43ce('0xa7')](function(_0xb3498a){return _0x553a60(msgResponse('ifTime',_0x43ce('0x141'),JSON[_0x43ce('0x46')](_0xb3498a)));});});};Dialer[_0x43ce('0x1a')][_0x43ce('0x154')]=function(_0x31a49c){var _0xfba88e=this;return function(){switch(_0x31a49c['dialMethod']){case _0x43ce('0x155'):freeVariablesPredictive(_0x31a49c);_0xfba88e[_0x43ce('0x156')](_0x31a49c,0x1);break;case'power':freeVariablesPredictive(_0x31a49c);_0xfba88e['handlePower'](_0x31a49c,_0x31a49c[_0x43ce('0x157')]);break;case'predictive':_0xfba88e[_0x43ce('0x158')](_0x31a49c);break;case'booked':freeVariablesPredictive(_0x31a49c);_0xfba88e[_0x43ce('0x156')](_0x31a49c,0x1);break;default:freeVariablesPredictive(_0x31a49c);logger['error'](_0x43ce('0x159'),_0x31a49c['name'],_0x43ce('0x15a'));}};};Dialer[_0x43ce('0x1a')][_0x43ce('0x15b')]=function(_0x2c8648){var _0x1e1dad=this;return function(){_0x1e1dad[_0x43ce('0x15c')](_0x2c8648);};};Dialer[_0x43ce('0x1a')][_0x43ce('0xa')]=function(_0x12282f){var _0x514a2b=this;if(isNotPreview(_0x12282f[_0x43ce('0x58')])){if(isVoiceQueueOutbound(_0x12282f[_0x43ce('0x4a')])&&isActive(_0x12282f[_0x43ce('0x57')])){_0x12282f['sendMessageOneNotActive']=!![];BPromise[_0x43ce('0xae')]()['then'](checkIsLoggedIn(_0x12282f,_0x12282f['loggedIn']))[_0x43ce('0xb0')](checkIsActive(_0x12282f,_0x12282f[_0x43ce('0x57')]))[_0x43ce('0xb0')](checkInterval(_0x12282f))[_0x43ce('0xb0')](_0x514a2b[_0x43ce('0x15d')](_0x12282f))[_0x43ce('0xb0')](_0x514a2b[_0x43ce('0x13e')](_0x12282f[_0x43ce('0x15e')],_0x12282f[_0x43ce('0x15f')],_0x12282f['name'],_0x12282f))['then'](_0x514a2b[_0x43ce('0x140')](_0x12282f[_0x43ce('0x3f')],_0x12282f['dialTimezone'],_0x12282f[_0x43ce('0x3b')],_0x12282f))[_0x43ce('0xb0')](_0x514a2b[_0x43ce('0x154')](_0x12282f))[_0x43ce('0xa7')](loggerCatchQueueSummary(_0x43ce('0x160'),_0x12282f));}else{notSendMessagesQueue(_0x12282f);}}else{freeVariablesPredictive(_0x12282f);}};Dialer['prototype']['syncCampaigns']=function(){var _0x2df413=this;var _0x1a95d4;for(var _0x53cbd1 in this[_0x43ce('0x21')]){if(typeof this[_0x43ce('0x21')][_0x53cbd1]!==_0x43ce('0x93')){_0x1a95d4=this[_0x43ce('0x21')][_0x53cbd1];if(isCampaignIvr(_0x1a95d4['type'])&&isActive(_0x1a95d4[_0x43ce('0xd4')])){_0x1a95d4[_0x43ce('0x99')]=!![];BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](checkIsActive(_0x1a95d4,_0x1a95d4['active']))[_0x43ce('0xb0')](checkInterval(_0x1a95d4))[_0x43ce('0xb0')](_0x2df413[_0x43ce('0x15d')](_0x1a95d4))['then'](_0x2df413[_0x43ce('0x13e')](_0x1a95d4['dialGlobalInterval'],_0x1a95d4['dialTimezone'],_0x1a95d4[_0x43ce('0x3b')],_0x1a95d4))['then'](_0x2df413[_0x43ce('0x140')](_0x1a95d4[_0x43ce('0x3f')],_0x1a95d4['dialTimezone'],_0x1a95d4[_0x43ce('0x3b')],_0x1a95d4))[_0x43ce('0xb0')](_0x2df413[_0x43ce('0x15b')](_0x1a95d4))[_0x43ce('0xa7')](loggerCatchQueueSummary(_0x43ce('0x161'),_0x1a95d4));}else{notSendMessagesCampaign(_0x1a95d4);}}}};function getCallerIdRandom(_0x49f91f,_0x18bcb7){var _0x441fc3;var _0x973e10;var _0x303d32;if(_0x18bcb7<=0x0){_0x18bcb7=0x1;}_0x441fc3=new RegExp(_0x43ce('0x162')+_0x18bcb7+'}$');_0x973e10=Math[_0x43ce('0x163')](0xa,_0x18bcb7-0x1);_0x303d32=Math[_0x43ce('0x163')](0xa,_0x18bcb7)-0x1;return util[_0x43ce('0x73')]('%s',_[_0x43ce('0x164')](_0x49f91f,_0x441fc3,_[_0x43ce('0x165')](_0x973e10,_0x303d32)));}function extractCalleridName(_0x16b2df){var _0x29be0d=_0x16b2df['match'](/"(.*?)"/);return _0x29be0d?_0x29be0d[0x1]:_0x16b2df;}function extractCalleridNumber(_0x1f8e46){var _0x37cd6a=_0x1f8e46[_0x43ce('0x166')](/<(.*?)>/);return _0x37cd6a?_0x37cd6a[0x1]:_0x1f8e46;}Dialer['prototype'][_0x43ce('0x167')]=function(_0x43864c,_0x1b77c5){var _0x125d6c=this;var _0x217e49=uuid['v4']();this[_0x43ce('0xa2')][_0x217e49]=new Action(_0x43864c,_0x1b77c5,_0x217e49);return new BPromise(function(_0x5d5b30,_0xa51358){if(_[_0x43ce('0x7f')](_0x43864c)&&typeof _0x43864c!==_0x43ce('0x168')){return _0xa51358(msgResponse(_0x43ce('0x169'),_0x43ce('0x141'),_0x43ce('0x16a')));}if(_[_0x43ce('0x7f')](_0x1b77c5['Contact']['phone'])||_0x1b77c5[_0x43ce('0x16b')][_0x43ce('0x16c')]===null){return _0xa51358(msgResponse('originate',_0x43ce('0x141'),_0x43ce('0x16d')));}var _0x2436a6={'XMD-CALLERID':_0x125d6c[_0x43ce('0xa2')][_0x217e49]['getCaller'](),'XMD-AGI':_0x43864c[_0x43ce('0x105')]?util[_0x43ce('0x73')](_0x43ce('0x16e'),ipAgi,_0x43864c[_0x43ce('0x105')]):_0x43ce('0x16f'),'XMD-AGIAFTER':_0x43864c['dialQueueProject2']?util[_0x43ce('0x73')](_0x43ce('0x16e'),ipAgi,_0x43864c['dialQueueProject2']):_0x43ce('0x16f'),'XMD-QUEUE':_0x43864c[_0x43ce('0x4a')]===_0x43ce('0x4b')?util[_0x43ce('0x73')]('\x22%s,%s%s,,,%s\x22',_0x43864c[_0x43ce('0x3b')],_0x43864c[_0x43ce('0x170')]||'',_0x43864c[_0x43ce('0x10c')]?'c':'',_0x43864c[_0x43ce('0x171')]||0x3):_0x43ce('0x16f'),'XMD-CONTACTID':_0x1b77c5[_0x43ce('0xca')],'XMD-CDRTYPE':_0x43ce('0x7'),'CALLERID(all)':_0x125d6c[_0x43ce('0xa2')][_0x217e49][_0x43ce('0x172')](),'XMD-AMD':_0x43864c[_0x43ce('0xe5')]?'ACTIVE':_0x43ce('0x16f'),'XMD-DESTINATION':_0x43ce('0x173')};if(_0x43864c[_0x43ce('0xe5')]){_0x2436a6[_0x43ce('0x174')]=_0x43864c['dialAMDInitialSilence']||0x9c4;_0x2436a6[_0x43ce('0x175')]=_0x43864c[_0x43ce('0x176')]||0x5dc;_0x2436a6['XMD-AMDAFTERGREETINGSILENCE']=_0x43864c[_0x43ce('0x177')]||0x320;_0x2436a6[_0x43ce('0x178')]=_0x43864c[_0x43ce('0x179')]||0x1388;_0x2436a6[_0x43ce('0x17a')]=_0x43864c[_0x43ce('0x17b')]||0x64;_0x2436a6[_0x43ce('0x17c')]=_0x43864c['dialAMDBetweenWordsSilence']||0x32;_0x2436a6['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x43864c[_0x43ce('0x17d')]||0x3;_0x2436a6['XMD-AMDSILENCETHRESHOLD']=_0x43864c['dialAMDSilenceThreshold']||0x100;_0x2436a6[_0x43ce('0x17e')]=_0x43864c[_0x43ce('0x17f')]||0x1388;}if(_0x43864c['type']===_0x43ce('0x4b')){_0x2436a6['XMD-VOICEQUEUEID']=_0x1b77c5['VoiceQueueId'];}else{_0x2436a6['XMD-CAMPAIGNID']=_0x1b77c5[_0x43ce('0xce')];}for(var _0x3ff999 in _0x1b77c5[_0x43ce('0x16b')]){if(typeof _0x1b77c5[_0x43ce('0x16b')][_0x3ff999]!==_0x43ce('0x93')){if(isNotNull(_0x1b77c5[_0x43ce('0x16b')][_0x3ff999])&&_0x3ff999!=='id'&&_0x3ff999!=='tags'&&_0x3ff999!==_0x43ce('0x180')&&_0x3ff999!==_0x43ce('0x181')){_0x2436a6[util[_0x43ce('0x73')]('%s%s',_0x43ce('0x182'),_[_0x43ce('0x183')](_0x3ff999))]=_0x1b77c5[_0x43ce('0x16b')][_0x3ff999];}}}var _0x1e601d=_0x125d6c[_0x43ce('0xd3')](_0x43864c[_0x43ce('0x72')])?getCallerId(_0x43864c[_0x43ce('0x72')]['callerid'],_0x43864c[_0x43ce('0x59')],_0x43864c['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x43864c['dialOriginateCallerIdNumber'],_0x43864c[_0x43ce('0x184')]):_0x43864c[_0x43ce('0x185')]):getCallerId(_['isNil'](_0x43864c[_0x43ce('0x13c')])?_0x43864c[_0x43ce('0x72')]['callerid']:_0x43864c['TrunkBackup'][_0x43ce('0x186')],_0x43864c[_0x43ce('0x59')],_0x43864c[_0x43ce('0x184')]>0x0?getCallerIdRandom(_0x43864c[_0x43ce('0x185')],_0x43864c[_0x43ce('0x184')]):_0x43864c['dialOriginateCallerIdNumber']);if(_0x1e601d){_0x2436a6['XMD-ORIGINATECALLERIDNAME']=_0x125d6c[_0x43ce('0xa2')][_0x217e49][_0x43ce('0x187')]=extractCalleridName(_0x1e601d);_0x2436a6['XMD-ORIGINATECALLERIDNUM']=_0x125d6c[_0x43ce('0xa2')][_0x217e49][_0x43ce('0x188')]=extractCalleridNumber(_0x1e601d);}return ami[_0x43ce('0x14e')]({'actionid':_0x217e49,'action':_0x43ce('0x169'),'channel':_0x125d6c[_0x43ce('0xd3')](_0x43864c[_0x43ce('0x72')])?util[_0x43ce('0x73')]('SIP/%s/%s%s',_0x43864c[_0x43ce('0x72')][_0x43ce('0x3b')],isNotNull(_0x43864c[_0x43ce('0x189')])?_0x43864c['dialPrefix']['trim']()||'':'',_0x43864c['dialCutDigit']>0x0?_0x1b77c5[_0x43ce('0x16b')][_0x43ce('0x16c')]['substring'](_0x43864c['dialCutDigit']):_0x1b77c5[_0x43ce('0x16b')][_0x43ce('0x16c')]):util[_0x43ce('0x73')](_0x43ce('0x18a'),_['isNil'](_0x43864c[_0x43ce('0x13c')])?_0x43864c['Trunk'][_0x43ce('0x3b')]:_0x43864c[_0x43ce('0x13c')][_0x43ce('0x3b')],isNotNull(_0x43864c[_0x43ce('0x189')])?_0x43864c[_0x43ce('0x189')]['trim']()||'':'',_0x43864c['dialCutDigit']>0x0?_0x1b77c5[_0x43ce('0x16b')]['phone'][_0x43ce('0x18b')](_0x43864c[_0x43ce('0x18c')]):_0x1b77c5[_0x43ce('0x16b')][_0x43ce('0x16c')]),'callerid':_0x1e601d,'Exten':_0x43ce('0x173'),'Context':_0x43ce('0x18d'),'Priority':'1','variable':_0x2436a6,'timeout':(_0x43864c[_0x43ce('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x217e49})[_0x43ce('0xb0')](function(_0x3c4235){return _0x5d5b30(_0x3c4235);})[_0x43ce('0xa7')](function(_0x5a6949){_0x43864c[_0x43ce('0x63')]+=0x1;var _0x2218ed=new History(_0x125d6c[_0x43ce('0xa2')][_0x217e49]);logger[_0x43ce('0x90')](util[_0x43ce('0x73')](_0x43ce('0x18f'),JSON[_0x43ce('0x46')](_0x5a6949)));_0x2218ed[_0x43ce('0xde')]=0xe;_0x2218ed[_0x43ce('0x9e')]=_0x43ce('0x190');_0x2218ed['starttime']=moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x2218ed[_0x43ce('0x9f')]=_0x2218ed[_0x43ce('0x11b')];_0x125d6c[_0x43ce('0xc1')](_0x2218ed)[_0x43ce('0xa7')](loggerCatch('[originate][error]'));_0x125d6c[_0x43ce('0xbf')](_0x2218ed)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x191')))['finally'](function(){delete _0x125d6c[_0x43ce('0xa2')][_0x217e49];return _0xa51358(msgResponse(_0x43ce('0x169'),_0x43ce('0x45'),_0x43ce('0x192')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x23b1f5){var _0x13a76d=this[_0x43ce('0xa2')][_0x23b1f5['actionid']];if(_0x13a76d){delete this['actions'][_0x23b1f5[_0x43ce('0x125')]];_0x13a76d[_0x43ce('0x193')]=moment()['format'](_0x43ce('0xfa'));var _0x16a66b=_0x13a76d[_0x43ce('0x4a')]==='ivr'?this[_0x43ce('0x21')][_0x13a76d[_0x43ce('0xab')]]:this[_0x43ce('0x20')][_0x13a76d[_0x43ce('0x194')]()];if(!this[_0x43ce('0xd1')](_0x23b1f5[_0x43ce('0x195')])){this['updateOriginated'](_0x16a66b);return this[_0x43ce('0x196')](_0x13a76d,_0x16a66b,_0x23b1f5)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0x43ce('0x26')][_0x23b1f5[_0x43ce('0xd8')]]=_0x13a76d;}};Dialer[_0x43ce('0x1a')][_0x43ce('0x197')]=function(_0xbf6db1,_0x544ce7,_0x2d9d25){var _0x3a1c7f=new History(_0x544ce7);if(_0x3a1c7f[_0x43ce('0xec')]+_0x3a1c7f[_0x43ce('0x100')]+_0x3a1c7f['countnoanswerretry']+_0x3a1c7f['countnosuchnumberretry']+_0x3a1c7f['countdropretry']+_0x3a1c7f[_0x43ce('0xf0')]+_0x3a1c7f['countmachineretry']+_0x3a1c7f[_0x43ce('0xf1')]>=_0x2d9d25[_0x43ce('0xf2')]-0x1){return!![];}switch(_0xbf6db1){case 0x3:if(_0x3a1c7f[_0x43ce('0xed')]>=_0x2d9d25[_0x43ce('0x198')]-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countnoanswerretry':_0x3a1c7f[_0x43ce('0xed')]+=0x1,'scheduledat':moment()['add'](_0x2d9d25[_0x43ce('0x199')],_0x43ce('0xf9'))['format'](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f['CampaignId']||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x19a')));break;case 0x5:if(_0x3a1c7f[_0x43ce('0xec')]>=_0x2d9d25['dialBusyMaxRetry']-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countbusyretry':_0x3a1c7f[_0x43ce('0xec')]+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25[_0x43ce('0x19b')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})['catch'](loggerCatch(_0x43ce('0x19c')));break;case 0x8:if(_0x3a1c7f[_0x43ce('0x100')]>=_0x2d9d25[_0x43ce('0x19d')]-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countcongestionretry':_0x3a1c7f[_0x43ce('0x100')]+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25[_0x43ce('0x19e')],_0x43ce('0xf9'))['format'](_0x43ce('0xfa')),'ContactId':_0x3a1c7f['ContactId'],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f['VoiceQueueId']||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x19f')));break;case 0x0:if(_0x3a1c7f[_0x43ce('0xee')]>=_0x2d9d25[_0x43ce('0x1a0')]-0x1){return!![];}else{this[_0x43ce('0xb8')]({'active':![],'countnosuchnumberretry':_0x3a1c7f[_0x43ce('0xee')]+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25['dialNoSuchNumberRetryFrequency'],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f['ListId'],'VoiceQueueId':_0x3a1c7f['VoiceQueueId']||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1a1')));}break;case 0xa:if(_0x3a1c7f[_0x43ce('0xef')]>=_0x2d9d25['dialDropMaxRetry']-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countdropretry':_0x3a1c7f[_0x43ce('0xef')]+=0x1,'scheduledat':moment()['add'](_0x2d9d25['dialDropRetryFrequency'],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f['ListId'],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x11a')));break;case 0xb:if(_0x3a1c7f['countabandonedretry']>=_0x2d9d25[_0x43ce('0x1a2')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x3a1c7f[_0x43ce('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x2d9d25[_0x43ce('0x121')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f['ContactId'],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f['CampaignId']||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x122')));break;case 0x13:if(_0x3a1c7f[_0x43ce('0xe9')]>=_0x2d9d25['dialMachineMaxRetry']-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countmachineretry':_0x3a1c7f[_0x43ce('0xe9')]+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25[_0x43ce('0x101')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xfb')));break;case 0x14:if(_0x3a1c7f[_0x43ce('0xf1')]>=_0x2d9d25['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countagentrejectretry':_0x3a1c7f['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25[_0x43ce('0x1a3')],_0x43ce('0xf9'))['format'](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f['VoiceQueueId']||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1a4')));break;default:return!![];}};Dialer[_0x43ce('0x1a')][_0x43ce('0x196')]=function(_0x3f2101,_0x15735f,_0x489653){var _0x402dad=this;var _0x5c9611=new History(_0x3f2101);return new BPromise(function(_0x5bae34,_0x1c89c9){if(_[_0x43ce('0x7f')](_0x15735f)&&typeof _0x15735f!==_0x43ce('0x168')){return _0x1c89c9(msgResponse(_0x43ce('0x1a5'),_0x43ce('0x141'),'entity\x20is\x20undefine'));}if(_[_0x43ce('0x7f')](_0x489653)&&typeof _0x489653!==_0x43ce('0x168')){return _0x1c89c9(msgResponse('[callProgressDetecting]',_0x43ce('0x141'),_0x43ce('0x1a6')));}switch(_0x489653[_0x43ce('0x10a')]){case'0':_0x15735f['outboundNoSuchCallsDay']+=0x1;_0x5c9611[_0x43ce('0xde')]=0x0;_0x5c9611[_0x43ce('0x9e')]='NoSuchNumber';_0x5c9611[_0x43ce('0xee')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;ami[_0x43ce('0x49')](_0x43ce('0x1a7'),ut[_0x43ce('0xe1')](_0x3f2101,_0x43ce('0x1a8')));_0x402dad[_0x43ce('0xc1')](_0x5c9611)[_0x43ce('0xa7')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x402dad[_0x43ce('0x197')](0x0,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xee')]>=_0x15735f[_0x43ce('0x1a0')]){_0x402dad['createStateFinal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1a9'));}else{_0x402dad['stateGlobal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1a9'));}}break;case'3':_0x15735f[_0x43ce('0x61')]+=0x1;_0x5c9611[_0x43ce('0xde')]=0x3;_0x5c9611['statedesc']=_0x43ce('0x1aa');_0x5c9611[_0x43ce('0xed')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;ami['emit'](_0x43ce('0x1ab'),ut[_0x43ce('0xe1')](_0x3f2101,'noanswer'));_0x402dad[_0x43ce('0xc1')](_0x5c9611)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1ac')));if(_0x402dad['checkRetriveMax'](0x3,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xed')]>=_0x15735f[_0x43ce('0x198')]){_0x402dad[_0x43ce('0xf6')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1ad'));}else{_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x15735f[_0x43ce('0x5c')]+=0x1;_0x5c9611['state']=0x5;_0x5c9611[_0x43ce('0x9e')]=_0x43ce('0x1ae');_0x5c9611[_0x43ce('0xec')]+=0x1;_0x5c9611['countglobal']+=0x1;ami[_0x43ce('0x49')](_0x43ce('0x1af'),ut[_0x43ce('0xe1')](_0x3f2101,_0x43ce('0x1b0')));_0x402dad[_0x43ce('0xc1')](_0x5c9611)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x402dad[_0x43ce('0x197')](0x5,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xec')]>=_0x15735f[_0x43ce('0x1b1')]){_0x402dad['createStateFinal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b2'));}else{_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b2'));}}break;case'8':_0x15735f[_0x43ce('0x5d')]+=0x1;_0x5c9611[_0x43ce('0xde')]=0x8;_0x5c9611[_0x43ce('0x9e')]=_0x43ce('0x1b3');_0x5c9611[_0x43ce('0x100')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;ami[_0x43ce('0x49')](_0x43ce('0x1b4'),ut[_0x43ce('0xe1')](_0x3f2101,_0x43ce('0x1b5')));_0x402dad[_0x43ce('0xc1')](_0x5c9611)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x402dad[_0x43ce('0x197')](0x8,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0x100')]>=_0x15735f[_0x43ce('0x19d')]){_0x402dad[_0x43ce('0xf6')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b6'));}else{_0x402dad['stateGlobal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b6'));}}break;case'11':_0x15735f['outboundAbandonedCallsDay']+=0x1;_0x5c9611['state']=0xb;_0x5c9611[_0x43ce('0x9e')]=_0x43ce('0x11f');_0x5c9611[_0x43ce('0xf0')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;_0x402dad[_0x43ce('0xc1')](_0x5c9611)['catch'](loggerCatch(_0x43ce('0x123')));if(_0x402dad[_0x43ce('0x197')](0xb,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xf0')]>=_0x15735f[_0x43ce('0x1a2')]){_0x402dad['createStateFinal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b7'));}else{_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b7'));}}break;case'20':_0x15735f[_0x43ce('0x1b8')]+=0x1;_0x5c9611[_0x43ce('0xde')]=0x14;_0x5c9611['statedesc']=_0x43ce('0x1b9');_0x5c9611[_0x43ce('0xf1')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;ami[_0x43ce('0x49')](_0x43ce('0x1ba'),ut[_0x43ce('0xe1')](_0x3f2101,_0x43ce('0x1bb')));_0x402dad['createHistory'](_0x5c9611)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1bc')));if(_0x402dad[_0x43ce('0x197')](0x14,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xf1')]>=_0x15735f[_0x43ce('0x1bd')]){_0x402dad['createStateFinal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1be'));}else{_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,'reason\x2020\x20agentreject');}}break;default:_0x15735f[_0x43ce('0x108')]+=0x1;_0x5c9611[_0x43ce('0xde')]=0xc;_0x5c9611[_0x43ce('0x9e')]=_0x489653[_0x43ce('0x10a')];_0x402dad[_0x43ce('0xc1')](_0x5c9611)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1bf')));if(_0x402dad['checkRetriveMax'](_0x489653[_0x43ce('0x10a')],_0x3f2101,_0x15735f)){if(_0x5c9611['countbusyretry']+_0x5c9611[_0x43ce('0x100')]+_0x5c9611[_0x43ce('0xed')]+_0x5c9611[_0x43ce('0xee')]+_0x5c9611[_0x43ce('0xef')]+_0x5c9611[_0x43ce('0xf0')]+_0x5c9611['countmachineretry']+_0x5c9611[_0x43ce('0xf1')]>=_0x15735f[_0x43ce('0xf2')]){_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x489653[_0x43ce('0x10a')]);}else{_0x402dad[_0x43ce('0xf6')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x489653[_0x43ce('0x10a')]);}}}});};Dialer[_0x43ce('0x1a')][_0x43ce('0xf3')]=function(_0x270580,_0x195313,_0x1917b2,_0x565ce9){var _0x4711db=new Final(_0x270580);_0x4711db[_0x43ce('0xde')]=0xf;_0x4711db[_0x43ce('0x9e')]='Global';this[_0x43ce('0xf6')](_0x4711db,_0x195313,_0x1917b2,_0x565ce9);};Dialer[_0x43ce('0x1a')]['createStateFinal']=function(_0x37b911,_0x196d1a,_0x58b1b9,_0x172822){this[_0x43ce('0xbf')](_0x37b911)[_0x43ce('0xb0')](function(){return _0x196d1a(msgResponse(_0x43ce('0x1a5'),_0x43ce('0xd2'),_0x172822));})[_0x43ce('0xa7')](function(){return _0x58b1b9(msgResponse(_0x43ce('0x1c0'),'Failure',_0x43ce('0x1c1')));});};Dialer[_0x43ce('0x1a')][_0x43ce('0x158')]=function(_0x548077){var _0x2f2e35=_0x548077[_0x43ce('0x1c2')]/0x64;var _0x3b7128=_0x548077['outboundDropCallsDayTimeout']/(_0x548077['outboundDropCallsDayTimeout']+_0x548077[_0x43ce('0x5b')]);var _0x1c74ee=Math[_0x43ce('0x1c3')](_0x548077['predictiveIntervalAvailable']*(_0x548077['predictiveIntervalMaxThreshold']/0x64));var _0x1d1dd2=Math[_0x43ce('0x1c3')](_0x548077['predictiveIntervalAvailable']*(_0x548077['predictiveIntervalMinThreshold']/0x64));var _0x2527d1=_0x548077['available']+_0x548077[_0x43ce('0x52')];var _0x14dd4a=Math[_0x43ce('0x1c4')](_0x548077[_0x43ce('0x6e')]*_0x548077[_0x43ce('0x6f')]*_0x548077[_0x43ce('0x6a')]*_0x548077[_0x43ce('0x1c5')]);if(_[_0x43ce('0x7f')](_0x548077['startProgressive'])){if(!_[_0x43ce('0x7f')](_0x548077[_0x43ce('0x71')])){_0x548077['startPredictive']=undefined;loggerPredictive['error'](_0x43ce('0x1c6'),_0x43ce('0x1c7'));}if(!_[_0x43ce('0x7f')](_0x548077[_0x43ce('0x89')])){loggerPredictive[_0x43ce('0x90')](_0x43ce('0x1c6'),_0x43ce('0x1c8'));clearInterval(_0x548077[_0x43ce('0x89')]);_0x548077[_0x43ce('0x89')]=undefined;}_0x548077[_0x43ce('0x86')]=moment()[_0x43ce('0x73')](_0x43ce('0xfa'));loggerPredictive[_0x43ce('0x78')](_0x548077[_0x43ce('0x3b')],_0x43ce('0x1c9'),_0x548077[_0x43ce('0x86')]);this[_0x43ce('0x156')](_0x548077,0x1);}else if(ifInterval(_0x548077[_0x43ce('0x1ca')],_0x548077[_0x43ce('0x86')])){this[_0x43ce('0x156')](_0x548077,0x1);loggerPredictiveCalls['info'](_0x43ce('0x1cb'),_0x548077[_0x43ce('0x86')],_0x548077[_0x43ce('0x3b')]);_0x548077['erlangCalls']=0x0;_0x548077[_0x43ce('0x69')]=0x0;}else if(_0x2f2e35<_0x3b7128&&_0x548077[_0x43ce('0x1cc')]===_0x43ce('0x1cd')){freeVariablesPredictive(_0x548077);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x1ce'),_0x43ce('0x1cf'),_0x3b7128,'startProgressive',_0x548077[_0x43ce('0x3b')]);}else if(_0x14dd4a<_0x548077[_0x43ce('0x69')]&&_0x548077[_0x43ce('0x1cc')]===_0x43ce('0x1cd')){freeVariablesPredictive(_0x548077);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x1d0'),'Max\x20Drop\x20',_0x14dd4a,'Drop\x20in\x20this\x20interval',_0x548077[_0x43ce('0x69')],_0x43ce('0x86'),_0x548077[_0x43ce('0x3b')]);}else if(!ifInterval(_0x548077[_0x43ce('0x1ca')],_0x548077['startProgressive'])&&_[_0x43ce('0x7f')](_0x548077['startPredictive'])&&!_[_0x43ce('0x7f')](_0x548077[_0x43ce('0x86')])){_0x548077[_0x43ce('0x71')]=moment()[_0x43ce('0x73')](_0x43ce('0xfa'));loggerPredictive[_0x43ce('0x78')](_0x548077[_0x43ce('0x3b')],_0x43ce('0x1d1'),_0x548077[_0x43ce('0x71')]);this[_0x43ce('0xb5')](_0x548077[_0x43ce('0x1ca')])[_0x43ce('0xb0')](this[_0x43ce('0x1d2')](_0x548077))[_0x43ce('0xb0')](mergeDataErlangB(_0x548077))['then'](this['startMethodPredictive'](_0x548077))[_0x43ce('0xa7')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x548077));}else if(!ifInterval(_0x548077['dialPredictiveInterval'],_0x548077[_0x43ce('0x71')])){_0x548077[_0x43ce('0x69')]=0x0;_0x548077[_0x43ce('0x71')]=moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x43ce('0x78')](_0x548077[_0x43ce('0x3b')],'recalculate\x20predictive\x20at',_0x548077[_0x43ce('0x71')]);clearInterval(_0x548077[_0x43ce('0x89')]);_0x548077['handlePredictive']=undefined;this[_0x43ce('0xb5')](_0x548077['dialPredictiveInterval'])[_0x43ce('0xb0')](this[_0x43ce('0x1d2')](_0x548077))[_0x43ce('0xb0')](mergeDataErlangB(_0x548077))[_0x43ce('0xb0')](this['startMethodPredictive'](_0x548077))['catch'](loggerCatchPredictive(_0x43ce('0x1d3'),_0x548077));}else if(_0x548077[_0x43ce('0x6c')]&&_0x2527d1<_0x548077[_0x43ce('0x6c')]-_0x1d1dd2){freeVariablesPredictive(_0x548077);loggerPredictive['info'](_0x548077['name'],_0x43ce('0x1d4'),_0x2527d1,')\x20are\x20less\x20than\x20threshold\x20(',_0x548077[_0x43ce('0x6c')],'-',_0x1d1dd2,'=',_0x548077[_0x43ce('0x6c')]-_0x1d1dd2,')');}else if(_0x548077[_0x43ce('0x6c')]&&_0x2527d1>_0x548077[_0x43ce('0x6c')]+_0x1c74ee){freeVariablesPredictive(_0x548077);loggerPredictive[_0x43ce('0x78')](_0x548077['name'],_0x43ce('0x1d4'),_0x2527d1,_0x43ce('0x1d5'),_0x548077[_0x43ce('0x6c')],'+',_0x1c74ee,'=',_0x548077[_0x43ce('0x6c')]+_0x1c74ee,')');}};Dialer['prototype']['getDataPredictive']=function(_0x415444){var _0x3558d1=this;return function(_0x400cca){return new BPromise(function(_0x5c5c72,_0x8b7942){_[_0x43ce('0xc8')](_0x415444,_0x400cca[0x0]);if(checkGetDataPredictive(_0x400cca[0x0])){var _0x4cdba2=_0x415444[_0x43ce('0x6c')]=_0x415444[_0x43ce('0x52')]+_0x415444['available'];var _0x3bc3ba=_0x415444[_0x43ce('0x1ca')]*0x3c;var _0x1343d5=_0x400cca[0x0][_0x43ce('0x66')]+_0x400cca[0x0][_0x43ce('0x7d')];var _0x23d73c=(_0x400cca[0x0][_0x43ce('0x65')]+_0x400cca[0x0][_0x43ce('0x68')]+_0x400cca[0x0][_0x43ce('0x67')])/_0x400cca[0x0][_0x43ce('0x6d')];_0x415444[_0x43ce('0x6a')]=_0x23d73c>0x0?_0x23d73c:0x1;switch(_0x415444[_0x43ce('0x1cc')]){case _0x43ce('0x1cd'):var _0x3e2c5a=_0x415444[_0x43ce('0x1c2')]/0x64;return _0x3558d1[_0x43ce('0x1d6')](_0x4cdba2,_0x3bc3ba,_0x1343d5,_0x23d73c,_0x3e2c5a)['then'](function(_0x5e4b05){return _0x5c5c72(_0x5e4b05);});case _0x43ce('0x1d7'):var _0x2961a2=_0x415444[_0x43ce('0x1c2')]/0x64;return _0x3558d1['busyFactor'](_0x4cdba2,_0x3bc3ba,_0x1343d5,_0x23d73c,_0x2961a2)[_0x43ce('0xb0')](function(_0x155279){return _0x5c5c72(_0x155279);});default:return _0x8b7942(msgResponse(_0x43ce('0x1d8'),_0x43ce('0x141'),_0x43ce('0x1d9')));}}else{return _0x8b7942(msgResponse(_0x43ce('0x1d8'),'Failure',_0x43ce('0x1da')));}});};};Dialer[_0x43ce('0x1a')][_0x43ce('0x1db')]=function(_0x551734){var _0xf2ac01=this;return function(_0x2fdad7){return new BPromise(function(_0x1b8501,_0x12efe0){_[_0x43ce('0xc8')](_0x551734,_0x2fdad7[0x0]);if(checkGetDataPredictive(_0x2fdad7[0x0])){loggerPredictive[_0x43ce('0x78')](JSON[_0x43ce('0x46')](_0x2fdad7[0x0]));if(_0x551734[_0x43ce('0x1cc')]==='dropRate'){return _0xf2ac01[_0x43ce('0xbe')](_0x551734['id'])['then'](function(_0xb01d24){var _0x284b96=_0x551734[_0x43ce('0x1dc')]-_0xb01d24[0x0][_0x43ce('0x1dd')];var _0x543acb=_0x551734[_0x43ce('0x1ca')]*0x3c;var _0x12a917=_0x2fdad7[0x0]['predictiveIntervalAvgTalktime']+_0x2fdad7[0x0][_0x43ce('0x7d')];var _0x106982=(_0x2fdad7[0x0][_0x43ce('0x65')]+_0x2fdad7[0x0][_0x43ce('0x68')]+_0x2fdad7[0x0][_0x43ce('0x67')])/_0x2fdad7[0x0][_0x43ce('0x6d')];var _0x221961=_0x551734['dialPredictiveOptimizationPercentage']/0x64;_0x551734['predictiveIntervalPauses']=_0xb01d24[0x0][_0x43ce('0x1dd')]||0x0;_0x551734[_0x43ce('0x6a')]=_0x106982>0x0?_0x106982:0x1;return _0xf2ac01[_0x43ce('0x1d6')](_0x284b96,_0x543acb,_0x12a917,_0x106982,_0x221961);})[_0x43ce('0xb0')](function(_0x2da1c8){return _0x1b8501(_0x2da1c8);})[_0x43ce('0xa7')](function(_0x5c3902){return _0x12efe0(msgResponse(_0x43ce('0x1de'),_0x43ce('0x141'),JSON[_0x43ce('0x46')](_0x5c3902)));});}if(_0x551734[_0x43ce('0x1cc')]===_0x43ce('0x1d7')){return _0xf2ac01[_0x43ce('0xbe')](_0x551734['id'])[_0x43ce('0xb0')](function(_0x44c443){var _0x1b40eb=_0x551734[_0x43ce('0x1dc')]-_0x44c443[0x0][_0x43ce('0x1dd')];var _0x15a165=_0x551734[_0x43ce('0x1ca')]*0x3c;var _0xb00f94=_0x2fdad7[0x0]['predictiveIntervalAvgTalktime']+_0x2fdad7[0x0][_0x43ce('0x7d')];var _0x3a2751=(_0x2fdad7[0x0][_0x43ce('0x65')]+_0x2fdad7[0x0][_0x43ce('0x68')]+_0x2fdad7[0x0][_0x43ce('0x67')])/_0x2fdad7[0x0][_0x43ce('0x6d')];var _0x2255ea=_0x551734[_0x43ce('0x1c2')]/0x64;_0x551734['predictiveIntervalPauses']=_0x44c443[0x0][_0x43ce('0x1dd')]||0x0;_0x551734['predictiveIntervalHitRate']=_0x3a2751>0x0?_0x3a2751:0x1;return _0xf2ac01[_0x43ce('0x1df')](_0x1b40eb,_0x15a165,_0xb00f94,_0x3a2751,_0x2255ea);})['then'](function(_0x51b1f3){return _0x1b8501(_0x51b1f3);})[_0x43ce('0xa7')](function(_0x3a98f5){return _0x12efe0(msgResponse(_0x43ce('0x1de'),_0x43ce('0x141'),JSON[_0x43ce('0x46')](_0x3a98f5)));});}}else{return _0x12efe0(msgResponse('[getDataPredictive]',_0x43ce('0x141'),_0x43ce('0x1da')));}});};};Dialer[_0x43ce('0x1a')][_0x43ce('0x1e0')]=function(_0x34934f){var _0x1e6e5f=this;return function(){var _0x3af826=0x0;var _0x559e87=Math['floor'](_0x34934f[_0x43ce('0x84')]*0x3e8);if(_0x559e87>0x0){_0x559e87=_0x559e87<0x64?0x64:_0x559e87;loggerPredictive[_0x43ce('0x78')](_0x34934f[_0x43ce('0x3b')],'one\x20call\x20every:',_0x559e87,_0x43ce('0x47'));_0x34934f[_0x43ce('0x89')]=setInterval(function(){_0x1e6e5f[_0x43ce('0x89')](_0x34934f);loggerPredictiveCalls[_0x43ce('0x78')](_0x43ce('0x1e1'),_0x3af826+=0x1);},_0x559e87);}else{loggerPredictive[_0x43ce('0x78')](_0x34934f[_0x43ce('0x3b')],_0x43ce('0x1e2'));}};};Dialer[_0x43ce('0x1a')][_0x43ce('0x1e3')]=function(_0x5c59f0,_0x3bfd8e){var _0x3da741=this;return function(_0x46b0ab){if(_[_0x43ce('0x43')](_0x46b0ab)){if(_['isNil'](_0x3bfd8e[_0x43ce('0xcc')])||!_0x3bfd8e[_0x43ce('0x1e4')]){if(_0x5c59f0[_0x43ce('0x58')]===_0x43ce('0x1e5')){_0x5c59f0[_0x43ce('0x12b')]=_[_0x43ce('0x7f')](_0x5c59f0['queueStatusComplete'])?!![]:_0x5c59f0[_0x43ce('0x12b')];var _0x2fc66e=uuid['v4']();_0x3da741[_0x43ce('0xa2')][_0x2fc66e]=new Action(_0x5c59f0,_0x3bfd8e,_0x2fc66e);loggerBooked[_0x43ce('0x78')](_0x43ce('0x1e6'),_0x2fc66e,_0x43ce('0x1e7'),JSON[_0x43ce('0x46')](_0x5c59f0[_0x43ce('0x12b')]),_0x43ce('0x1e8'),_0x5c59f0[_0x43ce('0x3b')]);if(_0x5c59f0[_0x43ce('0x12b')]){_0x5c59f0[_0x43ce('0x12b')]=![];_0x3da741[_0x43ce('0x29')][_0x3da741[_0x43ce('0xa2')][_0x2fc66e][_0x43ce('0xab')]]=[];ami[_0x43ce('0x14e')]({'actionid':_0x2fc66e,'action':'queuestatus','queue':_0x5c59f0['name']})[_0x43ce('0xa7')](function(){_0x3da741[_0x43ce('0xa9')](_0x5c59f0);_0x3da741['rescheduleContact']({'active':![],'ContactId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e][_0x43ce('0xca')],'ListId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e][_0x43ce('0xcb')],'VoiceQueueId':_0x3da741['actions'][_0x2fc66e][_0x43ce('0xcd')]||undefined,'CampaignId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e]['CampaignId']||undefined})[_0x43ce('0xa7')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3da741[_0x43ce('0xa2')][_0x2fc66e];});}else{loggerBooked[_0x43ce('0x78')](_0x43ce('0x1e9'),JSON[_0x43ce('0x46')](_0x5c59f0[_0x43ce('0x12b')]),_0x43ce('0x1e8'),_0x5c59f0[_0x43ce('0x3b')]);_0x3da741[_0x43ce('0xa9')](_0x5c59f0);_0x3da741[_0x43ce('0xb8')]({'active':![],'ContactId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e][_0x43ce('0xca')],'ListId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e]['ListId'],'VoiceQueueId':_0x3da741['actions'][_0x2fc66e][_0x43ce('0xcd')]||undefined,'CampaignId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e]['CampaignId']||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1ea')));delete _0x3da741[_0x43ce('0xa2')][_0x2fc66e];}}else{return _0x3da741[_0x43ce('0x167')](_0x5c59f0,_0x3bfd8e);}}else{if(getDiff(_0x3bfd8e['scheduledat'])<_0x5c59f0['dialRecallMeTimeout']*0x3c){if(_0x3bfd8e[_0x43ce('0x1eb')]&&!_0x3bfd8e[_0x43ce('0x1eb')]['voicePause']){_0x3da741['preview'][_0x43ce('0x12f')](_0x3bfd8e['id'])['finally'](function(){_0x3da741[_0x43ce('0xa9')](_0x5c59f0);});}else{_0x3da741['unlockContact']({'active':![]},_0x3bfd8e['id'],0x1)[_0x43ce('0x1d')](function(){_0x3da741['updateOriginated'](_0x5c59f0);});}}else{_0x5c59f0[_0x43ce('0x64')]+=0x1;_0x3da741[_0x43ce('0xa9')](_0x5c59f0);if(_0x5c59f0[_0x43ce('0x1ec')]){_0x3da741['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3bfd8e[_0x43ce('0xca')],'ListId':_0x3bfd8e[_0x43ce('0xcb')],'VoiceQueueId':_0x3bfd8e[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3bfd8e[_0x43ce('0xce')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3da741['createHistory'](createObjHistory(_0x5c59f0,_0x3bfd8e,_0x43ce('0x1ed'),0x17,'RecallInQueue'))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1ee')));}else{_0x3da741[_0x43ce('0xfc')](createObjHistory(_0x5c59f0,_0x3bfd8e,_0x43ce('0x1ef'),0x16,_0x43ce('0x1f0')),_0x43ce('0x1f1'),'[Originate][HistoryRecallClose]');}}}}else{_0x5c59f0[_0x43ce('0x1f2')]+=0x1;_0x3da741[_0x43ce('0xfc')](createObjHistory(_0x5c59f0,_0x3bfd8e,'BLACKLIST',0xd,_0x43ce('0x1f3')),'[Originate][historyBlacklist]',_0x43ce('0x1f4'));throw _0x43ce('0x1f5');}};};Dialer[_0x43ce('0x1a')][_0x43ce('0x15c')]=function(_0x44b9a5){var _0x562589=this;var _0x4e52fc=_0x44b9a5[_0x43ce('0x1f6')]-_0x44b9a5['originated']-_0x44b9a5[_0x43ce('0xbc')];emitCampaignSummary(_0x44b9a5);if(_0x4e52fc>0x0){if(_0x4e52fc>this[_0x43ce('0x24')]){_0x4e52fc=this['maxNumberOriginate'];}_0x44b9a5[_0x43ce('0xbc')]+=_0x4e52fc;this['getContactDialerIvr'](_0x44b9a5['id'],_0x4e52fc,_0x44b9a5[_0x43ce('0x1f7')],_0x44b9a5)['then'](function(_0x48d7cd){_0x44b9a5[_0x43ce('0xbc')]-=_0x4e52fc;_0x44b9a5[_0x43ce('0xbc')]=_0x44b9a5['temp']>0x0?_0x44b9a5['temp']:0x0;if(!checkContactEmpty(_0x48d7cd)){_0x44b9a5[_0x43ce('0x39')]=_0x43ce('0x98');logger['info'](_0x43ce('0x1f8')+_0x44b9a5[_0x43ce('0x3b')]);}else{_0x44b9a5['originated']+=_0x48d7cd[_0x43ce('0x91')];_0x44b9a5[_0x43ce('0x39')]=_0x43ce('0x1f9');for(var _0x1ee712=0x0;_0x1ee712<_0x48d7cd[_0x43ce('0x91')];_0x1ee712+=0x1){_0x44b9a5[_0x43ce('0x1fa')]+=0x1;if(_[_0x43ce('0xa4')](_0x48d7cd[_0x1ee712])||_[_0x43ce('0xa4')](_0x48d7cd[_0x1ee712][_0x43ce('0x16b')])||_[_0x43ce('0xa4')](_0x48d7cd[_0x1ee712][_0x43ce('0x16b')]['phone'])){_0x562589[_0x43ce('0xc6')](_0x43ce('0x1fb'),_0x44b9a5,_0x48d7cd[_0x1ee712]);}else{_0x562589['checkIsBlackListIvr'](_['pick'](_0x48d7cd[_0x1ee712],[_0x43ce('0xce'),_0x43ce('0x1fc')]))[_0x43ce('0xb0')](_0x562589[_0x43ce('0x1e3')](_0x44b9a5,_0x48d7cd[_0x1ee712]))[_0x43ce('0xa7')](_0x562589[_0x43ce('0xc5')](_0x43ce('0x1fd'),_0x44b9a5));}}}})[_0x43ce('0xa7')](loggerGetContactDialer(_0x43ce('0x1fe'),_0x44b9a5,_0x4e52fc));}};Dialer['prototype'][_0x43ce('0x156')]=function(_0x413fbb,_0x447f8e){var _0x176150=this;var _0x309d45=[];var _0x4e087a=_0x447f8e>=0x1?_0x447f8e:0x1;if(_0x413fbb['dialMethod']==='booked'){_0x4e087a=0x1;}var _0x23b21f=Math[_0x43ce('0x1c4')](_0x413fbb['available']*_0x4e087a)-_0x413fbb[_0x43ce('0x92')]-_0x413fbb['temp'];emitVoiceQueueSummary(_0x413fbb);if(_0x413fbb[_0x43ce('0x1ff')]>0x0){var _0x58e167=_0x413fbb[_0x43ce('0x1ff')]-_0x413fbb[_0x43ce('0x92')]-_0x413fbb[_0x43ce('0x52')]-_0x413fbb[_0x43ce('0xbc')]-_0x413fbb['pTalking'];if(_0x23b21f>_0x58e167){_0x23b21f=_0x58e167;}}if(_0x23b21f>0x0){if(_0x413fbb[_0x43ce('0x58')]===_0x43ce('0x1e5')){_0x23b21f=0x1;}if(_0x23b21f>this['maxNumberOriginate']){_0x23b21f=this['maxNumberOriginate'];}_0x413fbb[_0x43ce('0xbc')]+=_0x23b21f;for(var _0x4be0f0 in this[_0x43ce('0x22')]){if(typeof this[_0x43ce('0x22')][_0x4be0f0]!==_0x43ce('0x93')){if(this[_0x43ce('0x22')][_0x4be0f0][_0x43ce('0xde')]===_0x43ce('0x200')&&this[_0x43ce('0x22')][_0x4be0f0]['status']===_0x43ce('0xd6')){_0x309d45[_0x43ce('0x129')](this[_0x43ce('0x22')][_0x4be0f0]['id']);}}}this[_0x43ce('0xbb')](_0x413fbb['id'],_0x309d45,_0x23b21f,_0x413fbb['dialOrderByScheduledAt'],_0x413fbb)[_0x43ce('0xb0')](function(_0x505fbb){_0x413fbb[_0x43ce('0xbc')]-=_0x23b21f;_0x413fbb['temp']=_0x413fbb['temp']>0x0?_0x413fbb[_0x43ce('0xbc')]:0x0;if(!checkContactEmpty(_0x505fbb)){_0x176150['countReScheduled'](_0x413fbb)[_0x43ce('0xb0')](sendMessageReschedule(_0x413fbb))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xaf')));}else{_0x413fbb['originated']+=_0x505fbb[_0x43ce('0x91')];_0x413fbb[_0x43ce('0x39')]=_0x413fbb[_0x43ce('0x58')]===_0x43ce('0x1e5')?'ACTIVE':'RUNNING';for(var _0x2970e7=0x0;_0x2970e7<_0x505fbb[_0x43ce('0x91')];_0x2970e7+=0x1){if(_[_0x43ce('0xa4')](_0x505fbb[_0x2970e7])||_[_0x43ce('0xa4')](_0x505fbb[_0x2970e7][_0x43ce('0x16b')])||_['isNil'](_0x505fbb[_0x2970e7][_0x43ce('0x16b')][_0x43ce('0x16c')])){_0x176150['emptyContact'](_0x43ce('0x1fb'),_0x413fbb,_0x505fbb[_0x2970e7]);}else{_0x176150[_0x43ce('0xb1')](_['pick'](_0x505fbb[_0x2970e7],[_0x43ce('0xcd'),_0x43ce('0x1fc')]))[_0x43ce('0xb0')](_0x176150[_0x43ce('0x1e3')](_0x413fbb,_0x505fbb[_0x2970e7]))['catch'](_0x176150['loggerHandler'](_0x43ce('0x1fb'),_0x413fbb));}}}})[_0x43ce('0xa7')](loggerGetContactDialer(_0x43ce('0x201'),_0x413fbb,_0x23b21f));}};Dialer['prototype'][_0x43ce('0x89')]=function(_0x187b25){if(_0x187b25['dialLimitQueue']>0x0){var _0x3fe95e=_0x187b25[_0x43ce('0x1ff')]-_0x187b25['originated']-_0x187b25[_0x43ce('0x52')];if(_0x3fe95e>0x0){this[_0x43ce('0x202')](_0x187b25);}else{loggerPredictiveCalls[_0x43ce('0x78')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x187b25);}};Dialer[_0x43ce('0x1a')][_0x43ce('0x202')]=function(_0x14cda8){var _0x3810dc=this;var _0x473644=[];_0x14cda8['originated']+=0x1;for(var _0x1dbc73 in this[_0x43ce('0x22')]){if(typeof this[_0x43ce('0x22')][_0x1dbc73]!==_0x43ce('0x93')){if(this['agents'][_0x1dbc73]['state']===_0x43ce('0x200')&&this['agents'][_0x1dbc73][_0x43ce('0xa5')]===_0x43ce('0xd6')){_0x473644['push'](this[_0x43ce('0x22')][_0x1dbc73]['id']);}}}this[_0x43ce('0xbb')](_0x14cda8['id'],_0x473644,0x1,_0x14cda8[_0x43ce('0x1f7')],_0x14cda8)[_0x43ce('0xb0')](function(_0x499070){if(!checkContactEmpty(_0x499070)){checkContactLowerLimitOriginate(_0x14cda8,0x1,0x0);_0x3810dc['countReScheduled'](_0x14cda8)[_0x43ce('0xb0')](sendMessageReschedule(_0x14cda8))['catch'](loggerCatch(_0x43ce('0xaf')));}else{_0x14cda8['message']='RUNNING';if(_[_0x43ce('0xa4')](_0x499070[0x0])||_[_0x43ce('0xa4')](_0x499070[0x0]['Contact'])||_[_0x43ce('0xa4')](_0x499070[0x0][_0x43ce('0x16b')][_0x43ce('0x16c')])){_0x3810dc[_0x43ce('0xc6')]('[actionOriginate]\x20',_0x14cda8,_0x499070[0x0]);}else{_0x3810dc[_0x43ce('0xb1')](_[_0x43ce('0xc9')](_0x499070[0x0],[_0x43ce('0xcd'),'Contact.phone']))['then'](_0x3810dc[_0x43ce('0x1e3')](_0x14cda8,_0x499070[0x0]))[_0x43ce('0xa7')](_0x3810dc['loggerHandler'](_0x43ce('0x203'),_0x14cda8));}}})[_0x43ce('0xa7')](loggerGetContactDialer(_0x43ce('0x204'),_0x14cda8,0x1));emitVoiceQueueSummary(_0x14cda8);};Dialer[_0x43ce('0x1a')][_0x43ce('0x1d6')]=function(_0x5edefd,_0x2f9e83,_0x168e43,_0x3957f4,_0x424c4b,_0x127a6e){loggerPredictive[_0x43ce('0x78')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5edefd);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x205'),_0x2f9e83);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x206'),_0x168e43);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x207'),_0x3957f4);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x208'),_0x424c4b);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x3fad9b,_0x275fdd){if(_0x5edefd<=0x0||isNaN(_0x5edefd)){return _0x275fdd(msgResponse(_0x43ce('0x209'),_0x43ce('0x45'),_0x43ce('0x20a')+_0x5edefd));}if(_0x168e43<=0x0||isNaN(_0x168e43)){return _0x275fdd(msgResponse(_0x43ce('0x209'),_0x43ce('0x45'),_0x43ce('0x20b')+_0x168e43));}if(_0x3957f4<=0x0||isNaN(_0x3957f4)){return _0x275fdd(msgResponse(_0x43ce('0x209'),'Error',_0x43ce('0x20c')+_0x3957f4));}if(_0x2f9e83<=0x0||isNaN(_0x2f9e83)){return _0x275fdd(msgResponse(_0x43ce('0x209'),'Error',_0x43ce('0x20d')+_0x2f9e83));}if(_0x424c4b<=0x0||isNaN(_0x424c4b)){return _0x275fdd(msgResponse(_0x43ce('0x209'),_0x43ce('0x45'),_0x43ce('0x20e')+_0x424c4b));}_0x127a6e=_0x127a6e||0x0;var _0x4ab373=0x1/_0x168e43;var _0x4d84a2=0x0;var _0x121b5b=0x0;var _0x17c876=0x0;var _0x127580=0x0;for(var _0x4d4667=0x0;_0x17c876<_0x424c4b;_0x4d4667+=0x1){_0x121b5b=_0x4d4667/_0x2f9e83;_0x4d84a2=(_0x3957f4*_0x121b5b+_0x127a6e)/_0x4ab373;_0x17c876=erlangb(_0x4d84a2,_0x5edefd);_0x127580=_0x4d84a2/_0x5edefd*(0x1-erlangb(_0x4d84a2,_0x5edefd));}return _0x3fad9b({'erlangCalls':_0x4d4667,'erlangCallToSecond':_0x2f9e83/_0x4d4667,'erlangAbandonmentRate':_0x17c876,'erlangBusyFactor':_0x127580});});};Dialer[_0x43ce('0x1a')]['busyFactor']=function(_0xae6ff7,_0x3eead3,_0x4c4a40,_0x2bbfdd,_0x524d9d,_0x2460e4){loggerPredictive[_0x43ce('0x78')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x43ce('0x78')](_0x43ce('0x20f'),_0xae6ff7);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3eead3);loggerPredictive['info'](_0x43ce('0x206'),_0x4c4a40);loggerPredictive['info'](_0x43ce('0x207'),_0x2bbfdd);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x210'),_0x524d9d);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7e'));return new BPromise(function(_0x1e85f4,_0x3381bb){if(_0xae6ff7<=0x0||isNaN(_0xae6ff7)){return _0x3381bb(msgResponse(_0x43ce('0x211'),'Error','m\x20=\x20'+_0xae6ff7));}if(_0x4c4a40<=0x0||isNaN(_0x4c4a40)){return _0x3381bb(msgResponse('[busyFactor]',_0x43ce('0x45'),_0x43ce('0x20b')+_0x4c4a40));}if(_0x2bbfdd<=0x0||isNaN(_0x2bbfdd)){return _0x3381bb(msgResponse(_0x43ce('0x211'),_0x43ce('0x45'),_0x43ce('0x20c')+_0x2bbfdd));}if(_0x3eead3<=0x0||isNaN(_0x3eead3)){return _0x3381bb(msgResponse(_0x43ce('0x211'),_0x43ce('0x45'),_0x43ce('0x20d')+_0x3eead3));}if(_0x524d9d<=0x0||isNaN(_0x524d9d)){return _0x3381bb(msgResponse(_0x43ce('0x211'),'Error','Umin\x20=\x20'+_0x524d9d));}_0x2460e4=_0x2460e4||0x0;var _0xc3346b=0x1/_0x4c4a40;var _0x1c7ef6=0x0;var _0x3968b3=0x0;var _0x2826db=0x0;var _0x531eb5=0x0;for(var _0x44f93e=0x0;_0x531eb5<_0x524d9d;_0x44f93e+=0x1){_0x3968b3=_0x44f93e/_0x3eead3;_0x1c7ef6=(_0x2bbfdd*_0x3968b3+_0x2460e4)/_0xc3346b;_0x2826db=erlangb(_0x1c7ef6,_0xae6ff7);_0x531eb5=_0x1c7ef6/_0xae6ff7*(0x1-erlangb(_0x1c7ef6,_0xae6ff7));}return _0x1e85f4({'erlangCalls':_0x44f93e,'erlangCallToSecond':_0x3eead3/_0x44f93e,'erlangAbandonmentRate':_0x2826db,'erlangBusyFactor':_0x531eb5});});};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 fb1cd94..538231a 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 _0x071a=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','holdtime','connectedlinename','reason','callback','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridname','exports','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countglobal','countcongestionretry','countnoanswerretry'];(function(_0x5881fe,_0x2b60ff){var _0x3404db=function(_0x31e722){while(--_0x31e722){_0x5881fe['push'](_0x5881fe['shift']());}};_0x3404db(++_0x2b60ff);}(_0x071a,0x1af));var _0xa071=function(_0x2aeb4b,_0x29d79d){_0x2aeb4b=_0x2aeb4b-0x0;var _0x16138d=_0x071a[_0x2aeb4b];return _0x16138d;};'use strict';var util=require('util');var _=require(_0xa071('0x0'));var moment=require(_0xa071('0x1'));function getSeconds(_0x197757,_0xb2712d){var _0x4420c0=moment(_0x197757)['milliseconds'](0x0);var _0x1f0c29=moment(_0xb2712d)[_0xa071('0x2')](0x0);return _0x4420c0[_0xa071('0x3')](_0x1f0c29,'seconds');}function QueueCallerAbandon(_0x1ad22a,_0x277e53){this[_0xa071('0x4')]=_0x1ad22a['scheduledat'];this[_0xa071('0x5')]=_0x1ad22a[_0xa071('0x5')];this[_0xa071('0x6')]=_0x1ad22a['type']===_0xa071('0x7')?_0xa071('0x8'):_0x1ad22a[_0xa071('0x5')];this['countbusyretry']=_0x1ad22a[_0xa071('0x9')];this['countcongestionretry']=_0x1ad22a['countcongestionretry'];this['countnoanswerretry']=_0x1ad22a['countnoanswerretry'];this[_0xa071('0xa')]=_0x1ad22a[_0xa071('0x9')]+_0x1ad22a[_0xa071('0xb')]+_0x1ad22a[_0xa071('0xc')]+_0x1ad22a[_0xa071('0xd')]+_0x1ad22a[_0xa071('0xe')]+_0x1ad22a[_0xa071('0xf')]+_0x1ad22a[_0xa071('0x10')]+_0x1ad22a[_0xa071('0x11')];this[_0xa071('0xd')]=_0x1ad22a[_0xa071('0xd')];this[_0xa071('0xe')]=_0x1ad22a[_0xa071('0xe')];this['countabandonedretry']=_0x1ad22a[_0xa071('0xf')];this[_0xa071('0x10')]=_0x1ad22a[_0xa071('0x10')];this[_0xa071('0x11')]=_0x1ad22a[_0xa071('0x11')];this['uniqueid']=_0x277e53[_0xa071('0x12')];this[_0xa071('0x13')]=_0x1ad22a[_0xa071('0x14')];this[_0xa071('0x15')]=_0x1ad22a['number'];this[_0xa071('0x16')]=_0x1ad22a['starttime'];this['responsetime']=_0x1ad22a[_0xa071('0x17')];this[_0xa071('0x18')]=_0x1ad22a['droptime'];this[_0xa071('0x19')]=this[_0xa071('0x18')];this['ringtime']=getSeconds(_0x1ad22a[_0xa071('0x17')],_0x1ad22a[_0xa071('0x16')]);this[_0xa071('0x1a')]=getSeconds(this[_0xa071('0x18')],_0x1ad22a[_0xa071('0x17')]);this['talktime']=0x0;this[_0xa071('0x8')]=_0x277e53['queue'];this['membername']=_0x277e53[_0xa071('0x1b')];this[_0xa071('0x1c')]=_0x277e53[_0xa071('0x1c')];this['callback']=_0x1ad22a[_0xa071('0x1d')];this['callbackuniqueid']=_0x1ad22a['callbackuniqueid'];this['callbackat']=_0x1ad22a['callbackat'];this['recallme']=_0x1ad22a[_0xa071('0x1e')];this[_0xa071('0x1f')]=_0x1ad22a[_0xa071('0x1f')];this[_0xa071('0x20')]=_0x1ad22a[_0xa071('0x20')];this[_0xa071('0x21')]=_0x1ad22a[_0xa071('0x21')];this['VoiceQueueId']=_0x1ad22a['VoiceQueueId'];this[_0xa071('0x22')]=_0x1ad22a[_0xa071('0x22')];this['originatecalleridnum']=_0x1ad22a['originatecalleridnum']||'';this[_0xa071('0x23')]=_0x1ad22a[_0xa071('0x23')]||'';}module[_0xa071('0x24')]=QueueCallerAbandon; \ No newline at end of file +var _0xe137=['name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','queue','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname'];(function(_0x1419c9,_0x1a2bcf){var _0x45d558=function(_0x560a15){while(--_0x560a15){_0x1419c9['push'](_0x1419c9['shift']());}};_0x45d558(++_0x1a2bcf);}(_0xe137,0x176));var _0x7e13=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0xe137[_0x35d8af];return _0x1d08b0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x7e13('0x0'));function getSeconds(_0x3dcb6b,_0xf2fda0){var _0x46cf5d=moment(_0x3dcb6b)[_0x7e13('0x1')](0x0);var _0x5b9504=moment(_0xf2fda0)['milliseconds'](0x0);return _0x46cf5d[_0x7e13('0x2')](_0x5b9504,'seconds');}function QueueCallerAbandon(_0x3fd0e5,_0x54f6e7){this[_0x7e13('0x3')]=_0x3fd0e5['scheduledat'];this[_0x7e13('0x4')]=_0x3fd0e5[_0x7e13('0x4')];this['campaigntype']=_0x3fd0e5['type']==='outbound'?'queue':_0x3fd0e5[_0x7e13('0x4')];this['countbusyretry']=_0x3fd0e5[_0x7e13('0x5')];this[_0x7e13('0x6')]=_0x3fd0e5[_0x7e13('0x6')];this[_0x7e13('0x7')]=_0x3fd0e5[_0x7e13('0x7')];this[_0x7e13('0x8')]=_0x3fd0e5[_0x7e13('0x5')]+_0x3fd0e5['countcongestionretry']+_0x3fd0e5[_0x7e13('0x7')]+_0x3fd0e5[_0x7e13('0x9')]+_0x3fd0e5['countdropretry']+_0x3fd0e5['countabandonedretry']+_0x3fd0e5[_0x7e13('0xa')]+_0x3fd0e5[_0x7e13('0xb')];this[_0x7e13('0x9')]=_0x3fd0e5[_0x7e13('0x9')];this[_0x7e13('0xc')]=_0x3fd0e5['countdropretry'];this[_0x7e13('0xd')]=_0x3fd0e5[_0x7e13('0xd')];this['countmachineretry']=_0x3fd0e5['countmachineretry'];this[_0x7e13('0xb')]=_0x3fd0e5[_0x7e13('0xb')];this[_0x7e13('0xe')]=_0x54f6e7[_0x7e13('0xe')];this[_0x7e13('0xf')]=_0x3fd0e5[_0x7e13('0x10')];this[_0x7e13('0x11')]=_0x3fd0e5[_0x7e13('0x12')];this[_0x7e13('0x13')]=_0x3fd0e5[_0x7e13('0x13')];this[_0x7e13('0x14')]=_0x3fd0e5[_0x7e13('0x14')];this[_0x7e13('0x15')]=_0x3fd0e5[_0x7e13('0x15')];this[_0x7e13('0x16')]=this['droptime'];this[_0x7e13('0x17')]=getSeconds(_0x3fd0e5[_0x7e13('0x14')],_0x3fd0e5['starttime']);this['holdtime']=getSeconds(this[_0x7e13('0x15')],_0x3fd0e5[_0x7e13('0x14')]);this['talktime']=0x0;this[_0x7e13('0x18')]=_0x54f6e7[_0x7e13('0x18')];this[_0x7e13('0x19')]=_0x54f6e7[_0x7e13('0x1a')];this[_0x7e13('0x1b')]=_0x54f6e7[_0x7e13('0x1b')];this['callback']=_0x3fd0e5['callback'];this[_0x7e13('0x1c')]=_0x3fd0e5['callbackuniqueid'];this[_0x7e13('0x1d')]=_0x3fd0e5[_0x7e13('0x1d')];this[_0x7e13('0x1e')]=_0x3fd0e5[_0x7e13('0x1e')];this[_0x7e13('0x1f')]=_0x3fd0e5['ContactId'];this[_0x7e13('0x20')]=_0x3fd0e5['ListId'];this[_0x7e13('0x21')]=_0x3fd0e5[_0x7e13('0x21')];this[_0x7e13('0x22')]=_0x3fd0e5['VoiceQueueId'];this[_0x7e13('0x23')]=_0x3fd0e5[_0x7e13('0x23')];this['originatecalleridnum']=_0x3fd0e5[_0x7e13('0x24')]||'';this[_0x7e13('0x25')]=_0x3fd0e5[_0x7e13('0x25')]||'';}module[_0x7e13('0x26')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 14dd538..1d01f08 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(_0x1336ae,_0x2b9434){var _0x5b34da=function(_0x304c97){while(--_0x304c97){_0x1336ae['push'](_0x1336ae['shift']());}};_0x5b34da(++_0x2b9434);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x520ddf,_0x17b1d3){var _0x1e3103=function(_0x2dd284){while(--_0x2dd284){_0x520ddf['push'](_0x520ddf['shift']());}};_0x1e3103(++_0x17b1d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 2ea1cab..b295fe2 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 _0xda28=['Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','newstate','syncNewState','bind','newexten','receivefax','syncHangup','syncOriginateResponse','prototype','syncNewchannel','hasOwnProperty','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','value','channelstate','channelstatedesc','variable','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','application/pdf','then','.pdf','catch','error','\x20notify\x20','stringify','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','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','path','%s/%s.tif','dir'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0xda28,0x156));var _0x8da2=function(_0x4ed1b6,_0x34aa8e){_0x4ed1b6=_0x4ed1b6-0x0;var _0x3ddc88=_0xda28[_0x4ed1b6];return _0x3ddc88;};'use strict';var util=require(_0x8da2('0x0'));var _=require(_0x8da2('0x1'));var BPromise=require(_0x8da2('0x2'));var uuid=require(_0x8da2('0x3'));var moment=require(_0x8da2('0x4'));var path=require('path');var tiff2pdf=require(_0x8da2('0x5'));var gs=require(_0x8da2('0x6'));var logger=require(_0x8da2('0x7'))(_0x8da2('0x8'));var ami=require(_0x8da2('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x8da2('0xa'));var ut=require(_0x8da2('0xb'));var Action=require(_0x8da2('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x8da2('0xd'));function Fax(_0x3b45d7){this['channels']={};this[_0x8da2('0xe')]=_0x3b45d7['faxAccounts'];this[_0x8da2('0xf')]=_0x3b45d7['trunks'];this[_0x8da2('0x10')]={};ami['on'](_0x8da2('0x11'),this['syncNewchannel']['bind'](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x8da2('0x12'),this[_0x8da2('0x13')][_0x8da2('0x14')](this));ami['on'](_0x8da2('0x15'),this['syncNewExten'][_0x8da2('0x14')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x8da2('0x14')](this));ami['on'](_0x8da2('0x16'),this['syncReceiveFax'][_0x8da2('0x14')](this));ami['on']('hangup',this[_0x8da2('0x17')]['bind'](this));ami['on']('originateresponse',this[_0x8da2('0x18')]['bind'](this));}Fax[_0x8da2('0x19')][_0x8da2('0x1a')]=function(_0xc1194b){if(_0xc1194b['context']==='from-voip-provider'){for(var _0x44b3e7 in this['faxAccounts']){if(this[_0x8da2('0xe')][_0x8da2('0x1b')](_0x44b3e7)){if(_0xc1194b['exten']===this[_0x8da2('0xe')][_0x44b3e7][_0x8da2('0x1c')]){this[_0x8da2('0x1d')][_0xc1194b[_0x8da2('0x1e')]]={};this['channels'][_0xc1194b[_0x8da2('0x1e')]][_0x8da2('0x1f')]=_0xc1194b['channel'];this[_0x8da2('0x1d')][_0xc1194b[_0x8da2('0x1e')]]['id']=this[_0x8da2('0xe')][_0x44b3e7]['id'];this[_0x8da2('0x1d')][_0xc1194b['uniqueid']][_0x8da2('0x20')]=this['faxAccounts'][_0x44b3e7][_0x8da2('0x20')];logger['info'](_0xc1194b['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x8da2('0x10')][_0xc1194b[_0x8da2('0x1e')]]){this[_0x8da2('0x1d')][_0xc1194b['uniqueid']]={};this[_0x8da2('0x1d')][_0xc1194b[_0x8da2('0x1e')]][_0x8da2('0x1f')]=_0xc1194b[_0x8da2('0x1f')];logger[_0x8da2('0x21')](_0xc1194b[_0x8da2('0x1e')],_0x8da2('0x22'));}};Fax['prototype'][_0x8da2('0x23')]=function(_0x57edc3){if(this['channels'][_0x57edc3[_0x8da2('0x1e')]]){for(var _0x5ebb90 in _0x57edc3['variable']){if(_0x57edc3['variable'][_0x8da2('0x1b')](_0x5ebb90)){this[_0x8da2('0x1d')][_0x57edc3[_0x8da2('0x1e')]][_0x5ebb90]=_0x57edc3[_0x8da2('0x24')];}}}};Fax[_0x8da2('0x19')]['syncNewState']=function(_0x41e771){if(this[_0x8da2('0x1d')][_0x41e771['uniqueid']]){this[_0x8da2('0x1d')][_0x41e771[_0x8da2('0x1e')]][_0x8da2('0x25')]=_0x41e771[_0x8da2('0x25')];this[_0x8da2('0x1d')][_0x41e771[_0x8da2('0x1e')]][_0x8da2('0x26')]=_0x41e771[_0x8da2('0x26')];}};Fax[_0x8da2('0x19')]['syncNewExten']=function(_0x34a9d5){if(this[_0x8da2('0x1d')][_0x34a9d5['uniqueid']]){for(var _0x306631 in _0x34a9d5['variable']){if(_0x34a9d5[_0x8da2('0x27')][_0x8da2('0x1b')](_0x306631)){this[_0x8da2('0x1d')][_0x34a9d5[_0x8da2('0x1e')]][_0x306631]=_0x34a9d5[_0x8da2('0x24')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x221205){if(this[_0x8da2('0x1d')][_0x221205[_0x8da2('0x1e')]]){this[_0x8da2('0x1d')][_0x221205[_0x8da2('0x1e')]][_0x8da2('0x28')]=_0x221205[_0x8da2('0x28')];this['channels'][_0x221205[_0x8da2('0x1e')]]['status']=_0x221205[_0x8da2('0x29')];this[_0x8da2('0x1d')][_0x221205[_0x8da2('0x1e')]][_0x8da2('0x1c')]=_0x221205['localstationid'];this[_0x8da2('0x1d')][_0x221205['uniqueid']][_0x8da2('0x2a')]=_0x221205[_0x8da2('0x2a')];logger[_0x8da2('0x21')](_0x221205['uniqueid'],_0x8da2('0x2b'));}};Fax['prototype'][_0x8da2('0x2c')]=function(_0x211d0a){var _0xf2e7bc=this;if(this[_0x8da2('0x1d')][_0x211d0a[_0x8da2('0x1e')]]){var _0x1890ee=this['channels'][_0x211d0a['uniqueid']]['id'];this[_0x8da2('0x1d')][_0x211d0a[_0x8da2('0x1e')]][_0x8da2('0x2d')]=_0x211d0a[_0x8da2('0x2d')];this[_0x8da2('0x1d')][_0x211d0a['uniqueid']][_0x8da2('0x2e')]=_0x211d0a[_0x8da2('0x2e')];this['channels'][_0x211d0a[_0x8da2('0x1e')]][_0x8da2('0x1c')]=_0x211d0a['localstationid'];this[_0x8da2('0x1d')][_0x211d0a[_0x8da2('0x1e')]][_0x8da2('0x2f')]=_0x211d0a[_0x8da2('0x2f')];this[_0x8da2('0x1d')][_0x211d0a[_0x8da2('0x1e')]][_0x8da2('0x30')]=_0x211d0a[_0x8da2('0x30')];this['channels'][_0x211d0a[_0x8da2('0x1e')]]['filename']=_0x211d0a[_0x8da2('0x2a')];this[_0x8da2('0x1d')][_0x211d0a[_0x8da2('0x1e')]]['calleridnum']=_0x211d0a[_0x8da2('0x31')];if(this[_0x8da2('0x1d')][_0x211d0a[_0x8da2('0x1e')]][_0x8da2('0x2e')]>0x0){tiff2pdf(_0x211d0a[_0x8da2('0x2a')],_0x8da2('0x32'),function(_0x279a1a){logger['info'](_0x211d0a[_0x8da2('0x1e')],'\x20result\x20conversion\x20file\x20',_0x279a1a[_0x8da2('0x33')]);attachment[_0x8da2('0x34')]({'name':path[_0x8da2('0x35')](_0x211d0a['filename'])[_0x8da2('0x20')],'basename':path['parse'](_0x211d0a[_0x8da2('0x2a')])['name']+'.pdf','type':_0x8da2('0x36')})[_0x8da2('0x37')](function(_0x1590f7){faxAccount['notify'](_0x1890ee,{'from':_0x211d0a[_0x8da2('0x31')],'mapKey':_0x8da2('0x8'),'body':path[_0x8da2('0x35')](_0x211d0a[_0x8da2('0x2a')])[_0x8da2('0x20')]+_0x8da2('0x38'),'AttachmentId':_0x1590f7['id']})[_0x8da2('0x39')](function(_0x5e94a1){logger[_0x8da2('0x3a')](_0x211d0a[_0x8da2('0x1e')],_0x8da2('0x3b'),JSON['stringify'](_0x5e94a1));});})['catch'](function(_0xbe1fb5){logger[_0x8da2('0x3a')](_0x211d0a[_0x8da2('0x1e')],'\x20receiveFax\x20',JSON[_0x8da2('0x3c')](_0xbe1fb5));});});}logger[_0x8da2('0x21')](_0x211d0a[_0x8da2('0x1e')],'\x20receiveFax\x20');}};Fax['prototype'][_0x8da2('0x18')]=function(_0x5c4590){if(this['actions'][_0x5c4590[_0x8da2('0x1e')]]){_[_0x8da2('0x3d')](this['channels'][_0x5c4590[_0x8da2('0x1e')]],_['pick'](_0x5c4590,[_0x8da2('0x3e'),_0x8da2('0x3f')]));}};function updateStatus(_0x393132){if(_0x393132[_0x8da2('0x40')]){faxMessage[_0x8da2('0x41')](_0x393132[_0x8da2('0x40')],{'failMessage':_0x8da2('0x42')})[_0x8da2('0x37')](function(_0x253cee){ut[_0x8da2('0x43')]('[Fax][Message][Error][Updated]',_0x253cee);})[_0x8da2('0x39')](function(_0x3cf9c7){ut[_0x8da2('0x43')](_0x8da2('0x44'),_0x3cf9c7);});}else{ut[_0x8da2('0x43')](_0x8da2('0x45'));}}Fax[_0x8da2('0x19')][_0x8da2('0x46')]=function(_0x4e0703,_0x584362,_0x2b7bf0){var _0x44344a=this;var _0x39201c={};if(_0x584362){_0x39201c={'read':_0x584362};}else{_0x39201c={'failMessage':_0x2b7bf0};}if(this['actions'][_0x4e0703][_0x8da2('0x40')]){faxMessage[_0x8da2('0x41')](this[_0x8da2('0x10')][_0x4e0703][_0x8da2('0x40')],_0x39201c)[_0x8da2('0x37')](function(_0x2fb4e0){ut['logger']('[Fax][Message][Updated]',_0x2fb4e0);})[_0x8da2('0x39')](function(_0x5ac0db){ut['logger'](_0x8da2('0x47'),_0x5ac0db);})[_0x8da2('0x48')](function(){delete _0x44344a[_0x8da2('0x1d')][_0x4e0703];delete _0x44344a[_0x8da2('0x10')][_0x4e0703];});}else{ut[_0x8da2('0x43')](_0x8da2('0x49'));delete this[_0x8da2('0x1d')][_0x4e0703];delete this[_0x8da2('0x10')][_0x4e0703];}};Fax[_0x8da2('0x19')][_0x8da2('0x17')]=function(_0x310f53){var _0x31ae32=this;if(this['channels'][_0x310f53[_0x8da2('0x1e')]]){if(this[_0x8da2('0x10')][_0x310f53['uniqueid']]){this[_0x8da2('0x1d')][_0x310f53[_0x8da2('0x1e')]]['id']=this['actions'][_0x310f53['uniqueid']]['id'];this[_0x8da2('0x1d')][_0x310f53[_0x8da2('0x1e')]][_0x8da2('0x20')]=this[_0x8da2('0x10')][_0x310f53['uniqueid']][_0x8da2('0x20')];}logger[_0x8da2('0x21')](_0x310f53[_0x8da2('0x1e')],this[_0x8da2('0x10')][_0x310f53[_0x8da2('0x1e')]]?'\x20hangup\x20sendFile\x20':_0x8da2('0x4a'),JSON['stringify'](this['channels'][_0x310f53['uniqueid']]));if(this[_0x8da2('0x10')][_0x310f53[_0x8da2('0x1e')]]){if(this[_0x8da2('0x1d')][_0x310f53[_0x8da2('0x1e')]][_0x8da2('0x4b')]>0x0&&this['channels'][_0x310f53[_0x8da2('0x1e')]][_0x8da2('0x4c')]===_0x8da2('0x4d')){this[_0x8da2('0x46')](_0x310f53[_0x8da2('0x1e')],!![]);}else{this[_0x8da2('0x46')](_0x310f53[_0x8da2('0x1e')],![],this[_0x8da2('0x1d')][_0x310f53[_0x8da2('0x1e')]][_0x8da2('0x4e')]?'SENDING\x20FAILED:\x20'+this[_0x8da2('0x1d')][_0x310f53[_0x8da2('0x1e')]][_0x8da2('0x4e')]:_0x8da2('0x4f'));}}}};Fax[_0x8da2('0x19')][_0x8da2('0x50')]=function(_0x190fe0){var _0xfeddcb=this;return new BPromise(function(_0x497d75,_0x4db022){_0xfeddcb[_0x8da2('0x51')](_0x190fe0,_0xfeddcb[_0x8da2('0xe')][_0x190fe0[_0x8da2('0x52')]])[_0x8da2('0x37')](function(_0x50e7cd){ut[_0x8da2('0x43')](_0x8da2('0x53'),_0x50e7cd);_0x497d75(ut['message'](_0x8da2('0x54')));})[_0x8da2('0x39')](function(_0xa758c6){ut[_0x8da2('0x43')]('[Fax][execOriginate][failure]',_0xa758c6);updateStatus(_0x190fe0);_0x4db022(ut[_0x8da2('0x33')](_0x8da2('0x55')));});});};Fax[_0x8da2('0x19')][_0x8da2('0x56')]=function(_0xcbae88){var _0x3326bc=this;return new BPromise(function(_0x5e750f,_0x53c0db){var _0x292e78=_0x3326bc[_0x8da2('0x57')](_0x3326bc[_0x8da2('0xe')][_0xcbae88[_0x8da2('0x52')]][_0x8da2('0x58')],_0xcbae88);if(_0x292e78['isValid']){_0x5e750f(ut[_0x8da2('0x33')]('Trunk\x20Reachable'));}else{_0x53c0db(ut[_0x8da2('0x33')](_0x292e78['message']));}});};function originate(_0x7c77fd,_0x2d9ff0,_0x38acbc){return new BPromise(function(_0x19fb9a,_0x24f8ca){if(_0x38acbc){var _0x61a474=util[_0x8da2('0x59')](_0x8da2('0x5a'),path[_0x8da2('0x35')](_0x7c77fd['path'])[_0x8da2('0x20')],_0x7c77fd[_0x8da2('0x5b')]);gs['execute'](_0x61a474)['then'](function(){_0x7c77fd[_0x8da2('0x5b')]=util[_0x8da2('0x59')](_0x8da2('0x5c'),path[_0x8da2('0x35')](_0x7c77fd[_0x8da2('0x5b')])[_0x8da2('0x5d')],path[_0x8da2('0x35')](_0x7c77fd[_0x8da2('0x5b')])[_0x8da2('0x20')]);_0x2d9ff0['XMF-PATH']=_0x7c77fd[_0x8da2('0x5b')];ut[_0x8da2('0x43')](_0x8da2('0x5e'),'');ami[_0x8da2('0x5f')](ut['variablesAction'](_0x7c77fd,_0x2d9ff0))[_0x8da2('0x37')](function(_0x5cc8b9){_0x19fb9a(_0x5cc8b9);})[_0x8da2('0x39')](function(_0x4a54be){_0x24f8ca(_0x4a54be);});})[_0x8da2('0x39')](function(_0x3280ea){_0x24f8ca(_0x3280ea);});}else{ami[_0x8da2('0x5f')](ut[_0x8da2('0x60')](_0x7c77fd,_0x2d9ff0))[_0x8da2('0x37')](function(_0x3c14f4){_0x19fb9a(_0x3c14f4);})[_0x8da2('0x39')](function(_0x414805){_0x24f8ca(_0x414805);});}});}Fax[_0x8da2('0x19')][_0x8da2('0x51')]=function(_0x80caee,_0x29e58d){var _0x1c7473=this;return new BPromise(function(_0x529486,_0x5a4765){var _0x534d79=uuid['v4']();var _0x2632cd=ut[_0x8da2('0x61')](_0x80caee,_0x29e58d);_0x1c7473[_0x8da2('0x10')][_0x534d79]=new Action(_0x534d79,_0x29e58d,_0x80caee);var _0x158b44=_0x1c7473[_0x8da2('0x10')][_0x534d79];if(path['parse'](_0x80caee['path'])[_0x8da2('0x62')]===_0x8da2('0x38')){originate(_0x158b44,_0x2632cd,!![])[_0x8da2('0x37')](function(_0xbddf36){_0x529486(_0xbddf36);})[_0x8da2('0x39')](function(_0x48911){_0x5a4765(_0x48911);});}else{originate(_0x158b44,_0x2632cd,![])[_0x8da2('0x37')](function(_0x3edc3d){_0x529486(_0x3edc3d);})[_0x8da2('0x39')](function(_0x49ad6a){_0x5a4765(_0x49ad6a);});}});};Fax[_0x8da2('0x19')][_0x8da2('0x63')]=function(_0x116663){return!_[_0x8da2('0x64')](_0x116663)&&!_[_0x8da2('0x64')](_0x116663[_0x8da2('0x20')])&&!_[_0x8da2('0x64')](_0x116663[_0x8da2('0x65')])&&_0x116663[_0x8da2('0x65')]&&!_[_0x8da2('0x64')](this[_0x8da2('0xf')][util[_0x8da2('0x59')](_0x8da2('0x66'),_0x116663[_0x8da2('0x20')])])&&!_['isNil'](this[_0x8da2('0xf')][util[_0x8da2('0x59')]('SIP/%s',_0x116663[_0x8da2('0x20')])]['status'])&&(this['trunks'][util[_0x8da2('0x59')](_0x8da2('0x66'),_0x116663['name'])][_0x8da2('0x29')]===_0x8da2('0x67')||this[_0x8da2('0xf')][util[_0x8da2('0x59')](_0x8da2('0x66'),_0x116663[_0x8da2('0x20')])]['status']==='unmonitored');};Fax[_0x8da2('0x19')][_0x8da2('0x57')]=function(_0x84ce5,_0x182e2e){if(!this['isTrunkReachable'](_0x84ce5)){ut['logger'](_0x8da2('0x68'),_[_0x8da2('0x64')](_0x84ce5)?'':_0x84ce5[_0x8da2('0x20')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x8da2('0x64')](_0x182e2e[_0x8da2('0x8')])){ut[_0x8da2('0x43')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x8da2('0x3c')](_0x182e2e));return{'isValid':![],'message':_0x8da2('0x69')};}if(_[_0x8da2('0x64')](_0x182e2e[_0x8da2('0x5b')])){ut[_0x8da2('0x43')](_0x8da2('0x6a'),JSON[_0x8da2('0x3c')](_0x182e2e));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x8da2('0x6b')};};module[_0x8da2('0x6c')]=Fax; \ No newline at end of file +var _0xff54=['response','reason','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','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','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','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','parse','.pdf','notify','catch','\x20notify\x20','stringify','\x20receiveFax\x20','pick'];(function(_0x2f2226,_0x1e83af){var _0x48ea75=function(_0x4b0d54){while(--_0x4b0d54){_0x2f2226['push'](_0x2f2226['shift']());}};_0x48ea75(++_0x1e83af);}(_0xff54,0x188));var _0x4ff5=function(_0x114b6d,_0x18865f){_0x114b6d=_0x114b6d-0x0;var _0x3fc999=_0xff54[_0x114b6d];return _0x3fc999;};'use strict';var util=require(_0x4ff5('0x0'));var _=require(_0x4ff5('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x4ff5('0x2'));var path=require(_0x4ff5('0x3'));var tiff2pdf=require(_0x4ff5('0x4'));var gs=require(_0x4ff5('0x5'));var logger=require(_0x4ff5('0x6'))(_0x4ff5('0x7'));var ami=require(_0x4ff5('0x8'));var rpcDb=require(_0x4ff5('0x9'));var Channel=require(_0x4ff5('0xa'));var ut=require('./util/util');var Action=require(_0x4ff5('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4ff5('0xc'));var faxMessage=require(_0x4ff5('0xd'));function Fax(_0x21664a){this[_0x4ff5('0xe')]={};this[_0x4ff5('0xf')]=_0x21664a[_0x4ff5('0xf')];this[_0x4ff5('0x10')]=_0x21664a[_0x4ff5('0x10')];this[_0x4ff5('0x11')]={};ami['on'](_0x4ff5('0x12'),this[_0x4ff5('0x13')][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x15'),this['syncVarSet'][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x16'),this[_0x4ff5('0x17')][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x18'),this[_0x4ff5('0x19')][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x1a'),this[_0x4ff5('0x1b')][_0x4ff5('0x14')](this));ami['on']('receivefax',this[_0x4ff5('0x1c')]['bind'](this));ami['on']('hangup',this[_0x4ff5('0x1d')][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x1e'),this[_0x4ff5('0x1f')]['bind'](this));}Fax[_0x4ff5('0x20')][_0x4ff5('0x13')]=function(_0x17b5e4){if(_0x17b5e4[_0x4ff5('0x21')]===_0x4ff5('0x22')){for(var _0x1e60b8 in this[_0x4ff5('0xf')]){if(this[_0x4ff5('0xf')][_0x4ff5('0x23')](_0x1e60b8)){if(_0x17b5e4[_0x4ff5('0x24')]===this[_0x4ff5('0xf')][_0x1e60b8][_0x4ff5('0x25')]){this[_0x4ff5('0xe')][_0x17b5e4[_0x4ff5('0x26')]]={};this['channels'][_0x17b5e4[_0x4ff5('0x26')]][_0x4ff5('0x27')]=_0x17b5e4[_0x4ff5('0x27')];this['channels'][_0x17b5e4[_0x4ff5('0x26')]]['id']=this['faxAccounts'][_0x1e60b8]['id'];this[_0x4ff5('0xe')][_0x17b5e4['uniqueid']][_0x4ff5('0x28')]=this[_0x4ff5('0xf')][_0x1e60b8][_0x4ff5('0x28')];logger[_0x4ff5('0x29')](_0x17b5e4[_0x4ff5('0x26')],_0x4ff5('0x2a'));}}}}if(this[_0x4ff5('0x11')][_0x17b5e4[_0x4ff5('0x26')]]){this['channels'][_0x17b5e4['uniqueid']]={};this[_0x4ff5('0xe')][_0x17b5e4['uniqueid']]['channel']=_0x17b5e4['channel'];logger[_0x4ff5('0x29')](_0x17b5e4[_0x4ff5('0x26')],_0x4ff5('0x2a'));}};Fax[_0x4ff5('0x20')][_0x4ff5('0x2b')]=function(_0x48e300){if(this[_0x4ff5('0xe')][_0x48e300[_0x4ff5('0x26')]]){for(var _0x527f90 in _0x48e300[_0x4ff5('0x2c')]){if(_0x48e300[_0x4ff5('0x2c')]['hasOwnProperty'](_0x527f90)){this[_0x4ff5('0xe')][_0x48e300[_0x4ff5('0x26')]][_0x527f90]=_0x48e300[_0x4ff5('0x2d')];}}}};Fax[_0x4ff5('0x20')][_0x4ff5('0x17')]=function(_0x134b5c){if(this['channels'][_0x134b5c[_0x4ff5('0x26')]]){this['channels'][_0x134b5c[_0x4ff5('0x26')]]['channelstate']=_0x134b5c[_0x4ff5('0x2e')];this[_0x4ff5('0xe')][_0x134b5c[_0x4ff5('0x26')]][_0x4ff5('0x2f')]=_0x134b5c[_0x4ff5('0x2f')];}};Fax['prototype'][_0x4ff5('0x19')]=function(_0x1d22cb){if(this[_0x4ff5('0xe')][_0x1d22cb[_0x4ff5('0x26')]]){for(var _0x5dd9d2 in _0x1d22cb['variable']){if(_0x1d22cb['variable'][_0x4ff5('0x23')](_0x5dd9d2)){this['channels'][_0x1d22cb['uniqueid']][_0x5dd9d2]=_0x1d22cb[_0x4ff5('0x2d')];}}}};Fax[_0x4ff5('0x20')][_0x4ff5('0x1b')]=function(_0x4ed7ad){if(this['channels'][_0x4ed7ad[_0x4ff5('0x26')]]){this[_0x4ff5('0xe')][_0x4ed7ad[_0x4ff5('0x26')]][_0x4ff5('0x30')]=_0x4ed7ad[_0x4ff5('0x30')];this[_0x4ff5('0xe')][_0x4ed7ad['uniqueid']]['status']=_0x4ed7ad[_0x4ff5('0x31')];this[_0x4ff5('0xe')][_0x4ed7ad['uniqueid']][_0x4ff5('0x25')]=_0x4ed7ad[_0x4ff5('0x25')];this[_0x4ff5('0xe')][_0x4ed7ad[_0x4ff5('0x26')]][_0x4ff5('0x32')]=_0x4ed7ad[_0x4ff5('0x32')];logger['info'](_0x4ed7ad[_0x4ff5('0x26')],_0x4ff5('0x33'));}};Fax['prototype'][_0x4ff5('0x1c')]=function(_0x322fce){var _0x282908=this;if(this['channels'][_0x322fce[_0x4ff5('0x26')]]){var _0x437221=this[_0x4ff5('0xe')][_0x322fce['uniqueid']]['id'];this[_0x4ff5('0xe')][_0x322fce[_0x4ff5('0x26')]][_0x4ff5('0x34')]=_0x322fce['remotestationid'];this['channels'][_0x322fce['uniqueid']][_0x4ff5('0x35')]=_0x322fce['pagestransferred'];this['channels'][_0x322fce[_0x4ff5('0x26')]]['localstationid']=_0x322fce[_0x4ff5('0x25')];this['channels'][_0x322fce[_0x4ff5('0x26')]]['resolution']=_0x322fce[_0x4ff5('0x36')];this[_0x4ff5('0xe')][_0x322fce[_0x4ff5('0x26')]][_0x4ff5('0x37')]=_0x322fce['transferrate'];this['channels'][_0x322fce[_0x4ff5('0x26')]]['filename']=_0x322fce[_0x4ff5('0x32')];this[_0x4ff5('0xe')][_0x322fce[_0x4ff5('0x26')]][_0x4ff5('0x38')]=_0x322fce[_0x4ff5('0x38')];if(this[_0x4ff5('0xe')][_0x322fce[_0x4ff5('0x26')]]['pagestransferred']>0x0){tiff2pdf(_0x322fce['filename'],_0x4ff5('0x39'),function(_0x2c6dff){logger['info'](_0x322fce[_0x4ff5('0x26')],_0x4ff5('0x3a'),_0x2c6dff[_0x4ff5('0x3b')]);attachment['create']({'name':path[_0x4ff5('0x3c')](_0x322fce['filename'])[_0x4ff5('0x28')],'basename':path[_0x4ff5('0x3c')](_0x322fce[_0x4ff5('0x32')])['name']+_0x4ff5('0x3d'),'type':'application/pdf'})['then'](function(_0xde2ea1){faxAccount[_0x4ff5('0x3e')](_0x437221,{'from':_0x322fce[_0x4ff5('0x38')],'mapKey':_0x4ff5('0x7'),'body':path['parse'](_0x322fce['filename'])[_0x4ff5('0x28')]+'.pdf','AttachmentId':_0xde2ea1['id']})[_0x4ff5('0x3f')](function(_0x55c04d){logger['error'](_0x322fce[_0x4ff5('0x26')],_0x4ff5('0x40'),JSON[_0x4ff5('0x41')](_0x55c04d));});})['catch'](function(_0x42c287){logger['error'](_0x322fce['uniqueid'],_0x4ff5('0x42'),JSON[_0x4ff5('0x41')](_0x42c287));});});}logger[_0x4ff5('0x29')](_0x322fce['uniqueid'],_0x4ff5('0x42'));}};Fax['prototype'][_0x4ff5('0x1f')]=function(_0x2f6fa7){if(this[_0x4ff5('0x11')][_0x2f6fa7[_0x4ff5('0x26')]]){_['merge'](this['channels'][_0x2f6fa7[_0x4ff5('0x26')]],_[_0x4ff5('0x43')](_0x2f6fa7,[_0x4ff5('0x44'),_0x4ff5('0x45')]));}};function updateStatus(_0x3b0556){if(_0x3b0556['AttachmentId']){faxMessage[_0x4ff5('0x46')](_0x3b0556[_0x4ff5('0x47')],{'failMessage':_0x4ff5('0x48')})[_0x4ff5('0x49')](function(_0x1d9bf4){ut[_0x4ff5('0x4a')]('[Fax][Message][Error][Updated]',_0x1d9bf4);})[_0x4ff5('0x3f')](function(_0x641862){ut[_0x4ff5('0x4a')](_0x4ff5('0x4b'),_0x641862);});}else{ut['logger'](_0x4ff5('0x4c'));}}Fax[_0x4ff5('0x20')][_0x4ff5('0x4d')]=function(_0x4371ee,_0x55c6f6,_0x15ed93){var _0x3df608=this;var _0x481869={};if(_0x55c6f6){_0x481869={'read':_0x55c6f6};}else{_0x481869={'failMessage':_0x15ed93};}if(this[_0x4ff5('0x11')][_0x4371ee][_0x4ff5('0x47')]){faxMessage['update'](this[_0x4ff5('0x11')][_0x4371ee]['AttachmentId'],_0x481869)['then'](function(_0x17a6b6){ut[_0x4ff5('0x4a')]('[Fax][Message][Updated]',_0x17a6b6);})[_0x4ff5('0x3f')](function(_0x9de47e){ut[_0x4ff5('0x4a')](_0x4ff5('0x4e'),_0x9de47e);})[_0x4ff5('0x4f')](function(){delete _0x3df608[_0x4ff5('0xe')][_0x4371ee];delete _0x3df608['actions'][_0x4371ee];});}else{ut[_0x4ff5('0x4a')](_0x4ff5('0x50'));delete this[_0x4ff5('0xe')][_0x4371ee];delete this[_0x4ff5('0x11')][_0x4371ee];}};Fax['prototype']['syncHangup']=function(_0x292738){var _0x1fb9d8=this;if(this[_0x4ff5('0xe')][_0x292738['uniqueid']]){if(this[_0x4ff5('0x11')][_0x292738['uniqueid']]){this['channels'][_0x292738[_0x4ff5('0x26')]]['id']=this[_0x4ff5('0x11')][_0x292738[_0x4ff5('0x26')]]['id'];this[_0x4ff5('0xe')][_0x292738['uniqueid']][_0x4ff5('0x28')]=this[_0x4ff5('0x11')][_0x292738[_0x4ff5('0x26')]][_0x4ff5('0x28')];}logger[_0x4ff5('0x29')](_0x292738[_0x4ff5('0x26')],this[_0x4ff5('0x11')][_0x292738['uniqueid']]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x4ff5('0x41')](this['channels'][_0x292738[_0x4ff5('0x26')]]));if(this['actions'][_0x292738['uniqueid']]){if(this[_0x4ff5('0xe')][_0x292738[_0x4ff5('0x26')]][_0x4ff5('0x51')]>0x0&&this['channels'][_0x292738[_0x4ff5('0x26')]]['faxstatus']===_0x4ff5('0x52')){this['updateStatus'](_0x292738['uniqueid'],!![]);}else{this[_0x4ff5('0x4d')](_0x292738[_0x4ff5('0x26')],![],this[_0x4ff5('0xe')][_0x292738[_0x4ff5('0x26')]][_0x4ff5('0x53')]?_0x4ff5('0x54')+this[_0x4ff5('0xe')][_0x292738[_0x4ff5('0x26')]][_0x4ff5('0x53')]:'SENDING\x20FAILED');}}}};Fax[_0x4ff5('0x20')][_0x4ff5('0x55')]=function(_0x58e394){var _0x28c5cf=this;return new BPromise(function(_0x400791,_0x18a8bf){_0x28c5cf[_0x4ff5('0x56')](_0x58e394,_0x28c5cf['faxAccounts'][_0x58e394[_0x4ff5('0x57')]])['then'](function(_0x4f9a86){ut[_0x4ff5('0x4a')]('[Fax][execOriginate][success]',_0x4f9a86);_0x400791(ut[_0x4ff5('0x3b')](_0x4ff5('0x58')));})[_0x4ff5('0x3f')](function(_0x514732){ut['logger'](_0x4ff5('0x59'),_0x514732);updateStatus(_0x58e394);_0x18a8bf(ut['message'](_0x4ff5('0x5a')));});});};Fax[_0x4ff5('0x20')][_0x4ff5('0x5b')]=function(_0x135036){var _0x499247=this;return new BPromise(function(_0x12fb12,_0xf8716c){var _0x41eb23=_0x499247[_0x4ff5('0x5c')](_0x499247['faxAccounts'][_0x135036[_0x4ff5('0x57')]]['Trunk'],_0x135036);if(_0x41eb23[_0x4ff5('0x5d')]){_0x12fb12(ut[_0x4ff5('0x3b')](_0x4ff5('0x5e')));}else{_0xf8716c(ut[_0x4ff5('0x3b')](_0x41eb23[_0x4ff5('0x3b')]));}});};function originate(_0x1762dc,_0x5c9195,_0x1ad50e){return new BPromise(function(_0x249ab8,_0x30649e){if(_0x1ad50e){var _0x27e0be=util[_0x4ff5('0x5f')](_0x4ff5('0x60'),path[_0x4ff5('0x3c')](_0x1762dc[_0x4ff5('0x3')])[_0x4ff5('0x28')],_0x1762dc[_0x4ff5('0x3')]);gs['execute'](_0x27e0be)[_0x4ff5('0x49')](function(){_0x1762dc['path']=util[_0x4ff5('0x5f')](_0x4ff5('0x61'),path[_0x4ff5('0x3c')](_0x1762dc[_0x4ff5('0x3')])[_0x4ff5('0x62')],path['parse'](_0x1762dc['path'])[_0x4ff5('0x28')]);_0x5c9195[_0x4ff5('0x63')]=_0x1762dc[_0x4ff5('0x3')];ut['logger'](_0x4ff5('0x64'),'');ami[_0x4ff5('0x65')](ut[_0x4ff5('0x66')](_0x1762dc,_0x5c9195))[_0x4ff5('0x49')](function(_0x5ed231){_0x249ab8(_0x5ed231);})[_0x4ff5('0x3f')](function(_0x1d2c49){_0x30649e(_0x1d2c49);});})[_0x4ff5('0x3f')](function(_0x2292a2){_0x30649e(_0x2292a2);});}else{ami[_0x4ff5('0x65')](ut[_0x4ff5('0x66')](_0x1762dc,_0x5c9195))[_0x4ff5('0x49')](function(_0x578a1d){_0x249ab8(_0x578a1d);})[_0x4ff5('0x3f')](function(_0x3bac26){_0x30649e(_0x3bac26);});}});}Fax[_0x4ff5('0x20')][_0x4ff5('0x56')]=function(_0x1acb8b,_0x512761){var _0x4538c3=this;return new BPromise(function(_0x3b3717,_0x233089){var _0x295205=uuid['v4']();var _0x546415=ut['addVariables'](_0x1acb8b,_0x512761);_0x4538c3[_0x4ff5('0x11')][_0x295205]=new Action(_0x295205,_0x512761,_0x1acb8b);var _0x1e5af6=_0x4538c3[_0x4ff5('0x11')][_0x295205];if(path[_0x4ff5('0x3c')](_0x1acb8b['path'])['ext']===_0x4ff5('0x3d')){originate(_0x1e5af6,_0x546415,!![])['then'](function(_0x94f53d){_0x3b3717(_0x94f53d);})[_0x4ff5('0x3f')](function(_0x8227ee){_0x233089(_0x8227ee);});}else{originate(_0x1e5af6,_0x546415,![])[_0x4ff5('0x49')](function(_0x1f88f8){_0x3b3717(_0x1f88f8);})[_0x4ff5('0x3f')](function(_0x499746){_0x233089(_0x499746);});}});};Fax[_0x4ff5('0x20')][_0x4ff5('0x67')]=function(_0x5797ea){return!_['isNil'](_0x5797ea)&&!_[_0x4ff5('0x68')](_0x5797ea[_0x4ff5('0x28')])&&!_['isNil'](_0x5797ea[_0x4ff5('0x69')])&&_0x5797ea[_0x4ff5('0x69')]&&!_[_0x4ff5('0x68')](this[_0x4ff5('0x10')][util[_0x4ff5('0x5f')](_0x4ff5('0x6a'),_0x5797ea[_0x4ff5('0x28')])])&&!_[_0x4ff5('0x68')](this[_0x4ff5('0x10')][util[_0x4ff5('0x5f')](_0x4ff5('0x6a'),_0x5797ea[_0x4ff5('0x28')])][_0x4ff5('0x31')])&&(this[_0x4ff5('0x10')][util[_0x4ff5('0x5f')](_0x4ff5('0x6a'),_0x5797ea['name'])][_0x4ff5('0x31')]===_0x4ff5('0x6b')||this[_0x4ff5('0x10')][util[_0x4ff5('0x5f')](_0x4ff5('0x6a'),_0x5797ea[_0x4ff5('0x28')])][_0x4ff5('0x31')]==='unmonitored');};Fax[_0x4ff5('0x20')]['checkTrunk']=function(_0x3e94c3,_0x27c989){if(!this[_0x4ff5('0x67')](_0x3e94c3)){ut[_0x4ff5('0x4a')](_0x4ff5('0x6c'),_[_0x4ff5('0x68')](_0x3e94c3)?'':_0x3e94c3[_0x4ff5('0x28')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x4ff5('0x6d')};}if(_['isNil'](_0x27c989['fax'])){ut[_0x4ff5('0x4a')](_0x4ff5('0x6e'),JSON[_0x4ff5('0x41')](_0x27c989));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x27c989['path'])){ut['logger'](_0x4ff5('0x6f'),JSON[_0x4ff5('0x41')](_0x27c989));return{'isValid':![],'message':_0x4ff5('0x70')};}return{'isValid':!![],'message':_0x4ff5('0x71')};};module[_0x4ff5('0x72')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index ea4178d..bf688d2 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 _0x0de6=['lodash','../rpc/faxAccount','error','inspect','resolve','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x57c04f,_0x5ed40e){var _0x8022b8=function(_0x12968b){while(--_0x12968b){_0x57c04f['push'](_0x57c04f['shift']());}};_0x8022b8(++_0x5ed40e);}(_0x0de6,0x8b));var _0x60de=function(_0x113a2a,_0x5aa589){_0x113a2a=_0x113a2a-0x0;var _0x4b9c85=_0x0de6[_0x113a2a];return _0x4b9c85;};'use strict';var util=require(_0x60de('0x0'));var BPromise=require(_0x60de('0x1'));var logger=require(_0x60de('0x2'))(_0x60de('0x3'));var _=require(_0x60de('0x4'));var faxAccount=require(_0x60de('0x5'));function loggerCatch(_0x59859d){return function(_0x5698a4){logger[_0x60de('0x6')](_0x59859d,util[_0x60de('0x7')](_0x5698a4,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x53f995,_0x4b2a2e){return BPromise[_0x60de('0x8')]()['then'](faxAccount['notify'](_0x53f995,_0x4b2a2e))[_0x60de('0x9')](loggerCatch(_0x60de('0xa')));}; \ No newline at end of file +var _0xaf37=['then','catch','[Notify]\x20','util','bluebird','lodash','../rpc/faxAccount','error','notify','resolve'];(function(_0x5d8b86,_0x4cbd5f){var _0x1e3c6e=function(_0x226181){while(--_0x226181){_0x5d8b86['push'](_0x5d8b86['shift']());}};_0x1e3c6e(++_0x4cbd5f);}(_0xaf37,0x11b));var _0x7af3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xaf37[_0x138adb];return _0x1b27f2;};'use strict';var util=require(_0x7af3('0x0'));var BPromise=require(_0x7af3('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x7af3('0x2'));var faxAccount=require(_0x7af3('0x3'));function loggerCatch(_0x191e30){return function(_0x351f6b){logger[_0x7af3('0x4')](_0x191e30,util['inspect'](_0x351f6b,{'showHidden':![],'depth':null}));};}exports[_0x7af3('0x5')]=function(_0xa99f5,_0x139385){return BPromise[_0x7af3('0x6')]()[_0x7af3('0x7')](faxAccount[_0x7af3('0x5')](_0xa99f5,_0x139385))[_0x7af3('0x8')](loggerCatch(_0x7af3('0x9')));}; \ 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 b7baf0e..4ec4d7c 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 _0x081c=['fax','bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger'];(function(_0x15a34f,_0x1378ba){var _0x2e7b6b=function(_0x1fbfa2){while(--_0x1fbfa2){_0x15a34f['push'](_0x15a34f['shift']());}};_0x2e7b6b(++_0x1378ba);}(_0x081c,0x80));var _0xc081=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x081c[_0x5c6244];return _0x5800ce;};'use strict';var util=require(_0xc081('0x0'));var logger=require(_0xc081('0x1'))(_0xc081('0x2'));var BPromise=require(_0xc081('0x3'));var exec=require('child_process')[_0xc081('0x4')];exports[_0xc081('0x5')]=function(_0x5a84ac){return new BPromise(function(_0x27809f,_0x36b914){exec(_0x5a84ac,function(_0x2963ab,_0x4cf515,_0x4ca112){logger[_0xc081('0x6')](_0xc081('0x7'),_0x4cf515);if(_0x2963ab){logger[_0xc081('0x6')](_0xc081('0x7'),_0xc081('0x8'),util[_0xc081('0x9')](_0x2963ab,{'showHidden':![],'depth':null}),_0x4cf515,_0x4ca112);_0x36b914(_0x2963ab);}_0x27809f(_0x4cf515);});});}; \ No newline at end of file +var _0x8e2d=['bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','fax'];(function(_0x51dae5,_0x360b39){var _0x303ec2=function(_0x5a2bd0){while(--_0x5a2bd0){_0x51dae5['push'](_0x51dae5['shift']());}};_0x303ec2(++_0x360b39);}(_0x8e2d,0x14c));var _0xd8e2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e2d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0xd8e2('0x0'));var BPromise=require(_0xd8e2('0x1'));var exec=require(_0xd8e2('0x2'))[_0xd8e2('0x3')];exports[_0xd8e2('0x4')]=function(_0x34563b){return new BPromise(function(_0x12a461,_0x315396){exec(_0x34563b,function(_0x1afe69,_0x23212b,_0x4c4bd0){logger[_0xd8e2('0x5')](_0xd8e2('0x6'),_0x23212b);if(_0x1afe69){logger[_0xd8e2('0x5')](_0xd8e2('0x6'),_0xd8e2('0x7'),util[_0xd8e2('0x8')](_0x1afe69,{'showHidden':![],'depth':null}),_0x23212b,_0x4c4bd0);_0x315396(_0x1afe69);}_0x12a461(_0x23212b);});});}; \ 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 1c00ae3..28ee288 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 _0xa338=['minrate','maxrate','format','\x22%s\x22','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','lodash','moment','../../../../config/logger','fax','logger','info','inspect','addVariables','ecm','headerinfo'];(function(_0x5e3ca9,_0x1da538){var _0x2f14b4=function(_0x122683){while(--_0x122683){_0x5e3ca9['push'](_0x5e3ca9['shift']());}};_0x2f14b4(++_0x1da538);}(_0xa338,0x14f));var _0x8a33=function(_0x31350f,_0x447e12){_0x31350f=_0x31350f-0x0;var _0x3b7ab6=_0xa338[_0x31350f];return _0x3b7ab6;};'use strict';var util=require('util');var _=require(_0x8a33('0x0'));var moment=require(_0x8a33('0x1'));var logger=require(_0x8a33('0x2'))(_0x8a33('0x3'));exports['message']=function(_0x226e11){return{'message':_0x226e11};};exports[_0x8a33('0x4')]=function(_0x28db9f,_0x79577f){logger[_0x8a33('0x5')](_0x28db9f,util[_0x8a33('0x6')](_0x79577f,{'showHidden':![],'depth':null}));};exports[_0x8a33('0x7')]=function(_0x2062d5,_0x5cfa08){var _0x1fed73={'XMF-ECM':_0x5cfa08[_0x8a33('0x8')],'XMF-HEADERINFO':_0x5cfa08[_0x8a33('0x9')],'XMF-MINRATE':_0x5cfa08[_0x8a33('0xa')],'XMF-MAXRATE':_0x5cfa08[_0x8a33('0xb')],'XMF-MODEM':util[_0x8a33('0xc')](_0x8a33('0xd'),_0x5cfa08['modem']),'XMF-GATEWAY':_0x5cfa08[_0x8a33('0xe')],'XMF-FAXDETECT':_0x5cfa08[_0x8a33('0xf')],'XMF-T38TIMEOUT':_0x5cfa08['t38timeout'],'XMF-LOCALSTATIONID':_0x5cfa08[_0x8a33('0x10')],'XMF-PATH':_0x2062d5[_0x8a33('0x11')]};return _0x1fed73;};exports[_0x8a33('0x12')]=function(_0x42259d,_0x16e4e0){return{'actionid':_0x42259d[_0x8a33('0x13')],'action':_0x8a33('0x14'),'channel':_0x42259d['channel'],'Exten':_0x8a33('0x15'),'Context':_0x8a33('0x16'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x42259d[_0x8a33('0x9')]?_0x42259d[_0x8a33('0x9')]:'',_0x42259d[_0x8a33('0x10')]),'variable':_0x16e4e0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x42259d[_0x8a33('0x13')]};}; \ No newline at end of file +var _0x3b4b=['channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','util','moment','fax','message','logger','info','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate'];(function(_0x2fff8e,_0x43b892){var _0x45bfa3=function(_0x3b8184){while(--_0x3b8184){_0x2fff8e['push'](_0x2fff8e['shift']());}};_0x45bfa3(++_0x43b892);}(_0x3b4b,0xff));var _0xb3b4=function(_0x43b3fc,_0x4fb2ec){_0x43b3fc=_0x43b3fc-0x0;var _0x41ad9d=_0x3b4b[_0x43b3fc];return _0x41ad9d;};'use strict';var util=require(_0xb3b4('0x0'));var _=require('lodash');var moment=require(_0xb3b4('0x1'));var logger=require('../../../../config/logger')(_0xb3b4('0x2'));exports[_0xb3b4('0x3')]=function(_0x1d667e){return{'message':_0x1d667e};};exports[_0xb3b4('0x4')]=function(_0x233c71,_0x1db301){logger[_0xb3b4('0x5')](_0x233c71,util['inspect'](_0x1db301,{'showHidden':![],'depth':null}));};exports[_0xb3b4('0x6')]=function(_0x4750ed,_0x5aade3){var _0x32d578={'XMF-ECM':_0x5aade3[_0xb3b4('0x7')],'XMF-HEADERINFO':_0x5aade3[_0xb3b4('0x8')],'XMF-MINRATE':_0x5aade3[_0xb3b4('0x9')],'XMF-MAXRATE':_0x5aade3[_0xb3b4('0xa')],'XMF-MODEM':util[_0xb3b4('0xb')](_0xb3b4('0xc'),_0x5aade3['modem']),'XMF-GATEWAY':_0x5aade3[_0xb3b4('0xd')],'XMF-FAXDETECT':_0x5aade3[_0xb3b4('0xe')],'XMF-T38TIMEOUT':_0x5aade3[_0xb3b4('0xf')],'XMF-LOCALSTATIONID':_0x5aade3['localstationid'],'XMF-PATH':_0x4750ed[_0xb3b4('0x10')]};return _0x32d578;};exports[_0xb3b4('0x11')]=function(_0x271647,_0x239a6a){return{'actionid':_0x271647[_0xb3b4('0x12')],'action':_0xb3b4('0x13'),'channel':_0x271647[_0xb3b4('0x14')],'Exten':_0xb3b4('0x15'),'Context':_0xb3b4('0x16'),'Priority':'1','callerid':util[_0xb3b4('0xb')](_0xb3b4('0x17'),_0x271647[_0xb3b4('0x8')]?_0x271647['headerinfo']:'',_0x271647[_0xb3b4('0x18')]),'variable':_0x239a6a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x271647[_0xb3b4('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 1472ad5..b7827ed 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 _0x55e4=['./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./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/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax'];(function(_0x3134fa,_0x5797cd){var _0x352e44=function(_0x4315d2){while(--_0x4315d2){_0x3134fa['push'](_0x3134fa['shift']());}};_0x352e44(++_0x5797cd);}(_0x55e4,0x7d));var _0x455e=function(_0x471cc1,_0x5e89ed){_0x471cc1=_0x471cc1-0x0;var _0x139696=_0x55e4[_0x471cc1];return _0x139696;};'use strict';var BPromise=require('bluebird');var util=require(_0x455e('0x0'));var moment=require(_0x455e('0x1'));var server=require(_0x455e('0x2'));var Realtime=require(_0x455e('0x3'));var Report=require(_0x455e('0x4'));var Acw=require(_0x455e('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x455e('0x6'));var Preview=require(_0x455e('0x7'));var Fax=require(_0x455e('0x8'));var user=require(_0x455e('0x9'));var voiceQueue=require(_0x455e('0xa'));var voiceQueueReport=require(_0x455e('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x455e('0xc'));var trigger=require(_0x455e('0xd'));var template=require(_0x455e('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x455e('0xf'));var voiceExtension=require(_0x455e('0x10'));var faxAccount=require(_0x455e('0x11'));var zendesk=require(_0x455e('0x12'));var salesforce=require(_0x455e('0x13'));var sugarcrm=require(_0x455e('0x14'));var freshdesk=require(_0x455e('0x15'));var desk=require(_0x455e('0x16'));var zoho=require(_0x455e('0x17'));var vtiger=require(_0x455e('0x18'));var freshsales=require(_0x455e('0x19'));var servicenow=require(_0x455e('0x1a'));var dynamics365=require(_0x455e('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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x455e('0x1c')](_0x455e('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x455e('0x1c')](_0x455e('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x455e('0x1e')](user[_0x455e('0x1f')]())[_0x455e('0x1e')](realtime['initAgents']())[_0x455e('0x1e')](user[_0x455e('0x20')]())[_0x455e('0x1e')](realtime[_0x455e('0x21')]())[_0x455e('0x1e')](trunk[_0x455e('0x22')]())[_0x455e('0x1e')](realtime[_0x455e('0x23')]())['then'](voiceQueue['getVoiceQueues']())['then'](realtime[_0x455e('0x24')]())[_0x455e('0x1e')](trigger[_0x455e('0x25')]())[_0x455e('0x1e')](realtime['initTriggers']())['then'](template['getTemplates']())[_0x455e('0x1e')](realtime[_0x455e('0x26')]())['then'](zendesk[_0x455e('0x27')]())[_0x455e('0x1e')](realtime[_0x455e('0x28')]())[_0x455e('0x1e')](salesforce[_0x455e('0x29')]())[_0x455e('0x1e')](realtime[_0x455e('0x2a')]())['then'](sugarcrm[_0x455e('0x2b')]())[_0x455e('0x1e')](realtime[_0x455e('0x2c')]())[_0x455e('0x1e')](freshdesk[_0x455e('0x2d')]())[_0x455e('0x1e')](realtime['initFreshdeskAccounts']())['then'](desk[_0x455e('0x2e')]())[_0x455e('0x1e')](realtime['initDeskAccounts']())[_0x455e('0x1e')](zoho['getZohoAccounts']())[_0x455e('0x1e')](realtime[_0x455e('0x2f')]())['then'](vtiger[_0x455e('0x30')]())[_0x455e('0x1e')](realtime[_0x455e('0x31')]())[_0x455e('0x1e')](freshsales[_0x455e('0x32')]())[_0x455e('0x1e')](realtime[_0x455e('0x33')]())[_0x455e('0x1e')](servicenow['getServicenowAccounts']())[_0x455e('0x1e')](realtime['initServicenowAccounts']())[_0x455e('0x1e')](dynamics365['getDynamics365Accounts']())[_0x455e('0x1e')](realtime['initDynamics365Accounts']())[_0x455e('0x1e')](campaign[_0x455e('0x34')]())[_0x455e('0x1e')](realtime[_0x455e('0x35')]())[_0x455e('0x1e')](voiceExtension[_0x455e('0x36')]())['then'](realtime[_0x455e('0x37')]())[_0x455e('0x1e')](faxAccount[_0x455e('0x38')]())[_0x455e('0x1e')](realtime['initFaxAccounts']())[_0x455e('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x455e('0x1e')](voiceQueueReport[_0x455e('0x39')]())[_0x455e('0x1e')](realtime[_0x455e('0x3a')]())[_0x455e('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x455e('0x3b')]())['then'](cmHopperHistory[_0x455e('0x3c')]())[_0x455e('0x1e')](realtime[_0x455e('0x3d')]())[_0x455e('0x1e')](voiceCallReport[_0x455e('0x3e')]())['then'](realtime[_0x455e('0x3f')]())[_0x455e('0x1e')](function(_0x4dc806){})[_0x455e('0x40')](function(_0x3e019e){console[_0x455e('0x41')](_0x3e019e);});}function main(){return server[_0x455e('0x42')](realtime,preview,fax)['then'](function(_0x1cf54f){return initRealtime();})['then'](function(){return initParams();})[_0x455e('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x455e('0x40')](function(_0x3df95f){console[_0x455e('0x41')](_0x3df95f);});}main(); \ No newline at end of file +var _0xfd14=['./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','listen','sync','catch','log','util','moment','./realtime','./report','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xfd14,0x73));var _0x4fd1=function(_0x3b1448,_0x3071fa){_0x3b1448=_0x3b1448-0x0;var _0x543f82=_0xfd14[_0x3b1448];return _0x543f82;};'use strict';var BPromise=require('bluebird');var util=require(_0x4fd1('0x0'));var moment=require(_0x4fd1('0x1'));var server=require('./server');var Realtime=require(_0x4fd1('0x2'));var Report=require(_0x4fd1('0x3'));var Acw=require(_0x4fd1('0x4'));var Trigger=require(_0x4fd1('0x5'));var Dialer=require(_0x4fd1('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x4fd1('0x7'));var voiceQueue=require(_0x4fd1('0x8'));var voiceQueueReport=require(_0x4fd1('0x9'));var voiceCallReport=require(_0x4fd1('0xa'));var trunk=require(_0x4fd1('0xb'));var trigger=require(_0x4fd1('0xc'));var template=require(_0x4fd1('0xd'));var cmHopperHistory=require(_0x4fd1('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x4fd1('0xf'));var faxAccount=require(_0x4fd1('0x10'));var zendesk=require(_0x4fd1('0x11'));var salesforce=require(_0x4fd1('0x12'));var sugarcrm=require(_0x4fd1('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x4fd1('0x14'));var zoho=require(_0x4fd1('0x15'));var vtiger=require(_0x4fd1('0x16'));var freshsales=require(_0x4fd1('0x17'));var servicenow=require(_0x4fd1('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4fd1('0x19')](_0x4fd1('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x4fd1('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x4fd1('0x1b')]()[_0x4fd1('0x1c')](user[_0x4fd1('0x1d')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x1e')]())[_0x4fd1('0x1c')](user[_0x4fd1('0x1f')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x20')]())[_0x4fd1('0x1c')](trunk[_0x4fd1('0x21')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x22')]())[_0x4fd1('0x1c')](voiceQueue[_0x4fd1('0x23')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x24')]())[_0x4fd1('0x1c')](trigger[_0x4fd1('0x25')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x26')]())[_0x4fd1('0x1c')](template['getTemplates']())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x27')]())[_0x4fd1('0x1c')](zendesk[_0x4fd1('0x28')]())[_0x4fd1('0x1c')](realtime['initZendeskAccounts']())[_0x4fd1('0x1c')](salesforce[_0x4fd1('0x29')]())['then'](realtime['initSalesforceAccounts']())[_0x4fd1('0x1c')](sugarcrm[_0x4fd1('0x2a')]())[_0x4fd1('0x1c')](realtime['initSugarcrmAccounts']())[_0x4fd1('0x1c')](freshdesk[_0x4fd1('0x2b')]())[_0x4fd1('0x1c')](realtime['initFreshdeskAccounts']())[_0x4fd1('0x1c')](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())[_0x4fd1('0x1c')](zoho['getZohoAccounts']())[_0x4fd1('0x1c')](realtime['initZohoAccounts']())[_0x4fd1('0x1c')](vtiger[_0x4fd1('0x2c')]())['then'](realtime['initVtigerAccounts']())[_0x4fd1('0x1c')](freshsales[_0x4fd1('0x2d')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x2e')]())[_0x4fd1('0x1c')](servicenow[_0x4fd1('0x2f')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x30')]())['then'](dynamics365['getDynamics365Accounts']())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x31')]())[_0x4fd1('0x1c')](campaign[_0x4fd1('0x32')]())[_0x4fd1('0x1c')](realtime['initCampaigns']())[_0x4fd1('0x1c')](voiceExtension[_0x4fd1('0x33')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x34')]())[_0x4fd1('0x1c')](faxAccount[_0x4fd1('0x35')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x36')]())[_0x4fd1('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x4fd1('0x1b')]()[_0x4fd1('0x1c')](voiceQueueReport[_0x4fd1('0x37')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x38')]())['then'](cmHopperHistory[_0x4fd1('0x39')]())['then'](realtime[_0x4fd1('0x3a')]())[_0x4fd1('0x1c')](cmHopperHistory[_0x4fd1('0x3b')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x3c')]())[_0x4fd1('0x1c')](voiceCallReport['getVoiceCallReports']())[_0x4fd1('0x1c')](realtime['initVoiceCallReports']())[_0x4fd1('0x1c')](function(_0x2c8fd3){})['catch'](function(_0x389367){console['log'](_0x389367);});}function main(){return server[_0x4fd1('0x3d')](realtime,preview,fax)[_0x4fd1('0x1c')](function(_0x78cf69){return initRealtime();})['then'](function(){return initParams();})[_0x4fd1('0x1c')](function(){report[_0x4fd1('0x3e')]();setInterval(initRealtime,0x1388);})[_0x4fd1('0x3f')](function(_0x282978){console[_0x4fd1('0x40')](_0x282978);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index b762e3e..757bb78 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x4da28f,_0x164324){var _0xe49192=function(_0x29fdfc){while(--_0x29fdfc){_0x4da28f['push'](_0x4da28f['shift']());}};_0xe49192(++_0x164324);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x56149c,_0x36c8d2){var _0x155d78=function(_0x31041e){while(--_0x31041e){_0x56149c['push'](_0x56149c['shift']());}};_0x155d78(++_0x36c8d2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 3574323..e434862 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 _0x0333=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays'];(function(_0x16f547,_0xd09ffb){var _0x45d807=function(_0xa096e3){while(--_0xa096e3){_0x16f547['push'](_0x16f547['shift']());}};_0x45d807(++_0xd09ffb);}(_0x0333,0x8f));var _0x3033=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x0333[_0x2675da];return _0x5e6153;};'use strict';function Campaign(_0x5b66dd){this['id']=_0x5b66dd['id']||0x0;this['name']=_0x5b66dd[_0x3033('0x0')]||'';this['type']=_0x5b66dd[_0x3033('0x1')]||_0x3033('0x2');this[_0x3033('0x3')]=0x0;this[_0x3033('0x4')]=0x0;this[_0x3033('0x5')]=0x0;this[_0x3033('0x6')]=0x0;this['message']='';this[_0x3033('0x7')]=!![];this[_0x3033('0x8')]=_0x5b66dd[_0x3033('0x8')];this[_0x3033('0x9')]=_0x5b66dd[_0x3033('0x9')];this[_0x3033('0xa')]=_0x5b66dd[_0x3033('0xa')]||null;this[_0x3033('0xb')]=_0x5b66dd[_0x3033('0xb')]?_0x5b66dd[_0x3033('0xb')]:null;this[_0x3033('0xc')]=_0x5b66dd['dialOriginateCallerIdName'];this[_0x3033('0xd')]=_0x5b66dd['dialOriginateCallerIdNumber'];this[_0x3033('0xe')]=_0x5b66dd['dialOriginateTimeout']||0x1e;this[_0x3033('0xf')]=_0x5b66dd[_0x3033('0xf')];this[_0x3033('0x10')]=_0x5b66dd[_0x3033('0x10')];this[_0x3033('0x11')]=_0x5b66dd[_0x3033('0x11')];this[_0x3033('0x12')]=_0x5b66dd[_0x3033('0x12')];this[_0x3033('0x13')]=_0x5b66dd[_0x3033('0x13')];this[_0x3033('0x14')]=_0x5b66dd['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x5b66dd['dialGlobalMaxRetry'];this[_0x3033('0x15')]=_0x5b66dd[_0x3033('0x15')]||0x3;this[_0x3033('0x16')]=_0x5b66dd[_0x3033('0x16')]||0x96;this[_0x3033('0x17')]=_0x5b66dd['dialDropMaxRetry']||0x3;this[_0x3033('0x18')]=_0x5b66dd[_0x3033('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x5b66dd[_0x3033('0x19')]||0x3;this[_0x3033('0x1a')]=_0x5b66dd['dialAbandonedRetryFrequency']||0x96;this[_0x3033('0x1b')]=_0x5b66dd[_0x3033('0x1b')]||0x3;this[_0x3033('0x1c')]=_0x5b66dd['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x5b66dd[_0x3033('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5b66dd['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x5b66dd[_0x3033('0x1e')]||_0x3033('0x1f');this[_0x3033('0x20')]=_0x5b66dd['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x5b66dd[_0x3033('0x21')]||undefined;this['dialCutDigit']=_0x5b66dd[_0x3033('0x22')]||undefined;this[_0x3033('0x23')]=_0x5b66dd[_0x3033('0x23')]?_0x5b66dd[_0x3033('0x23')]:undefined;this[_0x3033('0x24')]=_0x5b66dd[_0x3033('0x24')]?_0x5b66dd['Trunk']:undefined;this[_0x3033('0x25')]=_0x5b66dd[_0x3033('0x25')]?_0x5b66dd[_0x3033('0x25')]:undefined;this[_0x3033('0x26')]=_0x5b66dd[_0x3033('0x26')]?_0x5b66dd[_0x3033('0x26')]:undefined;this[_0x3033('0x27')]=_0x5b66dd[_0x3033('0x26')]?_0x5b66dd[_0x3033('0x26')][_0x3033('0x0')]:undefined;this['dialAMDActive']=_0x5b66dd[_0x3033('0x28')]||![];this[_0x3033('0x29')]=_0x5b66dd[_0x3033('0x29')];this['dialAMDGreeting']=_0x5b66dd['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x5b66dd[_0x3033('0x2a')];this[_0x3033('0x2b')]=_0x5b66dd[_0x3033('0x2b')];this[_0x3033('0x2c')]=_0x5b66dd[_0x3033('0x2c')];this[_0x3033('0x2d')]=_0x5b66dd[_0x3033('0x2d')];this[_0x3033('0x2e')]=_0x5b66dd[_0x3033('0x2e')];this[_0x3033('0x2f')]=_0x5b66dd[_0x3033('0x2f')];this[_0x3033('0x30')]=_0x5b66dd[_0x3033('0x30')];}module[_0x3033('0x31')]=Campaign; \ No newline at end of file +var _0x3080=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','active'];(function(_0x54227d,_0xd56054){var _0x385e0a=function(_0x12b00a){while(--_0x12b00a){_0x54227d['push'](_0x54227d['shift']());}};_0x385e0a(++_0xd56054);}(_0x3080,0x8a));var _0x0308=function(_0x215ffc,_0x16c081){_0x215ffc=_0x215ffc-0x0;var _0x3dea83=_0x3080[_0x215ffc];return _0x3dea83;};'use strict';function Campaign(_0x48ea67){this['id']=_0x48ea67['id']||0x0;this[_0x0308('0x0')]=_0x48ea67['name']||'';this[_0x0308('0x1')]=_0x48ea67['type']||_0x0308('0x2');this['originated']=0x0;this[_0x0308('0x3')]=0x0;this[_0x0308('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x48ea67[_0x0308('0x5')];this['limitCalls']=_0x48ea67[_0x0308('0x6')];this[_0x0308('0x7')]=_0x48ea67[_0x0308('0x7')]||null;this[_0x0308('0x8')]=_0x48ea67[_0x0308('0x8')]?_0x48ea67[_0x0308('0x8')]:null;this[_0x0308('0x9')]=_0x48ea67['dialOriginateCallerIdName'];this[_0x0308('0xa')]=_0x48ea67[_0x0308('0xa')];this[_0x0308('0xb')]=_0x48ea67[_0x0308('0xb')]||0x1e;this[_0x0308('0xc')]=_0x48ea67['dialCongestionMaxRetry'];this[_0x0308('0xd')]=_0x48ea67[_0x0308('0xd')];this[_0x0308('0xe')]=_0x48ea67['dialBusyMaxRetry'];this[_0x0308('0xf')]=_0x48ea67[_0x0308('0xf')];this[_0x0308('0x10')]=_0x48ea67[_0x0308('0x10')];this['dialNoAnswerRetryFrequency']=_0x48ea67[_0x0308('0x11')];this[_0x0308('0x12')]=_0x48ea67['dialGlobalMaxRetry'];this[_0x0308('0x13')]=_0x48ea67[_0x0308('0x13')]||0x3;this[_0x0308('0x14')]=_0x48ea67[_0x0308('0x14')]||0x96;this[_0x0308('0x15')]=_0x48ea67[_0x0308('0x15')]||0x3;this[_0x0308('0x16')]=_0x48ea67[_0x0308('0x16')]||0x96;this[_0x0308('0x17')]=_0x48ea67[_0x0308('0x17')]||0x3;this[_0x0308('0x18')]=_0x48ea67[_0x0308('0x18')]||0x96;this[_0x0308('0x19')]=_0x48ea67[_0x0308('0x19')]||0x3;this[_0x0308('0x1a')]=_0x48ea67[_0x0308('0x1a')]||0x96;this[_0x0308('0x1b')]=_0x48ea67[_0x0308('0x1b')]||0x3;this[_0x0308('0x1c')]=_0x48ea67[_0x0308('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x48ea67['dialOrderByScheduledAt']||_0x0308('0x1d');this[_0x0308('0x1e')]=_0x48ea67['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x48ea67[_0x0308('0x1f')]||undefined;this[_0x0308('0x20')]=_0x48ea67['dialCutDigit']||undefined;this[_0x0308('0x21')]=_0x48ea67['TrunkBackup']?_0x48ea67[_0x0308('0x21')]:undefined;this['Trunk']=_0x48ea67[_0x0308('0x22')]?_0x48ea67[_0x0308('0x22')]:undefined;this[_0x0308('0x23')]=_0x48ea67[_0x0308('0x23')]?_0x48ea67[_0x0308('0x23')]:undefined;this[_0x0308('0x24')]=_0x48ea67[_0x0308('0x24')]?_0x48ea67[_0x0308('0x24')]:undefined;this[_0x0308('0x25')]=_0x48ea67['SquareProject']?_0x48ea67[_0x0308('0x24')]['name']:undefined;this['dialAMDActive']=_0x48ea67['dialAMDActive']||![];this[_0x0308('0x26')]=_0x48ea67[_0x0308('0x26')];this[_0x0308('0x27')]=_0x48ea67[_0x0308('0x27')];this['dialAMDAfterGreetingSilence']=_0x48ea67[_0x0308('0x28')];this['dialAMDTotalAnalysisTime']=_0x48ea67[_0x0308('0x29')];this['dialAMDMinWordLength']=_0x48ea67[_0x0308('0x2a')];this[_0x0308('0x2b')]=_0x48ea67[_0x0308('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x48ea67[_0x0308('0x2c')];this['dialAMDSilenceThreshold']=_0x48ea67[_0x0308('0x2d')];this['dialAMDMaximumWordLength']=_0x48ea67[_0x0308('0x2e')];}module[_0x0308('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 4d2bbfc..7f35d46 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 _0xd070=['tag','disposition','monitor','monitors','transfercalleridnum','transferType','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd070,0x8e));var _0x0d07=function(_0x298893,_0x14d157){_0x298893=_0x298893-0x0;var _0x158eb4=_0xd070[_0x298893];return _0x158eb4;};'use strict';function Channel(){this[_0x0d07('0x0')]=null;this['channel']='';this[_0x0d07('0x1')]='';this[_0x0d07('0x2')]=0x0;this[_0x0d07('0x3')]='';this[_0x0d07('0x4')]=undefined;this[_0x0d07('0x5')]=undefined;this[_0x0d07('0x6')]=0x0;this[_0x0d07('0x7')]='';this[_0x0d07('0x8')]=0x0;this[_0x0d07('0x9')]=0x0;this[_0x0d07('0xa')]=0x0;this[_0x0d07('0xb')]=![];this['answertime']=null;this[_0x0d07('0xc')]=null;this['unmanaged']=![];this[_0x0d07('0xd')]=![];this[_0x0d07('0xe')]='';this[_0x0d07('0xf')]='';this[_0x0d07('0x10')]=0x0;this[_0x0d07('0x11')]=0x0;this[_0x0d07('0x12')]=0x0;this[_0x0d07('0x13')]=null;this[_0x0d07('0x14')]=null;this[_0x0d07('0x15')]=null;this[_0x0d07('0x16')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x0d07('0x17')]=[];this[_0x0d07('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x0d07('0x19')]=undefined;this['mohtime']=0x0;}module[_0x0d07('0x1a')]=Channel; \ No newline at end of file +var _0x3166=['calleridnum','connectedlinenum','connectedlinename','context','uniqueid','exten','answered','answertime','endtime','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','channel','destinationchannel'];(function(_0x263825,_0x35839f){var _0x248be7=function(_0x2de741){while(--_0x2de741){_0x263825['push'](_0x263825['shift']());}};_0x248be7(++_0x35839f);}(_0x3166,0xbb));var _0x6316=function(_0x8967aa,_0x121b24){_0x8967aa=_0x8967aa-0x0;var _0x294056=_0x3166[_0x8967aa];return _0x294056;};'use strict';function Channel(){this['starttime']=null;this[_0x6316('0x0')]='';this[_0x6316('0x1')]='';this[_0x6316('0x2')]=0x0;this['calleridname']='';this[_0x6316('0x3')]=undefined;this[_0x6316('0x4')]=undefined;this['accountcode']=0x0;this[_0x6316('0x5')]='';this[_0x6316('0x6')]=0x0;this['linkedid']=0x0;this[_0x6316('0x7')]=0x0;this[_0x6316('0x8')]=![];this[_0x6316('0x9')]=null;this[_0x6316('0xa')]=null;this['unmanaged']=![];this[_0x6316('0xb')]=![];this[_0x6316('0xc')]='';this['lastdata']='';this[_0x6316('0xd')]=0x0;this[_0x6316('0xe')]=0x0;this[_0x6316('0xf')]=0x0;this[_0x6316('0x10')]=null;this[_0x6316('0x11')]=null;this[_0x6316('0x12')]=null;this[_0x6316('0x13')]=![];this[_0x6316('0x14')]=null;this[_0x6316('0x15')]=null;this[_0x6316('0x16')]=[];this[_0x6316('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x6316('0x18')]=undefined;this[_0x6316('0x19')]=0x0;}module[_0x6316('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index f0844e8..bc59e9b 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 _0x6f06=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x6f06,0x8b));var _0x66f0=function(_0x255036,_0xf94145){_0x255036=_0x255036-0x0;var _0x3c4c56=_0x6f06[_0x255036];return _0x3c4c56;};'use strict';function DeskAccount(_0x42f98e){this['id']=_0x42f98e['id']||0x0;this[_0x66f0('0x0')]=_0x42f98e[_0x66f0('0x0')]||'';this['username']=_0x42f98e[_0x66f0('0x1')]||'';this['remoteUri']=_0x42f98e[_0x66f0('0x2')]||'';this[_0x66f0('0x3')]=_0x42f98e[_0x66f0('0x3')]||'';this['password']=_0x42f98e[_0x66f0('0x4')]||'';this[_0x66f0('0x5')]=_0x42f98e[_0x66f0('0x5')]||'';this['consumerSecret']=_0x42f98e[_0x66f0('0x6')]||'';this['token']=_0x42f98e[_0x66f0('0x7')]||'';this[_0x66f0('0x8')]=_0x42f98e[_0x66f0('0x8')]||'';this[_0x66f0('0x9')]=_0x42f98e[_0x66f0('0x9')]||'';this[_0x66f0('0xa')]=_0x42f98e[_0x66f0('0xa')]||'';this[_0x66f0('0xb')]=_0x42f98e['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xd43a=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x3349ac,_0x889beb){var _0x18d071=function(_0x2993d3){while(--_0x2993d3){_0x3349ac['push'](_0x3349ac['shift']());}};_0x18d071(++_0x889beb);}(_0xd43a,0x1d3));var _0xad43=function(_0x520778,_0x3e0b30){_0x520778=_0x520778-0x0;var _0x4edf1c=_0xd43a[_0x520778];return _0x4edf1c;};'use strict';function DeskAccount(_0x59fc59){this['id']=_0x59fc59['id']||0x0;this['name']=_0x59fc59[_0xad43('0x0')]||'';this[_0xad43('0x1')]=_0x59fc59[_0xad43('0x1')]||'';this[_0xad43('0x2')]=_0x59fc59[_0xad43('0x2')]||'';this[_0xad43('0x3')]=_0x59fc59[_0xad43('0x3')]||'';this[_0xad43('0x4')]=_0x59fc59['password']||'';this[_0xad43('0x5')]=_0x59fc59[_0xad43('0x5')]||'';this[_0xad43('0x6')]=_0x59fc59[_0xad43('0x6')]||'';this[_0xad43('0x7')]=_0x59fc59[_0xad43('0x7')]||'';this[_0xad43('0x8')]=_0x59fc59[_0xad43('0x8')]||'';this[_0xad43('0x9')]=_0x59fc59[_0xad43('0x9')]||'';this['serverUrl']=_0x59fc59[_0xad43('0xa')]||'';this[_0xad43('0xb')]=_0x59fc59[_0xad43('0xb')]||{};}module[_0xad43('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 e25ecc0..0548ae5 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 _0x9354=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x45be54,_0x5672ff){var _0x41712d=function(_0x5acf75){while(--_0x5acf75){_0x45be54['push'](_0x45be54['shift']());}};_0x41712d(++_0x5672ff);}(_0x9354,0x96));var _0x4935=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0x9354[_0x2e6c19];return _0x52885d;};'use strict';function Dynamics365Account(_0x487ab6){this['id']=_0x487ab6['id']||0x0;this[_0x4935('0x0')]=_0x487ab6[_0x4935('0x0')]||'';this['username']=_0x487ab6[_0x4935('0x1')]||'';this[_0x4935('0x2')]=_0x487ab6[_0x4935('0x2')]||'';this[_0x4935('0x3')]=_0x487ab6['remoteUri']||'';this[_0x4935('0x4')]=_0x487ab6[_0x4935('0x4')]||'';this[_0x4935('0x5')]=_0x487ab6[_0x4935('0x5')]||'';this[_0x4935('0x6')]=_0x487ab6[_0x4935('0x6')]||{};this[_0x4935('0x7')]=_0x487ab6[_0x4935('0x7')]||'';this[_0x4935('0x8')]=_0x487ab6['Configurations']||{};}module[_0x4935('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x4483=['tenantId','clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x222b40,_0x2732f3){var _0x552e4d=function(_0x4d3357){while(--_0x4d3357){_0x222b40['push'](_0x222b40['shift']());}};_0x552e4d(++_0x2732f3);}(_0x4483,0x1a3));var _0x3448=function(_0x321034,_0xe74f81){_0x321034=_0x321034-0x0;var _0x5dd632=_0x4483[_0x321034];return _0x5dd632;};'use strict';function Dynamics365Account(_0x43f30d){this['id']=_0x43f30d['id']||0x0;this[_0x3448('0x0')]=_0x43f30d[_0x3448('0x0')]||'';this['username']=_0x43f30d[_0x3448('0x1')]||'';this[_0x3448('0x2')]=_0x43f30d[_0x3448('0x2')]||'';this[_0x3448('0x3')]=_0x43f30d[_0x3448('0x3')]||'';this['tenantId']=_0x43f30d[_0x3448('0x4')]||'';this[_0x3448('0x5')]=_0x43f30d[_0x3448('0x5')]||'';this[_0x3448('0x6')]=_0x43f30d[_0x3448('0x6')]||{};this[_0x3448('0x7')]=_0x43f30d[_0x3448('0x7')]||'';this[_0x3448('0x8')]=_0x43f30d['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index a6dd41f..5a9a619 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 _0xc92c=['faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x4c6eb8,_0x29cd2d){var _0x5101e8=function(_0x15431c){while(--_0x15431c){_0x4c6eb8['push'](_0x4c6eb8['shift']());}};_0x5101e8(++_0x29cd2d);}(_0xc92c,0x128));var _0xcc92=function(_0x1ee43c,_0x1bad15){_0x1ee43c=_0x1ee43c-0x0;var _0x3c1d87=_0xc92c[_0x1ee43c];return _0x3c1d87;};'use strict';function FaxAccount(_0x27ca7e){this['id']=_0x27ca7e['id']||0x0;this[_0xcc92('0x0')]=_0x27ca7e['name']||'';this[_0xcc92('0x1')]=_0x27ca7e[_0xcc92('0x1')];this[_0xcc92('0x2')]=_0x27ca7e[_0xcc92('0x2')];this[_0xcc92('0x3')]=_0x27ca7e[_0xcc92('0x3')];this[_0xcc92('0x4')]=_0x27ca7e[_0xcc92('0x4')];this[_0xcc92('0x5')]=_0x27ca7e[_0xcc92('0x5')]||0x960;this[_0xcc92('0x6')]=_0x27ca7e[_0xcc92('0x6')]||0x3840;this['modem']=_0x27ca7e[_0xcc92('0x7')]||_0xcc92('0x8');this[_0xcc92('0x9')]=_0x27ca7e['gateway']||'no';this['faxdetect']=_0x27ca7e[_0xcc92('0xa')]||'no';this['t38timeout']=_0x27ca7e[_0xcc92('0xb')]||0x1388;this['tech']=_0x27ca7e[_0xcc92('0xc')]||'SIP';this[_0xcc92('0xd')]=_0x27ca7e[_0xcc92('0xd')]?_0x27ca7e[_0xcc92('0xd')]:undefined;this[_0xcc92('0xe')]=_0x27ca7e[_0xcc92('0xe')];this[_0xcc92('0xf')]=_0x27ca7e[_0xcc92('0xf')];}module[_0xcc92('0x10')]=FaxAccount; \ No newline at end of file +var _0x3f02=['tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x199b64,_0x5d1120){var _0x42b220=function(_0x26d4e6){while(--_0x26d4e6){_0x199b64['push'](_0x199b64['shift']());}};_0x42b220(++_0x5d1120);}(_0x3f02,0x116));var _0x23f0=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0x3f02[_0x3d00db];return _0x41f115;};'use strict';function FaxAccount(_0x4f8f1b){this['id']=_0x4f8f1b['id']||0x0;this[_0x23f0('0x0')]=_0x4f8f1b[_0x23f0('0x0')]||'';this[_0x23f0('0x1')]=_0x4f8f1b['description'];this[_0x23f0('0x2')]=_0x4f8f1b[_0x23f0('0x2')];this[_0x23f0('0x3')]=_0x4f8f1b[_0x23f0('0x3')];this['localstationid']=_0x4f8f1b['localstationid'];this[_0x23f0('0x4')]=_0x4f8f1b[_0x23f0('0x4')]||0x960;this['maxrate']=_0x4f8f1b[_0x23f0('0x5')]||0x3840;this[_0x23f0('0x6')]=_0x4f8f1b[_0x23f0('0x6')]||_0x23f0('0x7');this[_0x23f0('0x8')]=_0x4f8f1b[_0x23f0('0x8')]||'no';this[_0x23f0('0x9')]=_0x4f8f1b[_0x23f0('0x9')]||'no';this[_0x23f0('0xa')]=_0x4f8f1b[_0x23f0('0xa')]||0x1388;this[_0x23f0('0xb')]=_0x4f8f1b['tech']||_0x23f0('0xc');this[_0x23f0('0xd')]=_0x4f8f1b[_0x23f0('0xd')]?_0x4f8f1b[_0x23f0('0xd')]:undefined;this[_0x23f0('0xe')]=_0x4f8f1b[_0x23f0('0xe')];this[_0x23f0('0xf')]=_0x4f8f1b[_0x23f0('0xf')];}module[_0x23f0('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 19198df..b8c6037 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 _0x64fc=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x42c88f,_0xa2704f){var _0x19c640=function(_0x5c3edb){while(--_0x5c3edb){_0x42c88f['push'](_0x42c88f['shift']());}};_0x19c640(++_0xa2704f);}(_0x64fc,0x1d6));var _0xc64f=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x64fc[_0xf50820];return _0x2a9b10;};'use strict';function FreshdeskAccount(_0x4cdc11){this['id']=_0x4cdc11['id']||0x0;this[_0xc64f('0x0')]=_0x4cdc11[_0xc64f('0x0')]||'';this[_0xc64f('0x1')]=_0x4cdc11[_0xc64f('0x1')]||'';this[_0xc64f('0x2')]=_0x4cdc11[_0xc64f('0x3')]||'';this['remoteUri']=_0x4cdc11[_0xc64f('0x4')]||'';this[_0xc64f('0x5')]=_0x4cdc11[_0xc64f('0x5')]||'';this[_0xc64f('0x6')]=_0x4cdc11[_0xc64f('0x6')]||{};}module[_0xc64f('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x203c=['Configurations','username','apiKey','token','remoteUri'];(function(_0x1aedc1,_0x5817b4){var _0x3284fa=function(_0x2ee98c){while(--_0x2ee98c){_0x1aedc1['push'](_0x1aedc1['shift']());}};_0x3284fa(++_0x5817b4);}(_0x203c,0x187));var _0xc203=function(_0x41ac41,_0x25bc79){_0x41ac41=_0x41ac41-0x0;var _0x16eccf=_0x203c[_0x41ac41];return _0x16eccf;};'use strict';function FreshdeskAccount(_0x1f5382){this['id']=_0x1f5382['id']||0x0;this['name']=_0x1f5382['name']||'';this[_0xc203('0x0')]=_0x1f5382[_0xc203('0x0')]||'';this[_0xc203('0x1')]=_0x1f5382[_0xc203('0x2')]||'';this['remoteUri']=_0x1f5382[_0xc203('0x3')]||'';this['serverUrl']=_0x1f5382['serverUrl']||'';this[_0xc203('0x4')]=_0x1f5382[_0xc203('0x4')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 7f2e6d1..a793eee 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 _0x0958=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x26d26c,_0x4e3075){var _0x4c3a6a=function(_0x3526d9){while(--_0x3526d9){_0x26d26c['push'](_0x26d26c['shift']());}};_0x4c3a6a(++_0x4e3075);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';function FreshsalesAccount(_0x309912){this['id']=_0x309912['id']||0x0;this[_0x8095('0x0')]=_0x309912[_0x8095('0x0')]||'';this['username']=_0x309912[_0x8095('0x1')]||'';this[_0x8095('0x2')]=_0x309912['token']||'';this['remoteUri']=_0x309912[_0x8095('0x3')]||'';this[_0x8095('0x4')]=_0x309912['serverUrl']||'';this['Configurations']=_0x309912[_0x8095('0x5')]||{};}module[_0x8095('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xcf12=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4ddd1e,_0x2987de){var _0x492392=function(_0x30400c){while(--_0x30400c){_0x4ddd1e['push'](_0x4ddd1e['shift']());}};_0x492392(++_0x2987de);}(_0xcf12,0x140));var _0x2cf1=function(_0x59b2f4,_0x2a3145){_0x59b2f4=_0x59b2f4-0x0;var _0x18a176=_0xcf12[_0x59b2f4];return _0x18a176;};'use strict';function FreshsalesAccount(_0x17b07d){this['id']=_0x17b07d['id']||0x0;this[_0x2cf1('0x0')]=_0x17b07d['name']||'';this[_0x2cf1('0x1')]=_0x17b07d[_0x2cf1('0x1')]||'';this[_0x2cf1('0x2')]=_0x17b07d['token']||'';this[_0x2cf1('0x3')]=_0x17b07d[_0x2cf1('0x3')]||'';this[_0x2cf1('0x4')]=_0x17b07d[_0x2cf1('0x4')]||'';this[_0x2cf1('0x5')]=_0x17b07d[_0x2cf1('0x5')]||{};}module[_0x2cf1('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index a7eda39..de32fb1 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 _0x894e=['queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','exports','inbound','queue'];(function(_0x3b2be5,_0x9c01ae){var _0x14cd8=function(_0x5262be){while(--_0x5262be){_0x3b2be5['push'](_0x3b2be5['shift']());}};_0x14cd8(++_0x9c01ae);}(_0x894e,0x111));var _0xe894=function(_0xdcb46f,_0x8f628e){_0xdcb46f=_0xdcb46f-0x0;var _0x1382d8=_0x894e[_0xdcb46f];return _0x1382d8;};'use strict';function QueueReport(){this['type']=_0xe894('0x0');this['uniqueid']='';this['calleridnum']='';this['calleridname']='';this[_0xe894('0x1')]='';this[_0xe894('0x2')]=null;this[_0xe894('0x3')]=null;this['position']=0x1;this[_0xe894('0x4')]=0x1;this['queuecallerabandon']=![];this[_0xe894('0x5')]=null;this[_0xe894('0x6')]=![];this[_0xe894('0x7')]=null;this[_0xe894('0x8')]=![];this[_0xe894('0x9')]=null;this[_0xe894('0xa')]=0x1;this[_0xe894('0xb')]='';this[_0xe894('0xc')]='';this[_0xe894('0xd')]='';this[_0xe894('0xe')]='';this[_0xe894('0xf')]='';this[_0xe894('0x10')]='';this[_0xe894('0x11')]='';this[_0xe894('0x12')]=0x0;this[_0xe894('0x13')]=![];this[_0xe894('0x14')]='';this[_0xe894('0x15')]=_0xe894('0x16');this['mohtime']=0x0;this[_0xe894('0x17')]={};}module[_0xe894('0x18')]=QueueReport; \ No newline at end of file +var _0x2f2b=['type','inbound','uniqueid','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','exten','priority','holdtime','assigned','motionChannel','voice','mohtime'];(function(_0x201098,_0x146ef6){var _0x543233=function(_0x578f8f){while(--_0x578f8f){_0x201098['push'](_0x201098['shift']());}};_0x543233(++_0x146ef6);}(_0x2f2b,0xe6));var _0xb2f2=function(_0x4677e8,_0x189a39){_0x4677e8=_0x4677e8-0x0;var _0x489280=_0x2f2b[_0x4677e8];return _0x489280;};'use strict';function QueueReport(){this[_0xb2f2('0x0')]=_0xb2f2('0x1');this[_0xb2f2('0x2')]='';this['calleridnum']='';this[_0xb2f2('0x3')]='';this['queue']='';this[_0xb2f2('0x4')]=null;this[_0xb2f2('0x5')]=null;this[_0xb2f2('0x6')]=0x1;this['count']=0x1;this[_0xb2f2('0x7')]=![];this[_0xb2f2('0x8')]=null;this['queuecallercomplete']=![];this[_0xb2f2('0x9')]=null;this[_0xb2f2('0xa')]=![];this[_0xb2f2('0xb')]=null;this[_0xb2f2('0xc')]=0x1;this[_0xb2f2('0xd')]='';this[_0xb2f2('0xe')]='';this[_0xb2f2('0xf')]='';this['accountcode']='';this['context']='';this[_0xb2f2('0x10')]='';this[_0xb2f2('0x11')]='';this[_0xb2f2('0x12')]=0x0;this[_0xb2f2('0x13')]=![];this['lastAssignedTo']='';this[_0xb2f2('0x14')]=_0xb2f2('0x15');this[_0xb2f2('0x16')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index ced91ca..2f47985 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 _0xab36=['name','username','remoteUri','password','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x5effcb,_0x577808){var _0x30907e=function(_0x4e9d0e){while(--_0x4e9d0e){_0x5effcb['push'](_0x5effcb['shift']());}};_0x30907e(++_0x577808);}(_0xab36,0xdc));var _0x6ab3=function(_0x22b56b,_0x12d19e){_0x22b56b=_0x22b56b-0x0;var _0x4ed3b4=_0xab36[_0x22b56b];return _0x4ed3b4;};'use strict';function SalesforceAccount(_0x2d0eb2){this['id']=_0x2d0eb2['id']||0x0;this[_0x6ab3('0x0')]=_0x2d0eb2[_0x6ab3('0x0')]||'';this[_0x6ab3('0x1')]=_0x2d0eb2[_0x6ab3('0x1')]||'';this[_0x6ab3('0x2')]=_0x2d0eb2[_0x6ab3('0x2')]||'';this[_0x6ab3('0x3')]=_0x2d0eb2[_0x6ab3('0x3')]||'';this['clientId']=_0x2d0eb2['clientId']||'';this[_0x6ab3('0x4')]=_0x2d0eb2[_0x6ab3('0x4')]||'';this[_0x6ab3('0x5')]=_0x2d0eb2[_0x6ab3('0x5')]||'';this[_0x6ab3('0x6')]=_0x2d0eb2[_0x6ab3('0x6')]||_0x6ab3('0x7');this[_0x6ab3('0x8')]=_0x2d0eb2[_0x6ab3('0x8')]||'';this[_0x6ab3('0x9')]=_0x2d0eb2[_0x6ab3('0x9')]||{};}module[_0x6ab3('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x5e6c=['serverUrl','Configurations','exports','name','username','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x53a26e,_0x1bfaf6){var _0x10cc83=function(_0x1d1f3c){while(--_0x1d1f3c){_0x53a26e['push'](_0x53a26e['shift']());}};_0x10cc83(++_0x1bfaf6);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x45b2a2,_0x25331f){_0x45b2a2=_0x45b2a2-0x0;var _0x157350=_0x5e6c[_0x45b2a2];return _0x157350;};'use strict';function SalesforceAccount(_0x41cc0c){this['id']=_0x41cc0c['id']||0x0;this[_0xc5e6('0x0')]=_0x41cc0c[_0xc5e6('0x0')]||'';this['username']=_0x41cc0c[_0xc5e6('0x1')]||'';this['remoteUri']=_0x41cc0c['remoteUri']||'';this['password']=_0x41cc0c[_0xc5e6('0x2')]||'';this[_0xc5e6('0x3')]=_0x41cc0c['clientId']||'';this[_0xc5e6('0x4')]=_0x41cc0c['clientSecret']||'';this[_0xc5e6('0x5')]=_0x41cc0c[_0xc5e6('0x5')]||'';this['type']=_0x41cc0c[_0xc5e6('0x6')]||_0xc5e6('0x7');this[_0xc5e6('0x8')]=_0x41cc0c[_0xc5e6('0x8')]||'';this[_0xc5e6('0x9')]=_0x41cc0c[_0xc5e6('0x9')]||{};}module[_0xc5e6('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 634a104..bc92bba 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 _0x5267=['Configurations','name','password','remoteUri','serverUrl'];(function(_0x194263,_0x415af8){var _0x58bf41=function(_0x50b50b){while(--_0x50b50b){_0x194263['push'](_0x194263['shift']());}};_0x58bf41(++_0x415af8);}(_0x5267,0x83));var _0x7526=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5267[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x5208d1){this['id']=_0x5208d1['id']||0x0;this[_0x7526('0x0')]=_0x5208d1[_0x7526('0x0')]||'';this['username']=_0x5208d1['username']||'';this[_0x7526('0x1')]=_0x5208d1[_0x7526('0x1')]||'';this[_0x7526('0x2')]=_0x5208d1['remoteUri']||'';this['serverUrl']=_0x5208d1[_0x7526('0x3')]||'';this[_0x7526('0x4')]=_0x5208d1['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xdecb=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0xd2b0b1,_0x13acf0){var _0x1a8303=function(_0x35cb82){while(--_0x35cb82){_0xd2b0b1['push'](_0xd2b0b1['shift']());}};_0x1a8303(++_0x13acf0);}(_0xdecb,0x1d4));var _0xbdec=function(_0x34cde5,_0x1e4e45){_0x34cde5=_0x34cde5-0x0;var _0x1451e1=_0xdecb[_0x34cde5];return _0x1451e1;};'use strict';function ServicenowAccount(_0x185f89){this['id']=_0x185f89['id']||0x0;this[_0xbdec('0x0')]=_0x185f89['name']||'';this[_0xbdec('0x1')]=_0x185f89[_0xbdec('0x1')]||'';this['password']=_0x185f89[_0xbdec('0x2')]||'';this['remoteUri']=_0x185f89[_0xbdec('0x3')]||'';this[_0xbdec('0x4')]=_0x185f89[_0xbdec('0x4')]||'';this[_0xbdec('0x5')]=_0x185f89[_0xbdec('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index e90f565..01f3749 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 _0xb041=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0xb041,0x99));var _0x1b04=function(_0x12b49b,_0x3df396){_0x12b49b=_0x12b49b-0x0;var _0x431802=_0xb041[_0x12b49b];return _0x431802;};'use strict';function SugarcrmAccount(_0x34662d){this['id']=_0x34662d['id']||0x0;this['name']=_0x34662d[_0x1b04('0x0')]||'';this[_0x1b04('0x1')]=_0x34662d[_0x1b04('0x1')]||'';this[_0x1b04('0x2')]=_0x34662d[_0x1b04('0x2')]||'';this['remoteUri']=_0x34662d[_0x1b04('0x3')]||'';this[_0x1b04('0x4')]=_0x34662d[_0x1b04('0x4')]||'';this[_0x1b04('0x5')]=_0x34662d['Configurations']||{};}module[_0x1b04('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x50ac=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0x50ac,0x1c2));var _0xc50a=function(_0x75e866,_0x30b4de){_0x75e866=_0x75e866-0x0;var _0x5e4b64=_0x50ac[_0x75e866];return _0x5e4b64;};'use strict';function SugarcrmAccount(_0x4a9f3c){this['id']=_0x4a9f3c['id']||0x0;this[_0xc50a('0x0')]=_0x4a9f3c[_0xc50a('0x0')]||'';this[_0xc50a('0x1')]=_0x4a9f3c[_0xc50a('0x1')]||'';this[_0xc50a('0x2')]=_0x4a9f3c[_0xc50a('0x2')]||'';this['remoteUri']=_0x4a9f3c[_0xc50a('0x3')]||'';this[_0xc50a('0x4')]=_0x4a9f3c[_0xc50a('0x4')]||'';this[_0xc50a('0x5')]=_0x4a9f3c[_0xc50a('0x5')]||{};}module[_0xc50a('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index debcd82..620356b 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 _0x92e7=['exports','name','accountcode','state','status','address'];(function(_0x3c7c46,_0x5c7122){var _0x1c084b=function(_0x137ef3){while(--_0x137ef3){_0x3c7c46['push'](_0x3c7c46['shift']());}};_0x1c084b(++_0x5c7122);}(_0x92e7,0x1ab));var _0x792e=function(_0x46f58c,_0x31d941){_0x46f58c=_0x46f58c-0x0;var _0x12b19b=_0x92e7[_0x46f58c];return _0x12b19b;};'use strict';function Telephone(_0x1bb75b){this['id']=_0x1bb75b['id']||0x0;this['name']=_0x1bb75b[_0x792e('0x0')]||'';this[_0x792e('0x1')]=_0x1bb75b[_0x792e('0x1')]||'';this[_0x792e('0x2')]='unknown';this['stateTime']=0x0;this[_0x792e('0x3')]='unknown';this[_0x792e('0x4')]='';}module[_0x792e('0x5')]=Telephone; \ No newline at end of file +var _0xf660=['status','unknown','address','name','accountcode','stateTime'];(function(_0x106cfc,_0x14222a){var _0x35df80=function(_0x23ca51){while(--_0x23ca51){_0x106cfc['push'](_0x106cfc['shift']());}};_0x35df80(++_0x14222a);}(_0xf660,0x195));var _0x0f66=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0xf660[_0xa9eaa0];return _0x30897a;};'use strict';function Telephone(_0x4798ee){this['id']=_0x4798ee['id']||0x0;this[_0x0f66('0x0')]=_0x4798ee['name']||'';this[_0x0f66('0x1')]=_0x4798ee[_0x0f66('0x1')]||'';this['state']='unknown';this[_0x0f66('0x2')]=0x0;this[_0x0f66('0x3')]=_0x0f66('0x4');this[_0x0f66('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index c1b69bf..1e65f78 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0xa807ea,_0x4e7f32){var _0x1cb85e=function(_0x4916cd){while(--_0x4916cd){_0xa807ea['push'](_0xa807ea['shift']());}};_0x1cb85e(++_0x4e7f32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x52a96c,_0x385325){var _0x67179=function(_0x47ba46){while(--_0x47ba46){_0x52a96c['push'](_0x52a96c['shift']());}};_0x67179(++_0x385325);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d7686,_0x5d11b1){_0x5d7686=_0x5d7686-0x0;var _0x408ab4=_0xb10b[_0x5d7686];return _0x408ab4;};'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 ce32d5c..be0edf1 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 _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0x0b0e[_0x509273];return _0x38ef40;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file +var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x661c2d,_0x1e597a){var _0x11d4ae=function(_0xf49680){while(--_0xf49680){_0x661c2d['push'](_0x661c2d['shift']());}};_0x11d4ae(++_0x1e597a);}(_0xda2d,0x102));var _0xdda2=function(_0x400ce7,_0x8088fa){_0x400ce7=_0x400ce7-0x0;var _0x59a996=_0xda2d[_0x400ce7];return _0x59a996;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index f37c238..6b869fa 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 _0x7c11=['domainport','refresh','stateRegistry','defaultuser','exports','active','name','state','stateTime','status','unknown','registry','indexOf','split','host','domain'];(function(_0x58e989,_0x2b6e4a){var _0x2bf9bd=function(_0x583536){while(--_0x583536){_0x58e989['push'](_0x58e989['shift']());}};_0x2bf9bd(++_0x2b6e4a);}(_0x7c11,0x1c5));var _0x17c1=function(_0x507d91,_0x13ae8b){_0x507d91=_0x507d91-0x0;var _0x1f10f8=_0x7c11[_0x507d91];return _0x1f10f8;};'use strict';function Trunk(_0x1e6093){this['id']=_0x1e6093['id']||0x0;this[_0x17c1('0x0')]=_0x1e6093['active']||![];this[_0x17c1('0x1')]=_0x1e6093[_0x17c1('0x1')]||'';this[_0x17c1('0x2')]='unknown';this[_0x17c1('0x3')]=0x0;this[_0x17c1('0x4')]=_0x17c1('0x5');this[_0x17c1('0x6')]=_0x1e6093[_0x17c1('0x6')]&&_0x1e6093['registry'][_0x17c1('0x7')](':')?_0x1e6093[_0x17c1('0x6')][_0x17c1('0x8')](':')[0x0]:'';this[_0x17c1('0x9')]='';this['port']='';this[_0x17c1('0xa')]='';this[_0x17c1('0xb')]='';this[_0x17c1('0xc')]='';this[_0x17c1('0xd')]=_0x17c1('0x5');this['registrationtime']='';this['address']='';this[_0x17c1('0xe')]=_0x1e6093[_0x17c1('0xe')]||'';}module[_0x17c1('0xf')]=Trunk; \ No newline at end of file +var _0xcf61=['domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','split','host','port'];(function(_0x49c5cd,_0x35259b){var _0x70e7fe=function(_0x43081c){while(--_0x43081c){_0x49c5cd['push'](_0x49c5cd['shift']());}};_0x70e7fe(++_0x35259b);}(_0xcf61,0x106));var _0x1cf6=function(_0x5776cb,_0x579eb7){_0x5776cb=_0x5776cb-0x0;var _0x46349f=_0xcf61[_0x5776cb];return _0x46349f;};'use strict';function Trunk(_0x275ea6){this['id']=_0x275ea6['id']||0x0;this[_0x1cf6('0x0')]=_0x275ea6[_0x1cf6('0x0')]||![];this['name']=_0x275ea6[_0x1cf6('0x1')]||'';this[_0x1cf6('0x2')]=_0x1cf6('0x3');this[_0x1cf6('0x4')]=0x0;this[_0x1cf6('0x5')]=_0x1cf6('0x3');this[_0x1cf6('0x6')]=_0x275ea6['registry']&&_0x275ea6['registry']['indexOf'](':')?_0x275ea6[_0x1cf6('0x6')][_0x1cf6('0x7')](':')[0x0]:'';this[_0x1cf6('0x8')]='';this[_0x1cf6('0x9')]='';this[_0x1cf6('0xa')]='';this[_0x1cf6('0xb')]='';this[_0x1cf6('0xc')]='';this[_0x1cf6('0xd')]=_0x1cf6('0x3');this[_0x1cf6('0xe')]='';this['address']='';this[_0x1cf6('0xf')]=_0x275ea6['defaultuser']||'';}module[_0x1cf6('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 0379b0d..bcd48ec 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 _0x8a50=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x4f86ef,_0x226fb5){var _0x20c5ca=function(_0x34265f){while(--_0x34265f){_0x4f86ef['push'](_0x4f86ef['shift']());}};_0x20c5ca(++_0x226fb5);}(_0x8a50,0x87));var _0x08a5=function(_0x44c674,_0x2ca0c0){_0x44c674=_0x44c674-0x0;var _0x2e70c7=_0x8a50[_0x44c674];return _0x2e70c7;};'use strict';function voiceExtension(_0x2bc33c){this['id']=_0x2bc33c['id']||0x0;this[_0x08a5('0x0')]=_0x2bc33c[_0x08a5('0x0')]||'';this[_0x08a5('0x1')]=_0x2bc33c['recordingFormat']||'none';this[_0x08a5('0x2')]=_0x2bc33c[_0x08a5('0x2')]||![];}module[_0x08a5('0x3')]=voiceExtension; \ No newline at end of file +var _0x8ade=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x23e776,_0x453cf4){var _0x52285a=function(_0x3cf38d){while(--_0x3cf38d){_0x23e776['push'](_0x23e776['shift']());}};_0x52285a(++_0x453cf4);}(_0x8ade,0xf9));var _0xe8ad=function(_0x56bd24,_0x2b69ca){_0x56bd24=_0x56bd24-0x0;var _0xc17683=_0x8ade[_0x56bd24];return _0xc17683;};'use strict';function voiceExtension(_0x5ab272){this['id']=_0x5ab272['id']||0x0;this[_0xe8ad('0x0')]=_0x5ab272['exten']||'';this[_0xe8ad('0x1')]=_0x5ab272[_0xe8ad('0x1')]||_0xe8ad('0x2');this[_0xe8ad('0x3')]=_0x5ab272[_0xe8ad('0x3')]||![];}module[_0xe8ad('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 0a6b27e..8daa197 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 _0x7708=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','onhold','wav','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x5b8772,_0x32a746){var _0xa25577=function(_0x29f826){while(--_0x29f826){_0x5b8772['push'](_0x5b8772['shift']());}};_0xa25577(++_0x32a746);}(_0x7708,0x188));var _0x8770=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x7708[_0x51fe5f];return _0x4abce9;};'use strict';var statusDesc=[_0x8770('0x0'),_0x8770('0x1'),'inuse',_0x8770('0x2'),'invalid','unavailable','ringing','ringinuse',_0x8770('0x3')];var monitorFormat={'wav':_0x8770('0x4'),'wav49':'wav49','gsm':_0x8770('0x5')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x8770('0x6')};function VoiceQueue(_0x42d305){this['id']=_0x42d305['id']||0x0;this[_0x8770('0x7')]=_0x42d305[_0x8770('0x7')]||'';this[_0x8770('0x8')]=_0x42d305[_0x8770('0x8')]||'';this[_0x8770('0x9')]=_0x42d305['type']||_0x8770('0xa');this[_0x8770('0xb')]=0x0;this[_0x8770('0xc')]=0x0;this['total']=0x0;this[_0x8770('0xd')]=0x0;this[_0x8770('0xe')]=0x0;this[_0x8770('0xf')]=0x0;this[_0x8770('0x10')]=0x0;this['unmanaged']=0x0;this[_0x8770('0x11')]=0x0;this[_0x8770('0x12')]=0x0;this[_0x8770('0x13')]=0x0;this['acw']=_0x42d305[_0x8770('0x14')]||![];this[_0x8770('0x15')]=_0x42d305[_0x8770('0x15')]||0xa;this[_0x8770('0x16')]=_0x42d305[_0x8770('0x16')]||'no';this[_0x8770('0x17')]=!![];this[_0x8770('0x18')]='';this[_0x8770('0x19')]=0x0;this['temp']=0x0;this[_0x8770('0x1a')]=_0x42d305[_0x8770('0x1a')]||null;this['dialGlobalInterval']=_0x42d305[_0x8770('0x1b')]?_0x42d305['dialGlobalInterval']:null;this[_0x8770('0x1c')]=_0x42d305['dialActive'];this['dialMethod']=_0x42d305['dialMethod']||_0x8770('0x1d');this[_0x8770('0x1e')]=_0x42d305[_0x8770('0x1e')]||0x0;this[_0x8770('0x1f')]=_0x42d305['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x42d305[_0x8770('0x20')]||0x1;this[_0x8770('0x21')]=_0x42d305[_0x8770('0x21')]||_0x8770('0x22');this[_0x8770('0x23')]=_0x42d305['dialPredictiveOptimizationPercentage']||0.03;this[_0x8770('0x24')]=_0x42d305[_0x8770('0x24')]||0x258;this[_0x8770('0x25')]=_0x42d305[_0x8770('0x25')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x42d305[_0x8770('0x26')]||_0x8770('0x27');this[_0x8770('0x28')]=_0x42d305[_0x8770('0x28')]||0x1e;this[_0x8770('0x29')]=_0x42d305[_0x8770('0x29')]||'tTxX';this[_0x8770('0x2a')]=_0x42d305[_0x8770('0x2a')]||0x3;this[_0x8770('0x2b')]=_0x42d305[_0x8770('0x2b')]||undefined;this['dialCongestionMaxRetry']=_0x42d305[_0x8770('0x2c')]||0x3;this['dialCongestionRetryFrequency']=_0x42d305[_0x8770('0x2d')]||0x96;this[_0x8770('0x2e')]=_0x42d305[_0x8770('0x2e')]||0x3;this[_0x8770('0x2f')]=_0x42d305[_0x8770('0x2f')]||0x96;this[_0x8770('0x30')]=_0x42d305[_0x8770('0x30')]||0x3;this[_0x8770('0x31')]=_0x42d305[_0x8770('0x31')]||0x96;this[_0x8770('0x32')]=_0x42d305['dialNoSuchNumberMaxRetry']||0x3;this[_0x8770('0x33')]=_0x42d305[_0x8770('0x33')]||0x96;this[_0x8770('0x34')]=_0x42d305[_0x8770('0x34')]||0x3;this[_0x8770('0x35')]=_0x42d305[_0x8770('0x35')]||0x96;this['dialAbandonedMaxRetry']=_0x42d305['dialAbandonedMaxRetry']||0x3;this[_0x8770('0x36')]=_0x42d305[_0x8770('0x36')]||0x96;this[_0x8770('0x37')]=_0x42d305[_0x8770('0x37')]||0x3;this[_0x8770('0x38')]=_0x42d305['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x42d305[_0x8770('0x39')]||0x3;this[_0x8770('0x3a')]=_0x42d305[_0x8770('0x3a')]||0x96;this[_0x8770('0x3b')]=_0x42d305['dialGlobalMaxRetry']||0x4;this[_0x8770('0x3c')]=_0x42d305['Trunk']?_0x42d305['Trunk']:undefined;this[_0x8770('0x3d')]=_0x42d305['TrunkBackup']?_0x42d305[_0x8770('0x3d')]:undefined;this[_0x8770('0x3e')]=_0x42d305[_0x8770('0x3e')]||undefined;this[_0x8770('0x3f')]=_0x42d305[_0x8770('0x3f')]?_0x42d305[_0x8770('0x3f')]:undefined;this[_0x8770('0x40')]=_0x42d305[_0x8770('0x40')]||_0x8770('0x41');this['dialRandomLastDigitCallerIdNumber']=_0x42d305[_0x8770('0x42')]||undefined;this[_0x8770('0x43')]=_0x42d305[_0x8770('0x43')]||undefined;this['strategy']=strategy[_0x42d305['strategy']]||_0x8770('0x44');this[_0x8770('0x45')]=!![];this[_0x8770('0x46')]=_0x42d305['dialAMDActive']||![];this[_0x8770('0x47')]=_0x42d305['dialAMDInitialSilence'];this[_0x8770('0x48')]=_0x42d305[_0x8770('0x48')];this[_0x8770('0x49')]=_0x42d305[_0x8770('0x49')];this[_0x8770('0x4a')]=_0x42d305[_0x8770('0x4a')];this[_0x8770('0x4b')]=_0x42d305[_0x8770('0x4b')];this[_0x8770('0x4c')]=_0x42d305[_0x8770('0x4c')];this['dialAMDMaximumNumberOfWords']=_0x42d305[_0x8770('0x4d')];this[_0x8770('0x4e')]=_0x42d305[_0x8770('0x4e')];this['dialAMDMaximumWordLength']=_0x42d305[_0x8770('0x4f')];this[_0x8770('0x50')]=0x0;this[_0x8770('0x51')]=0x0;this[_0x8770('0x52')]=_0x42d305[_0x8770('0x52')];this[_0x8770('0x53')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x8770('0x54')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x8770('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x8770('0x56')]=0x0;this[_0x8770('0x57')]=0x0;this[_0x8770('0x58')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x8770('0x59')]=0x0;this[_0x8770('0x5a')]=0x0;this[_0x8770('0x5b')]=0x0;this[_0x8770('0x5c')]=0x0;this[_0x8770('0x5d')]=undefined;this[_0x8770('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0x8770('0x5f')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x8770('0x60')]=0x0;this[_0x8770('0x61')]=0x0;this[_0x8770('0x62')]=0x0;this[_0x8770('0x63')]=0x0;this[_0x8770('0x64')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x8770('0x65')]=_0x42d305[_0x8770('0x66')]||0x14;this['predictiveIntervalMinThreshold']=_0x42d305[_0x8770('0x66')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x8770('0x67')]=0x0;this[_0x8770('0x68')]=0x1;this[_0x8770('0x69')]=0x0;this[_0x8770('0x6a')]=0x0;this[_0x8770('0x6b')]=0x0;this[_0x8770('0x6c')]=0x0;this[_0x8770('0x6d')]=_0x42d305[_0x8770('0x6d')]||0x1e;this[_0x8770('0x6e')]=_0x42d305[_0x8770('0x6e')]||![];this[_0x8770('0x6f')]=_0x42d305['dialQueueProject2']||undefined;this[_0x8770('0x70')]=_0x42d305[_0x8770('0x70')]||![];this[_0x8770('0x71')]=_0x42d305[_0x8770('0x71')]||![];this[_0x8770('0x8')]=monitorFormat[_0x42d305[_0x8770('0x8')]]?monitorFormat[_0x42d305['monitor_format']]:undefined;this[_0x8770('0x72')]=_0x42d305[_0x8770('0x72')]||![];this[_0x8770('0x73')]=_0x42d305[_0x8770('0x73')]?_0x42d305[_0x8770('0x73')]:undefined;}module[_0x8770('0x74')]=VoiceQueue; \ No newline at end of file +var _0x596b=['roundrobin','name','monitor_format','type','inbound','talking','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49'];(function(_0x167c44,_0x5d7e2f){var _0x2be52b=function(_0x216d39){while(--_0x216d39){_0x167c44['push'](_0x167c44['shift']());}};_0x2be52b(++_0x5d7e2f);}(_0x596b,0xde));var _0xb596=function(_0x11c30d,_0x566175){_0x11c30d=_0x11c30d-0x0;var _0x43c1b3=_0x596b[_0x11c30d];return _0x43c1b3;};'use strict';var statusDesc=[_0xb596('0x0'),_0xb596('0x1'),_0xb596('0x2'),_0xb596('0x3'),_0xb596('0x4'),_0xb596('0x5'),'ringing',_0xb596('0x6'),_0xb596('0x7')];var monitorFormat={'wav':_0xb596('0x8'),'wav49':_0xb596('0x9'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0xb596('0xa')};function VoiceQueue(_0x3f3213){this['id']=_0x3f3213['id']||0x0;this[_0xb596('0xb')]=_0x3f3213[_0xb596('0xb')]||'';this[_0xb596('0xc')]=_0x3f3213[_0xb596('0xc')]||'';this['type']=_0x3f3213[_0xb596('0xd')]||_0xb596('0xe');this['waiting']=0x0;this[_0xb596('0xf')]=0x0;this['total']=0x0;this[_0xb596('0x10')]=0x0;this[_0xb596('0x11')]=0x0;this['sumHoldTime']=0x0;this[_0xb596('0x12')]=0x0;this[_0xb596('0x13')]=0x0;this[_0xb596('0x14')]=0x0;this[_0xb596('0x15')]=0x0;this[_0xb596('0x16')]=0x0;this['acw']=_0x3f3213['acw']||![];this[_0xb596('0x17')]=_0x3f3213[_0xb596('0x17')]||0xa;this['autopause']=_0x3f3213[_0xb596('0x18')]||'no';this[_0xb596('0x19')]=!![];this['message']='';this['originated']=0x0;this[_0xb596('0x1a')]=0x0;this[_0xb596('0x1b')]=_0x3f3213[_0xb596('0x1b')]||null;this['dialGlobalInterval']=_0x3f3213[_0xb596('0x1c')]?_0x3f3213[_0xb596('0x1c')]:null;this['dialActive']=_0x3f3213['dialActive'];this[_0xb596('0x1d')]=_0x3f3213['dialMethod']||_0xb596('0x1e');this[_0xb596('0x1f')]=_0x3f3213[_0xb596('0x1f')]||0x0;this['dialLimitQueue']=_0x3f3213[_0xb596('0x20')]||0x0;this[_0xb596('0x21')]=_0x3f3213[_0xb596('0x21')]||0x1;this[_0xb596('0x22')]=_0x3f3213[_0xb596('0x22')]||_0xb596('0x23');this[_0xb596('0x24')]=_0x3f3213[_0xb596('0x24')]||0.03;this[_0xb596('0x25')]=_0x3f3213['dialPredictiveInterval']||0x258;this[_0xb596('0x26')]=_0x3f3213['dialOriginateCallerIdName']||_0xb596('0x27');this['dialOriginateCallerIdNumber']=_0x3f3213[_0xb596('0x28')]||_0xb596('0x27');this[_0xb596('0x29')]=_0x3f3213[_0xb596('0x29')]||0x1e;this[_0xb596('0x2a')]=_0x3f3213[_0xb596('0x2a')]||'tTxX';this[_0xb596('0x2b')]=_0x3f3213[_0xb596('0x2b')]||0x3;this[_0xb596('0x2c')]=_0x3f3213[_0xb596('0x2c')]||undefined;this[_0xb596('0x2d')]=_0x3f3213[_0xb596('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x3f3213[_0xb596('0x2e')]||0x96;this[_0xb596('0x2f')]=_0x3f3213[_0xb596('0x2f')]||0x3;this[_0xb596('0x30')]=_0x3f3213[_0xb596('0x30')]||0x96;this[_0xb596('0x31')]=_0x3f3213['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x3f3213[_0xb596('0x32')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x3f3213[_0xb596('0x33')]||0x3;this[_0xb596('0x34')]=_0x3f3213[_0xb596('0x34')]||0x96;this[_0xb596('0x35')]=_0x3f3213[_0xb596('0x35')]||0x3;this['dialDropRetryFrequency']=_0x3f3213[_0xb596('0x36')]||0x96;this[_0xb596('0x37')]=_0x3f3213[_0xb596('0x37')]||0x3;this['dialAbandonedRetryFrequency']=_0x3f3213[_0xb596('0x38')]||0x96;this[_0xb596('0x39')]=_0x3f3213['dialMachineMaxRetry']||0x3;this[_0xb596('0x3a')]=_0x3f3213[_0xb596('0x3a')]||0x96;this[_0xb596('0x3b')]=_0x3f3213[_0xb596('0x3b')]||0x3;this[_0xb596('0x3c')]=_0x3f3213[_0xb596('0x3c')]||0x96;this[_0xb596('0x3d')]=_0x3f3213[_0xb596('0x3d')]||0x4;this[_0xb596('0x3e')]=_0x3f3213['Trunk']?_0x3f3213[_0xb596('0x3e')]:undefined;this[_0xb596('0x3f')]=_0x3f3213[_0xb596('0x3f')]?_0x3f3213['TrunkBackup']:undefined;this['dialPrefix']=_0x3f3213[_0xb596('0x40')]||undefined;this[_0xb596('0x41')]=_0x3f3213[_0xb596('0x41')]?_0x3f3213[_0xb596('0x41')]:undefined;this[_0xb596('0x42')]=_0x3f3213[_0xb596('0x42')]||_0xb596('0x43');this['dialRandomLastDigitCallerIdNumber']=_0x3f3213['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xb596('0x44')]=_0x3f3213['dialCutDigit']||undefined;this[_0xb596('0x45')]=strategy[_0x3f3213[_0xb596('0x45')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0xb596('0x46')]=_0x3f3213[_0xb596('0x46')]||![];this[_0xb596('0x47')]=_0x3f3213['dialAMDInitialSilence'];this[_0xb596('0x48')]=_0x3f3213['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x3f3213[_0xb596('0x49')];this['dialAMDTotalAnalysisTime']=_0x3f3213['dialAMDTotalAnalysisTime'];this[_0xb596('0x4a')]=_0x3f3213[_0xb596('0x4a')];this[_0xb596('0x4b')]=_0x3f3213[_0xb596('0x4b')];this[_0xb596('0x4c')]=_0x3f3213[_0xb596('0x4c')];this[_0xb596('0x4d')]=_0x3f3213[_0xb596('0x4d')];this[_0xb596('0x4e')]=_0x3f3213[_0xb596('0x4e')];this['outboundRejectCallsDay']=0x0;this[_0xb596('0x4f')]=0x0;this['timeout']=_0x3f3213['timeout'];this[_0xb596('0x50')]=0x0;this[_0xb596('0x51')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xb596('0x52')]=0x0;this[_0xb596('0x53')]=0x0;this[_0xb596('0x54')]=0x0;this[_0xb596('0x55')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xb596('0x56')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xb596('0x57')]=0x0;this[_0xb596('0x58')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0xb596('0x59')]=undefined;this[_0xb596('0x5a')]=undefined;this['handlePredictive']=undefined;this[_0xb596('0x5b')]=1.05;this[_0xb596('0x5c')]=0x0;this[_0xb596('0x5d')]=0x0;this[_0xb596('0x5e')]=0x0;this[_0xb596('0x5f')]=0x0;this[_0xb596('0x60')]=0x0;this[_0xb596('0x61')]=0x0;this[_0xb596('0x62')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xb596('0x63')]=_0x3f3213[_0xb596('0x64')]||0x14;this[_0xb596('0x65')]=_0x3f3213['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xb596('0x66')]=0x0;this[_0xb596('0x67')]=0x0;this[_0xb596('0x68')]=0x1;this[_0xb596('0x69')]=0x0;this[_0xb596('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xb596('0x6b')]=0x0;this[_0xb596('0x6c')]=_0x3f3213[_0xb596('0x6c')]||0x1e;this[_0xb596('0x6d')]=_0x3f3213[_0xb596('0x6d')]||![];this[_0xb596('0x6e')]=_0x3f3213[_0xb596('0x6e')]||undefined;this[_0xb596('0x6f')]=_0x3f3213[_0xb596('0x6f')]||![];this[_0xb596('0x70')]=_0x3f3213['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x3f3213[_0xb596('0xc')]]?monitorFormat[_0x3f3213[_0xb596('0xc')]]:undefined;this['mandatoryDisposition']=_0x3f3213[_0xb596('0x71')]||![];this[_0xb596('0x72')]=_0x3f3213['mandatoryDispositionPause']?_0x3f3213[_0xb596('0x72')]:undefined;}module[_0xb596('0x73')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index b2ee47a..30bb661 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 _0x192c=['accessKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0xf95ddf,_0x2be86e){var _0xe6eba3=function(_0x5c287c){while(--_0x5c287c){_0xf95ddf['push'](_0xf95ddf['shift']());}};_0xe6eba3(++_0x2be86e);}(_0x192c,0xe8));var _0xc192=function(_0x237418,_0x56e144){_0x237418=_0x237418-0x0;var _0x22393e=_0x192c[_0x237418];return _0x22393e;};'use strict';function VtigerAccount(_0x41534e){this['id']=_0x41534e['id']||0x0;this[_0xc192('0x0')]=_0x41534e[_0xc192('0x0')]||'';this[_0xc192('0x1')]=_0x41534e[_0xc192('0x1')]||'';this[_0xc192('0x2')]=_0x41534e['accessKey']||'';this['remoteUri']=_0x41534e[_0xc192('0x3')]||'';this[_0xc192('0x4')]=_0x41534e[_0xc192('0x4')]||'';this[_0xc192('0x5')]=_0x41534e[_0xc192('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x04f1=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x4a7f4b,_0x4fe40f){var _0x312223=function(_0x3ccddd){while(--_0x3ccddd){_0x4a7f4b['push'](_0x4a7f4b['shift']());}};_0x312223(++_0x4fe40f);}(_0x04f1,0xc4));var _0x104f=function(_0x29dd3c,_0x488a2f){_0x29dd3c=_0x29dd3c-0x0;var _0x12b297=_0x04f1[_0x29dd3c];return _0x12b297;};'use strict';function VtigerAccount(_0x243df2){this['id']=_0x243df2['id']||0x0;this[_0x104f('0x0')]=_0x243df2[_0x104f('0x0')]||'';this[_0x104f('0x1')]=_0x243df2[_0x104f('0x1')]||'';this[_0x104f('0x2')]=_0x243df2[_0x104f('0x2')]||'';this[_0x104f('0x3')]=_0x243df2[_0x104f('0x3')]||'';this[_0x104f('0x4')]=_0x243df2[_0x104f('0x4')]||'';this[_0x104f('0x5')]=_0x243df2[_0x104f('0x5')]||{};}module[_0x104f('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 7443caa..5932883 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 _0x3494=['type','integrationTab','serverUrl','name','username','password','token','remoteUri','authType'];(function(_0x1850b8,_0x18a497){var _0x269bc3=function(_0x58f8e7){while(--_0x58f8e7){_0x1850b8['push'](_0x1850b8['shift']());}};_0x269bc3(++_0x18a497);}(_0x3494,0x78));var _0x4349=function(_0x583c9b,_0xe3bbb7){_0x583c9b=_0x583c9b-0x0;var _0x264e3e=_0x3494[_0x583c9b];return _0x264e3e;};'use strict';function ZendeskAccount(_0xe78048){this['id']=_0xe78048['id']||0x0;this[_0x4349('0x0')]=_0xe78048[_0x4349('0x0')]||'';this['username']=_0xe78048[_0x4349('0x1')]||'';this[_0x4349('0x2')]=_0xe78048[_0x4349('0x2')]||'';this[_0x4349('0x3')]=_0xe78048[_0x4349('0x3')]||'';this[_0x4349('0x4')]=_0xe78048['remoteUri']||'';this[_0x4349('0x5')]=_0xe78048[_0x4349('0x5')]||'';this[_0x4349('0x6')]=_0xe78048[_0x4349('0x6')]||_0x4349('0x7');this[_0x4349('0x8')]=_0xe78048[_0x4349('0x8')]||'';this['Configurations']=_0xe78048['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x2c6c=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','exports'];(function(_0x2f9340,_0x597888){var _0x347406=function(_0x419579){while(--_0x419579){_0x2f9340['push'](_0x2f9340['shift']());}};_0x347406(++_0x597888);}(_0x2c6c,0x14a));var _0xc2c6=function(_0x1e7253,_0x59e55b){_0x1e7253=_0x1e7253-0x0;var _0x9e721e=_0x2c6c[_0x1e7253];return _0x9e721e;};'use strict';function ZendeskAccount(_0x3f9cc0){this['id']=_0x3f9cc0['id']||0x0;this[_0xc2c6('0x0')]=_0x3f9cc0[_0xc2c6('0x0')]||'';this[_0xc2c6('0x1')]=_0x3f9cc0[_0xc2c6('0x1')]||'';this[_0xc2c6('0x2')]=_0x3f9cc0[_0xc2c6('0x2')]||'';this[_0xc2c6('0x3')]=_0x3f9cc0[_0xc2c6('0x3')]||'';this[_0xc2c6('0x4')]=_0x3f9cc0['remoteUri']||'';this[_0xc2c6('0x5')]=_0x3f9cc0[_0xc2c6('0x5')]||'';this[_0xc2c6('0x6')]=_0x3f9cc0['type']||_0xc2c6('0x7');this[_0xc2c6('0x8')]=_0x3f9cc0[_0xc2c6('0x8')]||'';this['Configurations']=_0x3f9cc0['Configurations']||{};}module[_0xc2c6('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 6cd0881..b140654 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 _0xbc43=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc43,0xb4));var _0x3bc4=function(_0x52cf3f,_0x157db6){_0x52cf3f=_0x52cf3f-0x0;var _0x429cad=_0xbc43[_0x52cf3f];return _0x429cad;};'use strict';function ZohoAccount(_0x2dfb88){this['id']=_0x2dfb88['id']||0x0;this[_0x3bc4('0x0')]=_0x2dfb88[_0x3bc4('0x0')]||'';this[_0x3bc4('0x1')]=_0x2dfb88[_0x3bc4('0x1')]||'';this['host']=_0x2dfb88[_0x3bc4('0x2')]||'';this[_0x3bc4('0x3')]=_0x2dfb88[_0x3bc4('0x3')]||'';this[_0x3bc4('0x4')]=_0x2dfb88['clientId']||'';this[_0x3bc4('0x5')]=_0x2dfb88['clientSecret']||'';this[_0x3bc4('0x6')]=_0x2dfb88[_0x3bc4('0x6')]||'';this['code']=_0x2dfb88[_0x3bc4('0x7')]||'';this['refreshToken']=_0x2dfb88[_0x3bc4('0x8')]||'';this['Configurations']=_0x2dfb88[_0x3bc4('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xbc48=['serverUrl','code','refreshToken','Configurations','exports','description','host','zone','clientId','clientSecret'];(function(_0x29ad0e,_0x4d7e03){var _0x3199fd=function(_0x4e995b){while(--_0x4e995b){_0x29ad0e['push'](_0x29ad0e['shift']());}};_0x3199fd(++_0x4d7e03);}(_0xbc48,0x16d));var _0x8bc4=function(_0x5612fa,_0x4082e7){_0x5612fa=_0x5612fa-0x0;var _0x54a641=_0xbc48[_0x5612fa];return _0x54a641;};'use strict';function ZohoAccount(_0x840636){this['id']=_0x840636['id']||0x0;this['name']=_0x840636['name']||'';this[_0x8bc4('0x0')]=_0x840636[_0x8bc4('0x0')]||'';this['host']=_0x840636[_0x8bc4('0x1')]||'';this[_0x8bc4('0x2')]=_0x840636[_0x8bc4('0x2')]||'';this[_0x8bc4('0x3')]=_0x840636[_0x8bc4('0x3')]||'';this[_0x8bc4('0x4')]=_0x840636[_0x8bc4('0x4')]||'';this[_0x8bc4('0x5')]=_0x840636[_0x8bc4('0x5')]||'';this[_0x8bc4('0x6')]=_0x840636['code']||'';this[_0x8bc4('0x7')]=_0x840636['refreshToken']||'';this[_0x8bc4('0x8')]=_0x840636[_0x8bc4('0x8')]||{};}module[_0x8bc4('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index e58aca8..e26d839 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 _0xd904=['string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','name','channelAgent','format','membername','calleridname','Contact','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','Agent','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','util','moment','isNil'];(function(_0x56dafd,_0x4971dc){var _0x138306=function(_0x41b477){while(--_0x41b477){_0x56dafd['push'](_0x56dafd['shift']());}};_0x138306(++_0x4971dc);}(_0xd904,0x11c));var _0x4d90=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xd904[_0x3070dc];return _0x431489;};'use strict';var util=require(_0x4d90('0x0'));var _=require('lodash');var moment=require(_0x4d90('0x1'));function checkNameSurname(_0x427879,_0x5c268c,_0x4c75d8){var _0x5225d3='';if(!_[_0x4d90('0x2')](_0x5c268c)&&_0x4d90('0x3')===typeof _0x5c268c){_0x5225d3+=_0x5c268c;}if(!_[_0x4d90('0x2')](_0x4c75d8)&&_0x4d90('0x3')===typeof _0x4c75d8){_0x5225d3+='\x20'+_0x4c75d8;}if(_0x5225d3!==''){return _0x5225d3;}return _0x427879;}function Action(_0x31d258,_0x18d241,_0x16a0a6,_0x14e30b,_0x11a1c5){this[_0x4d90('0x4')]=_0x16a0a6||undefined;this[_0x4d90('0x5')]=_0x31d258['id'];this[_0x4d90('0x6')]=_0x18d241['name'];this['type']=_0x18d241[_0x4d90('0x7')];this[_0x4d90('0x8')]=_0x4d90('0x6');this[_0x4d90('0x9')]=![];this['membername']=_[_0x4d90('0x2')](_0x31d258['Agent'])?undefined:_0x31d258['Agent'][_0x4d90('0xa')];this[_0x4d90('0xb')]=this['membername']?util[_0x4d90('0xc')]('SIP/%s',this[_0x4d90('0xd')]):_0x14e30b||undefined;this[_0x4d90('0xe')]=checkNameSurname(_0x31d258[_0x4d90('0xf')]['phone'],_0x31d258[_0x4d90('0xf')]['firstName'],_0x31d258[_0x4d90('0xf')][_0x4d90('0x10')]);this[_0x4d90('0x11')]=_0x31d258[_0x4d90('0x11')]||![];this['calleridnum']=_0x31d258[_0x4d90('0xf')][_0x4d90('0x12')];this[_0x4d90('0x13')]=_0x31d258[_0x4d90('0x13')];this[_0x4d90('0x14')]=_0x31d258[_0x4d90('0x14')]||0x0;this[_0x4d90('0x15')]=_0x31d258[_0x4d90('0x15')]||0x0;this[_0x4d90('0x16')]=_0x31d258[_0x4d90('0x16')]||0x0;this[_0x4d90('0x17')]=(_0x31d258['countbusyretry']||0x0)+(_0x31d258[_0x4d90('0x15')]||0x0)+(_0x31d258['countnoanswerretry']||0x0)+(_0x31d258[_0x4d90('0x18')]||0x0)+(_0x31d258[_0x4d90('0x19')]||0x0)+(_0x31d258[_0x4d90('0x1a')]||0x0)+(_0x31d258[_0x4d90('0x1b')]||0x0)+(_0x31d258[_0x4d90('0x1c')]||0x0);this['countnosuchnumberretry']=_0x31d258[_0x4d90('0x18')]||0x0;this[_0x4d90('0x19')]=_0x31d258[_0x4d90('0x19')]||0x0;this[_0x4d90('0x1a')]=_0x31d258[_0x4d90('0x1a')]||0x0;this[_0x4d90('0x1b')]=_0x31d258[_0x4d90('0x1b')]||0x0;this[_0x4d90('0x1c')]=_0x31d258[_0x4d90('0x1c')]||0x0;this[_0x4d90('0x1d')]=_0x31d258['callback'];this[_0x4d90('0x1e')]=_0x31d258[_0x4d90('0x1e')];this['callbackat']=_0x31d258[_0x4d90('0x1f')];this['recallme']=_0x31d258[_0x4d90('0x20')];this['ContactId']=_0x31d258['ContactId'];this[_0x4d90('0x21')]=_0x31d258[_0x4d90('0x21')];this[_0x4d90('0x22')]=_['isNil'](_0x31d258[_0x4d90('0x23')])?_0x31d258[_0x4d90('0x22')]:_0x31d258[_0x4d90('0x23')]['id'];this[_0x4d90('0x24')]=_0x31d258[_0x4d90('0x24')];this[_0x4d90('0x25')]='';this['originatecalleridname']='';}Action[_0x4d90('0x26')][_0x4d90('0x27')]=function(){return util['format'](_0x4d90('0x28'),this[_0x4d90('0xe')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0xa4a7=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0xa4a7,0x12f));var _0x7a4a=function(_0x29e085,_0xa997f7){_0x29e085=_0x29e085-0x0;var _0x50c646=_0xa4a7[_0x29e085];return _0x50c646;};'use strict';var util=require(_0x7a4a('0x0'));var _=require(_0x7a4a('0x1'));var moment=require(_0x7a4a('0x2'));function checkNameSurname(_0x3cf7ee,_0x83daff,_0x12dd6f){var _0x5ea24d='';if(!_[_0x7a4a('0x3')](_0x83daff)&&_0x7a4a('0x4')===typeof _0x83daff){_0x5ea24d+=_0x83daff;}if(!_[_0x7a4a('0x3')](_0x12dd6f)&&_0x7a4a('0x4')===typeof _0x12dd6f){_0x5ea24d+='\x20'+_0x12dd6f;}if(_0x5ea24d!==''){return _0x5ea24d;}return _0x3cf7ee;}function Action(_0x183cf2,_0x1bd284,_0x2f13df,_0x5b654a,_0x2b09eb){this[_0x7a4a('0x5')]=_0x2f13df||undefined;this[_0x7a4a('0x6')]=_0x183cf2['id'];this['queue']=_0x1bd284[_0x7a4a('0x7')];this[_0x7a4a('0x8')]=_0x1bd284[_0x7a4a('0x8')];this[_0x7a4a('0x9')]=_0x7a4a('0xa');this[_0x7a4a('0xb')]=![];this[_0x7a4a('0xc')]=_['isNil'](_0x183cf2[_0x7a4a('0xd')])?undefined:_0x183cf2[_0x7a4a('0xd')][_0x7a4a('0x7')];this[_0x7a4a('0xe')]=this['membername']?util['format']('SIP/%s',this[_0x7a4a('0xc')]):_0x5b654a||undefined;this[_0x7a4a('0xf')]=checkNameSurname(_0x183cf2[_0x7a4a('0x10')][_0x7a4a('0x11')],_0x183cf2[_0x7a4a('0x10')]['firstName'],_0x183cf2[_0x7a4a('0x10')][_0x7a4a('0x12')]);this[_0x7a4a('0x13')]=_0x183cf2[_0x7a4a('0x13')]||![];this[_0x7a4a('0x14')]=_0x183cf2[_0x7a4a('0x10')][_0x7a4a('0x11')];this[_0x7a4a('0x15')]=_0x183cf2[_0x7a4a('0x15')];this[_0x7a4a('0x16')]=_0x183cf2[_0x7a4a('0x16')]||0x0;this[_0x7a4a('0x17')]=_0x183cf2[_0x7a4a('0x17')]||0x0;this[_0x7a4a('0x18')]=_0x183cf2[_0x7a4a('0x18')]||0x0;this[_0x7a4a('0x19')]=(_0x183cf2['countbusyretry']||0x0)+(_0x183cf2[_0x7a4a('0x17')]||0x0)+(_0x183cf2[_0x7a4a('0x18')]||0x0)+(_0x183cf2['countnosuchnumberretry']||0x0)+(_0x183cf2['countdropretry']||0x0)+(_0x183cf2[_0x7a4a('0x1a')]||0x0)+(_0x183cf2[_0x7a4a('0x1b')]||0x0)+(_0x183cf2[_0x7a4a('0x1c')]||0x0);this['countnosuchnumberretry']=_0x183cf2[_0x7a4a('0x1d')]||0x0;this['countdropretry']=_0x183cf2[_0x7a4a('0x1e')]||0x0;this[_0x7a4a('0x1a')]=_0x183cf2[_0x7a4a('0x1a')]||0x0;this[_0x7a4a('0x1b')]=_0x183cf2[_0x7a4a('0x1b')]||0x0;this[_0x7a4a('0x1c')]=_0x183cf2['countagentrejectretry']||0x0;this[_0x7a4a('0x1f')]=_0x183cf2['callback'];this['callbackuniqueid']=_0x183cf2[_0x7a4a('0x20')];this[_0x7a4a('0x21')]=_0x183cf2[_0x7a4a('0x21')];this['recallme']=_0x183cf2[_0x7a4a('0x22')];this[_0x7a4a('0x23')]=_0x183cf2[_0x7a4a('0x23')];this[_0x7a4a('0x24')]=_0x183cf2['ListId'];this['UserId']=_[_0x7a4a('0x3')](_0x183cf2[_0x7a4a('0xd')])?_0x183cf2[_0x7a4a('0x25')]:_0x183cf2[_0x7a4a('0xd')]['id'];this[_0x7a4a('0x26')]=_0x183cf2[_0x7a4a('0x26')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x7a4a('0x27')]['getCaller']=function(){return util['format'](_0x7a4a('0x28'),this[_0x7a4a('0xf')],this['number']);};module[_0x7a4a('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index a534e32..d472337 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 _0x89f1=['predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','loopCampaigns','syncCampaigns','hasOwnProperty','booked','outbound','clearZombieChannels','setMessage','recallMe','clearZombieChannel','enqueue','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','status','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','info','[action]','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','answertime','uniqueid','\x20Queue','custom:agentconnect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','activeContact','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','isNil','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','toLowerVariables','starttime','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','channel','actionid','lookAgent','logLookAgent','responsetime','isFailure','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','destuniqueid','addVariable','variables','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','defaults','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','strategy','answered','available','loggedIn','sumBillable','sumDuration','talking','total','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x89f1,0x10f));var _0x189f=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x89f1[_0xa30766];return _0x24e780;};'use strict';var util=require(_0x189f('0x0'));var _=require(_0x189f('0x1'));var BPromise=require(_0x189f('0x2'));var uuid=require(_0x189f('0x3'));var moment=require(_0x189f('0x4'));var md5=require(_0x189f('0x5'));var Redis=require('ioredis');var config=require(_0x189f('0x6'));var logger=require(_0x189f('0x7'))(_0x189f('0x8'));var loggerAction=require(_0x189f('0x7'))(_0x189f('0x9'));var ami=require('../ami');var rpcDb=require(_0x189f('0xa'));var Action=require(_0x189f('0xb'));var ut=require('./util/util');config['redis']=_[_0x189f('0xc')](config[_0x189f('0xd')],{'host':_0x189f('0xe'),'port':0x18eb});var io=require(_0x189f('0xf'))(new Redis(config[_0x189f('0xd')]));var Sequence=function(){};Sequence[_0x189f('0x10')]['enqueue']=function(_0x26e674){this[_0x189f('0x11')]=this[_0x189f('0x11')]?this[_0x189f('0x11')][_0x189f('0x12')](_0x26e674):_0x26e674();};function Preview(_0x50036c){this[_0x189f('0x13')]=new Sequence();this[_0x189f('0x14')]=_0x50036c[_0x189f('0x15')];this[_0x189f('0x16')]=_0x50036c[_0x189f('0x16')];this[_0x189f('0x17')]={};this[_0x189f('0x18')]=_0x50036c[_0x189f('0x18')];this[_0x189f('0x19')]=0x0;ami['on'](_0x189f('0x1a'),this[_0x189f('0x1b')][_0x189f('0x1c')](this));ami['on'](_0x189f('0x1d'),this[_0x189f('0x1e')][_0x189f('0x1c')](this));ami['on']('hanguprequest',this[_0x189f('0x1f')][_0x189f('0x1c')](this));ami['on'](_0x189f('0x20'),this[_0x189f('0x21')][_0x189f('0x1c')](this));ami['on'](_0x189f('0x22'),this[_0x189f('0x23')][_0x189f('0x1c')](this));ami['on']('varset',this[_0x189f('0x24')][_0x189f('0x1c')](this));ami['on'](_0x189f('0x25'),this[_0x189f('0x26')][_0x189f('0x1c')](this));ami['on'](_0x189f('0x27'),this[_0x189f('0x28')]['bind'](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x56497a,_0xa60b0c,_0xbae2f5){io['to'](_0x56497a)[_0x189f('0x29')](_0xa60b0c,_0xbae2f5);}function emitCampaignPreview(_0x39d681){if(_0x39d681[_0x189f('0x2a')]==='outbound'){var _0x2dd09e={'id':_0x39d681['id'],'name':_0x39d681['name'],'strategy':_0x39d681[_0x189f('0x2b')],'answered':_0x39d681[_0x189f('0x2c')],'available':_0x39d681[_0x189f('0x2d')],'loggedIn':_0x39d681[_0x189f('0x2e')],'pTalking':_0x39d681['pTalking'],'sumBillable':_0x39d681[_0x189f('0x2f')],'sumDuration':_0x39d681[_0x189f('0x30')],'sumHoldTime':_0x39d681['sumHoldTime']||0x0,'talking':_0x39d681[_0x189f('0x31')],'total':_0x39d681[_0x189f('0x32')],'type':_0x39d681['type'],'unmanaged':_0x39d681['unmanaged'],'abandoned':_0x39d681['abandoned'],'waiting':_0x39d681[_0x189f('0x33')],'loggedInDb':_0x39d681[_0x189f('0x34')],'dialActive':_0x39d681[_0x189f('0x35')],'dialMethod':_0x39d681[_0x189f('0x36')],'dialOriginateCallerIdName':_0x39d681['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x39d681['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x39d681[_0x189f('0x37')],'dialPrefix':_0x39d681[_0x189f('0x38')],'outboundAnswerAgiCallsDay':_0x39d681['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x39d681[_0x189f('0x39')],'outboundBlacklistCallsDay':_0x39d681[_0x189f('0x3a')],'outboundBusyCallsDay':_0x39d681[_0x189f('0x3b')],'outboundCongestionCallsDay':_0x39d681[_0x189f('0x3c')],'outboundDropCallsDayACS':_0x39d681['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x39d681['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x39d681[_0x189f('0x3d')],'outboundNoAnswerCallsDay':_0x39d681[_0x189f('0x3e')],'outboundNoSuchCallsDay':_0x39d681[_0x189f('0x3f')],'outboundOriginateFailureCallsDay':_0x39d681[_0x189f('0x40')],'outboundReCallsDay':_0x39d681[_0x189f('0x41')],'outboundRejectCallsDay':_0x39d681[_0x189f('0x42')],'outboundUnknownCallsDay':_0x39d681[_0x189f('0x43')],'outboundAbandonedCallsDay':_0x39d681[_0x189f('0x44')],'predictiveIntervalAnsweredCalls':_0x39d681['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x39d681[_0x189f('0x45')],'predictiveIntervalAvgTalktime':_0x39d681[_0x189f('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x39d681['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x39d681['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x39d681[_0x189f('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x39d681[_0x189f('0x48')],'predictiveIntervalHitRate':_0x39d681[_0x189f('0x49')],'predictiveIntervalMultiplicativeFactor':_0x39d681[_0x189f('0x4a')],'predictiveIntervalPauses':_0x39d681[_0x189f('0x4b')],'predictiveIntervalAvailable':_0x39d681[_0x189f('0x4c')],'predictiveIntervalTotalCalls':_0x39d681[_0x189f('0x4d')],'message':_0x39d681[_0x189f('0x4e')],'originated':_0x39d681[_0x189f('0x4f')],'erlangCalls':_0x39d681['erlangCalls'],'erlangCallToSecond':_0x39d681['erlangCallToSecond'],'erlangAbandonmentRate':_0x39d681[_0x189f('0x50')],'erlangBusyFactor':_0x39d681[_0x189f('0x51')],'startPredictive':_0x39d681[_0x189f('0x52')],'startProgressive':_0x39d681[_0x189f('0x53')]};if(_0x39d681['Trunk']){_0x2dd09e[_0x189f('0x54')]={'id':_0x39d681[_0x189f('0x54')]['id'],'name':_0x39d681['Trunk'][_0x189f('0x55')],'active':_0x39d681[_0x189f('0x54')]['active'],'callerid':_0x39d681['Trunk'][_0x189f('0x56')]};}if(_0x39d681['Interval']){_0x2dd09e['Interval']={'id':_0x39d681['Interval']['id'],'name':_0x39d681[_0x189f('0x57')][_0x189f('0x55')]};}var _0x2e8fb7=md5(JSON[_0x189f('0x58')](_0x2dd09e));if(_0x39d681[_0x189f('0x5')]!==_0x2e8fb7){_0x39d681[_0x189f('0x5')]=_0x2e8fb7;emit(util[_0x189f('0x59')](_0x189f('0x5a'),_0x2dd09e[_0x189f('0x55')]),_0x189f('0x5b'),_0x2dd09e);}}}function emitVoiceQueueChannelRemove(_0x10beb1){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x189f('0x58')](_0x10beb1));emit(util[_0x189f('0x59')]('voice:queue:%s',_0x10beb1[_0x189f('0x55')]),_0x189f('0x5c'),_0x10beb1);io[_0x189f('0x29')](_0x189f('0x5d'),_0x10beb1);}function notSendMessagesQueue(_0x1ef28d){if(_0x1ef28d[_0x189f('0x5e')]){if(_0x1ef28d[_0x189f('0x4f')]===0x0&&_0x1ef28d[_0x189f('0x5f')]===0x0){_0x1ef28d[_0x189f('0x5e')]=![];_0x1ef28d[_0x189f('0x2d')]=0x0;_0x1ef28d[_0x189f('0x60')]=0x0;_0x1ef28d['message']=_0x189f('0x61');ut[_0x189f('0x62')](_0x189f('0x63'),_0x1ef28d['name']+'\x20is\x20not\x20active');}else{_0x1ef28d['message']='IS_DISACTIVED';ut[_0x189f('0x62')](_0x189f('0x63'),_0x1ef28d[_0x189f('0x55')]+'\x20is\x20disactive');}emitCampaignPreview(_0x1ef28d);}}Preview['prototype'][_0x189f('0x64')]=function(){var _0x24bc2e=this;setInterval(function(){_0x24bc2e[_0x189f('0x65')]();},0x7cf);};Preview[_0x189f('0x10')][_0x189f('0x65')]=function(){var _0x334150=this[_0x189f('0x14')];this[_0x189f('0x19')]+=0x1;for(var _0x65b7ab in _0x334150){if(_0x334150[_0x189f('0x66')](_0x65b7ab)&&(_0x334150[_0x65b7ab]['dialMethod']===_0x189f('0x8')||_0x334150[_0x65b7ab]['dialMethod']===_0x189f('0x67'))&&_0x334150[_0x65b7ab][_0x189f('0x2a')]===_0x189f('0x68')){if(this[_0x189f('0x19')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x189f('0x69')]();}}if(_0x334150[_0x189f('0x66')](_0x65b7ab)&&_0x334150[_0x65b7ab]['dialMethod']===_0x189f('0x8')&&_0x334150[_0x65b7ab][_0x189f('0x2a')]===_0x189f('0x68')){if(_0x334150[_0x65b7ab][_0x189f('0x35')]){this[_0x189f('0x6a')](_0x334150[_0x65b7ab]);this[_0x189f('0x6b')](_0x334150[_0x65b7ab]);}else{notSendMessagesQueue(_0x334150[_0x65b7ab]);}}}};Preview['prototype'][_0x189f('0x6c')]=function(_0x2c0687){var _0x27b6a5=this;this[_0x189f('0x13')][_0x189f('0x6d')](function(){if(!_['isNil'](_0x27b6a5[_0x189f('0x17')][_0x2c0687])){loggerAction['info'](_0x189f('0x6e'),_0x2c0687,_0x189f('0x6f'),_0x27b6a5[_0x189f('0x17')][_0x2c0687][_0x189f('0x70')],_0x189f('0x71'),JSON[_0x189f('0x58')](_0x27b6a5[_0x189f('0x14')][_0x27b6a5[_0x189f('0x17')][_0x2c0687]['queue']]['originated']),_0x189f('0x72'),JSON[_0x189f('0x58')](_0x27b6a5[_0x189f('0x14')][_0x27b6a5[_0x189f('0x17')][_0x2c0687][_0x189f('0x70')]][_0x189f('0x5f')]),JSON[_0x189f('0x58')](_0x27b6a5[_0x189f('0x17')][_0x2c0687][_0x189f('0x73')]),JSON[_0x189f('0x58')](_[_0x189f('0x74')](_0x27b6a5[_0x189f('0x17')][_0x2c0687],['contactId',_0x189f('0x75'),_0x189f('0x76'),'ListId'])));return ami['Action']({'action':_0x189f('0x77'),'channel':_0x27b6a5[_0x189f('0x17')][_0x2c0687]['channel']})[_0x189f('0x78')](function(_0x7b3964){if(_0x7b3964[_0x189f('0x4e')]===_0x189f('0x79')){setTimeout(function(){if(_0x27b6a5[_0x189f('0x17')][_0x2c0687]){ut['updateOriginated'](_0x27b6a5[_0x189f('0x14')][_0x27b6a5[_0x189f('0x17')][_0x2c0687][_0x189f('0x70')]],_0x189f('0x7a'));if(_0x27b6a5[_0x189f('0x17')][_0x2c0687][_0x189f('0x73')]===!![]){ut[_0x189f('0x7b')](_0x27b6a5[_0x189f('0x14')][_0x27b6a5[_0x189f('0x17')][_0x2c0687][_0x189f('0x70')]],_0x189f('0x7a'));ut[_0x189f('0x7c')](_0x189f('0x7d')+_0x2c0687,_0x27b6a5[_0x189f('0x17')][_0x2c0687]['queue']);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x2c0687,_0x27b6a5[_0x189f('0x17')][_0x2c0687]['queue']);delete _0x27b6a5[_0x189f('0x17')][_0x2c0687];}},0x2328);}});}});};Preview['prototype'][_0x189f('0x69')]=function(){var _0x2b37a4=this;loggerAction[_0x189f('0x7e')](_0x189f('0x7f'),_['size'](this[_0x189f('0x17')]));for(var _0x189bb7 in this['actions']){if(_0x2b37a4[_0x189f('0x17')][_0x189f('0x66')](_0x189bb7)){_0x2b37a4[_0x189f('0x6c')](_0x189bb7);}}};Preview[_0x189f('0x10')][_0x189f('0x6b')]=function(_0x3c2b51){var _0x3a6a08=this;rpcDb[_0x189f('0x80')](_0x3c2b51['id'],ut[_0x189f('0x81')](this['agents']))[_0x189f('0x82')](function(_0x2f6ad3){if(!_['isNil'](_0x2f6ad3)){for(var _0x3cf82f=0x0;_0x3cf82f<_0x2f6ad3[_0x189f('0x83')];_0x3cf82f+=0x1){if(ut[_0x189f('0x84')](_0x2f6ad3[_0x3cf82f]['scheduledat'])<_0x3c2b51[_0x189f('0x85')]*0x3c){if(_0x2f6ad3[_0x3cf82f][_0x189f('0x86')]&&!_0x2f6ad3[_0x3cf82f][_0x189f('0x86')][_0x189f('0x87')]){_0x3a6a08[_0x189f('0x88')](_0x2f6ad3[_0x3cf82f]['id'])[_0x189f('0x82')](ut[_0x189f('0x89')]('[RecallMe]'))['catch'](ut[_0x189f('0x89')](_0x189f('0x8a')));}else{rpcDb[_0x189f('0x8b')](_0x2f6ad3[_0x3cf82f]['id']);}}else{var _0x5057b2=new Action(_0x2f6ad3[_0x3cf82f],_0x3c2b51);_0x5057b2['starttime']=moment()[_0x189f('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c2b51[_0x189f('0x41')]+=0x1;ut[_0x189f('0x8c')](_0x5057b2,0x17,'RecallInQueue');if(_0x3c2b51[_0x189f('0x8d')]){rpcDb[_0x189f('0x8e')](ut['createBody'](_0x2f6ad3[_0x3cf82f]));rpcDb[_0x189f('0x8f')](_0x5057b2,_0x189f('0x90'));}else{ut[_0x189f('0x8c')](_0x5057b2,0x16,'RecallFailedTimeout');rpcDb[_0x189f('0x8f')](_0x5057b2,_0x189f('0x91'));rpcDb[_0x189f('0x92')](_0x5057b2,_0x189f('0x91'));}}}}})[_0x189f('0x78')](ut[_0x189f('0x89')](_0x189f('0x93')));};Preview[_0x189f('0x10')][_0x189f('0x6a')]=function(_0x452482){_0x452482[_0x189f('0x5e')]=!![];if(ut[_0x189f('0x94')](_0x452482[_0x189f('0x2e')])){_0x452482[_0x189f('0x4e')]=_0x189f('0x95');}else if(!ut['isActive'](_0x452482[_0x189f('0x35')])){_0x452482[_0x189f('0x4e')]='NOT_ACTIVE';}else if(!this[_0x189f('0x96')](_0x452482['Trunk'])){if(!this[_0x189f('0x96')](_0x452482[_0x189f('0x97')])){_0x452482[_0x189f('0x4e')]=_0x189f('0x98');}else{_0x452482['message']='ACTIVE';}}else{_0x452482[_0x189f('0x4e')]=_0x189f('0x99');}emitCampaignPreview(_0x452482);};Preview[_0x189f('0x10')][_0x189f('0x9a')]=function(_0x5eeb5a,_0x2306e6,_0x44323d){var _0x4ebb48=this;var _0x1ede62=this[_0x189f('0x17')][_0x2306e6];var _0x5758ed=this[_0x189f('0x14')][_0x1ede62['queue']];var _0x164385;if(_0x5758ed){switch(_0x44323d){case'1':_0x5758ed[_0x189f('0x3f')]+=0x1;_0x1ede62['countnosuchnumberretry']+=0x1;_0x1ede62[_0x189f('0x9b')]=ut[_0x189f('0x9c')](_0x1ede62);ut[_0x189f('0x8c')](_0x1ede62,0x0,_0x189f('0x9d'));ami[_0x189f('0x29')](_0x189f('0x9e'),ut[_0x189f('0x9f')](_0x1ede62,'nosuchnumber'));rpcDb[_0x189f('0x8f')](_0x1ede62,_0x189f('0xa0'));if(ut[_0x189f('0x9c')](_0x1ede62)>=_0x5758ed['dialGlobalMaxRetry']){_0x164385=ut['cloneAction'](_0x1ede62,0xf,_0x189f('0xa1'));rpcDb[_0x189f('0x92')](_0x164385,_0x189f('0xa2'));}else{if(_0x1ede62[_0x189f('0xa3')]>=_0x5758ed[_0x189f('0xa4')]){rpcDb[_0x189f('0x92')](_0x1ede62,_0x189f('0xa2'));}else{rpcDb[_0x189f('0xa5')](ut[_0x189f('0xa6')](_0x1ede62,_0x189f('0xa3'),_0x5758ed[_0x189f('0xa7')]),_0x1ede62[_0x189f('0xa8')],_0x1ede62['activeContact']);}}delete this['actions'][_0x5eeb5a[_0x189f('0xa9')]];break;case _0x189f('0xaa'):var _0x5d8d75=moment()['format'](_0x189f('0xab'));_0x1ede62['responsetime']=_0x5d8d75;_0x1ede62[_0x189f('0xac')]=_0x5d8d75;_0x1ede62[_0x189f('0x73')]=!![];_0x5758ed['pTalking']+=0x1;logger['info']('[syncHangup][talking][increment]',_0x1ede62[_0x189f('0xad')],_0x189f('0xae'),_0x5758ed[_0x189f('0x55')],_0x189f('0x72'),_0x5758ed[_0x189f('0x5f')]);ami[_0x189f('0x29')](_0x189f('0xaf'),ut[_0x189f('0x9f')](_0x1ede62,'connect',this['campaignsPreview'][_0x1ede62[_0x189f('0x70')]]));if(_0x5758ed['acw']){ami[_0x189f('0x29')](_0x189f('0xb0'),ut[_0x189f('0xb1')](_0x1ede62));}break;case'16':ami[_0x189f('0x29')](_0x189f('0xb2'),ut[_0x189f('0x9f')](_0x1ede62,_0x189f('0xb3'),this[_0x189f('0x14')][_0x1ede62[_0x189f('0x70')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x1ede62,_0x189f('0xb3')));_0x5758ed[_0x189f('0x39')]+=0x1;_0x5758ed[_0x189f('0x32')]+=0x1;_0x5758ed[_0x189f('0x2c')]+=0x1;ut[_0x189f('0x7b')](_0x5758ed,'[16]');_0x1ede62[_0x189f('0x9b')]=ut[_0x189f('0x9c')](_0x1ede62);ut[_0x189f('0x8c')](_0x1ede62,0x4,_0x189f('0xb4'));rpcDb[_0x189f('0x8f')](_0x1ede62,_0x189f('0xb5'));rpcDb[_0x189f('0x92')](_0x1ede62,_0x189f('0xb6'));rpcDb[_0x189f('0xb7')](_0x1ede62);_0x5758ed[_0x189f('0x30')]+=_0x1ede62['talktime'];_0x5758ed['sumBillable']+=_0x1ede62[_0x189f('0xb8')];logger[_0x189f('0x7e')](_0x189f('0xb9'),_0x1ede62[_0x189f('0xad')],_0x189f('0xae'),_0x5758ed[_0x189f('0x55')],_0x189f('0x72'),_0x5758ed[_0x189f('0x5f')]);delete this['actions'][_0x5eeb5a[_0x189f('0xa9')]];break;case _0x189f('0xba'):_0x5758ed[_0x189f('0x3b')]+=0x1;_0x1ede62[_0x189f('0xbb')]+=0x1;_0x1ede62['countglobal']=ut[_0x189f('0x9c')](_0x1ede62);ut[_0x189f('0x8c')](_0x1ede62,0x5,_0x189f('0xbc'));ami[_0x189f('0x29')](_0x189f('0xbd'),ut[_0x189f('0x9f')](_0x1ede62,_0x189f('0xbe')));rpcDb[_0x189f('0x8f')](_0x1ede62,_0x189f('0xbf'));if(ut[_0x189f('0x9c')](_0x1ede62)>=_0x5758ed['dialGlobalMaxRetry']){_0x164385=ut['cloneAction'](_0x1ede62,0xf,'Global');rpcDb[_0x189f('0x92')](_0x164385,_0x189f('0xc0'));}else{if(_0x1ede62[_0x189f('0xbb')]>=_0x5758ed[_0x189f('0xc1')]){rpcDb[_0x189f('0x92')](_0x1ede62,_0x189f('0xbf'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1ede62,_0x189f('0xbb'),_0x5758ed['dialBusyRetryFrequency']),_0x1ede62['unlockAgent'],_0x1ede62['activeContact']);}}break;case _0x189f('0xc2'):_0x5758ed['outboundNoAnswerCallsDay']+=0x1;_0x1ede62[_0x189f('0xc3')]+=0x1;_0x1ede62[_0x189f('0x9b')]=ut['totalGlobal'](_0x1ede62);ut['logCustomer'](_0x1ede62,0x3,_0x189f('0xc4'));ami[_0x189f('0x29')]('custom:agentnoanswer',ut['buildObj'](_0x1ede62,_0x189f('0xc5')));rpcDb[_0x189f('0x8f')](_0x1ede62,_0x189f('0xc6'));if(ut[_0x189f('0x9c')](_0x1ede62)>=_0x5758ed[_0x189f('0xc7')]){_0x164385=ut[_0x189f('0xc8')](_0x1ede62,0xf,_0x189f('0xa1'));rpcDb[_0x189f('0x92')](_0x164385,_0x189f('0xc9'));}else{if(_0x1ede62[_0x189f('0xc3')]>=_0x5758ed[_0x189f('0xca')]){rpcDb[_0x189f('0x92')](_0x1ede62,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0x189f('0xa6')](_0x1ede62,_0x189f('0xc3'),_0x5758ed[_0x189f('0xcb')]),_0x1ede62['unlockAgent'],_0x1ede62[_0x189f('0xcc')]);}}break;case'CONGESTION':_0x5758ed[_0x189f('0x3c')]+=0x1;_0x1ede62['countcongestionretry']+=0x1;_0x1ede62[_0x189f('0x9b')]=ut[_0x189f('0x9c')](_0x1ede62);ut[_0x189f('0x8c')](_0x1ede62,0x8,_0x189f('0xcd'));ami['emit'](_0x189f('0xce'),ut[_0x189f('0x9f')](_0x1ede62,_0x189f('0xcf')));rpcDb[_0x189f('0x8f')](_0x1ede62,_0x189f('0xd0'));if(ut['totalGlobal'](_0x1ede62)>=_0x5758ed[_0x189f('0xc7')]){_0x164385=ut[_0x189f('0xc8')](_0x1ede62,0xf,'Global');rpcDb[_0x189f('0x92')](_0x164385,_0x189f('0xd1'));}else{if(_0x1ede62[_0x189f('0xd2')]>=_0x5758ed[_0x189f('0xd3')]){rpcDb[_0x189f('0x92')](_0x1ede62,_0x189f('0xd0'));}else{rpcDb['rescheduleContact'](ut[_0x189f('0xa6')](_0x1ede62,_0x189f('0xd2'),_0x5758ed[_0x189f('0xd4')]),_0x1ede62[_0x189f('0xa8')],_0x1ede62[_0x189f('0xcc')]);}}break;case _0x189f('0xd5'):_0x5758ed[_0x189f('0x42')]+=0x1;_0x1ede62[_0x189f('0xd6')]+=0x1;_0x1ede62[_0x189f('0x9b')]=ut['totalGlobal'](_0x1ede62);ut[_0x189f('0x8c')](_0x1ede62,0x14,_0x189f('0xd7'));ami[_0x189f('0x29')](_0x189f('0xd8'),ut[_0x189f('0x9f')](_0x1ede62,'agentreject'));rpcDb[_0x189f('0x8f')](_0x1ede62,_0x189f('0xd9'));if(ut[_0x189f('0x9c')](_0x1ede62)>=_0x5758ed[_0x189f('0xc7')]){_0x164385=ut[_0x189f('0xc8')](_0x1ede62,0x14,'AgentReject');rpcDb[_0x189f('0x92')](_0x164385,_0x189f('0xda'));}else{if(_0x1ede62[_0x189f('0xd6')]>=_0x5758ed[_0x189f('0xdb')]){rpcDb['createCustomerFinal'](_0x1ede62,_0x189f('0xda'));}else{rpcDb[_0x189f('0xa5')](ut[_0x189f('0xa6')](_0x1ede62,_0x189f('0xd6'),_0x5758ed[_0x189f('0xdc')]),_0x1ede62['unlockAgent'],_0x1ede62[_0x189f('0xcc')]);}}break;case _0x189f('0xdd'):_0x5758ed[_0x189f('0x44')]+=0x1;_0x1ede62[_0x189f('0xde')]+=0x1;_0x1ede62[_0x189f('0x9b')]=ut[_0x189f('0x9c')](_0x1ede62);ut[_0x189f('0x8c')](_0x1ede62,0xb,'Abandoned');rpcDb[_0x189f('0x8f')](_0x1ede62,_0x189f('0xdf'));if(ut[_0x189f('0x9c')](_0x1ede62)>=_0x5758ed['dialGlobalMaxRetry']){_0x164385=ut[_0x189f('0xc8')](_0x1ede62,0xf,'Global');rpcDb[_0x189f('0x92')](_0x164385,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x1ede62[_0x189f('0xe0')]>=_0x5758ed[_0x189f('0xe1')]){rpcDb[_0x189f('0x92')](_0x1ede62,_0x189f('0xdf'));}else{rpcDb[_0x189f('0xa5')](ut[_0x189f('0xa6')](_0x1ede62,_0x189f('0xde'),_0x5758ed[_0x189f('0xe2')]),_0x1ede62[_0x189f('0xa8')],_0x1ede62['activeContact']);}}break;case'18':_0x5758ed[_0x189f('0x43')]+=0x1;_0x1ede62[_0x189f('0xe3')]+=0x1;_0x1ede62[_0x189f('0x9b')]=ut['totalGlobal'](_0x1ede62);ut[_0x189f('0x8c')](_0x1ede62,0x12,_0x5eeb5a[_0x189f('0xe4')]||_0x5eeb5a[_0x189f('0xe5')]);ami[_0x189f('0x29')](_0x189f('0xe6'),ut['buildObj'](_0x1ede62,_0x189f('0xe7')));rpcDb['createCustomerHistory'](_0x1ede62,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x189f('0x9c')](_0x1ede62)>=_0x5758ed[_0x189f('0xc7')]){_0x164385=ut['cloneAction'](_0x1ede62,0xf,_0x189f('0xa1'));rpcDb[_0x189f('0x92')](_0x164385,_0x189f('0xe8'));}else{rpcDb[_0x189f('0x92')](_0x1ede62,_0x189f('0xe8'));}delete this[_0x189f('0x17')][_0x5eeb5a[_0x189f('0xa9')]];break;case'19':_0x5758ed[_0x189f('0x43')]+=0x1;_0x1ede62['countglobal']=ut['totalGlobal'](_0x1ede62);ut[_0x189f('0x8c')](_0x1ede62,0x13,_0x5eeb5a[_0x189f('0xe4')]||_0x5eeb5a[_0x189f('0xe5')]);ami[_0x189f('0x29')](_0x189f('0xe6'),ut[_0x189f('0x9f')](_0x1ede62,_0x189f('0xe7')));rpcDb[_0x189f('0x8f')](_0x1ede62,_0x189f('0xe9'));if(ut[_0x189f('0x9c')](_0x1ede62)>=_0x5758ed[_0x189f('0xc7')]){_0x164385=ut[_0x189f('0xc8')](_0x1ede62,0xf,_0x189f('0xa1'));rpcDb[_0x189f('0x92')](_0x164385,_0x189f('0xe9'));}else{rpcDb[_0x189f('0x92')](_0x1ede62,'[callProgressDetectingCustomer][machine]');}delete this[_0x189f('0x17')][_0x5eeb5a[_0x189f('0xa9')]];break;default:if(_0x1ede62[_0x189f('0x73')]){ut[_0x189f('0x7b')](_0x5758ed,'[default]');ut[_0x189f('0x7c')](_0x189f('0xea')+_0x5758ed[_0x189f('0x55')],_0x5eeb5a);}_0x5758ed[_0x189f('0x43')]+=0x1;_0x1ede62[_0x189f('0x9b')]=ut['totalGlobal'](_0x1ede62);ut['logCustomer'](_0x1ede62,0xc,_0x5eeb5a['cause-txt']||_0x5eeb5a[_0x189f('0xe5')]);rpcDb[_0x189f('0x8f')](_0x1ede62,_0x189f('0xeb'));if(ut[_0x189f('0x9c')](_0x1ede62)>=_0x5758ed[_0x189f('0xc7')]){_0x164385=ut[_0x189f('0xc8')](_0x1ede62,0xf,_0x189f('0xa1'));rpcDb[_0x189f('0x92')](_0x164385,_0x189f('0xec'));}else{rpcDb[_0x189f('0x92')](_0x1ede62,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x189f('0x17')][_0x5eeb5a[_0x189f('0xa9')]];}if(!(_0x1ede62[_0x189f('0x73')]&&_0x44323d==='16')){ut[_0x189f('0xed')](_0x5758ed,_0x189f('0xee'));logger[_0x189f('0x7e')](_0x189f('0xef'),_0x1ede62[_0x189f('0xad')],_0x189f('0xae'),_0x5758ed[_0x189f('0x55')],_0x189f('0x71'),_0x5758ed['originated']);}if(_0x44323d!=='ANSWER'){delete this[_0x189f('0x17')][_0x5eeb5a[_0x189f('0xa9')]];delete this[_0x189f('0x17')][_0x5eeb5a[_0x189f('0xf0')]];}}};Preview[_0x189f('0x10')][_0x189f('0xf1')]=function(_0x1cc756,_0x586cf7,_0x2e2b9e){if(_[_0x189f('0xf2')](_0x586cf7)&&_0x189f('0xf3')!==typeof _0x586cf7){return;}if(_[_0x189f('0xf2')](_0x2e2b9e)&&_0x189f('0xf3')!==typeof _0x2e2b9e){return;}switch(_0x2e2b9e[_0x189f('0xf4')]){case'0':ut[_0x189f('0xf5')](_0x1cc756,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x1cc756,_0x189f('0xf6'));break;case'3':ut[_0x189f('0xf5')](_0x1cc756,0x3,_0x189f('0xc4'));rpcDb[_0x189f('0xf7')](_0x1cc756,_0x189f('0xf8'));break;case'5':ut[_0x189f('0xf5')](_0x1cc756,0x5,_0x189f('0xbc'));rpcDb[_0x189f('0xf7')](_0x1cc756,_0x189f('0xf9'));break;case'8':ut[_0x189f('0xf5')](_0x1cc756,0x8,_0x189f('0xcd'));rpcDb['createAgentHistory'](_0x1cc756,_0x189f('0xfa'));break;case'22':ut[_0x189f('0xf5')](_0x1cc756,0x16,_0x189f('0xfb'));rpcDb['createAgentHistory'](_0x1cc756,_0x189f('0xfc'));break;default:ut[_0x189f('0xf5')](_0x1cc756,0xc,_0x2e2b9e[_0x189f('0xf4')]);rpcDb['createAgentHistory'](_0x1cc756,_0x189f('0xfa'));}ut[_0x189f('0xed')](_0x586cf7,_0x189f('0xfd'));logger[_0x189f('0x7e')]('[originated][decrement][callProgressDetectingAgent]',_0x1cc756[_0x189f('0xad')],_0x189f('0xae'),_0x586cf7[_0x189f('0x55')],_0x189f('0x71'),_0x586cf7[_0x189f('0x4f')]);delete this[_0x189f('0x17')][_0x1cc756[_0x189f('0xad')]];};Preview[_0x189f('0x10')][_0x189f('0xfe')]=function(_0x581546,_0x441d7d,_0x220a70,_0x51eb33,_0x3b755e){var _0x5353d6=this;return new BPromise(function(_0x523910,_0x380bd8){if(_[_0x189f('0xff')](_0x441d7d)||_[_0x189f('0xff')](_0x441d7d['Contact'])||_[_0x189f('0xff')](_0x441d7d[_0x189f('0x100')][_0x189f('0x101')])||_[_0x189f('0xff')](_0x441d7d[_0x189f('0x76')])){_0x380bd8(ut[_0x189f('0x4e')](_0x189f('0x102'),_0x51eb33,_0x3b755e));return;}var _0xd7b94=uuid['v4']();var _0x52a9c2=_0x5353d6[_0x189f('0x14')][_0x441d7d[_0x189f('0x6f')][_0x189f('0x55')]];var _0x52a49e=_0x220a70?_0x5353d6[_0x189f('0x18')][_0x220a70]['id']:undefined;_0x5353d6[_0x189f('0x17')][_0xd7b94]=new Action(_0x441d7d,_0x52a9c2,_0xd7b94,_0x220a70,_0x52a49e);var _0x8c83a0=_0x5353d6['actions'][_0xd7b94];_0x8c83a0[_0x189f('0xa8')]=_0x51eb33;_0x8c83a0[_0x189f('0xcc')]=_0x3b755e;_0x8c83a0['lookAgent']=_0x220a70;if(_[_0x189f('0x103')](_0x581546)){_0x5353d6[_0x189f('0x104')](_0x8c83a0,_0x52a9c2,_0x441d7d,_0x220a70)[_0x189f('0x82')](function(_0x2f405d){logger[_0x189f('0x7e')](_0x189f('0x105'),_0x189f('0x106')+_0x8c83a0[_0x189f('0x70')]+_0x189f('0x107')+_0x8c83a0['idContact'],JSON[_0x189f('0x58')](_0x2f405d));ami['emit']('custom:agentcalled',ut['buildObj'](_0x8c83a0,_0x189f('0x108'),_0x5353d6['campaignsPreview'][_0x8c83a0[_0x189f('0x70')]]));_0x523910(ut[_0x189f('0x4e')](_0x189f('0x109')));})['catch'](function(_0x178375){ut[_0x189f('0x62')](_0x189f('0x10a'),_0x178375);_0x380bd8(ut[_0x189f('0x4e')](_0x189f('0x10b'),_0x51eb33,_0x3b755e));});}else{_0x52a9c2[_0x189f('0x3a')]+=0x1;ut[_0x189f('0x10c')](_0x8c83a0);rpcDb[_0x189f('0x10d')](_0x8c83a0,_0x189f('0x10e'));delete _0x5353d6[_0x189f('0x17')][_0xd7b94];_0x380bd8(ut[_0x189f('0x4e')]('Contact\x20in\x20black\x20List',_0x51eb33,_0x3b755e));}});};Preview[_0x189f('0x10')]['isTrunkReachable']=function(_0x5e326e){return!_[_0x189f('0xff')](_0x5e326e)&&!_[_0x189f('0xff')](_0x5e326e['name'])&&!_[_0x189f('0xff')](_0x5e326e[_0x189f('0x10f')])&&_0x5e326e['active']&&!_[_0x189f('0xff')](this[_0x189f('0x16')][util[_0x189f('0x59')]('SIP/%s',_0x5e326e[_0x189f('0x55')])])&&!_[_0x189f('0xff')](this[_0x189f('0x16')][util['format'](_0x189f('0x110'),_0x5e326e[_0x189f('0x55')])][_0x189f('0x77')])&&(this[_0x189f('0x16')][util[_0x189f('0x59')](_0x189f('0x110'),_0x5e326e[_0x189f('0x55')])]['status']===_0x189f('0x111')||this['trunks'][util['format'](_0x189f('0x110'),_0x5e326e[_0x189f('0x55')])]['status']===_0x189f('0x112'));};Preview[_0x189f('0x10')][_0x189f('0x88')]=function(_0xb3c41b,_0x574cec){var _0x3cd609=this;return new BPromise(function(_0x59464d,_0x40005e){_0x3cd609[_0x189f('0x113')](_0xb3c41b,_0x574cec)['then'](function(_0x344ef4){_0x59464d(_[_0x189f('0x74')](_0x344ef4,['message']));})[_0x189f('0x78')](function(_0x43717b){if(_0x43717b[_0x189f('0x114')]){rpcDb[_0x189f('0x115')](_0xb3c41b);}if(_0x43717b['active']){rpcDb[_0x189f('0x8b')](_0xb3c41b);}_0x40005e(_[_0x189f('0x74')](_0x43717b,['message']));});});};Preview['prototype'][_0x189f('0x113')]=function(_0x4d0aaf,_0x528bdb){var _0x56c0c2=this;return new BPromise(function(_0x365c44,_0x1e37d5){var _0x4f6444,_0x565065;rpcDb[_0x189f('0x116')](_0x4d0aaf)[_0x189f('0x82')](function(_0x3cdea6){if(!_['isNil'](_0x3cdea6[0x0])){_0x565065=_0x3cdea6[0x0]['recallme']?![]:!![];_0x4f6444=_0x3cdea6[0x0][_0x189f('0x117')]?!![]:![];_0x4f6444=_0x528bdb?!![]:_0x4f6444;}var _0x2031be=_0x56c0c2[_0x189f('0x118')](_0x3cdea6);if(_0x2031be[_0x189f('0x119')]){rpcDb['checkIsBlackList'](_[_0x189f('0x74')](_0x3cdea6[0x0],['VoiceQueueId',_0x189f('0x11a')]))['then'](function(_0x3fdb93){_0x56c0c2[_0x189f('0xfe')](_0x3fdb93,_0x3cdea6[0x0],_0x528bdb,_0x565065,_0x4f6444)[_0x189f('0x82')](function(_0x3ba6d1){_0x365c44(_0x3ba6d1);})[_0x189f('0x78')](function(_0x1c6a92){_0x1e37d5(_0x1c6a92);});})[_0x189f('0x78')](function(_0x27e01f){ut[_0x189f('0x62')](_0x189f('0x11b'),_0x27e01f);_0x1e37d5(ut[_0x189f('0x4e')](_0x189f('0x11c'),_0x565065,_0x4f6444));});}else{_0x1e37d5(ut[_0x189f('0x4e')](_0x2031be[_0x189f('0x4e')],_0x565065,_0x4f6444));}})[_0x189f('0x78')](function(_0x435597){ut['logger'](_0x189f('0x11d'),_0x435597);_0x1e37d5(ut['message'](_0x189f('0x11c'),![],!![]));});});};Preview['prototype'][_0x189f('0x118')]=function(_0x2d72a8){if(_[_0x189f('0xff')](_0x2d72a8)||_[_0x189f('0x103')](_0x2d72a8)||!_[_0x189f('0xff')](_0x2d72a8[0x0][_0x189f('0x86')])&&_[_0x189f('0xff')](_0x2d72a8[0x0][_0x189f('0x86')]['name'])){ut[_0x189f('0x62')]('[Preview][validateContact][Empty\x20Contact]',_0x2d72a8);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x1dabe8=this[_0x189f('0x14')][_0x2d72a8[0x0]['Queue'][_0x189f('0x55')]];_0x1dabe8['message']=_0x189f('0x99');if(_['isNil'](_0x1dabe8)){ut[_0x189f('0x62')](_0x189f('0x11e'),_0x1dabe8);return{'isValid':![],'message':_0x189f('0x11f')};}if(!this[_0x189f('0x96')](_0x1dabe8[_0x189f('0x54')])){ut[_0x189f('0x62')](_0x189f('0x120'),_0x189f('0x121')+_0x1dabe8[_0x189f('0x55')]+_0x189f('0x122'));if(!this[_0x189f('0x96')](_0x1dabe8[_0x189f('0x97')])){ut[_0x189f('0x62')](_0x189f('0x120'),_0x1dabe8[_0x189f('0x55')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x189f('0x123')};}}if(!ut[_0x189f('0x124')](_0x1dabe8[_0x189f('0x35')])){ut[_0x189f('0x62')](_0x189f('0x125'),_0x1dabe8['name']+_0x189f('0x126'));return{'isValid':![],'message':_0x189f('0x121')+_0x1dabe8[_0x189f('0x55')]+_0x189f('0x126')};}return{'isValid':!![],'message':_0x189f('0x127')};};Preview[_0x189f('0x10')][_0x189f('0x104')]=function(_0x19f58a,_0x361b96,_0x47f672,_0x36a729){var _0x111eb2=this;return new BPromise(function(_0x4e1eed,_0x2e1780){var _0x478b17=_0x19f58a[_0x189f('0xad')];var _0xe4b214=_0x111eb2[_0x189f('0x96')](_0x361b96[_0x189f('0x54')])?util[_0x189f('0x59')](_0x189f('0x128'),_0x361b96['Trunk']['name'],_[_0x189f('0xff')](_0x361b96[_0x189f('0x38')])?'':_0x361b96[_0x189f('0x38')][_0x189f('0x129')]()||'',_0x361b96[_0x189f('0x12a')]>0x0?_0x47f672[_0x189f('0x100')][_0x189f('0x101')][_0x189f('0x12b')](_0x361b96[_0x189f('0x12a')]):_0x47f672[_0x189f('0x100')][_0x189f('0x101')]):util[_0x189f('0x59')](_0x189f('0x128'),_[_0x189f('0xff')](_0x361b96[_0x189f('0x97')])?_0x361b96['Trunk'][_0x189f('0x55')]:_0x361b96['TrunkBackup'][_0x189f('0x55')],_[_0x189f('0xff')](_0x361b96[_0x189f('0x38')])?'':_0x361b96[_0x189f('0x38')][_0x189f('0x129')]()||'',_0x361b96[_0x189f('0x12a')]>0x0?_0x47f672[_0x189f('0x100')][_0x189f('0x101')][_0x189f('0x12b')](_0x361b96[_0x189f('0x12a')]):_0x47f672['Contact'][_0x189f('0x101')]);var _0x4df628=_0x111eb2['isTrunkReachable'](_0x361b96[_0x189f('0x54')])?ut['getCallerId'](_0x361b96[_0x189f('0x54')][_0x189f('0x56')],_0x361b96[_0x189f('0x12c')],_0x361b96[_0x189f('0x12d')]>0x0?ut['getCallerIdRandom'](_0x361b96[_0x189f('0x12e')],_0x361b96[_0x189f('0x12d')]):_0x361b96[_0x189f('0x12e')]):ut[_0x189f('0x12f')](_[_0x189f('0xff')](_0x361b96[_0x189f('0x97')])?_0x361b96[_0x189f('0x54')][_0x189f('0x56')]:_0x361b96['TrunkBackup']['callerid'],_0x361b96[_0x189f('0x12c')],_0x361b96[_0x189f('0x12d')]>0x0?ut[_0x189f('0x130')](_0x361b96['dialOriginateCallerIdNumber'],_0x361b96[_0x189f('0x12d')]):_0x361b96['dialOriginateCallerIdNumber']);if(_0x4df628){_0x19f58a[_0x189f('0x131')]=ut[_0x189f('0x132')](_0x4df628);_0x19f58a[_0x189f('0x133')]=ut[_0x189f('0x134')](_0x4df628);}var _0x2f85fb=ut['addVariables'](_0x361b96,_0x47f672,_0xe4b214,_0x4df628,_0x478b17,_0x19f58a);_['merge'](_0x19f58a,ut[_0x189f('0x135')](_0x2f85fb));_0x19f58a[_0x189f('0x136')]=moment()[_0x189f('0x59')](_0x189f('0xab'));ami['Action'](ut[_0x189f('0x137')](_0x19f58a,_0x361b96,_0x2f85fb,_0x19f58a[_0x189f('0xcc')],_0x36a729))[_0x189f('0x82')](function(_0x182327){var _0x571232=_0x19f58a[_0x189f('0x138')];if(!_[_0x189f('0xff')](_0x571232)){if(!_[_0x189f('0xff')](_0x111eb2[_0x189f('0x18')][_0x571232])){_0x111eb2[_0x189f('0x18')][_0x571232][_0x189f('0x139')]=_0x19f58a[_0x189f('0x13a')];emit(util['format'](_0x189f('0x13b'),_0x111eb2[_0x189f('0x18')][_0x571232]['name']),_0x189f('0x13c'),{'destaccountcode':_0x111eb2[_0x189f('0x18')][_0x571232][_0x189f('0x13d')],'destconnectedlinenum':_0x19f58a['calleridnum']});}}_0x361b96[_0x189f('0x4f')]+=0x1;logger[_0x189f('0x7e')]('[originated][increment]',_0x478b17,_0x189f('0xae'),_0x361b96[_0x189f('0x55')],_0x189f('0x71'),_0x361b96['originated']);_0x4e1eed(_0x182327);})[_0x189f('0x78')](function(_0x4fd773){ut[_0x189f('0xf5')](_0x19f58a,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x19f58a,'[originateFailure][logOriginateFailure]');_0x2e1780(_0x4fd773);});});};Preview[_0x189f('0x10')][_0x189f('0x23')]=function(_0x1363a5){if(this['actions'][_0x1363a5[_0x189f('0xa9')]]){this[_0x189f('0x17')][_0x1363a5[_0x189f('0xa9')]][_0x189f('0x13e')]=_0x1363a5['channel'];}};Preview[_0x189f('0x10')][_0x189f('0x1b')]=function(_0x4db388){var _0x5ba89b=this;var _0x3c23f2=this[_0x189f('0x17')][_0x4db388[_0x189f('0x13f')]];if(_0x3c23f2){if(_0x3c23f2[_0x189f('0x140')]&&this[_0x189f('0x18')][_0x3c23f2[_0x189f('0x140')]]){ut[_0x189f('0x141')](_0x3c23f2,this['agents'][_0x3c23f2[_0x189f('0x140')]]['name'],this[_0x189f('0x18')][_0x3c23f2[_0x189f('0x140')]]['id']);}var _0x3c4174=_['clone'](_0x3c23f2);_0x3c4174[_0x189f('0x142')]=moment()[_0x189f('0x59')](_0x189f('0xab'));var _0x3bf240=_0x5ba89b[_0x189f('0x14')][_0x3c23f2[_0x189f('0x70')]];if(ut[_0x189f('0x143')](_0x4db388['response'])){if(_0x3c23f2[_0x189f('0xa8')]){rpcDb['unlockContact'](_0x3c23f2[_0x189f('0x144')]);}if(_0x3c23f2['activeContact']){rpcDb[_0x189f('0x8b')](_0x3c23f2[_0x189f('0x144')]);}ami[_0x189f('0x29')](_0x189f('0x145'),ut[_0x189f('0x9f')](_0x3c23f2,_0x189f('0x146'),this[_0x189f('0x14')][_0x3c23f2[_0x189f('0x70')]]));this['callProgressDetectingAgent'](_0x3c4174,_0x3bf240,_0x4db388);}else{_0x3c23f2['starttime']=moment()[_0x189f('0x59')](_0x189f('0xab'));ut[_0x189f('0xf5')](_0x3c4174,0x4,_0x189f('0xb4'));rpcDb[_0x189f('0xf7')](_0x3c4174,_0x189f('0x147'));}}};Preview[_0x189f('0x10')][_0x189f('0x1e')]=function(_0xc5076a){var _0x577500=this;var _0x21355e=this['actions'][_0xc5076a[_0x189f('0xa9')]];var _0x4fec53;if(_0x21355e){_0x4fec53=this[_0x189f('0x14')][_0x21355e[_0x189f('0x70')]];logger[_0x189f('0x7e')](_0x189f('0x148'),_0xc5076a['linkedid'],_0x189f('0xae'),_0x4fec53[_0x189f('0x55')],_0x189f('0x72'),_0x4fec53[_0x189f('0x5f')]);}if(this[_0x189f('0x17')][_0xc5076a[_0x189f('0xa9')]]&&_0xc5076a[_0x189f('0xa9')]!==_0xc5076a['uniqueid']){if(_0xc5076a[_0x189f('0x149')]==='16'&&this[_0x189f('0x17')][_0xc5076a[_0x189f('0xa9')]]['dialAnswer']){this[_0x189f('0x9a')](_0xc5076a,_0xc5076a[_0x189f('0xa9')],_0xc5076a[_0x189f('0x149')]);}else if(this[_0x189f('0x17')][_0xc5076a[_0x189f('0xa9')]][_0x189f('0x73')]){logger['info'](_0x189f('0x14a'),_0xc5076a[_0x189f('0xa9')],_0xc5076a[_0x189f('0x149')],_0x189f('0xae'),_0x4fec53[_0x189f('0x55')],'pTalking:\x20',_0x4fec53[_0x189f('0x5f')]);this[_0x189f('0x9a')](_0xc5076a,_0xc5076a[_0x189f('0xa9')],_0xc5076a[_0x189f('0x149')]);}}else if(_0x21355e&&_[_0x189f('0xff')](_0x21355e[_0x189f('0x14b')])&&_0x4fec53[_0x189f('0x14c')]&&_0xc5076a[_0x189f('0xa9')]===_0xc5076a['uniqueid']&&_[_0x189f('0xff')](_0xc5076a[_0x189f('0xf4')])&&_0xc5076a[_0x189f('0x149')]==='16'&&_0xc5076a[_0x189f('0x14d')]==='6'&&_[_0x189f('0xf2')](_0x21355e['transfer'])){if(_0x21355e['unlockAgent']){rpcDb[_0x189f('0x115')](_0x21355e[_0x189f('0x144')]);}if(_0x21355e[_0x189f('0xcc')]){rpcDb[_0x189f('0x8b')](_0x21355e[_0x189f('0x144')]);}_0xc5076a['reason']='22';this[_0x189f('0xf1')](_0x21355e,_0x4fec53,_0xc5076a);}else if(_0x21355e&&_0x21355e['transfer']){if(_0xc5076a['cause']==='16'&&this[_0x189f('0x17')][_0xc5076a['linkedid']][_0x189f('0x73')]){logger['info']('[syncHangup][talking][transfer]',_0xc5076a[_0x189f('0xa9')],_0xc5076a[_0x189f('0x149')],_0x189f('0xae'),_0x4fec53[_0x189f('0x55')],_0x189f('0x72'),_0x4fec53['pTalking']);this[_0x189f('0x9a')](_0xc5076a,_0xc5076a[_0x189f('0xa9')],_0xc5076a[_0x189f('0x149')]);}else if(this[_0x189f('0x17')][_0xc5076a[_0x189f('0xa9')]]['dialAnswer']){logger[_0x189f('0x7e')](_0x189f('0x14a'),_0xc5076a[_0x189f('0xa9')],_0xc5076a[_0x189f('0x149')],'\x20Queue',_0x4fec53[_0x189f('0x55')],_0x189f('0x72'),_0x4fec53[_0x189f('0x5f')]);this[_0x189f('0x9a')](_0xc5076a,_0xc5076a['linkedid'],_0xc5076a[_0x189f('0x149')]);}}};Preview[_0x189f('0x10')][_0x189f('0x21')]=function(_0x2a2b36){if(this[_0x189f('0x17')][_0x2a2b36[_0x189f('0xf0')]]&&_0x2a2b36[_0x189f('0xf0')]!==_0x2a2b36[_0x189f('0x14e')]){this[_0x189f('0x9a')](_0x2a2b36,_0x2a2b36[_0x189f('0xf0')],_0x2a2b36['dialstatus']);}};Preview[_0x189f('0x10')][_0x189f('0x1f')]=function(_0x5ef436){if(this[_0x189f('0x17')][_0x5ef436[_0x189f('0xa9')]]&&_0x5ef436[_0x189f('0xa9')]!==_0x5ef436[_0x189f('0xad')]&&!this[_0x189f('0x17')][_0x5ef436[_0x189f('0xa9')]][_0x189f('0x73')]){if(_0x5ef436[_0x189f('0x149')]==='1'){this['callProgressDetectingCustomer'](_0x5ef436,_0x5ef436[_0x189f('0xa9')],_0x5ef436[_0x189f('0x149')]);}}};Preview['prototype'][_0x189f('0x14f')]=function(_0x5f4a96,_0x5b447a,_0x5d0d65){if(this['actions'][_0x5f4a96]){if(_[_0x189f('0xff')](this['actions'][_0x5f4a96][_0x189f('0x150')])){this[_0x189f('0x17')][_0x5f4a96][_0x189f('0x150')]={};}this[_0x189f('0x17')][_0x5f4a96]['variables'][_0x5b447a]=_0x5d0d65;}};Preview[_0x189f('0x10')]['syncVarSet']=function(_0x4d8da3){try{if(!_[_0x189f('0xff')](_0x4d8da3)){if(ut['filterKey'](_['keys'](_0x4d8da3[_0x189f('0x151')])[0x0])){this[_0x189f('0x14f')](_0x4d8da3[_0x189f('0xad')],_[_0x189f('0x152')](_0x4d8da3[_0x189f('0x151')])[0x0],_0x4d8da3[_0x189f('0x153')]);}}}catch(_0x19342e){logger[_0x189f('0x154')](_0x189f('0x155'),util[_0x189f('0x156')](_0x19342e,{'showHidden':![],'depth':null}));}};Preview[_0x189f('0x10')]['syncAttendedTransfer']=function(_0x539019){if(_0x539019){if(this[_0x189f('0x17')][_0x539019['transfertargetlinkedid']]){this[_0x189f('0x17')][_0x539019[_0x189f('0x157')]][_0x189f('0x158')]=!![];}}};Preview[_0x189f('0x10')][_0x189f('0x28')]=function(_0x293a4d){if(_0x293a4d){if(this[_0x189f('0x17')][_0x293a4d[_0x189f('0x159')]]){this[_0x189f('0x17')][_0x293a4d[_0x189f('0x159')]][_0x189f('0x158')]=!![];}}};module[_0x189f('0x15a')]=Preview; \ No newline at end of file +var _0xc021=['outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','Interval','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','emit','voice_queue_presence:remove','originated','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','info','size','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','[RecallMe]','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','createCustomerFinal','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','sumBillable','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','AgentReject','custom:agentreject','agentreject','countagentrejectretry','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','TrunkBackup','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','responsetime','isFailure','unlockContact','custom:agentringnoanswer','rejected','syncHangup','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','isUndefined','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','type','outbound','name','strategy','available','loggedIn','pTalking','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay'];(function(_0x5c466f,_0x5eaeca){var _0x215950=function(_0x276be4){while(--_0x276be4){_0x5c466f['push'](_0x5c466f['shift']());}};_0x215950(++_0x5eaeca);}(_0xc021,0x11c));var _0x1c02=function(_0x494739,_0x4fe52f){_0x494739=_0x494739-0x0;var _0x299203=_0xc021[_0x494739];return _0x299203;};'use strict';var util=require(_0x1c02('0x0'));var _=require(_0x1c02('0x1'));var BPromise=require(_0x1c02('0x2'));var uuid=require('uuid');var moment=require(_0x1c02('0x3'));var md5=require(_0x1c02('0x4'));var Redis=require('ioredis');var config=require(_0x1c02('0x5'));var logger=require(_0x1c02('0x6'))(_0x1c02('0x7'));var loggerAction=require(_0x1c02('0x6'))(_0x1c02('0x8'));var ami=require(_0x1c02('0x9'));var rpcDb=require(_0x1c02('0xa'));var Action=require('./action');var ut=require(_0x1c02('0xb'));config['redis']=_[_0x1c02('0xc')](config[_0x1c02('0xd')],{'host':_0x1c02('0xe'),'port':0x18eb});var io=require(_0x1c02('0xf'))(new Redis(config[_0x1c02('0xd')]));var Sequence=function(){};Sequence['prototype'][_0x1c02('0x10')]=function(_0x21d57a){this['tail']=this[_0x1c02('0x11')]?this['tail'][_0x1c02('0x12')](_0x21d57a):_0x21d57a();};function Preview(_0x21153d){this[_0x1c02('0x13')]=new Sequence();this['campaignsPreview']=_0x21153d[_0x1c02('0x14')];this[_0x1c02('0x15')]=_0x21153d[_0x1c02('0x15')];this[_0x1c02('0x16')]={};this[_0x1c02('0x17')]=_0x21153d['agents'];this[_0x1c02('0x18')]=0x0;ami['on'](_0x1c02('0x19'),this['syncOriginateResponse'][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x1b'),this['syncHangup'][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x1c'),this[_0x1c02('0x1d')][_0x1c02('0x1a')](this));ami['on']('dialend',this[_0x1c02('0x1e')][_0x1c02('0x1a')](this));ami['on']('newexten',this[_0x1c02('0x1f')][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x20'),this[_0x1c02('0x21')][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x22'),this[_0x1c02('0x23')][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x24'),this[_0x1c02('0x25')][_0x1c02('0x1a')](this));this[_0x1c02('0x26')](this[_0x1c02('0x27')]);}function emit(_0x19867e,_0x224aa3,_0x5270ac){io['to'](_0x19867e)['emit'](_0x224aa3,_0x5270ac);}function emitCampaignPreview(_0x411e12){if(_0x411e12[_0x1c02('0x28')]===_0x1c02('0x29')){var _0x109676={'id':_0x411e12['id'],'name':_0x411e12[_0x1c02('0x2a')],'strategy':_0x411e12[_0x1c02('0x2b')],'answered':_0x411e12['answered'],'available':_0x411e12[_0x1c02('0x2c')],'loggedIn':_0x411e12[_0x1c02('0x2d')],'pTalking':_0x411e12[_0x1c02('0x2e')],'sumBillable':_0x411e12['sumBillable'],'sumDuration':_0x411e12['sumDuration'],'sumHoldTime':_0x411e12['sumHoldTime']||0x0,'talking':_0x411e12[_0x1c02('0x2f')],'total':_0x411e12[_0x1c02('0x30')],'type':_0x411e12['type'],'unmanaged':_0x411e12[_0x1c02('0x31')],'abandoned':_0x411e12[_0x1c02('0x32')],'waiting':_0x411e12[_0x1c02('0x33')],'loggedInDb':_0x411e12[_0x1c02('0x34')],'dialActive':_0x411e12[_0x1c02('0x35')],'dialMethod':_0x411e12[_0x1c02('0x36')],'dialOriginateCallerIdName':_0x411e12[_0x1c02('0x37')],'dialOriginateCallerIdNumber':_0x411e12['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x411e12[_0x1c02('0x38')],'dialPrefix':_0x411e12[_0x1c02('0x39')],'outboundAnswerAgiCallsDay':_0x411e12[_0x1c02('0x3a')],'outboundAnswerCallsDay':_0x411e12[_0x1c02('0x3b')],'outboundBlacklistCallsDay':_0x411e12[_0x1c02('0x3c')],'outboundBusyCallsDay':_0x411e12[_0x1c02('0x3d')],'outboundCongestionCallsDay':_0x411e12['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x411e12['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x411e12[_0x1c02('0x3e')],'outboundDropCallsDayTimeout':_0x411e12['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x411e12['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x411e12[_0x1c02('0x3f')],'outboundOriginateFailureCallsDay':_0x411e12[_0x1c02('0x40')],'outboundReCallsDay':_0x411e12[_0x1c02('0x41')],'outboundRejectCallsDay':_0x411e12[_0x1c02('0x42')],'outboundUnknownCallsDay':_0x411e12[_0x1c02('0x43')],'outboundAbandonedCallsDay':_0x411e12[_0x1c02('0x44')],'predictiveIntervalAnsweredCalls':_0x411e12[_0x1c02('0x45')],'predictiveIntervalAvgHoldtime':_0x411e12[_0x1c02('0x46')],'predictiveIntervalAvgTalktime':_0x411e12[_0x1c02('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x411e12[_0x1c02('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x411e12[_0x1c02('0x49')],'predictiveIntervalErlangCalls':_0x411e12[_0x1c02('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x411e12[_0x1c02('0x4b')],'predictiveIntervalHitRate':_0x411e12[_0x1c02('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x411e12[_0x1c02('0x4d')],'predictiveIntervalPauses':_0x411e12['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x411e12['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x411e12[_0x1c02('0x4e')],'message':_0x411e12['message'],'originated':_0x411e12['originated'],'erlangCalls':_0x411e12['erlangCalls'],'erlangCallToSecond':_0x411e12[_0x1c02('0x4f')],'erlangAbandonmentRate':_0x411e12[_0x1c02('0x50')],'erlangBusyFactor':_0x411e12[_0x1c02('0x51')],'startPredictive':_0x411e12[_0x1c02('0x52')],'startProgressive':_0x411e12['startProgressive']};if(_0x411e12[_0x1c02('0x53')]){_0x109676[_0x1c02('0x53')]={'id':_0x411e12['Trunk']['id'],'name':_0x411e12['Trunk']['name'],'active':_0x411e12[_0x1c02('0x53')][_0x1c02('0x54')],'callerid':_0x411e12[_0x1c02('0x53')]['callerid']};}if(_0x411e12[_0x1c02('0x55')]){_0x109676[_0x1c02('0x55')]={'id':_0x411e12[_0x1c02('0x55')]['id'],'name':_0x411e12['Interval'][_0x1c02('0x2a')]};}var _0x1cd1d3=md5(JSON['stringify'](_0x109676));if(_0x411e12['md5']!==_0x1cd1d3){_0x411e12[_0x1c02('0x4')]=_0x1cd1d3;emit(util[_0x1c02('0x56')](_0x1c02('0x57'),_0x109676['name']),_0x1c02('0x58'),_0x109676);}}}function emitVoiceQueueChannelRemove(_0x508f99){logger['info'](_0x1c02('0x59'),JSON[_0x1c02('0x5a')](_0x508f99));emit(util[_0x1c02('0x56')]('voice:queue:%s',_0x508f99[_0x1c02('0x2a')]),_0x1c02('0x5b'),_0x508f99);io[_0x1c02('0x5c')](_0x1c02('0x5d'),_0x508f99);}function notSendMessagesQueue(_0x59b192){if(_0x59b192['sendMessageOneNotActive']){if(_0x59b192[_0x1c02('0x5e')]===0x0&&_0x59b192['pTalking']===0x0){_0x59b192[_0x1c02('0x5f')]=![];_0x59b192[_0x1c02('0x2c')]=0x0;_0x59b192[_0x1c02('0x60')]=0x0;_0x59b192[_0x1c02('0x61')]=_0x1c02('0x62');ut[_0x1c02('0x63')](_0x1c02('0x64'),_0x59b192[_0x1c02('0x2a')]+_0x1c02('0x65'));}else{_0x59b192[_0x1c02('0x61')]=_0x1c02('0x66');ut[_0x1c02('0x63')](_0x1c02('0x64'),_0x59b192['name']+_0x1c02('0x67'));}emitCampaignPreview(_0x59b192);}}Preview[_0x1c02('0x68')][_0x1c02('0x26')]=function(){var _0xbcff5e=this;setInterval(function(){_0xbcff5e[_0x1c02('0x69')]();},0x7cf);};Preview['prototype'][_0x1c02('0x69')]=function(){var _0x51e1e3=this[_0x1c02('0x27')];this[_0x1c02('0x18')]+=0x1;for(var _0x199f0b in _0x51e1e3){if(_0x51e1e3[_0x1c02('0x6a')](_0x199f0b)&&(_0x51e1e3[_0x199f0b][_0x1c02('0x36')]===_0x1c02('0x7')||_0x51e1e3[_0x199f0b][_0x1c02('0x36')]===_0x1c02('0x6b'))&&_0x51e1e3[_0x199f0b]['type']===_0x1c02('0x29')){if(this[_0x1c02('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x1c02('0x6c')]();}}if(_0x51e1e3[_0x1c02('0x6a')](_0x199f0b)&&_0x51e1e3[_0x199f0b][_0x1c02('0x36')]===_0x1c02('0x7')&&_0x51e1e3[_0x199f0b][_0x1c02('0x28')]===_0x1c02('0x29')){if(_0x51e1e3[_0x199f0b][_0x1c02('0x35')]){this['setMessage'](_0x51e1e3[_0x199f0b]);this[_0x1c02('0x6d')](_0x51e1e3[_0x199f0b]);}else{notSendMessagesQueue(_0x51e1e3[_0x199f0b]);}}}};Preview[_0x1c02('0x68')][_0x1c02('0x6e')]=function(_0x4694d1){var _0xa06234=this;this[_0x1c02('0x13')][_0x1c02('0x10')](function(){if(!_[_0x1c02('0x6f')](_0xa06234[_0x1c02('0x16')][_0x4694d1])){loggerAction['info'](_0x1c02('0x70'),_0x4694d1,_0x1c02('0x71'),_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')],_0x1c02('0x73'),JSON[_0x1c02('0x5a')](_0xa06234[_0x1c02('0x27')][_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]][_0x1c02('0x5e')]),'pTalking:\x20',JSON[_0x1c02('0x5a')](_0xa06234[_0x1c02('0x27')][_0xa06234['actions'][_0x4694d1][_0x1c02('0x72')]][_0x1c02('0x2e')]),JSON['stringify'](_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x74')]),JSON[_0x1c02('0x5a')](_[_0x1c02('0x75')](_0xa06234['actions'][_0x4694d1],['contactId',_0x1c02('0x76'),_0x1c02('0x77'),_0x1c02('0x78')])));return ami[_0x1c02('0x79')]({'action':_0x1c02('0x7a'),'channel':_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x7b')]})[_0x1c02('0x7c')](function(_0x43badd){if(_0x43badd[_0x1c02('0x61')]===_0x1c02('0x7d')){setTimeout(function(){if(_0xa06234[_0x1c02('0x16')][_0x4694d1]){ut[_0x1c02('0x7e')](_0xa06234[_0x1c02('0x27')][_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]],'[clearZombieChannel]');if(_0xa06234[_0x1c02('0x16')][_0x4694d1]['dialAnswer']===!![]){ut[_0x1c02('0x7f')](_0xa06234[_0x1c02('0x27')][_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]],_0x1c02('0x80'));ut[_0x1c02('0x81')]('[Dialer][checkChannel][pTalking][Preview]'+_0x4694d1,_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]);}ut['loggerError'](_0x1c02('0x82')+_0x4694d1,_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]);delete _0xa06234[_0x1c02('0x16')][_0x4694d1];}},0x2328);}});}});};Preview[_0x1c02('0x68')]['clearZombieChannels']=function(){var _0x446dbf=this;loggerAction[_0x1c02('0x83')]('[action]',_[_0x1c02('0x84')](this[_0x1c02('0x16')]));for(var _0x1ddc10 in this[_0x1c02('0x16')]){if(_0x446dbf[_0x1c02('0x16')]['hasOwnProperty'](_0x1ddc10)){_0x446dbf[_0x1c02('0x6e')](_0x1ddc10);}}};Preview[_0x1c02('0x68')]['recallMe']=function(_0xd5d8af){var _0x967f45=this;rpcDb['getContactRecallMe'](_0xd5d8af['id'],ut[_0x1c02('0x85')](this[_0x1c02('0x17')]))[_0x1c02('0x86')](function(_0x8e7348){if(!_[_0x1c02('0x6f')](_0x8e7348)){for(var _0x26577f=0x0;_0x26577f<_0x8e7348[_0x1c02('0x87')];_0x26577f+=0x1){if(ut[_0x1c02('0x88')](_0x8e7348[_0x26577f][_0x1c02('0x89')])<_0xd5d8af[_0x1c02('0x8a')]*0x3c){if(_0x8e7348[_0x26577f]['Agent']&&!_0x8e7348[_0x26577f]['Agent'][_0x1c02('0x8b')]){_0x967f45['run'](_0x8e7348[_0x26577f]['id'])[_0x1c02('0x86')](ut['logger2'](_0x1c02('0x8c')))[_0x1c02('0x7c')](ut[_0x1c02('0x8d')]('[RecallMe]'));}else{rpcDb[_0x1c02('0x8e')](_0x8e7348[_0x26577f]['id']);}}else{var _0x4f1b1f=new Action(_0x8e7348[_0x26577f],_0xd5d8af);_0x4f1b1f[_0x1c02('0x8f')]=moment()['format'](_0x1c02('0x90'));_0xd5d8af[_0x1c02('0x41')]+=0x1;ut[_0x1c02('0x91')](_0x4f1b1f,0x17,'RecallInQueue');if(_0xd5d8af[_0x1c02('0x92')]){rpcDb[_0x1c02('0x93')](ut[_0x1c02('0x94')](_0x8e7348[_0x26577f]));rpcDb[_0x1c02('0x95')](_0x4f1b1f,_0x1c02('0x96'));}else{ut['logCustomer'](_0x4f1b1f,0x16,_0x1c02('0x97'));rpcDb[_0x1c02('0x95')](_0x4f1b1f,_0x1c02('0x98'));rpcDb['createCustomerFinal'](_0x4f1b1f,_0x1c02('0x98'));}}}}})[_0x1c02('0x7c')](ut[_0x1c02('0x8d')](_0x1c02('0x99')));};Preview[_0x1c02('0x68')][_0x1c02('0x9a')]=function(_0x15aecb){_0x15aecb[_0x1c02('0x5f')]=!![];if(ut[_0x1c02('0x9b')](_0x15aecb[_0x1c02('0x2d')])){_0x15aecb[_0x1c02('0x61')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x1c02('0x9c')](_0x15aecb[_0x1c02('0x35')])){_0x15aecb[_0x1c02('0x61')]=_0x1c02('0x62');}else if(!this[_0x1c02('0x9d')](_0x15aecb[_0x1c02('0x53')])){if(!this[_0x1c02('0x9d')](_0x15aecb['TrunkBackup'])){_0x15aecb[_0x1c02('0x61')]=_0x1c02('0x9e');}else{_0x15aecb['message']=_0x1c02('0x9f');}}else{_0x15aecb[_0x1c02('0x61')]=_0x1c02('0x9f');}emitCampaignPreview(_0x15aecb);};Preview['prototype'][_0x1c02('0xa0')]=function(_0x2de598,_0x148099,_0xde6d91){var _0xf544e0=this;var _0x744df9=this[_0x1c02('0x16')][_0x148099];var _0x205464=this['campaignsPreview'][_0x744df9[_0x1c02('0x72')]];var _0x2331cb;if(_0x205464){switch(_0xde6d91){case'1':_0x205464[_0x1c02('0x3f')]+=0x1;_0x744df9[_0x1c02('0xa1')]+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x0,'NoSuchNumber');ami[_0x1c02('0x5c')]('custom:agentnosuchnumber',ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xa5')));rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xa6'));if(ut['totalGlobal'](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut['cloneAction'](_0x744df9,0xf,'Global');rpcDb['createCustomerFinal'](_0x2331cb,_0x1c02('0xa8'));}else{if(_0x744df9['countnosuchnumberretry']>=_0x205464['dialNoSuchNumberMaxRetry']){rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xa8'));}else{rpcDb[_0x1c02('0xaa')](ut[_0x1c02('0xab')](_0x744df9,_0x1c02('0xa1'),_0x205464[_0x1c02('0xac')]),_0x744df9[_0x1c02('0xad')],_0x744df9[_0x1c02('0xae')]);}}delete this[_0x1c02('0x16')][_0x2de598[_0x1c02('0xaf')]];break;case _0x1c02('0xb0'):var _0x235ea6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x744df9['responsetime']=_0x235ea6;_0x744df9['answertime']=_0x235ea6;_0x744df9[_0x1c02('0x74')]=!![];_0x205464[_0x1c02('0x2e')]+=0x1;logger[_0x1c02('0x83')]('[syncHangup][talking][increment]',_0x744df9[_0x1c02('0xb1')],'\x20Queue',_0x205464[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x205464['pTalking']);ami[_0x1c02('0x5c')](_0x1c02('0xb3'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xb4'),this[_0x1c02('0x27')][_0x744df9['queue']]));if(_0x205464[_0x1c02('0xb5')]){ami[_0x1c02('0x5c')]('custom:agentConnectPreview',ut[_0x1c02('0xb6')](_0x744df9));}break;case'16':ami[_0x1c02('0x5c')](_0x1c02('0xb7'),ut['buildObj'](_0x744df9,_0x1c02('0xb8'),this['campaignsPreview'][_0x744df9['queue']]));emitVoiceQueueChannelRemove(ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xb8')));_0x205464[_0x1c02('0x3b')]+=0x1;_0x205464[_0x1c02('0x30')]+=0x1;_0x205464['answered']+=0x1;ut['decrementTalkink'](_0x205464,_0x1c02('0xb9'));_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x4,_0x1c02('0xba'));rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xbb'));rpcDb[_0x1c02('0xa9')](_0x744df9,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x1c02('0xbc')](_0x744df9);_0x205464[_0x1c02('0xbd')]+=_0x744df9['talktime'];_0x205464[_0x1c02('0xbe')]+=_0x744df9[_0x1c02('0xbf')];logger[_0x1c02('0x83')](_0x1c02('0xc0'),_0x744df9[_0x1c02('0xb1')],_0x1c02('0xc1'),_0x205464[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x205464[_0x1c02('0x2e')]);delete this['actions'][_0x2de598[_0x1c02('0xaf')]];break;case _0x1c02('0xc2'):_0x205464[_0x1c02('0x3d')]+=0x1;_0x744df9[_0x1c02('0xc3')]+=0x1;_0x744df9['countglobal']=ut[_0x1c02('0xa3')](_0x744df9);ut['logCustomer'](_0x744df9,0x5,'Busy');ami[_0x1c02('0x5c')](_0x1c02('0xc4'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xc5')));rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xc6'));if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb['createCustomerFinal'](_0x2331cb,_0x1c02('0xc9'));}else{if(_0x744df9[_0x1c02('0xc3')]>=_0x205464[_0x1c02('0xca')]){rpcDb['createCustomerFinal'](_0x744df9,_0x1c02('0xc6'));}else{rpcDb[_0x1c02('0xaa')](ut[_0x1c02('0xab')](_0x744df9,_0x1c02('0xc3'),_0x205464[_0x1c02('0xcb')]),_0x744df9[_0x1c02('0xad')],_0x744df9[_0x1c02('0xae')]);}}break;case _0x1c02('0xcc'):_0x205464[_0x1c02('0xcd')]+=0x1;_0x744df9[_0x1c02('0xce')]+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut['logCustomer'](_0x744df9,0x3,'NoAnswer');ami['emit'](_0x1c02('0xcf'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xd0')));rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xd1'));if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464['dialGlobalMaxRetry']){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb['createCustomerFinal'](_0x2331cb,_0x1c02('0xd2'));}else{if(_0x744df9[_0x1c02('0xce')]>=_0x205464[_0x1c02('0xd3')]){rpcDb['createCustomerFinal'](_0x744df9,_0x1c02('0xd1'));}else{rpcDb['rescheduleContact'](ut[_0x1c02('0xab')](_0x744df9,'countnoanswerretry',_0x205464[_0x1c02('0xd4')]),_0x744df9[_0x1c02('0xad')],_0x744df9[_0x1c02('0xae')]);}}break;case _0x1c02('0xd5'):_0x205464[_0x1c02('0xd6')]+=0x1;_0x744df9['countcongestionretry']+=0x1;_0x744df9['countglobal']=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x8,_0x1c02('0xd7'));ami['emit'](_0x1c02('0xd8'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xd9')));rpcDb[_0x1c02('0x95')](_0x744df9,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut['cloneAction'](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb[_0x1c02('0xa9')](_0x2331cb,_0x1c02('0xda'));}else{if(_0x744df9[_0x1c02('0xdb')]>=_0x205464[_0x1c02('0xdc')]){rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xdd'));}else{rpcDb[_0x1c02('0xaa')](ut[_0x1c02('0xab')](_0x744df9,_0x1c02('0xdb'),_0x205464['dialBusyRetryFrequency']),_0x744df9[_0x1c02('0xad')],_0x744df9[_0x1c02('0xae')]);}}break;case _0x1c02('0xde'):_0x205464[_0x1c02('0x42')]+=0x1;_0x744df9['countagentrejectretry']+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x14,_0x1c02('0xdf'));ami[_0x1c02('0x5c')](_0x1c02('0xe0'),ut['buildObj'](_0x744df9,_0x1c02('0xe1')));rpcDb[_0x1c02('0x95')](_0x744df9,'[syncHangupRequest][logAgentReject]');if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0x14,'AgentReject');rpcDb[_0x1c02('0xa9')](_0x2331cb,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x744df9[_0x1c02('0xe2')]>=_0x205464['dialAgentRejectMaxRetry']){rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xe3'));}else{rpcDb[_0x1c02('0xaa')](ut[_0x1c02('0xab')](_0x744df9,'countagentrejectretry',_0x205464['dialAgentRejectRetryFrequency']),_0x744df9[_0x1c02('0xad')],_0x744df9['activeContact']);}}break;case'ABANDONED':_0x205464[_0x1c02('0x44')]+=0x1;_0x744df9[_0x1c02('0xe4')]+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x744df9,_0x1c02('0xe5'));if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464['dialGlobalMaxRetry']){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,'Global');rpcDb[_0x1c02('0xa9')](_0x2331cb,_0x1c02('0xe5'));}else{if(_0x744df9[_0x1c02('0xe6')]>=_0x205464['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x744df9,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x1c02('0xab')](_0x744df9,'countabandonedretry',_0x205464[_0x1c02('0xe7')]),_0x744df9['unlockAgent'],_0x744df9[_0x1c02('0xae')]);}}break;case'18':_0x205464[_0x1c02('0x43')]+=0x1;_0x744df9[_0x1c02('0xe8')]+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x12,_0x2de598[_0x1c02('0xe9')]||_0x2de598['dialstatus']);ami[_0x1c02('0x5c')](_0x1c02('0xea'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xeb')));rpcDb['createCustomerHistory'](_0x744df9,_0x1c02('0xec'));if(ut['totalGlobal'](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb[_0x1c02('0xa9')](_0x2331cb,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xec'));}delete this[_0x1c02('0x16')][_0x2de598[_0x1c02('0xaf')]];break;case'19':_0x205464['outboundUnknownCallsDay']+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x13,_0x2de598[_0x1c02('0xe9')]||_0x2de598[_0x1c02('0xed')]);ami['emit'](_0x1c02('0xea'),ut['buildObj'](_0x744df9,_0x1c02('0xeb')));rpcDb['createCustomerHistory'](_0x744df9,'[callProgressDetectingCustomer][machine]');if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb[_0x1c02('0xa9')](_0x2331cb,_0x1c02('0xee'));}else{rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xee'));}delete this[_0x1c02('0x16')][_0x2de598['linkedid']];break;default:if(_0x744df9['dialAnswer']){ut[_0x1c02('0x7f')](_0x205464,'[default]');ut[_0x1c02('0x81')](_0x1c02('0xef')+_0x205464[_0x1c02('0x2a')],_0x2de598);}_0x205464[_0x1c02('0x43')]+=0x1;_0x744df9['countglobal']=ut['totalGlobal'](_0x744df9);ut['logCustomer'](_0x744df9,0xc,_0x2de598[_0x1c02('0xe9')]||_0x2de598[_0x1c02('0xed')]);rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xf0'));if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut['cloneAction'](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb[_0x1c02('0xa9')](_0x2331cb,_0x1c02('0xf1'));}else{rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xf1'));}delete this[_0x1c02('0x16')][_0x2de598[_0x1c02('0xaf')]];}if(!(_0x744df9[_0x1c02('0x74')]&&_0xde6d91==='16')){ut[_0x1c02('0x7e')](_0x205464,_0x1c02('0xf2'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x744df9[_0x1c02('0xb1')],_0x1c02('0xc1'),_0x205464[_0x1c02('0x2a')],_0x1c02('0x73'),_0x205464['originated']);}if(_0xde6d91!==_0x1c02('0xb0')){delete this[_0x1c02('0x16')][_0x2de598[_0x1c02('0xaf')]];delete this['actions'][_0x2de598[_0x1c02('0xf3')]];}}};Preview[_0x1c02('0x68')][_0x1c02('0xf4')]=function(_0x2d8474,_0x575311,_0x1d7020){if(_['isUndefined'](_0x575311)&&_0x1c02('0xf5')!==typeof _0x575311){return;}if(_['isUndefined'](_0x1d7020)&&_0x1c02('0xf5')!==typeof _0x1d7020){return;}switch(_0x1d7020[_0x1c02('0xf6')]){case'0':ut[_0x1c02('0xf7')](_0x2d8474,0x0,_0x1c02('0xf8'));rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xfa'));break;case'3':ut[_0x1c02('0xf7')](_0x2d8474,0x3,_0x1c02('0xfb'));rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xfc'));break;case'5':ut['logAgent'](_0x2d8474,0x5,_0x1c02('0xfd'));rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xfe'));break;case'8':ut['logAgent'](_0x2d8474,0x8,_0x1c02('0xd7'));rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xff'));break;case'22':ut['logAgent'](_0x2d8474,0x16,_0x1c02('0x100'));rpcDb['createAgentHistory'](_0x2d8474,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x1c02('0xf7')](_0x2d8474,0xc,_0x1d7020[_0x1c02('0xf6')]);rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xff'));}ut[_0x1c02('0x7e')](_0x575311,_0x1c02('0x101'));logger[_0x1c02('0x83')](_0x1c02('0x102'),_0x2d8474[_0x1c02('0xb1')],'\x20Queue',_0x575311[_0x1c02('0x2a')],'originated:\x20',_0x575311[_0x1c02('0x5e')]);delete this[_0x1c02('0x16')][_0x2d8474[_0x1c02('0xb1')]];};Preview[_0x1c02('0x68')]['checkInBlack']=function(_0x49c7f,_0x2cce44,_0x50fb2e,_0x29d869,_0x548603){var _0x5bbdc6=this;return new BPromise(function(_0x76816,_0x31e8fe){if(_[_0x1c02('0x6f')](_0x2cce44)||_[_0x1c02('0x6f')](_0x2cce44[_0x1c02('0x103')])||_[_0x1c02('0x6f')](_0x2cce44[_0x1c02('0x103')][_0x1c02('0x104')])||_[_0x1c02('0x6f')](_0x2cce44['VoiceQueueId'])){_0x31e8fe(ut[_0x1c02('0x61')]('Contact\x20is\x20undefined',_0x29d869,_0x548603));return;}var _0x34e103=uuid['v4']();var _0x22e233=_0x5bbdc6[_0x1c02('0x27')][_0x2cce44[_0x1c02('0x71')][_0x1c02('0x2a')]];var _0x36c508=_0x50fb2e?_0x5bbdc6[_0x1c02('0x17')][_0x50fb2e]['id']:undefined;_0x5bbdc6[_0x1c02('0x16')][_0x34e103]=new Action(_0x2cce44,_0x22e233,_0x34e103,_0x50fb2e,_0x36c508);var _0x144bb4=_0x5bbdc6[_0x1c02('0x16')][_0x34e103];_0x144bb4[_0x1c02('0xad')]=_0x29d869;_0x144bb4['activeContact']=_0x548603;_0x144bb4[_0x1c02('0x105')]=_0x50fb2e;if(_[_0x1c02('0x106')](_0x49c7f)){_0x5bbdc6['execCall'](_0x144bb4,_0x22e233,_0x2cce44,_0x50fb2e)[_0x1c02('0x86')](function(_0x46b68f){logger[_0x1c02('0x83')](_0x1c02('0x107'),_0x1c02('0x108')+_0x144bb4[_0x1c02('0x72')]+_0x1c02('0x109')+_0x144bb4[_0x1c02('0x10a')],JSON[_0x1c02('0x5a')](_0x46b68f));ami[_0x1c02('0x5c')](_0x1c02('0x10b'),ut[_0x1c02('0xa4')](_0x144bb4,'called',_0x5bbdc6[_0x1c02('0x27')][_0x144bb4[_0x1c02('0x72')]]));_0x76816(ut[_0x1c02('0x61')](_0x1c02('0x10c')));})[_0x1c02('0x7c')](function(_0xaa6898){ut[_0x1c02('0x63')](_0x1c02('0x10d'),_0xaa6898);_0x31e8fe(ut[_0x1c02('0x61')](_0x1c02('0x10e'),_0x29d869,_0x548603));});}else{_0x22e233[_0x1c02('0x3c')]+=0x1;ut[_0x1c02('0x10f')](_0x144bb4);rpcDb[_0x1c02('0x110')](_0x144bb4,_0x1c02('0x111'));delete _0x5bbdc6[_0x1c02('0x16')][_0x34e103];_0x31e8fe(ut[_0x1c02('0x61')](_0x1c02('0x112'),_0x29d869,_0x548603));}});};Preview[_0x1c02('0x68')][_0x1c02('0x9d')]=function(_0x414c80){return!_[_0x1c02('0x6f')](_0x414c80)&&!_[_0x1c02('0x6f')](_0x414c80[_0x1c02('0x2a')])&&!_[_0x1c02('0x6f')](_0x414c80['active'])&&_0x414c80['active']&&!_[_0x1c02('0x6f')](this['trunks'][util[_0x1c02('0x56')](_0x1c02('0x113'),_0x414c80[_0x1c02('0x2a')])])&&!_[_0x1c02('0x6f')](this['trunks'][util[_0x1c02('0x56')](_0x1c02('0x113'),_0x414c80[_0x1c02('0x2a')])][_0x1c02('0x7a')])&&(this['trunks'][util[_0x1c02('0x56')](_0x1c02('0x113'),_0x414c80['name'])]['status']==='reachable'||this[_0x1c02('0x15')][util['format'](_0x1c02('0x113'),_0x414c80[_0x1c02('0x2a')])][_0x1c02('0x7a')]===_0x1c02('0x114'));};Preview[_0x1c02('0x68')]['run']=function(_0x3dd2d0,_0x4f0af3){var _0x506791=this;return new BPromise(function(_0x2281f3,_0x577bbc){_0x506791[_0x1c02('0x115')](_0x3dd2d0,_0x4f0af3)[_0x1c02('0x86')](function(_0x143b06){_0x2281f3(_[_0x1c02('0x75')](_0x143b06,[_0x1c02('0x61')]));})[_0x1c02('0x7c')](function(_0x54b343){if(_0x54b343[_0x1c02('0x116')]){rpcDb['unlockContact'](_0x3dd2d0);}if(_0x54b343['active']){rpcDb[_0x1c02('0x8e')](_0x3dd2d0);}_0x577bbc(_['pick'](_0x54b343,['message']));});});};Preview[_0x1c02('0x68')][_0x1c02('0x115')]=function(_0x150efb,_0x4bd4b3){var _0x28236c=this;return new BPromise(function(_0x1aa5cd,_0x9710ab){var _0x2d3769,_0x40cbdf;rpcDb[_0x1c02('0x117')](_0x150efb)[_0x1c02('0x86')](function(_0x16854f){if(!_[_0x1c02('0x6f')](_0x16854f[0x0])){_0x40cbdf=_0x16854f[0x0][_0x1c02('0x118')]?![]:!![];_0x2d3769=_0x16854f[0x0][_0x1c02('0x118')]?!![]:![];_0x2d3769=_0x4bd4b3?!![]:_0x2d3769;}var _0x566114=_0x28236c[_0x1c02('0x119')](_0x16854f);if(_0x566114[_0x1c02('0x11a')]){rpcDb[_0x1c02('0x11b')](_['pick'](_0x16854f[0x0],[_0x1c02('0x77'),_0x1c02('0x11c')]))[_0x1c02('0x86')](function(_0x5af33d){_0x28236c[_0x1c02('0x11d')](_0x5af33d,_0x16854f[0x0],_0x4bd4b3,_0x40cbdf,_0x2d3769)[_0x1c02('0x86')](function(_0x46a47d){_0x1aa5cd(_0x46a47d);})[_0x1c02('0x7c')](function(_0x3c0275){_0x9710ab(_0x3c0275);});})[_0x1c02('0x7c')](function(_0x25502e){ut[_0x1c02('0x63')](_0x1c02('0x11e'),_0x25502e);_0x9710ab(ut[_0x1c02('0x61')](_0x1c02('0x11f'),_0x40cbdf,_0x2d3769));});}else{_0x9710ab(ut[_0x1c02('0x61')](_0x566114['message'],_0x40cbdf,_0x2d3769));}})['catch'](function(_0x5afd8d){ut['logger'](_0x1c02('0x120'),_0x5afd8d);_0x9710ab(ut[_0x1c02('0x61')](_0x1c02('0x11f'),![],!![]));});});};Preview[_0x1c02('0x68')][_0x1c02('0x119')]=function(_0x13c1a6){if(_[_0x1c02('0x6f')](_0x13c1a6)||_[_0x1c02('0x106')](_0x13c1a6)||!_[_0x1c02('0x6f')](_0x13c1a6[0x0][_0x1c02('0x121')])&&_['isNil'](_0x13c1a6[0x0]['Agent'][_0x1c02('0x2a')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x13c1a6);return{'isValid':![],'message':_0x1c02('0x122')};}var _0x16e933=this[_0x1c02('0x27')][_0x13c1a6[0x0][_0x1c02('0x71')][_0x1c02('0x2a')]];_0x16e933[_0x1c02('0x61')]='ACTIVE';if(_['isNil'](_0x16e933)){ut['logger'](_0x1c02('0x123'),_0x16e933);return{'isValid':![],'message':_0x1c02('0x124')};}if(!this[_0x1c02('0x9d')](_0x16e933[_0x1c02('0x53')])){ut[_0x1c02('0x63')](_0x1c02('0x125'),'campaign\x20Name:\x20'+_0x16e933[_0x1c02('0x2a')]+_0x1c02('0x126'));if(!this[_0x1c02('0x9d')](_0x16e933['TrunkBackup'])){ut[_0x1c02('0x63')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x16e933[_0x1c02('0x2a')]+_0x1c02('0x127'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x1c02('0x9c')](_0x16e933[_0x1c02('0x35')])){ut[_0x1c02('0x63')](_0x1c02('0x128'),_0x16e933[_0x1c02('0x2a')]+_0x1c02('0x129'));return{'isValid':![],'message':_0x1c02('0x12a')+_0x16e933[_0x1c02('0x2a')]+_0x1c02('0x129')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x1c02('0x12b')]=function(_0x316d3a,_0x7b47ea,_0x2aee76,_0xd7f18b){var _0x309254=this;return new BPromise(function(_0x303273,_0x16a795){var _0x5477be=_0x316d3a[_0x1c02('0xb1')];var _0x45b7ff=_0x309254[_0x1c02('0x9d')](_0x7b47ea[_0x1c02('0x53')])?util[_0x1c02('0x56')](_0x1c02('0x12c'),_0x7b47ea[_0x1c02('0x53')][_0x1c02('0x2a')],_['isNil'](_0x7b47ea[_0x1c02('0x39')])?'':_0x7b47ea[_0x1c02('0x39')][_0x1c02('0x12d')]()||'',_0x7b47ea[_0x1c02('0x12e')]>0x0?_0x2aee76[_0x1c02('0x103')][_0x1c02('0x104')][_0x1c02('0x12f')](_0x7b47ea[_0x1c02('0x12e')]):_0x2aee76['Contact'][_0x1c02('0x104')]):util[_0x1c02('0x56')]('SIP/%s/%s%s',_['isNil'](_0x7b47ea[_0x1c02('0x130')])?_0x7b47ea[_0x1c02('0x53')][_0x1c02('0x2a')]:_0x7b47ea['TrunkBackup']['name'],_[_0x1c02('0x6f')](_0x7b47ea['dialPrefix'])?'':_0x7b47ea[_0x1c02('0x39')][_0x1c02('0x12d')]()||'',_0x7b47ea['dialCutDigit']>0x0?_0x2aee76['Contact'][_0x1c02('0x104')][_0x1c02('0x12f')](_0x7b47ea[_0x1c02('0x12e')]):_0x2aee76[_0x1c02('0x103')]['phone']);var _0x3ff488=_0x309254[_0x1c02('0x9d')](_0x7b47ea[_0x1c02('0x53')])?ut['getCallerId'](_0x7b47ea[_0x1c02('0x53')][_0x1c02('0x131')],_0x7b47ea[_0x1c02('0x37')],_0x7b47ea['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x1c02('0x132')](_0x7b47ea[_0x1c02('0x133')],_0x7b47ea[_0x1c02('0x134')]):_0x7b47ea[_0x1c02('0x133')]):ut['getCallerId'](_['isNil'](_0x7b47ea['TrunkBackup'])?_0x7b47ea[_0x1c02('0x53')][_0x1c02('0x131')]:_0x7b47ea['TrunkBackup'][_0x1c02('0x131')],_0x7b47ea['dialOriginateCallerIdName'],_0x7b47ea[_0x1c02('0x134')]>0x0?ut[_0x1c02('0x132')](_0x7b47ea['dialOriginateCallerIdNumber'],_0x7b47ea['dialRandomLastDigitCallerIdNumber']):_0x7b47ea[_0x1c02('0x133')]);if(_0x3ff488){_0x316d3a['originatecalleridname']=ut[_0x1c02('0x135')](_0x3ff488);_0x316d3a[_0x1c02('0x136')]=ut[_0x1c02('0x137')](_0x3ff488);}var _0x262920=ut[_0x1c02('0x138')](_0x7b47ea,_0x2aee76,_0x45b7ff,_0x3ff488,_0x5477be,_0x316d3a);_[_0x1c02('0x139')](_0x316d3a,ut[_0x1c02('0x13a')](_0x262920));_0x316d3a[_0x1c02('0x8f')]=moment()[_0x1c02('0x56')](_0x1c02('0x90'));ami[_0x1c02('0x79')](ut[_0x1c02('0x13b')](_0x316d3a,_0x7b47ea,_0x262920,_0x316d3a['activeContact'],_0xd7f18b))[_0x1c02('0x86')](function(_0x2e39e1){var _0x1d2965=_0x316d3a[_0x1c02('0x13c')];if(!_[_0x1c02('0x6f')](_0x1d2965)){if(!_[_0x1c02('0x6f')](_0x309254[_0x1c02('0x17')][_0x1d2965])){_0x309254[_0x1c02('0x17')][_0x1d2965][_0x1c02('0x13d')]=_0x316d3a[_0x1c02('0x13e')];emit(util[_0x1c02('0x56')]('user:%s',_0x309254[_0x1c02('0x17')][_0x1d2965][_0x1c02('0x2a')]),'user:agentconnect',{'destaccountcode':_0x309254[_0x1c02('0x17')][_0x1d2965]['accountcode'],'destconnectedlinenum':_0x316d3a[_0x1c02('0x13e')]});}}_0x7b47ea[_0x1c02('0x5e')]+=0x1;logger['info'](_0x1c02('0x13f'),_0x5477be,_0x1c02('0xc1'),_0x7b47ea[_0x1c02('0x2a')],_0x1c02('0x73'),_0x7b47ea[_0x1c02('0x5e')]);_0x303273(_0x2e39e1);})[_0x1c02('0x7c')](function(_0x1109b8){ut[_0x1c02('0xf7')](_0x316d3a,0xe,_0x1c02('0x140'));rpcDb[_0x1c02('0xf9')](_0x316d3a,_0x1c02('0x141'));_0x16a795(_0x1109b8);});});};Preview['prototype']['syncNewExten']=function(_0x1b23ba){if(this['actions'][_0x1b23ba[_0x1c02('0xaf')]]){this[_0x1c02('0x16')][_0x1b23ba[_0x1c02('0xaf')]][_0x1c02('0x7b')]=_0x1b23ba[_0x1c02('0x7b')];}};Preview[_0x1c02('0x68')][_0x1c02('0x142')]=function(_0x4296fd){var _0x10f29e=this;var _0x26f5b4=this[_0x1c02('0x16')][_0x4296fd[_0x1c02('0x143')]];if(_0x26f5b4){if(_0x26f5b4[_0x1c02('0x105')]&&this[_0x1c02('0x17')][_0x26f5b4[_0x1c02('0x105')]]){ut[_0x1c02('0x144')](_0x26f5b4,this[_0x1c02('0x17')][_0x26f5b4[_0x1c02('0x105')]]['name'],this['agents'][_0x26f5b4[_0x1c02('0x105')]]['id']);}var _0x1ca8a0=_[_0x1c02('0x145')](_0x26f5b4);_0x1ca8a0[_0x1c02('0x146')]=moment()[_0x1c02('0x56')]('YYYY-MM-DD\x20HH:mm:ss');var _0x253882=_0x10f29e[_0x1c02('0x27')][_0x26f5b4[_0x1c02('0x72')]];if(ut[_0x1c02('0x147')](_0x4296fd['response'])){if(_0x26f5b4[_0x1c02('0xad')]){rpcDb[_0x1c02('0x148')](_0x26f5b4[_0x1c02('0x10a')]);}if(_0x26f5b4['activeContact']){rpcDb[_0x1c02('0x8e')](_0x26f5b4[_0x1c02('0x10a')]);}ami[_0x1c02('0x5c')](_0x1c02('0x149'),ut[_0x1c02('0xa4')](_0x26f5b4,_0x1c02('0x14a'),this[_0x1c02('0x27')][_0x26f5b4[_0x1c02('0x72')]]));this[_0x1c02('0xf4')](_0x1ca8a0,_0x253882,_0x4296fd);}else{_0x26f5b4[_0x1c02('0x8f')]=moment()[_0x1c02('0x56')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x1c02('0xf7')](_0x1ca8a0,0x4,_0x1c02('0xba'));rpcDb['createAgentHistory'](_0x1ca8a0,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x1c02('0x68')][_0x1c02('0x14b')]=function(_0x45abd7){var _0x398a0c=this;var _0x46ca24=this[_0x1c02('0x16')][_0x45abd7[_0x1c02('0xaf')]];var _0x3977f1;if(_0x46ca24){_0x3977f1=this[_0x1c02('0x27')][_0x46ca24[_0x1c02('0x72')]];logger[_0x1c02('0x83')]('[syncHangup][talking]',_0x45abd7[_0x1c02('0xaf')],_0x1c02('0xc1'),_0x3977f1[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x3977f1[_0x1c02('0x2e')]);}if(this['actions'][_0x45abd7['linkedid']]&&_0x45abd7[_0x1c02('0xaf')]!==_0x45abd7[_0x1c02('0xb1')]){if(_0x45abd7[_0x1c02('0x14c')]==='16'&&this[_0x1c02('0x16')][_0x45abd7[_0x1c02('0xaf')]][_0x1c02('0x74')]){this[_0x1c02('0xa0')](_0x45abd7,_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')]);}else if(this[_0x1c02('0x16')][_0x45abd7[_0x1c02('0xaf')]][_0x1c02('0x74')]){logger[_0x1c02('0x83')](_0x1c02('0x14d'),_0x45abd7['linkedid'],_0x45abd7['cause'],_0x1c02('0xc1'),_0x3977f1['name'],_0x1c02('0xb2'),_0x3977f1[_0x1c02('0x2e')]);this[_0x1c02('0xa0')](_0x45abd7,_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')]);}}else if(_0x46ca24&&_[_0x1c02('0x6f')](_0x46ca24[_0x1c02('0x14e')])&&_0x3977f1[_0x1c02('0x14f')]&&_0x45abd7['linkedid']===_0x45abd7[_0x1c02('0xb1')]&&_[_0x1c02('0x6f')](_0x45abd7[_0x1c02('0xf6')])&&_0x45abd7['cause']==='16'&&_0x45abd7['channelstate']==='6'&&_[_0x1c02('0x150')](_0x46ca24['transfer'])){if(_0x46ca24[_0x1c02('0xad')]){rpcDb[_0x1c02('0x148')](_0x46ca24['idContact']);}if(_0x46ca24[_0x1c02('0xae')]){rpcDb['disableContact'](_0x46ca24[_0x1c02('0x10a')]);}_0x45abd7['reason']='22';this['callProgressDetectingAgent'](_0x46ca24,_0x3977f1,_0x45abd7);}else if(_0x46ca24&&_0x46ca24[_0x1c02('0x151')]){if(_0x45abd7['cause']==='16'&&this[_0x1c02('0x16')][_0x45abd7[_0x1c02('0xaf')]][_0x1c02('0x74')]){logger[_0x1c02('0x83')](_0x1c02('0x152'),_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')],_0x1c02('0xc1'),_0x3977f1[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x3977f1[_0x1c02('0x2e')]);this[_0x1c02('0xa0')](_0x45abd7,_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')]);}else if(this[_0x1c02('0x16')][_0x45abd7['linkedid']][_0x1c02('0x74')]){logger[_0x1c02('0x83')]('[syncHangup][talking][cause]',_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')],_0x1c02('0xc1'),_0x3977f1[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x3977f1[_0x1c02('0x2e')]);this['callProgressDetectingCustomer'](_0x45abd7,_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')]);}}};Preview[_0x1c02('0x68')][_0x1c02('0x1e')]=function(_0x171cdb){if(this[_0x1c02('0x16')][_0x171cdb[_0x1c02('0xf3')]]&&_0x171cdb[_0x1c02('0xf3')]!==_0x171cdb[_0x1c02('0x153')]){this['callProgressDetectingCustomer'](_0x171cdb,_0x171cdb[_0x1c02('0xf3')],_0x171cdb[_0x1c02('0xed')]);}};Preview[_0x1c02('0x68')][_0x1c02('0x1d')]=function(_0x273e88){if(this[_0x1c02('0x16')][_0x273e88[_0x1c02('0xaf')]]&&_0x273e88[_0x1c02('0xaf')]!==_0x273e88[_0x1c02('0xb1')]&&!this[_0x1c02('0x16')][_0x273e88['linkedid']][_0x1c02('0x74')]){if(_0x273e88['cause']==='1'){this[_0x1c02('0xa0')](_0x273e88,_0x273e88[_0x1c02('0xaf')],_0x273e88['cause']);}}};Preview[_0x1c02('0x68')][_0x1c02('0x154')]=function(_0x4b7ac9,_0xc722c,_0x15dd71){if(this['actions'][_0x4b7ac9]){if(_['isNil'](this[_0x1c02('0x16')][_0x4b7ac9][_0x1c02('0x155')])){this[_0x1c02('0x16')][_0x4b7ac9][_0x1c02('0x155')]={};}this[_0x1c02('0x16')][_0x4b7ac9]['variables'][_0xc722c]=_0x15dd71;}};Preview[_0x1c02('0x68')][_0x1c02('0x21')]=function(_0x2fb8b7){try{if(!_['isNil'](_0x2fb8b7)){if(ut[_0x1c02('0x156')](_[_0x1c02('0x157')](_0x2fb8b7[_0x1c02('0x158')])[0x0])){this[_0x1c02('0x154')](_0x2fb8b7[_0x1c02('0xb1')],_[_0x1c02('0x157')](_0x2fb8b7[_0x1c02('0x158')])[0x0],_0x2fb8b7[_0x1c02('0x159')]);}}}catch(_0x3de4e7){logger[_0x1c02('0x15a')](_0x1c02('0x15b'),util[_0x1c02('0x15c')](_0x3de4e7,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x19dc80){if(_0x19dc80){if(this[_0x1c02('0x16')][_0x19dc80[_0x1c02('0x15d')]]){this[_0x1c02('0x16')][_0x19dc80[_0x1c02('0x15d')]][_0x1c02('0x151')]=!![];}}};Preview[_0x1c02('0x68')][_0x1c02('0x25')]=function(_0xb9a706){if(_0xb9a706){if(this[_0x1c02('0x16')][_0xb9a706['transfererlinkedid']]){this[_0x1c02('0x16')][_0xb9a706[_0x1c02('0x15e')]][_0x1c02('0x151')]=!![];}}};module[_0x1c02('0x15f')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index b3f8634..8fe03bc 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 _0x3037=['exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','[createHistory]\x20','catch','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','from-sip'];(function(_0x58a92a,_0x1fcd68){var _0x375b49=function(_0x402583){while(--_0x402583){_0x58a92a['push'](_0x58a92a['shift']());}};_0x375b49(++_0x1fcd68);}(_0x3037,0x177));var _0x7303=function(_0x4bc937,_0x4808d4){_0x4bc937=_0x4bc937-0x0;var _0x49e32b=_0x3037[_0x4bc937];return _0x49e32b;};'use strict';var util=require(_0x7303('0x0'));var BPromise=require(_0x7303('0x1'));var logger=require(_0x7303('0x2'))('preview');var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x7303('0x3'));var cmHopperHistory=require(_0x7303('0x4'));var cmHopperBlack=require(_0x7303('0x5'));var voiceQueueRt=require(_0x7303('0x6'));var agentReportPreview=require(_0x7303('0x7'));var voiceQueueReport=require(_0x7303('0x8'));function loggerCatch(_0x1b7a44){return function(_0x53ba28){logger['error'](_0x1b7a44,util[_0x7303('0x9')](_0x53ba28,{'showHidden':![],'depth':null}));};}function create(_0x1e687d){return BPromise[_0x7303('0xa')]()[_0x7303('0xb')](cmHopperHistory[_0x7303('0xc')](_0x1e687d))['catch'](loggerCatch(_0x7303('0xd')));}function createAgent(_0x5abc5d){return BPromise['resolve']()['then'](agentReportPreview[_0x7303('0xc')](_0x5abc5d))[_0x7303('0xe')](loggerCatch(_0x7303('0xd')));}function moveContact(_0x6ad33b){return BPromise[_0x7303('0xa')]()[_0x7303('0xb')](cmHopper[_0x7303('0xf')](_0x6ad33b,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x7303('0x10')]=function(_0x2b8609){return BPromise[_0x7303('0xa')]()[_0x7303('0xb')](cmHopperBlack[_0x7303('0x10')](_0x2b8609))[_0x7303('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x7303('0x11')]=function(_0x4430e3){return BPromise[_0x7303('0xa')]()[_0x7303('0xb')](cmHopper[_0x7303('0x11')](_0x4430e3))[_0x7303('0xe')](loggerCatch(_0x7303('0x12')));};exports[_0x7303('0xc')]=function(_0x1ba8f0,_0x5171e0){create(_0x1ba8f0)[_0x7303('0xe')](loggerCatch(_0x5171e0));moveContact(_0x1ba8f0)[_0x7303('0xe')](loggerCatch(_0x5171e0));};exports[_0x7303('0x13')]=function(_0x1b1535,_0x1a0d25){createAgent(_0x1b1535)['catch'](loggerCatch(_0x1a0d25));};exports[_0x7303('0x14')]=function(_0x187e0e,_0x54054b){create(_0x187e0e)[_0x7303('0xe')](loggerCatch(_0x54054b));};exports[_0x7303('0x15')]=function(_0x2d7efd,_0x3346a2){moveContact(_0x2d7efd)['catch'](loggerCatch(_0x3346a2));};exports['rescheduleContact']=function(_0x5904b2,_0x92538e,_0xb764f2){if(_0x92538e){_0x5904b2['UserId']=null;}if(_0xb764f2){_0x5904b2['active']=![];}return BPromise['resolve']()[_0x7303('0xb')](cmHopper[_0x7303('0x16')](_0x5904b2))[_0x7303('0xe')](loggerCatch(_0x7303('0x17')));};exports[_0x7303('0x18')]=function(_0x2e31d0){return BPromise[_0x7303('0xa')]()['then'](cmHopper['countReScheduled'](_0x2e31d0))[_0x7303('0xe')](loggerCatch(_0x7303('0x19')));};exports[_0x7303('0x1a')]=function(_0x18d5a9){return BPromise[_0x7303('0xa')]()[_0x7303('0xb')](cmHopper[_0x7303('0x1a')]({'UserId':null},_0x18d5a9,0x1))[_0x7303('0xe')](loggerCatch(_0x7303('0x1b')));};exports[_0x7303('0x1c')]=function(_0xbb2523){return BPromise['resolve']()[_0x7303('0xb')](cmHopper[_0x7303('0x1a')]({'active':![]},_0xbb2523,0x1))['catch'](loggerCatch(_0x7303('0x1d')));};exports[_0x7303('0x1e')]=function(_0x3a0f72){var _0x3a547e={};_0x3a547e['type']=_0x3a0f72[_0x7303('0x1f')];_0x3a547e['uniqueid']=_0x3a0f72[_0x7303('0x20')];_0x3a547e[_0x7303('0x21')]=_0x3a0f72['calleridnum'];_0x3a547e[_0x7303('0x22')]=_0x3a0f72[_0x7303('0x22')];_0x3a547e[_0x7303('0x23')]=_0x3a0f72[_0x7303('0x23')];_0x3a547e[_0x7303('0x24')]=_0x3a0f72['answertime'];_0x3a547e['queuecallerleaveAt']=_0x3a0f72['answertime'];_0x3a547e[_0x7303('0x25')]=0x1;_0x3a547e[_0x7303('0x26')]=_0x3a0f72['endtime'];_0x3a547e[_0x7303('0x27')]=_0x3a0f72['membername'];_0x3a547e['context']=_0x7303('0x28');_0x3a547e[_0x7303('0x29')]=_0x7303('0x2a');_0x3a547e[_0x7303('0x2b')]=0x0;_0x3a547e[_0x7303('0x2c')]=0x1;_0x3a547e[_0x7303('0x2d')]=_0x3a0f72['membername'];_0x3a547e['queuecallerexitreason']='COMPLETED';return BPromise[_0x7303('0xa')]()[_0x7303('0xb')](voiceQueueReport[_0x7303('0x2e')](_0x3a547e))['catch'](loggerCatch(_0x7303('0x2f')));};exports[_0x7303('0x30')]=function(_0x352fe4,_0x3cf730){return BPromise['resolve']()['then'](cmHopper[_0x7303('0x30')](_0x352fe4,_0x3cf730))['catch'](loggerCatch(_0x7303('0x31')));};exports[_0x7303('0x32')]=function(_0x4bb633){return BPromise[_0x7303('0xa')]()[_0x7303('0xb')](cmHopper[_0x7303('0x16')](_0x4bb633,!![],!![]))[_0x7303('0xe')](loggerCatch(_0x7303('0x33')));}; \ No newline at end of file +var _0xc12c=['[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','from-sip','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','createHistory','catch'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc12c,0x10b));var _0xcc12=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xc12c[_0x4ea69d];return _0x5318e0;};'use strict';var util=require('util');var BPromise=require(_0xcc12('0x0'));var logger=require('../../../config/logger')(_0xcc12('0x1'));var _=require('lodash');var cmHopper=require(_0xcc12('0x2'));var cmHopperFinal=require(_0xcc12('0x3'));var cmHopperHistory=require(_0xcc12('0x4'));var cmHopperBlack=require(_0xcc12('0x5'));var voiceQueueRt=require(_0xcc12('0x6'));var agentReportPreview=require(_0xcc12('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x31f7e5){return function(_0x392260){logger[_0xcc12('0x8')](_0x31f7e5,util[_0xcc12('0x9')](_0x392260,{'showHidden':![],'depth':null}));};}function create(_0xe93c4b){return BPromise[_0xcc12('0xa')]()['then'](cmHopperHistory[_0xcc12('0xb')](_0xe93c4b))[_0xcc12('0xc')](loggerCatch(_0xcc12('0xd')));}function createAgent(_0x5a60d8){return BPromise[_0xcc12('0xa')]()['then'](agentReportPreview[_0xcc12('0xb')](_0x5a60d8))[_0xcc12('0xc')](loggerCatch(_0xcc12('0xd')));}function moveContact(_0x22a770){return BPromise['resolve']()[_0xcc12('0xe')](cmHopper[_0xcc12('0xf')](_0x22a770,!![]))['catch'](loggerCatch(_0xcc12('0x10')));}exports[_0xcc12('0x11')]=function(_0x317bc5){return BPromise[_0xcc12('0xa')]()['then'](cmHopperBlack[_0xcc12('0x11')](_0x317bc5))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x12')));};exports[_0xcc12('0x13')]=function(_0x1cc3b6){return BPromise[_0xcc12('0xa')]()[_0xcc12('0xe')](cmHopper['getContactPreview'](_0x1cc3b6))['catch'](loggerCatch(_0xcc12('0x14')));};exports['createHistory']=function(_0x40bf5e,_0x245c4c){create(_0x40bf5e)[_0xcc12('0xc')](loggerCatch(_0x245c4c));moveContact(_0x40bf5e)[_0xcc12('0xc')](loggerCatch(_0x245c4c));};exports['createAgentHistory']=function(_0x3a4100,_0x17aa96){createAgent(_0x3a4100)[_0xcc12('0xc')](loggerCatch(_0x17aa96));};exports['createCustomerHistory']=function(_0x38b9be,_0x1555ff){create(_0x38b9be)[_0xcc12('0xc')](loggerCatch(_0x1555ff));};exports[_0xcc12('0x15')]=function(_0x466ac4,_0x10e687){moveContact(_0x466ac4)['catch'](loggerCatch(_0x10e687));};exports['rescheduleContact']=function(_0x1abd0f,_0x427362,_0x3806ce){if(_0x427362){_0x1abd0f[_0xcc12('0x16')]=null;}if(_0x3806ce){_0x1abd0f[_0xcc12('0x17')]=![];}return BPromise['resolve']()[_0xcc12('0xe')](cmHopper['rescheduleContact'](_0x1abd0f))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x18')));};exports['countReScheduled']=function(_0x10d2dc){return BPromise['resolve']()[_0xcc12('0xe')](cmHopper[_0xcc12('0x19')](_0x10d2dc))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x1a')));};exports[_0xcc12('0x1b')]=function(_0x23b909){return BPromise['resolve']()[_0xcc12('0xe')](cmHopper[_0xcc12('0x1b')]({'UserId':null},_0x23b909,0x1))['catch'](loggerCatch(_0xcc12('0x1c')));};exports[_0xcc12('0x1d')]=function(_0x149624){return BPromise['resolve']()[_0xcc12('0xe')](cmHopper[_0xcc12('0x1b')]({'active':![]},_0x149624,0x1))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x1e')));};exports[_0xcc12('0x1f')]=function(_0x328d3c){var _0x491448={};_0x491448[_0xcc12('0x20')]=_0x328d3c[_0xcc12('0x20')];_0x491448[_0xcc12('0x21')]=_0x328d3c[_0xcc12('0x21')];_0x491448[_0xcc12('0x22')]=_0x328d3c[_0xcc12('0x22')];_0x491448[_0xcc12('0x23')]=_0x328d3c[_0xcc12('0x23')];_0x491448[_0xcc12('0x24')]=_0x328d3c[_0xcc12('0x24')];_0x491448[_0xcc12('0x25')]=_0x328d3c[_0xcc12('0x26')];_0x491448['queuecallerleaveAt']=_0x328d3c[_0xcc12('0x26')];_0x491448[_0xcc12('0x27')]=0x1;_0x491448['queuecallercompleteAt']=_0x328d3c[_0xcc12('0x28')];_0x491448[_0xcc12('0x29')]=_0x328d3c[_0xcc12('0x2a')];_0x491448['context']=_0xcc12('0x2b');_0x491448[_0xcc12('0x2c')]='xcally-motion-preview';_0x491448[_0xcc12('0x2d')]=0x0;_0x491448['assigned']=0x1;_0x491448[_0xcc12('0x2e')]=_0x328d3c[_0xcc12('0x2a')];_0x491448[_0xcc12('0x2f')]=_0xcc12('0x30');return BPromise[_0xcc12('0xa')]()[_0xcc12('0xe')](voiceQueueReport[_0xcc12('0x31')](_0x491448))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x32')));};exports[_0xcc12('0x33')]=function(_0x2f35c7,_0x547020){return BPromise[_0xcc12('0xa')]()['then'](cmHopper['getContactRecallMe'](_0x2f35c7,_0x547020))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x34')));};exports[_0xcc12('0x35')]=function(_0x1e70c8){return BPromise[_0xcc12('0xa')]()[_0xcc12('0xe')](cmHopper[_0xcc12('0x36')](_0x1e70c8,!![],!![]))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x37')));}; \ 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 105bef1..b370b62 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 _0xee64=['isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','responsetime','membername','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','error','info','inspect','loggerError','logger2','isUndefined','string'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0xee64,0x189));var _0x4ee6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee64[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4ee6('0x0'));var logger=require(_0x4ee6('0x1'))(_0x4ee6('0x2'));var ipAgi=process[_0x4ee6('0x3')][_0x4ee6('0x4')]||'127.0.0.1';function getSeconds(_0x4df4c1,_0x40ba49){var _0x296583=moment(_0x4df4c1)[_0x4ee6('0x5')](0x0);var _0x278b1c=moment(_0x40ba49)[_0x4ee6('0x5')](0x0);return _0x296583[_0x4ee6('0x6')](_0x278b1c,_0x4ee6('0x7'));}exports['loggerCatch']=function(_0x1c2206){return function(_0x3b4ce2){logger[_0x4ee6('0x8')](_0x1c2206,util['inspect'](_0x3b4ce2,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x44002a,_0x4970df){logger[_0x4ee6('0x9')](_0x44002a,util[_0x4ee6('0xa')](_0x4970df,{'showHidden':![],'depth':null}));};exports[_0x4ee6('0xb')]=function(_0x564fbe,_0x4313d3){logger['error'](_0x564fbe,util[_0x4ee6('0xa')](_0x4313d3,{'showHidden':![],'depth':null}));};exports[_0x4ee6('0xc')]=function(_0x1f0e14){return function(_0x76a67d){logger['info'](_0x1f0e14,util['inspect'](_0x76a67d,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x3f840d,_0x542f5e,_0x54be14){return{'message':_0x3f840d,'unlock':_0x542f5e,'active':_0x54be14};};exports['getCallerId']=function(_0x1bdaff,_0x19c230,_0x8a0d99){if(!_[_0x4ee6('0xd')](_0x8a0d99)&&_0x4ee6('0xe')===typeof _0x8a0d99&&!_[_0x4ee6('0xf')](_0x8a0d99)){if(!_[_0x4ee6('0xd')](_0x19c230)&&_0x4ee6('0xe')===typeof _0x19c230&&!_[_0x4ee6('0xf')](_0x19c230)){return util[_0x4ee6('0x10')]('\x22%s\x22\x20<%s>',_0x19c230,_0x8a0d99);}return util[_0x4ee6('0x10')](_0x4ee6('0x11'),_0x8a0d99,_0x8a0d99);}if(!_[_0x4ee6('0xd')](_0x1bdaff)&&_0x4ee6('0xe')===typeof _0x1bdaff&&!_[_0x4ee6('0xf')](_0x1bdaff)){return _0x1bdaff;}return _0x4ee6('0x12');};exports['isActive']=function(_0xb936fd){if(_[_0x4ee6('0x13')](_0xb936fd)){return![];}return _0xb936fd;};exports[_0x4ee6('0x14')]=function(_0x390cbf,_0x5c1ebc,_0x373a87,_0x30fdb6,_0xc2a04e,_0x4b6b37){var _0x5bc498={'XMD-QUEUE':_0x5c1ebc[_0x4ee6('0x15')]?_0x5c1ebc[_0x4ee6('0x15')]['name']:'','XMD-CALLERID':_0x30fdb6,'XMD-CALLERID-PREVIEW':_0x4b6b37?util['format'](_0x4ee6('0x11'),_0x4b6b37[_0x4ee6('0x16')],_0x4b6b37['calleridnum']):_0x30fdb6,'XMD-DIALID':_0xc2a04e,'XMD-CONTACTID':_0x5c1ebc[_0x4ee6('0x17')],'XMD-CDRTYPE':_0x4ee6('0x18'),'CALLERID(all)':_0x30fdb6,'XMD-VOICEQUEUEID':_0x5c1ebc[_0x4ee6('0x19')],'XMD-DIALCHANNEL':_0x373a87,'XMD-DIALTIMEOUT':_0x390cbf[_0x4ee6('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x390cbf[_0x4ee6('0x1b')]?'g':'',_[_0x4ee6('0xf')](_0x390cbf[_0x4ee6('0x1c')])?'':_0x4ee6('0x1d')),'XMD-DIALURL':_0x390cbf[_0x4ee6('0x1e')]||'','XMD-AGI':_0x390cbf['dialQueueProject']?util[_0x4ee6('0x10')](_0x4ee6('0x1f'),ipAgi,_0x390cbf[_0x4ee6('0x20')]):_0x4ee6('0x21'),'XMD-AGIAFTER':_0x390cbf[_0x4ee6('0x1b')]?util[_0x4ee6('0x10')](_0x4ee6('0x1f'),ipAgi,_0x390cbf['dialQueueProject2']):_0x4ee6('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x4b6b37?_0x4b6b37[_0x4ee6('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x4b6b37?_0x4b6b37[_0x4ee6('0x23')]:'','XMD-DESTINATION':_0x4ee6('0x24')};if(!_[_0x4ee6('0xf')](_0x390cbf[_0x4ee6('0x1c')])){_0x5bc498[util[_0x4ee6('0x10')]('%s',_0x4ee6('0x25'))]=_0x390cbf[_0x4ee6('0x1c')];_0x5bc498[util[_0x4ee6('0x10')]('%s',_0x4ee6('0x26'))]=_0xc2a04e;}if(_0x5c1ebc&&_0x5c1ebc[_0x4ee6('0x27')]){for(var _0x4898ac in _0x5c1ebc[_0x4ee6('0x27')]){if(_0x5c1ebc['Contact'][_0x4ee6('0x28')](_0x4898ac)){if(!_[_0x4ee6('0x13')](_0x5c1ebc[_0x4ee6('0x27')][_0x4898ac])&&_0x4898ac!=='id'&&_0x4898ac!==_0x4ee6('0x29')&&_0x4898ac!=='createdAt'&&_0x4898ac!=='updatedAt'){_0x5bc498[util[_0x4ee6('0x10')]('%s%s','XMD-',_[_0x4ee6('0x2a')](_0x4898ac))]=_0x5c1ebc['Contact'][_0x4898ac];}}}}return _0x5bc498;};exports[_0x4ee6('0x2b')]=function(_0x1392c1){var _0x44f2bf={};for(var _0x2c6de1 in _0x1392c1){if(_0x1392c1[_0x4ee6('0x28')](_0x2c6de1)){_0x44f2bf[util[_0x4ee6('0x10')]('%s',_['toLower'](_0x2c6de1))]=_0x1392c1[_0x2c6de1];}}return{'variables':_0x44f2bf};};exports[_0x4ee6('0x2c')]=function(_0x5f07ce,_0x8cb7ec){if(!_['isNil'](_0x5f07ce)){if(_0x5f07ce[_0x4ee6('0x28')](_0x4ee6('0x2d'))){if(_0x5f07ce['originated']>0x0){_0x5f07ce[_0x4ee6('0x2d')]-=0x1;}else{logger[_0x4ee6('0x8')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x8cb7ec);}}}else{logger['error'](_0x4ee6('0x2e'),_0x8cb7ec);}};exports[_0x4ee6('0x2f')]=function(_0x3d8aaa){var _0x5d544d=moment()[_0x4ee6('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d8aaa[_0x4ee6('0x30')]=0xd;_0x3d8aaa[_0x4ee6('0x31')]=_0x4ee6('0x32');_0x3d8aaa[_0x4ee6('0x33')]=_0x5d544d;_0x3d8aaa['responsetime']=_0x5d544d;_0x3d8aaa[_0x4ee6('0x34')]=_0x5d544d;};exports[_0x4ee6('0x35')]=function(_0x20613e,_0x14b4a5,_0x4c8033){var _0x207807=moment()[_0x4ee6('0x10')](_0x4ee6('0x36'));_0x20613e['state']=_0x14b4a5;_0x20613e[_0x4ee6('0x31')]=_0x4c8033;_0x20613e[_0x4ee6('0x37')]=_0x207807;_0x20613e['ringtime']=getSeconds(_0x20613e['responsetime'],_0x20613e[_0x4ee6('0x33')]);};exports['logLookAgent']=function(_0x5dbf93,_0x369515,_0x5c7287){_0x5dbf93[_0x4ee6('0x38')]=_0x369515;_0x5dbf93['UserId']=_0x5c7287;};exports['logCustomer']=function(_0x2ca9d6,_0x275665,_0x21f988){var _0xfa9f4b=moment()[_0x4ee6('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ca9d6[_0x4ee6('0x30')]=_0x275665;_0x2ca9d6[_0x4ee6('0x31')]=_0x21f988;_0x2ca9d6[_0x4ee6('0x37')]=_0x2ca9d6[_0x4ee6('0x37')]?_0x2ca9d6[_0x4ee6('0x37')]:_0xfa9f4b;_0x2ca9d6['endtime']=_0x2ca9d6['endtime']?_0x2ca9d6[_0x4ee6('0x34')]:_0xfa9f4b;_0x2ca9d6['ringtime']=getSeconds(_0x2ca9d6[_0x4ee6('0x37')]||0x0,_0x2ca9d6[_0x4ee6('0x33')]||0x0);_0x2ca9d6[_0x4ee6('0x39')]=_0x2ca9d6[_0x4ee6('0x3a')]?getSeconds(_0x2ca9d6[_0x4ee6('0x34')],_0x2ca9d6['answertime']):0x0;};exports[_0x4ee6('0x3b')]=function(_0x1e75b0){return _0x1e75b0===_0x4ee6('0x3c');};exports['variablesAction']=function(_0x48ea0d,_0x5ebd90,_0x4d8cba,_0x1edb73,_0x3ade9b){var _0x17448a=_0x1edb73?_0x4ee6('0x3d'):_0x48ea0d[_0x4ee6('0x16')];_0x17448a=_0x3ade9b?_0x4ee6('0x3e'):_0x17448a;return{'actionid':_0x48ea0d[_0x4ee6('0x3f')],'action':_0x4ee6('0x40'),'channel':_0x48ea0d[_0x4ee6('0x41')],'callerid':util[_0x4ee6('0x10')]('\x22%s\x22\x20<%s>',_0x17448a,_0x48ea0d[_0x4ee6('0x42')]),'Exten':_0x4ee6('0x24'),'Context':_0x4ee6('0x43'),'Priority':'1','variable':_0x4d8cba,'timeout':(_0x5ebd90['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x48ea0d['uniqueid']};};exports[_0x4ee6('0x44')]=function(_0x5c5721){return _0x5c5721[_0x4ee6('0x45')]+_0x5c5721[_0x4ee6('0x46')]+_0x5c5721[_0x4ee6('0x47')]+_0x5c5721['countagentrejectretry']+_0x5c5721[_0x4ee6('0x48')];};exports[_0x4ee6('0x49')]=function(_0x36deed){var _0x4a0c5f=_[_0x4ee6('0x4a')](_0x36deed);_0x4a0c5f[_0x4ee6('0x30')]=0xf;_0x4a0c5f[_0x4ee6('0x31')]='Global';return _0x4a0c5f;};exports[_0x4ee6('0x4b')]=function(_0x5eb2d8,_0x1b8c6f,_0x3f8999){var _0x3afbd0={};_0x3afbd0[_0x1b8c6f]=_0x5eb2d8[_0x1b8c6f];_0x3afbd0['active']=![];_0x3afbd0[_0x4ee6('0x4c')]=moment()[_0x4ee6('0x4d')](_0x3f8999,'minutes')[_0x4ee6('0x10')](_0x4ee6('0x36'));_0x3afbd0[_0x4ee6('0x17')]=_0x5eb2d8[_0x4ee6('0x17')];_0x3afbd0[_0x4ee6('0x4e')]=_0x5eb2d8['ListId'];_0x3afbd0['VoiceQueueId']=_0x5eb2d8[_0x4ee6('0x19')]||undefined;return _0x3afbd0;};exports[_0x4ee6('0x4f')]=function(_0x717ffb,_0x47652b){if(!_[_0x4ee6('0x13')](_0x717ffb)){if(_0x717ffb['pTalking']>0x0){_0x717ffb[_0x4ee6('0x50')]-=0x1;}else{logger[_0x4ee6('0x8')](_0x47652b,_0x4ee6('0x51'));}}else{logger['error'](_0x47652b,_0x4ee6('0x52'));}};exports[_0x4ee6('0x53')]=function(_0x5e9619){if(_0x5e9619<=0x0){return!![];}return![];};exports['buildObj']=function(_0x1f6eb0,_0x2a30af,_0x47f516){_0x1f6eb0['lastevent']=_0x2a30af;_0x1f6eb0[_0x4ee6('0x54')]=_0x1f6eb0[_0x4ee6('0x55')];_0x1f6eb0[_0x4ee6('0x56')]=_0x1f6eb0['channelAgent'];_0x1f6eb0['motionChannel']=_0x4ee6('0x57');if(_0x47f516){_0x1f6eb0[_0x4ee6('0x58')]=_0x47f516[_0x4ee6('0x58')];}return _0x1f6eb0;};exports[_0x4ee6('0x59')]=function(_0x4936d8){var _0x2edd4a={};_0x2edd4a[_0x4ee6('0x55')]=_0x4936d8[_0x4ee6('0x55')];_0x2edd4a[_0x4ee6('0x56')]=_0x4936d8[_0x4ee6('0x41')];_0x2edd4a[_0x4ee6('0x3f')]=_0x4936d8[_0x4ee6('0x3f')];return _0x2edd4a;};exports[_0x4ee6('0x5a')]=function(_0x3c3232){var _0x1828e0=[];for(var _0xb2ce32 in _0x3c3232){if(_0x3c3232[_0x4ee6('0x28')](_0xb2ce32)){if(!_[_0x4ee6('0x13')](_0x3c3232[_0xb2ce32])&&_0x3c3232[_0xb2ce32][_0x4ee6('0x30')]===_0x4ee6('0x5b')&&_0x3c3232[_0xb2ce32][_0x4ee6('0x5c')]===_0x4ee6('0x5d')){_0x1828e0[_0x4ee6('0x5e')](_0x3c3232[_0xb2ce32]['id']);}}}return _0x1828e0;};exports[_0x4ee6('0x5f')]=function(_0x310bfb){var _0xc88302=moment()[_0x4ee6('0x5')](0x0);var _0x3ab022=moment(_0x310bfb)[_0x4ee6('0x5')](0x0);return _0xc88302[_0x4ee6('0x6')](_0x3ab022,'seconds');};exports[_0x4ee6('0x60')]=function(_0x5ea6a2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5ea6a2[_0x4ee6('0x17')],'ListId':_0x5ea6a2[_0x4ee6('0x4e')],'VoiceQueueId':_0x5ea6a2[_0x4ee6('0x19')]||undefined,'CampaignId':_0x5ea6a2[_0x4ee6('0x61')]||undefined};};exports[_0x4ee6('0x62')]=function(_0x1100b1){if(_0x1100b1==='uniqueid'||_0x1100b1===_0x4ee6('0x63')||_0x1100b1===_0x4ee6('0x55')||_0x1100b1===_0x4ee6('0x64')||_0x1100b1===_0x4ee6('0x65')||_0x1100b1===_0x4ee6('0x66')||_0x1100b1==='membername'||_0x1100b1===_0x4ee6('0x41')||_0x1100b1===_0x4ee6('0x16')||_0x1100b1===_0x4ee6('0x67')||_0x1100b1===_0x4ee6('0x42')||_0x1100b1==='scheduledat'||_0x1100b1===_0x4ee6('0x45')||_0x1100b1===_0x4ee6('0x46')||_0x1100b1===_0x4ee6('0x47')||_0x1100b1===_0x4ee6('0x68')||_0x1100b1===_0x4ee6('0x69')||_0x1100b1===_0x4ee6('0x6a')||_0x1100b1==='callbackat'||_0x1100b1===_0x4ee6('0x6b')||_0x1100b1==='ContactId'||_0x1100b1===_0x4ee6('0x4e')||_0x1100b1==='UserId'||_0x1100b1===_0x4ee6('0x19')||_0x1100b1===_0x4ee6('0x6c')||_0x1100b1===_0x4ee6('0x6d')||_0x1100b1===_0x4ee6('0x6e')||_0x1100b1===_0x4ee6('0x6f')||_0x1100b1===_0x4ee6('0x70')||_0x1100b1==='xmd-dialurl'||_0x1100b1===_0x4ee6('0x71')||_0x1100b1===_0x4ee6('0x72')||_0x1100b1===_0x4ee6('0x73')||_0x1100b1==='xmd-dialchannel'||_0x1100b1===_0x4ee6('0x74')||_0x1100b1===_0x4ee6('0x75')||_0x1100b1===_0x4ee6('0x76')||_0x1100b1===_0x4ee6('0x77')||_0x1100b1===_0x4ee6('0x78')||_0x1100b1===_0x4ee6('0x79')||_0x1100b1===_0x4ee6('0x7a')||_0x1100b1==='rtpaudioqosjitter'||_0x1100b1==='rtpaudioqosjitterbridged'||_0x1100b1==='rtpaudioqosloss'||_0x1100b1==='rtpaudioqoslossbridged'||_0x1100b1===_0x4ee6('0x7b')||_0x1100b1===_0x4ee6('0x7c')||_0x1100b1===_0x4ee6('0x79')||_0x1100b1===_0x4ee6('0x7a')||_0x1100b1===_0x4ee6('0x7d')||_0x1100b1==='rtpaudioqosjitterbridged'||_0x1100b1===_0x4ee6('0x7e')||_0x1100b1===_0x4ee6('0x7f')||_0x1100b1===_0x4ee6('0x7b')||_0x1100b1==='rtpaudioqosrttbridged'||_0x1100b1===_0x4ee6('0x80')||_0x1100b1===_0x4ee6('0x81')||_0x1100b1===_0x4ee6('0x30')||_0x1100b1===_0x4ee6('0x31')){return![];}return!![];};exports[_0x4ee6('0x82')]=function(_0x19371d,_0x25ebdf){var _0x45da1d,_0x43fb0a,_0x436d04;if(_0x25ebdf<=0x0){_0x25ebdf=0x1;}_0x45da1d=new RegExp(_0x4ee6('0x83')+_0x25ebdf+'}$');_0x43fb0a=Math[_0x4ee6('0x84')](0xa,_0x25ebdf-0x1);_0x436d04=Math['pow'](0xa,_0x25ebdf)-0x1;return util[_0x4ee6('0x10')]('%s',_['replace'](_0x19371d,_0x45da1d,_[_0x4ee6('0x85')](_0x43fb0a,_0x436d04)));};exports[_0x4ee6('0x86')]=function(_0x253d49){var _0x299703=_0x253d49[_0x4ee6('0x87')](/"(.*?)"/);return _0x299703?_0x299703[0x1]:_0x253d49;};exports['extractCalleridNumber']=function(_0x5a9d48){var _0x50b30f=_0x5a9d48[_0x4ee6('0x87')](/<(.*?)>/);return _0x50b30f?_0x50b30f[0x1]:_0x5a9d48;}; \ No newline at end of file +var _0x6a9d=['extractCalleridNumber','lodash','moment','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','statedesc','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','totalGlobal','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','motionChannel','voice','mandatoryDisposition','buildAcw','queue','interface','channelAgent','agentReadyId','not_inuse','status','reachable','push','createBody','CampaignId','filterKey','idContact','active','scheduledat','countbusyretry','countnoanswerretry','countglobal','callback','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqoslossbridged','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','match'];(function(_0x36741d,_0x427fed){var _0x260fff=function(_0x27d61b){while(--_0x27d61b){_0x36741d['push'](_0x36741d['shift']());}};_0x260fff(++_0x427fed);}(_0x6a9d,0x91));var _0xd6a9=function(_0x88582e,_0x34aa5f){_0x88582e=_0x88582e-0x0;var _0x29057e=_0x6a9d[_0x88582e];return _0x29057e;};'use strict';var util=require('util');var _=require(_0xd6a9('0x0'));var moment=require(_0xd6a9('0x1'));var logger=require('../../../../config/logger')(_0xd6a9('0x2'));var ipAgi=process['env'][_0xd6a9('0x3')]||_0xd6a9('0x4');function getSeconds(_0x14f441,_0x222a5a){var _0x44a08b=moment(_0x14f441)[_0xd6a9('0x5')](0x0);var _0x4940b2=moment(_0x222a5a)['milliseconds'](0x0);return _0x44a08b[_0xd6a9('0x6')](_0x4940b2,_0xd6a9('0x7'));}exports['loggerCatch']=function(_0x16078b){return function(_0x56cfc7){logger[_0xd6a9('0x8')](_0x16078b,util[_0xd6a9('0x9')](_0x56cfc7,{'showHidden':![],'depth':null}));};};exports[_0xd6a9('0xa')]=function(_0x37a568,_0x372b7c){logger[_0xd6a9('0xb')](_0x37a568,util[_0xd6a9('0x9')](_0x372b7c,{'showHidden':![],'depth':null}));};exports[_0xd6a9('0xc')]=function(_0xb52cc3,_0x278628){logger[_0xd6a9('0x8')](_0xb52cc3,util[_0xd6a9('0x9')](_0x278628,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0xa693e3){return function(_0x53da0b){logger[_0xd6a9('0xb')](_0xa693e3,util[_0xd6a9('0x9')](_0x53da0b,{'showHidden':![],'depth':null}));};};exports[_0xd6a9('0xd')]=function(_0x47cfd7,_0x594886,_0x205656){return{'message':_0x47cfd7,'unlock':_0x594886,'active':_0x205656};};exports['getCallerId']=function(_0x24724b,_0x20a3bc,_0x478996){if(!_[_0xd6a9('0xe')](_0x478996)&&_0xd6a9('0xf')===typeof _0x478996&&!_['isEmpty'](_0x478996)){if(!_[_0xd6a9('0xe')](_0x20a3bc)&&_0xd6a9('0xf')===typeof _0x20a3bc&&!_[_0xd6a9('0x10')](_0x20a3bc)){return util[_0xd6a9('0x11')](_0xd6a9('0x12'),_0x20a3bc,_0x478996);}return util[_0xd6a9('0x11')](_0xd6a9('0x12'),_0x478996,_0x478996);}if(!_[_0xd6a9('0xe')](_0x24724b)&&_0xd6a9('0xf')===typeof _0x24724b&&!_[_0xd6a9('0x10')](_0x24724b)){return _0x24724b;}return'\x22\x22\x20<>';};exports[_0xd6a9('0x13')]=function(_0x28fc29){if(_[_0xd6a9('0x14')](_0x28fc29)){return![];}return _0x28fc29;};exports[_0xd6a9('0x15')]=function(_0x4794b2,_0x495aec,_0x3f1b9a,_0xfdf9d0,_0x685667,_0x245060){var _0x54d41d={'XMD-QUEUE':_0x495aec[_0xd6a9('0x16')]?_0x495aec['Queue'][_0xd6a9('0x17')]:'','XMD-CALLERID':_0xfdf9d0,'XMD-CALLERID-PREVIEW':_0x245060?util[_0xd6a9('0x11')]('\x22%s\x22\x20<%s>',_0x245060[_0xd6a9('0x18')],_0x245060[_0xd6a9('0x19')]):_0xfdf9d0,'XMD-DIALID':_0x685667,'XMD-CONTACTID':_0x495aec[_0xd6a9('0x1a')],'XMD-CDRTYPE':_0xd6a9('0x1b'),'CALLERID(all)':_0xfdf9d0,'XMD-VOICEQUEUEID':_0x495aec['VoiceQueueId'],'XMD-DIALCHANNEL':_0x3f1b9a,'XMD-DIALTIMEOUT':_0x4794b2['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0xd6a9('0x1c'),_0x4794b2[_0xd6a9('0x1d')]?'g':'',_['isEmpty'](_0x4794b2['monitor_format'])?'':_0xd6a9('0x1e')),'XMD-DIALURL':_0x4794b2[_0xd6a9('0x1f')]||'','XMD-AGI':_0x4794b2['dialQueueProject']?util[_0xd6a9('0x11')](_0xd6a9('0x20'),ipAgi,_0x4794b2[_0xd6a9('0x21')]):'NONE','XMD-AGIAFTER':_0x4794b2[_0xd6a9('0x1d')]?util[_0xd6a9('0x11')](_0xd6a9('0x20'),ipAgi,_0x4794b2[_0xd6a9('0x1d')]):_0xd6a9('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x245060?_0x245060[_0xd6a9('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x245060?_0x245060[_0xd6a9('0x24')]:'','XMD-DESTINATION':_0xd6a9('0x25')};if(!_[_0xd6a9('0x10')](_0x4794b2[_0xd6a9('0x26')])){_0x54d41d[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4794b2[_0xd6a9('0x26')];_0x54d41d[util[_0xd6a9('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x685667;}if(_0x495aec&&_0x495aec[_0xd6a9('0x27')]){for(var _0x174105 in _0x495aec['Contact']){if(_0x495aec[_0xd6a9('0x27')][_0xd6a9('0x28')](_0x174105)){if(!_[_0xd6a9('0x14')](_0x495aec['Contact'][_0x174105])&&_0x174105!=='id'&&_0x174105!==_0xd6a9('0x29')&&_0x174105!==_0xd6a9('0x2a')&&_0x174105!==_0xd6a9('0x2b')){_0x54d41d[util[_0xd6a9('0x11')](_0xd6a9('0x2c'),_0xd6a9('0x2d'),_[_0xd6a9('0x2e')](_0x174105))]=_0x495aec['Contact'][_0x174105];}}}}return _0x54d41d;};exports[_0xd6a9('0x2f')]=function(_0x26e5e2){var _0x288c88={};for(var _0x14c5c5 in _0x26e5e2){if(_0x26e5e2[_0xd6a9('0x28')](_0x14c5c5)){_0x288c88[util[_0xd6a9('0x11')]('%s',_[_0xd6a9('0x30')](_0x14c5c5))]=_0x26e5e2[_0x14c5c5];}}return{'variables':_0x288c88};};exports['updateOriginated']=function(_0x212b34,_0x418e78){if(!_[_0xd6a9('0x14')](_0x212b34)){if(_0x212b34['hasOwnProperty'](_0xd6a9('0x31'))){if(_0x212b34['originated']>0x0){_0x212b34[_0xd6a9('0x31')]-=0x1;}else{logger[_0xd6a9('0x8')](_0xd6a9('0x32'),_0x418e78);}}}else{logger[_0xd6a9('0x8')](_0xd6a9('0x33'),_0x418e78);}};exports['logBlacklist']=function(_0x186213){var _0x18ecb6=moment()[_0xd6a9('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x186213[_0xd6a9('0x34')]=0xd;_0x186213['statedesc']='Blacklist';_0x186213[_0xd6a9('0x35')]=_0x18ecb6;_0x186213[_0xd6a9('0x36')]=_0x18ecb6;_0x186213[_0xd6a9('0x37')]=_0x18ecb6;};exports[_0xd6a9('0x38')]=function(_0x528608,_0x300353,_0x2da3a3){var _0x26d9b4=moment()['format'](_0xd6a9('0x39'));_0x528608[_0xd6a9('0x34')]=_0x300353;_0x528608['statedesc']=_0x2da3a3;_0x528608[_0xd6a9('0x36')]=_0x26d9b4;_0x528608[_0xd6a9('0x3a')]=getSeconds(_0x528608[_0xd6a9('0x36')],_0x528608[_0xd6a9('0x35')]);};exports[_0xd6a9('0x3b')]=function(_0x56a0ec,_0x3ac6d9,_0x69f2b5){_0x56a0ec[_0xd6a9('0x3c')]=_0x3ac6d9;_0x56a0ec[_0xd6a9('0x3d')]=_0x69f2b5;};exports['logCustomer']=function(_0x725f22,_0x4b55d3,_0x4f96a4){var _0xda763a=moment()[_0xd6a9('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x725f22[_0xd6a9('0x34')]=_0x4b55d3;_0x725f22[_0xd6a9('0x3e')]=_0x4f96a4;_0x725f22[_0xd6a9('0x36')]=_0x725f22[_0xd6a9('0x36')]?_0x725f22['responsetime']:_0xda763a;_0x725f22[_0xd6a9('0x37')]=_0x725f22[_0xd6a9('0x37')]?_0x725f22['endtime']:_0xda763a;_0x725f22['ringtime']=getSeconds(_0x725f22['responsetime']||0x0,_0x725f22[_0xd6a9('0x35')]||0x0);_0x725f22[_0xd6a9('0x3f')]=_0x725f22[_0xd6a9('0x40')]?getSeconds(_0x725f22[_0xd6a9('0x37')],_0x725f22[_0xd6a9('0x40')]):0x0;};exports[_0xd6a9('0x41')]=function(_0x409291){return _0x409291===_0xd6a9('0x42');};exports[_0xd6a9('0x43')]=function(_0x4efcfe,_0x411744,_0x4f03a3,_0xe42f99,_0x3619e4){var _0xb38c11=_0xe42f99?_0xd6a9('0x44'):_0x4efcfe['calleridname'];_0xb38c11=_0x3619e4?_0xd6a9('0x45'):_0xb38c11;return{'actionid':_0x4efcfe[_0xd6a9('0x46')],'action':_0xd6a9('0x47'),'channel':_0x4efcfe['channelAgent'],'callerid':util[_0xd6a9('0x11')]('\x22%s\x22\x20<%s>',_0xb38c11,_0x4efcfe[_0xd6a9('0x19')]),'Exten':_0xd6a9('0x25'),'Context':_0xd6a9('0x48'),'Priority':'1','variable':_0x4f03a3,'timeout':(_0x411744['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4efcfe[_0xd6a9('0x46')]};};exports[_0xd6a9('0x49')]=function(_0x5bb125){return _0x5bb125['countbusyretry']+_0x5bb125[_0xd6a9('0x4a')]+_0x5bb125['countnoanswerretry']+_0x5bb125[_0xd6a9('0x4b')]+_0x5bb125[_0xd6a9('0x4c')];};exports[_0xd6a9('0x4d')]=function(_0x2543d6){var _0x596a36=_[_0xd6a9('0x4e')](_0x2543d6);_0x596a36[_0xd6a9('0x34')]=0xf;_0x596a36[_0xd6a9('0x3e')]='Global';return _0x596a36;};exports[_0xd6a9('0x4f')]=function(_0x4b63b2,_0x1a937a,_0x364e0f){var _0x592a3c={};_0x592a3c[_0x1a937a]=_0x4b63b2[_0x1a937a];_0x592a3c['active']=![];_0x592a3c['scheduledat']=moment()[_0xd6a9('0x50')](_0x364e0f,_0xd6a9('0x51'))[_0xd6a9('0x11')](_0xd6a9('0x39'));_0x592a3c['ContactId']=_0x4b63b2[_0xd6a9('0x1a')];_0x592a3c[_0xd6a9('0x52')]=_0x4b63b2[_0xd6a9('0x52')];_0x592a3c[_0xd6a9('0x53')]=_0x4b63b2[_0xd6a9('0x53')]||undefined;return _0x592a3c;};exports[_0xd6a9('0x54')]=function(_0x29da47,_0x32bdae){if(!_[_0xd6a9('0x14')](_0x29da47)){if(_0x29da47[_0xd6a9('0x55')]>0x0){_0x29da47[_0xd6a9('0x55')]-=0x1;}else{logger['error'](_0x32bdae,_0xd6a9('0x56'));}}else{logger[_0xd6a9('0x8')](_0x32bdae,_0xd6a9('0x57'));}};exports[_0xd6a9('0x58')]=function(_0x594ca8){if(_0x594ca8<=0x0){return!![];}return![];};exports[_0xd6a9('0x59')]=function(_0x1945ef,_0x172bfb,_0x1649f2){_0x1945ef[_0xd6a9('0x5a')]=_0x172bfb;_0x1945ef[_0xd6a9('0x17')]=_0x1945ef['queue'];_0x1945ef['interface']=_0x1945ef['channelAgent'];_0x1945ef[_0xd6a9('0x5b')]=_0xd6a9('0x5c');if(_0x1649f2){_0x1945ef['mandatoryDisposition']=_0x1649f2[_0xd6a9('0x5d')];}return _0x1945ef;};exports[_0xd6a9('0x5e')]=function(_0x5efe3a){var _0x1a690a={};_0x1a690a[_0xd6a9('0x5f')]=_0x5efe3a[_0xd6a9('0x5f')];_0x1a690a[_0xd6a9('0x60')]=_0x5efe3a[_0xd6a9('0x61')];_0x1a690a[_0xd6a9('0x46')]=_0x5efe3a[_0xd6a9('0x46')];return _0x1a690a;};exports[_0xd6a9('0x62')]=function(_0x48b6bb){var _0x23fc11=[];for(var _0x3ed76b in _0x48b6bb){if(_0x48b6bb[_0xd6a9('0x28')](_0x3ed76b)){if(!_[_0xd6a9('0x14')](_0x48b6bb[_0x3ed76b])&&_0x48b6bb[_0x3ed76b][_0xd6a9('0x34')]===_0xd6a9('0x63')&&_0x48b6bb[_0x3ed76b][_0xd6a9('0x64')]===_0xd6a9('0x65')){_0x23fc11[_0xd6a9('0x66')](_0x48b6bb[_0x3ed76b]['id']);}}}return _0x23fc11;};exports['getDiff']=function(_0x5c7366){var _0x3c8127=moment()[_0xd6a9('0x5')](0x0);var _0x1f7fc9=moment(_0x5c7366)[_0xd6a9('0x5')](0x0);return _0x3c8127[_0xd6a9('0x6')](_0x1f7fc9,_0xd6a9('0x7'));};exports[_0xd6a9('0x67')]=function(_0x241b14){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x241b14[_0xd6a9('0x1a')],'ListId':_0x241b14['ListId'],'VoiceQueueId':_0x241b14[_0xd6a9('0x53')]||undefined,'CampaignId':_0x241b14[_0xd6a9('0x68')]||undefined};};exports[_0xd6a9('0x69')]=function(_0x3a520d){if(_0x3a520d===_0xd6a9('0x46')||_0x3a520d===_0xd6a9('0x6a')||_0x3a520d===_0xd6a9('0x5f')||_0x3a520d==='type'||_0x3a520d==='campaigntype'||_0x3a520d==='dialAnswer'||_0x3a520d===_0xd6a9('0x3c')||_0x3a520d===_0xd6a9('0x61')||_0x3a520d===_0xd6a9('0x18')||_0x3a520d===_0xd6a9('0x6b')||_0x3a520d===_0xd6a9('0x19')||_0x3a520d===_0xd6a9('0x6c')||_0x3a520d===_0xd6a9('0x6d')||_0x3a520d===_0xd6a9('0x4a')||_0x3a520d===_0xd6a9('0x6e')||_0x3a520d===_0xd6a9('0x6f')||_0x3a520d===_0xd6a9('0x70')||_0x3a520d==='callbackuniqueid'||_0x3a520d===_0xd6a9('0x71')||_0x3a520d==='recallme'||_0x3a520d===_0xd6a9('0x1a')||_0x3a520d===_0xd6a9('0x52')||_0x3a520d===_0xd6a9('0x3d')||_0x3a520d===_0xd6a9('0x53')||_0x3a520d===_0xd6a9('0x72')||_0x3a520d===_0xd6a9('0x73')||_0x3a520d===_0xd6a9('0x74')||_0x3a520d===_0xd6a9('0x75')||_0x3a520d===_0xd6a9('0x76')||_0x3a520d===_0xd6a9('0x77')||_0x3a520d===_0xd6a9('0x78')||_0x3a520d===_0xd6a9('0x79')||_0x3a520d===_0xd6a9('0x7a')||_0x3a520d===_0xd6a9('0x7b')||_0x3a520d===_0xd6a9('0x7c')||_0x3a520d===_0xd6a9('0x7d')||_0x3a520d===_0xd6a9('0x7e')||_0x3a520d===_0xd6a9('0x7f')||_0x3a520d===_0xd6a9('0x80')||_0x3a520d==='rtpaudioqos'||_0x3a520d===_0xd6a9('0x81')||_0x3a520d===_0xd6a9('0x82')||_0x3a520d===_0xd6a9('0x83')||_0x3a520d===_0xd6a9('0x84')||_0x3a520d==='rtpaudioqoslossbridged'||_0x3a520d===_0xd6a9('0x85')||_0x3a520d===_0xd6a9('0x86')||_0x3a520d===_0xd6a9('0x87')||_0x3a520d===_0xd6a9('0x81')||_0x3a520d===_0xd6a9('0x82')||_0x3a520d==='rtpaudioqosjitterbridged'||_0x3a520d===_0xd6a9('0x84')||_0x3a520d===_0xd6a9('0x88')||_0x3a520d===_0xd6a9('0x85')||_0x3a520d===_0xd6a9('0x86')||_0x3a520d==='bridgepeer'||_0x3a520d===_0xd6a9('0x89')||_0x3a520d==='state'||_0x3a520d===_0xd6a9('0x3e')){return![];}return!![];};exports['getCallerIdRandom']=function(_0xfe3bff,_0x55006f){var _0x1d4ddd,_0x2d3b40,_0x2ae00b;if(_0x55006f<=0x0){_0x55006f=0x1;}_0x1d4ddd=new RegExp(_0xd6a9('0x8a')+_0x55006f+'}$');_0x2d3b40=Math[_0xd6a9('0x8b')](0xa,_0x55006f-0x1);_0x2ae00b=Math[_0xd6a9('0x8b')](0xa,_0x55006f)-0x1;return util[_0xd6a9('0x11')]('%s',_[_0xd6a9('0x8c')](_0xfe3bff,_0x1d4ddd,_['random'](_0x2d3b40,_0x2ae00b)));};exports[_0xd6a9('0x8d')]=function(_0xb9d500){var _0x21b8e8=_0xb9d500[_0xd6a9('0x8e')](/"(.*?)"/);return _0x21b8e8?_0x21b8e8[0x1]:_0xb9d500;};exports[_0xd6a9('0x8f')]=function(_0x30ec77){var _0xa2fb4f=_0x30ec77['match'](/<(.*?)>/);return _0xa2fb4f?_0xa2fb4f[0x1]:_0x30ec77;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 70f1e0e..518cac9 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 _0x6069=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','queueremove','queuepause','boolean','reload','voicequeuechannel'];(function(_0x36582c,_0x50cdec){var _0x51fe28=function(_0x5144bc){while(--_0x5144bc){_0x36582c['push'](_0x36582c['shift']());}};_0x51fe28(++_0x50cdec);}(_0x6069,0x17f));var _0x9606=function(_0x43451d,_0x4ab7be){_0x43451d=_0x43451d-0x0;var _0xb42a72=_0x6069[_0x43451d];return _0xb42a72;};'use strict';exports[_0x9606('0x0')]={'queue':{'type':_0x9606('0x1'),'required':!![]},'interface':{'type':_0x9606('0x1'),'required':!![]},'membername':{'type':_0x9606('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x9606('0x2')]={'queue':{'type':_0x9606('0x1'),'required':!![]},'interface':{'type':_0x9606('0x1'),'required':!![]}};exports[_0x9606('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x9606('0x4')},'reason':{'type':_0x9606('0x1'),'required':![]}};exports[_0x9606('0x5')]={'module':{'type':_0x9606('0x1'),'required':![]}};exports[_0x9606('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x9606('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x9606('0x1')},'format':{'type':_0x9606('0x1')},'mixmonitorid':{'type':_0x9606('0x1')}};exports[_0x9606('0x8')]={'uniqueid':{'type':_0x9606('0x1'),'required':!![]}};exports[_0x9606('0x9')]={'uniqueid':{'type':_0x9606('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x4a47=['number','queueremove','queuepause','reload','voicechannel','voicequeuechannelredirect','queueadd','string'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x4a47,0x146));var _0x74a4=function(_0x2af276,_0xb15ec5){_0x2af276=_0x2af276-0x0;var _0x4c586e=_0x4a47[_0x2af276];return _0x4c586e;};'use strict';exports[_0x74a4('0x0')]={'queue':{'type':_0x74a4('0x1'),'required':!![]},'interface':{'type':_0x74a4('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x74a4('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x74a4('0x3')]={'queue':{'type':_0x74a4('0x1'),'required':!![]},'interface':{'type':_0x74a4('0x1'),'required':!![]}};exports[_0x74a4('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x74a4('0x1'),'required':![]}};exports[_0x74a4('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x74a4('0x1'),'required':!![]}};exports[_0x74a4('0x6')]={'uniqueid':{'type':_0x74a4('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x74a4('0x1')},'mixmonitorid':{'type':_0x74a4('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x74a4('0x1'),'required':!![]}};exports[_0x74a4('0x7')]={'uniqueid':{'type':_0x74a4('0x1'),'required':!![]},'exten':{'type':_0x74a4('0x1'),'required':!![]},'context':{'type':_0x74a4('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2af8fc7..933fdc8 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 _0x6046=['initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','triggers','campaigns','templates','voiceExtensions','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','format','SIP/%s','name','mapKeys','isNil','interface','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','total','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','initTelephones','mergeFromDatabase','initVoiceQueues','voiceQueues','isUndefined','initTriggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','uniqueid','queue','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerexitAt','seconds','queuecallerleaveAt','initVoiceCallReports','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions'];(function(_0x4fcae6,_0x22526e){var _0x58ee40=function(_0x55e900){while(--_0x55e900){_0x4fcae6['push'](_0x4fcae6['shift']());}};_0x58ee40(++_0x22526e);}(_0x6046,0x197));var _0x6604=function(_0x469e1b,_0x3bd879){_0x469e1b=_0x469e1b-0x0;var _0x5db381=_0x6046[_0x469e1b];return _0x5db381;};'use strict';var BPromise=require(_0x6604('0x0'));var util=require('util');var _=require(_0x6604('0x1'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0x6604('0x2'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x6604('0x3'));var Campaign=require(_0x6604('0x4'));var VoiceExtension=require(_0x6604('0x5'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x6604('0x6'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x6604('0x7'));var ServicenowAccount=require(_0x6604('0x8'));var Dynamics365Account=require(_0x6604('0x9'));var FreshsalesAccount=require(_0x6604('0xa'));var FaxAccount=require(_0x6604('0xb'));var Realtime=function(){this[_0x6604('0xc')]={};this[_0x6604('0xd')]={};this[_0x6604('0xe')]={};this['voiceQueues']={};this[_0x6604('0xf')]={};this[_0x6604('0x10')]={};this[_0x6604('0x11')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x6604('0x12')]={};this['channels']={};this['queueChannels']={};this[_0x6604('0x13')]={};this['timers']={};this[_0x6604('0x14')]={};this[_0x6604('0x15')]={};this[_0x6604('0x16')]={};this[_0x6604('0x17')]={};this[_0x6604('0x18')]={};this['zohoAccounts']={};this[_0x6604('0x19')]={};this[_0x6604('0x1a')]={};this[_0x6604('0x1b')]={};this[_0x6604('0x1c')]={};this[_0x6604('0x1d')]={};this[_0x6604('0x1e')]={};};function freeIsNotKey(_0x53497a,_0x277e25,_0xd01cec){var _0x55fe11=_['mapKeys'](_0x53497a,function(_0x3dd3b9,_0x180330){return _0x3dd3b9[_0xd01cec];});for(var _0x9e57c2 in _0x277e25){if(_0x277e25[_0x6604('0x1f')](_0x9e57c2)){if(!_0x55fe11[_0x9e57c2]){delete _0x277e25[_0x9e57c2];}}}}function freeIsNotKeySip(_0x45fdcd,_0x22efd3){var _0x29b8cb=_['mapKeys'](_0x45fdcd,function(_0x198d1d,_0x458f07){return util[_0x6604('0x20')](_0x6604('0x21'),_0x198d1d[_0x6604('0x22')]);});for(var _0x23e76e in _0x22efd3){if(_0x22efd3[_0x6604('0x1f')](_0x23e76e)){if(!_0x29b8cb[_0x23e76e]){delete _0x22efd3[_0x23e76e];}}}}function freeIsNotKeyAgent(_0x45cdf0,_0x34560d){var _0x16913d=_[_0x6604('0x23')](_0x45cdf0,function(_0x49140,_0x589b6d){var _0x441f74=_[_0x6604('0x24')](_0x49140[_0x6604('0x25')])?util[_0x6604('0x20')](_0x6604('0x21'),_0x49140['name']):_0x49140['interface'];return _0x441f74;});for(var _0x2d75f2 in _0x34560d){if(_0x34560d[_0x6604('0x1f')](_0x2d75f2)){if(!_0x16913d[_0x2d75f2]){delete _0x34560d[_0x2d75f2];}}}}function clearVoiceCallReports(_0xf4762){_0xf4762['total']=0x0;_0xf4762[_0x6604('0x26')]=0x0;_0xf4762[_0x6604('0x27')]=0x0;_0xf4762[_0x6604('0x28')]=0x0;_0xf4762[_0x6604('0x29')]=0x0;}function clearCampaigns(_0x15c8a2){if(!_['isEmpty'](_0x15c8a2)){for(var _0x1d4fb9 in _0x15c8a2){if(_0x15c8a2[_0x6604('0x1f')](_0x1d4fb9)){_0x15c8a2[_0x1d4fb9][_0x6604('0x2a')]=0x0;_0x15c8a2[_0x1d4fb9][_0x6604('0x2b')]=0x0;}}}}function clearVoiceQueues(_0xa6d120){if(!_[_0x6604('0x2c')](_0xa6d120)){for(var _0xb3b09 in _0xa6d120){if(_0xa6d120[_0x6604('0x1f')](_0xb3b09)){_0xa6d120[_0xb3b09][_0x6604('0x2d')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x26')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x2e')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x2f')]=0x0;_0xa6d120[_0xb3b09]['sumHoldTime']=0x0;_0xa6d120[_0xb3b09][_0x6604('0x28')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x29')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x30')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x31')]=0x0;_0xa6d120[_0xb3b09]['outboundBusyCallsDay']=0x0;_0xa6d120[_0xb3b09][_0x6604('0x32')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x33')]=0x0;_0xa6d120[_0xb3b09]['outboundUnknownCallsDay']=0x0;_0xa6d120[_0xb3b09][_0x6604('0x34')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x35')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x36')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x37')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x38')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x39')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x30')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x3a')]=0x0;_0xa6d120[_0xb3b09][_0x6604('0x3b')]=!![];}}}}Realtime[_0x6604('0x3c')]['mergeFromDatabase']=function(_0x201d0f,_0x316795){for(var _0x1fc133 in _0x316795){if(_0x201d0f[_0x6604('0x1f')](_0x1fc133)){_0x201d0f[_0x1fc133]=_0x316795[_0x1fc133];}}};Realtime['prototype'][_0x6604('0x3d')]=function(){var _0x18b4f5=this;return function(_0xebfd51){if(_0xebfd51){freeIsNotKeyAgent(_0xebfd51,_0x18b4f5[_0x6604('0xc')]);for(var _0x4331aa=0x0,_0x19f9d5={},_0x2eeefe={};_0x4331aa<_0xebfd51[_0x6604('0x3e')];_0x4331aa+=0x1){_0x19f9d5=_0xebfd51[_0x4331aa];var _0x2f67c7=_[_0x6604('0x24')](_0x19f9d5[_0x6604('0x25')])?util[_0x6604('0x20')](_0x6604('0x21'),_0x19f9d5['name']):_0x19f9d5[_0x6604('0x25')];if(_['isUndefined'](_0x18b4f5[_0x6604('0xc')][_0x2f67c7])){_0x18b4f5[_0x6604('0xc')][_0x2f67c7]=new Agent(_0x19f9d5);}else{_0x18b4f5['mergeFromDatabase'](_0x18b4f5['agents'][_0x2f67c7],_0x19f9d5);}}}return _0x18b4f5[_0x6604('0xc')];};};Realtime[_0x6604('0x3c')][_0x6604('0x3f')]=function(){var _0x5e928d=this;return function(_0x40d175){if(_0x40d175){freeIsNotKeySip(_0x40d175,_0x5e928d[_0x6604('0xd')]);for(var _0x22a4a2=0x0,_0xa34688={},_0x217716={};_0x22a4a2<_0x40d175[_0x6604('0x3e')];_0x22a4a2+=0x1){_0xa34688=_0x40d175[_0x22a4a2];if(_['isUndefined'](_0x5e928d['telephones'][util['format'](_0x6604('0x21'),_0xa34688['name'])])){_0x5e928d['telephones'][util[_0x6604('0x20')](_0x6604('0x21'),_0xa34688['name'])]=new Telephone(_0xa34688);}else{_0x5e928d[_0x6604('0x40')](_0x5e928d['telephones'][util[_0x6604('0x20')](_0x6604('0x21'),_0xa34688[_0x6604('0x22')])],_0xa34688);}}}return _0x5e928d['telephones'];};};Realtime['prototype']['initTrunks']=function(){var _0x2052ee=this;return function(_0xf07986){if(_0xf07986){freeIsNotKeySip(_0xf07986,_0x2052ee['trunks']);for(var _0x49560c=0x0,_0x11636f={},_0x1be15e={};_0x49560c<_0xf07986['length'];_0x49560c+=0x1){_0x11636f=_0xf07986[_0x49560c];if(_['isUndefined'](_0x2052ee['trunks'][util[_0x6604('0x20')](_0x6604('0x21'),_0x11636f[_0x6604('0x22')])])){_0x2052ee[_0x6604('0xe')][util[_0x6604('0x20')](_0x6604('0x21'),_0x11636f[_0x6604('0x22')])]=new Trunk(_0x11636f);}else{_0x2052ee[_0x6604('0x40')](_0x2052ee[_0x6604('0xe')][util['format']('SIP/%s',_0x11636f[_0x6604('0x22')])],_0x11636f);}}}return _0x2052ee[_0x6604('0xe')];};};Realtime[_0x6604('0x3c')][_0x6604('0x41')]=function(){var _0x13dbfa=this;return function(_0x46face){if(_0x46face){freeIsNotKey(_0x46face,_0x13dbfa[_0x6604('0x42')],_0x6604('0x22'));for(var _0x2fe1b5=0x0,_0x2b3764={},_0x3a6f01={};_0x2fe1b5<_0x46face[_0x6604('0x3e')];_0x2fe1b5+=0x1){_0x2b3764=_0x46face[_0x2fe1b5];if(_[_0x6604('0x43')](_0x13dbfa[_0x6604('0x42')][_0x2b3764[_0x6604('0x22')]])){_0x13dbfa[_0x6604('0x42')][_0x2b3764['name']]=new VoiceQueue(_0x2b3764);}else{_0x13dbfa[_0x6604('0x40')](_0x13dbfa[_0x6604('0x42')][_0x2b3764['name']],_0x2b3764);}}}return _0x13dbfa[_0x6604('0x42')];};};Realtime[_0x6604('0x3c')][_0x6604('0x44')]=function(){var _0x1fd7e1=this;return function(_0x5f5d69){if(_0x5f5d69){freeIsNotKey(_0x5f5d69,_0x1fd7e1['triggers'],'id');for(var _0x1b6819=0x0,_0x290039={},_0x268abf={};_0x1b6819<_0x5f5d69['length'];_0x1b6819+=0x1){_0x290039=_0x5f5d69[_0x1b6819];if(_[_0x6604('0x43')](_0x1fd7e1[_0x6604('0xf')][_0x290039['id']])){_0x1fd7e1[_0x6604('0xf')][_0x290039['id']]=new Trigger(_0x290039);}else{_0x1fd7e1[_0x6604('0x40')](_0x1fd7e1[_0x6604('0xf')][_0x290039['id']],_0x290039);}}}return _0x1fd7e1[_0x6604('0xf')];};};Realtime['prototype']['initTemplates']=function(){var _0x2834fa=this;return function(_0x1cfe64){if(_0x1cfe64){freeIsNotKey(_0x1cfe64,_0x2834fa[_0x6604('0x11')],'id');for(var _0x5b225c=0x0,_0x5baf24={},_0x354782={};_0x5b225c<_0x1cfe64[_0x6604('0x3e')];_0x5b225c+=0x1){_0x5baf24=_0x1cfe64[_0x5b225c];if(_[_0x6604('0x43')](_0x2834fa['templates'][_0x5baf24['id']])){_0x2834fa[_0x6604('0x11')][_0x5baf24['id']]=new Template(_0x5baf24);}else{_0x2834fa[_0x6604('0x40')](_0x2834fa[_0x6604('0x11')][_0x5baf24['id']],_0x5baf24);}}}return _0x2834fa['templates'];};};Realtime[_0x6604('0x3c')][_0x6604('0x45')]=function(){var _0x3e4159=this;return function(_0x3c574f){if(_0x3c574f){freeIsNotKey(_0x3c574f,_0x3e4159[_0x6604('0x15')],'id');for(var _0x35a1c6=0x0,_0x304058={},_0x285943={};_0x35a1c6<_0x3c574f[_0x6604('0x3e')];_0x35a1c6+=0x1){_0x304058=_0x3c574f[_0x35a1c6];if(_['isUndefined'](_0x3e4159['zendeskAccounts'][_0x304058['id']])){_0x3e4159[_0x6604('0x15')][_0x304058['id']]=new ZendeskAccount(_0x304058);}else{_0x3e4159[_0x6604('0x40')](_0x3e4159[_0x6604('0x15')][_0x304058['id']],_0x304058);}}}return _0x3e4159['zendeskAccounts'];};};Realtime[_0x6604('0x3c')][_0x6604('0x46')]=function(){var _0x19733b=this;return function(_0x3b26a6){if(_0x3b26a6){freeIsNotKey(_0x3b26a6,_0x19733b[_0x6604('0x16')],'id');for(var _0x47cf41=0x0,_0xd4f0b3={},_0x4a5f07={};_0x47cf41<_0x3b26a6[_0x6604('0x3e')];_0x47cf41+=0x1){_0xd4f0b3=_0x3b26a6[_0x47cf41];if(_[_0x6604('0x43')](_0x19733b[_0x6604('0x16')][_0xd4f0b3['id']])){_0x19733b['salesforceAccounts'][_0xd4f0b3['id']]=new SalesforceAccount(_0xd4f0b3);}else{_0x19733b[_0x6604('0x40')](_0x19733b[_0x6604('0x16')][_0xd4f0b3['id']],_0xd4f0b3);}}}return _0x19733b[_0x6604('0x16')];};};Realtime['prototype'][_0x6604('0x47')]=function(){var _0x1dee7d=this;return function(_0x378043){if(_0x378043){freeIsNotKey(_0x378043,_0x1dee7d[_0x6604('0x18')],'id');for(var _0x2e126d=0x0,_0x4d68c2={},_0x53f853={};_0x2e126d<_0x378043[_0x6604('0x3e')];_0x2e126d+=0x1){_0x4d68c2=_0x378043[_0x2e126d];if(_[_0x6604('0x43')](_0x1dee7d[_0x6604('0x18')][_0x4d68c2['id']])){_0x1dee7d[_0x6604('0x18')][_0x4d68c2['id']]=new FreshdeskAccount(_0x4d68c2);}else{_0x1dee7d['mergeFromDatabase'](_0x1dee7d[_0x6604('0x18')][_0x4d68c2['id']],_0x4d68c2);}}}return _0x1dee7d[_0x6604('0x18')];};};Realtime[_0x6604('0x3c')][_0x6604('0x48')]=function(){var _0x21c719=this;return function(_0x1fefaa){if(_0x1fefaa){freeIsNotKey(_0x1fefaa,_0x21c719['zohoAccounts'],'id');for(var _0x4f3f7f=0x0,_0x290db4={},_0x1c2802={};_0x4f3f7f<_0x1fefaa['length'];_0x4f3f7f+=0x1){_0x290db4=_0x1fefaa[_0x4f3f7f];if(_[_0x6604('0x43')](_0x21c719['zohoAccounts'][_0x290db4['id']])){_0x21c719[_0x6604('0x49')][_0x290db4['id']]=new ZohoAccount(_0x290db4);}else{_0x21c719[_0x6604('0x40')](_0x21c719[_0x6604('0x49')][_0x290db4['id']],_0x290db4);}}}return _0x21c719[_0x6604('0x49')];};};Realtime['prototype'][_0x6604('0x4a')]=function(){var _0x255c38=this;return function(_0xd6050f){if(_0xd6050f){freeIsNotKey(_0xd6050f,_0x255c38['deskAccounts'],'id');for(var _0x536a04=0x0,_0x31c133={},_0x22d4a9={};_0x536a04<_0xd6050f[_0x6604('0x3e')];_0x536a04+=0x1){_0x31c133=_0xd6050f[_0x536a04];if(_[_0x6604('0x43')](_0x255c38['deskAccounts'][_0x31c133['id']])){_0x255c38[_0x6604('0x19')][_0x31c133['id']]=new DeskAccount(_0x31c133);}else{_0x255c38[_0x6604('0x40')](_0x255c38[_0x6604('0x19')][_0x31c133['id']],_0x31c133);}}}return _0x255c38[_0x6604('0x19')];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x190856=this;return function(_0x2152c3){if(_0x2152c3){freeIsNotKey(_0x2152c3,_0x190856[_0x6604('0x17')],'id');for(var _0x40b3ab=0x0,_0x563b64={},_0x5b3d45={};_0x40b3ab<_0x2152c3[_0x6604('0x3e')];_0x40b3ab+=0x1){_0x563b64=_0x2152c3[_0x40b3ab];if(_[_0x6604('0x43')](_0x190856[_0x6604('0x17')][_0x563b64['id']])){_0x190856[_0x6604('0x17')][_0x563b64['id']]=new SugarcrmAccount(_0x563b64);}else{_0x190856['mergeFromDatabase'](_0x190856[_0x6604('0x17')][_0x563b64['id']],_0x563b64);}}}return _0x190856[_0x6604('0x17')];};};Realtime[_0x6604('0x3c')][_0x6604('0x4b')]=function(){var _0x24a60c=this;return function(_0x310ded){if(_0x310ded){freeIsNotKey(_0x310ded,_0x24a60c[_0x6604('0x1a')],'id');for(var _0x47fe14=0x0,_0x58c2dc={},_0x1a1610={};_0x47fe14<_0x310ded['length'];_0x47fe14+=0x1){_0x58c2dc=_0x310ded[_0x47fe14];if(_[_0x6604('0x43')](_0x24a60c[_0x6604('0x1a')][_0x58c2dc['id']])){_0x24a60c[_0x6604('0x1a')][_0x58c2dc['id']]=new VtigerAccount(_0x58c2dc);}else{_0x24a60c['mergeFromDatabase'](_0x24a60c['vtigerAccounts'][_0x58c2dc['id']],_0x58c2dc);}}}return _0x24a60c[_0x6604('0x1a')];};};Realtime[_0x6604('0x3c')]['initServicenowAccounts']=function(){var _0x1930b8=this;return function(_0x5e6223){if(_0x5e6223){freeIsNotKey(_0x5e6223,_0x1930b8[_0x6604('0x1b')],'id');for(var _0x442d47=0x0,_0x152592={},_0x476c0a={};_0x442d47<_0x5e6223[_0x6604('0x3e')];_0x442d47+=0x1){_0x152592=_0x5e6223[_0x442d47];if(_[_0x6604('0x43')](_0x1930b8[_0x6604('0x1b')][_0x152592['id']])){_0x1930b8[_0x6604('0x1b')][_0x152592['id']]=new ServicenowAccount(_0x152592);}else{_0x1930b8[_0x6604('0x40')](_0x1930b8['servicenowAccounts'][_0x152592['id']],_0x152592);}}}return _0x1930b8[_0x6604('0x1b')];};};Realtime[_0x6604('0x3c')][_0x6604('0x4c')]=function(){var _0x1d455=this;return function(_0x42490f){if(_0x42490f){freeIsNotKey(_0x42490f,_0x1d455[_0x6604('0x1c')],'id');for(var _0xee3acc=0x0,_0x34b1a5={},_0x3d19a4={};_0xee3acc<_0x42490f['length'];_0xee3acc+=0x1){_0x34b1a5=_0x42490f[_0xee3acc];if(_[_0x6604('0x43')](_0x1d455[_0x6604('0x1c')][_0x34b1a5['id']])){_0x1d455[_0x6604('0x1c')][_0x34b1a5['id']]=new Dynamics365Account(_0x34b1a5);}else{_0x1d455[_0x6604('0x40')](_0x1d455['dynamics365Accounts'][_0x34b1a5['id']],_0x34b1a5);}}}return _0x1d455[_0x6604('0x1c')];};};Realtime[_0x6604('0x3c')][_0x6604('0x4d')]=function(){var _0x3bde7a=this;return function(_0x50c3d4){if(_0x50c3d4){freeIsNotKey(_0x50c3d4,_0x3bde7a['freshsalesAccounts'],'id');for(var _0x9b621=0x0,_0x36ee54={},_0x25891b={};_0x9b621<_0x50c3d4['length'];_0x9b621+=0x1){_0x36ee54=_0x50c3d4[_0x9b621];if(_[_0x6604('0x43')](_0x3bde7a['freshsalesAccounts'][_0x36ee54['id']])){_0x3bde7a[_0x6604('0x1d')][_0x36ee54['id']]=new FreshsalesAccount(_0x36ee54);}else{_0x3bde7a[_0x6604('0x40')](_0x3bde7a[_0x6604('0x1d')][_0x36ee54['id']],_0x36ee54);}}}return _0x3bde7a[_0x6604('0x1d')];};};Realtime[_0x6604('0x3c')]['initVoiceQueueHopperHistory']=function(){var _0x623770=this;return function(_0x1da4c9){for(var _0x3bd5e9=0x0;_0x3bd5e9<_0x1da4c9['length'];_0x3bd5e9+=0x1){_[_0x6604('0x4e')](_0x623770[_0x6604('0x42')][_0x1da4c9[_0x3bd5e9]['name']],_0x1da4c9[_0x3bd5e9]);}return _0x623770[_0x6604('0x42')];};};Realtime['prototype'][_0x6604('0x4f')]=function(){var _0x4136f1=this;return function(_0x27b1cf){clearVoiceQueues(_0x4136f1[_0x6604('0x42')]);if(_0x27b1cf){_0x27b1cf=_['groupBy'](_0x27b1cf,_0x6604('0x50'));for(var _0x476fa7 in _0x27b1cf){if(_0x27b1cf[_0x6604('0x1f')](_0x476fa7)){var _0x5594e1={};for(var _0x586875=0x0;_0x586875<_0x27b1cf[_0x476fa7][_0x6604('0x3e')];_0x586875+=0x1){var _0x5bdf22=_0x27b1cf[_0x476fa7][_0x586875][_0x6604('0x51')];if(_0x4136f1['voiceQueues'][_0x5bdf22]){if(_0x27b1cf[_0x476fa7][_0x586875]['queuecallerexit']){_0x4136f1[_0x6604('0x42')][_0x5bdf22]['unmanaged']+=0x1;}if(_0x27b1cf[_0x476fa7][_0x586875]['queuecallerabandon']){_0x4136f1[_0x6604('0x42')][_0x5bdf22][_0x6604('0x2f')]+=0x1;}_0x4136f1[_0x6604('0x42')][_0x5bdf22][_0x6604('0x27')]+=moment(_0x27b1cf[_0x476fa7][_0x586875]['queuecallerleaveAt'])[_0x6604('0x52')](moment(_0x27b1cf[_0x476fa7][_0x586875][_0x6604('0x53')]),'seconds')||0x0;if(_0x586875===_0x27b1cf[_0x476fa7][_0x6604('0x3e')]-0x1){_0x4136f1[_0x6604('0x42')][_0x5bdf22]['sumDuration']+=moment(_0x27b1cf[_0x476fa7][_0x586875][_0x6604('0x54')]||_0x27b1cf[_0x476fa7][_0x586875]['queuecallerabandonAt']||_0x27b1cf[_0x476fa7][_0x586875][_0x6604('0x55')])[_0x6604('0x52')](moment(_0x27b1cf[_0x476fa7][_0x586875][_0x6604('0x53')]),_0x6604('0x56'))||0x0;_0x4136f1[_0x6604('0x42')][_0x5bdf22][_0x6604('0x2d')]+=0x1;if(_0x27b1cf[_0x476fa7][_0x586875]['queuecallercomplete']){_0x4136f1['voiceQueues'][_0x5bdf22][_0x6604('0x26')]+=0x1;_0x4136f1[_0x6604('0x42')][_0x5bdf22][_0x6604('0x29')]+=moment(_0x27b1cf[_0x476fa7][_0x586875][_0x6604('0x54')])[_0x6604('0x52')](moment(_0x27b1cf[_0x476fa7][_0x586875][_0x6604('0x57')]),_0x6604('0x56'))||0x0;}}else{_0x4136f1[_0x6604('0x42')][_0x5bdf22][_0x6604('0x28')]+=_0x4136f1[_0x6604('0x42')][_0x5bdf22][_0x6604('0x27')]||0x0;}}}}}}return _0x4136f1[_0x6604('0x42')];};};Realtime[_0x6604('0x3c')][_0x6604('0x58')]=function(){var _0x214f3d=this;return function(_0x359a9f){clearVoiceCallReports(_0x214f3d[_0x6604('0x59')]);if(_0x359a9f){for(var _0x42a64e=0x0;_0x42a64e<_0x359a9f[_0x6604('0x3e')];_0x42a64e+=0x1){_0x214f3d['outbound'][_0x6604('0x2d')]+=0x1;_0x214f3d[_0x6604('0x59')][_0x6604('0x28')]+=_0x359a9f[_0x42a64e]['duration'];if(_0x359a9f[_0x42a64e][_0x6604('0x5a')]===_0x6604('0x5b')){_0x214f3d[_0x6604('0x59')][_0x6604('0x26')]+=0x1;_0x214f3d[_0x6604('0x59')]['sumHoldTime']+=_0x359a9f[_0x42a64e][_0x6604('0x5c')]-_0x359a9f[_0x42a64e][_0x6604('0x5d')]||0x0;_0x214f3d[_0x6604('0x59')][_0x6604('0x29')]+=_0x359a9f[_0x42a64e]['billableseconds'];}}}return _0x214f3d[_0x6604('0x59')];};};Realtime[_0x6604('0x3c')][_0x6604('0x5e')]=function(){var _0x444b23=this;return function(_0x33df02){if(_0x33df02){freeIsNotKey(_0x33df02,_0x444b23['campaigns'],'name');for(var _0x5628f9=0x0,_0x4271d4={};_0x5628f9<_0x33df02[_0x6604('0x3e')];_0x5628f9+=0x1){_0x4271d4=_0x33df02[_0x5628f9];if(_[_0x6604('0x43')](_0x444b23['campaigns'][_0x4271d4[_0x6604('0x22')]])){_0x444b23[_0x6604('0x10')][_0x4271d4[_0x6604('0x22')]]=new Campaign(_0x4271d4);}else{_0x444b23['mergeFromDatabase'](_0x444b23[_0x6604('0x10')][_0x4271d4['name']],_0x4271d4);_0x444b23['campaigns'][_0x4271d4[_0x6604('0x22')]][_0x6604('0x5f')]=_0x4271d4[_0x6604('0x60')]?_0x4271d4[_0x6604('0x60')]['name']:undefined;}}}return _0x444b23[_0x6604('0x10')];};};Realtime['prototype'][_0x6604('0x61')]=function(){var _0x44eca3=this;return function(_0xbefe41){if(_0xbefe41){freeIsNotKey(_0xbefe41,_0x44eca3['voiceExtensions'],'id');for(var _0x3fe963=0x0,_0x44bf43={};_0x3fe963<_0xbefe41['length'];_0x3fe963+=0x1){_0x44bf43=_0xbefe41[_0x3fe963];if(_[_0x6604('0x43')](_0x44eca3[_0x6604('0x12')][_0x44bf43['id']])){_0x44eca3[_0x6604('0x12')][_0x44bf43['id']]=new VoiceExtension(_0x44bf43);}else{_0x44eca3['mergeFromDatabase'](_0x44eca3[_0x6604('0x12')][_0x44bf43['id']],_0x44bf43);}}}return _0x44eca3[_0x6604('0x12')];};};Realtime[_0x6604('0x3c')][_0x6604('0x62')]=function(){var _0x2f63d5=this;return function(_0x35ea43){clearCampaigns(_0x2f63d5[_0x6604('0x10')]);for(var _0x5ef849=0x0;_0x5ef849<_0x35ea43['length'];_0x5ef849+=0x1){_[_0x6604('0x4e')](_0x2f63d5['campaigns'][_0x35ea43[_0x5ef849][_0x6604('0x22')]],_0x35ea43[_0x5ef849]);}return _0x2f63d5[_0x6604('0x10')];};};Realtime[_0x6604('0x3c')][_0x6604('0x63')]=function(){var _0x399ee9=this;return function(_0x108c69){if(_0x108c69){freeIsNotKey(_0x108c69,_0x399ee9['faxAccounts'],'id');for(var _0x34e21c=0x0,_0x2b3dc1={},_0x13e751={};_0x34e21c<_0x108c69[_0x6604('0x3e')];_0x34e21c+=0x1){_0x2b3dc1=_0x108c69[_0x34e21c];if(_[_0x6604('0x43')](_0x399ee9[_0x6604('0x1e')][_0x2b3dc1['id']])){_0x399ee9['faxAccounts'][_0x2b3dc1['id']]=new FaxAccount(_0x2b3dc1);}else{_0x399ee9[_0x6604('0x40')](_0x399ee9[_0x6604('0x1e')][_0x2b3dc1['id']],_0x2b3dc1);}}}return _0x399ee9[_0x6604('0x1e')];};};module[_0x6604('0x64')]=Realtime; \ No newline at end of file +var _0x0611=['outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','isUndefined','agents','initTelephones','length','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerabandon','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','sumBillable','queuecallerleaveAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','name','interface','total','answered','sumDuration','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','sumHoldTime','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0611,0x9a));var _0x1061=function(_0x3dcf2f,_0x42fe3d){_0x3dcf2f=_0x3dcf2f-0x0;var _0x53abaf=_0x0611[_0x3dcf2f];return _0x53abaf;};'use strict';var BPromise=require(_0x1061('0x0'));var util=require(_0x1061('0x1'));var _=require(_0x1061('0x2'));var moment=require('moment');var Agent=require(_0x1061('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x1061('0x4'));var VoiceQueue=require(_0x1061('0x5'));var Trigger=require('../model/trigger');var Template=require(_0x1061('0x6'));var Campaign=require(_0x1061('0x7'));var VoiceExtension=require(_0x1061('0x8'));var ZendeskAccount=require(_0x1061('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x1061('0xa'));var VtigerAccount=require(_0x1061('0xb'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x1061('0xc'));var FreshsalesAccount=require(_0x1061('0xd'));var FaxAccount=require(_0x1061('0xe'));var Realtime=function(){this['agents']={};this[_0x1061('0xf')]={};this[_0x1061('0x10')]={};this[_0x1061('0x11')]={};this[_0x1061('0x12')]={};this[_0x1061('0x13')]={};this[_0x1061('0x14')]={};this[_0x1061('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x1061('0x16')]={};this[_0x1061('0x17')]={};this[_0x1061('0x18')]={};this['outboundChannels']={};this['timers']={};this[_0x1061('0x19')]={};this[_0x1061('0x1a')]={};this[_0x1061('0x1b')]={};this[_0x1061('0x1c')]={};this['freshdeskAccounts']={};this[_0x1061('0x1d')]={};this[_0x1061('0x1e')]={};this[_0x1061('0x1f')]={};this[_0x1061('0x20')]={};this['dynamics365Accounts']={};this[_0x1061('0x21')]={};this[_0x1061('0x22')]={};};function freeIsNotKey(_0x2b54de,_0x478b57,_0x1387e3){var _0x55798b=_[_0x1061('0x23')](_0x2b54de,function(_0x19409e,_0x265927){return _0x19409e[_0x1387e3];});for(var _0x45dd79 in _0x478b57){if(_0x478b57[_0x1061('0x24')](_0x45dd79)){if(!_0x55798b[_0x45dd79]){delete _0x478b57[_0x45dd79];}}}}function freeIsNotKeySip(_0x34534c,_0x5ed29e){var _0x5255e3=_[_0x1061('0x23')](_0x34534c,function(_0x319383,_0x20721b){return util[_0x1061('0x25')](_0x1061('0x26'),_0x319383['name']);});for(var _0x53baf3 in _0x5ed29e){if(_0x5ed29e[_0x1061('0x24')](_0x53baf3)){if(!_0x5255e3[_0x53baf3]){delete _0x5ed29e[_0x53baf3];}}}}function freeIsNotKeyAgent(_0x4b76c4,_0x51e945){var _0x3b9e8f=_['mapKeys'](_0x4b76c4,function(_0x37d3db,_0x5ebe38){var _0x3f3f9a=_[_0x1061('0x27')](_0x37d3db['interface'])?util[_0x1061('0x25')](_0x1061('0x26'),_0x37d3db[_0x1061('0x28')]):_0x37d3db[_0x1061('0x29')];return _0x3f3f9a;});for(var _0xbfcd0d in _0x51e945){if(_0x51e945[_0x1061('0x24')](_0xbfcd0d)){if(!_0x3b9e8f[_0xbfcd0d]){delete _0x51e945[_0xbfcd0d];}}}}function clearVoiceCallReports(_0x30ed03){_0x30ed03[_0x1061('0x2a')]=0x0;_0x30ed03[_0x1061('0x2b')]=0x0;_0x30ed03['sumHoldTime']=0x0;_0x30ed03[_0x1061('0x2c')]=0x0;_0x30ed03['sumBillable']=0x0;}function clearCampaigns(_0x2e3556){if(!_['isEmpty'](_0x2e3556)){for(var _0x5788e7 in _0x2e3556){if(_0x2e3556[_0x1061('0x24')](_0x5788e7)){_0x2e3556[_0x5788e7][_0x1061('0x2d')]=0x0;_0x2e3556[_0x5788e7][_0x1061('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x32c2aa){if(!_[_0x1061('0x2f')](_0x32c2aa)){for(var _0x2422f0 in _0x32c2aa){if(_0x32c2aa[_0x1061('0x24')](_0x2422f0)){_0x32c2aa[_0x2422f0][_0x1061('0x2a')]=0x0;_0x32c2aa[_0x2422f0]['answered']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x30')]=0x0;_0x32c2aa[_0x2422f0]['abandoned']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x31')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x2c')]=0x0;_0x32c2aa[_0x2422f0]['sumBillable']=0x0;_0x32c2aa[_0x2422f0]['outboundAnswerAgiCallsDay']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x32')]=0x0;_0x32c2aa[_0x2422f0]['outboundBusyCallsDay']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x33')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x34')]=0x0;_0x32c2aa[_0x2422f0]['outboundUnknownCallsDay']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x35')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x36')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x37')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x38')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x39')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x3a')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x3b')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x3c')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x3d')]=!![];}}}}Realtime[_0x1061('0x3e')][_0x1061('0x3f')]=function(_0x2f2182,_0x5f4e5d){for(var _0x5433eb in _0x5f4e5d){if(_0x2f2182['hasOwnProperty'](_0x5433eb)){_0x2f2182[_0x5433eb]=_0x5f4e5d[_0x5433eb];}}};Realtime[_0x1061('0x3e')]['initAgents']=function(){var _0x10b64b=this;return function(_0x34f1f6){if(_0x34f1f6){freeIsNotKeyAgent(_0x34f1f6,_0x10b64b['agents']);for(var _0x39e6de=0x0,_0x2e45ac={},_0x798c51={};_0x39e6de<_0x34f1f6['length'];_0x39e6de+=0x1){_0x2e45ac=_0x34f1f6[_0x39e6de];var _0x31d339=_[_0x1061('0x27')](_0x2e45ac['interface'])?util[_0x1061('0x25')](_0x1061('0x26'),_0x2e45ac[_0x1061('0x28')]):_0x2e45ac[_0x1061('0x29')];if(_[_0x1061('0x40')](_0x10b64b[_0x1061('0x41')][_0x31d339])){_0x10b64b[_0x1061('0x41')][_0x31d339]=new Agent(_0x2e45ac);}else{_0x10b64b[_0x1061('0x3f')](_0x10b64b[_0x1061('0x41')][_0x31d339],_0x2e45ac);}}}return _0x10b64b[_0x1061('0x41')];};};Realtime[_0x1061('0x3e')][_0x1061('0x42')]=function(){var _0x498ecd=this;return function(_0x40359e){if(_0x40359e){freeIsNotKeySip(_0x40359e,_0x498ecd['telephones']);for(var _0x23c9c3=0x0,_0xff3b18={},_0x22f472={};_0x23c9c3<_0x40359e[_0x1061('0x43')];_0x23c9c3+=0x1){_0xff3b18=_0x40359e[_0x23c9c3];if(_[_0x1061('0x40')](_0x498ecd[_0x1061('0xf')][util[_0x1061('0x25')](_0x1061('0x26'),_0xff3b18['name'])])){_0x498ecd['telephones'][util[_0x1061('0x25')](_0x1061('0x26'),_0xff3b18[_0x1061('0x28')])]=new Telephone(_0xff3b18);}else{_0x498ecd[_0x1061('0x3f')](_0x498ecd[_0x1061('0xf')][util[_0x1061('0x25')](_0x1061('0x26'),_0xff3b18[_0x1061('0x28')])],_0xff3b18);}}}return _0x498ecd[_0x1061('0xf')];};};Realtime['prototype'][_0x1061('0x44')]=function(){var _0x43d7e4=this;return function(_0x3d971e){if(_0x3d971e){freeIsNotKeySip(_0x3d971e,_0x43d7e4[_0x1061('0x10')]);for(var _0xb467b=0x0,_0x2e9f4b={},_0x49468b={};_0xb467b<_0x3d971e['length'];_0xb467b+=0x1){_0x2e9f4b=_0x3d971e[_0xb467b];if(_[_0x1061('0x40')](_0x43d7e4[_0x1061('0x10')][util[_0x1061('0x25')](_0x1061('0x26'),_0x2e9f4b['name'])])){_0x43d7e4[_0x1061('0x10')][util[_0x1061('0x25')](_0x1061('0x26'),_0x2e9f4b[_0x1061('0x28')])]=new Trunk(_0x2e9f4b);}else{_0x43d7e4['mergeFromDatabase'](_0x43d7e4[_0x1061('0x10')][util[_0x1061('0x25')](_0x1061('0x26'),_0x2e9f4b[_0x1061('0x28')])],_0x2e9f4b);}}}return _0x43d7e4['trunks'];};};Realtime[_0x1061('0x3e')][_0x1061('0x45')]=function(){var _0x39d3c4=this;return function(_0xb856d4){if(_0xb856d4){freeIsNotKey(_0xb856d4,_0x39d3c4[_0x1061('0x11')],_0x1061('0x28'));for(var _0x50aac7=0x0,_0x2df83c={},_0x1fcb48={};_0x50aac7<_0xb856d4[_0x1061('0x43')];_0x50aac7+=0x1){_0x2df83c=_0xb856d4[_0x50aac7];if(_[_0x1061('0x40')](_0x39d3c4[_0x1061('0x11')][_0x2df83c['name']])){_0x39d3c4[_0x1061('0x11')][_0x2df83c[_0x1061('0x28')]]=new VoiceQueue(_0x2df83c);}else{_0x39d3c4['mergeFromDatabase'](_0x39d3c4[_0x1061('0x11')][_0x2df83c['name']],_0x2df83c);}}}return _0x39d3c4[_0x1061('0x11')];};};Realtime[_0x1061('0x3e')][_0x1061('0x46')]=function(){var _0x4f176e=this;return function(_0x476b80){if(_0x476b80){freeIsNotKey(_0x476b80,_0x4f176e[_0x1061('0x12')],'id');for(var _0x3d7eec=0x0,_0xa5db3b={},_0x4c21ff={};_0x3d7eec<_0x476b80[_0x1061('0x43')];_0x3d7eec+=0x1){_0xa5db3b=_0x476b80[_0x3d7eec];if(_[_0x1061('0x40')](_0x4f176e[_0x1061('0x12')][_0xa5db3b['id']])){_0x4f176e[_0x1061('0x12')][_0xa5db3b['id']]=new Trigger(_0xa5db3b);}else{_0x4f176e['mergeFromDatabase'](_0x4f176e[_0x1061('0x12')][_0xa5db3b['id']],_0xa5db3b);}}}return _0x4f176e[_0x1061('0x12')];};};Realtime[_0x1061('0x3e')][_0x1061('0x47')]=function(){var _0x2fb67b=this;return function(_0x493644){if(_0x493644){freeIsNotKey(_0x493644,_0x2fb67b[_0x1061('0x14')],'id');for(var _0x50d737=0x0,_0xdaffab={},_0x5e7475={};_0x50d737<_0x493644[_0x1061('0x43')];_0x50d737+=0x1){_0xdaffab=_0x493644[_0x50d737];if(_['isUndefined'](_0x2fb67b['templates'][_0xdaffab['id']])){_0x2fb67b['templates'][_0xdaffab['id']]=new Template(_0xdaffab);}else{_0x2fb67b[_0x1061('0x3f')](_0x2fb67b[_0x1061('0x14')][_0xdaffab['id']],_0xdaffab);}}}return _0x2fb67b['templates'];};};Realtime['prototype'][_0x1061('0x48')]=function(){var _0x20e888=this;return function(_0x487f2a){if(_0x487f2a){freeIsNotKey(_0x487f2a,_0x20e888['zendeskAccounts'],'id');for(var _0x1c3401=0x0,_0xe1f3cd={},_0x196ab2={};_0x1c3401<_0x487f2a[_0x1061('0x43')];_0x1c3401+=0x1){_0xe1f3cd=_0x487f2a[_0x1c3401];if(_['isUndefined'](_0x20e888['zendeskAccounts'][_0xe1f3cd['id']])){_0x20e888['zendeskAccounts'][_0xe1f3cd['id']]=new ZendeskAccount(_0xe1f3cd);}else{_0x20e888[_0x1061('0x3f')](_0x20e888['zendeskAccounts'][_0xe1f3cd['id']],_0xe1f3cd);}}}return _0x20e888['zendeskAccounts'];};};Realtime[_0x1061('0x3e')][_0x1061('0x49')]=function(){var _0x290f7f=this;return function(_0x6f71e2){if(_0x6f71e2){freeIsNotKey(_0x6f71e2,_0x290f7f['salesforceAccounts'],'id');for(var _0x169abe=0x0,_0x5c96ff={},_0x5a4590={};_0x169abe<_0x6f71e2[_0x1061('0x43')];_0x169abe+=0x1){_0x5c96ff=_0x6f71e2[_0x169abe];if(_[_0x1061('0x40')](_0x290f7f[_0x1061('0x1b')][_0x5c96ff['id']])){_0x290f7f['salesforceAccounts'][_0x5c96ff['id']]=new SalesforceAccount(_0x5c96ff);}else{_0x290f7f[_0x1061('0x3f')](_0x290f7f[_0x1061('0x1b')][_0x5c96ff['id']],_0x5c96ff);}}}return _0x290f7f[_0x1061('0x1b')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x477d56=this;return function(_0x1ba045){if(_0x1ba045){freeIsNotKey(_0x1ba045,_0x477d56[_0x1061('0x4a')],'id');for(var _0x46b308=0x0,_0x4be630={},_0x59578a={};_0x46b308<_0x1ba045[_0x1061('0x43')];_0x46b308+=0x1){_0x4be630=_0x1ba045[_0x46b308];if(_[_0x1061('0x40')](_0x477d56[_0x1061('0x4a')][_0x4be630['id']])){_0x477d56[_0x1061('0x4a')][_0x4be630['id']]=new FreshdeskAccount(_0x4be630);}else{_0x477d56[_0x1061('0x3f')](_0x477d56[_0x1061('0x4a')][_0x4be630['id']],_0x4be630);}}}return _0x477d56[_0x1061('0x4a')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4b')]=function(){var _0x16c9dd=this;return function(_0x235183){if(_0x235183){freeIsNotKey(_0x235183,_0x16c9dd[_0x1061('0x1d')],'id');for(var _0x32f636=0x0,_0xa77904={},_0x5a28d7={};_0x32f636<_0x235183[_0x1061('0x43')];_0x32f636+=0x1){_0xa77904=_0x235183[_0x32f636];if(_['isUndefined'](_0x16c9dd['zohoAccounts'][_0xa77904['id']])){_0x16c9dd['zohoAccounts'][_0xa77904['id']]=new ZohoAccount(_0xa77904);}else{_0x16c9dd['mergeFromDatabase'](_0x16c9dd['zohoAccounts'][_0xa77904['id']],_0xa77904);}}}return _0x16c9dd[_0x1061('0x1d')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4c')]=function(){var _0x320b2a=this;return function(_0x42c565){if(_0x42c565){freeIsNotKey(_0x42c565,_0x320b2a[_0x1061('0x1e')],'id');for(var _0xb5cbcc=0x0,_0x31324a={},_0x238a5f={};_0xb5cbcc<_0x42c565['length'];_0xb5cbcc+=0x1){_0x31324a=_0x42c565[_0xb5cbcc];if(_[_0x1061('0x40')](_0x320b2a['deskAccounts'][_0x31324a['id']])){_0x320b2a[_0x1061('0x1e')][_0x31324a['id']]=new DeskAccount(_0x31324a);}else{_0x320b2a[_0x1061('0x3f')](_0x320b2a[_0x1061('0x1e')][_0x31324a['id']],_0x31324a);}}}return _0x320b2a[_0x1061('0x1e')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4d')]=function(){var _0x56dbbf=this;return function(_0x49092f){if(_0x49092f){freeIsNotKey(_0x49092f,_0x56dbbf[_0x1061('0x1c')],'id');for(var _0x1245dc=0x0,_0x6629b={},_0x4c170b={};_0x1245dc<_0x49092f[_0x1061('0x43')];_0x1245dc+=0x1){_0x6629b=_0x49092f[_0x1245dc];if(_[_0x1061('0x40')](_0x56dbbf['sugarcrmAccounts'][_0x6629b['id']])){_0x56dbbf['sugarcrmAccounts'][_0x6629b['id']]=new SugarcrmAccount(_0x6629b);}else{_0x56dbbf[_0x1061('0x3f')](_0x56dbbf[_0x1061('0x1c')][_0x6629b['id']],_0x6629b);}}}return _0x56dbbf[_0x1061('0x1c')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4e')]=function(){var _0x2fe0d3=this;return function(_0x136117){if(_0x136117){freeIsNotKey(_0x136117,_0x2fe0d3['vtigerAccounts'],'id');for(var _0x37a834=0x0,_0x4158be={},_0x2be2a2={};_0x37a834<_0x136117['length'];_0x37a834+=0x1){_0x4158be=_0x136117[_0x37a834];if(_[_0x1061('0x40')](_0x2fe0d3[_0x1061('0x1f')][_0x4158be['id']])){_0x2fe0d3[_0x1061('0x1f')][_0x4158be['id']]=new VtigerAccount(_0x4158be);}else{_0x2fe0d3[_0x1061('0x3f')](_0x2fe0d3['vtigerAccounts'][_0x4158be['id']],_0x4158be);}}}return _0x2fe0d3[_0x1061('0x1f')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4f')]=function(){var _0x5d892a=this;return function(_0x3d59d5){if(_0x3d59d5){freeIsNotKey(_0x3d59d5,_0x5d892a['servicenowAccounts'],'id');for(var _0x35632b=0x0,_0x2f0c6c={},_0x1cf934={};_0x35632b<_0x3d59d5[_0x1061('0x43')];_0x35632b+=0x1){_0x2f0c6c=_0x3d59d5[_0x35632b];if(_[_0x1061('0x40')](_0x5d892a['servicenowAccounts'][_0x2f0c6c['id']])){_0x5d892a[_0x1061('0x20')][_0x2f0c6c['id']]=new ServicenowAccount(_0x2f0c6c);}else{_0x5d892a['mergeFromDatabase'](_0x5d892a[_0x1061('0x20')][_0x2f0c6c['id']],_0x2f0c6c);}}}return _0x5d892a[_0x1061('0x20')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x5cccd4=this;return function(_0x1fe0f5){if(_0x1fe0f5){freeIsNotKey(_0x1fe0f5,_0x5cccd4[_0x1061('0x50')],'id');for(var _0xb2f3fd=0x0,_0x2e13a5={},_0x8d8fa8={};_0xb2f3fd<_0x1fe0f5[_0x1061('0x43')];_0xb2f3fd+=0x1){_0x2e13a5=_0x1fe0f5[_0xb2f3fd];if(_[_0x1061('0x40')](_0x5cccd4[_0x1061('0x50')][_0x2e13a5['id']])){_0x5cccd4[_0x1061('0x50')][_0x2e13a5['id']]=new Dynamics365Account(_0x2e13a5);}else{_0x5cccd4[_0x1061('0x3f')](_0x5cccd4[_0x1061('0x50')][_0x2e13a5['id']],_0x2e13a5);}}}return _0x5cccd4[_0x1061('0x50')];};};Realtime[_0x1061('0x3e')][_0x1061('0x51')]=function(){var _0x3d4f8d=this;return function(_0x53ae51){if(_0x53ae51){freeIsNotKey(_0x53ae51,_0x3d4f8d[_0x1061('0x21')],'id');for(var _0x41eac8=0x0,_0x125677={},_0xdf3db3={};_0x41eac8<_0x53ae51[_0x1061('0x43')];_0x41eac8+=0x1){_0x125677=_0x53ae51[_0x41eac8];if(_[_0x1061('0x40')](_0x3d4f8d[_0x1061('0x21')][_0x125677['id']])){_0x3d4f8d[_0x1061('0x21')][_0x125677['id']]=new FreshsalesAccount(_0x125677);}else{_0x3d4f8d['mergeFromDatabase'](_0x3d4f8d[_0x1061('0x21')][_0x125677['id']],_0x125677);}}}return _0x3d4f8d[_0x1061('0x21')];};};Realtime[_0x1061('0x3e')][_0x1061('0x52')]=function(){var _0x34cfdb=this;return function(_0x36e80f){for(var _0x154e5a=0x0;_0x154e5a<_0x36e80f[_0x1061('0x43')];_0x154e5a+=0x1){_[_0x1061('0x53')](_0x34cfdb[_0x1061('0x11')][_0x36e80f[_0x154e5a][_0x1061('0x28')]],_0x36e80f[_0x154e5a]);}return _0x34cfdb[_0x1061('0x11')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0xbec01b=this;return function(_0x4a5b0f){clearVoiceQueues(_0xbec01b['voiceQueues']);if(_0x4a5b0f){_0x4a5b0f=_[_0x1061('0x54')](_0x4a5b0f,_0x1061('0x55'));for(var _0x266691 in _0x4a5b0f){if(_0x4a5b0f[_0x1061('0x24')](_0x266691)){var _0x16707e={};for(var _0x1f0c7a=0x0;_0x1f0c7a<_0x4a5b0f[_0x266691]['length'];_0x1f0c7a+=0x1){var _0x273644=_0x4a5b0f[_0x266691][_0x1f0c7a]['queue'];if(_0xbec01b['voiceQueues'][_0x273644]){if(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerexit']){_0xbec01b[_0x1061('0x11')][_0x273644][_0x1061('0x30')]+=0x1;}if(_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x56')]){_0xbec01b[_0x1061('0x11')][_0x273644]['abandoned']+=0x1;}_0xbec01b['voiceQueues'][_0x273644][_0x1061('0x31')]+=moment(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerleaveAt'])['diff'](moment(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerjoinAt']),_0x1061('0x57'))||0x0;if(_0x1f0c7a===_0x4a5b0f[_0x266691]['length']-0x1){_0xbec01b['voiceQueues'][_0x273644][_0x1061('0x2c')]+=moment(_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x58')]||_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x59')]||_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerexitAt'])[_0x1061('0x5a')](moment(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerjoinAt']),_0x1061('0x57'))||0x0;_0xbec01b[_0x1061('0x11')][_0x273644]['total']+=0x1;if(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallercomplete']){_0xbec01b[_0x1061('0x11')][_0x273644][_0x1061('0x2b')]+=0x1;_0xbec01b[_0x1061('0x11')][_0x273644][_0x1061('0x5b')]+=moment(_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x58')])[_0x1061('0x5a')](moment(_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x5c')]),_0x1061('0x57'))||0x0;}}else{_0xbec01b[_0x1061('0x11')][_0x273644]['sumDuration']+=_0xbec01b['voiceQueues'][_0x273644][_0x1061('0x31')]||0x0;}}}}}}return _0xbec01b[_0x1061('0x11')];};};Realtime[_0x1061('0x3e')][_0x1061('0x5d')]=function(){var _0x4c10b0=this;return function(_0x341f75){clearVoiceCallReports(_0x4c10b0[_0x1061('0x15')]);if(_0x341f75){for(var _0x247812=0x0;_0x247812<_0x341f75[_0x1061('0x43')];_0x247812+=0x1){_0x4c10b0[_0x1061('0x15')][_0x1061('0x2a')]+=0x1;_0x4c10b0[_0x1061('0x15')][_0x1061('0x2c')]+=_0x341f75[_0x247812][_0x1061('0x5e')];if(_0x341f75[_0x247812][_0x1061('0x5f')]===_0x1061('0x60')){_0x4c10b0[_0x1061('0x15')]['answered']+=0x1;_0x4c10b0['outbound'][_0x1061('0x31')]+=_0x341f75[_0x247812][_0x1061('0x5e')]-_0x341f75[_0x247812][_0x1061('0x61')]||0x0;_0x4c10b0[_0x1061('0x15')][_0x1061('0x5b')]+=_0x341f75[_0x247812][_0x1061('0x61')];}}}return _0x4c10b0[_0x1061('0x15')];};};Realtime[_0x1061('0x3e')]['initCampaigns']=function(){var _0x15ccb8=this;return function(_0x4dcbe8){if(_0x4dcbe8){freeIsNotKey(_0x4dcbe8,_0x15ccb8[_0x1061('0x13')],_0x1061('0x28'));for(var _0x34c4c2=0x0,_0x42d4ad={};_0x34c4c2<_0x4dcbe8[_0x1061('0x43')];_0x34c4c2+=0x1){_0x42d4ad=_0x4dcbe8[_0x34c4c2];if(_[_0x1061('0x40')](_0x15ccb8[_0x1061('0x13')][_0x42d4ad[_0x1061('0x28')]])){_0x15ccb8[_0x1061('0x13')][_0x42d4ad[_0x1061('0x28')]]=new Campaign(_0x42d4ad);}else{_0x15ccb8[_0x1061('0x3f')](_0x15ccb8['campaigns'][_0x42d4ad[_0x1061('0x28')]],_0x42d4ad);_0x15ccb8[_0x1061('0x13')][_0x42d4ad[_0x1061('0x28')]][_0x1061('0x62')]=_0x42d4ad[_0x1061('0x63')]?_0x42d4ad['SquareProject']['name']:undefined;}}}return _0x15ccb8['campaigns'];};};Realtime[_0x1061('0x3e')][_0x1061('0x64')]=function(){var _0x357abe=this;return function(_0x1988da){if(_0x1988da){freeIsNotKey(_0x1988da,_0x357abe['voiceExtensions'],'id');for(var _0x16d7c8=0x0,_0x30e62b={};_0x16d7c8<_0x1988da['length'];_0x16d7c8+=0x1){_0x30e62b=_0x1988da[_0x16d7c8];if(_[_0x1061('0x40')](_0x357abe[_0x1061('0x16')][_0x30e62b['id']])){_0x357abe[_0x1061('0x16')][_0x30e62b['id']]=new VoiceExtension(_0x30e62b);}else{_0x357abe[_0x1061('0x3f')](_0x357abe['voiceExtensions'][_0x30e62b['id']],_0x30e62b);}}}return _0x357abe['voiceExtensions'];};};Realtime[_0x1061('0x3e')][_0x1061('0x65')]=function(){var _0x3115a8=this;return function(_0x141b77){clearCampaigns(_0x3115a8[_0x1061('0x13')]);for(var _0x5a3ba2=0x0;_0x5a3ba2<_0x141b77[_0x1061('0x43')];_0x5a3ba2+=0x1){_['merge'](_0x3115a8[_0x1061('0x13')][_0x141b77[_0x5a3ba2][_0x1061('0x28')]],_0x141b77[_0x5a3ba2]);}return _0x3115a8['campaigns'];};};Realtime['prototype'][_0x1061('0x66')]=function(){var _0x45a6fe=this;return function(_0x4df6de){if(_0x4df6de){freeIsNotKey(_0x4df6de,_0x45a6fe[_0x1061('0x22')],'id');for(var _0xcb9780=0x0,_0x6fb47a={},_0x201f01={};_0xcb9780<_0x4df6de[_0x1061('0x43')];_0xcb9780+=0x1){_0x6fb47a=_0x4df6de[_0xcb9780];if(_['isUndefined'](_0x45a6fe[_0x1061('0x22')][_0x6fb47a['id']])){_0x45a6fe[_0x1061('0x22')][_0x6fb47a['id']]=new FaxAccount(_0x6fb47a);}else{_0x45a6fe[_0x1061('0x3f')](_0x45a6fe[_0x1061('0x22')][_0x6fb47a['id']],_0x6fb47a);}}}return _0x45a6fe[_0x1061('0x22')];};};module[_0x1061('0x67')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 3343b60..8718930 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 _0xa63a=['find','interface','format','length','connectedlinenum','lastAssignedTo','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','type','lastapplication','queue','lastdata','context','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','monitorFilename','monitors','createdAt','xcally-motion-preview','calleridname','connectedlinename','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','findAgent','membername','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','accountcode','name','isNil'];(function(_0xca3fe9,_0x3aaf2b){var _0x94c1f=function(_0x4600d2){while(--_0x4600d2){_0xca3fe9['push'](_0xca3fe9['shift']());}};_0x94c1f(++_0x3aaf2b);}(_0xa63a,0x18d));var _0xaa63=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0xa63a[_0x6978c0];return _0x361377;};'use strict';var _=require(_0xaa63('0x0'));var moment=require(_0xaa63('0x1'));var util=require(_0xaa63('0x2'));var config=require(_0xaa63('0x3'));var ami=require(_0xaa63('0x4'));var RpcVoiceAgentReport=require(_0xaa63('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xaa63('0x6'));var RpcMemberReport=require(_0xaa63('0x7'));var RpcVoiceQueueReport=require(_0xaa63('0x8'));var RpcVoiceRecording=require(_0xaa63('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xaa63('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xaa63('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xaa63('0xc'));function Report(_0x39c07e){this[_0xaa63('0xd')]=_0x39c07e;this[_0xaa63('0xe')]=_0x39c07e['agents'];this[_0xaa63('0xf')]=_0x39c07e[_0xaa63('0xf')];}Report[_0xaa63('0x10')]['sync']=function(_0x17d62e){var _0x3a931f=new VoiceQueueReport(this[_0xaa63('0xd')]);var _0x4b4053=new VoiceAgentReport(this[_0xaa63('0xd')]);var _0x471587=new VoiceDialReport(this[_0xaa63('0xd')]);var _0x150309=new VoiceCallReport(this['realtime']);var _0x5e60b8=new UserReport(this[_0xaa63('0xd')]);if(config[_0xaa63('0x11')]&&config['xdr'][_0xaa63('0x12')]){ami['on'](_0xaa63('0x13'),this[_0xaa63('0x14')][_0xaa63('0x15')](this));ami['on'](_0xaa63('0x16'),this[_0xaa63('0x17')]['bind'](this));ami['on'](_0xaa63('0x18'),this[_0xaa63('0x19')][_0xaa63('0x15')](this));ami['on'](_0xaa63('0x1a'),this[_0xaa63('0x1b')][_0xaa63('0x15')](this));ami['on'](_0xaa63('0x1c'),this['blindTransfer'][_0xaa63('0x15')](this));ami['on'](_0xaa63('0x1d'),this['attendedTransfer'][_0xaa63('0x15')](this));}};Report[_0xaa63('0x10')]['findAgent']=function(_0x416179){var _0x5ec399;_0x5ec399=_['find'](this[_0xaa63('0xe')],function(_0x3c4061){return _0x3c4061[_0xaa63('0x1e')]==_0x416179||_0x3c4061[_0xaa63('0x1f')]==_0x416179;});if(_[_0xaa63('0x20')](_0x5ec399)){var _0x5da44e=_['find'](this['telephones'],function(_0x35fe68){return _0x35fe68['accountcode']==_0x416179||_0x35fe68[_0xaa63('0x1f')]==_0x416179;});if(_0x5da44e){_0x5ec399=_[_0xaa63('0x21')](this['agents'],function(_0x4be632){return _0x4be632[_0xaa63('0x22')]==util[_0xaa63('0x23')]('SIP/%s',_0x5da44e[_0xaa63('0x1f')]);});}}return _0x5ec399;};Report[_0xaa63('0x10')][_0xaa63('0x14')]=function(_0x175d08){for(var _0x2878f7=0x0;_0x2878f7<_0x175d08[_0xaa63('0x24')];_0x2878f7+=0x1){var _0x36e2d0=this['findAgent'](_0x175d08[_0x2878f7][_0xaa63('0x25')]);if(_0x36e2d0){_0x175d08[_0x2878f7][_0xaa63('0x1e')]=_0x36e2d0[_0xaa63('0x1e')];_0x175d08[_0x2878f7]['assigned']=!![];_0x175d08[_0x2878f7][_0xaa63('0x26')]=_0x36e2d0[_0xaa63('0x1f')];_0x175d08[_0x2878f7][_0xaa63('0x22')]=_[_0xaa63('0x20')](_0x36e2d0[_0xaa63('0x22')])?util['format'](_0xaa63('0x27'),_0x36e2d0['name']):_0x36e2d0[_0xaa63('0x22')];if(_0x175d08[_0x2878f7][_0xaa63('0x28')]){_0x175d08[_0x2878f7]['queuecallercompleteAt']=moment()['format'](_0xaa63('0x29'));}if(_0x175d08[_0x2878f7]['queuecallerexit']){_0x175d08[_0x2878f7][_0xaa63('0x2a')]=moment()[_0xaa63('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x175d08[_0x2878f7]);}RpcVoiceQueueReport[_0xaa63('0x2b')](_0x175d08[_0x2878f7]);}};function extractCalleridNumber(_0x19baa5){var _0x280a52=_0x19baa5[_0xaa63('0x2c')](/<(.*?)>/);return _0x280a52?_0x280a52[0x1]:_0x19baa5;}Report[_0xaa63('0x10')][_0xaa63('0x17')]=function(_0x1e4672){_0x1e4672[_0xaa63('0x2d')]=_0x1e4672[_0xaa63('0x2d')]||_0x1e4672[_0xaa63('0x2e')];if(_0x1e4672[_0xaa63('0x2f')]=='dialer'){_0x1e4672[_0xaa63('0x30')]=_0xaa63('0x31');_0x1e4672[_0xaa63('0x32')]=_0x1e4672[_0xaa63('0x31')];if(_0x1e4672[_0xaa63('0x33')]=='from-voip-provider'){_0x1e4672[_0xaa63('0x1e')]='';_0x1e4672[_0xaa63('0x2d')]=extractCalleridNumber(_0x1e4672[_0xaa63('0x34')]);}else if(_0x1e4672[_0xaa63('0x33')]==_0xaa63('0x35')){if(_0x1e4672['destination']=='xcally-motion-preview'){_0x1e4672[_0xaa63('0x2d')]=extractCalleridNumber(_0x1e4672[_0xaa63('0x36')]);_0x1e4672[_0xaa63('0x37')]=_0x1e4672[_0xaa63('0x38')];_0x1e4672[_0xaa63('0x39')]=[_0x1e4672[_0xaa63('0x3a')],_0x1e4672[_0xaa63('0x3a')]=_0x1e4672[_0xaa63('0x39')]][0x0];_0x1e4672[_0xaa63('0x34')]=_0x1e4672[_0xaa63('0x36')];}else{_0x1e4672['destination']=_0x1e4672[_0xaa63('0x37')];_0x1e4672['calleridnum']=_0x1e4672[_0xaa63('0x38')];if(_0x1e4672[_0xaa63('0x3b')]==_0xaa63('0x3c')){_0x1e4672[_0xaa63('0x1e')]=_0x1e4672[_0xaa63('0x25')];}else{_0x1e4672[_0xaa63('0x1e')]='';}}}}else{_0x1e4672[_0xaa63('0x34')]=util['format'](_0xaa63('0x3d'),_0x1e4672['calleridname'],_0x1e4672['calleridnum']);}if(RpcVoiceTransferReport[_0xaa63('0x3e')][_0x1e4672['linkedid']]){var _0x3ceff3=RpcVoiceTransferReport[_0xaa63('0x3e')][_0x1e4672[_0xaa63('0x3f')]];_0x3ceff3[_0xaa63('0x40')]=_0x1e4672[_0xaa63('0x41')];RpcVoiceTransferReport[_0xaa63('0x42')](_0x3ceff3);delete RpcVoiceTransferReport['transfers'][_0x1e4672[_0xaa63('0x3f')]];}RpcVoiceCallReport[_0xaa63('0x2b')](_0x1e4672);if(_0x1e4672['monitor']){for(var _0x5053f1=0x0;_0x5053f1<_0x1e4672['monitors']['length'];_0x5053f1+=0x1){_0x1e4672[_0xaa63('0x43')]=_0x1e4672[_0xaa63('0x44')][_0x5053f1]['filename'];_0x1e4672[_0xaa63('0x45')]=_0x1e4672[_0xaa63('0x44')][_0x5053f1][_0xaa63('0x45')];if(_0x1e4672[_0xaa63('0x2e')]==_0xaa63('0x46')){_0x1e4672[_0xaa63('0x37')]=_0x1e4672['connectedlinenum'];_0x1e4672[_0xaa63('0x47')]=_0x1e4672[_0xaa63('0x48')];_0x1e4672[_0xaa63('0x25')]=_0x1e4672['accountcode'];_0x1e4672[_0xaa63('0x48')]=_0x1e4672['membername'];_0x1e4672['exten']=_0x1e4672['originatecalleridnum'];}else if(_0x1e4672[_0xaa63('0x2e')]=='xcally-motion-dialer'){_0x1e4672[_0xaa63('0x37')]=_0x1e4672[_0xaa63('0x2d')];_0x1e4672[_0xaa63('0x2e')]=_0x1e4672['originatecalleridnum'];}RpcVoiceRecording[_0xaa63('0x2b')](_0x1e4672);}}};Report['prototype'][_0xaa63('0x19')]=function(_0x304b1e){if(_[_0xaa63('0x49')](_0x304b1e)){_0x304b1e[_0xaa63('0x4a')](function(_0x338876){RpcVoiceAgentReport['create'](_0x338876);});}else{RpcVoiceAgentReport['create'](_0x304b1e);}};Report['prototype'][_0xaa63('0x1b')]=function(_0x3f2ac4){RpcVoiceDialReport[_0xaa63('0x2b')](_0x3f2ac4);var _0x2e28ee;var _0x2e9b3d;var _0x2f423d=_0x3f2ac4[_0xaa63('0x3a')];if(_[_0xaa63('0x4b')](_0x2f423d,'Local')){_0x2e9b3d=_0x2f423d[_0xaa63('0x4c')](_0x2f423d[_0xaa63('0x4d')]('/')+0x1,_0x2f423d[_0xaa63('0x4d')]('@'));_0x2e28ee=_['find'](this[_0xaa63('0xe')],function(_0x409b3c){return _0x409b3c[_0xaa63('0x4e')]==_0x2e9b3d||_0x409b3c[_0xaa63('0x4f')]==_0x2e9b3d||_0x409b3c[_0xaa63('0x1e')]==_0x2e9b3d;});}else{_0x2e9b3d=_0x2f423d[_0xaa63('0x4c')](_0x2f423d[_0xaa63('0x4d')]('/')+0x1,_0x2f423d[_0xaa63('0x50')]('-'));_0x2e28ee=this[_0xaa63('0x51')](_0x2e9b3d);}if(_0x2e28ee){_0x3f2ac4[_0xaa63('0x22')]=_[_0xaa63('0x20')](_0x2e28ee[_0xaa63('0x22')])?util['format'](_0xaa63('0x27'),_0x2e28ee[_0xaa63('0x1f')]):_0x2e28ee[_0xaa63('0x22')];_0x3f2ac4[_0xaa63('0x52')]=_0x2e28ee[_0xaa63('0x1f')];_0x3f2ac4[_0xaa63('0x1e')]=_0x2e28ee['accountcode'];RpcMemberReport[_0xaa63('0x1b')](_0x3f2ac4);}};Report[_0xaa63('0x10')][_0xaa63('0x42')]=function(_0x57f0ca){RpcVoiceTransferReport[_0xaa63('0x3e')][_0x57f0ca[_0xaa63('0x53')]]=_0x57f0ca;};Report[_0xaa63('0x10')][_0xaa63('0x54')]=function(_0x52f7c6){RpcVoiceTransferReport['attendedTransfer'](_0x52f7c6);};module[_0xaa63('0x55')]=Report; \ No newline at end of file +var _0x2e41=['lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','monitors','length','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','lastIndexOf','membername','transfererlinkedid','exports','lodash','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','interface','format','SIP/%s','name','connectedlinenum','assigned','lastAssignedTo','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','dialer'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0x2e41,0xd8));var _0x12e4=function(_0x4741e4,_0x457e2e){_0x4741e4=_0x4741e4-0x0;var _0x459f97=_0x2e41[_0x4741e4];return _0x459f97;};'use strict';var _=require(_0x12e4('0x0'));var moment=require('moment');var util=require('util');var config=require(_0x12e4('0x1'));var ami=require(_0x12e4('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x12e4('0x3'));var RpcMemberReport=require(_0x12e4('0x4'));var RpcVoiceQueueReport=require(_0x12e4('0x5'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x12e4('0x6'));var VoiceQueueReport=require(_0x12e4('0x7'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x12e4('0x8'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x12e4('0x9'));function Report(_0x83eaf5){this['realtime']=_0x83eaf5;this['agents']=_0x83eaf5[_0x12e4('0xa')];this[_0x12e4('0xb')]=_0x83eaf5['telephones'];}Report[_0x12e4('0xc')][_0x12e4('0xd')]=function(_0x4fc108){var _0x14458b=new VoiceQueueReport(this['realtime']);var _0x34d032=new VoiceAgentReport(this[_0x12e4('0xe')]);var _0x585972=new VoiceDialReport(this[_0x12e4('0xe')]);var _0x2b1a5a=new VoiceCallReport(this[_0x12e4('0xe')]);var _0xb04846=new UserReport(this[_0x12e4('0xe')]);if(config[_0x12e4('0xf')]&&config[_0x12e4('0xf')][_0x12e4('0x10')]){ami['on'](_0x12e4('0x11'),this[_0x12e4('0x12')][_0x12e4('0x13')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x12e4('0x13')](this));ami['on'](_0x12e4('0x14'),this['voiceAgentReport'][_0x12e4('0x13')](this));ami['on'](_0x12e4('0x15'),this[_0x12e4('0x16')]['bind'](this));ami['on'](_0x12e4('0x17'),this['blindTransfer']['bind'](this));ami['on'](_0x12e4('0x18'),this[_0x12e4('0x19')][_0x12e4('0x13')](this));}};Report[_0x12e4('0xc')][_0x12e4('0x1a')]=function(_0x22543c){var _0x43df93;_0x43df93=_[_0x12e4('0x1b')](this[_0x12e4('0xa')],function(_0x383506){return _0x383506[_0x12e4('0x1c')]==_0x22543c||_0x383506['name']==_0x22543c;});if(_[_0x12e4('0x1d')](_0x43df93)){var _0x451df2=_['find'](this[_0x12e4('0xb')],function(_0x5d8f33){return _0x5d8f33[_0x12e4('0x1c')]==_0x22543c||_0x5d8f33['name']==_0x22543c;});if(_0x451df2){_0x43df93=_[_0x12e4('0x1b')](this[_0x12e4('0xa')],function(_0x397b6f){return _0x397b6f[_0x12e4('0x1e')]==util[_0x12e4('0x1f')](_0x12e4('0x20'),_0x451df2[_0x12e4('0x21')]);});}}return _0x43df93;};Report['prototype'][_0x12e4('0x12')]=function(_0x15425f){for(var _0x3801d3=0x0;_0x3801d3<_0x15425f['length'];_0x3801d3+=0x1){var _0xa7c5=this[_0x12e4('0x1a')](_0x15425f[_0x3801d3][_0x12e4('0x22')]);if(_0xa7c5){_0x15425f[_0x3801d3][_0x12e4('0x1c')]=_0xa7c5['accountcode'];_0x15425f[_0x3801d3][_0x12e4('0x23')]=!![];_0x15425f[_0x3801d3][_0x12e4('0x24')]=_0xa7c5[_0x12e4('0x21')];_0x15425f[_0x3801d3]['interface']=_[_0x12e4('0x1d')](_0xa7c5[_0x12e4('0x1e')])?util[_0x12e4('0x1f')]('SIP/%s',_0xa7c5[_0x12e4('0x21')]):_0xa7c5[_0x12e4('0x1e')];if(_0x15425f[_0x3801d3]['queuecallercomplete']){_0x15425f[_0x3801d3]['queuecallercompleteAt']=moment()[_0x12e4('0x1f')](_0x12e4('0x25'));}if(_0x15425f[_0x3801d3][_0x12e4('0x26')]){_0x15425f[_0x3801d3][_0x12e4('0x27')]=moment()[_0x12e4('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x12e4('0x12')](_0x15425f[_0x3801d3]);}RpcVoiceQueueReport[_0x12e4('0x28')](_0x15425f[_0x3801d3]);}};function extractCalleridNumber(_0x399ebc){var _0x1b84ee=_0x399ebc[_0x12e4('0x29')](/<(.*?)>/);return _0x1b84ee?_0x1b84ee[0x1]:_0x399ebc;}Report[_0x12e4('0xc')][_0x12e4('0x2a')]=function(_0x25e70f){_0x25e70f[_0x12e4('0x2b')]=_0x25e70f[_0x12e4('0x2b')]||_0x25e70f['exten'];if(_0x25e70f['type']==_0x12e4('0x2c')){_0x25e70f[_0x12e4('0x2d')]=_0x12e4('0x2e');_0x25e70f[_0x12e4('0x2f')]=_0x25e70f[_0x12e4('0x2e')];if(_0x25e70f[_0x12e4('0x30')]=='from-voip-provider'){_0x25e70f[_0x12e4('0x1c')]='';_0x25e70f[_0x12e4('0x2b')]=extractCalleridNumber(_0x25e70f[_0x12e4('0x31')]);}else if(_0x25e70f[_0x12e4('0x30')]==_0x12e4('0x32')){if(_0x25e70f[_0x12e4('0x2b')]==_0x12e4('0x33')){_0x25e70f[_0x12e4('0x2b')]=extractCalleridNumber(_0x25e70f[_0x12e4('0x34')]);_0x25e70f[_0x12e4('0x35')]=_0x25e70f[_0x12e4('0x36')];_0x25e70f[_0x12e4('0x37')]=[_0x25e70f['channel'],_0x25e70f[_0x12e4('0x38')]=_0x25e70f[_0x12e4('0x37')]][0x0];_0x25e70f[_0x12e4('0x31')]=_0x25e70f[_0x12e4('0x34')];}else{_0x25e70f[_0x12e4('0x2b')]=_0x25e70f[_0x12e4('0x35')];_0x25e70f[_0x12e4('0x35')]=_0x25e70f[_0x12e4('0x36')];if(_0x25e70f[_0x12e4('0x39')]==_0x12e4('0x3a')){_0x25e70f[_0x12e4('0x1c')]=_0x25e70f[_0x12e4('0x22')];}else{_0x25e70f[_0x12e4('0x1c')]='';}}}}else{_0x25e70f[_0x12e4('0x31')]=util['format'](_0x12e4('0x3b'),_0x25e70f[_0x12e4('0x3c')],_0x25e70f[_0x12e4('0x35')]);}if(RpcVoiceTransferReport[_0x12e4('0x3d')][_0x25e70f['linkedid']]){var _0x32333c=RpcVoiceTransferReport[_0x12e4('0x3d')][_0x25e70f[_0x12e4('0x3e')]];_0x32333c[_0x12e4('0x3f')]=_0x25e70f[_0x12e4('0x40')];RpcVoiceTransferReport[_0x12e4('0x41')](_0x32333c);delete RpcVoiceTransferReport['transfers'][_0x25e70f[_0x12e4('0x3e')]];}RpcVoiceCallReport[_0x12e4('0x28')](_0x25e70f);if(_0x25e70f['monitor']){for(var _0x2af22e=0x0;_0x2af22e<_0x25e70f[_0x12e4('0x42')][_0x12e4('0x43')];_0x2af22e+=0x1){_0x25e70f[_0x12e4('0x44')]=_0x25e70f[_0x12e4('0x42')][_0x2af22e][_0x12e4('0x45')];_0x25e70f[_0x12e4('0x46')]=_0x25e70f['monitors'][_0x2af22e][_0x12e4('0x46')];if(_0x25e70f[_0x12e4('0x47')]==_0x12e4('0x33')){_0x25e70f[_0x12e4('0x35')]=_0x25e70f[_0x12e4('0x22')];_0x25e70f[_0x12e4('0x3c')]=_0x25e70f[_0x12e4('0x48')];_0x25e70f[_0x12e4('0x22')]=_0x25e70f[_0x12e4('0x1c')];_0x25e70f[_0x12e4('0x48')]=_0x25e70f['membername'];_0x25e70f['exten']=_0x25e70f[_0x12e4('0x36')];}else if(_0x25e70f[_0x12e4('0x47')]==_0x12e4('0x49')){_0x25e70f['calleridnum']=_0x25e70f[_0x12e4('0x2b')];_0x25e70f[_0x12e4('0x47')]=_0x25e70f['originatecalleridnum'];}RpcVoiceRecording[_0x12e4('0x28')](_0x25e70f);}}};Report['prototype'][_0x12e4('0x4a')]=function(_0x136797){if(_[_0x12e4('0x4b')](_0x136797)){_0x136797[_0x12e4('0x4c')](function(_0x523ec0){RpcVoiceAgentReport[_0x12e4('0x28')](_0x523ec0);});}else{RpcVoiceAgentReport['create'](_0x136797);}};Report[_0x12e4('0xc')][_0x12e4('0x16')]=function(_0x359f14){RpcVoiceDialReport[_0x12e4('0x28')](_0x359f14);var _0x1dd292;var _0x575d72;var _0x5bcab5=_0x359f14[_0x12e4('0x38')];if(_[_0x12e4('0x4d')](_0x5bcab5,_0x12e4('0x4e'))){_0x575d72=_0x5bcab5['substring'](_0x5bcab5['indexOf']('/')+0x1,_0x5bcab5[_0x12e4('0x4f')]('@'));_0x1dd292=_[_0x12e4('0x1b')](this[_0x12e4('0xa')],function(_0x26a808){return _0x26a808[_0x12e4('0x50')]==_0x575d72||_0x26a808[_0x12e4('0x51')]==_0x575d72||_0x26a808[_0x12e4('0x1c')]==_0x575d72;});}else{_0x575d72=_0x5bcab5[_0x12e4('0x52')](_0x5bcab5['indexOf']('/')+0x1,_0x5bcab5[_0x12e4('0x53')]('-'));_0x1dd292=this[_0x12e4('0x1a')](_0x575d72);}if(_0x1dd292){_0x359f14[_0x12e4('0x1e')]=_[_0x12e4('0x1d')](_0x1dd292[_0x12e4('0x1e')])?util['format'](_0x12e4('0x20'),_0x1dd292[_0x12e4('0x21')]):_0x1dd292[_0x12e4('0x1e')];_0x359f14[_0x12e4('0x54')]=_0x1dd292[_0x12e4('0x21')];_0x359f14['accountcode']=_0x1dd292['accountcode'];RpcMemberReport[_0x12e4('0x16')](_0x359f14);}};Report[_0x12e4('0xc')][_0x12e4('0x41')]=function(_0x1d0e84){RpcVoiceTransferReport[_0x12e4('0x3d')][_0x1d0e84[_0x12e4('0x55')]]=_0x1d0e84;};Report[_0x12e4('0xc')][_0x12e4('0x19')]=function(_0x206777){RpcVoiceTransferReport[_0x12e4('0x19')](_0x206777);};module[_0x12e4('0x56')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 492475f..347400f 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27fc=['indexOf','mobile','phone','[userReport][devicestatechange]','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','syncDeviceState','peerstatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','then','actionDeviceStateList','inspect','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','[userReport][registry]','find','stateRegistry','state','merge','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','error','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','startsWith'];(function(_0x13066d,_0x176208){var _0x313119=function(_0x2d8b43){while(--_0x2d8b43){_0x13066d['push'](_0x13066d['shift']());}};_0x313119(++_0x176208);}(_0x27fc,0x185));var _0xc27f=function(_0x5d4db8,_0x4ad01b){_0x5d4db8=_0x5d4db8-0x0;var _0x415548=_0x27fc[_0x5d4db8];return _0x415548;};'use strict';var _=require(_0xc27f('0x0'));var moment=require(_0xc27f('0x1'));var util=require('util');var Redis=require(_0xc27f('0x2'));var BPromise=require(_0xc27f('0x3'));var config=require(_0xc27f('0x4'));var logger=require(_0xc27f('0x5'))(_0xc27f('0x6'));var ami=require(_0xc27f('0x7'));config[_0xc27f('0x8')]=_[_0xc27f('0x9')](config['redis'],{'host':_0xc27f('0xa'),'port':0x18eb});var io=require(_0xc27f('0xb'))(new Redis(config[_0xc27f('0x8')]));function UserReport(_0x5e3143){this[_0xc27f('0xc')]=_0x5e3143[_0xc27f('0xc')];this[_0xc27f('0xd')]=_0x5e3143['agents'];this[_0xc27f('0xe')]=_0x5e3143[_0xc27f('0xe')];ami['on'](_0xc27f('0xf'),this[_0xc27f('0x10')]['bind'](this));ami['on']('registry',this[_0xc27f('0x10')]['bind'](this));ami['on']('devicestatechange',this[_0xc27f('0x11')]['bind'](this));ami['on'](_0xc27f('0x12'),this['syncPeerStatus']['bind'](this));return this[_0xc27f('0x13')]();}function showSipRegistrations(){Promise[_0xc27f('0x14')]()['then'](ami[_0xc27f('0x15')]())[_0xc27f('0x16')](function(_0x4f4527){logger['error']('[userReport][sipshowregistry]',util['inspect'](_0x4f4527,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xc27f('0x14')]()[_0xc27f('0x17')](ami[_0xc27f('0x18')]())[_0xc27f('0x16')](function(_0x505af4){logger['error']('[userReport][devicestatelist]',util[_0xc27f('0x19')](_0x505af4,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc27f('0x14')]()[_0xc27f('0x17')](ami['actionSipPeerStatus']())[_0xc27f('0x16')](function(_0x5739b4){logger['error'](_0xc27f('0x1a'),util['inspect'](_0x5739b4,{'showHidden':![],'depth':null}));});}UserReport[_0xc27f('0x1b')][_0xc27f('0x13')]=function(){setInterval(function(){BPromise[_0xc27f('0x14')]()[_0xc27f('0x17')](showSipRegistrations())['then'](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0xc27f('0x1b')][_0xc27f('0x1c')]=function(_0x284e64){return _0x284e64!==null&&!_[_0xc27f('0x1d')](_0x284e64);};UserReport['prototype'][_0xc27f('0x1e')]=function(_0xd53435,_0x33f563,_0x54cbc9){io['to'](_0xd53435)['emit'](_0x33f563,_0x54cbc9);};UserReport[_0xc27f('0x1b')][_0xc27f('0x10')]=function(_0x10cb52){try{if(this[_0xc27f('0x1c')](_0x10cb52)){logger['info'](_0xc27f('0x1f'),_0x10cb52[_0xc27f('0x20')],_0x10cb52['state']);logger['debug'](_0xc27f('0x21'),util[_0xc27f('0x19')](_0x10cb52,{'showHidden':![],'depth':null}));var _0xfb3aa5=_[_0xc27f('0x22')](this[_0xc27f('0xc')],{'defaultuser':_0x10cb52[_0xc27f('0x20')]});if(_0xfb3aa5){_0x10cb52[_0xc27f('0x23')]=_0x10cb52[_0xc27f('0x24')];_[_0xc27f('0x25')](_0xfb3aa5,_['omit'](_0x10cb52,[_0xc27f('0x26'),_0xc27f('0x27'),'username',_0xc27f('0x24')]));logger[_0xc27f('0x28')](_0xc27f('0x29'),util[_0xc27f('0x19')](_0xfb3aa5,{'showHidden':![],'depth':null}));this[_0xc27f('0x1e')](util[_0xc27f('0x2a')](_0xc27f('0x2b'),_0xfb3aa5[_0xc27f('0x2c')]),'trunk:save',_0xfb3aa5);}}}catch(_0x46c81d){logger[_0xc27f('0x2d')](_0xc27f('0x21'),util[_0xc27f('0x19')](_0x46c81d,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x39afe2){try{if(this[_0xc27f('0x1c')](_0x39afe2)){logger[_0xc27f('0x2e')](_0xc27f('0x2f'),_0x39afe2['device'],_0x39afe2[_0xc27f('0x24')]);logger[_0xc27f('0x28')]('[userReport][devicestatechange]',util[_0xc27f('0x19')](_0x39afe2,{'showHidden':![],'depth':null}));if(this[_0xc27f('0xd')][_0x39afe2[_0xc27f('0x30')]]){if(!this[_0xc27f('0xd')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x31')]||_0x39afe2[_0xc27f('0x24')][_0xc27f('0x32')]()==_0xc27f('0x33')){this['agents'][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x31')]=![];if(this['agents'][_0x39afe2['device']][_0xc27f('0x24')]!==_0x39afe2[_0xc27f('0x24')]['toLowerCase']()){this[_0xc27f('0xd')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x34')]=_[_0xc27f('0x35')](moment()['format']('x'));}this[_0xc27f('0xd')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x24')]=_0x39afe2[_0xc27f('0x24')]['toLowerCase']();this[_0xc27f('0xd')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x36')](_0x39afe2);}}else if(this['telephones'][_0x39afe2[_0xc27f('0x30')]]){if(this[_0xc27f('0xe')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x24')]!==_0x39afe2[_0xc27f('0x24')][_0xc27f('0x32')]()){this[_0xc27f('0xe')][_0x39afe2[_0xc27f('0x30')]]['stateTime']=_[_0xc27f('0x35')](moment()[_0xc27f('0x2a')]('x'));}this[_0xc27f('0xe')][_0x39afe2['device']][_0xc27f('0x24')]=_0x39afe2[_0xc27f('0x24')]['toLowerCase']();logger['debug'](_0xc27f('0x37'),util[_0xc27f('0x19')](this['telephones'][_0x39afe2[_0xc27f('0x30')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xc27f('0x2a')](_0xc27f('0x38'),this[_0xc27f('0xe')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x2c')]),_0xc27f('0x39'),this['telephones'][_0x39afe2[_0xc27f('0x30')]]);}else if(this[_0xc27f('0xc')][_0x39afe2[_0xc27f('0x30')]]){if(this[_0xc27f('0xc')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x24')]!==_0x39afe2['state'][_0xc27f('0x32')]()){this[_0xc27f('0xc')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x34')]=_['toNumber'](moment()['format']('x'));}this[_0xc27f('0xc')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x24')]=_0x39afe2['state'][_0xc27f('0x32')]();logger['debug'](_0xc27f('0x3a'),util[_0xc27f('0x19')](this[_0xc27f('0xc')][_0x39afe2['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0xc27f('0x2a')](_0xc27f('0x2b'),this[_0xc27f('0xc')][_0x39afe2[_0xc27f('0x30')]][_0xc27f('0x2c')]),_0xc27f('0x3b'),this[_0xc27f('0xc')][_0x39afe2[_0xc27f('0x30')]]);}else if(_[_0xc27f('0x3c')](_0x39afe2['device'],'Local')){var _0x2be240=_0x39afe2['device'];var _0x2034da=_0x2be240['substring'](_0x2be240[_0xc27f('0x3d')]('/')+0x1,_0x2be240[_0xc27f('0x3d')]('@'));var _0x436712=_[_0xc27f('0x22')](this[_0xc27f('0xd')],function(_0x414ccf){return _0x414ccf[_0xc27f('0x3e')]==_0x2034da||_0x414ccf[_0xc27f('0x3f')]==_0x2034da||_0x414ccf['accountcode']==_0x2034da;});if(_0x436712){if(_0x436712[_0xc27f('0x24')]!==_0x39afe2[_0xc27f('0x24')][_0xc27f('0x32')]()){_0x436712[_0xc27f('0x34')]=_[_0xc27f('0x35')](moment()[_0xc27f('0x2a')]('x'));}_0x436712[_0xc27f('0x24')]=_0x39afe2[_0xc27f('0x24')][_0xc27f('0x32')]();_0x436712['local']=!![];_0x436712[_0xc27f('0x36')](_0x39afe2);}}}}catch(_0x24b491){logger[_0xc27f('0x2d')](_0xc27f('0x40'),util[_0xc27f('0x19')](_0x24b491,{'showHidden':![],'depth':null}));}};UserReport[_0xc27f('0x1b')][_0xc27f('0x41')]=function(_0x27e537){try{if(this['isNotNull'](_0x27e537)&&this[_0xc27f('0x1c')](_0x27e537['peerstatus'])){logger[_0xc27f('0x2e')](_0xc27f('0x42'),_0x27e537[_0xc27f('0x43')],_0x27e537['address'],_0x27e537[_0xc27f('0x12')]);logger[_0xc27f('0x28')]('[userReport][peerstatus]',util['inspect'](_0x27e537,{'showHidden':![],'depth':null}));if(this['agents'][_0x27e537[_0xc27f('0x43')]]){if(!this[_0xc27f('0xd')][_0x27e537[_0xc27f('0x43')]][_0xc27f('0x31')]||_0x27e537[_0xc27f('0x12')][_0xc27f('0x32')]()==_0xc27f('0x44')){this[_0xc27f('0xd')][_0x27e537[_0xc27f('0x43')]][_0xc27f('0x31')]=![];this['agents'][_0x27e537[_0xc27f('0x43')]][_0xc27f('0x45')]=_0x27e537[_0xc27f('0x12')][_0xc27f('0x32')]();this[_0xc27f('0xd')][_0x27e537['peer']][_0xc27f('0x46')]=_0x27e537[_0xc27f('0x46')];this[_0xc27f('0xd')][_0x27e537[_0xc27f('0x43')]]['updateStatusRealtime'](_0x27e537);}}else if(this[_0xc27f('0xe')][_0x27e537[_0xc27f('0x43')]]){this[_0xc27f('0xe')][_0x27e537[_0xc27f('0x43')]][_0xc27f('0x45')]=_0x27e537[_0xc27f('0x12')][_0xc27f('0x32')]();this['telephones'][_0x27e537[_0xc27f('0x43')]][_0xc27f('0x46')]=_0x27e537[_0xc27f('0x46')];logger[_0xc27f('0x28')](_0xc27f('0x47'),util['inspect'](this['telephones'][_0x27e537[_0xc27f('0x43')]],{'showHidden':![],'depth':null}));this[_0xc27f('0x1e')](util[_0xc27f('0x2a')](_0xc27f('0x38'),this[_0xc27f('0xe')][_0x27e537[_0xc27f('0x43')]][_0xc27f('0x2c')]),_0xc27f('0x39'),this[_0xc27f('0xe')][_0x27e537['peer']]);}else if(this[_0xc27f('0xc')][_0x27e537[_0xc27f('0x43')]]){this[_0xc27f('0xc')][_0x27e537[_0xc27f('0x43')]][_0xc27f('0x45')]=_0x27e537[_0xc27f('0x12')]['toLowerCase']();this[_0xc27f('0xc')][_0x27e537[_0xc27f('0x43')]][_0xc27f('0x46')]=_0x27e537[_0xc27f('0x46')];logger[_0xc27f('0x28')](_0xc27f('0x48'),util[_0xc27f('0x19')](this['trunks'][_0x27e537[_0xc27f('0x43')]],{'showHidden':![],'depth':null}));this[_0xc27f('0x1e')](util[_0xc27f('0x2a')]('trunk:%s',this[_0xc27f('0xc')][_0x27e537[_0xc27f('0x43')]][_0xc27f('0x2c')]),_0xc27f('0x3b'),this[_0xc27f('0xc')][_0x27e537[_0xc27f('0x43')]]);}}}catch(_0x38db89){logger['error'](_0xc27f('0x49'),util['inspect'](_0x38db89,{'showHidden':![],'depth':null}));}};module[_0xc27f('0x4a')]=UserReport; \ No newline at end of file +var _0x839d=['agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','merge','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','emit','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','local','format','updateStatusRealtime','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','indexOf','find','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks'];(function(_0x52dbc4,_0x28514c){var _0x34e2a8=function(_0x2e9570){while(--_0x2e9570){_0x52dbc4['push'](_0x52dbc4['shift']());}};_0x34e2a8(++_0x28514c);}(_0x839d,0x12b));var _0xd839=function(_0x523e6c,_0x2dfbb7){_0x523e6c=_0x523e6c-0x0;var _0x16a8ea=_0x839d[_0x523e6c];return _0x16a8ea;};'use strict';var _=require(_0xd839('0x0'));var moment=require(_0xd839('0x1'));var util=require(_0xd839('0x2'));var Redis=require(_0xd839('0x3'));var BPromise=require(_0xd839('0x4'));var config=require(_0xd839('0x5'));var logger=require(_0xd839('0x6'))(_0xd839('0x7'));var ami=require('../ami');config[_0xd839('0x8')]=_[_0xd839('0x9')](config[_0xd839('0x8')],{'host':_0xd839('0xa'),'port':0x18eb});var io=require(_0xd839('0xb'))(new Redis(config[_0xd839('0x8')]));function UserReport(_0x211925){this[_0xd839('0xc')]=_0x211925['trunks'];this[_0xd839('0xd')]=_0x211925[_0xd839('0xd')];this[_0xd839('0xe')]=_0x211925['telephones'];ami['on'](_0xd839('0xf'),this[_0xd839('0x10')][_0xd839('0x11')](this));ami['on'](_0xd839('0x12'),this[_0xd839('0x10')][_0xd839('0x11')](this));ami['on'](_0xd839('0x13'),this[_0xd839('0x14')][_0xd839('0x11')](this));ami['on'](_0xd839('0x15'),this[_0xd839('0x16')][_0xd839('0x11')](this));return this[_0xd839('0x17')]();}function showSipRegistrations(){Promise[_0xd839('0x18')]()['then'](ami[_0xd839('0x19')]())[_0xd839('0x1a')](function(_0x2b6a7b){logger[_0xd839('0x1b')](_0xd839('0x1c'),util[_0xd839('0x1d')](_0x2b6a7b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xd839('0x1e')](ami[_0xd839('0x1f')]())[_0xd839('0x1a')](function(_0xfcd759){logger[_0xd839('0x1b')]('[userReport][devicestatelist]',util['inspect'](_0xfcd759,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xd839('0x18')]()['then'](ami[_0xd839('0x20')]())[_0xd839('0x1a')](function(_0x1e8c1d){logger[_0xd839('0x1b')](_0xd839('0x21'),util[_0xd839('0x1d')](_0x1e8c1d,{'showHidden':![],'depth':null}));});}UserReport[_0xd839('0x22')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0xd839('0x1e')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xd839('0x23')]=function(_0x315220){return _0x315220!==null&&!_['isUndefined'](_0x315220);};UserReport[_0xd839('0x22')]['emit']=function(_0x1032a6,_0x2cdf3d,_0x391b4d){io['to'](_0x1032a6)['emit'](_0x2cdf3d,_0x391b4d);};UserReport[_0xd839('0x22')][_0xd839('0x10')]=function(_0x40b649){try{if(this[_0xd839('0x23')](_0x40b649)){logger['info'](_0xd839('0x24'),_0x40b649[_0xd839('0x25')],_0x40b649[_0xd839('0x26')]);logger[_0xd839('0x27')](_0xd839('0x28'),util[_0xd839('0x1d')](_0x40b649,{'showHidden':![],'depth':null}));var _0x21486d=_['find'](this[_0xd839('0xc')],{'defaultuser':_0x40b649[_0xd839('0x25')]});if(_0x21486d){_0x40b649['stateRegistry']=_0x40b649[_0xd839('0x26')];_[_0xd839('0x29')](_0x21486d,_['omit'](_0x40b649,[_0xd839('0x2a'),'actionid',_0xd839('0x25'),_0xd839('0x26')]));logger[_0xd839('0x27')](_0xd839('0x2b'),util['inspect'](_0x21486d,{'showHidden':![],'depth':null}));this[_0xd839('0x2c')](util['format'](_0xd839('0x2d'),_0x21486d[_0xd839('0x2e')]),_0xd839('0x2f'),_0x21486d);}}}catch(_0xbef26b){logger[_0xd839('0x1b')](_0xd839('0x28'),util[_0xd839('0x1d')](_0xbef26b,{'showHidden':![],'depth':null}));}};UserReport[_0xd839('0x22')][_0xd839('0x14')]=function(_0x1a45c6){try{if(this[_0xd839('0x23')](_0x1a45c6)){logger[_0xd839('0x30')](_0xd839('0x31'),_0x1a45c6[_0xd839('0x32')],_0x1a45c6[_0xd839('0x26')]);logger['debug'](_0xd839('0x33'),util[_0xd839('0x1d')](_0x1a45c6,{'showHidden':![],'depth':null}));if(this['agents'][_0x1a45c6[_0xd839('0x32')]]){if(!this['agents'][_0x1a45c6['device']]['local']||_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]()==_0xd839('0x35')){this[_0xd839('0xd')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x36')]=![];if(this[_0xd839('0xd')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]!==_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]()){this[_0xd839('0xd')][_0x1a45c6['device']]['stateTime']=_['toNumber'](moment()[_0xd839('0x37')]('x'));}this[_0xd839('0xd')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]=_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]();this[_0xd839('0xd')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x38')](_0x1a45c6);}}else if(this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]]){if(this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]]['state']!==_0x1a45c6[_0xd839('0x26')]['toLowerCase']()){this['telephones'][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x39')]=_[_0xd839('0x3a')](moment()['format']('x'));}this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]=_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]();logger[_0xd839('0x27')](_0xd839('0x3b'),util[_0xd839('0x1d')](this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xd839('0x37')](_0xd839('0x3c'),this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x2e')]),_0xd839('0x3d'),this[_0xd839('0xe')][_0x1a45c6['device']]);}else if(this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]]){if(this['trunks'][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]!==_0x1a45c6[_0xd839('0x26')]['toLowerCase']()){this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x39')]=_[_0xd839('0x3a')](moment()['format']('x'));}this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]=_0x1a45c6['state'][_0xd839('0x34')]();logger[_0xd839('0x27')](_0xd839('0x3e'),util['inspect'](this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]],{'showHidden':![],'depth':null}));this[_0xd839('0x2c')](util[_0xd839('0x37')](_0xd839('0x2d'),this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x2e')]),'trunk:save',this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]]);}else if(_['startsWith'](_0x1a45c6[_0xd839('0x32')],_0xd839('0x3f'))){var _0x175444=_0x1a45c6[_0xd839('0x32')];var _0x1e4e97=_0x175444[_0xd839('0x40')](_0x175444[_0xd839('0x41')]('/')+0x1,_0x175444[_0xd839('0x41')]('@'));var _0x37ff0f=_[_0xd839('0x42')](this[_0xd839('0xd')],function(_0x4caeba){return _0x4caeba[_0xd839('0x43')]==_0x1e4e97||_0x4caeba[_0xd839('0x44')]==_0x1e4e97||_0x4caeba[_0xd839('0x45')]==_0x1e4e97;});if(_0x37ff0f){if(_0x37ff0f['state']!==_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]()){_0x37ff0f[_0xd839('0x39')]=_[_0xd839('0x3a')](moment()[_0xd839('0x37')]('x'));}_0x37ff0f[_0xd839('0x26')]=_0x1a45c6[_0xd839('0x26')]['toLowerCase']();_0x37ff0f[_0xd839('0x36')]=!![];_0x37ff0f['updateStatusRealtime'](_0x1a45c6);}}}}catch(_0x4ff338){logger['error'](_0xd839('0x33'),util[_0xd839('0x1d')](_0x4ff338,{'showHidden':![],'depth':null}));}};UserReport[_0xd839('0x22')]['syncPeerStatus']=function(_0x254d74){try{if(this[_0xd839('0x23')](_0x254d74)&&this['isNotNull'](_0x254d74['peerstatus'])){logger['info'](_0xd839('0x46'),_0x254d74[_0xd839('0x47')],_0x254d74[_0xd839('0x48')],_0x254d74[_0xd839('0x15')]);logger[_0xd839('0x27')](_0xd839('0x49'),util[_0xd839('0x1d')](_0x254d74,{'showHidden':![],'depth':null}));if(this[_0xd839('0xd')][_0x254d74[_0xd839('0x47')]]){if(!this[_0xd839('0xd')][_0x254d74['peer']][_0xd839('0x36')]||_0x254d74['peerstatus'][_0xd839('0x34')]()=='registered'){this[_0xd839('0xd')][_0x254d74[_0xd839('0x47')]][_0xd839('0x36')]=![];this['agents'][_0x254d74[_0xd839('0x47')]][_0xd839('0x4a')]=_0x254d74[_0xd839('0x15')]['toLowerCase']();this['agents'][_0x254d74['peer']][_0xd839('0x48')]=_0x254d74['address'];this[_0xd839('0xd')][_0x254d74[_0xd839('0x47')]][_0xd839('0x38')](_0x254d74);}}else if(this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]]){this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]][_0xd839('0x4a')]=_0x254d74[_0xd839('0x15')]['toLowerCase']();this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]]['address']=_0x254d74['address'];logger[_0xd839('0x27')](_0xd839('0x4b'),util[_0xd839('0x1d')](this['telephones'][_0x254d74[_0xd839('0x47')]],{'showHidden':![],'depth':null}));this[_0xd839('0x2c')](util[_0xd839('0x37')](_0xd839('0x3c'),this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]][_0xd839('0x2e')]),_0xd839('0x3d'),this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]]);}else if(this[_0xd839('0xc')][_0x254d74[_0xd839('0x47')]]){this[_0xd839('0xc')][_0x254d74[_0xd839('0x47')]][_0xd839('0x4a')]=_0x254d74[_0xd839('0x15')]['toLowerCase']();this[_0xd839('0xc')][_0x254d74[_0xd839('0x47')]]['address']=_0x254d74[_0xd839('0x48')];logger[_0xd839('0x27')](_0xd839('0x4c'),util[_0xd839('0x1d')](this[_0xd839('0xc')][_0x254d74['peer']],{'showHidden':![],'depth':null}));this[_0xd839('0x2c')](util['format'](_0xd839('0x2d'),this[_0xd839('0xc')][_0x254d74[_0xd839('0x47')]][_0xd839('0x2e')]),_0xd839('0x2f'),this[_0xd839('0xc')][_0x254d74['peer']]);}}}catch(_0x3e791a){logger[_0xd839('0x1b')](_0xd839('0x49'),util[_0xd839('0x1d')](_0x3e791a,{'showHidden':![],'depth':null}));}};module[_0xd839('0x4d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 93b9977..aeebcb4 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e63=['[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','talktime','acwtime','acwTimeout','agentacw','custom:agentcomplete','addVariable','value','variable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','membername','error','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','info','connectedlinename','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentcomplete','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','hasOwnProperty'];(function(_0x2d66fd,_0x3c9415){var _0x322f24=function(_0x3aa4cc){while(--_0x3aa4cc){_0x2d66fd['push'](_0x2d66fd['shift']());}};_0x322f24(++_0x3c9415);}(_0x2e63,0x14d));var _0x32e6=function(_0xa69733,_0x2aa122){_0xa69733=_0xa69733-0x0;var _0xca5645=_0x2e63[_0xa69733];return _0xca5645;};'use strict';var _=require('lodash');var moment=require(_0x32e6('0x0'));var util=require(_0x32e6('0x1'));var Redis=require(_0x32e6('0x2'));var config=require(_0x32e6('0x3'));var logger=require(_0x32e6('0x4'))(_0x32e6('0x5'));var ami=require(_0x32e6('0x6'));config['redis']=_[_0x32e6('0x7')](config[_0x32e6('0x8')],{'host':_0x32e6('0x9'),'port':0x18eb});var io=require(_0x32e6('0xa'))(new Redis(config[_0x32e6('0x8')]));function VoiceAgentReport(_0x43d291){this[_0x32e6('0xb')]={};this[_0x32e6('0xc')]=_0x43d291[_0x32e6('0xb')];this[_0x32e6('0xd')]=_0x43d291[_0x32e6('0xd')];this[_0x32e6('0xe')]=_0x43d291['agents'];this[_0x32e6('0xf')]={};ami['on'](_0x32e6('0x10'),this[_0x32e6('0x11')][_0x32e6('0x12')](this));ami['on'](_0x32e6('0x13'),this['syncAgentConnect'][_0x32e6('0x12')](this));ami['on'](_0x32e6('0x14'),this[_0x32e6('0x15')][_0x32e6('0x12')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x32e6('0x12')](this));ami['on']('agentcomplete',this[_0x32e6('0x16')]['bind'](this));ami['on'](_0x32e6('0x17'),this[_0x32e6('0x18')][_0x32e6('0x12')](this));ami['on'](_0x32e6('0x19'),this[_0x32e6('0x1a')][_0x32e6('0x12')](this));ami['on'](_0x32e6('0x1b'),this[_0x32e6('0x1c')][_0x32e6('0x12')](this));ami['on'](_0x32e6('0x1d'),this[_0x32e6('0x1e')][_0x32e6('0x12')](this));ami['on'](_0x32e6('0x1f'),this['syncAttendedTransfer'][_0x32e6('0x12')](this));ami['on'](_0x32e6('0x20'),this[_0x32e6('0x21')][_0x32e6('0x12')](this));}VoiceAgentReport[_0x32e6('0x22')][_0x32e6('0x23')]=function(_0x491369,_0x119be9,_0x347a37){io['to'](_0x491369)[_0x32e6('0x23')](_0x119be9,_0x347a37);};VoiceAgentReport[_0x32e6('0x22')][_0x32e6('0x24')]=function(_0x35db79){return _0x35db79!==null&&!_[_0x32e6('0x25')](_0x35db79);};VoiceAgentReport[_0x32e6('0x22')][_0x32e6('0x11')]=function(_0x4ac106){try{if(this[_0x32e6('0x24')](_0x4ac106)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x4ac106['uniqueid'],_0x4ac106['membername'],_0x4ac106[_0x32e6('0x26')]);logger[_0x32e6('0x27')](_0x32e6('0x28'),_0x4ac106[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x4ac106,{'showHidden':![],'depth':null}));if(_[_0x32e6('0x25')](this[_0x32e6('0xb')][_0x4ac106[_0x32e6('0x29')]])){this[_0x32e6('0xb')][_0x4ac106[_0x32e6('0x29')]]={};}if(_[_0x32e6('0x25')](this[_0x32e6('0xb')][_0x4ac106[_0x32e6('0x29')]][_0x4ac106[_0x32e6('0x26')]])){this['channels'][_0x4ac106[_0x32e6('0x29')]][_0x4ac106[_0x32e6('0x26')]]={'agentcalledAt':moment()[_0x32e6('0x2b')](_0x32e6('0x2c')),'lastevent':_0x32e6('0x2d'),'mandatoryDisposition':this[_0x32e6('0xd')][_0x4ac106[_0x32e6('0x2e')]]?this['voiceQueues'][_0x4ac106[_0x32e6('0x2e')]][_0x32e6('0x2f')]||![]:![],'type':this[_0x32e6('0xd')][_0x4ac106[_0x32e6('0x2e')]]?this[_0x32e6('0xd')][_0x4ac106['queue']][_0x32e6('0x30')]||_0x32e6('0x31'):_0x32e6('0x31'),'variables':this['variables'][_0x4ac106['uniqueid']],'motionChannel':_0x32e6('0x32')};}_[_0x32e6('0x33')](this[_0x32e6('0xb')][_0x4ac106[_0x32e6('0x29')]][_0x4ac106['destuniqueid']],_[_0x32e6('0x34')](_0x4ac106,[_0x32e6('0x35'),_0x32e6('0x36')]));logger[_0x32e6('0x27')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x4ac106[_0x32e6('0x29')],util['inspect'](this[_0x32e6('0xb')][_0x4ac106['uniqueid']][_0x4ac106[_0x32e6('0x26')]],{'showHidden':![],'depth':null}));ami[_0x32e6('0x23')](_0x32e6('0x37'),this['channels'][_0x4ac106[_0x32e6('0x29')]][_0x4ac106[_0x32e6('0x26')]]);logger[_0x32e6('0x27')](_0x32e6('0x38'),_0x4ac106[_0x32e6('0x29')],util['inspect'](this['channels'][_0x4ac106['uniqueid']][_0x4ac106['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x32e6('0x23')](util[_0x32e6('0x2b')](_0x32e6('0x39'),_0x4ac106[_0x32e6('0x3a')]),'user:called',this[_0x32e6('0xb')][_0x4ac106['uniqueid']][_0x4ac106[_0x32e6('0x26')]]);}}catch(_0x184479){logger[_0x32e6('0x3b')]('[%s][voiceAgentReport][agentcalled]',_0x4ac106[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x184479,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32e6('0x22')][_0x32e6('0x3c')]=function(_0x388b2f){try{if(this[_0x32e6('0x24')](_0x388b2f)){if(this['channels'][_0x388b2f[_0x32e6('0x29')]]){logger[_0x32e6('0x27')](_0x32e6('0x3d'),_0x388b2f[_0x32e6('0x29')],util['inspect'](_0x388b2f,{'showHidden':![],'depth':null}));for(var _0x579c4c in this['channels'][_0x388b2f['uniqueid']]){if(this['channels'][_0x388b2f[_0x32e6('0x29')]]['hasOwnProperty'](_0x579c4c)){if(_0x388b2f[_0x32e6('0x26')]===_0x579c4c){logger[_0x32e6('0x3e')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x388b2f['uniqueid'],_0x388b2f['membername'],_0x388b2f[_0x32e6('0x26')]);this['channels'][_0x388b2f[_0x32e6('0x29')]][_0x579c4c]['agentconnectAt']=moment()[_0x32e6('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x3f')]=_0x388b2f['connectedlinename'];this[_0x32e6('0xb')][_0x388b2f['uniqueid']][_0x579c4c]['connectedlinenum']=_0x388b2f['connectedlinenum'];this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x40')]=_0x388b2f[_0x32e6('0x40')];this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x41')]=_0x388b2f['destchannelstatedesc'];this['channels'][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x42')]=_0x388b2f[_0x32e6('0x42')];this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x43')]='connect';if(this[_0x32e6('0xc')][this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x29')]]){var _0x261f6b=this['voiceChannels'][this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x29')]]['routealias'];this['channels'][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x44')]=_0x261f6b;_0x388b2f[_0x32e6('0x44')]=_0x261f6b;}_[_0x32e6('0x33')](this['agents'][_0x388b2f[_0x32e6('0x45')]],_[_0x32e6('0x46')](_0x388b2f,[_0x32e6('0x2e'),_0x32e6('0x47'),'routealias']));logger[_0x32e6('0x27')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x388b2f[_0x32e6('0x29')],util[_0x32e6('0x2a')](this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x388b2f[_0x32e6('0x26')]],{'showHidden':![],'depth':null}));ami['emit'](_0x32e6('0x48'),this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x388b2f['destuniqueid']]);logger[_0x32e6('0x27')](_0x32e6('0x49'),_0x388b2f[_0x32e6('0x29')],util[_0x32e6('0x2a')](this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x388b2f[_0x32e6('0x26')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x32e6('0x2b')](_0x32e6('0x39'),_0x388b2f['membername']),_0x32e6('0x4a'),this[_0x32e6('0xb')][_0x388b2f['uniqueid']][_0x388b2f['destuniqueid']]);}else if(!this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x14')]&&!this[_0x32e6('0xb')][_0x388b2f['uniqueid']][_0x579c4c][_0x32e6('0x4b')]){logger[_0x32e6('0x3e')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x388b2f[_0x32e6('0x29')],this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x3a')],_0x579c4c);this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x14')]=!![];this['channels'][_0x388b2f['uniqueid']][_0x579c4c][_0x32e6('0x4c')]=moment()['format'](_0x32e6('0x2c'));this[_0x32e6('0xb')][_0x388b2f['uniqueid']][_0x579c4c][_0x32e6('0x4d')]=_0x388b2f['destuniqueid'];this['channels'][_0x388b2f[_0x32e6('0x29')]][_0x579c4c]['answeredelsewheremembername']=_0x388b2f[_0x32e6('0x3a')];this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c][_0x32e6('0x43')]=_0x32e6('0x4e');this[_0x32e6('0xb')][_0x388b2f['uniqueid']][_0x579c4c][_0x32e6('0x4f')]=_0x32e6('0x4e');logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x388b2f[_0x32e6('0x29')],util['inspect'](this[_0x32e6('0xb')][_0x388b2f[_0x32e6('0x29')]][_0x579c4c],{'showHidden':![],'depth':null}));ami[_0x32e6('0x23')]('custom:agentansweredelsewhere',this['channels'][_0x388b2f[_0x32e6('0x29')]][_0x579c4c]);}}}}}}catch(_0x2572e4){logger['error']('[%s][voiceAgentReport][agentconnect]',_0x388b2f[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x2572e4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32e6('0x22')]['syncAgentRingNoAnswer']=function(_0x1fc91b){try{if(this[_0x32e6('0x24')](_0x1fc91b)){logger[_0x32e6('0x27')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x1fc91b[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x1fc91b,{'showHidden':![],'depth':null}));if(this['channels'][_0x1fc91b[_0x32e6('0x29')]]&&this[_0x32e6('0xb')][_0x1fc91b[_0x32e6('0x29')]][_0x1fc91b[_0x32e6('0x26')]]){logger[_0x32e6('0x3e')](_0x32e6('0x50'),_0x1fc91b[_0x32e6('0x29')],_0x1fc91b[_0x32e6('0x3a')],_0x1fc91b['destuniqueid']);this[_0x32e6('0xb')][_0x1fc91b[_0x32e6('0x29')]][_0x1fc91b['destuniqueid']][_0x32e6('0x14')]=!![];this['channels'][_0x1fc91b[_0x32e6('0x29')]][_0x1fc91b[_0x32e6('0x26')]][_0x32e6('0x4c')]=moment()[_0x32e6('0x2b')](_0x32e6('0x2c'));this[_0x32e6('0xb')][_0x1fc91b[_0x32e6('0x29')]][_0x1fc91b['destuniqueid']][_0x32e6('0x43')]=_0x32e6('0x51');this['channels'][_0x1fc91b['uniqueid']][_0x1fc91b[_0x32e6('0x26')]][_0x32e6('0x4f')]=_0x32e6('0x51');logger['debug'](_0x32e6('0x52'),_0x1fc91b[_0x32e6('0x29')],util['inspect'](this['channels'][_0x1fc91b[_0x32e6('0x29')]][_0x1fc91b[_0x32e6('0x26')]],{'showHidden':![],'depth':null}));ami[_0x32e6('0x23')](_0x32e6('0x53'),this[_0x32e6('0xb')][_0x1fc91b[_0x32e6('0x29')]][_0x1fc91b[_0x32e6('0x26')]]);}}}catch(_0x4b77bf){logger[_0x32e6('0x3b')](_0x32e6('0x54'),_0x1fc91b[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x4b77bf,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x32e6('0x55')]=function(_0x386d3f){try{if(this[_0x32e6('0x24')](_0x386d3f)){logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x386d3f[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x386d3f,{'showHidden':![],'depth':null}));if(this[_0x32e6('0xb')][_0x386d3f[_0x32e6('0x29')]]){for(var _0xf9c2e8 in this[_0x32e6('0xb')][_0x386d3f['uniqueid']]){if(this['channels'][_0x386d3f['uniqueid']][_0x32e6('0x56')](_0xf9c2e8)&&!this[_0x32e6('0xb')][_0x386d3f['uniqueid']][_0xf9c2e8][_0x32e6('0x14')]&&!this[_0x32e6('0xb')][_0x386d3f[_0x32e6('0x29')]][_0xf9c2e8][_0x32e6('0x4b')]){logger[_0x32e6('0x3e')](_0x32e6('0x57'),_0x386d3f[_0x32e6('0x29')],this['channels'][_0x386d3f[_0x32e6('0x29')]][_0xf9c2e8]['membername'],_0xf9c2e8);this[_0x32e6('0xb')][_0x386d3f[_0x32e6('0x29')]][_0xf9c2e8][_0x32e6('0x14')]=!![];this[_0x32e6('0xb')][_0x386d3f[_0x32e6('0x29')]][_0xf9c2e8][_0x32e6('0x4c')]=moment()[_0x32e6('0x2b')](_0x32e6('0x2c'));this[_0x32e6('0xb')][_0x386d3f[_0x32e6('0x29')]][_0xf9c2e8]['lastevent']=_0x32e6('0x58');this[_0x32e6('0xb')][_0x386d3f[_0x32e6('0x29')]][_0xf9c2e8][_0x32e6('0x4f')]='abandoned';logger[_0x32e6('0x27')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x386d3f['uniqueid'],util['inspect'](this[_0x32e6('0xb')][_0x386d3f['uniqueid']][_0xf9c2e8],{'showHidden':![],'depth':null}));ami[_0x32e6('0x23')](_0x32e6('0x59'),this[_0x32e6('0xb')][_0x386d3f[_0x32e6('0x29')]][_0xf9c2e8]);}}}}}catch(_0x12d1c8){logger[_0x32e6('0x3b')](_0x32e6('0x5a'),_0x386d3f[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x12d1c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32e6('0x22')][_0x32e6('0x16')]=function(_0x26db30){try{if(this[_0x32e6('0x24')](_0x26db30)){logger[_0x32e6('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x26db30['uniqueid'],util['inspect'](_0x26db30,{'showHidden':![],'depth':null}));if(this['channels'][_0x26db30['uniqueid']]){for(var _0x4835f3 in this['channels'][_0x26db30[_0x32e6('0x29')]]){if(this[_0x32e6('0xb')][_0x26db30[_0x32e6('0x29')]][_0x32e6('0x56')](_0x4835f3)){if(this[_0x32e6('0xb')][_0x26db30[_0x32e6('0x29')]][_0x4835f3][_0x32e6('0x5b')]&&!this[_0x32e6('0xb')][_0x26db30['uniqueid']][_0x4835f3][_0x32e6('0x4b')]){logger[_0x32e6('0x3e')](_0x32e6('0x5c'),_0x26db30['uniqueid'],this[_0x32e6('0xb')][_0x26db30[_0x32e6('0x29')]][_0x4835f3][_0x32e6('0x3a')],_0x4835f3);this[_0x32e6('0xb')][_0x26db30['uniqueid']][_0x4835f3][_0x32e6('0x4b')]=!![];this['channels'][_0x26db30[_0x32e6('0x29')]][_0x4835f3][_0x32e6('0x5d')]=moment()[_0x32e6('0x2b')](_0x32e6('0x2c'));this['channels'][_0x26db30[_0x32e6('0x29')]][_0x4835f3]['lastevent']='complete';this[_0x32e6('0xb')][_0x26db30[_0x32e6('0x29')]][_0x4835f3][_0x32e6('0x4f')]=_0x26db30['reason']==_0x32e6('0x5e')?'agent':_0x26db30[_0x32e6('0x4f')];this['channels'][_0x26db30[_0x32e6('0x29')]][_0x4835f3][_0x32e6('0x5f')]=_0x26db30['talktime'];if(this[_0x32e6('0xd')][_0x26db30[_0x32e6('0x2e')]]&&this[_0x32e6('0xd')][_0x26db30['queue']]['acw']){this[_0x32e6('0xb')][_0x26db30[_0x32e6('0x29')]][_0x4835f3][_0x32e6('0x60')]=this[_0x32e6('0xd')][_0x26db30[_0x32e6('0x2e')]][_0x32e6('0x61')];this[_0x32e6('0xb')][_0x26db30[_0x32e6('0x29')]][_0x4835f3][_0x32e6('0x62')]=!![];}this[_0x32e6('0xe')][_0x26db30['interface']]=_[_0x32e6('0x34')](this[_0x32e6('0xe')][_0x26db30[_0x32e6('0x45')]],['queue',_0x32e6('0x47')]);logger[_0x32e6('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x26db30[_0x32e6('0x29')],util[_0x32e6('0x2a')](this['channels'][_0x26db30[_0x32e6('0x29')]][_0x4835f3],{'showHidden':![],'depth':null}));ami[_0x32e6('0x23')](_0x32e6('0x63'),this['channels'][_0x26db30[_0x32e6('0x29')]][_0x4835f3]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x26db30[_0x32e6('0x29')],util[_0x32e6('0x2a')](this['channels'][_0x26db30[_0x32e6('0x29')]][_0x4835f3],{'showHidden':![],'depth':null}));this[_0x32e6('0x23')](util['format'](_0x32e6('0x39'),_0x26db30[_0x32e6('0x3a')]),'user:agentcomplete',this['channels'][_0x26db30[_0x32e6('0x29')]][_0x4835f3]);}}}}}}catch(_0x502f4a){logger[_0x32e6('0x3b')]('[%s][voiceAgentReport][agentcomplete]',_0x26db30[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x502f4a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32e6('0x22')][_0x32e6('0x18')]=function(_0x20fe3b){try{if(this['isNotNull'](_0x20fe3b)){logger[_0x32e6('0x27')]('[%s][voiceAgentReport][varset]\x20event:',_0x20fe3b['uniqueid'],util[_0x32e6('0x2a')](_0x20fe3b,{'showHidden':![],'depth':null}));this[_0x32e6('0x64')](_0x20fe3b[_0x32e6('0x29')],_['keys'](_0x20fe3b['variable'])[0x0],_0x20fe3b[_0x32e6('0x65')]);if(this['channels'][_0x20fe3b[_0x32e6('0x29')]]){for(var _0x5cf6d2 in this[_0x32e6('0xb')][_0x20fe3b['uniqueid']]){if(this[_0x32e6('0xb')][_0x20fe3b[_0x32e6('0x29')]]['hasOwnProperty'](_0x5cf6d2)){logger[_0x32e6('0x3e')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x20fe3b[_0x32e6('0x29')],_0x5cf6d2,_['keys'](_0x20fe3b[_0x32e6('0x66')])[0x0],_0x20fe3b[_0x32e6('0x65')]);if(_[_0x32e6('0x25')](this[_0x32e6('0xb')][_0x20fe3b[_0x32e6('0x29')]][_0x5cf6d2]['variables'])){this[_0x32e6('0xb')][_0x20fe3b[_0x32e6('0x29')]][_0x5cf6d2]['variables']={};}this[_0x32e6('0xb')][_0x20fe3b[_0x32e6('0x29')]][_0x5cf6d2][_0x32e6('0xf')]=this[_0x32e6('0xf')][_0x20fe3b['uniqueid']];}}}}}catch(_0x5b042c){logger[_0x32e6('0x3b')]('[%s][voiceAgentReport][varset]',_0x20fe3b[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x5b042c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32e6('0x22')][_0x32e6('0x64')]=function(_0x241e39,_0x4e1f81,_0x36ce06){var _0x2eedd2=[_0x32e6('0x67'),_0x32e6('0x68'),_0x32e6('0x69'),_0x32e6('0x6a'),_0x32e6('0x6b'),_0x32e6('0x6c'),_0x32e6('0x6d'),_0x32e6('0x6e'),_0x32e6('0x6f'),'sipuri','bridgepeer',_0x32e6('0x70'),'membercalls','memberdynamic',_0x32e6('0x71'),'memberlastcall',_0x32e6('0x3a'),_0x32e6('0x72'),_0x32e6('0x73')];if(!_[_0x32e6('0x74')](_0x4e1f81)&&!_[_0x32e6('0x75')](_0x2eedd2,_0x4e1f81)){if(_['isUndefined'](this[_0x32e6('0xf')][_0x241e39])){this[_0x32e6('0xf')][_0x241e39]={};}this[_0x32e6('0xf')][_0x241e39][_0x4e1f81]=_0x36ce06;}};VoiceAgentReport[_0x32e6('0x22')]['syncHangup']=function(_0x2ea477){try{if(this[_0x32e6('0x24')](_0x2ea477)){logger[_0x32e6('0x27')](_0x32e6('0x76'),_0x2ea477[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x2ea477,{'showHidden':![],'depth':null}));if(this[_0x32e6('0xb')][_0x2ea477['uniqueid']]){for(var _0x4a6ba9 in this[_0x32e6('0xb')][_0x2ea477['uniqueid']]){if(this[_0x32e6('0xb')][_0x2ea477[_0x32e6('0x29')]]['hasOwnProperty'](_0x4a6ba9)){if(this['channels'][_0x2ea477[_0x32e6('0x29')]][_0x4a6ba9][_0x32e6('0x4f')]==_0x32e6('0x5e')&&this['channels'][_0x2ea477['uniqueid']][_0x4a6ba9][_0x32e6('0x4b')]){logger[_0x32e6('0x3e')](_0x32e6('0x77'),_0x2ea477[_0x32e6('0x29')],_0x4a6ba9);this[_0x32e6('0xb')][_0x2ea477['uniqueid']][_0x4a6ba9][_0x32e6('0x5d')]=moment()[_0x32e6('0x2b')](_0x32e6('0x2c'));}}}logger[_0x32e6('0x27')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x2ea477[_0x32e6('0x29')],util['inspect'](_[_0x32e6('0x78')](this[_0x32e6('0xb')][_0x2ea477[_0x32e6('0x29')]]),{'showHidden':![],'depth':null}));ami[_0x32e6('0x23')](_0x32e6('0x79'),_['values'](this[_0x32e6('0xb')][_0x2ea477[_0x32e6('0x29')]]));delete this[_0x32e6('0xb')][_0x2ea477[_0x32e6('0x29')]];}if(this[_0x32e6('0xf')][_0x2ea477[_0x32e6('0x29')]]){delete this[_0x32e6('0xf')][_0x2ea477[_0x32e6('0x29')]];}}}catch(_0x164d8d){logger[_0x32e6('0x3b')](_0x32e6('0x7a'),_0x2ea477[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x164d8d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32e6('0x22')]['syncAttendedTransfer']=function(_0x4c16ee){try{if(this['isNotNull'](_0x4c16ee)){logger['debug'](_0x32e6('0x7b'),_0x4c16ee[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x4c16ee,{'showHidden':![],'depth':null}));if(this[_0x32e6('0xb')][_0x4c16ee['transfereeuniqueid']]){for(var _0x25aacf in this[_0x32e6('0xb')][_0x4c16ee[_0x32e6('0x7c')]]){if(this[_0x32e6('0xb')][_0x4c16ee[_0x32e6('0x7c')]][_0x32e6('0x56')](_0x25aacf)){if(_0x4c16ee[_0x32e6('0x7d')]===_0x25aacf){logger[_0x32e6('0x3e')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4c16ee[_0x32e6('0x29')],this['channels'][_0x4c16ee[_0x32e6('0x7c')]][_0x25aacf]['membername'],_0x25aacf);var _0x340bac=moment();this['channels'][_0x4c16ee['transfereeuniqueid']][_0x25aacf]['agentcomplete']=!![];this[_0x32e6('0xb')][_0x4c16ee[_0x32e6('0x7c')]][_0x25aacf][_0x32e6('0x5d')]=moment()[_0x32e6('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x32e6('0xb')][_0x4c16ee['transfereeuniqueid']][_0x25aacf][_0x32e6('0x43')]='complete';this[_0x32e6('0xb')][_0x4c16ee['transfereeuniqueid']][_0x25aacf][_0x32e6('0x4f')]=_0x32e6('0x5e');this[_0x32e6('0xb')][_0x4c16ee[_0x32e6('0x7c')]][_0x25aacf]['talktime']=_0x340bac[_0x32e6('0x7e')](this[_0x32e6('0xb')][_0x4c16ee[_0x32e6('0x7c')]][_0x25aacf][_0x32e6('0x5b')],_0x32e6('0x7f'));}}}}if(this[_0x32e6('0xb')][_0x4c16ee[_0x32e6('0x80')]]){var _0x259629=this[_0x32e6('0xb')][_0x4c16ee[_0x32e6('0x80')]];this[_0x32e6('0xb')][_0x4c16ee[_0x32e6('0x80')]]=this[_0x32e6('0xb')][_0x4c16ee['transfereeuniqueid']];this['channels'][_0x4c16ee[_0x32e6('0x7c')]]=_0x259629;}}}catch(_0x4c97b7){logger[_0x32e6('0x3b')](_0x32e6('0x81'),_0x4c16ee['uniqueid'],util[_0x32e6('0x2a')](_0x4c97b7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x3c71d3){try{if(this[_0x32e6('0x24')](_0x3c71d3)){logger[_0x32e6('0x27')](_0x32e6('0x82'),_0x3c71d3[_0x32e6('0x29')],util['inspect'](_0x3c71d3,{'showHidden':![],'depth':null}));if(this[_0x32e6('0xb')][_0x3c71d3['transfereeuniqueid']]){for(var _0xbc9cab in this['channels'][_0x3c71d3[_0x32e6('0x7c')]]){if(this[_0x32e6('0xb')][_0x3c71d3[_0x32e6('0x7c')]][_0x32e6('0x56')](_0xbc9cab)){if(_0x3c71d3[_0x32e6('0x83')]===_0xbc9cab){logger['info']('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3c71d3[_0x32e6('0x29')],this[_0x32e6('0xb')][_0x3c71d3[_0x32e6('0x7c')]][_0xbc9cab][_0x32e6('0x3a')],_0xbc9cab);var _0x2a697b=moment();this[_0x32e6('0xb')][_0x3c71d3[_0x32e6('0x7c')]][_0xbc9cab][_0x32e6('0x4b')]=!![];this[_0x32e6('0xb')][_0x3c71d3[_0x32e6('0x7c')]][_0xbc9cab]['agentcompleteAt']=_0x2a697b;this[_0x32e6('0xb')][_0x3c71d3['transfereeuniqueid']][_0xbc9cab][_0x32e6('0x43')]='complete';this[_0x32e6('0xb')][_0x3c71d3[_0x32e6('0x7c')]][_0xbc9cab]['reason']=_0x32e6('0x5e');this[_0x32e6('0xb')][_0x3c71d3[_0x32e6('0x7c')]][_0xbc9cab][_0x32e6('0x5f')]=_0x2a697b['diff'](this['channels'][_0x3c71d3[_0x32e6('0x7c')]][_0xbc9cab][_0x32e6('0x5b')],_0x32e6('0x7f'));}}}}}}catch(_0x2d4fe3){logger[_0x32e6('0x3b')]('[%s][voiceAgentReport][blindtransfer]',_0x3c71d3[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x2d4fe3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32e6('0x22')][_0x32e6('0x1c')]=function(_0x2422a0){var _0x1c04a1='';try{if(this['isNotNull'](_0x2422a0)){logger[_0x32e6('0x27')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x2422a0[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x2422a0,{'showHidden':![],'depth':null}));if(_0x2422a0[_0x32e6('0x84')]){_0x1c04a1=_0x2422a0[_0x32e6('0x84')][_0x32e6('0x85')](0x0,_0x2422a0['channel'][_0x32e6('0x86')]('-'));if(this[_0x32e6('0xe')][_0x1c04a1]){logger['info'](_0x32e6('0x87'),_0x2422a0[_0x32e6('0x29')],_0x1c04a1);this[_0x32e6('0xe')][_0x1c04a1][_0x32e6('0x88')]=!![];}}}}catch(_0x10096c){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x2422a0[_0x32e6('0x29')],util[_0x32e6('0x2a')](_0x10096c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x32e6('0x1e')]=function(_0x32a4aa){var _0x1f6f44='';try{if(this[_0x32e6('0x24')](_0x32a4aa)){logger[_0x32e6('0x27')](_0x32e6('0x89'),_0x32a4aa['uniqueid'],util[_0x32e6('0x2a')](_0x32a4aa,{'showHidden':![],'depth':null}));if(_0x32a4aa[_0x32e6('0x84')]){_0x1f6f44=_0x32a4aa['channel'][_0x32e6('0x85')](0x0,_0x32a4aa[_0x32e6('0x84')][_0x32e6('0x86')]('-'));if(this['agents'][_0x1f6f44]){logger[_0x32e6('0x3e')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x32a4aa['uniqueid'],_0x1f6f44);this['agents'][_0x1f6f44][_0x32e6('0x88')]=![];}}}}catch(_0x4e9b9a){logger[_0x32e6('0x3b')](_0x32e6('0x8a'),_0x32a4aa['uniqueid'],util[_0x32e6('0x2a')](_0x4e9b9a,{'showHidden':![],'depth':null}));}};module[_0x32e6('0x8b')]=VoiceAgentReport; \ No newline at end of file +var _0x8ba0=['channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','isNotNull','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','lastevent','connect','routealias','merge','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','bridgepvtcallid','memberinterface','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','ioredis','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x2a1be6,_0x318725){_0x2a1be6=_0x2a1be6-0x0;var _0x41088a=_0x8ba0[_0x2a1be6];return _0x41088a;};'use strict';var _=require(_0x08ba('0x0'));var moment=require(_0x08ba('0x1'));var util=require(_0x08ba('0x2'));var Redis=require(_0x08ba('0x3'));var config=require(_0x08ba('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x08ba('0x5'));config[_0x08ba('0x6')]=_[_0x08ba('0x7')](config[_0x08ba('0x6')],{'host':_0x08ba('0x8'),'port':0x18eb});var io=require(_0x08ba('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x235354){this[_0x08ba('0xa')]={};this[_0x08ba('0xb')]=_0x235354[_0x08ba('0xa')];this[_0x08ba('0xc')]=_0x235354['voiceQueues'];this[_0x08ba('0xd')]=_0x235354['agents'];this[_0x08ba('0xe')]={};ami['on']('agentcalled',this[_0x08ba('0xf')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x11'),this[_0x08ba('0x12')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x13'),this[_0x08ba('0x14')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x15'),this[_0x08ba('0x16')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x17'),this['syncAgentComplete'][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x18'),this[_0x08ba('0x19')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x1a'),this[_0x08ba('0x1b')]['bind'](this));ami['on'](_0x08ba('0x1c'),this[_0x08ba('0x1d')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x1e'),this[_0x08ba('0x1f')]['bind'](this));ami['on'](_0x08ba('0x20'),this[_0x08ba('0x21')]['bind'](this));ami['on'](_0x08ba('0x22'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x24')]=function(_0xa66aeb,_0x6388ba,_0x6a9cc6){io['to'](_0xa66aeb)[_0x08ba('0x24')](_0x6388ba,_0x6a9cc6);};VoiceAgentReport[_0x08ba('0x23')]['isNotNull']=function(_0x506fbe){return _0x506fbe!==null&&!_[_0x08ba('0x25')](_0x506fbe);};VoiceAgentReport['prototype'][_0x08ba('0xf')]=function(_0x39fb5e){try{if(this['isNotNull'](_0x39fb5e)){logger[_0x08ba('0x26')](_0x08ba('0x27'),_0x39fb5e[_0x08ba('0x28')],_0x39fb5e[_0x08ba('0x29')],_0x39fb5e[_0x08ba('0x2a')]);logger[_0x08ba('0x2b')](_0x08ba('0x2c'),_0x39fb5e[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x39fb5e,{'showHidden':![],'depth':null}));if(_[_0x08ba('0x25')](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]])){this['channels'][_0x39fb5e[_0x08ba('0x28')]]={};}if(_[_0x08ba('0x25')](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e[_0x08ba('0x2a')]])){this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e['destuniqueid']]={'agentcalledAt':moment()[_0x08ba('0x2e')](_0x08ba('0x2f')),'lastevent':_0x08ba('0x30'),'mandatoryDisposition':this['voiceQueues'][_0x39fb5e['queue']]?this['voiceQueues'][_0x39fb5e[_0x08ba('0x31')]][_0x08ba('0x32')]||![]:![],'type':this[_0x08ba('0xc')][_0x39fb5e[_0x08ba('0x31')]]?this[_0x08ba('0xc')][_0x39fb5e['queue']][_0x08ba('0x33')]||'inbound':_0x08ba('0x34'),'variables':this[_0x08ba('0xe')][_0x39fb5e['uniqueid']],'motionChannel':'voice'};}_['merge'](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e[_0x08ba('0x2a')]],_[_0x08ba('0x35')](_0x39fb5e,['event',_0x08ba('0x36')]));logger[_0x08ba('0x2b')](_0x08ba('0x37'),_0x39fb5e[_0x08ba('0x28')],util['inspect'](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e[_0x08ba('0x2a')]],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x38'),this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e[_0x08ba('0x2a')]]);logger['debug'](_0x08ba('0x39'),_0x39fb5e[_0x08ba('0x28')],util[_0x08ba('0x2d')](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x08ba('0x24')](util[_0x08ba('0x2e')](_0x08ba('0x3a'),_0x39fb5e[_0x08ba('0x29')]),_0x08ba('0x3b'),this['channels'][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e['destuniqueid']]);}}catch(_0x12dc0e){logger['error'](_0x08ba('0x3c'),_0x39fb5e[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x12dc0e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x12')]=function(_0x257d25){try{if(this[_0x08ba('0x3d')](_0x257d25)){if(this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]]){logger[_0x08ba('0x2b')](_0x08ba('0x3e'),_0x257d25[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x257d25,{'showHidden':![],'depth':null}));for(var _0x268d30 in this['channels'][_0x257d25[_0x08ba('0x28')]]){if(this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x08ba('0x3f')](_0x268d30)){if(_0x257d25[_0x08ba('0x2a')]===_0x268d30){logger[_0x08ba('0x26')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x257d25['uniqueid'],_0x257d25[_0x08ba('0x29')],_0x257d25['destuniqueid']);this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x40')]=moment()['format'](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30]['connectedlinename']=_0x257d25[_0x08ba('0x41')];this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x42')]=_0x257d25[_0x08ba('0x42')];this['channels'][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x43')]=_0x257d25[_0x08ba('0x43')];this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30]['destchannelstatedesc']=_0x257d25[_0x08ba('0x44')];this['channels'][_0x257d25[_0x08ba('0x28')]][_0x268d30]['holdtime']=_0x257d25['holdtime'];this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x45')]=_0x08ba('0x46');if(this[_0x08ba('0xb')][this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30]['uniqueid']]){var _0x4e1caa=this[_0x08ba('0xb')][this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30]['uniqueid']][_0x08ba('0x47')];this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x47')]=_0x4e1caa;_0x257d25[_0x08ba('0x47')]=_0x4e1caa;}_[_0x08ba('0x48')](this[_0x08ba('0xd')][_0x257d25[_0x08ba('0x49')]],_[_0x08ba('0x4a')](_0x257d25,['queue',_0x08ba('0x4b'),_0x08ba('0x47')]));logger['debug'](_0x08ba('0x4c'),_0x257d25[_0x08ba('0x28')],util[_0x08ba('0x2d')](this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x257d25['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x4d'),this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x257d25[_0x08ba('0x2a')]]);logger[_0x08ba('0x2b')](_0x08ba('0x4e'),_0x257d25['uniqueid'],util[_0x08ba('0x2d')](this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x257d25['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x08ba('0x24')](util[_0x08ba('0x2e')](_0x08ba('0x3a'),_0x257d25['membername']),_0x08ba('0x4f'),this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x257d25[_0x08ba('0x2a')]]);}else if(!this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x13')]&&!this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x17')]){logger[_0x08ba('0x26')](_0x08ba('0x50'),_0x257d25[_0x08ba('0x28')],this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x29')],_0x268d30);this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x13')]=!![];this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x51')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x52')]=_0x257d25[_0x08ba('0x2a')];this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x53')]=_0x257d25[_0x08ba('0x29')];this['channels'][_0x257d25['uniqueid']][_0x268d30]['lastevent']=_0x08ba('0x54');this['channels'][_0x257d25[_0x08ba('0x28')]][_0x268d30]['reason']=_0x08ba('0x54');logger[_0x08ba('0x2b')](_0x08ba('0x55'),_0x257d25['uniqueid'],util[_0x08ba('0x2d')](this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x56'),this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30]);}}}}}}catch(_0x4d5ce6){logger[_0x08ba('0x57')]('[%s][voiceAgentReport][agentconnect]',_0x257d25[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x4d5ce6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x08ba('0x14')]=function(_0x4aac7f){try{if(this[_0x08ba('0x3d')](_0x4aac7f)){logger['debug'](_0x08ba('0x58'),_0x4aac7f['uniqueid'],util[_0x08ba('0x2d')](_0x4aac7f,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x4aac7f['uniqueid']]&&this[_0x08ba('0xa')][_0x4aac7f['uniqueid']][_0x4aac7f[_0x08ba('0x2a')]]){logger['info'](_0x08ba('0x59'),_0x4aac7f['uniqueid'],_0x4aac7f[_0x08ba('0x29')],_0x4aac7f['destuniqueid']);this[_0x08ba('0xa')][_0x4aac7f['uniqueid']][_0x4aac7f[_0x08ba('0x2a')]][_0x08ba('0x13')]=!![];this[_0x08ba('0xa')][_0x4aac7f['uniqueid']][_0x4aac7f['destuniqueid']]['agentringnoanswerAt']=moment()['format'](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x4aac7f[_0x08ba('0x28')]][_0x4aac7f[_0x08ba('0x2a')]]['lastevent']=_0x08ba('0x5a');this[_0x08ba('0xa')][_0x4aac7f[_0x08ba('0x28')]][_0x4aac7f['destuniqueid']][_0x08ba('0x5b')]=_0x08ba('0x5a');logger[_0x08ba('0x2b')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x4aac7f[_0x08ba('0x28')],util[_0x08ba('0x2d')](this['channels'][_0x4aac7f['uniqueid']][_0x4aac7f[_0x08ba('0x2a')]],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x5c'),this[_0x08ba('0xa')][_0x4aac7f[_0x08ba('0x28')]][_0x4aac7f[_0x08ba('0x2a')]]);}}}catch(_0x40c3cc){logger['error'](_0x08ba('0x5d'),_0x4aac7f[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x40c3cc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x16')]=function(_0x1e6f80){try{if(this[_0x08ba('0x3d')](_0x1e6f80)){logger[_0x08ba('0x2b')](_0x08ba('0x5e'),_0x1e6f80[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x1e6f80,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]]){for(var _0x2ec04f in this[_0x08ba('0xa')][_0x1e6f80['uniqueid']]){if(this['channels'][_0x1e6f80['uniqueid']][_0x08ba('0x3f')](_0x2ec04f)&&!this['channels'][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f][_0x08ba('0x13')]&&!this[_0x08ba('0xa')][_0x1e6f80['uniqueid']][_0x2ec04f]['agentcomplete']){logger[_0x08ba('0x26')](_0x08ba('0x5f'),_0x1e6f80['uniqueid'],this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f][_0x08ba('0x29')],_0x2ec04f);this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f][_0x08ba('0x13')]=!![];this['channels'][_0x1e6f80['uniqueid']][_0x2ec04f][_0x08ba('0x51')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f][_0x08ba('0x45')]='abandoned';this['channels'][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f]['reason']=_0x08ba('0x60');logger[_0x08ba('0x2b')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x1e6f80[_0x08ba('0x28')],util['inspect'](this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x61'),this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f]);}}}}}catch(_0x3892c9){logger[_0x08ba('0x57')](_0x08ba('0x62'),_0x1e6f80['uniqueid'],util[_0x08ba('0x2d')](_0x3892c9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x63')]=function(_0x3a405d){try{if(this[_0x08ba('0x3d')](_0x3a405d)){logger[_0x08ba('0x2b')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x3a405d[_0x08ba('0x28')],util['inspect'](_0x3a405d,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]]){for(var _0x48ba10 in this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]]){if(this['channels'][_0x3a405d[_0x08ba('0x28')]]['hasOwnProperty'](_0x48ba10)){if(this['channels'][_0x3a405d['uniqueid']][_0x48ba10][_0x08ba('0x40')]&&!this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10][_0x08ba('0x17')]){logger[_0x08ba('0x26')](_0x08ba('0x64'),_0x3a405d['uniqueid'],this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10][_0x08ba('0x29')],_0x48ba10);this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]][_0x48ba10][_0x08ba('0x17')]=!![];this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]][_0x48ba10][_0x08ba('0x65')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10]['lastevent']=_0x08ba('0x66');this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]][_0x48ba10][_0x08ba('0x5b')]=_0x3a405d[_0x08ba('0x5b')]==_0x08ba('0x67')?_0x08ba('0x68'):_0x3a405d['reason'];this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10]['talktime']=_0x3a405d[_0x08ba('0x69')];if(this[_0x08ba('0xc')][_0x3a405d[_0x08ba('0x31')]]&&this[_0x08ba('0xc')][_0x3a405d['queue']]['acw']){this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10][_0x08ba('0x6a')]=this[_0x08ba('0xc')][_0x3a405d[_0x08ba('0x31')]][_0x08ba('0x6b')];this['channels'][_0x3a405d[_0x08ba('0x28')]][_0x48ba10]['agentacw']=!![];}this['agents'][_0x3a405d['interface']]=_[_0x08ba('0x35')](this[_0x08ba('0xd')][_0x3a405d['interface']],[_0x08ba('0x31'),'destconnectedlinenum']);logger[_0x08ba('0x2b')](_0x08ba('0x6c'),_0x3a405d[_0x08ba('0x28')],util[_0x08ba('0x2d')](this['channels'][_0x3a405d[_0x08ba('0x28')]][_0x48ba10],{'showHidden':![],'depth':null}));ami['emit'](_0x08ba('0x6d'),this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]][_0x48ba10]);logger[_0x08ba('0x2b')](_0x08ba('0x6e'),_0x3a405d[_0x08ba('0x28')],util[_0x08ba('0x2d')](this['channels'][_0x3a405d[_0x08ba('0x28')]][_0x48ba10],{'showHidden':![],'depth':null}));this[_0x08ba('0x24')](util[_0x08ba('0x2e')](_0x08ba('0x3a'),_0x3a405d[_0x08ba('0x29')]),_0x08ba('0x6f'),this['channels'][_0x3a405d['uniqueid']][_0x48ba10]);}}}}}}catch(_0xbb897b){logger[_0x08ba('0x57')]('[%s][voiceAgentReport][agentcomplete]',_0x3a405d['uniqueid'],util[_0x08ba('0x2d')](_0xbb897b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x19')]=function(_0x2c19d9){try{if(this[_0x08ba('0x3d')](_0x2c19d9)){logger[_0x08ba('0x2b')](_0x08ba('0x70'),_0x2c19d9[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x2c19d9,{'showHidden':![],'depth':null}));this[_0x08ba('0x71')](_0x2c19d9[_0x08ba('0x28')],_[_0x08ba('0x72')](_0x2c19d9[_0x08ba('0x73')])[0x0],_0x2c19d9[_0x08ba('0x74')]);if(this[_0x08ba('0xa')][_0x2c19d9['uniqueid']]){for(var _0x34e7a7 in this[_0x08ba('0xa')][_0x2c19d9[_0x08ba('0x28')]]){if(this[_0x08ba('0xa')][_0x2c19d9[_0x08ba('0x28')]]['hasOwnProperty'](_0x34e7a7)){logger[_0x08ba('0x26')](_0x08ba('0x75'),_0x2c19d9['uniqueid'],_0x34e7a7,_[_0x08ba('0x72')](_0x2c19d9['variable'])[0x0],_0x2c19d9[_0x08ba('0x74')]);if(_[_0x08ba('0x25')](this[_0x08ba('0xa')][_0x2c19d9[_0x08ba('0x28')]][_0x34e7a7][_0x08ba('0xe')])){this['channels'][_0x2c19d9[_0x08ba('0x28')]][_0x34e7a7][_0x08ba('0xe')]={};}this['channels'][_0x2c19d9[_0x08ba('0x28')]][_0x34e7a7][_0x08ba('0xe')]=this['variables'][_0x2c19d9[_0x08ba('0x28')]];}}}}}catch(_0x376807){logger['error'](_0x08ba('0x76'),_0x2c19d9['uniqueid'],util[_0x08ba('0x2d')](_0x376807,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')]['addVariable']=function(_0x524a42,_0x39cc8c,_0x25e5db){var _0x15ae05=[_0x08ba('0x77'),_0x08ba('0x78'),_0x08ba('0x79'),'rtpaudioqosjitterbridged',_0x08ba('0x7a'),'rtpaudioqoslossbridged',_0x08ba('0x7b'),'rtpaudioqosrttbridged',_0x08ba('0x7c'),'sipuri','bridgepeer',_0x08ba('0x7d'),'membercalls','memberdynamic',_0x08ba('0x7e'),'memberlastcall',_0x08ba('0x29'),'memberpenalty',_0x08ba('0x7f')];if(!_[_0x08ba('0x80')](_0x39cc8c)&&!_[_0x08ba('0x81')](_0x15ae05,_0x39cc8c)){if(_[_0x08ba('0x25')](this['variables'][_0x524a42])){this['variables'][_0x524a42]={};}this[_0x08ba('0xe')][_0x524a42][_0x39cc8c]=_0x25e5db;}};VoiceAgentReport[_0x08ba('0x23')]['syncHangup']=function(_0x9861f2){try{if(this[_0x08ba('0x3d')](_0x9861f2)){logger[_0x08ba('0x2b')](_0x08ba('0x82'),_0x9861f2[_0x08ba('0x28')],util['inspect'](_0x9861f2,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]]){for(var _0x5626c1 in this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]]){if(this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]][_0x08ba('0x3f')](_0x5626c1)){if(this[_0x08ba('0xa')][_0x9861f2['uniqueid']][_0x5626c1]['reason']==_0x08ba('0x67')&&this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]][_0x5626c1][_0x08ba('0x17')]){logger[_0x08ba('0x26')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x9861f2[_0x08ba('0x28')],_0x5626c1);this[_0x08ba('0xa')][_0x9861f2['uniqueid']][_0x5626c1][_0x08ba('0x65')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));}}}logger[_0x08ba('0x2b')](_0x08ba('0x83'),_0x9861f2['uniqueid'],util[_0x08ba('0x2d')](_['values'](this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]]),{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x84'),_[_0x08ba('0x85')](this['channels'][_0x9861f2['uniqueid']]));delete this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]];}if(this[_0x08ba('0xe')][_0x9861f2['uniqueid']]){delete this[_0x08ba('0xe')][_0x9861f2[_0x08ba('0x28')]];}}}catch(_0x427b2b){logger['error']('[%s][voiceAgentReport][hangup]',_0x9861f2[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x427b2b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x08ba('0x21')]=function(_0x51ebf0){try{if(this[_0x08ba('0x3d')](_0x51ebf0)){logger[_0x08ba('0x2b')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x51ebf0[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x51ebf0,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]]){for(var _0x5540bf in this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]]){if(this['channels'][_0x51ebf0[_0x08ba('0x86')]][_0x08ba('0x3f')](_0x5540bf)){if(_0x51ebf0[_0x08ba('0x87')]===_0x5540bf){logger[_0x08ba('0x26')](_0x08ba('0x88'),_0x51ebf0[_0x08ba('0x28')],this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]][_0x5540bf][_0x08ba('0x29')],_0x5540bf);var _0x45b560=moment();this[_0x08ba('0xa')][_0x51ebf0['transfereeuniqueid']][_0x5540bf]['agentcomplete']=!![];this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]][_0x5540bf][_0x08ba('0x65')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]][_0x5540bf][_0x08ba('0x45')]=_0x08ba('0x66');this['channels'][_0x51ebf0['transfereeuniqueid']][_0x5540bf][_0x08ba('0x5b')]=_0x08ba('0x67');this[_0x08ba('0xa')][_0x51ebf0['transfereeuniqueid']][_0x5540bf]['talktime']=_0x45b560[_0x08ba('0x89')](this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]][_0x5540bf]['agentconnectAt'],_0x08ba('0x8a'));}}}}if(this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x8b')]]){var _0x790c62=this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x8b')]];this['channels'][_0x51ebf0[_0x08ba('0x8b')]]=this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]];this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]]=_0x790c62;}}}catch(_0x48d477){logger['error'](_0x08ba('0x8c'),_0x51ebf0[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x48d477,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x08ba('0x8d')]=function(_0x25de87){try{if(this[_0x08ba('0x3d')](_0x25de87)){logger[_0x08ba('0x2b')](_0x08ba('0x8e'),_0x25de87[_0x08ba('0x28')],util['inspect'](_0x25de87,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]]){for(var _0x4f4b54 in this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]]){if(this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]][_0x08ba('0x3f')](_0x4f4b54)){if(_0x25de87[_0x08ba('0x8f')]===_0x4f4b54){logger[_0x08ba('0x26')](_0x08ba('0x90'),_0x25de87[_0x08ba('0x28')],this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]][_0x4f4b54][_0x08ba('0x29')],_0x4f4b54);var _0x104583=moment();this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]][_0x4f4b54]['agentcomplete']=!![];this[_0x08ba('0xa')][_0x25de87['transfereeuniqueid']][_0x4f4b54]['agentcompleteAt']=_0x104583;this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]][_0x4f4b54]['lastevent']=_0x08ba('0x66');this[_0x08ba('0xa')][_0x25de87['transfereeuniqueid']][_0x4f4b54][_0x08ba('0x5b')]=_0x08ba('0x67');this[_0x08ba('0xa')][_0x25de87['transfereeuniqueid']][_0x4f4b54][_0x08ba('0x69')]=_0x104583[_0x08ba('0x89')](this[_0x08ba('0xa')][_0x25de87['transfereeuniqueid']][_0x4f4b54]['agentconnectAt'],_0x08ba('0x8a'));}}}}}}catch(_0x11c57f){logger[_0x08ba('0x57')](_0x08ba('0x91'),_0x25de87[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x11c57f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')]['syncMusicOnHoldStart']=function(_0x5d4c80){var _0x1b0489='';try{if(this[_0x08ba('0x3d')](_0x5d4c80)){logger['debug'](_0x08ba('0x92'),_0x5d4c80[_0x08ba('0x28')],util['inspect'](_0x5d4c80,{'showHidden':![],'depth':null}));if(_0x5d4c80[_0x08ba('0x93')]){_0x1b0489=_0x5d4c80[_0x08ba('0x93')][_0x08ba('0x94')](0x0,_0x5d4c80[_0x08ba('0x93')][_0x08ba('0x95')]('-'));if(this[_0x08ba('0xd')][_0x1b0489]){logger[_0x08ba('0x26')](_0x08ba('0x96'),_0x5d4c80['uniqueid'],_0x1b0489);this[_0x08ba('0xd')][_0x1b0489][_0x08ba('0x97')]=!![];}}}}catch(_0x1ba7df){logger['error'](_0x08ba('0x98'),_0x5d4c80[_0x08ba('0x28')],util['inspect'](_0x1ba7df,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x1f')]=function(_0x98fa71){var _0x3dd6a4='';try{if(this['isNotNull'](_0x98fa71)){logger[_0x08ba('0x2b')](_0x08ba('0x99'),_0x98fa71[_0x08ba('0x28')],util['inspect'](_0x98fa71,{'showHidden':![],'depth':null}));if(_0x98fa71['channel']){_0x3dd6a4=_0x98fa71[_0x08ba('0x93')][_0x08ba('0x94')](0x0,_0x98fa71[_0x08ba('0x93')][_0x08ba('0x95')]('-'));if(this[_0x08ba('0xd')][_0x3dd6a4]){logger[_0x08ba('0x26')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x98fa71[_0x08ba('0x28')],_0x3dd6a4);this[_0x08ba('0xd')][_0x3dd6a4][_0x08ba('0x97')]=![];}}}}catch(_0x2e0a1e){logger[_0x08ba('0x57')](_0x08ba('0x9a'),_0x98fa71['uniqueid'],util[_0x08ba('0x2d')](_0x2e0a1e,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index bf9de5f..8a61ec3 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb731=['transfereeuniqueid','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','some','origtransfererlinkedid','routeid','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','mohstarttime','bluebird','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','newchannel','syncNewChannel','bind','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','isNotNull','prototype','info','uniqueid','calleridname','calleridnum','debug','isUndefined','pick','from-sip','channel','split','destconnectedlinenum','emit','format','user:%s','name','connectedlinenum','error','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','keys','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','linkedid','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','includes','lastapplication','lastdata','cdr(','match','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','replace','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcallid','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','outbound','blindTransfers','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid'];(function(_0x42dde0,_0x4e1560){var _0x529a84=function(_0x328e1b){while(--_0x328e1b){_0x42dde0['push'](_0x42dde0['shift']());}};_0x529a84(++_0x4e1560);}(_0xb731,0x1b6));var _0x1b73=function(_0x40f31d,_0x166318){_0x40f31d=_0x40f31d-0x0;var _0x10d4e4=_0xb731[_0x40f31d];return _0x10d4e4;};'use strict';var BPromise=require(_0x1b73('0x0'));var _=require(_0x1b73('0x1'));var moment=require('moment');var util=require(_0x1b73('0x2'));var path=require('path');var Redis=require(_0x1b73('0x3'));var config=require(_0x1b73('0x4'));var logger=require(_0x1b73('0x5'))(_0x1b73('0x6'));var ami=require(_0x1b73('0x7'));var Channel=require(_0x1b73('0x8'));var RpcSetting=require(_0x1b73('0x9'));var statusDesc=[_0x1b73('0xa'),_0x1b73('0xb'),_0x1b73('0xc'),_0x1b73('0xd'),_0x1b73('0xe'),_0x1b73('0xf'),_0x1b73('0x10'),'ringinuse',_0x1b73('0x11')];var applications=[_0x1b73('0x12'),_0x1b73('0x13'),_0x1b73('0x14'),_0x1b73('0x15'),_0x1b73('0x16'),_0x1b73('0x17')];var dispositions=[_0x1b73('0x18'),_0x1b73('0x19'),_0x1b73('0x19'),_0x1b73('0x18'),_0x1b73('0x18'),_0x1b73('0x18'),_0x1b73('0x1a'),'BUSY','FAILED',_0x1b73('0x19'),_0x1b73('0x19')];var actions={};config['redis']=_['defaults'](config[_0x1b73('0x1b')],{'host':_0x1b73('0x1c'),'port':0x18eb});var io=require(_0x1b73('0x1d'))(new Redis(config[_0x1b73('0x1b')]));function VoiceCallReport(_0x49eac1){this['channels']=_0x49eac1[_0x1b73('0x1e')];this[_0x1b73('0x1f')]=_0x49eac1[_0x1b73('0x1f')];this['blindTransfers']={};ami['on'](_0x1b73('0x20'),this[_0x1b73('0x21')]['bind'](this));ami['on'](_0x1b73('0x22'),this[_0x1b73('0x21')]['bind'](this));ami['on'](_0x1b73('0x23'),this[_0x1b73('0x24')][_0x1b73('0x25')](this));ami['on'](_0x1b73('0x26'),this[_0x1b73('0x27')][_0x1b73('0x25')](this));ami['on'](_0x1b73('0x28'),this[_0x1b73('0x29')][_0x1b73('0x25')](this));ami['on'](_0x1b73('0x2a'),this[_0x1b73('0x2b')]['bind'](this));ami['on'](_0x1b73('0x2c'),this[_0x1b73('0x2d')][_0x1b73('0x25')](this));ami['on']('attendedtransfer',this[_0x1b73('0x2e')][_0x1b73('0x25')](this));ami['on']('blindtransfer',this[_0x1b73('0x2f')][_0x1b73('0x25')](this));ami['on'](_0x1b73('0x30'),this[_0x1b73('0x31')][_0x1b73('0x25')](this));ami['on'](_0x1b73('0x32'),this[_0x1b73('0x33')]['bind'](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x1b73('0x34')]();}catch(_0x503f6f){logger['error'](_0x1b73('0x35'),util[_0x1b73('0x36')](_0x503f6f,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x1b73('0x37')]=function(_0xb46912){return _0xb46912!==null&&!_['isUndefined'](_0xb46912);};VoiceCallReport[_0x1b73('0x38')]['emit']=function(_0x4dced0,_0x2c3c46,_0x2ca14b){io['to'](_0x4dced0)['emit'](_0x2c3c46,_0x2ca14b);};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x2d')]=function(_0x919314){try{if(this['isNotNull'](_0x919314)){logger[_0x1b73('0x39')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x919314[_0x1b73('0x3a')],_0x919314[_0x1b73('0x3b')],_0x919314[_0x1b73('0x3c')]);logger[_0x1b73('0x3d')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x919314['uniqueid'],util['inspect'](_0x919314,{'showHidden':![],'depth':null}));if(_0x919314['uniqueid']===_0x919314['linkedid']){if(!_[_0x1b73('0x3e')](this[_0x1b73('0x1e')][_0x919314['uniqueid']])){_['merge'](this[_0x1b73('0x1e')][_0x919314['uniqueid']],_[_0x1b73('0x3f')](_0x919314,_['keys'](this[_0x1b73('0x1e')][_0x919314['uniqueid']])));}}if(_0x919314['context']===_0x1b73('0x40')){if(this[_0x1b73('0x1f')][_0x919314[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]]){if(_0x919314['exten']=='xcally-motion-preview'){this[_0x1b73('0x1f')][_0x919314[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x43')]=_0x919314['connectedlinenum'];this[_0x1b73('0x44')](util[_0x1b73('0x45')](_0x1b73('0x46'),this[_0x1b73('0x1f')][_0x919314[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x47')]),'user:agentconnect',{'destaccountcode':this[_0x1b73('0x1f')][_0x919314[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x919314[_0x1b73('0x48')]});}}}}}catch(_0x4fd3eb){logger[_0x1b73('0x49')](_0x1b73('0x4a'),_0x919314[_0x1b73('0x3a')],util['inspect'](_0x4fd3eb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x24')]=function(_0xeb885d){try{if(this[_0x1b73('0x37')](_0xeb885d)){logger[_0x1b73('0x3d')](_0x1b73('0x4b'),_0xeb885d[_0x1b73('0x3a')],util['inspect'](_0xeb885d,{'showHidden':![],'depth':null}));if(_0xeb885d[_0x1b73('0x3a')]===_0xeb885d['linkedid']&&_0xeb885d[_0x1b73('0x41')]!=_0x1b73('0x4c')){if(_[_0x1b73('0x3e')](this[_0x1b73('0x1e')][_0xeb885d[_0x1b73('0x3a')]])){logger[_0x1b73('0x39')](_0x1b73('0x4d'),_0xeb885d[_0x1b73('0x3a')],_0xeb885d[_0x1b73('0x4e')],_0xeb885d[_0x1b73('0x4f')]);this[_0x1b73('0x1e')][_0xeb885d[_0x1b73('0x3a')]]=new Channel();this[_0x1b73('0x1e')][_0xeb885d['uniqueid']][_0x1b73('0x50')]=moment()[_0x1b73('0x45')](_0x1b73('0x51'));this[_0x1b73('0x1e')][_0xeb885d[_0x1b73('0x3a')]][_0x1b73('0x52')]=dispositions[_[_0x1b73('0x53')](_0xeb885d[_0x1b73('0x54')])];_[_0x1b73('0x55')](this[_0x1b73('0x1e')][_0xeb885d[_0x1b73('0x3a')]],_[_0x1b73('0x3f')](_0xeb885d,_[_0x1b73('0x56')](this[_0x1b73('0x1e')][_0xeb885d['uniqueid']])));if(_0xeb885d[_0x1b73('0x4e')]==='from-sip'){if(this[_0x1b73('0x1f')][_0xeb885d['channel'][_0x1b73('0x42')]('-')[0x0]]){if(_[_0x1b73('0x3e')](this[_0x1b73('0x1f')][_0xeb885d['channel'][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x43')])){this[_0x1b73('0x1f')][_0xeb885d[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x43')]=_0xeb885d[_0x1b73('0x4f')];logger[_0x1b73('0x3d')](_0x1b73('0x57'),_0xeb885d[_0x1b73('0x3a')],util[_0x1b73('0x36')]({'destaccountcode':this[_0x1b73('0x1f')][_0xeb885d[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x58')],'destconnectedlinenum':_0xeb885d[_0x1b73('0x4f')]},{'showHidden':![],'depth':null}));this[_0x1b73('0x44')](util['format']('user:%s',this[_0x1b73('0x1f')][_0xeb885d[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x47')]),_0x1b73('0x59'),{'destaccountcode':this[_0x1b73('0x1f')][_0xeb885d[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x58')],'destconnectedlinenum':_0xeb885d[_0x1b73('0x4f')]});}}}}}}}catch(_0x3142af){logger[_0x1b73('0x49')](_0x1b73('0x5a'),_0xeb885d[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x3142af,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x21')]=function(_0x1bb7a5){try{if(this[_0x1b73('0x37')](_0x1bb7a5)){logger[_0x1b73('0x3d')](_0x1b73('0x5b'),_0x1bb7a5[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x1bb7a5,{'showHidden':![],'depth':null}));if(_0x1bb7a5[_0x1b73('0x3a')]===_0x1bb7a5[_0x1b73('0x5c')]&&_0x1bb7a5[_0x1b73('0x4f')]!='h'&&_0x1bb7a5['channel']!=_0x1b73('0x4c')){_0x1bb7a5[_0x1b73('0x5d')]=_0x1bb7a5[_0x1b73('0x5d')][_0x1b73('0x5e')]();_0x1bb7a5['applicationdata']=_0x1bb7a5[_0x1b73('0x5f')]&&_0x1bb7a5[_0x1b73('0x5f')][_0x1b73('0x60')](_0x1b73('0x61'))?_0x1bb7a5[_0x1b73('0x5f')]:(_0x1bb7a5[_0x1b73('0x5f')]||_0x1bb7a5[_0x1b73('0x62')])[_0x1b73('0x5e')]();logger['info'](_0x1b73('0x63'),_0x1bb7a5['uniqueid'],_0x1bb7a5[_0x1b73('0x5d')],_0x1bb7a5['applicationdata']);if(_[_0x1b73('0x3e')](this[_0x1b73('0x1e')][_0x1bb7a5[_0x1b73('0x3a')]])){this['channels'][_0x1bb7a5[_0x1b73('0x3a')]]=new Channel();this[_0x1b73('0x1e')][_0x1bb7a5[_0x1b73('0x3a')]][_0x1b73('0x50')]=_0x1bb7a5[_0x1b73('0x64')]?moment()['subtract'](moment['duration'](_0x1bb7a5[_0x1b73('0x64')])[_0x1b73('0x65')](),'seconds')[_0x1b73('0x45')](_0x1b73('0x51')):moment()[_0x1b73('0x45')](_0x1b73('0x51'));this['channels'][_0x1bb7a5[_0x1b73('0x3a')]][_0x1b73('0x52')]=_0x1b73('0x18');}_['merge'](this['channels'][_0x1bb7a5[_0x1b73('0x3a')]],_['pick'](_0x1bb7a5,_[_0x1b73('0x56')](this[_0x1b73('0x1e')][_0x1bb7a5[_0x1b73('0x3a')]])));if(_[_0x1b73('0x66')](applications,_0x1bb7a5[_0x1b73('0x5d')])){this[_0x1b73('0x1e')][_0x1bb7a5[_0x1b73('0x3a')]][_0x1b73('0x67')]=_0x1bb7a5['application'];this[_0x1b73('0x1e')][_0x1bb7a5[_0x1b73('0x3a')]][_0x1b73('0x68')]=_0x1bb7a5[_0x1b73('0x62')];if(_0x1bb7a5[_0x1b73('0x5d')]==='set'&&_[_0x1b73('0x60')](_0x1bb7a5[_0x1b73('0x62')][_0x1b73('0x5e')](),_0x1b73('0x69'))){var _0x3eafdf=_0x1bb7a5['applicationdata'][_0x1b73('0x42')]('=');var _0x2b0258=_0x3eafdf[0x0][_0x1b73('0x5e')]()[_0x1b73('0x6a')](/cdr\((.*)\)/);if(_0x2b0258){this['channels'][_0x1bb7a5[_0x1b73('0x3a')]][_0x2b0258[0x1]]=_0x3eafdf[0x1];}}else if(_0x1bb7a5[_0x1b73('0x5d')]===_0x1b73('0x13')){this[_0x1b73('0x1e')][_0x1bb7a5[_0x1b73('0x3a')]]['queue']=_0x1bb7a5[_0x1b73('0x62')][_0x1b73('0x42')](',')[0x0];}}}}}catch(_0x574fdc){logger[_0x1b73('0x49')]('[%s][voiceCallReport][newexten]',_0x1bb7a5[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x574fdc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x27')]=function(_0x3ee277){try{if(this[_0x1b73('0x37')](_0x3ee277)){logger[_0x1b73('0x39')](_0x1b73('0x6b'),_0x3ee277[_0x1b73('0x3a')],_0x3ee277[_0x1b73('0x5c')],_0x3ee277[_0x1b73('0x3b')],_0x3ee277['calleridnum']);logger['debug'](_0x1b73('0x6c'),_0x3ee277[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x3ee277,{'showHidden':![],'depth':null}));if(_0x3ee277[_0x1b73('0x3a')]!==_0x3ee277[_0x1b73('0x5c')]){if(this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]]){if(_0x3ee277[_0x1b73('0x54')]==='6'){if(!this['channels'][_0x3ee277[_0x1b73('0x5c')]][_0x1b73('0x6d')]){var _0x59768b=moment();this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]][_0x1b73('0x6d')]=!![];this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]][_0x1b73('0x6e')]=_0x59768b[_0x1b73('0x45')](_0x1b73('0x51'));if(this['channels'][_0x3ee277[_0x1b73('0x5c')]][_0x1b73('0x50')]){this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]][_0x1b73('0x6f')]=_0x59768b[_0x1b73('0x70')](this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]]['starttime'],_0x1b73('0x65'));}}this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]]['linkedid']=_0x3ee277[_0x1b73('0x3a')];if(_0x3ee277[_0x1b73('0x3c')]!=='xcally-motion-preview'){this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]]['connectedlinenum']=_0x3ee277[_0x1b73('0x3c')];}this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]][_0x1b73('0x71')]=_0x3ee277['calleridname'];this[_0x1b73('0x1e')][_0x3ee277['linkedid']][_0x1b73('0x72')]=_0x3ee277['channel'];this[_0x1b73('0x1e')][_0x3ee277['linkedid']][_0x1b73('0x52')]=dispositions[_[_0x1b73('0x53')](_0x3ee277['channelstate'])];if(this['agents'][_0x3ee277[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]]){this['channels'][_0x3ee277[_0x1b73('0x5c')]][_0x1b73('0x73')]=this[_0x1b73('0x1f')][_0x3ee277[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]]['id'];this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]][_0x1b73('0x74')]=this[_0x1b73('0x1f')][_0x3ee277[_0x1b73('0x41')]['split']('-')[0x0]][_0x1b73('0x47')];}}}}else{if(this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x3a')]]){if(_0x3ee277['channelstate']==='6'){if(this['agents'][_0x3ee277['channel'][_0x1b73('0x42')]('-')[0x0]]){this['channels'][_0x3ee277[_0x1b73('0x3a')]][_0x1b73('0x73')]=this[_0x1b73('0x1f')][_0x3ee277[_0x1b73('0x41')]['split']('-')[0x0]]['id'];this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x3a')]][_0x1b73('0x74')]=this['agents'][_0x3ee277[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x47')];}}}}if(_0x3ee277['channelstate']==='6'&&_0x3ee277['context']===_0x1b73('0x40')){if(this['agents'][_0x3ee277['channel']['split']('-')[0x0]]){this['agents'][_0x3ee277[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]]['destconnectedlinenum']=_0x3ee277['exten'];var _0x5420f0;if(this['channels'][_0x3ee277[_0x1b73('0x3a')]])_0x5420f0=this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x3a')]][_0x1b73('0x75')];else if(this[_0x1b73('0x1e')][_0x3ee277[_0x1b73('0x5c')]])_0x5420f0=this[_0x1b73('0x1e')][_0x3ee277['linkedid']][_0x1b73('0x75')];logger[_0x1b73('0x3d')](_0x1b73('0x76'),_0x3ee277[_0x1b73('0x3a')],util[_0x1b73('0x36')]({'destaccountcode':this[_0x1b73('0x1f')][_0x3ee277[_0x1b73('0x41')]['split']('-')[0x0]][_0x1b73('0x58')],'destconnectedlinenum':_0x3ee277[_0x1b73('0x4f')],'routealias':_0x5420f0},{'showHidden':![],'depth':null}));this[_0x1b73('0x44')](util[_0x1b73('0x45')](_0x1b73('0x46'),this[_0x1b73('0x1f')][_0x3ee277[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x47')]),'user:agentconnect',{'destaccountcode':this[_0x1b73('0x1f')][_0x3ee277[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x58')],'destconnectedlinenum':_0x3ee277[_0x1b73('0x4f')],'routealias':_0x5420f0});}}}}catch(_0x3d9295){logger[_0x1b73('0x49')](_0x1b73('0x77'),_0x3ee277['uniqueid'],util['inspect'](_0x3d9295,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x78')]=function(_0x5373a8,_0x8c563f){try{if(this[_0x1b73('0x1e')][_0x5373a8]){logger[_0x1b73('0x39')](_0x1b73('0x79'),_0x5373a8,_0x8c563f);this[_0x1b73('0x1e')][_0x5373a8][_0x1b73('0x7a')]=!![];if(_[_0x1b73('0x7b')](_0x8c563f,'.wav49')){_0x8c563f=_0x8c563f[_0x1b73('0x7c')]('.wav49',_0x1b73('0x7d'));}this[_0x1b73('0x1e')][_0x5373a8][_0x1b73('0x7e')]=_0x8c563f;var _0x42b36d=_[_0x1b73('0x7f')](this[_0x1b73('0x1e')][_0x5373a8][_0x1b73('0x80')],{'filename':_0x8c563f});if(_['isNil'](_0x42b36d)){this['channels'][_0x5373a8]['monitors'][_0x1b73('0x81')]({'filename':_0x8c563f,'createdAt':moment()[_0x1b73('0x45')](_0x1b73('0x51')),'mixmonitorid':'','status':_0x1b73('0x82')});}}}catch(_0x950f8c){logger[_0x1b73('0x49')](_0x1b73('0x83'),_0x5373a8,util['inspect'](_0x950f8c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x29')]=function(_0x39fb3b){try{if(this['isNotNull'](_0x39fb3b)){logger[_0x1b73('0x3d')](_0x1b73('0x84'),_0x39fb3b[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x39fb3b,{'showHidden':![],'depth':null}));if(this[_0x1b73('0x1e')][_0x39fb3b[_0x1b73('0x3a')]]&&_0x39fb3b[_0x1b73('0x41')]!=_0x1b73('0x4c')){if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')])){if(this['isNotNull'](_0x39fb3b['variable'][_0x1b73('0x86')])){logger[_0x1b73('0x39')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x39fb3b[_0x1b73('0x3a')],_0x39fb3b[_0x1b73('0x87')]);this[_0x1b73('0x78')](_0x39fb3b[_0x1b73('0x3a')],_0x39fb3b[_0x1b73('0x87')]);}else if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')][_0x1b73('0x88')])){logger[_0x1b73('0x39')](_0x1b73('0x89'),_0x39fb3b['uniqueid'],_0x39fb3b['value']);this['channels'][_0x39fb3b[_0x1b73('0x3a')]][_0x1b73('0x3c')]=_0x39fb3b[_0x1b73('0x87')];}else if(this['isNotNull'](_0x39fb3b[_0x1b73('0x85')][_0x1b73('0x8a')])){logger['info'](_0x1b73('0x8b'),_0x39fb3b[_0x1b73('0x3a')],_0x39fb3b[_0x1b73('0x87')]);this[_0x1b73('0x1e')][_0x39fb3b[_0x1b73('0x3a')]][_0x1b73('0x8c')]=_0x39fb3b[_0x1b73('0x87')];}else if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')][_0x1b73('0x8d')])){logger[_0x1b73('0x39')](_0x1b73('0x8e'),_0x39fb3b[_0x1b73('0x3a')],_0x39fb3b[_0x1b73('0x87')]);this[_0x1b73('0x1e')][_0x39fb3b[_0x1b73('0x3a')]][_0x1b73('0x8f')]=_0x39fb3b[_0x1b73('0x87')];}else if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')][_0x1b73('0x90')])){logger[_0x1b73('0x39')](_0x1b73('0x91'),_0x39fb3b[_0x1b73('0x3a')],_0x39fb3b[_0x1b73('0x87')][_0x1b73('0x42')](',')[0x0]);this[_0x1b73('0x1e')][_0x39fb3b[_0x1b73('0x3a')]][_0x1b73('0x13')]=_0x39fb3b[_0x1b73('0x87')][_0x1b73('0x42')](',')[0x0];}else if(this[_0x1b73('0x37')](_0x39fb3b['variable'][_0x1b73('0x92')])){logger[_0x1b73('0x39')](_0x1b73('0x93'),_0x39fb3b[_0x1b73('0x3a')],_0x39fb3b[_0x1b73('0x87')]);this[_0x1b73('0x1e')][_0x39fb3b['uniqueid']][_0x1b73('0x94')]=_0x39fb3b[_0x1b73('0x87')];}else if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')][_0x1b73('0x95')])){logger[_0x1b73('0x39')](_0x1b73('0x96'),_0x39fb3b[_0x1b73('0x3a')],_0x39fb3b['value']);this['channels'][_0x39fb3b[_0x1b73('0x3a')]]['destination']=_0x39fb3b[_0x1b73('0x87')];}else if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')][_0x1b73('0x97')])){logger[_0x1b73('0x39')](_0x1b73('0x98'),_0x39fb3b[_0x1b73('0x3a')],_0x39fb3b[_0x1b73('0x87')]);this[_0x1b73('0x1e')][_0x39fb3b[_0x1b73('0x3a')]]['calleridpreview']=_0x39fb3b[_0x1b73('0x87')];}else if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')]['xmcs-queue'])){logger[_0x1b73('0x39')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x39fb3b[_0x1b73('0x3a')],_0x39fb3b[_0x1b73('0x87')]);this['channels'][_0x39fb3b[_0x1b73('0x3a')]][_0x1b73('0x13')]=_0x39fb3b['value'];}else if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')]['sipcallid'])){logger[_0x1b73('0x39')](_0x1b73('0x99'),_0x39fb3b['uniqueid'],_0x39fb3b[_0x1b73('0x87')]);this[_0x1b73('0x1e')][_0x39fb3b[_0x1b73('0x3a')]][_0x1b73('0x9a')]=_0x39fb3b['value'];}}}else if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')][_0x1b73('0x86')])){if(_0x39fb3b['value']){var _0x2d16f1=path[_0x1b73('0x9b')](_0x39fb3b['value'])[_0x1b73('0x47')];logger[_0x1b73('0x39')](_0x1b73('0x9c'),_0x2d16f1,_0x39fb3b[_0x1b73('0x87')]);this[_0x1b73('0x78')](_0x2d16f1,_0x39fb3b[_0x1b73('0x87')]);}}else if(this[_0x1b73('0x1e')][_0x39fb3b[_0x1b73('0x5c')]]){if(this[_0x1b73('0x37')](_0x39fb3b[_0x1b73('0x85')])){if(this[_0x1b73('0x37')](_0x39fb3b['variable'][_0x1b73('0x9d')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x39fb3b[_0x1b73('0x5c')],_0x39fb3b[_0x1b73('0x87')]);this[_0x1b73('0x1e')][_0x39fb3b[_0x1b73('0x5c')]]['sipcalllinkedid']=_0x39fb3b[_0x1b73('0x87')];}}}}}catch(_0x291ca1){logger['error']('[%s][voiceCallReport][varset]',_0x39fb3b['uniqueid'],util[_0x1b73('0x36')](_0x291ca1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')]['syncHangup']=function(_0x49c167){try{if(this[_0x1b73('0x37')](_0x49c167)){logger[_0x1b73('0x3d')]('[%s][voiceCallReport][hangup]\x20event:',_0x49c167['uniqueid'],util[_0x1b73('0x36')](_0x49c167,{'showHidden':![],'depth':null}));if(this['channels'][_0x49c167[_0x1b73('0x3a')]]){logger[_0x1b73('0x39')](_0x1b73('0x9e'),_0x49c167[_0x1b73('0x3a')],_0x49c167['cause-txt']);var _0x2674cc=moment();this[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0x9f')]=_0x2674cc[_0x1b73('0x45')](_0x1b73('0x51'));this[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0x64')]=_0x2674cc[_0x1b73('0x70')](this['channels'][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0x50')],_0x1b73('0x65'));if(this[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0x6d')]){this[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0xa0')]=_0x2674cc['diff'](this[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0x6e')],_0x1b73('0x65'));this[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0x6f')]=this[_0x1b73('0x1e')][_0x49c167['uniqueid']]['duration']-this[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0xa0')];}if(_0x49c167[_0x1b73('0x4e')]===_0x1b73('0x40')){if(this[_0x1b73('0x1f')][_0x49c167['channel'][_0x1b73('0x42')]('-')[0x0]]){this[_0x1b73('0x1f')][_0x49c167['channel']['split']('-')[0x0]]=_[_0x1b73('0xa1')](this[_0x1b73('0x1f')][_0x49c167[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]],[_0x1b73('0x43')]);logger[_0x1b73('0x3d')](_0x1b73('0xa2'),_0x49c167[_0x1b73('0x3a')],util[_0x1b73('0x36')]({'id':this[_0x1b73('0x1f')][_0x49c167['channel'][_0x1b73('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0x1b73('0x1f')][_0x49c167[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x58')]},{'showHidden':![],'depth':null}));this[_0x1b73('0x44')](util[_0x1b73('0x45')](_0x1b73('0x46'),this[_0x1b73('0x1f')][_0x49c167[_0x1b73('0x41')][_0x1b73('0x42')]('-')[0x0]][_0x1b73('0x47')]),_0x1b73('0xa3'),{'id':this[_0x1b73('0x1f')][_0x49c167[_0x1b73('0x41')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x1b73('0x1f')][_0x49c167[_0x1b73('0x41')]['split']('-')[0x0]][_0x1b73('0x58')]});}}var _0x384ae6=this;Promise[_0x1b73('0xa4')]()[_0x1b73('0xa5')](function(){var _0x30b795=_0x384ae6['channels'][_0x49c167[_0x1b73('0x3a')]];if(typeof _0x30b795[_0x1b73('0xa6')]==='undefined')return;if(_[_0x1b73('0xa7')](_0x30b795[_0x1b73('0x80')]))return;return RpcSetting[_0x1b73('0xa8')]()[_0x1b73('0xa5')](function(_0x559a34){if(!_0x559a34[_0x1b73('0xa9')])return;return Promise[_0x1b73('0xa4')]()[_0x1b73('0xa5')](function(){return ami[_0x1b73('0xaa')]({'action':_0x1b73('0xab'),'channel':_0x30b795[_0x1b73('0x41')]})['catch'](function(){});})[_0x1b73('0xa5')](function(){return ami['Action']({'action':_0x1b73('0xab'),'channel':_0x30b795[_0x1b73('0x72')]})[_0x1b73('0xac')](function(){})[_0x1b73('0xad')](function(){var _0x23d1d6=_0x384ae6['agents'][_0x30b795[_0x1b73('0x72')][_0x1b73('0x42')]('-')[0x0]];if(!_0x23d1d6)return;io[_0x1b73('0x44')](_0x1b73('0xae'),{'agentId':_0x23d1d6['id'],'uniqueid':_0x30b795['uniqueid']});});});});})[_0x1b73('0xa5')](function(){if(_0x49c167[_0x1b73('0xaf')]===_0x1b73('0xb0')){_0x384ae6['blindTransfers'][_0x49c167[_0x1b73('0x3a')]]=_0x384ae6[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]];}else{if(_0x384ae6['channels'][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0x8f')]===_0x1b73('0xb1')&&_0x384ae6['blindTransfers'][_0x49c167[_0x1b73('0x3a')]]){_0x384ae6[_0x1b73('0x1e')][_0x49c167['uniqueid']][_0x1b73('0x3a')]=[_0x384ae6[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0x5c')],_0x384ae6[_0x1b73('0x1e')][_0x49c167['uniqueid']][_0x1b73('0x5c')]=_0x384ae6[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]][_0x1b73('0x3a')]][0x0];delete _0x384ae6[_0x1b73('0xb2')][_0x49c167['uniqueid']];}}logger[_0x1b73('0x3d')](_0x1b73('0xb3'),_0x49c167['uniqueid'],util[_0x1b73('0x36')](_0x384ae6[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x1b73('0xb4'),_0x384ae6['channels'][_0x49c167['uniqueid']]);delete _0x384ae6[_0x1b73('0x1e')][_0x49c167[_0x1b73('0x3a')]];});}}}catch(_0x29c725){logger[_0x1b73('0x49')]('[%s][voiceCallReport][hangup]',_0x49c167['uniqueid'],util[_0x1b73('0x36')](_0x29c725,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x2e')]=function(_0x5ae6b8){try{if(this[_0x1b73('0x37')](_0x5ae6b8)){logger[_0x1b73('0x39')](_0x1b73('0xb5'),_0x5ae6b8[_0x1b73('0x3a')],_0x5ae6b8['origtransferercalleridnum'],_0x5ae6b8[_0x1b73('0xb6')]);logger[_0x1b73('0x3d')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x5ae6b8[_0x1b73('0x3a')],util['inspect'](_0x5ae6b8,{'showHidden':![],'depth':null}));if(this['channels'][_0x5ae6b8['transfereeuniqueid']]){this[_0x1b73('0x1e')][_0x5ae6b8['transfereeuniqueid']][_0x1b73('0xb7')]=_0x5ae6b8['origtransferercalleridnum'];this[_0x1b73('0x1e')][_0x5ae6b8['transfereeuniqueid']][_0x1b73('0xb8')]=_0x5ae6b8['transfertargetcalleridnum'];if(this[_0x1b73('0x1e')][_0x5ae6b8[_0x1b73('0xb9')]]){var _0x4d7f57=this['channels'][_0x5ae6b8[_0x1b73('0xb9')]];this['channels'][_0x5ae6b8['secondtransfereruniqueid']]=this['channels'][_0x5ae6b8[_0x1b73('0xba')]];this['channels'][_0x5ae6b8[_0x1b73('0xba')]]=_0x4d7f57;}}else if(this[_0x1b73('0x1e')][_0x5ae6b8['transfertargetuniqueid']]){this['channels'][_0x5ae6b8[_0x1b73('0xbb')]][_0x1b73('0xb7')]=_0x5ae6b8[_0x1b73('0xbc')];this['channels'][_0x5ae6b8['transfertargetuniqueid']]['transferconnectedlinenum']=_0x5ae6b8[_0x1b73('0xb6')];if(this['channels'][_0x5ae6b8[_0x1b73('0xbd')]]){var _0x4d7f57=this[_0x1b73('0x1e')][_0x5ae6b8['origtransfereruniqueid']];this[_0x1b73('0x1e')][_0x5ae6b8[_0x1b73('0xbd')]]=this['channels'][_0x5ae6b8[_0x1b73('0xbb')]];this[_0x1b73('0x1e')][_0x5ae6b8[_0x1b73('0xbb')]]=_0x4d7f57;}}if((this[_0x1b73('0x1e')][_0x5ae6b8[_0x1b73('0xbd')]]||this[_0x1b73('0x1e')][_0x5ae6b8['origtransfererlinkedid']])&&this['channels'][_0x5ae6b8[_0x1b73('0xb9')]]){var _0x303186=_[_0x1b73('0xbe')]([this[_0x1b73('0x1e')][_0x5ae6b8[_0x1b73('0xbd')]],this[_0x1b73('0x1e')][_0x5ae6b8[_0x1b73('0xbf')]],this[_0x1b73('0x1e')][_0x5ae6b8['secondtransfereruniqueid']]],function(_0x564011){return _0x564011&&_0x564011[_0x1b73('0x8f')]===_0x1b73('0xb1')&&_0x564011[_0x1b73('0xc0')];});if(_0x303186){if(this[_0x1b73('0x1e')][_0x5ae6b8[_0x1b73('0xbd')]])this['channels'][_0x5ae6b8[_0x1b73('0xbd')]]['transferType']=_0x1b73('0xc1');if(this[_0x1b73('0x1e')][_0x5ae6b8[_0x1b73('0xbf')]])this[_0x1b73('0x1e')][_0x5ae6b8['origtransfererlinkedid']][_0x1b73('0xa6')]=_0x1b73('0xc1');this[_0x1b73('0x1e')][_0x5ae6b8[_0x1b73('0xb9')]][_0x1b73('0xa6')]=_0x1b73('0xc1');}}}}catch(_0x3d28d7){logger[_0x1b73('0x49')]('[%s][voiceCallReport][attendedtransfer]',_0x5ae6b8[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x3d28d7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x2f')]=function(_0x229862){try{if(this[_0x1b73('0x37')](_0x229862)){logger['info'](_0x1b73('0xc2'),_0x229862['uniqueid'],_0x229862['transfereecalleridnum'],_0x229862[_0x1b73('0xc3')]);logger[_0x1b73('0x3d')](_0x1b73('0xc4'),_0x229862[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x229862,{'showHidden':![],'depth':null}));if(this[_0x1b73('0x1e')][_0x229862[_0x1b73('0xba')]]){this[_0x1b73('0x1e')][_0x229862[_0x1b73('0xba')]]['transfercalleridnum']=_0x229862[_0x1b73('0xc5')];this[_0x1b73('0x1e')][_0x229862['transfereeuniqueid']][_0x1b73('0xb8')]=_0x229862[_0x1b73('0xc3')];this[_0x1b73('0x1e')][_0x229862[_0x1b73('0xba')]]['transferType']=_0x1b73('0xc6');this['syncHangup']({'event':_0x1b73('0xb0'),'uniqueid':_0x229862[_0x1b73('0xba')],'context':_0x229862[_0x1b73('0x4e')],'channel':_0x229862[_0x1b73('0xc7')]});}else{this[_0x1b73('0x1e')][_0x229862[_0x1b73('0xc8')]][_0x1b73('0xa6')]=_0x1b73('0xc6');}}}catch(_0x328360){logger[_0x1b73('0x49')](_0x1b73('0xc9'),_0x229862[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x328360,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x31')]=function(_0x2cb285){try{if(this[_0x1b73('0x37')](_0x2cb285)){logger[_0x1b73('0x3d')](_0x1b73('0xca'),_0x2cb285[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x2cb285,{'showHidden':![],'depth':null}));if(this[_0x1b73('0x1e')][_0x2cb285[_0x1b73('0x3a')]]){if(!_[_0x1b73('0xcb')](this[_0x1b73('0x1e')][_0x2cb285['uniqueid']][_0x1b73('0x6e')])){this['channels'][_0x2cb285[_0x1b73('0x3a')]]['mohstarttime']=moment()[_0x1b73('0x45')](_0x1b73('0x51'));logger[_0x1b73('0x39')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x2cb285[_0x1b73('0x3a')],this[_0x1b73('0x1e')][_0x2cb285[_0x1b73('0x3a')]]['mohstarttime']);}}}}catch(_0x32d13c){logger[_0x1b73('0x49')](_0x1b73('0xcc'),_0x2cb285[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x32d13c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1b73('0x38')][_0x1b73('0x33')]=function(_0x4240ce){try{if(this['isNotNull'](_0x4240ce)){logger[_0x1b73('0x3d')](_0x1b73('0xcd'),_0x4240ce[_0x1b73('0x3a')],util['inspect'](_0x4240ce,{'showHidden':![],'depth':null}));if(this[_0x1b73('0x1e')][_0x4240ce[_0x1b73('0x3a')]]){if(!_[_0x1b73('0xcb')](this['channels'][_0x4240ce[_0x1b73('0x3a')]]['mohstarttime'])){this[_0x1b73('0x1e')][_0x4240ce[_0x1b73('0x3a')]][_0x1b73('0xce')]+=moment()['milliseconds'](0x0)[_0x1b73('0x70')](this[_0x1b73('0x1e')][_0x4240ce['uniqueid']][_0x1b73('0xcf')],_0x1b73('0x65'));logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x4240ce['uniqueid'],this[_0x1b73('0x1e')][_0x4240ce[_0x1b73('0x3a')]][_0x1b73('0xce')]);delete this[_0x1b73('0x1e')][_0x4240ce[_0x1b73('0x3a')]][_0x1b73('0xcf')];}}}}catch(_0x2d7a80){logger[_0x1b73('0x49')]('[%s][voiceCallReport][musiconholdstop]',_0x4240ce[_0x1b73('0x3a')],util[_0x1b73('0x36')](_0x2d7a80,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xaa6f=['StopMixMonitor','catch','type','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','outbound','routeid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','BlindTransfer','transfererchannel','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','moment','util','path','ioredis','ami','../ami','../rpc/setting','unknown','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','newstate','syncNewState','varset','hangup','syncHangup','syncNewCallerId','attendedtransfer','blindtransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','user:agentconnect','accountcode','connectedlinenum','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','merge','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','error','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','appdata','CDR(routeAlias)','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','toLowerCase','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','find','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','Action'];(function(_0x1a358c,_0x41c66a){var _0x3a42f3=function(_0x2715e3){while(--_0x2715e3){_0x1a358c['push'](_0x1a358c['shift']());}};_0x3a42f3(++_0x41c66a);}(_0xaa6f,0x1b2));var _0xfaa6=function(_0x1248e1,_0x12239f){_0x1248e1=_0x1248e1-0x0;var _0x121d4=_0xaa6f[_0x1248e1];return _0x121d4;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0xfaa6('0x0'));var util=require(_0xfaa6('0x1'));var path=require(_0xfaa6('0x2'));var Redis=require(_0xfaa6('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xfaa6('0x4'));var ami=require(_0xfaa6('0x5'));var Channel=require('../model/channel');var RpcSetting=require(_0xfaa6('0x6'));var statusDesc=[_0xfaa6('0x7'),'not_inuse','inuse',_0xfaa6('0x8'),_0xfaa6('0x9'),_0xfaa6('0xa'),_0xfaa6('0xb'),_0xfaa6('0xc'),_0xfaa6('0xd')];var applications=[_0xfaa6('0xe'),_0xfaa6('0xf'),_0xfaa6('0x10'),_0xfaa6('0x11'),_0xfaa6('0x12'),_0xfaa6('0x13')];var dispositions=[_0xfaa6('0x14'),_0xfaa6('0x15'),_0xfaa6('0x15'),_0xfaa6('0x14'),_0xfaa6('0x14'),'NO\x20ANSWER',_0xfaa6('0x16'),_0xfaa6('0x17'),_0xfaa6('0x15'),_0xfaa6('0x15'),'FAILED'];var actions={};config['redis']=_['defaults'](config[_0xfaa6('0x18')],{'host':'localhost','port':0x18eb});var io=require(_0xfaa6('0x19'))(new Redis(config[_0xfaa6('0x18')]));function VoiceCallReport(_0x77fa9e){this[_0xfaa6('0x1a')]=_0x77fa9e[_0xfaa6('0x1a')];this[_0xfaa6('0x1b')]=_0x77fa9e['agents'];this[_0xfaa6('0x1c')]={};ami['on'](_0xfaa6('0x1d'),this[_0xfaa6('0x1e')][_0xfaa6('0x1f')](this));ami['on']('newexten',this[_0xfaa6('0x1e')]['bind'](this));ami['on'](_0xfaa6('0x20'),this['syncNewChannel'][_0xfaa6('0x1f')](this));ami['on'](_0xfaa6('0x21'),this[_0xfaa6('0x22')][_0xfaa6('0x1f')](this));ami['on'](_0xfaa6('0x23'),this['syncVarSet']['bind'](this));ami['on'](_0xfaa6('0x24'),this[_0xfaa6('0x25')][_0xfaa6('0x1f')](this));ami['on']('newcallerid',this[_0xfaa6('0x26')]['bind'](this));ami['on'](_0xfaa6('0x27'),this['syncAttendedTransfer'][_0xfaa6('0x1f')](this));ami['on'](_0xfaa6('0x28'),this['syncBlindTransfer']['bind'](this));ami['on'](_0xfaa6('0x29'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xfaa6('0x2a'),this[_0xfaa6('0x2b')][_0xfaa6('0x1f')](this));try{logger[_0xfaa6('0x2c')](_0xfaa6('0x2d'));ami[_0xfaa6('0x2e')]();}catch(_0x2943c9){logger['error'](_0xfaa6('0x2f'),util[_0xfaa6('0x30')](_0x2943c9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x32')]=function(_0x106aa3){return _0x106aa3!==null&&!_[_0xfaa6('0x33')](_0x106aa3);};VoiceCallReport['prototype'][_0xfaa6('0x34')]=function(_0x2c89de,_0x910591,_0x278268){io['to'](_0x2c89de)[_0xfaa6('0x34')](_0x910591,_0x278268);};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x26')]=function(_0x2bab18){try{if(this['isNotNull'](_0x2bab18)){logger['info'](_0xfaa6('0x35'),_0x2bab18[_0xfaa6('0x36')],_0x2bab18[_0xfaa6('0x37')],_0x2bab18[_0xfaa6('0x38')]);logger[_0xfaa6('0x39')](_0xfaa6('0x3a'),_0x2bab18[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x2bab18,{'showHidden':![],'depth':null}));if(_0x2bab18['uniqueid']===_0x2bab18[_0xfaa6('0x3b')]){if(!_[_0xfaa6('0x33')](this[_0xfaa6('0x1a')][_0x2bab18['uniqueid']])){_['merge'](this['channels'][_0x2bab18[_0xfaa6('0x36')]],_[_0xfaa6('0x3c')](_0x2bab18,_[_0xfaa6('0x3d')](this[_0xfaa6('0x1a')][_0x2bab18[_0xfaa6('0x36')]])));}}if(_0x2bab18[_0xfaa6('0x3e')]===_0xfaa6('0x3f')){if(this[_0xfaa6('0x1b')][_0x2bab18[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]){if(_0x2bab18[_0xfaa6('0x42')]==_0xfaa6('0x43')){this[_0xfaa6('0x1b')][_0x2bab18[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x44')]=_0x2bab18['connectedlinenum'];this[_0xfaa6('0x34')](util[_0xfaa6('0x45')](_0xfaa6('0x46'),this[_0xfaa6('0x1b')][_0x2bab18[_0xfaa6('0x40')]['split']('-')[0x0]]['name']),_0xfaa6('0x47'),{'destaccountcode':this['agents'][_0x2bab18[_0xfaa6('0x40')]['split']('-')[0x0]][_0xfaa6('0x48')],'destconnectedlinenum':_0x2bab18[_0xfaa6('0x49')]});}}}}}catch(_0x50b8e8){logger['error']('[%s][voiceCallReport][newcallerid]',_0x2bab18['uniqueid'],util[_0xfaa6('0x30')](_0x50b8e8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0xa2c53a){try{if(this[_0xfaa6('0x32')](_0xa2c53a)){logger[_0xfaa6('0x39')]('[%s][voiceCallReport][newchannel]\x20event:',_0xa2c53a[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0xa2c53a,{'showHidden':![],'depth':null}));if(_0xa2c53a['uniqueid']===_0xa2c53a[_0xfaa6('0x3b')]&&_0xa2c53a[_0xfaa6('0x40')]!=_0xfaa6('0x4a')){if(_[_0xfaa6('0x33')](this[_0xfaa6('0x1a')][_0xa2c53a['uniqueid']])){logger[_0xfaa6('0x2c')](_0xfaa6('0x4b'),_0xa2c53a[_0xfaa6('0x36')],_0xa2c53a['context'],_0xa2c53a[_0xfaa6('0x42')]);this[_0xfaa6('0x1a')][_0xa2c53a[_0xfaa6('0x36')]]=new Channel();this['channels'][_0xa2c53a['uniqueid']][_0xfaa6('0x4c')]=moment()[_0xfaa6('0x45')](_0xfaa6('0x4d'));this['channels'][_0xa2c53a['uniqueid']][_0xfaa6('0x4e')]=dispositions[_['toNumber'](_0xa2c53a[_0xfaa6('0x4f')])];_[_0xfaa6('0x50')](this[_0xfaa6('0x1a')][_0xa2c53a[_0xfaa6('0x36')]],_[_0xfaa6('0x3c')](_0xa2c53a,_['keys'](this[_0xfaa6('0x1a')][_0xa2c53a[_0xfaa6('0x36')]])));if(_0xa2c53a[_0xfaa6('0x3e')]==='from-sip'){if(this['agents'][_0xa2c53a[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]){if(_[_0xfaa6('0x33')](this[_0xfaa6('0x1b')][_0xa2c53a['channel']['split']('-')[0x0]]['destconnectedlinenum'])){this[_0xfaa6('0x1b')][_0xa2c53a[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x44')]=_0xa2c53a[_0xfaa6('0x42')];logger[_0xfaa6('0x39')](_0xfaa6('0x51'),_0xa2c53a['uniqueid'],util[_0xfaa6('0x30')]({'destaccountcode':this[_0xfaa6('0x1b')][_0xa2c53a['channel']['split']('-')[0x0]][_0xfaa6('0x48')],'destconnectedlinenum':_0xa2c53a[_0xfaa6('0x42')]},{'showHidden':![],'depth':null}));this[_0xfaa6('0x34')](util[_0xfaa6('0x45')]('user:%s',this[_0xfaa6('0x1b')][_0xa2c53a[_0xfaa6('0x40')]['split']('-')[0x0]][_0xfaa6('0x52')]),'user:agentconnect',{'destaccountcode':this[_0xfaa6('0x1b')][_0xa2c53a['channel'][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x48')],'destconnectedlinenum':_0xa2c53a[_0xfaa6('0x42')]});}}}}}}}catch(_0x4656e1){logger[_0xfaa6('0x53')](_0xfaa6('0x54'),_0xa2c53a[_0xfaa6('0x36')],util['inspect'](_0x4656e1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x1e')]=function(_0x34e5de){try{if(this[_0xfaa6('0x32')](_0x34e5de)){logger[_0xfaa6('0x39')](_0xfaa6('0x55'),_0x34e5de['uniqueid'],util['inspect'](_0x34e5de,{'showHidden':![],'depth':null}));if(_0x34e5de[_0xfaa6('0x36')]===_0x34e5de[_0xfaa6('0x3b')]&&_0x34e5de[_0xfaa6('0x42')]!='h'&&_0x34e5de['channel']!=_0xfaa6('0x4a')){_0x34e5de[_0xfaa6('0x56')]=_0x34e5de['application']['toLowerCase']();_0x34e5de['applicationdata']=_0x34e5de[_0xfaa6('0x57')]&&_0x34e5de[_0xfaa6('0x57')]['startsWith'](_0xfaa6('0x58'))?_0x34e5de['appdata']:(_0x34e5de['appdata']||_0x34e5de[_0xfaa6('0x59')])['toLowerCase']();logger['info'](_0xfaa6('0x5a'),_0x34e5de['uniqueid'],_0x34e5de[_0xfaa6('0x56')],_0x34e5de[_0xfaa6('0x59')]);if(_[_0xfaa6('0x33')](this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]])){this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]]=new Channel();this['channels'][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0x4c')]=_0x34e5de[_0xfaa6('0x5b')]?moment()[_0xfaa6('0x5c')](moment[_0xfaa6('0x5b')](_0x34e5de[_0xfaa6('0x5b')])[_0xfaa6('0x5d')](),_0xfaa6('0x5d'))[_0xfaa6('0x45')](_0xfaa6('0x4d')):moment()[_0xfaa6('0x45')](_0xfaa6('0x4d'));this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0x4e')]='NO\x20ANSWER';}_[_0xfaa6('0x50')](this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]],_[_0xfaa6('0x3c')](_0x34e5de,_['keys'](this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]])));if(_[_0xfaa6('0x5e')](applications,_0x34e5de[_0xfaa6('0x56')])){this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0x5f')]=_0x34e5de[_0xfaa6('0x56')];this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0x60')]=_0x34e5de[_0xfaa6('0x59')];if(_0x34e5de[_0xfaa6('0x56')]==='set'&&_['startsWith'](_0x34e5de['applicationdata'][_0xfaa6('0x61')](),_0xfaa6('0x62'))){var _0x252301=_0x34e5de[_0xfaa6('0x59')]['split']('=');var _0x44674b=_0x252301[0x0][_0xfaa6('0x61')]()[_0xfaa6('0x63')](/cdr\((.*)\)/);if(_0x44674b){this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0x44674b[0x1]]=_0x252301[0x1];}}else if(_0x34e5de[_0xfaa6('0x56')]==='queue'){this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0xf')]=_0x34e5de[_0xfaa6('0x59')][_0xfaa6('0x41')](',')[0x0];}}}}}catch(_0x433a23){logger[_0xfaa6('0x53')](_0xfaa6('0x64'),_0x34e5de[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x433a23,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x22')]=function(_0x33ec86){try{if(this[_0xfaa6('0x32')](_0x33ec86)){logger['info'](_0xfaa6('0x65'),_0x33ec86['uniqueid'],_0x33ec86[_0xfaa6('0x3b')],_0x33ec86[_0xfaa6('0x37')],_0x33ec86['calleridnum']);logger[_0xfaa6('0x39')]('[%s][voiceCallReport][newstate]\x20event:',_0x33ec86['uniqueid'],util[_0xfaa6('0x30')](_0x33ec86,{'showHidden':![],'depth':null}));if(_0x33ec86[_0xfaa6('0x36')]!==_0x33ec86[_0xfaa6('0x3b')]){if(this[_0xfaa6('0x1a')][_0x33ec86['linkedid']]){if(_0x33ec86[_0xfaa6('0x4f')]==='6'){if(!this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x66')]){var _0x3cd07c=moment();this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x66')]=!![];this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x67')]=_0x3cd07c[_0xfaa6('0x45')](_0xfaa6('0x4d'));if(this[_0xfaa6('0x1a')][_0x33ec86['linkedid']]['starttime']){this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x68')]=_0x3cd07c[_0xfaa6('0x69')](this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x4c')],_0xfaa6('0x5d'));}}this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x3b')]=_0x33ec86['uniqueid'];if(_0x33ec86[_0xfaa6('0x38')]!==_0xfaa6('0x43')){this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x49')]=_0x33ec86['calleridnum'];}this['channels'][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x6a')]=_0x33ec86[_0xfaa6('0x37')];this['channels'][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x6b')]=_0x33ec86[_0xfaa6('0x40')];this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x4e')]=dispositions[_[_0xfaa6('0x6c')](_0x33ec86[_0xfaa6('0x4f')])];if(this[_0xfaa6('0x1b')][_0x33ec86[_0xfaa6('0x40')]['split']('-')[0x0]]){this['channels'][_0x33ec86['linkedid']][_0xfaa6('0x6d')]=this['agents'][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['id'];this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x6e')]=this[_0xfaa6('0x1b')][_0x33ec86['channel'][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x52')];}}}}else{if(this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x36')]]){if(_0x33ec86[_0xfaa6('0x4f')]==='6'){if(this[_0xfaa6('0x1b')][_0x33ec86[_0xfaa6('0x40')]['split']('-')[0x0]]){this['channels'][_0x33ec86[_0xfaa6('0x36')]][_0xfaa6('0x6d')]=this[_0xfaa6('0x1b')][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['id'];this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x36')]][_0xfaa6('0x6e')]=this[_0xfaa6('0x1b')][_0x33ec86[_0xfaa6('0x40')]['split']('-')[0x0]]['name'];}}}}if(_0x33ec86[_0xfaa6('0x4f')]==='6'&&_0x33ec86[_0xfaa6('0x3e')]===_0xfaa6('0x3f')){if(this[_0xfaa6('0x1b')][_0x33ec86['channel']['split']('-')[0x0]]){this[_0xfaa6('0x1b')][_0x33ec86['channel']['split']('-')[0x0]][_0xfaa6('0x44')]=_0x33ec86[_0xfaa6('0x42')];var _0x1f1744;if(this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x36')]])_0x1f1744=this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x36')]]['routealias'];else if(this['channels'][_0x33ec86[_0xfaa6('0x3b')]])_0x1f1744=this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x6f')];logger['debug'](_0xfaa6('0x70'),_0x33ec86[_0xfaa6('0x36')],util[_0xfaa6('0x30')]({'destaccountcode':this['agents'][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x33ec86[_0xfaa6('0x42')],'routealias':_0x1f1744},{'showHidden':![],'depth':null}));this[_0xfaa6('0x34')](util['format'](_0xfaa6('0x46'),this['agents'][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x52')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x48')],'destconnectedlinenum':_0x33ec86['exten'],'routealias':_0x1f1744});}}}}catch(_0x3ea14e){logger[_0xfaa6('0x53')]('[%s][voiceCallReport][newstate]',_0x33ec86[_0xfaa6('0x36')],util['inspect'](_0x3ea14e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xfaa6('0x71')]=function(_0x26f7ae,_0x6b6282){try{if(this[_0xfaa6('0x1a')][_0x26f7ae]){logger['info'](_0xfaa6('0x72'),_0x26f7ae,_0x6b6282);this[_0xfaa6('0x1a')][_0x26f7ae][_0xfaa6('0x73')]=!![];if(_[_0xfaa6('0x74')](_0x6b6282,_0xfaa6('0x75'))){_0x6b6282=_0x6b6282['replace'](_0xfaa6('0x75'),_0xfaa6('0x76'));}this[_0xfaa6('0x1a')][_0x26f7ae]['monitorFilename']=_0x6b6282;var _0x57f7ad=_[_0xfaa6('0x77')](this[_0xfaa6('0x1a')][_0x26f7ae][_0xfaa6('0x78')],{'filename':_0x6b6282});if(_[_0xfaa6('0x79')](_0x57f7ad)){this[_0xfaa6('0x1a')][_0x26f7ae][_0xfaa6('0x78')]['push']({'filename':_0x6b6282,'createdAt':moment()[_0xfaa6('0x45')](_0xfaa6('0x4d')),'mixmonitorid':'','status':_0xfaa6('0x7a')});}}}catch(_0x300f3b){logger[_0xfaa6('0x53')](_0xfaa6('0x7b'),_0x26f7ae,util['inspect'](_0x300f3b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x7c')]=function(_0x2fbb44){try{if(this[_0xfaa6('0x32')](_0x2fbb44)){logger['debug'](_0xfaa6('0x7d'),_0x2fbb44['uniqueid'],util[_0xfaa6('0x30')](_0x2fbb44,{'showHidden':![],'depth':null}));if(this['channels'][_0x2fbb44[_0xfaa6('0x36')]]&&_0x2fbb44['channel']!=_0xfaa6('0x4a')){if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')])){if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x7f')])){logger['info'](_0xfaa6('0x80'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this['syncMixMonitorFilename'](_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x82')])){logger[_0xfaa6('0x2c')](_0xfaa6('0x83'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44['uniqueid']][_0xfaa6('0x38')]=_0x2fbb44['value'];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x84')])){logger[_0xfaa6('0x2c')](_0xfaa6('0x85'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]]['callerid']=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44['variable'][_0xfaa6('0x86')])){logger[_0xfaa6('0x2c')](_0xfaa6('0x87'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]]['type']=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x88')])){logger[_0xfaa6('0x2c')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]['split'](',')[0x0]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0xf')]=_0x2fbb44[_0xfaa6('0x81')]['split'](',')[0x0];}else if(this['isNotNull'](_0x2fbb44[_0xfaa6('0x7e')]['xmd-originatecalleridnum'])){logger[_0xfaa6('0x2c')](_0xfaa6('0x89'),_0x2fbb44['uniqueid'],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0x8a')]=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x8b')])){logger[_0xfaa6('0x2c')](_0xfaa6('0x8c'),_0x2fbb44['uniqueid'],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0x8d')]=_0x2fbb44['value'];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')]['xmd-callerid-preview'])){logger[_0xfaa6('0x2c')](_0xfaa6('0x8e'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0x8f')]=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')]['xmcs-queue'])){logger[_0xfaa6('0x2c')](_0xfaa6('0x90'),_0x2fbb44['uniqueid'],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0xf')]=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x91')])){logger[_0xfaa6('0x2c')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2fbb44['uniqueid'],_0x2fbb44[_0xfaa6('0x81')]);this['channels'][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0x92')]=_0x2fbb44[_0xfaa6('0x81')];}}}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x7f')])){if(_0x2fbb44[_0xfaa6('0x81')]){var _0x3d1cc3=path['parse'](_0x2fbb44[_0xfaa6('0x81')])[_0xfaa6('0x52')];logger[_0xfaa6('0x2c')](_0xfaa6('0x80'),_0x3d1cc3,_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x71')](_0x3d1cc3,_0x2fbb44['value']);}}else if(this['channels'][_0x2fbb44[_0xfaa6('0x3b')]]){if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')])){if(this[_0xfaa6('0x32')](_0x2fbb44['variable']['sipcallid'])){logger[_0xfaa6('0x2c')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2fbb44[_0xfaa6('0x3b')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44['linkedid']][_0xfaa6('0x93')]=_0x2fbb44[_0xfaa6('0x81')];}}}}}catch(_0x48e53e){logger['error'](_0xfaa6('0x94'),_0x2fbb44[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x48e53e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x25')]=function(_0x1c401f){try{if(this['isNotNull'](_0x1c401f)){logger[_0xfaa6('0x39')](_0xfaa6('0x95'),_0x1c401f[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x1c401f,{'showHidden':![],'depth':null}));if(this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]){logger[_0xfaa6('0x2c')](_0xfaa6('0x96'),_0x1c401f[_0xfaa6('0x36')],_0x1c401f['cause-txt']);var _0x2000fb=moment();this['channels'][_0x1c401f[_0xfaa6('0x36')]]['endtime']=_0x2000fb[_0xfaa6('0x45')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1c401f[_0xfaa6('0x36')]]['duration']=_0x2000fb[_0xfaa6('0x69')](this['channels'][_0x1c401f['uniqueid']]['starttime'],_0xfaa6('0x5d'));if(this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]['answered']){this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x97')]=_0x2000fb['diff'](this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x67')],_0xfaa6('0x5d'));this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]['holdtime']=this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x5b')]-this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]['billableseconds'];}if(_0x1c401f[_0xfaa6('0x3e')]===_0xfaa6('0x3f')){if(this['agents'][_0x1c401f['channel'][_0xfaa6('0x41')]('-')[0x0]]){this[_0xfaa6('0x1b')][_0x1c401f[_0xfaa6('0x40')]['split']('-')[0x0]]=_[_0xfaa6('0x98')](this[_0xfaa6('0x1b')][_0x1c401f[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]],['destconnectedlinenum']);logger['debug'](_0xfaa6('0x99'),_0x1c401f[_0xfaa6('0x36')],util['inspect']({'id':this[_0xfaa6('0x1b')][_0x1c401f[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xfaa6('0x1b')][_0x1c401f[_0xfaa6('0x40')]['split']('-')[0x0]][_0xfaa6('0x48')]},{'showHidden':![],'depth':null}));this[_0xfaa6('0x34')](util['format'](_0xfaa6('0x46'),this['agents'][_0x1c401f[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x52')]),'user:agentcomplete',{'id':this['agents'][_0x1c401f[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xfaa6('0x1b')][_0x1c401f['channel'][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x48')]});}}var _0x2d6ea8=this;Promise['resolve']()['then'](function(){var _0x41ac0a=_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f['uniqueid']];if(typeof _0x41ac0a['transferType']===_0xfaa6('0x9a'))return;if(_[_0xfaa6('0x9b')](_0x41ac0a[_0xfaa6('0x78')]))return;return RpcSetting[_0xfaa6('0x9c')]()[_0xfaa6('0x9d')](function(_0x203e24){if(!_0x203e24[_0xfaa6('0x9e')])return;return Promise['resolve']()[_0xfaa6('0x9d')](function(){return ami[_0xfaa6('0x9f')]({'action':_0xfaa6('0xa0'),'channel':_0x41ac0a[_0xfaa6('0x40')]})[_0xfaa6('0xa1')](function(){});})[_0xfaa6('0x9d')](function(){return ami['Action']({'action':_0xfaa6('0xa0'),'channel':_0x41ac0a[_0xfaa6('0x6b')]})[_0xfaa6('0xa1')](function(){})['finally'](function(){var _0x1b1f2b=_0x2d6ea8[_0xfaa6('0x1b')][_0x41ac0a[_0xfaa6('0x6b')][_0xfaa6('0x41')]('-')[0x0]];if(!_0x1b1f2b)return;io['emit']('webbar:stopmonitors',{'agentId':_0x1b1f2b['id'],'uniqueid':_0x41ac0a[_0xfaa6('0x36')]});});});});})[_0xfaa6('0x9d')](function(){if(_0x1c401f['event']==='BlindTransfer'){_0x2d6ea8[_0xfaa6('0x1c')][_0x1c401f[_0xfaa6('0x36')]]=_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f['uniqueid']];}else{if(_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0xa2')]==='outbound'&&_0x2d6ea8['blindTransfers'][_0x1c401f[_0xfaa6('0x36')]]){_0x2d6ea8['channels'][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x36')]=[_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x3b')],_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]['linkedid']=_0x2d6ea8['channels'][_0x1c401f[_0xfaa6('0x36')]]['uniqueid']][0x0];delete _0x2d6ea8[_0xfaa6('0x1c')][_0x1c401f[_0xfaa6('0x36')]];}}logger['debug'](_0xfaa6('0xa3'),_0x1c401f[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]],{'showHidden':![],'depth':null}));ami[_0xfaa6('0x34')](_0xfaa6('0xa4'),_0x2d6ea8['channels'][_0x1c401f[_0xfaa6('0x36')]]);delete _0x2d6ea8['channels'][_0x1c401f[_0xfaa6('0x36')]];});}}}catch(_0x535eae){logger['error'](_0xfaa6('0xa5'),_0x1c401f[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x535eae,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xfaa6('0xa6')]=function(_0x5cf5b0){try{if(this[_0xfaa6('0x32')](_0x5cf5b0)){logger[_0xfaa6('0x2c')](_0xfaa6('0xa7'),_0x5cf5b0['uniqueid'],_0x5cf5b0[_0xfaa6('0xa8')],_0x5cf5b0[_0xfaa6('0xa9')]);logger['debug'](_0xfaa6('0xaa'),_0x5cf5b0[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x5cf5b0,{'showHidden':![],'depth':null}));if(this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xab')]]){this[_0xfaa6('0x1a')][_0x5cf5b0['transfereeuniqueid']][_0xfaa6('0xac')]=_0x5cf5b0[_0xfaa6('0xa8')];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xab')]][_0xfaa6('0xad')]=_0x5cf5b0[_0xfaa6('0xa9')];if(this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]]){var _0x532687=this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]]=this[_0xfaa6('0x1a')][_0x5cf5b0['transfereeuniqueid']];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xab')]]=_0x532687;}}else if(this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xaf')]]){this['channels'][_0x5cf5b0[_0xfaa6('0xaf')]][_0xfaa6('0xac')]=_0x5cf5b0[_0xfaa6('0xa8')];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xaf')]][_0xfaa6('0xad')]=_0x5cf5b0['transfertargetcalleridnum'];if(this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xb0')]]){var _0x532687=this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xb0')]];this['channels'][_0x5cf5b0[_0xfaa6('0xb0')]]=this['channels'][_0x5cf5b0['transfertargetuniqueid']];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xaf')]]=_0x532687;}}if((this['channels'][_0x5cf5b0[_0xfaa6('0xb0')]]||this['channels'][_0x5cf5b0[_0xfaa6('0xb1')]])&&this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]]){var _0x5bb092=_['some']([this['channels'][_0x5cf5b0[_0xfaa6('0xb0')]],this[_0xfaa6('0x1a')][_0x5cf5b0['origtransfererlinkedid']],this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]]],function(_0x3197e3){return _0x3197e3&&_0x3197e3[_0xfaa6('0xa2')]===_0xfaa6('0xb2')&&_0x3197e3[_0xfaa6('0xb3')];});if(_0x5bb092){if(this[_0xfaa6('0x1a')][_0x5cf5b0['origtransfereruniqueid']])this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xb0')]][_0xfaa6('0xb4')]=_0xfaa6('0xb5');if(this['channels'][_0x5cf5b0[_0xfaa6('0xb1')]])this['channels'][_0x5cf5b0['origtransfererlinkedid']][_0xfaa6('0xb4')]=_0xfaa6('0xb5');this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]][_0xfaa6('0xb4')]='ATTENDED';}}}}catch(_0x52bd8f){logger[_0xfaa6('0x53')](_0xfaa6('0xb6'),_0x5cf5b0[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x52bd8f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')]['syncBlindTransfer']=function(_0x429ef1){try{if(this[_0xfaa6('0x32')](_0x429ef1)){logger[_0xfaa6('0x2c')](_0xfaa6('0xb7'),_0x429ef1[_0xfaa6('0x36')],_0x429ef1[_0xfaa6('0xb8')],_0x429ef1[_0xfaa6('0xb9')]);logger[_0xfaa6('0x39')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x429ef1[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x429ef1,{'showHidden':![],'depth':null}));if(this[_0xfaa6('0x1a')][_0x429ef1['transfereeuniqueid']]){this[_0xfaa6('0x1a')][_0x429ef1['transfereeuniqueid']]['transfercalleridnum']=_0x429ef1[_0xfaa6('0xb8')];this['channels'][_0x429ef1[_0xfaa6('0xab')]]['transferconnectedlinenum']=_0x429ef1['extension'];this[_0xfaa6('0x1a')][_0x429ef1[_0xfaa6('0xab')]][_0xfaa6('0xb4')]=_0xfaa6('0xba');this[_0xfaa6('0x25')]({'event':_0xfaa6('0xbb'),'uniqueid':_0x429ef1[_0xfaa6('0xab')],'context':_0x429ef1[_0xfaa6('0x3e')],'channel':_0x429ef1[_0xfaa6('0xbc')]});}else{this['channels'][_0x429ef1['transfereruniqueid']][_0xfaa6('0xb4')]='BLIND';}}}catch(_0x101f0b){logger[_0xfaa6('0x53')]('[%s][voiceCallReport][blindtransfer]',_0x429ef1['uniqueid'],util[_0xfaa6('0x30')](_0x101f0b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')]['syncMusicOnHoldStart']=function(_0x342207){try{if(this[_0xfaa6('0x32')](_0x342207)){logger[_0xfaa6('0x39')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x342207[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x342207,{'showHidden':![],'depth':null}));if(this[_0xfaa6('0x1a')][_0x342207[_0xfaa6('0x36')]]){if(!_[_0xfaa6('0x79')](this[_0xfaa6('0x1a')][_0x342207[_0xfaa6('0x36')]]['answertime'])){this[_0xfaa6('0x1a')][_0x342207[_0xfaa6('0x36')]][_0xfaa6('0xbd')]=moment()[_0xfaa6('0x45')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xfaa6('0x2c')](_0xfaa6('0xbe'),_0x342207['uniqueid'],this[_0xfaa6('0x1a')][_0x342207['uniqueid']]['mohstarttime']);}}}}catch(_0x28b57c){logger[_0xfaa6('0x53')](_0xfaa6('0xbf'),_0x342207['uniqueid'],util['inspect'](_0x28b57c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xfaa6('0x2b')]=function(_0x3b2254){try{if(this[_0xfaa6('0x32')](_0x3b2254)){logger['debug'](_0xfaa6('0xc0'),_0x3b2254[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x3b2254,{'showHidden':![],'depth':null}));if(this['channels'][_0x3b2254[_0xfaa6('0x36')]]){if(!_[_0xfaa6('0x79')](this[_0xfaa6('0x1a')][_0x3b2254['uniqueid']][_0xfaa6('0xbd')])){this[_0xfaa6('0x1a')][_0x3b2254['uniqueid']][_0xfaa6('0xc1')]+=moment()[_0xfaa6('0xc2')](0x0)['diff'](this[_0xfaa6('0x1a')][_0x3b2254[_0xfaa6('0x36')]][_0xfaa6('0xbd')],_0xfaa6('0x5d'));logger['info'](_0xfaa6('0xc3'),_0x3b2254[_0xfaa6('0x36')],this[_0xfaa6('0x1a')][_0x3b2254[_0xfaa6('0x36')]]['mohtime']);delete this[_0xfaa6('0x1a')][_0x3b2254[_0xfaa6('0x36')]][_0xfaa6('0xbd')];}}}}catch(_0x5a3e83){logger[_0xfaa6('0x53')](_0xfaa6('0xc4'),_0x3b2254[_0xfaa6('0x36')],util['inspect'](_0x5a3e83,{'showHidden':![],'depth':null}));}};module[_0xfaa6('0xc5')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 4187c1f..ffa50f9 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ce5=['memberinterface','memberlastcall','memberrealtime','isNil','isUndefined','[%s][voiceDialReport][hangup]\x20event:','info','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','duration','seconds','complete','answertime','answered','diff','starttime','billableseconds','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','bind','dialend','syncVarSet','newexten','syncHangup','prototype','emit','isNotNull','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','merge','voice:outbound','voice_outbound_channel:save','debug','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','dialstatus','connectedlinename','format','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic'];(function(_0x4c094a,_0x3b5cef){var _0x45f004=function(_0x4876ae){while(--_0x4876ae){_0x4c094a['push'](_0x4c094a['shift']());}};_0x45f004(++_0x3b5cef);}(_0x6ce5,0x94));var _0x56ce=function(_0x1722ca,_0x3460cb){_0x1722ca=_0x1722ca-0x0;var _0x55efa3=_0x6ce5[_0x1722ca];return _0x55efa3;};'use strict';var _=require(_0x56ce('0x0'));var moment=require('moment');var util=require(_0x56ce('0x1'));var Redis=require(_0x56ce('0x2'));var config=require(_0x56ce('0x3'));var logger=require(_0x56ce('0x4'))(_0x56ce('0x5'));var ami=require(_0x56ce('0x6'));config['redis']=_[_0x56ce('0x7')](config['redis'],{'host':_0x56ce('0x8'),'port':0x18eb});var io=require(_0x56ce('0x9'))(new Redis(config['redis']));function VoiceDialReport(_0x425c65){this[_0x56ce('0xa')]=_0x425c65[_0x56ce('0xb')];this[_0x56ce('0xc')]=_0x425c65[_0x56ce('0xc')];this[_0x56ce('0xd')]={};this[_0x56ce('0xe')]={};ami['on'](_0x56ce('0xf'),this['syncDialBegin'][_0x56ce('0x10')](this));ami['on'](_0x56ce('0x11'),this['syncDialEnd'][_0x56ce('0x10')](this));ami['on']('varset',this[_0x56ce('0x12')][_0x56ce('0x10')](this));ami['on'](_0x56ce('0x13'),this['syncNewExten']['bind'](this));ami['on']('hangup',this[_0x56ce('0x14')]['bind'](this));}VoiceDialReport[_0x56ce('0x15')]['isNotNull']=function(_0x43ac53){return _0x43ac53!==null&&!_['isUndefined'](_0x43ac53);};VoiceDialReport[_0x56ce('0x15')]['emit']=function(_0x5625ae,_0x4db736,_0x10b5c1){io['to'](_0x5625ae)[_0x56ce('0x16')](_0x4db736,_0x10b5c1);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x27388d){try{if(this[_0x56ce('0x17')](_0x27388d)){logger['debug'](_0x56ce('0x18'),_0x27388d[_0x56ce('0x19')],util[_0x56ce('0x1a')](_0x27388d,{'showHidden':![],'depth':null}));if(this[_0x56ce('0xa')][_0x27388d['uniqueid']]){_['merge'](this['channels'][_0x27388d[_0x56ce('0x19')]],{'starttime':moment()['format'](_0x56ce('0x1b')),'lastevent':'called','interface':_0x27388d[_0x56ce('0x1c')][_0x56ce('0x1d')](0x0,_0x27388d['channel']['lastIndexOf']('-')),'membername':_0x27388d[_0x56ce('0x1c')][_0x56ce('0x1d')](_0x27388d[_0x56ce('0x1c')][_0x56ce('0x1e')]('/')+0x1,_0x27388d[_0x56ce('0x1c')]['lastIndexOf']('-'))},_[_0x56ce('0x1f')](_0x27388d,['event',_0x56ce('0x20')]));logger['info'](_0x56ce('0x21'),_0x27388d[_0x56ce('0x19')],this[_0x56ce('0xa')][_0x27388d[_0x56ce('0x19')]][_0x56ce('0x22')],this[_0x56ce('0xa')][_0x27388d['uniqueid']][_0x56ce('0x23')]);logger['debug'](_0x56ce('0x24'),_0x27388d[_0x56ce('0x19')],util['inspect'](this[_0x56ce('0xa')][_0x27388d['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0x56ce('0xd')][_0x27388d[_0x56ce('0x19')]])_[_0x56ce('0x25')](this[_0x56ce('0xa')][_0x27388d[_0x56ce('0x19')]],this[_0x56ce('0xd')][_0x27388d[_0x56ce('0x19')]]);this[_0x56ce('0x16')](_0x56ce('0x26'),_0x56ce('0x27'),this['channels'][_0x27388d[_0x56ce('0x19')]]);logger[_0x56ce('0x28')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x27388d['uniqueid'],util['inspect'](this[_0x56ce('0xa')][_0x27388d[_0x56ce('0x19')]],{'showHidden':![],'depth':null}));ami[_0x56ce('0x16')](_0x56ce('0x29'),this['channels'][_0x27388d[_0x56ce('0x19')]]);}}}catch(_0x3fd6a2){logger[_0x56ce('0x2a')](_0x56ce('0x2b'),_0x27388d[_0x56ce('0x19')],util[_0x56ce('0x1a')](_0x3fd6a2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x56ce('0x15')][_0x56ce('0x2c')]=function(_0x262623){try{if(this[_0x56ce('0x17')](_0x262623)){logger[_0x56ce('0x28')]('[%s][voiceDialReport][dialend]\x20event:',_0x262623[_0x56ce('0x19')],util[_0x56ce('0x1a')](_0x262623,{'showHidden':![],'depth':null}));if(this['channels'][_0x262623[_0x56ce('0x19')]]){this[_0x56ce('0xa')][_0x262623[_0x56ce('0x19')]][_0x56ce('0x2d')]=_0x262623[_0x56ce('0x2d')];if(_0x262623[_0x56ce('0x2d')]==='ANSWER'){this[_0x56ce('0xa')][_0x262623[_0x56ce('0x19')]]['connectedlinenum']=_0x262623['connectedlinenum'];this[_0x56ce('0xa')][_0x262623[_0x56ce('0x19')]][_0x56ce('0x2e')]=_0x262623[_0x56ce('0x2e')];this[_0x56ce('0xa')][_0x262623[_0x56ce('0x19')]]['answertime']=moment()[_0x56ce('0x2f')](_0x56ce('0x1b'));this[_0x56ce('0xa')][_0x262623[_0x56ce('0x19')]][_0x56ce('0x30')]=_0x56ce('0x31');logger['info'](_0x56ce('0x32'),_0x262623[_0x56ce('0x19')],_0x262623[_0x56ce('0x1c')][_0x56ce('0x1d')](_0x262623[_0x56ce('0x1c')][_0x56ce('0x1e')]('/')+0x1,_0x262623[_0x56ce('0x1c')][_0x56ce('0x1e')]('-')));logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x262623[_0x56ce('0x19')],util['inspect'](this[_0x56ce('0xa')][_0x262623['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x56ce('0x16')](_0x56ce('0x33'),this['channels'][_0x262623['uniqueid']]);}logger[_0x56ce('0x28')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x262623[_0x56ce('0x19')],util[_0x56ce('0x1a')](this[_0x56ce('0xa')][_0x262623[_0x56ce('0x19')]],{'showHidden':![],'depth':null}));this[_0x56ce('0x16')]('voice:outbound','voice_outbound_channel:save',this[_0x56ce('0xa')][_0x262623['uniqueid']]);}}}catch(_0x28b6ee){logger[_0x56ce('0x2a')](_0x56ce('0x34'),_0x262623[_0x56ce('0x19')],util['inspect'](_0x28b6ee,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x56ce('0x15')][_0x56ce('0x12')]=function(_0x3ed207){try{if(this['isNotNull'](_0x3ed207)){logger['debug'](_0x56ce('0x35'),_0x3ed207[_0x56ce('0x19')],util[_0x56ce('0x1a')](_0x3ed207,{'showHidden':![],'depth':null}));this[_0x56ce('0x36')](_0x3ed207['uniqueid'],_['keys'](_0x3ed207[_0x56ce('0x37')])[0x0],_0x3ed207[_0x56ce('0x38')]);if(this[_0x56ce('0x17')](_0x3ed207[_0x56ce('0x37')])&&this[_0x56ce('0x17')](_0x3ed207['variable'][_0x56ce('0x39')])){if(_['isUndefined'](this[_0x56ce('0xa')][_0x3ed207[_0x56ce('0x19')]])){this['channels'][_0x3ed207[_0x56ce('0x19')]]={'routeId':_0x3ed207[_0x56ce('0x38')],'variables':this[_0x56ce('0xe')][_0x3ed207[_0x56ce('0x19')]],'motionChannel':_0x56ce('0x3a')};logger['info'](_0x56ce('0x3b'),_0x3ed207[_0x56ce('0x19')],_0x3ed207['variable'][_0x56ce('0x39')],_[_0x56ce('0x3c')](_0x3ed207['variable'])[0x0],_0x3ed207['value']);logger[_0x56ce('0x28')](_0x56ce('0x3d'),_0x3ed207['uniqueid'],util[_0x56ce('0x1a')](this[_0x56ce('0xa')][_0x3ed207[_0x56ce('0x19')]],{'showHidden':![],'depth':null}));this[_0x56ce('0x16')](_0x56ce('0x26'),'voice_outbound_channel:save',this[_0x56ce('0xa')][_0x3ed207['uniqueid']]);}}}}catch(_0x204170){logger[_0x56ce('0x2a')](_0x56ce('0x3e'),_0x3ed207[_0x56ce('0x19')],util[_0x56ce('0x1a')](_0x204170,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x56ce('0x15')][_0x56ce('0x36')]=function(_0x49a19b,_0x2810ed,_0x29b1b4){var _0x54a79f=[_0x56ce('0x3f'),'rtpaudioqosbridged',_0x56ce('0x40'),_0x56ce('0x41'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x56ce('0x42'),'rtpaudioqosrttbridged',_0x56ce('0x43'),_0x56ce('0x44'),_0x56ce('0x45'),'bridgepvtcallid',_0x56ce('0x46'),_0x56ce('0x47'),_0x56ce('0x48'),_0x56ce('0x49'),_0x56ce('0x22'),'memberpenalty',_0x56ce('0x4a')];if(!_[_0x56ce('0x4b')](_0x2810ed)&&!_['includes'](_0x54a79f,_0x2810ed)){if(_[_0x56ce('0x4c')](this[_0x56ce('0xe')][_0x49a19b])){this[_0x56ce('0xe')][_0x49a19b]={};}this[_0x56ce('0xe')][_0x49a19b][_0x2810ed]=_0x29b1b4;}};VoiceDialReport['prototype'][_0x56ce('0x14')]=function(_0x26d927){try{if(this[_0x56ce('0x17')](_0x26d927)){logger[_0x56ce('0x28')](_0x56ce('0x4d'),_0x26d927[_0x56ce('0x19')],util['inspect'](_0x26d927,{'showHidden':![],'depth':null}));if(this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]]){logger[_0x56ce('0x4e')](_0x56ce('0x4f'),_0x26d927['uniqueid'],_0x26d927['cause-txt']);this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]][_0x56ce('0x50')]=moment()['format'](_0x56ce('0x1b'));this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]][_0x56ce('0x51')]=moment(this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]][_0x56ce('0x50')])['diff'](this[_0x56ce('0xa')][_0x26d927['uniqueid']]['starttime'],_0x56ce('0x52'));this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]][_0x56ce('0x30')]=_0x56ce('0x53');this['outbound']['total']+=0x1;if(this[_0x56ce('0xa')][_0x26d927['uniqueid']][_0x56ce('0x54')]){this[_0x56ce('0xc')][_0x56ce('0x55')]+=0x1;this['channels'][_0x26d927['uniqueid']]['holdtime']=moment(this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]]['answertime'])[_0x56ce('0x56')](this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]][_0x56ce('0x57')],_0x56ce('0x52'));this[_0x56ce('0xa')][_0x26d927['uniqueid']][_0x56ce('0x58')]=moment(this['channels'][_0x26d927[_0x56ce('0x19')]][_0x56ce('0x50')])[_0x56ce('0x56')](this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]][_0x56ce('0x54')],_0x56ce('0x52'));this[_0x56ce('0xc')]['sumHoldTime']+=this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]][_0x56ce('0x59')]||0x0;this['outbound'][_0x56ce('0x5a')]+=this['channels'][_0x26d927['uniqueid']]['billableseconds'];}this[_0x56ce('0xc')][_0x56ce('0x5b')]+=this['channels'][_0x26d927['uniqueid']][_0x56ce('0x51')];logger['debug'](_0x56ce('0x5c'),_0x26d927[_0x56ce('0x19')],util[_0x56ce('0x1a')](this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]],{'showHidden':![],'depth':null}));ami[_0x56ce('0x16')](_0x56ce('0x5d'),this[_0x56ce('0xa')][_0x26d927['uniqueid']]);logger[_0x56ce('0x28')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x26d927['uniqueid'],util[_0x56ce('0x1a')](this[_0x56ce('0xa')][_0x26d927['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x56ce('0x16')](_0x56ce('0x5e'),this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]]);logger[_0x56ce('0x28')](_0x56ce('0x5f'),_0x26d927[_0x56ce('0x19')],util[_0x56ce('0x1a')](this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]],{'showHidden':![],'depth':null}));this[_0x56ce('0x16')](_0x56ce('0x26'),'voice_outbound:save',this['outbound']);logger[_0x56ce('0x4e')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON['stringify'](this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x19')]]));logger[_0x56ce('0x28')](_0x56ce('0x60'),_0x26d927[_0x56ce('0x19')],util[_0x56ce('0x1a')](this['channels'][_0x26d927[_0x56ce('0x19')]],{'showHidden':![],'depth':null}));this[_0x56ce('0x16')](_0x56ce('0x26'),_0x56ce('0x61'),this[_0x56ce('0xa')][_0x26d927['uniqueid']]);delete this['channels'][_0x26d927['uniqueid']];}else if(this['channels'][_0x26d927[_0x56ce('0x62')]]){this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x62')]][_0x56ce('0x19')]=this[_0x56ce('0xa')][_0x26d927[_0x56ce('0x62')]][_0x56ce('0x63')];}if(this[_0x56ce('0xe')][_0x26d927[_0x56ce('0x19')]]){delete this['variables'][_0x26d927[_0x56ce('0x19')]];}}}catch(_0x2fa28e){logger[_0x56ce('0x2a')](_0x56ce('0x64'),_0x26d927[_0x56ce('0x19')],util[_0x56ce('0x1a')](_0x2fa28e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x56ce('0x15')][_0x56ce('0x65')]=function(_0x3aa122){try{if(this[_0x56ce('0x17')](_0x3aa122)){logger['debug'](_0x56ce('0x66'),_0x3aa122[_0x56ce('0x19')],util['inspect'](_0x3aa122,{'showHidden':![],'depth':null}));if(_0x3aa122['application'][_0x56ce('0x67')]()===_0x56ce('0x68')){_0x3aa122[_0x56ce('0x69')]=(_0x3aa122[_0x56ce('0x6a')]||_0x3aa122[_0x56ce('0x69')])[_0x56ce('0x67')]();if(_[_0x56ce('0x6b')](_0x3aa122['applicationdata'],'cdr(')){if(_[_0x56ce('0x4c')](this[_0x56ce('0xd')][_0x3aa122[_0x56ce('0x19')]]))this['applications'][_0x3aa122[_0x56ce('0x19')]]={};logger[_0x56ce('0x4e')](_0x56ce('0x6c'),_0x3aa122[_0x56ce('0x19')],_0x3aa122[_0x56ce('0x6d')],_0x3aa122['applicationdata']);var _0xe3f8bc=_0x3aa122[_0x56ce('0x69')]['split']('=');var _0x9b9c78=_0xe3f8bc[0x0]['match'](/cdr\((.*)\)/);if(_0x9b9c78)this[_0x56ce('0xd')][_0x3aa122[_0x56ce('0x19')]][_0x9b9c78[0x1]]=_0xe3f8bc[0x1];}}}}catch(_0x19fb9f){logger['error']('[%s][voiceDialReport][newexten]',_0x3aa122['uniqueid'],util[_0x56ce('0x1a')](_0x19fb9f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x41a5=['debug','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','event','privilege','info','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','addVariable','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','complete','answered','holdtime','billableseconds','sumHoldTime','sumDuration','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','linkedid','destuniqueid','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','startsWith','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','newexten','hangup','prototype','isNotNull','isUndefined','emit'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0x41a5,0x1b6));var _0x541a=function(_0x3797cf,_0x1234b5){_0x3797cf=_0x3797cf-0x0;var _0x56a87b=_0x41a5[_0x3797cf];return _0x56a87b;};'use strict';var _=require(_0x541a('0x0'));var moment=require(_0x541a('0x1'));var util=require(_0x541a('0x2'));var Redis=require(_0x541a('0x3'));var config=require('../../../config/environment');var logger=require(_0x541a('0x4'))('ami');var ami=require(_0x541a('0x5'));config['redis']=_[_0x541a('0x6')](config[_0x541a('0x7')],{'host':_0x541a('0x8'),'port':0x18eb});var io=require(_0x541a('0x9'))(new Redis(config[_0x541a('0x7')]));function VoiceDialReport(_0x11cae7){this[_0x541a('0xa')]=_0x11cae7[_0x541a('0xb')];this[_0x541a('0xc')]=_0x11cae7[_0x541a('0xc')];this[_0x541a('0xd')]={};this[_0x541a('0xe')]={};ami['on']('dialbegin',this[_0x541a('0xf')][_0x541a('0x10')](this));ami['on'](_0x541a('0x11'),this[_0x541a('0x12')][_0x541a('0x10')](this));ami['on']('varset',this[_0x541a('0x13')][_0x541a('0x10')](this));ami['on'](_0x541a('0x14'),this['syncNewExten']['bind'](this));ami['on'](_0x541a('0x15'),this['syncHangup'][_0x541a('0x10')](this));}VoiceDialReport[_0x541a('0x16')][_0x541a('0x17')]=function(_0x1669a5){return _0x1669a5!==null&&!_[_0x541a('0x18')](_0x1669a5);};VoiceDialReport[_0x541a('0x16')][_0x541a('0x19')]=function(_0x4820ff,_0x45fc33,_0x1a23b0){io['to'](_0x4820ff)[_0x541a('0x19')](_0x45fc33,_0x1a23b0);};VoiceDialReport[_0x541a('0x16')][_0x541a('0xf')]=function(_0x1977c7){try{if(this[_0x541a('0x17')](_0x1977c7)){logger[_0x541a('0x1a')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x1977c7[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x1977c7,{'showHidden':![],'depth':null}));if(this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]]){_[_0x541a('0x1d')](this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]],{'starttime':moment()[_0x541a('0x1e')](_0x541a('0x1f')),'lastevent':'called','interface':_0x1977c7[_0x541a('0x20')][_0x541a('0x21')](0x0,_0x1977c7[_0x541a('0x20')]['lastIndexOf']('-')),'membername':_0x1977c7[_0x541a('0x20')]['substring'](_0x1977c7[_0x541a('0x20')]['lastIndexOf']('/')+0x1,_0x1977c7['channel'][_0x541a('0x22')]('-'))},_[_0x541a('0x23')](_0x1977c7,[_0x541a('0x24'),_0x541a('0x25')]));logger[_0x541a('0x26')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x1977c7[_0x541a('0x1b')],this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]]['membername'],this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]][_0x541a('0x27')]);logger[_0x541a('0x1a')](_0x541a('0x28'),_0x1977c7[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x541a('0xd')][_0x1977c7[_0x541a('0x1b')]])_[_0x541a('0x1d')](this['channels'][_0x1977c7[_0x541a('0x1b')]],this[_0x541a('0xd')][_0x1977c7['uniqueid']]);this[_0x541a('0x19')]('voice:outbound',_0x541a('0x29'),this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]]);logger[_0x541a('0x1a')](_0x541a('0x2a'),_0x1977c7[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x541a('0x19')](_0x541a('0x2b'),this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]]);}}}catch(_0x3dfbda){logger[_0x541a('0x2c')]('[%s][voiceDialReport][dialbegin]',_0x1977c7[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x3dfbda,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x541a('0x16')][_0x541a('0x12')]=function(_0x226898){try{if(this[_0x541a('0x17')](_0x226898)){logger['debug'](_0x541a('0x2d'),_0x226898[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x226898,{'showHidden':![],'depth':null}));if(this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]){this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]['dialstatus']=_0x226898[_0x541a('0x2e')];if(_0x226898['dialstatus']===_0x541a('0x2f')){this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]][_0x541a('0x30')]=_0x226898['connectedlinenum'];this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]][_0x541a('0x31')]=_0x226898[_0x541a('0x31')];this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]][_0x541a('0x32')]=moment()[_0x541a('0x1e')](_0x541a('0x1f'));this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]['lastevent']=_0x541a('0x33');logger[_0x541a('0x26')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x226898[_0x541a('0x1b')],_0x226898[_0x541a('0x20')]['substring'](_0x226898[_0x541a('0x20')][_0x541a('0x22')]('/')+0x1,_0x226898[_0x541a('0x20')][_0x541a('0x22')]('-')));logger['debug'](_0x541a('0x34'),_0x226898[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x226898['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:dialconnect',this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]);}logger[_0x541a('0x1a')](_0x541a('0x35'),_0x226898['uniqueid'],util['inspect'](this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));this[_0x541a('0x19')]('voice:outbound',_0x541a('0x29'),this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]);}}}catch(_0x9b0724){logger[_0x541a('0x2c')]('[%s][voiceDialReport][dialend]',_0x226898[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x9b0724,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x541a('0x16')][_0x541a('0x13')]=function(_0x261c90){try{if(this[_0x541a('0x17')](_0x261c90)){logger[_0x541a('0x1a')]('[%s][voiceDialReport][varset]\x20event:',_0x261c90[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x261c90,{'showHidden':![],'depth':null}));this[_0x541a('0x36')](_0x261c90['uniqueid'],_[_0x541a('0x37')](_0x261c90[_0x541a('0x38')])[0x0],_0x261c90[_0x541a('0x39')]);if(this[_0x541a('0x17')](_0x261c90['variable'])&&this[_0x541a('0x17')](_0x261c90['variable'][_0x541a('0x3a')])){if(_[_0x541a('0x18')](this[_0x541a('0xa')][_0x261c90[_0x541a('0x1b')]])){this[_0x541a('0xa')][_0x261c90[_0x541a('0x1b')]]={'routeId':_0x261c90['value'],'variables':this['variables'][_0x261c90[_0x541a('0x1b')]],'motionChannel':_0x541a('0x3b')};logger['info'](_0x541a('0x3c'),_0x261c90[_0x541a('0x1b')],_0x261c90[_0x541a('0x38')][_0x541a('0x3a')],_[_0x541a('0x37')](_0x261c90[_0x541a('0x38')])[0x0],_0x261c90[_0x541a('0x39')]);logger[_0x541a('0x1a')](_0x541a('0x3d'),_0x261c90['uniqueid'],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x261c90[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));this[_0x541a('0x19')](_0x541a('0x3e'),_0x541a('0x29'),this['channels'][_0x261c90[_0x541a('0x1b')]]);}}}}catch(_0x5e99d7){logger[_0x541a('0x2c')](_0x541a('0x3f'),_0x261c90[_0x541a('0x1b')],util['inspect'](_0x5e99d7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x541a('0x16')][_0x541a('0x36')]=function(_0x93bbdb,_0x24f765,_0xd70f37){var _0x320ad0=[_0x541a('0x40'),_0x541a('0x41'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x541a('0x42'),_0x541a('0x43'),_0x541a('0x44'),_0x541a('0x45'),_0x541a('0x46'),_0x541a('0x47'),_0x541a('0x48'),'bridgepvtcallid',_0x541a('0x49'),_0x541a('0x4a'),_0x541a('0x4b'),_0x541a('0x4c'),_0x541a('0x4d'),_0x541a('0x4e'),'memberrealtime'];if(!_[_0x541a('0x4f')](_0x24f765)&&!_[_0x541a('0x50')](_0x320ad0,_0x24f765)){if(_['isUndefined'](this[_0x541a('0xe')][_0x93bbdb])){this[_0x541a('0xe')][_0x93bbdb]={};}this['variables'][_0x93bbdb][_0x24f765]=_0xd70f37;}};VoiceDialReport['prototype'][_0x541a('0x51')]=function(_0x1b1e82){try{if(this['isNotNull'](_0x1b1e82)){logger[_0x541a('0x1a')](_0x541a('0x52'),_0x1b1e82['uniqueid'],util[_0x541a('0x1c')](_0x1b1e82,{'showHidden':![],'depth':null}));if(this[_0x541a('0xa')][_0x1b1e82['uniqueid']]){logger['info'](_0x541a('0x53'),_0x1b1e82[_0x541a('0x1b')],_0x1b1e82[_0x541a('0x54')]);this[_0x541a('0xa')][_0x1b1e82['uniqueid']][_0x541a('0x55')]=moment()[_0x541a('0x1e')](_0x541a('0x1f'));this['channels'][_0x1b1e82[_0x541a('0x1b')]]['duration']=moment(this['channels'][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x55')])[_0x541a('0x56')](this[_0x541a('0xa')][_0x1b1e82['uniqueid']][_0x541a('0x57')],_0x541a('0x58'));this[_0x541a('0xa')][_0x1b1e82['uniqueid']]['lastevent']=_0x541a('0x59');this['outbound']['total']+=0x1;if(this[_0x541a('0xa')][_0x1b1e82['uniqueid']][_0x541a('0x32')]){this[_0x541a('0xc')][_0x541a('0x5a')]+=0x1;this['channels'][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x5b')]=moment(this['channels'][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x32')])[_0x541a('0x56')](this['channels'][_0x1b1e82['uniqueid']]['starttime'],'seconds');this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x5c')]=moment(this['channels'][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x55')])[_0x541a('0x56')](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]]['answertime'],_0x541a('0x58'));this[_0x541a('0xc')][_0x541a('0x5d')]+=this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x5b')]||0x0;this[_0x541a('0xc')]['sumBillable']+=this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x5c')];}this[_0x541a('0xc')][_0x541a('0x5e')]+=this[_0x541a('0xa')][_0x1b1e82['uniqueid']][_0x541a('0x5f')];logger[_0x541a('0x1a')](_0x541a('0x60'),_0x1b1e82[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x541a('0x19')](_0x541a('0x61'),this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]]);logger[_0x541a('0x1a')](_0x541a('0x62'),_0x1b1e82[_0x541a('0x1b')],util['inspect'](this['channels'][_0x1b1e82[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x541a('0x19')](_0x541a('0x63'),this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]]);logger['debug'](_0x541a('0x64'),_0x1b1e82[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound:save',this[_0x541a('0xc')]);logger[_0x541a('0x26')](_0x541a('0x65'),JSON['stringify'](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]]));logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x1b1e82['uniqueid'],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));this[_0x541a('0x19')](_0x541a('0x3e'),_0x541a('0x66'),this[_0x541a('0xa')][_0x1b1e82['uniqueid']]);delete this['channels'][_0x1b1e82[_0x541a('0x1b')]];}else if(this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x67')]]){this['channels'][_0x1b1e82['linkedid']][_0x541a('0x1b')]=this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x67')]][_0x541a('0x68')];}if(this[_0x541a('0xe')][_0x1b1e82['uniqueid']]){delete this[_0x541a('0xe')][_0x1b1e82[_0x541a('0x1b')]];}}}catch(_0xa8517){logger[_0x541a('0x2c')]('[%s][voiceDialReport][hangup]',_0x1b1e82[_0x541a('0x1b')],util['inspect'](_0xa8517,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x541a('0x16')][_0x541a('0x69')]=function(_0x203bb4){try{if(this[_0x541a('0x17')](_0x203bb4)){logger[_0x541a('0x1a')](_0x541a('0x6a'),_0x203bb4[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x203bb4,{'showHidden':![],'depth':null}));if(_0x203bb4[_0x541a('0x6b')][_0x541a('0x6c')]()===_0x541a('0x6d')){_0x203bb4[_0x541a('0x6e')]=(_0x203bb4['appdata']||_0x203bb4[_0x541a('0x6e')])[_0x541a('0x6c')]();if(_[_0x541a('0x6f')](_0x203bb4[_0x541a('0x6e')],'cdr(')){if(_[_0x541a('0x18')](this[_0x541a('0xd')][_0x203bb4[_0x541a('0x1b')]]))this[_0x541a('0xd')][_0x203bb4[_0x541a('0x1b')]]={};logger[_0x541a('0x26')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x203bb4['uniqueid'],_0x203bb4[_0x541a('0x6b')],_0x203bb4['applicationdata']);var _0x2f30d=_0x203bb4['applicationdata'][_0x541a('0x70')]('=');var _0x145553=_0x2f30d[0x0][_0x541a('0x71')](/cdr\((.*)\)/);if(_0x145553)this[_0x541a('0xd')][_0x203bb4['uniqueid']][_0x145553[0x1]]=_0x2f30d[0x1];}}}}catch(_0x4d5ffb){logger[_0x541a('0x2c')](_0x541a('0x72'),_0x203bb4[_0x541a('0x1b')],util['inspect'](_0x4d5ffb,{'showHidden':![],'depth':null}));}};module[_0x541a('0x73')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 072ed37..bee8cd8 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4de7=['custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','set','appdata','CDR(routeAlias)','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','exports','lodash','util','md5','ioredis','../../../config/environment','../../../config/logger','../ami','../model/queueReport','redis','localhost','socket.io-emitter','prototype','enqueue','tail','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','syncFullyBooted','newexten','syncNewExten','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','isEmpty','hasOwnProperty','originated','talking','pTalking','unlockRR','switch','sequence','isNil','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkQueueReport]','inspect','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','sumDuration','sumHoldTime','type','abandoned','waiting','Trunk','active','callerid','Interval','stringify','voice_queue:save','isNotNull','loopQueueShow','clearZombieChannels','Action','queues','[voiceQueueReport][queues]','queuesummary','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedin','loggedIn','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','emitVoiceQueueChannelSave','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','add','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','variable','value','queuestatus','CONTINUE','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','EXITWITHKEY','[%s][voiceQueueReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','[%s][voiceQueueReport][hangup]','length','unmanaged','milliseconds','diff','total','sumBillable','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:'];(function(_0x4cf021,_0x25550e){var _0x23f9a5=function(_0x52b704){while(--_0x52b704){_0x4cf021['push'](_0x4cf021['shift']());}};_0x23f9a5(++_0x25550e);}(_0x4de7,0x1f3));var _0x74de=function(_0x3a1414,_0x1646b3){_0x3a1414=_0x3a1414-0x0;var _0x4afc89=_0x4de7[_0x3a1414];return _0x4afc89;};'use strict';var _=require(_0x74de('0x0'));var moment=require('moment');var util=require(_0x74de('0x1'));var md5=require(_0x74de('0x2'));var Redis=require(_0x74de('0x3'));var config=require(_0x74de('0x4'));var logger=require(_0x74de('0x5'))('ami');var ami=require(_0x74de('0x6'));var QueueReport=require(_0x74de('0x7'));config[_0x74de('0x8')]=_['defaults'](config[_0x74de('0x8')],{'host':_0x74de('0x9'),'port':0x18eb});var io=require(_0x74de('0xa'))(new Redis(config[_0x74de('0x8')]));var Sequence=function(){};Sequence[_0x74de('0xb')][_0x74de('0xc')]=function(_0x175c71){this[_0x74de('0xd')]=this[_0x74de('0xd')]?this[_0x74de('0xd')]['finally'](_0x175c71):_0x175c71();};function VoiceQueueReport(_0x2a4ded){this['sequence']=new Sequence();this[_0x74de('0xe')]={};this[_0x74de('0xf')]=_0x2a4ded['agents'];this[_0x74de('0x10')]=_0x2a4ded[_0x74de('0x11')];this[_0x74de('0x12')]=_0x2a4ded[_0x74de('0x12')];this[_0x74de('0x13')]=!![];this[_0x74de('0x14')]=_0x2a4ded['campaigns'];this[_0x74de('0x15')]={};ami['on']('queuesummary',this[_0x74de('0x16')][_0x74de('0x17')](this));ami['on'](_0x74de('0x18'),this['syncQueueSummaryComplete'][_0x74de('0x17')](this));ami['on'](_0x74de('0x19'),this['syncQueueCallerJoin'][_0x74de('0x17')](this));ami['on'](_0x74de('0x1a'),this[_0x74de('0x1b')][_0x74de('0x17')](this));ami['on'](_0x74de('0x1c'),this[_0x74de('0x1d')][_0x74de('0x17')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x74de('0x17')](this));ami['on'](_0x74de('0x1e'),this[_0x74de('0x1f')][_0x74de('0x17')](this));ami['on'](_0x74de('0x20'),this[_0x74de('0x21')]['bind'](this));ami['on'](_0x74de('0x22'),this[_0x74de('0x23')][_0x74de('0x17')](this));ami['on']('fullybooted',this[_0x74de('0x24')][_0x74de('0x17')](this));ami['on'](_0x74de('0x25'),this[_0x74de('0x26')]['bind'](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x74de('0x27'),this[_0x74de('0x28')]['bind'](this));ami['on']('attendedtransfer',this[_0x74de('0x29')][_0x74de('0x17')](this));ami['on'](_0x74de('0x2a'),this['syncBlindTransfer']['bind'](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x2ddb31){if(!_[_0x74de('0x2b')](_0x2ddb31)){for(var _0x36b4f8 in _0x2ddb31){if(_0x2ddb31[_0x74de('0x2c')](_0x36b4f8)){delete _0x2ddb31[_0x36b4f8];}}}}function clearCampaigns(_0x4f6029){if(!_[_0x74de('0x2b')](_0x4f6029)){for(var _0x37626b in _0x4f6029){if(_0x4f6029[_0x74de('0x2c')](_0x37626b)){_0x4f6029[_0x37626b][_0x74de('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3ef29a){if(!_[_0x74de('0x2b')](_0x3ef29a)){for(var _0x269de8 in _0x3ef29a){if(_0x3ef29a[_0x74de('0x2c')](_0x269de8)){_0x3ef29a[_0x269de8][_0x74de('0x2d')]=0x0;_0x3ef29a[_0x269de8][_0x74de('0x2e')]=0x0;_0x3ef29a[_0x269de8][_0x74de('0x2f')]=0x0;_0x3ef29a[_0x269de8]['waiting']=0x0;_0x3ef29a[_0x269de8]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x1d3504){if(!_[_0x74de('0x2b')](_0x1d3504)){for(var _0x31147f in _0x1d3504){if(_0x1d3504['hasOwnProperty'](_0x31147f)){_0x1d3504[_0x31147f][_0x74de('0x30')]=!![];}}}}VoiceQueueReport[_0x74de('0xb')]['clearZombieChannels']=function(){var _0x1cd58b=this;for(var _0x120559 in this[_0x74de('0x10')]){if(this['channels'][_0x74de('0x2c')](_0x120559)&&!this[_0x74de('0x10')][_0x120559][_0x74de('0x31')]){this[_0x74de('0x32')][_0x74de('0xc')](function(){if(!_[_0x74de('0x33')](_0x1cd58b[_0x74de('0x10')][_0x120559])){return ami['Action']({'action':'status','channel':_0x1cd58b[_0x74de('0x10')][_0x120559][_0x74de('0x34')]})[_0x74de('0x35')](function(_0x383d34){if(_0x383d34[_0x74de('0x36')]===_0x74de('0x37')){setTimeout(function(){if(_0x1cd58b[_0x74de('0x10')][_0x120559]){delete _0x1cd58b['channels'][_0x120559];logger[_0x74de('0x38')]('[%s][voiceQueueReport][checkChannel]',_0x120559,util['inspect'](_0x383d34,{'showHidden':![],'depth':null}));}if(_0x1cd58b[_0x74de('0xe')][_0x120559]){delete _0x1cd58b['queueReports'][_0x120559];logger[_0x74de('0x38')](_0x74de('0x39'),_0x120559,util[_0x74de('0x3a')](_0x383d34,{'showHidden':![],'depth':null}));}if(_0x1cd58b['variables'][_0x120559]){delete _0x1cd58b[_0x74de('0x15')][_0x120559];logger[_0x74de('0x38')]('[%s][voiceQueueReport][checkVariables]',_0x120559,util['inspect'](_0x383d34,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x74de('0xb')][_0x74de('0x24')]=function(){logger['error'](_0x74de('0x3b'));clearChannels(this[_0x74de('0x10')]);this['clearQueueReport'](this[_0x74de('0xe')]);clearAgentBooked(this[_0x74de('0xf')]);clearVoiceQueues(this[_0x74de('0x12')]);clearCampaigns(this[_0x74de('0x14')]);};VoiceQueueReport['prototype'][_0x74de('0x3c')]=function(_0x4f6921){var _0x3dc9fc=this;if(!_[_0x74de('0x2b')](_0x4f6921)){for(var _0x5ddb16 in _0x4f6921){if(_0x4f6921[_0x74de('0x2c')](_0x5ddb16)){_0x3dc9fc['emitVoiceQueueChannelRemove'](_0x4f6921[_0x5ddb16],'clearqueuereport');delete _0x4f6921[_0x5ddb16];}}}};VoiceQueueReport[_0x74de('0xb')][_0x74de('0x3d')]=function(_0x4a1c6b,_0x3a0fda,_0x62c886){io['to'](_0x4a1c6b)[_0x74de('0x3d')](_0x3a0fda,_0x62c886);};VoiceQueueReport['prototype']['emitVoiceQueueChannelSave']=function(_0x1511e1,_0x1cac02){logger[_0x74de('0x3e')](_0x74de('0x3f')+_0x1cac02+_0x74de('0x40'),_0x1511e1[_0x74de('0x41')],util[_0x74de('0x3a')](_0x1511e1,{'showHidden':![],'depth':null}));this[_0x74de('0x3d')](util[_0x74de('0x42')]('voice:queue:%s',_0x1511e1['name']),'voice_queue_channel:save',_0x1511e1);io[_0x74de('0x3d')](_0x74de('0x43'),_0x1511e1);};VoiceQueueReport[_0x74de('0xb')][_0x74de('0x44')]=function(_0x287b0b,_0x472581){logger[_0x74de('0x3e')](_0x74de('0x3f')+_0x472581+_0x74de('0x45'),_0x287b0b[_0x74de('0x41')],util[_0x74de('0x3a')](_0x287b0b,{'showHidden':![],'depth':null}));this[_0x74de('0x3d')](util['format'](_0x74de('0x46'),_0x287b0b[_0x74de('0x47')]),_0x74de('0x48'),_0x287b0b);io[_0x74de('0x3d')](_0x74de('0x49'),_0x287b0b);};VoiceQueueReport[_0x74de('0xb')][_0x74de('0x4a')]=function(_0x3406fb,_0x47299c){if(_0x3406fb['type']===_0x74de('0x4b')){var _0x3cd0c8={'id':_0x3406fb['id'],'name':_0x3406fb[_0x74de('0x47')],'strategy':_0x3406fb[_0x74de('0x4c')],'answered':_0x3406fb[_0x74de('0x4d')],'available':_0x3406fb[_0x74de('0x4e')],'loggedIn':_0x3406fb['loggedIn'],'pTalking':_0x3406fb['pTalking'],'sumBillable':_0x3406fb['sumBillable'],'sumDuration':_0x3406fb[_0x74de('0x4f')],'sumHoldTime':_0x3406fb[_0x74de('0x50')]||0x0,'talking':_0x3406fb['talking'],'total':_0x3406fb['total'],'type':_0x3406fb[_0x74de('0x51')],'unmanaged':_0x3406fb['unmanaged'],'abandoned':_0x3406fb[_0x74de('0x52')],'waiting':_0x3406fb[_0x74de('0x53')]};if(_0x3406fb[_0x74de('0x54')]){_0x3cd0c8['Trunk']={'id':_0x3406fb[_0x74de('0x54')]['id'],'name':_0x3406fb[_0x74de('0x54')][_0x74de('0x47')],'active':_0x3406fb[_0x74de('0x54')][_0x74de('0x55')],'callerid':_0x3406fb[_0x74de('0x54')][_0x74de('0x56')]};}if(_0x3406fb[_0x74de('0x57')]){_0x3cd0c8['Interval']={'id':_0x3406fb[_0x74de('0x57')]['id'],'name':_0x3406fb[_0x74de('0x57')]['name']};}var _0x354d30=md5(JSON[_0x74de('0x58')](_0x3cd0c8));if(_0x3406fb[_0x74de('0x2')]!==_0x354d30){_0x3406fb[_0x74de('0x2')]=_0x354d30;logger['debug']('[voiceQueueReport]['+_0x47299c+']\x20sending\x20voice_queue:save\x20event:',util[_0x74de('0x3a')](_0x3cd0c8,{'showHidden':![],'depth':null}));this[_0x74de('0x3d')](util[_0x74de('0x42')](_0x74de('0x46'),_0x3cd0c8[_0x74de('0x47')]),_0x74de('0x59'),_0x3cd0c8);}}};VoiceQueueReport[_0x74de('0xb')][_0x74de('0x5a')]=function(_0x3e938e){return _0x3e938e!==null&&!_['isUndefined'](_0x3e938e);};VoiceQueueReport[_0x74de('0xb')][_0x74de('0x5b')]=function(){var _0x86b4cd=this;setInterval(function(){_0x86b4cd[_0x74de('0x5c')]();ami[_0x74de('0x5d')]({'action':_0x74de('0x5e')})[_0x74de('0x35')](function(_0xc7f622){logger[_0x74de('0x38')](_0x74de('0x5f'),util[_0x74de('0x3a')](_0xc7f622,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x4716d5=this;setInterval(function(){if(_0x4716d5[_0x74de('0x13')]){return ami['Action']({'action':_0x74de('0x60')})[_0x74de('0x61')](function(_0x35138c){_0x4716d5[_0x74de('0x13')]=![];})[_0x74de('0x35')](function(_0x3559f0){logger[_0x74de('0x38')](_0x74de('0x62'),util[_0x74de('0x3a')](_0x3559f0,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x74de('0xb')][_0x74de('0x16')]=function(_0x537e05){try{if(this[_0x74de('0x5a')](_0x537e05)&&this[_0x74de('0x5a')](_0x537e05[_0x74de('0x63')])){logger['debug'](_0x74de('0x64'),util[_0x74de('0x3a')](_0x537e05,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x537e05[_0x74de('0x63')]]){logger[_0x74de('0x65')](_0x74de('0x66'),_0x537e05[_0x74de('0x63')]);var _0x42f5cc=_['countBy'](this[_0x74de('0x10')],_0x74de('0x63'))[_0x537e05[_0x74de('0x63')]]||0x0;var _0x186001=_0x42f5cc-_0x537e05[_0x74de('0x67')];if(this['voiceQueues'][_0x537e05[_0x74de('0x63')]][_0x74de('0x53')]!==_[_0x74de('0x68')](_0x537e05['callers'])||this[_0x74de('0x12')][_0x537e05['queue']]['loggedIn']!==_[_0x74de('0x68')](_0x537e05[_0x74de('0x69')])||this[_0x74de('0x12')][_0x537e05['queue']][_0x74de('0x4e')]!==_[_0x74de('0x68')](_0x537e05[_0x74de('0x4e')])||this[_0x74de('0x12')][_0x537e05[_0x74de('0x63')]]['talking']!==_0x186001){this[_0x74de('0x12')][_0x537e05[_0x74de('0x63')]][_0x74de('0x53')]=_['toNumber'](_0x537e05['callers']);this[_0x74de('0x12')][_0x537e05[_0x74de('0x63')]][_0x74de('0x6a')]=_['toNumber'](_0x537e05[_0x74de('0x69')]);this[_0x74de('0x12')][_0x537e05[_0x74de('0x63')]]['available']=_[_0x74de('0x68')](_0x537e05['available']);this[_0x74de('0x12')][_0x537e05[_0x74de('0x63')]][_0x74de('0x2e')]=_0x186001>0x0?_0x186001:0x0;this[_0x74de('0x12')][_0x537e05[_0x74de('0x63')]][_0x74de('0x2e')]=this['voiceQueues'][_0x537e05[_0x74de('0x63')]][_0x74de('0x2e')]>_['toNumber'](_0x537e05[_0x74de('0x69')])?_[_0x74de('0x68')](_0x537e05[_0x74de('0x69')]):this[_0x74de('0x12')][_0x537e05[_0x74de('0x63')]]['talking'];this[_0x74de('0x4a')](this[_0x74de('0x12')][_0x537e05[_0x74de('0x63')]],_0x74de('0x60'));}logger[_0x74de('0x3e')](_0x74de('0x6b'),util[_0x74de('0x3a')](this['voiceQueues'][_0x537e05['queue']],{'showHidden':![],'depth':null}));ami[_0x74de('0x3d')](_0x74de('0x6c'),this[_0x74de('0x12')][_0x537e05[_0x74de('0x63')]]);}}}catch(_0x42b11c){logger[_0x74de('0x38')](_0x74de('0x62'),util[_0x74de('0x3a')](_0x42b11c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74de('0xb')]['syncQueueSummaryComplete']=function(_0x2fcd73){logger[_0x74de('0x3e')](_0x74de('0x6d'),util[_0x74de('0x3a')](_0x2fcd73,{'showHidden':![],'depth':null}));this[_0x74de('0x13')]=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0xe0b469){try{if(this[_0x74de('0x5a')](_0xe0b469)){logger[_0x74de('0x3e')]('[%s][voiceQueueReport][queuecallerjoin]',_0xe0b469['uniqueid'],util[_0x74de('0x3a')](_0xe0b469,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x74de('0xe')][_0xe0b469['uniqueid']]))this['queueReports'][_0xe0b469[_0x74de('0x41')]]=[];if(_[_0x74de('0x6e')](this[_0x74de('0x10')][_0xe0b469[_0x74de('0x41')]]))this[_0x74de('0x10')][_0xe0b469[_0x74de('0x41')]]={};var _0x3b0496=new QueueReport();_0x3b0496['name']=_0xe0b469[_0x74de('0x63')];_0x3b0496[_0x74de('0x51')]=this[_0x74de('0x12')][_0x3b0496[_0x74de('0x47')]]&&this[_0x74de('0x12')][_0x3b0496['name']][_0x74de('0x51')]?this[_0x74de('0x12')][_0x3b0496[_0x74de('0x47')]][_0x74de('0x51')]||_0x74de('0x4b'):_0x74de('0x4b');_0x3b0496[_0x74de('0x63')]=_0xe0b469[_0x74de('0x63')];_0x3b0496[_0x74de('0x6f')]=moment()[_0x74de('0x42')](_0x74de('0x70'));_0x3b0496[_0x74de('0x71')]=_0xe0b469[_0x74de('0x71')];_0x3b0496[_0x74de('0x72')]=_0xe0b469[_0x74de('0x72')];_0x3b0496[_0x74de('0x41')]=_0xe0b469[_0x74de('0x41')];_0x3b0496[_0x74de('0x73')]=this[_0x74de('0x10')][_0xe0b469[_0x74de('0x41')]][_0x74de('0x73')];logger['info'](_0x74de('0x74'),_0x3b0496[_0x74de('0x47')],_0x3b0496[_0x74de('0x51')]);_[_0x74de('0x75')](_0x3b0496,_[_0x74de('0x76')](_0xe0b469,_[_0x74de('0x77')](_0x3b0496)));this[_0x74de('0xe')][_0xe0b469[_0x74de('0x41')]][_0x74de('0x78')](_0x3b0496);this['channels'][_0xe0b469['uniqueid']]=_0x3b0496;this['emitVoiceQueueChannelSave'](_0x3b0496,_0x74de('0x19'));}}catch(_0x5a53e7){logger['error'](_0x74de('0x79'),_0xe0b469[_0x74de('0x41')],util[_0x74de('0x3a')](_0x5a53e7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74de('0xb')][_0x74de('0x1b')]=function(_0x1b2c02){try{if(this[_0x74de('0x5a')](_0x1b2c02)){logger['debug'](_0x74de('0x7a'),_0x1b2c02[_0x74de('0x41')],util['inspect'](_0x1b2c02,{'showHidden':![],'depth':null}));if(this[_0x74de('0xe')][_0x1b2c02['uniqueid']]){var _0xa03888=_['last'](this[_0x74de('0xe')][_0x1b2c02['uniqueid']]);_0xa03888[_0x74de('0x7b')]=![];_0xa03888['queuecallercompleteAt']=null;_0xa03888[_0x74de('0x7c')]=_0x1b2c02[_0x74de('0x7c')];_0xa03888['originalposition']=_0x1b2c02[_0x74de('0x7d')];_0xa03888['queuecallerabandon']=!![];_0xa03888[_0x74de('0x7e')]=moment()[_0x74de('0x42')](_0x74de('0x70'));_0xa03888[_0x74de('0x7f')]=_0x74de('0x80');_0xa03888[_0x74de('0x81')]=null;logger[_0x74de('0x65')](_0x74de('0x82'),_0xa03888['name'],_0xa03888[_0x74de('0x51')]);this[_0x74de('0x10')][_0x1b2c02[_0x74de('0x41')]]=_0xa03888;this['emitVoiceQueueChannelRemove'](_0xa03888,'queuecallerabandon');}}}catch(_0x44eaef){logger[_0x74de('0x38')](_0x74de('0x7a'),_0x1b2c02['uniqueid'],util[_0x74de('0x3a')](_0x44eaef,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x74de('0x1d')]=function(_0x30d0d4){try{if(this[_0x74de('0x5a')](_0x30d0d4)){logger[_0x74de('0x3e')](_0x74de('0x83'),_0x30d0d4[_0x74de('0x41')],util[_0x74de('0x3a')](_0x30d0d4,{'showHidden':![],'depth':null}));if(this[_0x74de('0xe')][_0x30d0d4[_0x74de('0x41')]]){var _0x42b4dd=_[_0x74de('0x84')](this[_0x74de('0xe')][_0x30d0d4[_0x74de('0x41')]]);_0x42b4dd[_0x74de('0x85')]=moment()['format'](_0x74de('0x70'));_0x42b4dd['connectedlinenum']=_0x30d0d4[_0x74de('0x86')];_0x42b4dd[_0x74de('0x87')]=_0x30d0d4['connectedlinename'];logger[_0x74de('0x65')](_0x74de('0x88'),_0x42b4dd[_0x74de('0x47')],_0x42b4dd['type'],_0x30d0d4[_0x74de('0x86')],_0x30d0d4[_0x74de('0x87')]);this[_0x74de('0x10')][_0x30d0d4[_0x74de('0x41')]]=_0x42b4dd;this[_0x74de('0x89')](_0x42b4dd,_0x74de('0x1c'));}}}catch(_0x318fab){logger[_0x74de('0x38')]('[%s][voiceQueueReport][queuecallerleave]',_0x30d0d4[_0x74de('0x41')],util[_0x74de('0x3a')](_0x318fab,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x74de('0x1f')]=function(_0x358424){try{if(this[_0x74de('0x5a')](_0x358424)){logger['debug'](_0x74de('0x8a'),_0x358424['uniqueid'],util['inspect'](_0x358424,{'showHidden':![],'depth':null}));if(this[_0x74de('0xe')][_0x358424[_0x74de('0x41')]]){var _0x19ffc1=_['last'](this[_0x74de('0xe')][_0x358424['uniqueid']]);_0x19ffc1[_0x74de('0x7b')]=!![];_0x19ffc1[_0x74de('0x7f')]='COMPLETEDBYAGENT';logger['info'](_0x74de('0x8b'),_0x19ffc1[_0x74de('0x47')],_0x19ffc1['type']);}}}catch(_0x5da9eb){logger['error'](_0x74de('0x8a'),_0x358424[_0x74de('0x41')],util['inspect'](_0x5da9eb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74de('0xb')]['syncAgentComplete']=function(_0x373138){try{if(this[_0x74de('0x5a')](_0x373138)){logger[_0x74de('0x3e')](_0x74de('0x8c'),_0x373138[_0x74de('0x41')],util['inspect'](_0x373138,{'showHidden':![],'depth':null}));if(this[_0x74de('0xe')][_0x373138[_0x74de('0x41')]]){var _0x5282c9=_['last'](this['queueReports'][_0x373138[_0x74de('0x41')]]);_0x5282c9[_0x74de('0x1a')]=![];_0x5282c9[_0x74de('0x7e')]=null;_0x5282c9[_0x74de('0x8d')]=!![];_0x5282c9['lastAssignedTo']=_0x373138[_0x74de('0x8e')];_0x5282c9[_0x74de('0x7c')]=_0x373138['holdtime'];_0x5282c9['queuecallercomplete']=!![];_0x5282c9[_0x74de('0x8f')]=![];_0x5282c9['queuecallerexitAt']=null;if(!_0x5282c9[_0x74de('0x90')]){if(_0x373138[_0x74de('0x91')]==_0x74de('0x90')){_0x5282c9[_0x74de('0x7f')]=_0x74de('0x92');logger[_0x74de('0x65')](_0x74de('0x93'),_0x5282c9[_0x74de('0x47')],_0x5282c9[_0x74de('0x51')]);}else{if(_[_0x74de('0x94')](_0x373138[_0x74de('0x34')][_0x74de('0x95')](),_0x74de('0x96'))){if(this[_0x74de('0xe')][_0x373138[_0x74de('0x97')]]){var _0x3b398c=_[_0x74de('0x84')](this[_0x74de('0xe')][_0x373138[_0x74de('0x97')]]);_0x3b398c[_0x74de('0x7b')]=![];_0x3b398c[_0x74de('0x8f')]=!![];_0x3b398c[_0x74de('0x98')]=moment(_0x5282c9['queuecallerjoinAt'])[_0x74de('0x99')](_0x373138['holdtime'],_0x74de('0x9a'))['format'](_0x74de('0x70'));_0x3b398c[_0x74de('0x7f')]='FORWARDTRANSFER';_0x3b398c[_0x74de('0x90')]=!![];_0x3b398c[_0x74de('0x9b')]=_0x74de('0x9c');_0x3b398c[_0x74de('0x9d')]=_0x373138[_0x74de('0x9e')];_0x3b398c[_0x74de('0x9f')]=_0x373138['uniqueid'];logger['info'](_0x74de('0xa0'),_0x3b398c[_0x74de('0x47')],_0x3b398c['type']);var _0x3b731e=this[_0x74de('0xe')][_0x373138[_0x74de('0x97')]];this[_0x74de('0xe')][_0x373138[_0x74de('0x97')]]=this['queueReports'][_0x373138[_0x74de('0x41')]];this[_0x74de('0xe')][_0x373138[_0x74de('0x41')]]=_0x3b731e;}}else{_0x5282c9[_0x74de('0x7f')]=_0x74de('0xa1')+_0x373138[_0x74de('0x91')][_0x74de('0xa2')]();logger[_0x74de('0x65')](_0x74de('0xa3'),_0x5282c9['name'],_0x5282c9['type'],_0x5282c9[_0x74de('0x7f')]);}}}this['channels'][_0x373138[_0x74de('0x41')]]=_0x5282c9;this[_0x74de('0x44')](_0x5282c9,_0x74de('0xa4'));}}}catch(_0x53ed84){logger['error'](_0x74de('0x8c'),_0x373138[_0x74de('0x41')],util[_0x74de('0x3a')](_0x53ed84,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74de('0xb')]['syncVarSet']=function(_0x31c17c){try{if(this[_0x74de('0x5a')](_0x31c17c)){logger['debug']('[%s][voiceQueueReport][varset]',_0x31c17c[_0x74de('0x41')],util[_0x74de('0x3a')](_0x31c17c,{'showHidden':![],'depth':null}));this['addVariable'](_0x31c17c[_0x74de('0x41')],_['keys'](_0x31c17c[_0x74de('0xa5')])[0x0],_0x31c17c[_0x74de('0xa6')]);if(this[_0x74de('0xe')][_0x31c17c['uniqueid']]){var _0x52b679=_['last'](this[_0x74de('0xe')][_0x31c17c['uniqueid']]);if(_0x52b679){if(this[_0x74de('0x5a')](_0x31c17c[_0x74de('0xa5')])&&this[_0x74de('0x5a')](_0x31c17c[_0x74de('0xa5')][_0x74de('0xa7')])){switch(_0x31c17c[_0x74de('0xa6')]){case _0x74de('0xa8'):_0x52b679[_0x74de('0x8f')]=![];_0x52b679[_0x74de('0x98')]=null;break;case'TIMEOUT':_0x52b679[_0x74de('0xa9')]='timeout';_0x52b679['queuecallerexit']=!![];_0x52b679[_0x74de('0x98')]=moment()['format'](_0x74de('0x70'));_0x52b679['queuecallerleaveAt']=moment()[_0x74de('0x42')](_0x74de('0x70'));logger[_0x74de('0x3e')](_0x74de('0xaa'),_0x31c17c[_0x74de('0x41')],util[_0x74de('0x3a')](_0x52b679,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x52b679);break;default:_0x52b679[_0x74de('0x8f')]=!![];_0x52b679[_0x74de('0x98')]=moment()[_0x74de('0x42')](_0x74de('0x70'));_0x52b679[_0x74de('0x85')]=moment()[_0x74de('0x42')]('YYYY-MM-DD\x20HH:mm:ss');}_0x52b679[_0x74de('0x1a')]=![];_0x52b679[_0x74de('0x7e')]=null;_0x52b679[_0x74de('0x7f')]=_0x31c17c[_0x74de('0xa6')];this[_0x74de('0x10')][_0x31c17c['uniqueid']]=_0x52b679;this[_0x74de('0x44')](_0x52b679,_0x74de('0x20'));}else if(this[_0x74de('0x5a')](_0x31c17c[_0x74de('0xa5')])&&this['isNotNull'](_0x31c17c[_0x74de('0xa5')]['queueposition'])){if(!_0x52b679[_0x74de('0x1a')]){_0x52b679['queuecallerexit']=!![];_0x52b679['queuecallerexitAt']=moment()[_0x74de('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x52b679[_0x74de('0x7f')]=_0x74de('0xab');_0x52b679['queuecallerleaveAt']=moment()[_0x74de('0x42')](_0x74de('0x70'));this[_0x74de('0x10')][_0x31c17c[_0x74de('0x41')]]=_0x52b679;}}logger[_0x74de('0x65')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x31c17c[_0x74de('0x41')],_0x52b679['name'],_0x52b679[_0x74de('0x51')],_[_0x74de('0x77')](_0x31c17c['variable'])[0x0],_0x31c17c['value']);_0x52b679['variables']=this['variables'][_0x31c17c[_0x74de('0x41')]];}}}}catch(_0x2d7d83){logger['error'](_0x74de('0xac'),_0x31c17c[_0x74de('0x41')],util['inspect'](_0x2d7d83,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74de('0xb')][_0x74de('0xad')]=function(_0x17cbac,_0x13f2b4,_0x57111f){var _0x576fa5=[_0x74de('0xae'),_0x74de('0xaf'),'rtpaudioqosjitter',_0x74de('0xb0'),_0x74de('0xb1'),_0x74de('0xb2'),_0x74de('0xb3'),_0x74de('0xb4'),_0x74de('0xb5'),_0x74de('0xb6'),'bridgepeer','bridgepvtcallid',_0x74de('0xb7'),_0x74de('0xb8'),_0x74de('0xb9'),'memberlastcall',_0x74de('0x8e'),_0x74de('0xba'),_0x74de('0xbb')];if(!_[_0x74de('0x33')](_0x13f2b4)&&!_['includes'](_0x576fa5,_0x13f2b4)){if(_[_0x74de('0x6e')](this[_0x74de('0x15')][_0x17cbac])){this[_0x74de('0x15')][_0x17cbac]={};}this[_0x74de('0x15')][_0x17cbac][_0x13f2b4]=_0x57111f;}};VoiceQueueReport[_0x74de('0xb')][_0x74de('0x23')]=function(_0x55c233){try{if(this[_0x74de('0x5a')](_0x55c233)){logger[_0x74de('0x3e')](_0x74de('0xbc'),_0x55c233[_0x74de('0x41')],util[_0x74de('0x3a')](_0x55c233,{'showHidden':![],'depth':null}));if(this[_0x74de('0xe')][_0x55c233[_0x74de('0x41')]]){for(var _0x54c494=0x0,_0x4d1268={};_0x54c4940x0?_0x44a950:0x0;this[_0x3deb('0x12')][_0x4195b5['queue']][_0x3deb('0x31')]=this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x31')]>_[_0x3deb('0x6e')](_0x4195b5[_0x3deb('0x70')])?_['toNumber'](_0x4195b5[_0x3deb('0x70')]):this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x31')];this[_0x3deb('0x50')](this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]],'queuesummary');}logger[_0x3deb('0x47')](_0x3deb('0x73'),util[_0x3deb('0x3f')](this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0x3deb('0x74'),this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]]);}}}catch(_0x2b7063){logger[_0x3deb('0x3d')](_0x3deb('0x75'),util[_0x3deb('0x3f')](_0x2b7063,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x19')]=function(_0xb05ab4){logger[_0x3deb('0x47')](_0x3deb('0x76'),util[_0x3deb('0x3f')](_0xb05ab4,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x1b')]=function(_0x17f3fe){try{if(this[_0x3deb('0x61')](_0x17f3fe)){logger[_0x3deb('0x47')](_0x3deb('0x77'),_0x17f3fe[_0x3deb('0x4a')],util['inspect'](_0x17f3fe,{'showHidden':![],'depth':null}));if(_[_0x3deb('0x62')](this[_0x3deb('0x10')][_0x17f3fe[_0x3deb('0x4a')]]))this[_0x3deb('0x10')][_0x17f3fe[_0x3deb('0x4a')]]=[];if(_[_0x3deb('0x62')](this[_0x3deb('0x35')][_0x17f3fe[_0x3deb('0x4a')]]))this[_0x3deb('0x35')][_0x17f3fe[_0x3deb('0x4a')]]={};var _0x1897f9=new QueueReport();_0x1897f9['name']=_0x17f3fe[_0x3deb('0x69')];_0x1897f9[_0x3deb('0x51')]=this['voiceQueues'][_0x1897f9[_0x3deb('0x53')]]&&this[_0x3deb('0x12')][_0x1897f9[_0x3deb('0x53')]]['type']?this[_0x3deb('0x12')][_0x1897f9['name']]['type']||_0x3deb('0x52'):'inbound';_0x1897f9[_0x3deb('0x69')]=_0x17f3fe[_0x3deb('0x69')];_0x1897f9[_0x3deb('0x78')]=moment()['format'](_0x3deb('0x79'));_0x1897f9['position']=_0x17f3fe[_0x3deb('0x7a')];_0x1897f9[_0x3deb('0x7b')]=_0x17f3fe[_0x3deb('0x7b')];_0x1897f9[_0x3deb('0x4a')]=_0x17f3fe['uniqueid'];_0x1897f9[_0x3deb('0x7c')]=this[_0x3deb('0x35')][_0x17f3fe[_0x3deb('0x4a')]][_0x3deb('0x7c')];logger[_0x3deb('0x6b')](_0x3deb('0x7d'),_0x1897f9[_0x3deb('0x53')],_0x1897f9['type']);_[_0x3deb('0x7e')](_0x1897f9,_['pick'](_0x17f3fe,_[_0x3deb('0x7f')](_0x1897f9)));this[_0x3deb('0x10')][_0x17f3fe[_0x3deb('0x4a')]][_0x3deb('0x80')](_0x1897f9);this[_0x3deb('0x35')][_0x17f3fe[_0x3deb('0x4a')]]=_0x1897f9;this['emitVoiceQueueChannelSave'](_0x1897f9,_0x3deb('0x1a'));}}catch(_0xd8b047){logger[_0x3deb('0x3d')](_0x3deb('0x77'),_0x17f3fe['uniqueid'],util['inspect'](_0xd8b047,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x48cfda){try{if(this[_0x3deb('0x61')](_0x48cfda)){logger[_0x3deb('0x47')](_0x3deb('0x81'),_0x48cfda[_0x3deb('0x4a')],util['inspect'](_0x48cfda,{'showHidden':![],'depth':null}));if(this[_0x3deb('0x10')][_0x48cfda[_0x3deb('0x4a')]]){var _0x300151=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x48cfda['uniqueid']]);_0x300151[_0x3deb('0x83')]=![];_0x300151['queuecallercompleteAt']=null;_0x300151[_0x3deb('0x84')]=_0x48cfda[_0x3deb('0x84')];_0x300151[_0x3deb('0x85')]=_0x48cfda[_0x3deb('0x85')];_0x300151[_0x3deb('0x86')]=!![];_0x300151[_0x3deb('0x87')]=moment()[_0x3deb('0x4b')](_0x3deb('0x79'));_0x300151[_0x3deb('0x88')]=_0x3deb('0x89');_0x300151[_0x3deb('0x8a')]=null;logger[_0x3deb('0x6b')](_0x3deb('0x8b'),_0x300151[_0x3deb('0x53')],_0x300151['type']);this[_0x3deb('0x35')][_0x48cfda[_0x3deb('0x4a')]]=_0x300151;this[_0x3deb('0x44')](_0x300151,'queuecallerabandon');}}}catch(_0x316b5e){logger[_0x3deb('0x3d')](_0x3deb('0x81'),_0x48cfda['uniqueid'],util['inspect'](_0x316b5e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x1d')]=function(_0x2eb8cf){try{if(this[_0x3deb('0x61')](_0x2eb8cf)){logger[_0x3deb('0x47')](_0x3deb('0x8c'),_0x2eb8cf['uniqueid'],util[_0x3deb('0x3f')](_0x2eb8cf,{'showHidden':![],'depth':null}));if(this[_0x3deb('0x10')][_0x2eb8cf[_0x3deb('0x4a')]]){var _0x42c042=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x2eb8cf[_0x3deb('0x4a')]]);_0x42c042['queuecallerleaveAt']=moment()[_0x3deb('0x4b')](_0x3deb('0x79'));_0x42c042['connectedlinenum']=_0x2eb8cf['connectedlinenum'];_0x42c042[_0x3deb('0x8d')]=_0x2eb8cf[_0x3deb('0x8d')];logger[_0x3deb('0x6b')](_0x3deb('0x8e'),_0x42c042[_0x3deb('0x53')],_0x42c042[_0x3deb('0x51')],_0x2eb8cf[_0x3deb('0x8f')],_0x2eb8cf[_0x3deb('0x8d')]);this[_0x3deb('0x35')][_0x2eb8cf[_0x3deb('0x4a')]]=_0x42c042;this['emitVoiceQueueChannelSave'](_0x42c042,_0x3deb('0x90'));}}}catch(_0x4eaf94){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x2eb8cf[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x4eaf94,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x4ca06d){try{if(this[_0x3deb('0x61')](_0x4ca06d)){logger[_0x3deb('0x47')](_0x3deb('0x91'),_0x4ca06d[_0x3deb('0x4a')],util['inspect'](_0x4ca06d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4ca06d[_0x3deb('0x4a')]]){var _0x465559=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x4ca06d['uniqueid']]);_0x465559[_0x3deb('0x83')]=!![];_0x465559[_0x3deb('0x88')]=_0x3deb('0x92');logger[_0x3deb('0x6b')](_0x3deb('0x93'),_0x465559[_0x3deb('0x53')],_0x465559[_0x3deb('0x51')]);}}}catch(_0x1b29f5){logger[_0x3deb('0x3d')]('[%s][voiceQueueReport][agentconnect]',_0x4ca06d[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x1b29f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x94')]=function(_0x1a8714){try{if(this[_0x3deb('0x61')](_0x1a8714)){logger['debug'](_0x3deb('0x95'),_0x1a8714['uniqueid'],util['inspect'](_0x1a8714,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1a8714[_0x3deb('0x4a')]]){var _0x57023f=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x4a')]]);_0x57023f[_0x3deb('0x86')]=![];_0x57023f[_0x3deb('0x87')]=null;_0x57023f[_0x3deb('0x96')]=!![];_0x57023f[_0x3deb('0x8a')]=_0x1a8714['membername'];_0x57023f[_0x3deb('0x84')]=_0x1a8714['holdtime'];_0x57023f[_0x3deb('0x83')]=!![];_0x57023f[_0x3deb('0x97')]=![];_0x57023f[_0x3deb('0x98')]=null;if(!_0x57023f[_0x3deb('0x99')]){if(_0x1a8714[_0x3deb('0x9a')]==_0x3deb('0x99')){_0x57023f[_0x3deb('0x88')]='COMPLETED';logger['info'](_0x3deb('0x9b'),_0x57023f['name'],_0x57023f[_0x3deb('0x51')]);}else{if(_[_0x3deb('0x9c')](_0x1a8714[_0x3deb('0x39')][_0x3deb('0x9d')](),_0x3deb('0x9e'))){if(this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x9f')]]){var _0x2cbdd5=_['last'](this[_0x3deb('0x10')][_0x1a8714['linkedid']]);_0x2cbdd5[_0x3deb('0x83')]=![];_0x2cbdd5[_0x3deb('0x97')]=!![];_0x2cbdd5[_0x3deb('0x98')]=moment(_0x57023f[_0x3deb('0x78')])[_0x3deb('0xa0')](_0x1a8714[_0x3deb('0x84')],'seconds')[_0x3deb('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x2cbdd5['queuecallerexitreason']=_0x3deb('0xa1');_0x2cbdd5[_0x3deb('0x99')]=!![];_0x2cbdd5[_0x3deb('0xa2')]='FORWARD';_0x2cbdd5[_0x3deb('0xa3')]=_0x1a8714['destexten'];_0x2cbdd5[_0x3deb('0xa4')]=_0x1a8714[_0x3deb('0x4a')];logger['info'](_0x3deb('0xa5'),_0x2cbdd5[_0x3deb('0x53')],_0x2cbdd5['type']);var _0x49647f=this['queueReports'][_0x1a8714[_0x3deb('0x9f')]];this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x9f')]]=this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x4a')]];this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x4a')]]=_0x49647f;}}else{_0x57023f['queuecallerexitreason']=_0x3deb('0xa6')+_0x1a8714[_0x3deb('0x9a')][_0x3deb('0xa7')]();logger[_0x3deb('0x6b')](_0x3deb('0xa8'),_0x57023f[_0x3deb('0x53')],_0x57023f[_0x3deb('0x51')],_0x57023f['queuecallerexitreason']);}}}this[_0x3deb('0x35')][_0x1a8714['uniqueid']]=_0x57023f;this[_0x3deb('0x44')](_0x57023f,'agentcomplete');}}}catch(_0x16ecc8){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x1a8714[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x16ecc8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x20')]=function(_0x3ef3a6){try{if(this[_0x3deb('0x61')](_0x3ef3a6)){logger[_0x3deb('0x47')](_0x3deb('0xa9'),_0x3ef3a6[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x3ef3a6,{'showHidden':![],'depth':null}));this[_0x3deb('0xaa')](_0x3ef3a6['uniqueid'],_[_0x3deb('0x7f')](_0x3ef3a6['variable'])[0x0],_0x3ef3a6[_0x3deb('0xab')]);if(this['queueReports'][_0x3ef3a6[_0x3deb('0x4a')]]){var _0x2f5739=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x3ef3a6[_0x3deb('0x4a')]]);if(_0x2f5739){if(this[_0x3deb('0x61')](_0x3ef3a6[_0x3deb('0xac')])&&this['isNotNull'](_0x3ef3a6[_0x3deb('0xac')][_0x3deb('0xad')])){switch(_0x3ef3a6[_0x3deb('0xab')]){case _0x3deb('0xae'):_0x2f5739[_0x3deb('0x97')]=![];_0x2f5739[_0x3deb('0x98')]=null;break;case'TIMEOUT':_0x2f5739[_0x3deb('0xaf')]=_0x3deb('0xb0');_0x2f5739[_0x3deb('0x97')]=!![];_0x2f5739[_0x3deb('0x98')]=moment()['format'](_0x3deb('0x79'));_0x2f5739['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x3ef3a6[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x2f5739,{'showHidden':![],'depth':null}));ami[_0x3deb('0x45')]('custom:timeout',_0x2f5739);break;default:_0x2f5739['queuecallerexit']=!![];_0x2f5739[_0x3deb('0x98')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f5739['queuecallerleaveAt']=moment()[_0x3deb('0x4b')](_0x3deb('0x79'));}_0x2f5739[_0x3deb('0x86')]=![];_0x2f5739[_0x3deb('0x87')]=null;_0x2f5739[_0x3deb('0x88')]=_0x3ef3a6[_0x3deb('0xab')];this[_0x3deb('0x35')][_0x3ef3a6['uniqueid']]=_0x2f5739;this[_0x3deb('0x44')](_0x2f5739,_0x3deb('0xb1'));}else if(this[_0x3deb('0x61')](_0x3ef3a6['variable'])&&this[_0x3deb('0x61')](_0x3ef3a6['variable'][_0x3deb('0xb2')])){if(!_0x2f5739[_0x3deb('0x86')]){_0x2f5739[_0x3deb('0x97')]=!![];_0x2f5739['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f5739['queuecallerexitreason']=_0x3deb('0xb3');_0x2f5739[_0x3deb('0xb4')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3ef3a6[_0x3deb('0x4a')]]=_0x2f5739;}}logger[_0x3deb('0x6b')](_0x3deb('0xb5'),_0x3ef3a6[_0x3deb('0x4a')],_0x2f5739[_0x3deb('0x53')],_0x2f5739[_0x3deb('0x51')],_[_0x3deb('0x7f')](_0x3ef3a6[_0x3deb('0xac')])[0x0],_0x3ef3a6['value']);_0x2f5739[_0x3deb('0x15')]=this[_0x3deb('0x15')][_0x3ef3a6['uniqueid']];}}}}catch(_0x562f9b){logger['error'](_0x3deb('0xa9'),_0x3ef3a6['uniqueid'],util[_0x3deb('0x3f')](_0x562f9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0xaa')]=function(_0xb65abb,_0x508f6b,_0x5a18c0){var _0x423278=[_0x3deb('0xb6'),_0x3deb('0xb7'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x3deb('0xb8'),_0x3deb('0xb9'),_0x3deb('0xba'),'rtpaudioqosrttbridged',_0x3deb('0xbb'),_0x3deb('0xbc'),_0x3deb('0xbd'),_0x3deb('0xbe'),_0x3deb('0xbf'),_0x3deb('0xc0'),_0x3deb('0xc1'),_0x3deb('0xc2'),_0x3deb('0xc3'),_0x3deb('0xc4'),_0x3deb('0xc5')];if(!_[_0x3deb('0x37')](_0x508f6b)&&!_[_0x3deb('0xc6')](_0x423278,_0x508f6b)){if(_[_0x3deb('0x62')](this[_0x3deb('0x15')][_0xb65abb])){this['variables'][_0xb65abb]={};}this[_0x3deb('0x15')][_0xb65abb][_0x508f6b]=_0x5a18c0;}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x22')]=function(_0x5639bc){try{if(this[_0x3deb('0x61')](_0x5639bc)){logger[_0x3deb('0x47')](_0x3deb('0xc7'),_0x5639bc[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x5639bc,{'showHidden':![],'depth':null}));if(this[_0x3deb('0x10')][_0x5639bc['uniqueid']]){for(var _0x2a909c=0x0,_0x1760c6={};_0x2a909c=0x0?moment(_0x3fede3[_0x0c5c('0x18')])[_0x0c5c('0xb')](_0x3fede3[_0x0c5c('0x17')],'seconds'):null,'data1':_0x0c5c('0x19'),'data2':_0x3fede3[_0x0c5c('0x11')],'data3':_0x3fede3['exten'],'data4':_0x3fede3[_0x0c5c('0x1a')]||null,'role':'agent','internal':_0x3fede3['accountcode']?_[_0x0c5c('0x12')](_0x3fede3[_0x0c5c('0x11')]):undefined,'uniqueid':_0x3fede3[_0x0c5c('0x1b')]},'log':_0x0c5c('0x5')});}; \ No newline at end of file +var _0xd8d4=['SIP/%s','queuecallerleaveAt','diff','seconds','exten','queue','agent','accountcode','uniqueid','voiceDialReport','TALKING','starttime','endtime','outbound','dialstring','toNumber','moment','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format'];(function(_0x50c40d,_0x5e5fec){var _0x10cc89=function(_0x3681fd){while(--_0x3681fd){_0x50c40d['push'](_0x50c40d['shift']());}};_0x10cc89(++_0x5e5fec);}(_0xd8d4,0x1e0));var _0x4d8d=function(_0x4a3aa9,_0x5cbaed){_0x4a3aa9=_0x4a3aa9-0x0;var _0x40b796=_0xd8d4[_0x4a3aa9];return _0x40b796;};'use strict';var moment=require(_0x4d8d('0x0'));var _=require(_0x4d8d('0x1'));var util=require('util');var client=require(_0x4d8d('0x2'));exports[_0x4d8d('0x3')]=function(_0x575306){var _0x2af9da=_0x575306[_0x4d8d('0x4')]||_0x575306[_0x4d8d('0x5')];return client[_0x4d8d('0x6')](_0x4d8d('0x7'),{'body':{'channel':_0x4d8d('0x8'),'membername':_0x575306[_0x4d8d('0x9')],'interface':_[_0x4d8d('0xa')](_0x575306[_0x4d8d('0xb')])?util[_0x4d8d('0xc')](_0x4d8d('0xd'),_0x575306[_0x4d8d('0x9')]):_0x575306[_0x4d8d('0xb')],'type':'TALKING','enterAt':_0x575306[_0x4d8d('0xe')],'exitAt':_0x2af9da,'duration':moment(_0x2af9da)[_0x4d8d('0xf')](_0x575306[_0x4d8d('0xe')],_0x4d8d('0x10')),'data1':'inbound','data2':_0x575306['calleridnum'],'data3':_0x575306[_0x4d8d('0x11')],'data4':null,'data5':_0x575306[_0x4d8d('0x12')],'role':_0x4d8d('0x13'),'internal':_0x575306[_0x4d8d('0x14')]?_['toNumber'](_0x575306[_0x4d8d('0x14')]):undefined,'uniqueid':_0x575306[_0x4d8d('0x15')]},'log':_0x4d8d('0x7')});};exports[_0x4d8d('0x16')]=function(_0x526d30){return client[_0x4d8d('0x6')](_0x4d8d('0x7'),{'body':{'channel':_0x4d8d('0x8'),'membername':_0x526d30['membername'],'interface':_0x526d30[_0x4d8d('0xb')],'type':_0x4d8d('0x17'),'enterAt':_0x526d30[_0x4d8d('0x18')],'exitAt':_0x526d30[_0x4d8d('0x19')],'duration':moment(_0x526d30[_0x4d8d('0x19')])[_0x4d8d('0xf')](_0x526d30['starttime'],'seconds')>=0x0?moment(_0x526d30[_0x4d8d('0x19')])[_0x4d8d('0xf')](_0x526d30[_0x4d8d('0x18')],_0x4d8d('0x10')):null,'data1':_0x4d8d('0x1a'),'data2':_0x526d30[_0x4d8d('0x14')],'data3':_0x526d30[_0x4d8d('0x11')],'data4':_0x526d30[_0x4d8d('0x1b')]||null,'role':'agent','internal':_0x526d30['accountcode']?_[_0x4d8d('0x1c')](_0x526d30[_0x4d8d('0x14')]):undefined,'uniqueid':_0x526d30[_0x4d8d('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 4682c69..17f898f 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 _0x2182=['getSettings','Request','ShowSetting','GetSettings','../client'];(function(_0x10b521,_0x2166c4){var _0x353570=function(_0x2b8117){while(--_0x2b8117){_0x10b521['push'](_0x10b521['shift']());}};_0x353570(++_0x2166c4);}(_0x2182,0xea));var _0x2218=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2182[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x2218('0x0'));exports[_0x2218('0x1')]=function(){return client[_0x2218('0x2')](_0x2218('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x2218('0x4')});}; \ No newline at end of file +var _0xd73a=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','../client'];(function(_0x13c651,_0x29b9a3){var _0x4639cc=function(_0x51b8a8){while(--_0x51b8a8){_0x13c651['push'](_0x13c651['shift']());}};_0x4639cc(++_0x29b9a3);}(_0xd73a,0x171));var _0xad73=function(_0x13ab72,_0x197b95){_0x13ab72=_0x13ab72-0x0;var _0x1a46db=_0xd73a[_0x13ab72];return _0x1a46db;};'use strict';var client=require(_0xad73('0x0'));exports[_0xad73('0x1')]=function(){return client[_0xad73('0x2')](_0xad73('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xad73('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 78c55bc..fe3cb0e 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 _0x276e=['html','../client','getTemplates','Request','GetTemplate'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x276e,0xec));var _0xe276=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x276e[_0x1a36a5];return _0x746243;};'use strict';var client=require(_0xe276('0x0'));exports[_0xe276('0x1')]=function(_0x336ef7){return function(_0x4dcc53){return client[_0xe276('0x2')](_0xe276('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0xe276('0x4')]},'log':_0xe276('0x3')});};}; \ No newline at end of file +var _0xf739=['html','../client','GetTemplate','name'];(function(_0x3d79e9,_0xcd400a){var _0x2c3e24=function(_0x4dc8a4){while(--_0x4dc8a4){_0x3d79e9['push'](_0x3d79e9['shift']());}};_0x2c3e24(++_0xcd400a);}(_0xf739,0x81));var _0x9f73=function(_0x588981,_0x5706bd){_0x588981=_0x588981-0x0;var _0x3eb575=_0xf739[_0x588981];return _0x3eb575;};'use strict';var client=require(_0x9f73('0x0'));exports['getTemplates']=function(_0x3834a9){return function(_0x126d59){return client['Request'](_0x9f73('0x1'),{'options':{'raw':!![],'attributes':['id',_0x9f73('0x2'),_0x9f73('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index ba38fc8..e186587 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 _0x0c8e=['name','channel','status','AllConditions','field','value','Condition','operator','Action','Actions','action','data1','data2','data3','data4','data5','data7','../client','Request','GetTrigger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0c8e,0x18d));var _0xe0c8=function(_0x2b79f0,_0x483415){_0x2b79f0=_0x2b79f0-0x0;var _0x2c48d9=_0x0c8e[_0x2b79f0];return _0x2c48d9;};'use strict';var client=require(_0xe0c8('0x0'));exports['getTriggers']=function(_0x45da79){return function(_0x32c466){return client[_0xe0c8('0x1')](_0xe0c8('0x2'),{'options':{'raw':![],'attributes':['id',_0xe0c8('0x3'),_0xe0c8('0x4'),_0xe0c8('0x5')],'include':[{'model':'Condition','as':_0xe0c8('0x6'),'attributes':['id',_0xe0c8('0x7'),'operator',_0xe0c8('0x8')]},{'model':_0xe0c8('0x9'),'as':'AnyConditions','attributes':['id',_0xe0c8('0x7'),_0xe0c8('0xa'),'value']},{'model':_0xe0c8('0xb'),'as':_0xe0c8('0xc'),'attributes':['id',_0xe0c8('0xd'),_0xe0c8('0xe'),_0xe0c8('0xf'),_0xe0c8('0x10'),_0xe0c8('0x11'),_0xe0c8('0x12'),'data6',_0xe0c8('0x13')]}]},'log':_0xe0c8('0x2')});};}; \ No newline at end of file +var _0xe7bf=['Request','GetTrigger','name','channel','status','Condition','AllConditions','operator','AnyConditions','value','Action','Actions','action','data1','data2','data3','data6','data7','../client','getTriggers'];(function(_0x3162d3,_0x29889a){var _0x255ddd=function(_0x1e3b88){while(--_0x1e3b88){_0x3162d3['push'](_0x3162d3['shift']());}};_0x255ddd(++_0x29889a);}(_0xe7bf,0x166));var _0xfe7b=function(_0x414fd7,_0x3f423e){_0x414fd7=_0x414fd7-0x0;var _0x5074ad=_0xe7bf[_0x414fd7];return _0x5074ad;};'use strict';var client=require(_0xfe7b('0x0'));exports[_0xfe7b('0x1')]=function(_0x174303){return function(_0x381943){return client[_0xfe7b('0x2')](_0xfe7b('0x3'),{'options':{'raw':![],'attributes':['id',_0xfe7b('0x4'),_0xfe7b('0x5'),_0xfe7b('0x6')],'include':[{'model':_0xfe7b('0x7'),'as':_0xfe7b('0x8'),'attributes':['id','field',_0xfe7b('0x9'),'value']},{'model':'Condition','as':_0xfe7b('0xa'),'attributes':['id','field','operator',_0xfe7b('0xb')]},{'model':_0xfe7b('0xc'),'as':_0xfe7b('0xd'),'attributes':['id',_0xfe7b('0xe'),_0xfe7b('0xf'),_0xfe7b('0x10'),_0xfe7b('0x11'),'data4','data5',_0xfe7b('0x12'),_0xfe7b('0x13')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index b6cf565..9990c14 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 _0xcb57=['defaultuser','../client','getTrunks','GetTrunk','registry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb57,0xa1));var _0x7cb5=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xcb57[_0x2aec52];return _0x3b8835;};'use strict';var client=require(_0x7cb5('0x0'));exports[_0x7cb5('0x1')]=function(_0x5df18a){return function(_0x21a4c6){return client['Request'](_0x7cb5('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x7cb5('0x3'),_0x7cb5('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x7bb8=['registry','GetTrunk','getTrunks','Request','name'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x7bb8,0xe8));var _0x87bb=function(_0x365579,_0x31d251){_0x365579=_0x365579-0x0;var _0x4d3c6d=_0x7bb8[_0x365579];return _0x4d3c6d;};'use strict';var client=require('../client');exports[_0x87bb('0x0')]=function(_0x2548cc){return function(_0x33c051){return client[_0x87bb('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x87bb('0x2'),_0x87bb('0x3'),'defaultuser']},'log':_0x87bb('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 402a4e0..e4be8d2 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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x282c6b,_0x257c10){var _0x3d1fe4=function(_0x3ee066){while(--_0x3ee066){_0x282c6b['push'](_0x282c6b['shift']());}};_0x3d1fe4(++_0x257c10);}(_0x70e0,0x17b));var _0x070e=function(_0x1de9e8,_0x4940f0){_0x1de9e8=_0x1de9e8-0x0;var _0x4cbcfc=_0x70e0[_0x1de9e8];return _0x4cbcfc;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0xfb1b78,_0x1d1684){var _0x39c772=function(_0x23c291){while(--_0x23c291){_0xfb1b78['push'](_0xfb1b78['shift']());}};_0x39c772(++_0x1d1684);}(_0xedd9,0xfc));var _0x9edd=function(_0x279c27,_0x23ac03){_0x279c27=_0x279c27-0x0;var _0x11048a=_0xedd9[_0x279c27];return _0x11048a;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 2f4f1b0..520fc38 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 _0x05b2=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x2485ef,_0x18b487){var _0x4e6334=function(_0x2e7e33){while(--_0x2e7e33){_0x2485ef['push'](_0x2485ef['shift']());}};_0x4e6334(++_0x18b487);}(_0x05b2,0x124));var _0x205b=function(_0x10eff5,_0x34e38c){_0x10eff5=_0x10eff5-0x0;var _0x39578e=_0x05b2[_0x10eff5];return _0x39578e;};'use strict';var client=require('../client');exports['create']=function(_0x259840){return client[_0x205b('0x0')](_0x205b('0x1'),{'body':_0x259840,'log':_0x205b('0x1')});};exports[_0x205b('0x2')]=function(_0x31c570,_0x129a3c,_0x3dd8ae){return client[_0x205b('0x0')](_0x205b('0x3'),{'body':_0x31c570,'options':{'where':{'uniqueid':_0x129a3c,'interface':_0x3dd8ae,'agentcomplete':!![]}},'log':_0x205b('0x3')});}; \ No newline at end of file +var _0xb390=['UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport','update'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xb390,0x128));var _0x0b39=function(_0x270b85,_0x3b9b3b){_0x270b85=_0x270b85-0x0;var _0x5aeea4=_0xb390[_0x270b85];return _0x5aeea4;};'use strict';var client=require('../client');exports[_0x0b39('0x0')]=function(_0x28dc8b){return client[_0x0b39('0x1')](_0x0b39('0x2'),{'body':_0x28dc8b,'log':_0x0b39('0x2')});};exports[_0x0b39('0x3')]=function(_0x40e77f,_0x1d9ccf,_0x3e6635){return client[_0x0b39('0x1')](_0x0b39('0x4'),{'body':_0x40e77f,'options':{'where':{'uniqueid':_0x1d9ccf,'interface':_0x3e6635,'agentcomplete':!![]}},'log':_0x0b39('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index b89e3aa..976d295 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 _0xac54=['DOCUMENTATION','getVoiceCallReports','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid'];(function(_0x469737,_0x384255){var _0x33da41=function(_0xd0a674){while(--_0xd0a674){_0x469737['push'](_0x469737['shift']());}};_0x33da41(++_0x384255);}(_0xac54,0x173));var _0x4ac5=function(_0x4891fc,_0x4ba73f){_0x4891fc=_0x4891fc-0x0;var _0x49a727=_0xac54[_0x4891fc];return _0x49a727;};'use strict';var moment=require('moment');var util=require(_0x4ac5('0x0'));var _=require(_0x4ac5('0x1'));var client=require(_0x4ac5('0x2'));exports[_0x4ac5('0x3')]=function(_0x27b698){return client[_0x4ac5('0x4')](_0x4ac5('0x5'),{'body':_[_0x4ac5('0x6')](_0x27b698,{'source':_0x27b698[_0x4ac5('0x7')],'destinationcontext':_0x27b698['context'],'callerid':_0x27b698[_0x4ac5('0x8')],'amaflags':_0x4ac5('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x4ac5('0xa')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x4ac5('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x4ac5('0xc'))[_0x4ac5('0xd')](_0x4ac5('0xe')),moment()[_0x4ac5('0xf')](_0x4ac5('0xc'))['format'](_0x4ac5('0xe'))]}},'attributes':[_0x4ac5('0x10'),_0x4ac5('0x11'),'duration',_0x4ac5('0x12')]},'log':_0x4ac5('0x13')});};}; \ No newline at end of file +var _0xacea=['create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','day','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','GetVoiceCallReports','moment','util','../client'];(function(_0x401e3a,_0x2bc155){var _0x2d4eac=function(_0x53eac7){while(--_0x53eac7){_0x401e3a['push'](_0x401e3a['shift']());}};_0x2d4eac(++_0x2bc155);}(_0xacea,0x12d));var _0xaace=function(_0x485634,_0x51fbde){_0x485634=_0x485634-0x0;var _0x7450cc=_0xacea[_0x485634];return _0x7450cc;};'use strict';var moment=require(_0xaace('0x0'));var util=require(_0xaace('0x1'));var _=require('lodash');var client=require(_0xaace('0x2'));exports[_0xaace('0x3')]=function(_0x5818bc){return client[_0xaace('0x4')](_0xaace('0x5'),{'body':_[_0xaace('0x6')](_0x5818bc,{'source':_0x5818bc['calleridnum'],'destinationcontext':_0x5818bc[_0xaace('0x7')],'callerid':_0x5818bc[_0xaace('0x8')],'amaflags':_0xaace('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0xaace('0xa')]=function(){return function(){return client[_0xaace('0x4')](_0xaace('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xaace('0xc'))[_0xaace('0xd')](_0xaace('0xe')),moment()['endOf']('day')['format'](_0xaace('0xe'))]}},'attributes':[_0xaace('0xf'),'disposition',_0xaace('0x10'),_0xaace('0x11')]},'log':_0xaace('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index aab183a..fc2c553 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 _0xd993=['Request','CreateVoiceDialReport'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0xd993,0x18e));var _0x3d99=function(_0x57cc15,_0x153b44){_0x57cc15=_0x57cc15-0x0;var _0x2b48e5=_0xd993[_0x57cc15];return _0x2b48e5;};'use strict';var client=require('../client');exports['create']=function(_0xb99ef6){return client[_0x3d99('0x0')](_0x3d99('0x1'),{'body':_0xb99ef6,'log':_0x3d99('0x1')});}; \ No newline at end of file +var _0x0309=['create','Request','CreateVoiceDialReport','../client'];(function(_0x55dd68,_0x2dc9d8){var _0x213ac7=function(_0x32699d){while(--_0x32699d){_0x55dd68['push'](_0x55dd68['shift']());}};_0x213ac7(++_0x2dc9d8);}(_0x0309,0x1e3));var _0x9030=function(_0x47cf7f,_0x32f11e){_0x47cf7f=_0x47cf7f-0x0;var _0x145135=_0x0309[_0x47cf7f];return _0x145135;};'use strict';var client=require(_0x9030('0x0'));exports[_0x9030('0x1')]=function(_0x4517c5){return client[_0x9030('0x2')](_0x9030('0x3'),{'body':_0x4517c5,'log':_0x9030('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index cf1a92f..a599f7c 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 _0x76dc=['Request','GetVoiceExtension','recordingFormat','../client','getVoiceExtensions'];(function(_0x46a81e,_0x28ca60){var _0x464725=function(_0x31344e){while(--_0x31344e){_0x46a81e['push'](_0x46a81e['shift']());}};_0x464725(++_0x28ca60);}(_0x76dc,0x1f2));var _0xc76d=function(_0xc236c4,_0xc58ec3){_0xc236c4=_0xc236c4-0x0;var _0x52358a=_0x76dc[_0xc236c4];return _0x52358a;};'use strict';var client=require(_0xc76d('0x0'));exports[_0xc76d('0x1')]=function(){return function(){return client[_0xc76d('0x2')](_0xc76d('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xc76d('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xc76d('0x1')});};}; \ No newline at end of file +var _0x222f=['../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x52b1e8,_0xb7cfaf){var _0x3cdb24=function(_0x40c789){while(--_0x40c789){_0x52b1e8['push'](_0x52b1e8['shift']());}};_0x3cdb24(++_0xb7cfaf);}(_0x222f,0x1a4));var _0xf222=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x222f[_0x46ae5a];return _0x434986;};'use strict';var client=require(_0xf222('0x0'));exports[_0xf222('0x1')]=function(){return function(){return client[_0xf222('0x2')](_0xf222('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xf222('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 82f2015..47fba77 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 _0x0b97=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','acw','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType'];(function(_0x39054b,_0x8aea23){var _0x1ea740=function(_0x4f9905){while(--_0x4f9905){_0x39054b['push'](_0x39054b['shift']());}};_0x1ea740(++_0x8aea23);}(_0x0b97,0x99));var _0x70b9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0b97[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x70b9('0x0'));exports[_0x70b9('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0x70b9('0x2'),'acwTimeout','autopause','monitor_format',_0x70b9('0x3'),'dialActive',_0x70b9('0x4'),_0x70b9('0x5'),_0x70b9('0x6'),_0x70b9('0x7'),_0x70b9('0x8'),_0x70b9('0x9'),_0x70b9('0xa'),'dialOriginateCallerIdName',_0x70b9('0xb'),'dialOriginateTimeout',_0x70b9('0xc'),_0x70b9('0xd'),'dialQueueProject','dialCongestionMaxRetry',_0x70b9('0xe'),'dialBusyMaxRetry',_0x70b9('0xf'),_0x70b9('0x10'),_0x70b9('0x11'),_0x70b9('0x12'),_0x70b9('0x13'),'dialGlobalInterval','dialPrefix',_0x70b9('0x14'),_0x70b9('0x15'),_0x70b9('0x16'),_0x70b9('0x17'),_0x70b9('0x18'),'dialAMDTotalAnalysisTime',_0x70b9('0x19'),_0x70b9('0x1a'),_0x70b9('0x1b'),_0x70b9('0x1c'),_0x70b9('0x1d'),_0x70b9('0x1e'),_0x70b9('0x1f'),_0x70b9('0x20'),_0x70b9('0x21'),_0x70b9('0x22'),_0x70b9('0x23'),_0x70b9('0x24'),'monitor_format',_0x70b9('0x25'),_0x70b9('0x26'),_0x70b9('0x27'),_0x70b9('0x28'),_0x70b9('0x29'),_0x70b9('0x2a'),'dialDropRetryFrequency',_0x70b9('0x2b'),'dialAbandonedRetryFrequency',_0x70b9('0x2c'),_0x70b9('0x2d'),_0x70b9('0x2e'),_0x70b9('0x2f'),_0x70b9('0x30'),_0x70b9('0x31'),_0x70b9('0x32')],'include':[{'model':_0x70b9('0x33'),'as':'Trunk','attributes':['id',_0x70b9('0x34'),_0x70b9('0x35'),_0x70b9('0x36')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':_0x70b9('0x37'),'attributes':['id',_0x70b9('0x34'),_0x70b9('0x35'),_0x70b9('0x36')]},{'model':_0x70b9('0x38'),'as':_0x70b9('0x38'),'attributes':['id',_0x70b9('0x34')],'include':[{'model':_0x70b9('0x38'),'as':_0x70b9('0x39'),'attributes':['id',_0x70b9('0x34'),'interval']}]}]},'log':_0x70b9('0x1')});};}; \ No newline at end of file +var _0x91f5=['dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix'];(function(_0x26a461,_0x3d0bea){var _0x2fb2c8=function(_0x1cfd7d){while(--_0x1cfd7d){_0x26a461['push'](_0x26a461['shift']());}};_0x2fb2c8(++_0x3d0bea);}(_0x91f5,0x9c));var _0x591f=function(_0x56cb27,_0x262f51){_0x56cb27=_0x56cb27-0x0;var _0x62e322=_0x91f5[_0x56cb27];return _0x62e322;};'use strict';var client=require(_0x591f('0x0'));exports[_0x591f('0x1')]=function(){return function(){return client['Request'](_0x591f('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x591f('0x3'),'acwTimeout',_0x591f('0x4'),_0x591f('0x5'),_0x591f('0x6'),_0x591f('0x7'),_0x591f('0x8'),_0x591f('0x9'),_0x591f('0xa'),_0x591f('0xb'),_0x591f('0xc'),_0x591f('0xd'),_0x591f('0xe'),_0x591f('0xf'),_0x591f('0x10'),_0x591f('0x11'),_0x591f('0x12'),'dialQueueTimeout',_0x591f('0x13'),_0x591f('0x14'),_0x591f('0x15'),_0x591f('0x16'),_0x591f('0x17'),_0x591f('0x18'),_0x591f('0x19'),_0x591f('0x1a'),_0x591f('0x1b'),_0x591f('0x1c'),_0x591f('0x1d'),_0x591f('0x1e'),_0x591f('0x1f'),_0x591f('0x20'),_0x591f('0x21'),'dialAMDAfterGreetingSilence',_0x591f('0x22'),'dialAMDMinWordLength',_0x591f('0x23'),_0x591f('0x24'),_0x591f('0x25'),_0x591f('0x26'),_0x591f('0x27'),_0x591f('0x28'),_0x591f('0x29'),_0x591f('0x2a'),_0x591f('0x2b'),'dialAgiAfterHangupClient',_0x591f('0x2c'),_0x591f('0x5'),'strategy',_0x591f('0x2d'),_0x591f('0x2e'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x591f('0x2f'),_0x591f('0x30'),_0x591f('0x31'),'dialMachineRetryFrequency',_0x591f('0x32'),_0x591f('0x33'),_0x591f('0x34'),'dialPredictiveIntervalMaxThreshold',_0x591f('0x35')],'include':[{'model':'Trunk','as':_0x591f('0x36'),'attributes':['id',_0x591f('0x37'),_0x591f('0x38'),_0x591f('0x39')]},{'model':'Pause','as':_0x591f('0x3a'),'attributes':['id',_0x591f('0x37')]},{'model':_0x591f('0x36'),'as':'TrunkBackup','attributes':['id',_0x591f('0x37'),'callerid',_0x591f('0x39')]},{'model':'Interval','as':_0x591f('0x3b'),'attributes':['id',_0x591f('0x37')],'include':[{'model':_0x591f('0x3b'),'as':_0x591f('0x3c'),'attributes':['id',_0x591f('0x37'),_0x591f('0x3d')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index ad55119..bf1bfb5 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(_0x5cd676,_0x2998fc){var _0x5e4d6b=function(_0x22de35){while(--_0x22de35){_0x5cd676['push'](_0x5cd676['shift']());}};_0x5e4d6b(++_0x2998fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x2284bf,_0x297fcd){var _0x2239ca=function(_0x2459b6){while(--_0x2459b6){_0x2284bf['push'](_0x2284bf['shift']());}};_0x2239ca(++_0x297fcd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 2d2c6eb..472163a 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 _0x482a=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x4537be,_0x5bd14c){var _0x1c8fed=function(_0x505a50){while(--_0x505a50){_0x4537be['push'](_0x4537be['shift']());}};_0x1c8fed(++_0x5bd14c);}(_0x482a,0xaa));var _0xa482=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x482a[_0x5f309e];return _0x487b5e;};'use strict';var client=require(_0xa482('0x0'));exports[_0xa482('0x1')]=function(_0x4d7a7c){return function(){return client[_0xa482('0x2')](_0xa482('0x3'),{'options':{'where':{'VoiceQueueId':_0x4d7a7c,'paused':!![]},'raw':!![]},'log':_0xa482('0x1')});};}; \ No newline at end of file +var _0x9f8a=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x145824,_0x5e892c){var _0x1d155c=function(_0xb8a650){while(--_0xb8a650){_0x145824['push'](_0x145824['shift']());}};_0x1d155c(++_0x5e892c);}(_0x9f8a,0xda));var _0xa9f8=function(_0x19ad63,_0x4df85e){_0x19ad63=_0x19ad63-0x0;var _0x26a275=_0x9f8a[_0x19ad63];return _0x26a275;};'use strict';var client=require(_0xa9f8('0x0'));exports[_0xa9f8('0x1')]=function(_0x3d01d6){return function(){return client['Request'](_0xa9f8('0x2'),{'options':{'where':{'VoiceQueueId':_0x3d01d6,'paused':!![]},'raw':!![]},'log':_0xa9f8('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index d675964..23050be 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(_0x498710,_0x3a335e){var _0x1bbd31=function(_0x31cf19){while(--_0x31cf19){_0x498710['push'](_0x498710['shift']());}};_0x1bbd31(++_0x3a335e);}(_0x7a54,0x106));var _0x47a5=function(_0x57cd75,_0x587773){_0x57cd75=_0x57cd75-0x0;var _0x1e1f87=_0x7a54[_0x57cd75];return _0x1e1f87;};'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(_0x4ff01d,_0x4c5ae8){var _0x2584d5=function(_0x8f1502){while(--_0x8f1502){_0x4ff01d['push'](_0x4ff01d['shift']());}};_0x2584d5(++_0x4c5ae8);}(_0x7a54,0x106));var _0x47a5=function(_0x225672,_0x636224){_0x225672=_0x225672-0x0;var _0x7088ee=_0x7a54[_0x225672];return _0x7088ee;};'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 d403d10..d903951 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 _0x2869=['transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinename','transfereraccountcode','transfereecalleridnum'];(function(_0x15204b,_0x12d6af){var _0x410d73=function(_0x48e1df){while(--_0x48e1df){_0x15204b['push'](_0x15204b['shift']());}};_0x410d73(++_0x12d6af);}(_0x2869,0x132));var _0x9286=function(_0x243cd2,_0x482a02){_0x243cd2=_0x243cd2-0x0;var _0x5e8bc1=_0x2869[_0x243cd2];return _0x5e8bc1;};'use strict';var client=require(_0x9286('0x0'));exports[_0x9286('0x1')]={};exports[_0x9286('0x2')]=function(_0x183987){return client['Request'](_0x9286('0x3'),{'body':{'result':_0x183987[_0x9286('0x4')],'transfererchannel':_0x183987[_0x9286('0x5')],'transferercalleridnum':_0x183987['transferercalleridnum'],'transferercalleridname':_0x183987['transferercalleridname'],'transfererconnectedlinenum':_0x183987['transfererconnectedlinenum'],'transfererconnectedlinename':_0x183987[_0x9286('0x6')],'transfereraccountcode':_0x183987[_0x9286('0x7')],'transferercontext':_0x183987['transferercontext'],'transfererexten':_0x183987['transfererexten'],'transfererlinkedid':_0x183987['transfererlinkedid'],'transfereechannel':_0x183987['transfereechannel'],'transfereecalleridnum':_0x183987[_0x9286('0x8')],'transfereecalleridname':_0x183987[_0x9286('0x9')],'transfereeconnectedlinenum':_0x183987['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x183987[_0x9286('0xa')],'transfereeaccountcode':_0x183987[_0x9286('0xb')],'transfereecontext':_0x183987[_0x9286('0xc')],'transfereeexten':_0x183987['transfereeexten'],'transfereelinkedid':_0x183987[_0x9286('0xd')],'isexternal':_0x183987[_0x9286('0xe')],'context':_0x183987[_0x9286('0xf')],'extension':_0x183987[_0x9286('0x10')],'type':_0x9286('0x11')},'log':_0x9286('0x3')});};exports[_0x9286('0x12')]=function(_0x2010c5){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x2010c5[_0x9286('0x4')],'transfererchannel':_0x2010c5[_0x9286('0x13')],'transferercalleridnum':_0x2010c5[_0x9286('0x14')],'transferercalleridname':_0x2010c5[_0x9286('0x15')],'transfererconnectedlinenum':_0x2010c5[_0x9286('0x16')],'transfererconnectedlinename':_0x2010c5['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2010c5['origtransfereraccountcode'],'transferercontext':_0x2010c5[_0x9286('0x17')],'transfererexten':_0x2010c5[_0x9286('0x18')],'transfererlinkedid':_0x2010c5['origtransfererlinkedid'],'transfereechannel':_0x2010c5[_0x9286('0x19')],'transfereecalleridnum':_0x2010c5[_0x9286('0x1a')],'transfereecalleridname':_0x2010c5[_0x9286('0x1b')],'transfereeconnectedlinenum':_0x2010c5[_0x9286('0x1c')],'transfereeconnectedlinename':_0x2010c5[_0x9286('0x1d')],'transfereeaccountcode':_0x2010c5[_0x9286('0x1e')],'transfereecontext':_0x2010c5[_0x9286('0x1f')],'transfereeexten':_0x2010c5[_0x9286('0x20')],'transfereelinkedid':_0x2010c5['transfertargetlinkedid'],'isexternal':_0x2010c5[_0x9286('0xe')],'context':_0x2010c5[_0x9286('0x21')],'extension':_0x2010c5[_0x9286('0x22')],'type':'attended'},'log':_0x9286('0x3')});}; \ No newline at end of file +var _0xf374=['transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','extension','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext'];(function(_0x51ebcf,_0x64a11a){var _0x3af5ec=function(_0x4bd0bd){while(--_0x4bd0bd){_0x51ebcf['push'](_0x51ebcf['shift']());}};_0x3af5ec(++_0x64a11a);}(_0xf374,0x75));var _0x4f37=function(_0x23ee6b,_0x2c44a3){_0x23ee6b=_0x23ee6b-0x0;var _0xa8924e=_0xf374[_0x23ee6b];return _0xa8924e;};'use strict';var client=require(_0x4f37('0x0'));exports['transfers']={};exports[_0x4f37('0x1')]=function(_0x471f0e){return client['Request'](_0x4f37('0x2'),{'body':{'result':_0x471f0e[_0x4f37('0x3')],'transfererchannel':_0x471f0e[_0x4f37('0x4')],'transferercalleridnum':_0x471f0e['transferercalleridnum'],'transferercalleridname':_0x471f0e[_0x4f37('0x5')],'transfererconnectedlinenum':_0x471f0e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x471f0e[_0x4f37('0x6')],'transfereraccountcode':_0x471f0e[_0x4f37('0x7')],'transferercontext':_0x471f0e[_0x4f37('0x8')],'transfererexten':_0x471f0e[_0x4f37('0x9')],'transfererlinkedid':_0x471f0e['transfererlinkedid'],'transfereechannel':_0x471f0e[_0x4f37('0xa')],'transfereecalleridnum':_0x471f0e[_0x4f37('0xb')],'transfereecalleridname':_0x471f0e['transfereecalleridname'],'transfereeconnectedlinenum':_0x471f0e[_0x4f37('0xc')],'transfereeconnectedlinename':_0x471f0e[_0x4f37('0xd')],'transfereeaccountcode':_0x471f0e[_0x4f37('0xe')],'transfereecontext':_0x471f0e['transfereecontext'],'transfereeexten':_0x471f0e[_0x4f37('0xf')],'transfereelinkedid':_0x471f0e[_0x4f37('0x10')],'isexternal':_0x471f0e[_0x4f37('0x11')],'context':_0x471f0e['context'],'extension':_0x471f0e[_0x4f37('0x12')],'type':'blind'},'log':_0x4f37('0x2')});};exports[_0x4f37('0x13')]=function(_0x23ad87){return client[_0x4f37('0x14')]('CreateVoiceTransferReport',{'body':{'result':_0x23ad87[_0x4f37('0x3')],'transfererchannel':_0x23ad87[_0x4f37('0x15')],'transferercalleridnum':_0x23ad87[_0x4f37('0x16')],'transferercalleridname':_0x23ad87[_0x4f37('0x17')],'transfererconnectedlinenum':_0x23ad87[_0x4f37('0x18')],'transfererconnectedlinename':_0x23ad87[_0x4f37('0x19')],'transfereraccountcode':_0x23ad87[_0x4f37('0x1a')],'transferercontext':_0x23ad87[_0x4f37('0x1b')],'transfererexten':_0x23ad87[_0x4f37('0x1c')],'transfererlinkedid':_0x23ad87[_0x4f37('0x1d')],'transfereechannel':_0x23ad87[_0x4f37('0x1e')],'transfereecalleridnum':_0x23ad87[_0x4f37('0x1f')],'transfereecalleridname':_0x23ad87[_0x4f37('0x20')],'transfereeconnectedlinenum':_0x23ad87[_0x4f37('0x21')],'transfereeconnectedlinename':_0x23ad87[_0x4f37('0x22')],'transfereeaccountcode':_0x23ad87[_0x4f37('0x23')],'transfereecontext':_0x23ad87[_0x4f37('0x24')],'transfereeexten':_0x23ad87[_0x4f37('0x25')],'transfereelinkedid':_0x23ad87[_0x4f37('0x26')],'isexternal':_0x23ad87[_0x4f37('0x11')],'context':_0x23ad87[_0x4f37('0x27')],'extension':_0x23ad87[_0x4f37('0x28')],'type':_0x4f37('0x29')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index a43e2c2..4df1abb 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 _0x41d0=['channels','voicechannel','length','uniqueid','%s.%s','filename','MixMonitor','channel','then','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','MixMonitor\x20Success','map','resolve','StopMixMonitor','destinationchannel','status','wav','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','exten','telephones','trunks','outboundChannels','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','module','action','Reload','message','ami\x20disconnected','command','Command','Action','content','catch','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','callerid','Interval','push','find','undefined','values'];(function(_0x49db99,_0xead361){var _0x59cc19=function(_0x327a71){while(--_0x327a71){_0x49db99['push'](_0x49db99['shift']());}};_0x59cc19(++_0xead361);}(_0x41d0,0x1c6));var _0x041d=function(_0x20949b,_0x46490e){_0x20949b=_0x20949b-0x0;var _0x35d9fa=_0x41d0[_0x20949b];return _0x35d9fa;};'use strict';var _=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var jayson=require(_0x041d('0x2'));var schema=require(_0x041d('0x3'));var BPromise=require('bluebird');var moment=require(_0x041d('0x4'));var config=require(_0x041d('0x5'));var properties=require(_0x041d('0x6'));var ami=require(_0x041d('0x7'));exports[_0x041d('0x8')]=function(_0x3a22a4,_0x4293ba,_0x14907f){return new BPromise(function(_0x196419,_0x5f083c){var _0x372840={'QueuePause':function(_0x50dae8){return new Promise(function(_0xae8b94,_0x584adf){var _0xd7e3b6=util[_0x041d('0x9')]('%s/%s','SIP',_0x50dae8['name']);if(_0x3a22a4[_0x041d('0xa')]&&_0x3a22a4['timers'][_0xd7e3b6]&&_0x3a22a4[_0x041d('0xa')][_0xd7e3b6]['timer']){_0x3a22a4[_0x041d('0xa')][_0xd7e3b6][_0x041d('0xb')]();}if(_0x3a22a4[_0x041d('0xc')][_0xd7e3b6]){_0x3a22a4[_0x041d('0xc')][_0xd7e3b6][_0x041d('0xd')]({'statePause':_0x50dae8[_0x041d('0xe')]?!![]:![]});}_0xae8b94({'code':0xc8,'message':_0x041d('0xf')});});},'Reload':function(_0x111e9b){var _0x1488c=this;return new Promise(function(_0x5eede1,_0x18fa5a){if(ami[_0x041d('0x10')]()==![]){return _0x18fa5a(_0x1488c[_0x041d('0x11')](0x1f4,[config[_0x041d('0x12')]['ip'],config[_0x041d('0x12')][_0x041d('0x13')],'ami\x20disconnected'][_0x041d('0x14')]('\x20')));}_0x111e9b=_[_0x041d('0x15')](_0x111e9b,_[_0x041d('0x16')](properties[_0x041d('0x17')]));_0x111e9b[_0x041d('0x18')]=_0x041d('0x19');return ami['Action'](_0x111e9b)['then'](function(_0x239ac3){_0x5eede1({'code':0xc8,'message':_0x239ac3[_0x041d('0x1a')]});})['catch'](function(_0x15b10b){_0x18fa5a(_0x1488c['error'](0x1f5,_0x15b10b[_0x041d('0x1a')]));});});},'Command':function(_0x2d51dc){var _0x137878=this;return new Promise(function(_0x56e031,_0x3505e7){if(ami['isConnected']()==![]){return _0x3505e7(_0x137878['error'](0x1f4,[config[_0x041d('0x12')]['ip'],config['asterisk'][_0x041d('0x13')],_0x041d('0x1b')][_0x041d('0x14')]('\x20')));}_0x2d51dc=_[_0x041d('0x15')](_0x2d51dc,_0x041d('0x1c'));_0x2d51dc[_0x041d('0x18')]=_0x041d('0x1d');return ami[_0x041d('0x1e')](_0x2d51dc)['then'](function(_0x1fee9a){_0x56e031({'code':0xc8,'message':_0x1fee9a[_0x041d('0x1f')]});})[_0x041d('0x20')](function(_0x6c8547){_0x3505e7(_0x137878[_0x041d('0x11')](0x1f5,_0x6c8547['message']));});});},'VoiceQueues':function(_0x3c8715){return new Promise(function(_0x31481d,_0x3e04e3){var _0x3b34a7=[];for(var _0x315d73 in _0x3a22a4[_0x041d('0x21')]){if(_0x3a22a4[_0x041d('0x21')][_0x041d('0x22')](_0x315d73)){var _0x1ca19c=_0x3a22a4[_0x041d('0x21')][_0x315d73];var _0x366fe8={'id':_0x1ca19c['id'],'name':_0x1ca19c[_0x041d('0x23')],'strategy':_0x1ca19c[_0x041d('0x24')],'answered':_0x1ca19c[_0x041d('0x25')],'available':_0x1ca19c[_0x041d('0x26')],'loggedIn':_0x1ca19c[_0x041d('0x27')],'pTalking':_0x1ca19c[_0x041d('0x28')],'sumBillable':_0x1ca19c[_0x041d('0x29')],'sumDuration':_0x1ca19c[_0x041d('0x2a')],'sumHoldTime':_0x1ca19c[_0x041d('0x2b')]||0x0,'talking':_0x1ca19c[_0x041d('0x2c')],'total':_0x1ca19c[_0x041d('0x2d')],'type':_0x1ca19c[_0x041d('0x2e')],'unmanaged':_0x1ca19c['unmanaged'],'abandoned':_0x1ca19c[_0x041d('0x2f')],'waiting':_0x1ca19c[_0x041d('0x30')],'loggedInDb':_0x1ca19c['loggedInDb']};if(_0x1ca19c[_0x041d('0x2e')]==='outbound'){_0x366fe8['dialActive']=_0x1ca19c[_0x041d('0x31')];_0x366fe8['dialMethod']=_0x1ca19c[_0x041d('0x32')];_0x366fe8[_0x041d('0x33')]=_0x1ca19c['dialOriginateCallerIdName'];_0x366fe8[_0x041d('0x34')]=_0x1ca19c[_0x041d('0x34')];_0x366fe8[_0x041d('0x35')]=_0x1ca19c[_0x041d('0x35')];_0x366fe8['dialPrefix']=_0x1ca19c[_0x041d('0x36')];_0x366fe8[_0x041d('0x37')]=_0x1ca19c[_0x041d('0x37')];_0x366fe8[_0x041d('0x38')]=_0x1ca19c[_0x041d('0x38')];_0x366fe8['outboundAnswerCallsDay']=_0x1ca19c[_0x041d('0x39')];_0x366fe8['outboundBlacklistCallsDay']=_0x1ca19c[_0x041d('0x3a')];_0x366fe8[_0x041d('0x3b')]=_0x1ca19c['outboundBusyCallsDay'];_0x366fe8['outboundCongestionCallsDay']=_0x1ca19c[_0x041d('0x3c')];_0x366fe8[_0x041d('0x3d')]=_0x1ca19c[_0x041d('0x3d')];_0x366fe8['outboundDropCallsDayCallersExit']=_0x1ca19c[_0x041d('0x3e')];_0x366fe8[_0x041d('0x3f')]=_0x1ca19c[_0x041d('0x3f')];_0x366fe8[_0x041d('0x40')]=_0x1ca19c['outboundNoAnswerCallsDay'];_0x366fe8[_0x041d('0x41')]=_0x1ca19c['outboundNoSuchCallsDay'];_0x366fe8[_0x041d('0x42')]=_0x1ca19c[_0x041d('0x42')];_0x366fe8['outboundReCallsDay']=_0x1ca19c[_0x041d('0x43')];_0x366fe8['outboundRejectCallsDay']=_0x1ca19c[_0x041d('0x44')];_0x366fe8[_0x041d('0x45')]=_0x1ca19c['outboundUnknownCallsDay'];_0x366fe8[_0x041d('0x46')]=_0x1ca19c[_0x041d('0x46')];_0x366fe8['predictiveIntervalAvgHoldtime']=_0x1ca19c[_0x041d('0x47')];_0x366fe8[_0x041d('0x48')]=_0x1ca19c[_0x041d('0x48')];_0x366fe8[_0x041d('0x49')]=_0x1ca19c[_0x041d('0x49')];_0x366fe8[_0x041d('0x4a')]=_0x1ca19c[_0x041d('0x4a')];_0x366fe8[_0x041d('0x4b')]=_0x1ca19c[_0x041d('0x4b')];_0x366fe8[_0x041d('0x4c')]=_0x1ca19c[_0x041d('0x4c')];_0x366fe8[_0x041d('0x4d')]=_0x1ca19c['predictiveIntervalHitRate'];_0x366fe8[_0x041d('0x4e')]=_0x1ca19c[_0x041d('0x4e')];_0x366fe8[_0x041d('0x4f')]=_0x1ca19c[_0x041d('0x4f')];_0x366fe8['predictiveIntervalAvailable']=_0x1ca19c[_0x041d('0x50')];_0x366fe8[_0x041d('0x51')]=_0x1ca19c[_0x041d('0x51')];_0x366fe8[_0x041d('0x1a')]=_0x1ca19c[_0x041d('0x1a')];_0x366fe8[_0x041d('0x52')]=_0x1ca19c[_0x041d('0x52')];_0x366fe8[_0x041d('0x53')]=_0x1ca19c[_0x041d('0x53')];_0x366fe8['erlangCallToSecond']=_0x1ca19c[_0x041d('0x54')];_0x366fe8[_0x041d('0x55')]=_0x1ca19c['erlangAbandonmentRate'];_0x366fe8['erlangBusyFactor']=_0x1ca19c['erlangBusyFactor'];_0x366fe8['startPredictive']=_0x1ca19c['startPredictive'];_0x366fe8[_0x041d('0x56')]=_0x1ca19c[_0x041d('0x56')];}if(_0x1ca19c['Trunk']){_0x366fe8['Trunk']={'id':_0x1ca19c[_0x041d('0x57')]['id'],'name':_0x1ca19c[_0x041d('0x57')][_0x041d('0x23')],'active':_0x1ca19c[_0x041d('0x57')]['active'],'callerid':_0x1ca19c['Trunk'][_0x041d('0x58')]};}if(_0x1ca19c[_0x041d('0x59')]){_0x366fe8[_0x041d('0x59')]={'id':_0x1ca19c[_0x041d('0x59')]['id'],'name':_0x1ca19c[_0x041d('0x59')][_0x041d('0x23')]};}_0x3b34a7[_0x041d('0x5a')](_0x366fe8);}}_0x31481d({'count':_0x3b34a7['length'],'rows':_0x3b34a7});});},'UpdateVoiceQueue':function(_0x3d03ad){return new Promise(function(_0x9fa501,_0x2e9abc){var _0x12a2a1=_[_0x041d('0x5b')](_0x3a22a4['voiceQueues'],{'id':parseInt(_0x3d03ad['id'])});var _0x53c9fe=_['omit'](_0x3d03ad,['id']);if(_0x12a2a1){for(var _0x4be216 in _0x53c9fe){if(typeof _0x53c9fe[_0x4be216]!==_0x041d('0x5c')&&typeof _0x12a2a1[_0x4be216]!==_0x041d('0x5c')){_0x12a2a1[_0x4be216]=_0x53c9fe[_0x4be216];}}_0x9fa501(_0x12a2a1);}else{_0x2e9abc();}});},'VoiceChannels':function(_0x42f71){return new Promise(function(_0x59409c,_0x5be9f7){var _0x431086=_[_0x041d('0x5d')](_0x3a22a4[_0x041d('0x5e')]);_0x59409c({'count':_0x431086['length'],'rows':_0x431086});});},'VoiceChannelMixMonitor':function(_0x511345){var _0x2e603c=this;return new Promise(function(_0x5ce72a,_0x4ea4d9){if(ami['isConnected']()==![]){return _0x4ea4d9(_0x2e603c[_0x041d('0x11')](0x1f4,[config[_0x041d('0x12')]['ip'],config[_0x041d('0x12')][_0x041d('0x13')],_0x041d('0x1b')]['join']('\x20')));}var _0x548073=schema(properties[_0x041d('0x5f')])[_0x041d('0x3')](_0x511345);if(_0x548073[_0x041d('0x60')]>0x0){return _0x4ea4d9(_0x2e603c[_0x041d('0x11')](0x1f4,_['map'](_0x548073,_0x041d('0x1a'))[_0x041d('0x14')](',\x20')));}var _0x57be33=_[_0x041d('0x5b')](_0x3a22a4['channels'],{'uniqueid':_0x511345[_0x041d('0x61')]});if(_0x57be33&&_0x57be33['channel']){var _0x3b6b02=util['format'](_0x041d('0x62'),_0x511345[_0x041d('0x63')]||_0x511345['uniqueid'],_0x511345[_0x041d('0x9')]||'wav');return ami[_0x041d('0x1e')]({'action':_0x041d('0x64'),'channel':_0x57be33[_0x041d('0x65')],'file':_0x3b6b02,'options':'ai(mixmonitorid)'})[_0x041d('0x66')](function(_0x2c6041){var _0x35844d=_[_0x041d('0x5b')](_0x57be33[_0x041d('0x67')],{'filename':_0x041d('0x68')+_0x3b6b02[_0x041d('0x69')]()});if(_[_0x041d('0x6a')](_0x35844d)){_0x57be33[_0x041d('0x67')][_0x041d('0x5a')]({'filename':'/var/spool/asterisk/monitor/'+_0x3b6b02[_0x041d('0x69')](),'createdAt':moment()[_0x041d('0x9')](_0x041d('0x6b')),'mixmonitorid':_0x2c6041[_0x041d('0x6c')],'status':'rec'});}else{_0x35844d[_0x041d('0x6c')]=_0x2c6041[_0x041d('0x6c')];_0x35844d['status']='rec';}_0x5ce72a({'code':0xc8,'message':[_0x511345[_0x041d('0x61')],_0x041d('0x6d'),_0x2c6041['mixmonitorid']][_0x041d('0x14')]('\x20'),'mixmonitorid':_0x2c6041[_0x041d('0x6c')]});})[_0x041d('0x20')](function(_0x2534cc){_0x4ea4d9(_0x2e603c[_0x041d('0x11')](0x1f5,[_0x511345[_0x041d('0x61')],_0x2534cc['message'][_0x041d('0x69')]()][_0x041d('0x14')]('\x20')));});}else{return _0x4ea4d9(_0x2e603c['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x322f08){var _0xd48dfa=this;return new Promise(function(_0x2dd5b2,_0xc1af4d){if(ami[_0x041d('0x10')]()==![]){return _0xc1af4d(_0xd48dfa[_0x041d('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x041d('0x13')],_0x041d('0x1b')][_0x041d('0x14')]('\x20')));}var _0x530ad0=schema(properties[_0x041d('0x5f')])[_0x041d('0x3')](_0x322f08);if(_0x530ad0['length']>0x0){return _0xc1af4d(_0xd48dfa[_0x041d('0x11')](0x1f4,_[_0x041d('0x6e')](_0x530ad0,_0x041d('0x1a'))[_0x041d('0x14')](',\x20')));}var _0x215a2f=_['find'](_0x3a22a4['channels'],{'uniqueid':_0x322f08[_0x041d('0x61')]});if(_0x215a2f){return BPromise[_0x041d('0x6f')]()[_0x041d('0x66')](function(){if(_0x215a2f[_0x041d('0x65')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x215a2f[_0x041d('0x65')],'mixmonitorid':_0x322f08['mixmonitorid']})['catch'](function(_0x1ebc5e){});}})[_0x041d('0x66')](function(){if(_0x215a2f['destinationchannel']){return ami[_0x041d('0x1e')]({'action':_0x041d('0x70'),'channel':_0x215a2f[_0x041d('0x71')],'mixmonitorid':_0x322f08['mixmonitorid']})[_0x041d('0x20')](function(_0x3906be){});}})[_0x041d('0x66')](function(_0x1fa720){var _0x3a4ca7=_['find'](_0x215a2f[_0x041d('0x67')],{'mixmonitorid':_0x322f08[_0x041d('0x6c')]});if(_0x3a4ca7){_0x3a4ca7[_0x041d('0x72')]='stop';}})[_0x041d('0x66')](function(){var _0x3caab8=util[_0x041d('0x9')]('%s.%s',_0x322f08['filename']||_0x322f08['uniqueid'],_0x322f08['format']||_0x041d('0x73'));var _0x25bb42=_[_0x041d('0x5b')](_0x215a2f[_0x041d('0x67')],{'filename':_0x041d('0x68')+_0x3caab8[_0x041d('0x69')]()});if(_0x25bb42){_0x25bb42['status']='stop';}})[_0x041d('0x66')](function(){_0x2dd5b2({'code':0xc8,'message':[_0x322f08[_0x041d('0x61')],_0x041d('0x74')][_0x041d('0x14')]('\x20')});})['catch'](function(_0x5a969e){_0xc1af4d(_0xd48dfa[_0x041d('0x11')](0x1f5,[_0x322f08['uniqueid'],_0x5a969e[_0x041d('0x1a')]['toLowerCase']()][_0x041d('0x14')]('\x20')));});}else{return _0xc1af4d(_0xd48dfa[_0x041d('0x11')](0x1f5,_0x041d('0x75')));}});},'VoiceQueuesChannels':function(_0x444c1e){return new Promise(function(_0x1cc854,_0x2977dd){var _0x459dfd=_['values'](_0x3a22a4[_0x041d('0x76')]);_0x1cc854({'count':_0x459dfd[_0x041d('0x60')],'rows':_0x459dfd});});},'VoiceQueuesChannel':function(_0x33ee88){var _0x410760=this;return new Promise(function(_0x469d38,_0x558952){var _0x40fdfb=schema(properties[_0x041d('0x77')])[_0x041d('0x3')](_0x33ee88);if(_0x40fdfb[_0x041d('0x60')]>0x0){return _0x558952(_0x410760['error'](0x1f4,_[_0x041d('0x6e')](_0x40fdfb,_0x041d('0x1a'))['join'](',\x20')));}var _0x53cb44=_['find'](_0x3a22a4[_0x041d('0x76')],{'uniqueid':_0x33ee88[_0x041d('0x61')]});if(_0x53cb44){_0x469d38(_0x53cb44);}else{return _0x558952(_0x410760[_0x041d('0x11')](0x1f5,_0x041d('0x75')));}});},'VoiceQueuesChannelHangup':function(_0x52f7ed){var _0x5e2989=this;return new Promise(function(_0x3e8f20,_0x3a9ed3){if(ami['isConnected']()==![]){return _0x3a9ed3(_0x5e2989[_0x041d('0x11')](0x1f4,[config[_0x041d('0x12')]['ip'],config[_0x041d('0x12')][_0x041d('0x13')],_0x041d('0x1b')][_0x041d('0x14')]('\x20')));}var _0x5920e8=schema(properties['voicequeuechannelhangup'])[_0x041d('0x3')](_0x52f7ed);if(_0x5920e8[_0x041d('0x60')]>0x0){return _0x3a9ed3(_0x5e2989[_0x041d('0x11')](0x1f4,_[_0x041d('0x6e')](_0x5920e8,_0x041d('0x1a'))[_0x041d('0x14')](',\x20')));}var _0x58963e=_[_0x041d('0x5b')](_0x3a22a4[_0x041d('0x76')],{'uniqueid':_0x52f7ed[_0x041d('0x61')]});if(_0x58963e&&_0x58963e[_0x041d('0x65')]){return ami[_0x041d('0x1e')]({'action':_0x041d('0x78'),'channel':_0x58963e['channel']})[_0x041d('0x66')](function(_0x8e57da){_0x3e8f20({'code':0xc8,'message':[_0x52f7ed[_0x041d('0x61')],_0x8e57da[_0x041d('0x1a')][_0x041d('0x69')]()]['join']('\x20')});})[_0x041d('0x20')](function(_0x19f420){_0x3a9ed3(_0x5e2989[_0x041d('0x11')](0x1f5,[_0x52f7ed[_0x041d('0x61')],_0x19f420[_0x041d('0x1a')]['toLowerCase']()]['join']('\x20')));});}else{return _0x3a9ed3(_0x5e2989[_0x041d('0x11')](0x1f5,_0x041d('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x1f55e4){var _0x5569a2=this;return new Promise(function(_0x22610d,_0x999cbb){if(ami[_0x041d('0x10')]()==![]){return _0x999cbb(_0x5569a2[_0x041d('0x11')](0x1f4,[config[_0x041d('0x12')]['ip'],config[_0x041d('0x12')][_0x041d('0x13')],'ami\x20disconnected']['join']('\x20')));}var _0x44cd0e=schema(properties[_0x041d('0x79')])[_0x041d('0x3')](_0x1f55e4);if(_0x44cd0e[_0x041d('0x60')]>0x0){return _0x999cbb(_0x5569a2[_0x041d('0x11')](0x1f4,_[_0x041d('0x6e')](_0x44cd0e,_0x041d('0x1a'))[_0x041d('0x14')](',\x20')));}var _0x5577b5=_[_0x041d('0x5b')](_0x3a22a4[_0x041d('0x76')],{'uniqueid':_0x1f55e4[_0x041d('0x61')]});if(_0x5577b5&&_0x5577b5[_0x041d('0x65')]){return ami[_0x041d('0x1e')]({'action':'Redirect','channel':_0x5577b5['channel'],'exten':_0x1f55e4[_0x041d('0x7a')],'context':_0x1f55e4['context']||_0x5577b5['context'],'priority':0x1})['then'](function(_0x2e5958){_0x22610d({'code':0xc8,'message':[_0x1f55e4[_0x041d('0x61')],_0x2e5958['message'][_0x041d('0x69')]()][_0x041d('0x14')]('\x20')});})[_0x041d('0x20')](function(_0x3ef990){_0x999cbb(_0x5569a2['error'](0x1f5,[_0x1f55e4['uniqueid'],_0x3ef990[_0x041d('0x1a')][_0x041d('0x69')]()][_0x041d('0x14')]('\x20')));});}else{return _0x999cbb(_0x5569a2[_0x041d('0x11')](0x1f5,_0x041d('0x75')));}});},'Agents':function(_0x2ac5d9){return new Promise(function(_0x39898b,_0x465264){var _0x30ce94=_['values'](_0x3a22a4[_0x041d('0xc')]);_0x39898b({'count':_0x30ce94['length'],'rows':_0x30ce94});});},'Telephones':function(_0x12d687){return new Promise(function(_0x9defd,_0x516b92){var _0x2647ae=_[_0x041d('0x5d')](_0x3a22a4[_0x041d('0x7b')]);_0x9defd({'count':_0x2647ae['length'],'rows':_0x2647ae});});},'Trunks':function(_0x5ac93d){return new Promise(function(_0x4e42d6,_0x289059){var _0x4f8536=_['values'](_0x3a22a4[_0x041d('0x7c')]);_0x4e42d6({'count':_0x4f8536[_0x041d('0x60')],'rows':_0x4f8536});});},'OutboundChannels':function(_0x51d1ff){return new Promise(function(_0x4928e0,_0x103093){var _0x4349f3=_[_0x041d('0x5d')](_0x3a22a4[_0x041d('0x7d')]);_0x4928e0({'count':_0x4349f3[_0x041d('0x60')],'rows':_0x4349f3});});},'Outbound':function(_0x4dc1b9){return new Promise(function(_0x2b1234,_0x4ea82f){_0x2b1234(_0x3a22a4['outbound']);});},'Campaigns':function(_0x41397a){return new Promise(function(_0x6dde98,_0x202f4d){var _0x52e927=_[_0x041d('0x5d')](_0x3a22a4['campaigns']);_0x6dde98({'count':_0x52e927[_0x041d('0x60')],'rows':_0x52e927});});},'VoiceQueuesPreview':function(_0x381933){var _0x20293f=this;return new Promise(function(_0x5bea3e,_0x2baf8e){_0x4293ba['run'](_0x381933['id'])['then'](function(_0x36dc9c){_0x5bea3e({'code':0xc8,'message':_0x36dc9c[_0x041d('0x1a')]});})[_0x041d('0x20')](function(_0x1fece0){_0x2baf8e(_0x20293f[_0x041d('0x11')](0x1f4,_0x1fece0[_0x041d('0x1a')]));});});},'EventManager':function(_0x39140a){var _0x277a56=this;return new Promise(function(_0x47577f,_0x262952){if(!_0x39140a['event']){return _0x262952(_0x277a56[_0x041d('0x11')](0x1f4,_0x041d('0x7e')));}ami[_0x041d('0x7f')](_0x041d('0x80')+_0x39140a[_0x041d('0x81')],_0x39140a['message']);_0x47577f({'code':0xc8,'message':_0x39140a});});},'FaxAccounts':function(_0xd062d7){return new Promise(function(_0x48cfc6,_0x1e32ae){var _0x16d553=_[_0x041d('0x5d')](_0x3a22a4[_0x041d('0x82')]);_0x48cfc6({'count':_0x16d553[_0x041d('0x60')],'rows':_0x16d553});});},'SendFax':function(_0x1be9ae){var _0x16cc7d=this;return new Promise(function(_0x5ba3f5,_0x187223){_0x14907f[_0x041d('0x83')](_0x1be9ae)['then'](function(_0x33acbd){_0x5ba3f5({'code':0xc8,'message':_0x33acbd[_0x041d('0x1a')]});})[_0x041d('0x20')](function(_0x370f5c){_0x187223(_0x16cc7d[_0x041d('0x11')](0x1f4,_0x370f5c[_0x041d('0x1a')]));});});},'CheckAfterSend':function(_0x269866){var _0x256de8=this;return new Promise(function(_0x310417,_0x34d4da){_0x14907f['checkAfterSend'](_0x269866)['then'](function(_0x984cf){_0x310417({'code':0xc8,'message':_0x984cf['message']});})[_0x041d('0x20')](function(_0x5676db){_0x34d4da(_0x256de8[_0x041d('0x11')](0x1f4,_0x5676db[_0x041d('0x1a')]));});});}};var _0x4a097e=jayson[_0x041d('0x84')](_0x372840)[_0x041d('0x85')]();_0x4a097e['on'](_0x041d('0x11'),function(_0x2c90aa){return _0x5f083c(_0x2c90aa);});_0x4a097e[_0x041d('0x8')](0x232a,'127.0.0.1',function(){console[_0x041d('0x86')](_0x041d('0x87'),0x232a);return _0x196419(_0x041d('0x88')+0x232a);});});}; \ No newline at end of file +var _0xafb9=['then','catch','error','message','isConnected','command','Command','voiceQueues','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','find','undefined','values','channels','length','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','resolve','StopMixMonitor','destinationchannel','stop','monitors','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','send','checkAfterSend','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','Action'];(function(_0x72337f,_0xebeab7){var _0x48545b=function(_0x9918c9){while(--_0x9918c9){_0x72337f['push'](_0x72337f['shift']());}};_0x48545b(++_0xebeab7);}(_0xafb9,0x68));var _0x9afb=function(_0x23d7c3,_0x581b2f){_0x23d7c3=_0x23d7c3-0x0;var _0x56fef4=_0xafb9[_0x23d7c3];return _0x56fef4;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var jayson=require(_0x9afb('0x2'));var schema=require(_0x9afb('0x3'));var BPromise=require(_0x9afb('0x4'));var moment=require(_0x9afb('0x5'));var config=require(_0x9afb('0x6'));var properties=require(_0x9afb('0x7'));var ami=require(_0x9afb('0x8'));exports['listen']=function(_0x498463,_0x91ffa0,_0x56a139){return new BPromise(function(_0x1ccf93,_0x548b24){var _0x556880={'QueuePause':function(_0x4c0e9d){return new Promise(function(_0x1edf77,_0x20b8c1){var _0x51dc88=util[_0x9afb('0x9')](_0x9afb('0xa'),_0x9afb('0xb'),_0x4c0e9d[_0x9afb('0xc')]);if(_0x498463[_0x9afb('0xd')]&&_0x498463['timers'][_0x51dc88]&&_0x498463['timers'][_0x51dc88][_0x9afb('0xe')]){_0x498463[_0x9afb('0xd')][_0x51dc88][_0x9afb('0xf')]();}if(_0x498463[_0x9afb('0x10')][_0x51dc88]){_0x498463[_0x9afb('0x10')][_0x51dc88][_0x9afb('0x11')]({'statePause':_0x4c0e9d[_0x9afb('0x12')]?!![]:![]});}_0x1edf77({'code':0xc8,'message':_0x9afb('0x13')});});},'Reload':function(_0x464462){var _0x10602b=this;return new Promise(function(_0x47a804,_0x27137c){if(ami['isConnected']()==![]){return _0x27137c(_0x10602b['error'](0x1f4,[config[_0x9afb('0x14')]['ip'],config[_0x9afb('0x14')][_0x9afb('0x15')],_0x9afb('0x16')][_0x9afb('0x17')]('\x20')));}_0x464462=_[_0x9afb('0x18')](_0x464462,_[_0x9afb('0x19')](properties['module']));_0x464462[_0x9afb('0x1a')]=_0x9afb('0x1b');return ami[_0x9afb('0x1c')](_0x464462)[_0x9afb('0x1d')](function(_0x223aef){_0x47a804({'code':0xc8,'message':_0x223aef['message']});})[_0x9afb('0x1e')](function(_0x50a7e4){_0x27137c(_0x10602b[_0x9afb('0x1f')](0x1f5,_0x50a7e4[_0x9afb('0x20')]));});});},'Command':function(_0x4a856b){var _0x4a1c74=this;return new Promise(function(_0x3ac42f,_0x1217d9){if(ami[_0x9afb('0x21')]()==![]){return _0x1217d9(_0x4a1c74[_0x9afb('0x1f')](0x1f4,[config[_0x9afb('0x14')]['ip'],config['asterisk'][_0x9afb('0x15')],'ami\x20disconnected']['join']('\x20')));}_0x4a856b=_[_0x9afb('0x18')](_0x4a856b,_0x9afb('0x22'));_0x4a856b[_0x9afb('0x1a')]=_0x9afb('0x23');return ami['Action'](_0x4a856b)[_0x9afb('0x1d')](function(_0x725a04){_0x3ac42f({'code':0xc8,'message':_0x725a04['content']});})['catch'](function(_0x5b5dab){_0x1217d9(_0x4a1c74[_0x9afb('0x1f')](0x1f5,_0x5b5dab['message']));});});},'VoiceQueues':function(_0x387379){return new Promise(function(_0x123510,_0x50a919){var _0x324293=[];for(var _0x28beba in _0x498463[_0x9afb('0x24')]){if(_0x498463[_0x9afb('0x24')]['hasOwnProperty'](_0x28beba)){var _0x348255=_0x498463['voiceQueues'][_0x28beba];var _0x29e092={'id':_0x348255['id'],'name':_0x348255['name'],'strategy':_0x348255['strategy'],'answered':_0x348255[_0x9afb('0x25')],'available':_0x348255[_0x9afb('0x26')],'loggedIn':_0x348255[_0x9afb('0x27')],'pTalking':_0x348255[_0x9afb('0x28')],'sumBillable':_0x348255[_0x9afb('0x29')],'sumDuration':_0x348255[_0x9afb('0x2a')],'sumHoldTime':_0x348255[_0x9afb('0x2b')]||0x0,'talking':_0x348255['talking'],'total':_0x348255['total'],'type':_0x348255[_0x9afb('0x2c')],'unmanaged':_0x348255[_0x9afb('0x2d')],'abandoned':_0x348255['abandoned'],'waiting':_0x348255[_0x9afb('0x2e')],'loggedInDb':_0x348255[_0x9afb('0x2f')]};if(_0x348255['type']===_0x9afb('0x30')){_0x29e092[_0x9afb('0x31')]=_0x348255[_0x9afb('0x31')];_0x29e092[_0x9afb('0x32')]=_0x348255[_0x9afb('0x32')];_0x29e092[_0x9afb('0x33')]=_0x348255[_0x9afb('0x33')];_0x29e092[_0x9afb('0x34')]=_0x348255['dialOriginateCallerIdNumber'];_0x29e092['dialOriginateTimeout']=_0x348255[_0x9afb('0x35')];_0x29e092[_0x9afb('0x36')]=_0x348255[_0x9afb('0x36')];_0x29e092[_0x9afb('0x37')]=_0x348255[_0x9afb('0x37')];_0x29e092[_0x9afb('0x38')]=_0x348255[_0x9afb('0x38')];_0x29e092['outboundAnswerCallsDay']=_0x348255['outboundAnswerCallsDay'];_0x29e092[_0x9afb('0x39')]=_0x348255[_0x9afb('0x39')];_0x29e092['outboundBusyCallsDay']=_0x348255[_0x9afb('0x3a')];_0x29e092['outboundCongestionCallsDay']=_0x348255[_0x9afb('0x3b')];_0x29e092[_0x9afb('0x3c')]=_0x348255['outboundDropCallsDayACS'];_0x29e092[_0x9afb('0x3d')]=_0x348255['outboundDropCallsDayCallersExit'];_0x29e092[_0x9afb('0x3e')]=_0x348255[_0x9afb('0x3e')];_0x29e092[_0x9afb('0x3f')]=_0x348255[_0x9afb('0x3f')];_0x29e092[_0x9afb('0x40')]=_0x348255[_0x9afb('0x40')];_0x29e092[_0x9afb('0x41')]=_0x348255[_0x9afb('0x41')];_0x29e092['outboundReCallsDay']=_0x348255[_0x9afb('0x42')];_0x29e092['outboundRejectCallsDay']=_0x348255[_0x9afb('0x43')];_0x29e092[_0x9afb('0x44')]=_0x348255[_0x9afb('0x44')];_0x29e092[_0x9afb('0x45')]=_0x348255[_0x9afb('0x45')];_0x29e092[_0x9afb('0x46')]=_0x348255[_0x9afb('0x46')];_0x29e092[_0x9afb('0x47')]=_0x348255[_0x9afb('0x47')];_0x29e092['predictiveIntervalDroppedCallsCallersExit']=_0x348255[_0x9afb('0x48')];_0x29e092['predictiveIntervalDroppedCallsTimeout']=_0x348255[_0x9afb('0x49')];_0x29e092[_0x9afb('0x4a')]=_0x348255[_0x9afb('0x4a')];_0x29e092['predictiveIntervalErlangCallsDroppedCalls']=_0x348255[_0x9afb('0x4b')];_0x29e092[_0x9afb('0x4c')]=_0x348255[_0x9afb('0x4c')];_0x29e092[_0x9afb('0x4d')]=_0x348255[_0x9afb('0x4d')];_0x29e092[_0x9afb('0x4e')]=_0x348255[_0x9afb('0x4e')];_0x29e092['predictiveIntervalAvailable']=_0x348255[_0x9afb('0x4f')];_0x29e092[_0x9afb('0x50')]=_0x348255[_0x9afb('0x50')];_0x29e092[_0x9afb('0x20')]=_0x348255[_0x9afb('0x20')];_0x29e092[_0x9afb('0x51')]=_0x348255[_0x9afb('0x51')];_0x29e092[_0x9afb('0x52')]=_0x348255['erlangCalls'];_0x29e092[_0x9afb('0x53')]=_0x348255['erlangCallToSecond'];_0x29e092['erlangAbandonmentRate']=_0x348255['erlangAbandonmentRate'];_0x29e092[_0x9afb('0x54')]=_0x348255[_0x9afb('0x54')];_0x29e092['startPredictive']=_0x348255[_0x9afb('0x55')];_0x29e092[_0x9afb('0x56')]=_0x348255[_0x9afb('0x56')];}if(_0x348255[_0x9afb('0x57')]){_0x29e092[_0x9afb('0x57')]={'id':_0x348255[_0x9afb('0x57')]['id'],'name':_0x348255[_0x9afb('0x57')][_0x9afb('0xc')],'active':_0x348255[_0x9afb('0x57')]['active'],'callerid':_0x348255[_0x9afb('0x57')][_0x9afb('0x58')]};}if(_0x348255[_0x9afb('0x59')]){_0x29e092[_0x9afb('0x59')]={'id':_0x348255['Interval']['id'],'name':_0x348255[_0x9afb('0x59')][_0x9afb('0xc')]};}_0x324293[_0x9afb('0x5a')](_0x29e092);}}_0x123510({'count':_0x324293['length'],'rows':_0x324293});});},'UpdateVoiceQueue':function(_0x24f76c){return new Promise(function(_0x1d79b1,_0x13179d){var _0x12eddf=_[_0x9afb('0x5b')](_0x498463[_0x9afb('0x24')],{'id':parseInt(_0x24f76c['id'])});var _0x21ce09=_['omit'](_0x24f76c,['id']);if(_0x12eddf){for(var _0x5a36e4 in _0x21ce09){if(typeof _0x21ce09[_0x5a36e4]!=='undefined'&&typeof _0x12eddf[_0x5a36e4]!==_0x9afb('0x5c')){_0x12eddf[_0x5a36e4]=_0x21ce09[_0x5a36e4];}}_0x1d79b1(_0x12eddf);}else{_0x13179d();}});},'VoiceChannels':function(_0x29cde4){return new Promise(function(_0x5a1507,_0x20bd33){var _0xdcfefd=_[_0x9afb('0x5d')](_0x498463[_0x9afb('0x5e')]);_0x5a1507({'count':_0xdcfefd[_0x9afb('0x5f')],'rows':_0xdcfefd});});},'VoiceChannelMixMonitor':function(_0x122a35){var _0xdb82c3=this;return new Promise(function(_0x1de5cf,_0x20abe4){if(ami[_0x9afb('0x21')]()==![]){return _0x20abe4(_0xdb82c3[_0x9afb('0x1f')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x9afb('0x15')],'ami\x20disconnected'][_0x9afb('0x17')]('\x20')));}var _0xd41258=schema(properties[_0x9afb('0x60')])[_0x9afb('0x3')](_0x122a35);if(_0xd41258[_0x9afb('0x5f')]>0x0){return _0x20abe4(_0xdb82c3['error'](0x1f4,_[_0x9afb('0x61')](_0xd41258,'message')[_0x9afb('0x17')](',\x20')));}var _0x222ee0=_[_0x9afb('0x5b')](_0x498463[_0x9afb('0x5e')],{'uniqueid':_0x122a35[_0x9afb('0x62')]});if(_0x222ee0&&_0x222ee0[_0x9afb('0x63')]){var _0x449a7e=util['format'](_0x9afb('0x64'),_0x122a35[_0x9afb('0x65')]||_0x122a35[_0x9afb('0x62')],_0x122a35['format']||_0x9afb('0x66'));return ami[_0x9afb('0x1c')]({'action':'MixMonitor','channel':_0x222ee0[_0x9afb('0x63')],'file':_0x449a7e,'options':_0x9afb('0x67')})[_0x9afb('0x1d')](function(_0x5bcea5){var _0x3975c0=_[_0x9afb('0x5b')](_0x222ee0['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x449a7e['toLowerCase']()});if(_[_0x9afb('0x68')](_0x3975c0)){_0x222ee0['monitors'][_0x9afb('0x5a')]({'filename':'/var/spool/asterisk/monitor/'+_0x449a7e[_0x9afb('0x69')](),'createdAt':moment()[_0x9afb('0x9')](_0x9afb('0x6a')),'mixmonitorid':_0x5bcea5['mixmonitorid'],'status':_0x9afb('0x6b')});}else{_0x3975c0[_0x9afb('0x6c')]=_0x5bcea5[_0x9afb('0x6c')];_0x3975c0[_0x9afb('0x6d')]=_0x9afb('0x6b');}_0x1de5cf({'code':0xc8,'message':[_0x122a35[_0x9afb('0x62')],'MixMonitor\x20Success',_0x5bcea5[_0x9afb('0x6c')]][_0x9afb('0x17')]('\x20'),'mixmonitorid':_0x5bcea5[_0x9afb('0x6c')]});})[_0x9afb('0x1e')](function(_0x54aeff){_0x20abe4(_0xdb82c3[_0x9afb('0x1f')](0x1f5,[_0x122a35[_0x9afb('0x62')],_0x54aeff['message'][_0x9afb('0x69')]()][_0x9afb('0x17')]('\x20')));});}else{return _0x20abe4(_0xdb82c3[_0x9afb('0x1f')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x347ce8){var _0x12b44e=this;return new Promise(function(_0x158dfd,_0x41bb8e){if(ami[_0x9afb('0x21')]()==![]){return _0x41bb8e(_0x12b44e[_0x9afb('0x1f')](0x1f4,[config[_0x9afb('0x14')]['ip'],config[_0x9afb('0x14')][_0x9afb('0x15')],_0x9afb('0x16')][_0x9afb('0x17')]('\x20')));}var _0x2404aa=schema(properties[_0x9afb('0x60')])['validate'](_0x347ce8);if(_0x2404aa[_0x9afb('0x5f')]>0x0){return _0x41bb8e(_0x12b44e[_0x9afb('0x1f')](0x1f4,_['map'](_0x2404aa,_0x9afb('0x20'))[_0x9afb('0x17')](',\x20')));}var _0x597bc7=_['find'](_0x498463[_0x9afb('0x5e')],{'uniqueid':_0x347ce8[_0x9afb('0x62')]});if(_0x597bc7){return BPromise[_0x9afb('0x6e')]()[_0x9afb('0x1d')](function(){if(_0x597bc7[_0x9afb('0x63')]){return ami['Action']({'action':_0x9afb('0x6f'),'channel':_0x597bc7[_0x9afb('0x63')],'mixmonitorid':_0x347ce8[_0x9afb('0x6c')]})[_0x9afb('0x1e')](function(_0xcd741f){});}})[_0x9afb('0x1d')](function(){if(_0x597bc7[_0x9afb('0x70')]){return ami[_0x9afb('0x1c')]({'action':'StopMixMonitor','channel':_0x597bc7[_0x9afb('0x70')],'mixmonitorid':_0x347ce8['mixmonitorid']})[_0x9afb('0x1e')](function(_0x1ff543){});}})[_0x9afb('0x1d')](function(_0x22ffa){var _0x20b9d4=_['find'](_0x597bc7['monitors'],{'mixmonitorid':_0x347ce8[_0x9afb('0x6c')]});if(_0x20b9d4){_0x20b9d4[_0x9afb('0x6d')]=_0x9afb('0x71');}})[_0x9afb('0x1d')](function(){var _0x1ecbd1=util['format'](_0x9afb('0x64'),_0x347ce8[_0x9afb('0x65')]||_0x347ce8['uniqueid'],_0x347ce8[_0x9afb('0x9')]||_0x9afb('0x66'));var _0x480c4a=_[_0x9afb('0x5b')](_0x597bc7[_0x9afb('0x72')],{'filename':'/var/spool/asterisk/monitor/'+_0x1ecbd1[_0x9afb('0x69')]()});if(_0x480c4a){_0x480c4a['status']=_0x9afb('0x71');}})[_0x9afb('0x1d')](function(){_0x158dfd({'code':0xc8,'message':[_0x347ce8[_0x9afb('0x62')],_0x9afb('0x73')][_0x9afb('0x17')]('\x20')});})['catch'](function(_0x4be2a5){_0x41bb8e(_0x12b44e[_0x9afb('0x1f')](0x1f5,[_0x347ce8[_0x9afb('0x62')],_0x4be2a5[_0x9afb('0x20')]['toLowerCase']()][_0x9afb('0x17')]('\x20')));});}else{return _0x41bb8e(_0x12b44e[_0x9afb('0x1f')](0x1f5,_0x9afb('0x74')));}});},'VoiceQueuesChannels':function(_0x5357b4){return new Promise(function(_0x3c16a8,_0x1ee714){var _0x134716=_[_0x9afb('0x5d')](_0x498463[_0x9afb('0x75')]);_0x3c16a8({'count':_0x134716[_0x9afb('0x5f')],'rows':_0x134716});});},'VoiceQueuesChannel':function(_0x4f3a42){var _0x3084b3=this;return new Promise(function(_0x5b8b4a,_0x463df3){var _0x1f5a39=schema(properties[_0x9afb('0x76')])['validate'](_0x4f3a42);if(_0x1f5a39[_0x9afb('0x5f')]>0x0){return _0x463df3(_0x3084b3['error'](0x1f4,_[_0x9afb('0x61')](_0x1f5a39,_0x9afb('0x20'))['join'](',\x20')));}var _0x1a43bf=_[_0x9afb('0x5b')](_0x498463[_0x9afb('0x75')],{'uniqueid':_0x4f3a42[_0x9afb('0x62')]});if(_0x1a43bf){_0x5b8b4a(_0x1a43bf);}else{return _0x463df3(_0x3084b3['error'](0x1f5,_0x9afb('0x74')));}});},'VoiceQueuesChannelHangup':function(_0x2c8f29){var _0x3af5af=this;return new Promise(function(_0x1e3500,_0x1fa9cc){if(ami['isConnected']()==![]){return _0x1fa9cc(_0x3af5af[_0x9afb('0x1f')](0x1f4,[config[_0x9afb('0x14')]['ip'],config['asterisk'][_0x9afb('0x15')],_0x9afb('0x16')][_0x9afb('0x17')]('\x20')));}var _0x203e5e=schema(properties['voicequeuechannelhangup'])[_0x9afb('0x3')](_0x2c8f29);if(_0x203e5e[_0x9afb('0x5f')]>0x0){return _0x1fa9cc(_0x3af5af[_0x9afb('0x1f')](0x1f4,_[_0x9afb('0x61')](_0x203e5e,_0x9afb('0x20'))[_0x9afb('0x17')](',\x20')));}var _0x5a4596=_[_0x9afb('0x5b')](_0x498463['queueChannels'],{'uniqueid':_0x2c8f29[_0x9afb('0x62')]});if(_0x5a4596&&_0x5a4596[_0x9afb('0x63')]){return ami[_0x9afb('0x1c')]({'action':_0x9afb('0x77'),'channel':_0x5a4596[_0x9afb('0x63')]})[_0x9afb('0x1d')](function(_0x3db3bb){_0x1e3500({'code':0xc8,'message':[_0x2c8f29[_0x9afb('0x62')],_0x3db3bb['message'][_0x9afb('0x69')]()][_0x9afb('0x17')]('\x20')});})[_0x9afb('0x1e')](function(_0x34ae00){_0x1fa9cc(_0x3af5af[_0x9afb('0x1f')](0x1f5,[_0x2c8f29[_0x9afb('0x62')],_0x34ae00[_0x9afb('0x20')][_0x9afb('0x69')]()][_0x9afb('0x17')]('\x20')));});}else{return _0x1fa9cc(_0x3af5af['error'](0x1f5,_0x9afb('0x74')));}});},'VoiceQueuesChannelRedirect':function(_0x9be6f0){var _0x378462=this;return new Promise(function(_0x14a47f,_0x207180){if(ami[_0x9afb('0x21')]()==![]){return _0x207180(_0x378462['error'](0x1f4,[config[_0x9afb('0x14')]['ip'],config[_0x9afb('0x14')][_0x9afb('0x15')],_0x9afb('0x16')]['join']('\x20')));}var _0x372aed=schema(properties[_0x9afb('0x78')])[_0x9afb('0x3')](_0x9be6f0);if(_0x372aed[_0x9afb('0x5f')]>0x0){return _0x207180(_0x378462['error'](0x1f4,_[_0x9afb('0x61')](_0x372aed,'message')[_0x9afb('0x17')](',\x20')));}var _0x5d1d8e=_[_0x9afb('0x5b')](_0x498463[_0x9afb('0x75')],{'uniqueid':_0x9be6f0[_0x9afb('0x62')]});if(_0x5d1d8e&&_0x5d1d8e['channel']){return ami[_0x9afb('0x1c')]({'action':'Redirect','channel':_0x5d1d8e['channel'],'exten':_0x9be6f0[_0x9afb('0x79')],'context':_0x9be6f0['context']||_0x5d1d8e[_0x9afb('0x7a')],'priority':0x1})[_0x9afb('0x1d')](function(_0x5ce675){_0x14a47f({'code':0xc8,'message':[_0x9be6f0['uniqueid'],_0x5ce675[_0x9afb('0x20')][_0x9afb('0x69')]()]['join']('\x20')});})[_0x9afb('0x1e')](function(_0x29f1f2){_0x207180(_0x378462[_0x9afb('0x1f')](0x1f5,[_0x9be6f0['uniqueid'],_0x29f1f2['message'][_0x9afb('0x69')]()][_0x9afb('0x17')]('\x20')));});}else{return _0x207180(_0x378462[_0x9afb('0x1f')](0x1f5,_0x9afb('0x74')));}});},'Agents':function(_0x46ff4c){return new Promise(function(_0x2991d3,_0x19667d){var _0x369bfb=_[_0x9afb('0x5d')](_0x498463[_0x9afb('0x10')]);_0x2991d3({'count':_0x369bfb['length'],'rows':_0x369bfb});});},'Telephones':function(_0x3c0107){return new Promise(function(_0x14d0f5,_0x535977){var _0x29f047=_['values'](_0x498463[_0x9afb('0x7b')]);_0x14d0f5({'count':_0x29f047[_0x9afb('0x5f')],'rows':_0x29f047});});},'Trunks':function(_0x3ccba9){return new Promise(function(_0xb4a934,_0x538303){var _0x357f57=_['values'](_0x498463[_0x9afb('0x7c')]);_0xb4a934({'count':_0x357f57[_0x9afb('0x5f')],'rows':_0x357f57});});},'OutboundChannels':function(_0x267f7b){return new Promise(function(_0x9acaba,_0x2d6cf1){var _0x4e5467=_['values'](_0x498463[_0x9afb('0x7d')]);_0x9acaba({'count':_0x4e5467['length'],'rows':_0x4e5467});});},'Outbound':function(_0x3cc289){return new Promise(function(_0x2269cc,_0xa3b371){_0x2269cc(_0x498463[_0x9afb('0x30')]);});},'Campaigns':function(_0x4866bd){return new Promise(function(_0x3e5b87,_0x1222f9){var _0x3c96a2=_['values'](_0x498463[_0x9afb('0x7e')]);_0x3e5b87({'count':_0x3c96a2[_0x9afb('0x5f')],'rows':_0x3c96a2});});},'VoiceQueuesPreview':function(_0x24d635){var _0x53d995=this;return new Promise(function(_0x3ebfea,_0x44e3f7){_0x91ffa0['run'](_0x24d635['id'])['then'](function(_0x422edb){_0x3ebfea({'code':0xc8,'message':_0x422edb[_0x9afb('0x20')]});})[_0x9afb('0x1e')](function(_0x83e860){_0x44e3f7(_0x53d995['error'](0x1f4,_0x83e860[_0x9afb('0x20')]));});});},'EventManager':function(_0x120f44){var _0x24a00b=this;return new Promise(function(_0x19a30d,_0xf484b8){if(!_0x120f44[_0x9afb('0x7f')]){return _0xf484b8(_0x24a00b[_0x9afb('0x1f')](0x1f4,_0x9afb('0x80')));}ami['emit'](_0x9afb('0x81')+_0x120f44[_0x9afb('0x7f')],_0x120f44[_0x9afb('0x20')]);_0x19a30d({'code':0xc8,'message':_0x120f44});});},'FaxAccounts':function(_0x2c7a5b){return new Promise(function(_0x194263,_0x173e75){var _0x1faa74=_[_0x9afb('0x5d')](_0x498463['faxAccounts']);_0x194263({'count':_0x1faa74[_0x9afb('0x5f')],'rows':_0x1faa74});});},'SendFax':function(_0x5e5325){var _0xabe6c=this;return new Promise(function(_0x3c6761,_0x3fb617){_0x56a139[_0x9afb('0x82')](_0x5e5325)['then'](function(_0x8cabe2){_0x3c6761({'code':0xc8,'message':_0x8cabe2['message']});})[_0x9afb('0x1e')](function(_0x349fcd){_0x3fb617(_0xabe6c['error'](0x1f4,_0x349fcd[_0x9afb('0x20')]));});});},'CheckAfterSend':function(_0x1997fa){var _0x1c0150=this;return new Promise(function(_0x1cf4ed,_0x287583){_0x56a139[_0x9afb('0x83')](_0x1997fa)[_0x9afb('0x1d')](function(_0x3ba7d7){_0x1cf4ed({'code':0xc8,'message':_0x3ba7d7[_0x9afb('0x20')]});})[_0x9afb('0x1e')](function(_0x17fc1c){_0x287583(_0x1c0150[_0x9afb('0x1f')](0x1f4,_0x17fc1c[_0x9afb('0x20')]));});});}};var _0x376f63=jayson['server'](_0x556880)['http']();_0x376f63['on']('error',function(_0x23a5ad){return _0x548b24(_0x23a5ad);});_0x376f63['listen'](0x232a,'127.0.0.1',function(){console['log'](_0x9afb('0x84'),0x232a);return _0x1ccf93('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 884b623..923e12c 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 _0x171c=['$or','map','calleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','destcalleridnum','','calleridname','Unknown','destcalleridname','resolve','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','routeId','push','format','user:%s','name','trigger:%s','action','toLowerCase','merge','length','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data2','xmd-contactid','ListId','data3'];(function(_0x35b205,_0x24e696){var _0x20ecb2=function(_0xead3ac){while(--_0xead3ac){_0x35b205['push'](_0x35b205['shift']());}};_0x20ecb2(++_0x24e696);}(_0x171c,0x13e));var _0xc171=function(_0x4103e0,_0x1f681a){_0x4103e0=_0x4103e0-0x0;var _0x955879=_0x171c[_0x4103e0];return _0x955879;};'use strict';var _=require('lodash');var BPromise=require(_0xc171('0x0'));var Redis=require(_0xc171('0x1'));var util=require(_0xc171('0x2'));var config=require(_0xc171('0x3'));var logger=require(_0xc171('0x4'))('trigger');var cmContactRpc=require(_0xc171('0x5'));config[_0xc171('0x6')]=_[_0xc171('0x7')](config['redis'],{'host':_0xc171('0x8'),'port':0x18eb});var io=require(_0xc171('0x9'))(new Redis(config[_0xc171('0x6')]));function emit(_0x38e801,_0x885d2d,_0x51a5f0,_0x2432d0,_0x1e635f){logger[_0xc171('0xa')](_0xc171('0xb'),_0x38e801,_0x885d2d['id'],_0x51a5f0,_0x2432d0,JSON[_0xc171('0xc')](_0x1e635f));io['to'](_0x51a5f0)[_0xc171('0xd')](_0x2432d0,_0x1e635f);}exports['exec']=function(_0x1d6798,_0x313da9,_0x366a74,_0x30a1f2){var _0xe9d8eb,_0x4a206d;var _0x36d29b={};var _0x17959d=Number(_0x366a74['data1']);var _0x1cb884=_0x366a74[_0xc171('0xe')]?Boolean(Number(_0x366a74[_0xc171('0xe')])):![];var _0x10ccbd;if(_0x30a1f2['xmd-contactid']){_0x36d29b['id']=_0x30a1f2[_0xc171('0xf')];}if(!_0x36d29b['id']){_0x36d29b[_0xc171('0x10')]=_0x17959d;_0x10ccbd=_0x366a74[_0xc171('0x11')]&&_0x366a74[_0xc171('0x11')]!=='0'?_0x366a74['data3']['split'](','):['phone'];_0x36d29b[_0xc171('0x12')]=_[_0xc171('0x13')](_0x10ccbd,function(_0x17a841){var _0x2c5baf={};_0x2c5baf[_0x17a841]=_0x30a1f2['routeId']?_0x30a1f2['destcalleridnum']:_0x30a1f2[_0xc171('0x14')];return _0x2c5baf;});}var _0x3280d5=['id',_0xc171('0x15'),_0xc171('0x16'),'phone',_0xc171('0x17'),_0xc171('0x18'),_0xc171('0x10'),'createdAt',_0xc171('0x19'),_0xc171('0x1a')];var _0x21a9dd=_['union'](_0x3280d5,_0x10ccbd);BPromise['resolve']()[_0xc171('0x1b')](cmContactRpc[_0xc171('0x1c')]({'attributes':_0x21a9dd,'where':_0x36d29b}))[_0xc171('0x1b')](function(_0x24a904){_0x4a206d=_0x24a904;if(!_[_0xc171('0x1d')](_0x4a206d)){if(_0x4a206d['length']===0x1){_0xe9d8eb=_0x4a206d[0x0];logger[_0xc171('0xa')](_0xc171('0x1e'),_0x30a1f2['uniqueid'],_0x313da9['id'],_0xe9d8eb['id']);}else{logger[_0xc171('0xa')](_0xc171('0x1f'),_0x30a1f2[_0xc171('0x20')],_0x313da9['id'],_[_0xc171('0x13')](_0x4a206d,'id')[_0xc171('0x21')](','));}return;}else{logger[_0xc171('0xa')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x30a1f2[_0xc171('0x20')],_0x313da9['id']);var _0x111348={'ListId':_0x17959d};var _0x243838=_0x366a74[_0xc171('0x22')]&&_0x366a74['data4']!=='0'?_0x366a74[_0xc171('0x22')]:'phone';if(_0x1cb884){logger[_0xc171('0xa')](_0xc171('0x23'),_0x30a1f2[_0xc171('0x20')],_0x313da9['id']);_0x111348[_0x243838]=_[_0xc171('0x24')](_0x30a1f2['routeId'])?_0x30a1f2[_0xc171('0x14')]:_0x30a1f2[_0xc171('0x25')];if(_[_0xc171('0x24')](_0x30a1f2['routeId'])){_0x111348[_0xc171('0x15')]=_0x30a1f2['calleridname']&&_0x30a1f2['calleridname']!==_0xc171('0x26')?_0x30a1f2[_0xc171('0x27')]:_0xc171('0x28');}else{_0x111348[_0xc171('0x15')]=_0x30a1f2[_0xc171('0x29')]&&_0x30a1f2[_0xc171('0x29')]!==_0xc171('0x26')?_0x30a1f2[_0xc171('0x29')]:_0xc171('0x28');}return BPromise[_0xc171('0x2a')]()[_0xc171('0x1b')](cmContactRpc[_0xc171('0x2b')](_0x111348))['then'](function(_0x52c021){_0xe9d8eb=_0x52c021;_0x4a206d['push'](_0x52c021);if(_0xe9d8eb){logger[_0xc171('0xa')](_0xc171('0x2c'),_0x30a1f2[_0xc171('0x20')],_0x313da9['id'],_0xe9d8eb['id']);}return;});}else{logger[_0xc171('0xa')](_0xc171('0x2d'),_0x30a1f2['uniqueid'],_0x313da9['id']);_0x111348[_0x243838]=_[_0xc171('0x24')](_0x30a1f2[_0xc171('0x2e')])?_0x30a1f2[_0xc171('0x14')]:_0x30a1f2['destcalleridnum'];if(_[_0xc171('0x24')](_0x30a1f2[_0xc171('0x2e')])){_0x111348['firstName']=_0x30a1f2[_0xc171('0x27')]&&_0x30a1f2[_0xc171('0x27')]!==_0xc171('0x26')?_0x30a1f2[_0xc171('0x27')]:_0xc171('0x28');}else{_0x111348[_0xc171('0x15')]=_0x30a1f2[_0xc171('0x29')]&&_0x30a1f2['destcalleridname']!==''?_0x30a1f2[_0xc171('0x29')]:_0xc171('0x28');}_0xe9d8eb=_0x111348;_0x4a206d[_0xc171('0x2f')](_0x111348);return;}}})[_0xc171('0x1b')](function(){if(_0x1d6798){emit(_0x30a1f2[_0xc171('0x20')],_0x313da9,util[_0xc171('0x30')](_0xc171('0x31'),_0x1d6798[_0xc171('0x32')]),util[_0xc171('0x30')](_0xc171('0x33'),_0x366a74[_0xc171('0x34')][_0xc171('0x35')]()),{'evt':_[_0xc171('0x36')](_0x30a1f2,{'autoCreate':_0x1cb884}),'contact':_0xe9d8eb===undefined?{}:_0xe9d8eb,'contacts':_0x4a206d[_0xc171('0x37')]===0x0?undefined:_0x4a206d});}});}; \ No newline at end of file +var _0x3be8=['merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','emit','exec','data2','xmd-contactid','data3','split','phone','destcalleridnum','lastName','mobile','ListId','scheduledAt','updatedAt','union','then','getContacts','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','calleridnum','firstName','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','action'];(function(_0x40ee8f,_0x54f7bf){var _0x363bb6=function(_0x3316e6){while(--_0x3316e6){_0x40ee8f['push'](_0x40ee8f['shift']());}};_0x363bb6(++_0x54f7bf);}(_0x3be8,0x105));var _0x83be=function(_0x48aaca,_0x140945){_0x48aaca=_0x48aaca-0x0;var _0xac5ed9=_0x3be8[_0x48aaca];return _0xac5ed9;};'use strict';var _=require(_0x83be('0x0'));var BPromise=require(_0x83be('0x1'));var Redis=require(_0x83be('0x2'));var util=require(_0x83be('0x3'));var config=require('../../../../config/environment');var logger=require(_0x83be('0x4'))(_0x83be('0x5'));var cmContactRpc=require(_0x83be('0x6'));config[_0x83be('0x7')]=_[_0x83be('0x8')](config[_0x83be('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x83be('0x9'))(new Redis(config[_0x83be('0x7')]));function emit(_0x2a451e,_0x4ccdec,_0x169a48,_0x345cbd,_0xd47685){logger[_0x83be('0xa')]('[CM][%s][%s]',_0x2a451e,_0x4ccdec['id'],_0x169a48,_0x345cbd,JSON['stringify'](_0xd47685));io['to'](_0x169a48)[_0x83be('0xb')](_0x345cbd,_0xd47685);}exports[_0x83be('0xc')]=function(_0x16276f,_0x347c3b,_0x37b77f,_0x678d7f){var _0x59d4f9,_0x3be99c;var _0x272a12={};var _0x597cda=Number(_0x37b77f['data1']);var _0x4f134a=_0x37b77f[_0x83be('0xd')]?Boolean(Number(_0x37b77f['data2'])):![];var _0x5dd865;if(_0x678d7f[_0x83be('0xe')]){_0x272a12['id']=_0x678d7f[_0x83be('0xe')];}if(!_0x272a12['id']){_0x272a12['ListId']=_0x597cda;_0x5dd865=_0x37b77f[_0x83be('0xf')]&&_0x37b77f[_0x83be('0xf')]!=='0'?_0x37b77f['data3'][_0x83be('0x10')](','):[_0x83be('0x11')];_0x272a12['$or']=_['map'](_0x5dd865,function(_0x5d977f){var _0x3492cb={};_0x3492cb[_0x5d977f]=_0x678d7f['routeId']?_0x678d7f[_0x83be('0x12')]:_0x678d7f['calleridnum'];return _0x3492cb;});}var _0x14a0db=['id','firstName',_0x83be('0x13'),'phone',_0x83be('0x14'),'fax',_0x83be('0x15'),'createdAt',_0x83be('0x16'),_0x83be('0x17')];var _0x2b5d9f=_[_0x83be('0x18')](_0x14a0db,_0x5dd865);BPromise['resolve']()[_0x83be('0x19')](cmContactRpc[_0x83be('0x1a')]({'attributes':_0x2b5d9f,'where':_0x272a12}))['then'](function(_0x34dbd1){_0x3be99c=_0x34dbd1;if(!_['isEmpty'](_0x3be99c)){if(_0x3be99c[_0x83be('0x1b')]===0x1){_0x59d4f9=_0x3be99c[0x0];logger['info'](_0x83be('0x1c'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id'],_0x59d4f9['id']);}else{logger[_0x83be('0xa')](_0x83be('0x1e'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id'],_['map'](_0x3be99c,'id')[_0x83be('0x1f')](','));}return;}else{logger[_0x83be('0xa')](_0x83be('0x20'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id']);var _0x27c1ae={'ListId':_0x597cda};var _0x89820c=_0x37b77f[_0x83be('0x21')]&&_0x37b77f[_0x83be('0x21')]!=='0'?_0x37b77f[_0x83be('0x21')]:_0x83be('0x11');if(_0x4f134a){logger[_0x83be('0xa')](_0x83be('0x22'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id']);_0x27c1ae[_0x89820c]=_[_0x83be('0x23')](_0x678d7f[_0x83be('0x24')])?_0x678d7f[_0x83be('0x25')]:_0x678d7f[_0x83be('0x12')];if(_[_0x83be('0x23')](_0x678d7f[_0x83be('0x24')])){_0x27c1ae[_0x83be('0x26')]=_0x678d7f[_0x83be('0x27')]&&_0x678d7f[_0x83be('0x27')]!==_0x83be('0x28')?_0x678d7f[_0x83be('0x27')]:_0x83be('0x29');}else{_0x27c1ae[_0x83be('0x26')]=_0x678d7f[_0x83be('0x2a')]&&_0x678d7f[_0x83be('0x2a')]!==_0x83be('0x28')?_0x678d7f[_0x83be('0x2a')]:'Unknown';}return BPromise[_0x83be('0x2b')]()[_0x83be('0x19')](cmContactRpc[_0x83be('0x2c')](_0x27c1ae))['then'](function(_0x3002ee){_0x59d4f9=_0x3002ee;_0x3be99c[_0x83be('0x2d')](_0x3002ee);if(_0x59d4f9){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x678d7f[_0x83be('0x1d')],_0x347c3b['id'],_0x59d4f9['id']);}return;});}else{logger[_0x83be('0xa')](_0x83be('0x2e'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id']);_0x27c1ae[_0x89820c]=_[_0x83be('0x23')](_0x678d7f['routeId'])?_0x678d7f[_0x83be('0x25')]:_0x678d7f['destcalleridnum'];if(_['isNil'](_0x678d7f[_0x83be('0x24')])){_0x27c1ae[_0x83be('0x26')]=_0x678d7f[_0x83be('0x27')]&&_0x678d7f['calleridname']!==_0x83be('0x28')?_0x678d7f[_0x83be('0x27')]:_0x83be('0x29');}else{_0x27c1ae['firstName']=_0x678d7f['destcalleridname']&&_0x678d7f[_0x83be('0x2a')]!==_0x83be('0x28')?_0x678d7f['destcalleridname']:_0x83be('0x29');}_0x59d4f9=_0x27c1ae;_0x3be99c[_0x83be('0x2d')](_0x27c1ae);return;}}})['then'](function(){if(_0x16276f){emit(_0x678d7f[_0x83be('0x1d')],_0x347c3b,util[_0x83be('0x2f')](_0x83be('0x30'),_0x16276f['name']),util[_0x83be('0x2f')](_0x83be('0x31'),_0x37b77f[_0x83be('0x32')]['toLowerCase']()),{'evt':_[_0x83be('0x33')](_0x678d7f,{'autoCreate':_0x4f134a}),'contact':_0x59d4f9===undefined?{}:_0x59d4f9,'contacts':_0x3be99c[_0x83be('0x1b')]===0x0?undefined:_0x3be99c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 7e0849a..09f53ce 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 _0x36a5=['Actions','length','action','toLowerCase','contactmanager','motionbar','data1','TemplateId','data2','html','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','name','trigger:%s:%s','user:%s','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','render','query','search','replace','channel','AllConditions','every','checkConditions','some','AnyConditions','field','account','chat','ChatWebsiteId','AccountId','operator','value','upperFirst','interaction','message','event','agent','membername','lastevent','exports','util','lodash','url','ioredis','./urlforward','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','accounts','salesforceAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','motionChannel','undefined','voice','checkTriggers','interface','checkTrigger','merge','variables'];(function(_0x253e33,_0x4dfe57){var _0x4a8819=function(_0x40bef8){while(--_0x40bef8){_0x253e33['push'](_0x253e33['shift']());}};_0x4a8819(++_0x4dfe57);}(_0x36a5,0xb4));var _0x536a=function(_0xf92c86,_0x2ea385){_0xf92c86=_0xf92c86-0x0;var _0x231b4a=_0x36a5[_0xf92c86];return _0x231b4a;};'use strict';var util=require(_0x536a('0x0'));var _=require(_0x536a('0x1'));var url=require(_0x536a('0x2'));var Mustache=require('mustache');var Redis=require(_0x536a('0x3'));var urlforward=require(_0x536a('0x4'));var integration=require('./integration');var cmContact=require(_0x536a('0x5'));var script=require('./script');var config=require(_0x536a('0x6'));var logger=require(_0x536a('0x7'))(_0x536a('0x8'));var ami=require(_0x536a('0x9'));config[_0x536a('0xa')]=_['defaults'](config[_0x536a('0xa')],{'host':_0x536a('0xb'),'port':0x18eb});var io=require(_0x536a('0xc'))(new Redis(config[_0x536a('0xa')]));var operators={'equals':function(_0x576b08,_0x38c16f){return _0x576b08==_0x38c16f;},'not_equals':function(_0x104a6b,_0x398d71){return _0x104a6b!=_0x398d71;}};var barAndWebActions=[_0x536a('0xd'),_0x536a('0x2'),'winapp'];function Trigger(_0x341431){this[_0x536a('0xe')]=_0x341431[_0x536a('0xe')];this[_0x536a('0xf')]=_0x341431[_0x536a('0xf')];this[_0x536a('0x10')]=_0x341431['voiceQueues'];this['templates']=_0x341431[_0x536a('0x11')];this[_0x536a('0x12')]=_0x341431[_0x536a('0x12')];this[_0x536a('0x13')]=_0x341431[_0x536a('0x13')];this['freshdeskAccounts']=_0x341431[_0x536a('0x14')];this['salesforceAccounts']=_0x341431['salesforceAccounts'];this['sugarcrmAccounts']=_0x341431[_0x536a('0x15')];this[_0x536a('0x16')]=_0x341431[_0x536a('0x16')];this['deskAccounts']=_0x341431[_0x536a('0x17')];this[_0x536a('0x18')]=_0x341431[_0x536a('0x18')];this['servicenowAccounts']=_0x341431['servicenowAccounts'];this[_0x536a('0x19')]=_0x341431['dynamics365Accounts'];this[_0x536a('0x1a')]=_0x341431[_0x536a('0x1a')];this[_0x536a('0x1b')]={'zendesk':this[_0x536a('0x13')],'salesforce':this[_0x536a('0x1c')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x536a('0x16')],'desk':this[_0x536a('0x17')],'vtiger':this[_0x536a('0x18')],'dynamics365':this[_0x536a('0x19')],'freshsales':this[_0x536a('0x1a')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0x536a('0x1d')][_0x536a('0x1e')](this));ami['on'](_0x536a('0x1f'),this[_0x536a('0x1d')][_0x536a('0x1e')](this));ami['on'](_0x536a('0x20'),this['syncCustomEvent'][_0x536a('0x1e')](this));ami['on']('custom:agentcomplete',this[_0x536a('0x1d')]['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x536a('0x1d')][_0x536a('0x1e')](this));ami['on'](_0x536a('0x21'),this[_0x536a('0x1d')][_0x536a('0x1e')](this));ami['on']('custom:agentbusy',this[_0x536a('0x1d')]['bind'](this));ami['on'](_0x536a('0x22'),this[_0x536a('0x1d')]['bind'](this));ami['on'](_0x536a('0x23'),this[_0x536a('0x1d')]['bind'](this));ami['on'](_0x536a('0x24'),this['syncCustomEvent'][_0x536a('0x1e')](this));ami['on'](_0x536a('0x25'),this[_0x536a('0x1d')][_0x536a('0x1e')](this));ami['on'](_0x536a('0x26'),this['syncCustomEvent'][_0x536a('0x1e')](this));ami['on'](_0x536a('0x27'),this['syncAgentDial'][_0x536a('0x1e')](this));ami['on'](_0x536a('0x28'),this[_0x536a('0x29')]['bind'](this));ami['on'](_0x536a('0x2a'),this[_0x536a('0x29')]['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0x536a('0x1e')](this));ami['on']('custom:closedinteraction',this[_0x536a('0x1d')][_0x536a('0x1e')](this));ami['on']('custom:incomingmessage',this[_0x536a('0x1d')]['bind'](this));ami['on'](_0x536a('0x2b'),this[_0x536a('0x1d')][_0x536a('0x1e')](this));ami['on'](_0x536a('0x2c'),this[_0x536a('0x1d')][_0x536a('0x1e')](this));ami['on'](_0x536a('0x2d'),this[_0x536a('0x1d')][_0x536a('0x1e')](this));}Trigger[_0x536a('0x2e')]['emit']=function(_0x2b4652,_0x22870a,_0x11f1be){logger['info'](_0x2b4652,_0x22870a,JSON['stringify'](_0x11f1be));io['to'](_0x2b4652)[_0x536a('0x2f')](_0x22870a,_0x11f1be);};Trigger[_0x536a('0x2e')][_0x536a('0x1d')]=function(_0x5a9b61){var _0x5224e3=_['clone'](_0x5a9b61);if(typeof _0x5224e3[_0x536a('0x30')]===_0x536a('0x31')){_0x5224e3[_0x536a('0x30')]=_0x536a('0x32');}this[_0x536a('0x33')](_0x5224e3);};Trigger[_0x536a('0x2e')][_0x536a('0x29')]=function(_0x26f1c5){if(this['agents'][_0x26f1c5[_0x536a('0x34')]]){this[_0x536a('0x1d')](_0x26f1c5);}};Trigger[_0x536a('0x2e')][_0x536a('0x33')]=function(_0x39aecc){var _0x31cd8e;for(var _0x259079 in this['triggers']){if(this[_0x536a('0xe')]['hasOwnProperty'](_0x259079)){if(this[_0x536a('0xe')][_0x259079]['status']){_0x31cd8e=this[_0x536a('0x35')](this[_0x536a('0xe')][_0x259079],_0x39aecc);if(_0x31cd8e){_[_0x536a('0x36')](_0x39aecc,_0x39aecc[_0x536a('0x37')]);for(var _0x557fa7=0x0,_0x2f4eba,_0x28e3aa,_0x4e8e63;_0x557fa70x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +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(_0x100a9d,_0x598081){var _0x177ca3=function(_0x4b153e){while(--_0x4b153e){_0x100a9d['push'](_0x100a9d['shift']());}};_0x177ca3(++_0x598081);}(_0x7217,0x19e));var _0x7721=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7217[_0xf50820];return _0x2a9b10;};'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 01703e6..fd6b215 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 _0x3d67=['clientSecret','then','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','toUpperCase','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','internalemailaddress','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','telephone1','contactid','info',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','nameField','indexOf','content','ticketType','POST','incidents','assign','Subjects','/contacts(','Fields','phonecall','phonecalls','getString','callDirection','queue','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','util','./util','ioredis','../../../../config/logger','dynamics365','defaults','redis','localhost','socket.io-emitter','clientId','remoteUri','username','password'];(function(_0x148425,_0x3fabfd){var _0x410e6b=function(_0x37ce44){while(--_0x37ce44){_0x148425['push'](_0x148425['shift']());}};_0x410e6b(++_0x3fabfd);}(_0x3d67,0x1dc));var _0x73d6=function(_0x3f23a3,_0xe923b0){_0x3f23a3=_0x3f23a3-0x0;var _0x3e6488=_0x3d67[_0x3f23a3];return _0x3e6488;};'use strict';var _=require(_0x73d6('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0x73d6('0x1'));var intUtil=require(_0x73d6('0x2'));var md5=require('md5');var Redis=require(_0x73d6('0x3'));var logger=require(_0x73d6('0x4'))(_0x73d6('0x5'));var config=require('../../../../config/environment');config['redis']=_[_0x73d6('0x6')](config[_0x73d6('0x7')],{'host':_0x73d6('0x8'),'port':0x18eb});var io=require(_0x73d6('0x9'))(new Redis(config['redis']));function getAuthToken(_0x1ca3b3,_0x317430,_0x44c497){var _0x2c86b0={'method':'POST','uri':_0x317430,'form':{'client_id':_0x1ca3b3[_0x73d6('0xa')],'resource':_0x1ca3b3[_0x73d6('0xb')],'username':_0x1ca3b3[_0x73d6('0xc')],'password':_0x1ca3b3[_0x73d6('0xd')],'grant_type':_0x73d6('0xd'),'client_secret':_0x1ca3b3[_0x73d6('0xe')]},'json':!![]};return rp(_0x2c86b0)[_0x73d6('0xf')](function(_0x376849){return _0x376849['access_token'];})[_0x73d6('0x10')](function(_0x1c0ca1){logger['error']('['+[_0x44c497['toUpperCase']()]+_0x73d6('0x11'));return _0x1c0ca1[_0x73d6('0x12')];});}function getUser(_0x2c0c0b,_0x2b5c9d,_0x12b406,_0xb04d5b,_0x2899c0,_0x2a9daa){return new BPromise(function(_0x1810ff,_0x3fb538){return getAuthToken(_0x2b5c9d,_0xb04d5b,_0x2a9daa)[_0x73d6('0xf')](function(_0x582b04){var _0x54a928={'method':_0x73d6('0x13'),'uri':_0x2899c0+_0x73d6('0x14'),'headers':{'Authorization':_0x73d6('0x15')+_0x582b04,'OData-Version':_0x73d6('0x16')},'json':!![]};return rp(_0x54a928);})[_0x73d6('0xf')](function(_0x409469){var _0x2e8462=_0x409469[_0x73d6('0x17')];var _0x3686ff=![];var _0x2a2986=null;if(!_[_0x73d6('0x18')](_0x12b406)){if(intUtil[_0x73d6('0x19')](_0x12b406[_0x73d6('0x1a')])){_0x2c0c0b[_0x73d6('0x1b')]=_0x12b406[_0x73d6('0x1a')];for(_0x2a2986=0x0;_0x2a2986<_0x2e8462['length'];_0x2a2986++){if(_0x2e8462[_0x2a2986]['internalemailaddress']===_0x12b406['email']&&!_0x2e8462[_0x2a2986]['isdisabled']){_0x3686ff=!![];logger['info']('['+[_0x2a9daa[_0x73d6('0x1c')]()]+']\x20Agent\x20found\x20'+_0x2e8462[_0x2a2986][_0x73d6('0x1d')]+'!');_0x2c0c0b[_0x73d6('0x1e')]=_0x2e8462[_0x2a2986][_0x73d6('0x1d')];}}}}if(!_0x3686ff){logger['info']('['+[_0x2a9daa[_0x73d6('0x1c')]()]+_0x73d6('0x1f'));_0x2c0c0b[_0x73d6('0x1b')]=_0x2b5c9d[_0x73d6('0xc')];for(_0x2a2986=0x0;_0x2a2986<_0x2e8462[_0x73d6('0x20')];_0x2a2986++){if(_0x2e8462[_0x2a2986][_0x73d6('0x21')]===_0x2b5c9d['username']){_0x2c0c0b[_0x73d6('0x1e')]=_0x2e8462[_0x2a2986]['systemuserid'];}}}_0x1810ff(_0x2c0c0b);})[_0x73d6('0x10')](function(_0x5deb9a){_0x3fb538(_0x5deb9a[_0x73d6('0x12')]);});});}function createEndUser(_0x28aaca,_0x4082e5,_0x554504,_0x199256,_0x4a08d2,_0x5a59e7){return new BPromise(function(_0x580550,_0x56d0c4){return getAuthToken(_0x4082e5,_0x554504,_0x5a59e7)[_0x73d6('0xf')](function(_0x8f4307){var _0xa12764=_0x5a59e7[_0x73d6('0x22')]()===_0x73d6('0x23')?_0x4a08d2[_0x73d6('0x24')]:_0x4a08d2['calleridnum'];var _0x53ce98={'method':'POST','uri':_0x199256+_0x73d6('0x25'),'body':{'telephone1':_0xa12764,'fullname':_0xa12764,'firstname':_0xa12764,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x73d6('0x26')+_0x28aaca['userId']+')'},'headers':{'Authorization':_0x73d6('0x15')+_0x8f4307,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x53ce98);})[_0x73d6('0xf')](function(_0x9533e6){var _0x1c0959=_0x9533e6[_0x73d6('0x27')][_0x73d6('0x28')];var _0x187796=_0x1c0959[_0x73d6('0x29')](_0x1c0959[_0x73d6('0x2a')]('(')+0x1,_0x1c0959[_0x73d6('0x2a')](')'));_0x28aaca[_0x73d6('0x2b')]=_0x187796;_0x580550(_0x28aaca);})[_0x73d6('0x10')](function(_0x1c4ae5){_0x56d0c4(_0x1c4ae5['message']);});});}function getEndUser(_0x53b1f1,_0x78b6ad,_0xb6c81,_0x144460,_0x31cb39,_0x44e489){return new BPromise(function(_0x37a7f4,_0x5cad81){var _0x23003a=_0x44e489['toLowerCase']()===_0x73d6('0x23')?_0x31cb39[_0x73d6('0x24')]:_0x31cb39[_0x73d6('0x2c')];return getAuthToken(_0x78b6ad,_0xb6c81,_0x44e489)[_0x73d6('0xf')](function(_0x26a8b7){var _0x2b78de={'method':_0x73d6('0x13'),'uri':_0x144460+_0x73d6('0x2d')+_0x23003a[_0x73d6('0x2e')]('+','%2b')+'\x27','headers':{'Authorization':_0x73d6('0x15')+_0x26a8b7,'If-None-Match':null,'OData-Version':_0x73d6('0x16')},'json':!![]};return rp(_0x2b78de);})[_0x73d6('0xf')](function(_0x56ccff){var _0xfee099=null;if(_0x56ccff){var _0x4b72e2=_0x56ccff[_0x73d6('0x17')];var _0x27c2e7=![];for(_0xfee099=0x0;_0xfee099<_0x4b72e2['length'];_0xfee099++){if(_0x4b72e2[_0xfee099][_0x73d6('0x2f')]===_0x23003a){_0x27c2e7=!![];_0x53b1f1[_0x73d6('0x2b')]=_0x4b72e2[_0xfee099][_0x73d6('0x30')];}}if(_0x27c2e7){_0x37a7f4(_0x53b1f1);}else{return createEndUser(_0x53b1f1,_0x78b6ad,_0xb6c81,_0x144460,_0x31cb39,_0x44e489)['then'](function(_0x27790a){logger[_0x73d6('0x31')]('['+[_0x44e489[_0x73d6('0x1c')]()]+_0x73d6('0x32'),_0x27790a[_0x73d6('0x2b')]);_0x37a7f4(_0x27790a);});}}else{return createEndUser(_0x53b1f1,_0x78b6ad,_0xb6c81,_0x144460,_0x31cb39,_0x44e489)[_0x73d6('0xf')](function(_0x103f8d){logger[_0x73d6('0x31')]('['+[_0x44e489['toUpperCase']()]+_0x73d6('0x33'),_0x103f8d[_0x73d6('0x2b')]);_0x37a7f4(_0x103f8d);});}});});}function getCustomFields(_0x40c2c1,_0x1f0ee0,_0x12612d){var _0x503d13={};if(_0x40c2c1[_0x73d6('0x20')]>0x0){_[_0x73d6('0x34')](_0x40c2c1,function(_0x54b4cd){if(_[_0x73d6('0x35')]([_0x73d6('0x36'),'picklist'],_0x54b4cd['type'])&&_0x54b4cd[_0x73d6('0x37')]&&!_0x54b4cd['customField']){var _0x3be15e=_0x54b4cd['idField'][_0x73d6('0x22')]();var _0x310284=_0x3be15e[_0x73d6('0x29')](0x0,_0x3be15e[_0x73d6('0x38')]('_'));var _0x165ebc=_0x3be15e[_0x73d6('0x29')](_0x3be15e[_0x73d6('0x38')]('_')+0x1);if(_0x310284===_0x12612d){_0x503d13[_0x165ebc]=_0x54b4cd[_0x73d6('0x39')];}}});}return _0x503d13;}function getTicket(_0x43dcdd,_0x349341,_0x28d9b5,_0xd66315,_0x2b26a1,_0x5e9394,_0x54bd6a){return new BPromise(function(_0x3de7a9,_0x5f0afc){var _0x247897;return getAuthToken(_0x349341,_0x28d9b5,_0x54bd6a)['then'](function(_0x329388){if(_0x5e9394[_0x73d6('0x3a')]==='incident'){_0x247897={'method':_0x73d6('0x3b'),'uri':_0xd66315+_0x73d6('0x3c'),'body':Object[_0x73d6('0x3d')]({},{'title':intUtil['getString'](_0x5e9394[_0x73d6('0x3e')],_0x2b26a1,'\x20'),'description':intUtil['getString'](_0x5e9394['Descriptions'],_0x2b26a1,'\x0a'),'customerid_contact@odata.bind':_0x73d6('0x3f')+_0x43dcdd[_0x73d6('0x2b')]+')','ownerid@odata.bind':_0x73d6('0x26')+_0x43dcdd[_0x73d6('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x5e9394[_0x73d6('0x40')],_0x2b26a1,_0x5e9394[_0x73d6('0x3a')])),'headers':{'Authorization':_0x73d6('0x15')+_0x329388,'OData-Version':_0x73d6('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5e9394[_0x73d6('0x3a')]===_0x73d6('0x41')){_0x247897={'method':_0x73d6('0x3b'),'uri':_0xd66315+_0x73d6('0x42'),'body':Object[_0x73d6('0x3d')]({},{'subject':intUtil[_0x73d6('0x43')](_0x5e9394[_0x73d6('0x3e')],_0x2b26a1,'\x20'),'phonenumber':String(_0x2b26a1['calleridnum']),'description':intUtil[_0x73d6('0x43')](_0x5e9394['Descriptions'],_0x2b26a1,'\x0a'),'regardingobjectid_contact@odata.bind':_0x73d6('0x3f')+_0x43dcdd[_0x73d6('0x2b')]+')','ownerid@odata.bind':'/systemusers('+_0x43dcdd[_0x73d6('0x1e')]+')','directioncode':_0x43dcdd[_0x73d6('0x44')]===_0x73d6('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x43dcdd[_0x73d6('0x1e')]+')','participationtypemask':_0x43dcdd[_0x73d6('0x44')]===_0x73d6('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x73d6('0x3f')+_0x43dcdd[_0x73d6('0x2b')]+')','participationtypemask':_0x43dcdd['callDirection']===_0x73d6('0x45')?0x1:0x2}]},getCustomFields(_0x5e9394[_0x73d6('0x40')],_0x2b26a1,_0x5e9394[_0x73d6('0x3a')])),'headers':{'Authorization':_0x73d6('0x15')+_0x329388,'OData-Version':_0x73d6('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x247897);})[_0x73d6('0xf')](function(_0x100697){var _0x1b4f2e=_0x100697['headers']['odata-entityid'];var _0x21400f=_0x1b4f2e['substring'](_0x1b4f2e[_0x73d6('0x2a')]('(')+0x1,_0x1b4f2e['lastIndexOf'](')'));_0x43dcdd[_0x73d6('0x46')]=_0x21400f;_0x3de7a9(_0x43dcdd);})[_0x73d6('0x10')](function(_0x580f24){_0x5f0afc(_0x580f24['message']);});});}function emit(_0x283c85,_0x411002,_0x2ecdc9,_0x1d85b5){var _0x3dcef6={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x283c85,_0x2ecdc9,_0x1d85b5)};io['to'](util[_0x73d6('0x47')](_0x73d6('0x48'),_0x411002))[_0x73d6('0x49')](_0x73d6('0x4a'),_0x3dcef6);}exports['cs']=function(_0x403cf0,_0x860fe5,_0x5cb721,_0x79f159,_0x98b788,_0x1b12e2,_0x1ad955,_0x166be6){var _0x4fce60={};_0x1b12e2['remoteUri']=intUtil[_0x73d6('0x4b')](_0x1b12e2[_0x73d6('0xb')]);_0x1b12e2[_0x73d6('0x4c')]=intUtil[_0x73d6('0x4b')](_0x1b12e2[_0x73d6('0x4c')]);_0x4fce60[_0x73d6('0x44')]=_0x166be6==='queue'||_0x166be6===_0x73d6('0x4d')?_0x73d6('0x45'):'outbound';var _0x254956=util[_0x73d6('0x47')](_0x73d6('0x4e'),_0x1b12e2[_0x73d6('0xb')]);var _0x4f2f44=util[_0x73d6('0x47')]('https://login.microsoftonline.com/%s/oauth2/token',_0x1b12e2[_0x73d6('0x4f')]);var _0x1f5e2d=util[_0x73d6('0x47')](_0x73d6('0x50'),_0x1b12e2[_0x73d6('0x4c')],_0x860fe5['uniqueid'],md5(_0x860fe5[_0x73d6('0x51')]));if(_0x98b788&&_0x98b788[_0x73d6('0x52')]){logger[_0x73d6('0x31')](_0x73d6('0x53'),_0x73d6('0x54'));_0x860fe5['recordingURL']=_0x1f5e2d;}else if(_0x1ad955&&_0x1ad955[_0x73d6('0x55')]&&_0x1ad955['recordingFormat']!==_0x73d6('0x56')){logger['info']('[OUTBOUND]',_0x73d6('0x54'));_0x860fe5['recordingURL']=_0x1f5e2d;}else{_0x860fe5[_0x73d6('0x57')]='';}return getUser(_0x4fce60,_0x1b12e2,_0x79f159,_0x4f2f44,_0x254956,_0x166be6)['then'](function(_0x402826){logger[_0x73d6('0x31')]('['+_0x166be6[_0x73d6('0x1c')]()+_0x73d6('0x58'),_0x402826[_0x73d6('0x1e')]);logger[_0x73d6('0x31')]('['+_0x166be6['toUpperCase']()+_0x73d6('0x59'),_0x402826[_0x73d6('0x1b')]);return getEndUser(_0x402826,_0x1b12e2,_0x4f2f44,_0x254956,_0x860fe5,_0x166be6);})[_0x73d6('0xf')](function(_0x3dfaf8){logger[_0x73d6('0x31')]('['+_0x166be6[_0x73d6('0x1c')]()+_0x73d6('0x5a'),_0x3dfaf8[_0x73d6('0x2b')]);logger[_0x73d6('0x31')]('['+_0x166be6[_0x73d6('0x1c')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x860fe5[_0x73d6('0x2c')]);return getTicket(_0x3dfaf8,_0x1b12e2,_0x4f2f44,_0x254956,_0x860fe5,_0x5cb721,_0x166be6);})[_0x73d6('0xf')](function(_0x5eb62){logger[_0x73d6('0x31')](util['format']('['+_0x166be6[_0x73d6('0x1c')]()+_0x73d6('0x5b'),_0x5cb721[_0x73d6('0x3a')],_0x5eb62[_0x73d6('0x46')]));logger[_0x73d6('0x31')](util[_0x73d6('0x47')]('['+_0x166be6['toUpperCase']()+_0x73d6('0x5c'),_0x166be6));if(_0x166be6!==_0x73d6('0x4d')){logger[_0x73d6('0x31')]('['+_0x166be6[_0x73d6('0x1c')]()+']',_0x73d6('0x5d'));emit(_0x1b12e2[_0x73d6('0xb')],_0x79f159[_0x73d6('0x5e')],_0x5cb721[_0x73d6('0x3a')],_0x5eb62[_0x73d6('0x46')]);}})['catch'](function(_0x562702){logger[_0x73d6('0x5f')]('['+_0x166be6[_0x73d6('0x1c')]()+_0x73d6('0x60'),util[_0x73d6('0x61')](_0x562702,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc4e2=['password','clientSecret','then','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','lastIndexOf','enduserId','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','telephone1','contactid',']\x20Enduser\x20Created!','string','picklist','customField','idField','substring','indexOf','content','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','odata-entityid','ticketId','catch','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketType',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','./util','../../../../config/logger','../../../../config/environment','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username'];(function(_0x50f0a9,_0x2b0c57){var _0x5a33d9=function(_0x40338e){while(--_0x40338e){_0x50f0a9['push'](_0x50f0a9['shift']());}};_0x5a33d9(++_0x2b0c57);}(_0xc4e2,0x1cf));var _0x2c4e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc4e2[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var BPromise=require(_0x2c4e('0x0'));var rp=require(_0x2c4e('0x1'));var util=require('util');var intUtil=require(_0x2c4e('0x2'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x2c4e('0x3'))('dynamics365');var config=require(_0x2c4e('0x4'));config['redis']=_[_0x2c4e('0x5')](config['redis'],{'host':_0x2c4e('0x6'),'port':0x18eb});var io=require(_0x2c4e('0x7'))(new Redis(config['redis']));function getAuthToken(_0x1da0fb,_0x5f3466,_0xe89278){var _0x2030db={'method':_0x2c4e('0x8'),'uri':_0x5f3466,'form':{'client_id':_0x1da0fb[_0x2c4e('0x9')],'resource':_0x1da0fb[_0x2c4e('0xa')],'username':_0x1da0fb[_0x2c4e('0xb')],'password':_0x1da0fb['password'],'grant_type':_0x2c4e('0xc'),'client_secret':_0x1da0fb[_0x2c4e('0xd')]},'json':!![]};return rp(_0x2030db)[_0x2c4e('0xe')](function(_0x5a02d6){return _0x5a02d6['access_token'];})['catch'](function(_0x3739be){logger[_0x2c4e('0xf')]('['+[_0xe89278[_0x2c4e('0x10')]()]+']\x20Wrong\x20credentials!');return _0x3739be[_0x2c4e('0x11')];});}function getUser(_0xadbefa,_0x37dcf7,_0x269516,_0x27fefb,_0x46aa4f,_0xcf0dc9){return new BPromise(function(_0x2f54b1,_0x3c5cbc){return getAuthToken(_0x37dcf7,_0x27fefb,_0xcf0dc9)[_0x2c4e('0xe')](function(_0x210a3a){var _0x119ff2={'method':_0x2c4e('0x12'),'uri':_0x46aa4f+_0x2c4e('0x13'),'headers':{'Authorization':_0x2c4e('0x14')+_0x210a3a,'OData-Version':_0x2c4e('0x15')},'json':!![]};return rp(_0x119ff2);})['then'](function(_0x2c33c8){var _0x5ff220=_0x2c33c8[_0x2c4e('0x16')];var _0x46a5d1=![];var _0x4aa55f=null;if(!_[_0x2c4e('0x17')](_0x269516)){if(intUtil[_0x2c4e('0x18')](_0x269516[_0x2c4e('0x19')])){_0xadbefa['userEmail']=_0x269516[_0x2c4e('0x19')];for(_0x4aa55f=0x0;_0x4aa55f<_0x5ff220[_0x2c4e('0x1a')];_0x4aa55f++){if(_0x5ff220[_0x4aa55f][_0x2c4e('0x1b')]===_0x269516[_0x2c4e('0x19')]&&!_0x5ff220[_0x4aa55f][_0x2c4e('0x1c')]){_0x46a5d1=!![];logger['info']('['+[_0xcf0dc9['toUpperCase']()]+_0x2c4e('0x1d')+_0x5ff220[_0x4aa55f][_0x2c4e('0x1e')]+'!');_0xadbefa[_0x2c4e('0x1f')]=_0x5ff220[_0x4aa55f]['systemuserid'];}}}}if(!_0x46a5d1){logger[_0x2c4e('0x20')]('['+[_0xcf0dc9[_0x2c4e('0x10')]()]+_0x2c4e('0x21'));_0xadbefa['userEmail']=_0x37dcf7[_0x2c4e('0xb')];for(_0x4aa55f=0x0;_0x4aa55f<_0x5ff220['length'];_0x4aa55f++){if(_0x5ff220[_0x4aa55f]['internalemailaddress']===_0x37dcf7['username']){_0xadbefa[_0x2c4e('0x1f')]=_0x5ff220[_0x4aa55f][_0x2c4e('0x1e')];}}}_0x2f54b1(_0xadbefa);})['catch'](function(_0x3f7a05){_0x3c5cbc(_0x3f7a05[_0x2c4e('0x11')]);});});}function createEndUser(_0x1cab9b,_0x5db604,_0x18a662,_0xc1b0dd,_0x597ab6,_0x19bc8c){return new BPromise(function(_0x63db11,_0x18ebe8){return getAuthToken(_0x5db604,_0x18a662,_0x19bc8c)[_0x2c4e('0xe')](function(_0x3c9dc5){var _0x5a982c=_0x19bc8c['toLowerCase']()===_0x2c4e('0x22')?_0x597ab6[_0x2c4e('0x23')]:_0x597ab6[_0x2c4e('0x24')];var _0x5ce188={'method':_0x2c4e('0x8'),'uri':_0xc1b0dd+_0x2c4e('0x25'),'body':{'telephone1':_0x5a982c,'fullname':_0x5a982c,'firstname':_0x5a982c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2c4e('0x26')+_0x1cab9b[_0x2c4e('0x1f')]+')'},'headers':{'Authorization':_0x2c4e('0x14')+_0x3c9dc5,'OData-Version':_0x2c4e('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5ce188);})[_0x2c4e('0xe')](function(_0x206b8d){var _0x425c8a=_0x206b8d[_0x2c4e('0x27')]['odata-entityid'];var _0x1793fa=_0x425c8a['substring'](_0x425c8a[_0x2c4e('0x28')]('(')+0x1,_0x425c8a['lastIndexOf'](')'));_0x1cab9b[_0x2c4e('0x29')]=_0x1793fa;_0x63db11(_0x1cab9b);})['catch'](function(_0x59f104){_0x18ebe8(_0x59f104[_0x2c4e('0x11')]);});});}function getEndUser(_0x385983,_0x2f1432,_0x1f2421,_0x5195d0,_0x1ff340,_0x3c4d75){return new BPromise(function(_0x396daf,_0x35e418){var _0x4ac77e=_0x3c4d75[_0x2c4e('0x2a')]()===_0x2c4e('0x22')?_0x1ff340['destcalleridnum']:_0x1ff340[_0x2c4e('0x24')];return getAuthToken(_0x2f1432,_0x1f2421,_0x3c4d75)['then'](function(_0x111847){var _0x4e9558={'method':'GET','uri':_0x5195d0+_0x2c4e('0x2b')+_0x4ac77e[_0x2c4e('0x2c')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x111847,'If-None-Match':null,'OData-Version':_0x2c4e('0x15')},'json':!![]};return rp(_0x4e9558);})[_0x2c4e('0xe')](function(_0x552d82){var _0x4a0c75=null;if(_0x552d82){var _0x154823=_0x552d82['value'];var _0x8c9ac8=![];for(_0x4a0c75=0x0;_0x4a0c75<_0x154823[_0x2c4e('0x1a')];_0x4a0c75++){if(_0x154823[_0x4a0c75][_0x2c4e('0x2d')]===_0x4ac77e){_0x8c9ac8=!![];_0x385983[_0x2c4e('0x29')]=_0x154823[_0x4a0c75][_0x2c4e('0x2e')];}}if(_0x8c9ac8){_0x396daf(_0x385983);}else{return createEndUser(_0x385983,_0x2f1432,_0x1f2421,_0x5195d0,_0x1ff340,_0x3c4d75)[_0x2c4e('0xe')](function(_0x3f37d5){logger[_0x2c4e('0x20')]('['+[_0x3c4d75[_0x2c4e('0x10')]()]+']\x20Enduser\x20created!',_0x3f37d5['enduserId']);_0x396daf(_0x3f37d5);});}}else{return createEndUser(_0x385983,_0x2f1432,_0x1f2421,_0x5195d0,_0x1ff340,_0x3c4d75)[_0x2c4e('0xe')](function(_0x5e8376){logger[_0x2c4e('0x20')]('['+[_0x3c4d75[_0x2c4e('0x10')]()]+_0x2c4e('0x2f'),_0x5e8376['enduserId']);_0x396daf(_0x5e8376);});}});});}function getCustomFields(_0x207f7f,_0x521698,_0x139080){var _0xe9f3={};if(_0x207f7f[_0x2c4e('0x1a')]>0x0){_['forEach'](_0x207f7f,function(_0x505181){if(_['includes']([_0x2c4e('0x30'),_0x2c4e('0x31')],_0x505181['type'])&&_0x505181['nameField']&&!_0x505181[_0x2c4e('0x32')]){var _0x5b149b=_0x505181[_0x2c4e('0x33')][_0x2c4e('0x2a')]();var _0x1f61d6=_0x5b149b[_0x2c4e('0x34')](0x0,_0x5b149b[_0x2c4e('0x35')]('_'));var _0x3aee9f=_0x5b149b[_0x2c4e('0x34')](_0x5b149b['indexOf']('_')+0x1);if(_0x1f61d6===_0x139080){_0xe9f3[_0x3aee9f]=_0x505181[_0x2c4e('0x36')];}}});}return _0xe9f3;}function getTicket(_0x471c42,_0x4a9371,_0x46059a,_0x1d68a1,_0x4892d9,_0x723078,_0x78ac13){return new BPromise(function(_0x1c6d41,_0x2f79bd){var _0xdbba0f;return getAuthToken(_0x4a9371,_0x46059a,_0x78ac13)[_0x2c4e('0xe')](function(_0x21db9f){if(_0x723078['ticketType']==='incident'){_0xdbba0f={'method':'POST','uri':_0x1d68a1+_0x2c4e('0x37'),'body':Object[_0x2c4e('0x38')]({},{'title':intUtil[_0x2c4e('0x39')](_0x723078[_0x2c4e('0x3a')],_0x4892d9,'\x20'),'description':intUtil[_0x2c4e('0x39')](_0x723078[_0x2c4e('0x3b')],_0x4892d9,'\x0a'),'customerid_contact@odata.bind':_0x2c4e('0x3c')+_0x471c42[_0x2c4e('0x29')]+')','ownerid@odata.bind':'/systemusers('+_0x471c42['userId']+')','caseorigincode':'1'},getCustomFields(_0x723078[_0x2c4e('0x3d')],_0x4892d9,_0x723078['ticketType'])),'headers':{'Authorization':_0x2c4e('0x14')+_0x21db9f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x723078['ticketType']===_0x2c4e('0x3e')){_0xdbba0f={'method':'POST','uri':_0x1d68a1+'phonecalls','body':Object[_0x2c4e('0x38')]({},{'subject':intUtil['getString'](_0x723078['Subjects'],_0x4892d9,'\x20'),'phonenumber':String(_0x4892d9[_0x2c4e('0x24')]),'description':intUtil['getString'](_0x723078['Descriptions'],_0x4892d9,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2c4e('0x3c')+_0x471c42[_0x2c4e('0x29')]+')','ownerid@odata.bind':_0x2c4e('0x26')+_0x471c42['userId']+')','directioncode':_0x471c42['callDirection']===_0x2c4e('0x3f')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2c4e('0x26')+_0x471c42['userId']+')','participationtypemask':_0x471c42[_0x2c4e('0x40')]===_0x2c4e('0x3f')?0x2:0x1},{'partyid_contact@odata.bind':_0x2c4e('0x3c')+_0x471c42[_0x2c4e('0x29')]+')','participationtypemask':_0x471c42['callDirection']===_0x2c4e('0x3f')?0x1:0x2}]},getCustomFields(_0x723078[_0x2c4e('0x3d')],_0x4892d9,_0x723078['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x21db9f,'OData-Version':_0x2c4e('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xdbba0f);})[_0x2c4e('0xe')](function(_0x9ee39a){var _0x4e03b6=_0x9ee39a[_0x2c4e('0x27')][_0x2c4e('0x41')];var _0x9ea13c=_0x4e03b6['substring'](_0x4e03b6[_0x2c4e('0x28')]('(')+0x1,_0x4e03b6['lastIndexOf'](')'));_0x471c42[_0x2c4e('0x42')]=_0x9ea13c;_0x1c6d41(_0x471c42);})[_0x2c4e('0x43')](function(_0x541b19){_0x2f79bd(_0x541b19[_0x2c4e('0x11')]);});});}function emit(_0xcb1760,_0x2f2073,_0x177f7b,_0x39058d){var _0x59ed6a={'uri':util[_0x2c4e('0x44')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0xcb1760,_0x177f7b,_0x39058d)};io['to'](util['format']('user:%s',_0x2f2073))[_0x2c4e('0x45')](_0x2c4e('0x46'),_0x59ed6a);}exports['cs']=function(_0x1a0d30,_0x5aa833,_0x45dc56,_0x389bd3,_0x2529ad,_0x48c356,_0x2daadd,_0x44f1c5){var _0x20fa9c={};_0x48c356[_0x2c4e('0xa')]=intUtil[_0x2c4e('0x47')](_0x48c356[_0x2c4e('0xa')]);_0x48c356['serverUrl']=intUtil[_0x2c4e('0x47')](_0x48c356[_0x2c4e('0x48')]);_0x20fa9c[_0x2c4e('0x40')]=_0x44f1c5===_0x2c4e('0x3f')||_0x44f1c5===_0x2c4e('0x49')?_0x2c4e('0x3f'):_0x2c4e('0x22');var _0x42aa63=util[_0x2c4e('0x44')](_0x2c4e('0x4a'),_0x48c356['remoteUri']);var _0x36eca1=util[_0x2c4e('0x44')]('https://login.microsoftonline.com/%s/oauth2/token',_0x48c356[_0x2c4e('0x4b')]);var _0x456a4c=util[_0x2c4e('0x44')](_0x2c4e('0x4c'),_0x48c356[_0x2c4e('0x48')],_0x5aa833[_0x2c4e('0x4d')],md5(_0x5aa833[_0x2c4e('0x4d')]));if(_0x2529ad&&_0x2529ad[_0x2c4e('0x4e')]){logger[_0x2c4e('0x20')](_0x2c4e('0x4f'),_0x2c4e('0x50'));_0x5aa833[_0x2c4e('0x51')]=_0x456a4c;}else if(_0x2daadd&&_0x2daadd['recordingFormat']&&_0x2daadd[_0x2c4e('0x52')]!==_0x2c4e('0x53')){logger['info'](_0x2c4e('0x54'),_0x2c4e('0x50'));_0x5aa833[_0x2c4e('0x51')]=_0x456a4c;}else{_0x5aa833[_0x2c4e('0x51')]='';}return getUser(_0x20fa9c,_0x48c356,_0x389bd3,_0x36eca1,_0x42aa63,_0x44f1c5)['then'](function(_0x4b9a53){logger[_0x2c4e('0x20')]('['+_0x44f1c5['toUpperCase']()+_0x2c4e('0x55'),_0x4b9a53['userId']);logger[_0x2c4e('0x20')]('['+_0x44f1c5['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x4b9a53['userEmail']);return getEndUser(_0x4b9a53,_0x48c356,_0x36eca1,_0x42aa63,_0x5aa833,_0x44f1c5);})['then'](function(_0x1bfb6d){logger['info']('['+_0x44f1c5[_0x2c4e('0x10')]()+_0x2c4e('0x56'),_0x1bfb6d['enduserId']);logger['info']('['+_0x44f1c5['toUpperCase']()+_0x2c4e('0x57'),_0x5aa833[_0x2c4e('0x24')]);return getTicket(_0x1bfb6d,_0x48c356,_0x36eca1,_0x42aa63,_0x5aa833,_0x45dc56,_0x44f1c5);})['then'](function(_0x31c763){logger[_0x2c4e('0x20')](util[_0x2c4e('0x44')]('['+_0x44f1c5[_0x2c4e('0x10')]()+_0x2c4e('0x58'),_0x45dc56[_0x2c4e('0x59')],_0x31c763[_0x2c4e('0x42')]));logger['info'](util[_0x2c4e('0x44')]('['+_0x44f1c5[_0x2c4e('0x10')]()+_0x2c4e('0x5a'),_0x44f1c5));if(_0x44f1c5!=='unmanaged'){logger[_0x2c4e('0x20')]('['+_0x44f1c5['toUpperCase']()+']',_0x2c4e('0x5b'));emit(_0x48c356[_0x2c4e('0xa')],_0x389bd3[_0x2c4e('0x5c')],_0x45dc56[_0x2c4e('0x59')],_0x31c763[_0x2c4e('0x42')]);}})[_0x2c4e('0x43')](function(_0x19d4e2){logger[_0x2c4e('0xf')]('['+_0x44f1c5[_0x2c4e('0x10')]()+_0x2c4e('0x5d'),util[_0x2c4e('0x5e')](_0x19d4e2,{'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 d57f564..40f7b66 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 _0x8984=['The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','[OUTBOUND]','recordingURL','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:browser:url','monitor_format','calleridname','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','freshdesk','defaults','redis','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Tags','name','Fields','mapValues','keyBy','custom_fields','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','info','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','map','forEach','includes','picklist','type','nameField','customField','content','string','push','variable','variableName','idField','customVariable','toLowerCase','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:'];(function(_0x3326a7,_0x412962){var _0x50ab2b=function(_0x5a4ef8){while(--_0x5a4ef8){_0x3326a7['push'](_0x3326a7['shift']());}};_0x50ab2b(++_0x412962);}(_0x8984,0x17d));var _0x4898=function(_0x3b53e4,_0x48286b){_0x3b53e4=_0x3b53e4-0x0;var _0x58ac99=_0x8984[_0x3b53e4];return _0x58ac99;};'use strict';var _=require(_0x4898('0x0'));var rp=require(_0x4898('0x1'));var md5=require('md5');var util=require(_0x4898('0x2'));var Redis=require(_0x4898('0x3'));var intUtil=require(_0x4898('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x4898('0x5'));config['redis']=_[_0x4898('0x6')](config[_0x4898('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4898('0x8'))(new Redis(config[_0x4898('0x7')]));var headers={'Content-Type':_0x4898('0x9'),'Accept':_0x4898('0x9')};function emit(_0x3646be,_0x29b106,_0xeb7fad){io['to'](_0x3646be)[_0x4898('0xa')](_0x29b106,_0xeb7fad);}function getTicket(_0x2484bc,_0x4eb346,_0xccc02b,_0x5a89e2,_0x115ad7){logger['info'](_0x4898('0xb'));var _0x4d1b55=_[_0x4898('0xc')]({'responder_id':_0x4eb346['id'],'requester_id':_0xccc02b['id'],'name':util[_0x4898('0xd')](_0x4898('0xe'),_0x115ad7['calleridname']),'phone':_0x115ad7[_0x4898('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4898('0x10')](_0x5a89e2[_0x4898('0x11')],_0x115ad7,'\x20'),'description':intUtil[_0x4898('0x10')](_0x5a89e2['Descriptions'],_0x115ad7,'
'),'tags':getTags(_0x5a89e2[_0x4898('0x12')],_0x4898('0x13'))},getCustomFields(_0x5a89e2[_0x4898('0x14')],_0x115ad7));_0x4d1b55['custom_fields']=_[_0x4898('0x15')](_[_0x4898('0x16')](_0x4d1b55[_0x4898('0x17')],'id'),'value');return request({'uri':util[_0x4898('0xd')](_0x4898('0x18'),_0x2484bc[_0x4898('0x19')]),'method':_0x4898('0x1a'),'body':_0x4d1b55})[_0x4898('0x1b')](function(_0x21d75c){logger['info'](_0x4898('0x1c'));return _0x21d75c;});}function getUser(_0x45e333,_0xeb5c6){if(intUtil[_0x4898('0x1d')](_0xeb5c6)){return request({'uri':util[_0x4898('0xd')](_0x4898('0x1e'),_0x45e333['remoteUri']),'qs':{'email':_0xeb5c6}})[_0x4898('0x1b')](function(_0x2542da){if(_0x2542da[_0x4898('0x1f')]){logger[_0x4898('0x20')]('Agent\x20found!');return _[_0x4898('0x21')](_0x2542da,function(_0x154851){return _0x154851[_0x4898('0x22')]['email']===_0xeb5c6;});}else{logger[_0x4898('0x20')](_0x4898('0x23'));return request({'uri':util[_0x4898('0xd')](_0x4898('0x24'),_0x45e333[_0x4898('0x19')])})[_0x4898('0x1b')](function(_0x11e3dc){logger[_0x4898('0x20')](_0x4898('0x25'));return _0x11e3dc;});}});}else{logger[_0x4898('0x20')](_0x4898('0x26'));return request({'uri':util[_0x4898('0xd')](_0x4898('0x24'),_0x45e333[_0x4898('0x19')])})[_0x4898('0x1b')](function(_0x547db6){logger['info'](_0x4898('0x25'));return _0x547db6;});}}function getEndUser(_0x5c7077,_0xc2bccc,_0x3762df){logger[_0x4898('0x20')](_0x4898('0x27'),_0x3762df);return request({'uri':util['format'](_0x4898('0x28'),_0x5c7077[_0x4898('0x19')]),'qs':{'phone':_0x3762df}})['then'](function(_0x23b1fe){if(_0x23b1fe[_0x4898('0x1f')]){logger[_0x4898('0x20')](_0x4898('0x29'));return _[_0x4898('0x21')](_0x23b1fe,{'phone':_0x3762df});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4898('0xd')](_0x4898('0x28'),_0x5c7077['remoteUri']),'method':_0x4898('0x1a'),'body':{'name':_0xc2bccc,'phone':_0x3762df}})['then'](function(_0x190c5c){logger[_0x4898('0x20')](_0x4898('0x2a'));return _0x190c5c;});}});}function getAuth(_0x1c861d){return util[_0x4898('0xd')](_0x4898('0x2b'),new Buffer(_0x1c861d[_0x4898('0x2c')]+':X')[_0x4898('0x2d')]('base64'));}function request(_0x4d9fa7){logger[_0x4898('0x2e')](_0x4898('0x2f'),JSON[_0x4898('0x30')](_0x4d9fa7));return rp(_[_0x4898('0x6')](_0x4d9fa7,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x29a0e9,_0x58eeef){var _0x29976d=[];if(_0x29a0e9&&_0x29a0e9[_0x4898('0x1f')]>0x0){_0x29976d=_[_0x4898('0x31')](_0x29a0e9,_0x58eeef);}return _0x29976d;}function getCustomFields(_0x4997f1,_0x4da21c){var _0x3ad63a=[];var _0x2f3e38={'custom_fields':[]};if(_0x4997f1[_0x4898('0x1f')]>0x0){_[_0x4898('0x32')](_0x4997f1,function(_0x2bdbaf){if(_[_0x4898('0x33')](['string',_0x4898('0x34')],_0x2bdbaf[_0x4898('0x35')])&&_0x2bdbaf[_0x4898('0x36')]&&!_0x2bdbaf[_0x4898('0x37')]){_0x2f3e38[_0x2bdbaf['nameField']['toLowerCase']()]=_0x2bdbaf[_0x4898('0x38')][_0x4898('0x2d')]();}else if(_['includes']([_0x4898('0x39'),_0x4898('0x34')],_0x2bdbaf['type'])&&_0x2bdbaf['idField']&&_0x2bdbaf['customField']){_0x2f3e38[_0x4898('0x17')][_0x4898('0x3a')]({'id':_0x2bdbaf['idField'],'value':_0x2bdbaf['content'][_0x4898('0x2d')]()});}else if(_0x2bdbaf['type']===_0x4898('0x3b')&&_0x2bdbaf[_0x4898('0x3c')]&&_0x2bdbaf[_0x4898('0x3d')]&&_0x2bdbaf[_0x4898('0x37')]){_0x4da21c[_0x2bdbaf[_0x4898('0x3c')]]&&_0x2f3e38[_0x4898('0x17')][_0x4898('0x3a')]({'id':_0x2bdbaf[_0x4898('0x3d')],'value':_0x4da21c[_0x2bdbaf[_0x4898('0x3c')]][_0x4898('0x2d')]()});}else if(_0x2bdbaf[_0x4898('0x35')]===_0x4898('0x3e')&&_0x2bdbaf['Variable']&&_0x2bdbaf['Variable']['name']&&_0x2bdbaf['idField']&&_0x2bdbaf[_0x4898('0x37')]){_0x4da21c[_0x2bdbaf['Variable'][_0x4898('0x13')][_0x4898('0x3f')]()]&&_0x2f3e38[_0x4898('0x17')]['push']({'id':_0x2bdbaf[_0x4898('0x3d')],'value':_0x4da21c[_0x2bdbaf[_0x4898('0x40')][_0x4898('0x13')][_0x4898('0x3f')]()][_0x4898('0x2d')]()});}});}return _0x2f3e38;}exports[_0x4898('0x41')]=function(_0x323185,_0x18063a,_0x2c4f35,_0x5bce92,_0x3c09ce,_0x9e9db2){var _0x4ef7aa,_0x4d9565;_0x9e9db2[_0x4898('0x19')]=intUtil[_0x4898('0x42')](_0x9e9db2[_0x4898('0x19')]);_0x9e9db2[_0x4898('0x43')]=intUtil[_0x4898('0x42')](_0x9e9db2[_0x4898('0x43')]);if(_0x3c09ce&&_0x3c09ce['monitor_format']){logger[_0x4898('0x20')](_0x4898('0x44'),_0x4898('0x45'));_0x18063a['recordingURL']=util['format'](_0x4898('0x46'),_0x9e9db2[_0x4898('0x43')],_0x18063a[_0x4898('0x47')],md5(_0x18063a['uniqueid']));}else{_0x18063a['recordingURL']='';}headers[_0x4898('0x48')]=getAuth(_0x9e9db2);return getUser(_0x9e9db2,_0x5bce92['email'])['then'](function(_0x2cc66d){_0x4ef7aa=_0x2cc66d;logger[_0x4898('0x20')](_0x4898('0x49'),_0x4ef7aa['id']);return getEndUser(_0x9e9db2,_0x18063a['calleridname'],_0x18063a[_0x4898('0xf')]);})[_0x4898('0x1b')](function(_0x4e92a6){_0x4d9565=_0x4e92a6;logger[_0x4898('0x20')]('The\x20Enduser\x20ID\x20is:',_0x4d9565['id']);return getTicket(_0x9e9db2,_0x4ef7aa,_0x4d9565,_0x2c4f35,_0x18063a);})[_0x4898('0x1b')](function(_0x302ac7){if(_0x302ac7&&_0x302ac7['id']){logger[_0x4898('0x20')]('Ticket\x20created!');logger[_0x4898('0x20')](_0x4898('0x4a'),_0x302ac7['id']);logger[_0x4898('0x20')](_0x4898('0x44'),_0x4898('0x4b'));emit(util[_0x4898('0xd')](_0x4898('0x4c'),_0x5bce92[_0x4898('0x13')]),'trigger:browser:url',{'uri':util[_0x4898('0xd')](_0x4898('0x4d'),_0x9e9db2[_0x4898('0x19')],_0x302ac7['id'])});}})[_0x4898('0x4e')](function(_0x5eb6ea){logger[_0x4898('0x4f')]('[QUEUE]',JSON['stringify'](_0x5eb6ea));});};exports['outbound']=function(_0x257e30,_0xc54517,_0x19ae14,_0x3609bf,_0x552f15,_0x50cec9,_0x5b1117){var _0xe04de0,_0x58dd1b;_0x50cec9['remoteUri']=intUtil[_0x4898('0x42')](_0x50cec9[_0x4898('0x19')]);_0x50cec9[_0x4898('0x43')]=intUtil[_0x4898('0x42')](_0x50cec9[_0x4898('0x43')]);if(_0x5b1117&&_0x5b1117['recordingFormat']&&_0x5b1117['recordingFormat']!=='none'){logger[_0x4898('0x20')](_0x4898('0x50'),_0x4898('0x45'));_0xc54517[_0x4898('0x51')]=util[_0x4898('0xd')](_0x4898('0x46'),_0x50cec9[_0x4898('0x43')],_0xc54517[_0x4898('0x47')],md5(_0xc54517[_0x4898('0x47')]));}headers[_0x4898('0x48')]=getAuth(_0x50cec9);return getUser(_0x50cec9,_0x3609bf[_0x4898('0x52')])[_0x4898('0x1b')](function(_0x23428a){_0xe04de0=_0x23428a;logger[_0x4898('0x20')](_0x4898('0x49'),_0xe04de0['id']);return getEndUser(_0x50cec9,_0xc54517[_0x4898('0x53')],_0xc54517[_0x4898('0x54')]);})[_0x4898('0x1b')](function(_0xc76ec3){_0x58dd1b=_0xc76ec3;logger['info'](_0x4898('0x55'),_0x58dd1b['id']);return getTicket(_0x50cec9,_0xe04de0,_0x58dd1b,_0x19ae14,_0xc54517);})[_0x4898('0x1b')](function(_0x4d9404){if(_0x4d9404&&_0x4d9404['id']){logger['info'](_0x4898('0x1c'));logger[_0x4898('0x20')](_0x4898('0x4a'),_0x4d9404['id']);logger[_0x4898('0x20')]('[OUTBOUND]',_0x4898('0x4b'));emit(util[_0x4898('0xd')](_0x4898('0x4c'),_0x3609bf[_0x4898('0x13')]),_0x4898('0x56'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x50cec9[_0x4898('0x19')],_0x4d9404['id'])});}})[_0x4898('0x4e')](function(_0x25bbc2){logger[_0x4898('0x4f')]('[OUTBOUND]',JSON[_0x4898('0x30')](_0x25bbc2));});};exports['unmanaged']=function(_0x5a1eb6,_0x1501dc,_0x443d87,_0x5e2261,_0x3b1e34,_0x42d47d){var _0x585ddb,_0x5d8026;_0x42d47d[_0x4898('0x19')]=intUtil[_0x4898('0x42')](_0x42d47d[_0x4898('0x19')]);_0x42d47d[_0x4898('0x43')]=intUtil[_0x4898('0x42')](_0x42d47d['serverUrl']);if(_0x3b1e34&&_0x3b1e34[_0x4898('0x57')]){logger[_0x4898('0x20')]('['+_0x1501dc['lastevent']['toUpperCase']()+']',_0x4898('0x45'));_0x1501dc[_0x4898('0x51')]=util[_0x4898('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x42d47d[_0x4898('0x43')],_0x1501dc[_0x4898('0x47')],md5(_0x1501dc[_0x4898('0x47')]));}else{_0x1501dc['recordingURL']='';}headers[_0x4898('0x48')]=getAuth(_0x42d47d);return getUser(_0x42d47d,'')[_0x4898('0x1b')](function(_0xf141fe){_0x585ddb=_0xf141fe;logger[_0x4898('0x20')](_0x4898('0x49'),_0x585ddb['id']);return getEndUser(_0x42d47d,_0x1501dc[_0x4898('0x58')],_0x1501dc[_0x4898('0xf')]);})[_0x4898('0x1b')](function(_0x3c3f9b){_0x5d8026=_0x3c3f9b;logger[_0x4898('0x20')](_0x4898('0x55'),_0x5d8026['id']);return getTicket(_0x42d47d,_0x585ddb,_0x5d8026,_0x443d87,_0x1501dc);})['then'](function(_0x2c2626){if(_0x2c2626){logger[_0x4898('0x20')](_0x4898('0x1c'));logger[_0x4898('0x20')](_0x4898('0x4a'),_0x2c2626['id']);}})[_0x4898('0x4e')](function(_0x22a428){logger[_0x4898('0x4f')]('['+_0x1501dc[_0x4898('0x59')][_0x4898('0x5a')]()+']',JSON['stringify'](_0x22a428));});}; \ No newline at end of file +var _0xe7fd=['./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','getString','Subjects','Descriptions','
','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','customField','nameField','content','push','idField','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','calleridnum','toUpperCase','stringify','lodash','request-promise','ioredis'];(function(_0x1bf228,_0x43de68){var _0x336d6b=function(_0x1c4596){while(--_0x1c4596){_0x1bf228['push'](_0x1bf228['shift']());}};_0x336d6b(++_0x43de68);}(_0xe7fd,0xb9));var _0xde7f=function(_0x4ca094,_0x796fd1){_0x4ca094=_0x4ca094-0x0;var _0x1444df=_0xe7fd[_0x4ca094];return _0x1444df;};'use strict';var _=require(_0xde7f('0x0'));var rp=require(_0xde7f('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xde7f('0x2'));var intUtil=require(_0xde7f('0x3'));var config=require(_0xde7f('0x4'));var logger=require('../../../../config/logger')('freshdesk');config[_0xde7f('0x5')]=_[_0xde7f('0x6')](config[_0xde7f('0x5')],{'host':_0xde7f('0x7'),'port':0x18eb});var io=require(_0xde7f('0x8'))(new Redis(config[_0xde7f('0x5')]));var headers={'Content-Type':_0xde7f('0x9'),'Accept':_0xde7f('0x9')};function emit(_0x224d79,_0x224598,_0x55551e){io['to'](_0x224d79)[_0xde7f('0xa')](_0x224598,_0x55551e);}function getTicket(_0x389b62,_0x5baf82,_0x33408e,_0x355d5a,_0x353463){logger[_0xde7f('0xb')]('Creating\x20new\x20ticket...');var _0x539aa8=_[_0xde7f('0xc')]({'responder_id':_0x5baf82['id'],'requester_id':_0x33408e['id'],'name':util[_0xde7f('0xd')]('Caller\x20-\x20%s',_0x353463['calleridname']),'phone':_0x353463['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xde7f('0xe')](_0x355d5a[_0xde7f('0xf')],_0x353463,'\x20'),'description':intUtil[_0xde7f('0xe')](_0x355d5a[_0xde7f('0x10')],_0x353463,_0xde7f('0x11')),'tags':getTags(_0x355d5a['Tags'],_0xde7f('0x12'))},getCustomFields(_0x355d5a[_0xde7f('0x13')],_0x353463));_0x539aa8['custom_fields']=_[_0xde7f('0x14')](_[_0xde7f('0x15')](_0x539aa8[_0xde7f('0x16')],'id'),_0xde7f('0x17'));return request({'uri':util['format'](_0xde7f('0x18'),_0x389b62[_0xde7f('0x19')]),'method':_0xde7f('0x1a'),'body':_0x539aa8})[_0xde7f('0x1b')](function(_0x3d7c25){logger['info'](_0xde7f('0x1c'));return _0x3d7c25;});}function getUser(_0x22451e,_0x5c19ce){if(intUtil[_0xde7f('0x1d')](_0x5c19ce)){return request({'uri':util['format']('%s/api/v2/agents',_0x22451e['remoteUri']),'qs':{'email':_0x5c19ce}})[_0xde7f('0x1b')](function(_0x5e151e){if(_0x5e151e['length']){logger[_0xde7f('0xb')](_0xde7f('0x1e'));return _[_0xde7f('0x1f')](_0x5e151e,function(_0x304a4b){return _0x304a4b[_0xde7f('0x20')]['email']===_0x5c19ce;});}else{logger[_0xde7f('0xb')](_0xde7f('0x21'));return request({'uri':util[_0xde7f('0xd')]('%s/api/v2/agents/me',_0x22451e['remoteUri'])})['then'](function(_0x1043df){logger['info'](_0xde7f('0x22'));return _0x1043df;});}});}else{logger[_0xde7f('0xb')](_0xde7f('0x23'));return request({'uri':util[_0xde7f('0xd')](_0xde7f('0x24'),_0x22451e[_0xde7f('0x19')])})['then'](function(_0x5b1c0b){logger[_0xde7f('0xb')](_0xde7f('0x22'));return _0x5b1c0b;});}}function getEndUser(_0x98a3a7,_0x154e64,_0x335e96){logger['info'](_0xde7f('0x25'),_0x335e96);return request({'uri':util[_0xde7f('0xd')](_0xde7f('0x26'),_0x98a3a7[_0xde7f('0x19')]),'qs':{'phone':_0x335e96}})[_0xde7f('0x1b')](function(_0xeac075){if(_0xeac075[_0xde7f('0x27')]){logger[_0xde7f('0xb')](_0xde7f('0x28'));return _['find'](_0xeac075,{'phone':_0x335e96});}else{logger[_0xde7f('0xb')](_0xde7f('0x29'));return request({'uri':util[_0xde7f('0xd')](_0xde7f('0x26'),_0x98a3a7[_0xde7f('0x19')]),'method':_0xde7f('0x1a'),'body':{'name':_0x154e64,'phone':_0x335e96}})[_0xde7f('0x1b')](function(_0x2524a1){logger['info']('Enduser\x20created.');return _0x2524a1;});}});}function getAuth(_0x19d26e){return util[_0xde7f('0xd')](_0xde7f('0x2a'),new Buffer(_0x19d26e[_0xde7f('0x2b')]+':X')[_0xde7f('0x2c')](_0xde7f('0x2d')));}function request(_0x22c985){logger[_0xde7f('0x2e')](_0xde7f('0x2f'),JSON['stringify'](_0x22c985));return rp(_[_0xde7f('0x6')](_0x22c985,{'method':_0xde7f('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x3661cb,_0x38e55c){var _0x529f24=[];if(_0x3661cb&&_0x3661cb[_0xde7f('0x27')]>0x0){_0x529f24=_[_0xde7f('0x31')](_0x3661cb,_0x38e55c);}return _0x529f24;}function getCustomFields(_0x516b57,_0x12a88e){var _0x28854f=[];var _0x453ba3={'custom_fields':[]};if(_0x516b57[_0xde7f('0x27')]>0x0){_[_0xde7f('0x32')](_0x516b57,function(_0x4fd51b){if(_[_0xde7f('0x33')]([_0xde7f('0x34'),_0xde7f('0x35')],_0x4fd51b[_0xde7f('0x36')])&&_0x4fd51b['nameField']&&!_0x4fd51b[_0xde7f('0x37')]){_0x453ba3[_0x4fd51b[_0xde7f('0x38')]['toLowerCase']()]=_0x4fd51b[_0xde7f('0x39')]['toString']();}else if(_['includes'](['string',_0xde7f('0x35')],_0x4fd51b[_0xde7f('0x36')])&&_0x4fd51b['idField']&&_0x4fd51b['customField']){_0x453ba3[_0xde7f('0x16')][_0xde7f('0x3a')]({'id':_0x4fd51b[_0xde7f('0x3b')],'value':_0x4fd51b[_0xde7f('0x39')]['toString']()});}else if(_0x4fd51b[_0xde7f('0x36')]===_0xde7f('0x3c')&&_0x4fd51b[_0xde7f('0x3d')]&&_0x4fd51b['idField']&&_0x4fd51b[_0xde7f('0x37')]){_0x12a88e[_0x4fd51b[_0xde7f('0x3d')]]&&_0x453ba3[_0xde7f('0x16')]['push']({'id':_0x4fd51b[_0xde7f('0x3b')],'value':_0x12a88e[_0x4fd51b[_0xde7f('0x3d')]]['toString']()});}else if(_0x4fd51b['type']==='customVariable'&&_0x4fd51b[_0xde7f('0x3e')]&&_0x4fd51b[_0xde7f('0x3e')][_0xde7f('0x12')]&&_0x4fd51b[_0xde7f('0x3b')]&&_0x4fd51b[_0xde7f('0x37')]){_0x12a88e[_0x4fd51b[_0xde7f('0x3e')][_0xde7f('0x12')][_0xde7f('0x3f')]()]&&_0x453ba3['custom_fields'][_0xde7f('0x3a')]({'id':_0x4fd51b['idField'],'value':_0x12a88e[_0x4fd51b[_0xde7f('0x3e')][_0xde7f('0x12')]['toLowerCase']()][_0xde7f('0x2c')]()});}});}return _0x453ba3;}exports[_0xde7f('0x40')]=function(_0x2ee380,_0x41a64c,_0x2cd48f,_0x288b73,_0x290115,_0x115ee7){var _0xe71268,_0xebc636;_0x115ee7[_0xde7f('0x19')]=intUtil[_0xde7f('0x41')](_0x115ee7['remoteUri']);_0x115ee7[_0xde7f('0x42')]=intUtil[_0xde7f('0x41')](_0x115ee7[_0xde7f('0x42')]);if(_0x290115&&_0x290115[_0xde7f('0x43')]){logger[_0xde7f('0xb')](_0xde7f('0x44'),_0xde7f('0x45'));_0x41a64c[_0xde7f('0x46')]=util[_0xde7f('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x115ee7[_0xde7f('0x42')],_0x41a64c[_0xde7f('0x47')],md5(_0x41a64c[_0xde7f('0x47')]));}else{_0x41a64c['recordingURL']='';}headers[_0xde7f('0x48')]=getAuth(_0x115ee7);return getUser(_0x115ee7,_0x288b73[_0xde7f('0x49')])['then'](function(_0x58852f){_0xe71268=_0x58852f;logger[_0xde7f('0xb')](_0xde7f('0x4a'),_0xe71268['id']);return getEndUser(_0x115ee7,_0x41a64c[_0xde7f('0x4b')],_0x41a64c['calleridnum']);})[_0xde7f('0x1b')](function(_0x19e5ec){_0xebc636=_0x19e5ec;logger[_0xde7f('0xb')](_0xde7f('0x4c'),_0xebc636['id']);return getTicket(_0x115ee7,_0xe71268,_0xebc636,_0x2cd48f,_0x41a64c);})[_0xde7f('0x1b')](function(_0x17abff){if(_0x17abff&&_0x17abff['id']){logger[_0xde7f('0xb')](_0xde7f('0x1c'));logger[_0xde7f('0xb')]('The\x20Ticket\x20ID\x20is:',_0x17abff['id']);logger[_0xde7f('0xb')](_0xde7f('0x44'),_0xde7f('0x4d'));emit(util[_0xde7f('0xd')](_0xde7f('0x4e'),_0x288b73[_0xde7f('0x12')]),_0xde7f('0x4f'),{'uri':util[_0xde7f('0xd')](_0xde7f('0x50'),_0x115ee7['remoteUri'],_0x17abff['id'])});}})[_0xde7f('0x51')](function(_0x33a638){logger[_0xde7f('0x52')](_0xde7f('0x44'),JSON['stringify'](_0x33a638));});};exports['outbound']=function(_0x2424e4,_0x4fe2aa,_0x4f4979,_0x59193b,_0x41236f,_0x4bbd5b,_0x1f148b){var _0x1882ef,_0x113f28;_0x4bbd5b['remoteUri']=intUtil['stripTrailingSlash'](_0x4bbd5b[_0xde7f('0x19')]);_0x4bbd5b[_0xde7f('0x42')]=intUtil[_0xde7f('0x41')](_0x4bbd5b[_0xde7f('0x42')]);if(_0x1f148b&&_0x1f148b['recordingFormat']&&_0x1f148b[_0xde7f('0x53')]!=='none'){logger[_0xde7f('0xb')](_0xde7f('0x54'),_0xde7f('0x45'));_0x4fe2aa[_0xde7f('0x46')]=util[_0xde7f('0xd')](_0xde7f('0x55'),_0x4bbd5b[_0xde7f('0x42')],_0x4fe2aa['uniqueid'],md5(_0x4fe2aa[_0xde7f('0x47')]));}headers[_0xde7f('0x48')]=getAuth(_0x4bbd5b);return getUser(_0x4bbd5b,_0x59193b[_0xde7f('0x49')])[_0xde7f('0x1b')](function(_0x5b649a){_0x1882ef=_0x5b649a;logger[_0xde7f('0xb')]('The\x20User\x20ID\x20is:',_0x1882ef['id']);return getEndUser(_0x4bbd5b,_0x4fe2aa[_0xde7f('0x56')],_0x4fe2aa[_0xde7f('0x57')]);})[_0xde7f('0x1b')](function(_0x17f010){_0x113f28=_0x17f010;logger[_0xde7f('0xb')]('The\x20Enduser\x20ID\x20is:',_0x113f28['id']);return getTicket(_0x4bbd5b,_0x1882ef,_0x113f28,_0x4f4979,_0x4fe2aa);})[_0xde7f('0x1b')](function(_0x3c8e40){if(_0x3c8e40&&_0x3c8e40['id']){logger[_0xde7f('0xb')](_0xde7f('0x1c'));logger[_0xde7f('0xb')](_0xde7f('0x58'),_0x3c8e40['id']);logger[_0xde7f('0xb')](_0xde7f('0x54'),_0xde7f('0x4d'));emit(util[_0xde7f('0xd')]('user:%s',_0x59193b['name']),_0xde7f('0x4f'),{'uri':util[_0xde7f('0xd')]('%s/helpdesk/tickets/%d',_0x4bbd5b[_0xde7f('0x19')],_0x3c8e40['id'])});}})[_0xde7f('0x51')](function(_0xa89921){logger[_0xde7f('0x52')](_0xde7f('0x54'),JSON['stringify'](_0xa89921));});};exports[_0xde7f('0x59')]=function(_0x36b208,_0x6ec9f0,_0x29e42,_0x58d87c,_0x17bfde,_0x4915b8){var _0x47aa37,_0x116d20;_0x4915b8[_0xde7f('0x19')]=intUtil['stripTrailingSlash'](_0x4915b8['remoteUri']);_0x4915b8[_0xde7f('0x42')]=intUtil[_0xde7f('0x41')](_0x4915b8[_0xde7f('0x42')]);if(_0x17bfde&&_0x17bfde['monitor_format']){logger[_0xde7f('0xb')]('['+_0x6ec9f0[_0xde7f('0x5a')]['toUpperCase']()+']',_0xde7f('0x45'));_0x6ec9f0['recordingURL']=util[_0xde7f('0xd')](_0xde7f('0x55'),_0x4915b8[_0xde7f('0x42')],_0x6ec9f0[_0xde7f('0x47')],md5(_0x6ec9f0['uniqueid']));}else{_0x6ec9f0[_0xde7f('0x46')]='';}headers['Authorization']=getAuth(_0x4915b8);return getUser(_0x4915b8,'')['then'](function(_0x3e7625){_0x47aa37=_0x3e7625;logger[_0xde7f('0xb')](_0xde7f('0x4a'),_0x47aa37['id']);return getEndUser(_0x4915b8,_0x6ec9f0[_0xde7f('0x4b')],_0x6ec9f0[_0xde7f('0x5b')]);})['then'](function(_0x1159dd){_0x116d20=_0x1159dd;logger[_0xde7f('0xb')](_0xde7f('0x4c'),_0x116d20['id']);return getTicket(_0x4915b8,_0x47aa37,_0x116d20,_0x29e42,_0x6ec9f0);})[_0xde7f('0x1b')](function(_0x148a78){if(_0x148a78){logger[_0xde7f('0xb')]('Ticket\x20created!');logger[_0xde7f('0xb')](_0xde7f('0x58'),_0x148a78['id']);}})[_0xde7f('0x51')](function(_0x14dd81){logger['error']('['+_0x6ec9f0[_0xde7f('0x5a')][_0xde7f('0x5c')]()+']',JSON[_0xde7f('0x5d')](_0x14dd81));});}; \ 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 1dbb477..77b3e27 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 _0x7ae8=['destcalleridnum','calleridnum','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','localhost','socket.io-emitter','redis','GET','/api/selector/owners','headers','info','then','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','&f=','find','format','Searching\x20contact\x20with\x20phone\x20%s','Contact\x20found\x20mobile_number:','contactNumber','Contact\x20found\x20work_number:','endUserId','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','Subjects','getString','Contact','add','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound'];(function(_0x296494,_0x1121d2){var _0x32acf3=function(_0x5ee349){while(--_0x5ee349){_0x296494['push'](_0x296494['shift']());}};_0x32acf3(++_0x1121d2);}(_0x7ae8,0x1aa));var _0x87ae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ae8[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var rp=require(_0x87ae('0x0'));var md5=require('md5');var util=require(_0x87ae('0x1'));var moment=require(_0x87ae('0x2'));var Promise=require(_0x87ae('0x3'));var Redis=require(_0x87ae('0x4'));var intUtil=require(_0x87ae('0x5'));var config=require(_0x87ae('0x6'));var logger=require(_0x87ae('0x7'))(_0x87ae('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0x87ae('0x9'),'port':0x18eb});var io=require(_0x87ae('0xa'))(new Redis(config[_0x87ae('0xb')]));function getAdminId(_0x5745c7,_0x18cd7a,_0x4c543e,_0x59a1ff){return new Promise(function(_0x337a3b,_0x274762){var _0x2e963a=![];var _0x81cada={'method':_0x87ae('0xc'),'uri':_0x59a1ff+_0x87ae('0xd'),'json':!![]};_0x81cada[_0x87ae('0xe')]=_0x4c543e;logger[_0x87ae('0xf')]('Getting\x20admin\x20information');return rp(_0x81cada)[_0x87ae('0x10')](function(_0x5c789d){if(_0x5c789d){var _0x4794f7=_0x5c789d[_0x87ae('0x11')];var _0x595169=null;for(_0x595169=0x0;_0x595169<_0x4794f7[_0x87ae('0x12')];_0x595169++){if(_0x4794f7[_0x595169][_0x87ae('0x13')]===_0x5745c7[_0x87ae('0x14')]){_0x5745c7['adminId']=_0x4794f7[_0x595169]['id'];_0x2e963a=!![];}}if(_0x2e963a){logger['info'](_0x87ae('0x15'),_0x5745c7[_0x87ae('0x16')]);_0x337a3b(_0x5745c7);}else{_0x274762({'statusCode':0x194,'message':_0x87ae('0x17')});}}else{_0x274762({'statusCode':0x194,'message':_0x87ae('0x17')});}})[_0x87ae('0x18')](function(_0x1c7520){logger[_0x87ae('0x19')]('['+[_0x18cd7a[_0x87ae('0x1a')]()]+']',_0x1c7520[_0x87ae('0x1b')]);_0x274762(_0x1c7520);});});}function getUser(_0x210345,_0x448535,_0x5eb749){return function(_0x241dff){return new Promise(function(_0x1d76ac,_0x467f31){var _0x601f11={'method':_0x87ae('0xc'),'uri':_0x5eb749+'/api/selector/owners','json':!![]};_0x601f11['headers']=_0x448535;logger[_0x87ae('0xf')]('Getting\x20user\x20list');return rp(_0x601f11)['then'](function(_0x309f09){if(_0x309f09){var _0x5138cc=_0x309f09[_0x87ae('0x11')];var _0x3f7504=![];var _0x4e4e2d=null;if(_0x241dff[_0x87ae('0x1c')]!==null){logger[_0x87ae('0xf')](_0x87ae('0x1d'),_0x241dff[_0x87ae('0x1c')]);_0x241dff[_0x87ae('0x1e')]=_0x241dff[_0x87ae('0x1c')];for(_0x4e4e2d=0x0;_0x4e4e2d<_0x5138cc[_0x87ae('0x12')];_0x4e4e2d++){if(_0x5138cc[_0x4e4e2d]['email']===_0x241dff[_0x87ae('0x1c')]){_0x3f7504=!![];_0x241dff[_0x87ae('0x1f')]=_0x5138cc[_0x4e4e2d]['id'];logger[_0x87ae('0xf')](_0x87ae('0x20'),_0x241dff[_0x87ae('0x1f')]);}}}if(!_0x3f7504){logger[_0x87ae('0xf')](_0x87ae('0x21'));_0x241dff['userEmail']=_0x241dff[_0x87ae('0x14')];_0x241dff[_0x87ae('0x1f')]=_0x241dff['adminId'];_0x3f7504=!![];}if(_0x3f7504){_0x1d76ac(_0x241dff);}else{_0x467f31({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x467f31({'statusCode':0x194,'message':_0x87ae('0x17')});}})[_0x87ae('0x18')](function(_0x2803f7){logger[_0x87ae('0x19')]('['+[_0x210345[_0x87ae('0x1a')]()]+']',_0x2803f7[_0x87ae('0x1b')]);_0x467f31(_0x2803f7);});});};}function searchContact(_0xc1a6ff,_0x3c5658,_0x476ef7,_0x54de18){return new Promise(function(_0x1dcb4e,_0x453a03){var _0x2e5188={'method':_0x87ae('0xc'),'headers':_0x3c5658,'uri':_0xc1a6ff+'/api/lookup?q='+_0x54de18+_0x87ae('0x22')+_0x476ef7+'&entities=contact','json':!![]};rp(_0x2e5188)[_0x87ae('0x10')](function(_0x4ee414){var _0x260915=_[_0x87ae('0x23')](_0x4ee414['contacts']['contacts'],[_0x476ef7,_0x54de18]);_0x1dcb4e(_0x260915);})[_0x87ae('0x18')](function(_0x2e0de4){_0x453a03(_0x2e0de4);});});}function getEndUser(_0xb893e1,_0x51eb9d,_0x4bb2a3){return function(_0x42a56e){return new Promise(function(_0x3b2f21,_0x3b1ae8){logger[_0x87ae('0xf')](util[_0x87ae('0x24')](_0x87ae('0x25'),_0x42a56e['contactNumber']));searchContact(_0x4bb2a3,_0x51eb9d,'mobile_number',_0x42a56e['contactNumber'])['then'](function(_0x13793c){if(_0x13793c){_0x42a56e['endUserId']=_0x13793c['id'];logger[_0x87ae('0xf')](_0x87ae('0x26'),_0x42a56e['endUserId']);return _0x3b2f21(_0x42a56e);}searchContact(_0x4bb2a3,_0x51eb9d,'work_number',_0x42a56e[_0x87ae('0x27')])[_0x87ae('0x10')](function(_0xe6754f){if(_0xe6754f){_0x42a56e['endUserId']=_0xe6754f['id'];logger[_0x87ae('0xf')](_0x87ae('0x28'),_0x42a56e[_0x87ae('0x29')]);return _0x3b2f21(_0x42a56e);}createEndUser(_0x42a56e,_0xb893e1,_0x51eb9d,_0x4bb2a3)[_0x87ae('0x10')](function(_0x4745ac){logger[_0x87ae('0xf')](_0x87ae('0x2a'),_0x4745ac[_0x87ae('0x29')]);return _0x3b2f21(_0x4745ac);});});})['catch'](function(_0x33030b){_0x3b1ae8(_0x33030b);});});};}function createEndUser(_0x4a6090,_0x1a1f97,_0x2ce34a,_0x3b11cd){return new Promise(function(_0xc446de,_0x4da67f){var _0x31f591=moment();var _0x208be9={'method':_0x87ae('0x2b'),'uri':_0x3b11cd+_0x87ae('0x2c'),'body':{'contact':{'last_name':_0x4a6090[_0x87ae('0x27')],'work_number':_0x4a6090[_0x87ae('0x27')],'mobile_number':_0x4a6090[_0x87ae('0x27')],'owner_id':_0x4a6090[_0x87ae('0x1f')],'created_at':_0x31f591[_0x87ae('0x24')](_0x87ae('0x2d'))}},'json':!![]};_0x208be9[_0x87ae('0xe')]=_0x2ce34a;logger['info'](_0x87ae('0x2e'));return rp(_0x208be9)[_0x87ae('0x10')](function(_0x2fe2d8){_0x4a6090[_0x87ae('0x29')]=_0x2fe2d8['contact']['id'];_0xc446de(_0x4a6090);})[_0x87ae('0x18')](function(_0x51cea0){logger[_0x87ae('0x19')]('['+[_0x1a1f97['toUpperCase']()]+']',_0x51cea0['message']);_0x4da67f(_0x51cea0['message']);});});}function getTicket(_0x1b669f,_0x1b9d36,_0xae7d58,_0x4d8907,_0x21a7f6){return function(_0x296708){logger[_0x87ae('0xf')](_0x87ae('0x2f'));return new Promise(function(_0x50ef60,_0x3f3572){var _0x48fa35=moment();var _0x25f9a3={'method':'POST','uri':_0xae7d58+_0x87ae('0x30'),'body':{'title':intUtil['getString'](_0x4d8907[_0x87ae('0x31')],_0x21a7f6,'\x20'),'description':intUtil[_0x87ae('0x32')](_0x4d8907['Descriptions'],_0x21a7f6,'\x0a'),'owner_id':_0x296708['userId'],'creater_id':_0x296708[_0x87ae('0x16')],'targetable_id':_0x296708[_0x87ae('0x29')],'targetable_type':_0x87ae('0x33'),'created_at':_0x48fa35['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x48fa35[_0x87ae('0x34')](0x1e,'m')[_0x87ae('0x24')](_0x87ae('0x2d'))},'json':!![]};_0x25f9a3['headers']=_0x1b9d36;return rp(_0x25f9a3)['then'](function(_0x8b7b90){_0x296708['ticketId']=_0x8b7b90[_0x87ae('0x35')]['id'];logger[_0x87ae('0xf')](_0x87ae('0x36'),_0x296708['ticketId']);_0x50ef60(_0x296708);})[_0x87ae('0x18')](function(_0x528a38){logger[_0x87ae('0x19')]('['+[_0x1b669f[_0x87ae('0x1a')]()]+']',_0x528a38[_0x87ae('0x1b')]);_0x3f3572(_0x528a38['message']);});});};}function emit(_0x283fb2,_0x2f4e1f,_0x103322){var _0x4929ee={'uri':_0x283fb2+_0x87ae('0x37')+_0x103322};io['to'](util['format'](_0x87ae('0x38'),_0x2f4e1f))[_0x87ae('0x39')](_0x87ae('0x3a'),_0x4929ee);}exports['cs']=function(_0x4df743,_0x4f07fd,_0x117746,_0x441280,_0x4e9dae,_0x3f2d42,_0x500628,_0x4506dd){var _0x4462ca={};var _0x3f7752={'Authorization':'Token\x20token='+_0x3f2d42[_0x87ae('0x3b')]};_0x3f2d42['remoteUri']=intUtil[_0x87ae('0x3c')](_0x3f2d42[_0x87ae('0x3d')]);_0x3f2d42[_0x87ae('0x3e')]=intUtil[_0x87ae('0x3c')](_0x3f2d42[_0x87ae('0x3e')]);var _0x5dab3b=_0x3f2d42['remoteUri'];_0x4462ca[_0x87ae('0x14')]=_0x3f2d42[_0x87ae('0x3f')];_0x4462ca['contactNumber']=_0x4506dd[_0x87ae('0x40')]()===_0x87ae('0x41')?_0x4f07fd[_0x87ae('0x42')]:_0x4f07fd[_0x87ae('0x43')];_0x4462ca['callDirection']=_0x4506dd===_0x87ae('0x44')||_0x4506dd===_0x87ae('0x45')?_0x87ae('0x44'):_0x87ae('0x41');if(_0x441280){_0x4462ca[_0x87ae('0x1c')]=_0x441280[_0x87ae('0x13')];}var _0x2c2233=util[_0x87ae('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f2d42[_0x87ae('0x3e')],_0x4f07fd['uniqueid'],md5(_0x4f07fd[_0x87ae('0x46')]));if(_0x4e9dae&&_0x4e9dae[_0x87ae('0x47')]){logger[_0x87ae('0xf')](_0x87ae('0x48'),'Recording\x20is\x20enabled!');_0x4f07fd[_0x87ae('0x49')]=_0x2c2233;}else if(_0x500628&&_0x500628[_0x87ae('0x4a')]&&_0x500628[_0x87ae('0x4a')]!==_0x87ae('0x4b')){logger[_0x87ae('0xf')](_0x87ae('0x4c'),_0x87ae('0x4d'));_0x4f07fd[_0x87ae('0x49')]=_0x2c2233;}else{_0x4f07fd['recordingURL']='';}return getAdminId(_0x4462ca,_0x4506dd,_0x3f7752,_0x5dab3b)['then'](getUser(_0x4506dd,_0x3f7752,_0x5dab3b))['then'](getEndUser(_0x4506dd,_0x3f7752,_0x5dab3b))[_0x87ae('0x10')](getTicket(_0x4506dd,_0x3f7752,_0x5dab3b,_0x117746,_0x4f07fd))[_0x87ae('0x10')](function(_0x138c04){logger[_0x87ae('0xf')](util[_0x87ae('0x24')](_0x87ae('0x4e'),_0x138c04['ticketId']));if(_0x4506dd!==_0x87ae('0x45')){logger[_0x87ae('0xf')]('['+[_0x4506dd[_0x87ae('0x1a')]()]+']',_0x87ae('0x4f'));emit(_0x5dab3b,_0x441280[_0x87ae('0x50')],_0x138c04['endUserId']);}})[_0x87ae('0x18')](function(_0x1b8bff){logger[_0x87ae('0x19')]('['+[_0x4506dd[_0x87ae('0x1a')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x87ae('0x51')](_0x1b8bff,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xecc8=['uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/logger','freshsales','redis','defaults','GET','/api/selector/owners','headers','info','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','error','/api/lookup?q=','&f=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x49641e,_0x5d497c){var _0x422c56=function(_0x512aea){while(--_0x512aea){_0x49641e['push'](_0x49641e['shift']());}};_0x422c56(++_0x5d497c);}(_0xecc8,0x19b));var _0x8ecc=function(_0x1d6024,_0x197dff){_0x1d6024=_0x1d6024-0x0;var _0x2c5310=_0xecc8[_0x1d6024];return _0x2c5310;};'use strict';var _=require(_0x8ecc('0x0'));var rp=require(_0x8ecc('0x1'));var md5=require(_0x8ecc('0x2'));var util=require(_0x8ecc('0x3'));var moment=require(_0x8ecc('0x4'));var Promise=require(_0x8ecc('0x5'));var Redis=require('ioredis');var intUtil=require(_0x8ecc('0x6'));var config=require('../../../../config/environment');var logger=require(_0x8ecc('0x7'))(_0x8ecc('0x8'));config[_0x8ecc('0x9')]=_[_0x8ecc('0xa')](config[_0x8ecc('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8ecc('0x9')]));function getAdminId(_0x46139c,_0x125c91,_0x113ef6,_0xef6ec8){return new Promise(function(_0x167dbf,_0x58aedd){var _0x2fce72=![];var _0x511f0d={'method':_0x8ecc('0xb'),'uri':_0xef6ec8+_0x8ecc('0xc'),'json':!![]};_0x511f0d[_0x8ecc('0xd')]=_0x113ef6;logger[_0x8ecc('0xe')]('Getting\x20admin\x20information');return rp(_0x511f0d)[_0x8ecc('0xf')](function(_0x277189){if(_0x277189){var _0x447df1=_0x277189[_0x8ecc('0x10')];var _0x41f5bb=null;for(_0x41f5bb=0x0;_0x41f5bb<_0x447df1[_0x8ecc('0x11')];_0x41f5bb++){if(_0x447df1[_0x41f5bb][_0x8ecc('0x12')]===_0x46139c[_0x8ecc('0x13')]){_0x46139c[_0x8ecc('0x14')]=_0x447df1[_0x41f5bb]['id'];_0x2fce72=!![];}}if(_0x2fce72){logger[_0x8ecc('0xe')]('Admin\x20found:',_0x46139c['adminId']);_0x167dbf(_0x46139c);}else{_0x58aedd({'statusCode':0x194,'message':_0x8ecc('0x15')});}}else{_0x58aedd({'statusCode':0x194,'message':_0x8ecc('0x15')});}})[_0x8ecc('0x16')](function(_0x219bfa){logger['error']('['+[_0x125c91[_0x8ecc('0x17')]()]+']',_0x219bfa[_0x8ecc('0x18')]);_0x58aedd(_0x219bfa);});});}function getUser(_0x54eca0,_0x40ccb6,_0x5b3822){return function(_0x91765){return new Promise(function(_0x1c3eac,_0x59790a){var _0x1bbeec={'method':_0x8ecc('0xb'),'uri':_0x5b3822+'/api/selector/owners','json':!![]};_0x1bbeec[_0x8ecc('0xd')]=_0x40ccb6;logger['info']('Getting\x20user\x20list');return rp(_0x1bbeec)[_0x8ecc('0xf')](function(_0x3f2845){if(_0x3f2845){var _0x340a4c=_0x3f2845['users'];var _0x484043=![];var _0x39d919=null;if(_0x91765[_0x8ecc('0x19')]!==null){logger[_0x8ecc('0xe')](_0x8ecc('0x1a'),_0x91765[_0x8ecc('0x19')]);_0x91765[_0x8ecc('0x1b')]=_0x91765['agentEmail'];for(_0x39d919=0x0;_0x39d919<_0x340a4c[_0x8ecc('0x11')];_0x39d919++){if(_0x340a4c[_0x39d919][_0x8ecc('0x12')]===_0x91765[_0x8ecc('0x19')]){_0x484043=!![];_0x91765[_0x8ecc('0x1c')]=_0x340a4c[_0x39d919]['id'];logger['info'](_0x8ecc('0x1d'),_0x91765[_0x8ecc('0x1c')]);}}}if(!_0x484043){logger['info'](_0x8ecc('0x1e'));_0x91765['userEmail']=_0x91765[_0x8ecc('0x13')];_0x91765[_0x8ecc('0x1c')]=_0x91765[_0x8ecc('0x14')];_0x484043=!![];}if(_0x484043){_0x1c3eac(_0x91765);}else{_0x59790a({'statusCode':0x194,'message':_0x8ecc('0x15')});}}else{_0x59790a({'statusCode':0x194,'message':_0x8ecc('0x15')});}})[_0x8ecc('0x16')](function(_0x600950){logger[_0x8ecc('0x1f')]('['+[_0x54eca0[_0x8ecc('0x17')]()]+']',_0x600950['message']);_0x59790a(_0x600950);});});};}function searchContact(_0x441d0f,_0x38613d,_0x15df20,_0x31440){return new Promise(function(_0x2a5591,_0x5a6ee7){var _0x30eee4={'method':_0x8ecc('0xb'),'headers':_0x38613d,'uri':_0x441d0f+_0x8ecc('0x20')+_0x31440+_0x8ecc('0x21')+_0x15df20+'&entities=contact','json':!![]};rp(_0x30eee4)[_0x8ecc('0xf')](function(_0x47b569){var _0x90bc7c=_['find'](_0x47b569['contacts'][_0x8ecc('0x22')],[_0x15df20,_0x31440]);_0x2a5591(_0x90bc7c);})[_0x8ecc('0x16')](function(_0x27f360){_0x5a6ee7(_0x27f360);});});}function getEndUser(_0xd86a15,_0x2a10fa,_0x56a50){return function(_0xb7ef46){return new Promise(function(_0x36a2d6,_0x256e01){logger['info'](util[_0x8ecc('0x23')](_0x8ecc('0x24'),_0xb7ef46[_0x8ecc('0x25')]));searchContact(_0x56a50,_0x2a10fa,_0x8ecc('0x26'),_0xb7ef46[_0x8ecc('0x25')])[_0x8ecc('0xf')](function(_0xdc1d71){if(_0xdc1d71){_0xb7ef46[_0x8ecc('0x27')]=_0xdc1d71['id'];logger[_0x8ecc('0xe')](_0x8ecc('0x28'),_0xb7ef46['endUserId']);return _0x36a2d6(_0xb7ef46);}searchContact(_0x56a50,_0x2a10fa,'work_number',_0xb7ef46['contactNumber'])[_0x8ecc('0xf')](function(_0xa17333){if(_0xa17333){_0xb7ef46[_0x8ecc('0x27')]=_0xa17333['id'];logger[_0x8ecc('0xe')](_0x8ecc('0x29'),_0xb7ef46[_0x8ecc('0x27')]);return _0x36a2d6(_0xb7ef46);}createEndUser(_0xb7ef46,_0xd86a15,_0x2a10fa,_0x56a50)['then'](function(_0x2563d6){logger['info'](_0x8ecc('0x2a'),_0x2563d6[_0x8ecc('0x27')]);return _0x36a2d6(_0x2563d6);});});})[_0x8ecc('0x16')](function(_0x5719c5){_0x256e01(_0x5719c5);});});};}function createEndUser(_0x13899f,_0x13c42c,_0x29f562,_0x56d2d8){return new Promise(function(_0x41affd,_0x16b6c9){var _0x5652f7=moment();var _0x3f0832={'method':_0x8ecc('0x2b'),'uri':_0x56d2d8+'/api/contacts','body':{'contact':{'last_name':_0x13899f[_0x8ecc('0x25')],'work_number':_0x13899f[_0x8ecc('0x25')],'mobile_number':_0x13899f[_0x8ecc('0x25')],'owner_id':_0x13899f['userId'],'created_at':_0x5652f7[_0x8ecc('0x23')](_0x8ecc('0x2c'))}},'json':!![]};_0x3f0832[_0x8ecc('0xd')]=_0x29f562;logger[_0x8ecc('0xe')](_0x8ecc('0x2d'));return rp(_0x3f0832)['then'](function(_0x38782e){_0x13899f[_0x8ecc('0x27')]=_0x38782e[_0x8ecc('0x2e')]['id'];_0x41affd(_0x13899f);})['catch'](function(_0x3f08b1){logger['error']('['+[_0x13c42c[_0x8ecc('0x17')]()]+']',_0x3f08b1[_0x8ecc('0x18')]);_0x16b6c9(_0x3f08b1[_0x8ecc('0x18')]);});});}function getTicket(_0x3c9e15,_0x256eb8,_0x4eb06f,_0x1e9dba,_0x517566){return function(_0x45e981){logger[_0x8ecc('0xe')](_0x8ecc('0x2f'));return new Promise(function(_0x1cc523,_0x4b3405){var _0x342245=moment();var _0x3cc80c={'method':'POST','uri':_0x4eb06f+_0x8ecc('0x30'),'body':{'title':intUtil[_0x8ecc('0x31')](_0x1e9dba['Subjects'],_0x517566,'\x20'),'description':intUtil[_0x8ecc('0x31')](_0x1e9dba[_0x8ecc('0x32')],_0x517566,'\x0a'),'owner_id':_0x45e981[_0x8ecc('0x1c')],'creater_id':_0x45e981[_0x8ecc('0x14')],'targetable_id':_0x45e981[_0x8ecc('0x27')],'targetable_type':'Contact','created_at':_0x342245['format'](_0x8ecc('0x2c')),'due_date':_0x342245[_0x8ecc('0x33')](0x1e,'m')['format'](_0x8ecc('0x2c'))},'json':!![]};_0x3cc80c['headers']=_0x256eb8;return rp(_0x3cc80c)['then'](function(_0x1c818f){_0x45e981[_0x8ecc('0x34')]=_0x1c818f['task']['id'];logger['info'](_0x8ecc('0x35'),_0x45e981['ticketId']);_0x1cc523(_0x45e981);})[_0x8ecc('0x16')](function(_0x2be7b0){logger[_0x8ecc('0x1f')]('['+[_0x3c9e15[_0x8ecc('0x17')]()]+']',_0x2be7b0[_0x8ecc('0x18')]);_0x4b3405(_0x2be7b0[_0x8ecc('0x18')]);});});};}function emit(_0x554aff,_0x332bb4,_0x107914){var _0x657e1={'uri':_0x554aff+_0x8ecc('0x36')+_0x107914};io['to'](util[_0x8ecc('0x23')](_0x8ecc('0x37'),_0x332bb4))[_0x8ecc('0x38')](_0x8ecc('0x39'),_0x657e1);}exports['cs']=function(_0x58d30e,_0x74bf97,_0x4d9525,_0x2b6cf1,_0x1780b2,_0x111c6b,_0x55bf67,_0x1a6d8a){var _0x3f12b1={};var _0x16596e={'Authorization':_0x8ecc('0x3a')+_0x111c6b[_0x8ecc('0x3b')]};_0x111c6b[_0x8ecc('0x3c')]=intUtil[_0x8ecc('0x3d')](_0x111c6b[_0x8ecc('0x3c')]);_0x111c6b[_0x8ecc('0x3e')]=intUtil['stripTrailingSlash'](_0x111c6b[_0x8ecc('0x3e')]);var _0x1d4b8b=_0x111c6b[_0x8ecc('0x3c')];_0x3f12b1[_0x8ecc('0x13')]=_0x111c6b['username'];_0x3f12b1[_0x8ecc('0x25')]=_0x1a6d8a['toLowerCase']()===_0x8ecc('0x3f')?_0x74bf97[_0x8ecc('0x40')]:_0x74bf97[_0x8ecc('0x41')];_0x3f12b1[_0x8ecc('0x42')]=_0x1a6d8a===_0x8ecc('0x43')||_0x1a6d8a==='unmanaged'?_0x8ecc('0x43'):'outbound';if(_0x2b6cf1){_0x3f12b1[_0x8ecc('0x19')]=_0x2b6cf1[_0x8ecc('0x12')];}var _0x28cdb2=util[_0x8ecc('0x23')](_0x8ecc('0x44'),_0x111c6b[_0x8ecc('0x3e')],_0x74bf97[_0x8ecc('0x45')],md5(_0x74bf97[_0x8ecc('0x45')]));if(_0x1780b2&&_0x1780b2[_0x8ecc('0x46')]){logger[_0x8ecc('0xe')](_0x8ecc('0x47'),'Recording\x20is\x20enabled!');_0x74bf97[_0x8ecc('0x48')]=_0x28cdb2;}else if(_0x55bf67&&_0x55bf67[_0x8ecc('0x49')]&&_0x55bf67[_0x8ecc('0x49')]!=='none'){logger[_0x8ecc('0xe')]('[OUTBOUND]',_0x8ecc('0x4a'));_0x74bf97[_0x8ecc('0x48')]=_0x28cdb2;}else{_0x74bf97['recordingURL']='';}return getAdminId(_0x3f12b1,_0x1a6d8a,_0x16596e,_0x1d4b8b)[_0x8ecc('0xf')](getUser(_0x1a6d8a,_0x16596e,_0x1d4b8b))[_0x8ecc('0xf')](getEndUser(_0x1a6d8a,_0x16596e,_0x1d4b8b))[_0x8ecc('0xf')](getTicket(_0x1a6d8a,_0x16596e,_0x1d4b8b,_0x4d9525,_0x74bf97))[_0x8ecc('0xf')](function(_0x11d505){logger['info'](util['format'](_0x8ecc('0x4b'),_0x11d505['ticketId']));if(_0x1a6d8a!==_0x8ecc('0x4c')){logger[_0x8ecc('0xe')]('['+[_0x1a6d8a[_0x8ecc('0x17')]()]+']',_0x8ecc('0x4d'));emit(_0x1d4b8b,_0x2b6cf1['name'],_0x11d505[_0x8ecc('0x27')]);}})[_0x8ecc('0x16')](function(_0x362af0){logger[_0x8ecc('0x1f')]('['+[_0x1a6d8a[_0x8ecc('0x17')]()]+_0x8ecc('0x4e'),util[_0x8ecc('0x4f')](_0x362af0,{'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 e2d944d..e6f3443 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 _0xd217=['data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','freshdesk','zoho','vtiger','unknown\x20integration','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','desk','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase'];(function(_0x2badac,_0x4b93fa){var _0x28276c=function(_0x19d5db){while(--_0x19d5db){_0x2badac['push'](_0x2badac['shift']());}};_0x28276c(++_0x4b93fa);}(_0xd217,0x155));var _0x7d21=function(_0x5517aa,_0x4679c5){_0x5517aa=_0x5517aa-0x0;var _0xe6f7e6=_0xd217[_0x5517aa];return _0xe6f7e6;};'use strict';var _=require(_0x7d21('0x0'));var util=require(_0x7d21('0x1'));var zendesk=require(_0x7d21('0x2'));var salesforce=require(_0x7d21('0x3'));var sugarcrm=require(_0x7d21('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x7d21('0x5'));var desk=require('./desk');var vtiger=require(_0x7d21('0x6'));var servicenow=require(_0x7d21('0x7'));var dynamics365=require(_0x7d21('0x8'));var freshsales=require('./freshsales');var integrations=[_0x7d21('0x9'),'salesforce',_0x7d21('0xa'),'freshdesk','zoho',_0x7d21('0xb'),'vtiger',_0x7d21('0xc'),_0x7d21('0xd'),_0x7d21('0xe')];exports[_0x7d21('0xf')]=function(_0x18b049,_0x305d54,_0x4db0bd,_0xf8d17d,_0x3df15d,_0x2a2b09){if(_0x4db0bd){if(_[_0x7d21('0x10')](integrations,_0x18b049[_0x7d21('0x11')][_0x7d21('0x12')]())){try{var _0x48be17=null;var _0x5df56e='';var _0x101e70=_0x4db0bd[_0x18b049[_0x7d21('0x11')][_0x7d21('0x12')]()];if(_0x101e70){var _0x3a0ade=_0x101e70[_0x18b049[_0x7d21('0x13')]];if(_0x3a0ade){var _0x371418=_[_0x7d21('0x14')](_0x3a0ade[_0x7d21('0x15')],{'id':parseInt(_0x18b049[_0x7d21('0x16')],0xa)});if(_0x371418){if(_0xf8d17d){if(_0x3df15d&&_0x305d54[_0x7d21('0x17')]){_0x5df56e=_0x7d21('0x17');}else if(_0x305d54[_0x7d21('0x18')]){_0x5df56e=_0x7d21('0x19');}else{console[_0x7d21('0x1a')](_0x7d21('0x1b'),_0x305d54);}}else{_0x5df56e=_0x7d21('0x1c');}switch(_0x18b049[_0x7d21('0x11')][_0x7d21('0x12')]()){case _0x7d21('0x9'):zendesk[_0x5df56e](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09);break;case _0x7d21('0x1d'):salesforce[_0x5df56e](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09);break;case _0x7d21('0xa'):sugarcrm[_0x5df56e](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09);break;case _0x7d21('0x1e'):freshdesk[_0x5df56e](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09);break;case _0x7d21('0x1f'):zoho[_0x5df56e](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09);break;case _0x7d21('0xb'):desk[_0x5df56e](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09);break;case _0x7d21('0x20'):vtiger[_0x5df56e](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09);break;case'freshsales':freshsales['cs'](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09,_0x5df56e);break;case'servicenow':servicenow['cs'](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09,_0x5df56e);break;case _0x7d21('0xc'):dynamics365['cs'](_0x18b049,_0x305d54,_0x371418,_0xf8d17d,_0x3df15d,_0x3a0ade,_0x2a2b09,_0x5df56e);break;default:console[_0x7d21('0x1a')](_0x7d21('0x21'));}}else{_0x48be17=require('../../../../config/logger')(_0x18b049[_0x7d21('0x11')][_0x7d21('0x12')]());_0x48be17[_0x7d21('0x22')](_0x7d21('0x23'),util['format'](_0x7d21('0x24'),_0x18b049['data1'][_0x7d21('0x12')](),_0x18b049[_0x7d21('0x16')]));}}else{_0x48be17=require(_0x7d21('0x25'))(_0x18b049['data1'][_0x7d21('0x12')]());_0x48be17[_0x7d21('0x22')](_0x7d21('0x23'),util[_0x7d21('0x26')](_0x7d21('0x27'),_0x18b049[_0x7d21('0x11')][_0x7d21('0x12')](),_0x18b049['data2']));}}else{}}catch(_0x1ddfd8){console[_0x7d21('0x22')](_0x1ddfd8);}}}}; \ No newline at end of file +var _0x4e9c=['lodash','util','./zendesk','./salesforce','./sugarcrm','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','Configurations','queue','outbound','log','EVENT\x20UNKNOWN','servicenow','error','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found'];(function(_0x41452a,_0x35da2c){var _0x4cc55b=function(_0x3f4445){while(--_0x3f4445){_0x41452a['push'](_0x41452a['shift']());}};_0x4cc55b(++_0x35da2c);}(_0x4e9c,0x1dc));var _0xc4e9=function(_0x353292,_0x3f1713){_0x353292=_0x353292-0x0;var _0x4b8996=_0x4e9c[_0x353292];return _0x4b8996;};'use strict';var _=require(_0xc4e9('0x0'));var util=require(_0xc4e9('0x1'));var zendesk=require(_0xc4e9('0x2'));var salesforce=require(_0xc4e9('0x3'));var sugarcrm=require(_0xc4e9('0x4'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0xc4e9('0x5'));var vtiger=require(_0xc4e9('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0xc4e9('0x7'));var freshsales=require(_0xc4e9('0x8'));var integrations=[_0xc4e9('0x9'),_0xc4e9('0xa'),_0xc4e9('0xb'),_0xc4e9('0xc'),_0xc4e9('0xd'),_0xc4e9('0xe'),_0xc4e9('0xf'),_0xc4e9('0x10'),_0xc4e9('0x11'),'servicenow'];exports[_0xc4e9('0x12')]=function(_0x4a72b7,_0x359169,_0xee91d2,_0x50a498,_0x5f03c4,_0x48352f){if(_0xee91d2){if(_[_0xc4e9('0x13')](integrations,_0x4a72b7[_0xc4e9('0x14')][_0xc4e9('0x15')]())){try{var _0x335631=null;var _0x1c163e='';var _0x48677d=_0xee91d2[_0x4a72b7[_0xc4e9('0x14')]['toLowerCase']()];if(_0x48677d){var _0x128980=_0x48677d[_0x4a72b7['data2']];if(_0x128980){var _0x5ae78d=_['find'](_0x128980[_0xc4e9('0x16')],{'id':parseInt(_0x4a72b7['data3'],0xa)});if(_0x5ae78d){if(_0x50a498){if(_0x5f03c4&&_0x359169[_0xc4e9('0x17')]){_0x1c163e=_0xc4e9('0x17');}else if(_0x359169['routeId']){_0x1c163e=_0xc4e9('0x18');}else{console[_0xc4e9('0x19')](_0xc4e9('0x1a'),_0x359169);}}else{_0x1c163e='unmanaged';}switch(_0x4a72b7['data1'][_0xc4e9('0x15')]()){case _0xc4e9('0x9'):zendesk[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xa'):salesforce[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xb'):sugarcrm[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case'freshdesk':freshdesk[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xd'):zoho[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xe'):desk[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xf'):vtiger[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0x11'):freshsales['cs'](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f,_0x1c163e);break;case _0xc4e9('0x1b'):servicenow['cs'](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f,_0x1c163e);break;case _0xc4e9('0x10'):dynamics365['cs'](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f,_0x1c163e);break;default:console[_0xc4e9('0x19')]('unknown\x20integration');}}else{_0x335631=require('../../../../config/logger')(_0x4a72b7[_0xc4e9('0x14')][_0xc4e9('0x15')]());_0x335631[_0xc4e9('0x1c')]('[EXEC]',util[_0xc4e9('0x1d')](_0xc4e9('0x1e'),_0x4a72b7[_0xc4e9('0x14')][_0xc4e9('0x15')](),_0x4a72b7[_0xc4e9('0x1f')]));}}else{_0x335631=require(_0xc4e9('0x20'))(_0x4a72b7[_0xc4e9('0x14')][_0xc4e9('0x15')]());_0x335631['error']('[EXEC]',util[_0xc4e9('0x1d')](_0xc4e9('0x21'),_0x4a72b7['data1'][_0xc4e9('0x15')](),_0x4a72b7['data2']));}}else{}}catch(_0xcc6e4b){console[_0xc4e9('0x1c')](_0xcc6e4b);}}}}; \ 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 023e4bb..76013a0 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 _0x80e3=['WhatId','Case','ContactId','account','AccountId','lead','leadId','info','sobject','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','$or','Contact','length','cloneDeep','additionalSearchLead','merge','Lead','additionalSearchAccount','Account','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','create','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.','lodash','request-promise','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','localhost','redis','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','WhoId'];(function(_0x3e3527,_0x4f9564){var _0x1465cb=function(_0x16031d){while(--_0x16031d){_0x3e3527['push'](_0x3e3527['shift']());}};_0x1465cb(++_0x4f9564);}(_0x80e3,0x6d));var _0x380e=function(_0x4c217e,_0x1e462c){_0x4c217e=_0x4c217e-0x0;var _0x5a6811=_0x80e3[_0x4c217e];return _0x5a6811;};'use strict';var _=require(_0x380e('0x0'));var rp=require(_0x380e('0x1'));var moment=require('moment');var BPromise=require(_0x380e('0x2'));var md5=require('md5');var jsforce=require(_0x380e('0x3'));var util=require(_0x380e('0x4'));var Redis=require(_0x380e('0x5'));var intUtil=require(_0x380e('0x6'));var config=require(_0x380e('0x7'));var logger=require(_0x380e('0x8'))('salesforce');config['redis']=_['defaults'](config['redis'],{'host':_0x380e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x380e('0xa')]));function emit(_0xa520b8,_0x52fb38,_0x2a191c){io['to'](_0xa520b8)['emit'](_0x52fb38,_0x2a191c);}function getTicket(_0x447df8,_0x3a425a,_0x177323,_0x3a125c,_0x3fb10b,_0x2ceb87,_0xac5735,_0x4d3ab8){var _0x59d8e5=Object['assign']({},{'OwnerId':_0x3a425a['id'],'Subject':intUtil[_0x380e('0xb')](_0x3a125c['Subjects'],_0x3fb10b,'\x20'),'Description':intUtil[_0x380e('0xb')](_0x3a125c[_0x380e('0xc')],_0x3fb10b,'\x0a')},getCustomFields(_0x2ceb87,_0x3fb10b));if(_0x177323){if(_0x3a125c[_0x380e('0xd')]===_0x380e('0xe')){_0x59d8e5[_0x380e('0xf')]=moment[_0x380e('0x10')]();_0x59d8e5['IsReminderSet']=![];_0x59d8e5[_0x380e('0x11')]=![];if(_0x177323[_0x380e('0x12')]===_0x380e('0x13')||_0x177323[_0x380e('0x12')]==='lead'){_0x59d8e5[_0x380e('0x14')]=_0x177323['id'];}else if(_0x177323[_0x380e('0x12')]==='account'){_0x59d8e5[_0x380e('0x15')]=_0x177323['id'];}}else if(_0x3a125c[_0x380e('0xd')]===_0x380e('0x16')){if(_0x177323[_0x380e('0x12')]===_0x380e('0x13')){_0x59d8e5[_0x380e('0x17')]=_0x177323['id'];}else if(_0x177323[_0x380e('0x12')]===_0x380e('0x18')){_0x59d8e5[_0x380e('0x19')]=_0x177323['id'];}else if(_0x177323[_0x380e('0x12')]===_0x380e('0x1a')&&_0x3a125c[_0x380e('0x1b')]){_0x59d8e5[_0x3a125c[_0x380e('0x1b')]]=_0x177323['id'];}else{logger[_0x380e('0x1c')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0xac5735[_0x380e('0x1d')](_0x3a125c[_0x380e('0xd')])['create'](_0x59d8e5);}function getUser(_0x36f339,_0x174de8,_0x3c2ecd){if(!_['isNil'](_0x174de8)&&intUtil[_0x380e('0x1e')](_0x174de8)){var _0x46fdfb={'Email':_0x174de8};var _0x557e33={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3c2ecd[_0x380e('0x1d')](_0x380e('0x1f'))[_0x380e('0x20')](_0x46fdfb,_0x557e33)[_0x380e('0x21')]()[_0x380e('0x22')](function(_0x3778ea){if(_0x3778ea['length']){var _0x296db7=_[_0x380e('0x20')](_0x3778ea,function(_0x22dc50){return _0x22dc50[_0x380e('0x23')]===_0x174de8;});if(_0x296db7){logger['info'](_0x380e('0x24'),_0x174de8);return BPromise[_0x380e('0x25')]({'id':_0x296db7['Id'],'name':_0x296db7[_0x380e('0x26')]});}}else{logger[_0x380e('0x1c')](_0x380e('0x27'),_0x174de8);return _0x3c2ecd[_0x380e('0x28')]()[_0x380e('0x22')](function(_0xf5515a){return BPromise['resolve']({'id':_0xf5515a[_0x380e('0x29')],'name':_0xf5515a['display_name']});});}});}else{logger[_0x380e('0x1c')](_0x380e('0x27'),_0x174de8);return _0x3c2ecd[_0x380e('0x28')]()[_0x380e('0x22')](function(_0x5980ad){return BPromise[_0x380e('0x25')]({'id':_0x5980ad[_0x380e('0x29')],'name':_0x5980ad['display_name']});});}}function getEndUser(_0x3bada9,_0x430b2c,_0x5e9fc5,_0x385817,_0x126399){var _0xd57920={'$or':{'Phone':_0x385817}};var _0x44680e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x380e('0x25')]()['then'](function(){logger['info'](_0x380e('0x2a'),_0x385817,_0x430b2c[_0x380e('0x2b')]);switch(_0x430b2c[_0x380e('0x2b')]){case _0x380e('0x2c'):var _0x57414c=_['cloneDeep'](_0xd57920);if(_0x430b2c['additionalSearchContact']){var _0x521b50={};_0x521b50[_0x430b2c[_0x380e('0x2d')]]=_0x385817;_['merge'](_0x57414c[_0x380e('0x2e')],_0x521b50);}return _0x126399[_0x380e('0x1d')](_0x380e('0x2f'))['find'](_0x57414c,_0x44680e)[_0x380e('0x21')]()['then'](function(_0x32bd0e){if(_0x32bd0e&&_0x32bd0e[_0x380e('0x30')]){return _0x32bd0e;}else{var _0x4b97c3=_[_0x380e('0x31')](_0xd57920);if(_0x430b2c[_0x380e('0x32')]){var _0x3f8684={};_0x3f8684[_0x430b2c[_0x380e('0x32')]]=_0x385817;_[_0x380e('0x33')](_0x4b97c3[_0x380e('0x2e')],_0x3f8684);}return _0x126399['sobject'](_0x380e('0x34'))['find'](_0x4b97c3,_0x44680e);}});case'account_contact_lead':var _0x37c40c=_[_0x380e('0x31')](_0xd57920);if(_0x430b2c[_0x380e('0x35')]){var _0x521b50={};_0x521b50[_0x430b2c[_0x380e('0x35')]]=_0x385817;_[_0x380e('0x33')](_0x37c40c[_0x380e('0x2e')],_0x521b50);}return _0x126399['sobject']('Account')[_0x380e('0x20')](_0x37c40c,_0x44680e)['execute']()['then'](function(_0x12f70b){if(_0x12f70b&&_0x12f70b['length']){return _0x12f70b;}else{var _0x4f2730=_[_0x380e('0x31')](_0xd57920);if(_0x430b2c[_0x380e('0x2d')]){var _0x5aa02c={};_0x5aa02c[_0x430b2c[_0x380e('0x2d')]]=_0x385817;_[_0x380e('0x33')](_0x4f2730[_0x380e('0x2e')],_0x5aa02c);}return _0x126399[_0x380e('0x1d')]('Contact')[_0x380e('0x20')](_0x4f2730,_0x44680e)[_0x380e('0x22')](function(_0x2fa032){if(_0x2fa032&&_0x2fa032['length']){return _0x2fa032;}else{var _0x166798=_[_0x380e('0x31')](_0xd57920);if(_0x430b2c['additionalSearchLead']){var _0x245971={};_0x245971[_0x430b2c[_0x380e('0x32')]]=_0x385817;_[_0x380e('0x33')](_0x166798[_0x380e('0x2e')],_0x245971);}return _0x126399[_0x380e('0x1d')](_0x380e('0x34'))['find'](_0x166798,_0x44680e);}});}});case'contact':var _0x57414c=_[_0x380e('0x31')](_0xd57920);if(_0x430b2c[_0x380e('0x2d')]){var _0x521b50={};_0x521b50[_0x430b2c[_0x380e('0x2d')]]=_0x385817;_['merge'](_0x57414c[_0x380e('0x2e')],_0x521b50);}return _0x126399[_0x380e('0x1d')]('Contact')[_0x380e('0x20')](_0x57414c,_0x44680e)[_0x380e('0x21')]();case _0x380e('0x1a'):var _0x23fd49=_['cloneDeep'](_0xd57920);if(_0x430b2c[_0x380e('0x32')]){var _0x521b50={};_0x521b50[_0x430b2c[_0x380e('0x32')]]=_0x385817;_[_0x380e('0x33')](_0x23fd49[_0x380e('0x2e')],_0x521b50);}return _0x126399[_0x380e('0x1d')]('Lead')[_0x380e('0x20')](_0x23fd49,_0x44680e);case _0x380e('0x18'):var _0x37c40c=_[_0x380e('0x31')](_0xd57920);if(_0x430b2c[_0x380e('0x35')]){var _0x521b50={};_0x521b50[_0x430b2c[_0x380e('0x35')]]=_0x385817;_['merge'](_0x37c40c['$or'],_0x521b50);}return _0x126399[_0x380e('0x1d')](_0x380e('0x36'))[_0x380e('0x20')](_0x37c40c,_0x44680e);default:return null;}})['then'](function(_0x4495e4){if(_0x4495e4&&_0x4495e4[_0x380e('0x30')]){var _0x799407=_[_0x380e('0x37')](_0x4495e4);if(_0x799407){return BPromise[_0x380e('0x25')]({'id':_0x799407['Id'],'name':_0x799407['Name'],'phone':_0x799407[_0x380e('0x38')],'endUserType':_0x799407[_0x380e('0x39')][_0x380e('0x3a')]['toLowerCase']()});}}})[_0x380e('0x22')](function(_0x2b318a){if(_0x2b318a){logger['info'](_0x380e('0x3b'),_0x2b318a['endUserType'],_0x385817);return BPromise[_0x380e('0x25')](_0x2b318a);}else{logger[_0x380e('0x1c')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x385817);var _0x3a1797={'Phone':_0x385817};if(_0x430b2c[_0x380e('0x3c')]){if(_0x430b2c[_0x380e('0x3c')]===_0x380e('0x13')){logger['info'](_0x380e('0x3d'),_0x385817,_0x430b2c[_0x380e('0x3c')]);_0x3a1797[_0x380e('0x3e')]=_0x5e9fc5!==_0x380e('0x3f')?_0x5e9fc5:util[_0x380e('0x40')](_0x380e('0x41'),_0x385817);}else if(_0x430b2c[_0x380e('0x3c')]===_0x380e('0x1a')){logger['info'](_0x380e('0x3d'),_0x385817,_0x430b2c[_0x380e('0x3c')]);_0x3a1797['LastName']=_0x5e9fc5!==_0x380e('0x3f')?_0x5e9fc5:util[_0x380e('0x40')](_0x380e('0x41'),_0x385817);_0x3a1797[_0x380e('0x42')]=_0x380e('0x43');}else if(_0x430b2c['moduleCreate']===_0x380e('0x18')){logger[_0x380e('0x1c')](_0x380e('0x3d'),_0x385817,_0x430b2c[_0x380e('0x3c')]);_0x3a1797['Name']=_0x5e9fc5!==_0x380e('0x3f')?_0x5e9fc5:util['format'](_0x380e('0x41'),_0x385817);}else{return null;}}return _0x126399['sobject'](_[_0x380e('0x44')](_0x430b2c[_0x380e('0x3c')]))[_0x380e('0x45')](_0x3a1797)['then'](function(_0x5756e0){return BPromise[_0x380e('0x25')]({'id':_0x5756e0['id'],'endUserType':_0x430b2c['moduleCreate']});});}});}function getCustomFields(_0x4ea5d0,_0x106d6c){var _0x58e75c={};if(_0x4ea5d0[_0x380e('0x30')]>0x0){_[_0x380e('0x46')](_0x4ea5d0,function(_0x20e0f3){if(_[_0x380e('0x47')]([_0x380e('0x48'),_0x380e('0x49')],_0x20e0f3[_0x380e('0x3a')])&&_0x20e0f3[_0x380e('0x4a')]){_0x58e75c[_0x20e0f3[_0x380e('0x4a')]]=_0x20e0f3[_0x380e('0x4b')][_0x380e('0x4c')]();}else if(_0x20e0f3['type']===_0x380e('0x4d')&&_0x20e0f3['variableName']&&_0x20e0f3[_0x380e('0x4a')]){_0x106d6c[_0x20e0f3[_0x380e('0x4e')]]&&(_0x58e75c[_0x20e0f3[_0x380e('0x4a')]]=_0x106d6c[_0x20e0f3[_0x380e('0x4e')]][_0x380e('0x4c')]());}else if(_0x20e0f3[_0x380e('0x3a')]===_0x380e('0x4f')&&_0x20e0f3['Variable']&&_0x20e0f3[_0x380e('0x50')][_0x380e('0x51')]&&_0x20e0f3[_0x380e('0x4a')]){_0x106d6c[_0x20e0f3[_0x380e('0x50')][_0x380e('0x51')][_0x380e('0x52')]()]&&(_0x58e75c[_0x20e0f3['idField']]=_0x106d6c[_0x20e0f3[_0x380e('0x50')][_0x380e('0x51')][_0x380e('0x52')]()][_0x380e('0x4c')]());}});}return _0x58e75c;}function getConnection(_0x351e1a){var _0x3e1e80=_0x351e1a[_0x380e('0x53')]['concat'](_0x351e1a[_0x380e('0x54')]);var _0x27435b=new jsforce[(_0x380e('0x55'))]({'oauth2':{'loginUrl':_0x351e1a[_0x380e('0x56')]||_0x380e('0x57'),'clientId':_0x351e1a[_0x380e('0x58')],'clientSecret':_0x351e1a[_0x380e('0x59')]}});return _0x27435b[_0x380e('0x5a')](_0x351e1a[_0x380e('0x5b')],_0x3e1e80)[_0x380e('0x22')](function(){logger['info'](_0x380e('0x5c'));return _0x27435b;});}exports[_0x380e('0x5d')]=function(_0xeda755,_0x116d85,_0x3182f6,_0x1b88ae,_0x2ce1d8,_0x56331a){var _0x9591bd,_0xbe7509,_0x491ef1,_0x4f6ff1;_0x56331a[_0x380e('0x5e')]=intUtil[_0x380e('0x5f')](_0x56331a[_0x380e('0x5e')]);_0x56331a[_0x380e('0x56')]=intUtil['stripTrailingSlash'](_0x56331a[_0x380e('0x56')]);if(_0x2ce1d8&&_0x2ce1d8[_0x380e('0x60')]){logger[_0x380e('0x1c')]('[QUEUE]',_0x380e('0x61'));_0x116d85[_0x380e('0x62')]=util[_0x380e('0x40')](_0x380e('0x63'),_0x56331a[_0x380e('0x5e')],_0x116d85[_0x380e('0x64')],md5(_0x116d85[_0x380e('0x64')]));}else{_0x116d85[_0x380e('0x62')]='';}return getConnection(_0x56331a)[_0x380e('0x22')](function(_0x55954f){_0x4f6ff1=_0x55954f;return getUser(_0x56331a,_0x1b88ae[_0x380e('0x65')],_0x4f6ff1);})[_0x380e('0x22')](function(_0x13a2f1){_0x9591bd=_0x13a2f1;return getEndUser(_0x56331a,_0x3182f6,_0x116d85[_0x380e('0x66')],_0x116d85[_0x380e('0x67')],_0x4f6ff1);})[_0x380e('0x22')](function(_0x7ac824){_0xbe7509=_0x7ac824;return getTicket(_0x56331a,_0x9591bd,_0xbe7509,_0x3182f6,_0x116d85,_0x3182f6[_0x380e('0x68')],_0x4f6ff1,_0x380e('0x5d'));})[_0x380e('0x22')](function(_0x152652){_0x491ef1=_0x152652;logger[_0x380e('0x1c')](_0x380e('0x69'),_0x491ef1['id']);logger[_0x380e('0x1c')](_0x380e('0x6a'),_0x491ef1['id'],_0x1b88ae['name'],_0x56331a['type']);switch(_0x56331a[_0x380e('0x3a')]){case'integrationTab':emit(util[_0x380e('0x40')](_0x380e('0x6b'),_0x1b88ae[_0x380e('0x51')]),_0x380e('0x6c'),{'recordId':_0x491ef1['id']});break;case _0x380e('0x6d'):emit(util[_0x380e('0x40')](_0x380e('0x6b'),_0x1b88ae[_0x380e('0x51')]),_0x380e('0x6e'),{'uri':util['format'](_0x380e('0x6f'),_0x4f6ff1[_0x380e('0x70')],_0x491ef1['id'])});break;default:logger[_0x380e('0x71')](_0x380e('0x72'));}})[_0x380e('0x73')](function(_0x19a4ff){logger[_0x380e('0x71')](_0x380e('0x74'),_0x19a4ff);});};exports[_0x380e('0x75')]=function(_0x36c071,_0x1ca27c,_0xc01ec0,_0x536476,_0x4d5406,_0x227313,_0x2c355d){var _0x35f0ff,_0x3ce274,_0x3d5afa,_0x21a742;_0x227313[_0x380e('0x5e')]=intUtil[_0x380e('0x5f')](_0x227313[_0x380e('0x5e')]);_0x227313['remoteUri']=intUtil[_0x380e('0x5f')](_0x227313[_0x380e('0x56')]);if(_0x2c355d&&_0x2c355d[_0x380e('0x76')]&&_0x2c355d[_0x380e('0x76')]!==_0x380e('0x77')){logger[_0x380e('0x1c')](_0x380e('0x78'),'Recording\x20is\x20enabled!');_0x1ca27c[_0x380e('0x62')]=util[_0x380e('0x40')](_0x380e('0x63'),_0x227313[_0x380e('0x5e')],_0x1ca27c[_0x380e('0x64')],md5(_0x1ca27c['uniqueid']));}return getConnection(_0x227313)[_0x380e('0x22')](function(_0x140cde){_0x21a742=_0x140cde;return getUser(_0x227313,_0x536476[_0x380e('0x65')],_0x21a742);})[_0x380e('0x22')](function(_0x122ba1){_0x35f0ff=_0x122ba1;return getEndUser(_0x227313,_0xc01ec0,_0x1ca27c[_0x380e('0x79')],_0x1ca27c['destcalleridnum'],_0x21a742);})[_0x380e('0x22')](function(_0xac7281){_0x3ce274=_0xac7281;return getTicket(_0x227313,_0x35f0ff,_0x3ce274,_0xc01ec0,_0x1ca27c,_0xc01ec0['Fields'],_0x21a742,_0x380e('0x75'));})['then'](function(_0xb3d0d){_0x3d5afa=_0xb3d0d;logger['info'](_0x380e('0x7a'),_0x3d5afa['id']);logger[_0x380e('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3d5afa['id'],_0x536476[_0x380e('0x51')],_0x227313[_0x380e('0x3a')]);switch(_0x227313[_0x380e('0x3a')]){case _0x380e('0x7b'):emit(util[_0x380e('0x40')]('user:%s',_0x536476[_0x380e('0x51')]),_0x380e('0x6c'),{'recordId':_0x3d5afa['id']});break;case _0x380e('0x6d'):emit(util[_0x380e('0x40')]('user:%s',_0x536476['name']),_0x380e('0x6e'),{'uri':util['format'](_0x380e('0x6f'),_0x21a742[_0x380e('0x70')],_0x3d5afa['id'])});break;default:logger['error'](_0x380e('0x78'),_0x380e('0x7c'));}})[_0x380e('0x73')](function(_0x43c8a1){logger['error']('[OUTBOUND]',_0x43c8a1);});};exports[_0x380e('0x7d')]=function(_0x4c778e,_0x2cfa3f,_0x4ebd9c,_0x553f5c,_0x3dc6a3,_0x59ff77){var _0x4abf36,_0x1c1ea0,_0x217376,_0x3fd53;_0x59ff77[_0x380e('0x5e')]=intUtil['stripTrailingSlash'](_0x59ff77[_0x380e('0x5e')]);_0x59ff77[_0x380e('0x56')]=intUtil['stripTrailingSlash'](_0x59ff77[_0x380e('0x56')]);if(_0x3dc6a3&&_0x3dc6a3['monitor_format']){logger[_0x380e('0x1c')]('['+_0x2cfa3f[_0x380e('0x7e')][_0x380e('0x7f')]()+']',_0x380e('0x61'));_0x2cfa3f[_0x380e('0x62')]=util['format'](_0x380e('0x63'),_0x59ff77[_0x380e('0x5e')],_0x2cfa3f[_0x380e('0x64')],md5(_0x2cfa3f['uniqueid']));}else{_0x2cfa3f[_0x380e('0x62')]='';}return getConnection(_0x59ff77)[_0x380e('0x22')](function(_0x368ddf){_0x3fd53=_0x368ddf;if(!_[_0x380e('0x80')](_0x553f5c)){return getUser(_0x59ff77,_0x553f5c[_0x380e('0x51')],_0x3fd53);}else{return getUser(_0x59ff77,null,_0x3fd53);}})[_0x380e('0x22')](function(_0x240cf){_0x4abf36=_0x240cf;return getEndUser(_0x59ff77,_0x4ebd9c,_0x2cfa3f['calleridname'],_0x2cfa3f[_0x380e('0x67')],_0x3fd53);})[_0x380e('0x22')](function(_0xa576b1){_0x1c1ea0=_0xa576b1;return getTicket(_0x59ff77,_0x4abf36,_0x1c1ea0,_0x4ebd9c,_0x2cfa3f,_0x4ebd9c[_0x380e('0x68')],_0x3fd53);})[_0x380e('0x22')](function(_0x3b18ac){_0x217376=_0x3b18ac;logger[_0x380e('0x1c')]('['+_0x2cfa3f[_0x380e('0x7e')][_0x380e('0x7f')]()+_0x380e('0x81'),_0x217376['id']);logger['info']('['+_0x2cfa3f[_0x380e('0x7e')][_0x380e('0x7f')]()+']\x20Integration\x20account\x20type\x20%s.',_0x59ff77['type']);})[_0x380e('0x73')](function(_0x5ae3f0){logger['error']('['+_0x2cfa3f[_0x380e('0x7e')][_0x380e('0x7f')]()+']',_0x5ae3f0);});}; \ No newline at end of file +var _0xf774=['moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','string','idField','content','toString','variable','variableName','customVariable','Variable','name','password','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','queue','serverUrl','stripTrailingSlash','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','recordingFormat','none','[OUTBOUND]','email','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','isNil','calleridnum','lodash','moment','md5','util','ioredis','./util','salesforce','redis','localhost','socket.io-emitter','assign','getString','Subjects','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','then','length','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name'];(function(_0x1b9702,_0xf09368){var _0x1282ac=function(_0x396019){while(--_0x396019){_0x1b9702['push'](_0x1b9702['shift']());}};_0x1282ac(++_0xf09368);}(_0xf774,0x1b2));var _0x4f77=function(_0x3176ce,_0x465c1c){_0x3176ce=_0x3176ce-0x0;var _0x4649ba=_0xf774[_0x3176ce];return _0x4649ba;};'use strict';var _=require(_0x4f77('0x0'));var rp=require('request-promise');var moment=require(_0x4f77('0x1'));var BPromise=require('bluebird');var md5=require(_0x4f77('0x2'));var jsforce=require('jsforce');var util=require(_0x4f77('0x3'));var Redis=require(_0x4f77('0x4'));var intUtil=require(_0x4f77('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x4f77('0x6'));config[_0x4f77('0x7')]=_['defaults'](config['redis'],{'host':_0x4f77('0x8'),'port':0x18eb});var io=require(_0x4f77('0x9'))(new Redis(config[_0x4f77('0x7')]));function emit(_0x3b489c,_0x5209dd,_0x1bed87){io['to'](_0x3b489c)['emit'](_0x5209dd,_0x1bed87);}function getTicket(_0x223f5c,_0x31e1f8,_0x5f2359,_0x4d07e0,_0x5b6b63,_0x5ae88d,_0x4afde9,_0x56cbe1){var _0x45da3f=Object[_0x4f77('0xa')]({},{'OwnerId':_0x31e1f8['id'],'Subject':intUtil[_0x4f77('0xb')](_0x4d07e0[_0x4f77('0xc')],_0x5b6b63,'\x20'),'Description':intUtil['getString'](_0x4d07e0['Descriptions'],_0x5b6b63,'\x0a')},getCustomFields(_0x5ae88d,_0x5b6b63));if(_0x5f2359){if(_0x4d07e0[_0x4f77('0xd')]===_0x4f77('0xe')){_0x45da3f['ActivityDate']=moment[_0x4f77('0xf')]();_0x45da3f[_0x4f77('0x10')]=![];_0x45da3f[_0x4f77('0x11')]=![];if(_0x5f2359[_0x4f77('0x12')]===_0x4f77('0x13')||_0x5f2359[_0x4f77('0x12')]===_0x4f77('0x14')){_0x45da3f['WhoId']=_0x5f2359['id'];}else if(_0x5f2359[_0x4f77('0x12')]===_0x4f77('0x15')){_0x45da3f['WhatId']=_0x5f2359['id'];}}else if(_0x4d07e0['ticketType']==='Case'){if(_0x5f2359[_0x4f77('0x12')]===_0x4f77('0x13')){_0x45da3f[_0x4f77('0x16')]=_0x5f2359['id'];}else if(_0x5f2359['endUserType']===_0x4f77('0x15')){_0x45da3f[_0x4f77('0x17')]=_0x5f2359['id'];}else if(_0x5f2359['endUserType']===_0x4f77('0x14')&&_0x4d07e0[_0x4f77('0x18')]){_0x45da3f[_0x4d07e0[_0x4f77('0x18')]]=_0x5f2359['id'];}else{logger['info'](_0x4f77('0x19'));}}}return _0x4afde9[_0x4f77('0x1a')](_0x4d07e0[_0x4f77('0xd')])[_0x4f77('0x1b')](_0x45da3f);}function getUser(_0x344e5a,_0x15d72c,_0xd1b6d9){if(!_['isNil'](_0x15d72c)&&intUtil[_0x4f77('0x1c')](_0x15d72c)){var _0x179577={'Email':_0x15d72c};var _0x3b0bc1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xd1b6d9[_0x4f77('0x1a')](_0x4f77('0x1d'))[_0x4f77('0x1e')](_0x179577,_0x3b0bc1)[_0x4f77('0x1f')]()[_0x4f77('0x20')](function(_0x188215){if(_0x188215[_0x4f77('0x21')]){var _0x26600f=_[_0x4f77('0x1e')](_0x188215,function(_0x2440ff){return _0x2440ff['Email']===_0x15d72c;});if(_0x26600f){logger[_0x4f77('0x22')](_0x4f77('0x23'),_0x15d72c);return BPromise[_0x4f77('0x24')]({'id':_0x26600f['Id'],'name':_0x26600f[_0x4f77('0x25')]});}}else{logger[_0x4f77('0x22')](_0x4f77('0x26'),_0x15d72c);return _0xd1b6d9[_0x4f77('0x27')]()[_0x4f77('0x20')](function(_0x24608c){return BPromise[_0x4f77('0x24')]({'id':_0x24608c[_0x4f77('0x28')],'name':_0x24608c[_0x4f77('0x29')]});});}});}else{logger[_0x4f77('0x22')](_0x4f77('0x26'),_0x15d72c);return _0xd1b6d9[_0x4f77('0x27')]()[_0x4f77('0x20')](function(_0x22a53a){return BPromise[_0x4f77('0x24')]({'id':_0x22a53a[_0x4f77('0x28')],'name':_0x22a53a['display_name']});});}}function getEndUser(_0x3a4efc,_0x2604f7,_0x3c56eb,_0x29fcd7,_0x2df8f1){var _0x263c84={'$or':{'Phone':_0x29fcd7}};var _0x55398b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x4f77('0x24')]()[_0x4f77('0x20')](function(){logger[_0x4f77('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x29fcd7,_0x2604f7[_0x4f77('0x2a')]);switch(_0x2604f7[_0x4f77('0x2a')]){case'contact_lead':var _0x89f4cd=_[_0x4f77('0x2b')](_0x263c84);if(_0x2604f7[_0x4f77('0x2c')]){var _0x1cdf29={};_0x1cdf29[_0x2604f7[_0x4f77('0x2c')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0x89f4cd[_0x4f77('0x2e')],_0x1cdf29);}return _0x2df8f1['sobject'](_0x4f77('0x2f'))['find'](_0x89f4cd,_0x55398b)[_0x4f77('0x1f')]()['then'](function(_0x39e49f){if(_0x39e49f&&_0x39e49f[_0x4f77('0x21')]){return _0x39e49f;}else{var _0x115dd7=_[_0x4f77('0x2b')](_0x263c84);if(_0x2604f7[_0x4f77('0x30')]){var _0x34c64b={};_0x34c64b[_0x2604f7[_0x4f77('0x30')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0x115dd7[_0x4f77('0x2e')],_0x34c64b);}return _0x2df8f1[_0x4f77('0x1a')](_0x4f77('0x31'))['find'](_0x115dd7,_0x55398b);}});case _0x4f77('0x32'):var _0x52b282=_['cloneDeep'](_0x263c84);if(_0x2604f7[_0x4f77('0x33')]){var _0x1cdf29={};_0x1cdf29[_0x2604f7['additionalSearchAccount']]=_0x29fcd7;_[_0x4f77('0x2d')](_0x52b282[_0x4f77('0x2e')],_0x1cdf29);}return _0x2df8f1[_0x4f77('0x1a')](_0x4f77('0x34'))[_0x4f77('0x1e')](_0x52b282,_0x55398b)[_0x4f77('0x1f')]()[_0x4f77('0x20')](function(_0x18eac4){if(_0x18eac4&&_0x18eac4[_0x4f77('0x21')]){return _0x18eac4;}else{var _0x273615=_['cloneDeep'](_0x263c84);if(_0x2604f7[_0x4f77('0x2c')]){var _0x4d6e65={};_0x4d6e65[_0x2604f7[_0x4f77('0x2c')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0x273615['$or'],_0x4d6e65);}return _0x2df8f1['sobject'](_0x4f77('0x2f'))[_0x4f77('0x1e')](_0x273615,_0x55398b)['then'](function(_0x3c708f){if(_0x3c708f&&_0x3c708f[_0x4f77('0x21')]){return _0x3c708f;}else{var _0x5a6c7e=_[_0x4f77('0x2b')](_0x263c84);if(_0x2604f7['additionalSearchLead']){var _0x59dd93={};_0x59dd93[_0x2604f7[_0x4f77('0x30')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0x5a6c7e[_0x4f77('0x2e')],_0x59dd93);}return _0x2df8f1['sobject'](_0x4f77('0x31'))[_0x4f77('0x1e')](_0x5a6c7e,_0x55398b);}});}});case _0x4f77('0x13'):var _0x89f4cd=_[_0x4f77('0x2b')](_0x263c84);if(_0x2604f7['additionalSearchContact']){var _0x1cdf29={};_0x1cdf29[_0x2604f7['additionalSearchContact']]=_0x29fcd7;_['merge'](_0x89f4cd['$or'],_0x1cdf29);}return _0x2df8f1[_0x4f77('0x1a')](_0x4f77('0x2f'))[_0x4f77('0x1e')](_0x89f4cd,_0x55398b)[_0x4f77('0x1f')]();case _0x4f77('0x14'):var _0xb9fbb9=_['cloneDeep'](_0x263c84);if(_0x2604f7[_0x4f77('0x30')]){var _0x1cdf29={};_0x1cdf29[_0x2604f7[_0x4f77('0x30')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0xb9fbb9['$or'],_0x1cdf29);}return _0x2df8f1['sobject'](_0x4f77('0x31'))[_0x4f77('0x1e')](_0xb9fbb9,_0x55398b);case _0x4f77('0x15'):var _0x52b282=_['cloneDeep'](_0x263c84);if(_0x2604f7['additionalSearchAccount']){var _0x1cdf29={};_0x1cdf29[_0x2604f7['additionalSearchAccount']]=_0x29fcd7;_['merge'](_0x52b282['$or'],_0x1cdf29);}return _0x2df8f1[_0x4f77('0x1a')]('Account')[_0x4f77('0x1e')](_0x52b282,_0x55398b);default:return null;}})[_0x4f77('0x20')](function(_0x3a927c){if(_0x3a927c&&_0x3a927c['length']){var _0x568315=_[_0x4f77('0x35')](_0x3a927c);if(_0x568315){return BPromise[_0x4f77('0x24')]({'id':_0x568315['Id'],'name':_0x568315[_0x4f77('0x25')],'phone':_0x568315[_0x4f77('0x36')],'endUserType':_0x568315['attributes'][_0x4f77('0x37')][_0x4f77('0x38')]()});}}})['then'](function(_0x2c99ac){if(_0x2c99ac){logger['info'](_0x4f77('0x39'),_0x2c99ac[_0x4f77('0x12')],_0x29fcd7);return BPromise[_0x4f77('0x24')](_0x2c99ac);}else{logger[_0x4f77('0x22')](_0x4f77('0x3a'),_0x29fcd7);var _0x26c605={'Phone':_0x29fcd7};if(_0x2604f7[_0x4f77('0x3b')]){if(_0x2604f7[_0x4f77('0x3b')]===_0x4f77('0x13')){logger[_0x4f77('0x22')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x29fcd7,_0x2604f7[_0x4f77('0x3b')]);_0x26c605[_0x4f77('0x3c')]=_0x3c56eb!==_0x4f77('0x3d')?_0x3c56eb:util[_0x4f77('0x3e')]('Caller\x20-\x20%s',_0x29fcd7);}else if(_0x2604f7[_0x4f77('0x3b')]===_0x4f77('0x14')){logger['info'](_0x4f77('0x3f'),_0x29fcd7,_0x2604f7['moduleCreate']);_0x26c605[_0x4f77('0x3c')]=_0x3c56eb!==_0x4f77('0x3d')?_0x3c56eb:util[_0x4f77('0x3e')](_0x4f77('0x40'),_0x29fcd7);_0x26c605[_0x4f77('0x41')]=_0x4f77('0x42');}else if(_0x2604f7['moduleCreate']===_0x4f77('0x15')){logger['info'](_0x4f77('0x3f'),_0x29fcd7,_0x2604f7[_0x4f77('0x3b')]);_0x26c605[_0x4f77('0x25')]=_0x3c56eb!==_0x4f77('0x3d')?_0x3c56eb:util[_0x4f77('0x3e')](_0x4f77('0x40'),_0x29fcd7);}else{return null;}}return _0x2df8f1[_0x4f77('0x1a')](_[_0x4f77('0x43')](_0x2604f7[_0x4f77('0x3b')]))[_0x4f77('0x1b')](_0x26c605)[_0x4f77('0x20')](function(_0x8034b){return BPromise['resolve']({'id':_0x8034b['id'],'endUserType':_0x2604f7[_0x4f77('0x3b')]});});}});}function getCustomFields(_0x4014ba,_0x26f374){var _0x5962ae={};if(_0x4014ba[_0x4f77('0x21')]>0x0){_['forEach'](_0x4014ba,function(_0x2b5c60){if(_['includes']([_0x4f77('0x44'),'picklist'],_0x2b5c60[_0x4f77('0x37')])&&_0x2b5c60[_0x4f77('0x45')]){_0x5962ae[_0x2b5c60[_0x4f77('0x45')]]=_0x2b5c60[_0x4f77('0x46')][_0x4f77('0x47')]();}else if(_0x2b5c60[_0x4f77('0x37')]===_0x4f77('0x48')&&_0x2b5c60[_0x4f77('0x49')]&&_0x2b5c60[_0x4f77('0x45')]){_0x26f374[_0x2b5c60['variableName']]&&(_0x5962ae[_0x2b5c60[_0x4f77('0x45')]]=_0x26f374[_0x2b5c60[_0x4f77('0x49')]][_0x4f77('0x47')]());}else if(_0x2b5c60['type']===_0x4f77('0x4a')&&_0x2b5c60[_0x4f77('0x4b')]&&_0x2b5c60[_0x4f77('0x4b')][_0x4f77('0x4c')]&&_0x2b5c60[_0x4f77('0x45')]){_0x26f374[_0x2b5c60[_0x4f77('0x4b')][_0x4f77('0x4c')]['toLowerCase']()]&&(_0x5962ae[_0x2b5c60[_0x4f77('0x45')]]=_0x26f374[_0x2b5c60['Variable'][_0x4f77('0x4c')][_0x4f77('0x38')]()][_0x4f77('0x47')]());}});}return _0x5962ae;}function getConnection(_0x5b31eb){var _0x49470a=_0x5b31eb[_0x4f77('0x4d')]['concat'](_0x5b31eb[_0x4f77('0x4e')]);var _0x1f41bd=new jsforce[(_0x4f77('0x4f'))]({'oauth2':{'loginUrl':_0x5b31eb['remoteUri']||_0x4f77('0x50'),'clientId':_0x5b31eb[_0x4f77('0x51')],'clientSecret':_0x5b31eb[_0x4f77('0x52')]}});return _0x1f41bd[_0x4f77('0x53')](_0x5b31eb['username'],_0x49470a)[_0x4f77('0x20')](function(){logger[_0x4f77('0x22')]('Connection\x20established.');return _0x1f41bd;});}exports[_0x4f77('0x54')]=function(_0xd2c89b,_0x2394a5,_0x4f385f,_0x52c000,_0x2167ce,_0x188c18){var _0x5de4f9,_0x52b664,_0x3125b2,_0x4eb9f4;_0x188c18[_0x4f77('0x55')]=intUtil[_0x4f77('0x56')](_0x188c18[_0x4f77('0x55')]);_0x188c18[_0x4f77('0x57')]=intUtil['stripTrailingSlash'](_0x188c18[_0x4f77('0x57')]);if(_0x2167ce&&_0x2167ce['monitor_format']){logger['info'](_0x4f77('0x58'),_0x4f77('0x59'));_0x2394a5[_0x4f77('0x5a')]=util[_0x4f77('0x3e')](_0x4f77('0x5b'),_0x188c18[_0x4f77('0x55')],_0x2394a5['uniqueid'],md5(_0x2394a5[_0x4f77('0x5c')]));}else{_0x2394a5[_0x4f77('0x5a')]='';}return getConnection(_0x188c18)['then'](function(_0x432a7c){_0x4eb9f4=_0x432a7c;return getUser(_0x188c18,_0x52c000['email'],_0x4eb9f4);})[_0x4f77('0x20')](function(_0x13184f){_0x5de4f9=_0x13184f;return getEndUser(_0x188c18,_0x4f385f,_0x2394a5[_0x4f77('0x5d')],_0x2394a5['calleridnum'],_0x4eb9f4);})[_0x4f77('0x20')](function(_0x54de24){_0x52b664=_0x54de24;return getTicket(_0x188c18,_0x5de4f9,_0x52b664,_0x4f385f,_0x2394a5,_0x4f385f[_0x4f77('0x5e')],_0x4eb9f4,_0x4f77('0x54'));})[_0x4f77('0x20')](function(_0x2d71e6){_0x3125b2=_0x2d71e6;logger[_0x4f77('0x22')](_0x4f77('0x5f'),_0x3125b2['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3125b2['id'],_0x52c000[_0x4f77('0x4c')],_0x188c18[_0x4f77('0x37')]);switch(_0x188c18[_0x4f77('0x37')]){case _0x4f77('0x60'):emit(util[_0x4f77('0x3e')](_0x4f77('0x61'),_0x52c000[_0x4f77('0x4c')]),_0x4f77('0x62'),{'recordId':_0x3125b2['id']});break;case _0x4f77('0x63'):emit(util[_0x4f77('0x3e')](_0x4f77('0x61'),_0x52c000['name']),_0x4f77('0x64'),{'uri':util[_0x4f77('0x3e')](_0x4f77('0x65'),_0x4eb9f4[_0x4f77('0x66')],_0x3125b2['id'])});break;default:logger[_0x4f77('0x67')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x4f77('0x68')](function(_0x2f5270){logger[_0x4f77('0x67')](_0x4f77('0x58'),_0x2f5270);});};exports['outbound']=function(_0xadb4fc,_0x9bd366,_0x492872,_0x2ce1ff,_0x5e26d4,_0x1e5069,_0x4afbc9){var _0x503096,_0x53bf70,_0x2534cd,_0x5e0229;_0x1e5069[_0x4f77('0x55')]=intUtil[_0x4f77('0x56')](_0x1e5069[_0x4f77('0x55')]);_0x1e5069['remoteUri']=intUtil[_0x4f77('0x56')](_0x1e5069[_0x4f77('0x57')]);if(_0x4afbc9&&_0x4afbc9[_0x4f77('0x69')]&&_0x4afbc9[_0x4f77('0x69')]!==_0x4f77('0x6a')){logger[_0x4f77('0x22')](_0x4f77('0x6b'),_0x4f77('0x59'));_0x9bd366[_0x4f77('0x5a')]=util[_0x4f77('0x3e')](_0x4f77('0x5b'),_0x1e5069['serverUrl'],_0x9bd366['uniqueid'],md5(_0x9bd366[_0x4f77('0x5c')]));}return getConnection(_0x1e5069)[_0x4f77('0x20')](function(_0x583a7e){_0x5e0229=_0x583a7e;return getUser(_0x1e5069,_0x2ce1ff[_0x4f77('0x6c')],_0x5e0229);})['then'](function(_0x193e25){_0x503096=_0x193e25;return getEndUser(_0x1e5069,_0x492872,_0x9bd366['destcalleridname'],_0x9bd366[_0x4f77('0x6d')],_0x5e0229);})['then'](function(_0x401193){_0x53bf70=_0x401193;return getTicket(_0x1e5069,_0x503096,_0x53bf70,_0x492872,_0x9bd366,_0x492872['Fields'],_0x5e0229,_0x4f77('0x6e'));})[_0x4f77('0x20')](function(_0x3531e1){_0x2534cd=_0x3531e1;logger[_0x4f77('0x22')](_0x4f77('0x6f'),_0x2534cd['id']);logger[_0x4f77('0x22')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2534cd['id'],_0x2ce1ff['name'],_0x1e5069[_0x4f77('0x37')]);switch(_0x1e5069[_0x4f77('0x37')]){case _0x4f77('0x60'):emit(util[_0x4f77('0x3e')](_0x4f77('0x61'),_0x2ce1ff['name']),_0x4f77('0x62'),{'recordId':_0x2534cd['id']});break;case _0x4f77('0x63'):emit(util[_0x4f77('0x3e')](_0x4f77('0x61'),_0x2ce1ff[_0x4f77('0x4c')]),_0x4f77('0x64'),{'uri':util[_0x4f77('0x3e')](_0x4f77('0x65'),_0x5e0229[_0x4f77('0x66')],_0x2534cd['id'])});break;default:logger[_0x4f77('0x67')]('[OUTBOUND]',_0x4f77('0x70'));}})['catch'](function(_0x3bf1af){logger['error'](_0x4f77('0x6b'),_0x3bf1af);});};exports[_0x4f77('0x71')]=function(_0xd0ae3e,_0x3c801a,_0x203670,_0x2fbc41,_0x1ba9e2,_0x5dd518){var _0x2e8939,_0x52dcba,_0xb45081,_0xdd0bd6;_0x5dd518[_0x4f77('0x55')]=intUtil[_0x4f77('0x56')](_0x5dd518[_0x4f77('0x55')]);_0x5dd518[_0x4f77('0x57')]=intUtil[_0x4f77('0x56')](_0x5dd518[_0x4f77('0x57')]);if(_0x1ba9e2&&_0x1ba9e2[_0x4f77('0x72')]){logger[_0x4f77('0x22')]('['+_0x3c801a[_0x4f77('0x73')][_0x4f77('0x74')]()+']',_0x4f77('0x59'));_0x3c801a[_0x4f77('0x5a')]=util[_0x4f77('0x3e')](_0x4f77('0x5b'),_0x5dd518[_0x4f77('0x55')],_0x3c801a[_0x4f77('0x5c')],md5(_0x3c801a[_0x4f77('0x5c')]));}else{_0x3c801a['recordingURL']='';}return getConnection(_0x5dd518)[_0x4f77('0x20')](function(_0x31b6a3){_0xdd0bd6=_0x31b6a3;if(!_[_0x4f77('0x75')](_0x2fbc41)){return getUser(_0x5dd518,_0x2fbc41[_0x4f77('0x4c')],_0xdd0bd6);}else{return getUser(_0x5dd518,null,_0xdd0bd6);}})[_0x4f77('0x20')](function(_0xb97925){_0x2e8939=_0xb97925;return getEndUser(_0x5dd518,_0x203670,_0x3c801a['calleridname'],_0x3c801a[_0x4f77('0x76')],_0xdd0bd6);})['then'](function(_0x251007){_0x52dcba=_0x251007;return getTicket(_0x5dd518,_0x2e8939,_0x52dcba,_0x203670,_0x3c801a,_0x203670['Fields'],_0xdd0bd6);})['then'](function(_0x26109a){_0xb45081=_0x26109a;logger[_0x4f77('0x22')]('['+_0x3c801a['lastevent']['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0xb45081['id']);logger[_0x4f77('0x22')]('['+_0x3c801a[_0x4f77('0x73')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x5dd518['type']);})['catch'](function(_0x29252a){logger[_0x4f77('0x67')]('['+_0x3c801a[_0x4f77('0x73')][_0x4f77('0x74')]()+']',_0x29252a);});}; \ 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 6b65db8..a6f8e9f 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 _0x9263=['queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','localhost','redis','GET','result','length','adminId','sys_id','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','info','],\x20getUser\x20input\x20crm','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','userId','userEmail','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','includes','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','forEach','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','isNil','email','calleridnum','callDirection'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x9263,0xdd));var _0x3926=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x9263[_0xac151d];return _0x111dba;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x3926('0x0'));var util=require(_0x3926('0x1'));var md5=require(_0x3926('0x2'));var Redis=require(_0x3926('0x3'));var intUtil=require('./util');var config=require(_0x3926('0x4'));var logger=require(_0x3926('0x5'))(_0x3926('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x3926('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3926('0x8')]));function getAdminUser(_0x46d175,_0x449df2,_0x11c2d3,_0x556e8c,_0x287b40,_0x1b2c5f){return new Promise(function(_0x341588,_0x2c9191){var _0xb5eadd={'method':_0x3926('0x9'),'uri':_0x556e8c+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x287b40+'&'+_0x1b2c5f,'auth':_0x449df2,'json':!![]};return rp(_0xb5eadd)['then'](function(_0x44d9ec){if(_0x44d9ec[_0x3926('0xa')][_0x3926('0xb')]>0x0){_0x11c2d3[_0x3926('0xc')]=_0x44d9ec[_0x3926('0xa')][0x0][_0x3926('0xd')];}logger['info']('['+[_0x46d175['toUpperCase']()]+_0x3926('0xe'),_0x11c2d3);_0x341588(_0x11c2d3);})[_0x3926('0xf')](function(_0x29a882){logger[_0x3926('0x10')]('['+[_0x46d175[_0x3926('0x11')]()]+']',_0x29a882[_0x3926('0x12')]);_0x2c9191(_0x29a882[_0x3926('0x12')]);});});}function getUser(_0x5eb352,_0x7c0597,_0x24894d,_0x12e02e,_0x373d6c){return function(_0x33fe4b){logger[_0x3926('0x13')]('['+[_0x5eb352['toUpperCase']()]+_0x3926('0x14'),_0x33fe4b);return new Promise(function(_0x245a16,_0x10027f){if(intUtil['validateEmail'](_0x33fe4b['userEmail'])){var _0xc2e817={'method':_0x3926('0x9'),'uri':_0x24894d+'sys_user?sysparm_query=email%3D'+_0x33fe4b['userEmail']+'&'+_0x12e02e+'&'+_0x373d6c,'auth':_0x7c0597,'json':!![]};logger['info']('['+[_0x5eb352[_0x3926('0x11')]()]+_0x3926('0x15'),_0xc2e817);return rp(_0xc2e817)[_0x3926('0x16')](function(_0x4fce){logger[_0x3926('0x13')]('['+[_0x5eb352[_0x3926('0x11')]()]+_0x3926('0x17'),_0x4fce);if(_0x4fce[_0x3926('0xa')][_0x3926('0xb')]>0x0&&String(_0x4fce['result'][0x0][_0x3926('0x18')])==='true'){_0x33fe4b[_0x3926('0x19')]=_0x4fce[_0x3926('0xa')][0x0][_0x3926('0xd')];}else{_0x33fe4b[_0x3926('0x19')]=_0x33fe4b[_0x3926('0xc')];_0x33fe4b[_0x3926('0x1a')]=_0x33fe4b[_0x3926('0x1b')];}logger[_0x3926('0x13')]('['+[_0x5eb352['toUpperCase']()]+_0x3926('0x1c'),_0x33fe4b);_0x245a16(_0x33fe4b);})[_0x3926('0xf')](function(_0x2dc738){logger['error']('['+[_0x5eb352['toUpperCase']()]+']',_0x2dc738[_0x3926('0x12')]);_0x10027f(_0x2dc738['message']);});}else{logger[_0x3926('0x13')]('['+[_0x5eb352[_0x3926('0x11')]()]+']\x20using\x20admin\x20profile');_0x33fe4b[_0x3926('0x19')]=_0x33fe4b[_0x3926('0xc')];_0x33fe4b[_0x3926('0x1a')]=_0x33fe4b['adminEmail'];_0x245a16(_0x33fe4b);}});};}function createEndUser(_0x14b873,_0x51412c,_0x10b42e,_0x12232e,_0x3867d0){logger[_0x3926('0x13')]('['+[_0x14b873[_0x3926('0x11')]()]+_0x3926('0x1d'),_0x10b42e);return new Promise(function(_0x334ffd,_0x3ed6ea){var _0x291d93={'method':_0x3926('0x1e'),'uri':_0x12232e+_0x3926('0x1f')+_0x3867d0,'body':{'user_name':_0x10b42e['endUserNumber'],'roles':_0x3926('0x20'),'first_name':_0x10b42e[_0x3926('0x21')],'active':_0x3926('0x22'),'date_format':'System','phone':_0x10b42e[_0x3926('0x21')]},'auth':_0x51412c,'json':!![]};return rp(_0x291d93)[_0x3926('0x16')](function(_0x406283){logger[_0x3926('0x13')]('['+[_0x14b873[_0x3926('0x11')]()]+_0x3926('0x23'),_0x406283[_0x3926('0xa')]);_0x10b42e[_0x3926('0x24')]=_0x406283[_0x3926('0xa')]['sys_id'];_0x334ffd(_0x10b42e);})['catch'](function(_0x17c0f9){logger[_0x3926('0x10')]('['+[_0x14b873[_0x3926('0x11')]()]+']',_0x17c0f9[_0x3926('0x12')]);_0x3ed6ea(_0x17c0f9[_0x3926('0x12')]);});});}function getEndUser(_0x4fd684,_0x39e25a,_0x203b3c,_0x5dcfbf,_0x1701c4){return function(_0x4c86bb){logger['info']('['+[_0x4fd684[_0x3926('0x11')]()]+_0x3926('0x25'),_0x4c86bb);return new Promise(function(_0x43eaaf,_0x282717){var _0x187f71={'method':_0x3926('0x9'),'uri':_0x203b3c+_0x3926('0x26')+_0x4c86bb[_0x3926('0x21')]+'&'+_0x5dcfbf+'&'+_0x1701c4,'auth':_0x39e25a,'json':!![]};return rp(_0x187f71)[_0x3926('0x16')](function(_0x53d16a){if(_0x53d16a[_0x3926('0xa')][_0x3926('0xb')]>0x0){_0x4c86bb[_0x3926('0x24')]=_0x53d16a[_0x3926('0xa')][0x0][_0x3926('0xd')];logger['info']('['+[_0x4fd684['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x4c86bb);_0x43eaaf(_0x4c86bb);}else{return createEndUser(_0x4fd684,_0x39e25a,_0x4c86bb,_0x203b3c,_0x5dcfbf)['then'](function(_0x262fa7){logger[_0x3926('0x13')]('['+[_0x4fd684[_0x3926('0x11')]()]+_0x3926('0x27'),_0x262fa7);_0x43eaaf(_0x262fa7);});}})[_0x3926('0xf')](function(_0x344d82){logger['error']('['+[_0x4fd684[_0x3926('0x11')]()]+']',_0x344d82['message']);_0x282717(_0x344d82['message']);});});};}function getCustomFields(_0x3c5102,_0x1db754){var _0x42b3ff={};if(_0x3c5102[_0x3926('0xb')]>0x0){_['forEach'](_0x3c5102,function(_0x383f26){if(_[_0x3926('0x28')](['string',_0x3926('0x29')],_0x383f26[_0x3926('0x2a')])&&_0x383f26[_0x3926('0x2b')]&&!_0x383f26[_0x3926('0x2c')]){_0x42b3ff[_0x383f26[_0x3926('0x2b')][_0x3926('0x2d')]()]=_0x383f26[_0x3926('0x2e')][_0x3926('0x2f')]();}else if(_['includes'](['string','picklist'],_0x383f26['type'])&&_0x383f26[_0x3926('0x30')]&&_0x383f26[_0x3926('0x2c')]){_0x42b3ff[_0x383f26[_0x3926('0x30')][_0x3926('0x2d')]()]=_0x383f26[_0x3926('0x2e')][_0x3926('0x2f')]();}else if(_0x383f26[_0x3926('0x2a')]===_0x3926('0x31')&&_0x383f26[_0x3926('0x32')]&&_0x383f26['idField']&&_0x383f26['customField']){_0x42b3ff[_0x383f26[_0x3926('0x30')][_0x3926('0x2d')]()]=_0x1db754[_0x383f26[_0x3926('0x32')]][_0x3926('0x2f')]();}else if(_0x383f26[_0x3926('0x2a')]===_0x3926('0x33')&&_0x383f26[_0x3926('0x34')]&&_0x383f26['Variable'][_0x3926('0x35')]&&_0x383f26[_0x3926('0x30')]&&_0x383f26[_0x3926('0x2c')]){_0x42b3ff[_0x383f26[_0x3926('0x30')][_0x3926('0x2d')]()]=_0x1db754[_0x383f26['Variable'][_0x3926('0x35')][_0x3926('0x2d')]()][_0x3926('0x2f')]();}});}return _0x42b3ff;}function getTicket(_0x140df8,_0x1de89d,_0x1d3a33,_0x15162c,_0x4482a2,_0x5ad751){return function(_0x59f9b2){logger[_0x3926('0x13')]('['+[_0x140df8['toUpperCase']()]+_0x3926('0x36'),_0x59f9b2);return new Promise(function(_0xde30eb,_0x4d94e5){var _0x23844e=_0x140df8[_0x3926('0x2d')]()===_0x3926('0x37')?_0x59f9b2[_0x3926('0x19')]:_0x59f9b2[_0x3926('0x24')];var _0x94b870={'method':'POST','uri':_0x1d3a33+_0x3926('0x38')+'?'+_0x5ad751,'body':Object[_0x3926('0x39')]({},{'active':_0x3926('0x22'),'caller_id':_0x23844e,'assigned_to':_0x59f9b2[_0x3926('0x19')],'short_description':intUtil[_0x3926('0x3a')](_0x15162c['Subjects'],_0x4482a2,'\x20'),'description':intUtil[_0x3926('0x3a')](_0x15162c[_0x3926('0x3b')],_0x4482a2,'\x0a')},getCustomFields(_0x15162c[_0x3926('0x3c')],_0x4482a2)),'auth':_0x1de89d,'json':!![]};return rp(_0x94b870)[_0x3926('0x16')](function(_0x47d622){logger['info']('['+[_0x140df8['toUpperCase']()]+_0x3926('0x3d'),_0x47d622[_0x3926('0xa')]);_0x59f9b2[_0x3926('0x3e')]=_0x47d622[_0x3926('0xa')][_0x3926('0xd')];_0x59f9b2['ticketNumber']=_0x47d622['result']['number'];logger[_0x3926('0x13')]('['+[_0x140df8['toUpperCase']()]+_0x3926('0x3f'),_0x59f9b2);_0xde30eb(_0x59f9b2);})[_0x3926('0xf')](function(_0x18c82c){logger[_0x3926('0x10')]('['+[_0x140df8[_0x3926('0x11')]()]+']',_0x18c82c[_0x3926('0x12')]);_0x4d94e5(_0x18c82c['message']);});});};}function createRemoteTag(_0x1db33b,_0x3015eb,_0x6bcf08,_0x180ae9){return new Promise(function(_0x57e27f,_0x35fea5){var _0x1bccfc={'method':'POST','uri':_0x6bcf08+'label'+'?'+_0x180ae9,'body':{'short_description':_0x1db33b,'global':!![],'active':!![],'name':_0x1db33b},'auth':_0x3015eb,'json':!![]};return rp(_0x1bccfc)['then'](function(_0x3f2c2a){var _0x39ef6a=_0x3f2c2a['result'][_0x3926('0xd')];_0x57e27f(_0x39ef6a);});});}function getRemoteTag(_0x2bb226,_0x2882ec,_0xe8e63,_0x282737,_0xdcf7be){return new Promise(function(_0x190ff0,_0x5de31d){var _0x38a37e={'method':_0x3926('0x9'),'uri':_0xe8e63+_0x3926('0x40')+_0x3926('0x41')+_0x2bb226+'&'+_0x282737,'auth':_0x2882ec,'json':!![]};return rp(_0x38a37e)[_0x3926('0x16')](function(_0x119879){if(_0x119879['result'][_0x3926('0xb')]>0x0){var _0x1759f5=_0x119879['result'][0x0][_0x3926('0xd')];_0x190ff0(_0x1759f5);}else{return createRemoteTag(_0x2bb226,_0x2882ec,_0xe8e63,_0x282737)[_0x3926('0x16')](function(_0xc17073){_0x190ff0(_0xc17073);});}});});}function assignTagToIncident(_0x2de40b,_0x5d5c89,_0x41142a,_0x34ce72,_0x3dfe1c){return new Promise(function(_0x875c90,_0x223c72){var _0x5f098a={'method':'POST','uri':_0x41142a+_0x3926('0x42')+'?'+_0x3dfe1c,'body':{'label':_0x2de40b,'table':_0x3926('0x38'),'id_type':'Incident','table_key':_0x34ce72[_0x3926('0x3e')],'title':_0x3926('0x43')+_0x34ce72['ticketNumber'],'id_display':_0x34ce72['ticketNumber']},'auth':_0x5d5c89,'json':!![]};return rp(_0x5f098a)[_0x3926('0x16')](function(_0x21b33f){_0x875c90();})[_0x3926('0xf')](function(){_0x875c90();});});}function manageTags(_0x4de3e2,_0x1e4825,_0x53c8ae,_0x23cb9f,_0x49be7a,_0x7fe75f,_0x3dfa09){return new Promise(function(_0xfe5b7c,_0x1069e3){var _0x337206=[];_0x1e4825[_0x3926('0x44')](function(_0x199ac5){_0x337206['push'](getRemoteTag(_0x199ac5,_0x53c8ae,_0x23cb9f,_0x7fe75f,_0x3dfa09));});return Promise[_0x3926('0x45')](_0x337206)['then'](function(_0x600169){if(_0x600169['length']){logger[_0x3926('0x13')]('['+[_0x4de3e2[_0x3926('0x11')]()]+_0x3926('0x46'),_0x600169);var _0x2e6fa5=[];_0x600169['forEach'](function(_0x2378e3){_0x2e6fa5[_0x3926('0x47')](assignTagToIncident(_0x2378e3,_0x53c8ae,_0x23cb9f,_0x49be7a,_0x7fe75f));});return Promise['all'](_0x2e6fa5)[_0x3926('0x16')](function(){_0xfe5b7c();})[_0x3926('0xf')](function(){_0xfe5b7c();});}else{_0xfe5b7c();}});});}function getTags(_0x17a409,_0x44c825,_0x20ebcd,_0x2ecd85,_0x576769,_0x1f8c00){return function(_0x93488d){return new Promise(function(_0x411784,_0x2e9f08){var _0x5e4095=[];var _0x15d4c0=_0x2ecd85['Tags'];if(_0x15d4c0&&_0x15d4c0[_0x3926('0xb')]>0x0){_0x5e4095=_['map'](_0x15d4c0,_0x3926('0x35'));}if(_0x5e4095['length']>0x0){return manageTags(_0x17a409,_0x5e4095,_0x44c825,_0x20ebcd,_0x93488d,_0x576769,_0x1f8c00)[_0x3926('0x16')](function(){_0x411784(_0x93488d);});}else{_0x411784(_0x93488d);}});};}function emit(_0x15dab2,_0x51daa4,_0x198786){var _0x13e46b='%26sysparm_record_target%3Dincident'+_0x3926('0x48')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x3926('0x49');var _0x48149e={'uri':_0x15dab2+_0x3926('0x4a')+_0x198786+_0x13e46b};io['to'](util[_0x3926('0x4b')](_0x3926('0x4c'),_0x51daa4))['emit'](_0x3926('0x4d'),_0x48149e);}exports['cs']=function(_0x4e8f67,_0x251e33,_0x90cd04,_0xf50b76,_0x2f6e02,_0x55eb1,_0x24cc5f,_0x4932de){var _0x445c39={};var _0x1e5b0e={'user':_0x55eb1[_0x3926('0x4e')],'pass':_0x55eb1[_0x3926('0x4f')]};var _0x459287=_0x3926('0x50');var _0x2cbd57='sysparm_display_value=true';_0x55eb1[_0x3926('0x51')]=intUtil[_0x3926('0x52')](_0x55eb1[_0x3926('0x51')]);_0x55eb1[_0x3926('0x53')]=intUtil[_0x3926('0x52')](_0x55eb1[_0x3926('0x53')]);var _0x14ac0f=util['format']('%s/api/now/table/',_0x55eb1[_0x3926('0x51')]);_0x445c39[_0x3926('0x1a')]=!_[_0x3926('0x54')](_0xf50b76)?_0xf50b76[_0x3926('0x55')]:null;_0x445c39[_0x3926('0x1b')]=_0x55eb1[_0x3926('0x55')];_0x445c39[_0x3926('0x21')]=_0x4932de['toLowerCase']()===_0x3926('0x37')?_0x251e33['destcalleridnum']:_0x251e33[_0x3926('0x56')];_0x445c39[_0x3926('0x57')]=_0x4932de===_0x3926('0x58')||_0x4932de===_0x3926('0x59')?'queue':_0x3926('0x37');var _0x1b2225=util[_0x3926('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55eb1[_0x3926('0x53')],_0x251e33[_0x3926('0x5a')],md5(_0x251e33[_0x3926('0x5a')]));if(_0x2f6e02&&_0x2f6e02[_0x3926('0x5b')]){logger[_0x3926('0x13')](_0x3926('0x5c'),'Recording\x20is\x20enabled!');_0x251e33[_0x3926('0x5d')]=_0x1b2225;}else if(_0x24cc5f&&_0x24cc5f[_0x3926('0x5e')]&&_0x24cc5f['recordingFormat']!==_0x3926('0x5f')){logger[_0x3926('0x13')](_0x3926('0x60'),_0x3926('0x61'));_0x251e33[_0x3926('0x5d')]=_0x1b2225;}else{_0x251e33[_0x3926('0x5d')]='';}return getAdminUser(_0x4932de,_0x1e5b0e,_0x445c39,_0x14ac0f,_0x2cbd57,_0x459287)['then'](getUser(_0x4932de,_0x1e5b0e,_0x14ac0f,_0x2cbd57,_0x459287))[_0x3926('0x16')](getEndUser(_0x4932de,_0x1e5b0e,_0x14ac0f,_0x2cbd57,_0x459287))['then'](getTicket(_0x4932de,_0x1e5b0e,_0x14ac0f,_0x90cd04,_0x251e33,_0x2cbd57))['then'](function(_0x567d6e){logger[_0x3926('0x13')](util['format'](_0x3926('0x62'),_0x567d6e['ticketId']));logger['info'](util[_0x3926('0x4b')](_0x3926('0x63'),_0x4932de));if(_0x4932de!==_0x3926('0x59')){logger[_0x3926('0x13')]('['+[_0x4932de[_0x3926('0x11')]()]+']',_0x3926('0x64'));emit(_0x55eb1['remoteUri'],_0xf50b76[_0x3926('0x35')],_0x567d6e[_0x3926('0x3e')]);}})[_0x3926('0xf')](function(_0x312a99){logger[_0x3926('0x10')]('['+[_0x4932de['toUpperCase']()]+_0x3926('0x65'),util[_0x3926('0x66')](_0x312a99,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2adc=['message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','info','],\x20getUser\x20entity','active','true','userId','adminEmail','catch',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','toString','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','ticketNumber','forEach','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error'];(function(_0x3f3053,_0x3940c9){var _0x105221=function(_0x98d89){while(--_0x98d89){_0x3f3053['push'](_0x3f3053['shift']());}};_0x105221(++_0x3940c9);}(_0x2adc,0x141));var _0xc2ad=function(_0x14c72f,_0x785db0){_0x14c72f=_0x14c72f-0x0;var _0x4312c5=_0x2adc[_0x14c72f];return _0x4312c5;};'use strict';var _=require(_0xc2ad('0x0'));var Promise=require(_0xc2ad('0x1'));var rp=require(_0xc2ad('0x2'));var util=require(_0xc2ad('0x3'));var md5=require('md5');var Redis=require(_0xc2ad('0x4'));var intUtil=require(_0xc2ad('0x5'));var config=require(_0xc2ad('0x6'));var logger=require(_0xc2ad('0x7'))(_0xc2ad('0x8'));config[_0xc2ad('0x9')]=_[_0xc2ad('0xa')](config['redis'],{'host':_0xc2ad('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x16cd2c,_0x41c621,_0x5b61ff,_0x5a887a,_0x32a241,_0x387be2){return new Promise(function(_0x2d9342,_0x1d077e){var _0x4b03fa={'method':_0xc2ad('0xc'),'uri':_0x5a887a+_0xc2ad('0xd')+'&'+_0x32a241+'&'+_0x387be2,'auth':_0x41c621,'json':!![]};return rp(_0x4b03fa)[_0xc2ad('0xe')](function(_0xcc8fd5){if(_0xcc8fd5[_0xc2ad('0xf')]['length']>0x0){_0x5b61ff[_0xc2ad('0x10')]=_0xcc8fd5[_0xc2ad('0xf')][0x0][_0xc2ad('0x11')];}logger['info']('['+[_0x16cd2c[_0xc2ad('0x12')]()]+_0xc2ad('0x13'),_0x5b61ff);_0x2d9342(_0x5b61ff);})['catch'](function(_0x5f1234){logger[_0xc2ad('0x14')]('['+[_0x16cd2c['toUpperCase']()]+']',_0x5f1234['message']);_0x1d077e(_0x5f1234[_0xc2ad('0x15')]);});});}function getUser(_0x5e7689,_0xa15ca7,_0xdd5473,_0x217745,_0x57abdb){return function(_0x484ae0){logger['info']('['+[_0x5e7689['toUpperCase']()]+_0xc2ad('0x16'),_0x484ae0);return new Promise(function(_0x4bba47,_0x55dcc9){if(intUtil[_0xc2ad('0x17')](_0x484ae0[_0xc2ad('0x18')])){var _0x1fd3fe={'method':'GET','uri':_0xdd5473+_0xc2ad('0x19')+_0x484ae0[_0xc2ad('0x18')]+'&'+_0x217745+'&'+_0x57abdb,'auth':_0xa15ca7,'json':!![]};logger['info']('['+[_0x5e7689[_0xc2ad('0x12')]()]+_0xc2ad('0x1a'),_0x1fd3fe);return rp(_0x1fd3fe)[_0xc2ad('0xe')](function(_0x50ffa9){logger[_0xc2ad('0x1b')]('['+[_0x5e7689[_0xc2ad('0x12')]()]+_0xc2ad('0x1c'),_0x50ffa9);if(_0x50ffa9[_0xc2ad('0xf')]['length']>0x0&&String(_0x50ffa9[_0xc2ad('0xf')][0x0][_0xc2ad('0x1d')])===_0xc2ad('0x1e')){_0x484ae0['userId']=_0x50ffa9[_0xc2ad('0xf')][0x0][_0xc2ad('0x11')];}else{_0x484ae0[_0xc2ad('0x1f')]=_0x484ae0[_0xc2ad('0x10')];_0x484ae0['userEmail']=_0x484ae0[_0xc2ad('0x20')];}logger['info']('['+[_0x5e7689[_0xc2ad('0x12')]()]+'],\x20getUser\x20crm',_0x484ae0);_0x4bba47(_0x484ae0);})[_0xc2ad('0x21')](function(_0xe58e52){logger[_0xc2ad('0x14')]('['+[_0x5e7689[_0xc2ad('0x12')]()]+']',_0xe58e52[_0xc2ad('0x15')]);_0x55dcc9(_0xe58e52['message']);});}else{logger['info']('['+[_0x5e7689[_0xc2ad('0x12')]()]+_0xc2ad('0x22'));_0x484ae0['userId']=_0x484ae0[_0xc2ad('0x10')];_0x484ae0[_0xc2ad('0x18')]=_0x484ae0[_0xc2ad('0x20')];_0x4bba47(_0x484ae0);}});};}function createEndUser(_0x86c2c2,_0x2beb47,_0x4e1505,_0x2eca5b,_0x5d6f20){logger[_0xc2ad('0x1b')]('['+[_0x86c2c2['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x4e1505);return new Promise(function(_0x22854c,_0x43e030){var _0x4c9177={'method':_0xc2ad('0x23'),'uri':_0x2eca5b+_0xc2ad('0x24')+_0x5d6f20,'body':{'user_name':_0x4e1505[_0xc2ad('0x25')],'roles':'user','first_name':_0x4e1505[_0xc2ad('0x25')],'active':_0xc2ad('0x1e'),'date_format':'System','phone':_0x4e1505[_0xc2ad('0x25')]},'auth':_0x2beb47,'json':!![]};return rp(_0x4c9177)['then'](function(_0x513500){logger[_0xc2ad('0x1b')]('['+[_0x86c2c2[_0xc2ad('0x12')]()]+_0xc2ad('0x26'),_0x513500[_0xc2ad('0xf')]);_0x4e1505[_0xc2ad('0x27')]=_0x513500[_0xc2ad('0xf')]['sys_id'];_0x22854c(_0x4e1505);})[_0xc2ad('0x21')](function(_0x1033ec){logger[_0xc2ad('0x14')]('['+[_0x86c2c2[_0xc2ad('0x12')]()]+']',_0x1033ec[_0xc2ad('0x15')]);_0x43e030(_0x1033ec['message']);});});}function getEndUser(_0x28af3c,_0x3ed2b8,_0xf40acc,_0x1f18ae,_0x395eb4){return function(_0x248b41){logger['info']('['+[_0x28af3c[_0xc2ad('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x248b41);return new Promise(function(_0x22eda1,_0xec53dc){var _0x15300a={'method':_0xc2ad('0xc'),'uri':_0xf40acc+_0xc2ad('0x28')+_0x248b41['endUserNumber']+'&'+_0x1f18ae+'&'+_0x395eb4,'auth':_0x3ed2b8,'json':!![]};return rp(_0x15300a)[_0xc2ad('0xe')](function(_0x22ad99){if(_0x22ad99[_0xc2ad('0xf')]['length']>0x0){_0x248b41[_0xc2ad('0x27')]=_0x22ad99['result'][0x0][_0xc2ad('0x11')];logger['info']('['+[_0x28af3c['toUpperCase']()]+_0xc2ad('0x29'),_0x248b41);_0x22eda1(_0x248b41);}else{return createEndUser(_0x28af3c,_0x3ed2b8,_0x248b41,_0xf40acc,_0x1f18ae)[_0xc2ad('0xe')](function(_0x1250e3){logger['info']('['+[_0x28af3c[_0xc2ad('0x12')]()]+_0xc2ad('0x2a'),_0x1250e3);_0x22eda1(_0x1250e3);});}})['catch'](function(_0x3db575){logger[_0xc2ad('0x14')]('['+[_0x28af3c[_0xc2ad('0x12')]()]+']',_0x3db575[_0xc2ad('0x15')]);_0xec53dc(_0x3db575[_0xc2ad('0x15')]);});});};}function getCustomFields(_0x3752b0,_0x3a17a0){var _0x19b20d={};if(_0x3752b0[_0xc2ad('0x2b')]>0x0){_['forEach'](_0x3752b0,function(_0x4a43d0){if(_[_0xc2ad('0x2c')]([_0xc2ad('0x2d'),_0xc2ad('0x2e')],_0x4a43d0['type'])&&_0x4a43d0[_0xc2ad('0x2f')]&&!_0x4a43d0[_0xc2ad('0x30')]){_0x19b20d[_0x4a43d0[_0xc2ad('0x2f')][_0xc2ad('0x31')]()]=_0x4a43d0[_0xc2ad('0x32')]['toString']();}else if(_[_0xc2ad('0x2c')]([_0xc2ad('0x2d'),_0xc2ad('0x2e')],_0x4a43d0[_0xc2ad('0x33')])&&_0x4a43d0[_0xc2ad('0x34')]&&_0x4a43d0['customField']){_0x19b20d[_0x4a43d0['idField'][_0xc2ad('0x31')]()]=_0x4a43d0[_0xc2ad('0x32')][_0xc2ad('0x35')]();}else if(_0x4a43d0[_0xc2ad('0x33')]===_0xc2ad('0x36')&&_0x4a43d0[_0xc2ad('0x37')]&&_0x4a43d0[_0xc2ad('0x34')]&&_0x4a43d0['customField']){_0x19b20d[_0x4a43d0[_0xc2ad('0x34')][_0xc2ad('0x31')]()]=_0x3a17a0[_0x4a43d0['variableName']][_0xc2ad('0x35')]();}else if(_0x4a43d0[_0xc2ad('0x33')]==='customVariable'&&_0x4a43d0[_0xc2ad('0x38')]&&_0x4a43d0[_0xc2ad('0x38')][_0xc2ad('0x39')]&&_0x4a43d0[_0xc2ad('0x34')]&&_0x4a43d0[_0xc2ad('0x30')]){_0x19b20d[_0x4a43d0[_0xc2ad('0x34')]['toLowerCase']()]=_0x3a17a0[_0x4a43d0[_0xc2ad('0x38')][_0xc2ad('0x39')]['toLowerCase']()]['toString']();}});}return _0x19b20d;}function getTicket(_0x36b21a,_0x2d5636,_0x457eca,_0x7dbe98,_0x4b8a29,_0x269b32){return function(_0x24f4ea){logger[_0xc2ad('0x1b')]('['+[_0x36b21a[_0xc2ad('0x12')]()]+_0xc2ad('0x3a'),_0x24f4ea);return new Promise(function(_0x58d3db,_0x4e5b94){var _0x237f56=_0x36b21a[_0xc2ad('0x31')]()===_0xc2ad('0x3b')?_0x24f4ea[_0xc2ad('0x1f')]:_0x24f4ea['endUserId'];var _0x157c77={'method':'POST','uri':_0x457eca+_0xc2ad('0x3c')+'?'+_0x269b32,'body':Object['assign']({},{'active':_0xc2ad('0x1e'),'caller_id':_0x237f56,'assigned_to':_0x24f4ea[_0xc2ad('0x1f')],'short_description':intUtil[_0xc2ad('0x3d')](_0x7dbe98[_0xc2ad('0x3e')],_0x4b8a29,'\x20'),'description':intUtil['getString'](_0x7dbe98[_0xc2ad('0x3f')],_0x4b8a29,'\x0a')},getCustomFields(_0x7dbe98[_0xc2ad('0x40')],_0x4b8a29)),'auth':_0x2d5636,'json':!![]};return rp(_0x157c77)[_0xc2ad('0xe')](function(_0x5f4c9c){logger[_0xc2ad('0x1b')]('['+[_0x36b21a[_0xc2ad('0x12')]()]+_0xc2ad('0x41'),_0x5f4c9c[_0xc2ad('0xf')]);_0x24f4ea['ticketId']=_0x5f4c9c[_0xc2ad('0xf')][_0xc2ad('0x11')];_0x24f4ea['ticketNumber']=_0x5f4c9c['result'][_0xc2ad('0x42')];logger['info']('['+[_0x36b21a[_0xc2ad('0x12')]()]+']\x20getTicket\x20crm',_0x24f4ea);_0x58d3db(_0x24f4ea);})[_0xc2ad('0x21')](function(_0x3d2e23){logger['error']('['+[_0x36b21a[_0xc2ad('0x12')]()]+']',_0x3d2e23[_0xc2ad('0x15')]);_0x4e5b94(_0x3d2e23[_0xc2ad('0x15')]);});});};}function createRemoteTag(_0x3a70ae,_0x3def7c,_0x224a6f,_0x2a88b4){return new Promise(function(_0x40e3f3,_0x276a9c){var _0x59d832={'method':'POST','uri':_0x224a6f+_0xc2ad('0x43')+'?'+_0x2a88b4,'body':{'short_description':_0x3a70ae,'global':!![],'active':!![],'name':_0x3a70ae},'auth':_0x3def7c,'json':!![]};return rp(_0x59d832)['then'](function(_0x5614e5){var _0x579a71=_0x5614e5[_0xc2ad('0xf')][_0xc2ad('0x11')];_0x40e3f3(_0x579a71);});});}function getRemoteTag(_0x20a074,_0x126698,_0x382b8d,_0x2de43e,_0x594896){return new Promise(function(_0x199330,_0x38890f){var _0x4fad22={'method':_0xc2ad('0xc'),'uri':_0x382b8d+'label'+_0xc2ad('0x44')+_0x20a074+'&'+_0x2de43e,'auth':_0x126698,'json':!![]};return rp(_0x4fad22)[_0xc2ad('0xe')](function(_0x505043){if(_0x505043[_0xc2ad('0xf')]['length']>0x0){var _0x28f9ae=_0x505043['result'][0x0][_0xc2ad('0x11')];_0x199330(_0x28f9ae);}else{return createRemoteTag(_0x20a074,_0x126698,_0x382b8d,_0x2de43e)[_0xc2ad('0xe')](function(_0x482854){_0x199330(_0x482854);});}});});}function assignTagToIncident(_0x3c11fe,_0x36c95f,_0x1d7a96,_0x27058d,_0x41e31e){return new Promise(function(_0x5d8304,_0x6aefaf){var _0x17d8fb={'method':_0xc2ad('0x23'),'uri':_0x1d7a96+_0xc2ad('0x45')+'?'+_0x41e31e,'body':{'label':_0x3c11fe,'table':'incident','id_type':_0xc2ad('0x46'),'table_key':_0x27058d[_0xc2ad('0x47')],'title':_0xc2ad('0x48')+_0x27058d['ticketNumber'],'id_display':_0x27058d[_0xc2ad('0x49')]},'auth':_0x36c95f,'json':!![]};return rp(_0x17d8fb)['then'](function(_0x130788){_0x5d8304();})[_0xc2ad('0x21')](function(){_0x5d8304();});});}function manageTags(_0x1e2774,_0x32e059,_0x18d616,_0x5e4dc8,_0x4a93a5,_0x509847,_0x15addd){return new Promise(function(_0x4c6ba4,_0x210acc){var _0x3fbebc=[];_0x32e059[_0xc2ad('0x4a')](function(_0x4d4a2e){_0x3fbebc[_0xc2ad('0x4b')](getRemoteTag(_0x4d4a2e,_0x18d616,_0x5e4dc8,_0x509847,_0x15addd));});return Promise['all'](_0x3fbebc)[_0xc2ad('0xe')](function(_0x24919a){if(_0x24919a[_0xc2ad('0x2b')]){logger[_0xc2ad('0x1b')]('['+[_0x1e2774[_0xc2ad('0x12')]()]+_0xc2ad('0x4c'),_0x24919a);var _0x5df806=[];_0x24919a['forEach'](function(_0x10179d){_0x5df806['push'](assignTagToIncident(_0x10179d,_0x18d616,_0x5e4dc8,_0x4a93a5,_0x509847));});return Promise[_0xc2ad('0x4d')](_0x5df806)['then'](function(){_0x4c6ba4();})[_0xc2ad('0x21')](function(){_0x4c6ba4();});}else{_0x4c6ba4();}});});}function getTags(_0x3d1c9e,_0x2ede3a,_0x3783bc,_0x3eb102,_0x2611ed,_0x212e5f){return function(_0x54665a){return new Promise(function(_0x5d0502,_0x100de0){var _0x36ecea=[];var _0x37d3e2=_0x3eb102[_0xc2ad('0x4e')];if(_0x37d3e2&&_0x37d3e2[_0xc2ad('0x2b')]>0x0){_0x36ecea=_['map'](_0x37d3e2,_0xc2ad('0x39'));}if(_0x36ecea[_0xc2ad('0x2b')]>0x0){return manageTags(_0x3d1c9e,_0x36ecea,_0x2ede3a,_0x3783bc,_0x54665a,_0x2611ed,_0x212e5f)['then'](function(){_0x5d0502(_0x54665a);});}else{_0x5d0502(_0x54665a);}});};}function emit(_0x27d23d,_0x5940d2,_0x50babf){var _0x3001e4=_0xc2ad('0x4f')+_0xc2ad('0x50')+_0xc2ad('0x51')+_0xc2ad('0x52');var _0x4379fc={'uri':_0x27d23d+_0xc2ad('0x53')+_0x50babf+_0x3001e4};io['to'](util[_0xc2ad('0x54')](_0xc2ad('0x55'),_0x5940d2))[_0xc2ad('0x56')](_0xc2ad('0x57'),_0x4379fc);}exports['cs']=function(_0x26f37f,_0x399d07,_0x2b9b15,_0x2d8914,_0x2573f3,_0x1824e6,_0x3aee85,_0x4c3484){var _0xcf13f4={};var _0x205e6e={'user':_0x1824e6['username'],'pass':_0x1824e6[_0xc2ad('0x58')]};var _0x52190e=_0xc2ad('0x59');var _0x39857b=_0xc2ad('0x5a');_0x1824e6[_0xc2ad('0x5b')]=intUtil[_0xc2ad('0x5c')](_0x1824e6[_0xc2ad('0x5b')]);_0x1824e6[_0xc2ad('0x5d')]=intUtil[_0xc2ad('0x5c')](_0x1824e6['serverUrl']);var _0x40bd86=util[_0xc2ad('0x54')](_0xc2ad('0x5e'),_0x1824e6[_0xc2ad('0x5b')]);_0xcf13f4[_0xc2ad('0x18')]=!_[_0xc2ad('0x5f')](_0x2d8914)?_0x2d8914[_0xc2ad('0x60')]:null;_0xcf13f4[_0xc2ad('0x20')]=_0x1824e6[_0xc2ad('0x60')];_0xcf13f4[_0xc2ad('0x25')]=_0x4c3484[_0xc2ad('0x31')]()===_0xc2ad('0x3b')?_0x399d07[_0xc2ad('0x61')]:_0x399d07[_0xc2ad('0x62')];_0xcf13f4[_0xc2ad('0x63')]=_0x4c3484===_0xc2ad('0x64')||_0x4c3484===_0xc2ad('0x65')?_0xc2ad('0x64'):_0xc2ad('0x3b');var _0x364dcc=util['format'](_0xc2ad('0x66'),_0x1824e6[_0xc2ad('0x5d')],_0x399d07['uniqueid'],md5(_0x399d07[_0xc2ad('0x67')]));if(_0x2573f3&&_0x2573f3[_0xc2ad('0x68')]){logger[_0xc2ad('0x1b')](_0xc2ad('0x69'),'Recording\x20is\x20enabled!');_0x399d07[_0xc2ad('0x6a')]=_0x364dcc;}else if(_0x3aee85&&_0x3aee85[_0xc2ad('0x6b')]&&_0x3aee85[_0xc2ad('0x6b')]!==_0xc2ad('0x6c')){logger[_0xc2ad('0x1b')](_0xc2ad('0x6d'),'Recording\x20is\x20enabled!');_0x399d07[_0xc2ad('0x6a')]=_0x364dcc;}else{_0x399d07[_0xc2ad('0x6a')]='';}return getAdminUser(_0x4c3484,_0x205e6e,_0xcf13f4,_0x40bd86,_0x39857b,_0x52190e)[_0xc2ad('0xe')](getUser(_0x4c3484,_0x205e6e,_0x40bd86,_0x39857b,_0x52190e))[_0xc2ad('0xe')](getEndUser(_0x4c3484,_0x205e6e,_0x40bd86,_0x39857b,_0x52190e))[_0xc2ad('0xe')](getTicket(_0x4c3484,_0x205e6e,_0x40bd86,_0x2b9b15,_0x399d07,_0x39857b))['then'](function(_0x2b98d3){logger[_0xc2ad('0x1b')](util[_0xc2ad('0x54')](_0xc2ad('0x6e'),_0x2b98d3[_0xc2ad('0x47')]));logger[_0xc2ad('0x1b')](util['format']('call\x20direction:\x20%s',_0x4c3484));if(_0x4c3484!==_0xc2ad('0x65')){logger[_0xc2ad('0x1b')]('['+[_0x4c3484[_0xc2ad('0x12')]()]+']',_0xc2ad('0x6f'));emit(_0x1824e6['remoteUri'],_0x2d8914['name'],_0x2b98d3[_0xc2ad('0x47')]);}})[_0xc2ad('0x21')](function(_0x55b00e){logger[_0xc2ad('0x14')]('['+[_0x4c3484[_0xc2ad('0x12')]()]+_0xc2ad('0x70'),util[_0xc2ad('0x71')](_0x55b00e,{'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 4449d09..a7e6a07 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 _0x6295=['sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','Employees','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','first_name','debug','[HTTP]','map','type','nameField','customField','toLowerCase','content','custom_fields','variable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','trigger:browser:url','catch','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','destcalleridname','destcalleridnum','Fields','Outbound','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','error','monitor_format','lastevent','isNil','calleridname','toUpperCase','lodash','request-promise','bluebird','util','ioredis','../../../../config/environment'];(function(_0x4ab3d1,_0x40604c){var _0x4e96dd=function(_0x123d47){while(--_0x123d47){_0x4ab3d1['push'](_0x4ab3d1['shift']());}};_0x4e96dd(++_0x40604c);}(_0x6295,0x162));var _0x5629=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6295[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x5629('0x0'));var rp=require(_0x5629('0x1'));var BPromise=require(_0x5629('0x2'));var md5=require('md5');var util=require(_0x5629('0x3'));var Redis=require(_0x5629('0x4'));var intUtil=require('./util');var config=require(_0x5629('0x5'));var logger=require('../../../../config/logger')(_0x5629('0x6'));config[_0x5629('0x7')]=_[_0x5629('0x8')](config['redis'],{'host':_0x5629('0x9'),'port':0x18eb});var io=require(_0x5629('0xa'))(new Redis(config[_0x5629('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x373c88,_0x3ef61e,_0x49f303){io['to'](_0x373c88)[_0x5629('0xb')](_0x3ef61e,_0x49f303);}function getTicket(_0x4aeaed,_0x36244f,_0x145f07,_0x2cf8f4,_0x34f3c7,_0x1e3b91,_0x5ab50b,_0x446e91){logger[_0x5629('0xc')]('Creating\x20new\x20ticket...');var _0x721b53=new Date();var _0x174e38=[{'name':_0x5629('0xd'),'value':intUtil[_0x5629('0xe')](_0x2cf8f4[_0x5629('0xf')],_0x34f3c7,'\x20')},{'name':_0x5629('0x10'),'value':_0x36244f['id']},{'name':_0x5629('0x11'),'value':_0x36244f['id']},{'name':_0x5629('0x12'),'value':intUtil['getString'](_0x2cf8f4[_0x5629('0x13')],_0x34f3c7,'\x0a')},{'name':_0x5629('0x14'),'value':_0x721b53[_0x5629('0x15')]()['slice'](0x0,0x13)[_0x5629('0x16')]('T','\x20')},{'name':_0x5629('0x17'),'value':'0'},{'name':_0x5629('0x18'),'value':'15'},{'name':'parent_id','value':_0x145f07['id']},{'name':_0x5629('0x19'),'value':_0x5629('0x1a')},{'name':_0x5629('0x1b'),'value':_0x145f07[_0x5629('0xd')]},{'name':_0x5629('0x1c'),'value':_0x446e91}];if(_0x1e3b91[_0x5629('0x1d')]){_[_0x5629('0x1e')](_0x1e3b91,function(_0x199431){if(_0x34f3c7[_0x199431[_0x5629('0x1f')]]){_0x174e38[_0x5629('0x20')]({'name':_0x199431[_0x5629('0x21')],'value':_0x34f3c7[_0x199431[_0x5629('0x1f')]]});}});}return request({'form':{'method':_0x5629('0x22'),'input_type':_0x5629('0x23'),'response_type':'JSON','rest_data':JSON[_0x5629('0x24')]({'session':_0x5ab50b['id'],'module_name':_0x5629('0x25'),'name_value_list':_0x174e38})}});}function getAuth(_0x21223b){return util[_0x5629('0x26')](_0x5629('0x27'),new Buffer(_0x21223b[_0x5629('0x28')]+':X')[_0x5629('0x29')](_0x5629('0x2a')));}function getServerInfo(_0x390c40){return request({'form':{'method':_0x5629('0x2b'),'input_type':_0x5629('0x23'),'response_type':_0x5629('0x23'),'rest_data':JSON[_0x5629('0x24')]({'session':_0x390c40['id']})}});}function getUser(_0x311f95,_0x5cff0e,_0x581d3a){if(!_['isNil'](_0x5cff0e)){logger[_0x5629('0xc')]('Getting\x20agent\x20with\x20name',_0x5cff0e);return request({'form':{'method':'get_entry_list','input_type':_0x5629('0x23'),'response_type':'JSON','rest_data':JSON[_0x5629('0x24')]({'session':_0x581d3a['id'],'module_name':_0x5629('0x2c'),'query':util[_0x5629('0x26')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5cff0e),'order_by':'','offset':'0','select_fields':['id',_0x5629('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x453ef1){if(_0x453ef1[_0x5629('0x2d')][_0x5629('0x1d')]){var _0x5b0bdb=_[_0x5629('0x2e')](_0x453ef1[_0x5629('0x2d')],function(_0x28c337){return _0x28c337[_0x5629('0x2f')][_0x5629('0x30')][_0x5629('0x31')]===_0x5cff0e;});if(_0x5b0bdb){logger['info'](_0x5629('0x32'));return BPromise[_0x5629('0x33')]({'id':_0x5b0bdb[_0x5629('0x2f')]['id'][_0x5629('0x31')],'name':_0x5b0bdb[_0x5629('0x2f')][_0x5629('0xd')][_0x5629('0x31')]});}}logger[_0x5629('0xc')](_0x5629('0x34'));return BPromise['resolve']({'id':_0x581d3a[_0x5629('0x2f')][_0x5629('0x35')]['value'],'name':_0x581d3a[_0x5629('0x2f')][_0x5629('0x30')]['value']});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x5629('0x33')]({'id':_0x581d3a[_0x5629('0x2f')][_0x5629('0x35')][_0x5629('0x31')],'name':_0x581d3a['name_value_list']['user_name'][_0x5629('0x31')]});}}function getEndUser(_0x16f1b5,_0x1600c7,_0x107223,_0x485e08){logger[_0x5629('0xc')]('Searching\x20enduser\x20with\x20phone',_0x107223);return request({'form':{'method':_0x5629('0x36'),'input_type':_0x5629('0x23'),'response_type':_0x5629('0x23'),'rest_data':JSON[_0x5629('0x24')]({'session':_0x485e08['id'],'module_name':'Contacts','query':util[_0x5629('0x26')](_0x5629('0x37'),_0x107223),'order_by':'','offset':'0','select_fields':['id','name',_0x5629('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5629('0x39')](function(_0x2c7f36){if(_0x2c7f36['entry_list']['length']){var _0x4d1442=_[_0x5629('0x2e')](_0x2c7f36[_0x5629('0x2d')],function(_0x505a2c){return _0x505a2c['name_value_list'][_0x5629('0x38')][_0x5629('0x31')]===_0x107223;});if(_0x4d1442){logger[_0x5629('0xc')]('Enduser\x20found!');return BPromise[_0x5629('0x33')]({'id':_0x4d1442[_0x5629('0x2f')]['id']['value'],'name':_0x4d1442[_0x5629('0x2f')][_0x5629('0xd')][_0x5629('0x31')],'phone':_0x4d1442[_0x5629('0x2f')][_0x5629('0x38')][_0x5629('0x31')]});}}else{logger['info'](_0x5629('0x3a'));return request({'form':{'method':_0x5629('0x22'),'input_type':_0x5629('0x23'),'response_type':_0x5629('0x23'),'rest_data':JSON[_0x5629('0x24')]({'session':_0x485e08['id'],'module_name':_0x5629('0x1a'),'name_value_list':[{'name':'first_name','value':_0x1600c7!==''?_0x1600c7:util[_0x5629('0x26')](_0x5629('0x3b'),_0x107223)},{'name':_0x5629('0x38'),'value':_0x107223}]})}})[_0x5629('0x39')](function(_0x5c3c88){logger['info']('Enduser\x20created.');return BPromise[_0x5629('0x33')]({'id':_0x5c3c88['id'],'name':_0x5c3c88[_0x5629('0x2d')][_0x5629('0x3c')][_0x5629('0x31')],'phone':_0x5c3c88['entry_list'][_0x5629('0x38')][_0x5629('0x31')]});});}});}function request(_0x131fb1){logger[_0x5629('0x3d')](_0x5629('0x3e'),JSON[_0x5629('0x24')](_0x131fb1));return rp(_['merge'](def,_0x131fb1));}function getTags(_0x4a5720,_0x7c3ea3){var _0x5375bc=[];if(_0x4a5720&&_0x4a5720[_0x5629('0x1d')]>0x0){_0x5375bc=_[_0x5629('0x3f')](_0x4a5720,_0x7c3ea3);}return _0x5375bc;}function getCustomFields(_0x483570,_0x4ec4bf){var _0x443d5a=[];var _0xf6b24f={'custom_fields':[]};if(_0x483570[_0x5629('0x1d')]>0x0){_[_0x5629('0x1e')](_0x483570,function(_0x588385){if(_0x588385[_0x5629('0x40')]==='string'&&_0x588385[_0x5629('0x41')]&&!_0x588385[_0x5629('0x42')]){_0xf6b24f[_0x588385[_0x5629('0x41')][_0x5629('0x43')]()]=_0x588385[_0x5629('0x44')][_0x5629('0x29')]();}else if(_0x588385[_0x5629('0x40')]==='string'&&_0x588385[_0x5629('0x21')]&&_0x588385[_0x5629('0x42')]){_0xf6b24f[_0x5629('0x45')][_0x5629('0x20')]({'id':_0x588385[_0x5629('0x21')],'value':_0x588385[_0x5629('0x44')][_0x5629('0x29')]()});}else if(_0x588385[_0x5629('0x40')]===_0x5629('0x46')&&_0x588385[_0x5629('0x1f')]&&_0x588385['idField']&&_0x588385[_0x5629('0x42')]){_0x4ec4bf[_0x588385[_0x5629('0x1f')]]&&_0xf6b24f[_0x5629('0x45')][_0x5629('0x20')]({'id':_0x588385[_0x5629('0x21')],'value':_0x4ec4bf[_0x588385[_0x5629('0x1f')]][_0x5629('0x29')]()});}else if(_0x588385[_0x5629('0x40')]==='customVariable'&&_0x588385['Variable']&&_0x588385[_0x5629('0x47')][_0x5629('0xd')]&&_0x588385[_0x5629('0x21')]&&_0x588385[_0x5629('0x42')]){_0x4ec4bf[_0x588385['Variable'][_0x5629('0xd')]['toLowerCase']()]&&_0xf6b24f[_0x5629('0x45')][_0x5629('0x20')]({'id':_0x588385['idField'],'value':_0x4ec4bf[_0x588385[_0x5629('0x47')][_0x5629('0xd')]['toLowerCase']()][_0x5629('0x29')]()});}});}return _0xf6b24f;}function getConnection(_0x549481){return request({'method':_0x5629('0x48'),'form':{'method':_0x5629('0x49'),'input_type':_0x5629('0x23'),'response_type':_0x5629('0x23'),'rest_data':JSON[_0x5629('0x24')]({'user_auth':{'user_name':_0x549481[_0x5629('0x4a')],'password':_0x549481[_0x5629('0x4b')],'encryption':_0x5629('0x4c')},'application':_0x5629('0x4d')})}})[_0x5629('0x39')](function(_0x4d22e4){var _0x5cb9d7=_0x4d22e4;if(_0x5cb9d7['id']){def[_0x5629('0x4e')]=_0x5cb9d7['id'];return BPromise['resolve'](_0x5cb9d7);}else{throw new Error(util['format'](_0x5629('0x4f'),_0x549481['id']));}});}function setRelationship(_0x2d2bdc,_0x160910,_0x2e0663,_0x588571){return request({'form':{'method':_0x5629('0x50'),'input_type':_0x5629('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2d2bdc['id'],'module_name':_0x5629('0x25'),'module_id':_0x2e0663['id'],'link_field_name':_0x588571,'related_ids':[_0x160910['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x5629('0x51')]=function(_0x296339,_0x2aed5e,_0x1842b5,_0x598289,_0x56ac61,_0x96f8bb){var _0x256c0c,_0x2d1b75,_0x537a6f,_0xb64942;_0x96f8bb['remoteUri']=intUtil[_0x5629('0x52')](_0x96f8bb[_0x5629('0x53')]);_0x96f8bb[_0x5629('0x54')]=intUtil['stripTrailingSlash'](_0x96f8bb['serverUrl']);def[_0x5629('0x55')]=util['format'](_0x5629('0x56'),_0x96f8bb[_0x5629('0x53')]);if(_0x56ac61&&_0x56ac61['monitor_format']){logger[_0x5629('0xc')]('[QUEUE]',_0x5629('0x57'));_0x2aed5e[_0x5629('0x58')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x96f8bb[_0x5629('0x54')],_0x2aed5e['uniqueid'],md5(_0x2aed5e['uniqueid']));}else{_0x2aed5e[_0x5629('0x58')]='';}return getConnection(_0x96f8bb)['then'](function(_0x12466b){_0xb64942=_0x12466b;return getUser(_0x96f8bb,_0x598289[_0x5629('0xd')],_0xb64942);})[_0x5629('0x39')](function(_0x38160b){_0x256c0c=_0x38160b;logger[_0x5629('0xc')](_0x5629('0x59'),_0x256c0c['id']);return getEndUser(_0x96f8bb,_0x2aed5e['calleridname'],_0x2aed5e[_0x5629('0x5a')],_0xb64942);})[_0x5629('0x39')](function(_0x2c5ab0){_0x2d1b75=_0x2c5ab0;logger[_0x5629('0xc')](_0x5629('0x5b'),_0x2d1b75['id']);return getTicket(_0x96f8bb,_0x256c0c,_0x2d1b75,_0x1842b5,_0x2aed5e,_0x1842b5['Fields'],_0xb64942,_0x5629('0x5c'));})[_0x5629('0x39')](function(_0x171cd2){_0x537a6f=_0x171cd2;logger[_0x5629('0xc')](_0x5629('0x5d'));logger[_0x5629('0xc')](_0x5629('0x5e'),_0x537a6f['id']);return setRelationship(_0xb64942,_0x256c0c,_0x537a6f,_0x5629('0x5f'));})['then'](function(){return setRelationship(_0xb64942,_0x2d1b75,_0x537a6f,_0x5629('0x60'));})[_0x5629('0x39')](function(){return getServerInfo(_0xb64942);})[_0x5629('0x39')](function(_0xc57c13){var _0x4646c8=parseInt(_0xc57c13['version'][_0x5629('0x61')](0x0));var _0xe514f4=util['format'](_0x5629('0x62'),_0x96f8bb[_0x5629('0x53')],_0x537a6f['id']);if(_0x4646c8>0x6){_0xe514f4=util[_0x5629('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x96f8bb['remoteUri'],_0x537a6f['id']);}logger[_0x5629('0xc')](_0x5629('0x63'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x598289['name']),_0x5629('0x64'),{'uri':_0xe514f4});})[_0x5629('0x65')](function(_0x1c1b80){logger['error'](_0x5629('0x63'),JSON[_0x5629('0x24')](_0x1c1b80));});};exports[_0x5629('0x66')]=function(_0x15683b,_0x4fb6c2,_0x2ae656,_0x3a7ea6,_0x10e54b,_0x3b21b9,_0x5a05a8){var _0x2e1e9d,_0x2e130f,_0x5c73a9,_0x1c9a92;_0x3b21b9['remoteUri']=intUtil[_0x5629('0x52')](_0x3b21b9['remoteUri']);_0x3b21b9[_0x5629('0x54')]=intUtil[_0x5629('0x52')](_0x3b21b9[_0x5629('0x54')]);def['uri']=util[_0x5629('0x26')](_0x5629('0x56'),_0x3b21b9[_0x5629('0x53')]);if(_0x5a05a8&&_0x5a05a8['recordingFormat']&&_0x5a05a8[_0x5629('0x67')]!=='none'){logger[_0x5629('0xc')](_0x5629('0x68'),_0x5629('0x57'));_0x4fb6c2[_0x5629('0x58')]=util[_0x5629('0x26')](_0x5629('0x69'),_0x3b21b9['serverUrl'],_0x4fb6c2[_0x5629('0x6a')],md5(_0x4fb6c2[_0x5629('0x6a')]));}return getConnection(_0x3b21b9)[_0x5629('0x39')](function(_0x5bd481){_0x1c9a92=_0x5bd481;return getUser(_0x3b21b9,_0x3a7ea6[_0x5629('0xd')],_0x1c9a92);})[_0x5629('0x39')](function(_0x586ce9){_0x2e1e9d=_0x586ce9;logger[_0x5629('0xc')]('The\x20User\x20ID\x20is:',_0x2e1e9d['id']);return getEndUser(_0x3b21b9,_0x4fb6c2[_0x5629('0x6b')],_0x4fb6c2[_0x5629('0x6c')],_0x1c9a92);})[_0x5629('0x39')](function(_0x41eae0){_0x2e130f=_0x41eae0;logger[_0x5629('0xc')](_0x5629('0x5b'),_0x2e130f['id']);return getTicket(_0x3b21b9,_0x2e1e9d,_0x2e130f,_0x2ae656,_0x4fb6c2,_0x2ae656[_0x5629('0x6d')],_0x1c9a92,_0x5629('0x6e'));})[_0x5629('0x39')](function(_0x4a4905){_0x5c73a9=_0x4a4905;logger[_0x5629('0xc')]('Ticket\x20created!');logger[_0x5629('0xc')](_0x5629('0x5e'),_0x5c73a9['id']);return setRelationship(_0x1c9a92,_0x2e1e9d,_0x5c73a9,_0x5629('0x5f'));})[_0x5629('0x39')](function(){return setRelationship(_0x1c9a92,_0x2e130f,_0x5c73a9,'contacts');})[_0x5629('0x39')](function(){return getServerInfo(_0x1c9a92);})['then'](function(_0x5634ae){var _0x4fa408=parseInt(_0x5634ae[_0x5629('0x6f')][_0x5629('0x61')](0x0));var _0x3cc681=util[_0x5629('0x26')](_0x5629('0x62'),_0x3b21b9[_0x5629('0x53')],_0x5c73a9['id']);if(_0x4fa408>0x6){_0x3cc681=util[_0x5629('0x26')](_0x5629('0x70'),_0x3b21b9[_0x5629('0x53')],_0x5c73a9['id']);}logger['info'](_0x5629('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5629('0x26')](_0x5629('0x71'),_0x3a7ea6[_0x5629('0xd')]),_0x5629('0x64'),{'uri':_0x3cc681});})[_0x5629('0x65')](function(_0x4050d6){logger[_0x5629('0x72')](_0x5629('0x68'),JSON[_0x5629('0x24')](_0x4050d6));});};exports['unmanaged']=function(_0x4acf81,_0x14e550,_0x5e5994,_0xd8308f,_0x25e9ed,_0x5ac6d8){var _0x1aa72e,_0x417d55,_0x1b1693,_0x9ec25a;_0x5ac6d8['remoteUri']=intUtil['stripTrailingSlash'](_0x5ac6d8[_0x5629('0x53')]);_0x5ac6d8['serverUrl']=intUtil['stripTrailingSlash'](_0x5ac6d8[_0x5629('0x54')]);def['uri']=util[_0x5629('0x26')](_0x5629('0x56'),_0x5ac6d8['remoteUri']);if(_0x25e9ed&&_0x25e9ed[_0x5629('0x73')]){logger[_0x5629('0xc')]('['+_0x14e550[_0x5629('0x74')]['toUpperCase']()+']',_0x5629('0x57'));_0x14e550[_0x5629('0x58')]=util[_0x5629('0x26')](_0x5629('0x69'),_0x5ac6d8['serverUrl'],_0x14e550[_0x5629('0x6a')],md5(_0x14e550[_0x5629('0x6a')]));}else{_0x14e550[_0x5629('0x58')]='';}return getConnection(_0x5ac6d8)[_0x5629('0x39')](function(_0x2ee1ce){_0x9ec25a=_0x2ee1ce;if(!_[_0x5629('0x75')](_0xd8308f)){return getUser(_0x5ac6d8,_0xd8308f[_0x5629('0xd')],_0x9ec25a);}else{return getUser(_0x5ac6d8,null,_0x9ec25a);}})[_0x5629('0x39')](function(_0x84f558){_0x1aa72e=_0x84f558;logger['info'](_0x5629('0x59'),_0x1aa72e['id']);return getEndUser(_0x5ac6d8,_0x14e550[_0x5629('0x76')],_0x14e550['calleridnum'],_0x9ec25a);})[_0x5629('0x39')](function(_0x2bd03c){_0x417d55=_0x2bd03c;logger[_0x5629('0xc')]('The\x20Enduser\x20ID\x20is:',_0x417d55['id']);return getTicket(_0x5ac6d8,_0x1aa72e,_0x417d55,_0x5e5994,_0x14e550,_0x5e5994['Fields'],_0x9ec25a,_0x5629('0x5c'));})[_0x5629('0x39')](function(_0x1e32e2){_0x1b1693=_0x1e32e2;logger['info'](_0x5629('0x5d'));logger['info'](_0x5629('0x5e'),_0x1b1693['id']);return setRelationship(_0x9ec25a,_0x1aa72e,_0x1b1693,_0x5629('0x5f'));})['then'](function(){return setRelationship(_0x9ec25a,_0x417d55,_0x1b1693,_0x5629('0x60'));})['then'](function(){return getServerInfo(_0x9ec25a);})[_0x5629('0x65')](function(_0x2b973f){logger[_0x5629('0x72')]('['+_0x14e550[_0x5629('0x74')][_0x5629('0x77')]()+']',JSON['stringify'](_0x2b973f));});}; \ No newline at end of file +var _0x1ea1=['set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','type','string','customField','toLowerCase','content','custom_fields','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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','user:%s','trigger:browser:url','catch','outbound','uri','recordingFormat','[OUTBOUND]','destcalleridname','Outbound','users','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','Subjects','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','idField'];(function(_0x2c6d9d,_0x2002ac){var _0xf72ead=function(_0x5b9a14){while(--_0x5b9a14){_0x2c6d9d['push'](_0x2c6d9d['shift']());}};_0xf72ead(++_0x2002ac);}(_0x1ea1,0x1cd));var _0x11ea=function(_0x5af875,_0x54386c){_0x5af875=_0x5af875-0x0;var _0x440ada=_0x1ea1[_0x5af875];return _0x440ada;};'use strict';var _=require(_0x11ea('0x0'));var rp=require(_0x11ea('0x1'));var BPromise=require(_0x11ea('0x2'));var md5=require(_0x11ea('0x3'));var util=require(_0x11ea('0x4'));var Redis=require(_0x11ea('0x5'));var intUtil=require(_0x11ea('0x6'));var config=require('../../../../config/environment');var logger=require(_0x11ea('0x7'))(_0x11ea('0x8'));config[_0x11ea('0x9')]=_[_0x11ea('0xa')](config[_0x11ea('0x9')],{'host':_0x11ea('0xb'),'port':0x18eb});var io=require(_0x11ea('0xc'))(new Redis(config[_0x11ea('0x9')]));var def={'method':_0x11ea('0xd'),'json':!![]};function emit(_0x1529ee,_0xd56ddb,_0xdab75f){io['to'](_0x1529ee)[_0x11ea('0xe')](_0xd56ddb,_0xdab75f);}function getTicket(_0x57e25a,_0x1f0282,_0x12d06a,_0x4389ed,_0x24dcdb,_0x3b860c,_0x27e770,_0x2e875e){logger[_0x11ea('0xf')](_0x11ea('0x10'));var _0x57f1a5=new Date();var _0x333e17=[{'name':'name','value':intUtil['getString'](_0x4389ed[_0x11ea('0x11')],_0x24dcdb,'\x20')},{'name':'assigned_user_id','value':_0x1f0282['id']},{'name':_0x11ea('0x12'),'value':_0x1f0282['id']},{'name':_0x11ea('0x13'),'value':intUtil[_0x11ea('0x14')](_0x4389ed[_0x11ea('0x15')],_0x24dcdb,'\x0a')},{'name':_0x11ea('0x16'),'value':_0x57f1a5[_0x11ea('0x17')]()[_0x11ea('0x18')](0x0,0x13)[_0x11ea('0x19')]('T','\x20')},{'name':_0x11ea('0x1a'),'value':'0'},{'name':_0x11ea('0x1b'),'value':'15'},{'name':_0x11ea('0x1c'),'value':_0x12d06a['id']},{'name':_0x11ea('0x1d'),'value':_0x11ea('0x1e')},{'name':_0x11ea('0x1f'),'value':_0x12d06a[_0x11ea('0x20')]},{'name':_0x11ea('0x21'),'value':_0x2e875e}];if(_0x3b860c[_0x11ea('0x22')]){_[_0x11ea('0x23')](_0x3b860c,function(_0x8a971d){if(_0x24dcdb[_0x8a971d[_0x11ea('0x24')]]){_0x333e17[_0x11ea('0x25')]({'name':_0x8a971d[_0x11ea('0x26')],'value':_0x24dcdb[_0x8a971d['variableName']]});}});}return request({'form':{'method':_0x11ea('0x27'),'input_type':'JSON','response_type':_0x11ea('0x28'),'rest_data':JSON[_0x11ea('0x29')]({'session':_0x27e770['id'],'module_name':_0x11ea('0x2a'),'name_value_list':_0x333e17})}});}function getAuth(_0x302c27){return util[_0x11ea('0x2b')](_0x11ea('0x2c'),new Buffer(_0x302c27['apiKey']+':X')[_0x11ea('0x2d')]('base64'));}function getServerInfo(_0x56d9f6){return request({'form':{'method':'get_server_info','input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'session':_0x56d9f6['id']})}});}function getUser(_0x460366,_0x5a83d5,_0x1e1261){if(!_[_0x11ea('0x2e')](_0x5a83d5)){logger['info'](_0x11ea('0x2f'),_0x5a83d5);return request({'form':{'method':_0x11ea('0x30'),'input_type':'JSON','response_type':_0x11ea('0x28'),'rest_data':JSON[_0x11ea('0x29')]({'session':_0x1e1261['id'],'module_name':_0x11ea('0x31'),'query':util[_0x11ea('0x2b')](_0x11ea('0x32'),_0x5a83d5),'order_by':'','offset':'0','select_fields':['id',_0x11ea('0x20'),_0x11ea('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x11ea('0x34')](function(_0x409fb2){if(_0x409fb2[_0x11ea('0x35')][_0x11ea('0x22')]){var _0x44798d=_['find'](_0x409fb2[_0x11ea('0x35')],function(_0xdc42ff){return _0xdc42ff[_0x11ea('0x36')][_0x11ea('0x33')][_0x11ea('0x37')]===_0x5a83d5;});if(_0x44798d){logger[_0x11ea('0xf')](_0x11ea('0x38'));return BPromise[_0x11ea('0x39')]({'id':_0x44798d[_0x11ea('0x36')]['id'][_0x11ea('0x37')],'name':_0x44798d[_0x11ea('0x36')][_0x11ea('0x20')]['value']});}}logger[_0x11ea('0xf')](_0x11ea('0x3a'));return BPromise[_0x11ea('0x39')]({'id':_0x1e1261['name_value_list'][_0x11ea('0x3b')][_0x11ea('0x37')],'name':_0x1e1261[_0x11ea('0x36')]['user_name']['value']});});}else{logger[_0x11ea('0xf')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x11ea('0x39')]({'id':_0x1e1261['name_value_list'][_0x11ea('0x3b')][_0x11ea('0x37')],'name':_0x1e1261[_0x11ea('0x36')][_0x11ea('0x33')][_0x11ea('0x37')]});}}function getEndUser(_0x246eba,_0x3afe46,_0x4f1862,_0x52d493){logger[_0x11ea('0xf')](_0x11ea('0x3c'),_0x4f1862);return request({'form':{'method':_0x11ea('0x30'),'input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'session':_0x52d493['id'],'module_name':_0x11ea('0x1e'),'query':util[_0x11ea('0x2b')](_0x11ea('0x3d'),_0x4f1862),'order_by':'','offset':'0','select_fields':['id','name',_0x11ea('0x3e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x11ea('0x34')](function(_0x3f0ca4){if(_0x3f0ca4[_0x11ea('0x35')][_0x11ea('0x22')]){var _0xf8669=_[_0x11ea('0x3f')](_0x3f0ca4['entry_list'],function(_0x2051a2){return _0x2051a2[_0x11ea('0x36')][_0x11ea('0x3e')][_0x11ea('0x37')]===_0x4f1862;});if(_0xf8669){logger[_0x11ea('0xf')](_0x11ea('0x40'));return BPromise[_0x11ea('0x39')]({'id':_0xf8669[_0x11ea('0x36')]['id'][_0x11ea('0x37')],'name':_0xf8669[_0x11ea('0x36')][_0x11ea('0x20')][_0x11ea('0x37')],'phone':_0xf8669[_0x11ea('0x36')][_0x11ea('0x3e')][_0x11ea('0x37')]});}}else{logger['info'](_0x11ea('0x41'));return request({'form':{'method':_0x11ea('0x27'),'input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'session':_0x52d493['id'],'module_name':_0x11ea('0x1e'),'name_value_list':[{'name':_0x11ea('0x42'),'value':_0x3afe46!==_0x11ea('0x43')?_0x3afe46:util['format'](_0x11ea('0x44'),_0x4f1862)},{'name':'phone_home','value':_0x4f1862}]})}})[_0x11ea('0x34')](function(_0xa928b6){logger[_0x11ea('0xf')]('Enduser\x20created.');return BPromise['resolve']({'id':_0xa928b6['id'],'name':_0xa928b6[_0x11ea('0x35')][_0x11ea('0x42')][_0x11ea('0x37')],'phone':_0xa928b6['entry_list'][_0x11ea('0x3e')][_0x11ea('0x37')]});});}});}function request(_0x415372){logger[_0x11ea('0x45')](_0x11ea('0x46'),JSON[_0x11ea('0x29')](_0x415372));return rp(_[_0x11ea('0x47')](def,_0x415372));}function getTags(_0x5cb6c6,_0x582472){var _0x4b938a=[];if(_0x5cb6c6&&_0x5cb6c6[_0x11ea('0x22')]>0x0){_0x4b938a=_['map'](_0x5cb6c6,_0x582472);}return _0x4b938a;}function getCustomFields(_0x51c7f9,_0x218830){var _0xfedbf5=[];var _0xa75e7d={'custom_fields':[]};if(_0x51c7f9[_0x11ea('0x22')]>0x0){_[_0x11ea('0x23')](_0x51c7f9,function(_0x22425f){if(_0x22425f[_0x11ea('0x48')]===_0x11ea('0x49')&&_0x22425f['nameField']&&!_0x22425f[_0x11ea('0x4a')]){_0xa75e7d[_0x22425f['nameField'][_0x11ea('0x4b')]()]=_0x22425f[_0x11ea('0x4c')][_0x11ea('0x2d')]();}else if(_0x22425f['type']===_0x11ea('0x49')&&_0x22425f[_0x11ea('0x26')]&&_0x22425f[_0x11ea('0x4a')]){_0xa75e7d[_0x11ea('0x4d')][_0x11ea('0x25')]({'id':_0x22425f[_0x11ea('0x26')],'value':_0x22425f[_0x11ea('0x4c')][_0x11ea('0x2d')]()});}else if(_0x22425f[_0x11ea('0x48')]==='variable'&&_0x22425f['variableName']&&_0x22425f[_0x11ea('0x26')]&&_0x22425f[_0x11ea('0x4a')]){_0x218830[_0x22425f[_0x11ea('0x24')]]&&_0xa75e7d[_0x11ea('0x4d')][_0x11ea('0x25')]({'id':_0x22425f[_0x11ea('0x26')],'value':_0x218830[_0x22425f['variableName']][_0x11ea('0x2d')]()});}else if(_0x22425f[_0x11ea('0x48')]===_0x11ea('0x4e')&&_0x22425f[_0x11ea('0x4f')]&&_0x22425f['Variable'][_0x11ea('0x20')]&&_0x22425f[_0x11ea('0x26')]&&_0x22425f[_0x11ea('0x4a')]){_0x218830[_0x22425f['Variable'][_0x11ea('0x20')][_0x11ea('0x4b')]()]&&_0xa75e7d[_0x11ea('0x4d')]['push']({'id':_0x22425f['idField'],'value':_0x218830[_0x22425f['Variable'][_0x11ea('0x20')][_0x11ea('0x4b')]()][_0x11ea('0x2d')]()});}});}return _0xa75e7d;}function getConnection(_0x209504){return request({'method':'POST','form':{'method':_0x11ea('0x50'),'input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'user_auth':{'user_name':_0x209504[_0x11ea('0x51')],'password':_0x209504[_0x11ea('0x52')],'encryption':_0x11ea('0x53')},'application':_0x11ea('0x54')})}})[_0x11ea('0x34')](function(_0x46ea8c){var _0x1d8600=_0x46ea8c;if(_0x1d8600['id']){def[_0x11ea('0x55')]=_0x1d8600['id'];return BPromise[_0x11ea('0x39')](_0x1d8600);}else{throw new Error(util[_0x11ea('0x2b')](_0x11ea('0x56'),_0x209504['id']));}});}function setRelationship(_0x5aaffd,_0x45acb4,_0x45905c,_0x3d5cc9){return request({'form':{'method':_0x11ea('0x57'),'input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'session':_0x5aaffd['id'],'module_name':_0x11ea('0x2a'),'module_id':_0x45905c['id'],'link_field_name':_0x3d5cc9,'related_ids':[_0x45acb4['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x1bc212,_0x3e671f,_0x585d82,_0x4ce2dd,_0x589ca1,_0x10d99a){var _0x5f19a1,_0xc56cd3,_0x4355b8,_0xb5c169;_0x10d99a[_0x11ea('0x58')]=intUtil[_0x11ea('0x59')](_0x10d99a[_0x11ea('0x58')]);_0x10d99a[_0x11ea('0x5a')]=intUtil[_0x11ea('0x59')](_0x10d99a[_0x11ea('0x5a')]);def['uri']=util['format'](_0x11ea('0x5b'),_0x10d99a[_0x11ea('0x58')]);if(_0x589ca1&&_0x589ca1[_0x11ea('0x5c')]){logger[_0x11ea('0xf')](_0x11ea('0x5d'),_0x11ea('0x5e'));_0x3e671f['recordingURL']=util[_0x11ea('0x2b')](_0x11ea('0x5f'),_0x10d99a[_0x11ea('0x5a')],_0x3e671f[_0x11ea('0x60')],md5(_0x3e671f[_0x11ea('0x60')]));}else{_0x3e671f[_0x11ea('0x61')]='';}return getConnection(_0x10d99a)[_0x11ea('0x34')](function(_0xa81873){_0xb5c169=_0xa81873;return getUser(_0x10d99a,_0x4ce2dd[_0x11ea('0x20')],_0xb5c169);})[_0x11ea('0x34')](function(_0x244c5a){_0x5f19a1=_0x244c5a;logger[_0x11ea('0xf')](_0x11ea('0x62'),_0x5f19a1['id']);return getEndUser(_0x10d99a,_0x3e671f['calleridname'],_0x3e671f[_0x11ea('0x63')],_0xb5c169);})[_0x11ea('0x34')](function(_0x2f0855){_0xc56cd3=_0x2f0855;logger[_0x11ea('0xf')](_0x11ea('0x64'),_0xc56cd3['id']);return getTicket(_0x10d99a,_0x5f19a1,_0xc56cd3,_0x585d82,_0x3e671f,_0x585d82[_0x11ea('0x65')],_0xb5c169,'Inbound');})[_0x11ea('0x34')](function(_0x26daa4){_0x4355b8=_0x26daa4;logger[_0x11ea('0xf')](_0x11ea('0x66'));logger[_0x11ea('0xf')](_0x11ea('0x67'),_0x4355b8['id']);return setRelationship(_0xb5c169,_0x5f19a1,_0x4355b8,'users');})['then'](function(){return setRelationship(_0xb5c169,_0xc56cd3,_0x4355b8,_0x11ea('0x68'));})['then'](function(){return getServerInfo(_0xb5c169);})[_0x11ea('0x34')](function(_0x38f46a){var _0x39767c=parseInt(_0x38f46a['version'][_0x11ea('0x69')](0x0));var _0x10926a=util[_0x11ea('0x2b')](_0x11ea('0x6a'),_0x10d99a[_0x11ea('0x58')],_0x4355b8['id']);if(_0x39767c>0x6){_0x10926a=util[_0x11ea('0x2b')](_0x11ea('0x6b'),_0x10d99a[_0x11ea('0x58')],_0x4355b8['id']);}logger[_0x11ea('0xf')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x11ea('0x2b')](_0x11ea('0x6c'),_0x4ce2dd[_0x11ea('0x20')]),_0x11ea('0x6d'),{'uri':_0x10926a});})[_0x11ea('0x6e')](function(_0x551a65){logger['error'](_0x11ea('0x5d'),JSON[_0x11ea('0x29')](_0x551a65));});};exports[_0x11ea('0x6f')]=function(_0x4f5631,_0x482d4b,_0x2e5eda,_0x5da66b,_0x461f0b,_0x589d5f,_0x8d3314){var _0x505a03,_0x3abb9b,_0x88c517,_0x515fb9;_0x589d5f['remoteUri']=intUtil['stripTrailingSlash'](_0x589d5f[_0x11ea('0x58')]);_0x589d5f[_0x11ea('0x5a')]=intUtil[_0x11ea('0x59')](_0x589d5f[_0x11ea('0x5a')]);def[_0x11ea('0x70')]=util[_0x11ea('0x2b')](_0x11ea('0x5b'),_0x589d5f[_0x11ea('0x58')]);if(_0x8d3314&&_0x8d3314[_0x11ea('0x71')]&&_0x8d3314[_0x11ea('0x71')]!=='none'){logger[_0x11ea('0xf')](_0x11ea('0x72'),_0x11ea('0x5e'));_0x482d4b[_0x11ea('0x61')]=util[_0x11ea('0x2b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x589d5f[_0x11ea('0x5a')],_0x482d4b['uniqueid'],md5(_0x482d4b['uniqueid']));}return getConnection(_0x589d5f)['then'](function(_0x13ee47){_0x515fb9=_0x13ee47;return getUser(_0x589d5f,_0x5da66b[_0x11ea('0x20')],_0x515fb9);})['then'](function(_0x2b7ce3){_0x505a03=_0x2b7ce3;logger[_0x11ea('0xf')]('The\x20User\x20ID\x20is:',_0x505a03['id']);return getEndUser(_0x589d5f,_0x482d4b[_0x11ea('0x73')],_0x482d4b['destcalleridnum'],_0x515fb9);})[_0x11ea('0x34')](function(_0x32c8d2){_0x3abb9b=_0x32c8d2;logger['info'](_0x11ea('0x64'),_0x3abb9b['id']);return getTicket(_0x589d5f,_0x505a03,_0x3abb9b,_0x2e5eda,_0x482d4b,_0x2e5eda[_0x11ea('0x65')],_0x515fb9,_0x11ea('0x74'));})[_0x11ea('0x34')](function(_0x186cfb){_0x88c517=_0x186cfb;logger['info'](_0x11ea('0x66'));logger[_0x11ea('0xf')](_0x11ea('0x67'),_0x88c517['id']);return setRelationship(_0x515fb9,_0x505a03,_0x88c517,_0x11ea('0x75'));})['then'](function(){return setRelationship(_0x515fb9,_0x3abb9b,_0x88c517,_0x11ea('0x68'));})[_0x11ea('0x34')](function(){return getServerInfo(_0x515fb9);})[_0x11ea('0x34')](function(_0x253c9f){var _0x21a149=parseInt(_0x253c9f[_0x11ea('0x76')]['charAt'](0x0));var _0x4475ab=util[_0x11ea('0x2b')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x589d5f['remoteUri'],_0x88c517['id']);if(_0x21a149>0x6){_0x4475ab=util[_0x11ea('0x2b')](_0x11ea('0x6b'),_0x589d5f[_0x11ea('0x58')],_0x88c517['id']);}logger[_0x11ea('0xf')](_0x11ea('0x72'),_0x11ea('0x77'));emit(util[_0x11ea('0x2b')](_0x11ea('0x6c'),_0x5da66b[_0x11ea('0x20')]),'trigger:browser:url',{'uri':_0x4475ab});})[_0x11ea('0x6e')](function(_0x54fe50){logger[_0x11ea('0x78')]('[OUTBOUND]',JSON['stringify'](_0x54fe50));});};exports[_0x11ea('0x79')]=function(_0x1f2b0b,_0x425f1f,_0x3aab2c,_0x513bc6,_0x5a0edf,_0x2e0b91){var _0x83b2ec,_0x445f88,_0x401a10,_0x168044;_0x2e0b91[_0x11ea('0x58')]=intUtil[_0x11ea('0x59')](_0x2e0b91['remoteUri']);_0x2e0b91[_0x11ea('0x5a')]=intUtil[_0x11ea('0x59')](_0x2e0b91[_0x11ea('0x5a')]);def['uri']=util[_0x11ea('0x2b')](_0x11ea('0x5b'),_0x2e0b91[_0x11ea('0x58')]);if(_0x5a0edf&&_0x5a0edf[_0x11ea('0x5c')]){logger[_0x11ea('0xf')]('['+_0x425f1f[_0x11ea('0x7a')][_0x11ea('0x7b')]()+']','Recording\x20is\x20enabled!');_0x425f1f[_0x11ea('0x61')]=util[_0x11ea('0x2b')](_0x11ea('0x5f'),_0x2e0b91[_0x11ea('0x5a')],_0x425f1f[_0x11ea('0x60')],md5(_0x425f1f[_0x11ea('0x60')]));}else{_0x425f1f[_0x11ea('0x61')]='';}return getConnection(_0x2e0b91)['then'](function(_0xf5c261){_0x168044=_0xf5c261;if(!_[_0x11ea('0x2e')](_0x513bc6)){return getUser(_0x2e0b91,_0x513bc6[_0x11ea('0x20')],_0x168044);}else{return getUser(_0x2e0b91,null,_0x168044);}})[_0x11ea('0x34')](function(_0x3ed91d){_0x83b2ec=_0x3ed91d;logger[_0x11ea('0xf')](_0x11ea('0x62'),_0x83b2ec['id']);return getEndUser(_0x2e0b91,_0x425f1f[_0x11ea('0x7c')],_0x425f1f[_0x11ea('0x63')],_0x168044);})[_0x11ea('0x34')](function(_0x329e31){_0x445f88=_0x329e31;logger[_0x11ea('0xf')](_0x11ea('0x64'),_0x445f88['id']);return getTicket(_0x2e0b91,_0x83b2ec,_0x445f88,_0x3aab2c,_0x425f1f,_0x3aab2c[_0x11ea('0x65')],_0x168044,'Inbound');})['then'](function(_0x15208e){_0x401a10=_0x15208e;logger[_0x11ea('0xf')](_0x11ea('0x66'));logger[_0x11ea('0xf')]('The\x20Ticket\x20ID\x20is:',_0x401a10['id']);return setRelationship(_0x168044,_0x83b2ec,_0x401a10,_0x11ea('0x75'));})[_0x11ea('0x34')](function(){return setRelationship(_0x168044,_0x445f88,_0x401a10,_0x11ea('0x68'));})[_0x11ea('0x34')](function(){return getServerInfo(_0x168044);})[_0x11ea('0x6e')](function(_0x317407){logger[_0x11ea('0x78')]('['+_0x425f1f[_0x11ea('0x7a')]['toUpperCase']()+']',JSON[_0x11ea('0x29')](_0x317407));});}; \ 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 78d8358..d4dc17c 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 _0xf988=['toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','format','customVariable','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','Variable','name'];(function(_0x2459d6,_0x3caa97){var _0x5d0a77=function(_0x43121e){while(--_0x43121e){_0x2459d6['push'](_0x2459d6['shift']());}};_0x5d0a77(++_0x3caa97);}(_0xf988,0x14e));var _0x8f98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf988[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8f98('0x0'));var util=require(_0x8f98('0x1'));exports[_0x8f98('0x2')]=function(_0x2619b1,_0x5b9a99,_0xf35434){var _0x23a4b9=[];if(_0x2619b1[_0x8f98('0x3')]>0x0){var _0x277cd1=_[_0x8f98('0x4')](_0x2619b1,['id']);for(var _0x14bb45=0x0;_0x14bb45<_0x277cd1['length'];_0x14bb45++){var _0x226930=_0x277cd1[_0x14bb45];if(_0x226930[_0x8f98('0x5')]===_0x8f98('0x6')){_0x23a4b9[_0x8f98('0x7')](_0x226930[_0x8f98('0x8')]);}else if(_0x226930[_0x8f98('0x5')]===_0x8f98('0x9')&&_0x226930[_0x8f98('0xa')]){_0x5b9a99[_0x226930[_0x8f98('0xa')]]&&_0x23a4b9[_0x8f98('0x7')](_0x5b9a99[_0x226930[_0x8f98('0xa')]][_0x8f98('0xb')]());}else if(_0x226930['type']==='customVariable'&&_0x226930[_0x8f98('0xc')]&&_0x226930[_0x8f98('0xc')][_0x8f98('0xd')]){_0x5b9a99[_0x226930['Variable']['name'][_0x8f98('0xe')]()]&&_0x23a4b9[_0x8f98('0x7')](_0x5b9a99[_0x226930[_0x8f98('0xc')][_0x8f98('0xd')][_0x8f98('0xe')]()][_0x8f98('0xb')]());}else if(_0x226930[_0x8f98('0x5')]===_0x8f98('0xf')){if(_0x226930[_0x8f98('0x10')]===_0x8f98('0x6')&&_0x226930[_0x8f98('0x11')]){_0x23a4b9[_0x8f98('0x7')](util['format'](_0x8f98('0x12'),_0x226930['key'],_0x226930[_0x8f98('0x13')]));}else if(_0x226930[_0x8f98('0x10')]===_0x8f98('0x9')&&_0x226930[_0x8f98('0xa')]&&_0x226930[_0x8f98('0x11')]){_0x5b9a99[_0x226930['variableName']]&&_0x23a4b9[_0x8f98('0x7')](util[_0x8f98('0x14')](_0x8f98('0x12'),_0x226930[_0x8f98('0x11')],_0x5b9a99[_0x226930[_0x8f98('0xa')]]));}else if(_0x226930[_0x8f98('0x10')]===_0x8f98('0x15')&&_0x226930[_0x8f98('0xc')]&&_0x226930[_0x8f98('0xc')][_0x8f98('0xd')]&&_0x226930['key']){_0x5b9a99[_0x226930[_0x8f98('0xc')][_0x8f98('0xd')][_0x8f98('0xe')]()]&&_0x23a4b9[_0x8f98('0x7')](util[_0x8f98('0x14')](_0x8f98('0x12'),_0x226930[_0x8f98('0x11')],_0x5b9a99[_0x226930[_0x8f98('0xc')][_0x8f98('0xd')][_0x8f98('0xe')]()]));}}}}return _0x23a4b9[_0x8f98('0x16')](_0xf35434);};exports[_0x8f98('0x17')]=function(_0x156261){var _0xf8e3b8=_0x156261[_0x8f98('0x18')](-0x1);if(_0xf8e3b8==='/'){_0x156261=_0x156261[_0x8f98('0x19')](0x0,_0x156261['lastIndexOf'](_0xf8e3b8));}return _0x156261;};exports[_0x8f98('0x1a')]=function(_0x16873c){if(!_[_0x8f98('0x1b')](_0x16873c)&&_0x16873c!==''){var _0x557de1=/^(([^<>()\[\]\\.,;:\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 _0x557de1[_0x8f98('0x1c')](String(_0x16873c)[_0x8f98('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xec58=['toLowerCase','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','sortBy','length','type','string','push','content','variableName','toString','Variable','name','keyValue','key','format','%s:\x20%s','keyContent','keyType','variable'];(function(_0xa82f36,_0x4c34f3){var _0x220080=function(_0xff66d6){while(--_0xff66d6){_0xa82f36['push'](_0xa82f36['shift']());}};_0x220080(++_0x4c34f3);}(_0xec58,0x1b7));var _0x8ec5=function(_0x317497,_0x2d6cf7){_0x317497=_0x317497-0x0;var _0x3445b0=_0xec58[_0x317497];return _0x3445b0;};'use strict';var _=require('lodash');var util=require('util');exports['getString']=function(_0x3514b6,_0x24b484,_0x268623){var _0x3b23ca=[];if(_0x3514b6['length']>0x0){var _0x29ec9d=_[_0x8ec5('0x0')](_0x3514b6,['id']);for(var _0x486909=0x0;_0x486909<_0x29ec9d[_0x8ec5('0x1')];_0x486909++){var _0x2d5d83=_0x29ec9d[_0x486909];if(_0x2d5d83[_0x8ec5('0x2')]===_0x8ec5('0x3')){_0x3b23ca[_0x8ec5('0x4')](_0x2d5d83[_0x8ec5('0x5')]);}else if(_0x2d5d83[_0x8ec5('0x2')]==='variable'&&_0x2d5d83[_0x8ec5('0x6')]){_0x24b484[_0x2d5d83[_0x8ec5('0x6')]]&&_0x3b23ca[_0x8ec5('0x4')](_0x24b484[_0x2d5d83['variableName']][_0x8ec5('0x7')]());}else if(_0x2d5d83[_0x8ec5('0x2')]==='customVariable'&&_0x2d5d83[_0x8ec5('0x8')]&&_0x2d5d83[_0x8ec5('0x8')]['name']){_0x24b484[_0x2d5d83[_0x8ec5('0x8')][_0x8ec5('0x9')]['toLowerCase']()]&&_0x3b23ca[_0x8ec5('0x4')](_0x24b484[_0x2d5d83[_0x8ec5('0x8')][_0x8ec5('0x9')]['toLowerCase']()][_0x8ec5('0x7')]());}else if(_0x2d5d83['type']===_0x8ec5('0xa')){if(_0x2d5d83['keyType']==='string'&&_0x2d5d83[_0x8ec5('0xb')]){_0x3b23ca[_0x8ec5('0x4')](util[_0x8ec5('0xc')](_0x8ec5('0xd'),_0x2d5d83[_0x8ec5('0xb')],_0x2d5d83[_0x8ec5('0xe')]));}else if(_0x2d5d83[_0x8ec5('0xf')]===_0x8ec5('0x10')&&_0x2d5d83[_0x8ec5('0x6')]&&_0x2d5d83['key']){_0x24b484[_0x2d5d83['variableName']]&&_0x3b23ca[_0x8ec5('0x4')](util[_0x8ec5('0xc')]('%s:\x20%s',_0x2d5d83[_0x8ec5('0xb')],_0x24b484[_0x2d5d83[_0x8ec5('0x6')]]));}else if(_0x2d5d83[_0x8ec5('0xf')]==='customVariable'&&_0x2d5d83['Variable']&&_0x2d5d83['Variable'][_0x8ec5('0x9')]&&_0x2d5d83[_0x8ec5('0xb')]){_0x24b484[_0x2d5d83[_0x8ec5('0x8')]['name'][_0x8ec5('0x11')]()]&&_0x3b23ca[_0x8ec5('0x4')](util[_0x8ec5('0xc')]('%s:\x20%s',_0x2d5d83[_0x8ec5('0xb')],_0x24b484[_0x2d5d83['Variable'][_0x8ec5('0x9')][_0x8ec5('0x11')]()]));}}}}return _0x3b23ca['join'](_0x268623);};exports[_0x8ec5('0x12')]=function(_0x55ad61){var _0x1cf00d=_0x55ad61[_0x8ec5('0x13')](-0x1);if(_0x1cf00d==='/'){_0x55ad61=_0x55ad61['substring'](0x0,_0x55ad61[_0x8ec5('0x14')](_0x1cf00d));}return _0x55ad61;};exports[_0x8ec5('0x15')]=function(_0x54faca){if(!_[_0x8ec5('0x16')](_0x54faca)&&_0x54faca!==''){var _0x559ae1=/^(([^<>()\[\]\\.,;:\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 _0x559ae1[_0x8ec5('0x17')](String(_0x54faca)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 4bb1081..f93d686 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x380e53,_0x4b1203){var _0x4dd7bf=function(_0x465ffe){while(--_0x465ffe){_0x380e53['push'](_0x380e53['shift']());}};_0x4dd7bf(++_0x4b1203);}(_0xe706,0xa3));var _0x6e70=function(_0x455284,_0x383648){_0x455284=_0x455284-0x0;var _0x3e70dc=_0xe706[_0x455284];return _0x3e70dc;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x560d2a,_0x4a9f54){var _0x3df62d=function(_0x1ce1ec){while(--_0x1ce1ec){_0x560d2a['push'](_0x560d2a['shift']());}};_0x3df62d(++_0x4a9f54);}(_0xe706,0xa3));var _0x6e70=function(_0x43d0dd,_0x1bd3d2){_0x43d0dd=_0x43d0dd-0x0;var _0x233879=_0xe706[_0x43d0dd];return _0x233879;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 6324841..b9f5196 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 _0xd64d=['request-promise','md5','util','./util','../../../../config/logger','zendesk','redis','socket.io-emitter','application/json','format','%s/tickets.json','POST','merge','name','getString','Subjects','Descriptions','Fields','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','then','find','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','%s/token:%s','token','Basic\x20%s','base64','debug','[HTTP]','map','forEach','string','picklist','nameField','content','toString','type','idField','customField','variable','variableName','custom_fields','push','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration'];(function(_0x388369,_0x11f081){var _0x4f5fbe=function(_0x23133a){while(--_0x23133a){_0x388369['push'](_0x388369['shift']());}};_0x4f5fbe(++_0x11f081);}(_0xd64d,0x6c));var _0xdd64=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd64d[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var rp=require(_0xdd64('0x0'));var md5=require(_0xdd64('0x1'));var util=require(_0xdd64('0x2'));var Redis=require('ioredis');var intUtil=require(_0xdd64('0x3'));var config=require('../../../../config/environment');var logger=require(_0xdd64('0x4'))(_0xdd64('0x5'));config[_0xdd64('0x6')]=_['defaults'](config[_0xdd64('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xdd64('0x7'))(new Redis(config[_0xdd64('0x6')]));function emit(_0x1549da,_0x24ea89,_0x561100){io['to'](_0x1549da)['emit'](_0x24ea89,_0x561100);}var headers={'Content-Type':_0xdd64('0x8'),'Accept':_0xdd64('0x8')};function getTicket(_0x4ee90d,_0x3bb096,_0x1a5343,_0x2c4559,_0x6c2249){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xdd64('0x9')](_0xdd64('0xa'),_0x4ee90d['remoteUri']),'method':_0xdd64('0xb'),'body':{'ticket':_[_0xdd64('0xc')]({'requester_id':_0x1a5343['id'],'submitter_id':_0x3bb096?_0x3bb096['id']:undefined,'assignee_id':_0x3bb096?_0x3bb096['id']:undefined,'tags':getTags(_0x2c4559['Tags'],_0xdd64('0xd')),'subject':intUtil[_0xdd64('0xe')](_0x2c4559[_0xdd64('0xf')],_0x6c2249,'\x20'),'description':intUtil['getString'](_0x2c4559[_0xdd64('0x10')],_0x6c2249,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2c4559[_0xdd64('0x10')],_0x6c2249,'\x0a')}},getCustomFields(_0x2c4559[_0xdd64('0x11')],_0x6c2249))}})['then'](function(_0x7bc7c0){logger[_0xdd64('0x12')](_0xdd64('0x13'));return _0x7bc7c0[_0xdd64('0x14')];});}function getUser(_0x388eb3,_0x3c2246){if(intUtil[_0xdd64('0x15')](_0x3c2246)){logger[_0xdd64('0x12')](_0xdd64('0x16'),_0x3c2246);return request({'uri':util[_0xdd64('0x9')](_0xdd64('0x17'),_0x388eb3[_0xdd64('0x18')]),'qs':{'query':util[_0xdd64('0x9')](_0xdd64('0x19'),_0x3c2246)}})[_0xdd64('0x1a')](function(_0x31782a){if(_0x31782a['count']){logger[_0xdd64('0x12')]('Agent\x20found!');return _[_0xdd64('0x1b')](_0x31782a['results'],{'email':_0x3c2246,'role':'agent'});}else{logger[_0xdd64('0x12')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xdd64('0x1c'),_0x388eb3['remoteUri'])})['then'](function(_0x410a0b){logger[_0xdd64('0x12')](_0xdd64('0x1d'));return _0x410a0b['user'];});}});}else{logger[_0xdd64('0x12')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x388eb3[_0xdd64('0x18')])})[_0xdd64('0x1a')](function(_0x1658f9){logger['info'](_0xdd64('0x1d'));return _0x1658f9[_0xdd64('0x1e')];});}}function getEndUser(_0x236ca3,_0x4df59e,_0x4b741a){logger[_0xdd64('0x12')](_0xdd64('0x1f'),_0x4b741a);return request({'uri':util[_0xdd64('0x9')](_0xdd64('0x17'),_0x236ca3[_0xdd64('0x18')]),'qs':{'query':util[_0xdd64('0x9')](_0xdd64('0x20'),_0x4b741a)}})['then'](function(_0x34efb3){var _0x4cfdd2;if(_0x34efb3[_0xdd64('0x21')]['length']){_0x34efb3[_0xdd64('0x21')]=_[_0xdd64('0x22')](_0x34efb3[_0xdd64('0x21')],{'suspended':![],'role':_0xdd64('0x23')});if(_0x34efb3[_0xdd64('0x21')][_0xdd64('0x24')]){_0x4cfdd2=_[_0xdd64('0x25')](_0x34efb3['results']);}}if(_0x4cfdd2){logger[_0xdd64('0x12')](_0xdd64('0x26'));return _0x4cfdd2;}else{logger[_0xdd64('0x12')](_0xdd64('0x27'));return request({'uri':util[_0xdd64('0x9')](_0xdd64('0x28'),_0x236ca3[_0xdd64('0x18')]),'method':_0xdd64('0xb'),'body':{'user':{'role':'end-user','name':util[_0xdd64('0x9')](_0xdd64('0x29'),_0x4df59e||_0x4b741a),'phone':_0x4b741a}}})[_0xdd64('0x1a')](function(_0x4514c5){logger[_0xdd64('0x12')](_0xdd64('0x2a'));return _0x4514c5[_0xdd64('0x1e')];});}});}function getAuth(_0x21a790){var _0x11beda;if(_0x21a790['authType']===_0xdd64('0x2b')){_0x11beda=util['format']('%s:%s',_0x21a790[_0xdd64('0x2c')],_0x21a790[_0xdd64('0x2b')]);}else if(_0x21a790[_0xdd64('0x2d')]==='token'){_0x11beda=util[_0xdd64('0x9')](_0xdd64('0x2e'),_0x21a790['username'],_0x21a790[_0xdd64('0x2f')]);}return util[_0xdd64('0x9')](_0xdd64('0x30'),new Buffer(_0x11beda)['toString'](_0xdd64('0x31')));}function request(_0x19eed3){logger[_0xdd64('0x32')](_0xdd64('0x33'),JSON['stringify'](_0x19eed3));return rp(_['defaults'](_0x19eed3,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4a707c,_0x5e3114){var _0xf1fbfc=[];if(_0x4a707c&&_0x4a707c[_0xdd64('0x24')]>0x0){_0xf1fbfc=_[_0xdd64('0x34')](_0x4a707c,_0x5e3114);}return _0xf1fbfc;}function getCustomFields(_0x3b47b3,_0x1d1c3a){var _0x1e7d36=[];var _0x2857a1={'custom_fields':[]};if(_0x3b47b3[_0xdd64('0x24')]>0x0){_[_0xdd64('0x35')](_0x3b47b3,function(_0x2f289c){if(_['includes']([_0xdd64('0x36'),_0xdd64('0x37')],_0x2f289c['type'])&&_0x2f289c[_0xdd64('0x38')]&&!_0x2f289c['customField']){_0x2857a1[_0x2f289c[_0xdd64('0x38')]['toLowerCase']()]=_0x2f289c[_0xdd64('0x39')][_0xdd64('0x3a')]();}else if(_['includes']([_0xdd64('0x36'),_0xdd64('0x37')],_0x2f289c[_0xdd64('0x3b')])&&_0x2f289c[_0xdd64('0x3c')]&&_0x2f289c[_0xdd64('0x3d')]){_0x2857a1['custom_fields']['push']({'id':_0x2f289c[_0xdd64('0x3c')],'value':_0x2f289c[_0xdd64('0x39')][_0xdd64('0x3a')]()});}else if(_0x2f289c['type']===_0xdd64('0x3e')&&_0x2f289c['variableName']&&_0x2f289c[_0xdd64('0x3c')]&&_0x2f289c[_0xdd64('0x3d')]){_0x1d1c3a[_0x2f289c[_0xdd64('0x3f')]]&&_0x2857a1[_0xdd64('0x40')][_0xdd64('0x41')]({'id':_0x2f289c[_0xdd64('0x3c')],'value':_0x1d1c3a[_0x2f289c[_0xdd64('0x3f')]][_0xdd64('0x3a')]()});}else if(_0x2f289c[_0xdd64('0x3b')]===_0xdd64('0x42')&&_0x2f289c[_0xdd64('0x43')]&&_0x2f289c['Variable'][_0xdd64('0xd')]&&_0x2f289c[_0xdd64('0x3c')]&&_0x2f289c[_0xdd64('0x3d')]){_0x1d1c3a[_0x2f289c[_0xdd64('0x43')][_0xdd64('0xd')]['toLowerCase']()]&&_0x2857a1[_0xdd64('0x40')][_0xdd64('0x41')]({'id':_0x2f289c[_0xdd64('0x3c')],'value':_0x1d1c3a[_0x2f289c[_0xdd64('0x43')]['name'][_0xdd64('0x44')]()][_0xdd64('0x3a')]()});}});}return _0x2857a1;}exports['queue']=function(_0xdfdf7d,_0x3116f0,_0xb27ed9,_0x558ab5,_0x5ad2ac,_0x1a9316){var _0x2abb1c,_0x145f6f;_0x1a9316[_0xdd64('0x18')]=intUtil[_0xdd64('0x45')](_0x1a9316[_0xdd64('0x18')]);_0x1a9316[_0xdd64('0x46')]=intUtil[_0xdd64('0x45')](_0x1a9316['serverUrl']);if(_0x5ad2ac&&_0x5ad2ac[_0xdd64('0x47')]){logger['info'](_0xdd64('0x48'),_0xdd64('0x49'));_0x3116f0[_0xdd64('0x4a')]=util[_0xdd64('0x9')](_0xdd64('0x4b'),_0x1a9316[_0xdd64('0x46')],_0x3116f0[_0xdd64('0x4c')],md5(_0x3116f0[_0xdd64('0x4c')]));}else{_0x3116f0[_0xdd64('0x4a')]='';}headers[_0xdd64('0x4d')]=getAuth(_0x1a9316);return getUser(_0x1a9316,_0x558ab5[_0xdd64('0x4e')])[_0xdd64('0x1a')](function(_0x1c806d){_0x2abb1c=_0x1c806d;logger[_0xdd64('0x12')](_0xdd64('0x4f'),_0x2abb1c['id']);return getEndUser(_0x1a9316,_0x3116f0[_0xdd64('0x50')],_0x3116f0['calleridnum']);})[_0xdd64('0x1a')](function(_0x3ed31c){_0x145f6f=_0x3ed31c;logger['info'](_0xdd64('0x51'),_0x145f6f['id']);return getTicket(_0x1a9316,_0x2abb1c,_0x145f6f,_0xb27ed9,_0x3116f0);})['then'](function(_0x314a82){if(_0x314a82){logger[_0xdd64('0x12')](_0xdd64('0x52'),_0x314a82['id']);switch(_0x1a9316[_0xdd64('0x3b')]){case _0xdd64('0x53'):logger[_0xdd64('0x12')](_0xdd64('0x48'),_0xdd64('0x54'));return request({'uri':util[_0xdd64('0x9')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1a9316[_0xdd64('0x18')],_0x2abb1c['id'],_0x314a82['id']),'method':_0xdd64('0xb')});case _0xdd64('0x55'):logger[_0xdd64('0x12')](_0xdd64('0x48'),_0xdd64('0x56'));emit(util['format'](_0xdd64('0x57'),_0x558ab5['name']),'trigger:browser:url',{'uri':util[_0xdd64('0x9')](_0xdd64('0x58'),_0x1a9316[_0xdd64('0x18')][_0xdd64('0x59')]('/api/v2',''),_0x314a82['id'])});break;default:logger[_0xdd64('0x5a')](_0xdd64('0x48'),_0xdd64('0x5b'));}}})[_0xdd64('0x5c')](function(_0x5a4184){logger[_0xdd64('0x5a')](_0xdd64('0x5d'),util[_0xdd64('0x5e')](_0x5a4184,{'showHidden':!![],'depth':null}));});};exports[_0xdd64('0x5f')]=function(_0x51bee1,_0x195112,_0x325a02,_0x383381,_0x43a2d6,_0x15cedd,_0x2202df){var _0x9a8fb2,_0xb23857;_0x15cedd[_0xdd64('0x18')]=intUtil[_0xdd64('0x45')](_0x15cedd[_0xdd64('0x18')]);_0x15cedd[_0xdd64('0x46')]=intUtil['stripTrailingSlash'](_0x15cedd[_0xdd64('0x46')]);if(_0x2202df&&_0x2202df[_0xdd64('0x60')]&&_0x2202df[_0xdd64('0x60')]!=='none'){logger[_0xdd64('0x12')]('[OUTBOUND]',_0xdd64('0x49'));_0x195112[_0xdd64('0x4a')]=util[_0xdd64('0x9')](_0xdd64('0x4b'),_0x15cedd[_0xdd64('0x46')],_0x195112[_0xdd64('0x4c')],md5(_0x195112[_0xdd64('0x4c')]));}headers[_0xdd64('0x4d')]=getAuth(_0x15cedd);return getUser(_0x15cedd,_0x383381['email'])[_0xdd64('0x1a')](function(_0x3c6609){_0x9a8fb2=_0x3c6609;logger[_0xdd64('0x12')](_0xdd64('0x4f'),_0x9a8fb2['id']);return getEndUser(_0x15cedd,_0x195112[_0xdd64('0x61')],_0x195112[_0xdd64('0x62')]);})['then'](function(_0x1f8024){_0xb23857=_0x1f8024;logger[_0xdd64('0x12')](_0xdd64('0x51'),_0xb23857['id']);return getTicket(_0x15cedd,_0x9a8fb2,_0xb23857,_0x325a02,_0x195112);})[_0xdd64('0x1a')](function(_0x5d9399){if(_0x5d9399){logger[_0xdd64('0x12')](_0xdd64('0x52'),_0x5d9399['id']);switch(_0x15cedd['type']){case _0xdd64('0x53'):logger['info']('[OUTBOUND]',_0xdd64('0x54'));return request({'uri':util[_0xdd64('0x9')](_0xdd64('0x63'),_0x15cedd[_0xdd64('0x18')],_0x9a8fb2['id'],_0x5d9399['id']),'method':'POST'});case _0xdd64('0x55'):logger[_0xdd64('0x12')](_0xdd64('0x64'),_0xdd64('0x56'));emit(util['format']('user:%s',_0x383381['name']),_0xdd64('0x65'),{'uri':util[_0xdd64('0x9')]('%s/agent/tickets/%s',_0x15cedd[_0xdd64('0x18')][_0xdd64('0x59')]('/api/v2',''),_0x5d9399['id'])});break;default:logger[_0xdd64('0x5a')](_0xdd64('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xdd64('0x5c')](function(_0x408af4){logger[_0xdd64('0x5a')](_0xdd64('0x66'),util[_0xdd64('0x5e')](_0x408af4,{'showHidden':!![],'depth':null}));});};exports[_0xdd64('0x67')]=function(_0x3c030b,_0x1eb8d7,_0x18c95c,_0x5e1440,_0x4b7e2d,_0x59ab55){var _0xc9f776,_0x471d24;_0x59ab55[_0xdd64('0x18')]=intUtil['stripTrailingSlash'](_0x59ab55[_0xdd64('0x18')]);_0x59ab55[_0xdd64('0x46')]=intUtil['stripTrailingSlash'](_0x59ab55[_0xdd64('0x46')]);if(_0x4b7e2d&&_0x4b7e2d[_0xdd64('0x47')]){logger[_0xdd64('0x12')]('['+_0x1eb8d7[_0xdd64('0x68')][_0xdd64('0x69')]()+']','Recording\x20is\x20enabled!');_0x1eb8d7['recordingURL']=util[_0xdd64('0x9')](_0xdd64('0x4b'),_0x59ab55[_0xdd64('0x46')],_0x1eb8d7[_0xdd64('0x4c')],md5(_0x1eb8d7[_0xdd64('0x4c')]));}else{_0x1eb8d7['recordingURL']='';}headers['Authorization']=getAuth(_0x59ab55);return getUser(_0x59ab55)[_0xdd64('0x1a')](function(_0x3c3cda){_0xc9f776=_0x3c3cda;logger[_0xdd64('0x12')](_0xdd64('0x4f'),_0xc9f776['id']);return getEndUser(_0x59ab55,_0x1eb8d7['calleridname'],_0x1eb8d7[_0xdd64('0x6a')]);})[_0xdd64('0x1a')](function(_0x3499ea){_0x471d24=_0x3499ea;logger['info'](_0xdd64('0x51'),_0x471d24['id']);return getTicket(_0x59ab55,_0xc9f776,_0x471d24,_0x18c95c,_0x1eb8d7);})[_0xdd64('0x1a')](function(_0x3462fb){if(_0x3462fb){logger[_0xdd64('0x12')]('The\x20Ticket\x20ID\x20is:',_0x3462fb['id']);}})[_0xdd64('0x5c')](function(_0x5b1f35){logger[_0xdd64('0x5a')]('['+_0x1eb8d7[_0xdd64('0x68')][_0xdd64('0x69')]()+']'+_0xdd64('0x6b'),util[_0xdd64('0x5e')](_0x5b1f35,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9931=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','monitor_format','lastevent','toUpperCase','Authorization','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','%s/tickets.json','remoteUri','merge','name','getString','Descriptions','then','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s/token:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','forEach','picklist','nameField','toLowerCase','content','toString','includes','string','type','idField','customField','custom_fields','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab'];(function(_0x226ce9,_0x2b7154){var _0x5816d2=function(_0x6495c1){while(--_0x6495c1){_0x226ce9['push'](_0x226ce9['shift']());}};_0x5816d2(++_0x2b7154);}(_0x9931,0x16e));var _0x1993=function(_0x4558a7,_0x4cad23){_0x4558a7=_0x4558a7-0x0;var _0x241274=_0x9931[_0x4558a7];return _0x241274;};'use strict';var _=require(_0x1993('0x0'));var rp=require(_0x1993('0x1'));var md5=require(_0x1993('0x2'));var util=require(_0x1993('0x3'));var Redis=require(_0x1993('0x4'));var intUtil=require(_0x1993('0x5'));var config=require(_0x1993('0x6'));var logger=require(_0x1993('0x7'))(_0x1993('0x8'));config[_0x1993('0x9')]=_[_0x1993('0xa')](config[_0x1993('0x9')],{'host':_0x1993('0xb'),'port':0x18eb});var io=require(_0x1993('0xc'))(new Redis(config[_0x1993('0x9')]));function emit(_0x58b257,_0x595d51,_0x29f9c0){io['to'](_0x58b257)['emit'](_0x595d51,_0x29f9c0);}var headers={'Content-Type':'application/json','Accept':_0x1993('0xd')};function getTicket(_0x587234,_0x142d2d,_0x577aae,_0x1e44ef,_0x4a2790){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x1993('0xe'),_0x587234[_0x1993('0xf')]),'method':'POST','body':{'ticket':_[_0x1993('0x10')]({'requester_id':_0x577aae['id'],'submitter_id':_0x142d2d?_0x142d2d['id']:undefined,'assignee_id':_0x142d2d?_0x142d2d['id']:undefined,'tags':getTags(_0x1e44ef['Tags'],_0x1993('0x11')),'subject':intUtil['getString'](_0x1e44ef['Subjects'],_0x4a2790,'\x20'),'description':intUtil[_0x1993('0x12')](_0x1e44ef[_0x1993('0x13')],_0x4a2790,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1993('0x12')](_0x1e44ef[_0x1993('0x13')],_0x4a2790,'\x0a')}},getCustomFields(_0x1e44ef['Fields'],_0x4a2790))}})[_0x1993('0x14')](function(_0x5d38d6){logger[_0x1993('0x15')](_0x1993('0x16'));return _0x5d38d6[_0x1993('0x17')];});}function getUser(_0x1f0dff,_0x3eeeef){if(intUtil['validateEmail'](_0x3eeeef)){logger[_0x1993('0x15')](_0x1993('0x18'),_0x3eeeef);return request({'uri':util['format'](_0x1993('0x19'),_0x1f0dff[_0x1993('0xf')]),'qs':{'query':util['format'](_0x1993('0x1a'),_0x3eeeef)}})['then'](function(_0x55224c){if(_0x55224c[_0x1993('0x1b')]){logger['info'](_0x1993('0x1c'));return _[_0x1993('0x1d')](_0x55224c[_0x1993('0x1e')],{'email':_0x3eeeef,'role':_0x1993('0x1f')});}else{logger[_0x1993('0x15')](_0x1993('0x20'));return request({'uri':util[_0x1993('0x21')]('%s/users/me.json',_0x1f0dff[_0x1993('0xf')])})['then'](function(_0x3cb4e4){logger[_0x1993('0x15')](_0x1993('0x22'));return _0x3cb4e4[_0x1993('0x23')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1993('0x21')](_0x1993('0x24'),_0x1f0dff[_0x1993('0xf')])})[_0x1993('0x14')](function(_0x4d827d){logger[_0x1993('0x15')]('Admin\x20account\x20selected.');return _0x4d827d[_0x1993('0x23')];});}}function getEndUser(_0xca4ce8,_0x55b15f,_0x47bfe2){logger[_0x1993('0x15')](_0x1993('0x25'),_0x47bfe2);return request({'uri':util[_0x1993('0x21')](_0x1993('0x19'),_0xca4ce8[_0x1993('0xf')]),'qs':{'query':util[_0x1993('0x21')]('type:user\x20role:end-user\x20phone:%s',_0x47bfe2)}})[_0x1993('0x14')](function(_0x394d74){var _0x3d9d6f;if(_0x394d74['results'][_0x1993('0x26')]){_0x394d74['results']=_[_0x1993('0x27')](_0x394d74[_0x1993('0x1e')],{'suspended':![],'role':_0x1993('0x28')});if(_0x394d74[_0x1993('0x1e')][_0x1993('0x26')]){_0x3d9d6f=_[_0x1993('0x29')](_0x394d74[_0x1993('0x1e')]);}}if(_0x3d9d6f){logger['info']('Enduser\x20found!');return _0x3d9d6f;}else{logger['info'](_0x1993('0x2a'));return request({'uri':util[_0x1993('0x21')](_0x1993('0x2b'),_0xca4ce8[_0x1993('0xf')]),'method':_0x1993('0x2c'),'body':{'user':{'role':'end-user','name':util['format'](_0x1993('0x2d'),_0x55b15f||_0x47bfe2),'phone':_0x47bfe2}}})[_0x1993('0x14')](function(_0x5147c7){logger[_0x1993('0x15')](_0x1993('0x2e'));return _0x5147c7[_0x1993('0x23')];});}});}function getAuth(_0x449860){var _0x106c75;if(_0x449860[_0x1993('0x2f')]===_0x1993('0x30')){_0x106c75=util[_0x1993('0x21')]('%s:%s',_0x449860['username'],_0x449860[_0x1993('0x30')]);}else if(_0x449860['authType']==='token'){_0x106c75=util[_0x1993('0x21')](_0x1993('0x31'),_0x449860[_0x1993('0x32')],_0x449860[_0x1993('0x33')]);}return util[_0x1993('0x21')](_0x1993('0x34'),new Buffer(_0x106c75)['toString'](_0x1993('0x35')));}function request(_0x44ced1){logger[_0x1993('0x36')](_0x1993('0x37'),JSON[_0x1993('0x38')](_0x44ced1));return rp(_[_0x1993('0xa')](_0x44ced1,{'method':_0x1993('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x3b3f2f,_0x3e7a3e){var _0x193341=[];if(_0x3b3f2f&&_0x3b3f2f[_0x1993('0x26')]>0x0){_0x193341=_['map'](_0x3b3f2f,_0x3e7a3e);}return _0x193341;}function getCustomFields(_0x2a2d92,_0xbbea75){var _0x34835a=[];var _0x3bb597={'custom_fields':[]};if(_0x2a2d92[_0x1993('0x26')]>0x0){_[_0x1993('0x3a')](_0x2a2d92,function(_0x138e8c){if(_['includes'](['string',_0x1993('0x3b')],_0x138e8c['type'])&&_0x138e8c[_0x1993('0x3c')]&&!_0x138e8c['customField']){_0x3bb597[_0x138e8c['nameField'][_0x1993('0x3d')]()]=_0x138e8c[_0x1993('0x3e')][_0x1993('0x3f')]();}else if(_[_0x1993('0x40')]([_0x1993('0x41'),_0x1993('0x3b')],_0x138e8c[_0x1993('0x42')])&&_0x138e8c[_0x1993('0x43')]&&_0x138e8c[_0x1993('0x44')]){_0x3bb597[_0x1993('0x45')][_0x1993('0x46')]({'id':_0x138e8c[_0x1993('0x43')],'value':_0x138e8c[_0x1993('0x3e')][_0x1993('0x3f')]()});}else if(_0x138e8c[_0x1993('0x42')]==='variable'&&_0x138e8c[_0x1993('0x47')]&&_0x138e8c['idField']&&_0x138e8c['customField']){_0xbbea75[_0x138e8c[_0x1993('0x47')]]&&_0x3bb597[_0x1993('0x45')]['push']({'id':_0x138e8c[_0x1993('0x43')],'value':_0xbbea75[_0x138e8c[_0x1993('0x47')]][_0x1993('0x3f')]()});}else if(_0x138e8c[_0x1993('0x42')]===_0x1993('0x48')&&_0x138e8c[_0x1993('0x49')]&&_0x138e8c[_0x1993('0x49')][_0x1993('0x11')]&&_0x138e8c[_0x1993('0x43')]&&_0x138e8c[_0x1993('0x44')]){_0xbbea75[_0x138e8c[_0x1993('0x49')][_0x1993('0x11')][_0x1993('0x3d')]()]&&_0x3bb597[_0x1993('0x45')]['push']({'id':_0x138e8c[_0x1993('0x43')],'value':_0xbbea75[_0x138e8c[_0x1993('0x49')][_0x1993('0x11')][_0x1993('0x3d')]()][_0x1993('0x3f')]()});}});}return _0x3bb597;}exports[_0x1993('0x4a')]=function(_0x5c73bc,_0x2d83fb,_0x2b1e31,_0x6231ef,_0x5d2c23,_0x5d3b7d){var _0x50f4d8,_0x21bd46;_0x5d3b7d['remoteUri']=intUtil[_0x1993('0x4b')](_0x5d3b7d['remoteUri']);_0x5d3b7d[_0x1993('0x4c')]=intUtil[_0x1993('0x4b')](_0x5d3b7d[_0x1993('0x4c')]);if(_0x5d2c23&&_0x5d2c23['monitor_format']){logger[_0x1993('0x15')]('[QUEUE]',_0x1993('0x4d'));_0x2d83fb[_0x1993('0x4e')]=util[_0x1993('0x21')](_0x1993('0x4f'),_0x5d3b7d[_0x1993('0x4c')],_0x2d83fb['uniqueid'],md5(_0x2d83fb[_0x1993('0x50')]));}else{_0x2d83fb[_0x1993('0x4e')]='';}headers['Authorization']=getAuth(_0x5d3b7d);return getUser(_0x5d3b7d,_0x6231ef['email'])['then'](function(_0x208059){_0x50f4d8=_0x208059;logger[_0x1993('0x15')](_0x1993('0x51'),_0x50f4d8['id']);return getEndUser(_0x5d3b7d,_0x2d83fb[_0x1993('0x52')],_0x2d83fb[_0x1993('0x53')]);})[_0x1993('0x14')](function(_0x5210c0){_0x21bd46=_0x5210c0;logger['info'](_0x1993('0x54'),_0x21bd46['id']);return getTicket(_0x5d3b7d,_0x50f4d8,_0x21bd46,_0x2b1e31,_0x2d83fb);})[_0x1993('0x14')](function(_0x5e576f){if(_0x5e576f){logger[_0x1993('0x15')](_0x1993('0x55'),_0x5e576f['id']);switch(_0x5d3b7d[_0x1993('0x42')]){case _0x1993('0x56'):logger[_0x1993('0x15')](_0x1993('0x57'),_0x1993('0x58'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5d3b7d[_0x1993('0xf')],_0x50f4d8['id'],_0x5e576f['id']),'method':_0x1993('0x2c')});case _0x1993('0x59'):logger[_0x1993('0x15')](_0x1993('0x57'),_0x1993('0x5a'));emit(util['format'](_0x1993('0x5b'),_0x6231ef[_0x1993('0x11')]),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x5d3b7d[_0x1993('0xf')][_0x1993('0x5c')]('/api/v2',''),_0x5e576f['id'])});break;default:logger[_0x1993('0x5d')](_0x1993('0x57'),_0x1993('0x5e'));}}})[_0x1993('0x5f')](function(_0x2c0a61){logger[_0x1993('0x5d')](_0x1993('0x60'),util['inspect'](_0x2c0a61,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x39946d,_0x43fdc4,_0x35abb3,_0x37b903,_0x4be6d9,_0x254bab,_0x4059b6){var _0x4a4044,_0x23bb55;_0x254bab[_0x1993('0xf')]=intUtil[_0x1993('0x4b')](_0x254bab[_0x1993('0xf')]);_0x254bab['serverUrl']=intUtil[_0x1993('0x4b')](_0x254bab[_0x1993('0x4c')]);if(_0x4059b6&&_0x4059b6[_0x1993('0x61')]&&_0x4059b6[_0x1993('0x61')]!==_0x1993('0x62')){logger[_0x1993('0x15')](_0x1993('0x63'),_0x1993('0x4d'));_0x43fdc4['recordingURL']=util[_0x1993('0x21')](_0x1993('0x4f'),_0x254bab[_0x1993('0x4c')],_0x43fdc4['uniqueid'],md5(_0x43fdc4[_0x1993('0x50')]));}headers['Authorization']=getAuth(_0x254bab);return getUser(_0x254bab,_0x37b903[_0x1993('0x64')])[_0x1993('0x14')](function(_0x9734a7){_0x4a4044=_0x9734a7;logger['info'](_0x1993('0x51'),_0x4a4044['id']);return getEndUser(_0x254bab,_0x43fdc4[_0x1993('0x65')],_0x43fdc4[_0x1993('0x66')]);})[_0x1993('0x14')](function(_0x1fe92e){_0x23bb55=_0x1fe92e;logger[_0x1993('0x15')](_0x1993('0x54'),_0x23bb55['id']);return getTicket(_0x254bab,_0x4a4044,_0x23bb55,_0x35abb3,_0x43fdc4);})['then'](function(_0x151778){if(_0x151778){logger[_0x1993('0x15')]('The\x20Ticket\x20ID\x20is:',_0x151778['id']);switch(_0x254bab[_0x1993('0x42')]){case'integrationTab':logger['info'](_0x1993('0x63'),_0x1993('0x58'));return request({'uri':util[_0x1993('0x21')](_0x1993('0x67'),_0x254bab['remoteUri'],_0x4a4044['id'],_0x151778['id']),'method':'POST'});case _0x1993('0x59'):logger[_0x1993('0x15')]('[OUTBOUND]',_0x1993('0x5a'));emit(util['format'](_0x1993('0x5b'),_0x37b903[_0x1993('0x11')]),'trigger:browser:url',{'uri':util[_0x1993('0x21')](_0x1993('0x68'),_0x254bab[_0x1993('0xf')][_0x1993('0x5c')](_0x1993('0x69'),''),_0x151778['id'])});break;default:logger[_0x1993('0x5d')](_0x1993('0x63'),_0x1993('0x5e'));}}})['catch'](function(_0xab85d3){logger[_0x1993('0x5d')](_0x1993('0x6a'),util[_0x1993('0x6b')](_0xab85d3,{'showHidden':!![],'depth':null}));});};exports[_0x1993('0x6c')]=function(_0x5a2415,_0x410304,_0x3eb0cc,_0x24ee40,_0x39ff5e,_0x291768){var _0x299909,_0x41fc2c;_0x291768[_0x1993('0xf')]=intUtil[_0x1993('0x4b')](_0x291768[_0x1993('0xf')]);_0x291768[_0x1993('0x4c')]=intUtil[_0x1993('0x4b')](_0x291768[_0x1993('0x4c')]);if(_0x39ff5e&&_0x39ff5e[_0x1993('0x6d')]){logger['info']('['+_0x410304[_0x1993('0x6e')][_0x1993('0x6f')]()+']',_0x1993('0x4d'));_0x410304[_0x1993('0x4e')]=util[_0x1993('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x291768['serverUrl'],_0x410304[_0x1993('0x50')],md5(_0x410304['uniqueid']));}else{_0x410304[_0x1993('0x4e')]='';}headers[_0x1993('0x70')]=getAuth(_0x291768);return getUser(_0x291768)[_0x1993('0x14')](function(_0x56007d){_0x299909=_0x56007d;logger[_0x1993('0x15')](_0x1993('0x51'),_0x299909['id']);return getEndUser(_0x291768,_0x410304['calleridname'],_0x410304['calleridnum']);})[_0x1993('0x14')](function(_0x650fcb){_0x41fc2c=_0x650fcb;logger[_0x1993('0x15')]('The\x20Enduser\x20ID\x20is:',_0x41fc2c['id']);return getTicket(_0x291768,_0x299909,_0x41fc2c,_0x3eb0cc,_0x410304);})[_0x1993('0x14')](function(_0x2ec7cc){if(_0x2ec7cc){logger[_0x1993('0x15')]('The\x20Ticket\x20ID\x20is:',_0x2ec7cc['id']);}})['catch'](function(_0x36cc0d){logger[_0x1993('0x5d')]('['+_0x410304[_0x1993('0x6e')][_0x1993('0x6f')]()+']'+_0x1993('0x71'),util['inspect'](_0x36cc0d,{'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 0712a76..9c2bb56 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 _0x27bd=['Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','/crm/v2/','startCase','role','first_name','last_name','code','details','enduserType','moduleCreate','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','administrator','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','err','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','zoho.eu','com','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=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridnum','user:%s','unmanaged','toUpperCase','calleridnum','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','redis','defaults','localhost','[HTTP]','length','forEach','includes','string','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','then','add','seconds','error'];(function(_0x5ef0a3,_0x30d350){var _0x3c9825=function(_0x3812c3){while(--_0x3812c3){_0x5ef0a3['push'](_0x5ef0a3['shift']());}};_0x3c9825(++_0x30d350);}(_0x27bd,0x199));var _0xd27b=function(_0x1d6651,_0x53ba51){_0x1d6651=_0x1d6651-0x0;var _0xa1e41e=_0x27bd[_0x1d6651];return _0xa1e41e;};'use strict';var _=require(_0xd27b('0x0'));var rp=require(_0xd27b('0x1'));var md5=require(_0xd27b('0x2'));var util=require(_0xd27b('0x3'));var intUtil=require('./util');var moment=require(_0xd27b('0x4'));var Redis=require(_0xd27b('0x5'));var BPromise=require(_0xd27b('0x6'));var config=require(_0xd27b('0x7'));var logger=require('../../../../config/logger')('zoho');config[_0xd27b('0x8')]=_[_0xd27b('0x9')](config[_0xd27b('0x8')],{'host':_0xd27b('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x282353,_0x2ddec6,_0x4625ac){io['to'](_0x282353)['emit'](_0x2ddec6,_0x4625ac);}function request(_0x324459){logger['debug'](_0xd27b('0xb'),JSON['stringify'](_0x324459));return rp(_0x324459);}function getCustomFields(_0xaf116d,_0x15863e){var _0x1e3bcc={};if(_0xaf116d[_0xd27b('0xc')]>0x0){_[_0xd27b('0xd')](_0xaf116d,function(_0x30ec9f){if(_[_0xd27b('0xe')]([_0xd27b('0xf'),'picklist'],_0x30ec9f[_0xd27b('0x10')])&&_0x30ec9f['idField']){_0x1e3bcc[_0x30ec9f[_0xd27b('0x11')]]=_0x30ec9f[_0xd27b('0x12')][_0xd27b('0x13')]();}else if(_0x30ec9f[_0xd27b('0x10')]==='variable'&&_0x30ec9f[_0xd27b('0x14')]&&_0x30ec9f[_0xd27b('0x11')]&&_0x15863e[_0x30ec9f[_0xd27b('0x14')]]){_0x1e3bcc[_0x30ec9f[_0xd27b('0x11')]]=_0x15863e[_0x30ec9f[_0xd27b('0x14')]]['toString']();}else if(_0x30ec9f[_0xd27b('0x10')]===_0xd27b('0x15')&&_0x30ec9f[_0xd27b('0x16')]&&_0x30ec9f[_0xd27b('0x16')][_0xd27b('0x17')]&&_0x30ec9f[_0xd27b('0x11')]&&_0x15863e[_0x30ec9f[_0xd27b('0x16')][_0xd27b('0x17')]['toLowerCase']()]){_0x1e3bcc[_0x30ec9f['idField']]=_0x15863e[_0x30ec9f[_0xd27b('0x16')][_0xd27b('0x17')][_0xd27b('0x18')]()][_0xd27b('0x13')]();}});}return _0x1e3bcc;}function getName(_0x25a7db){if(_0x25a7db[_0xd27b('0x19')]('\x20')>0x0){var _0x57583d=_0x25a7db[_0xd27b('0x1a')](/ (.+)/);if(_0x57583d[0x1]){return _0x57583d;}}return[_0x25a7db,_0x25a7db];}var accountsTokens={};function getAccessToken(_0x884797){return new Promise(function(_0x49ed1e,_0x1baea4){if(!_[_0xd27b('0x1b')](accountsTokens[_0x884797['id']])&&!_['isNil'](accountsTokens[_0x884797['id']][_0xd27b('0x1c')])){if(moment()[_0xd27b('0x1d')](accountsTokens[_0x884797['id']][_0xd27b('0x1e')])){_0x49ed1e(accountsTokens[_0x884797['id']][_0xd27b('0x1c')]);}}var _0x268d6d;switch(_0x884797[_0xd27b('0x1f')]){case'US':_0x268d6d=_0xd27b('0x20');break;case'AU':_0x268d6d=_0xd27b('0x21');break;case'EU':_0x268d6d='https://accounts.zoho.eu';break;case'IN':_0x268d6d=_0xd27b('0x22');break;case'CN':_0x268d6d=_0xd27b('0x23');break;default:_0x268d6d='https://accounts.zoho.eu';break;}var _0x1ed78b={'method':_0xd27b('0x24'),'uri':_0x268d6d+'/oauth/v2/token','qs':{'refresh_token':_0x884797[_0xd27b('0x25')],'client_id':_0x884797[_0xd27b('0x26')],'client_secret':_0x884797[_0xd27b('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1ed78b)[_0xd27b('0x28')](function(_0x38c429){accountsTokens[_0x884797['id']]={'access_token':_0x38c429['access_token'],'expires_in':moment()[_0xd27b('0x29')](_0x38c429[_0xd27b('0x1e')],_0xd27b('0x2a'))};_0x49ed1e(_0x38c429[_0xd27b('0x1c')]);})['catch'](function(_0x12334f){logger[_0xd27b('0x2b')](_0xd27b('0x2c'),_0x12334f[_0xd27b('0x2d')]);_0x1baea4(_0x12334f);});});}function getUser(_0x425e7a,_0x41ae57,_0x11b84d,_0x2a1374){logger[_0xd27b('0x2e')](_0xd27b('0x2f'));return request({'method':_0xd27b('0x30'),'uri':util[_0xd27b('0x31')]('https://www.zohoapis.%s/crm/v2/users',_0x41ae57),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xd27b('0x32')+_0x425e7a},'json':!![]})[_0xd27b('0x28')](function(_0x207e0b){if(_0x207e0b[_0xd27b('0x33')]){var _0xd3f95=-0x1;if(_[_0xd27b('0x34')](_0x207e0b[_0xd27b('0x33')])){if(!_[_0xd27b('0x1b')](_0x2a1374)){_0xd3f95=_['findIndex'](_0x207e0b[_0xd27b('0x33')],function(_0xba87a6){return _0xba87a6[_0xd27b('0x35')]===_0x2a1374;});}if(_0xd3f95>=0x0){logger['info'](_0xd27b('0x36'));}else{logger[_0xd27b('0x2e')](_0xd27b('0x37'));_0xd3f95=_[_0xd27b('0x38')](_0x207e0b[_0xd27b('0x33')],function(_0x90156){return _0x90156[_0xd27b('0x39')][_0xd27b('0x17')]===_0xd27b('0x3a');});}return _0x207e0b[_0xd27b('0x33')][_0xd3f95];}else{if(_0x207e0b[_0xd27b('0x3b')][_0xd27b('0x39')][_0xd27b('0x17')]===_0xd27b('0x3a')){logger[_0xd27b('0x2e')]('Using\x20the\x20admin\x20account!');user=_0x207e0b[_0xd27b('0x3b')];return user;}else{logger[_0xd27b('0x2b')](_0xd27b('0x3c'),JSON[_0xd27b('0x3d')](_0x207e0b));throw new Error(_0xd27b('0x3e')+JSON[_0xd27b('0x3d')](_0x207e0b));}}}else{logger[_0xd27b('0x2b')](_0xd27b('0x3c'),JSON[_0xd27b('0x3d')](_0x207e0b));throw new Error(_0xd27b('0x3e')+JSON[_0xd27b('0x3d')](_0x207e0b));}})[_0xd27b('0x3f')](function(_0xb0d2a2){console[_0xd27b('0x2b')](_0xb0d2a2);});}function getZohoUser(_0x89886,_0x454b18){return new BPromise(function(_0x188a78,_0xe7040f){request(_0x89886)['then'](function(_0xa977d2){var _0xf8e883=null;if(_0xa977d2){_0xf8e883=_0xa977d2[_0xd27b('0x40')][0x0];_0xf8e883['enduserType']=_0x454b18;}_0x188a78(_0xf8e883);})['catch'](function(_0x58c9e3){_0xe7040f(_0x58c9e3);});});}function createEndUser(_0xb4c03b,_0x228ea6,_0x15ff6b,_0x26f529,_0x3d397e,_0x9ef9d0){var _0x15ff6b=getName(_0x15ff6b);return request({'method':_0xd27b('0x24'),'uri':'https://www.zohoapis.'+_0x228ea6+_0xd27b('0x41')+_[_0xd27b('0x42')](_0x9ef9d0['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x15ff6b[0x1],'First_Name':_0x15ff6b[0x0],'Phone':_0x26f529,'Owner':{'name':!_[_0xd27b('0x1b')](_0x3d397e[_0xd27b('0x43')][_0xd27b('0x17')])?_0x3d397e[_0xd27b('0x43')][_0xd27b('0x17')]:!_[_0xd27b('0x1b')](_0x3d397e[_0xd27b('0x44')])?_0x3d397e[_0xd27b('0x44')]+'\x20'+_0x3d397e[_0xd27b('0x45')]:_0x3d397e[_0xd27b('0x45')],'id':_0x3d397e['id']}}]},'headers':{'Authorization':_0xd27b('0x32')+_0xb4c03b},'json':!![]})[_0xd27b('0x28')](function(_0x54ce66){if(_0x54ce66&&_0x54ce66[_0xd27b('0x40')][0x0][_0xd27b('0x46')]==='SUCCESS'){var _0x21d203=_0x54ce66['data'][0x0][_0xd27b('0x47')];_0x21d203[_0xd27b('0x48')]=_[_0xd27b('0x42')](_0x9ef9d0[_0xd27b('0x49')])+'s';return _0x21d203;}logger[_0xd27b('0x2b')](_0xd27b('0x3c'),JSON[_0xd27b('0x3d')](data));throw new Error(_0xd27b('0x4a')+JSON['stringify'](data));})['catch'](function(_0x254e4b){console[_0xd27b('0x4b')](_0xd27b('0x4c'),_0x254e4b);});}function getEndUser(_0x3f374d,_0x3eb8e5,_0x2cc220,_0xec370a,_0x51252c,_0x3f3cdd,_0x3a3c21){var _0x5dd93a={'method':_0xd27b('0x30'),'uri':'','headers':{'Authorization':_0xd27b('0x32')+_0x3f374d},'json':!![]};switch(_0x3a3c21['moduleSearch']){case _0xd27b('0x4d'):_0x5dd93a[_0xd27b('0x4e')]=_0xd27b('0x4f')+_0x3eb8e5+_0xd27b('0x50')+_0x51252c+'))';return getZohoUser(_0x5dd93a,'Contacts')[_0xd27b('0x28')](function(_0x8c1ad5){if(_0x8c1ad5)return _0x8c1ad5;_0x5dd93a[_0xd27b('0x4e')]='https://www.zohoapis.'+_0x3eb8e5+_0xd27b('0x51')+_0x51252c+'))';return getZohoUser(_0x5dd93a,_0xd27b('0x52'))[_0xd27b('0x28')](function(_0x3bb6bc){if(_0x3bb6bc)return _0x3bb6bc;if(_0x3a3c21[_0xd27b('0x49')]!=_0xd27b('0x53')){return createEndUser(_0x3f374d,_0x3eb8e5,_0xec370a,_0x51252c,_0x3f3cdd,_0x3a3c21);}else{return{};}});});break;case _0xd27b('0x54'):_0x5dd93a[_0xd27b('0x4e')]=_0xd27b('0x4f')+_0x3eb8e5+_0xd27b('0x50')+_0x51252c+'))';return getZohoUser(_0x5dd93a,_0xd27b('0x55'))['then'](function(_0xe05390){if(_0xe05390)return _0xe05390;if(_0x3a3c21[_0xd27b('0x49')]!=_0xd27b('0x53')){return createEndUser(_0x3f374d,_0x3eb8e5,_0xec370a,_0x51252c,_0x3f3cdd,_0x3a3c21);}else{return{};}});break;case _0xd27b('0x56'):_0x5dd93a[_0xd27b('0x4e')]='https://www.zohoapis.'+_0x3eb8e5+_0xd27b('0x51')+_0x51252c+'))';return getZohoUser(_0x5dd93a,'Leads')[_0xd27b('0x28')](function(_0x52021c){if(_0x52021c)return _0x52021c;if(_0x3a3c21['moduleCreate']!=_0xd27b('0x53')){return createEndUser(_0x3f374d,_0x3eb8e5,_0xec370a,_0x51252c,_0x3f3cdd,_0x3a3c21);}else{return{};}});break;}}function getCall(_0x438678,_0x3c23a1,_0x3b89c8,_0x17ea29,_0x28ca71,_0x2382cf,_0x577d34,_0x38f6c2){logger['info'](_0xd27b('0x57'));var _0x4d24a4={};_0x4d24a4['Owner']={'name':!_[_0xd27b('0x1b')](_0x17ea29[_0xd27b('0x43')][_0xd27b('0x17')])&&!_['isNil'](_0x17ea29['profile']['name'])&&_0x17ea29[_0xd27b('0x39')][_0xd27b('0x17')]===_0xd27b('0x58')?_0x17ea29[_0xd27b('0x43')][_0xd27b('0x17')]:!_['isNil'](_0x17ea29['first_name'])?_0x17ea29[_0xd27b('0x44')]+'\x20'+_0x17ea29[_0xd27b('0x45')]:_0x17ea29[_0xd27b('0x45')],'id':_0x17ea29['id']};_0x4d24a4['Subject']=intUtil[_0xd27b('0x59')](_0x2382cf['Subjects'],_0x577d34,'\x20');_0x4d24a4[_0xd27b('0x5a')]=intUtil[_0xd27b('0x59')](_0x2382cf[_0xd27b('0x5b')],_0x577d34,'\x0a');if(_0x28ca71[_0xd27b('0x48')]==='Contacts'){_0x4d24a4[_0xd27b('0x5c')]={'name':!_[_0xd27b('0x1b')](_0x28ca71[_0xd27b('0x5d')])?_0x28ca71['Full_Name']:!_[_0xd27b('0x1b')](_0x28ca71['First_Name'])?_0x28ca71[_0xd27b('0x5e')]+'\x20'+_0x28ca71[_0xd27b('0x5f')]:_0x28ca71[_0xd27b('0x5f')],'id':_0x28ca71['id']};}if(_0x28ca71['enduserType']===_0xd27b('0x52')){_0x4d24a4[_0xd27b('0x60')]={'name':!_[_0xd27b('0x1b')](_0x28ca71['Full_Name'])?_0x28ca71[_0xd27b('0x5d')]:!_['isNil'](_0x28ca71[_0xd27b('0x5e')])?_0x28ca71[_0xd27b('0x5e')]+'\x20'+_0x28ca71[_0xd27b('0x5f')]:_0x28ca71[_0xd27b('0x5f')],'id':_0x28ca71['id']};_0x4d24a4[_0xd27b('0x61')]=_[_0xd27b('0x42')](_0x28ca71[_0xd27b('0x48')]);}if(_0x577d34[_0xd27b('0x62')]){_0x4d24a4[_0xd27b('0x63')]=moment['utc'](parseInt(_0x577d34[_0xd27b('0x62')])*0x3e8)['format']('mm:ss');}else if(_0x577d34[_0xd27b('0x64')]&&_0x577d34[_0xd27b('0x65')]){_0x4d24a4[_0xd27b('0x63')]=moment['utc'](moment(_0x577d34[_0xd27b('0x65')],_0xd27b('0x66'))['diff'](moment(_0x577d34[_0xd27b('0x67')],_0xd27b('0x66'))))['format']('mm:ss');}switch(_0x577d34[_0xd27b('0x68')]){case _0xd27b('0x69'):_0x4d24a4[_0xd27b('0x6a')]=_0xd27b('0x6b');break;case _0xd27b('0x6c'):case _0xd27b('0x6d'):_0x4d24a4['Call_Result']=_0xd27b('0x6e');break;case _0xd27b('0x6f'):_0x4d24a4[_0xd27b('0x6a')]='Rejected';break;case'abandoned':_0x4d24a4[_0xd27b('0x6a')]=_0xd27b('0x70');break;case _0xd27b('0x71'):_0x4d24a4[_0xd27b('0x6a')]=_0xd27b('0x72');default:}_0x4d24a4[_0xd27b('0x73')]=(_0x38f6c2===_0xd27b('0x74')?moment(_0x577d34[_0xd27b('0x67')])[_0xd27b('0x31')](_0xd27b('0x66')):moment(_0x577d34[_0xd27b('0x75')])['format'](_0xd27b('0x66')))||moment()[_0xd27b('0x31')](_0xd27b('0x66'));_0x4d24a4[_0xd27b('0x76')]=_0x38f6c2||_0xd27b('0x77');_0x4d24a4=_[_0xd27b('0x78')](_0x4d24a4,getCustomFields(_0x2382cf[_0xd27b('0x79')],_0x577d34));return request({'method':_0xd27b('0x24'),'uri':_0xd27b('0x4f')+_0x3c23a1+_0xd27b('0x7a'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x438678},'body':{'data':[_0x4d24a4]},'json':!![]})['then'](function(_0x15e79c){if(_0x15e79c&&_0x15e79c['data'][0x0][_0xd27b('0x46')]===_0xd27b('0x7b')){logger[_0xd27b('0x2e')]('Call\x20created!');return{'id':_0x15e79c[_0xd27b('0x40')][0x0][_0xd27b('0x47')]['id']};}})[_0xd27b('0x3f')](function(_0x58f101){logger[_0xd27b('0x2e')](_0xd27b('0x7c'),_0x58f101[_0xd27b('0x2d')]);console[_0xd27b('0x4b')](_0xd27b('0x7c'),_0x58f101);});}exports[_0xd27b('0x7d')]=function(_0x4229c5,_0x24361a,_0x22b344,_0x5b3b15,_0x392211,_0x277742){var _0x257927,_0x26136e,_0x22a4e9;_0x277742['host']=intUtil['stripTrailingSlash'](_0x277742[_0xd27b('0x7e')]);_0x277742[_0xd27b('0x7f')]=intUtil[_0xd27b('0x80')](_0x277742[_0xd27b('0x7f')]);if(_0x392211&&_0x392211['monitor_format']){logger[_0xd27b('0x2e')](_0xd27b('0x81'),_0xd27b('0x82'));_0x24361a[_0xd27b('0x83')]=_0x277742[_0xd27b('0x7f')]+'/api/voice/recordings/'+_0x24361a[_0xd27b('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x24361a[_0xd27b('0x84')]);}else{_0x24361a[_0xd27b('0x83')]='';}var _0x4a5a81=_0x277742[_0xd27b('0x7e')]===_0xd27b('0x85')?'eu':_0xd27b('0x86');return getAccessToken(_0x277742)[_0xd27b('0x28')](function(_0x3fed7f){_0x22a4e9=_0x3fed7f;return getUser(_0x22a4e9,_0x4a5a81,_0x277742,_0x5b3b15[_0xd27b('0x35')]);})[_0xd27b('0x28')](function(_0x561428){_0x257927=_0x561428;logger[_0xd27b('0x2e')](_0xd27b('0x87'),_0x257927['id']);return getEndUser(_0x22a4e9,_0x4a5a81,_0x277742,_0x24361a[_0xd27b('0x88')],_0x24361a['calleridnum'],_0x257927,_0x22b344);})['then'](function(_0x430a9b){_0x26136e=_0x430a9b;return getCall(_0x22a4e9,_0x4a5a81,_0x277742,_0x257927,_0x26136e,_0x22b344,_0x24361a,_0xd27b('0x77'));})[_0xd27b('0x28')](function(_0x54d416){if(_0x54d416){logger['info'](_0xd27b('0x89'),_0x54d416['id']);logger['info'](_0xd27b('0x81'),_0xd27b('0x8a'));emit(util['format']('user:%s',_0x5b3b15[_0xd27b('0x17')]),_0xd27b('0x8b'),{'uri':_0xd27b('0x8c')+_0x277742[_0xd27b('0x7e')]+_0xd27b('0x8d')+_0x54d416['id']});}})[_0xd27b('0x3f')](function(_0x5c50b5){logger[_0xd27b('0x2b')]('[QUEUE]',JSON[_0xd27b('0x3d')](_0x5c50b5));});};exports['outbound']=function(_0xbfa128,_0x4fa32d,_0x49b468,_0x3addcb,_0x2c94c0,_0x2d481d,_0x475b3c){var _0x459c77,_0x315fd0,_0x1f6838;_0x2d481d['host']=intUtil[_0xd27b('0x80')](_0x2d481d[_0xd27b('0x7e')]);_0x2d481d['serverUrl']=intUtil[_0xd27b('0x80')](_0x2d481d[_0xd27b('0x7f')]);if(_0x475b3c&&_0x475b3c[_0xd27b('0x8e')]&&_0x475b3c[_0xd27b('0x8e')]!==_0xd27b('0x8f')){logger[_0xd27b('0x2e')](_0xd27b('0x90'),'Recording\x20is\x20enabled!');_0x4fa32d[_0xd27b('0x83')]=_0x2d481d[_0xd27b('0x7f')]+_0xd27b('0x91')+_0x4fa32d[_0xd27b('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x4fa32d[_0xd27b('0x84')]);}var _0x1e0308=_0x2d481d[_0xd27b('0x7e')]===_0xd27b('0x85')?'eu':_0xd27b('0x86');return getAccessToken(_0x2d481d)[_0xd27b('0x28')](function(_0x705941){_0x1f6838=_0x705941;return getUser(_0x1f6838,_0x1e0308,_0x2d481d,_0x3addcb['email']);})[_0xd27b('0x28')](function(_0x192446){_0x459c77=_0x192446;logger[_0xd27b('0x2e')]('The\x20User\x20ID\x20is:',_0x459c77['id']);return getEndUser(_0x1f6838,_0x1e0308,_0x2d481d,_0x4fa32d['destcalleridname'],_0x4fa32d[_0xd27b('0x92')],_0x459c77,_0x49b468);})[_0xd27b('0x28')](function(_0xe33f1c){_0x315fd0=_0xe33f1c;return getCall(_0x1f6838,_0x1e0308,_0x2d481d,_0x459c77,_0x315fd0,_0x49b468,_0x4fa32d,'Outbound');})[_0xd27b('0x28')](function(_0x310e36){if(_0x310e36){logger[_0xd27b('0x2e')](_0xd27b('0x89'),_0x310e36['id']);logger[_0xd27b('0x2e')](_0xd27b('0x90'),_0xd27b('0x8a'));emit(util[_0xd27b('0x31')](_0xd27b('0x93'),_0x3addcb[_0xd27b('0x17')]),_0xd27b('0x8b'),{'uri':_0xd27b('0x8c')+_0x2d481d[_0xd27b('0x7e')]+_0xd27b('0x8d')+_0x310e36['id']});}})[_0xd27b('0x3f')](function(_0x3a430e){logger[_0xd27b('0x2b')](_0xd27b('0x90'),JSON[_0xd27b('0x3d')](_0x3a430e));});};exports[_0xd27b('0x94')]=function(_0x465037,_0x1a7810,_0x211c7e,_0x235ddd,_0x165d79,_0x1beadb){var _0xc4afda,_0x13e1bf,_0x4259a1;_0x1beadb[_0xd27b('0x7e')]=intUtil['stripTrailingSlash'](_0x1beadb[_0xd27b('0x7e')]);_0x1beadb[_0xd27b('0x7f')]=intUtil[_0xd27b('0x80')](_0x1beadb[_0xd27b('0x7f')]);if(_0x165d79&&_0x165d79['monitor_format']){logger[_0xd27b('0x2e')]('['+_0x1a7810[_0xd27b('0x68')][_0xd27b('0x95')]()+']','Recording\x20is\x20enabled!');_0x1a7810[_0xd27b('0x83')]=_0x1beadb[_0xd27b('0x7f')]+'/api/voice/recordings/'+_0x1a7810[_0xd27b('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x1a7810['uniqueid']);}else{_0x1a7810[_0xd27b('0x83')]='';}var _0x51a848=_0x1beadb[_0xd27b('0x7e')]===_0xd27b('0x85')?'eu':_0xd27b('0x86');return getAccessToken(_0x1beadb)['then'](function(_0x5bd5c0){_0x4259a1=_0x5bd5c0;return getUser(_0x4259a1,_0x51a848,_0x1beadb);})[_0xd27b('0x28')](function(_0xeb415a){_0xc4afda=_0xeb415a;logger[_0xd27b('0x2e')](_0xd27b('0x87'),_0xc4afda['id']);return getEndUser(_0x4259a1,_0x51a848,_0x1beadb,_0x1a7810['calleridname'],_0x1a7810[_0xd27b('0x96')],_0xc4afda,_0x211c7e);})[_0xd27b('0x28')](function(_0x1e736f){_0x13e1bf=_0x1e736f;return getCall(_0x4259a1,_0x51a848,_0x1beadb,_0xc4afda,_0x13e1bf,_0x211c7e,_0x1a7810,_0xd27b('0x77'));})[_0xd27b('0x28')](function(_0x5e1a1e){if(_0x5e1a1e){logger[_0xd27b('0x2e')](_0xd27b('0x89'),_0x5e1a1e['id']);}})[_0xd27b('0x3f')](function(_0x35d6ab){logger[_0xd27b('0x2b')]('['+_0x1a7810[_0xd27b('0x68')]['toUpperCase']()+']',JSON[_0xd27b('0x3d')](_0x35d6ab));});}; \ No newline at end of file +var _0x3678=['customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','ActiveUsers','users','findIndex','Using\x20the\x20admin\x20account!','user','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','moduleCreate','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','string','type','idField','toString','variableName'];(function(_0xd5d1d1,_0x32b81d){var _0x362d2e=function(_0x54f45d){while(--_0x54f45d){_0xd5d1d1['push'](_0xd5d1d1['shift']());}};_0x362d2e(++_0x32b81d);}(_0x3678,0x81));var _0x8367=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0x3678[_0x2d3a4d];return _0x3a94a3;};'use strict';var _=require(_0x8367('0x0'));var rp=require(_0x8367('0x1'));var md5=require(_0x8367('0x2'));var util=require(_0x8367('0x3'));var intUtil=require(_0x8367('0x4'));var moment=require(_0x8367('0x5'));var Redis=require(_0x8367('0x6'));var BPromise=require(_0x8367('0x7'));var config=require(_0x8367('0x8'));var logger=require(_0x8367('0x9'))(_0x8367('0xa'));config[_0x8367('0xb')]=_[_0x8367('0xc')](config[_0x8367('0xb')],{'host':_0x8367('0xd'),'port':0x18eb});var io=require(_0x8367('0xe'))(new Redis(config['redis']));function emit(_0x32f7c5,_0x307500,_0x7dadcf){io['to'](_0x32f7c5)[_0x8367('0xf')](_0x307500,_0x7dadcf);}function request(_0x44269c){logger[_0x8367('0x10')](_0x8367('0x11'),JSON[_0x8367('0x12')](_0x44269c));return rp(_0x44269c);}function getCustomFields(_0x5b0f71,_0x2be594){var _0x35542f={};if(_0x5b0f71[_0x8367('0x13')]>0x0){_['forEach'](_0x5b0f71,function(_0xb24a65){if(_[_0x8367('0x14')]([_0x8367('0x15'),'picklist'],_0xb24a65[_0x8367('0x16')])&&_0xb24a65[_0x8367('0x17')]){_0x35542f[_0xb24a65['idField']]=_0xb24a65['content'][_0x8367('0x18')]();}else if(_0xb24a65[_0x8367('0x16')]==='variable'&&_0xb24a65[_0x8367('0x19')]&&_0xb24a65[_0x8367('0x17')]&&_0x2be594[_0xb24a65[_0x8367('0x19')]]){_0x35542f[_0xb24a65['idField']]=_0x2be594[_0xb24a65['variableName']][_0x8367('0x18')]();}else if(_0xb24a65[_0x8367('0x16')]===_0x8367('0x1a')&&_0xb24a65[_0x8367('0x1b')]&&_0xb24a65[_0x8367('0x1b')][_0x8367('0x1c')]&&_0xb24a65[_0x8367('0x17')]&&_0x2be594[_0xb24a65[_0x8367('0x1b')][_0x8367('0x1c')][_0x8367('0x1d')]()]){_0x35542f[_0xb24a65[_0x8367('0x17')]]=_0x2be594[_0xb24a65[_0x8367('0x1b')][_0x8367('0x1c')][_0x8367('0x1d')]()]['toString']();}});}return _0x35542f;}function getName(_0x2861d3){if(_0x2861d3[_0x8367('0x1e')]('\x20')>0x0){var _0x5775f7=_0x2861d3[_0x8367('0x1f')](/ (.+)/);if(_0x5775f7[0x1]){return _0x5775f7;}}return[_0x2861d3,_0x2861d3];}var accountsTokens={};function getAccessToken(_0x41e67b){return new Promise(function(_0x38d4a4,_0x31cbca){if(!_[_0x8367('0x20')](accountsTokens[_0x41e67b['id']])&&!_[_0x8367('0x20')](accountsTokens[_0x41e67b['id']]['access_token'])){if(moment()[_0x8367('0x21')](accountsTokens[_0x41e67b['id']]['expires_in'])){_0x38d4a4(accountsTokens[_0x41e67b['id']][_0x8367('0x22')]);}}var _0x2f0c6b;switch(_0x41e67b[_0x8367('0x23')]){case'US':_0x2f0c6b=_0x8367('0x24');break;case'AU':_0x2f0c6b='https://accounts.zoho.com.au';break;case'EU':_0x2f0c6b=_0x8367('0x25');break;case'IN':_0x2f0c6b=_0x8367('0x26');break;case'CN':_0x2f0c6b=_0x8367('0x27');break;default:_0x2f0c6b=_0x8367('0x25');break;}var _0x4c6691={'method':_0x8367('0x28'),'uri':_0x2f0c6b+_0x8367('0x29'),'qs':{'refresh_token':_0x41e67b[_0x8367('0x2a')],'client_id':_0x41e67b[_0x8367('0x2b')],'client_secret':_0x41e67b[_0x8367('0x2c')],'grant_type':_0x8367('0x2d')},'json':!![]};return rp(_0x4c6691)[_0x8367('0x2e')](function(_0x4b065f){accountsTokens[_0x41e67b['id']]={'access_token':_0x4b065f[_0x8367('0x22')],'expires_in':moment()['add'](_0x4b065f[_0x8367('0x2f')],_0x8367('0x30'))};_0x38d4a4(_0x4b065f[_0x8367('0x22')]);})[_0x8367('0x31')](function(_0x3fadb7){logger[_0x8367('0x32')](_0x8367('0x33'),_0x3fadb7[_0x8367('0x34')]);_0x31cbca(_0x3fadb7);});});}function getUser(_0x305c41,_0x5ec8fa,_0xfc9e2c,_0x164475){logger[_0x8367('0x35')]('Search\x20user');return request({'method':_0x8367('0x36'),'uri':util[_0x8367('0x37')]('https://www.zohoapis.%s/crm/v2/users',_0x5ec8fa),'qs':{'type':_0x8367('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x305c41},'json':!![]})[_0x8367('0x2e')](function(_0x5de78f){if(_0x5de78f[_0x8367('0x39')]){var _0x31b40b=-0x1;if(_['isArrayLikeObject'](_0x5de78f['users'])){if(!_[_0x8367('0x20')](_0x164475)){_0x31b40b=_[_0x8367('0x3a')](_0x5de78f[_0x8367('0x39')],function(_0x285e20){return _0x285e20['email']===_0x164475;});}if(_0x31b40b>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x8367('0x35')](_0x8367('0x3b'));_0x31b40b=_[_0x8367('0x3a')](_0x5de78f['users'],function(_0x4d23de){return _0x4d23de['profile'][_0x8367('0x1c')]==='Administrator';});}return _0x5de78f[_0x8367('0x39')][_0x31b40b];}else{if(_0x5de78f[_0x8367('0x3c')][_0x8367('0x3d')][_0x8367('0x1c')]===_0x8367('0x3e')){logger[_0x8367('0x35')](_0x8367('0x3b'));user=_0x5de78f['user'];return user;}else{logger[_0x8367('0x32')](_0x8367('0x3f'),JSON['stringify'](_0x5de78f));throw new Error(_0x8367('0x40')+JSON['stringify'](_0x5de78f));}}}else{logger[_0x8367('0x32')](_0x8367('0x3f'),JSON[_0x8367('0x12')](_0x5de78f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x8367('0x12')](_0x5de78f));}})[_0x8367('0x31')](function(_0x109020){console['error'](_0x109020);});}function getZohoUser(_0x1d1b44,_0x3553b3){return new BPromise(function(_0x2d8fcd,_0x3ea305){request(_0x1d1b44)[_0x8367('0x2e')](function(_0x1fa92c){var _0x38dd7b=null;if(_0x1fa92c){_0x38dd7b=_0x1fa92c[_0x8367('0x41')][0x0];_0x38dd7b[_0x8367('0x42')]=_0x3553b3;}_0x2d8fcd(_0x38dd7b);})['catch'](function(_0x5ef97f){_0x3ea305(_0x5ef97f);});});}function createEndUser(_0x25556d,_0x22667d,_0x594979,_0x46baee,_0x11978b,_0x3334bb){var _0x594979=getName(_0x594979);return request({'method':_0x8367('0x28'),'uri':_0x8367('0x43')+_0x22667d+_0x8367('0x44')+_[_0x8367('0x45')](_0x3334bb['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x594979[0x1],'First_Name':_0x594979[0x0],'Phone':_0x46baee,'Owner':{'name':!_[_0x8367('0x20')](_0x11978b[_0x8367('0x46')][_0x8367('0x1c')])?_0x11978b['role'][_0x8367('0x1c')]:!_[_0x8367('0x20')](_0x11978b['first_name'])?_0x11978b[_0x8367('0x47')]+'\x20'+_0x11978b[_0x8367('0x48')]:_0x11978b[_0x8367('0x48')],'id':_0x11978b['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x25556d},'json':!![]})[_0x8367('0x2e')](function(_0x2fcf02){if(_0x2fcf02&&_0x2fcf02[_0x8367('0x41')][0x0]['code']===_0x8367('0x49')){var _0x47b38a=_0x2fcf02[_0x8367('0x41')][0x0][_0x8367('0x4a')];_0x47b38a[_0x8367('0x42')]=_[_0x8367('0x45')](_0x3334bb['moduleCreate'])+'s';return _0x47b38a;}logger[_0x8367('0x32')](_0x8367('0x3f'),JSON[_0x8367('0x12')](data));throw new Error(_0x8367('0x4b')+JSON[_0x8367('0x12')](data));})[_0x8367('0x31')](function(_0x21d7f7){console[_0x8367('0x4c')](_0x8367('0x4d'),_0x21d7f7);});}function getEndUser(_0x8e6e1b,_0x18119d,_0x3236f1,_0x6a2985,_0x47d2ea,_0x2c38c0,_0x4e7719){var _0x416837={'method':'GET','uri':'','headers':{'Authorization':_0x8367('0x4e')+_0x8e6e1b},'json':!![]};switch(_0x4e7719[_0x8367('0x4f')]){case'contact_lead':_0x416837[_0x8367('0x50')]='https://www.zohoapis.'+_0x18119d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x47d2ea+'))';return getZohoUser(_0x416837,_0x8367('0x51'))[_0x8367('0x2e')](function(_0x2afc69){if(_0x2afc69)return _0x2afc69;_0x416837['uri']=_0x8367('0x43')+_0x18119d+_0x8367('0x52')+_0x47d2ea+'))';return getZohoUser(_0x416837,'Leads')[_0x8367('0x2e')](function(_0x2e2c33){if(_0x2e2c33)return _0x2e2c33;if(_0x4e7719[_0x8367('0x53')]!='nothing'){return createEndUser(_0x8e6e1b,_0x18119d,_0x6a2985,_0x47d2ea,_0x2c38c0,_0x4e7719);}else{return{};}});});break;case _0x8367('0x54'):_0x416837[_0x8367('0x50')]=_0x8367('0x43')+_0x18119d+_0x8367('0x55')+_0x47d2ea+'))';return getZohoUser(_0x416837,_0x8367('0x51'))['then'](function(_0x4c2402){if(_0x4c2402)return _0x4c2402;if(_0x4e7719[_0x8367('0x53')]!=_0x8367('0x56')){return createEndUser(_0x8e6e1b,_0x18119d,_0x6a2985,_0x47d2ea,_0x2c38c0,_0x4e7719);}else{return{};}});break;case _0x8367('0x57'):_0x416837[_0x8367('0x50')]=_0x8367('0x43')+_0x18119d+_0x8367('0x52')+_0x47d2ea+'))';return getZohoUser(_0x416837,_0x8367('0x58'))[_0x8367('0x2e')](function(_0x376745){if(_0x376745)return _0x376745;if(_0x4e7719['moduleCreate']!=_0x8367('0x56')){return createEndUser(_0x8e6e1b,_0x18119d,_0x6a2985,_0x47d2ea,_0x2c38c0,_0x4e7719);}else{return{};}});break;}}function getCall(_0x180bf8,_0x3ef075,_0x10362c,_0x41efe6,_0x284eac,_0x1611df,_0x536061,_0x3b2c80){logger['info'](_0x8367('0x59'));var _0x3a04d5={};_0x3a04d5['Owner']={'name':!_['isNil'](_0x41efe6[_0x8367('0x46')][_0x8367('0x1c')])&&!_[_0x8367('0x20')](_0x41efe6['profile'][_0x8367('0x1c')])&&_0x41efe6[_0x8367('0x3d')][_0x8367('0x1c')]===_0x8367('0x5a')?_0x41efe6['role'][_0x8367('0x1c')]:!_['isNil'](_0x41efe6['first_name'])?_0x41efe6[_0x8367('0x47')]+'\x20'+_0x41efe6['last_name']:_0x41efe6[_0x8367('0x48')],'id':_0x41efe6['id']};_0x3a04d5['Subject']=intUtil[_0x8367('0x5b')](_0x1611df[_0x8367('0x5c')],_0x536061,'\x20');_0x3a04d5[_0x8367('0x5d')]=intUtil['getString'](_0x1611df[_0x8367('0x5e')],_0x536061,'\x0a');if(_0x284eac['enduserType']==='Contacts'){_0x3a04d5['Who_Id']={'name':!_[_0x8367('0x20')](_0x284eac[_0x8367('0x5f')])?_0x284eac[_0x8367('0x5f')]:!_[_0x8367('0x20')](_0x284eac[_0x8367('0x60')])?_0x284eac['First_Name']+'\x20'+_0x284eac[_0x8367('0x61')]:_0x284eac[_0x8367('0x61')],'id':_0x284eac['id']};}if(_0x284eac['enduserType']===_0x8367('0x58')){_0x3a04d5['What_Id']={'name':!_[_0x8367('0x20')](_0x284eac[_0x8367('0x5f')])?_0x284eac[_0x8367('0x5f')]:!_[_0x8367('0x20')](_0x284eac['First_Name'])?_0x284eac['First_Name']+'\x20'+_0x284eac[_0x8367('0x61')]:_0x284eac[_0x8367('0x61')],'id':_0x284eac['id']};_0x3a04d5['$se_module']=_[_0x8367('0x45')](_0x284eac[_0x8367('0x42')]);}if(_0x536061[_0x8367('0x62')]){_0x3a04d5['Call_Duration']=moment[_0x8367('0x63')](parseInt(_0x536061[_0x8367('0x62')])*0x3e8)[_0x8367('0x37')](_0x8367('0x64'));}else if(_0x536061[_0x8367('0x65')]&&_0x536061[_0x8367('0x66')]){_0x3a04d5[_0x8367('0x67')]=moment[_0x8367('0x63')](moment(_0x536061[_0x8367('0x66')],_0x8367('0x68'))[_0x8367('0x69')](moment(_0x536061['starttime'],_0x8367('0x68'))))[_0x8367('0x37')](_0x8367('0x64'));}switch(_0x536061['lastevent']){case _0x8367('0x6a'):_0x3a04d5[_0x8367('0x6b')]=_0x8367('0x6c');break;case _0x8367('0x6d'):case _0x8367('0x6e'):_0x3a04d5['Call_Result']=_0x8367('0x6f');break;case _0x8367('0x70'):_0x3a04d5['Call_Result']=_0x8367('0x71');break;case'abandoned':_0x3a04d5[_0x8367('0x6b')]=_0x8367('0x72');break;case _0x8367('0x73'):_0x3a04d5[_0x8367('0x6b')]=_0x8367('0x74');default:}_0x3a04d5[_0x8367('0x75')]=(_0x3b2c80===_0x8367('0x76')?moment(_0x536061['starttime'])[_0x8367('0x37')](_0x8367('0x68')):moment(_0x536061[_0x8367('0x77')])[_0x8367('0x37')](_0x8367('0x68')))||moment()[_0x8367('0x37')](_0x8367('0x68'));_0x3a04d5[_0x8367('0x78')]=_0x3b2c80||_0x8367('0x79');_0x3a04d5=_[_0x8367('0x7a')](_0x3a04d5,getCustomFields(_0x1611df[_0x8367('0x7b')],_0x536061));return request({'method':_0x8367('0x28'),'uri':_0x8367('0x43')+_0x3ef075+'/crm/v2/Calls','headers':{'Authorization':_0x8367('0x4e')+_0x180bf8},'body':{'data':[_0x3a04d5]},'json':!![]})[_0x8367('0x2e')](function(_0x4da3fe){if(_0x4da3fe&&_0x4da3fe['data'][0x0]['code']===_0x8367('0x49')){logger[_0x8367('0x35')]('Call\x20created!');return{'id':_0x4da3fe[_0x8367('0x41')][0x0][_0x8367('0x4a')]['id']};}})[_0x8367('0x31')](function(_0x4c1626){logger[_0x8367('0x35')](_0x8367('0x7c'),_0x4c1626['stack']);console[_0x8367('0x4c')](_0x8367('0x7c'),_0x4c1626);});}exports[_0x8367('0x7d')]=function(_0x107fdd,_0x1fe02c,_0x444b0d,_0x2e01ca,_0x14469d,_0x553901){var _0x9532e1,_0x24d0d2,_0x539474;_0x553901[_0x8367('0x7e')]=intUtil['stripTrailingSlash'](_0x553901[_0x8367('0x7e')]);_0x553901['serverUrl']=intUtil[_0x8367('0x7f')](_0x553901[_0x8367('0x80')]);if(_0x14469d&&_0x14469d[_0x8367('0x81')]){logger['info']('[QUEUE]',_0x8367('0x82'));_0x1fe02c['recordingURL']=_0x553901[_0x8367('0x80')]+_0x8367('0x83')+_0x1fe02c[_0x8367('0x84')]+_0x8367('0x85')+md5(_0x1fe02c[_0x8367('0x84')]);}else{_0x1fe02c[_0x8367('0x86')]='';}var _0x3980ac=_0x553901[_0x8367('0x7e')]===_0x8367('0x87')?'eu':_0x8367('0x88');return getAccessToken(_0x553901)[_0x8367('0x2e')](function(_0x2501cf){_0x539474=_0x2501cf;return getUser(_0x539474,_0x3980ac,_0x553901,_0x2e01ca[_0x8367('0x89')]);})['then'](function(_0x2ddfe3){_0x9532e1=_0x2ddfe3;logger[_0x8367('0x35')](_0x8367('0x8a'),_0x9532e1['id']);return getEndUser(_0x539474,_0x3980ac,_0x553901,_0x1fe02c[_0x8367('0x8b')],_0x1fe02c[_0x8367('0x8c')],_0x9532e1,_0x444b0d);})['then'](function(_0x163176){_0x24d0d2=_0x163176;return getCall(_0x539474,_0x3980ac,_0x553901,_0x9532e1,_0x24d0d2,_0x444b0d,_0x1fe02c,_0x8367('0x79'));})[_0x8367('0x2e')](function(_0x2187a2){if(_0x2187a2){logger[_0x8367('0x35')](_0x8367('0x8d'),_0x2187a2['id']);logger[_0x8367('0x35')](_0x8367('0x8e'),_0x8367('0x8f'));emit(util['format'](_0x8367('0x90'),_0x2e01ca[_0x8367('0x1c')]),'trigger:browser:url',{'uri':_0x8367('0x91')+_0x553901[_0x8367('0x7e')]+_0x8367('0x92')+_0x2187a2['id']});}})[_0x8367('0x31')](function(_0x22a1a7){logger[_0x8367('0x32')]('[QUEUE]',JSON[_0x8367('0x12')](_0x22a1a7));});};exports[_0x8367('0x76')]=function(_0x4820c4,_0x4cb198,_0x1452aa,_0x991a3b,_0xd642a4,_0x2386f7,_0x744bf3){var _0x581957,_0x32cd87,_0x50362d;_0x2386f7[_0x8367('0x7e')]=intUtil[_0x8367('0x7f')](_0x2386f7[_0x8367('0x7e')]);_0x2386f7[_0x8367('0x80')]=intUtil[_0x8367('0x7f')](_0x2386f7[_0x8367('0x80')]);if(_0x744bf3&&_0x744bf3[_0x8367('0x93')]&&_0x744bf3[_0x8367('0x93')]!=='none'){logger[_0x8367('0x35')](_0x8367('0x94'),_0x8367('0x82'));_0x4cb198[_0x8367('0x86')]=_0x2386f7['serverUrl']+_0x8367('0x83')+_0x4cb198[_0x8367('0x84')]+_0x8367('0x85')+md5(_0x4cb198['uniqueid']);}var _0x20395e=_0x2386f7[_0x8367('0x7e')]==='zoho.eu'?'eu':_0x8367('0x88');return getAccessToken(_0x2386f7)[_0x8367('0x2e')](function(_0x5b5741){_0x50362d=_0x5b5741;return getUser(_0x50362d,_0x20395e,_0x2386f7,_0x991a3b['email']);})[_0x8367('0x2e')](function(_0x756145){_0x581957=_0x756145;logger[_0x8367('0x35')](_0x8367('0x8a'),_0x581957['id']);return getEndUser(_0x50362d,_0x20395e,_0x2386f7,_0x4cb198[_0x8367('0x95')],_0x4cb198[_0x8367('0x96')],_0x581957,_0x1452aa);})[_0x8367('0x2e')](function(_0x322b3c){_0x32cd87=_0x322b3c;return getCall(_0x50362d,_0x20395e,_0x2386f7,_0x581957,_0x32cd87,_0x1452aa,_0x4cb198,'Outbound');})['then'](function(_0x21fff2){if(_0x21fff2){logger[_0x8367('0x35')](_0x8367('0x8d'),_0x21fff2['id']);logger[_0x8367('0x35')](_0x8367('0x94'),_0x8367('0x8f'));emit(util['format']('user:%s',_0x991a3b['name']),_0x8367('0x97'),{'uri':_0x8367('0x91')+_0x2386f7[_0x8367('0x7e')]+_0x8367('0x92')+_0x21fff2['id']});}})[_0x8367('0x31')](function(_0xdc64a9){logger[_0x8367('0x32')](_0x8367('0x94'),JSON[_0x8367('0x12')](_0xdc64a9));});};exports[_0x8367('0x98')]=function(_0x1f212b,_0x488dfa,_0x37b726,_0x1f7fde,_0x5d2f90,_0x17195e){var _0x15229b,_0x10276f,_0x39f196;_0x17195e[_0x8367('0x7e')]=intUtil[_0x8367('0x7f')](_0x17195e['host']);_0x17195e[_0x8367('0x80')]=intUtil[_0x8367('0x7f')](_0x17195e['serverUrl']);if(_0x5d2f90&&_0x5d2f90['monitor_format']){logger[_0x8367('0x35')]('['+_0x488dfa[_0x8367('0x99')][_0x8367('0x9a')]()+']',_0x8367('0x82'));_0x488dfa[_0x8367('0x86')]=_0x17195e[_0x8367('0x80')]+'/api/voice/recordings/'+_0x488dfa[_0x8367('0x84')]+_0x8367('0x85')+md5(_0x488dfa[_0x8367('0x84')]);}else{_0x488dfa[_0x8367('0x86')]='';}var _0x524962=_0x17195e[_0x8367('0x7e')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x17195e)[_0x8367('0x2e')](function(_0x564725){_0x39f196=_0x564725;return getUser(_0x39f196,_0x524962,_0x17195e);})[_0x8367('0x2e')](function(_0x115c3f){_0x15229b=_0x115c3f;logger[_0x8367('0x35')](_0x8367('0x8a'),_0x15229b['id']);return getEndUser(_0x39f196,_0x524962,_0x17195e,_0x488dfa[_0x8367('0x8b')],_0x488dfa[_0x8367('0x8c')],_0x15229b,_0x37b726);})[_0x8367('0x2e')](function(_0x49a915){_0x10276f=_0x49a915;return getCall(_0x39f196,_0x524962,_0x17195e,_0x15229b,_0x10276f,_0x37b726,_0x488dfa,'Inbound');})[_0x8367('0x2e')](function(_0xddd36b){if(_0xddd36b){logger['info']('The\x20Call\x20ID\x20is:',_0xddd36b['id']);}})[_0x8367('0x31')](function(_0x2f7d64){logger[_0x8367('0x32')]('['+_0x488dfa[_0x8367('0x99')]['toUpperCase']()+']',JSON[_0x8367('0x12')](_0x2f7d64));});}; \ 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 ddab7b5..95ac83d 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 _0xc547=['shelljs','mustache','../../../../config/logger','exec','data2','Script','data3','error','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'];(function(_0x3858cc,_0x8790fb){var _0x525ee3=function(_0x1eeb92){while(--_0x1eeb92){_0x3858cc['push'](_0x3858cc['shift']());}};_0x525ee3(++_0x8790fb);}(_0xc547,0x192));var _0x7c54=function(_0x14179f,_0x18b584){_0x14179f=_0x14179f-0x0;var _0x46ebf8=_0xc547[_0x14179f];return _0x46ebf8;};'use strict';var util=require(_0x7c54('0x0'));var sh=require(_0x7c54('0x1'));var Mustache=require(_0x7c54('0x2'));var logger=require(_0x7c54('0x3'))('trigger');exports[_0x7c54('0x4')]=function(_0x5567fe,_0x2e0acc){var _0x3cd922=_0x5567fe['data2']?_0x5567fe[_0x7c54('0x5')]:_0x7c54('0x6');var _0x2c1e2b=_0x5567fe['data3']?Mustache['render'](_0x5567fe[_0x7c54('0x7')],_0x2e0acc):_0x2e0acc;sh[_0x7c54('0x4')](_0x2c1e2b,function(_0x4094c0,_0x301936,_0x3230c7){if(_0x4094c0!==0x0){logger[_0x7c54('0x8')](util[_0x7c54('0x9')](_0x7c54('0xa'),_0x3cd922,_0x2c1e2b,_0x4094c0,_0x3230c7));}else{logger[_0x7c54('0xb')](util['format'](_0x7c54('0xc'),_0x3cd922,_0x2c1e2b,_0x301936));}});}; \ No newline at end of file +var _0x2340=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x4226a3,_0x2b5fdf){var _0x21ff9e=function(_0x4e17a2){while(--_0x4e17a2){_0x4226a3['push'](_0x4226a3['shift']());}};_0x21ff9e(++_0x2b5fdf);}(_0x2340,0xf8));var _0x0234=function(_0x3d67d9,_0x5b0e8b){_0x3d67d9=_0x3d67d9-0x0;var _0xec066e=_0x2340[_0x3d67d9];return _0xec066e;};'use strict';var util=require(_0x0234('0x0'));var sh=require(_0x0234('0x1'));var Mustache=require(_0x0234('0x2'));var logger=require('../../../../config/logger')(_0x0234('0x3'));exports['exec']=function(_0x3854c0,_0x59425f){var _0x21da32=_0x3854c0[_0x0234('0x4')]?_0x3854c0['data2']:_0x0234('0x5');var _0xd21609=_0x3854c0[_0x0234('0x6')]?Mustache[_0x0234('0x7')](_0x3854c0['data3'],_0x59425f):_0x59425f;sh['exec'](_0xd21609,function(_0x1ca24d,_0xfded56,_0x16466f){if(_0x1ca24d!==0x0){logger[_0x0234('0x8')](util[_0x0234('0x9')](_0x0234('0xa'),_0x21da32,_0xd21609,_0x1ca24d,_0x16466f));}else{logger[_0x0234('0xb')](util[_0x0234('0x9')](_0x0234('0xc'),_0x21da32,_0xd21609,_0xfded56));}});}; \ 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 5197171..371f452 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 _0x17fa=['data7','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','body','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','lodash','mustache','trigger','data1','render','data2','data5','number','stack','toUpperCase','GET','POST'];(function(_0x367367,_0x599933){var _0x22fc94=function(_0x6c2707){while(--_0x6c2707){_0x367367['push'](_0x367367['shift']());}};_0x22fc94(++_0x599933);}(_0x17fa,0xea));var _0xa17f=function(_0x756aca,_0x295527){_0x756aca=_0x756aca-0x0;var _0x26acd7=_0x17fa[_0x756aca];return _0x26acd7;};'use strict';var rp=require(_0xa17f('0x0'));var util=require(_0xa17f('0x1'));var _=require(_0xa17f('0x2'));var Mustache=require(_0xa17f('0x3'));var logger=require('../../../../config/logger')(_0xa17f('0x4'));exports['exec']=function(_0x35ad63,_0x229b77){var _0x3676dc,_0x525382;var _0x133261={'method':_0x35ad63[_0xa17f('0x5')]['toUpperCase'](),'uri':Mustache[_0xa17f('0x6')](_0x35ad63[_0xa17f('0x7')],_0x229b77),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x35ad63[_0xa17f('0x8')])===_0xa17f('0x9')&&parseInt(_0x35ad63[_0xa17f('0x8')])>=0x1&&parseInt(_0x35ad63[_0xa17f('0x8')])<=0xa?parseInt(_0x35ad63[_0xa17f('0x8')])*0x3e8:0x5*0x3e8};try{_0x133261['headers']=_0x35ad63['data6']?JSON['parse'](Mustache[_0xa17f('0x6')](_0x35ad63['data6'],_0x229b77)):{};}catch(_0x39d7c5){logger['error'](_0x39d7c5[_0xa17f('0xa')]);}switch(_0x35ad63[_0xa17f('0x5')][_0xa17f('0xb')]()){case _0xa17f('0xc'):case'DELETE':_0x3676dc=null;_0x133261['qs']=_0x229b77;break;case _0xa17f('0xd'):case'PUT':if(_0x35ad63[_0xa17f('0xe')]){try{_0x3676dc=JSON['parse'](Mustache[_0xa17f('0x6')](_0x35ad63[_0xa17f('0xe')],_0x229b77));_0x133261['body']=_0x3676dc;}catch(_0x3e563f){logger[_0xa17f('0xf')](_0x3e563f[_0xa17f('0xa')]);logger[_0xa17f('0xf')](_0xa17f('0x10'));}}else{_0x3676dc=_0x229b77;_0x133261['body']=_0x3676dc;}break;}logger[_0xa17f('0x11')](util[_0xa17f('0x12')](_0xa17f('0x13'),_0x35ad63[_0xa17f('0x5')],_0x35ad63[_0xa17f('0x7')],JSON['stringify'](_0x133261)));rp(_0x133261)[_0xa17f('0x14')](function(_0x315c0b){_0x3676dc=!_[_0xa17f('0x15')](_0x3676dc)?',\x20request\x20body:\x20'+_0x3676dc:'';_0x525382=typeof _0x315c0b[_0xa17f('0x16')]===_0xa17f('0x17')?JSON[_0xa17f('0x18')](_0x315c0b['body']):_0x315c0b[_0xa17f('0x16')];logger['info'](util['format'](_0xa17f('0x19'),_0x35ad63[_0xa17f('0x5')],_0x35ad63[_0xa17f('0x7')],_0x315c0b[_0xa17f('0x1a')],_0x525382));})[_0xa17f('0x1b')](function(_0x315a4f){logger[_0xa17f('0xf')](util['format'](_0xa17f('0x1c'),_0x35ad63[_0xa17f('0x5')],_0x35ad63[_0xa17f('0x7')],_0x315a4f[_0xa17f('0x1a')],_0x315a4f[_0xa17f('0x1d')],_0x315a4f[_0xa17f('0x1e')]));});}; \ No newline at end of file +var _0x6013=['message','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data5','number','data6','parse','error','stack','GET','DELETE','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','data2','stringify','isNil','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x342401,_0x628117){var _0x21ba20=function(_0x4fc4ca){while(--_0x4fc4ca){_0x342401['push'](_0x342401['shift']());}};_0x21ba20(++_0x628117);}(_0x6013,0x197));var _0x3601=function(_0x3bad26,_0x1cf013){_0x3bad26=_0x3bad26-0x0;var _0x42e1ff=_0x6013[_0x3bad26];return _0x42e1ff;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x3601('0x0'));var Mustache=require(_0x3601('0x1'));var logger=require(_0x3601('0x2'))(_0x3601('0x3'));exports[_0x3601('0x4')]=function(_0x38654e,_0x17c1d8){var _0x5567d9,_0x52a7b4;var _0x57118f={'method':_0x38654e[_0x3601('0x5')][_0x3601('0x6')](),'uri':Mustache[_0x3601('0x7')](_0x38654e['data2'],_0x17c1d8),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x38654e[_0x3601('0x8')])===_0x3601('0x9')&&parseInt(_0x38654e['data5'])>=0x1&&parseInt(_0x38654e['data5'])<=0xa?parseInt(_0x38654e[_0x3601('0x8')])*0x3e8:0x5*0x3e8};try{_0x57118f['headers']=_0x38654e[_0x3601('0xa')]?JSON[_0x3601('0xb')](Mustache[_0x3601('0x7')](_0x38654e['data6'],_0x17c1d8)):{};}catch(_0x187c8b){logger[_0x3601('0xc')](_0x187c8b[_0x3601('0xd')]);}switch(_0x38654e['data1'][_0x3601('0x6')]()){case _0x3601('0xe'):case _0x3601('0xf'):_0x5567d9=null;_0x57118f['qs']=_0x17c1d8;break;case _0x3601('0x10'):case'PUT':if(_0x38654e[_0x3601('0x11')]){try{_0x5567d9=JSON[_0x3601('0xb')](Mustache[_0x3601('0x7')](_0x38654e[_0x3601('0x11')],_0x17c1d8));_0x57118f[_0x3601('0x12')]=_0x5567d9;}catch(_0x3fc1b6){logger[_0x3601('0xc')](_0x3fc1b6['stack']);logger[_0x3601('0xc')](_0x3601('0x13'));}}else{_0x5567d9=_0x17c1d8;_0x57118f[_0x3601('0x12')]=_0x5567d9;}break;}logger[_0x3601('0x14')](util[_0x3601('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x38654e[_0x3601('0x5')],_0x38654e[_0x3601('0x16')],JSON[_0x3601('0x17')](_0x57118f)));rp(_0x57118f)['then'](function(_0x233edb){_0x5567d9=!_[_0x3601('0x18')](_0x5567d9)?',\x20request\x20body:\x20'+_0x5567d9:'';_0x52a7b4=typeof _0x233edb[_0x3601('0x12')]===_0x3601('0x19')?JSON[_0x3601('0x17')](_0x233edb['body']):_0x233edb[_0x3601('0x12')];logger['info'](util[_0x3601('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x38654e[_0x3601('0x5')],_0x38654e[_0x3601('0x16')],_0x233edb['statusCode'],_0x52a7b4));})[_0x3601('0x1a')](function(_0x5cb99e){logger[_0x3601('0xc')](util['format'](_0x3601('0x1b'),_0x38654e[_0x3601('0x5')],_0x38654e[_0x3601('0x16')],_0x5cb99e['statusCode'],_0x5cb99e['name'],_0x5cb99e[_0x3601('0x1c')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 5b297eb..eb52051 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 _0x4ee9=['routing','client','http','Request','debug','error','rpc','message','result','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4ee9,0x14f));var _0x94ee=function(_0x27a8e1,_0xbfecea){_0x27a8e1=_0x27a8e1-0x0;var _0x2e4d37=_0x4ee9[_0x27a8e1];return _0x2e4d37;};'use strict';var jayson=require(_0x94ee('0x0'));var BPromise=require(_0x94ee('0x1'));var logger=require(_0x94ee('0x2'))(_0x94ee('0x3'));var client=jayson[_0x94ee('0x4')][_0x94ee('0x5')]({'port':0x2329});client[_0x94ee('0x6')]=function(_0xfb6818,_0x2f0ea5){return new BPromise(function(_0x56a128,_0x414ae2){return client['request'](_0xfb6818,_0x2f0ea5)['then'](function(_0x38ebed){logger[_0x94ee('0x7')]('rpc',_0x94ee('0x3'),_0xfb6818,_0x2f0ea5,_0x38ebed);if(_0x38ebed[_0x94ee('0x8')]){logger[_0x94ee('0x8')](_0x94ee('0x9'),_0x94ee('0x3'),_0xfb6818,_0x38ebed['error']['message'],_0x2f0ea5);return _0x414ae2(_0x38ebed[_0x94ee('0x8')][_0x94ee('0xa')]);}else{return _0x56a128(_0x38ebed[_0x94ee('0xb')]);}})['catch'](function(_0x462571){logger['error'](_0x94ee('0x9'),_0x94ee('0x3'),_0xfb6818,_0x462571,_0x2f0ea5);return _0x414ae2(_0x462571);});});};module[_0x94ee('0xc')]=client; \ No newline at end of file +var _0x1983=['exports','jayson/promise','bluebird','../../config/logger','routing','client','then','rpc','error','message','result','catch'];(function(_0x87533b,_0x39971b){var _0x529e89=function(_0x2becb6){while(--_0x2becb6){_0x87533b['push'](_0x87533b['shift']());}};_0x529e89(++_0x39971b);}(_0x1983,0xfd));var _0x3198=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x1983[_0x5f1391];return _0x50ebe3;};'use strict';var jayson=require(_0x3198('0x0'));var BPromise=require(_0x3198('0x1'));var logger=require(_0x3198('0x2'))(_0x3198('0x3'));var client=jayson[_0x3198('0x4')]['http']({'port':0x2329});client['Request']=function(_0x1c0cd3,_0x4a0c55){return new BPromise(function(_0x54f6f1,_0x250e58){return client['request'](_0x1c0cd3,_0x4a0c55)[_0x3198('0x5')](function(_0x123228){logger['debug'](_0x3198('0x6'),'routing',_0x1c0cd3,_0x4a0c55,_0x123228);if(_0x123228[_0x3198('0x7')]){logger[_0x3198('0x7')](_0x3198('0x6'),'routing',_0x1c0cd3,_0x123228[_0x3198('0x7')][_0x3198('0x8')],_0x4a0c55);return _0x250e58(_0x123228[_0x3198('0x7')][_0x3198('0x8')]);}else{return _0x54f6f1(_0x123228[_0x3198('0x9')]);}})[_0x3198('0xa')](function(_0xe2188d){logger[_0x3198('0x7')](_0x3198('0x6'),_0x3198('0x3'),_0x1c0cd3,_0xe2188d,_0x4a0c55);return _0x250e58(_0xe2188d);});});};module[_0x3198('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 5eec064..eb0b7a3 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 _0x29bb=['then','refresh','mailAccounts','listen','loginMailFrequency','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','getMailAccounts'];(function(_0xe2de24,_0x4d2d4c){var _0x1f16d2=function(_0x42ac7e){while(--_0x42ac7e){_0xe2de24['push'](_0xe2de24['shift']());}};_0x1f16d2(++_0x4d2d4c);}(_0x29bb,0x13d));var _0xb29b=function(_0x32dbca,_0xd27a2c){_0x32dbca=_0x32dbca-0x0;var _0x117a0b=_0x29bb[_0x32dbca];return _0x117a0b;};'use strict';var BPromise=require('bluebird');var server=require(_0xb29b('0x0'));var Realtime=require(_0xb29b('0x1'));var EmailChannel=require(_0xb29b('0x2'));var mailAccount=require(_0xb29b('0x3'));var setting=require(_0xb29b('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xb29b('0x5')]()['then'](mailAccount[_0xb29b('0x6')]())[_0xb29b('0x7')](realtime['initMailAccounts']())[_0xb29b('0x7')](function(){email[_0xb29b('0x8')](realtime[_0xb29b('0x9')]);return realtime;});}function main(){return server[_0xb29b('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0xb29b('0x7')](function(){return setting['getSettings']();})[_0xb29b('0x7')](function(_0x5846e0){return setInterval(initRealtime,_0x5846e0[_0xb29b('0xb')]*0x3e8);})['catch'](function(_0x564ec6){console['log'](_0x564ec6);});}main(); \ No newline at end of file +var _0x254f=['resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','catch','./realtime','./rpc/mailAccount','./rpc/setting'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x254f,0x8d));var _0xf254=function(_0x2c73fd,_0x2f514f){_0x2c73fd=_0x2c73fd-0x0;var _0x9ee71c=_0x254f[_0x2c73fd];return _0x9ee71c;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0xf254('0x0'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xf254('0x1'));var setting=require(_0xf254('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xf254('0x3')]()[_0xf254('0x4')](mailAccount[_0xf254('0x5')]())['then'](realtime[_0xf254('0x6')]())[_0xf254('0x4')](function(){email[_0xf254('0x7')](realtime[_0xf254('0x8')]);return realtime;});}function main(){return server[_0xf254('0x9')](realtime,email)[_0xf254('0x4')](function(){return initRealtime();})['then'](function(){return setting[_0xf254('0xa')]();})[_0xf254('0x4')](function(_0x161005){return setInterval(initRealtime,_0x161005['loginMailFrequency']*0x3e8);})[_0xf254('0xb')](function(_0x43069b){console['log'](_0x43069b);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index a9575cc..cd23734 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 _0xd483=['verified','catch','exports','lodash','moment','bluebird','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','name','key','active','Imap','total','isNil','stringify','md5','emit','mailAccount:update','prototype','refresh','hasOwnProperty','imapAccounts','box','handleImapBox','handleImapEmail','bind','handleImapEnd','error','handleImapError','status','disabled','messageStatus','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify'];(function(_0xedda13,_0x17657b){var _0x1b73cd=function(_0x538b34){while(--_0x538b34){_0xedda13['push'](_0xedda13['shift']());}};_0x1b73cd(++_0x17657b);}(_0xd483,0xdf));var _0x3d48=function(_0xf71868,_0x58940e){_0xf71868=_0xf71868-0x0;var _0x501e32=_0xd483[_0xf71868];return _0x501e32;};'use strict';var _=require(_0x3d48('0x0'));var moment=require(_0x3d48('0x1'));var BPromise=require(_0x3d48('0x2'));var md5=require('md5');var Redis=require(_0x3d48('0x3'));var config=require('../../../config/environment');var logger=require(_0x3d48('0x4'))(_0x3d48('0x5'));config[_0x3d48('0x6')]=_[_0x3d48('0x7')](config['redis'],{'host':_0x3d48('0x8'),'port':0x18eb});var io=require(_0x3d48('0x9'))(new Redis(config['redis']));var EmailImap=require(_0x3d48('0xa'));var EmailSmtp=require(_0x3d48('0xb'));var mailAccount=require(_0x3d48('0xc'));var md5Accounts={};function EmailChannel(_0x3b2afa){logger[_0x3d48('0xd')]('start\x20email\x20channel');this['mailAccounts']=_0x3b2afa[_0x3d48('0xe')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x401570){var _0xfbfdd2=this[_0x3d48('0xe')][_0x401570];var _0x2cdd70={'id':_0xfbfdd2['id'],'name':_0xfbfdd2[_0x3d48('0xf')],'key':_0xfbfdd2[_0x3d48('0x10')],'active':_0xfbfdd2[_0x3d48('0x11')],'Imap':{'status':_0xfbfdd2[_0x3d48('0x12')]['status'],'messageStatus':_0xfbfdd2[_0x3d48('0x12')]['messageStatus'],'total':_0xfbfdd2['Imap'][_0x3d48('0x13')]}};if(_[_0x3d48('0x14')](md5Accounts[_0x401570])){md5Accounts[_0x401570]={};}var _0x84f02e=md5(JSON[_0x3d48('0x15')](_0x2cdd70));if(md5Accounts[_0x401570][_0x3d48('0x16')]!==_0x84f02e){md5Accounts[_0x401570][_0x3d48('0x16')]=_0x84f02e;io[_0x3d48('0x17')](_0x3d48('0x18'),_0x2cdd70);}};EmailChannel[_0x3d48('0x19')][_0x3d48('0x1a')]=function(_0x4c86ee){for(var _0xde83d6 in _0x4c86ee){if(_0x4c86ee[_0x3d48('0x1b')](_0xde83d6)){if(_0x4c86ee[_0xde83d6][_0x3d48('0x12')]&&_0x4c86ee[_0xde83d6][_0x3d48('0x11')]){var _0x18b7b4=_0x4c86ee[_0xde83d6][_0x3d48('0x12')];if(!this[_0x3d48('0x1c')][_0x3d48('0x1b')](_0x18b7b4['id'])){this['imapAccounts'][_0x18b7b4['id']]=new EmailImap(_0x18b7b4,_0x4c86ee[_0xde83d6]['email']);this[_0x3d48('0x1c')][_0x18b7b4['id']]['on'](_0x3d48('0x1d'),this[_0x3d48('0x1e')]['bind'](this,_0xde83d6));this[_0x3d48('0x1c')][_0x18b7b4['id']]['on'](_0x3d48('0x5'),this[_0x3d48('0x1f')][_0x3d48('0x20')](this,_0xde83d6));this[_0x3d48('0x1c')][_0x18b7b4['id']]['on']('end',this[_0x3d48('0x21')]['bind'](this,_0xde83d6));this['imapAccounts'][_0x18b7b4['id']]['on'](_0x3d48('0x22'),this[_0x3d48('0x23')][_0x3d48('0x20')](this,_0xde83d6));}}else{if(_[_0x3d48('0x14')](this[_0x3d48('0xe')][_0xde83d6]['Imap'])){this[_0x3d48('0xe')][_0xde83d6][_0x3d48('0x12')]={};}this[_0x3d48('0xe')][_0xde83d6]['Imap'][_0x3d48('0x24')]=_0x3d48('0x25');this[_0x3d48('0xe')][_0xde83d6]['Imap'][_0x3d48('0x26')]='';this[_0x3d48('0x17')](_0xde83d6);}}}};EmailChannel[_0x3d48('0x19')]['handleImapBox']=function(_0x15ab38,_0x41238a){if(this[_0x3d48('0xe')][_0x15ab38]){this['mailAccounts'][_0x15ab38][_0x3d48('0x12')][_0x3d48('0x24')]='connected';this[_0x3d48('0xe')][_0x15ab38][_0x3d48('0x12')][_0x3d48('0x26')]=_0x41238a[_0x3d48('0xf')];if(_0x41238a['messages']){this[_0x3d48('0xe')][_0x15ab38][_0x3d48('0x12')]['total']=_0x41238a[_0x3d48('0x27')][_0x3d48('0x13')];}return this[_0x3d48('0x17')](_0x15ab38);}};EmailChannel[_0x3d48('0x19')][_0x3d48('0x1f')]=function(_0x1c30d0,_0x118cf1){logger[_0x3d48('0xd')](_0x3d48('0x28'),_0x118cf1['firstName'],_0x118cf1[_0x3d48('0x29')],_0x118cf1['from'],_0x1c30d0);if(this[_0x3d48('0xe')][_0x1c30d0]){return mailAccount['notify'](_0x1c30d0,_0x118cf1)[_0x3d48('0x2a')](function(_0x5383a6){if(_0x5383a6){logger['info'](_0x3d48('0x2b'));}})['catch'](function(_0xa49ddf){logger[_0x3d48('0x22')](_0x3d48('0x2c'),JSON[_0x3d48('0x15')](_0xa49ddf));});}};EmailChannel[_0x3d48('0x19')][_0x3d48('0x21')]=function(_0x3d8e8a){if(this[_0x3d48('0xe')][_0x3d8e8a]&&this['mailAccounts'][_0x3d8e8a][_0x3d48('0x12')]){if(this[_0x3d48('0x1c')][this[_0x3d48('0xe')][_0x3d8e8a][_0x3d48('0x12')]['id']]){delete this[_0x3d48('0x1c')][this[_0x3d48('0xe')][_0x3d8e8a][_0x3d48('0x12')]['id']];}this[_0x3d48('0xe')][_0x3d8e8a][_0x3d48('0x12')][_0x3d48('0x2d')]=moment();this[_0x3d48('0x17')](_0x3d8e8a);}};EmailChannel[_0x3d48('0x19')][_0x3d48('0x23')]=function(_0xdfe89,_0x18fc47){if(this[_0x3d48('0xe')][_0xdfe89]){this['mailAccounts'][_0xdfe89][_0x3d48('0x12')][_0x3d48('0x24')]=_0x3d48('0x22');this[_0x3d48('0xe')][_0xdfe89][_0x3d48('0x12')][_0x3d48('0x26')]=_0x18fc47;return this[_0x3d48('0x17')](_0xdfe89);}};EmailChannel['prototype'][_0x3d48('0x2e')]=function(_0x3dfcf6,_0x489e99){return this[_0x3d48('0x2f')][_0x3d48('0x30')](_0x3dfcf6,_0x489e99);};EmailChannel[_0x3d48('0x19')][_0x3d48('0x31')]=function(_0x53a8e2){var _0x27249d=this;if(this[_0x3d48('0xe')][_0x53a8e2['id']]){if(_[_0x3d48('0x14')](this[_0x3d48('0xe')][_0x53a8e2['id']]['Smtp'])){this['mailAccounts'][_0x53a8e2['id']]['Smtp']={};}this[_0x3d48('0xe')][_0x53a8e2['id']][_0x3d48('0x32')][_0x3d48('0x2d')]=moment();return new BPromise(function(_0xbfcf02,_0x6c76c1){return _0x27249d[_0x3d48('0x2f')][_0x3d48('0x33')](_0x53a8e2)[_0x3d48('0x2a')](function(_0x4fe5ba){_0x27249d[_0x3d48('0xe')][_0x53a8e2['id']]['Smtp'][_0x3d48('0x24')]=_0x3d48('0x34');_0x27249d['mailAccounts'][_0x53a8e2['id']][_0x3d48('0x32')][_0x3d48('0x26')]='';_0x27249d[_0x3d48('0x17')](_0x53a8e2['id']);_0xbfcf02(_0x4fe5ba);})[_0x3d48('0x35')](function(_0x182ec5){_0x27249d[_0x3d48('0xe')][_0x53a8e2['id']][_0x3d48('0x32')][_0x3d48('0x24')]=_0x3d48('0x22');_0x27249d[_0x3d48('0xe')][_0x53a8e2['id']][_0x3d48('0x32')][_0x3d48('0x26')]=_0x182ec5;_0x27249d[_0x3d48('0x17')](_0x53a8e2['id']);_0x6c76c1(_0x182ec5);});});}return this[_0x3d48('0x2f')][_0x3d48('0x33')](_0x53a8e2);};module[_0x3d48('0x36')]=EmailChannel; \ No newline at end of file +var _0xdfbf=['socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','Imap','status','total','isNil','mailAccount:update','prototype','refresh','active','hasOwnProperty','box','handleImapBox','bind','handleImapError','disabled','messageStatus','connected','name','messages','handleImapEmail','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','send','verifySmtp','Smtp','verify','exports','lodash','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost'];(function(_0x1177db,_0x10e9a5){var _0x253c82=function(_0x582d58){while(--_0x582d58){_0x1177db['push'](_0x1177db['shift']());}};_0x253c82(++_0x10e9a5);}(_0xdfbf,0x1af));var _0xfdfb=function(_0x498ba2,_0x11182a){_0x498ba2=_0x498ba2-0x0;var _0x15cfc=_0xdfbf[_0x498ba2];return _0x15cfc;};'use strict';var _=require(_0xfdfb('0x0'));var moment=require('moment');var BPromise=require(_0xfdfb('0x1'));var md5=require(_0xfdfb('0x2'));var Redis=require('ioredis');var config=require(_0xfdfb('0x3'));var logger=require(_0xfdfb('0x4'))(_0xfdfb('0x5'));config[_0xfdfb('0x6')]=_[_0xfdfb('0x7')](config[_0xfdfb('0x6')],{'host':_0xfdfb('0x8'),'port':0x18eb});var io=require(_0xfdfb('0x9'))(new Redis(config[_0xfdfb('0x6')]));var EmailImap=require(_0xfdfb('0xa'));var EmailSmtp=require(_0xfdfb('0xb'));var mailAccount=require(_0xfdfb('0xc'));var md5Accounts={};function EmailChannel(_0x1785bd){logger[_0xfdfb('0xd')](_0xfdfb('0xe'));this[_0xfdfb('0xf')]=_0x1785bd[_0xfdfb('0xf')];this[_0xfdfb('0x10')]={};this[_0xfdfb('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xfdfb('0x12')]=function(_0x390045){var _0x3d8bf4=this[_0xfdfb('0xf')][_0x390045];var _0x5bae14={'id':_0x3d8bf4['id'],'name':_0x3d8bf4['name'],'key':_0x3d8bf4[_0xfdfb('0x13')],'active':_0x3d8bf4['active'],'Imap':{'status':_0x3d8bf4[_0xfdfb('0x14')][_0xfdfb('0x15')],'messageStatus':_0x3d8bf4[_0xfdfb('0x14')]['messageStatus'],'total':_0x3d8bf4['Imap'][_0xfdfb('0x16')]}};if(_[_0xfdfb('0x17')](md5Accounts[_0x390045])){md5Accounts[_0x390045]={};}var _0x491b0a=md5(JSON['stringify'](_0x5bae14));if(md5Accounts[_0x390045]['md5']!==_0x491b0a){md5Accounts[_0x390045][_0xfdfb('0x2')]=_0x491b0a;io['emit'](_0xfdfb('0x18'),_0x5bae14);}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x1a')]=function(_0x531f9f){for(var _0x6a70c8 in _0x531f9f){if(_0x531f9f['hasOwnProperty'](_0x6a70c8)){if(_0x531f9f[_0x6a70c8][_0xfdfb('0x14')]&&_0x531f9f[_0x6a70c8][_0xfdfb('0x1b')]){var _0x2d7029=_0x531f9f[_0x6a70c8][_0xfdfb('0x14')];if(!this['imapAccounts'][_0xfdfb('0x1c')](_0x2d7029['id'])){this[_0xfdfb('0x10')][_0x2d7029['id']]=new EmailImap(_0x2d7029,_0x531f9f[_0x6a70c8][_0xfdfb('0x5')]);this[_0xfdfb('0x10')][_0x2d7029['id']]['on'](_0xfdfb('0x1d'),this[_0xfdfb('0x1e')][_0xfdfb('0x1f')](this,_0x6a70c8));this[_0xfdfb('0x10')][_0x2d7029['id']]['on'](_0xfdfb('0x5'),this['handleImapEmail']['bind'](this,_0x6a70c8));this[_0xfdfb('0x10')][_0x2d7029['id']]['on']('end',this['handleImapEnd'][_0xfdfb('0x1f')](this,_0x6a70c8));this[_0xfdfb('0x10')][_0x2d7029['id']]['on']('error',this[_0xfdfb('0x20')][_0xfdfb('0x1f')](this,_0x6a70c8));}}else{if(_[_0xfdfb('0x17')](this[_0xfdfb('0xf')][_0x6a70c8][_0xfdfb('0x14')])){this[_0xfdfb('0xf')][_0x6a70c8][_0xfdfb('0x14')]={};}this[_0xfdfb('0xf')][_0x6a70c8][_0xfdfb('0x14')][_0xfdfb('0x15')]=_0xfdfb('0x21');this[_0xfdfb('0xf')][_0x6a70c8][_0xfdfb('0x14')][_0xfdfb('0x22')]='';this[_0xfdfb('0x12')](_0x6a70c8);}}}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x1e')]=function(_0x4f1058,_0x59ca08){if(this['mailAccounts'][_0x4f1058]){this[_0xfdfb('0xf')][_0x4f1058][_0xfdfb('0x14')][_0xfdfb('0x15')]=_0xfdfb('0x23');this[_0xfdfb('0xf')][_0x4f1058]['Imap'][_0xfdfb('0x22')]=_0x59ca08[_0xfdfb('0x24')];if(_0x59ca08[_0xfdfb('0x25')]){this[_0xfdfb('0xf')][_0x4f1058][_0xfdfb('0x14')][_0xfdfb('0x16')]=_0x59ca08[_0xfdfb('0x25')][_0xfdfb('0x16')];}return this[_0xfdfb('0x12')](_0x4f1058);}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x26')]=function(_0x507325,_0x42b00e){logger[_0xfdfb('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x42b00e[_0xfdfb('0x27')],_0x42b00e[_0xfdfb('0x28')],_0x42b00e[_0xfdfb('0x29')],_0x507325);if(this['mailAccounts'][_0x507325]){return mailAccount['notify'](_0x507325,_0x42b00e)[_0xfdfb('0x2a')](function(_0x2a8bce){if(_0x2a8bce){logger[_0xfdfb('0xd')](_0xfdfb('0x2b'));}})[_0xfdfb('0x2c')](function(_0x3f5add){logger[_0xfdfb('0x2d')](_0xfdfb('0x2e'),JSON[_0xfdfb('0x2f')](_0x3f5add));});}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x30')]=function(_0x43032d){if(this[_0xfdfb('0xf')][_0x43032d]&&this[_0xfdfb('0xf')][_0x43032d]['Imap']){if(this[_0xfdfb('0x10')][this[_0xfdfb('0xf')][_0x43032d]['Imap']['id']]){delete this[_0xfdfb('0x10')][this[_0xfdfb('0xf')][_0x43032d][_0xfdfb('0x14')]['id']];}this['mailAccounts'][_0x43032d]['Imap'][_0xfdfb('0x31')]=moment();this[_0xfdfb('0x12')](_0x43032d);}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x20')]=function(_0x455098,_0x22956b){if(this[_0xfdfb('0xf')][_0x455098]){this['mailAccounts'][_0x455098][_0xfdfb('0x14')][_0xfdfb('0x15')]='error';this[_0xfdfb('0xf')][_0x455098]['Imap']['messageStatus']=_0x22956b;return this[_0xfdfb('0x12')](_0x455098);}};EmailChannel[_0xfdfb('0x19')]['sendMail']=function(_0x34b343,_0x443d51){return this['smtp'][_0xfdfb('0x32')](_0x34b343,_0x443d51);};EmailChannel['prototype'][_0xfdfb('0x33')]=function(_0x1df2d3){var _0x4f7e1b=this;if(this[_0xfdfb('0xf')][_0x1df2d3['id']]){if(_[_0xfdfb('0x17')](this[_0xfdfb('0xf')][_0x1df2d3['id']]['Smtp'])){this[_0xfdfb('0xf')][_0x1df2d3['id']][_0xfdfb('0x34')]={};}this[_0xfdfb('0xf')][_0x1df2d3['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x32ecbb,_0x5c6c09){return _0x4f7e1b['smtp'][_0xfdfb('0x35')](_0x1df2d3)[_0xfdfb('0x2a')](function(_0x5913bb){_0x4f7e1b[_0xfdfb('0xf')][_0x1df2d3['id']]['Smtp'][_0xfdfb('0x15')]='verified';_0x4f7e1b[_0xfdfb('0xf')][_0x1df2d3['id']][_0xfdfb('0x34')][_0xfdfb('0x22')]='';_0x4f7e1b[_0xfdfb('0x12')](_0x1df2d3['id']);_0x32ecbb(_0x5913bb);})['catch'](function(_0x187d10){_0x4f7e1b[_0xfdfb('0xf')][_0x1df2d3['id']][_0xfdfb('0x34')]['status']=_0xfdfb('0x2d');_0x4f7e1b[_0xfdfb('0xf')][_0x1df2d3['id']][_0xfdfb('0x34')][_0xfdfb('0x22')]=_0x187d10;_0x4f7e1b[_0xfdfb('0x12')](_0x1df2d3['id']);_0x5c6c09(_0x187d10);});});}return this['smtp'][_0xfdfb('0x35')](_0x1df2d3);};module[_0xfdfb('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 100b0d9..948a9ab 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 _0x84ef=['util','lodash','randomstring','mailparser','simpleParser','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','imap','end','handleEnd','bind','error','inherits','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','prototype','openBox','handleOpenBox','handleError','emit','readUnseen','search','UNSEEN','handleReadUnseen','message','handleFetchMessage','handleFetchError','handleFetchEnd','handleCloseBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','closeBox','stringify','textCode','hasOwnProperty','exports','path'];(function(_0x7b44f,_0x269b15){var _0x300b99=function(_0x45c43d){while(--_0x45c43d){_0x7b44f['push'](_0x7b44f['shift']());}};_0x300b99(++_0x269b15);}(_0x84ef,0xfb));var _0xf84e=function(_0x15b79f,_0x49c437){_0x15b79f=_0x15b79f-0x0;var _0x1c4cc5=_0x84ef[_0x15b79f];return _0x1c4cc5;};'use strict';var fs=require('fs');var path=require(_0xf84e('0x0'));var util=require(_0xf84e('0x1'));var Imap=require('imap');var _=require(_0xf84e('0x2'));var rs=require(_0xf84e('0x3'));var simpleParser=require(_0xf84e('0x4'))[_0xf84e('0x5')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0xf84e('0x6'))[_0xf84e('0x7')];var utils=require(_0xf84e('0x8'));var logger=require(_0xf84e('0x9'))(_0xf84e('0xa'));function EmailImap(_0x4931b5,_0x411d48){this[_0xf84e('0xb')]=_0xf84e('0xc');this[_0xf84e('0xd')]=this[_0xf84e('0xe')](_0x4931b5,_0x411d48);this['imap']=new Imap(this[_0xf84e('0xd')]);this['imap'][_0xf84e('0xf')](_0xf84e('0x10'),this[_0xf84e('0x11')]['bind'](this));this[_0xf84e('0x12')][_0xf84e('0xf')](_0xf84e('0x13'),this[_0xf84e('0x14')][_0xf84e('0x15')](this));this['imap']['on'](_0xf84e('0x16'),this['handleError']['bind'](this));this[_0xf84e('0x12')]['connect']();}util[_0xf84e('0x17')](EmailImap,EventEmitter);EmailImap['prototype'][_0xf84e('0xe')]=function(_0x50e248,_0x342b50){var _0x199d85={'connTimeout':_0x50e248['connTimeout']?_0x50e248[_0xf84e('0x18')]*0x3e8:0x2710,'authTimeout':_0x50e248['authTimeout']?_0x50e248[_0xf84e('0x19')]*0x3e8:0x1388};if(_[_0xf84e('0x1a')](_0x50e248[_0xf84e('0x1b')])){if(_0x50e248['authentication']){_0x199d85[_0xf84e('0x1c')]=_0x50e248[_0xf84e('0x1c')];_0x199d85[_0xf84e('0x1d')]=_0x50e248[_0xf84e('0x1d')];}_0x199d85[_0xf84e('0x1e')]=_0x50e248[_0xf84e('0x1e')];_0x199d85[_0xf84e('0x1f')]=_0x50e248[_0xf84e('0x1f')]||0x3e1;if(_0x50e248['tls']){_0x199d85[_0xf84e('0x20')]=!![];}else{_0x199d85[_0xf84e('0x20')]=![];_0x199d85[_0xf84e('0x21')]=_0xf84e('0x22');}}else{_0x199d85[_0xf84e('0x1c')]=_0x50e248[_0xf84e('0x1c')];_0x199d85[_0xf84e('0x1d')]=_0x50e248[_0xf84e('0x1d')];_0x199d85[_0xf84e('0x1e')]=utils[_0xf84e('0x23')](_0x50e248['service']);_0x199d85[_0xf84e('0x1f')]=0x3e1;_0x199d85[_0xf84e('0x20')]=!![];}_0x199d85[_0xf84e('0xa')]=_0x342b50||_0x50e248[_0xf84e('0x1c')]||_0xf84e('0x24');return _0x199d85;};EmailImap[_0xf84e('0x25')][_0xf84e('0x11')]=function(){this['imap'][_0xf84e('0x26')](this[_0xf84e('0xb')],![],this[_0xf84e('0x27')][_0xf84e('0x15')](this));};EmailImap['prototype'][_0xf84e('0x27')]=function(_0x6cb275,_0x341390){if(_0x6cb275){this[_0xf84e('0x28')](_0x6cb275,!![]);}else{this[_0xf84e('0x29')]('box',_0x341390);this[_0xf84e('0x2a')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x419c2c){if(_0x419c2c){this[_0xf84e('0x28')](_0x419c2c,!![]);}else{this[_0xf84e('0x12')]['end']();}};EmailImap[_0xf84e('0x25')][_0xf84e('0x2a')]=function(){this[_0xf84e('0x12')][_0xf84e('0x2b')]([_0xf84e('0x2c')],this['handleReadUnseen'][_0xf84e('0x15')](this));};EmailImap[_0xf84e('0x25')][_0xf84e('0x2d')]=function(_0x2009af,_0x33abb8){if(_0x2009af){this[_0xf84e('0x28')](_0x2009af,!![]);}else{if(_0x33abb8['length']){try{var _0x1fd395=this[_0xf84e('0x12')]['fetch'](_0x33abb8,{'bodies':'','markSeen':!![]});_0x1fd395['on'](_0xf84e('0x2e'),this[_0xf84e('0x2f')][_0xf84e('0x15')](this));_0x1fd395[_0xf84e('0xf')](_0xf84e('0x16'),this[_0xf84e('0x30')]['bind'](this));_0x1fd395['once'](_0xf84e('0x13'),this[_0xf84e('0x31')]['bind'](this));}catch(_0x28fa36){logger[_0xf84e('0x16')](_0x28fa36);}}else{this[_0xf84e('0x12')]['closeBox'](!![],this[_0xf84e('0x32')][_0xf84e('0x15')](this));}}};EmailImap[_0xf84e('0x25')][_0xf84e('0x2f')]=function(_0x2fd1ac,_0x16cfd8){_0x2fd1ac['on'](_0xf84e('0x33'),this[_0xf84e('0x34')][_0xf84e('0x15')](this));_0x2fd1ac[_0xf84e('0xf')](_0xf84e('0x35'),this['handleMessageAttributes'][_0xf84e('0x15')](this));_0x2fd1ac[_0xf84e('0xf')](_0xf84e('0x13'),this[_0xf84e('0x36')][_0xf84e('0x15')](this));};EmailImap['prototype'][_0xf84e('0x34')]=function(_0x41154f,_0xc86588){simpleParser(_0x41154f,{'Iconv':Iconv},this[_0xf84e('0x37')][_0xf84e('0x15')](this));};EmailImap['prototype'][_0xf84e('0x38')]=function(_0x21f628){};EmailImap[_0xf84e('0x25')][_0xf84e('0x36')]=function(){};EmailImap[_0xf84e('0x25')][_0xf84e('0x37')]=function(_0x9c6138,_0x298a49){if(_0x9c6138){logger[_0xf84e('0x16')](_0x9c6138);}else{var _0x30bc3f=this;utils[_0xf84e('0x39')](this[_0xf84e('0xd')],_0x298a49,function(_0x4a2208){_0x30bc3f[_0xf84e('0x29')](_0xf84e('0xa'),_0x4a2208);});}};EmailImap[_0xf84e('0x25')][_0xf84e('0x31')]=function(){this[_0xf84e('0x12')][_0xf84e('0x3a')](!![],this['handleCloseBox'][_0xf84e('0x15')](this));};EmailImap[_0xf84e('0x25')][_0xf84e('0x30')]=function(_0x5794ae){this[_0xf84e('0x28')](_0x5794ae);this[_0xf84e('0x12')][_0xf84e('0x3a')](!![],this[_0xf84e('0x32')]['bind'](this));};EmailImap[_0xf84e('0x25')][_0xf84e('0x14')]=function(){this[_0xf84e('0x29')](_0xf84e('0x13'));};EmailImap[_0xf84e('0x25')][_0xf84e('0x28')]=function(_0x207fc4,_0x5c0738){logger[_0xf84e('0x16')](_0xf84e('0x28'),this['account'][_0xf84e('0xa')],JSON[_0xf84e('0x3b')](_0x207fc4));var _0x54898c='';if(_0x207fc4){if(_0x207fc4[_0xf84e('0x3c')]){_0x54898c=_0x207fc4[_0xf84e('0x3c')];}else{for(var _0x305cbe in _0x207fc4){if(_0x207fc4[_0xf84e('0x3d')](_0x305cbe)){_0x54898c+=_['upperFirst'](_0x305cbe)+':\x20'+_0x207fc4[_0x305cbe]+'\x0a';}}}}if(_0x5c0738){this[_0xf84e('0x12')][_0xf84e('0x13')]();}else{this[_0xf84e('0x29')](_0xf84e('0x16'),_0x54898c);this[_0xf84e('0x29')]('end');}};module[_0xf84e('0x3e')]=EmailImap; \ No newline at end of file +var _0x132f=['iconv','Iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','once','ready','end','handleEnd','bind','error','handleError','connect','inherits','authTimeout','isNil','user','password','host','port','tls','required','anonymous@xcally.com','prototype','handleReady','openBox','handleOpenBox','emit','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','attributes','handleSimpleParser','handleMessageEnd','closeBox','stringify','textCode','hasOwnProperty','path','util','imap','lodash','randomstring','mailparser'];(function(_0x143172,_0x30b931){var _0x940ffb=function(_0x1220f4){while(--_0x1220f4){_0x143172['push'](_0x143172['shift']());}};_0x940ffb(++_0x30b931);}(_0x132f,0x182));var _0xf132=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0x132f[_0x7feb90];return _0x3c5b33;};'use strict';var fs=require('fs');var path=require(_0xf132('0x0'));var util=require(_0xf132('0x1'));var Imap=require(_0xf132('0x2'));var _=require(_0xf132('0x3'));var rs=require(_0xf132('0x4'));var simpleParser=require(_0xf132('0x5'))['simpleParser'];var Iconv=require(_0xf132('0x6'))[_0xf132('0x7')];var EventEmitter=require(_0xf132('0x8'))[_0xf132('0x9')];var utils=require(_0xf132('0xa'));var logger=require('../../../config/logger')(_0xf132('0xb'));function EmailImap(_0x280c1f,_0x533464){this[_0xf132('0xc')]='INBOX';this[_0xf132('0xd')]=this[_0xf132('0xe')](_0x280c1f,_0x533464);this[_0xf132('0x2')]=new Imap(this[_0xf132('0xd')]);this[_0xf132('0x2')][_0xf132('0xf')](_0xf132('0x10'),this['handleReady']['bind'](this));this[_0xf132('0x2')][_0xf132('0xf')](_0xf132('0x11'),this[_0xf132('0x12')][_0xf132('0x13')](this));this[_0xf132('0x2')]['on'](_0xf132('0x14'),this[_0xf132('0x15')][_0xf132('0x13')](this));this[_0xf132('0x2')][_0xf132('0x16')]();}util[_0xf132('0x17')](EmailImap,EventEmitter);EmailImap['prototype'][_0xf132('0xe')]=function(_0x259b76,_0x569b7e){var _0x18f348={'connTimeout':_0x259b76['connTimeout']?_0x259b76['connTimeout']*0x3e8:0x2710,'authTimeout':_0x259b76[_0xf132('0x18')]?_0x259b76[_0xf132('0x18')]*0x3e8:0x1388};if(_[_0xf132('0x19')](_0x259b76['service'])){if(_0x259b76['authentication']){_0x18f348[_0xf132('0x1a')]=_0x259b76[_0xf132('0x1a')];_0x18f348[_0xf132('0x1b')]=_0x259b76[_0xf132('0x1b')];}_0x18f348['host']=_0x259b76[_0xf132('0x1c')];_0x18f348[_0xf132('0x1d')]=_0x259b76[_0xf132('0x1d')]||0x3e1;if(_0x259b76[_0xf132('0x1e')]){_0x18f348['tls']=!![];}else{_0x18f348[_0xf132('0x1e')]=![];_0x18f348['autotls']=_0xf132('0x1f');}}else{_0x18f348[_0xf132('0x1a')]=_0x259b76['user'];_0x18f348[_0xf132('0x1b')]=_0x259b76['password'];_0x18f348['host']=utils['getHost'](_0x259b76['service']);_0x18f348[_0xf132('0x1d')]=0x3e1;_0x18f348[_0xf132('0x1e')]=!![];}_0x18f348[_0xf132('0xb')]=_0x569b7e||_0x259b76[_0xf132('0x1a')]||_0xf132('0x20');return _0x18f348;};EmailImap[_0xf132('0x21')][_0xf132('0x22')]=function(){this['imap'][_0xf132('0x23')](this[_0xf132('0xc')],![],this[_0xf132('0x24')][_0xf132('0x13')](this));};EmailImap[_0xf132('0x21')][_0xf132('0x24')]=function(_0x6f16b1,_0x4f1e5f){if(_0x6f16b1){this[_0xf132('0x15')](_0x6f16b1,!![]);}else{this[_0xf132('0x25')]('box',_0x4f1e5f);this['readUnseen']();}};EmailImap[_0xf132('0x21')][_0xf132('0x26')]=function(_0x3933bc){if(_0x3933bc){this[_0xf132('0x15')](_0x3933bc,!![]);}else{this[_0xf132('0x2')][_0xf132('0x11')]();}};EmailImap[_0xf132('0x21')][_0xf132('0x27')]=function(){this[_0xf132('0x2')][_0xf132('0x28')]([_0xf132('0x29')],this[_0xf132('0x2a')][_0xf132('0x13')](this));};EmailImap['prototype'][_0xf132('0x2a')]=function(_0x519127,_0x4ff070){if(_0x519127){this[_0xf132('0x15')](_0x519127,!![]);}else{if(_0x4ff070['length']){try{var _0x549bd0=this[_0xf132('0x2')]['fetch'](_0x4ff070,{'bodies':'','markSeen':!![]});_0x549bd0['on'](_0xf132('0x2b'),this[_0xf132('0x2c')][_0xf132('0x13')](this));_0x549bd0[_0xf132('0xf')](_0xf132('0x14'),this[_0xf132('0x2d')][_0xf132('0x13')](this));_0x549bd0[_0xf132('0xf')](_0xf132('0x11'),this[_0xf132('0x2e')][_0xf132('0x13')](this));}catch(_0x584511){logger[_0xf132('0x14')](_0x584511);}}else{this[_0xf132('0x2')]['closeBox'](!![],this[_0xf132('0x26')][_0xf132('0x13')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x3dfda5,_0x31356c){_0x3dfda5['on'](_0xf132('0x2f'),this[_0xf132('0x30')][_0xf132('0x13')](this));_0x3dfda5[_0xf132('0xf')](_0xf132('0x31'),this['handleMessageAttributes']['bind'](this));_0x3dfda5['once']('end',this['handleMessageEnd'][_0xf132('0x13')](this));};EmailImap['prototype'][_0xf132('0x30')]=function(_0x245e1e,_0x19d0fa){simpleParser(_0x245e1e,{'Iconv':Iconv},this[_0xf132('0x32')][_0xf132('0x13')](this));};EmailImap[_0xf132('0x21')]['handleMessageAttributes']=function(_0x51e99b){};EmailImap['prototype'][_0xf132('0x33')]=function(){};EmailImap['prototype'][_0xf132('0x32')]=function(_0x54b933,_0x4f09b7){if(_0x54b933){logger[_0xf132('0x14')](_0x54b933);}else{var _0x427430=this;utils['parser'](this[_0xf132('0xd')],_0x4f09b7,function(_0x843850){_0x427430[_0xf132('0x25')](_0xf132('0xb'),_0x843850);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap'][_0xf132('0x34')](!![],this[_0xf132('0x26')][_0xf132('0x13')](this));};EmailImap[_0xf132('0x21')]['handleFetchError']=function(_0x4e9119){this['handleError'](_0x4e9119);this[_0xf132('0x2')][_0xf132('0x34')](!![],this[_0xf132('0x26')]['bind'](this));};EmailImap[_0xf132('0x21')][_0xf132('0x12')]=function(){this[_0xf132('0x25')]('end');};EmailImap[_0xf132('0x21')][_0xf132('0x15')]=function(_0x2ede85,_0x4c597f){logger[_0xf132('0x14')]('handleError',this[_0xf132('0xd')][_0xf132('0xb')],JSON[_0xf132('0x35')](_0x2ede85));var _0x391aa0='';if(_0x2ede85){if(_0x2ede85[_0xf132('0x36')]){_0x391aa0=_0x2ede85['textCode'];}else{for(var _0x4afcb0 in _0x2ede85){if(_0x2ede85[_0xf132('0x37')](_0x4afcb0)){_0x391aa0+=_['upperFirst'](_0x4afcb0)+':\x20'+_0x2ede85[_0x4afcb0]+'\x0a';}}}}if(_0x4c597f){this[_0xf132('0x2')]['end']();}else{this[_0xf132('0x25')]('error',_0x391aa0);this[_0xf132('0x25')]('end');}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 4c702e6..3e4624f 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 _0x4bfa=['send','createTransport','use','compile','sendMail','toString','prototype','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x18b978,_0x437fbd){var _0x30322c=function(_0x2b79f5){while(--_0x2b79f5){_0x18b978['push'](_0x18b978['shift']());}};_0x30322c(++_0x437fbd);}(_0x4bfa,0xb2));var _0xa4bf=function(_0x1ed354,_0x4bb5be){_0x1ed354=_0x1ed354-0x0;var _0x532757=_0x4bfa[_0x1ed354];return _0x532757;};'use strict';var nodemailer=require(_0xa4bf('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xa4bf('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0xa4bf('0x2')]=function(_0x5cbf3a,_0x42a27f){return new BPromise(function(_0x262b5f,_0x1aa79c){var _0x4d7b9b=nodemailer[_0xa4bf('0x3')](_0x5cbf3a);_0x4d7b9b[_0xa4bf('0x4')](_0xa4bf('0x5'),inlineBase64());_0x4d7b9b[_0xa4bf('0x6')](_0x42a27f,function(_0x1abc29,_0x42905d){if(_0x1abc29){_0x1aa79c(_0x1abc29[_0xa4bf('0x7')]());}else{_0x262b5f(_0x42905d);}});});};EmailSmtp[_0xa4bf('0x8')][_0xa4bf('0x9')]=function(_0x3b77e1){return new BPromise(function(_0x4307d9,_0x5976f0){var _0x1c6b20=nodemailer[_0xa4bf('0x3')](_0x3b77e1);_0x1c6b20[_0xa4bf('0x9')](function(_0x3fb792,_0x4ce5c2){if(_0x3fb792){_0x5976f0(_0x3fb792['toString']());}else{if(_0x4ce5c2){_0x4307d9(_0x4ce5c2);}else{_0x5976f0(_0xa4bf('0xa'));}}});});};module[_0xa4bf('0xb')]=EmailSmtp; \ No newline at end of file +var _0x9ef3=['toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','use','compile','sendMail'];(function(_0x40eec9,_0x817a67){var _0xfee890=function(_0x186640){while(--_0x186640){_0x40eec9['push'](_0x40eec9['shift']());}};_0xfee890(++_0x817a67);}(_0x9ef3,0x14e));var _0x39ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ef3[_0x3dd15e];return _0x231fd0;};'use strict';var nodemailer=require(_0x39ef('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x39ef('0x1'));function EmailSmtp(){}EmailSmtp[_0x39ef('0x2')]['send']=function(_0x366e30,_0x12a8dd){return new BPromise(function(_0x39c16d,_0x117bee){var _0x412754=nodemailer['createTransport'](_0x366e30);_0x412754[_0x39ef('0x3')](_0x39ef('0x4'),inlineBase64());_0x412754[_0x39ef('0x5')](_0x12a8dd,function(_0x130b1c,_0x4f5307){if(_0x130b1c){_0x117bee(_0x130b1c[_0x39ef('0x6')]());}else{_0x39c16d(_0x4f5307);}});});};EmailSmtp[_0x39ef('0x2')][_0x39ef('0x7')]=function(_0x54bc50){return new BPromise(function(_0x47c4cd,_0x17da9d){var _0x13fbf2=nodemailer['createTransport'](_0x54bc50);_0x13fbf2[_0x39ef('0x7')](function(_0x4d2cd8,_0x4712eb){if(_0x4d2cd8){_0x17da9d(_0x4d2cd8[_0x39ef('0x6')]());}else{if(_0x4712eb){_0x47c4cd(_0x4712eb);}else{_0x17da9d(_0x39ef('0x8'));}}});});};module[_0x39ef('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 3d9a507..6482583 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 _0xd47f=['parseBuffer','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','gmail','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','generate','name','indexOf','split','pop','length','isEmpty','anonymous','@xcally.com','test','html','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originCc','originTo','attach','type','attachment-','format','now','root','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system'];(function(_0x375474,_0x30e34d){var _0x46a374=function(_0x2362c9){while(--_0x2362c9){_0x375474['push'](_0x375474['shift']());}};_0x46a374(++_0x30e34d);}(_0xd47f,0x1bd));var _0xfd47=function(_0x1b31d0,_0x5b6aa2){_0x1b31d0=_0x1b31d0-0x0;var _0x209c6d=_0xd47f[_0x1b31d0];return _0x209c6d;};'use strict';var _=require(_0xfd47('0x0'));var moment=require('moment');var random=require(_0xfd47('0x1'));var fs=require('fs');var path=require(_0xfd47('0x2'));var util=require(_0xfd47('0x3'));var tnef=require(_0xfd47('0x4'));var logger=require(_0xfd47('0x5'))(_0xfd47('0x6'));var config=require(_0xfd47('0x7'));function getAddress(_0x1701c3){var _0x24b68b=_[_0xfd47('0x8')](_0x1701c3[_0xfd47('0x9')]);return _0x24b68b&&_0x24b68b[_0xfd47('0xa')]?_0x24b68b['address']:'anonymous'+random[_0xfd47('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x5cfba2){var _0x4fa356=_[_0xfd47('0x8')](_0x5cfba2[_0xfd47('0x9')]);if(_0x4fa356&&_0x4fa356[_0xfd47('0xc')]){if(_0x4fa356[_0xfd47('0xc')]==_0x4fa356[_0xfd47('0xa')]){return _0x4fa356[_0xfd47('0xc')]['substring'](0x0,_0x4fa356['name'][_0xfd47('0xd')]('@'));}var _0x5e5ad4=_0x4fa356['name'][_0xfd47('0xe')](/\s+/);return _0x5e5ad4['length']>0x1?_0x5e5ad4['slice'](0x0,-0x1)['join']('\x20'):_0x4fa356[_0xfd47('0xc')];}return'Anonymous';}function getLastName(_0x391aec){var _0x44144b=_[_0xfd47('0x8')](_0x391aec['value']);if(_0x44144b&&_0x44144b[_0xfd47('0xc')]){var _0x13fc51=_0x44144b[_0xfd47('0xc')][_0xfd47('0xe')](/\s+/);return _0x13fc51['length']>0x1?_0x13fc51[_0xfd47('0xf')]():'';}return'';}function getMails(_0x1011a3,_0x11300b){var _0x502836='';for(var _0x59f36e=0x0;_0x59f36e<_0x11300b[_0xfd47('0x9')][_0xfd47('0x10')];_0x59f36e+=0x1){if(_0x11300b[_0xfd47('0x9')][_0x59f36e][_0xfd47('0xa')]!==_0x1011a3){if(!_[_0xfd47('0x11')](_0x502836)){_0x502836+=',';}_0x502836+=_0x11300b['value'][_0x59f36e][_0xfd47('0xc')]||_0x11300b[_0xfd47('0x9')][_0x59f36e][_0xfd47('0xa')]||'';_0x502836+='\x20<';_0x502836+=_0x11300b[_0xfd47('0x9')][_0x59f36e][_0xfd47('0xa')]?_0x11300b[_0xfd47('0x9')][_0x59f36e]['address']:_0xfd47('0x12')+random['generate'](0x6)+_0xfd47('0x13');_0x502836+='>';}}return _0x502836;}function parseEmail(_0x1394a5,_0x4153f6,_0x9e3ccd){if(_0x4153f6['html']){var _0x45e681=/)<[^<]*)*<\/script>/gi;while(_0x45e681[_0xfd47('0x14')](_0x4153f6[_0xfd47('0x15')])){_0x4153f6[_0xfd47('0x15')]=_0x4153f6['html']['replace'](_0x45e681,'');}if(_0x4153f6[_0xfd47('0x15')][_0xfd47('0x16')](_0xfd47('0x17'))){var _0x42105a=[];_0x4153f6[_0xfd47('0x18')]['forEach'](_0x348f90=>{_0x42105a['push'](_0x348f90[_0xfd47('0x19')]);});var _0x26e5fa=/]+>/g;var _0x1071e6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2d319a=_0x4153f6[_0xfd47('0x15')][_0xfd47('0x1a')](_0x1071e6,_0xfd47('0x1b'));var _0x504ce5=_0x2d319a[_0xfd47('0x1a')](_0x26e5fa,_0xfd47('0x1c'));for(let _0x284964=0x0;_0x284964<_0x42105a[_0xfd47('0x10')];_0x284964++){var _0x847192=_0x504ce5[_0xfd47('0x1a')](_0xfd47('0x1c'),_0xfd47('0x1d')+_0x42105a[_0x284964]+_0xfd47('0x1e'));_0x504ce5=_0x847192;}_0x4153f6[_0xfd47('0x15')]=_0x504ce5;}_0x9e3ccd[_0xfd47('0x1f')]=_0x4153f6[_0xfd47('0x15')];}else{_0x9e3ccd['body']=_0x4153f6[_0xfd47('0x20')];}if(_0x9e3ccd[_0xfd47('0x1f')]){_0x9e3ccd[_0xfd47('0x1f')]=_0x9e3ccd['body'][_0xfd47('0x1a')](/0x0){var _0x2abfd1=[_0xfd47('0x2d'),'X-Auto-Response-Suppress:\x20All',_0xfd47('0x2e')];for(var _0x3d0e2e=0x0;_0x3d0e2e<_0x4153f6[_0xfd47('0x2c')][_0xfd47('0x10')];_0x3d0e2e++){var _0xf0727c=_[_0xfd47('0xd')](_0x2abfd1,_0x4153f6[_0xfd47('0x2c')][_0x3d0e2e][_0xfd47('0x2f')]);if(_0xf0727c>=0x0){_0x9e3ccd[_0xfd47('0x30')]=!![];}}}return _0x9e3ccd;}exports[_0xfd47('0x31')]=function(_0x3c4b7c,_0x11e823,_0x59e0ba){var _0x849492={'from':getAddress(_0x11e823[_0xfd47('0x32')]),'firstName':getFirstName(_0x11e823[_0xfd47('0x32')]),'lastName':getLastName(_0x11e823[_0xfd47('0x32')]),'mapKey':_0xfd47('0x6'),'message':{'from':getMails(_0x3c4b7c[_0xfd47('0x6')],_0x11e823['from']),'to':_0x3c4b7c[_0xfd47('0x6')],'cc':'','subject':_0x11e823[_0xfd47('0x33')]||'','messageId':_0x11e823[_0xfd47('0x34')],'inReplyTo':_0x11e823['inReplyTo'],'sentAt':moment(_0x11e823[_0xfd47('0x35')])[_0xfd47('0x27')](_0xfd47('0x36')),'attach':![],'attachments':[]}};if(!_0x11e823[_0xfd47('0x15')]&&!_0x11e823[_0xfd47('0x20')]){var _0x69b02f=_[_0xfd47('0x37')](_0x11e823['attachments'],{'contentType':_0xfd47('0x38')});if(_0x69b02f[_0xfd47('0x10')]){logger[_0xfd47('0x39')](util['format'](_0xfd47('0x3a'),_0x11e823['messageId']));tnef[_0xfd47('0x3b')](_[_0xfd47('0x3c')](_0x69b02f)['content'],function(_0x2db46b,_0x3c407c){if(_0x3c407c){_0x11e823[_0xfd47('0x15')]=_0x3c407c[_0xfd47('0x3d')]||'

Empty\x20message

';if(_0x3c407c[_0xfd47('0x3e')]){for(var _0x50e41a=0x0;_0x50e41a<_0x3c407c['Attachments'][_0xfd47('0x10')];_0x50e41a++){var _0x2e30da=_0x3c407c['Attachments'][_0x50e41a];_0x849492[_0xfd47('0x21')][_0xfd47('0x18')]['push']({'filename':_0x2e30da[_0xfd47('0x3f')],'content':Buffer[_0xfd47('0x32')](_0x2e30da[_0xfd47('0x40')])});}}}_0x59e0ba(parseEmail(_0x3c4b7c,_0x11e823,_0x849492));});}else{_0x11e823[_0xfd47('0x15')]=_0xfd47('0x41');_0x59e0ba(parseEmail(_0x3c4b7c,_0x11e823,_0x849492));}}else{_0x59e0ba(parseEmail(_0x3c4b7c,_0x11e823,_0x849492));}};exports['getHost']=function(_0x376360){switch(_0x376360){case _0xfd47('0x42'):return _0xfd47('0x43');case'yahoo':return'imap.mail.yahoo.com';case _0xfd47('0x44'):return _0xfd47('0x45');case'outlook365':return _0xfd47('0x46');}return _0xfd47('0x47');}; \ No newline at end of file +var _0x3e4d=['value','name','indexOf','split','length','slice','Anonymous','pop','html','test','includes','','body','textAsHtml','message','originCc','isEmpty','bcc','type','attachment','filename','attachment-','format','%s-%s','now','join','server/files/attachments/','writeFileSync','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','lodash','randomstring','../../../config/logger','email','../../../config/environment','address','anonymous','generate','@xcally.com','head'];(function(_0x25af06,_0x398b8b){var _0x17eddb=function(_0x24b642){while(--_0x24b642){_0x25af06['push'](_0x25af06['shift']());}};_0x17eddb(++_0x398b8b);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x51f545,_0x13ad62){_0x51f545=_0x51f545-0x0;var _0xd7b74a=_0x3e4d[_0x51f545];return _0xd7b74a;};'use strict';var _=require(_0xd3e4('0x0'));var moment=require('moment');var random=require(_0xd3e4('0x1'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require('node-tnef');var logger=require(_0xd3e4('0x2'))(_0xd3e4('0x3'));var config=require(_0xd3e4('0x4'));function getAddress(_0x5ea48b){var _0xc5abea=_['head'](_0x5ea48b['value']);return _0xc5abea&&_0xc5abea[_0xd3e4('0x5')]?_0xc5abea[_0xd3e4('0x5')]:_0xd3e4('0x6')+random[_0xd3e4('0x7')](0x6)+_0xd3e4('0x8');}function getFirstName(_0x4b3954){var _0x68d3a8=_[_0xd3e4('0x9')](_0x4b3954[_0xd3e4('0xa')]);if(_0x68d3a8&&_0x68d3a8['name']){if(_0x68d3a8[_0xd3e4('0xb')]==_0x68d3a8[_0xd3e4('0x5')]){return _0x68d3a8['name']['substring'](0x0,_0x68d3a8[_0xd3e4('0xb')][_0xd3e4('0xc')]('@'));}var _0x2f805e=_0x68d3a8[_0xd3e4('0xb')][_0xd3e4('0xd')](/\s+/);return _0x2f805e[_0xd3e4('0xe')]>0x1?_0x2f805e[_0xd3e4('0xf')](0x0,-0x1)['join']('\x20'):_0x68d3a8[_0xd3e4('0xb')];}return _0xd3e4('0x10');}function getLastName(_0x27f3a7){var _0x4f15ef=_['head'](_0x27f3a7[_0xd3e4('0xa')]);if(_0x4f15ef&&_0x4f15ef['name']){var _0x33daec=_0x4f15ef[_0xd3e4('0xb')]['split'](/\s+/);return _0x33daec[_0xd3e4('0xe')]>0x1?_0x33daec[_0xd3e4('0x11')]():'';}return'';}function getMails(_0x4d5136,_0x4fae0a){var _0x5acc91='';for(var _0x353f84=0x0;_0x353f84<_0x4fae0a[_0xd3e4('0xa')][_0xd3e4('0xe')];_0x353f84+=0x1){if(_0x4fae0a[_0xd3e4('0xa')][_0x353f84][_0xd3e4('0x5')]!==_0x4d5136){if(!_['isEmpty'](_0x5acc91)){_0x5acc91+=',';}_0x5acc91+=_0x4fae0a[_0xd3e4('0xa')][_0x353f84][_0xd3e4('0xb')]||_0x4fae0a[_0xd3e4('0xa')][_0x353f84]['address']||'';_0x5acc91+='\x20<';_0x5acc91+=_0x4fae0a[_0xd3e4('0xa')][_0x353f84][_0xd3e4('0x5')]?_0x4fae0a[_0xd3e4('0xa')][_0x353f84]['address']:_0xd3e4('0x6')+random[_0xd3e4('0x7')](0x6)+_0xd3e4('0x8');_0x5acc91+='>';}}return _0x5acc91;}function parseEmail(_0x44dd10,_0x4386b0,_0xa147d2){if(_0x4386b0[_0xd3e4('0x12')]){var _0x186786=/)<[^<]*)*<\/script>/gi;while(_0x186786[_0xd3e4('0x13')](_0x4386b0[_0xd3e4('0x12')])){_0x4386b0['html']=_0x4386b0[_0xd3e4('0x12')]['replace'](_0x186786,'');}if(_0x4386b0[_0xd3e4('0x12')][_0xd3e4('0x14')](_0xd3e4('0x15'))){var _0x82d2c5=[];_0x4386b0[_0xd3e4('0x16')][_0xd3e4('0x17')](_0x16a06e=>{_0x82d2c5['push'](_0x16a06e['filename']);});var _0x81b1f5=/]+>/g;var _0x239763=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xebf9ff=_0x4386b0[_0xd3e4('0x12')][_0xd3e4('0x18')](_0x239763,_0xd3e4('0x19'));var _0x462586=_0xebf9ff['replace'](_0x81b1f5,'_IMG');for(let _0x578c9e=0x0;_0x578c9e<_0x82d2c5[_0xd3e4('0xe')];_0x578c9e++){var _0x5e96fc=_0x462586[_0xd3e4('0x18')](_0xd3e4('0x1a'),'\x20[Attachment:\x20'+_0x82d2c5[_0x578c9e]+_0xd3e4('0x1b'));_0x462586=_0x5e96fc;}_0x4386b0[_0xd3e4('0x12')]=_0x462586;}_0xa147d2[_0xd3e4('0x1c')]=_0x4386b0[_0xd3e4('0x12')];}else{_0xa147d2[_0xd3e4('0x1c')]=_0x4386b0[_0xd3e4('0x1d')];}if(_0xa147d2[_0xd3e4('0x1c')]){_0xa147d2[_0xd3e4('0x1c')]=_0xa147d2[_0xd3e4('0x1c')][_0xd3e4('0x18')](/0x0){var _0x576d32=[_0xd3e4('0x30'),'X-Auto-Response-Suppress:\x20All',_0xd3e4('0x31')];for(var _0x52f496=0x0;_0x52f496<_0x4386b0[_0xd3e4('0x2f')][_0xd3e4('0xe')];_0x52f496++){var _0xcee5c=_[_0xd3e4('0xc')](_0x576d32,_0x4386b0[_0xd3e4('0x2f')][_0x52f496][_0xd3e4('0x32')]);if(_0xcee5c>=0x0){_0xa147d2[_0xd3e4('0x33')]=!![];}}}return _0xa147d2;}exports['parser']=function(_0x4fef51,_0x5b97f8,_0x768fd1){var _0x32e5a5={'from':getAddress(_0x5b97f8[_0xd3e4('0x34')]),'firstName':getFirstName(_0x5b97f8[_0xd3e4('0x34')]),'lastName':getLastName(_0x5b97f8[_0xd3e4('0x34')]),'mapKey':_0xd3e4('0x3'),'message':{'from':getMails(_0x4fef51[_0xd3e4('0x3')],_0x5b97f8[_0xd3e4('0x34')]),'to':_0x4fef51[_0xd3e4('0x3')],'cc':'','subject':_0x5b97f8[_0xd3e4('0x35')]||'','messageId':_0x5b97f8['messageId'],'inReplyTo':_0x5b97f8[_0xd3e4('0x36')],'sentAt':moment(_0x5b97f8[_0xd3e4('0x37')])[_0xd3e4('0x26')](_0xd3e4('0x38')),'attach':![],'attachments':[]}};if(!_0x5b97f8[_0xd3e4('0x12')]&&!_0x5b97f8[_0xd3e4('0x1d')]){var _0x1e4d83=_[_0xd3e4('0x39')](_0x5b97f8[_0xd3e4('0x16')],{'contentType':_0xd3e4('0x3a')});if(_0x1e4d83[_0xd3e4('0xe')]){logger[_0xd3e4('0x3b')](util['format'](_0xd3e4('0x3c'),_0x5b97f8[_0xd3e4('0x3d')]));tnef[_0xd3e4('0x3e')](_['first'](_0x1e4d83)[_0xd3e4('0x2c')],function(_0x515728,_0x199354){if(_0x199354){_0x5b97f8[_0xd3e4('0x12')]=_0x199354[_0xd3e4('0x3f')]||_0xd3e4('0x40');if(_0x199354[_0xd3e4('0x41')]){for(var _0x4e113c=0x0;_0x4e113c<_0x199354[_0xd3e4('0x41')][_0xd3e4('0xe')];_0x4e113c++){var _0x56ad46=_0x199354[_0xd3e4('0x41')][_0x4e113c];_0x32e5a5[_0xd3e4('0x1e')][_0xd3e4('0x16')]['push']({'filename':_0x56ad46[_0xd3e4('0x42')],'content':Buffer[_0xd3e4('0x34')](_0x56ad46[_0xd3e4('0x43')])});}}}_0x768fd1(parseEmail(_0x4fef51,_0x5b97f8,_0x32e5a5));});}else{_0x5b97f8[_0xd3e4('0x12')]=_0xd3e4('0x40');_0x768fd1(parseEmail(_0x4fef51,_0x5b97f8,_0x32e5a5));}}else{_0x768fd1(parseEmail(_0x4fef51,_0x5b97f8,_0x32e5a5));}};exports[_0xd3e4('0x44')]=function(_0x380e65){switch(_0x380e65){case'gmail':return _0xd3e4('0x45');case _0xd3e4('0x46'):return _0xd3e4('0x47');case _0xd3e4('0x48'):return'imap-mail.outlook.com';case _0xd3e4('0x49'):return _0xd3e4('0x4a');}return'127.0.0.1';}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 7043501..d1b84aa 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 _0xa0c6=['key','SERV','active','Imap','Smtp','lodash','name','Service'];(function(_0x5c304e,_0x358468){var _0x2a70ed=function(_0x4fabff){while(--_0x4fabff){_0x5c304e['push'](_0x5c304e['shift']());}};_0x2a70ed(++_0x358468);}(_0xa0c6,0xfd));var _0x6a0c=function(_0x3f4448,_0x22911c){_0x3f4448=_0x3f4448-0x0;var _0x152ac7=_0xa0c6[_0x3f4448];return _0x152ac7;};'use strict';var _=require(_0x6a0c('0x0'));function MailAccount(_0x220355){this['id']=_0x220355['id']||0x0;this[_0x6a0c('0x1')]=_0x220355['name']||_0x6a0c('0x2');this[_0x6a0c('0x3')]=_0x220355['key']||_0x6a0c('0x4');this['active']=_0x220355[_0x6a0c('0x5')]||![];this[_0x6a0c('0x6')]=_0x220355[_0x6a0c('0x6')]||[];this[_0x6a0c('0x7')]=_0x220355['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x5a80=['Service','key','SERV','active','Imap','Smtp','lodash','name'];(function(_0x58f2bb,_0x106aa5){var _0x5be0f3=function(_0x3d76e4){while(--_0x3d76e4){_0x58f2bb['push'](_0x58f2bb['shift']());}};_0x5be0f3(++_0x106aa5);}(_0x5a80,0x196));var _0x05a8=function(_0x35f28e,_0x2a7413){_0x35f28e=_0x35f28e-0x0;var _0x2fa36d=_0x5a80[_0x35f28e];return _0x2fa36d;};'use strict';var _=require(_0x05a8('0x0'));function MailAccount(_0x2d9f24){this['id']=_0x2d9f24['id']||0x0;this[_0x05a8('0x1')]=_0x2d9f24['name']||_0x05a8('0x2');this[_0x05a8('0x3')]=_0x2d9f24['key']||_0x05a8('0x4');this[_0x05a8('0x5')]=_0x2d9f24[_0x05a8('0x5')]||![];this[_0x05a8('0x6')]=_0x2d9f24['Imap']||[];this[_0x05a8('0x7')]=_0x2d9f24[_0x05a8('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 0e2ab17..37b184b 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 _0x42f0=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','exports','../model/mailAccount'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x42f0,0xdb));var _0x042f=function(_0xb9d405,_0x41e8eb){_0xb9d405=_0xb9d405-0x0;var _0x2dfdf0=_0x42f0[_0xb9d405];return _0x2dfdf0;};'use strict';var _=require('lodash');var MailAccount=require(_0x042f('0x0'));var Realtime=function(){this[_0x042f('0x1')]={};};function freeIsNotKey(_0x53ea87,_0x33646f,_0x3a3d73){var _0x5da1d4=_[_0x042f('0x2')](_0x53ea87,function(_0x289be6,_0x5e267d){return _0x289be6[_0x3a3d73];});for(var _0x1677b8 in _0x33646f){if(_0x33646f[_0x042f('0x3')](_0x1677b8)){if(!_0x5da1d4[_0x1677b8]){delete _0x33646f[_0x1677b8];}}}}Realtime[_0x042f('0x4')][_0x042f('0x5')]=function(_0x5f2de6,_0x496eb3){for(var _0x457129 in _0x496eb3){if(_0x5f2de6['hasOwnProperty'](_0x457129)){_0x5f2de6[_0x457129]=_0x496eb3[_0x457129];}}};Realtime[_0x042f('0x4')][_0x042f('0x6')]=function(){var _0x16f5f4=this;return function(_0x1970f0){if(_0x1970f0){freeIsNotKey(_0x1970f0,_0x16f5f4[_0x042f('0x1')],'id');for(var _0x3692e6=0x0,_0x2974dd={},_0x5f58d5={};_0x3692e6<_0x1970f0[_0x042f('0x7')];_0x3692e6+=0x1){_0x2974dd=_0x1970f0[_0x3692e6];if(_[_0x042f('0x8')](_0x16f5f4[_0x042f('0x1')][_0x2974dd['id']])){_0x16f5f4['mailAccounts'][_0x2974dd['id']]=new MailAccount(_0x2974dd);}else{_['merge'](_0x16f5f4['mailAccounts'][_0x2974dd['id']],_0x2974dd);}}}return _0x16f5f4['mailAccounts'];};};module[_0x042f('0x9')]=Realtime; \ No newline at end of file +var _0x5136=['prototype','mergeFromDatabase','initMailAccounts','isUndefined','lodash','../model/mailAccount','mailAccounts','hasOwnProperty'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5136,0x1ac));var _0x6513=function(_0x152620,_0x102bb1){_0x152620=_0x152620-0x0;var _0x3cc6fa=_0x5136[_0x152620];return _0x3cc6fa;};'use strict';var _=require(_0x6513('0x0'));var MailAccount=require(_0x6513('0x1'));var Realtime=function(){this[_0x6513('0x2')]={};};function freeIsNotKey(_0x5170da,_0x4a43ce,_0x5ab7bf){var _0x532f81=_['mapKeys'](_0x5170da,function(_0x8d69ad,_0x3eee8b){return _0x8d69ad[_0x5ab7bf];});for(var _0x4fa228 in _0x4a43ce){if(_0x4a43ce[_0x6513('0x3')](_0x4fa228)){if(!_0x532f81[_0x4fa228]){delete _0x4a43ce[_0x4fa228];}}}}Realtime[_0x6513('0x4')][_0x6513('0x5')]=function(_0x593976,_0x488d9b){for(var _0x1fdd0f in _0x488d9b){if(_0x593976[_0x6513('0x3')](_0x1fdd0f)){_0x593976[_0x1fdd0f]=_0x488d9b[_0x1fdd0f];}}};Realtime[_0x6513('0x4')][_0x6513('0x6')]=function(){var _0x127770=this;return function(_0x16cc0c){if(_0x16cc0c){freeIsNotKey(_0x16cc0c,_0x127770[_0x6513('0x2')],'id');for(var _0x3a26d0=0x0,_0x59909e={},_0x46a869={};_0x3a26d0<_0x16cc0c['length'];_0x3a26d0+=0x1){_0x59909e=_0x16cc0c[_0x3a26d0];if(_[_0x6513('0x7')](_0x127770[_0x6513('0x2')][_0x59909e['id']])){_0x127770[_0x6513('0x2')][_0x59909e['id']]=new MailAccount(_0x59909e);}else{_['merge'](_0x127770[_0x6513('0x2')][_0x59909e['id']],_0x59909e);}}}return _0x127770[_0x6513('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index c5c36f2..64fc5ed 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 _0x3fc6=['MailServerOut','Smtp','getMailAccount','NotifyMailAccount','../client','Request','GetMailAccount','name','service','active','key','ListId','MailServerIn'];(function(_0x4abeab,_0x142980){var _0x243ac9=function(_0x1cc52d){while(--_0x1cc52d){_0x4abeab['push'](_0x4abeab['shift']());}};_0x243ac9(++_0x142980);}(_0x3fc6,0x115));var _0x63fc=function(_0x95bd83,_0x12183b){_0x95bd83=_0x95bd83-0x0;var _0x4d2fc1=_0x3fc6[_0x95bd83];return _0x4d2fc1;};'use strict';var client=require(_0x63fc('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x63fc('0x1')](_0x63fc('0x2'),{'options':{'attributes':['id',_0x63fc('0x3'),_0x63fc('0x4'),'email',_0x63fc('0x5'),_0x63fc('0x6'),_0x63fc('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0x63fc('0x8'),'as':'Imap'},{'model':_0x63fc('0x9'),'as':_0x63fc('0xa')}]},'log':_0x63fc('0xb')});};};exports['notify']=function(_0x3ec832,_0xffe000){return client[_0x63fc('0x1')](_0x63fc('0xc'),{'account':{'id':_0x3ec832},'body':_0xffe000,'log':_0x63fc('0xc')});}; \ No newline at end of file +var _0xa68e=['MailServerIn','MailServerOut','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','service','email','active','key','ListId','TemplateId'];(function(_0x2d1cfe,_0x57bf1a){var _0x559449=function(_0x12e885){while(--_0x12e885){_0x2d1cfe['push'](_0x2d1cfe['shift']());}};_0x559449(++_0x57bf1a);}(_0xa68e,0xd3));var _0xea68=function(_0x509b99,_0x3ff1f0){_0x509b99=_0x509b99-0x0;var _0x383d46=_0xa68e[_0x509b99];return _0x383d46;};'use strict';var client=require(_0xea68('0x0'));exports[_0xea68('0x1')]=function(){return function(){return client['Request'](_0xea68('0x2'),{'options':{'attributes':['id',_0xea68('0x3'),_0xea68('0x4'),_0xea68('0x5'),_0xea68('0x6'),_0xea68('0x7'),_0xea68('0x8'),_0xea68('0x9')],'raw':![],'include':[{'model':_0xea68('0xa'),'as':'Imap'},{'model':_0xea68('0xb'),'as':_0xea68('0xc')}]},'log':_0xea68('0xd')});};};exports[_0xea68('0xe')]=function(_0xddd0a3,_0x33a901){return client[_0xea68('0xf')](_0xea68('0x10'),{'account':{'id':_0xddd0a3},'body':_0x33a901,'log':_0xea68('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 354c257..a3cfa52 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 _0x5607=['getSettings','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x5607,0xe5));var _0x7560=function(_0xf3acd9,_0x3d6149){_0xf3acd9=_0xf3acd9-0x0;var _0x58a170=_0x5607[_0xf3acd9];return _0x58a170;};'use strict';var client=require(_0x7560('0x0'));exports[_0x7560('0x1')]=function(){return client['Request'](_0x7560('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7560('0x3')]},'log':_0x7560('0x4')});}; \ No newline at end of file +var _0xd683=['Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x211f51,_0x3af006){var _0x152287=function(_0x39b7af){while(--_0x39b7af){_0x211f51['push'](_0x211f51['shift']());}};_0x152287(++_0x3af006);}(_0xd683,0x168));var _0x3d68=function(_0x1671e8,_0x405093){_0x1671e8=_0x1671e8-0x0;var _0x4c2781=_0xd683[_0x1671e8];return _0x4c2781;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x3d68('0x0')](_0x3d68('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3d68('0x2')]},'log':_0x3d68('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 302ed61..0cdaeb2 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 b9c932a..6dadd20 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 _0xa330=['../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','express','sticky-session','../../config/environment','createServer','socket.io','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express'];(function(_0xdbc911,_0x187ee5){var _0x594fa1=function(_0x533f85){while(--_0x533f85){_0xdbc911['push'](_0xdbc911['shift']());}};_0x594fa1(++_0x187ee5);}(_0xa330,0x1bb));var _0x0a33=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xa330[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x0a33('0x0'));var http=require(_0x0a33('0x1'));var express=require(_0x0a33('0x2'));var sticky=require(_0x0a33('0x3'));var Redis=require('ioredis');var config=require(_0x0a33('0x4'));var app=express();var server=http[_0x0a33('0x5')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x0a33('0x6'))(server,{'transports':[_0x0a33('0x7'),_0x0a33('0x8')]});config[_0x0a33('0x9')]=_[_0x0a33('0xa')](config[_0x0a33('0x9')],{'host':_0x0a33('0xb'),'port':0x18eb});socketio['adapter'](require(_0x0a33('0xc'))({'pubClient':new Redis(config[_0x0a33('0x9')]),'subClient':new Redis(config[_0x0a33('0x9')])}));require(_0x0a33('0xd'))[_0x0a33('0xe')]();require(_0x0a33('0xf'))[_0x0a33('0xe')](socketio);require(_0x0a33('0x10'))['default'](app);require(_0x0a33('0x11'))[_0x0a33('0xe')](app);}else{server[_0x0a33('0x12')](_0x0a33('0x13'),function(){console['log'](_0x0a33('0x14'),config[_0x0a33('0x15')]);});}exports=module[_0x0a33('0x16')]=app; \ No newline at end of file +var _0x0dc9=['listen','socket.io','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','ioredis','../../config/environment','createServer','timeout'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x0dc9,0xe0));var _0x90dc=function(_0x2a0824,_0x21d97a){_0x2a0824=_0x2a0824-0x0;var _0x1a78f7=_0x0dc9[_0x2a0824];return _0x1a78f7;};'use strict';var _=require(_0x90dc('0x0'));var http=require(_0x90dc('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0x90dc('0x2'));var config=require(_0x90dc('0x3'));var app=express();var server=http[_0x90dc('0x4')](app);server[_0x90dc('0x5')]=0xdbba0;if(sticky[_0x90dc('0x6')](server,config['port'])){var socketio=require(_0x90dc('0x7'))(server,{'transports':[_0x90dc('0x8'),_0x90dc('0x9')]});config[_0x90dc('0xa')]=_[_0x90dc('0xb')](config[_0x90dc('0xa')],{'host':_0x90dc('0xc'),'port':0x18eb});socketio['adapter'](require(_0x90dc('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x90dc('0xe'))[_0x90dc('0xf')]();require('../../config/socketio')[_0x90dc('0xf')](socketio);require('../../config/express')[_0x90dc('0xf')](app);require(_0x90dc('0x10'))[_0x90dc('0xf')](app);}else{server[_0x90dc('0x11')](_0x90dc('0x12'),function(){console[_0x90dc('0x13')](_0x90dc('0x14'),config[_0x90dc('0x15')]);});}exports=module[_0x90dc('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index cc559dc..e9b0316 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 _0xc270=['../../config/logger','routing','client','http','Request','request','then','rpc','error','message','result','jayson/promise','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc270,0xce));var _0x0c27=function(_0x3b8fd2,_0x144c2b){_0x3b8fd2=_0x3b8fd2-0x0;var _0x327780=_0xc270[_0x3b8fd2];return _0x327780;};'use strict';var jayson=require(_0x0c27('0x0'));var BPromise=require(_0x0c27('0x1'));var logger=require(_0x0c27('0x2'))(_0x0c27('0x3'));var client=jayson[_0x0c27('0x4')][_0x0c27('0x5')]({'port':0x2329});client[_0x0c27('0x6')]=function(_0x5ba414,_0x117ae1){return new BPromise(function(_0x120066,_0x40f56a){return client[_0x0c27('0x7')](_0x5ba414,_0x117ae1)[_0x0c27('0x8')](function(_0x2b9fe9){logger['debug'](_0x0c27('0x9'),_0x0c27('0x3'),_0x5ba414,_0x117ae1,_0x2b9fe9);if(_0x2b9fe9['error']){logger[_0x0c27('0xa')](_0x0c27('0x9'),_0x0c27('0x3'),_0x5ba414,_0x2b9fe9[_0x0c27('0xa')][_0x0c27('0xb')],_0x117ae1);return _0x40f56a(_0x2b9fe9['error'][_0x0c27('0xb')]);}else{return _0x120066(_0x2b9fe9[_0x0c27('0xc')]);}})['catch'](function(_0x1f4345){logger['error'](_0x0c27('0x9'),_0x0c27('0x3'),_0x5ba414,_0x1f4345,_0x117ae1);return _0x40f56a(_0x1f4345);});});};module['exports']=client; \ No newline at end of file +var _0xd94c=['then','debug','rpc','error','message','result','jayson/promise','../../config/logger','routing','client','http','request'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0xd94c,0xde));var _0xcd94=function(_0x22b1c4,_0x34032b){_0x22b1c4=_0x22b1c4-0x0;var _0x37be68=_0xd94c[_0x22b1c4];return _0x37be68;};'use strict';var jayson=require(_0xcd94('0x0'));var BPromise=require('bluebird');var logger=require(_0xcd94('0x1'))(_0xcd94('0x2'));var client=jayson[_0xcd94('0x3')][_0xcd94('0x4')]({'port':0x2329});client['Request']=function(_0x42bb42,_0x5b961f){return new BPromise(function(_0x19a144,_0x2f6cb4){return client[_0xcd94('0x5')](_0x42bb42,_0x5b961f)[_0xcd94('0x6')](function(_0x166a31){logger[_0xcd94('0x7')](_0xcd94('0x8'),_0xcd94('0x2'),_0x42bb42,_0x5b961f,_0x166a31);if(_0x166a31['error']){logger['error'](_0xcd94('0x8'),_0xcd94('0x2'),_0x42bb42,_0x166a31[_0xcd94('0x9')][_0xcd94('0xa')],_0x5b961f);return _0x2f6cb4(_0x166a31[_0xcd94('0x9')][_0xcd94('0xa')]);}else{return _0x19a144(_0x166a31[_0xcd94('0xb')]);}})['catch'](function(_0x702d3b){logger[_0xcd94('0x9')]('rpc',_0xcd94('0x2'),_0x42bb42,_0x702d3b,_0x5b961f);return _0x2f6cb4(_0x702d3b);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index d1bf183..ef718f1 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 _0x798f=['getMailQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','getAgents','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x798f,0x1c0));var _0xf798=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x798f[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0xf798('0x0'));var server=require(_0xf798('0x1'));var Realtime=require(_0xf798('0x2'));var user=require(_0xf798('0x3'));var interval=require(_0xf798('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xf798('0x5'));var smsQueue=require(_0xf798('0x6'));var mailQueue=require(_0xf798('0x7'));var faxQueue=require(_0xf798('0x8'));var whatsappQueue=require(_0xf798('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0xf798('0xa')]())[_0xf798('0xb')](realtime[_0xf798('0xc')]())[_0xf798('0xb')](interval[_0xf798('0xd')]())['then'](realtime['initIntervals']())[_0xf798('0xb')](openchannelQueue[_0xf798('0xe')]())[_0xf798('0xb')](realtime[_0xf798('0xf')]())['then'](chatQueue[_0xf798('0x10')]())[_0xf798('0xb')](realtime[_0xf798('0x11')]())['then'](smsQueue[_0xf798('0x12')]())['then'](realtime[_0xf798('0x13')]())[_0xf798('0xb')](mailQueue[_0xf798('0x14')]())['then'](realtime['initMailQueues']())[_0xf798('0xb')](faxQueue['getFaxQueues']())[_0xf798('0xb')](realtime[_0xf798('0x15')]())[_0xf798('0xb')](whatsappQueue[_0xf798('0x16')]())[_0xf798('0xb')](realtime['initWhatsappQueues']())[_0xf798('0xb')](function(){return realtime;});}function main(){return server[_0xf798('0x17')](realtime)[_0xf798('0xb')](function(_0x57f924){return initRealtime();})[_0xf798('0xb')](function(_0x3a576c){return setInterval(initRealtime,0x1388);})[_0xf798('0x18')](function(_0xfb9994){console[_0xf798('0x19')](_0xfb9994);});}main(); \ No newline at end of file +var _0x8f4d=['./rpc/mailQueue','./rpc/whatsappQueue','then','initAgents','initIntervals','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x3ba2a0,_0x5453a5){var _0x575d6c=function(_0x122450){while(--_0x122450){_0x3ba2a0['push'](_0x3ba2a0['shift']());}};_0x575d6c(++_0x5453a5);}(_0x8f4d,0x181));var _0xd8f4=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x8f4d[_0x9c2427];return _0x51984f;};'use strict';var BPromise=require(_0xd8f4('0x0'));var server=require(_0xd8f4('0x1'));var Realtime=require(_0xd8f4('0x2'));var user=require('./rpc/user');var interval=require(_0xd8f4('0x3'));var openchannelQueue=require(_0xd8f4('0x4'));var chatQueue=require(_0xd8f4('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xd8f4('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xd8f4('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xd8f4('0x8')](user['getAgents']())['then'](realtime[_0xd8f4('0x9')]())[_0xd8f4('0x8')](interval['getIntervals']())[_0xd8f4('0x8')](realtime[_0xd8f4('0xa')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0xd8f4('0x8')](realtime['initOpenchannelQueues']())[_0xd8f4('0x8')](chatQueue[_0xd8f4('0xb')]())['then'](realtime[_0xd8f4('0xc')]())[_0xd8f4('0x8')](smsQueue[_0xd8f4('0xd')]())[_0xd8f4('0x8')](realtime[_0xd8f4('0xe')]())[_0xd8f4('0x8')](mailQueue[_0xd8f4('0xf')]())[_0xd8f4('0x8')](realtime[_0xd8f4('0x10')]())[_0xd8f4('0x8')](faxQueue[_0xd8f4('0x11')]())[_0xd8f4('0x8')](realtime[_0xd8f4('0x12')]())[_0xd8f4('0x8')](whatsappQueue[_0xd8f4('0x13')]())[_0xd8f4('0x8')](realtime[_0xd8f4('0x14')]())[_0xd8f4('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x21a521){return initRealtime();})[_0xd8f4('0x8')](function(_0x1b8315){return setInterval(initRealtime,0x1388);})[_0xd8f4('0x15')](function(_0xb7fb01){console[_0xd8f4('0x16')](_0xb7fb01);});}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 06dad52..c9619c9 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 _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x4ea6ae,_0x2644d0){var _0x17704b=function(_0x14cb82){while(--_0x14cb82){_0x4ea6ae['push'](_0x4ea6ae['shift']());}};_0x17704b(++_0x2644d0);}(_0x326f,0xd1));var _0xf326=function(_0x1bc309,_0x1ae77e){_0x1bc309=_0x1bc309-0x0;var _0x135109=_0x326f[_0x1bc309];return _0x135109;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x3dd3bc,_0x32950b){var _0x172373=function(_0x2b0f0d){while(--_0x2b0f0d){_0x3dd3bc['push'](_0x3dd3bc['shift']());}};_0x172373(++_0x32950b);}(_0x326f,0xd1));var _0xf326=function(_0xf8bcb8,_0x1710db){_0xf8bcb8=_0xf8bcb8-0x0;var _0x112c38=_0x326f[_0xf8bcb8];return _0x112c38;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};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 615fc73..3aabf7b 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 _0x08bf=['result','SendMail','bluebird','client','http','request','then','error','message'];(function(_0xf7c93e,_0x586f4b){var _0x2e3b2a=function(_0x2d2d78){while(--_0x2d2d78){_0xf7c93e['push'](_0xf7c93e['shift']());}};_0x2e3b2a(++_0x586f4b);}(_0x08bf,0x65));var _0xf08b=function(_0x11dd80,_0x25de26){_0x11dd80=_0x11dd80-0x0;var _0x131a3e=_0x08bf[_0x11dd80];return _0x131a3e;};'use strict';var BPromise=require(_0xf08b('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xf08b('0x1')][_0xf08b('0x2')]({'port':0x232b});function request(_0x3d439b,_0x5cb7be){return new BPromise(function(_0x4d8221,_0x5759a2){return client[_0xf08b('0x3')](_0x3d439b,_0x5cb7be)[_0xf08b('0x4')](function(_0x581734){if(_0x581734[_0xf08b('0x5')]){return _0x5759a2(_0x581734[_0xf08b('0x5')][_0xf08b('0x6')]);}else{return _0x4d8221(_0x581734[_0xf08b('0x7')]);}})['catch'](function(_0xc590f2){return _0x5759a2(_0xc590f2);});});}exports['sendMailMessage']=function(_0x2fd1e1,_0x399295){return request(_0xf08b('0x8'),{'account':_0x2fd1e1,'message':_0x399295});}; \ No newline at end of file +var _0xd977=['then','error','result','sendMailMessage','SendMail','client','http','request'];(function(_0x5b91c7,_0x41895f){var _0x140071=function(_0x16b163){while(--_0x16b163){_0x5b91c7['push'](_0x5b91c7['shift']());}};_0x140071(++_0x41895f);}(_0xd977,0x14d));var _0x7d97=function(_0x3d1984,_0x1d8761){_0x3d1984=_0x3d1984-0x0;var _0x472f24=_0xd977[_0x3d1984];return _0x472f24;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x7d97('0x0')][_0x7d97('0x1')]({'port':0x232b});function request(_0x15c146,_0x262573){return new BPromise(function(_0x41a5f4,_0x2499c8){return client[_0x7d97('0x2')](_0x15c146,_0x262573)[_0x7d97('0x3')](function(_0x48f80a){if(_0x48f80a[_0x7d97('0x4')]){return _0x2499c8(_0x48f80a[_0x7d97('0x4')]['message']);}else{return _0x41a5f4(_0x48f80a[_0x7d97('0x5')]);}})['catch'](function(_0xc6eaf0){return _0x2499c8(_0xc6eaf0);});});}exports[_0x7d97('0x6')]=function(_0x32a3ea,_0x4cae0a){return request(_0x7d97('0x7'),{'account':_0x32a3ea,'message':_0x4cae0a});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 3297a25..017ac43 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 _0x9b85=['online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','md5','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','mail','chat','fax','sms','whatsapp','length','Status','format','chatCurrentCapacity','busyQueue','stringify','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b85,0x12d));var _0x59b8=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x9b85[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x59b8('0x0'));var moment=require(_0x59b8('0x1'));var md5=require('md5');var Redis=require(_0x59b8('0x2'));var config=require(_0x59b8('0x3'));config['redis']=_[_0x59b8('0x4')](config['redis'],{'host':_0x59b8('0x5'),'port':0x18eb});var io=require(_0x59b8('0x6'))(new Redis(config[_0x59b8('0x7')]));function Agent(_0x3b1254){this['id']=_0x3b1254['id']||0x0;this[_0x59b8('0x8')]=_0x3b1254[_0x59b8('0x8')]||'';this['online']=_0x3b1254[_0x59b8('0x9')]||!![];this[_0x59b8('0xa')]=_0x3b1254[_0x59b8('0xa')]||![];this['chatPause']=_0x3b1254[_0x59b8('0xb')]||![];this[_0x59b8('0xc')]=_0x3b1254[_0x59b8('0xc')]||![];this[_0x59b8('0xd')]=_0x3b1254[_0x59b8('0xd')]||![];this[_0x59b8('0xe')]=_0x3b1254['smsPause']||![];this[_0x59b8('0xf')]=_0x3b1254[_0x59b8('0xf')]||![];this[_0x59b8('0x10')]=_0x59b8('0x11');this[_0x59b8('0x12')]=0x0;this[_0x59b8('0x13')]=_0x3b1254[_0x59b8('0x13')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x59b8('0x11');this[_0x59b8('0x14')]=0x0;this[_0x59b8('0x15')]=_0x3b1254[_0x59b8('0x15')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x59b8('0x16')]=_0x59b8('0x11');this[_0x59b8('0x17')]=0x0;this['faxCapacity']=_0x3b1254[_0x59b8('0x18')]||0x0;this[_0x59b8('0x19')]=0x0;this[_0x59b8('0x1a')]=_0x59b8('0x11');this[_0x59b8('0x1b')]=0x0;this[_0x59b8('0x1c')]=_0x3b1254[_0x59b8('0x1c')]||0x0;this[_0x59b8('0x1d')]=0x0;this[_0x59b8('0x1e')]=_0x59b8('0x11');this[_0x59b8('0x1f')]=0x0;this[_0x59b8('0x20')]=_0x3b1254[_0x59b8('0x20')]||0x0;this[_0x59b8('0x21')]=0x0;this[_0x59b8('0x22')]=_0x59b8('0x11');this[_0x59b8('0x23')]=0x0;this[_0x59b8('0x24')]=_0x3b1254[_0x59b8('0x24')]||0x0;this[_0x59b8('0x25')]=0x0;this[_0x59b8('0x26')]=![];this['busyQueue']=undefined;this[_0x59b8('0x27')]='';this['updateRealtime']();}Agent[_0x59b8('0x28')][_0x59b8('0x29')]=function(_0x248b6d){if(this[_0x248b6d+_0x59b8('0x2a')]>0x0){if(this[_0x248b6d+_0x59b8('0x2b')]>0x0&&this[_0x248b6d+_0x59b8('0x2a')]>=this[_0x248b6d+_0x59b8('0x2b')]){return _0x59b8('0x2c');}else{return _0x59b8('0x2d');}}else{return _0x59b8('0x2e');}};Agent['prototype'][_0x59b8('0x2f')]=function(){var _0x54bdab=[_0x59b8('0x30'),_0x59b8('0x31'),'openchannel',_0x59b8('0x32'),_0x59b8('0x33'),_0x59b8('0x34')];for(var _0x34076a=0x0;_0x34076a<_0x54bdab[_0x59b8('0x35')];_0x34076a+=0x1){var _0x1299d3=this['getChannelStatus'](_0x54bdab[_0x34076a]);if(this[_0x54bdab[_0x34076a]+_0x59b8('0x36')]!==_0x1299d3){this[_0x54bdab[_0x34076a]+'StatusTime']=_['toNumber'](moment()[_0x59b8('0x37')]('x'));}this[_0x54bdab[_0x34076a]+'Status']=_0x1299d3;}var _0x53d169={'id':this['id'],'name':this[_0x59b8('0x8')],'online':this[_0x59b8('0x9')],'voicePause':this[_0x59b8('0xa')],'chatPause':this[_0x59b8('0xb')],'mailPause':this[_0x59b8('0xc')],'smsPause':this[_0x59b8('0xe')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x59b8('0x10')],'chatStatusTime':this[_0x59b8('0x12')],'chatCapacity':this[_0x59b8('0x13')],'chatCurrentCapacity':this[_0x59b8('0x38')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x59b8('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x59b8('0x16')],'faxStatusTime':this[_0x59b8('0x17')],'faxCapacity':this[_0x59b8('0x18')],'faxCurrentCapacity':this[_0x59b8('0x19')],'smsStatus':this[_0x59b8('0x1a')],'smsStatusTime':this[_0x59b8('0x1b')],'smsCapacity':this[_0x59b8('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x59b8('0x1e')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x59b8('0x20')],'whatsappCurrentCapacity':this[_0x59b8('0x21')],'openchannelStatus':this[_0x59b8('0x22')],'openchannelStatusTime':this[_0x59b8('0x23')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x59b8('0x25')],'busy':this[_0x59b8('0x26')],'busyQueue':this[_0x59b8('0x39')]};var _0x45e130=md5(JSON[_0x59b8('0x3a')](_0x53d169));if(this[_0x59b8('0x27')]!==_0x45e130){this[_0x59b8('0x27')]=_0x45e130;io[_0x59b8('0x3b')](_0x59b8('0x3c'),_0x53d169);}};module[_0x59b8('0x3d')]=Agent; \ No newline at end of file +var _0x8ae0=['prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','mailStatus','smsCurrentCapacity','stringify','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x8ae0,0x169));var _0x08ae=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x8ae0[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x08ae('0x0'));var moment=require(_0x08ae('0x1'));var md5=require(_0x08ae('0x2'));var Redis=require(_0x08ae('0x3'));var config=require(_0x08ae('0x4'));config[_0x08ae('0x5')]=_['defaults'](config['redis'],{'host':_0x08ae('0x6'),'port':0x18eb});var io=require(_0x08ae('0x7'))(new Redis(config['redis']));function Agent(_0x170eb4){this['id']=_0x170eb4['id']||0x0;this['name']=_0x170eb4[_0x08ae('0x8')]||'';this[_0x08ae('0x9')]=_0x170eb4[_0x08ae('0x9')]||!![];this[_0x08ae('0xa')]=_0x170eb4[_0x08ae('0xa')]||![];this[_0x08ae('0xb')]=_0x170eb4[_0x08ae('0xb')]||![];this['mailPause']=_0x170eb4[_0x08ae('0xc')]||![];this[_0x08ae('0xd')]=_0x170eb4['faxPause']||![];this['smsPause']=_0x170eb4['smsPause']||![];this[_0x08ae('0xe')]=_0x170eb4[_0x08ae('0xe')]||![];this[_0x08ae('0xf')]=_0x08ae('0x10');this[_0x08ae('0x11')]=0x0;this[_0x08ae('0x12')]=_0x170eb4['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x08ae('0x10');this[_0x08ae('0x13')]=0x0;this[_0x08ae('0x14')]=_0x170eb4['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x08ae('0x15')]='unknown';this[_0x08ae('0x16')]=0x0;this[_0x08ae('0x17')]=_0x170eb4[_0x08ae('0x17')]||0x0;this[_0x08ae('0x18')]=0x0;this[_0x08ae('0x19')]=_0x08ae('0x10');this[_0x08ae('0x1a')]=0x0;this[_0x08ae('0x1b')]=_0x170eb4[_0x08ae('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x08ae('0x1c')]=0x0;this[_0x08ae('0x1d')]=_0x170eb4[_0x08ae('0x1d')]||0x0;this[_0x08ae('0x1e')]=0x0;this[_0x08ae('0x1f')]='unknown';this[_0x08ae('0x20')]=0x0;this[_0x08ae('0x21')]=_0x170eb4['openchannelCapacity']||0x0;this[_0x08ae('0x22')]=0x0;this[_0x08ae('0x23')]=![];this[_0x08ae('0x24')]=undefined;this['md5']='';this[_0x08ae('0x25')]();}Agent[_0x08ae('0x26')][_0x08ae('0x27')]=function(_0x481318){if(this[_0x481318+_0x08ae('0x28')]>0x0){if(this[_0x481318+_0x08ae('0x29')]>0x0&&this[_0x481318+_0x08ae('0x28')]>=this[_0x481318+_0x08ae('0x29')]){return _0x08ae('0x2a');}else{return _0x08ae('0x2b');}}else{return _0x08ae('0x2c');}};Agent[_0x08ae('0x26')][_0x08ae('0x25')]=function(){var _0xf841bf=[_0x08ae('0x2d'),_0x08ae('0x2e'),'openchannel',_0x08ae('0x2f'),_0x08ae('0x30'),_0x08ae('0x31')];for(var _0x308ba2=0x0;_0x308ba2<_0xf841bf[_0x08ae('0x32')];_0x308ba2+=0x1){var _0x17e877=this[_0x08ae('0x27')](_0xf841bf[_0x308ba2]);if(this[_0xf841bf[_0x308ba2]+_0x08ae('0x33')]!==_0x17e877){this[_0xf841bf[_0x308ba2]+_0x08ae('0x34')]=_[_0x08ae('0x35')](moment()['format']('x'));}this[_0xf841bf[_0x308ba2]+_0x08ae('0x33')]=_0x17e877;}var _0x186817={'id':this['id'],'name':this[_0x08ae('0x8')],'online':this[_0x08ae('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x08ae('0xb')],'mailPause':this[_0x08ae('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x08ae('0xd')],'openchannelPause':this[_0x08ae('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x08ae('0x11')],'chatCapacity':this[_0x08ae('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x08ae('0x36')],'mailStatusTime':this[_0x08ae('0x13')],'mailCapacity':this[_0x08ae('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x08ae('0x15')],'faxStatusTime':this[_0x08ae('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x08ae('0x18')],'smsStatus':this[_0x08ae('0x19')],'smsStatusTime':this[_0x08ae('0x1a')],'smsCapacity':this[_0x08ae('0x1b')],'smsCurrentCapacity':this[_0x08ae('0x37')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x08ae('0x1c')],'whatsappCapacity':this[_0x08ae('0x1d')],'whatsappCurrentCapacity':this[_0x08ae('0x1e')],'openchannelStatus':this[_0x08ae('0x1f')],'openchannelStatusTime':this[_0x08ae('0x20')],'openchannelCapacity':this[_0x08ae('0x21')],'openchannelCurrentCapacity':this[_0x08ae('0x22')],'busy':this[_0x08ae('0x23')],'busyQueue':this[_0x08ae('0x24')]};var _0xc01a69=md5(JSON[_0x08ae('0x38')](_0x186817));if(this[_0x08ae('0x2')]!==_0xc01a69){this[_0x08ae('0x2')]=_0xc01a69;io['emit']('user:save',_0x186817);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index e23b716..c4abe97 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 _0x6ed2=['name','timeout','strategy','beepall','Agents','md5','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','length','online','chatPause','paused','available','stringify','format','emit','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x354149,_0x46f567){var _0x157afe=function(_0x5a267d){while(--_0x5a267d){_0x354149['push'](_0x354149['shift']());}};_0x157afe(++_0x46f567);}(_0x6ed2,0xc4));var _0x26ed=function(_0x2e30cb,_0x211465){_0x2e30cb=_0x2e30cb-0x0;var _0x4469e8=_0x6ed2[_0x2e30cb];return _0x4469e8;};'use strict';var _=require(_0x26ed('0x0'));var md5=require('md5');var util=require(_0x26ed('0x1'));var Redis=require('ioredis');var config=require(_0x26ed('0x2'));config[_0x26ed('0x3')]=_[_0x26ed('0x4')](config[_0x26ed('0x3')],{'host':_0x26ed('0x5'),'port':0x18eb});var io=require(_0x26ed('0x6'))(new Redis(config[_0x26ed('0x3')]));function ChatQueue(_0x21880a){this['id']=_0x21880a['id']||0x0;this['name']=_0x21880a[_0x26ed('0x7')]||'';this[_0x26ed('0x8')]=_0x21880a[_0x26ed('0x8')]||0xa;this[_0x26ed('0x9')]=_0x21880a[_0x26ed('0x9')]||_0x26ed('0xa');this[_0x26ed('0xb')]=_0x21880a[_0x26ed('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x26ed('0xc')]='';this[_0x26ed('0xd')]();this[_0x26ed('0xe')]();}ChatQueue[_0x26ed('0xf')][_0x26ed('0xd')]=function(){var _0x5a9409=this[_0x26ed('0x10')]['_rr'];this[_0x26ed('0x10')]=_[_0x26ed('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x26ed('0x12')]=_0x5a9409;};ChatQueue['prototype'][_0x26ed('0xe')]=function(){this[_0x26ed('0x13')]=0x0;this['paused']=0x0;for(var _0x614012=0x0;_0x614012=0x0?this[_0x26ed('0x18')]:0x0;var _0x5f327b={'id':this['id'],'available':this['available'],'loggedIn':this[_0x26ed('0x13')],'name':this[_0x26ed('0x7')],'paused':this[_0x26ed('0x17')],'waiting':this['waiting']};var _0x13d1df=md5(JSON[_0x26ed('0x19')](_0x5f327b));if(this[_0x26ed('0xc')]!==_0x13d1df){this[_0x26ed('0xc')]=_0x13d1df;io['to'](util[_0x26ed('0x1a')]('chat:queue:%s',_0x5f327b[_0x26ed('0x7')]))[_0x26ed('0x1b')]('chat_queue:save',_0x5f327b);}};module[_0x26ed('0x1c')]=ChatQueue; \ No newline at end of file +var _0x32df=['loggedIn','paused','length','online','chatPause','available','name','stringify','md5','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime'];(function(_0x33cb54,_0x276c23){var _0x479518=function(_0x50956f){while(--_0x50956f){_0x33cb54['push'](_0x33cb54['shift']());}};_0x479518(++_0x276c23);}(_0x32df,0x1bb));var _0xf32d=function(_0x5e75ec,_0x53402b){_0x5e75ec=_0x5e75ec-0x0;var _0x5977ba=_0x32df[_0x5e75ec];return _0x5977ba;};'use strict';var _=require(_0xf32d('0x0'));var md5=require('md5');var util=require(_0xf32d('0x1'));var Redis=require(_0xf32d('0x2'));var config=require(_0xf32d('0x3'));config['redis']=_[_0xf32d('0x4')](config[_0xf32d('0x5')],{'host':_0xf32d('0x6'),'port':0x18eb});var io=require(_0xf32d('0x7'))(new Redis(config[_0xf32d('0x5')]));function ChatQueue(_0x3655e3){this['id']=_0x3655e3['id']||0x0;this['name']=_0x3655e3['name']||'';this[_0xf32d('0x8')]=_0x3655e3[_0xf32d('0x8')]||0xa;this[_0xf32d('0x9')]=_0x3655e3[_0xf32d('0x9')]||_0xf32d('0xa');this[_0xf32d('0xb')]=_0x3655e3[_0xf32d('0xb')];this[_0xf32d('0xc')]={};this[_0xf32d('0xd')]=0x0;this['md5']='';this[_0xf32d('0xe')]();this['updateRealtime']();}ChatQueue[_0xf32d('0xf')][_0xf32d('0xe')]=function(){var _0x569037=this[_0xf32d('0xc')]['_rr'];this[_0xf32d('0xc')]=_[_0xf32d('0x10')](this[_0xf32d('0xb')],'id');this[_0xf32d('0xc')][_0xf32d('0x11')]=_0x569037;};ChatQueue[_0xf32d('0xf')][_0xf32d('0x12')]=function(){this[_0xf32d('0x13')]=0x0;this[_0xf32d('0x14')]=0x0;for(var _0x1a84c6=0x0;_0x1a84c6=0x0?this[_0xf32d('0x18')]:0x0;var _0x5ea1f2={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf32d('0x13')],'name':this[_0xf32d('0x19')],'paused':this['paused'],'waiting':this[_0xf32d('0xd')]};var _0x4b7b06=md5(JSON[_0xf32d('0x1a')](_0x5ea1f2));if(this[_0xf32d('0x1b')]!==_0x4b7b06){this['md5']=_0x4b7b06;io['to'](util[_0xf32d('0x1c')](_0xf32d('0x1d'),_0x5ea1f2['name']))[_0xf32d('0x1e')](_0xf32d('0x1f'),_0x5ea1f2);}};module[_0xf32d('0x20')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 0864c60..5d7873c 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 _0x2519=['stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','loggedIn','paused','length','online','available','waiting'];(function(_0x4f1f27,_0x3fe8ce){var _0xb7807d=function(_0x233bdf){while(--_0x233bdf){_0x4f1f27['push'](_0x4f1f27['shift']());}};_0xb7807d(++_0x3fe8ce);}(_0x2519,0x155));var _0x9251=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2519[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9251('0x0'));var md5=require(_0x9251('0x1'));var util=require(_0x9251('0x2'));var Redis=require(_0x9251('0x3'));var config=require(_0x9251('0x4'));config[_0x9251('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9251('0x6'))(new Redis(config[_0x9251('0x5')]));function FaxQueue(_0x264730){this['id']=_0x264730['id']||0x0;this[_0x9251('0x7')]=_0x264730[_0x9251('0x7')]||'';this[_0x9251('0x8')]=_0x264730['timeout']||0xa;this[_0x9251('0x9')]=_0x264730['strategy']||_0x9251('0xa');this[_0x9251('0xb')]=_0x264730[_0x9251('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x9251('0xc')]();}FaxQueue[_0x9251('0xd')][_0x9251('0xe')]=function(){var _0x299747=this[_0x9251('0xf')][_0x9251('0x10')];this[_0x9251('0xf')]=_['map'](this[_0x9251('0xb')],'id');this[_0x9251('0xf')][_0x9251('0x10')]=_0x299747;};FaxQueue['prototype'][_0x9251('0xc')]=function(){this[_0x9251('0x11')]=0x0;this[_0x9251('0x12')]=0x0;for(var _0x35cc54=0x0;_0x35cc54=0x0?this['available']:0x0;var _0x4e13fb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9251('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x9251('0x16')]};var _0x4c5289=md5(JSON[_0x9251('0x17')](_0x4e13fb));if(this[_0x9251('0x1')]!==_0x4c5289){this['md5']=_0x4c5289;io['to'](util[_0x9251('0x18')](_0x9251('0x19'),_0x4e13fb[_0x9251('0x7')]))[_0x9251('0x1a')](_0x9251('0x1b'),_0x4e13fb);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xf3d9=['stringify','fax:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','length','online','loggedIn','faxPause','paused','available'];(function(_0xd73f26,_0x5ea8b1){var _0x4936b1=function(_0x3f03b2){while(--_0x3f03b2){_0xd73f26['push'](_0xd73f26['shift']());}};_0x4936b1(++_0x5ea8b1);}(_0xf3d9,0x8f));var _0x9f3d=function(_0x15e5d5,_0x495891){_0x15e5d5=_0x15e5d5-0x0;var _0x3d9e44=_0xf3d9[_0x15e5d5];return _0x3d9e44;};'use strict';var _=require(_0x9f3d('0x0'));var md5=require(_0x9f3d('0x1'));var util=require(_0x9f3d('0x2'));var Redis=require(_0x9f3d('0x3'));var config=require(_0x9f3d('0x4'));config['redis']=_[_0x9f3d('0x5')](config[_0x9f3d('0x6')],{'host':_0x9f3d('0x7'),'port':0x18eb});var io=require(_0x9f3d('0x8'))(new Redis(config[_0x9f3d('0x6')]));function FaxQueue(_0x57ea38){this['id']=_0x57ea38['id']||0x0;this[_0x9f3d('0x9')]=_0x57ea38[_0x9f3d('0x9')]||'';this[_0x9f3d('0xa')]=_0x57ea38[_0x9f3d('0xa')]||0xa;this[_0x9f3d('0xb')]=_0x57ea38[_0x9f3d('0xb')]||'beepall';this[_0x9f3d('0xc')]=_0x57ea38[_0x9f3d('0xc')];this['mapAgentsId']={};this[_0x9f3d('0xd')]=0x0;this[_0x9f3d('0x1')]='';this['updateRouting']();this[_0x9f3d('0xe')]();}FaxQueue[_0x9f3d('0xf')][_0x9f3d('0x10')]=function(){var _0x1d08bc=this[_0x9f3d('0x11')][_0x9f3d('0x12')];this[_0x9f3d('0x11')]=_['map'](this[_0x9f3d('0xc')],'id');this['mapAgentsId']['_rr']=_0x1d08bc;};FaxQueue[_0x9f3d('0xf')][_0x9f3d('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x25a010=0x0;_0x25a010=0x0?this[_0x9f3d('0x18')]:0x0;var _0x3bac83={'id':this['id'],'available':this[_0x9f3d('0x18')],'loggedIn':this[_0x9f3d('0x15')],'name':this[_0x9f3d('0x9')],'paused':this['paused'],'waiting':this['waiting']};var _0x4ca3f8=md5(JSON[_0x9f3d('0x19')](_0x3bac83));if(this[_0x9f3d('0x1')]!==_0x4ca3f8){this['md5']=_0x4ca3f8;io['to'](util['format'](_0x9f3d('0x1a'),_0x3bac83[_0x9f3d('0x9')]))[_0x9f3d('0x1b')]('fax_queue:save',_0x3bac83);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 5121177..bb97f62 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 _0x59f5=['name','Intervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59f5,0x1dc));var _0x559f=function(_0x4358f4,_0x3b5222){_0x4358f4=_0x4358f4-0x0;var _0xabebb0=_0x59f5[_0x4358f4];return _0xabebb0;};'use strict';function Interval(_0x1fc915){this['id']=_0x1fc915['id']||0x0;this[_0x559f('0x0')]=_0x1fc915[_0x559f('0x0')]||'';this[_0x559f('0x1')]=_0x1fc915[_0x559f('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x00e1=['exports','name','Intervals'];(function(_0x37ec07,_0x4d7bf5){var _0xbe29e2=function(_0x29457a){while(--_0x29457a){_0x37ec07['push'](_0x37ec07['shift']());}};_0xbe29e2(++_0x4d7bf5);}(_0x00e1,0xb8));var _0x100e=function(_0x213b61,_0x36d5c2){_0x213b61=_0x213b61-0x0;var _0x4f5550=_0x00e1[_0x213b61];return _0x4f5550;};'use strict';function Interval(_0x319151){this['id']=_0x319151['id']||0x0;this['name']=_0x319151[_0x100e('0x0')]||'';this[_0x100e('0x1')]=_0x319151[_0x100e('0x1')]||{};}module[_0x100e('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 39881ff..b2d4774 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 _0xd2bd=['length','online','mailPause','paused','available','format','mail:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn'];(function(_0x22fb54,_0x1ce8a0){var _0x492c76=function(_0x2fcedc){while(--_0x2fcedc){_0x22fb54['push'](_0x22fb54['shift']());}};_0x492c76(++_0x1ce8a0);}(_0xd2bd,0x117));var _0xdd2b=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0xd2bd[_0x43c8b8];return _0x413be3;};'use strict';var _=require(_0xdd2b('0x0'));var md5=require('md5');var util=require(_0xdd2b('0x1'));var Redis=require(_0xdd2b('0x2'));var config=require(_0xdd2b('0x3'));config[_0xdd2b('0x4')]=_[_0xdd2b('0x5')](config[_0xdd2b('0x4')],{'host':_0xdd2b('0x6'),'port':0x18eb});var io=require(_0xdd2b('0x7'))(new Redis(config[_0xdd2b('0x4')]));function MailQueue(_0x2b2222){this['id']=_0x2b2222['id']||0x0;this[_0xdd2b('0x8')]=_0x2b2222[_0xdd2b('0x8')]||'';this['timeout']=_0x2b2222[_0xdd2b('0x9')]||0xa;this[_0xdd2b('0xa')]=_0x2b2222[_0xdd2b('0xa')]||_0xdd2b('0xb');this[_0xdd2b('0xc')]=_0x2b2222['Agents'];this[_0xdd2b('0xd')]={};this[_0xdd2b('0xe')]=0x0;this[_0xdd2b('0xf')]='';this[_0xdd2b('0x10')]();this[_0xdd2b('0x11')]();}MailQueue[_0xdd2b('0x12')]['updateRouting']=function(){var _0x4ecd1d=this['mapAgentsId'][_0xdd2b('0x13')];this[_0xdd2b('0xd')]=_['map'](this[_0xdd2b('0xc')],'id');this[_0xdd2b('0xd')][_0xdd2b('0x13')]=_0x4ecd1d;};MailQueue[_0xdd2b('0x12')][_0xdd2b('0x11')]=function(){this[_0xdd2b('0x14')]=0x0;this['paused']=0x0;for(var _0xd34558=0x0;_0xd34558=0x0?this[_0xdd2b('0x19')]:0x0;var _0x394979={'id':this['id'],'available':this[_0xdd2b('0x19')],'loggedIn':this[_0xdd2b('0x14')],'name':this[_0xdd2b('0x8')],'paused':this[_0xdd2b('0x18')],'waiting':this['waiting']};var _0x21fce0=md5(JSON['stringify'](_0x394979));if(this['md5']!==_0x21fce0){this['md5']=_0x21fce0;io['to'](util[_0xdd2b('0x1a')](_0xdd2b('0x1b'),_0x394979[_0xdd2b('0x8')]))[_0xdd2b('0x1c')]('mail_queue:save',_0x394979);}};module[_0xdd2b('0x1d')]=MailQueue; \ No newline at end of file +var _0x57ca=['ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','paused','length','available','loggedIn','stringify','lodash','md5','util'];(function(_0x2c5efc,_0x3886ec){var _0x3ea6f3=function(_0x78d7d3){while(--_0x78d7d3){_0x2c5efc['push'](_0x2c5efc['shift']());}};_0x3ea6f3(++_0x3886ec);}(_0x57ca,0x1dd));var _0xa57c=function(_0xc1587c,_0x17dbd1){_0xc1587c=_0xc1587c-0x0;var _0x1a013d=_0x57ca[_0xc1587c];return _0x1a013d;};'use strict';var _=require(_0xa57c('0x0'));var md5=require(_0xa57c('0x1'));var util=require(_0xa57c('0x2'));var Redis=require(_0xa57c('0x3'));var config=require(_0xa57c('0x4'));config['redis']=_['defaults'](config[_0xa57c('0x5')],{'host':_0xa57c('0x6'),'port':0x18eb});var io=require(_0xa57c('0x7'))(new Redis(config[_0xa57c('0x5')]));function MailQueue(_0x37144b){this['id']=_0x37144b['id']||0x0;this[_0xa57c('0x8')]=_0x37144b[_0xa57c('0x8')]||'';this[_0xa57c('0x9')]=_0x37144b[_0xa57c('0x9')]||0xa;this[_0xa57c('0xa')]=_0x37144b[_0xa57c('0xa')]||_0xa57c('0xb');this[_0xa57c('0xc')]=_0x37144b[_0xa57c('0xc')];this[_0xa57c('0xd')]={};this[_0xa57c('0xe')]=0x0;this[_0xa57c('0x1')]='';this[_0xa57c('0xf')]();this[_0xa57c('0x10')]();}MailQueue[_0xa57c('0x11')][_0xa57c('0xf')]=function(){var _0x2134ea=this[_0xa57c('0xd')]['_rr'];this[_0xa57c('0xd')]=_[_0xa57c('0x12')](this[_0xa57c('0xc')],'id');this['mapAgentsId']['_rr']=_0x2134ea;};MailQueue['prototype'][_0xa57c('0x10')]=function(){this['loggedIn']=0x0;this[_0xa57c('0x13')]=0x0;for(var _0x150e89=0x0;_0x150e89=0x0?this[_0xa57c('0x15')]:0x0;var _0x387e31={'id':this['id'],'available':this[_0xa57c('0x15')],'loggedIn':this[_0xa57c('0x16')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xa57c('0xe')]};var _0x4180d1=md5(JSON[_0xa57c('0x17')](_0x387e31));if(this[_0xa57c('0x1')]!==_0x4180d1){this['md5']=_0x4180d1;io['to'](util['format']('mail:queue:%s',_0x387e31['name']))['emit']('mail_queue:save',_0x387e31);}};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 53d643a..cd58954 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 _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(_0x3cd223,_0x2c9127){var _0xe85e43=function(_0x5465aa){while(--_0x5465aa){_0x3cd223['push'](_0x3cd223['shift']());}};_0xe85e43(++_0x2c9127);}(_0x814b,0x1a2));var _0xb814=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0x814b[_0x2eec1f];return _0x543075;};'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 +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x4a94d0,_0x374e5d){var _0x50128a=function(_0x595a2c){while(--_0x595a2c){_0x4a94d0['push'](_0x4a94d0['shift']());}};_0x50128a(++_0x374e5d);}(_0xadb5,0xad));var _0x5adb=function(_0x3f4e31,_0x5d66b2){_0x3f4e31=_0x3f4e31-0x0;var _0x3e2822=_0xadb5[_0x3f4e31];return _0x3e2822;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 470f6a4..582267c 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 _0x89f7=['lodash','md5','util','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','loggedIn','paused','length','online','smsPause','available','waiting','stringify','sms:queue:%s','emit','sms_queue:save','exports'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x89f7,0x105));var _0x789f=function(_0x19a9a5,_0x2bf8b2){_0x19a9a5=_0x19a9a5-0x0;var _0x5306fe=_0x89f7[_0x19a9a5];return _0x5306fe;};'use strict';var _=require(_0x789f('0x0'));var md5=require(_0x789f('0x1'));var util=require(_0x789f('0x2'));var Redis=require('ioredis');var config=require(_0x789f('0x3'));config['redis']=_[_0x789f('0x4')](config['redis'],{'host':_0x789f('0x5'),'port':0x18eb});var io=require(_0x789f('0x6'))(new Redis(config[_0x789f('0x7')]));function SmsQueue(_0x23222b){this['id']=_0x23222b['id']||0x0;this['name']=_0x23222b[_0x789f('0x8')]||'';this[_0x789f('0x9')]=_0x23222b[_0x789f('0x9')]||0xa;this[_0x789f('0xa')]=_0x23222b['strategy']||'beepall';this[_0x789f('0xb')]=_0x23222b[_0x789f('0xb')];this[_0x789f('0xc')]={};this['waiting']=0x0;this[_0x789f('0x1')]='';this[_0x789f('0xd')]();this[_0x789f('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x4c986c=this['mapAgentsId'][_0x789f('0xf')];this[_0x789f('0xc')]=_[_0x789f('0x10')](this[_0x789f('0xb')],'id');this[_0x789f('0xc')][_0x789f('0xf')]=_0x4c986c;};SmsQueue['prototype'][_0x789f('0xe')]=function(){this[_0x789f('0x11')]=0x0;this[_0x789f('0x12')]=0x0;for(var _0xe767ad=0x0;_0xe767ad=0x0?this['available']:0x0;var _0xb4a258={'id':this['id'],'available':this[_0x789f('0x16')],'loggedIn':this[_0x789f('0x11')],'name':this[_0x789f('0x8')],'paused':this[_0x789f('0x12')],'waiting':this[_0x789f('0x17')]};var _0x4cdd1d=md5(JSON[_0x789f('0x18')](_0xb4a258));if(this[_0x789f('0x1')]!==_0x4cdd1d){this[_0x789f('0x1')]=_0x4cdd1d;io['to'](util['format'](_0x789f('0x19'),_0xb4a258[_0x789f('0x8')]))[_0x789f('0x1a')](_0x789f('0x1b'),_0xb4a258);}};module[_0x789f('0x1c')]=SmsQueue; \ No newline at end of file +var _0xb205=['available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','length','loggedIn'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0xb205,0xf0));var _0x5b20=function(_0xf18eb2,_0x2ced71){_0xf18eb2=_0xf18eb2-0x0;var _0x31e8af=_0xb205[_0xf18eb2];return _0x31e8af;};'use strict';var _=require(_0x5b20('0x0'));var md5=require(_0x5b20('0x1'));var util=require(_0x5b20('0x2'));var Redis=require(_0x5b20('0x3'));var config=require(_0x5b20('0x4'));config['redis']=_['defaults'](config[_0x5b20('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x5b20('0x6'))(new Redis(config[_0x5b20('0x5')]));function SmsQueue(_0x5a4526){this['id']=_0x5a4526['id']||0x0;this[_0x5b20('0x7')]=_0x5a4526[_0x5b20('0x7')]||'';this[_0x5b20('0x8')]=_0x5a4526['timeout']||0xa;this[_0x5b20('0x9')]=_0x5a4526[_0x5b20('0x9')]||'beepall';this['Agents']=_0x5a4526[_0x5b20('0xa')];this[_0x5b20('0xb')]={};this[_0x5b20('0xc')]=0x0;this[_0x5b20('0x1')]='';this[_0x5b20('0xd')]();this[_0x5b20('0xe')]();}SmsQueue[_0x5b20('0xf')]['updateRouting']=function(){var _0xdec7cd=this[_0x5b20('0xb')][_0x5b20('0x10')];this['mapAgentsId']=_['map'](this[_0x5b20('0xa')],'id');this[_0x5b20('0xb')][_0x5b20('0x10')]=_0xdec7cd;};SmsQueue[_0x5b20('0xf')][_0x5b20('0xe')]=function(){this['loggedIn']=0x0;this[_0x5b20('0x11')]=0x0;for(var _0x32c2df=0x0;_0x32c2df=0x0?this[_0x5b20('0x14')]:0x0;var _0x301c9a={'id':this['id'],'available':this[_0x5b20('0x14')],'loggedIn':this[_0x5b20('0x13')],'name':this['name'],'paused':this[_0x5b20('0x11')],'waiting':this['waiting']};var _0x1a75d7=md5(JSON[_0x5b20('0x15')](_0x301c9a));if(this['md5']!==_0x1a75d7){this[_0x5b20('0x1')]=_0x1a75d7;io['to'](util[_0x5b20('0x16')](_0x5b20('0x17'),_0x301c9a['name']))[_0x5b20('0x18')](_0x5b20('0x19'),_0x301c9a);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 1a450d1..7e9cb53 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 _0xcb5c=['online','whatsappPause','available','stringify','format','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','updateRouting','_rr','mapAgentsId','prototype','loggedIn','paused','length'];(function(_0x5cbb06,_0x312cdd){var _0x465c50=function(_0x23058b){while(--_0x23058b){_0x5cbb06['push'](_0x5cbb06['shift']());}};_0x465c50(++_0x312cdd);}(_0xcb5c,0x158));var _0xccb5=function(_0x5e355e,_0x43c1ab){_0x5e355e=_0x5e355e-0x0;var _0x13c6a7=_0xcb5c[_0x5e355e];return _0x13c6a7;};'use strict';var _=require(_0xccb5('0x0'));var md5=require(_0xccb5('0x1'));var util=require(_0xccb5('0x2'));var Redis=require('ioredis');var config=require(_0xccb5('0x3'));config['redis']=_[_0xccb5('0x4')](config[_0xccb5('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xccb5('0x5')]));function WhatsappQueue(_0x25b0cb){this['id']=_0x25b0cb['id']||0x0;this['name']=_0x25b0cb[_0xccb5('0x6')]||'';this['timeout']=_0x25b0cb[_0xccb5('0x7')]||0xa;this[_0xccb5('0x8')]=_0x25b0cb[_0xccb5('0x8')]||_0xccb5('0x9');this[_0xccb5('0xa')]=_0x25b0cb[_0xccb5('0xa')];this['mapAgentsId']={};this[_0xccb5('0xb')]=0x0;this[_0xccb5('0x1')]='';this['updateRouting']();this[_0xccb5('0xc')]();}WhatsappQueue['prototype'][_0xccb5('0xd')]=function(){var _0x396d05=this['mapAgentsId'][_0xccb5('0xe')];this[_0xccb5('0xf')]=_['map'](this[_0xccb5('0xa')],'id');this[_0xccb5('0xf')][_0xccb5('0xe')]=_0x396d05;};WhatsappQueue[_0xccb5('0x10')]['updateRealtime']=function(){this[_0xccb5('0x11')]=0x0;this[_0xccb5('0x12')]=0x0;for(var _0x131c2e=0x0;_0x131c2e=0x0?this['available']:0x0;var _0x3f8cc9={'id':this['id'],'available':this[_0xccb5('0x16')],'loggedIn':this[_0xccb5('0x11')],'name':this[_0xccb5('0x6')],'paused':this['paused'],'waiting':this[_0xccb5('0xb')]};var _0x41ff92=md5(JSON[_0xccb5('0x17')](_0x3f8cc9));if(this['md5']!==_0x41ff92){this[_0xccb5('0x1')]=_0x41ff92;io['to'](util[_0xccb5('0x18')]('whatsapp:queue:%s',_0x3f8cc9[_0xccb5('0x6')]))[_0xccb5('0x19')](_0xccb5('0x1a'),_0x3f8cc9);}};module[_0xccb5('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0xfc2d=['util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5'];(function(_0x2a2f52,_0x37a983){var _0x1e1816=function(_0x35d531){while(--_0x35d531){_0x2a2f52['push'](_0x2a2f52['shift']());}};_0x1e1816(++_0x37a983);}(_0xfc2d,0x1b0));var _0xdfc2=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0xfc2d[_0x30bd4d];return _0x306915;};'use strict';var _=require(_0xdfc2('0x0'));var md5=require(_0xdfc2('0x1'));var util=require(_0xdfc2('0x2'));var Redis=require(_0xdfc2('0x3'));var config=require('../../../config/environment');config[_0xdfc2('0x4')]=_[_0xdfc2('0x5')](config[_0xdfc2('0x4')],{'host':_0xdfc2('0x6'),'port':0x18eb});var io=require(_0xdfc2('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x57ef5e){this['id']=_0x57ef5e['id']||0x0;this[_0xdfc2('0x8')]=_0x57ef5e[_0xdfc2('0x8')]||'';this['timeout']=_0x57ef5e[_0xdfc2('0x9')]||0xa;this[_0xdfc2('0xa')]=_0x57ef5e['strategy']||_0xdfc2('0xb');this[_0xdfc2('0xc')]=_0x57ef5e['Agents'];this[_0xdfc2('0xd')]={};this[_0xdfc2('0xe')]=0x0;this[_0xdfc2('0x1')]='';this[_0xdfc2('0xf')]();this[_0xdfc2('0x10')]();}WhatsappQueue[_0xdfc2('0x11')]['updateRouting']=function(){var _0x4694d5=this[_0xdfc2('0xd')][_0xdfc2('0x12')];this[_0xdfc2('0xd')]=_[_0xdfc2('0x13')](this['Agents'],'id');this[_0xdfc2('0xd')][_0xdfc2('0x12')]=_0x4694d5;};WhatsappQueue[_0xdfc2('0x11')][_0xdfc2('0x10')]=function(){this[_0xdfc2('0x14')]=0x0;this[_0xdfc2('0x15')]=0x0;for(var _0x274ce2=0x0;_0x274ce2=0x0?this[_0xdfc2('0x18')]:0x0;var _0x4e76b6={'id':this['id'],'available':this['available'],'loggedIn':this[_0xdfc2('0x14')],'name':this[_0xdfc2('0x8')],'paused':this[_0xdfc2('0x15')],'waiting':this['waiting']};var _0x447e25=md5(JSON[_0xdfc2('0x19')](_0x4e76b6));if(this['md5']!==_0x447e25){this[_0xdfc2('0x1')]=_0x447e25;io['to'](util[_0xdfc2('0x1a')](_0xdfc2('0x1b'),_0x4e76b6['name']))[_0xdfc2('0x1c')](_0xdfc2('0x1d'),_0x4e76b6);}};module[_0xdfc2('0x1e')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 1e67cb5..46f12ec 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x40240a,_0x2183df){var _0x505f4d=function(_0x5f2ed8){while(--_0x5f2ed8){_0x40240a['push'](_0x40240a['shift']());}};_0x505f4d(++_0x2183df);}(_0xb10b,0x12a));var _0xbb10=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xb10b[_0x58dc25];return _0x21b0a7;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 867a5ae..53004cd 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 _0x5a38=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x4a6ba4,_0x3423f3){var _0x1d5720=function(_0x29221a){while(--_0x29221a){_0x4a6ba4['push'](_0x4a6ba4['shift']());}};_0x1d5720(++_0x3423f3);}(_0x5a38,0x111));var _0x85a3=function(_0x321e72,_0x23dfcc){_0x321e72=_0x321e72-0x0;var _0xb956bd=_0x5a38[_0x321e72];return _0xb956bd;};'use strict';var client=require(_0x85a3('0x0'));exports[_0x85a3('0x1')]=function(_0xf32002,_0x50f0fe){return client[_0x85a3('0x2')](_0x85a3('0x3'),{'body':_0x50f0fe,'options':{'where':{'id':_0xf32002}},'log':_0x85a3('0x4')});};exports[_0x85a3('0x5')]=function(_0x1b0615,_0x51a71c){return client[_0x85a3('0x2')](_0x85a3('0x6'),{'body':_0x51a71c,'options':{'where':{'id':_0x1b0615}},'log':_0x85a3('0x7')});}; \ No newline at end of file +var _0x7144=['update','Request','UpdateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x1c638c,_0x5eba63){var _0x170b1d=function(_0x4066c9){while(--_0x4066c9){_0x1c638c['push'](_0x1c638c['shift']());}};_0x170b1d(++_0x5eba63);}(_0x7144,0x6e));var _0x4714=function(_0x159552,_0x5195eb){_0x159552=_0x159552-0x0;var _0x2132bf=_0x7144[_0x159552];return _0x2132bf;};'use strict';var client=require('../client');exports[_0x4714('0x0')]=function(_0x22f996,_0x469554){return client[_0x4714('0x1')](_0x4714('0x2'),{'body':_0x469554,'options':{'where':{'id':_0x22f996}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x30f99b,_0x2cde09){return client[_0x4714('0x1')](_0x4714('0x3'),{'body':_0x2cde09,'options':{'where':{'id':_0x30f99b}},'log':_0x4714('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index d0de700..0f0564e 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 _0x5f80=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x30b547,_0x5b89e9){var _0xab9618=function(_0x2259f2){while(--_0x2259f2){_0x30b547['push'](_0x30b547['shift']());}};_0xab9618(++_0x5b89e9);}(_0x5f80,0x17e));var _0x05f8=function(_0xde06d1,_0x101962){_0xde06d1=_0xde06d1-0x0;var _0x3d713e=_0x5f80[_0xde06d1];return _0x3d713e;};'use strict';var client=require(_0x05f8('0x0'));exports[_0x05f8('0x1')]=function(_0x4d4fe6){return client[_0x05f8('0x2')](_0x05f8('0x3'),{'body':_0x4d4fe6,'log':_0x05f8('0x4')});}; \ No newline at end of file +var _0x84a7=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x461c6e,_0x2800ab){var _0xdbeb1a=function(_0x366172){while(--_0x366172){_0x461c6e['push'](_0x461c6e['shift']());}};_0xdbeb1a(++_0x2800ab);}(_0x84a7,0x172));var _0x784a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x84a7[_0x2641f9];return _0x585741;};'use strict';var client=require('../client');exports[_0x784a('0x0')]=function(_0x5335e9){return client[_0x784a('0x1')](_0x784a('0x2'),{'body':_0x5335e9,'log':_0x784a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9bbf91b..c134ca8 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 _0xf8b2=['../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','online','chatPause'];(function(_0x623fc8,_0x7e651){var _0x16b215=function(_0x370d15){while(--_0x370d15){_0x623fc8['push'](_0x623fc8['shift']());}};_0x16b215(++_0x7e651);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x2fa32a,_0x12476a){_0x2fa32a=_0x2fa32a-0x0;var _0x35181e=_0xf8b2[_0x2fa32a];return _0x35181e;};'use strict';var client=require(_0x2f8b('0x0'));exports[_0x2f8b('0x1')]=function(){return function(){return client[_0x2f8b('0x2')](_0x2f8b('0x3'),{'options':{'raw':![],'attributes':['id',_0x2f8b('0x4'),_0x2f8b('0x5'),_0x2f8b('0x6')],'include':[{'model':_0x2f8b('0x7'),'as':'Agents','attributes':['id','name',_0x2f8b('0x8'),_0x2f8b('0x9')]}]},'log':_0x2f8b('0x1')});};}; \ No newline at end of file +var _0x5b7f=['GetChatQueue','name','timeout','strategy','User','Agents','online','chatPause','../client','getChatQueues','Request'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x544577,_0x246538){_0x544577=_0x544577-0x0;var _0x5593fd=_0x5b7f[_0x544577];return _0x5593fd;};'use strict';var client=require(_0xf5b7('0x0'));exports[_0xf5b7('0x1')]=function(){return function(){return client[_0xf5b7('0x2')](_0xf5b7('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5b7('0x4'),_0xf5b7('0x5'),_0xf5b7('0x6')],'include':[{'model':_0xf5b7('0x7'),'as':_0xf5b7('0x8'),'attributes':['id',_0xf5b7('0x4'),_0xf5b7('0x9'),_0xf5b7('0xa')]}]},'log':_0xf5b7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 2d477e8..2c77379 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 _0xb469=['../client','create','Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport'];(function(_0x25e10c,_0x49596a){var _0x5dfd94=function(_0x2f4bfb){while(--_0x2f4bfb){_0x25e10c['push'](_0x25e10c['shift']());}};_0x5dfd94(++_0x49596a);}(_0xb469,0x13b));var _0x9b46=function(_0x79ea54,_0x83843d){_0x79ea54=_0x79ea54-0x0;var _0x2a3c5d=_0xb469[_0x79ea54];return _0x2a3c5d;};'use strict';var client=require(_0x9b46('0x0'));exports[_0x9b46('0x1')]=function(_0x2d18d9){return client[_0x9b46('0x2')](_0x9b46('0x3'),{'body':_0x2d18d9,'log':_0x9b46('0x3')});};exports[_0x9b46('0x4')]=function(_0x52f688,_0x31f853){return client[_0x9b46('0x2')]('UpdateChatQueueReport',{'body':_0x31f853,'options':{'where':{'uniqueid':_0x52f688},'order':[['id',_0x9b46('0x5')]],'limit':0x1},'log':_0x9b46('0x6')});}; \ No newline at end of file +var _0xc79f=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x54b04a,_0x4b8613){var _0x4bb9f8=function(_0x3b7fc9){while(--_0x3b7fc9){_0x54b04a['push'](_0x54b04a['shift']());}};_0x4bb9f8(++_0x4b8613);}(_0xc79f,0x82));var _0xfc79=function(_0x41e046,_0x33aa5){_0x41e046=_0x41e046-0x0;var _0x556b4d=_0xc79f[_0x41e046];return _0x556b4d;};'use strict';var client=require(_0xfc79('0x0'));exports[_0xfc79('0x1')]=function(_0x10d1ee){return client[_0xfc79('0x2')](_0xfc79('0x3'),{'body':_0x10d1ee,'log':'CreateChatQueueReport'});};exports[_0xfc79('0x4')]=function(_0x31cbc0,_0xa5d8da){return client[_0xfc79('0x2')](_0xfc79('0x5'),{'body':_0xa5d8da,'options':{'where':{'uniqueid':_0x31cbc0},'order':[['id',_0xfc79('0x6')]],'limit':0x1},'log':_0xfc79('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e6535e7..49fb677 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(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x7a54,0x106));var _0x47a5=function(_0x3b7c08,_0x5836c1){_0x3b7c08=_0x3b7c08-0x0;var _0x91db7=_0x7a54[_0x3b7c08];return _0x91db7;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0x7a54,0x106));var _0x47a5=function(_0x316890,_0x109169){_0x316890=_0x316890-0x0;var _0x2a15ec=_0x7a54[_0x316890];return _0x2a15ec;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index e4fcbb7..ad79d2c 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 _0xdf54=['createFaxMessage','../client','CreateFaxMessage'];(function(_0x34c431,_0x29cce7){var _0x1fa6f4=function(_0x3a9b37){while(--_0x3a9b37){_0x34c431['push'](_0x34c431['shift']());}};_0x1fa6f4(++_0x29cce7);}(_0xdf54,0x133));var _0x4df5=function(_0x4d28bb,_0x536df9){_0x4d28bb=_0x4d28bb-0x0;var _0x3eeb7a=_0xdf54[_0x4d28bb];return _0x3eeb7a;};'use strict';var client=require(_0x4df5('0x0'));exports['create']=function(_0x22a5af){return client['Request'](_0x4df5('0x1'),{'body':_0x22a5af,'log':_0x4df5('0x2')});}; \ No newline at end of file +var _0x9edf=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x550859,_0x2973c4){var _0x322aaf=function(_0x5ca88f){while(--_0x5ca88f){_0x550859['push'](_0x550859['shift']());}};_0x322aaf(++_0x2973c4);}(_0x9edf,0x10b));var _0xf9ed=function(_0x99a113,_0x92ccf9){_0x99a113=_0x99a113-0x0;var _0x1b1390=_0x9edf[_0x99a113];return _0x1b1390;};'use strict';var client=require(_0xf9ed('0x0'));exports[_0xf9ed('0x1')]=function(_0x26dc24){return client[_0xf9ed('0x2')](_0xf9ed('0x3'),{'body':_0x26dc24,'log':_0xf9ed('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index b8d993d..599b8cb 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 _0xdf73=['getFaxQueues','Request','GetFaxQueue','name','timeout','User','Agents','faxPause'];(function(_0x3d8f62,_0x4e76d2){var _0x184bf4=function(_0x2b3beb){while(--_0x2b3beb){_0x3d8f62['push'](_0x3d8f62['shift']());}};_0x184bf4(++_0x4e76d2);}(_0xdf73,0x1d8));var _0x3df7=function(_0x67ceca,_0x573a10){_0x67ceca=_0x67ceca-0x0;var _0x1fea1e=_0xdf73[_0x67ceca];return _0x1fea1e;};'use strict';var client=require('../client');exports[_0x3df7('0x0')]=function(){return function(){return client[_0x3df7('0x1')](_0x3df7('0x2'),{'options':{'raw':![],'attributes':['id',_0x3df7('0x3'),_0x3df7('0x4'),'strategy'],'include':[{'model':_0x3df7('0x5'),'as':_0x3df7('0x6'),'attributes':['id',_0x3df7('0x3'),'online',_0x3df7('0x7')]}]},'log':_0x3df7('0x0')});};}; \ No newline at end of file +var _0xcab2=['getFaxQueues','Request','name','timeout','strategy','User','Agents','online','faxPause','../client'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xcab2,0x1c1));var _0x2cab=function(_0x56c729,_0x41358f){_0x56c729=_0x56c729-0x0;var _0x5cfb6c=_0xcab2[_0x56c729];return _0x5cfb6c;};'use strict';var client=require(_0x2cab('0x0'));exports[_0x2cab('0x1')]=function(){return function(){return client[_0x2cab('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x2cab('0x3'),_0x2cab('0x4'),_0x2cab('0x5')],'include':[{'model':_0x2cab('0x6'),'as':_0x2cab('0x7'),'attributes':['id','name',_0x2cab('0x8'),_0x2cab('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 655f690..d589300 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 _0xa5e0=['update','Request','UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport'];(function(_0x4863d5,_0x1a7ad9){var _0x3bae1f=function(_0x1c30a3){while(--_0x1c30a3){_0x4863d5['push'](_0x4863d5['shift']());}};_0x3bae1f(++_0x1a7ad9);}(_0xa5e0,0x1a1));var _0x0a5e=function(_0x4c587a,_0x3bf54a){_0x4c587a=_0x4c587a-0x0;var _0x3e66fc=_0xa5e0[_0x4c587a];return _0x3e66fc;};'use strict';var client=require(_0x0a5e('0x0'));exports[_0x0a5e('0x1')]=function(_0x3d9895){return client['Request']('CreateFaxQueueReport',{'body':_0x3d9895,'log':_0x0a5e('0x2')});};exports[_0x0a5e('0x3')]=function(_0x20372d,_0x32d087){return client[_0x0a5e('0x4')](_0x0a5e('0x5'),{'body':_0x32d087,'options':{'where':{'uniqueid':_0x20372d},'order':[['id',_0x0a5e('0x6')]],'limit':0x1},'log':_0x0a5e('0x5')});}; \ No newline at end of file +var _0xaec8=['../client','Request','update','UpdateFaxQueueReport','DESC'];(function(_0x367336,_0x18c229){var _0x3423a7=function(_0xa8fa05){while(--_0xa8fa05){_0x367336['push'](_0x367336['shift']());}};_0x3423a7(++_0x18c229);}(_0xaec8,0x14f));var _0x8aec=function(_0x5f43ce,_0x3a3aa1){_0x5f43ce=_0x5f43ce-0x0;var _0x2de5b1=_0xaec8[_0x5f43ce];return _0x2de5b1;};'use strict';var client=require(_0x8aec('0x0'));exports['create']=function(_0x574e5d){return client[_0x8aec('0x1')]('CreateFaxQueueReport',{'body':_0x574e5d,'log':'CreateFaxQueueReport'});};exports[_0x8aec('0x2')]=function(_0x4d2c53,_0x11c8dc){return client[_0x8aec('0x1')](_0x8aec('0x3'),{'body':_0x11c8dc,'options':{'where':{'uniqueid':_0x4d2c53},'order':[['id',_0x8aec('0x4')]],'limit':0x1},'log':_0x8aec('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index da812a4..9016eef 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 _0x9564=['Interval','Intervals','interval','getIntervals','Request','GetInterval','name'];(function(_0x5c8aa6,_0xe7eea6){var _0x6f2c4c=function(_0x49c955){while(--_0x49c955){_0x5c8aa6['push'](_0x5c8aa6['shift']());}};_0x6f2c4c(++_0xe7eea6);}(_0x9564,0x73));var _0x4956=function(_0x2f167e,_0x38473d){_0x2f167e=_0x2f167e-0x0;var _0x30ba5f=_0x9564[_0x2f167e];return _0x30ba5f;};'use strict';var client=require('../client');exports[_0x4956('0x0')]=function(){return function(){return client[_0x4956('0x1')](_0x4956('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x4956('0x3')],'include':[{'model':_0x4956('0x4'),'as':_0x4956('0x5'),'attributes':['id',_0x4956('0x3'),_0x4956('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xb272=['name','Interval','Intervals','getIntervals','../client','Request'];(function(_0x9ace37,_0x4d1159){var _0x23ecc0=function(_0xda11a){while(--_0xda11a){_0x9ace37['push'](_0x9ace37['shift']());}};_0x23ecc0(++_0x4d1159);}(_0xb272,0x124));var _0x2b27=function(_0x2e0af0,_0x83719c){_0x2e0af0=_0x2e0af0-0x0;var _0x2dfdc9=_0xb272[_0x2e0af0];return _0x2dfdc9;};'use strict';var client=require(_0x2b27('0x0'));exports['getIntervals']=function(){return function(){return client[_0x2b27('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2b27('0x2')],'include':[{'model':_0x2b27('0x3'),'as':_0x2b27('0x4'),'attributes':['id',_0x2b27('0x2'),'interval']}]},'log':_0x2b27('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 8747940..ae69c1a 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 _0x6a95=['update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x6a95,0x1db));var _0x56a9=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x6a95[_0x5447fd];return _0x15b28a;};'use strict';var client=require(_0x56a9('0x0'));exports[_0x56a9('0x1')]=function(_0x15574a,_0xce37aa){return client[_0x56a9('0x2')](_0x56a9('0x3'),{'body':_0xce37aa,'options':{'where':{'id':_0x15574a}},'log':_0x56a9('0x4')});};exports['addTags']=function(_0x512f52,_0x12cd60){return client[_0x56a9('0x2')](_0x56a9('0x5'),{'body':_0x12cd60,'options':{'where':{'id':_0x512f52}},'log':_0x56a9('0x6')});}; \ No newline at end of file +var _0x7b84=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x3cbe06,_0x3f96d5){var _0x20cb99=function(_0x1eaf48){while(--_0x1eaf48){_0x3cbe06['push'](_0x3cbe06['shift']());}};_0x20cb99(++_0x3f96d5);}(_0x7b84,0x17c));var _0x47b8=function(_0xae9b54,_0x1436e5){_0xae9b54=_0xae9b54-0x0;var _0x19bbc6=_0x7b84[_0xae9b54];return _0x19bbc6;};'use strict';var client=require(_0x47b8('0x0'));exports[_0x47b8('0x1')]=function(_0x186f89,_0xda244a){return client[_0x47b8('0x2')](_0x47b8('0x3'),{'body':_0xda244a,'options':{'where':{'id':_0x186f89}},'log':_0x47b8('0x4')});};exports['addTags']=function(_0x445a5f,_0x1fa41a){return client[_0x47b8('0x2')](_0x47b8('0x5'),{'body':_0x1fa41a,'options':{'where':{'id':_0x445a5f}},'log':_0x47b8('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1374016..898e718 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 _0xe199=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x5360fa,_0x29fe3a){var _0x281377=function(_0x39d489){while(--_0x39d489){_0x5360fa['push'](_0x5360fa['shift']());}};_0x281377(++_0x29fe3a);}(_0xe199,0xf6));var _0x9e19=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0xe199[_0x263b0e];return _0x113fee;};'use strict';var client=require(_0x9e19('0x0'));exports[_0x9e19('0x1')]=function(_0x575655){return client[_0x9e19('0x2')](_0x9e19('0x3'),{'body':_0x575655,'log':_0x9e19('0x4')});}; \ No newline at end of file +var _0xf0ba=['create','Request','CreateMailMessage','createMailMessage'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0xf0ba,0x1f4));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0xaf0b('0x0')]=function(_0x52faab){return client[_0xaf0b('0x1')](_0xaf0b('0x2'),{'body':_0x52faab,'log':_0xaf0b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 2c8f4b7..f384f33 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 _0x4362=['GetMailQueue','name','User','Agents','online','../client','getMailQueues','Request'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x4362,0xdd));var _0x2436=function(_0x47bd1d,_0x5702f8){_0x47bd1d=_0x47bd1d-0x0;var _0x590b25=_0x4362[_0x47bd1d];return _0x590b25;};'use strict';var client=require(_0x2436('0x0'));exports[_0x2436('0x1')]=function(){return function(){return client[_0x2436('0x2')](_0x2436('0x3'),{'options':{'raw':![],'attributes':['id',_0x2436('0x4'),'timeout','strategy'],'include':[{'model':_0x2436('0x5'),'as':_0x2436('0x6'),'attributes':['id',_0x2436('0x4'),_0x2436('0x7'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x455b=['getMailQueues','Request','GetMailQueue','strategy','User','Agents','name','online','../client'];(function(_0x2f590c,_0x45fa8d){var _0x17f83d=function(_0x4c7360){while(--_0x4c7360){_0x2f590c['push'](_0x2f590c['shift']());}};_0x17f83d(++_0x45fa8d);}(_0x455b,0x14c));var _0xb455=function(_0x1bec05,_0x58475e){_0x1bec05=_0x1bec05-0x0;var _0x5995e8=_0x455b[_0x1bec05];return _0x5995e8;};'use strict';var client=require(_0xb455('0x0'));exports[_0xb455('0x1')]=function(){return function(){return client[_0xb455('0x2')](_0xb455('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xb455('0x4')],'include':[{'model':_0xb455('0x5'),'as':_0xb455('0x6'),'attributes':['id',_0xb455('0x7'),_0xb455('0x8'),'mailPause']}]},'log':_0xb455('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 385e63e..3b1e556 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 _0x2507=['../client','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x2f5fea,_0x3ba2c0){var _0x36fe14=function(_0x3bbfc0){while(--_0x3bbfc0){_0x2f5fea['push'](_0x2f5fea['shift']());}};_0x36fe14(++_0x3ba2c0);}(_0x2507,0x1c2));var _0x7250=function(_0x24620f,_0xc150a8){_0x24620f=_0x24620f-0x0;var _0xe67f13=_0x2507[_0x24620f];return _0xe67f13;};'use strict';var client=require(_0x7250('0x0'));exports['create']=function(_0x520531){return client['Request']('CreateMailQueueReport',{'body':_0x520531,'log':_0x7250('0x1')});};exports[_0x7250('0x2')]=function(_0x395f5e,_0x4f096d){return client['Request'](_0x7250('0x3'),{'body':_0x4f096d,'options':{'where':{'uniqueid':_0x395f5e},'order':[['id',_0x7250('0x4')]],'limit':0x1},'log':_0x7250('0x3')});}; \ No newline at end of file +var _0xfdcf=['UpdateMailQueueReport','create','Request','CreateMailQueueReport','update'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xfdcf,0xf6));var _0xffdc=function(_0x286a54,_0x1126a9){_0x286a54=_0x286a54-0x0;var _0x5cc54d=_0xfdcf[_0x286a54];return _0x5cc54d;};'use strict';var client=require('../client');exports[_0xffdc('0x0')]=function(_0x34ab34){return client[_0xffdc('0x1')](_0xffdc('0x2'),{'body':_0x34ab34,'log':_0xffdc('0x2')});};exports[_0xffdc('0x3')]=function(_0xaadd58,_0x1ae783){return client[_0xffdc('0x1')](_0xffdc('0x4'),{'body':_0x1ae783,'options':{'where':{'uniqueid':_0xaadd58},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index a2f446c..3c61cbd 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 _0x8948=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction','update','Request'];(function(_0x4c2b08,_0x470242){var _0x283de6=function(_0x382557){while(--_0x382557){_0x4c2b08['push'](_0x4c2b08['shift']());}};_0x283de6(++_0x470242);}(_0x8948,0x88));var _0x8894=function(_0x1c6649,_0x5a4603){_0x1c6649=_0x1c6649-0x0;var _0x544c99=_0x8948[_0x1c6649];return _0x544c99;};'use strict';var client=require('../client');exports[_0x8894('0x0')]=function(_0xdb13f8,_0x4fd046){return client[_0x8894('0x1')](_0x8894('0x2'),{'body':_0x4fd046,'options':{'where':{'id':_0xdb13f8}},'log':_0x8894('0x3')});};exports[_0x8894('0x4')]=function(_0x19e1df,_0x4cd855){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x4cd855,'options':{'where':{'id':_0x19e1df}},'log':_0x8894('0x5')});}; \ No newline at end of file +var _0x4410=['Request','AddTagsToOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x4307c3,_0x454b3f){var _0x80659a=function(_0x452824){while(--_0x452824){_0x4307c3['push'](_0x4307c3['shift']());}};_0x80659a(++_0x454b3f);}(_0x4410,0xda));var _0x0441=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x4410[_0x588011];return _0x3b3773;};'use strict';var client=require('../client');exports['update']=function(_0x415edc,_0x27d599){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x27d599,'options':{'where':{'id':_0x415edc}},'log':_0x0441('0x0')});};exports[_0x0441('0x1')]=function(_0x24ca41,_0x3d54fe){return client[_0x0441('0x2')](_0x0441('0x3'),{'body':_0x3d54fe,'options':{'where':{'id':_0x24ca41}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 4f6cb60..050abc7 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 _0x86ba=['createOpenchannelMessage','create','Request'];(function(_0x532402,_0x1fc175){var _0x2b4684=function(_0x1dc714){while(--_0x1dc714){_0x532402['push'](_0x532402['shift']());}};_0x2b4684(++_0x1fc175);}(_0x86ba,0x178));var _0xa86b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x86ba[_0x21a9d9];return _0x46adce;};'use strict';var client=require('../client');exports[_0xa86b('0x0')]=function(_0x283b2c){return client[_0xa86b('0x1')]('CreateOpenchannelMessage',{'body':_0x283b2c,'log':_0xa86b('0x2')});}; \ No newline at end of file +var _0x89e7=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89e7,0x136));var _0x789e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x89e7[_0x4ae6ef];return _0x3cbb4e;};'use strict';var client=require(_0x789e('0x0'));exports[_0x789e('0x1')]=function(_0x58fb08){return client[_0x789e('0x2')](_0x789e('0x3'),{'body':_0x58fb08,'log':_0x789e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 5c964ee..197c9eb 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 _0xa282=['Agents','openchannelPause','../client','getOpenchannelQueues','name','strategy','User'];(function(_0x2f9c3a,_0x1f6aa7){var _0x4769fb=function(_0x1fbe95){while(--_0x1fbe95){_0x2f9c3a['push'](_0x2f9c3a['shift']());}};_0x4769fb(++_0x1f6aa7);}(_0xa282,0x1bb));var _0x2a28=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa282[_0x422905];return _0x33dc6c;};'use strict';var client=require(_0x2a28('0x0'));exports[_0x2a28('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x2a28('0x2'),'timeout',_0x2a28('0x3')],'include':[{'model':_0x2a28('0x4'),'as':_0x2a28('0x5'),'attributes':['id',_0x2a28('0x2'),'online',_0x2a28('0x6')]}]},'log':_0x2a28('0x1')});};}; \ No newline at end of file +var _0x752c=['online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x752c,0xea));var _0xc752=function(_0x427565,_0x4506f2){_0x427565=_0x427565-0x0;var _0xaf0ccb=_0x752c[_0x427565];return _0xaf0ccb;};'use strict';var client=require(_0xc752('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xc752('0x1')](_0xc752('0x2'),{'options':{'raw':![],'attributes':['id',_0xc752('0x3'),_0xc752('0x4'),_0xc752('0x5')],'include':[{'model':_0xc752('0x6'),'as':_0xc752('0x7'),'attributes':['id',_0xc752('0x3'),_0xc752('0x8'),_0xc752('0x9')]}]},'log':_0xc752('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 38bff73..a0a9068 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 _0xd840=['../client','create','CreateOpenchannelQueueReport','update','DESC'];(function(_0x5b994f,_0x2ad80f){var _0x1c59b7=function(_0x26620b){while(--_0x26620b){_0x5b994f['push'](_0x5b994f['shift']());}};_0x1c59b7(++_0x2ad80f);}(_0xd840,0xd7));var _0x0d84=function(_0x2caffb,_0x5ce5b5){_0x2caffb=_0x2caffb-0x0;var _0x2226f3=_0xd840[_0x2caffb];return _0x2226f3;};'use strict';var client=require(_0x0d84('0x0'));exports[_0x0d84('0x1')]=function(_0x1e1861){return client['Request'](_0x0d84('0x2'),{'body':_0x1e1861,'log':_0x0d84('0x2')});};exports[_0x0d84('0x3')]=function(_0x55820b,_0x2f27a0){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x2f27a0,'options':{'where':{'uniqueid':_0x55820b},'order':[['id',_0x0d84('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x7a8a=['create','Request','CreateOpenchannelQueueReport','DESC','UpdateOpenchannelQueueReport','../client'];(function(_0x59dfe2,_0x5399f6){var _0x1659b8=function(_0x2386db){while(--_0x2386db){_0x59dfe2['push'](_0x59dfe2['shift']());}};_0x1659b8(++_0x5399f6);}(_0x7a8a,0xb3));var _0xa7a8=function(_0x2d4064,_0x16d97b){_0x2d4064=_0x2d4064-0x0;var _0x55b0e7=_0x7a8a[_0x2d4064];return _0x55b0e7;};'use strict';var client=require(_0xa7a8('0x0'));exports[_0xa7a8('0x1')]=function(_0x2adddd){return client[_0xa7a8('0x2')](_0xa7a8('0x3'),{'body':_0x2adddd,'log':_0xa7a8('0x3')});};exports['update']=function(_0x219d85,_0x1e2469){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x1e2469,'options':{'where':{'uniqueid':_0x219d85},'order':[['id',_0xa7a8('0x4')]],'limit':0x1},'log':_0xa7a8('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index b0ae822..83bfe01 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 _0x20d6=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','updateSmsInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20d6,0x9d));var _0x620d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x20d6[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x620d('0x0'));exports[_0x620d('0x1')]=function(_0xd8cdeb,_0x6474fc){return client[_0x620d('0x2')]('UpdateSmsInteraction',{'body':_0x6474fc,'options':{'where':{'id':_0xd8cdeb}},'log':_0x620d('0x3')});};exports[_0x620d('0x4')]=function(_0x11883f,_0x39dbb4){return client['Request'](_0x620d('0x5'),{'body':_0x39dbb4,'options':{'where':{'id':_0x11883f}},'log':_0x620d('0x6')});}; \ No newline at end of file +var _0x4849=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x500a2c,_0xfe5b5b){var _0x192e0d=function(_0x3ceb73){while(--_0x3ceb73){_0x500a2c['push'](_0x500a2c['shift']());}};_0x192e0d(++_0xfe5b5b);}(_0x4849,0x86));var _0x9484=function(_0x22153e,_0xc6a9af){_0x22153e=_0x22153e-0x0;var _0x5cebed=_0x4849[_0x22153e];return _0x5cebed;};'use strict';var client=require(_0x9484('0x0'));exports[_0x9484('0x1')]=function(_0x4fcfaf,_0x11cf8a){return client[_0x9484('0x2')](_0x9484('0x3'),{'body':_0x11cf8a,'options':{'where':{'id':_0x4fcfaf}},'log':_0x9484('0x4')});};exports[_0x9484('0x5')]=function(_0x3f3057,_0x6ea4d8){return client['Request'](_0x9484('0x6'),{'body':_0x6ea4d8,'options':{'where':{'id':_0x3f3057}},'log':_0x9484('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 40ac83c..4f870fd 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 _0xdceb=['Request','createSmsMessage','../client','create'];(function(_0x2f7154,_0x1c2c71){var _0x12a260=function(_0x2718d8){while(--_0x2718d8){_0x2f7154['push'](_0x2f7154['shift']());}};_0x12a260(++_0x1c2c71);}(_0xdceb,0x12e));var _0xbdce=function(_0x2090a5,_0x3fa7d9){_0x2090a5=_0x2090a5-0x0;var _0x52db3b=_0xdceb[_0x2090a5];return _0x52db3b;};'use strict';var client=require(_0xbdce('0x0'));exports[_0xbdce('0x1')]=function(_0x432d71){return client[_0xbdce('0x2')]('CreateSmsMessage',{'body':_0x432d71,'log':_0xbdce('0x3')});}; \ No newline at end of file +var _0xd075=['createSmsMessage','Request'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xd075,0x1bb));var _0x5d07=function(_0xa56451,_0x4e3d72){_0xa56451=_0xa56451-0x0;var _0x12a904=_0xd075[_0xa56451];return _0x12a904;};'use strict';var client=require('../client');exports['create']=function(_0x42b3da){return client[_0x5d07('0x0')]('CreateSmsMessage',{'body':_0x42b3da,'log':_0x5d07('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 3a65e75..65b30af 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x4b4f1b,_0x167470){var _0xbcaf1f=function(_0x45bf5b){while(--_0x45bf5b){_0x4b4f1b['push'](_0x4b4f1b['shift']());}};_0xbcaf1f(++_0x167470);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x199e32,_0x217eb5){var _0x38265c=function(_0x1bd35b){while(--_0x1bd35b){_0x199e32['push'](_0x199e32['shift']());}};_0x38265c(++_0x217eb5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index ba0f3f3..e15d3c9 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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x4c4477,_0x326500){var _0x584f9e=function(_0x3fd849){while(--_0x3fd849){_0x4c4477['push'](_0x4c4477['shift']());}};_0x584f9e(++_0x326500);}(_0x55ca,0x126));var _0xa55c=function(_0x315d32,_0x33485b){_0x315d32=_0x315d32-0x0;var _0x3ea98d=_0x55ca[_0x315d32];return _0x3ea98d;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x1725f6,_0x3bce2e){var _0x10be49=function(_0x20aa24){while(--_0x20aa24){_0x1725f6['push'](_0x1725f6['shift']());}};_0x10be49(++_0x3bce2e);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4db86bd..26cee4e 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(_0x1bd72e,_0xa68751){var _0x15e50d=function(_0x28832d){while(--_0x28832d){_0x1bd72e['push'](_0x1bd72e['shift']());}};_0x15e50d(++_0xa68751);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x146e36,_0x3207e6){var _0x36ff78=function(_0x504638){while(--_0x504638){_0x146e36['push'](_0x146e36['shift']());}};_0x36ff78(++_0x3207e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 7e6ffb6..64d6fe4 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 _0x4300=['addTags','AddTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x5f32a6,_0x3b2a7d){var _0x53d5a5=function(_0x261649){while(--_0x261649){_0x5f32a6['push'](_0x5f32a6['shift']());}};_0x53d5a5(++_0x3b2a7d);}(_0x4300,0x1a6));var _0x0430=function(_0x1156e2,_0x41720e){_0x1156e2=_0x1156e2-0x0;var _0x28a746=_0x4300[_0x1156e2];return _0x28a746;};'use strict';var client=require(_0x0430('0x0'));exports['update']=function(_0x48a4db,_0x481e26){return client['Request'](_0x0430('0x1'),{'body':_0x481e26,'options':{'where':{'id':_0x48a4db}},'log':_0x0430('0x2')});};exports[_0x0430('0x3')]=function(_0x2a1e62,_0x1735aa){return client['Request'](_0x0430('0x4'),{'body':_0x1735aa,'options':{'where':{'id':_0x2a1e62}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x7923=['update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client'];(function(_0x49de1a,_0x3b1047){var _0x53170f=function(_0x4e2c37){while(--_0x4e2c37){_0x49de1a['push'](_0x49de1a['shift']());}};_0x53170f(++_0x3b1047);}(_0x7923,0x8f));var _0x3792=function(_0x561fcc,_0x289736){_0x561fcc=_0x561fcc-0x0;var _0x22ec67=_0x7923[_0x561fcc];return _0x22ec67;};'use strict';var client=require(_0x3792('0x0'));exports[_0x3792('0x1')]=function(_0x2fb5a5,_0xdc0c64){return client[_0x3792('0x2')](_0x3792('0x3'),{'body':_0xdc0c64,'options':{'where':{'id':_0x2fb5a5}},'log':_0x3792('0x4')});};exports['addTags']=function(_0x21134d,_0x51d334){return client['Request'](_0x3792('0x5'),{'body':_0x51d334,'options':{'where':{'id':_0x21134d}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 4e13395..02a149f 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 _0x26a0=['createWhatsappMessage','create','Request','CreateWhatsappMessage'];(function(_0x2800ce,_0x5f05a0){var _0x3d0ee1=function(_0x326d38){while(--_0x326d38){_0x2800ce['push'](_0x2800ce['shift']());}};_0x3d0ee1(++_0x5f05a0);}(_0x26a0,0x1bd));var _0x026a=function(_0xcdd786,_0x1ed6d3){_0xcdd786=_0xcdd786-0x0;var _0x4b6fe0=_0x26a0[_0xcdd786];return _0x4b6fe0;};'use strict';var client=require('../client');exports[_0x026a('0x0')]=function(_0x22251d){return client[_0x026a('0x1')](_0x026a('0x2'),{'body':_0x22251d,'log':_0x026a('0x3')});}; \ No newline at end of file +var _0x87cb=['createWhatsappMessage','CreateWhatsappMessage'];(function(_0x1cf6bb,_0x2661e2){var _0xe208a6=function(_0x5345fa){while(--_0x5345fa){_0x1cf6bb['push'](_0x1cf6bb['shift']());}};_0xe208a6(++_0x2661e2);}(_0x87cb,0x19d));var _0xb87c=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x87cb[_0xbd08b4];return _0x314f1e;};'use strict';var client=require('../client');exports['create']=function(_0x37c9bd){return client['Request'](_0xb87c('0x0'),{'body':_0x37c9bd,'log':_0xb87c('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 7bbd51d..ba5da24 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 _0x8feb=['online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','User','Agents'];(function(_0x303ff4,_0x5b9c25){var _0x5be822=function(_0x106c8e){while(--_0x106c8e){_0x303ff4['push'](_0x303ff4['shift']());}};_0x5be822(++_0x5b9c25);}(_0x8feb,0xca));var _0xb8fe=function(_0x4cedbe,_0x17c16d){_0x4cedbe=_0x4cedbe-0x0;var _0x47aee5=_0x8feb[_0x4cedbe];return _0x47aee5;};'use strict';var client=require(_0xb8fe('0x0'));exports[_0xb8fe('0x1')]=function(){return function(){return client[_0xb8fe('0x2')](_0xb8fe('0x3'),{'options':{'raw':![],'attributes':['id',_0xb8fe('0x4'),_0xb8fe('0x5'),'strategy'],'include':[{'model':_0xb8fe('0x6'),'as':_0xb8fe('0x7'),'attributes':['id',_0xb8fe('0x4'),_0xb8fe('0x8'),_0xb8fe('0x9')]}]},'log':_0xb8fe('0x1')});};}; \ No newline at end of file +var _0x598e=['../client','getWhatsappQueues','name','timeout','strategy','User','Agents','online','whatsappPause'];(function(_0x3d8d33,_0x11799f){var _0x598936=function(_0x1c4bff){while(--_0x1c4bff){_0x3d8d33['push'](_0x3d8d33['shift']());}};_0x598936(++_0x11799f);}(_0x598e,0x18c));var _0xe598=function(_0x505151,_0x8e3de9){_0x505151=_0x505151-0x0;var _0x541232=_0x598e[_0x505151];return _0x541232;};'use strict';var client=require(_0xe598('0x0'));exports[_0xe598('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xe598('0x2'),_0xe598('0x3'),_0xe598('0x4')],'include':[{'model':_0xe598('0x5'),'as':_0xe598('0x6'),'attributes':['id',_0xe598('0x2'),_0xe598('0x7'),_0xe598('0x8')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index a6af8d7..f3730da 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 _0x6d54=['DESC','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0x6d54,0x1cd));var _0x46d5=function(_0x4aa6b2,_0x54395a){_0x4aa6b2=_0x4aa6b2-0x0;var _0x50005c=_0x6d54[_0x4aa6b2];return _0x50005c;};'use strict';var client=require(_0x46d5('0x0'));exports['create']=function(_0x17f5de){return client[_0x46d5('0x1')](_0x46d5('0x2'),{'body':_0x17f5de,'log':'CreateWhatsappQueueReport'});};exports[_0x46d5('0x3')]=function(_0x18b942,_0x5a093e){return client[_0x46d5('0x1')]('UpdateWhatsappQueueReport',{'body':_0x5a093e,'options':{'where':{'uniqueid':_0x18b942},'order':[['id',_0x46d5('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x746b=['UpdateWhatsappQueueReport','../client','create','CreateWhatsappQueueReport','update','Request'];(function(_0xa85344,_0x4e827a){var _0x307144=function(_0x5112f8){while(--_0x5112f8){_0xa85344['push'](_0xa85344['shift']());}};_0x307144(++_0x4e827a);}(_0x746b,0xc7));var _0xb746=function(_0x36d790,_0x5e2433){_0x36d790=_0x36d790-0x0;var _0x2dab5f=_0x746b[_0x36d790];return _0x2dab5f;};'use strict';var client=require(_0xb746('0x0'));exports[_0xb746('0x1')]=function(_0x23c85c){return client['Request'](_0xb746('0x2'),{'body':_0x23c85c,'log':'CreateWhatsappQueueReport'});};exports[_0xb746('0x3')]=function(_0x34db82,_0x389588){return client[_0xb746('0x4')](_0xb746('0x5'),{'body':_0x389588,'options':{'where':{'uniqueid':_0x34db82},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index b255595..601bd30 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 _0xc7df=['find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','error','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop'];(function(_0x228abd,_0x1a2168){var _0x2de6ee=function(_0x2a508c){while(--_0x2a508c){_0x228abd['push'](_0x228abd['shift']());}};_0x2de6ee(++_0x1a2168);}(_0xc7df,0x149));var _0xfc7d=function(_0x53c4e1,_0x4234b1){_0x53c4e1=_0x53c4e1-0x0;var _0x3f8a97=_0xc7df[_0x53c4e1];return _0x3f8a97;};'use strict';var schema=require(_0xfc7d('0x0'));var _=require(_0xfc7d('0x1'));var util=require(_0xfc7d('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xfc7d('0x3'))(_0xfc7d('0x4'));var strategy=require(_0xfc7d('0x5'));var queue=schema({'name':{'type':_0xfc7d('0x6'),'required':!![],'message':_0xfc7d('0x7')},'timeout':{'type':_0xfc7d('0x8'),'message':_0xfc7d('0x9')}});function writeLog(_0x42df5a,_0x26c030,_0x49b69d){return logger[_0xfc7d('0xa')](util[_0xfc7d('0xb')](_0xfc7d('0xc'),_0x42df5a,_0x26c030[_0xfc7d('0xd')],_0x49b69d));}function handleFindAgent(_0x281bc3){return function(_0x4de0ab){return _0x4de0ab[_0xfc7d('0xd')][_0xfc7d('0xe')]()===_0x281bc3[_0xfc7d('0xe')]();};}exports[_0xfc7d('0xf')]=function(_0x26b087,_0x56739e,_0xf34698,_0x580727){return function(_0x5dc1b7){try{var _0x5a9929={'name':_0x56739e[0x0],'timeout':_0x56739e[0x1]};var _0x56feae=queue[_0xfc7d('0x0')](_0x5a9929,{'typecast':!![]});if(_0x56feae[_0xfc7d('0x10')]){logger['error'](_0xfc7d('0x11'),_0x26b087,_[_0xfc7d('0x12')](_0x56feae,_0xfc7d('0x13'))[_0xfc7d('0x14')](',\x20'));_0x5dc1b7[_0xfc7d('0x15')]();}else{var _0x3f44f7=_[_0xfc7d('0x16')](_0xf34698[_0xfc7d('0x17')],handleFindAgent(_0x5a9929[_0xfc7d('0xd')]));if(_0x3f44f7){var _0x546d93=(_0x5a9929[_0xfc7d('0x18')]||0xa)*0x3e8;var _0x35f663,_0x567a54;var _0x43a37d=seqqueue[_0xfc7d('0x19')](_0x546d93);_0x43a37d['id']=_0x26b087;_0x43a37d[_0xfc7d('0x1a')]=_0x546d93;_0x43a37d[_0xfc7d('0x1b')]=_0x580727[_0xfc7d('0x1b')];writeLog(_0x26b087,_0x3f44f7,util[_0xfc7d('0xb')](_0xfc7d('0x1c'),_0x546d93));_0xf34698[_0xfc7d('0x1d')][_0x26b087]['on'](_0xfc7d('0x1e'),function(){logger[_0xfc7d('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x26b087);clearTimeout(_0x567a54);_0x567a54=undefined;_0x43a37d[_0xfc7d('0x1f')]();if(_0xf34698[_0xfc7d('0x1d')][_0x26b087]){delete _0xf34698[_0xfc7d('0x1d')][_0x26b087];}_0x5dc1b7['stop']();});_0xf34698[_0xfc7d('0x1d')][_0x26b087]['on']('complete',function(){if(_0xf34698[_0xfc7d('0x1d')][_0x26b087]){delete _0xf34698[_0xfc7d('0x1d')][_0x26b087];}});_0x567a54=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x26b087);clearTimeout(_0x567a54);_0x43a37d[_0xfc7d('0x1f')]();_0x5dc1b7[_0xfc7d('0x20')]();},_0x546d93);strategy[_0xfc7d('0x21')](_0x43a37d,_0x3f44f7,_0xf34698,_0x580727);}else{logger['error'](_0xfc7d('0x22'),_0x26b087,_0x5a9929[_0xfc7d('0xd')]);_0x5dc1b7['stop']();}}}catch(_0x5ad76e){console[_0xfc7d('0x23')](_0x5ad76e);logger[_0xfc7d('0x24')](_0xfc7d('0x25'),_0x26b087,_0x5ad76e[_0xfc7d('0x26')]);_0x5dc1b7[_0xfc7d('0x15')]();}};}; \ No newline at end of file +var _0xa28c=['log','stack','validate','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','map','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','info','close','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s'];(function(_0x17dea5,_0x3439f3){var _0x4df79c=function(_0x6da011){while(--_0x6da011){_0x17dea5['push'](_0x17dea5['shift']());}};_0x4df79c(++_0x3439f3);}(_0xa28c,0x182));var _0xca28=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xa28c[_0x543084];return _0x306a57;};'use strict';var schema=require(_0xca28('0x0'));var _=require('lodash');var util=require(_0xca28('0x1'));var seqqueue=require(_0xca28('0x2'));var logger=require('../../../../config/logger')(_0xca28('0x3'));var strategy=require(_0xca28('0x4'));var queue=schema({'name':{'type':_0xca28('0x5'),'required':!![],'message':_0xca28('0x6')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x152131,_0x2a7323,_0x3e97b2){return logger['info'](util[_0xca28('0x7')](_0xca28('0x8'),_0x152131,_0x2a7323[_0xca28('0x9')],_0x3e97b2));}function handleFindAgent(_0x55edcc){return function(_0x2a1618){return _0x2a1618[_0xca28('0x9')][_0xca28('0xa')]()===_0x55edcc['toLowerCase']();};}exports['consequence']=function(_0x2821b5,_0x1cca17,_0x371145,_0x582737){return function(_0x5cb415){try{var _0x2e05a1={'name':_0x1cca17[0x0],'timeout':_0x1cca17[0x1]};var _0x47fc52=queue[_0xca28('0x0')](_0x2e05a1,{'typecast':!![]});if(_0x47fc52['length']){logger[_0xca28('0xb')]('[%s][AGENT]\x20%s',_0x2821b5,_[_0xca28('0xc')](_0x47fc52,_0xca28('0xd'))[_0xca28('0xe')](',\x20'));_0x5cb415[_0xca28('0xf')]();}else{var _0x1e4c7a=_[_0xca28('0x10')](_0x371145[_0xca28('0x11')],handleFindAgent(_0x2e05a1[_0xca28('0x9')]));if(_0x1e4c7a){var _0x28e877=(_0x2e05a1[_0xca28('0x12')]||0xa)*0x3e8;var _0x964b22,_0x50dde5;var _0x2ae98b=seqqueue[_0xca28('0x13')](_0x28e877);_0x2ae98b['id']=_0x2821b5;_0x2ae98b['atimeout']=_0x28e877;_0x2ae98b[_0xca28('0x14')]=_0x582737[_0xca28('0x14')];writeLog(_0x2821b5,_0x1e4c7a,util[_0xca28('0x7')](_0xca28('0x15'),_0x28e877));_0x371145[_0xca28('0x16')][_0x2821b5]['on'](_0xca28('0x17'),function(){logger[_0xca28('0x18')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x2821b5);clearTimeout(_0x50dde5);_0x50dde5=undefined;_0x2ae98b[_0xca28('0x19')]();if(_0x371145['rules'][_0x2821b5]){delete _0x371145[_0xca28('0x16')][_0x2821b5];}_0x5cb415['stop']();});_0x371145[_0xca28('0x16')][_0x2821b5]['on'](_0xca28('0x1a'),function(){if(_0x371145[_0xca28('0x16')][_0x2821b5]){delete _0x371145[_0xca28('0x16')][_0x2821b5];}});_0x50dde5=setTimeout(function(){logger[_0xca28('0x18')]('[%s][AGENT]\x20ROUTING\x20END',_0x2821b5);clearTimeout(_0x50dde5);_0x2ae98b[_0xca28('0x19')]();_0x5cb415[_0xca28('0x1b')]();},_0x28e877);strategy[_0xca28('0x1c')](_0x2ae98b,_0x1e4c7a,_0x371145,_0x582737);}else{logger[_0xca28('0xb')](_0xca28('0x1d'),_0x2821b5,_0x2e05a1[_0xca28('0x9')]);_0x5cb415[_0xca28('0xf')]();}}}catch(_0x598735){console[_0xca28('0x1e')](_0x598735);logger[_0xca28('0xb')]('[%s][QUEUE]\x20%s',_0x2821b5,_0x598735[_0xca28('0x1f')]);_0x5cb415[_0xca28('0xf')]();}};}; \ 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 acfe516..4e65868 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 _0x604d=['body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','providerName','amazonlex','then','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','account','AccountId','upperFirst','InteractionId','created','isEmpty','Message','create','info'];(function(_0xa8d2f7,_0x2349b5){var _0x3b8c8f=function(_0x5823fb){while(--_0x5823fb){_0xa8d2f7['push'](_0xa8d2f7['shift']());}};_0x3b8c8f(++_0x2349b5);}(_0x604d,0x1c2));var _0xd604=function(_0x1ac07d,_0x36c831){_0x1ac07d=_0x1ac07d-0x0;var _0x555ec6=_0x604d[_0x1ac07d];return _0x555ec6;};'use strict';var _=require(_0xd604('0x0'));var moment=require(_0xd604('0x1'));var AWS=require(_0xd604('0x2'));var utils=require(_0xd604('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xd604('0x4')),'openchannelMessage':require(_0xd604('0x5')),'mailMessage':require(_0xd604('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd604('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x47d012,_0x1abe1c){return function(_0xc058d1){try{if(!_[_0xd604('0x8')](this[_0xd604('0x9')][_0xd604('0xa')])){logger['info'](_0xd604('0xb'),_0x47d012,_0xd604('0xc'));return _0xc058d1[_0xd604('0xd')]();}var _0x542269={'ContactId':this[_0xd604('0xe')]['id'],'sentAt':moment()[_0xd604('0xf')](_0xd604('0x10')),'direction':_0xd604('0x11')};if(this[_0xd604('0x12')]==='sms'||this[_0xd604('0x12')]===_0xd604('0x13')){_0x542269[_0xd604('0x14')]=this[_0xd604('0x9')][_0xd604('0x14')];}var _0x175f17=this['channel'];if(_0x175f17==='chat'){_0x542269['ChatWebsiteId']=this[_0xd604('0x15')]['id'];}else{_0x542269[_['upperFirst'](_0x175f17)+_0xd604('0x16')]=this[_0xd604('0x15')]['id'];}_0x542269[_[_0xd604('0x17')](_0x175f17)+_0xd604('0x18')]=this[_0xd604('0x9')]['id'];if(this[_0xd604('0x9')][_0xd604('0x19')]){var _0x5a43c8=_0x1abe1c[0x4];if(!_[_0xd604('0x1a')](_0x5a43c8)){_0x542269['body']=utils['getMustacheRender'](_0x5a43c8,this);return rpc[_0x175f17+_0xd604('0x1b')][_0xd604('0x1c')](_0x542269)['then'](function(_0x58904f){logger[_0xd604('0x1d')](_0xd604('0xb'),_0x47d012,_0x542269[_0xd604('0x1e')]);})[_0xd604('0x1f')](function(_0x45d933){logger[_0xd604('0x20')]('[%s][AMAZONLEX]\x20%s',_0x47d012,JSON[_0xd604('0x21')](_0x45d933));})[_0xd604('0x22')](function(){logger['info'](_0xd604('0x23'),_0x47d012);_0xc058d1[_0xd604('0x24')]();});}else{logger[_0xd604('0x1d')](_0xd604('0x25'),_0x47d012);_0xc058d1[_0xd604('0x24')]();}}else{var _0xdaa9d=this;var _0xe0eb95=new AWS[(_0xd604('0x26'))]({'accessKeyId':_0x1abe1c[0x0],'secretAccessKey':_0x1abe1c[0x1],'region':_0x1abe1c[0x2]});var _0x3646fb={'botAlias':_0xd604('0x27'),'botName':_0x1abe1c[0x3],'inputText':this[_0xd604('0x28')]['body'],'userId':this['channel']+':'+this['interaction']['id'][_0xd604('0x29')]()};_0xe0eb95[_0xd604('0x2a')](_0x3646fb,function(_0x146456,_0x2f5ebf){if(_0x146456){logger[_0xd604('0x20')](_0xd604('0xb'),_0x47d012,_0x146456[_0xd604('0x28')]);_0xc058d1[_0xd604('0xd')]();}else if(_0x2f5ebf&&_0x2f5ebf[_0xd604('0x28')]){_0xdaa9d[_0xd604('0x1e')]['amazonlex']=_0x2f5ebf;_0x542269[_0xd604('0x1e')]=_0x2f5ebf['message'];_0x542269[_0xd604('0x2b')]=_0xd604('0x2c');_0x542269['providerResponse']=JSON[_0xd604('0x21')](_0x2f5ebf);return rpc[_0x175f17+_0xd604('0x1b')][_0xd604('0x1c')](_0x542269)[_0xd604('0x2d')](function(_0x39cfa7){logger[_0xd604('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x47d012,_0x542269[_0xd604('0x1e')]);if(_0x2f5ebf[_0xd604('0x2e')]==_0xd604('0x2f')){_0xc058d1['next']();}else{_0xc058d1['stop']();}})[_0xd604('0x1f')](function(_0x3d8efd){logger[_0xd604('0x20')](_0xd604('0xb'),_0x47d012,JSON['stringify'](_0x3d8efd));_0xc058d1[_0xd604('0xd')]();});}else{_0xc058d1[_0xd604('0xd')]();}});}}catch(_0x265307){logger[_0xd604('0x20')](_0xd604('0xb'),_0x47d012,JSON[_0xd604('0x21')](_0x265307));_0xc058d1['stop']();}};}; \ No newline at end of file +var _0x351e=['chat','account','AccountId','upperFirst','InteractionId','interaction','created','isEmpty','body','Message','create','then','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','error','next','amazonlex','providerName','stringify','dialogState','Failed','aws-sdk','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','whatsapp','phone'];(function(_0x130867,_0x188e00){var _0x2c849b=function(_0x166a48){while(--_0x166a48){_0x130867['push'](_0x130867['shift']());}};_0x2c849b(++_0x188e00);}(_0x351e,0x10f));var _0xe351=function(_0x3bbd2d,_0xf8ba3c){_0x3bbd2d=_0x3bbd2d-0x0;var _0x241bd4=_0x351e[_0x3bbd2d];return _0x241bd4;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0xe351('0x0'));var utils=require(_0xe351('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe351('0x2')),'mailMessage':require(_0xe351('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe351('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x4e55f8,_0x14e1cd){return function(_0x43bd1f){try{if(!_[_0xe351('0x5')](this['interaction'][_0xe351('0x6')])){logger[_0xe351('0x7')](_0xe351('0x8'),_0x4e55f8,_0xe351('0x9'));return _0x43bd1f['next']();}var _0xb56364={'ContactId':this[_0xe351('0xa')]['id'],'sentAt':moment()[_0xe351('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xe351('0xc')};if(this[_0xe351('0xd')]==='sms'||this['channel']===_0xe351('0xe')){_0xb56364[_0xe351('0xf')]=this['interaction'][_0xe351('0xf')];}var _0x216ab3=this[_0xe351('0xd')];if(_0x216ab3===_0xe351('0x10')){_0xb56364['ChatWebsiteId']=this[_0xe351('0x11')]['id'];}else{_0xb56364[_['upperFirst'](_0x216ab3)+_0xe351('0x12')]=this[_0xe351('0x11')]['id'];}_0xb56364[_[_0xe351('0x13')](_0x216ab3)+_0xe351('0x14')]=this['interaction']['id'];if(this[_0xe351('0x15')][_0xe351('0x16')]){var _0x432d65=_0x14e1cd[0x4];if(!_[_0xe351('0x17')](_0x432d65)){_0xb56364[_0xe351('0x18')]=utils['getMustacheRender'](_0x432d65,this);return rpc[_0x216ab3+_0xe351('0x19')][_0xe351('0x1a')](_0xb56364)[_0xe351('0x1b')](function(_0x513840){logger['info'](_0xe351('0x8'),_0x4e55f8,_0xb56364[_0xe351('0x18')]);})[_0xe351('0x1c')](function(_0x3611cf){logger['error'](_0xe351('0x8'),_0x4e55f8,JSON['stringify'](_0x3611cf));})[_0xe351('0x1d')](function(){logger[_0xe351('0x7')](_0xe351('0x1e'),_0x4e55f8);_0x43bd1f[_0xe351('0x1f')]();});}else{logger[_0xe351('0x7')](_0xe351('0x20'),_0x4e55f8);_0x43bd1f[_0xe351('0x1f')]();}}else{var _0x2f91f9=this;var _0x3d65ff=new AWS['LexRuntime']({'accessKeyId':_0x14e1cd[0x0],'secretAccessKey':_0x14e1cd[0x1],'region':_0x14e1cd[0x2]});var _0x2a286={'botAlias':'$LATEST','botName':_0x14e1cd[0x3],'inputText':this[_0xe351('0x21')][_0xe351('0x18')],'userId':this[_0xe351('0xd')]+':'+this[_0xe351('0x15')]['id']['toString']()};_0x3d65ff['postText'](_0x2a286,function(_0x7ed21d,_0x210e65){if(_0x7ed21d){logger[_0xe351('0x22')](_0xe351('0x8'),_0x4e55f8,_0x7ed21d[_0xe351('0x21')]);_0x43bd1f[_0xe351('0x23')]();}else if(_0x210e65&&_0x210e65['message']){_0x2f91f9['body'][_0xe351('0x24')]=_0x210e65;_0xb56364[_0xe351('0x18')]=_0x210e65[_0xe351('0x21')];_0xb56364[_0xe351('0x25')]=_0xe351('0x24');_0xb56364['providerResponse']=JSON[_0xe351('0x26')](_0x210e65);return rpc[_0x216ab3+_0xe351('0x19')][_0xe351('0x1a')](_0xb56364)[_0xe351('0x1b')](function(_0x5b1cfc){logger[_0xe351('0x7')](_0xe351('0x8'),_0x4e55f8,_0xb56364['body']);if(_0x210e65[_0xe351('0x27')]==_0xe351('0x28')){_0x43bd1f['next']();}else{_0x43bd1f['stop']();}})[_0xe351('0x1c')](function(_0x2c038a){logger[_0xe351('0x22')](_0xe351('0x8'),_0x4e55f8,JSON[_0xe351('0x26')](_0x2c038a));_0x43bd1f['next']();});}else{_0x43bd1f['next']();}});}}catch(_0x834820){logger[_0xe351('0x22')](_0xe351('0x8'),_0x4e55f8,JSON[_0xe351('0x26')](_0x834820));_0x43bd1f[_0xe351('0x1f')]();}};}; \ 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 fbe6384..f710928 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 _0xe528=['InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','','headers','sendMailMessage','then','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','autoreplyExecuted','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0xe528,0x19d));var _0x8e52=function(_0x315b7c,_0x19ff8e){_0x315b7c=_0x315b7c-0x0;var _0x3a99eb=_0xe528[_0x315b7c];return _0x3a99eb;};'use strict';var _=require(_0x8e52('0x0'));var moment=require(_0x8e52('0x1'));var utils=require(_0x8e52('0x2'));var logger=require(_0x8e52('0x3'))(_0x8e52('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8e52('0x5')),'mailMessage':require(_0x8e52('0x6')),'smsMessage':require(_0x8e52('0x7')),'faxMessage':require(_0x8e52('0x8')),'whatsappMessage':require(_0x8e52('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x8e52('0xa')),'faxInteraction':require(_0x8e52('0xb')),'whatsappInteraction':require(_0x8e52('0xc'))};var mailRpc=require(_0x8e52('0xd'));exports['consequence']=function(_0x38bfa0,_0x48d25a,_0x4335b2,_0x3878f8){return function(_0x319f03){try{var _0x4709ee=this['channel'];if(_0x4709ee===_0x8e52('0xe')&&_0x3878f8[_0x8e52('0xf')][_0x8e52('0x10')]){logger[_0x8e52('0x11')](_0x8e52('0x12'),_0x38bfa0,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x319f03[_0x8e52('0x13')]();}if(_0x48d25a[0x0]==='1'&&(_['isNil'](this[_0x8e52('0x14')][_0x8e52('0x15')])||!this[_0x8e52('0x14')][_0x8e52('0x15')])){logger[_0x8e52('0x11')](_0x8e52('0x12'),_0x38bfa0,_0x8e52('0x16'));return _0x319f03[_0x8e52('0x13')]();}if(_0x48d25a[0x0]==='2'&&this[_0x8e52('0x14')]['autoreplyExecuted']){logger['info'](_0x8e52('0x17'),_0x38bfa0,_0x8e52('0x18'));return _0x319f03['next']();}var _0xa1dcc2={'ContactId':this[_0x8e52('0x19')]['id'],'sentAt':moment()[_0x8e52('0x1a')](_0x8e52('0x1b')),'direction':_0x8e52('0x1c')};if(this[_0x8e52('0x1d')]===_0x8e52('0xe')){_0xa1dcc2[_0x8e52('0xf')]=utils[_0x8e52('0x1e')](_0x48d25a[0x2],this);}else{_0xa1dcc2[_0x8e52('0xf')]=utils[_0x8e52('0x1e')](_0x48d25a[0x1],this);}if(this[_0x8e52('0x1f')]){_0xa1dcc2['to']=this[_0x8e52('0x1f')][_0x8e52('0x20')]||'';if(this['channel']==='mail'&&_0x48d25a[0x1]==='1'){_0xa1dcc2['cc']=this[_0x8e52('0x1f')]['cc']||'';}_0xa1dcc2[_0x8e52('0x20')]=this[_0x8e52('0x1f')]['to']||'';_0xa1dcc2[_0x8e52('0x21')]=this[_0x8e52('0x1f')][_0x8e52('0x21')]||'';_0xa1dcc2[_0x8e52('0x22')]=!![];if(this[_0x8e52('0x1f')][_0x8e52('0x23')]){_0xa1dcc2[_0x8e52('0x23')]='';_0xa1dcc2['subject']+=_['startsWith'](this[_0x8e52('0x1f')][_0x8e52('0x23')],_0x8e52('0x24'))?'':_0x8e52('0x25');_0xa1dcc2[_0x8e52('0x23')]+=this[_0x8e52('0x1f')][_0x8e52('0x23')];}}if(this[_0x8e52('0x1d')]===_0x8e52('0x26')){_0xa1dcc2[_0x8e52('0x27')]=this[_0x8e52('0x28')]['id'];}else{_0xa1dcc2[_[_0x8e52('0x29')](this[_0x8e52('0x1d')])+_0x8e52('0x2a')]=this[_0x8e52('0x28')]['id'];}_0xa1dcc2[_[_0x8e52('0x29')](this[_0x8e52('0x1d')])+_0x8e52('0x2b')]=this[_0x8e52('0x14')]['id'];var _0x36b8dd=this[_0x8e52('0x14')];if(rpc[this[_0x8e52('0x1d')]+_0x8e52('0x2c')]){if(this['channel']===_0x8e52('0xe')){var _0x20c09e={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x8e52('0x2d')]['service']){_0x20c09e['service']=this[_0x8e52('0x28')][_0x8e52('0x2d')][_0x8e52('0x2e')];}else{_0x20c09e['host']=this[_0x8e52('0x28')][_0x8e52('0x2d')][_0x8e52('0x2f')];_0x20c09e[_0x8e52('0x30')]=this[_0x8e52('0x28')]['Smtp']['port'];_0x20c09e[_0x8e52('0x31')]=this[_0x8e52('0x28')][_0x8e52('0x2d')]['secure'];}if(this['account'][_0x8e52('0x2d')]['authentication']){_0x20c09e[_0x8e52('0x32')]={'user':this[_0x8e52('0x28')]['Smtp'][_0x8e52('0x33')],'pass':this[_0x8e52('0x28')][_0x8e52('0x2d')][_0x8e52('0x34')]};}_0xa1dcc2[_0x8e52('0x35')]=this[_0x8e52('0x1f')][_0x8e52('0x36')];_0xa1dcc2[_0x8e52('0x37')]=_0x8e52('0x38')+_[_0x8e52('0x39')](_0xa1dcc2['body'],_0x8e52('0x3a'),_0x8e52('0x3b'))+_0x8e52('0x3c');_0xa1dcc2[_0x8e52('0x3d')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':'auto_reply'};return mailRpc[_0x8e52('0x3e')](_0x20c09e,_0xa1dcc2)[_0x8e52('0x3f')](function(_0xfe4fc0){logger[_0x8e52('0x11')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x38bfa0);_0xa1dcc2[_0x8e52('0x36')]=_0xfe4fc0[_0x8e52('0x1f')]['messageId'];return rpc[_0x4709ee+'Message'][_0x8e52('0x40')](_0xa1dcc2);})[_0x8e52('0x3f')](function(_0x44078c){logger['info'](_0x8e52('0x12'),_0x38bfa0,JSON[_0x8e52('0x41')](_0x44078c));})['catch'](function(_0x398cc7){logger['error'](_0x8e52('0x42'),_0x38bfa0,JSON[_0x8e52('0x41')](_0x398cc7));})[_0x8e52('0x43')](function(){Promise[_0x8e52('0x44')]()[_0x8e52('0x3f')](function(){if(_0x48d25a[0x0]!=='2'||_0x36b8dd['autoreplyExecuted'])return;return rpc[_0x4709ee+_0x8e52('0x45')][_0x8e52('0x46')](_0x36b8dd['id'],{'autoreplyExecuted':!![]})[_0x8e52('0x3f')](function(_0x26ea63){logger['info'](_0x8e52('0x17'),_0x38bfa0,JSON[_0x8e52('0x41')](_0x26ea63));})[_0x8e52('0x47')](function(_0x1494e5){logger[_0x8e52('0x48')](_0x8e52('0x49'),_0x38bfa0,JSON[_0x8e52('0x41')](_0x1494e5));});})[_0x8e52('0x3f')](function(){_0x319f03['next']();});});}else{return rpc[this[_0x8e52('0x1d')]+_0x8e52('0x2c')][_0x8e52('0x40')](_0xa1dcc2)[_0x8e52('0x3f')](function(_0x5319dd){logger['info'](_0x8e52('0x12'),_0x38bfa0,_0xa1dcc2[_0x8e52('0xf')]);})['catch'](function(_0x564fb0){logger['error'](_0x8e52('0x12'),_0x38bfa0,JSON[_0x8e52('0x41')](_0x564fb0));})['finally'](function(){Promise[_0x8e52('0x44')]()[_0x8e52('0x3f')](function(){if(_0x48d25a[0x0]!=='2'||_0x36b8dd[_0x8e52('0x4a')])return;return rpc[_0x4709ee+'Interaction'][_0x8e52('0x46')](_0x36b8dd['id'],{'autoreplyExecuted':!![]})[_0x8e52('0x3f')](function(_0x188ecc){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x38bfa0,JSON[_0x8e52('0x41')](_0x188ecc));})[_0x8e52('0x47')](function(_0x2e3204){logger[_0x8e52('0x48')](_0x8e52('0x49'),_0x38bfa0,JSON[_0x8e52('0x41')](_0x2e3204));});})[_0x8e52('0x3f')](function(){_0x319f03[_0x8e52('0x13')]();});});}}}catch(_0x38e54f){logger[_0x8e52('0x48')](_0x8e52('0x12'),_0x38bfa0,JSON[_0x8e52('0x41')](_0x38e54f));_0x319f03[_0x8e52('0x4b')]();}};}; \ No newline at end of file +var _0xb76e=['service','port','secure','user','pass','html','replace','','headers','auto-replied','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','resolve','stop','lodash','moment','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp'];(function(_0x4913f1,_0x2564ac){var _0x45710f=function(_0x441312){while(--_0x441312){_0x4913f1['push'](_0x4913f1['shift']());}};_0x45710f(++_0x2564ac);}(_0xb76e,0x137));var _0xeb76=function(_0x4c7e3f,_0xe430d6){_0x4c7e3f=_0x4c7e3f-0x0;var _0x252e30=_0xb76e[_0x4c7e3f];return _0x252e30;};'use strict';var _=require(_0xeb76('0x0'));var moment=require(_0xeb76('0x1'));var utils=require('./utils');var logger=require(_0xeb76('0x2'))(_0xeb76('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xeb76('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xeb76('0x5')),'faxMessage':require(_0xeb76('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xeb76('0x7')),'openchannelInteraction':require(_0xeb76('0x8')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xeb76('0x9'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x532215,_0x488ce2,_0x47c5db,_0x43159){return function(_0x53e5d7){try{var _0x1eee75=this[_0xeb76('0xa')];if(_0x1eee75===_0xeb76('0xb')&&_0x43159[_0xeb76('0xc')][_0xeb76('0xd')]){logger['info'](_0xeb76('0xe'),_0x532215,_0xeb76('0xf'));return _0x53e5d7[_0xeb76('0x10')]();}if(_0x488ce2[0x0]==='1'&&(_[_0xeb76('0x11')](this[_0xeb76('0x12')][_0xeb76('0x13')])||!this[_0xeb76('0x12')]['created'])){logger[_0xeb76('0x14')](_0xeb76('0xe'),_0x532215,_0xeb76('0x15'));return _0x53e5d7[_0xeb76('0x10')]();}if(_0x488ce2[0x0]==='2'&&this[_0xeb76('0x12')][_0xeb76('0x16')]){logger[_0xeb76('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x532215,_0xeb76('0x17'));return _0x53e5d7[_0xeb76('0x10')]();}var _0x41b5b5={'ContactId':this[_0xeb76('0x18')]['id'],'sentAt':moment()[_0xeb76('0x19')](_0xeb76('0x1a')),'direction':_0xeb76('0x1b')};if(this[_0xeb76('0xa')]===_0xeb76('0xb')){_0x41b5b5[_0xeb76('0xc')]=utils[_0xeb76('0x1c')](_0x488ce2[0x2],this);}else{_0x41b5b5[_0xeb76('0xc')]=utils[_0xeb76('0x1c')](_0x488ce2[0x1],this);}if(this[_0xeb76('0x1d')]){_0x41b5b5['to']=this[_0xeb76('0x1d')][_0xeb76('0x1e')]||'';if(this[_0xeb76('0xa')]==='mail'&&_0x488ce2[0x1]==='1'){_0x41b5b5['cc']=this[_0xeb76('0x1d')]['cc']||'';}_0x41b5b5[_0xeb76('0x1e')]=this['message']['to']||'';_0x41b5b5['phone']=this['message'][_0xeb76('0x1f')]||'';_0x41b5b5[_0xeb76('0x20')]=!![];if(this[_0xeb76('0x1d')][_0xeb76('0x21')]){_0x41b5b5[_0xeb76('0x21')]='';_0x41b5b5[_0xeb76('0x21')]+=_[_0xeb76('0x22')](this[_0xeb76('0x1d')]['subject'],'Re:')?'':_0xeb76('0x23');_0x41b5b5[_0xeb76('0x21')]+=this[_0xeb76('0x1d')][_0xeb76('0x21')];}}if(this[_0xeb76('0xa')]===_0xeb76('0x24')){_0x41b5b5[_0xeb76('0x25')]=this[_0xeb76('0x26')]['id'];}else{_0x41b5b5[_[_0xeb76('0x27')](this[_0xeb76('0xa')])+_0xeb76('0x28')]=this[_0xeb76('0x26')]['id'];}_0x41b5b5[_[_0xeb76('0x27')](this[_0xeb76('0xa')])+_0xeb76('0x29')]=this[_0xeb76('0x12')]['id'];var _0x2615b1=this[_0xeb76('0x12')];if(rpc[this[_0xeb76('0xa')]+_0xeb76('0x2a')]){if(this[_0xeb76('0xa')]===_0xeb76('0xb')){var _0x291bcf={'tls':{'rejectUnauthorized':![]}};if(this[_0xeb76('0x26')][_0xeb76('0x2b')][_0xeb76('0x2c')]){_0x291bcf[_0xeb76('0x2c')]=this[_0xeb76('0x26')]['Smtp'][_0xeb76('0x2c')];}else{_0x291bcf['host']=this[_0xeb76('0x26')][_0xeb76('0x2b')]['host'];_0x291bcf[_0xeb76('0x2d')]=this[_0xeb76('0x26')][_0xeb76('0x2b')][_0xeb76('0x2d')];_0x291bcf[_0xeb76('0x2e')]=this['account'][_0xeb76('0x2b')][_0xeb76('0x2e')];}if(this[_0xeb76('0x26')][_0xeb76('0x2b')]['authentication']){_0x291bcf['auth']={'user':this[_0xeb76('0x26')][_0xeb76('0x2b')][_0xeb76('0x2f')],'pass':this[_0xeb76('0x26')]['Smtp'][_0xeb76('0x30')]};}_0x41b5b5['inReplyTo']=this['message']['messageId'];_0x41b5b5[_0xeb76('0x31')]=''+_[_0xeb76('0x32')](_0x41b5b5[_0xeb76('0xc')],_0xeb76('0x33'),']+(>|$)/g,''),'priorityTrue':_0xe6a37f[0x1],'priorityFalse':_0xe6a37f[0x2]};var _0x370860=gotoif['validate'](_0x3f50e9,{'typecast':!![]});if(_0x370860[_0x0192('0xd')]){logger[_0x0192('0xe')](_0x0192('0xf'),_0x2ac192,_[_0x0192('0x10')](_0x370860,_0x0192('0x11'))[_0x0192('0x12')](',\x20'));_0x12afa1[_0x0192('0x13')]();}else{try{var _0x2ef6b8=eval('('+_0x3f50e9[_0x0192('0x14')]+')');var _0x19e9f8=_0x2ef6b8?_0x3f50e9[_0x0192('0x15')]:_0x3f50e9[_0x0192('0x16')];logger[_0x0192('0x17')](_0x0192('0x18'),_0x2ac192,_0x3f50e9[_0x0192('0x14')],_0x2ef6b8,_0x19e9f8||_0x0192('0x19'));if(_0x19e9f8){var _0x339de5=_[_0x0192('0x1a')](_0x12afa1[_0x0192('0x1b')](),{'p':_0x19e9f8});if(_0x339de5>=0x0){logger[_0x0192('0x17')](_0x0192('0x1c'),_0x2ac192,_0x19e9f8||_0x0192('0x19'),_0x339de5);_0x12afa1['next'](_0x339de5);}else{logger[_0x0192('0x17')](_0x0192('0x1d'),_0x2ac192,_0x19e9f8||_0x0192('0x19'));_0x12afa1[_0x0192('0x13')]();}}else{_0x12afa1[_0x0192('0x19')]();}}catch(_0x588b69){logger[_0x0192('0xe')](_0x0192('0x1e'),_0x2ac192,_0x588b69['message']);_0x12afa1['stop']();}}}catch(_0xecbdf7){logger[_0x0192('0xe')](_0x0192('0xf'),_0x2ac192,JSON[_0x0192('0x1f')](_0xecbdf7));_0x12afa1[_0x0192('0x13')]();}};}; \ No newline at end of file +var _0x05fb=['number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','error','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x05fb,0x19c));var _0xb05f=function(_0x59357a,_0x59443f){_0x59357a=_0x59357a-0x0;var _0x28c05e=_0x05fb[_0x59357a];return _0x28c05e;};'use strict';var schema=require(_0xb05f('0x0'));var _=require(_0xb05f('0x1'));var htmlToText=require(_0xb05f('0x2'));var utils=require(_0xb05f('0x3'));var logger=require(_0xb05f('0x4'))(_0xb05f('0x5'));var gotoif=schema({'condition':{'type':_0xb05f('0x6'),'required':!![],'message':_0xb05f('0x7')},'priorityTrue':{'type':_0xb05f('0x8'),'message':_0xb05f('0x9')},'priorityFalse':{'type':_0xb05f('0x8'),'message':_0xb05f('0xa')}});exports[_0xb05f('0xb')]=function(_0x8c0350,_0x40c6b8){return function(_0x250dc){try{var _0x4d59cf={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x40c6b8[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x40c6b8[0x1],'priorityFalse':_0x40c6b8[0x2]};var _0x220068=gotoif['validate'](_0x4d59cf,{'typecast':!![]});if(_0x220068['length']){logger[_0xb05f('0xc')]('[%s][GOTOIF]\x20%s',_0x8c0350,_[_0xb05f('0xd')](_0x220068,_0xb05f('0xe'))[_0xb05f('0xf')](',\x20'));_0x250dc[_0xb05f('0x10')]();}else{try{var _0x289b65=eval('('+_0x4d59cf[_0xb05f('0x11')]+')');var _0x16fa3e=_0x289b65?_0x4d59cf[_0xb05f('0x12')]:_0x4d59cf[_0xb05f('0x13')];logger[_0xb05f('0x14')](_0xb05f('0x15'),_0x8c0350,_0x4d59cf[_0xb05f('0x11')],_0x289b65,_0x16fa3e||_0xb05f('0x16'));if(_0x16fa3e){var _0x144ead=_[_0xb05f('0x17')](_0x250dc[_0xb05f('0x18')](),{'p':_0x16fa3e});if(_0x144ead>=0x0){logger[_0xb05f('0x14')](_0xb05f('0x19'),_0x8c0350,_0x16fa3e||'next',_0x144ead);_0x250dc['next'](_0x144ead);}else{logger[_0xb05f('0x14')](_0xb05f('0x1a'),_0x8c0350,_0x16fa3e||'next');_0x250dc[_0xb05f('0x10')]();}}else{_0x250dc[_0xb05f('0x16')]();}}catch(_0x42af3e){logger['error'](_0xb05f('0x1b'),_0x8c0350,_0x42af3e[_0xb05f('0xe')]);_0x250dc['stop']();}}}catch(_0xec2076){logger['error'](_0xb05f('0x1c'),_0x8c0350,JSON[_0xb05f('0x1d')](_0xec2076));_0x250dc['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 3c5b86e..2870d97 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 _0xf4e2=['stringify','validate','lodash','../../../../config/logger','routing','consequence','length','error','[%s][GOTOP]\x20%s','map','join','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'];(function(_0x214302,_0x5b792c){var _0xff4fb4=function(_0x35bcec){while(--_0x35bcec){_0x214302['push'](_0x214302['shift']());}};_0xff4fb4(++_0x5b792c);}(_0xf4e2,0x1cd));var _0x2f4e=function(_0x4b0a5a,_0x49f7ab){_0x4b0a5a=_0x4b0a5a-0x0;var _0x12d259=_0xf4e2[_0x4b0a5a];return _0x12d259;};'use strict';var schema=require(_0x2f4e('0x0'));var _=require(_0x2f4e('0x1'));var logger=require(_0x2f4e('0x2'))(_0x2f4e('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x2f4e('0x4')]=function(_0x14fbce,_0x2085f5){return function(_0x3213eb){try{var _0x40491f={'priority':_0x2085f5[0x0]};var _0x2f14ec=gotop[_0x2f4e('0x0')](_0x40491f,{'typecast':!![]});if(_0x2f14ec[_0x2f4e('0x5')]){logger[_0x2f4e('0x6')](_0x2f4e('0x7'),_0x14fbce,_[_0x2f4e('0x8')](_0x2f14ec,'message')[_0x2f4e('0x9')](',\x20'));_0x3213eb[_0x2f4e('0xa')]();}else{logger[_0x2f4e('0xb')](_0x2f4e('0xc'),_0x14fbce,_0x40491f[_0x2f4e('0xd')]);if(_0x40491f[_0x2f4e('0xd')]){var _0x3b0a69=_[_0x2f4e('0xe')](_0x3213eb[_0x2f4e('0xf')](),{'p':_0x40491f[_0x2f4e('0xd')]});if(_0x3b0a69>=0x0){logger[_0x2f4e('0xb')](_0x2f4e('0x10'),_0x14fbce,_0x40491f[_0x2f4e('0xd')]||_0x2f4e('0x11'),_0x3b0a69);_0x3213eb[_0x2f4e('0x11')](_0x3b0a69);}else{logger[_0x2f4e('0xb')](_0x2f4e('0x12'),_0x14fbce,_0x40491f[_0x2f4e('0xd')]||_0x2f4e('0x11'));_0x3213eb['stop']();}}else{_0x3213eb[_0x2f4e('0x11')]();}}}catch(_0x57cc75){logger[_0x2f4e('0x6')](_0x2f4e('0x7'),_0x14fbce,JSON[_0x2f4e('0x13')](_0x57cc75));_0x3213eb[_0x2f4e('0xa')]();}};}; \ No newline at end of file +var _0x7052=['consequence','validate','length','[%s][GOTOP]\x20%s','join','stop','info','rules','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','lodash','../../../../config/logger','routing'];(function(_0x1806a9,_0x5a85ba){var _0x260ef1=function(_0x3e3f1a){while(--_0x3e3f1a){_0x1806a9['push'](_0x1806a9['shift']());}};_0x260ef1(++_0x5a85ba);}(_0x7052,0xbd));var _0x2705=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0x7052[_0x296897];return _0x2b44ab;};'use strict';var schema=require('validate');var _=require(_0x2705('0x0'));var logger=require(_0x2705('0x1'))(_0x2705('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x2705('0x3')]=function(_0xac66c5,_0x4475ad){return function(_0x2ea301){try{var _0x490147={'priority':_0x4475ad[0x0]};var _0x4cf781=gotop[_0x2705('0x4')](_0x490147,{'typecast':!![]});if(_0x4cf781[_0x2705('0x5')]){logger['error'](_0x2705('0x6'),_0xac66c5,_['map'](_0x4cf781,'message')[_0x2705('0x7')](',\x20'));_0x2ea301[_0x2705('0x8')]();}else{logger[_0x2705('0x9')]('[%s][GOTOP]\x20priority\x20%s',_0xac66c5,_0x490147['priority']);if(_0x490147['priority']){var _0x5d08da=_['findIndex'](_0x2ea301[_0x2705('0xa')](),{'p':_0x490147[_0x2705('0xb')]});if(_0x5d08da>=0x0){logger[_0x2705('0x9')](_0x2705('0xc'),_0xac66c5,_0x490147[_0x2705('0xb')]||_0x2705('0xd'),_0x5d08da);_0x2ea301[_0x2705('0xd')](_0x5d08da);}else{logger[_0x2705('0x9')](_0x2705('0xe'),_0xac66c5,_0x490147[_0x2705('0xb')]||_0x2705('0xd'));_0x2ea301['stop']();}}else{_0x2ea301['next']();}}}catch(_0x4aa899){logger[_0x2705('0xf')](_0x2705('0x6'),_0xac66c5,JSON['stringify'](_0x4aa899));_0x2ea301['stop']();}};}; \ 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 31b0271..7bdcfc8 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 _0x2afc=['getMustacheRender','account','channel','AccountId','upperFirst','InteractionId','Message','create','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence'];(function(_0x11e67e,_0x42b245){var _0x6cd208=function(_0x1f91d1){while(--_0x1f91d1){_0x11e67e['push'](_0x11e67e['shift']());}};_0x6cd208(++_0x42b245);}(_0x2afc,0x87));var _0xc2af=function(_0x2cea58,_0x153c15){_0x2cea58=_0x2cea58-0x0;var _0x192933=_0x2afc[_0x2cea58];return _0x192933;};'use strict';var _=require(_0xc2af('0x0'));var utils=require(_0xc2af('0x1'));var logger=require(_0xc2af('0x2'))('routing');var rpc={'chatMessage':require(_0xc2af('0x3')),'openchannelMessage':require(_0xc2af('0x4')),'mailMessage':require(_0xc2af('0x5')),'smsMessage':require(_0xc2af('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xc2af('0x7'))};exports[_0xc2af('0x8')]=function(_0x5b32bd,_0xf91913){return function(_0x427e4b){try{var _0x4d1fa4={'body':utils[_0xc2af('0x9')](_0xf91913[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x4d1fa4['ChatWebsiteId']=this[_0xc2af('0xa')]['id'];}else{_0x4d1fa4[_['upperFirst'](this[_0xc2af('0xb')])+_0xc2af('0xc')]=this['account']['id'];}_0x4d1fa4[_[_0xc2af('0xd')](this[_0xc2af('0xb')])+_0xc2af('0xe')]=this['interaction']['id'];if(rpc[this[_0xc2af('0xb')]+'Message']){return rpc[this[_0xc2af('0xb')]+_0xc2af('0xf')][_0xc2af('0x10')](_0x4d1fa4)['then'](function(_0x14faa0){logger[_0xc2af('0x11')](_0xc2af('0x12'),_0x5b32bd,_0x4d1fa4['body']);_0x427e4b[_0xc2af('0x13')]();})[_0xc2af('0x14')](function(_0x1d0a39){logger[_0xc2af('0x15')](_0xc2af('0x12'),_0x5b32bd,JSON[_0xc2af('0x16')](_0x1d0a39));_0x427e4b[_0xc2af('0x17')]();});}}catch(_0x2f16fc){logger[_0xc2af('0x15')](_0xc2af('0x12'),_0x5b32bd,JSON['stringify'](_0x2f16fc));_0x427e4b[_0xc2af('0x17')]();}};}; \ No newline at end of file +var _0x1356=['[%s][MESSAGE]\x20%s','catch','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','upperFirst','interaction','Message','create','then','info'];(function(_0x4ee604,_0x2b2176){var _0x54d338=function(_0x31c15a){while(--_0x31c15a){_0x4ee604['push'](_0x4ee604['shift']());}};_0x54d338(++_0x2b2176);}(_0x1356,0x10d));var _0x6135=function(_0x6ef6fb,_0x5f4b1c){_0x6ef6fb=_0x6ef6fb-0x0;var _0x5cd62b=_0x1356[_0x6ef6fb];return _0x5cd62b;};'use strict';var _=require(_0x6135('0x0'));var utils=require(_0x6135('0x1'));var logger=require(_0x6135('0x2'))(_0x6135('0x3'));var rpc={'chatMessage':require(_0x6135('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6135('0x5')),'smsMessage':require(_0x6135('0x6')),'faxMessage':require(_0x6135('0x7')),'whatsappMessage':require(_0x6135('0x8'))};exports['consequence']=function(_0x3b0bb4,_0x221eaa){return function(_0x405784){try{var _0x1cbd22={'body':utils[_0x6135('0x9')](_0x221eaa[0x0],this),'ContactId':this[_0x6135('0xa')]['id']};if(this[_0x6135('0xb')]===_0x6135('0xc')){_0x1cbd22['ChatWebsiteId']=this['account']['id'];}else{_0x1cbd22[_['upperFirst'](this[_0x6135('0xb')])+'AccountId']=this['account']['id'];}_0x1cbd22[_[_0x6135('0xd')](this[_0x6135('0xb')])+'InteractionId']=this[_0x6135('0xe')]['id'];if(rpc[this[_0x6135('0xb')]+_0x6135('0xf')]){return rpc[this[_0x6135('0xb')]+_0x6135('0xf')][_0x6135('0x10')](_0x1cbd22)[_0x6135('0x11')](function(_0x111a53){logger[_0x6135('0x12')](_0x6135('0x13'),_0x3b0bb4,_0x1cbd22['body']);_0x405784['next']();})[_0x6135('0x14')](function(_0x2ed091){logger['error']('[%s][MESSAGE]\x20%s',_0x3b0bb4,JSON[_0x6135('0x15')](_0x2ed091));_0x405784[_0x6135('0x16')]();});}}catch(_0x4dae6f){logger[_0x6135('0x17')](_0x6135('0x13'),_0x3b0bb4,JSON[_0x6135('0x15')](_0x4dae6f));_0x405784[_0x6135('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 7e86756..086303b 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 _0x1abe=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','../../../../config/logger'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x1abe,0x1db));var _0xe1ab=function(_0x174010,_0x55a4a3){_0x174010=_0x174010-0x0;var _0xc38013=_0x1abe[_0x174010];return _0xc38013;};'use strict';var utils=require('./utils');var logger=require(_0xe1ab('0x0'))('routing');exports['consequence']=function(_0x34709e,_0x436f86){return function(_0x42e54e){try{logger['info'](_0xe1ab('0x1'),_0x34709e,utils[_0xe1ab('0x2')](_0x436f86[0x0],this));_0x42e54e[_0xe1ab('0x3')]();}catch(_0x3f6507){logger[_0xe1ab('0x4')]('[%s][NOOP]\x20%s',_0x34709e,JSON[_0xe1ab('0x5')](_0x3f6507));_0x42e54e[_0xe1ab('0x6')]();}};}; \ No newline at end of file +var _0x87d2=['getMustacheRender','next','error','stringify','stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x10cc81,_0x172700){var _0x3bbe1e=function(_0x319ed2){while(--_0x319ed2){_0x10cc81['push'](_0x10cc81['shift']());}};_0x3bbe1e(++_0x172700);}(_0x87d2,0x163));var _0x287d=function(_0x73f54a,_0x1a7b6e){_0x73f54a=_0x73f54a-0x0;var _0x7c93be=_0x87d2[_0x73f54a];return _0x7c93be;};'use strict';var utils=require('./utils');var logger=require(_0x287d('0x0'))(_0x287d('0x1'));exports[_0x287d('0x2')]=function(_0x1dd164,_0x405b44){return function(_0x4e1ba5){try{logger[_0x287d('0x3')](_0x287d('0x4'),_0x1dd164,utils[_0x287d('0x5')](_0x405b44[0x0],this));_0x4e1ba5[_0x287d('0x6')]();}catch(_0x634ca2){logger[_0x287d('0x7')](_0x287d('0x4'),_0x1dd164,JSON[_0x287d('0x8')](_0x634ca2));_0x4e1ba5[_0x287d('0x9')]();}};}; \ 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 9ce7b36..39b6b23 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 _0x7d36=['length','[%s][QUEUE]\x20%s','map','stop','createQueue','atimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','validate'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7d36,0x14c));var _0x67d3=function(_0x496138,_0x12d8ca){_0x496138=_0x496138-0x0;var _0x16774e=_0x7d36[_0x496138];return _0x16774e;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x67d3('0x0'));var seqqueue=require('seq-queue');var moment=require(_0x67d3('0x1'));var Redis=require(_0x67d3('0x2'));var config=require(_0x67d3('0x3'));var logger=require(_0x67d3('0x4'))(_0x67d3('0x5'));var strategy=require(_0x67d3('0x6'));config[_0x67d3('0x7')]=_[_0x67d3('0x8')](config['redis'],{'host':_0x67d3('0x9'),'port':0x18eb});var io=require(_0x67d3('0xa'))(new Redis(config[_0x67d3('0x7')]));var attributes=['id',_0x67d3('0xb'),_0x67d3('0xc'),_0x67d3('0xd'),_0x67d3('0xe'),_0x67d3('0xf')];function emit(_0x585cf7,_0x284ac3,_0x1d55d2){io['to'](_0x585cf7)[_0x67d3('0x10')](_0x284ac3,_0x1d55d2);}function emitChannelQueueInteraction(_0x4754e5,_0xb7d62,_0x172bfc,_0x5f524d,_0x3e403d,_0x19f97a,_0xd39f06,_0xd5fd22){var _0x316f69=_[_0x67d3('0x11')](_0x172bfc);_0x316f69[_0x67d3('0xb')]=_0xd5fd22;_0x316f69[_0x67d3('0xd')]=_0xb7d62;_0x316f69[_0x67d3('0xc')]=_0x5f524d;_0x316f69['id']=_0x3e403d;if(_0x19f97a){_0xd39f06[util[_0x67d3('0x12')](_0x67d3('0x13'),_0x4754e5)][_0x3e403d]=_[_0x67d3('0x14')](_0x316f69,attributes);}else{delete _0xd39f06[util[_0x67d3('0x12')](_0x67d3('0x13'),_0x4754e5)][_0x3e403d];}emit(util['format'](_0x67d3('0x15'),_0x4754e5,_0xb7d62),util[_0x67d3('0x12')](_0x67d3('0x16'),_0x4754e5,_0x19f97a?_0x67d3('0x17'):_0x67d3('0x18')),_['pick'](_0x316f69,attributes));}var rpc={'openchannelQueueReport':require(_0x67d3('0x19')),'mailQueueReport':require(_0x67d3('0x1a')),'chatQueueReport':require(_0x67d3('0x1b')),'smsQueueReport':require(_0x67d3('0x1c')),'faxQueueReport':require(_0x67d3('0x1d')),'whatsappQueueReport':require(_0x67d3('0x1e'))};var queue=schema({'name':{'type':_0x67d3('0x1f'),'required':!![],'message':_0x67d3('0x20')},'timeout':{'type':_0x67d3('0x21'),'message':_0x67d3('0x22')}});function startRouting(_0x90c27b,_0x53d813,_0x4e5685,_0x30f3ff){if(_0x90c27b&&_0x53d813&&_0x4e5685){_0x53d813[_0x67d3('0x23')]+=0x1;var _0x1a30ec={'uniqueid':_0x90c27b,'from':_0x4e5685[_0x67d3('0x24')]?_0x4e5685[_0x67d3('0x24')][_0x67d3('0xe')]:'','joinAt':moment()[_0x67d3('0x12')](_0x67d3('0x25')),'ContactId':_0x4e5685['contact']?_0x4e5685[_0x67d3('0x26')]['id']:null,'ListId':_0x4e5685['list']?_0x4e5685[_0x67d3('0x27')]['id']:null};_0x1a30ec[_['upperFirst'](_0x4e5685[_0x67d3('0x28')])+_0x67d3('0x29')]=_0x53d813['id']||null;_0x1a30ec[_[_0x67d3('0x2a')](_0x4e5685[_0x67d3('0x28')])+_0x67d3('0x2b')]=_0x4e5685[_0x67d3('0x2c')]?_0x4e5685[_0x67d3('0x2c')]['id']:null;_0x1a30ec[_[_0x67d3('0x2a')](_0x4e5685[_0x67d3('0x28')])+'MessageId']=_0x4e5685[_0x67d3('0x2d')]?_0x4e5685[_0x67d3('0x2d')]['id']:null;_0x1a30ec[_[_0x67d3('0x2a')](_0x4e5685[_0x67d3('0x28')])+(_0x4e5685[_0x67d3('0x28')]!==_0x67d3('0x2e')?_0x67d3('0x2f'):_0x67d3('0x30'))]=_0x4e5685[_0x67d3('0xc')]?_0x4e5685['account']['id']:null;logger[_0x67d3('0x31')](util['format'](_0x67d3('0x32'),_0x90c27b,_0x53d813[_0x67d3('0x33')]));emitChannelQueueInteraction(_0x4e5685[_0x67d3('0x28')],_0x53d813['name'],_0x1a30ec,_0x4e5685[_0x67d3('0xc')]['name'],_0x4e5685[_0x67d3('0x2d')]['id'],!![],_0x30f3ff,_0x53d813['id']);if(rpc[_0x4e5685[_0x67d3('0x28')]+_0x67d3('0x34')]){return rpc[_0x4e5685['channel']+_0x67d3('0x34')][_0x67d3('0x35')](_0x1a30ec)[_0x67d3('0x36')](function(_0x5be218){logger[_0x67d3('0x37')]('create\x20queue\x20report');});}}}function stopRouting(_0x31e441,_0xdce7d7,_0x32eb8d,_0xf0ccf){if(_0x31e441&&_0xdce7d7){_0xdce7d7[_0x67d3('0x23')]-=0x1;var _0x5cd2da={'leaveAt':moment()[_0x67d3('0x12')](_0x67d3('0x25')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x67d3('0x31')](util[_0x67d3('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x31e441,_0xdce7d7['name']));emitChannelQueueInteraction(_0x32eb8d['channel'],_0xdce7d7[_0x67d3('0x33')],_0x32eb8d[_0x67d3('0x24')],_0x32eb8d[_0x67d3('0xc')]['name'],_0x32eb8d['message']['id'],![],_0xf0ccf,_0xdce7d7['id']);if(rpc[_0x32eb8d[_0x67d3('0x28')]+_0x67d3('0x34')]){return rpc[_0x32eb8d[_0x67d3('0x28')]+_0x67d3('0x34')][_0x67d3('0x38')](_0x31e441,_0x5cd2da)[_0x67d3('0x36')](function(_0x2fa9dd){logger[_0x67d3('0x37')]('update\x20queue\x20report');});}}}function endRouting(_0x53d6b3,_0x2f4f07,_0x2428f8,_0x486ce5){if(_0x53d6b3&&_0x2f4f07){_0x2f4f07[_0x67d3('0x23')]-=0x1;var _0x52cb4f={'leaveAt':moment()[_0x67d3('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x67d3('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x67d3('0x39')};logger[_0x67d3('0x31')](util[_0x67d3('0x12')](_0x67d3('0x3a'),_0x53d6b3,_0x2f4f07['name']));emitChannelQueueInteraction(_0x2428f8['channel'],_0x2f4f07[_0x67d3('0x33')],_0x2428f8[_0x67d3('0x24')],_0x2428f8['account'][_0x67d3('0x33')],_0x2428f8[_0x67d3('0x2d')]['id'],![],_0x486ce5);if(rpc[_0x2428f8[_0x67d3('0x28')]+'QueueReport']){return rpc[_0x2428f8[_0x67d3('0x28')]+_0x67d3('0x34')][_0x67d3('0x38')](_0x53d6b3,_0x52cb4f)[_0x67d3('0x36')](function(_0x1ead77){logger[_0x67d3('0x37')](_0x67d3('0x3b'));});}}}function handleFindQueue(_0xb1cac0){return function(_0x2a8f8c){return _0x2a8f8c[_0x67d3('0x33')][_0x67d3('0x3c')]()===_0xb1cac0['toLowerCase']();};}exports[_0x67d3('0x3d')]=function(_0x4f65ef,_0x58f379,_0x115988,_0x20f8c4){return function(_0xb529c){try{var _0x57e2a4={'name':_0x58f379[0x0],'timeout':_0x58f379[0x1]};var _0x254c2c=queue[_0x67d3('0x3e')](_0x57e2a4,{'typecast':!![]});if(_0x254c2c[_0x67d3('0x3f')]){logger['error'](_0x67d3('0x40'),_0x4f65ef,_[_0x67d3('0x41')](_0x254c2c,_0x67d3('0x2d'))['join'](',\x20'));_0xb529c[_0x67d3('0x42')]();}else{var _0xd7b8be=_['find'](_0x115988[_0x20f8c4[_0x67d3('0x28')]+'Queues'],handleFindQueue(_0x57e2a4[_0x67d3('0x33')]));if(_0xd7b8be){startRouting(_0x4f65ef,_0xd7b8be,_0x20f8c4,_0x115988);var _0xa209be=(_0xd7b8be['timeout']||0xa)*0x3e8;var _0x299088=(_0x57e2a4[_0x67d3('0x39')]||0x14)*0x3e8;var _0x5d6894,_0x5277dd;if(_0xa209be>_0x299088){_0x299088=_0xa209be;}var _0x65d443=seqqueue[_0x67d3('0x43')](_0xa209be);_0x65d443['id']=_0x4f65ef;_0x65d443[_0x67d3('0x44')]=_0xa209be;_0x65d443['qtimeout']=_0x299088;_0x65d443[_0x67d3('0x28')]=_0x20f8c4[_0x67d3('0x28')];_0x115988[_0x67d3('0x45')][_0x4f65ef]['on'](_0x67d3('0x46'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4f65ef);stopRouting(_0x4f65ef,_0xd7b8be,_0x20f8c4,_0x115988);clearTimeout(_0x5d6894);_0x5d6894=undefined;_0x65d443[_0x67d3('0x47')](!![]);if(_0x115988[_0x67d3('0x45')][_0x4f65ef]){delete _0x115988[_0x67d3('0x45')][_0x4f65ef];}_0xb529c[_0x67d3('0x42')]();});_0x115988['rules'][_0x4f65ef]['on'](_0x67d3('0x48'),function(){if(_0x115988[_0x67d3('0x45')][_0x4f65ef]){delete _0x115988['rules'][_0x4f65ef];}});_0x5d6894=setTimeout(function(){logger[_0x67d3('0x31')](_0x67d3('0x49'),_0x4f65ef);endRouting(_0x4f65ef,_0xd7b8be,_0x20f8c4,_0x115988);clearTimeout(_0x5d6894);_0x65d443[_0x67d3('0x47')](!![]);_0xb529c[_0x67d3('0x4a')]();},_0x299088);switch(_0xd7b8be[_0x67d3('0x4b')]){case _0x67d3('0x4c'):strategy['rrmemory'](_0x65d443,_0xd7b8be,_0x115988,_0x20f8c4);break;default:strategy['beepall'](_0x65d443,_0xd7b8be,_0x115988,_0x20f8c4);}}else{logger[_0x67d3('0x37')](_0x67d3('0x4d'),_0x4f65ef,_0x57e2a4[_0x67d3('0x33')]);_0xb529c[_0x67d3('0x42')]();}}}catch(_0x5059ce){console[_0x67d3('0x4e')](_0x5059ce);logger['error'](_0x67d3('0x40'),_0x4f65ef,_0x5059ce['stack']);_0xb529c[_0x67d3('0x42')]();}};}; \ No newline at end of file +var _0xfef3=['../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','catch','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','rrmemory','log','[%s][QUEUE]\x20%s','validate','util','moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport'];(function(_0x29db2d,_0x24adce){var _0x35bfc1=function(_0x31ed79){while(--_0x31ed79){_0x29db2d['push'](_0x29db2d['shift']());}};_0x35bfc1(++_0x24adce);}(_0xfef3,0x118));var _0x3fef=function(_0x4722a4,_0x1c710e){_0x4722a4=_0x4722a4-0x0;var _0x9e8608=_0xfef3[_0x4722a4];return _0x9e8608;};'use strict';var schema=require(_0x3fef('0x0'));var _=require('lodash');var util=require(_0x3fef('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x3fef('0x2'));var Redis=require(_0x3fef('0x3'));var config=require('../../../../config/environment');var logger=require(_0x3fef('0x4'))(_0x3fef('0x5'));var strategy=require('./strategy');config[_0x3fef('0x6')]=_[_0x3fef('0x7')](config['redis'],{'host':_0x3fef('0x8'),'port':0x18eb});var io=require(_0x3fef('0x9'))(new Redis(config[_0x3fef('0x6')]));var attributes=['id',_0x3fef('0xa'),_0x3fef('0xb'),_0x3fef('0xc'),_0x3fef('0xd'),_0x3fef('0xe')];function emit(_0x31c30f,_0x307586,_0x67cdd8){io['to'](_0x31c30f)[_0x3fef('0xf')](_0x307586,_0x67cdd8);}function emitChannelQueueInteraction(_0x1a7ef7,_0x7cc5b,_0x5b5a07,_0xab6df8,_0x3560d9,_0x11696d,_0x49d216,_0x1c20b3){var _0x4c4a47=_[_0x3fef('0x10')](_0x5b5a07);_0x4c4a47[_0x3fef('0xa')]=_0x1c20b3;_0x4c4a47[_0x3fef('0xc')]=_0x7cc5b;_0x4c4a47['account']=_0xab6df8;_0x4c4a47['id']=_0x3560d9;if(_0x11696d){_0x49d216[util[_0x3fef('0x11')]('%sQueuesWaitingInteractions',_0x1a7ef7)][_0x3560d9]=_[_0x3fef('0x12')](_0x4c4a47,attributes);}else{delete _0x49d216[util[_0x3fef('0x11')]('%sQueuesWaitingInteractions',_0x1a7ef7)][_0x3560d9];}emit(util[_0x3fef('0x11')](_0x3fef('0x13'),_0x1a7ef7,_0x7cc5b),util[_0x3fef('0x11')](_0x3fef('0x14'),_0x1a7ef7,_0x11696d?_0x3fef('0x15'):_0x3fef('0x16')),_['pick'](_0x4c4a47,attributes));}var rpc={'openchannelQueueReport':require(_0x3fef('0x17')),'mailQueueReport':require(_0x3fef('0x18')),'chatQueueReport':require(_0x3fef('0x19')),'smsQueueReport':require(_0x3fef('0x1a')),'faxQueueReport':require(_0x3fef('0x1b')),'whatsappQueueReport':require(_0x3fef('0x1c'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x3fef('0x1d')},'timeout':{'type':_0x3fef('0x1e'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2c7f36,_0x51a554,_0x42e095,_0x218f91){if(_0x2c7f36&&_0x51a554&&_0x42e095){_0x51a554[_0x3fef('0x1f')]+=0x1;var _0x2b5226={'uniqueid':_0x2c7f36,'from':_0x42e095[_0x3fef('0x20')]?_0x42e095[_0x3fef('0x20')][_0x3fef('0xd')]:'','joinAt':moment()[_0x3fef('0x11')](_0x3fef('0x21')),'ContactId':_0x42e095[_0x3fef('0x22')]?_0x42e095[_0x3fef('0x22')]['id']:null,'ListId':_0x42e095[_0x3fef('0x23')]?_0x42e095[_0x3fef('0x23')]['id']:null};_0x2b5226[_['upperFirst'](_0x42e095['channel'])+'QueueId']=_0x51a554['id']||null;_0x2b5226[_[_0x3fef('0x24')](_0x42e095[_0x3fef('0x25')])+_0x3fef('0x26')]=_0x42e095['interaction']?_0x42e095[_0x3fef('0x27')]['id']:null;_0x2b5226[_['upperFirst'](_0x42e095[_0x3fef('0x25')])+_0x3fef('0x28')]=_0x42e095[_0x3fef('0x29')]?_0x42e095[_0x3fef('0x29')]['id']:null;_0x2b5226[_[_0x3fef('0x24')](_0x42e095['channel'])+(_0x42e095['channel']!=='chat'?_0x3fef('0x2a'):_0x3fef('0x2b'))]=_0x42e095['account']?_0x42e095[_0x3fef('0xb')]['id']:null;logger[_0x3fef('0x2c')](util['format'](_0x3fef('0x2d'),_0x2c7f36,_0x51a554[_0x3fef('0x2e')]));emitChannelQueueInteraction(_0x42e095[_0x3fef('0x25')],_0x51a554[_0x3fef('0x2e')],_0x2b5226,_0x42e095[_0x3fef('0xb')][_0x3fef('0x2e')],_0x42e095[_0x3fef('0x29')]['id'],!![],_0x218f91,_0x51a554['id']);if(rpc[_0x42e095['channel']+_0x3fef('0x2f')]){return rpc[_0x42e095[_0x3fef('0x25')]+_0x3fef('0x2f')][_0x3fef('0x30')](_0x2b5226)['catch'](function(_0xcd635d){logger['error'](_0x3fef('0x31'));});}}}function stopRouting(_0x3c4483,_0x16009a,_0x1136b3,_0x10b803){if(_0x3c4483&&_0x16009a){_0x16009a[_0x3fef('0x1f')]-=0x1;var _0x355c03={'leaveAt':moment()[_0x3fef('0x11')](_0x3fef('0x21')),'acceptAt':moment()[_0x3fef('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x3fef('0x2c')](util['format'](_0x3fef('0x32'),_0x3c4483,_0x16009a[_0x3fef('0x2e')]));emitChannelQueueInteraction(_0x1136b3[_0x3fef('0x25')],_0x16009a[_0x3fef('0x2e')],_0x1136b3[_0x3fef('0x20')],_0x1136b3[_0x3fef('0xb')][_0x3fef('0x2e')],_0x1136b3[_0x3fef('0x29')]['id'],![],_0x10b803,_0x16009a['id']);if(rpc[_0x1136b3[_0x3fef('0x25')]+_0x3fef('0x2f')]){return rpc[_0x1136b3[_0x3fef('0x25')]+_0x3fef('0x2f')][_0x3fef('0x33')](_0x3c4483,_0x355c03)[_0x3fef('0x34')](function(_0x58d276){logger[_0x3fef('0x35')](_0x3fef('0x36'));});}}}function endRouting(_0x31669f,_0x19e935,_0x1879ec,_0x52a3c4){if(_0x31669f&&_0x19e935){_0x19e935['waiting']-=0x1;var _0x5cbea8={'leaveAt':moment()[_0x3fef('0x11')](_0x3fef('0x21')),'exitAt':moment()[_0x3fef('0x11')](_0x3fef('0x21')),'reason':_0x3fef('0x37')};logger[_0x3fef('0x2c')](util[_0x3fef('0x11')](_0x3fef('0x38'),_0x31669f,_0x19e935[_0x3fef('0x2e')]));emitChannelQueueInteraction(_0x1879ec[_0x3fef('0x25')],_0x19e935[_0x3fef('0x2e')],_0x1879ec['body'],_0x1879ec[_0x3fef('0xb')][_0x3fef('0x2e')],_0x1879ec['message']['id'],![],_0x52a3c4);if(rpc[_0x1879ec['channel']+_0x3fef('0x2f')]){return rpc[_0x1879ec[_0x3fef('0x25')]+_0x3fef('0x2f')][_0x3fef('0x33')](_0x31669f,_0x5cbea8)[_0x3fef('0x34')](function(_0x201aa3){logger[_0x3fef('0x35')](_0x3fef('0x36'));});}}}function handleFindQueue(_0x577ab8){return function(_0x107d42){return _0x107d42[_0x3fef('0x2e')][_0x3fef('0x39')]()===_0x577ab8[_0x3fef('0x39')]();};}exports[_0x3fef('0x3a')]=function(_0x2143ec,_0x545154,_0x798184,_0x3df52b){return function(_0x301f65){try{var _0x12867c={'name':_0x545154[0x0],'timeout':_0x545154[0x1]};var _0x254880=queue[_0x3fef('0x0')](_0x12867c,{'typecast':!![]});if(_0x254880[_0x3fef('0x3b')]){logger[_0x3fef('0x35')]('[%s][QUEUE]\x20%s',_0x2143ec,_[_0x3fef('0x3c')](_0x254880,_0x3fef('0x29'))[_0x3fef('0x3d')](',\x20'));_0x301f65[_0x3fef('0x3e')]();}else{var _0x1879c1=_[_0x3fef('0x3f')](_0x798184[_0x3df52b['channel']+_0x3fef('0x40')],handleFindQueue(_0x12867c['name']));if(_0x1879c1){startRouting(_0x2143ec,_0x1879c1,_0x3df52b,_0x798184);var _0x3bcb0e=(_0x1879c1[_0x3fef('0x37')]||0xa)*0x3e8;var _0x59e3b0=(_0x12867c[_0x3fef('0x37')]||0x14)*0x3e8;var _0x4e662c,_0x416a81;if(_0x3bcb0e>_0x59e3b0){_0x59e3b0=_0x3bcb0e;}var _0x29f5d3=seqqueue[_0x3fef('0x41')](_0x3bcb0e);_0x29f5d3['id']=_0x2143ec;_0x29f5d3[_0x3fef('0x42')]=_0x3bcb0e;_0x29f5d3[_0x3fef('0x43')]=_0x59e3b0;_0x29f5d3[_0x3fef('0x25')]=_0x3df52b[_0x3fef('0x25')];_0x798184[_0x3fef('0x44')][_0x2143ec]['on'](_0x3fef('0x45'),function(){logger[_0x3fef('0x2c')](_0x3fef('0x46'),_0x2143ec);stopRouting(_0x2143ec,_0x1879c1,_0x3df52b,_0x798184);clearTimeout(_0x4e662c);_0x4e662c=undefined;_0x29f5d3[_0x3fef('0x47')](!![]);if(_0x798184[_0x3fef('0x44')][_0x2143ec]){delete _0x798184['rules'][_0x2143ec];}_0x301f65[_0x3fef('0x3e')]();});_0x798184[_0x3fef('0x44')][_0x2143ec]['on']('complete',function(){if(_0x798184[_0x3fef('0x44')][_0x2143ec]){delete _0x798184[_0x3fef('0x44')][_0x2143ec];}});_0x4e662c=setTimeout(function(){logger[_0x3fef('0x2c')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x2143ec);endRouting(_0x2143ec,_0x1879c1,_0x3df52b,_0x798184);clearTimeout(_0x4e662c);_0x29f5d3[_0x3fef('0x47')](!![]);_0x301f65[_0x3fef('0x48')]();},_0x59e3b0);switch(_0x1879c1['strategy']){case _0x3fef('0x49'):strategy['rrmemory'](_0x29f5d3,_0x1879c1,_0x798184,_0x3df52b);break;default:strategy['beepall'](_0x29f5d3,_0x1879c1,_0x798184,_0x3df52b);}}else{logger[_0x3fef('0x35')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2143ec,_0x12867c[_0x3fef('0x2e')]);_0x301f65[_0x3fef('0x3e')]();}}}catch(_0x4f7b3c){console[_0x3fef('0x4a')](_0x4f7b3c);logger[_0x3fef('0x35')](_0x3fef('0x4b'),_0x2143ec,_0x4f7b3c['stack']);_0x301f65[_0x3fef('0x3e')]();}};}; \ 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 f540d7d..60d1a31 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 _0xdc09=['handleRun','bind','handleTimeout','timeout','drained','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','info','channel','busyQueue','showNotification','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','prototype','[%s][AGENT]\x20timeout\x20with\x20%s','notificationId','busy','STOP','TIMEOUT','lodash','./util','../../../../../config/logger','routing','squeue','realtime','push'];(function(_0x6c59fc,_0x5fe88d){var _0x17c96f=function(_0x5a6c82){while(--_0x5a6c82){_0x6c59fc['push'](_0x6c59fc['shift']());}};_0x17c96f(++_0x5fe88d);}(_0xdc09,0xb9));var _0x9dc0=function(_0x4ffa03,_0x363a82){_0x4ffa03=_0x4ffa03-0x0;var _0x30d661=_0xdc09[_0x4ffa03];return _0x30d661;};'use strict';var _=require(_0x9dc0('0x0'));var uuid=require('uuid');var util=require(_0x9dc0('0x1'));var logger=require(_0x9dc0('0x2'))(_0x9dc0('0x3'));var Agent=function(_0x15fc49,_0x5d8f8d,_0x461a75,_0x330dfa){this['notificationId']=uuid['v4']();this[_0x9dc0('0x4')]=_0x15fc49;this['agent']=_0x5d8f8d;this[_0x9dc0('0x5')]=_0x461a75;this[_0x9dc0('0x3')]=_0x330dfa;this[_0x9dc0('0x4')][_0x9dc0('0x6')](this[_0x9dc0('0x7')][_0x9dc0('0x8')](this),this[_0x9dc0('0x9')][_0x9dc0('0x8')](this));this[_0x9dc0('0x4')]['on'](_0x9dc0('0xa'),this['handleTimeout']['bind'](this));this[_0x9dc0('0x4')]['on'](_0x9dc0('0xb'),this['handleDrained']['bind'](this));};Agent['prototype'][_0x9dc0('0x6')]=function(){this['squeue'][_0x9dc0('0x6')](this[_0x9dc0('0x7')][_0x9dc0('0x8')](this),this['handleTimeout'][_0x9dc0('0x8')](this));};Agent['prototype'][_0x9dc0('0xc')]=function(){this[_0x9dc0('0x9')](!![]);};Agent['prototype'][_0x9dc0('0x7')]=function(_0x3cea72){logger['info'](_0x9dc0('0xd'),this[_0x9dc0('0x4')]['id'],this[_0x9dc0('0xe')]['id']);if(_[_0x9dc0('0xf')](this['realtime'][_0x9dc0('0x10')][this[_0x9dc0('0xe')]['id']])){logger[_0x9dc0('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x9dc0('0x4')]['id'],this[_0x9dc0('0xe')]['id']);setTimeout(this[_0x9dc0('0x6')]['bind'](this),0x3e8);}else{if(this[_0x9dc0('0x3')]['forcedOwnership']||util['isAgentAvailable'](this[_0x9dc0('0x4')]['id'],this[_0x9dc0('0x5')]['agents'][this[_0x9dc0('0xe')]['id']],this[_0x9dc0('0x4')][_0x9dc0('0x12')],![])){this[_0x9dc0('0x5')][_0x9dc0('0x10')][this[_0x9dc0('0xe')]['id']]['busy']=!![];this[_0x9dc0('0x5')][_0x9dc0('0x10')][this[_0x9dc0('0xe')]['id']][_0x9dc0('0x13')]=undefined;util[_0x9dc0('0x14')](this['notificationId'],this[_0x9dc0('0x4')]['id'],this[_0x9dc0('0x5')]['agents'][this[_0x9dc0('0xe')]['id']],null,this[_0x9dc0('0x3')]);util[_0x9dc0('0x15')](this[_0x9dc0('0x4')]['id'],this[_0x9dc0('0x5')][_0x9dc0('0x10')][this[_0x9dc0('0xe')]['id']],_0x9dc0('0x16')+(this[_0x9dc0('0x3')][_0x9dc0('0x17')]?_0x9dc0('0x18'):''));}else{logger['info'](_0x9dc0('0x19'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x9dc0('0x6')][_0x9dc0('0x8')](this),0x3e8);}}};Agent[_0x9dc0('0x1a')][_0x9dc0('0x9')]=function(_0x264f6d){if(_[_0x9dc0('0xf')](this[_0x9dc0('0x5')]['agents'][this[_0x9dc0('0xe')]['id']])){return logger[_0x9dc0('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x9dc0('0x4')]['id'],this[_0x9dc0('0xe')]['id']);}else{logger[_0x9dc0('0x11')](_0x9dc0('0x1b'),this[_0x9dc0('0x4')]['id'],this[_0x9dc0('0xe')]['id']);util['hideNotification'](this[_0x9dc0('0x1c')],this[_0x9dc0('0x4')]['id'],this['realtime']['agents'][this[_0x9dc0('0xe')]['id']],null,this['routing']);this[_0x9dc0('0x5')]['agents'][this[_0x9dc0('0xe')]['id']][_0x9dc0('0x1d')]=![];this[_0x9dc0('0x5')][_0x9dc0('0x10')][this[_0x9dc0('0xe')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0x9dc0('0x4')]['id'],this['realtime'][_0x9dc0('0x10')][this['agent']['id']],_0x264f6d?_0x9dc0('0x1e'):_0x9dc0('0x1f'));}if(!_0x264f6d){setTimeout(this[_0x9dc0('0x6')][_0x9dc0('0x8')](this),0x3e8);}};function agent(_0x1043a6,_0x428856,_0x4efc17,_0x58d8aa){return new Agent(_0x1043a6,_0x428856,_0x4efc17,_0x58d8aa);}module['exports']=agent; \ No newline at end of file +var _0xbb12=['writeLog','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','showNotification','notificationId','RINGING',':FORCED','info','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy'];(function(_0x3ec748,_0x645ea2){var _0x1aefd6=function(_0x1ff023){while(--_0x1ff023){_0x3ec748['push'](_0x3ec748['shift']());}};_0x1aefd6(++_0x645ea2);}(_0xbb12,0x1a7));var _0x2bb1=function(_0x93b713,_0x59d132){_0x93b713=_0x93b713-0x0;var _0x49509f=_0xbb12[_0x93b713];return _0x49509f;};'use strict';var _=require(_0x2bb1('0x0'));var uuid=require(_0x2bb1('0x1'));var util=require(_0x2bb1('0x2'));var logger=require(_0x2bb1('0x3'))(_0x2bb1('0x4'));var Agent=function(_0x290955,_0x2eb048,_0x4e1096,_0x86ade7){this['notificationId']=uuid['v4']();this[_0x2bb1('0x5')]=_0x290955;this[_0x2bb1('0x6')]=_0x2eb048;this[_0x2bb1('0x7')]=_0x4e1096;this[_0x2bb1('0x4')]=_0x86ade7;this[_0x2bb1('0x5')][_0x2bb1('0x8')](this[_0x2bb1('0x9')][_0x2bb1('0xa')](this),this[_0x2bb1('0xb')][_0x2bb1('0xa')](this));this[_0x2bb1('0x5')]['on'](_0x2bb1('0xc'),this[_0x2bb1('0xb')]['bind'](this));this['squeue']['on'](_0x2bb1('0xd'),this[_0x2bb1('0xe')][_0x2bb1('0xa')](this));};Agent[_0x2bb1('0xf')][_0x2bb1('0x8')]=function(){this[_0x2bb1('0x5')]['push'](this[_0x2bb1('0x9')][_0x2bb1('0xa')](this),this[_0x2bb1('0xb')][_0x2bb1('0xa')](this));};Agent['prototype'][_0x2bb1('0xe')]=function(){this[_0x2bb1('0xb')](!![]);};Agent[_0x2bb1('0xf')]['handleRun']=function(_0x2c6ea4){logger['info'](_0x2bb1('0x10'),this[_0x2bb1('0x5')]['id'],this['agent']['id']);if(_[_0x2bb1('0x11')](this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']])){logger['info'](_0x2bb1('0x13'),this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x6')]['id']);setTimeout(this[_0x2bb1('0x8')][_0x2bb1('0xa')](this),0x3e8);}else{if(this[_0x2bb1('0x4')][_0x2bb1('0x14')]||util[_0x2bb1('0x15')](this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x7')]['agents'][this[_0x2bb1('0x6')]['id']],this['squeue'][_0x2bb1('0x16')],![])){this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']]['busy']=!![];this['realtime'][_0x2bb1('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x2bb1('0x17')](this[_0x2bb1('0x18')],this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']],null,this[_0x2bb1('0x4')]);util['writeLog'](this['squeue']['id'],this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']],_0x2bb1('0x19')+(this['routing'][_0x2bb1('0x14')]?_0x2bb1('0x1a'):''));}else{logger[_0x2bb1('0x1b')](_0x2bb1('0x1c'),this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x6')]['id']);setTimeout(this[_0x2bb1('0x8')][_0x2bb1('0xa')](this),0x3e8);}}};Agent['prototype'][_0x2bb1('0xb')]=function(_0x3d834b){if(_[_0x2bb1('0x11')](this['realtime'][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']])){return logger[_0x2bb1('0x1b')](_0x2bb1('0x13'),this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x6')]['id']);}else{logger[_0x2bb1('0x1b')](_0x2bb1('0x1d'),this['squeue']['id'],this[_0x2bb1('0x6')]['id']);util[_0x2bb1('0x1e')](this[_0x2bb1('0x18')],this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']],null,this[_0x2bb1('0x4')]);this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']][_0x2bb1('0x1f')]=![];this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']]['busyQueue']=undefined;util[_0x2bb1('0x20')](this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x7')][_0x2bb1('0x12')][this['agent']['id']],_0x3d834b?'STOP':_0x2bb1('0x21'));}if(!_0x3d834b){setTimeout(this[_0x2bb1('0x8')][_0x2bb1('0xa')](this),0x3e8);}};function agent(_0x549137,_0x2d60dd,_0x46ff18,_0x58f32a){return new Agent(_0x549137,_0x2d60dd,_0x46ff18,_0x58f32a);}module[_0x2bb1('0x22')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 9fdc3a3..dea0bda 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 _0xf569=['notificationId','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','squeue','realtime','push','handleRun','handleTimeout','bind','handleDrained','prototype','isNil','queue','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification'];(function(_0x576999,_0x122d8b){var _0x21d7b2=function(_0x191b2e){while(--_0x191b2e){_0x576999['push'](_0x576999['shift']());}};_0x21d7b2(++_0x122d8b);}(_0xf569,0xd0));var _0x9f56=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xf569[_0xef8146];return _0x5a6cb0;};'use strict';var _=require('lodash');var uuid=require(_0x9f56('0x0'));var util=require(_0x9f56('0x1'));var logger=require(_0x9f56('0x2'))(_0x9f56('0x3'));var Beepall=function(_0x45b196,_0x4466ac,_0x4506a1,_0x6d506b){this['notificationId']=uuid['v4']();this[_0x9f56('0x4')]=_0x45b196;this['queue']=_0x4466ac;this[_0x9f56('0x5')]=_0x4506a1;this[_0x9f56('0x3')]=_0x6d506b;this['squeue'][_0x9f56('0x6')](this[_0x9f56('0x7')]['bind'](this),this[_0x9f56('0x8')][_0x9f56('0x9')](this));this[_0x9f56('0x4')]['on']('timeout',this['handleTimeout'][_0x9f56('0x9')](this));this[_0x9f56('0x4')]['on']('drained',this[_0x9f56('0xa')][_0x9f56('0x9')](this));};Beepall[_0x9f56('0xb')]['push']=function(){this['squeue'][_0x9f56('0x6')](this['handleRun'][_0x9f56('0x9')](this),this['handleTimeout']['bind'](this));};Beepall[_0x9f56('0xb')][_0x9f56('0xa')]=function(_0x5af8ab){this[_0x9f56('0x8')](!![]);};Beepall[_0x9f56('0xb')][_0x9f56('0x7')]=function(_0x1277b3){var _0x1c572f=!![];if(!_[_0x9f56('0xc')](this[_0x9f56('0xd')])&&!_[_0x9f56('0xc')](this[_0x9f56('0xd')][_0x9f56('0xe')])&&this[_0x9f56('0xd')][_0x9f56('0xe')][_0x9f56('0xf')]>0x0){for(var _0x9c39ec=0x0,_0x131130;_0x9c39ec0x0){for(var _0x369f2f=0x0,_0x4a8323;_0x369f2f0x0&&_0x1e512d[_0x219be1+_0x5474('0x26')]>=_0x1e512d[_0x219be1+'Capacity']){writeLog(_0xe4850d,_0x1e512d,_0x219be1[_0x5474('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x5474('0x28')]=function(_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a){return sendNotification(!![],_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a);};exports['hideNotification']=function(_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb){return sendNotification(![],_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x4745=['../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','format','user:%s','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','online','OFFLINE','Pause','hasOwnProperty','CurrentCapacity','toUpperCase','showNotification','lodash','util','../utils','mustache','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4745,0x1e7));var _0x5474=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x4745[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var utils=require(_0x5474('0x2'));var Mustache=require(_0x5474('0x3'));var Redis=require(_0x5474('0x4'));var config=require(_0x5474('0x5'));var logger=require(_0x5474('0x6'))(_0x5474('0x7'));config[_0x5474('0x8')]=_[_0x5474('0x9')](config[_0x5474('0x8')],{'host':_0x5474('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5474('0x8')]));function emit(_0x431f81,_0x57add7,_0x13929f){io['to'](_0x431f81)['emit'](_0x57add7,_0x13929f);}function sendNotification(_0x902ba8,_0x3c8860,_0x4fae2b,_0xf876f8,_0x11dcb2,_0x46b4b3){io['to'](util[_0x5474('0xb')](_0x5474('0xc'),_0xf876f8[_0x5474('0xd')]))[_0x5474('0xe')](_0x5474('0xf'),_0xf876f8);var _0x48fc51=_0x46b4b3||{};var _0x38dadb=_0x4fae2b[_0x5474('0x10')]('.');var _0xdc4c23={'uniqueid':_0x3c8860,'channel':_0x38dadb[0x0],'id':_0x38dadb[0x1],'title':_0x38dadb[0x0]+_0x5474('0x11'),'interactionId':_0x38dadb[0x2],'queue':_0x11dcb2?_0x11dcb2[_0x5474('0xd')]:null,'sound':_0x48fc51[_0x5474('0x12')][_0x5474('0x13')],'shake':_0x48fc51[_0x5474('0x12')][_0x5474('0x14')]};try{if(!_0x48fc51['body']){_0x48fc51[_0x5474('0x15')]={};}if(_0x11dcb2){_0x48fc51[_0x5474('0x15')][_0x5474('0x16')]=_0x11dcb2;}else if(_0x48fc51[_0x5474('0x15')]['queue']){delete _0x48fc51['body']['queue'];}_0xdc4c23['msg']=utils[_0x5474('0x17')](_0x48fc51[_0x5474('0x12')][_0x5474('0x18')],_0x48fc51);}catch(_0x532718){_0xdc4c23[_0x5474('0x19')]=_0x5474('0x1a');logger['error'](util[_0x5474('0xb')](_0x5474('0x1b'),_0x3c8860,_0x532718[_0x5474('0x1c')]));}io['to'](util[_0x5474('0xb')](_0x5474('0xc'),_0xf876f8['name']))[_0x5474('0xe')](util['format'](_0x5474('0x1d'),_0x902ba8?_0x5474('0x1e'):'remove'),_0xdc4c23);}function writeLog(_0x504826,_0x563539,_0x1f81d6){return logger[_0x5474('0x1f')](util[_0x5474('0xb')](_0x5474('0x20'),_0x504826,_0x563539[_0x5474('0xd')],_0x1f81d6));}exports[_0x5474('0x21')]=function(_0xe4850d,_0x1e512d,_0x219be1,_0x9c80cc){if(_0x1e512d['busy']){writeLog(_0xe4850d,_0x1e512d,'BUSY');return![];}if(!_0x1e512d[_0x5474('0x22')]){writeLog(_0xe4850d,_0x1e512d,_0x5474('0x23'));return![];}if(_0x1e512d[_0x219be1+_0x5474('0x24')]){writeLog(_0xe4850d,_0x1e512d,'PAUSE');return![];}if(_0x9c80cc&&_0x1e512d[_0x5474('0x25')](_0x219be1+'Capacity')&&_0x1e512d[_0x5474('0x25')](_0x219be1+_0x5474('0x26'))){if(_0x1e512d[_0x219be1+'Capacity']>0x0&&_0x1e512d[_0x219be1+_0x5474('0x26')]>=_0x1e512d[_0x219be1+'Capacity']){writeLog(_0xe4850d,_0x1e512d,_0x219be1[_0x5474('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x5474('0x28')]=function(_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a){return sendNotification(!![],_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a);};exports['hideNotification']=function(_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb){return sendNotification(![],_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index c70a74c..92c55b4 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 _0x5686=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty'];(function(_0x1808b2,_0x35f5a6){var _0x498147=function(_0x17d30a){while(--_0x17d30a){_0x1808b2['push'](_0x1808b2['shift']());}};_0x498147(++_0x35f5a6);}(_0x5686,0xbc));var _0x6568=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x5686[_0x34843e];return _0x598f7f;};'use strict';var schema=require('validate');var sh=require(_0x6568('0x0'));var _=require(_0x6568('0x1'));var utils=require('./utils');var logger=require(_0x6568('0x2'))(_0x6568('0x3'));var system=schema({'command':{'type':_0x6568('0x4'),'required':!![],'message':_0x6568('0x5')}});exports[_0x6568('0x6')]=function(_0x282518,_0x1e8e9c){return function(_0x5c4879){try{var _0x1253a6={'command':_0x1e8e9c[0x0]};var _0x535c7b=system[_0x6568('0x7')](_0x1253a6,{'typecast':!![]});if(_0x535c7b[_0x6568('0x8')]){logger['error'](_0x6568('0x9'),_0x282518,_[_0x6568('0xa')](_0x535c7b,_0x6568('0xb'))['join'](',\x20'));logger[_0x6568('0xc')](_0x6568('0xd'),_0x282518);_0x5c4879[_0x6568('0xe')]();}else{var _0x145c5f=this;var _0x1a9766=utils['getMustacheRender'](_0x1e8e9c[0x0],this);logger[_0x6568('0xc')](_0x6568('0xf'),_0x282518,_0x1a9766);sh[_0x6568('0x10')](_['trim'](_0x1a9766),function(_0x30edcb,_0x5739ac){logger['info'](_0x6568('0x11'),_0x282518,_0x30edcb);if(_0x30edcb==0x0){var _0x569576=_0x5739ac['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x6568('0x12')](_0x1e8e9c[0x1])||_[_0x6568('0x13')](_0x1e8e9c[0x1])){logger[_0x6568('0xc')](_0x6568('0x14'),_0x282518);_0x145c5f[_0x6568('0x15')][_0x1e8e9c[0x1]]=_0x569576;}else{logger['info'](_0x6568('0x16'),_0x282518,_0x1e8e9c[0x1],_0x569576);_0x145c5f[_0x6568('0x15')][_0x1e8e9c[0x1]]=_0x569576;}}_0x5c4879[_0x6568('0xe')]();});}}catch(_0x5d7050){logger[_0x6568('0x17')](_0x6568('0x9'),_0x282518,_[_0x6568('0x18')](_0x5d7050)?JSON[_0x6568('0x19')](_0x5d7050):_0x5d7050);logger[_0x6568('0xc')](_0x6568('0xd'),_0x282518);_0x5c4879['next']();}};}; \ No newline at end of file +var _0x25b0=['error','[%s][SYSTEM]\x20%s','map','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x25b0,0x140));var _0x025b=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x25b0[_0x2932cf];return _0x1711dd;};'use strict';var schema=require(_0x025b('0x0'));var sh=require(_0x025b('0x1'));var _=require(_0x025b('0x2'));var utils=require(_0x025b('0x3'));var logger=require(_0x025b('0x4'))(_0x025b('0x5'));var system=schema({'command':{'type':_0x025b('0x6'),'required':!![],'message':_0x025b('0x7')}});exports[_0x025b('0x8')]=function(_0x286601,_0x516a8d){return function(_0xf0bd10){try{var _0x41b88b={'command':_0x516a8d[0x0]};var _0x41d8a4=system['validate'](_0x41b88b,{'typecast':!![]});if(_0x41d8a4[_0x025b('0x9')]){logger[_0x025b('0xa')](_0x025b('0xb'),_0x286601,_[_0x025b('0xc')](_0x41d8a4,_0x025b('0xd'))[_0x025b('0xe')](',\x20'));logger[_0x025b('0xf')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x286601);_0xf0bd10[_0x025b('0x10')]();}else{var _0x30d59e=this;var _0x3fb897=utils[_0x025b('0x11')](_0x516a8d[0x0],this);logger[_0x025b('0xf')](_0x025b('0x12'),_0x286601,_0x3fb897);sh[_0x025b('0x13')](_[_0x025b('0x14')](_0x3fb897),function(_0x2cf688,_0x5a80a3){logger[_0x025b('0xf')](_0x025b('0x15'),_0x286601,_0x2cf688);if(_0x2cf688==0x0){var _0x288d63=_0x5a80a3[_0x025b('0x16')](/(\r\n|\n|\r)/gm,'');if(_[_0x025b('0x17')](_0x516a8d[0x1])||_['isEmpty'](_0x516a8d[0x1])){logger[_0x025b('0xf')](_0x025b('0x18'),_0x286601);_0x30d59e[_0x025b('0x19')][_0x516a8d[0x1]]=_0x288d63;}else{logger[_0x025b('0xf')](_0x025b('0x1a'),_0x286601,_0x516a8d[0x1],_0x288d63);_0x30d59e[_0x025b('0x19')][_0x516a8d[0x1]]=_0x288d63;}}_0xf0bd10[_0x025b('0x10')]();});}}catch(_0x50d54b){logger[_0x025b('0xa')](_0x025b('0xb'),_0x286601,_[_0x025b('0x1b')](_0x50d54b)?JSON[_0x025b('0x1c')](_0x50d54b):_0x50d54b);logger[_0x025b('0xf')](_0x025b('0x1d'),_0x286601);_0xf0bd10[_0x025b('0x10')]();}};}; \ 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 7d8427c..e5f6426 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 _0xb39e=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','length','error','[%s][TAG]\x20%s','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0xd638d1,_0x58c98f){var _0x4091a5=function(_0x6400a3){while(--_0x6400a3){_0xd638d1['push'](_0xd638d1['shift']());}};_0x4091a5(++_0x58c98f);}(_0xb39e,0x14e));var _0xeb39=function(_0x380d66,_0x4f2eef){_0x380d66=_0x380d66-0x0;var _0x138bfe=_0xb39e[_0x380d66];return _0x138bfe;};'use strict';var schema=require(_0xeb39('0x0'));var _=require(_0xeb39('0x1'));var rpc={'chatInteraction':require(_0xeb39('0x2')),'openchannelInteraction':require(_0xeb39('0x3')),'smsInteraction':require(_0xeb39('0x4')),'mailInteraction':require(_0xeb39('0x5')),'faxInteraction':require(_0xeb39('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xeb39('0x7'))(_0xeb39('0x8'));var tag=schema({'tag':{'type':_0xeb39('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x26b8d5,_0x41e1a7,_0x58d717,_0x5c7450){return function(_0x23893a){try{var _0x3e3f01={'tag':_0x41e1a7[0x0]};var _0x2745e1=tag[_0xeb39('0x0')](_0x3e3f01,{'typecast':!![]});if(_0x2745e1[_0xeb39('0xa')]){logger[_0xeb39('0xb')](_0xeb39('0xc'),_0x26b8d5,_['map'](_0x2745e1,_0xeb39('0xd'))[_0xeb39('0xe')](',\x20'));logger['info'](_0xeb39('0xf'),_0x26b8d5);_0x23893a[_0xeb39('0x10')]();}else{var _0x4320a6={'ids':[_0x41e1a7[0x0]]};if(rpc[_0x5c7450['channel']+'Interaction']){rpc[_0x5c7450[_0xeb39('0x11')]+'Interaction']['addTags'](_0x5c7450[_0xeb39('0x12')]['id'],_0x4320a6)[_0xeb39('0x13')](function(_0x5bf7d8){logger[_0xeb39('0x14')](_0xeb39('0x15'),_0x26b8d5,_0x41e1a7[0x1],_0x5c7450[_0xeb39('0x11')],_0x5c7450['interaction']['id']);})[_0xeb39('0x16')](function(_0x5173b7){logger[_0xeb39('0xb')]('[%s][TAG]\x20%s',_0x26b8d5,JSON[_0xeb39('0x17')](_0x5173b7));logger[_0xeb39('0x14')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x26b8d5);})[_0xeb39('0x18')](function(){_0x23893a[_0xeb39('0x10')]();});}}}catch(_0x5512ef){logger['error'](_0xeb39('0xc'),_0x26b8d5,_[_0xeb39('0x19')](_0x5512ef)?JSON[_0xeb39('0x17')](_0x5512ef):_0x5512ef);logger['info'](_0xeb39('0xf'),_0x26b8d5);_0x23893a[_0xeb39('0x10')]();}};}; \ No newline at end of file +var _0xcb97=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','error','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/mailInteraction'];(function(_0xa79520,_0x3d9a1a){var _0x4a7e1e=function(_0x42c5d9){while(--_0x42c5d9){_0xa79520['push'](_0xa79520['shift']());}};_0x4a7e1e(++_0x3d9a1a);}(_0xcb97,0x114));var _0x7cb9=function(_0x53561b,_0x1706b3){_0x53561b=_0x53561b-0x0;var _0x3fa06d=_0xcb97[_0x53561b];return _0x3fa06d;};'use strict';var schema=require(_0x7cb9('0x0'));var _=require(_0x7cb9('0x1'));var rpc={'chatInteraction':require(_0x7cb9('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7cb9('0x3')),'faxInteraction':require(_0x7cb9('0x4')),'whatsappInteraction':require(_0x7cb9('0x5'))};var logger=require(_0x7cb9('0x6'))('routing');var tag=schema({'tag':{'type':_0x7cb9('0x7'),'required':!![],'message':_0x7cb9('0x8')}});exports[_0x7cb9('0x9')]=function(_0x4b2eca,_0x4c8f18,_0x81c04f,_0xb71c97){return function(_0x43725a){try{var _0x510f85={'tag':_0x4c8f18[0x0]};var _0x57b6e1=tag[_0x7cb9('0x0')](_0x510f85,{'typecast':!![]});if(_0x57b6e1[_0x7cb9('0xa')]){logger['error'](_0x7cb9('0xb'),_0x4b2eca,_['map'](_0x57b6e1,_0x7cb9('0xc'))[_0x7cb9('0xd')](',\x20'));logger['info'](_0x7cb9('0xe'),_0x4b2eca);_0x43725a[_0x7cb9('0xf')]();}else{var _0x138b8d={'ids':[_0x4c8f18[0x0]]};if(rpc[_0xb71c97['channel']+'Interaction']){rpc[_0xb71c97[_0x7cb9('0x10')]+_0x7cb9('0x11')][_0x7cb9('0x12')](_0xb71c97[_0x7cb9('0x13')]['id'],_0x138b8d)[_0x7cb9('0x14')](function(_0x5e7ba4){logger[_0x7cb9('0x15')](_0x7cb9('0x16'),_0x4b2eca,_0x4c8f18[0x1],_0xb71c97[_0x7cb9('0x10')],_0xb71c97[_0x7cb9('0x13')]['id']);})[_0x7cb9('0x17')](function(_0x14c0ab){logger['error']('[%s][TAG]\x20%s',_0x4b2eca,JSON[_0x7cb9('0x18')](_0x14c0ab));logger[_0x7cb9('0x15')](_0x7cb9('0xe'),_0x4b2eca);})[_0x7cb9('0x19')](function(){_0x43725a[_0x7cb9('0xf')]();});}}}catch(_0x428088){logger[_0x7cb9('0x1a')](_0x7cb9('0xb'),_0x4b2eca,_[_0x7cb9('0x1b')](_0x428088)?JSON[_0x7cb9('0x18')](_0x428088):_0x428088);logger['info'](_0x7cb9('0xe'),_0x4b2eca);_0x43725a[_0x7cb9('0xf')]();}};}; \ 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 15c2a74..c6f9ced 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x1d9003,_0xee8067){var _0x2caaec=function(_0x3b28fb){while(--_0x3b28fb){_0x1d9003['push'](_0x1d9003['shift']());}};_0x2caaec(++_0xee8067);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x1f38dd,_0x2b8969){var _0x408adb=function(_0x2b6045){while(--_0x2b6045){_0x1f38dd['push'](_0x1f38dd['shift']());}};_0x408adb(++_0x2b8969);}(_0xe706,0xa3));var _0x6e70=function(_0x2db146,_0x509cc5){_0x2db146=_0x2db146-0x0;var _0x524bcb=_0xe706[_0x2db146];return _0x524bcb;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d2cdab9..27180fa 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 _0x5472=['consequence','priority','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','busy','agents','QueueReport','update','UserId','catch','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','paused','waiting','mailQueues','loggedIn','name','openchannelQueues','smsQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/logger','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','format','./interval','condition','intervals'];(function(_0x581504,_0x31bb1e){var _0x3e82fd=function(_0x369c2d){while(--_0x369c2d){_0x581504['push'](_0x581504['shift']());}};_0x3e82fd(++_0x31bb1e);}(_0x5472,0xe1));var _0x2547=function(_0x24fe8e,_0x3fa991){_0x24fe8e=_0x24fe8e-0x0;var _0xe063e8=_0x5472[_0x24fe8e];return _0xe063e8;};'use strict';var _=require('lodash');var util=require(_0x2547('0x0'));var path=require(_0x2547('0x1'));var fs=require('fs');var jayson=require(_0x2547('0x2'));var BPromise=require(_0x2547('0x3'));var uuid=require(_0x2547('0x4'));var config=require('../../../config/environment');var logger=require(_0x2547('0x5'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2547('0x6')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x2547('0x7')),'faxQueueReport':require(_0x2547('0x8')),'whatsappQueueReport':require(_0x2547('0x9'))};var RuleEngine=require(_0x2547('0xa'));function getId(_0x204e7e,_0x1e27df,_0x595699){return util['format'](_0x2547('0xb'),_0x204e7e,_0x1e27df||0x0,_0x595699||0x0);}function getIntervals(_0x2af3c0,_0x30ce9d){var _0x2be219=[];if(!_[_0x2547('0xc')](_0x30ce9d[_0x2547('0xd')])&&!_[_0x2547('0xc')](_0x2af3c0[_0x30ce9d[_0x2547('0xd')]])&&!_[_0x2547('0xc')](_0x2af3c0[_0x30ce9d[_0x2547('0xd')]][_0x2547('0xe')])){_0x2be219=_['map'](_0x2af3c0[_0x30ce9d['IntervalId']][_0x2547('0xe')],_0x2547('0xf'));}else if(!_[_0x2547('0xc')](_0x30ce9d[_0x2547('0xf')])){_0x2be219=[_0x30ce9d['interval']];}return _0x2be219;}exports[_0x2547('0x10')]=function(_0x92c442){_0x92c442[_0x2547('0x11')]={};return new BPromise(function(_0x54b839,_0x344bcf){var _0x29bc91={'Start':function(_0x21bb46){var _0x4964e2=this;return new Promise(function(_0x431cc3,_0x426fd9){if(_0x21bb46){try{var _0x393628=[];var _0x1651e3=getId(_0x21bb46[_0x2547('0x12')],_0x21bb46[_0x2547('0x13')]?_0x21bb46[_0x2547('0x13')]['id']:0x0,_0x21bb46[_0x2547('0x14')]?_0x21bb46[_0x2547('0x14')]['id']:0x0);if(_0x21bb46[_0x2547('0x15')]&&_[_0x2547('0x16')](_0x21bb46['applications'])&&_0x21bb46['applications'][_0x2547('0x17')]){for(var _0x19b86c=0x0;_0x19b86c<_0x21bb46['applications'][_0x2547('0x17')];_0x19b86c+=0x1){var _0x2b8dd7=_0x21bb46[_0x2547('0x15')][_0x19b86c];if(fs[_0x2547('0x18')](path[_0x2547('0x19')](__dirname,'applications',_0x2b8dd7[_0x2547('0x1a')]+'.js'))){var _0x59f6b3=[];switch(_0x2b8dd7[_0x2547('0x1a')][_0x2547('0x1b')]()){case _0x2547('0x1c'):var _0x42813e=_0x2b8dd7[_0x2547('0x1d')][_0x2547('0x1e')](',');if(_0x21bb46['channel']===_0x2547('0x1f')){_0x59f6b3[_0x2547('0x20')](_0x42813e[0x0]);_0x59f6b3['push'](_0x42813e[0x1]);_0x59f6b3[_0x2547('0x20')](_0x42813e[_0x2547('0x21')](0x2,_0x42813e['length'])[_0x2547('0x19')](','));}else{_0x59f6b3['push'](_0x42813e[0x0]);_0x59f6b3[_0x2547('0x20')](_0x42813e['slice'](0x1,_0x42813e[_0x2547('0x17')])[_0x2547('0x19')](','));}break;case _0x2547('0x22'):var _0x4be075=_0x2b8dd7[_0x2547('0x1d')][_0x2547('0x1e')](',');_0x59f6b3[_0x2547('0x20')](_0x4be075[0x0]);_0x59f6b3['push'](_0x4be075[0x1]);_0x59f6b3[_0x2547('0x20')](_0x4be075['slice'](0x2,_0x4be075[_0x2547('0x17')])[_0x2547('0x19')](','));break;case _0x2547('0x23'):var _0x21f1b8=_0x2b8dd7[_0x2547('0x1d')]['split'](',');_0x59f6b3[_0x2547('0x20')](_0x21f1b8[0x0]);_0x59f6b3[_0x2547('0x20')](_0x21f1b8[0x1]);_0x59f6b3['push'](_0x21f1b8[0x2]);_0x59f6b3['push'](_0x21f1b8[0x3]);_0x59f6b3[_0x2547('0x20')](_0x21f1b8[_0x2547('0x21')](0x4,_0x21f1b8[_0x2547('0x17')])[_0x2547('0x19')](','));break;case _0x2547('0x24'):var _0x208d7b=_0x2b8dd7['appdata'][_0x2547('0x1e')](',');_0x59f6b3[_0x2547('0x20')](_0x208d7b[0x0]);_0x59f6b3[_0x2547('0x20')](_0x208d7b[0x1]);_0x59f6b3[_0x2547('0x20')](_0x208d7b[0x2]);_0x59f6b3[_0x2547('0x20')](_0x208d7b[0x3]);_0x59f6b3['push'](_0x208d7b[_0x2547('0x21')](0x4,_0x208d7b['length'])[_0x2547('0x19')](','));break;case _0x2547('0x13'):_0x59f6b3[_0x2547('0x20')](_0x2b8dd7[_0x2547('0x1d')]);break;case _0x2547('0x25'):_0x59f6b3[_0x2547('0x20')](_0x2b8dd7['TagId']);_0x59f6b3['push'](_0x2b8dd7[_0x2547('0x1d')]);break;default:_0x59f6b3=_['isNil'](_0x2b8dd7[_0x2547('0x1d')])?[]:_0x2b8dd7[_0x2547('0x1d')][_0x2547('0x1e')](',');}var _0x331741={'id':util[_0x2547('0x26')]('%s:%s:%s',_0x1651e3,_0x2b8dd7['id'],_0x2b8dd7[_0x2547('0x1a')]),'condition':require(_0x2547('0x27'))[_0x2547('0x28')](_0x1651e3,getIntervals(_0x92c442[_0x2547('0x29')],_0x2b8dd7),_0x92c442),'consequence':require('./applications/'+_0x2b8dd7[_0x2547('0x1a')])[_0x2547('0x2a')](_0x1651e3,_0x59f6b3,_0x92c442,_0x21bb46),'p':_0x2b8dd7[_0x2547('0x2b')]||0x0};logger['info']('Push\x20new\x20rule',_0x331741['id'],_0x2547('0x2c'),getIntervals(_0x92c442['intervals'],_0x2b8dd7)[_0x2547('0x19')](_0x2547('0x2d')));_0x393628['push'](_0x331741);}else{logger[_0x2547('0x2e')](_0x2547('0x2f'),path[_0x2547('0x19')](__dirname,_0x2547('0x15'),_0x2b8dd7['app']+'.js'));}}_0x92c442[_0x2547('0x11')][_0x1651e3]=new RuleEngine(_0x393628);_0x92c442[_0x2547('0x11')][_0x1651e3][_0x2547('0x30')](_0x21bb46,function(_0x5adaeb){logger[_0x2547('0x31')](_0x2547('0x32'),JSON[_0x2547('0x33')](_0x5adaeb['matchPath']));if(_0x92c442[_0x2547('0x11')][_0x1651e3]){_0x92c442[_0x2547('0x11')][_0x1651e3][_0x2547('0x34')](_0x2547('0x35'));}});return _0x431cc3({'code':0xc8,'message':_0x21bb46});}else{logger[_0x2547('0x31')](_0x2547('0x36'));return _0x431cc3({'code':0xc8,'message':_0x21bb46});}}catch(_0x3679ef){logger[_0x2547('0x2e')](_0x3679ef[_0x2547('0x37')]);return _0x426fd9(_0x4964e2['error'](0x1f4,_0x3679ef));}}return _0x426fd9(_0x2547('0x38'));});},'AcceptMessage':function(_0xa32f13){var _0x5e83fb=this;return new Promise(function(_0x43c569,_0x2b59c7){if(_0xa32f13[_0x2547('0x39')]&&_0xa32f13[_0x2547('0x39')]['id']){if(_0x92c442['agents'][_0xa32f13[_0x2547('0x39')]['id']]){_0x92c442['agents'][_0xa32f13[_0x2547('0x39')]['id']][_0x2547('0x3a')]=![];_0x92c442[_0x2547('0x3b')][_0xa32f13[_0x2547('0x39')]['id']]['busyQueue']=undefined;}}if(_0xa32f13[_0x2547('0x13')]&&_0xa32f13[_0x2547('0x13')]['id']){try{var _0x2708f8=getId(_0xa32f13[_0x2547('0x12')],_0xa32f13['message']?_0xa32f13[_0x2547('0x13')]['id']:0x0,_0xa32f13[_0x2547('0x14')]?_0xa32f13[_0x2547('0x14')]['id']:0x0);if(_0x92c442[_0x2547('0x11')][_0x2708f8]){_0x92c442[_0x2547('0x11')][_0x2708f8][_0x2547('0x34')]('end');if(rpc[_0xa32f13[_0x2547('0x12')]+_0x2547('0x3c')]){rpc[_0xa32f13[_0x2547('0x12')]+_0x2547('0x3c')][_0x2547('0x3d')](_0x2708f8,{'UserId':_0xa32f13[_0x2547('0x13')][_0x2547('0x3e')]})[_0x2547('0x3f')](function(_0x5e6bed){logger[_0x2547('0x2e')]('error\x20update\x20queue\x20report');});}}return _0x43c569({'code':0xc8,'message':_0xa32f13});}catch(_0xa8764){logger[_0x2547('0x2e')](_0xa8764[_0x2547('0x37')]);return _0x2b59c7(_0x5e83fb[_0x2547('0x2e')](0x1f4,_0xa8764));}}logger['error'](_0x2547('0x40'));return _0x2b59c7(_0x5e83fb[_0x2547('0x2e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x325b9a){var _0x3ddc68=this;return new Promise(function(_0x27c1bb,_0x54ac1b){if(_0x325b9a[_0x2547('0x39')]&&_0x325b9a[_0x2547('0x39')]['id']){try{if(_0x92c442[_0x2547('0x3b')][_0x325b9a[_0x2547('0x39')]['id']]){_0x92c442[_0x2547('0x3b')][_0x325b9a[_0x2547('0x39')]['id']][_0x2547('0x3a')]=![];_0x92c442['agents'][_0x325b9a[_0x2547('0x39')]['id']][_0x2547('0x41')]=undefined;}return _0x27c1bb({'code':0xc8,'message':_0x325b9a});}catch(_0x2f62de){logger[_0x2547('0x2e')](_0x2f62de[_0x2547('0x37')]);return _0x54ac1b(_0x3ddc68[_0x2547('0x2e')](0x1f4,_0x2f62de));}}logger[_0x2547('0x2e')](_0x2547('0x40'));return _0x54ac1b(_0x3ddc68['error'](0x1f4,_0x2547('0x40')));});},'AbandonInteraction':function(_0x51f79d){var _0x15c69b=this;return new Promise(function(_0x55efef,_0x1d9a8e){if(_0x51f79d[_0x2547('0x12')]&&_0x51f79d[_0x2547('0x14')]&&_0x51f79d[_0x2547('0x14')]['id']){try{var _0x3b348d=getId(_0x51f79d['channel'],_0x51f79d[_0x2547('0x13')]?_0x51f79d['message']['id']:0x0,_0x51f79d[_0x2547('0x14')]?_0x51f79d[_0x2547('0x14')]['id']:0x0);if(_0x92c442['rules'][_0x3b348d]){_0x92c442[_0x2547('0x11')][_0x3b348d][_0x2547('0x34')]('end');}return _0x55efef({'code':0xc8,'message':_0x51f79d});}catch(_0xc179e2){logger['error'](_0xc179e2['stack']);return _0x1d9a8e(_0x15c69b['error'](0x1f4,_0xc179e2));}}logger[_0x2547('0x2e')](_0x2547('0x40'));return _0x1d9a8e(_0x15c69b[_0x2547('0x2e')](0x1f4,_0x2547('0x40')));});},'AgentCapacity':function(_0x5252c2){var _0x56662c=this;return new Promise(function(_0x2b2ec1,_0x393374){if(_0x92c442[_0x2547('0x3b')][_0x2547('0x42')](_0x5252c2['id'])){for(var _0x342aec in _0x5252c2['capacity']){if(_0x5252c2[_0x2547('0x43')][_0x2547('0x42')](_0x342aec)){if(_0x92c442[_0x2547('0x3b')][_0x5252c2['id']][_0x2547('0x42')](_0x342aec+_0x2547('0x44'))){_0x92c442['agents'][_0x5252c2['id']][_0x342aec+'CurrentCapacity']=parseInt(_0x5252c2[_0x2547('0x43')][_0x342aec],0xa);}}}_0x92c442[_0x2547('0x3b')][_0x5252c2['id']][_0x2547('0x45')]();return _0x2b2ec1({'code':0xc8,'message':_0x92c442['agents'][_0x5252c2['id']]});}else{return _0x393374(_0x56662c[_0x2547('0x2e')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x27edcf){return new Promise(function(_0x369369,_0x28c2ab){var _0x50e3f6=_[_0x2547('0x46')](_0x92c442[_0x2547('0x3b')]);_0x369369({'count':_0x50e3f6[_0x2547('0x17')],'rows':_0x50e3f6});});},'ChatQueues':function(_0x37703d){return new Promise(function(_0x231909,_0x1bce4e){var _0xcad2b=[];for(var _0x5a8adf in _0x92c442[_0x2547('0x47')]){if(_0x92c442[_0x2547('0x47')][_0x2547('0x42')](_0x5a8adf)){var _0x44d513=_0x92c442['chatQueues'][_0x5a8adf];var _0x1cee4c={'id':_0x44d513['id'],'available':_0x44d513[_0x2547('0x48')],'loggedIn':_0x44d513['loggedIn'],'name':_0x44d513['name'],'paused':_0x44d513[_0x2547('0x49')],'waiting':_0x44d513[_0x2547('0x4a')]};_0xcad2b[_0x2547('0x20')](_0x1cee4c);}}_0x231909({'count':_0xcad2b['length'],'rows':_0xcad2b});});},'MailQueues':function(_0x4efb38){return new Promise(function(_0x33237b,_0x3aaed0){var _0x3927da=[];for(var _0x35b680 in _0x92c442[_0x2547('0x4b')]){if(_0x92c442['mailQueues'][_0x2547('0x42')](_0x35b680)){var _0x163e85=_0x92c442['mailQueues'][_0x35b680];var _0x5314bd={'id':_0x163e85['id'],'available':_0x163e85[_0x2547('0x48')],'loggedIn':_0x163e85[_0x2547('0x4c')],'name':_0x163e85[_0x2547('0x4d')],'paused':_0x163e85[_0x2547('0x49')],'waiting':_0x163e85[_0x2547('0x4a')]};_0x3927da[_0x2547('0x20')](_0x5314bd);}}_0x33237b({'count':_0x3927da['length'],'rows':_0x3927da});});},'OpenchannelQueues':function(_0x5af790){return new Promise(function(_0x566d71,_0x5a5084){var _0x28f223=[];for(var _0x1a7228 in _0x92c442[_0x2547('0x4e')]){if(_0x92c442[_0x2547('0x4e')][_0x2547('0x42')](_0x1a7228)){var _0x48485d=_0x92c442[_0x2547('0x4e')][_0x1a7228];var _0x3005b5={'id':_0x48485d['id'],'available':_0x48485d[_0x2547('0x48')],'loggedIn':_0x48485d['loggedIn'],'name':_0x48485d['name'],'paused':_0x48485d[_0x2547('0x49')],'waiting':_0x48485d[_0x2547('0x4a')]};_0x28f223[_0x2547('0x20')](_0x3005b5);}}_0x566d71({'count':_0x28f223[_0x2547('0x17')],'rows':_0x28f223});});},'SmsQueues':function(_0xf18fb9){return new Promise(function(_0x3b6445,_0x3ff3b1){var _0xf57d66=[];for(var _0x53aa60 in _0x92c442[_0x2547('0x4f')]){if(_0x92c442['smsQueues'][_0x2547('0x42')](_0x53aa60)){var _0x431b56=_0x92c442[_0x2547('0x4f')][_0x53aa60];var _0x378369={'id':_0x431b56['id'],'available':_0x431b56['available'],'loggedIn':_0x431b56[_0x2547('0x4c')],'name':_0x431b56[_0x2547('0x4d')],'paused':_0x431b56[_0x2547('0x49')],'waiting':_0x431b56[_0x2547('0x4a')]};_0xf57d66['push'](_0x378369);}}_0x3b6445({'count':_0xf57d66[_0x2547('0x17')],'rows':_0xf57d66});});},'FaxQueues':function(_0x590d15){return new Promise(function(_0x7f2fca,_0x14cdc1){var _0xf4fa55=[];for(var _0x2ac04a in _0x92c442['faxQueues']){if(_0x92c442['faxQueues'][_0x2547('0x42')](_0x2ac04a)){var _0x415d62=_0x92c442['faxQueues'][_0x2ac04a];var _0x464f41={'id':_0x415d62['id'],'available':_0x415d62[_0x2547('0x48')],'loggedIn':_0x415d62[_0x2547('0x4c')],'name':_0x415d62[_0x2547('0x4d')],'paused':_0x415d62['paused'],'waiting':_0x415d62[_0x2547('0x4a')]};_0xf4fa55[_0x2547('0x20')](_0x464f41);}}_0x7f2fca({'count':_0xf4fa55[_0x2547('0x17')],'rows':_0xf4fa55});});},'WhatsappQueues':function(_0x9eb57d){return new Promise(function(_0x1536a9,_0xa96818){var _0x3872c3=[];for(var _0x10fbcf in _0x92c442['whatsappQueues']){if(_0x92c442[_0x2547('0x50')][_0x2547('0x42')](_0x10fbcf)){var _0x31301b=_0x92c442[_0x2547('0x50')][_0x10fbcf];var _0x16dbc={'id':_0x31301b['id'],'available':_0x31301b[_0x2547('0x48')],'loggedIn':_0x31301b[_0x2547('0x4c')],'name':_0x31301b[_0x2547('0x4d')],'paused':_0x31301b[_0x2547('0x49')],'waiting':_0x31301b['waiting']};_0x3872c3[_0x2547('0x20')](_0x16dbc);}}_0x1536a9({'count':_0x3872c3[_0x2547('0x17')],'rows':_0x3872c3});});},'ChatQueuesWaitingInteractions':function(_0x362752){return new Promise(function(_0x275fd6,_0x233183){var _0x3284b9=_[_0x2547('0x46')](_0x92c442['chatQueuesWaitingInteractions']);_0x275fd6({'count':_0x3284b9[_0x2547('0x17')],'rows':_0x3284b9});});},'MailQueuesWaitingInteractions':function(_0x1abb8d){return new Promise(function(_0x47e31c,_0x5d135d){var _0x1a503d=_[_0x2547('0x46')](_0x92c442[_0x2547('0x51')]);_0x47e31c({'count':_0x1a503d[_0x2547('0x17')],'rows':_0x1a503d});});},'OpenchannelQueuesWaitingInteractions':function(_0x467ee2){return new Promise(function(_0x30b45c,_0x581a62){var _0x21e32d=_[_0x2547('0x46')](_0x92c442[_0x2547('0x52')]);_0x30b45c({'count':_0x21e32d[_0x2547('0x17')],'rows':_0x21e32d});});},'SmsQueuesWaitingInteractions':function(_0x119015){return new Promise(function(_0x4d2fa4,_0x1e6aaf){var _0x46f9e1=_[_0x2547('0x46')](_0x92c442['smsQueuesWaitingInteractions']);_0x4d2fa4({'count':_0x46f9e1[_0x2547('0x17')],'rows':_0x46f9e1});});},'FaxQueuesWaitingInteractions':function(_0x2e6c19){return new Promise(function(_0x257dcd,_0x545dd0){var _0x521a8e=_[_0x2547('0x46')](_0x92c442[_0x2547('0x53')]);_0x257dcd({'count':_0x521a8e[_0x2547('0x17')],'rows':_0x521a8e});});},'WhatsappQueuesWaitingInteractions':function(_0xe798f5){return new Promise(function(_0x59de52,_0x57f377){var _0x84240f=_[_0x2547('0x46')](_0x92c442[_0x2547('0x54')]);_0x59de52({'count':_0x84240f[_0x2547('0x17')],'rows':_0x84240f});});}};var _0x3076f2=jayson['server'](_0x29bc91)['http']();_0x3076f2['on'](_0x2547('0x2e'),function(_0x134377){logger[_0x2547('0x2e')](JSON['stringify'](_0x134377));return _0x344bcf(_0x134377);});_0x3076f2['listen'](0x232c,_0x2547('0x55'),function(){console[_0x2547('0x56')](_0x2547('0x57'),0x232c);return _0x54b839(_0x2547('0x58')+0x232c);});});}; \ No newline at end of file +var _0x1465=['isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','.js','app','toLowerCase','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','TagId','format','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','update','UserId','catch','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','%s.%s.%s'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0x1465,0x1c7));var _0x5146=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x1465[_0x2132a3];return _0x21890c;};'use strict';var _=require(_0x5146('0x0'));var util=require(_0x5146('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x5146('0x2'));var BPromise=require(_0x5146('0x3'));var uuid=require(_0x5146('0x4'));var config=require('../../../config/environment');var logger=require(_0x5146('0x5'))(_0x5146('0x6'));var rpc={'openchannelQueueReport':require(_0x5146('0x7')),'mailQueueReport':require(_0x5146('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x21813c,_0x28e0ed,_0x4acb43){return util['format'](_0x5146('0x9'),_0x21813c,_0x28e0ed||0x0,_0x4acb43||0x0);}function getIntervals(_0x1709fa,_0x5f1167){var _0x20b852=[];if(!_[_0x5146('0xa')](_0x5f1167[_0x5146('0xb')])&&!_[_0x5146('0xa')](_0x1709fa[_0x5f1167[_0x5146('0xb')]])&&!_[_0x5146('0xa')](_0x1709fa[_0x5f1167[_0x5146('0xb')]][_0x5146('0xc')])){_0x20b852=_[_0x5146('0xd')](_0x1709fa[_0x5f1167[_0x5146('0xb')]][_0x5146('0xc')],'interval');}else if(!_['isNil'](_0x5f1167[_0x5146('0xe')])){_0x20b852=[_0x5f1167[_0x5146('0xe')]];}return _0x20b852;}exports[_0x5146('0xf')]=function(_0x5d71ee){_0x5d71ee[_0x5146('0x10')]={};return new BPromise(function(_0x4a6929,_0x13702a){var _0x1e5f90={'Start':function(_0x362401){var _0x3a8f08=this;return new Promise(function(_0x1e0926,_0x2e86e9){if(_0x362401){try{var _0x5b95c5=[];var _0x5269c2=getId(_0x362401[_0x5146('0x11')],_0x362401[_0x5146('0x12')]?_0x362401[_0x5146('0x12')]['id']:0x0,_0x362401[_0x5146('0x13')]?_0x362401['interaction']['id']:0x0);if(_0x362401[_0x5146('0x14')]&&_[_0x5146('0x15')](_0x362401['applications'])&&_0x362401[_0x5146('0x14')][_0x5146('0x16')]){for(var _0x295c11=0x0;_0x295c11<_0x362401[_0x5146('0x14')][_0x5146('0x16')];_0x295c11+=0x1){var _0xbe944e=_0x362401[_0x5146('0x14')][_0x295c11];if(fs[_0x5146('0x17')](path['join'](__dirname,_0x5146('0x14'),_0xbe944e['app']+_0x5146('0x18')))){var _0x2360c6=[];switch(_0xbe944e[_0x5146('0x19')][_0x5146('0x1a')]()){case'autoreply':var _0xd33f72=_0xbe944e[_0x5146('0x1b')][_0x5146('0x1c')](',');if(_0x362401['channel']===_0x5146('0x1d')){_0x2360c6[_0x5146('0x1e')](_0xd33f72[0x0]);_0x2360c6['push'](_0xd33f72[0x1]);_0x2360c6[_0x5146('0x1e')](_0xd33f72[_0x5146('0x1f')](0x2,_0xd33f72['length'])[_0x5146('0x20')](','));}else{_0x2360c6[_0x5146('0x1e')](_0xd33f72[0x0]);_0x2360c6[_0x5146('0x1e')](_0xd33f72[_0x5146('0x1f')](0x1,_0xd33f72[_0x5146('0x16')])[_0x5146('0x20')](','));}break;case _0x5146('0x21'):var _0x23e282=_0xbe944e['appdata'][_0x5146('0x1c')](',');_0x2360c6['push'](_0x23e282[0x0]);_0x2360c6[_0x5146('0x1e')](_0x23e282[0x1]);_0x2360c6[_0x5146('0x1e')](_0x23e282[_0x5146('0x1f')](0x2,_0x23e282[_0x5146('0x16')])[_0x5146('0x20')](','));break;case _0x5146('0x22'):var _0x345ab4=_0xbe944e[_0x5146('0x1b')]['split'](',');_0x2360c6['push'](_0x345ab4[0x0]);_0x2360c6['push'](_0x345ab4[0x1]);_0x2360c6[_0x5146('0x1e')](_0x345ab4[0x2]);_0x2360c6[_0x5146('0x1e')](_0x345ab4[0x3]);_0x2360c6['push'](_0x345ab4[_0x5146('0x1f')](0x4,_0x345ab4[_0x5146('0x16')])['join'](','));break;case _0x5146('0x23'):var _0x5d4a06=_0xbe944e[_0x5146('0x1b')]['split'](',');_0x2360c6[_0x5146('0x1e')](_0x5d4a06[0x0]);_0x2360c6[_0x5146('0x1e')](_0x5d4a06[0x1]);_0x2360c6['push'](_0x5d4a06[0x2]);_0x2360c6[_0x5146('0x1e')](_0x5d4a06[0x3]);_0x2360c6['push'](_0x5d4a06[_0x5146('0x1f')](0x4,_0x5d4a06['length'])[_0x5146('0x20')](','));break;case _0x5146('0x12'):_0x2360c6['push'](_0xbe944e[_0x5146('0x1b')]);break;case'tag':_0x2360c6['push'](_0xbe944e[_0x5146('0x24')]);_0x2360c6[_0x5146('0x1e')](_0xbe944e[_0x5146('0x1b')]);break;default:_0x2360c6=_[_0x5146('0xa')](_0xbe944e[_0x5146('0x1b')])?[]:_0xbe944e['appdata'][_0x5146('0x1c')](',');}var _0x533f51={'id':util[_0x5146('0x25')](_0x5146('0x26'),_0x5269c2,_0xbe944e['id'],_0xbe944e[_0x5146('0x19')]),'condition':require(_0x5146('0x27'))[_0x5146('0x28')](_0x5269c2,getIntervals(_0x5d71ee[_0x5146('0x29')],_0xbe944e),_0x5d71ee),'consequence':require(_0x5146('0x2a')+_0xbe944e[_0x5146('0x19')])[_0x5146('0x2b')](_0x5269c2,_0x2360c6,_0x5d71ee,_0x362401),'p':_0xbe944e[_0x5146('0x2c')]||0x0};logger[_0x5146('0x2d')](_0x5146('0x2e'),_0x533f51['id'],_0x5146('0x2f'),getIntervals(_0x5d71ee[_0x5146('0x29')],_0xbe944e)['join'](_0x5146('0x30')));_0x5b95c5['push'](_0x533f51);}else{logger[_0x5146('0x31')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x5146('0x20')](__dirname,_0x5146('0x14'),_0xbe944e[_0x5146('0x19')]+_0x5146('0x18')));}}_0x5d71ee[_0x5146('0x10')][_0x5269c2]=new RuleEngine(_0x5b95c5);_0x5d71ee[_0x5146('0x10')][_0x5269c2]['execute'](_0x362401,function(_0x4e7d7a){logger[_0x5146('0x2d')](_0x5146('0x32'),JSON[_0x5146('0x33')](_0x4e7d7a['matchPath']));if(_0x5d71ee[_0x5146('0x10')][_0x5269c2]){_0x5d71ee[_0x5146('0x10')][_0x5269c2][_0x5146('0x34')](_0x5146('0x35'));}});return _0x1e0926({'code':0xc8,'message':_0x362401});}else{logger[_0x5146('0x2d')](_0x5146('0x36'));return _0x1e0926({'code':0xc8,'message':_0x362401});}}catch(_0x4b4021){logger[_0x5146('0x31')](_0x4b4021[_0x5146('0x37')]);return _0x2e86e9(_0x3a8f08[_0x5146('0x31')](0x1f4,_0x4b4021));}}return _0x2e86e9(_0x5146('0x38'));});},'AcceptMessage':function(_0x1d736e){var _0x1d7b80=this;return new Promise(function(_0x32f964,_0x53a0c8){if(_0x1d736e[_0x5146('0x39')]&&_0x1d736e['agent']['id']){if(_0x5d71ee['agents'][_0x1d736e[_0x5146('0x39')]['id']]){_0x5d71ee[_0x5146('0x3a')][_0x1d736e[_0x5146('0x39')]['id']]['busy']=![];_0x5d71ee['agents'][_0x1d736e[_0x5146('0x39')]['id']][_0x5146('0x3b')]=undefined;}}if(_0x1d736e['message']&&_0x1d736e[_0x5146('0x12')]['id']){try{var _0xf4eb7e=getId(_0x1d736e[_0x5146('0x11')],_0x1d736e['message']?_0x1d736e[_0x5146('0x12')]['id']:0x0,_0x1d736e[_0x5146('0x13')]?_0x1d736e[_0x5146('0x13')]['id']:0x0);if(_0x5d71ee[_0x5146('0x10')][_0xf4eb7e]){_0x5d71ee[_0x5146('0x10')][_0xf4eb7e]['emit']('end');if(rpc[_0x1d736e['channel']+'QueueReport']){rpc[_0x1d736e[_0x5146('0x11')]+_0x5146('0x3c')][_0x5146('0x3d')](_0xf4eb7e,{'UserId':_0x1d736e['message'][_0x5146('0x3e')]})[_0x5146('0x3f')](function(_0x2af247){logger[_0x5146('0x31')]('error\x20update\x20queue\x20report');});}}return _0x32f964({'code':0xc8,'message':_0x1d736e});}catch(_0xf2c8c1){logger[_0x5146('0x31')](_0xf2c8c1[_0x5146('0x37')]);return _0x53a0c8(_0x1d7b80[_0x5146('0x31')](0x1f4,_0xf2c8c1));}}logger['error'](_0x5146('0x40'));return _0x53a0c8(_0x1d7b80[_0x5146('0x31')](0x1f4,_0x5146('0x40')));});},'RejectMessage':function(_0x1e572d){var _0x2ab619=this;return new Promise(function(_0x2aace3,_0x2e248a){if(_0x1e572d[_0x5146('0x39')]&&_0x1e572d[_0x5146('0x39')]['id']){try{if(_0x5d71ee[_0x5146('0x3a')][_0x1e572d[_0x5146('0x39')]['id']]){_0x5d71ee[_0x5146('0x3a')][_0x1e572d[_0x5146('0x39')]['id']][_0x5146('0x41')]=![];_0x5d71ee[_0x5146('0x3a')][_0x1e572d[_0x5146('0x39')]['id']][_0x5146('0x3b')]=undefined;}return _0x2aace3({'code':0xc8,'message':_0x1e572d});}catch(_0x56b616){logger['error'](_0x56b616[_0x5146('0x37')]);return _0x2e248a(_0x2ab619[_0x5146('0x31')](0x1f4,_0x56b616));}}logger[_0x5146('0x31')](_0x5146('0x40'));return _0x2e248a(_0x2ab619[_0x5146('0x31')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x4dfbf4){var _0x36bb25=this;return new Promise(function(_0x1a4202,_0x201a0f){if(_0x4dfbf4[_0x5146('0x11')]&&_0x4dfbf4['interaction']&&_0x4dfbf4[_0x5146('0x13')]['id']){try{var _0x3dee7a=getId(_0x4dfbf4['channel'],_0x4dfbf4[_0x5146('0x12')]?_0x4dfbf4[_0x5146('0x12')]['id']:0x0,_0x4dfbf4['interaction']?_0x4dfbf4[_0x5146('0x13')]['id']:0x0);if(_0x5d71ee[_0x5146('0x10')][_0x3dee7a]){_0x5d71ee[_0x5146('0x10')][_0x3dee7a]['emit']('end');}return _0x1a4202({'code':0xc8,'message':_0x4dfbf4});}catch(_0x454ea2){logger['error'](_0x454ea2['stack']);return _0x201a0f(_0x36bb25[_0x5146('0x31')](0x1f4,_0x454ea2));}}logger[_0x5146('0x31')]('message\x20is\x20empty');return _0x201a0f(_0x36bb25[_0x5146('0x31')](0x1f4,_0x5146('0x40')));});},'AgentCapacity':function(_0x1b36dd){var _0x5d9e90=this;return new Promise(function(_0x2ef89f,_0x2c56b5){if(_0x5d71ee['agents'][_0x5146('0x42')](_0x1b36dd['id'])){for(var _0x26babf in _0x1b36dd[_0x5146('0x43')]){if(_0x1b36dd[_0x5146('0x43')][_0x5146('0x42')](_0x26babf)){if(_0x5d71ee['agents'][_0x1b36dd['id']][_0x5146('0x42')](_0x26babf+'CurrentCapacity')){_0x5d71ee['agents'][_0x1b36dd['id']][_0x26babf+_0x5146('0x44')]=parseInt(_0x1b36dd[_0x5146('0x43')][_0x26babf],0xa);}}}_0x5d71ee['agents'][_0x1b36dd['id']][_0x5146('0x45')]();return _0x2ef89f({'code':0xc8,'message':_0x5d71ee[_0x5146('0x3a')][_0x1b36dd['id']]});}else{return _0x2c56b5(_0x5d9e90[_0x5146('0x31')](0x1f4,_0x5146('0x46')));}});},'Agents':function(_0x41f4be){return new Promise(function(_0x14801c,_0x11cad8){var _0x14de55=_[_0x5146('0x47')](_0x5d71ee['agents']);_0x14801c({'count':_0x14de55[_0x5146('0x16')],'rows':_0x14de55});});},'ChatQueues':function(_0x53382d){return new Promise(function(_0x4a2151,_0x3d6c75){var _0x553ad6=[];for(var _0x4afe0b in _0x5d71ee['chatQueues']){if(_0x5d71ee[_0x5146('0x48')][_0x5146('0x42')](_0x4afe0b)){var _0x538a6a=_0x5d71ee['chatQueues'][_0x4afe0b];var _0x29dd63={'id':_0x538a6a['id'],'available':_0x538a6a[_0x5146('0x49')],'loggedIn':_0x538a6a[_0x5146('0x4a')],'name':_0x538a6a[_0x5146('0x4b')],'paused':_0x538a6a[_0x5146('0x4c')],'waiting':_0x538a6a[_0x5146('0x4d')]};_0x553ad6['push'](_0x29dd63);}}_0x4a2151({'count':_0x553ad6[_0x5146('0x16')],'rows':_0x553ad6});});},'MailQueues':function(_0x7302b4){return new Promise(function(_0x263f3f,_0x2df870){var _0x507a05=[];for(var _0x32d5a7 in _0x5d71ee[_0x5146('0x4e')]){if(_0x5d71ee[_0x5146('0x4e')][_0x5146('0x42')](_0x32d5a7)){var _0x175df1=_0x5d71ee['mailQueues'][_0x32d5a7];var _0x68456f={'id':_0x175df1['id'],'available':_0x175df1['available'],'loggedIn':_0x175df1[_0x5146('0x4a')],'name':_0x175df1['name'],'paused':_0x175df1['paused'],'waiting':_0x175df1[_0x5146('0x4d')]};_0x507a05['push'](_0x68456f);}}_0x263f3f({'count':_0x507a05[_0x5146('0x16')],'rows':_0x507a05});});},'OpenchannelQueues':function(_0x190202){return new Promise(function(_0x3247af,_0x4ea102){var _0x3ad799=[];for(var _0x101df3 in _0x5d71ee[_0x5146('0x4f')]){if(_0x5d71ee['openchannelQueues'][_0x5146('0x42')](_0x101df3)){var _0x56a335=_0x5d71ee[_0x5146('0x4f')][_0x101df3];var _0x43421f={'id':_0x56a335['id'],'available':_0x56a335[_0x5146('0x49')],'loggedIn':_0x56a335[_0x5146('0x4a')],'name':_0x56a335['name'],'paused':_0x56a335[_0x5146('0x4c')],'waiting':_0x56a335[_0x5146('0x4d')]};_0x3ad799[_0x5146('0x1e')](_0x43421f);}}_0x3247af({'count':_0x3ad799['length'],'rows':_0x3ad799});});},'SmsQueues':function(_0x4548a8){return new Promise(function(_0x182b79,_0x5219f5){var _0x5a5764=[];for(var _0x1d2885 in _0x5d71ee[_0x5146('0x50')]){if(_0x5d71ee['smsQueues'][_0x5146('0x42')](_0x1d2885)){var _0x287c6d=_0x5d71ee[_0x5146('0x50')][_0x1d2885];var _0x1f42d5={'id':_0x287c6d['id'],'available':_0x287c6d[_0x5146('0x49')],'loggedIn':_0x287c6d['loggedIn'],'name':_0x287c6d['name'],'paused':_0x287c6d[_0x5146('0x4c')],'waiting':_0x287c6d[_0x5146('0x4d')]};_0x5a5764['push'](_0x1f42d5);}}_0x182b79({'count':_0x5a5764[_0x5146('0x16')],'rows':_0x5a5764});});},'FaxQueues':function(_0x1908bd){return new Promise(function(_0xf19e82,_0x3ebdd1){var _0x126d71=[];for(var _0x4c50b9 in _0x5d71ee[_0x5146('0x51')]){if(_0x5d71ee[_0x5146('0x51')][_0x5146('0x42')](_0x4c50b9)){var _0x27d9e2=_0x5d71ee[_0x5146('0x51')][_0x4c50b9];var _0x53c7fc={'id':_0x27d9e2['id'],'available':_0x27d9e2[_0x5146('0x49')],'loggedIn':_0x27d9e2[_0x5146('0x4a')],'name':_0x27d9e2[_0x5146('0x4b')],'paused':_0x27d9e2[_0x5146('0x4c')],'waiting':_0x27d9e2[_0x5146('0x4d')]};_0x126d71['push'](_0x53c7fc);}}_0xf19e82({'count':_0x126d71[_0x5146('0x16')],'rows':_0x126d71});});},'WhatsappQueues':function(_0x1d499f){return new Promise(function(_0x245a20,_0x26e96d){var _0x3a976d=[];for(var _0x1ef7ac in _0x5d71ee[_0x5146('0x52')]){if(_0x5d71ee[_0x5146('0x52')][_0x5146('0x42')](_0x1ef7ac)){var _0x1aeae9=_0x5d71ee[_0x5146('0x52')][_0x1ef7ac];var _0x4e8b7c={'id':_0x1aeae9['id'],'available':_0x1aeae9['available'],'loggedIn':_0x1aeae9['loggedIn'],'name':_0x1aeae9['name'],'paused':_0x1aeae9[_0x5146('0x4c')],'waiting':_0x1aeae9[_0x5146('0x4d')]};_0x3a976d['push'](_0x4e8b7c);}}_0x245a20({'count':_0x3a976d[_0x5146('0x16')],'rows':_0x3a976d});});},'ChatQueuesWaitingInteractions':function(_0x3e3a64){return new Promise(function(_0x120805,_0x593c9d){var _0x3a2743=_['values'](_0x5d71ee[_0x5146('0x53')]);_0x120805({'count':_0x3a2743['length'],'rows':_0x3a2743});});},'MailQueuesWaitingInteractions':function(_0x45039e){return new Promise(function(_0x286bb7,_0x3ea6ec){var _0x58da14=_['values'](_0x5d71ee[_0x5146('0x54')]);_0x286bb7({'count':_0x58da14[_0x5146('0x16')],'rows':_0x58da14});});},'OpenchannelQueuesWaitingInteractions':function(_0x522a56){return new Promise(function(_0x517fc2,_0x4b6c10){var _0x42040b=_['values'](_0x5d71ee['openchannelQueuesWaitingInteractions']);_0x517fc2({'count':_0x42040b[_0x5146('0x16')],'rows':_0x42040b});});},'SmsQueuesWaitingInteractions':function(_0x56e13c){return new Promise(function(_0x49acba,_0x41e164){var _0x388ad6=_[_0x5146('0x47')](_0x5d71ee[_0x5146('0x55')]);_0x49acba({'count':_0x388ad6[_0x5146('0x16')],'rows':_0x388ad6});});},'FaxQueuesWaitingInteractions':function(_0x2ebab9){return new Promise(function(_0x58b3f5,_0x1e82f9){var _0x44b5c9=_[_0x5146('0x47')](_0x5d71ee[_0x5146('0x56')]);_0x58b3f5({'count':_0x44b5c9[_0x5146('0x16')],'rows':_0x44b5c9});});},'WhatsappQueuesWaitingInteractions':function(_0x437ef6){return new Promise(function(_0x582e07,_0xd3df2){var _0x3fb421=_[_0x5146('0x47')](_0x5d71ee[_0x5146('0x57')]);_0x582e07({'count':_0x3fb421['length'],'rows':_0x3fb421});});}};var _0x35d53b=jayson[_0x5146('0x58')](_0x1e5f90)['http']();_0x35d53b['on'](_0x5146('0x31'),function(_0x551505){logger[_0x5146('0x31')](JSON[_0x5146('0x33')](_0x551505));return _0x13702a(_0x551505);});_0x35d53b[_0x5146('0xf')](0x232c,_0x5146('0x59'),function(){console[_0x5146('0x5a')](_0x5146('0x5b'),0x232c);return _0x4a6929(_0x5146('0x5c')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index dd1069f..bb13b2d 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 _0xe122=['message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','Command','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','join','stack','stop','bluebird','lodash','../../../config/logger','routing','client','http','error'];(function(_0x2d3bf9,_0x316601){var _0x150076=function(_0x54fa9f){while(--_0x54fa9f){_0x2d3bf9['push'](_0x2d3bf9['shift']());}};_0x150076(++_0x316601);}(_0xe122,0xf5));var _0x2e12=function(_0x578cf7,_0x25ecc2){_0x578cf7=_0x578cf7-0x0;var _0x1a3a5f=_0xe122[_0x578cf7];return _0x1a3a5f;};'use strict';var util=require('util');var BPromise=require(_0x2e12('0x0'));var jayson=require('jayson/promise');var _=require(_0x2e12('0x1'));var logger=require(_0x2e12('0x2'))(_0x2e12('0x3'));var client=jayson[_0x2e12('0x4')][_0x2e12('0x5')]({'port':0x232a});function request(_0x22f6a8,_0x39f9db){return new BPromise(function(_0x562038,_0x3325c4){return client['request'](_0x22f6a8,_0x39f9db)['then'](function(_0x27038a){if(_0x27038a[_0x2e12('0x6')]){return _0x3325c4(_0x27038a[_0x2e12('0x6')][_0x2e12('0x7')]);}else{return _0x562038(_0x27038a[_0x2e12('0x8')]);}})[_0x2e12('0x9')](function(_0x16c74d){return _0x3325c4(_0x16c74d);});});}exports[_0x2e12('0xa')]=function(_0x5647c4,_0x45783e,_0x3fcc25){return function(_0x2150f1){if(_0x3fcc25['rules']&&!_0x3fcc25[_0x2e12('0xb')][_0x5647c4]){logger[_0x2e12('0xc')](_0x2e12('0xd'),_0x5647c4);return _0x2150f1['stop']();}var _0x4eaac5=[];for(var _0x3323cf=0x0;_0x3323cf<_0x45783e['length'];_0x3323cf+=0x1){_0x4eaac5['push'](request(_0x2e12('0xe'),{'command':util['format'](_0x2e12('0xf'),_0x45783e[_0x3323cf])})[_0x2e12('0x10')](function(_0x3e8e8){return _0x3e8e8&&_0x3e8e8[_0x2e12('0x7')]&&_0x3e8e8[_0x2e12('0x7')][_0x2e12('0x11')](_0x2e12('0x12'))>=0x0?!![]:![];})[_0x2e12('0x9')](function(_0xf10845){logger[_0x2e12('0x6')](_0x2e12('0x13'),_0x5647c4,_0x45783e[_0x3323cf]);}));}BPromise[_0x2e12('0x14')](_0x4eaac5)[_0x2e12('0x10')](function(_0x30ad64){var _0x1c0395=_['some'](_0x30ad64);logger[_0x2e12('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x5647c4,_0x45783e['join'](_0x2e12('0x15')),_0x1c0395);_0x2150f1[_0x2e12('0x16')](_0x1c0395);})['catch'](function(_0x53449a){console[_0x2e12('0x17')](_0x53449a);logger[_0x2e12('0x6')](_0x2e12('0x18'),_0x5647c4,_0x45783e[_0x2e12('0x19')](_0x2e12('0x15')),_0x53449a[_0x2e12('0x1a')]);_0x2150f1[_0x2e12('0x1b')]();});};}; \ No newline at end of file +var _0x9521=['push','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','info','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','bluebird','jayson/promise','lodash','routing','http','then','error','message','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length'];(function(_0x49ccfe,_0x360c03){var _0x3536cc=function(_0x3685da){while(--_0x3685da){_0x49ccfe['push'](_0x49ccfe['shift']());}};_0x3536cc(++_0x360c03);}(_0x9521,0x1d7));var _0x1952=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0x9521[_0x4c73ac];return _0x9839ee;};'use strict';var util=require(_0x1952('0x0'));var BPromise=require(_0x1952('0x1'));var jayson=require(_0x1952('0x2'));var _=require(_0x1952('0x3'));var logger=require('../../../config/logger')(_0x1952('0x4'));var client=jayson['client'][_0x1952('0x5')]({'port':0x232a});function request(_0x5a1510,_0x131145){return new BPromise(function(_0x611eb6,_0x25f4f0){return client['request'](_0x5a1510,_0x131145)[_0x1952('0x6')](function(_0x9ee861){if(_0x9ee861[_0x1952('0x7')]){return _0x25f4f0(_0x9ee861[_0x1952('0x7')][_0x1952('0x8')]);}else{return _0x611eb6(_0x9ee861['result']);}})[_0x1952('0x9')](function(_0x3ade52){return _0x25f4f0(_0x3ade52);});});}exports[_0x1952('0xa')]=function(_0x42c457,_0x2d2479,_0x2903c1){return function(_0x3310a9){if(_0x2903c1[_0x1952('0xb')]&&!_0x2903c1['rules'][_0x42c457]){logger['info'](_0x1952('0xc'),_0x42c457);return _0x3310a9[_0x1952('0xd')]();}var _0x16edd2=[];for(var _0x411e66=0x0;_0x411e66<_0x2d2479[_0x1952('0xe')];_0x411e66+=0x1){_0x16edd2[_0x1952('0xf')](request('Command',{'command':util['format'](_0x1952('0x10'),_0x2d2479[_0x411e66])})['then'](function(_0x10ca3c){return _0x10ca3c&&_0x10ca3c[_0x1952('0x8')]&&_0x10ca3c[_0x1952('0x8')][_0x1952('0x11')](_0x1952('0x12'))>=0x0?!![]:![];})[_0x1952('0x9')](function(_0x5d666d){logger[_0x1952('0x7')](_0x1952('0x13'),_0x42c457,_0x2d2479[_0x411e66]);}));}BPromise['all'](_0x16edd2)['then'](function(_0x2261d8){var _0x5152bd=_['some'](_0x2261d8);logger[_0x1952('0x14')](_0x1952('0x15'),_0x42c457,_0x2d2479['join'](_0x1952('0x16')),_0x5152bd);_0x3310a9[_0x1952('0x17')](_0x5152bd);})['catch'](function(_0x15101c){console[_0x1952('0x18')](_0x15101c);logger['error'](_0x1952('0x15'),_0x42c457,_0x2d2479[_0x1952('0x19')]('\x20|\x20'),_0x15101c[_0x1952('0x1a')]);_0x3310a9['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b968f25..5d81e45 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 _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(_0x4cd468,_0x5d91e8){var _0x6ffd2a=function(_0x4639b0){while(--_0x4639b0){_0x4cd468['push'](_0x4cd468['shift']());}};_0x6ffd2a(++_0x5d91e8);}(_0xc788,0xc4));var _0x8c78=function(_0x5d963e,_0x5edbfe){_0x5d963e=_0x5d963e-0x0;var _0x523c8e=_0xc788[_0x5d963e];return _0x523c8e;};'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 +var _0x2f68=['called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','uniqueid','channel','membername','interface','lastevent','queue','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0xb99509,_0x28ebdc){var _0x12453c=function(_0x576687){while(--_0x576687){_0xb99509['push'](_0xb99509['shift']());}};_0x12453c(++_0x28ebdc);}(_0x2f68,0x9a));var _0x82f6=function(_0x3879c7,_0x483ae7){_0x3879c7=_0x3879c7-0x0;var _0x2caa73=_0x2f68[_0x3879c7];return _0x2caa73;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var utils=require(_0x82f6('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24c877,_0x3a9c8f){utils['info'](util[_0x82f6('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x24c877[_0x82f6('0x3')],_0x24c877[_0x82f6('0x4')],_0x24c877['queue'],_0x24c877[_0x82f6('0x5')],_0x24c877[_0x82f6('0x6')],_0x24c877['calleridnum'],_0x24c877['connectedlinenum'],_0x24c877[_0x82f6('0x7')]));if(_0x24c877['queue']){utils['getVoiceQueueByName'](_0x24c877[_0x82f6('0x8')])[_0x82f6('0x9')](function(_0x250d71){if(_0x250d71){_0x24c877['type']=_0x250d71[_0x82f6('0xa')];_0x24c877[_0x82f6('0xb')]=_0x24c877['agentcomplete']?_0x250d71[_0x82f6('0xc')]:![];_0x24c877[_0x82f6('0xd')]=_0x24c877[_0x82f6('0xb')]?_0x250d71[_0x82f6('0xe')]:0x0;}utils[_0x82f6('0xf')](_0x82f6('0x10'),_0x24c877);});}else{utils['request'](_0x82f6('0x10'),_0x24c877);}if(_0x3a9c8f){delete transfers[_0x24c877[_0x82f6('0x3')]];}else{delete agents[_0x24c877['destuniqueid']];}}exports[_0x82f6('0x11')]=function(_0x1f8bf5){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x13'),_0x1f8bf5[_0x82f6('0x3')]),_0x1f8bf5);agents[_0x1f8bf5[_0x82f6('0x14')]]=_0x1f8bf5;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x15')]=utils['now']();agents[_0x1f8bf5[_0x82f6('0x14')]]['lastevent']=_0x82f6('0x16');agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x17')]=null;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x18')]=null;utils[_0x82f6('0x19')](util[_0x82f6('0x2')](_0x82f6('0x1a'),_0x1f8bf5[_0x82f6('0x3')],agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x5')],_0x1f8bf5[_0x82f6('0x14')]));}catch(_0x2652a9){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')]('[%s][agents][agentcalled]',_0x1f8bf5[_0x82f6('0x3')]),_0x2652a9);}};exports[_0x82f6('0x1c')]=function(_0x55cbce){try{if(!_[_0x82f6('0x1d')](agents[_0x55cbce[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')]('[%s][agents][agentringnoanswer]',_0x55cbce[_0x82f6('0x3')]),_0x55cbce);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x1e'),_0x55cbce['uniqueid'],agents[_0x55cbce['destuniqueid']][_0x82f6('0x5')],_0x55cbce[_0x82f6('0x14')]));agents[_0x55cbce['destuniqueid']]['agentringnoanswer']=!![];agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x1f')]=utils['now']();agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x7')]='timeout';agents[_0x55cbce['destuniqueid']][_0x82f6('0x20')]='timeout';agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x21')]=_0x55cbce['ringtime']?parseInt(_0x55cbce[_0x82f6('0x22')])/0x3e8:0x0;agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x23')]=0x0;unanswered[_0x82f6('0x24')](_0x55cbce['destuniqueid']);}}catch(_0x40a071){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x25'),_0x55cbce[_0x82f6('0x3')]),_0x40a071);}};exports[_0x82f6('0x26')]=function(_0x27e473){try{_[_0x82f6('0x27')](agents,function(_0x1e1aa4,_0x402449){if(_0x1e1aa4[_0x82f6('0x3')]==_0x27e473[_0x82f6('0x3')]&&!_[_0x82f6('0x28')](unanswered,_0x1e1aa4[_0x82f6('0x14')])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x27e473);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x2a'),_0x27e473[_0x82f6('0x3')],_0x1e1aa4[_0x82f6('0x5')],_0x1e1aa4[_0x82f6('0x14')]));_0x1e1aa4[_0x82f6('0x1c')]=!![];_0x1e1aa4[_0x82f6('0x1f')]=utils[_0x82f6('0x2b')]();_0x1e1aa4[_0x82f6('0x7')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x20')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x21')]=_0x27e473[_0x82f6('0x21')];_0x1e1aa4['talktime']=0x0;writeDB(_0x1e1aa4);}});}catch(_0x13a409){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x13a409);}};exports[_0x82f6('0x2d')]=function(_0x34c2f1){try{if(agents[_0x34c2f1[_0x82f6('0x14')]]){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x34c2f1);utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x34c2f1[_0x82f6('0x3')],agents[_0x34c2f1['destuniqueid']]['membername'],_0x34c2f1[_0x82f6('0x14')]));agents[_0x34c2f1[_0x82f6('0x14')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x17')]=_0x34c2f1['connectedlinenum'];agents[_0x34c2f1[_0x82f6('0x14')]]['connectedlinename']=_0x34c2f1[_0x82f6('0x18')];agents[_0x34c2f1['destuniqueid']][_0x82f6('0x21')]=_0x34c2f1['ringtime'];agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x7')]='connect';_[_0x82f6('0x27')](agents,function(_0x368c11,_0x3e7c53){if(_0x368c11[_0x82f6('0x14')]!=_0x34c2f1['destuniqueid']&&_0x368c11[_0x82f6('0x3')]==_0x34c2f1[_0x82f6('0x3')]){_0x368c11[_0x82f6('0x23')]=0x0;_0x368c11[_0x82f6('0x21')]=_0x34c2f1['ringtime'];_0x368c11[_0x82f6('0x1c')]=!![];_0x368c11[_0x82f6('0x1f')]=utils['now']();_0x368c11[_0x82f6('0x7')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x20')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x30')]=_0x34c2f1['destuniqueid'];_0x368c11[_0x82f6('0x31')]=_0x34c2f1['membername'];writeDB(_0x368c11);}});}}catch(_0x139614){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x139614);}};exports[_0x82f6('0x32')]=function(_0x43fefc){try{if(!_['isNil'](agents[_0x43fefc[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc['uniqueid']),_0x43fefc);utils[_0x82f6('0x19')](util['format'](_0x82f6('0x34'),_0x43fefc[_0x82f6('0x3')],agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x5')],_0x43fefc[_0x82f6('0x14')]));agents[_0x43fefc[_0x82f6('0x14')]]['agentcomplete']=!![];agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')],agents[_0x43fefc['destuniqueid']][_0x82f6('0x37')]);agents[_0x43fefc[_0x82f6('0x14')]]['reason']=_0x43fefc[_0x82f6('0x20')];agents[_0x43fefc['destuniqueid']][_0x82f6('0x7')]='complete';writeDB(agents[_0x43fefc[_0x82f6('0x14')]]);}}catch(_0x31dec7){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc[_0x82f6('0x3')]),_0x31dec7);}};exports['blindtransfer']=function(_0x3cb1f0){try{if(!_[_0x82f6('0x1d')](agents[_0x3cb1f0['transfereruniqueid']])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x38'),_0x3cb1f0[_0x82f6('0x3')]),_0x3cb1f0);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x39'),_0x3cb1f0[_0x82f6('0x3')],agents[_0x3cb1f0[_0x82f6('0x3a')]]['membername'],agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3')]));agents[_0x3cb1f0[_0x82f6('0x3a')]][_0x82f6('0x3b')]=!![];agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3c')]=_0x82f6('0x3d');agents[_0x3cb1f0['transfereruniqueid']]['transferexten']=_0x3cb1f0['extension'];agents[_0x3cb1f0[_0x82f6('0x3a')]]['transferuniqueid']=agents[_0x3cb1f0[_0x82f6('0x3a')]]['uniqueid'];}}catch(_0x33c359){utils['error'](util[_0x82f6('0x2')]('[%s][agents][blindtransfer]',_0x3cb1f0[_0x82f6('0x3')]),_0x33c359);}};exports[_0x82f6('0x3e')]=function(_0x44de65){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x44de65);if(_0x44de65[_0x82f6('0x40')]==_0x44de65[_0x82f6('0x41')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65['secondtransfereruniqueid']])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x43')]]['membername']));agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x43')]]['transfertype']='ATTENDED';agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x45')];agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x40')];}if(_0x44de65[_0x82f6('0x47')]&&agents[_0x44de65[_0x82f6('0x47')]]){agents[_0x44de65[_0x82f6('0x47')]]['agententerreason']=0x1;transfers[_0x44de65[_0x82f6('0x47')]]=_[_0x82f6('0x48')](agents[_0x44de65[_0x82f6('0x47')]]);transfers[_0x44de65[_0x82f6('0x47')]]['calleridnum']=agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x47')]]['calleridname']=agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x47')]]['agentcalledAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x37')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65['transfereeuniqueid']][_0x82f6('0x4b')]=0x2;}}else if(_0x44de65[_0x82f6('0x43')]==_0x44de65[_0x82f6('0x4c')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65[_0x82f6('0x40')]])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x5')]));agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x40')]]['transfertype']=_0x82f6('0x4d');agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x4e')];agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x43')];}if(_0x44de65[_0x82f6('0x4f')]&&agents[_0x44de65['transfertargetuniqueid']]){agents[_0x44de65['transfertargetuniqueid']][_0x82f6('0x4b')]=0x1;transfers[_0x44de65[_0x82f6('0x4f')]]=_['clone'](agents[_0x44de65['transfertargetuniqueid']]);transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x49')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4a')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x15')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4b')]=0x2;}}}catch(_0x4ef838){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x4ef838);}};exports[_0x82f6('0x50')]=function(_0x192dc7){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x192dc7);if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7['uniqueid']][_0x82f6('0x20')]==='timeout'){if(_0x192dc7[_0x82f6('0x52')]==='21'){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=_0x82f6('0x53');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x53');}utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')],agents[_0x192dc7[_0x82f6('0x3')]]['lastevent']));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);var _0x443547=unanswered['indexOf'](_0x192dc7['uniqueid']);if(_0x443547>-0x1){unanswered[_0x82f6('0x54')](_0x443547,0x1);}}if(transfers[_0x192dc7[_0x82f6('0x3')]]){transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x35')]=utils['now']();transfers[_0x192dc7[_0x82f6('0x3')]]['talktime']=utils[_0x82f6('0x36')](transfers[_0x192dc7['uniqueid']][_0x82f6('0x35')],transfers[_0x192dc7['uniqueid']][_0x82f6('0x37')]);transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]='agent';transfers[_0x192dc7[_0x82f6('0x3')]]['lastevent']=_0x82f6('0x55');utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],transfers[_0x192dc7['uniqueid']]['reason'],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]));writeDB(transfers[_0x192dc7[_0x82f6('0x3')]],!![]);}if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];agents[_0x192dc7['uniqueid']][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x192dc7['uniqueid']][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x192dc7[_0x82f6('0x3')]]['agentcompleteAt'],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]);agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=agents[_0x192dc7['uniqueid']][_0x82f6('0x3b')]?_0x82f6('0x3b'):_0x82f6('0x56');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x55');utils['info'](util[_0x82f6('0x2')](_0x82f6('0x57'),_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7['uniqueid']][_0x82f6('0x20')],agents[_0x192dc7['uniqueid']][_0x82f6('0x7')]));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);}}catch(_0x425e33){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x425e33);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index d657dc6..9a9bf08 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 _0xf821=['startsWith','appdata','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','format','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','origtransfereruniqueid','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set'];(function(_0x1acfb9,_0x52bc80){var _0x1416e3=function(_0x1909d1){while(--_0x1909d1){_0x1acfb9['push'](_0x1acfb9['shift']());}};_0x1416e3(++_0x52bc80);}(_0xf821,0x1c5));var _0x1f82=function(_0x359318,_0x32bb33){_0x359318=_0x359318-0x0;var _0x5de84d=_0xf821[_0x359318];return _0x5de84d;};'use strict';var _=require(_0x1f82('0x0'));var util=require(_0x1f82('0x1'));var utils=require(_0x1f82('0x2'));var transfers=require(_0x1f82('0x3'));var dispositions=[_0x1f82('0x4'),_0x1f82('0x5'),_0x1f82('0x5'),_0x1f82('0x4'),_0x1f82('0x4'),'NO\x20ANSWER',_0x1f82('0x6'),_0x1f82('0x7'),'FAILED',_0x1f82('0x5'),_0x1f82('0x5')];var channels={};function writeDB(_0x122013){var _0x3abed9;if(transfers['blinds'][_0x122013[_0x1f82('0x8')]]){_0x3abed9=_0x122013[_0x1f82('0x8')];_0x122013[_0x1f82('0x8')]=transfers[_0x1f82('0x9')][_0x122013['uniqueid']][_0x1f82('0xa')];}utils[_0x1f82('0xb')](util['format'](_0x1f82('0xc'),_0x122013[_0x1f82('0x8')],_0x122013[_0x1f82('0xd')],_0x122013[_0x1f82('0xe')],_0x122013[_0x1f82('0xf')],_0x122013[_0x1f82('0x10')],_0x122013['calleridnum'],_0x122013['connectedlinenum'],_0x122013['lastevent']));if(_0x122013[_0x1f82('0x11')]){utils[_0x1f82('0x12')](_0x122013[_0x1f82('0x11')])['then'](function(_0x4683f4){if(_0x4683f4){_0x122013[_0x1f82('0x13')]=_0x4683f4['id'];}utils[_0x1f82('0x14')](_0x1f82('0x15'),_0x122013);});}else{utils['request'](_0x1f82('0x15'),_0x122013);}if(channels[_0x122013[_0x1f82('0x8')]]){delete channels[_0x122013[_0x1f82('0x8')]];}else if(_0x3abed9&&channels[_0x3abed9]){delete transfers[_0x1f82('0x9')][_0x3abed9];delete channels[_0x3abed9];}}exports[_0x1f82('0x16')]=function(_0x3ce887){try{utils[_0x1f82('0x17')](util[_0x1f82('0x18')]('[%s][calls][newchannel]',_0x3ce887['uniqueid']),_0x3ce887);if(_0x3ce887[_0x1f82('0x8')]==_0x3ce887[_0x1f82('0x19')]&&_0x3ce887[_0x1f82('0xd')]!=_0x1f82('0x1a')){utils[_0x1f82('0xb')](util[_0x1f82('0x18')](_0x1f82('0x1b'),_0x3ce887[_0x1f82('0x8')],_0x3ce887[_0x1f82('0x1c')],_0x3ce887[_0x1f82('0x1d')]));channels[_0x3ce887['uniqueid']]={'uniqueid':_0x3ce887[_0x1f82('0x8')],'accountcode':_0x3ce887[_0x1f82('0x11')],'source':_0x3ce887[_0x1f82('0x1e')],'destination':_0x3ce887[_0x1f82('0x1d')],'destinationcontext':_0x3ce887['context'],'channel':_0x3ce887[_0x1f82('0xd')],'starttime':utils[_0x1f82('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1f82('0x4'),'amaflags':_0x1f82('0x20')};}}catch(_0x400e7d){utils[_0x1f82('0x21')](util[_0x1f82('0x18')]('[%s][calls][newchannel]',_0x3ce887[_0x1f82('0x8')]),_0x400e7d);}};exports[_0x1f82('0x22')]=function(_0x2b10c6){try{utils[_0x1f82('0x17')](util[_0x1f82('0x18')](_0x1f82('0x23'),_0x2b10c6[_0x1f82('0x8')]),_0x2b10c6);if(!_[_0x1f82('0x24')](channels[_0x2b10c6[_0x1f82('0x8')]])&&_0x2b10c6['channelstate']==0x6){utils[_0x1f82('0xb')](util[_0x1f82('0x18')](_0x1f82('0x25'),_0x2b10c6[_0x1f82('0x8')],_0x2b10c6[_0x1f82('0x1c')],_0x2b10c6[_0x1f82('0xd')]));if(_['isNil'](channels[_0x2b10c6[_0x1f82('0x8')]]['systemanswertime'])){channels[_0x2b10c6[_0x1f82('0x8')]][_0x1f82('0x26')]=utils[_0x1f82('0x1f')]();}}else if(!_['isNil'](channels[_0x2b10c6[_0x1f82('0x19')]])&&_0x2b10c6[_0x1f82('0x27')]==0x6&&_0x2b10c6[_0x1f82('0x1c')]!=_0x1f82('0x28')){utils[_0x1f82('0xb')](util['format'](_0x1f82('0x29'),_0x2b10c6[_0x1f82('0x8')],_0x2b10c6['linkedid'],_0x2b10c6['context'],_0x2b10c6[_0x1f82('0xd')]));channels[_0x2b10c6[_0x1f82('0x19')]][_0x1f82('0x11')]=_0x2b10c6[_0x1f82('0x11')];channels[_0x2b10c6[_0x1f82('0x19')]][_0x1f82('0x2a')]=_0x2b10c6['channel'];if(_[_0x1f82('0x24')](channels[_0x2b10c6['linkedid']][_0x1f82('0x2b')])){channels[_0x2b10c6['linkedid']]['answertime']=utils['now']();}channels[_0x2b10c6[_0x1f82('0x19')]]['disposition']=dispositions[_[_0x1f82('0x2c')](_0x2b10c6[_0x1f82('0x27')])]||_0x1f82('0x6');}}catch(_0x1442ac){utils[_0x1f82('0x21')](util[_0x1f82('0x18')](_0x1f82('0x23'),_0x2b10c6[_0x1f82('0x8')]),_0x1442ac);}};exports[_0x1f82('0x2d')]=function(_0x136b68){try{if(!_['isNil'](channels[_0x136b68[_0x1f82('0x8')]])){utils[_0x1f82('0x17')](util[_0x1f82('0x18')]('[%s][calls][hangup]',_0x136b68[_0x1f82('0x8')]),_0x136b68);if(_[_0x1f82('0x24')](channels[_0x136b68[_0x1f82('0x8')]]['callerid'])){channels[_0x136b68[_0x1f82('0x8')]][_0x1f82('0x2e')]=_0x136b68[_0x1f82('0x2f')]+'\x20<'+_0x136b68['calleridnum']+'>';}utils[_0x1f82('0xb')](util['format'](_0x1f82('0x30'),_0x136b68[_0x1f82('0x8')],channels[_0x136b68['uniqueid']]['callerid'],_0x136b68['cause-txt']));channels[_0x136b68['uniqueid']][_0x1f82('0x31')]=utils[_0x1f82('0x1f')]();channels[_0x136b68[_0x1f82('0x8')]][_0x1f82('0x32')]=utils[_0x1f82('0x33')](channels[_0x136b68['uniqueid']][_0x1f82('0x31')],channels[_0x136b68[_0x1f82('0x8')]][_0x1f82('0x34')]);channels[_0x136b68[_0x1f82('0x8')]][_0x1f82('0x35')]=channels[_0x136b68[_0x1f82('0x8')]]['answertime']?utils[_0x1f82('0x33')](channels[_0x136b68['uniqueid']][_0x1f82('0x31')],channels[_0x136b68[_0x1f82('0x8')]][_0x1f82('0x2b')]):0x0;writeDB(channels[_0x136b68[_0x1f82('0x8')]]);}}catch(_0x19af60){utils[_0x1f82('0x21')](util[_0x1f82('0x18')](_0x1f82('0x36'),_0x136b68['uniqueid']),_0x19af60);}};exports[_0x1f82('0x37')]=function(_0x2a9de5){try{if(!_[_0x1f82('0x24')](channels[_0x2a9de5[_0x1f82('0x38')]])){utils[_0x1f82('0x17')](util[_0x1f82('0x18')](_0x1f82('0x39'),_0x2a9de5['origtransfereruniqueid']),_0x2a9de5);if(channels[_0x2a9de5['localtwolinkedid']]['channel']==_0x2a9de5[_0x1f82('0x3a')]){utils['info'](util['format'](_0x1f82('0x3b'),_0x2a9de5['origtransfereruniqueid'],_0x2a9de5[_0x1f82('0x38')],_0x2a9de5[_0x1f82('0x3c')]));channels[_0x2a9de5[_0x1f82('0x38')]][_0x1f82('0x2a')]=_0x2a9de5[_0x1f82('0x3c')];channels[_0x2a9de5['localtwolinkedid']][_0x1f82('0x3d')]=_0x1f82('0x3e');}else if(channels[_0x2a9de5['localtwolinkedid']][_0x1f82('0xd')]=_0x2a9de5[_0x1f82('0x3f')]){utils[_0x1f82('0xb')](util['format'](_0x1f82('0x3b'),_0x2a9de5['origtransfereruniqueid'],_0x2a9de5[_0x1f82('0x38')],_0x2a9de5[_0x1f82('0x40')]));channels[_0x2a9de5[_0x1f82('0x38')]][_0x1f82('0x2a')]=_0x2a9de5[_0x1f82('0x40')];channels[_0x2a9de5['localtwolinkedid']][_0x1f82('0x3d')]=_0x1f82('0x3e');}}}catch(_0x4a9c64){utils[_0x1f82('0x21')](util[_0x1f82('0x18')](_0x1f82('0x39'),_0x2a9de5[_0x1f82('0x41')]),_0x4a9c64);}};exports[_0x1f82('0x42')]=function(_0x4be709){try{if(!_[_0x1f82('0x24')](channels[_0x4be709[_0x1f82('0x8')]])){utils[_0x1f82('0x17')](util['format'](_0x1f82('0x43'),_0x4be709['uniqueid']),_0x4be709);channels[_0x4be709[_0x1f82('0x8')]]['musiconholdstartAt']=utils['now']();utils[_0x1f82('0xb')](util[_0x1f82('0x18')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4be709[_0x1f82('0x8')],channels[_0x4be709[_0x1f82('0x8')]][_0x1f82('0x44')]));}}catch(_0x6bdbce){utils[_0x1f82('0x21')](util['format'](_0x1f82('0x43'),_0x4be709[_0x1f82('0x8')]),_0x6bdbce);}};exports['musiconholdstop']=function(_0x2c60fe){try{if(!_[_0x1f82('0x24')](channels[_0x2c60fe[_0x1f82('0x8')]])){utils[_0x1f82('0x17')](util[_0x1f82('0x18')](_0x1f82('0x45'),_0x2c60fe[_0x1f82('0x8')]),_0x2c60fe);if(!_[_0x1f82('0x24')](channels[_0x2c60fe[_0x1f82('0x8')]][_0x1f82('0x44')])){channels[_0x2c60fe[_0x1f82('0x8')]][_0x1f82('0x46')]+=utils[_0x1f82('0x33')](utils[_0x1f82('0x1f')](),channels[_0x2c60fe['uniqueid']][_0x1f82('0x44')]);utils[_0x1f82('0xb')](util[_0x1f82('0x18')](_0x1f82('0x47'),_0x2c60fe[_0x1f82('0x8')],channels[_0x2c60fe['uniqueid']][_0x1f82('0x46')]));delete channels[_0x2c60fe[_0x1f82('0x8')]][_0x1f82('0x44')];}}}catch(_0x4d6a02){utils[_0x1f82('0x21')](util[_0x1f82('0x18')](_0x1f82('0x45'),_0x2c60fe[_0x1f82('0x8')]),_0x4d6a02);}};exports[_0x1f82('0x48')]=function(_0x4e0e4f){try{if(!_[_0x1f82('0x24')](channels[_0x4e0e4f['uniqueid']])){utils[_0x1f82('0x17')](util[_0x1f82('0x18')](_0x1f82('0x49'),_0x4e0e4f[_0x1f82('0x8')]),_0x4e0e4f);if(!_[_0x1f82('0x24')](_0x4e0e4f['variable'][_0x1f82('0x4a')])){utils['info'](util[_0x1f82('0x18')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x4e0e4f[_0x1f82('0x8')],_0x4e0e4f[_0x1f82('0x4b')]));channels[_0x4e0e4f[_0x1f82('0x8')]][_0x1f82('0x4c')]=_0x4e0e4f['value'];}if(!_[_0x1f82('0x24')](_0x4e0e4f[_0x1f82('0x4d')][_0x1f82('0x4e')])){utils[_0x1f82('0xb')](util[_0x1f82('0x18')](_0x1f82('0x4f'),_0x4e0e4f[_0x1f82('0x8')],_0x4e0e4f[_0x1f82('0x4b')]));channels[_0x4e0e4f['uniqueid']]['destination']=_0x4e0e4f[_0x1f82('0x4b')];channels[_0x4e0e4f[_0x1f82('0x8')]][_0x1f82('0x2e')]='\x22'+_0x4e0e4f[_0x1f82('0x4b')]+_0x1f82('0x50')+_0x4e0e4f['value']+'>';}if(!_[_0x1f82('0x24')](_0x4e0e4f['variable'][_0x1f82('0x51')])||!_['isNil'](_0x4e0e4f['variable'][_0x1f82('0x52')])){utils['info'](util[_0x1f82('0x18')](_0x1f82('0x53'),_0x4e0e4f[_0x1f82('0x8')],!_[_0x1f82('0x24')](_0x4e0e4f[_0x1f82('0x4d')]['xmd-callerid-preview'])?'xmd-callerid-preview':_0x1f82('0x52'),_0x4e0e4f[_0x1f82('0x4b')]));channels[_0x4e0e4f[_0x1f82('0x8')]][_0x1f82('0x2e')]=_0x4e0e4f[_0x1f82('0x4b')];}if(!_[_0x1f82('0x24')](_0x4e0e4f[_0x1f82('0x4d')][_0x1f82('0x54')])||!_['isNil'](_0x4e0e4f['variable']['xmcs-queue'])){utils[_0x1f82('0xb')](util[_0x1f82('0x18')](_0x1f82('0x53'),_0x4e0e4f['uniqueid'],!_[_0x1f82('0x24')](_0x4e0e4f[_0x1f82('0x4d')][_0x1f82('0x54')])?'xmd-queue':_0x1f82('0x55'),_0x4e0e4f['value']));channels[_0x4e0e4f[_0x1f82('0x8')]]['lastapplication']=_0x1f82('0x56');channels[_0x4e0e4f[_0x1f82('0x8')]][_0x1f82('0x57')]=_0x4e0e4f[_0x1f82('0x4b')];channels[_0x4e0e4f[_0x1f82('0x8')]][_0x1f82('0xe')]=!![];}if(!_[_0x1f82('0x24')](_0x4e0e4f[_0x1f82('0x4d')]['xmd-contactid'])){utils[_0x1f82('0xb')](util[_0x1f82('0x18')](_0x1f82('0x58'),_0x4e0e4f[_0x1f82('0x8')],_0x4e0e4f['value']));channels[_0x4e0e4f[_0x1f82('0x8')]][_0x1f82('0x59')]=_0x4e0e4f[_0x1f82('0x4b')];}if(!_[_0x1f82('0x24')](_0x4e0e4f[_0x1f82('0x4d')][_0x1f82('0x5a')])){utils[_0x1f82('0xb')](util[_0x1f82('0x18')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4e0e4f[_0x1f82('0x8')],_0x4e0e4f[_0x1f82('0x4b')]));channels[_0x4e0e4f[_0x1f82('0x8')]][_0x1f82('0x5b')]=_0x4e0e4f[_0x1f82('0x4b')];}if(!_[_0x1f82('0x24')](_0x4e0e4f[_0x1f82('0x4d')][_0x1f82('0x5c')])){utils[_0x1f82('0xb')](util[_0x1f82('0x18')](_0x1f82('0x5d'),_0x4e0e4f[_0x1f82('0x8')],_0x4e0e4f['value']));channels[_0x4e0e4f[_0x1f82('0x8')]][_0x1f82('0x5e')]=_0x4e0e4f[_0x1f82('0x4b')];}if(!_[_0x1f82('0x24')](_0x4e0e4f[_0x1f82('0x4d')][_0x1f82('0x5f')])){utils[_0x1f82('0xb')](util[_0x1f82('0x18')](_0x1f82('0x60'),_0x4e0e4f[_0x1f82('0x8')],_0x4e0e4f[_0x1f82('0x4b')]));channels[_0x4e0e4f[_0x1f82('0x8')]]['sipcallid']=_0x4e0e4f['value'];}}}catch(_0x31f597){utils[_0x1f82('0x21')](util[_0x1f82('0x18')](_0x1f82('0x49'),_0x4e0e4f[_0x1f82('0x8')]),_0x31f597);}};exports['newexten']=function(_0x12a00d){try{if(!_['isNil'](channels[_0x12a00d[_0x1f82('0x8')]])){utils[_0x1f82('0x17')](util[_0x1f82('0x18')](_0x1f82('0x61'),_0x12a00d[_0x1f82('0x8')]),_0x12a00d);utils[_0x1f82('0xb')](util[_0x1f82('0x18')](_0x1f82('0x62'),_0x12a00d['uniqueid'],_0x12a00d[_0x1f82('0x63')],_0x12a00d['appdata']));if(_0x12a00d[_0x1f82('0x63')][_0x1f82('0x64')]()==_0x1f82('0x65')&&_[_0x1f82('0x66')](_0x12a00d[_0x1f82('0x67')][_0x1f82('0x64')](),'cdr')){var _0x533bc7=_0x12a00d[_0x1f82('0x67')]['split']('=');var _0x9e704=_0x533bc7[0x0][_0x1f82('0x68')](_0x533bc7[0x0][_0x1f82('0x69')]('(')+0x1,_0x533bc7[0x0]['lastIndexOf'](')'));var _0x26d246=_0x533bc7[0x1];channels[_0x12a00d[_0x1f82('0x8')]][_0x9e704]=_0x26d246;}if(!_[_0x1f82('0x6a')](['hangup',_0x1f82('0x6b'),_0x1f82('0x6c'),_0x1f82('0x65'),_0x1f82('0x6d')],_0x12a00d['application'][_0x1f82('0x64')]())){channels[_0x12a00d['uniqueid']][_0x1f82('0x6e')]=_0x12a00d[_0x1f82('0x63')];channels[_0x12a00d[_0x1f82('0x8')]][_0x1f82('0x57')]=_0x12a00d[_0x1f82('0x67')];}}}catch(_0x4856bd){utils[_0x1f82('0x21')](util['format']('[%s][calls][newexten]',_0x12a00d[_0x1f82('0x8')]),_0x4856bd);}}; \ No newline at end of file +var _0x39b7=['sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','startsWith','split','substring','lastIndexOf','includes','hangup','noop','execif','set','gotoif','lastapplication','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','destinationchannel','answertime','disposition','toNumber','channelstate','error','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','diffTime','endtime','starttime','billableseconds','[%s][calls][attendedtransfer]','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x229871,_0x3e45fc){var _0x126b33=function(_0x28e262){while(--_0x28e262){_0x229871['push'](_0x229871['shift']());}};_0x126b33(++_0x3e45fc);}(_0x39b7,0x15c));var _0x739b=function(_0x4e9f5d,_0x391085){_0x4e9f5d=_0x4e9f5d-0x0;var _0x162e63=_0x39b7[_0x4e9f5d];return _0x162e63;};'use strict';var _=require('lodash');var util=require(_0x739b('0x0'));var utils=require(_0x739b('0x1'));var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0x739b('0x2'),_0x739b('0x2'),_0x739b('0x3'),_0x739b('0x3'),'NO\x20ANSWER',_0x739b('0x4'),_0x739b('0x5'),'FAILED',_0x739b('0x2'),_0x739b('0x2')];var channels={};function writeDB(_0x27b7a5){var _0x4961c9;if(transfers[_0x739b('0x6')][_0x27b7a5['uniqueid']]){_0x4961c9=_0x27b7a5['uniqueid'];_0x27b7a5[_0x739b('0x7')]=transfers[_0x739b('0x6')][_0x27b7a5['uniqueid']][_0x739b('0x8')];}utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0xb'),_0x27b7a5[_0x739b('0x7')],_0x27b7a5[_0x739b('0xc')],_0x27b7a5[_0x739b('0xd')],_0x27b7a5[_0x739b('0xe')],_0x27b7a5[_0x739b('0xf')],_0x27b7a5[_0x739b('0x10')],_0x27b7a5[_0x739b('0x11')],_0x27b7a5[_0x739b('0x12')]));if(_0x27b7a5[_0x739b('0x13')]){utils[_0x739b('0x14')](_0x27b7a5['accountcode'])['then'](function(_0x4489c7){if(_0x4489c7){_0x27b7a5['UserId']=_0x4489c7['id'];}utils[_0x739b('0x15')](_0x739b('0x16'),_0x27b7a5);});}else{utils[_0x739b('0x15')](_0x739b('0x16'),_0x27b7a5);}if(channels[_0x27b7a5[_0x739b('0x7')]]){delete channels[_0x27b7a5[_0x739b('0x7')]];}else if(_0x4961c9&&channels[_0x4961c9]){delete transfers[_0x739b('0x6')][_0x4961c9];delete channels[_0x4961c9];}}exports[_0x739b('0x17')]=function(_0x23ff30){try{utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x19'),_0x23ff30[_0x739b('0x7')]),_0x23ff30);if(_0x23ff30[_0x739b('0x7')]==_0x23ff30[_0x739b('0x1a')]&&_0x23ff30[_0x739b('0xc')]!=_0x739b('0x1b')){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x1c'),_0x23ff30[_0x739b('0x7')],_0x23ff30['context'],_0x23ff30['exten']));channels[_0x23ff30[_0x739b('0x7')]]={'uniqueid':_0x23ff30[_0x739b('0x7')],'accountcode':_0x23ff30[_0x739b('0x13')],'source':_0x23ff30[_0x739b('0x10')],'destination':_0x23ff30[_0x739b('0x1d')],'destinationcontext':_0x23ff30[_0x739b('0x1e')],'channel':_0x23ff30[_0x739b('0xc')],'starttime':utils[_0x739b('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x739b('0x20')};}}catch(_0x4c0843){utils['error'](util['format'](_0x739b('0x19'),_0x23ff30[_0x739b('0x7')]),_0x4c0843);}};exports[_0x739b('0x21')]=function(_0x338d44){try{utils[_0x739b('0x18')](util['format'](_0x739b('0x22'),_0x338d44['uniqueid']),_0x338d44);if(!_[_0x739b('0x23')](channels[_0x338d44[_0x739b('0x7')]])&&_0x338d44['channelstate']==0x6){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x24'),_0x338d44[_0x739b('0x7')],_0x338d44[_0x739b('0x1e')],_0x338d44[_0x739b('0xc')]));if(_[_0x739b('0x23')](channels[_0x338d44[_0x739b('0x7')]][_0x739b('0x25')])){channels[_0x338d44['uniqueid']][_0x739b('0x25')]=utils[_0x739b('0x1f')]();}}else if(!_[_0x739b('0x23')](channels[_0x338d44[_0x739b('0x1a')]])&&_0x338d44['channelstate']==0x6&&_0x338d44['context']!='transfer'){utils[_0x739b('0x9')](util[_0x739b('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x338d44['uniqueid'],_0x338d44[_0x739b('0x1a')],_0x338d44[_0x739b('0x1e')],_0x338d44[_0x739b('0xc')]));channels[_0x338d44[_0x739b('0x1a')]][_0x739b('0x13')]=_0x338d44[_0x739b('0x13')];channels[_0x338d44[_0x739b('0x1a')]][_0x739b('0x26')]=_0x338d44[_0x739b('0xc')];if(_[_0x739b('0x23')](channels[_0x338d44['linkedid']][_0x739b('0x27')])){channels[_0x338d44[_0x739b('0x1a')]][_0x739b('0x27')]=utils[_0x739b('0x1f')]();}channels[_0x338d44[_0x739b('0x1a')]][_0x739b('0x28')]=dispositions[_[_0x739b('0x29')](_0x338d44[_0x739b('0x2a')])]||_0x739b('0x4');}}catch(_0x3fa00d){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x22'),_0x338d44[_0x739b('0x7')]),_0x3fa00d);}};exports['hangup']=function(_0x5b9503){try{if(!_['isNil'](channels[_0x5b9503[_0x739b('0x7')]])){utils[_0x739b('0x18')](util['format'](_0x739b('0x2c'),_0x5b9503[_0x739b('0x7')]),_0x5b9503);if(_[_0x739b('0x23')](channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x2d')])){channels[_0x5b9503['uniqueid']][_0x739b('0x2d')]=_0x5b9503[_0x739b('0x2e')]+'\x20<'+_0x5b9503['calleridnum']+'>';}utils['info'](util[_0x739b('0xa')](_0x739b('0x2f'),_0x5b9503['uniqueid'],channels[_0x5b9503[_0x739b('0x7')]]['callerid'],_0x5b9503[_0x739b('0x30')]));channels[_0x5b9503[_0x739b('0x7')]]['endtime']=utils[_0x739b('0x1f')]();channels[_0x5b9503['uniqueid']]['duration']=utils[_0x739b('0x31')](channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x32')],channels[_0x5b9503['uniqueid']][_0x739b('0x33')]);channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x34')]=channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x27')]?utils[_0x739b('0x31')](channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x32')],channels[_0x5b9503['uniqueid']][_0x739b('0x27')]):0x0;writeDB(channels[_0x5b9503[_0x739b('0x7')]]);}}catch(_0x552f1f){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x2c'),_0x5b9503['uniqueid']),_0x552f1f);}};exports['attendedtransfer']=function(_0x5324eb){try{if(!_['isNil'](channels[_0x5324eb['localtwolinkedid']])){utils['debug'](util['format'](_0x739b('0x35'),_0x5324eb['origtransfereruniqueid']),_0x5324eb);if(channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0xc')]==_0x5324eb[_0x739b('0x37')]){utils[_0x739b('0x9')](util['format'](_0x739b('0x38'),_0x5324eb[_0x739b('0x39')],_0x5324eb[_0x739b('0x36')],_0x5324eb[_0x739b('0x3a')]));channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0x26')]=_0x5324eb[_0x739b('0x3a')];channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0x3b')]=_0x739b('0x3c');}else if(channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0xc')]=_0x5324eb[_0x739b('0x3d')]){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x38'),_0x5324eb[_0x739b('0x39')],_0x5324eb[_0x739b('0x36')],_0x5324eb[_0x739b('0x3e')]));channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0x26')]=_0x5324eb['origtransfererchannel'];channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0x3b')]=_0x739b('0x3c');}}}catch(_0x388334){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x35'),_0x5324eb[_0x739b('0x39')]),_0x388334);}};exports[_0x739b('0x3f')]=function(_0x8ec20){try{if(!_['isNil'](channels[_0x8ec20[_0x739b('0x7')]])){utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x40'),_0x8ec20[_0x739b('0x7')]),_0x8ec20);channels[_0x8ec20[_0x739b('0x7')]][_0x739b('0x41')]=utils[_0x739b('0x1f')]();utils[_0x739b('0x9')](util['format'](_0x739b('0x42'),_0x8ec20['uniqueid'],channels[_0x8ec20[_0x739b('0x7')]][_0x739b('0x41')]));}}catch(_0x3a09ae){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x40'),_0x8ec20[_0x739b('0x7')]),_0x3a09ae);}};exports[_0x739b('0x43')]=function(_0xd8b6c9){try{if(!_[_0x739b('0x23')](channels[_0xd8b6c9[_0x739b('0x7')]])){utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x44'),_0xd8b6c9[_0x739b('0x7')]),_0xd8b6c9);if(!_[_0x739b('0x23')](channels[_0xd8b6c9[_0x739b('0x7')]][_0x739b('0x41')])){channels[_0xd8b6c9[_0x739b('0x7')]][_0x739b('0x45')]+=utils[_0x739b('0x31')](utils[_0x739b('0x1f')](),channels[_0xd8b6c9[_0x739b('0x7')]]['musiconholdstartAt']);utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x46'),_0xd8b6c9['uniqueid'],channels[_0xd8b6c9[_0x739b('0x7')]][_0x739b('0x45')]));delete channels[_0xd8b6c9['uniqueid']][_0x739b('0x41')];}}}catch(_0x9d728){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x44'),_0xd8b6c9['uniqueid']),_0x9d728);}};exports['varset']=function(_0x877d5c){try{if(!_[_0x739b('0x23')](channels[_0x877d5c['uniqueid']])){utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x47'),_0x877d5c[_0x739b('0x7')]),_0x877d5c);if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')]['xmd-originatecalleridnum'])){utils[_0x739b('0x9')](util['format'](_0x739b('0x49'),_0x877d5c[_0x739b('0x7')],_0x877d5c['value']));channels[_0x877d5c[_0x739b('0x7')]]['source']=_0x877d5c[_0x739b('0x4a')];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x4b')])){utils[_0x739b('0x9')](util[_0x739b('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x877d5c[_0x739b('0x7')],_0x877d5c['value']));channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x4c')]=_0x877d5c[_0x739b('0x4a')];channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x2d')]='\x22'+_0x877d5c[_0x739b('0x4a')]+_0x739b('0x4d')+_0x877d5c[_0x739b('0x4a')]+'>';}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x4e')])||!_[_0x739b('0x23')](_0x877d5c['variable'][_0x739b('0x4f')])){utils['info'](util[_0x739b('0xa')](_0x739b('0x50'),_0x877d5c[_0x739b('0x7')],!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x4e')])?_0x739b('0x4e'):'xmd-callerid',_0x877d5c[_0x739b('0x4a')]));channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x2d')]=_0x877d5c[_0x739b('0x4a')];}if(!_['isNil'](_0x877d5c['variable']['xmd-queue'])||!_['isNil'](_0x877d5c[_0x739b('0x48')][_0x739b('0x51')])){utils['info'](util['format'](_0x739b('0x50'),_0x877d5c[_0x739b('0x7')],!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x52')])?_0x739b('0x52'):_0x739b('0x51'),_0x877d5c['value']));channels[_0x877d5c[_0x739b('0x7')]]['lastapplication']='Queue';channels[_0x877d5c['uniqueid']][_0x739b('0x53')]=_0x877d5c[_0x739b('0x4a')];channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0xd')]=!![];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x54')])){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x55'),_0x877d5c[_0x739b('0x7')],_0x877d5c[_0x739b('0x4a')]));channels[_0x877d5c['uniqueid']][_0x739b('0x56')]=_0x877d5c[_0x739b('0x4a')];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x57')])){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x58'),_0x877d5c[_0x739b('0x7')],_0x877d5c['value']));channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x59')]=_0x877d5c[_0x739b('0x4a')];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x5a')])){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x5b'),_0x877d5c[_0x739b('0x7')],_0x877d5c[_0x739b('0x4a')]));channels[_0x877d5c[_0x739b('0x7')]]['routeid']=_0x877d5c['value'];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x5c')])){utils['info'](util[_0x739b('0xa')](_0x739b('0x5d'),_0x877d5c[_0x739b('0x7')],_0x877d5c[_0x739b('0x4a')]));channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x5c')]=_0x877d5c[_0x739b('0x4a')];}}}catch(_0x52f471){utils['error'](util['format'](_0x739b('0x47'),_0x877d5c[_0x739b('0x7')]),_0x52f471);}};exports[_0x739b('0x5e')]=function(_0x4a0d66){try{if(!_[_0x739b('0x23')](channels[_0x4a0d66['uniqueid']])){utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x5f'),_0x4a0d66['uniqueid']),_0x4a0d66);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x4a0d66[_0x739b('0x7')],_0x4a0d66[_0x739b('0x60')],_0x4a0d66[_0x739b('0x61')]));if(_0x4a0d66[_0x739b('0x60')][_0x739b('0x62')]()=='set'&&_[_0x739b('0x63')](_0x4a0d66[_0x739b('0x61')][_0x739b('0x62')](),'cdr')){var _0x5ccf18=_0x4a0d66[_0x739b('0x61')][_0x739b('0x64')]('=');var _0x471124=_0x5ccf18[0x0][_0x739b('0x65')](_0x5ccf18[0x0]['lastIndexOf']('(')+0x1,_0x5ccf18[0x0][_0x739b('0x66')](')'));var _0x1139d4=_0x5ccf18[0x1];channels[_0x4a0d66[_0x739b('0x7')]][_0x471124]=_0x1139d4;}if(!_[_0x739b('0x67')]([_0x739b('0x68'),_0x739b('0x69'),_0x739b('0x6a'),_0x739b('0x6b'),_0x739b('0x6c')],_0x4a0d66[_0x739b('0x60')][_0x739b('0x62')]())){channels[_0x4a0d66[_0x739b('0x7')]][_0x739b('0x6d')]=_0x4a0d66[_0x739b('0x60')];channels[_0x4a0d66[_0x739b('0x7')]][_0x739b('0x53')]=_0x4a0d66[_0x739b('0x61')];}}}catch(_0x3e85ad){utils[_0x739b('0x2b')](util['format']('[%s][calls][newexten]',_0x4a0d66[_0x739b('0x7')]),_0x3e85ad);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1111767..756a770 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 _0x1966=['[core]\x20close','managerevent','./utils','connect','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','info','[core]\x20fullybooted','error','close'];(function(_0x2633c7,_0x4db8b3){var _0xbb644=function(_0x3b63e0){while(--_0x3b63e0){_0x2633c7['push'](_0x2633c7['shift']());}};_0xbb644(++_0x4db8b3);}(_0x1966,0x10a));var _0x6196=function(_0xa9953,_0x20e16f){_0xa9953=_0xa9953-0x0;var _0x180d04=_0x1966[_0xa9953];return _0x180d04;};'use strict';var utils=require(_0x6196('0x0'));exports[_0x6196('0x1')]=function(){utils['info'](_0x6196('0x2'));};exports[_0x6196('0x3')]=function(){utils['info'](_0x6196('0x4'));};exports[_0x6196('0x5')]=function(){utils[_0x6196('0x6')](_0x6196('0x7'));};exports[_0x6196('0x8')]=function(_0x2f6ec5){utils[_0x6196('0x8')]('[core]\x20error',_0x2f6ec5);};exports[_0x6196('0x9')]=function(){utils['info'](_0x6196('0xa'));};exports[_0x6196('0xb')]=function(_0x12187c){}; \ No newline at end of file +var _0xcf7b=['[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20close','./utils','connect','info'];(function(_0xc4980e,_0x14d513){var _0x44b5e7=function(_0x1ab712){while(--_0x1ab712){_0xc4980e['push'](_0xc4980e['shift']());}};_0x44b5e7(++_0x14d513);}(_0xcf7b,0x14a));var _0xbcf7=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xcf7b[_0x1d1779];return _0x2377e9;};'use strict';var utils=require(_0xbcf7('0x0'));exports[_0xbcf7('0x1')]=function(){utils[_0xbcf7('0x2')](_0xbcf7('0x3'));};exports[_0xbcf7('0x4')]=function(){utils[_0xbcf7('0x2')](_0xbcf7('0x5'));};exports['fullybooted']=function(){utils[_0xbcf7('0x2')](_0xbcf7('0x6'));};exports[_0xbcf7('0x7')]=function(_0xb69aff){utils[_0xbcf7('0x7')]('[core]\x20error',_0xb69aff);};exports['close']=function(){utils[_0xbcf7('0x2')](_0xbcf7('0x8'));};exports['managerevent']=function(_0x1bfa41){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index a59fa08..0ba99de 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 _0x7556=['billableseconds','[%s][dials][hangup]','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','uniqueid','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','varset','[%s][dials][varset]','variable','outboundrouteid','value','assign','starttime','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','error','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','isNil','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','duration','diffTime','holdtime','endtime'];(function(_0x4ec1cc,_0x3bb957){var _0xc90313=function(_0x424d09){while(--_0x424d09){_0x4ec1cc['push'](_0x4ec1cc['shift']());}};_0xc90313(++_0x3bb957);}(_0x7556,0x1d6));var _0x6755=function(_0x31e159,_0x476ca2){_0x31e159=_0x31e159-0x0;var _0x5144c0=_0x7556[_0x31e159];return _0x5144c0;};'use strict';var _=require(_0x6755('0x0'));var util=require(_0x6755('0x1'));var utils=require(_0x6755('0x2'));var dials={};function writeDB(_0x36575b){utils['info'](util[_0x6755('0x3')](_0x6755('0x4'),_0x36575b['uniqueid'],_0x36575b[_0x6755('0x5')],_0x36575b[_0x6755('0x6')],_0x36575b[_0x6755('0x7')],_0x36575b['connectedlinenum'],_0x36575b[_0x6755('0x8')]));utils[_0x6755('0x9')](_0x6755('0xa'),_0x36575b);delete dials[_0x36575b['uniqueid']];}exports[_0x6755('0xb')]=function(_0x2af0ec){try{utils[_0x6755('0xc')](util[_0x6755('0x3')](_0x6755('0xd'),_0x2af0ec[_0x6755('0xe')]),_0x2af0ec);utils[_0x6755('0xf')](util[_0x6755('0x3')](_0x6755('0x10'),_0x2af0ec[_0x6755('0xe')],_0x2af0ec['application'],_0x2af0ec['appdata']));if(_0x2af0ec[_0x6755('0x11')][_0x6755('0x12')]()==_0x6755('0x13')&&_[_0x6755('0x14')](_0x2af0ec[_0x6755('0x15')][_0x6755('0x12')](),_0x6755('0x16'))){var _0x4cf418=_0x2af0ec[_0x6755('0x15')][_0x6755('0x17')]('=');dials[_0x2af0ec[_0x6755('0xe')]]={'routeId':_0x4cf418[0x1]};}}catch(_0x24e4ca){utils['error'](util[_0x6755('0x3')](_0x6755('0xd'),_0x2af0ec[_0x6755('0xe')]),_0x24e4ca);}};exports[_0x6755('0x18')]=function(_0x4c3a45){try{utils[_0x6755('0xc')](util['format'](_0x6755('0x19'),_0x4c3a45['uniqueid']),_0x4c3a45);if(!_['isNil'](_0x4c3a45[_0x6755('0x1a')][_0x6755('0x1b')])){utils['info'](util[_0x6755('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x4c3a45[_0x6755('0xe')],_0x4c3a45[_0x6755('0x1c')]));dials[_0x4c3a45[_0x6755('0xe')]]={'routeId':_0x4c3a45[_0x6755('0x1c')]};}}catch(_0x263fa8){utils['error'](util[_0x6755('0x3')]('[%s][dials][varset]',_0x4c3a45[_0x6755('0xe')]),_0x263fa8);}};exports['dialbegin']=function(_0x4bdcd4){try{if(!_['isNil'](dials[_0x4bdcd4[_0x6755('0xe')]])){utils[_0x6755('0xc')](util[_0x6755('0x3')]('[%s][dials][dialbegin]',_0x4bdcd4[_0x6755('0xe')]),_0x4bdcd4);dials[_0x4bdcd4[_0x6755('0xe')]]=_[_0x6755('0x1d')](dials[_0x4bdcd4[_0x6755('0xe')]],_0x4bdcd4);dials[_0x4bdcd4[_0x6755('0xe')]][_0x6755('0x1e')]=utils['now']();dials[_0x4bdcd4['uniqueid']][_0x6755('0x1f')]='called';utils[_0x6755('0xf')](util[_0x6755('0x3')](_0x6755('0x20'),_0x4bdcd4[_0x6755('0xe')],dials[_0x4bdcd4[_0x6755('0xe')]][_0x6755('0x1e')]));}}catch(_0x2a7b68){utils[_0x6755('0x21')](util[_0x6755('0x3')](_0x6755('0x22'),_0x4bdcd4[_0x6755('0xe')]),_0x2a7b68);}};exports[_0x6755('0x23')]=function(_0x14a28b){try{if(!_['isNil'](dials[_0x14a28b[_0x6755('0xe')]])){utils['debug'](util[_0x6755('0x3')](_0x6755('0x24'),_0x14a28b[_0x6755('0xe')]),_0x14a28b);dials[_0x14a28b[_0x6755('0xe')]][_0x6755('0x8')]=_0x14a28b[_0x6755('0x8')];if(_0x14a28b[_0x6755('0x8')]==_0x6755('0x25')){dials[_0x14a28b['uniqueid']]=_[_0x6755('0x1d')](dials[_0x14a28b[_0x6755('0xe')]],_0x14a28b);dials[_0x14a28b[_0x6755('0xe')]][_0x6755('0x26')]=utils[_0x6755('0x27')]();dials[_0x14a28b[_0x6755('0xe')]][_0x6755('0x1f')]=_0x6755('0x28');utils['info'](util[_0x6755('0x3')](_0x6755('0x29'),_0x14a28b[_0x6755('0xe')],_0x14a28b[_0x6755('0x8')],dials[_0x14a28b[_0x6755('0xe')]][_0x6755('0x26')]));}else{utils['info'](util[_0x6755('0x3')](_0x6755('0x2a'),_0x14a28b[_0x6755('0xe')],_0x14a28b[_0x6755('0x8')]));}}}catch(_0x21fd9){utils['error'](util[_0x6755('0x3')](_0x6755('0x24'),_0x14a28b[_0x6755('0xe')]),_0x21fd9);}};exports['hangup']=function(_0x2a1865){try{if(!_[_0x6755('0x2b')](dials[_0x2a1865[_0x6755('0xe')]])){utils[_0x6755('0xc')](util[_0x6755('0x3')]('[%s][dials][hangup]',_0x2a1865[_0x6755('0xe')]),_0x2a1865);utils[_0x6755('0xf')](util[_0x6755('0x3')](_0x6755('0x2c'),_0x2a1865[_0x6755('0xe')],_0x2a1865[_0x6755('0x7')],_0x2a1865['calleridname'],_0x2a1865[_0x6755('0x2d')]));dials[_0x2a1865['uniqueid']]=_[_0x6755('0x1d')](dials[_0x2a1865['uniqueid']],{'endtime':utils[_0x6755('0x27')](),'lastevent':'complete'});dials[_0x2a1865[_0x6755('0xe')]][_0x6755('0x2e')]=utils[_0x6755('0x2f')](dials[_0x2a1865['uniqueid']]['endtime'],dials[_0x2a1865['uniqueid']]['starttime']);dials[_0x2a1865[_0x6755('0xe')]][_0x6755('0x30')]=utils[_0x6755('0x2f')](dials[_0x2a1865[_0x6755('0xe')]][_0x6755('0x26')]||dials[_0x2a1865[_0x6755('0xe')]][_0x6755('0x31')],dials[_0x2a1865[_0x6755('0xe')]][_0x6755('0x1e')]);dials[_0x2a1865[_0x6755('0xe')]][_0x6755('0x32')]=dials[_0x2a1865[_0x6755('0xe')]]['answertime']?utils[_0x6755('0x2f')](dials[_0x2a1865['uniqueid']]['endtime'],dials[_0x2a1865[_0x6755('0xe')]]['answertime']):0x0;writeDB(dials[_0x2a1865[_0x6755('0xe')]]);}}catch(_0x2f0af9){utils[_0x6755('0x21')](util[_0x6755('0x3')](_0x6755('0x33'),_0x2a1865['uniqueid']),_0x2f0af9);}}; \ No newline at end of file +var _0x384c=['value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','error','dialend','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','[%s][dials][hangup]','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','connectedlinenum','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','split','varset','debug','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0xaf4af7,_0x6a8b6f){var _0x596009=function(_0x563e6f){while(--_0x563e6f){_0xaf4af7['push'](_0xaf4af7['shift']());}};_0x596009(++_0x6a8b6f);}(_0x384c,0xb8));var _0xc384=function(_0x2e3206,_0x31b698){_0x2e3206=_0x2e3206-0x0;var _0x283560=_0x384c[_0x2e3206];return _0x283560;};'use strict';var _=require(_0xc384('0x0'));var util=require(_0xc384('0x1'));var utils=require(_0xc384('0x2'));var dials={};function writeDB(_0xb85d72){utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0x5'),_0xb85d72[_0xc384('0x6')],_0xb85d72['channel'],_0xb85d72[_0xc384('0x7')],_0xb85d72['calleridnum'],_0xb85d72[_0xc384('0x8')],_0xb85d72['dialstatus']));utils['request'](_0xc384('0x9'),_0xb85d72);delete dials[_0xb85d72[_0xc384('0x6')]];}exports[_0xc384('0xa')]=function(_0x1c0ffd){try{utils['debug'](util[_0xc384('0x4')](_0xc384('0xb'),_0x1c0ffd['uniqueid']),_0x1c0ffd);utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0xc'),_0x1c0ffd[_0xc384('0x6')],_0x1c0ffd[_0xc384('0xd')],_0x1c0ffd[_0xc384('0xe')]));if(_0x1c0ffd['application']['toLowerCase']()=='set'&&_[_0xc384('0xf')](_0x1c0ffd[_0xc384('0xe')][_0xc384('0x10')](),'cdr(routeid)')){var _0x144621=_0x1c0ffd['appdata'][_0xc384('0x11')]('=');dials[_0x1c0ffd[_0xc384('0x6')]]={'routeId':_0x144621[0x1]};}}catch(_0x261091){utils['error'](util[_0xc384('0x4')](_0xc384('0xb'),_0x1c0ffd[_0xc384('0x6')]),_0x261091);}};exports[_0xc384('0x12')]=function(_0x3a7e4e){try{utils[_0xc384('0x13')](util[_0xc384('0x4')](_0xc384('0x14'),_0x3a7e4e['uniqueid']),_0x3a7e4e);if(!_[_0xc384('0x15')](_0x3a7e4e['variable'][_0xc384('0x16')])){utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0x17'),_0x3a7e4e[_0xc384('0x6')],_0x3a7e4e[_0xc384('0x18')]));dials[_0x3a7e4e[_0xc384('0x6')]]={'routeId':_0x3a7e4e[_0xc384('0x18')]};}}catch(_0x1d479c){utils['error'](util['format'](_0xc384('0x14'),_0x3a7e4e[_0xc384('0x6')]),_0x1d479c);}};exports[_0xc384('0x19')]=function(_0x101e95){try{if(!_[_0xc384('0x15')](dials[_0x101e95[_0xc384('0x6')]])){utils[_0xc384('0x13')](util[_0xc384('0x4')](_0xc384('0x1a'),_0x101e95[_0xc384('0x6')]),_0x101e95);dials[_0x101e95[_0xc384('0x6')]]=_[_0xc384('0x1b')](dials[_0x101e95[_0xc384('0x6')]],_0x101e95);dials[_0x101e95['uniqueid']][_0xc384('0x1c')]=utils[_0xc384('0x1d')]();dials[_0x101e95[_0xc384('0x6')]][_0xc384('0x1e')]=_0xc384('0x1f');utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0x20'),_0x101e95[_0xc384('0x6')],dials[_0x101e95[_0xc384('0x6')]][_0xc384('0x1c')]));}}catch(_0x575158){utils[_0xc384('0x21')](util[_0xc384('0x4')](_0xc384('0x1a'),_0x101e95[_0xc384('0x6')]),_0x575158);}};exports[_0xc384('0x22')]=function(_0x139f7c){try{if(!_[_0xc384('0x15')](dials[_0x139f7c[_0xc384('0x6')]])){utils[_0xc384('0x13')](util[_0xc384('0x4')]('[%s][dials][dialend]',_0x139f7c[_0xc384('0x6')]),_0x139f7c);dials[_0x139f7c['uniqueid']][_0xc384('0x23')]=_0x139f7c[_0xc384('0x23')];if(_0x139f7c['dialstatus']==_0xc384('0x24')){dials[_0x139f7c[_0xc384('0x6')]]=_['assign'](dials[_0x139f7c[_0xc384('0x6')]],_0x139f7c);dials[_0x139f7c[_0xc384('0x6')]][_0xc384('0x25')]=utils['now']();dials[_0x139f7c['uniqueid']][_0xc384('0x1e')]=_0xc384('0x26');utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0x27'),_0x139f7c['uniqueid'],_0x139f7c[_0xc384('0x23')],dials[_0x139f7c[_0xc384('0x6')]]['answertime']));}else{utils[_0xc384('0x3')](util['format'](_0xc384('0x28'),_0x139f7c['uniqueid'],_0x139f7c[_0xc384('0x23')]));}}}catch(_0x56ef96){utils[_0xc384('0x21')](util[_0xc384('0x4')]('[%s][dials][dialend]',_0x139f7c[_0xc384('0x6')]),_0x56ef96);}};exports[_0xc384('0x29')]=function(_0x146239){try{if(!_[_0xc384('0x15')](dials[_0x146239[_0xc384('0x6')]])){utils[_0xc384('0x13')](util[_0xc384('0x4')]('[%s][dials][hangup]',_0x146239[_0xc384('0x6')]),_0x146239);utils['info'](util[_0xc384('0x4')](_0xc384('0x2a'),_0x146239[_0xc384('0x6')],_0x146239[_0xc384('0x2b')],_0x146239[_0xc384('0x2c')],_0x146239[_0xc384('0x2d')]));dials[_0x146239[_0xc384('0x6')]]=_[_0xc384('0x1b')](dials[_0x146239[_0xc384('0x6')]],{'endtime':utils[_0xc384('0x1d')](),'lastevent':_0xc384('0x2e')});dials[_0x146239['uniqueid']][_0xc384('0x2f')]=utils[_0xc384('0x30')](dials[_0x146239['uniqueid']][_0xc384('0x31')],dials[_0x146239[_0xc384('0x6')]][_0xc384('0x1c')]);dials[_0x146239['uniqueid']][_0xc384('0x32')]=utils[_0xc384('0x30')](dials[_0x146239['uniqueid']][_0xc384('0x25')]||dials[_0x146239['uniqueid']][_0xc384('0x31')],dials[_0x146239['uniqueid']][_0xc384('0x1c')]);dials[_0x146239[_0xc384('0x6')]]['billableseconds']=dials[_0x146239['uniqueid']][_0xc384('0x25')]?utils['diffTime'](dials[_0x146239[_0xc384('0x6')]][_0xc384('0x31')],dials[_0x146239['uniqueid']][_0xc384('0x25')]):0x0;writeDB(dials[_0x146239[_0xc384('0x6')]]);}}catch(_0x48f95a){utils[_0xc384('0x21')](util[_0xc384('0x4')](_0xc384('0x33'),_0x146239[_0xc384('0x6')]),_0x48f95a);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 9c2f8ef..7da2051 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 _0xd054=['origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','util','asterisk','port','password','keepConnected','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd054,0xdb));var _0x4d05=function(_0x4f03f4,_0x32a1ea){_0x4f03f4=_0x4f03f4-0x0;var _0x24c936=_0xd054[_0x4f03f4];return _0x24c936;};var AsteriskManager=require(_0x4d05('0x0'));var config=require(_0x4d05('0x1'));var utils=require(_0x4d05('0x2'));var util=require(_0x4d05('0x3'));var ami=new AsteriskManager(config[_0x4d05('0x4')][_0x4d05('0x5')],config[_0x4d05('0x4')]['ip'],config[_0x4d05('0x4')]['username'],config['asterisk'][_0x4d05('0x6')],!![]);ami[_0x4d05('0x7')]();if(config['xdr']&&config['xdr'][_0x4d05('0x8')]){utils[_0x4d05('0x9')](_0x4d05('0xa'));}else{var agents=require(_0x4d05('0xb'));var calls=require(_0x4d05('0xc'));var queues=require(_0x4d05('0xd'));var recordings=require('./recordings.controller');var members=require(_0x4d05('0xe'));var dials=require(_0x4d05('0xf'));var transfers=require('./transfers.controller');var core=require(_0x4d05('0x10'));ami['on'](_0x4d05('0x11'),core[_0x4d05('0x11')]);ami['on'](_0x4d05('0x12'),core[_0x4d05('0x12')]);ami['on']('fullybooted',core[_0x4d05('0x13')]);ami['on'](_0x4d05('0x14'),core[_0x4d05('0x14')]);ami['on'](_0x4d05('0x15'),core[_0x4d05('0x15')]);ami['on'](_0x4d05('0x16'),core['managerevent']);ami['on'](_0x4d05('0x17'),function(_0x458676){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x1a'),_0x458676[_0x4d05('0x1b')]),_0x458676);members[_0x4d05('0x17')](_0x458676);}catch(_0xf05301){utils[_0x4d05('0x14')](util[_0x4d05('0x19')]('[%s][index][devicestatechange]',_0x458676[_0x4d05('0x1b')]),_0xf05301);}});ami['on'](_0x4d05('0x1c'),function(_0x2e914a){try{utils['debug'](util[_0x4d05('0x19')](_0x4d05('0x1d'),_0x2e914a[_0x4d05('0x1e')]),_0x2e914a);agents[_0x4d05('0x1c')](_0x2e914a);}catch(_0x3b9caf){utils[_0x4d05('0x14')](util[_0x4d05('0x19')](_0x4d05('0x1d'),_0x2e914a['uniqueid']),_0x3b9caf);}});ami['on']('agentringnoanswer',function(_0x461117){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x1f'),_0x461117[_0x4d05('0x1e')]),_0x461117);agents[_0x4d05('0x20')](_0x461117);}catch(_0x32a7b3){utils[_0x4d05('0x14')](util['format'](_0x4d05('0x1f'),_0x461117['uniqueid']),_0x32a7b3);}});ami['on'](_0x4d05('0x21'),function(_0x10be91){try{utils[_0x4d05('0x18')](util['format'](_0x4d05('0x22'),_0x10be91[_0x4d05('0x1e')]),_0x10be91);agents[_0x4d05('0x21')](_0x10be91);queues[_0x4d05('0x21')](_0x10be91);}catch(_0x48f26d){utils[_0x4d05('0x14')](util[_0x4d05('0x19')](_0x4d05('0x22'),_0x10be91[_0x4d05('0x1e')]),_0x48f26d);}});ami['on'](_0x4d05('0x23'),function(_0x22fa54){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')]('[%s][index][agentcomplete]',_0x22fa54[_0x4d05('0x1e')]),_0x22fa54);agents[_0x4d05('0x23')](_0x22fa54);queues[_0x4d05('0x23')](_0x22fa54);members[_0x4d05('0x23')](_0x22fa54);}catch(_0x9005){utils[_0x4d05('0x14')](util[_0x4d05('0x19')](_0x4d05('0x24'),_0x22fa54[_0x4d05('0x1e')]),_0x9005);}});ami['on'](_0x4d05('0x25'),function(_0x3b9de3){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x26'),_0x3b9de3['uniqueid']),_0x3b9de3);agents[_0x4d05('0x25')](_0x3b9de3);queues[_0x4d05('0x25')](_0x3b9de3);}catch(_0x4dcaa7){utils[_0x4d05('0x14')](util[_0x4d05('0x19')]('[%s][index][queuecallerabandon]',_0x3b9de3['uniqueid']),_0x4dcaa7);}});ami['on'](_0x4d05('0x27'),function(_0x46889e){try{utils['debug'](util[_0x4d05('0x19')](_0x4d05('0x28'),_0x46889e['uniqueid']),_0x46889e);queues[_0x4d05('0x27')](_0x46889e);recordings[_0x4d05('0x27')](_0x46889e);}catch(_0x4a5f19){utils[_0x4d05('0x14')](util[_0x4d05('0x19')]('[%s][index][queuecallerjoin]',_0x46889e[_0x4d05('0x1e')]),_0x4a5f19);}});ami['on'](_0x4d05('0x29'),function(_0x3f8b9f){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x2a'),_0x3f8b9f[_0x4d05('0x1e')]),_0x3f8b9f);queues[_0x4d05('0x29')](_0x3f8b9f);}catch(_0x566e92){utils[_0x4d05('0x14')](util[_0x4d05('0x19')](_0x4d05('0x2a'),_0x3f8b9f[_0x4d05('0x1e')]),_0x566e92);}});ami['on'](_0x4d05('0x2b'),function(_0x4ac238){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x2c'),_0x4ac238[_0x4d05('0x1e')]),_0x4ac238);queues[_0x4d05('0x2b')](_0x4ac238);calls['musiconholdstart'](_0x4ac238);}catch(_0x54aa31){utils[_0x4d05('0x14')](util[_0x4d05('0x19')]('[%s][index][musiconholdstart]',_0x4ac238[_0x4d05('0x1e')]),_0x54aa31);}});ami['on'](_0x4d05('0x2d'),function(_0x3846c6){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x2e'),_0x3846c6['uniqueid']),_0x3846c6);queues['musiconholdstop'](_0x3846c6);calls[_0x4d05('0x2d')](_0x3846c6);}catch(_0x20ad79){utils[_0x4d05('0x14')](util[_0x4d05('0x19')](_0x4d05('0x2e'),_0x3846c6[_0x4d05('0x1e')]),_0x20ad79);}});ami['on'](_0x4d05('0x2f'),function(_0x40cba2){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x30'),_0x40cba2[_0x4d05('0x1e')]),_0x40cba2);calls[_0x4d05('0x2f')](_0x40cba2);recordings[_0x4d05('0x2f')](_0x40cba2);}catch(_0x2774cb){utils[_0x4d05('0x14')](util[_0x4d05('0x19')](_0x4d05('0x30'),_0x40cba2[_0x4d05('0x1e')]),_0x2774cb);}});ami['on'](_0x4d05('0x31'),function(_0x4053a8){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x32'),_0x4053a8['uniqueid']),_0x4053a8);calls[_0x4d05('0x31')](_0x4053a8);recordings[_0x4d05('0x31')](_0x4053a8);dials[_0x4d05('0x31')](_0x4053a8);agents[_0x4d05('0x31')](_0x4053a8);queues[_0x4d05('0x31')](_0x4053a8);}catch(_0x4091a6){utils[_0x4d05('0x14')](util['format'](_0x4d05('0x32'),_0x4053a8[_0x4d05('0x1e')]),_0x4091a6);}});ami['on']('cdr',function(_0x46b2b4){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x33'),_0x46b2b4[_0x4d05('0x1e')]),_0x46b2b4);members[_0x4d05('0x34')](_0x46b2b4);}catch(_0x4a508a){utils[_0x4d05('0x14')](util[_0x4d05('0x19')](_0x4d05('0x33'),_0x46b2b4[_0x4d05('0x1e')]),_0x4a508a);}});ami['on']('blindtransfer',function(_0x45bb7a){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x35'),_0x45bb7a['uniqueid']),_0x45bb7a);queues['blindtransfer'](_0x45bb7a);agents[_0x4d05('0x36')](_0x45bb7a);transfers['blindtransfer'](_0x45bb7a);}catch(_0x2646d3){utils[_0x4d05('0x14')](util[_0x4d05('0x19')](_0x4d05('0x35'),_0x45bb7a['uniqueid']),_0x2646d3);}});ami['on'](_0x4d05('0x37'),function(_0x516c23){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x38'),_0x516c23[_0x4d05('0x39')]),_0x516c23);queues[_0x4d05('0x37')](_0x516c23);transfers['attendedtransfer'](_0x516c23);agents['attendedtransfer'](_0x516c23);calls[_0x4d05('0x37')](_0x516c23);}catch(_0x588eec){utils[_0x4d05('0x14')](util['format'](_0x4d05('0x38'),_0x516c23[_0x4d05('0x39')]),_0x588eec);}});ami['on'](_0x4d05('0x3a'),function(_0x42c75e){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x3b'),_0x42c75e[_0x4d05('0x1e')]),_0x42c75e);queues['varset'](_0x42c75e);recordings[_0x4d05('0x3a')](_0x42c75e);calls[_0x4d05('0x3a')](_0x42c75e);dials[_0x4d05('0x3a')](_0x42c75e);}catch(_0x2f3baa){utils[_0x4d05('0x14')](util[_0x4d05('0x19')]('[%s][index][varset]',_0x42c75e[_0x4d05('0x1e')]),_0x2f3baa);}});ami['on']('newexten',function(_0x1ea173){try{utils['debug'](util[_0x4d05('0x19')](_0x4d05('0x3c'),_0x1ea173[_0x4d05('0x1e')]),_0x1ea173);calls['newexten'](_0x1ea173);recordings['newexten'](_0x1ea173);dials[_0x4d05('0x3d')](_0x1ea173);}catch(_0x320302){utils[_0x4d05('0x14')](util[_0x4d05('0x19')]('[%s][index][newexten]',_0x1ea173[_0x4d05('0x1e')]),_0x320302);}});ami['on'](_0x4d05('0x3e'),function(_0x20cd64){try{utils['debug'](util['format'](_0x4d05('0x3f'),_0x20cd64['uniqueid']),_0x20cd64);calls[_0x4d05('0x3e')](_0x20cd64);recordings[_0x4d05('0x3e')](_0x20cd64);}catch(_0x34694e){utils[_0x4d05('0x14')](util[_0x4d05('0x19')](_0x4d05('0x3f'),_0x20cd64[_0x4d05('0x1e')]),_0x34694e);}});ami['on'](_0x4d05('0x40'),function(_0x511adc){try{utils[_0x4d05('0x18')](util[_0x4d05('0x19')](_0x4d05('0x41'),_0x511adc[_0x4d05('0x1e')]),_0x511adc);dials[_0x4d05('0x40')](_0x511adc);}catch(_0x578e24){utils[_0x4d05('0x14')](util['format'](_0x4d05('0x42'),_0x511adc[_0x4d05('0x1e')]),_0x578e24);}});ami['on']('dialend',function(_0x184a1c){try{utils['debug'](util[_0x4d05('0x19')](_0x4d05('0x43'),_0x184a1c['uniqueid']),_0x184a1c);dials[_0x4d05('0x44')](_0x184a1c);}catch(_0x423f48){utils['error'](util['format']('[%s][index][dialend]',_0x184a1c[_0x4d05('0x1e')]),_0x423f48);}});} \ No newline at end of file +var _0x7325=['dialend','[%s][index][dialend]','asterisk-manager','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','debug','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin'];(function(_0x31e3e4,_0x5c795a){var _0x4ee39e=function(_0x21ee01){while(--_0x21ee01){_0x31e3e4['push'](_0x31e3e4['shift']());}};_0x4ee39e(++_0x5c795a);}(_0x7325,0x147));var _0x5732=function(_0x453ec6,_0x2b1fb5){_0x453ec6=_0x453ec6-0x0;var _0x32418e=_0x7325[_0x453ec6];return _0x32418e;};var AsteriskManager=require(_0x5732('0x0'));var config=require('../../config/environment');var utils=require(_0x5732('0x1'));var util=require('util');var ami=new AsteriskManager(config[_0x5732('0x2')][_0x5732('0x3')],config['asterisk']['ip'],config[_0x5732('0x2')][_0x5732('0x4')],config['asterisk'][_0x5732('0x5')],!![]);ami[_0x5732('0x6')]();if(config[_0x5732('0x7')]&&config[_0x5732('0x7')][_0x5732('0x8')]){utils['info']('XDR\x20DISABLED');}else{var agents=require(_0x5732('0x9'));var calls=require(_0x5732('0xa'));var queues=require(_0x5732('0xb'));var recordings=require(_0x5732('0xc'));var members=require('./members.controller');var dials=require(_0x5732('0xd'));var transfers=require(_0x5732('0xe'));var core=require(_0x5732('0xf'));ami['on'](_0x5732('0x10'),core[_0x5732('0x10')]);ami['on'](_0x5732('0x11'),core[_0x5732('0x11')]);ami['on'](_0x5732('0x12'),core[_0x5732('0x12')]);ami['on']('error',core[_0x5732('0x13')]);ami['on']('close',core['close']);ami['on'](_0x5732('0x14'),core['managerevent']);ami['on'](_0x5732('0x15'),function(_0x518646){try{utils['debug'](util[_0x5732('0x16')](_0x5732('0x17'),_0x518646[_0x5732('0x18')]),_0x518646);members[_0x5732('0x15')](_0x518646);}catch(_0x25b42f){utils[_0x5732('0x13')](util['format'](_0x5732('0x17'),_0x518646[_0x5732('0x18')]),_0x25b42f);}});ami['on'](_0x5732('0x19'),function(_0x6fafe2){try{utils['debug'](util['format'](_0x5732('0x1a'),_0x6fafe2[_0x5732('0x1b')]),_0x6fafe2);agents[_0x5732('0x19')](_0x6fafe2);}catch(_0x4389f9){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][agentcalled]',_0x6fafe2['uniqueid']),_0x4389f9);}});ami['on']('agentringnoanswer',function(_0x31780d){try{utils['debug'](util[_0x5732('0x16')](_0x5732('0x1c'),_0x31780d['uniqueid']),_0x31780d);agents[_0x5732('0x1d')](_0x31780d);}catch(_0x93503a){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x1c'),_0x31780d[_0x5732('0x1b')]),_0x93503a);}});ami['on']('agentconnect',function(_0x206c59){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')]('[%s][index][agentconnect]',_0x206c59[_0x5732('0x1b')]),_0x206c59);agents[_0x5732('0x1f')](_0x206c59);queues['agentconnect'](_0x206c59);}catch(_0x1586db){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][agentconnect]',_0x206c59['uniqueid']),_0x1586db);}});ami['on'](_0x5732('0x20'),function(_0x402ca2){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x21'),_0x402ca2[_0x5732('0x1b')]),_0x402ca2);agents['agentcomplete'](_0x402ca2);queues[_0x5732('0x20')](_0x402ca2);members[_0x5732('0x20')](_0x402ca2);}catch(_0x5083e9){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][agentcomplete]',_0x402ca2['uniqueid']),_0x5083e9);}});ami['on'](_0x5732('0x22'),function(_0x4e702b){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x23'),_0x4e702b[_0x5732('0x1b')]),_0x4e702b);agents[_0x5732('0x22')](_0x4e702b);queues[_0x5732('0x22')](_0x4e702b);}catch(_0x1e2955){utils['error'](util[_0x5732('0x16')](_0x5732('0x23'),_0x4e702b[_0x5732('0x1b')]),_0x1e2955);}});ami['on'](_0x5732('0x24'),function(_0x221384){try{utils[_0x5732('0x1e')](util['format'](_0x5732('0x25'),_0x221384[_0x5732('0x1b')]),_0x221384);queues['queuecallerjoin'](_0x221384);recordings[_0x5732('0x24')](_0x221384);}catch(_0xa0b1c3){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x25'),_0x221384['uniqueid']),_0xa0b1c3);}});ami['on'](_0x5732('0x26'),function(_0x2b4197){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x27'),_0x2b4197[_0x5732('0x1b')]),_0x2b4197);queues[_0x5732('0x26')](_0x2b4197);}catch(_0x42cd4c){utils['error'](util['format'](_0x5732('0x27'),_0x2b4197[_0x5732('0x1b')]),_0x42cd4c);}});ami['on'](_0x5732('0x28'),function(_0x2cc6e7){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')]('[%s][index][musiconholdstart]',_0x2cc6e7['uniqueid']),_0x2cc6e7);queues[_0x5732('0x28')](_0x2cc6e7);calls['musiconholdstart'](_0x2cc6e7);}catch(_0x44a3c0){utils['error'](util[_0x5732('0x16')](_0x5732('0x29'),_0x2cc6e7[_0x5732('0x1b')]),_0x44a3c0);}});ami['on']('musiconholdstop',function(_0xa67ac5){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x2a'),_0xa67ac5['uniqueid']),_0xa67ac5);queues[_0x5732('0x2b')](_0xa67ac5);calls['musiconholdstop'](_0xa67ac5);}catch(_0x37b32d){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][musiconholdstop]',_0xa67ac5[_0x5732('0x1b')]),_0x37b32d);}});ami['on'](_0x5732('0x2c'),function(_0x1251f3){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x2d'),_0x1251f3[_0x5732('0x1b')]),_0x1251f3);calls[_0x5732('0x2c')](_0x1251f3);recordings['newstate'](_0x1251f3);}catch(_0x467d9a){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][newstate]',_0x1251f3[_0x5732('0x1b')]),_0x467d9a);}});ami['on'](_0x5732('0x2e'),function(_0x5c63df){try{utils['debug'](util['format'](_0x5732('0x2f'),_0x5c63df['uniqueid']),_0x5c63df);calls[_0x5732('0x2e')](_0x5c63df);recordings[_0x5732('0x2e')](_0x5c63df);dials[_0x5732('0x2e')](_0x5c63df);agents['hangup'](_0x5c63df);queues[_0x5732('0x2e')](_0x5c63df);}catch(_0x19efe7){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x2f'),_0x5c63df[_0x5732('0x1b')]),_0x19efe7);}});ami['on'](_0x5732('0x30'),function(_0x52d33b){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x31'),_0x52d33b['uniqueid']),_0x52d33b);members['cdr'](_0x52d33b);}catch(_0x216c90){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x31'),_0x52d33b['uniqueid']),_0x216c90);}});ami['on'](_0x5732('0x32'),function(_0x1e92db){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x33'),_0x1e92db[_0x5732('0x1b')]),_0x1e92db);queues[_0x5732('0x32')](_0x1e92db);agents['blindtransfer'](_0x1e92db);transfers['blindtransfer'](_0x1e92db);}catch(_0x4afb16){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x33'),_0x1e92db['uniqueid']),_0x4afb16);}});ami['on'](_0x5732('0x34'),function(_0x46c4ff){try{utils[_0x5732('0x1e')](util['format'](_0x5732('0x35'),_0x46c4ff[_0x5732('0x36')]),_0x46c4ff);queues['attendedtransfer'](_0x46c4ff);transfers[_0x5732('0x34')](_0x46c4ff);agents[_0x5732('0x34')](_0x46c4ff);calls[_0x5732('0x34')](_0x46c4ff);}catch(_0x574cc2){utils[_0x5732('0x13')](util['format'](_0x5732('0x35'),_0x46c4ff['origtransfereruniqueid']),_0x574cc2);}});ami['on']('varset',function(_0x39044b){try{utils[_0x5732('0x1e')](util['format'](_0x5732('0x37'),_0x39044b[_0x5732('0x1b')]),_0x39044b);queues[_0x5732('0x38')](_0x39044b);recordings[_0x5732('0x38')](_0x39044b);calls[_0x5732('0x38')](_0x39044b);dials[_0x5732('0x38')](_0x39044b);}catch(_0x4101b9){utils['error'](util[_0x5732('0x16')](_0x5732('0x37'),_0x39044b[_0x5732('0x1b')]),_0x4101b9);}});ami['on'](_0x5732('0x39'),function(_0x53ab8f){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x3a'),_0x53ab8f[_0x5732('0x1b')]),_0x53ab8f);calls['newexten'](_0x53ab8f);recordings[_0x5732('0x39')](_0x53ab8f);dials[_0x5732('0x39')](_0x53ab8f);}catch(_0x12fc75){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][newexten]',_0x53ab8f[_0x5732('0x1b')]),_0x12fc75);}});ami['on'](_0x5732('0x3b'),function(_0x23fbd3){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x3c'),_0x23fbd3[_0x5732('0x1b')]),_0x23fbd3);calls['newchannel'](_0x23fbd3);recordings[_0x5732('0x3b')](_0x23fbd3);}catch(_0x3110ff){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][newchannel]',_0x23fbd3[_0x5732('0x1b')]),_0x3110ff);}});ami['on'](_0x5732('0x3d'),function(_0x273570){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')]('[%s][index][dialbegin]',_0x273570[_0x5732('0x1b')]),_0x273570);dials[_0x5732('0x3d')](_0x273570);}catch(_0x401804){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x3e'),_0x273570[_0x5732('0x1b')]),_0x401804);}});ami['on'](_0x5732('0x3f'),function(_0x25e4b5){try{utils[_0x5732('0x1e')](util['format'](_0x5732('0x40'),_0x25e4b5[_0x5732('0x1b')]),_0x25e4b5);dials[_0x5732('0x3f')](_0x25e4b5);}catch(_0x1fdbdf){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][dialend]',_0x25e4b5[_0x5732('0x1b')]),_0x1fdbdf);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c4bf890..f6e1f20 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 _0x3eec=['queue','assign','cdr','[%s][members][cdr]','channel','split','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','then','name','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s'];(function(_0x50c87a,_0x5a5256){var _0x2a9b67=function(_0x3b52fe){while(--_0x3b52fe){_0x50c87a['push'](_0x50c87a['shift']());}};_0x2a9b67(++_0x5a5256);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x140c6c,_0x3344e7){_0x140c6c=_0x140c6c-0x0;var _0x36078c=_0x3eec[_0x140c6c];return _0x36078c;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var utils=require(_0xc3ee('0x2'));var members={};var exclude=[_0xc3ee('0x3'),'Queue:'];function writeDB(_0x223d08){utils[_0xc3ee('0x4')](util[_0xc3ee('0x5')](_0xc3ee('0x6'),_0x223d08[_0xc3ee('0x7')],_0x223d08[_0xc3ee('0x8')],_0x223d08['channel'],_0x223d08[_0xc3ee('0x9')],_0x223d08[_0xc3ee('0xa')],_0x223d08[_0xc3ee('0xb')]));if(_0x223d08[_0xc3ee('0x8')]){utils[_0xc3ee('0xc')](_0x223d08[_0xc3ee('0x8')])[_0xc3ee('0xd')](function(_0x2c9701){if(_0x2c9701){_0x223d08[_0xc3ee('0xa')]=_0x2c9701[_0xc3ee('0xe')];_0x223d08['internal']=_0x2c9701['internal'];utils[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x223d08);}else{utils[_0xc3ee('0x11')](_0x223d08[_0xc3ee('0x8')]['split']('/')[0x1])[_0xc3ee('0xd')](function(_0x4b1bff){if(_0x4b1bff){_0x223d08[_0xc3ee('0xa')]=_0x4b1bff[_0xc3ee('0xe')];_0x223d08['internal']=_0x4b1bff['internal'];utils[_0xc3ee('0xf')]('CreateMemberReport',_0x223d08);}});}})[_0xc3ee('0x12')](function(_0x535d1a){utils[_0xc3ee('0x13')](util['format'](_0xc3ee('0x14'),_0x223d08[_0xc3ee('0x7')]),_0x535d1a);});}delete members[_0x223d08[_0xc3ee('0x8')]];}function startsWith(_0x664bad,_0x476f8f){return _[_0xc3ee('0x15')](_0x664bad,function(_0x277e11){return _['startsWith'](_0x476f8f,_0x277e11);});}exports[_0xc3ee('0x16')]=function(_0x4eea89){try{utils[_0xc3ee('0x17')](util[_0xc3ee('0x5')](_0xc3ee('0x18'),members[_0x4eea89[_0xc3ee('0x19')]]?members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x7')]:_0x4eea89[_0xc3ee('0x19')]),_0x4eea89);utils[_0xc3ee('0x4')](util[_0xc3ee('0x5')](_0xc3ee('0x1a'),members[_0x4eea89[_0xc3ee('0x19')]]?members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x7')]:_0x4eea89[_0xc3ee('0x19')],_0x4eea89[_0xc3ee('0x1b')],_0x4eea89[_0xc3ee('0x19')]));switch(_0x4eea89[_0xc3ee('0x1b')]){case _0xc3ee('0x1c'):case _0xc3ee('0x1d'):if(!startsWith(exclude,_0x4eea89[_0xc3ee('0x19')])){members[_0x4eea89[_0xc3ee('0x19')]]={'channel':'voice','interface':_0x4eea89['device'],'type':_0xc3ee('0x1e'),'enterAt':utils[_0xc3ee('0x1f')](),'role':_0xc3ee('0x20')};}break;case _0xc3ee('0x21'):if(!_[_0xc3ee('0x22')](members[_0x4eea89[_0xc3ee('0x19')]])){members[_0x4eea89['device']][_0xc3ee('0x23')]=utils[_0xc3ee('0x1f')]();members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x24')]=utils[_0xc3ee('0x25')](members[_0x4eea89['device']]['exitAt'],members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x26')]);if(members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x7')]){writeDB(members[_0x4eea89[_0xc3ee('0x19')]]);}}break;default:break;}}catch(_0x4ecfec){utils['error'](util['format'](_0xc3ee('0x18'),members[_0x4eea89[_0xc3ee('0x19')]]?members[_0x4eea89[_0xc3ee('0x19')]][_0xc3ee('0x7')]:_0x4eea89[_0xc3ee('0x19')]),_0x4ecfec);}};exports['agentcomplete']=function(_0x13f30d){try{if(!_[_0xc3ee('0x22')](members[_0x13f30d[_0xc3ee('0x8')]])){utils[_0xc3ee('0x17')](util[_0xc3ee('0x5')](_0xc3ee('0x27'),_0x13f30d[_0xc3ee('0x7')]),_0x13f30d);utils['info'](util[_0xc3ee('0x5')](_0xc3ee('0x28'),_0x13f30d[_0xc3ee('0x7')],_0x13f30d['interface'],_0x13f30d[_0xc3ee('0x29')]));members[_0x13f30d[_0xc3ee('0x8')]]=_[_0xc3ee('0x2a')](members[_0x13f30d[_0xc3ee('0x8')]],{'data4':_0x13f30d[_0xc3ee('0x29')],'uniqueid':_0x13f30d[_0xc3ee('0x7')]});}}catch(_0x16677d){utils['error'](util[_0xc3ee('0x5')]('[%s][members][agentcomplete]',_0x13f30d[_0xc3ee('0x7')]),_0x16677d);}};exports[_0xc3ee('0x2b')]=function(_0x13d6e5){try{utils[_0xc3ee('0x17')](util[_0xc3ee('0x5')](_0xc3ee('0x2c'),_0x13d6e5['uniqueid']),_0x13d6e5);if(_0x13d6e5[_0xc3ee('0x2d')]){var _0x3f2e5a=_0x13d6e5[_0xc3ee('0x2d')][_0xc3ee('0x2e')]('-')[0x0];if(!_[_0xc3ee('0x22')](members[_0x3f2e5a])){members[_0x3f2e5a]=_[_0xc3ee('0x2a')](members[_0x3f2e5a],{'data1':members[_0x3f2e5a][_0xc3ee('0x2f')]||_0x13d6e5[_0xc3ee('0xb')],'data2':members[_0x3f2e5a][_0xc3ee('0x9')]||_0x13d6e5[_0xc3ee('0x30')],'data3':members[_0x3f2e5a][_0xc3ee('0x31')]||_0x13d6e5[_0xc3ee('0x32')],'uniqueid':members[_0x3f2e5a][_0xc3ee('0x7')]||_0x13d6e5[_0xc3ee('0x7')]});utils[_0xc3ee('0x4')](util[_0xc3ee('0x5')](_0xc3ee('0x33'),_0x13d6e5[_0xc3ee('0x7')],members[_0x3f2e5a][_0xc3ee('0x2f')],members[_0x3f2e5a][_0xc3ee('0x9')],members[_0x3f2e5a][_0xc3ee('0x31')]));if(members[_0x3f2e5a]['exitAt']){writeDB(members[_0x3f2e5a]);}}}if(_0x13d6e5[_0xc3ee('0x34')]){var _0x548df8=_0x13d6e5[_0xc3ee('0x34')][_0xc3ee('0x2e')]('-')[0x0];if(!_[_0xc3ee('0x22')](members[_0x548df8])){members[_0x548df8]=_[_0xc3ee('0x2a')](members[_0x548df8],{'data1':members[_0x548df8][_0xc3ee('0x2f')]||_0x13d6e5[_0xc3ee('0xb')],'data2':members[_0x548df8]['data2']||_0x13d6e5[_0xc3ee('0x30')],'data3':members[_0x548df8][_0xc3ee('0x31')]||_0x13d6e5[_0xc3ee('0x32')],'uniqueid':members[_0x548df8]['uniqueid']||_0x13d6e5[_0xc3ee('0x7')]});utils[_0xc3ee('0x4')](util[_0xc3ee('0x5')](_0xc3ee('0x33'),_0x13d6e5[_0xc3ee('0x7')],members[_0x548df8][_0xc3ee('0x2f')],members[_0x548df8][_0xc3ee('0x9')],members[_0x548df8][_0xc3ee('0x31')]));if(members[_0x548df8][_0xc3ee('0x23')]){writeDB(members[_0x548df8]);}}}}catch(_0x23d365){utils[_0xc3ee('0x13')](util['format'](_0xc3ee('0x2c'),_0x13d6e5[_0xc3ee('0x7')]),_0x23d365);}}; \ No newline at end of file +var _0xc9b6=['agent','NOT_INUSE','exitAt','duration','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','assign','data1','source','data3','destination','destinationchannel','type','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','getUserByInterface','then','membername','request','CreateMemberReport','split','name','internal','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','format','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now'];(function(_0x310246,_0x4f96d9){var _0x3e808e=function(_0x541515){while(--_0x541515){_0x310246['push'](_0x310246['shift']());}};_0x3e808e(++_0x4f96d9);}(_0xc9b6,0xb6));var _0x6c9b=function(_0x18381f,_0x45e87c){_0x18381f=_0x18381f-0x0;var _0x1ccb6e=_0xc9b6[_0x18381f];return _0x1ccb6e;};'use strict';var _=require(_0x6c9b('0x0'));var util=require(_0x6c9b('0x1'));var utils=require(_0x6c9b('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x6c9b('0x3')];function writeDB(_0x32f5b4){utils[_0x6c9b('0x4')](util['format'](_0x6c9b('0x5'),_0x32f5b4[_0x6c9b('0x6')],_0x32f5b4[_0x6c9b('0x7')],_0x32f5b4[_0x6c9b('0x8')],_0x32f5b4[_0x6c9b('0x9')],_0x32f5b4['membername'],_0x32f5b4['type']));if(_0x32f5b4[_0x6c9b('0x7')]){utils[_0x6c9b('0xa')](_0x32f5b4[_0x6c9b('0x7')])[_0x6c9b('0xb')](function(_0x58b390){if(_0x58b390){_0x32f5b4[_0x6c9b('0xc')]=_0x58b390['name'];_0x32f5b4['internal']=_0x58b390['internal'];utils[_0x6c9b('0xd')](_0x6c9b('0xe'),_0x32f5b4);}else{utils['getUserByName'](_0x32f5b4[_0x6c9b('0x7')][_0x6c9b('0xf')]('/')[0x1])[_0x6c9b('0xb')](function(_0xa592a0){if(_0xa592a0){_0x32f5b4[_0x6c9b('0xc')]=_0xa592a0[_0x6c9b('0x10')];_0x32f5b4[_0x6c9b('0x11')]=_0xa592a0[_0x6c9b('0x11')];utils[_0x6c9b('0xd')](_0x6c9b('0xe'),_0x32f5b4);}});}})[_0x6c9b('0x12')](function(_0x4b36e9){utils[_0x6c9b('0x13')](util['format'](_0x6c9b('0x14'),_0x32f5b4[_0x6c9b('0x6')]),_0x4b36e9);});}delete members[_0x32f5b4[_0x6c9b('0x7')]];}function startsWith(_0x29e5d9,_0x277e8f){return _['some'](_0x29e5d9,function(_0x2fdfbd){return _[_0x6c9b('0x15')](_0x277e8f,_0x2fdfbd);});}exports[_0x6c9b('0x16')]=function(_0x53cb9b){try{utils[_0x6c9b('0x17')](util[_0x6c9b('0x18')](_0x6c9b('0x19'),members[_0x53cb9b[_0x6c9b('0x1a')]]?members[_0x53cb9b['device']][_0x6c9b('0x6')]:_0x53cb9b[_0x6c9b('0x1a')]),_0x53cb9b);utils[_0x6c9b('0x4')](util['format'](_0x6c9b('0x1b'),members[_0x53cb9b[_0x6c9b('0x1a')]]?members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x6')]:_0x53cb9b[_0x6c9b('0x1a')],_0x53cb9b[_0x6c9b('0x1c')],_0x53cb9b[_0x6c9b('0x1a')]));switch(_0x53cb9b[_0x6c9b('0x1c')]){case _0x6c9b('0x1d'):case _0x6c9b('0x1e'):if(!startsWith(exclude,_0x53cb9b['device'])){members[_0x53cb9b[_0x6c9b('0x1a')]]={'channel':_0x6c9b('0x1f'),'interface':_0x53cb9b[_0x6c9b('0x1a')],'type':_0x6c9b('0x20'),'enterAt':utils[_0x6c9b('0x21')](),'role':_0x6c9b('0x22')};}break;case _0x6c9b('0x23'):if(!_['isNil'](members[_0x53cb9b[_0x6c9b('0x1a')]])){members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x24')]=utils['now']();members[_0x53cb9b['device']][_0x6c9b('0x25')]=utils['diffTime'](members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x24')],members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x26')]);if(members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x6')]){writeDB(members[_0x53cb9b[_0x6c9b('0x1a')]]);}}break;default:break;}}catch(_0x3d9af2){utils[_0x6c9b('0x13')](util['format'](_0x6c9b('0x19'),members[_0x53cb9b[_0x6c9b('0x1a')]]?members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x6')]:_0x53cb9b[_0x6c9b('0x1a')]),_0x3d9af2);}};exports[_0x6c9b('0x27')]=function(_0x392dbe){try{if(!_[_0x6c9b('0x28')](members[_0x392dbe[_0x6c9b('0x7')]])){utils[_0x6c9b('0x17')](util[_0x6c9b('0x18')](_0x6c9b('0x29'),_0x392dbe[_0x6c9b('0x6')]),_0x392dbe);utils['info'](util['format'](_0x6c9b('0x2a'),_0x392dbe['uniqueid'],_0x392dbe['interface'],_0x392dbe[_0x6c9b('0x2b')]));members[_0x392dbe[_0x6c9b('0x7')]]=_['assign'](members[_0x392dbe[_0x6c9b('0x7')]],{'data4':_0x392dbe[_0x6c9b('0x2b')],'uniqueid':_0x392dbe[_0x6c9b('0x6')]});}}catch(_0x4a1941){utils['error'](util[_0x6c9b('0x18')]('[%s][members][agentcomplete]',_0x392dbe[_0x6c9b('0x6')]),_0x4a1941);}};exports[_0x6c9b('0x2c')]=function(_0x14c459){try{utils[_0x6c9b('0x17')](util[_0x6c9b('0x18')](_0x6c9b('0x2d'),_0x14c459[_0x6c9b('0x6')]),_0x14c459);if(_0x14c459[_0x6c9b('0x8')]){var _0xe886e7=_0x14c459[_0x6c9b('0x8')][_0x6c9b('0xf')]('-')[0x0];if(!_[_0x6c9b('0x28')](members[_0xe886e7])){members[_0xe886e7]=_[_0x6c9b('0x2e')](members[_0xe886e7],{'data1':members[_0xe886e7][_0x6c9b('0x2f')]||_0x14c459['type'],'data2':members[_0xe886e7][_0x6c9b('0x9')]||_0x14c459[_0x6c9b('0x30')],'data3':members[_0xe886e7][_0x6c9b('0x31')]||_0x14c459[_0x6c9b('0x32')],'uniqueid':members[_0xe886e7][_0x6c9b('0x6')]||_0x14c459[_0x6c9b('0x6')]});utils[_0x6c9b('0x4')](util[_0x6c9b('0x18')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x14c459[_0x6c9b('0x6')],members[_0xe886e7][_0x6c9b('0x2f')],members[_0xe886e7][_0x6c9b('0x9')],members[_0xe886e7]['data3']));if(members[_0xe886e7][_0x6c9b('0x24')]){writeDB(members[_0xe886e7]);}}}if(_0x14c459[_0x6c9b('0x33')]){var _0xc30862=_0x14c459['destinationchannel'][_0x6c9b('0xf')]('-')[0x0];if(!_[_0x6c9b('0x28')](members[_0xc30862])){members[_0xc30862]=_[_0x6c9b('0x2e')](members[_0xc30862],{'data1':members[_0xc30862][_0x6c9b('0x2f')]||_0x14c459[_0x6c9b('0x34')],'data2':members[_0xc30862][_0x6c9b('0x9')]||_0x14c459[_0x6c9b('0x30')],'data3':members[_0xc30862][_0x6c9b('0x31')]||_0x14c459[_0x6c9b('0x32')],'uniqueid':members[_0xc30862]['uniqueid']||_0x14c459[_0x6c9b('0x6')]});utils[_0x6c9b('0x4')](util['format'](_0x6c9b('0x35'),_0x14c459[_0x6c9b('0x6')],members[_0xc30862][_0x6c9b('0x2f')],members[_0xc30862]['data2'],members[_0xc30862]['data3']));if(members[_0xc30862]['exitAt']){writeDB(members[_0xc30862]);}}}}catch(_0x507173){utils[_0x6c9b('0x13')](util[_0x6c9b('0x18')](_0x6c9b('0x2d'),_0x14c459[_0x6c9b('0x6')]),_0x507173);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index e29944e..8b7901b 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 _0xae30=['[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','lastAssignedTo','calleridnum','accountcode','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','count','membername','queuecallerexitAt','assigned','destaccountcode','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xae30,0xea));var _0x0ae3=function(_0x5f35c5,_0x48949c){_0x5f35c5=_0x5f35c5-0x0;var _0x5e5d64=_0xae30[_0x5f35c5];return _0x5e5d64;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x4be878){utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x4'),_0x4be878['uniqueid'],_0x4be878[_0x0ae3('0x5')],_0x4be878['queue'],_0x4be878[_0x0ae3('0x6')],_0x4be878[_0x0ae3('0x7')],_0x4be878[_0x0ae3('0x8')],_0x4be878['queuecallerexitreason']));if(_0x4be878[_0x0ae3('0x9')]){utils[_0x0ae3('0xa')](_0x4be878[_0x0ae3('0x9')])[_0x0ae3('0xb')](function(_0x4e6a77){if(_0x4e6a77){_0x4be878[_0x0ae3('0xc')]=_0x4e6a77['type'];}utils[_0x0ae3('0xd')](_0x0ae3('0xe'),_0x4be878);});}else{utils[_0x0ae3('0xd')](_0x0ae3('0xe'),_0x4be878);}if(_0x4be878[_0x0ae3('0xf')]){delete queues[_0x4be878[_0x0ae3('0xf')]];}else{delete queues[_0x4be878[_0x0ae3('0x10')]];}}exports[_0x0ae3('0x11')]=function(_0x224ae8){try{utils[_0x0ae3('0x12')](util[_0x0ae3('0x3')]('[%s][queues][queuecallerjoin]',_0x224ae8[_0x0ae3('0x10')]),_0x224ae8);utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x13'),_0x224ae8[_0x0ae3('0x10')],_0x224ae8[_0x0ae3('0x9')],_0x224ae8['position']));queues[_0x224ae8[_0x0ae3('0x10')]]=_['assign'](_0x224ae8,{'originalposition':_0x224ae8[_0x0ae3('0x14')],'queuecallerjoinAt':utils[_0x0ae3('0x15')](),'mohtime':0x0});}catch(_0x4d4e5d){utils['error'](util[_0x0ae3('0x3')](_0x0ae3('0x16'),_0x224ae8[_0x0ae3('0x10')]),_0x4d4e5d);}};exports[_0x0ae3('0x17')]=function(_0xf3b458){try{if(!_[_0x0ae3('0x18')](queues[_0xf3b458[_0x0ae3('0x10')]])){utils[_0x0ae3('0x12')](util[_0x0ae3('0x3')](_0x0ae3('0x19'),_0xf3b458[_0x0ae3('0x10')]),_0xf3b458);if(queues[_0xf3b458['uniqueid']][_0x0ae3('0x1a')]){if(!queues[_0xf3b458[_0x0ae3('0x10')]][_0x0ae3('0x1b')]&&!queues[_0xf3b458[_0x0ae3('0x10')]]['queuecallerexit']){queues[_0xf3b458[_0x0ae3('0x10')]][_0x0ae3('0x1c')]=!![];queues[_0xf3b458[_0x0ae3('0x10')]][_0x0ae3('0x1d')]=utils['now']();queues[_0xf3b458[_0x0ae3('0x10')]][_0x0ae3('0x1e')]=_0x0ae3('0x1f');}utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x20'),_0xf3b458[_0x0ae3('0x10')],queues[_0xf3b458[_0x0ae3('0x10')]][_0x0ae3('0x21')],queues[_0xf3b458[_0x0ae3('0x10')]][_0x0ae3('0x1e')]));writeDB(queues[_0xf3b458[_0x0ae3('0x10')]]);}else if(queues[_0xf3b458[_0x0ae3('0x10')]][_0x0ae3('0xf')]){utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x22'),_0xf3b458[_0x0ae3('0x10')],queues[_0xf3b458['uniqueid']]['name'],queues[_0xf3b458[_0x0ae3('0x10')]][_0x0ae3('0xf')]));queues[queues[_0xf3b458['uniqueid']][_0x0ae3('0xf')]]=queues[_0xf3b458[_0x0ae3('0x10')]];queues[queues[_0xf3b458[_0x0ae3('0x10')]][_0x0ae3('0xf')]][_0x0ae3('0x23')]=0x2;delete queues[_0xf3b458[_0x0ae3('0x10')]];}}}catch(_0x233959){utils[_0x0ae3('0x24')](util['format'](_0x0ae3('0x19'),_0xf3b458[_0x0ae3('0x10')]),_0x233959);}};exports[_0x0ae3('0x25')]=function(_0x4cdee9){try{utils[_0x0ae3('0x12')](util[_0x0ae3('0x3')](_0x0ae3('0x26'),_0x4cdee9[_0x0ae3('0x10')]),_0x4cdee9);if(!_[_0x0ae3('0x18')](_0x4cdee9[_0x0ae3('0x27')][_0x0ae3('0x28')])&&_0x4cdee9[_0x0ae3('0x29')][_0x0ae3('0x2a')]()!==_0x0ae3('0x2b')){if(!_[_0x0ae3('0x18')](queues[_0x4cdee9[_0x0ae3('0x10')]])){queues[_0x4cdee9[_0x0ae3('0x10')]][_0x0ae3('0x1b')]=![];queues[_0x4cdee9[_0x0ae3('0x10')]]['queuecallerabandonAt']=null;queues[_0x4cdee9[_0x0ae3('0x10')]][_0x0ae3('0x2c')]=!![];queues[_0x4cdee9['uniqueid']]['queuecallerexitAt']=utils[_0x0ae3('0x15')]();queues[_0x4cdee9[_0x0ae3('0x10')]][_0x0ae3('0x1e')]=_0x4cdee9[_0x0ae3('0x29')]['toUpperCase']();utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4cdee9[_0x0ae3('0x10')],queues[_0x4cdee9[_0x0ae3('0x10')]][_0x0ae3('0x21')],_0x4cdee9['value'],queues[_0x4cdee9[_0x0ae3('0x10')]][_0x0ae3('0x1e')]));writeDB(queues[_0x4cdee9['uniqueid']]);}}else if(!_[_0x0ae3('0x18')](_0x4cdee9[_0x0ae3('0x27')][_0x0ae3('0x2d')])){if(!_[_0x0ae3('0x18')](queues[_0x4cdee9[_0x0ae3('0x10')]])&&!queues[_0x4cdee9[_0x0ae3('0x10')]][_0x0ae3('0x1b')]){queues[_0x4cdee9[_0x0ae3('0x10')]][_0x0ae3('0x1b')]=![];queues[_0x4cdee9['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4cdee9[_0x0ae3('0x10')]]['queuecallerexit']=!![];queues[_0x4cdee9[_0x0ae3('0x10')]]['queuecallerexitAt']=utils[_0x0ae3('0x15')]();queues[_0x4cdee9[_0x0ae3('0x10')]][_0x0ae3('0x1e')]=_0x0ae3('0x2e');utils['info'](util['format'](_0x0ae3('0x2f'),_0x4cdee9[_0x0ae3('0x10')],queues[_0x4cdee9['uniqueid']][_0x0ae3('0x21')],_0x4cdee9[_0x0ae3('0x29')],queues[_0x4cdee9[_0x0ae3('0x10')]][_0x0ae3('0x1e')]));}}}catch(_0x4ca039){utils[_0x0ae3('0x24')](util[_0x0ae3('0x3')]('[%s][queues][varset]',_0x4cdee9[_0x0ae3('0x10')]),_0x4ca039);}};exports[_0x0ae3('0x1b')]=function(_0x2a1762){try{if(!_[_0x0ae3('0x18')](queues[_0x2a1762['uniqueid']])){utils[_0x0ae3('0x12')](util[_0x0ae3('0x3')]('[%s][queues][queuecallerabandon]',_0x2a1762[_0x0ae3('0x10')]),_0x2a1762);queues[_0x2a1762[_0x0ae3('0x10')]][_0x0ae3('0x2c')]=![];queues[_0x2a1762[_0x0ae3('0x10')]]['queuecallerexitAt']=null;queues[_0x2a1762[_0x0ae3('0x10')]][_0x0ae3('0x1b')]=!![];queues[_0x2a1762[_0x0ae3('0x10')]][_0x0ae3('0x30')]=utils[_0x0ae3('0x15')]();queues[_0x2a1762['uniqueid']][_0x0ae3('0x1e')]='ABANDONED';utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2a1762[_0x0ae3('0x10')],queues[_0x2a1762[_0x0ae3('0x10')]][_0x0ae3('0x21')],queues[_0x2a1762[_0x0ae3('0x10')]][_0x0ae3('0x1e')]));}}catch(_0x2e5936){utils[_0x0ae3('0x24')](util[_0x0ae3('0x3')](_0x0ae3('0x31'),_0x2a1762[_0x0ae3('0x10')]),_0x2e5936);}};exports[_0x0ae3('0x32')]=function(_0x67dc42){try{if(!_[_0x0ae3('0x18')](queues[_0x67dc42[_0x0ae3('0x10')]])){utils[_0x0ae3('0x12')](util[_0x0ae3('0x3')]('[%s][queues][queuecallerleave]',_0x67dc42[_0x0ae3('0x10')]),_0x67dc42);utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x33'),_0x67dc42['uniqueid'],queues[_0x67dc42[_0x0ae3('0x10')]][_0x0ae3('0x21')],_0x67dc42[_0x0ae3('0x34')],_0x67dc42[_0x0ae3('0x35')]));queues[_0x67dc42[_0x0ae3('0x10')]]['queuecallerleave']=!![];queues[_0x67dc42[_0x0ae3('0x10')]][_0x0ae3('0x1a')]=utils[_0x0ae3('0x15')]();queues[_0x67dc42[_0x0ae3('0x10')]][_0x0ae3('0x36')]=utils[_0x0ae3('0x37')](queues[_0x67dc42[_0x0ae3('0x10')]][_0x0ae3('0x1a')],queues[_0x67dc42[_0x0ae3('0x10')]]['queuecallerjoinAt']);queues[_0x67dc42[_0x0ae3('0x10')]][_0x0ae3('0x14')]=_0x67dc42[_0x0ae3('0x14')];queues[_0x67dc42[_0x0ae3('0x10')]]['count']=_0x67dc42[_0x0ae3('0x38')];queues[_0x67dc42[_0x0ae3('0x10')]]['connectedlinenum']=_0x67dc42['connectedlinenum'];queues[_0x67dc42[_0x0ae3('0x10')]][_0x0ae3('0x35')]=_0x67dc42[_0x0ae3('0x35')];}}catch(_0x1bd48d){utils['error'](util[_0x0ae3('0x3')]('[%s][queues][queuecallerleave]',_0x67dc42[_0x0ae3('0x10')]),_0x1bd48d);}};exports['agentconnect']=function(_0x4f6728){try{if(!_[_0x0ae3('0x18')](queues[_0x4f6728[_0x0ae3('0x10')]])){utils[_0x0ae3('0x12')](util['format']('[%s][queues][agentconnect]',_0x4f6728[_0x0ae3('0x10')]),_0x4f6728);utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4f6728[_0x0ae3('0x10')],queues[_0x4f6728['uniqueid']][_0x0ae3('0x21')],_0x4f6728[_0x0ae3('0x39')],_0x4f6728['destaccountcode']));queues[_0x4f6728['uniqueid']][_0x0ae3('0x1b')]=![];queues[_0x4f6728['uniqueid']][_0x0ae3('0x1b')]=![];queues[_0x4f6728['uniqueid']][_0x0ae3('0x30')]=null;queues[_0x4f6728[_0x0ae3('0x10')]]['queuecallerexit']=![];queues[_0x4f6728[_0x0ae3('0x10')]][_0x0ae3('0x1e')]=null;queues[_0x4f6728[_0x0ae3('0x10')]][_0x0ae3('0x3a')]=null;queues[_0x4f6728['uniqueid']][_0x0ae3('0x3b')]=!![];queues[_0x4f6728[_0x0ae3('0x10')]][_0x0ae3('0x8')]=_0x4f6728[_0x0ae3('0x3c')];queues[_0x4f6728[_0x0ae3('0x10')]][_0x0ae3('0x6')]=_0x4f6728[_0x0ae3('0x39')];}}catch(_0x2f525e){utils[_0x0ae3('0x24')](util[_0x0ae3('0x3')](_0x0ae3('0x3d'),_0x4f6728[_0x0ae3('0x10')]),_0x2f525e);}};exports[_0x0ae3('0x3e')]=function(_0x175523){try{if(!_['isNil'](queues[_0x175523[_0x0ae3('0x10')]])){if(queues[_0x175523['uniqueid']]['queuecallerleaveAt']){utils['debug'](util['format'](_0x0ae3('0x3f'),_0x175523[_0x0ae3('0x10')]),_0x175523);queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x1b')]=![];queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x1b')]=![];queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x30')]=null;queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x2c')]=![];queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x3a')]=null;queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x3b')]=!![];queues[_0x175523['uniqueid']][_0x0ae3('0x6')]=_0x175523[_0x0ae3('0x39')];queues[_0x175523[_0x0ae3('0x10')]]['queuecallercomplete']=!![];queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x1d')]=utils['now']();if(_0x175523['reason']=='transfer'){if(!queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x40')]){queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x1e')]=_0x0ae3('0x41');}}else{queues[_0x175523['uniqueid']][_0x0ae3('0x1e')]='COMPLETEDBY'+_0x175523[_0x0ae3('0x42')]['toUpperCase']();}utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x43'),_0x175523[_0x0ae3('0x10')],queues[_0x175523['uniqueid']]['name'],_0x175523[_0x0ae3('0x39')],queues[_0x175523[_0x0ae3('0x10')]][_0x0ae3('0x1e')]));writeDB(queues[_0x175523[_0x0ae3('0x10')]]);}}}catch(_0x33da83){utils[_0x0ae3('0x24')](util[_0x0ae3('0x3')](_0x0ae3('0x3f'),_0x175523[_0x0ae3('0x10')]),_0x33da83);}};exports['blindtransfer']=function(_0x3d6ed9){try{if(!_[_0x0ae3('0x18')](queues[_0x3d6ed9[_0x0ae3('0x44')]])){utils[_0x0ae3('0x12')](util[_0x0ae3('0x3')](_0x0ae3('0x45'),_0x3d6ed9[_0x0ae3('0x10')]),_0x3d6ed9);queues[_0x3d6ed9[_0x0ae3('0x44')]][_0x0ae3('0x40')]=!![];queues[_0x3d6ed9[_0x0ae3('0x44')]][_0x0ae3('0x46')]=_0x0ae3('0x47');queues[_0x3d6ed9[_0x0ae3('0x44')]][_0x0ae3('0x48')]=_0x3d6ed9[_0x0ae3('0x49')];queues[_0x3d6ed9[_0x0ae3('0x44')]][_0x0ae3('0x4a')]=_0x3d6ed9[_0x0ae3('0x44')];queues[_0x3d6ed9[_0x0ae3('0x44')]]['queuecallerexitreason']=_0x0ae3('0x4b');utils[_0x0ae3('0x2')](util['format'](_0x0ae3('0x4c'),_0x3d6ed9[_0x0ae3('0x10')],queues[_0x3d6ed9[_0x0ae3('0x44')]][_0x0ae3('0x21')],_0x3d6ed9[_0x0ae3('0x44')],_0x3d6ed9[_0x0ae3('0x49')]));}}catch(_0xb704d3){utils[_0x0ae3('0x24')](util[_0x0ae3('0x3')](_0x0ae3('0x45'),_0x3d6ed9[_0x0ae3('0x10')]),_0xb704d3);}};exports[_0x0ae3('0x4d')]=function(_0x587358){try{utils[_0x0ae3('0x12')](util[_0x0ae3('0x3')](_0x0ae3('0x4e'),_0x587358[_0x0ae3('0x4f')]),_0x587358);if(_0x587358['origtransfereruniqueid']==_0x587358[_0x0ae3('0x50')]){if(!_['isNil'](queues[_0x587358['secondtransfererlinkedid']])){utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x51'),_0x587358[_0x0ae3('0x4f')],queues[_0x587358[_0x0ae3('0x52')]]['name'],_0x587358[_0x0ae3('0x53')]));queues[_0x587358[_0x0ae3('0x52')]][_0x0ae3('0x40')]=!![];queues[_0x587358[_0x0ae3('0x52')]]['transfertype']=_0x0ae3('0x54');queues[_0x587358[_0x0ae3('0x52')]][_0x0ae3('0x48')]=_0x587358[_0x0ae3('0x53')];queues[_0x587358[_0x0ae3('0x52')]][_0x0ae3('0x4a')]=_0x587358[_0x0ae3('0x4f')];queues[_0x587358[_0x0ae3('0x52')]][_0x0ae3('0x1e')]=_0x0ae3('0x55');}if(!_[_0x0ae3('0x18')](queues[_0x587358['origtransfererlinkedid']])){if(_0x587358[_0x0ae3('0x56')]&&queues[_0x587358[_0x0ae3('0x56')]]){queues[_0x587358[_0x0ae3('0x56')]]['queuecallerenterreason']=0x1;queues[_0x587358['transfereeuniqueid']]=_[_0x0ae3('0x57')](queues[_0x587358[_0x0ae3('0x56')]]);queues[_0x587358['transfereeuniqueid']][_0x0ae3('0xf')]=_0x587358[_0x0ae3('0x58')];queues[_0x587358[_0x0ae3('0x44')]][_0x0ae3('0x23')]=0x2;queues[_0x587358[_0x0ae3('0x44')]][_0x0ae3('0x7')]=queues[_0x587358[_0x0ae3('0x52')]][_0x0ae3('0x7')];queues[_0x587358[_0x0ae3('0x44')]][_0x0ae3('0x59')]=queues[_0x587358[_0x0ae3('0x52')]][_0x0ae3('0x59')];queues[_0x587358[_0x0ae3('0x44')]][_0x0ae3('0x5a')]=utils[_0x0ae3('0x15')]();queues[_0x587358[_0x0ae3('0x44')]][_0x0ae3('0x1a')]=utils[_0x0ae3('0x15')]();queues[_0x587358[_0x0ae3('0x44')]][_0x0ae3('0x36')]=0x0;queues[_0x587358['transfereeuniqueid']][_0x0ae3('0x5b')]=0x0;utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x5c'),_0x587358[_0x0ae3('0x4f')],queues[_0x587358['transfereeuniqueid']][_0x0ae3('0x21')],queues[_0x587358[_0x0ae3('0x44')]][_0x0ae3('0x7')],queues[_0x587358[_0x0ae3('0x44')]]['calleridname']));}else{utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x5d'),_0x587358[_0x0ae3('0x4f')],queues[_0x587358[_0x0ae3('0x50')]][_0x0ae3('0x21')],_0x587358[_0x0ae3('0x52')]));queues[_0x587358['origtransfererlinkedid']][_0x0ae3('0xf')]=_0x587358[_0x0ae3('0x52')];}}}else if(_0x587358['secondtransfereruniqueid']==_0x587358[_0x0ae3('0x52')]){if(!_[_0x0ae3('0x18')](queues[_0x587358[_0x0ae3('0x50')]])){utils[_0x0ae3('0x2')](util['format'](_0x0ae3('0x5e'),_0x587358['origtransfereruniqueid'],queues[_0x587358['origtransfererlinkedid']][_0x0ae3('0x21')],_0x587358[_0x0ae3('0x5f')],_0x587358[_0x0ae3('0x60')]));queues[_0x587358[_0x0ae3('0x50')]]['transfer']=!![];queues[_0x587358[_0x0ae3('0x50')]][_0x0ae3('0x46')]=_0x0ae3('0x54');queues[_0x587358[_0x0ae3('0x50')]][_0x0ae3('0x48')]=_0x587358[_0x0ae3('0x60')];queues[_0x587358[_0x0ae3('0x50')]][_0x0ae3('0x4a')]=_0x587358['secondtransfereruniqueid'];queues[_0x587358[_0x0ae3('0x50')]][_0x0ae3('0x1e')]=_0x0ae3('0x55');}if(!_[_0x0ae3('0x18')](queues[_0x587358[_0x0ae3('0x52')]])){if(_0x587358[_0x0ae3('0x61')]&&queues[_0x587358[_0x0ae3('0x61')]]){queues[_0x587358[_0x0ae3('0x61')]][_0x0ae3('0x23')]=0x1;queues[_0x587358[_0x0ae3('0x58')]]=_[_0x0ae3('0x57')](queues[_0x587358[_0x0ae3('0x61')]]);queues[_0x587358[_0x0ae3('0x58')]][_0x0ae3('0xf')]=_0x587358[_0x0ae3('0x58')];queues[_0x587358[_0x0ae3('0x58')]][_0x0ae3('0x23')]=0x2;queues[_0x587358[_0x0ae3('0x58')]]['calleridnum']=queues[_0x587358['origtransfererlinkedid']][_0x0ae3('0x7')];queues[_0x587358[_0x0ae3('0x58')]][_0x0ae3('0x59')]=queues[_0x587358[_0x0ae3('0x50')]][_0x0ae3('0x59')];queues[_0x587358[_0x0ae3('0x58')]]['queuecallerjoinAt']=utils[_0x0ae3('0x15')]();queues[_0x587358[_0x0ae3('0x58')]][_0x0ae3('0x1a')]=utils[_0x0ae3('0x15')]();queues[_0x587358['transfertargetuniqueid']][_0x0ae3('0x36')]=0x0;queues[_0x587358[_0x0ae3('0x58')]]['mohtime']=0x0;utils['info'](util[_0x0ae3('0x3')](_0x0ae3('0x62'),_0x587358[_0x0ae3('0x4f')],queues[_0x587358[_0x0ae3('0x58')]][_0x0ae3('0x21')],queues[_0x587358['transfertargetuniqueid']][_0x0ae3('0xf')],queues[_0x587358[_0x0ae3('0x58')]][_0x0ae3('0x7')],queues[_0x587358[_0x0ae3('0x58')]][_0x0ae3('0x59')]));}else{utils[_0x0ae3('0x2')](util['format'](_0x0ae3('0x5d'),_0x587358[_0x0ae3('0x4f')],queues[_0x587358['secondtransfererlinkedid']][_0x0ae3('0x21')],_0x587358['origtransfererlinkedid']));queues[_0x587358['secondtransfererlinkedid']][_0x0ae3('0xf')]=_0x587358[_0x0ae3('0x50')];}}}}catch(_0x16b22e){utils[_0x0ae3('0x24')](util[_0x0ae3('0x3')](_0x0ae3('0x4e'),_0x587358['origtransfereruniqueid']),_0x16b22e);}};exports[_0x0ae3('0x63')]=function(_0x3cd8e7){try{if(!_['isNil'](queues[_0x3cd8e7['uniqueid']])){utils[_0x0ae3('0x12')](util[_0x0ae3('0x3')](_0x0ae3('0x64'),_0x3cd8e7['uniqueid']),_0x3cd8e7);queues[_0x3cd8e7[_0x0ae3('0x10')]]['musiconholdstartAt']=utils['now']();utils[_0x0ae3('0x2')](util[_0x0ae3('0x3')](_0x0ae3('0x65'),_0x3cd8e7[_0x0ae3('0x10')],queues[_0x3cd8e7[_0x0ae3('0x10')]]['name'],queues[_0x3cd8e7[_0x0ae3('0x10')]][_0x0ae3('0x66')]));}}catch(_0x1bd089){utils[_0x0ae3('0x24')](util[_0x0ae3('0x3')](_0x0ae3('0x64'),_0x3cd8e7[_0x0ae3('0x10')]),_0x1bd089);}};exports['musiconholdstop']=function(_0x2d8cdc){try{if(!_[_0x0ae3('0x18')](queues[_0x2d8cdc[_0x0ae3('0x10')]])){if(!_[_0x0ae3('0x18')](queues[_0x2d8cdc[_0x0ae3('0x10')]][_0x0ae3('0x66')])){utils[_0x0ae3('0x12')](util[_0x0ae3('0x3')](_0x0ae3('0x67'),_0x2d8cdc[_0x0ae3('0x10')]),_0x2d8cdc);queues[_0x2d8cdc[_0x0ae3('0x10')]][_0x0ae3('0x5b')]+=utils[_0x0ae3('0x37')](utils[_0x0ae3('0x15')](),queues[_0x2d8cdc['uniqueid']][_0x0ae3('0x66')]);utils['info'](util[_0x0ae3('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x2d8cdc['uniqueid'],queues[_0x2d8cdc['uniqueid']]['name'],queues[_0x2d8cdc[_0x0ae3('0x10')]][_0x0ae3('0x5b')]));delete queues[_0x2d8cdc[_0x0ae3('0x10')]][_0x0ae3('0x66')];}}}catch(_0x2f7d28){utils['error'](util['format'](_0x0ae3('0x67'),_0x2d8cdc['uniqueid']),_0x2f7d28);}}; \ No newline at end of file +var _0xbc2e=['request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','queueposition','queuecallerabandonAt','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfereelinkedid','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','clone','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type'];(function(_0x42be20,_0x5f4866){var _0x4168d7=function(_0x1432bc){while(--_0x1432bc){_0x42be20['push'](_0x42be20['shift']());}};_0x4168d7(++_0x5f4866);}(_0xbc2e,0xb9));var _0xebc2=function(_0x55a108,_0x13f86c){_0x55a108=_0x55a108-0x0;var _0x4caf93=_0xbc2e[_0x55a108];return _0x4caf93;};'use strict';var _=require(_0xebc2('0x0'));var util=require(_0xebc2('0x1'));var utils=require(_0xebc2('0x2'));var queues={};function writeDB(_0x2b06bf){utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x5'),_0x2b06bf[_0xebc2('0x6')],_0x2b06bf['channel'],_0x2b06bf[_0xebc2('0x7')],_0x2b06bf[_0xebc2('0x8')],_0x2b06bf[_0xebc2('0x9')],_0x2b06bf[_0xebc2('0xa')],_0x2b06bf[_0xebc2('0xb')]));if(_0x2b06bf[_0xebc2('0x7')]){utils[_0xebc2('0xc')](_0x2b06bf[_0xebc2('0x7')])[_0xebc2('0xd')](function(_0x3d5b44){if(_0x3d5b44){_0x2b06bf[_0xebc2('0xe')]=_0x3d5b44[_0xebc2('0xe')];}utils[_0xebc2('0xf')]('CreateVoiceQueueReport',_0x2b06bf);});}else{utils['request'](_0xebc2('0x10'),_0x2b06bf);}if(_0x2b06bf[_0xebc2('0x11')]){delete queues[_0x2b06bf['transfereduniqueid']];}else{delete queues[_0x2b06bf['uniqueid']];}}exports[_0xebc2('0x12')]=function(_0x474162){try{utils[_0xebc2('0x13')](util['format'](_0xebc2('0x14'),_0x474162[_0xebc2('0x6')]),_0x474162);utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x15'),_0x474162[_0xebc2('0x6')],_0x474162['queue'],_0x474162['position']));queues[_0x474162[_0xebc2('0x6')]]=_[_0xebc2('0x16')](_0x474162,{'originalposition':_0x474162[_0xebc2('0x17')],'queuecallerjoinAt':utils[_0xebc2('0x18')](),'mohtime':0x0});}catch(_0x2249d1){utils[_0xebc2('0x19')](util['format'](_0xebc2('0x14'),_0x474162[_0xebc2('0x6')]),_0x2249d1);}};exports['hangup']=function(_0x4b4ac7){try{if(!_[_0xebc2('0x1a')](queues[_0x4b4ac7['uniqueid']])){utils['debug'](util['format'](_0xebc2('0x1b'),_0x4b4ac7[_0xebc2('0x6')]),_0x4b4ac7);if(queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x1c')]){if(!queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x1d')]&&!queues[_0x4b4ac7[_0xebc2('0x6')]]['queuecallerexit']){queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x1e')]=!![];queues[_0x4b4ac7[_0xebc2('0x6')]]['queuecallercompleteAt']=utils[_0xebc2('0x18')]();queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0xb')]=_0xebc2('0x1f');}utils['info'](util[_0xebc2('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x4b4ac7[_0xebc2('0x6')],queues[_0x4b4ac7['uniqueid']][_0xebc2('0x20')],queues[_0x4b4ac7['uniqueid']][_0xebc2('0xb')]));writeDB(queues[_0x4b4ac7[_0xebc2('0x6')]]);}else if(queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x11')]){utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x21'),_0x4b4ac7[_0xebc2('0x6')],queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x20')],queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x11')]));queues[queues[_0x4b4ac7['uniqueid']][_0xebc2('0x11')]]=queues[_0x4b4ac7[_0xebc2('0x6')]];queues[queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x11')]][_0xebc2('0x22')]=0x2;delete queues[_0x4b4ac7['uniqueid']];}}}catch(_0x3bb70b){utils['error'](util[_0xebc2('0x4')](_0xebc2('0x1b'),_0x4b4ac7[_0xebc2('0x6')]),_0x3bb70b);}};exports[_0xebc2('0x23')]=function(_0x212592){try{utils['debug'](util[_0xebc2('0x4')](_0xebc2('0x24'),_0x212592[_0xebc2('0x6')]),_0x212592);if(!_[_0xebc2('0x1a')](_0x212592[_0xebc2('0x25')][_0xebc2('0x26')])&&_0x212592[_0xebc2('0x27')][_0xebc2('0x28')]()!==_0xebc2('0x29')){if(!_[_0xebc2('0x1a')](queues[_0x212592['uniqueid']])){queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x1d')]=![];queues[_0x212592['uniqueid']]['queuecallerabandonAt']=null;queues[_0x212592['uniqueid']][_0xebc2('0x2a')]=!![];queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x2b')]=utils['now']();queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0xb')]=_0x212592[_0xebc2('0x27')][_0xebc2('0x28')]();utils[_0xebc2('0x3')](util[_0xebc2('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x212592[_0xebc2('0x6')],queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x20')],_0x212592[_0xebc2('0x27')],queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0xb')]));writeDB(queues[_0x212592['uniqueid']]);}}else if(!_[_0xebc2('0x1a')](_0x212592['variable'][_0xebc2('0x2c')])){if(!_[_0xebc2('0x1a')](queues[_0x212592[_0xebc2('0x6')]])&&!queues[_0x212592['uniqueid']]['queuecallerabandon']){queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x1d')]=![];queues[_0x212592['uniqueid']][_0xebc2('0x2d')]=null;queues[_0x212592['uniqueid']][_0xebc2('0x2a')]=!![];queues[_0x212592['uniqueid']][_0xebc2('0x2b')]=utils[_0xebc2('0x18')]();queues[_0x212592['uniqueid']][_0xebc2('0xb')]='EXITWITHKEY';utils[_0xebc2('0x3')](util[_0xebc2('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x212592[_0xebc2('0x6')],queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x20')],_0x212592[_0xebc2('0x27')],queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0xb')]));}}}catch(_0x770ee4){utils['error'](util[_0xebc2('0x4')](_0xebc2('0x24'),_0x212592[_0xebc2('0x6')]),_0x770ee4);}};exports['queuecallerabandon']=function(_0x5d9a3d){try{if(!_[_0xebc2('0x1a')](queues[_0x5d9a3d[_0xebc2('0x6')]])){utils['debug'](util['format'](_0xebc2('0x2e'),_0x5d9a3d[_0xebc2('0x6')]),_0x5d9a3d);queues[_0x5d9a3d['uniqueid']][_0xebc2('0x2a')]=![];queues[_0x5d9a3d[_0xebc2('0x6')]][_0xebc2('0x2b')]=null;queues[_0x5d9a3d['uniqueid']][_0xebc2('0x1d')]=!![];queues[_0x5d9a3d[_0xebc2('0x6')]][_0xebc2('0x2d')]=utils[_0xebc2('0x18')]();queues[_0x5d9a3d[_0xebc2('0x6')]][_0xebc2('0xb')]='ABANDONED';utils[_0xebc2('0x3')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x5d9a3d['uniqueid'],queues[_0x5d9a3d[_0xebc2('0x6')]]['name'],queues[_0x5d9a3d[_0xebc2('0x6')]][_0xebc2('0xb')]));}}catch(_0x3af33c){utils[_0xebc2('0x19')](util['format'](_0xebc2('0x2e'),_0x5d9a3d[_0xebc2('0x6')]),_0x3af33c);}};exports[_0xebc2('0x2f')]=function(_0x577c49){try{if(!_[_0xebc2('0x1a')](queues[_0x577c49['uniqueid']])){utils['debug'](util['format'](_0xebc2('0x30'),_0x577c49['uniqueid']),_0x577c49);utils['info'](util['format'](_0xebc2('0x31'),_0x577c49[_0xebc2('0x6')],queues[_0x577c49['uniqueid']][_0xebc2('0x20')],_0x577c49[_0xebc2('0x32')],_0x577c49['connectedlinename']));queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x2f')]=!![];queues[_0x577c49[_0xebc2('0x6')]]['queuecallerleaveAt']=utils[_0xebc2('0x18')]();queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x33')]=utils[_0xebc2('0x34')](queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x1c')],queues[_0x577c49['uniqueid']][_0xebc2('0x35')]);queues[_0x577c49['uniqueid']]['position']=_0x577c49['position'];queues[_0x577c49['uniqueid']][_0xebc2('0x36')]=_0x577c49[_0xebc2('0x36')];queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x32')]=_0x577c49[_0xebc2('0x32')];queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x37')]=_0x577c49[_0xebc2('0x37')];}}catch(_0x497ccf){utils[_0xebc2('0x19')](util[_0xebc2('0x4')]('[%s][queues][queuecallerleave]',_0x577c49[_0xebc2('0x6')]),_0x497ccf);}};exports[_0xebc2('0x38')]=function(_0x99d50f){try{if(!_[_0xebc2('0x1a')](queues[_0x99d50f[_0xebc2('0x6')]])){utils[_0xebc2('0x13')](util['format'](_0xebc2('0x39'),_0x99d50f[_0xebc2('0x6')]),_0x99d50f);utils['info'](util[_0xebc2('0x4')](_0xebc2('0x3a'),_0x99d50f[_0xebc2('0x6')],queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x20')],_0x99d50f[_0xebc2('0x3b')],_0x99d50f[_0xebc2('0x3c')]));queues[_0x99d50f['uniqueid']]['queuecallerabandon']=![];queues[_0x99d50f['uniqueid']][_0xebc2('0x1d')]=![];queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x2d')]=null;queues[_0x99d50f['uniqueid']][_0xebc2('0x2a')]=![];queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0xb')]=null;queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x2b')]=null;queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x3d')]=!![];queues[_0x99d50f[_0xebc2('0x6')]]['accountcode']=_0x99d50f[_0xebc2('0x3c')];queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x8')]=_0x99d50f[_0xebc2('0x3b')];}}catch(_0x56956b){utils[_0xebc2('0x19')](util[_0xebc2('0x4')](_0xebc2('0x39'),_0x99d50f[_0xebc2('0x6')]),_0x56956b);}};exports['agentcomplete']=function(_0x41362c){try{if(!_['isNil'](queues[_0x41362c[_0xebc2('0x6')]])){if(queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x1c')]){utils[_0xebc2('0x13')](util['format'](_0xebc2('0x3e'),_0x41362c[_0xebc2('0x6')]),_0x41362c);queues[_0x41362c[_0xebc2('0x6')]]['queuecallerabandon']=![];queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x1d')]=![];queues[_0x41362c[_0xebc2('0x6')]]['queuecallerabandonAt']=null;queues[_0x41362c['uniqueid']][_0xebc2('0x2a')]=![];queues[_0x41362c[_0xebc2('0x6')]]['queuecallerexitAt']=null;queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x3d')]=!![];queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x8')]=_0x41362c['membername'];queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x1e')]=!![];queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x3f')]=utils[_0xebc2('0x18')]();if(_0x41362c[_0xebc2('0x40')]==_0xebc2('0x41')){if(!queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x41')]){queues[_0x41362c[_0xebc2('0x6')]]['queuecallerexitreason']=_0xebc2('0x42');}}else{queues[_0x41362c[_0xebc2('0x6')]]['queuecallerexitreason']=_0xebc2('0x43')+_0x41362c[_0xebc2('0x40')][_0xebc2('0x28')]();}utils[_0xebc2('0x3')](util[_0xebc2('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x41362c['uniqueid'],queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x20')],_0x41362c['membername'],queues[_0x41362c['uniqueid']][_0xebc2('0xb')]));writeDB(queues[_0x41362c['uniqueid']]);}}}catch(_0x34b82e){utils[_0xebc2('0x19')](util[_0xebc2('0x4')](_0xebc2('0x3e'),_0x41362c['uniqueid']),_0x34b82e);}};exports[_0xebc2('0x44')]=function(_0x282fbc){try{if(!_[_0xebc2('0x1a')](queues[_0x282fbc[_0xebc2('0x45')]])){utils['debug'](util[_0xebc2('0x4')]('[%s][queues][blindtransfer]',_0x282fbc[_0xebc2('0x6')]),_0x282fbc);queues[_0x282fbc[_0xebc2('0x45')]][_0xebc2('0x41')]=!![];queues[_0x282fbc[_0xebc2('0x45')]][_0xebc2('0x46')]='BLIND';queues[_0x282fbc['transfereeuniqueid']][_0xebc2('0x47')]=_0x282fbc[_0xebc2('0x48')];queues[_0x282fbc[_0xebc2('0x45')]][_0xebc2('0x49')]=_0x282fbc[_0xebc2('0x45')];queues[_0x282fbc[_0xebc2('0x45')]][_0xebc2('0xb')]=_0xebc2('0x4a');utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x4b'),_0x282fbc[_0xebc2('0x6')],queues[_0x282fbc['transfereeuniqueid']]['name'],_0x282fbc[_0xebc2('0x45')],_0x282fbc[_0xebc2('0x48')]));}}catch(_0x1d9f98){utils[_0xebc2('0x19')](util[_0xebc2('0x4')](_0xebc2('0x4c'),_0x282fbc[_0xebc2('0x6')]),_0x1d9f98);}};exports[_0xebc2('0x4d')]=function(_0x5007c2){try{utils[_0xebc2('0x13')](util[_0xebc2('0x4')]('[%s][queues][attendedtransfer]',_0x5007c2[_0xebc2('0x4e')]),_0x5007c2);if(_0x5007c2[_0xebc2('0x4e')]==_0x5007c2[_0xebc2('0x4f')]){if(!_[_0xebc2('0x1a')](queues[_0x5007c2[_0xebc2('0x50')]])){utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x51'),_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x50')]]['name'],_0x5007c2[_0xebc2('0x52')]));queues[_0x5007c2['secondtransfererlinkedid']]['transfer']=!![];queues[_0x5007c2['secondtransfererlinkedid']][_0xebc2('0x46')]='ATTENDED';queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x47')]=_0x5007c2[_0xebc2('0x52')];queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x49')]=_0x5007c2[_0xebc2('0x4e')];queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xebc2('0x1a')](queues[_0x5007c2[_0xebc2('0x4f')]])){if(_0x5007c2[_0xebc2('0x53')]&&queues[_0x5007c2[_0xebc2('0x53')]]){queues[_0x5007c2[_0xebc2('0x53')]]['queuecallerenterreason']=0x1;queues[_0x5007c2[_0xebc2('0x45')]]=_['clone'](queues[_0x5007c2['transfereelinkedid']]);queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x11')]=_0x5007c2[_0xebc2('0x54')];queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x22')]=0x2;queues[_0x5007c2['transfereeuniqueid']][_0xebc2('0x9')]=queues[_0x5007c2[_0xebc2('0x50')]]['calleridnum'];queues[_0x5007c2[_0xebc2('0x45')]]['calleridname']=queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x55')];queues[_0x5007c2['transfereeuniqueid']][_0xebc2('0x35')]=utils[_0xebc2('0x18')]();queues[_0x5007c2['transfereeuniqueid']][_0xebc2('0x1c')]=utils[_0xebc2('0x18')]();queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x33')]=0x0;queues[_0x5007c2[_0xebc2('0x45')]]['mohtime']=0x0;utils[_0xebc2('0x3')](util['format'](_0xebc2('0x56'),_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x20')],queues[_0x5007c2[_0xebc2('0x45')]]['calleridnum'],queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x55')]));}else{utils[_0xebc2('0x3')](util['format'](_0xebc2('0x57'),_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x20')],_0x5007c2[_0xebc2('0x50')]));queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x11')]=_0x5007c2[_0xebc2('0x50')];}}}else if(_0x5007c2[_0xebc2('0x58')]==_0x5007c2[_0xebc2('0x50')]){if(!_['isNil'](queues[_0x5007c2['origtransfererlinkedid']])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x20')],_0x5007c2[_0xebc2('0x58')],_0x5007c2[_0xebc2('0x59')]));queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x41')]=!![];queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x46')]=_0xebc2('0x5a');queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x47')]=_0x5007c2[_0xebc2('0x59')];queues[_0x5007c2['origtransfererlinkedid']][_0xebc2('0x49')]=_0x5007c2[_0xebc2('0x58')];queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xebc2('0x1a')](queues[_0x5007c2['secondtransfererlinkedid']])){if(_0x5007c2[_0xebc2('0x5b')]&&queues[_0x5007c2[_0xebc2('0x5b')]]){queues[_0x5007c2[_0xebc2('0x5b')]][_0xebc2('0x22')]=0x1;queues[_0x5007c2['transfertargetuniqueid']]=_[_0xebc2('0x5c')](queues[_0x5007c2[_0xebc2('0x5b')]]);queues[_0x5007c2[_0xebc2('0x54')]]['transfereduniqueid']=_0x5007c2[_0xebc2('0x54')];queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x22')]=0x2;queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x9')]=queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x9')];queues[_0x5007c2[_0xebc2('0x54')]]['calleridname']=queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x55')];queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x35')]=utils[_0xebc2('0x18')]();queues[_0x5007c2['transfertargetuniqueid']][_0xebc2('0x1c')]=utils[_0xebc2('0x18')]();queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x33')]=0x0;queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x5d')]=0x0;utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x5e'),_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2['transfertargetuniqueid']][_0xebc2('0x20')],queues[_0x5007c2['transfertargetuniqueid']][_0xebc2('0x11')],queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x9')],queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x55')]));}else{utils[_0xebc2('0x3')](util[_0xebc2('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x20')],_0x5007c2[_0xebc2('0x4f')]));queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x11')]=_0x5007c2[_0xebc2('0x4f')];}}}}catch(_0x2c6e37){utils[_0xebc2('0x19')](util[_0xebc2('0x4')]('[%s][queues][attendedtransfer]',_0x5007c2[_0xebc2('0x4e')]),_0x2c6e37);}};exports[_0xebc2('0x5f')]=function(_0x16d791){try{if(!_[_0xebc2('0x1a')](queues[_0x16d791['uniqueid']])){utils[_0xebc2('0x13')](util[_0xebc2('0x4')]('[%s][queues][musiconholdstart]',_0x16d791[_0xebc2('0x6')]),_0x16d791);queues[_0x16d791[_0xebc2('0x6')]][_0xebc2('0x60')]=utils['now']();utils[_0xebc2('0x3')](util['format'](_0xebc2('0x61'),_0x16d791[_0xebc2('0x6')],queues[_0x16d791[_0xebc2('0x6')]][_0xebc2('0x20')],queues[_0x16d791[_0xebc2('0x6')]][_0xebc2('0x60')]));}}catch(_0x2e69be){utils[_0xebc2('0x19')](util[_0xebc2('0x4')](_0xebc2('0x62'),_0x16d791[_0xebc2('0x6')]),_0x2e69be);}};exports['musiconholdstop']=function(_0x1d6150){try{if(!_[_0xebc2('0x1a')](queues[_0x1d6150[_0xebc2('0x6')]])){if(!_[_0xebc2('0x1a')](queues[_0x1d6150[_0xebc2('0x6')]][_0xebc2('0x60')])){utils['debug'](util['format']('[%s][queues][musiconholdstop]',_0x1d6150['uniqueid']),_0x1d6150);queues[_0x1d6150[_0xebc2('0x6')]][_0xebc2('0x5d')]+=utils[_0xebc2('0x34')](utils[_0xebc2('0x18')](),queues[_0x1d6150['uniqueid']][_0xebc2('0x60')]);utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x63'),_0x1d6150['uniqueid'],queues[_0x1d6150['uniqueid']][_0xebc2('0x20')],queues[_0x1d6150[_0xebc2('0x6')]][_0xebc2('0x5d')]));delete queues[_0x1d6150[_0xebc2('0x6')]]['musiconholdstartAt'];}}}catch(_0x4f5834){utils[_0xebc2('0x19')](util[_0xebc2('0x4')]('[%s][queues][musiconholdstop]',_0x1d6150[_0xebc2('0x6')]),_0x4f5834);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c8313bc..ea08717 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 _0x35d4=['CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','request'];(function(_0x3d48a3,_0x5a1d83){var _0x5400ea=function(_0x40e289){while(--_0x40e289){_0x3d48a3['push'](_0x3d48a3['shift']());}};_0x5400ea(++_0x5a1d83);}(_0x35d4,0xe4));var _0x435d=function(_0x416717,_0x3e6737){_0x416717=_0x416717-0x0;var _0x53024c=_0x35d4[_0x416717];return _0x53024c;};'use strict';var _=require(_0x435d('0x0'));var util=require(_0x435d('0x1'));var utils=require(_0x435d('0x2'));var recordings={};function writeDB(_0x1d29ba){utils[_0x435d('0x3')](util[_0x435d('0x4')](_0x435d('0x5'),_0x1d29ba[_0x435d('0x6')]));if(_0x1d29ba[_0x435d('0x7')]){utils['getUserByInternal'](_0x1d29ba[_0x435d('0x7')])[_0x435d('0x8')](function(_0x27c67e){if(_0x27c67e){_0x1d29ba[_0x435d('0x9')]=_0x27c67e[_0x435d('0xa')];_0x1d29ba['UserId']=_0x27c67e['id'];}utils[_0x435d('0xb')](_0x435d('0xc'),_0x1d29ba);});}else{utils['request'](_0x435d('0xc'),_0x1d29ba);}}exports[_0x435d('0xd')]=function(_0x333008){try{utils['debug'](util[_0x435d('0x4')](_0x435d('0xe'),_0x333008[_0x435d('0x6')]),_0x333008);if(_0x333008['uniqueid']==_0x333008[_0x435d('0xf')]){utils[_0x435d('0x3')](util[_0x435d('0x4')](_0x435d('0x10'),_0x333008['uniqueid'],_0x333008[_0x435d('0x11')],_0x333008[_0x435d('0x12')]));recordings[_0x333008[_0x435d('0x6')]]={'uniqueid':_0x333008[_0x435d('0x6')],'accountcode':_0x333008[_0x435d('0x7')],'exten':_0x333008[_0x435d('0x12')],'context':_0x333008[_0x435d('0x11')],'channel':_0x333008[_0x435d('0x13')],'monitors':[]};}}catch(_0x467982){utils[_0x435d('0x14')](util[_0x435d('0x4')]('[%s][recordings][newchannel]',_0x333008[_0x435d('0x6')]),_0x467982);}};exports[_0x435d('0x15')]=function(_0x352370){try{utils[_0x435d('0x16')](util['format'](_0x435d('0x17'),_0x352370[_0x435d('0x6')]),_0x352370);if(!_[_0x435d('0x18')](recordings[_0x352370['uniqueid']])&&_0x352370['channelstate']==0x6){utils['info'](util[_0x435d('0x4')](_0x435d('0x19'),_0x352370['uniqueid'],_0x352370[_0x435d('0x11')],_0x352370['channel']));}else if(!_[_0x435d('0x18')](recordings[_0x352370[_0x435d('0xf')]])&&_0x352370[_0x435d('0x1a')]==0x6&&_0x352370['context']!=_0x435d('0x1b')){utils[_0x435d('0x3')](util[_0x435d('0x4')](_0x435d('0x1c'),_0x352370[_0x435d('0x6')],_0x352370[_0x435d('0xf')],_0x352370[_0x435d('0x11')],_0x352370[_0x435d('0x13')]));recordings[_0x352370[_0x435d('0xf')]][_0x435d('0x7')]=_0x352370[_0x435d('0x7')];}}catch(_0x52b7e3){utils[_0x435d('0x14')](util[_0x435d('0x4')](_0x435d('0x17'),_0x352370[_0x435d('0x6')]),_0x52b7e3);}};exports[_0x435d('0x1d')]=function(_0x51abaf){try{if(!_[_0x435d('0x18')](_0x51abaf[_0x435d('0x1e')])&&!_[_0x435d('0x18')](_0x51abaf[_0x435d('0x1e')]['mixmonitor_filename'])){utils[_0x435d('0x16')](util[_0x435d('0x4')](_0x435d('0x1f'),_0x51abaf[_0x435d('0x6')]),_0x51abaf);utils[_0x435d('0x3')](util[_0x435d('0x4')](_0x435d('0x20'),_0x51abaf[_0x435d('0x6')],_0x51abaf['variable'],_0x51abaf[_0x435d('0x21')]));if(_['endsWith'](_0x51abaf[_0x435d('0x21')],_0x435d('0x22'))){_0x51abaf[_0x435d('0x21')]=_0x51abaf[_0x435d('0x21')][_0x435d('0x23')](_0x435d('0x22'),_0x435d('0x24'));}if(recordings[_0x51abaf[_0x435d('0xf')]]){var _0x5442bc=_['find'](recordings[_0x51abaf[_0x435d('0xf')]][_0x435d('0x25')],{'value':_0x51abaf[_0x435d('0x21')]});if(_[_0x435d('0x18')](_0x5442bc)){recordings[_0x51abaf[_0x435d('0xf')]][_0x435d('0x25')][_0x435d('0x26')]({'value':_0x51abaf[_0x435d('0x21')]});}}}}catch(_0x159f01){utils[_0x435d('0x14')](util[_0x435d('0x4')](_0x435d('0x1f'),_0x51abaf[_0x435d('0x6')]),_0x159f01);}};exports['hangup']=function(_0x281c4c){try{if(!_[_0x435d('0x18')](recordings[_0x281c4c[_0x435d('0x6')]])){utils[_0x435d('0x16')](util[_0x435d('0x4')](_0x435d('0x27'),_0x281c4c[_0x435d('0x6')]),_0x281c4c);utils[_0x435d('0x3')](util['format'](_0x435d('0x28'),_0x281c4c[_0x435d('0x6')],_0x281c4c[_0x435d('0x29')],_0x281c4c[_0x435d('0x2a')],_0x281c4c[_0x435d('0x2b')]));recordings[_0x281c4c['uniqueid']][_0x435d('0x29')]=_0x281c4c[_0x435d('0x29')];recordings[_0x281c4c['uniqueid']][_0x435d('0x2a')]=_0x281c4c[_0x435d('0x2a')];recordings[_0x281c4c[_0x435d('0x6')]][_0x435d('0x2c')]=_0x281c4c[_0x435d('0x2c')];recordings[_0x281c4c[_0x435d('0x6')]][_0x435d('0x2d')]=_0x281c4c['connectedlinename'];if(recordings[_0x281c4c[_0x435d('0x6')]]['type']==_0x435d('0x2e')&&recordings[_0x281c4c[_0x435d('0x6')]][_0x435d('0x7')]){recordings[_0x281c4c[_0x435d('0x6')]]['connectedlinenum']=recordings[_0x281c4c[_0x435d('0x6')]][_0x435d('0x7')];recordings[_0x281c4c[_0x435d('0x6')]][_0x435d('0x2d')]='';}recordings[_0x281c4c[_0x435d('0x6')]][_0x435d('0x25')]['forEach'](function(_0x3eee5d){var _0x202fd0=_['clone'](recordings[_0x281c4c[_0x435d('0x6')]]);_0x202fd0[_0x435d('0x21')]=_0x3eee5d[_0x435d('0x21')];writeDB(_0x202fd0);});delete recordings[_0x281c4c['uniqueid']];}}catch(_0x18a75c){utils[_0x435d('0x14')](util['format'](_0x435d('0x27'),_0x281c4c[_0x435d('0x6')]),_0x18a75c);}};exports[_0x435d('0x2f')]=function(_0x184c98){try{if(!_[_0x435d('0x18')](recordings[_0x184c98[_0x435d('0x6')]])){utils[_0x435d('0x16')](util[_0x435d('0x4')](_0x435d('0x30'),_0x184c98[_0x435d('0x6')]),_0x184c98);utils['info'](util[_0x435d('0x4')](_0x435d('0x31'),_0x184c98[_0x435d('0x6')],_0x184c98[_0x435d('0x32')],_0x184c98[_0x435d('0x33')]));if(_0x184c98[_0x435d('0x32')]['toLowerCase']()=='set'&&_[_0x435d('0x34')](_0x184c98[_0x435d('0x33')]['toLowerCase'](),_0x435d('0x35'))){var _0x527506=_0x184c98['appdata'][_0x435d('0x36')]('=');var _0x4adcc5=_0x527506[0x0][_0x435d('0x37')](_0x527506[0x0]['lastIndexOf']('(')+0x1,_0x527506[0x0][_0x435d('0x38')](')'));var _0x357b4a=_0x527506[0x1];recordings[_0x184c98[_0x435d('0x6')]][_0x4adcc5]=_0x357b4a;}}}catch(_0x1232da){utils[_0x435d('0x14')](util[_0x435d('0x4')](_0x435d('0x30'),_0x184c98['uniqueid']),_0x1232da);}};exports['queuecallerjoin']=function(_0x14d725){try{if(!_[_0x435d('0x18')](recordings[_0x14d725[_0x435d('0x6')]])){utils['debug'](util[_0x435d('0x4')](_0x435d('0x39'),_0x14d725[_0x435d('0x6')]),_0x14d725);utils[_0x435d('0x3')](util[_0x435d('0x4')](_0x435d('0x3a'),_0x14d725[_0x435d('0x6')],_0x14d725[_0x435d('0x3b')]));recordings[_0x14d725[_0x435d('0x6')]][_0x435d('0x3b')]=_0x14d725[_0x435d('0x3b')];}}catch(_0x758b38){utils[_0x435d('0x14')](util[_0x435d('0x4')](_0x435d('0x39'),_0x14d725[_0x435d('0x6')]),_0x758b38);}}; \ No newline at end of file +var _0xc752=['[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','uniqueid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','.WAV','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','cdr','split','lastIndexOf','[%s][recordings][queuecallerjoin]'];(function(_0x4bf038,_0x15bef3){var _0x2e5e8a=function(_0x4101d0){while(--_0x4101d0){_0x4bf038['push'](_0x4bf038['shift']());}};_0x2e5e8a(++_0x15bef3);}(_0xc752,0xf6));var _0x2c75=function(_0x101659,_0x3509fa){_0x101659=_0x101659-0x0;var _0x26ca66=_0xc752[_0x101659];return _0x26ca66;};'use strict';var _=require(_0x2c75('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x1074fd){utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x3'),_0x1074fd['uniqueid']));if(_0x1074fd[_0x2c75('0x4')]){utils[_0x2c75('0x5')](_0x1074fd[_0x2c75('0x4')])[_0x2c75('0x6')](function(_0x251d9e){if(_0x251d9e){_0x1074fd[_0x2c75('0x7')]=_0x251d9e[_0x2c75('0x8')];_0x1074fd[_0x2c75('0x9')]=_0x251d9e['id'];}utils[_0x2c75('0xa')](_0x2c75('0xb'),_0x1074fd);});}else{utils[_0x2c75('0xa')](_0x2c75('0xb'),_0x1074fd);}}exports[_0x2c75('0xc')]=function(_0x52e8cd){try{utils['debug'](util[_0x2c75('0x2')]('[%s][recordings][newchannel]',_0x52e8cd['uniqueid']),_0x52e8cd);if(_0x52e8cd[_0x2c75('0xd')]==_0x52e8cd['linkedid']){utils['info'](util['format'](_0x2c75('0xe'),_0x52e8cd[_0x2c75('0xd')],_0x52e8cd[_0x2c75('0xf')],_0x52e8cd[_0x2c75('0x10')]));recordings[_0x52e8cd[_0x2c75('0xd')]]={'uniqueid':_0x52e8cd[_0x2c75('0xd')],'accountcode':_0x52e8cd['accountcode'],'exten':_0x52e8cd[_0x2c75('0x10')],'context':_0x52e8cd[_0x2c75('0xf')],'channel':_0x52e8cd[_0x2c75('0x11')],'monitors':[]};}}catch(_0x2ecd4d){utils[_0x2c75('0x12')](util[_0x2c75('0x2')]('[%s][recordings][newchannel]',_0x52e8cd['uniqueid']),_0x2ecd4d);}};exports[_0x2c75('0x13')]=function(_0x2ba91d){try{utils[_0x2c75('0x14')](util[_0x2c75('0x2')](_0x2c75('0x15'),_0x2ba91d['uniqueid']),_0x2ba91d);if(!_['isNil'](recordings[_0x2ba91d[_0x2c75('0xd')]])&&_0x2ba91d[_0x2c75('0x16')]==0x6){utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x17'),_0x2ba91d[_0x2c75('0xd')],_0x2ba91d[_0x2c75('0xf')],_0x2ba91d[_0x2c75('0x11')]));}else if(!_[_0x2c75('0x18')](recordings[_0x2ba91d[_0x2c75('0x19')]])&&_0x2ba91d[_0x2c75('0x16')]==0x6&&_0x2ba91d[_0x2c75('0xf')]!=_0x2c75('0x1a')){utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x1b'),_0x2ba91d['uniqueid'],_0x2ba91d['linkedid'],_0x2ba91d[_0x2c75('0xf')],_0x2ba91d[_0x2c75('0x11')]));recordings[_0x2ba91d[_0x2c75('0x19')]][_0x2c75('0x4')]=_0x2ba91d[_0x2c75('0x4')];}}catch(_0x5d4360){utils[_0x2c75('0x12')](util[_0x2c75('0x2')]('[%s][recordings][newstate]',_0x2ba91d[_0x2c75('0xd')]),_0x5d4360);}};exports['varset']=function(_0x128444){try{if(!_[_0x2c75('0x18')](_0x128444[_0x2c75('0x1c')])&&!_[_0x2c75('0x18')](_0x128444[_0x2c75('0x1c')][_0x2c75('0x1d')])){utils[_0x2c75('0x14')](util['format'](_0x2c75('0x1e'),_0x128444['uniqueid']),_0x128444);utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x1f'),_0x128444[_0x2c75('0xd')],_0x128444[_0x2c75('0x1c')],_0x128444['value']));if(_[_0x2c75('0x20')](_0x128444['value'],'.wav49')){_0x128444[_0x2c75('0x21')]=_0x128444['value']['replace'](_0x2c75('0x22'),_0x2c75('0x23'));}if(recordings[_0x128444['linkedid']]){var _0x49d032=_['find'](recordings[_0x128444[_0x2c75('0x19')]]['monitors'],{'value':_0x128444[_0x2c75('0x21')]});if(_[_0x2c75('0x18')](_0x49d032)){recordings[_0x128444['linkedid']][_0x2c75('0x24')][_0x2c75('0x25')]({'value':_0x128444[_0x2c75('0x21')]});}}}}catch(_0x170c93){utils[_0x2c75('0x12')](util[_0x2c75('0x2')](_0x2c75('0x1e'),_0x128444[_0x2c75('0xd')]),_0x170c93);}};exports[_0x2c75('0x26')]=function(_0x38f90d){try{if(!_[_0x2c75('0x18')](recordings[_0x38f90d[_0x2c75('0xd')]])){utils[_0x2c75('0x14')](util[_0x2c75('0x2')](_0x2c75('0x27'),_0x38f90d[_0x2c75('0xd')]),_0x38f90d);utils[_0x2c75('0x1')](util[_0x2c75('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x38f90d[_0x2c75('0xd')],_0x38f90d[_0x2c75('0x28')],_0x38f90d['calleridname'],_0x38f90d[_0x2c75('0x29')]));recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x28')]=_0x38f90d[_0x2c75('0x28')];recordings[_0x38f90d[_0x2c75('0xd')]]['calleridname']=_0x38f90d[_0x2c75('0x2a')];recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x2b')]=_0x38f90d[_0x2c75('0x2b')];recordings[_0x38f90d['uniqueid']][_0x2c75('0x2c')]=_0x38f90d[_0x2c75('0x2c')];if(recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x2d')]==_0x2c75('0x2e')&&recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x4')]){recordings[_0x38f90d['uniqueid']][_0x2c75('0x2b')]=recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x4')];recordings[_0x38f90d[_0x2c75('0xd')]]['connectedlinename']='';}recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x24')]['forEach'](function(_0x29ce3e){var _0x2366a7=_[_0x2c75('0x2f')](recordings[_0x38f90d[_0x2c75('0xd')]]);_0x2366a7['value']=_0x29ce3e[_0x2c75('0x21')];writeDB(_0x2366a7);});delete recordings[_0x38f90d['uniqueid']];}}catch(_0x356430){utils[_0x2c75('0x12')](util['format'](_0x2c75('0x27'),_0x38f90d[_0x2c75('0xd')]),_0x356430);}};exports[_0x2c75('0x30')]=function(_0x5c1124){try{if(!_[_0x2c75('0x18')](recordings[_0x5c1124[_0x2c75('0xd')]])){utils[_0x2c75('0x14')](util[_0x2c75('0x2')](_0x2c75('0x31'),_0x5c1124[_0x2c75('0xd')]),_0x5c1124);utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x32'),_0x5c1124['uniqueid'],_0x5c1124['application'],_0x5c1124[_0x2c75('0x33')]));if(_0x5c1124[_0x2c75('0x34')]['toLowerCase']()==_0x2c75('0x35')&&_[_0x2c75('0x36')](_0x5c1124[_0x2c75('0x33')]['toLowerCase'](),_0x2c75('0x37'))){var _0x22eba=_0x5c1124[_0x2c75('0x33')][_0x2c75('0x38')]('=');var _0x4ce235=_0x22eba[0x0]['substring'](_0x22eba[0x0][_0x2c75('0x39')]('(')+0x1,_0x22eba[0x0][_0x2c75('0x39')](')'));var _0xc62588=_0x22eba[0x1];recordings[_0x5c1124[_0x2c75('0xd')]][_0x4ce235]=_0xc62588;}}}catch(_0x249bad){utils[_0x2c75('0x12')](util[_0x2c75('0x2')](_0x2c75('0x31'),_0x5c1124[_0x2c75('0xd')]),_0x249bad);}};exports['queuecallerjoin']=function(_0x5c90b5){try{if(!_[_0x2c75('0x18')](recordings[_0x5c90b5[_0x2c75('0xd')]])){utils[_0x2c75('0x14')](util[_0x2c75('0x2')](_0x2c75('0x3a'),_0x5c90b5[_0x2c75('0xd')]),_0x5c90b5);utils[_0x2c75('0x1')](util['format'](_0x2c75('0x3b'),_0x5c90b5['uniqueid'],_0x5c90b5[_0x2c75('0x3c')]));recordings[_0x5c90b5[_0x2c75('0xd')]][_0x2c75('0x3c')]=_0x5c90b5[_0x2c75('0x3c')];}}catch(_0x292b49){utils[_0x2c75('0x12')](util[_0x2c75('0x2')](_0x2c75('0x3a'),_0x5c90b5[_0x2c75('0xd')]),_0x292b49);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 7188a6a..ffb0261 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 _0x6120=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetchannel'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6120,0x9f));var _0x0612=function(_0x16aa19,_0x2c6d9c){_0x16aa19=_0x16aa19-0x0;var _0x3e385c=_0x6120[_0x16aa19];return _0x3e385c;};'use strict';var _=require('lodash');var util=require(_0x0612('0x0'));var utils=require('./utils');function writeDB(_0x54e05b){utils[_0x0612('0x1')](util[_0x0612('0x2')](_0x0612('0x3'),_0x54e05b[_0x0612('0x4')]===_0x0612('0x5')?_0x54e05b['origtransfereruniqueid']:_0x54e05b[_0x0612('0x6')],_0x54e05b[_0x0612('0x4')]));utils[_0x0612('0x7')]('CreateVoiceTransferReport',_0x54e05b);}exports[_0x0612('0x8')]={};exports[_0x0612('0x9')]=function(_0x48db35){try{utils[_0x0612('0xa')](util[_0x0612('0x2')](_0x0612('0xb'),_0x48db35[_0x0612('0x6')]),_0x48db35);utils['info'](util[_0x0612('0x2')](_0x0612('0xc'),_0x48db35['uniqueid'],_0x48db35['transferercalleridnum'],_0x48db35[_0x0612('0xd')],_0x48db35[_0x0612('0xe')],_0x48db35[_0x0612('0xf')]));_0x48db35[_0x0612('0x4')]=_0x0612('0x10');exports['blinds'][_0x48db35[_0x0612('0x11')]]=_0x48db35;writeDB(_0x48db35);}catch(_0x486b28){utils[_0x0612('0x12')](util[_0x0612('0x2')](_0x0612('0xb'),_0x48db35[_0x0612('0x6')]),_0x486b28);}};exports[_0x0612('0x13')]=function(_0x293d39){try{utils[_0x0612('0xa')](util[_0x0612('0x2')](_0x0612('0x14'),_0x293d39[_0x0612('0x15')]),_0x293d39);utils[_0x0612('0x1')](util[_0x0612('0x2')](_0x0612('0x16'),_0x293d39['origtransfereruniqueid'],_0x293d39[_0x0612('0x17')],_0x293d39[_0x0612('0x18')],_0x293d39[_0x0612('0x19')],_0x293d39[_0x0612('0x1a')]));_0x293d39=_[_0x0612('0x1b')](_0x293d39,{'transfererchannel':_0x293d39[_0x0612('0x1c')],'transferercalleridnum':_0x293d39[_0x0612('0x17')],'transferercalleridname':_0x293d39[_0x0612('0x18')],'transfererconnectedlinenum':_0x293d39['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x293d39['secondtransfererconnectedlinename'],'transfereraccountcode':_0x293d39[_0x0612('0x1d')],'transferercontext':_0x293d39['secondtransferercontext'],'transfererexten':_0x293d39[_0x0612('0x1e')],'transfererlinkedid':_0x293d39[_0x0612('0x1f')],'context':_0x293d39['origtransferercontext'],'extension':_0x293d39[_0x0612('0x20')],'type':'attended'});if(_[_0x0612('0x21')](_0x293d39[_0x0612('0x22')])){_0x293d39=_[_0x0612('0x1b')](_0x293d39,{'transfereechannel':_0x293d39[_0x0612('0x23')],'transfereecalleridnum':_0x293d39[_0x0612('0x19')],'transfereecalleridname':_0x293d39[_0x0612('0x1a')],'transfereeconnectedlinenum':_0x293d39[_0x0612('0x24')],'transfereeconnectedlinename':_0x293d39[_0x0612('0x25')],'transfereeaccountcode':_0x293d39['transfertargetaccountcode'],'transfereecontext':_0x293d39[_0x0612('0x26')],'transfereeexten':_0x293d39['transfertargetexten'],'transfereelinkedid':_0x293d39['transfertargetlinkedid']});}writeDB(_0x293d39);}catch(_0x3d09fa){utils[_0x0612('0x12')](util[_0x0612('0x2')](_0x0612('0x14'),_0x293d39[_0x0612('0x15')]),_0x3d09fa);}}; \ No newline at end of file +var _0x5ede=['transferercalleridname','transfereecalleridnum','blind','blinds','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum'];(function(_0x3443b3,_0x308277){var _0x23eddb=function(_0x1aca07){while(--_0x1aca07){_0x3443b3['push'](_0x3443b3['shift']());}};_0x23eddb(++_0x308277);}(_0x5ede,0x6e));var _0xe5ed=function(_0x4df6ba,_0x477c3e){_0x4df6ba=_0x4df6ba-0x0;var _0x472acf=_0x5ede[_0x4df6ba];return _0x472acf;};'use strict';var _=require(_0xe5ed('0x0'));var util=require(_0xe5ed('0x1'));var utils=require(_0xe5ed('0x2'));function writeDB(_0x5d0e74){utils[_0xe5ed('0x3')](util[_0xe5ed('0x4')](_0xe5ed('0x5'),_0x5d0e74[_0xe5ed('0x6')]===_0xe5ed('0x7')?_0x5d0e74[_0xe5ed('0x8')]:_0x5d0e74['uniqueid'],_0x5d0e74['type']));utils[_0xe5ed('0x9')]('CreateVoiceTransferReport',_0x5d0e74);}exports['blinds']={};exports[_0xe5ed('0xa')]=function(_0x1374bf){try{utils[_0xe5ed('0xb')](util[_0xe5ed('0x4')](_0xe5ed('0xc'),_0x1374bf['uniqueid']),_0x1374bf);utils[_0xe5ed('0x3')](util[_0xe5ed('0x4')](_0xe5ed('0xd'),_0x1374bf[_0xe5ed('0xe')],_0x1374bf[_0xe5ed('0xf')],_0x1374bf[_0xe5ed('0x10')],_0x1374bf[_0xe5ed('0x11')],_0x1374bf['transfereecalleridname']));_0x1374bf[_0xe5ed('0x6')]=_0xe5ed('0x12');exports[_0xe5ed('0x13')][_0x1374bf[_0xe5ed('0x14')]]=_0x1374bf;writeDB(_0x1374bf);}catch(_0x5c52ff){utils['error'](util[_0xe5ed('0x4')](_0xe5ed('0xc'),_0x1374bf[_0xe5ed('0xe')]),_0x5c52ff);}};exports[_0xe5ed('0x15')]=function(_0xd258e1){try{utils[_0xe5ed('0xb')](util[_0xe5ed('0x4')](_0xe5ed('0x16'),_0xd258e1[_0xe5ed('0x8')]),_0xd258e1);utils[_0xe5ed('0x3')](util[_0xe5ed('0x4')](_0xe5ed('0x17'),_0xd258e1['origtransfereruniqueid'],_0xd258e1[_0xe5ed('0x18')],_0xd258e1[_0xe5ed('0x19')],_0xd258e1[_0xe5ed('0x1a')],_0xd258e1['transfertargetcalleridname']));_0xd258e1=_[_0xe5ed('0x1b')](_0xd258e1,{'transfererchannel':_0xd258e1['origtransfererchannel'],'transferercalleridnum':_0xd258e1[_0xe5ed('0x18')],'transferercalleridname':_0xd258e1[_0xe5ed('0x19')],'transfererconnectedlinenum':_0xd258e1[_0xe5ed('0x1c')],'transfererconnectedlinename':_0xd258e1[_0xe5ed('0x1d')],'transfereraccountcode':_0xd258e1[_0xe5ed('0x1e')],'transferercontext':_0xd258e1[_0xe5ed('0x1f')],'transfererexten':_0xd258e1['secondtransfererexten'],'transfererlinkedid':_0xd258e1['origtransfererlinkedid'],'context':_0xd258e1['origtransferercontext'],'extension':_0xd258e1[_0xe5ed('0x20')],'type':_0xe5ed('0x7')});if(_[_0xe5ed('0x21')](_0xd258e1['transfereechannel'])){_0xd258e1=_[_0xe5ed('0x1b')](_0xd258e1,{'transfereechannel':_0xd258e1[_0xe5ed('0x22')],'transfereecalleridnum':_0xd258e1[_0xe5ed('0x1a')],'transfereecalleridname':_0xd258e1[_0xe5ed('0x23')],'transfereeconnectedlinenum':_0xd258e1[_0xe5ed('0x24')],'transfereeconnectedlinename':_0xd258e1[_0xe5ed('0x25')],'transfereeaccountcode':_0xd258e1[_0xe5ed('0x26')],'transfereecontext':_0xd258e1[_0xe5ed('0x27')],'transfereeexten':_0xd258e1['transfertargetexten'],'transfereelinkedid':_0xd258e1[_0xe5ed('0x28')]});}writeDB(_0xd258e1);}catch(_0x893325){utils[_0xe5ed('0x29')](util[_0xe5ed('0x4')]('[%s][transfers][attendedtransfer]',_0xd258e1['origtransfereruniqueid']),_0x893325);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 4e1415f..d2a59c8 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 _0xf072=['[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','subtractTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf072,0x131));var _0x2f07=function(_0x1c6601,_0x44e8e4){_0x1c6601=_0x1c6601-0x0;var _0x1d4bf0=_0xf072[_0x1c6601];return _0x1d4bf0;};'use strict';var BPromise=require(_0x2f07('0x0'));var jayson=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var util=require(_0x2f07('0x3'));var client=jayson['client'][_0x2f07('0x4')]({'port':0x2329});var logger=require(_0x2f07('0x5'))('xdr');exports[_0x2f07('0x6')]=function(_0x408284,_0x50464f){logger[_0x2f07('0x6')](_0x408284,_0x50464f?util[_0x2f07('0x7')](_0x50464f,{'showHidden':![],'depth':null}):'');};exports[_0x2f07('0x8')]=function(_0x4823a2,_0x59dae5){logger['debug'](_0x4823a2,_0x59dae5?util[_0x2f07('0x7')](_0x59dae5,{'showHidden':![],'depth':null}):'');};exports[_0x2f07('0x9')]=function(_0x58e366,_0x38e70a){logger['error'](_0x58e366,_0x38e70a?util[_0x2f07('0x7')](_0x38e70a,{'showHidden':![],'depth':null}):'');};exports[_0x2f07('0xa')]=function(_0x1f5271,_0x247c1c){return client[_0x2f07('0xa')](_0x1f5271,{'body':_0x247c1c})[_0x2f07('0xb')](function(_0x2dd69c){logger['debug'](_0x2f07('0xc'),_0x1f5271,_0x2dd69c?util[_0x2f07('0x7')](_0x2dd69c,{'showHidden':![],'depth':null}):'');})[_0x2f07('0xd')](function(_0x4e09aa){logger[_0x2f07('0x9')](_0x2f07('0xc'),_0x1f5271,_0x4e09aa?util['inspect'](_0x4e09aa,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4d1d18){return client['request'](_0x2f07('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x2f07('0xf'),_0x2f07('0x10')],'where':_0x4d1d18,'limit':0x1}})[_0x2f07('0xb')](function(_0x5c44b6){logger[_0x2f07('0x8')](_0x2f07('0x11'),JSON[_0x2f07('0x12')](_0x4d1d18),_0x5c44b6?util[_0x2f07('0x7')](_0x5c44b6,{'showHidden':![],'depth':null}):'');return _0x5c44b6[_0x2f07('0x13')][_0x2f07('0x14')]?_0x5c44b6['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x53e69e){return new BPromise(function(_0x485c60,_0x473553){if(_0x53e69e){return getUser({'internal':_0x53e69e})[_0x2f07('0xb')](function(_0x41cf1a){logger[_0x2f07('0x6')](_0x2f07('0x15'),_0x53e69e,_0x41cf1a?_0x2f07('0x16'):_0x2f07('0x17'));return _0x485c60(_0x41cf1a);})[_0x2f07('0xd')](function(_0x14f489){logger[_0x2f07('0x9')](_0x2f07('0x18'),_0x14f489?util[_0x2f07('0x7')](_0x14f489,{'showHidden':![],'depth':null}):'');return _0x485c60(null);});}return _0x485c60(null);});};exports[_0x2f07('0x19')]=function(_0x2bc0dc){return new BPromise(function(_0x111c38,_0x458f59){if(_0x2bc0dc){return getUser({'interface':_0x2bc0dc})['then'](function(_0x52b95c){logger[_0x2f07('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x2bc0dc,_0x52b95c?'found':_0x2f07('0x17'));return _0x111c38(_0x52b95c);})[_0x2f07('0xd')](function(_0x3e71fb){logger[_0x2f07('0x9')](_0x2f07('0x1a'),_0x3e71fb?util[_0x2f07('0x7')](_0x3e71fb,{'showHidden':![],'depth':null}):'');return _0x111c38(null);});}return _0x111c38(null);});};exports[_0x2f07('0x1b')]=function(_0x302562){return new BPromise(function(_0x40d8ea,_0x1e78b3){if(_0x302562){return getUser({'name':_0x302562})[_0x2f07('0xb')](function(_0x256cfb){logger[_0x2f07('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x302562,_0x256cfb?_0x2f07('0x16'):_0x2f07('0x17'));return _0x40d8ea(_0x256cfb);})['catch'](function(_0x59131f){logger[_0x2f07('0x9')](_0x2f07('0x1c'),_0x59131f?util[_0x2f07('0x7')](_0x59131f,{'showHidden':![],'depth':null}):'');return _0x40d8ea(null);});}return _0x40d8ea(null);});};exports[_0x2f07('0x1d')]=function(_0xef6142){return new BPromise(function(_0x57b5ec,_0x5af773){if(_0xef6142){return client[_0x2f07('0xa')](_0x2f07('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x2f07('0xf'),_0x2f07('0x1f'),'acw','acwTimeout'],'where':{'name':_0xef6142},'limit':0x1}})[_0x2f07('0xb')](function(_0x1c06ff){logger['debug'](_0x2f07('0x20'),_0xef6142,_0x1c06ff?util['inspect'](_0x1c06ff,{'showHidden':![],'depth':null}):'');logger[_0x2f07('0x6')](_0x2f07('0x21'),_0xef6142,_0x1c06ff?_0x2f07('0x16'):'notfound');return _0x57b5ec(_0x1c06ff['result'][_0x2f07('0x14')]?_0x1c06ff[_0x2f07('0x13')][0x0]:null);})[_0x2f07('0xd')](function(_0x5cfd9e){logger[_0x2f07('0x9')](_0x2f07('0x22'),_0x5cfd9e?util['inspect'](_0x5cfd9e,{'showHidden':![],'depth':null}):'');return _0x57b5ec(null);});}return _0x57b5ec(null);});};exports['addTime']=function(_0x4b0fea,_0x417fdf){return moment(_0x4b0fea)[_0x2f07('0x23')](_0x417fdf,_0x2f07('0x24'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x2f07('0x25')]=function(_0x475043,_0x2dddb9){return moment(_0x475043)[_0x2f07('0x26')](_0x2dddb9,_0x2f07('0x24'))[_0x2f07('0x27')](_0x2f07('0x28'));};exports[_0x2f07('0x29')]=function(_0xd4838c,_0x59b700){return moment(_0xd4838c)[_0x2f07('0x2a')](moment(_0x59b700),_0x2f07('0x24'));};exports['sumTime']=function(_0x57f818,_0x1f8861){return parseInt(_0x57f818,0xa)+parseInt(_0x1f8861,0xa);};exports[_0x2f07('0x2b')]=function(){return moment()['format'](_0x2f07('0x28'));};exports[_0x2f07('0x2c')]=function(_0x1b77e9,_0x31b42e){if(_0x31b42e){return moment(_0x1b77e9)['isAfter'](_0x31b42e);}return!![];};exports['isBefore']=function(_0x535b0e,_0x363478){if(_0x363478){return moment(_0x535b0e)[_0x2f07('0x2d')](_0x363478);}else if(_0x535b0e){return!![];}return![];}; \ No newline at end of file +var _0x9c0b=['found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','getVoiceQueueByName','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','diff','isAfter','isBefore','bluebird','jayson/promise','util','client','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal'];(function(_0x16d345,_0x13c7c8){var _0x293935=function(_0x307dbd){while(--_0x307dbd){_0x16d345['push'](_0x16d345['shift']());}};_0x293935(++_0x13c7c8);}(_0x9c0b,0xc8));var _0xb9c0=function(_0xd6640b,_0x475e47){_0xd6640b=_0xd6640b-0x0;var _0x4c843e=_0x9c0b[_0xd6640b];return _0x4c843e;};'use strict';var BPromise=require(_0xb9c0('0x0'));var jayson=require(_0xb9c0('0x1'));var moment=require('moment');var util=require(_0xb9c0('0x2'));var client=jayson[_0xb9c0('0x3')]['http']({'port':0x2329});var logger=require(_0xb9c0('0x4'))('xdr');exports[_0xb9c0('0x5')]=function(_0x2a461a,_0x30068b){logger['info'](_0x2a461a,_0x30068b?util[_0xb9c0('0x6')](_0x30068b,{'showHidden':![],'depth':null}):'');};exports[_0xb9c0('0x7')]=function(_0x2c3272,_0x4556dc){logger[_0xb9c0('0x7')](_0x2c3272,_0x4556dc?util[_0xb9c0('0x6')](_0x4556dc,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x21b5ba,_0x3273ba){logger[_0xb9c0('0x8')](_0x21b5ba,_0x3273ba?util[_0xb9c0('0x6')](_0x3273ba,{'showHidden':![],'depth':null}):'');};exports[_0xb9c0('0x9')]=function(_0x4310a2,_0x126fee){return client[_0xb9c0('0x9')](_0x4310a2,{'body':_0x126fee})[_0xb9c0('0xa')](function(_0x3ccf17){logger[_0xb9c0('0x7')](_0xb9c0('0xb'),_0x4310a2,_0x3ccf17?util[_0xb9c0('0x6')](_0x3ccf17,{'showHidden':![],'depth':null}):'');})[_0xb9c0('0xc')](function(_0x17973f){logger['error'](_0xb9c0('0xb'),_0x4310a2,_0x17973f?util[_0xb9c0('0x6')](_0x17973f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2194c1){return client[_0xb9c0('0x9')](_0xb9c0('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0xb9c0('0xe'),_0xb9c0('0xf')],'where':_0x2194c1,'limit':0x1}})[_0xb9c0('0xa')](function(_0x550e02){logger['debug'](_0xb9c0('0x10'),JSON[_0xb9c0('0x11')](_0x2194c1),_0x550e02?util[_0xb9c0('0x6')](_0x550e02,{'showHidden':![],'depth':null}):'');return _0x550e02[_0xb9c0('0x12')]['length']?_0x550e02[_0xb9c0('0x12')][0x0]:null;});}exports[_0xb9c0('0x13')]=function(_0x106369){return new BPromise(function(_0x2fd9ad,_0x2bb45b){if(_0x106369){return getUser({'internal':_0x106369})[_0xb9c0('0xa')](function(_0x3b33cf){logger[_0xb9c0('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x106369,_0x3b33cf?_0xb9c0('0x14'):'notfound');return _0x2fd9ad(_0x3b33cf);})[_0xb9c0('0xc')](function(_0x2390fc){logger[_0xb9c0('0x8')](_0xb9c0('0x15'),_0x2390fc?util[_0xb9c0('0x6')](_0x2390fc,{'showHidden':![],'depth':null}):'');return _0x2fd9ad(null);});}return _0x2fd9ad(null);});};exports[_0xb9c0('0x16')]=function(_0x4cae21){return new BPromise(function(_0x4c45ce,_0x3c10c6){if(_0x4cae21){return getUser({'interface':_0x4cae21})[_0xb9c0('0xa')](function(_0x1dbec3){logger['info'](_0xb9c0('0x17'),_0x4cae21,_0x1dbec3?'found':'notfound');return _0x4c45ce(_0x1dbec3);})[_0xb9c0('0xc')](function(_0xc26998){logger[_0xb9c0('0x8')]('[utils][getUserByInterface]',_0xc26998?util[_0xb9c0('0x6')](_0xc26998,{'showHidden':![],'depth':null}):'');return _0x4c45ce(null);});}return _0x4c45ce(null);});};exports[_0xb9c0('0x18')]=function(_0x1eaa30){return new BPromise(function(_0xf786ab,_0x58c989){if(_0x1eaa30){return getUser({'name':_0x1eaa30})[_0xb9c0('0xa')](function(_0x1eb64e){logger[_0xb9c0('0x5')](_0xb9c0('0x19'),_0x1eaa30,_0x1eb64e?_0xb9c0('0x14'):_0xb9c0('0x1a'));return _0xf786ab(_0x1eb64e);})[_0xb9c0('0xc')](function(_0x2b1558){logger[_0xb9c0('0x8')](_0xb9c0('0x1b'),_0x2b1558?util[_0xb9c0('0x6')](_0x2b1558,{'showHidden':![],'depth':null}):'');return _0xf786ab(null);});}return _0xf786ab(null);});};exports[_0xb9c0('0x1c')]=function(_0x4ddd29){return new BPromise(function(_0x4b5cbb,_0x3e1d05){if(_0x4ddd29){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xb9c0('0xe'),_0xb9c0('0x1d'),'acw','acwTimeout'],'where':{'name':_0x4ddd29},'limit':0x1}})[_0xb9c0('0xa')](function(_0xd1a6cf){logger[_0xb9c0('0x7')](_0xb9c0('0x1e'),_0x4ddd29,_0xd1a6cf?util[_0xb9c0('0x6')](_0xd1a6cf,{'showHidden':![],'depth':null}):'');logger['info'](_0xb9c0('0x1f'),_0x4ddd29,_0xd1a6cf?_0xb9c0('0x14'):_0xb9c0('0x1a'));return _0x4b5cbb(_0xd1a6cf['result'][_0xb9c0('0x20')]?_0xd1a6cf[_0xb9c0('0x12')][0x0]:null);})[_0xb9c0('0xc')](function(_0x277ccd){logger[_0xb9c0('0x8')](_0xb9c0('0x21'),_0x277ccd?util[_0xb9c0('0x6')](_0x277ccd,{'showHidden':![],'depth':null}):'');return _0x4b5cbb(null);});}return _0x4b5cbb(null);});};exports[_0xb9c0('0x22')]=function(_0xf29a60,_0x485756){return moment(_0xf29a60)[_0xb9c0('0x23')](_0x485756,_0xb9c0('0x24'))['format'](_0xb9c0('0x25'));};exports[_0xb9c0('0x26')]=function(_0x3ac35a,_0x33b62f){return moment(_0x3ac35a)['subtract'](_0x33b62f,_0xb9c0('0x24'))[_0xb9c0('0x27')](_0xb9c0('0x25'));};exports[_0xb9c0('0x28')]=function(_0x41c4cd,_0x1c8e1e){return moment(_0x41c4cd)[_0xb9c0('0x29')](moment(_0x1c8e1e),_0xb9c0('0x24'));};exports['sumTime']=function(_0x173fbd,_0x266271){return parseInt(_0x173fbd,0xa)+parseInt(_0x266271,0xa);};exports['now']=function(){return moment()[_0xb9c0('0x27')](_0xb9c0('0x25'));};exports['isAfter']=function(_0x27c1a0,_0x29697b){if(_0x29697b){return moment(_0x27c1a0)[_0xb9c0('0x2a')](_0x29697b);}return!![];};exports[_0xb9c0('0x2b')]=function(_0x3b4030,_0x49cfa9){if(_0x49cfa9){return moment(_0x3b4030)['isBefore'](_0x49cfa9);}else if(_0x3b4030){return!![];}return![];}; \ No newline at end of file -- 1.7.1